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:
Mon Apr 02 22:37:04 2018 +0000
Parent:
34:427237571c6a
Child:
36:771321e70814
Commit message:
All changes synced with Github repo (mode 13, mode 15 etc.)

Changed in this revision

POKITTO_CORE/FONTS/fontMonkey.cpp Show annotated file Show diff for this revision Revisions of this file
POKITTO_CORE/GBcompatibility.h Show diff for this revision Revisions of this file
POKITTO_CORE/Localization.h Show diff for this revision Revisions of this file
POKITTO_CORE/Macros_LCD.h 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/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 annotated file 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 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 annotated file 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 annotated file 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
Pokitto.h Show annotated file Show diff for this revision Revisions of this file
Pokitto_settings.h Show annotated file Show diff for this revision Revisions of this file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/POKITTO_CORE/FONTS/fontMonkey.cpp	Mon Apr 02 22:37:04 2018 +0000
@@ -0,0 +1,113 @@
+
+//WARNING: This Font is usable only with MikroE GLCD Lib.
+//         X-GLCD Lib does not handle this font.
+
+//Font Generated by MikroElektronika GLCD Font Creator 1.2.0.0
+//MikroeElektronika 2011
+//http://www.mikroe.com
+
+//GLCD FontName : C64Font8x8
+//GLCD FontSize : 8 x 8
+#include "PokittoFonts.h"
+
+const unsigned char fontMonkey[] = {
+        8,9,32,0, // width, height, start character, only caps
+        0x05, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,  // Code for char
+        0x02, 0x9E, 0x00, 0x9E, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,  // Code for char !
+        0x06, 0x0E, 0x00, 0x0E, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0E, 0x00, 0x0E, 0x00, 0x00, 0x00, 0x00, 0x00,  // Code for char "
+        0x08, 0x28, 0x00, 0xFE, 0x00, 0xFE, 0x00, 0x28, 0x00, 0x28, 0x00, 0xFE, 0x00, 0xFE, 0x00, 0x28, 0x00,  // Code for char #
+        0x06, 0x48, 0x00, 0x5C, 0x00, 0xD6, 0x00, 0xD6, 0x00, 0x74, 0x00, 0x24, 0x00, 0x00, 0x00, 0x00, 0x00,  // Code for char $
+        0x06, 0xC6, 0x00, 0x66, 0x00, 0x30, 0x00, 0x18, 0x00, 0xCC, 0x00, 0xC6, 0x00, 0x00, 0x00, 0x00, 0x00,  // Code for char %
+        0x07, 0x64, 0x00, 0xFE, 0x00, 0x9A, 0x00, 0x9A, 0x00, 0xEE, 0x00, 0xE4, 0x00, 0xA0, 0x00, 0x00, 0x00,  // Code for char &
+        0x03, 0x08, 0x00, 0x04, 0x00, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,  // Code for char '
+        0x04, 0x38, 0x00, 0x7C, 0x00, 0xC6, 0x00, 0x82, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,  // Code for char (
+        0x04, 0x82, 0x00, 0xC6, 0x00, 0x7C, 0x00, 0x38, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,  // Code for char )
+        0x08, 0x10, 0x00, 0x54, 0x00, 0x7C, 0x00, 0x38, 0x00, 0x38, 0x00, 0x7C, 0x00, 0x54, 0x00, 0x10, 0x00,  // Code for char *
+        0x06, 0x10, 0x00, 0x10, 0x00, 0x7C, 0x00, 0x7C, 0x00, 0x10, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00,  // Code for char +
+        0x03, 0x00, 0x01, 0xC0, 0x01, 0xC0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,  // Code for char ,
+        0x06, 0x10, 0x00, 0x10, 0x00, 0x10, 0x00, 0x10, 0x00, 0x10, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00,  // Code for char -
+        0x02, 0xC0, 0x00, 0xC0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,  // Code for char .
+        0x07, 0x80, 0x00, 0xC0, 0x00, 0x60, 0x00, 0x30, 0x00, 0x18, 0x00, 0x0C, 0x00, 0x04, 0x00, 0x00, 0x00,  // Code for char /
+        0x06, 0x7C, 0x00, 0xFE, 0x00, 0x82, 0x00, 0x82, 0x00, 0xFE, 0x00, 0x7C, 0x00, 0x00, 0x00, 0x00, 0x00,  // Code for char 0
+        0x06, 0x80, 0x00, 0x88, 0x00, 0xFE, 0x00, 0xFE, 0x00, 0x80, 0x00, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00,  // Code for char 1
+        0x06, 0xC4, 0x00, 0xE6, 0x00, 0xA2, 0x00, 0x92, 0x00, 0x9E, 0x00, 0x8C, 0x00, 0x00, 0x00, 0x00, 0x00,  // Code for char 2
+        0x06, 0x44, 0x00, 0xC6, 0x00, 0x92, 0x00, 0x92, 0x00, 0xFE, 0x00, 0x6C, 0x00, 0x00, 0x00, 0x00, 0x00,  // Code for char 3
+        0x07, 0x30, 0x00, 0x30, 0x00, 0x28, 0x00, 0x2C, 0x00, 0xFE, 0x00, 0xFE, 0x00, 0x20, 0x00, 0x00, 0x00,  // Code for char 4
+        0x06, 0x4E, 0x00, 0xCE, 0x00, 0x8A, 0x00, 0x8A, 0x00, 0xFA, 0x00, 0x72, 0x00, 0x00, 0x00, 0x00, 0x00,  // Code for char 5
+        0x06, 0x7C, 0x00, 0xFE, 0x00, 0x92, 0x00, 0x92, 0x00, 0xF6, 0x00, 0x64, 0x00, 0x00, 0x00, 0x00, 0x00,  // Code for char 6
+        0x06, 0x06, 0x00, 0x06, 0x00, 0xF2, 0x00, 0xFA, 0x00, 0x0E, 0x00, 0x06, 0x00, 0x00, 0x00, 0x00, 0x00,  // Code for char 7
+        0x06, 0x6C, 0x00, 0xFE, 0x00, 0x92, 0x00, 0x92, 0x00, 0xFE, 0x00, 0x6C, 0x00, 0x00, 0x00, 0x00, 0x00,  // Code for char 8
+        0x06, 0x4C, 0x00, 0xDE, 0x00, 0x92, 0x00, 0x92, 0x00, 0xFE, 0x00, 0x7C, 0x00, 0x00, 0x00, 0x00, 0x00,  // Code for char 9
+        0x02, 0x48, 0x00, 0x48, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,  // Code for char :
+        0x03, 0x00, 0x01, 0xC8, 0x01, 0xC8, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,  // Code for char ;
+        0x06, 0x10, 0x00, 0x38, 0x00, 0x6C, 0x00, 0xC6, 0x00, 0x82, 0x00, 0x82, 0x00, 0x00, 0x00, 0x00, 0x00,  // Code for char <
+        0x06, 0x28, 0x00, 0x28, 0x00, 0x28, 0x00, 0x28, 0x00, 0x28, 0x00, 0x28, 0x00, 0x00, 0x00, 0x00, 0x00,  // Code for char =
+        0x06, 0x82, 0x00, 0x82, 0x00, 0xC6, 0x00, 0x6C, 0x00, 0x38, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00,  // Code for char >
+        0x06, 0x04, 0x00, 0x06, 0x00, 0xA2, 0x00, 0xB2, 0x00, 0x1E, 0x00, 0x0C, 0x00, 0x00, 0x00, 0x00, 0x00,  // Code for char ?
+        0x07, 0xFC, 0x00, 0x02, 0x01, 0x72, 0x01, 0x4A, 0x01, 0x7A, 0x01, 0x42, 0x01, 0x3C, 0x00, 0x00, 0x00,  // Code for char @
+        0x06, 0xF8, 0x00, 0xFC, 0x00, 0x16, 0x00, 0x16, 0x00, 0xFC, 0x00, 0xF8, 0x00, 0x00, 0x00, 0x00, 0x00,  // Code for char A
+        0x06, 0xFE, 0x00, 0xFE, 0x00, 0x92, 0x00, 0x92, 0x00, 0xFE, 0x00, 0x6C, 0x00, 0x00, 0x00, 0x00, 0x00,  // Code for char B
+        0x06, 0x7C, 0x00, 0xFE, 0x00, 0x82, 0x00, 0x82, 0x00, 0xC6, 0x00, 0x44, 0x00, 0x00, 0x00, 0x00, 0x00,  // Code for char C
+        0x06, 0xFE, 0x00, 0xFE, 0x00, 0x82, 0x00, 0xC6, 0x00, 0x7C, 0x00, 0x38, 0x00, 0x00, 0x00, 0x00, 0x00,  // Code for char D
+        0x06, 0xFE, 0x00, 0xFE, 0x00, 0x92, 0x00, 0x92, 0x00, 0x82, 0x00, 0x82, 0x00, 0x00, 0x00, 0x00, 0x00,  // Code for char E
+        0x06, 0xFE, 0x00, 0xFE, 0x00, 0x12, 0x00, 0x12, 0x00, 0x02, 0x00, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00,  // Code for char F
+        0x06, 0x7C, 0x00, 0xFE, 0x00, 0x82, 0x00, 0x92, 0x00, 0xF6, 0x00, 0x74, 0x00, 0x00, 0x00, 0x00, 0x00,  // Code for char G
+        0x06, 0xFE, 0x00, 0xFE, 0x00, 0x10, 0x00, 0x10, 0x00, 0xFE, 0x00, 0xFE, 0x00, 0x00, 0x00, 0x00, 0x00,  // Code for char H
+        0x04, 0x82, 0x00, 0xFE, 0x00, 0xFE, 0x00, 0x82, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,  // Code for char I
+        0x06, 0x40, 0x00, 0xC0, 0x00, 0x82, 0x00, 0xFE, 0x00, 0x7E, 0x00, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00,  // Code for char J
+        0x06, 0xFE, 0x00, 0xFE, 0x00, 0x38, 0x00, 0x6C, 0x00, 0xC6, 0x00, 0x82, 0x00, 0x00, 0x00, 0x00, 0x00,  // Code for char K
+        0x06, 0xFE, 0x00, 0xFE, 0x00, 0x80, 0x00, 0x80, 0x00, 0x80, 0x00, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00,  // Code for char L
+        0x07, 0xFE, 0x00, 0xFE, 0x00, 0x0C, 0x00, 0x18, 0x00, 0x0C, 0x00, 0xFE, 0x00, 0xFE, 0x00, 0x00, 0x00,  // Code for char M
+        0x06, 0xFE, 0x00, 0xFE, 0x00, 0x1C, 0x00, 0x38, 0x00, 0xFE, 0x00, 0xFE, 0x00, 0x00, 0x00, 0x00, 0x00,  // Code for char N
+        0x06, 0x7C, 0x00, 0xFE, 0x00, 0x82, 0x00, 0x82, 0x00, 0xFE, 0x00, 0x7C, 0x00, 0x00, 0x00, 0x00, 0x00,  // Code for char O
+        0x06, 0xFE, 0x00, 0xFE, 0x00, 0x12, 0x00, 0x12, 0x00, 0x1E, 0x00, 0x0C, 0x00, 0x00, 0x00, 0x00, 0x00,  // Code for char P
+        0x06, 0x3C, 0x00, 0x7E, 0x00, 0x42, 0x00, 0xC2, 0x00, 0xFE, 0x00, 0xBC, 0x00, 0x00, 0x00, 0x00, 0x00,  // Code for char Q
+        0x06, 0xFE, 0x00, 0xFE, 0x00, 0x32, 0x00, 0x72, 0x00, 0xDE, 0x00, 0x8C, 0x00, 0x00, 0x00, 0x00, 0x00,  // Code for char R
+        0x06, 0x4C, 0x00, 0xDE, 0x00, 0x92, 0x00, 0x92, 0x00, 0xF6, 0x00, 0x64, 0x00, 0x00, 0x00, 0x00, 0x00,  // Code for char S
+        0x06, 0x02, 0x00, 0x02, 0x00, 0xFE, 0x00, 0xFE, 0x00, 0x02, 0x00, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00,  // Code for char T
+        0x06, 0x7E, 0x00, 0xFE, 0x00, 0x80, 0x00, 0x80, 0x00, 0xFE, 0x00, 0x7E, 0x00, 0x00, 0x00, 0x00, 0x00,  // Code for char U
+        0x06, 0x3E, 0x00, 0x7E, 0x00, 0xC0, 0x00, 0xC0, 0x00, 0x7E, 0x00, 0x3E, 0x00, 0x00, 0x00, 0x00, 0x00,  // Code for char V
+        0x07, 0xFE, 0x00, 0xFE, 0x00, 0x60, 0x00, 0x30, 0x00, 0x60, 0x00, 0xFE, 0x00, 0xFE, 0x00, 0x00, 0x00,  // Code for char W
+        0x06, 0xC6, 0x00, 0xEE, 0x00, 0x38, 0x00, 0x38, 0x00, 0xEE, 0x00, 0xC6, 0x00, 0x00, 0x00, 0x00, 0x00,  // Code for char X
+        0x06, 0x0E, 0x00, 0x1E, 0x00, 0xF0, 0x00, 0xF0, 0x00, 0x1E, 0x00, 0x0E, 0x00, 0x00, 0x00, 0x00, 0x00,  // Code for char Y
+        0x06, 0xC2, 0x00, 0xE2, 0x00, 0xB2, 0x00, 0x9A, 0x00, 0x8E, 0x00, 0x86, 0x00, 0x00, 0x00, 0x00, 0x00,  // Code for char Z
+        0x03, 0xFE, 0x00, 0xFE, 0x00, 0x82, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,  // Code for char [
+        0x07, 0x04, 0x00, 0x0C, 0x00, 0x18, 0x00, 0x30, 0x00, 0x60, 0x00, 0xC0, 0x00, 0x80, 0x00, 0x00, 0x00,  // Code for char BackSlash
+        0x03, 0x82, 0x00, 0xFE, 0x00, 0xFE, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,  // Code for char ]
+        0x04, 0x04, 0x00, 0x02, 0x00, 0x02, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,  // Code for char ^
+        0x06, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00,  // Code for char _
+        0x02, 0x02, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,  // Code for char `
+        0x06, 0x40, 0x00, 0xE8, 0x00, 0xA8, 0x00, 0xA8, 0x00, 0xF8, 0x00, 0xF0, 0x00, 0x00, 0x00, 0x00, 0x00,  // Code for char a
+        0x06, 0xFC, 0x00, 0xFC, 0x00, 0x90, 0x00, 0x90, 0x00, 0xF0, 0x00, 0x60, 0x00, 0x00, 0x00, 0x00, 0x00,  // Code for char b
+        0x05, 0x70, 0x00, 0xF8, 0x00, 0x88, 0x00, 0x88, 0x00, 0x88, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,  // Code for char c
+        0x06, 0x70, 0x00, 0xF8, 0x00, 0x88, 0x00, 0x88, 0x00, 0xFE, 0x00, 0xFE, 0x00, 0x00, 0x00, 0x00, 0x00,  // Code for char d
+        0x06, 0x70, 0x00, 0xF8, 0x00, 0xA8, 0x00, 0xA8, 0x00, 0xB8, 0x00, 0x30, 0x00, 0x00, 0x00, 0x00, 0x00,  // Code for char e
+        0x05, 0x08, 0x00, 0xFC, 0x00, 0xFE, 0x00, 0x0A, 0x00, 0x0A, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,  // Code for char f
+        0x06, 0x30, 0x01, 0x78, 0x01, 0x48, 0x01, 0x48, 0x01, 0xF8, 0x01, 0xF8, 0x00, 0x00, 0x00, 0x00, 0x00,  // Code for char g
+        0x06, 0xFE, 0x00, 0xFE, 0x00, 0x08, 0x00, 0x08, 0x00, 0xF8, 0x00, 0xF0, 0x00, 0x00, 0x00, 0x00, 0x00,  // Code for char h
+        0x04, 0x90, 0x00, 0xF4, 0x00, 0xF4, 0x00, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,  // Code for char i
+        0x05, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0xF4, 0x01, 0xF4, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,  // Code for char j
+        0x06, 0xFE, 0x00, 0xFE, 0x00, 0x20, 0x00, 0x70, 0x00, 0xD0, 0x00, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00,  // Code for char k
+        0x04, 0x82, 0x00, 0xFE, 0x00, 0xFE, 0x00, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,  // Code for char l
+        0x07, 0xF8, 0x00, 0xF8, 0x00, 0x30, 0x00, 0x70, 0x00, 0x38, 0x00, 0xF8, 0x00, 0xF0, 0x00, 0x00, 0x00,  // Code for char m
+        0x06, 0xF8, 0x00, 0xF8, 0x00, 0x08, 0x00, 0x08, 0x00, 0xF8, 0x00, 0xF0, 0x00, 0x00, 0x00, 0x00, 0x00,  // Code for char n
+        0x06, 0x70, 0x00, 0xF8, 0x00, 0x88, 0x00, 0x88, 0x00, 0xF8, 0x00, 0x70, 0x00, 0x00, 0x00, 0x00, 0x00,  // Code for char o
+        0x06, 0xF8, 0x01, 0xF8, 0x01, 0x48, 0x00, 0x48, 0x00, 0x78, 0x00, 0x30, 0x00, 0x00, 0x00, 0x00, 0x00,  // Code for char p
+        0x06, 0x30, 0x00, 0x78, 0x00, 0x48, 0x00, 0x48, 0x00, 0xF8, 0x01, 0xF8, 0x01, 0x00, 0x00, 0x00, 0x00,  // Code for char q
+        0x06, 0xF8, 0x00, 0xF8, 0x00, 0x08, 0x00, 0x08, 0x00, 0x18, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00,  // Code for char r
+        0x06, 0x90, 0x00, 0xB8, 0x00, 0xA8, 0x00, 0xA8, 0x00, 0xE8, 0x00, 0x48, 0x00, 0x00, 0x00, 0x00, 0x00,  // Code for char s
+        0x06, 0x08, 0x00, 0x08, 0x00, 0x7E, 0x00, 0xFE, 0x00, 0x88, 0x00, 0x88, 0x00, 0x00, 0x00, 0x00, 0x00,  // Code for char t
+        0x06, 0x78, 0x00, 0xF8, 0x00, 0x80, 0x00, 0x80, 0x00, 0xF8, 0x00, 0xF8, 0x00, 0x00, 0x00, 0x00, 0x00,  // Code for char u
+        0x06, 0x38, 0x00, 0x78, 0x00, 0xC0, 0x00, 0xC0, 0x00, 0x78, 0x00, 0x38, 0x00, 0x00, 0x00, 0x00, 0x00,  // Code for char v
+        0x07, 0x38, 0x00, 0xF8, 0x00, 0xE0, 0x00, 0x70, 0x00, 0xE0, 0x00, 0xF8, 0x00, 0x38, 0x00, 0x00, 0x00,  // Code for char w
+        0x06, 0x88, 0x00, 0xD8, 0x00, 0x70, 0x00, 0x70, 0x00, 0xD8, 0x00, 0x88, 0x00, 0x00, 0x00, 0x00, 0x00,  // Code for char x
+        0x06, 0x38, 0x01, 0x78, 0x01, 0x40, 0x01, 0xC0, 0x01, 0xF8, 0x00, 0x78, 0x00, 0x00, 0x00, 0x00, 0x00,  // Code for char y
+        0x06, 0x88, 0x00, 0xC8, 0x00, 0xE8, 0x00, 0xB8, 0x00, 0x98, 0x00, 0x88, 0x00, 0x00, 0x00, 0x00, 0x00,  // Code for char z
+        0x04, 0x10, 0x00, 0x7C, 0x00, 0xEE, 0x00, 0x82, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,  // Code for char {
+        0x02, 0xFF, 0x01, 0xFF, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,  // Code for char |
+        0x04, 0x82, 0x00, 0xEE, 0x00, 0x7C, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,  // Code for char }
+        0x07, 0x10, 0x00, 0x08, 0x00, 0x08, 0x00, 0x10, 0x00, 0x20, 0x00, 0x20, 0x00, 0x10, 0x00, 0x00, 0x00,  // Code for char ~
+        0x02, 0x7E, 0x00, 0x7E, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00   // Code for char 
+        };
+
+
--- a/POKITTO_CORE/GBcompatibility.h	Sat Mar 24 13:17:22 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 1 //disable battery monitoring
-#define ENABLE_BACKLIGHT 1 //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
-
-
--- a/POKITTO_CORE/Localization.h	Sat Mar 24 13:17:22 2018 +0000
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,48 +0,0 @@
-/**************************************************************************/
-/*!
-    @file     Localization.h
-    @author   Hannu Viitala
-
-    @section LICENSE
-
-    Software License Agreement (BSD License)
-
-    Copyright (c) 2017, 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 LOCALIZATION_H
-#define LOCALIZATION_H
-
-//** Localized strings of the Pokitto SW  */
-
-// Texts
-#define STR_OK "OK"
-#define STR_CANCEL "CANCEL"
-
-#endif
-
-
--- a/POKITTO_CORE/Macros_LCD.h	Sat Mar 24 13:17:22 2018 +0000
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,105 +0,0 @@
-/**************************************************************************/
-/*!
-    @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	Sat Mar 24 13:17:22 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	Sat Mar 24 13:17:22 2018 +0000
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,60 +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 {
-/** This class controls the backlight of the Pokitto LCD display
- *
- */
-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	Sat Mar 24 13:17:22 2018 +0000
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,56 +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;
-
-void Battery::begin() {
-
-}
-
-void Battery::update() {
-    //ToDo - make a real function
-    level=0xFF; //full battery all the time
-}
-
-
--- a/POKITTO_CORE/PokittoBattery.h	Sat Mar 24 13:17:22 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	Sat Mar 24 13:17:22 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
-        } 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
-        } 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	Sat Mar 24 13:17:22 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	Sat Mar 24 13:17:22 2018 +0000
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,314 +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;
-    }
-
-    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	Sat Mar 24 13:17:22 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
-
-
--- a/POKITTO_CORE/PokittoCore.cpp	Sat Mar 24 13:17:22 2018 +0000
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,1296 +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 "PokittoCore.h"
-#include "Pokitto_settings.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;
-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=POK_LOADER_COUNTDOWN; 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;
-    if (text) display.directRectangle(0,0,50,50,COLOR_BLACK);
-    display.directcolor = COLOR_GREEN;
-    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<12) display.directcolor = COLOR_GRAY_80;
-    display.directBitmap(x,y,Pokitto_volumebar,1,1);
-    if (level<24) display.directcolor = COLOR_GRAY_80;
-    display.directBitmap(x+8,y,Pokitto_volumebar,1,1);
-    display.directBitmap(x+8,y-4,Pokitto_volumebar,1,1);
-    display.directcolor = COLOR_RED;
-    if (level<48) 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<96) {
-            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<160) {
-            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);
-    display.directcolor = oldcol;
-}
-
-
-#ifdef POK_SIM
-#define VINCMULT 1
-#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);
-    #endif
-    if (vol>VOLUME_HEADPHONE_MAX) sound.setMaxVol(VOLUME_SPEAKER_MAX);
-    else sound.setMaxVol(VOLUME_HEADPHONE_MAX);
-    for (uint8_t t=0;t<vol;t++) {
-            sound.setVolume(t);
-    }
-    volbar_visible=0;
-    while (core.isRunning() && dstate){
-        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 (sound.getVolume()-5<=VOLUME_HEADPHONE_MAX) 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 (sound.getVolume()-8>VOLUME_HEADPHONE_MAX) 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;}
-            else display.directcolor=COLOR_GREEN;
-            display.print(int(sound.getVolume()));
-            //display.print(int(tvol));
-            display.print("  ");
-            display.directcolor=COLOR_GREEN;
-            drawvolbar(14*8,14*8+4+2,sound.getVolume(),false);
-            //display.setCursor(1,10);
-            //display.print(vol);
-            dstate=2; break;
-        case 2:
-            buttons.pollButtons();
-            if (aBtn()) {dstate=0;while(aBtn()){buttons.pollButtons();};break;}
-            if (rightBtn()) {
-                    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);
-                    dstate=1; wipe=false;
-                    break;
-                    }
-            if (leftBtn()) {
-                    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);
-                    dstate=1; wipe=false;
-                    break;
-                    }
-            break;
-        }
-    }
-    #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();
-}
-
-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
-        showLogo();
-	#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
-    askLoader();
-    #endif
-
-	#ifndef DISABLE_SOUND_WARNING
-	//showWarning();
-	setVolLimit();
-	//sound.setVolume(sound.getVolume());//make sure we're at set volume before continue
-	sound.volumeUp();
-	#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();
-        sound.volumeUp();
-
-	//mute when B is held during start up or if battery is low
-	battery.update();
-	if(buttons.pressed(BTN_B) || (battery.level == 0)){
-		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
-		#ifdef PROJ_USE_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;
-        }
-        #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) {
-    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;
-
-    int8_t activeItem = 0;
-	int16_t currentY = 100;
-	int16_t targetY = 0, rowh = display.fontHeight + 2;
-	boolean exit = false;
-
-	char* txt;
-
-
-	while (isRunning()) {
-		if (update()) {
-            getFirstFile(ext);
-			if (buttons.pressed(BTN_A) || buttons.pressed(BTN_B) || buttons.pressed(BTN_C)) {
-				exit = true; //time to exit menu !
-				targetY = - display.fontHeight * 10 - 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;
-                if (currentY>targetY) currentY-=16;
-                if (currentY<targetY) currentY=targetY;
-				//targetY = -rowh * activeItem + (rowh+4); //center the menu on the active item
-			} else { //exit :
-			    if (currentY>targetY) currentY-=16;
-                if (currentY<targetY) currentY=targetY;
-				if ((currentY - targetY) <= 1)
-				{
-				    display.bgcolor=oldbg;
-				    display.color=oldfg;
-				    display.palette[0] = oldpal0;
-				    display.palette[1] = oldpal1;
-				    display.palette[2] = oldpal2;
-				    return selectedfile;
-				}
-
-			}
-			//draw a fancy menu
-			//currentY = 0;//(currentY + targetY) / 2 + 5;
-			display.cursorX = 0;
-			display.cursorY = currentY;
-			display.textWrap = false;
-			uint16_t fc,bc;
-			fc = display.color;
-            bc = display.bgcolor;
-            //getFirstFile(ext);
-			for (int i = 0; i<20; i++) {
-				display.invisiblecolor=255;
-				display.cursorY = currentY + rowh * i;
-				if (i==3) display.color=1;
-				if (i == activeItem){
-					display.cursorX = 3;
-
-                    //display.fillRoundRect(0, currentY + display.fontHeight * activeItem - 2, LCDWIDTH, (display.fontHeight+3), 3);
-                    display.color=2;
-                    display.fillRect(0, currentY + rowh * activeItem - 2, LCDWIDTH, (rowh));
-                    display.setColor(0,2);
-				} else display.setColor(1,0);
-				//display.println((char*)*(const unsigned int*)(items+i));
-				//display.println((int)i);
-                txt = getNextFile(ext);
-                if (txt) {
-                        display.println(txt);
-                        if (i == activeItem) {
-                            strcpy(selectedfile,txt);
-                        }
-                } else i--;
-                display.setColor(1,0);
-			} // draw menu loop
-		} // update
-	}
-	return 0;
-}
-
-char* Core::filemenu() {
-    return filemenu("");
-}
-
-int8_t Core::menu(const char* const* items, uint8_t length) {
-#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	Sat Mar 24 13:17:22 2018 +0000
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,268 +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;
-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
-private:
-  static uint8_t heldStates[];
-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	Sat Mar 24 13:17:22 2018 +0000
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,295 +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
-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();
-    res = disk_initialize();
-    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;
-}
-
-int 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 dirOpen() {
-    return pf_opendir(&dir,"");
-}
-
-int dirUp() {
-
-return 0;
-}
-
-#endif // POK_ENABLE_SD
-
-
-
-
--- a/POKITTO_CORE/PokittoDisk.h	Sat Mar 24 13:17:22 2018 +0000
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,112 +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
-
-#ifndef POK_SIM
-// real hardware disk driver
-#include "diskio.h"
-#include "pff.h"
-#include "connect.h"
-#include "mbed.h"
-extern BYTE res;
-extern FATFS fs;            /* File system object */
-extern FATDIR dir;            /* Directory object */
-extern FILINFO fno;        /* File information */
-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 int 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 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	Sat Mar 24 13:17:22 2018 +0000
+++ b/POKITTO_CORE/PokittoDisplay.cpp	Mon Apr 02 22:37:04 2018 +0000
@@ -78,6 +78,10 @@
 #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;
 
