Jonne Valola / PokittoLib Featured

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!

Files at this revision

API Documentation at this revision

Comitter:
Pokitto
Date:
Sun Jul 01 06:32:10 2018 +0000
Parent:
50:ca94812a17b6
Child:
52:c04087025cab
Commit message:
PokittoCookie and faster Mode2 and Mode13 added

Changed in this revision

POKITTO_CORE/GBcompatibility.h Show diff for this revision Revisions of this file
POKITTO_CORE/Macros_LCD.h Show annotated file Show diff for this revision Revisions of this file
POKITTO_CORE/PokittoBacklight.cpp Show diff for this revision Revisions of this file
POKITTO_CORE/PokittoBacklight.h Show diff for this revision Revisions of this file
POKITTO_CORE/PokittoBattery.cpp Show diff for this revision Revisions of this file
POKITTO_CORE/PokittoBattery.h Show diff for this revision Revisions of this file
POKITTO_CORE/PokittoButtons.cpp Show diff for this revision Revisions of this file
POKITTO_CORE/PokittoButtons.h Show diff for this revision Revisions of this file
POKITTO_CORE/PokittoConsole.cpp Show diff for this revision Revisions of this file
POKITTO_CORE/PokittoConsole.h Show diff for this revision Revisions of this file
POKITTO_CORE/PokittoCookie.cpp Show annotated file Show diff for this revision Revisions of this file
POKITTO_CORE/PokittoCookie.h Show annotated file Show diff for this revision Revisions of this file
POKITTO_CORE/PokittoCore.cpp Show diff for this revision Revisions of this file
POKITTO_CORE/PokittoCore.h Show diff for this revision Revisions of this file
POKITTO_CORE/PokittoDisk.cpp Show diff for this revision Revisions of this file
POKITTO_CORE/PokittoDisk.h Show diff for this revision Revisions of this file
POKITTO_CORE/PokittoDisplay.cpp Show diff for this revision Revisions of this file
POKITTO_CORE/PokittoDisplay.h Show diff for this revision Revisions of this file
POKITTO_CORE/PokittoFakeavr.h Show diff for this revision Revisions of this file
POKITTO_CORE/PokittoFonts.h Show diff for this revision Revisions of this file
POKITTO_CORE/PokittoGlobs.h Show diff for this revision Revisions of this file
POKITTO_CORE/PokittoItoa.cpp Show diff for this revision Revisions of this file
POKITTO_CORE/PokittoItoa.h Show diff for this revision Revisions of this file
POKITTO_CORE/PokittoLogos.cpp Show diff for this revision Revisions of this file
POKITTO_CORE/PokittoLogos.h Show diff for this revision Revisions of this file
POKITTO_CORE/PokittoPalette.cpp Show diff for this revision Revisions of this file
POKITTO_CORE/PokittoPalettes.h Show diff for this revision Revisions of this file
POKITTO_CORE/PokittoSound.cpp Show diff for this revision Revisions of this file
POKITTO_CORE/PokittoSound.h Show diff for this revision Revisions of this file
POKITTO_CORE/PokittoTimer.h Show diff for this revision Revisions of this file
POKITTO_CORE/binary.h Show diff for this revision Revisions of this file
POKITTO_HW/HWButtons.cpp Show diff for this revision Revisions of this file
POKITTO_HW/HWButtons.h Show diff for this revision Revisions of this file
POKITTO_HW/HWLCD.cpp Show annotated file Show diff for this revision Revisions of this file
POKITTO_HW/HWLCD.h Show diff for this revision Revisions of this file
POKITTO_HW/HWSound.cpp Show diff for this revision Revisions of this file
POKITTO_HW/HWSound.h Show diff for this revision Revisions of this file
POKITTO_HW/PokittoClock.cpp Show diff for this revision Revisions of this file
POKITTO_HW/PokittoEEPROM.h Show diff for this revision Revisions of this file
POKITTO_HW/PokittoHW.cpp Show diff for this revision Revisions of this file
POKITTO_HW/Pokitto_extport.cpp Show diff for this revision Revisions of this file
POKITTO_HW/Pokitto_extport.h Show diff for this revision Revisions of this file
POKITTO_HW/SoftwareI2C.cpp Show diff for this revision Revisions of this file
POKITTO_HW/SoftwareI2C.h Show diff for this revision Revisions of this file
POKITTO_HW/clock_11u6x.c Show diff for this revision Revisions of this file
POKITTO_HW/clock_11u6x.h Show diff for this revision Revisions of this file
POKITTO_HW/dma_11u6x.c Show diff for this revision Revisions of this file
POKITTO_HW/dma_11u6x.h Show diff for this revision Revisions of this file
POKITTO_HW/iap.cpp Show diff for this revision Revisions of this file
POKITTO_HW/iap.h Show diff for this revision Revisions of this file
POKITTO_HW/loader.h Show diff for this revision Revisions of this file
POKITTO_HW/lpc_defs.h Show diff for this revision Revisions of this file
POKITTO_HW/lpc_types.h Show diff for this revision Revisions of this file
POKITTO_HW/sys_config.h Show diff for this revision Revisions of this file
POKITTO_HW/timer_11u6x.c Show diff for this revision Revisions of this file
POKITTO_HW/timer_11u6x.h Show diff for this revision Revisions of this file
libpff/connect.h Show diff for this revision Revisions of this file
libpff/diskio.h Show diff for this revision Revisions of this file
libpff/integer.h Show diff for this revision Revisions of this file
libpff/mmc.cpp Show diff for this revision Revisions of this file
libpff/pff.cpp Show diff for this revision Revisions of this file
libpff/pff.h Show diff for this revision Revisions of this file
--- a/POKITTO_CORE/GBcompatibility.h	Wed Jun 27 13:14:54 2018 +0000
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,184 +0,0 @@
-#ifndef GBCOMPATIBILITY_H
-#define GBCOMPATIBILITY_H
-
-/*
- * (C) Copyright 2014 Aurélien Rodot. All rights reserved.
- *
- * This file is part of the Gamebuino Library (http://gamebuino.com)
- *
- * The Gamebuino Library is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License as published by
- * the Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public License
- * along with this program.  If not, see <http://www.gnu.org/licenses/>
- */
-
-
-
-#ifndef SETTINGS_C
-#define	SETTINGS_C
-
-#include "binary.h"
-
-#define _BV(bit) (1 << (bit)) //jonne
-
-#define NOROT 0
-#define ROTCCW 1
-#define ROT180 2
-#define ROTCW 3
-
-//colors
-#define WHITE 0
-#define BLACK 1
-#define GRAY 2
-#define INVERT 255
-
-//for extended bitmap function :
-#define NOROT 0
-#define ROTCCW 1
-#define ROT180 2
-#define ROTCW 3
-#define NOFLIP 0
-#define FLIPH 1
-#define FLIPV 2
-#define FLIPVH 3
-
-
-
-
-//SETTINGS YOU CAN EDIT
-
-#define NUM_CHANNELS 1 //number of sound channels, between 0 and 4
-#define DISPLAY_ROT NOROT //set to NOROT, ROTCCW, ROT180 or ROTCW. Can be used to play in portrait mode.
-#define ENABLE_GUI 1 //enable menu, keyboard, pop-up, volume adjust functions
-#define ENABLE_BITMAPS 1 //will replace bitmaps with rectangles if disabled
-#define ENABLE_GRAYSCALE 1 //allows the use of the GRAY color
-#define EXTENDED_NOTE_RANGE 0 //allows the use of notes above A 5... please avoid that they sound really bad
-
-//not really useful
-#define ENABLE_BATTERY 0 //disable battery monitoring
-#define ENABLE_BACKLIGHT 0 //disable automatic back-light
-
-//IT'S STRONGLY ADVISED TO LEAVE THE FOLLOWING SETTINGS ALONE
-
-//defaults values of settings which can be adjusted on each Gamebuino using settings.hex
-#define SCR_CONTRAST 60
-#define START_MENU_TIMER 255 //40 = 40 frames (2sec) before start menu is skipped, 0 = no start menu, 255 = start menu until you press A
-
-//addresses of settings stored in the program memory
-#define SETTINGS_PAGE ((const char *)(0x7800-128))
-#define SETTINGS_TOKEN 			0xC001
-#define OFFSET_CURRENTGAME		2
-#define OFFSET_USERNAME			11
-#define USERNAME_LENGTH			10
-#define OFFSET_CONTRAST			22
-#define OFFSET_BACKLIGHT_MIN	23
-#define OFFSET_BACKLIGHT_MAX	24
-#define OFFSET_LIGHT_MIN		25
-#define OFFSET_LIGHT_MAX		27
-#define OFFSET_VOLUME_MAX		29
-#define OFFSET_VOLUME_DEFAULT	30
-#define OFFSET_START_MENU_TIMER	31
-#define OFFSET_BATTERY_CRITIC	32
-#define OFFSET_BATTERY_LOW		34
-#define OFFSET_BATTERY_MED		36
-#define OFFSET_BATTERY_FULL		38
-
-//GUI
-#define KEYBOARD_W 16
-#define KEYBOARD_H 8
-
-//sound
-#define VOLUME_CHANNEL_MAX 255/NUM_CHANNELS/7/9 //7=instrument volume 9=note volume
-
-//battery voltage monitor
-#define BAT_PIN 6 //was A6
-#define NUM_LVL 4
-#define BAT_LVL_CRITIC  3500
-#define BAT_LVL_LOW		3550
-#define BAT_LVL_MED		3700
-#define BAT_LVL_FULL	3900
-
-//SD card
-#define SD_CS 10
-
-//screens back light
-#define BACKLIGHT_PIN 5
-//auto back-light levels
-#define BACKLIGHT_MIN 0
-#define BACKLIGHT_MAX 255
-
-//ambient light sensor
-#define AMBIENTLIGHT_PIN A7
-//auto back-light levels
-#define AMBIENTLIGHT_MIN 800 //800
-#define AMBIENTLIGHT_MAX 980 //1000
-#define AMBIENTLIGHT_SMOOTHING 16
-
-//number of buttons
-#define NUM_BTN         7
-//buttons ID
-#if DISPLAY_ROT == 0
-	#define BTN_UP      1
-	#define BTN_RIGHT   2
-	#define BTN_DOWN    3
-	#define BTN_LEFT    0
-#elif DISPLAY_ROT == ROTCCW
-	#define BTN_UP      2
-	#define BTN_RIGHT   3
-	#define BTN_DOWN    0
-	#define BTN_LEFT    1
-#elif DISPLAY_ROT == ROT180
-	#define BTN_UP      3
-	#define BTN_RIGHT   0
-	#define BTN_DOWN    1
-	#define BTN_LEFT    2
-#elif DISPLAY_ROT == ROTCW
-	#define BTN_UP      0
-	#define BTN_RIGHT   1
-	#define BTN_DOWN    2
-	#define BTN_LEFT    3
-#endif
-#define BTN_A           4
-#define BTN_B           5
-#define BTN_C           6
-
-#define BTN_LEFT_PIN 0
-#define BTN_UP_PIN 1
-#define BTN_RIGHT_PIN 2
-#define BTN_DOWN_PIN 3
-#define BTN_A_PIN 4
-#define BTN_B_PIN 5
-#define BTN_C_PIN 6
-
-
-
-#endif /*  */
-
-const uint16_t startupSound[] = {0x0005,0x3089,0x208,0x238,0x7849,0x1468,0x0000};
-
-const uint8_t gamebuinoLogo[]  =
-{
-	84,10, //width and height
-	B00000011, B11100001, B10000001, B10000110, B01111111, B00111110, B00011000, B01101101, B10000011, B00001111, B00001111,
-	B00001110, B00000001, B10000011, B10000110, B01100000, B00110011, B00011000, B01101101, B11000011, B00011001, B10001111,
-	B00011000, B00000011, B11000011, B10001110, B01100000, B00110011, B00011000, B01101101, B11100011, B00110000, B11001111,
-	B00011000, B00000011, B11000011, B10011110, B01100000, B00110110, B00110000, B11001101, B11100011, B01100000, B11001111,
-	B00110000, B00000110, B11000111, B10011110, B01111110, B00111110, B00110000, B11001101, B10110011, B01100000, B11001111,
-	B00110000, B00001100, B11000110, B11110110, B01100000, B00110011, B00110000, B11011001, B10110110, B01100000, B11001111,
-	B00110011, B11001111, B11001100, B11110110, B01100000, B01100001, B10110000, B11011011, B00011110, B01100000, B11001111,
-	B00110000, B11011000, B01101100, B11100110, B11000000, B01100001, B10110000, B11011011, B00011110, B01100001, B10001111,
-	B00011001, B10011000, B01101100, B11000110, B11000000, B01100011, B10110001, B10011011, B00001110, B00110011, B00001111,
-	B00001111, B10110000, B01111000, B11000110, B11111111, B01111110, B00011111, B00011011, B00000110, B00011110, B00001111,
-};
-
-#endif // GBCOMPATIBILITY_H
-
-
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/POKITTO_CORE/Macros_LCD.h	Sun Jul 01 06:32:10 2018 +0000
@@ -0,0 +1,105 @@
+/**************************************************************************/
+/*!
+    @file     Macros_LCD.h
+    @author   Jonne Valola
+
+    @section LICENSE
+
+    Software License Agreement (BSD License)
+
+    Copyright (c) 2015, Jonne Valola
+    All rights reserved.
+
+    Redistribution and use in source and binary forms, with or without
+    modification, are permitted provided that the following conditions are met:
+    1. Redistributions of source code must retain the above copyright
+    notice, this list of conditions and the following disclaimer.
+    2. Redistributions in binary form must reproduce the above copyright
+    notice, this list of conditions and the following disclaimer in the
+    documentation and/or other materials provided with the distribution.
+    3. Neither the name of the copyright holders nor the
+    names of its contributors may be used to endorse or promote products
+    derived from this software without specific prior written permission.
+
+    THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS ''AS IS'' AND ANY
+    EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+    WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+    DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER BE LIABLE FOR ANY
+    DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+    (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+    LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+    ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+    (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+    SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+*/
+/**************************************************************************/
+
+#ifndef LCDMACROS_H
+#define LCDMACROS_H
+
+/**************************************************************************/
+/**                          PINS AND PORTS                              **/
+/**************************************************************************/
+
+#if POK_BOARDREV == 1
+/** 2-layer board version 1.3 **/
+ #define LCD_CD_PORT           0
+ #define LCD_CD_PIN            2
+ #define LCD_WR_PORT           1
+ #define LCD_WR_PIN            23
+ #define LCD_RD_PORT           1
+ #define LCD_RD_PIN            24
+ #define LCD_RES_PORT          1
+ #define LCD_RES_PIN           28
+#else
+/** 4-layer board version 2.1 **/
+ #define LCD_CD_PORT           0
+ #define LCD_CD_PIN            2
+ #define LCD_WR_PORT           1
+ #define LCD_WR_PIN            12
+ #define LCD_RD_PORT           1
+ #define LCD_RD_PIN            24
+ #define LCD_RES_PORT          1
+ #define LCD_RES_PIN           0
+#endif
+
+/**************************************************************************/
+/**                          LCD CONTROL MACROS                          **/
+/**************************************************************************/
+
+#define CLR_RESET LPC_GPIO_PORT->CLR[LCD_RES_PORT] = 1 << LCD_RES_PIN; //RST = (0); // Clear pin
+#define SET_RESET LPC_GPIO_PORT->SET[LCD_RES_PORT] = 1 << LCD_RES_PIN; // RST = (1); // Set pin
+
+#define CLR_CD  LPC_GPIO_PORT->CLR[LCD_CD_PORT] = 1 << LCD_CD_PIN; // RS = (0); // Clear pin
+#define SET_CD LPC_GPIO_PORT->SET[LCD_CD_PORT] = 1 << LCD_CD_PIN; // RS = (1); // Set pin
+
+#define CLR_WR { LPC_GPIO_PORT->CLR[LCD_WR_PORT] = 1 << LCD_WR_PIN; __asm("nop");}//WR = (0); // Clear pin
+#define SET_WR LPC_GPIO_PORT->SET[LCD_WR_PORT] = 1 << LCD_WR_PIN; //WR = (1); // Set pin
+
+#define CLR_RD LPC_GPIO_PORT->CLR[LCD_RD_PORT] = 1 << LCD_RD_PIN; //RD = (0); // Clear pin
+#define SET_RD LPC_GPIO_PORT->SET[LCD_RD_PORT] = 1 << LCD_RD_PIN; //RD = (1); // Set pin
+
+#define SET_CS  //CS tied to ground
+#define CLR_CS
+
+#define CLR_CS_CD_SET_RD_WR {CLR_CD; SET_RD; SET_WR;}
+#define CLR_CS_SET_CD_RD_WR {SET_CD; SET_RD; SET_WR;}
+#define SET_CD_RD_WR {SET_CD; SET_RD; SET_WR;}
+#define SET_WR_CS SET_WR;
+
+#define SET_MASK_P2 LPC_GPIO_PORT->MASK[2] = ~(0x7FFF8); //mask P2_3 ...P2_18
+#define CLR_MASK_P2 LPC_GPIO_PORT->MASK[2] = 0; // all on
+
+/**************************************************************************/
+/**                          OTHER MACROS                                **/
+/**************************************************************************/
+
+#define write_command w_cmd_16
+#define write_data w_data_16
+
+#define AB_JUMP 1024 // jump one 1-bit Arduboy screen forward to get next color bit
+#define GB_JUMP 504 // jump one 1-bit Gamebuino screen forward to get next color bit
+
+#endif // LCDMACROS_H
+
+
--- a/POKITTO_CORE/PokittoBacklight.cpp	Wed Jun 27 13:14:54 2018 +0000
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,59 +0,0 @@
-/**************************************************************************/
-/*!
-    @file     PokittoBacklight.cpp
-    @author   Jonne Valola
-
-    @section LICENSE
-
-    Software License Agreement (BSD License)
-
-    Copyright (c) 2016, Jonne Valola
-    All rights reserved.
-
-    Redistribution and use in source and binary forms, with or without
-    modification, are permitted provided that the following conditions are met:
-    1. Redistributions of source code must retain the above copyright
-    notice, this list of conditions and the following disclaimer.
-    2. Redistributions in binary form must reproduce the above copyright
-    notice, this list of conditions and the following disclaimer in the
-    documentation and/or other materials provided with the distribution.
-    3. Neither the name of the copyright holders nor the
-    names of its contributors may be used to endorse or promote products
-    derived from this software without specific prior written permission.
-
-    THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS ''AS IS'' AND ANY
-    EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
-    WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
-    DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER BE LIABLE FOR ANY
-    DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-    (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-    LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-    ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-    (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
-    SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-*/
-/**************************************************************************/
-
-#include "PokittoBacklight.h"
-
-using namespace Pokitto;
-
-bool Backlight::automatic;
-uint16_t Backlight::ambientLight;
-uint8_t Backlight::backlightValue;
-uint8_t Backlight::backlightMin, Backlight::backlightMax;
-uint16_t Backlight::ambientLightMin, Backlight::ambientLightMax;
-
-void Backlight::begin() {
-
-}
-
-void Backlight::set(uint8_t value) {
-
-}
-
-void Backlight::update() {
-
-}
-
-
--- a/POKITTO_CORE/PokittoBacklight.h	Wed Jun 27 13:14:54 2018 +0000
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,57 +0,0 @@
-/**************************************************************************/
-/*!
-    @file     PokittoBacklight.h
-    @author   Jonne Valola
-
-    @section LICENSE
-
-    Software License Agreement (BSD License)
-
-    Copyright (c) 2016, Jonne Valola
-    All rights reserved.
-
-    Redistribution and use in source and binary forms, with or without
-    modification, are permitted provided that the following conditions are met:
-    1. Redistributions of source code must retain the above copyright
-    notice, this list of conditions and the following disclaimer.
-    2. Redistributions in binary form must reproduce the above copyright
-    notice, this list of conditions and the following disclaimer in the
-    documentation and/or other materials provided with the distribution.
-    3. Neither the name of the copyright holders nor the
-    names of its contributors may be used to endorse or promote products
-    derived from this software without specific prior written permission.
-
-    THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS ''AS IS'' AND ANY
-    EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
-    WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
-    DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER BE LIABLE FOR ANY
-    DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-    (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-    LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-    ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-    (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
-    SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-*/
-/**************************************************************************/
-
-#ifndef POKITTO_BACKLIGHT
-#define POKITTO_BACKLIGHT
-
-#include <stdint.h>
-
-namespace Pokitto {
-class Backlight {
-public:
-    static void begin();
-    static void set(uint8_t value);
-    static void update();
-    static bool automatic;
-    static uint16_t ambientLight;
-    static uint8_t backlightValue;
-	static uint8_t backlightMin, backlightMax;
-	static uint16_t ambientLightMin, ambientLightMax;
-};
-}
-#endif // POKITTO_BACKLIGHT
-
-
--- a/POKITTO_CORE/PokittoBattery.cpp	Wed Jun 27 13:14:54 2018 +0000
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,69 +0,0 @@
-/**************************************************************************/
-/*!
-    @file     PokittoBattery.cpp
-    @author   Jonne Valola
-
-    @section LICENSE
-
-    Software License Agreement (BSD License)
-
-    Copyright (c) 2016, Jonne Valola
-    All rights reserved.
-
-    Redistribution and use in source and binary forms, with or without
-    modification, are permitted provided that the following conditions are met:
-    1. Redistributions of source code must retain the above copyright
-    notice, this list of conditions and the following disclaimer.
-    2. Redistributions in binary form must reproduce the above copyright
-    notice, this list of conditions and the following disclaimer in the
-    documentation and/or other materials provided with the distribution.
-    3. Neither the name of the copyright holders nor the
-    names of its contributors may be used to endorse or promote products
-    derived from this software without specific prior written permission.
-
-    THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS ''AS IS'' AND ANY
-    EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
-    WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
-    DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER BE LIABLE FOR ANY
-    DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-    (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-    LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-    ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-    (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
-    SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-*/
-/**************************************************************************/
-
-#include "PokittoBattery.h"
-
-using namespace Pokitto;
-
-bool Battery::show;
-uint8_t  Battery::level;
-uint16_t Battery::voltage;
-uint16_t Battery::thresholds[NUM_LVL];
-uint8_t  Battery::nextUpdate;
-
-#ifndef POK_SIM
-AnalogIn BatLevelPin(P0_23);
-#endif
-
-void Battery::begin() {
-	#ifndef POK_SIM
-    level = BatLevelPin * 0xFF;
-	#else
-	//ToDo - simulate the battery on the simulator
-	level = 0;
-	#endif
-}
-
-void Battery::update() {
-	#ifndef POK_SIM
-    //ToDo - make a real function
-    level = BatLevelPin * 0xFF;
-	#else
-	//ToDo - simulate the battery on the simulator
-	#endif
-}
-
-
--- a/POKITTO_CORE/PokittoBattery.h	Wed Jun 27 13:14:54 2018 +0000
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,63 +0,0 @@
-/**************************************************************************/
-/*!
-    @file     PokittoBattery.h
-    @author   Jonne Valola
-
-    @section LICENSE
-
-    Software License Agreement (BSD License)
-
-    Copyright (c) 2016, Jonne Valola
-    All rights reserved.
-
-    Redistribution and use in source and binary forms, with or without
-    modification, are permitted provided that the following conditions are met:
-    1. Redistributions of source code must retain the above copyright
-    notice, this list of conditions and the following disclaimer.
-    2. Redistributions in binary form must reproduce the above copyright
-    notice, this list of conditions and the following disclaimer in the
-    documentation and/or other materials provided with the distribution.
-    3. Neither the name of the copyright holders nor the
-    names of its contributors may be used to endorse or promote products
-    derived from this software without specific prior written permission.
-
-    THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS ''AS IS'' AND ANY
-    EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
-    WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
-    DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER BE LIABLE FOR ANY
-    DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-    (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-    LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-    ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-    (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
-    SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-*/
-/**************************************************************************/
-
-
-#ifndef POKITTOBATTERY_H
-#define POKITTOBATTERY_H
-
-#include <stdint.h>
-#include "Pokitto_settings.h"
-#include "GBcompatibility.h"
-#include "PokittoGlobs.h"
-
-
-namespace Pokitto {
-
-class Battery {
-public:
-    static void begin();
-    static void update();
-	static bool show;
-    static uint8_t  level;
-    static uint16_t voltage;
-    static uint16_t thresholds[NUM_LVL];
-    static uint8_t  nextUpdate;
-};
-}
-
-#endif //POKITTOBATTERY_H
-
-
--- a/POKITTO_CORE/PokittoButtons.cpp	Wed Jun 27 13:14:54 2018 +0000
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,263 +0,0 @@
-/**************************************************************************/
-/*!
-    @file     PokittoButtons.cpp
-    @author   Jonne Valola
-
-    @section LICENSE
-
-    Software License Agreement (BSD License)
-
-    Copyright (c) 2016, Jonne Valola
-    All rights reserved.
-
-    Redistribution and use in source and binary forms, with or without
-    modification, are permitted provided that the following conditions are met:
-    1. Redistributions of source code must retain the above copyright
-    notice, this list of conditions and the following disclaimer.
-    2. Redistributions in binary form must reproduce the above copyright
-    notice, this list of conditions and the following disclaimer in the
-    documentation and/or other materials provided with the distribution.
-    3. Neither the name of the copyright holders nor the
-    names of its contributors may be used to endorse or promote products
-    derived from this software without specific prior written permission.
-
-    THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS ''AS IS'' AND ANY
-    EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
-    WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
-    DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER BE LIABLE FOR ANY
-    DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-    (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-    LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-    ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-    (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
-    SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-*/
-/**************************************************************************/
-
-#include "PokittoCore.h"
-
-using namespace Pokitto;
-
-uint8_t Buttons::pins[NUM_BTN];
-uint8_t Buttons::states[NUM_BTN];
-uint8_t Buttons::buttons_state;
-uint8_t Buttons::buttons_held;
-uint8_t Buttons::buttons_released; // from LSB up,down,left,right,a,b,c
-uint16_t Buttons::cHWLongPress = CHWLONGPRESSTIMEOUT;
-
-
-void Buttons::begin() {
-    #ifndef POK_SIM
-    Pokitto::initButtons();
-    #endif // POK_SIM
-}
-
-void Buttons::update() {
-    #if POK_USE_CONSOLE
-    if (console.conscounter) return;
-    #endif // POK_USE_CONSOLE
-    #ifndef POK_SIM
-        /** HARDWARE CODE **/
-    for (uint8_t thisButton = 0; thisButton < NUM_BTN; thisButton++) {
-        if (Pokitto::heldStates[thisButton]) { //if button pressed
-            states[thisButton]++; //increase button hold time
-            if (states[thisButton]==0xFF) states[thisButton]=2; // PREVENT WRAPAROUND!!!!
-        } else {
-            if (states[thisButton] == 0)//button idle
-                continue;
-            if (states[thisButton] == 0xFF)//if previously released
-                states[thisButton] = 0; //set to idle
-            else
-                states[thisButton] = 0xFF; //button just released
-        }
-        }
-    #else
-        /** POK_SIM code **/
-        simulator.pollButtons();
-        for (uint8_t thisButton = 0; thisButton < NUM_BTN; thisButton++) {
-        uint8_t temp=0;
-        switch (thisButton) {
-        case 0:
-            temp = simulator.leftHeld(); break;
-        case 1:
-            temp = simulator.upHeld(); break;
-        case 2:
-            temp = simulator.rightHeld(); break;
-        case 3:
-            temp = simulator.downHeld(); break;
-        case 4:
-            temp = simulator.aHeld(); break;
-        case 5:
-            temp = simulator.bHeld(); break;
-        case 6:
-            temp = simulator.cHeld(); break;
-        default:
-            break;
-        }
-
-        if (temp == HIGH) { //if button pressed
-            states[thisButton]++; //increase button hold time
-            if (states[thisButton]==0xFF) states[thisButton] = 2; //prevent wraparound and retrigger
-        } else {
-            if (states[thisButton] == 0)//button idle
-                continue;
-            if (states[thisButton] == 0xFF)//if previously released
-                states[thisButton] = 0; //set to idle
-            else
-                states[thisButton] = 0xFF; //button just released
-        }
-        }
-
-        #endif // POK_SIM
-}
-
-/*
- * Returns true when 'button' is pressed.
- * The button has to be released for it to be triggered again.
- */
-bool Buttons::pressed(uint8_t button) {
-    if (states[button] == 1)
-        return true;
-    else
-        return false;
-}
-
-/*
- * return true if 'button' is released
- */
-bool Buttons::released(uint8_t button) {
-    if (states[button] == 0xFF)
-        return true;
-    else
-        return false;
-}
-
-/**
- * returns true ONCE when 'button' is held for 'time' frames
- * @param button The button's ID
- * @param time How much frames button must be held, between 1 and 254.
- * @return true when 'button' is held for 'time' frames
- */
-bool Buttons::held(uint8_t button, uint8_t time){
-    if(states[button] == (time+1))
-        return true;
-    else
-        return false;
-}
-
-/**
- * returns true every 'period' frames when 'button' is held
- * @param button The button's ID
- * @param period How much frames button must be held, between 1 and 254.
- * @return true if the button is held for the given time
- */
-bool Buttons::repeat(uint8_t button, uint8_t period) {
-    if (period <= 1) {
-        if ((states[button] != 0xFF) && (states[button]))
-            return true;
-    } else {
-        if ((states[button] != 0xFF) && ((states[button] % period) == 1))
-            return true;
-    }
-    return false;
-}
-
-/**
- *
- * @param button The button's ID
- * @return The number of frames during which the button has been held.
- */
-uint8_t Buttons::timeHeld(uint8_t button){
-    if(states[button] != 0xFF)
-        return states[button];
-    else
-        return 0;
-
-}
-
-void Buttons::pollButtons() {
-    #ifdef POK_SIM
-    simulator.pollButtons();
-    #else
-    uint8_t buttons_state_old = buttons_state;
-    buttons_state = 0; // clear all
-    if (upBtn()) buttons_state |= (1<<UPBIT);
-    if (downBtn()) buttons_state |= (1<<DOWNBIT);
-    if (leftBtn()) buttons_state |= (1<<LEFTBIT);
-    if (rightBtn()) buttons_state |= (1<<RIGHTBIT);
-    if (aBtn()) buttons_state |= (1<<ABIT);
-    if (bBtn()) buttons_state |= (1<<BBIT);
-    if (cBtn()) buttons_state |= (1<<CBIT);
-    buttons_held = buttons_state & buttons_state_old; // only if both 1, end result is 1
-    buttons_released = ~buttons_state & buttons_state_old; // if now zero, then 1 AND previous 1 = 1
-    #endif // POK_SIM
-}
-
-uint8_t Buttons::aBtn() {
-    #ifdef POK_SIM
-    return simulator.aBtn();
-    #else
-    return Pokitto::heldStates[BTN_A];
-    #endif // POK_SIM
-}
-
-
-uint8_t Buttons::bBtn() {
-    #ifdef POK_SIM
-    return simulator.bBtn();
-    #else
-    return Pokitto::heldStates[BTN_B];
-    #endif // POK_SIM
-}
-
-uint8_t Buttons::cBtn() {
-    uint8_t c;
-    #ifdef POK_SIM
-    c = simulator.cBtn();
-    #else
-    c = Pokitto::heldStates[BTN_C];
-    #endif // POK_SIM
-    return c;
-}
-
-uint8_t Buttons::leftBtn() {
-    #ifdef POK_SIM
-    return simulator.leftBtn();
-    #else
-    return Pokitto::heldStates[BTN_LEFT];
-    #endif // POK_SIM
-}
-
-uint8_t Buttons::rightBtn() {
-    #ifdef POK_SIM
-    return simulator.rightBtn();
-    #else
-    return Pokitto::heldStates[BTN_RIGHT];
-    #endif // POK_SIM
-}
-
-uint8_t Buttons::upBtn() {
-    #ifdef POK_SIM
-    return simulator.upBtn();
-    #else
-    return Pokitto::heldStates[BTN_UP];
-    #endif // POK_SIM
-}
-
-uint8_t Buttons::downBtn() {
-    #ifdef POK_SIM
-    return simulator.downBtn();
-    #else
-    return Pokitto::heldStates[BTN_DOWN];
-    #endif // POK_SIM
-}
-
-
-
-
-
-
-
-
-//** EOF **//
-
--- a/POKITTO_CORE/PokittoButtons.h	Wed Jun 27 13:14:54 2018 +0000
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,110 +0,0 @@
-/**************************************************************************/
-/*!
-    @file     PokittoButtons.h
-    @author   Jonne Valola
-
-    @section LICENSE
-
-    Software License Agreement (BSD License)
-
-    Copyright (c) 2016, Jonne Valola
-    All rights reserved.
-
-    Redistribution and use in source and binary forms, with or without
-    modification, are permitted provided that the following conditions are met:
-    1. Redistributions of source code must retain the above copyright
-    notice, this list of conditions and the following disclaimer.
-    2. Redistributions in binary form must reproduce the above copyright
-    notice, this list of conditions and the following disclaimer in the
-    documentation and/or other materials provided with the distribution.
-    3. Neither the name of the copyright holders nor the
-    names of its contributors may be used to endorse or promote products
-    derived from this software without specific prior written permission.
-
-    THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS ''AS IS'' AND ANY
-    EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
-    WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
-    DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER BE LIABLE FOR ANY
-    DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-    (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-    LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-    ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-    (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
-    SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-*/
-/**************************************************************************/
-
-
-#ifndef POKITTOBUTTONS_H
-#define POKITTOBUTTONS_H
-
-#include <stdint.h>
-#include "Pokitto_settings.h"
-#include "GBcompatibility.h"
-#include "PokittoGlobs.h"
-
-#ifndef POK_SIM
-    #include "HWButtons.h"
-    #define CHWLONGPRESSTIMEOUT 100
-#else
-    #include "PokittoSimulator.h"
-    #define CHWLONGPRESSTIMEOUT 1000
-#endif // POK_SIM
-
-
-namespace Pokitto {
-
-class Buttons {
-public:
-    // Original functions
-    static uint8_t buttons_state, buttons_held, buttons_released;
-    static void initButtons();
-    static void pollButtons();
-    static uint8_t leftBtn();
-    static uint8_t rightBtn();
-    static uint8_t upBtn();
-    static uint8_t downBtn();
-    static uint8_t aBtn();
-    static uint8_t bBtn();
-    static uint8_t cBtn();
-    static uint8_t leftHeld();
-    static uint8_t rightHeld();
-    static uint8_t upHeld();
-    static uint8_t downHeld();
-    static uint8_t aHeld();
-    static uint8_t bHeld();
-    static uint8_t cHeld();
-
-    static uint8_t leftReleased();
-    static uint8_t rightReleased();
-    static uint8_t upReleased();
-    static uint8_t downReleased();
-    static uint8_t aReleased();
-    static uint8_t bReleased();
-    static uint8_t cReleased();
-
-    // GB compatibility functions
-	static void begin();
-    static void update();
-    static bool pressed(uint8_t button);
-    static bool released(uint8_t button);
-    static bool held(uint8_t button, uint8_t time);
-    static bool repeat(uint8_t button, uint8_t period);
-    static uint8_t timeHeld(uint8_t button);
-    static uint8_t pins[NUM_BTN];
-    static uint8_t states[NUM_BTN];
-    static uint8_t heldStates[NUM_BTN]; // additional, not GB based
-private:
-    static uint16_t cHWLongPress; //forced hardware detection of C long press
-};
-
-}
-
-#endif // POKITTOBUTTONS_H
-
-
-
-
-
-
-
--- a/POKITTO_CORE/PokittoConsole.cpp	Wed Jun 27 13:14:54 2018 +0000
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,315 +0,0 @@
-/**************************************************************************/
-/*!
-    @file     PokittoConsole.cpp
-    @author   Jonne Valola
-
-    @section LICENSE
-
-    Software License Agreement (BSD License)
-
-    Copyright (c) 2016, Jonne Valola
-    All rights reserved.
-
-    Redistribution and use in source and binary forms, with or without
-    modification, are permitted provided that the following conditions are met:
-    1. Redistributions of source code must retain the above copyright
-    notice, this list of conditions and the following disclaimer.
-    2. Redistributions in binary form must reproduce the above copyright
-    notice, this list of conditions and the following disclaimer in the
-    documentation and/or other materials provided with the distribution.
-    3. Neither the name of the copyright holders nor the
-    names of its contributors may be used to endorse or promote products
-    derived from this software without specific prior written permission.
-
-    THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS ''AS IS'' AND ANY
-    EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
-    WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
-    DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER BE LIABLE FOR ANY
-    DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-    (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-    LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-    ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-    (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
-    SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-*/
-/**************************************************************************/
-
-#include "PokittoGlobs.h"
-#include "PokittoConsole.h"
-#include "PokittoFonts.h"
-#include "PokittoDisplay.h"
-
-Pokitto::Console pConsole;
-
-using namespace Pokitto;
-
-consmsg Console::msgbuf[CONSOLEBUFSIZE];
-uint8_t Console::conslast;
-uint8_t Console::consfirst;
-uint8_t Console::conspointer;
-uint16_t Console::conscounter;
-uint16_t Console::color;
-Display* Console::_display;
-uint8_t Console::mode;
-uint8_t Console::visible;
-unsigned char* Console::font;
-
-Console::Console() {
-    conslast=consfirst=conspointer=conscounter=0;
-    color=0xFFFF;
-    font=(unsigned char*)fontMini;
-    #if POK_CONSOLE_VISIBLE_AT_STARTUP > 0
-        mode=CONS_OVERLAY|CONS_VISIBLE;
-    #else
-        mode=CONS_OVERLAY;//|CONS_VISIBLE;
-    #endif
-}
-
-void Console::Toggle() {
-    if (!conscounter) // conscounter is a debounce feature for console toggle
-    {
-        mode ^= CONS_VISIBLE;
-        conscounter = CONS_TIMEOUT;
-    }
-}
-
-
-void Console::AddMessage(uint8_t source, uint8_t msgtype) {
-    AddMessage(source,msgtype, V_NONE,0);
-}
-
-
-void Console::AddMessage(uint8_t type, char* stringptr) {
-    AddMessage(MSOURCE_USER,type,V_STRING, (uint32_t) stringptr);
-}
-
-
-void Console::AddMessage(uint8_t msgtype, uint8_t valtype, uint32_t val) {
-    AddMessage(MSOURCE_USER,msgtype,valtype,val);
-}
-
-void Console::AddMessage(uint8_t source, uint8_t msgtype, uint8_t valtype, uint32_t val) {
-    consmsg c;
-    c.msgsource = source;
-    c.msgtype = msgtype;
-    c.valtype = valtype;
-    c.val = val;
-    msgbuf[conslast] = c;
-    conslast++;
-    if (conslast==CONSOLEBUFSIZE) conslast = 0; // wrap around the buffer
-    consfirst = conslast + 1;
-    if (consfirst == CONSOLEBUFSIZE) consfirst = 0;
-}
-
-void Console::Last() {
-    conspointer = conslast;
-}
-
-void Console::RemoveLast() {
-    Last();
-    Previous();
-    msgbuf[conspointer].msgsource = MSOURCE_USER;
-    msgbuf[conspointer].msgtype = MSG_OK;
-    msgbuf[conspointer].val = 0;
-    msgbuf[conspointer].valtype = 0;
-    conslast = conspointer;
-}
-
-void Console::First() {
-    consmsg c;
-    uint16_t outofbounds=0;
-    conspointer = consfirst;
-    c=GetMessage();
-    while (!c.msgsource) {
-        Next();
-        c=GetMessage();
-        outofbounds++;
-        if (outofbounds==CONSOLEBUFSIZE) {
-            conspointer = consfirst;
-            break;
-        }
-    }
-}
-
-void Console::Previous() {
-    if (conspointer==0) conspointer = CONSOLEBUFSIZE-1;
-    else conspointer--;
-}
-
-void Console::Next() {
-    if (conspointer==CONSOLEBUFSIZE-1) conspointer = 0;
-    else conspointer++;
-}
-
-consmsg Console::GetMessage() {
-    return msgbuf[conspointer];
-}
-
-void Console::PrintMessage() {
-    consmsg c = msgbuf[conspointer];
-    switch (c.msgsource) {
-    case MSOURCE_APP:
-        _display->print("App:");break;
-    case MSOURCE_BATT:
-        _display->print("Batt:");break;
-    case MSOURCE_BTNA:
-        _display->print("A:");break;
-    case MSOURCE_BTNB:
-        _display->print("B:");break;
-    case MSOURCE_BTNC:
-        _display->print("C:");break;
-    case MSOURCE_BTNU:
-        _display->print("Up:");break;
-    case MSOURCE_BTND:
-        _display->print("Down:");break;
-    case MSOURCE_BTNL:
-        _display->print("Left:");break;
-    case MSOURCE_BTNR:
-        _display->print("Right:");break;
-    case MSOURCE_LCD:
-        _display->print("LCD:");break;
-    case MSOURCE_SD:
-        _display->print("SD:");break;
-    case MSOURCE_SOUND:
-        _display->print("Sound:");break;
-    case MSOURCE_TIMER:
-        _display->print("Timer:");break;
-    case MSOURCE_USER:
-        _display->print("User:");break;
-    case MSOURCE_COLLISION:
-        _display->print("Hit:");break;
-    default:
-        return;
-        break;
-    }
-
-    switch (c.msgtype) {
-    case MSG_OK:
-        _display->print("OK ");break;
-    case MSG_INIT_OK:
-        _display->print("INIT OK ");break;
-    case MSG_INIT_FAIL:
-        _display->print("INIT FAIL ");break;
-    case MSG_WARNING:
-        _display->print("WARNING ");break;
-    case MSG_FATAL:
-        _display->print("FATAL ");break;
-    case MSG_GFX_MODE_CHANGE:
-        _display->print("MODE ");break;
-    case MSG_GFX_MODE_INVALID:
-        _display->print("INVALID!");break;
-    case MSG_NOT_ENOUGH_MEM:
-       _display->print("NOT ENOUGH MEM ");break;
-    case MSG_UP:
-        _display->print("KEYUP");break;
-    case MSG_DOWN:
-        _display->print("KEYDOWN");break;
-    case MSG_BREAK:
-        _display->print("BREAK ");break;
-    case MSG_YESNO:
-        _display->print("YES(A)/NO(B)");break;
-    case MSG_YES:
-        _display->print("YES");break;
-    case MSG_NO:
-        _display->print("NO");break;
-    case MSG_OBJECT:
-        _display->print("OBJ1: ");break;
-    case MSG_OBJECT2:
-        _display->print("OBJ2: ");break;
-    default:
-        _display->print(" ");
-    }
-
-    switch (c.valtype) {
-    case V_NONE:
-        _display->println();break;
-    case V_UINT8:
-        _display->println((uint16_t)c.val);break;
-    case V_INT8:
-        _display->println((int16_t)c.val);break;
-    case V_UINT16:
-        _display->println((uint16_t)c.val);break;
-    case V_INT16:
-        _display->println((int16_t)c.val);break;
-    case V_UINT32:
-        _display->println((uint32_t)c.val);break;
-    case V_INT32:
-        _display->println((int32_t)c.val);break;
-    case V_FLOAT:
-        _display->println((float)c.val);break;
-    case V_STRING:
-        _display->println((char*)c.val);break;
-    default:
-        _display->println();
-    }
-
-    if (c.msgtype == MSG_BREAK || c.msgtype == MSG_YESNO) {
-        #ifndef POK_SIM
-        __disable_irq();    // Disable Interrupts
-        #else
-        pauseAudio(1);
-        visible = false; // avoid loop in loop inside refreshDisplay
-        simulator.wait_ms(300);
-        #endif
-        int rval=0;
-        while(!rval) {
-                _buttons->pollButtons();
-                #ifdef POK_SIM
-                    simulator.refreshDisplay();
-                #endif // POK_SIM
-                if (_buttons->aBtn()) rval = 1;
-                if (_buttons->bBtn()) rval = -1;
-                }
-        /* now remove this message to prevent it from rerunning */
-        if (c.msgtype == MSG_YESNO) {
-            int8_t* v;
-            v = (int8_t*) c.val; //c.val is a pointer to the memory location that receives answer
-            *v = rval; // return value through pointer
-            msgbuf[conspointer].msgsource = MSOURCE_USER;
-            if (rval==1) msgbuf[conspointer].msgtype = MSG_YES;
-            else msgbuf[conspointer].msgtype = MSG_NO;
-        } else msgbuf[conspointer].msgsource = MSOURCE_NULL;
-
-        #ifndef POK_SIM
-        __enable_irq();     // Enable Interrupts
-        #else
-        pauseAudio(0);
-        visible = true;
-        #endif
-    }
-}
-
-void Console::Draw() {
-    unsigned char* oldfont;
-    int16_t oldx,oldy;
-    uint16_t oldcolor;
-    uint8_t oldsize;
-    bool oldenable;
-    oldfont = (unsigned char*) _display->font;
-    oldx = _display->cursorX;
-    oldy = _display->cursorY;
-    oldcolor = _display->directcolor;
-    oldsize = _display->fontSize;
-    if (!(mode & CONS_OVERLAY)) _display->clearLCD();
-    _display->setFont(font5x7);
-    _display->fontSize=1;
-    _display->setCursor(0,0);
-    _display->directcolor=color;
-    First();
-    while(conspointer!=conslast) {
-        PrintMessage();
-        Next();
-        if (GetMessage().msgsource==MSOURCE_NULL) break;
-    }
-    _display->font = oldfont;
-    _display->fontSize = oldsize;
-    _display->cursorX = oldx;
-    _display->cursorY = oldy;
-    _display->directcolor = oldcolor;
-}
-
-
-
-
-
-
--- a/POKITTO_CORE/PokittoConsole.h	Wed Jun 27 13:14:54 2018 +0000
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,161 +0,0 @@
-/**************************************************************************/
-/*!
-    @file     PokittoConsole.h
-    @author   Jonne Valola
-
-    @section LICENSE
-
-    Software License Agreement (BSD License)
-
-    Copyright (c) 2016, Jonne Valola
-    All rights reserved.
-
-    Redistribution and use in source and binary forms, with or without
-    modification, are permitted provided that the following conditions are met:
-    1. Redistributions of source code must retain the above copyright
-    notice, this list of conditions and the following disclaimer.
-    2. Redistributions in binary form must reproduce the above copyright
-    notice, this list of conditions and the following disclaimer in the
-    documentation and/or other materials provided with the distribution.
-    3. Neither the name of the copyright holders nor the
-    names of its contributors may be used to endorse or promote products
-    derived from this software without specific prior written permission.
-
-    THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS ''AS IS'' AND ANY
-    EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
-    WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
-    DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER BE LIABLE FOR ANY
-    DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-    (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-    LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-    ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-    (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
-    SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-*/
-/**************************************************************************/
-
-#ifndef POKITTO_CONSOLE_H
-#define POKITTO_CONSOLE_H
-
-#include "Pokitto_settings.h"
-#include "PokittoButtons.h"
-#include <stdint.h>
-
-struct consmsg {
-  uint32_t val;
-  uint8_t valtype;
-  uint8_t msgsource;
-  uint8_t msgtype;
-};
-
-/** VAL TYPES **/
-#define V_UINT8     0
-#define V_INT8      1
-#define V_UINT16    2
-#define V_INT16     3
-#define V_UINT32    4
-#define V_INT32     5
-#define V_FLOAT     6
-#define V_STRING    7
-#define V_NONE      8
-
-/** MESSAGE TYPE **/
-#define MSG_NULL        0
-#define MSG_OK          1
-#define MSG_WARNING     2
-#define MSG_FATAL       255
-#define MSG_INIT_OK     3
-#define MSG_INIT_FAIL   4
-#define MSG_NOT_ENOUGH_MEM  5
-#define MSG_GFX_MODE_CHANGE 6
-#define MSG_GFX_MODE_INVALID 7
-#define MSG_UP          8
-#define MSG_DOWN        9
-#define MSG_PRINT       10
-#define MSG_BREAK       11
-#define MSG_YESNO       12
-#define MSG_YES         13
-#define MSG_NO          14
-#define MSG_OBJECT      15
-#define MSG_OBJECT2     16
-
-/** MESSAGE SOURCE **/
-#define MSOURCE_NULL    0
-#define MSOURCE_SD      1
-#define MSOURCE_LCD     2
-#define MSOURCE_SOUND   3
-#define MSOURCE_TIMER   4
-#define MSOURCE_BTNA    5
-#define MSOURCE_BTNB    6
-#define MSOURCE_BTNC    7
-#define MSOURCE_BTNU    8
-#define MSOURCE_BTND    9
-#define MSOURCE_BTNL    10
-#define MSOURCE_BTNR    11
-#define MSOURCE_BATT    12
-#define MSOURCE_APP     13
-#define MSOURCE_USER    14
-#define MSOURCE_COLLISION 15
-
-/** CONSOLE MODES **/
-#define CONS_OVERLAY    0x1
-#define CONS_PAUSE      0x2
-#define CONS_STEP       0x4
-#define CONS_VISIBLE    0x8
-
-
-/** CONSOLE DEBOUNCE **/
-#define CONS_TIMEOUT   20
-extern uint16_t conscounter;
-
-
-
-namespace Pokitto {
-
-class Display;
-
-class Console {
-public:
-    /** Console class constructor */
-    Console();
-
-    static uint8_t mode;
-    static uint8_t visible;
-    static unsigned char* font;
-    static void Toggle();
-    static void AddMessage(uint8_t, uint8_t, uint8_t, uint32_t);
-    static void AddMessage(uint8_t, uint8_t);
-    static void AddMessage(uint8_t, char*);
-    static void AddMessage(uint8_t, uint8_t, uint32_t);
-    static void Last();
-    static void First();
-    static void RemoveLast();
-    static void Previous();
-    static void Next();
-    static consmsg GetMessage();
-    static void PrintMessage();
-    static void Purge();
-    static void Draw(); // pokConsole
-
-private:
-    /** Message buffer */
-    static consmsg msgbuf[CONSOLEBUFSIZE];
-    static uint8_t conslast;
-    static uint8_t consfirst;
-    static uint8_t conspointer;
-public:
-    static uint16_t conscounter;
-    static uint16_t color;
-    static Display* _display;
-    static Buttons* _buttons;
-};
-
-
-} // namespace
-
-// this is the console used by the core if POK_USE_CONSOLE is nonzero
-extern Pokitto::Console console;
-
-#endif // POKITTO_CONSOLE_H
-
-
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/POKITTO_CORE/PokittoCookie.cpp	Sun Jul 01 06:32:10 2018 +0000
@@ -0,0 +1,362 @@
+/**************************************************************************/
+/*!
+    @file     PokittoCookie.cpp
+    @author   Jonne Valola
+
+    @section LICENSE
+
+    Software License Agreement (BSD License)
+
+    Copyright (c) 2018, Jonne Valola
+    All rights reserved.
+
+    Redistribution and use in source and binary forms, with or without
+    modification, are permitted provided that the following conditions are met:
+    1. Redistributions of source code must retain the above copyright
+    notice, this list of conditions and the following disclaimer.
+    2. Redistributions in binary form must reproduce the above copyright
+    notice, this list of conditions and the following disclaimer in the
+    documentation and/or other materials provided with the distribution.
+    3. Neither the name of the copyright holders nor the
+    names of its contributors may be used to endorse or promote products
+    derived from this software without specific prior written permission.
+
+    THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS ''AS IS'' AND ANY
+    EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+    WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+    DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER BE LIABLE FOR ANY
+    DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+    (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+    LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+    ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+    (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+    SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+*/
+/**************************************************************************/
+
+#include "Pokitto_settings.h"
+#include "Pokitto.h"
+#include "PokittoCookie.h"
+
+#ifndef POK_SIM
+#else
+#include "PokittoSimulator.h"
+#endif
+
+using namespace Pokitto;
+
+//char Cookie::_key[SBKEYSIZE];
+//char Cookie::_keyorder;
+//bool Cookie::_status;
+
+#define HARDCODEDOFFSET 25 //bypasses Cookie parent instance general data (that does not need to be saved in EEPROM)
+
+Cookie::Cookie() {
+    _status = false;
+    _keyorder = SBINVALIDSLOT;
+}
+
+int Cookie::initialize() {
+    //initialize is called from begin() and can be called several times during program run
+    int datasize = _datasize;
+    // check if key already exists
+    _keyorder = exists(_key);
+    if (_keyorder < SBMAXKEYS) {
+            // key already exists
+            // check amount of existing storage reserved for cookie
+            datasize -= getAssignedBlocks()*SBBLOCKSIZE;
+            if (datasize<=0) {
+                // the size of data matches the size requested
+                // therefore retrieve data from storage
+                _status = true; //were good to go
+                loadCookie();
+            } else {
+            // if that does not cover the whole size (maybe a newer version of program, who knows)
+            // then do not load but reserve more blocks and store a new version
+                while (datasize>0) {
+                    if(reserveBlock()) datasize -= SBBLOCKSIZE;
+                    else return SBNOTENOUGHBLOCKSFREE; //no space to allocate
+                }
+                _status = true; //were good to go
+                eraseKeytableEntry(_keyorder);
+                writeKeyToKeytable(_key,_keyorder); // write the key in the key table in EEPROM
+                saveCookie();
+            }
+    } else {
+            // new key needed
+            // check if we have free keyslots
+            _keyorder = getFreeKeytableSlot();
+            if (_keyorder>=SBMAXKEYS) return SBNOMOREKEYS; //no space for key
+            // check if we have free storage blocks
+            if (getFreeBlocks()*SBBLOCKSIZE<datasize) return SBNOTENOUGHBLOCKSFREE; //no space to allocate
+            while (datasize>0) {
+                //reserve enough blocks for the data until all data can fit
+                if(reserveBlock()) datasize -= SBBLOCKSIZE;
+                else return SBNOTENOUGHBLOCKSFREE; //no space to allocate
+            }
+    }
+    _status = true; //were good to go
+    eraseKeytableEntry(_keyorder);
+    writeKeyToKeytable(_key,_keyorder); // write the key in the key table in EEPROM
+    return 0;
+}
+
+int Cookie::begin(const char* idkey, int datasize, char* ptr) {
+    _status=false;
+    _datasize=datasize-HARDCODEDOFFSET;// warning! hardcoded! sizeof(this); //do not include the data of the parent Cookie instance
+    _pointer = ptr + HARDCODEDOFFSET;// warning! hardcoded! sizeof(this); //point to the beginning of the inherited instance
+    char _idkey[8];
+    // make _idkey exactly 8 readable characters long
+    for (int t = 0 ; t < 8 ; t++) _idkey[t]=' ';
+    for (int t = 0 ; t < 8 ; t++) {if (idkey[t]==0) break; _idkey[t]=idkey[t];}
+    // clean Keytable of keys with no storage
+    cleanKeytable();
+    memcpy(_key, _idkey, SBKEYSIZE); //store name of key
+    initialize();
+    return 0; //success
+}
+
+bool Cookie::saveCookie() {
+    if (!_status || !_pointer) initialize(); //reinitialize if needed
+    if (!_status || !_pointer) return false; //return if initialize still failed
+    char* p = _pointer;
+    _head=0;
+    _block=0;
+    _block=findMyNextBlock();
+    for (int i=0; i<_datasize; i++) writeQueue(*p++);
+}
+
+bool Cookie::loadCookie() {
+    if (!_status || !_pointer) return false;
+    char* p = _pointer;
+    _head=0;
+    _block=0;
+    _block=findMyNextBlock();
+    for (int i=0; i<_datasize; i++) *p++ = readQueue();
+}
+
+void Cookie::deleteCookie() {
+    if (!_status) return;
+    // free all blocks held by Cookie
+    for (int i=0; i<SBMAXBLOCKS; i++) {
+            if (isMyBlock(i)) freeBlock(i);
+    }
+    // erase Cookie entry from keytable
+    eraseKeytableEntry(_keyorder);
+    // set status to deleted
+    _status = false;
+}
+
+int Cookie::exists(const char* idkey) {
+    for (int i=0; i< SBMAXKEYS; i++) {
+        #ifndef POK_SIM
+            if(eeprom_read_byte((uint16_t*)(i*SBKEYSIZE))==idkey[0]) {
+                    int total=0;
+                    for (int j=0; j<SBKEYSIZE;j++) {
+                        if(eeprom_read_byte((uint16_t*)(i*SBKEYSIZE+j))==idkey[j]) total++;
+                    }
+                    if (total==SBKEYSIZE) return i; // return the keyslot number where key exists
+            }
+        #endif
+    }
+    return SBINVALIDSLOT; //not found
+}
+
+int Cookie::getFreeKeytableSlot() {
+    int freeslot=SBINVALIDSLOT;
+    for (int i=0; i<SBMAXKEYS; i++) {
+    #ifndef POK_SIM
+    if (eeprom_read_byte((uint16_t*)(i*SBKEYSIZE))==0) {freeslot=i; break;}
+    #endif
+    }
+    return freeslot;
+}
+
+int Cookie::getAssignedBlocks() {
+    int assignedblocks=0;
+    for (int i=0;i<SBMAXBLOCKS;i++) {
+        if (isMyBlock(i)) assignedblocks++;
+    }
+    return assignedblocks;
+}
+
+int Cookie::getFreeBlocks() {
+    int freeblocks=0;
+    for (int i=0;i<SBMAXBLOCKS;i++) {
+        if (isFreeBlock(i)) freeblocks++;
+    }
+    return freeblocks;
+}
+
+bool Cookie::isFreeBlock(int n) {
+    if (n>=SBMAXBLOCKS) return false;
+    #ifndef POK_SIM
+    if (!(eeprom_read_byte((uint16_t*)(SBMAXKEYS*SBKEYSIZE+n))&0x80)) return true; //highest bit 0, its free
+    #endif
+    return false; //its not free
+}
+
+bool Cookie::isMyBlock(int n) {
+    if (n>=SBMAXBLOCKS) return false;
+    if (isFreeBlock(n)) return false; //"free" blocks can not be "reserved" at the same time!
+    #ifndef POK_SIM
+    char temp; int address;
+    address = (SBMAXKEYS*SBKEYSIZE+n);
+    temp = eeprom_read_byte((uint16_t*)address);
+    if ((temp&0x7F) ==_keyorder) return true;
+    #endif
+    return false; //its not your block
+}
+
+bool Cookie::blockIsOwnedBy(int n, int k) {
+    if (n>=SBMAXBLOCKS) return false;
+    if (k>=SBMAXKEYS) return false;
+    if (isFreeBlock(n)) return false; //"free" blocks can not be "owned" by anyone
+    #ifndef POK_SIM
+    char temp; int address;
+    address = (SBMAXKEYS*SBKEYSIZE+n);
+    temp = eeprom_read_byte((uint16_t*)address);
+    if ((temp&0x7F) == k) return true;
+    #endif
+    return false; //its not your block
+}
+
+void Cookie::writeKeyToKeytable(const char* key, int slot) {
+    for (int i=0; i<SBKEYSIZE; i++) {
+    #ifndef POK_SIM
+    if (key[i]) eeprom_write_byte((uint16_t*)(slot*SBKEYSIZE+i),key[i]);
+    else eeprom_write_byte((uint16_t*)(slot*SBKEYSIZE+i),0);
+    #endif
+    }
+}
+
+void Cookie::readKeytableEntry(int n, char* answer) {
+    answer[8]=0;
+    if (n >= SBMAXKEYS) n=SBMAXKEYS-1;
+    for (int i=0; i<SBKEYSIZE; i++) {
+        #ifndef POK_SIM
+        answer[i] = eeprom_read_byte((uint16_t*)(n*SBKEYSIZE+i));
+        #endif
+    }
+}
+
+char Cookie::getBlockTableEntry(int n) {
+    if (n>=SBMAXBLOCKS) return 0x80; // out of bounds will return a reserved block marker
+    #ifndef POK_SIM
+        return eeprom_read_byte((uint16_t*)(SBKEYSIZE*SBMAXKEYS+n));
+    #endif
+    return 0x80;
+}
+
+void Cookie::readBlock(int n, char* data) {
+    for (int i=0; i<SBBLOCKSIZE; i++) {
+    data[i]=0;
+    #ifndef POK_SIM
+        if (n < SBMAXBLOCKS) data[i] = eeprom_read_byte((uint16_t*)(SBKEYSIZE*SBMAXKEYS+SBMAXBLOCKS+n*SBBLOCKSIZE+i));
+    #endif
+    }
+}
+
+void Cookie::formatKeytable() {
+    for (int j=0; j<SBMAXKEYS; j++) {
+    for (int i=0; i<SBKEYSIZE; i++) {
+        #ifndef POK_SIM
+        eeprom_write_byte((uint16_t*)(j*SBKEYSIZE+i),0);
+        #endif
+    }
+    }
+}
+
+void Cookie::freeBlock(int n) {
+    if (n >= SBMAXBLOCKS) return; //out of bounds
+    #ifndef POK_SIM
+        // delete entry from blocktable
+        eeprom_write_byte((uint16_t*)(SBKEYSIZE*SBMAXKEYS+n),0);
+    #endif
+    for (int i=0; i<SBBLOCKSIZE;i++) {
+    #ifndef POK_SIM
+        // wipe data in the block
+        eeprom_write_byte((uint16_t*)(SBKEYSIZE*SBMAXKEYS+SBMAXBLOCKS+n*SBBLOCKSIZE+i),0);
+    #endif
+    }
+}
+
+bool Cookie::reserveBlock() {
+    for (int i=0; i<SBMAXBLOCKS;i++) {
+    #ifndef POK_SIM
+        // reserve block from blocktable
+        if (isFreeBlock(i)) {
+                //free block found, mark it for us in the blocktable
+                eeprom_write_byte((uint16_t*)(SBKEYSIZE*SBMAXKEYS+i),_keyorder | 0x80);
+                return true;
+        }
+    #endif
+    }
+    return false; // no free block found
+}
+
+void Cookie::eraseKeytableEntry(int n) {
+    if (n >= SBMAXKEYS) n=SBMAXKEYS-1;
+    for (int i=0; i<SBKEYSIZE; i++) {
+        #ifndef POK_SIM
+        eeprom_write_byte((uint16_t*)(n*SBKEYSIZE+i),0);
+        #endif
+    }
+}
+
+void Cookie::cleanKeytable() {
+    //Remove any keys without blocks
+    for (int entry=0; entry<SBMAXKEYS; entry++) {
+            if (eeprom_read_byte((uint16_t*)(entry*SBKEYSIZE))) {
+                bool isEmpty=true;
+                for (int block=0; block<SBMAXBLOCKS; block++) if (blockIsOwnedBy(block,entry)) {isEmpty=false;break;}
+                //this entry has no blocks reserved, so lets clean it from the keytable
+                if (isEmpty) eraseKeytableEntry(entry);
+            }
+    }
+    for (int block=0;block<SBMAXBLOCKS;block++) {
+            int blockentry = eeprom_read_byte((uint16_t*)(SBMAXKEYS*SBKEYSIZE+block));
+            if (blockentry&0x80) {
+                    blockentry &= 0x7F;
+                    bool isEmpty=true;
+                    for (int key=0;key<SBMAXKEYS;key++) {
+                            if (eeprom_read_byte((uint16_t*)(key*SBKEYSIZE))) {isEmpty=false;break;}
+                    }
+                    if (isEmpty) eeprom_write_byte((uint16_t*)(SBMAXKEYS*SBKEYSIZE+block),0);
+            }
+    }
+}
+
+char Cookie::readQueue() {
+    char data=0;
+    #ifndef POK_SIM
+    int address;
+    address = SBMAXKEYS*SBKEYSIZE+SBMAXBLOCKS+SBBLOCKSIZE*_block+_head%SBBLOCKSIZE;
+    data=eeprom_read_byte((uint16_t*)address);
+    #endif
+    _head++;
+    if (_head%SBBLOCKSIZE==0 && _head) {
+            _block++;
+            _block=findMyNextBlock();
+    }
+    return data;
+}
+
+void Cookie::writeQueue(char data) {
+    #ifndef POK_SIM
+    eeprom_write_byte((uint16_t*)(SBMAXKEYS*SBKEYSIZE+SBMAXBLOCKS+SBBLOCKSIZE*_block+_head%SBBLOCKSIZE),data);
+    #endif
+    _head++;
+    if (_head%SBBLOCKSIZE==0 && _head) {
+            _block++;
+            _block=findMyNextBlock();
+    }
+}
+
+int Cookie::findMyNextBlock() {
+    if (!_status) return SBINVALIDBLOCK;
+    for (int i=_block; i<SBMAXBLOCKS;i++) if (isMyBlock(i)) return i;
+}
+
+
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/POKITTO_CORE/PokittoCookie.h	Sun Jul 01 06:32:10 2018 +0000
@@ -0,0 +1,344 @@
+/**************************************************************************/
+/*!
+    @file     PokittoCookie.h
+    @author   Jonne Valola
+
+    @section LICENSE
+
+    Software License Agreement (BSD License)
+
+    Copyright (c) 2018, Jonne Valola
+    All rights reserved.
+
+    Redistribution and use in source and binary forms, with or without
+    modification, are permitted provided that the following conditions are met:
+    1. Redistributions of source code must retain the above copyright
+    notice, this list of conditions and the following disclaimer.
+    2. Redistributions in binary form must reproduce the above copyright
+    notice, this list of conditions and the following disclaimer in the
+    documentation and/or other materials provided with the distribution.
+    3. Neither the name of the copyright holders nor the
+    names of its contributors may be used to endorse or promote products
+    derived from this software without specific prior written permission.
+
+    THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS ''AS IS'' AND ANY
+    EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+    WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+    DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER BE LIABLE FOR ANY
+    DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+    (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+    LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+    ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+    (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+    SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+*/
+/**************************************************************************/
+
+#ifndef POKITTO_COOKIE_H
+#define POKITTO_COOKIE_H
+
+#include "Pokitto_settings.h"
+#include <stdint.h>
+
+#define SBNOMOREKEYS 1
+#define SBNOTENOUGHBLOCKSFREE 2
+#define SBMAXKEYS 48 //number of available keys
+#define SBMAXBLOCKS 112 //0xF8C (settings reserved area) - 0x180 (start of block table) / 32 bytes (block size)
+#define SBBLOCKSIZE 32 //block size in bytes
+#define SBKEYSIZE 8
+#define SBINVALIDSLOT 255
+#define SBINVALIDBLOCK -1
+
+namespace Pokitto {
+
+/** Pokitto Cookies are queues of 32 byte blocks that are saved in the EEPROM in a safe way
+ *
+ * Example:
+ * @code
+ * // Create saveable data and initialize your app to use Cookies
+ *
+ *   class gdata : public Cookie {
+ *   int highscore;
+ *   }
+ *
+ *   gdata gamedata;
+ *
+ *   gamedata.begin("ASTEROCK"); // register your Cookie with key "ASTEROCK"
+ *
+ *   // you use the data objects inside the Cookie as normal:
+ *
+ *   gamedata.highscore = player.currentscore; // It's a new highscore!
+ *
+ *   // Finally you call the save method to write your data to EEPROM
+ *
+ *   gamedata.save;
+ * @endcode
+ */
+
+class Cookie {
+public:
+    /** Cookie class constructor
+    */
+    Cookie();
+
+    /** begin - Register your Cookie with a 8-byte key to begin using it
+     *
+     *  @param 8-byte key string
+     *  @param size of cookie data in bytes
+     *  @param pointer to beginning of cookie data in memory
+     *
+     *  @returns
+     *       0 on success (free blocks available),
+     *   non-0 on failure (no more free keys/blocks)
+     */
+     int begin(const char*, int, char*);
+
+
+    /** begin - Register your Cookie with a 8-byte key to begin using it
+     *
+     *  @param 8-byte key string
+     *  @param reference to cookie data object in memory
+     *
+     *  @returns
+     *       0 on success (free blocks available),
+     *   non-0 on failure (no more free keys/blocks)
+     */
+     template< typename T >
+     int begin(const char * key, T & object) {
+       return begin(key, sizeof(T), reinterpret_cast<char *>(&object));
+     }
+
+    /** initialize - create cookie structure. Can be called many times
+     *  @returns
+     *       0 on success (free blocks available),
+     *   non-0 on failure (no more free keys/blocks)
+     */
+     int initialize();
+
+    /** saveCookie - Save your Cookie
+     *
+     *  @returns
+     *      true on success (saved successfully and verified),
+     *      false on failure (something is wrong)
+     */
+     bool saveCookie();
+
+     /** loadCookie - Load your Cookie
+     *
+     *  @returns
+     *      true on success
+     *      false on failure
+     */
+     bool loadCookie();
+
+     /** deleteCookie -  your Cookie
+     */
+     void deleteCookie();
+
+    /** isOK - Get status of Cookie
+     *
+     *  @returns
+     *       true on success (Cookie is initialized and ready to use),
+     *      false on failure (Cookie did not initialize and can't be used)
+     */
+     bool isOK();
+
+    /** readKeytableEntry - return the key at slot n
+     *
+     *  @param slot number to check
+     *  @param pointer to a 9 char buffer for return answer
+     *
+     */
+     void readKeytableEntry(int, char*);
+
+
+    /** formatKeyTable(int) - erase all keys
+     *
+     *  @param slot number to erase
+     *
+     */
+     void formatKeytable();
+
+
+    /** eraseKeyAt(int) - erase key at slot n
+     *
+     *  @param slot number to erase
+     *
+     */
+     void eraseKeytableEntry(int);
+
+     /** cleanKeytable() - erase keys that have no blocks reserved from the keyTable
+     *
+     */
+     void cleanKeytable();
+
+//private:
+public:
+
+    /** exists - find out if the key exists
+     *
+     *  @param 8-byte key string
+     *
+     *  @returns
+     *       slotnumber on key exists ,
+     *       SBINVALIDSLOT on does not exist
+     */
+     int exists(const char*);
+
+    /** getFreeKeytableSlot - Are there any keys left to use
+     *
+     *  @returns
+     *      slot number 0...47 on success
+     *      -1 on failure
+     */
+     int getFreeKeytableSlot();
+
+    /** getFreeBlocks - Are there any storage blocks left to use
+     *
+     *  @returns
+     *      number of blocks available
+     */
+     int getFreeBlocks();
+
+    /** getAssignedBlocks - return number of blocks already reserved for cookie
+     *
+     *  @returns
+     *      number of blocks assigned to cookie
+     */
+     int getAssignedBlocks();
+
+
+    /** isFreeBlock - check if block n is free to use
+     *
+     *  @param block number
+     *  @returns
+     *      true when free
+     *      false when reserved
+     */
+     bool isFreeBlock(int);
+
+    /** isMyBlock - check if block n is already reserved for this cookie
+     *
+     *  @param block number
+     *  @returns
+     *      true when is already reserved
+     *      false when is not
+     */
+     bool isMyBlock(int);
+
+    /** blockIsOwnedBy - check if block n is owned by Keytable entry k
+     *
+     *  @param block number
+     *  @param keytable entry number
+     *  @returns
+     *      true when keytable entry k is owner of block n
+     *      false when is not
+     */
+     bool blockIsOwnedBy(int,int);
+
+    /** writeKeyToKeyTable - write the key into the key table
+     *
+     *  @param 8-byte key string
+     *  @param slot number into which the key is written 0...47
+     *
+     */
+     void writeKeyToKeytable(const char*, int);
+
+
+    /** getBlockTableEntry - read an entry from the blocktable
+     *
+     *  @param block table index number
+     *
+     *  @returns
+     *         block table entry (1 byte)
+     */
+     char getBlockTableEntry(int);
+
+     /** readBlock - read the data of a block
+     *
+     *  @param block index number
+     *  @param pointer to a buffer of SBBLOCKSIZE size to hold the return data
+     *
+     */
+     void readBlock(int, char*);
+
+     /** freeBlock - free block from blocktable and delete data of block in EEPROM
+     *
+     *  @param block index number
+     *
+     */
+     void freeBlock(int);
+
+     /** reserveBlock - search and reserve a block from blocktable for use by this cookie
+     *
+     *  @returns
+     *      true when it was possible to reserve a block
+     *      false when it was not
+     *
+     */
+     bool reserveBlock();
+
+    /** writeQueue - write the cookie data as a stream of bytes into the EEPROM blocks
+     *
+     *  @param byte to be written
+     */
+     void writeQueue(char);
+
+    /** readQueue - write the cookie data as a stream of bytes into the EEPROM blocks
+     *
+     *  @returns
+     *      byte value from EEPROM memory
+     */
+     char readQueue();
+
+
+    /** findMyNextBlock - find the next block assigned to this cookie
+     *
+     *  @returns
+     *      number of next block
+     */
+     int findMyNextBlock();
+
+    /** keystring
+    * identification string for the Cookie
+    */
+     char _key[SBKEYSIZE];
+
+    /** Keyorder
+    * order number of key in key table
+    */
+     char _keyorder;
+
+    /** Status
+    * false = uninitialized
+    * true = ready
+    */
+     bool _status;
+
+    /** Datasize
+    * size (in bytes) of cookie data to be saved and reloaded
+    */
+    int _datasize;
+
+    /** Pointer
+    * pointer to cookie data
+    */
+    char* _pointer;
+
+    /** Head
+    * data "head" for byte write/read operations
+    */
+    int _head;
+
+    /** Current block
+    * block number that we are reading/writing
+    */
+    char _block;
+};
+
+
+} // namespace
+
+
+#endif // POKITTO_Cookie_H
+
--- a/POKITTO_CORE/PokittoCore.cpp	Wed Jun 27 13:14:54 2018 +0000
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,1391 +0,0 @@
-/**************************************************************************/
-/*!
-    @file     PokittoCore.cpp
-    @author   Jonne Valola
-
-    @section LICENSE
-
-    Software License Agreement (BSD License)
-
-    Copyright (c) 2016, Jonne Valola
-    All rights reserved.
-
-    Redistribution and use in source and binary forms, with or without
-    modification, are permitted provided that the following conditions are met:
-    1. Redistributions of source code must retain the above copyright
-    notice, this list of conditions and the following disclaimer.
-    2. Redistributions in binary form must reproduce the above copyright
-    notice, this list of conditions and the following disclaimer in the
-    documentation and/or other materials provided with the distribution.
-    3. Neither the name of the copyright holders nor the
-    names of its contributors may be used to endorse or promote products
-    derived from this software without specific prior written permission.
-
-    THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS ''AS IS'' AND ANY
-    EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
-    WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
-    DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER BE LIABLE FOR ANY
-    DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-    (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-    LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-    ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-    (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
-    SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-*/
-/**************************************************************************/
-
-#include "Pokitto_settings.h"
-#include "PokittoCore.h"
-#include "PokittoConsole.h"
-#include "PokittoFonts.h"
-#include "PokittoTimer.h"
-#include "PokittoLogos.h"
-#include <stdlib.h>
-
-#ifndef DISABLEAVRMIN
-#define max(a,b) ((a)>(b)?(a):(b))
-#endif // DISABLEAVRMIN
-
-char selectedfile[25];
-
-//#define F
-#ifdef __ARMCC_VERSION
-typedef void (*func_t)(void);
-#endif
-
-#ifndef POK_SIM
-#include "iap.h"
-/** start the user application
-* https://community.nxp.com/thread/417695
-*
-*/
-void start_application(unsigned long app_link_location){
-    //asm(" ldr sp, [r0,#0]");
-    //asm(" ldr pc, [r0,#4]");
-    //This code is not valid for the Cortex-m0+ instruction set.
-    // The equivalent for this (as used by the KL26) is
-__disable_irq();// Start by disabling interrupts, before changing interrupt vectors
-
-// delete buttons
-//pokDeleteButtons();
-
-// completely kill button interrupts in preparation for reset
-LPC_PINT->IENR = 0;
-LPC_PINT->IENF = 0;
-
-SysTick->CTRL = SysTick_CTRL_CLKSOURCE_Msk & ~(SysTick_CTRL_ENABLE_Msk); //disable systick
-LPC_SYSCON->PDRUNCFG     |=  (1 << 10);       /* Power-down USB PHY         */
-LPC_SYSCON->PDRUNCFG     |=  (1 <<  8);       /* Power-down USB PLL         */
-
-// reset clock source to IRC
-LPC_SYSCON->MAINCLKUEN    = 0x01;             /* Update MCLK Clock Source   */
-LPC_SYSCON->MAINCLKUEN    = 0x00;             /* Toggle Update Register     */
-while (LPC_SYSCON->MAINCLKUEN & 0x01);     /* Wait Until Updated         */
-// switch clock selection to IRC
-LPC_SYSCON->MAINCLKSEL    = 0;             /* Select Clock Source        */
-LPC_SYSCON->MAINCLKUEN    = 0x01;             /* Update MCLK Clock Source   */
-LPC_SYSCON->MAINCLKUEN    = 0x00;             /* Toggle Update Register     */
-while (LPC_SYSCON->MAINCLKUEN & 0x01);     /* Wait Until Updated         */
-//disable PLL clock output
-LPC_SYSCON->SYSPLLCLKUEN = 0;
-while (LPC_SYSCON->SYSPLLCLKUEN & 0x00);
-LPC_SYSCON->SYSPLLCTRL = 0;
-
-//kill peripherals
-LPC_SYSCON->MAINCLKSEL = 0;
-LPC_SYSCON->PRESETCTRL = 0; //disable all peripherals
-
-//power down PLL
-volatile uint32_t tmp;
-tmp = (LPC_SYSCON->PDRUNCFG & 0x000025FFL);
-tmp |= ((1<<7) & 0x000025FFL);
-LPC_SYSCON->PDRUNCFG = (tmp | 0x0000C800L); /* Power-down SYSPLL          */
-
-//Chip_Clock_SetMainClockSource(SYSCTL_MAINCLKSRC_IRC); //switch to IRC
-
-// clear all gpio states
-LPC_GPIO_PORT->PIN[0] = 0;
-LPC_GPIO_PORT->PIN[1] = 0;
-LPC_GPIO_PORT->PIN[2] = 0;
-
-SCB->VTOR = app_link_location;//APPL_ADDRESS; /* Change vector table address */
-#ifndef __ARMCC_VERSION
-asm(" mov r0, %[address]"::[address] "r" (app_link_location));
-asm(" ldr r1, [r0,#0]"); // get the stack pointer value from the program's reset vector
-asm(" mov sp, r1");      // copy the value to the stack pointer
-asm(" ldr r0, [r0,#4]"); // get the program counter value from the program's reset vector
-asm(" blx r0");          // jump to the' start address
-#else
-uint32_t *app_loc = (uint32_t*)app_link_location;
-__set_MSP (app_loc[0]);
-((func_t)(app_loc[1]))();
-#endif
-}
-#endif
-
-// returns a random integar between 0 and maxVal
-int random(int maxVal)
-{
-  return random( 0, maxVal);
-}
-
-// returns a random integar between minVal and maxVal
-int random(int minVal, int maxVal)
-{
-  // int rand(void); included by default from newlib
-  return rand() % (maxVal-minVal+1) + minVal;
-}
-
-using namespace Pokitto;
-
-bool Core::run_state; // this definition needed
-
-/** Components */
-Backlight Core::backlight;
-Buttons Core::buttons;
-Battery Core::battery;
-#if POK_ENABLE_SOUND > 0
-Sound Core::sound;
-#endif
-Display Core::display;
-
-//GB Related
-uint8_t Core::startMenuTimer;
-uint8_t Core::timePerFrame;
-uint32_t Core::nextFrameMillis;
-uint32_t Core::frameCount;
-const char* Core::popupText;
-uint8_t Core::popupTimeLeft;
-uint16_t Core::frameDurationMicros;
-uint32_t Core::frameStartMicros, Core::frameEndMicros;
-uint8_t Core::volbar_visible=0;
-
-uint32_t Core::fps_counter;
-bool Core::fps_counter_updated;
-uint32_t Core::fps_refreshtime;
-uint32_t Core::fps_frameCount;
-
-Core::Core() {
-
-}
-
-
-int Core::updateLoader (uint32_t version, uint32_t jumpaddress) {
-    #ifndef POK_SIM
-    uint32_t counter=0;
-    uint8_t data[256];
-    /** prepare the flash writing **/
-    float progress=0;
-    int opg=-1;
-    uint32_t fsize=0;
-    fileEnd(); //
-    fsize = fileGetPosition();
-    if (fsize>0x40000-jumpaddress) fsize = 0x40000-jumpaddress; // shouldn't happen!!
-    fileRewind();
-    display.println("PLEASE WAIT");
-    while (1) {
-        //if (counter >= fsize-0x200) {
-        //    display.println("gotcha");
-        //}
-        if (counter >= fsize) {
-                break;
-        }
-        opg=progress;
-        if (fileReadBytes(&data[0],0x100)<0x100) {
-                if (fsize-counter>0x100) {
-                        display.println("ERROR READING LOA.DER FILE");
-                        return 1; // 1 means error
-                }
-        }
-        if (CopyPageToFlash(jumpaddress+counter,data)) {
-                    display.println("FLASH WRITE ERROR");
-                    return 1;
-        } else {
-            counter += 0x100;
-            display.print(".");
-        }
-        }
-        #endif // POK_SIM
-    return 0; //success
-}
-
-void Core::showWarning() {
-    display.enableDirectPrinting(true);
-    display.directbgcolor = COLOR_BLACK;
-    display.clearLCD();
-    display.directcolor = COLOR_RED;
-    display.setFont(fntC64UIGfx);
-    display.adjustCharStep = 0;
-    display.adjustLineStep = 0;
-    display.setCursor(10*8,9);
-    display.print("WARNING!");
-    display.directcolor = COLOR_WHITE;
-    display.setCursor(5*8,4*9);
-    display.print("LOUD SOUND THROUGH");
-    display.setCursor(2*8,5*9);
-    display.print("HEADPHONES COULD DAMAGE");
-    display.setCursor(7*8,6*9);
-    display.print("YOUR HEARING.");
-    display.setCursor(5*8,8*9);
-    display.print("USE "); display.directcolor = COLOR_GREEN;
-    display.print("0-100% VOLUME");
-    display.directcolor = COLOR_WHITE;
-    display.setCursor(5*8,9*9);
-    display.print("FOR LISTENING WITH");
-    display.setCursor(8*8,10*9);
-    display.print("HEADPHONES");
-    display.setCursor(5*8,12*9);
-    display.print("USE "); display.directcolor = COLOR_RED;
-    display.print("> 100% VOLUME"); display.directcolor = COLOR_GREEN;
-    display.directcolor = COLOR_WHITE;
-    display.setCursor(1*8,13*9);
-    display.print("ONLY FOR LISTENING VIA THE");
-    display.setCursor(5*8,14*9);
-    display.print("BUILT-IN SPEAKER");
-    display.setCursor(5*8,17*9);
-    display.print("PRESS ");display.directcolor = COLOR_GREEN;
-    display.print("C ");display.directcolor = COLOR_WHITE;
-    display.print("TO ACCEPT");
-    while (!buttons.cBtn()) {
-        wait(100);
-    }
-    display.clearLCD();
-    display.enableDirectPrinting(false);
-}
-
-void Core::jumpToLoader() {
-    //display.setFont(font5x7);
-    //display.adjustCharStep=1;
-    //display.adjustLineStep=2;
-    display.fontSize=1;
-    display.directbgcolor=COLOR_BLACK;
-    display.directcolor=COLOR_GREEN;
-    display.clearLCD();
-    display.setCursor(0,0);
-    display.enableDirectPrinting(true);
-    #ifdef POK_SIM
-    display.println("LOADER IS NOT AVAILABLE ON THE SIMULATOR. PRESS A TO RETURN.");
-    #else
-    uint32_t* bootinfo;
-    uint32_t bootversion=0, sdversion=0, sdjump=0;
-    bool flashloader=false, checkforboot=true;
-    //check for loa.der on SD card
-    #if POK_ENABLE_LOADER_UPDATES > 0
-    pokInitSD();
-    if (fileOpen("LOA.DER", FILE_MODE_BINARY)==0) {
-        //LOA.DER found on SD
-        fileEnd(); // go to end
-        fileSeekRelative(-8); //rewind 8 bytes
-        uint32_t* tptr = &sdversion;
-        fileReadBytes((uint8_t*)tptr,4); //read version number of loader on SD card
-        tptr = &sdjump;
-        fileReadBytes((uint8_t*)tptr,4); //read jump address of loader on sd card
-        fileRewind();
-    }
-    #endif
-    //now start searching for bootkey
-    while (checkforboot)
-    {
-    checkforboot=false; flashloader=false;
-    bootinfo = (uint32_t*)0x3FFF4;
-    if (*bootinfo != 0xB007AB1E) bootinfo = (uint32_t*)0x3FF04; //allow couple of alternative locations
-    if (*bootinfo != 0xB007AB1E) bootinfo = (uint32_t*)0x3FE04; //allow couple of alternative locations
-    if (*bootinfo != 0xB007AB1E) bootinfo = (uint32_t*)0x3F004; //for futureproofing
-    if (*bootinfo != 0xB007AB1E) {
-        // no bootkey found at all
-        display.directcolor=COLOR_YELLOW;
-        display.println("NO LOADER INSTALLED");
-        if (sdversion==0 || sdjump < 0x38000) {
-                //file open of loader failed
-                display.println("NO VALID LOA.DER ON SD");
-                display.println("");
-                display.directcolor=COLOR_GREEN;
-                display.println("PUT LOA.DER ON SD & REBOOT");
-        } else flashloader=true;
-    } else {
-        //loader was found
-        //check if we should update the loader
-        display.directcolor=COLOR_CYAN;
-        display.print("LOADER V.");
-        display.directcolor=COLOR_WHITE;
-        display.println(*(bootinfo+1));
-        #if POK_ENABLE_LOADER_UPDATES
-        if (sdversion>(*(bootinfo+1))) flashloader=true;
-        else start_application(*(bootinfo+2)); //never returns
-        #else
-        start_application(*(bootinfo+2)); //never returns
-        #endif
-    }
-    // update loader if it was requested
-    if(flashloader) {
-            display.directcolor=COLOR_MAGENTA;
-            display.print("NEW LOADER ON SD V.");
-            display.directcolor=COLOR_WHITE;
-            display.println(sdversion);
-            display.directcolor=COLOR_GREEN;
-            display.println("UPDATE LOADER?\n(UP=YES, DOWN=CANCEL)");
-            while(1) {
-                    if (buttons.upBtn()) {
-                        if (updateLoader(sdversion,sdjump)) {
-                            display.println("PUT LOA.DER ON SD AND RETRY");
-                        } else {
-                        display.println("SUCCESS!!");
-                        checkforboot=true; //recheck
-                        }
-                    break;
-                    }
-                    if (buttons.downBtn()) return;
-            }
-    } // if flashloader
-    } // while checkforboot
-    #endif // POK_SIM
-    while (!buttons.aBtn()) {
-        buttons.pollButtons();
-        if (buttons.aBtn()) {
-            while (buttons.aBtn()) {
-                buttons.pollButtons();
-            }
-            return;
-        }
-    }
-}
-
-void Core::askLoader() {
-    display.enableDirectPrinting(true);
-    display.directbgcolor = COLOR_BLACK;
-    display.clearLCD();
-    display.directcolor = COLOR_RED;
-    display.setFont(fntC64UIGfx);
-    display.fontSize=1;
-    display.adjustCharStep = 0;
-    display.adjustLineStep = 0;
-    display.directcolor=COLOR_GREEN;
-    display.set_cursor(12*8,6*8);
-    display.print("ijkl");
-    display.set_cursor(12*8,7*8);
-    display.print("mnop");
-    display.set_cursor(12*8,8*8);
-    display.print("qrst");
-    display.set_cursor(12*8,9*8);
-    display.print("uvwx");
-    display.set_cursor(5*8,12*8);
-    display.print("PRESS");
-    display.directcolor=COLOR_WHITE;
-    display.print(" C ");
-    display.directcolor=COLOR_GREEN;
-    display.print("FOR LOADER");
-    display.directcolor=COLOR_WHITE;
-    display.fontSize=2;
-    int countd = 0;
-    #ifndef POK_SIM
-    //read countdown time from settings
-    countd = eeprom_read_byte((uint16_t*)EESETTINGS_LOADERWAIT);
-    #endif
-    if (countd<=0 || countd > 5) countd=3;
-    uint16_t c2 = getTime();
-    while (countd) {
-        buttons.pollButtons();
-        display.set_cursor(13*8,15*8);
-        display.print(countd);
-        if (getTime()>c2+1000) {
-            c2=getTime();
-            countd--;
-        }
-        if (cBtn()) {while (cBtn()) buttons.pollButtons();jumpToLoader();countd=0;}
-        if (aBtn()) {while (aBtn()) buttons.pollButtons();countd=0;}
-        if (bBtn()) {while (bBtn()) buttons.pollButtons();countd=0;}
-    }
-    display.fontSize=1;
-    display.clearLCD();
-    display.enableDirectPrinting(false);
-}
-
-
-void Core::drawvolbar(int x, int y, int level, bool text) {
-    uint16_t oldcol = display.directcolor;
-    level = level >> 5;
-    if (text) display.directRectangle(0,0,50,50,COLOR_BLACK);
-    if (level<4)  display.directcolor = COLOR_GREEN;
-    if (level==4) display.directcolor = COLOR_YELLOW;
-    if (level>4) display.directcolor = COLOR_RED;
-
-    if (text) {
-            bool temp = display.isDirectPrintingEnabled();
-            display.enableDirectPrinting(true);
-            display.print(x-1,y-20,(int)sound.getVolume());
-            display.print("  ");
-            display.enableDirectPrinting(temp);
-    }
-    if (level<1) display.directcolor = COLOR_GRAY_80;
-    display.directBitmap(x,y,Pokitto_volumebar,1,1);
-    if (level<2) display.directcolor = COLOR_GRAY_80;
-    display.directBitmap(x+8,y,Pokitto_volumebar,1,1);
-    display.directBitmap(x+8,y-4,Pokitto_volumebar,1,1);
-    if (level<3) display.directcolor = COLOR_GRAY_80;
-    display.directBitmap(x+16,y,Pokitto_volumebar,1,1);
-    display.directBitmap(x+16,y-4,Pokitto_volumebar,1,1);
-    display.directBitmap(x+16,y-8,Pokitto_volumebar,1,1);
-    if (level<4) {
-            display.directcolor = COLOR_GRAY_80;
-    }
-    display.directBitmap(x+24,y,Pokitto_volumebar,1,1);
-    display.directBitmap(x+24,y-4,Pokitto_volumebar,1,1);
-    display.directBitmap(x+24,y-8,Pokitto_volumebar,1,1);
-    display.directBitmap(x+24,y-12,Pokitto_volumebar,1,1);
-
-    if (level<5) {
-            display.directcolor = COLOR_GRAY_80;
-    }
-    display.directBitmap(x+32,y,Pokitto_volumebar,1,1);
-    display.directBitmap(x+32,y-4,Pokitto_volumebar,1,1);
-    display.directBitmap(x+32,y-8,Pokitto_volumebar,1,1);
-    display.directBitmap(x+32,y-12,Pokitto_volumebar,1,1);
-    display.directBitmap(x+32,y-16,Pokitto_volumebar,1,1);
-
-    if (level<6) {
-            display.directcolor = COLOR_GRAY_80;
-    }
-    display.directBitmap(x+40,y,Pokitto_volumebar,1,1);
-    display.directBitmap(x+40,y-4,Pokitto_volumebar,1,1);
-    display.directBitmap(x+40,y-8,Pokitto_volumebar,1,1);
-    display.directBitmap(x+40,y-12,Pokitto_volumebar,1,1);
-    display.directBitmap(x+40,y-16,Pokitto_volumebar,1,1);
-    display.directBitmap(x+40,y-20,Pokitto_volumebar,1,1);
-    display.directcolor = oldcol;
-}
-
-
-#ifdef POK_SIM
-#define VINCMULT 0.9f
-#else
-#define VINCMULT 50
-#endif //POK_SIM
-void Core::setVolLimit() {
-    display.enableDirectPrinting(true);
-    display.adjustCharStep = 0;
-    //sound.setMaxVol(VOLUME_HEADPHONE_MAX);
-    int dstate=1;
-    bool wipe = true;
-    float vol = sound.getVolume(); float tvol;
-    #ifndef POK_SIM
-    vol=eeprom_read_byte((uint16_t*)EESETTINGS_VOL);
-    Pokitto::Sound::globalVolume=vol;
-    #endif
-    if (vol>VOLUME_HEADPHONE_MAX) sound.setMaxVol(VOLUME_SPEAKER_MAX);
-    else sound.setMaxVol(VOLUME_HEADPHONE_MAX);
-    #ifdef PRODUCTIONTESTING
-    vol=170;
-    sound.setMaxVol(VOLUME_SPEAKER_MAX);
-    #endif
-    for (uint8_t t=0;t<=vol;t++) {
-            sound.setVolume(t);
-    }
-    volbar_visible=0;
-    int countd=0;
-    #ifndef POK_SIM
-    //read countdown time from settings
-    countd = eeprom_read_byte((uint16_t*)EESETTINGS_VOLWAIT);
-    #endif
-    if (countd==0 || countd > 10) countd=0xFFFF;
-    #ifdef PRODUCTIONTESTING
-    countd=2;
-    #endif
-    uint16_t c2 = getTime();
-    while (core.isRunning() && dstate && countd){
-        if (getTime()>c2+1000) {
-            c2=getTime();
-            if (countd<0xFFFF) countd--;
-        }
-        switch (dstate) {
-        case 1:
-            //redraw
-            if (wipe) {
-            display.clearLCD();
-            display.directcolor = COLOR_WHITE;
-            display.setCursor(4*8,2*8);
-            display.print("SELECT VOLUME LIMIT");
-            display.setCursor(5*8,17*9);
-            display.print("PRESS ");
-            display.directcolor = COLOR_GREEN;
-            display.print("A");
-            display.directcolor = COLOR_WHITE;
-            display.print(" TO ACCEPT");
-            display.directcolor = COLOR_GREEN;
-            // draw frame below first
-            display.setCursor(0,11*8);
-            display.println(" abbbbbbbbbbbbbbbbbbbbbbbc");
-            display.println(" |                       |");
-            display.println(" |                       |");
-            display.println(" |                       |");
-            display.println(" |                       |");
-            display.println(" dbbbbbbbbbbbbbbbbbbbbbbbe");
-            } // wipe = true
-            display.setCursor(6*8,17*9);
-            if (discrete_vol<4) display.directcolor = COLOR_WHITE;
-            else display.directcolor = COLOR_RED;
-            display.directBitmap(21*8-4,6*8,Pokitto_headphones,1,2);
-            display.setCursor(3*8,6*8+6);
-            display.print("HEADPHONES");
-            display.setCursor(3*8,8*8+2);
-            if (discrete_vol>3) display.print("TOO LOUD!");
-            else display.print("OK        ");
-            display.directcolor = COLOR_GREEN;
-            display.directBitmap(21*8-4,12*8,Pokitto_speaker,1,2);
-            display.setCursor(3*8,12*8+6);
-            display.print("VOLUME MAX");
-            display.setCursor(3*8,14*8+2);
-            //tvol = (vol/float(VOLUME_HEADPHONE_MAX))*100;
-            //if (tvol > 100 && tvol < 120) tvol=100;
-            //if (sound.getVolume()-5>VOLUME_HEADPHONE_MAX) { display.directcolor=COLOR_RED;}
-            if ((sound.getVolume()>>5)>3) { display.directcolor=COLOR_RED;}
-            else display.directcolor=COLOR_GREEN;
-            if (discrete_vol==4) display.directcolor=COLOR_YELLOW;
-            if (discrete_vol==7) discrete_vol=6;
-            display.print((int)discrete_vol);
-            //display.print(int(tvol));
-            display.print("  ");
-            display.directcolor=COLOR_GREEN;
-            drawvolbar(14*8,14*8+4+3,sound.getVolume(),false);
-            //display.setCursor(1,10);
-            //display.print(vol);
-            dstate=2; break;
-        case 2:
-            #ifndef POK_SIM
-            buttons.pollButtons();
-            #endif // POK_SIM
-            buttons.update();
-            if (aBtn()) {dstate=0;break;}
-            if (buttons.pressed(BTN_RIGHT)) {
-                    countd=0xFFFF; //disable countdown
-                    /*if (vol >= VOLUME_HEADPHONE_MAX && vol < VOLUME_HEADPHONE_MAX+1 ) vol += 0.00025f*VINCMULT;
-                    else if (vol >= VOLUME_HEADPHONE_MAX) vol += 0.25f*VINCMULT;
-                    else vol += 0.05f*VINCMULT;
-                    if (vol > VOLUME_HEADPHONE_MAX + 20) {
-                            sound.setMaxVol(VOLUME_SPEAKER_MAX);
-                    }
-                    if (vol > VOLUME_SPEAKER_MAX) vol=VOLUME_SPEAKER_MAX;
-                    sound.setVolume(vol);*/
-                    sound.volumeUp();
-                    dstate=1; wipe=false;
-                    break;
-                    }
-            if (buttons.pressed(BTN_LEFT)) {
-                    countd=0xFFFF; //disable countdown
-                    /*if (vol >= VOLUME_HEADPHONE_MAX) vol -= 0.25f*VINCMULT;
-                    else vol -= 0.05f*VINCMULT;
-                    if (vol <= VOLUME_HEADPHONE_MAX) sound.setMaxVol(VOLUME_HEADPHONE_MAX);
-                    if (vol < 0) vol=0;
-                    sound.setVolume(vol);*/
-                    sound.volumeDown();
-                    dstate=1; wipe=false;
-                    break;
-                    }
-            break;
-        }
-    }
-    vol = sound.getVolume();
-    #ifndef POK_SIM
-    if (vol != eeprom_read_byte((uint16_t*)EESETTINGS_VOL)) eeprom_write_byte((uint16_t*)EESETTINGS_VOL,(uint8_t)vol);
-    #endif
-    sound.setVolume(vol);
-    //sound.volumeUp();
-    display.setCursor(0,0);
-}
-
-void Core::begin() {
-
-    init(); // original functions
-    timePerFrame = POK_FRAMEDURATION;
-	//nextFrameMillis = 0;
-	//frameCount = 0;
-	frameEndMicros = 1;
-	startMenuTimer = 255;
-	//read default settings from flash memory (set using settings.hex)
-	readSettings();
-	//init everything
-	backlight.begin();
-	backlight.set(BACKLIGHT_MAX);
-	buttons.begin();
-	buttons.update();
-	battery.begin();
-	display.begin();
-	#if POK_DISPLAYLOGO
-        #if PROJ_DEVELOPER_MODE != 1
-        showLogo();
-        #endif // PROJ_DEVELOPER_MODE
-	#endif // POK_DISPLAYLOGO
-
-	display.enableDirectPrinting(true);
-    display.directbgcolor = COLOR_BLACK;
-    display.clearLCD();
-    display.setFont(fntC64UIGfx);
-
-    display.enableDirectPrinting(true);
-    display.directbgcolor = COLOR_BLACK;
-    display.directcolor = COLOR_GREEN;
-    display.clearLCD();
-    display.setFont(fntC64UIGfx);
-    display.adjustCharStep=0;
-    display.adjustLineStep=1;
-    #ifdef JUSTLOAD
-	jumpToLoader();
-	#endif
-
-    #ifndef DISABLE_LOADER
-    #if PROJ_DEVELOPER_MODE != 1
-    askLoader();
-    #endif // PROJ_DEVELOPER_MODE
-    #endif
-
-	#if PROJ_DEVELOPER_MODE==1
-	sound.setMaxVol(VOLUME_SPEAKER_MAX);
-	sound.setVolume(VOLUME_SPEAKER_MAX);
-	#else
-	//showWarning();
-	setVolLimit();
-	display.clear();
-	display.update();
-
-	while(buttons.states[BTN_A])
-    {
-        buttons.update();
-    }
-
-	//sound.setVolume(sound.getVolume());//make sure we're at set volume before continue
-	#endif
-	display.enableDirectPrinting(false);
-	display.adjustCharStep=1;
-	display.adjustLineStep=1;
-	display.fontSize=1;
-	display.textWrap=true;
-	#if POK_GAMEBUINO_SUPPORT > 0
-	display.setFont(font5x7);
-	#else
-	display.setFont(fontC64);
-    #endif
-	#if POK_ENABLE_SOUND > 0
-        sound.begin();
-
-	//mute when B is held during start up or if battery is low
-	battery.update();
-	if(buttons.pressed(BTN_B)){
-		sound.setVolume(0);
-	}
-	else{ //play the startup sound on each channel for it to be louder
-		#if POK_GBSOUND > 0
-		#if(NUM_CHANNELS > 0)
-			sound.playPattern(startupSound, 0);
-		#endif
-		#if(NUM_CHANNELS > 1)
-			sound.playPattern(startupSound, 1);
-		#endif
-		#if(NUM_CHANNELS > 2)
-			sound.playPattern(startupSound, 2);
-		#endif
-		#if(NUM_CHANNELS > 3)
-			sound.playPattern(startupSound, 3);
-		#endif
-		#endif // POK_GBSOUND
-	}
-	#endif // POK ENABLE_SOUND
-}
-
-void Core::init() {
-    run_state = true;
-    display.enableDirectPrinting(false);
-    display.setFont(DEFAULT_FONT);
-    initClock();
-    initGPIO();
-    initButtons();
-    initRandom();
-    //initAudio();
-    //initDisplay();
-}
-
-void Core::init(uint8_t switches) {
-    run_state = true;
-    display.enableDirectPrinting(false);
-    display.setFont(DEFAULT_FONT);
-    initClock();
-    initGPIO();
-    initButtons();
-    initRandom();
-    //initAudio();
-    //initDisplay();
-}
-
-void Core::initButtons() {
-    #ifndef POK_SIM
-    Pokitto::initButtons();
-    #endif
-}
-
-bool Core::isRunning() {
-    #ifdef POK_SIM
-    run_state = simulator.isRunning();
-    #endif // POK_SIM
-    return run_state;
-}
-
-void Core::initDisplay() {
-    #if POK_DISPLAYLOGO > 0
-        showLogo();
-    #endif
-    #if POK_USE_CONSOLE > 0
-        console.AddMessage(MSOURCE_LCD,MSG_INIT_OK);
-    #endif
-}
-
-void Core::showLogo() {
-    uint32_t now;
-    uint8_t state=0; //jump directly to logo, bypass teeth
-    uint16_t counter=0, i=0;
-    uint16_t sc;
-    while (state < 255/6) {
-    now=getTime();
-    if (now>refreshtime) {
-            refreshtime=now+30;
-            switch (state) {
-            case 0:
-                /** POKITTO CLEAN **/
-                display.directbgcolor = COLOR_BLACK;
-                display.fillLCD(display.directbgcolor);
-                sc = COLOR_BLACK;
-                state++;
-                break;
-            case 1:
-                /** POKITTO FADE IN **/
-                display.directcolor = display.interpolateColor(sc, COLOR_GREEN, i);
-                display.directBitmap(POK_LCD_W/2 - (*Pokitto_logo/2),POK_LCD_H/2-(*(Pokitto_logo+1)/2),Pokitto_logo,1,1);
-                i += 28;
-                if (i>=0xFF) { state++; i=0;}
-                break;
-            case 2:
-                /** POKITTO WAIT **/
-                display.directcolor = COLOR_GREEN;
-                display.directBitmap(POK_LCD_W/2 - (*Pokitto_logo/2),POK_LCD_H/2-(*(Pokitto_logo+1)/2),Pokitto_logo,1,1);
-                i+= 0x3F;
-                if (i>0x3FF) state = 255;
-                break;
-            }
-            if(buttons.aBtn()) state=255;
-    }
-    }
-}
-
-void Core::readSettings() {
-    // ToDo
-        /*display.contrast = SCR_CONTRAST;
-		backlight.backlightMin = BACKLIGHT_MIN;
-		backlight.backlightMax = BACKLIGHT_MAX;
-		backlight.ambientLightMin = AMBIENTLIGHT_MIN;
-		backlight.ambientLightMax = AMBIENTLIGHT_MAX;
-*/
-		sound.setMaxVol(VOLUME_HEADPHONE_MAX);
-		sound.globalVolume = VOLUME_STARTUP;
-
-		startMenuTimer = START_MENU_TIMER;
-/*
-		battery.thresolds[0] = BAT_LVL_CRITIC;
-		battery.thresolds[1] = BAT_LVL_LOW;
-		battery.thresolds[2] = BAT_LVL_MED;
-		battery.thresolds[3] = BAT_LVL_FULL;*/
-}
-
-void Core::titleScreen(const char* name){
-	titleScreen(name, 0);
-}
-
-void Core::titleScreen(const uint8_t* logo){
-	titleScreen((""), logo);
-}
-
-void Core::titleScreen(){
-	titleScreen((""));
-}
-
-void Core::titleScreen(const char*  name, const uint8_t *logo){
-	display.setFont(font5x7);
-	if(startMenuTimer){
-		display.fontSize = 1;
-		display.textWrap = false;
-		display.persistence = false;
-		battery.show = false;
-		display.setColor(BLACK);
-		while(isRunning()){
-			if(update()){
-				uint8_t logoOffset = name[0]?display.fontHeight:0; //add an offset the logo when there is a name to display
-				//draw graphics
-				display.setColorDepth(1);
-				display.setColor(3);
-				//display.drawBitmap(0,0, gamebuinoLogo);
-				display.setColor(1);
-				if(logo){
-					display.drawBitmap(0, 12+logoOffset, logo);
-				}
-				display.cursorX = 0;
-				display.cursorY = 12;
-				display.print(name);
-
-				//A button
-				display.cursorX = LCDWIDTH - display.fontWidth*3 -1;
-				display.cursorY = LCDHEIGHT - display.fontHeight*3 - 3;
-				if((frameCount/16)%2)
-				  display.println(("\25 \20"));
-				else
-				  display.println(("\25\20 "));
-				//B button
-				display.cursorX = LCDWIDTH - display.fontWidth*3 - 1;
-				display.cursorY++;
-				if(sound.globalVolume)
-					display.println(("\26\23\24"));
-				else
-					display.println(("\26\23x"));
-				//C button
-				display.cursorX = LCDWIDTH - display.fontWidth*3 - 1;
-				display.cursorY++;
-				//display.println(F("\27SD"));
-
-				//toggle volume when B is pressed
-				if(buttons.pressed(BTN_B)){
-					sound.setVolume(sound.getVolume() + 1);
-					sound.playTick();
-				}
-				//leave the menu
-				if(buttons.pressed(BTN_A) || ((frameCount>=startMenuTimer)&&(startMenuTimer != 255))){
-					startMenuTimer = 255; //don't automatically skip the title screen next time it's displayed
-					sound.stopPattern(0);
-					sound.playOK();
-					break;
-				}
-				//flash the loader
-				//if(buttons.pressed(BTN_C))
-					// ToDo changeGame();
-			}
-		}
-		battery.show = true;
-	}
-}
-
-/**
- * Update all the subsystems, like graphics, audio, events, etc.
- * Note: the update rect is used for drawing only part of the screen buffer to LCD. Because of speed optimizations,
- * the x, y, and width of the update rect must be dividable by 4 pixels, and the height must be dividable by 8 pixels.
- * The update rect is currently used for 220x176, 4 colors, screen mode only.
- * @param useDirectMode True, if only direct screen drawing is used. False, if the screen buffer is drawn. Note: If sprites are enabled, they are drawn in both modes.
- * @param updRectX The update rect.
- * @param updRectY The update rect.
- * @param updRectW The update rect.
- * @param updRectH The update rect.
- */
-bool Core::update(bool useDirectMode, uint8_t updRectX, uint8_t updRectY, uint8_t updRectW, uint8_t updRectH) {
-
-    #if POK_STREAMING_MUSIC
-        sound.updateStream();
-    #endif
-
-    uint32_t now = getTime();
-	if ((((nextFrameMillis - now)) > timePerFrame) && frameEndMicros) { //if time to render a new frame is reached and the frame end has ran once
-		nextFrameMillis = now + timePerFrame;
-		frameCount++;
-
-		frameEndMicros = 0;
-		backlight.update();
-		buttons.update();
-		battery.update();
-
-        // FPS counter
-		#if defined(PROJ_USE_FPS_COUNTER) ||  defined(PROJ_SHOW_FPS_COUNTER)
-        const uint32_t fpsInterval_ms = 1000*3;
-
-        fps_frameCount++;
-        if (now > fps_refreshtime) {
-            fps_counter = (1000*fps_frameCount) / (now - fps_refreshtime + fpsInterval_ms);
-            fps_refreshtime = now + fpsInterval_ms;
-            fps_frameCount = 0;
-            fps_counter_updated = true;
-        }
-        #endif
-
-		return true;
-
-	} else {
-		if (!frameEndMicros) { //runs once at the end of the frame
-			#if POK_ENABLE_SOUND > 0
-			sound.updateTrack();
-			sound.updatePattern();
-			sound.updateNote();
-			#endif
-			updatePopup();
-			displayBattery();
-
-            display.update(useDirectMode, updRectX, updRectY, updRectW, updRectH); //send the buffer to the screen
-
-            frameEndMicros = 1; //jonne
-
-		}
-		return false;
-	}
-}
-
-void Core::displayBattery(){
-#if (ENABLE_BATTERY > 0)
-	//display.setColor(BLACK, WHITE);
-	uint8_t ox,oy;
-	ox=display.cursorX;
-	oy=display.cursorY;
-	display.cursorX = LCDWIDTH-display.fontWidth+1;
-	display.cursorY = 0;
-	switch(battery.level){
-	case 0://battery critic, power down
-		sound.stopPattern();
-		backlight.set(0);
-		display.clear();
-		display.fontSize = 1;
-		display.print(("LOW BATTERY\n"));
-		display.print(battery.voltage);
-		display.print(("mV\n\nPLEASE\nTURN OFF"));
-		display.update();
-		break;
-	case 1: //empty battery
-		if((frameCount % 16) < 8) display.print('\7'); //blinking battery
-		else display.print('x');
-		break;
-	case 2://low battery
-	case 3://full battery
-	case 4://full battery
-		if(battery.show){
-			display.print(char(5+battery.level));
-		}
-		break;
-	default:
-		if(battery.show){
-			display.print('/');
-		}
-		break;
-	}
-display.cursorX = ox;
-display.cursorY = oy;
-#endif
-}
-
-char* Core::filemenu(char *ext) {
-    uint8_t oldPersistence = display.persistence;
-    display.persistence = false;
-    uint16_t oldpal0=display.palette[0];
-    uint16_t oldpal1=display.palette[1];
-    uint16_t oldpal2=display.palette[2];
-    display.palette[2]=COLOR_GREEN;
-    display.palette[1]=COLOR_WHITE;
-    display.palette[0]=COLOR_BLACK;
-    uint8_t oldbg=display.bgcolor;
-    uint8_t oldfg=display.color;
-    display.color=1;
-    display.bgcolor=0;
-
-	int16_t rowh = display.fontHeight + 2;
-    int8_t activeItem = 0;
-	int16_t currentTopItem = 0;
-	int16_t itemsPerScreen = (display.height+1) / rowh;
-	int16_t numOfItemsFound = 0;
-	boolean exit = false;
-
-	char* txt;
-
-    pokInitSD();
-
-    bool updated = true;
-	while (isRunning()) {
-		if (update(true)) {
-			if (buttons.pressed(BTN_A) || buttons.pressed(BTN_B) || buttons.pressed(BTN_C)) {
-				exit = true; //time to exit menu !
-				if (buttons.pressed(BTN_A)) {
-					sound.playOK();
-				} else {
-				    *selectedfile = 0;
-					sound.playCancel();
-				}
-				updated = true; // update screen
-			}
-			if (exit == false) {
-				if (buttons.repeat(BTN_DOWN,4)) {
-                    if( ++activeItem >= numOfItemsFound ) activeItem = numOfItemsFound - 1;
-					if( activeItem >= currentTopItem + itemsPerScreen) currentTopItem += itemsPerScreen; // next page
-					sound.playTick();
-                    updated = true; // update screen
-				}
-				if (buttons.repeat(BTN_UP,4)) {
-				    if( --activeItem < 0 ) activeItem = 0;
- 					if( activeItem < currentTopItem) currentTopItem -= itemsPerScreen;  // previous page
-					sound.playTick();
-                    updated = true; // update screen
-				}
-
-			} else { //exit :
-				    display.bgcolor=oldbg;
-				    display.color=oldfg;
-				    display.palette[0] = oldpal0;
-				    display.palette[1] = oldpal1;
-				    display.palette[2] = oldpal2;
-				    display.persistence = oldPersistence;
-				    return selectedfile;
-			}
-
-			//draw a fancy menu
-			display.textWrap = false;
-			uint16_t fc,bc;
-			fc = display.color;
-            bc = display.bgcolor;
-            if( updated ) { // update screen?
-                #if POK_SIM
-                getFirstFile(ext);
-                #else
-                bool isFirstFile = true;
-                #endif
-                for (int i = 0; ; i++) {
-                    display.cursorX = 0;
-                    display.invisiblecolor=255;
-                    display.cursorY = (i - currentTopItem ) * rowh;
-
-                    // read the file name from SD
-                    #ifndef POK_SIM
-                    if(isFirstFile) {
-                        txt = getFirstFile(ext);
-                        isFirstFile = false;
-                    }
-                    else
-                    #endif
-
-                    txt = getNextFile(ext);
-
-                    if (txt) {
-
-                        numOfItemsFound = i+1;
-
-                        // Draw active line with diffrent backgtound and char color
-                        if (i == activeItem){
-                            display.cursorX = 3;
-                            display.color=2;
-                            display.fillRect(0, display.cursorY - 2, LCDWIDTH, rowh);
-                            display.setColor(0,2);
-                        } else display.setColor(1,0);
-
-                        // break loop if going out of screen
-                        if(i >= currentTopItem + itemsPerScreen ) {
-                            break;
-                        }
-
-                        // Display only if the file is on the current page
-                        if( i >= currentTopItem) {
-                            display.print(display.cursorX, display.cursorY, txt);
-                            if (i == activeItem)
-                                strcpy(selectedfile,txt);
-                        }
-                    } else
-                        break; // break loop as no more files found
-
-                    display.setColor(1,0);
-                } // end for
-
-                display.update();
-            }
-            updated = false;
-		} // update
-
-        display.setColor(1,0);
-	}
-	return 0;
-}
-
-char* Core::filemenu() {
-    return filemenu("");
-}
-
-int8_t Core::menu(const char* const* items, uint8_t length) {
-if (display.color>4) display.color=1;
-#if (ENABLE_GUI > 0)
-	display.persistence = false;
-	int8_t activeItem = 0;
-	int16_t currentY = display.height;
-	int16_t targetY = 0, rowh = display.fontHeight + 2;
-	boolean exit = false;
-	int8_t answer = -1;
-	while (isRunning()) {
-		if (update()) {
-			if (buttons.pressed(BTN_A) || buttons.pressed(BTN_B) || buttons.pressed(BTN_C)) {
-				exit = true; //time to exit menu !
-				targetY = - display.fontHeight * length - 2; //send the menu out of the screen
-				if (buttons.pressed(BTN_A)) {
-					answer = activeItem;
-					sound.playOK();
-				} else {
-					sound.playCancel();
-				}
-			}
-			if (exit == false) {
-				if (buttons.repeat(BTN_DOWN,4)) {
-					activeItem++;
-					sound.playTick();
-				}
-				if (buttons.repeat(BTN_UP,4)) {
-					activeItem--;
-					sound.playTick();
-				}
-				//don't go out of the menu
-				if (activeItem == length) activeItem = 0;
-				if (activeItem < 0) activeItem = length - 1;
-
-				targetY = -rowh * activeItem + (rowh+4); //center the menu on the active item
-			} else { //exit :
-				if ((currentY - targetY) <= 1)
-				return (answer);
-			}
-			//draw a fancy menu
-			currentY = (currentY + targetY) / 2;
-			display.cursorX = 0;
-			display.cursorY = currentY;
-			display.textWrap = false;
-			uint16_t fc,bc;
-			fc = display.color;
-            bc = display.bgcolor;
-			for (byte i = 0; i < length; i++) {
-				display.cursorY = currentY + rowh * i;
-				if (i == activeItem){
-					display.cursorX = 3;
-
-                    //display.fillRoundRect(0, currentY + display.fontHeight * activeItem - 2, LCDWIDTH, (display.fontHeight+3), 3);
-                    display.fillRect(0, currentY + rowh * activeItem - 2, LCDWIDTH, (rowh));
-                    display.setColor(bc,fc);
-				} else display.setColor(fc,bc);
-
-				display.println((char*)*(const unsigned int*)(items+i));
-				display.setColor(fc,bc);
-			}
-
-		}
-	}
-#else
-	return 0;
-#endif
-	return 0;
-}
-
-void Core::keyboard(char* text, uint8_t length) {
-#if (ENABLE_GUI > 0)
-	display.persistence = false;
-	//memset(text, 0, length); //clear the text
-	text[length-1] = '\0';
-	//active character in the typing area
-	int8_t activeChar = 0;
-	//selected char on the keyboard
-	int8_t activeX = 0;
-	int8_t activeY = 2;
-	//position of the keyboard on the screen
-	int8_t currentX = LCDWIDTH;
-	int8_t currentY = LCDHEIGHT;
-	int8_t targetX = 0;
-	int8_t targetY = 0;
-
-	while (1) {
-		if (update()) {
-			//move the character selector
-			if (buttons.repeat(BTN_DOWN, 4)) {
-				activeY++;
-				sound.playTick();
-			}
-			if (buttons.repeat(BTN_UP, 4)) {
-				activeY--;
-				sound.playTick();
-			}
-			if (buttons.repeat(BTN_RIGHT, 4)) {
-				activeX++;
-				sound.playTick();
-			}
-			if (buttons.repeat(BTN_LEFT, 4)) {
-				activeX--;
-				sound.playTick();
-			}
-			//don't go out of the keyboard
-			if (activeX == KEYBOARD_W) activeX = 0;
-			if (activeX < 0) activeX = KEYBOARD_W - 1;
-			if (activeY == KEYBOARD_H) activeY = 0;
-			if (activeY < 0) activeY = KEYBOARD_H - 1;
-			//set the keyboard position on screen
-			targetX = -(display.fontWidth+1) * activeX + LCDWIDTH / 2 - 3;
-			targetY = -(display.fontHeight+1) * activeY + LCDHEIGHT / 2 - 4 - display.fontHeight;
-			//smooth the keyboard displacement
-			currentX = (targetX + currentX) / 2;
-			currentY = (targetY + currentY) / 2;
-			//type character
-			if (buttons.pressed(BTN_A)) {
-				if (activeChar < (length-1)) {
-					byte thisChar = activeX + KEYBOARD_W * activeY;
-					if((thisChar == 0)||(thisChar == 10)||(thisChar == 13)) //avoid line feed and carriage return
-					continue;
-					text[activeChar] = thisChar;
-					text[activeChar+1] = '\0';
-				}
-				activeChar++;
-				sound.playOK();
-				if (activeChar > length)
-				activeChar = length;
-			}
-			//erase character
-			if (buttons.pressed(BTN_B)) {
-				activeChar--;
-				sound.playCancel();
-				if (activeChar >= 0)
-				text[activeChar] = 0;
-				else
-				activeChar = 0;
-			}
-			//leave menu
-			if (buttons.pressed(BTN_C)) {
-				sound.playOK();
-				while (1) {
-					if (update()) {
-						//display.setCursor(0,0);
-						display.println(("You entered\n"));
-						display.print(text);
-						display.println(("\n\n\n\x15:okay \x16:edit"));
-						if(buttons.pressed(BTN_A)){
-							sound.playOK();
-							return;
-						}
-						if(buttons.pressed(BTN_B)){
-							sound.playCancel();
-							break;
-						}
-					}
-				}
-			}
-			//draw the keyboard
-			for (int8_t y = 0; y < KEYBOARD_H; y++) {
-				for (int8_t x = 0; x < KEYBOARD_W; x++) {
-					display.drawChar(currentX + x * (display.fontWidth+1), currentY + y * (display.fontHeight+1), x + y * KEYBOARD_W, 1);
-				}
-			}
-			//draw instruction
-			display.cursorX = currentX-display.fontWidth*6-2;
-			display.cursorY = currentY+1*(display.fontHeight+1);
-			display.print(("\25type"));
-
-			display.cursorX = currentX-display.fontWidth*6-2;
-			display.cursorY = currentY+2*(display.fontHeight+1);
-			display.print(("\26back"));
-
-			display.cursorX = currentX-display.fontWidth*6-2;
-			display.cursorY = currentY+3*(display.fontHeight+1);
-			display.print(("\27save"));
-
-			//erase some pixels around the selected character
-			display.setColor(WHITE);
-			display.drawFastHLine(currentX + activeX * (display.fontWidth+1) - 1, currentY + activeY * (display.fontHeight+1) - 2, 7);
-			//draw the selection rectangle
-			display.setColor(BLACK);
-			display.drawRoundRect(currentX + activeX * (display.fontWidth+1) - 2, currentY + activeY * (display.fontHeight+1) - 3, (display.fontWidth+2)+(display.fontWidth-1)%2, (display.fontHeight+5), 3);
-			//draw keyboard outline
-			//display.drawRoundRect(currentX - 6, currentY - 6, KEYBOARD_W * (display.fontWidth+1) + 12, KEYBOARD_H * (display.fontHeight+1) + 12, 8, BLACK);
-			//text field
-			display.drawFastHLine(0, LCDHEIGHT-display.fontHeight-2, LCDWIDTH);
-			display.setColor(WHITE);
-			display.fillRect(0, LCDHEIGHT-display.fontHeight-1, LCDWIDTH, display.fontHeight+1);
-			//typed text
-			display.cursorX = 0;
-			display.cursorY = LCDHEIGHT-display.fontHeight;
-			display.setColor(BLACK);
-			display.print(text);
-			//blinking cursor
-			if (((frameCount % 8) < 4) && (activeChar < (length-1)))
-			display.drawChar(display.fontWidth * activeChar, LCDHEIGHT-display.fontHeight, '_',1);
-		}
-	}
-#endif
-}
-
-void Core::popup(const char* text, uint8_t duration){
-#if (ENABLE_GUI > 0)
-	popupText = text;
-	popupTimeLeft = duration+12;
-#endif
-}
-
-void Core::updatePopup(){
-#if (ENABLE_GUI > 0)
-	if (popupTimeLeft){
-		uint8_t yOffset = 0;
-		if(popupTimeLeft<12){
-			yOffset = 12-popupTimeLeft;
-		}
-		display.fontSize = 1;
-		display.setColor(WHITE);
-		display.fillRoundRect(0,LCDHEIGHT-display.fontHeight+yOffset-3,84,display.fontHeight+3,3);
-		display.setColor(BLACK);
-		display.drawRoundRect(0,LCDHEIGHT-display.fontHeight+yOffset-3,84,display.fontHeight+3,3);
-		display.cursorX = 4;
-		display.cursorY = LCDHEIGHT-display.fontHeight+yOffset-1;
-		display.print(popupText);
-		popupTimeLeft--;
-	}
-#endif
-}
-
-void Core::setFrameRate(uint8_t fps) {
-	timePerFrame = 1000 / fps;
-	sound.prescaler = fps / 20;
-	sound.prescaler = __avrmax(1, sound.prescaler);
-}
-
-void Core::pickRandomSeed(){
-        initRandom();
-}
-
-bool Core::collidePointRect(int16_t x1, int16_t y1 ,int16_t x2 ,int16_t y2, int16_t w, int16_t h){
-	if((x1>=x2)&&(x1<x2+w))
-	if((y1>=y2)&&(y1<y2+h))
-	return true;
-	return false;
-}
-
-bool Core::collideRectRect(int16_t x1, int16_t y1, int16_t w1, int16_t h1 ,int16_t x2 ,int16_t y2, int16_t w2, int16_t h2){
-  return !( x2     >=  x1+w1  ||
-            x2+w2  <=  x1     ||
-            y2     >=  y1+h1  ||
-            y2+h2  <=  y1     );
-}
-
-bool Core::collideBitmapBitmap(int16_t x1, int16_t y1, const uint8_t* b1, int16_t x2, int16_t y2, const uint8_t* b2){
-  int16_t w1 = pgm_read_byte(b1);
-  int16_t h1 = pgm_read_byte(b1 + 1);
-  int16_t w2 = pgm_read_byte(b2);
-  int16_t h2 = pgm_read_byte(b2 + 1);
-
-  if(collideRectRect(x1, y1, w1, h1, x2, y2, w2, h2) == false){
-    return false;
-  }
-
-  int16_t xmin = (x1>=x2)? 0 : x2-x1;
-  int16_t ymin = (y1>=y2)? 0 : y2-y1;
-  int16_t xmax = (x1+w1>=x2+w2)? x2+w2-x1 : w1;
-  int16_t ymax = (y1+h1>=y2+h2)? y2+h2-y1 : h1;
-  for(uint8_t y = ymin; y < ymax; y++){
-    for(uint8_t x = xmin; x < xmax; x++){
-      if(display.getBitmapPixel(b1, x, y) && display.getBitmapPixel(b2, x1+x-x2, y1+y-y2)){
-        return true;
-      }
-    }
-  }
-  return false;
-}
-
-
-//** EOF **//
-
-
-
-
-
-
-
-
-
--- a/POKITTO_CORE/PokittoCore.h	Wed Jun 27 13:14:54 2018 +0000
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,267 +0,0 @@
-/**************************************************************************/
-/*!
-    @file     PokittoCore.h
-    @author   Jonne Valola
-
-    @section LICENSE
-
-    Software License Agreement (BSD License)
-
-    Copyright (c) 2016, Jonne Valola
-    All rights reserved.
-
-    Redistribution and use in source and binary forms, with or without
-    modification, are permitted provided that the following conditions are met:
-    1. Redistributions of source code must retain the above copyright
-    notice, this list of conditions and the following disclaimer.
-    2. Redistributions in binary form must reproduce the above copyright
-    notice, this list of conditions and the following disclaimer in the
-    documentation and/or other materials provided with the distribution.
-    3. Neither the name of the copyright holders nor the
-    names of its contributors may be used to endorse or promote products
-    derived from this software without specific prior written permission.
-
-    THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS ''AS IS'' AND ANY
-    EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
-    WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
-    DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER BE LIABLE FOR ANY
-    DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-    (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-    LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-    ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-    (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
-    SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-*/
-/**************************************************************************/
-
-#ifndef POKITTOCORE_H
-#define POKITTOCORE_H
-
-#include <stdint.h>
-#include <math.h>
-#ifndef POK_SIM
-    #include "pwmout_api.h"
-    #include "HWButtons.h"
-#else
-    #include "PokittoSimulator.h"
-#endif
-#if POK_USE_CONSOLE > 0
-    #include "PokittoConsole.h"
-#endif // POK_USE_CONSOLE
-#if POK_ENABLE_SD > 0
-    #include "PokittoDisk.h"
-#endif
-
-#include "PokittoFonts.h"
-#include "PokittoPalettes.h"
-#include "PokittoDisplay.h"
-#include "PokittoButtons.h"
-#include "PokittoBattery.h"
-#include "PokittoBacklight.h"
-#include "PokittoSound.h"
-#include "PokittoFakeavr.h"
-
-#define PALETTE_SIZE 256
-#define PI 3.141592741f
-
-// For GB compatibility
-#if PROJ_GAMEBUINO > 0
-extern void setup();
-extern void loop();
-#endif // PROJ_GAMEBUINO
-
-extern uint32_t* ptimer; // re-directed tick counter
-
-namespace Pokitto {
-
-/** Core class.
- *  The Core class is a class consisting of static data and methods.
- *  It handles the lowlevel hardware functions of the Pokitto.
- *  It is declared as static to prevent several instances running at same time.
- * Example:
- * @code
- * // A simple "Hello World!" program with Pokitto
- *
- * #include "Pokitto.h"
- *
- * Pokitto::Core myApp;
- *
- * int main() {
- *     myApp.begin(); // This starts up the console (the display, buttons etc.)
- *     while(myApp.isRunning()) {
- *         if(myApp.Update()) {
- *             myApp.display.print("Hello World!");
- *         }
- *     }
- * }
- * @endcode
- */
-
-class Core
-{
-public:
-  /** Create a Core runtime instance
-  */
-  Core();
-
-  /** Backlight component of the Core runtime */
-  static Backlight backlight;
-  /** Buttons component of the Core runtime */
-  static Buttons buttons;
-  /** Battery component of the Core runtime */
-  static Battery battery;
-  /** Sound component of the Core runtime */
-  static Sound sound;
-  /** Display component of the Core runtime */
-  static Display display;
-
-  // EXCECUTION CONTROL
-public:
-  /** Initialize runtime (use this one) */
-  static void begin();
-  /** Initialize runtime (deprecated, avoid) */
-  static void init();
-  /** Initialize runtime with options (deprecated, avoid) */
-  static void init(uint8_t);
-  /** Return run state (1 = running, 0 = shutting down) */
-  static bool isRunning();
-  /** Stop running */
-  static void quit();
-//private:
-  /** run_state is true as long as program is running */
-  static bool run_state;
-
-public:
-  // INITIALIZATION
-  /** Initialize display */
-  static void initDisplay();
-  /** Initialize random generator */
-  static void initRandom();
-  /** Initialize GPIO */
-  static void initGPIO();
-  /** Initialize LCD */
-  static void initLCD();
-  /** Initialize Audio */
-  static void initAudio();
-
-
-  // DISPLAY
-public:
-  /** Initialize backlight */
-  static void initBacklight();
-
-private:
-  /** Backlight PWM pointer */
-  #ifndef POK_SIM
-  static pwmout_t backlightpwm;
-  #endif
-
-  // TIMEKEEPING
-public:
-  /** Initialize runtime clock */
-  static void initClock();
-  /** Get value of time elapsed during program in milliseconds */
-  static uint32_t getTime();
-  /** Wait for n milliseconds */
-  static void wait(uint16_t);
-  /** FPS */
-  static uint32_t fps_counter;
-  static bool fps_counter_updated;
-private:
-  /** Time of next refresh */
-  static uint32_t refreshtime;
-
-  // DIRECT TO SCREEN
-public:
-  /** Display Pokitto logo */
-  static void showLogo();
-  static void showWarning();
-  static void setVolLimit();
-
-// BUTTON INPUT HANDLING
-public:
-  static void initButtons();
-  static void pollButtons();
-  static uint8_t leftBtn();
-  static uint8_t rightBtn();
-  static uint8_t upBtn();
-  static uint8_t downBtn();
-  static uint8_t aBtn();
-  static uint8_t bBtn();
-  static uint8_t cBtn();
-  static uint8_t leftHeld();
-  static uint8_t rightHeld();
-  static uint8_t upHeld();
-  static uint8_t downHeld();
-  static uint8_t aHeld();
-  static uint8_t bHeld();
-  static uint8_t cHeld();
-
-  static uint8_t leftReleased();
-  static uint8_t rightReleased();
-  static uint8_t upReleased();
-  static uint8_t downReleased();
-  static uint8_t aReleased();
-  static uint8_t bReleased();
-  static uint8_t cReleased();
-
-  // AUDIO RELATED
-  static uint8_t ampIsOn();
-  static void ampEnable(uint8_t);
-  static uint8_t soundbyte;
-
-  // GB RELATED
-public:
-    static void readSettings();
-    static void titleScreen(const char* name, const uint8_t *logo);
-	static void titleScreen(const char* name);
-	static void titleScreen(const uint8_t* logo);
-    static void titleScreen();
-    static bool update(bool useDirectMode=false, uint8_t updRectX=0, uint8_t updRectY=0, uint8_t updRectW=LCDWIDTH, uint8_t updRectH=LCDHEIGHT);
-    static uint32_t frameCount;
-    static int8_t menu(const char* const* items, uint8_t length);
-    static char* filemenu(char*);
-    static char* filemenu();
-    static void keyboard(char* text, uint8_t length);
-    static void popup(const char* text, uint8_t duration);
-    static void setFrameRate(uint8_t fps);
-	static void pickRandomSeed();
-
-	static uint8_t getCpuLoad();
-    static uint16_t getFreeRam();
-
-    static bool collidePointRect(int16_t x1, int16_t y1 ,int16_t x2 ,int16_t y2, int16_t w, int16_t h);
-	static bool collideRectRect(int16_t x1, int16_t y1, int16_t w1, int16_t h1 ,int16_t x2 ,int16_t y2, int16_t w2, int16_t h2);
-    static bool collideBitmapBitmap(int16_t x1, int16_t y1, const uint8_t* b1, int16_t x2, int16_t y2, const uint8_t* b2);
-
-private:
-    static uint8_t timePerFrame;
-    static uint32_t nextFrameMillis;
-    static void updatePopup();
-    static const char* popupText;
-    static uint8_t popupTimeLeft;
-    static void displayBattery();
-    static uint16_t frameDurationMicros;
-    static uint32_t frameStartMicros, frameEndMicros;
-    static uint8_t startMenuTimer;
-    static int updateLoader(uint32_t,uint32_t);
-    static uint32_t fps_refreshtime;
-    static uint32_t fps_frameCount;
-
-public:
-    static uint8_t volbar_visible;
-    static void drawvolbar(int,int,int, bool);
-    static void askLoader();
-    static void jumpToLoader();
-};
-
-// this is the instance used by the system
-extern Core core;
-
-
-}
-
-#endif // POKITTOCORE_H
-
-
-
--- a/POKITTO_CORE/PokittoDisk.cpp	Wed Jun 27 13:14:54 2018 +0000
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,318 +0,0 @@
-/**************************************************************************/
-/*!
-    @file     Pokitto_disk.cpp
-    @author   Jonne Valola
-
-    @section LICENSE
-
-    Pokitto development stage library
-    Software License Agreement
-
-    Copyright (c) 2015, Jonne Valola ("Author")
-    All rights reserved.
-
-    This library is intended solely for the purpose of Pokitto development.
-
-    Redistribution and use in source and binary forms, with or without
-    modification requires written permission from Author.
-*/
-/**************************************************************************/
-
-#include "Pokitto.h"
-
-#define SD_MOSI_PORT   0
-#define SD_MISO_PORT   0
-#define SD_SCK_PORT    0
-#define SD_CS_PORT     0
-#define SD_MOSI_PIN   9
-#define SD_MISO_PIN   8
-#define SD_SCK_PIN    6
-#define SD_CS_PIN     7
-
-#if POK_ENABLE_SD > 0
-#ifndef NOPETITFATFS
-BYTE res;
-FATFS fs;            /* File system object */
-FATDIR dir;            /* Directory object */
-FILINFO fno;        /* File information */
-
-//static FATFS *FatFs;    /* Pointer to the file system object (logical drive) */
-
-bool diropened=false;
-
-#define SPEAKER 3
-//#define BUFFER_SIZE 256 // was 128
-#define SONGLENGTH 0x1BFBCD // 1072223
-#define FILESIZE 0x1BFBCD
-
-uint8_t filemode = FILE_MODE_UNINITIALIZED;
-char currentfile[15]; // holds current file's name
-
-SPI device(CONNECT_MOSI,CONNECT_MISO,CONNECT_SCK);
-//DigitalOut mmccs(CONNECT_CS);
-
-const char *get_filename_ext(const char *filename) {
-    const char *dot = strrchr(filename, '.');
-    if(!dot || dot == filename) return "";
-    return dot + 1;
-}
-
-__attribute__((section(".SD_Code"))) void initSDGPIO() {
-    LPC_GPIO_PORT->DIR[SD_MOSI_PORT] |= (1  << SD_MOSI_PIN );
-    LPC_GPIO_PORT->DIR[SD_MISO_PORT] |= (1  << SD_MISO_PIN );
-    LPC_GPIO_PORT->DIR[SD_SCK_PORT]  |= (1  << SD_SCK_PIN );
-    LPC_GPIO_PORT->DIR[SD_CS_PORT]   |= (1  << SD_CS_PIN );
-}
-
-__attribute__((section(".SD_Code"))) int pokInitSD() {
-    initSDGPIO();
-    #ifndef NOPETITFATFS
-    res = disk_initialize();
-    #else
-    res = disk_initialize(0);
-    #endif
-    res = (pf_mount(&fs));
-    res = pf_opendir(&dir,"");
-    if (res) diropened=false;
-    else diropened=true;
-    return res;
-}
-
-
-void emptyFname() {
-    for (int i=0; i<13; i++) fno.fname[i]=NULL;
-}
-
-/** PUBLIC FUNCTIONS **/
-
-char* getFirstDirEntry() {
-    res=0;
-    if (!diropened) {
-            pokInitSD();
-    }
-    res = pf_opendir(&dir,"");
-    emptyFname();
-    res = pf_readdir(&dir,&fno); //returns 0 if everything is OK
-    if (res) return 0;
-    while (res==0) { //while res is ok
-        if ((fno.fattrib & 0x02)==0) {
-                if (fno.fattrib & 0x10) {
-                    fno.fname[8]='.';
-                    fno.fname[9]='D';
-                    fno.fname[10]='I';
-                    fno.fname[11]='R';
-                    fno.fname[12]='\0';
-                }
-                return fno.fname;
-        }
-        emptyFname();
-        res = pf_readdir(&dir,&fno); //returns 0 if everything is OK
-        if (res==0 && dir.index==0) break;
-    }
-    return 0;
-}
-
-char* getNextDirEntry() {
-    if (!diropened) pokInitSD();
-    emptyFname();
-	res = pf_readdir(&dir,&fno); //returns 0 if everything is OK
-	if (res==0) {
-	        while (fno.fattrib & 0x02 && !res) {emptyFname(); res = pf_readdir(&dir,&fno);} //system/hidden file
-	        if (fno.fattrib & 0x10) {
-	                int a=12;
-                    while (a) {
-                            fno.fname[a] = fno.fname[a-1];
-                            a--;
-                    }
-                    if (fno.fname[0]) {
-                            fno.fname[0]='/';
-                            a=0;
-                            while (fno.fname[a]) a++;
-                            fno.fname[a]='/';
-                    }
-
-	                /*fno.fname[a++]='.';
-                    fno.fname[a++]='D';
-                    fno.fname[a++]='I';
-                    fno.fname[a++]='R';
-                    fno.fname[a]='\0';*/
-	        }
-	        return fno.fname;
-	}
-    return NULL;
-}
-
-char* getNextFile (char* ext){
-
-    if (!diropened) pokInitSD();
-	int a=1;
-	emptyFname();
-	res = pf_readdir(&dir,&fno); //returns 0 if everything is OK
-	while (res==0 || a) { //while there are entries and
-        if (dir.index==0) return 0; //end of list
-        a = strcmp((const char*)get_filename_ext(fno.fname),(const char*)ext); // returns 0 if strings are identical
-        if (strcmp(ext,"")==0 && (fno.fattrib & 0x10) == 0) a=0;
-        if (a == 0 && (fno.fattrib & 0x10) == 0) return fno.fname;
-        if (fno.fname[0]==NULL) return NULL; //end of files
-        //if (fno.fattrib&0x10) return NULL; //its a directory
-        emptyFname();
-        res = pf_readdir(&dir,&fno); //returns 0 if everything is OK
-	}
-return 0;
-}
-
-
-char* getNextFile() {
-    return getNextFile("");
-}
-
-char* getFirstFile(char* ext) {
-    res=0;
-    if (!diropened) {
-            pokInitSD();
-    }
-    res = pf_opendir(&dir,"");
-    emptyFname();
-    res = pf_readdir(&dir,&fno); //returns 0 if everything is OK
-    if (res) return 0;
-    while (res==0 || (fno.fattrib & 0x10) == 0) {
-        int a=0;
-        a = strcmp((const char*)get_filename_ext(fno.fname),(const char*)ext); // returns 0 if strings are identical
-        if (!strcmp(ext,"")) a=0;
-        if ( a == 0 && (fno.fattrib & 0x10) == 0) return fno.fname;
-        emptyFname();
-        res = pf_readdir(&dir,&fno); //returns 0 if everything is OK
-        if (fno.fname[0]==NULL) break; //end of directory reached, no files found
-        if (res==0 && dir.index==0) break;
-    }
-    return 0;
-}
-
-char* getFirstFile() {
-    return getFirstFile("");
-}
-
-int isThisFileOpen(char* buffer){
-    int a=0;
-    a = strcmp((const char*)buffer,(const char*)currentfile); // returns 0 if strings are identical
-    if ( a == 0 && filemode != FILE_MODE_FAILED) return 1;
-    return 0;
-}
-
-int fileOK() {
-    if (filemode != FILE_MODE_FAILED) return 1;
-    return 0;
-}
-
-uint8_t fileOpen(char* buffer, char fmode) {
-    int err;
-    if (filemode == FILE_MODE_UNINITIALIZED) {
-        int a = pf_mount(&fs);
-        if (a) return 1; // 1 means error in this context
-    }
-
-    filemode = fmode;
-    err = pf_open(buffer);
-    if (err==0) {
-            strcpy(currentfile,(const char*)buffer);
-            return 0; // 0 means all clear
-    }
-    // file open failed
-    filemode = FILE_MODE_FAILED;
-    return 1; // 1 means failed
-}
-
-void fileClose() {
-    filemode = FILE_MODE_UNINITIALIZED;
-    for (uint8_t i=0; i<15; i++) currentfile[i]=0;
-}
-
-char fileGetChar() {
-    BYTE buff[1];
-    WORD br;
-    int err = pf_read(buff, 1, &br);    /* Read data to the buff[] */
-    return buff[0];
-}
-
-void filePutChar(char c) {
-    WORD bw;
-    pf_write((const void*)&c, 1, &bw);
-    pf_write(0, 0, &bw);
-}
-
-void fileWriteBytes(uint8_t * b, uint16_t n) {
-    WORD bw;
-    pf_write((const void*)&b, n, &bw);
-    pf_write(0, 0, &bw);
-}
-
-uint16_t fileReadBytes(uint8_t * b, uint16_t n) {
-    WORD br;
-    pf_read(b, n, &br);    /* Read data to the buff[] */
-    return br;             /* Return number of bytes read */
-}
-
-void fileSeekAbsolute(long n) {
-    res = pf_lseek(n);
-}
-
-void fileSeekRelative(long n) {
-    if (n<0) if (fs.fptr < -n) n=-fs.fptr;
-    else if (n>0) if (fs.fptr+n > fs.fsize) n=fs.fsize-fs.fptr;
-    res = pf_lseek(fs.fptr + n);
-}
-
-void fileRewind() {
-  res = pf_lseek(0);
-}
-
-void fileEnd() {
-  res = pf_lseek(fs.fsize);
-}
-
-long int fileGetPosition() {
-    return fs.fptr;
-}
-
-uint8_t filePeek(long n) {
-    pf_lseek(n);
-    return fileGetChar();
-}
-
-void filePoke(long n, uint8_t c) {
-    pf_lseek(n);
-    filePutChar(c);
-}
-
-int fileReadLine(char* destination, int maxchars) {
-    int n=0;
-    char c=1;
-    char linebuf[80];
-    fileReadBytes((uint8_t*)linebuf,80);
-    int index=0;
-    while (c!=NULL) {
-        c = linebuf[index++];
-        if (n == 0) {
-            while (c == '\n' || c == '\r') c = linebuf[index++]; // skip empty lines
-        }
-        n++;
-        if (c=='\n' || c=='\r' || n==maxchars-1) c=NULL; //prevent buffer overflow
-        *destination++ = c;
-    }
-    fileSeekRelative(-80+index); //rewind
-    return n; //number of characters read
-}
-
-int dirOpen() {
-    return pf_opendir(&dir,"");
-}
-
-int dirUp() {
-
-return 0;
-}
-#endif // NOPETITFATFS
-#endif // POK_ENABLE_SD
-
-
-
--- a/POKITTO_CORE/PokittoDisk.h	Wed Jun 27 13:14:54 2018 +0000
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,119 +0,0 @@
-/**************************************************************************/
-/*!
-    @file     PokittoDisk.h
-    @author   Jonne Valola
-
-    @section LICENSE
-
-    Software License Agreement (BSD License)
-
-    Copyright (c) 2016, Jonne Valola
-    All rights reserved.
-
-    Redistribution and use in source and binary forms, with or without
-    modification, are permitted provided that the following conditions are met:
-    1. Redistributions of source code must retain the above copyright
-    notice, this list of conditions and the following disclaimer.
-    2. Redistributions in binary form must reproduce the above copyright
-    notice, this list of conditions and the following disclaimer in the
-    documentation and/or other materials provided with the distribution.
-    3. Neither the name of the copyright holders nor the
-    names of its contributors may be used to endorse or promote products
-    derived from this software without specific prior written permission.
-
-    THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS ''AS IS'' AND ANY
-    EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
-    WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
-    DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER BE LIABLE FOR ANY
-    DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-    (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-    LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-    ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-    (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
-    SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-*/
-/**************************************************************************/
-
-
-#ifndef POKITTO_DISK_H
-#define POKITTO_DISK_H
-
-#include "Pokitto_settings.h" // needed for NOPETITFATFS
-
-#ifndef POK_SIM
-// real hardware disk driver
-#ifndef NOPETITFATFS
-#include "diskio.h"
-#include "pff.h"
-#include "connect.h"
-extern BYTE res;
-extern FATFS fs;            /* File system object */
-extern FATDIR dir;            /* Directory object */
-extern FILINFO fno;        /* File information */
-#endif
-
-#include "mbed.h"
-
-extern SPI device;
-extern DigitalOut mmccs;
-
-/**************************************************************************/
-/**                          SD CONTROL MACROS                           **/
-/**************************************************************************/
-
-// CS ... #define CONNECT_CS      P0_7 //p13
-#define CLR_SD_CS LPC_GPIO_PORT->CLR[0] = (1 << 7)
-#define SET_SD_CS LPC_GPIO_PORT->SET[0] = (1 << 7)
-#define GET_SD_CS LPC_GPIO_PORT->PIN[0] & (1 << 7)
-
-#else
-// simulated disk driver
-#endif
-
-#include <stdint.h>
-
-
-
-extern int pokInitSD();
-
-// File IO modes
-#define FILE_MODE_APPEND 0x1
-#define FILE_MODE_OVERWRITE 0
-#define FILE_MODE_READONLY 0x2
-#define FILE_MODE_READWRITE 0
-#define FILE_MODE_BINARY 0x4
-#define FILE_MODE_ASCII 0
-#define FILE_MODE_FAILED 0x8
-#define FILE_MODE_UNINITIALIZED 0x10
-
-extern uint8_t fileOpen(char*, char);
-extern void fileClose();
-extern char fileGetChar();
-extern void filePutChar(char);
-extern void fileWriteBytes(uint8_t *, uint16_t);
-extern uint16_t fileReadBytes(uint8_t *, uint16_t);
-extern void fileSeekAbsolute(long);
-extern void fileSeekRelative(long);
-extern void fileRewind();
-extern void fileEnd();
-extern long int fileGetPosition();
-#define fileSetPosition(n)  (fileSeekAbsolute(n))
-extern uint8_t filePeek(long);
-extern void filePoke(long, uint8_t);
-extern int fileReadLine(char*,int);
-extern char* getCurrentFileName ();
-extern char* getNextFile (char*);
-extern char* getNextFile ();
-extern char* getFirstFile(char*);
-extern char* getFirstFile();
-extern char* getFirstDirEntry();
-extern char* getNextDirEntry();
-extern int isThisFileOpen(char*);
-extern int fileOK();
-extern int dirOpen();
-extern int dirUp();
-
-#endif // POKITTO_DISK_H
-
-
-
--- a/POKITTO_CORE/PokittoDisplay.cpp	Wed Jun 27 13:14:54 2018 +0000
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,2564 +0,0 @@
-/**************************************************************************/
-/*!
-    @file     PokittoDisplay.cpp
-    @author   Jonne Valola
-
-    @section LICENSE
-
-    Software License Agreement (BSD License)
-
-    Copyright (c) 2016, Jonne Valola
-    All rights reserved.
-
-    Redistribution and use in source and binary forms, with or without
-    modification, are permitted provided that the following conditions are met:
-    1. Redistributions of source code must retain the above copyright
-    notice, this list of conditions and the following disclaimer.
-    2. Redistributions in binary form must reproduce the above copyright
-    notice, this list of conditions and the following disclaimer in the
-    documentation and/or other materials provided with the distribution.
-    3. Neither the name of the copyright holders nor the
-    names of its contributors may be used to endorse or promote products
-    derived from this software without specific prior written permission.
-
-    THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS ''AS IS'' AND ANY
-    EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
-    WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
-    DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER BE LIABLE FOR ANY
-    DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-    (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-    LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-    ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-    (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
-    SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-*/
-/**************************************************************************/
-
-
-/* THE SEGMENT BELOW PERTAINS TO CIRCLE DRAWING FUNCTIONS ONLY
-*
-This is the core graphics library for all our displays, providing a common
-set of graphics primitives (points, lines, circles, etc.).  It needs to be
-paired with a hardware-specific library for each display device we carry
-(to handle the lower-level functions).
-Adafruit invests time and resources providing this open source code, please
-support Adafruit & open-source hardware by purchasing products from Adafruit!
-Copyright (c) 2013 Adafruit Industries.  All rights reserved.
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are met:
-- Redistributions of source code must retain the above copyright notice,
-  this list of conditions and the following disclaimer.
-- Redistributions in binary form must reproduce the above copyright notice,
-  this list of conditions and the following disclaimer in the documentation
-  and/or other materials provided with the distribution.
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
-AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
-LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
-CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
-SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
-INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
-CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
-ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
-POSSIBILITY OF SUCH DAMAGE.
-*/
-
-#include "PokittoDisplay.h"
-#include "Pokitto_settings.h"
-#include "GBcompatibility.h"
-#include "PokittoCore.h"
-#include "PokittoSound.h"
-#include <stdio.h>
-#include <string.h>
-#ifdef DISABLEAVRMIN
-#include <algorithm>
-using std::min;
-using std::max;
-#endif // DISABLEAVRMIN
-
-#ifndef POK_SIM
-#include "HWLCD.h"
-#else
-#include "SimLCD.h"
-#endif
-
-extern "C" void CheckStack();
-extern char _ebss[];  // In map file
-extern char _vStackTop[];  // In map file
-
-Pokitto::Core core;
-Pokitto::Sound _pdsound;
-
-using namespace Pokitto;
-
-
-
-uint8_t* Display::m_scrbuf;
-uint8_t* Display::m_tileset;
-uint8_t* Display::m_tilebuf;
-uint8_t* Display::m_tilecolorbuf;
-uint8_t Display::m_mode, Display::m_colordepth;
-uint8_t Display::palOffset;
-SpriteInfo Display::m_sprites[SPRITE_COUNT];
-uint8_t Display::fontSize=1;
-int16_t Display::cursorX,Display::cursorY;
-uint16_t Display::m_w,Display::m_h;
-uint8_t Display::fontWidth, Display::fontHeight;
-bool Display::textWrap=true;
-
-uint8_t Display::persistence = 0;
-uint16_t Display::color = 1;
-uint16_t Display::bgcolor = 0;
-uint16_t Display::invisiblecolor = 17;
-uint16_t Display::directcolor=0xFFFF;
-uint16_t Display::directbgcolor=0x0;
-bool Display::directtextrotated=false;
-int16_t Display::clipX = 0;
-int16_t Display::clipY = 0;
-int16_t Display::clipW = LCDWIDTH;
-int16_t Display::clipH = LCDHEIGHT;
-
-uint16_t* Display::paletteptr;
-uint16_t Display::palette[PALETTE_SIZE];
-const unsigned char* Display::font;
-int8_t Display::adjustCharStep = 1;
-int8_t Display::adjustLineStep = 1;
-bool Display::fixedWidthFont = false;
-
-/** drawing canvas **/
-//uint8_t* Display::canvas; // points to the active buffer. if null, draw direct to screen
-
-/** screenbuffer **/
-uint8_t Display::bpp = POK_COLORDEPTH;
-#ifndef POK_TILEDMODE
-#if (POK_SCREENMODE == MODE_HI_MONOCHROME)
-    uint8_t Display::width = POK_LCD_W;
-    uint8_t Display::height = POK_LCD_H;
-    uint8_t Display::screenbuffer[((POK_LCD_H+1)*POK_LCD_W)*POK_COLORDEPTH/8]; // maximum resolution
-#elif (POK_SCREENMODE == MODE_HI_4COLOR)
-    uint8_t Display::width = POK_LCD_W;
-    uint8_t Display::height = POK_LCD_H;
-    uint8_t __attribute__((section (".bss"))) Display::screenbuffer[((POK_LCD_H)*POK_LCD_W)/4]; // maximum resolution
-#elif (POK_SCREENMODE == MODE_FAST_16COLOR)
-    uint8_t Display::width = POK_LCD_W/2;
-    uint8_t Display::height = POK_LCD_H/2;
-    uint8_t Display::screenbuffer[(((POK_LCD_H/2)+1)*POK_LCD_W/2)*POK_COLORDEPTH/8]; // half resolution
-#elif (POK_SCREENMODE == MODE_HI_16COLOR)
-    uint8_t Display::width = POK_LCD_W;
-    uint8_t Display::height = POK_LCD_H;
-    uint8_t Display::screenbuffer[POK_LCD_H*POK_LCD_W/2]; // 4 bits per pixel
-#elif (POK_SCREENMODE == MODE_LAMENES)
-    uint8_t Display::width = 128;
-    uint8_t Display::height = 120;
-    uint8_t Display::screenbuffer[((121)*128)*POK_COLORDEPTH/8]; // half resolution
-#elif (POK_SCREENMODE == MODE_GAMEBOY)
-    uint8_t Display::width = 160;
-    uint8_t Display::height = 144;
-    uint8_t Display::screenbuffer[160*144/4];
-#elif (POK_SCREENMODE == MODE14)
-    uint8_t Display::width = 220;
-    uint8_t Display::height = 176;
-    uint8_t Display::screenbuffer[14520];
-#elif (POK_SCREENMODE == MODE13)
-    uint8_t Display::width = 110;
-    uint8_t Display::height = 88;
-    uint8_t Display::screenbuffer[110*88]; // 8bit 110x88
-#elif (POK_SCREENMODE == MODE15)
-    uint8_t Display::width = 220;
-    uint8_t Display::height = 176;
-    uint8_t Display::screenbuffer[0x4BA0];
-#else
-    uint8_t Display::width = 84;
-    uint8_t Display::height = 48;
-    uint8_t Display::screenbuffer[128*64]; // not needed because Gamebuino and Arduboy have their own buffer
-#endif
-#else //Tiledmode
-#if (POK_SCREENMODE == MODE_TILED_1BIT)
-    uint8_t Display::width = POK_LCD_W;
-    uint8_t Display::height = POK_LCD_H;
-    uint8_t Display::screenbuffer[0];
-#else
-    uint8_t Display::width = POK_LCD_W;
-    uint8_t Display::height = POK_LCD_H;
-    uint8_t Display::screenbuffer[0];
-#endif
-#endif //tiledmode
-
-// RLE decoding
-#define RLE_ESC_EOL 0
-#define RLE_ESC_EOB 1
-#define RLE_ESC_OFFSET 2
-
-Display::Display() {
-    m_scrbuf = screenbuffer;
-    setDefaultPalette();
-    m_mode = 1; // direct printing on by default
-    m_w = POK_LCD_W;
-    m_h = POK_LCD_H;
-    setFont(DEFAULT_FONT);
-    invisiblecolor=17;
-    bgcolor=0;
-    if (POK_COLORDEPTH) m_colordepth = POK_COLORDEPTH;
-    else m_colordepth = 4;
-    #if POK_GAMEBUINO_SUPPORT
-    setColorDepth(1);
-    #endif // POK_GAMEBUINO_SUPPORT
-
-    // Reset sprites
-    m_tilecolorbuf = NULL; //!!HV
-    for (uint8_t s = 0; s < SPRITE_COUNT; s++) m_sprites[s].bitmapData = NULL;
-}
-
-uint16_t Display::getWidth() {
-    return width;
-}
-
-uint8_t Display::getNumberOfColors() {
-    return 1<<POK_COLORDEPTH;
-}
-
-uint16_t Display::getHeight() {
-    return height;
-}
-
-uint8_t Display::getColorDepth() {
-    return m_colordepth;
-}
-
-void Display::setColorDepth(uint8_t v) {
-    if (v > POK_COLORDEPTH) v=POK_COLORDEPTH;
-    m_colordepth = v;
-}
-
-void Display::clearLCD() {
-    lcdFillSurface(0);
-    setCursor(0,0); // old basic computer style
-}
-
-void Display::fillLCD(uint16_t c) {
-    lcdFillSurface(c);
-}
-
-void Display::directPixel(int16_t x, int16_t y, uint16_t color) {
-    if ((invisiblecolor < PALETTE_SIZE) && (invisiblecolor < 16) && (color == palette[invisiblecolor])) return;
-    lcdPixel(x,y,color);
-}
-
-void Display::directTile(int16_t x, int16_t y, int16_t x2, int16_t y2, uint16_t* gfx) {
-    lcdTile(x,y,x2,y2,gfx);
-}
-
-void Display::directRectangle(int16_t x, int16_t y,int16_t x2, int16_t y2, uint16_t color) {
-    lcdRectangle(x,y,x2,y2,color);
-}
-
-void Display::begin() {
-    lcdInit();
-}
-
-void Display::setCursor(int16_t x,int16_t y) {
-    cursorX = x;
-    cursorY = y;
-}
-
-/**
- * Update the display.
- * The update rect is used for drawing only part of the screen buffer to LCD. Because of speed optimizations, the
- * x, y, and width of the update rect must be dividable by 4 pixels, and the height must be dividable by 8 pixels.
- * Note: The update rect is currently used for 220x176, 4 colors, screen mode only.
- * @param useDirectMode True, if only direct screen drawing is used. False, if the screen buffer is drawn. Note: If sprites are enabled, they are drawn in both modes.
- * @param updRectX The update rect.
- * @param updRectY The update rect.
- * @param updRectW The update rect.
- * @param updRectH The update rect.
- */
-void Display::update(bool useDirectDrawMode, uint8_t updRectX, uint8_t updRectY, uint8_t updRectW, uint8_t updRectH) {
-
-    #if POK_SCREENMODE == MODE_HI_4COLOR
-    // If there is one or more sprites, use sprite enabled drawing.
-    if (m_sprites[0].bitmapData != NULL)
-        lcdRefreshMode1Spr(m_scrbuf, updRectX, updRectY, updRectW, updRectH, paletteptr, m_sprites, useDirectDrawMode);
-    else if (!useDirectDrawMode)
-        lcdRefreshMode1(m_scrbuf, updRectX, updRectY, updRectW, updRectH, paletteptr);
-    #endif
-
-    // For the screen modes that do not support sprites, return if the direct draw mode is used.
-    if (! useDirectDrawMode) {
-		#if POK_SCREENMODE == MODE13
-		lcdRefreshMode13(m_scrbuf, paletteptr, palOffset);
-		#endif
-
-        #if POK_SCREENMODE == MODE_GAMEBOY
-        lcdRefreshModeGBC(m_scrbuf, paletteptr);
-        #endif
-
-        #if POK_SCREENMODE == MODE_HI_16COLOR
-        lcdRefreshMode3(m_scrbuf, paletteptr);
-        #endif
-
-        #if POK_SCREENMODE == MODE_FAST_16COLOR
-        lcdRefreshMode2(m_scrbuf, paletteptr);
-        #endif
-
-        #if POK_SCREENMODE == MODE_GAMEBUINO_16COLOR
-        lcdRefreshGB(m_scrbuf, paletteptr);
-        #endif
-
-        #if POK_SCREENMODE == MODE_ARDUBOY_16COLOR
-        lcdRefreshAB(m_scrbuf, paletteptr);
-        #endif
-
-        #if POK_SCREENMODE == MODE14
-        lcdRefreshMode14(m_scrbuf, paletteptr);
-        #endif
-
-        #if POK_SCREENMODE == MODE15
-        lcdRefreshMode15(paletteptr, m_scrbuf);
-        #endif
-
-        #if POK_SCREENMODE == MODE_TILED_1BIT
-        lcdRefreshT1(m_tilebuf, m_tilecolorbuf, m_tileset, paletteptr);
-        #endif
-    }
-
-    if (!persistence) clear();
-
-    /** draw volume bar if visible **/
-    #if POK_SHOW_VOLUME > 0
-    if (core.volbar_visible) {
-            core.drawvolbar(4,20,_pdsound.getVolume(),true);
-            core.volbar_visible--;
-    }
-    #endif // POK_SHOW_VOLUME
-
-    /** draw FPS if visible **/
-    #ifdef PROJ_SHOW_FPS_COUNTER
-
-    if(core.fps_counter_updated) {
-
-        // Store current state
-        bool temp = isDirectPrintingEnabled();
-        uint16_t oldcol = directcolor;
-        uint16_t oldinvisiblecolor = invisiblecolor;
-        uint16_t oldbgcol = directbgcolor;
-        bool olddirecttextrotated = directtextrotated;
-        int8_t oldadjustCharStep = adjustCharStep;
-        const unsigned char * oldFont = font;
-
-        // Print FPS
-        char str[16];
-        sprintf(str,"FPS:%d ", (int)core.fps_counter);
-        directcolor = COLOR_WHITE;
-        invisiblecolor = COLOR_BLACK;
-        directbgcolor = 0x0001; // Cannot be black as that is transparent color
-        directtextrotated = true;
-        adjustCharStep = 0;
-        setFont(fontC64);
-        enableDirectPrinting(true);
-        print(0,0, str);
-
-        // Restore state
-        enableDirectPrinting(temp);
-        directcolor = oldcol;
-        invisiblecolor =  oldinvisiblecolor;
-        directbgcolor = oldbgcol;
-        directtextrotated = olddirecttextrotated;
-        adjustCharStep = oldadjustCharStep;
-        setFont(font);
-
-        core.fps_counter_updated = false;
-    }
-    #endif
-}
-
-void Display::directBitmap(int16_t x, int16_t y, const uint8_t *bitmap, uint8_t depth, uint8_t scale) {
-    uint8_t w = *bitmap;
-	uint8_t h = *(bitmap + 1);
-	bitmap = bitmap + 2; //add an offset to the pointer to start after the width and height
-    int16_t i, j;
-    int8_t byteNum, bitNum, byteWidth = (w + 7) >> 3;
-
-    if (depth == 1) {
-        for (i = 0; i < w; i++) {
-            byteNum = i / 8;
-            bitNum = i % 8;
-            for (j = 0; j < h; j++) {
-                if (*(bitmap + j * byteWidth + byteNum) & (0x80 >> bitNum)) { //0x80 = B10000000
-                    if (scale==1) directPixel(x + i, y + j,directcolor);
-                    else {
-                        directPixel(x + i + i, y + j + j,directcolor);
-                        directPixel(x + 1 + i + i, y + j + j,directcolor);
-                        directPixel(x + i + i, y + j + j + 1,directcolor);
-                        directPixel(x + i + i + 1 , y + j + j + 1,directcolor);
-                    }
-                }
-            }
-        }
-    } else if (depth == 4) {
-        for (j = 0; j < h; j+=1) {
-            for (i = 0; i < w; i+=2) {
-                uint16_t col = paletteptr[*bitmap>>4]; //higher nibble
-                if (scale==2) {
-                        directPixel(x + (i<<1), y + (j<<1),col);
-                        directPixel(x + (i<<1) + 1, y + (j<<1),col);
-                        directPixel(x + (i<<1) + 1, y + (j<<1) + 1,col);
-                        directPixel(x + (i<<1), y + (j<<1) + 1,col);
-                } else directPixel(x + i, y + j,col);
-                col = paletteptr[*bitmap&0xF]; // lower nibble
-                if (scale==2) {
-                        directPixel(x + (i<<1) + 2, y + (j<<1),col);
-                        directPixel(x + (i<<1) + 1 + 2, y + (j<<1),col);
-                        directPixel(x + (i<<1) + 1 + 2, y + (j<<1) + 1,col);
-                        directPixel(x + (i<<1) + 2 , y + (j<<1) + 1,col);
-                } else directPixel(x + i + 1, y + j,col);
-                bitmap++;
-            }
-        }
-    }
-
-}
-
-int Display::directChar(int16_t x, int16_t y, uint16_t index){
-    const uint8_t* bitmap = font;
-    uint8_t w = *bitmap;
-	uint8_t h = *(bitmap + 1);
-	uint8_t hbytes=0, xtra=1;
-	if (h==8 || h==16) xtra=0; //don't add if exactly on byte limit
-	hbytes=(h>>3)+xtra; //GLCD fonts are arranged w+1 times h/8 bytes
-	//bitmap = bitmap + 3 + index * h * ((w>>3)+xtra); //add an offset to the pointer (fonts !)
-	bitmap = bitmap + 4 + index * (w * hbytes + 1); //add an offset to the pointer (fonts !)
-	//int8_t i, j, byteNum, bitNum, byteWidth = (w + 7) >> 3;
-    int8_t i, j, numBytes;
-    numBytes = *bitmap++; //first byte of char is the width in bytes
-    // GLCD fonts are arranged LSB = topmost pixel of char, so its easy to just shift through the column
-    uint16_t bitcolumn; //16 bits for 2x8 bit high characters
-
-	for (i = 0; i < numBytes; i++) {
-            bitcolumn = *bitmap++;
-            if (hbytes == 2) bitcolumn |= (*bitmap++)<<8; // add second byte for 16 bit high fonts
-            for (j = 0; j < h; j++) {
-                if (bitcolumn&0x1) {
-                    if (fontSize==2) {
-                        directPixel(x + (i<<1)  , y + (j<<1),directcolor);
-                        directPixel(x + (i<<1)+1, y + (j<<1),directcolor);
-                        directPixel(x + (i<<1)  , y + (j<<1)+1,directcolor);
-                        directPixel(x + (i<<1)+1, y + (j<<1)+1,directcolor);
-                    } else {
-                        if(directtextrotated) directPixel(y + h - j - 1, x + i,directcolor);
-                        else directPixel(x + i, y + j,directcolor);
-                    }
-
-                } else if (directbgcolor != invisiblecolor) {
-                    if (fontSize==2) {
-                        directPixel(x + (i<<1)  , y + (j<<1),directbgcolor);
-                        directPixel(x + (i<<1)+1, y + (j<<1),directbgcolor);
-                        directPixel(x + (i<<1)  , y + (j<<1)+1,directbgcolor);
-                        directPixel(x + (i<<1)+1, y + (j<<1)+1,directbgcolor);
-                    } else {
-                        if(directtextrotated) directPixel(y + h - j - 1, x + i,directbgcolor);
-                        else directPixel(x + i, y + j,directbgcolor);
-                    }
-                }
-                bitcolumn>>=1;
-            }
-    }
-    return (numBytes+adjustCharStep)*fontSize; // for character stepping
-}
-
-int Display::bufferChar(int16_t x, int16_t y, uint16_t index){
-    const uint8_t* bitmap = font;
-    uint8_t w = *bitmap;
-	uint8_t h = *(bitmap + 1);
-	uint8_t hbytes=0, xtra=1;
-	if (h==8 || h==16) xtra=0; //don't add if exactly on byte limit
-	hbytes=(h>>3)+xtra; //GLCD fonts are arranged w+1 times h/8 bytes
-	//bitmap = bitmap + 3 + index * h * ((w>>3)+xtra); //add an offset to the pointer (fonts !)
-	bitmap = bitmap + 4 + index * (w * hbytes + 1); //add an offset to the pointer (fonts !)
-	//int8_t i, j, byteNum, bitNum, byteWidth = (w + 7) >> 3;
-    int8_t i, j, numBytes;
-    numBytes = *bitmap++; //first byte of char is the width in bytes
-    // GLCD fonts are arranged LSB = topmost pixel of char, so its easy to just shift through the column
-    uint16_t bitcolumn; //16 bits for 2x8 bit high characters
-
-	for (i = 0; i < numBytes; i++) {
-            bitcolumn = *bitmap++;
-            if (hbytes == 2) bitcolumn |= (*bitmap++)<<8; // add second byte for 16 bit high fonts
-            for (j = 0; j <= h; j++) { // was j<=h
-                #if PROJ_ARDUBOY > 0
-                if (bitcolumn&0x1) {
-                    drawPixel(x + i, y + 7 - j,color);
-                } else drawPixel(x + i, y + 7 - j,bgcolor);
-                bitcolumn>>=1;
-                #else
-                if (bitcolumn&0x1) {
-                    drawPixel(x + i, y + j,color);
-                } else drawPixel(x + i, y + j,bgcolor);
-                bitcolumn>>=1;
-                #endif // PROJ_ARDUBOY
-
-            }
-    }
-
-    return numBytes+adjustCharStep; // for character stepping
-}
-
-void Display::clear() {
-
-    uint8_t c=0;
-    c = bgcolor & (PALETTE_SIZE-1) ; //don't let palette go out of bounds
-    if (bpp==1 && bgcolor) c=0xFF; // bgcolor !=0, set all pixels
-    else if (bpp==2) {
-        c = bgcolor & 0x3;
-        c = c | (c << 2);
-        c = c | (c << 4);
-    } else if (bpp==3){
-        uint16_t j = POK_BITFRAME;
-        if (bgcolor & 0x1) memset((void*)m_scrbuf,0xFF,j);// R
-        else memset((void*)m_scrbuf,0x00,j);// R
-        if ((bgcolor>>1) & 0x1) memset((void*)m_scrbuf+POK_BITFRAME,0xFF,j);// G
-        else memset((void*)m_scrbuf+POK_BITFRAME,0x00,j);// G
-        if ((bgcolor>>2) & 0x1) memset((void*)m_scrbuf+POK_BITFRAME*2,0xFF,j);// B
-        else memset((void*)m_scrbuf+POK_BITFRAME*2,0x00,j);// B
-        setCursor(0,0);
-        return;
-    } else {
-        c = (c & 0x0F) | (c << 4);
-    }
-    uint16_t j = sizeof(screenbuffer);
-    memset((void*)m_scrbuf,c,j);
-
-    setCursor(0,0);
-
-}
-
-void Display::scroll(int16_t pixelrows) {
-    uint16_t index = 0, index2=0,oc;
-    if (pixelrows==0) return;
-    if (pixelrows >= height) pixelrows=height-1;
-    if (bpp == 4) index2 = pixelrows*width/2;
-    else if (bpp == 2) index2 = pixelrows*width/4;
-    else return;
-    oc = color;
-    color = bgcolor;
-    if (pixelrows>0) {
-    for (uint16_t y=0;y<height-pixelrows;y++) {
-            for (uint16_t x=0;x<(width/8)*bpp;x++) screenbuffer[index++]=screenbuffer[index2++];
-    }
-    fillRect(0,cursorY,width,height);
-    } else {
-    for (uint16_t y=pixelrows;y<height;y++) {
-            for (uint16_t x=0;x<(width*bpp)/8;x++) screenbuffer[index2++]=screenbuffer[index++];
-    }
-    fillRect(0,0,width,pixelrows);
-    }
-    color=oc;
-}
-
-void Display::fillScreen(uint16_t c) {
-    c = c & (PALETTE_SIZE-1) ; //don't let palette go out of bounds
-    if (bpp==1 && c) c=0xFF; // set all pixels
-    else if (bpp==2) {
-        c = c & 0x3;
-        c = c | (c << 2);
-        c = c | (c << 4);
-    } else {
-        c = (c & 0x0F) | (c << 4);
-    }
-    memset((void*)m_scrbuf,c,sizeof(screenbuffer));
-}
-
-void Display::setDefaultPalette() {
-    #if PICOPALETTE
-        loadRGBPalette(palettePico);
-    #else
-        loadRGBPalette(POK_DEFAULT_PALETTE);
-    #endif //PICOPALETTE
-}
-
-void Display::setColor(uint8_t c) {
-    color = c & ((1<<POK_COLORDEPTH)-1); // cut out colors that go above palette limit
-}
-
-void Display::setColor(uint8_t c,uint8_t bgc){
-    color = c & ((1<<POK_COLORDEPTH)-1); // cut out colors that go above palette limit
-    bgcolor = bgc & ((1<<POK_COLORDEPTH)-1); // cut out colors that go above palette limit
-}
-
-void Display::setInvisibleColor(uint16_t c){
-    invisiblecolor = c; // invisible color can have values beyond 255 for identification purposes
-}
-
-uint8_t Display::getColor() {
-    return color;
-}
-
-uint8_t Display::getBgColor() {
-    return bgcolor;
-}
-
-uint16_t Display::getInvisibleColor() {
-    return invisiblecolor;
-}
-
-void Display::setClipRect(int16_t x, int16_t y, int16_t w, int16_t h) {
-    clipX = x; clipY = y; clipW = w; clipH = h;
-}
-
-
-void Display::drawPixel(int16_t x,int16_t y, uint8_t col) {
-    if (col==invisiblecolor) return; // do not draw transparent pixels
-    if ((uint16_t)x >= width || (uint16_t)y >= height) return;
-    col &= (PALETTE_SIZE-1);
-
-    #if POK_COLORDEPTH == 8
-        m_scrbuf[x+width*y] = col;
-    #endif
-
-    #if POK_GAMEBUINO_SUPPORT >0
-
-	uint8_t c = col;
-	uint8_t ct = col;
-
-    uint16_t bitptr=0;
-    for (uint8_t cbit=0;cbit<POK_COLORDEPTH;cbit++) {
-	c = ct & 1; // take the lowest bit of the color index number
-	if(c == 0){ //white - or actually "Clear bit"
-		m_scrbuf[x + (y / 8) * LCDWIDTH + bitptr] &= ~_BV(y % 8);
-	} else { //black - or actually "Set bit"
-		m_scrbuf[x + (y / 8) * LCDWIDTH + bitptr] |= _BV(y % 8);
-	}
-	ct >>=1; // shift to get next bit
-	bitptr += POK_BITFRAME; // move one screen worth of buffer forward to get to the next color bit
-    } // POK_COLOURDEPTH
-
-    #else
-    #if POK_COLORDEPTH == 1
-        if (col) {m_scrbuf[(y >> 3) * width + x] |= (0x80 >> (y & 7)); return;}
-        m_scrbuf[(y >> 3) * width + x] &= ~(0x80 >> (y & 7));
-    #elif POK_COLORDEPTH == 2
-        if (col) {
-                col &= 3;
-        }
-        uint16_t i = y*(width>>2) + (x>>2);
-        uint8_t pixel = m_scrbuf[i];
-        uint8_t column = x&0x03;
-        if (column==3) pixel = (pixel&0xFC)|(col); // bits 0-1
-        else if (column==2) pixel = (pixel&0xF3)|(col<<2); // bits 2-3
-        else if (column==1) pixel = (pixel&0xCF)|(col<<4); // bits 4-5
-        else pixel = (pixel&0x3F)|(col<<6); // bits 6-7
-        m_scrbuf[i] = pixel;
-    #elif POK_COLORDEPTH == 3
-    uint8_t c = col;
-	uint8_t ct = col;
-
-    uint16_t bitptr=0;
-    for (uint8_t cbit=0;cbit<POK_COLORDEPTH;cbit++) {
-	c = ct & 1; // take the lowest bit of the color index number
-	if(c == 0){ //white - or actually "Clear bit"
-		m_scrbuf[x + (y / 8) * LCDWIDTH + bitptr] &= ~_BV(y % 8);
-	} else { //black - or actually "Set bit"
-		m_scrbuf[x + (y / 8) * LCDWIDTH + bitptr] |= _BV(y % 8);
-	}
-	ct >>=1; // shift to get next bit
-	bitptr += POK_BITFRAME; // move one screen worth of buffer forward to get to the next color bit
-    } // POK_COLOURDEPTH
-    #elif POK_COLORDEPTH == 4
-    uint16_t i = y*(width>>1) + (x>>1);
-    uint8_t pixel = m_scrbuf[i];
-    if (x&1) pixel = (pixel&0xF0)|(col);
-    else pixel = (pixel&0x0F) | (col<<4);
-    m_scrbuf[i] = pixel;
-    #endif // POK_COLORDEPTH
-    #endif // POK_GAMEBUINO_SUPPORT
-}
-
-void Display::drawPixel(int16_t x,int16_t y) {
-    if ((uint16_t)x >= width || (uint16_t)y >= height) return;
-
-    #if POK_COLORDEPTH == 8
-        m_scrbuf[x+width*y] = color;
-    #endif
-
-    #if POK_GAMEBUINO_SUPPORT > 0
-
-	uint8_t c = color;
-	uint8_t ct = color;
-	if(ct == INVERT){
-	 ct = !getPixel(x, y); //jonne - was c = !getP...
-	}
-
-    uint16_t bitptr=0;
-    for (uint8_t cbit=0;cbit<POK_COLORDEPTH;cbit++) {
-	c = ct & 1; // take the lowest bit of the color index number
-	if(c == 0){ //white - or actually "Clear bit"
-    #if DISPLAY_ROT == NOROT
-		m_scrbuf[x + (y / 8) * LCDWIDTH + bitptr] &= ~_BV(y % 8);
-    #elif DISPLAY_ROT == ROTCCW
-		m_scrbuf[LCDHEIGHT - y - 1 + (x / 8) * LCDWIDTH_NOROT + bitptr] &= ~_BV(x % 8);
-    #elif DISPLAY_ROT == ROT180
-		m_scrbuf[LCDWIDTH - x - 1 + ((LCDHEIGHT - y - 1) / 8) * LCDWIDTH_NOROT + bitptr] &= ~_BV((LCDHEIGHT - y - 1) % 8);
-    #elif DISPLAY_ROT == ROTCW
-		m_scrbuf[y + ((LCDWIDTH - x - 1) / 8) * LCDWIDTH_NOROT + bitbtr] &= ~_BV((LCDWIDTH - x - 1) % 8);
-    #endif
-		//return; //jonne
-	} else { //black - or actually "Set bit"
-    #if DISPLAY_ROT == NOROT
-		m_scrbuf[x + (y / 8) * LCDWIDTH + bitptr] |= _BV(y % 8);
-    #elif DISPLAY_ROT == ROTCCW
-		m_scrbuf[LCDHEIGHT - y - 1 + (x / 8) * LCDWIDTH_NOROT + bitptr] |= _BV(x % 8);
-    #elif DISPLAY_ROT == ROT180
-		m_scrbuf[LCDWIDTH - x - 1 + ((LCDHEIGHT - y - 1) / 8) * LCDWIDTH_NOROT + bitptr] |= _BV((LCDHEIGHT - y - 1) % 8);
-    #elif DISPLAY_ROT == ROTCW
-		m_scrbuf[y + ((LCDWIDTH - x - 1) / 8) * LCDWIDTH_NOROT + bitptr] |= _BV((LCDWIDTH - x -1) % 8);
-    #endif
-		//return; //jonne
-	}
-	ct >>=1; // shift to get next bit
-	bitptr += POK_BITFRAME; // move one screen worth of buffer forward to get to the next color bit
-    } // POK_COLOURDEPTH
-
-    #else
-
-    /** NOT Gamebuino */
-    #if POK_COLORDEPTH == 1
-        if (color) {m_scrbuf[(y >> 3) * width + x] |= (0x80 >> (y & 7)); return;}
-        m_scrbuf[(y >> 3) * width + x] &= ~(0x80 >> (y & 7));
-    #elif POK_COLORDEPTH == 2
-        uint16_t i = y*(width>>2) + (x>>2);
-        uint8_t pixel = m_scrbuf[i];
-        uint8_t column = x&0x03;
-        if (column==3) pixel = (pixel&0xFC)|(color); // bits 0-1
-        else if (column==2) pixel = (pixel&0xF3)|(color<<2); // bits 2-3
-        else if (column==1) pixel = (pixel&0xCF)|(color<<4); // bits 4-5
-        else pixel = (pixel&0x3F)|(color<<6); // bits 6-7
-        m_scrbuf[i] = pixel;
-    #elif POK_COLORDEPTH == 3
-    #elif POK_COLORDEPTH == 4
-            uint16_t i = y*(width>>1) + (x>>1);
-            uint8_t pixel = m_scrbuf[i];
-            if (x&1) pixel = (pixel&0xF0)|(color);
-            else pixel = (pixel&0x0F) | (color<<4);
-            m_scrbuf[i] = pixel;
-    #endif // POK_COLORDEPTH
-    #endif // POK_GAMEBUINO_SUPPORT
-}
-
-uint8_t Display::getPixel(int16_t x,int16_t y) {
-    if ((uint16_t)x >= width || (uint16_t)y >= height) return 0;
-    #if POK_COLORDEPTH == 8
-    uint16_t i = y*width+x;
-    return m_scrbuf[i];
-    #endif // POK_COLORDEPTH
-
-    #if POK_GAMEBUINO_SUPPORT
-    uint8_t color=0; //jonne
-	for (uint8_t cbit=0; cbit<POK_COLORDEPTH;cbit++) {
-    	color |= (m_scrbuf[x + (y / 8) * LCDWIDTH+POK_BITFRAME*cbit] >> (y % 8)) & 0x1 ; //jonne - added +504*cbit
-	}
-	return color;
-    #else
-    /** not gamebuino */
-    #if POK_COLORDEPTH == 1
-        return (m_scrbuf[(y >> 3) * width + x] & (0x80 >> (y & 7))) ? 1:0;
-    #elif POK_COLORDEPTH == 2
-        uint16_t i = y*(width>>2) + (x>>2);
-        uint8_t pixel = m_scrbuf[i];
-        uint8_t column = x&0x03;
-        if (column==0) return pixel & 0x03; // bits 0-1
-        else if (column==1) return (pixel & 0x0C)>>2; // bits 2-3
-        else if (column==2) return (pixel & 0x30)>>4; // bits 4-5
-        else return pixel>>6;; // bits 6-7
-    #elif POK_COLORDEPTH == 3
-    #elif POK_COLORDEPTH == 4
-    uint16_t i = y*(width>>1) + (x>>1);
-    uint8_t pixel = m_scrbuf[i];
-    if (x&1) return pixel & 0x0F;
-    else return pixel>>4;
-    #endif // POK_COLORDEPTH
-    #endif // POK_GAMEBUINO_SUPPORT
-}
-
-void Display::drawLine(int16_t x0, int16_t y0, int16_t x1, int16_t y1) {
-    if ((uint16_t)x0 >= width || (uint16_t)y0 >= height || (uint16_t)x1 >= width || (uint16_t)y1 >= height ) {
-        if (clipLine (&x0,&y0,&x1,&y1)==0) return; // line out of bounds
-    }
-	if (x0 == x1)
-		drawColumn(x0,y0,y1);
-	else if (y0 == y1)
-		drawRow(x0,x1,y0);
-	else {
-		int e;
-		signed int dx,dy,j, temp;
-		signed char s1,s2, xchange;
-		signed int x,y;
-
-		x = x0;
-		y = y0;
-
-		//take absolute value
-		if (x1 < x0) {
-			dx = x0 - x1;
-			s1 = -1;
-		}
-		else if (x1 == x0) {
-			dx = 0;
-			s1 = 0;
-		}
-		else {
-			dx = x1 - x0;
-			s1 = 1;
-		}
-
-		if (y1 < y0) {
-			dy = y0 - y1;
-			s2 = -1;
-		}
-		else if (y1 == y0) {
-			dy = 0;
-			s2 = 0;
-		}
-		else {
-			dy = y1 - y0;
-			s2 = 1;
-		}
-
-		xchange = 0;
-
-		if (dy>dx) {
-			temp = dx;
-			dx = dy;
-			dy = temp;
-			xchange = 1;
-		}
-
-		e = ((int)dy<<1) - dx;
-
-		for (j=0; j<=dx; j++) {
-			drawPixel(x,y);
-
-			if (e>=0) {
-				if (xchange==1) x = x + s1;
-				else y = y + s2;
-				e = e - ((int)dx<<1);
-			}
-			if (xchange==1)
-				y = y + s2;
-			else
-				x = x + s1;
-			e = e + ((int)dy<<1);
-		}
-	}
-}
-
-uint8_t Display::clipLine(int16_t *x0, int16_t *y0, int16_t *x1, int16_t *y1){
-    // Check X bounds
-	if (*x1<*x0) {
-        //std::swap (*x1,*x0); // swap so that we dont have to check x1 also
-        swapWT(int16_t*,x1,x0);
-        //std::swap (*y1,*y0); // y needs to be swaaped also
-        swapWT(int16_t*,y1,y0);
-	}
-
-	if (*x0>=width) return 0; // whole line is out of bounds
-
-	// Clip against X0 = 0
-	if (*x0 < 0) {
-        if ( *x1 < 0) return 0; // nothing visible
-        int16_t dx = (*x1 - *x0);
-        int16_t dy = ((*y1 - *y0) << 8); // 8.8 fixed point calculation trick
-        int16_t m = dy/dx;
-        *y0 = *y0 + ((m*-*x0)>>8); // get y0 at boundary
-        *x0 = 0;
-	}
-
-	// Clip against x1 = 83
-	if (*x1 >= width) {
-        int16_t dx = (*x1 - *x0);
-        int16_t dy = ((*y1 - *y0) << 8); // 8.8 fixed point calculation trick
-        int16_t m = dy/dx;
-        //*y1 = *y1 + ((m*(*x1-XMAX))>>8); // get y0 at boundary
-        *y1 = *y1 + ((m*(width-1-*x1))>>8); // get y0 at boundary
-        *x1 = width-1;
-	}
-
-    // Check Y bounds
-	if (*y1<*y0) {
-        //std::swap (*x1,*x0); // swap so that we dont have to check x1 also
-        swapWT(int16_t*,x1,x0);
-        //std::swap (*y1,*y0); // y needs to be swaaped also
-        swapWT(int16_t*,y1,y0);
-	}
-
-	if (*y0>=height) return 0; // whole line is out of bounds
-
-    if (*y0 < 0) {
-        if ( *y1 < 0) return 0; // nothing visible
-        int16_t dx = (*x1 - *x0) << 8;
-        int16_t dy = (*y1 - *y0); // 8.8 fixed point calculation trick
-        int16_t m = dx/dy;
-        *x0 = *x0 + ((m*-*y0)>>8); // get x0 at boundary
-        *y0 = 0;
-	}
-
-    // Clip against y1 = 47
-	if (*y1 >= height) {
-        int16_t dx = (*x1 - *x0) << 8;
-        int16_t dy = (*y1 - *y0); // 8.8 fixed point calculation trick
-        int16_t m = dx/dy;
-        *x1 = *x1 + ((m*(height-1-*y1))>>8); // get y0 at boundary
-        //*x1 = *x1 + ((m*(*y1-YMAX))>>8); // get y0 at boundary
-        *y1 = height-1;
-	}
-	return 1; // clipped succesfully
-}
-
-void Display::map1BitColumn(int16_t x, int16_t sy, int16_t ey, const uint8_t* bitmap, uint16_t column){
-    if ((uint16_t)sy>=height && (uint16_t)ey>=height) return; //completely out of bounds
-    if ((uint16_t)x>=width) return; //completely out of bounds
-    if (sy>ey) {
-            int y=sy;
-            sy=ey;
-            ey=y; // swap around so that x0 is less than x1
-    }
-    uint16_t bmw,bmh;
-    float texelstep, texelindex;
-    bmw = *(bitmap);
-    bmh = *(bitmap+1);
-    if (column>bmw-1) column=bmw-1;
-    bitmap += 2;
-    bitmap += column;
-    texelstep = (float)bmh/((float)ey-(float)sy);
-    texelindex = 0;
-    for (int y=sy; y <= ey; y++, texelindex += texelstep) {
-        uint8_t texel;
-        uint8_t currbyte, bit;
-        currbyte = texelindex / 8;
-        bit = 7-((uint16_t) texelindex & 0x7);
-        texel=*(bitmap+currbyte*bmw);
-        if (texel & (1<<bit)) drawPixel(x,y);
-        else if (bgcolor != invisiblecolor) drawPixel(x,y,bgcolor);
-    }
-};
-
-void Display::drawColumn(int16_t x, int16_t sy, int16_t ey){
-    if ((uint16_t)sy>=height && (uint16_t)ey>=height) return; //completely out of bounds
-    if ((uint16_t)x>=width) return; //completely out of bounds
-    if (sy>ey) {
-            int y=sy;
-            sy=ey;
-            ey=y; // swap around so that x0 is less than x1
-    }
-    for (int y=sy; y <= ey; y++) {
-        drawPixel(x,y);
-    }
-}
-
-void Display::drawRow(int16_t x0, int16_t x1, int16_t y){
-    if ((uint16_t)x0>=width && (uint16_t)x1>=width) return; //completely out of bounds
-    if ((uint16_t)y>=height) return; //completely out of bounds
-
-    if (x0>x1) {
-            int x=x0;
-            x0=x1;
-            x1=x; // swap around so that x0 is less than x1
-    }
-    for (int x=x0; x <= x1; x++) {
-        drawPixel(x,y);
-    }
-}
-
-void Display::drawFastVLine(int16_t x, int16_t y, int16_t h){
-    if (h<0) {y += h; h = -h;}
-    drawColumn(x,y,y+h);
-}
-
-void Display::drawFastHLine(int16_t x, int16_t y, int16_t w){
-    if (w<0) {x += w; w = -w;}
-    drawRow(x,x+w-1,y);
-}
-
-void Display::drawRectangle(int16_t x0, int16_t y0, int16_t w, int16_t h) {
-    drawColumn(x0,y0,y0+h);
-    drawColumn(x0+w,y0,y0+h);
-    drawRow(x0,x0+w,y0);
-    drawRow(x0,x0+w,y0+h);
-}
-
-void Display::fillRectangle(int16_t x0,int16_t y0, int16_t w, int16_t h){
-    int16_t x,y,x1,y1;
-    x1=x0+w;y1=y0+h;
-    if ((x0<0 && x1<0) || (x0>=width && x1 >=width)) return; //completely out of bounds
-    if ((y0<0 && y1<0) || (y0>=height && y1 >=height)) return; //completely out of bounds
-    if (x0>x1) {x=x1;x1=x0;}
-    else x=x0;
-    if (y0>y1) {y=y1;y1=y0;}
-    else y=y0;
-    if (x<0) x=0;
-    if (y<0) y=0;
-    for (;x<x1;x++) drawColumn(x,y,y1);
-}
-
-void Display::fillRect(int16_t x, int16_t y, int16_t w, int16_t h) {
-    fillRectangle(x,y,w,h);
-}
-
-void Display::drawRect(int16_t x, int16_t y, int16_t w, int16_t h) {
-    drawRectangle(x,y,w,h);
-}
-
-void Display::drawCircle(int16_t x0, int16_t y0, int16_t r) {
-    int16_t f = 1 - r;
-    int16_t ddF_x = 1;
-    int16_t ddF_y = -2 * r;
-    int16_t x = 0;
-    int16_t y = r;
-
-    drawPixel(x0, y0 + r);
-    drawPixel(x0, y0 - r);
-    drawPixel(x0 + r, y0);
-    drawPixel(x0 - r, y0);
-
-    while (x < y) {
-        if (f >= 0) {
-
-            y--;
-            ddF_y += 2;
-            f += ddF_y;
-        }
-        x++;
-        ddF_x += 2;
-        f += ddF_x;
-
-        drawPixel(x0 + x, y0 + y);
-        drawPixel(x0 - x, y0 + y);
-        drawPixel(x0 + x, y0 - y);
-        drawPixel(x0 - x, y0 - y);
-        drawPixel(x0 + y, y0 + x);
-        drawPixel(x0 - y, y0 + x);
-        drawPixel(x0 + y, y0 - x);
-        drawPixel(x0 - y, y0 - x);
-
-    }
-}
-
-void Display::drawCircleHelper(int16_t x0, int16_t y0, int16_t r, uint16_t cornername) {
-    int16_t f = 1 - r;
-    int16_t ddF_x = 1;
-    int16_t ddF_y = -2 * r;
-    int16_t x = 0;
-    int16_t y = r;
-
-    while (x < y) {
-        if (f >= 0) {
-            y--;
-            ddF_y += 2;
-            f += ddF_y;
-        }
-        x++;
-        ddF_x += 2;
-        f += ddF_x;
-        if (cornername & 0x4) {
-            drawPixel(x0 + x, y0 + y);
-            drawPixel(x0 + y, y0 + x);
-        }
-        if (cornername & 0x2) {
-            drawPixel(x0 + x, y0 - y);
-            drawPixel(x0 + y, y0 - x);
-        }
-        if (cornername & 0x8) {
-            drawPixel(x0 - y, y0 + x);
-            drawPixel(x0 - x, y0 + y);
-        }
-        if (cornername & 0x1) {
-
-            drawPixel(x0 - y, y0 - x);
-            drawPixel(x0 - x, y0 - y);
-        }
-    }
-}
-
-void Display::fillCircle(int16_t x0, int16_t y0, int16_t r) {
-    drawFastVLine(x0, y0 - r, 2 * r );
-    fillCircleHelper(x0, y0, r, 3, 0);
-}
-
-void Display::fillCircleHelper(int16_t x0, int16_t y0, int16_t r, uint16_t cornername, int16_t delta) {
-    int16_t f = 1 - r;
-    int16_t ddF_x = 1;
-    int16_t ddF_y = -2 * r;
-    int16_t x = 0;
-    int16_t y = r;
-
-    while (x < y) {
-        if (f >= 0) {
-            y--;
-            ddF_y += 2;
-            f += ddF_y;
-        }
-        x++;
-        ddF_x += 2;
-        f += ddF_x;
-
-        if (cornername & 0x1) {
-            drawFastVLine(x0 + x, y0 - y, 2 * y + 1 + delta-1); //added -1 here, jonne
-            drawFastVLine(x0 + y, y0 - x, 2 * x + 1 + delta-1); //added -1 here, jonne
-        }
-        if (cornername & 0x2) {
-
-            drawFastVLine(x0 - x, y0 - y, 2 * y + 1 + delta-1); //added -1 here, jonne
-            drawFastVLine(x0 - y, y0 - x, 2 * x + 1 + delta-1); //added -1 here, jonne
-        }
-    }
-}
-
-void Display::drawRoundRect(int16_t x, int16_t y, int16_t w,int16_t h, int16_t r) {
-    if (r<2) {drawRectangle(x,y,w,h);return;}
-    // smarter version
-    drawFastHLine(x + r, y, w - 2 * r); // Top
-    drawFastHLine(x + r, y + h - 1, w - 2 * r); // Bottom
-    drawFastVLine(x, y + r, h - 2 * r); // Left
-    drawFastVLine(x + w - 1, y + r, h - 2 * r); // Right
-    // draw four corners
-    drawCircleHelper(x + r, y + r, r, 1);
-    drawCircleHelper(x + w - r - 1, y + r, r, 2);
-    drawCircleHelper(x + w - r - 1, y + h - r - 1, r, 4);
-    drawCircleHelper(x + r, y + h - r - 1, r, 8);
-}
-
-void Display::fillRoundRect(int16_t x, int16_t y, int16_t w,int16_t h, int16_t r) {
-    if (r<2) {fillRectangle(x,y,w,h);return;}
-    fillRectangle(x + r, y, w - 2 * r, h-1);
-    // draw four corners
-    fillCircleHelper(x + w - r - 1, y + r, r, 1, h - 2 * r - 1);
-    fillCircleHelper(x + r, y + r, r, 2, h - 2 * r - 1);
-}
-
-void Display::drawTriangle(int16_t x0, int16_t y0,
-        int16_t x1, int16_t y1,
-        int16_t x2, int16_t y2) {
-    drawLine(x0, y0, x1, y1);
-    drawLine(x1, y1, x2, y2);
-    drawLine(x2, y2, x0, y0);
-}
-
-void Display::fillTriangle(int16_t x0, int16_t y0,
-        int16_t x1, int16_t y1,
-        int16_t x2, int16_t y2) {
-    int16_t a, b, y, last;
-
-    // Sort coordinates by Y order (y2 >= y1 >= y0)
-    if (y0 > y1) {
-        swapWT(int16_t,y0, y1);
-        swapWT(int16_t,x0, x1);
-    }
-    if (y1 > y2) {
-        swapWT(int16_t,y2, y1);
-        swapWT(int16_t,x2, x1);
-    }
-    if (y0 > y1) {
-        swapWT(int16_t,y0, y1);
-        swapWT(int16_t,x0, x1);
-    }
-
-    if (y0 == y2) { // Handle awkward all-on-same-line case as its own thing
-        a = b = x0;
-        if (x1 < a) a = x1;
-        else if (x1 > b) b = x1;
-        if (x2 < a) a = x2;
-        else if (x2 > b) b = x2;
-        drawFastHLine(a, y0, b - a + 1);
-        return;
-    }
-
-    int16_t
-    dx01 = x1 - x0,
-            dy01 = y1 - y0,
-            dx02 = x2 - x0,
-            dy02 = y2 - y0,
-            dx12 = x2 - x1,
-            dy12 = y2 - y1,
-            sa = 0,
-            sb = 0;
-
-    // For upper part of triangle, find scanline crossings for segments
-    // 0-1 and 0-2.  If y1=y2 (flat-bottomed triangle), the scanline y1
-    // is included here (and second loop will be skipped, avoiding a /0
-    // error there), otherwise scanline y1 is skipped here and handled
-    // in the second loop...which also avoids a /0 error here if y0=y1
-    // (flat-topped triangle).
-    if (y1 == y2) last = y1; // Include y1 scanline
-    else last = y1 - 1; // Skip it
-
-    for (y = y0; y <= last; y++) {
-        a = x0 + sa / dy01;
-        b = x0 + sb / dy02;
-        sa += dx01;
-        sb += dx02;
-        /* longhand:
-        a = x0 + (x1 - x0) * (y - y0) / (y1 - y0);
-        b = x0 + (x2 - x0) * (y - y0) / (y2 - y0);
-         */
-        if (a > b) swapWT(int16_t,a, b);
-        drawFastHLine(a, y, b - a + 1);
-    }
-
-    // For lower part of triangle, find scanline crossings for segments
-    // 0-2 and 1-2.  This loop is skipped if y1=y2.
-    sa = dx12 * (y - y1);
-    sb = dx02 * (y - y0);
-    for (; y <= y2; y++) {
-        a = x1 + sa / dy12;
-        b = x0 + sb / dy02;
-        sa += dx12;
-        sb += dx02;
-
-        if (a > b) swapWT(int16_t,a, b);
-        drawFastHLine(a, y, b - a + 1);
-    }
-}
-
-void Display::setFont(const unsigned char * f) {
-	font = f;
-	fontWidth = *(font)+1;
-	fontHeight = *(font + 1)+1;
-}
-
-void Display::drawMonoBitmap(int16_t x, int16_t y, const uint8_t* bitmap, uint8_t index) {
-    uint8_t w = *bitmap;
-	uint8_t h = *(bitmap + 1);
-	uint8_t xtra=0;
-	if (w&0x7) xtra=1;
-	bitmap = bitmap + 3 + index * h * ((w>>3)+xtra); //add an offset to the pointer (fonts !)
-    #if POK_GAMEBUINO_SUPPORT > 0
-    int8_t i, j, byteNum, bitNum, byteWidth = (w + 7) >> 3;
-    for (i = 0; i < w; i++) {
-        byteNum = i / 8;
-        bitNum = i % 8;
-        for (j = 0; j < h; j++) {
-            uint8_t source = *(bitmap + j * byteWidth + byteNum);
-            if (source & (0x80 >> bitNum)) {
-                drawPixel(x + i, y + j);
-            }
-        }
-    }
-    #else
-    /** not gamebuino */
-    int8_t scrx,scry;
-    uint8_t* scrptr = m_scrbuf + (y*(width>>1) + (x>>1));
-    int8_t bitptr;
-    for (scry = y; scry < y+h; scry+=1) {
-            if ((x&1)==0) { /** EVEN pixel starting line**/
-                for (scrx = x, bitptr=7; scrx < w+x; scrx+=2) {
-                    uint8_t targetpixel = *scrptr;
-                    if (*bitmap & (1<<bitptr)) targetpixel = (targetpixel & 0xF) | color<<4; // upper nibble
-                    else if (bgcolor != invisiblecolor) targetpixel = (targetpixel & 0xF) | bgcolor<<4; // upper nibble
-                    bitptr--;
-                    if (*bitmap & (1<<bitptr)) targetpixel = (targetpixel & 0xF0) | color; // lower nibble
-                    else if (bgcolor != invisiblecolor) targetpixel = (targetpixel & 0xF0) | bgcolor; // lower nibble
-                    bitptr--;
-                    if (bitptr<0) { bitptr = 7; bitmap++; }
-                    *scrptr = targetpixel;
-                    scrptr++;
-                }
-            } else { /** ODD pixel starting line **/
-                for (scrx = x, bitptr=7; scrx < w+x; scrx+=2) {
-                    uint8_t targetpixel = *scrptr;
-                    // store higher nibble of source pixel in lower nibble of target
-                    if (*bitmap & (1<<bitptr)) targetpixel = (targetpixel & 0xF0) | color; // lower nibble
-                    else if (bgcolor != invisiblecolor) targetpixel = (targetpixel & 0xF0) | bgcolor; // lower nibble
-                    *scrptr = targetpixel; // store
-                    bitptr--;scrptr++;targetpixel = *scrptr;
-                    // store lower nibble of source pixel in higher nibble of target
-                    if (*bitmap & (1<<bitptr)) targetpixel = (targetpixel & 0xF) | color<<4; // higher nibble
-                    else if (bgcolor != invisiblecolor) targetpixel = (targetpixel & 0xF) | bgcolor<<4; // higher nibble
-                    *scrptr = targetpixel; // store
-                    bitptr--; // do not increment scrptr here !
-                }
-            }
-            if (bitptr!=7) bitmap++; // force skip to next line
-            // increment the y jump in the scrptr
-            scrptr = scrptr + ((width - w)>>1);
-    }
-    #endif // POK_GAMEBUINO_SUPPORT
-}
-
-
-void Display::drawBitmap(int16_t x, int16_t y, const uint8_t* bitmap, uint8_t frame)
-{
-    int16_t w = *bitmap;
-	int16_t h = *(bitmap + 1);
-	uint8_t framew = *(bitmap+2);
-    bitmap = bitmap + 3; //add an offset to the pointer to start after the width and height
-    /** visibility check */
-    if (y<-h || y>height) return; //invisible
-    if (x<-framew || x>width) return;  //invisible
-    /** 1 bpp mode */
-    if (m_colordepth<2) {
-    int16_t i, j, byteNum, bitNum, byteWidth = (w + 7) >> 3;
-    for (i = 0; i < w; i++) {
-        byteNum = i / 8;
-        bitNum = i % 8;
-        for (j = 0; j < h; j++) {
-            uint8_t source = *(bitmap + j * byteWidth + byteNum);
-            if (source & (0x80 >> bitNum)) {
-                drawPixel(x + i, y + j);
-            }
-        }
-    }
-
-    return;
-    }
-    /** 2 bpp mode */
-    if (m_colordepth<4) {
-    int16_t i, j, byteNum, bitNum, byteWidth = w >> 2;
-    for (i = 0; i < w; i++) {
-        byteNum = i / 4;
-        bitNum = (i % 4)<<1;
-        for (j = 0; j < h; j++) {
-            uint8_t source = *(bitmap + j * byteWidth + byteNum);
-            uint8_t output = (source & (0xC0 >> bitNum));
-            output >>= (6-bitNum);
-            if (output != invisiblecolor) {
-                setColor(output);
-                drawPixel(x + i, y + j);
-            }
-        }
-    }
-
-    return;
-    }
-    /** 4bpp fast version */
-	int16_t scrx,scry,xclip,xjump,scrxjump;
-    xclip=xjump=scrxjump=0;
-    bitmap += (framew*frame)>>1;
-    /** y clipping */
-    if (y<0) { h+=y; bitmap -= y*(w>>1); y=0;}
-    else if (y+h>height) { h -=(y-height);}
-    /** x clipping */
-    xjump = (w-framew)>>1;
-    if (x<0) { xclip=(x&1)<<1; framew+=x; xjump = ((-x)>>1); bitmap += xjump; x=0;}
-    else if (x+framew>width) {
-            xclip = (x&1)<<1;
-            scrxjump = x&1;
-            xjump=((x+framew-width)>>1)+scrxjump;
-            framew = width-x;}
-
-    uint8_t* scrptr = m_scrbuf + (y*(width>>1) + (x>>1));
-    /** ONLY 4-bit mode for time being **/
-    for (scry = y; scry < y+h; scry+=1) {
-            if (scry>=height) return;
-            if ((x&1)==0) { /** EVEN pixel starting line, very simple, just copypaste **/
-                for (scrx = x; scrx < framew+x-xclip; scrx+=2) {
-                    uint8_t sourcepixel = *bitmap;
-                    if (xclip) {
-                            sourcepixel <<=4;
-                            sourcepixel |= ((*(bitmap+1))>>4);
-                    }
-                    uint8_t targetpixel = *scrptr;
-                    if ((sourcepixel>>4) != invisiblecolor ) targetpixel = (targetpixel&0x0F) | (sourcepixel & 0xF0);
-                    if ((sourcepixel&0x0F) != invisiblecolor) targetpixel = (targetpixel & 0xF0) | (sourcepixel & 0x0F);
-                    *scrptr = targetpixel;
-                    bitmap++;
-                    scrptr++;
-                }
-                if (xclip){
-                    if (framew&1) {
-                        /**last pixel is odd pixel due to clipping & odd width*/
-                        uint8_t sourcepixel = *bitmap;
-                        if ((sourcepixel&0x0F) != invisiblecolor) {
-                            sourcepixel <<=4;
-                            uint8_t targetpixel = *scrptr;// & 0x0F;
-                            targetpixel |= sourcepixel;
-                            *scrptr = targetpixel;
-                        }
-                        //scrptr++;
-                    }
-                    bitmap++;
-                    scrptr++;
-                }
-                bitmap += xjump; // needed if x<0 clipping occurs
-            } else { /** ODD pixel starting line **/
-                for (scrx = x; scrx < framew+x-xclip; scrx+=2) {
-                    uint8_t sourcepixel = *bitmap;
-                    uint8_t targetpixel = *scrptr;
-                    // store higher nibble of source pixel in lower nibble of target
-                    if((sourcepixel>>4)!=invisiblecolor) targetpixel = (targetpixel & 0xF0) | (sourcepixel >> 4 );
-                    *scrptr = targetpixel;
-                    scrptr++;
-                    targetpixel = *scrptr;
-                    // store lower nibble of source pixel in higher nibble of target
-                    if((sourcepixel&0x0F)!=invisiblecolor) targetpixel = (targetpixel & 0x0F) | (sourcepixel << 4);
-                    *scrptr = targetpixel;
-                    bitmap++;
-                }
-                bitmap+=xjump;
-            }
-            // increment the y jump in the scrptr
-            scrptr = scrptr + ((width - framew)>>1)+scrxjump;
-    }
-}
-
-
-void Display::drawBitmap(int16_t x, int16_t y, const uint8_t* bitmap)
-{
-    int16_t w = *bitmap;
-	int16_t h = *(bitmap + 1);
-    bitmap = bitmap + 2; //add an offset to the pointer to start after the width and height
-    drawBitmapData(x, y, w, h, bitmap);
-}
-
-void Display::drawBitmapData(int16_t x, int16_t y, int16_t w, int16_t h, const uint8_t* bitmap) {
-    /** visibility check */
-    if (y<-h || y>height) return; //invisible
-    if (x<-w || x>width) return;  //invisible
-    /** 1 bpp mode */
-    if (m_colordepth<2) {
-    int16_t i, j, byteNum, bitNum, byteWidth = (w + 7) >> 3;
-    for (i = 0; i < w; i++) {
-        byteNum = i / 8;
-        bitNum = i % 8;
-        for (j = 0; j < h; j++) {
-            uint8_t source = *(bitmap + j * byteWidth + byteNum);
-            if (source & (0x80 >> bitNum)) {
-                drawPixel(x + i, y + j);
-            }
-        }
-    }
-
-    return;
-    }
-    /** 2 bpp mode */
-    else if (m_colordepth==2) {
-        if(clipH > 0) {
-
-            // Clip
-            int16_t x1 = max(x, clipX);
-            int16_t x2 = min(x + w, clipX + clipW);
-            int16_t bmupdateX = x1 - x;
-            int16_t bmupdateX2 = x2 - x;
-            int16_t y1 = max(y, clipY);
-            int16_t y2 = min(y + h, clipY + clipH);
-            int16_t bmupdateY = y1 - y;
-            int16_t bmupdateY2 = y2 - y;
-
-            int16_t i, j, byteNum, bitNum, byteWidth = w >> 2;
-            for (i = bmupdateX; i < bmupdateX2; i++) {
-                byteNum = i / 4;
-                bitNum = (i % 4)<<1;
-                for (j = bmupdateY; j < bmupdateY2; j++) {
-                    uint8_t source = *(bitmap + (j * byteWidth) + byteNum);
-                    uint8_t output = (source & (0xC0 >> bitNum));
-                    output >>= (6-bitNum);
-                    if (output != invisiblecolor) {
-                        setColor(output);
-                        drawPixel(x + i, y + j);
-                    }
-                }
-            }
-        }
-        else {
-            int16_t i, j, byteNum, bitNum, byteWidth = w >> 2;
-            for (i = 0; i < w; i++) {
-                byteNum = i / 4;
-                bitNum = (i % 4)<<1;
-                for (j = 0; j < h; j++) {
-                    uint8_t source = *(bitmap + (j * byteWidth) + byteNum);
-                    uint8_t output = (source & (0xC0 >> bitNum));
-                    output >>= (6-bitNum);
-                    if (output != invisiblecolor) {
-                        setColor(output);
-                        drawPixel(x + i, y + j);
-                    }
-                }
-            }
-        }
-        return;
-    }
-
-    /** 3 bpp mode */
-    else if (m_colordepth==3) {
-        int16_t i, j, byteNum, bitNum, byteWidth = (w + 7) >> 3;
-        int16_t bitFrame = w * h / 8;
-        for (i = 0; i < w; i++) {
-        byteNum = i / 8;
-        bitNum = i % 8;
-
-        uint8_t bitcount=0;
-        for (j = 0; j <= h/8; j++) {
-            uint8_t r_val = *(bitmap + j * byteWidth + byteNum);
-            uint8_t g_val = *(bitmap + bitFrame + j * byteWidth + byteNum);
-            uint8_t b_val = *(bitmap + (bitFrame<<1) + j * byteWidth + byteNum);
-            for (bitcount=0; bitcount<8; bitcount++) {
-                uint8_t col = (r_val&0x1) | ((g_val&0x1)<<1) | ((b_val&0x1)<<2);
-                r_val >>= 1; g_val >>= 1; b_val >>= 1;
-                drawPixel(x + i, y + j+bitcount,col);
-            }
-            }
-        }
-
-    return;
-    }
-
-
-    /** 4bpp fast version */
-    else if (m_colordepth==4) {
-
-    /** 4bpp fast version */
-	int16_t scrx,scry,xclip,xjump,scrxjump;
-    xclip=xjump=scrxjump=0;
-    /** y clipping */
-    if (y<0) { h+=y; bitmap -= y*(w>>1); y=0;}
-    else if (y+h>height) { h -=(y-height);}
-    /** x clipping */
-    if (x<0) { xclip=(x&1)<<1; w+=x; xjump = ((-x)>>1); bitmap += xjump; x=0;}
-    else if (x+w>width) {
-            xclip = (x&1)<<1;
-            scrxjump = x&1;
-            xjump=((x+w-width)>>1)+scrxjump;
-            w = width-x;}
-
-    uint8_t* scrptr = m_scrbuf + (y*(width>>1) + (x>>1));
-    /** ONLY 4-bit mode for time being **/
-    for (scry = y; scry < y+h; scry+=1) {
-            if (scry>=height) return;
-            if ((x&1)==0) { /** EVEN pixel starting line, very simple, just copypaste **/
-                for (scrx = x; scrx < w+x-xclip; scrx+=2) {
-                    uint8_t sourcepixel = *bitmap;
-                    if (xclip) {
-                            sourcepixel <<=4;
-                            sourcepixel |= ((*(bitmap+1))>>4);
-                    }
-                    uint8_t targetpixel = *scrptr;
-                    if ((sourcepixel>>4) != invisiblecolor ) targetpixel = (targetpixel&0x0F) | (sourcepixel & 0xF0);
-                    if ((sourcepixel&0x0F) != invisiblecolor) targetpixel = (targetpixel & 0xF0) | (sourcepixel & 0x0F);
-                    *scrptr = targetpixel;
-                    bitmap++;
-                    scrptr++;
-                }
-                if (xclip){
-                    if (w&1) {
-                        /**last pixel is odd pixel due to clipping & odd width*/
-                        uint8_t sourcepixel = *bitmap;
-                        if ((sourcepixel&0x0F) != invisiblecolor) {
-                            sourcepixel <<=4;
-                            uint8_t targetpixel = *scrptr;// & 0x0F;
-                            targetpixel |= sourcepixel;
-                            *scrptr = targetpixel;
-                        }
-                        //scrptr++;
-                    }
-                    bitmap++;
-                    scrptr++;
-                }
-                bitmap += xjump; // needed if x<0 clipping occurs
-            } else { /** ODD pixel starting line **/
-                for (scrx = x; scrx < w+x-xclip; scrx+=2) {
-                    uint8_t sourcepixel = *bitmap;
-                    uint8_t targetpixel = *scrptr;
-                    // store higher nibble of source pixel in lower nibble of target
-                    if((sourcepixel>>4)!=invisiblecolor) targetpixel = (targetpixel & 0xF0) | (sourcepixel >> 4 );
-                    *scrptr = targetpixel;
-                    scrptr++;
-                    targetpixel = *scrptr;
-                    // store lower nibble of source pixel in higher nibble of target
-                    if((sourcepixel&0x0F)!=invisiblecolor) targetpixel = (targetpixel & 0x0F) | (sourcepixel << 4);
-                    *scrptr = targetpixel;
-                    bitmap++;
-                }
-                bitmap+=xjump;
-            }
-            // increment the y jump in the scrptr
-            scrptr = scrptr + ((width - w)>>1)+scrxjump;
-    }
-
-    return;
-    }
-
-    /** 4bpp fast version */
-
-    if (m_colordepth==8) {
-	int16_t scrx,scry,xclip,xjump,scrxjump;
-    xclip=xjump=scrxjump=0;
-    /** y clipping */
-    if (y<0) { h+=y; bitmap -= y*w; y=0;}
-    else if (y+h>height) { h -=(y-height);}
-    /** x clipping */
-    if (x<0) { xclip=x; w+=x; xjump = (-x); bitmap += xjump; x=0;}
-    else if (x+w>width) {
-            xclip = x;
-            scrxjump = x;
-            xjump=(x+w-width)+scrxjump;
-            w = width-x;}
-
-    uint8_t* scrptr = m_scrbuf + (y*width + x);
-    for (scry = y; scry < y+h; scry+=1) {
-            if (scry>=height) return;
-                for (scrx = x; scrx < w+x; scrx++) {
-                    uint8_t sourcepixel = *bitmap;
-                    uint8_t targetpixel = *scrptr;
-                    if (sourcepixel != invisiblecolor ) targetpixel = sourcepixel;
-                    *scrptr = targetpixel;
-                    bitmap++;
-                    scrptr++;
-                }
-            bitmap += xjump; // needed if x<0 clipping occurs
-        scrptr = scrptr + (width - w)+scrxjump;
-    }
-    return;
-    }
-
-
-}
-
-void Display::drawRleBitmap(int16_t x, int16_t y, const uint8_t* rlebitmap)
-{
-    // ONLY can copy 4-bit bitmap to 4-bit screen mode for time being
-    #if (POK_SCREENMODE != MODE_FAST_16COLOR)
-    return;
-    #endif
-
-    int16_t w = *rlebitmap;
-	int16_t h = *(rlebitmap + 1);
-    rlebitmap = rlebitmap + 2; //add an offset to the pointer to start after the width and height
-
-    // visibility check
-    if (y<-h || y>height) return; //invisible
-    if (x<-w || x>width) return;  //invisible
-
-    // Clipping is not supported
-    if ((x < 0) || (x+w > width) || (y < 0) || (y+h > height)) return;
-
-    // Currently only support RLE bitmaps in 16 color mode.
-    if (m_colordepth != 4)  //
-        return;
-
-    // Go through each line.
-    uint8_t* scrptr = m_scrbuf + (y*(width>>1) + (x>>1));
-    bool is_endofbitmap = false;
-    for (int16_t scry = y; scry < y+h && !is_endofbitmap;) {
-
-        // Process one line. Go through each pixel run and escape command in RLE data.
-        for (int16_t scrx = x;;) {
-            uint8_t rle_count = *rlebitmap++;
-
-            if (rle_count == 0) {
-
-               /* Escape or absolute mode */
-
-                uint8_t rle_escape_or_runsize = *rlebitmap++;
-                if ( rle_escape_or_runsize == RLE_ESC_EOL) {
-                    // End of line.
-                    break;
-                }
-                else if ( rle_escape_or_runsize == RLE_ESC_EOB) {
-                    // End of bitmap.
-                    is_endofbitmap = true;
-                    break;
-                }
-                else if ( rle_escape_or_runsize == RLE_ESC_OFFSET) {
-                    // Move position in target.
-                    // TODO: not tested yet.
-                    uint8_t xoffset = *rlebitmap++;
-                    uint8_t yoffset = *rlebitmap++;
-                    scrptr += (xoffset>1);
-                    scrx += xoffset;
-                    scrptr += yoffset*width;
-                    scry += yoffset;
-                 }
-                else {
-
-                    /* Absolute mode. Copy pixels from the source bitmap to the target screen. */
-
-                    int16_t runsize = rle_escape_or_runsize;
-                    uint8_t targetpixel = *scrptr;  // initial value
-                    uint8_t sourcepixel = *rlebitmap;  // initial value
-                    for( int16_t runx = 0; runx < runsize; ) {
-                        if (scrx&0x1)  { // screen pixel is in the low nibble
-                            if (runx&0x1) { // bitmap pixel is in the low nibble
-                                if ((sourcepixel&0x0F) != invisiblecolor)
-                                    targetpixel = (targetpixel&0xF0) | (sourcepixel&0x0F); // Copy low to low nibble.
-                                rlebitmap++;
-                            }
-                            else // bitmap pixel is in the high nibble
-                                if ((sourcepixel>>4) != invisiblecolor)
-                                    targetpixel = (targetpixel&0xF0) | (sourcepixel>>4); // Copy high to low nibble.
-
-                            // Copy the byte to the target.
-                            *scrptr = targetpixel;
-                            scrptr++;
-                        }
-                        else  { // screen pixel is in the high nibble
-                            targetpixel = *scrptr;
-                            sourcepixel = *rlebitmap;
-                            if (runx&0x1) { // bitmap pixel is sourcepixel = *rlebitmapin the low nibble
-                                if ((sourcepixel&0x0F) != invisiblecolor )
-                                    targetpixel = (targetpixel&0x0F) | ((sourcepixel<<4)&0xF0); // Copy low to high nibble.
-                                rlebitmap++;  // read the new source byte
-                            }
-                            else // bitmap pixel is in the high nibble
-                                if ((sourcepixel>>4) != invisiblecolor )
-                                    targetpixel = (targetpixel&0x0F) | (sourcepixel&0xF0); // Copy high to high nibble.
-                        }
-                        runx++;
-                        scrx++;
-                    }  // end for
-
-                     // If this is odd target index, copy the byte to the target.
-                    if (scrx&0x1) {
-                        *scrptr = targetpixel;
-                        scrptr++;
-                    }
-
-                    // In absolute mode the source size is always padded to the word boundary.
-                    if (runsize%4) {
-                        int16_t padpixcount = 4 - (runsize%4);
-                        rlebitmap += padpixcount>>1;  // skip n padding bytes
-                    }
-                }
-            }
-            else {
-
-                /* Encoded mode. Duplicate one pixel pair to the all required pixels on the target screen */
-
-                int16_t runsize = rle_count;
-                uint8_t clonepixelpair = *rlebitmap++;
-                uint8_t targetpixel = *scrptr;  // initial value
-                for( int16_t runx = 0;  runx < runsize; ) {
-                    if (scrx&0x1)  { // screen pixel is in the low nibble
-                        if (runx&0x1) { // bitmap pixel is in the low nibble
-                            if ((clonepixelpair&0x0F) != invisiblecolor)
-                                targetpixel = (targetpixel&0xF0) | (clonepixelpair&0x0F); // Copy low to low nibble.
-                        }
-                        else // bitmap pixel is in the high nibble
-                            if ((clonepixelpair>>4) != invisiblecolor)
-                                targetpixel = (targetpixel&0xF0) | (clonepixelpair>>4); // Copy high to low nibble.
-
-                        // Copy the byte to the target.
-                        *scrptr = targetpixel;
-                        scrptr++;
-                    }
-                    else  { // screen pixel is in the high nibble
-                        targetpixel = *scrptr;
-                        if (runx&0x1) {// bitmap pixel is in the low nibble
-                            if ((clonepixelpair&0x0F) != invisiblecolor )
-                                targetpixel = (targetpixel&0x0F) | ((clonepixelpair<<4)&0xF0); // Copy low to high nibble.
-                        }
-                        else // bitmap pixel is in the high nibble
-                            if ((clonepixelpair>>4) != invisiblecolor )
-                                targetpixel = (targetpixel&0x0F) | (clonepixelpair&0xF0); // Copy high to high nibble.
-                    }
-                    runx++;
-                    scrx++;
-
-                }  // end for
-
-                // If this is odd target index, copy the byte to the target.
-                if (scrx&0x1) {
-                    *scrptr = targetpixel;
-                    scrptr++;
-                 }
-            } // end if
-        }  // end while
-
-        // Increment the target screen pointer and index.
-        scrptr = scrptr + ((width - w)>>1);
-        scry++;
-    } // end for scry
-}
-
-void Display::drawBitmapXFlipped(int16_t x, int16_t y, const uint8_t* bitmap)
-{
-    int16_t w = *bitmap;
-	int16_t h = *(bitmap + 1);
-    bitmap = bitmap + 2; //add an offset to the pointer to start after the width and height
-    /** visibility check */
-    if (y<-h || y>height) return; //invisible
-    if (x<-w || x>width) return;  //invisible
-    /** 1 bpp mode */
-    if (m_colordepth<2) {
-    int16_t i, j, byteNum, bitNum, byteWidth = (w + 7) >> 3;
-    for (i = 0; i < w; i++) {
-        byteNum = i / 8;
-        bitNum = i % 8;
-        for (j = 0; j < h; j++) {
-            uint8_t source = *(bitmap + j * byteWidth + byteNum);
-            if (source & (0x80 >> bitNum)) {
-                drawPixel(x + w - i, y + j);
-            }
-        }
-    }
-
-    return;
-    }
-    /** 2 bpp mode */
-    if (m_colordepth<4) {
-    int16_t i, j, byteNum, bitNum, byteWidth = w >> 2;
-    for (i = 0; i < w; i++) {
-        byteNum = i / 4;
-        bitNum = (i % 4)<<1;
-        for (j = 0; j < h; j++) {
-            uint8_t source = *(bitmap + j * byteWidth + byteNum);
-            uint8_t output = (source & (0xC0 >> bitNum));
-            output >>= (6-bitNum);
-            if (output != invisiblecolor) {
-                setColor(output);
-                drawPixel(x + i, y + j);
-            }
-        }
-    }
-
-    return;
-    }
-    /** 4bpp fast version */
-	int16_t scrx,scry,xclip,xjump,scrxjump;
-    xclip=xjump=scrxjump=0;
-    /** y clipping */
-    if (y<0) { h+=y; bitmap -= y*(w>>1); y=0;}
-    else if (y+h>height) { h -=(y-height);}
-    /** x clipping */
-    bitmap += ((w>>1)-1); //inverted!
-    if (x<0) {
-            xclip=(x&1)<<1;
-            w+=x;
-            xjump = ((-x)>>1);
-            //bitmap += xjump; // do not clip left edge of source, as bitmap is inverted !
-            x=0;
-            }
-    else if (x+w>width) {
-            xclip = (x&1)<<1;
-            scrxjump = x&1;
-            xjump=((x+w-width)>>1)+scrxjump;
-            w = width-x;}
-
-    //uint8_t* scrptr = m_scrbuf + (y*(width>>1) + ((x+width)>>1));
-    uint8_t* scrptr = m_scrbuf + (y*(width>>1) + (x>>1));
-    /** ONLY 4-bit mode for time being **/
-    for (scry = y; scry < y+h; scry+=1) {
-    //    for (scry = y; scry < y+2; scry+=1) {
-            if (scry>=height) return;
-            if ((x&1)==0) { /** EVEN pixel starting line, very simple, just copypaste **/
-                //for (scrx = w+x-xclip-1; scrx >= x; scrx-=2) {
-                for (scrx = x; scrx < w+x-xclip; scrx+=2) {
-                    uint8_t sourcepixel = *(bitmap);
-                    if (xclip) {
-                            sourcepixel <<=4;
-                            sourcepixel |= ((*(bitmap-1))>>4);//inverted!
-                    }
-                    uint8_t targetpixel = *scrptr;
-                    // NIBBLES ARE INVERTED BECAUSE PICTURE IS FLIPPED !!!
-                    if ((sourcepixel>>4) != invisiblecolor ) targetpixel = (targetpixel&0xF0) | (sourcepixel>>4);
-                    if ((sourcepixel&0x0F) != invisiblecolor) targetpixel = (targetpixel & 0x0F) | (sourcepixel<<4);
-                    *scrptr = targetpixel;
-                    bitmap--;
-                    scrptr++;
-                }
-                bitmap += w; // w*2 >> 1 because inverted and because 2 pixels per byte!!
-                if (xclip){
-                    if (w&1) {
-                        /**last pixel is odd pixel due to clipping & odd width*/
-                        uint8_t sourcepixel = *bitmap;
-                        if ((sourcepixel&0x0F) != invisiblecolor) {
-                            sourcepixel <<=4;
-                            uint8_t targetpixel = *scrptr;// & 0x0F;
-                            targetpixel |= sourcepixel;
-                            *scrptr = targetpixel;
-                        }
-                        //scrptr++;
-                    }
-                    bitmap++;
-                    scrptr++;
-                }
-                bitmap += xjump; // needed if x<0 clipping occurs
-            } else { /** ODD pixel starting line **/
-                for (scrx = x; scrx < w+x-xclip; scrx+=2 ) {
-                    uint8_t sourcepixel = *bitmap;
-                    uint8_t targetpixel = *scrptr;
-                    // inverted !!! store lower nibble of source pixel in lower nibble of target
-                    if((sourcepixel&0x0F)!=invisiblecolor) targetpixel = (targetpixel & 0xF0) | (sourcepixel & 0x0F );
-                    *scrptr = targetpixel;
-                    scrptr++;
-                    targetpixel = *scrptr;
-                    // inverted ! store higher nibble of source pixel in higher nibble of target
-                    if((sourcepixel>>4)!=invisiblecolor) targetpixel = (targetpixel & 0x0F) | (sourcepixel & 0xF0);
-                    *scrptr = targetpixel;
-                    bitmap--;
-                }
-                bitmap += w; // w*2 >> 1 because inverted and because 2 pixels per byte!!
-                bitmap+=xjump;
-            }
-            // increment the y jump in the scrptr
-            scrptr = scrptr + ((width - w)>>1)+scrxjump;
-    }
-}
-
-void Display::drawBitmap(int16_t x, int16_t y, const uint8_t *bitmap, uint8_t rotation, uint8_t flip) {
-#if PROJ_GAMEBUINO == 0
-    if (!flip) drawBitmap(x,y,bitmap);
-    else drawBitmapXFlipped(x,y,bitmap);
-#else
-	if((rotation == NOROT) && (flip == NOFLIP)){
-		drawBitmap(x,y,bitmap); //use the faster algorithm
-		return;
-	}
-	uint8_t w = bitmap[0];
-	uint8_t h = bitmap[1];
-	bitmap = bitmap + 2; //add an offset to the pointer to start after the width and height
-    int8_t i, j, //coordinates in the raw bitmap
-            k, l, //coordinates in the rotated/flipped bitmap
-            byteNum, bitNum, byteWidth = (w + 7) >> 3;
-
-    rotation %= 4;
-
-    for (i = 0; i < w; i++) {
-        byteNum = i / 8;
-        bitNum = i % 8;
-        for (j = 0; j < h; j++) {
-            if (bitmap[j * byteWidth + byteNum] & (B10000000 >> bitNum)) {
-                switch (rotation) {
-                    case NOROT: //no rotation
-                        k = i;
-                        l = j;
-                        break;
-                    case ROTCCW: //90° counter-clockwise
-                        k = j;
-                        l = w - i - 1;
-                        break;
-                    case ROT180: //180°
-                        k = w - i - 1;
-                        l = h - j - 1;
-                        break;
-                    case ROTCW: //90° clockwise
-                        k = h - j - 1;
-                        l = i;
-                        break;
-                }
-                if (flip) {
-                    flip %= 4;
-                    if (flip & B00000001) { //horizontal flip
-                        k = w - k;
-                    }
-                    if (flip & B00000010) { //vertical flip
-                        l = h - l;
-                    }
-                }
-                k += x; //place the bitmap on the screen
-                l += y;
-                drawPixel(k, l);
-            }
-        }
-    }
-#endif //PROJ_GAMEBUINO
-
-}
-
-uint8_t* Display::getBuffer() {
-    return m_scrbuf;
-}
-
-uint8_t Display::getBitmapPixel(const uint8_t* bitmap, uint16_t x, uint16_t y) {
-    uint16_t w = *bitmap;
-    uint8_t sourcebyte = bitmap[2+(y * ((w+7)>>3))+ (x>>3)];
-    return sourcebyte & (0x80>>(x&7));
-}
-
-int Display::print_char(uint8_t x, uint8_t y, unsigned char c) {
-	c -= font[2];
-	if (m_mode) return directChar(x,y,c);
-	return bufferChar(x,y,c);
-}
-
-void Display::drawChar(int8_t x, int8_t y, unsigned char c, uint8_t size) {
-	print_char(x,y,c);
-	return;
-}
-
-
-bool Display::isDirectPrintingEnabled() {
-    return m_mode;
-}
-
-void Display::enableDirectPrinting(uint8_t m) {
-    if (m) {
-            m_mode=true;
-            m_w = POK_LCD_W;
-            m_h = POK_LCD_H;
-    } else {
-            m_mode=false;
-            m_w = getWidth();
-            m_h = getHeight();
-    }
-}
-
-void Display::write(uint8_t c) {
-	int charstep=0;
-	if(font[3]) {
-        // only caps in this font
-        if (c>=97) c-=32;
-	}
-	switch(c) {
-		case '\0':			//null
-			break;
-		case '\n':			//line feed
-			cursorX = 0;
-			inc_txtline();
-			break;
-		case 8:				//backspace
-			cursorX -= font[0];
-			charstep=print_char(cursorX,cursorY,' ');
-			break;
-		case 13:			//carriage return
-			cursorX = 0;
-			break;
-		case 14:			//form feed new page(clear screen)
-			//clear_screen();
-			break;
-		default:
-			if (cursorX >= (m_w - font[0])) {
-				cursorX = 0;
-				if (textWrap) inc_txtline();
-				else return; // stop outputting text
-				charstep=print_char(cursorX,cursorY,c);
-			}
-			else
-				charstep=print_char(cursorX,cursorY,c);
-			if (c==' ' && adjustCharStep) charstep=(charstep>>1)+1;
-			cursorX += charstep;
-	}
-}
-
-void Display::inc_txtline() {
-	if (cursorY > m_h - 2*font[1]) //= (height - (font[1]+1)))
-		#if SCROLL_TEXT > 0
-		scroll(font[1] + adjustLineStep);
-		#else
-		cursorY = 0;
-		#endif
-	else
-		cursorY += font[1] + adjustLineStep;
-}
-
-/* default implementation: may be overridden */
-void Display::write(const char *str)
-{
-  while (*str)
-    write(*str++);
-}
-
-/* default implementation: may be overridden */
-void Display::write(const uint8_t *buffer, uint8_t size)
-{
-  while (size--)
-    write(*buffer++);
-}
-
-void Display::print(const char str[])
-{
-  write(str);
-}
-
-void Display::print(char c, int base)
-{
-  print((long) c, base);
-}
-
-void Display::print(unsigned char b, int base)
-{
-  print((unsigned long) b, base);
-}
-
-void Display::print(int n, int base)
-{
-  print((long) n, base);
-}
-
-void Display::print(unsigned int n, int base)
-{
-  print((unsigned long) n, base);
-}
-
-void Display::print(long n, int base)
-{
-  if (base == 0) {
-    write(n);
-  } else if (base == 10) {
-    if (n < 0) {
-      print('-');
-      n = -n;
-    }
-    printNumber(n, 10);
-  } else {
-    printNumber(n, base);
-  }
-}
-
-void Display::print(unsigned long n, int base)
-{
-  if (base == 0) write(n);
-  else printNumber(n, base);
-}
-
-void Display::print(double n, int digits)
-{
-  printFloat(n, digits);
-}
-
-void Display::println(void)
-{
-  print('\r');
-  print('\n');
-}
-
-void Display::println(const char c[])
-{
-  print(c);
-  println();
-}
-
-void Display::println(char c, int base)
-{
-  print(c, base);
-  println();
-}
-
-void Display::println(unsigned char b, int base)
-{
-  print(b, base);
-  println();
-}
-
-void Display::println(int n, int base)
-{
-  print(n, base);
-  println();
-}
-
-void Display::println(unsigned int n, int base)
-{
-  print(n, base);
-  println();
-}
-
-void Display::println(long n, int base)
-{
-  print(n, base);
-  println();
-}
-
-void Display::println(unsigned long n, int base)
-{
-  print(n, base);
-  println();
-}
-
-void Display::println(double n, int digits)
-{
-  print(n, digits);
-  println();
-}
-
-void Display::set_cursor(uint8_t x, uint8_t y) {
-	cursorX = x;
-	cursorY = y;
-}
-
-void Display::print(uint8_t x, uint8_t y, const char str[]) {
-	cursorX = x;
-	cursorY = y;
-	write(str);
-
-}
-void Display::print(uint8_t x, uint8_t y, char c, int base) {
-	cursorX = x;
-	cursorY = y;
-	print((long) c, base);
-}
-void Display::print(uint8_t x, uint8_t y, unsigned char b, int base) {
-	cursorX = x;
-	cursorY = y;
-	print((unsigned long) b, base);
-}
-void Display::print(uint8_t x, uint8_t y, int n, int base) {
-	cursorX = x;
-	cursorY = y;
-	print((long) n, base);
-}
-void Display::print(uint8_t x, uint8_t y, unsigned int n, int base) {
-	cursorX = x;
-	cursorY = y;
-	print((unsigned long) n, base);
-}
-void Display::print(uint8_t x, uint8_t y, long n, int base) {
-	cursorX = x;
-	cursorY = y;
-	print(n,base);
-}
-void Display::print(uint8_t x, uint8_t y, unsigned long n, int base) {
-	cursorX = x;
-	cursorY = y;
-	print(n,base);
-}
-void Display::print(uint8_t x, uint8_t y, double n, int digits) {
-	cursorX = x;
-	cursorY = y;
-	print(n,digits);
-}
-
-void Display::println(uint8_t x, uint8_t y, const char c[])
-{
-	cursorX = x;
-	cursorY = y;
-	print(c);
-	println();
-}
-
-void Display::println(uint8_t x, uint8_t y, char c, int base)
-{
-	cursorX = x;
-	cursorY = y;
-	print(c, base);
-	println();
-}
-
-void Display::println(uint8_t x, uint8_t y, unsigned char b, int base)
-{
-	cursorX = x;
-	cursorY = y;
-	print(b, base);
-	println();
-}
-
-void Display::println(uint8_t x, uint8_t y, int n, int base)
-{
-	cursorX = x;
-	cursorY = y;
-	print(n, base);
-	println();
-}
-
-void Display::println(uint8_t x, uint8_t y, unsigned int n, int base)
-{
-	cursorX = x;
-	cursorY = y;
-	print(n, base);
-	println();
-}
-
-void Display::println(uint8_t x, uint8_t y, long n, int base)
-{
-	cursorX = x;
-	cursorY = y;
-	print(n, base);
-	println();
-}
-
-void Display::println(uint8_t x, uint8_t y, unsigned long n, int base)
-{
-	cursorX = x;
-	cursorY = y;
-	print(n, base);
-	println();
-}
-
-void Display::println(uint8_t x, uint8_t y, double n, int digits)
-{
-	cursorX = x;
-	cursorY = y;
-	print(n, digits);
-	println();
-}
-
-void Display::printNumber(unsigned long n, uint8_t base)
-{
-  unsigned char buf[8 * sizeof(long)]; // Assumes 8-bit chars.
-  unsigned long i = 0;
-
-  if (n == 0) {
-    print('0');
-    return;
-  }
-
-  while (n > 0) {
-    buf[i++] = n % base;
-    n /= base;
-  }
-
-  for (; i > 0; i--)
-    print((char) (buf[i - 1] < 10 ?
-      '0' + buf[i - 1] :
-      'A' + buf[i - 1] - 10));
-}
-
-void Display::printFloat(double number, uint8_t digits)
-{
-  // Handle negative numbers
-  if (number < 0.0)
-  {
-     print('-');
-     number = -number;
-  }
-
-  // Round correctly so that print(1.999, 2) prints as "2.00"
-  double rounding = 0.5;
-  for (uint8_t i=0; i<digits; ++i)
-    rounding /= 10.0;
-
-  number += rounding;
-
-  // Extract the integer part of the number and print it
-  unsigned long int_part = (unsigned long)number;
-  double remainder = number - (double)int_part;
-  print(int_part);
-
-  // Print the decimal point, but only if there are digits beyond
-  if (digits > 0)
-    print(".");
-
-  // Extract digits from the remainder one at a time
-  while (digits-- > 0)
-  {
-    remainder *= 10.0;
-    int toPrint = int(remainder);
-    print(toPrint);
-    remainder -= toPrint;
-  }
-}
-
-void Display::draw4BitColumn(int16_t x, int16_t y, uint8_t h, uint8_t* bitmap)
-{
-    int8_t scry;
-    uint8_t* scrptr = m_scrbuf + (y*(width>>1) + (x>>1));
-
-    /** ONLY 4-bit mode for time being **/
-
-            if ((x&1)==0) { /** EVEN pixel starting line, very simple, just copypaste **/
-                for (scry = y; scry < h+y; scry++) {
-                    uint8_t sourcepixel = *bitmap;
-                    uint8_t targetpixel = *scrptr;
-                    targetpixel = (targetpixel&0x0F) | (sourcepixel << 4);
-                    *scrptr = targetpixel;
-                    bitmap++;
-                    scrptr+=55;
-                }
-            } else { /** ODD pixel starting line **/
-                for (scry = y; scry < h+y; scry++) {
-                    uint8_t sourcepixel = *bitmap;
-                    uint8_t targetpixel = *scrptr;
-                    // store source pixel in lower nibble of target
-                    targetpixel = (targetpixel & 0xF0) | (sourcepixel);
-                    *scrptr = targetpixel;
-                    scrptr+=55;
-                    bitmap++;
-                }
-            }
-}
-
-/**
- * Setup or disable the sprite. Note that enabled sprites must always have subsequent indices, starting from the index zero.
- * You cannot have gaps in indices of enabled sprites.
- * The max number of sprites can be changed by a SPRITE_COUNT define, the default is 4.
- * Note: the sprites currently work only in the 220 x 176 x 2bpp mode.
- * @param index The sprite index. The lower index is drawn first, i.e. is on bottom.
- * @param bitmap A pointer to a 2bpp bitmap. A NULL value means that the sprite is disabled. The ownership is not transferred, so the caller must keep the bitmap alive.
- * @param palette4x16bit Four color palette of 16bit elements. The first color value is considered as transparent. The palette is copied to the sprite struct, so the caller do not have to keep it alive.
- * @param x The initial x
- * @param y The initial y
- * @param doResetDirtyRect (default=true) True, if the previous coordinates are reseted.
- */
-void Display::setSpriteBitmap(uint8_t index, const uint8_t* bitmap,  const uint16_t* palette4x16bit, int16_t x, int16_t y, bool doResetDirtyRect ) {
-
-    setSprite(index, &(bitmap[2]), palette4x16bit, x, y, bitmap[0], bitmap[1], doResetDirtyRect);
-}
-
-/**
- * Setup or disable the sprite. Note that enabled sprites must always have subsequent indices, starting from the index zero.
- * You cannot have gaps in indices of enabled sprites.
- * The max number of sprites can be changed by a SPRITE_COUNT define, the default is 4.
- * Note: the sprites currently work only in the 220 x 176 x 2bpp mode.
- * @param index The sprite index. The lower index is drawn first, i.e. is on bottom. Note that
- * @param data A pointer to a 2bpp pixel data of size w x h. A NULL value means that the sprite is disabled. The ownership is not transferred, so the caller must keep the data alive.
- * @param palette4x16bit Four color palette of 16bit elements. The first color value is considered as transparent. The palette is copied to the sprite struct, so the caller do not have to keep it alive.
- * @param x The initial x
- * @param y The initial y
- * @param w Width
- * @param h Height
- */
-void Display::setSprite(uint8_t index, const uint8_t* data, const uint16_t* palette4x16bit, int16_t x, int16_t y, uint8_t w, uint8_t h, bool doResetDirtyRect ) {
-
-    if(index >= SPRITE_COUNT) return;
-    m_sprites[index].bitmapData = data;
-    m_sprites[index].x = x;
-    m_sprites[index].y = y;
-    if (doResetDirtyRect) {
-        m_sprites[index].oldx = x;
-        m_sprites[index].oldy = y;
-    }
-    m_sprites[index].w = w;
-    m_sprites[index].h = h;
-    if( palette4x16bit ) memcpy(m_sprites[index].palette, palette4x16bit, 4*2);
-}
-
-/**
- * Set the sprite position.
- * @param index The sprite index
- * @param x
- * @param y
- */
-void Display::setSpritePos(uint8_t index, int16_t x, int16_t y) {
-
-    if(index >= SPRITE_COUNT) return;
-    m_sprites[index].x = x;
-    m_sprites[index].y = y;
-}
-
-void Display::lcdRefresh(unsigned char* scr, bool useDirectDrawMode) {
-
-#if POK_SCREENMODE == MODE_HI_4COLOR
-    // If there is one or more sprites, use sprite enabled drawing.
-    if (m_sprites[0].bitmapData != NULL)
-        lcdRefreshMode1Spr(scr, 0, 0, LCDWIDTH, LCDHEIGHT, paletteptr, m_sprites, useDirectDrawMode);
-    else if (!useDirectDrawMode)
-        lcdRefreshMode1(m_scrbuf, 0, 0, LCDWIDTH, LCDHEIGHT, paletteptr);
-#endif
-
-    // For the screen modes that do not support sprites, return if the direct draw mode is used.
-    if (useDirectDrawMode) return;
-#if POK_SCREENMODE == MODE13
-    lcdRefreshMode13(m_scrbuf, paletteptr, palOffset);
-#endif
-
-#if POK_SCREENMODE == MODE_GAMEBOY
-    lcdRefreshModeGBC(scr, paletteptr);
-#endif
-
-#if POK_SCREENMODE == MODE_FAST_16COLOR
-    lcdRefreshMode2(scr, paletteptr);
-#endif
-
-#if POK_SCREENMODE == MODE_GAMEBUINO_16COLOR
-    lcdRefreshGB(scr, paletteptr);
-#endif
-
-#if POK_SCREENMODE == MODE_ARDUBOY_16COLOR
-    lcdRefreshAB(scr, paletteptr);
-#endif
-
-}
-
-void Display::setFrameBufferTo(uint8_t* sb) {
-    m_scrbuf = sb;
-};
-
-void Display::setTileBufferTo(uint8_t* tb) {
-    m_tilebuf = tb;
-};
-
-void Display::loadTileset(const uint8_t* ts) {
-    m_tileset = (uint8_t*) ts;
-};
-
-void Display::setTile(uint16_t i, uint8_t t) {
-    if (!m_tilebuf) return;
-    m_tilebuf[i]=t;
-};
-
-// Convert an integer to a hexadecimal string
-char* itoa_hex(int num, char* dest, int destLen) {
-    int i = destLen-1;
-    do {
-        char c = (num % 16) + '0';
-        if (c > '9') c += 7;
-        dest[i--] = c;
-        num /= 16;
-    } while (num && i >= 0);
-    return &(dest[i+1]);
-}
-
-// Draw the crash screen and wait forever
-void ShowCrashScreenAndWait( const char* texLine1, const char* texLine2, const char* texLine3, const char* texLine4, const char* texLine5 ) {
-
-    // draw screen red
-    lcdFillSurface(COLOR_RED);
-
-    // Draw text
-    Display::directcolor = COLOR_WHITE;
-    Display::invisiblecolor = COLOR_RED;
-    Display::directbgcolor = COLOR_RED; // Cannot be black as that is a transparent color
-    Display::directtextrotated = false;
-    Display::adjustCharStep = 0;
-    Display::adjustLineStep = 0;
-    Display::setFont(fntC64UIGfx);  // A special font set that contains UI gfx in lower case letters.
-    Display::fixedWidthFont = true; // Needed for the non-proportional C64 font (default value=false)
-    Display::enableDirectPrinting(true);
-
-    // Draw texts
-    int  yOffsetInPixels = 5;
-    Display::set_cursor(0, 9 + yOffsetInPixels);
-    Display::print("  ");    Display::println(texLine1);
-    Display::print("  ");    Display::println(texLine2);
-    Display::print("  ");    Display::println(texLine3);
-    Display::println();
-    Display::print("  *");   Display::println(texLine4);
-    Display::print("  *");   Display::println(texLine5);
-
-    Display::set_cursor(0, 0 + yOffsetInPixels);
-
-    // Frame
-    Display::println(" abbbbbbbbbbbbbbbbbbbbbbbbc");
-    Display::print  (" |"); Display::println(26*8, Display::cursorY,"|");
-    Display::print  (" |"); Display::println(26*8, Display::cursorY,"|");
-    Display::print  (" |"); Display::println(26*8, Display::cursorY,"|");
-    Display::print  (" |"); Display::println(26*8, Display::cursorY,"|");
-    Display::print  (" |"); Display::println(26*8, Display::cursorY,"|");
-    Display::print  (" |"); Display::println(26*8, Display::cursorY,"|");
-    Display::println(" dbbbzybbbbbbbbbbbbbbbbbbbe");
-    Display::println("     {e");
-
-     // Pokitto image
-    Display::println  ("");
-    Display::println  ("  ijkl");
-    Display::println  ("  mnop");
-    Display::println  ("  qrst");
-    Display::println  ("  uvwx");
-
-   // loop forever
-    while(1){;}
- }
-
-// Check the stack size and show a crash screen if the stack is too big.
-void CheckStack() {
-    #ifndef POK_SIM
-    #ifndef __ARMCC_VERSION
-    int currStackTop;
-    const int freeStackThreshold = 400;
-    if ((int)&currStackTop - (int)_ebss < freeStackThreshold) {
-
-        // Create info string: "<stack size>:<current stack pointer>", e.g. "12345ABC:12345ABC"
-        const int infoStringLen = 8+1+8;
-        static char infoString[infoStringLen+1];
-        memset(infoString,0,infoStringLen+1);
-        const int stackSize = (int)_vStackTop - (int)&currStackTop;
-        const int tmpStrLen = 8;
-        static char tmpStr[tmpStrLen+1];
-        memset(tmpStr,0,tmpStrLen+1);
-        char* subStr = itoa_hex(stackSize, tmpStr, tmpStrLen); // keep ending null
-        strcat(infoString, subStr); // Add stack size as hex string
-        strcat(infoString, ":");
-        subStr = itoa_hex((int)&currStackTop, tmpStr, tmpStrLen); // keep ending null
-        strcat(infoString, subStr); // Add stack pointer address as hex string
-
-        // Draw the crash screen and wait forever. Use static const strings to avoid more stack usage.
-        static const char* texLine1 = "OOPS! PLEASE, RESTART";
-        static const char* texLine2 = "POKITTO OR RELOAD";
-        static const char* texLine3 = "SOFTWARE.";
-        static const char* texLine4 = "STACK TOO BIG!";
-        ShowCrashScreenAndWait(texLine1, texLine2, texLine3, texLine4, infoString);
-    }
-    #endif
-    #endif
-}
-
-/** Eof */
-
-
-
--- a/POKITTO_CORE/PokittoDisplay.h	Wed Jun 27 13:14:54 2018 +0000
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,430 +0,0 @@
-/**************************************************************************/
-/*!
-    @file     PokittoDisplay.h
-    @author   Jonne Valola
-
-    @section LICENSE
-
-    Software License Agreement (BSD License)
-
-    Copyright (c) 2016, Jonne Valola
-    All rights reserved.
-
-    Redistribution and use in source and binary forms, with or without
-    modification, are permitted provided that the following conditions are met:
-    1. Redistributions of source code must retain the above copyright
-    notice, this list of conditions and the following disclaimer.
-    2. Redistributions in binary form must reproduce the above copyright
-    notice, this list of conditions and the following disclaimer in the
-    documentation and/or other materials provided with the distribution.
-    3. Neither the name of the copyright holders nor the
-    names of its contributors may be used to endorse or promote products
-    derived from this software without specific prior written permission.
-
-    THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS ''AS IS'' AND ANY
-    EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
-    WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
-    DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER BE LIABLE FOR ANY
-    DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-    (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-    LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-    ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-    (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
-    SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-*/
-/**************************************************************************/
-
-
-
-/* THE SEGMENT BELOW PERTAINS TO CIRCLE DRAWING FUNCTIONS ONLY
-*
-This is the core graphics library for all our displays, providing a common
-set of graphics primitives (points, lines, circles, etc.).  It needs to be
-paired with a hardware-specific library for each display device we carry
-(to handle the lower-level functions).
-Adafruit invests time and resources providing this open source code, please
-support Adafruit & open-source hardware by purchasing products from Adafruit!
-Copyright (c) 2013 Adafruit Industries.  All rights reserved.
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are met:
-- Redistributions of source code must retain the above copyright notice,
-  this list of conditions and the following disclaimer.
-- Redistributions in binary form must reproduce the above copyright notice,
-  this list of conditions and the following disclaimer in the documentation
-  and/or other materials provided with the distribution.
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
-AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
-LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
-CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
-SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
-INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
-CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
-ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
-POSSIBILITY OF SUCH DAMAGE.
-*/
-
-#ifndef POKITTODISPLAY_H
-#define POKITTODISPLAY_H
-
-#include <stdint.h>
-#include "Pokitto_settings.h"
-#include "PokittoGlobs.h"
-#include "PokittoFonts.h"
-#include "PokittoPalettes.h"
-
-// Basic Color definitions
-#define	COLOR_BLACK                         (uint16_t)(0x0000)
-#define	COLOR_BLUE                          (uint16_t)(0x001F)
-#define	COLOR_RED                           (uint16_t)(0xF800)
-#define	COLOR_GREEN                         (uint16_t)(0x07E0)
-#define COLOR_CYAN                          (uint16_t)(0x07FF)
-#define COLOR_MAGENTA                       (uint16_t)(0xF81F)
-#define COLOR_YELLOW                        (uint16_t)(0xFFE0)
-#define COLOR_WHITE                         (uint16_t)(0xFFFF)
-
-// Grayscale Values
-#define COLOR_GRAY_15                       (uint16_t)(0x0861)    //  15  15  15
-#define COLOR_GRAY_30                       (uint16_t)(0x18E3)    //  30  30  30
-#define COLOR_GRAY_50                       (uint16_t)(0x3186)    //  50  50  50
-#define COLOR_GRAY_80                       (uint16_t)(0x528A)    //  80  80  80
-#define COLOR_GRAY_128                      (uint16_t)(0x8410)    // 128 128 128
-#define COLOR_GRAY_200                      (uint16_t)(0xCE59)    // 200 200 200
-#define COLOR_GRAY_225                      (uint16_t)(0xE71C)    // 225 225 225
-
-/** The tables below are palettes, that resemble the Pico 8 palette*/
-
-enum defcolors {
-    C_BLACK,
-    C_DARKBLUE,
-    C_PURPLE,
-    C_DARKGREEN,
-
-    C_BROWN,
-    C_DARKBROWN,
-    C_LIGHTGRAY,
-    C_WHITE,
-
-    C_RED,
-    C_ORANGE,
-    C_YELLOW,
-    C_GREEN,
-
-    C_BLUE,
-    C_DARKGRAY,
-    C_PINK,
-    C_PEACH
-};
-
-const uint16_t def565palette[16] = {
-    //kind of like pico8 palette
-    0,0x194a,0x792a,0x42a,
-    0xaa86,0x5aa9,0xc618,0xff9d,
-    0xf809,0xfd00,0xff84,0x72a,
-    0x2d7f,0x83b3,0xfbb5,0xfe75
-};
-
-#define PALETTE_SIZE 256
-#include <stdint.h>
-#include <stdlib.h>
-#include <string.h>
-
-
-namespace Pokitto {
-
-class Display {
-public:
-    Display();
-
-    // PROPERTIES
-private:
-    static uint8_t* canvas;
-    static uint8_t bpp;
-    static uint8_t m_colordepth;
-public:
-    static uint8_t palOffset;
-    static uint8_t width;
-    static uint8_t height;
-    static uint8_t screenbuffer[];
-
-    // PROPERTIES
-    static void setColorDepth(uint8_t);
-    static uint8_t getColorDepth();
-    static uint8_t getBitsPerPixel();
-    static uint16_t getWidth();
-    static uint16_t getHeight();
-    static uint8_t getNumberOfColors();
-
-    // IMPORTANT PUBLIC STATE MEMBERS
-    /** Selected font */
-    static const unsigned char * font;
-    /** Set if screen is cleared between updates or not*/
-    static uint8_t persistence;
-    /** Selected drawing color */
-    static uint16_t color;
-    /** Selected background color */
-    static uint16_t bgcolor;
-    /** Selected invisible color */
-    static uint16_t invisiblecolor;
-    /** Direct unbuffered color */
-    static uint16_t directcolor;
-    /** Direct unbuffered background color */
-    static uint16_t directbgcolor;
-    /** Direct text rotated */
-    static bool directtextrotated;
-    /** clip rect on screen**/
-    static int16_t clipX;
-    static int16_t clipY;
-    static int16_t clipW;
-    static int16_t clipH;
-    /** set color with a command */
-    static void setColor(uint8_t);
-    /** set color and bgcolor with a command */
-    static void setColor(uint8_t,uint8_t);
-    /** set invisiblecolor with a command */
-    static void setInvisibleColor(uint16_t);
-    /** get color */
-    static uint8_t getColor();
-    /** get background color */
-    static uint8_t getBgColor();
-    /** get invisible color */
-    static uint16_t getInvisibleColor();
-    /** set clip rect on screen**/
-    static void setClipRect(int16_t x, int16_t y, int16_t w, int16_t h);
-
-    /** Initialize display */
-    static void begin();
-    /** Clear display buffer */
-    static void clear();
-    /** Scroll by x lines */
-    static void scroll(int16_t);
-    /** Fill display buffer */
-    static void fillScreen(uint16_t);
-    /** Send display buffer to display hardware */
-    static void update(bool useDirectMode=false, uint8_t updRectX=0, uint8_t updRectY=0, uint8_t updRectW=LCDWIDTH, uint8_t updRectH=LCDHEIGHT);
-    /** Forced update of LCD display memory with a given pixel buffer */
-    static void lcdRefresh(unsigned char*, bool useDirectMode=false);
-    /** Clear LCD hardware memory */
-    static void clearLCD();
-    /** Fill LCD hardware memory */
-    static void fillLCD(uint16_t);
-    /** Show Pokitto logo at startup*/
-    static void showLogo();
-    /** Point to another screenbuffer instead of the default one */
-    static void setFrameBufferTo(uint8_t*);
-
-    // COLORS AND PALETTE
-public:
-    /** set default palette */
-    static void setDefaultPalette();
-    /** master palette */
-    static uint16_t palette[PALETTE_SIZE];
-    /** runtime palette pointer */
-    static uint16_t *paletteptr;
-    /** convert RGB to 565 color value */
-    static uint16_t RGBto565(uint8_t,uint8_t,uint8_t);
-    /** linear interpolation between colors */
-    static uint16_t interpolateColor(uint16_t, uint16_t, uint8_t);
-    /** load an R,G,B triplet palette */
-    static void loadRGBPalette(const unsigned char*);
-    /** load a ready-made 565 palette */
-    static void load565Palette(const uint16_t*);
-    /** rotate palette by step */
-    static void rotatePalette(int8_t);
-    /** tween between two palettes **/
-    static void tweenPalette(uint16_t*, const uint16_t*, const uint16_t*, uint8_t);
-
-    // DIRECT DRAWING (NO BUFFERING)
-    /** Direct pixel (not through display buffer) */
-    static void directPixel(int16_t,int16_t,uint16_t);
-    /** Direct tile 16bit (not through display buffer) */
-	static void directTile(int16_t x, int16_t y, int16_t x2, int16_t y2, uint16_t* gfx);
-    /** Direct rectangle (not through display buffer) */
-    static void directRectangle(int16_t, int16_t,int16_t, int16_t, uint16_t);
-    /** Set the cursor for printing to a certain screen position */
-    static void setCursor(int16_t,int16_t);
-    /** direct bitmap to screen (no buffering) */
-    static void directBitmap(int16_t,int16_t,const uint8_t*, uint8_t,uint8_t);
-
-
-    // DRAWING METHODS
-    /** Draw pixel at various bit depths */
-    static void drawPixel(int16_t,int16_t);
-    /** Draw pixel with specific color index at various bit depths */
-    static void drawPixel(int16_t x,int16_t y, uint8_t col);
-    /** Get pixel at various bit depths */
-    static uint8_t getPixel(int16_t,int16_t);
-    /** Draw line **/
-    static void drawLine(int16_t,int16_t,int16_t,int16_t);
-    /** Clip line with screen boundaries, returns 0 if whole line is out of bounds */
-    static uint8_t clipLine(int16_t*, int16_t*, int16_t*, int16_t*);
-    /** Draw a column real fast */
-    static void drawColumn(int16_t, int16_t, int16_t);
-    /** Map a 1-bit column real fast */
-    static void map1BitColumn(int16_t, int16_t, int16_t, const uint8_t*, uint16_t);
-    /** Draw a row real fast */
-    static void drawRow(int16_t, int16_t, int16_t);
-    /** Legacy drawColumn name, for compatibility - macros are not OK because of scope problems */
-    static void drawFastVLine(int16_t, int16_t, int16_t);
-    /** Legacy drawRow name, for compatibility - macros are not OK because of scope problems */
-    static void drawFastHLine(int16_t, int16_t, int16_t);
-    /** Draw rectangle (edges only) */
-    static void drawRectangle(int16_t,int16_t,int16_t,int16_t);
-    /** Fill rectangle */
-    static void fillRectangle(int16_t,int16_t,int16_t,int16_t);
-    /** GB compatibility fillRect */
-    static void fillRect(int16_t x, int16_t y, int16_t w, int16_t h);
-    /** GB compatibility drawRect */
-    static void drawRect(int16_t x, int16_t y, int16_t w, int16_t h);
-
-    // Functions lifted from Adafruit GFX library (see PokittoDisplay.h for license //
-    /** Draw circle */
-    static void drawCircle(int16_t x0, int16_t y0, int16_t r);
-    /** Draw circle helper */
-	static void drawCircleHelper(int16_t x0, int16_t y0, int16_t r, uint16_t cornername);
-	/** Fill circle */
-	static void fillCircle(int16_t x0, int16_t y0, int16_t r);
-	/** Fill circle helper*/
-	static void fillCircleHelper(int16_t x0, int16_t y0, int16_t r, uint16_t cornername, int16_t delta);
-	/** draw triangle */
-	static void drawTriangle(int16_t x0, int16_t y0, int16_t x1, int16_t y1, int16_t x2, int16_t y2);
-	/** Fill triangle*/
-	static void fillTriangle(int16_t x0, int16_t y0, int16_t x1, int16_t y1, int16_t x2, int16_t y2);
-	/** Draw rounded rectangle */
-	static void drawRoundRect(int16_t x0, int16_t y0, int16_t w, int16_t h, int16_t radius);
-	/** Fill rounded rectangle */
-	static void fillRoundRect(int16_t x0, int16_t y0, int16_t w, int16_t h, int16_t radius);
-
-    // BITMAPS !
-    /** Draw monochromatic bitmap. Used in font rendering */
-    static void drawMonoBitmap(int16_t x, int16_t y, const uint8_t* bitmap, uint8_t index);
-    /** Draw bitmap data*/
-    static void drawBitmapData(int16_t x, int16_t y, int16_t w, int16_t h, const uint8_t* bitmap);
-    /** Draw bitmap */
-    static void drawBitmap(int16_t x, int16_t y, const uint8_t* bitmap);
-    /** Draw RLE bitmap */
-    static void drawRleBitmap(int16_t x, int16_t y, const uint8_t* bitmap);
-    /** Draw animated bitmap frame */
-    static void drawBitmap(int16_t x, int16_t y, const uint8_t* bitmap, uint8_t frame);
-    /** Draw bitmap flipped on x-axis*/
-    static void drawBitmapXFlipped(int16_t x, int16_t y, const uint8_t* bitmap);
-    /** Draw bitmap with options */
-    static void drawBitmap(int16_t x, int16_t y, const uint8_t *bitmap, uint8_t rotation, uint8_t flip);
-    /** Get pointer to the screen buffer - GB compatibility */
-    static uint8_t* getBuffer();
-    /** Get pixel in a monochromatic bitmap - GB compatibility */
-    static uint8_t getBitmapPixel(const uint8_t*, uint16_t, uint16_t);
-    /** Optimized functions for drawing bit columns - used in raytracing */
-    static void draw4BitColumn(int16_t x, int16_t y, uint8_t h, uint8_t* bitmap);
-
-    // SPRITES
-    /* Setup or disable the sprite */
-    static void setSpriteBitmap(uint8_t index, const uint8_t* bitmap, const uint16_t* palette4x16bit, int16_t x, int16_t y, bool doResetDirtyRect=true );
-    /* Setup or disable the sprite */
-    static void setSprite(uint8_t index, const uint8_t* data, const uint16_t* palette4x16bit, int16_t x, int16_t y, uint8_t w, uint8_t h, bool doResetDirtyRect=true );
-    /* Set the sprite position */
-    static void setSpritePos(uint8_t index, int16_t x, int16_t y);
-
-    // PRINTING
-    /** direct character to screen (no buffering) */
-    static int directChar(int16_t, int16_t, uint16_t);
-    /** character to screenbuffer */
-    static int bufferChar(int16_t, int16_t, uint16_t);
-    /** set the active font */
-    static void setFont(const unsigned char * f);
-    /** font dimensions */
-    static uint8_t fontWidth, fontHeight;
-    /** text wrapping */
-    static bool textWrap;
-    /** GB compatibility drawChar */
-    static void drawChar(int8_t x, int8_t y, unsigned char c, uint8_t size);
-
-    static void enableDirectPrinting(uint8_t m);
-    static bool isDirectPrintingEnabled();
-    static int print_char(uint8_t x, uint8_t y, unsigned char c);
-    static void set_cursor(uint8_t, uint8_t);
-    static void write(uint8_t);
-    static void write(const char *str);
-    static void write(const uint8_t *buffer, uint8_t size);
-    static void print(const char[]);
-    static void print(char, int base = 0);
-    static void print(unsigned char, int base = 0);
-    static void print(int, int base = 10);
-    static void print(unsigned int, int base = 10);
-    static void print(long, int base = 10);
-    static void print(unsigned long, int base = 10);
-    static void print(double, int base = 2);
-    static void print(uint8_t, uint8_t, const char[]);
-    static void print(uint8_t, uint8_t, char, int = 0);
-    static void print(uint8_t, uint8_t, unsigned char, int = 0);
-    static void print(uint8_t, uint8_t, int, int = 10);
-    static void print(uint8_t, uint8_t, unsigned int, int = 10);
-    static void print(uint8_t, uint8_t, long, int = 10);
-    static void print(uint8_t, uint8_t, unsigned long, int = 10);
-    static void print(uint8_t, uint8_t, double, int = 2);
-    static void println(uint8_t, uint8_t, const char[]);
-    static void println(uint8_t, uint8_t, char, int = 0);
-    static void println(uint8_t, uint8_t, unsigned char, int = 0);
-    static void println(uint8_t, uint8_t, int, int = 10);
-    static void println(uint8_t, uint8_t, unsigned int, int = 10);
-    static void println(uint8_t, uint8_t, long, int = 10);
-    static void println(uint8_t, uint8_t, unsigned long, int = 10);
-    static void println(uint8_t, uint8_t, double, int = 2);
-    static void println(uint8_t, uint8_t);
-    static void println(const char[]);
-    static void println(char, int = 0);
-    static void println(unsigned char, int = 0);
-    static void println(int, int = 10);
-    static void println(unsigned int, int = 10);
-    static void println(long, int = 10 );
-    static void println(unsigned long, int = 10);
-    static void println(double, int = 2);
-    static void println(void);
-
-    static int16_t cursorX,cursorY;
-    static uint8_t fontSize;
-    static int8_t adjustCharStep, adjustLineStep;
-	static bool fixedWidthFont;
-
-    static void inc_txtline();
-    static void printNumber(unsigned long, uint8_t);
-    static void printFloat(double, uint8_t);
-
-    /** Tiled mode functions **/
-
-    static void loadTileset(const uint8_t*);
-
-    static void setTileBufferTo(uint8_t*);
-    static void clearTileBuffer();
-    static void shiftTileBuffer(int8_t,int8_t);
-
-    static void setTile(uint16_t,uint8_t);
-    static uint8_t getTile(uint16_t);
-    static uint8_t getTile(uint8_t,uint8_t);
-
-
-
-private:
-    static uint8_t m_mode;
-    static uint16_t m_w,m_h; // store these for faster access when switching printing modes
-    /** Pointer to screen buffer */
-    static uint8_t* m_scrbuf;
-    /** Pointer to tileset */
-    static uint8_t* m_tileset;
-    /** Pointer to tilebuffer */
-    static uint8_t* m_tilebuf;
-    /** Pointer to tilecolorbuffer */
-    static uint8_t* m_tilecolorbuf;
-    /** Sprites */
-    static SpriteInfo m_sprites[SPRITE_COUNT];  // Does not own sprite bitmaps
-};
-
-}
-
-#endif // POKITTODISPLAY_H
-
-
-
-
-
--- a/POKITTO_CORE/PokittoFakeavr.h	Wed Jun 27 13:14:54 2018 +0000
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,106 +0,0 @@
-/**************************************************************************/
-/*!
-    @file     PokittoFakeavr.h
-    @author   Jonne Valola
-
-    @section LICENSE
-
-    Software License Agreement (BSD License)
-
-    Copyright (c) 2016, Jonne Valola
-    All rights reserved.
-
-    Redistribution and use in source and binary forms, with or without
-    modification, are permitted provided that the following conditions are met:
-    1. Redistributions of source code must retain the above copyright
-    notice, this list of conditions and the following disclaimer.
-    2. Redistributions in binary form must reproduce the above copyright
-    notice, this list of conditions and the following disclaimer in the
-    documentation and/or other materials provided with the distribution.
-    3. Neither the name of the copyright holders nor the
-    names of its contributors may be used to endorse or promote products
-    derived from this software without specific prior written permission.
-
-    THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS ''AS IS'' AND ANY
-    EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
-    WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
-    DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER BE LIABLE FOR ANY
-    DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-    (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-    LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-    ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-    (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
-    SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-*/
-/**************************************************************************/
-
-#ifndef _POKITTO_FAKEAVR_H_
-#define _POKITTO_FAKEAVR_H_
-
-#include "PokittoItoa.h"
-#include "binary.h"
-#include <stdint.h>
-#include <stdlib.h>
-
-#ifdef POK_SIM
-#include <stdbool.h>
-#else
-#include <stdbool.h>
-#endif // POK_SIM
-
-#define _BV(bit) (1 << (bit)) //jonne
-
-/** data types */
-#ifndef _RPCNDR_H
-typedef bool boolean;
-#endif
-typedef uint8_t byte;
-
-/** PROGMEM */
-#define PROGMEM
-//#define F
-
-/** AVR program memory string functions **/
-#define sprintf_P sprintf
-#define strstr_P strstr
-#define strcpy_P strcpy
-
-#define utoa pokItoa
-#define ultoa pokItoa
-
-/** PROGMEM hacks **/
-#define PROGMEM
-    #define pgm_read_byte(addr) (*(const unsigned char *)(addr))
-    #ifndef WIN32
-    #define pgm_read_word(addr) (*(addr))
-    #else
-    #define pgm_read_word(addr) (*(const unsigned int *)(addr))
-    #endif // WIN32
-
-/** min max & others **/
-
-
-#ifndef DISABLEAVRMIN
-#define max(a,b) ((a)>(b)?(a):(b))
-#define min(a,b) ((a)<(b)?(a):(b))
-#endif // DISABLEAVRMIN
-#define __avrmax(a,b) ((a)>(b)?(a):(b))
-#define __avrmin(a,b) ((a)<(b)?(a):(b))
-#define constrain(amt,low,high) ((amt)<(low)?(low):((amt)>(high)?(high):(amt)))
-#define min2(a,b) (((a)<(b))?(a):(b))
-
-
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-void cli();
-void sei();
-
-#ifdef __cplusplus
-}
-#endif
-#endif
-
-
--- a/POKITTO_CORE/PokittoFonts.h	Wed Jun 27 13:14:54 2018 +0000
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,69 +0,0 @@
-/**************************************************************************/
-/*!
-    @file     PokittoFonts.h
-    @author   Jonne Valola
-
-    @section LICENSE
-
-    Software License Agreement (BSD License)
-
-    Copyright (c) 2016, Jonne Valola
-    All rights reserved.
-
-    Redistribution and use in source and binary forms, with or without
-    modification, are permitted provided that the following conditions are met:
-    1. Redistributions of source code must retain the above copyright
-    notice, this list of conditions and the following disclaimer.
-    2. Redistributions in binary form must reproduce the above copyright
-    notice, this list of conditions and the following disclaimer in the
-    documentation and/or other materials provided with the distribution.
-    3. Neither the name of the copyright holders nor the
-    names of its contributors may be used to endorse or promote products
-    derived from this software without specific prior written permission.
-
-    THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS ''AS IS'' AND ANY
-    EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
-    WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
-    DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER BE LIABLE FOR ANY
-    DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-    (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-    LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-    ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-    (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
-    SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-*/
-/**************************************************************************/
-
-#ifndef POK_FONTS_H
-#define POK_FONTS_H
-
-#include "Pokitto_settings.h"
-
-extern const unsigned char fontMini[];
-extern const unsigned char fontDonut[];
-extern const unsigned char fontDragon[];
-extern const unsigned char fontKarateka[];
-extern const unsigned char fontKoubit[];
-extern const unsigned char fontRunes[];
-extern const unsigned char fontTight[];
-extern const unsigned char fontTiny[];
-extern const unsigned char fontAdventurer[];
-extern const unsigned char font5x7[];
-extern const unsigned char font3x5[];
-extern const unsigned char font3x3[];
-extern const unsigned char fontC64[];
-extern const unsigned char fntC64UIGfx[];
-extern const unsigned char fontZXSpec[];
-extern const unsigned char fontTIC806x6[];
-extern const unsigned char fontMonkey[];
-
-#if POK_GAMEBUINO_SUPPORT > 0
-#define DEFAULT_FONT font3x5
-#else
-#define DEFAULT_FONT font5x7
-#endif // POK_GAMEBUINO_SUPPORT
-
-
-#endif
-
-
--- a/POKITTO_CORE/PokittoGlobs.h	Wed Jun 27 13:14:54 2018 +0000
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,91 +0,0 @@
-/**************************************************************************/
-/*!
-    @file     PokittoGlobs.h
-    @author   Jonne Valola
-
-    @section LICENSE
-
-    Software License Agreement (BSD License)
-
-    Copyright (c) 2016, Jonne Valola
-    All rights reserved.
-
-    Redistribution and use in source and binary forms, with or without
-    modification, are permitted provided that the following conditions are met:
-    1. Redistributions of source code must retain the above copyright
-    notice, this list of conditions and the following disclaimer.
-    2. Redistributions in binary form must reproduce the above copyright
-    notice, this list of conditions and the following disclaimer in the
-    documentation and/or other materials provided with the distribution.
-    3. Neither the name of the copyright holders nor the
-    names of its contributors may be used to endorse or promote products
-    derived from this software without specific prior written permission.
-
-    THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS ''AS IS'' AND ANY
-    EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
-    WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
-    DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER BE LIABLE FOR ANY
-    DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-    (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-    LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-    ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-    (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
-    SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-*/
-/**************************************************************************/
-
-#ifndef POKITTO_GLOBS_H
-#define POKITTO_GLOBS_H
-
-#include <stdint.h>
-
-#ifdef POK_SIM
-    #include "SimLCD.h"
-    #include "SimSound.h"
-    #include "PokittoSimulator.h"
-#else
-    #include "mbed.h"
-    #include "HWLCD.h"
-    #include "HWSound.h"
-#endif // POK_SIM
-
-extern int random(int);
-extern int random(int,int);
-
-#define HIGH    1
-#define LOW     0
-
-#define swapWT(type, a, b)    \
-{               \
-    type _t_;   \
-    _t_ = a;    \
-    a = b;      \
-    b = _t_;    \
-}
-
-#define SAMPLE_RATE POK_AUD_FREQ //was 16000, was 57000
-#define NUMFRAMES 570 //1 ms before refresh was 357
-
-
-// TODO: move these into some suitable place
-extern void fakeISR();
-extern void audio_IRQ();
-extern void update_SDAudioStream();
-extern uint16_t soundbyte;
-
-#if POK_STREAMING_MUSIC
-    #define SPEAKER 3
-   // #define BUFFER_SIZE 512 //5120 // was 256
-    extern unsigned char buffers[][BUFFER_SIZE];
-    extern volatile int currentBuffer, oldBuffer;
-    extern volatile int bufindex, vol;
-    extern volatile unsigned char * currentPtr;
-    extern volatile unsigned char * endPtr;
-    extern int8_t streamvol;
-    extern uint32_t streamcounter;
-    extern uint8_t streamstep;
-#endif
-
-#endif // POKITTO_GLOBS_H
-
-
--- a/POKITTO_CORE/PokittoItoa.cpp	Wed Jun 27 13:14:54 2018 +0000
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,141 +0,0 @@
-/**************************************************************************/
-/*!
-    @file     PokittoItoa.cpp
-    @author   Jonne Valola
-
-    @section LICENSE
-
-    Software License Agreement (BSD License)
-
-    Copyright (c) 2016, Jonne Valola
-    All rights reserved.
-
-    Redistribution and use in source and binary forms, with or without
-    modification, are permitted provided that the following conditions are met:
-    1. Redistributions of source code must retain the above copyright
-    notice, this list of conditions and the following disclaimer.
-    2. Redistributions in binary form must reproduce the above copyright
-    notice, this list of conditions and the following disclaimer in the
-    documentation and/or other materials provided with the distribution.
-    3. Neither the name of the copyright holders nor the
-    names of its contributors may be used to endorse or promote products
-    derived from this software without specific prior written permission.
-
-    THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS ''AS IS'' AND ANY
-    EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
-    WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
-    DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER BE LIABLE FOR ANY
-    DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-    (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-    LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-    ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-    (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
-    SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-*/
-/**************************************************************************/
-
-#include "PokittoItoa.h"
-#include <string.h>
-#include <stdint.h>
-
-
-void pokItoa(uint16_t value, char *str, int base)
-{
-    /** pokItoa:  convert value n to characters
-     * Needed to emulate AVR LibC non-standard functions, this is a very fast version of itoa
-     *
-     * @param value unsigned integer to be converted
-     * @param *str pointer to string where function stores the result as characters
-     * @param base (not implemented in this function, base is always 10)
-     */
-
-    char *p = str;
-    uint8_t v;
-    if (value > 499)
-    {
-        if (value > 799)
-        {
-            if (value > 999)
-            {
-                // Treated as a special case as there
-                // are only 24 values above 999
-                *p++ = '1';
-                *p++ = '0';
-                uint8_t v = value - 1000;
-
-                if      (v > 19) { *p++ = '2'; v -= 20; }
-                else if (v >  9) { *p++ = '1'; v -= 10; }
-                else             { *p++ = '0'; }
-
-                *p++ = v + '0';
-                *p = 0;
-                return;
-            }
-
-            if (value > 899) { *p++ = '9'; v = value - 900; }
-            else             { *p++ = '8'; v = value - 800; }
-        }
-        else
-        {
-            if      (value > 699) { *p++ = '7'; v = value - 700; }
-            else if (value > 599) { *p++ = '6'; v = value - 600; }
-            else                  { *p++ = '5'; v = value - 500; }
-        }
-    }
-    else
-    {
-        if (value > 299)
-        {
-            if (value > 399) { *p++ = '4'; v = value - 400; }
-            else             { *p++ = '3'; v = value - 300; }
-        }
-        else
-        {
-            if      (value > 199) { *p++ = '2'; v = value - 200; }
-            else if (value >  99) { *p++ = '1'; v = value - 100; }
-            else                  {             v = value; }
-        }
-    }
-
-    if (v > 49)
-    {
-        if (v > 69)
-        {
-            if      (v > 89) { *p++ = '9'; v -= 90; }
-            else if (v > 79) { *p++ = '8'; v -= 80; }
-            else             { *p++ = '7'; v -= 70; }
-        }
-        else
-        {
-            if (v > 59) { *p++ = '6'; v -= 60; }
-            else        { *p++ = '5'; v -= 50; }
-        }
-    }
-    else
-    {
-        if (v > 19)
-        {
-            if      (v > 39) { *p++ = '4'; v -= 40; }
-            else if (v > 29) { *p++ = '3'; v -= 30; }
-            else             { *p++ = '2'; v -= 20; }
-        }
-        else
-        {
-            if      (v >  9)   { *p++ = '1'; v -= 10; }
-            else if (p != str) { *p++ = '0'; }
-        }
-    }
-
-    *p++ = v + '0';
-    *p = 0;
-}
-
-void pokUtoa(uint16_t value, char *str, int base) {
-    pokItoa(value,str,base);
-}
-
-void pokLtoa(long value, char *str, int base) {
-    pokItoa(value,str,base);
-}
-
-
--- a/POKITTO_CORE/PokittoItoa.h	Wed Jun 27 13:14:54 2018 +0000
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,51 +0,0 @@
-/**************************************************************************/
-/*!
-    @file     PokittoItoa.h
-    @author   Jonne Valola
-
-    @section LICENSE
-
-    Software License Agreement (BSD License)
-
-    Copyright (c) 2016, Jonne Valola
-    All rights reserved.
-
-    Redistribution and use in source and binary forms, with or without
-    modification, are permitted provided that the following conditions are met:
-    1. Redistributions of source code must retain the above copyright
-    notice, this list of conditions and the following disclaimer.
-    2. Redistributions in binary form must reproduce the above copyright
-    notice, this list of conditions and the following disclaimer in the
-    documentation and/or other materials provided with the distribution.
-    3. Neither the name of the copyright holders nor the
-    names of its contributors may be used to endorse or promote products
-    derived from this software without specific prior written permission.
-
-    THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS ''AS IS'' AND ANY
-    EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
-    WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
-    DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER BE LIABLE FOR ANY
-    DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-    (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-    LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-    ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-    (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
-    SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-*/
-/**************************************************************************/
-
-
-#ifndef POKITTO_ITOA_H
-#define POKITTO_ITOA_H
-
-#include <stdint.h>
-
-/** MBED online compiler has no itoa or strrev **/
-
-extern void pokItoa(uint16_t, char*,int);
-extern void pokUtoa(int16_t, char*,int);
-extern void pokLtoa(long, char*,int);
-
-#endif // POKITTO_ITOA_H
-
-
--- a/POKITTO_CORE/PokittoLogos.cpp	Wed Jun 27 13:14:54 2018 +0000
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,115 +0,0 @@
-/**************************************************************************/
-/*!
-    @file     PokittoLogos.cpp
-    @author   Jonne Valola
-
-    @section LICENSE
-
-    Software License Agreement (BSD License)
-
-    Copyright (c) 2015, Jonne Valola
-    All rights reserved.
-
-    Redistribution and use in source and binary forms, with or without
-    modification, are permitted provided that the following conditions are met:
-    1. Redistributions of source code must retain the above copyright
-    notice, this list of conditions and the following disclaimer.
-    2. Redistributions in binary form must reproduce the above copyright
-    notice, this list of conditions and the following disclaimer in the
-    documentation and/or other materials provided with the distribution.
-    3. Neither the name of the copyright holders nor the
-    names of its contributors may be used to endorse or promote products
-    derived from this software without specific prior written permission.
-
-    THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS ''AS IS'' AND ANY
-    EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
-    WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
-    DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER BE LIABLE FOR ANY
-    DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-    (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-    LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-    ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-    (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
-    SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-*/
-/**************************************************************************/
-
-
-#include "PokittoLogos.h"
-
-const uint8_t Pokitto_speaker[] = {
-16,16,
-0x00,0x00,0x01,0x00,0x03,0x00,0x05,0x04,0x09,0x12,0x71,0x4A,0x71,0x2A,0x71,0x2A,0x71,0x2A,0x71,0x2A,0x71,0x4A,0x09,0x12,0x05,0x04,0x03,0x00,0x01,0x00,0x00,0x00
-};
-
-const uint8_t Pokitto_headphones[] = {
-16,16,
-0x00,0x00,0x0F,0xF0,0x18,0x18,0x10,0x08,0x20,0x04,0x20,0x04,0x70,0x0E,0x70,0x0E,0x70,0x0E,0x70,0x0E,0x70,0x0E,0x20,0x04,0x00,0x04,0x00,0x08,0x00,0x04,0x00,0x08
-};
-
-const uint8_t Pokitto_volumebar[] = {
-4,4,
-0xE0,0xE0,0xE0,0xE0
-};
-
-const uint8_t Pokitto_logo[] = {
-184,56,
-0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
-0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
-0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
-0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x07,0xFC,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
-0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x07,0xFC,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x78,
-0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x0F,0xF8,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x84,
-0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x0F,0xF8,0x00,0x00,0x00,0x00,0x7F,0xC0,0x0F,0xF8,0x00,0x00,0x01,0x72,
-0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x1F,0xF0,0x00,0x03,0xFC,0x00,0x7F,0xC0,0x1F,0xF0,0x00,0x00,0x01,0x4A,
-0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x1F,0xF0,0x00,0x07,0xFC,0x00,0x7F,0xC0,0x1F,0xF0,0x00,0x00,0x01,0x72,
-0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x3F,0xE0,0x00,0x07,0xFC,0x00,0xFF,0x80,0x3F,0xE0,0x00,0x00,0x01,0x4A,
-0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x3F,0xE0,0x00,0x0F,0xF8,0x00,0xFF,0x80,0x3F,0xE0,0x00,0x00,0x01,0x02,
-0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x7F,0xC0,0x00,0x0F,0xF8,0x01,0xFF,0x00,0x7F,0xC0,0x00,0x00,0x00,0x84,
-0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x7F,0xC0,0x00,0x1F,0xF0,0x01,0xFF,0x00,0x7F,0xC0,0x00,0x00,0x00,0x78,
-0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xFF,0xC0,0x00,0x1F,0xF0,0x03,0xFE,0x00,0xFF,0xC0,0x00,0x00,0x00,0x00,
-0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xFF,0x80,0x00,0x3F,0xE0,0x03,0xFE,0x00,0xFF,0x80,0x00,0x00,0x00,0x00,
-0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x01,0xFF,0x80,0x00,0x00,0x00,0x07,0xFC,0x01,0xFF,0x80,0x00,0x00,0x00,0x00,
-0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x01,0xFF,0x00,0x00,0x00,0x00,0x07,0xFC,0x01,0xFF,0x00,0x00,0x00,0x00,0x00,
-0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x03,0xFF,0x00,0x00,0x00,0x00,0x0F,0xFC,0x03,0xFF,0x00,0x00,0x00,0x00,0x00,
-0x00,0x00,0x0F,0xFF,0xE0,0x01,0xFF,0xFC,0x03,0xFF,0xFF,0xFC,0xFF,0x9F,0xEF,0xFF,0xFB,0xFF,0xFF,0x0F,0xFF,0xE0,0x00,
-0x00,0x00,0xCF,0xFF,0xF0,0x09,0xFF,0xFE,0x03,0xFF,0xFF,0xFC,0xFF,0x9F,0xEF,0xFF,0xFB,0xFF,0xFE,0x27,0xFF,0xF0,0x00,
-0x00,0x01,0xCF,0xFF,0xF8,0x1D,0xFF,0xFF,0x03,0xFF,0xFF,0xF9,0xFF,0x3F,0xF7,0xFF,0xFD,0xFF,0xFE,0x67,0xFF,0xF8,0x00,
-0x00,0x01,0xEF,0xFF,0xFC,0x1D,0xFF,0xFF,0x03,0xFF,0xFF,0xF9,0xFF,0x3F,0xF7,0xFF,0xFD,0xFF,0xFC,0xF7,0xFF,0xFC,0x00,
-0x00,0x03,0xE7,0xFF,0xFC,0x3C,0xFF,0xFF,0x8B,0xFF,0xFF,0xF3,0xFE,0x3F,0xF3,0xFF,0xFC,0xFF,0xFC,0xF3,0xFF,0xFC,0x00,
-0x00,0x03,0xE7,0xFF,0xFC,0x3E,0xFF,0xFF,0x89,0xFF,0xFF,0xF3,0xFE,0x7F,0xFB,0xFF,0xFE,0xFF,0xF9,0xF3,0xFF,0xFC,0x00,
-0x00,0x07,0xF7,0xFF,0xFC,0x7E,0xFF,0xFF,0x99,0xFF,0xFF,0xF3,0xFE,0x7F,0xF9,0xFF,0xFE,0x7F,0xF9,0xFB,0xFF,0xFC,0x00,
-0x00,0x07,0xF3,0xFF,0xFC,0x7E,0x7F,0xFF,0x9D,0xFF,0xFF,0xE7,0xFC,0x7F,0xFC,0x7F,0xFF,0x1F,0xF3,0xF9,0xFF,0xFC,0x00,
-0x00,0x0F,0xF0,0x07,0xFC,0xFE,0x00,0xFF,0x3D,0xFE,0x00,0x07,0xFC,0x00,0xFF,0x00,0x3F,0xC0,0x03,0xF8,0x03,0xF8,0x00,
-0x00,0x0F,0xF0,0x07,0xF8,0xFE,0x00,0xFF,0x3C,0xFE,0x00,0x0F,0xF8,0x00,0xFF,0x80,0x3F,0xE0,0x07,0xF8,0x07,0xF8,0x00,
-0x00,0x0F,0xF0,0x0F,0xF9,0xFE,0x01,0xFE,0x7C,0xFE,0x00,0x0F,0xF8,0x01,0xFF,0x00,0x7F,0xE0,0x07,0xF8,0x07,0xF8,0x00,
-0x00,0x1F,0xE0,0x0F,0xF1,0xFC,0x01,0xFE,0x7E,0xFF,0x00,0x1F,0xF0,0x01,0xFF,0x00,0x7F,0xC0,0x0F,0xF0,0x0F,0xF0,0x00,
-0x00,0x1F,0xE0,0x1F,0xF3,0xFC,0x03,0xFC,0xFE,0x7F,0x00,0x1F,0xF0,0x03,0xFE,0x00,0xFF,0xC0,0x0F,0xF0,0x0F,0xF0,0x00,
-0x00,0x3F,0xC0,0x1F,0xE3,0xF8,0x03,0xFC,0xFE,0x7F,0x80,0x3F,0xE0,0x03,0xFE,0x00,0xFF,0x80,0x1F,0xE0,0x0F,0xE0,0x00,
-0x00,0x3F,0xC0,0x3F,0xE7,0xF8,0x07,0xF8,0xFF,0x3F,0x80,0x3F,0xE0,0x07,0xFE,0x00,0xFF,0x80,0x1F,0xE0,0x1F,0xE0,0x00,
-0x00,0x7F,0x80,0x3F,0xC7,0xF0,0x07,0xF9,0xFF,0x3F,0xC0,0x7F,0xC0,0x07,0xFC,0x01,0xFF,0x00,0x1F,0xC0,0x1F,0xC0,0x00,
-0x00,0x7F,0x80,0x7F,0xC7,0xF0,0x0F,0xF1,0xFF,0x1F,0xE0,0x7F,0xC0,0x0F,0xFC,0x01,0xFF,0x00,0x3F,0xC0,0x3F,0xC0,0x00,
-0x00,0x7F,0x80,0x7F,0x8F,0xF0,0x0F,0xF3,0xFE,0x1F,0xF0,0xFF,0x80,0x0F,0xF8,0x03,0xFE,0x00,0x3F,0x80,0x3F,0x80,0x00,
-0x00,0xFF,0x80,0x7F,0x8F,0xF0,0x0F,0xE3,0xFE,0x0F,0xF8,0xFF,0x80,0x0F,0xF8,0x03,0xFE,0x00,0x3F,0xC0,0x3F,0x80,0x00,
-0x00,0xFF,0xFE,0x7F,0x1F,0xFF,0xEF,0xE7,0xFC,0x0F,0xF9,0xFF,0x00,0x1F,0xF0,0x07,0xFC,0x00,0x7F,0xFF,0x3F,0x80,0x00,
-0x01,0xFF,0xFF,0x7E,0x1F,0xFF,0xE7,0xC7,0xFC,0x07,0xF9,0xFF,0x00,0x1F,0xF0,0x07,0xFC,0x00,0x7F,0xFF,0xBF,0x00,0x00,
-0x01,0xFF,0xFF,0x3E,0x1F,0xFF,0xE7,0xCF,0xF8,0x07,0xF9,0xFF,0x00,0x3F,0xE0,0x0F,0xF8,0x00,0x7F,0xFF,0x9E,0x00,0x00,
-0x01,0xFF,0xFF,0x3C,0x1F,0xFF,0xF7,0x87,0xF8,0x03,0xF3,0xFE,0x00,0x3F,0xE0,0x0F,0xF8,0x00,0x7F,0xFF,0x9E,0x00,0x00,
-0x03,0xFF,0xFF,0xB8,0x0F,0xFF,0xF3,0x07,0xF0,0x01,0xF3,0xFE,0x00,0x7F,0xC0,0x1F,0xF0,0x00,0x3F,0xFF,0xDC,0x00,0x00,
-0x03,0xFF,0xFF,0x98,0x0F,0xFF,0xF3,0x03,0xF0,0x00,0xE7,0xFC,0x00,0x7F,0xC0,0x1F,0xF0,0x00,0x3F,0xFF,0xCC,0x00,0x00,
-0x07,0xFF,0xFF,0x90,0x07,0xFF,0xFA,0x03,0xF0,0x00,0xE7,0xFC,0x00,0xFF,0x80,0x3F,0xF0,0x00,0x1F,0xFF,0xC8,0x00,0x00,
-0x07,0xFF,0xFF,0x80,0x03,0xFF,0xF8,0x00,0xE0,0x00,0x47,0xF8,0x00,0xFF,0x80,0x3F,0xE0,0x00,0x03,0xFF,0xC0,0x00,0x00,
-0x07,0xF8,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
-0x0F,0xF8,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
-0x0F,0xF0,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
-0x0F,0xF0,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
-0x1F,0xE0,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
-0x1F,0xC0,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
-0x1F,0xC0,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
-0x3F,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
-0x3C,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
-0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
-0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
-};
-
-
--- a/POKITTO_CORE/PokittoLogos.h	Wed Jun 27 13:14:54 2018 +0000
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,49 +0,0 @@
-/**************************************************************************/
-/*!
-    @file     PokittoLogos.h
-    @author   Jonne Valola
-
-    @section LICENSE
-
-    Software License Agreement (BSD License)
-
-    Copyright (c) 2015, Jonne Valola
-    All rights reserved.
-
-    Redistribution and use in source and binary forms, with or without
-    modification, are permitted provided that the following conditions are met:
-    1. Redistributions of source code must retain the above copyright
-    notice, this list of conditions and the following disclaimer.
-    2. Redistributions in binary form must reproduce the above copyright
-    notice, this list of conditions and the following disclaimer in the
-    documentation and/or other materials provided with the distribution.
-    3. Neither the name of the copyright holders nor the
-    names of its contributors may be used to endorse or promote products
-    derived from this software without specific prior written permission.
-
-    THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS ''AS IS'' AND ANY
-    EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
-    WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
-    DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER BE LIABLE FOR ANY
-    DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-    (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-    LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-    ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-    (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
-    SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-*/
-/**************************************************************************/
-
-#ifndef POKITTO_LOGOS_H
-#define POKITTO_LOGOS_H
-
-#include <stdint.h>
-
-extern const uint8_t Pokitto_logo[];
-extern const uint8_t Pokitto_headphones[];
-extern const uint8_t Pokitto_speaker[];
-extern const uint8_t Pokitto_volumebar[];
-
-#endif
-
-
--- a/POKITTO_CORE/PokittoPalette.cpp	Wed Jun 27 13:14:54 2018 +0000
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,132 +0,0 @@
-/**************************************************************************/
-/*!
-    @file     PokittoPalette.cpp
-    @author   Jonne Valola
-
-    @section LICENSE
-
-Software License Agreement (BSD License)
-
-    Copyright (c) 2016, Jonne Valola
-    All rights reserved.
-
-    Redistribution and use in source and binary forms, with or without
-    modification, are permitted provided that the following conditions are met:
-    1. Redistributions of source code must retain the above copyright
-    notice, this list of conditions and the following disclaimer.
-    2. Redistributions in binary form must reproduce the above copyright
-    notice, this list of conditions and the following disclaimer in the
-    documentation and/or other materials provided with the distribution.
-    3. Neither the name of the copyright holders nor the
-    names of its contributors may be used to endorse or promote products
-    derived from this software without specific prior written permission.
-
-    THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS ''AS IS'' AND ANY
-    EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
-    WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
-    DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER BE LIABLE FOR ANY
-    DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-    (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-    LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-    ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-    (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
-    SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-*/
-/**************************************************************************/
-
-#include "PokittoDisplay.h"
-#include "Pokitto_settings.h"
-#include "GBcompatibility.h"
-#include <stdio.h>
-#include <string.h>
-
-#ifndef POK_SIM
-#include "HWLCD.h"
-#else
-#include "SimLCD.h"
-#endif
-
-using namespace Pokitto;
-
-
-void Display::loadRGBPalette(const unsigned char* p) {
-    for (int i=0;i<PALETTE_SIZE;i++) palette[i] = RGBto565(p[i*3], p[i*3+1],p[i*3+2]);
-    paletteptr = palette;
-}
-
-void Display::load565Palette(const uint16_t* p) {
-    for (int i=0;i<PALETTE_SIZE;i++) palette[i] = p[i];
-    paletteptr = palette;
-}
-
-void Display::rotatePalette(int8_t step) {
-    #ifndef PROJ_MODE13
-    #define PALSIZE 16
-    #else
-    #define PALSIZE 256
-    #endif
-    uint16_t tpal[PALSIZE];
-    if (step == 0) return;
-    step = 0-step;
-    if (step>0) {
-        for (int i=step;i<PALSIZE;i++) tpal[i]=palette[i-step]; // palette revolves up, new color 1 becomes old color 0
-        for (int i=0; i < step; i++) tpal[i]=palette[PALSIZE-step+i]; // overflow topmost values to bottom of new palette
-    } else {
-        for (int i=0;i<PALSIZE+step;i++)
-        {
-            tpal[i]=palette[i-step];
-            }// palette revolves down, new color 0 becomes old color 1
-        for (int i=0;i<-step; i++) {
-                tpal[PALSIZE+step+i]=palette[i];
-        }
-        // overflow bottom values to top of new palette
-    }
-    for (int i=0; i<PALSIZE;i++) palette[i] = tpal[i];
-}
-
-uint16_t Display::RGBto565(uint8_t R,uint8_t G,uint8_t B) {
-    uint16_t color;
-    color = B>>3;
-    color |= ((G >> 2) << 5);
-    color |= ((R >> 3) << 11);
-    return color;
-}
-
-uint16_t Display::interpolateColor(uint16_t c1, uint16_t c2, uint8_t factor) {
-    int16_t R,G,B;
-    int16_t dR,dG,dB;
-    uint16_t color;
-
-    B = (c1 & 0x1F);
-    dB = (c2 & 0x1F)-B;
-    dB = (dB*factor)>>8;
-    B += dB;
-    if (B<0) B = 0;
-
-    G = ((c1>>5) & 0x3F);
-    dG = ((c2>>5) & 0x3F)-G;
-    dG = (dG*factor)>>8;
-    G += dG;
-    if (G<0) G=0;
-
-    R = (c1>>11);
-    dR = (c2>>11)-R;
-    dR = (dR*factor)>>8;
-    R += dR;
-    if (R<0) R=0;
-
-    color = B;
-    color |= (G << 5);
-    color |= (R << 11);
-    return color;
-}
-
-void Display::tweenPalette(uint16_t* ram_pal, const uint16_t* pal_1, const uint16_t* pal_2, uint8_t factor) {
-    for (uint8_t i = 0; i<16 ; i++) {
-        ram_pal[i] = interpolateColor(pal_1[i],pal_2[i],factor);
-    }
-}
-
-
-
-
--- a/POKITTO_CORE/PokittoPalettes.h	Wed Jun 27 13:14:54 2018 +0000
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,25 +0,0 @@
-#ifndef POK_PALETTES_H
-#define POK_PALETTES_H
-
-#include "Pokitto_settings.h"
-
-extern const unsigned char paletteDefault[];
-extern const unsigned char paletteCGA[];
-extern const unsigned char paletteNeon[];
-extern const unsigned char palettePico[];
-extern const unsigned char paletteCopper[];
-extern const unsigned char paletteAction[];
-extern const unsigned char paletteMagma[];
-extern const unsigned char paletteRainbow[];
-extern const unsigned char paletteMono[];
-extern const unsigned char paletteGameboy[];
-extern const unsigned char paletteZXSpec[];
-extern const unsigned char paletteDB16[];
-
-
-#define POK_DEFAULT_PALETTE paletteCGA
-
-#endif
-
-
-
--- a/POKITTO_CORE/PokittoSound.cpp	Wed Jun 27 13:14:54 2018 +0000
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,948 +0,0 @@
-/**************************************************************************/
-/*!
-    @file     PokittoSound.cpp
-    @author   Jonne Valola
-
-    @section LICENSE
-
-    Software License Agreement (BSD License)
-
-    Copyright (c) 2016, Jonne Valola
-    All rights reserved.
-
-    Redistribution and use in source and binary forms, with or without
-    modification, are permitted provided that the following conditions are met:
-    1. Redistributions of source code must retain the above copyright
-    notice, this list of conditions and the following disclaimer.
-    2. Redistributions in binary form must reproduce the above copyright
-    notice, this list of conditions and the following disclaimer in the
-    documentation and/or other materials provided with the distribution.
-    3. Neither the name of the copyright holders nor the
-    names of its contributors may be used to endorse or promote products
-    derived from this software without specific prior written permission.
-
-    THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS ''AS IS'' AND ANY
-    EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
-    WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
-    DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER BE LIABLE FOR ANY
-    DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-    (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-    LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-    ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-    (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
-    SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-*/
-/**************************************************************************/
-
-/*
- * NOTE:
- * API of the Pokitto Sound library is partially identical to the Gamebuino Sound API.
- * Due to the difference in architecture (ARM Cortex-M0+ in mbed environment vs. 8-bit AVR)
- * large parts are not identical. Most functions were rewritten, with only API remaining.
- * We want to give attribution to the original author's project:
- *
- * License for Gamebuino-identical code:
- *
- * (C) Copyright 2014 Aur�lien Rodot. All rights reserved.
- *
- * This file is part of the Gamebuino Library (http://gamebuino.com)
- *
- * The Gamebuino Library is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License as published by
- * the Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public License
- * along with this program.  If not, see <http://www.gnu.org/licenses/>
- */
-
-#include "PokittoSound.h"
-#include "Pokitto_settings.h"
-#include "PokittoCore.h"
-#include "Synth.h"
-
-#ifndef POK_SIM
-#include "HWSound.h"
-#else
-#include "SimSound.h"
-#include "PokittoSimulator.h"
-#endif
-
-typedef uint8_t byte;
-
-using namespace Pokitto;
-
-/** discrete hardware volume control **/
-
-uint8_t Pokitto::discrete_vol = 0;
-uint8_t const Pokitto::discrete_vol_levels[8]      {0,32,64,96,128,160,192,224};
-uint8_t const Pokitto::discrete_vol_hw_levels[8]   {0,27,64,96,36,117,127,127};
-uint8_t const Pokitto::discrete_vol_multipliers[8] {0,127,127,127,192,192,255,255};
-
-Pokitto::Core _soundc;
-
-uint8_t Sound::prescaler;
-uint16_t Sound::globalVolume;
-uint16_t Sound::volumeMax = VOLUME_HEADPHONE_MAX;
-uint8_t Sound::headPhoneLevel=1;
-
-bool Sound::trackIsPlaying[NUM_CHANNELS];
-bool Sound::patternIsPlaying[NUM_CHANNELS];
-uint8_t Sound::outputPitch[NUM_CHANNELS];
-int8_t Sound::outputVolume[NUM_CHANNELS];
-
-uint16_t *Sound::trackData[NUM_CHANNELS];
-uint8_t Sound::trackCursor[NUM_CHANNELS];
-uint16_t **Sound::patternSet[NUM_CHANNELS];
-int8_t Sound::patternPitch[NUM_CHANNELS];
-
-// pattern data
-uint16_t *Sound::patternData[NUM_CHANNELS];
-uint16_t **Sound::instrumentSet[NUM_CHANNELS];
-bool Sound::patternLooping[NUM_CHANNELS];
-uint16_t Sound::patternCursor[NUM_CHANNELS];
-
-// note data
-uint8_t Sound::notePitch[NUM_CHANNELS];
-uint8_t Sound::noteDuration[NUM_CHANNELS];
-int8_t Sound::noteVolume[NUM_CHANNELS];
-bool Sound::notePlaying[NUM_CHANNELS];
-
-// commands data
-int8_t Sound::commandsCounter[NUM_CHANNELS];
-int8_t Sound::volumeSlideStepDuration[NUM_CHANNELS];
-int8_t Sound::volumeSlideStepSize[NUM_CHANNELS];
-uint8_t Sound::arpeggioStepDuration[NUM_CHANNELS];
-int8_t Sound::arpeggioStepSize[NUM_CHANNELS];
-uint8_t Sound::tremoloStepDuration[NUM_CHANNELS];
-int8_t Sound::tremoloStepSize[NUM_CHANNELS];
-
-// instrument data
-uint16_t *Sound::instrumentData[NUM_CHANNELS];
-uint8_t Sound::instrumentLength[NUM_CHANNELS]; //number of steps in the instrument
-uint8_t Sound::instrumentLooping[NUM_CHANNELS]; //how many steps to loop on when the last step of the instrument is reached
-uint16_t Sound::instrumentCursor[NUM_CHANNELS]; //which step is being played
-uint8_t Sound::instrumentNextChange[NUM_CHANNELS]; //how many frames before the next step
-
-//current step data
-int8_t Sound::stepVolume[NUM_CHANNELS];
-uint8_t Sound::stepPitch[NUM_CHANNELS];
-uint8_t Sound::chanVolumes[NUM_CHANNELS];
-
-#if (POK_ENABLE_SOUND < 1)
- #define NUM_CHANNELS 0
-#endif
-
-#if(NUM_CHANNELS > 0)
-    #ifndef POK_SIM
-        uint32_t sbyte;
-    #else
-    uint32_t sbyte;
-    float pwm1;
-    #endif // POK_SIM
-
-//declare these variables globally for faster access
-uint8_t _rand = 1;
-uint8_t _chanCount[NUM_CHANNELS]; //counts until the next change of the waveform
-bool _chanState[NUM_CHANNELS]; //if the waveform is currently high or low
-uint8_t _chanHalfPeriod[NUM_CHANNELS]; //duration of half the period of the waveform
-uint8_t _chanOutputVolume[NUM_CHANNELS]; //amplitude of the outputted waveform
-uint8_t _chanOutput[NUM_CHANNELS]; //current value of the outputted waveform
-bool _chanNoise[NUM_CHANNELS]; //if a random value should be added to the waveform to generate noise
-
-#if POK_GBSOUND > 0
-const uint16_t squareWaveInstrument[]  = {0x0101, 0x03F7};
-const uint16_t noiseInstrument[]  = {0x0101, 0x03FF};
-const uint16_t* const defaultInstruments[]  = {squareWaveInstrument,noiseInstrument};
-
-const uint16_t playOKPattern[]  = {0x0005,0x138,0x168,0x0000};
-const uint16_t playCancelPattern[]  = {0x0005,0x168,0x138,0x0000};
-const uint16_t playTickP[]  = {0x0045,0x168,0x0000};
-#endif
-#if(EXTENDED_NOTE_RANGE > 0)
-//extended note range
-#define NUM_PITCH 59
-const uint8_t _halfPeriods[NUM_PITCH] = {246,232,219,207,195,184,174,164,155,146,138,130,123,116,110,104,98,92,87,82,78,73,69,65,62,58,55,52,49,46,44,41,39,37,35,33,31,29,28,26,25,23,22,21,20,19,18,17,16,15,14,13,12,11,10,9,8,7,6};
-#else
-//regular note range
-#define NUM_PITCH 36
-const uint8_t _halfPeriods[NUM_PITCH] = {246,232,219,207,195,184,174,164,155,146,138,130,123,116,110,104,98,92,87,82,78,73,69,65,62,58,55,52,49,46,44,41,39,37,35,33};
-#endif
-
-#endif
-
-void Pokitto::audio_IRQ() {
-    #if POK_STREAMING_MUSIC > 0
-        #if POK_STREAMFREQ_HALVE > 0
-        streamstep = 1-streamstep;
-        #else
-        streamstep=1;
-        #endif
-
-        streamstep &= streamon; //check if stream is on
-
-        if(streamvol && streamstep) {
-            uint8_t output = (*currentPtr++);
-            sbyte = output;
-        } else {
-            sbyte = 0; // duty cycle
-        }
-
-        if (currentPtr >= endPtr)
-        {
-        currentBuffer++;
-        if (currentBuffer==4) currentBuffer=0;
-        currentPtr = buffers[currentBuffer];
-        endPtr = currentPtr + BUFFER_SIZE;
-        }
-
-    #endif // POK_STREAMING_MUSIC
-    #if (NUM_CHANNELS > 0)
-	Sound::generateOutput();
-    #endif
-}
-
-void Sound::volumeUp() {
-    Pokitto::discrete_vol++;
-    if (discrete_vol>7) discrete_vol=7;
-    globalVolume = discrete_vol_levels[discrete_vol];
-    setVolume(globalVolume);
-    //if (globalVolume>VOLUME_HEADPHONE_MAX) setVolume(getVolume()+VOLUME_STEP*2);
-    //else setVolume(getVolume()+VOLUME_STEP);
-}
-
-void Sound::volumeDown() {
-    if (discrete_vol) Pokitto::discrete_vol--;
-    globalVolume = discrete_vol_levels[discrete_vol];
-    setVolume(globalVolume);
-    //if (globalVolume>VOLUME_HEADPHONE_MAX) setVolume(getVolume()-VOLUME_STEP*4);
-    //else setVolume(getVolume()-VOLUME_STEP);
-}
-
-
-void Sound::setMaxVol(int16_t v) {
-    if (v < 0) v = 0; //prevent nasty wraparound
-    if (v > VOLUME_SPEAKER_MAX) {
-            v = VOLUME_SPEAKER_MAX;
-    }
-    volumeMax = v;
-    setVolume(globalVolume);
-}
-
-uint16_t Sound::getMaxVol() {
-    return volumeMax;
-}
-
-void Sound::updateStream() {
-     #if POK_STREAMING_MUSIC
-    if (oldBuffer != currentBuffer) {
-        if (currentBuffer==0) fileReadBytes(&buffers[3][0],BUFFER_SIZE);
-        else if (currentBuffer==1) fileReadBytes(&buffers[0][0],BUFFER_SIZE);
-        else if (currentBuffer==2) fileReadBytes(&buffers[1][0],BUFFER_SIZE);
-        else fileReadBytes(&buffers[2][0],BUFFER_SIZE);
-        oldBuffer = currentBuffer;
-        streamcounter += BUFFER_SIZE;
-    }
-
-    #ifndef POK_SIM
-    if ( streamcounter > fs.fsize - (BUFFER_SIZE)) {
-    #else
-    if ( streamcounter > getFileLength() - (BUFFER_SIZE)) {
-    #endif
-        streamcounter=0;
-        #if POK_STREAM_LOOP > 0
-        fileRewind();
-        #else
-            #ifndef POK_SIM
-                streamon=0;
-            #endif // POK_SIM
-        #endif // POK_STREAM_LOOP
-    }
-    #endif
-}
-
-void Sound::begin() {
-#if POK_ENABLE_SOUND > 0
-soundInit();
-ampEnable(true);
-#endif
-#if (NUM_CHANNELS > 0)
-#if POK_ENABLE_SOUND > 0
-#if POK_GBSOUND > 0
-	prescaler = 1;
-	for(byte i=0; i<NUM_CHANNELS; i++){
-		chanVolumes[i] = VOLUME_CHANNEL_MAX;
-		changeInstrumentSet(defaultInstruments, i); //load default instruments. #0:square wave, #1: noise
-		command(CMD_INSTRUMENT, 0, 0, i); //set the default instrument to square wave
-	}
-#endif // POK_GBSOUND
-#endif //POK_ENABLE_SOUND
-#endif
-}
-
-void Sound::playTrack(const uint16_t* track, uint8_t channel){
-#if(NUM_CHANNELS > 0)
-	if(channel>=NUM_CHANNELS)
-		return;
-	stopTrack(channel);
-	trackCursor[channel] = 0;
-	trackData[channel] = (uint16_t*)track;
-	trackIsPlaying[channel] = true;
-#endif
-}
-
-void Sound::stopTrack(uint8_t channel){
-#if(NUM_CHANNELS > 0)
-	if(channel>=NUM_CHANNELS)
-		return;
-	trackIsPlaying[channel] = false;
-	stopPattern(channel);
-#endif
-}
-
-void Sound::stopTrack(){
-#if(NUM_CHANNELS > 0)
-	for(uint8_t i=0; i<NUM_CHANNELS; i++){
-		stopTrack(i);
-	}
-#endif
-}
-
-void Sound::updateTrack(uint8_t channel){
-#if(NUM_CHANNELS > 0)
-	if(channel>=NUM_CHANNELS)
-		return;
-	if(trackIsPlaying[channel] && !patternIsPlaying[channel]){
-		uint16_t data = pgm_read_word(trackData[channel] + trackCursor[channel]);
-		if(data == 0xFFFF){ //en of the track
-			trackIsPlaying[channel] = false;
-			return;
-		}
-		uint8_t patternID = data & 0xFF;
-		data >>= 8;
-		patternPitch[channel] = data;
-		playPattern((const uint16_t*)pgm_read_word(&(patternSet[channel][patternID])), channel);
-		trackCursor[channel] ++;
-	}
-#endif
-}
-
-void Sound::updateTrack(){
-#if(NUM_CHANNELS > 0)
-	for (uint8_t i=0; i<NUM_CHANNELS; i++){
-		updateTrack(i);
-	}
-#endif
-}
-
-void Sound::changePatternSet(const uint16_t* const* patterns, uint8_t channel){
-#if(NUM_CHANNELS > 0)
-	if(channel>=NUM_CHANNELS)
-		return;
-	patternSet[channel] = (uint16_t**)patterns;
-#endif
-}
-
-void Sound::playPattern(const uint16_t* pattern, uint8_t channel){
-#if(NUM_CHANNELS > 0)
-	if(channel>=NUM_CHANNELS)
-		return;
-	stopPattern(channel);
-	patternData[channel] = (uint16_t*)pattern;
-	patternCursor[channel] = 0;
-	patternIsPlaying[channel] = true;
-	noteVolume[channel] = 9;
-	//reinit commands
-	volumeSlideStepDuration[channel] = 0;
-	arpeggioStepDuration[channel] = 0;
-	tremoloStepDuration[channel] = 0;
-#endif
-}
-
-void Sound::updatePattern(){
-#if(NUM_CHANNELS > 0)
-	for (uint8_t i=0; i<NUM_CHANNELS; i++){
-		updatePattern(i);
-	}
-#endif
-}
-
-void Sound::changeInstrumentSet(const uint16_t* const* instruments, uint8_t channel){
-#if(NUM_CHANNELS > 0)
-	if(channel>=NUM_CHANNELS)
-		return;
-	instrumentSet[channel] = (uint16_t**)instruments;
-#endif
-}
-
-void Sound::updatePattern(uint8_t i){
-#if(NUM_CHANNELS > 0)
-	if(i>=NUM_CHANNELS)
-		return;
-	if(patternIsPlaying[i]){
-		if(noteDuration[i]==0){//if the end of the previous note is reached
-
-			uint16_t data = pgm_read_word(patternCursor[i] + patternData[i]);
-
-			if(data == 0){ //end of the pattern reached
-				if(patternLooping[i] == true){
-					patternCursor[i] = 0;
-					data = pgm_read_word(patternCursor[i] + patternData[i]);
-				}
-				else{
-					patternIsPlaying[i] = false;
-					if(trackIsPlaying[i]){ //if this pattern is part of a track, get the next pattern
-						updateTrack(i);
-						data = pgm_read_word(patternCursor[i] + patternData[i]);
-					} else {
-						stopNote(i);
-						//Serial.print("pattern end\n");
-						return;
-					}
-				}
-			}
-
-			while (data & 0x0001){ //read all commands and instrument changes
-				data >>= 2;
-				//Serial.print("\ncmd\t");
-				uint8_t cmd = data & 0x0F;
-				data >>= 4;
-				uint8_t X = data & 0x1F;
-				data >>= 5;
-				int8_t Y = data - 16;
-				command(cmd,X,Y,i);
-				patternCursor[i]++;
-				data = pgm_read_word(patternCursor[i] + patternData[i]);
-			}
-			data >>= 2;
-
-			uint8_t pitch = data & 0x003F;
-			data >>= 6;
-
-			uint8_t duration = data;
-			if(pitch != 63){
-			}
-
-			playNote(pitch, duration, i);
-
-			patternCursor[i]++;
-		}
-	}
-#endif
-}
-
-void Sound::stopPattern(uint8_t channel){
-#if(NUM_CHANNELS > 0)
-	if(channel>=NUM_CHANNELS)
-		return;
-	stopNote(channel);
-	patternIsPlaying[channel] = false;
-#endif
-}
-
-void Sound::stopPattern(){
-#if(NUM_CHANNELS > 0)
-	for(uint8_t i=0; i<NUM_CHANNELS; i++){
-		stopPattern(i);
-	}
-#endif
-}
-
-void Sound::command(uint8_t cmd, uint8_t X, int8_t Y, uint8_t i){
-#if(NUM_CHANNELS > 0)
-	if(i>=NUM_CHANNELS)
-		return;
-	switch(cmd){
-	case CMD_VOLUME: //volume
-	    X = constrain((int8_t)X, 0, 10);
-		noteVolume[i] = X;
-		break;
-	case CMD_INSTRUMENT: //instrument
-		instrumentData[i] = (uint16_t*)pgm_read_word(&(instrumentSet[i][X]));
-		instrumentLength[i] = pgm_read_word(&(instrumentData[i][0])) & 0x00FF; //8 LSB
-		instrumentLength[i] *= prescaler;
-		instrumentLooping[i] = min2((pgm_read_word(&(instrumentData[i][0])) >> 8), instrumentLength[i]); //8 MSB - check that the loop is shorter than the instrument length
-		instrumentLooping[i] *= prescaler;
-		break;
-	case CMD_SLIDE: //volume slide
-		volumeSlideStepDuration[i] = X * prescaler;
-		volumeSlideStepSize[i] = Y;
-		break;
-	case CMD_ARPEGGIO:
-		arpeggioStepDuration[i] = X * prescaler;
-		arpeggioStepSize[i] = Y;
-		break;
-	case CMD_TREMOLO:
-		tremoloStepDuration[i] = X * prescaler;
-		tremoloStepSize[i] = Y;
-		break;
-	default:
-		break;
-	}
-#endif
-}
-
-void Sound::playNote(uint8_t pitch, uint8_t duration, uint8_t channel){
-#if(NUM_CHANNELS > 0)
-	if(channel>=NUM_CHANNELS)
-		return;
-	//set note
-	notePitch[channel] = pitch;
-	noteDuration[channel] = duration * prescaler;
-	//reinit vars
-	instrumentNextChange[channel] = 0;
-	instrumentCursor[channel] = 0;
-	notePlaying[channel] = true;
-	_chanState[channel] = true;
-	commandsCounter[channel] = 0;
-#endif
-}
-
-void Sound::stopNote(uint8_t channel) {
-#if(NUM_CHANNELS > 0)
-	if(channel>=NUM_CHANNELS)
-		return;
-	notePlaying[channel] = false;
-	//counters
-	noteDuration[channel] = 0;
-	instrumentCursor[channel] = 0;
-	commandsCounter[channel] = 0;
-	//output
-	_chanOutput[channel] = 0;
-	_chanOutputVolume[channel] = 0;
-	_chanState[channel] = false;
-	updateOutput();
-#endif
-}
-
-void Sound::stopNote() {
-#if(NUM_CHANNELS > 0)
-	for (uint8_t channel = 0; channel < NUM_CHANNELS; channel++) {
-		stopNote(channel);
-	}
-#endif
-}
-
-void Sound::updateNote() {
-#if(NUM_CHANNELS > 0)
-	for (uint8_t i = 0; i < NUM_CHANNELS; i++) {
-		updateNote(i);
-	}
-#endif
-}
-
-void Sound::updateNote(uint8_t i) {
-#if(NUM_CHANNELS > 0)
-	if(i>=NUM_CHANNELS)
-		return;
-	if (notePlaying[i]) {
-
-		if(noteDuration[i] == 0){
-			stopNote(i);
-			//Serial.println("note end");
-			return;
-		} else {
-			noteDuration[i]--;
-		}
-
-		if (instrumentNextChange[i] == 0) {
-
-			//read the step data from the progmem and decode it
-			uint16_t thisStep = pgm_read_word(&(instrumentData[i][1 + instrumentCursor[i]]));
-
-			stepVolume[i] = thisStep & 0x0007;
-			thisStep >>= 3;
-
-			uint8_t stepNoise = thisStep & 0x0001;
-			thisStep >>= 1;
-
-			uint8_t stepDuration = thisStep & 0x003F;
-			thisStep >>= 6;
-
-			stepPitch[i] = thisStep;
-
-			//apply the step settings
-			instrumentNextChange[i] = stepDuration * prescaler;
-
-			_chanNoise[i] = stepNoise;
-
-
-			instrumentCursor[i]++;
-
-			if (instrumentCursor[i] >= instrumentLength[i]) {
-				if (instrumentLooping[i]) {
-					instrumentCursor[i] = instrumentLength[i] - instrumentLooping[i];
-				} else {
-					stopNote(i);
-				}
-			}
-		}
-		instrumentNextChange[i]--;
-
-		commandsCounter[i]++;
-
-		//UPDATE VALUES
-		//pitch
-		outputPitch[i] = notePitch[i] + stepPitch[i] + patternPitch[i];
-		if(arpeggioStepDuration[i]){
-		  outputPitch[i] += commandsCounter[i] / arpeggioStepDuration[i] * arpeggioStepSize[i];
-		}
-		outputPitch[i] = (outputPitch[i] + NUM_PITCH) % NUM_PITCH; //wrap
-		//volume
-		outputVolume[i] = noteVolume[i];
-		if(volumeSlideStepDuration[i]){
-		  outputVolume[i] += commandsCounter[i] / volumeSlideStepDuration[i] * volumeSlideStepSize[i];
-		}
-		if(tremoloStepDuration[i]){
-			outputVolume[i] += ((commandsCounter[i]/tremoloStepDuration[i]) % 2) * tremoloStepSize[i];
-		}
-		outputVolume[i] = constrain(outputVolume[i], 0, 9);
-		if(notePitch[i] == 63){
-			outputVolume[i] = 0;
-		}
-		// jonnehw noInterrupts();
-		_chanHalfPeriod[i] = pgm_read_byte(_halfPeriods + outputPitch[i]);
-		_chanOutput[i] = _chanOutputVolume[i] = outputVolume[i] * (globalVolume>>GLOBVOL_SHIFT) * chanVolumes[i] * stepVolume[i];
-		//Serial.println(outputVolume[i]);
-		// jonnehw interrupts();
-	}
-#endif
-}
-
-void Sound::setChannelHalfPeriod(uint8_t channel, uint8_t halfPeriod) {
-#if(NUM_CHANNELS > 0)
-	if(channel>=NUM_CHANNELS)
-		return;
-	_chanHalfPeriod[channel] = halfPeriod;
-	_chanState[channel] = false;
-	_chanCount[channel] = 0;
-	updateOutput();
-#endif
-}
-
-
-void Sound::generateOutput() {
-#if(NUM_CHANNELS > 0)
-	bool outputChanged = false;
-	//no for loop here, for the performance sake (this function runs 15 000 times per second...)
-	//CHANNEL 0
-	if (_chanOutputVolume[0]) {
-		_chanCount[0]++;
-		if (_chanCount[0] >= _chanHalfPeriod[0]) {
-			outputChanged = true;
-			_chanState[0] = !_chanState[0];
-			_chanCount[0] = 0;
-			if (_chanNoise[0]) {
-				_rand = 67 * _rand + 71;
-				_chanOutput[0] = _rand % _chanOutputVolume[0];
-			}
-		}
-	}
-
-
-	//CHANNEL 1
-	#if (NUM_CHANNELS > 1)
-	if (_chanOutputVolume[1]) {
-		_chanCount[1]++;
-		if (_chanCount[1] >= _chanHalfPeriod[1]) {
-			outputChanged = true;
-			_chanState[1] = !_chanState[1];
-			_chanCount[1] = 0;
-			if (_chanNoise[1]) {
-				_rand = 67 * _rand + 71;
-				_chanOutput[1] = _rand % _chanOutputVolume[1];
-			}
-		}
-	}
-	#endif
-
-	//CHANNEL 2
-	#if (NUM_CHANNELS > 2)
-	if (_chanOutputVolume[2]) {
-		_chanCount[2]++;
-		if (_chanCount[2] >= _chanHalfPeriod[2]) {
-			outputChanged = true;
-			_chanState[2] = !_chanState[2];
-			_chanCount[2] = 0;
-			if (_chanNoise[2]) {
-				_rand = 67 * _rand + 71;
-				_chanOutput[2] = _rand % _chanOutputVolume[2];
-			}
-		}
-	}
-	#endif
-
-	//CHANNEL 3
-	#if (NUM_CHANNELS > 3)
-	if (_chanOutputVolume[3]) {
-		_chanCount[3]++;
-		if (_chanCount[3] >= _chanHalfPeriod[3]) {
-			outputChanged = true;
-			_chanState[3] = !_chanState[3];
-			_chanCount[3] = 0;
-			if (_chanNoise[3]) {
-				_rand = 67 * _rand + 71;
-				_chanOutput[3] = _rand % _chanOutputVolume[3];
-			}
-		}
-	}
-	#endif
-
-    #if POK_STREAMING_MUSIC
-        if (streamstep) {
-            outputChanged=true;
-        }
-    #endif
-
-	if (outputChanged) {
-		updateOutput();
-	}
-#endif
-}
-
-void Sound::updateOutput() {
-#if(NUM_CHANNELS > 0)
-	uint32_t output = 0;
-
-	//CHANNEL 0
-	if (_chanState[0]) {
-		output += _chanOutput[0];
-	}
-
-	//CHANNEL 1
-	#if (NUM_CHANNELS > 1)
-	if (_chanState[1]) {
-		output += _chanOutput[1];
-	}
-	#endif
-
-	//CHANNEL 2
-	#if (NUM_CHANNELS > 2)
-	if (_chanState[2]) {
-		output += _chanOutput[2];
-	}
-	#endif
-
-	//CHANNEL 3
-	#if (NUM_CHANNELS > 3)
-	if (_chanState[3]) {
-		output += _chanOutput[3];
-	}
-	#endif
-
-    #ifndef POK_SIM
-    #if POK_ENABLE_SOUND
-    /** HARDWARE **/
-
-        #if POK_STREAMING_MUSIC
-            if (streamstep) {
-                //pwmout_write(&audiopwm,(float)(sbyte>>headPhoneLevel)/(float)255);
-                sbyte *= discrete_vol_multipliers[discrete_vol];
-                sbyte >>= 8;
-                pwmout_write(&audiopwm,(float)(sbyte)/(float)255);
-            }
-        #endif
-            output *= discrete_vol_multipliers[discrete_vol];
-            output >>= 8;
-            dac_write((uint8_t)output); //direct hardware mixing baby !
-    soundbyte = output;
-    #endif //POK_ENABLE_SOUND
-    #else
-    /** SIMULATOR **/
-        #if POK_STREAMING_MUSIC
-            if (streamstep) {
-                uint16_t o = output + sbyte;
-                output = (o/2);//>>headPhoneLevel;
-            }
-        #endif
-        soundbyte = output;//<<headPhoneLevel;
-    #endif // POK_SIM
-#endif
-}
-
-void Sound::setPatternLooping(bool loop, uint8_t channel) {
-#if(NUM_CHANNELS > 0)
-	if(channel>=NUM_CHANNELS)
-		return;
-	patternLooping[channel] = loop;
-#endif
-}
-
-void Sound::playOK(){
-    #if POK_GBSOUND
-#if(NUM_CHANNELS > 0)
-	playPattern(playOKPattern,0);
-#endif
-#endif // POK_GBSOUND
-}
-
-void Sound::playCancel(){
-#if POK_GBSOUND
-#if(NUM_CHANNELS > 0)
-	playPattern(playCancelPattern,0);
-#endif
-#endif
-}
-
-void Sound::playTick(){
-#if POK_GBSOUND
-#if(NUM_CHANNELS > 0)
-	playPattern(playTickP,0);
-#endif
-#endif // POK_GBSOUND
-}
-
-void Sound::setVolume(int16_t volume) {
-//#if NUM_CHANNELS > 0
-	if (volume<0) volume = 0;
-	//if (volume>volumeMax) volume = volumeMax;
-	globalVolume = volume;
-	#if POK_ENABLE_SOUND > 0
-	discrete_vol = (volume>>5);
-	#ifndef POK_SIM
-	setHWvolume(discrete_vol_hw_levels[discrete_vol]); //boost volume if headphonelevel
-	#endif
-	#endif
-	#if POK_SHOW_VOLUME > 0
-	_soundc.volbar_visible = VOLUMEBAR_TIMEOUT;
-	#endif
-//#endif
-}
-
-uint16_t Sound::getVolume() {
-//#if NUM_CHANNELS > 0
-	return globalVolume;
-//#else
-//	return 0;
-//#endif
-}
-
-void Sound::setVolume(int8_t volume, uint8_t channel) {
-#if(NUM_CHANNELS > 0)
-	if(channel>=NUM_CHANNELS)
-		return;
-	volume = (volume > VOLUME_CHANNEL_MAX) ? VOLUME_CHANNEL_MAX : volume;
-	volume = (volume < 0) ? 0 : volume;
-	chanVolumes[channel] = volume;
-#endif
-}
-
-uint8_t Sound::getVolume(uint8_t channel) {
-#if(NUM_CHANNELS > 0)
-	if(channel>=NUM_CHANNELS)
-		return 255;
-	return (chanVolumes[channel]);
-#else
-	return 0;
-#endif
-}
-
-void Sound::playTone(uint8_t os, int frq, uint8_t amp, uint8_t wav,uint8_t arpmode)
-{
-    if (wav>5) wav=0;
-    if (arpmode>MAX_ARPMODE) arpmode=MAX_ARPMODE;
-    if (os==1) setOSC(&osc1,1,wav,1,0,0,frq,amp,0,0,0,0,0,0,arpmode,0,0);
-    else if (os==2) setOSC(&osc2,1,wav,1,0,0,frq,amp,0,0,0,0,0,0,arpmode,0,0);
-    else if (os==3) setOSC(&osc3,1,wav,1,0,0,frq,amp,0,0,0,0,0,0,arpmode,0,0);
-}
-
-void Sound::playTone(uint8_t os, uint16_t frq, uint8_t volume, uint32_t duration)
-{
-    if (os==1) setOSC(&osc1,1,WSQUARE,frq,volume,duration);
-    else if (os==2) setOSC(&osc2,1,WTRI,frq,volume,duration);
-    else if (os==3) setOSC(&osc3,1,WTRI,frq,volume,duration);
-}
-
-uint8_t Sound::ampIsOn()
-{
-    #ifdef POK_SIM
-    return core.ampIsOn();
-    #else
-    #if POK_ENABLE_SOUND > 0
-    return Pokitto::ampIsOn();
-    #endif
-    #endif // POK_SIM
-    return 0;
-}
-
-void Sound::ampEnable(uint8_t v) {
-    #ifdef POK_SIM
-    core.ampEnable(v);
-    #else
-    #if POK_ENABLE_SOUND > 0
-    Pokitto::ampEnable(v);
-    #endif
-    #endif // POK_SIM
-
-}
-
-int Sound::playMusicStream(char* filename)
-{
-    return playMusicStream(filename,FILE_MODE_READONLY | FILE_MODE_BINARY);
-}
-
-int Sound::playMusicStream()
-{
-    #if POK_STREAMING_MUSIC >0
-    if (currentPtr) {
-            pokPlayStream();
-            return 1;
-    } else return 0; //no stream
-    #endif // POK_STREAMING_MUSIC
-}
-
-void Sound::pauseMusicStream() {
-    #if POK_ENABLE_SOUND > 0
-    pokPauseStream();
-    #endif
-}
-
-int Sound::playMusicStream(char* filename, uint8_t options)
-{
-    #if POK_STREAMING_MUSIC
-        uint8_t result;
-        result = pokInitSD();
-        if (!isThisFileOpen(filename)) {
-            fileClose(); // close any open files
-            result = fileOpen(filename,FILE_MODE_READONLY | FILE_MODE_BINARY);
-        }
-
-        if (result) {
-                currentPtr = 0; // mark that no stream is available
-                return 0; // opening music file failed
-        }
-
-        fileReadBytes(&buffers[0][0],BUFFER_SIZE);
-        fileReadBytes(&buffers[1][0],BUFFER_SIZE);
-        fileReadBytes(&buffers[2][0],BUFFER_SIZE);
-        fileReadBytes(&buffers[3][0],BUFFER_SIZE);
-        currentBuffer = 0;
-        currentPtr = buffers[currentBuffer];
-        endPtr = currentPtr + BUFFER_SIZE;
-
-        //streaming = STR_PLAYING|options;
-
-        if (!options) pokPlayStream(); // activate stream
-    #endif //POK_STREAMING_MUSIC
-    return 1; // opening music file succeeded
-}
-
-uint32_t Sound::getMusicStreamElapsedSec() {
-    #if POK_STREAMING_MUSIC
-    return streamcounter/POK_AUD_FREQ;
-    #endif
-    return 0;
-}
-
-uint32_t Sound::getMusicStreamElapsedMilliSec() {
-    #if POK_STREAMING_MUSIC
-    return streamcounter/(POK_AUD_FREQ/1000);
-    #endif
-    return 0;
-}
-
--- a/POKITTO_CORE/PokittoSound.h	Wed Jun 27 13:14:54 2018 +0000
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,229 +0,0 @@
-/**************************************************************************/
-/*!
-    @file     PokittoSound.h
-    @author   Jonne Valola
-
-    @section LICENSE
-
-    Software License Agreement (BSD License)
-
-    Copyright (c) 2016, Jonne Valola
-    All rights reserved.
-
-    Redistribution and use in source and binary forms, with or without
-    modification, are permitted provided that the following conditions are met:
-    1. Redistributions of source code must retain the above copyright
-    notice, this list of conditions and the following disclaimer.
-    2. Redistributions in binary form must reproduce the above copyright
-    notice, this list of conditions and the following disclaimer in the
-    documentation and/or other materials provided with the distribution.
-    3. Neither the name of the copyright holders nor the
-    names of its contributors may be used to endorse or promote products
-    derived from this software without specific prior written permission.
-
-    THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS ''AS IS'' AND ANY
-    EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
-    WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
-    DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER BE LIABLE FOR ANY
-    DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-    (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-    LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-    ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-    (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
-    SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-*/
-/**************************************************************************/
-
-
-#ifndef POKITTOSOUND_H
-#define POKITTOSOUND_H
-
-#include <stdint.h>
-#include "Pokitto_settings.h"
-#include "GBcompatibility.h"
-#include "PokittoFakeavr.h"
-#include "PokittoGlobs.h"
-
-extern void pokPauseStream();
-extern void pokPlayStream();
-extern uint8_t pokStreamPaused();
-
-//volume levels
-#define GLOBVOL_SHIFT 5 //shift global volume to allow for finer increments
-
-
-#ifndef MAX_VOL_TEST
-    #define VOLUME_SPEAKER_MAX 255 //((8<<GLOBVOL_SHIFT)-1)
-    #define VOLUME_HEADPHONE_MAX 127
-    #define VOLUME_STARTUP VOLUME_HEADPHONE_MAX
-#else
-    #define VOLUME_SPEAKER_MAX 255
-    #define VOLUME_HEADPHONE_MAX VOLUME_SPEAKER_MAX
-    #define VOLUME_STARTUP VOLUME_SPEAKER_MAX
-#endif // MAXVOLTEST
-
-#ifdef POK_SIM
-#define VOLUME_STEP 1
-#else
-#define VOLUME_STEP 8
-#endif
-
-
-//commands
-#define CMD_VOLUME 0
-#define CMD_INSTRUMENT 1
-#define CMD_SLIDE 2
-#define CMD_ARPEGGIO 3
-#define CMD_TREMOLO 4
-
-#define STR_PLAYING 0x1
-#define STR_VISUALIZER  0x2
-#define STR_LOOP    0x4
-#define STR_PAUSED  0x8
-
-namespace Pokitto {
-
-/** Sound class.
- *  The Sound class is an API-compatible version of the Gamebuino Sound API by Aurelien Rodot.
- *  Because it is a class consisting of only static members, there is only 1 instance running,
- *  no matter how many Sound classes are declared (see example below). This means sound can
- *  be used through a simple Sound class object or as a member of the Core class.
- *
- */
-
-/** discrete_vol* are needed for more accurate volume control levels on hardware **/
-extern uint8_t discrete_vol;
-extern const uint8_t discrete_vol_levels[];
-extern const uint8_t discrete_vol_hw_levels[];
-extern const uint8_t discrete_vol_multipliers[];
-
-extern void audio_IRQ();  // audio interrupt
-
-class Sound {
-private:
-    static uint16_t volumeMax;
-
-public:
-	static void begin();
-
-	// Headphonemode
-	static uint8_t headPhoneLevel; // a workaround to disappearing sound at low volume
-	static void setMaxVol(int16_t);
-    static uint16_t getMaxVol();
-    static void volumeUp();
-    static void volumeDown();
-
-	// Original functions
-	static void updateStream();
-    static void playTone(uint8_t os, int frq, uint8_t amp, uint8_t wav,uint8_t arpmode);
-    static void playTone(uint8_t os, uint16_t freq, uint8_t volume, uint32_t duration);
-    static uint8_t ampIsOn();
-    static void ampEnable(uint8_t);
-    static int playMusicStream(char* filename, uint8_t options);
-    static int playMusicStream(char* filename);
-    static int playMusicStream();
-    static void pauseMusicStream();
-    static uint32_t getMusicStreamElapsedSec();
-    static uint32_t getMusicStreamElapsedMilliSec();
-
-	// GB compatibility functions
-	static void playTrack(const uint16_t* track, uint8_t channel);
-	static void updateTrack(uint8_t channel);
-	static void updateTrack();
-	static void stopTrack(uint8_t channel);
-	static void stopTrack();
-	static void changePatternSet(const uint16_t* const* patterns, uint8_t channel);
-	static bool trackIsPlaying[NUM_CHANNELS];
-
-	static void playPattern(const uint16_t* pattern, uint8_t channel);
-	static void changeInstrumentSet(const uint16_t* const* instruments, uint8_t channel);
-	static void updatePattern(uint8_t i);
-	static void updatePattern();
-	static void setPatternLooping(bool loop, uint8_t channel);
-	static void stopPattern(uint8_t channel);
-	static void stopPattern();
-	static bool patternIsPlaying[NUM_CHANNELS];
-
-	static void command(uint8_t cmd, uint8_t X, int8_t Y, uint8_t i);
-	static void playNote(uint8_t pitch, uint8_t duration, uint8_t channel);
-	static void updateNote();
-	static void updateNote(uint8_t i);
-	static void stopNote(uint8_t channel);
-	static void stopNote();
-
-	static uint8_t outputPitch[NUM_CHANNELS];
-	static int8_t outputVolume[NUM_CHANNELS];
-
-	static void setMasterVolume(uint8_t);
-	static uint8_t GetMasterVolume();
-	static void setVolume(int16_t volume);
-	static uint16_t getVolume();
-	static void setVolume(int8_t volume, uint8_t channel);
-	static uint8_t getVolume(uint8_t channel);
-
-	static void playOK();
-	static void playCancel();
-	static void playTick();
-
-	static uint8_t prescaler;
-
-	static void setChannelHalfPeriod(uint8_t channel, uint8_t halfPeriod);
-
-	static void generateOutput(); //!\\ DO NOT USE
-	static uint16_t globalVolume;
-
-
-#if (NUM_CHANNELS > 0)
-	//tracks data
-	static uint16_t *trackData[NUM_CHANNELS];
-	static uint8_t trackCursor[NUM_CHANNELS];
-	static uint16_t **patternSet[NUM_CHANNELS];
-	static int8_t patternPitch[NUM_CHANNELS];
-
-	// pattern data
-	static uint16_t *patternData[NUM_CHANNELS];
-	static uint16_t **instrumentSet[NUM_CHANNELS];
-	static bool patternLooping[NUM_CHANNELS];
-	static uint16_t patternCursor[NUM_CHANNELS];
-
-	// note data
-	static uint8_t notePitch[NUM_CHANNELS];
-	static uint8_t noteDuration[NUM_CHANNELS];
-	static int8_t noteVolume[NUM_CHANNELS];
-	static bool notePlaying[NUM_CHANNELS];
-
-	// commands data
-	static int8_t commandsCounter[NUM_CHANNELS];
-	static int8_t volumeSlideStepDuration[NUM_CHANNELS];
-	static int8_t volumeSlideStepSize[NUM_CHANNELS];
-	static uint8_t arpeggioStepDuration[NUM_CHANNELS];
-	static int8_t arpeggioStepSize[NUM_CHANNELS];
-	static uint8_t tremoloStepDuration[NUM_CHANNELS];
-	static int8_t tremoloStepSize[NUM_CHANNELS];
-
-
-	// instrument data
-	static uint16_t *instrumentData[NUM_CHANNELS];
-	static uint8_t instrumentLength[NUM_CHANNELS]; //number of steps in the instrument
-	static uint8_t instrumentLooping[NUM_CHANNELS]; //how many steps to loop on when the last step of the instrument is reached
-	static uint16_t instrumentCursor[NUM_CHANNELS]; //which step is being played
-	static uint8_t instrumentNextChange[NUM_CHANNELS]; //how many frames before the next step
-
-	//current step data
-	static int8_t stepVolume[NUM_CHANNELS];
-	static uint8_t stepPitch[NUM_CHANNELS];
-
-	static uint8_t chanVolumes[NUM_CHANNELS];
-#endif
-	static void updateOutput();
-};
-
-}
-
-#endif // POKITTOSOUND_H
-
-
-
-
-
-
--- a/POKITTO_CORE/PokittoTimer.h	Wed Jun 27 13:14:54 2018 +0000
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,46 +0,0 @@
-/**************************************************************************/
-/*!
-    @file     PokittoTimer.h
-    @author   Jonne Valola
-
-    @section LICENSE
-
-    Software License Agreement (BSD License)
-
-    Copyright (c) 2016, Jonne Valola
-    All rights reserved.
-
-    Redistribution and use in source and binary forms, with or without
-    modification, are permitted provided that the following conditions are met:
-    1. Redistributions of source code must retain the above copyright
-    notice, this list of conditions and the following disclaimer.
-    2. Redistributions in binary form must reproduce the above copyright
-    notice, this list of conditions and the following disclaimer in the
-    documentation and/or other materials provided with the distribution.
-    3. Neither the name of the copyright holders nor the
-    names of its contributors may be used to endorse or promote products
-    derived from this software without specific prior written permission.
-
-    THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS ''AS IS'' AND ANY
-    EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
-    WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
-    DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER BE LIABLE FOR ANY
-    DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-    (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-    LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-    ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-    (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
-    SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-*/
-/**************************************************************************/
-
-#ifndef POKITTO_TIMER_H
-#define POKITTO_TIMER_H
-
-extern void pokInitTimer(void);
-extern unsigned int pokGetTime(void);
-extern void pokWaitms(uint16_t);
-
-#endif
-
-
--- a/POKITTO_CORE/binary.h	Wed Jun 27 13:14:54 2018 +0000
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,517 +0,0 @@
-#ifndef Binary_h
-#define Binary_h
-
-//jonne #define B0 0
-#define B00 0
-#define B000 0
-#define B0000 0
-#define B00000 0
-#define B000000 0
-#define B0000000 0
-#define B00000000 0
-//jonne #define B1 1
-#define B01 1
-#define B001 1
-#define B0001 1
-#define B00001 1
-#define B000001 1
-#define B0000001 1
-#define B00000001 1
-#define B10 2
-#define B010 2
-#define B0010 2
-#define B00010 2
-#define B000010 2
-#define B0000010 2
-#define B00000010 2
-#define B11 3
-#define B011 3
-#define B0011 3
-#define B00011 3
-#define B000011 3
-#define B0000011 3
-#define B00000011 3
-#define B100 4
-#define B0100 4
-#define B00100 4
-#define B000100 4
-#define B0000100 4
-#define B00000100 4
-#define B101 5
-#define B0101 5
-#define B00101 5
-#define B000101 5
-#define B0000101 5
-#define B00000101 5
-#define B110 6
-#define B0110 6
-#define B00110 6
-#define B000110 6
-#define B0000110 6
-#define B00000110 6
-#define B111 7
-#define B0111 7
-#define B00111 7
-#define B000111 7
-#define B0000111 7
-#define B00000111 7
-#define B1000 8
-#define B01000 8
-#define B001000 8
-#define B0001000 8
-#define B00001000 8
-#define B1001 9
-#define B01001 9
-#define B001001 9
-#define B0001001 9
-#define B00001001 9
-#define B1010 10
-#define B01010 10
-#define B001010 10
-#define B0001010 10
-#define B00001010 10
-#define B1011 11
-#define B01011 11
-#define B001011 11
-#define B0001011 11
-#define B00001011 11
-#define B1100 12
-#define B01100 12
-#define B001100 12
-#define B0001100 12
-#define B00001100 12
-#define B1101 13
-#define B01101 13
-#define B001101 13
-#define B0001101 13
-#define B00001101 13
-#define B1110 14
-#define B01110 14
-#define B001110 14
-#define B0001110 14
-#define B00001110 14
-#define B1111 15
-#define B01111 15
-#define B001111 15
-#define B0001111 15
-#define B00001111 15
-#define B10000 16
-#define B010000 16
-#define B0010000 16
-#define B00010000 16
-#define B10001 17
-#define B010001 17
-#define B0010001 17
-#define B00010001 17
-#define B10010 18
-#define B010010 18
-#define B0010010 18
-#define B00010010 18
-#define B10011 19
-#define B010011 19
-#define B0010011 19
-#define B00010011 19
-#define B10100 20
-#define B010100 20
-#define B0010100 20
-#define B00010100 20
-#define B10101 21
-#define B010101 21
-#define B0010101 21
-#define B00010101 21
-#define B10110 22
-#define B010110 22
-#define B0010110 22
-#define B00010110 22
-#define B10111 23
-#define B010111 23
-#define B0010111 23
-#define B00010111 23
-#define B11000 24
-#define B011000 24
-#define B0011000 24
-#define B00011000 24
-#define B11001 25
-#define B011001 25
-#define B0011001 25
-#define B00011001 25
-#define B11010 26
-#define B011010 26
-#define B0011010 26
-#define B00011010 26
-#define B11011 27
-#define B011011 27
-#define B0011011 27
-#define B00011011 27
-#define B11100 28
-#define B011100 28
-#define B0011100 28
-#define B00011100 28
-#define B11101 29
-#define B011101 29
-#define B0011101 29
-#define B00011101 29
-#define B11110 30
-#define B011110 30
-#define B0011110 30
-#define B00011110 30
-#define B11111 31
-#define B011111 31
-#define B0011111 31
-#define B00011111 31
-#define B100000 32
-#define B0100000 32
-#define B00100000 32
-#define B100001 33
-#define B0100001 33
-#define B00100001 33
-#define B100010 34
-#define B0100010 34
-#define B00100010 34
-#define B100011 35
-#define B0100011 35
-#define B00100011 35
-#define B100100 36
-#define B0100100 36
-#define B00100100 36
-#define B100101 37
-#define B0100101 37
-#define B00100101 37
-#define B100110 38
-#define B0100110 38
-#define B00100110 38
-#define B100111 39
-#define B0100111 39
-#define B00100111 39
-#define B101000 40
-#define B0101000 40
-#define B00101000 40
-#define B101001 41
-#define B0101001 41
-#define B00101001 41
-#define B101010 42
-#define B0101010 42
-#define B00101010 42
-#define B101011 43
-#define B0101011 43
-#define B00101011 43
-#define B101100 44
-#define B0101100 44
-#define B00101100 44
-#define B101101 45
-#define B0101101 45
-#define B00101101 45
-#define B101110 46
-#define B0101110 46
-#define B00101110 46
-#define B101111 47
-#define B0101111 47
-#define B00101111 47
-#define B110000 48
-#define B0110000 48
-#define B00110000 48
-#define B110001 49
-#define B0110001 49
-#define B00110001 49
-#define B110010 50
-#define B0110010 50
-#define B00110010 50
-#define B110011 51
-#define B0110011 51
-#define B00110011 51
-#define B110100 52
-#define B0110100 52
-#define B00110100 52
-#define B110101 53
-#define B0110101 53
-#define B00110101 53
-#define B110110 54
-#define B0110110 54
-#define B00110110 54
-#define B110111 55
-#define B0110111 55
-#define B00110111 55
-#define B111000 56
-#define B0111000 56
-#define B00111000 56
-#define B111001 57
-#define B0111001 57
-#define B00111001 57
-#define B111010 58
-#define B0111010 58
-#define B00111010 58
-#define B111011 59
-#define B0111011 59
-#define B00111011 59
-#define B111100 60
-#define B0111100 60
-#define B00111100 60
-#define B111101 61
-#define B0111101 61
-#define B00111101 61
-#define B111110 62
-#define B0111110 62
-#define B00111110 62
-#define B111111 63
-#define B0111111 63
-#define B00111111 63
-#define B1000000 64
-#define B01000000 64
-#define B1000001 65
-#define B01000001 65
-#define B1000010 66
-#define B01000010 66
-#define B1000011 67
-#define B01000011 67
-#define B1000100 68
-#define B01000100 68
-#define B1000101 69
-#define B01000101 69
-#define B1000110 70
-#define B01000110 70
-#define B1000111 71
-#define B01000111 71
-#define B1001000 72
-#define B01001000 72
-#define B1001001 73
-#define B01001001 73
-#define B1001010 74
-#define B01001010 74
-#define B1001011 75
-#define B01001011 75
-#define B1001100 76
-#define B01001100 76
-#define B1001101 77
-#define B01001101 77
-#define B1001110 78
-#define B01001110 78
-#define B1001111 79
-#define B01001111 79
-#define B1010000 80
-#define B01010000 80
-#define B1010001 81
-#define B01010001 81
-#define B1010010 82
-#define B01010010 82
-#define B1010011 83
-#define B01010011 83
-#define B1010100 84
-#define B01010100 84
-#define B1010101 85
-#define B01010101 85
-#define B1010110 86
-#define B01010110 86
-#define B1010111 87
-#define B01010111 87
-#define B1011000 88
-#define B01011000 88
-#define B1011001 89
-#define B01011001 89
-#define B1011010 90
-#define B01011010 90
-#define B1011011 91
-#define B01011011 91
-#define B1011100 92
-#define B01011100 92
-#define B1011101 93
-#define B01011101 93
-#define B1011110 94
-#define B01011110 94
-#define B1011111 95
-#define B01011111 95
-#define B1100000 96
-#define B01100000 96
-#define B1100001 97
-#define B01100001 97
-#define B1100010 98
-#define B01100010 98
-#define B1100011 99
-#define B01100011 99
-#define B1100100 100
-#define B01100100 100
-#define B1100101 101
-#define B01100101 101
-#define B1100110 102
-#define B01100110 102
-#define B1100111 103
-#define B01100111 103
-#define B1101000 104
-#define B01101000 104
-#define B1101001 105
-#define B01101001 105
-#define B1101010 106
-#define B01101010 106
-#define B1101011 107
-#define B01101011 107
-#define B1101100 108
-#define B01101100 108
-#define B1101101 109
-#define B01101101 109
-#define B1101110 110
-#define B01101110 110
-#define B1101111 111
-#define B01101111 111
-#define B1110000 112
-#define B01110000 112
-#define B1110001 113
-#define B01110001 113
-#define B1110010 114
-#define B01110010 114
-#define B1110011 115
-#define B01110011 115
-#define B1110100 116
-#define B01110100 116
-#define B1110101 117
-#define B01110101 117
-#define B1110110 118
-#define B01110110 118
-#define B1110111 119
-#define B01110111 119
-#define B1111000 120
-#define B01111000 120
-#define B1111001 121
-#define B01111001 121
-#define B1111010 122
-#define B01111010 122
-#define B1111011 123
-#define B01111011 123
-#define B1111100 124
-#define B01111100 124
-#define B1111101 125
-#define B01111101 125
-#define B1111110 126
-#define B01111110 126
-#define B1111111 127
-#define B01111111 127
-#define B10000000 128
-#define B10000001 129
-#define B10000010 130
-#define B10000011 131
-#define B10000100 132
-#define B10000101 133
-#define B10000110 134
-#define B10000111 135
-#define B10001000 136
-#define B10001001 137
-#define B10001010 138
-#define B10001011 139
-#define B10001100 140
-#define B10001101 141
-#define B10001110 142
-#define B10001111 143
-#define B10010000 144
-#define B10010001 145
-#define B10010010 146
-#define B10010011 147
-#define B10010100 148
-#define B10010101 149
-#define B10010110 150
-#define B10010111 151
-#define B10011000 152
-#define B10011001 153
-#define B10011010 154
-#define B10011011 155
-#define B10011100 156
-#define B10011101 157
-#define B10011110 158
-#define B10011111 159
-#define B10100000 160
-#define B10100001 161
-#define B10100010 162
-#define B10100011 163
-#define B10100100 164
-#define B10100101 165
-#define B10100110 166
-#define B10100111 167
-#define B10101000 168
-#define B10101001 169
-#define B10101010 170
-#define B10101011 171
-#define B10101100 172
-#define B10101101 173
-#define B10101110 174
-#define B10101111 175
-#define B10110000 176
-#define B10110001 177
-#define B10110010 178
-#define B10110011 179
-#define B10110100 180
-#define B10110101 181
-#define B10110110 182
-#define B10110111 183
-#define B10111000 184
-#define B10111001 185
-#define B10111010 186
-#define B10111011 187
-#define B10111100 188
-#define B10111101 189
-#define B10111110 190
-#define B10111111 191
-#define B11000000 192
-#define B11000001 193
-#define B11000010 194
-#define B11000011 195
-#define B11000100 196
-#define B11000101 197
-#define B11000110 198
-#define B11000111 199
-#define B11001000 200
-#define B11001001 201
-#define B11001010 202
-#define B11001011 203
-#define B11001100 204
-#define B11001101 205
-#define B11001110 206
-#define B11001111 207
-#define B11010000 208
-#define B11010001 209
-#define B11010010 210
-#define B11010011 211
-#define B11010100 212
-#define B11010101 213
-#define B11010110 214
-#define B11010111 215
-#define B11011000 216
-#define B11011001 217
-#define B11011010 218
-#define B11011011 219
-#define B11011100 220
-#define B11011101 221
-#define B11011110 222
-#define B11011111 223
-#define B11100000 224
-#define B11100001 225
-#define B11100010 226
-#define B11100011 227
-#define B11100100 228
-#define B11100101 229
-#define B11100110 230
-#define B11100111 231
-#define B11101000 232
-#define B11101001 233
-#define B11101010 234
-#define B11101011 235
-#define B11101100 236
-#define B11101101 237
-#define B11101110 238
-#define B11101111 239
-#define B11110000 240
-#define B11110001 241
-#define B11110010 242
-#define B11110011 243
-#define B11110100 244
-#define B11110101 245
-#define B11110110 246
-#define B11110111 247
-#define B11111000 248
-#define B11111001 249
-#define B11111010 250
-#define B11111011 251
-#define B11111100 252
-#define B11111101 253
-#define B11111110 254
-#define B11111111 255
-
-#endif
-
-
--- a/POKITTO_HW/HWButtons.cpp	Wed Jun 27 13:14:54 2018 +0000
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,222 +0,0 @@
-/**************************************************************************/
-/*!
-    @file     HWButtons.cpp
-    @author   Jonne Valola
-
-    @section LICENSE
-
-    Software License Agreement (BSD License)
-
-    Copyright (c) 2016, Jonne Valola
-    All rights reserved.
-
-    Redistribution and use in source and binary forms, with or without
-    modification, are permitted provided that the following conditions are met:
-    1. Redistributions of source code must retain the above copyright
-    notice, this list of conditions and the following disclaimer.
-    2. Redistributions in binary form must reproduce the above copyright
-    notice, this list of conditions and the following disclaimer in the
-    documentation and/or other materials provided with the distribution.
-    3. Neither the name of the copyright holders nor the
-    names of its contributors may be used to endorse or promote products
-    derived from this software without specific prior written permission.
-
-    THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS ''AS IS'' AND ANY
-    EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
-    WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
-    DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER BE LIABLE FOR ANY
-    DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-    (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-    LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-    ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-    (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
-    SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-*/
-/**************************************************************************/
-
-#include "HWButtons.h"
-#include "PokittoCore.h"
-#include "PokittoSound.h"
-#include "PokittoDisplay.h"
-
-Pokitto::Sound _s;
-Pokitto::Display _bd;
-
-using namespace mbed;
-
-InterruptIn ABtn(POK_BTN_A_PIN);
-InterruptIn BBtn(POK_BTN_B_PIN);
-InterruptIn CBtn(POK_BTN_C_PIN);
-InterruptIn UBtn(POK_BTN_UP_PIN);
-InterruptIn DBtn(POK_BTN_DOWN_PIN);
-InterruptIn LBtn(POK_BTN_LEFT_PIN);
-InterruptIn RBtn(POK_BTN_RIGHT_PIN);
-
-#define BS_IDLE 0
-#define BS_DOWN 1
-#define BS_UP 2
-
-uint8_t Pokitto::heldStates[NUM_BTN];
-bool vol_control_clicked=false;
-
-void APressed() {
-    Pokitto::heldStates[BTN_A] = 1;
-    }
-void AReleased() {
-    Pokitto::heldStates[BTN_A] = 0;
-    }
-void BPressed() { Pokitto::heldStates[BTN_B] = 1; }
-void BReleased() { Pokitto::heldStates[BTN_B] = 0; }
-void CPressed() {
-    Pokitto::heldStates[BTN_C] = 1;
-    }
-void CReleased() { Pokitto::heldStates[BTN_C] = 0; }
-void UPressed() { Pokitto::heldStates[BTN_UP] = 1; }
-void UReleased() { Pokitto::heldStates[BTN_UP] = 0; }
-void DPressed() { Pokitto::heldStates[BTN_DOWN] = 1; }
-void DReleased() { Pokitto::heldStates[BTN_DOWN] = 0; }
-void RPressed() {
-    /* Hardware volume control */
-    if (Pokitto::heldStates[BTN_C]) _s.volumeUp();
-    else Pokitto::heldStates[BTN_RIGHT] = 1;
-    }
-void RReleased() { Pokitto::heldStates[BTN_RIGHT] = 0; }
-void LPressed() {
-    /* Hardware volume control */
-    if (Pokitto::heldStates[BTN_C]) _s.volumeDown();
-    else Pokitto::heldStates[BTN_LEFT] = 1;
-    }
-void LReleased() { Pokitto::heldStates[BTN_LEFT] = 0; }
-
-static inline void ClearPinInt(LPC_PIN_INT_T *pPININT, uint32_t pins)
-{
-	pPININT->IST = pins;
-}
-
-void PIN_INT0_IRQHandler(void)
-{
-	//Pokitto::heldStates[BTN_A] = 1 - Pokitto::heldStates[BTN_A];
-	//uint32_t  pins = ((LPC_PIN_INT_T*)LPC_PININT)->FALL;
-	//if ((((LPC_PIN_INT_T*)LPC_PININT)->RISE)&(1<<0)) Pokitto::heldStates[BTN_A] = 1;
-	//else if ((((LPC_PIN_INT_T*)LPC_PININT)->FALL)&(1<<0)) Pokitto::heldStates[BTN_A] = 0;
-	Pokitto::heldStates[BTN_A]=ABtn.read();
-	ClearPinInt((LPC_PIN_INT_T *)LPC_PININT, PININTCH(0));
-}
-
-void PIN_INT1_IRQHandler(void)
-{
-	//if ((((LPC_PIN_INT_T*)LPC_PININT)->RISE)&(1<<1)) Pokitto::heldStates[BTN_B] = 1;
-	//else if ((((LPC_PIN_INT_T*)LPC_PININT)->FALL)&(1<<1)) Pokitto::heldStates[BTN_B] = 0;
-	Pokitto::heldStates[BTN_B]=BBtn.read();
-	ClearPinInt((LPC_PIN_INT_T *)LPC_PININT, PININTCH(1));
-}
-
-void PIN_INT2_IRQHandler(void)
-{
-	//if ((((LPC_PIN_INT_T*)LPC_PININT)->RISE)&(1<<2)) Pokitto::heldStates[BTN_C] = 1;
-	//else if ((((LPC_PIN_INT_T*)LPC_PININT)->FALL)&(1<<2)) Pokitto::heldStates[BTN_C] = 0;
-	Pokitto::heldStates[BTN_C]=CBtn.read();
-	ClearPinInt((LPC_PIN_INT_T *)LPC_PININT, PININTCH(2));
-}
-
-void PIN_INT3_IRQHandler(void)
-{
-	//if ((((LPC_PIN_INT_T*)LPC_PININT)->RISE)&(1<<3)) Pokitto::heldStates[BTN_UP] = 1;
-	//else if ((((LPC_PIN_INT_T*)LPC_PININT)->FALL)&(1<<3)) Pokitto::heldStates[BTN_UP] = 0;
-	Pokitto::heldStates[BTN_UP]=UBtn.read();
-	ClearPinInt((LPC_PIN_INT_T *)LPC_PININT, PININTCH(3));
-}
-
-void PIN_INT4_IRQHandler(void)
-{
-	//if ((((LPC_PIN_INT_T*)LPC_PININT)->RISE)&(1<<4)) Pokitto::heldStates[BTN_DOWN] = 1;
-	//else if ((((LPC_PIN_INT_T*)LPC_PININT)->FALL)&(1<<4)) Pokitto::heldStates[BTN_DOWN] = 0;
-	Pokitto::heldStates[BTN_DOWN]=DBtn.read();
-	ClearPinInt((LPC_PIN_INT_T *)LPC_PININT, PININTCH(4));
-}
-
-void PIN_INT5_IRQHandler(void)
-{
-    /* Hardware volume control */
-    //if ((((LPC_PIN_INT_T*)LPC_PININT)->RISE)&(1<<5)) Pokitto::heldStates[BTN_LEFT] = 1;
-	//else if ((((LPC_PIN_INT_T*)LPC_PININT)->FALL)&(1<<5)) Pokitto::heldStates[BTN_LEFT] = 0;
-    Pokitto::heldStates[BTN_C]=CBtn.read();
-    Pokitto::heldStates[BTN_LEFT]=LBtn.read();
-    if (Pokitto::heldStates[BTN_C] && Pokitto::heldStates[BTN_LEFT])
-    {
-        if (!vol_control_clicked) _s.volumeDown();
-        Pokitto::heldStates[BTN_LEFT]=0; //do not do normal button operation
-        vol_control_clicked=true;
-    } else vol_control_clicked=false;
-
-	ClearPinInt((LPC_PIN_INT_T *)LPC_PININT, PININTCH(5));
-}
-
-void PIN_INT6_IRQHandler(void)
-{
-    /* Hardware volume control */
-    //if ((((LPC_PIN_INT_T*)LPC_PININT)->RISE)&(1<<6)) Pokitto::heldStates[BTN_RIGHT] = 1;
-	//else if ((((LPC_PIN_INT_T*)LPC_PININT)->FALL)&(1<<6)) Pokitto::heldStates[BTN_RIGHT] = 0;
-    Pokitto::heldStates[BTN_C]=CBtn.read();
-    Pokitto::heldStates[BTN_RIGHT]=RBtn.read();
-    if (Pokitto::heldStates[BTN_C] && Pokitto::heldStates[BTN_RIGHT])
-    {
-        if (!vol_control_clicked) _s.volumeUp();
-        Pokitto::heldStates[BTN_RIGHT]=0; //do not do normal button operation
-        vol_control_clicked=true;
-    } else vol_control_clicked=false;
-
-	ClearPinInt((LPC_PIN_INT_T *)LPC_PININT, PININTCH(6));
-}
-
-
-void Pokitto::initButtons() {
-  ABtn.fall(&AReleased);
-  ABtn.rise(&APressed);
-  BBtn.fall(&BReleased);
-  BBtn.rise(&BPressed);
-  CBtn.fall(&CReleased);
-  CBtn.rise(&CPressed);
-  UBtn.fall(&UReleased);
-  UBtn.rise(&UPressed);
-  DBtn.fall(&DReleased);
-  DBtn.rise(&DPressed);
-  LBtn.fall(&LReleased);
-  LBtn.rise(&LPressed);
-  RBtn.fall(&RReleased);
-  RBtn.rise(&RPressed);
-  NVIC_SetVector((IRQn_Type)(PIN_INT0_IRQn), (uint32_t)&PIN_INT0_IRQHandler);
-  NVIC_SetVector((IRQn_Type)(PIN_INT1_IRQn), (uint32_t)&PIN_INT1_IRQHandler);
-  NVIC_SetVector((IRQn_Type)(PIN_INT2_IRQn), (uint32_t)&PIN_INT2_IRQHandler);
-  NVIC_SetVector((IRQn_Type)(PIN_INT3_IRQn), (uint32_t)&PIN_INT3_IRQHandler);
-  NVIC_SetVector((IRQn_Type)(PIN_INT4_IRQn), (uint32_t)&PIN_INT4_IRQHandler);
-  NVIC_SetVector((IRQn_Type)(PIN_INT5_IRQn), (uint32_t)&PIN_INT5_IRQHandler);
-  NVIC_SetVector((IRQn_Type)(PIN_INT6_IRQn), (uint32_t)&PIN_INT6_IRQHandler);
-}
-
-uint8_t Pokitto::Core::aBtn() {
-    return Pokitto::heldStates[BTN_A];
-}
-
-uint8_t Pokitto::Core::bBtn() {
-    return Pokitto::heldStates[BTN_B];
-}
-
-uint8_t Pokitto::Core::cBtn() {
-    return Pokitto::heldStates[BTN_C];
-}
-
-uint8_t Pokitto::Core::upBtn() {
-    return Pokitto::heldStates[BTN_UP];
-}
-uint8_t Pokitto::Core::downBtn() {
-    return Pokitto::heldStates[BTN_DOWN];
-}
-
-uint8_t Pokitto::Core::leftBtn() {
-    return Pokitto::heldStates[BTN_LEFT];
-}
-uint8_t Pokitto::Core::rightBtn() {
-    return Pokitto::heldStates[BTN_RIGHT];
-}
-
--- a/POKITTO_HW/HWButtons.h	Wed Jun 27 13:14:54 2018 +0000
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,81 +0,0 @@
-/**************************************************************************/
-/*!
-    @file     HWButtons.h
-    @author   Jonne Valola
-
-    @section LICENSE
-
-    Software License Agreement (BSD License)
-
-    Copyright (c) 2016, Jonne Valola
-    All rights reserved.
-
-    Redistribution and use in source and binary forms, with or without
-    modification, are permitted provided that the following conditions are met:
-    1. Redistributions of source code must retain the above copyright
-    notice, this list of conditions and the following disclaimer.
-    2. Redistributions in binary form must reproduce the above copyright
-    notice, this list of conditions and the following disclaimer in the
-    documentation and/or other materials provided with the distribution.
-    3. Neither the name of the copyright holders nor the
-    names of its contributors may be used to endorse or promote products
-    derived from this software without specific prior written permission.
-
-    THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS ''AS IS'' AND ANY
-    EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
-    WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
-    DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER BE LIABLE FOR ANY
-    DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-    (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-    LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-    ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-    (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
-    SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-*/
-/**************************************************************************/
-#ifndef HWBUTTONS_H
-#define HWBUTTONS_H
-
-#include "mbed.h"
-#include "Pokitto_settings.h"
-
-#define BTN_UP      1
-#define BTN_RIGHT   2
-#define BTN_DOWN    3
-#define BTN_LEFT    0
-#define BTN_A       4
-#define BTN_B       5
-#define BTN_C       6
-#define NUM_BTN     7
-
-typedef struct {			/*!< PIN_INT Structure */
-	__IO uint32_t ISEL;		/*!< Pin Interrupt Mode register */
-	__IO uint32_t IENR;		/*!< Pin Interrupt Enable (Rising) register */
-	__IO uint32_t SIENR;	/*!< Set Pin Interrupt Enable (Rising) register */
-	__IO uint32_t CIENR;	/*!< Clear Pin Interrupt Enable (Rising) register */
-	__IO uint32_t IENF;		/*!< Pin Interrupt Enable Falling Edge / Active Level register */
-	__IO uint32_t SIENF;	/*!< Set Pin Interrupt Enable Falling Edge / Active Level register */
-	__IO uint32_t CIENF;	/*!< Clear Pin Interrupt Enable Falling Edge / Active Level address */
-	__IO uint32_t RISE;		/*!< Pin Interrupt Rising Edge register */
-	__IO uint32_t FALL;		/*!< Pin Interrupt Falling Edge register */
-	__IO uint32_t IST;		/*!< Pin Interrupt Status register */
-	__IO uint32_t PMCTRL;	/*!< GPIO pattern match interrupt control register          */
-	__IO uint32_t PMSRC;	/*!< GPIO pattern match interrupt bit-slice source register */
-	__IO uint32_t PMCFG;	/*!< GPIO pattern match interrupt bit slice configuration register */
-} LPC_PIN_INT_T;
-
-#define LPC_PININT          0xA0004000
-#define PININTCH(ch)      (1 << (ch))
-
-namespace Pokitto {
-
-extern uint8_t heldStates[];
-extern void initButtons();
-extern void pollButtons();
-
-
-} // namespace Pokitto
-
-#endif //HWBUTTONS
-
-
--- a/POKITTO_HW/HWLCD.cpp	Wed Jun 27 13:14:54 2018 +0000
+++ b/POKITTO_HW/HWLCD.cpp	Sun Jul 01 06:32:10 2018 +0000
@@ -37,10 +37,8 @@
 #include "HWLCD.h" //HWLCD.h" #include "HWLCD.h"
 #include "Pokitto_settings.h"
 
-#ifndef DISABLEAVRMIN
-#define max(a,b) ((a)>(b)?(a):(b))
-#define min(a,b) ((a)<(b)?(a):(b))
-#endif // DISABLEAVRMIN
+#define avrmax(a,b) ((a)>(b)?(a):(b))
+#define avrmin(a,b) ((a)<(b)?(a):(b))
 
 #ifdef DISABLEAVRMIN
 #include <algorithm>
@@ -59,6 +57,7 @@
     pwmout_t backlightpwm;
 #endif
 
+volatile uint32_t *LCD = reinterpret_cast< volatile uint32_t * >(0xA0002188);
 
 /**************************************************************************/
 /*!
@@ -749,8 +748,8 @@
                     continue;
 
                 // Detect the dirty rect x-span by combining the previous and current sprite position.
-                int16_t sprDirtyXMin = min(sprx, sprOldX);
-                int16_t sprDirtyXMax = max(sprx, sprOldX);
+                int16_t sprDirtyXMin = avrmin(sprx, sprOldX);
+                int16_t sprDirtyXMax = avrmax(sprx, sprOldX);
                 if (isCurrentSpriteOutOfScreen)
                     sprDirtyXMax = sprOldX;
                 if (isOldSpriteOutOfScreen)
@@ -763,15 +762,15 @@
                     // *** COMBINE DIRTY RECTS FOR THIS SCANLINE GROUP ***
 
                     // Dirty rect
-                    int sprDirtyYMin = min(spry, sprOldY);
-                    sprDirtyYMin = max((int)sprDirtyYMin, 0);
-                    int sprDirtyYMax = max(spry, sprOldY);
+                    int sprDirtyYMin = avrmin(spry, sprOldY);
+                    sprDirtyYMin = avrmax((int)sprDirtyYMin, 0);
+                    int sprDirtyYMax = avrmax(spry, sprOldY);
                     if (isCurrentSpriteOutOfScreen)
                         sprDirtyYMax = sprOldY;
                     if (isOldSpriteOutOfScreen)
                         sprDirtyYMax = spry;
                     int sprDirtyYMaxEnd = sprDirtyYMax + sprh - 1;
-                    sprDirtyYMaxEnd = min(sprDirtyYMaxEnd, LCDHEIGHT - 1);  // Should use LCDHEIGHT instead of screenH? Same with other screen* ?
+                    sprDirtyYMaxEnd = avrmin(sprDirtyYMaxEnd, LCDHEIGHT - 1);  // Should use LCDHEIGHT instead of screenH? Same with other screen* ?
 
                     // Get the scanline min and max y values for drawing
                     if (sprDirtyYMin < scanlineMinY)
@@ -948,91 +947,160 @@
     #endif
 }
 
-void Pokitto::lcdRefreshMode2(uint8_t * scrbuf, uint16_t* paletteptr) {
-uint16_t x,y;
-uint16_t scanline[2][88]; // read two nibbles = pixels at a time
-uint8_t *d;
+  
+#define MODE2_INNER_LOOP_B				\
+  "	ldm %[scanline]!, {%[c]}"   "\n"		\
+	       "	str %[c], [%[LCD], 0]"    "\n"	\
+	       "	str %[t], [%[LCD], 124]"  "\n"	\
+	       "	movs %[c], 252"   "\n"		\
+	       "	str %[t], [%[LCD], %[c]]" "\n"	\
+	       "	str %[t], [%[LCD], 124]"  "\n"	\
+	       "	subs %[x], 1"             "\n"	\
+	       "	str %[t], [%[LCD], %[c]]" "\n"	\
+    
+
+void Pokitto::lcdRefreshMode2(uint8_t * scrbuf, uint16_t* paletteptr ) {
+  uint32_t x,y,byte,c,t=1<<12;
+  uint32_t scanline[110];
+
+  write_command(0x03); write_data(0x1038);
+  write_command(0x20);  // Horizontal DRAM Address
+  write_data(0);  // 0
+  write_command(0x21);  // Vertical DRAM Address
+  write_data(1);
+  write_command(0x22); // write data to DRAM
+  CLR_CS_SET_CD_RD_WR;
+  SET_MASK_P2;
+
+#ifndef __ARMCC_VERSION
+   asm volatile(
+	 ".syntax unified"         "\n"
+	 
+	 "mov r10, %[scanline]"    "\n"
+	 "mov r11, %[t]"           "\n"
+	 
+	 "mode2OuterLoop:"        "\n"
+	 
+	 "movs %[x], 110"          "\n"
+	 "mode2InnerLoopA:"
+
+
+	 "	ldrb %[byte], [%[scrbuf],0]"   "\n"				
+	 "	lsrs %[c], %[byte], 4"    "\n"
+
+	 "	movs %[t], 15" "\n"
+	 "	ands %[byte], %[t]"    "\n"		
+	 
+	 "	lsls %[c], 1"             "\n"			
+	 "	ldrh %[t], [%[paletteptr], %[c]]"      "\n"	
+	 "	lsls %[t], %[t], 3"       "\n"			
+	 "	str %[t], [%[LCD], 0]"    "\n"			
+	 "	mov %[c], r11" "\n"				
+	 "	str %[c], [%[LCD], 124]"  "\n"			
+	 "	stm %[scanline]!, {%[t]}" "\n"			
+	 "	movs %[t], 252"   "\n"				
+	 "	str %[c], [%[LCD], %[t]]" "\n"			
+	 "	str %[c], [%[LCD], 124]"  "\n"			
+	 "	lsls %[byte], %[byte], 1"             "\n"			
+	 "	str %[c], [%[LCD], %[t]]" "\n"
 
-write_command(0x20);  // Horizontal DRAM Address
-write_data(0);  // 0
-write_command(0x21);  // Vertical DRAM Address
-write_data(0);
-write_command(0x22); // write data to DRAM
-CLR_CS_SET_CD_RD_WR;
+	 "	ldrh %[t], [%[paletteptr], %[byte]]"      "\n"	
+	 "	lsls %[t], %[t], 3"       "\n"			
+	 "	str %[t], [%[LCD], 0]"    "\n"			
+	 "	mov %[c], r11" "\n"				
+	 "	str %[c], [%[LCD], 124]"  "\n"			
+	 "	stm %[scanline]!, {%[t]}" "\n"			
+	 "	movs %[t], 252"   "\n"				
+	 "	str %[c], [%[LCD], %[t]]" "\n"			
+	 "	str %[c], [%[LCD], 124]"  "\n"			
+	 "	adds %[scrbuf], %[scrbuf], 1" "\n"		
+	 "	str %[c], [%[LCD], %[t]]" "\n"
+	 
+	 "	subs %[x], 2"          "\n"	
+	 "	bne mode2InnerLoopA"  "\n"
 
-for(x=0;x<110;x+=2)
+	 "mov %[scanline], r10"    "\n"
+	 "movs %[x], 110"          "\n"
+	 "mov %[t], r11"           "\n"
+	 "mode2InnerLoopB:"
+	 MODE2_INNER_LOOP_B	 
+	 MODE2_INNER_LOOP_B	 
+	 MODE2_INNER_LOOP_B	 
+	 MODE2_INNER_LOOP_B	 
+	 MODE2_INNER_LOOP_B	 
+	 MODE2_INNER_LOOP_B	 
+	 MODE2_INNER_LOOP_B	 
+	 MODE2_INNER_LOOP_B	 
+	 MODE2_INNER_LOOP_B	 
+	 MODE2_INNER_LOOP_B	 
+	 "	bne mode2InnerLoopB"     "\n"
+	 
+	 "mov %[scanline], r10"    "\n"
+	 "movs %[t], 1"              "\n"
+	 "movs %[c], 88"             "\n"
+	 "add %[y], %[t]"            "\n" // y++... derpy, but it's the outer loop
+	 "cmp %[y], %[c]"            "\n"
+	 "bne mode2OuterLoop"       "\n" // if y != 88, loop
+	 
+	 : // outputs
+	   [c]"+l" (c),
+	   [t]"+l" (t),
+	   [x]"+l" (x),
+	   [y]"+h" (y),  // +:Read-Write l:lower (0-7) register
+	   [scrbuf]"+l" (scrbuf)
+	   
+	 : // inputs
+	   [LCD]"l" (0xA0002188),
+	   [scanline]"l" (scanline),
+	   [paletteptr]"l" (paletteptr),
+	   [byte]"l" (byte)
+	 : // clobbers
+	   "cc", "r10", "r11"
+       );
+
+ 
+#else
+uint8_t* d = scrbuf;// point to beginning of line in data
+
+  #ifdef PROJ_SHOW_FPS_COUNTER
+  setDRAMptr(0, 8);
+  wait_us(200); // Add wait to compensate skipping of 8 lines. Makes FPS counter to show the correct value.
+  for(y=4;y<88;y++)
+  #else
+  for(y=0;y<88;y++)
+  #endif
   {
-    d = scrbuf+(x>>1);// point to beginning of line in data
-    /** find colours in one scanline **/
+
+
     uint8_t s=0;
-    for(y=0;y<88;y++)
+    for(x=0;x<110;x+=2)
     {
-    uint8_t t = *d >> 4; // higher nibble
-    uint8_t t2 = *d & 0xF; // lower nibble
-    /** higher nibble = left pixel in pixel pair **/
-    scanline[0][s] = paletteptr[t];
-    scanline[1][s++] = paletteptr[t2];
-    /** testing only **/
-    //scanline[0][s] = 0xFFFF*(s&1);
-    //scanline[1][s] = 0xFFFF*(!(s&1));
-    //s++;
-    /** until here **/
-    d+=110/2; // jump to read byte directly below in screenbuffer
-    }
-    s=0;
-    /** draw scanlines **/
-    /** leftmost scanline twice**/
-
-    #ifdef PROJ_SHOW_FPS_COUNTER
-    if (x<4) continue;
-    setDRAMptr(x<<1, 0);
-    #endif
-
-    for (s=0;s<88;) {
-        setup_data_16(scanline[0][s++]);CLR_WR;SET_WR;CLR_WR;SET_WR;
-        setup_data_16(scanline[0][s++]);CLR_WR;SET_WR;CLR_WR;SET_WR;
-        setup_data_16(scanline[0][s++]);CLR_WR;SET_WR;CLR_WR;SET_WR;
-        setup_data_16(scanline[0][s++]);CLR_WR;SET_WR;CLR_WR;SET_WR;
-        setup_data_16(scanline[0][s++]);CLR_WR;SET_WR;CLR_WR;SET_WR;
-        setup_data_16(scanline[0][s++]);CLR_WR;SET_WR;CLR_WR;SET_WR;
-        setup_data_16(scanline[0][s++]);CLR_WR;SET_WR;CLR_WR;SET_WR;
-        setup_data_16(scanline[0][s++]);CLR_WR;SET_WR;CLR_WR;SET_WR;
+      uint8_t t = *d++;
+      uint32_t color;
+      color = uint32_t(paletteptr[t>>4])<<3;
+      scanline[s]=*LCD=color;TGL_WR_OP(s++);TGL_WR;
+      color = uint32_t(paletteptr[t&0xF])<<3;
+      scanline[s]=*LCD=color;TGL_WR_OP(s++);TGL_WR;
     }
 
-    for (s=0;s<88;) {
-        setup_data_16(scanline[0][s++]);CLR_WR;SET_WR;CLR_WR;SET_WR;
-        setup_data_16(scanline[0][s++]);CLR_WR;SET_WR;CLR_WR;SET_WR;
-        setup_data_16(scanline[0][s++]);CLR_WR;SET_WR;CLR_WR;SET_WR;
-        setup_data_16(scanline[0][s++]);CLR_WR;SET_WR;CLR_WR;SET_WR;
-        setup_data_16(scanline[0][s++]);CLR_WR;SET_WR;CLR_WR;SET_WR;
-        setup_data_16(scanline[0][s++]);CLR_WR;SET_WR;CLR_WR;SET_WR;
-        setup_data_16(scanline[0][s++]);CLR_WR;SET_WR;CLR_WR;SET_WR;
-        setup_data_16(scanline[0][s++]);CLR_WR;SET_WR;CLR_WR;SET_WR;
-    }
-    /** rightmost scanline twice**/
-    //setDRAMptr(xptr++,yoffset);
-    for (s=0;s<88;) {
-        setup_data_16(scanline[1][s++]);CLR_WR;SET_WR;CLR_WR;SET_WR;
-        setup_data_16(scanline[1][s++]);CLR_WR;SET_WR;CLR_WR;SET_WR;
-        setup_data_16(scanline[1][s++]);CLR_WR;SET_WR;CLR_WR;SET_WR;
-        setup_data_16(scanline[1][s++]);CLR_WR;SET_WR;CLR_WR;SET_WR;
-        setup_data_16(scanline[1][s++]);CLR_WR;SET_WR;CLR_WR;SET_WR;
-        setup_data_16(scanline[1][s++]);CLR_WR;SET_WR;CLR_WR;SET_WR;
-        setup_data_16(scanline[1][s++]);CLR_WR;SET_WR;CLR_WR;SET_WR;
-        setup_data_16(scanline[1][s++]);CLR_WR;SET_WR;CLR_WR;SET_WR;
+    s=0;
+    for (s=0;s<110;) {
+      *LCD = (scanline[s]);TGL_WR_OP(s++);TGL_WR;
+      *LCD = (scanline[s]);TGL_WR_OP(s++);TGL_WR;
+      *LCD = (scanline[s]);TGL_WR_OP(s++);TGL_WR;
+      *LCD = (scanline[s]);TGL_WR_OP(s++);TGL_WR;
+      *LCD = (scanline[s]);TGL_WR_OP(s++);TGL_WR;
+      *LCD = (scanline[s]);TGL_WR_OP(s++);TGL_WR;
+      *LCD = (scanline[s]);TGL_WR_OP(s++);TGL_WR;
+      *LCD = (scanline[s]);TGL_WR_OP(s++);TGL_WR;
+      *LCD = (scanline[s]);TGL_WR_OP(s++);TGL_WR;
+      *LCD = (scanline[s]);TGL_WR_OP(s++);TGL_WR;
     }
 
-    for (s=0;s<88;) {
-        setup_data_16(scanline[1][s++]);CLR_WR;SET_WR;CLR_WR;SET_WR;
-        setup_data_16(scanline[1][s++]);CLR_WR;SET_WR;CLR_WR;SET_WR;
-        setup_data_16(scanline[1][s++]);CLR_WR;SET_WR;CLR_WR;SET_WR;
-        setup_data_16(scanline[1][s++]);CLR_WR;SET_WR;CLR_WR;SET_WR;
-        setup_data_16(scanline[1][s++]);CLR_WR;SET_WR;CLR_WR;SET_WR;
-        setup_data_16(scanline[1][s++]);CLR_WR;SET_WR;CLR_WR;SET_WR;
-        setup_data_16(scanline[1][s++]);CLR_WR;SET_WR;CLR_WR;SET_WR;
-        setup_data_16(scanline[1][s++]);CLR_WR;SET_WR;CLR_WR;SET_WR;
-    }
   }
+#endif
+
+ CLR_MASK_P2;
 }
 
 void Pokitto::lcdRefreshMode3(uint8_t * scrbuf, uint16_t* paletteptr) {
@@ -1646,75 +1714,141 @@
     #endif
 }
 
+#define MODE13_INNER_LOOP_A						\
+  "	ldrb %[t], [%[scrbuf],0]"   "\n"				\
+	       "	add %[t], %[t], %[offset]"  "\n"		\
+	       "	uxtb %[c], %[t] " "\n"				\
+	       "	lsls %[c], 1"             "\n"			\
+	       "	ldrh %[t], [%[paletteptr], %[c]]"      "\n"	\
+	       "	lsls %[t], %[t], 3"       "\n"			\
+	       "	str %[t], [%[LCD], 0]"    "\n"			\
+	       "	mov %[c], r11" "\n"				\
+	       "	str %[c], [%[LCD], 124]"  "\n"			\
+	       "	stm %[scanline]!, {%[t]}" "\n"			\
+	       "	movs %[t], 252"   "\n"				\
+	       "	str %[c], [%[LCD], %[t]]" "\n"			\
+	       "	str %[c], [%[LCD], 124]"  "\n"			\
+	       "	adds %[scrbuf], %[scrbuf], 1" "\n"		\
+	       "	str %[c], [%[LCD], %[t]]" "\n"
+  
+#define MODE13_INNER_LOOP_B				\
+  "	ldm %[scanline]!, {%[c]}"   "\n"		\
+	       "	str %[c], [%[LCD], 0]"    "\n"	\
+	       "	str %[t], [%[LCD], 124]"  "\n"	\
+	       "	movs %[c], 252"   "\n"		\
+	       "	str %[t], [%[LCD], %[c]]" "\n"	\
+	       "	str %[t], [%[LCD], 124]"  "\n"	\
+	       "	subs %[x], 1"             "\n"	\
+	       "	str %[t], [%[LCD], %[c]]" "\n"	\
 
-void Pokitto::lcdRefreshMode13(uint8_t * scrbuf, uint16_t* paletteptr, uint8_t offset){
-uint16_t x,y;
-uint16_t scanline[2][110]; // read two nibbles = pixels at a time
-uint8_t *d;
-
-write_command(0x20); write_data(0);
-write_command(0x21); write_data(0);
-write_command(0x22);
-CLR_CS_SET_CD_RD_WR;
+ 
+ void Pokitto::lcdRefreshMode13(uint8_t * scrbuf, uint16_t* paletteptr, uint8_t offset){
+   uint32_t scanline[110]; // read two nibbles = pixels at a time
+   
+   write_command_16(0x03); write_data_16(0x1038);
+   write_command(0x20); write_data(0);
+   write_command(0x21); write_data(1);
+   write_command(0x22);
+   CLR_CS_SET_CD_RD_WR;
+   SET_MASK_P2;
+   
+   uint32_t x, y=0, c, t;
+   
+#ifndef __ARMCC_VERSION
+   asm volatile(
+	 ".syntax unified"         "\n"
+	 
+	 "mov r10, %[scanline]"    "\n"
+	 
+	 "movs %[t], 1"            "\n"
+	 "lsls %[t], %[t], 12"     "\n"
+	 "mov r11, %[t]"           "\n"
+	 
+	 "mode13OuterLoop:"        "\n"
+	 
+	 "movs %[x], 110"          "\n"
+	 "mode13InnerLoopA:"
+	 MODE13_INNER_LOOP_A
+	 MODE13_INNER_LOOP_A
+	 "	subs %[x], 2"          "\n"	
+	 "	bne mode13InnerLoopA"  "\n"
 
-for(x=0;x<110;x+=2)
-  {
-    d = scrbuf+x;// point to beginning of line in data
-    uint8_t s=0;
-    for(y=0;y<88;y++)
-    {
-        uint8_t t = *d;
-        uint8_t t1 = *(d+1);
-        scanline[0][s] = paletteptr[(t+offset)&255];
-        scanline[1][s++] = paletteptr[(t1+offset)&255];
-        d+=110; // jump to read byte directly below in screenbuffer
-    }
-    s=0;
-    for (s=0;s<88;) {
-        setup_data_16(scanline[0][s++]);CLR_WR;SET_WR;CLR_WR;SET_WR;
-        setup_data_16(scanline[0][s++]);CLR_WR;SET_WR;CLR_WR;SET_WR;
-        setup_data_16(scanline[0][s++]);CLR_WR;SET_WR;CLR_WR;SET_WR;
-        setup_data_16(scanline[0][s++]);CLR_WR;SET_WR;CLR_WR;SET_WR;
-        setup_data_16(scanline[0][s++]);CLR_WR;SET_WR;CLR_WR;SET_WR;
-        setup_data_16(scanline[0][s++]);CLR_WR;SET_WR;CLR_WR;SET_WR;
-        setup_data_16(scanline[0][s++]);CLR_WR;SET_WR;CLR_WR;SET_WR;
-        setup_data_16(scanline[0][s++]);CLR_WR;SET_WR;CLR_WR;SET_WR;
-    }
-    for (s=0;s<88;) {
-        setup_data_16(scanline[0][s++]);CLR_WR;SET_WR;CLR_WR;SET_WR;
-        setup_data_16(scanline[0][s++]);CLR_WR;SET_WR;CLR_WR;SET_WR;
-        setup_data_16(scanline[0][s++]);CLR_WR;SET_WR;CLR_WR;SET_WR;
-        setup_data_16(scanline[0][s++]);CLR_WR;SET_WR;CLR_WR;SET_WR;
-        setup_data_16(scanline[0][s++]);CLR_WR;SET_WR;CLR_WR;SET_WR;
-        setup_data_16(scanline[0][s++]);CLR_WR;SET_WR;CLR_WR;SET_WR;
-        setup_data_16(scanline[0][s++]);CLR_WR;SET_WR;CLR_WR;SET_WR;
-        setup_data_16(scanline[0][s++]);CLR_WR;SET_WR;CLR_WR;SET_WR;
-    }
-    for (s=0;s<88;) {
-        setup_data_16(scanline[1][s++]);CLR_WR;SET_WR;CLR_WR;SET_WR;
-        setup_data_16(scanline[1][s++]);CLR_WR;SET_WR;CLR_WR;SET_WR;
-        setup_data_16(scanline[1][s++]);CLR_WR;SET_WR;CLR_WR;SET_WR;
-        setup_data_16(scanline[1][s++]);CLR_WR;SET_WR;CLR_WR;SET_WR;
-        setup_data_16(scanline[1][s++]);CLR_WR;SET_WR;CLR_WR;SET_WR;
-        setup_data_16(scanline[1][s++]);CLR_WR;SET_WR;CLR_WR;SET_WR;
-        setup_data_16(scanline[1][s++]);CLR_WR;SET_WR;CLR_WR;SET_WR;
-        setup_data_16(scanline[1][s++]);CLR_WR;SET_WR;CLR_WR;SET_WR;
-    }
-    for (s=0;s<88;) {
-        setup_data_16(scanline[1][s++]);CLR_WR;SET_WR;CLR_WR;SET_WR;
-        setup_data_16(scanline[1][s++]);CLR_WR;SET_WR;CLR_WR;SET_WR;
-        setup_data_16(scanline[1][s++]);CLR_WR;SET_WR;CLR_WR;SET_WR;
-        setup_data_16(scanline[1][s++]);CLR_WR;SET_WR;CLR_WR;SET_WR;
-        setup_data_16(scanline[1][s++]);CLR_WR;SET_WR;CLR_WR;SET_WR;
-        setup_data_16(scanline[1][s++]);CLR_WR;SET_WR;CLR_WR;SET_WR;
-        setup_data_16(scanline[1][s++]);CLR_WR;SET_WR;CLR_WR;SET_WR;
-        setup_data_16(scanline[1][s++]);CLR_WR;SET_WR;CLR_WR;SET_WR;
-    }
-  }
+	 "mov %[scanline], r10"    "\n"
+	 "movs %[x], 110"          "\n"
+	 "mov %[t], r11"           "\n"
+	 "mode13InnerLoopB:"
+	 MODE13_INNER_LOOP_B	 
+	 MODE13_INNER_LOOP_B	 
+	 MODE13_INNER_LOOP_B	 
+	 MODE13_INNER_LOOP_B	 
+	 MODE13_INNER_LOOP_B	 
+	 MODE13_INNER_LOOP_B	 
+	 MODE13_INNER_LOOP_B	 
+	 MODE13_INNER_LOOP_B	 
+	 MODE13_INNER_LOOP_B	 
+	 MODE13_INNER_LOOP_B	 
+	 "	bne mode13InnerLoopB"     "\n"
+	 
+	 "mov %[scanline], r10"    "\n"
+	 "movs %[t], 1"              "\n"
+	 "movs %[c], 88"             "\n"
+	 "add %[y], %[t]"            "\n" // y++... derpy, but it's the outer loop
+	 "cmp %[y], %[c]"            "\n"
+	 "bne mode13OuterLoop"       "\n" // if y != 88, loop
+	 
+	 : // outputs
+	   [c]"+l" (c),
+	   [t]"+l" (t),
+	   [x]"+l" (x),
+	   [y]"+h" (y),  // +:Read-Write l:lower (0-7) register
+	   [scrbuf]"+l" (scrbuf)
+	   
+	 : // inputs
+	   [LCD]"l" (0xA0002188),
+	   [scanline]"l" (scanline),
+	   [paletteptr]"l" (paletteptr),
+	   [offset]"l" (offset)
+	 : // clobbers
+	   "cc", "r10", "r11"
+       );
 
-}
-
-
+#else
+   uint8_t* d = scrbuf;// point to beginning of line in data
+   for(y=0;y<88;y++){
+     
+     uint32_t* s = scanline;
+     
+     for(x=0;x<110;x+=10){
+       *LCD = *s = paletteptr[(*d + offset)&255]<<3; TGL_WR_OP(s++);TGL_WR_OP(d++);	
+       *LCD = *s = paletteptr[(*d + offset)&255]<<3; TGL_WR_OP(s++);TGL_WR_OP(d++);	
+       *LCD = *s = paletteptr[(*d + offset)&255]<<3; TGL_WR_OP(s++);TGL_WR_OP(d++);	
+       *LCD = *s = paletteptr[(*d + offset)&255]<<3; TGL_WR_OP(s++);TGL_WR_OP(d++);	
+       *LCD = *s = paletteptr[(*d + offset)&255]<<3; TGL_WR_OP(s++);TGL_WR_OP(d++);	
+       *LCD = *s = paletteptr[(*d + offset)&255]<<3; TGL_WR_OP(s++);TGL_WR_OP(d++);	
+       *LCD = *s = paletteptr[(*d + offset)&255]<<3; TGL_WR_OP(s++);TGL_WR_OP(d++);	
+       *LCD = *s = paletteptr[(*d + offset)&255]<<3; TGL_WR_OP(s++);TGL_WR_OP(d++);	
+       *LCD = *s = paletteptr[(*d + offset)&255]<<3; TGL_WR_OP(s++);TGL_WR_OP(d++);	
+       *LCD = *s = paletteptr[(*d + offset)&255]<<3; TGL_WR_OP(s++);TGL_WR_OP(d++);	
+     }
+     
+     s = scanline;
+     uint32_t c = *s;
+     for(x=0;x<110;x+=10){
+       *LCD = c; TGL_WR_OP(s++);TGL_WR_OP(c=*s);
+       *LCD = c; TGL_WR_OP(s++);TGL_WR_OP(c=*s);
+       *LCD = c; TGL_WR_OP(s++);TGL_WR_OP(c=*s);
+       *LCD = c; TGL_WR_OP(s++);TGL_WR_OP(c=*s);
+       *LCD = c; TGL_WR_OP(s++);TGL_WR_OP(c=*s);
+       *LCD = c; TGL_WR_OP(s++);TGL_WR_OP(c=*s);
+       *LCD = c; TGL_WR_OP(s++);TGL_WR_OP(c=*s);
+       *LCD = c; TGL_WR_OP(s++);TGL_WR_OP(c=*s);
+       *LCD = c; TGL_WR_OP(s++);TGL_WR_OP(c=*s);
+       *LCD = c; TGL_WR_OP(s++);TGL_WR_OP(c=*s);
+     }
+   
+   }
+#endif
+ }
 
 void Pokitto::lcdRefreshMode14(uint8_t * scrbuf, uint16_t* paletteptr) {
 uint16_t x,y,data,xptr;
--- a/POKITTO_HW/HWLCD.h	Wed Jun 27 13:14:54 2018 +0000
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,218 +0,0 @@
-/**************************************************************************/
-/*!
-    @file     HWLCD.h
-    @author   Jonne Valola
-
-    @section LICENSE
-
-    Software License Agreement (BSD License)
-
-    Copyright (c) 2016, Jonne Valola
-    All rights reserved.
-
-    Redistribution and use in source and binary forms, with or without
-    modification, are permitted provided that the following conditions are met:
-    1. Redistributions of source code must retain the above copyright
-    notice, this list of conditions and the following disclaimer.
-    2. Redistributions in binary form must reproduce the above copyright
-    notice, this list of conditions and the following disclaimer in the
-    documentation and/or other materials provided with the distribution.
-    3. Neither the name of the copyright holders nor the
-    names of its contributors may be used to endorse or promote products
-    derived from this software without specific prior written permission.
-
-    THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS ''AS IS'' AND ANY
-    EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
-    WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
-    DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER BE LIABLE FOR ANY
-    DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-    (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-    LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-    ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-    (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
-    SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-*/
-/**************************************************************************/
-
-#ifndef __HWLCD_H__
-#define __HWLCD_H__
-
-#include "mbed.h"
-#include "gpio_api.h"
-#include "pinmap.h"
-
-#define write_command write_command_16
-#define write_data write_data_16
-
-namespace Pokitto {
-
-struct SpriteInfo {
-    const uint8_t* bitmapData;
-    int16_t x;
-    int16_t y;
-    int16_t oldx;
-    int16_t oldy;
-    uint8_t w;
-    uint8_t h;
-    uint16_t palette[4];
-};
-
-extern void setDRAMpoint(uint8_t, uint8_t);
-extern void pumpDRAMdata(uint16_t*, uint16_t);
-extern void initBacklight();
-extern void setBacklight(float);
-extern void lcdFillSurface(uint16_t);
-extern void lcdPixel(int16_t x, int16_t y, uint16_t c);
-extern void setWindow(uint8_t x1, uint8_t y1, uint8_t x2, uint8_t y2);
-extern void lcdTile(int16_t x0, int16_t y0, int16_t width, int16_t height, uint16_t* gfx);
-extern void lcdRectangle(int16_t x, int16_t y,int16_t x2, int16_t y2, uint16_t color);
-extern void lcdInit();
-extern void lcdSleep();
-extern void lcdWakeUp();
-extern void lcdRefresh(uint8_t *, uint16_t*);
-extern void lcdRefreshAB(uint8_t *, uint16_t*);
-extern void lcdRefreshMode14(uint8_t *, uint16_t*);
-extern void lcdRefreshGB(uint8_t *, uint16_t*);
-extern void lcdRefreshMode1(uint8_t* scrbuf, uint8_t updRectX, uint8_t updRectY, uint8_t updRectW, uint8_t updRectH, uint16_t* paletteptr);
-extern void lcdRefreshMode1Spr(uint8_t * scrbuf, uint8_t screenx, uint8_t screeny, uint8_t screenw, uint8_t screenh, uint16_t* paletteptr, Pokitto::SpriteInfo* sprites, bool drawSpritesOnly);
-extern void lcdRefreshMode2(uint8_t *, uint16_t*);
-extern void lcdRefreshMode3(uint8_t *, uint16_t*);
-extern void lcdRefreshModeGBC(uint8_t *, uint16_t*);
-extern void lcdRefreshMode13(uint8_t *, uint16_t*, uint8_t);
- 
-extern void lcdRefreshMode15(uint16_t*, uint8_t*);
- 
-
-/** Update LCD from 1-bit tile mode */
-extern void lcdRefreshT1(uint8_t*, uint8_t*, uint8_t*, uint16_t*);
-extern void lcdClear();
-extern void lcdFill(uint16_t);
-/** Blit one word of data*/
-extern void blitWord(uint16_t);
-
-/**************************************************************************/
-/**                          PINS AND PORTS                              **/
-/**************************************************************************/
-
-#if POK_BOARDREV == 1
-/** 2-layer board version 1.3 **/
- #define LCD_CD_PORT           0
- #define LCD_CD_PIN            2
- #define LCD_WR_PORT           1
- #define LCD_WR_PIN            23
- #define LCD_RD_PORT           1
- #define LCD_RD_PIN            24
- #define LCD_RES_PORT          1
- #define LCD_RES_PIN           28
-#else
-/** 4-layer board version 2.1 **/
- #define LCD_CD_PORT           0
- #define LCD_CD_PIN            2
- #define LCD_WR_PORT           1
- #define LCD_WR_PIN            12
- #define LCD_RD_PORT           1
- #define LCD_RD_PIN            24
- #define LCD_RES_PORT          1
- #define LCD_RES_PIN           0
-#endif
-
-/**************************************************************************/
-/**                          LCD CONTROL MACROS                          **/
-/**************************************************************************/
-
-#define CLR_RESET LPC_GPIO_PORT->CLR[LCD_RES_PORT] = 1 << LCD_RES_PIN; //RST = (0); // Clear pin
-#define SET_RESET LPC_GPIO_PORT->SET[LCD_RES_PORT] = 1 << LCD_RES_PIN; // RST = (1); // Set pin
-
-#define CLR_CD { LPC_GPIO_PORT->CLR[LCD_CD_PORT] = 1 << LCD_CD_PIN; } // RS = (0); // Clear pin
-#define SET_CD { LPC_GPIO_PORT->SET[LCD_CD_PORT] = 1 << LCD_CD_PIN; }// RS = (1); // Set pin
-
-#define CLR_WR { LPC_GPIO_PORT->CLR[LCD_WR_PORT] = 1 << LCD_WR_PIN;__asm("nop");}//__asm("nop");}//WR = (0); // Clear pin
-#define CLR_WR_SLOW { LPC_GPIO_PORT->CLR[LCD_WR_PORT] = 1 << LCD_WR_PIN;__asm("nop");__asm("nop");}//WR = (0); // Clear pin
-#define SET_WR LPC_GPIO_PORT->SET[LCD_WR_PORT] = 1 << LCD_WR_PIN; //WR = (1); // Set pin
-
-#define CLR_RD LPC_GPIO_PORT->CLR[LCD_RD_PORT] = 1 << LCD_RD_PIN; //RD = (0); // Clear pin
-#define SET_RD LPC_GPIO_PORT->SET[LCD_RD_PORT] = 1 << LCD_RD_PIN; //RD = (1); // Set pin
-
-#define SET_CS  //CS tied to ground
-#define CLR_CS
-
-#define CLR_CS_CD_SET_RD_WR {CLR_CD; SET_RD; SET_WR;}
-#define CLR_CS_SET_CD_RD_WR {SET_CD; SET_RD; SET_WR;}
-#define SET_CD_RD_WR {SET_CD; SET_RD; SET_WR;}
-#define SET_WR_CS SET_WR;
-
-#define SET_MASK_P2 LPC_GPIO_PORT->MASK[2] = ~(0x7FFF8); //mask P2_3 ...P2_18
-#define CLR_MASK_P2 LPC_GPIO_PORT->MASK[2] = 0; // all on
-
-
-
-/**************************************************************************/
-/**                          SETUP GPIO & DATA                           **/
-/**************************************************************************/
-
-static void setup_gpio()
-{
-    /** control lines **/
-    LPC_GPIO_PORT->DIR[LCD_CD_PORT] |= (1  << LCD_CD_PIN );
-    LPC_GPIO_PORT->DIR[LCD_WR_PORT] |= (1  << LCD_WR_PIN );
-    LPC_GPIO_PORT->DIR[LCD_RD_PORT] |= (1  << LCD_RD_PIN );
-    LPC_GPIO_PORT->DIR[LCD_RES_PORT] |= (1  << LCD_RES_PIN );
-    /** data lines **/
-    LPC_GPIO_PORT->DIR[2] |= (0xFFFF  << 3);  // P2_3...P2_18 as output
-
-    pin_mode(P2_3,PullNone); // turn off pull-up
-    pin_mode(P2_4,PullNone); // turn off pull-up
-    pin_mode(P2_5,PullNone); // turn off pull-up
-    pin_mode(P2_6,PullNone); // turn off pull-up
-
-    pin_mode(P2_7,PullNone); // turn off pull-up
-    pin_mode(P2_8,PullNone); // turn off pull-up
-    pin_mode(P2_9,PullNone); // turn off pull-up
-    pin_mode(P2_10,PullNone); // turn off pull-up
-
-    pin_mode(P2_11,PullNone); // turn off pull-up
-    pin_mode(P2_12,PullNone); // turn off pull-up
-    pin_mode(P2_13,PullNone); // turn off pull-up
-    pin_mode(P2_14,PullNone); // turn off pull-up
-
-    pin_mode(P2_15,PullNone); // turn off pull-up
-    pin_mode(P2_16,PullNone); // turn off pull-up
-    pin_mode(P2_17,PullNone); // turn off pull-up
-    pin_mode(P2_18,PullNone); // turn off pull-up
-}
-
-
-
-
-#define HI_BYTE(d) (LPC_GPIO->MPIN[1]= (d<<13)) //((d>>8)<<21))
-#define LO_BYTE(d) (LPC_GPIO->MPIN[1]= (d<<21)) //because of mask makes no difference
-
-// Macros to set data bus direction to input/output
-#define LCD_GPIO2DATA_SETINPUT  GPIO_GPIO2DIR &= ~LCD_DATA_MASK
-#define LCD_GPIO2DATA_SETOUTPUT GPIO_GPIO2DIR |= LCD_DATA_MASK
-
-
-// Basic Color definitions
-#define	COLOR_BLACK                         (uint16_t)(0x0000)
-#define	COLOR_BLUE                          (uint16_t)(0x001F)
-#define	COLOR_RED                           (uint16_t)(0xF800)
-#define	COLOR_GREEN                         (uint16_t)(0x07E0)
-#define COLOR_CYAN                          (uint16_t)(0x07FF)
-#define COLOR_MAGENTA                       (uint16_t)(0xF81F)
-#define COLOR_YELLOW                        (uint16_t)(0xFFE0)
-#define COLOR_WHITE                         (uint16_t)(0xFFFF)
-
-// Grayscale Values
-#define COLOR_GRAY_15                       (uint16_t)(0x0861)    //  15  15  15
-#define COLOR_GRAY_30                       (uint16_t)(0x18E3)    //  30  30  30
-#define COLOR_GRAY_50                       (uint16_t)(0x3186)    //  50  50  50
-#define COLOR_GRAY_80                       (uint16_t)(0x528A)    //  80  80  80
-#define COLOR_GRAY_128                      (uint16_t)(0x8410)    // 128 128 128
-#define COLOR_GRAY_200                      (uint16_t)(0xCE59)    // 200 200 200
-#define COLOR_GRAY_225                      (uint16_t)(0xE71C)    // 225 225 225
-
-
-} // namespace pokitto
-#endif // __HWLCD_H_
-
-
--- a/POKITTO_HW/HWSound.cpp	Wed Jun 27 13:14:54 2018 +0000
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,514 +0,0 @@
-/**************************************************************************/
-/*!
-    @file     HWSound.cpp
-    @author   Jonne Valola
-
-    @section LICENSE
-
-    Software License Agreement (BSD License)
-
-    Copyright (c) 2016, Jonne Valola
-    All rights reserved.
-
-    Redistribution and use in source and binary forms, with or without
-    modification, are permitted provided that the following conditions are met:
-    1. Redistributions of source code must retain the above copyright
-    notice, this list of conditions and the following disclaimer.
-    2. Redistributions in binary form must reproduce the above copyright
-    notice, this list of conditions and the following disclaimer in the
-    documentation and/or other materials provided with the distribution.
-    3. Neither the name of the copyright holders nor the
-    names of its contributors may be used to endorse or promote products
-    derived from this software without specific prior written permission.
-
-    THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS ''AS IS'' AND ANY
-    EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
-    WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
-    DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER BE LIABLE FOR ANY
-    DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-    (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-    LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-    ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-    (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
-    SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-*/
-/**************************************************************************/
-
-#include "mbed.h"
-#include "HWSound.h"
-//#include "MCP4018.h"
-#include "SoftwareI2C.h"
-#include "Pokitto_settings.h"
-#include "PokittoDisk.h"
-#include "PokittoGlobs.h"
-#include "Synth.h"
-#include "timer_11u6x.h"
-#include "clock_11u6x.h"
-#include "HWLCD.h"
-//#include "beat_11025.h"
-
-
-Pokitto::Sound __shw;
-
-using namespace Pokitto;
-
-#ifndef POK_SIM
-#if POK_ENABLE_SOUND
-pwmout_t* obj = &audiopwm;
-#endif
-#endif
-
-/** Sound Variables **/
-#if (POK_STREAMING_MUSIC > 0)
-    unsigned char buffers[4][BUFFER_SIZE];
-    volatile int currentBuffer = 0, oldBuffer = 0;
-    volatile int bufindex = 0, vol=1;
-    volatile unsigned char * currentPtr;
-    volatile unsigned char * endPtr;
-    int8_t streamvol=3;
-    uint32_t streamcounter=0;
-    uint8_t streamstep=0;
-#endif
-
-#if POK_ENABLE_SOUND > 0
-	pwmout_t Pokitto::audiopwm; // this way (instead of PwmOut class) pwm doesn't start screaming until it is initialized !
-    //Ticker Pokitto::audio;
-
-using namespace Pokitto;
-
-
-/** stream output and status */
-uint8_t Pokitto::streambyte,Pokitto::streamon;
-
-uint8_t soundbuf[SBUFSIZE];
-uint8_t Pokitto::HWvolume=0;
-uint16_t soundbufindex;
-uint8_t* soundbufptr;
-
-bool volpotError=false; //test for broken MCP4018
-
-uint16_t soundbyte;
-
-
-#if POK_USE_DAC > 0
-#if POK_BOARDREV == 1
- /** 2-layer board rev 1.3 **/
- DigitalOut dac0(P1_6);
- DigitalOut dac1(P1_0);
- DigitalOut dac2(P1_16);
- DigitalOut dac3(P0_19);
- DigitalOut dac4(P0_17);
- DigitalOut dac5(P1_12);
- DigitalOut dac6(P1_15);
- DigitalOut dac7(P1_8);
-#else
- /** 4-layer board rev 2.1 **/
- DigitalOut dac0(P1_28);
- DigitalOut dac1(P1_29);
- DigitalOut dac2(P1_30);
- DigitalOut dac3(P1_31);
- /* has daniel made a mistake ?*/
- DigitalOut dac4(P2_20);
- DigitalOut dac5(P2_21);
- DigitalOut dac6(P2_22);
- DigitalOut dac7(P2_23);
-
- DigitalOut amp(P1_17);
-
-#endif // POK_BOARDREV
-#endif // POK_USE_DAC
-
-#if POK_BOARDREV == 2
-//MCP4018 volpot(P0_5,P0_4);
-
-/**
- * @brief	Handle interrupt from 32-bit timer 0
- * @return	Nothing
- */
-
-uint32_t p=0;
-uint8_t pixx=0, pixy=0;
-
-extern "C" void TIMER32_0_IRQHandler(void)
-{
-	if (Chip_TIMER_MatchPending(LPC_TIMER32_0, 1)) {
-		Chip_TIMER_ClearMatch(LPC_TIMER32_0, 1);
-		//pokSoundBufferedIRQ();
-		#if POK_GBSOUND > 0
-    	/** GAMEBUINO SOUND **/
-    	Pokitto::audio_IRQ();
-    	#else
-    	/** NOT GAMEBUINO SOUND **/
-            #if POK_SOUND_BUFFERED
-                pokSoundBufferedIRQ();
-            #else
-                pokSoundIRQ();
-            #endif
-		#endif
-	}
-}
-
-
-void initHWvolumecontrol() {
-    HWvolume=0;
-   	volpotError=true;
-    //if (volpot.put(HWvolume)) volpotError=true; //try if MCP4018 answers
-    setHWvolume(discrete_vol_hw_levels[VOLUME_STARTUP>>5]);
-}
-
-int Pokitto::setHWvolume(uint8_t v) {
-    HWvolume=v;
-    if (HWvolume>127) HWvolume=127;
-    //HWvolume = 0x7F&v;
-    //if (!volpotError) return volpot.put(HWvolume); //use normal I2C
-    /* fallback method for broken MCP4018 */
-    SoftwareI2C swvolpot(P0_4, P0_5); //swapped SDA,SCL
-    swvolpot.write(0x5e,HWvolume);
-	return HWvolume;
-}
-
-uint8_t Pokitto::getHWvolume() {
-    return HWvolume;
-}
-
-void Pokitto::changeHWvolume(int8_t v) {
-    int temp  = HWvolume + v;
-    if (temp < 0) temp = 0; //prevent volume "looparound" than can make a massive crack
-    if (temp > 127) temp = 127;
-    setHWvolume(temp);
-}
-
- uint8_t Pokitto::ampIsOn() {
-    return amp;
- }
-
- void Pokitto::ampEnable(uint8_t v) {
-    if (v>1) v=1; // limit against funny values
-    amp=v;
- }
-#endif // POK_BOARDREV == 2
-
-void Pokitto::dac_write(uint8_t value) {
-    #if POK_USE_DAC > 0
-    #if POK_BOARDREV == 1 // was 1
-    if (value & 1) SET_DAC0 else CLR_DAC0;
-    value >>= 1;
-    if (value & 1) SET_DAC1 else CLR_DAC1;
-    value >>= 1;
-    if (value & 1) SET_DAC2 else CLR_DAC2;
-    value >>= 1;
-    if (value & 1) SET_DAC3 else CLR_DAC3;
-    value >>= 1;
-    if (value & 1) SET_DAC4 else CLR_DAC4;
-    value >>= 1;
-    if (value & 1) SET_DAC5 else CLR_DAC5;
-    value >>= 1;
-    if (value & 1) SET_DAC6 else CLR_DAC6;
-    value >>= 1;
-    if (value & 1) SET_DAC7 else CLR_DAC7;
-    #else
-
-    //val = value<<28; //lower 4 bits go higher - because port mask is used, no AND is needed to clear bits
-    //val += value<<(15-4); //higher 4 bits go lower. No need to shift by 15 because bits are in the higher nibble
-    /* daniel has made a mistake with ports */
-    //val = ((value&0x70)<<(28-4)); //higher 4 bits go higher - because port mask is used, no AND is needed to clear bits
-    //val += value<<(15); //lower 4 bits go lower. No need to shift by 15 because bits are in the higher nibble
-    //SET_MASK_DAC;
-    //LPC_GPIO_PORT->MPIN[1] = val; // write bits to port
-    //CLR_MASK_DAC;
-    /* fixed here */
-    #define MASKED_DAC 0
-    #if MASKED_DAC
-    uint32_t val;
-    val=value;
-    SET_MASK_DAC_LO;
-    LPC_GPIO_PORT->MPIN[1] = val<<28; // write lower 4 bits to port
-    CLR_MASK_DAC_LO;
-    SET_MASK_DAC_HI;
-    LPC_GPIO_PORT->MPIN[2] = val<<(20-4); // write bits to port
-    CLR_MASK_DAC_HI;
-    #else
-    if (value & 1) SET_DAC0 else CLR_DAC0;
-    value >>= 1;
-    if (value & 1) SET_DAC1 else CLR_DAC1;
-    value >>= 1;
-    if (value & 1) SET_DAC2 else CLR_DAC2;
-    value >>= 1;
-    if (value & 1) SET_DAC3 else CLR_DAC3;
-    value >>= 1;
-    if (value & 1) SET_DAC4 else CLR_DAC4;
-    value >>= 1;
-    if (value & 1) SET_DAC5 else CLR_DAC5;
-    value >>= 1;
-    if (value & 1) SET_DAC6 else CLR_DAC6;
-    value >>= 1;
-    if (value & 1) SET_DAC7 else CLR_DAC7;
-    #endif //MASKED_DAC
-    //CLR_MASK_DAC;
-    #endif // BOARDREV
-    #endif
-}
-
-/** SOUND INIT **/
-void Pokitto::soundInit() {
-    #if POK_ENABLE_SOUND > 0
-    uint32_t timerFreq;
-    #if POK_USE_PWM
-
-    pwmout_init(&audiopwm,POK_AUD_PIN);
-    pwmout_period_us(&audiopwm,POK_AUD_PWM_US); //was 31us
-    pwmout_write(&audiopwm,0.1f);
-    #endif
-
-    //#if POK_GBSOUND > 0
-    /** GAMEBUINO SOUND **/
-    //audio.attach_us(&audio_IRQ, 1000000/(POK_AUD_FREQ>>0));
-    //#else
-    /** NOT GAMEBUINO SOUND **/
-    //audio.attach_us(&pokSoundBufferedIRQ, 1000000/(POK_AUD_FREQ>>0));
-     /* Initialize 32-bit timer 0 clock */
-	Chip_TIMER_Init(LPC_TIMER32_0);
-
-    /* Timer rate is system clock rate */
-	timerFreq = Chip_Clock_GetSystemClockRate();
-
-	/* Timer setup for match and interrupt at TICKRATE_HZ */
-	Chip_TIMER_Reset(LPC_TIMER32_0);
-
-	/* Enable both timers to generate interrupts when time matches */
-	Chip_TIMER_MatchEnableInt(LPC_TIMER32_0, 1);
-
-    /* Setup 32-bit timer's duration (32-bit match time) */
-	Chip_TIMER_SetMatch(LPC_TIMER32_0, 1, (timerFreq / POK_AUD_FREQ));
-
-	/* Setup both timers to restart when match occurs */
-	Chip_TIMER_ResetOnMatchEnable(LPC_TIMER32_0, 1);
-
-	/* Start both timers */
-	Chip_TIMER_Enable(LPC_TIMER32_0);
-
-	/* Clear both timers of any pending interrupts */
-    #define TIMER_32_0_IRQn 18
-	NVIC_ClearPendingIRQ((IRQn_Type)TIMER_32_0_IRQn);
-
-    /* Redirect IRQ vector - Jonne*/
-    NVIC_SetVector((IRQn_Type)TIMER_32_0_IRQn, (uint32_t)&TIMER32_0_IRQHandler);
-
-	/* Enable both timer interrupts */
-	NVIC_EnableIRQ((IRQn_Type)TIMER_32_0_IRQn);
-    //#endif // POK_GAMEBUINO_SUPPORT
-
-    //emptySong();
-    //emptyOscillators();
-    //emptyBlocks();
-    //emptyPatches();
-    #ifdef TEST_SOUND
-        testOsc();
-    #endif // TEST_SOUND
-    #if POK_BOARDREV == 2
-        //initHWvolumecontrol();
-    #endif
-
-    #if POK_ENABLE_SYNTH
-        emptyOscillators();
-    #endif
-
-
-    #endif // POK_ENABLE_SOUND
-
-}
-
-
-uint8_t Pokitto::streamPaused() {
-    return !streamon;
-}
-
-void Pokitto::pauseStream() {
-    streamon=0;
-}
-
-void Pokitto::playStream() {
-    streamon=1;
-}
-
-
-void pokPauseStream() {
-    streamon=0;
-}
-
-void pokPlayStream() {
-    streamon=1;
-}
-
-
-
-inline void pokSoundBufferedIRQ() {
-           uint32_t output = soundbuf[soundbufindex+=Pokitto::streamon];
-           if (soundbufindex==SBUFSIZE) soundbufindex=0;
-           //if (p==sizeof(beat_11025_raw)) p=0;
-           //soundbuf[soundbufindex++] = output;
-           //uint32_t t_on = (uint32_t)(((obj->pwm->MATCHREL0)*output)>>8); //cut out float
-           //obj->pwm->MATCHREL1 = t_on;
-           output *= discrete_vol_multipliers[discrete_vol];
-           output >>= 8;
-           dac_write(output);
-
-           //setDRAMpoint(pixx, pixy);
-}
-
-inline void pokSoundIRQ() {
-    #if POK_ENABLE_SOUND > 0
-    //#define TICKY 0xFFFF //160
-    //#define INCY 409
-    uint32_t output=0;uint32_t op;
-    streamon=1;
-    //if (test==TICKY) test=0;
-    //if (test<(TICKY/2)) { tpin=1; pwmout_write(&audiopwm,(float)0/(float)255);}//dac_write(0);}
-    //else {tpin=0; pwmout_write(&audiopwm,(float)255/(float)255);}//dac_write(64);}
-    //test+=INCY;
-    //return;
-    #ifndef POK_SIM
-        #if POK_USE_PWM
-        pwmout_t* obj = &audiopwm;
-        #endif
-    #endif
-    #if POK_STREAMING_MUSIC > 0
-        #if POK_STREAMFREQ_HALVE
-        streamstep = 1-streamstep;
-        #else
-        streamstep = 1;
-        #endif // POK_STREAMFREQ_HALVE
-        streamstep &= streamon; // streamon is used to toggle SD music streaming on and off
-        if (streamstep) {
-            output = (*currentPtr++);
-            if(streamvol && streamon) {
-                output >>= 3-streamvol;
-                streambyte = output;
-            } else {
-                streambyte = 0; // duty cycle
-                output = 0;
-            }
-            if (currentPtr >= endPtr)
-            {
-            currentBuffer++;
-            if (currentBuffer==4) currentBuffer=0;
-            currentPtr = buffers[currentBuffer];
-            endPtr = currentPtr + BUFFER_SIZE;
-            }
-        }
-    #endif // POK_STREAMING_MUSIC
-
-    /** DO ADDITIONAL SOUND PROCESSING (NOT STREAM) OF SOUND HERE **/
-
-    #if POK_ENABLE_SYNTH
-        /** if song is being played from sd **/
-        if (playing) {
-                notetick++;
-                updatePlayback();
-        }
-        /** oscillators update **/
-        osc1.count += osc1.cinc + (osc1.pitchbend >> 4); // counts to 65535 and overflows to zero WAS 8 !
-        osc2.count += osc2.cinc + (osc2.pitchbend >> 4); // counts to 65535 and overflows to zero
-        osc3.count += osc3.cinc + (osc3.pitchbend >> 4); // counts to 65535 and overflows to zero
-        Marr[tick](); // call mixing function
-        --tick;
-
-        /** mixing oscillator output **/
-
-        op = (uint32_t) ((osc1.output)*(osc1.vol>>8))>>9;// >> 2 osc1.vol Marr;
-        op += (uint32_t) ((osc2.output)*(osc2.vol>>8))>>9;// >> 2 osc1.vol Marr;
-        op += (uint32_t) ((osc3.output)*(osc3.vol>>8))>>9;// >> 2 osc1.vol Marr;
-        op *= discrete_vol_multipliers[discrete_vol];
-        op >>= 8;
-        output = op & 0xFF;
-
-    #endif // POK_ENABLE_SYNTH
-
-    #ifndef POK_SIM
-    /** HARDWARE **/
-        #if POK_ENABLE_SOUND > 0
-            #if POK_STREAMING_MUSIC > 0
-                /** sound is enabled, streaming is enabled */
-                #if POK_STREAM_TO_DAC > 0
-                    /** stream goes to DAC */
-                    #if POK_USE_DAC > 0
-                    uint32_t sbyte = streambyte;
-                    sbyte *= discrete_vol_multipliers[discrete_vol];
-                    sbyte >>= 8;
-                    dac_write((uint8_t)sbyte); // duty cycle
-                    #endif // POK_USE_DAC
-                #else
-                    /** stream goes to PWM */
-                    if (streamstep) {
-                            //pwmout_write(&audiopwm,(float)streambyte/(float)255);
-                            #if POK_USE_PWM
-                            uint32_t sbyte = streambyte;
-                            sbyte *= discrete_vol_multipliers[discrete_vol];
-                            sbyte >>= 8;
-                            uint32_t t_on = (uint32_t)((((obj->pwm->MATCHREL0)*sbyte)>>8)); //cut out float
-                            obj->pwm->MATCHREL1 = t_on;
-                            #endif
-                            //dac_write((uint8_t)streambyte); // duty cycle
-                    }
-                #endif // POK_STREAM_TO_DAC
-            #endif // POK_STREAMING_MUSIC
-            #if POK_STREAM_TO_DAC > 0
-                /** synth goes to PWM */
-                //pwmout_write(&audiopwm,(float)output/(float)255);
-                #if POK_USE_PWM
-                    op = output;
-                    op *= discrete_vol_multipliers[discrete_vol];
-                    op >>= 8;
-                    uint32_t t_on = (uint32_t)((((obj->pwm->MATCHREL0)*op)>>8)); //cut out float
-                    obj->pwm->MATCHREL1 = t_on;
-                #endif
-            #else // POK_STREAMING_MUSIC
-                op = output;
-                op *= discrete_vol_multipliers[discrete_vol];
-                op >>= 8;
-                dac_write((uint8_t)op); // SYNTH to DAC
-            #endif
-            soundbyte = (output+streambyte)>>1;
-            soundbuf[soundbufindex++]=soundbyte;
-            if (soundbufindex==256) soundbufindex=0;
-        #endif //POK_ENABLE_SOUND
-    #endif // HARDWARE
-#endif //POK_ENABLE_SOUND
-}
-
-
-void Pokitto::updateSDAudioStream() {
-    #ifndef NOPETITFATFS
-    if (streamPaused()) return;
-
-    #if POK_STREAMING_MUSIC > 0
-    if (oldBuffer != currentBuffer) {
-        if (currentBuffer==0) fileReadBytes(&buffers[3][0],BUFFER_SIZE);
-        else if (currentBuffer==1) fileReadBytes(&buffers[0][0],BUFFER_SIZE);
-        else if (currentBuffer==2) fileReadBytes(&buffers[1][0],BUFFER_SIZE);
-        else fileReadBytes(&buffers[2][0],BUFFER_SIZE);
-        oldBuffer = currentBuffer;
-        streamcounter += BUFFER_SIZE;
-    } else return;
-
-    #ifndef POK_SIM
-    if ( streamcounter > fs.fsize - (BUFFER_SIZE*6)) {
-    #else
-    if ( streamcounter > getFileLength() - (BUFFER_SIZE*6)) {
-    #endif
-        streamcounter=0;
-        #if POK_STREAM_LOOP
-        fileRewind();
-        #else
-        pokPauseStream();
-        #endif
-    }
-    #endif
-    #endif // NOPETITFATFS
-}
-
-
-#endif // POK_ENABLE_SOUND
-
-
-
--- a/POKITTO_HW/HWSound.h	Wed Jun 27 13:14:54 2018 +0000
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,165 +0,0 @@
-/**************************************************************************/
-/*!
-    @file     HWSOUND.h
-    @author   Jonne Valola
-
-    @section LICENSE
-
-    Software License Agreement (BSD License)
-
-    Copyright (c) 2016, Jonne Valola
-    All rights reserved.
-
-    Redistribution and use in source and binary forms, with or without
-    modification, are permitted provided that the following conditions are met:
-    1. Redistributions of source code must retain the above copyright
-    notice, this list of conditions and the following disclaimer.
-    2. Redistributions in binary form must reproduce the above copyright
-    notice, this list of conditions and the following disclaimer in the
-    documentation and/or other materials provided with the distribution.
-    3. Neither the name of the copyright holders nor the
-    names of its contributors may be used to endorse or promote products
-    derived from this software without specific prior written permission.
-
-    THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS ''AS IS'' AND ANY
-    EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
-    WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
-    DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER BE LIABLE FOR ANY
-    DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-    (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-    LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-    ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-    (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
-    SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-*/
-/**************************************************************************/
-#ifndef HWSOUND_H
-#define HWSOUND_H
-
-#include "mbed.h"
-#include "Pokitto_settings.h"
-
-#define SPEAKER 3
-#define BUFFER_SIZE 512*4 //*8 //*8 // 512 // was 512 (works really well with crabator) was 256
-
-#define SBUFSIZE 512*4
-
-#if POK_BOARDREV == 1
- /** 2-layer board rev 1.3 **/
- #define DAC0_PORT   1
- #define DAC0_PIN    6
- #define DAC1_PORT   1
- #define DAC1_PIN    0
- #define DAC2_PORT   1
- #define DAC2_PIN    16
- #define DAC3_PORT   0
- #define DAC3_PIN    19
- #define DAC4_PORT   0
- #define DAC4_PIN    17
- #define DAC5_PORT   1
- #define DAC5_PIN    12
- #define DAC6_PORT   1
- #define DAC6_PIN    15
- #define DAC7_PORT   1
- #define DAC7_PIN    8
-#else
- /** 4-layer board rev 2.1 **/
- #define DAC0_PORT   1
- #define DAC0_PIN    28
- #define DAC1_PORT   1
- #define DAC1_PIN    29
- #define DAC2_PORT   1
- #define DAC2_PIN    30
- #define DAC3_PORT   1
- #define DAC3_PIN    31
-/** has daniel made a mistake with dac ? **/
- #define DAC4_PORT   2
- #define DAC4_PIN    20
- #define DAC5_PORT   2
- #define DAC5_PIN    21
- #define DAC6_PORT   2
- #define DAC6_PIN    22
- #define DAC7_PORT   2
- #define DAC7_PIN    23
-
- /** MASK FOR FASTER DAC **/
- #define SET_MASK_DAC LPC_GPIO_PORT->MASK[1] = ~(0xF0078000); //mask P1_15...P1_18 and P1_28...P1_31
- #define CLR_MASK_DAC LPC_GPIO_PORT->MASK[1] = 0; // all on
-
- /* fixing wrong pins from daniel*/
- #define SET_MASK_DAC_LO LPC_GPIO_PORT->MASK[1] = ~(0xF0000000); //mask P1_28...P1_31
- #define CLR_MASK_DAC_LO LPC_GPIO_PORT->MASK[1] = 0; // all on
- #define SET_MASK_DAC_HI LPC_GPIO_PORT->MASK[2] = ~(0xF00000); //mask P2_20...P2_23
- #define CLR_MASK_DAC_HI LPC_GPIO_PORT->MASK[2] = 0; // all on
-
-#endif
-
-#define CLR_DAC0 LPC_GPIO_PORT->CLR[DAC0_PORT] = 1UL << DAC0_PIN;
-#define SET_DAC0 LPC_GPIO_PORT->SET[DAC0_PORT] = 1UL << DAC0_PIN;
-#define CLR_DAC1 LPC_GPIO_PORT->CLR[DAC1_PORT] = 1UL << DAC1_PIN;
-#define SET_DAC1 LPC_GPIO_PORT->SET[DAC1_PORT] = 1UL << DAC1_PIN;
-#define CLR_DAC2 LPC_GPIO_PORT->CLR[DAC2_PORT] = 1UL << DAC2_PIN;
-#define SET_DAC2 LPC_GPIO_PORT->SET[DAC2_PORT] = 1UL << DAC2_PIN;
-#define CLR_DAC3 LPC_GPIO_PORT->CLR[DAC3_PORT] = 1UL << DAC3_PIN;
-#define SET_DAC3 LPC_GPIO_PORT->SET[DAC3_PORT] = 1UL << DAC3_PIN;
-#define CLR_DAC4 LPC_GPIO_PORT->CLR[DAC4_PORT] = 1UL << DAC4_PIN;
-#define SET_DAC4 LPC_GPIO_PORT->SET[DAC4_PORT] = 1UL << DAC4_PIN;
-#define CLR_DAC5 LPC_GPIO_PORT->CLR[DAC5_PORT] = 1UL << DAC5_PIN;
-#define SET_DAC5 LPC_GPIO_PORT->SET[DAC5_PORT] = 1UL << DAC5_PIN;
-#define CLR_DAC6 LPC_GPIO_PORT->CLR[DAC6_PORT] = 1UL << DAC6_PIN;
-#define SET_DAC6 LPC_GPIO_PORT->SET[DAC6_PORT] = 1UL << DAC6_PIN;
-#define CLR_DAC7 LPC_GPIO_PORT->CLR[DAC7_PORT] = 1UL << DAC7_PIN;
-#define SET_DAC7 LPC_GPIO_PORT->SET[DAC7_PORT] = 1UL << DAC7_PIN;
-
-/** the output holder **/
-extern uint16_t soundbyte;
-
-
-namespace Pokitto {
-
-/** stream output and status */
-extern uint8_t streambyte, streamon, HWvolume;
-
-extern float pwm2; //virtual pwm output
-
-extern void soundInit();
-extern void dac_write(uint8_t value);
-extern uint8_t ampIsOn();
-extern void ampEnable(uint8_t v);
-extern void audio_IRQ();
-extern void updateSDAudioStream();
-extern uint8_t streamPaused();
-extern void pauseStream();
-extern void playStream();
-extern int setHWvolume(uint8_t);
-extern uint8_t getHWvolume();
-extern void changeHWvolume(int8_t);
-
-extern pwmout_t audiopwm;
-extern uint8_t pokAmpIsOn();
-extern void pokAmpEnable(uint8_t);
-
-extern Ticker audio;
-
-extern void update_SDAudioStream();
-}
-
-
-extern void pokSoundIRQ();
-extern void pokSoundBufferedIRQ();
-
-#if POK_STREAMING_MUSIC > 0
-    extern unsigned char buffers[][BUFFER_SIZE];
-    extern volatile int currentBuffer, oldBuffer;
-    extern volatile int bufindex, vol;
-    extern volatile unsigned char * currentPtr;
-    extern volatile unsigned char * endPtr;
-    extern int8_t streamvol;
-    extern uint32_t streamcounter;
-    extern uint8_t streamstep;
-#endif
-
-#endif //HWSOUND_H
-
-
-
--- a/POKITTO_HW/PokittoClock.cpp	Wed Jun 27 13:14:54 2018 +0000
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,86 +0,0 @@
-/**************************************************************************/
-/*!
-    @file     PokittoClock.cpp
-    @author   Jonne Valola
-
-    @section LICENSE
-
-    Software License Agreement (BSD License)
-
-    Copyright (c) 2015, Jonne Valola
-    All rights reserved.
-
-    Redistribution and use in source and binary forms, with or without
-    modification, are permitted provided that the following conditions are met:
-    1. Redistributions of source code must retain the above copyright
-    notice, this list of conditions and the following disclaimer.
-    2. Redistributions in binary form must reproduce the above copyright
-    notice, this list of conditions and the following disclaimer in the
-    documentation and/or other materials provided with the distribution.
-    3. Neither the name of the copyright holders nor the
-    names of its contributors may be used to endorse or promote products
-    derived from this software without specific prior written permission.
-
-    THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS ''AS IS'' AND ANY
-    EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
-    WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
-    DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER BE LIABLE FOR ANY
-    DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-    (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-    LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-    ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-    (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
-    SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-*/
-/**************************************************************************/
-
-#include "PokittoCore.h"
-#include "pinmap.h"
-#include "HWLCD.h"
-#include "Pokitto_settings.h"
-#include "wait_api.h"
-
-uint32_t pt_count=0;
-uint32_t* ptimer;
-
-extern "C" {
-void SysTick_Handler(void) {
-    //interrupt happens when systick has counted down to zero
-    #if PROJ_GAMEBOY > 0
-    uint32_t a;
-    a = *ptimer;
-    *ptimer = a + 1;
-    #endif
-    pt_count+=10;                        // increment counter
-}}
-
-using namespace Pokitto;
-
-uint32_t Core::refreshtime;
-
-void Core::initClock() {
-        // to get 1000 interrupts per second the reload value should be 48000
-    #if PROJ_GAMEBOY > 0
-    ptimer = &pt_count;
-    SysTick->LOAD = 480000-1;
-    #else
-    #ifdef _OSCT
-    SysTick->LOAD = (480000*3/_OSCT)-1;
-    #else
-    SysTick->LOAD = 480000-1;
-    #endif
-    #endif
-    SysTick->VAL  = 0;
-    SysTick->CTRL  = 4 | 2 | 1; //CLKSOURCE=CPU clock | TICKINT | ENABLE
-    pt_count = 0;
-}
-
-uint32_t Core::getTime() {
-    return pt_count;
-}
-
-void Core::wait(uint16_t ms) {
-    wait_ms(ms);
-}
-
-
--- a/POKITTO_HW/PokittoEEPROM.h	Wed Jun 27 13:14:54 2018 +0000
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,147 +0,0 @@
-/*
-  EEPROM.h - EEPROM library
-  Original Copyright (c) 2006 David A. Mellis.  All right reserved.
-  New version by Christopher Andrews 2015.
-
-  This library is free software; you can redistribute it and/or
-  modify it under the terms of the GNU Lesser General Public
-  License as published by the Free Software Foundation; either
-  version 2.1 of the License, or (at your option) any later version.
-
-  This library is distributed in the hope that it will be useful,
-  but WITHOUT ANY WARRANTY; without even the implied warranty of
-  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-  Lesser General Public License for more details.
-
-  You should have received a copy of the GNU Lesser General Public
-  License along with this library; if not, write to the Free Software
-  Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
-*/
-
-#ifndef EEPROM_h
-#define EEPROM_h
-
-#include <stdint.h>
-#include "iap.h"
-
-/***
-    EERef class.
-
-    This object references an EEPROM cell.
-    Its purpose is to mimic a typical byte of RAM, however its storage is the EEPROM.
-    This class has an overhead of two bytes, similar to storing a pointer to an EEPROM cell.
-***/
-
-struct EERef{
-
-    EERef( const int index )
-        : index( index )                 {}
-
-    //Access/read members.
-    uint8_t operator*() const            { return eeprom_read_byte( (uint16_t*) index ); }
-    operator const uint8_t() const       { return **this; }
-
-    //Assignment/write members.
-    EERef &operator=( const EERef &ref ) { return *this = *ref; }
-    EERef &operator=( uint8_t in )       { return eeprom_write_byte( (uint16_t*) index, in ), *this;  }
-    EERef &operator +=( uint8_t in )     { return *this = **this + in; }
-    EERef &operator -=( uint8_t in )     { return *this = **this - in; }
-    EERef &operator *=( uint8_t in )     { return *this = **this * in; }
-    EERef &operator /=( uint8_t in )     { return *this = **this / in; }
-    EERef &operator ^=( uint8_t in )     { return *this = **this ^ in; }
-    EERef &operator %=( uint8_t in )     { return *this = **this % in; }
-    EERef &operator &=( uint8_t in )     { return *this = **this & in; }
-    EERef &operator |=( uint8_t in )     { return *this = **this | in; }
-    EERef &operator <<=( uint8_t in )    { return *this = **this << in; }
-    EERef &operator >>=( uint8_t in )    { return *this = **this >> in; }
-
-    EERef &update( uint8_t in )          { return  in != *this ? *this = in : *this; }
-
-    /** Prefix increment/decrement **/
-    EERef& operator++()                  { return *this += 1; }
-    EERef& operator--()                  { return *this -= 1; }
-
-    /** Postfix increment/decrement **/
-    uint8_t operator++ (int){
-        uint8_t ret = **this;
-        return ++(*this), ret;
-    }
-
-    uint8_t operator-- (int){
-        uint8_t ret = **this;
-        return --(*this), ret;
-    }
-
-    int index; //Index of current EEPROM cell.
-};
-
-/***
-    EEPtr class.
-
-    This object is a bidirectional pointer to EEPROM cells represented by EERef objects.
-    Just like a normal pointer type, this can be dereferenced and repositioned using
-    increment/decrement operators.
-***/
-
-struct EEPtr{
-
-    EEPtr( const int index )
-        : index( index )                {}
-
-    operator const int() const          { return index; }
-    EEPtr &operator=( int in )          { return index = in, *this; }
-
-    //Iterator functionality.
-    bool operator!=( const EEPtr &ptr ) { return index != ptr.index; }
-    EERef operator*()                   { return index; }
-
-    /** Prefix & Postfix increment/decrement **/
-    EEPtr& operator++()                 { return ++index, *this; }
-    EEPtr& operator--()                 { return --index, *this; }
-    EEPtr operator++ (int)              { return index++; }
-    EEPtr operator-- (int)              { return index--; }
-
-    int index; //Index of current EEPROM cell.
-};
-
-/***
-    EEPROMClass class.
-
-    This object represents the entire EEPROM space.
-    It wraps the functionality of EEPtr and EERef into a basic interface.
-    This class is also 100% backwards compatible with earlier Arduino core releases.
-***/
-
-struct EEPROMClass{
-
-    //Basic user access methods.
-    EERef operator[]( const int idx )    { return idx; }
-    uint8_t read( int idx )              { return EERef( idx ); }
-    void write( int idx, uint8_t val )   { (EERef( idx )) = val; }
-    void update( int idx, uint8_t val )  { EERef( idx ).update( val ); }
-
-    //STL and C++11 iteration capability.
-    EEPtr begin()                        { return 0x00; }
-    EEPtr end()                          { return length(); } //Standards requires this to be the item after the last valid entry. The returned pointer is invalid.
-    uint16_t length()                    { return EESETTINGS_VOL; } // length for pokitto is 4kB MINUS settings area!!
-
-    //Functionality to 'get' and 'put' objects to and from EEPROM.
-    template< typename T > T &get( int idx, T &t ){
-        EEPtr e = idx;
-        uint8_t *ptr = (uint8_t*) &t;
-        for( int count = sizeof(T) ; count ; --count, ++e )  *ptr++ = *e;
-        return t;
-    }
-
-    template< typename T > const T &put( int idx, const T &t ){
-        EEPtr e = idx;
-        const uint8_t *ptr = (const uint8_t*) &t;
-        for( int count = sizeof(T) ; count ; --count, ++e )  (*e).update( *ptr++ );
-        return t;
-    }
-};
-
-static EEPROMClass EEPROM;
-#endif
-
-
--- a/POKITTO_HW/PokittoHW.cpp	Wed Jun 27 13:14:54 2018 +0000
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,89 +0,0 @@
-/**************************************************************************/
-/*!
-    @file     PokittoHW.cpp
-    @author   Jonne Valola
-
-    @section LICENSE
-
-    Software License Agreement (BSD License)
-
-    Copyright (c) 2015, Jonne Valola
-    All rights reserved.
-
-    Redistribution and use in source and binary forms, with or without
-    modification, are permitted provided that the following conditions are met:
-    1. Redistributions of source code must retain the above copyright
-    notice, this list of conditions and the following disclaimer.
-    2. Redistributions in binary form must reproduce the above copyright
-    notice, this list of conditions and the following disclaimer in the
-    documentation and/or other materials provided with the distribution.
-    3. Neither the name of the copyright holders nor the
-    names of its contributors may be used to endorse or promote products
-    derived from this software without specific prior written permission.
-
-    THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS ''AS IS'' AND ANY
-    EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
-    WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
-    DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER BE LIABLE FOR ANY
-    DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-    (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-    LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-    ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-    (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
-    SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-*/
-/**************************************************************************/
-
-#include "PokittoCore.h"
-#include "pinmap.h"
-#include "HWLCD.h"
-
-
-using namespace Pokitto;
-
-
-void Core::quit() {
-    run_state = false;
-}
-
-void Core::initRandom() {
-    time_t seconds = time(NULL);
-    Pokitto::Battery::update();
-    srand((unsigned int) (Pokitto::Battery::level + (seconds)));
-}
-
-void Core::initGPIO() {
-    /** control lines **/
-    LPC_GPIO_PORT->DIR[LCD_CD_PORT] |= (1  << LCD_CD_PIN );
-    LPC_GPIO_PORT->DIR[LCD_WR_PORT] |= (1  << LCD_WR_PIN );
-    LPC_GPIO_PORT->DIR[LCD_RD_PORT] |= (1  << LCD_RD_PIN );
-    LPC_GPIO_PORT->DIR[LCD_RES_PORT] |= (1  << LCD_RES_PIN );
-    /** data lines **/
-    LPC_GPIO_PORT->DIR[2] |= (0xFFFF  << 3);  // P2_3...P2_18 as output
-
-    pin_mode(P2_3,PullNone); // turn off pull-up
-    pin_mode(P2_4,PullNone); // turn off pull-up
-    pin_mode(P2_5,PullNone); // turn off pull-up
-    pin_mode(P2_6,PullNone); // turn off pull-up
-
-    pin_mode(P2_7,PullNone); // turn off pull-up
-    pin_mode(P2_8,PullNone); // turn off pull-up
-    pin_mode(P2_9,PullNone); // turn off pull-up
-    pin_mode(P2_10,PullNone); // turn off pull-up
-
-    pin_mode(P2_11,PullNone); // turn off pull-up
-    pin_mode(P2_12,PullNone); // turn off pull-up
-    pin_mode(P2_13,PullNone); // turn off pull-up
-    pin_mode(P2_14,PullNone); // turn off pull-up
-
-    pin_mode(P2_15,PullNone); // turn off pull-up
-    pin_mode(P2_16,PullNone); // turn off pull-up
-    pin_mode(P2_17,PullNone); // turn off pull-up
-    pin_mode(P2_18,PullNone); // turn off pull-up
-}
-
-
-
-
-
-
--- a/POKITTO_HW/Pokitto_extport.cpp	Wed Jun 27 13:14:54 2018 +0000
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,96 +0,0 @@
-/**************************************************************************/
-/*!
-    @file     Pokitto_extport.cpp
-    @author   Jonne Valola
-
-    @section LICENSE
-
-    Pokitto development stage library
-    Software License Agreement
-
-    Copyright (c) 2015, Jonne Valola ("Author")
-    All rights reserved.
-
-    This library is intended solely for the purpose of Pokitto development.
-
-    Redistribution and use in source and binary forms, with or without
-    modification requires written permission from Author.
-*/
-/**************************************************************************/
-
-#include "Pokitto.h"
-
-using namespace mbed; //needed for interruptin
-
-#if POK_USE_EXT > 0
-//#if POK_BOARDREV == 1
- /** 2-layer board rev 1.3 **/
-//#else
- /** 4-layer board rev 2.1 **/
- //InterruptIn ext0(P1_19);
- AnalogIn ext0(P1_19);
- DigitalIn ext1(P0_11, PullUp);
- //DigitalOut ext0(P1_19);
- //DigitalOut ext1(P0_11);
- DigitalOut ext2(P0_12);
- DigitalOut ext3(P0_13);
- DigitalOut ext4(P0_14);
- DigitalOut ext5(P0_17);
- DigitalOut ext6(P0_18);
- DigitalOut ext7(P0_19);
- DigitalOut ext8(P1_20);
- DigitalOut ext9(P1_21);
- DigitalOut ext10(P1_22);
- DigitalOut ext11(P1_23);
- DigitalOut ext12(P1_5);
- DigitalOut ext13(P1_6);
- DigitalOut ext14(P1_8);
- DigitalOut ext15(P1_26);
- DigitalOut ext16(P1_27);
- DigitalOut ext17(P0_16);
-//#endif // POK_BOARDREV
-#endif // POK_USE_EXT
-
-
-
-void ext_write(uint32_t value) {
-    #if POK_USE_EXT > 0
-    if (value & 1) SET_EXT0 else CLR_EXT0;
-    value >>= 1;
-    if (value & 1) SET_EXT1 else CLR_EXT1;
-    value >>= 1;
-    if (value & 1) SET_EXT2 else CLR_EXT2;
-    value >>= 1;
-    if (value & 1) SET_EXT3 else CLR_EXT3;
-    value >>= 1;
-    if (value & 1) SET_EXT4 else CLR_EXT4;
-    value >>= 1;
-    if (value & 1) SET_EXT5 else CLR_EXT5;
-    value >>= 1;
-    if (value & 1) SET_EXT6 else CLR_EXT6;
-    value >>= 1;
-    if (value & 1) SET_EXT7 else CLR_EXT7;
-    value >>= 1;
-    if (value & 1) SET_EXT8 else CLR_EXT8;
-    value >>= 1;
-    if (value & 1) SET_EXT9 else CLR_EXT9;
-    value >>= 1;
-    if (value & 1) SET_EXT10 else CLR_EXT10;
-    value >>= 1;
-    if (value & 1) SET_EXT11 else CLR_EXT11;
-    value >>= 1;
-    if (value & 1) SET_EXT12 else CLR_EXT12;
-    value >>= 1;
-    if (value & 1) SET_EXT13 else CLR_EXT13;
-    value >>= 1;
-    if (value & 1) SET_EXT14 else CLR_EXT14;
-    value >>= 1;
-    if (value & 1) SET_EXT15 else CLR_EXT15;
-    value >>= 1;
-    if (value & 1) SET_EXT16 else CLR_EXT16;
-    value >>= 1;
-    if (value & 1) SET_EXT17 else CLR_EXT17;
-    #endif
-}
-
-
--- a/POKITTO_HW/Pokitto_extport.h	Wed Jun 27 13:14:54 2018 +0000
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,195 +0,0 @@
-/**************************************************************************/
-/*!
-    @file     Pokitto_extport.h
-    @author   Jonne Valola
-
-    @section LICENSE
-
-    Pokitto development stage library
-    Software License Agreement
-
-    Copyright (c) 2015, Jonne Valola ("Author")
-    All rights reserved.
-
-    This library is intended solely for the purpose of Pokitto development.
-
-    Redistribution and use in source and binary forms, with or without
-    modification requires written permission from Author.
-*/
-/**************************************************************************/
-
-#ifndef POKITTO_EXTPORT_H
-#define POKITTO_EXTPORT_H
-
-#include "mbed.h"
-
-using namespace mbed; //interruptin
-
-#if POK_BOARDREV == 1
- /** 2-layer board rev 1.3 **/
- #define EXT0_PORT   1
- #define EXT0_PIN    19
- #define EXT1_PORT   0
- #define EXT1_PIN    11
- #define EXT2_PORT   0
- #define EXT2_PIN    12
- #define EXT3_PORT   0
- #define EXT3_PIN    13
- #define EXT4_PORT   0
- #define EXT4_PIN    14
- #define EXT5_PORT   0
- #define EXT5_PIN    17
- #define EXT6_PORT   0
- #define EXT6_PIN    18
- #define EXT7_PORT   0
- #define EXT7_PIN    19
- #define EXT8_PORT   1
- #define EXT8_PIN    20
- #define EXT9_PORT   1
- #define EXT9_PIN    21
- #define EXT10_PORT   1
- #define EXT10_PIN    22
- #define EXT11_PORT   1
- #define EXT11_PIN    23
- #define EXT12_PORT   1
- #define EXT12_PIN    5
- #define EXT13_PORT   1
- #define EXT13_PIN    6
- #define EXT14_PORT   1
- #define EXT14_PIN    8
- #define EXT15_PORT   0
- #define EXT15_PIN    19
- #define EXT16_PORT   0
- #define EXT16_PIN    13
- #define EXT17_PORT   0
- #define EXT17_PIN    16
-#else
- /** 4-layer board rev 2.1 **/
- #define EXT0_PORT   1
- #define EXT0_PIN    19
- #define EXT1_PORT   0
- #define EXT1_PIN    11
- #define EXT2_PORT   0
- #define EXT2_PIN    12
- #define EXT3_PORT   0
- #define EXT3_PIN    13
- #define EXT4_PORT   0
- #define EXT4_PIN    14
- #define EXT5_PORT   0
- #define EXT5_PIN    17
- #define EXT6_PORT   0
- #define EXT6_PIN    18
- #define EXT7_PORT   0
- #define EXT7_PIN    19
- #define EXT8_PORT   1
- #define EXT8_PIN    20
- #define EXT9_PORT   1
- #define EXT9_PIN    21
- #define EXT10_PORT   1
- #define EXT10_PIN    22
- #define EXT11_PORT   1
- #define EXT11_PIN    23
- #define EXT12_PORT   1
- #define EXT12_PIN    5
- #define EXT13_PORT   1
- #define EXT13_PIN    6
- #define EXT14_PORT   1
- #define EXT14_PIN    8
- #define EXT15_PORT   0
- #define EXT15_PIN    19
- #define EXT16_PORT   0
- #define EXT16_PIN    13
- #define EXT17_PORT   0
- #define EXT17_PIN    16
-
- #define EXT0 	P1_19
- #define EXT1	P0_11
- #define EXT2	P0_12
- #define EXT3	P0_13
- #define EXT4	P0_14
- #define EXT5	P0_17
- #define EXT6	P0_18
- #define EXT7	P0_19
- #define EXT8	P1_20
- #define EXT9	P1_21
- #define EXT10	P1_22
- #define EXT11	P1_23
- #define EXT12	P1_5
- #define EXT13	P1_6
- #define EXT14	P1_8
- #define EXT15	P1_26
- #define EXT16	P1_27
- #define EXT17	P0_16
-
-#endif // POK_BOARDREV
-
-#define CLR_EXT0 LPC_GPIO_PORT->CLR[EXT0_PORT] = 1 << EXT0_PIN;
-#define SET_EXT0 LPC_GPIO_PORT->SET[EXT0_PORT] = 1 << EXT0_PIN;
-#define CLR_EXT1 LPC_GPIO_PORT->CLR[EXT1_PORT] = 1 << EXT1_PIN;
-#define SET_EXT1 LPC_GPIO_PORT->SET[EXT1_PORT] = 1 << EXT1_PIN;
-#define CLR_EXT2 LPC_GPIO_PORT->CLR[EXT2_PORT] = 1 << EXT2_PIN;
-#define SET_EXT2 LPC_GPIO_PORT->SET[EXT2_PORT] = 1 << EXT2_PIN;
-#define CLR_EXT3 LPC_GPIO_PORT->CLR[EXT3_PORT] = 1 << EXT3_PIN;
-#define SET_EXT3 LPC_GPIO_PORT->SET[EXT3_PORT] = 1 << EXT3_PIN;
-#define CLR_EXT4 LPC_GPIO_PORT->CLR[EXT4_PORT] = 1 << EXT4_PIN;
-#define SET_EXT4 LPC_GPIO_PORT->SET[EXT4_PORT] = 1 << EXT4_PIN;
-#define CLR_EXT5 LPC_GPIO_PORT->CLR[EXT5_PORT] = 1 << EXT5_PIN;
-#define SET_EXT5 LPC_GPIO_PORT->SET[EXT5_PORT] = 1 << EXT5_PIN;
-#define CLR_EXT6 LPC_GPIO_PORT->CLR[EXT6_PORT] = 1 << EXT6_PIN;
-#define SET_EXT6 LPC_GPIO_PORT->SET[EXT6_PORT] = 1 << EXT6_PIN;
-#define CLR_EXT7 LPC_GPIO_PORT->CLR[EXT7_PORT] = 1 << EXT7_PIN;
-#define SET_EXT7 LPC_GPIO_PORT->SET[EXT7_PORT] = 1 << EXT7_PIN;
-#define CLR_EXT8 LPC_GPIO_PORT->CLR[EXT8_PORT] = 1 << EXT8_PIN;
-#define SET_EXT8 LPC_GPIO_PORT->SET[EXT8_PORT] = 1 << EXT8_PIN;
-#define CLR_EXT9 LPC_GPIO_PORT->CLR[EXT9_PORT] = 1 << EXT9_PIN;
-#define SET_EXT9 LPC_GPIO_PORT->SET[EXT9_PORT] = 1 << EXT9_PIN;
-#define CLR_EXT10 LPC_GPIO_PORT->CLR[EXT10_PORT] = 1 << EXT10_PIN;
-#define SET_EXT10 LPC_GPIO_PORT->SET[EXT10_PORT] = 1 << EXT10_PIN;
-#define CLR_EXT11 LPC_GPIO_PORT->CLR[EXT11_PORT] = 1 << EXT11_PIN;
-#define SET_EXT11 LPC_GPIO_PORT->SET[EXT11_PORT] = 1 << EXT11_PIN;
-#define CLR_EXT12 LPC_GPIO_PORT->CLR[EXT12_PORT] = 1 << EXT12_PIN;
-#define SET_EXT12 LPC_GPIO_PORT->SET[EXT12_PORT] = 1 << EXT12_PIN;
-#define CLR_EXT13 LPC_GPIO_PORT->CLR[EXT13_PORT] = 1 << EXT13_PIN;
-#define SET_EXT13 LPC_GPIO_PORT->SET[EXT13_PORT] = 1 << EXT13_PIN;
-#define CLR_EXT14 LPC_GPIO_PORT->CLR[EXT14_PORT] = 1 << EXT14_PIN;
-#define SET_EXT14 LPC_GPIO_PORT->SET[EXT14_PORT] = 1 << EXT14_PIN;
-#define CLR_EXT15 LPC_GPIO_PORT->CLR[EXT15_PORT] = 1 << EXT15_PIN;
-#define SET_EXT15 LPC_GPIO_PORT->SET[EXT15_PORT] = 1 << EXT15_PIN;
-#define CLR_EXT16 LPC_GPIO_PORT->CLR[EXT16_PORT] = 1 << EXT16_PIN;
-#define SET_EXT16 LPC_GPIO_PORT->SET[EXT16_PORT] = 1 << EXT16_PIN;
-#define CLR_EXT17 LPC_GPIO_PORT->CLR[EXT17_PORT] = 1 << EXT17_PIN;
-#define SET_EXT17 LPC_GPIO_PORT->SET[EXT17_PORT] = 1 << EXT17_PIN;
-
-#if POK_USE_EXT > 0
-//#if POK_BOARDREV == 1
- /** 2-layer board rev 1.3 **/
-//#else
- /** 4-layer board rev 2.1 **/
- //extern InterruptIn ext0;
- extern AnalogIn ext0;
- extern DigitalIn ext1;
- //DigitalOut ext0;
- //DigitalOut ext1;
- extern DigitalOut ext2;
- extern DigitalOut ext3;
- extern DigitalOut ext4;
- extern DigitalOut ext5;
- extern DigitalOut ext6;
- extern DigitalOut ext7;
- extern DigitalOut ext8;
- extern DigitalOut ext9;
- extern DigitalOut ext10;
- extern DigitalOut ext11;
- extern DigitalOut ext12;
- extern DigitalOut ext13;
- extern DigitalOut ext14;
- extern DigitalOut ext15;
- extern DigitalOut ext16;
- extern DigitalOut ext17;
-//#endif // POK_BOARDREV
-#endif // POK_USE_EXT
-
-extern int turn;
-#endif // POKITTO_EXTPORT_H
-
-
--- a/POKITTO_HW/SoftwareI2C.cpp	Wed Jun 27 13:14:54 2018 +0000
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,214 +0,0 @@
-/*
- * mbed Library to use a software master i2c interface on any GPIO pins
- * Copyright (c) 2012 Christopher Pepper
- * Released under the MIT License: http://mbed.org/license/mit
- */
-
-#include "SoftwareI2C.h"
-
-/**
- * @brief Initializes interface
- * @param sda GPIO pin to use as I2C SDA
- * @param scl GPIO pin to use as I2C SCL
- */
-
-SoftwareI2C::SoftwareI2C(PinName sda, PinName scl) : _sda(sda) , _scl(scl) {
-    _scl.output();
-    _scl.mode(OpenDrain);
-    _sda.output();
-    _sda.mode(OpenDrain);
-
-    _device_address = 0;
-    _frequency_delay = 1;
-
-    initialise();
-}
-
-SoftwareI2C::~SoftwareI2C() {
-
-}
-
-/**
- * @brief Read 1 or more bytes from the I2C slave
- * @param device_address The address of the device to read from
- * @param data An allocated array to read the data into
- * @param data_bytes Number of bytes to read (must be equal to or less then the allocated memory in data)
- */
-void SoftwareI2C::read(uint8_t device_address, uint8_t* data, uint8_t data_bytes) {
-    if (data == 0 || data_bytes == 0) return;
-
-    device_address = device_address | 0x01;
-    start();
-    putByte(device_address);
-    getAck();
-    for (int x = 0; x < data_bytes; ++x) {
-        data[x] = getByte();
-        if ( x < (data_bytes -1)) { //ack all but the final byte
-            giveAck();
-        }
-    }
-    stop();
-}
-
-/**
- * @brief Write 1 or more bytes to the I2C slave
- * @param device_address The address of the device to write to
- * @param data An array to write the data from
- * @param data_bytes Number of bytes to write from array
- */
-void SoftwareI2C::write(uint8_t device_address, uint8_t* data,  uint8_t data_bytes) {
-    if (data == 0 || data_bytes == 0) return;
-
-    device_address = device_address & 0xFE;
-    start();
-    putByte(device_address);
-    getAck();
-    for ( int x = 0; x < data_bytes; ++x ) {
-        putByte(data[x]);
-        getAck();
-    }
-    stop();
-}
-
-/**
- * @brief Write 1 byte to the I2C slave
- * @param device_address The address of the device to write to
- * @param byte The data to write
- */
-void SoftwareI2C::write(uint8_t device_address, uint8_t byte) {
-    device_address = device_address & 0xFE;
-    start();
-    putByte(device_address);
-    getAck();
-    putByte(byte);
-    getAck();
-    stop();
-}
-
-/**
- * @brief Read 1 or more bytes from the I2C slave at the specified memory address
- * @param device_address The address of the device to read from
- * @param start_address The memory address to read from
- * @param data The allocated array to read into
- * @param data_bytes The number of bytes to read
- */
-void SoftwareI2C::randomRead(uint8_t device_address, uint8_t start_address, uint8_t* data, uint8_t data_bytes) {
-    if (data == 0 || data_bytes == 0) return;
-
-    device_address = device_address & 0xFE;
-    start();
-    putByte(device_address);
-    if (!getAck()) {
-        return;
-    }
-    putByte(start_address);
-    if (!getAck()) {
-        return;
-    }
-
-    device_address=device_address | 0x01;
-    start();
-    putByte(device_address);
-    if (!getAck()) {
-        return;
-    }
-    for ( int x = 0; x < data_bytes; ++x) {
-        data[x] = getByte();
-        if (x != (data_bytes - 1)) giveAck();
-    }
-    stop();
-}
-
-/**
- * @brief Write 1 byte to the I2C slave at the specified memory address
- * @param device_address The address of the device to write to
- * @param start_address The memory address to write to
- * @param byte The data to write
- */
-void SoftwareI2C::randomWrite(uint8_t device_address, uint8_t start_address, uint8_t byte) {
-    device_address = device_address & 0xFE;
-    start();
-    putByte(device_address);
-    getAck();
-    putByte(start_address);
-    getAck();
-    putByte(byte);
-    getAck();
-    stop();
-}
-
-/**
- * @brief Write 1 or more bytes to the I2C slave at the specified memory address
- * @param device_address The address of the device to write to
- * @param start_address The memory address to write to
- * @param data The data to write
- * @param data_bytes The number of bytes to write
- */
-void SoftwareI2C::randomWrite(uint8_t device_address, uint8_t start_address, uint8_t* data, uint8_t data_bytes) {
-    if (data == 0 || data_bytes == 0) return;
-
-    device_address = device_address & 0xFE;
-    start();
-    putByte(device_address);
-    getAck();
-    putByte(start_address);
-    getAck();
-    for ( int x = 0; x <= data_bytes; ++x ) {
-        putByte(data[x]);
-        getAck();
-    }
-    stop();
-}
-
-/**
- * @brief Read 2 bytes from the I2C slave at the specified memory address and return them as an 16bit unsigned integer
- * @param device_address The address of the device to read from
- * @param start_address The memory address to read from
- * @return MSB 16bit unsigned integer
- */
-uint16_t SoftwareI2C::read16(uint8_t device_address, uint8_t start_address) {
-    uint8_t short_array[2] = {0, 0};
-    randomRead(device_address, start_address, short_array, 2 );
-    uint16_t value = 0;
-    value = short_array[0] << 8;
-    value |= short_array[1];
-
-    return value;
-}
-
-/**
- * @brief Read 3 bytes from the I2C slave at the specified memory address and return them as an 32bit unsigned integer
- * @param device_address The address of the device to read from
- * @param start_address The memory address to read from
- * @return MSB 32bit unsigned integer
- */
-uint32_t SoftwareI2C::read24(uint8_t device_address, uint8_t start_address) {
-    uint8_t value_array[4] = {0, 0, 0};
-    randomRead(device_address, start_address, value_array, 3 );
-    uint32_t value = 0;
-    value = value_array[0] << 16;
-    value |= value_array[1] << 8;
-    value |= value_array[2];
-
-    return value;
-}
-
-/**
- * @brief Read 4 bytes from the I2C slave at the specified memory address and return them as an 32bit unsigned integer
- * @param device_address The address of the device to read from
- * @param start_address The memory address to read from
- * @return MSB 32bit unsigned integer
- */
-uint32_t SoftwareI2C::read32(uint8_t device_address, uint8_t start_address) {
-    uint8_t value_array[4] = {0, 0, 0, 0};
-    randomRead(device_address, start_address, value_array, 4 );
-    uint32_t value = 0;
-    value = value_array[0] << 24;
-    value |= value_array[1] << 16;
-    value |= value_array[2] << 8;
-    value |= value_array[3];
-
-    return value;
-}
-
-
--- a/POKITTO_HW/SoftwareI2C.h	Wed Jun 27 13:14:54 2018 +0000
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,146 +0,0 @@
-/*
- * mbed Library to use a software master i2c interface on any GPIO pins
- * Copyright (c) 2012 Christopher Pepper
- * Released under the MIT License: http://mbed.org/license/mit
- */
-
-#ifndef _SOFTWARE_I2C_H_
-#define _SOFTWARE_I2C_H_
-
-#include "mbed.h"
-
-/**
-  * @brief SoftwareI2C class
-  */
-
-class SoftwareI2C {
-public:
-    SoftwareI2C(PinName sda, PinName scl);
-    ~SoftwareI2C();
-
-    void read(uint8_t device_address, uint8_t* data, uint8_t data_bytes);
-    void write(uint8_t device_address, uint8_t* data,  uint8_t data_bytes);
-    void write(uint8_t device_address, uint8_t byte);
-    void randomRead(uint8_t device_address, uint8_t start_address, uint8_t* data, uint8_t data_bytes);
-    void randomWrite(uint8_t device_address, uint8_t start_address, uint8_t* data, uint8_t data_bytes);
-    void randomWrite(uint8_t device_address, uint8_t start_address, uint8_t byte);
-
-    uint8_t read8(uint8_t device_address, uint8_t start_address);
-    uint16_t read16(uint8_t device_address, uint8_t start_address);
-    uint32_t read24(uint8_t device_address, uint8_t start_address);
-    uint32_t read32(uint8_t device_address, uint8_t start_address);
-
-    void setDeviceAddress(uint8_t address){
-        _device_address = address;
-    }
-
-    void setFrequency(uint32_t frequency){
-        _frequency_delay = 1000000 / frequency;
-    }
-
-    inline void initialise() {
-        _scl.output();
-        _sda.output();
-
-        _sda = 1;
-        _scl = 0;
-        wait_us(_frequency_delay);
-
-        for ( int n = 0; n <= 3; ++n ) {
-            stop();
-        }
-    }
-
-private:
-    inline void start() {
-        _sda.output();
-        wait_us(_frequency_delay);
-        _scl = 1;
-        _sda = 1;
-        wait_us(_frequency_delay);
-        _sda = 0;
-        wait_us(_frequency_delay);
-        _scl = 0;
-        wait_us(_frequency_delay);
-    }
-
-    inline void stop() {
-        _sda.output();
-        wait_us(_frequency_delay);
-        _sda = 0;
-        wait_us(_frequency_delay);
-        _scl = 1;
-        wait_us(_frequency_delay);
-        _sda = 1;
-    }
-
-    inline void putByte(uint8_t byte) {
-        _sda.output();
-        for ( int n = 8; n > 0; --n) {
-            wait_us(_frequency_delay);
-            _sda = byte & (1 << (n-1));
-            _scl = 1;
-            wait_us(_frequency_delay);
-            _scl = 0;
-        }
-        _sda = 1;
-    }
-
-    inline uint8_t getByte() {
-        uint8_t byte = 0;
-
-        _sda.input();          //release the data line
-        _sda.mode(OpenDrain);
-
-        wait_us(_frequency_delay);
-
-        for ( int n = 8; n > 0; --n ) {
-            _scl=1;            //set clock high
-            wait_us(_frequency_delay);
-            byte |= _sda << (n-1); //read the bit
-            wait_us(_frequency_delay);
-            _scl=0;            //set clock low
-            wait_us(_frequency_delay);
-        }
-
-        _sda.output();         //take data line back
-
-        return byte;
-    }
-
-    inline void giveAck() {
-        _sda.output();
-        wait_us(_frequency_delay);
-        _sda = 0;
-        _scl = 1;
-        wait_us(_frequency_delay);
-        _scl = 0;
-        _sda = 1;
-
-    }
-
-    inline bool getAck() {
-        _sda.output();
-        _sda = 1;
-        _scl = 1;
-        _sda.input();
-        _sda.mode(OpenDrain);
-        wait_us(_frequency_delay);
-        _scl = 0;
-
-        if(_sda != 0){return false;}
-
-        wait_us(_frequency_delay);
-        return true;
-    }
-
-    DigitalInOut _sda;
-    DigitalInOut _scl;
-
-    uint8_t _device_address;
-    uint32_t _frequency_delay;
-};
-
-#endif
-
-
--- a/POKITTO_HW/clock_11u6x.c	Wed Jun 27 13:14:54 2018 +0000
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,120 +0,0 @@
-#include "clock_11u6x.h"
-
-
-/* Inprecise clock rates for the watchdog oscillator */
-STATIC const uint32_t wdtOSCRate[WDTLFO_OSC_4_60 + 1] = {
-	0,					/* WDT_OSC_ILLEGAL */
-	600000,				/* WDT_OSC_0_60 */
-	1050000,			/* WDT_OSC_1_05 */
-	1400000,			/* WDT_OSC_1_40 */
-	1750000,			/* WDT_OSC_1_75 */
-	2100000,			/* WDT_OSC_2_10 */
-	2400000,			/* WDT_OSC_2_40 */
-	2700000,			/* WDT_OSC_2_70 */
-	3000000,			/* WDT_OSC_3_00 */
-	3250000,			/* WDT_OSC_3_25 */
-	3500000,			/* WDT_OSC_3_50 */
-	3750000,			/* WDT_OSC_3_75 */
-	4000000,			/* WDT_OSC_4_00 */
-	4200000,			/* WDT_OSC_4_20 */
-	4400000,			/* WDT_OSC_4_40 */
-	4600000				/* WDT_OSC_4_60 */
-};
-
-/* Compute a PLL frequency */
-STATIC uint32_t Chip_Clock_GetPLLFreq(uint32_t PLLReg, uint32_t inputRate)
-{
-	uint32_t msel = ((PLLReg & 0x1F) + 1);
-
-	return inputRate * msel;
-}
-
-/* Return System PLL output clock rate */
-uint32_t Chip_Clock_GetSystemPLLOutClockRate(void)
-{
-	return Chip_Clock_GetPLLFreq(LPC_SYSCTL->SYSPLLCTRL,
-								 Chip_Clock_GetSystemPLLInClockRate());
-}
-
-
-/* Compute a WDT rate */
-STATIC uint32_t Chip_Clock_GetWDTRate(uint32_t reg)
-{
-	uint32_t div;
-	CHIP_WDTLFO_OSC_T clk;
-
-	/* Get WDT oscillator settings */
-	clk = (CHIP_WDTLFO_OSC_T) ((reg >> 5) & 0xF);
-	div = reg & 0x1F;
-
-	/* Compute clock rate and divided by divde value */
-	return wdtOSCRate[clk] / ((div + 1) << 1);
-}
-
-/* Return estimated watchdog oscillator rate */
-uint32_t Chip_Clock_GetWDTOSCRate(void)
-{
-	return Chip_Clock_GetWDTRate(LPC_SYSCTL->WDTOSCCTRL);
-}
-
-
-/* Return System PLL input clock rate */
-uint32_t Chip_Clock_GetSystemPLLInClockRate(void)
-{
-	uint32_t clkRate;
-
-	switch ((CHIP_SYSCTL_PLLCLKSRC_T) (LPC_SYSCTL->SYSPLLCLKSEL & 0x3)) {
-	case SYSCTL_PLLCLKSRC_IRC:
-		clkRate = Chip_Clock_GetIntOscRate();
-		break;
-
-	case SYSCTL_PLLCLKSRC_MAINOSC:
-		clkRate = Chip_Clock_GetMainOscRate();
-		break;
-
-	case SYSCTL_PLLCLKSRC_RTC32K:
-		clkRate = Chip_Clock_GetRTCOscRate();
-		break;
-
-	default:
-		clkRate = 0;
-	}
-
-	return clkRate;
-}
-
-
-/* Return main clock rate */
-uint32_t Chip_Clock_GetMainClockRate(void)
-{
-	uint32_t clkRate = 0;
-
-	switch ((CHIP_SYSCTL_MAINCLKSRC_T) (LPC_SYSCTL->MAINCLKSEL & 0x3)) {
-	case SYSCTL_MAINCLKSRC_IRC:
-		clkRate = Chip_Clock_GetIntOscRate();
-		break;
-
-	case SYSCTL_MAINCLKSRC_PLLIN:
-		clkRate = Chip_Clock_GetSystemPLLInClockRate();
-		break;
-
-	case SYSCTL_MAINCLKSRC_WDTOSC:
-		clkRate = Chip_Clock_GetWDTOSCRate();
-		break;
-
-	case SYSCTL_MAINCLKSRC_PLLOUT:
-		clkRate = Chip_Clock_GetSystemPLLOutClockRate();
-		break;
-	}
-
-	return clkRate;
-}
-
-/* Return system clock rate */
-uint32_t Chip_Clock_GetSystemClockRate(void)
-{
-	/* No point in checking for divide by 0 */
-	return Chip_Clock_GetMainClockRate() / LPC_SYSCTL->SYSAHBCLKDIV;
-}
-
-
--- a/POKITTO_HW/clock_11u6x.h	Wed Jun 27 13:14:54 2018 +0000
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,595 +0,0 @@
-/*
- * @brief LPC11U6X Clock control functions
- *
- * @note
- * Copyright(C) NXP Semiconductors, 2013
- * All rights reserved.
- *
- * @par
- * Software that is described herein is for illustrative purposes only
- * which provides customers with programming information regarding the
- * LPC products.  This software is supplied "AS IS" without any warranties of
- * any kind, and NXP Semiconductors and its licensor disclaim any and
- * all warranties, express or implied, including all implied warranties of
- * merchantability, fitness for a particular purpose and non-infringement of
- * intellectual property rights.  NXP Semiconductors assumes no responsibility
- * or liability for the use of the software, conveys no license or rights under any
- * patent, copyright, mask work right, or any other intellectual property rights in
- * or to any products. NXP Semiconductors reserves the right to make changes
- * in the software without notification. NXP Semiconductors also makes no
- * representation or warranty that such application will be suitable for the
- * specified use without further testing or modification.
- *
- * @par
- * Permission to use, copy, modify, and distribute this software and its
- * documentation is hereby granted, under NXP Semiconductors' and its
- * licensor's relevant copyrights in the software, without fee, provided that it
- * is used in conjunction with NXP Semiconductors microcontrollers.  This
- * copyright, permission, and disclaimer notice must appear in all copies of
- * this code.
- */
-
-#ifndef __CLOCK_11U6X_H_
-#define __CLOCK_11U6X_H_
-
-#include "lpc_defs.h"
-#define STATIC static
-#define INLINE inline
-#define bool unsigned char
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-/** @defgroup CLOCK_11U6X CHIP: LPC11u6x Clock Control block driver
- * @ingroup CHIP_11U6X_Drivers
- * @{
- */
-
-/** Internal oscillator frequency */
-#define SYSCTL_IRC_FREQ (12000000)
-
-/**
- * @brief	Set System PLL divider values
- * @param	msel    : PLL feedback divider value. M = msel + 1.
- * @param	psel    : PLL post divider value. P =  (1<<psel).
- * @return	Nothing
- * @note	See the user manual for how to setup the PLL.
- */
-STATIC INLINE void Chip_Clock_SetupSystemPLL(uint8_t msel, uint8_t psel)
-{
-	LPC_SYSCTL->SYSPLLCTRL = (msel & 0x1F) | ((psel & 0x3) << 5);
-}
-
-/**
- * @brief	Read System PLL lock status
- * @return	true of the PLL is locked. false if not locked
- */
-STATIC INLINE bool Chip_Clock_IsSystemPLLLocked(void)
-{
-	return (bool) ((LPC_SYSCTL->SYSPLLSTAT & 1) != 0);
-}
-
-/**
- * Clock sources for system PLL
- */
-typedef enum CHIP_SYSCTL_PLLCLKSRC {
-	SYSCTL_PLLCLKSRC_IRC = 0,		/*!< Internal oscillator in */
-	SYSCTL_PLLCLKSRC_MAINOSC,		/*!< Crystal (main) oscillator in */
-	SYSCTL_PLLCLKSRC_SYSOSC = SYSCTL_PLLCLKSRC_MAINOSC,
-	SYSCTL_PLLCLKSRC_RESERVED1,		/*!< Reserved */
-	SYSCTL_PLLCLKSRC_RTC32K,		/*!< RTC 32KHz clock */
-} CHIP_SYSCTL_PLLCLKSRC_T;
-
-/**
- * @brief	Set System PLL clock source
- * @param	src	: Clock source for system PLL
- * @return	Nothing
- * @note	This function will also toggle the clock source update register
- * to update the clock source.
- */
-void Chip_Clock_SetSystemPLLSource(CHIP_SYSCTL_PLLCLKSRC_T src);
-
-/**
- * @brief	Set USB PLL divider values
- * @param	msel    : PLL feedback divider value. M = msel + 1.
- * @param	psel    : PLL post divider value. P = (1<<psel).
- * @return	Nothing
- * @note	See the user manual for how to setup the PLL.
- */
-STATIC INLINE void Chip_Clock_SetupUSBPLL(uint8_t msel, uint8_t psel)
-{
-	LPC_SYSCTL->USBPLLCTRL = (msel & 0x1F) | ((psel & 0x3) << 5);
-}
-
-/**
- * @brief	Read USB PLL lock status
- * @return	true of the PLL is locked. false if not locked
- */
-STATIC INLINE bool Chip_Clock_IsUSBPLLLocked(void)
-{
-	return (bool) ((LPC_SYSCTL->USBPLLSTAT & 1) != 0);
-}
-
-/**
- * Clock sources for USB PLL
- */
-typedef enum CHIP_SYSCTL_USBPLLCLKSRC {
-	SYSCTL_USBPLLCLKSRC_IRC = 0,		/*!< Internal oscillator in */
-	SYSCTL_USBPLLCLKSRC_MAINOSC,		/*!< Crystal (main) oscillator in */
-	SYSCTL_USBPLLCLKSRC_SYSOSC = SYSCTL_USBPLLCLKSRC_MAINOSC,
-	SYSCTL_USBPLLCLKSRC_RESERVED1,		/*!< Reserved */
-	SYSCTL_USBPLLCLKSRC_RESERVED2,		/*!< Reserved */
-} CHIP_SYSCTL_USBPLLCLKSRC_T;
-
-/**
- * @brief	Set USB PLL clock source
- * @param	src	: Clock source for USB PLL
- * @return	Nothing
- * @note	This function will also toggle the clock source update register
- * to update the clock source.
- */
-void Chip_Clock_SetUSBPLLSource(CHIP_SYSCTL_USBPLLCLKSRC_T src);
-
-/**
- * @brief	Bypass System Oscillator and set oscillator frequency range
- * @param	bypass	: Flag to bypass oscillator
- * @param	highfr	: Flag to set oscillator range from 15-25 MHz
- * @return	Nothing
- * @note	Sets the PLL input to bypass the oscillator. This would be
- * used if an external clock that is not an oscillator is attached
- * to the XTALIN pin.
- */
-void Chip_Clock_SetPLLBypass(bool bypass, bool highfr);
-
-/**
- * @brief	Enable the RTC 32KHz output
- * @return	Nothing
- * @note	This clock can be used for the main clock directly, but
- *			do not use this clock with the system PLL.
- */
-STATIC INLINE void Chip_Clock_EnableRTCOsc(void)
-{
-	LPC_SYSCTL->RTCOSCCTRL  = 1;
-}
-
-/**
- * @brief	Disable the RTC 32KHz output
- * @return	Nothing
- */
-STATIC INLINE void Chip_Clock_DisableRTCOsc(void)
-{
-	LPC_SYSCTL->RTCOSCCTRL  = 0;
-}
-
-/**
- * Watchdog and low frequency oscillator frequencies plus or minus 40%
- */
-typedef enum CHIP_WDTLFO_OSC {
-	WDTLFO_OSC_ILLEGAL,
-	WDTLFO_OSC_0_60,	/*!< 0.6 MHz watchdog/LFO rate */
-	WDTLFO_OSC_1_05,	/*!< 1.05 MHz watchdog/LFO rate */
-	WDTLFO_OSC_1_40,	/*!< 1.4 MHz watchdog/LFO rate */
-	WDTLFO_OSC_1_75,	/*!< 1.75 MHz watchdog/LFO rate */
-	WDTLFO_OSC_2_10,	/*!< 2.1 MHz watchdog/LFO rate */
-	WDTLFO_OSC_2_40,	/*!< 2.4 MHz watchdog/LFO rate */
-	WDTLFO_OSC_2_70,	/*!< 2.7 MHz watchdog/LFO rate */
-	WDTLFO_OSC_3_00,	/*!< 3.0 MHz watchdog/LFO rate */
-	WDTLFO_OSC_3_25,	/*!< 3.25 MHz watchdog/LFO rate */
-	WDTLFO_OSC_3_50,	/*!< 3.5 MHz watchdog/LFO rate */
-	WDTLFO_OSC_3_75,	/*!< 3.75 MHz watchdog/LFO rate */
-	WDTLFO_OSC_4_00,	/*!< 4.0 MHz watchdog/LFO rate */
-	WDTLFO_OSC_4_20,	/*!< 4.2 MHz watchdog/LFO rate */
-	WDTLFO_OSC_4_40,	/*!< 4.4 MHz watchdog/LFO rate */
-	WDTLFO_OSC_4_60		/*!< 4.6 MHz watchdog/LFO rate */
-} CHIP_WDTLFO_OSC_T;
-
-/**
- * @brief	Setup Watchdog oscillator rate and divider
- * @param	wdtclk	: Selected watchdog clock rate
- * @param	div		: Watchdog divider value, even value between 2 and 64
- * @return	Nothing
- * @note	Watchdog rate = selected rate divided by divider rate
- */
-STATIC INLINE void Chip_Clock_SetWDTOSC(CHIP_WDTLFO_OSC_T wdtclk, uint8_t div)
-{
-	LPC_SYSCTL->WDTOSCCTRL  = (((uint32_t) wdtclk) << 5) | ((div >> 1) - 1);
-}
-
-/**
- * Clock sources for main system clock
- */
-typedef enum CHIP_SYSCTL_MAINCLKSRC {
-	SYSCTL_MAINCLKSRC_IRC = 0,		/*!< Internal oscillator */
-	SYSCTL_MAINCLKSRC_PLLIN,		/*!< System PLL input */
-	SYSCTL_MAINCLKSRC_WDTOSC,		/*!< Watchdog oscillator rate */
-	SYSCTL_MAINCLKSRC_PLLOUT,		/*!< System PLL output */
-} CHIP_SYSCTL_MAINCLKSRC_T;
-
-/**
- * @brief	Set main system clock source
- * @param	src	: Clock source for main system
- * @return	Nothing
- * @note	This function will also toggle the clock source update register
- * to update the clock source.
- */
-void Chip_Clock_SetMainClockSource(CHIP_SYSCTL_MAINCLKSRC_T src);
-
-/**
- * @brief   Returns the main clock source
- * @return	Which clock is used for the core clock source?
- */
-STATIC INLINE CHIP_SYSCTL_MAINCLKSRC_T Chip_Clock_GetMainClockSource(void)
-{
-	return (CHIP_SYSCTL_MAINCLKSRC_T) (LPC_SYSCTL->MAINCLKSEL);
-}
-
-/**
- * @brief	Set system clock divider
- * @param	div	: divider for system clock
- * @return	Nothing
- * @note	Use 0 to disable, or a divider value of 1 to 255. The system clock
- * rate is the main system clock divided by this value.
- */
-STATIC INLINE void Chip_Clock_SetSysClockDiv(uint32_t div)
-{
-	LPC_SYSCTL->SYSAHBCLKDIV  = div;
-}
-
-/**
- * System and peripheral clocks
- */
-typedef enum CHIP_SYSCTL_CLOCK {
-	SYSCTL_CLOCK_SYS = 0,				/*!< 0: System clock */
-	SYSCTL_CLOCK_ROM,					/*!< 1:  ROM clock */
-	SYSCTL_CLOCK_RAM0,					/*!< 2: RAM0 clock */
-	SYSCTL_CLOCK_FLASHREG,				/*!< 3: FLASH register interface clock */
-	SYSCTL_CLOCK_FLASHARRAY,			/*!< 4: FLASH array access clock */
-	SYSCTL_CLOCK_I2C0,					/*!< 5: I2C0 clock */
-	SYSCTL_CLOCK_GPIO,					/*!< 6: GPIO clock */
-	SYSCTL_CLOCK_CT16B0,				/*!< 7: 16-bit Counter/timer 0 clock */
-	SYSCTL_CLOCK_CT16B1,				/*!< 8: 16-bit Counter/timer 1 clock */
-	SYSCTL_CLOCK_CT32B0,				/*!< 9: 32-bit Counter/timer 0 clock */
-	SYSCTL_CLOCK_CT32B1,				/*!< 10: 32-bit Counter/timer 1 clock */
-	SYSCTL_CLOCK_SSP0,					/*!< 11: SSP0 clock */
-	SYSCTL_CLOCK_UART0,					/*!< 12: UART0 clock */
-	SYSCTL_CLOCK_ADC,					/*!< 13: ADC clock */
-	SYSCTL_CLOCK_USB,					/*!< 14: USB clock */
-	SYSCTL_CLOCK_WDT,					/*!< 15: Watchdog timer clock */
-	SYSCTL_CLOCK_IOCON,					/*!< 16: IOCON block clock */
-	SYSCTL_CLOCK_RESERVED17,			/*!< 17: Reserved */
-	SYSCTL_CLOCK_SSP1,					/*!< 18: SSP1 clock */
-	SYSCTL_CLOCK_PINT,					/*!< 19: GPIO Pin int register interface clock */
-	SYSCTL_CLOCK_USART1,				/*!< 20: USART1 clock */
-	SYSCTL_CLOCK_USART2,				/*!< 21: USART2 clock */
-	SYSCTL_CLOCK_USART3_4,				/*!< 22: USART3_4 clock */
-	SYSCTL_CLOCK_P0INT,					/*!< 23: GPIO GROUP1 interrupt register clock */
-	SYSCTL_CLOCK_GROUP0INT = SYSCTL_CLOCK_P0INT,/*!< 23: GPIO GROUP0 interrupt register interface clock */
-	SYSCTL_CLOCK_P1INT,					/*!< 24: GPIO GROUP1 interrupt register clock */
-	SYSCTL_CLOCK_GROUP1INT = SYSCTL_CLOCK_P1INT,/*!< 24: GPIO GROUP1 interrupt register interface clock */
-	SYSCTL_CLOCK_I2C1,					/*!< 25: I2C1 clock */
-	SYSCTL_CLOCK_RAM1,					/*!< 26: SRAM block clock */
-	SYSCTL_CLOCK_USBRAM,				/*!< 27: USB SRAM block clock */
-	SYSCTL_CLOCK_CRC,					/*!< 25: CRC clock */
-	SYSCTL_CLOCK_DMA,					/*!< 25: DMA clock */
-	SYSCTL_CLOCK_RTC,					/*!< 25: RTC clock */
-	SYSCTL_CLOCK_SCT0_1,				/*!< 25: SCT 0/1 clock */
-} CHIP_SYSCTL_CLOCK_T;
-
-/**
- * @brief	Enable a system or peripheral clock
- * @param	clk	: Clock to enable
- * @return	Nothing
- */
-STATIC INLINE void Chip_Clock_EnablePeriphClock(CHIP_SYSCTL_CLOCK_T clk)
-{
-	LPC_SYSCTL->SYSAHBCLKCTRL |= (1 << clk);
-}
-
-/**
- * @brief	Disable a system or peripheral clock
- * @param	clk	: Clock to disable
- * @return	Nothing
- */
-STATIC INLINE void Chip_Clock_DisablePeriphClock(CHIP_SYSCTL_CLOCK_T clk)
-{
-	LPC_SYSCTL->SYSAHBCLKCTRL &= ~(1 << clk);
-}
-
-/**
- * @brief	Set SSP0 divider
- * @param	div	: divider for SSP0 clock
- * @return	Nothing
- * @note	Use 0 to disable, or a divider value of 1 to 255. The SSP0 clock
- * rate is the main system clock divided by this value.
- */
-STATIC INLINE void Chip_Clock_SetSSP0ClockDiv(uint32_t div)
-{
-	LPC_SYSCTL->SSP0CLKDIV  = div;
-}
-
-/**
- * @brief	Return SSP0 divider
- * @return	divider for SSP0 clock
- * @note	A value of 0 means the clock is disabled.
- */
-STATIC INLINE uint32_t Chip_Clock_GetSSP0ClockDiv(void)
-{
-	return LPC_SYSCTL->SSP0CLKDIV;
-}
-
-/**
- * @brief	Set USART0 divider clock
- * @param	div	: divider for UART clock
- * @return	Nothing
- * @note	Use 0 to disable, or a divider value of 1 to 255. The UART clock
- * rate is the main system clock divided by this value.
- */
-STATIC INLINE void Chip_Clock_SetUSART0ClockDiv(uint32_t div)
-{
-	LPC_SYSCTL->USART0CLKDIV  = div;
-}
-
-/**
- * @brief	Return USART0 divider
- * @return	divider for UART clock
- * @note	A value of 0 means the clock is disabled.
- */
-STATIC INLINE uint32_t Chip_Clock_GetUASRT0ClockDiv(void)
-{
-	return LPC_SYSCTL->USART0CLKDIV;
-}
-
-/**
- * @brief	Set SSP1 divider clock
- * @param	div	: divider for SSP1 clock
- * @return	Nothing
- * @note	Use 0 to disable, or a divider value of 1 to 255. The SSP1 clock
- * rate is the main system clock divided by this value.
- */
-STATIC INLINE void Chip_Clock_SetSSP1ClockDiv(uint32_t div)
-{
-	LPC_SYSCTL->SSP1CLKDIV  = div;
-}
-
-/**
- * @brief	Return SSP1 divider
- * @return	divider for SSP1 clock
- * @note	A value of 0 means the clock is disabled.
- */
-STATIC INLINE uint32_t Chip_Clock_GetSSP1ClockDiv(void)
-{
-	return LPC_SYSCTL->SSP1CLKDIV;
-}
-
-/**
- * @brief	Set USART 1/2/3/4 UART base rate (up to main clock rate)
- * @param	rate	: Desired rate for fractional divider/multipler output
- * @param	fEnable	: true to use fractional clocking, false for integer clocking
- * @return	Actual rate generated
- * @note	USARTs 1 - 4 use the same base clock for their baud rate
- *			basis. This function is used to generate that clock, while the
- *			UART driver's SetBaud functions will attempt to get the closest
- *			baud rate from this base clock without altering it. This needs
- *			to be setup prior to individual UART setup.<br>
- *			UARTs need a base clock 16x faster than the baud rate, so if you
- *			need a 115.2Kbps baud rate, you will need a clock rate of at
- *			least (115.2K * 16). The UART base clock is generated from the
- *			main system clock, so fractional clocking may be the only
- *			possible choice when using a low main system clock frequency.
- *			Do not alter the FRGCLKDIV register after this call.
- */
-uint32_t Chip_Clock_SetUSARTNBaseClockRate(uint32_t rate, bool fEnable);
-
-/**
- * @brief	Get USART 1/2/3/4 UART base rate
- * @return	USART 1/2/3/4 UART base rate
- */
-uint32_t Chip_Clock_GetUSARTNBaseClockRate(void);
-
-/**
- * @brief	Set USART 1/2/3/4 fractional baud rate divider clock
- * @param	div	: divider for USART 1/2/3/4 fractional baud rate clock
- * @return	Nothing
- * @note	Use 0 to disable, or a divider value of 1 to 255.
- * This does not affect USART0.
- */
-STATIC INLINE void Chip_Clock_SetUSARTNBaseClockDiv(uint8_t div)
-{
-	LPC_SYSCTL->FRGCLKDIV = (uint32_t) div;
-}
-
-/**
- * @brief	Return USART 1/2/3/4 fractional baud rate divider
- * @return	divider for USART 1/2/3/4 fractional baud rate clock
- * @note	A value of 0 means the clock is disabled.
- * This does not affect USART0.
- */
-STATIC INLINE uint32_t Chip_Clock_GetUSARTNBaseClockDiv(void)
-{
-	return LPC_SYSCTL->FRGCLKDIV;
-}
-
-/**
- * @brief	Set The USART Fractional Generator Divider
- * @param   div  :  Fractional Generator Divider value, should be 0xFF
- * @return	Nothing
- */
-STATIC INLINE void Chip_Clock_SetUSARTNFRGDivider(uint8_t div)
-{
-	LPC_SYSCTL->UARTFRGDIV = (uint32_t) div;
-}
-
-/**
- * @brief	Set The USART Fractional Generator Divider
- * @return	Value of USART Fractional Generator Divider
- */
-STATIC INLINE uint32_t Chip_Clock_GetUSARTNFRGDivider(void)
-{
-	return LPC_SYSCTL->UARTFRGDIV;
-}
-
-/**
- * @brief	Set The USART Fractional Generator Multiplier
- * @param   mult  :  An 8-bit value (0-255) U_PCLK = UARTCLKDIV/(1 + MULT/256)
- * @return	Nothing
- */
-STATIC INLINE void Chip_Clock_SetUSARTNFRGMultiplier(uint8_t mult)
-{
-	LPC_SYSCTL->UARTFRGMULT = (uint32_t) mult;
-}
-
-/**
- * @brief	Get The USART Fractional Generator Multiplier
- * @return	Value of USART Fractional Generator Multiplier
- */
-STATIC INLINE uint32_t Chip_Clock_GetUSARTNFRGMultiplier(void)
-{
-	return LPC_SYSCTL->UARTFRGMULT;
-}
-
-/**
- * Clock sources for USB
- */
-typedef enum CHIP_SYSCTL_USBCLKSRC {
-	SYSCTL_USBCLKSRC_PLLOUT = 0,	/*!< USB PLL out */
-	SYSCTL_USBCLKSRC_MAINSYSCLK,	/*!< Main system clock */
-} CHIP_SYSCTL_USBCLKSRC_T;
-
-/**
- * @brief	Set USB clock source and divider
- * @param	src	: Clock source for USB
- * @param	div	: divider for USB clock
- * @return	Nothing
- * @note	Use 0 to disable, or a divider value of 1 to 255. The USB clock
- * rate is either the main system clock or USB PLL output clock divided
- * by this value. This function will also toggle the clock source
- * update register to update the clock source.
- */
-void Chip_Clock_SetUSBClockSource(CHIP_SYSCTL_USBCLKSRC_T src, uint32_t div);
-
-/**
- * Clock sources for CLKOUT
- */
-typedef enum CHIP_SYSCTL_CLKOUTSRC {
-	SYSCTL_CLKOUTSRC_IRC = 0,		/*!< Internal oscillator for CLKOUT */
-	SYSCTL_CLKOUTSRC_MAINOSC,		/*!< Main oscillator for CLKOUT */
-	SYSCTL_CLKOUTSRC_SYSOSC = SYSCTL_CLKOUTSRC_MAINOSC,
-	SYSCTL_CLKOUTSRC_WDTOSC,		/*!< Watchdog oscillator for CLKOUT */
-	SYSCTL_CLKOUTSRC_MAINSYSCLK,	/*!< Main system clock for CLKOUT */
-} CHIP_SYSCTL_CLKOUTSRC_T;
-
-/**
- * @brief	Set CLKOUT clock source and divider
- * @param	src	: Clock source for CLKOUT
- * @param	div	: divider for CLKOUT clock
- * @return	Nothing
- * @note	Use 0 to disable, or a divider value of 1 to 255. The CLKOUT clock
- * rate is the clock source divided by the divider. This function will
- * also toggle the clock source update register to update the clock
- * source.
- */
-void Chip_Clock_SetCLKOUTSource(CHIP_SYSCTL_CLKOUTSRC_T src, uint32_t div);
-
-/**
- * @brief	Set IOCON glitch filter clock divider value
- * @param	index	: IOCON divider index (0 - 6) to set
- * @param	div		: value for IOCON filter divider value
- * @return	Nothing
- * @note	Use 0 to disable, or a divider value of 1 to 255.
- */
-STATIC INLINE void Chip_Clock_SetIOCONFiltClockDiv(int index, uint32_t div)
-{
-	LPC_SYSCTL->IOCONCLKDIV[6 - index]  = div;
-}
-
-/**
- * @brief	Return IOCON glitch filter clock divider value
- * @param	index	: IOCON divider index (0 - 6) to get
- * @return	IOCON glitch filter clock divider value
- */
-STATIC INLINE uint32_t Chip_Clock_GetIOCONFiltClockDiv(int index)
-{
-	return LPC_SYSCTL->IOCONCLKDIV[6 - index];
-}
-
-/**
- * @brief	Returns the main oscillator clock rate
- * @return	main oscillator clock rate in Hz
- */
-STATIC INLINE uint32_t Chip_Clock_GetMainOscRate(void)
-{
-	return 12000000; //OscRateIn;
-}
-
-/**
- * @brief	Returns the internal oscillator (IRC) clock rate
- * @return	internal oscillator (IRC) clock rate in Hz
- */
-STATIC INLINE uint32_t Chip_Clock_GetIntOscRate(void)
-{
-	return SYSCTL_IRC_FREQ;
-}
-
-/**
- * @brief	Returns the RTC clock rate
- * @return	RTC oscillator clock rate in Hz
- */
-STATIC INLINE uint32_t Chip_Clock_GetRTCOscRate(void)
-{
-	return 32768;//RTCOscRateIn;
-}
-
-/**
- * @brief	Return estimated watchdog oscillator rate
- * @return	Estimated watchdog oscillator rate
- * @note	This rate is accurate to plus or minus 40%.
- */
-uint32_t Chip_Clock_GetWDTOSCRate(void);
-
-/**
- * @brief	Return System PLL input clock rate
- * @return	System PLL input clock rate
- */
-uint32_t Chip_Clock_GetSystemPLLInClockRate(void);
-
-/**
- * @brief	Return System PLL output clock rate
- * @return	System PLL output clock rate
- */
-uint32_t Chip_Clock_GetSystemPLLOutClockRate(void);
-
-/**
- * @brief	Return USB PLL input clock rate
- * @return	USB PLL input clock rate
- */
-uint32_t Chip_Clock_GetUSBPLLInClockRate(void);
-
-/**
- * @brief	Return USB PLL output clock rate
- * @return	USB PLL output clock rate
- */
-uint32_t Chip_Clock_GetUSBPLLOutClockRate(void);
-
-/**
- * @brief	Return main clock rate
- * @return	main clock rate
- */
-uint32_t Chip_Clock_GetMainClockRate(void);
-
-/**
- * @brief	Return system clock rate
- * @return	system clock rate
- */
-uint32_t Chip_Clock_GetSystemClockRate(void);
-
-/**
- * @}
- */
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif /* __CLOCK_11U6X_H_ */
-
--- a/POKITTO_HW/dma_11u6x.c	Wed Jun 27 13:14:54 2018 +0000
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,128 +0,0 @@
-/*
- * @brief LPC11u6x DMA chip driver
- *
- * @note
- * Copyright(C) NXP Semiconductors, 2013
- * All rights reserved.
- *
- * @par
- * Software that is described herein is for illustrative purposes only
- * which provides customers with programming information regarding the
- * LPC products.  This software is supplied "AS IS" without any warranties of
- * any kind, and NXP Semiconductors and its licensor disclaim any and
- * all warranties, express or implied, including all implied warranties of
- * merchantability, fitness for a particular purpose and non-infringement of
- * intellectual property rights.  NXP Semiconductors assumes no responsibility
- * or liability for the use of the software, conveys no license or rights under any
- * patent, copyright, mask work right, or any other intellectual property rights in
- * or to any products. NXP Semiconductors reserves the right to make changes
- * in the software without notification. NXP Semiconductors also makes no
- * representation or warranty that such application will be suitable for the
- * specified use without further testing or modification.
- *
- * @par
- * Permission to use, copy, modify, and distribute this software and its
- * documentation is hereby granted, under NXP Semiconductors' and its
- * licensor's relevant copyrights in the software, without fee, provided that it
- * is used in conjunction with NXP Semiconductors microcontrollers.  This
- * copyright, permission, and disclaimer notice must appear in all copies of
- * this code.
- */
-
-//#include "lpc_defs.h"
-#include "dma_11u6x.h"
-
-#define false 0
-#define true 1
-
-/*****************************************************************************
- * Private types/enumerations/variables
- ****************************************************************************/
-
-/*****************************************************************************
- * Public types/enumerations/variables
- ****************************************************************************/
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-/* DMA SRAM table - this can be optionally used with the Chip_DMA_SetSRAMBase()
-   function if a DMA SRAM table is needed. This table is correctly aligned for
-     the DMA controller. */
-#if defined(__CC_ARM)
-/* Keil alignement to 256 bytes */
-__align(256) DMA_CHDESC_T Chip_DMA_Table[MAX_DMA_CHANNEL];
-#endif /* defined (__CC_ARM) */
-
-/* IAR support */
-#if defined(__ICCARM__)
-/* IAR EWARM alignement to 256 bytes */
-#pragma data_alignment=256
-DMA_CHDESC_T Chip_DMA_Table[MAX_DMA_CHANNEL];
-#endif /* defined (__ICCARM__) */
-
-#if defined( __GNUC__ )
-/* GNU alignement to 256 bytes */
-DMA_CHDESC_T Chip_DMA_Table[MAX_DMA_CHANNEL] __attribute__ ((aligned(256)));
-#endif /* defined (__GNUC__) */
-
-#ifdef __cplusplus
-}
-#endif
-
-/*****************************************************************************
- * Private functions
- ****************************************************************************/
-
-/*****************************************************************************
- * Public functions
- ****************************************************************************/
-
-/* Set DMA transfer register interrupt bits (safe) */
-void Chip_DMA_SetTranBits(LPC_DMA_T *pDMA, DMA_CHID_T ch, uint32_t mask)
-{
-	uint32_t temp;
-
-	/* Read and write values may not be the same, write 0 to
-	   undefined bits */
-	temp = pDMA->DMACH[ch].XFERCFG & ~0xFC000CC0;
-
-	pDMA->DMACH[ch].XFERCFG = temp | mask;
-}
-
-/* Clear DMA transfer register interrupt bits (safe) */
-void Chip_DMA_ClearTranBits(LPC_DMA_T *pDMA, DMA_CHID_T ch, uint32_t mask)
-{
-	uint32_t temp;
-
-	/* Read and write values may not be the same, write 0 to
-	   undefined bits */
-	temp = pDMA->DMACH[ch].XFERCFG & ~0xFC000CC0;
-
-	pDMA->DMACH[ch].XFERCFG = temp & ~mask;
-}
-
-/* Update the transfer size in an existing DMA channel transfer configuration */
-void Chip_DMA_SetupChannelTransferSize(LPC_DMA_T *pDMA, DMA_CHID_T ch, uint32_t trans)
-{
-	Chip_DMA_ClearTranBits(pDMA, ch, (0x3FF << 16));
-	Chip_DMA_SetTranBits(pDMA, ch, DMA_XFERCFG_XFERCOUNT(trans));
-}
-
-/* Sets up a DMA channel with the passed DMA transfer descriptor */
-bool Chip_DMA_SetupTranChannel(LPC_DMA_T *pDMA, DMA_CHID_T ch, DMA_CHDESC_T *desc)
-{
-	bool good = false;
-	DMA_CHDESC_T *pDesc = (DMA_CHDESC_T *) pDMA->SRAMBASE;
-
-	if ((Chip_DMA_GetActiveChannels(pDMA) & (1 << ch)) == 0) {
-		/* Channel is not active, so update the descriptor */
-	   pDesc[ch] = *desc;
-
-	   good = true;
-   }
-
-   return good;
-}
-
--- a/POKITTO_HW/dma_11u6x.h	Wed Jun 27 13:14:54 2018 +0000
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,699 +0,0 @@
-/*
- * @brief LPC11u6x DMA chip driver
- *
- * @note
- * Copyright(C) NXP Semiconductors, 2013
- * All rights reserved.
- *
- * @par
- * Software that is described herein is for illustrative purposes only
- * which provides customers with programming information regarding the
- * LPC products.  This software is supplied "AS IS" without any warranties of
- * any kind, and NXP Semiconductors and its licensor disclaim any and
- * all warranties, express or implied, including all implied warranties of
- * merchantability, fitness for a particular purpose and non-infringement of
- * intellectual property rights.  NXP Semiconductors assumes no responsibility
- * or liability for the use of the software, conveys no license or rights under any
- * patent, copyright, mask work right, or any other intellectual property rights in
- * or to any products. NXP Semiconductors reserves the right to make changes
- * in the software without notification. NXP Semiconductors also makes no
- * representation or warranty that such application will be suitable for the
- * specified use without further testing or modification.
- *
- * @par
- * Permission to use, copy, modify, and distribute this software and its
- * documentation is hereby granted, under NXP Semiconductors' and its
- * licensor's relevant copyrights in the software, without fee, provided that it
- * is used in conjunction with NXP Semiconductors microcontrollers.  This
- * copyright, permission, and disclaimer notice must appear in all copies of
- * this code.
- */
-
-#ifndef __DMA_11U6X_H_
-#define __DMA_11U6X_H_
-
-#include "lpc_types.h"
-#include "clock_11u6x.h"
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-/** @defgroup DMA_11U6X CHIP: LPC11u6x DMA Controller driver
- * @ingroup CHIP_11U6X_Drivers
- * @{
- */
-
-/**
- * @brief DMA Controller shared registers structure
- */
-typedef struct {					/*!< DMA shared registers structure */
-	__IO uint32_t  ENABLESET;		/*!< DMA Channel Enable read and Set for all DMA channels */
-	__I  uint32_t  RESERVED0;
-	__O  uint32_t  ENABLECLR;		/*!< DMA Channel Enable Clear for all DMA channels */
-	__I  uint32_t  RESERVED1;
-	__I  uint32_t  ACTIVE;			/*!< DMA Channel Active status for all DMA channels */
-	__I  uint32_t  RESERVED2;
-	__I  uint32_t  BUSY;			/*!< DMA Channel Busy status for all DMA channels */
-	__I  uint32_t  RESERVED3;
-	__IO uint32_t  ERRINT;			/*!< DMA Error Interrupt status for all DMA channels */
-	__I  uint32_t  RESERVED4;
-	__IO uint32_t  INTENSET;		/*!< DMA Interrupt Enable read and Set for all DMA channels */
-	__I  uint32_t  RESERVED5;
-	__O  uint32_t  INTENCLR;		/*!< DMA Interrupt Enable Clear for all DMA channels */
-	__I  uint32_t  RESERVED6;
-	__IO uint32_t  INTA;			/*!< DMA Interrupt A status for all DMA channels */
-	__I  uint32_t  RESERVED7;
-	__IO uint32_t  INTB;			/*!< DMA Interrupt B status for all DMA channels */
-	__I  uint32_t  RESERVED8;
-	__O  uint32_t  SETVALID;		/*!< DMA Set ValidPending control bits for all DMA channels */
-	__I  uint32_t  RESERVED9;
-	__O  uint32_t  SETTRIG;			/*!< DMA Set Trigger control bits for all DMA channels */
-	__I  uint32_t  RESERVED10;
-	__O  uint32_t  ABORT;			/*!< DMA Channel Abort control for all DMA channels */
-} LPC_DMA_COMMON_T;
-
-/**
- * @brief DMA Controller shared registers structure
- */
-typedef struct {					/*!< DMA channel register structure */
-	__IO uint32_t  CFG;				/*!< DMA Configuration register */
-	__I  uint32_t  CTLSTAT;			/*!< DMA Control and status register */
-	__IO uint32_t  XFERCFG;			/*!< DMA Transfer configuration register */
-	__I  uint32_t  RESERVED;
-} LPC_DMA_CHANNEL_T;
-
-
-#define DMA_CH15 15
-
-/* On LPC412x, Max DMA channel is 22 */
-#define MAX_DMA_CHANNEL			(DMA_CH15 + 1)
-
-/**
- * @brief DMA Controller register block structure
- */
-typedef struct {					/*!< DMA Structure */
-	__IO uint32_t  CTRL;			/*!< DMA control register */
-	__I  uint32_t  INTSTAT;			/*!< DMA Interrupt status register */
-	__IO uint32_t  SRAMBASE;		/*!< DMA SRAM address of the channel configuration table */
-	__I  uint32_t  RESERVED2[5];
-	LPC_DMA_COMMON_T DMACOMMON[1];	/*!< DMA shared channel (common) registers */
-	__I  uint32_t  RESERVED0[225];
-	LPC_DMA_CHANNEL_T DMACH[MAX_DMA_CHANNEL];	/*!< DMA channel registers */
-} LPC_DMA_T;
-
-/** @defgroup DMA_COMMONDRV_11U6X CHIP: LPC11u6x DMA Controller driver common functions
- * @{
- */
-
-/**
- * @brief	Initialize DMA controller
- * @param	pDMA	: The base of DMA controller on the chip
- * @return	Nothing
- */
-STATIC INLINE void Chip_DMA_Init(LPC_DMA_T *pDMA)
-{
-	(void) pDMA;
-	Chip_Clock_EnablePeriphClock(SYSCTL_CLOCK_DMA);
-}
-
-/**
- * @brief	De-Initialize DMA controller
- * @param	pDMA	: The base of DMA controller on the chip
- * @return	Nothing
- */
-STATIC INLINE void Chip_DMA_DeInit(LPC_DMA_T *pDMA)
-{
-	(void) pDMA;
-	Chip_Clock_DisablePeriphClock(SYSCTL_CLOCK_DMA);
-}
-
-/**
- * @brief	Enable DMA controller
- * @param	pDMA	: The base of DMA controller on the chip
- * @return	Nothing
- */
-STATIC INLINE void Chip_DMA_Enable(LPC_DMA_T *pDMA)
-{
-	pDMA->CTRL = 1;
-}
-
-/**
- * @brief	Disable DMA controller
- * @param	pDMA	: The base of DMA controller on the chip
- * @return	Nothing
- */
-STATIC INLINE void Chip_DMA_Disable(LPC_DMA_T *pDMA)
-{
-	pDMA->CTRL = 0;
-}
-
-/* DMA interrupt status bits (common) */
-#define DMA_INTSTAT_ACTIVEINT       0x2		/*!< Summarizes whether any enabled interrupts are pending */
-#define DMA_INTSTAT_ACTIVEERRINT    0x4		/*!< Summarizes whether any error interrupts are pending */
-
-/**
- * @brief	Get pending interrupt or error interrupts
- * @param	pDMA	: The base of DMA controller on the chip
- * @return	An Or'ed value of DMA_INTSTAT_* types
- * @note	If any DMA channels have an active interrupt or error interrupt
- *			pending, this functional will a common status that applies to all
- *			channels.
- */
-STATIC INLINE uint32_t Chip_DMA_GetIntStatus(LPC_DMA_T *pDMA)
-{
-	return pDMA->INTSTAT;
-}
-
-
-
-/* DMA SRAM table - this can be optionally used with the Chip_DMA_SetSRAMBase()
-   function if a DMA SRAM table is needed. */
-extern DMA_CHDESC_T Chip_DMA_Table[MAX_DMA_CHANNEL];
-
-/**
- * @brief	Set DMA controller SRAM base address
- * @param	pDMA	: The base of DMA controller on the chip
- * @param	base	: The base address where the DMA descriptors will be stored
- * @return	Nothing
- * @note	A 256 byte block of memory aligned on a 256 byte boundary must be
- *			provided for this function. It sets the base address used for
- *			DMA descriptor table (16 descriptors total that use 16 bytes each).<br>
- *
- *			A pre-defined table with correct alignment can be used for this
- *			function by calling Chip_DMA_SetSRAMBase(LPC_DMA, DMA_ADDR(Chip_DMA_Table));
- */
-STATIC INLINE void Chip_DMA_SetSRAMBase(LPC_DMA_T *pDMA, uint32_t base)
-{
-	pDMA->SRAMBASE = base;
-}
-
-/**
- * @brief	Returns DMA controller SRAM base address
- * @param	pDMA	: The base of DMA controller on the chip
- * @return	The base address where the DMA descriptors are stored
- */
-STATIC INLINE uint32_t Chip_DMA_GetSRAMBase(LPC_DMA_T *pDMA)
-{
-	return pDMA->SRAMBASE;
-}
-
-/**
- * @}
- */
-
-/** @defgroup DMA_COMMON_11U6X CHIP: LPC11u6x DMA Controller driver common channel functions
- * @{
- */
-
-/**
- * @brief	Enables a single DMA channel
- * @param	pDMA	: The base of DMA controller on the chip
- * @param	ch		: DMA channel ID
- * @return	Nothing
- */
-STATIC INLINE void Chip_DMA_EnableChannel(LPC_DMA_T *pDMA, DMA_CHID_T ch)
-{
-	pDMA->DMACOMMON[0].ENABLESET = (1 << ch);
-}
-
-/**
- * @brief	Disables a single DMA channel
- * @param	pDMA	: The base of DMA controller on the chip
- * @param	ch		: DMA channel ID
- * @return	Nothing
- */
-STATIC INLINE void Chip_DMA_DisableChannel(LPC_DMA_T *pDMA, DMA_CHID_T ch)
-{
-	pDMA->DMACOMMON[0].ENABLECLR = (1 << ch);
-}
-
-/**
- * @brief	Returns all enabled DMA channels
- * @param	pDMA	: The base of DMA controller on the chip
- * @return	An Or'ed value of all enabled DMA channels (0 - 15)
- * @note	A high values in bits 0 .. 15 in the return values indicates
- *			that the channel for that bit (bit 0 = channel 0, bit 1 -
- *			channel 1, etc.) is enabled. A low state is disabled.
- */
-STATIC INLINE uint32_t Chip_DMA_GetEnabledChannels(LPC_DMA_T *pDMA)
-{
-	return pDMA->DMACOMMON[0].ENABLESET;
-}
-
-/**
- * @brief	Returns all active DMA channels
- * @param	pDMA	: The base of DMA controller on the chip
- * @return	An Or'ed value of all active DMA channels (0 - 15)
- * @note	A high values in bits 0 .. 15 in the return values indicates
- *			that the channel for that bit (bit 0 = channel 0, bit 1 -
- *			channel 1, etc.) is active. A low state is inactive. A active
- *			channel indicates that a DMA operation has been started but
- *			not yet fully completed.
- */
-STATIC INLINE uint32_t Chip_DMA_GetActiveChannels(LPC_DMA_T *pDMA)
-{
-	return pDMA->DMACOMMON[0].ACTIVE;
-}
-
-/**
- * @brief	Returns all busy DMA channels
- * @param	pDMA	: The base of DMA controller on the chip
- * @return	An Or'ed value of all busy DMA channels (0 - 15)
- * @note	A high values in bits 0 .. 15 in the return values indicates
- *			that the channel for that bit (bit 0 = channel 0, bit 1 -
- *			channel 1, etc.) is busy. A low state is not busy. A DMA
- *			channel is considered busy when there is any operation
- *			related to that channel in the DMA controller�s internal
- *			pipeline.
- */
-STATIC INLINE uint32_t Chip_DMA_GetBusyChannels(LPC_DMA_T *pDMA)
-{
-	return pDMA->DMACOMMON[0].BUSY;
-}
-
-/**
- * @brief	Returns pending error interrupt status for all DMA channels
- * @param	pDMA	: The base of DMA controller on the chip
- * @return	An Or'ed value of all channels (0 - 15) error interrupt status
- * @note	A high values in bits 0 .. 15 in the return values indicates
- *			that the channel for that bit (bit 0 = channel 0, bit 1 -
- *			channel 1, etc.) has a pending error interrupt. A low state
- *			indicates no error interrupt.
- */
-STATIC INLINE uint32_t Chip_DMA_GetErrorIntChannels(LPC_DMA_T *pDMA)
-{
-	return pDMA->DMACOMMON[0].ERRINT;
-}
-
-/**
- * @brief	Clears a pending error interrupt status for a single DMA channel
- * @param	pDMA	: The base of DMA controller on the chip
- * @param	ch		: DMA channel ID
- * @return	Nothing
- */
-STATIC INLINE void Chip_DMA_ClearErrorIntChannel(LPC_DMA_T *pDMA, DMA_CHID_T ch)
-{
-	pDMA->DMACOMMON[0].ERRINT = (1 << ch);
-}
-
-/**
- * @brief	Enables a single DMA channel's interrupt used in common DMA interrupt
- * @param	pDMA	: The base of DMA controller on the chip
- * @param	ch		: DMA channel ID
- * @return	Nothing
- */
-STATIC INLINE void Chip_DMA_EnableIntChannel(LPC_DMA_T *pDMA, DMA_CHID_T ch)
-{
-	pDMA->DMACOMMON[0].INTENSET = (1 << ch);
-}
-
-/**
- * @brief	Disables a single DMA channel's interrupt used in common DMA interrupt
- * @param	pDMA	: The base of DMA controller on the chip
- * @param	ch		: DMA channel ID
- * @return	Nothing
- */
-STATIC INLINE void Chip_DMA_DisableIntChannel(LPC_DMA_T *pDMA, DMA_CHID_T ch)
-{
-	pDMA->DMACOMMON[0].INTENCLR = (1 << ch);
-}
-
-/**
- * @brief	Returns all enabled interrupt channels
- * @param	pDMA	: The base of DMA controller on the chip
- * @return	Nothing
- * @note	A high values in bits 0 .. 15 in the return values indicates
- *			that the channel for that bit (bit 0 = channel 0, bit 1 -
- *			channel 1, etc.) has an enabled interrupt for the channel.
- *			A low state indicates that the DMA channel will not contribute
- *			to the common DMA interrupt status.
- */
-STATIC INLINE uint32_t Chip_DMA_GetEnableIntChannels(LPC_DMA_T *pDMA)
-{
-	return pDMA->DMACOMMON[0].INTENSET;
-}
-
-/**
- * @brief	Returns active A interrupt status for all channels
- * @param	pDMA	: The base of DMA controller on the chip
- * @return	Nothing
- * @note	A high values in bits 0 .. 15 in the return values indicates
- *			that the channel for that bit (bit 0 = channel 0, bit 1 -
- *			channel 1, etc.) has an active A interrupt for the channel.
- *			A low state indicates that the A interrupt is not active.
- */
-STATIC INLINE uint32_t Chip_DMA_GetActiveIntAChannels(LPC_DMA_T *pDMA)
-{
-	return pDMA->DMACOMMON[0].INTA;
-}
-
-/**
- * @brief	Clears active A interrupt status for a single channel
- * @param	pDMA	: The base of DMA controller on the chip
- * @param	ch		: DMA channel ID
- * @return	Nothing
- */
-STATIC INLINE void Chip_DMA_ClearActiveIntAChannel(LPC_DMA_T *pDMA, DMA_CHID_T ch)
-{
-	pDMA->DMACOMMON[0].INTA = (1 << ch);
-}
-
-/**
- * @brief	Returns active B interrupt status for all channels
- * @param	pDMA	: The base of DMA controller on the chip
- * @return	Nothing
- * @note	A high values in bits 0 .. 15 in the return values indicates
- *			that the channel for that bit (bit 0 = channel 0, bit 1 -
- *			channel 1, etc.) has an active B interrupt for the channel.
- *			A low state indicates that the B interrupt is not active.
- */
-STATIC INLINE uint32_t Chip_DMA_GetActiveIntBChannels(LPC_DMA_T *pDMA)
-{
-	return pDMA->DMACOMMON[0].INTB;
-}
-
-/**
- * @brief	Clears active B interrupt status for a single channel
- * @param	pDMA	: The base of DMA controller on the chip
- * @param	ch		: DMA channel ID
- * @return	Nothing
- */
-STATIC INLINE void Chip_DMA_ClearActiveIntBChannel(LPC_DMA_T *pDMA, DMA_CHID_T ch)
-{
-	pDMA->DMACOMMON[0].INTB = (1 << ch);
-}
-
-/**
- * @brief	Sets the VALIDPENDING control bit for a single channel
- * @param	pDMA	: The base of DMA controller on the chip
- * @param	ch		: DMA channel ID
- * @return	Nothing
- * @note	See the User Manual for more information for what this bit does.
- *
- */
-STATIC INLINE void Chip_DMA_SetValidChannel(LPC_DMA_T *pDMA, DMA_CHID_T ch)
-{
-	pDMA->DMACOMMON[0].SETVALID = (1 << ch);
-}
-
-/**
- * @brief	Sets the TRIG bit for a single channel
- * @param	pDMA	: The base of DMA controller on the chip
- * @param	ch		: DMA channel ID
- * @return	Nothing
- * @note	See the User Manual for more information for what this bit does.
- */
-STATIC INLINE void Chip_DMA_SetTrigChannel(LPC_DMA_T *pDMA, DMA_CHID_T ch)
-{
-	pDMA->DMACOMMON[0].SETTRIG = (1 << ch);
-}
-
-/**
- * @brief	Aborts a DMA operation for a single channel
- * @param	pDMA	: The base of DMA controller on the chip
- * @param	ch		: DMA channel ID
- * @return	Nothing
- * @note	To abort a channel, the channel should first be disabled. Then wait
- *			until the channel is no longer busy by checking the corresponding
- *			bit in BUSY. Finally, abort the channel operation. This prevents the
- *			channel from restarting an incomplete operation when it is enabled
- *			again.
- */
-STATIC INLINE void Chip_DMA_AbortChannel(LPC_DMA_T *pDMA, DMA_CHID_T ch)
-{
-	pDMA->DMACOMMON[0].ABORT = (1 << ch);
-}
-
-/**
- * @}
- */
-
-/** @defgroup DMATRIGMUX_11U6X CHIP: LPC11u6x DMA trigger selection driver
- * @ingroup CHIP_11U6X_Drivers
- * @{
- */
-
-/**
- * @brief DMA trigger pin muxing structure
- */
-typedef struct {					/*!< DMA trigger pin muxing register structure */
-	__IO uint32_t  DMA_ITRIG_INMUX[MAX_DMA_CHANNEL];	/*!< Trigger input select register for DMA channels */
-} LPC_DMATRIGMUX_T;
-
-/* DMA triggers that can mapped to DMA channels */
-typedef enum {
-	DMATRIG_ADC0_SEQA_IRQ = 0,			/*!< ADC0 sequencer A interrupt as trigger */
-	DMATRIG_ADC0_SEQB_IRQ,				/*!< ADC0 sequencer B interrupt as trigger */
-	DMATRIG_CT16B0_MAT0,				/*!< 16-bit counter/timer 0 interrupt as trigger */
-	DMATRIG_CT16B1_MAT0,				/*!< 16-bit counter/timer 1 interrupt as trigger */
-	DMATRIG_CT32B0_MAT0,				/*!< 32-bit counter/timer 0 interrupt as trigger */
-	DMATRIG_CT32B1_MAT0,				/*!< 32-bit counter/timer 1 interrupt as trigger */
-	DMATRIG_PINT0,						/*!< Pin interrupt 0 as trigger */
-	DMATRIG_PINT1,						/*!< Pin interrupt 1 as trigger */
-	DMATRIG_SCT0_DMA0,					/*!< SCT 0, DMA 0 as trigger */
-	DMATRIG_SCT0_DMA1,					/*!< SCT 1, DMA 1 as trigger */
-	DMATRIG_SCT1_DMA0,					/*!< SCT 0, DMA 0 as trigger */
-	DMATRIG_SCT1_DMA1					/*!< SCT 1, DMA 1 as trigger */
-} DMA_TRIGSRC_T;
-
-/**
- * @brief	Select a trigger source for a DMA channel
- * @param	pDMATRIG	: The base of DMA trigger setup block on the chip
- * @param	ch			: DMA channel ID
- * @param	trig		: Trigger source for the DMA channel
- * @return	Nothing
- * @note	A DMA trigger source only needs to be setup when the DMA is setup
- *			for hardware trigger mode (when Chip_DMA_SetupChannelConfig() is
- *			called with DMA_CFG_HWTRIGEN as OR'ed option).
- */
-STATIC INLINE void Chip_DMA_SetHWTrigger(LPC_DMATRIGMUX_T *pDMATRIG, DMA_CHID_T ch, DMA_TRIGSRC_T trig)
-{
-	pDMATRIG->DMA_ITRIG_INMUX[ch] = (uint32_t) trig;
-}
-
-/**
- * @}
- */
-
-/** @defgroup DMA_CHANNEL_11U6X CHIP: LPC11u6x DMA Controller driver channel specific functions
- * @{
- */
-
-/* Support macro for DMA_CHDESC_T */
-#define DMA_ADDR(addr)      ((uint32_t) (addr))
-
-/* Support definitions for setting the configuration of a DMA channel. You
-   will need to get more information on these options from the User manual. */
-#define DMA_CFG_PERIPHREQEN     (1 << 0)	/*!< Enables Peripheral DMA requests */
-#define DMA_CFG_HWTRIGEN        (1 << 1)	/*!< Use hardware triggering via imput mux */
-#define DMA_CFG_TRIGPOL_LOW     (0 << 4)	/*!< Hardware trigger is active low or falling edge */
-#define DMA_CFG_TRIGPOL_HIGH    (1 << 4)	/*!< Hardware trigger is active high or rising edge */
-#define DMA_CFG_TRIGTYPE_EDGE   (0 << 5)	/*!< Hardware trigger is edge triggered */
-#define DMA_CFG_TRIGTYPE_LEVEL  (1 << 5)	/*!< Hardware trigger is level triggered */
-#define DMA_CFG_TRIGBURST_SNGL  (0 << 6)	/*!< Single transfer. Hardware trigger causes a single transfer */
-#define DMA_CFG_TRIGBURST_BURST (1 << 6)	/*!< Burst transfer (see UM) */
-#define DMA_CFG_BURSTPOWER_1    (0 << 8)	/*!< Set DMA burst size to 1 transfer */
-#define DMA_CFG_BURSTPOWER_2    (1 << 8)	/*!< Set DMA burst size to 2 transfers */
-#define DMA_CFG_BURSTPOWER_4    (2 << 8)	/*!< Set DMA burst size to 4 transfers */
-#define DMA_CFG_BURSTPOWER_8    (3 << 8)	/*!< Set DMA burst size to 8 transfers */
-#define DMA_CFG_BURSTPOWER_16   (4 << 8)	/*!< Set DMA burst size to 16 transfers */
-#define DMA_CFG_BURSTPOWER_32   (5 << 8)	/*!< Set DMA burst size to 32 transfers */
-#define DMA_CFG_BURSTPOWER_64   (6 << 8)	/*!< Set DMA burst size to 64 transfers */
-#define DMA_CFG_BURSTPOWER_128  (7 << 8)	/*!< Set DMA burst size to 128 transfers */
-#define DMA_CFG_BURSTPOWER_256  (8 << 8)	/*!< Set DMA burst size to 256 transfers */
-#define DMA_CFG_BURSTPOWER_512  (9 << 8)	/*!< Set DMA burst size to 512 transfers */
-#define DMA_CFG_BURSTPOWER_1024 (10 << 8)	/*!< Set DMA burst size to 1024 transfers */
-#define DMA_CFG_BURSTPOWER(n)   ((n) << 8)	/*!< Set DMA burst size to 2^n transfers, max n=10 */
-#define DMA_CFG_SRCBURSTWRAP    (1 << 14)	/*!< Source burst wrapping is enabled for this DMA channel */
-#define DMA_CFG_DSTBURSTWRAP    (1 << 15)	/*!< Destination burst wrapping is enabled for this DMA channel */
-#define DMA_CFG_CHPRIORITY(p)   ((p) << 16)	/*!< Sets DMA channel priority, min 0 (highest), max 3 (lowest) */
-
-/**
- * @brief	Setup a DMA channel configuration
- * @param	pDMA	: The base of DMA controller on the chip
- * @param	ch		: DMA channel ID
- * @param	cfg		: An Or'ed value of DMA_CFG_* values that define the channel's configuration
- * @return	Nothing
- * @note	This function sets up all configurable options for the DMA channel.
- *			These options are usually set once for a channel and then unchanged.<br>
- *
- *			The following example show how to configure the channel for peripheral
- *			DMA requests, burst transfer size of 1 (in 'transfers', not bytes),
- *			continuous reading of the same source address, incrementing destination
- *			address, and highest channel priority.<br>
- *			Example: Chip_DMA_SetupChannelConfig(pDMA, SSP0_RX_DMA,
- *				(DMA_CFG_PERIPHREQEN | DMA_CFG_TRIGBURST_BURST | DMA_CFG_BURSTPOWER_1 |
- *				DMA_CFG_SRCBURSTWRAP | DMA_CFG_CHPRIORITY(0)));<br>
- *
- *			The following example show how to configure the channel for an external
- *			trigger from the imput mux with low edge polarity, a burst transfer size of 8,
- *			incrementing source and destination addresses, and lowest channel
- *			priority.<br>
- *			Example: Chip_DMA_SetupChannelConfig(pDMA, DMA_CH14,
- *				(DMA_CFG_HWTRIGEN | DMA_CFG_TRIGPOL_LOW | DMA_CFG_TRIGTYPE_EDGE |
- *				DMA_CFG_TRIGBURST_BURST | DMA_CFG_BURSTPOWER_8 |
- *				DMA_CFG_CHPRIORITY(3)));<br>
- *
- *			For non-peripheral DMA triggering (DMA_CFG_HWTRIGEN definition), use the
- *			DMA input mux functions to configure the DMA trigger source for a DMA channel.
- */
-STATIC INLINE void Chip_DMA_SetupChannelConfig(LPC_DMA_T *pDMA, DMA_CHID_T ch, uint32_t cfg)
-{
-	pDMA->DMACH[ch].CFG = cfg;
-}
-
-/* DMA channel control and status register definitions */
-#define DMA_CTLSTAT_VALIDPENDING    (1 << 0)	/*!< Valid pending flag for this channel */
-#define DMA_CTLSTAT_TRIG            (1 << 2)	/*!< Trigger flag. Indicates that the trigger for this channel is currently set */
-
-/**
- * @brief	Returns channel specific status flags
- * @param	pDMA	: The base of DMA controller on the chip
- * @param	ch		: DMA channel ID
- * @return	AN Or'ed value of DMA_CTLSTAT_VALIDPENDING and DMA_CTLSTAT_TRIG
- */
-STATIC INLINE uint32_t Chip_DMA_GetChannelStatus(LPC_DMA_T *pDMA, DMA_CHID_T ch)
-{
-	return pDMA->DMACH[ch].XFERCFG;
-}
-
-/* DMA channel transfer configuration registers definitions */
-#define DMA_XFERCFG_CFGVALID        (1 << 0)	/*!< Configuration Valid flag */
-#define DMA_XFERCFG_RELOAD          (1 << 1)	/*!< Indicates whether the channels control structure will be reloaded when the current descriptor is exhausted */
-#define DMA_XFERCFG_SWTRIG          (1 << 2)	/*!< Software Trigger */
-#define DMA_XFERCFG_CLRTRIG         (1 << 3)	/*!< Clear Trigger */
-#define DMA_XFERCFG_SETINTA         (1 << 4)	/*!< Set Interrupt flag A for this channel to fire when descriptor is complete */
-#define DMA_XFERCFG_SETINTB         (1 << 5)	/*!< Set Interrupt flag B for this channel to fire when descriptor is complete */
-#define DMA_XFERCFG_WIDTH_8         (0 << 8)	/*!< 8-bit transfers are performed */
-#define DMA_XFERCFG_WIDTH_16        (1 << 8)	/*!< 16-bit transfers are performed */
-#define DMA_XFERCFG_WIDTH_32        (2 << 8)	/*!< 32-bit transfers are performed */
-#define DMA_XFERCFG_SRCINC_0        (0 << 12)	/*!< DMA source address is not incremented after a transfer */
-#define DMA_XFERCFG_SRCINC_1        (1 << 12)	/*!< DMA source address is incremented by 1 (width) after a transfer */
-#define DMA_XFERCFG_SRCINC_2        (2 << 12)	/*!< DMA source address is incremented by 2 (width) after a transfer */
-#define DMA_XFERCFG_SRCINC_4        (3 << 12)	/*!< DMA source address is incremented by 4 (width) after a transfer */
-#define DMA_XFERCFG_DSTINC_0        (0 << 14)	/*!< DMA destination address is not incremented after a transfer */
-#define DMA_XFERCFG_DSTINC_1        (1 << 14)	/*!< DMA destination address is incremented by 1 (width) after a transfer */
-#define DMA_XFERCFG_DSTINC_2        (2 << 14)	/*!< DMA destination address is incremented by 2 (width) after a transfer */
-#define DMA_XFERCFG_DSTINC_4        (3 << 14)	/*!< DMA destination address is incremented by 4 (width) after a transfer */
-#define DMA_XFERCFG_XFERCOUNT(n)    ((n - 1) << 16)	/*!< DMA transfer count in 'transfers', between (0)1 and (1023)1024 */
-
-/**
- * @brief	Setup a DMA channel transfer configuration
- * @param	pDMA	: The base of DMA controller on the chip
- * @param	ch		: DMA channel ID
- * @param	cfg		: An Or'ed value of DMA_XFERCFG_* values that define the channel's transfer configuration
- * @return	Nothing
- * @note	This function sets up the transfer configuration for the DMA channel.<br>
- *
- *			The following example show how to configure the channel's transfer for
- *			multiple transfer descriptors (ie, ping-pong), interrupt 'A' trigger on
- *			transfer descriptor completion, 128 byte size transfers, and source and
- *			destination address increment.<br>
- *			Example: Chip_DMA_SetupChannelTransfer(pDMA, SSP0_RX_DMA,
- *				(DMA_XFERCFG_CFGVALID | DMA_XFERCFG_RELOAD | DMA_XFERCFG_SETINTA |
- *				DMA_XFERCFG_WIDTH_8 | DMA_XFERCFG_SRCINC_1 | DMA_XFERCFG_DSTINC_1 |
- *				DMA_XFERCFG_XFERCOUNT(128)));<br>
- */
-STATIC INLINE void Chip_DMA_SetupChannelTransfer(LPC_DMA_T *pDMA, DMA_CHID_T ch, uint32_t cfg)
-{
-	pDMA->DMACH[ch].XFERCFG = cfg;
-}
-
-/**
- * @brief	Set DMA transfer register interrupt bits (safe)
- * @param	pDMA	: The base of DMA controller on the chip
- * @param	ch		: DMA channel ID
- * @param	mask	: Bits to set
- * @return	Nothing
- * @note	This function safely sets bits in the DMA channel specific XFERCFG
- *			register.
- */
-void Chip_DMA_SetTranBits(LPC_DMA_T *pDMA, DMA_CHID_T ch, uint32_t mask);
-
-/**
- * @brief	Clear DMA transfer register interrupt bits (safe)
- * @param	pDMA	: The base of DMA controller on the chip
- * @param	ch		: DMA channel ID
- * @param	mask	: Bits to clear
- * @return	Nothing
- * @note	This function safely clears bits in the DMA channel specific XFERCFG
- *			register.
- */
-void Chip_DMA_ClearTranBits(LPC_DMA_T *pDMA, DMA_CHID_T ch, uint32_t mask);
-
-/**
- * @brief	Update the transfer size in an existing DMA channel transfer configuration
- * @param	pDMA	: The base of DMA controller on the chip
- * @param	ch		: DMA channel ID
- * @param	trans	: Number of transfers to update the transfer configuration to (1 - 1023)
- * @return	Nothing
- */
-void Chip_DMA_SetupChannelTransferSize(LPC_DMA_T *pDMA, DMA_CHID_T ch, uint32_t trans);
-
-/**
- * @brief	Sets a DMA channel configuration as valid
- * @param	pDMA	: The base of DMA controller on the chip
- * @param	ch		: DMA channel ID
- * @return	Nothing
- */
-STATIC INLINE void Chip_DMA_SetChannelValid(LPC_DMA_T *pDMA, DMA_CHID_T ch)
-{
-	Chip_DMA_SetTranBits(pDMA, ch, DMA_XFERCFG_CFGVALID);
-}
-
-/**
- * @brief	Sets a DMA channel configuration as invalid
- * @param	pDMA	: The base of DMA controller on the chip
- * @param	ch		: DMA channel ID
- * @return	Nothing
- */
-STATIC INLINE void Chip_DMA_SetChannelInValid(LPC_DMA_T *pDMA, DMA_CHID_T ch)
-{
-	Chip_DMA_ClearTranBits(pDMA, ch, DMA_XFERCFG_CFGVALID);
-}
-
-/**
- * @brief	Performs a software trigger of the DMA channel
- * @param	pDMA	: The base of DMA controller on the chip
- * @param	ch		: DMA channel ID
- * @return	Nothing
- */
-STATIC INLINE void Chip_DMA_SWTriggerChannel(LPC_DMA_T *pDMA, DMA_CHID_T ch)
-{
-	Chip_DMA_SetTranBits(pDMA, ch, DMA_XFERCFG_SWTRIG);
-}
-
-/**
- * @brief	Sets up a DMA channel with the passed DMA transfer descriptor
- * @param	pDMA	: The base of DMA controller on the chip
- * @param	ch		: DMA channel ID
- * @param	desc	: Pointer to DMA transfer descriptor
- * @return	false if the DMA channel was active, otherwise true
- * @note	This function will set the DMA descriptor in the SRAM table to the
- *			the passed descriptor. This function is only meant to be used when
- *			the DMA channel is not active and can be used to setup the
- *			initial transfer for a linked list or ping-pong buffer or just a
- *			single transfer without a next descriptor.<br>
- *
- *			If using this function to write the initial transfer descriptor in
- *			a linked list or ping-pong buffer configuration, it should contain a
- *			non-NULL 'next' field pointer.
- */
-bool Chip_DMA_SetupTranChannel(LPC_DMA_T *pDMA, DMA_CHID_T ch, DMA_CHDESC_T *desc);
-
-/**
- * @}
- */
-
-/**
- * @}
- */
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif /* __DMA_11U6X_H_ */
-
-
--- a/POKITTO_HW/iap.cpp	Wed Jun 27 13:14:54 2018 +0000
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,733 +0,0 @@
-#include <stdio.h>
-#include <stdint.h>
-#include <iap.h>
-#include "LPC11U6x.h"
-#include "PokittoDisk.h"
-
-#define TICKRATE_HZ (10)	/* 10 ticks per second */
-/* SystemTick Counter */
-static volatile uint32_t sysTick;
-
-/* LPC1347 IAP entry address */
-#define IAP_LOCATION 0x1fff1ff1
-
-#define last_sector_flash  0x00038000  //0x0000F000
-#define IAP_LAST_SECTOR 28 /* Page number 896 - 1023, 0x00038000 - 0x0003FFFF */
-#define IAP_NUM_BYTES_TO_WRITE 256
-#define WRITECOUNT (IAP_NUM_BYTES_TO_WRITE / 4) /* when data array is in uint32_t */
-
-#define IAP_PREWRRITE_CMD 50 /* Prepare sector for write operation command */
-#define IAP_WRISECTOR_CMD 51
-#define IAP_ERSSECTOR_CMD 52
-#define IAP_REPID_CMD 54
-
-/* IAP command variables */
-static unsigned int command[5], result[4];
-
-/* IAP entry function */
-typedef int (*IAP)(unsigned int[], unsigned int[]);
-IAP iap_entry = (IAP) IAP_LOCATION;
-
-int CopyPageToFlash (uint32_t address, uint8_t* data) {
-    IAP iap_call = (IAP) IAP_LOCATION;
-    uint32_t writecount=0;
-	__disable_irq();
-
-    unsigned int sector, page;
-    bool firstpage=false, erasepage=false;
-
-    //DEBUG//
-    //for (int i=0;i<256;i++) data[i]=0xBB;
-
-    /* Calculate sector based on address */
-    if (address < 0x18000) sector = address/0x1000; // sectors go in 4 k's
-    else if (address >= 0x38000) sector = 28;
-    else if (address >= 0x30000) sector = 27;
-    else if (address >= 0x28000) sector = 26;
-    else if (address >= 0x20000) sector = 25;
-    else sector = 24;
-
-    /* Check is it the first page in the sector */
-    if (sector < 24) {
-        /* 4KB addresses cover 0x000 - 0xFFF range */
-        firstpage = ((address & 0x0FFF) == 0);
-    } else {
-        /* 32KB addresses cover 0x0000 - 0x7FFF and 0x8000 - 0xFFFF range */
-        firstpage = ((address & 0x7FFF) == 0);
-    }
-
-	/* Prepare the sector for writing */
-	command[0] = IAP_PREWRRITE_CMD;						/* Prepare to write/erase command code */
-	command[1] = sector;         							/* Start Sector Number */
-	command[2] = sector;		        					/* End Sector Number */
-	iap_call(command, result);
-    if (result[0]) return 1;
-
-    /* wipe pages when writing the loader */
-    if (address==0x39000) {
-            erasepage=true;
-    }
-
-    /* do sector erase only when writing first page of given sector */
-    if (firstpage) {
-        /* Erase the last sector */
-        command[0] = IAP_ERSSECTOR_CMD;	   					/* Erase command code*/
-        command[1] = sector;             						/* Start Sector Number */
-        command[2] = sector;            						/* End Sector Number */
-        command[3] = SystemCoreClock / 1000UL;	/* Core clock frequency in kHz */
-        iap_call(command, result);
-        if (result[0]) return 1;
-        /* Prepare to write/erase the last sector, needs to be done again because succesful erase re-locks sectors */
-        command[0] = IAP_PREWRRITE_CMD;						/* Prepare to write/erase command code */
-        command[1] = sector;			            				/* Start Sector Number */
-        command[2] = sector;        							/* Start Sector Number */
-        iap_call(command, result);
-        if (result[0]) return 1;
-    }
-
-    /* page erase for bootloader area */
-    if (erasepage) {
-        command[0] = 59; //erase page command
-        command[1] = 896;
-        command[2] = 1023;
-        command[3] = SystemCoreClock / 1000UL;	/* Core clock frequency in kHz */
-        iap_call(command, result);
-        if (result[0]) return 1;
-        /* Prepare to write/erase the last sector, needs to be done again because succesful erase re-locks sectors */
-        command[0] = IAP_PREWRRITE_CMD;						/* Prepare to write/erase command code */
-        command[1] = sector;			            				/* Start Sector Number */
-        command[2] = sector;        							/* Start Sector Number */
-        iap_call(command, result);
-        if (result[0]) return 1;
-    }
-
-	/* Write data to the sectors */
-	command[0] = IAP_WRISECTOR_CMD;						/* Write command code */
-	command[1] = (uint32_t) (uint32_t*) address;              		    /* Destination Flash Address */
-	command[2] = (uint32_t) data;	    				/* Source RAM Address */
-	command[3] = 0x100;             					/* Number of Bytes to be written */
-	command[4] = SystemCoreClock / 1000;				/* System clock frequency */
-	iap_call(command, result);
-    if (result[0]) return 1;
-
-	/* Re-enable interrupt mode */
-	__enable_irq();
-
-    return 0; /*succesful write*/
-
-}
-
-__attribute__((section(".IAP_Code"))) int HelloFromIAP() {
-    #ifndef NOPETITFATFS
-    static uint32_t array_data[WRITECOUNT];
-    int i;
-    /* Initialize the array data to be written to FLASH */
-	for (i = 0; i < WRITECOUNT; i++) {
-		array_data[i] = 0xB007AB1E;
-	}
-
-    IAP iap_call = (IAP) IAP_LOCATION;
-    uint8_t teahupoo;
-    //readEEPROM(0,&teahupoo,1);
-    teahupoo++;
-    //writeEEPROM(0,&teahupoo,1);
-
-    /** open file **/
-    pokInitSD();
-    char fn[20];
-    char* now;
-    now = (char*)last_sector_flash;
-    switch (now[0]) {
-case 0xAA:
-    fn[0]='B';fn[1]='B';fn[2]='.';fn[3]='B';fn[4]='I';fn[5]='N';fn[6]='\0';break;
-case 0xBB:
-    fn[0]='C';fn[1]='C';fn[2]='.';fn[3]='B';fn[4]='I';fn[5]='N';fn[6]='\0';break;
-default:
-    fn[0]='A';fn[1]='A';fn[2]='.';fn[3]='B';fn[4]='I';fn[5]='N';fn[6]='\0';
-    }
-    if(fileOpen(fn,FILE_MODE_BINARY)) {
-            return 1;
-    } else {
-     for (i = 0; i < WRITECOUNT; i++) {
-		fileReadBytes((uint8_t*)&array_data[i],4);
-	 }
-    }
-
-
-    /** write sector in flash **/
-    /* Read Part Identification Number*/
-	command[0] = IAP_REPID_CMD;								/* Read ID command code */
-	iap_call(command, result);
-
-	__disable_irq();
-
-	/* Prepare to write/erase the last sector */
-	command[0] = IAP_PREWRRITE_CMD;						/* Prepare to write/erase command code */
-	command[1] = IAP_LAST_SECTOR;							/* Start Sector Number */
-	command[2] = IAP_LAST_SECTOR;							/* End Sector Number */
-	iap_call(command, result);
-	/* Erase the last sector */
-	command[0] = IAP_ERSSECTOR_CMD;						/* Erase command code*/
-	command[1] = IAP_LAST_SECTOR;							/* Start Sector Number */
-	command[2] = IAP_LAST_SECTOR;							/* Start Sector Number */
-	command[3] = SystemCoreClock / 1000UL;	/* Core clock frequency in kHz */
-	iap_call(command, result);
-	/* Prepare to write/erase the last sector */
-	command[0] = IAP_PREWRRITE_CMD;						/* Prepare to write/erase command code */
-	command[1] = IAP_LAST_SECTOR;							/* Start Sector Number */
-	command[2] = IAP_LAST_SECTOR;							/* Start Sector Number */
-	iap_call(command, result);
-	/* Write to the last sector */
-	command[0] = IAP_WRISECTOR_CMD;								/* Write command code */
-	command[1] = (uint32_t) last_sector_flash;		        /* Destination Flash Address */
-	command[2] = (uint32_t) &array_data;					/* Source RAM Address */
-	command[3] = IAP_NUM_BYTES_TO_WRITE;					/* Number of Bytes to be written */
-	command[4] = SystemCoreClock / 1000;					/* System clock frequency */
-	iap_call(command, result);
-
-	/* Re-enable interrupt mode */
-	__enable_irq();
-
-
-    SCB->AIRCR = 0x05FA0004; //issue system reset
-    while(1); //should never come here
-    return teahupoo;
-    #endif //NOPETITFATFS
-}
-
-
-
-
-void IAPstacksave()
-{
-  /*need to save 32 top bytes of RAM to RAM1*/
-  #define RAM1_0 (*((volatile unsigned long *) 0x20000000))
-  #define RAM1_1 (*((volatile unsigned long *) 0x20000004))
-  #define RAM1_2 (*((volatile unsigned long *) 0x20000008))
-  #define RAM1_3 (*((volatile unsigned long *) 0x2000000C))
-  #define RAM1_4 (*((volatile unsigned long *) 0x20000010))
-  #define RAM1_5 (*((volatile unsigned long *) 0x20000014))
-  #define RAM1_6 (*((volatile unsigned long *) 0x20000018))
-  #define RAM1_7 (*((volatile unsigned long *) 0x2000001C))
-
-  uint32_t *saveloc = (uint32_t*)(0x10002000-0x20); // RAM top - 32 bytes
-  RAM1_0 = *saveloc++;
-  RAM1_1 = *saveloc++;
-  RAM1_2 = *saveloc++;
-  RAM1_3 = *saveloc++;
-  RAM1_4 = *saveloc++;
-  RAM1_5 = *saveloc++;
-  RAM1_6 = *saveloc++;
-  RAM1_7 = *saveloc;
-}
-
-
-char iaptest() {
-    static uint32_t array_data[WRITECOUNT];
-    int i;
-    /* Initialize the array data to be written to FLASH */
-	for (i = 0; i < WRITECOUNT; i++) {
-		array_data[i] = 0x11223340 + i;
-	}
-
-	/* Read Part Identification Number*/
-	command[0] = IAP_REPID_CMD;								/* Read ID command code */
-	iap_entry(command, result);
-
-	/* Reinvoke ISP mode so that reprogamming of Flash possible */
-	__disable_irq();
-
-	command[0] = IAP_REPID_CMD;
-	iap_entry(command, result);
-
-	/* Prepare to write/erase the last sector */
-	command[0] = IAP_PREWRRITE_CMD;						/* Prepare to write/erase command code */
-	command[1] = IAP_LAST_SECTOR;							/* Start Sector Number */
-	command[2] = IAP_LAST_SECTOR;							/* End Sector Number */
-	iap_entry(command, result);
-
-	/* Erase the last sector */
-	command[0] = IAP_ERSSECTOR_CMD;						/* Erase command code*/
-	command[1] = IAP_LAST_SECTOR;							/* Start Sector Number */
-	command[2] = IAP_LAST_SECTOR;							/* Start Sector Number */
-	iap_entry(command, result);
-
-	/* Prepare to write/erase the last sector */
-	command[0] = IAP_PREWRRITE_CMD;						/* Prepare to write/erase command code */
-	command[1] = IAP_LAST_SECTOR;							/* Start Sector Number */
-	command[2] = IAP_LAST_SECTOR;							/* Start Sector Number */
-	iap_entry(command, result);
-
-	/* Write to the last sector */
-	command[0] = IAP_WRISECTOR_CMD;								/* Write command code */
-	command[1] = (uint32_t) last_sector_flash;		/* Destination Flash Address */
-	command[2] = (uint32_t) &array_data;					/* Source RAM Address */
-	command[3] = IAP_NUM_BYTES_TO_WRITE;					/* Number of Bytes to be written */
-	command[4] = SystemCoreClock / 1000;					/* System clock frequency */
-	iap_entry(command, result);
-
-	/* Re-enable interrupt mode */
-	__enable_irq();
-
-	//while (1) {
-	//	__WFI();
-	//}
-
-	return 0;
-
-}
-
-
-//1) EEprom Write
-//
-//Command code: 61
-//Param0: eeprom address (byte, half-word or word aligned)
-//Param1: RAM address (byte, half-word or word aligned)
-//Param2: Number of bytes to be written ( Byte, Half-words write are ok)
-//Param3: System Clock Frequency (CCLK) in kHz
-//
-//Return Code CMD_SUCCESS | SRC_ADDR_NOT_MAPPED | DST_ADDR_NOT_MAPPED
-__attribute__((section(".IAP_Code"))) void writeEEPROM( uint16_t* eeAddress, uint8_t* buffAddress, uint32_t byteCount )
-{
-	unsigned int command[5], result[4];
-
-	command[0] = 61;
-	command[1] = (uint32_t) eeAddress;
-	command[2] = (uint32_t) buffAddress;
-	command[3] = byteCount;
-	command[4] = SystemCoreClock/1000;
-
-	/* Invoke IAP call...*/
-#if (EEPROM_PROFILE!=0)
-	LPC_CT32B0->TCR = 1;
-	__disable_irq();
-  	iap_entry(command, result);
-  	__enable_irq();
-	LPC_CT32B0->TCR = 0;
-#else
-    __disable_irq();
-	iap_entry(command, result);
-	__enable_irq();
-#endif
-	if (0 != result[0])
-	{
-		//Trap error
-		while(1);
-	}
-	return;
-}
-
-//2) EEprom Read
-//Command code: 62
-//Param0: eeprom address (byte, half-word or word aligned)
-//Param1: RAM address (byte, half-word or word aligned)
-//Param2: Number of bytes to be read ( Byte, Half-words read are ok)
-//Param3: System Clock Frequency (CCLK) in kHz
-//
-//Return Code CMD_SUCCESS | SRC_ADDR_NOT_MAPPED | DST_ADDR_NOT_MAPPED
-__attribute__((section(".IAP_Code"))) void readEEPROM( uint16_t* eeAddress, uint8_t* buffAddress, uint32_t byteCount )
-{
-	unsigned int command[5], result[4];
-
-	command[0] = 62;
-	command[1] = (uint32_t) eeAddress;
-	command[2] = (uint32_t) buffAddress;
-	command[3] = byteCount;
-	command[4] = SystemCoreClock/1000;
-
-	/* Invoke IAP call...*/
-	__disable_irq();
-  	iap_entry( command, result);
-  	__enable_irq();
-	if (0 != result[0])
-	{
-		//Trap error
-		while(1);
-	}
-	return;
-}
-
-__attribute__((section(".IAP_Code"))) void IAPreadPartId( uint8_t* eeAddress, uint8_t* buffAddress, uint32_t byteCount )
-{
-	unsigned int command[5], result[4];
-
-	command[0] = 62;
-	command[1] = (uint32_t) eeAddress;
-	command[2] = (uint32_t) buffAddress;
-	command[3] = byteCount;
-	command[4] = SystemCoreClock/1000;
-
-	/* Invoke IAP call...*/
-	__disable_irq();
-  	iap_entry( command, result);
-  	__enable_irq();
-	if (0 != result[0])
-	{
-		//Trap error
-		while(1);
-	}
-	return;
-}
-
-uint8_t eeprom_read_byte(uint16_t* index) {
-    uint8_t val;
-    readEEPROM(index,&val,1);
-    return val;
-}
-
-void eeprom_write_byte(uint16_t* index , uint8_t val) {
-    writeEEPROM(index,&val,1);
-}
-
-/*****************************************************************************
- * $Id$
- *
- * Project: 	NXP LPC11U6x In Application Programming
- *
- * Description: Provides access to In-Application Programming (IAP) routines
- * 			    contained within the bootROM sector of LPC11U6x devices.
- *
- * Copyright(C) 2010, NXP Semiconductor
- * All rights reserved.
- *
- *****************************************************************************
- * Software that is described herein is for illustrative purposes only
- * which provides customers with programming information regarding the
- * products. This software is supplied "AS IS" without any warranties.
- * NXP Semiconductors assumes no responsibility or liability for the
- * use of the software, conveys no license or title under any patent,
- * copyright, or mask work right to the product. NXP Semiconductors
- * reserves the right to make changes in the software without
- * notification. NXP Semiconductors also make no representation or
- * warranty that such application will be suitable for the specified
- * use without further testing or modification.
- *****************************************************************************/
-
-/* IAP Command Definitions */
-#define	IAP_CMD_PREPARE_SECTORS			  50
-#define	IAP_CMD_COPY_RAM_TO_FLASH		  51
-#define	IAP_CMD_ERASE_SECTORS			    52
-#define	IAP_CMD_BLANK_CHECK_SECTORS		53
-#define	IAP_CMD_READ_PART_ID			    54
-#define	IAP_CMD_READ_BOOT_ROM_VERSION	55
-#define	IAP_CMD_COMPARE					      56
-#define	IAP_CMD_REINVOKE_ISP			    57
-#define IAP_CMD_READ_UID              58
-
-#define IAP_CMD_ERASE_PAGE            59    //new
-
-/* IAP boot ROM location and access function */
-#define IAP_ROM_LOCATION				0x1FFF1FF1UL
-//#define IAP_EXECUTE_CMD(a, b)			((void (*)())(IAP_ROM_LOCATION))(a, b)
-
-__attribute__((section(".IAP_Code"))) void IAP_EXECUTE_CMD(uint32_t* a, uint32_t* b) {
-    void (*user_code_entry)(uint32_t*,uint32_t*);
-    uint32_t *p;
-    p = (uint32_t *)IAP_ROM_LOCATION;
-    user_code_entry = (void (*)(uint32_t*,uint32_t*))(*p);
-    user_code_entry(a, b);
-}
-
-
-/*****************************************************************************
-** Function name:	u32IAP_PrepareSectors
-**
-** Description:		Prepares sector(s) for erasing or write operations. This
-** 								command must be executed before executing the "Copy RAM to
-** 								Flash" or "Erase Sector(s)" commands.
-**
-** Parameters:		u32StartSector - Number of first sector to prepare.
-** 								u32EndSector - Number of last sector to prepare.
-**
-** Returned value:	Status code returned by IAP ROM function.
-**
-******************************************************************************/
-__attribute__((section(".IAP_Code"))) uint32_t u32IAP_PrepareSectors(uint32_t u32StartSector, uint32_t u32EndSector)
-{
-	uint32_t u32Status;
-	uint32_t au32Result[3];
-	uint32_t au32Command[5];
-
-	if (u32EndSector < u32StartSector)
-	{
-		u32Status = IAP_STA_INVALD_PARAM;
-	}
-	else
-	{
-		au32Command[0] = IAP_CMD_PREPARE_SECTORS;
-		au32Command[1] = u32StartSector;
-		au32Command[2] = u32EndSector;
-		__disable_irq();
-		IAP_EXECUTE_CMD(au32Command, au32Result);
-		__enable_irq();
-		u32Status = au32Result[0];
-	}
-	return u32Status;
-}
-
-/*****************************************************************************
-** Function name:	u32IAP_CopyRAMToFlash
-**
-** Description:		Program the flash memory with data stored in RAM.
-**
-** Parameters:	   	u32DstAddr - Destination Flash address, should be a 256
-**                               byte boundary.
-**			 		u32SrcAddr - Source RAM address, should be a word boundary
-**			 		u32Len     - Number of 8-bit bytes to write, must be a
-**			 					 multiple of 256.
-*
-** Returned value:	Status code returned by IAP ROM function.
-**
-******************************************************************************/
-__attribute__((section(".IAP_Code"))) uint32_t u32IAP_CopyRAMToFlash(uint32_t u32DstAddr, uint32_t u32SrcAddr, uint32_t u32Len)
-{
-	uint32_t au32Result[3];
-	uint32_t au32Command[5];
-
-	au32Command[0] = IAP_CMD_COPY_RAM_TO_FLASH;
-	au32Command[1] = u32DstAddr;
-	au32Command[2] = u32SrcAddr;
-	au32Command[3] = u32Len;
-	au32Command[4] = SystemCoreClock / 1000UL;	/* Core clock frequency in kHz */
-
-	IAP_EXECUTE_CMD(au32Command, au32Result);
-
-	return au32Result[0];
-}
-
-/*****************************************************************************
-** Function name:	u32IAP_EraseSectors
-**
-** Description:		Erase a sector or multiple sectors of on-chip Flash memory.
-**
-** Parameters:		u32StartSector - Number of first sector to erase.
-** 					u32EndSector - Number of last sector to erase.
-*
-** Returned value:	Status code returned by IAP ROM function.
-**
-******************************************************************************/
-__attribute__((section(".IAP_Code"))) uint32_t u32IAP_EraseSectors(uint32_t u32StartSector, uint32_t u32EndSector)
-{
-	uint32_t u32Status;
-	uint32_t au32Result[3];
-	uint32_t au32Command[5];
-
-	if (u32EndSector < u32StartSector)
-	{
-		u32Status = IAP_STA_INVALD_PARAM;
-	}
-	else
-	{
-		au32Command[0] = IAP_CMD_ERASE_SECTORS;
-		au32Command[1] = u32StartSector;
-		au32Command[2] = u32EndSector;
-		au32Command[3] = SystemCoreClock / 1000UL;	/* Core clock frequency in kHz */
-
-		IAP_EXECUTE_CMD(au32Command, au32Result);
-
-		u32Status = au32Result[0];
-	}
-	return u32Status;
-}
-
-/*****************************************************************************
-** Function name:	u32IAP_BlankCheckSectors
-**
-** Description:		Blank check a sector or multiple sectors of on-chip flash
-** 					memory.
-**
-** Parameters:		u32StartSector - Number of first sector to check.
-** 					u32EndSector - Number of last sector to check.
-** 					pu32Result[0] - Offset of the first non blank word location
-**                  if the Status Code is IAP_STA_SECTOR_NOT_BLANK.
-** 					pu32Result[1] - Contents of non blank word location.
-**
-** Returned value:	Status code returned by IAP ROM function.
-**
-******************************************************************************/
-__attribute__((section(".IAP_Code"))) uint32_t u32IAP_BlankCheckSectors(uint32_t u32StartSector, uint32_t u32EndSector, uint32_t *pu32Result)
-{
-	uint32_t u32Status;
-	uint32_t au32Result[3];
-	uint32_t au32Command[5];
-
-	if (u32EndSector < u32StartSector)
-	{
-		u32Status = IAP_STA_INVALD_PARAM;
-	}
-	else
-	{
-		au32Command[0] = IAP_CMD_BLANK_CHECK_SECTORS;
-		au32Command[1] = u32StartSector;
-		au32Command[2] = u32EndSector;
-
-		IAP_EXECUTE_CMD(au32Command, au32Result);
-
-		if (au32Result[0] == IAP_STA_SECTOR_NOT_BLANK)
-		{
-			*pu32Result       = au32Result[0];
-			*(pu32Result + 1) = au32Result[1];
-		}
-		u32Status = au32Result[0];
-	}
-	return u32Status;
-}
-
-/*****************************************************************************
-** Function name:	u32IAP_ReadPartID
-**
-** Description:		Read the part identification number.
-**
-** Parameters:		pu32PartID - Pointer to storage for part ID number.
-*
-** Returned value:	Status code returned by IAP ROM function.
-**
-******************************************************************************/
-__attribute__((section(".IAP_Code"))) uint32_t u32IAP_ReadPartID(uint32_t *pu32PartID)
-{
-	uint32_t au32Result[3];
-	uint32_t au32Command[5];
-
-	au32Command[0] = IAP_CMD_READ_PART_ID;
-	__disable_irq();
-	IAP_EXECUTE_CMD(au32Command, au32Result);
-	__enable_irq();
-	*pu32PartID = au32Result[1];
-
-	return au32Result[0];
-}
-
-/*****************************************************************************
-** Function name:	u32IAP_ReadBootVersion
-**
-** Description:		Read the boot code version number.
-**
-** Parameters:		pu32Major - Major version number in ASCII format.
-** 					pu32Minor - Minor version number in ASCII format.
-**
-** Returned value:	Status code returned by IAP ROM function.
-**
-******************************************************************************/
-__attribute__((section(".IAP_Code"))) uint32_t u32IAP_ReadBootVersion(uint32_t *pu32Major, uint32_t *pu32Minor)
-//uint32_t u32IAP_ReadBootVersion(uint32_t *pu32Major)
-{
-	uint32_t au32Result[3];
-	uint32_t au32Command[5];
-
-	au32Command[0] = IAP_CMD_READ_BOOT_ROM_VERSION;
-
-	IAP_EXECUTE_CMD(au32Command, au32Result);
-
-
-	*pu32Major = (au32Result[1] & 0x0000FF00UL) >> 8;
-	*pu32Minor = au32Result[1] & 0x000000FFUL;
-
-	return au32Result[0];
-}
-
-/*****************************************************************************
-** Function name:	u32IAP_Compare
-**
-** Description:		Compares the memory contents at two locations.
-**
-** Parameters:		u32Len - Number of bytes to compare, must be a multiple of 4.
-**					pu32Offset - Offset of the first mismatch if the Status Code is COMPARE_ERROR
-**
-** Returned value:	Status code returned by IAP ROM function.
-**
-******************************************************************************/
-__attribute__((section(".IAP_Code"))) uint32_t u32IAP_Compare(uint32_t u32DstAddr, uint32_t u32SrcAddr, uint32_t u32Len, uint32_t *pu32Offset)
-{
-	uint32_t au32Result[3];
-	uint32_t au32Command[5];
-
-	au32Command[0] = IAP_CMD_COMPARE;
-	au32Command[1] = u32DstAddr;
-	au32Command[2] = u32SrcAddr;
-	au32Command[3] = u32Len;
-
-	IAP_EXECUTE_CMD(au32Command, au32Result);
-
-	if (au32Result[0] == IAP_STA_COMPARE_ERROR)
-	{
-		if (pu32Offset != 0)
-		{
-			*pu32Offset = au32Result[1];
-		}
-	}
-	return au32Result[0];
-}
-
-/*****************************************************************************
-** Function name:	vIAP_ReinvokeISP
-**
-** Description:		Invoke the bootloader in ISP mode.
-**
-** Parameters:		None.
-*
-** Returned value:	None.
-**
-******************************************************************************/
-__attribute__((section(".IAP_Code"))) void vIAP_ReinvokeISP(void)
-{
-	uint32_t au32Result[3];
-	uint32_t au32Command[5];
-
-	au32Command[0] = IAP_CMD_REINVOKE_ISP;
-
-	IAP_EXECUTE_CMD(au32Command, au32Result);
-}
-
-// read UID
-__attribute__((section(".IAP_Code"))) uint32_t u32IAP_ReadUID(uint32_t * pu32UID)
-{
-	uint32_t au32Result[5];
-	uint32_t au32Command[5];
-
-	au32Command[0] = IAP_CMD_READ_UID;
-
-	IAP_EXECUTE_CMD(au32Command, au32Result);
-//	*pu32UID++ =  au32Result[1];
-//	*pu32UID++ =  au32Result[2];
-//	*pu32UID++ =  au32Result[3];
-//	*pu32UID =  au32Result[4];
-
-	*pu32UID =  au32Result[1];
-	*pu32UID++ =  au32Result[2];
-	*pu32UID++ =  au32Result[3];
-	*pu32UID++ =  au32Result[4];
-
-	return au32Result[0];
-
-}
-
-//IAP erase	Page  256B	 64K have 0-255 pages, page0-15 in sector 0,	32K have 0-127 pages, 128k have 0-511 pages,
-__attribute__((section(".IAP_Code"))) uint32_t u32IAP_ErasePage(uint32_t u32StartPage, uint32_t u32EndPage)
-{
-	uint32_t u32Status;
-	uint32_t au32Result[3];
-	uint32_t au32Command[5];
-
-	if (u32EndPage < u32StartPage)
-	{
-		u32Status = IAP_STA_INVALD_PARAM;
-	}
-	else
-	{
-		au32Command[0] = IAP_CMD_ERASE_PAGE;
-		au32Command[1] = u32StartPage;
-		au32Command[2] = u32EndPage;
-		au32Command[3] = SystemCoreClock / 1000UL;	/* Core clock frequency in kHz */
-
-		IAP_EXECUTE_CMD(au32Command, au32Result);
-
-		u32Status = au32Result[0];
-	}
-	return u32Status;
-}
-
-
-/*****************************************************************************
- **                            End Of File
- *****************************************************************************/
-
--- a/POKITTO_HW/iap.h	Wed Jun 27 13:14:54 2018 +0000
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,81 +0,0 @@
-#ifndef IAP_H_INCLUDED
-#define IAP_H_INCLUDED
-
-#include "Pokitto_settings.h"
-
-extern int HelloFromIAP();
-extern int CopyPageToFlash(uint32_t,uint8_t*);
-extern char iaptest();
-extern void IAPstacksave();
-#define EEPROM_PROFILE 1
-extern void writeEEPROM( uint16_t* eeAddress, uint8_t* buffAddress, uint32_t byteCount );
-extern void readEEPROM( uint16_t* eeAddress, uint8_t* buffAddress, uint32_t byteCount );
-extern uint8_t eeprom_read_byte(uint16_t*);
-extern void eeprom_write_byte(uint16_t*,uint8_t);
-
-/*****************************************************************************
- * $Id$
- *
- * Project:		NXP LPC1100 Secondary Bootloader Example
- *
- * Description: Provides access to In-Application Programming (IAP) routines
- * 			    		contained within the bootROM sector of LPC1100 devices.
- *
- * Copyright(C) 2010, NXP Semiconductor
- * All rights reserved.
- *
- *****************************************************************************
- * Software that is described herein is for illustrative purposes only
- * which provides customers with programming information regarding the
- * products. This software is supplied "AS IS" without any warranties.
- * NXP Semiconductors assumes no responsibility or liability for the
- * use of the software, conveys no license or title under any patent,
- * copyright, or mask work right to the product. NXP Semiconductors
- * reserves the right to make changes in the software without
- * notification. NXP Semiconductors also make no representation or
- * warranty that such application will be suitable for the specified
- * use without further testing or modification.
- *****************************************************************************/
-
-#include <stdint.h>
-
-/* IAP Command Status Codes */
-#define IAP_STA_CMD_SUCCESS 																0
-#define IAP_STA_INVALID_COMMAND 														1
-#define IAP_STA_SRC_ADDR_ERROR 															2
-#define IAP_STA_DST_ADDR_ERROR 															3
-#define IAP_STA_SRC_ADDR_NOT_MAPPED 												4
-#define IAP_STA_DST_ADDR_NOT_MAPPED 												5
-#define IAP_STA_COUNT_ERROR 																6
-#define IAP_STA_INVALID_SECTOR 															7
-#define IAP_STA_SECTOR_NOT_BLANK														8
-#define IAP_STA_SECTOR_NOT_PREPARED_FOR_WRITE_OPERATION 		9
-#define IAP_STA_COMPARE_ERROR 															10
-#define IAP_STA_BUSY 																				11
-#define IAP_STA_INVALD_PARAM 																12
-
-/* Define the flash page size, this is the minimum amount of data can be written in one operation */
-#define IAP_FLASH_PAGE_SIZE_BYTES							256
-#define IAP_FLASH_PAGE_SIZE_WORDS							(IAP_FLASH_PAGE_SIZE_BYTES >> 2)
-
-void vIAP_ReinvokeISP(void);
-uint32_t u32IAP_ReadPartID(uint32_t *pu32PartID);
-uint32_t u32IAP_ReadBootVersion(uint32_t *pu32Major, uint32_t *pu32Minor);
-//uint32_t u32IAP_ReadBootVersion(uint32_t *pu32Major);
-uint32_t u32IAP_EraseSectors(uint32_t u32StartSector, uint32_t u32EndSector);
-uint32_t u32IAP_PrepareSectors(uint32_t u32StartSector, uint32_t u32EndSector);
-uint32_t u32IAP_CopyRAMToFlash(uint32_t u32DstAddr, uint32_t u32SrcAddr, uint32_t u32Len);
-uint32_t u32IAP_BlankCheckSectors(uint32_t u32StartSector, uint32_t u32EndSector, uint32_t *pu32Result);
-uint32_t u32IAP_Compare(uint32_t u32DstAddr, uint32_t u32SrcAddr, uint32_t u32Len, uint32_t *pu32Offset);
-uint32_t u32IAP_ReadUID(uint32_t * pu32UID);
-uint32_t u32IAP_ErasePage(uint32_t u32StartPage, uint32_t u32EndPage);
-
-/*****************************************************************************
-**                            End Of File
-******************************************************************************/
-
-
-
-#endif /* IAP_H_INCLUDED */
-
-
--- a/POKITTO_HW/loader.h	Wed Jun 27 13:14:54 2018 +0000
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,2343 +0,0 @@
-#ifndef MINIHI_BIN_H
-#define MINIHI_BIN_H
-
-
-static const unsigned char loaderh[] __attribute__((at(0x39000))) = {
-    0xe0, 0x7f, 0x00, 0x10, 0xfd, 0x90, 0x03, 0x00, 0x4d, 0x9f, 0x03, 0x00, 
-    0x51, 0x9f, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
-    0x00, 0x00, 0x00, 0x00, 0x85, 0xb0, 0xf4, 0xef, 0x00, 0x00, 0x00, 0x00, 
-    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x55, 0x9f, 0x03, 0x00, 
-    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x59, 0x9f, 0x03, 0x00, 
-    0x5d, 0x9f, 0x03, 0x00, 0x61, 0x9f, 0x03, 0x00, 0x61, 0x9f, 0x03, 0x00, 
-    0x61, 0x9f, 0x03, 0x00, 0x61, 0x9f, 0x03, 0x00, 0x61, 0x9f, 0x03, 0x00, 
-    0x61, 0x9f, 0x03, 0x00, 0x61, 0x9f, 0x03, 0x00, 0x61, 0x9f, 0x03, 0x00, 
-    0x61, 0x9f, 0x03, 0x00, 0x61, 0x9f, 0x03, 0x00, 0x61, 0x9f, 0x03, 0x00, 
-    0x61, 0x9f, 0x03, 0x00, 0x61, 0x9f, 0x03, 0x00, 0x61, 0x9f, 0x03, 0x00, 
-    0x61, 0x9f, 0x03, 0x00, 0x61, 0x9f, 0x03, 0x00, 0x61, 0x9f, 0x03, 0x00, 
-    0x61, 0x9f, 0x03, 0x00, 0x61, 0x9f, 0x03, 0x00, 0x61, 0x9f, 0x03, 0x00, 
-    0x61, 0x9f, 0x03, 0x00, 0x61, 0x9f, 0x03, 0x00, 0x61, 0x9f, 0x03, 0x00, 
-    0x61, 0x9f, 0x03, 0x00, 0x61, 0x9f, 0x03, 0x00, 0x61, 0x9f, 0x03, 0x00, 
-    0x61, 0x9f, 0x03, 0x00, 0x61, 0x9f, 0x03, 0x00, 0x61, 0x9f, 0x03, 0x00, 
-    0x61, 0x9f, 0x03, 0x00, 0x61, 0x9f, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 
-    0x84, 0xeb, 0x03, 0x00, 0x00, 0x01, 0x00, 0x10, 0x7c, 0x00, 0x00, 0x00, 
-    0x84, 0xeb, 0x03, 0x00, 0x00, 0x00, 0x00, 0x20, 0x00, 0x00, 0x00, 0x00, 
-    0x84, 0xeb, 0x03, 0x00, 0x00, 0x40, 0x00, 0x20, 0x00, 0x00, 0x00, 0x00, 
-    0x7c, 0x01, 0x00, 0x10, 0x5c, 0x0b, 0x00, 0x00, 0x00, 0x00, 0x00, 0x20, 
-    0x00, 0x00, 0x00, 0x00, 0x00, 0x40, 0x00, 0x20, 0x00, 0x00, 0x00, 0x00, 
-    0x70, 0xb5, 0x1b, 0x4c, 0x1b, 0x4d, 0xac, 0x42, 0x0e, 0xd2, 0x20, 0x68, 
-    0x61, 0x68, 0x0c, 0x34, 0x23, 0x1f, 0x1a, 0x68, 0x00, 0x23, 0x00, 0x2a, 
-    0xf5, 0xd0, 0x1e, 0x58, 0x5e, 0x50, 0x04, 0x33, 0x9a, 0x42, 0xfa, 0xd8, 
-    0xac, 0x42, 0xf0, 0xd3, 0x13, 0x4a, 0x94, 0x42, 0x13, 0xd2, 0x23, 0x1c, 
-    0x08, 0x33, 0xd5, 0x1d, 0xed, 0x1a, 0xed, 0x08, 0xed, 0x00, 0x5d, 0x19, 
-    0x00, 0x21, 0x62, 0x68, 0x20, 0x68, 0x00, 0x23, 0x00, 0x2a, 0x03, 0xd0, 
-    0x19, 0x50, 0x04, 0x33, 0x9a, 0x42, 0xfb, 0xd8, 0x08, 0x34, 0xac, 0x42, 
-    0xf3, 0xd1, 0x00, 0xf0, 0x69, 0xfe, 0x08, 0x4b, 0x00, 0x2b, 0x02, 0xd0, 
-    0x00, 0xe0, 0x00, 0xbf, 0xfe, 0xe7, 0x02, 0xf0, 0xf7, 0xff, 0x00, 0xf0, 
-    0x87, 0xfd, 0xf9, 0xe7, 0xc0, 0x90, 0x03, 0x00, 0xe4, 0x90, 0x03, 0x00, 
-    0xfc, 0x90, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x10, 0xb5, 0x06, 0x4c, 
-    0x23, 0x78, 0x00, 0x2b, 0x07, 0xd1, 0x05, 0x4b, 0x00, 0x2b, 0x02, 0xd0, 
-    0x04, 0x48, 0x00, 0xe0, 0x00, 0xbf, 0x01, 0x23, 0x23, 0x70, 0x10, 0xbd, 
-    0x7c, 0x01, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x84, 0xeb, 0x03, 0x00, 
-    0x08, 0xb5, 0x08, 0x4b, 0x00, 0x2b, 0x03, 0xd0, 0x07, 0x48, 0x08, 0x49, 
-    0x00, 0xe0, 0x00, 0xbf, 0x07, 0x48, 0x03, 0x68, 0x00, 0x2b, 0x03, 0xd0, 
-    0x06, 0x4b, 0x00, 0x2b, 0x00, 0xd0, 0x98, 0x47, 0x08, 0xbd, 0xc0, 0x46, 
-    0x00, 0x00, 0x00, 0x00, 0x84, 0xeb, 0x03, 0x00, 0x80, 0x01, 0x00, 0x10, 
-    0x7c, 0x01, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x08, 0xb5, 0x01, 0x1c, 
-    0x01, 0x48, 0x00, 0xf0, 0xbd, 0xfd, 0x08, 0xbd, 0x24, 0x02, 0x00, 0x10, 
-    0x08, 0xb5, 0x03, 0x48, 0xff, 0x21, 0x00, 0xf0, 0xb5, 0xfd, 0xc0, 0xb2, 
-    0x08, 0xbd, 0xc0, 0x46, 0x24, 0x02, 0x00, 0x10, 0xf8, 0xb5, 0x43, 0xb2, 
-    0x04, 0x1c, 0x0d, 0x1c, 0x00, 0x2b, 0x07, 0xda, 0x77, 0x20, 0x00, 0x21, 
-    0xff, 0xf7, 0xf6, 0xff, 0x01, 0x28, 0x32, 0xd8, 0x7f, 0x23, 0x1c, 0x40, 
-    0xa0, 0x26, 0x88, 0x23, 0x9b, 0x01, 0x36, 0x06, 0x80, 0x27, 0xf7, 0x50, 
-    0xff, 0xf7, 0xe0, 0xff, 0x8a, 0x23, 0x9b, 0x01, 0xf7, 0x50, 0xff, 0xf7, 
-    0xdb, 0xff, 0x20, 0x1c, 0xff, 0xf7, 0xd0, 0xff, 0x28, 0x0e, 0xff, 0xf7, 
-    0xcd, 0xff, 0x28, 0x0c, 0xc0, 0xb2, 0xff, 0xf7, 0xc9, 0xff, 0x28, 0x0a, 
-    0xc0, 0xb2, 0xff, 0xf7, 0xc5, 0xff, 0xe8, 0xb2, 0xff, 0xf7, 0xc2, 0xff, 
-    0x40, 0x2c, 0x04, 0xd0, 0x87, 0x20, 0x48, 0x2c, 0x02, 0xd0, 0x01, 0x20, 
-    0x00, 0xe0, 0x95, 0x20, 0xff, 0xf7, 0xb8, 0xff, 0x0a, 0x24, 0xff, 0xf7, 
-    0xbd, 0xff, 0x03, 0x06, 0x03, 0xd5, 0x01, 0x3c, 0xe4, 0xb2, 0x00, 0x2c, 
-    0xf7, 0xd1, 0xf8, 0xbd, 0x73, 0xb5, 0x88, 0x23, 0x40, 0x4d, 0xa0, 0x24, 
-    0x9b, 0x01, 0x80, 0x22, 0x24, 0x06, 0xe2, 0x50, 0x28, 0x1c, 0x3e, 0x49, 
-    0x00, 0xf0, 0x5a, 0xfd, 0x28, 0x1c, 0x08, 0x21, 0x00, 0x22, 0x00, 0xf0, 
-    0x49, 0xfd, 0x84, 0x23, 0x9b, 0x01, 0xe3, 0x58, 0x64, 0x25, 0x01, 0x3d, 
-    0xed, 0xb2, 0xff, 0xf7, 0x9d, 0xff, 0x00, 0x2d, 0xf9, 0xd1, 0x40, 0x20, 
-    0x29, 0x1c, 0xff, 0xf7, 0xa1, 0xff, 0x04, 0x1e, 0x01, 0x2c, 0x35, 0xd1, 
-    0xd5, 0x21, 0x48, 0x20, 0x49, 0x00, 0xff, 0xf7, 0x99, 0xff, 0x01, 0x28, 
-    0x15, 0xd1, 0xff, 0xf7, 0x8b, 0xff, 0x01, 0xae, 0xa8, 0x55, 0x01, 0x35, 
-    0x04, 0x2d, 0xf8, 0xd1, 0xb3, 0x78, 0x01, 0x2b, 0x24, 0xd1, 0xf3, 0x78, 
-    0xaa, 0x2b, 0x21, 0xd1, 0x28, 0x4c, 0x80, 0x21, 0xc9, 0x05, 0xe9, 0x20, 
-    0xff, 0xf7, 0x84, 0xff, 0x01, 0x1e, 0x3b, 0xd1, 0x1a, 0xe0, 0xe9, 0x20, 
-    0x29, 0x1c, 0xff, 0xf7, 0x7d, 0xff, 0x41, 0x26, 0x01, 0x28, 0x01, 0xd8, 
-    0x02, 0x24, 0xe9, 0x26, 0x20, 0x4d, 0x30, 0x1c, 0x00, 0x21, 0xff, 0xf7, 
-    0x73, 0xff, 0x00, 0x28, 0x2f, 0xd1, 0x00, 0x2d, 0x06, 0xd0, 0x80, 0x21, 
-    0x50, 0x20, 0x89, 0x00, 0xff, 0xf7, 0x6a, 0xff, 0x00, 0x28, 0x13, 0xd0, 
-    0x00, 0x24, 0x11, 0xe0, 0x00, 0x2c, 0xfb, 0xd0, 0x7a, 0x20, 0xff, 0xf7, 
-    0x61, 0xff, 0x00, 0x28, 0xf6, 0xd1, 0x04, 0x1c, 0xff, 0xf7, 0x52, 0xff, 
-    0x30, 0x55, 0x01, 0x34, 0x04, 0x2c, 0xf9, 0xd1, 0x33, 0x78, 0x5a, 0x06, 
-    0x00, 0xd5, 0x0c, 0x24, 0x0f, 0x4b, 0xa0, 0x22, 0x1c, 0x70, 0x88, 0x23, 
-    0x80, 0x21, 0x9b, 0x01, 0x12, 0x06, 0xd1, 0x50, 0xff, 0xf7, 0x40, 0xff, 
-    0x60, 0x42, 0x60, 0x41, 0xc0, 0xb2, 0x76, 0xbd, 0x01, 0x3c, 0xa4, 0xb2, 
-    0x00, 0x2c, 0xd9, 0xd0, 0xb7, 0xe7, 0x01, 0x3d, 0xad, 0xb2, 0x00, 0x2d, 
-    0xd4, 0xd0, 0xc4, 0xe7, 0x24, 0x02, 0x00, 0x10, 0x80, 0x1a, 0x06, 0x00, 
-    0xe0, 0x2e, 0x00, 0x00, 0xa8, 0x61, 0x00, 0x00, 0x98, 0x01, 0x00, 0x10, 
-    0xf8, 0xb5, 0x1d, 0x1c, 0x23, 0x4b, 0x07, 0x1c, 0x1b, 0x78, 0x14, 0x1c, 
-    0x1a, 0x07, 0x00, 0xd4, 0x49, 0x02, 0x51, 0x20, 0xff, 0xf7, 0x26, 0xff, 
-    0x00, 0x28, 0x01, 0xd0, 0x01, 0x26, 0x2f, 0xe0, 0x1d, 0x4e, 0xff, 0xf7, 
-    0x15, 0xff, 0xff, 0x28, 0x04, 0xd1, 0x01, 0x3e, 0xb6, 0xb2, 0x00, 0x2e, 
-    0xf4, 0xd0, 0xf6, 0xe7, 0xfe, 0x28, 0xf1, 0xd1, 0x18, 0x4e, 0x76, 0x1b, 
-    0x36, 0x1b, 0xb6, 0xb2, 0x00, 0x2c, 0x02, 0xd1, 0x3c, 0x1e, 0x05, 0xd1, 
-    0x0e, 0xe0, 0x01, 0x3c, 0xff, 0xf7, 0x00, 0xff, 0xa4, 0xb2, 0xf5, 0xe7, 
-    0xff, 0xf7, 0xfc, 0xfe, 0x7a, 0x19, 0x20, 0x70, 0x01, 0x34, 0x92, 0xb2, 
-    0xa3, 0xb2, 0x9a, 0x42, 0xf6, 0xd1, 0x05, 0xe0, 0x01, 0x3d, 0xad, 0xb2, 
-    0xff, 0xf7, 0xf0, 0xfe, 0x00, 0x2d, 0xf9, 0xd1, 0x01, 0x3e, 0xb6, 0xb2, 
-    0xff, 0xf7, 0xea, 0xfe, 0x00, 0x2e, 0xf9, 0xd1, 0x88, 0x23, 0xa0, 0x22, 
-    0x80, 0x21, 0x9b, 0x01, 0x12, 0x06, 0xd1, 0x50, 0xff, 0xf7, 0xe0, 0xfe, 
-    0x30, 0x1c, 0xf8, 0xbd, 0x98, 0x01, 0x00, 0x10, 0x30, 0x75, 0x00, 0x00, 
-    0x02, 0x02, 0x00, 0x00, 0x06, 0x4b, 0x82, 0x1e, 0x1b, 0x68, 0x00, 0x20, 
-    0xd9, 0x68, 0x02, 0x39, 0x8a, 0x42, 0x03, 0xd2, 0x58, 0x78, 0x9b, 0x69, 
-    0x50, 0x43, 0xc0, 0x18, 0x70, 0x47, 0xc0, 0x46, 0x9c, 0x01, 0x00, 0x10, 
-    0x0f, 0x4b, 0x10, 0xb5, 0x1a, 0x68, 0x00, 0x23, 0x03, 0x80, 0x83, 0x68, 
-    0x04, 0x1c, 0x01, 0x2b, 0x14, 0xd0, 0xd1, 0x68, 0x01, 0x20, 0x8b, 0x42, 
-    0x11, 0xd2, 0x00, 0x2b, 0x03, 0xd1, 0x11, 0x78, 0x03, 0x29, 0x00, 0xd1, 
-    0x53, 0x69, 0xe3, 0x60, 0x00, 0x2b, 0x03, 0xd0, 0x18, 0x1c, 0xff, 0xf7, 
-    0xd7, 0xff, 0x00, 0xe0, 0x50, 0x69, 0x20, 0x61, 0x00, 0x20, 0x00, 0xe0, 
-    0x18, 0x1c, 0x10, 0xbd, 0x9c, 0x01, 0x00, 0x10, 0xf0, 0xb5, 0x36, 0x4b, 
-    0x85, 0xb0, 0x04, 0x1c, 0x1d, 0x68, 0x01, 0x28, 0x63, 0xd9, 0xea, 0x68, 
-    0x90, 0x42, 0x60, 0xd2, 0x2e, 0x78, 0x02, 0x2e, 0x32, 0xd0, 0x03, 0x2e, 
-    0x41, 0xd0, 0x01, 0x2e, 0x59, 0xd1, 0x83, 0xb2, 0x5a, 0x08, 0xd3, 0x18, 
-    0x9b, 0xb2, 0xda, 0x05, 0x5b, 0x0a, 0x01, 0x93, 0x2b, 0x4b, 0xd2, 0x0d, 
-    0x03, 0xaf, 0x29, 0x69, 0x9a, 0x42, 0x04, 0xd0, 0x01, 0x9b, 0x38, 0x1c, 
-    0x59, 0x18, 0x02, 0x23, 0x0e, 0xe0, 0x01, 0x9b, 0x38, 0x1c, 0x59, 0x18, 
-    0x33, 0x1c, 0xff, 0xf7, 0x55, 0xff, 0x02, 0x1e, 0x3f, 0xd1, 0x29, 0x69, 
-    0x01, 0x9b, 0x01, 0x31, 0x68, 0x46, 0xc9, 0x18, 0x0d, 0x30, 0x33, 0x1c, 
-    0xff, 0xf7, 0x4a, 0xff, 0x00, 0x28, 0x34, 0xd1, 0x7b, 0x78, 0x38, 0x78, 
-    0x1b, 0x02, 0x03, 0x43, 0x18, 0x11, 0xe2, 0x07, 0x2e, 0xd4, 0x18, 0x05, 
-    0x00, 0x0d, 0x2b, 0xe0, 0x2b, 0x69, 0x01, 0x0a, 0xc4, 0xb2, 0x03, 0xaf, 
-    0xc9, 0x18, 0x62, 0x00, 0x38, 0x1c, 0x33, 0x1c, 0xff, 0xf7, 0x34, 0xff, 
-    0x00, 0x28, 0x1e, 0xd1, 0x78, 0x78, 0x3b, 0x78, 0x00, 0x02, 0x18, 0x43, 
-    0x1a, 0xe0, 0x2b, 0x69, 0x7f, 0x22, 0xc1, 0x09, 0x03, 0xae, 0x14, 0x40, 
-    0xc9, 0x18, 0xa2, 0x00, 0x30, 0x1c, 0x04, 0x23, 0xff, 0xf7, 0x22, 0xff, 
-    0x00, 0x28, 0x0c, 0xd1, 0xf0, 0x78, 0xb3, 0x78, 0x00, 0x06, 0x1b, 0x04, 
-    0x18, 0x43, 0x33, 0x78, 0x18, 0x43, 0x73, 0x78, 0x1b, 0x02, 0x18, 0x43, 
-    0x00, 0x01, 0x00, 0x09, 0x00, 0xe0, 0x01, 0x20, 0x05, 0xb0, 0xf0, 0xbd, 
-    0x9c, 0x01, 0x00, 0x10, 0xff, 0x01, 0x00, 0x00, 0x70, 0xb5, 0x05, 0x88, 
-    0x15, 0x4b, 0x01, 0x35, 0xad, 0xb2, 0x04, 0x1c, 0x1e, 0x68, 0x00, 0x2d, 
-    0x01, 0xd1, 0x03, 0x20, 0x21, 0xe0, 0x03, 0x69, 0x00, 0x2b, 0xfa, 0xd0, 
-    0x2a, 0x07, 0x18, 0xd1, 0x01, 0x33, 0x03, 0x61, 0xc0, 0x68, 0x00, 0x28, 
-    0x03, 0xd1, 0xb3, 0x88, 0xab, 0x42, 0xf0, 0xd9, 0x0f, 0xe0, 0x72, 0x78, 
-    0x2b, 0x09, 0x01, 0x3a, 0x1a, 0x42, 0x0a, 0xd1, 0xff, 0xf7, 0x6e, 0xff, 
-    0x01, 0x28, 0x09, 0xd9, 0xf3, 0x68, 0x98, 0x42, 0xe3, 0xd2, 0xe0, 0x60, 
-    0xff, 0xf7, 0x34, 0xff, 0x20, 0x61, 0x25, 0x80, 0x00, 0x20, 0x00, 0xe0, 
-    0x01, 0x20, 0x70, 0xbd, 0x9c, 0x01, 0x00, 0x10, 0xf8, 0xb5, 0x04, 0x1c, 
-    0x0d, 0x1c, 0x2b, 0x78, 0x20, 0x2b, 0x01, 0xd1, 0x01, 0x35, 0xfa, 0xe7, 
-    0x2f, 0x3b, 0x5a, 0x42, 0x53, 0x41, 0x00, 0x26, 0xed, 0x18, 0xa6, 0x60, 
-    0x2b, 0x78, 0x20, 0x2b, 0x2b, 0xd8, 0x20, 0x1c, 0xff, 0xf7, 0x28, 0xff, 
-    0x3e, 0x4b, 0x1b, 0x68, 0x9b, 0x68, 0x1e, 0x70, 0x76, 0xe0, 0x33, 0x78, 
-    0x00, 0x2b, 0x65, 0xd0, 0xf2, 0x7a, 0x08, 0x23, 0x13, 0x40, 0x5a, 0xd1, 
-    0x62, 0x68, 0xf1, 0x5c, 0x01, 0x33, 0xd0, 0x18, 0x01, 0x38, 0x00, 0x78, 
-    0x88, 0x42, 0x52, 0xd1, 0x0b, 0x2b, 0xf6, 0xd1, 0xd3, 0x7a, 0x00, 0x2b, 
-    0x61, 0xd1, 0x3b, 0x68, 0x9b, 0x68, 0xda, 0x7a, 0xd1, 0x06, 0x5a, 0xd5, 
-    0x5a, 0x7d, 0x19, 0x7d, 0x12, 0x02, 0x0a, 0x43, 0xd9, 0x7e, 0x9b, 0x7e, 
-    0x09, 0x02, 0x12, 0x04, 0x0b, 0x43, 0x13, 0x43, 0xa3, 0x60, 0x60, 0x68, 
-    0x02, 0x1c, 0x03, 0x1c, 0x0b, 0x32, 0x93, 0x42, 0x03, 0xd0, 0x20, 0x21, 
-    0x19, 0x70, 0x01, 0x33, 0xf9, 0xe7, 0x00, 0x22, 0x13, 0x1c, 0x08, 0x21, 
-    0x5e, 0x1c, 0xeb, 0x5c, 0xf6, 0xb2, 0x20, 0x2b, 0x10, 0xd9, 0x2f, 0x2b, 
-    0x0e, 0xd0, 0x2e, 0x2b, 0x34, 0xd0, 0x8a, 0x42, 0x0a, 0xd2, 0x1f, 0x1c, 
-    0x61, 0x3f, 0x19, 0x2f, 0x01, 0xd8, 0x20, 0x3b, 0xdb, 0xb2, 0x57, 0x1c, 
-    0x83, 0x54, 0xfa, 0xb2, 0x33, 0x1c, 0xe9, 0xe7, 0x00, 0x22, 0x20, 0x21, 
-    0x99, 0x42, 0x52, 0x41, 0xc2, 0x72, 0x20, 0x1c, 0xad, 0x19, 0xff, 0xf7, 
-    0xd3, 0xfe, 0x00, 0x28, 0x14, 0xd1, 0x13, 0x4f, 0x3b, 0x68, 0x9e, 0x68, 
-    0x22, 0x88, 0x0f, 0x23, 0x1a, 0x40, 0x52, 0x01, 0x30, 0x1c, 0x21, 0x69, 
-    0x20, 0x23, 0xff, 0xf7, 0x65, 0xfe, 0x00, 0x28, 0x9f, 0xd0, 0x01, 0x20, 
-    0x14, 0xe0, 0x20, 0x1c, 0xff, 0xf7, 0x52, 0xff, 0x00, 0x28, 0xed, 0xd0, 
-    0x03, 0x28, 0x0d, 0xd1, 0x63, 0x68, 0xd8, 0x7a, 0x43, 0x42, 0x58, 0x41, 
-    0x03, 0x30, 0x07, 0xe0, 0x08, 0x29, 0xd5, 0xd1, 0x0a, 0x1c, 0x0b, 0x21, 
-    0xd0, 0xe7, 0x04, 0x20, 0x00, 0xe0, 0x00, 0x20, 0xf8, 0xbd, 0xc0, 0x46, 
-    0x9c, 0x01, 0x00, 0x10, 0x30, 0xb5, 0x1b, 0x4b, 0x01, 0x1c, 0x1d, 0x68, 
-    0x91, 0xb0, 0x06, 0x20, 0x00, 0x2d, 0x2c, 0xd0, 0x00, 0x23, 0x08, 0xac, 
-    0xab, 0x70, 0xac, 0x60, 0x00, 0xab, 0x03, 0xa8, 0x04, 0x93, 0xff, 0xf7, 
-    0x5b, 0xff, 0x00, 0x28, 0x21, 0xd1, 0x23, 0x78, 0x03, 0x20, 0x00, 0x2b, 
-    0x1d, 0xd0, 0xe2, 0x7a, 0x10, 0x23, 0x13, 0x40, 0x19, 0xd1, 0x61, 0x7d, 
-    0x22, 0x7d, 0x09, 0x02, 0x11, 0x43, 0xe2, 0x7e, 0xa0, 0x7e, 0x12, 0x02, 
-    0x09, 0x04, 0x02, 0x43, 0x0a, 0x43, 0x6a, 0x62, 0xe1, 0x7f, 0xa2, 0x7f, 
-    0x09, 0x06, 0x12, 0x04, 0x0a, 0x43, 0x21, 0x7f, 0x18, 0x1c, 0x0a, 0x43, 
-    0x61, 0x7f, 0xeb, 0x61, 0x09, 0x02, 0x0a, 0x43, 0x2a, 0x62, 0x01, 0x22, 
-    0xaa, 0x70, 0x11, 0xb0, 0x30, 0xbd, 0xc0, 0x46, 0x9c, 0x01, 0x00, 0x10, 
-    0xf7, 0xb5, 0x31, 0x4b, 0x01, 0x90, 0x1c, 0x68, 0x00, 0x23, 0x0d, 0x1c, 
-    0x17, 0x1c, 0x13, 0x80, 0x9c, 0x42, 0x57, 0xd0, 0xa3, 0x78, 0x05, 0x20, 
-    0xd9, 0x07, 0x54, 0xd5, 0x22, 0x6a, 0xe1, 0x69, 0x53, 0x1a, 0x9d, 0x42, 
-    0x00, 0xd9, 0x9d, 0xb2, 0x01, 0x9a, 0x00, 0x92, 0x00, 0x2d, 0x43, 0xd0, 
-    0xe6, 0x69, 0xf3, 0x05, 0x1b, 0xd1, 0x70, 0x0a, 0x61, 0x78, 0x02, 0xf0, 
-    0x99, 0xfd, 0x00, 0x29, 0x0b, 0xd1, 0x00, 0x2e, 0x01, 0xd1, 0x60, 0x6a, 
-    0x02, 0xe0, 0xa0, 0x6a, 0xff, 0xf7, 0x68, 0xfe, 0x01, 0x28, 0x33, 0xd9, 
-    0x00, 0x23, 0xa0, 0x62, 0xe3, 0x70, 0xa0, 0x6a, 0xff, 0xf7, 0x2e, 0xfe, 
-    0x00, 0x28, 0x2b, 0xd0, 0xe3, 0x78, 0x5a, 0x1c, 0xc3, 0x18, 0xe2, 0x70, 
-    0xe3, 0x62, 0xe3, 0x69, 0x2e, 0x1c, 0xda, 0x05, 0x80, 0x23, 0xd1, 0x0d, 
-    0x9b, 0x00, 0x5b, 0x1a, 0x9b, 0xb2, 0x9d, 0x42, 0x00, 0xd9, 0x1e, 0x1c, 
-    0x01, 0x98, 0x00, 0x99, 0x43, 0x1e, 0x98, 0x41, 0xb6, 0xb2, 0x40, 0x42, 
-    0x08, 0x40, 0xd2, 0x0d, 0xe1, 0x6a, 0x33, 0x1c, 0xff, 0xf7, 0xc0, 0xfd, 
-    0x00, 0x28, 0x0d, 0xd1, 0xe2, 0x69, 0xad, 0x1b, 0x93, 0x19, 0xe3, 0x61, 
-    0x00, 0x9b, 0xad, 0xb2, 0x9b, 0x19, 0x00, 0x93, 0x3b, 0x88, 0xf6, 0x18, 
-    0x3e, 0x80, 0xb9, 0xe7, 0x28, 0x1c, 0x04, 0xe0, 0x00, 0x23, 0xa3, 0x70, 
-    0x01, 0x20, 0x00, 0xe0, 0x06, 0x20, 0xfe, 0xbd, 0x9c, 0x01, 0x00, 0x10, 
-    0x2a, 0x4b, 0xf7, 0xb5, 0x1c, 0x68, 0x00, 0x2c, 0x4c, 0xd0, 0xa2, 0x78, 
-    0x05, 0x23, 0xd1, 0x07, 0x49, 0xd5, 0x23, 0x6a, 0x05, 0x1e, 0x9d, 0x42, 
-    0x00, 0xd9, 0x1d, 0x1c, 0x00, 0x22, 0xe3, 0x69, 0xe2, 0x61, 0x95, 0x42, 
-    0x38, 0xd0, 0x66, 0x78, 0x76, 0x02, 0x00, 0x2b, 0x12, 0xd0, 0x31, 0x1c, 
-    0x68, 0x1e, 0x5f, 0x1e, 0x02, 0xf0, 0xf2, 0xfc, 0x31, 0x1c, 0x01, 0x90, 
-    0x38, 0x1c, 0x02, 0xf0, 0xed, 0xfc, 0x01, 0x9a, 0x82, 0x42, 0x05, 0xd3, 
-    0x73, 0x42, 0x3b, 0x40, 0xe3, 0x61, 0xed, 0x1a, 0xa0, 0x6a, 0x0e, 0xe0, 
-    0x60, 0x6a, 0xa0, 0x62, 0x0b, 0xe0, 0xff, 0xf7, 0xfb, 0xfd, 0x01, 0x28, 
-    0x1c, 0xd9, 0xe3, 0x68, 0x98, 0x42, 0x19, 0xd2, 0xe1, 0x69, 0xa0, 0x62, 
-    0x8b, 0x19, 0xe3, 0x61, 0xad, 0x1b, 0xb5, 0x42, 0xf1, 0xd8, 0xe2, 0x69, 
-    0x53, 0x19, 0xe3, 0x61, 0xff, 0xf7, 0xb8, 0xfd, 0x00, 0x28, 0x0b, 0xd0, 
-    0x6b, 0x0a, 0xda, 0xb2, 0xed, 0x05, 0x01, 0xd1, 0xe2, 0x70, 0x03, 0xe0, 
-    0x01, 0x32, 0x18, 0x18, 0xe2, 0x70, 0xe0, 0x62, 0x00, 0x23, 0x04, 0xe0, 
-    0x00, 0x23, 0xa3, 0x70, 0x01, 0x23, 0x00, 0xe0, 0x06, 0x23, 0x18, 0x1c, 
-    0xfe, 0xbd, 0xc0, 0x46, 0x9c, 0x01, 0x00, 0x10, 0x30, 0xb5, 0x15, 0x4b, 
-    0x05, 0x1c, 0x1b, 0x68, 0x8d, 0xb0, 0x06, 0x20, 0x00, 0x2b, 0x20, 0xd0, 
-    0x04, 0xac, 0x9c, 0x60, 0x01, 0xab, 0x6b, 0x60, 0x28, 0x1c, 0xff, 0xf7, 
-    0x65, 0xfe, 0x00, 0x28, 0x14, 0xd1, 0x23, 0x78, 0x00, 0x2b, 0x0e, 0xd0, 
-    0xe3, 0x7a, 0x04, 0x20, 0xda, 0x06, 0x10, 0xd5, 0x62, 0x7d, 0x23, 0x7d, 
-    0x12, 0x02, 0x1a, 0x43, 0xe3, 0x7e, 0xa1, 0x7e, 0x1b, 0x02, 0x12, 0x04, 
-    0x0b, 0x43, 0x13, 0x43, 0xab, 0x60, 0x28, 0x1c, 0xff, 0xf7, 0x8a, 0xfd, 
-    0x03, 0x28, 0x00, 0xd1, 0x04, 0x20, 0x0d, 0xb0, 0x30, 0xbd, 0xc0, 0x46, 
-    0x9c, 0x01, 0x00, 0x10, 0xf0, 0xb5, 0x44, 0x4f, 0x8d, 0xb0, 0x3b, 0x68, 
-    0x04, 0x1c, 0x0d, 0x1c, 0x00, 0x2b, 0x74, 0xd0, 0x04, 0xae, 0x9e, 0x60, 
-    0x01, 0xab, 0x43, 0x60, 0x03, 0x20, 0x00, 0x29, 0x1a, 0xd1, 0x20, 0x1c, 
-    0xff, 0xf7, 0x70, 0xfd, 0x74, 0xe0, 0x22, 0x88, 0x0f, 0x23, 0x1a, 0x40, 
-    0x52, 0x01, 0x30, 0x1c, 0x20, 0x23, 0xff, 0xf7, 0x07, 0xfd, 0x00, 0x28, 
-    0x68, 0xd1, 0x33, 0x78, 0x00, 0x2b, 0x63, 0xd0, 0x6a, 0x46, 0x1b, 0x32, 
-    0x12, 0x78, 0xe5, 0x2b, 0x59, 0xd1, 0x20, 0x1c, 0xff, 0xf7, 0xee, 0xfd, 
-    0x00, 0x28, 0x04, 0xd1, 0x21, 0x69, 0x00, 0x29, 0xe5, 0xd1, 0x00, 0x28, 
-    0x05, 0xd0, 0x00, 0x23, 0x23, 0x61, 0x03, 0x28, 0x01, 0xd0, 0x00, 0x28, 
-    0x52, 0xd1, 0x23, 0x69, 0x28, 0x1c, 0x09, 0x30, 0x00, 0x2b, 0x38, 0xd0, 
-    0x3b, 0x68, 0x02, 0x1c, 0x9b, 0x68, 0x00, 0x21, 0x5e, 0x5c, 0x20, 0x2e, 
-    0x07, 0xd0, 0x05, 0x2e, 0x00, 0xd1, 0xe5, 0x26, 0x46, 0x54, 0x01, 0x31, 
-    0x01, 0x32, 0x08, 0x29, 0xf4, 0xd1, 0x19, 0x7a, 0x20, 0x29, 0x0e, 0xd0, 
-    0x2e, 0x21, 0x11, 0x70, 0x19, 0x1c, 0x16, 0x1d, 0x08, 0x31, 0x01, 0x32, 
-    0x08, 0x78, 0x20, 0x28, 0x05, 0xd0, 0x01, 0x32, 0x57, 0x1e, 0x38, 0x70, 
-    0x01, 0x31, 0xb2, 0x42, 0xf6, 0xd1, 0xd9, 0x7a, 0x29, 0x72, 0xd8, 0x7f, 
-    0x99, 0x7f, 0x00, 0x06, 0x09, 0x04, 0x01, 0x43, 0x18, 0x7f, 0x01, 0x43, 
-    0x58, 0x7f, 0x00, 0x02, 0x01, 0x43, 0x29, 0x60, 0x59, 0x7e, 0x18, 0x7e, 
-    0x09, 0x02, 0x01, 0x43, 0xa9, 0x80, 0xd9, 0x7d, 0x9b, 0x7d, 0x09, 0x02, 
-    0x0b, 0x43, 0xeb, 0x80, 0x10, 0x1c, 0x00, 0x25, 0x05, 0x70, 0x20, 0x1c, 
-    0xff, 0xf7, 0x9e, 0xfd, 0x03, 0x28, 0x0d, 0xd1, 0x25, 0x61, 0x28, 0x1c, 
-    0x0a, 0xe0, 0x06, 0x20, 0x08, 0xe0, 0x2e, 0x2b, 0xa3, 0xd0, 0x13, 0x07, 
-    0xa1, 0xd4, 0xb0, 0xe7, 0x03, 0x20, 0xa8, 0xe7, 0x01, 0x20, 0xa6, 0xe7, 
-    0x0d, 0xb0, 0xf0, 0xbd, 0x9c, 0x01, 0x00, 0x10, 0x38, 0xb5, 0x05, 0x1c, 
-    0x0c, 0x1c, 0x13, 0x1c, 0x29, 0x1c, 0x02, 0x48, 0x22, 0x1c, 0x00, 0xf0, 
-    0x0c, 0xf8, 0x38, 0xbd, 0xb8, 0xdb, 0x03, 0x00, 0x08, 0xb5, 0x72, 0xb6, 
-    0x96, 0x20, 0x00, 0xf0, 0xa8, 0xf9, 0x96, 0x20, 0x00, 0xf0, 0xa5, 0xf9, 
-    0xf8, 0xe7, 0x0f, 0xb4, 0x01, 0x20, 0x08, 0xb5, 0x02, 0xf0, 0x42, 0xfb, 
-    0x70, 0xb5, 0x0d, 0x1c, 0x04, 0x1c, 0x16, 0x1c, 0x00, 0xf0, 0xa8, 0xfa, 
-    0x01, 0x35, 0x07, 0xd0, 0x20, 0x1c, 0x00, 0x21, 0x00, 0xf0, 0xca, 0xfa, 
-    0x20, 0x1c, 0x31, 0x1c, 0x00, 0xf0, 0xc0, 0xfa, 0x70, 0xbd, 0x08, 0xb5, 
-    0x01, 0x22, 0xff, 0xf7, 0xeb, 0xff, 0x08, 0xbd, 0x10, 0xb5, 0x04, 0x4b, 
-    0x04, 0x1c, 0x08, 0x33, 0x03, 0x60, 0x1c, 0x30, 0x00, 0xf0, 0x90, 0xfb, 
-    0x20, 0x1c, 0x10, 0xbd, 0xf0, 0xdb, 0x03, 0x00, 0x10, 0xb5, 0x06, 0x4b, 
-    0x04, 0x1c, 0x08, 0x33, 0x03, 0x60, 0x1c, 0x30, 0x00, 0xf0, 0x84, 0xfb, 
-    0x20, 0x1c, 0x00, 0xf0, 0x35, 0xfa, 0x20, 0x1c, 0x10, 0xbd, 0xc0, 0x46, 
-    0xf0, 0xdb, 0x03, 0x00, 0x08, 0xb5, 0x01, 0x29, 0x0c, 0xd0, 0x02, 0x29, 
-    0x09, 0xd1, 0xc3, 0x6c, 0x00, 0x2b, 0x12, 0xd0, 0x82, 0x6b, 0x00, 0x2a, 
-    0x03, 0xd0, 0x01, 0x1c, 0x3c, 0x31, 0x10, 0x1c, 0x98, 0x47, 0x08, 0xbd, 
-    0x43, 0x6b, 0x00, 0x2b, 0x0c, 0xd0, 0x02, 0x6a, 0x00, 0x2a, 0xf8, 0xd0, 
-    0x01, 0x1c, 0x24, 0x31, 0x10, 0x1c, 0x98, 0x47, 0xf3, 0xe7, 0x83, 0x6b, 
-    0x00, 0x2b, 0xf0, 0xd0, 0x98, 0x47, 0xee, 0xe7, 0x03, 0x6a, 0x00, 0x2b, 
-    0xeb, 0xd0, 0x98, 0x47, 0xe9, 0xe7, 0xc0, 0x46, 0x38, 0xb5, 0x0e, 0x4b, 
-    0x04, 0x1c, 0x08, 0x33, 0x03, 0x60, 0x00, 0x23, 0x0d, 0x1c, 0x43, 0x60, 
-    0x83, 0x60, 0xc3, 0x60, 0x03, 0x61, 0x43, 0x61, 0x83, 0x61, 0xc3, 0x61, 
-    0x03, 0x62, 0x43, 0x63, 0x83, 0x63, 0xc3, 0x64, 0x06, 0x4a, 0x23, 0x1c, 
-    0x1c, 0x30, 0x00, 0xf0, 0xdd, 0xfa, 0x20, 0x1d, 0x29, 0x1c, 0xff, 0xf7, 
-    0x9e, 0xff, 0x20, 0x1c, 0x38, 0xbd, 0xc0, 0x46, 0xf0, 0xdb, 0x03, 0x00, 
-    0x09, 0x9b, 0x03, 0x00, 0x08, 0xb5, 0x00, 0x29, 0x08, 0xd0, 0x00, 0x23, 
-    0x01, 0x62, 0x43, 0x63, 0x01, 0x21, 0x1c, 0x30, 0x01, 0x22, 0x00, 0xf0, 
-    0x3d, 0xfb, 0x08, 0xbd, 0x1c, 0x30, 0x01, 0x21, 0x00, 0x22, 0x00, 0xf0, 
-    0x37, 0xfb, 0xf8, 0xe7, 0x08, 0xb5, 0x00, 0x29, 0x08, 0xd0, 0x00, 0x23, 
-    0x81, 0x63, 0xc3, 0x64, 0x02, 0x21, 0x1c, 0x30, 0x01, 0x22, 0x00, 0xf0, 
-    0x2b, 0xfb, 0x08, 0xbd, 0x1c, 0x30, 0x02, 0x21, 0x00, 0x22, 0x00, 0xf0, 
-    0x25, 0xfb, 0xf8, 0xe7, 0x10, 0xb5, 0x04, 0x1c, 0x42, 0x1c, 0x12, 0xd0, 
-    0x0b, 0x68, 0x5a, 0x1c, 0x0c, 0xd0, 0xa3, 0x42, 0x08, 0xd1, 0x20, 0x1c, 
-    0x89, 0x68, 0x00, 0xf0, 0x3d, 0xfb, 0x20, 0x1c, 0x00, 0x21, 0x00, 0xf0, 
-    0x55, 0xfb, 0x04, 0xe0, 0x0c, 0x31, 0xef, 0xe7, 0x01, 0x48, 0xff, 0xf7, 
-    0x46, 0xff, 0x10, 0xbd, 0x00, 0xdc, 0x03, 0x00, 0x08, 0xb5, 0x88, 0x42, 
-    0x0a, 0xd0, 0x43, 0x1c, 0x07, 0xd0, 0x01, 0x31, 0x06, 0xd0, 0x04, 0x48, 
-    0xff, 0xf7, 0x39, 0xff, 0x01, 0x20, 0x40, 0x42, 0x00, 0xe0, 0x08, 0x1c, 
-    0x08, 0xbd, 0xc0, 0x46, 0x11, 0xdc, 0x03, 0x00, 0x0b, 0x68, 0x5a, 0x1c, 
-    0x05, 0xd0, 0x83, 0x42, 0x01, 0xd1, 0x48, 0x68, 0x02, 0xe0, 0x0c, 0x31, 
-    0xf6, 0xe7, 0x18, 0x1c, 0x70, 0x47, 0x00, 0x00, 0x10, 0xb5, 0x04, 0x1c, 
-    0x43, 0x1c, 0x07, 0xd0, 0xff, 0xf7, 0xee, 0xff, 0x04, 0x1c, 0x43, 0x1c, 
-    0x02, 0xd1, 0x02, 0x48, 0xff, 0xf7, 0x19, 0xff, 0x20, 0x1c, 0x10, 0xbd, 
-    0x22, 0xdc, 0x03, 0x00, 0x70, 0x47, 0xc0, 0x46, 0x70, 0x47, 0xc0, 0x46, 
-    0x08, 0xb5, 0xff, 0xf7, 0xfb, 0xff, 0xff, 0xf7, 0xf7, 0xff, 0x02, 0xf0, 
-    0xa9, 0xf8, 0x08, 0xbd, 0x08, 0xb5, 0x00, 0x28, 0x00, 0xd1, 0xfe, 0xe7, 
-    0xff, 0xf7, 0xfa, 0xfe, 0xfb, 0xe7, 0xc0, 0x46, 0x01, 0x4b, 0x08, 0x33, 
-    0x03, 0x60, 0x70, 0x47, 0x60, 0xdc, 0x03, 0x00, 0x10, 0xb5, 0x04, 0x4b, 
-    0x04, 0x1c, 0x08, 0x33, 0x03, 0x60, 0x00, 0xf0, 0x5b, 0xf9, 0x20, 0x1c, 
-    0x10, 0xbd, 0xc0, 0x46, 0x60, 0xdc, 0x03, 0x00, 0x30, 0xb5, 0x04, 0x1c, 
-    0x0f, 0x48, 0x83, 0xb0, 0x08, 0x30, 0x20, 0x60, 0x00, 0x20, 0x60, 0x60, 
-    0x20, 0x72, 0x20, 0x61, 0x0c, 0x48, 0x08, 0x25, 0x60, 0x61, 0x06, 0x98, 
-    0xe5, 0x60, 0x25, 0x1d, 0x00, 0x90, 0x28, 0x1c, 0x00, 0xf0, 0x22, 0xfc, 
-    0x28, 0x1c, 0xe1, 0x68, 0x22, 0x69, 0x00, 0x23, 0x00, 0xf0, 0x9c, 0xfc, 
-    0x28, 0x1c, 0x61, 0x69, 0x00, 0xf0, 0xce, 0xfc, 0x20, 0x1c, 0x03, 0xb0, 
-    0x30, 0xbd, 0xc0, 0x46, 0x60, 0xdc, 0x03, 0x00, 0x40, 0x42, 0x0f, 0x00, 
-    0x70, 0xb5, 0x09, 0x4d, 0x04, 0x1c, 0x2b, 0x68, 0x83, 0x42, 0x0b, 0xd0, 
-    0x06, 0x1d, 0x30, 0x1c, 0xe1, 0x68, 0x22, 0x69, 0x00, 0x23, 0x00, 0xf0, 
-    0x83, 0xfc, 0x30, 0x1c, 0x61, 0x69, 0x00, 0xf0, 0xb5, 0xfc, 0x2c, 0x60, 
-    0x70, 0xbd, 0xc0, 0x46, 0xa0, 0x01, 0x00, 0x10, 0x08, 0xb5, 0x04, 0x4b, 
-    0x02, 0x61, 0xc1, 0x60, 0x00, 0x22, 0x1a, 0x60, 0xff, 0xf7, 0xe2, 0xff, 
-    0x08, 0xbd, 0xc0, 0x46, 0xa0, 0x01, 0x00, 0x10, 0x08, 0xb5, 0x03, 0x4b, 
-    0x00, 0x22, 0x41, 0x61, 0x1a, 0x60, 0xff, 0xf7, 0xd7, 0xff, 0x08, 0xbd, 
-    0xa0, 0x01, 0x00, 0x10, 0x38, 0xb5, 0x0d, 0x1c, 0x04, 0x1c, 0xff, 0xf7, 
-    0xcf, 0xff, 0x29, 0x1c, 0x20, 0x1d, 0x00, 0xf0, 0xd7, 0xfc, 0x38, 0xbd, 
-    0x38, 0xb5, 0x03, 0x68, 0x04, 0x1c, 0xdb, 0x68, 0x98, 0x47, 0x63, 0x68, 
-    0x5a, 0x68, 0x23, 0x68, 0x00, 0x2a, 0x02, 0xd1, 0x9b, 0x68, 0x98, 0x47, 
-    0x14, 0xe0, 0x5b, 0x68, 0x15, 0x68, 0x98, 0x47, 0x63, 0x68, 0x2d, 0x1a, 
-    0x00, 0x2d, 0x08, 0xdc, 0x5a, 0x68, 0x91, 0x68, 0x59, 0x60, 0x1b, 0x68, 
-    0x00, 0x2b, 0xea, 0xd0, 0x50, 0x68, 0x98, 0x47, 0xe7, 0xe7, 0x5b, 0x68, 
-    0x22, 0x68, 0x18, 0x68, 0x13, 0x69, 0x98, 0x47, 0x38, 0xbd, 0x00, 0x00, 
-    0x08, 0xb5, 0x02, 0x48, 0xff, 0xf7, 0xd8, 0xff, 0x08, 0xbd, 0xc0, 0x46, 
-    0x8c, 0xdc, 0x03, 0x00, 0x38, 0xb5, 0x04, 0x1c, 0x00, 0xf0, 0xe2, 0xfc, 
-    0x05, 0x1c, 0x00, 0xf0, 0xdf, 0xfc, 0x40, 0x1b, 0xa0, 0x42, 0xfa, 0xd3, 
-    0x38, 0xbd, 0x08, 0xb5, 0xfa, 0x23, 0x9b, 0x00, 0x58, 0x43, 0xff, 0xf7, 
-    0xef, 0xff, 0x08, 0xbd, 0x0c, 0x4b, 0xf0, 0xb5, 0x9d, 0x68, 0x9f, 0x68, 
-    0x80, 0x24, 0x2a, 0x1c, 0x1e, 0x1c, 0x64, 0x05, 0xa7, 0x42, 0x0b, 0xd0, 
-    0x00, 0x23, 0x80, 0x27, 0x7f, 0x05, 0xda, 0x19, 0x5f, 0x59, 0x04, 0x33, 
-    0x17, 0x60, 0xc0, 0x2b, 0xf7, 0xd1, 0x80, 0x22, 0xb4, 0x60, 0x52, 0x05, 
-    0x10, 0x30, 0x80, 0x00, 0x81, 0x50, 0xf0, 0xbd, 0x00, 0xed, 0x00, 0xe0, 
-    0x7f, 0xb5, 0x3e, 0x4a, 0x80, 0x21, 0xd0, 0x6f, 0x49, 0x02, 0x3d, 0x4b, 
-    0x01, 0x43, 0xd1, 0x67, 0x23, 0x22, 0x3c, 0x49, 0x9a, 0x60, 0x01, 0x22, 
-    0x0a, 0x60, 0x3b, 0x49, 0x3b, 0x4d, 0x0a, 0x60, 0x00, 0x22, 0x8e, 0x21, 
-    0x1a, 0x62, 0x89, 0x00, 0x58, 0x58, 0x20, 0x24, 0x28, 0x40, 0x01, 0x90, 
-    0x01, 0x98, 0xa0, 0x43, 0x01, 0x90, 0x01, 0x9c, 0xc8, 0x20, 0x00, 0x02, 
-    0x20, 0x43, 0x58, 0x50, 0x00, 0x92, 0x00, 0x99, 0x32, 0x4a, 0x91, 0x42, 
-    0x03, 0xd8, 0xc0, 0x46, 0x00, 0x9a, 0x01, 0x32, 0xf6, 0xe7, 0x01, 0x22, 
-    0x00, 0x21, 0x1a, 0x64, 0x5a, 0x64, 0x59, 0x64, 0x5a, 0x64, 0x59, 0x6c, 
-    0x27, 0x4a, 0xc8, 0x07, 0xfb, 0xd5, 0x8e, 0x21, 0x89, 0x00, 0x50, 0x58, 
-    0x80, 0x24, 0x28, 0x40, 0x02, 0x90, 0x02, 0x98, 0x20, 0x43, 0x02, 0x90, 
-    0x02, 0x9e, 0xc8, 0x20, 0x00, 0x02, 0x06, 0x43, 0x56, 0x50, 0x23, 0x26, 
-    0x96, 0x60, 0x56, 0x58, 0x35, 0x40, 0x03, 0x95, 0x03, 0x9d, 0xa5, 0x43, 
-    0x03, 0x95, 0x03, 0x9c, 0x20, 0x43, 0x50, 0x50, 0xd8, 0x68, 0x01, 0x21, 
-    0x18, 0x4a, 0x08, 0x42, 0xfa, 0xd0, 0x03, 0x20, 0x10, 0x67, 0x00, 0x20, 
-    0x51, 0x67, 0x50, 0x67, 0x51, 0x67, 0x58, 0x6f, 0x01, 0x21, 0x13, 0x4a, 
-    0x08, 0x42, 0xfa, 0xd0, 0x8e, 0x20, 0x91, 0x67, 0x80, 0x00, 0x15, 0x58, 
-    0x14, 0x4c, 0x2c, 0x40, 0x14, 0x50, 0x15, 0x58, 0x13, 0x4c, 0x2c, 0x40, 
-    0x14, 0x50, 0x00, 0x20, 0x91, 0x64, 0xd1, 0x64, 0xd0, 0x64, 0xd1, 0x64, 
-    0xda, 0x6c, 0xd1, 0x07, 0xfc, 0xd5, 0x08, 0x4a, 0x23, 0x21, 0x11, 0x61, 
-    0x59, 0x69, 0x01, 0x22, 0x11, 0x42, 0xfb, 0xd0, 0x0b, 0x4b, 0x00, 0x21, 
-    0x19, 0x60, 0x19, 0x60, 0x0a, 0x4b, 0x1a, 0x60, 0x7f, 0xbd, 0xc0, 0x46, 
-    0x04, 0x80, 0x04, 0x40, 0x00, 0x80, 0x04, 0x40, 0xf0, 0x40, 0x04, 0x40, 
-    0xf4, 0x40, 0x04, 0x40, 0xff, 0x25, 0x00, 0x00, 0xc3, 0x09, 0x00, 0x00, 
-    0xff, 0xfb, 0xff, 0xff, 0xff, 0xfe, 0xff, 0xff, 0xc0, 0x80, 0x04, 0x40, 
-    0xc8, 0x80, 0x04, 0x40, 0x70, 0x47, 0xc0, 0x46, 0x70, 0x47, 0xc0, 0x46, 
-    0x70, 0x47, 0xc0, 0x46, 0x70, 0x47, 0xc0, 0x46, 0x70, 0x47, 0xc0, 0x46, 
-    0x70, 0x47, 0xc0, 0x46, 0x00, 0x20, 0x70, 0x47, 0x08, 0xb5, 0x02, 0xf0, 
-    0x19, 0xf9, 0x08, 0xbd, 0x10, 0xb5, 0x04, 0x1c, 0x42, 0x1c, 0x04, 0xd1, 
-    0x16, 0x48, 0x17, 0x49, 0x1e, 0x22, 0xff, 0xf7, 0x77, 0xfd, 0x16, 0x4b, 
-    0x1a, 0x68, 0x00, 0x2a, 0x06, 0xd1, 0x01, 0x22, 0x1a, 0x60, 0x14, 0x4b, 
-    0x14, 0x49, 0xda, 0x6f, 0x0a, 0x43, 0xda, 0x67, 0x01, 0x21, 0x00, 0x2c, 
-    0x12, 0xd0, 0x12, 0x4b, 0x9c, 0x42, 0x0f, 0xd0, 0x11, 0x4b, 0x9c, 0x42, 
-    0x0c, 0xd0, 0x11, 0x4b, 0x9c, 0x42, 0x09, 0xd0, 0x10, 0x4b, 0x9c, 0x42, 
-    0x06, 0xd0, 0x10, 0x4b, 0x9c, 0x42, 0x03, 0xd0, 0x0f, 0x4b, 0xe1, 0x18, 
-    0x4b, 0x42, 0x59, 0x41, 0x20, 0x1c, 0xa4, 0x04, 0x00, 0xf0, 0x54, 0xf9, 
-    0xe4, 0x0e, 0x01, 0x20, 0xa0, 0x40, 0x10, 0xbd, 0xd4, 0xdc, 0x03, 0x00, 
-    0x94, 0xdc, 0x03, 0x00, 0xac, 0x01, 0x00, 0x10, 0x04, 0x80, 0x04, 0x40, 
-    0x40, 0x00, 0x01, 0x00, 0x28, 0x14, 0x00, 0x00, 0x2c, 0x16, 0x00, 0x00, 
-    0x30, 0x18, 0x00, 0x00, 0x34, 0x1a, 0x00, 0x00, 0x38, 0x1c, 0x00, 0x00, 
-    0xc4, 0xe1, 0xff, 0xff, 0x38, 0xb5, 0x04, 0x1c, 0x0d, 0x1c, 0x21, 0x60, 
-    0x4a, 0x1c, 0x11, 0xd0, 0x08, 0x1c, 0xff, 0xf7, 0xaf, 0xff, 0x2d, 0x14, 
-    0x07, 0x4a, 0xad, 0x00, 0xab, 0x18, 0x07, 0x4a, 0xe3, 0x60, 0xab, 0x18, 
-    0x06, 0x4a, 0x23, 0x61, 0xab, 0x18, 0x63, 0x61, 0x05, 0x4b, 0x60, 0x60, 
-    0xed, 0x18, 0xa5, 0x60, 0x38, 0xbd, 0xc0, 0x46, 0x00, 0x22, 0x00, 0xa0, 
-    0x80, 0x22, 0x00, 0xa0, 0x00, 0x21, 0x00, 0xa0, 0x00, 0x20, 0x00, 0xa0, 
-    0x08, 0xb5, 0x00, 0x68, 0x00, 0xf0, 0x30, 0xf9, 0x08, 0xbd, 0x00, 0x00, 
-    0x38, 0xb5, 0x03, 0x68, 0x04, 0x1c, 0x0d, 0x1c, 0x01, 0x33, 0x04, 0xd1, 
-    0x09, 0x48, 0x0a, 0x49, 0x43, 0x22, 0xff, 0xf7, 0x05, 0xfd, 0x00, 0x2d, 
-    0x06, 0xd0, 0x01, 0x2d, 0x09, 0xd1, 0xa3, 0x68, 0x62, 0x68, 0x19, 0x68, 
-    0x0a, 0x43, 0x03, 0xe0, 0xa3, 0x68, 0x61, 0x68, 0x1a, 0x68, 0x8a, 0x43, 
-    0x1a, 0x60, 0x38, 0xbd, 0xcf, 0xdc, 0x03, 0x00, 0x94, 0xdc, 0x03, 0x00, 
-    0xf8, 0xb5, 0x14, 0x4d, 0x01, 0x21, 0x0c, 0x1c, 0x6b, 0x6a, 0x84, 0x40, 
-    0x23, 0x42, 0x20, 0xd0, 0x11, 0x4b, 0x87, 0x00, 0xf8, 0x58, 0x00, 0x28, 
-    0x1b, 0xd0, 0x2b, 0x68, 0x23, 0x42, 0x18, 0xd1, 0x6b, 0x68, 0x23, 0x42, 
-    0x06, 0xd0, 0xeb, 0x69, 0x23, 0x42, 0x03, 0xd0, 0x0b, 0x4b, 0x1b, 0x68, 
-    0x98, 0x47, 0xec, 0x61, 0x2b, 0x69, 0x07, 0x4e, 0x23, 0x42, 0x09, 0xd0, 
-    0x33, 0x6a, 0x23, 0x42, 0x06, 0xd0, 0x05, 0x4b, 0x02, 0x21, 0xd8, 0x59, 
-    0x04, 0x4b, 0x1b, 0x68, 0x98, 0x47, 0x34, 0x62, 0x6c, 0x62, 0xf8, 0xbd, 
-    0x00, 0x40, 0x00, 0xa0, 0xb4, 0x01, 0x00, 0x10, 0xb0, 0x01, 0x00, 0x10, 
-    0x08, 0xb5, 0x00, 0x20, 0xff, 0xf7, 0xcc, 0xff, 0x08, 0xbd, 0x08, 0xb5, 
-    0x01, 0x20, 0xff, 0xf7, 0xc7, 0xff, 0x08, 0xbd, 0x08, 0xb5, 0x02, 0x20, 
-    0xff, 0xf7, 0xc2, 0xff, 0x08, 0xbd, 0x08, 0xb5, 0x03, 0x20, 0xff, 0xf7, 
-    0xbd, 0xff, 0x08, 0xbd, 0x08, 0xb5, 0x04, 0x20, 0xff, 0xf7, 0xb8, 0xff, 
-    0x08, 0xbd, 0x08, 0xb5, 0x05, 0x20, 0xff, 0xf7, 0xb3, 0xff, 0x08, 0xbd, 
-    0x08, 0xb5, 0x06, 0x20, 0xff, 0xf7, 0xae, 0xff, 0x08, 0xbd, 0x08, 0xb5, 
-    0x07, 0x20, 0xff, 0xf7, 0xa9, 0xff, 0x08, 0xbd, 0xf0, 0xb5, 0x06, 0x1c, 
-    0x27, 0x48, 0x85, 0xb0, 0x81, 0x42, 0x02, 0xdd, 0x01, 0x20, 0x40, 0x42, 
-    0x46, 0xe0, 0x25, 0x48, 0x02, 0x60, 0x00, 0x22, 0x24, 0x48, 0x95, 0x00, 
-    0x2c, 0x58, 0x02, 0x94, 0x00, 0x2c, 0x39, 0xd1, 0x2b, 0x50, 0x22, 0x48, 
-    0x32, 0x60, 0xc4, 0x6f, 0x21, 0x4f, 0x22, 0x4b, 0x3c, 0x43, 0xc4, 0x67, 
-    0x88, 0x03, 0x80, 0x0f, 0x18, 0x24, 0x44, 0x43, 0x49, 0x12, 0x1f, 0x27, 
-    0x0f, 0x40, 0x11, 0x1c, 0xbc, 0x46, 0x5e, 0x31, 0x64, 0x44, 0x89, 0x00, 
-    0x00, 0x90, 0xcc, 0x50, 0x81, 0x21, 0x89, 0x00, 0x01, 0x24, 0x58, 0x58, 
-    0x27, 0x1c, 0x97, 0x40, 0x38, 0x43, 0x58, 0x50, 0x00, 0x99, 0xa0, 0x23, 
-    0x88, 0x00, 0x1b, 0x06, 0xc0, 0x18, 0x80, 0x23, 0x9b, 0x01, 0xc7, 0x58, 
-    0x61, 0x46, 0x03, 0x97, 0x27, 0x1c, 0x8f, 0x40, 0x03, 0x99, 0xb9, 0x43, 
-    0xc1, 0x50, 0x0f, 0x4b, 0x50, 0xb2, 0xe9, 0x58, 0xff, 0xf7, 0x16, 0xfe, 
-    0x33, 0x68, 0x1f, 0x22, 0x13, 0x40, 0x9c, 0x40, 0x0b, 0x4b, 0x02, 0x98, 
-    0x1c, 0x60, 0x03, 0xe0, 0x01, 0x32, 0x08, 0x2a, 0xbc, 0xd1, 0xb5, 0xe7, 
-    0x05, 0xb0, 0xf0, 0xbd, 0x13, 0x11, 0x02, 0x00, 0xb0, 0x01, 0x00, 0x10, 
-    0xb4, 0x01, 0x00, 0x10, 0x04, 0x80, 0x04, 0x40, 0x80, 0x00, 0x09, 0x00, 
-    0x00, 0x80, 0x04, 0x40, 0xe8, 0xdc, 0x03, 0x00, 0x00, 0xe1, 0x00, 0xe0, 
-    0x03, 0x68, 0x00, 0x21, 0x9a, 0x00, 0x06, 0x4b, 0x10, 0xb5, 0xd1, 0x50, 
-    0x05, 0x4a, 0x81, 0x23, 0x9b, 0x00, 0x00, 0x68, 0xd1, 0x58, 0x01, 0x24, 
-    0x84, 0x40, 0xa1, 0x43, 0xd1, 0x50, 0x10, 0xbd, 0xb4, 0x01, 0x00, 0x10, 
-    0x00, 0x80, 0x04, 0x40, 0x03, 0x68, 0x70, 0xb5, 0x10, 0x4d, 0x01, 0x20, 
-    0x98, 0x40, 0x2b, 0x68, 0x03, 0x42, 0x00, 0xd1, 0x68, 0x62, 0x2e, 0x68, 
-    0xc4, 0x43, 0x26, 0x40, 0x0b, 0x4b, 0x2e, 0x60, 0x01, 0x29, 0x09, 0xd1, 
-    0x00, 0x2a, 0x03, 0xd0, 0x5a, 0x68, 0x10, 0x43, 0x58, 0x60, 0x0c, 0xe0, 
-    0x5a, 0x68, 0x14, 0x40, 0x5c, 0x60, 0x08, 0xe0, 0x00, 0x2a, 0x03, 0xd0, 
-    0x1a, 0x69, 0x10, 0x43, 0x18, 0x61, 0x02, 0xe0, 0x1a, 0x69, 0x14, 0x40, 
-    0x1c, 0x61, 0x70, 0xbd, 0x00, 0x40, 0x00, 0xa0, 0x38, 0xb5, 0x04, 0x1c, 
-    0x0d, 0x1c, 0x43, 0x1c, 0x04, 0xd1, 0x08, 0x48, 0x08, 0x49, 0x15, 0x22, 
-    0xff, 0xf7, 0xf4, 0xfb, 0x07, 0x4b, 0xe4, 0x05, 0xe4, 0x0d, 0xe4, 0x18, 
-    0x22, 0x68, 0x07, 0x23, 0x9a, 0x43, 0x1d, 0x40, 0x13, 0x1c, 0x2b, 0x43, 
-    0x23, 0x60, 0x38, 0xbd, 0xd4, 0xdc, 0x03, 0x00, 0x08, 0xdd, 0x03, 0x00, 
-    0x00, 0x40, 0x04, 0x40, 0x38, 0xb5, 0x04, 0x1c, 0x0d, 0x1c, 0x43, 0x1c, 
-    0x05, 0xd1, 0x11, 0x48, 0x11, 0x49, 0x1d, 0x22, 0xff, 0xf7, 0xd8, 0xfb, 
-    0x06, 0xe0, 0x81, 0x23, 0x1b, 0x01, 0x98, 0x42, 0x16, 0xd0, 0x0e, 0x4b, 
-    0x98, 0x42, 0x13, 0xd0, 0xe4, 0x05, 0x0d, 0x4b, 0xe4, 0x0d, 0xe4, 0x18, 
-    0x22, 0x68, 0x04, 0x2d, 0x04, 0xd1, 0x80, 0x23, 0xdb, 0x00, 0x13, 0x43, 
-    0x23, 0x60, 0x07, 0xe0, 0x18, 0x23, 0x9a, 0x43, 0x03, 0x23, 0x1d, 0x40, 
-    0xeb, 0x00, 0x15, 0x1c, 0x1d, 0x43, 0x25, 0x60, 0x38, 0xbd, 0xc0, 0x46, 
-    0xd4, 0xdc, 0x03, 0x00, 0x08, 0xdd, 0x03, 0x00, 0x14, 0x0a, 0x00, 0x00, 
-    0x00, 0x40, 0x04, 0x40, 0x38, 0xb5, 0x05, 0x1c, 0x0c, 0x1c, 0x08, 0x1c, 
-    0x00, 0x21, 0x02, 0xf0, 0x47, 0xf8, 0x00, 0x28, 0x09, 0xd1, 0xfe, 0x21, 
-    0x20, 0x1c, 0x89, 0x05, 0x02, 0xf0, 0x54, 0xf8, 0x00, 0x28, 0x03, 0xd0, 
-    0xfe, 0x24, 0xa4, 0x05, 0x00, 0xe0, 0x00, 0x24, 0x2d, 0x68, 0x80, 0x23, 
-    0x9b, 0x00, 0xe8, 0x58, 0x02, 0xf0, 0xe0, 0xfe, 0x21, 0x1c, 0x02, 0xf0, 
-    0xc1, 0xfb, 0x02, 0xf0, 0x57, 0xf8, 0x81, 0x23, 0x9b, 0x00, 0xe8, 0x50, 
-    0x38, 0xbd, 0xf7, 0xb5, 0x80, 0x23, 0x81, 0x22, 0x04, 0x68, 0x95, 0x00, 
-    0x9b, 0x00, 0xe7, 0x58, 0x08, 0x1c, 0x66, 0x59, 0xe1, 0x50, 0x02, 0xf0, 
-    0x6f, 0xfe, 0x01, 0x90, 0x30, 0x1c, 0x02, 0xf0, 0xc7, 0xfe, 0x06, 0x1c, 
-    0x38, 0x1c, 0x02, 0xf0, 0xc3, 0xfe, 0x01, 0x1c, 0x30, 0x1c, 0x02, 0xf0, 
-    0xbf, 0xf9, 0x01, 0x1c, 0x01, 0x98, 0x02, 0xf0, 0x9f, 0xfb, 0x02, 0xf0, 
-    0x35, 0xf8, 0x60, 0x51, 0xf7, 0xbd, 0x00, 0x00, 0xf7, 0xb5, 0x04, 0x1c, 
-    0x0f, 0x1c, 0x08, 0x1c, 0x51, 0x49, 0xff, 0xf7, 0x57, 0xfc, 0xc3, 0xb2, 
-    0x06, 0x1c, 0xff, 0x2b, 0x02, 0xd1, 0x4f, 0x48, 0xff, 0xf7, 0x75, 0xfb, 
-    0x4e, 0x48, 0x01, 0x23, 0x01, 0x78, 0x05, 0x1c, 0x0a, 0x1c, 0x1a, 0x40, 
-    0x00, 0xd1, 0x8e, 0xe0, 0x19, 0x41, 0x19, 0x42, 0x00, 0xd0, 0x84, 0xe0, 
-    0x2a, 0x78, 0x01, 0x21, 0x99, 0x40, 0x0a, 0x43, 0x2a, 0x70, 0x47, 0x4a, 
-    0x99, 0x00, 0x89, 0x58, 0x63, 0x60, 0x21, 0x60, 0x45, 0x49, 0x80, 0x25, 
-    0xc8, 0x6f, 0x45, 0x4a, 0x01, 0x90, 0x28, 0x06, 0x01, 0x9d, 0x09, 0x33, 
-    0x05, 0x43, 0xcd, 0x67, 0x01, 0x20, 0x51, 0x68, 0x98, 0x40, 0x03, 0x1c, 
-    0x0b, 0x43, 0x53, 0x60, 0x38, 0x1c, 0x39, 0x49, 0xff, 0xf7, 0xee, 0xfb, 
-    0x27, 0x68, 0x3d, 0x4a, 0x3b, 0x68, 0x3d, 0x49, 0x13, 0x43, 0x3b, 0x60, 
-    0x7b, 0x68, 0x0c, 0x22, 0x13, 0x43, 0x7b, 0x60, 0x7a, 0x68, 0x3a, 0x4b, 
-    0x13, 0x40, 0x7b, 0x60, 0x39, 0x4b, 0x7d, 0x68, 0x18, 0x68, 0x01, 0xf0, 
-    0x1f, 0xff, 0x7f, 0x23, 0x01, 0x38, 0x18, 0x40, 0x40, 0x01, 0x28, 0x43, 
-    0x78, 0x60, 0xf0, 0xb2, 0x01, 0x25, 0x07, 0x28, 0x1d, 0xd8, 0x01, 0xf0, 
-    0x09, 0xff, 0x04, 0x0a, 0x10, 0x16, 0x04, 0x0a, 0x10, 0x16, 0xa0, 0x23, 
-    0xdb, 0x00, 0xfd, 0x50, 0x02, 0x22, 0x2e, 0x4b, 0x10, 0xe0, 0xa1, 0x23, 
-    0xdb, 0x00, 0xfd, 0x50, 0x02, 0x22, 0x2c, 0x4b, 0x0a, 0xe0, 0xa2, 0x23, 
-    0xdb, 0x00, 0xfd, 0x50, 0x02, 0x22, 0x2a, 0x4b, 0x04, 0xe0, 0xa3, 0x23, 
-    0xdb, 0x00, 0xfd, 0x50, 0x28, 0x4b, 0x02, 0x22, 0xfa, 0x50, 0x80, 0x22, 
-    0xc1, 0x23, 0x52, 0x01, 0x9b, 0x00, 0xfa, 0x50, 0x01, 0x23, 0xc0, 0x22, 
-    0x5b, 0x42, 0x92, 0x00, 0xbb, 0x50, 0x23, 0x49, 0xc3, 0x22, 0x92, 0x00, 
-    0xb9, 0x50, 0x80, 0x25, 0x21, 0x49, 0xc2, 0x22, 0xad, 0x00, 0x92, 0x00, 
-    0xbb, 0x50, 0x79, 0x51, 0x7b, 0x59, 0x81, 0x26, 0xb6, 0x00, 0x9b, 0x08, 
-    0xbb, 0x51, 0x7b, 0x68, 0x04, 0x22, 0x93, 0x43, 0x7b, 0x60, 0x20, 0x1c, 
-    0xff, 0xf7, 0x4b, 0xff, 0x24, 0x68, 0x60, 0x59, 0x02, 0xf0, 0x1e, 0xfe, 
-    0x00, 0x21, 0x02, 0xf0, 0xff, 0xfa, 0x01, 0xf0, 0x95, 0xff, 0xa0, 0x51, 
-    0xf7, 0xbd, 0x14, 0x48, 0xff, 0xf7, 0xe1, 0xfa, 0x01, 0x23, 0x5b, 0x42, 
-    0x74, 0xe7, 0x13, 0x1c, 0x72, 0xe7, 0xc0, 0x46, 0x44, 0xdd, 0x03, 0x00, 
-    0xb0, 0xdd, 0x03, 0x00, 0xd4, 0x01, 0x00, 0x10, 0xdc, 0xdd, 0x03, 0x00, 
-    0x04, 0x80, 0x04, 0x40, 0x00, 0x80, 0x04, 0x40, 0x01, 0x00, 0x06, 0x00, 
-    0x40, 0x42, 0x0f, 0x00, 0x1f, 0xf0, 0xff, 0xff, 0x04, 0x01, 0x00, 0x10, 
-    0x04, 0x05, 0x00, 0x00, 0x0c, 0x05, 0x00, 0x00, 0x14, 0x05, 0x00, 0x00, 
-    0x1c, 0x05, 0x00, 0x00, 0x01, 0x10, 0x00, 0x00, 0x20, 0x4e, 0x00, 0x00, 
-    0xca, 0xdd, 0x03, 0x00, 0xf0, 0xb5, 0x87, 0xb0, 0x04, 0x1c, 0x00, 0x91, 
-    0x08, 0x1c, 0x31, 0x49, 0x01, 0x92, 0x02, 0x93, 0xff, 0xf7, 0x8a, 0xfb, 
-    0x2f, 0x49, 0x07, 0x1c, 0x01, 0x98, 0xff, 0xf7, 0x85, 0xfb, 0x2e, 0x4d, 
-    0x03, 0x90, 0x29, 0x1c, 0x02, 0x98, 0xff, 0xf7, 0x7f, 0xfb, 0x2c, 0x4e, 
-    0x04, 0x90, 0x31, 0x1c, 0x0c, 0x98, 0xff, 0xf7, 0x79, 0xfb, 0x03, 0x99, 
-    0x05, 0x90, 0x38, 0x1c, 0xff, 0xf7, 0x56, 0xfb, 0x05, 0x99, 0x07, 0x1c, 
-    0x04, 0x98, 0xff, 0xf7, 0x51, 0xfb, 0x01, 0x1c, 0x38, 0x1c, 0xff, 0xf7, 
-    0x4d, 0xfb, 0x20, 0x4f, 0x20, 0x60, 0x01, 0x30, 0x04, 0xd1, 0x21, 0x48, 
-    0x21, 0x49, 0x48, 0x22, 0xff, 0xf7, 0x72, 0xfa, 0x23, 0x68, 0x20, 0x4a, 
-    0x93, 0x42, 0x0f, 0xd0, 0x1f, 0x4a, 0x93, 0x42, 0x19, 0xd1, 0x1f, 0x4a, 
-    0x80, 0x21, 0xd0, 0x6f, 0xc9, 0x02, 0x01, 0x43, 0xd1, 0x67, 0x1d, 0x4a, 
-    0x01, 0x21, 0x1d, 0x4b, 0x11, 0x60, 0x5a, 0x68, 0x04, 0x21, 0x0a, 0xe0, 
-    0x18, 0x4a, 0x80, 0x21, 0xd0, 0x6f, 0x09, 0x01, 0x01, 0x43, 0xd1, 0x67, 
-    0x18, 0x49, 0x17, 0x4b, 0x01, 0x22, 0x0a, 0x60, 0x59, 0x68, 0x0a, 0x43, 
-    0x5a, 0x60, 0x00, 0x98, 0x09, 0x49, 0xff, 0xf7, 0x05, 0xfb, 0x01, 0x98, 
-    0x39, 0x1c, 0xff, 0xf7, 0x01, 0xfb, 0x02, 0x98, 0x29, 0x1c, 0xff, 0xf7, 
-    0xfd, 0xfa, 0x0c, 0x9b, 0x01, 0x33, 0x03, 0xd0, 0x0c, 0x98, 0x31, 0x1c, 
-    0xff, 0xf7, 0xf6, 0xfa, 0x07, 0xb0, 0xf0, 0xbd, 0x1c, 0xdf, 0x03, 0x00, 
-    0xe4, 0xdd, 0x03, 0x00, 0x20, 0xde, 0x03, 0x00, 0x58, 0xdf, 0x03, 0x00, 
-    0x68, 0xde, 0x03, 0x00, 0x7c, 0xde, 0x03, 0x00, 0x00, 0x00, 0x04, 0x40, 
-    0x00, 0x80, 0x05, 0x40, 0x04, 0x80, 0x04, 0x40, 0x9c, 0x80, 0x04, 0x40, 
-    0x00, 0x80, 0x04, 0x40, 0x94, 0x80, 0x04, 0x40, 0xf8, 0xb5, 0x1f, 0x1c, 
-    0x03, 0x68, 0x15, 0x1c, 0x5a, 0x68, 0x0e, 0x1c, 0x02, 0x21, 0x8a, 0x43, 
-    0x5a, 0x60, 0x33, 0x1f, 0x04, 0x1c, 0x0c, 0x2b, 0x06, 0xd9, 0x03, 0x2d, 
-    0x04, 0xd9, 0x11, 0x48, 0x11, 0x49, 0x65, 0x22, 0xff, 0xf7, 0x10, 0xfa, 
-    0x23, 0x68, 0x01, 0x22, 0x28, 0x1c, 0x19, 0x68, 0xd5, 0x40, 0x10, 0x40, 
-    0xc0, 0x01, 0x2a, 0x40, 0x01, 0x3e, 0x06, 0x43, 0x92, 0x01, 0x09, 0x0c, 
-    0x09, 0x04, 0x16, 0x43, 0x0e, 0x43, 0x1e, 0x60, 0x5a, 0x68, 0x0d, 0x21, 
-    0x8a, 0x43, 0x79, 0x1e, 0x8f, 0x41, 0xbf, 0x00, 0x17, 0x43, 0x5f, 0x60, 
-    0x23, 0x68, 0x02, 0x21, 0x5a, 0x68, 0x0a, 0x43, 0x5a, 0x60, 0xf8, 0xbd, 
-    0xb6, 0xde, 0x03, 0x00, 0x7c, 0xde, 0x03, 0x00, 0xf7, 0xb5, 0x03, 0x68, 
-    0x02, 0x24, 0x5a, 0x68, 0x05, 0x1c, 0xa2, 0x43, 0x5a, 0x60, 0x1c, 0x4b, 
-    0x0e, 0x1c, 0x1b, 0x68, 0x01, 0x93, 0x21, 0x1c, 0x01, 0x98, 0x01, 0xf0, 
-    0xdb, 0xfd, 0x02, 0xf0, 0xc9, 0xfc, 0x07, 0x1c, 0x30, 0x1c, 0x02, 0xf0, 
-    0xc5, 0xfc, 0x01, 0x1c, 0x38, 0x1c, 0x02, 0xf0, 0x1d, 0xf8, 0xfc, 0x21, 
-    0x89, 0x05, 0x01, 0xf0, 0xad, 0xfe, 0x03, 0xf0, 0x03, 0xfa, 0x01, 0xf0, 
-    0x71, 0xfc, 0x03, 0xf0, 0xcb, 0xf9, 0xff, 0x28, 0x10, 0xdc, 0x2b, 0x68, 
-    0x0d, 0x4a, 0x1c, 0x61, 0x19, 0x68, 0x01, 0x38, 0x0a, 0x40, 0x1a, 0x60, 
-    0x1a, 0x68, 0x00, 0x02, 0x10, 0x43, 0x18, 0x60, 0x2b, 0x68, 0x02, 0x21, 
-    0x5a, 0x68, 0x0a, 0x43, 0x5a, 0x60, 0x07, 0xe0, 0x80, 0x23, 0x02, 0x34, 
-    0x5b, 0x00, 0x9c, 0x42, 0xcf, 0xd1, 0x04, 0x48, 0xff, 0xf7, 0xc5, 0xf9, 
-    0xf7, 0xbd, 0xc0, 0x46, 0x04, 0x01, 0x00, 0x10, 0xff, 0x00, 0x00, 0xff, 
-    0xf4, 0xde, 0x03, 0x00, 0x10, 0xb5, 0x03, 0x68, 0xda, 0x68, 0x94, 0x07, 
-    0xfc, 0xd5, 0x99, 0x60, 0x03, 0x68, 0xda, 0x68, 0x51, 0x07, 0xfc, 0xd5, 
-    0x98, 0x68, 0x10, 0xbd, 0x38, 0xb5, 0x10, 0x4b, 0x1a, 0x68, 0x00, 0x2a, 
-    0x1a, 0xd1, 0x01, 0x25, 0x1d, 0x60, 0x0e, 0x4b, 0x80, 0x22, 0xd9, 0x6f, 
-    0xd2, 0x00, 0x0a, 0x43, 0xda, 0x67, 0x0c, 0x4b, 0x0c, 0x4c, 0x18, 0x68, 
-    0x02, 0x23, 0x63, 0x60, 0x0b, 0x49, 0x01, 0xf0, 0x83, 0xfd, 0x01, 0x38, 
-    0xe0, 0x60, 0x0a, 0x49, 0x65, 0x60, 0x13, 0x20, 0xff, 0xf7, 0x40, 0xfb, 
-    0x80, 0x22, 0x08, 0x4b, 0x12, 0x03, 0x1a, 0x60, 0x38, 0xbd, 0xc0, 0x46, 
-    0xd8, 0x01, 0x00, 0x10, 0x04, 0x80, 0x04, 0x40, 0x04, 0x01, 0x00, 0x10, 
-    0x00, 0x80, 0x01, 0x40, 0x40, 0x42, 0x0f, 0x00, 0xbd, 0x9d, 0x03, 0x00, 
-    0x00, 0xe1, 0x00, 0xe0, 0x08, 0xb5, 0x04, 0x4b, 0x1b, 0x68, 0x00, 0x2b, 
-    0x01, 0xd1, 0xff, 0xf7, 0xc9, 0xff, 0x02, 0x4b, 0x98, 0x68, 0x08, 0xbd, 
-    0xd8, 0x01, 0x00, 0x10, 0x00, 0x80, 0x01, 0x40, 0x03, 0x4b, 0x01, 0x21, 
-    0x98, 0x61, 0x5a, 0x69, 0x0a, 0x43, 0x5a, 0x61, 0x70, 0x47, 0xc0, 0x46, 
-    0x00, 0x80, 0x01, 0x40, 0x02, 0x4b, 0x01, 0x21, 0x5a, 0x69, 0x8a, 0x43, 
-    0x5a, 0x61, 0x70, 0x47, 0x00, 0x80, 0x01, 0x40, 0x01, 0x4b, 0x01, 0x22, 
-    0x1a, 0x60, 0x70, 0x47, 0x00, 0x80, 0x01, 0x40, 0x70, 0xb5, 0x1d, 0x4d, 
-    0x00, 0x23, 0x2b, 0x70, 0x1c, 0x4b, 0x1b, 0x78, 0x00, 0x2b, 0x01, 0xd1, 
-    0x03, 0xf0, 0xdd, 0xff, 0x1a, 0x4e, 0x1b, 0x49, 0x30, 0x1c, 0xff, 0xf7, 
-    0x7d, 0xf8, 0x1a, 0x4c, 0x28, 0x70, 0x21, 0x1c, 0x30, 0x1c, 0xff, 0xf7, 
-    0xa5, 0xf8, 0x28, 0x70, 0x00, 0x28, 0x0c, 0xd0, 0x00, 0x20, 0x20, 0xe0, 
-    0x22, 0x7a, 0x02, 0x23, 0x13, 0x40, 0x0a, 0xd0, 0x30, 0x1c, 0x21, 0x1c, 
-    0xff, 0xf7, 0x98, 0xf8, 0x28, 0x70, 0x00, 0x28, 0x11, 0xd0, 0x2b, 0x78, 
-    0x00, 0x2b, 0xf1, 0xd0, 0xee, 0xe7, 0x20, 0x1c, 0x09, 0x30, 0xd1, 0x06, 
-    0x0d, 0xd5, 0x2e, 0x22, 0x62, 0x74, 0x44, 0x22, 0xa2, 0x74, 0x49, 0x22, 
-    0xe2, 0x74, 0x52, 0x22, 0x22, 0x75, 0x63, 0x75, 0x03, 0xe0, 0x33, 0x88, 
-    0x00, 0x2b, 0xea, 0xd1, 0xdc, 0xe7, 0x70, 0xbd, 0x4b, 0x02, 0x00, 0x10, 
-    0x60, 0x02, 0x00, 0x10, 0x4c, 0x02, 0x00, 0x10, 0x18, 0xe3, 0x03, 0x00, 
-    0x0c, 0x02, 0x00, 0x10, 0x1d, 0x4b, 0x70, 0xb5, 0x1b, 0x78, 0x00, 0x2b, 
-    0x01, 0xd1, 0x03, 0xf0, 0x9a, 0xff, 0x1b, 0x4e, 0x1b, 0x4c, 0x30, 0x1c, 
-    0x21, 0x1c, 0xff, 0xf7, 0x67, 0xf8, 0x1a, 0x4d, 0x28, 0x70, 0x00, 0x28, 
-    0x28, 0xd1, 0x23, 0x7a, 0x9a, 0x07, 0x06, 0xd4, 0xda, 0x06, 0x20, 0xd5, 
-    0x23, 0x1c, 0x22, 0x1c, 0x14, 0x33, 0x08, 0x32, 0x08, 0xe0, 0x2a, 0x78, 
-    0x00, 0x2a, 0xf5, 0xd1, 0x30, 0x1c, 0x21, 0x1c, 0xff, 0xf7, 0x52, 0xf8, 
-    0x28, 0x70, 0xec, 0xe7, 0x19, 0x78, 0x01, 0x3b, 0x99, 0x70, 0x93, 0x42, 
-    0xfa, 0xd1, 0x63, 0x7a, 0x00, 0x2b, 0x0a, 0xd0, 0x2f, 0x23, 0x63, 0x72, 
-    0x00, 0x23, 0xe2, 0x18, 0x51, 0x7a, 0x00, 0x29, 0x01, 0xd0, 0x01, 0x33, 
-    0xf9, 0xe7, 0x2f, 0x23, 0x53, 0x72, 0x20, 0x1c, 0x09, 0x30, 0x00, 0xe0, 
-    0x00, 0x20, 0x70, 0xbd, 0x60, 0x02, 0x00, 0x10, 0x4c, 0x02, 0x00, 0x10, 
-    0x0c, 0x02, 0x00, 0x10, 0x4b, 0x02, 0x00, 0x10, 0x70, 0xb5, 0x0f, 0x4c, 
-    0x06, 0x1c, 0x23, 0x78, 0x0d, 0x1c, 0x10, 0x2b, 0x0b, 0xd0, 0x30, 0x1c, 
-    0x25, 0x70, 0xfe, 0xf7, 0xff, 0xfe, 0x05, 0x1e, 0x0c, 0xd1, 0x0a, 0x48, 
-    0x31, 0x1c, 0x01, 0xf0, 0x95, 0xfc, 0x2b, 0x1c, 0x09, 0xe0, 0x08, 0x48, 
-    0x03, 0xf0, 0x84, 0xfe, 0x01, 0x23, 0x00, 0x28, 0xed, 0xd0, 0x02, 0xe0, 
-    0x08, 0x23, 0x23, 0x70, 0x01, 0x23, 0x18, 0x1c, 0x70, 0xbd, 0xc0, 0x46, 
-    0x08, 0x01, 0x00, 0x10, 0x3c, 0x02, 0x00, 0x10, 0xdc, 0x01, 0x00, 0x10, 
-    0x13, 0xb5, 0x6c, 0x46, 0x06, 0x34, 0x22, 0x1c, 0xfe, 0xf7, 0x18, 0xff, 
-    0x20, 0x88, 0x16, 0xbd, 0x08, 0xb5, 0x00, 0x20, 0xfe, 0xf7, 0x78, 0xff, 
-    0x01, 0x4b, 0x18, 0x70, 0x08, 0xbd, 0xc0, 0x46, 0x4b, 0x02, 0x00, 0x10, 
-    0x08, 0xb5, 0x03, 0x4b, 0x18, 0x6a, 0xfe, 0xf7, 0x6d, 0xff, 0x02, 0x4b, 
-    0x18, 0x70, 0x08, 0xbd, 0xdc, 0x01, 0x00, 0x10, 0x4b, 0x02, 0x00, 0x10, 
-    0x01, 0x4b, 0xd8, 0x69, 0x70, 0x47, 0xc0, 0x46, 0xdc, 0x01, 0x00, 0x10, 
-    0x13, 0xb5, 0x01, 0x23, 0x07, 0x4c, 0x5b, 0x42, 0x81, 0x22, 0x00, 0x93, 
-    0x20, 0x1c, 0x06, 0x4b, 0x06, 0x49, 0x52, 0x01, 0xff, 0xf7, 0x8c, 0xf9, 
-    0x20, 0x1c, 0x05, 0x49, 0x05, 0x4a, 0xff, 0xf7, 0xdb, 0xfa, 0x13, 0xbd, 
-    0x24, 0x02, 0x00, 0x10, 0x18, 0x0c, 0x00, 0x00, 0x24, 0x12, 0x00, 0x00, 
-    0x99, 0x9c, 0x03, 0x00, 0x00, 0x01, 0x00, 0x10, 0xf7, 0xb5, 0x07, 0x1c, 
-    0x01, 0x91, 0x72, 0xb6, 0x34, 0x4b, 0x98, 0x42, 0x02, 0xd8, 0x05, 0x0b, 
-    0x2b, 0x03, 0x14, 0xe0, 0x32, 0x4b, 0x1c, 0x25, 0x98, 0x42, 0x0d, 0xd8, 
-    0x31, 0x4b, 0x1b, 0x25, 0x98, 0x42, 0x09, 0xd8, 0x30, 0x4b, 0x1a, 0x25, 
-    0x98, 0x42, 0x05, 0xd8, 0x2f, 0x4b, 0x00, 0x25, 0x83, 0x42, 0x6d, 0x41, 
-    0x19, 0x23, 0x5d, 0x1b, 0x2d, 0x4a, 0xab, 0x18, 0x9b, 0x03, 0xfb, 0x1a, 
-    0x2c, 0x4c, 0x2d, 0x4e, 0x5a, 0x42, 0x53, 0x41, 0xdb, 0xb2, 0x32, 0x22, 
-    0x00, 0x93, 0x22, 0x60, 0x2a, 0x4b, 0x65, 0x60, 0xa5, 0x60, 0x20, 0x1c, 
-    0x31, 0x1c, 0x98, 0x47, 0x33, 0x68, 0x00, 0x2b, 0x01, 0xd0, 0x01, 0x20, 
-    0x38, 0xe0, 0x00, 0x9a, 0x00, 0x2a, 0x17, 0xd1, 0x33, 0x23, 0x23, 0x60, 
-    0x01, 0x9b, 0xfa, 0x21, 0xa3, 0x60, 0x80, 0x23, 0x5b, 0x00, 0xe3, 0x60, 
-    0x20, 0x4b, 0x89, 0x00, 0x18, 0x68, 0x67, 0x60, 0x01, 0xf0, 0x0e, 0xfc, 
-    0x31, 0x1c, 0x20, 0x61, 0x1b, 0x4a, 0x20, 0x1c, 0x90, 0x47, 0x30, 0x68, 
-    0x00, 0x28, 0xe4, 0xd1, 0x62, 0xb6, 0x1d, 0xe0, 0x34, 0x23, 0x23, 0x60, 
-    0x17, 0x4b, 0xfa, 0x21, 0x18, 0x68, 0x89, 0x00, 0x65, 0x60, 0xa5, 0x60, 
-    0x01, 0xf0, 0xfa, 0xfb, 0x31, 0x1c, 0xe0, 0x60, 0x11, 0x4b, 0x20, 0x1c, 
-    0x98, 0x47, 0x32, 0x68, 0x00, 0x2a, 0xd0, 0xd1, 0x32, 0x23, 0x23, 0x60, 
-    0x65, 0x60, 0xa5, 0x60, 0x20, 0x1c, 0x31, 0x1c, 0x0b, 0x4a, 0x90, 0x47, 
-    0x33, 0x68, 0x00, 0x2b, 0xca, 0xd0, 0xc4, 0xe7, 0xfe, 0xbd, 0xc0, 0x46, 
-    0xff, 0x7f, 0x01, 0x00, 0xff, 0x7f, 0x03, 0x00, 0xff, 0xff, 0x02, 0x00, 
-    0xff, 0x7f, 0x02, 0x00, 0xff, 0xff, 0x01, 0x00, 0xee, 0xff, 0x03, 0x00, 
-    0x64, 0x03, 0x00, 0x10, 0x78, 0x03, 0x00, 0x10, 0xf1, 0x1f, 0xff, 0x1f, 
-    0x04, 0x01, 0x00, 0x10, 0x01, 0x4b, 0x01, 0x22, 0x1a, 0x71, 0x70, 0x47, 
-    0x28, 0x04, 0x00, 0x10, 0x01, 0x4b, 0x00, 0x22, 0x1a, 0x71, 0x70, 0x47, 
-    0x28, 0x04, 0x00, 0x10, 0x01, 0x4b, 0x01, 0x22, 0x5a, 0x71, 0x70, 0x47, 
-    0x28, 0x04, 0x00, 0x10, 0x01, 0x4b, 0x00, 0x22, 0x5a, 0x71, 0x70, 0x47, 
-    0x28, 0x04, 0x00, 0x10, 0x01, 0x4b, 0x01, 0x22, 0x9a, 0x71, 0x70, 0x47, 
-    0x28, 0x04, 0x00, 0x10, 0x01, 0x4b, 0x00, 0x22, 0x9a, 0x71, 0x70, 0x47, 
-    0x28, 0x04, 0x00, 0x10, 0x01, 0x4b, 0x01, 0x22, 0x5a, 0x70, 0x70, 0x47, 
-    0x28, 0x04, 0x00, 0x10, 0x01, 0x4b, 0x00, 0x22, 0x5a, 0x70, 0x70, 0x47, 
-    0x28, 0x04, 0x00, 0x10, 0x01, 0x4b, 0x01, 0x22, 0xda, 0x70, 0x70, 0x47, 
-    0x28, 0x04, 0x00, 0x10, 0x01, 0x4b, 0x00, 0x22, 0xda, 0x70, 0x70, 0x47, 
-    0x28, 0x04, 0x00, 0x10, 0x01, 0x4b, 0x01, 0x22, 0x9a, 0x70, 0x70, 0x47, 
-    0x28, 0x04, 0x00, 0x10, 0x01, 0x4b, 0x00, 0x22, 0x9a, 0x70, 0x70, 0x47, 
-    0x28, 0x04, 0x00, 0x10, 0x01, 0x4b, 0x01, 0x22, 0x1a, 0x70, 0x70, 0x47, 
-    0x28, 0x04, 0x00, 0x10, 0x01, 0x4b, 0x00, 0x22, 0x1a, 0x70, 0x70, 0x47, 
-    0x28, 0x04, 0x00, 0x10, 0x38, 0xb5, 0x2a, 0x4b, 0x00, 0x24, 0x2a, 0x4d, 
-    0x1c, 0x70, 0x2a, 0x4b, 0x28, 0x1c, 0x2a, 0x49, 0x1c, 0x70, 0xff, 0xf7, 
-    0x1b, 0xf8, 0x28, 0x1c, 0x28, 0x49, 0xff, 0xf7, 0x05, 0xf8, 0x28, 0x4d, 
-    0x28, 0x49, 0x28, 0x1c, 0xff, 0xf7, 0x12, 0xf8, 0x28, 0x1c, 0x27, 0x49, 
-    0xfe, 0xf7, 0xfc, 0xff, 0x26, 0x4d, 0x27, 0x49, 0x28, 0x1c, 0xff, 0xf7, 
-    0x09, 0xf8, 0x28, 0x1c, 0x25, 0x49, 0xfe, 0xf7, 0xf3, 0xff, 0x25, 0x4d, 
-    0x25, 0x49, 0x28, 0x1c, 0xff, 0xf7, 0x00, 0xf8, 0x28, 0x1c, 0x24, 0x49, 
-    0xfe, 0xf7, 0xea, 0xff, 0x23, 0x4d, 0x24, 0x49, 0x28, 0x1c, 0xfe, 0xf7, 
-    0xf7, 0xff, 0x28, 0x1c, 0x22, 0x49, 0xfe, 0xf7, 0xe1, 0xff, 0x22, 0x4d, 
-    0x22, 0x49, 0x28, 0x1c, 0xfe, 0xf7, 0xee, 0xff, 0x28, 0x1c, 0x21, 0x49, 
-    0xfe, 0xf7, 0xd8, 0xff, 0x20, 0x4d, 0x21, 0x49, 0x28, 0x1c, 0xfe, 0xf7, 
-    0xe5, 0xff, 0x28, 0x1c, 0x1f, 0x49, 0xfe, 0xf7, 0xcf, 0xff, 0x1f, 0x4b, 
-    0x1c, 0x70, 0x5c, 0x70, 0x9c, 0x70, 0xdc, 0x70, 0x1c, 0x71, 0x5c, 0x71, 
-    0x9c, 0x71, 0x1c, 0x4b, 0x1c, 0x70, 0x5c, 0x70, 0x9c, 0x70, 0xdc, 0x70, 
-    0x1c, 0x71, 0x5c, 0x71, 0x9c, 0x71, 0x38, 0xbd, 0x24, 0x05, 0x00, 0x10, 
-    0x30, 0x05, 0x00, 0x10, 0x80, 0x04, 0x00, 0x10, 0xd5, 0xaa, 0x03, 0x00, 
-    0xc9, 0xaa, 0x03, 0x00, 0x80, 0x05, 0x00, 0x10, 0xed, 0xaa, 0x03, 0x00, 
-    0xe1, 0xaa, 0x03, 0x00, 0x88, 0x03, 0x00, 0x10, 0x05, 0xab, 0x03, 0x00, 
-    0xf9, 0xaa, 0x03, 0x00, 0xd4, 0x04, 0x00, 0x10, 0x1d, 0xab, 0x03, 0x00, 
-    0x11, 0xab, 0x03, 0x00, 0xd8, 0x03, 0x00, 0x10, 0x35, 0xab, 0x03, 0x00, 
-    0x29, 0xab, 0x03, 0x00, 0x30, 0x04, 0x00, 0x10, 0x65, 0xab, 0x03, 0x00, 
-    0x59, 0xab, 0x03, 0x00, 0x84, 0x04, 0x00, 0x10, 0x4d, 0xab, 0x03, 0x00, 
-    0x41, 0xab, 0x03, 0x00, 0x28, 0x04, 0x00, 0x10, 0x25, 0x05, 0x00, 0x10, 
-    0x02, 0x4b, 0x18, 0x78, 0x01, 0x23, 0x18, 0x40, 0x70, 0x47, 0xc0, 0x46, 
-    0x2c, 0x05, 0x00, 0x10, 0x02, 0x4b, 0x18, 0x78, 0x80, 0x07, 0xc0, 0x0f, 
-    0x70, 0x47, 0xc0, 0x46, 0x2c, 0x05, 0x00, 0x10, 0x02, 0x4b, 0x18, 0x78, 
-    0x40, 0x07, 0xc0, 0x0f, 0x70, 0x47, 0xc0, 0x46, 0x2c, 0x05, 0x00, 0x10, 
-    0x02, 0x4b, 0x18, 0x78, 0x00, 0x07, 0xc0, 0x0f, 0x70, 0x47, 0xc0, 0x46, 
-    0x2c, 0x05, 0x00, 0x10, 0x02, 0x4b, 0x18, 0x78, 0xc0, 0x06, 0xc0, 0x0f, 
-    0x70, 0x47, 0xc0, 0x46, 0x2c, 0x05, 0x00, 0x10, 0x03, 0x4b, 0x18, 0x78, 
-    0x01, 0x38, 0x43, 0x42, 0x58, 0x41, 0xc0, 0xb2, 0x70, 0x47, 0xc0, 0x46, 
-    0x28, 0x04, 0x00, 0x10, 0x03, 0x4b, 0x98, 0x78, 0x01, 0x38, 0x43, 0x42, 
-    0x58, 0x41, 0xc0, 0xb2, 0x70, 0x47, 0xc0, 0x46, 0x28, 0x04, 0x00, 0x10, 
-    0x03, 0x4b, 0x58, 0x78, 0x01, 0x38, 0x43, 0x42, 0x58, 0x41, 0xc0, 0xb2, 
-    0x70, 0x47, 0xc0, 0x46, 0x28, 0x04, 0x00, 0x10, 0x03, 0x4b, 0xd8, 0x78, 
-    0x01, 0x38, 0x43, 0x42, 0x58, 0x41, 0xc0, 0xb2, 0x70, 0x47, 0xc0, 0x46, 
-    0x28, 0x04, 0x00, 0x10, 0x03, 0x4b, 0x18, 0x79, 0x01, 0x38, 0x43, 0x42, 
-    0x58, 0x41, 0xc0, 0xb2, 0x70, 0x47, 0xc0, 0x46, 0x28, 0x04, 0x00, 0x10, 
-    0x03, 0x4b, 0x58, 0x79, 0x01, 0x38, 0x43, 0x42, 0x58, 0x41, 0xc0, 0xb2, 
-    0x70, 0x47, 0xc0, 0x46, 0x28, 0x04, 0x00, 0x10, 0x03, 0x4b, 0x98, 0x79, 
-    0x01, 0x38, 0x43, 0x42, 0x58, 0x41, 0xc0, 0xb2, 0x70, 0x47, 0xc0, 0x46, 
-    0x28, 0x04, 0x00, 0x10, 0x38, 0xb5, 0x21, 0x4c, 0x00, 0x23, 0x25, 0x78, 
-    0x23, 0x70, 0xff, 0xf7, 0xc7, 0xff, 0x00, 0x28, 0x01, 0xd0, 0x01, 0x23, 
-    0x23, 0x70, 0xff, 0xf7, 0xcb, 0xff, 0x00, 0x28, 0x03, 0xd0, 0x23, 0x78, 
-    0x02, 0x22, 0x13, 0x43, 0x23, 0x70, 0xff, 0xf7, 0xa5, 0xff, 0x00, 0x28, 
-    0x03, 0xd0, 0x23, 0x78, 0x04, 0x22, 0x13, 0x43, 0x23, 0x70, 0xff, 0xf7, 
-    0xa7, 0xff, 0x00, 0x28, 0x03, 0xd0, 0x23, 0x78, 0x08, 0x22, 0x13, 0x43, 
-    0x23, 0x70, 0xff, 0xf7, 0xbd, 0xff, 0x00, 0x28, 0x03, 0xd0, 0x23, 0x78, 
-    0x10, 0x22, 0x13, 0x43, 0x23, 0x70, 0xff, 0xf7, 0xbf, 0xff, 0x00, 0x28, 
-    0x03, 0xd0, 0x23, 0x78, 0x20, 0x22, 0x13, 0x43, 0x23, 0x70, 0xff, 0xf7, 
-    0xc1, 0xff, 0x00, 0x28, 0x03, 0xd0, 0x23, 0x78, 0x40, 0x22, 0x13, 0x43, 
-    0x23, 0x70, 0x23, 0x78, 0x29, 0x1c, 0x19, 0x40, 0x9d, 0x43, 0x03, 0x4a, 
-    0x03, 0x4b, 0x11, 0x70, 0x1d, 0x70, 0x38, 0xbd, 0x80, 0x04, 0x00, 0x10, 
-    0x24, 0x05, 0x00, 0x10, 0x2c, 0x05, 0x00, 0x10, 0x70, 0xb5, 0x24, 0x4e, 
-    0x24, 0x49, 0x30, 0x1c, 0xfe, 0xf7, 0xac, 0xfe, 0x23, 0x4d, 0x24, 0x4c, 
-    0x29, 0x1c, 0x22, 0x1c, 0x30, 0x1c, 0xff, 0xf7, 0xad, 0xf8, 0x22, 0x4e, 
-    0x22, 0x49, 0x30, 0x1c, 0xfe, 0xf7, 0xa0, 0xfe, 0x29, 0x1c, 0x22, 0x1c, 
-    0x30, 0x1c, 0xff, 0xf7, 0xa3, 0xf8, 0x1f, 0x4e, 0x1f, 0x49, 0x30, 0x1c, 
-    0xfe, 0xf7, 0x96, 0xfe, 0x29, 0x1c, 0x22, 0x1c, 0x30, 0x1c, 0xff, 0xf7, 
-    0x99, 0xf8, 0x1c, 0x4e, 0x1c, 0x49, 0x30, 0x1c, 0xfe, 0xf7, 0x8c, 0xfe, 
-    0x29, 0x1c, 0x22, 0x1c, 0x30, 0x1c, 0xff, 0xf7, 0x8f, 0xf8, 0x19, 0x4e, 
-    0x19, 0x49, 0x30, 0x1c, 0xfe, 0xf7, 0x82, 0xfe, 0x29, 0x1c, 0x22, 0x1c, 
-    0x30, 0x1c, 0xff, 0xf7, 0x85, 0xf8, 0x16, 0x4e, 0x16, 0x49, 0x30, 0x1c, 
-    0xfe, 0xf7, 0x78, 0xfe, 0x29, 0x1c, 0x22, 0x1c, 0x30, 0x1c, 0xff, 0xf7, 
-    0x7b, 0xf8, 0x13, 0x4e, 0x13, 0x49, 0x30, 0x1c, 0xfe, 0xf7, 0x6e, 0xfe, 
-    0x30, 0x1c, 0x29, 0x1c, 0x22, 0x1c, 0xff, 0xf7, 0x71, 0xf8, 0x70, 0xbd, 
-    0x30, 0x05, 0x00, 0x10, 0x84, 0x12, 0x01, 0x00, 0xd1, 0x9a, 0x03, 0x00, 
-    0x00, 0x01, 0x00, 0x10, 0x80, 0x05, 0x00, 0x10, 0x70, 0x08, 0x01, 0x00, 
-    0x88, 0x03, 0x00, 0x10, 0x88, 0x14, 0x01, 0x00, 0xd4, 0x04, 0x00, 0x10, 
-    0x94, 0x1a, 0x01, 0x00, 0xd8, 0x03, 0x00, 0x10, 0x6c, 0x06, 0x01, 0x00, 
-    0x30, 0x04, 0x00, 0x10, 0xc4, 0x32, 0x01, 0x00, 0x84, 0x04, 0x00, 0x10, 
-    0x7c, 0x0e, 0x01, 0x00, 0xf0, 0xb5, 0x89, 0xb0, 0x07, 0x91, 0x51, 0x78, 
-    0x15, 0x78, 0x01, 0x91, 0x59, 0x43, 0x07, 0x23, 0x2b, 0x40, 0x06, 0x90, 
-    0x5c, 0x1e, 0xa3, 0x41, 0xe8, 0x10, 0xc3, 0x18, 0x4b, 0x43, 0x03, 0x33, 
-    0xd3, 0x18, 0x02, 0x93, 0xeb, 0x1d, 0xdb, 0x10, 0x03, 0x93, 0x00, 0x26, 
-    0x74, 0xb2, 0xac, 0x42, 0x2f, 0xda, 0xe3, 0x17, 0x5b, 0x0f, 0x1b, 0x19, 
-    0xdb, 0x10, 0xdb, 0xb2, 0x04, 0x93, 0x16, 0x4b, 0x23, 0x40, 0x04, 0xd5, 
-    0x08, 0x22, 0x01, 0x3b, 0x52, 0x42, 0x13, 0x43, 0x01, 0x33, 0x5b, 0xb2, 
-    0x80, 0x22, 0x1a, 0x41, 0x05, 0x92, 0x00, 0x27, 0x01, 0x99, 0x78, 0xb2, 
-    0x88, 0x42, 0x15, 0xda, 0x04, 0x9a, 0x02, 0x99, 0x53, 0xb2, 0x03, 0x9a, 
-    0x42, 0x43, 0x8a, 0x18, 0xd3, 0x5c, 0x05, 0x9a, 0x1a, 0x42, 0x08, 0xd0, 
-    0x06, 0x9b, 0x07, 0x99, 0x18, 0x18, 0x08, 0x4b, 0x08, 0x31, 0x09, 0x1b, 
-    0x1a, 0x68, 0x00, 0xf0, 0x29, 0xfa, 0x01, 0x37, 0xff, 0xb2, 0xe5, 0xe7, 
-    0x01, 0x36, 0xf6, 0xb2, 0xcc, 0xe7, 0x09, 0xb0, 0xf0, 0xbd, 0xc0, 0x46, 
-    0x07, 0x00, 0x00, 0x80, 0x10, 0x01, 0x00, 0x10, 0x07, 0x4b, 0x1a, 0x68, 
-    0x90, 0x42, 0x0a, 0xd0, 0x18, 0x60, 0x06, 0x4a, 0x06, 0x49, 0xa0, 0x23, 
-    0x1b, 0x06, 0x99, 0x50, 0x05, 0x49, 0xc0, 0x00, 0x58, 0x50, 0x00, 0x21, 
-    0x99, 0x50, 0x70, 0x47, 0xd0, 0x05, 0x00, 0x10, 0x88, 0x20, 0x00, 0x00, 
-    0x07, 0x00, 0xf8, 0xff, 0x88, 0x21, 0x00, 0x00, 0x10, 0xb5, 0x07, 0x4c, 
-    0x07, 0x49, 0x20, 0x1c, 0xff, 0xf7, 0xfa, 0xf9, 0x20, 0x1c, 0x05, 0x21, 
-    0xff, 0xf7, 0xd5, 0xf9, 0x20, 0x1c, 0x04, 0x49, 0xff, 0xf7, 0xae, 0xf9, 
-    0x10, 0xbd, 0xc0, 0x46, 0xd4, 0x05, 0x00, 0x10, 0xfc, 0x04, 0x02, 0x00, 
-    0x9a, 0x99, 0x99, 0x3e, 0x38, 0xb5, 0xa0, 0x24, 0x8a, 0x23, 0x24, 0x06, 
-    0x04, 0x22, 0x9b, 0x01, 0xe2, 0x50, 0x06, 0x4d, 0x80, 0x23, 0x5b, 0x04, 
-    0x63, 0x51, 0xff, 0xf7, 0xc5, 0xff, 0x04, 0x4a, 0x80, 0x23, 0x5b, 0x01, 
-    0xa3, 0x50, 0xc0, 0x46, 0x63, 0x51, 0x38, 0xbd, 0x04, 0x22, 0x00, 0x00, 
-    0x84, 0x22, 0x00, 0x00, 0x38, 0xb5, 0xa0, 0x24, 0x88, 0x23, 0x24, 0x06, 
-    0x04, 0x22, 0x9b, 0x01, 0xe2, 0x50, 0x06, 0x4d, 0x80, 0x23, 0x5b, 0x04, 
-    0x63, 0x51, 0xff, 0xf7, 0xad, 0xff, 0x04, 0x4a, 0x80, 0x23, 0x5b, 0x01, 
-    0xa3, 0x50, 0xc0, 0x46, 0x63, 0x51, 0x38, 0xbd, 0x04, 0x22, 0x00, 0x00, 
-    0x84, 0x22, 0x00, 0x00, 0x10, 0xb5, 0x20, 0x20, 0xff, 0xf7, 0xcc, 0xff, 
-    0x00, 0x20, 0xff, 0xf7, 0xe1, 0xff, 0x21, 0x20, 0xff, 0xf7, 0xc6, 0xff, 
-    0x00, 0x20, 0xff, 0xf7, 0xdb, 0xff, 0x22, 0x20, 0xff, 0xf7, 0xc0, 0xff, 
-    0x00, 0x20, 0xff, 0xf7, 0x8f, 0xff, 0xa0, 0x23, 0x88, 0x22, 0x1b, 0x06, 
-    0x04, 0x21, 0x92, 0x01, 0x99, 0x50, 0x0a, 0x4a, 0x80, 0x21, 0x49, 0x04, 
-    0x99, 0x50, 0x80, 0x21, 0x49, 0x01, 0x99, 0x50, 0x07, 0x4b, 0x08, 0x4c, 
-    0xa0, 0x21, 0x80, 0x20, 0x09, 0x06, 0x40, 0x01, 0x08, 0x51, 0xc0, 0x46, 
-    0x01, 0x3b, 0x88, 0x50, 0x00, 0x2b, 0xf4, 0xd1, 0x10, 0xbd, 0xc0, 0x46, 
-    0x04, 0x22, 0x00, 0x00, 0x40, 0x97, 0x00, 0x00, 0x84, 0x22, 0x00, 0x00, 
-    0xf8, 0xb5, 0xa0, 0x24, 0x80, 0x23, 0x24, 0x06, 0x9b, 0x01, 0xe2, 0x58, 
-    0x04, 0x21, 0x0a, 0x43, 0xe2, 0x50, 0xa1, 0x4b, 0x80, 0x26, 0xe2, 0x58, 
-    0x76, 0x01, 0x32, 0x43, 0xe2, 0x50, 0xe1, 0x58, 0x80, 0x22, 0x52, 0x04, 
-    0x0a, 0x43, 0xe2, 0x50, 0xe2, 0x58, 0x01, 0x25, 0x2a, 0x43, 0xe2, 0x50, 
-    0x9a, 0x4b, 0x9b, 0x49, 0xe2, 0x58, 0x9b, 0x48, 0x0a, 0x43, 0xe2, 0x50, 
-    0x00, 0x21, 0xff, 0xf7, 0xf1, 0xf8, 0x99, 0x48, 0x00, 0x21, 0xff, 0xf7, 
-    0xed, 0xf8, 0x98, 0x48, 0x00, 0x21, 0xff, 0xf7, 0xe9, 0xf8, 0x97, 0x48, 
-    0x00, 0x21, 0xff, 0xf7, 0xe5, 0xf8, 0x96, 0x48, 0x00, 0x21, 0xff, 0xf7, 
-    0xe1, 0xf8, 0x95, 0x48, 0x00, 0x21, 0xff, 0xf7, 0xdd, 0xf8, 0x94, 0x48, 
-    0x00, 0x21, 0xff, 0xf7, 0xd9, 0xf8, 0x93, 0x48, 0x00, 0x21, 0xff, 0xf7, 
-    0xd5, 0xf8, 0x92, 0x48, 0x00, 0x21, 0xff, 0xf7, 0xd1, 0xf8, 0x91, 0x48, 
-    0x00, 0x21, 0xff, 0xf7, 0xcd, 0xf8, 0x90, 0x48, 0x00, 0x21, 0xff, 0xf7, 
-    0xc9, 0xf8, 0x8f, 0x48, 0x00, 0x21, 0xff, 0xf7, 0xc5, 0xf8, 0x8e, 0x48, 
-    0x00, 0x21, 0xff, 0xf7, 0xc1, 0xf8, 0x8d, 0x48, 0x00, 0x21, 0xff, 0xf7, 
-    0xbd, 0xf8, 0x8c, 0x4f, 0x8c, 0x48, 0x00, 0x21, 0xff, 0xf7, 0xb8, 0xf8, 
-    0x00, 0x21, 0x8b, 0x48, 0xff, 0xf7, 0xb4, 0xf8, 0xff, 0xf7, 0x26, 0xff, 
-    0xe5, 0x51, 0x0a, 0x20, 0xfe, 0xf7, 0x49, 0xfe, 0x87, 0x4b, 0x0a, 0x20, 
-    0xe5, 0x50, 0xfe, 0xf7, 0x44, 0xfe, 0xe5, 0x51, 0x0a, 0x20, 0xfe, 0xf7, 
-    0x40, 0xfe, 0x28, 0x1c, 0xff, 0xf7, 0x2c, 0xff, 0x8e, 0x20, 0xa8, 0x40, 
-    0xff, 0xf7, 0x40, 0xff, 0x02, 0x20, 0xff, 0xf7, 0x25, 0xff, 0x80, 0x20, 
-    0xa8, 0x40, 0xff, 0xf7, 0x39, 0xff, 0x03, 0x20, 0xff, 0xf7, 0x1e, 0xff, 
-    0x7b, 0x48, 0xff, 0xf7, 0x33, 0xff, 0x08, 0x20, 0xff, 0xf7, 0x18, 0xff, 
-    0x79, 0x48, 0xff, 0xf7, 0x2d, 0xff, 0x0c, 0x20, 0xff, 0xf7, 0x12, 0xff, 
-    0x00, 0x20, 0xff, 0xf7, 0x27, 0xff, 0x0f, 0x20, 0xff, 0xf7, 0x0c, 0xff, 
-    0x28, 0x1c, 0xff, 0xf7, 0x21, 0xff, 0x20, 0x20, 0xff, 0xf7, 0x06, 0xff, 
-    0x00, 0x20, 0xff, 0xf7, 0x1b, 0xff, 0x21, 0x20, 0xff, 0xf7, 0x00, 0xff, 
-    0x00, 0x20, 0xff, 0xf7, 0x15, 0xff, 0x10, 0x20, 0xff, 0xf7, 0xfa, 0xfe, 
-    0x00, 0x20, 0xff, 0xf7, 0x0f, 0xff, 0x11, 0x20, 0xff, 0xf7, 0xf4, 0xfe, 
-    0x30, 0x1c, 0xff, 0xf7, 0x09, 0xff, 0x0a, 0x20, 0xfe, 0xf7, 0xff, 0xfd, 
-    0x30, 0x20, 0xff, 0xf7, 0xeb, 0xfe, 0x00, 0x20, 0xff, 0xf7, 0x00, 0xff, 
-    0x31, 0x20, 0xff, 0xf7, 0xe5, 0xfe, 0xdb, 0x20, 0xff, 0xf7, 0xfa, 0xfe, 
-    0x32, 0x20, 0xff, 0xf7, 0xdf, 0xfe, 0x00, 0x20, 0xff, 0xf7, 0xf4, 0xfe, 
-    0x33, 0x20, 0xff, 0xf7, 0xd9, 0xfe, 0x00, 0x20, 0xff, 0xf7, 0xee, 0xfe, 
-    0x34, 0x20, 0xff, 0xf7, 0xd3, 0xfe, 0xdb, 0x20, 0xff, 0xf7, 0xe8, 0xfe, 
-    0x35, 0x20, 0xff, 0xf7, 0xcd, 0xfe, 0x00, 0x20, 0xff, 0xf7, 0xe2, 0xfe, 
-    0x36, 0x20, 0xff, 0xf7, 0xc7, 0xfe, 0xaf, 0x20, 0xff, 0xf7, 0xdc, 0xfe, 
-    0x37, 0x20, 0xff, 0xf7, 0xc1, 0xfe, 0x00, 0x20, 0xff, 0xf7, 0xd6, 0xfe, 
-    0x38, 0x20, 0xff, 0xf7, 0xbb, 0xfe, 0xdb, 0x20, 0xff, 0xf7, 0xd0, 0xfe, 
-    0x39, 0x20, 0xff, 0xf7, 0xb5, 0xfe, 0x00, 0x20, 0xff, 0xf7, 0xca, 0xfe, 
-    0x0a, 0x20, 0xfe, 0xf7, 0xc0, 0xfd, 0xff, 0x20, 0xff, 0xf7, 0xac, 0xfe, 
-    0x03, 0x20, 0xff, 0xf7, 0xc1, 0xfe, 0x50, 0x20, 0xff, 0xf7, 0xa6, 0xfe, 
-    0x41, 0x48, 0xff, 0xf7, 0xbb, 0xfe, 0x51, 0x20, 0xff, 0xf7, 0xa0, 0xfe, 
-    0x3f, 0x48, 0xff, 0xf7, 0xb5, 0xfe, 0x52, 0x20, 0xff, 0xf7, 0x9a, 0xfe, 
-    0x3d, 0x4d, 0x05, 0x20, 0xff, 0xf7, 0xae, 0xfe, 0x53, 0x20, 0xff, 0xf7, 
-    0x93, 0xfe, 0x28, 0x1c, 0xff, 0xf7, 0xa8, 0xfe, 0x54, 0x20, 0xff, 0xf7, 
-    0x8d, 0xfe, 0x38, 0x48, 0xff, 0xf7, 0xa2, 0xfe, 0x55, 0x20, 0xff, 0xf7, 
-    0x87, 0xfe, 0x36, 0x4c, 0x03, 0x20, 0xff, 0xf7, 0x9b, 0xfe, 0x56, 0x20, 
-    0xff, 0xf7, 0x80, 0xfe, 0x20, 0x1c, 0xff, 0xf7, 0x95, 0xfe, 0x57, 0x20, 
-    0xff, 0xf7, 0x7a, 0xfe, 0x30, 0x48, 0xff, 0xf7, 0x8f, 0xfe, 0x58, 0x20, 
-    0xff, 0xf7, 0x74, 0xfe, 0x28, 0x1c, 0xff, 0xf7, 0x89, 0xfe, 0x59, 0x20, 
-    0xff, 0xf7, 0x6e, 0xfe, 0x20, 0x1c, 0xff, 0xf7, 0x83, 0xfe, 0xb0, 0x20, 
-    0xff, 0xf7, 0x68, 0xfe, 0x28, 0x48, 0xff, 0xf7, 0x7d, 0xfe, 0xff, 0x20, 
-    0xff, 0xf7, 0x62, 0xfe, 0x00, 0x20, 0xff, 0xf7, 0x77, 0xfe, 0x07, 0x20, 
-    0xff, 0xf7, 0x5c, 0xfe, 0x23, 0x48, 0xff, 0xf7, 0x71, 0xfe, 0xc8, 0x20, 
-    0xfe, 0xf7, 0x67, 0xfd, 0x22, 0x20, 0xff, 0xf7, 0x53, 0xfe, 0xff, 0xf7, 
-    0x81, 0xfe, 0xf8, 0xbd, 0x04, 0x20, 0x00, 0x00, 0x08, 0x20, 0x00, 0x00, 
-    0xf8, 0xff, 0x07, 0x00, 0x00, 0x07, 0x02, 0x00, 0x04, 0x09, 0x02, 0x00, 
-    0x08, 0x0b, 0x02, 0x00, 0x0c, 0x0d, 0x02, 0x00, 0x10, 0x0f, 0x02, 0x00, 
-    0x14, 0x11, 0x02, 0x00, 0x18, 0x13, 0x02, 0x00, 0x1c, 0x15, 0x02, 0x00, 
-    0x20, 0x17, 0x02, 0x00, 0x24, 0x19, 0x02, 0x00, 0x28, 0x1b, 0x02, 0x00, 
-    0x2c, 0x1d, 0x02, 0x00, 0x30, 0x1f, 0x02, 0x00, 0x34, 0x21, 0x02, 0x00, 
-    0x04, 0x22, 0x00, 0x00, 0x38, 0x23, 0x02, 0x00, 0x3c, 0x25, 0x02, 0x00, 
-    0x84, 0x22, 0x00, 0x00, 0x30, 0x10, 0x00, 0x00, 0x08, 0x08, 0x00, 0x00, 
-    0x03, 0x02, 0x00, 0x00, 0x09, 0x0a, 0x00, 0x00, 0x21, 0x10, 0x00, 0x00, 
-    0x02, 0x06, 0x00, 0x00, 0x03, 0x07, 0x00, 0x00, 0x07, 0x05, 0x00, 0x00, 
-    0x01, 0x25, 0x00, 0x00, 0x17, 0x10, 0x00, 0x00, 0xf8, 0xb5, 0x04, 0x1c, 
-    0x0d, 0x1c, 0x17, 0x1c, 0xdb, 0x28, 0x24, 0xd8, 0xaf, 0x29, 0x22, 0xd8, 
-    0x20, 0x20, 0xff, 0xf7, 0x07, 0xfe, 0xa8, 0xb2, 0xff, 0xf7, 0x1c, 0xfe, 
-    0x21, 0x20, 0xff, 0xf7, 0x01, 0xfe, 0xa0, 0xb2, 0xff, 0xf7, 0x16, 0xfe, 
-    0x22, 0x20, 0xff, 0xf7, 0xfb, 0xfd, 0xa0, 0x24, 0x88, 0x23, 0x24, 0x06, 
-    0x04, 0x22, 0x9b, 0x01, 0xe2, 0x50, 0x07, 0x4d, 0x80, 0x23, 0x80, 0x26, 
-    0x5b, 0x04, 0x76, 0x01, 0x63, 0x51, 0xb8, 0xb2, 0x66, 0x51, 0xff, 0xf7, 
-    0xbd, 0xfd, 0x03, 0x4b, 0xe6, 0x50, 0xc0, 0x46, 0x66, 0x51, 0xf8, 0xbd, 
-    0x04, 0x22, 0x00, 0x00, 0x84, 0x22, 0x00, 0x00, 0x0c, 0x4b, 0x00, 0x20, 
-    0x10, 0xb5, 0x18, 0x60, 0x0b, 0x4b, 0x00, 0x21, 0x0b, 0x4c, 0x00, 0x22, 
-    0x24, 0x18, 0x62, 0x54, 0x01, 0x31, 0x0a, 0x29, 0xf8, 0xd1, 0x1a, 0x70, 
-    0x5a, 0x70, 0x9a, 0x70, 0xda, 0x70, 0x1a, 0x71, 0x0a, 0x30, 0xfa, 0x22, 
-    0x05, 0x33, 0x92, 0x00, 0x90, 0x42, 0xec, 0xd1, 0x10, 0xbd, 0xc0, 0x46, 
-    0xbc, 0x0b, 0x00, 0x10, 0xdc, 0x05, 0x00, 0x10, 0xd0, 0x07, 0x00, 0x10, 
-    0x03, 0x78, 0x30, 0xb5, 0x2e, 0x2b, 0x09, 0xd1, 0x43, 0x78, 0x00, 0x2b, 
-    0x01, 0xd0, 0x2e, 0x2b, 0x04, 0xd1, 0x2e, 0x23, 0x0b, 0x70, 0x43, 0x78, 
-    0x4b, 0x70, 0x11, 0xe0, 0x00, 0x23, 0x1d, 0x1c, 0xc4, 0x5c, 0x2e, 0x2c, 
-    0x06, 0xd0, 0x00, 0x2c, 0x0a, 0xd0, 0x00, 0x2d, 0x02, 0xd1, 0x0c, 0x70, 
-    0x01, 0x31, 0x02, 0xe0, 0x14, 0x70, 0x01, 0x25, 0x01, 0x32, 0x01, 0x33, 
-    0x0f, 0x2b, 0xef, 0xd1, 0x30, 0xbd, 0x00, 0x00, 0x38, 0xb5, 0x04, 0x1c, 
-    0xff, 0xf7, 0xba, 0xff, 0xff, 0xf7, 0xac, 0xf9, 0x00, 0x28, 0x04, 0xd1, 
-    0x11, 0x49, 0x12, 0x48, 0x00, 0xf0, 0xd6, 0xfe, 0x19, 0xe0, 0x00, 0x2c, 
-    0x15, 0xd1, 0x0f, 0x49, 0x0f, 0x4a, 0xff, 0xf7, 0xcb, 0xff, 0x01, 0x24, 
-    0x0f, 0xe0, 0xff, 0xf7, 0xe1, 0xf9, 0x03, 0x78, 0x00, 0x2b, 0x0e, 0xd0, 
-    0x0a, 0x21, 0x61, 0x43, 0x05, 0x22, 0x08, 0x4b, 0x62, 0x43, 0x59, 0x18, 
-    0x07, 0x4b, 0x01, 0x34, 0x9a, 0x18, 0xff, 0xf7, 0xb9, 0xff, 0x63, 0x2c, 
-    0xed, 0xdd, 0x00, 0x20, 0x00, 0xe0, 0x20, 0x1c, 0x38, 0xbd, 0xc0, 0x46, 
-    0x97, 0xe2, 0x03, 0x00, 0xd0, 0x07, 0x00, 0x10, 0xdc, 0x05, 0x00, 0x10, 
-    0xf0, 0xb5, 0x87, 0xb0, 0x05, 0x93, 0x27, 0x4b, 0x0a, 0x25, 0x1c, 0x68, 
-    0x26, 0x4b, 0x65, 0x43, 0x5d, 0x19, 0x05, 0x23, 0x63, 0x43, 0x04, 0x92, 
-    0x24, 0x4a, 0x03, 0x90, 0xd3, 0x18, 0x0e, 0x1c, 0x00, 0x93, 0x2b, 0x78, 
-    0x00, 0x2b, 0x3a, 0xd0, 0x03, 0x9a, 0xf3, 0xb2, 0xd2, 0xb2, 0x10, 0x1c, 
-    0x19, 0x1c, 0x01, 0x92, 0x02, 0x93, 0x00, 0xf0, 0x33, 0xfd, 0x1d, 0x4b, 
-    0x1a, 0x68, 0x19, 0x4b, 0x1b, 0x68, 0xd2, 0x18, 0x1b, 0x4b, 0x94, 0x42, 
-    0x01, 0xd1, 0x05, 0x9a, 0x00, 0xe0, 0x04, 0x9a, 0x28, 0x1c, 0x1a, 0x60, 
-    0x00, 0xf0, 0x20, 0xfd, 0x17, 0x4f, 0x0a, 0x25, 0x3b, 0x68, 0x01, 0x9a, 
-    0x18, 0x78, 0x01, 0x34, 0x68, 0x43, 0x10, 0x18, 0xc0, 0xb2, 0x02, 0x99, 
-    0x65, 0x43, 0x00, 0xf0, 0x17, 0xfd, 0x00, 0x98, 0x00, 0xf0, 0x26, 0xfd, 
-    0x0b, 0x4b, 0x0c, 0x4a, 0x5d, 0x19, 0x05, 0x23, 0x63, 0x43, 0xd2, 0x18, 
-    0x3b, 0x68, 0x00, 0x92, 0x5b, 0x78, 0xf6, 0x18, 0x05, 0x4b, 0x1b, 0x68, 
-    0x0d, 0x33, 0x9c, 0x42, 0x03, 0xd0, 0x09, 0x4b, 0x1b, 0x68, 0x9c, 0x42, 
-    0xc1, 0xd1, 0x07, 0xb0, 0xf0, 0xbd, 0xc0, 0x46, 0xc0, 0x0c, 0x00, 0x10, 
-    0xd0, 0x07, 0x00, 0x10, 0xdc, 0x05, 0x00, 0x10, 0xc4, 0x0c, 0x00, 0x10, 
-    0x10, 0x01, 0x00, 0x10, 0xcc, 0x0c, 0x00, 0x10, 0xbc, 0x0b, 0x00, 0x10, 
-    0x70, 0xb5, 0x06, 0x1c, 0x0d, 0x1c, 0x00, 0x24, 0x09, 0x4b, 0xf0, 0xb2, 
-    0x1b, 0x68, 0x59, 0x78, 0x61, 0x43, 0x49, 0x19, 0xc9, 0xb2, 0x00, 0xf0, 
-    0xe3, 0xfc, 0x06, 0x4b, 0x00, 0x22, 0x06, 0x48, 0x01, 0x34, 0x1a, 0x60, 
-    0x00, 0xf0, 0xee, 0xfc, 0x0d, 0x2c, 0xed, 0xd1, 0x70, 0xbd, 0xc0, 0x46, 
-    0xcc, 0x0c, 0x00, 0x10, 0x10, 0x01, 0x00, 0x10, 0x52, 0xe3, 0x03, 0x00, 
-    0xf8, 0xb5, 0x10, 0x4c, 0x07, 0x1c, 0x20, 0x60, 0x00, 0x20, 0x0e, 0x1c, 
-    0x01, 0x1c, 0x15, 0x1c, 0x00, 0xf0, 0xc8, 0xfc, 0x0c, 0x48, 0x00, 0xf0, 
-    0xc1, 0xfc, 0x0c, 0x48, 0x26, 0x60, 0x00, 0xf0, 0xbd, 0xfc, 0x0b, 0x48, 
-    0x25, 0x60, 0x00, 0xf0, 0xcf, 0xfc, 0x0a, 0x48, 0x27, 0x60, 0x00, 0xf0, 
-    0xb5, 0xfc, 0x09, 0x48, 0x26, 0x60, 0x00, 0xf0, 0xb1, 0xfc, 0x08, 0x48, 
-    0x25, 0x60, 0x00, 0xf0, 0xc3, 0xfc, 0xf8, 0xbd, 0x10, 0x01, 0x00, 0x10, 
-    0xa0, 0xe2, 0x03, 0x00, 0xa7, 0xe2, 0x03, 0x00, 0xb6, 0xe2, 0x03, 0x00, 
-    0xbe, 0xe2, 0x03, 0x00, 0xc5, 0xe2, 0x03, 0x00, 0xd4, 0xe2, 0x03, 0x00, 
-    0x38, 0xb5, 0x13, 0x4b, 0x18, 0x21, 0x18, 0x60, 0x00, 0x20, 0x00, 0xf0, 
-    0x9b, 0xfc, 0x05, 0x24, 0x10, 0x4d, 0x01, 0x3c, 0x28, 0x1c, 0x00, 0xf0, 
-    0xa7, 0xfc, 0x00, 0x2c, 0xf8, 0xd1, 0x0e, 0x4c, 0x20, 0x1c, 0x00, 0xf0, 
-    0xa1, 0xfc, 0x0d, 0x48, 0x00, 0xf0, 0x88, 0xfc, 0x20, 0x1c, 0x00, 0xf0, 
-    0x9b, 0xfc, 0x20, 0x1c, 0x00, 0xf0, 0x98, 0xfc, 0x05, 0x24, 0x28, 0x1c, 
-    0x01, 0x3c, 0x00, 0xf0, 0x93, 0xfc, 0x00, 0x2c, 0xf9, 0xd1, 0x06, 0x48, 
-    0x00, 0xf0, 0x8e, 0xfc, 0x38, 0xbd, 0xc0, 0x46, 0x10, 0x01, 0x00, 0x10, 
-    0xdc, 0xe2, 0x03, 0x00, 0xf8, 0xe2, 0x03, 0x00, 0x14, 0xe3, 0x03, 0x00, 
-    0x19, 0xe3, 0x03, 0x00, 0x19, 0x4b, 0x00, 0x22, 0x70, 0xb5, 0x05, 0x1c, 
-    0x1a, 0x60, 0x16, 0x24, 0x1e, 0x1c, 0x17, 0x48, 0x01, 0x3c, 0x00, 0xf0, 
-    0x77, 0xfc, 0x00, 0x2c, 0xf9, 0xd1, 0x20, 0x24, 0xe1, 0xb2, 0x28, 0x20, 
-    0x00, 0xf0, 0x5e, 0xfc, 0x08, 0x34, 0x12, 0x48, 0x00, 0xf0, 0x6c, 0xfc, 
-    0x98, 0x2c, 0xf5, 0xd1, 0x28, 0x20, 0x20, 0x21, 0x35, 0x60, 0x00, 0xf0, 
-    0x53, 0xfc, 0x0e, 0x48, 0x00, 0xf0, 0x62, 0xfc, 0x28, 0x24, 0xe1, 0xb2, 
-    0x28, 0x20, 0x00, 0xf0, 0x4b, 0xfc, 0x08, 0x34, 0x0a, 0x48, 0x00, 0xf0, 
-    0x59, 0xfc, 0x90, 0x2c, 0xf5, 0xd1, 0x21, 0x1c, 0x28, 0x20, 0x00, 0xf0, 
-    0x41, 0xfc, 0x07, 0x48, 0x00, 0xf0, 0x50, 0xfc, 0x70, 0xbd, 0xc0, 0x46, 
-    0x10, 0x01, 0x00, 0x10, 0x35, 0xe3, 0x03, 0x00, 0x51, 0xe3, 0x03, 0x00, 
-    0x64, 0xe3, 0x03, 0x00, 0x77, 0xe3, 0x03, 0x00, 0x8a, 0xe3, 0x03, 0x00, 
-    0x38, 0xb5, 0xf8, 0x24, 0x24, 0x02, 0x05, 0x1c, 0x20, 0x1c, 0xff, 0xf7, 
-    0xb9, 0xff, 0x21, 0x4b, 0x30, 0x21, 0x60, 0x20, 0x1c, 0x60, 0x00, 0xf0, 
-    0x23, 0xfc, 0x1f, 0x48, 0x00, 0xf0, 0x1c, 0xfc, 0x38, 0x21, 0x60, 0x20, 
-    0x00, 0xf0, 0x1c, 0xfc, 0x1c, 0x48, 0x00, 0xf0, 0x15, 0xfc, 0x40, 0x21, 
-    0x60, 0x20, 0x00, 0xf0, 0x15, 0xfc, 0x1a, 0x48, 0x00, 0xf0, 0x0e, 0xfc, 
-    0x48, 0x21, 0x60, 0x20, 0x00, 0xf0, 0x0e, 0xfc, 0x17, 0x48, 0x00, 0xf0, 
-    0x07, 0xfc, 0x60, 0x21, 0x38, 0x20, 0x00, 0xf0, 0x07, 0xfc, 0x28, 0x1c, 
-    0x00, 0xf0, 0x00, 0xfc, 0xff, 0xf7, 0x3e, 0xfe, 0x12, 0x49, 0x13, 0x48, 
-    0x00, 0xf0, 0x5e, 0xfd, 0x12, 0x4b, 0x13, 0x49, 0x00, 0x22, 0x1d, 0x68, 
-    0x0a, 0x60, 0x1a, 0x60, 0x1c, 0x1c, 0xff, 0xf7, 0xe1, 0xfa, 0x50, 0x20, 
-    0x78, 0x21, 0x0f, 0x4a, 0x0f, 0x4b, 0xff, 0xf7, 0x9f, 0xfe, 0xff, 0xf7, 
-    0x8b, 0xfa, 0x00, 0x28, 0xf3, 0xd0, 0x0d, 0x4b, 0x00, 0x22, 0x25, 0x60, 
-    0x1a, 0x60, 0x38, 0xbd, 0x10, 0x01, 0x00, 0x10, 0x9d, 0xe3, 0x03, 0x00, 
-    0xa2, 0xe3, 0x03, 0x00, 0xa7, 0xe3, 0x03, 0x00, 0xac, 0xe3, 0x03, 0x00, 
-    0xb1, 0xe3, 0x03, 0x00, 0xd0, 0x07, 0x00, 0x10, 0xc4, 0x0c, 0x00, 0x10, 
-    0xc0, 0x0c, 0x00, 0x10, 0xef, 0x7b, 0x00, 0x00, 0xff, 0xff, 0x00, 0x00, 
-    0xb8, 0x0b, 0x00, 0x10, 0x38, 0xb5, 0xff, 0xf7, 0xb7, 0xfa, 0x1d, 0x4c, 
-    0x20, 0x68, 0x04, 0x28, 0xf9, 0xd8, 0x00, 0xf0, 0x2d, 0xfd, 0x03, 0x22, 
-    0x16, 0x2f, 0x31, 0x00, 0x19, 0x4d, 0xff, 0xf7, 0x0d, 0xfc, 0x80, 0x20, 
-    0x29, 0x1c, 0x18, 0x4a, 0xc0, 0x00, 0xff, 0xf7, 0xe7, 0xfe, 0x17, 0x4b, 
-    0x17, 0x48, 0x1d, 0x60, 0x00, 0xf0, 0xc6, 0xfb, 0x28, 0x1c, 0xff, 0xf7, 
-    0x0f, 0xff, 0x02, 0x23, 0x16, 0xe0, 0x18, 0x20, 0x30, 0x21, 0x00, 0xf0, 
-    0xab, 0xfb, 0x10, 0x4b, 0x11, 0x4a, 0x12, 0x48, 0x1a, 0x60, 0x00, 0xf0, 
-    0xb7, 0xfb, 0x01, 0x23, 0x0a, 0xe0, 0xff, 0xf7, 0x2f, 0xfa, 0x00, 0x28, 
-    0x01, 0xd0, 0x03, 0x23, 0x23, 0x60, 0xff, 0xf7, 0x31, 0xfa, 0x00, 0x28, 
-    0xcb, 0xd0, 0x04, 0x23, 0x23, 0x60, 0xc8, 0xe7, 0x01, 0x22, 0x00, 0xe0, 
-    0x03, 0x22, 0x08, 0x4b, 0x1a, 0x60, 0x38, 0xbd, 0xb8, 0x0b, 0x00, 0x10, 
-    0xff, 0x07, 0x00, 0x00, 0x10, 0x80, 0x00, 0x00, 0x10, 0x01, 0x00, 0x10, 
-    0xbb, 0xe3, 0x03, 0x00, 0xef, 0x7b, 0x00, 0x00, 0xd7, 0xe3, 0x03, 0x00, 
-    0x14, 0x01, 0x00, 0x10, 0x38, 0xb5, 0xff, 0xf7, 0x69, 0xfa, 0x1e, 0x4c, 
-    0x20, 0x68, 0x04, 0x28, 0xf9, 0xd8, 0x00, 0xf0, 0xdf, 0xfc, 0x03, 0x23, 
-    0x17, 0x30, 0x32, 0x00, 0x1a, 0x4d, 0xff, 0xf7, 0xbf, 0xfb, 0x80, 0x20, 
-    0x82, 0x21, 0xc9, 0x00, 0x2a, 0x1c, 0xc0, 0x00, 0xff, 0xf7, 0x98, 0xfe, 
-    0x16, 0x4b, 0x17, 0x48, 0x1d, 0x60, 0x00, 0xf0, 0x77, 0xfb, 0x28, 0x1c, 
-    0xff, 0xf7, 0xc0, 0xfe, 0x02, 0x23, 0x16, 0xe0, 0x18, 0x20, 0x30, 0x21, 
-    0x00, 0xf0, 0x5c, 0xfb, 0x0f, 0x4b, 0x11, 0x4a, 0x11, 0x48, 0x1a, 0x60, 
-    0x00, 0xf0, 0x68, 0xfb, 0x01, 0x23, 0x0a, 0xe0, 0xff, 0xf7, 0xe0, 0xf9, 
-    0x00, 0x28, 0x01, 0xd0, 0x03, 0x23, 0x23, 0x60, 0xff, 0xf7, 0xe2, 0xf9, 
-    0x00, 0x28, 0xca, 0xd0, 0x04, 0x23, 0x23, 0x60, 0xc7, 0xe7, 0x02, 0x22, 
-    0x00, 0xe0, 0x01, 0x22, 0x07, 0x4b, 0x1a, 0x60, 0x38, 0xbd, 0xc0, 0x46, 
-    0xb8, 0x0b, 0x00, 0x10, 0x1f, 0xf8, 0x00, 0x00, 0x10, 0x01, 0x00, 0x10, 
-    0xe0, 0xe3, 0x03, 0x00, 0xef, 0x7b, 0x00, 0x00, 0xfc, 0xe3, 0x03, 0x00, 
-    0x14, 0x01, 0x00, 0x10, 0xf0, 0xb5, 0x89, 0xb0, 0x6e, 0x46, 0x01, 0x23, 
-    0x0b, 0x36, 0x33, 0x70, 0x00, 0x23, 0x03, 0xad, 0x00, 0x24, 0x5c, 0x55, 
-    0x01, 0x33, 0x14, 0x2b, 0xf9, 0xd1, 0x27, 0x1c, 0x20, 0x1c, 0x31, 0x1c, 
-    0x01, 0x22, 0x03, 0xf0, 0x0d, 0xf8, 0x33, 0x78, 0x00, 0x2b, 0x06, 0xd0, 
-    0x2b, 0x55, 0x63, 0x1c, 0x27, 0x1c, 0x14, 0x2b, 0x01, 0xd0, 0x1c, 0x1c, 
-    0xf0, 0xe7, 0x5b, 0x4c, 0xfc, 0x23, 0xdb, 0x00, 0x23, 0x60, 0xff, 0xf7, 
-    0x5d, 0xfb, 0x30, 0x21, 0x60, 0x20, 0x00, 0xf0, 0x0b, 0xfb, 0x57, 0x48, 
-    0x00, 0xf0, 0x04, 0xfb, 0x38, 0x21, 0x60, 0x20, 0x00, 0xf0, 0x04, 0xfb, 
-    0x54, 0x48, 0x00, 0xf0, 0xfd, 0xfa, 0x40, 0x21, 0x60, 0x20, 0x00, 0xf0, 
-    0xfd, 0xfa, 0x52, 0x48, 0x00, 0xf0, 0xf6, 0xfa, 0x48, 0x21, 0x60, 0x20, 
-    0x00, 0xf0, 0xf6, 0xfa, 0x4f, 0x48, 0x00, 0xf0, 0xef, 0xfa, 0x08, 0x20, 
-    0x40, 0x42, 0xc0, 0x1b, 0x80, 0x00, 0x6e, 0x30, 0x60, 0x21, 0xc0, 0xb2, 
-    0x00, 0xf0, 0xea, 0xfa, 0x4a, 0x48, 0x00, 0xf0, 0xe3, 0xfa, 0x28, 0x1c, 
-    0x00, 0xf0, 0xe0, 0xfa, 0x02, 0xf0, 0xf9, 0xfe, 0x27, 0x1c, 0x00, 0x28, 
-    0x02, 0xd0, 0x46, 0x48, 0xff, 0xf7, 0xac, 0xfe, 0x28, 0x1c, 0x04, 0x21, 
-    0xfe, 0xf7, 0x92, 0xff, 0x00, 0x28, 0x02, 0xd0, 0x42, 0x48, 0xff, 0xf7, 
-    0xa3, 0xfe, 0xfe, 0xf7, 0xc3, 0xff, 0xfe, 0xf7, 0xcd, 0xff, 0x80, 0x23, 
-    0x05, 0x1c, 0x9b, 0x02, 0x98, 0x42, 0x00, 0xd9, 0x1d, 0x1c, 0xfe, 0xf7, 
-    0xaf, 0xff, 0x01, 0x23, 0x5b, 0x42, 0x00, 0x22, 0x00, 0x93, 0x01, 0x92, 
-    0x00, 0x24, 0x1e, 0x20, 0x78, 0x21, 0x00, 0xf0, 0xbd, 0xfa, 0xfc, 0x23, 
-    0xdb, 0x00, 0x3b, 0x60, 0x00, 0x9b, 0xa3, 0x42, 0x02, 0xd1, 0xac, 0x42, 
-    0x1c, 0xd3, 0x48, 0xe0, 0x01, 0x98, 0x32, 0x49, 0x01, 0xf0, 0x52, 0xf8, 
-    0x00, 0x26, 0x00, 0x90, 0x30, 0x1c, 0x01, 0xf0, 0x0d, 0xfb, 0x00, 0x99, 
-    0x00, 0xf0, 0xd8, 0xfc, 0x00, 0x28, 0x04, 0xd0, 0xfc, 0x23, 0xdb, 0x00, 
-    0x3b, 0x60, 0x2b, 0x48, 0x02, 0xe0, 0x2b, 0x4b, 0x2b, 0x48, 0x3b, 0x60, 
-    0x01, 0x36, 0x00, 0xf0, 0x97, 0xfa, 0x14, 0x2e, 0xea, 0xd1, 0xe0, 0xe7, 
-    0x01, 0x98, 0x01, 0xf0, 0xd7, 0xfa, 0x27, 0x4e, 0x80, 0x21, 0x00, 0x90, 
-    0x49, 0x00, 0x30, 0x1c, 0xfe, 0xf7, 0x6e, 0xff, 0xff, 0x28, 0x07, 0xd8, 
-    0x80, 0x22, 0x2b, 0x1b, 0x52, 0x00, 0x93, 0x42, 0x02, 0xd9, 0x21, 0x48, 
-    0xff, 0xf7, 0x54, 0xfe, 0x20, 0x1c, 0x31, 0x1c, 0xfe, 0xf7, 0xa0, 0xff, 
-    0x00, 0x28, 0x03, 0xd0, 0x1d, 0x48, 0xff, 0xf7, 0x4b, 0xfe, 0x01, 0xe0, 
-    0x01, 0x34, 0xff, 0x34, 0x20, 0x1c, 0x01, 0xf0, 0x33, 0xfb, 0x06, 0x1c, 
-    0x28, 0x1c, 0x01, 0xf0, 0x2f, 0xfb, 0x01, 0x1c, 0x30, 0x1c, 0x00, 0xf0, 
-    0x2b, 0xfe, 0x01, 0x90, 0xa9, 0xe7, 0x90, 0x21, 0x4e, 0x20, 0x00, 0xf0, 
-    0x67, 0xfa, 0x13, 0x48, 0x00, 0xf0, 0x60, 0xfa, 0x12, 0x4a, 0x13, 0x4b, 
-    0x01, 0x20, 0xda, 0x60, 0x09, 0xb0, 0xf0, 0xbd, 0x10, 0x01, 0x00, 0x10, 
-    0x9d, 0xe3, 0x03, 0x00, 0xa2, 0xe3, 0x03, 0x00, 0xa7, 0xe3, 0x03, 0x00, 
-    0xac, 0xe3, 0x03, 0x00, 0x06, 0xe4, 0x03, 0x00, 0x0f, 0xe4, 0x03, 0x00, 
-    0x21, 0xe4, 0x03, 0x00, 0x00, 0x00, 0xa0, 0x41, 0x4f, 0xe3, 0x03, 0x00, 
-    0xff, 0xff, 0x00, 0x00, 0x20, 0xdc, 0x03, 0x00, 0xc0, 0x0b, 0x00, 0x10, 
-    0x30, 0xe4, 0x03, 0x00, 0x43, 0xe4, 0x03, 0x00, 0x55, 0xe4, 0x03, 0x00, 
-    0x04, 0x00, 0xfa, 0x05, 0x00, 0xed, 0x00, 0xe0, 0xf0, 0xb5, 0x00, 0x22, 
-    0x87, 0xb0, 0x01, 0xad, 0x00, 0x23, 0x53, 0x55, 0x01, 0x32, 0x14, 0x2a, 
-    0xf9, 0xd1, 0x3d, 0x4c, 0x3d, 0x4a, 0x26, 0x68, 0x17, 0x68, 0x3d, 0x49, 
-    0xf0, 0x19, 0x0a, 0x26, 0x70, 0x43, 0x08, 0x18, 0xc6, 0x5c, 0x00, 0x2e, 
-    0x02, 0xd0, 0xee, 0x54, 0x01, 0x33, 0xf9, 0xe7, 0x2e, 0x22, 0xea, 0x54, 
-    0xfc, 0x27, 0xeb, 0x18, 0x42, 0x22, 0x5a, 0x70, 0xff, 0x00, 0x49, 0x22, 
-    0x9a, 0x70, 0x38, 0x1c, 0x4e, 0x22, 0xda, 0x70, 0xff, 0xf7, 0xa4, 0xfd, 
-    0x31, 0x4b, 0x30, 0x21, 0x60, 0x20, 0x1f, 0x60, 0x00, 0xf0, 0x0e, 0xfa, 
-    0x2f, 0x48, 0x00, 0xf0, 0x07, 0xfa, 0x38, 0x21, 0x60, 0x20, 0x00, 0xf0, 
-    0x07, 0xfa, 0x2d, 0x48, 0x00, 0xf0, 0x00, 0xfa, 0x40, 0x21, 0x60, 0x20, 
-    0x00, 0xf0, 0x00, 0xfa, 0x2a, 0x48, 0x00, 0xf0, 0xf9, 0xf9, 0x48, 0x21, 
-    0x60, 0x20, 0x00, 0xf0, 0xf9, 0xf9, 0x28, 0x48, 0x00, 0xf0, 0xf2, 0xf9, 
-    0x60, 0x21, 0x38, 0x20, 0x00, 0xf0, 0xf2, 0xf9, 0x25, 0x48, 0x00, 0xf0, 
-    0xeb, 0xf9, 0xff, 0xf7, 0x29, 0xfc, 0x24, 0x49, 0x1c, 0x48, 0x00, 0xf0, 
-    0x49, 0xfb, 0x1b, 0x48, 0x22, 0x49, 0x0a, 0x30, 0x00, 0xf0, 0x44, 0xfb, 
-    0x17, 0x48, 0x27, 0x68, 0x06, 0x60, 0x26, 0x60, 0xff, 0xf7, 0xca, 0xf8, 
-    0x60, 0x20, 0x70, 0x21, 0x1d, 0x4a, 0x1e, 0x4b, 0xff, 0xf7, 0x88, 0xfc, 
-    0xff, 0xf7, 0x54, 0xf8, 0x00, 0x28, 0x01, 0xd0, 0x00, 0x23, 0x23, 0x60, 
-    0xff, 0xf7, 0x56, 0xf8, 0x00, 0x28, 0x01, 0xd0, 0x01, 0x23, 0x23, 0x60, 
-    0xff, 0xf7, 0x68, 0xf8, 0x00, 0x28, 0xe7, 0xd0, 0x23, 0x68, 0x01, 0x2b, 
-    0x04, 0xd1, 0x14, 0x4b, 0x00, 0x22, 0x1a, 0x60, 0x27, 0x60, 0x06, 0xe0, 
-    0x00, 0x20, 0x29, 0x1c, 0x14, 0x22, 0x02, 0xf0, 0x83, 0xfe, 0xff, 0xf7, 
-    0x87, 0xfe, 0x07, 0xb0, 0xf0, 0xbd, 0xc0, 0x46, 0xc4, 0x0c, 0x00, 0x10, 
-    0xc0, 0x0c, 0x00, 0x10, 0xd0, 0x07, 0x00, 0x10, 0x10, 0x01, 0x00, 0x10, 
-    0x9d, 0xe3, 0x03, 0x00, 0xa2, 0xe3, 0x03, 0x00, 0xa7, 0xe3, 0x03, 0x00, 
-    0xac, 0xe3, 0x03, 0x00, 0x60, 0xe4, 0x03, 0x00, 0x6e, 0xe4, 0x03, 0x00, 
-    0x72, 0xe4, 0x03, 0x00, 0xef, 0x7b, 0x00, 0x00, 0xff, 0xff, 0x00, 0x00, 
-    0xb8, 0x0b, 0x00, 0x10, 0xf7, 0xb5, 0x00, 0x20, 0xff, 0xf7, 0x14, 0xfc, 
-    0x54, 0x4b, 0x00, 0x24, 0x18, 0x60, 0x01, 0x94, 0xff, 0xf7, 0x7c, 0xf8, 
-    0x52, 0x4d, 0x28, 0x68, 0x04, 0x28, 0xf9, 0xd8, 0x00, 0xf0, 0xf2, 0xfa, 
-    0x03, 0x1f, 0x17, 0x97, 0x99, 0x00, 0xfc, 0x26, 0xff, 0xf7, 0xd2, 0xf9, 
-    0xf6, 0x00, 0x82, 0x21, 0xc9, 0x00, 0x4c, 0x4a, 0x30, 0x1c, 0xff, 0xf7, 
-    0xab, 0xfc, 0x4b, 0x4b, 0x4b, 0x48, 0x1e, 0x60, 0x00, 0xf0, 0x8a, 0xf9, 
-    0x30, 0x1c, 0xff, 0xf7, 0xd3, 0xfc, 0x02, 0x23, 0x7d, 0xe0, 0x48, 0x4b, 
-    0x18, 0x20, 0x30, 0x21, 0x47, 0x4a, 0xff, 0xf7, 0x1d, 0xfc, 0x01, 0x23, 
-    0x75, 0xe0, 0xff, 0xf7, 0x07, 0xf8, 0x00, 0x28, 0x01, 0xd0, 0xff, 0xf7, 
-    0x2b, 0xff, 0xff, 0xf7, 0x1d, 0xf8, 0x00, 0x28, 0x03, 0xd0, 0x01, 0x9b, 
-    0x01, 0x33, 0x9b, 0xb2, 0x01, 0x93, 0x01, 0x9a, 0xfa, 0x23, 0x9b, 0x00, 
-    0x9a, 0x42, 0x24, 0xd9, 0xff, 0xf7, 0x10, 0xf8, 0x00, 0x28, 0x03, 0xd0, 
-    0x3a, 0x4b, 0x01, 0x9a, 0x9a, 0x42, 0x1c, 0xd9, 0xff, 0xf7, 0x08, 0xf8, 
-    0x38, 0x4e, 0x43, 0x1e, 0x98, 0x41, 0x01, 0x9a, 0x33, 0x68, 0x40, 0x42, 
-    0x02, 0x40, 0x01, 0x3b, 0x01, 0x92, 0x33, 0x60, 0x00, 0x2b, 0x0c, 0xda, 
-    0x33, 0x4f, 0x3b, 0x68, 0x00, 0x2b, 0x07, 0xd0, 0x18, 0x20, 0x30, 0x21, 
-    0xff, 0xf7, 0x4a, 0xfc, 0x3b, 0x68, 0x0d, 0x3b, 0x3b, 0x60, 0x0c, 0x23, 
-    0x33, 0x60, 0x02, 0x23, 0x2b, 0x60, 0xfe, 0xf7, 0xf5, 0xff, 0x00, 0x28, 
-    0x01, 0xd0, 0x01, 0x34, 0xa4, 0xb2, 0xfa, 0x23, 0x9b, 0x00, 0x9c, 0x42, 
-    0x27, 0xd9, 0xfe, 0xf7, 0xeb, 0xff, 0x00, 0x28, 0x02, 0xd0, 0x23, 0x4b, 
-    0x9c, 0x42, 0x20, 0xd9, 0xfe, 0xf7, 0xe4, 0xff, 0x21, 0x4e, 0x22, 0x4f, 
-    0x43, 0x1e, 0x98, 0x41, 0x3a, 0x68, 0x33, 0x68, 0x40, 0x42, 0x99, 0x18, 
-    0x15, 0x4a, 0x04, 0x40, 0x12, 0x68, 0x00, 0x92, 0x01, 0x3a, 0x91, 0x42, 
-    0x01, 0xda, 0x01, 0x33, 0x33, 0x60, 0x33, 0x68, 0x0c, 0x2b, 0x08, 0xdd, 
-    0x18, 0x20, 0x30, 0x21, 0xff, 0xf7, 0x18, 0xfc, 0x00, 0x23, 0x33, 0x60, 
-    0x3b, 0x68, 0x0d, 0x33, 0x3b, 0x60, 0x02, 0x23, 0x2b, 0x60, 0xfe, 0xf7, 
-    0x8d, 0xff, 0x00, 0x28, 0x01, 0xd0, 0x03, 0x23, 0x2b, 0x60, 0xfe, 0xf7, 
-    0x8f, 0xff, 0x00, 0x28, 0x00, 0xd1, 0x63, 0xe7, 0x04, 0x23, 0x2b, 0x60, 
-    0x60, 0xe7, 0x03, 0x22, 0x00, 0xe0, 0x02, 0x22, 0x0b, 0x4b, 0x1a, 0x60, 
-    0xf7, 0xbd, 0xc0, 0x46, 0xbc, 0x0b, 0x00, 0x10, 0xb8, 0x0b, 0x00, 0x10, 
-    0x10, 0x80, 0x00, 0x00, 0x10, 0x01, 0x00, 0x10, 0x75, 0xe4, 0x03, 0x00, 
-    0xff, 0xff, 0x00, 0x00, 0xef, 0x7b, 0x00, 0x00, 0x30, 0x75, 0x00, 0x00, 
-    0xc4, 0x0c, 0x00, 0x10, 0xc0, 0x0c, 0x00, 0x10, 0x14, 0x01, 0x00, 0x10, 
-    0x25, 0x4a, 0x80, 0x23, 0x10, 0xb5, 0x5b, 0x02, 0x9a, 0x42, 0x02, 0xd9, 
-    0x23, 0x4b, 0x01, 0x22, 0x1a, 0x70, 0x62, 0xb6, 0x22, 0x4b, 0x05, 0x22, 
-    0x1a, 0x60, 0xff, 0xf7, 0x49, 0xf9, 0xfe, 0xf7, 0xbb, 0xfe, 0x20, 0x4a, 
-    0x20, 0x4b, 0x00, 0x20, 0x01, 0x1c, 0x1a, 0x60, 0x00, 0xf0, 0xbe, 0xf8, 
-    0x1e, 0x48, 0x00, 0xf0, 0xb7, 0xf8, 0x02, 0xf0, 0xd0, 0xfc, 0x1d, 0x4c, 
-    0x00, 0x28, 0x06, 0xd0, 0xf8, 0x23, 0x1b, 0x02, 0x1b, 0x48, 0x23, 0x60, 
-    0x00, 0xf0, 0xc2, 0xf8, 0xfe, 0xe7, 0xfc, 0x23, 0xdb, 0x00, 0x19, 0x48, 
-    0x23, 0x60, 0x00, 0xf0, 0xbb, 0xf8, 0x18, 0x4b, 0x23, 0x60, 0xff, 0xf7, 
-    0xf3, 0xf8, 0x17, 0x4b, 0x1b, 0x68, 0x02, 0x2b, 0x09, 0xd0, 0x03, 0x2b, 
-    0x0d, 0xd0, 0x01, 0x2b, 0xf9, 0xd1, 0x14, 0x4b, 0x00, 0x22, 0x1a, 0x60, 
-    0xff, 0xf7, 0xfe, 0xfe, 0xf1, 0xe7, 0x11, 0x4b, 0x00, 0x22, 0x1a, 0x60, 
-    0xff, 0xf7, 0xc4, 0xfc, 0xeb, 0xe7, 0x0e, 0x4b, 0x00, 0x22, 0x1a, 0x60, 
-    0xff, 0xf7, 0x0c, 0xfd, 0xe5, 0xe7, 0xc0, 0x46, 0xd9, 0xbd, 0x03, 0x00, 
-    0xc8, 0x0c, 0x00, 0x10, 0x10, 0xe0, 0x00, 0xe0, 0x94, 0xdf, 0x03, 0x00, 
-    0xcc, 0x0c, 0x00, 0x10, 0x91, 0xe4, 0x03, 0x00, 0x10, 0x01, 0x00, 0x10, 
-    0x2b, 0xe4, 0x03, 0x00, 0x9a, 0xe4, 0x03, 0x00, 0xff, 0xff, 0x00, 0x00, 
-    0x14, 0x01, 0x00, 0x10, 0xb8, 0x0b, 0x00, 0x10, 0x10, 0xb5, 0x04, 0x4b, 
-    0x1c, 0x68, 0xa3, 0x78, 0xd3, 0x1a, 0xdb, 0xb2, 0x22, 0x1c, 0xff, 0xf7, 
-    0x09, 0xf8, 0x10, 0xbd, 0xcc, 0x0c, 0x00, 0x10, 0x06, 0x49, 0x07, 0x4b, 
-    0x09, 0x68, 0x1a, 0x78, 0x49, 0x78, 0xb0, 0x20, 0x40, 0x1a, 0x82, 0x42, 
-    0x01, 0xdb, 0x00, 0x22, 0x00, 0xe0, 0x8a, 0x18, 0x1a, 0x70, 0x70, 0x47, 
-    0xcc, 0x0c, 0x00, 0x10, 0xd1, 0x0c, 0x00, 0x10, 0xf8, 0xb5, 0x05, 0x1e, 
-    0x0e, 0x2d, 0x21, 0xd8, 0x00, 0xf0, 0xb6, 0xf9, 0x38, 0x20, 0x20, 0x20, 
-    0x20, 0x20, 0x20, 0x20, 0x0e, 0x20, 0x08, 0x20, 0x20, 0x1c, 0x38, 0x00, 
-    0x18, 0x4b, 0x00, 0x22, 0x1a, 0x70, 0xff, 0xf7, 0xdb, 0xff, 0x29, 0xe0, 
-    0x16, 0x4a, 0x15, 0x4b, 0x12, 0x68, 0x18, 0x78, 0x12, 0x78, 0x80, 0x1a, 
-    0xc0, 0xb2, 0x18, 0x70, 0x13, 0x4b, 0x20, 0x22, 0x19, 0x78, 0xff, 0xf7, 
-    0xc1, 0xff, 0x1b, 0xe0, 0x0e, 0x4b, 0x00, 0x22, 0x1a, 0x70, 0x17, 0xe0, 
-    0x0d, 0x4f, 0x0c, 0x4c, 0x3a, 0x68, 0x20, 0x78, 0x13, 0x78, 0xdc, 0x22, 
-    0xd3, 0x1a, 0x0b, 0x4e, 0x98, 0x42, 0x04, 0xdb, 0x00, 0x23, 0x23, 0x70, 
-    0xff, 0xf7, 0xba, 0xff, 0x20, 0x78, 0x2a, 0x1c, 0x31, 0x78, 0xff, 0xf7, 
-    0xa9, 0xff, 0x3b, 0x68, 0x1a, 0x78, 0x23, 0x78, 0xd3, 0x18, 0x23, 0x70, 
-    0xf8, 0xbd, 0xc0, 0x46, 0xd0, 0x0c, 0x00, 0x10, 0xcc, 0x0c, 0x00, 0x10, 
-    0xd1, 0x0c, 0x00, 0x10, 0x10, 0xb5, 0x04, 0x1c, 0x20, 0x78, 0x00, 0x28, 
-    0x03, 0xd0, 0x01, 0x34, 0xff, 0xf7, 0xb2, 0xff, 0xf8, 0xe7, 0x10, 0xbd, 
-    0x08, 0xb5, 0xff, 0xf7, 0xf3, 0xff, 0x08, 0xbd, 0x02, 0x4b, 0x18, 0x70, 
-    0x02, 0x4b, 0x19, 0x70, 0x70, 0x47, 0xc0, 0x46, 0xd0, 0x0c, 0x00, 0x10, 
-    0xd1, 0x0c, 0x00, 0x10, 0x08, 0xb5, 0x0d, 0x20, 0xff, 0xf7, 0x9e, 0xff, 
-    0x0a, 0x20, 0xff, 0xf7, 0x9b, 0xff, 0x08, 0xbd, 0x08, 0xb5, 0xff, 0xf7, 
-    0xdd, 0xff, 0xff, 0xf7, 0xf3, 0xff, 0x08, 0xbd, 0x00, 0x00, 0x00, 0x00, 
-    0xf0, 0xb5, 0x56, 0x46, 0x4d, 0x46, 0x44, 0x46, 0x5f, 0x46, 0xf0, 0xb4, 
-    0x52, 0x4a, 0x4f, 0x00, 0x7f, 0x0d, 0x83, 0xb0, 0xbe, 0x18, 0x04, 0x1c, 
-    0x0d, 0x1c, 0x89, 0x46, 0x8a, 0x46, 0x80, 0x46, 0x01, 0x97, 0x13, 0x2e, 
-    0x2a, 0xdc, 0x00, 0x2e, 0x56, 0xdb, 0x4c, 0x4f, 0x02, 0x1c, 0x37, 0x41, 
-    0x3b, 0x1c, 0x0b, 0x40, 0x03, 0x43, 0x9c, 0x46, 0xbb, 0x46, 0x67, 0x46, 
-    0x0b, 0x1c, 0x00, 0x2f, 0x13, 0xd0, 0x42, 0x4b, 0x40, 0x4a, 0x01, 0xf0, 
-    0xcf, 0xf8, 0x41, 0x4a, 0x41, 0x4b, 0x00, 0xf0, 0xa9, 0xf9, 0x00, 0x28, 
-    0x07, 0xd0, 0x00, 0x2d, 0x4e, 0xdb, 0x53, 0x46, 0x5f, 0x46, 0xbb, 0x43, 
-    0x00, 0x22, 0x99, 0x46, 0x90, 0x46, 0x4b, 0x46, 0x42, 0x46, 0x10, 0x1c, 
-    0x19, 0x1c, 0x03, 0xb0, 0x3c, 0xbc, 0x90, 0x46, 0x99, 0x46, 0xa2, 0x46, 
-    0xab, 0x46, 0xf0, 0xbd, 0x33, 0x2e, 0x0b, 0xdd, 0x0b, 0x1c, 0x80, 0x21, 
-    0x02, 0x1c, 0xc9, 0x00, 0x8e, 0x42, 0xee, 0xd1, 0x29, 0x1c, 0x01, 0xf0, 
-    0xab, 0xf8, 0x02, 0x1c, 0x0b, 0x1c, 0xe8, 0xe7, 0x01, 0x9f, 0x31, 0x4a, 
-    0xbb, 0x18, 0x01, 0x22, 0x52, 0x42, 0xda, 0x40, 0x93, 0x46, 0x5f, 0x46, 
-    0x02, 0x1c, 0x0b, 0x1c, 0x07, 0x42, 0xdc, 0xd0, 0x26, 0x4b, 0x25, 0x4a, 
-    0x01, 0xf0, 0x98, 0xf8, 0x25, 0x4a, 0x26, 0x4b, 0x00, 0xf0, 0x72, 0xf9, 
-    0x00, 0x28, 0xd0, 0xd0, 0x00, 0x2d, 0x1d, 0xdb, 0x42, 0x46, 0x5b, 0x46, 
-    0x9a, 0x43, 0x90, 0x46, 0xd1, 0x46, 0x4b, 0x46, 0x42, 0x46, 0xc8, 0xe7, 
-    0x1c, 0x4b, 0x1b, 0x4a, 0x01, 0xf0, 0x84, 0xf8, 0x1b, 0x4a, 0x1c, 0x4b, 
-    0x00, 0xf0, 0x5e, 0xf9, 0x00, 0x28, 0xbc, 0xd0, 0x00, 0x2d, 0x17, 0xdb, 
-    0x00, 0x27, 0xb8, 0x46, 0xb9, 0x46, 0xb6, 0xe7, 0x80, 0x23, 0x5b, 0x03, 
-    0x33, 0x41, 0x5e, 0x19, 0xb2, 0x46, 0xaa, 0xe7, 0x14, 0x2e, 0x19, 0xd0, 
-    0x16, 0x4b, 0x01, 0x9a, 0x9f, 0x1a, 0x01, 0x23, 0xbb, 0x40, 0x1b, 0x19, 
-    0x9c, 0x42, 0x0f, 0xd9, 0x6f, 0x1c, 0xba, 0x46, 0x98, 0x46, 0xd3, 0xe7, 
-    0x6b, 0x00, 0x5b, 0x08, 0x1c, 0x43, 0x02, 0xd1, 0x00, 0x27, 0xb8, 0x46, 
-    0x9b, 0xe7, 0x0e, 0x4f, 0x00, 0x23, 0x98, 0x46, 0xb9, 0x46, 0x96, 0xe7, 
-    0x98, 0x46, 0xc5, 0xe7, 0x6b, 0x1c, 0x9a, 0x46, 0xc2, 0xe7, 0xc0, 0x46, 
-    0xc0, 0x46, 0xc0, 0x46, 0x9c, 0x75, 0x00, 0x88, 0x3c, 0xe4, 0x37, 0x7e, 
-    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0xfc, 0xff, 0xff, 
-    0xff, 0xff, 0x0f, 0x00, 0xed, 0xfb, 0xff, 0xff, 0x33, 0x04, 0x00, 0x00, 
-    0x00, 0x00, 0xf0, 0xbf, 0xc0, 0x46, 0xc0, 0x46, 0x08, 0x4b, 0x10, 0xb5, 
-    0x04, 0x1c, 0x00, 0x2b, 0x02, 0xd0, 0x00, 0x21, 0x00, 0xe0, 0x00, 0xbf, 
-    0x05, 0x4b, 0x18, 0x68, 0x83, 0x6a, 0x00, 0x2b, 0x00, 0xd0, 0x98, 0x47, 
-    0x20, 0x1c, 0xfd, 0xf7, 0x9f, 0xfd, 0xc0, 0x46, 0x00, 0x00, 0x00, 0x00, 
-    0x00, 0xe5, 0x03, 0x00, 0x70, 0xb5, 0x0e, 0x4b, 0x0e, 0x4d, 0x00, 0x24, 
-    0xed, 0x1a, 0xad, 0x10, 0x1e, 0x1c, 0xac, 0x42, 0x04, 0xd0, 0xa3, 0x00, 
-    0xf3, 0x58, 0x98, 0x47, 0x01, 0x34, 0xf8, 0xe7, 0x02, 0xf0, 0x08, 0xfa, 
-    0x08, 0x4b, 0x09, 0x4d, 0x00, 0x24, 0xed, 0x1a, 0xad, 0x10, 0x1e, 0x1c, 
-    0xac, 0x42, 0x04, 0xd0, 0xa3, 0x00, 0xf3, 0x58, 0x98, 0x47, 0x01, 0x34, 
-    0xf8, 0xe7, 0x70, 0xbd, 0x90, 0xe5, 0x03, 0x00, 0x90, 0xe5, 0x03, 0x00, 
-    0x90, 0xe5, 0x03, 0x00, 0x9c, 0xe5, 0x03, 0x00, 0x08, 0xb5, 0x03, 0x4b, 
-    0x01, 0x1c, 0x18, 0x68, 0x00, 0xf0, 0x04, 0xf8, 0x08, 0xbd, 0xc0, 0x46, 
-    0x78, 0x01, 0x00, 0x10, 0x30, 0xb5, 0x00, 0x29, 0x40, 0xd0, 0x04, 0x39, 
-    0x0b, 0x68, 0x00, 0x2b, 0x00, 0xda, 0xc9, 0x18, 0x1e, 0x4a, 0x13, 0x68, 
-    0x14, 0x1c, 0x00, 0x2b, 0x02, 0xd1, 0x4b, 0x60, 0x11, 0x60, 0x33, 0xe0, 
-    0x99, 0x42, 0x0f, 0xd2, 0x08, 0x68, 0x0a, 0x18, 0x9a, 0x42, 0x05, 0xd1, 
-    0x13, 0x68, 0x52, 0x68, 0xc0, 0x18, 0x08, 0x60, 0x4a, 0x60, 0x00, 0xe0, 
-    0x4b, 0x60, 0x21, 0x60, 0x24, 0xe0, 0x8a, 0x42, 0x03, 0xd8, 0x13, 0x1c, 
-    0x5a, 0x68, 0x00, 0x2a, 0xf9, 0xd1, 0x1d, 0x68, 0x5c, 0x19, 0x8c, 0x42, 
-    0x0b, 0xd1, 0x09, 0x68, 0x69, 0x18, 0x58, 0x18, 0x19, 0x60, 0x90, 0x42, 
-    0x14, 0xd1, 0x14, 0x68, 0x52, 0x68, 0x09, 0x19, 0x19, 0x60, 0x5a, 0x60, 
-    0x0e, 0xe0, 0x8c, 0x42, 0x02, 0xd9, 0x0c, 0x23, 0x03, 0x60, 0x09, 0xe0, 
-    0x08, 0x68, 0x0c, 0x18, 0x94, 0x42, 0x03, 0xd1, 0x14, 0x68, 0x52, 0x68, 
-    0x00, 0x19, 0x08, 0x60, 0x4a, 0x60, 0x59, 0x60, 0x30, 0xbd, 0xc0, 0x46, 
-    0xd4, 0x0c, 0x00, 0x10, 0x03, 0x1c, 0x0a, 0x78, 0x01, 0x31, 0x1a, 0x70, 
-    0x01, 0x33, 0x00, 0x2a, 0xf9, 0xd1, 0x70, 0x47, 0x02, 0xb4, 0x71, 0x46, 
-    0x49, 0x08, 0x49, 0x00, 0x09, 0x5c, 0x49, 0x00, 0x8e, 0x44, 0x02, 0xbc, 
-    0x70, 0x47, 0xc0, 0x46, 0x00, 0x29, 0x34, 0xd0, 0x01, 0x23, 0x00, 0x22, 
-    0x10, 0xb4, 0x88, 0x42, 0x2c, 0xd3, 0x01, 0x24, 0x24, 0x07, 0xa1, 0x42, 
-    0x04, 0xd2, 0x81, 0x42, 0x02, 0xd2, 0x09, 0x01, 0x1b, 0x01, 0xf8, 0xe7, 
-    0xe4, 0x00, 0xa1, 0x42, 0x04, 0xd2, 0x81, 0x42, 0x02, 0xd2, 0x49, 0x00, 
-    0x5b, 0x00, 0xf8, 0xe7, 0x88, 0x42, 0x01, 0xd3, 0x40, 0x1a, 0x1a, 0x43, 
-    0x4c, 0x08, 0xa0, 0x42, 0x02, 0xd3, 0x00, 0x1b, 0x5c, 0x08, 0x22, 0x43, 
-    0x8c, 0x08, 0xa0, 0x42, 0x02, 0xd3, 0x00, 0x1b, 0x9c, 0x08, 0x22, 0x43, 
-    0xcc, 0x08, 0xa0, 0x42, 0x02, 0xd3, 0x00, 0x1b, 0xdc, 0x08, 0x22, 0x43, 
-    0x00, 0x28, 0x03, 0xd0, 0x1b, 0x09, 0x01, 0xd0, 0x09, 0x09, 0xe3, 0xe7, 
-    0x10, 0x1c, 0x10, 0xbc, 0x70, 0x47, 0x00, 0x28, 0x01, 0xd0, 0x00, 0x20, 
-    0xc0, 0x43, 0x07, 0xb4, 0x02, 0x48, 0x02, 0xa1, 0x40, 0x18, 0x02, 0x90, 
-    0x03, 0xbd, 0xc0, 0x46, 0x19, 0x00, 0x00, 0x00, 0x00, 0x29, 0xf0, 0xd0, 
-    0x03, 0xb5, 0xff, 0xf7, 0xb9, 0xff, 0x0e, 0xbc, 0x42, 0x43, 0x89, 0x1a, 
-    0x18, 0x47, 0xc0, 0x46, 0x70, 0x47, 0xc0, 0x46, 0x84, 0x46, 0x10, 0x1c, 
-    0x62, 0x46, 0x8c, 0x46, 0x19, 0x1c, 0x63, 0x46, 0x00, 0xe0, 0xc0, 0x46, 
-    0x1f, 0xb5, 0x01, 0xf0, 0x2b, 0xfb, 0x00, 0x28, 0x01, 0xd4, 0x00, 0x21, 
-    0xc8, 0x42, 0x1f, 0xbd, 0x10, 0xb5, 0x01, 0xf0, 0x5b, 0xfa, 0x40, 0x42, 
-    0x01, 0x30, 0x10, 0xbd, 0x10, 0xb5, 0x01, 0xf0, 0x1d, 0xfb, 0x00, 0x28, 
-    0x01, 0xdb, 0x00, 0x20, 0x10, 0xbd, 0x01, 0x20, 0x10, 0xbd, 0xc0, 0x46, 
-    0x10, 0xb5, 0x01, 0xf0, 0x13, 0xfb, 0x00, 0x28, 0x01, 0xdd, 0x00, 0x20, 
-    0x10, 0xbd, 0x01, 0x20, 0x10, 0xbd, 0xc0, 0x46, 0x10, 0xb5, 0x01, 0xf0, 
-    0x8b, 0xfa, 0x00, 0x28, 0x01, 0xdc, 0x00, 0x20, 0x10, 0xbd, 0x01, 0x20, 
-    0x10, 0xbd, 0xc0, 0x46, 0x10, 0xb5, 0x01, 0xf0, 0x81, 0xfa, 0x00, 0x28, 
-    0x01, 0xda, 0x00, 0x20, 0x10, 0xbd, 0x01, 0x20, 0x10, 0xbd, 0xc0, 0x46, 
-    0x84, 0x46, 0x08, 0x1c, 0x61, 0x46, 0xff, 0xe7, 0x1f, 0xb5, 0x00, 0xf0, 
-    0x4f, 0xfb, 0x00, 0x28, 0x01, 0xd4, 0x00, 0x21, 0xc8, 0x42, 0x1f, 0xbd, 
-    0x10, 0xb5, 0x00, 0xf0, 0xd5, 0xfa, 0x40, 0x42, 0x01, 0x30, 0x10, 0xbd, 
-    0x10, 0xb5, 0x00, 0xf0, 0x41, 0xfb, 0x00, 0x28, 0x01, 0xdb, 0x00, 0x20, 
-    0x10, 0xbd, 0x01, 0x20, 0x10, 0xbd, 0xc0, 0x46, 0x10, 0xb5, 0x00, 0xf0, 
-    0x37, 0xfb, 0x00, 0x28, 0x01, 0xdd, 0x00, 0x20, 0x10, 0xbd, 0x01, 0x20, 
-    0x10, 0xbd, 0xc0, 0x46, 0x10, 0xb5, 0x00, 0xf0, 0xe5, 0xfa, 0x00, 0x28, 
-    0x01, 0xdc, 0x00, 0x20, 0x10, 0xbd, 0x01, 0x20, 0x10, 0xbd, 0xc0, 0x46, 
-    0x10, 0xb5, 0x00, 0xf0, 0xdb, 0xfa, 0x00, 0x28, 0x01, 0xda, 0x00, 0x20, 
-    0x10, 0xbd, 0x01, 0x20, 0x10, 0xbd, 0xc0, 0x46, 0x9e, 0x21, 0x10, 0xb5, 
-    0xc9, 0x05, 0x04, 0x1c, 0xff, 0xf7, 0xf0, 0xff, 0x00, 0x28, 0x03, 0xd1, 
-    0x20, 0x1c, 0x00, 0xf0, 0xfd, 0xfd, 0x10, 0xbd, 0x9e, 0x21, 0xc9, 0x05, 
-    0x20, 0x1c, 0x00, 0xf0, 0x81, 0xfc, 0x00, 0xf0, 0xf5, 0xfd, 0x80, 0x23, 
-    0x1b, 0x06, 0xc0, 0x18, 0xf3, 0xe7, 0xc0, 0x46, 0xf8, 0xb5, 0x43, 0x02, 
-    0x44, 0x00, 0xc5, 0x0f, 0x4e, 0x02, 0x48, 0x00, 0x24, 0x0e, 0x2a, 0x1c, 
-    0x9b, 0x09, 0x00, 0x0e, 0xc9, 0x0f, 0xb6, 0x09, 0x8d, 0x42, 0x5b, 0xd0, 
-    0x22, 0x1a, 0x00, 0x2a, 0x00, 0xdc, 0x89, 0xe0, 0x00, 0x28, 0x1d, 0xd1, 
-    0x00, 0x2e, 0x00, 0xd0, 0x75, 0xe0, 0x58, 0x07, 0x04, 0xd0, 0x0f, 0x22, 
-    0x1a, 0x40, 0x04, 0x2a, 0x00, 0xd0, 0x04, 0x33, 0x80, 0x21, 0xc9, 0x04, 
-    0x19, 0x40, 0x2a, 0x1c, 0x00, 0x29, 0x3a, 0xd0, 0x01, 0x34, 0xff, 0x2c, 
-    0x00, 0xd1, 0x7f, 0xe0, 0x9b, 0x01, 0x5b, 0x0a, 0x5b, 0x02, 0xe4, 0xb2, 
-    0xe4, 0x05, 0x58, 0x0a, 0xd2, 0x07, 0x20, 0x43, 0x10, 0x43, 0xf8, 0xbd, 
-    0xff, 0x2c, 0xe2, 0xd0, 0x80, 0x21, 0xc9, 0x04, 0x0e, 0x43, 0x1b, 0x2a, 
-    0x00, 0xdd, 0x2d, 0xe1, 0x31, 0x1c, 0x20, 0x20, 0xd1, 0x40, 0x82, 0x1a, 
-    0x96, 0x40, 0x72, 0x1e, 0x96, 0x41, 0x0e, 0x43, 0x9b, 0x1b, 0x58, 0x01, 
-    0xd1, 0xd5, 0x9b, 0x01, 0x9f, 0x09, 0x38, 0x1c, 0x01, 0xf0, 0x60, 0xfb, 
-    0x42, 0x1f, 0x97, 0x40, 0x94, 0x42, 0x5b, 0xdc, 0x14, 0x1b, 0x1f, 0x23, 
-    0x1b, 0x1b, 0x3a, 0x1c, 0x9f, 0x40, 0x61, 0x1c, 0x3b, 0x1c, 0xca, 0x40, 
-    0x5f, 0x1e, 0xbb, 0x41, 0x13, 0x43, 0x00, 0x24, 0xbb, 0xe7, 0x13, 0x1e, 
-    0xb9, 0xd1, 0x00, 0x23, 0x00, 0x22, 0xdb, 0x08, 0xff, 0x2c, 0x04, 0xd1, 
-    0x00, 0x2b, 0x43, 0xd0, 0x80, 0x20, 0xc0, 0x03, 0x03, 0x43, 0x5b, 0x02, 
-    0x5b, 0x0a, 0xbf, 0xe7, 0x21, 0x1a, 0x00, 0x29, 0x40, 0xdd, 0x00, 0x28, 
-    0x23, 0xd0, 0xff, 0x2c, 0xa5, 0xd0, 0x80, 0x20, 0xc0, 0x04, 0x06, 0x43, 
-    0x1b, 0x29, 0x00, 0xdd, 0xee, 0xe0, 0x30, 0x1c, 0x20, 0x27, 0xc8, 0x40, 
-    0x79, 0x1a, 0x8e, 0x40, 0x71, 0x1e, 0x8e, 0x41, 0x06, 0x43, 0x9b, 0x19, 
-    0x59, 0x01, 0x00, 0xd4, 0x93, 0xe7, 0x01, 0x34, 0xff, 0x2c, 0x55, 0xd0, 
-    0x71, 0x49, 0x01, 0x22, 0x1a, 0x40, 0x0b, 0x40, 0x5b, 0x08, 0x13, 0x43, 
-    0x89, 0xe7, 0x01, 0x3a, 0x00, 0x2a, 0xb1, 0xd0, 0xff, 0x2c, 0xa4, 0xd1, 
-    0x83, 0xe7, 0x00, 0x2e, 0x00, 0xd1, 0x80, 0xe7, 0x01, 0x39, 0x00, 0x29, 
-    0xe5, 0xd0, 0xff, 0x2c, 0xd8, 0xd1, 0x7a, 0xe7, 0x00, 0x2a, 0x1b, 0xd1, 
-    0x62, 0x1c, 0xd2, 0xb2, 0x01, 0x2a, 0x4b, 0xdd, 0x9f, 0x1b, 0x7a, 0x01, 
-    0x23, 0xd5, 0xf7, 0x1a, 0x0d, 0x1c, 0x9e, 0xe7, 0x00, 0x23, 0x7f, 0xe7, 
-    0x5f, 0x4b, 0xa4, 0x1a, 0x3b, 0x40, 0x68, 0xe7, 0x00, 0x29, 0x46, 0xd1, 
-    0x61, 0x1c, 0xc8, 0xb2, 0x01, 0x28, 0x29, 0xdd, 0xff, 0x29, 0x24, 0xd0, 
-    0xf3, 0x18, 0x5b, 0x08, 0x0c, 0x1c, 0x5c, 0xe7, 0x00, 0x2c, 0x13, 0xd0, 
-    0xff, 0x28, 0x18, 0xd0, 0x80, 0x24, 0xe4, 0x04, 0x52, 0x42, 0x23, 0x43, 
-    0x1b, 0x2a, 0x4d, 0xdd, 0x01, 0x23, 0xf3, 0x1a, 0x04, 0x1c, 0x0d, 0x1c, 
-    0x79, 0xe7, 0x00, 0x2f, 0x00, 0xd0, 0x7a, 0xe7, 0x00, 0x23, 0x00, 0x22, 
-    0x00, 0x24, 0x8e, 0xe7, 0x00, 0x2b, 0x3b, 0xd0, 0xd2, 0x43, 0x00, 0x2a, 
-    0xef, 0xd0, 0xff, 0x28, 0xea, 0xd1, 0x33, 0x1c, 0xff, 0x24, 0x0d, 0x1c, 
-    0x3b, 0xe7, 0xff, 0x24, 0x00, 0x23, 0x80, 0xe7, 0x00, 0x2c, 0x5c, 0xd1, 
-    0x00, 0x2b, 0x00, 0xd1, 0x80, 0xe0, 0x00, 0x2e, 0x00, 0xd1, 0x30, 0xe7, 
-    0x9b, 0x19, 0x58, 0x01, 0x00, 0xd4, 0x2c, 0xe7, 0x3f, 0x4a, 0x01, 0x24, 
-    0x13, 0x40, 0x28, 0xe7, 0x00, 0x2c, 0x15, 0xd1, 0x00, 0x2b, 0x40, 0xd1, 
-    0x00, 0x2e, 0x63, 0xd0, 0x33, 0x1c, 0x0d, 0x1c, 0x1f, 0xe7, 0x00, 0x2c, 
-    0x21, 0xd1, 0x00, 0x2b, 0x54, 0xd0, 0xc9, 0x43, 0x00, 0x29, 0x04, 0xd0, 
-    0xff, 0x28, 0x4c, 0xd0, 0x1b, 0x29, 0x58, 0xdd, 0x01, 0x23, 0x9b, 0x19, 
-    0x04, 0x1c, 0x79, 0xe7, 0x00, 0x2b, 0x19, 0xd1, 0x00, 0x2e, 0x48, 0xd0, 
-    0x33, 0x1c, 0x0d, 0x1c, 0xff, 0x24, 0x08, 0xe7, 0x33, 0x1c, 0x04, 0x1c, 
-    0x0d, 0x1c, 0x04, 0xe7, 0x1c, 0x1c, 0x20, 0x25, 0xd4, 0x40, 0xaa, 0x1a, 
-    0x93, 0x40, 0x5a, 0x1e, 0x93, 0x41, 0x23, 0x43, 0xa9, 0xe7, 0xff, 0x28, 
-    0x2f, 0xd0, 0x80, 0x24, 0xe4, 0x04, 0x49, 0x42, 0x23, 0x43, 0xdd, 0xe7, 
-    0xff, 0x24, 0x00, 0x2e, 0x00, 0xd1, 0xf0, 0xe6, 0x80, 0x22, 0xdb, 0x08, 
-    0xd2, 0x03, 0x13, 0x42, 0x04, 0xd0, 0xf6, 0x08, 0x16, 0x42, 0x01, 0xd1, 
-    0x33, 0x1c, 0x0d, 0x1c, 0xdb, 0x00, 0xff, 0x24, 0xe3, 0xe6, 0x00, 0x2e, 
-    0x00, 0xd1, 0xe0, 0xe6, 0x9a, 0x1b, 0x50, 0x01, 0x00, 0xd4, 0x20, 0xe7, 
-    0xf3, 0x1a, 0x0d, 0x1c, 0xd9, 0xe6, 0x00, 0x2b, 0x0d, 0xd0, 0xff, 0x24, 
-    0x00, 0x2e, 0x00, 0xd1, 0xd3, 0xe6, 0x80, 0x22, 0xdb, 0x08, 0xd2, 0x03, 
-    0x13, 0x42, 0xe7, 0xd0, 0xf6, 0x08, 0x16, 0x42, 0xe4, 0xd1, 0x33, 0x1c, 
-    0xe2, 0xe7, 0x33, 0x1c, 0xff, 0x24, 0xc6, 0xe6, 0x33, 0x1c, 0x04, 0x1c, 
-    0xc3, 0xe6, 0x80, 0x23, 0x00, 0x22, 0x9b, 0x04, 0xff, 0x24, 0x06, 0xe7, 
-    0x23, 0x1c, 0x00, 0x22, 0x03, 0xe7, 0x1c, 0x1c, 0x20, 0x27, 0xcc, 0x40, 
-    0x79, 0x1a, 0x8b, 0x40, 0x59, 0x1e, 0x8b, 0x41, 0x23, 0x43, 0x9e, 0xe7, 
-    0x33, 0x1c, 0xb0, 0xe6, 0x01, 0x26, 0x16, 0xe7, 0x01, 0x26, 0xd7, 0xe6, 
-    0xff, 0xff, 0xff, 0xfb, 0xf0, 0xb5, 0x5f, 0x46, 0x56, 0x46, 0x4d, 0x46, 
-    0x44, 0x46, 0xf0, 0xb4, 0x46, 0x02, 0x45, 0x00, 0xc0, 0x0f, 0x85, 0xb0, 
-    0x0f, 0x1c, 0x76, 0x0a, 0x2d, 0x0e, 0x80, 0x46, 0x41, 0xd0, 0xff, 0x2d, 
-    0x26, 0xd0, 0x80, 0x24, 0x24, 0x04, 0x00, 0x21, 0x26, 0x43, 0xf6, 0x00, 
-    0x7f, 0x3d, 0x89, 0x46, 0x8b, 0x46, 0xf9, 0x0f, 0x7c, 0x02, 0x78, 0x00, 
-    0x64, 0x0a, 0x00, 0x0e, 0x00, 0x91, 0x8a, 0x46, 0x3c, 0xd0, 0xff, 0x28, 
-    0x34, 0xd0, 0x80, 0x23, 0x1b, 0x04, 0x1c, 0x43, 0x00, 0x23, 0xe4, 0x00, 
-    0x7f, 0x38, 0x01, 0x93, 0x00, 0x9f, 0x43, 0x46, 0x01, 0x9a, 0x7b, 0x40, 
-    0x49, 0x46, 0x9c, 0x46, 0x11, 0x43, 0x0f, 0x29, 0x00, 0xd9, 0x71, 0xe0, 
-    0x76, 0x4f, 0x89, 0x00, 0x7f, 0x58, 0xbf, 0x46, 0x00, 0x2e, 0x3e, 0xd1, 
-    0x08, 0x22, 0x02, 0x23, 0x91, 0x46, 0x9b, 0x46, 0xd9, 0xe7, 0x5a, 0x46, 
-    0x34, 0x1c, 0xc2, 0x46, 0x01, 0x92, 0x01, 0x99, 0x02, 0x29, 0x37, 0xd0, 
-    0x03, 0x29, 0x00, 0xd1, 0xcf, 0xe0, 0x01, 0x29, 0x00, 0xd0, 0xab, 0xe0, 
-    0x53, 0x46, 0x0b, 0x40, 0x00, 0x22, 0x00, 0x26, 0x32, 0xe0, 0x00, 0x2e, 
-    0x19, 0xd1, 0x04, 0x21, 0x01, 0x22, 0x89, 0x46, 0x93, 0x46, 0xc0, 0xe7, 
-    0x22, 0x1c, 0x53, 0x1e, 0x9a, 0x41, 0x02, 0x32, 0x01, 0x92, 0xcb, 0xe7, 
-    0x01, 0x27, 0x01, 0x97, 0x00, 0x2c, 0xc7, 0xd0, 0x20, 0x1c, 0x01, 0xf0, 
-    0xd9, 0xf9, 0x43, 0x1f, 0x9c, 0x40, 0x76, 0x23, 0x5b, 0x42, 0x00, 0x21, 
-    0x18, 0x1a, 0x01, 0x91, 0xbc, 0xe7, 0x30, 0x1c, 0x01, 0xf0, 0xce, 0xf9, 
-    0x76, 0x25, 0x43, 0x1f, 0x9e, 0x40, 0x6d, 0x42, 0x00, 0x23, 0x2d, 0x1a, 
-    0x99, 0x46, 0x9b, 0x46, 0x9f, 0xe7, 0x0c, 0x23, 0x03, 0x21, 0x99, 0x46, 
-    0x8b, 0x46, 0x9a, 0xe7, 0xd4, 0x46, 0x01, 0x23, 0x67, 0x46, 0x3b, 0x40, 
-    0xff, 0x22, 0x00, 0x26, 0x76, 0x02, 0xd2, 0x05, 0x70, 0x0a, 0xdb, 0x07, 
-    0x10, 0x43, 0x18, 0x43, 0x05, 0xb0, 0x3c, 0xbc, 0x90, 0x46, 0x99, 0x46, 
-    0xa2, 0x46, 0xab, 0x46, 0xf0, 0xbd, 0x80, 0x26, 0x00, 0x23, 0xf6, 0x03, 
-    0xff, 0x22, 0xed, 0xe7, 0x00, 0x22, 0x00, 0x26, 0xea, 0xe7, 0x80, 0x20, 
-    0xc0, 0x03, 0x06, 0x42, 0x3b, 0xd0, 0x04, 0x42, 0x39, 0xd1, 0x06, 0x1c, 
-    0x26, 0x43, 0x76, 0x02, 0x76, 0x0a, 0x00, 0x9b, 0xff, 0x22, 0xdd, 0xe7, 
-    0x28, 0x1a, 0x03, 0x90, 0x76, 0x01, 0x64, 0x01, 0xa6, 0x42, 0x39, 0xd3, 
-    0x36, 0x1b, 0x1a, 0x22, 0x01, 0x23, 0x01, 0x20, 0x31, 0x1c, 0x5b, 0x00, 
-    0x76, 0x00, 0x00, 0x29, 0x01, 0xdb, 0xb4, 0x42, 0x01, 0xd8, 0x36, 0x1b, 
-    0x03, 0x43, 0x01, 0x3a, 0x00, 0x2a, 0xf3, 0xdc, 0x74, 0x1e, 0xa6, 0x41, 
-    0x34, 0x1c, 0x1c, 0x43, 0x03, 0x9a, 0x7f, 0x32, 0x00, 0x2a, 0x27, 0xdd, 
-    0x63, 0x07, 0x04, 0xd0, 0x0f, 0x23, 0x23, 0x40, 0x04, 0x2b, 0x00, 0xd0, 
-    0x04, 0x34, 0x27, 0x01, 0x03, 0xd5, 0x2b, 0x4b, 0x03, 0x9a, 0x1c, 0x40, 
-    0x80, 0x32, 0xfe, 0x2a, 0x0b, 0xdd, 0x01, 0x23, 0x61, 0x46, 0x0b, 0x40, 
-    0xff, 0x22, 0x00, 0x26, 0xaa, 0xe7, 0x06, 0x43, 0x76, 0x02, 0x76, 0x0a, 
-    0x43, 0x46, 0xff, 0x22, 0xa4, 0xe7, 0xa4, 0x01, 0x01, 0x23, 0x67, 0x46, 
-    0x66, 0x0a, 0xd2, 0xb2, 0x3b, 0x40, 0x9d, 0xe7, 0x03, 0x9f, 0x1b, 0x22, 
-    0x01, 0x3f, 0x03, 0x97, 0x00, 0x23, 0xc2, 0xe7, 0x7e, 0x23, 0x03, 0x9f, 
-    0x5b, 0x42, 0xdb, 0x1b, 0x1b, 0x2b, 0x07, 0xdd, 0x01, 0x23, 0x61, 0x46, 
-    0x0b, 0x40, 0x00, 0x22, 0x00, 0x26, 0x8b, 0xe7, 0xd4, 0x46, 0xc5, 0xe7, 
-    0x22, 0x1c, 0xda, 0x40, 0x03, 0x9b, 0x9e, 0x33, 0x9c, 0x40, 0x23, 0x1c, 
-    0x5c, 0x1e, 0xa3, 0x41, 0x13, 0x43, 0x5a, 0x07, 0x04, 0xd0, 0x0f, 0x22, 
-    0x1a, 0x40, 0x04, 0x2a, 0x00, 0xd0, 0x04, 0x33, 0x5f, 0x01, 0x05, 0xd5, 
-    0x01, 0x23, 0x61, 0x46, 0x0b, 0x40, 0x01, 0x22, 0x00, 0x26, 0x71, 0xe7, 
-    0x9e, 0x01, 0x62, 0x46, 0x01, 0x23, 0x13, 0x40, 0x76, 0x0a, 0x00, 0x22, 
-    0x6a, 0xe7, 0x80, 0x26, 0xf6, 0x03, 0x26, 0x43, 0x76, 0x02, 0x76, 0x0a, 
-    0x53, 0x46, 0xff, 0x22, 0x62, 0xe7, 0xc0, 0x46, 0x04, 0xe5, 0x03, 0x00, 
-    0xff, 0xff, 0xff, 0xf7, 0x4a, 0x02, 0x43, 0x02, 0x70, 0xb5, 0x5c, 0x0a, 
-    0x55, 0x0a, 0x43, 0x00, 0x4a, 0x00, 0x1b, 0x0e, 0xc6, 0x0f, 0x12, 0x0e, 
-    0xc9, 0x0f, 0xff, 0x2b, 0x05, 0xd0, 0xff, 0x2a, 0x08, 0xd0, 0x01, 0x20, 
-    0x93, 0x42, 0x0b, 0xd0, 0x70, 0xbd, 0x01, 0x20, 0x00, 0x2c, 0xfb, 0xd1, 
-    0xff, 0x2a, 0xf6, 0xd1, 0x01, 0x20, 0x00, 0x2d, 0xf6, 0xd1, 0x01, 0x20, 
-    0x93, 0x42, 0xf3, 0xd1, 0xac, 0x42, 0xf1, 0xd1, 0x8e, 0x42, 0x05, 0xd0, 
-    0x00, 0x2b, 0xed, 0xd1, 0x20, 0x1c, 0x44, 0x1e, 0xa0, 0x41, 0xe9, 0xe7, 
-    0x00, 0x20, 0xe7, 0xe7, 0x4a, 0x02, 0x43, 0x02, 0xf0, 0xb5, 0x5c, 0x0a, 
-    0x55, 0x0a, 0x43, 0x00, 0x4a, 0x00, 0x1b, 0x0e, 0xc6, 0x0f, 0x12, 0x0e, 
-    0xc9, 0x0f, 0xff, 0x2b, 0x31, 0xd0, 0xff, 0x2a, 0x34, 0xd0, 0x00, 0x2b, 
-    0x16, 0xd1, 0x60, 0x42, 0x60, 0x41, 0x84, 0x46, 0x00, 0x2a, 0x14, 0xd0, 
-    0x00, 0x28, 0x20, 0xd1, 0x8e, 0x42, 0x17, 0xd1, 0x93, 0x42, 0x15, 0xdc, 
-    0x04, 0xdb, 0xac, 0x42, 0x12, 0xd8, 0x00, 0x20, 0xac, 0x42, 0x12, 0xd2, 
-    0x70, 0x42, 0x70, 0x41, 0x40, 0x42, 0x01, 0x23, 0x18, 0x43, 0x0c, 0xe0, 
-    0x00, 0x2a, 0xed, 0xd1, 0x94, 0x46, 0x6f, 0x42, 0x6f, 0x41, 0x60, 0x46, 
-    0x00, 0x28, 0x05, 0xd1, 0x00, 0x2f, 0xe5, 0xd0, 0x70, 0x42, 0x01, 0x23, 
-    0x18, 0x43, 0xf0, 0xbd, 0x00, 0x20, 0x00, 0x2f, 0xfb, 0xd1, 0x48, 0x42, 
-    0x48, 0x41, 0x40, 0x42, 0x01, 0x23, 0x18, 0x43, 0xf5, 0xe7, 0x00, 0x2c, 
-    0xcb, 0xd0, 0x02, 0x20, 0x40, 0x42, 0xf0, 0xe7, 0x00, 0x2d, 0xc8, 0xd0, 
-    0xf9, 0xe7, 0xc0, 0x46, 0x4a, 0x02, 0x43, 0x02, 0xf0, 0xb5, 0x5c, 0x0a, 
-    0x55, 0x0a, 0x43, 0x00, 0x4a, 0x00, 0x1b, 0x0e, 0xc6, 0x0f, 0x12, 0x0e, 
-    0xc9, 0x0f, 0xff, 0x2b, 0x27, 0xd0, 0xff, 0x2a, 0x29, 0xd0, 0x00, 0x2b, 
-    0x10, 0xd0, 0x00, 0x2a, 0x15, 0xd1, 0x94, 0x46, 0x6f, 0x42, 0x6f, 0x41, 
-    0x60, 0x46, 0x00, 0x28, 0x15, 0xd0, 0x00, 0x20, 0x00, 0x2f, 0x04, 0xd1, 
-    0x48, 0x42, 0x48, 0x41, 0x40, 0x42, 0x01, 0x23, 0x18, 0x43, 0xf0, 0xbd, 
-    0x60, 0x42, 0x60, 0x41, 0x84, 0x46, 0x00, 0x2a, 0xec, 0xd0, 0x00, 0x28, 
-    0xf2, 0xd1, 0x8e, 0x42, 0x11, 0xd0, 0x70, 0x42, 0x01, 0x23, 0x18, 0x43, 
-    0xf1, 0xe7, 0x00, 0x2f, 0xf7, 0xd0, 0x70, 0x42, 0x01, 0x23, 0x18, 0x43, 
-    0xeb, 0xe7, 0x02, 0x20, 0x00, 0x2c, 0xe8, 0xd1, 0xd3, 0xe7, 0x02, 0x20, 
-    0x00, 0x2d, 0xe4, 0xd1, 0xd1, 0xe7, 0x93, 0x42, 0xeb, 0xdc, 0x04, 0xdb, 
-    0xac, 0x42, 0xe8, 0xd8, 0x00, 0x20, 0xac, 0x42, 0xdb, 0xd2, 0x70, 0x42, 
-    0x70, 0x41, 0x40, 0x42, 0x01, 0x23, 0x18, 0x43, 0xd5, 0xe7, 0xc0, 0x46, 
-    0xf0, 0xb5, 0x5f, 0x46, 0x56, 0x46, 0x4d, 0x46, 0x44, 0x46, 0xf0, 0xb4, 
-    0x44, 0x02, 0x46, 0x00, 0x83, 0xb0, 0x0f, 0x1c, 0x64, 0x0a, 0x36, 0x0e, 
-    0xc5, 0x0f, 0x00, 0x2e, 0x41, 0xd0, 0xff, 0x2e, 0x22, 0xd0, 0x80, 0x23, 
-    0x1b, 0x04, 0x00, 0x20, 0x1c, 0x43, 0xe4, 0x00, 0x7f, 0x3e, 0x82, 0x46, 
-    0x80, 0x46, 0x39, 0x1c, 0x4b, 0x00, 0x7f, 0x02, 0xc9, 0x0f, 0x7f, 0x0a, 
-    0x1b, 0x0e, 0x8b, 0x46, 0x3b, 0xd0, 0xff, 0x2b, 0x34, 0xd0, 0x80, 0x22, 
-    0x12, 0x04, 0x17, 0x43, 0xff, 0x00, 0x7f, 0x3b, 0x00, 0x21, 0x5a, 0x46, 
-    0x6a, 0x40, 0x01, 0x92, 0x52, 0x46, 0x0a, 0x43, 0x0f, 0x2a, 0x63, 0xd8, 
-    0x7a, 0x48, 0x92, 0x00, 0x82, 0x58, 0x97, 0x46, 0x00, 0x2c, 0x3f, 0xd1, 
-    0x08, 0x22, 0x02, 0x23, 0x92, 0x46, 0x98, 0x46, 0xdd, 0xe7, 0x01, 0x95, 
-    0x40, 0x46, 0x02, 0x28, 0x2a, 0xd1, 0x01, 0x9a, 0x01, 0x25, 0x15, 0x40, 
-    0xff, 0x23, 0x00, 0x24, 0x64, 0x02, 0xdb, 0x05, 0x60, 0x0a, 0xed, 0x07, 
-    0x18, 0x43, 0x28, 0x43, 0x03, 0xb0, 0x3c, 0xbc, 0x90, 0x46, 0x99, 0x46, 
-    0xa2, 0x46, 0xab, 0x46, 0xf0, 0xbd, 0x00, 0x2c, 0x27, 0xd1, 0x04, 0x20, 
-    0x01, 0x22, 0x82, 0x46, 0x90, 0x46, 0xc0, 0xe7, 0x39, 0x1c, 0x4a, 0x1e, 
-    0x91, 0x41, 0x02, 0x31, 0xcb, 0xe7, 0x01, 0x21, 0x00, 0x2f, 0xc8, 0xd0, 
-    0x38, 0x1c, 0x00, 0xf0, 0xf7, 0xff, 0x43, 0x1f, 0x9f, 0x40, 0x76, 0x23, 
-    0x5b, 0x42, 0x1b, 0x1a, 0x00, 0x21, 0xbe, 0xe7, 0x03, 0x28, 0x00, 0xd1, 
-    0xae, 0xe0, 0x01, 0x28, 0x4f, 0xd1, 0x01, 0x98, 0x42, 0x46, 0x10, 0x40, 
-    0xc5, 0xb2, 0x00, 0x23, 0x00, 0x24, 0xcd, 0xe7, 0x0c, 0x23, 0x03, 0x20, 
-    0x9a, 0x46, 0x80, 0x46, 0x9d, 0xe7, 0x20, 0x1c, 0x00, 0xf0, 0xdc, 0xff, 
-    0x76, 0x26, 0x43, 0x1f, 0x9c, 0x40, 0x76, 0x42, 0x00, 0x23, 0x36, 0x1a, 
-    0x9a, 0x46, 0x98, 0x46, 0x91, 0xe7, 0x80, 0x24, 0x00, 0x25, 0xe4, 0x03, 
-    0xff, 0x23, 0xb7, 0xe7, 0x5b, 0x46, 0x3c, 0x1c, 0x01, 0x93, 0x88, 0x46, 
-    0xaa, 0xe7, 0x3c, 0x1c, 0x88, 0x46, 0xa7, 0xe7, 0x25, 0x0c, 0x24, 0x04, 
-    0x3a, 0x0c, 0x24, 0x0c, 0x3f, 0x04, 0xf6, 0x18, 0x3f, 0x0c, 0x21, 0x1c, 
-    0x23, 0x1c, 0x79, 0x43, 0x53, 0x43, 0x6f, 0x43, 0x55, 0x43, 0xfb, 0x18, 
-    0x0a, 0x0c, 0x9b, 0x18, 0xb1, 0x46, 0x9f, 0x42, 0x02, 0xd9, 0x80, 0x22, 
-    0x52, 0x02, 0xad, 0x18, 0x09, 0x04, 0x1a, 0x04, 0x09, 0x0c, 0x52, 0x18, 
-    0x94, 0x01, 0x1b, 0x0c, 0x61, 0x1e, 0x8c, 0x41, 0x92, 0x0e, 0xed, 0x18, 
-    0x14, 0x43, 0xad, 0x01, 0x2c, 0x43, 0x23, 0x01, 0x05, 0xd5, 0x01, 0x22, 
-    0x63, 0x08, 0x01, 0x20, 0x14, 0x40, 0x81, 0x44, 0x1c, 0x43, 0x4b, 0x46, 
-    0x7f, 0x33, 0x00, 0x2b, 0x2d, 0xdd, 0x60, 0x07, 0x04, 0xd0, 0x0f, 0x22, 
-    0x22, 0x40, 0x04, 0x2a, 0x00, 0xd0, 0x04, 0x34, 0x22, 0x01, 0x03, 0xd5, 
-    0x2d, 0x4b, 0x1c, 0x40, 0x4b, 0x46, 0x80, 0x33, 0xfe, 0x2b, 0x17, 0xdd, 
-    0x01, 0x9b, 0x01, 0x25, 0x1d, 0x40, 0x00, 0x24, 0xff, 0x23, 0x6b, 0xe7, 
-    0x80, 0x20, 0xc0, 0x03, 0x04, 0x42, 0x08, 0xd0, 0x07, 0x42, 0x06, 0xd1, 
-    0x04, 0x1c, 0x3c, 0x43, 0x64, 0x02, 0x64, 0x0a, 0x5d, 0x46, 0xff, 0x23, 
-    0x5e, 0xe7, 0x04, 0x43, 0x64, 0x02, 0x64, 0x0a, 0xff, 0x23, 0x59, 0xe7, 
-    0x01, 0x98, 0xa4, 0x01, 0x01, 0x25, 0x64, 0x0a, 0xdb, 0xb2, 0x05, 0x40, 
-    0x52, 0xe7, 0x7e, 0x23, 0x5b, 0x42, 0x4a, 0x46, 0x9b, 0x1a, 0x1b, 0x2b, 
-    0x05, 0xdd, 0x01, 0x9b, 0x01, 0x25, 0x1d, 0x40, 0x00, 0x24, 0x00, 0x23, 
-    0x46, 0xe7, 0x22, 0x1c, 0xda, 0x40, 0x4b, 0x46, 0x9e, 0x33, 0x9c, 0x40, 
-    0x23, 0x1c, 0x5c, 0x1e, 0xa3, 0x41, 0x13, 0x43, 0x58, 0x07, 0x04, 0xd0, 
-    0x0f, 0x22, 0x1a, 0x40, 0x04, 0x2a, 0x00, 0xd0, 0x04, 0x33, 0x5a, 0x01, 
-    0x05, 0xd5, 0x01, 0x9b, 0x01, 0x25, 0x1d, 0x40, 0x00, 0x24, 0x01, 0x23, 
-    0x2e, 0xe7, 0x01, 0x98, 0x9c, 0x01, 0x01, 0x25, 0x64, 0x0a, 0x05, 0x40, 
-    0x00, 0x23, 0x27, 0xe7, 0x80, 0x27, 0xff, 0x03, 0x01, 0x9b, 0x3c, 0x43, 
-    0x64, 0x02, 0x01, 0x25, 0x1d, 0x40, 0x64, 0x0a, 0xff, 0x23, 0x1d, 0xe7, 
-    0x44, 0xe5, 0x03, 0x00, 0xff, 0xff, 0xff, 0xf7, 0xf8, 0xb5, 0xc2, 0x0f, 
-    0x43, 0x02, 0x44, 0x00, 0x4d, 0x02, 0x48, 0x00, 0x24, 0x0e, 0x16, 0x1c, 
-    0x9b, 0x09, 0x00, 0x0e, 0xc9, 0x0f, 0xad, 0x09, 0xff, 0x28, 0x00, 0xd1, 
-    0x83, 0xe0, 0x01, 0x27, 0x79, 0x40, 0x8a, 0x42, 0x5c, 0xd0, 0x22, 0x1a, 
-    0x00, 0x2a, 0x00, 0xdc, 0x8e, 0xe0, 0x00, 0x28, 0x1e, 0xd1, 0x00, 0x2d, 
-    0x00, 0xd0, 0x7a, 0xe0, 0x58, 0x07, 0x04, 0xd0, 0x0f, 0x22, 0x1a, 0x40, 
-    0x04, 0x2a, 0x00, 0xd0, 0x04, 0x33, 0x80, 0x21, 0xc9, 0x04, 0x01, 0x22, 
-    0x19, 0x40, 0x32, 0x40, 0x00, 0x29, 0x3a, 0xd0, 0x01, 0x34, 0xff, 0x2c, 
-    0x00, 0xd1, 0x83, 0xe0, 0x9b, 0x01, 0x5b, 0x0a, 0x5b, 0x02, 0xe4, 0xb2, 
-    0xe4, 0x05, 0x58, 0x0a, 0xd2, 0x07, 0x20, 0x43, 0x10, 0x43, 0xf8, 0xbd, 
-    0xff, 0x2c, 0xe1, 0xd0, 0x80, 0x21, 0xc9, 0x04, 0x0d, 0x43, 0x1b, 0x2a, 
-    0x00, 0xdd, 0x31, 0xe1, 0x29, 0x1c, 0x20, 0x20, 0xd1, 0x40, 0x82, 0x1a, 
-    0x95, 0x40, 0x6a, 0x1e, 0x95, 0x41, 0x0d, 0x43, 0x5b, 0x1b, 0x58, 0x01, 
-    0xd0, 0xd5, 0x9b, 0x01, 0x9f, 0x09, 0x38, 0x1c, 0x00, 0xf0, 0xe0, 0xfe, 
-    0x42, 0x1f, 0x97, 0x40, 0x94, 0x42, 0x5f, 0xdc, 0x14, 0x1b, 0x1f, 0x23, 
-    0x1b, 0x1b, 0x3a, 0x1c, 0x9f, 0x40, 0x61, 0x1c, 0x3b, 0x1c, 0xca, 0x40, 
-    0x5f, 0x1e, 0xbb, 0x41, 0x13, 0x43, 0x00, 0x24, 0xba, 0xe7, 0x13, 0x1e, 
-    0xb8, 0xd1, 0x00, 0x23, 0x00, 0x22, 0xdb, 0x08, 0xff, 0x2c, 0x04, 0xd1, 
-    0x00, 0x2b, 0x47, 0xd0, 0x80, 0x20, 0xc0, 0x03, 0x03, 0x43, 0x5b, 0x02, 
-    0x5b, 0x0a, 0xbf, 0xe7, 0x21, 0x1a, 0x00, 0x29, 0x44, 0xdd, 0x00, 0x28, 
-    0x27, 0xd0, 0xff, 0x2c, 0xa4, 0xd0, 0x80, 0x20, 0xc0, 0x04, 0x05, 0x43, 
-    0x1b, 0x29, 0x00, 0xdd, 0xf2, 0xe0, 0x28, 0x1c, 0x20, 0x27, 0xc8, 0x40, 
-    0x79, 0x1a, 0x8d, 0x40, 0x69, 0x1e, 0x8d, 0x41, 0x05, 0x43, 0x5b, 0x19, 
-    0x59, 0x01, 0x00, 0xd4, 0x92, 0xe7, 0x01, 0x34, 0xff, 0x2c, 0x59, 0xd0, 
-    0x73, 0x49, 0x01, 0x22, 0x1a, 0x40, 0x0b, 0x40, 0x5b, 0x08, 0x13, 0x43, 
-    0x88, 0xe7, 0x00, 0x2d, 0x00, 0xd0, 0x7a, 0xe7, 0x77, 0xe7, 0x01, 0x3a, 
-    0x00, 0x2a, 0xad, 0xd0, 0xff, 0x2c, 0xa0, 0xd1, 0x7e, 0xe7, 0x00, 0x2d, 
-    0x00, 0xd1, 0x7b, 0xe7, 0x01, 0x39, 0x00, 0x29, 0xe1, 0xd0, 0xff, 0x2c, 
-    0xd4, 0xd1, 0x75, 0xe7, 0x00, 0x2a, 0x1b, 0xd1, 0x62, 0x1c, 0xd2, 0xb2, 
-    0x01, 0x2a, 0x4b, 0xdd, 0x5f, 0x1b, 0x7a, 0x01, 0x23, 0xd5, 0xef, 0x1a, 
-    0x0e, 0x1c, 0x9a, 0xe7, 0x00, 0x23, 0x7b, 0xe7, 0x5f, 0x4b, 0xa4, 0x1a, 
-    0x3b, 0x40, 0x63, 0xe7, 0x00, 0x29, 0x46, 0xd1, 0x61, 0x1c, 0xc8, 0xb2, 
-    0x01, 0x28, 0x29, 0xdd, 0xff, 0x29, 0x24, 0xd0, 0xeb, 0x18, 0x5b, 0x08, 
-    0x0c, 0x1c, 0x57, 0xe7, 0x00, 0x2c, 0x13, 0xd0, 0xff, 0x28, 0x18, 0xd0, 
-    0x80, 0x24, 0xe4, 0x04, 0x52, 0x42, 0x23, 0x43, 0x1b, 0x2a, 0x4d, 0xdd, 
-    0x01, 0x23, 0xeb, 0x1a, 0x04, 0x1c, 0x0e, 0x1c, 0x75, 0xe7, 0x00, 0x2f, 
-    0x00, 0xd0, 0x76, 0xe7, 0x00, 0x23, 0x00, 0x22, 0x00, 0x24, 0x8a, 0xe7, 
-    0x00, 0x2b, 0x3b, 0xd0, 0xd2, 0x43, 0x00, 0x2a, 0xef, 0xd0, 0xff, 0x28, 
-    0xea, 0xd1, 0x2b, 0x1c, 0xff, 0x24, 0x0e, 0x1c, 0x36, 0xe7, 0xff, 0x24, 
-    0x00, 0x23, 0x7c, 0xe7, 0x00, 0x2c, 0x5c, 0xd1, 0x00, 0x2b, 0x00, 0xd1, 
-    0x80, 0xe0, 0x00, 0x2d, 0x00, 0xd1, 0x2b, 0xe7, 0x5b, 0x19, 0x58, 0x01, 
-    0x00, 0xd4, 0x27, 0xe7, 0x3f, 0x4a, 0x01, 0x24, 0x13, 0x40, 0x23, 0xe7, 
-    0x00, 0x2c, 0x15, 0xd1, 0x00, 0x2b, 0x40, 0xd1, 0x00, 0x2d, 0x63, 0xd0, 
-    0x2b, 0x1c, 0x0e, 0x1c, 0x1a, 0xe7, 0x00, 0x2c, 0x21, 0xd1, 0x00, 0x2b, 
-    0x54, 0xd0, 0xc9, 0x43, 0x00, 0x29, 0x04, 0xd0, 0xff, 0x28, 0x4c, 0xd0, 
-    0x1b, 0x29, 0x58, 0xdd, 0x01, 0x23, 0x5b, 0x19, 0x04, 0x1c, 0x75, 0xe7, 
-    0x00, 0x2b, 0x19, 0xd1, 0x00, 0x2d, 0x48, 0xd0, 0x2b, 0x1c, 0x0e, 0x1c, 
-    0xff, 0x24, 0x03, 0xe7, 0x2b, 0x1c, 0x04, 0x1c, 0x0e, 0x1c, 0xff, 0xe6, 
-    0x1c, 0x1c, 0x20, 0x26, 0xd4, 0x40, 0xb2, 0x1a, 0x93, 0x40, 0x5a, 0x1e, 
-    0x93, 0x41, 0x23, 0x43, 0xa9, 0xe7, 0xff, 0x28, 0x2f, 0xd0, 0x80, 0x24, 
-    0xe4, 0x04, 0x49, 0x42, 0x23, 0x43, 0xdd, 0xe7, 0xff, 0x24, 0x00, 0x2d, 
-    0x00, 0xd1, 0xeb, 0xe6, 0x80, 0x22, 0xdb, 0x08, 0xd2, 0x03, 0x13, 0x42, 
-    0x04, 0xd0, 0xed, 0x08, 0x15, 0x42, 0x01, 0xd1, 0x2b, 0x1c, 0x0e, 0x1c, 
-    0xdb, 0x00, 0xff, 0x24, 0xde, 0xe6, 0x00, 0x2d, 0x00, 0xd1, 0xdb, 0xe6, 
-    0x5a, 0x1b, 0x50, 0x01, 0x00, 0xd4, 0x1c, 0xe7, 0xeb, 0x1a, 0x0e, 0x1c, 
-    0xd4, 0xe6, 0x00, 0x2b, 0x0d, 0xd0, 0xff, 0x24, 0x00, 0x2d, 0x00, 0xd1, 
-    0xce, 0xe6, 0x80, 0x22, 0xdb, 0x08, 0xd2, 0x03, 0x13, 0x42, 0xe7, 0xd0, 
-    0xed, 0x08, 0x15, 0x42, 0xe4, 0xd1, 0x2b, 0x1c, 0xe2, 0xe7, 0x2b, 0x1c, 
-    0xff, 0x24, 0xc1, 0xe6, 0x2b, 0x1c, 0x04, 0x1c, 0xbe, 0xe6, 0x80, 0x23, 
-    0x00, 0x22, 0x9b, 0x04, 0xff, 0x24, 0x02, 0xe7, 0x23, 0x1c, 0x00, 0x22, 
-    0xff, 0xe6, 0x1c, 0x1c, 0x20, 0x27, 0xcc, 0x40, 0x79, 0x1a, 0x8b, 0x40, 
-    0x59, 0x1e, 0x8b, 0x41, 0x23, 0x43, 0x9e, 0xe7, 0x2b, 0x1c, 0xab, 0xe6, 
-    0x01, 0x25, 0x12, 0xe7, 0x01, 0x25, 0xd3, 0xe6, 0xff, 0xff, 0xff, 0xfb, 
-    0x43, 0x02, 0x59, 0x0a, 0x43, 0x00, 0xc2, 0x0f, 0x1b, 0x0e, 0x00, 0x20, 
-    0x7e, 0x2b, 0x0d, 0xdd, 0x9d, 0x2b, 0x0c, 0xdc, 0x80, 0x20, 0x00, 0x04, 
-    0x01, 0x43, 0x95, 0x2b, 0x0a, 0xdc, 0x96, 0x20, 0xc3, 0x1a, 0xd9, 0x40, 
-    0x48, 0x42, 0x00, 0x2a, 0x00, 0xd1, 0x08, 0x1c, 0x70, 0x47, 0x03, 0x4b, 
-    0xd0, 0x18, 0xfb, 0xe7, 0x96, 0x3b, 0x99, 0x40, 0xf4, 0xe7, 0xc0, 0x46, 
-    0xff, 0xff, 0xff, 0x7f, 0x70, 0xb5, 0x04, 0x1e, 0x3c, 0xd0, 0xc6, 0x0f, 
-    0x00, 0xd0, 0x44, 0x42, 0x20, 0x1c, 0x00, 0xf0, 0x91, 0xfd, 0x9e, 0x23, 
-    0x25, 0x1c, 0x1b, 0x1a, 0x96, 0x2b, 0x0c, 0xdc, 0x08, 0x38, 0x84, 0x40, 
-    0x64, 0x02, 0x64, 0x0a, 0xdb, 0xb2, 0x32, 0x1c, 0x64, 0x02, 0xdb, 0x05, 
-    0x60, 0x0a, 0xd2, 0x07, 0x18, 0x43, 0x10, 0x43, 0x70, 0xbd, 0x99, 0x2b, 
-    0x0a, 0xdd, 0x05, 0x22, 0x12, 0x1a, 0x21, 0x1c, 0xd1, 0x40, 0x0a, 0x1c, 
-    0x01, 0x1c, 0x1b, 0x31, 0x8d, 0x40, 0x69, 0x1e, 0x8d, 0x41, 0x15, 0x43, 
-    0x05, 0x28, 0x01, 0xdd, 0x42, 0x1f, 0x95, 0x40, 0x16, 0x4c, 0x2c, 0x40, 
-    0x6a, 0x07, 0x04, 0xd0, 0x0f, 0x22, 0x15, 0x40, 0x04, 0x2d, 0x00, 0xd0, 
-    0x04, 0x34, 0x61, 0x01, 0x0c, 0xd5, 0x9f, 0x23, 0x18, 0x1a, 0xff, 0x28, 
-    0x1a, 0xd0, 0xa4, 0x01, 0x64, 0x0a, 0xc3, 0xb2, 0x32, 0x1c, 0xd3, 0xe7, 
-    0x00, 0x22, 0x00, 0x23, 0x00, 0x24, 0xcf, 0xe7, 0xe4, 0x08, 0xff, 0x2b, 
-    0x04, 0xd0, 0x64, 0x02, 0x64, 0x0a, 0xdb, 0xb2, 0x32, 0x1c, 0xc7, 0xe7, 
-    0x00, 0x2c, 0x04, 0xd0, 0x80, 0x20, 0xc0, 0x03, 0x04, 0x43, 0x64, 0x02, 
-    0x64, 0x0a, 0x32, 0x1c, 0xff, 0x23, 0xbd, 0xe7, 0x32, 0x1c, 0xff, 0x23, 
-    0x00, 0x24, 0xb9, 0xe7, 0xff, 0xff, 0xff, 0xfb, 0x10, 0xb5, 0x04, 0x1e, 
-    0x33, 0xd0, 0x00, 0xf0, 0x39, 0xfd, 0x9e, 0x23, 0x1b, 0x1a, 0x96, 0x2b, 
-    0x09, 0xdc, 0x08, 0x38, 0x84, 0x40, 0x64, 0x02, 0x64, 0x0a, 0xdb, 0xb2, 
-    0x64, 0x02, 0xdb, 0x05, 0x60, 0x0a, 0x18, 0x43, 0x10, 0xbd, 0x99, 0x2b, 
-    0x0a, 0xdd, 0x05, 0x22, 0x12, 0x1a, 0x21, 0x1c, 0xd1, 0x40, 0x0a, 0x1c, 
-    0x01, 0x1c, 0x1b, 0x31, 0x8c, 0x40, 0x61, 0x1e, 0x8c, 0x41, 0x14, 0x43, 
-    0x05, 0x28, 0x01, 0xdd, 0x42, 0x1f, 0x94, 0x40, 0x14, 0x4a, 0x22, 0x40, 
-    0x61, 0x07, 0x04, 0xd0, 0x0f, 0x21, 0x0c, 0x40, 0x04, 0x2c, 0x00, 0xd0, 
-    0x04, 0x32, 0x51, 0x01, 0x0a, 0xd5, 0x9f, 0x23, 0x18, 0x1a, 0xff, 0x28, 
-    0x16, 0xd0, 0x94, 0x01, 0x64, 0x0a, 0xc3, 0xb2, 0xd6, 0xe7, 0x00, 0x23, 
-    0x00, 0x24, 0xd3, 0xe7, 0xd2, 0x08, 0xff, 0x2b, 0x03, 0xd0, 0x54, 0x02, 
-    0x64, 0x0a, 0xdb, 0xb2, 0xcc, 0xe7, 0x00, 0x2a, 0x06, 0xd0, 0x80, 0x24, 
-    0xe4, 0x03, 0x14, 0x43, 0x64, 0x02, 0x64, 0x0a, 0xff, 0x23, 0xc3, 0xe7, 
-    0xff, 0x23, 0x00, 0x24, 0xc0, 0xe7, 0xc0, 0x46, 0xff, 0xff, 0xff, 0xfb, 
-    0xf8, 0xb5, 0x5f, 0x46, 0x56, 0x46, 0x44, 0x46, 0x4d, 0x46, 0xf0, 0xb4, 
-    0x0c, 0x03, 0x4d, 0x00, 0xce, 0x0f, 0x61, 0x0a, 0x44, 0x0f, 0x21, 0x43, 
-    0xc4, 0x00, 0x18, 0x03, 0x80, 0x46, 0x58, 0x00, 0x40, 0x0d, 0x82, 0x46, 
-    0xd8, 0x0f, 0x84, 0x46, 0x40, 0x46, 0x40, 0x0a, 0x53, 0x0f, 0x03, 0x43, 
-    0xd0, 0x00, 0x6d, 0x0d, 0x37, 0x1c, 0x83, 0x46, 0x52, 0x46, 0x66, 0x45, 
-    0x00, 0xd1, 0xa4, 0xe0, 0xaf, 0x1a, 0x00, 0x2f, 0x00, 0xdc, 0x09, 0xe1, 
-    0x00, 0x2a, 0x3b, 0xd1, 0x18, 0x43, 0x00, 0xd0, 0xea, 0xe0, 0x63, 0x07, 
-    0x00, 0xd1, 0x87, 0xe0, 0x0f, 0x23, 0x23, 0x40, 0x04, 0x2b, 0x00, 0xd1, 
-    0x82, 0xe0, 0x22, 0x1d, 0xa2, 0x42, 0xa4, 0x41, 0x64, 0x42, 0x80, 0x23, 
-    0x09, 0x19, 0x1b, 0x04, 0x0b, 0x40, 0x37, 0x1c, 0x14, 0x1c, 0x00, 0x2b, 
-    0x00, 0xd1, 0x7c, 0xe0, 0xce, 0x4b, 0x01, 0x35, 0x9d, 0x42, 0x00, 0xd1, 
-    0x05, 0xe1, 0xcd, 0x4b, 0xe4, 0x08, 0x19, 0x40, 0x48, 0x07, 0x49, 0x02, 
-    0x04, 0x43, 0x0b, 0x0b, 0x00, 0x20, 0x00, 0x21, 0x1b, 0x03, 0x1a, 0x0b, 
-    0x0b, 0x0d, 0x6d, 0x05, 0x1b, 0x05, 0x13, 0x43, 0x6a, 0x08, 0xc6, 0x4d, 
-    0xff, 0x07, 0x1d, 0x40, 0x15, 0x43, 0x6d, 0x00, 0x6d, 0x08, 0x29, 0x1c, 
-    0x39, 0x43, 0x20, 0x1c, 0x3c, 0xbc, 0x90, 0x46, 0x99, 0x46, 0xa2, 0x46, 
-    0xab, 0x46, 0xf8, 0xbd, 0xbc, 0x48, 0x85, 0x42, 0xc3, 0xd0, 0x80, 0x20, 
-    0x00, 0x04, 0x03, 0x43, 0x38, 0x2f, 0x00, 0xdd, 0xf0, 0xe0, 0x1f, 0x2f, 
-    0x00, 0xdd, 0x24, 0xe1, 0x20, 0x20, 0xc0, 0x1b, 0x1a, 0x1c, 0x81, 0x46, 
-    0x82, 0x40, 0x58, 0x46, 0xf8, 0x40, 0x02, 0x43, 0x94, 0x46, 0x58, 0x46, 
-    0x4a, 0x46, 0x90, 0x40, 0x42, 0x1e, 0x90, 0x41, 0xfb, 0x40, 0x62, 0x46, 
-    0x02, 0x43, 0x1f, 0x1c, 0xa2, 0x1a, 0x94, 0x42, 0xa4, 0x41, 0x64, 0x42, 
-    0xc9, 0x1b, 0x09, 0x1b, 0x14, 0x1c, 0x0b, 0x02, 0x9f, 0xd5, 0x49, 0x02, 
-    0x4f, 0x0a, 0x00, 0x2f, 0x00, 0xd1, 0xc8, 0xe0, 0x38, 0x1c, 0x00, 0xf0, 
-    0x5d, 0xfc, 0x02, 0x1c, 0x08, 0x3a, 0x1f, 0x2a, 0x00, 0xdd, 0xb5, 0xe0, 
-    0x28, 0x21, 0x09, 0x1a, 0x20, 0x1c, 0x97, 0x40, 0xc8, 0x40, 0x07, 0x43, 
-    0x94, 0x40, 0x95, 0x42, 0x00, 0xdd, 0xb2, 0xe0, 0x55, 0x1b, 0x69, 0x1c, 
-    0x1f, 0x29, 0x00, 0xdd, 0xdc, 0xe0, 0x1f, 0x22, 0x55, 0x1b, 0x3b, 0x1c, 
-    0x22, 0x1c, 0xab, 0x40, 0xca, 0x40, 0xac, 0x40, 0x65, 0x1e, 0xac, 0x41, 
-    0x13, 0x43, 0xcf, 0x40, 0x1c, 0x43, 0x39, 0x1c, 0x00, 0x25, 0x74, 0xe7, 
-    0x80, 0x23, 0x1b, 0x04, 0x0b, 0x40, 0x37, 0x1c, 0x00, 0x2b, 0x00, 0xd0, 
-    0x82, 0xe7, 0x90, 0x4b, 0x48, 0x07, 0xe4, 0x08, 0x04, 0x43, 0xc9, 0x08, 
-    0x9d, 0x42, 0x48, 0xd0, 0x09, 0x03, 0x0b, 0x0b, 0x84, 0xe7, 0xaa, 0x1a, 
-    0x94, 0x46, 0x00, 0x2a, 0x00, 0xdc, 0x98, 0xe0, 0x50, 0x46, 0x00, 0x28, 
-    0x52, 0xd0, 0x87, 0x48, 0x85, 0x42, 0x00, 0xd1, 0x57, 0xe7, 0x80, 0x20, 
-    0x00, 0x04, 0x03, 0x43, 0x62, 0x46, 0x38, 0x2a, 0x00, 0xdd, 0xfc, 0xe0, 
-    0x1f, 0x2a, 0x00, 0xdd, 0x4a, 0xe1, 0x20, 0x22, 0x60, 0x46, 0x10, 0x1a, 
-    0x1a, 0x1c, 0x82, 0x40, 0x82, 0x46, 0x91, 0x46, 0x58, 0x46, 0x62, 0x46, 
-    0xd0, 0x40, 0x4a, 0x46, 0x02, 0x43, 0x90, 0x46, 0x58, 0x46, 0x52, 0x46, 
-    0x90, 0x40, 0x42, 0x1e, 0x90, 0x41, 0x42, 0x46, 0x02, 0x43, 0x60, 0x46, 
-    0xc3, 0x40, 0x12, 0x19, 0xa2, 0x42, 0xa4, 0x41, 0x64, 0x42, 0x59, 0x18, 
-    0x09, 0x19, 0x14, 0x1c, 0x08, 0x02, 0x00, 0xd4, 0x2d, 0xe7, 0x70, 0x4b, 
-    0x01, 0x35, 0x9d, 0x42, 0x00, 0xd1, 0x22, 0xe1, 0x6e, 0x4b, 0x60, 0x08, 
-    0x19, 0x40, 0x01, 0x23, 0x23, 0x40, 0x1c, 0x1c, 0x04, 0x43, 0xcb, 0x07, 
-    0x1c, 0x43, 0x49, 0x08, 0x1d, 0xe7, 0x23, 0x1c, 0x0b, 0x43, 0x3a, 0xd0, 
-    0x80, 0x23, 0x1b, 0x03, 0x0b, 0x43, 0x1b, 0x03, 0x1b, 0x0b, 0x35, 0xe7, 
-    0x01, 0x3f, 0x00, 0x2f, 0x65, 0xd1, 0x58, 0x46, 0x22, 0x1a, 0x94, 0x42, 
-    0xa4, 0x41, 0x64, 0x42, 0xc9, 0x1a, 0x09, 0x1b, 0x14, 0x1c, 0x66, 0xe7, 
-    0x58, 0x46, 0x18, 0x43, 0x00, 0xd1, 0x04, 0xe7, 0x01, 0x22, 0x52, 0x42, 
-    0x94, 0x44, 0x60, 0x46, 0x00, 0x28, 0x00, 0xd0, 0xc5, 0xe0, 0x58, 0x46, 
-    0x02, 0x19, 0xc3, 0xe7, 0x00, 0x2f, 0x73, 0xd1, 0x68, 0x1c, 0x40, 0x05, 
-    0x40, 0x0d, 0x01, 0x28, 0x00, 0xdc, 0xde, 0xe0, 0x5a, 0x46, 0xa2, 0x1a, 
-    0x94, 0x42, 0xbf, 0x41, 0xc8, 0x1a, 0x7f, 0x42, 0xc7, 0x1b, 0x38, 0x02, 
-    0x00, 0xd4, 0x89, 0xe0, 0x5a, 0x46, 0x14, 0x1b, 0xa3, 0x45, 0x92, 0x41, 
-    0x59, 0x1a, 0x52, 0x42, 0x8f, 0x1a, 0x66, 0x46, 0x41, 0xe7, 0x00, 0x23, 
-    0x00, 0x24, 0xfd, 0xe6, 0x27, 0x1c, 0x28, 0x38, 0x87, 0x40, 0x00, 0x24, 
-    0x95, 0x42, 0x00, 0xdc, 0x4c, 0xe7, 0x45, 0x49, 0xad, 0x1a, 0x39, 0x40, 
-    0xd1, 0xe6, 0x20, 0x1c, 0x00, 0xf0, 0x94, 0xfb, 0x20, 0x30, 0x34, 0xe7, 
-    0x5a, 0x46, 0x1a, 0x43, 0x53, 0x1e, 0x9a, 0x41, 0xd2, 0xb2, 0x00, 0x27, 
-    0x1c, 0xe7, 0x00, 0x2a, 0x00, 0xd0, 0xdc, 0xe0, 0x68, 0x1c, 0x42, 0x05, 
-    0x52, 0x0d, 0x01, 0x2a, 0x00, 0xdc, 0x8d, 0xe0, 0x37, 0x4d, 0xa8, 0x42, 
-    0x00, 0xd1, 0xf3, 0xe0, 0x5d, 0x46, 0x2a, 0x19, 0xa2, 0x42, 0xa4, 0x41, 
-    0x64, 0x42, 0x59, 0x18, 0x09, 0x19, 0xcc, 0x07, 0x52, 0x08, 0x14, 0x43, 
-    0x49, 0x08, 0x05, 0x1c, 0xab, 0xe6, 0x2f, 0x48, 0x85, 0x42, 0x00, 0xd0, 
-    0xe6, 0xe6, 0xa6, 0xe6, 0x2b, 0x1c, 0x1f, 0x3b, 0x3a, 0x1c, 0xda, 0x40, 
-    0x13, 0x1c, 0x20, 0x29, 0x6c, 0xd0, 0x3f, 0x22, 0x55, 0x1b, 0xaf, 0x40, 
-    0x3c, 0x43, 0x60, 0x1e, 0x84, 0x41, 0x1c, 0x43, 0x00, 0x21, 0x00, 0x25, 
-    0x95, 0xe6, 0x38, 0x1c, 0x20, 0x38, 0x1a, 0x1c, 0xc2, 0x40, 0x10, 0x1c, 
-    0x20, 0x2f, 0x5d, 0xd0, 0x40, 0x22, 0xd7, 0x1b, 0xbb, 0x40, 0x5a, 0x46, 
-    0x1a, 0x43, 0x53, 0x1e, 0x9a, 0x41, 0x02, 0x43, 0x00, 0x27, 0xdb, 0xe6, 
-    0x00, 0x2d, 0x3b, 0xd0, 0x1a, 0x4d, 0xaa, 0x45, 0x00, 0xd1, 0x93, 0xe0, 
-    0x80, 0x25, 0x2d, 0x04, 0x7f, 0x42, 0x29, 0x43, 0x38, 0x2f, 0x00, 0xdd, 
-    0xac, 0xe0, 0x1f, 0x2f, 0x00, 0xdd, 0x29, 0xe1, 0x20, 0x25, 0xed, 0x1b, 
-    0x08, 0x1c, 0x26, 0x1c, 0xa8, 0x40, 0xfe, 0x40, 0xac, 0x40, 0x06, 0x43, 
-    0x65, 0x1e, 0xac, 0x41, 0x34, 0x43, 0xf9, 0x40, 0x5d, 0x46, 0x2c, 0x1b, 
-    0xa3, 0x45, 0x92, 0x41, 0x5b, 0x1a, 0x52, 0x42, 0x99, 0x1a, 0x55, 0x46, 
-    0x66, 0x46, 0xbc, 0xe6, 0x13, 0x1c, 0x3b, 0x43, 0x14, 0x1c, 0x00, 0x2b, 
-    0x00, 0xd0, 0xba, 0xe6, 0x00, 0x27, 0x00, 0x21, 0x00, 0x25, 0x00, 0x24, 
-    0xe5, 0xe6, 0x5a, 0x46, 0x1a, 0x43, 0x53, 0x1e, 0x9a, 0x41, 0xd2, 0xb2, 
-    0x00, 0x23, 0x14, 0xe7, 0xff, 0x07, 0x00, 0x00, 0xff, 0xff, 0x7f, 0xff, 
-    0xff, 0xff, 0x0f, 0x80, 0x0d, 0x1c, 0x25, 0x43, 0x58, 0xd0, 0xff, 0x43, 
-    0x00, 0x2f, 0x51, 0xd1, 0x04, 0x1b, 0xa3, 0x45, 0x92, 0x41, 0x59, 0x1a, 
-    0x52, 0x42, 0x89, 0x1a, 0x55, 0x46, 0x66, 0x46, 0x95, 0xe6, 0x96, 0x48, 
-    0x85, 0x42, 0x00, 0xd0, 0xde, 0xe6, 0x32, 0xe6, 0x00, 0x27, 0x93, 0xe7, 
-    0x00, 0x23, 0xa2, 0xe7, 0x08, 0x1c, 0x20, 0x43, 0x00, 0x2d, 0x00, 0xd0, 
-    0xc4, 0xe0, 0x00, 0x28, 0x00, 0xd1, 0xf7, 0xe0, 0x58, 0x46, 0x18, 0x43, 
-    0x00, 0xd1, 0x22, 0xe6, 0x58, 0x46, 0x02, 0x19, 0xa2, 0x42, 0xa4, 0x41, 
-    0x64, 0x42, 0x59, 0x18, 0x09, 0x19, 0x14, 0x1c, 0x0a, 0x02, 0x00, 0xd4, 
-    0x17, 0xe6, 0x87, 0x4b, 0x01, 0x25, 0x19, 0x40, 0x13, 0xe6, 0x08, 0x1c, 
-    0x20, 0x43, 0x00, 0x2d, 0x39, 0xd1, 0x00, 0x28, 0x71, 0xd1, 0x59, 0x46, 
-    0x19, 0x43, 0x03, 0xd0, 0x19, 0x1c, 0x5c, 0x46, 0x66, 0x46, 0x06, 0xe6, 
-    0x00, 0x27, 0x00, 0x21, 0x00, 0x24, 0x94, 0xe6, 0x60, 0x46, 0x20, 0x38, 
-    0x1a, 0x1c, 0xc2, 0x40, 0x60, 0x46, 0x91, 0x46, 0x20, 0x28, 0x00, 0xd1, 
-    0xac, 0xe0, 0x40, 0x22, 0x12, 0x1a, 0x93, 0x40, 0x5a, 0x46, 0x1a, 0x43, 
-    0x53, 0x1e, 0x9a, 0x41, 0x4b, 0x46, 0x1a, 0x43, 0x00, 0x23, 0xb6, 0xe6, 
-    0x71, 0x4d, 0xaa, 0x45, 0x00, 0xd0, 0x6f, 0xe7, 0x19, 0x1c, 0x5c, 0x46, 
-    0x55, 0x46, 0x66, 0x46, 0xe5, 0xe5, 0x00, 0x2d, 0x22, 0xd1, 0x0d, 0x1c, 
-    0x25, 0x43, 0x77, 0xd0, 0xd5, 0x43, 0x00, 0x2d, 0x71, 0xd1, 0x5c, 0x44, 
-    0x5c, 0x45, 0x92, 0x41, 0x59, 0x18, 0x52, 0x42, 0x89, 0x18, 0x55, 0x46, 
-    0xa4, 0xe6, 0x00, 0x28, 0x4d, 0xd1, 0x59, 0x46, 0x19, 0x43, 0x00, 0xd1, 
-    0x94, 0xe0, 0x19, 0x1c, 0x5c, 0x46, 0x66, 0x46, 0x60, 0x4d, 0xca, 0xe5, 
-    0x0c, 0x43, 0x61, 0x1e, 0x8c, 0x41, 0xe4, 0xb2, 0x00, 0x21, 0x5b, 0xe7, 
-    0x05, 0x1c, 0x00, 0x21, 0x00, 0x24, 0x52, 0xe6, 0x5a, 0x4d, 0xaa, 0x45, 
-    0x54, 0xd0, 0x55, 0x42, 0x80, 0x22, 0x10, 0x04, 0x01, 0x43, 0x38, 0x2d, 
-    0x00, 0xdd, 0x81, 0xe0, 0x1f, 0x2d, 0x00, 0xdd, 0x92, 0xe0, 0x20, 0x22, 
-    0x50, 0x1b, 0x0a, 0x1c, 0x84, 0x46, 0x82, 0x40, 0x20, 0x1c, 0xe8, 0x40, 
-    0x02, 0x43, 0x90, 0x46, 0x62, 0x46, 0x94, 0x40, 0x60, 0x1e, 0x84, 0x41, 
-    0x42, 0x46, 0x14, 0x43, 0xe9, 0x40, 0x5c, 0x44, 0x5c, 0x45, 0x92, 0x41, 
-    0xcb, 0x18, 0x52, 0x42, 0x99, 0x18, 0x55, 0x46, 0x6a, 0xe6, 0x58, 0x46, 
-    0x18, 0x43, 0x00, 0xd1, 0x97, 0xe5, 0x58, 0x46, 0x27, 0x1a, 0xbc, 0x42, 
-    0x92, 0x41, 0xc8, 0x1a, 0x52, 0x42, 0x80, 0x1a, 0x02, 0x02, 0x66, 0xd5, 
-    0x58, 0x46, 0x04, 0x1b, 0xa3, 0x45, 0x92, 0x41, 0x59, 0x1a, 0x52, 0x42, 
-    0x89, 0x1a, 0x66, 0x46, 0x85, 0xe5, 0x58, 0x46, 0x18, 0x43, 0x33, 0xd0, 
-    0x48, 0x07, 0xe4, 0x08, 0x04, 0x43, 0x80, 0x20, 0xc9, 0x08, 0x00, 0x03, 
-    0x01, 0x42, 0x08, 0xd0, 0xdd, 0x08, 0x05, 0x42, 0x05, 0xd1, 0x59, 0x46, 
-    0xca, 0x08, 0x5c, 0x07, 0x14, 0x43, 0x29, 0x1c, 0x66, 0x46, 0x63, 0x0f, 
-    0xc9, 0x00, 0x19, 0x43, 0xe4, 0x00, 0x31, 0x4d, 0x6b, 0xe5, 0x30, 0x4a, 
-    0x92, 0x45, 0xae, 0xd1, 0x19, 0x1c, 0x5c, 0x46, 0x55, 0x46, 0x64, 0xe5, 
-    0x00, 0x28, 0x36, 0xd0, 0x58, 0x46, 0x18, 0x43, 0x10, 0xd0, 0x80, 0x25, 
-    0x48, 0x07, 0xe4, 0x08, 0xc9, 0x08, 0x2d, 0x03, 0x04, 0x43, 0x29, 0x42, 
-    0xe5, 0xd0, 0xd8, 0x08, 0x28, 0x42, 0xe2, 0xd1, 0x5d, 0x46, 0xea, 0x08, 
-    0x5c, 0x07, 0x14, 0x43, 0x01, 0x1c, 0xdc, 0xe7, 0x21, 0x4d, 0x4c, 0xe5, 
-    0x00, 0x23, 0x53, 0xe7, 0x3d, 0x1c, 0x20, 0x3d, 0x0a, 0x1c, 0xea, 0x40, 
-    0x15, 0x1c, 0x20, 0x2f, 0x34, 0xd0, 0x40, 0x26, 0xf7, 0x1b, 0xb9, 0x40, 
-    0x0c, 0x43, 0x61, 0x1e, 0x8c, 0x41, 0x2c, 0x43, 0x00, 0x21, 0xd1, 0xe6, 
-    0x80, 0x21, 0x00, 0x27, 0xc9, 0x03, 0x16, 0x4d, 0x00, 0x24, 0xc6, 0xe5, 
-    0x0c, 0x43, 0x61, 0x1e, 0x8c, 0x41, 0xe4, 0xb2, 0x00, 0x21, 0x8a, 0xe7, 
-    0x19, 0x1c, 0x5c, 0x46, 0x2b, 0xe5, 0x19, 0x1c, 0x5c, 0x46, 0x0f, 0x4d, 
-    0x27, 0xe5, 0x03, 0x1c, 0x3b, 0x43, 0x00, 0xd1, 0x1c, 0xe7, 0x01, 0x1c, 
-    0x3c, 0x1c, 0x20, 0xe5, 0x20, 0x20, 0x40, 0x42, 0x40, 0x19, 0x0a, 0x1c, 
-    0xc2, 0x40, 0x90, 0x46, 0x20, 0x2d, 0x0b, 0xd0, 0x40, 0x20, 0x45, 0x1b, 
-    0xa9, 0x40, 0x0c, 0x43, 0x61, 0x1e, 0x8c, 0x41, 0x45, 0x46, 0x2c, 0x43, 
-    0x00, 0x21, 0x6a, 0xe7, 0x00, 0x21, 0xcb, 0xe7, 0x00, 0x21, 0xf4, 0xe7, 
-    0xff, 0x07, 0x00, 0x00, 0xff, 0xff, 0x7f, 0xff, 0xf0, 0xb5, 0x5f, 0x46, 
-    0x56, 0x46, 0x4d, 0x46, 0x44, 0x46, 0xf0, 0xb4, 0x0d, 0x1c, 0x04, 0x1c, 
-    0x80, 0x46, 0xe8, 0x0f, 0x81, 0x46, 0x18, 0x03, 0x0f, 0x03, 0x00, 0x0b, 
-    0x3f, 0x0b, 0x83, 0xb0, 0x84, 0x46, 0x1b, 0x48, 0x00, 0x97, 0x49, 0x00, 
-    0x5e, 0x00, 0xdf, 0x0f, 0x49, 0x0d, 0x92, 0x46, 0x76, 0x0d, 0xbb, 0x46, 
-    0x81, 0x42, 0x0c, 0xd0, 0x15, 0x48, 0x86, 0x42, 0x10, 0xd0, 0x01, 0x20, 
-    0xb1, 0x42, 0x15, 0xd0, 0x03, 0xb0, 0x3c, 0xbc, 0x90, 0x46, 0x99, 0x46, 
-    0xa2, 0x46, 0xab, 0x46, 0xf0, 0xbd, 0x00, 0x9f, 0x01, 0x20, 0x27, 0x43, 
-    0xf4, 0xd1, 0x0d, 0x48, 0x86, 0x42, 0xee, 0xd1, 0x60, 0x46, 0x02, 0x43, 
-    0x01, 0x20, 0x00, 0x2a, 0xec, 0xd1, 0x01, 0x20, 0xb1, 0x42, 0xe9, 0xd1, 
-    0x00, 0x9b, 0x63, 0x45, 0xe6, 0xd1, 0xd0, 0x45, 0xe4, 0xd1, 0xd9, 0x45, 
-    0x06, 0xd0, 0x00, 0x29, 0xe0, 0xd1, 0x1c, 0x43, 0x20, 0x1c, 0x44, 0x1e, 
-    0xa0, 0x41, 0xdb, 0xe7, 0x00, 0x20, 0xd9, 0xe7, 0xff, 0x07, 0x00, 0x00, 
-    0xf0, 0xb5, 0x5f, 0x46, 0x56, 0x46, 0x4d, 0x46, 0x44, 0x46, 0xf0, 0xb4, 
-    0xcd, 0x0f, 0xde, 0x0f, 0xac, 0x46, 0x1d, 0x03, 0x2d, 0x0b, 0xb1, 0x46, 
-    0x37, 0x4e, 0x0f, 0x03, 0x4c, 0x00, 0xab, 0x46, 0x5d, 0x00, 0x80, 0x46, 
-    0x3f, 0x0b, 0x64, 0x0d, 0x92, 0x46, 0x6d, 0x0d, 0xb4, 0x42, 0x32, 0xd0, 
-    0x31, 0x4e, 0xb5, 0x42, 0x35, 0xd0, 0x00, 0x2c, 0x0e, 0xd1, 0x38, 0x43, 
-    0x41, 0x42, 0x41, 0x41, 0x08, 0x1c, 0x00, 0x2d, 0x0b, 0xd0, 0x00, 0x29, 
-    0x19, 0xd1, 0xcc, 0x45, 0x2d, 0xd0, 0x65, 0x46, 0x68, 0x42, 0x01, 0x23, 
-    0x18, 0x43, 0x18, 0xe0, 0x00, 0x2d, 0xf6, 0xd1, 0x28, 0x1c, 0x59, 0x46, 
-    0x0a, 0x43, 0x53, 0x42, 0x53, 0x41, 0x00, 0x28, 0x06, 0xd1, 0x00, 0x2b, 
-    0xed, 0xd0, 0x63, 0x46, 0x58, 0x42, 0x01, 0x23, 0x18, 0x43, 0x08, 0xe0, 
-    0x00, 0x20, 0x00, 0x2b, 0x05, 0xd1, 0x4a, 0x46, 0x50, 0x42, 0x50, 0x41, 
-    0x40, 0x42, 0x01, 0x23, 0x18, 0x43, 0x3c, 0xbc, 0x90, 0x46, 0x99, 0x46, 
-    0xa2, 0x46, 0xab, 0x46, 0xf0, 0xbd, 0x3e, 0x1c, 0x06, 0x43, 0xc9, 0xd0, 
-    0x02, 0x20, 0x40, 0x42, 0xf3, 0xe7, 0x5e, 0x46, 0x16, 0x43, 0xc6, 0xd0, 
-    0xf8, 0xe7, 0xac, 0x42, 0x07, 0xdc, 0x0b, 0xda, 0x61, 0x46, 0x48, 0x42, 
-    0x48, 0x41, 0x40, 0x42, 0x01, 0x23, 0x18, 0x43, 0xe5, 0xe7, 0x66, 0x46, 
-    0x70, 0x42, 0x01, 0x23, 0x18, 0x43, 0xe0, 0xe7, 0x5f, 0x45, 0x0a, 0xd8, 
-    0x0e, 0xd0, 0x00, 0x20, 0x5f, 0x45, 0xda, 0xd2, 0x65, 0x46, 0x68, 0x42, 
-    0x68, 0x41, 0x40, 0x42, 0x01, 0x23, 0x18, 0x43, 0xd3, 0xe7, 0x62, 0x46, 
-    0x50, 0x42, 0x01, 0x23, 0x18, 0x43, 0xce, 0xe7, 0xd0, 0x45, 0xf8, 0xd8, 
-    0x00, 0x20, 0xd0, 0x45, 0xee, 0xd3, 0xc8, 0xe7, 0xff, 0x07, 0x00, 0x00, 
-    0xf0, 0xb5, 0x56, 0x46, 0x4d, 0x46, 0x44, 0x46, 0x5f, 0x46, 0xf0, 0xb4, 
-    0x0d, 0x1c, 0x83, 0xb0, 0x04, 0x1c, 0x01, 0x90, 0xe8, 0x0f, 0x81, 0x46, 
-    0x18, 0x03, 0x0f, 0x03, 0x00, 0x0b, 0x3f, 0x0b, 0x84, 0x46, 0x35, 0x48, 
-    0x00, 0x97, 0x49, 0x00, 0x5e, 0x00, 0xdf, 0x0f, 0x49, 0x0d, 0x92, 0x46, 
-    0x76, 0x0d, 0xb8, 0x46, 0x81, 0x42, 0x34, 0xd0, 0x2f, 0x48, 0x86, 0x42, 
-    0x36, 0xd0, 0x00, 0x29, 0x18, 0xd0, 0x00, 0x2e, 0x1f, 0xd1, 0x34, 0x1c, 
-    0x67, 0x46, 0x3a, 0x43, 0x53, 0x42, 0x53, 0x41, 0x00, 0x2c, 0x1f, 0xd0, 
-    0x00, 0x20, 0x00, 0x2b, 0x05, 0xd1, 0x42, 0x46, 0x50, 0x42, 0x50, 0x41, 
-    0x40, 0x42, 0x01, 0x23, 0x18, 0x43, 0x03, 0xb0, 0x3c, 0xbc, 0x90, 0x46, 
-    0x99, 0x46, 0xa2, 0x46, 0xab, 0x46, 0xf0, 0xbd, 0x00, 0x98, 0x04, 0x43, 
-    0x60, 0x42, 0x60, 0x41, 0x04, 0x1c, 0x00, 0x2e, 0xe2, 0xd0, 0x00, 0x28, 
-    0xe9, 0xd1, 0xc1, 0x45, 0x15, 0xd0, 0x4f, 0x46, 0x78, 0x42, 0x01, 0x23, 
-    0x18, 0x43, 0xe8, 0xe7, 0x00, 0x2b, 0xf6, 0xd0, 0x4b, 0x46, 0x58, 0x42, 
-    0x01, 0x23, 0x18, 0x43, 0xe1, 0xe7, 0x00, 0x9f, 0x02, 0x20, 0x27, 0x43, 
-    0xdd, 0xd1, 0xc5, 0xe7, 0x67, 0x46, 0x02, 0x20, 0x17, 0x43, 0xd8, 0xd1, 
-    0xc3, 0xe7, 0xb1, 0x42, 0x04, 0xdd, 0x4a, 0x46, 0x50, 0x42, 0x01, 0x23, 
-    0x18, 0x43, 0xd0, 0xe7, 0xb1, 0x42, 0x07, 0xdb, 0x00, 0x98, 0x60, 0x45, 
-    0xe4, 0xd8, 0x0a, 0xd0, 0x00, 0x9f, 0x00, 0x20, 0x67, 0x45, 0xc6, 0xd2, 
-    0x4f, 0x46, 0x78, 0x42, 0x78, 0x41, 0x40, 0x42, 0x01, 0x23, 0x18, 0x43, 
-    0xbf, 0xe7, 0x01, 0x9a, 0x52, 0x45, 0xd5, 0xd8, 0x01, 0x9a, 0x00, 0x20, 
-    0x52, 0x45, 0xf1, 0xd3, 0xb7, 0xe7, 0xc0, 0x46, 0xff, 0x07, 0x00, 0x00, 
-    0x70, 0xb5, 0x0b, 0x1c, 0x12, 0x4c, 0x09, 0x03, 0x0e, 0x0b, 0x59, 0x00, 
-    0x02, 0x1c, 0x49, 0x0d, 0xdd, 0x0f, 0x00, 0x20, 0xa1, 0x42, 0x11, 0xdd, 
-    0x0e, 0x48, 0x81, 0x42, 0x0f, 0xdc, 0x80, 0x20, 0x40, 0x03, 0x06, 0x43, 
-    0x0c, 0x48, 0x40, 0x1a, 0x1f, 0x28, 0x0b, 0xdd, 0x0b, 0x4a, 0x52, 0x1a, 
-    0xd6, 0x40, 0x32, 0x1c, 0x50, 0x42, 0x00, 0x2d, 0x00, 0xd1, 0x10, 0x1c, 
-    0x70, 0xbd, 0x08, 0x4b, 0xe8, 0x18, 0xfb, 0xe7, 0x07, 0x4b, 0xc2, 0x40, 
-    0xc9, 0x18, 0x8e, 0x40, 0x32, 0x43, 0xf1, 0xe7, 0xfe, 0x03, 0x00, 0x00, 
-    0x1d, 0x04, 0x00, 0x00, 0x33, 0x04, 0x00, 0x00, 0x13, 0x04, 0x00, 0x00, 
-    0xff, 0xff, 0xff, 0x7f, 0xed, 0xfb, 0xff, 0xff, 0x43, 0x00, 0x1b, 0x0e, 
-    0x5a, 0x1c, 0x41, 0x02, 0xd2, 0xb2, 0x70, 0xb5, 0x4c, 0x0a, 0xc5, 0x0f, 
-    0x01, 0x2a, 0x17, 0xdd, 0xe0, 0x22, 0x92, 0x00, 0x64, 0x07, 0x09, 0x0b, 
-    0x98, 0x18, 0x00, 0x22, 0x00, 0x23, 0x1e, 0x0d, 0x22, 0x1c, 0x34, 0x05, 
-    0x0c, 0x43, 0x1b, 0x49, 0x40, 0x05, 0x40, 0x08, 0x21, 0x40, 0x01, 0x43, 
-    0x49, 0x00, 0x49, 0x08, 0xed, 0x07, 0x0b, 0x1c, 0x2b, 0x43, 0x10, 0x1c, 
-    0x19, 0x1c, 0x70, 0xbd, 0x00, 0x2b, 0x15, 0xd1, 0x00, 0x2c, 0x1c, 0xd0, 
-    0x20, 0x1c, 0x00, 0xf0, 0x29, 0xf8, 0x0a, 0x28, 0x1a, 0xdc, 0x0b, 0x21, 
-    0x09, 0x1a, 0x23, 0x1c, 0xcb, 0x40, 0x19, 0x1c, 0x03, 0x1c, 0x15, 0x33, 
-    0x9c, 0x40, 0x0d, 0x4b, 0x09, 0x03, 0x18, 0x1a, 0x40, 0x05, 0x09, 0x0b, 
-    0x40, 0x0d, 0xd4, 0xe7, 0x00, 0x2c, 0x03, 0xd0, 0x64, 0x07, 0x09, 0x0b, 
-    0x08, 0x48, 0xce, 0xe7, 0x07, 0x48, 0x00, 0x21, 0xcb, 0xe7, 0x00, 0x20, 
-    0x00, 0x21, 0xc8, 0xe7, 0x01, 0x1c, 0x0b, 0x39, 0x8c, 0x40, 0x21, 0x1c, 
-    0x00, 0x24, 0xe6, 0xe7, 0xff, 0xff, 0x0f, 0x80, 0x89, 0x03, 0x00, 0x00, 
-    0xff, 0x07, 0x00, 0x00, 0x1c, 0x21, 0x01, 0x23, 0x1b, 0x04, 0x98, 0x42, 
-    0x01, 0xd3, 0x00, 0x0c, 0x10, 0x39, 0x1b, 0x0a, 0x98, 0x42, 0x01, 0xd3, 
-    0x00, 0x0a, 0x08, 0x39, 0x1b, 0x09, 0x98, 0x42, 0x01, 0xd3, 0x00, 0x09, 
-    0x04, 0x39, 0x02, 0xa2, 0x10, 0x5c, 0x40, 0x18, 0x70, 0x47, 0xc0, 0x46, 
-    0x04, 0x03, 0x02, 0x02, 0x01, 0x01, 0x01, 0x01, 0x00, 0x00, 0x00, 0x00, 
-    0x00, 0x00, 0x00, 0x00, 0x6d, 0x62, 0x65, 0x64, 0x20, 0x61, 0x73, 0x73, 
-    0x65, 0x72, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x66, 0x61, 0x69, 
-    0x6c, 0x65, 0x64, 0x3a, 0x20, 0x25, 0x73, 0x2c, 0x20, 0x66, 0x69, 0x6c, 
-    0x65, 0x3a, 0x20, 0x25, 0x73, 0x2c, 0x20, 0x6c, 0x69, 0x6e, 0x65, 0x20, 
-    0x25, 0x64, 0x20, 0x0a, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
-    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xd1, 0x9a, 0x03, 0x00, 
-    0xe9, 0x9a, 0x03, 0x00, 0x63, 0x6f, 0x75, 0x6c, 0x64, 0x20, 0x6e, 0x6f, 
-    0x74, 0x20, 0x70, 0x69, 0x6e, 0x6f, 0x75, 0x74, 0x00, 0x70, 0x69, 0x6e, 
-    0x6d, 0x61, 0x70, 0x20, 0x6d, 0x69, 0x73, 0x2d, 0x6d, 0x61, 0x74, 0x63, 
-    0x68, 0x00, 0x70, 0x69, 0x6e, 0x6d, 0x61, 0x70, 0x20, 0x6e, 0x6f, 0x74, 
-    0x20, 0x66, 0x6f, 0x75, 0x6e, 0x64, 0x20, 0x66, 0x6f, 0x72, 0x20, 0x70, 
-    0x65, 0x72, 0x69, 0x70, 0x68, 0x65, 0x72, 0x61, 0x6c, 0x00, 0x70, 0x69, 
-    0x6e, 0x6d, 0x61, 0x70, 0x20, 0x6e, 0x6f, 0x74, 0x20, 0x66, 0x6f, 0x75, 
-    0x6e, 0x64, 0x20, 0x66, 0x6f, 0x72, 0x20, 0x66, 0x75, 0x6e, 0x63, 0x74, 
-    0x69, 0x6f, 0x6e, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
-    0x61, 0x9d, 0x03, 0x00, 0x99, 0x9c, 0x03, 0x00, 0xa5, 0x9c, 0x03, 0x00, 
-    0x00, 0x00, 0x00, 0x00, 0x39, 0xa7, 0x03, 0x00, 0x99, 0xa7, 0x03, 0x00, 
-    0xc9, 0xa7, 0x03, 0x00, 0xd9, 0xa7, 0x03, 0x00, 0xb5, 0xa7, 0x03, 0x00, 
-    0x78, 0xdc, 0x03, 0x00, 0xa4, 0x01, 0x00, 0x10, 0x6d, 0x62, 0x65, 0x64, 
-    0x2d, 0x73, 0x72, 0x63, 0x5c, 0x74, 0x61, 0x72, 0x67, 0x65, 0x74, 0x73, 
-    0x5c, 0x68, 0x61, 0x6c, 0x5c, 0x54, 0x41, 0x52, 0x47, 0x45, 0x54, 0x5f, 
-    0x4e, 0x58, 0x50, 0x5c, 0x54, 0x41, 0x52, 0x47, 0x45, 0x54, 0x5f, 0x4c, 
-    0x50, 0x43, 0x31, 0x31, 0x55, 0x36, 0x58, 0x5c, 0x67, 0x70, 0x69, 0x6f, 
-    0x5f, 0x61, 0x70, 0x69, 0x2e, 0x63, 0x00, 0x6f, 0x62, 0x6a, 0x2d, 0x3e, 
-    0x70, 0x69, 0x6e, 0x20, 0x21, 0x3d, 0x20, 0x28, 0x50, 0x69, 0x6e, 0x4e, 
-    0x61, 0x6d, 0x65, 0x29, 0x4e, 0x43, 0x00, 0x00, 0xed, 0xa0, 0x03, 0x00, 
-    0xf7, 0xa0, 0x03, 0x00, 0x01, 0xa1, 0x03, 0x00, 0x0b, 0xa1, 0x03, 0x00, 
-    0x15, 0xa1, 0x03, 0x00, 0x1f, 0xa1, 0x03, 0x00, 0x29, 0xa1, 0x03, 0x00, 
-    0x33, 0xa1, 0x03, 0x00, 0x6d, 0x62, 0x65, 0x64, 0x2d, 0x73, 0x72, 0x63, 
-    0x5c, 0x74, 0x61, 0x72, 0x67, 0x65, 0x74, 0x73, 0x5c, 0x68, 0x61, 0x6c, 
-    0x5c, 0x54, 0x41, 0x52, 0x47, 0x45, 0x54, 0x5f, 0x4e, 0x58, 0x50, 0x5c, 
-    0x54, 0x41, 0x52, 0x47, 0x45, 0x54, 0x5f, 0x4c, 0x50, 0x43, 0x31, 0x31, 
-    0x55, 0x36, 0x58, 0x5c, 0x70, 0x69, 0x6e, 0x6d, 0x61, 0x70, 0x2e, 0x63, 
-    0x00, 0x00, 0x00, 0x00, 0xac, 0x26, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 
-    0x02, 0x00, 0x00, 0x00, 0xfc, 0x04, 0x02, 0x00, 0x01, 0x00, 0x00, 0x00, 
-    0x03, 0x00, 0x00, 0x00, 0x10, 0x0f, 0x02, 0x00, 0x02, 0x00, 0x00, 0x00, 
-    0x02, 0x00, 0x00, 0x00, 0x94, 0x1a, 0x01, 0x00, 0x03, 0x00, 0x00, 0x00, 
-    0x02, 0x00, 0x00, 0x00, 0x34, 0x21, 0x02, 0x00, 0x04, 0x00, 0x00, 0x00, 
-    0x01, 0x00, 0x00, 0x00, 0x38, 0x23, 0x02, 0x00, 0x05, 0x00, 0x00, 0x00, 
-    0x01, 0x00, 0x00, 0x00, 0x3c, 0x25, 0x02, 0x00, 0x06, 0x00, 0x00, 0x00, 
-    0x01, 0x00, 0x00, 0x00, 0x40, 0x27, 0x02, 0x00, 0x07, 0x00, 0x00, 0x00, 
-    0x01, 0x00, 0x00, 0x00, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 
-    0x00, 0x00, 0x00, 0x00, 0x50, 0x77, 0x6d, 0x4f, 0x75, 0x74, 0x20, 0x70, 
-    0x69, 0x6e, 0x20, 0x6d, 0x61, 0x70, 0x70, 0x69, 0x6e, 0x67, 0x20, 0x66, 
-    0x61, 0x69, 0x6c, 0x65, 0x64, 0x00, 0x4e, 0x6f, 0x20, 0x61, 0x76, 0x61, 
-    0x69, 0x6c, 0x61, 0x62, 0x6c, 0x65, 0x20, 0x53, 0x43, 0x54, 0x00, 0x00, 
-    0x00, 0xc0, 0x00, 0x50, 0x00, 0xe0, 0x00, 0x50, 0x20, 0x10, 0x00, 0x00, 
-    0x00, 0x00, 0x04, 0x40, 0x01, 0x00, 0x00, 0x00, 0xa0, 0x20, 0x01, 0x00, 
-    0x00, 0x00, 0x04, 0x40, 0x01, 0x00, 0x00, 0x00, 0x58, 0x2c, 0x00, 0x00, 
-    0x00, 0x80, 0x05, 0x40, 0x03, 0x00, 0x00, 0x00, 0xb4, 0x2a, 0x01, 0x00, 
-    0x00, 0x80, 0x05, 0x40, 0x02, 0x00, 0x00, 0x00, 0xff, 0xff, 0xff, 0xff, 
-    0xff, 0xff, 0xff, 0xff, 0x00, 0x00, 0x00, 0x00, 0x18, 0x0c, 0x00, 0x00, 
-    0x00, 0x00, 0x04, 0x40, 0x02, 0x00, 0x00, 0x00, 0xd4, 0x3a, 0x01, 0x00, 
-    0x00, 0x00, 0x04, 0x40, 0x01, 0x00, 0x00, 0x00, 0x10, 0x0f, 0x02, 0x00, 
-    0x00, 0x00, 0x04, 0x40, 0x01, 0x00, 0x00, 0x00, 0xb0, 0x28, 0x01, 0x00, 
-    0x00, 0x80, 0x05, 0x40, 0x02, 0x00, 0x00, 0x00, 0xcc, 0x36, 0x01, 0x00, 
-    0x00, 0x80, 0x05, 0x40, 0x04, 0x00, 0x00, 0x00, 0xff, 0xff, 0xff, 0xff, 
-    0xff, 0xff, 0xff, 0xff, 0x00, 0x00, 0x00, 0x00, 0x28, 0x69, 0x6e, 0x74, 
-    0x29, 0x6f, 0x62, 0x6a, 0x2d, 0x3e, 0x73, 0x70, 0x69, 0x20, 0x21, 0x3d, 
-    0x20, 0x4e, 0x43, 0x00, 0x6d, 0x62, 0x65, 0x64, 0x2d, 0x73, 0x72, 0x63, 
-    0x5c, 0x74, 0x61, 0x72, 0x67, 0x65, 0x74, 0x73, 0x5c, 0x68, 0x61, 0x6c, 
-    0x5c, 0x54, 0x41, 0x52, 0x47, 0x45, 0x54, 0x5f, 0x4e, 0x58, 0x50, 0x5c, 
-    0x54, 0x41, 0x52, 0x47, 0x45, 0x54, 0x5f, 0x4c, 0x50, 0x43, 0x31, 0x31, 
-    0x55, 0x36, 0x58, 0x5c, 0x73, 0x70, 0x69, 0x5f, 0x61, 0x70, 0x69, 0x2e, 
-    0x63, 0x00, 0x28, 0x28, 0x62, 0x69, 0x74, 0x73, 0x20, 0x3e, 0x3d, 0x20, 
-    0x34, 0x29, 0x20, 0x26, 0x26, 0x20, 0x28, 0x62, 0x69, 0x74, 0x73, 0x20, 
-    0x3c, 0x3d, 0x20, 0x31, 0x36, 0x29, 0x29, 0x20, 0x7c, 0x7c, 0x20, 0x28, 
-    0x28, 0x6d, 0x6f, 0x64, 0x65, 0x20, 0x3e, 0x3d, 0x20, 0x30, 0x29, 0x20, 
-    0x26, 0x26, 0x20, 0x28, 0x6d, 0x6f, 0x64, 0x65, 0x20, 0x3c, 0x3d, 0x20, 
-    0x33, 0x29, 0x29, 0x00, 0x43, 0x6f, 0x75, 0x6c, 0x64, 0x6e, 0x27, 0x74, 
-    0x20, 0x73, 0x65, 0x74, 0x75, 0x70, 0x20, 0x72, 0x65, 0x71, 0x75, 0x65, 
-    0x73, 0x74, 0x65, 0x64, 0x20, 0x53, 0x50, 0x49, 0x20, 0x66, 0x72, 0x65, 
-    0x71, 0x75, 0x65, 0x6e, 0x63, 0x79, 0x00, 0x00, 0x24, 0x12, 0x00, 0x00, 
-    0x00, 0x00, 0x04, 0x40, 0x01, 0x00, 0x00, 0x00, 0x90, 0x18, 0x01, 0x00, 
-    0x00, 0x00, 0x04, 0x40, 0x01, 0x00, 0x00, 0x00, 0x54, 0x2a, 0x00, 0x00, 
-    0x00, 0x80, 0x05, 0x40, 0x02, 0x00, 0x00, 0x00, 0xb8, 0x2c, 0x01, 0x00, 
-    0x00, 0x80, 0x05, 0x40, 0x01, 0x00, 0x00, 0x00, 0xff, 0xff, 0xff, 0xff, 
-    0xff, 0xff, 0xff, 0xff, 0x00, 0x00, 0x00, 0x00, 0x08, 0x04, 0x00, 0x00, 
-    0x00, 0x00, 0x04, 0x40, 0x01, 0x00, 0x00, 0x00, 0x9c, 0x1e, 0x01, 0x00, 
-    0x00, 0x00, 0x04, 0x40, 0x01, 0x00, 0x00, 0x00, 0x5c, 0x2e, 0x00, 0x00, 
-    0x00, 0x80, 0x05, 0x40, 0x04, 0x00, 0x00, 0x00, 0xbc, 0x2e, 0x01, 0x00, 
-    0x00, 0x80, 0x05, 0x40, 0x02, 0x00, 0x00, 0x00, 0xff, 0xff, 0xff, 0xff, 
-    0xff, 0xff, 0xff, 0xff, 0x00, 0x00, 0x00, 0x00, 0x08, 0x08, 0x20, 0x00, 
-    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x4f, 0x4f, 
-    0x00, 0x00, 0x00, 0x00, 0x03, 0x03, 0x00, 0x00, 0x03, 0x03, 0x00, 0x14, 
-    0x7f, 0x7f, 0x14, 0x14, 0x7f, 0x7f, 0x14, 0x00, 0x24, 0x2e, 0x6b, 0x6b, 
-    0x3a, 0x12, 0x00, 0x00, 0x63, 0x33, 0x18, 0x0c, 0x66, 0x63, 0x00, 0x00, 
-    0x32, 0x7f, 0x4d, 0x4d, 0x77, 0x72, 0x50, 0x00, 0x00, 0x00, 0x04, 0x06, 
-    0x03, 0x01, 0x00, 0x00, 0x00, 0x1c, 0x3e, 0x63, 0x41, 0x00, 0x00, 0x00, 
-    0x00, 0x41, 0x63, 0x3e, 0x1c, 0x00, 0x00, 0x08, 0x2a, 0x3e, 0x1c, 0x1c, 
-    0x3e, 0x2a, 0x08, 0x00, 0x08, 0x08, 0x3e, 0x3e, 0x08, 0x08, 0x00, 0x00, 
-    0x00, 0x80, 0xe0, 0x60, 0x00, 0x00, 0x00, 0x00, 0x08, 0x08, 0x08, 0x08, 
-    0x08, 0x08, 0x00, 0x00, 0x00, 0x00, 0x60, 0x60, 0x00, 0x00, 0x00, 0x00, 
-    0x40, 0x60, 0x30, 0x18, 0x0c, 0x06, 0x02, 0x00, 0x3e, 0x7f, 0x49, 0x45, 
-    0x7f, 0x3e, 0x00, 0x00, 0x40, 0x44, 0x7f, 0x7f, 0x40, 0x40, 0x00, 0x00, 
-    0x62, 0x73, 0x51, 0x49, 0x4f, 0x46, 0x00, 0x00, 0x22, 0x63, 0x49, 0x49, 
-    0x7f, 0x36, 0x00, 0x00, 0x00, 0x18, 0x14, 0x16, 0x7f, 0x7f, 0x10, 0x00, 
-    0x27, 0x67, 0x45, 0x45, 0x7d, 0x39, 0x00, 0x00, 0x3e, 0x7f, 0x49, 0x49, 
-    0x7b, 0x32, 0x00, 0x00, 0x03, 0x03, 0x79, 0x7d, 0x07, 0x03, 0x00, 0x00, 
-    0x36, 0x7f, 0x49, 0x49, 0x7f, 0x36, 0x00, 0x00, 0x26, 0x6f, 0x49, 0x49, 
-    0x7f, 0x3e, 0x00, 0x00, 0x00, 0x00, 0x24, 0x24, 0x00, 0x00, 0x00, 0x00, 
-    0x00, 0x80, 0xe4, 0x64, 0x00, 0x00, 0x00, 0x00, 0x08, 0x1c, 0x36, 0x63, 
-    0x41, 0x41, 0x00, 0x00, 0x14, 0x14, 0x14, 0x14, 0x14, 0x14, 0x00, 0x00, 
-    0x41, 0x41, 0x63, 0x36, 0x1c, 0x08, 0x00, 0x00, 0x02, 0x03, 0x51, 0x59, 
-    0x0f, 0x06, 0x00, 0x00, 0x3e, 0x7f, 0x41, 0x4d, 0x6f, 0x2e, 0x00, 0x00, 
-    0x7c, 0x7e, 0x0b, 0x0b, 0x7e, 0x7c, 0x00, 0x00, 0x7f, 0x7f, 0x49, 0x49, 
-    0x7f, 0x36, 0x00, 0x00, 0x3e, 0x7f, 0x41, 0x41, 0x63, 0x22, 0x00, 0x00, 
-    0x7f, 0x7f, 0x41, 0x63, 0x3e, 0x1c, 0x00, 0x00, 0x7f, 0x7f, 0x49, 0x49, 
-    0x41, 0x41, 0x00, 0x00, 0x7f, 0x7f, 0x09, 0x09, 0x01, 0x01, 0x00, 0x00, 
-    0x3e, 0x7f, 0x41, 0x49, 0x7b, 0x3a, 0x00, 0x00, 0x7f, 0x7f, 0x08, 0x08, 
-    0x7f, 0x7f, 0x00, 0x00, 0x00, 0x41, 0x7f, 0x7f, 0x41, 0x00, 0x00, 0x00, 
-    0x20, 0x61, 0x41, 0x7f, 0x3f, 0x01, 0x00, 0x00, 0x7f, 0x7f, 0x1c, 0x36, 
-    0x63, 0x41, 0x00, 0x00, 0x7f, 0x7f, 0x40, 0x40, 0x40, 0x40, 0x00, 0x00, 
-    0x7f, 0x7f, 0x06, 0x0c, 0x06, 0x7f, 0x7f, 0x00, 0x7f, 0x7f, 0x0e, 0x1c, 
-    0x7f, 0x7f, 0x00, 0x00, 0x3e, 0x7f, 0x41, 0x41, 0x7f, 0x3e, 0x00, 0x00, 
-    0x7f, 0x7f, 0x09, 0x09, 0x0f, 0x06, 0x00, 0x00, 0x1e, 0x3f, 0x21, 0x61, 
-    0x7f, 0x5e, 0x00, 0x00, 0x7f, 0x7f, 0x19, 0x39, 0x6f, 0x46, 0x00, 0x00, 
-    0x26, 0x6f, 0x49, 0x49, 0x7b, 0x32, 0x00, 0x00, 0x01, 0x01, 0x7f, 0x7f, 
-    0x01, 0x01, 0x00, 0x00, 0x3f, 0x7f, 0x40, 0x40, 0x7f, 0x3f, 0x00, 0x00, 
-    0x1f, 0x3f, 0x60, 0x60, 0x3f, 0x1f, 0x00, 0x00, 0x7f, 0x7f, 0x30, 0x18, 
-    0x30, 0x7f, 0x7f, 0x00, 0x63, 0x77, 0x1c, 0x1c, 0x77, 0x63, 0x00, 0x00, 
-    0x07, 0x0f, 0x78, 0x78, 0x0f, 0x07, 0x00, 0x00, 0x61, 0x71, 0x59, 0x4d, 
-    0x47, 0x43, 0x00, 0x00, 0x00, 0x7f, 0x7f, 0x41, 0x41, 0x00, 0x00, 0x02, 
-    0x06, 0x0c, 0x18, 0x30, 0x60, 0x40, 0x00, 0x00, 0x00, 0x41, 0x41, 0x7f, 
-    0x7f, 0x00, 0x00, 0x00, 0x08, 0x0c, 0xfe, 0xfe, 0x0c, 0x08, 0x00, 0x00, 
-    0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x00, 0x00, 0x00, 0x00, 0x01, 0x03, 
-    0x06, 0x04, 0x00, 0x00, 0x00, 0x00, 0xe0, 0xf0, 0x38, 0x18, 0x18, 0x18, 
-    0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x38, 0xf0, 0xe0, 
-    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x07, 0x0f, 0x1c, 0x18, 0x18, 0x18, 
-    0x18, 0x1c, 0x0f, 0x07, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xcc, 0xcc, 
-    0x00, 0x00, 0x00, 0x33, 0x99, 0xcc, 0x66, 0x33, 0x99, 0xcc, 0x66, 0xff, 
-    0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x00, 0x00, 0x00, 0x00, 0xfe, 
-    0x09, 0x09, 0x07, 0xf1, 0xf1, 0xf1, 0xf1, 0x71, 0x71, 0xf1, 0xf1, 0xf1, 
-    0xf1, 0x71, 0x71, 0xf1, 0xf1, 0xf1, 0xf1, 0x07, 0x09, 0x09, 0xfe, 0x00, 
-    0x00, 0x00, 0x00, 0x00, 0x0c, 0x12, 0x12, 0xff, 0x00, 0x00, 0x00, 0xff, 
-    0xff, 0xff, 0xfe, 0xf7, 0xef, 0xee, 0xef, 0xef, 0xee, 0xef, 0xf7, 0xfe, 
-    0xff, 0xff, 0xff, 0x00, 0x00, 0x00, 0xff, 0x12, 0x12, 0x0c, 0x00, 0x00, 
-    0x00, 0x00, 0x00, 0xff, 0x00, 0x00, 0x00, 0x30, 0x30, 0xfc, 0xfc, 0x30, 
-    0x30, 0x00, 0x00, 0x00, 0x00, 0x70, 0x70, 0x70, 0x00, 0x1c, 0x1c, 0x1c, 
-    0x00, 0x00, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x7f, 
-    0x92, 0x92, 0x7c, 0x10, 0x10, 0x10, 0x10, 0x10, 0x10, 0x10, 0x12, 0x12, 
-    0x12, 0x10, 0x10, 0x10, 0x10, 0x10, 0x10, 0x7c, 0x92, 0x92, 0x7f, 0x00, 
-    0x00, 0x00, 0x00, 0x00, 0x9c, 0xbc, 0xa0, 0xe0, 0x7c, 0x3c, 0x00, 0x00, 
-    0x44, 0x64, 0x74, 0x5c, 0x4c, 0x44, 0x00, 0x00, 0x08, 0x7f, 0x77, 0x41, 
-    0x41, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, 0x00, 0x00, 0x00, 0x00, 
-    0x00, 0x41, 0x41, 0x77, 0x7f, 0x08, 0x00, 0x00, 0x02, 0x06, 0x04, 0x02, 
-    0x06, 0x04, 0x00, 0x00, 0x3c, 0x66, 0x66, 0x3c, 0x66, 0x66, 0x3c, 0x4e, 
-    0x4f, 0x20, 0x46, 0x49, 0x4c, 0x45, 0x53, 0x00, 0x61, 0x62, 0x62, 0x62, 
-    0x62, 0x63, 0x00, 0x61, 0x62, 0x62, 0x62, 0x62, 0x62, 0x62, 0x62, 0x62, 
-    0x63, 0x20, 0x20, 0x20, 0x20, 0x00, 0x61, 0x62, 0x62, 0x62, 0x62, 0x62, 
-    0x63, 0x00, 0x7c, 0x46, 0x49, 0x4c, 0x45, 0x7c, 0x00, 0x7c, 0x53, 0x45, 
-    0x54, 0x54, 0x49, 0x4e, 0x47, 0x53, 0x7c, 0x20, 0x20, 0x20, 0x20, 0x00, 
-    0x7c, 0x41, 0x42, 0x4f, 0x55, 0x54, 0x7c, 0x00, 0x7c, 0x20, 0x20, 0x20, 
-    0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 
-    0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x7c, 0x00, 
-    0x66, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 
-    0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 
-    0x20, 0x20, 0x66, 0x00, 0x0a, 0x0a, 0x0a, 0x0a, 0x00, 0x64, 0x62, 0x62, 
-    0x62, 0x62, 0x62, 0x62, 0x62, 0x62, 0x62, 0x62, 0x62, 0x62, 0x62, 0x62, 
-    0x62, 0x62, 0x62, 0x62, 0x62, 0x62, 0x62, 0x62, 0x62, 0x62, 0x62, 0x65, 
-    0x00, 0x67, 0x67, 0x67, 0x67, 0x67, 0x67, 0x67, 0x67, 0x67, 0x67, 0x67, 
-    0x67, 0x67, 0x67, 0x67, 0x67, 0x67, 0x67, 0x67, 0x67, 0x67, 0x67, 0x67, 
-    0x67, 0x67, 0x67, 0x67, 0x00, 0x68, 0x68, 0x68, 0x68, 0x68, 0x68, 0x68, 
-    0x68, 0x68, 0x68, 0x68, 0x68, 0x68, 0x68, 0x68, 0x68, 0x68, 0x68, 0x00, 
-    0x61, 0x62, 0x62, 0x62, 0x62, 0x62, 0x62, 0x62, 0x62, 0x62, 0x62, 0x62, 
-    0x62, 0x62, 0x62, 0x62, 0x62, 0x63, 0x00, 0x7c, 0x20, 0x20, 0x20, 0x20, 
-    0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 
-    0x7c, 0x00, 0x64, 0x62, 0x62, 0x62, 0x62, 0x62, 0x62, 0x62, 0x62, 0x62, 
-    0x62, 0x62, 0x62, 0x62, 0x62, 0x62, 0x62, 0x65, 0x00, 0x69, 0x6a, 0x6b, 
-    0x6c, 0x00, 0x6d, 0x6e, 0x6f, 0x70, 0x00, 0x71, 0x72, 0x73, 0x74, 0x00, 
-    0x75, 0x76, 0x77, 0x78, 0x00, 0x54, 0x52, 0x59, 0x20, 0x41, 0x47, 0x41, 
-    0x49, 0x4e, 0x00, 0x61, 0x62, 0x62, 0x62, 0x62, 0x62, 0x65, 0x20, 0x20, 
-    0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x64, 0x62, 0x62, 0x62, 0x62, 0x62, 
-    0x62, 0x62, 0x62, 0x62, 0x62, 0x63, 0x00, 0x53, 0x45, 0x54, 0x54, 0x49, 
-    0x4e, 0x47, 0x53, 0x00, 0x61, 0x62, 0x62, 0x62, 0x62, 0x62, 0x62, 0x62, 
-    0x62, 0x62, 0x62, 0x62, 0x62, 0x62, 0x62, 0x62, 0x62, 0x62, 0x62, 0x62, 
-    0x65, 0x20, 0x20, 0x20, 0x20, 0x20, 0x7c, 0x00, 0x43, 0x4f, 0x50, 0x59, 
-    0x52, 0x49, 0x47, 0x48, 0x54, 0x00, 0x4c, 0x4f, 0x41, 0x44, 0x49, 0x4e, 
-    0x47, 0x20, 0x00, 0x53, 0x44, 0x20, 0x43, 0x41, 0x52, 0x44, 0x20, 0x49, 
-    0x4e, 0x49, 0x54, 0x20, 0x46, 0x41, 0x49, 0x4c, 0x00, 0x46, 0x49, 0x4c, 
-    0x45, 0x20, 0x4f, 0x50, 0x45, 0x4e, 0x20, 0x46, 0x41, 0x49, 0x4c, 0x00, 
-    0x45, 0x52, 0x52, 0x4f, 0x52, 0x20, 0x52, 0x45, 0x41, 0x44, 0x49, 0x4e, 
-    0x47, 0x20, 0x46, 0x49, 0x4c, 0x45, 0x00, 0x46, 0x4c, 0x41, 0x53, 0x48, 
-    0x20, 0x57, 0x52, 0x49, 0x54, 0x45, 0x20, 0x45, 0x52, 0x52, 0x4f, 0x52, 
-    0x00, 0x53, 0x55, 0x43, 0x43, 0x45, 0x53, 0x53, 0x20, 0x21, 0x21, 0x00, 
-    0x4c, 0x4f, 0x41, 0x44, 0x20, 0x50, 0x52, 0x4f, 0x47, 0x52, 0x41, 0x4d, 
-    0x3f, 0x00, 0x59, 0x45, 0x53, 0x00, 0x4e, 0x4f, 0x00, 0x7c, 0x20, 0x20, 
-    0x20, 0x20, 0x64, 0x62, 0x62, 0x62, 0x62, 0x62, 0x62, 0x62, 0x62, 0x62, 
-    0x62, 0x62, 0x62, 0x62, 0x62, 0x62, 0x62, 0x62, 0x62, 0x62, 0x62, 0x63, 
-    0x00, 0x53, 0x44, 0x20, 0x49, 0x4e, 0x49, 0x54, 0x20, 0x00, 0x4f, 0x4b, 
-    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
-    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
-    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
-    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
-    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
-    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
-    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
-    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
-    0x00, 0x00, 0x00, 0x00, 0x18, 0x01, 0x00, 0x10, 0x4c, 0xc8, 0x03, 0x00, 
-    0xfe, 0xc7, 0x03, 0x00, 0x2c, 0xc8, 0x03, 0x00, 0x86, 0xc7, 0x03, 0x00, 
-    0x2c, 0xc8, 0x03, 0x00, 0x22, 0xc8, 0x03, 0x00, 0x2c, 0xc8, 0x03, 0x00, 
-    0x86, 0xc7, 0x03, 0x00, 0xfe, 0xc7, 0x03, 0x00, 0xfe, 0xc7, 0x03, 0x00, 
-    0x22, 0xc8, 0x03, 0x00, 0x86, 0xc7, 0x03, 0x00, 0x7e, 0xc7, 0x03, 0x00, 
-    0x7e, 0xc7, 0x03, 0x00, 0x7e, 0xc7, 0x03, 0x00, 0x32, 0xc8, 0x03, 0x00, 
-    0xf0, 0xcb, 0x03, 0x00, 0xea, 0xcb, 0x03, 0x00, 0xea, 0xcb, 0x03, 0x00, 
-    0xe0, 0xcb, 0x03, 0x00, 0x40, 0xcb, 0x03, 0x00, 0x40, 0xcb, 0x03, 0x00, 
-    0xd6, 0xcb, 0x03, 0x00, 0xe0, 0xcb, 0x03, 0x00, 0x40, 0xcb, 0x03, 0x00, 
-    0xd6, 0xcb, 0x03, 0x00, 0x40, 0xcb, 0x03, 0x00, 0xe0, 0xcb, 0x03, 0x00, 
-    0x3e, 0xcb, 0x03, 0x00, 0x3e, 0xcb, 0x03, 0x00, 0x3e, 0xcb, 0x03, 0x00, 
-    0x78, 0xcc, 0x03, 0x00, 0xf8, 0xb5, 0xc0, 0x46, 0xf8, 0xbc, 0x08, 0xbc, 
-    0x9e, 0x46, 0x70, 0x47, 0xa5, 0x91, 0x03, 0x00, 0x8d, 0xa9, 0x03, 0x00, 
-    0xf1, 0xad, 0x03, 0x00, 0xf8, 0xb5, 0xc0, 0x46, 0xf8, 0xbc, 0x08, 0xbc, 
-    0x9e, 0x46, 0x70, 0x47, 0xff, 0x22, 0x38, 0xb5, 0x52, 0x00, 0x02, 0x23, 
-    0x04, 0x1c, 0x0d, 0x1c, 0xfa, 0xf7, 0xf2, 0xfe, 0x03, 0x23, 0x00, 0x28, 
-    0x2d, 0xd1, 0x61, 0x78, 0x23, 0x78, 0x09, 0x02, 0x19, 0x43, 0x16, 0x4a, 
-    0x09, 0xb2, 0x02, 0x23, 0x91, 0x42, 0x24, 0xd1, 0x20, 0x1c, 0x29, 0x1c, 
-    0x36, 0x22, 0xfa, 0xf7, 0xe1, 0xfe, 0x00, 0x28, 0x09, 0xd1, 0x62, 0x78, 
-    0x23, 0x78, 0x12, 0x02, 0x1a, 0x43, 0x0f, 0x4b, 0x12, 0xb2, 0x9a, 0x42, 
-    0x01, 0xd1, 0x03, 0x1c, 0x13, 0xe0, 0x20, 0x1c, 0x29, 0x1c, 0x52, 0x22, 
-    0x02, 0x23, 0xfa, 0xf7, 0xcf, 0xfe, 0x00, 0x28, 0x0a, 0xd1, 0x63, 0x78, 
-    0x22, 0x78, 0x1b, 0x02, 0x13, 0x43, 0x07, 0x4a, 0x1b, 0xb2, 0x9b, 0x18, 
-    0x5a, 0x1e, 0x93, 0x41, 0xdb, 0xb2, 0x00, 0xe0, 0x01, 0x23, 0x18, 0x1c, 
-    0x38, 0xbd, 0xc0, 0x46, 0x55, 0xaa, 0xff, 0xff, 0x46, 0x41, 0x00, 0x00, 
-    0xba, 0xbe, 0xff, 0xff, 0xf0, 0xb5, 0x52, 0x4b, 0x00, 0x22, 0x8d, 0xb0, 
-    0x05, 0x1c, 0x1a, 0x60, 0x90, 0x42, 0x00, 0xd1, 0x9a, 0xe0, 0xfa, 0xf7, 
-    0x1f, 0xfe, 0x01, 0x23, 0x06, 0x1c, 0x1e, 0x40, 0x02, 0x20, 0x00, 0x2e, 
-    0x00, 0xd0, 0x91, 0xe0, 0x03, 0xac, 0x20, 0x1c, 0x31, 0x1c, 0xff, 0xf7, 
-    0xa7, 0xff, 0x01, 0x28, 0x1d, 0xd1, 0xdf, 0x22, 0x20, 0x1c, 0x31, 0x1c, 
-    0x52, 0x00, 0x10, 0x23, 0xfa, 0xf7, 0x98, 0xfe, 0x00, 0x28, 0x01, 0xd0, 
-    0x01, 0x20, 0x7f, 0xe0, 0x23, 0x79, 0x00, 0x2b, 0x01, 0xd1, 0x07, 0x20, 
-    0x7a, 0xe0, 0xe6, 0x7a, 0xa3, 0x7a, 0x36, 0x06, 0x1b, 0x04, 0x1e, 0x43, 
-    0x23, 0x7a, 0x20, 0x1c, 0x1e, 0x43, 0x63, 0x7a, 0x1b, 0x02, 0x1e, 0x43, 
-    0x31, 0x1c, 0xff, 0xf7, 0x87, 0xff, 0x03, 0x28, 0xe8, 0xd0, 0x00, 0x28, 
-    0xeb, 0xd1, 0x20, 0x1c, 0x31, 0x1c, 0x0d, 0x22, 0x24, 0x23, 0xfa, 0xf7, 
-    0x77, 0xfe, 0x00, 0x28, 0xde, 0xd1, 0xa7, 0x7a, 0x63, 0x7a, 0x3f, 0x02, 
-    0x1f, 0x43, 0x09, 0xd1, 0xa7, 0x7e, 0x63, 0x7e, 0x3f, 0x06, 0x1b, 0x04, 
-    0x1f, 0x43, 0xe3, 0x7d, 0x1f, 0x43, 0x23, 0x7e, 0x1b, 0x02, 0x1f, 0x43, 
-    0xe3, 0x78, 0xa2, 0x78, 0x5f, 0x43, 0x63, 0x78, 0x12, 0x02, 0x1a, 0x43, 
-    0x21, 0x78, 0xb6, 0x18, 0x01, 0x92, 0x2e, 0x61, 0x69, 0x70, 0x60, 0x79, 
-    0x23, 0x79, 0x00, 0x02, 0x18, 0x43, 0xa8, 0x80, 0xe3, 0x79, 0x1b, 0x02, 
-    0x00, 0x93, 0xa2, 0x79, 0x13, 0x43, 0x0b, 0xd1, 0xa3, 0x7d, 0x1b, 0x06, 
-    0x9c, 0x46, 0x63, 0x7d, 0x62, 0x46, 0x1b, 0x04, 0x1a, 0x43, 0xe3, 0x7c, 
-    0x24, 0x7d, 0x13, 0x43, 0x24, 0x02, 0x23, 0x43, 0x01, 0x9a, 0x04, 0x09, 
-    0x98, 0x1a, 0xc0, 0x1b, 0x00, 0x1b, 0xfd, 0xf7, 0xa3, 0xfd, 0x16, 0x4a, 
-    0x02, 0x30, 0xe8, 0x60, 0x01, 0x23, 0x90, 0x42, 0x04, 0xd9, 0x14, 0x4b, 
-    0x83, 0x42, 0x9b, 0x41, 0x5b, 0x42, 0x02, 0x33, 0x2b, 0x70, 0x03, 0x2b, 
-    0x10, 0xd1, 0x6b, 0x46, 0x0f, 0x33, 0xda, 0x7f, 0x01, 0x3b, 0xdb, 0x7f, 
-    0x12, 0x06, 0x1b, 0x04, 0x13, 0x43, 0x03, 0xaa, 0xd2, 0x7f, 0x13, 0x43, 
-    0x6a, 0x46, 0x0d, 0x32, 0xd2, 0x7f, 0x12, 0x02, 0x13, 0x43, 0x00, 0xe0, 
-    0xbb, 0x19, 0x6b, 0x61, 0x36, 0x19, 0x04, 0x4b, 0xf7, 0x19, 0x00, 0x20, 
-    0xaf, 0x61, 0xa8, 0x70, 0x1d, 0x60, 0xff, 0xe7, 0x0d, 0xb0, 0xf0, 0xbd, 
-    0x9c, 0x01, 0x00, 0x10, 0xf6, 0x0f, 0x00, 0x00, 0xf6, 0xff, 0x00, 0x00, 
-    0xa0, 0x22, 0x80, 0x23, 0x12, 0x06, 0x9b, 0x01, 0xd0, 0x58, 0x80, 0x21, 
-    0x89, 0x00, 0x01, 0x43, 0xd1, 0x50, 0xd0, 0x58, 0x80, 0x21, 0x49, 0x00, 
-    0x01, 0x43, 0xd1, 0x50, 0xd1, 0x58, 0x40, 0x20, 0x01, 0x43, 0xd1, 0x50, 
-    0xd1, 0x58, 0x80, 0x20, 0x01, 0x43, 0xd1, 0x50, 0x70, 0x47, 0x10, 0xb5, 
-    0xff, 0xf7, 0xe6, 0xff, 0xfa, 0xf7, 0x62, 0xfd, 0x08, 0x4c, 0x20, 0x70, 
-    0x08, 0x48, 0xff, 0xf7, 0x33, 0xff, 0x08, 0x49, 0x20, 0x70, 0x08, 0x48, 
-    0xfb, 0xf7, 0x96, 0xf8, 0x07, 0x4b, 0x20, 0x70, 0x00, 0x22, 0x00, 0x28, 
-    0x00, 0xd1, 0x01, 0x22, 0x1a, 0x70, 0x10, 0xbd, 0x4b, 0x02, 0x00, 0x10, 
-    0xdc, 0x01, 0x00, 0x10, 0x18, 0xe3, 0x03, 0x00, 0x4c, 0x02, 0x00, 0x10, 
-    0x60, 0x02, 0x00, 0x10, 0xf0, 0xb5, 0x00, 0x23, 0x87, 0xb0, 0x3e, 0x4a, 
-    0x3e, 0x49, 0x99, 0x50, 0x80, 0x22, 0x04, 0x33, 0x52, 0x00, 0x93, 0x42, 
-    0xf7, 0xd1, 0xff, 0xf7, 0xd2, 0xff, 0xe0, 0x23, 0x9b, 0x02, 0x1b, 0x78, 
-    0x01, 0xa8, 0xaa, 0x2b, 0x03, 0xd0, 0xbb, 0x2b, 0x07, 0xd1, 0x43, 0x23, 
-    0x06, 0xe0, 0x42, 0x23, 0x2e, 0x22, 0x03, 0x70, 0x43, 0x70, 0x82, 0x70, 
-    0x05, 0xe0, 0x41, 0x23, 0x03, 0x70, 0x43, 0x70, 0x2e, 0x23, 0x83, 0x70, 
-    0x42, 0x23, 0xc3, 0x70, 0x49, 0x23, 0x03, 0x71, 0x4e, 0x23, 0x43, 0x71, 
-    0x04, 0x21, 0x00, 0x23, 0x83, 0x71, 0xfc, 0xf7, 0x55, 0xf8, 0x00, 0x28, 
-    0x4c, 0xd1, 0x28, 0x4d, 0x27, 0x4c, 0x01, 0x35, 0xff, 0x35, 0x20, 0x1c, 
-    0x04, 0x21, 0x04, 0x34, 0xfc, 0xf7, 0x70, 0xf8, 0xac, 0x42, 0xf8, 0xd1, 
-    0x24, 0x4c, 0x25, 0x4e, 0x36, 0x23, 0x23, 0x60, 0x20, 0x1c, 0x31, 0x1c, 
-    0x23, 0x4b, 0x98, 0x47, 0x72, 0xb6, 0x1c, 0x25, 0x32, 0x23, 0x23, 0x60, 
-    0x31, 0x1c, 0x65, 0x60, 0xa5, 0x60, 0x20, 0x1c, 0x1e, 0x4b, 0x98, 0x47, 
-    0x1e, 0x4f, 0x34, 0x23, 0xfa, 0x21, 0x23, 0x60, 0x38, 0x68, 0x65, 0x60, 
-    0xa5, 0x60, 0x89, 0x00, 0xfd, 0xf7, 0xe4, 0xfc, 0x31, 0x1c, 0xe0, 0x60, 
-    0x17, 0x4b, 0x20, 0x1c, 0x98, 0x47, 0x32, 0x23, 0x23, 0x60, 0x31, 0x1c, 
-    0x65, 0x60, 0xa5, 0x60, 0x20, 0x1c, 0x13, 0x4b, 0x98, 0x47, 0x33, 0x23, 
-    0x23, 0x60, 0xe0, 0x23, 0x9b, 0x02, 0x63, 0x60, 0x0b, 0x4b, 0xfa, 0x21, 
-    0xa3, 0x60, 0x80, 0x23, 0x5b, 0x00, 0xe3, 0x60, 0x38, 0x68, 0x89, 0x00, 
-    0xfd, 0xf7, 0xc8, 0xfc, 0x31, 0x1c, 0x20, 0x61, 0x09, 0x4b, 0x20, 0x1c, 
-    0x98, 0x47, 0x62, 0xb6, 0x09, 0x4a, 0x0a, 0x4b, 0xda, 0x60, 0xfe, 0xe7, 
-    0x01, 0x20, 0x07, 0xb0, 0xf0, 0xbd, 0xc0, 0x46, 0x64, 0x02, 0x00, 0x10, 
-    0x1e, 0xab, 0x07, 0xb0, 0x64, 0x03, 0x00, 0x10, 0x78, 0x03, 0x00, 0x10, 
-    0xf1, 0x1f, 0xff, 0x1f, 0x04, 0x01, 0x00, 0x10, 0x04, 0x00, 0xfa, 0x05, 
-    0x00, 0xed, 0x00, 0xe0, 0x10, 0xb5, 0x3d, 0x23, 0x8a, 0xb0, 0x05, 0x93, 
-    0x0d, 0x4b, 0x07, 0x91, 0xfa, 0x21, 0x06, 0x90, 0x89, 0x00, 0x18, 0x68, 
-    0x08, 0x92, 0xfd, 0xf7, 0x9d, 0xfc, 0x0a, 0x4c, 0x01, 0x23, 0x09, 0x90, 
-    0x63, 0x60, 0x72, 0xb6, 0x08, 0x4b, 0x05, 0xa8, 0x1b, 0x68, 0x01, 0xa9, 
-    0x98, 0x47, 0x62, 0xb6, 0x00, 0x23, 0x63, 0x60, 0x01, 0x9b, 0x00, 0x2b, 
-    0x00, 0xd0, 0xfe, 0xe7, 0x0a, 0xb0, 0x10, 0xbd, 0x04, 0x01, 0x00, 0x10, 
-    0x00, 0x40, 0x01, 0x40, 0x0c, 0x01, 0x00, 0x10, 0x00, 0xb5, 0x3e, 0x23, 
-    0x8b, 0xb0, 0x05, 0x93, 0x0b, 0x4b, 0x07, 0x91, 0xfa, 0x21, 0x06, 0x90, 
-    0x89, 0x00, 0x18, 0x68, 0x08, 0x92, 0xfd, 0xf7, 0x77, 0xfc, 0x09, 0x90, 
-    0x72, 0xb6, 0x07, 0x4b, 0x05, 0xa8, 0x1b, 0x68, 0x01, 0xa9, 0x98, 0x47, 
-    0x62, 0xb6, 0x01, 0x9b, 0x00, 0x2b, 0x00, 0xd0, 0xfe, 0xe7, 0x0b, 0xb0, 
-    0x00, 0xbd, 0xc0, 0x46, 0x04, 0x01, 0x00, 0x10, 0x0c, 0x01, 0x00, 0x10, 
-    0x00, 0xb5, 0x3e, 0x23, 0x8b, 0xb0, 0x05, 0x93, 0x0b, 0x4b, 0x07, 0x91, 
-    0xfa, 0x21, 0x06, 0x90, 0x89, 0x00, 0x18, 0x68, 0x08, 0x92, 0xfd, 0xf7, 
-    0x57, 0xfc, 0x09, 0x90, 0x72, 0xb6, 0x07, 0x4b, 0x05, 0xa8, 0x1b, 0x68, 
-    0x01, 0xa9, 0x98, 0x47, 0x62, 0xb6, 0x01, 0x9b, 0x00, 0x2b, 0x00, 0xd0, 
-    0xfe, 0xe7, 0x0b, 0xb0, 0x00, 0xbd, 0xc0, 0x46, 0x04, 0x01, 0x00, 0x10, 
-    0x0c, 0x01, 0x00, 0x10, 0x08, 0xb5, 0x02, 0x4b, 0x1b, 0x68, 0x98, 0x47, 
-    0x08, 0xbd, 0xc0, 0x46, 0xf1, 0x1f, 0xff, 0x1f, 0x00, 0xb5, 0x03, 0x1c, 
-    0x89, 0xb0, 0x0c, 0x20, 0x99, 0x42, 0x0a, 0xd3, 0x32, 0x22, 0x03, 0x92, 
-    0x04, 0x93, 0x05, 0x91, 0x72, 0xb6, 0x03, 0xa8, 0x69, 0x46, 0xff, 0xf7, 
-    0xe9, 0xff, 0x62, 0xb6, 0x00, 0x98, 0x09, 0xb0, 0x00, 0xbd, 0x00, 0xb5, 
-    0x33, 0x23, 0x89, 0xb0, 0x03, 0x93, 0x08, 0x4b, 0x05, 0x91, 0xfa, 0x21, 
-    0x04, 0x90, 0x89, 0x00, 0x18, 0x68, 0x06, 0x92, 0xfd, 0xf7, 0x1c, 0xfc, 
-    0x69, 0x46, 0x07, 0x90, 0x03, 0xa8, 0xff, 0xf7, 0xd3, 0xff, 0x00, 0x98, 
-    0x09, 0xb0, 0x00, 0xbd, 0x04, 0x01, 0x00, 0x10, 0x00, 0xb5, 0x03, 0x1c, 
-    0x89, 0xb0, 0x0c, 0x20, 0x99, 0x42, 0x0f, 0xd3, 0x04, 0x93, 0x08, 0x4b, 
-    0x05, 0x91, 0xfa, 0x21, 0x34, 0x22, 0x18, 0x68, 0x89, 0x00, 0x03, 0x92, 
-    0xfd, 0xf7, 0x02, 0xfc, 0x69, 0x46, 0x06, 0x90, 0x03, 0xa8, 0xff, 0xf7, 
-    0xb9, 0xff, 0x00, 0x98, 0x09, 0xb0, 0x00, 0xbd, 0x04, 0x01, 0x00, 0x10, 
-    0x10, 0xb5, 0x0c, 0x23, 0x88, 0xb0, 0x14, 0x1c, 0x81, 0x42, 0x0d, 0xd3, 
-    0x35, 0x23, 0x04, 0x90, 0x05, 0x91, 0x03, 0xa8, 0x69, 0x46, 0x03, 0x93, 
-    0xff, 0xf7, 0xa6, 0xff, 0x00, 0x9b, 0x08, 0x2b, 0x02, 0xd1, 0x01, 0x9a, 
-    0x23, 0x60, 0x62, 0x60, 0x18, 0x1c, 0x08, 0xb0, 0x10, 0xbd, 0x10, 0xb5, 
-    0x36, 0x23, 0x88, 0xb0, 0x04, 0x1c, 0x03, 0x93, 0x72, 0xb6, 0x03, 0xa8, 
-    0x69, 0x46, 0xff, 0xf7, 0x93, 0xff, 0x62, 0xb6, 0x01, 0x9b, 0x00, 0x98, 
-    0x23, 0x60, 0x08, 0xb0, 0x10, 0xbd, 0x30, 0xb5, 0x89, 0xb0, 0x05, 0x1c, 
-    0x0c, 0x1c, 0x37, 0x23, 0x03, 0xa8, 0x69, 0x46, 0x03, 0x93, 0xff, 0xf7, 
-    0x83, 0xff, 0x01, 0x9b, 0x00, 0x98, 0x1a, 0x04, 0x12, 0x0e, 0xdb, 0xb2, 
-    0x2a, 0x60, 0x23, 0x60, 0x09, 0xb0, 0x30, 0xbd, 0x10, 0xb5, 0x88, 0xb0, 
-    0x04, 0x90, 0x05, 0x91, 0x03, 0xa8, 0x1c, 0x1c, 0x69, 0x46, 0x38, 0x23, 
-    0x03, 0x93, 0x06, 0x92, 0xff, 0xf7, 0x6e, 0xff, 0x00, 0x98, 0x0a, 0x28, 
-    0x03, 0xd1, 0x00, 0x2c, 0x01, 0xd0, 0x01, 0x9b, 0x23, 0x60, 0x08, 0xb0, 
-    0x10, 0xbd, 0x00, 0xb5, 0x89, 0xb0, 0x39, 0x23, 0x03, 0xa8, 0x69, 0x46, 
-    0x03, 0x93, 0xff, 0xf7, 0x5d, 0xff, 0x09, 0xb0, 0x00, 0xbd, 0x10, 0xb5, 
-    0x8a, 0xb0, 0x04, 0x1c, 0x3a, 0x23, 0x05, 0xa8, 0x69, 0x46, 0x05, 0x93, 
-    0xff, 0xf7, 0x52, 0xff, 0x02, 0x9b, 0x00, 0x98, 0x23, 0x60, 0x03, 0x9b, 
-    0x63, 0x60, 0x04, 0x9b, 0xa3, 0x60, 0x0a, 0xb0, 0x10, 0xbd, 0x00, 0xb5, 
-    0x03, 0x1c, 0x89, 0xb0, 0x0c, 0x20, 0x99, 0x42, 0x0f, 0xd3, 0x04, 0x93, 
-    0x08, 0x4b, 0x05, 0x91, 0xfa, 0x21, 0x3b, 0x22, 0x18, 0x68, 0x89, 0x00, 
-    0x03, 0x92, 0xfd, 0xf7, 0x7d, 0xfb, 0x69, 0x46, 0x06, 0x90, 0x03, 0xa8, 
-    0xff, 0xf7, 0x34, 0xff, 0x00, 0x98, 0x09, 0xb0, 0x00, 0xbd, 0xc0, 0x46, 
-    0x04, 0x01, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x6c, 0xdc, 0x02, 
-    0x10, 0x00, 0x00, 0x00, 0xf1, 0x1f, 0xff, 0x1f, 0xff, 0xff, 0x00, 0x00, 
-    0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xa0, 0xe4, 0x03, 0x00, 
-    0xc0, 0xe4, 0x03, 0x00, 0xe0, 0xe4, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 
-    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
-    0x7a, 0xde, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
-    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
-    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
-    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
-    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
-    0x00, 0x00, 0x00, 0x00, 0x18, 0x01, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 
-    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
-    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
-    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
-    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
-    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
-    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
-    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
-    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
-    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
-    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
-    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
-    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
-    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
-    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
-    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
-    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
-    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
-    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
-    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
-    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
-    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
-    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
-    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
-    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
-    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
-    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
-    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
-    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
-    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
-    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
-    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
-    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
-    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
-    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
-    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
-    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
-    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
-    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
-    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
-    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
-    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
-    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
-    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
-    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
-    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
-    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
-    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
-    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
-    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
-    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
-    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
-    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
-    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
-    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
-    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
-    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
-    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
-    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
-    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
-    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
-    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
-    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
-    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
-    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
-    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
-    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
-    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
-    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
-    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
-    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
-    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
-    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
-    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
-    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
-    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
-    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
-    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
-    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
-    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
-    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
-    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
-    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
-    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
-    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
-    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
-    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
-    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
-    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
-    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
-    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
-    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
-    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
-    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
-    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
-    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
-    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
-    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
-    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
-    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
-    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
-    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
-    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
-    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
-    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
-    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
-    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
-    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
-    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
-    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
-    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
-    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
-    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
-    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
-    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
-    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
-    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
-    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
-    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
-    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
-    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
-    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
-    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
-    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
-    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
-    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
-    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
-    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
-    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
-    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
-    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
-    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
-    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
-    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
-    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
-    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
-    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
-    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
-    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
-    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
-    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
-    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
-    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
-    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
-    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
-    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
-    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
-    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
-    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
-    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
-    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
-    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
-    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
-    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
-    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
-    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
-    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
-    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
-    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
-    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
-    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
-    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
-    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
-    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
-    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
-    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
-    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
-    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
-    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
-    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
-    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
-    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
-    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
-    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
-    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
-    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
-    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
-    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
-    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
-    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
-    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
-    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
-    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
-    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
-    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
-    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
-    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
-    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
-    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
-    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
-    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
-    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
-    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
-    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
-    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
-    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
-    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
-    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
-    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
-    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
-    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
-    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
-    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
-    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
-    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
-    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
-    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
-    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
-    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
-    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
-    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
-    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
-    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
-    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
-    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
-    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
-    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
-    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
-    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
-    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
-    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
-    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
-    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
-    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
-    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
-    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
-    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
-    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
-    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
-    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
-    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
-    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
-    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
-    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
-    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
-    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
-    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
-    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
-    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
-    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
-    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
-    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
-    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
-    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
-    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
-    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
-    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
-    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
-    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
-    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
-    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
-    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
-    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
-    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
-    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
-    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
-    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
-    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
-    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
-    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
-    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
-    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
-    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
-    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
-    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
-    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
-    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
-    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
-    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
-    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
-    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
-    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
-    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
-    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
-    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
-    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
-    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
-    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
-    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
-    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
-    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
-    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
-    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
-    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
-    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
-    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
-    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
-    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
-    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
-    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
-    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
-    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
-    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
-    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
-    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
-    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
-    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
-    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
-    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
-    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
-    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
-    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
-    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
-    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
-    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
-    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
-    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
-    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
-    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
-    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
-    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
-    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
-    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
-    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
-    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
-    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
-    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
-    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
-    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
-    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
-    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
-    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
-    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
-    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
-    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
-    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
-    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
-    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
-    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
-    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
-    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
-    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
-    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
-    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
-    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
-    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
-    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
-    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
-    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
-    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
-    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
-    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
-    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
-    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
-    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
-    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
-    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
-    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
-    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
-    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
-};
-
-//const unsigned long flash_key1[1] __attribute__((section(".ARM.__at_0x3FFF4"))) = {0x1eab07b0};
-
-
-//static const unsigned char bootable[] __attribute__((section(".ARM.__at_0x3FFF4"))) = {
-static const unsigned char bootable[]__attribute__((at(0x3FE04))) = { 
-	    //(.bootable*)
-        0x1E,
-        0xAB,
-        0x07,
-        0xB0,
-        // version and options 
-        0x01,
-        0x00,
-        0x00,
-        0x00,
-        // jump address 
-        0x00,
-        0x90,
-        0x03,
-        0x00
-};
-
-#endif
-
--- a/POKITTO_HW/lpc_defs.h	Wed Jun 27 13:14:54 2018 +0000
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,217 +0,0 @@
-#ifndef LPCDEFS_H
-#define LPCDEFS_H
-
-#include <stdint.h>
-
-#ifdef __cplusplus
-  #define   __I     volatile             /*!< Defines 'read only' permissions                 */
-#else
-  #define   __I     volatile const       /*!< Defines 'read only' permissions                 */
-#endif
-#define     __O     volatile             /*!< Defines 'write only' permissions                */
-#define     __IO    volatile             /*!< Defines 'read / write' permissions              */
-
-
-#define LPC_PMU_BASE              0x40038000
-#define LPC_IOCON_BASE            0x40044000
-#define LPC_SYSCTL_BASE           0x40048000
-#define LPC_GPIO_PORT_BASE        0xA0000000
-#define LPC_GPIO_GROUP_INT0_BASE  0x4005C000
-#define LPC_GPIO_GROUP_INT1_BASE  0x40060000
-#define LPC_PIN_INT_BASE          0xA0004000
-#define LPC_USART0_BASE           0x40008000
-#define LPC_USART1_BASE           0x4006C000
-#define LPC_USART2_BASE           0x40070000
-#define LPC_USART3_BASE           0x40074000
-#define LPC_USART4_BASE           0x4004C000
-#define LPC_I2C0_BASE             0x40000000
-#define LPC_I2C1_BASE             0x40020000
-#define LPC_SSP0_BASE             0x40040000
-#define LPC_SSP1_BASE             0x40058000
-#define LPC_USB0_BASE             0x40080000
-#define LPC_ADC_BASE              0x4001C000
-#define LPC_SCT0_BASE             0x5000C000
-#define LPC_SCT1_BASE             0x5000E000
-#define LPC_TIMER16_0_BASE        0x4000C000
-#define LPC_TIMER16_1_BASE        0x40010000
-#define LPC_TIMER32_0_BASE        0x40014000
-#define LPC_TIMER32_1_BASE        0x40018000
-#define LPC_RTC_BASE              0x40024000
-#define LPC_WWDT_BASE             0x40004000
-#define LPC_DMA_BASE              0x50004000
-#define LPC_CRC_BASE              0x50000000
-#define LPC_FLASH_BASE            0x4003C000
-#define LPC_DMATRIGMUX_BASE       0x40028000UL
-
-/**
- * @brief LPC11U6X System Control block structure
- */
-typedef struct {					/*!< SYSCTL Structure */
-	__IO uint32_t  SYSMEMREMAP;		/*!< System Memory remap register */
-	__IO uint32_t  PRESETCTRL;		/*!< Peripheral reset Control register */
-	__IO uint32_t  SYSPLLCTRL;		/*!< System PLL control register */
-	__I  uint32_t  SYSPLLSTAT;		/*!< System PLL status register */
-	__IO uint32_t  USBPLLCTRL;		/*!< USB PLL control register */
-	__I  uint32_t  USBPLLSTAT;		/*!< USB PLL status register */
-	__I  uint32_t  RESERVED1[1];
-	__IO uint32_t  RTCOSCCTRL;		/*!< RTC Oscillator control register */
-	__IO uint32_t  SYSOSCCTRL;		/*!< System Oscillator control register */
-	__IO uint32_t  WDTOSCCTRL;		/*!< Watchdog Oscillator control register */
-	__I  uint32_t  RESERVED2[2];
-	__IO uint32_t  SYSRSTSTAT;		/*!< System Reset Status register */
-	__I  uint32_t  RESERVED3[3];
-	__IO uint32_t  SYSPLLCLKSEL;	/*!< System PLL clock source select register */
-	__IO uint32_t  SYSPLLCLKUEN;	/*!< System PLL clock source update enable register*/
-	__IO uint32_t  USBPLLCLKSEL;	/*!< USB PLL clock source select register */
-	__IO uint32_t  USBPLLCLKUEN;	/*!< USB PLL clock source update enable register */
-	__I  uint32_t  RESERVED4[8];
-	__IO uint32_t  MAINCLKSEL;		/*!< Main clock source select register */
-	__IO uint32_t  MAINCLKUEN;		/*!< Main clock source update enable register */
-	__IO uint32_t  SYSAHBCLKDIV;	/*!< System Clock divider register */
-	__I  uint32_t  RESERVED5;
-	__IO uint32_t  SYSAHBCLKCTRL;	/*!< System clock control register */
-	__I  uint32_t  RESERVED6[4];
-	__IO uint32_t  SSP0CLKDIV;		/*!< SSP0 clock divider register */
-	__IO uint32_t  USART0CLKDIV;	/*!< UART clock divider register */
-	__IO uint32_t  SSP1CLKDIV;		/*!< SSP1 clock divider register */
-	__IO uint32_t  FRGCLKDIV;		/*!< FRG clock divider (USARTS 1 - 4) register */
-	__I  uint32_t  RESERVED7[7];
-	__IO uint32_t  USBCLKSEL;		/*!< USB clock source select register */
-	__IO uint32_t  USBCLKUEN;		/*!< USB clock source update enable register */
-	__IO uint32_t  USBCLKDIV;		/*!< USB clock source divider register */
-	__I  uint32_t  RESERVED8[5];
-	__IO uint32_t  CLKOUTSEL;		/*!< Clock out source select register */
-	__IO uint32_t  CLKOUTUEN;		/*!< Clock out source update enable register */
-	__IO uint32_t  CLKOUTDIV;		/*!< Clock out divider register */
-	__I  uint32_t  RESERVED9;
-	__IO uint32_t  UARTFRGDIV;		/*!< USART fractional generator divider (USARTS 1 - 4) register */
-	__IO uint32_t  UARTFRGMULT;		/*!< USART fractional generator multiplier (USARTS 1 - 4) register */
-	__I  uint32_t  RESERVED10;
-	__IO uint32_t  EXTTRACECMD;		/*!< External trace buffer command register */
-	__I  uint32_t  PIOPORCAP[3];	/*!< POR captured PIO status registers */
-	__I  uint32_t  RESERVED11[10];
-	__IO uint32_t  IOCONCLKDIV[7];	/*!< IOCON block for programmable glitch filter divider registers */
-	__IO uint32_t  BODCTRL;			/*!< Brown Out Detect register */
-	__IO uint32_t  SYSTCKCAL;		/*!< System tick counter calibration register */
-	__I  uint32_t  RESERVED12[6];
-	__IO uint32_t  IRQLATENCY;		/*!< IRQ delay register */
-	__IO uint32_t  NMISRC;			/*!< NMI source control register */
-	__IO uint32_t  PINTSEL[8];		/*!< GPIO pin interrupt select register 0-7 */
-	__IO uint32_t  USBCLKCTRL;		/*!< USB clock control register */
-	__I  uint32_t  USBCLKST;		/*!< USB clock status register */
-	__I  uint32_t  RESERVED13[25];
-	__IO uint32_t  STARTERP0;		/*!< Start logic 0 interrupt wake-up enable register */
-	__I  uint32_t  RESERVED14[3];
-	__IO uint32_t  STARTERP1;		/*!< Start logic 1 interrupt wake-up enable register */
-	__I  uint32_t  RESERVED15[6];
-	__IO uint32_t  PDSLEEPCFG;		/*!< Power down states in deep sleep mode register */
-	__IO uint32_t  PDWAKECFG;		/*!< Power down states in wake up from deep sleep register */
-	__IO uint32_t  PDRUNCFG;		/*!< Power configuration register*/
-	__I  uint32_t  RESERVED16[110];
-	__I  uint32_t  DEVICEID;		/*!< Device ID register */
-} LPC_SYSCTL_T;
-
-
-#define LPC_SYSCTL_BASE           0x40048000
-
-#define LPC_SYSCTL                ((LPC_SYSCTL_T           *) LPC_SYSCTL_BASE)
-
-
-
-#define LPC_DMA                   ((LPC_DMA_T              *) LPC_DMA_BASE)
-
-/* DMA channel source/address/next descriptor */
-typedef struct {
-	uint32_t  xfercfg;		/*!< Transfer configuration (only used in linked lists and ping-pong configs) */
-	uint32_t  source;		/*!< DMA transfer source end address */
-	uint32_t  dest;			/*!< DMA transfer desintation end address */
-	uint32_t  next;			/*!< Link to next DMA descriptor, must be 16 byte aligned */
-} DMA_CHDESC_T;
-
-
-/* DMA channel mapping - each channel is mapped to an individual peripheral
-   and direction or a DMA imput mux trigger */
-typedef enum {
-	SSP0_RX_DMA = 0,				/*!< SSP0 receive DMA channel */
-	DMA_CH0 = SSP0_RX_DMA,
-	DMAREQ_SSP0_TX,					/*!< SSP0 transmit DMA channel */
-	DMA_CH1 = DMAREQ_SSP0_TX,
-	DMAREQ_SSP1_RX,					/*!< SSP1 receive DMA channel */
-	DMA_CH2 = DMAREQ_SSP1_RX,
-	DMAREQ_SSP1_TX,					/*!< SSP1 transmit DMA channel */
-	DMA_CH3 = DMAREQ_SSP1_TX,
-	DMAREQ_USART0_RX,					/*!< USART0 receive DMA channel */
-	DMA_CH4 = DMAREQ_USART0_RX,
-	DMAREQ_USART0_TX,					/*!< USART0 transmit DMA channel */
-	DMA_CH5 = DMAREQ_USART0_TX,
-	DMAREQ_USART1_RX,					/*!< USART1 transmit DMA channel */
-	DMA_CH6 = DMAREQ_USART1_RX,
-	DMAREQ_USART1_TX,					/*!< USART1 transmit DMA channel */
-	DMA_CH7 = DMAREQ_USART1_TX,
-	DMAREQ_USART2_RX,					/*!< USART2 transmit DMA channel */
-	DMA_CH8 = DMAREQ_USART2_RX,
-	DMAREQ_USART2_TX,					/*!< USART2 transmit DMA channel */
-	DMA_CH9 = DMAREQ_USART2_TX,
-	DMAREQ_USART3_RX,					/*!< USART3 transmit DMA channel */
-	DMA_CH10 = DMAREQ_USART3_RX,
-	DMAREQ_USART3_TX,					/*!< USART3 transmit DMA channel */
-	DMA_CH11 = DMAREQ_USART3_TX,
-	DMAREQ_USART4_RX,					/*!< USART4 transmit DMA channel */
-	DMA_CH12 = DMAREQ_USART4_RX,
-	DMAREQ_USART4_TX,					/*!< USART4 transmit DMA channel */
-	DMA_CH13 = DMAREQ_USART4_TX,
-	DMAREQ_RESERVED_14,
-	DMA_CH14 = DMAREQ_RESERVED_14,
-	DMAREQ_RESERVED_15,
-	DMA_CH15 = DMAREQ_RESERVED_15
-} DMA_CHID_T;
-
-/* On LPC412x, Max DMA channel is 22 */
-#define MAX_DMA_CHANNEL			(DMA_CH15 + 1)
-
-#undef _BIT
-/* Set bit macro */
-#define _BIT(n) (1 << (n))
-
-/* _SBF(f,v) sets the bit field starting at position "f" to value "v".
- * _SBF(f,v) is intended to be used in "OR" and "AND" expressions:
- * e.g., "((_SBF(5,7) | _SBF(12,0xF)) & 0xFFFF)"
- */
-#undef _SBF
-/* Set bit field macro */
-#define _SBF(f, v) ((v) << (f))
-
-/* _BITMASK constructs a symbol with 'field_width' least significant
- * bits set.
- * e.g., _BITMASK(5) constructs '0x1F', _BITMASK(16) == 0xFFFF
- * The symbol is intended to be used to limit the bit field width
- * thusly:
- * <a_register> = (any_expression) & _BITMASK(x), where 0 < x <= 32.
- * If "any_expression" results in a value that is larger than can be
- * contained in 'x' bits, the bits above 'x - 1' are masked off.  When
- * used with the _SBF example above, the example would be written:
- * a_reg = ((_SBF(5,7) | _SBF(12,0xF)) & _BITMASK(16))
- * This ensures that the value written to a_reg is no wider than
- * 16 bits, and makes the code easier to read and understand.
- */
-#undef _BITMASK
-/* Bitmask creation macro */
-#define _BITMASK(field_width) ( _BIT(field_width) - 1)
-
-/* NULL pointer */
-#ifndef NULL
-#define NULL ((void *) 0)
-#endif
-
-/* Number of elements in an array */
-#define NELEMENTS(array)  (sizeof(array) / sizeof(array[0]))
-
-#define LPC_SCT0                  ((LPC_SCT_T              *) LPC_SCT0_BASE)
-#define LPC_SCT1                  ((LPC_SCT_T              *) LPC_SCT1_BASE)
-#define LPC_TIMER16_0             ((LPC_TIMER_T            *) LPC_TIMER16_0_BASE)
-#define LPC_TIMER16_1             ((LPC_TIMER_T            *) LPC_TIMER16_1_BASE)
-#define LPC_TIMER32_0             ((LPC_TIMER_T            *) LPC_TIMER32_0_BASE)
-#define LPC_TIMER32_1             ((LPC_TIMER_T            *) LPC_TIMER32_1_BASE)
-
-#endif
-
--- a/POKITTO_HW/lpc_types.h	Wed Jun 27 13:14:54 2018 +0000
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,217 +0,0 @@
-/*
- * @brief Common types used in LPC functions
- *
- * @note
- * Copyright(C) NXP Semiconductors, 2012
- * All rights reserved.
- *
- * @par
- * Software that is described herein is for illustrative purposes only
- * which provides customers with programming information regarding the
- * LPC products.  This software is supplied "AS IS" without any warranties of
- * any kind, and NXP Semiconductors and its licensor disclaim any and
- * all warranties, express or implied, including all implied warranties of
- * merchantability, fitness for a particular purpose and non-infringement of
- * intellectual property rights.  NXP Semiconductors assumes no responsibility
- * or liability for the use of the software, conveys no license or rights under any
- * patent, copyright, mask work right, or any other intellectual property rights in
- * or to any products. NXP Semiconductors reserves the right to make changes
- * in the software without notification. NXP Semiconductors also makes no
- * representation or warranty that such application will be suitable for the
- * specified use without further testing or modification.
- *
- * @par
- * Permission to use, copy, modify, and distribute this software and its
- * documentation is hereby granted, under NXP Semiconductors' and its
- * licensor's relevant copyrights in the software, without fee, provided that it
- * is used in conjunction with NXP Semiconductors microcontrollers.  This
- * copyright, permission, and disclaimer notice must appear in all copies of
- * this code.
- */
-
-#ifndef __LPC_TYPES_H_
-#define __LPC_TYPES_H_
-
-#include <stdint.h>
-#include <stdbool.h>
-
-/** @defgroup LPC_Types CHIP: LPC Common Types
- * @ingroup CHIP_Common
- * @{
- */
-
-/** @defgroup LPC_Types_Public_Types LPC Public Types
- * @{
- */
-
-/**
- * @brief Boolean Type definition
- */
-typedef enum {FALSE = 0, TRUE = !FALSE} Bool;
-
-/**
- * @brief Boolean Type definition
- */
-#if !defined(__cplusplus)
-// typedef enum {false = 0, true = !false} bool;
-#endif
-
-/**
- * @brief Flag Status and Interrupt Flag Status type definition
- */
-typedef enum {RESET = 0, SET = !RESET} FlagStatus, IntStatus, SetState;
-#define PARAM_SETSTATE(State) ((State == RESET) || (State == SET))
-
-/**
- * @brief Functional State Definition
- */
-typedef enum {DISABLE = 0, ENABLE = !DISABLE} FunctionalState;
-#define PARAM_FUNCTIONALSTATE(State) ((State == DISABLE) || (State == ENABLE))
-
-/**
- * @ Status type definition
- */
-typedef enum {ERROR = 0, SUCCESS = !ERROR} Status;
-
-/**
- * Read/Write transfer type mode (Block or non-block)
- */
-typedef enum {
-	NONE_BLOCKING = 0,		/**< None Blocking type */
-	BLOCKING,				/**< Blocking type */
-} TRANSFER_BLOCK_T;
-
-/** Pointer to Function returning Void (any number of parameters) */
-typedef void (*PFV)();
-
-/** Pointer to Function returning int32_t (any number of parameters) */
-typedef int32_t (*PFI)();
-
-/**
- * @}
- */
-
-/** @defgroup LPC_Types_Public_Macros  LPC Public Macros
- * @{
- */
-
-/* _BIT(n) sets the bit at position "n"
- * _BIT(n) is intended to be used in "OR" and "AND" expressions:
- * e.g., "(_BIT(3) | _BIT(7))".
- */
-#undef _BIT
-/* Set bit macro */
-#define _BIT(n) (1 << (n))
-
-/* _SBF(f,v) sets the bit field starting at position "f" to value "v".
- * _SBF(f,v) is intended to be used in "OR" and "AND" expressions:
- * e.g., "((_SBF(5,7) | _SBF(12,0xF)) & 0xFFFF)"
- */
-#undef _SBF
-/* Set bit field macro */
-#define _SBF(f, v) ((v) << (f))
-
-/* _BITMASK constructs a symbol with 'field_width' least significant
- * bits set.
- * e.g., _BITMASK(5) constructs '0x1F', _BITMASK(16) == 0xFFFF
- * The symbol is intended to be used to limit the bit field width
- * thusly:
- * <a_register> = (any_expression) & _BITMASK(x), where 0 < x <= 32.
- * If "any_expression" results in a value that is larger than can be
- * contained in 'x' bits, the bits above 'x - 1' are masked off.  When
- * used with the _SBF example above, the example would be written:
- * a_reg = ((_SBF(5,7) | _SBF(12,0xF)) & _BITMASK(16))
- * This ensures that the value written to a_reg is no wider than
- * 16 bits, and makes the code easier to read and understand.
- */
-#undef _BITMASK
-/* Bitmask creation macro */
-#define _BITMASK(field_width) ( _BIT(field_width) - 1)
-
-/* NULL pointer */
-#ifndef NULL
-#define NULL ((void *) 0)
-#endif
-
-/* Number of elements in an array */
-#define NELEMENTS(array)  (sizeof(array) / sizeof(array[0]))
-
-/* Static data/function define */
-#define STATIC static
-/* External data/function define */
-#define EXTERN extern
-
-#if !defined(MAX)
-#define MAX(a, b) (((a) > (b)) ? (a) : (b))
-#endif
-#if !defined(MIN)
-#define MIN(a, b) (((a) < (b)) ? (a) : (b))
-#endif
-
-/**
- * @}
- */
-
-/* Old Type Definition compatibility */
-/** @addtogroup LPC_Types_Public_Types
- * @{
- */
-
-/** LPC type for character type */
-//typedef char CHAR;
-
-/** LPC type for 8 bit unsigned value */
-typedef uint8_t UNS_8;
-
-/** LPC type for 8 bit signed value */
-typedef int8_t INT_8;
-
-/** LPC type for 16 bit unsigned value */
-typedef uint16_t UNS_16;
-
-/** LPC type for 16 bit signed value */
-typedef int16_t INT_16;
-
-/** LPC type for 32 bit unsigned value */
-typedef uint32_t UNS_32;
-
-/** LPC type for 32 bit signed value */
-typedef int32_t INT_32;
-
-/** LPC type for 64 bit signed value */
-typedef int64_t INT_64;
-
-/** LPC type for 64 bit unsigned value */
-typedef uint64_t UNS_64;
-
-#ifdef __CODE_RED
-#define BOOL_32 bool
-#define BOOL_16 bool
-#define BOOL_8  bool
-#else
-/** 32 bit boolean type */
-typedef bool BOOL_32;
-
-/** 16 bit boolean type */
-typedef bool BOOL_16;
-
-/** 8 bit boolean type */
-typedef bool BOOL_8;
-#endif
-
-#ifdef __CC_ARM
-#define INLINE  __inline
-#else
-#define INLINE inline
-#endif
-
-/**
- * @}
- */
-
-/**
- * @}
- */
-
-#endif /* __LPC_TYPES_H_ */
-
--- a/POKITTO_HW/sys_config.h	Wed Jun 27 13:14:54 2018 +0000
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,37 +0,0 @@
-/*
- * @note
- * Copyright(C) NXP Semiconductors, 2013
- * All rights reserved.
- *
- * @par
- * Software that is described herein is for illustrative purposes only
- * which provides customers with programming information regarding the
- * LPC products.  This software is supplied "AS IS" without any warranties of
- * any kind, and NXP Semiconductors and its licensor disclaim any and
- * all warranties, express or implied, including all implied warranties of
- * merchantability, fitness for a particular purpose and non-infringement of
- * intellectual property rights.  NXP Semiconductors assumes no responsibility
- * or liability for the use of the software, conveys no license or rights under any
- * patent, copyright, mask work right, or any other intellectual property rights in
- * or to any products. NXP Semiconductors reserves the right to make changes
- * in the software without notification. NXP Semiconductors also makes no
- * representation or warranty that such application will be suitable for the
- * specified use without further testing or modification.
- *
- * @par
- * Permission to use, copy, modify, and distribute this software and its
- * documentation is hereby granted, under NXP Semiconductors' and its
- * licensor's relevant copyrights in the software, without fee, provided that it
- * is used in conjunction with NXP Semiconductors microcontrollers.  This
- * copyright, permission, and disclaimer notice must appear in all copies of
- * this code.
- */
-
-#ifndef __SYS_CONFIG_H_
-#define __SYS_CONFIG_H_
-
-/* Required for the LPC11U6x device */
-#define CHIP_LPC11U6X
-
-#endif /* __SYS_CONFIG_H_ */
-
--- a/POKITTO_HW/timer_11u6x.c	Wed Jun 27 13:14:54 2018 +0000
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,132 +0,0 @@
-/*
- * @brief LPC11u6x 16/32-bit Timer/PWM control functions
- *
- * @note
- * Copyright(C) NXP Semiconductors, 2013
- * All rights reserved.
- *
- * @par
- * Software that is described herein is for illustrative purposes only
- * which provides customers with programming information regarding the
- * LPC products.  This software is supplied "AS IS" without any warranties of
- * any kind, and NXP Semiconductors and its licensor disclaim any and
- * all warranties, express or implied, including all implied warranties of
- * merchantability, fitness for a particular purpose and non-infringement of
- * intellectual property rights.  NXP Semiconductors assumes no responsibility
- * or liability for the use of the software, conveys no license or rights under any
- * patent, copyright, mask work right, or any other intellectual property rights in
- * or to any products. NXP Semiconductors reserves the right to make changes
- * in the software without notification. NXP Semiconductors also makes no
- * representation or warranty that such application will be suitable for the
- * specified use without further testing or modification.
- *
- * @par
- * Permission to use, copy, modify, and distribute this software and its
- * documentation is hereby granted, under NXP Semiconductors' and its
- * licensor's relevant copyrights in the software, without fee, provided that it
- * is used in conjunction with NXP Semiconductors microcontrollers.  This
- * copyright, permission, and disclaimer notice must appear in all copies of
- * this code.
- */
-
-//#include "chip.h"
-//#include "lpc_defs.h"
-#include "timer_11u6x.h"
-#include "clock_11u6x.h"
-
-/* System oscillator rate and RTC oscillator rate */
-const uint32_t OscRateIn = 12000000;
-const uint32_t RTCOscRateIn = 32768;
-
-
-/*****************************************************************************
- * Private types/enumerations/variables
- ****************************************************************************/
-
-/*****************************************************************************
- * Public types/enumerations/variables
- ****************************************************************************/
-
-/*****************************************************************************
- * Private functions
- ****************************************************************************/
-
-/* Static data/function define */
-#define STATIC static
-/* External data/function define */
-#define EXTERN extern
-
-
-
-
-/* Returns clock index for a specific timer referenced by IP block address */
-STATIC CHIP_SYSCTL_CLOCK_T Chip_TIMER_GetClock(LPC_TIMER_T *pTMR)
-{
-	CHIP_SYSCTL_CLOCK_T tmrClk;
-	if (pTMR == LPC_TIMER32_1) {
-		tmrClk = SYSCTL_CLOCK_CT32B1;
-	}
-	else if (pTMR == LPC_TIMER16_0) {
-		tmrClk = SYSCTL_CLOCK_CT16B0;
-	}
-	else if (pTMR == LPC_TIMER16_1) {
-		tmrClk = SYSCTL_CLOCK_CT16B1;
-	}
-	else {
-		tmrClk = SYSCTL_CLOCK_CT32B0;
-	}
-
-	return tmrClk;
-}
-
-/*****************************************************************************
- * Public functions
- ****************************************************************************/
-
-/* Initialize a timer */
-void Chip_TIMER_Init(LPC_TIMER_T *pTMR)
-{
-	Chip_Clock_EnablePeriphClock(Chip_TIMER_GetClock(pTMR));
-}
-
-/*	Shutdown a timer */
-void Chip_TIMER_DeInit(LPC_TIMER_T *pTMR)
-{
-	Chip_Clock_DisablePeriphClock(Chip_TIMER_GetClock(pTMR));
-}
-
-/* Resets the timer terminal and prescale counts to 0 */
-void Chip_TIMER_Reset(LPC_TIMER_T *pTMR)
-{
-	uint32_t reg;
-
-	/* Disable timer, set terminal count to non-0 */
-	reg = pTMR->TCR;
-	pTMR->TCR = 0;
-	pTMR->TC = 1;
-
-	/* Reset timer counter */
-	pTMR->TCR = TIMER_RESET;
-
-	/* Wait for terminal count to clear */
-	while (pTMR->TC != 0) {}
-
-	/* Restore timer state */
-	pTMR->TCR = reg;
-}
-
-/* Sets external match control (MATn.matchnum) pin control */
-void Chip_TIMER_ExtMatchControlSet(LPC_TIMER_T *pTMR, int8_t initial_state,
-								   TIMER_PIN_MATCH_STATE_T matchState, int8_t matchnum)
-{
-	uint32_t mask, reg;
-
-	/* Clear bits corresponding to selected match register */
-	mask = (1 << matchnum) | (0x03 << (4 + (matchnum * 2)));
-	reg = pTMR->EMR &= ~mask;
-
-	/* Set new configuration for selected match register */
-	pTMR->EMR = reg | (((uint32_t) initial_state) << matchnum) |
-				(((uint32_t) matchState) << (4 + (matchnum * 2)));
-}
-
--- a/POKITTO_HW/timer_11u6x.h	Wed Jun 27 13:14:54 2018 +0000
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,504 +0,0 @@
-/*
- * @brief LPC11u6x 16/32-bit Timer/PWM control functions
- *
- * @note
- * Copyright(C) NXP Semiconductors, 2013
- * All rights reserved.
- *
- * @par
- * Software that is described herein is for illustrative purposes only
- * which provides customers with programming information regarding the
- * LPC products.  This software is supplied "AS IS" without any warranties of
- * any kind, and NXP Semiconductors and its licensor disclaim any and
- * all warranties, express or implied, including all implied warranties of
- * merchantability, fitness for a particular purpose and non-infringement of
- * intellectual property rights.  NXP Semiconductors assumes no responsibility
- * or liability for the use of the software, conveys no license or rights under any
- * patent, copyright, mask work right, or any other intellectual property rights in
- * or to any products. NXP Semiconductors reserves the right to make changes
- * in the software without notification. NXP Semiconductors also makes no
- * representation or warranty that such application will be suitable for the
- * specified use without further testing or modification.
- *
- * @par
- * Permission to use, copy, modify, and distribute this software and its
- * documentation is hereby granted, under NXP Semiconductors' and its
- * licensor's relevant copyrights in the software, without fee, provided that it
- * is used in conjunction with NXP Semiconductors microcontrollers.  This
- * copyright, permission, and disclaimer notice must appear in all copies of
- * this code.
- */
-
-#ifndef __TIMER_11U6X_H_
-#define __TIMER_11U6X_H_
-
-#include "lpc_defs.h"
-#include <stdint.h>
-
-/* Static data/function define */
-#define STATIC static
-/* External data/function define */
-#define EXTERN extern
-#define INLINE inline
-#define bool uint8_t
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-/** @defgroup TIMER_11U6X CHIP: LPC11u6x 16/32-bit Timer driver
- * @ingroup CHIP_11U6X_Drivers
- * <b>IMPORTANT NOTE ABOUT lpc11u6x TIMERS</b><br>
- * For timer 0 on both the 16-bit and 32-bit timers, the capture functions
- * use index 0 for capture 0 functions and index 2 for capture 1 functions,
- * while timer 1 for both the 16-bit and 32-bit timers uses index 0 and
- * index 1. Use care when selecting
- * The LPC11U6X User manual is inconsistent in it's designation of capture
- * channels for each timer. See the comments for each function for special
- * handling per timer when dealing with capture channels.
- * @{
- */
-
-/**
- * @brief 32-bit Standard timer register block structure
- */
-typedef struct {				/*!< TIMERn Structure       */
-	__IO uint32_t IR;			/*!< Interrupt Register. The IR can be written to clear interrupts. The IR can be read to identify which of eight possible interrupt sources are pending. */
-	__IO uint32_t TCR;			/*!< Timer Control Register. The TCR is used to control the Timer Counter functions. The Timer Counter can be disabled or reset through the TCR. */
-	__IO uint32_t TC;			/*!< Timer Counter. The 32 bit TC is incremented every PR+1 cycles of PCLK. The TC is controlled through the TCR. */
-	__IO uint32_t PR;			/*!< Prescale Register. The Prescale Counter (below) is equal to this value, the next clock increments the TC and clears the PC. */
-	__IO uint32_t PC;			/*!< Prescale Counter. The 32 bit PC is a counter which is incremented to the value stored in PR. When the value in PR is reached, the TC is incremented and the PC is cleared. The PC is observable and controllable through the bus interface. */
-	__IO uint32_t MCR;			/*!< Match Control Register. The MCR is used to control if an interrupt is generated and if the TC is reset when a Match occurs. */
-	__IO uint32_t MR[4];		/*!< Match Register. MR can be enabled through the MCR to reset the TC, stop both the TC and PC, and/or generate an interrupt every time MR matches the TC. */
-	__IO uint32_t CCR;			/*!< Capture Control Register. The CCR controls which edges of the capture inputs are used to load the Capture Registers and whether or not an interrupt is generated when a capture takes place. */
-	__IO uint32_t CR[4];		/*!< Capture Register. CR is loaded with the value of TC when there is an event on the CAPn.0 input. */
-	__IO uint32_t EMR;			/*!< External Match Register. The EMR controls the external match pins MATn.0-3 (MAT0.0-3 and MAT1.0-3 respectively). */
-	__I  uint32_t RESERVED0[12];
-	__IO uint32_t CTCR;			/*!< Count Control Register. The CTCR selects between Timer and Counter mode, and in Counter mode selects the signal and edge(s) for counting. */
-	__IO uint32_t PWMC;
-} LPC_TIMER_T;
-
-/** Macro to clear interrupt pending */
-#define TIMER_IR_CLR(n)         _BIT(n)
-
-/** Macro for getting a timer match interrupt bit */
-#define TIMER_MATCH_INT(n)      (_BIT((n) & 0x0F))
-/** Macro for getting a capture event interrupt bit */
-#define TIMER_CAP_INT(n)        (_BIT((((n) & 0x0F) + 4)))
-
-/** Timer/counter enable bit */
-#define TIMER_ENABLE            ((uint32_t) (1 << 0))
-/** Timer/counter reset bit */
-#define TIMER_RESET             ((uint32_t) (1 << 1))
-
-/** Bit location for interrupt on MRx match, n = 0 to 3 */
-#define TIMER_INT_ON_MATCH(n)   (_BIT(((n) * 3)))
-/** Bit location for reset on MRx match, n = 0 to 3 */
-#define TIMER_RESET_ON_MATCH(n) (_BIT((((n) * 3) + 1)))
-/** Bit location for stop on MRx match, n = 0 to 3 */
-#define TIMER_STOP_ON_MATCH(n)  (_BIT((((n) * 3) + 2)))
-
-/** Bit location for CAP.n on CRx rising edge, n = 0 to 3 */
-#define TIMER_CAP_RISING(n)     (_BIT(((n) * 3)))
-/** Bit location for CAP.n on CRx falling edge, n = 0 to 3 */
-#define TIMER_CAP_FALLING(n)    (_BIT((((n) * 3) + 1)))
-/** Bit location for CAP.n on CRx interrupt enable, n = 0 to 3 */
-#define TIMER_INT_ON_CAP(n)     (_BIT((((n) * 3) + 2)))
-
-/**
- * @brief	Initialize a timer
- * @param	pTMR	: Pointer to timer IP register address
- * @return	Nothing
- */
-void Chip_TIMER_Init(LPC_TIMER_T *pTMR);
-
-/**
- * @brief	Shutdown a timer
- * @param	pTMR	: Pointer to timer IP register address
- * @return	Nothing
- */
-void Chip_TIMER_DeInit(LPC_TIMER_T *pTMR);
-
-/**
- * @brief	Determine if a match interrupt is pending
- * @param	pTMR		: Pointer to timer IP register address
- * @param	matchnum	: Match interrupt number to check
- * @return	false if the interrupt is not pending, otherwise true
- * @note	Determine if the match interrupt for the passed timer and match
- * counter is pending.<br>
- */
-STATIC INLINE bool Chip_TIMER_MatchPending(LPC_TIMER_T *pTMR, int8_t matchnum)
-{
-	return (bool) ((pTMR->IR & TIMER_MATCH_INT(matchnum)) != 0);
-}
-
-/**
- * @brief	Determine if a capture interrupt is pending
- * @param	pTMR	: Pointer to timer IP register address
- * @param	capnum	: Capture interrupt number to check
- * @return	false if the interrupt is not pending, otherwise true
- * @note	Determine if the capture interrupt for the passed capture pin is
- * pending.<br>
- * <b>Special handling for timer 0</b><br>
- * For 16-bit and 32-bit timers 0, select channel 2 to check the capture
- * interrupt status for channel 1. For 16-bit and 32-bit timers 1, select
- * channel 1. (User manual designation of channel 1 is capture slot 2
- * for timer 0).
- */
-STATIC INLINE bool Chip_TIMER_CapturePending(LPC_TIMER_T *pTMR, int8_t capnum)
-{
-	return (bool) ((pTMR->IR & TIMER_CAP_INT(capnum)) != 0);
-}
-
-/**
- * @brief	Clears a (pending) match interrupt
- * @param	pTMR		: Pointer to timer IP register address
- * @param	matchnum	: Match interrupt number to clear
- * @return	Nothing
- * @note	Clears a pending timer match interrupt.<br>
- */
-STATIC INLINE void Chip_TIMER_ClearMatch(LPC_TIMER_T *pTMR, int8_t matchnum)
-{
-	pTMR->IR = TIMER_IR_CLR(matchnum);
-}
-
-/**
- * @brief	Clears a (pending) capture interrupt
- * @param	pTMR	: Pointer to timer IP register address
- * @param	capnum	: Capture interrupt number to clear
- * @return	Nothing
- * @note	Clears a pending timer capture interrupt.<br>
- * <b>Special handling for timer 0</b><br>
- * For 16-bit and 32-bit timers 0, select channel 2 to check the capture
- * interrupt status for channel 1. For 16-bit and 32-bit timers 1, select
- * channel 1. (User manual designation of channel 1 is capture slot 2
- * for timer 0).
- */
-STATIC INLINE void Chip_TIMER_ClearCapture(LPC_TIMER_T *pTMR, int8_t capnum)
-{
-	pTMR->IR = (0x10 << capnum);
-}
-
-/**
- * @brief	Enables the timer (starts count)
- * @param	pTMR	: Pointer to timer IP register address
- * @return	Nothing
- * @note	Enables the timer to start counting.
- */
-STATIC INLINE void Chip_TIMER_Enable(LPC_TIMER_T *pTMR)
-{
-	pTMR->TCR |= TIMER_ENABLE;
-}
-
-/**
- * @brief	Disables the timer (stops count)
- * @param	pTMR	: Pointer to timer IP register address
- * @return	Nothing
- * @note	Disables the timer to stop counting.
- */
-STATIC INLINE void Chip_TIMER_Disable(LPC_TIMER_T *pTMR)
-{
-	pTMR->TCR &= ~TIMER_ENABLE;
-}
-
-/**
- * @brief	Returns the current timer count
- * @param	pTMR	: Pointer to timer IP register address
- * @return	Current timer terminal count value
- * @note	Returns the current timer terminal count.
- */
-STATIC INLINE uint32_t Chip_TIMER_ReadCount(LPC_TIMER_T *pTMR)
-{
-	return pTMR->TC;
-}
-
-/**
- * @brief	Returns the current prescale count
- * @param	pTMR	: Pointer to timer IP register address
- * @return	Current timer prescale count value
- * @note	Returns the current prescale count.
- */
-STATIC INLINE uint32_t Chip_TIMER_ReadPrescale(LPC_TIMER_T *pTMR)
-{
-	return pTMR->PC;
-}
-
-/**
- * @brief	Sets the prescaler value
- * @param	pTMR		: Pointer to timer IP register address
- * @param	prescale	: Prescale value to set the prescale register to
- * @return	Nothing
- * @note	Sets the prescale count value.
- */
-STATIC INLINE void Chip_TIMER_PrescaleSet(LPC_TIMER_T *pTMR, uint32_t prescale)
-{
-	pTMR->PR = prescale;
-}
-
-/**
- * @brief	Sets a timer match value
- * @param	pTMR		: Pointer to timer IP register address
- * @param	matchnum	: Match timer to set match count for
- * @param	matchval	: Match value for the selected match count
- * @return	Nothing
- * @note	Sets one of the timer match values.
- */
-STATIC INLINE void Chip_TIMER_SetMatch(LPC_TIMER_T *pTMR, int8_t matchnum, uint32_t matchval)
-{
-	pTMR->MR[matchnum] = matchval;
-}
-
-/**
- * @brief	Reads a capture register
- * @param	pTMR	: Pointer to timer IP register address
- * @param	capnum	: Capture register to read
- * @return	The selected capture register value
- * @note	Returns the selected capture register value.<br>
- * <b>Special handling for timer 0</b><br>
- * For 16-bit and 32-bit timers 0, select channel 2 to get the capture
- * count for channel 1. For 16-bit and 32-bit timers 1, select
- * channel 1. (User manual designation of channel 1 is capture slot 2
- * for timer 0).
- */
-STATIC INLINE uint32_t Chip_TIMER_ReadCapture(LPC_TIMER_T *pTMR, int8_t capnum)
-{
-	return pTMR->CR[capnum];
-}
-
-/**
- * @brief	Resets the timer terminal and prescale counts to 0
- * @param	pTMR	: Pointer to timer IP register address
- * @return	Nothing
- */
-void Chip_TIMER_Reset(LPC_TIMER_T *pTMR);
-
-/**
- * @brief	Enables a match interrupt that fires when the terminal count
- *			matches the match counter value.
- * @param	pTMR		: Pointer to timer IP register address
- * @param	matchnum	: Match timer, 0 to 3
- * @return	Nothing
- */
-STATIC INLINE void Chip_TIMER_MatchEnableInt(LPC_TIMER_T *pTMR, int8_t matchnum)
-{
-	pTMR->MCR |= TIMER_INT_ON_MATCH(matchnum);
-}
-
-/**
- * @brief	Disables a match interrupt for a match counter.
- * @param	pTMR		: Pointer to timer IP register address
- * @param	matchnum	: Match timer, 0 to 3
- * @return	Nothing
- */
-STATIC INLINE void Chip_TIMER_MatchDisableInt(LPC_TIMER_T *pTMR, int8_t matchnum)
-{
-	pTMR->MCR &= ~TIMER_INT_ON_MATCH(matchnum);
-}
-
-/**
- * @brief	For the specific match counter, enables reset of the terminal count register when a match occurs
- * @param	pTMR		: Pointer to timer IP register address
- * @param	matchnum	: Match timer, 0 to 3
- * @return	Nothing
- */
-STATIC INLINE void Chip_TIMER_ResetOnMatchEnable(LPC_TIMER_T *pTMR, int8_t matchnum)
-{
-	pTMR->MCR |= TIMER_RESET_ON_MATCH(matchnum);
-}
-
-/**
- * @brief	For the specific match counter, disables reset of the terminal count register when a match occurs
- * @param	pTMR		: Pointer to timer IP register address
- * @param	matchnum	: Match timer, 0 to 3
- * @return	Nothing
- */
-STATIC INLINE void Chip_TIMER_ResetOnMatchDisable(LPC_TIMER_T *pTMR, int8_t matchnum)
-{
-	pTMR->MCR &= ~TIMER_RESET_ON_MATCH(matchnum);
-}
-
-/**
- * @brief	Enable a match timer to stop the terminal count when a
- *			match count equals the terminal count.
- * @param	pTMR		: Pointer to timer IP register address
- * @param	matchnum	: Match timer, 0 to 3
- * @return	Nothing
- */
-STATIC INLINE void Chip_TIMER_StopOnMatchEnable(LPC_TIMER_T *pTMR, int8_t matchnum)
-{
-	pTMR->MCR |= TIMER_STOP_ON_MATCH(matchnum);
-}
-
-/**
- * @brief	Disable stop on match for a match timer. Disables a match timer
- *			to stop the terminal count when a match count equals the terminal count.
- * @param	pTMR		: Pointer to timer IP register address
- * @param	matchnum	: Match timer, 0 to 3
- * @return	Nothing
- */
-STATIC INLINE void Chip_TIMER_StopOnMatchDisable(LPC_TIMER_T *pTMR, int8_t matchnum)
-{
-	pTMR->MCR &= ~TIMER_STOP_ON_MATCH(matchnum);
-}
-
-/**
- * @brief	Enables capture on on rising edge of selected CAP signal for the
- *			selected capture register, enables the selected CAPn.capnum signal to load
- *			the capture register with the terminal coount on a rising edge.
- * @param	pTMR	: Pointer to timer IP register address
- * @param	capnum	: Capture signal/register to use
- * @return	Nothing
- * @note	<b>Special handling for timer 0</b><br>
- * For 16-bit and 32-bit timers 0, select channel 2 to set channel 1. For 16-bit and
- * 32-bit timers 1, select channel 1. (User manual designation of channel 1 is capture
- * slot 2).
- */
-STATIC INLINE void Chip_TIMER_CaptureRisingEdgeEnable(LPC_TIMER_T *pTMR, int8_t capnum)
-{
-	pTMR->CCR |= TIMER_CAP_RISING(capnum);
-}
-
-/**
- * @brief	Disables capture on on rising edge of selected CAP signal. For the
- *			selected capture register, disables the selected CAPn.capnum signal to load
- *			the capture register with the terminal coount on a rising edge.
- * @param	pTMR	: Pointer to timer IP register address
- * @param	capnum	: Capture signal/register to use
- * @return	Nothing
- * @note	<b>Special handling for timer 0</b><br>
- * For 16-bit and 32-bit timers 0, select channel 2 to set channel 1. For 16-bit and
- * 32-bit timers 1, select channel 1. (User manual designation of channel 1 is capture
- * slot 2).
- */
-STATIC INLINE void Chip_TIMER_CaptureRisingEdgeDisable(LPC_TIMER_T *pTMR, int8_t capnum)
-{
-	pTMR->CCR &= ~TIMER_CAP_RISING(capnum);
-}
-
-/**
- * @brief	Enables capture on on falling edge of selected CAP signal. For the
- *			selected capture register, enables the selected CAPn.capnum signal to load
- *			the capture register with the terminal coount on a falling edge.
- * @param	pTMR	: Pointer to timer IP register address
- * @param	capnum	: Capture signal/register to use
- * @return	Nothing
- * @note	<b>Special handling for timer 0</b><br>
- * For 16-bit and 32-bit timers 0, select channel 2 to set channel 1. For 16-bit and
- * 32-bit timers 1, select channel 1. (User manual designation of channel 1 is capture
- * slot 2).
- */
-STATIC INLINE void Chip_TIMER_CaptureFallingEdgeEnable(LPC_TIMER_T *pTMR, int8_t capnum)
-{
-	pTMR->CCR |= TIMER_CAP_FALLING(capnum);
-}
-
-/**
- * @brief	Disables capture on on falling edge of selected CAP signal. For the
- *			selected capture register, disables the selected CAPn.capnum signal to load
- *			the capture register with the terminal coount on a falling edge.
- * @param	pTMR	: Pointer to timer IP register address
- * @param	capnum	: Capture signal/register to use
- * @return	Nothing
- * @note	<b>Special handling for timer 0</b><br>
- * For 16-bit and 32-bit timers 0, select channel 2 to set channel 1. For 16-bit and
- * 32-bit timers 1, select channel 1. (User manual designation of channel 1 is capture
- * slot 2).
- */
-STATIC INLINE void Chip_TIMER_CaptureFallingEdgeDisable(LPC_TIMER_T *pTMR, int8_t capnum)
-{
-	pTMR->CCR &= ~TIMER_CAP_FALLING(capnum);
-}
-
-/**
- * @brief	Enables interrupt on capture of selected CAP signal. For the
- *			selected capture register, an interrupt will be generated when the enabled
- *			rising or falling edge on CAPn.capnum is detected.
- * @param	pTMR	: Pointer to timer IP register address
- * @param	capnum	: Capture signal/register to use
- * @return	Nothing
- * @note	<b>Special handling for timer 0</b><br>
- * For 16-bit and 32-bit timers 0, select channel 2 to set channel 1. For 16-bit and
- * 32-bit timers 1, select channel 1. (User manual designation of channel 1 is capture
- * slot 2).
- */
-STATIC INLINE void Chip_TIMER_CaptureEnableInt(LPC_TIMER_T *pTMR, int8_t capnum)
-{
-	pTMR->CCR |= TIMER_INT_ON_CAP(capnum);
-}
-
-/**
- * @brief	Disables interrupt on capture of selected CAP signal
- * @param	pTMR	: Pointer to timer IP register address
- * @param	capnum	: Capture signal/register to use
- * @return	Nothing
- * @note	<b>Special handling for timer 0</b><br>
- * For 16-bit and 32-bit timers 0, select channel 2 to set channel 1. For 16-bit and
- * 32-bit timers 1, select channel 1. (User manual designation of channel 1 is capture
- * slot 2).
- */
-STATIC INLINE void Chip_TIMER_CaptureDisableInt(LPC_TIMER_T *pTMR, int8_t capnum)
-{
-	pTMR->CCR &= ~TIMER_INT_ON_CAP(capnum);
-}
-
-/**
- * @brief Standard timer initial match pin state and change state
- */
-typedef enum IP_TIMER_PIN_MATCH_STATE {
-	TIMER_EXTMATCH_DO_NOTHING = 0,	/*!< Timer match state does nothing on match pin */
-	TIMER_EXTMATCH_CLEAR      = 1,	/*!< Timer match state sets match pin low */
-	TIMER_EXTMATCH_SET        = 2,	/*!< Timer match state sets match pin high */
-	TIMER_EXTMATCH_TOGGLE     = 3	/*!< Timer match state toggles match pin */
-} TIMER_PIN_MATCH_STATE_T;
-
-/**
- * @brief	Sets external match control (MATn.matchnum) pin control. For the pin
- *          selected with matchnum, sets the function of the pin that occurs on
- *          a terminal count match for the match count.
- * @param	pTMR			: Pointer to timer IP register address
- * @param	initial_state	: Initial state of the pin, high(1) or low(0)
- * @param	matchState		: Selects the match state for the pin
- * @param	matchnum		: MATn.matchnum signal to use
- * @return	Nothing
- * @note	For the pin selected with matchnum, sets the function of the pin that occurs on
- * a terminal count match for the match count.
- */
-void Chip_TIMER_ExtMatchControlSet(LPC_TIMER_T *pTMR, int8_t initial_state,
-								   TIMER_PIN_MATCH_STATE_T matchState, int8_t matchnum);
-
-/**
- * @brief Standard timer clock and edge for count source
- */
-typedef enum IP_TIMER_CAP_SRC_STATE {
-	TIMER_CAPSRC_RISING_PCLK  = 0,	/*!< Timer ticks on PCLK rising edge */
-	TIMER_CAPSRC_RISING_CAPN  = 1,	/*!< Timer ticks on CAPn.x rising edge */
-	TIMER_CAPSRC_FALLING_CAPN = 2,	/*!< Timer ticks on CAPn.x falling edge */
-	TIMER_CAPSRC_BOTH_CAPN    = 3	/*!< Timer ticks on CAPn.x both edges */
-} TIMER_CAP_SRC_STATE_T;
-
-/**
- * @brief	Sets timer count source and edge with the selected passed from CapSrc.
- *          If CapSrc selected a CAPn pin, select the specific CAPn pin with the capnum value.
- * @param	pTMR	: Pointer to timer IP register address
- * @param	capSrc	: timer clock source and edge
- * @param	capnum	: CAPn.capnum pin to use (if used)
- * @return	Nothing
- * @note	If CapSrc selected a CAPn pin, select the specific CAPn pin with the capnum value.
- */
-STATIC INLINE void Chip_TIMER_TIMER_SetCountClockSrc(LPC_TIMER_T *pTMR,
-													 TIMER_CAP_SRC_STATE_T capSrc,
-													 int8_t capnum)
-{
-	pTMR->CTCR = (uint32_t) capSrc | ((uint32_t) capnum) << 2;
-}
-
-/**
- * @}
- */
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif /* __TIMER_11U6X_H_ */
-
--- a/libpff/connect.h	Wed Jun 27 13:14:54 2018 +0000
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,12 +0,0 @@
-#ifndef _CONNECT_H_
-
-//SDFileSystem sd(P0_9,P0_8, P1_29, P1_19, "sd"); // mosi,miso,clk,cs
-#define CONNECT_MOSI    P0_9 //p5
-#define CONNECT_MISO    P0_8 //p6
-#define CONNECT_SCK     P0_6 //p7
-#define CONNECT_CS      P0_7 //p13
-#define SPI_FREQ        400000
-
-#define _CONNECT_H_
-#endif
-
--- a/libpff/diskio.h	Wed Jun 27 13:14:54 2018 +0000
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,39 +0,0 @@
-/*-----------------------------------------------------------------------
-/  PFF - Low level disk interface modlue include file    (C)ChaN, 2009
-/-----------------------------------------------------------------------*/
-
-#ifndef _DISKIO
-
-#include "integer.h"
-
-/* Status of Disk Functions */
-typedef BYTE    DSTATUS;
-
-/* Results of Disk Functions */
-typedef enum {
-    RES_OK = 0,        /* 0: Function succeeded */
-    RES_ERROR,        /* 1: Disk error */
-    RES_NOTRDY,        /* 2: Not ready */
-    RES_PARERR        /* 3: Invalid parameter */
-} DRESULT;
-
-/*---------------------------------------*/
-/* Prototypes for disk control functions */
-
-DSTATUS disk_initialize (void);
-DRESULT disk_readp (BYTE*, DWORD, WORD, WORD);
-DRESULT disk_writep (const BYTE*, DWORD);
-
-#define STA_NOINIT        0x01    /* Drive not initialized */
-#define STA_NODISK        0x02    /* No medium in the drive */
-
-/* Card type flags (CardType) */
-#define CT_MMC                0x01    /* MMC ver 3 */
-#define CT_SD1                0x02    /* SD ver 1 */
-#define CT_SD2                0x04    /* SD ver 2 */
-#define CT_SDC                (CT_SD1|CT_SD2)    /* SD */
-#define CT_BLOCK            0x08    /* Block addressing */
-
-#define _DISKIO
-#endif
-
--- a/libpff/integer.h	Wed Jun 27 13:14:54 2018 +0000
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,32 +0,0 @@
-/*-------------------------------------------*/
-/* Integer type definitions for FatFs module */
-/*-------------------------------------------*/
-
-#ifndef _INTEGER
-
-/* These types must be 16-bit, 32-bit or larger integer */
-typedef int                INT;
-typedef unsigned int    UINT;
-
-/* These types must be 8-bit integer */
-typedef signed char        CHAR;
-typedef unsigned char    UCHAR;
-typedef unsigned char    BYTE;
-
-/* These types must be 16-bit integer */
-typedef short            SHORT;
-typedef unsigned short    USHORT;
-typedef unsigned short    WORD;
-typedef unsigned short    WCHAR;
-
-/* These types must be 32-bit integer */
-typedef long            LONG;
-typedef unsigned long    ULONG;
-typedef unsigned long    DWORD;
-
-/* Boolean type */
-// typedef enum { FALSE = 0, TRUE } BOOL; // for soe reason does not work, but otoh isnt used anywhere
-
-#define _INTEGER
-#endif
-
--- a/libpff/mmc.cpp	Wed Jun 27 13:14:54 2018 +0000
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,271 +0,0 @@
-/*-----------------------------------------------------------------------*/
-/* PFF - Low level disk control module for ATtiny85     (C)ChaN, 2009    */
-/*-----------------------------------------------------------------------*/
-
-#define _WRITE_FUNC    1
-
-#include "diskio.h"
-#include "mbed.h"
-#include "connect.h"
-#include "PokittoDisk.h"
-
-/* Definitions for MMC/SDC command */
-#define CMD0    (0x40+0)    /* GO_IDLE_STATE */
-#define CMD1    (0x40+1)    /* SEND_OP_COND (MMC) */
-#define    ACMD41    (0xC0+41)    /* SEND_OP_COND (SDC) */
-#define CMD8    (0x40+8)    /* SEND_IF_COND */
-#define CMD16    (0x40+16)    /* SET_BLOCKLEN */
-#define CMD17    (0x40+17)    /* READ_SINGLE_BLOCK */
-#define CMD24    (0x40+24)    /* WRITE_BLOCK */
-#define CMD55    (0x40+55)    /* APP_CMD */
-#define CMD58    (0x40+58)    /* READ_OCR */
-
-
-
-/* Port Controls (Platform dependent) */
-#define SELECT()    CLR_SD_CS //mmccs.write(0)        /* MMC CS = L */
-#define    DESELECT()    SET_SD_CS // mmccs.write(1)        /* MMC CS = H */
-#define    MMC_SEL        !GET_SD_CS // !mmccs.read()    /* MMC CS status (true:selected) */
-
-void xmit_spi (BYTE c) {
-    device.write(c);    /* Send a byte */
-}
-
-BYTE rcv_spi (void) {
-    return device.write(0xff);
-}
-
-/*--------------------------------------------------------------------------
-
-   Module Private Functions
-
----------------------------------------------------------------------------*/
-
-static
-BYTE CardType;
-
-
-/*-----------------------------------------------------------------------*/
-/* Deselect the card and release SPI bus                                 */
-/*-----------------------------------------------------------------------*/
-
-static
-void release_spi (void) {
-    DESELECT();
-    rcv_spi();
-}
-
-
-/*-----------------------------------------------------------------------*/
-/* Send a command packet to MMC                                          */
-/*-----------------------------------------------------------------------*/
-
-static
-BYTE send_cmd (
-    BYTE cmd,        /* Command byte */
-    DWORD arg        /* Argument */
-) {
-    BYTE n, res;
-
-
-    if (cmd & 0x80) {    /* ACMD<n> is the command sequense of CMD55-CMD<n> */
-        cmd &= 0x7F;
-        res = send_cmd(CMD55, 0);
-        if (res > 1) return res;
-    }
-
-    /* Select the card */
-    DESELECT();
-    rcv_spi();
-    SELECT();
-    rcv_spi();
-
-    /* Send a command packet */
-    xmit_spi(cmd);                        /* Start + Command index */
-    xmit_spi((BYTE)(arg >> 24));        /* Argument[31..24] */
-    xmit_spi((BYTE)(arg >> 16));        /* Argument[23..16] */
-    xmit_spi((BYTE)(arg >> 8));            /* Argument[15..8] */
-    xmit_spi((BYTE)arg);                /* Argument[7..0] */
-    n = 0x01;                            /* Dummy CRC + Stop */
-    if (cmd == CMD0) n = 0x95;            /* Valid CRC for CMD0(0) */
-    if (cmd == CMD8) n = 0x87;            /* Valid CRC for CMD8(0x1AA) */
-    xmit_spi(n);
-
-    /* Receive a command response */
-    n = 10;                                /* Wait for a valid response in timeout of 10 attempts */
-    do {
-        res = rcv_spi();
-    } while ((res & 0x80) && --n);
-
-    return res;            /* Return with the response value */
-}
-
-
-
-/*--------------------------------------------------------------------------
-
-   Public Functions
-
----------------------------------------------------------------------------*/
-
-
-/*-----------------------------------------------------------------------*/
-/* Initialize Disk Drive                                                 */
-/*-----------------------------------------------------------------------*/
-
-//__attribute__((section(".SD_Code")))
-DSTATUS disk_initialize (void) {
-    BYTE n, cmd, ty, ocr[4];
-    WORD tmr;
-
-    DESELECT();
-    device.frequency(SPI_FREQ);
-    device.format(8);
-    // device.frequency(SPI_FREQ); // hangs if this is after format
-
-#if _WRITE_FUNC
-    if (MMC_SEL) disk_writep(0, 0);        /* Finalize write process if it is in progress */
-#endif
-    for (n = 100; n; n--) rcv_spi();    /* Dummy clocks */
-
-    ty = 0;
-    if (send_cmd(CMD0, 0) == 1) {            /* Enter Idle state */
-        if (send_cmd(CMD8, 0x1AA) == 1) {    /* SDv2 */
-            for (n = 0; n < 4; n++) ocr[n] = rcv_spi();        /* Get trailing return value of R7 resp */
-            if (ocr[2] == 0x01 && ocr[3] == 0xAA) {                /* The card can work at vdd range of 2.7-3.6V */
-                for (tmr = 12000; tmr && send_cmd(ACMD41, 1UL << 30); tmr--) ;    /* Wait for leaving idle state (ACMD41 with HCS bit) */
-                if (tmr && send_cmd(CMD58, 0) == 0) {        /* Check CCS bit in the OCR */
-                    for (n = 0; n < 4; n++) ocr[n] = rcv_spi();
-                    ty = (ocr[0] & 0x40) ? CT_SD2 | CT_BLOCK : CT_SD2;    /* SDv2 (HC or SC) */
-                }
-            }
-        } else {                            /* SDv1 or MMCv3 */
-            if (send_cmd(ACMD41, 0) <= 1)     {
-                ty = CT_SD1;
-                cmd = ACMD41;    /* SDv1 */
-            } else {
-                ty = CT_MMC;
-                cmd = CMD1;    /* MMCv3 */
-            }
-            for (tmr = 25000; tmr && send_cmd(cmd, 0); tmr--) ;    /* Wait for leaving idle state */
-            if (!tmr || send_cmd(CMD16, 512) != 0)            /* Set R/W block length to 512 */
-                ty = 0;
-        }
-    }
-    CardType = ty;
-    release_spi();
-
-    return ty ? 0 : STA_NOINIT;
-}
-
-
-
-/*-----------------------------------------------------------------------*/
-/* Read partial sector                                                   */
-/*-----------------------------------------------------------------------*/
-
-DRESULT disk_readp (
-    BYTE *buff,        /* Pointer to the read buffer (NULL:Read bytes are forwarded to the stream) */
-    DWORD lba,        /* Sector number (LBA) */
-    WORD ofs,        /* Byte offset to read from (0..511) */
-    WORD cnt        /* Number of bytes to read (ofs + cnt mus be <= 512) */
-) {
-    DRESULT res;
-    BYTE rc;
-    WORD bc;
-
-
-    if (!(CardType & CT_BLOCK)) lba *= 512;        /* Convert to byte address if needed */
-
-    res = RES_ERROR;
-    if (send_cmd(CMD17, lba) == 0) {        /* READ_SINGLE_BLOCK */
-
-        bc = 30000;
-        do {                            /* Wait for data packet in timeout of 100ms */
-            rc = rcv_spi();
-        } while (rc == 0xFF && --bc);
-
-        if (rc == 0xFE) {                /* A data packet arrived */
-            bc = 514 - ofs - cnt;
-
-            /* Skip leading bytes */
-            if (ofs) {
-                do {
-                    rcv_spi();
-                } while (--ofs);
-            }
-
-            /* Receive a part of the sector */
-            if (buff) {    /* Store data to the memory */
-                do {
-                    *buff++ = rcv_spi();
-                } while (--cnt);
-            } else {    /* Forward data to the outgoing stream (depends on the project) */
-                do {
-                    rcv_spi();
-                } while (--cnt);
-            }
-
-            /* Skip trailing bytes and CRC */
-            do rcv_spi();
-            while (--bc);
-
-            res = RES_OK;
-        }
-    }
-
-    release_spi();
-
-    return res;
-}
-
-
-
-/*-----------------------------------------------------------------------*/
-/* Write partial sector                                                  */
-/*-----------------------------------------------------------------------*/
-#if _WRITE_FUNC
-
-DRESULT disk_writep (
-    const BYTE *buff,    /* Pointer to the bytes to be written (NULL:Initiate/Finalize sector write) */
-    DWORD sa            /* Number of bytes to send, Sector number (LBA) or zero */
-) {
-    DRESULT res;
-    WORD bc;
-    static WORD wc;
-
-
-    res = RES_ERROR;
-
-    if (buff) {        /* Send data bytes */
-        bc = (WORD)sa;
-        while (bc && wc) {        /* Send data bytes to the card */
-            xmit_spi(*buff++);
-            wc--;
-            bc--;
-        }
-        res = RES_OK;
-    } else {
-        if (sa) {    /* Initiate sector write process */
-            if (!(CardType & CT_BLOCK)) sa *= 512;    /* Convert to byte address if needed */
-            if (send_cmd(CMD24, sa) == 0) {            /* WRITE_SINGLE_BLOCK */
-                xmit_spi(0xFF);
-                xmit_spi(0xFE);        /* Data block header */
-                wc = 512;                            /* Set byte counter */
-                res = RES_OK;
-            }
-        } else {    /* Finalize sector write process */
-            bc = wc + 2;
-            while (bc--) xmit_spi(0);    /* Fill left bytes and CRC with zeros */
-            if ((rcv_spi() & 0x1F) == 0x05) {    /* Receive data resp and wait for end of write process in timeout of 300ms */
-                for (bc = 65000; rcv_spi() != 0xFF && bc; bc--) ;    /* Wait ready */
-                if (bc) res = RES_OK;
-            }
-            release_spi();
-        }
-    }
-
-    return res;
-}
-#endif
-
--- a/libpff/pff.cpp	Wed Jun 27 13:14:54 2018 +0000
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,841 +0,0 @@
-/*----------------------------------------------------------------------------/
-/  Petit FatFs - FAT file system module  R0.02                 (C)ChaN, 2009
-/-----------------------------------------------------------------------------/
-/ Petit FatFs module is an open source software to implement FAT file system to
-/ small embedded systems. This is a free software and is opened for education,
-/ research and commercial developments under license policy of following trems.
-/
-/  Copyright (C) 2009, ChaN, all right reserved.
-/
-/ * The Petit FatFs module is a free software and there is NO WARRANTY.
-/ * No restriction on use. You can use, modify and redistribute it for
-/   personal, non-profit or commercial use UNDER YOUR RESPONSIBILITY.
-/ * Redistributions of source code must retain the above copyright notice.
-/
-/-----------------------------------------------------------------------------/
-/ Jun 15,'09  R0.01a  First release. (Branched from FatFs R0.07b.)
-/
-/ Dec 14,'09  R0.02   Added multiple code page support.
-/                     Added write funciton.
-/                     Changed stream read mode interface.
-/----------------------------------------------------------------------------*/
-
-#include "pff.h"        /* Petit FatFs configurations and declarations */
-#include "diskio.h"        /* Declarations of low level disk I/O functions */
-
-
-/*--------------------------------------------------------------------------
-
-   Private Functions
-
----------------------------------------------------------------------------*/
-
-static
-FATFS *FatFs;    /* Pointer to the file system object (logical drive) */
-
-
-
-/*-----------------------------------------------------------------------*/
-/* String functions                                                      */
-/*-----------------------------------------------------------------------*/
-
-/* Fill memory */
-static
-void mem_set (void* dst, int val, int cnt) {
-    char *d = (char*)dst;
-    while (cnt--) *d++ = (char)val;
-}
-
-/* Compare memory to memory */
-static
-int mem_cmp (const void* dst, const void* src, int cnt) {
-    const char *d = (const char *)dst, *s = (const char *)src;
-    int r = 0;
-    while (cnt-- && (r = *d++ - *s++) == 0) ;
-    return r;
-}
-
-
-
-/*-----------------------------------------------------------------------*/
-/* FAT access - Read value of a FAT entry                                */
-/*-----------------------------------------------------------------------*/
-
-static
-CLUST get_fat (    /* 1:IO error, Else:Cluster status */
-    CLUST clst    /* Cluster# to get the link information */
-) {
-    WORD wc, bc, ofs;
-    BYTE buf[4];
-    FATFS *fs = FatFs;
-
-
-    if (clst < 2 || clst >= fs->max_clust)    /* Range check */
-        return 1;
-
-    switch (fs->fs_type) {
-        case FS_FAT12 :
-            bc = (WORD)clst;
-            bc += bc / 2;
-            ofs = bc % 512;
-            bc /= 512;
-            if (ofs != 511) {
-                if (disk_readp(buf, fs->fatbase + bc, ofs, 2)) break;
-            } else {
-                if (disk_readp(buf, fs->fatbase + bc, 511, 1)) break;
-                if (disk_readp(buf+1, fs->fatbase + bc + 1, 0, 1)) break;
-            }
-            wc = LD_WORD(buf);
-            return (clst & 1) ? (wc >> 4) : (wc & 0xFFF);
-
-        case FS_FAT16 :
-            if (disk_readp(buf, fs->fatbase + clst / 256, (WORD)(((WORD)clst % 256) * 2), 2)) break;
-            return LD_WORD(buf);
-#if _FS_FAT32
-        case FS_FAT32 :
-            if (disk_readp(buf, fs->fatbase + clst / 128, (WORD)(((WORD)clst % 128) * 4), 4)) break;
-            return ((WORD)(((WORD)*(BYTE*)((buf)+1)<<8)|(WORD)*(BYTE*)(buf))) & 0x0FFFFFFF; //return LD_DWORD(buf) & 0x0FFFFFFF; //get rid of out of bounds warning in online IDE
-#endif
-    }
-
-    return 1;    /* An error occured at the disk I/O layer */
-}
-
-
-
-
-/*-----------------------------------------------------------------------*/
-/* Get sector# from cluster#                                             */
-/*-----------------------------------------------------------------------*/
-
-static
-DWORD clust2sect (    /* !=0: Sector number, 0: Failed - invalid cluster# */
-    CLUST clst        /* Cluster# to be converted */
-) {
-    FATFS *fs = FatFs;
-
-
-    clst -= 2;
-    if (clst >= (fs->max_clust - 2)) return 0;        /* Invalid cluster# */
-    return (DWORD)clst * fs->csize + fs->database;
-}
-
-
-
-
-/*-----------------------------------------------------------------------*/
-/* Directory handling - Rewind directory index                           */
-/*-----------------------------------------------------------------------*/
-
-static
-FRESULT dir_rewind (
-    FATDIR *dj            /* Pointer to directory object */
-) {
-    CLUST clst;
-    FATFS *fs = FatFs;
-
-
-    dj->index = 0;
-    clst = dj->sclust;
-    if (clst == 1 || clst >= fs->max_clust)    /* Check start cluster range */
-        return FR_DISK_ERR;
-#if _FS_FAT32
-    if (!clst && fs->fs_type == FS_FAT32)    /* Replace cluster# 0 with root cluster# if in FAT32 */
-        clst = fs->dirbase;
-#endif
-    dj->clust = clst;                        /* Current cluster */
-    dj->sect = clst ? clust2sect(clst) : fs->dirbase;    /* Current sector */
-
-    return FR_OK;    /* Seek succeeded */
-}
-
-
-
-
-/*-----------------------------------------------------------------------*/
-/* Directory handling - Move directory index next                        */
-/*-----------------------------------------------------------------------*/
-
-static
-FRESULT dir_next (    /* FR_OK:Succeeded, FR_NO_FILE:End of table */
-    FATDIR *dj            /* Pointer to directory object */
-) {
-    CLUST clst;
-    WORD i;
-    FATFS *fs = FatFs;
-
-
-    i = dj->index + 1;
-    if (!i || !dj->sect)    /* Report EOT when index has reached 65535 */
-        return FR_NO_FILE;
-
-    if (!(i & (16-1))) {    /* Sector changed? */
-        dj->sect++;            /* Next sector */
-
-        if (dj->clust == 0) {    /* Static table */
-            if (i >= fs->n_rootdir)    /* Report EOT when end of table */
-                return FR_NO_FILE;
-        } else {                   /* Dynamic table */
-            if (((i / 16) & (fs->csize-1)) == 0) {    /* Cluster changed? */
-                clst = get_fat(dj->clust);        /* Get next cluster */
-                if (clst <= 1) return FR_DISK_ERR;
-                if (clst >= fs->max_clust)        /* When it reached end of dynamic table */
-                    return FR_NO_FILE;            /* Report EOT */
-                dj->clust = clst;                /* Initialize data for new cluster */
-                dj->sect = clust2sect(clst);
-            }
-        }
-    }
-
-    dj->index = i;
-
-    return FR_OK;
-}
-
-
-
-
-/*-----------------------------------------------------------------------*/
-/* Directory handling - Find an object in the directory                  */
-/*-----------------------------------------------------------------------*/
-
-static
-FRESULT dir_find (
-    FATDIR *dj            /* Pointer to the directory object linked to the file name */
-) {
-    FRESULT res;
-    BYTE c, *dir;
-
-
-    res = dir_rewind(dj);            /* Rewind directory object */
-    if (res != FR_OK) return res;
-
-    dir = FatFs->buf;
-    do {
-        res = disk_readp(dir, dj->sect, (WORD)((dj->index % 16) * 32), 32)    /* Read an entry */
-              ? FR_DISK_ERR : FR_OK;
-        if (res != FR_OK) break;
-        c = dir[DIR_Name];    /* First character */
-        if (c == 0) {
-            res = FR_NO_FILE;    /* Reached to end of table */
-            break;
-        }
-        if (!(dir[DIR_Attr] & AM_VOL) && !mem_cmp(dir, dj->fn, 11)) /* Is it a valid entry? */
-            break;
-        res = dir_next(dj);                            /* Next entry */
-    } while (res == FR_OK);
-
-    return res;
-}
-
-
-
-
-/*-----------------------------------------------------------------------*/
-/* Read an object from the directory                                     */
-/*-----------------------------------------------------------------------*/
-#if _USE_DIR
-static
-FRESULT dir_read (
-    FATDIR *dj            /* Pointer to the directory object to store read object name */
-) {
-    FRESULT res;
-    BYTE a, c, *dir;
-
-
-    res = FR_NO_FILE;
-    dir = FatFs->buf;
-    while (dj->sect) {
-        res = disk_readp(dir, dj->sect, (WORD)((dj->index % 16) * 32), 32)    /* Read an entry */
-              ? FR_DISK_ERR : FR_OK;
-        if (res != FR_OK) break;
-        c = dir[DIR_Name];
-        if (c == 0) {
-            res = FR_NO_FILE;    /* Reached to end of table */
-            break;
-        }
-        a = dir[DIR_Attr] & AM_MASK;
-        if (c != 0xE5 && c != '.' && !(a & AM_VOL))    /* Is it a valid entry? */
-            break;
-        res = dir_next(dj);                /* Next entry */
-        if (res != FR_OK) break;
-    }
-
-    if (res != FR_OK) dj->sect = 0;
-
-    return res;
-}
-#endif
-
-
-
-/*-----------------------------------------------------------------------*/
-/* Pick a segment and create the object name in directory form           */
-/*-----------------------------------------------------------------------*/
-
-#ifdef _EXCVT
-static const BYTE cvt[] = _EXCVT;
-#endif
-
-static
-FRESULT create_name (
-    FATDIR *dj,            /* Pointer to the directory object */
-    const char **path    /* Pointer to pointer to the segment in the path string */
-) {
-    BYTE c, d, ni, si, i, *sfn;
-    const char *p;
-
-    /* Create file name in directory form */
-    sfn = dj->fn;
-    mem_set(sfn, ' ', 11);
-    si = i = 0;
-    ni = 8;
-    p = *path;
-    for (;;) {
-        c = p[si++];
-        if (c <= ' ' || c == '/') break;    /* Break on end of segment */
-        if (c == '.' || i >= ni) {
-            if (ni != 8 || c != '.') break;
-            i = 8;
-            ni = 11;
-            continue;
-        }
-#ifdef _EXCVT
-        if (c >= 0x80)                    /* To upper extended char (SBCS) */
-            c = cvt[c - 0x80];
-#endif
-        if (IsDBCS1(c) && i >= ni - 1) {    /* DBC 1st byte? */
-            d = p[si++];                    /* Get 2nd byte */
-            sfn[i++] = c;
-            sfn[i++] = d;
-        } else {                        /* Single byte code */
-            if (IsLower(c)) c -= 0x20;    /* toupper */
-            sfn[i++] = c;
-        }
-    }
-    *path = &p[si];                        /* Rerurn pointer to the next segment */
-
-    sfn[11] = (c <= ' ') ? 1 : 0;        /* Set last segment flag if end of path */
-
-    return FR_OK;
-}
-
-
-
-
-/*-----------------------------------------------------------------------*/
-/* Get file information from directory entry                             */
-/*-----------------------------------------------------------------------*/
-#if _USE_DIR
-static
-void get_fileinfo (        /* No return code */
-    FATDIR *dj,            /* Pointer to the directory object */
-    FILINFO *fno         /* Pointer to store the file information */
-) {
-    BYTE i, c, *dir;
-    char *p;
-
-
-    p = fno->fname;
-    if (dj->sect) {
-        dir = FatFs->buf;
-        for (i = 0; i < 8; i++) {    /* Copy file name body */
-            c = dir[i];
-            if (c == ' ') break;
-            if (c == 0x05) c = 0xE5;
-            *p++ = c;
-        }
-        if (dir[8] != ' ') {        /* Copy file name extension */
-            *p++ = '.';
-            for (i = 8; i < 11; i++) {
-                c = dir[i];
-                if (c == ' ') break;
-                *p++ = c;
-            }
-        }
-        fno->fattrib = dir[DIR_Attr];                /* Attribute */
-        fno->fsize = LD_DWORD(dir+DIR_FileSize);    /* Size */
-        fno->fdate = LD_WORD(dir+DIR_WrtDate);        /* Date */
-        fno->ftime = LD_WORD(dir+DIR_WrtTime);        /* Time */
-    }
-    *p = 0;
-}
-#endif /* _USE_DIR */
-
-
-
-/*-----------------------------------------------------------------------*/
-/* Follow a file path                                                    */
-/*-----------------------------------------------------------------------*/
-
-static
-FRESULT follow_path (    /* FR_OK(0): successful, !=0: error code */
-    FATDIR *dj,            /* Directory object to return last directory and found object */
-    const char *path    /* Full-path string to find a file or directory */
-) {
-    FRESULT res;
-    BYTE *dir;
-
-
-    while (*path == ' ') path++;        /* Skip leading spaces */
-    if (*path == '/') path++;            /* Strip heading separator */
-    dj->sclust = 0;                        /* Set start directory (always root dir) */
-
-    if ((BYTE)*path <= ' ') {            /* Null path means the root directory */
-        res = dir_rewind(dj);
-        FatFs->buf[0] = 0;
-
-    } else {                            /* Follow path */
-        for (;;) {
-            res = create_name(dj, &path);    /* Get a segment */
-            if (res != FR_OK) break;
-            res = dir_find(dj);                /* Find it */
-            if (res != FR_OK) {                /* Could not find the object */
-                if (res == FR_NO_FILE && !*(dj->fn+11))
-                    res = FR_NO_PATH;
-                break;
-            }
-            if (*(dj->fn+11)) break;        /* Last segment match. Function completed. */
-            dir = FatFs->buf;                /* There is next segment. Follow the sub directory */
-            if (!(dir[DIR_Attr] & AM_DIR)) { /* Cannot follow because it is a file */
-                res = FR_NO_PATH;
-                break;
-            }
-            dj->sclust =
-#if _FS_FAT32
-                ((DWORD)LD_WORD(dir+DIR_FstClusHI) << 16) |
-#endif
-                LD_WORD(dir+DIR_FstClusLO);
-        }
-    }
-
-    return res;
-}
-
-
-
-
-/*-----------------------------------------------------------------------*/
-/* Check a sector if it is an FAT boot record                            */
-/*-----------------------------------------------------------------------*/
-
-static
-__attribute__((section(".SD_Code"))) BYTE check_fs (    /* 0:The FAT boot record, 1:Valid boot record but not an FAT, 2:Not a boot record, 3:Error */
-    BYTE *buf,    /* Working buffer */
-    DWORD sect    /* Sector# (lba) to check if it is an FAT boot record or not */
-) {
-    if (disk_readp(buf, sect, 510, 2))        /* Read the boot sector */
-        return 3;
-    if (LD_WORD(buf) != 0xAA55)                /* Check record signature */
-        return 2;
-
-    if (!disk_readp(buf, sect, BS_FilSysType, 2) && LD_WORD(buf) == 0x4146)    /* Check FAT12/16 */
-        return 0;
-#if _FS_FAT32
-    if (!disk_readp(buf, sect, BS_FilSysType32, 2) && LD_WORD(buf) == 0x4146)    /* Check FAT32 */
-        return 0;
-#endif
-    return 1;
-}
-
-
-
-
-/*--------------------------------------------------------------------------
-
-   Public Functions
-
---------------------------------------------------------------------------*/
-
-
-
-/*-----------------------------------------------------------------------*/
-/* Mount/Unmount a Locical Drive                                         */
-/*-----------------------------------------------------------------------*/
-
-__attribute__((section(".SD_Code"))) FRESULT pf_mount (
-    FATFS *fs        /* Pointer to new file system object (NULL: Unmount) */
-) {
-    BYTE fmt, buf[36];
-    DWORD bsect, fsize, tsect, mclst;
-
-
-    FatFs = 0;
-    if (!fs) return FR_OK;                /* Unregister fs object */
-
-    if (disk_initialize() & STA_NOINIT)    /* Check if the drive is ready or not */
-        return FR_NOT_READY;
-
-    /* Search FAT partition on the drive */
-    bsect = 0;
-    fmt = check_fs(buf, bsect);            /* Check sector 0 as an SFD format */
-    if (fmt == 1) {                        /* Not an FAT boot record, it may be FDISK format */
-        /* Check a partition listed in top of the partition table */
-        if (disk_readp(buf, bsect, MBR_Table, 16)) {    /* 1st partition entry */
-            fmt = 3;
-        } else {
-            if (buf[4]) {                    /* Is the partition existing? */
-                bsect = LD_DWORD(&buf[8]);    /* Partition offset in LBA */
-                fmt = check_fs(buf, bsect);    /* Check the partition */
-            }
-        }
-    }
-    if (fmt == 3) return FR_DISK_ERR;
-    if (fmt) return FR_NO_FILESYSTEM;    /* No valid FAT patition is found */
-
-    /* Initialize the file system object */
-    if (disk_readp(buf, bsect, 13, sizeof(buf))) return FR_DISK_ERR;
-
-    fsize = LD_WORD(buf+BPB_FATSz16-13);                /* Number of sectors per FAT */
-    if (!fsize) fsize = LD_DWORD(buf+BPB_FATSz32-13);
-
-    fsize *= buf[BPB_NumFATs-13];                        /* Number of sectors in FAT area */
-    fs->fatbase = bsect + LD_WORD(buf+BPB_RsvdSecCnt-13); /* FAT start sector (lba) */
-    fs->csize = buf[BPB_SecPerClus-13];                    /* Number of sectors per cluster */
-    fs->n_rootdir = LD_WORD(buf+BPB_RootEntCnt-13);        /* Nmuber of root directory entries */
-    tsect = LD_WORD(buf+BPB_TotSec16-13);                /* Number of sectors on the file system */
-    if (!tsect) tsect = LD_DWORD(buf+BPB_TotSec32-13);
-    mclst = (tsect                        /* Last cluster# + 1 */
-             - LD_WORD(buf+BPB_RsvdSecCnt-13) - fsize - fs->n_rootdir / 16
-            ) / fs->csize + 2;
-    fs->max_clust = (CLUST)mclst;
-
-    fmt = FS_FAT12;                            /* Determine the FAT sub type */
-    if (mclst >= 0xFF7) fmt = FS_FAT16;        /* Number of clusters >= 0xFF5 */
-    if (mclst >= 0xFFF7)                    /* Number of clusters >= 0xFFF5 */
-#if _FS_FAT32
-        fmt = FS_FAT32;
-#else
-        return FR_NO_FILESYSTEM;
-#endif
-
-    fs->fs_type = fmt;        /* FAT sub-type */
-#if _FS_FAT32
-    if (fmt == FS_FAT32)
-        fs->dirbase = LD_DWORD(buf+(BPB_RootClus-13));    /* Root directory start cluster */
-    else
-#endif
-        fs->dirbase = fs->fatbase + fsize;                /* Root directory start sector (lba) */
-    fs->database = fs->fatbase + fsize + fs->n_rootdir / 16;    /* Data start sector (lba) */
-
-    fs->flag = 0;
-    FatFs = fs;
-
-    return FR_OK;
-}
-
-
-
-
-/*-----------------------------------------------------------------------*/
-/* Open or Create a File                                                 */
-/*-----------------------------------------------------------------------*/
-
-FRESULT pf_open (
-    const char *path    /* Pointer to the file name */
-) {
-    FRESULT res;
-    FATDIR dj;
-    BYTE sp[12], dir[32];
-    FATFS *fs = FatFs;
-
-
-    if (!fs)                        /* Check file system */
-        return FR_NOT_ENABLED;
-
-    fs->flag = 0;
-    fs->buf = dir;
-    dj.fn = sp;
-    res = follow_path(&dj, path);    /* Follow the file path */
-    if (res != FR_OK) return res;    /* Follow failed */
-    if (!dir[0] || (dir[DIR_Attr] & AM_DIR))    /* It is a directory */
-        return FR_NO_FILE;
-
-    fs->org_clust =                        /* File start cluster */
-#if _FS_FAT32
-        ((DWORD)LD_WORD(dir+DIR_FstClusHI) << 16) |
-#endif
-        LD_WORD(dir+DIR_FstClusLO);
-    fs->fsize = LD_DWORD(dir+DIR_FileSize);    /* File size */
-    fs->fptr = 0;                        /* File pointer */
-    fs->flag = FA_OPENED;
-
-    return FR_OK;
-}
-
-
-
-
-/*-----------------------------------------------------------------------*/
-/* Read File                                                             */
-/*-----------------------------------------------------------------------*/
-#if _USE_READ
-
-FRESULT pf_read (
-    void* buff,        /* Pointer to the read buffer (NULL:Forward data to the stream)*/
-    WORD btr,        /* Number of bytes to read */
-    WORD* br        /* Pointer to number of bytes read */
-) {
-    DRESULT dr;
-    CLUST clst;
-    DWORD sect, remain;
-    BYTE *rbuff = (BYTE *)buff;
-    WORD rcnt;
-    FATFS *fs = FatFs;
-
-
-    *br = 0;
-    if (!fs) return FR_NOT_ENABLED;        /* Check file system */
-    if (!(fs->flag & FA_OPENED))        /* Check if opened */
-        return FR_NOT_OPENED;
-
-    remain = fs->fsize - fs->fptr;
-    if (btr > remain) btr = (WORD)remain;            /* Truncate btr by remaining bytes */
-
-    while (btr)    {                                    /* Repeat until all data transferred */
-        if ((fs->fptr % 512) == 0) {                /* On the sector boundary? */
-            if ((fs->fptr / 512 % fs->csize) == 0) {    /* On the cluster boundary? */
-                clst = (fs->fptr == 0) ?            /* On the top of the file? */
-                       fs->org_clust : get_fat(fs->curr_clust);
-                if (clst <= 1) goto fr_abort;
-                fs->curr_clust = clst;                /* Update current cluster */
-                fs->csect = 0;                        /* Reset sector offset in the cluster */
-            }
-            sect = clust2sect(fs->curr_clust);        /* Get current sector */
-            if (!sect) goto fr_abort;
-            fs->dsect = sect + fs->csect++;
-        }
-        rcnt = 512 - ((WORD)fs->fptr % 512);        /* Get partial sector data from sector buffer */
-        if (rcnt > btr) rcnt = btr;
-        dr = disk_readp(!buff ? 0 : rbuff, fs->dsect, (WORD)(fs->fptr % 512), rcnt);
-        if (dr) goto fr_abort;
-        fs->fptr += rcnt;
-        rbuff += rcnt;            /* Update pointers and counters */
-        btr -= rcnt;
-        *br += rcnt;
-    }
-
-    return FR_OK;
-
-fr_abort:
-    fs->flag = 0;
-    return FR_DISK_ERR;
-}
-#endif
-
-
-
-/*-----------------------------------------------------------------------*/
-/* Write File                                                            */
-/*-----------------------------------------------------------------------*/
-#if _USE_WRITE
-
-FRESULT pf_write (
-    const void* buff,    /* Pointer to the data to be written */
-    WORD btw,            /* Number of bytes to write (0:Finalize the current write operation) */
-    WORD* bw            /* Pointer to number of bytes written */
-) {
-    CLUST clst;
-    DWORD sect, remain;
-    const BYTE *p = (const BYTE *)buff;
-    WORD wcnt;
-    FATFS *fs = FatFs;
-
-
-    *bw = 0;
-    if (!fs) return FR_NOT_ENABLED;        /* Check file system */
-    if (!(fs->flag & FA_OPENED))        /* Check if opened */
-        return FR_NOT_OPENED;
-
-    if (!btw) {        /* Finalize request */
-        if ((fs->flag & FA__WIP) && disk_writep(0, 0)) goto fw_abort;
-        fs->flag &= ~FA__WIP;
-        return FR_OK;
-    } else {        /* Write data request */
-        if (!(fs->flag & FA__WIP))        /* Round down fptr to the sector boundary */
-            fs->fptr &= 0xFFFFFE00;
-    }
-    remain = fs->fsize - fs->fptr;
-    if (btw > remain) btw = (WORD)remain;            /* Truncate btw by remaining bytes */
-
-    while (btw)    {                                    /* Repeat until all data transferred */
-        if (((WORD)fs->fptr % 512) == 0) {                /* On the sector boundary? */
-            if ((fs->fptr / 512 % fs->csize) == 0) {    /* On the cluster boundary? */
-                clst = (fs->fptr == 0) ?            /* On the top of the file? */
-                       fs->org_clust : get_fat(fs->curr_clust);
-                if (clst <= 1) goto fw_abort;
-                fs->curr_clust = clst;                /* Update current cluster */
-                fs->csect = 0;                        /* Reset sector offset in the cluster */
-            }
-            sect = clust2sect(fs->curr_clust);        /* Get current sector */
-            if (!sect) goto fw_abort;
-            fs->dsect = sect + fs->csect++;
-            if (disk_writep(0, fs->dsect)) goto fw_abort;    /* Initiate a sector write operation */
-            fs->flag |= FA__WIP;
-        }
-        wcnt = 512 - ((WORD)fs->fptr % 512);        /* Number of bytes to write to the sector */
-        if (wcnt > btw) wcnt = btw;
-        if (disk_writep(p, wcnt)) goto fw_abort;    /* Send data to the sector */
-        fs->fptr += wcnt;
-        p += wcnt;                /* Update pointers and counters */
-        btw -= wcnt;
-        *bw += wcnt;
-        if (((WORD)fs->fptr % 512) == 0) {
-            if (disk_writep(0, 0)) goto fw_abort;    /* Finalize the currtent secter write operation */
-            fs->flag &= ~FA__WIP;
-        }
-    }
-
-    return FR_OK;
-
-fw_abort:
-    fs->flag = 0;
-    return FR_DISK_ERR;
-}
-#endif
-
-
-
-/*-----------------------------------------------------------------------*/
-/* Seek File R/W Pointer                                                 */
-/*-----------------------------------------------------------------------*/
-#if _USE_LSEEK
-
-FRESULT pf_lseek (
-    DWORD ofs        /* File pointer from top of file */
-) {
-    CLUST clst;
-    DWORD bcs, sect, ifptr;
-    FATFS *fs = FatFs;
-
-
-    if (!fs) return FR_NOT_ENABLED;        /* Check file system */
-    if (!(fs->flag & FA_OPENED))        /* Check if opened */
-        return FR_NOT_OPENED;
-
-    if (ofs > fs->fsize) ofs = fs->fsize;    /* Clip offset with the file size */
-    ifptr = fs->fptr;
-    fs->fptr = 0;
-    if (ofs > 0) {
-        bcs = (DWORD)fs->csize * 512;    /* Cluster size (byte) */
-        if (ifptr > 0 &&
-                (ofs - 1) / bcs >= (ifptr - 1) / bcs) {    /* When seek to same or following cluster, */
-            fs->fptr = (ifptr - 1) & ~(bcs - 1);    /* start from the current cluster */
-            ofs -= fs->fptr;
-            clst = fs->curr_clust;
-        } else {                            /* When seek to back cluster, */
-            clst = fs->org_clust;            /* start from the first cluster */
-            fs->curr_clust = clst;
-        }
-        while (ofs > bcs) {                /* Cluster following loop */
-            clst = get_fat(clst);        /* Follow cluster chain */
-            if (clst <= 1 || clst >= fs->max_clust) goto fe_abort;
-            fs->curr_clust = clst;
-            fs->fptr += bcs;
-            ofs -= bcs;
-        }
-        fs->fptr += ofs;
-        sect = clust2sect(clst);        /* Current sector */
-        if (!sect) goto fe_abort;
-        fs->csect = (BYTE)(ofs / 512);    /* Sector offset in the cluster */
-        if (ofs % 512)
-            fs->dsect = sect + fs->csect++;
-    }
-
-    return FR_OK;
-
-fe_abort:
-    fs->flag = 0;
-    return FR_DISK_ERR;
-}
-#endif
-
-
-
-/*-----------------------------------------------------------------------*/
-/* Create a Directroy Object                                             */
-/*-----------------------------------------------------------------------*/
-#if _USE_DIR
-
-FRESULT pf_opendir (
-    FATDIR *dj,            /* Pointer to directory object to create */
-    const char *path    /* Pointer to the directory path */
-) {
-    FRESULT res;
-    BYTE sp[12], dir[32];
-    FATFS *fs = FatFs;
-
-
-    if (!fs) {                /* Check file system */
-        res = FR_NOT_ENABLED;
-    } else {
-        fs->buf = dir;
-        dj->fn = sp;
-        res = follow_path(dj, path);            /* Follow the path to the directory */
-        if (res == FR_OK) {                        /* Follow completed */
-            if (dir[0]) {                        /* It is not the root dir */
-                if (dir[DIR_Attr] & AM_DIR) {    /* The object is a directory */
-                    dj->sclust =
-#if _FS_FAT32
-                        ((DWORD)LD_WORD(dir+DIR_FstClusHI) << 16) |
-#endif
-                        LD_WORD(dir+DIR_FstClusLO);
-                } else {                        /* The object is not a directory */
-                    res = FR_NO_PATH;
-                }
-            }
-            if (res == FR_OK)
-                res = dir_rewind(dj);            /* Rewind dir */
-        }
-        if (res == FR_NO_FILE) res = FR_NO_PATH;
-    }
-
-    return res;
-}
-
-
-
-
-/*-----------------------------------------------------------------------*/
-/* Read Directory Entry in Sequense                                      */
-/*-----------------------------------------------------------------------*/
-
-FRESULT pf_readdir (
-    FATDIR *dj,            /* Pointer to the open directory object */
-    FILINFO *fno        /* Pointer to file information to return */
-) {
-    FRESULT res;
-    BYTE sp[12], dir[32];
-    FATFS *fs = FatFs;
-
-
-    if (!fs) {                /* Check file system */
-        res = FR_NOT_ENABLED;
-    } else {
-        fs->buf = dir;
-        dj->fn = sp;
-        if (!fno) {
-            res = dir_rewind(dj);
-        } else {
-            res = dir_read(dj);
-            if (res == FR_NO_FILE) {
-                dj->sect = 0;
-                res = FR_OK;
-            }
-            if (res == FR_OK) {                /* A valid entry is found */
-                get_fileinfo(dj, fno);        /* Get the object information */
-                res = dir_next(dj);            /* Increment index for next */
-                if (res == FR_NO_FILE) {
-                    dj->sect = 0;
-                    res = FR_OK;
-                }
-            }
-        }
-    }
-
-    return res;
-}
-
-#endif /* _USE_DIR */
-
-
--- a/libpff/pff.h	Wed Jun 27 13:14:54 2018 +0000
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,467 +0,0 @@
-/*---------------------------------------------------------------------------/
-/  Petit FatFs - FAT file system module include file  R0.02    (C)ChaN, 2009
-/----------------------------------------------------------------------------/
-/ Petit FatFs module is an open source software to implement FAT file system to
-/ small embedded systems. This is a free software and is opened for education,
-/ research and commercial developments under license policy of following trems.
-/
-/  Copyright (C) 2009, ChaN, all right reserved.
-/
-/ * The Petit FatFs module is a free software and there is NO WARRANTY.
-/ * No restriction on use. You can use, modify and redistribute it for
-/   personal, non-profit or commercial use UNDER YOUR RESPONSIBILITY.
-/ * Redistributions of source code must retain the above copyright notice.
-/
-/----------------------------------------------------------------------------*/
-
-#include "integer.h"
-
-/*---------------------------------------------------------------------------/
-/ Petit FatFs Configuration Options
-/
-/ CAUTION! Do not forget to make clean the project after any changes to
-/ the configuration options.
-/
-/----------------------------------------------------------------------------*/
-#ifndef _FATFS
-#define _FATFS
-
-#define    _USE_READ    1    /* pf_read(): 0:Remove ,1:Enable */
-
-#define    _USE_DIR    1    /* pf_opendir() and pf_readdir(): 0:Remove ,1:Enable */
-
-#define    _USE_LSEEK    1    /* pf_lseek(): 0:Remove ,1:Enable */
-
-#define    _USE_WRITE    1    /* pf_write(): 0:Remove ,1:Enable */
-
-#define _FS_FAT32    1    /* 0:Supports FAT12/16 only, 1:Enable FAT32 supprt */
-
-
-#define    _CODE_PAGE    1
-/* Defines which code page is used for path name. Supported code pages are:
-/  932, 936, 949, 950, 437, 720, 737, 775, 850, 852, 855, 857, 858, 862, 866,
-/  874, 1250, 1251, 1252, 1253, 1254, 1255, 1257, 1258 and 1 (ASCII only).
-/  SBCS configurations except for 1 requiers a case conversion table. This
-/  might occupy 128 bytes on the RAM on some platforms, e.g. avr-gcc. */
-
-
-#define _WORD_ACCESS    0 //jonne 1 gives hard fault with lpc11u68
-/* The _WORD_ACCESS option defines which access method is used to the word
-/  data in the FAT structure.
-/
-/   0: Byte-by-byte access. Always compatible with all platforms.
-/   1: Word access. Do not choose this unless following condition is met.
-/
-/  When the byte order on the memory is big-endian or address miss-aligned
-/  word access results incorrect behavior, the _WORD_ACCESS must be set to 0.
-/  If it is not the case, the value can also be set to 1 to improve the
-/  performance and code efficiency. */
-
-
-/* End of configuration options. Do not change followings without care.     */
-/*--------------------------------------------------------------------------*/
-
-#if _FS_FAT32
-#define    CLUST    DWORD
-#else
-#define    CLUST    WORD
-#endif
-
-
-/* File system object structure */
-
-typedef struct _FATFS_ {
-    BYTE    fs_type;    /* FAT sub type */
-    BYTE    csize;        /* Number of sectors per cluster */
-    BYTE    flag;        /* File status flags */
-    BYTE    csect;        /* File sector address in the cluster */
-    WORD    n_rootdir;    /* Number of root directory entries (0 on FAT32) */
-    BYTE*    buf;        /* Pointer to the disk access buffer */
-    CLUST    max_clust;    /* Maximum cluster# + 1. Number of clusters is max_clust - 2 */
-    DWORD    fatbase;    /* FAT start sector */
-    DWORD    dirbase;    /* Root directory start sector (Cluster# on FAT32) */
-    DWORD    database;    /* Data start sector */
-    DWORD    fptr;        /* File R/W pointer */
-    DWORD    fsize;        /* File size */
-    CLUST    org_clust;    /* File start cluster */
-    CLUST    curr_clust;    /* File current cluster */
-    DWORD    dsect;        /* File current data sector */
-} FATFS;
-
-
-
-/* Directory object structure */
-
-typedef struct _DIR_ {
-    WORD    index;        /* Current read/write index number */
-    BYTE*    fn;            /* Pointer to the SFN (in/out) {file[8],ext[3],status[1]} */
-    CLUST    sclust;        /* Table start cluster (0:Static table) */
-    CLUST    clust;        /* Current cluster */
-    DWORD    sect;        /* Current sector */
-} FATDIR;
-
-
-
-/* File status structure */
-
-typedef struct _FILINFO_ {
-    DWORD    fsize;        /* File size */
-    WORD    fdate;        /* Last modified date */
-    WORD    ftime;        /* Last modified time */
-    BYTE    fattrib;    /* Attribute */
-    char    fname[13];    /* File name */
-} FILINFO;
-
-
-
-/* File function return code (FRESULT) */
-
-typedef enum {
-    FR_OK = 0,            /* 0 */
-    FR_DISK_ERR,        /* 1 */
-    FR_NOT_READY,        /* 2 */
-    FR_NO_FILE,            /* 3 */
-    FR_NO_PATH,            /* 4 */
-    FR_NOT_OPENED,        /* 5 */
-    FR_NOT_ENABLED,        /* 6 */
-    FR_NO_FILESYSTEM    /* 7 */
-} FRESULT;
-
-
-
-/*--------------------------------------------------------------*/
-/* Petit FatFs module application interface                     */
-
-FRESULT pf_mount (FATFS*);                        /* Mount/Unmount a logical drive */
-FRESULT pf_open (const char*);                    /* Open a file */
-FRESULT pf_read (void*, WORD, WORD*);            /* Read data from the open file */
-FRESULT pf_write (const void*, WORD, WORD*);    /* Write data to the open file */
-FRESULT pf_lseek (DWORD);                        /* Move file pointer of the open file */
-FRESULT pf_opendir (FATDIR*, const char*);            /* Open a directory */
-FRESULT pf_readdir (FATDIR*, FILINFO*);            /* Read a directory item from the open directory */
-
-
-
-/*--------------------------------------------------------------*/
-/* Flags and offset address                                     */
-
-/* File status flag (FATFS.flag) */
-
-#define    FA_OPENED    0x01
-#define    FA_WPRT        0x02
-#define    FA__WIP        0x40
-
-
-/* FAT sub type (FATFS.fs_type) */
-
-#define FS_FAT12    1
-#define FS_FAT16    2
-#define FS_FAT32    3
-
-
-/* File attribute bits for directory entry */
-
-#define    AM_RDO    0x01    /* Read only */
-#define    AM_HID    0x02    /* Hidden */
-#define    AM_SYS    0x04    /* System */
-#define    AM_VOL    0x08    /* Volume label */
-#define AM_LFN    0x0F    /* LFN entry */
-#define AM_DIR    0x10    /* Directory */
-#define AM_ARC    0x20    /* Archive */
-#define AM_MASK    0x3F    /* Mask of defined bits */
-
-
-/* FatFs refers the members in the FAT structures with byte offset instead
-/ of structure member because there are incompatibility of the packing option
-/ between various compilers. */
-
-#define BS_jmpBoot            0
-#define BS_OEMName            3
-#define BPB_BytsPerSec        11
-#define BPB_SecPerClus        13
-#define BPB_RsvdSecCnt        14
-#define BPB_NumFATs            16
-#define BPB_RootEntCnt        17
-#define BPB_TotSec16        19
-#define BPB_Media            21
-#define BPB_FATSz16            22
-#define BPB_SecPerTrk        24
-#define BPB_NumHeads        26
-#define BPB_HiddSec            28
-#define BPB_TotSec32        32
-#define BS_55AA                510
-
-#define BS_DrvNum            36
-#define BS_BootSig            38
-#define BS_VolID            39
-#define BS_VolLab            43
-#define BS_FilSysType        54
-
-#define BPB_FATSz32            36
-#define BPB_ExtFlags        40
-#define BPB_FSVer            42
-#define BPB_RootClus        44
-#define BPB_FSInfo            48
-#define BPB_BkBootSec        50
-#define BS_DrvNum32            64
-#define BS_BootSig32        66
-#define BS_VolID32            67
-#define BS_VolLab32            71
-#define BS_FilSysType32        82
-
-#define MBR_Table            446
-
-#define    DIR_Name            0
-#define    DIR_Attr            11
-#define    DIR_NTres            12
-#define    DIR_CrtTime            14
-#define    DIR_CrtDate            16
-#define    DIR_FstClusHI        20
-#define    DIR_WrtTime            22
-#define    DIR_WrtDate            24
-#define    DIR_FstClusLO        26
-#define    DIR_FileSize        28
-
-
-
-/*--------------------------------*/
-/* Multi-byte word access macros  */
-
-#if _WORD_ACCESS == 1    /* Enable word access to the FAT structure */
-#define    LD_WORD(ptr)        (WORD)(*(WORD*)(BYTE*)(ptr))
-#define    LD_DWORD(ptr)        (DWORD)(*(DWORD*)(BYTE*)(ptr))
-#define    ST_WORD(ptr,val)    *(WORD*)(BYTE*)(ptr)=(WORD)(val)
-#define    ST_DWORD(ptr,val)    *(DWORD*)(BYTE*)(ptr)=(DWORD)(val)
-#else                    /* Use byte-by-byte access to the FAT structure */
-#define    LD_WORD(ptr)        (WORD)(((WORD)*(BYTE*)((ptr)+1)<<8)|(WORD)*(BYTE*)(ptr))
-#define    LD_DWORD(ptr)        (DWORD)(((DWORD)*(BYTE*)((ptr)+3)<<24)|((DWORD)*(BYTE*)((ptr)+2)<<16)|((WORD)*(BYTE*)((ptr)+1)<<8)|*(BYTE*)(ptr))
-#define    ST_WORD(ptr,val)    *(BYTE*)(ptr)=(BYTE)(val); *(BYTE*)((ptr)+1)=(BYTE)((WORD)(val)>>8)
-#define    ST_DWORD(ptr,val)    *(BYTE*)(ptr)=(BYTE)(val); *(BYTE*)((ptr)+1)=(BYTE)((WORD)(val)>>8); *(BYTE*)((ptr)+2)=(BYTE)((DWORD)(val)>>16); *(BYTE*)((ptr)+3)=(BYTE)((DWORD)(val)>>24)
-#endif
-
-
-/*--------------------------------------------------------*/
-/* DBCS code ranges and SBCS extend char conversion table */
-
-#if _CODE_PAGE == 932    /* Japanese Shift-JIS */
-#define _DF1S    0x81    /* DBC 1st byte range 1 start */
-#define _DF1E    0x9F    /* DBC 1st byte range 1 end */
-#define _DF2S    0xE0    /* DBC 1st byte range 2 start */
-#define _DF2E    0xFC    /* DBC 1st byte range 2 end */
-#define _DS1S    0x40    /* DBC 2nd byte range 1 start */
-#define _DS1E    0x7E    /* DBC 2nd byte range 1 end */
-#define _DS2S    0x80    /* DBC 2nd byte range 2 start */
-#define _DS2E    0xFC    /* DBC 2nd byte range 2 end */
-
-#elif _CODE_PAGE == 936    /* Simplified Chinese GBK */
-#define _DF1S    0x81
-#define _DF1E    0xFE
-#define _DS1S    0x40
-#define _DS1E    0x7E
-#define _DS2S    0x80
-#define _DS2E    0xFE
-
-#elif _CODE_PAGE == 949    /* Korean */
-#define _DF1S    0x81
-#define _DF1E    0xFE
-#define _DS1S    0x41
-#define _DS1E    0x5A
-#define _DS2S    0x61
-#define _DS2E    0x7A
-#define _DS3S    0x81
-#define _DS3E    0xFE
-
-#elif _CODE_PAGE == 950    /* Traditional Chinese Big5 */
-#define _DF1S    0x81
-#define _DF1E    0xFE
-#define _DS1S    0x40
-#define _DS1E    0x7E
-#define _DS2S    0xA1
-#define _DS2E    0xFE
-
-#elif _CODE_PAGE == 437    /* U.S. (OEM) */
-#define _DF1S    0
-#define _EXCVT {0x80,0x9A,0x90,0x41,0x8E,0x41,0x8F,0x80,0x45,0x45,0x45,0x49,0x49,0x49,0x8E,0x8F,0x90,0x92,0x92,0x4F,0x99,0x4F,0x55,0x55,0x59,0x99,0x9A,0x9B,0x9C,0x9D,0x9E,0x9F, \
-                0x41,0x49,0x4F,0x55,0xA5,0xA5,0xA6,0xA7,0xA8,0xA9,0xAA,0xAB,0xAC,0x21,0xAE,0xAF,0xB0,0xB1,0xB2,0xB3,0xB4,0xB5,0xB6,0xB7,0xB8,0xB9,0xBA,0xBB,0xBC,0xBD,0xBE,0xBF, \
-                0xC0,0xC1,0xC2,0xC3,0xC4,0xC5,0xC6,0xC7,0xC8,0xC9,0xCA,0xCB,0xCC,0xCD,0xCE,0xCF,0xD0,0xD1,0xD2,0xD3,0xD4,0xD5,0xD6,0xD7,0xD8,0xD9,0xDA,0xDB,0xDC,0xDD,0xDE,0xDF, \
-                0xE0,0xE1,0xE2,0xE3,0xE4,0xE5,0xE6,0xE7,0xE8,0xE9,0xEA,0xEB,0xEC,0xED,0xEE,0xEF,0xF0,0xF1,0xF2,0xF3,0xF4,0xF5,0xF6,0xF7,0xF8,0xF9,0xFA,0xFB,0xFC,0xFD,0xFE,0xFF}
-
-#elif _CODE_PAGE == 720    /* Arabic (OEM) */
-#define _DF1S    0
-#define _EXCVT {0x80,0x81,0x45,0x41,0x84,0x41,0x86,0x43,0x45,0x45,0x45,0x49,0x49,0x8D,0x8E,0x8F,0x90,0x92,0x92,0x93,0x94,0x95,0x49,0x49,0x98,0x99,0x9A,0x9B,0x9C,0x9D,0x9E,0x9F, \
-                0xA0,0xA1,0xA2,0xA3,0xA4,0xA5,0xA6,0xA7,0xA8,0xA9,0xAA,0xAB,0xAC,0xAD,0xAE,0xAF,0xB0,0xB1,0xB2,0xB3,0xB4,0xB5,0xB6,0xB7,0xB8,0xB9,0xBA,0xBB,0xBC,0xBD,0xBE,0xBF, \
-                0xC0,0xC1,0xC2,0xC3,0xC4,0xC5,0xC6,0xC7,0xC8,0xC9,0xCA,0xCB,0xCC,0xCD,0xCE,0xCF,0xD0,0xD1,0xD2,0xD3,0xD4,0xD5,0xD6,0xD7,0xD8,0xD9,0xDA,0xDB,0xDC,0xDD,0xDE,0xDF, \
-                0xE0,0xE1,0xE2,0xE3,0xE4,0xE5,0xE6,0xE7,0xE8,0xE9,0xEA,0xEB,0xEC,0xED,0xEE,0xEF,0xF0,0xF1,0xF2,0xF3,0xF4,0xF5,0xF6,0xF7,0xF8,0xF9,0xFA,0xFB,0xFC,0xFD,0xFE,0xFF}
-
-#elif _CODE_PAGE == 737    /* Greek (OEM) */
-#define _DF1S    0
-#define _EXCVT {0x80,0x81,0x82,0x83,0x84,0x85,0x86,0x87,0x88,0x89,0x8A,0x8B,0x8C,0x8D,0x8E,0x8F,0x90,0x92,0x92,0x93,0x94,0x95,0x96,0x97,0x80,0x81,0x82,0x83,0x84,0x85,0x86,0x87, \
-                0x88,0x89,0x8A,0x8B,0x8C,0x8D,0x8E,0x8F,0x90,0x91,0xAA,0x92,0x93,0x94,0x95,0x96,0xB0,0xB1,0xB2,0xB3,0xB4,0xB5,0xB6,0xB7,0xB8,0xB9,0xBA,0xBB,0xBC,0xBD,0xBE,0xBF, \
-                0xC0,0xC1,0xC2,0xC3,0xC4,0xC5,0xC6,0xC7,0xC8,0xC9,0xCA,0xCB,0xCC,0xCD,0xCE,0xCF,0xD0,0xD1,0xD2,0xD3,0xD4,0xD5,0xD6,0xD7,0xD8,0xD9,0xDA,0xDB,0xDC,0xDD,0xDE,0xDF, \
-                0x97,0xEA,0xEB,0xEC,0xE4,0xED,0xEE,0xE7,0xE8,0xF1,0xEA,0xEB,0xEC,0xED,0xEE,0xEF,0xF0,0xF1,0xF2,0xF3,0xF4,0xF5,0xF6,0xF7,0xF8,0xF9,0xFA,0xFB,0xFC,0xFD,0xFE,0xFF}
-
-#elif _CODE_PAGE == 775    /* Baltic (OEM) */
-#define _DF1S    0
-#define _EXCVT {0x80,0x9A,0x91,0xA0,0x8E,0x95,0x8F,0x80,0xAD,0xED,0x8A,0x8A,0xA1,0x8D,0x8E,0x8F,0x90,0x92,0x92,0xE2,0x99,0x95,0x96,0x97,0x97,0x99,0x9A,0x9D,0x9C,0x9D,0x9E,0x9F, \
-                0xA0,0xA1,0xE0,0xA3,0xA3,0xA5,0xA6,0xA7,0xA8,0xA9,0xAA,0xAB,0xAC,0xAD,0xAE,0xAF,0xB0,0xB1,0xB2,0xB3,0xB4,0xB5,0xB6,0xB7,0xB8,0xB9,0xBA,0xBB,0xBC,0xBD,0xBE,0xBF, \
-                0xC0,0xC1,0xC2,0xC3,0xC4,0xC5,0xC6,0xC7,0xC8,0xC9,0xCA,0xCB,0xCC,0xCD,0xCE,0xCF,0xB5,0xB6,0xB7,0xB8,0xBD,0xBE,0xC6,0xC7,0xA5,0xD9,0xDA,0xDB,0xDC,0xDD,0xDE,0xDF, \
-                0xE0,0xE1,0xE2,0xE3,0xE5,0xE5,0xE6,0xE3,0xE8,0xE8,0xEA,0xEA,0xEE,0xED,0xEE,0xEF,0xF0,0xF1,0xF2,0xF3,0xF4,0xF5,0xF6,0xF7,0xF8,0xF9,0xFA,0xFB,0xFC,0xFD,0xFE,0xFF}
-
-#elif _CODE_PAGE == 850    /* Multilingual Latin 1 (OEM) */
-#define _DF1S    0
-#define _EXCVT {0x80,0x9A,0x90,0xB6,0x8E,0xB7,0x8F,0x80,0xD2,0xD3,0xD4,0xD8,0xD7,0xDE,0x8E,0x8F,0x90,0x92,0x92,0xE2,0x99,0xE3,0xEA,0xEB,0x59,0x99,0x9A,0x9D,0x9C,0x9D,0x9E,0x9F, \
-                0xB5,0xD6,0xE0,0xE9,0xA5,0xA5,0xA6,0xA7,0xA8,0xA9,0xAA,0xAB,0xAC,0x21,0xAE,0xAF,0xB0,0xB1,0xB2,0xB3,0xB4,0xB5,0xB6,0xB7,0xB8,0xB9,0xBA,0xBB,0xBC,0xBD,0xBE,0xBF, \
-                0xC0,0xC1,0xC2,0xC3,0xC4,0xC5,0xC7,0xC7,0xC8,0xC9,0xCA,0xCB,0xCC,0xCD,0xCE,0xCF,0xD0,0xD1,0xD2,0xD3,0xD4,0xD5,0xD6,0xD7,0xD8,0xD9,0xDA,0xDB,0xDC,0xDD,0xDE,0xDF, \
-                0xE0,0xE1,0xE2,0xE3,0xE5,0xE5,0xE6,0xE7,0xE7,0xE9,0xEA,0xEB,0xED,0xED,0xEE,0xEF,0xF0,0xF1,0xF2,0xF3,0xF4,0xF5,0xF6,0xF7,0xF8,0xF9,0xFA,0xFB,0xFC,0xFD,0xFE,0xFF}
-
-#elif _CODE_PAGE == 852    /* Latin 2 (OEM) */
-#define _DF1S    0
-#define _EXCVT {0x80,0x9A,0x90,0xB6,0x8E,0xDE,0x8F,0x80,0x9D,0xD3,0x8A,0x8A,0xD7,0x8D,0x8E,0x8F,0x90,0x91,0x91,0xE2,0x99,0x95,0x95,0x97,0x97,0x99,0x9A,0x9B,0x9B,0x9D,0x9E,0x9F, \
-                0xB5,0xD6,0xE0,0xE9,0xA4,0xA4,0xA6,0xA6,0xA8,0xA8,0xAA,0x8D,0xAC,0xB8,0xAE,0xAF,0xB0,0xB1,0xB2,0xB3,0xB4,0xB5,0xB6,0xB7,0xB8,0xB9,0xBA,0xBB,0xBC,0xBD,0xBD,0xBF, \
-                0xC0,0xC1,0xC2,0xC3,0xC4,0xC5,0xC6,0xC6,0xC8,0xC9,0xCA,0xCB,0xCC,0xCD,0xCE,0xCF,0xD1,0xD1,0xD2,0xD3,0xD2,0xD5,0xD6,0xD7,0xB7,0xD9,0xDA,0xDB,0xDC,0xDD,0xDE,0xDF, \
-                0xE0,0xE1,0xE2,0xE3,0xE3,0xD5,0xE6,0xE6,0xE8,0xE9,0xE8,0xEB,0xED,0xED,0xDD,0xEF,0xF0,0xF1,0xF2,0xF3,0xF4,0xF5,0xF6,0xF7,0xF8,0xF9,0xFA,0xEB,0xFC,0xFC,0xFE,0xFF}
-
-#elif _CODE_PAGE == 855    /* Cyrillic (OEM) */
-#define _DF1S    0
-#define _EXCVT {0x81,0x81,0x83,0x83,0x85,0x85,0x87,0x87,0x89,0x89,0x8B,0x8B,0x8D,0x8D,0x8F,0x8F,0x91,0x91,0x93,0x93,0x95,0x95,0x97,0x97,0x99,0x99,0x9B,0x9B,0x9D,0x9D,0x9F,0x9F, \
-                0xA1,0xA1,0xA3,0xA3,0xA5,0xA5,0xA7,0xA7,0xA9,0xA9,0xAB,0xAB,0xAD,0xAD,0xAE,0xAF,0xB0,0xB1,0xB2,0xB3,0xB4,0xB6,0xB6,0xB8,0xB8,0xB9,0xBA,0xBB,0xBC,0xBE,0xBE,0xBF, \
-                0xC0,0xC1,0xC2,0xC3,0xC4,0xC5,0xC7,0xC7,0xC8,0xC9,0xCA,0xCB,0xCC,0xCD,0xCE,0xCF,0xD1,0xD1,0xD3,0xD3,0xD5,0xD5,0xD7,0xD7,0xDD,0xD9,0xDA,0xDB,0xDC,0xDD,0xE0,0xDF, \
-                0xE0,0xE2,0xE2,0xE4,0xE4,0xE6,0xE6,0xE8,0xE8,0xEA,0xEA,0xEC,0xEC,0xEE,0xEE,0xEF,0xF0,0xF2,0xF2,0xF4,0xF4,0xF6,0xF6,0xF8,0xF8,0xFA,0xFA,0xFC,0xFC,0xFD,0xFE,0xFF}
-
-#elif _CODE_PAGE == 857    /* Turkish (OEM) */
-#define _DF1S    0
-#define _EXCVT {0x80,0x9A,0x90,0xB6,0x8E,0xB7,0x8F,0x80,0xD2,0xD3,0xD4,0xD8,0xD7,0x98,0x8E,0x8F,0x90,0x92,0x92,0xE2,0x99,0xE3,0xEA,0xEB,0x98,0x99,0x9A,0x9D,0x9C,0x9D,0x9E,0x9E, \
-                0xB5,0xD6,0xE0,0xE9,0xA5,0xA5,0xA6,0xA6,0xA8,0xA9,0xAA,0xAB,0xAC,0x21,0xAE,0xAF,0xB0,0xB1,0xB2,0xB3,0xB4,0xB5,0xB6,0xB7,0xB8,0xB9,0xBA,0xBB,0xBC,0xBD,0xBE,0xBF, \
-                0xC0,0xC1,0xC2,0xC3,0xC4,0xC5,0xC7,0xC7,0xC8,0xC9,0xCA,0xCB,0xCC,0xCD,0xCE,0xCF,0xD0,0xD1,0xD2,0xD3,0xD4,0xD5,0xD6,0xD7,0xD8,0xD9,0xDA,0xDB,0xDC,0xDD,0xDE,0xDF, \
-                0xE0,0xE1,0xE2,0xE3,0xE5,0xE5,0xE6,0xE7,0xE8,0xE9,0xEA,0xEB,0xDE,0x59,0xEE,0xEF,0xF0,0xF1,0xF2,0xF3,0xF4,0xF5,0xF6,0xF7,0xF8,0xF9,0xFA,0xFB,0xFC,0xFD,0xFE,0xFF}
-
-#elif _CODE_PAGE == 858    /* Multilingual Latin 1 + Euro (OEM) */
-#define _DF1S    0
-#define _EXCVT {0x80,0x9A,0x90,0xB6,0x8E,0xB7,0x8F,0x80,0xD2,0xD3,0xD4,0xD8,0xD7,0xDE,0x8E,0x8F,0x90,0x92,0x92,0xE2,0x99,0xE3,0xEA,0xEB,0x59,0x99,0x9A,0x9D,0x9C,0x9D,0x9E,0x9F, \
-                0xB5,0xD6,0xE0,0xE9,0xA5,0xA5,0xA6,0xA7,0xA8,0xA9,0xAA,0xAB,0xAC,0x21,0xAE,0xAF,0xB0,0xB1,0xB2,0xB3,0xB4,0xB5,0xB6,0xB7,0xB8,0xB9,0xBA,0xBB,0xBC,0xBD,0xBE,0xBF, \
-                0xC0,0xC1,0xC2,0xC3,0xC4,0xC5,0xC7,0xC7,0xC8,0xC9,0xCA,0xCB,0xCC,0xCD,0xCE,0xCF,0xD1,0xD1,0xD2,0xD3,0xD4,0xD5,0xD6,0xD7,0xD8,0xD9,0xDA,0xDB,0xDC,0xDD,0xDE,0xDF, \
-                0xE0,0xE1,0xE2,0xE3,0xE5,0xE5,0xE6,0xE7,0xE7,0xE9,0xEA,0xEB,0xED,0xED,0xEE,0xEF,0xF0,0xF1,0xF2,0xF3,0xF4,0xF5,0xF6,0xF7,0xF8,0xF9,0xFA,0xFB,0xFC,0xFD,0xFE,0xFF}
-
-#elif _CODE_PAGE == 862    /* Hebrew (OEM) */
-#define _DF1S    0
-#define _EXCVT {0x80,0x81,0x82,0x83,0x84,0x85,0x86,0x87,0x88,0x89,0x8A,0x8B,0x8C,0x8D,0x8E,0x8F,0x90,0x91,0x92,0x93,0x94,0x95,0x96,0x97,0x98,0x99,0x9A,0x9B,0x9C,0x9D,0x9E,0x9F, \
-                0x41,0x49,0x4F,0x55,0xA5,0xA5,0xA6,0xA7,0xA8,0xA9,0xAA,0xAB,0xAC,0x21,0xAE,0xAF,0xB0,0xB1,0xB2,0xB3,0xB4,0xB5,0xB6,0xB7,0xB8,0xB9,0xBA,0xBB,0xBC,0xBD,0xBE,0xBF, \
-                0xC0,0xC1,0xC2,0xC3,0xC4,0xC5,0xC6,0xC7,0xC8,0xC9,0xCA,0xCB,0xCC,0xCD,0xCE,0xCF,0xD0,0xD1,0xD2,0xD3,0xD4,0xD5,0xD6,0xD7,0xD8,0xD9,0xDA,0xDB,0xDC,0xDD,0xDE,0xDF, \
-                0xE0,0xE1,0xE2,0xE3,0xE4,0xE5,0xE6,0xE7,0xE8,0xE9,0xEA,0xEB,0xEC,0xED,0xEE,0xEF,0xF0,0xF1,0xF2,0xF3,0xF4,0xF5,0xF6,0xF7,0xF8,0xF9,0xFA,0xFB,0xFC,0xFD,0xFE,0xFF}
-
-#elif _CODE_PAGE == 866    /* Russian (OEM) */
-#define _DF1S    0
-#define _EXCVT {0x80,0x81,0x82,0x83,0x84,0x85,0x86,0x87,0x88,0x89,0x8A,0x8B,0x8C,0x8D,0x8E,0x8F,0x90,0x91,0x92,0x93,0x94,0x95,0x96,0x97,0x98,0x99,0x9A,0x9B,0x9C,0x9D,0x9E,0x9F, \
-                0x80,0x81,0x82,0x83,0x84,0x85,0x86,0x87,0x88,0x89,0x8A,0x8B,0x8C,0x8D,0x8E,0x8F,0xB0,0xB1,0xB2,0xB3,0xB4,0xB5,0xB6,0xB7,0xB8,0xB9,0xBA,0xBB,0xBC,0xBD,0xBE,0xBF, \
-                0xC0,0xC1,0xC2,0xC3,0xC4,0xC5,0xC6,0xC7,0xC8,0xC9,0xCA,0xCB,0xCC,0xCD,0xCE,0xCF,0xD0,0xD1,0xD2,0xD3,0xD4,0xD5,0xD6,0xD7,0xD8,0xD9,0xDA,0xDB,0xDC,0xDD,0xDE,0xDF, \
-                0x90,0x91,0x92,0x93,0x9d,0x95,0x96,0x97,0x98,0x99,0x9A,0x9B,0x9C,0x9D,0x9E,0x9F,0xF0,0xF0,0xF2,0xF2,0xF4,0xF4,0xF6,0xF6,0xF8,0xF9,0xFA,0xFB,0xFC,0xFD,0xFE,0xFF}
-
-#elif _CODE_PAGE == 874    /* Thai (OEM, Windows) */
-#define _DF1S    0
-#define _EXCVT {0x80,0x81,0x82,0x83,0x84,0x85,0x86,0x87,0x88,0x89,0x8A,0x8B,0x8C,0x8D,0x8E,0x8F,0x90,0x91,0x92,0x93,0x94,0x95,0x96,0x97,0x98,0x99,0x9A,0x9B,0x9C,0x9D,0x9E,0x9F, \
-                0xA0,0xA1,0xA2,0xA3,0xA4,0xA5,0xA6,0xA7,0xA8,0xA9,0xAA,0xAB,0xAC,0xAD,0xAE,0xAF,0xB0,0xB1,0xB2,0xB3,0xB4,0xB5,0xB6,0xB7,0xB8,0xB9,0xBA,0xBB,0xBC,0xBD,0xBE,0xBF, \
-                0xC0,0xC1,0xC2,0xC3,0xC4,0xC5,0xC6,0xC7,0xC8,0xC9,0xCA,0xCB,0xCC,0xCD,0xCE,0xCF,0xD0,0xD1,0xD2,0xD3,0xD4,0xD5,0xD6,0xD7,0xD8,0xD9,0xDA,0xDB,0xDC,0xDD,0xDE,0xDF, \
-                0xE0,0xE1,0xE2,0xE3,0xE4,0xE5,0xE6,0xE7,0xE8,0xE9,0xEA,0xEB,0xEC,0xED,0xEE,0xEF,0xF0,0xF1,0xF2,0xF3,0xF4,0xF5,0xF6,0xF7,0xF8,0xF9,0xFA,0xFB,0xFC,0xFD,0xFE,0xFF}
-
-#elif _CODE_PAGE == 1250 /* Central Europe (Windows) */
-#define _DF1S    0
-#define _EXCVT {0x80,0x81,0x82,0x83,0x84,0x85,0x86,0x87,0x88,0x89,0x8A,0x8B,0x8C,0x8D,0x8E,0x8F,0x90,0x91,0x92,0x93,0x94,0x95,0x96,0x97,0x98,0x99,0x8A,0x9B,0x8C,0x8D,0x8E,0x8F, \
-                0xA0,0xA1,0xA2,0xA3,0xA4,0xA5,0xA6,0xA7,0xA8,0xA9,0xAA,0xAB,0xAC,0xAD,0xAE,0xAF,0xB0,0xB1,0xB2,0xA3,0xB4,0xB5,0xB6,0xB7,0xB8,0xA5,0xAA,0xBB,0xBC,0xBD,0xBC,0xAF, \
-                0xC0,0xC1,0xC2,0xC3,0xC4,0xC5,0xC6,0xC7,0xC8,0xC9,0xCA,0xCB,0xCC,0xCD,0xCE,0xCF,0xD0,0xD1,0xD2,0xD3,0xD4,0xD5,0xD6,0xD7,0xD8,0xD9,0xDA,0xDB,0xDC,0xDD,0xDE,0xDF, \
-                0xC0,0xC1,0xC2,0xC3,0xC4,0xC5,0xC6,0xC7,0xC8,0xC9,0xCA,0xCB,0xCC,0xCD,0xCE,0xCF,0xD0,0xD1,0xD2,0xD3,0xD4,0xD5,0xD6,0xF7,0xD8,0xD9,0xDA,0xDB,0xDC,0xDD,0xDE,0xFF}
-
-#elif _CODE_PAGE == 1251 /* Cyrillic (Windows) */
-#define _DF1S    0
-#define _EXCVT {0x80,0x81,0x82,0x82,0x84,0x85,0x86,0x87,0x88,0x89,0x8A,0x8B,0x8C,0x8D,0x8E,0x8F,0x80,0x91,0x92,0x93,0x94,0x95,0x96,0x97,0x98,0x99,0x8A,0x9B,0x8C,0x8D,0x8E,0x8F, \
-                0xA0,0xA2,0xA2,0xA3,0xA4,0xA5,0xA6,0xA7,0xA8,0xA9,0xAA,0xAB,0xAC,0xAD,0xAE,0xAF,0xB0,0xB1,0xB2,0xB2,0xA5,0xB5,0xB6,0xB7,0xA8,0xB9,0xAA,0xBB,0xA3,0xBD,0xBD,0xAF, \
-                0xC0,0xC1,0xC2,0xC3,0xC4,0xC5,0xC6,0xC7,0xC8,0xC9,0xCA,0xCB,0xCC,0xCD,0xCE,0xCF,0xD0,0xD1,0xD2,0xD3,0xD4,0xD5,0xD6,0xD7,0xD8,0xD9,0xDA,0xDB,0xDC,0xDD,0xDE,0xDF, \
-                0xC0,0xC1,0xC2,0xC3,0xC4,0xC5,0xC6,0xC7,0xC8,0xC9,0xCA,0xCB,0xCC,0xCD,0xCE,0xCF,0xD0,0xD1,0xD2,0xD3,0xD4,0xD5,0xD6,0xD7,0xD8,0xD9,0xDA,0xDB,0xDC,0xDD,0xDE,0xDF}
-
-#elif _CODE_PAGE == 1252 /* Latin 1 (Windows) */
-#define _DF1S    0
-#define _EXCVT {0x80,0x81,0x82,0x83,0x84,0x85,0x86,0x87,0x88,0x89,0x8A,0x8B,0x8C,0x8D,0x8E,0x8F,0x90,0x91,0x92,0x93,0x94,0x95,0x96,0x97,0x98,0x99,0xAd,0x9B,0x8C,0x9D,0xAE,0x9F, \
-                0xA0,0x21,0xA2,0xA3,0xA4,0xA5,0xA6,0xA7,0xA8,0xA9,0xAA,0xAB,0xAC,0xAD,0xAE,0xAF,0xB0,0xB1,0xB2,0xB3,0xB4,0xB5,0xB6,0xB7,0xB8,0xB9,0xBA,0xBB,0xBC,0xBD,0xBE,0xBF, \
-                0xC0,0xC1,0xC2,0xC3,0xC4,0xC5,0xC6,0xC7,0xC8,0xC9,0xCA,0xCB,0xCC,0xCD,0xCE,0xCF,0xD0,0xD1,0xD2,0xD3,0xD4,0xD5,0xD6,0xD7,0xD8,0xD9,0xDA,0xDB,0xDC,0xDD,0xDE,0xDF, \
-                0xC0,0xC1,0xC2,0xC3,0xC4,0xC5,0xC6,0xC7,0xC8,0xC9,0xCA,0xCB,0xCC,0xCD,0xCE,0xCF,0xD0,0xD1,0xD2,0xD3,0xD4,0xD5,0xD6,0xF7,0xD8,0xD9,0xDA,0xDB,0xDC,0xDD,0xDE,0x9F}
-
-#elif _CODE_PAGE == 1253 /* Greek (Windows) */
-#define _DF1S    0
-#define _EXCVT {0x80,0x81,0x82,0x83,0x84,0x85,0x86,0x87,0x88,0x89,0x8A,0x8B,0x8C,0x8D,0x8E,0x8F,0x90,0x91,0x92,0x93,0x94,0x95,0x96,0x97,0x98,0x99,0x9A,0x9B,0x9C,0x9D,0x9E,0x9F, \
-                0xA0,0xA1,0xA2,0xA3,0xA4,0xA5,0xA6,0xA7,0xA8,0xA9,0xAA,0xAB,0xAC,0xAD,0xAE,0xAF,0xB0,0xB1,0xB2,0xB3,0xB4,0xB5,0xB6,0xB7,0xB8,0xB9,0xBA,0xBB,0xBC,0xBD,0xBE,0xBF, \
-                0xC0,0xC1,0xC2,0xC3,0xC4,0xC5,0xC6,0xC7,0xC8,0xC9,0xCA,0xCB,0xCC,0xCD,0xCE,0xCF,0xD0,0xD1,0xD2,0xD3,0xD4,0xD5,0xD6,0xD7,0xD8,0xD9,0xDA,0xDB,0xA2,0xB8,0xB9,0xBA, \
-                0xE0,0xC1,0xC2,0xC3,0xC4,0xC5,0xC6,0xC7,0xC8,0xC9,0xCA,0xCB,0xCC,0xCD,0xCE,0xCF,0xD0,0xD1,0xF2,0xD3,0xD4,0xD5,0xD6,0xD7,0xD8,0xD9,0xDA,0xFB,0xBC,0xFD,0xBF,0xFF}
-
-#elif _CODE_PAGE == 1254 /* Turkish (Windows) */
-#define _DF1S    0
-#define _EXCVT {0x80,0x81,0x82,0x83,0x84,0x85,0x86,0x87,0x88,0x89,0x8A,0x8B,0x8C,0x8D,0x8E,0x8F,0x90,0x91,0x92,0x93,0x94,0x95,0x96,0x97,0x98,0x99,0x8A,0x9B,0x8C,0x9D,0x9E,0x9F, \
-                0xA0,0x21,0xA2,0xA3,0xA4,0xA5,0xA6,0xA7,0xA8,0xA9,0xAA,0xAB,0xAC,0xAD,0xAE,0xAF,0xB0,0xB1,0xB2,0xB3,0xB4,0xB5,0xB6,0xB7,0xB8,0xB9,0xBA,0xBB,0xBC,0xBD,0xBE,0xBF, \
-                0xC0,0xC1,0xC2,0xC3,0xC4,0xC5,0xC6,0xC7,0xC8,0xC9,0xCA,0xCB,0xCC,0xCD,0xCE,0xCF,0xD0,0xD1,0xD2,0xD3,0xD4,0xD5,0xD6,0xD7,0xD8,0xD9,0xDA,0xDB,0xDC,0xDD,0xDE,0xDF, \
-                0xC0,0xC1,0xC2,0xC3,0xC4,0xC5,0xC6,0xC7,0xC8,0xC9,0xCA,0xCB,0xCC,0xCD,0xCE,0xCF,0xD0,0xD1,0xD2,0xD3,0xD4,0xD5,0xD6,0xF7,0xD8,0xD9,0xDA,0xDB,0xDC,0xDD,0xDE,0x9F}
-
-#elif _CODE_PAGE == 1255 /* Hebrew (Windows) */
-#define _DF1S    0
-#define _EXCVT {0x80,0x81,0x82,0x83,0x84,0x85,0x86,0x87,0x88,0x89,0x8A,0x8B,0x8C,0x8D,0x8E,0x8F,0x90,0x91,0x92,0x93,0x94,0x95,0x96,0x97,0x98,0x99,0x9A,0x9B,0x9C,0x9D,0x9E,0x9F, \
-                0xA0,0x21,0xA2,0xA3,0xA4,0xA5,0xA6,0xA7,0xA8,0xA9,0xAA,0xAB,0xAC,0xAD,0xAE,0xAF,0xB0,0xB1,0xB2,0xB3,0xB4,0xB5,0xB6,0xB7,0xB8,0xB9,0xBA,0xBB,0xBC,0xBD,0xBE,0xBF, \
-                0xC0,0xC1,0xC2,0xC3,0xC4,0xC5,0xC6,0xC7,0xC8,0xC9,0xCA,0xCB,0xCC,0xCD,0xCE,0xCF,0xD0,0xD1,0xD2,0xD3,0xD4,0xD5,0xD6,0xD7,0xD8,0xD9,0xDA,0xDB,0xDC,0xDD,0xDE,0xDF, \
-                0xE0,0xE1,0xE2,0xE3,0xE4,0xE5,0xE6,0xE7,0xE8,0xE9,0xEA,0xEB,0xEC,0xED,0xEE,0xEF,0xF0,0xF1,0xF2,0xF3,0xF4,0xF5,0xF6,0xF7,0xF8,0xF9,0xFA,0xFB,0xFC,0xFD,0xFE,0xFF}
-
-#elif _CODE_PAGE == 1256 /* Arabic (Windows) */
-#define _DF1S    0
-#define _EXCVT {0x80,0x81,0x82,0x83,0x84,0x85,0x86,0x87,0x88,0x89,0x8A,0x8B,0x8C,0x8D,0x8E,0x8F,0x90,0x91,0x92,0x93,0x94,0x95,0x96,0x97,0x98,0x99,0x9A,0x9B,0x8C,0x9D,0x9E,0x9F, \
-                0xA0,0xA1,0xA2,0xA3,0xA4,0xA5,0xA6,0xA7,0xA8,0xA9,0xAA,0xAB,0xAC,0xAD,0xAE,0xAF,0xB0,0xB1,0xB2,0xB3,0xB4,0xB5,0xB6,0xB7,0xB8,0xB9,0xBA,0xBB,0xBC,0xBD,0xBE,0xBF, \
-                0xC0,0xC1,0xC2,0xC3,0xC4,0xC5,0xC6,0xC7,0xC8,0xC9,0xCA,0xCB,0xCC,0xCD,0xCE,0xCF,0xD0,0xD1,0xD2,0xD3,0xD4,0xD5,0xD6,0xD7,0xD8,0xD9,0xDA,0xDB,0xDC,0xDD,0xDE,0xDF, \
-                0x41,0xE1,0x41,0xE3,0xE4,0xE5,0xE6,0x43,0x45,0x45,0x45,0x45,0xEC,0xED,0x49,0x49,0xF0,0xF1,0xF2,0xF3,0x4F,0xF5,0xF6,0xF7,0xF8,0x55,0xFA,0x55,0x55,0xFD,0xFE,0xFF}
-
-#elif _CODE_PAGE == 1257 /* Baltic (Windows) */
-#define _DF1S    0
-#define _EXCVT {0x80,0x81,0x82,0x83,0x84,0x85,0x86,0x87,0x88,0x89,0x8A,0x8B,0x8C,0x8D,0x8E,0x8F,0x90,0x91,0x92,0x93,0x94,0x95,0x96,0x97,0x98,0x99,0x9A,0x9B,0x9C,0x9D,0x9E,0x9F, \
-                0xA0,0xA1,0xA2,0xA3,0xA4,0xA5,0xA6,0xA7,0xA8,0xA9,0xAA,0xAB,0xAC,0xAD,0xAE,0xAF,0xB0,0xB1,0xB2,0xB3,0xB4,0xB5,0xB6,0xB7,0xA8,0xB9,0xAA,0xBB,0xBC,0xBD,0xBE,0xAF, \
-                0xC0,0xC1,0xC2,0xC3,0xC4,0xC5,0xC6,0xC7,0xC8,0xC9,0xCA,0xCB,0xCC,0xCD,0xCE,0xCF,0xD0,0xD1,0xD2,0xD3,0xD4,0xD5,0xD6,0xD7,0xD8,0xD9,0xDA,0xDB,0xDC,0xDD,0xDE,0xDF, \
-                0xC0,0xC1,0xC2,0xC3,0xC4,0xC5,0xC6,0xC7,0xC8,0xC9,0xCA,0xCB,0xCC,0xCD,0xCE,0xCF,0xD0,0xD1,0xD2,0xD3,0xD4,0xD5,0xD6,0xF7,0xD8,0xD9,0xDA,0xDB,0xDC,0xDD,0xDE,0xFF}
-
-#elif _CODE_PAGE == 1258 /* Vietnam (OEM, Windows) */
-#define _DF1S    0
-#define _EXCVT {0x80,0x81,0x82,0x83,0x84,0x85,0x86,0x87,0x88,0x89,0x8A,0x8B,0x8C,0x8D,0x8E,0x8F,0x90,0x91,0x92,0x93,0x94,0x95,0x96,0x97,0x98,0x99,0x9A,0x9B,0xAC,0x9D,0x9E,0x9F, \
-                0xA0,0x21,0xA2,0xA3,0xA4,0xA5,0xA6,0xA7,0xA8,0xA9,0xAA,0xAB,0xAC,0xAD,0xAE,0xAF,0xB0,0xB1,0xB2,0xB3,0xB4,0xB5,0xB6,0xB7,0xB8,0xB9,0xBA,0xBB,0xBC,0xBD,0xBE,0xBF, \
-                0xC0,0xC1,0xC2,0xC3,0xC4,0xC5,0xC6,0xC7,0xC8,0xC9,0xCA,0xCB,0xCC,0xCD,0xCE,0xCF,0xD0,0xD1,0xD2,0xD3,0xD4,0xD5,0xD6,0xD7,0xD8,0xD9,0xDA,0xDB,0xDC,0xDD,0xDE,0xDF, \
-                0xC0,0xC1,0xC2,0xC3,0xC4,0xC5,0xC6,0xC7,0xC8,0xC9,0xCA,0xCB,0xEC,0xCD,0xCE,0xCF,0xD0,0xD1,0xF2,0xD3,0xD4,0xD5,0xD6,0xF7,0xD8,0xD9,0xDA,0xDB,0xDC,0xDD,0xFE,0x9F}
-
-#elif _CODE_PAGE == 1    /* ASCII (for only non-LFN cfg) */
-#define _DF1S    0
-
-#else
-#error Unknown code page
-
-#endif
-
-
-
-/* Character code support macros */
-
-#define IsUpper(c)    (((c)>='A')&&((c)<='Z'))
-#define IsLower(c)    (((c)>='a')&&((c)<='z'))
-
-#if _DF1S        /* DBCS configuration */
-
-#ifdef _DF2S    /* Two 1st byte areas */
-#define IsDBCS1(c)    (((BYTE)(c) >= _DF1S && (BYTE)(c) <= _DF1E) || ((BYTE)(c) >= _DF2S && (BYTE)(c) <= _DF2E))
-#else            /* One 1st byte area */
-#define IsDBCS1(c)    ((BYTE)(c) >= _DF1S && (BYTE)(c) <= _DF1E)
-#endif
-
-#ifdef _DS3S    /* Three 2nd byte areas */
-#define IsDBCS2(c)    (((BYTE)(c) >= _DS1S && (BYTE)(c) <= _DS1E) || ((BYTE)(c) >= _DS2S && (BYTE)(c) <= _DS2E) || ((BYTE)(c) >= _DS3S && (BYTE)(c) <= _DS3E))
-#else            /* Two 2nd byte areas */
-#define IsDBCS2(c)    (((BYTE)(c) >= _DS1S && (BYTE)(c) <= _DS1E) || ((BYTE)(c) >= _DS2S && (BYTE)(c) <= _DS2E))
-#endif
-
-#else            /* SBCS configuration */
-
-#define IsDBCS1(c)    0
-#define IsDBCS2(c)    0
-
-#endif /* _DF1S */
-
-
-#endif /* _FATFS */
-