Henry Triff / Mbed 2 deprecated ELEC2645_Project_el18ht

Dependencies:   mbed

Embed: (wiki syntax)

« Back to documentation index

Show/hide line numbers Menu.cpp Source File

Menu.cpp

00001 #include "Menu.h"
00002 
00003 //-----------------------------
00004 //  CONSTRUCTOR / DESCTRUCTOR
00005 //-----------------------------
00006 
00007 Menu::Menu()
00008 {
00009 }
00010 
00011 Menu::~Menu()
00012 {
00013 }
00014 
00015 //----------
00016 // SPRITES
00017 //----------
00018 
00019 //ARROWS
00020 int select_left [8][5] = {
00021     {1,0,0,0,0},
00022     {1,1,0,0,0},
00023     {1,1,1,0,0},
00024     {1,1,1,1,0},
00025     {1,1,1,1,0},
00026     {1,1,1,0,0},
00027     {1,1,0,0,0},
00028     {1,0,0,0,0},
00029 };
00030 
00031 int select_right [8][5] = {
00032     {0,0,0,0,1},
00033     {0,0,0,1,1},
00034     {0,0,1,1,1},
00035     {0,1,1,1,1},
00036     {0,1,1,1,1},
00037     {0,0,1,1,1},
00038     {0,0,0,1,1},
00039     {0,0,0,0,1},
00040 };
00041 
00042 //IMAGES OF EACH TYPE OF CAR
00043 int car_basic_sprite [32][32] = {
00044     {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0},
00045     {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0},
00046     {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0},
00047     {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0},
00048     {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0},
00049     {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0},
00050     {0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,0,0,0,0,0,1,1,0,0,0,0,0,0,0,0,0,0},
00051     {0,0,0,0,0,1,1,1,1,0,0,0,0,0,0,0,1,1,1,1,0,0,1,0,0,0,0,0,0,0,0,0},
00052     {0,0,0,0,1,0,0,0,0,1,1,0,1,1,1,1,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0},
00053     {0,0,0,0,1,0,0,0,0,1,0,1,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0},
00054     {0,0,0,1,0,0,0,0,0,1,0,1,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0},
00055     {0,0,1,0,1,0,0,0,0,1,0,0,1,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0},
00056     {0,1,0,0,0,1,1,0,0,1,0,0,1,0,0,0,0,0,0,0,0,0,0,1,1,1,0,0,0,0,0,0},
00057     {0,1,1,0,0,0,0,1,1,0,0,0,0,1,0,0,0,0,0,1,1,1,1,0,0,0,1,1,0,0,0,0},
00058     {0,1,0,1,1,0,0,0,0,1,1,0,0,1,0,1,1,1,1,0,0,0,0,0,0,0,0,0,1,0,0,0},
00059     {0,1,0,0,0,1,0,0,0,0,0,1,1,0,1,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,0,0},
00060     {0,1,0,0,0,1,0,0,0,0,0,0,0,0,0,1,1,0,0,0,0,0,1,1,1,1,1,0,0,0,1,0},
00061     {0,0,1,0,1,1,1,0,0,0,0,1,1,1,0,0,0,1,0,1,1,1,1,0,0,0,1,0,0,0,1,0},
00062     {0,0,0,1,0,0,0,1,1,0,1,0,0,0,1,0,0,0,1,0,1,0,1,0,0,0,1,1,1,1,0,0},
00063     {0,0,0,0,0,0,0,0,0,1,0,0,0,0,1,0,0,0,1,0,1,0,1,1,1,1,1,0,0,0,1,0},
00064     {0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,1,0,0,0,1,1,1,0,0,0,0,0,0,0,0,1,0},
00065     {0,0,0,0,0,0,0,0,0,0,1,0,0,0,1,1,0,0,1,0,0,0,0,0,0,0,0,1,1,1,0,0},
00066     {0,0,0,0,0,0,0,0,0,0,0,1,1,1,0,1,0,0,1,0,0,0,0,1,1,1,1,0,0,0,0,0},
00067     {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,0,1,1,1,1,0,0,0,0,0,0,0,0,0},
00068     {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0},
00069     {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0},
00070     {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0},
00071     {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0},
00072     {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0},
00073     {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0},
00074     {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0},
00075     {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0}
00076 };
00077 int car_off_road_sprite [32][32] = {
00078     {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0},
00079     {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0},
00080     {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0},
00081     {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0},
00082     {0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0},
00083     {0,0,0,0,0,0,0,0,0,0,1,1,0,0,0,0,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0},
00084     {0,0,0,0,0,0,0,0,1,1,0,0,0,0,0,0,0,0,0,1,1,0,0,0,0,0,0,0,0,0,0,0},
00085     {0,0,0,0,0,0,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,1,1,0,0,0,0,0,0,0,0,0},
00086     {0,0,0,0,1,1,0,0,1,1,0,0,0,0,0,0,0,0,0,1,1,0,1,0,0,0,0,0,0,0,0,0},
00087     {0,0,1,1,0,0,0,1,0,0,1,1,0,0,0,0,0,1,1,0,0,0,1,0,0,0,0,0,0,0,0,0},
00088     {0,1,1,0,0,0,0,1,0,0,0,0,1,1,0,1,1,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0},
00089     {0,1,0,1,1,0,0,1,0,0,0,0,0,0,1,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0},
00090     {0,1,0,0,0,1,1,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0},
00091     {0,1,0,0,0,0,0,1,1,0,0,0,0,0,1,0,0,0,0,0,0,1,1,1,0,0,0,0,0,0,0,0},
00092     {0,1,0,0,0,0,0,0,0,1,1,0,0,0,1,0,0,0,0,1,1,0,0,0,1,1,0,0,0,0,0,0},
00093     {0,1,0,0,0,0,0,0,0,0,0,1,1,0,1,0,0,1,1,0,0,0,0,0,0,0,1,1,0,0,0,0},
00094     {0,0,1,1,1,0,0,0,0,0,0,0,0,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,1,1,0,0},
00095     {0,1,0,0,0,1,0,0,0,0,0,0,0,0,0,1,1,0,0,0,0,0,0,0,0,0,1,1,0,0,1,0},
00096     {0,1,0,1,1,0,1,0,0,0,0,0,0,0,0,0,0,1,1,0,0,0,0,0,1,1,0,0,0,0,1,0},
00097     {0,1,1,0,0,1,1,0,0,0,0,0,0,0,0,0,0,0,0,1,1,0,1,1,0,0,0,0,0,0,1,0},
00098     {0,1,0,1,1,0,1,0,0,0,0,0,0,0,1,1,1,0,0,0,0,1,0,0,0,0,0,0,0,0,1,0},
00099     {0,0,1,0,0,1,0,1,1,0,0,0,0,1,0,0,0,1,1,0,0,1,0,0,0,0,0,0,1,1,0,0},
00100     {0,0,0,1,1,0,0,0,0,1,1,0,0,1,0,1,1,0,0,1,0,1,0,0,0,0,1,1,0,0,1,0},
00101     {0,0,0,0,0,0,0,0,0,0,0,1,1,0,1,0,0,1,0,1,0,1,0,0,1,1,0,0,1,1,0,0},
00102     {0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,1,1,0,1,1,0,0,1,1,0,0,1,1,0,0,0,0},
00103     {0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,1,1,0,1,0,1,1,0,0,1,1,0,0,0,0,0,0},
00104     {0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,1,0,0,0,0,1,1,0,0,0,0,0,0,0,0},
00105     {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0},
00106     {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0},
00107     {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0},
00108     {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0},
00109     {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0}
00110 };
00111 int car_drifter_sprite [32][32] = {
00112     {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0},
00113     {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0},
00114     {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0},
00115     {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0},
00116     {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0},
00117     {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0},
00118     {0,0,0,0,0,0,0,0,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0},
00119     {0,0,0,0,0,0,1,1,1,1,0,0,0,0,0,0,0,0,0,0,1,1,0,0,0,0,0,0,0,0,0,0},
00120     {0,0,0,0,1,1,1,1,0,0,0,0,0,0,0,0,0,0,1,1,0,0,1,0,0,0,0,0,0,0,0,0},
00121     {0,0,1,1,1,1,0,0,1,0,0,0,0,0,0,0,1,1,0,0,0,0,1,0,0,0,0,0,0,0,0,0},
00122     {0,0,1,1,0,0,1,0,1,0,1,1,1,0,1,1,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0},
00123     {0,0,0,0,0,0,1,0,1,1,0,0,0,1,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0},
00124     {0,0,0,0,0,0,1,1,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0},
00125     {0,0,0,0,1,1,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,1,1,0,1,0,0,0,0,0,0},
00126     {0,0,0,1,1,1,1,1,0,0,0,0,0,0,0,1,0,0,0,0,1,1,0,0,0,0,1,1,1,1,0,0},
00127     {0,0,1,0,0,0,0,0,1,1,1,1,0,0,0,1,0,0,1,1,0,0,0,0,0,0,0,0,0,0,1,0},
00128     {0,1,0,0,0,0,0,0,0,0,0,0,1,1,1,0,1,1,0,0,0,0,0,0,0,0,0,0,0,1,1,0},
00129     {0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,1,1,0,0,1},
00130     {0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,0,0,1,1,0,0,1,0,1},
00131     {1,0,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,0,0,0,0,1,0,1},
00132     {1,0,1,0,1,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,1,0,0,1,0,0,1},
00133     {1,1,0,0,0,1,1,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,0,0,0,1,1,0,0,1,1,0},
00134     {0,1,0,0,0,0,1,1,1,1,0,0,0,0,0,0,0,1,1,0,0,1,1,0,0,0,0,1,1,0,0,0},
00135     {0,1,0,0,0,1,0,0,0,0,1,1,1,1,0,0,0,1,0,0,0,0,1,0,0,1,1,0,0,0,0,0},
00136     {0,0,1,1,1,0,0,0,0,0,0,0,0,0,1,1,1,0,0,0,0,0,0,1,1,0,0,0,0,0,0,0},
00137     {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,1,0,0,0,0,0,0,0,0,0},
00138     {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,0,0,0,0,0,0,0,0,0,0},
00139     {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0},
00140     {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0},
00141     {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0},
00142     {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0},
00143     {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0}
00144 };
00145 int car_sports_car_sprite [32][32] = {
00146     {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0},
00147     {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0},
00148     {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0},
00149     {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0},
00150     {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0},
00151     {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0},
00152     {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0},
00153     {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0},
00154     {0,0,0,0,0,0,0,0,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0},
00155     {0,0,0,0,0,0,0,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0},
00156     {0,0,0,0,1,1,1,1,0,0,0,0,0,1,1,1,1,1,1,1,0,0,1,1,0,0,0,0,0,0,0,0},
00157     {0,0,0,1,1,1,1,0,1,0,0,1,1,0,0,0,0,0,0,0,1,1,0,0,1,0,0,0,0,0,0,0},
00158     {0,1,1,1,0,0,0,0,0,1,1,0,0,0,0,0,0,0,1,1,0,0,0,0,0,1,0,0,0,0,0,0},
00159     {0,1,1,0,1,0,0,1,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,0,1,1,0,0,0,0},
00160     {0,0,0,0,0,1,1,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,1,1,0,0,1,1,0,0},
00161     {0,0,0,1,1,1,1,1,0,0,0,0,0,0,0,0,0,1,0,0,0,0,1,1,0,0,0,0,1,0,1,0},
00162     {0,0,1,0,1,1,0,0,1,1,1,1,0,0,0,0,0,0,1,0,1,1,0,0,0,0,0,0,1,0,0,1},
00163     {0,0,1,1,0,0,1,1,0,0,0,0,1,1,1,1,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,1},
00164     {0,0,1,0,0,0,0,1,0,0,0,0,0,0,0,0,1,1,1,0,1,1,0,1,1,1,0,0,0,1,1,0},
00165     {0,0,0,1,0,0,1,0,1,1,1,1,0,0,0,0,0,1,0,1,1,0,1,0,0,0,0,1,1,0,0,0},
00166     {0,0,0,0,1,1,0,0,0,0,0,0,1,1,1,1,0,1,1,0,0,1,1,0,0,1,1,0,0,0,0,0},
00167     {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,0,0,0,0,1,1,1,0,0,0,0,0,0,0},
00168     {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,1,0,0,0,0,0,0,0,0,0,0},
00169     {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,0,0,0,0,0,0,0,0,0,0,0},
00170     {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0},
00171     {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0},
00172     {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0},
00173     {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0},
00174     {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0},
00175     {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0},
00176     {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0},
00177     {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0}
00178 };
00179 int car_race_car_sprite [32][32] = {
00180     {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0},
00181     {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0},
00182     {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0},
00183     {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0},
00184     {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0},
00185     {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0},
00186     {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0},
00187     {0,0,0,0,0,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0},
00188     {0,0,0,1,1,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0},
00189     {0,1,1,0,0,1,0,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0},
00190     {1,0,0,1,1,1,0,1,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0},
00191     {1,1,1,0,0,0,1,1,0,0,0,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0},
00192     {0,1,0,0,0,1,0,1,0,1,1,0,0,0,0,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0},
00193     {0,1,0,0,1,0,0,0,1,0,0,0,0,0,1,0,0,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0},
00194     {0,1,0,1,0,0,0,0,0,1,0,0,0,1,1,1,1,0,0,0,0,0,1,1,0,0,0,0,0,0,0,0},
00195     {0,0,1,1,0,0,0,0,0,0,1,1,1,0,0,0,0,1,1,1,1,0,0,0,1,1,0,0,0,0,0,0},
00196     {0,0,0,1,0,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,0,0,0,1,0,0,0,0,0},
00197     {0,0,0,0,1,0,0,1,1,0,0,0,0,0,1,1,1,1,1,1,0,0,0,1,1,0,0,1,0,1,0,0},
00198     {0,0,0,0,1,0,0,1,0,1,1,1,1,1,0,0,1,1,0,0,1,1,0,0,0,1,0,1,1,0,1,0},
00199     {0,0,0,0,0,1,1,0,0,0,0,0,0,0,0,1,0,0,1,1,0,0,1,1,0,1,0,1,0,0,0,1},
00200     {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,1,0,0,0,1,1,1,0,1,0,0,1,1},
00201     {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,0,0,1,0,1,1,0,0,0,0,0,1,1,0,0},
00202     {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,0,1,0,0,0,0,0,1,1,0,0,0,0},
00203     {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,1,1,0,0,0,0,0,0},
00204     {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,0,0,0,0,0,0,0,0},
00205     {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0},
00206     {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0},
00207     {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0},
00208     {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0},
00209     {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0},
00210     {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0},
00211     {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0}
00212 };
00213 int car_stupid_sprite [32][32] = {
00214     {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0},
00215     {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0},
00216     {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0},
00217     {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0},
00218     {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0},
00219     {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0},
00220     {0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0},
00221     {0,0,0,0,0,0,0,0,0,0,0,1,1,0,0,0,0,0,0,1,1,0,0,0,0,0,0,0,0,0,0,0},
00222     {0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0},
00223     {0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0},
00224     {0,0,0,0,0,0,0,0,0,1,0,0,1,0,1,0,0,1,0,1,0,0,1,0,0,0,0,0,0,0,0,0},
00225     {0,0,0,0,0,0,0,0,0,1,0,0,0,1,0,0,0,0,1,0,0,0,1,0,0,0,0,0,0,0,0,0},
00226     {0,0,0,0,0,0,0,0,0,1,0,0,1,0,1,0,0,1,0,1,0,0,1,0,0,0,0,0,0,0,0,0},
00227     {0,0,0,0,0,0,0,0,0,1,0,0,1,0,1,0,0,1,0,1,0,0,1,0,0,0,0,0,0,0,0,0},
00228     {0,0,0,0,0,0,0,0,0,1,0,0,0,1,0,0,0,0,1,0,0,0,1,0,0,0,0,0,0,0,0,0},
00229     {0,0,0,0,0,0,0,0,0,1,0,0,1,1,1,0,0,1,1,1,0,0,1,0,0,0,0,0,0,0,0,0},
00230     {0,0,0,0,0,0,0,1,1,0,0,0,1,1,1,0,0,1,1,1,0,0,0,1,1,0,0,0,0,0,0,0},
00231     {0,0,0,0,0,0,1,0,0,1,1,1,1,1,1,0,0,1,1,1,1,1,1,0,0,1,0,0,0,0,0,0},
00232     {0,0,0,0,0,1,0,0,0,0,0,0,1,1,1,1,1,1,1,1,0,0,0,0,0,0,1,0,0,0,0,0},
00233     {0,0,0,0,1,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,1,0,0,0,0},
00234     {0,0,0,1,0,0,0,0,1,0,0,1,0,0,0,1,0,0,0,1,0,0,0,1,0,0,0,0,1,0,0,0},
00235     {0,0,0,0,1,1,0,0,0,0,0,0,1,0,0,0,1,0,0,0,1,0,0,0,0,0,1,1,0,0,0,0},
00236     {0,0,0,0,0,0,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,0,0,0,0,0,0},
00237     {0,0,0,0,0,0,0,0,0,1,1,1,1,0,0,0,0,0,0,1,1,1,1,0,0,0,0,0,0,0,0,0},
00238     {0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0},
00239     {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0},
00240     {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0},
00241     {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0},
00242     {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0},
00243     {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0},
00244     {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0},
00245     {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0}
00246 };
00247 
00248 
00249 //IMAGES OF EACH MAP
00250 
00251 int map_1_short [32][32] = {
00252     {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0},
00253     {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0},
00254     {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0},
00255     {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0},
00256     {0,0,0,0,0,1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,0,0,0,0,0},
00257     {0,0,0,0,1,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,1,0,0,0,0},
00258     {0,0,0,1,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,1,0,0,0},
00259     {0,0,0,1,0,0,0,1,1,0,0,0,1,0,0,0,0,0,0,1,0,0,0,1,1,0,0,0,1,0,0,0},
00260     {0,0,0,1,0,0,1,0,0,1,0,0,1,0,0,0,0,0,0,1,0,0,1,0,0,1,0,0,1,0,0,0},
00261     {0,0,0,1,0,0,1,0,0,1,0,0,1,0,0,0,0,0,0,1,0,0,1,0,0,1,0,0,1,0,0,0},
00262     {0,0,0,1,0,0,1,0,0,1,0,0,0,1,0,0,0,0,1,0,0,0,1,0,0,1,0,0,1,0,0,0},
00263     {0,0,0,1,0,0,1,0,0,0,1,0,0,0,1,1,1,1,0,0,0,1,0,0,0,1,0,0,1,0,0,0},
00264     {0,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,0,0,0,0,1,0,0,0,0,1,0,0,1,0,0,0},
00265     {0,0,0,1,0,0,1,0,0,0,0,0,1,0,0,0,0,0,0,1,0,0,0,0,0,1,0,0,1,0,0,0},
00266     {0,0,0,1,0,0,1,0,0,0,0,0,0,1,1,1,1,1,1,0,0,0,0,0,0,1,0,0,1,0,0,0},
00267     {0,0,0,1,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,1,0,0,0},
00268     {0,0,0,1,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,1,0,0,0,0},
00269     {0,0,0,1,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,1,0,0,0,0,0},
00270     {0,0,0,1,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,1,0,0,0,0,0,0},
00271     {0,0,0,1,0,0,1,0,0,0,0,0,0,0,1,1,1,1,1,1,1,0,0,0,1,0,0,0,0,0,0,0},
00272     {0,0,0,1,0,0,1,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0},
00273     {0,0,0,1,0,0,1,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0},
00274     {0,0,0,1,0,0,0,1,0,0,0,1,0,0,0,1,1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0},
00275     {0,0,0,0,1,0,0,0,1,0,1,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0},
00276     {0,0,0,0,0,1,0,0,0,1,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0},
00277     {0,0,0,0,0,0,1,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0},
00278     {0,0,0,0,0,0,0,1,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0},
00279     {0,0,0,0,0,0,0,0,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0},
00280     {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0},
00281     {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0},
00282     {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0},
00283     {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0}
00284 };
00285 
00286 int map_2_medium [32][32] = {
00287     {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0},
00288     {0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0},
00289     {0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0},
00290     {0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0},
00291     {0,0,0,0,1,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,1,0},
00292     {0,0,0,0,1,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,1,0},
00293     {0,0,0,0,1,0,0,1,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,1,0,0,1,0},
00294     {0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,1,0,0,1,0},
00295     {0,0,0,0,1,0,0,1,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,1,0,0,1,0},
00296     {0,0,0,0,1,0,0,1,0,1,0,0,0,1,1,1,1,0,0,0,0,1,0,0,0,1,0,1,0,0,1,0},
00297     {0,0,0,0,1,0,0,1,0,1,0,0,1,0,0,0,0,1,0,0,1,0,1,0,0,1,0,1,0,0,1,0},
00298     {0,0,0,0,1,0,0,1,0,1,0,0,1,0,0,0,0,1,0,0,1,0,1,0,0,1,0,1,0,0,1,0},
00299     {0,0,0,0,1,0,0,1,0,1,0,0,1,0,0,0,0,1,0,0,1,0,1,0,0,1,0,1,0,0,1,0},
00300     {0,0,0,0,1,0,0,1,0,1,0,0,1,0,0,0,0,1,0,0,1,0,1,0,0,1,0,1,0,0,1,0},
00301     {0,0,0,0,1,0,0,0,1,0,0,0,0,1,1,1,1,0,0,0,1,0,1,0,0,1,0,1,0,0,1,0},
00302     {0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,1,0,0,1,0,1,0,0,1,0},
00303     {0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,1,0,0,1,0,1,0,0,1,0},
00304     {0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,1,0,0,1,0,1,0,0,1,0},
00305     {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,1,0,1,0,0,1,0},
00306     {0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,0,1,0,0,1,0,1,0,0,1,0},
00307     {0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,1,0,0,1,0,1,0,0,1,0},
00308     {0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,1,0,0,1,0,1,0,0,1,0},
00309     {0,1,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,1,1,0,0,0,1,0,1,0,0,1,0},
00310     {0,1,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,1,0,1,0,0,1,0},
00311     {0,1,0,0,1,0,0,0,1,1,1,1,1,0,0,0,0,0,1,0,0,0,0,0,1,0,0,1,0,0,1,0},
00312     {0,1,0,0,0,1,1,1,0,0,0,0,0,1,1,1,0,0,0,1,1,1,1,1,0,0,0,1,0,0,1,0},
00313     {0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,1,0,0,0,1,0},
00314     {0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,0,0,0,0,1,0},
00315     {0,0,0,1,1,1,1,1,0,0,0,0,0,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0},
00316     {0,0,0,0,0,0,0,0,1,1,1,1,1,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0},
00317     {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0},
00318     {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,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,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,0,0,0},
00353     {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0}
00354 };
00355 
00356 //************
00357 // MENU CODE
00358 //************
00359 //FINITE STATE MACHINE USED FOR GAME SETUP SEE LINE 545
00360 
00361 bool Menu::Main_Menu(N5110 &LCD, Gamepad &Device) //Main Menu
00362 {
00363     while(1) {
00364         int main_menu_select = 1; //Initial option selected
00365         do { //Loop until an option is selected
00366             if(Device.get_direction() == N) { //Moving stick up moves selection arrows up
00367                 if(main_menu_select > 1) {
00368                     main_menu_select--;
00369                     wait(0.3);
00370                 }
00371             } else if(Device.get_direction() == S) { //Moving stuck down moves selection arrows down
00372                 if(main_menu_select < 4) {
00373                     main_menu_select++;
00374                     wait(0.3);
00375                 }
00376             }
00377 
00378             LCD.setContrast((0.35 + 0.2 * Device.read_pot1()));
00379 
00380             LCD.clear();
00381             //Print options
00382             LCD.printString("SKRRT SKRRT",0,0); //Game Name
00383             LCD.printString("RACE",5,2); //Option 1
00384             LCD.printString("SETTINGS",5,3); //Option 2
00385             LCD.printString("INSTRUCTIONS",5,4); //Option 3
00386             LCD.printString("CREDITS",5,5); //Option 4
00387 
00388             //Menu select arrows
00389             LCD.drawSprite(0, (8*main_menu_select + 8), 8, 5, (int *) select_left);
00390             LCD.drawSprite(79, (8*main_menu_select + 8), 8, 5, (int *) select_right);
00391 
00392             LCD.refresh();
00393             wait(0.1);
00394         } while(Device.X_held() == false); //Loop until an option is selected
00395 
00396         if (main_menu_select == 1) { //If option 1 is selected, return the function as false
00397             return false;
00398         } else if(main_menu_select == 2) { //If settings is selected
00399             if(Settings_Menu(LCD, Device) == true) { //Show settings, if it returns true (indicating format was selected)
00400                 if(Format_SD(LCD, Device) == true) { //If formatting was confirmed
00401                     return true; //Return the function as true
00402                 }
00403             }
00404         } else if(main_menu_select == 3) { //If Instructions are selected
00405             Instructions_Menu(LCD, Device); //Show instructions menu
00406         } else if(main_menu_select == 4) { //If Credits are selected
00407             Credits_Menu(LCD, Device); //Show credits
00408         }
00409     }
00410 }
00411 
00412 void Menu::Credits_Menu(N5110 &LCD, Gamepad &Device)
00413 {
00414     wait(0.2);
00415     while(Device.A_held() == false) { //Display credits until A is pressed
00416         //Write credit info
00417         LCD.clear();
00418         LCD.printString("CREDITS",0,0);
00419         LCD.printString("MADE BY:",5,2);
00420         LCD.printString("HENRY TRIFF",5,3);
00421         LCD.printString("25/03/2020",5,4);
00422         LCD.printString("UNI OF LEEDS",5,5);
00423         LCD.refresh();
00424         wait(0.1);
00425     }
00426 }
00427 
00428 void Menu::Instructions_Menu(N5110 &LCD, Gamepad &Device)
00429 {
00430     string instructions_array[21] = { //All Lines for the instructions
00431         "MOVE STICK UP/",
00432         "DONE TO SCROLL",
00433         "THROUGH THE   ",
00434         "INSTRUCTIONS  ",
00435         "              ",
00436         "MENU CONTROLS ",
00437         "X = SELECT    ",
00438         "A = BACK      ",
00439         "STICK:        ",
00440         " LEFT = -     ",
00441         " RIGHT = +    ",
00442         "              ",
00443         "GAME CONTROLS ",
00444         "X = ACCELERATE",
00445         "A = BREAK     ",
00446         "STICK = STEER ",
00447         "GYRO = STEER  ",
00448         "(SEE SETTINGS)",
00449         "              ",
00450         "LEFT POT =    ",
00451         "CONTRAST      "
00452     };
00453 
00454     wait(0.2);
00455     int line = 0;
00456     while(Device.A_held() == false) { //Loop until A is pressed
00457 
00458         //Converting from string to char array       
00459         string line_1_string = instructions_array[line];
00460         string line_2_string = instructions_array[line+1];
00461         string line_3_string = instructions_array[line+2];
00462         string line_4_string = instructions_array[line+3];
00463         string line_5_string = instructions_array[line+4];
00464         string line_6_string = instructions_array[line+5];
00465 
00466         char line_1_char[14];
00467         char line_2_char[14];
00468         char line_3_char[14];
00469         char line_4_char[14];
00470         char line_5_char[14];
00471         char line_6_char[14];
00472 
00473         for(int i = 0; i < 14; i++) {
00474             line_1_char[i] = line_1_string[i];
00475             line_2_char[i] = line_2_string[i];
00476             line_3_char[i] = line_3_string[i];
00477             line_4_char[i] = line_4_string[i];
00478             line_5_char[i] = line_5_string[i];
00479             line_6_char[i] = line_6_string[i];
00480         }
00481 
00482         //Printing the lines to the screen
00483         LCD.clear();
00484         LCD.printString(line_1_char,0,0);
00485         LCD.printString(line_2_char,0,1);
00486         LCD.printString(line_3_char,0,2);
00487         LCD.printString(line_4_char,0,3);
00488         LCD.printString(line_5_char,0,4);
00489         LCD.printString(line_6_char,0,5);
00490         LCD.refresh();
00491 
00492         //Scrolling up / down
00493         if(Device.get_direction() == S) {
00494             if(line < 15) {
00495                 line++;
00496             }
00497         } else if(Device.get_direction() == N) {
00498             if(line > 0) {
00499                 line--;
00500             }
00501         }
00502         
00503         wait(0.2);
00504     }
00505 }
00506 
00507 bool Menu::Settings_Menu(N5110 &LCD, Gamepad &Device) //Settings menu
00508 {
00509     wait(0.2);
00510     int menu_option = 0; //Initial option is 0
00511     while(Device.A_held() == false) {
00512 
00513         if(Device.get_direction() == N) { //If the stick is in the up position, move arrow up
00514             if(menu_option > 0) {
00515                 menu_option--;
00516                 wait(0.3);
00517             }
00518         } else if(Device.get_direction() == S) { //If the stick is int he down position, move arrow down
00519             if(menu_option < 2) {
00520                 menu_option++;
00521                 wait(0.3);
00522             }
00523         }
00524 
00525         if(menu_option == 0) { //If gyro setting is indicated
00526             if(Device.X_held() == true) {
00527                 if(Settings_Gyro == true) {//Pressing X changes the setting
00528                     Settings_Gyro = false;
00529                 } else {
00530                     Settings_Gyro = true;
00531                 }
00532                 wait(0.3);
00533             } else if(Device.get_direction() == E) { //Moving stick right, enables gyro
00534                 Settings_Gyro = true;
00535             } else if(Device.get_direction() == W) { //Moving stick left, disables gyro
00536                 Settings_Gyro = false;
00537             }
00538         } else if (menu_option == 1) { //If led setting is indicated
00539             if(Device.X_held() == true) { //Pressing X changes the setting
00540                 if(Settings_LEDs == true) {
00541                     Settings_LEDs = false;
00542                 } else {
00543                     Settings_LEDs = true;
00544                 }
00545                 wait(0.3);
00546             } else if(Device.get_direction() == E) { //Moving stick right, enables LEDs
00547                 Settings_LEDs = true;
00548             } else if(Device.get_direction() == W) { //Moving stick left, disables LEDs
00549                 Settings_LEDs = false;
00550             }
00551         } else if (menu_option == 2) { //If formatting SD is indicated
00552             if(Device.get_direction() == E) { //If stick is moved to the right
00553                 return true; //Return the function as true
00554             } else if(Device.X_held() == true) { //If the X button is pressed
00555                 wait(0.3);
00556                 return true; //Return the function as true
00557             }
00558         }
00559 
00560         //Display settings menu
00561         LCD.clear();
00562         LCD.printString("SETTINGS",0,0);
00563 
00564         LCD.printString("GYRO STEER",5,2);
00565         if(Settings_Gyro == true) {
00566             LCD.printString("Y",70,2);
00567         } else {
00568             LCD.printString("N",70,2);
00569         }
00570 
00571         LCD.printString("LEDS",5,3);
00572         if(Settings_LEDs == true) {
00573             LCD.printString("Y",70,3);
00574         } else {
00575             LCD.printString("N",70,3);
00576         }
00577 
00578         LCD.printString("FORMAT SD?",5,4);
00579         LCD.printString("?",70,4);
00580 
00581         //Display arrows
00582         LCD.drawSprite(0, (8*menu_option + 16), 8, 5, (int *) select_left);
00583         LCD.drawSprite(79, (8*menu_option + 16), 8, 5, (int *) select_right);
00584 
00585         LCD.refresh();
00586         wait(0.05);
00587     }
00588     return false; //return function as false if A is pressed
00589 }
00590 
00591 bool Menu::Format_SD(N5110 &LCD, Gamepad &Device)
00592 {
00593     //Are you sure message
00594     LCD.clear();
00595     LCD.printString("FORMAT SD?",0,0);
00596     LCD.printString("X = YES",0,2);
00597     LCD.printString("A = NO",0,3);
00598     LCD.printString("(THIS MAY TAKE",0,4);
00599     LCD.printString("A FEW MINS)",0,5);
00600     LCD.refresh();
00601 
00602     while(1) { //Waits here
00603         if(Device.X_held() == true) {
00604             return true; //Return that yes was selected
00605         } else if(Device.A_held() == true) {
00606             return false; //Return that no was selected
00607         }
00608     }
00609 }
00610 
00611 
00612 bool Menu::Game_Setup(N5110 &LCD, Gamepad &Device) //Create finite state machine and run it
00613 {
00614     //Creating finite state machine
00615     Menu_Setup Game_Setup[7] = {
00616         {{0, 0, 0, 0}},                             //GO_Main
00617         {{GO_Main, Map, GO_Main, Ghost_Warning}},   //Mode
00618         {{Mode, Laps, Mode, Car}},                  //Map
00619         {{Map, Car, 0, 0}},                         //Laps
00620         {{Laps, GO_Race, Map, GO_Race}},            //Car
00621         {{0, 0, Map, Map}},                         //Ghost_Warning
00622         {{0, 0, 0, 0}}                              //GO_Race
00623     };
00624 
00625     int state = Mode; //Initial state is Mode menu
00626     int input;
00627     wait(0.5);
00628     while(1) { //Loop to run the FSM
00629         switch(state) {
00630             case GO_Main:
00631                 return false; //Indicates returning to main menu
00632             case Mode:
00633                 input = Setup_State_Mode(LCD, Device); //Display Mode menu
00634                 break;
00635             case Map:
00636                 input = Setup_State_Map(LCD, Device); //Display Map menu
00637                 break;
00638             case Laps:
00639                 input = Setup_State_Laps(LCD, Device); //Display Laps menu
00640                 break;
00641             case Car:
00642                 input = Setup_State_Car(LCD, Device); //Display Car menu
00643                 break;
00644             case Ghost_Warning:
00645                 input = Setup_State_Ghost_Warning(LCD, Device); //Display SD card formatting warning
00646                 break;
00647             case GO_Race:
00648                 return true; //Indicates starting the game
00649         }
00650 
00651         input = input + (2*Setup_Ghost); //Ensuring the correct array is selected
00652         state = Game_Setup[state].next_state[input]; //Compare input to FSM table and return state
00653         wait(0.3);
00654     }
00655 }
00656 
00657 int Menu::Setup_State_Mode(N5110 &LCD, Gamepad &Device) //Mode state
00658 {
00659     int mode_option = 1;
00660     do {
00661         do {
00662             if(Device.get_direction() == E) { //Stick to the right indicates option increase
00663                 if(mode_option < 3) {
00664                     mode_option++; //Increase option
00665                     wait(0.3);
00666                 }
00667             } else if(Device.get_direction() == W) { //Stick to the left indicates option decrease
00668                 if(mode_option > 1) {
00669                     mode_option--; //Decrease option
00670                     wait(0.3);
00671                 }
00672             }
00673 
00674             //Display menu
00675             LCD.clear();
00676             LCD.printString("SELECT MODE",0,0);
00677 
00678             //Display current menu option
00679             if(mode_option == 1) {
00680                 LCD.printString("FREE RACE",6,3);
00681             }
00682             if(mode_option == 2) {
00683                 LCD.printString("GHOST MODE",6,3);
00684             }
00685             if(mode_option == 3) {
00686                 LCD.printString("2P RACE",6,3);
00687                 LCD.printString("*UNAVAILABLE*",6,5);
00688                 //I have not yet implamented 2-player mode because i have already put lots of hours into this.
00689                 //I may do it, if i want to in my spare time.
00690                 //I was intending to use Ethernet to connect two devices together
00691             }
00692 
00693             //Display arrows
00694             LCD.drawSprite(79, 24, 8, 5, (int *) select_left);
00695             LCD.drawSprite(0, 24, 8, 5, (int *) select_right);
00696 
00697             LCD.refresh();
00698             wait(0.05);
00699         } while(mode_option == 3); //Loop until 2P Race is not selected
00700     } while(Device.X_held() == false && Device.A_held() == false); //Loop until an option is selected
00701 
00702     if(mode_option == 2) { //If Ghost mode is selected, set Setup_Ghost to 1;
00703         Setup_Ghost = 1;
00704     } else {
00705         Setup_Ghost = 0;
00706     }
00707     return Device.X_held(); //Return if X was pressed or not (if not, we can conclude A was pressed)
00708 }
00709 
00710 int Menu::Setup_State_Map(N5110 &LCD, Gamepad &Device) //Map Menu
00711 {
00712     int map_option = Small; //Initial option is small map
00713     do { //Loop until a button is pressed
00714         if(Device.get_direction() == E) { //If stick is right, then increase the map option
00715             if(map_option < Large) {
00716                 map_option++;
00717                 wait(0.3);
00718             }
00719         } else if(Device.get_direction() == W) { //If stick is left then decrease the map option
00720             if(map_option > Small) {
00721                 map_option--;
00722                 wait(0.3);
00723             }
00724         }
00725 
00726         //Display menu
00727         LCD.clear();
00728         LCD.printString("SELECT A MAP",0,0);
00729 
00730         //Display map
00731         if(map_option == Small) {
00732             LCD.printString("SHORT",6,1); //Display name of track
00733             LCD.drawSprite(26, 16, 32, 32, (int *) map_1_short); //Draw the image of the map
00734         }
00735         if(map_option == Medium) {
00736             LCD.printString("MEDIUM",6,1); //Display name of track
00737             LCD.drawSprite(26, 16, 32, 32, (int *) map_2_medium); //Draw the image of the map
00738         }
00739         if(map_option == Large) {
00740             LCD.printString("LONG",6,1); //Display name of track
00741             LCD.drawSprite(10, 16, 32, 64, (int *) map_3_long); //Draw the image of the map
00742         }
00743 
00744         //Display arrows
00745         LCD.drawSprite(79, 8, 8, 5, (int *) select_left);
00746         LCD.drawSprite(0, 8, 8, 5, (int *) select_right);
00747 
00748         LCD.refresh();
00749         wait(0.05);
00750     } while(Device.A_held() == false && Device.X_held() == false); //Loop until a button is pressed
00751 
00752     Setup_Map = map_option; //Set the Setup_Map as the option selected
00753 
00754     return Device.X_held(); //Return which button was pressed
00755 }
00756 
00757 int Menu::Setup_State_Laps(N5110 &LCD, Gamepad &Device) //Laps menu
00758 {
00759     int lap_option = 1; //Initial option is 1 lap
00760     do { //Loop until a button is pressed
00761 
00762         if(Device.get_direction() == E) { //If Stick is right then increase the laps
00763             if(lap_option < 5) {
00764                 lap_option++;
00765                 wait(0.3);
00766             }
00767         } else if(Device.get_direction() == W) { //If stick is left then decrease the laps
00768             if(lap_option > 1) {
00769                 lap_option--;
00770                 wait(0.3);
00771             }
00772         }
00773 
00774         //Display laps menu
00775         LCD.clear();
00776         LCD.printString("SELECT # LAPS",0,0);
00777 
00778         //Display the number of laps
00779         if(lap_option == 1) {
00780             LCD.printString("1",40,3);
00781         }
00782         if(lap_option == 2) {
00783             LCD.printString("2",40,3);
00784         }
00785         if(lap_option == 3) {
00786             LCD.printString("3",40,3);
00787         }
00788         if(lap_option == 4) {
00789             LCD.printString("4",40,3);
00790         }
00791         if(lap_option == 5) {
00792             LCD.printString("5",40,3);
00793         }
00794 
00795         //Display the arrows
00796         LCD.drawSprite(79, 24, 8, 5, (int *) select_left);
00797         LCD.drawSprite(0, 24, 8, 5, (int *) select_right);
00798 
00799         LCD.refresh();
00800         wait(0.05);
00801     } while(Device.A_held() == false && Device.X_held() == false); //Loop for an option to be selected
00802 
00803     Setup_Laps = lap_option; //Set Setup_Laps to the option selected
00804 
00805     return Device.X_held(); //Return the button pressed
00806 }
00807 
00808 int Menu::Setup_State_Car(N5110 &LCD, Gamepad &Device) //Menu to select car
00809 {
00810     int car_option = Basic; //Initial option is the basic car
00811     do {
00812         if(Device.get_direction() == E) { //If stick is moved to the right
00813             if(car_option < 5) {
00814                 car_option++; //Change (increase) the car displayed
00815                 wait(0.3);
00816             }
00817         } else if(Device.get_direction() == W) { //If stick is moved to the left
00818             if(car_option > 0) {
00819                 car_option--; //Change (decrease) the car displayed
00820                 wait(0.3);
00821             }
00822         }
00823 
00824         LCD.clear();
00825         LCD.printString("SELECT A CAR",0,0); //Menu title
00826 
00827         if(car_option == Basic) {
00828             LCD.printString("BASIC",6,1); //Car Name
00829             LCD.drawSprite(26, 16, 32, 32, (int *) car_basic_sprite); //Draw the image of the car
00830         }
00831         if(car_option == Offroad) {
00832             LCD.printString("OFF-ROAD",6,1); //Car Name
00833             LCD.drawSprite(26, 16, 32, 32, (int *) car_off_road_sprite); //Draw the image of the car
00834         }
00835         if(car_option == Drifter) {
00836             LCD.printString("DRIFTER",6,1); //Car Name
00837             LCD.drawSprite(26, 16, 32, 32, (int *) car_drifter_sprite); //Draw the image of the car
00838         }
00839         if(car_option == Sportscar) {
00840             LCD.printString("SPORTS CAR",6,1); //Car Name
00841             LCD.drawSprite(26, 16, 32, 32, (int *) car_sports_car_sprite); //Draw the image of the car
00842         }
00843         if(car_option == Racecar) {
00844             LCD.printString("RACE CAR",6,1); //Car Name
00845             LCD.drawSprite(26, 16, 32, 32, (int *) car_race_car_sprite); //Draw the image of the car
00846         }
00847         if(car_option == Stupid) {
00848             LCD.printString("ALIEN SHIP",6,1); //Car Name
00849             LCD.drawSprite(26, 16, 32, 32, (int *) car_stupid_sprite); //Draw the image of the car
00850         }
00851 
00852 
00853         LCD.drawSprite(79, 8, 8, 5, (int *) select_left); //Left arrow
00854         LCD.drawSprite(0, 8, 8, 5, (int *) select_right); //Right arrow
00855 
00856         LCD.refresh();
00857         wait(0.05);
00858     } while(Device.A_held() == false && Device.X_held() == false); //Loop until an option has been selected
00859 
00860     Setup_Car = car_option; //Setup_Car is set to the option selected
00861 
00862     return Device.X_held(); //Return the button pressed
00863 }
00864 
00865 int Menu::Setup_State_Ghost_Warning(N5110 &LCD, Gamepad &Device)
00866 {
00867     LCD.clear();
00868     LCD.printString("ENSURE SD CARD",0,0);
00869     LCD.printString("IS FORMATTED",0,1);
00870     LCD.printString("CORRECTLY",0,2);
00871     LCD.printString("SEE SETTINGS",0,4);
00872     LCD.refresh();
00873     wait(3);
00874 
00875     return Device.X_held();
00876 }
00877 
00878 
00879 //*********************
00880 //  GETTING VARIABLES
00881 //*********************
00882 
00883 int Menu::Get_Mode() //Returns if ghost_mode is enabled
00884 {
00885     return Setup_Ghost;
00886 }
00887 int Menu::Get_Map() //Returns which map was selected
00888 {
00889     return Setup_Map;
00890 }
00891 int Menu::Get_Laps() //Returns how many laps were chosen
00892 {
00893     return Setup_Laps;
00894 }
00895 int Menu::Get_Car() //Returns which car was selected
00896 {
00897     return Setup_Car;
00898 }
00899 bool Menu::Get_Setting_LED() //Returns if LEDS are on
00900 {
00901     return Settings_LEDs;
00902 }
00903 bool Menu::Get_Setting_Gyro() //Returns if Gyro steering is enabled
00904 {
00905     return Settings_Gyro;
00906 }