@@ -147,6 +151,18 @@
     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;
@@ -264,6 +280,9 @@
 
     // 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);
@@ -285,6 +304,14 @@
         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
@@ -301,37 +328,42 @@
     #endif // POK_SHOW_VOLUME
 
     /** draw FPS if visible **/
-    #ifdef PROJ_USE_FPS_COUNTER
+    #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;
+        // 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);
+        // 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);
+        // Restore state
+        enableDirectPrinting(temp);
+        directcolor = oldcol;
+        invisiblecolor =  oldinvisiblecolor;
+        directbgcolor = oldbgcol;
+        directtextrotated = olddirecttextrotated;
+        adjustCharStep = oldadjustCharStep;
+        setFont(font);
+
+        core.fps_counter_updated = false;
+    }
     #endif
 }
 
@@ -475,6 +507,16 @@
         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);
     }
@@ -602,6 +644,20 @@
         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];
@@ -685,6 +741,11 @@
 
 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++) {
@@ -1363,7 +1424,7 @@
     return;
     }
     /** 2 bpp mode */
-    if (m_colordepth<4) {
+    else if (m_colordepth==2) {
         if(clipH > 0) {
 
             // Clip
@@ -1409,6 +1470,35 @@
         }
         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;
@@ -1447,7 +1537,7 @@
                         uint8_t sourcepixel = *bitmap;
                         if ((sourcepixel&0x0F) != invisiblecolor) {
                             sourcepixel <<=4;
-                            uint8_t targetpixel = *scrptr & 0x0F;
+                            uint8_t targetpixel = *scrptr;// & 0x0F;
                             targetpixel |= sourcepixel;
                             *scrptr = targetpixel;
                         }
@@ -1458,7 +1548,6 @@
                 }
                 bitmap += xjump; // needed if x<0 clipping occurs
             } else { /** ODD pixel starting line **/
-                //for (scrx = x; scrx < w+x-xclip; scrx+=2) {
                 for (scrx = x; scrx < w+x-xclip; scrx+=2) {
                     uint8_t sourcepixel = *bitmap;
                     uint8_t targetpixel = *scrptr;
@@ -1472,24 +1561,49 @@
                     *scrptr = targetpixel;
                     bitmap++;
                 }
-                if (xclip){
-                    if (w&1) {
-                        /**last pixel is odd pixel due to clipping & odd width*/
-                        uint8_t sourcepixel = *bitmap;
-                        sourcepixel >>=4; //top nibble of sourcebyte from bitmap...
-                        if (sourcepixel != invisiblecolor) {
-                            uint8_t targetpixel = *scrptr & 0xF0; //...put into the low nibble of the target
-                            targetpixel |= sourcepixel;
-                            *scrptr = targetpixel;
-                        }
-                        //scrptr++;
-                    }
-                }
                 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)
