PokittoLib with changes to lcd refresh etc.

Dependents:   Pokittris

Fork of Pokitto by Pokitto Community Team

This is a fork by user @Spinal, and is used in Pokittris for testing. Do not import this to your own program.

Revision:
2:968589ca3484
Parent:
1:4b1511a0a2c2
Child:
4:ecf2fe370c1c
diff -r 4b1511a0a2c2 -r 968589ca3484 POKITTO_CORE/PokittoSound.cpp
--- a/POKITTO_CORE/PokittoSound.cpp	Mon Sep 18 12:34:05 2017 +0000
+++ b/POKITTO_CORE/PokittoSound.cpp	Tue Sep 19 08:47:36 2017 +0000
@@ -147,6 +147,7 @@
 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};
@@ -154,7 +155,7 @@
 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
@@ -441,7 +442,7 @@
 		return;
 	switch(cmd){
 	case CMD_VOLUME: //volume
-	    X = constrain(X, 0, 10);
+	    X = constrain((int8_t)X, 0, 10);
 		noteVolume[i] = X;
 		break;
 	case CMD_INSTRUMENT: //instrument
@@ -845,6 +846,7 @@
     return Pokitto::ampIsOn();
     #endif
     #endif // POK_SIM
+    return 0;
 }
 
 void Sound::ampEnable(uint8_t v) {
@@ -860,7 +862,7 @@
 
 int Sound::playMusicStream(char* filename)
 {
-    playMusicStream(filename,0);
+    return playMusicStream(filename,0);
 }
 
 int Sound::playMusicStream()