/* Keep these headers */ #include #include #include #include /* Standard headers - it's recommended to leave them included */ #include #include #include #include #include "map.h" #include "mem.h" #include "rle.h" uint8_t* map = {0}; /* Your code here */ void initMap() { // map data is RLE-compressed // bits 0-2 : tile ID (3-bits) // bits 3-7 : number (5-bits) // 0 value for end of data uint8_t map_C[] = {249,249,249,249,249,249,249,249,249,249,249,249,249,249,249,249,249,249,249,249,249,249,249,249,249,249,249,249,249,97,72,33,80,121,56,26,72,20,88,169,40,113,24,177,248,8,17,96,105,56,42,56,20,40,21,48,145,120,21,225,104,68,144,18,48,105,48,26,11,26,40,20,40,53,8,29,65,29,17,29,9,21,48,33,32,29,57,29,41,29,224,12,136,18,48,113,40,26,27,26,24,20,56,189,16,37,32,49,32,37,25,61,17,29,112,35,16,147,104,20,24,105,32,42,11,42,16,20,48,101,40,61,24,29,48,17,56,37,9,69,9,21,80,251,80,12,21,20,16,113,40,82,16,12,72,109,8,69,8,37,40,33,56,117,72,251,27,48,20,37,12,24,105,56,58,104,141,26,61,40,49,56,53,20,37,64,251,43,40,12,29,12,40,113,64,34,72,17,24,93,82,69,24,65,56,37,20,37,64,187,25,83,40,12,45,12,24,121,64,18,96,43,16,101,26,61,56,73,56,37,20,21,72,123,33,35,17,91,32,12,53,12,32,113,64,10,96,59,24,45,16,101,16,13,32,73,72,53,88,107,33,35,25,83,32,12,53,12,48,121,88,10,24,14,8,67,64,45,25,13,17,13,9,53,40,57,64,69,88,107,33,19,25,83,40,12,45,12,48,121,88,10,40,75,72,29,81,37,40,73,48,85,80,115,65,91,40,12,37,12,56,105,136,83,88,13,73,37,56,65,56,85,80,115,49,91,40,12,37,12,64,105,128,99,72,29,73,37,40,65,64,117,8,9,32,107,49,91,40,12,45,20,48,113,120,91,80,37,73,37,40,57,56,133,8,17,40,115,49,67,40,12,61,12,48,113,48,20,40,91,80,53,57,53,40,49,24,14,24,141,25,40,99,49,75,32,12,61,12,56,113,40,36,24,99,72,61,65,53,24,65,64,125,33,40,91,32,17,83,24,20,53,12,56,121,40,20,24,107,64,45,18,13,73,53,16,65,72,45,34,37,16,41,24,91,25,8,17,83,32,12,53,12,56,113,48,12,24,123,56,37,18,29,65,53,24,49,88,45,34,29,24,49,16,83,25,8,9,99,24,12,53,12,56,105,48,12,24,139,48,29,18,37,73,45,24,49,96,45,18,37,40,41,16,67,33,16,9,91,24,20,45,20,48,105,56,12,16,59,28,59,56,13,26,29,81,45,16,65,88,45,10,45,48,41,16,59,41,8,9,91,32,12,53,12,40,113,16,9,32,12,8,75,28,43,48,29,34,29,73,45,16,65,40,20,40,85,56,41,16,59,9,20,9,8,17,83,40,12,53,12,32,145,32,12,8,67,20,51,56,21,26,45,73,37,16,57,40,28,32,93,64,41,16,51,9,12,17,8,17,83,40,12,53,12,24,145,32,12,16,67,36,27,64,37,10,61,57,37,24,41,48,12,48,93,64,41,16,51,33,8,25,75,40,12,53,12,24,137,56,131,56,125,33,45,24,65,32,12,40,93,64,41,16,59,25,15,17,83,40,12,53,12,16,137,80,115,48,141,25,45,24,49,48,12,40,93,56,41,16,67,49,75,40,12,69,12,8,129,48,21,16,131,48,141,17,45,24,41,48,12,48,93,56,41,16,75,41,67,40,12,77,12,8,129,20,24,37,139,56,93,18,37,9,45,24,41,48,12,40,53,20,37,48,41,16,91,25,67,48,12,69,12,24,121,28,16,37,67,17,59,64,85,10,45,9,45,16,41,96,53,36,29,48,41,16,99,17,59,48,12,37,18,37,12,16,121,20,32,21,43,32,75,72,173,24,41,80,61,36,29,40,41,16,27,16,67,17,51,48,12,101,12,16,113,12,48,43,48,59,32,28,48,149,24,33,88,61,36,29,40,41,16,27,16,67,17,27,72,12,53,18,37,12,16,113,48,43,56,59,32,20,80,125,16,49,72,77,20,37,32,41,16,35,24,59,9,19,96,12,93,12,24,105,48,27,88,51,32,12,104,101,24,41,88,109,40,25,16,35,40,67,96,12,93,12,24,113,56,11,96,51,24,33,112,77,24,49,96,93,48,17,16,35,48,51,88,12,101,12,32,113,160,51,8,65,88,85,24,57,88,93,48,17,16,35,16,20,16,51,64,10,12,93,12,32,137,168,35,16,57,88,93,32,49,96,85,48,9,16,35,16,36,16,59,48,26,93,24,145,24,28,80,15,40,27,16,65,64,109,24,49,104,77,80,35,24,20,24,75,40,26,93,32,129,32,12,144,11,32,65,40,125,32,33,48,26,32,77,40,20,32,35,16,20,15,20,8,91,32,26,77,64,105,88,18,56,18,48,73,24,61,34,45,32,33,48,18,40,69,48,12,40,35,16,20,8,20,16,83,48,18,61,56,10,8,113,72,18,136,57,8,9,8,77,18,53,40,17,48,18,12,32,69,96,35,32,12,8,12,16,91,24,12,24,18,45,32,28,16,121,72,34,112,57,32,141,32,41,48,12,32,61,56,18,32,35,24,13,16,13,16,99,40,26,61,24,12,24,113,72,26,72,20,24,65,32,85,15,61,24,57,40,12,24,69,16,12,32,18,32,35,16,18,13,8,13,24,99,24,42,61,24,12,8,121,88,105,8,73,24,157,16,73,40,12,8,69,16,20,40,18,16,35,24,10,32,10,8,115,32,34,61,40,10,249,121,24,77,17,77,8,89,32,12,69,24,12,80,35,80,123,32,34,61,32,10,249,113,24,77,33,69,8,89,32,77,32,12,40,12,16,35,80,131,40,34,53,40,249,105,24,69,57,61,8,81,40,53,48,12,72,35,40,20,8,12,147,32,42,53,16,249,17,48,49,24,61,65,69,16,81,32,53,56,12,56,35,88,51,25,59,48,34,53,24,209,96,33,32,45,14,73,77,8,97,16,53,56,12,64,35,32,36,8,20,51,25,59,32,58,53,24,169,56,19,40,21,17,24,61,97,69,16,73,26,61,56,12,56,35,48,20,16,20,59,17,67,32,58,45,16,153,120,125,113,61,16,73,10,15,8,53,80,12,48,35,56,18,8,75,17,59,48,50,37,16,137,120,149,105,61,16,73,26,45,40,34,64,35,56,34,75,17,67,56,34,37,24,121,120,149,121,53,16,97,61,112,35,80,18,67,17,75,20,32,12,8,26,37,24,105,128,157,121,53,24,57,24,53,80,10,40,35,40,50,11,8,147,36,24,34,37,24,105,48,51,16,181,113,53,24,57,24,53,120,35,56,26,32,155,12,32,42,37,16,137,8,51,8,237,81,53,24,57,24,53,120,35,56,10,14,10,32,155,40,42,37,16,121,24,59,253,41,77,32,49,16,53,40,42,40,43,48,18,8,18,24,163,40,42,37,16,105,32,19,8,15,8,19,141,42,101,17,77,40,33,16,53,40,58,24,43,48,26,8,10,40,155,40,42,37,8,121,24,19,24,19,8,141,42,141,28,21,24,49,8,53,48,18,27,18,16,43,56,18,64,163,32,34,37,24,105,32,19,16,27,32,109,58,125,44,13,24,41,16,45,56,18,27,18,8,59,48,10,72,163,32,42,37,16,105,18,24,19,8,19,64,85,18,27,26,125,28,21,32,33,8,37,72,58,59,8,11,112,163,32,42,37,16,121,40,11,8,11,96,69,10,19,26,173,24,41,29,96,42,83,32,35,8,75,25,107,8,14,32,34,37,16,105,104,18,176,69,34,61,16,49,21,56,21,64,155,8,75,33,99,56,26,29,24,105,40,18,40,18,192,61,18,11,18,53,16,41,8,13,56,37,48,163,8,67,33,115,56,26,21,24,105,40,27,24,18,64,10,136,53,26,11,10,53,16,65,56,21,48,171,8,67,25,115,64,26,13,24,113,24,75,64,10,64,28,64,53,26,61,16,57,120,147,64,51,17,107,80,26,13,16,113,8,115,40,10,56,28,80,109,32,49,128,115,104,51,9,107,72,26,13,32,105,147,24,10,56,28,104,61,136,26,56,107,120,163,72,26,13,32,105,251,35,104,29,136,42,40,67,72,90,14,8,123,17,27,56,34,13,32,105,67,25,251,43,160,34,40,75,56,106,16,139,9,27,48,34,13,40,105,67,9,12,8,12,17,251,219,8,91,56,50,24,34,24,147,9,27,40,26,13,16,15,24,105,67,41,219,25,235,8,83,56,66,16,26,24,187,48,34,13,24,113,251,51,49,235,8,75,64,34,8,26,24,18,16,203,40,34,13,16,121,35,88,179,25,251,11,8,67,88,42,40,10,24,195,32,34,40,121,11,112,251,203,8,59,24,18,80,26,32,10,32,195,32,26,48,113,11,112,155,112,19,32,139,8,75,96,18,32,18,40,187,32,26,32,137,144,59,184,11,10,96,19,16,27,40,27,160,18,24,10,24,67,17,107,48,11,40,129,176,19,96,18,232,11,48,11,144,42,32,10,16,11,8,51,9,10,9,107,112,121,253,85,20,173,232,26,48,10,83,17,115,48,20,17,24,129,69,14,213,28,69,20,117,96,34,120,18,64,203,48,20,40,137,53,34,253,53,36,77,128,21,88,26,80,203,32,28,40,153,53,26,133,44,29,12,13,12,29,12,61,20,69,152,15,152,18,40,195,24,36,24,169,53,10,181,20,29,20,13,12,61,20,69,80,14,160,26,8,28,11,64,83,15,107,32,28,8,12,185,229,20,37,20,21,12,13,12,37,12,53,72,58,40,18,48,81,32,25,16,9,96,99,40,20,24,185,109,19,117,20,61,12,69,12,13,88,26,249,25,64,49,8,107,32,20,32,185,93,19,205,128,249,105,64,33,8,107,32,12,9,40,249,33,8,49,32,61,168,249,145,56,17,8,107,24,20,32,121,32,33,16,41,40,17,8,65,32,21,176,249,177,24,33,8,83,48,20,40,113,15,17,104,25,32,73,136,249,249,17,18,16,17,8,59,80,14,16,249,249,249,249,249,249,249,249,249,249,249,249,249,249,249,249,249,249,249,249,249,249,249,249,249,169,0}; map = (uint8_t*)myMalloc(MAP_SIZE); memset(map, 1, MAP_SIZE); decompRLE(map, map_C, 3, 0, 0, 0, 0, 0); }