@@ -2276,7 +2390,7 @@
     }
     m_sprites[index].w = w;
     m_sprites[index].h = h;
-    memcpy(m_sprites[index].palette, palette4x16bit, 4*2);
+    if( palette4x16bit ) memcpy(m_sprites[index].palette, palette4x16bit, 4*2);
 }
 
 /**
@@ -2304,6 +2418,9 @@
 
     // 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);
@@ -2340,6 +2457,99 @@
     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
+    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
+}*/
 
 /** Eof */
 
--- a/POKITTO_CORE/PokittoDisplay.h	Sat Mar 24 13:17:22 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	Sat Mar 24 13:17:22 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	Sat Mar 24 13:17:22 2018 +0000
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,68 +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[];
-
-#if POK_GAMEBUINO_SUPPORT > 0
-#define DEFAULT_FONT font3x5
-#else
-#define DEFAULT_FONT font5x7
-#endif // POK_GAMEBUINO_SUPPORT
-
-
-#endif
-
-
--- a/POKITTO_CORE/PokittoGlobs.h	Sat Mar 24 13:17:22 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	Sat Mar 24 13:17:22 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	Sat Mar 24 13:17:22 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	Sat Mar 24 13:17:22 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	Sat Mar 24 13:17:22 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	Sat Mar 24 13:17:22 2018 +0000
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,127 +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) {
-    uint16_t tpal[PALETTE_SIZE];
-    if (step == 0) return;
-    step = 0-step;
-    if (step>0) {
-        for (int i=step;i<PALETTE_SIZE;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[PALETTE_SIZE-step+i]; // overflow topmost values to bottom of new palette
-    } else {
-        for (int i=0;i<PALETTE_SIZE+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[PALETTE_SIZE+step+i]=palette[i];
-        }
-        // overflow bottom values to top of new palette
-    }
-    for (int i=0; i<PALETTE_SIZE;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	Sat Mar 24 13:17:22 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	Sat Mar 24 13:17:22 2018 +0000
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,915 +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;
-
-Pokitto::Core _soundc;
-
-uint8_t Sound::prescaler;
-uint16_t Sound::globalVolume;
-uint16_t Sound::volumeMax = VOLUME_HEADPHONE_MAX;
-
-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
-        uint8_t sbyte;
-    #else
-    uint8_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() {
-    if (globalVolume>VOLUME_HEADPHONE_MAX) setVolume(getVolume()+VOLUME_STEP*2);
-    else setVolume(getVolume()+VOLUME_STEP);
-}
-
-void Sound::volumeDown() {
-    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();
-        #endif
-        #ifndef POK_SIM
-        streamon=0;
-        #endif // POK_SIM
-    }
-    #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)
-	uint8_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/(float)255);
-            }
-        #endif
-            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;
-            }
-        #endif
-        soundbyte = output;
-    #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; // % (volumeMax+1);
-	#ifndef POK_SIM
-	volume = (volume / 2)-10;
-	if (volume<0) volume = 0;
-	#if POK_ENABLE_SOUND > 0
-	setHWvolume(volume);
-	#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,0);
-}
-
-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_OVERWRITE | 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
-}
-
-
--- a/POKITTO_CORE/PokittoSound.h	Sat Mar 24 13:17:22 2018 +0000
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,217 +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 (1<<GLOBVOL_SHIFT)
-    #define VOLUME_STARTUP ((1<<GLOBVOL_SHIFT)/2)
-#else
-    #define VOLUME_SPEAKER_MAX ((8<<GLOBVOL_SHIFT)-1)
-    #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.
- *
- */
-
-extern void audio_IRQ();  // audio interrupt
-
-class Sound {
-private:
-    static uint16_t volumeMax;
-public:
-	static void begin();
-
-	// Headphonemode
-	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();
-
-	// 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	Sat Mar 24 13:17:22 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	Sat Mar 24 13:17:22 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	Sat Mar 24 13:17:22 2018 +0000
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,128 +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];
-
-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; }
-
-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);
-}
-
-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	Sat Mar 24 13:17:22 2018 +0000
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,62 +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
-
-namespace Pokitto {
-
-extern uint8_t heldStates[];
-extern void initButtons();
-extern void pollButtons();
-
-
-} // namespace Pokitto
-
-#endif //HWBUTTONS
-
-
--- a/POKITTO_HW/HWLCD.cpp	Sat Mar 24 13:17:22 2018 +0000
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,1673 +0,0 @@
-/**************************************************************************/
-/*!
-    @file     HWLCD.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 "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 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
-
-using namespace Pokitto;
-
-uint16_t prevdata=0; // if data does not change, do not adjust LCD bus lines
-
-#if POK_BOARDREV == 2
-    pwmout_t backlightpwm;
-#endif
-
-
-/**************************************************************************/
-/*!
-    @brief  set up the 16-bit bus
-*/
-/**************************************************************************/
-
-static inline void setup_data_16(uint16_t data)
-{
-    uint32_t p2=0;
-
-    if (data != prevdata) {
-
-    prevdata=data;
-
-    /** D0...D16 = P2_3 ... P2_18 **/
-    p2 = data << 3;
-
-    //__disable_irq();    // Disable Interrupts
-    SET_MASK_P2;
-    LPC_GPIO_PORT->MPIN[2] = p2; // write bits to port
-    CLR_MASK_P2;
-    //__enable_irq();     // Enable Interrupts
-    }
-}
-
-
-/**************************************************************************/
-/*!
-    @brief  Write a command to the lcd, 16-bit bus
-*/
-/**************************************************************************/
-inline void write_command_16(uint16_t data)
-{
-   CLR_CS; // select lcd
-   CLR_CD; // clear CD = command
-   SET_RD; // RD high, do not read
-   setup_data_16(data); // function that inputs the data into the relevant bus lines
-   CLR_WR;  // WR low
-   SET_WR;  // WR low, then high = write strobe
-   SET_CS; // de-select lcd
-}
-
-/**************************************************************************/
-/*!
-    @brief  Write data to the lcd, 16-bit bus
-*/
-/**************************************************************************/
-inline void write_data_16(uint16_t data)
-{
-   CLR_CS;
-   SET_CD;
-   SET_RD;
-   setup_data_16(data);
-   CLR_WR;
-   SET_WR;
-   SET_CS;
-}
-
-/**************************************************************************/
-/*!
-    @brief  Point to a (x,y) location in the LCD DRAM
-*/
-/**************************************************************************/
-static inline void setDRAMptr(uint8_t xptr, uint8_t yoffset)
-{
-    write_command(0x20);  // Vertical DRAM Address
-    write_data(yoffset);
-    write_command(0x21);  // Horizontal DRAM Address
-    write_data(xptr);  //
-    write_command(0x22); // write data to DRAM
-    CLR_CS_SET_CD_RD_WR;
-}
-
-void Pokitto::initBacklight() {
-    #if POK_BOARDREV == 2
-    pwmout_init(&backlightpwm,POK_BACKLIGHT_PIN);
-    pwmout_period_us(&backlightpwm,5);
-    pwmout_write(&backlightpwm,POK_BACKLIGHT_INITIALVALUE);
-    #endif
-}
-
-void Pokitto::setBacklight(float value) {
-    if (value>0.999f) value = 0.999f;
-    pwmout_write(&backlightpwm,value);
-}
-
-void Pokitto::lcdInit() {
-   initBacklight();
-
-   SET_RESET;
-   wait_ms(10);
-   CLR_RESET;
-   wait_ms(10);
-   SET_RESET;
-   wait_ms(10);
-  //************* Start Initial Sequence **********//
-    write_command(0x01); // driver output control, this also affects direction
-    write_data(0x11C); // originally: 0x11C 100011100 SS,NL4,NL3,NL2
-                        // NL4...0 is the number of scan lines to drive the screen !!!
-                        // so 11100 is 1c = 220 lines, correct
-                        // test 1: 0x1C 11100 SS=0,NL4,NL3,NL2 -> no effect
-                        // test 2: 0x31C 1100011100 GS=1,SS=1,NL4,NL3,NL2 -> no effect
-                        // test 3: 0x51C 10100011100 SM=1,GS=0,SS=1,NL4,NL3,NL2 -> no effect
-                        // test 4: 0x71C SM=1,GS=1,SS=1,NL4,NL3,NL2
-                        // test 5: 0x
-                        // seems to have no effect... is this perhaps only for RGB mode ?
-
-    write_command(0x02); // LCD driving control
-    write_data(0x0100); // INV = 1
-
-    write_command(0x03); // Entry mode... lets try if this affects the direction
-    write_data(0x1030); // originally 0x1030 1000000110000 BGR,ID1,ID0
-                        // test 1: 0x1038 1000000111000 BGR,ID1,ID0,AM=1 ->drawing DRAM horizontally
-                        // test 4: am=1, id0=0, id1=0, 1000000001000,0x1008 -> same as above, but flipped on long
-                        // test 2: am=0, id0=0, 1000000100000, 0x1020 -> flipped on long axis
-                        // test 3: am=0, id1=0, 1000000010000, 0x1010 -> picture flowed over back to screen
-
-
-    write_command(0x08); // Display control 2
-    write_data(0x0808); // 100000001000 FP2,BP2
-
-    write_command(0x0C); // RGB display interface
-    write_data(0x0000); // all off
-
-    write_command(0x0F); // Frame marker position
-    write_data(0x0001); // OSC_EN
-
-    write_command(0x20);  // Horizontal DRAM Address
-    write_data(0x0000);  // 0
-
-    write_command(0x21);  // Vertical DRAM Address
-    write_data(0x0000); // 0
-
- //*************Power On sequence ****************//
-    write_command(0x10);
-    write_data(0x0000);
-
-    write_command(0x11);
-    write_data(0x1000);
-    wait_ms(10);
-//------------------------ Set GRAM area --------------------------------//
-    write_command(0x30); // Gate scan position
-    write_data(0x0000); // if GS=0, 00h=G1, else 00h=G220
-
-    write_command(0x31); // Vertical scroll control
-    write_data(0x00DB); // scroll start line 11011011 = 219
-
-    write_command(0x32); // Vertical scroll control
-    write_data(0x0000); // scroll end line 0
-
-    write_command(0x33); // Vertical scroll control
-    write_data(0x0000); // 0=vertical scroll disabled
-
-    write_command(0x34); // Partial screen driving control
-    write_data(0x00DB); // db = full screen (end)
-
-    write_command(0x35); // partial screen
-    write_data(0x0000); // 0 = start
-
-    write_command(0x36); // Horizontal and vertical RAM position
-    write_data(0x00AF); //end address 175
-
-    write_command(0x37);
-    write_data(0x0000); // start address 0
-
-    write_command(0x38);
-    write_data(0x00DB); //end address 219
-
-    write_command(0x39); // start address 0
-    write_data(0x0000);
-    wait_ms(10);
-    write_command(0xff); // start gamma register control
-    write_data(0x0003);
-
-// ----------- Adjust the Gamma  Curve ----------//
-    write_command(0x50);
-    write_data(0x0203);
-
-    write_command(0x051);
-    write_data(0x0A09);
-
-    write_command(0x52);
-    write_data(0x0005);
-
-    write_command(0x53);
-    write_data(0x1021);
-
-    write_command(0x54);
-    write_data(0x0602);
-
-    write_command(0x55);
-    write_data(0x0003);
-
-    write_command(0x56);
-    write_data(0x0703);
-
-    write_command(0x57);
-    write_data(0x0507);
-
-    write_command(0x58);
-    write_data(0x1021);
-
-    write_command(0x59);
-    write_data(0x0703);
-
-    write_command(0xB0);
-    write_data(0x2501);
-
-    write_command(0xFF);
-    write_data(0x0000);
-
-    write_command(0x07);
-    write_data(0x1017);
-    wait_ms(200);
-    write_command(0x22);
-
-    lcdClear();
-}
-
-void Pokitto::lcdSleep(void){
-   write_command(0xFF);
-   write_data(0x0000);
-
-   write_command(0x07);
-   write_data(0x0000);
-   wait_ms(50);
-   write_command(0x10);// Enter Standby mode
-   write_data(0x0003);
-   wait_ms(200);
-
-}
-
-void Pokitto::lcdWakeUp (void){
-
-   wait_ms(200);
-   write_command(0xFF);
-   write_data(0x0000);
-
-   write_command(0x10);// Exit Sleep/ Standby mode
-   write_data(0x0000);
-   wait_ms(50);
-   write_command(0x07);
-   write_data(0x0117);
-   wait_ms(200);
-  }
-
-void Pokitto::lcdFillSurface(uint16_t c) {
-    uint32_t i;
-    write_command(0x20);  // Horizontal DRAM Address
-    write_data(0x0000);  // 0
-    write_command(0x21);  // Vertical DRAM Address
-    write_data(0);
-    write_command(0x22); // write data to DRAM
-    setup_data_16(c);
-    CLR_CS_SET_CD_RD_WR;
-    for(i=0;i<220*176;i++)
-    {
-    CLR_WR;
-    SET_WR;
-    }
-}
-
-void Pokitto::lcdClear() {
-    uint32_t i;
-    write_command(0x20);  // Horizontal DRAM Address
-    write_data(0x0000);  // 0
-    write_command(0x21);  // Vertical DRAM Address
-    write_data(0);
-    write_command(0x22); // write data to DRAM
-    setup_data_16(0x0000);
-    CLR_CS_SET_CD_RD_WR;
-    for(i=0;i<220*176;i++)
-    {
-        CLR_WR;
-        SET_WR;
-    }
-}
-
-void Pokitto::lcdPixel(int16_t x, int16_t y, uint16_t color) {
-    if ((x < 0) || (x >= POK_LCD_W) || (y < 0) || (y >= POK_LCD_H))
-	return;
-	write_command(0x20);  // Horizontal DRAM Address
-    write_data(y);  // 0
-    write_command(0x21);  // Vertical DRAM Address
-    write_data(x);
-    write_command(0x22); // write data to DRAM
-    CLR_CS_SET_CD_RD_WR;
-    setup_data_16(color);
-    CLR_WR;SET_WR;
-}
-
-void Pokitto::setWindow(uint8_t x1, uint8_t y1, uint8_t x2, uint8_t y2) {
-	write_command(0x37); write_data(x1);
-	write_command(0x36); write_data(x2);
-	write_command(0x39); write_data(y1);
-	write_command(0x38); write_data(y2);
-	write_command(0x20); write_data(x1);
-	write_command(0x21); write_data(y1);
-}
-
-void Pokitto::lcdTile(int16_t x0, int16_t y0, int16_t x1, int16_t y1, uint16_t* gfx){
-	int width=x1-x0;
-	int height=y1-y0;
-	if (x0 > POK_LCD_W) return;
-	if (y0 > POK_LCD_H) return;
-	if (x0 < 0) x0=0;
-	if (y0 < 0) y0=0;
-
-	setWindow(y0, x0, y1-1, x1-1);
-    write_command(0x22);
-
-    for (int x=0; x<=width*height-1;x++) {
-        write_data(gfx[x]);
-    }
-	setWindow(0, 0, 175, 219);
-}
-
-
-void Pokitto::lcdRectangle(int16_t x0, int16_t y0, int16_t x1, int16_t y1, uint16_t color) {
-    	int16_t temp;
-	if (x0>x1) {temp=x0;x0=x1;x1=temp;}
-	if (y0>y1) {temp=y0;y0=y1;y1=temp;}
-	if (x0 > POK_LCD_W) return;
-	if (y0 > POK_LCD_H) return;
-    if (x1 > POK_LCD_W) x1=POK_LCD_W;
-	if (y1 > POK_LCD_H) y1=POK_LCD_W;
-	if (x0 < 0) x0=0;
-	if (y0 < 0) y0=0;
-
-	int16_t x,y;
-    for (x=x0; x<=x1;x++) {
-        write_command(0x20);  // Horizontal DRAM Address (=y on pokitto screen)
-        write_data(y0);
-        write_command(0x21);  // Vertical DRAM Address (=x on pokitto screen)
-        write_data(x);
-        write_command(0x22); // write data to DRAM
-
-        CLR_CS_SET_CD_RD_WR; // go to vram write mode
-
-
-        for (y=y0; y<y1;y++) {
-                setup_data_16(color); // setup the data (flat color = no change between pixels)
-                CLR_WR;SET_WR; //CLR_WR;SET_WR;//toggle writeline, pokitto screen writes a column up to down
-        }
-    }
-}
-
-/***
- * Update the screen buffer of 220x176 pixels, 4 colors to LCD.
- *
- * 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 scrbuf The screen buffer.
- * @param updRectX The update rect.
- * @param updRectY The update rect.
- * @param updRectW The update rect.
- * @param updRectH The update rect.
- * @param paletteptr The screen palette.
-*/
-void Pokitto::lcdRefreshMode1(uint8_t * scrbuf, uint8_t updRectX, uint8_t updRectY, uint8_t updRectW, uint8_t updRectH, uint16_t* paletteptr) {
-
-    uint16_t x,y,xptr;
-    uint16_t scanline[4][176]; // read 4 half-nibbles = 4 pixels at a time
-    uint8_t *d, yoffset=0;
-
-    // If not the full screen is updated, check the validity of the update rect.
-    if ( updRectX != 0 || updRectY != 0 ||updRectW != LCDWIDTH ||updRectH != LCDHEIGHT ) {
-        uint8_t org_screenx = updRectX;
-        updRectX &= 0xfc; // Make the value dividable by 4.
-        updRectW += org_screenx - updRectX;
-        updRectW = (updRectW + 3) & 0xfc; // Make the value dividable by 4, round up.
-
-        uint8_t org_screeny = updRectY;
-        updRectY &= 0xfc; // Make the value dividable by 4.
-        updRectH += org_screeny - updRectY;
-        updRectH = (updRectH + 7) & 0xf8; // Make the value dividable by 8 (because of loop unroll optimization), round up.
-    }
-
-
-    #ifdef PROJ_USE_FPS_COUNTER
-    xptr = 8;
-    setDRAMptr(8, 0);
-    #else
-    xptr = 0;
-    setDRAMptr(0, 0);
-    #endif
-
-    for (x=updRectX; x<updRectX+updRectW; x+=4) {
-        d = scrbuf+(x>>2);// point to beginning of line in data
-
-        /** find colours in one scanline **/
-        uint8_t s=0;
-        d += (updRectY * 220/4);
-        for (y=updRectY; y<updRectY+updRectH; y++) {
-            uint8_t tdata = *d;
-            uint8_t t4 = tdata & 0x03; tdata >>= 2;// lowest half-nibble
-            uint8_t t3 = tdata & 0x03; tdata >>= 2;// second lowest half-nibble
-            uint8_t t2 = tdata & 0x03; tdata >>= 2;// second highest half-nibble
-            uint8_t t = tdata & 0x03;// highest half-nibble
-
-            /** put nibble values in the scanlines **/
-            scanline[0][y] = paletteptr[t];
-            scanline[1][y] = paletteptr[t2];
-            scanline[2][y] = paletteptr[t3];
-            scanline[3][y] = paletteptr[t4];
-
-            d += 220/4; // jump to read byte directly below in screenbuffer
-        }
-
-        #ifdef PROJ_USE_FPS_COUNTER
-        if (x>=8 ) {
-        #else
-        {
-
-        #endif
-
-            // Draw 8 vertical pixels at a time for performance reasons
-            setDRAMptr(x, updRectY);
-            for (uint8_t s=updRectY; s<updRectY+updRectH;) {
-                setup_data_16(scanline[0][s++]);CLR_WR;SET_WR;
-                setup_data_16(scanline[0][s++]);CLR_WR;SET_WR;
-                setup_data_16(scanline[0][s++]);CLR_WR;SET_WR;
-                setup_data_16(scanline[0][s++]);CLR_WR;SET_WR;
-                setup_data_16(scanline[0][s++]);CLR_WR;SET_WR;
-                setup_data_16(scanline[0][s++]);CLR_WR;SET_WR;
-                setup_data_16(scanline[0][s++]);CLR_WR;SET_WR;
-                setup_data_16(scanline[0][s++]);CLR_WR;SET_WR;
-            }
-            setDRAMptr(x+1, updRectY);
-            for (uint8_t s=updRectY; s<updRectY+updRectH;) {
-                setup_data_16(scanline[1][s++]);CLR_WR;SET_WR;
-                setup_data_16(scanline[1][s++]);CLR_WR;SET_WR;
-                setup_data_16(scanline[1][s++]);CLR_WR;SET_WR;
-                setup_data_16(scanline[1][s++]);CLR_WR;SET_WR;
-                setup_data_16(scanline[1][s++]);CLR_WR;SET_WR;
-                setup_data_16(scanline[1][s++]);CLR_WR;SET_WR;
-                setup_data_16(scanline[1][s++]);CLR_WR;SET_WR;
-                setup_data_16(scanline[1][s++]);CLR_WR;SET_WR;
-            }
-            setDRAMptr(x+2, updRectY);
-            for (uint8_t s=updRectY; s<updRectY+updRectH;) {
-                setup_data_16(scanline[2][s++]);CLR_WR;SET_WR;
-                setup_data_16(scanline[2][s++]);CLR_WR;SET_WR;
-                setup_data_16(scanline[2][s++]);CLR_WR;SET_WR;
-                setup_data_16(scanline[2][s++]);CLR_WR;SET_WR;
-                setup_data_16(scanline[2][s++]);CLR_WR;SET_WR;
-                setup_data_16(scanline[2][s++]);CLR_WR;SET_WR;
-                setup_data_16(scanline[2][s++]);CLR_WR;SET_WR;
-                setup_data_16(scanline[2][s++]);CLR_WR;SET_WR;
-            }
-            setDRAMptr(x+3, updRectY);
-            for (uint8_t s=updRectY; s<updRectY+updRectH;) {
-                setup_data_16(scanline[3][s++]);CLR_WR;SET_WR;
-                setup_data_16(scanline[3][s++]);CLR_WR;SET_WR;
-                setup_data_16(scanline[3][s++]);CLR_WR;SET_WR;
-                setup_data_16(scanline[3][s++]);CLR_WR;SET_WR;
-                setup_data_16(scanline[3][s++]);CLR_WR;SET_WR;
-                setup_data_16(scanline[3][s++]);CLR_WR;SET_WR;
-                setup_data_16(scanline[3][s++]);CLR_WR;SET_WR;
-                setup_data_16(scanline[3][s++]);CLR_WR;SET_WR;
-            }
-        }
-    }
-
-    #ifdef POK_SIM
-    simulator.refreshDisplay();
-    #endif
-}
-
-// Copy sprite pixels to the scanline
-#define SPRITE_2BPP_INNER_LOOP(n)\
-\
-    /* If the sprite is enabled and contained in this vertical scanline, copy 4 pixels. */\
-    if (sprScanlineAddr[(n)] &&\
-        y >= sprites[(n)].y && y < sprites[(n)].y + sprites[(n)].h ) {\
-\
-        int16_t sprx = sprites[(n)].x;\
-        uint16_t s_data16b = 0;  /* sprite data, 2 bytes */\
-\
-        /* Get pixel block, 4 or 8 pixels horizontally. Use the predefined bitshift mode. */\
-        /* Note:it is cheapest to compare to 0 first. */\
-        if (sprScanlineBitshiftMode[(n)] == BITSHIFT_MODE_MIDDLE_BYTE) {\
-            s_data16b = *(sprScanlineAddr[(n)]);\
-            uint16_t leftByte = *(sprScanlineAddr[(n)]-1);\
-            s_data16b = (leftByte << 8) | s_data16b;\
-        }\
-        else if (sprScanlineBitshiftMode[(n)] == BITSHIFT_MODE_FIRST_BYTE) {\
-            s_data16b = *(sprScanlineAddr[(n)]);\
-        }\
-        else { /* BITSHIFT_MODE_LAST_BYTE */\
-            uint16_t leftByte = *(sprScanlineAddr[(n)]-1);\
-            s_data16b = (leftByte << 8) | s_data16b;\
-        }\
-\
-        /* Shift sprite pixels according to sprite x. After shifting we have only 4 pixels. */\
-        uint8_t shiftRight = (sprx&0x3) << 1;\
-        s_data16b = (s_data16b >> shiftRight);\
-\
-        /* Get individual pixels */\
-        uint8_t s_t4 = s_data16b & 0x03; s_data16b >>= 2; /* lowest half-nibble */\
-        uint8_t s_t3 = s_data16b & 0x03; s_data16b >>= 2; /* second lowest half-nibble */\
-        uint8_t s_t2 = s_data16b & 0x03; s_data16b >>= 2; /* second highest half-nibble */\
-        uint8_t s_t1 = s_data16b & 0x03;                  /* highest half-nibble */\
-\
-        /* Store pixels as 16-bit colors from the palette */\
-        if (s_t4 != transparentColor) p4 = sprites[(n)].palette[s_t4];\
-        if (s_t3 != transparentColor) p3 = sprites[(n)].palette[s_t3];\
-        if (s_t2 != transparentColor) p2 = sprites[(n)].palette[s_t2];\
-        if (s_t1 != transparentColor) p = sprites[(n)].palette[s_t1];\
-\
-        /* Advance scanline address */\
-        sprScanlineAddr[(n)] += (sprites[(n)].w >> 2);\
-    }
-
-// Loop unrolling macros
-#define UNROLLED_LOOP_1() SPRITE_2BPP_INNER_LOOP(0)
-#define UNROLLED_LOOP_2() UNROLLED_LOOP_1() SPRITE_2BPP_INNER_LOOP(1)
-#define UNROLLED_LOOP_3() UNROLLED_LOOP_2() SPRITE_2BPP_INNER_LOOP(2)
-#define UNROLLED_LOOP_4() UNROLLED_LOOP_3() SPRITE_2BPP_INNER_LOOP(3)
-#define UNROLLED_LOOP_5() UNROLLED_LOOP_4() SPRITE_2BPP_INNER_LOOP(4)
-#define UNROLLED_LOOP_6() UNROLLED_LOOP_5() SPRITE_2BPP_INNER_LOOP(5)
-#define UNROLLED_LOOP_7() UNROLLED_LOOP_6() SPRITE_2BPP_INNER_LOOP(6)
-#define UNROLLED_LOOP_8() UNROLLED_LOOP_7() SPRITE_2BPP_INNER_LOOP(7)
-#define UNROLLED_LOOP_9() UNROLLED_LOOP_8() SPRITE_2BPP_INNER_LOOP(8)
-#define UNROLLED_LOOP_10() UNROLLED_LOOP_9() SPRITE_2BPP_INNER_LOOP(9)
-#define UNROLLED_LOOP_11() UNROLLED_LOOP_10() SPRITE_2BPP_INNER_LOOP(10)
-#define UNROLLED_LOOP_12() UNROLLED_LOOP_11() SPRITE_2BPP_INNER_LOOP(11)
-#define UNROLLED_LOOP_13() UNROLLED_LOOP_12() SPRITE_2BPP_INNER_LOOP(12)
-#define UNROLLED_LOOP_14() UNROLLED_LOOP_13() SPRITE_2BPP_INNER_LOOP(13)
-#define UNROLLED_LOOP_15() UNROLLED_LOOP_14() SPRITE_2BPP_INNER_LOOP(14)
-#define UNROLLED_LOOP_16() UNROLLED_LOOP_15() SPRITE_2BPP_INNER_LOOP(15)
-#define UNROLLED_LOOP_N_(n) UNROLLED_LOOP_##n()
-#define UNROLLED_LOOP_N(n) UNROLLED_LOOP_N_(n)
-
-/***
- * Update the screen buffer of 220x176 pixels, 4 colors and free size 4 color sprites to LCD.
- *
- * 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.
- * If drawSpritesOnly=true, only sprites are fully updated to LCD. However, the dirty rect of the screen buffer is
- * drawn behind the sprite current and previous location.
- * Note: Sprite is enabled if sprite.bitmapData is not NULL. Also all enabled sprites must be at the beginning of
- * the sprites array. No gaps are allowed in the array.
- * @param scrbuf The screen buffer.
- * @param updRectX The update rect.
- * @param updRectY The update rect.
- * @param updRectW The update rect.
- * @param updRectH The update rect.
- * @param paletteptr The screen palette.
- * @param sprites The sprite array.
- * @param drawSpritesOnly True, if only sprites are drawn. False, if both sprites and the screen buffer are drawn.
-*/
-void Pokitto::lcdRefreshMode1Spr(
-    uint8_t * scrbuf, uint8_t updRectX, uint8_t updRectY, uint8_t updRectW, uint8_t updRectH, uint16_t* paletteptr,
-    SpriteInfo* sprites, bool drawSpritesOnly) {
-
-    // In direct mode draw only sprites and their dirty rects. Return now if there are no sprites
-    if (drawSpritesOnly && (sprites == NULL || sprites[0].bitmapData == NULL))
-        return;
-
-    uint16_t x,y;
-    uint16_t scanline[4][176]; // read 4 half-nibbles (= 4 pixels) at a time
-    const uint8_t transparentColor = 0;  // fixed palette index 0 for transparency
-
-    // If not the full screen is updated, check the validity of the update rect.
-    if ( updRectX != 0 || updRectY != 0 ||updRectW != LCDWIDTH ||updRectH != LCDHEIGHT ) {
-        uint8_t org_screenx = updRectX;
-        updRectX &= 0xfc; // Make the value dividable by 4.
-        updRectW += org_screenx - updRectX;
-        updRectW = (updRectW + 3) & 0xfc; // Make the value dividable by 4, round up.
-
-        uint8_t org_screeny = updRectY;
-        updRectY &= 0xfc; // Make the value dividable by 4.
-        updRectH += org_screeny - updRectY;
-        updRectH = (updRectH + 7) & 0xf8; // Make the value dividable by 8 (because of loop unroll optimization), round up.
-    }
-
-    // Calculate the current  amount of sprites
-    // Note: Sprites must be taken into use from index 0 upwards, because the first sprite with bitmapData==NULL is considered as the last sprite
-    uint8_t spriteCount = 0;
-    if (sprites != NULL)
-        for (;sprites[spriteCount].bitmapData != NULL && spriteCount < SPRITE_COUNT; spriteCount++);
-
-    // If drawing the screen buffer, set the start pos to LCD commands only here.
-    #ifdef PROJ_USE_FPS_COUNTER
-    if (!drawSpritesOnly) setDRAMptr(8, 0);
-    #else
-    if (!drawSpritesOnly) setDRAMptr(0, 0);
-    #endif
-
-    //*** GO THROUGH EACH VERTICAL GROUP OF 4 SCANLINES.***
-
-    for (x=0; x<LCDWIDTH; x+=4) {
-
-        uint8_t *screenBufScanlineAddr = scrbuf + (x>>2);// point to beginning of line in data
-
-        /*Prepare scanline start address for sprites that are visible in this vertical scanline. Sprite width cannot exceed the screen width*/
-        uint8_t *sprScanlineAddr[SPRITE_COUNT];  // Sprite start address for the scanline
-        uint8_t sprScanlineBitshiftMode[SPRITE_COUNT];  // Sprite bitshift mode for the scanline
-        const uint8_t BITSHIFT_MODE_MIDDLE_BYTE = 0;
-        const uint8_t BITSHIFT_MODE_FIRST_BYTE = 1;
-        const uint8_t BITSHIFT_MODE_LAST_BYTE = 2;
-        uint8_t scanlineMinY = 255; // Init to uninitialized value. Do not draw by default.
-        uint8_t scanlineMaxY = 0; // Init to uninitialized value. Do not draw by default.
-
-        //*** CALCULATE DIRTY RECTS AND RESOLVE WHICH SPRITES BELONG TO THIS SCANLINE GROUP ***
-
-        if (sprites != NULL) {
-
-            // Check all the sprites for this scanline. That is used for handling the given update rect
-            // Note that the last round is when (sprindex == spriteCount). That is used to add the screen buffer
-            // update rect to the dirty rect.
-            for (int sprindex = 0; sprindex <= spriteCount; sprindex++) {
-
-                int16_t sprx, spry, sprOldX, sprOldY;
-                uint8_t sprw, sprh;
-                bool isCurrentSpriteOutOfScreen = false;
-                bool isOldSpriteOutOfScreen = false;
-
-                if (sprindex < spriteCount) {
-
-                    sprx = sprites[sprindex].x;
-                    spry = sprites[sprindex].y;
-                    sprw = sprites[sprindex].w;
-                    sprh = sprites[sprindex].h;
-                    sprOldX = sprites[sprindex].oldx;
-                    sprOldY = sprites[sprindex].oldy;
-               }
-
-                // Handle the screen buffer update rect after all sprites
-                else if(!drawSpritesOnly){
-
-                    sprx = updRectX;
-                    spry = updRectY;
-                    sprw = updRectW;
-                    sprh = updRectH;
-                    sprOldX = updRectX;
-                    sprOldY = updRectY;
-                    isCurrentSpriteOutOfScreen = false;
-                    isOldSpriteOutOfScreen = false;
-                }
-
-                // Check for out-of-screen
-                if (sprx >= LCDWIDTH || spry >= LCDHEIGHT)
-                    isCurrentSpriteOutOfScreen = true;
-                if (sprOldX >= LCDWIDTH || sprOldY >= LCDHEIGHT)
-                    isOldSpriteOutOfScreen = true;
-
-                // Skip if current and old sprites are out-of-screen
-                if (isCurrentSpriteOutOfScreen && isOldSpriteOutOfScreen)
-                    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);
-                if (isCurrentSpriteOutOfScreen)
-                    sprDirtyXMax = sprOldX;
-                if (isOldSpriteOutOfScreen)
-                    sprDirtyXMax = sprx;
-
-                // Is current x inside the sprite combined dirty rect ?
-                int16_t sprDirtyXMaxEnd = sprDirtyXMax + sprw - 1 + 4; // Add 4 pixels to dirty rect width (needed?)
-                if (sprDirtyXMin <= x+3 && x <= sprDirtyXMaxEnd) {
-
-                    // *** COMBINE DIRTY RECTS FOR THIS SCANLINE GROUP ***
-
-                    // Dirty rect
-                    int16_t sprDirtyYMin = min(spry, sprOldY);
-                    sprDirtyYMin = max(sprDirtyYMin, 0);
-                    int16_t sprDirtyYMax = max(spry, sprOldY);
-                    if (isCurrentSpriteOutOfScreen)
-                        sprDirtyYMax = sprOldY;
-                    if (isOldSpriteOutOfScreen)
-                        sprDirtyYMax = spry;
-                    int16_t sprDirtyYMaxEnd = sprDirtyYMax + sprh - 1;
-                    sprDirtyYMaxEnd = min(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)
-                        scanlineMinY = sprDirtyYMin;
-                    if (sprDirtyYMaxEnd > scanlineMaxY)
-                        scanlineMaxY = sprDirtyYMaxEnd;
-
-                   // *** PREPARE SPRITE FOR DRAWING ***
-
-                   // Check if the sprite should be active for this vertical scanline group.
-                    if (sprindex < spriteCount &&  // not for update rect
-                        !isCurrentSpriteOutOfScreen && //out-of-screen
-                        sprx <= x+3 && x < sprx + sprw) { // note: cover group of 4 pixels of the scanline (x+3)
-
-                        // Find the byte number in the sprite data
-                        int16_t byteNum = ((x+3) - sprx)>>2;
-
-                        // Get the start addres of the spite data in this scanline.
-                        sprScanlineAddr[sprindex] = const_cast<uint8_t*>(sprites[sprindex].bitmapData + byteNum);
-
-                        // If the sprite goes over the top, it must be clipped from the top.
-                        if(spry < 0)
-                            sprScanlineAddr[sprindex] += (-spry) * (sprw >> 2);
-
-                        // Select the bitshift mode for the blit algorithm
-                        if (byteNum == 0)
-                            sprScanlineBitshiftMode[sprindex] = BITSHIFT_MODE_FIRST_BYTE;
-                        else if (byteNum >= (sprw >> 2))
-                            sprScanlineBitshiftMode[sprindex] = BITSHIFT_MODE_LAST_BYTE;
-                        else
-                            sprScanlineBitshiftMode[sprindex] = BITSHIFT_MODE_MIDDLE_BYTE;
-                    }
-                    else
-                        sprScanlineAddr[sprindex] = NULL;  // Deactive sprite for this scanline
-                }
-                else
-                    sprScanlineAddr[sprindex] = NULL;  // Deactive sprite for this scanline
-            }
-        }
-
-        // *** ADJUST THE SCANLINE GROUP HEIGHT ***
-
-        // The height must dividable by 8. That is needed because later we copy 8 pixels at a time to the LCD.
-        if (scanlineMaxY - scanlineMinY + 1 > 0) {
-            uint8_t scanlineH = scanlineMaxY - scanlineMinY + 1;
-            uint8_t addW = 8 - (scanlineH & 0x7);
-
-            // if height is not dividable by 8, make it be.
-            if (addW != 0) {
-                if (scanlineMinY > addW )
-                    scanlineMinY -= addW;
-                else if( scanlineMaxY + addW < updRectY+updRectH)
-                    scanlineMaxY += addW;
-                else {
-                    // Draw full height scanline
-                    scanlineMinY = updRectY;
-                    scanlineMaxY = updRectY+updRectH-1;
-                }
-            }
-        }
-
-        // *** COMBINE THE SCANLINE GROUP OF THE SCREEN BUFFER AND ALL SPRITES ***
-
-        // Find colours in this group of 4 scanlines
-        screenBufScanlineAddr += (scanlineMinY * 220/4);
-        for (y=scanlineMinY; y<=scanlineMaxY; y++)
-        {
-            // get the screen buffer data first
-            uint8_t tdata = *screenBufScanlineAddr;
-            uint8_t t4 = tdata & 0x03; tdata >>= 2;// lowest half-nibble
-            uint8_t t3 = tdata & 0x03; tdata >>= 2;// second lowest half-nibble
-            uint8_t t2 = tdata & 0x03; tdata >>= 2;// second highest half-nibble
-            uint8_t t = tdata & 0x03;// highest half-nibble
-
-            // Convert to 16-bit colors in palette
-            uint16_t p = paletteptr[t];
-            uint16_t p2 = paletteptr[t2];
-            uint16_t p3 = paletteptr[t3];
-            uint16_t p4 = paletteptr[t4];
-
-            #if 0
-            // Dirty rect visual test
-            p = COLOR_BLUE >> (Core::frameCount % 5);
-            p2 = COLOR_BLUE >> (Core::frameCount % 5);
-            p3 = COLOR_BLUE >> (Core::frameCount % 5);
-            p4 = COLOR_BLUE >> (Core::frameCount % 5);
-            #endif
-
-            // Add active sprite pixels
-            if (sprites != NULL) {
-
-                // Use loop unrolling for speed optimization
-                UNROLLED_LOOP_N(SPRITE_COUNT)
-            }
-
-            // put the result nibble values in the scanline
-            scanline[0][y] = p;
-            scanline[1][y] = p2;
-            scanline[2][y] = p3;
-            scanline[3][y] = p4;
-
-            screenBufScanlineAddr += 220>>2; // jump to read byte directly below in screenbuffer
-        }
-
-        // *** DRAW THE SCANLINE GROUP TO LCD
-
-#ifdef PROJ_USE_FPS_COUNTER
-        if (x>=8 && scanlineMaxY - scanlineMinY +1 > 0) {
-#else
-        if (scanlineMaxY - scanlineMinY +1 > 0) {
-#endif
-            // Draw 8 vertical pixels at a time for performance reasons
-
-            setDRAMptr(x, scanlineMinY);
-            for (uint8_t s=scanlineMinY;s<=scanlineMaxY;) {
-                setup_data_16(scanline[0][s++]);CLR_WR;SET_WR;
-                setup_data_16(scanline[0][s++]);CLR_WR;SET_WR;
-                setup_data_16(scanline[0][s++]);CLR_WR;SET_WR;
-                setup_data_16(scanline[0][s++]);CLR_WR;SET_WR;
-                setup_data_16(scanline[0][s++]);CLR_WR;SET_WR;
-                setup_data_16(scanline[0][s++]);CLR_WR;SET_WR;
-                setup_data_16(scanline[0][s++]);CLR_WR;SET_WR;
-                setup_data_16(scanline[0][s++]);CLR_WR;SET_WR;
-            }
-
-            setDRAMptr(x+1, scanlineMinY);
-            for (uint8_t s=scanlineMinY;s<=scanlineMaxY;) {
-                setup_data_16(scanline[1][s++]);CLR_WR;SET_WR;
-                setup_data_16(scanline[1][s++]);CLR_WR;SET_WR;
-                setup_data_16(scanline[1][s++]);CLR_WR;SET_WR;
-                setup_data_16(scanline[1][s++]);CLR_WR;SET_WR;
-                setup_data_16(scanline[1][s++]);CLR_WR;SET_WR;
-                setup_data_16(scanline[1][s++]);CLR_WR;SET_WR;
-                setup_data_16(scanline[1][s++]);CLR_WR;SET_WR;
-                setup_data_16(scanline[1][s++]);CLR_WR;SET_WR;
-            }
-
-            setDRAMptr(x+2, scanlineMinY);
-            for (uint8_t s=scanlineMinY;s<=scanlineMaxY;) {
-                setup_data_16(scanline[2][s++]);CLR_WR;SET_WR;
-                setup_data_16(scanline[2][s++]);CLR_WR;SET_WR;
-                setup_data_16(scanline[2][s++]);CLR_WR;SET_WR;
-                setup_data_16(scanline[2][s++]);CLR_WR;SET_WR;
-                setup_data_16(scanline[2][s++]);CLR_WR;SET_WR;
-                setup_data_16(scanline[2][s++]);CLR_WR;SET_WR;
-                setup_data_16(scanline[2][s++]);CLR_WR;SET_WR;
-                setup_data_16(scanline[2][s++]);CLR_WR;SET_WR;
-            }
-
-            setDRAMptr(x+3, scanlineMinY);
-            for (uint8_t s=scanlineMinY;s<=scanlineMaxY;) {
-                setup_data_16(scanline[3][s++]);CLR_WR;SET_WR;
-                setup_data_16(scanline[3][s++]);CLR_WR;SET_WR;
-                setup_data_16(scanline[3][s++]);CLR_WR;SET_WR;
-                setup_data_16(scanline[3][s++]);CLR_WR;SET_WR;
-                setup_data_16(scanline[3][s++]);CLR_WR;SET_WR;
-                setup_data_16(scanline[3][s++]);CLR_WR;SET_WR;
-                setup_data_16(scanline[3][s++]);CLR_WR;SET_WR;
-                setup_data_16(scanline[3][s++]);CLR_WR;SET_WR;
-            }
-        }
-    }
-
-    // Update old x and y for the sprites
-    if (sprites != NULL) {
-        for (int sprindex = 0; sprindex < spriteCount; sprindex++) {
-            sprites[sprindex].oldx = sprites[sprindex].x;
-            sprites[sprindex].oldy = sprites[sprindex].y;
-        }
-    }
-
-    #ifdef POK_SIM
-    simulator.refreshDisplay();
-    #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;
-
-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;
-
-for(x=0;x<110;x+=2)
-  {
-    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++)
-    {
-    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**/
-
-    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;
-    }
-    /** 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;
-    }
-
-    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;
-    }
-  }
-}
-
-void Pokitto::lcdRefreshMode3(uint8_t * scrbuf, uint16_t* paletteptr) {
-uint16_t x,y;
-uint16_t scanline[2][176]; // read two nibbles = pixels at a time
-uint8_t *d;
-
-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;
-
-for(x=0;x<220;x+=2)
-  {
-    d = scrbuf+(x>>1);// point to beginning of line in data
-    /** find colours in one scanline **/
-    uint8_t s=0;
-    for(y=0;y<176;y++)
-    {
-    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+=220/2; // jump to read byte directly below in screenbuffer
-    }
-    s=0;
-    /** draw scanlines **/
-    /** leftmost scanline**/
-
-    for (s=0;s<176;) {
-        setup_data_16(scanline[0][s++]);CLR_WR;SET_WR;
-        setup_data_16(scanline[0][s++]);CLR_WR;SET_WR;
-        setup_data_16(scanline[0][s++]);CLR_WR;SET_WR;
-        setup_data_16(scanline[0][s++]);CLR_WR;SET_WR;
-        setup_data_16(scanline[0][s++]);CLR_WR;SET_WR;
-        setup_data_16(scanline[0][s++]);CLR_WR;SET_WR;
-        setup_data_16(scanline[0][s++]);CLR_WR;SET_WR;
-        setup_data_16(scanline[0][s++]);CLR_WR;SET_WR;
-    }
-
-    /** rightmost scanline**/
-    //setDRAMptr(xptr++,yoffset);
-    for (s=0;s<176;) {
-        setup_data_16(scanline[1][s++]);CLR_WR;SET_WR;
-        setup_data_16(scanline[1][s++]);CLR_WR;SET_WR;
-        setup_data_16(scanline[1][s++]);CLR_WR;SET_WR;
-        setup_data_16(scanline[1][s++]);CLR_WR;SET_WR;
-        setup_data_16(scanline[1][s++]);CLR_WR;SET_WR;
-        setup_data_16(scanline[1][s++]);CLR_WR;SET_WR;
-        setup_data_16(scanline[1][s++]);CLR_WR;SET_WR;
-        setup_data_16(scanline[1][s++]);CLR_WR;SET_WR;
-    }
-  }
-}
-
-void Pokitto::lcdRefreshGB(uint8_t * scrbuf, uint16_t* paletteptr) {
-uint16_t x,y;
-uint16_t scanline[48];
-uint8_t * d;
-
-#if POK_STRETCH
-//uint16_t xptr = 8;
-#else
-//xptr = 26;
-#endif
-
-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;
-
-/** draw border **/
-    for (int s=0;s<5*176;) {
-            setup_data_16(COLOR_BLACK);CLR_WR;SET_WR;s++;
-    }
-
-for(x=0;x<84;x++)
-  {
-
-        d = scrbuf + x;// point to beginning of line in data
-
-        /** find colours in one scanline **/
-        uint8_t s=0;
-        for(y=0;y<6;y++)
-            {
-            uint8_t t = *d;
-            #if POK_COLORDEPTH > 1
-            uint8_t t2 = *(d+504);
-            #endif
-            #if POK_COLORDEPTH > 2
-            uint8_t t3 = *(d+504+504);
-            #endif
-            #if POK_COLORDEPTH > 3
-            uint8_t t4 = *(d+504+504+504);
-            #endif
-            uint8_t paletteindex = 0;
-
-            /** bit 1 **/
-            #if POK_COLORDEPTH == 1
-            paletteindex = (t & 0x1);
-            #elif POK_COLORDEPTH == 2
-            paletteindex = ((t & 0x1)) | ((t2 & 0x01)<<1);
-            #elif POK_COLORDEPTH == 3
-            paletteindex = (t & 0x1) | ((t2 & 0x1)<<1) | ((t3 & 0x1)<<2);
-            #elif POK_COLORDEPTH == 4
-            paletteindex = (t & 0x1) | ((t2 & 0x1)<<1) | ((t3 & 0x1)<<2) | ((t4 & 0x1)<<3);
-            #endif
-            scanline[s++] = paletteptr[paletteindex];
-
-            /** bit 2 **/
-            #if POK_COLORDEPTH == 1
-            paletteindex = (t & 0x2)>>1;
-            #elif POK_COLORDEPTH == 2
-            paletteindex = ((t & 0x2)>>1) | ((t2 & 0x02));
-            #elif POK_COLORDEPTH == 3
-            paletteindex = ((t & 0x2)>>1) | ((t2 & 0x2)) | ((t3 & 0x2)<<1);
-            #elif POK_COLORDEPTH == 4
-            paletteindex = ((t & 0x2)>>1) | ((t2 & 0x2)) | ((t3 & 0x2)<<1) | ((t4 & 0x2)<<2);
-            #endif
-            scanline[s++] = paletteptr[paletteindex];
-
-            /** bit 3 **/
-            #if POK_COLORDEPTH == 1
-            paletteindex = (t & 0x4)>>2;
-            #elif POK_COLORDEPTH == 2
-            paletteindex = ((t & 4)>>2) | ((t2 & 0x04)>>1);
-            #elif POK_COLORDEPTH == 3
-            paletteindex = ((t & 0x4)>>2) | ((t2 & 0x4)>>1) | (t3 & 0x4);
-            #elif POK_COLORDEPTH == 4
-            paletteindex = ((t & 0x4)>>2) | ((t2 & 0x4)>>1) | (t3 & 0x4) | ((t4 & 0x4)<<1);
-            #endif
-            scanline[s++] = paletteptr[paletteindex];
-
-            /** bit 4 **/
-            #if POK_COLORDEPTH == 1
-            paletteindex = (t & 0x8)>>3;
-            #elif POK_COLORDEPTH == 2
-            paletteindex = ((t & 0x8)>>3) | ((t2 & 0x08)>>2);
-            #elif POK_COLORDEPTH == 3
-            paletteindex = ((t & 0x8)>>3) | ((t2 & 0x8)>>2) | ((t3 & 0x8)>>1);
-            #elif POK_COLORDEPTH == 4
-            paletteindex = ((t & 0x8)>>3) | ((t2 & 0x8)>>2) | ((t3 & 0x8)>>1) | (t4 & 0x8);
-            #endif
-            scanline[s++] = paletteptr[paletteindex];
-
-            /** bit 5 **/
-            #if POK_COLORDEPTH == 1
-            paletteindex = (t & 0x10)>>4;
-            #elif POK_COLORDEPTH == 2
-            paletteindex = ((t & 0x10)>>4) | ((t2 & 0x10)>>3);
-            #elif POK_COLORDEPTH == 3
-            paletteindex = ((t & 0x10)>>4) | ((t2 & 0x10)>>3) | ((t3 & 0x10)>>2);
-            #elif POK_COLORDEPTH == 4
-            paletteindex = ((t & 0x10)>>4) | ((t2 & 0x10)>>3) | ((t3 & 0x10)>>2) | ((t4 & 0x10)>>1);
-            #endif
-            scanline[s++] = paletteptr[paletteindex];
-
-            /** bit 6 **/
-            #if POK_COLORDEPTH == 1
-            paletteindex = (t & 0x20)>>5;
-            #elif POK_COLORDEPTH == 2
-            paletteindex = ((t & 0x20)>>5) | ((t2 & 0x20)>>4);
-            #elif POK_COLORDEPTH == 3
-            paletteindex = ((t & 0x20)>>5) | ((t2 & 0x20)>>4) | ((t3 & 0x20)>>3);
-            #elif POK_COLORDEPTH == 4
-            paletteindex = ((t & 0x20)>>5) | ((t2 & 0x20)>>4) | ((t3 & 0x20)>>3) | ((t4 & 0x20)>>2);
-            #endif
-            scanline[s++] = paletteptr[paletteindex];
-
-            /** bit 7 **/
-            #if POK_COLORDEPTH == 1
-            paletteindex = (t & 0x40)>>6;
-            #elif POK_COLORDEPTH == 2
-            paletteindex = ((t & 0x40)>>6) | ((t2 & 0x40)>>5);
-            #elif POK_COLORDEPTH == 3
-            paletteindex = ((t & 0x40)>>6) | ((t2 & 0x40)>>5) | ((t3 & 0x40)>>4) ;
-            #elif POK_COLORDEPTH == 4
-            paletteindex = ((t & 0x40)>>6) | ((t2 & 0x40)>>5) | ((t3 & 0x40)>>4) | ((t4 & 0x40)>>3);
-            #endif
-            scanline[s++] = paletteptr[paletteindex];
-
-            /** bit 8 **/
-            #if POK_COLORDEPTH == 1
-            paletteindex = (t & 0x80)>>7;
-            #elif POK_COLORDEPTH == 2
-            paletteindex = ((t & 0x80)>>7) | ((t2 & 0x80)>>6);
-            #elif POK_COLORDEPTH == 3
-            paletteindex = ((t & 0x80)>>7) | ((t2 & 0x80)>>6) | ((t3 & 0x80)>>5);
-            #elif POK_COLORDEPTH == 4
-            paletteindex = ((t & 0x80)>>7) | ((t2 & 0x80)>>6) | ((t3 & 0x80)>>5) | ((t4 & 0x80)>>4);
-            #endif
-            scanline[s++] = paletteptr[paletteindex];
-
-            d+=84; // jump to byte directly below
-            }
-
-
-        /*write_command(0x20);  // Horizontal DRAM Address
-        write_data(0x10);  // 0
-        write_command(0x21);  // Vertical DRAM Address
-        write_data(xptr++);
-        write_command(0x22); // write data to DRAM
-        CLR_CS_SET_CD_RD_WR;*/
-        /** draw border **/
-        setup_data_16(COLOR_BLACK);CLR_WR;SET_WR;CLR_WR;SET_WR;CLR_WR;SET_WR;CLR_WR;SET_WR;CLR_WR;SET_WR;CLR_WR;SET_WR;CLR_WR;SET_WR;CLR_WR;SET_WR;CLR_WR;SET_WR;CLR_WR;SET_WR;        CLR_WR;SET_WR;CLR_WR;SET_WR;CLR_WR;SET_WR;CLR_WR;SET_WR;CLR_WR;SET_WR;CLR_WR;SET_WR;
-
-        s=0;
-
-        /** draw scanlines **/
-        for (s=0;s<48;) {
-            setup_data_16(scanline[s++]);CLR_WR;SET_WR;CLR_WR;SET_WR;CLR_WR;SET_WR;
-            setup_data_16(scanline[s++]);CLR_WR;SET_WR;CLR_WR;SET_WR;CLR_WR;SET_WR;
-            setup_data_16(scanline[s++]);CLR_WR;SET_WR;CLR_WR;SET_WR;CLR_WR;SET_WR;
-            setup_data_16(scanline[s++]);CLR_WR;SET_WR;CLR_WR;SET_WR;CLR_WR;SET_WR;
-            setup_data_16(scanline[s++]);CLR_WR;SET_WR;CLR_WR;SET_WR;CLR_WR;SET_WR;
-            setup_data_16(scanline[s++]);CLR_WR;SET_WR;CLR_WR;SET_WR;CLR_WR;SET_WR;
-            setup_data_16(scanline[s++]);CLR_WR;SET_WR;CLR_WR;SET_WR;CLR_WR;SET_WR;
-            setup_data_16(scanline[s++]);CLR_WR;SET_WR;CLR_WR;SET_WR;CLR_WR;SET_WR;
-        }
-        /** draw border **/
-        setup_data_16(COLOR_BLACK);CLR_WR;SET_WR;CLR_WR;SET_WR;CLR_WR;SET_WR;CLR_WR;SET_WR;CLR_WR;SET_WR;CLR_WR;SET_WR;CLR_WR;SET_WR;CLR_WR;SET_WR;CLR_WR;SET_WR;CLR_WR;SET_WR;        CLR_WR;SET_WR;CLR_WR;SET_WR;CLR_WR;SET_WR;CLR_WR;SET_WR;CLR_WR;SET_WR;CLR_WR;SET_WR;
-
-
-        /*write_command(0x20);  // Horizontal DRAM Address
-        write_data(0x10);  // 0
-        write_command(0x21);  // Vertical DRAM Address
-        write_data(xptr++);
-        write_command(0x22); // write data to DRAM
-        CLR_CS_SET_CD_RD_WR;*/
-        /** draw border **/
-        setup_data_16(COLOR_BLACK);CLR_WR;SET_WR;CLR_WR;SET_WR;CLR_WR;SET_WR;CLR_WR;SET_WR;CLR_WR;SET_WR;CLR_WR;SET_WR;CLR_WR;SET_WR;CLR_WR;SET_WR;CLR_WR;SET_WR;CLR_WR;SET_WR;        CLR_WR;SET_WR;CLR_WR;SET_WR;CLR_WR;SET_WR;CLR_WR;SET_WR;CLR_WR;SET_WR;CLR_WR;SET_WR;
-
-        for (s=0;s<48;) {
-            setup_data_16(scanline[s++]);CLR_WR;SET_WR;CLR_WR;SET_WR;CLR_WR;SET_WR;
-            setup_data_16(scanline[s++]);CLR_WR;SET_WR;CLR_WR;SET_WR;CLR_WR;SET_WR;
-            setup_data_16(scanline[s++]);CLR_WR;SET_WR;CLR_WR;SET_WR;CLR_WR;SET_WR;
-            setup_data_16(scanline[s++]);CLR_WR;SET_WR;CLR_WR;SET_WR;CLR_WR;SET_WR;
-            setup_data_16(scanline[s++]);CLR_WR;SET_WR;CLR_WR;SET_WR;CLR_WR;SET_WR;
-            setup_data_16(scanline[s++]);CLR_WR;SET_WR;CLR_WR;SET_WR;CLR_WR;SET_WR;
-            setup_data_16(scanline[s++]);CLR_WR;SET_WR;CLR_WR;SET_WR;CLR_WR;SET_WR;
-            setup_data_16(scanline[s++]);CLR_WR;SET_WR;CLR_WR;SET_WR;CLR_WR;SET_WR;
-        }
-
-        /** draw border **/
-        setup_data_16(COLOR_BLACK);CLR_WR;SET_WR;CLR_WR;SET_WR;CLR_WR;SET_WR;CLR_WR;SET_WR;CLR_WR;SET_WR;CLR_WR;SET_WR;CLR_WR;SET_WR;CLR_WR;SET_WR;CLR_WR;SET_WR;CLR_WR;SET_WR;        CLR_WR;SET_WR;CLR_WR;SET_WR;CLR_WR;SET_WR;CLR_WR;SET_WR;CLR_WR;SET_WR;CLR_WR;SET_WR;
-
-
-        #if POK_STRETCH
-        //if (x>16 && x<68)
-        if (x&2)// && x&2)
-        {
-            /*write_command(0x20);  // Horizontal DRAM Address
-            write_data(0x10);  // 0
-            write_command(0x21);  // Vertical DRAM Address
-            write_data(xptr++);
-            write_command(0x22); // write data to DRAM
-            CLR_CS_SET_CD_RD_WR;*/
-            /** draw border **/
-        setup_data_16(COLOR_BLACK);CLR_WR;SET_WR;CLR_WR;SET_WR;CLR_WR;SET_WR;CLR_WR;SET_WR;CLR_WR;SET_WR;CLR_WR;SET_WR;CLR_WR;SET_WR;CLR_WR;SET_WR;CLR_WR;SET_WR;CLR_WR;SET_WR;        CLR_WR;SET_WR;CLR_WR;SET_WR;CLR_WR;SET_WR;CLR_WR;SET_WR;CLR_WR;SET_WR;CLR_WR;SET_WR;
-
-
-            for (s=0;s<48;) {
-            setup_data_16(scanline[s++]);CLR_WR;SET_WR;CLR_WR;SET_WR;CLR_WR;SET_WR;
-            setup_data_16(scanline[s++]);CLR_WR;SET_WR;CLR_WR;SET_WR;CLR_WR;SET_WR;
-            setup_data_16(scanline[s++]);CLR_WR;SET_WR;CLR_WR;SET_WR;CLR_WR;SET_WR;
-            setup_data_16(scanline[s++]);CLR_WR;SET_WR;CLR_WR;SET_WR;CLR_WR;SET_WR;
-            setup_data_16(scanline[s++]);CLR_WR;SET_WR;CLR_WR;SET_WR;CLR_WR;SET_WR;
-            setup_data_16(scanline[s++]);CLR_WR;SET_WR;CLR_WR;SET_WR;CLR_WR;SET_WR;
-            setup_data_16(scanline[s++]);CLR_WR;SET_WR;CLR_WR;SET_WR;CLR_WR;SET_WR;
-            setup_data_16(scanline[s++]);CLR_WR;SET_WR;CLR_WR;SET_WR;CLR_WR;SET_WR;
-            }
-
-            /** draw border **/
-        setup_data_16(COLOR_BLACK);CLR_WR;SET_WR;CLR_WR;SET_WR;CLR_WR;SET_WR;CLR_WR;SET_WR;CLR_WR;SET_WR;CLR_WR;SET_WR;CLR_WR;SET_WR;CLR_WR;SET_WR;CLR_WR;SET_WR;CLR_WR;SET_WR;        CLR_WR;SET_WR;CLR_WR;SET_WR;CLR_WR;SET_WR;CLR_WR;SET_WR;CLR_WR;SET_WR;CLR_WR;SET_WR;
-
-        }
-        #endif
-    }
-    /** draw border **/
-    for (int s=0;s<5*176;) {
-            setup_data_16(COLOR_BLACK);CLR_WR;SET_WR;s++;
-    }
-}
-
-
-void Pokitto::lcdRefreshAB(uint8_t * scrbuf, uint16_t* paletteptr) {
-uint16_t x,y;
-uint16_t scanline[64];
-uint8_t *d;
-//lcdClear();
-#if POK_STRETCH
-uint16_t xptr = 14;
-uint8_t yoffset = 24;
-#else
-xptr = 0; //was 26
-#endif
-
-for(x=0;x<128;x++)
-  {
-    write_command(0x20);  // Horizontal DRAM Address
-    write_data(yoffset);  // 0
-    write_command(0x21);  // Vertical DRAM Address
-    write_data(xptr++);
-    write_command(0x22); // write data to DRAM
-    CLR_CS_SET_CD_RD_WR;
-    //setDRAMptr(xptr++,yoffset);
-
-        d = scrbuf + x;// point to beginning of line in data
-
-        /** find colours in one scanline **/
-        uint8_t s=0;
-        for(y=0;y<8;y++)
-            {
-            uint8_t t = *d;
-            #if POK_COLORDEPTH > 1
-            uint8_t t2 = *(d+AB_JUMP);
-            #endif // POK_COLORDEPTH
-            #if POK_COLORDEPTH > 2
-            uint8_t t3 = *(d+AB_JUMP+AB_JUMP);
-            #endif // POK_COLORDEPTH
-            #if POK_COLORDEPTH > 3
-            uint8_t t4 = *(d+AB_JUMP+AB_JUMP+AB_JUMP);
-            #endif // POK_COLORDEPTH
-            uint8_t paletteindex = 0;
-
-            /** bit 1 **/
-            #if POK_COLORDEPTH == 1
-            paletteindex = (t & 0x1);
-            #elif POK_COLORDEPTH == 2
-            paletteindex = ((t & 0x1)) | ((t2 & 0x01)<<1);
-            #elif POK_COLORDEPTH == 3
-            paletteindex = (t & 0x1) | ((t2 & 0x1)<<1) | ((t3 & 0x1)<<2);
-            #elif POK_COLORDEPTH == 4
-            paletteindex = (t & 0x1) | ((t2 & 0x1)<<1) | ((t3 & 0x1)<<2) | ((t4 & 0x1)<<3);
-            #endif
-            scanline[s++] = paletteptr[paletteindex];
-
-            /** bit 2 **/
-            #if POK_COLORDEPTH == 1
-            paletteindex = (t & 0x2)>>1;
-            #elif POK_COLORDEPTH == 2
-            paletteindex = ((t & 0x2)>>1) | ((t2 & 0x02));
-            #elif POK_COLORDEPTH == 3
-            paletteindex = ((t & 0x2)>>1) | ((t2 & 0x2)) | ((t3 & 0x2)<<1);
-            #elif POK_COLORDEPTH == 4
-            paletteindex = ((t & 0x2)>>1) | ((t2 & 0x2)) | ((t3 & 0x2)<<1) | ((t4 & 0x2)<<2);
-            #endif
-            scanline[s++] = paletteptr[paletteindex];
-
-            /** bit 3 **/
-            #if POK_COLORDEPTH == 1
-            paletteindex = (t & 0x4)>>2;
-            #elif POK_COLORDEPTH == 2
-            paletteindex = ((t & 4)>>2) | ((t2 & 0x04)>>1);
-            #elif POK_COLORDEPTH == 3
-            paletteindex = ((t & 0x4)>>2) | ((t2 & 0x4)>>1) | (t3 & 0x4);
-            #elif POK_COLORDEPTH == 4
-            paletteindex = ((t & 0x4)>>2) | ((t2 & 0x4)>>1) | (t3 & 0x4) | ((t4 & 0x4)<<1);
-            #endif
-            scanline[s++] = paletteptr[paletteindex];
-
-            /** bit 4 **/
-            #if POK_COLORDEPTH == 1
-            paletteindex = (t & 0x8)>>3;
-            #elif POK_COLORDEPTH == 2
-            paletteindex = ((t & 0x8)>>3) | ((t2 & 0x08)>>2);
-            #elif POK_COLORDEPTH == 3
-            paletteindex = ((t & 0x8)>>3) | ((t2 & 0x8)>>2) | ((t3 & 0x8)>>1);
-            #elif POK_COLORDEPTH == 4
-            paletteindex = ((t & 0x8)>>3) | ((t2 & 0x8)>>2) | ((t3 & 0x8)>>1) | (t4 & 0x8);
-            #endif
-            scanline[s++] = paletteptr[paletteindex];
-
-            /** bit 5 **/
-            #if POK_COLORDEPTH == 1
-            paletteindex = (t & 0x10)>>4;
-            #elif POK_COLORDEPTH == 2
-            paletteindex = ((t & 0x10)>>4) | ((t2 & 0x10)>>3);
-            #elif POK_COLORDEPTH == 3
-            paletteindex = ((t & 0x10)>>4) | ((t2 & 0x10)>>3) | ((t3 & 0x10)>>2);
-            #elif POK_COLORDEPTH == 4
-            paletteindex = ((t & 0x10)>>4) | ((t2 & 0x10)>>3) | ((t3 & 0x10)>>2) | ((t4 & 0x10)>>1);
-            #endif
-            scanline[s++] = paletteptr[paletteindex];
-
-            /** bit 6 **/
-            #if POK_COLORDEPTH == 1
-            paletteindex = (t & 0x20)>>5;
-            #elif POK_COLORDEPTH == 2
-            paletteindex = ((t & 0x20)>>5) | ((t2 & 0x20)>>4);
-            #elif POK_COLORDEPTH == 3
-            paletteindex = ((t & 0x20)>>5) | ((t2 & 0x20)>>4) | ((t3 & 0x20)>>3);
-            #elif POK_COLORDEPTH == 4
-            paletteindex = ((t & 0x20)>>5) | ((t2 & 0x20)>>4) | ((t3 & 0x20)>>3) | ((t4 & 0x20)>>2);
-            #endif
-            scanline[s++] = paletteptr[paletteindex];
-
-            /** bit 7 **/
-            #if POK_COLORDEPTH == 1
-            paletteindex = (t & 0x40)>>6;
-            #elif POK_COLORDEPTH == 2
-            paletteindex = ((t & 0x40)>>6) | ((t2 & 0x40)>>5);
-            #elif POK_COLORDEPTH == 3
-            paletteindex = ((t & 0x40)>>6) | ((t2 & 0x40)>>5) | ((t3 & 0x40)>>4) ;
-            #elif POK_COLORDEPTH == 4
-            paletteindex = ((t & 0x40)>>6) | ((t2 & 0x40)>>5) | ((t3 & 0x40)>>4) | ((t4 & 0x40)>>3);
-            #endif
-            scanline[s++] = paletteptr[paletteindex];
-
-            /** bit 8 **/
-            #if POK_COLORDEPTH == 1
-            paletteindex = (t & 0x80)>>7;
-            #elif POK_COLORDEPTH == 2
-            paletteindex = ((t & 0x80)>>7) | ((t2 & 0x80)>>6);
-            #elif POK_COLORDEPTH == 3
-            paletteindex = ((t & 0x80)>>7) | ((t2 & 0x80)>>6) | ((t3 & 0x80)>>5);
-            #elif POK_COLORDEPTH == 4
-            paletteindex = ((t & 0x80)>>7) | ((t2 & 0x80)>>6) | ((t3 & 0x80)>>5) | ((t4 & 0x80)>>4);
-            #endif
-            scanline[s++] = paletteptr[paletteindex];
-
-            d+=128; // jump to byte directly below
-            }
-
-        s=0;
-
-        /** draw scanlines **/
-        for (s=0;s<64;) {
-            setup_data_16(scanline[s++]);CLR_WR;SET_WR;CLR_WR;SET_WR;
-            setup_data_16(scanline[s++]);CLR_WR;SET_WR;CLR_WR;SET_WR;
-            setup_data_16(scanline[s++]);CLR_WR;SET_WR;CLR_WR;SET_WR;
-            setup_data_16(scanline[s++]);CLR_WR;SET_WR;CLR_WR;SET_WR;
-            setup_data_16(scanline[s++]);CLR_WR;SET_WR;CLR_WR;SET_WR;
-            setup_data_16(scanline[s++]);CLR_WR;SET_WR;CLR_WR;SET_WR;
-            setup_data_16(scanline[s++]);CLR_WR;SET_WR;CLR_WR;SET_WR;
-            setup_data_16(scanline[s++]);CLR_WR;SET_WR;CLR_WR;SET_WR;
-        }
-
-        #if POK_STRETCH
-        if (x&1) {
-        write_command(0x20);  // Horizontal DRAM Address
-        write_data(yoffset);  // 0
-        write_command(0x21);  // Vertical DRAM Address
-        write_data(xptr++);
-        write_command(0x22); // write data to DRAM
-        CLR_CS_SET_CD_RD_WR;
-        //setDRAMptr(xptr++,yoffset);
-
-        for (s=0;s<64;) {
-            setup_data_16(scanline[s++]);CLR_WR;SET_WR;CLR_WR;SET_WR;
-            setup_data_16(scanline[s++]);CLR_WR;SET_WR;CLR_WR;SET_WR;
-            setup_data_16(scanline[s++]);CLR_WR;SET_WR;CLR_WR;SET_WR;
-            setup_data_16(scanline[s++]);CLR_WR;SET_WR;CLR_WR;SET_WR;
-            setup_data_16(scanline[s++]);CLR_WR;SET_WR;CLR_WR;SET_WR;
-            setup_data_16(scanline[s++]);CLR_WR;SET_WR;CLR_WR;SET_WR;
-            setup_data_16(scanline[s++]);CLR_WR;SET_WR;CLR_WR;SET_WR;
-            setup_data_16(scanline[s++]);CLR_WR;SET_WR;CLR_WR;SET_WR;
-        }
-        }
-        #endif
-    }
-}
-
-void Pokitto::lcdRefreshModeGBC(uint8_t * scrbuf, uint16_t* paletteptr) {
-uint16_t x,y,xptr;
-uint16_t scanline[4][144]; // read 4 half-nibbles = 4 pixels at a time
-uint8_t *d, yoffset=0;
-
-xptr = 0;
-setDRAMptr(xptr,yoffset);
-
-
-for(x=0;x<160;x+=4)
-  {
-    d = scrbuf+(x>>2);// point to beginning of line in data
-    /** find colours in one scanline **/
-    uint8_t s=0;
-    for(y=0;y<144;y++)
-    {
-    uint8_t tdata = *d;
-    uint8_t t4 = tdata & 0x03; tdata >>= 2;// lowest half-nibble
-    uint8_t t3 = tdata & 0x03; tdata >>= 2;// second lowest half-nibble
-    uint8_t t2 = tdata & 0x03; tdata >>= 2;// second highest half-nibble
-    uint8_t t = tdata & 0x03;// highest half-nibble
-
-    /** put nibble values in the scanlines **/
-
-    scanline[0][s] = paletteptr[t];
-    scanline[1][s] = paletteptr[t2];
-    scanline[2][s] = paletteptr[t3];
-    scanline[3][s++] = paletteptr[t4];
-
-     d+=160/4; // jump to read byte directly below in screenbuffer
-    }
-
-    s=0;
-    /** draw scanlines **/
-    for (s=0;s<144;) {
-        setup_data_16(scanline[0][s++]);CLR_WR;SET_WR;
-        setup_data_16(scanline[0][s++]);CLR_WR;SET_WR;
-        setup_data_16(scanline[0][s++]);CLR_WR;SET_WR;
-        setup_data_16(scanline[0][s++]);CLR_WR;SET_WR;
-        setup_data_16(scanline[0][s++]);CLR_WR;SET_WR;
-        setup_data_16(scanline[0][s++]);CLR_WR;SET_WR;
-    }
-    setDRAMptr(++xptr,yoffset);
-    for (s=0;s<144;) {
-        setup_data_16(scanline[1][s++]);CLR_WR;SET_WR;
-        setup_data_16(scanline[1][s++]);CLR_WR;SET_WR;
-        setup_data_16(scanline[1][s++]);CLR_WR;SET_WR;
-        setup_data_16(scanline[1][s++]);CLR_WR;SET_WR;
-        setup_data_16(scanline[1][s++]);CLR_WR;SET_WR;
-        setup_data_16(scanline[1][s++]);CLR_WR;SET_WR;
-    }
-    setDRAMptr(++xptr,yoffset);
-    for (s=0;s<144;) {
-        setup_data_16(scanline[2][s++]);CLR_WR;SET_WR;
-        setup_data_16(scanline[2][s++]);CLR_WR;SET_WR;
-        setup_data_16(scanline[2][s++]);CLR_WR;SET_WR;
-        setup_data_16(scanline[2][s++]);CLR_WR;SET_WR;
-        setup_data_16(scanline[2][s++]);CLR_WR;SET_WR;
-        setup_data_16(scanline[2][s++]);CLR_WR;SET_WR;
-    }
-    setDRAMptr(++xptr,yoffset);
-    for (s=0;s<144;) {
-        setup_data_16(scanline[3][s++]);CLR_WR;SET_WR;
-        setup_data_16(scanline[3][s++]);CLR_WR;SET_WR;
-        setup_data_16(scanline[3][s++]);CLR_WR;SET_WR;
-        setup_data_16(scanline[3][s++]);CLR_WR;SET_WR;
-        setup_data_16(scanline[3][s++]);CLR_WR;SET_WR;
-        setup_data_16(scanline[3][s++]);CLR_WR;SET_WR;
-    }
-    setDRAMptr(++xptr,yoffset);
-  }
-}
-
-
-void Pokitto::lcdRefreshT1(uint8_t* tilebuf, uint8_t* tilecolorbuf, uint8_t* tileset, uint16_t* paletteptr) {
-#ifdef POK_TILEMODE
-uint16_t x,y,data,xptr;
-uint16_t scanline[176];
-uint8_t yoffset=0, tilebyte, tileindex, tilex=0, tiley=0,xcount;
-
-
-if (!tileset) return;
-
-#if LCDWIDTH < POK_LCD_W
-xptr = (POK_LCD_W-LCDWIDTH)/2;
-#else
-xptr = 0;
-#endif
-#if LCDHEIGHT < POK_LCD_H
-yoffset = (POK_LCD_H-LCDHEIGHT)/2;
-#else
-yoffset = 0;
-#endif
-
-for(x=0, xcount=0 ;x<LCDWIDTH;x++,xcount++)  // loop through vertical columns
-  {
-    setDRAMptr(xptr++,yoffset); //point to VRAM
-
-        /** find colours in one scanline **/
-        uint8_t s=0, tiley=0;
-        //tileindex = tilebuf[tilex*POK_TILES_Y];
-        if (xcount==POK_TILE_W) {
-            tilex++;
-            xcount=0;
-        }
-
-        for(y=0;y<LCDHEIGHT;)
-        {
-            uint8_t tileval = tilebuf[tilex+tiley*POK_TILES_X]; //get tile number
-            uint16_t index = tileval*POK_TILE_W+xcount;
-            uint8_t tilebyte = tileset[index]; //get bitmap data
-            for (uint8_t ycount=0, bitcount=0; ycount<POK_TILE_H; ycount++, y++, bitcount++) {
-                if (bitcount==8) {
-                    bitcount=0;
-                    index += 176; //jump to byte below in the tileset bitmap
-                    tilebyte = tileset[index]; //get bitmap data
-                }
-                //tilebyte = tile[(tileindex>>4)+*POK_TILE_W]; //tilemaps are 16x16
-                //uint8_t paletteindex = ((tilebyte>>(bitcount&0x7)) & 0x1);
-                if (!tileval) scanline[s++] = COLOR_MAGENTA*((tilebyte>>bitcount)&0x1);//paletteptr[paletteindex];
-                else scanline[s++] = paletteptr[((tilebyte>>bitcount)&0x1)*tileval];//paletteptr[paletteindex];
-            }
-            tiley++; //move to next tile
-        }
-        s=0;
-
-        /** draw scanlines **/
-        for (s=0;s<LCDHEIGHT;) {
-            setup_data_16(scanline[s++]);CLR_WR;SET_WR;
-        }
-    }
-    #endif
-}
-
-
-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;
-
-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;
-    }
-  }
-
-}
-
-
-
-
-void Pokitto::blitWord(uint16_t c) {
-    setup_data_16(c);CLR_WR;SET_WR;
-}
-
-
--- a/POKITTO_HW/HWLCD.h	Sat Mar 24 13:17:22 2018 +0000
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,211 +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 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 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);
-
-/** 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 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	Sat Mar 24 13:17:22 2018 +0000
+++ b/POKITTO_HW/HWSound.cpp	Mon Apr 02 22:37:04 2018 +0000
@@ -44,15 +44,16 @@
 #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 > 0
+#if POK_ENABLE_SOUND
 pwmout_t* obj = &audiopwm;
 #endif
 #endif
@@ -78,7 +79,11 @@
 /** stream output and status */
 uint8_t Pokitto::streambyte,Pokitto::streamon;
 
-uint8_t soundbuf[256], soundbufindex=0, Pokitto::HWvolume=0;
+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;
@@ -121,6 +126,7 @@
  */
 
 uint32_t p=0;
+uint8_t pixx=0, pixy=0;
 
 extern "C" void TIMER32_0_IRQHandler(void)
 {
@@ -132,7 +138,11 @@
     	Pokitto::audio_IRQ();
     	#else
     	/** NOT GAMEBUINO SOUND **/
-		pokSoundIRQ();
+            #if POK_SOUND_BUFFERED
+                pokSoundBufferedIRQ();
+            #else
+                pokSoundIRQ();
+            #endif
 		#endif
 	}
 }
@@ -194,7 +204,7 @@
     value >>= 1;
     if (value & 1) SET_DAC7 else CLR_DAC7;
     #else
-    //uint32_t val;
+
     //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 */
@@ -204,13 +214,17 @@
     //LPC_GPIO_PORT->MPIN[1] = val; // write bits to port
     //CLR_MASK_DAC;
     /* fixed here */
-    /*val=value;
+    #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; */
+    CLR_MASK_DAC_HI;
+    #else
     if (value & 1) SET_DAC0 else CLR_DAC0;
     value >>= 1;
     if (value & 1) SET_DAC1 else CLR_DAC1;
@@ -226,6 +240,7 @@
     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
@@ -233,11 +248,14 @@
 
 /** SOUND INIT **/
 void Pokitto::soundInit() {
+    #if POK_ENABLE_SOUND > 0
     uint32_t timerFreq;
-    #if POK_ENABLE_SOUND
+    #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 **/
@@ -287,7 +305,14 @@
     #if POK_BOARDREV == 2
         initHWvolumecontrol();
     #endif
-	#endif //POK_ENABLE_SOUND
+
+    #if POK_ENABLE_SYNTH
+        emptyOscillators();
+    #endif
+
+
+    #endif // POK_ENABLE_SOUND
+
 }
 
 
@@ -314,20 +339,33 @@
 
 
 
-void pokSoundBufferedIRQ() {
-           uint8_t output = soundbuf[soundbufindex++];
+inline void pokSoundBufferedIRQ() {
+           uint8_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;
+           //uint32_t t_on = (uint32_t)(((obj->pwm->MATCHREL0)*output)>>8); //cut out float
+           //obj->pwm->MATCHREL1 = t_on;
+           dac_write(output);
+
+           //setDRAMpoint(pixx, pixy);
 }
 
-void pokSoundIRQ() {
+inline void pokSoundIRQ() {
     #if POK_ENABLE_SOUND > 0
+    //#define TICKY 0xFFFF //160
+    //#define INCY 409
     uint8_t output=0;
     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
-    pwmout_t* obj = &audiopwm;
+        #if POK_USE_PWM
+        pwmout_t* obj = &audiopwm;
+        #endif
     #endif
     #if POK_STREAMING_MUSIC > 0
         #if POK_STREAMFREQ_HALVE
@@ -361,7 +399,7 @@
         /** if song is being played from sd **/
         if (playing) {
                 notetick++;
-                updatePlaybackSD(playerpos&7);
+                updatePlayback();
         }
         /** oscillators update **/
         osc1.count += osc1.cinc + (osc1.pitchbend >> 4); // counts to 65535 and overflows to zero WAS 8 !
@@ -387,35 +425,41 @@
                 #if POK_STREAM_TO_DAC > 0
                     /** stream goes to DAC */
                     #if POK_USE_DAC > 0
-                    if (streamstep) dac_write((uint8_t)streambyte); // duty cycle
+                    dac_write(streambyte>>__shw.headPhoneLevel); // duty cycle
                     #endif // POK_USE_DAC
                 #else
                     /** stream goes to PWM */
                     if (streamstep) {
                             //pwmout_write(&audiopwm,(float)streambyte/(float)255);
-                            uint32_t t_on = (uint32_t)(((obj->pwm->MATCHREL0)*streambyte)>>8); //cut out float
+                            #if POK_USE_PWM
+                            uint32_t t_on = (uint32_t)((((obj->pwm->MATCHREL0)*streambyte)>>8)>>__shw.headPhoneLevel); //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);
-            uint32_t t_on = (uint32_t)(((obj->pwm->MATCHREL0)*output)>>8); //cut out float
-            obj->pwm->MATCHREL1 = t_on;
-            #else
-            dac_write((uint8_t)output);
-            #endif // decide where synth is output
+                /** synth goes to PWM */
+                //pwmout_write(&audiopwm,(float)output/(float)255);
+                #if POK_USE_PWM
+                    uint32_t t_on = (uint32_t)((((obj->pwm->MATCHREL0)*output)>>8)>>__shw.headPhoneLevel); //cut out float
+                    obj->pwm->MATCHREL1 = t_on;
+                #endif
+            #else // POK_STREAMING_MUSIC
+                dac_write((uint8_t)output>>__shw.headPhoneLevel); // 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
+#endif //POK_ENABLE_SOUND
 }
 
 
 void Pokitto::updateSDAudioStream() {
+    #ifndef NOPETITFATFS
     if (streamPaused()) return;
 
     #if POK_STREAMING_MUSIC > 0
@@ -441,6 +485,7 @@
         #endif
     }
     #endif
+    #endif // NOPETITFATFS
 }
 
 
--- a/POKITTO_HW/HWSound.h	Sat Mar 24 13:17:22 2018 +0000
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,163 +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
-
-#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	Sat Mar 24 13:17:22 2018 +0000
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,82 +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
-    SysTick->LOAD = 480000-1;
-    #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	Sat Mar 24 13:17:22 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 0x1000; } // length for pokitto is 4kB
-
-    //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	Sat Mar 24 13:17:22 2018 +0000
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,87 +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() {
-    //TODO: hook random seed to battery level
-}
-
-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	Sat Mar 24 13:17:22 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	Sat Mar 24 13:17:22 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	Sat Mar 24 13:17:22 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	Sat Mar 24 13:17:22 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	Sat Mar 24 13:17:22 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	Sat Mar 24 13:17:22 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	Sat Mar 24 13:17:22 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	Sat Mar 24 13:17:22 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	Sat Mar 24 13:17:22 2018 +0000
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,730 +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) {
-        if (address == sector * 0x1000) firstpage = true;
-    } else {
-        if (address == (sector-24)*0x4000 + 0x18000) firstpage = true;
-    }
-
-	/* 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() {
-    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;
-}
-
-
-
-
-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	Sat Mar 24 13:17:22 2018 +0000
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,79 +0,0 @@
-#ifndef IAP_H_INCLUDED
-#define IAP_H_INCLUDED
-
-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 */
-
-
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/POKITTO_HW/loader.h	Mon Apr 02 22:37:04 2018 +0000
@@ -0,0 +1,2343 @@
+#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	Sat Mar 24 13:17:22 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	Sat Mar 24 13:17:22 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	Sat Mar 24 13:17:22 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	Sat Mar 24 13:17:22 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	Sat Mar 24 13:17:22 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/Pokitto.h	Sat Mar 24 13:17:22 2018 +0000
+++ b/Pokitto.h	Mon Apr 02 22:37:04 2018 +0000
@@ -67,6 +67,8 @@
     #include "Synth.h"
     #endif
     extern uint8_t soundbuf[];
+    extern uint16_t soundbufindex;
+    extern uint8_t* soundbufptr;
     #ifndef POK_SIM
         #include "HWSound.h"
     #endif // if not POK_SIM
--- a/Pokitto_settings.h	Sat Mar 24 13:17:22 2018 +0000
+++ b/Pokitto_settings.h	Mon Apr 02 22:37:04 2018 +0000
@@ -64,6 +64,12 @@
     #define POK_ENABLE_SOUND PROJ_ENABLE_SOUND
 #endif
 
+#ifndef PROJ_SOUND_BUFFERED
+    #define POK_SOUND_BUFFERED 0
+#else
+    #define POK_SOUND_BUFFERED PROJ_SOUND_BUFFERED
+#endif
+
 #ifndef PROJ_GBSOUND
     #if POK_ENABLE_SOUND > 0
         #define POK_GBSOUND 0
@@ -74,9 +80,7 @@
 
 
 #ifndef PROJ_STREAMING_MUSIC
-    #if POK_ENABLE_SOUND > 0
-        #define POK_STREAMING_MUSIC 1 // Define true to stream music from SD
-    #endif
+        #define POK_STREAMING_MUSIC 0 // Define true to stream music from SD
 #else
     #define POK_STREAMING_MUSIC PROJ_STREAMING_MUSIC
 #endif // PROJ_STREAMING_MUSIC
@@ -193,14 +197,6 @@
 #endif // PROJ_GAMEBUINO
 #endif // PROJ_TILEDMODE
 
-#if PROJ_MODE13 > 0
-    #define PROJ_SCREENMODE MODE13
-    #define POK_COLORDEPTH 8
-    #define POK_STRETCH 0
-    #define POK_FPS 30
-    #define POK_COLORDEPTH 8
-#endif
-
 
 /** SCREEN MODES TABLE -- DO NOT CHANGE THESE **/
 
@@ -233,11 +229,16 @@
 #define BUFSIZE_MODE_12              4176 // 72 x 58
 #define MODE13                      13
 #define BUFSIZE_MODE13              9680 // 110*88
+#define MODE14                      14
+#define BUFSIZE_MODE14              14520
 // Tiled modes
 #define MODE_TILED_1BIT             1001
 #define MODE_TILED_8BIT             1002
 
 
+    #define R_MASK  0xF800
+    #define G_MASK  0x7E0
+    #define B_MASK  0x1F
 
 /** SCREENMODE - USE THIS SELECTION FOR YOUR PROJECT **/
 
@@ -278,6 +279,34 @@
 #endif
 #endif // POK_TILEDMODE
 
+#if PROJ_MODE13 > 0
+    #undef POK_SCREENMODE //get rid of warnings
+    #undef POK_COLORDEPTH
+    #undef POK_FPS
+    #define POK_SCREENMODE MODE13
+    #define POK_COLORDEPTH 8
+    #define POK_STRETCH 0
+    #define POK_FPS 30
+#endif
+
+#if PROJ_MODE14 > 0
+    #undef POK_SCREENMODE //get rid of warnings
+    #undef POK_COLORDEPTH
+    #undef POK_FPS
+    #define POK_SCREENMODE MODE14
+    #define POK_COLORDEPTH 3
+    #define POK_STRETCH 0
+    #define POK_FPS 30
+#endif
+#if PROJ_MODE15 > 0
+    #undef POK_SCREENMODE //get rid of warnings
+    #undef POK_COLORDEPTH
+    #undef POK_FPS
+    #define POK_SCREENMODE MODE15
+    #define POK_COLORDEPTH 4
+    #define POK_STRETCH 0
+    #define POK_FPS 30
+#endif
 /* DEFINE SCREENMODE AS THE MAXIMUM SCREEN SIZE NEEDED BY YOUR APP ... SEE SIZES LISTED ABOVE */
 
 /** AUTOMATIC COLOR DEPTH SETTING - DO NOT CHANGE **/
@@ -345,6 +374,16 @@
     #define LCDWIDTH 110
     #define LCDHEIGHT 88
     #define POK_BITFRAME 110*88
+#elif POK_SCREENMODE == MODE14
+    #define POK_SCREENBUFFERSIZE 14520
+    #define LCDWIDTH 220
+    #define LCDHEIGHT 176
+    #define POK_BITFRAME 4840
+#elif POK_SCREENMODE == MODE15
+    #define POK_SCREENBUFFERSIZE 0x4BA0
+    #define LCDWIDTH 220
+    #define LCDHEIGHT 176
+
 #else
     #define POK_SCREENBUFFERSIZE 0
 #endif // POK_SCREENMODE
@@ -352,6 +391,10 @@
 #ifndef POK_STRETCH
     #define POK_STRETCH 1 // Stretch Gamebuino display
 #endif
+
+#ifdef PROJ_FPS
+#define POK_FPS PROJ_FPS
+#endif
 #ifndef POK_FPS
     #define POK_FPS 20
 #endif
@@ -363,14 +406,34 @@
 /** AUDIO **/
 #define POK_AUD_PIN P2_19
 #define POK_AUD_PWM_US 15 //31 //Default value 31
-#define POK_AUD_FREQ 22050 //Valid values: 8000, 11025, 16000, 22050 // audio update frequency in Hz
-//#define POK_CINC_MULTIPLIER 0 // multiplies synth cycle table
+#ifndef PROJ_AUD_FREQ
+    #define POK_AUD_FREQ 22050 //Valid values: 8000, 11025, 16000, 22050 // audio update frequency in Hz
+#else
+    #define POK_AUD_FREQ PROJ_AUD_FREQ
+#endif
+
+
+#define POK_USE_EXT 0 // if extension port is in use or not
+
 #define POK_STREAMFREQ_HALVE  0  // if true, stream update freq is half audio freq
 #define POK_STREAM_LOOP 1 //master switch
 
-#define POK_USE_DAC 1 // is DAC in use in this project
-#define POK_USE_EXT 0 // if extension port is in use or not
-#define POK_STREAM_TO_DAC 1  // 1 = stream from SD to DAC, synthesizer to PWM,  0 = opposite
+#ifndef PROJ_USE_DAC
+    #define POK_USE_DAC 1 // is DAC in use in this project
+#else
+    #define POK_USE_DAC PROJ_USE_DAC
+#endif
+#ifndef PROJ_USE_PWM
+    #define POK_USE_PWM 1 // is PWM for audio used in this project
+#else
+    #define POK_USE_PWM PROJ_USE_PWM
+#endif
+
+#ifndef PROJ_STREAM_TO_DAC
+    #define POK_STREAM_TO_DAC 1  // 1 = stream from SD to DAC, synthesizer to PWM,  0 = opposite
+#else
+    #define POK_STREAM_TO_DAC PROJ_STREAM_TO_DAC
+#endif
 
 
 #define POK_BACKLIGHT_PIN P2_2
@@ -403,7 +466,22 @@
 #endif
 
 /** SYSTEM SETTINGS ADDRESSES IN EEPROM **/
-#define EESETTINGS_VOL 4000
+#define EESETTINGS_FILENAME         3980 // 0xF8C 20bytes last filename requested
+#define EESETTINGS_VOL              4000 // 0xFA0 Volume
+#define EESETTINGS_DEFAULTVOL       4001 // 0xFA1 Default volume
+#define EESETTINGS_LOADERWAIT       4002 //	0xFA2 Loader wait in sec
+#define EESETTINGS_VOLWAIT          4003 // 0xFA3 Volume screen wait in sec
+#define EESETTINGS_TIMEFORMAT       4004 // 0xFA4 Time format (0=24 hrs, 1 = 12 hrs)
+#define EESETTINGS_LASTHOURSSET     4005 // 0xFA5 Last time set in hours
+#define EESETTINGS_LASTMINUTESSET   4006 // 0xFA6 Last time set in minutes
+#define EESETTINGS_DATEFORMAT       4007 // 0xFA7 Date format (0=D/M/Y, 1 = M/D/Y)
+#define EESETTINGS_LASTDAYSET       4008 // 0xFA8 Last Day set
+#define EESETTINGS_LASTMONTHSET     4009 // 0xFA9 Last Month set
+#define EESETTINGS_LASTYEARSET      4010 // 0xFAA Last Year set (counting from 2000)
+#define EESETTINGS_RTCALARMMODE     4011 // 0xFAB RTC alarm mode (0=disabled, 1=enabled, 3 = enabled with sound)
+#define EESETTINGS_RESERVED         4012 // 0xFAC 4bytes reserved (additional sleep configuration)
+#define EESETTINGS_WAKEUPTIME       4016 // 0xFB0 Wake-up time as 32bit value for 1Hz RTC clock
+
 
 #endif // POKITTO_SETTINGS_H