forked from adafruit/Mini-LED-Gamer
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Menu.cpp
87 lines (78 loc) · 1.16 KB
/
Menu.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
#include "Menu.h"
const uint8_t tetrisBoot[16]={
B00000000,
B00000000,
B00001000,
B00001100,
B00000100,
B00000000,
B00000000,
B00100000,
B11100000,
B11111010,
B10111110,
B11011110,
B01111111,
B11111101,
B11011111,
B10110111
};
const uint8_t snakeBoot[16]={
B00000000,
B00000000,
B00000100,
B00000000,
B00000000,
B00000000,
B00000100,
B00000100,
B00000100,
B01111100,
B01000000,
B01000000,
B01100000,
B00100000,
B00100000,
B00100000
};
const uint8_t paintBoot[16]={
B01100000,
B11000000,
B10000010,
B00001010,
B00011110,
B00110110,
B01100011,
B11000001,
B01010101,
B01010001,
B01111111,
B00101000,
B11101111,
B00000000,
B11011011,
B00000000
};
uint8_t option=1;
// Mode: 0-Undecided; 1-Tetris; 2-Snake; 3-Paint
uint8_t mode=0;
void changeMode(){
mode = option;
}
uint8_t* getMenu(){
switch(option) {
case 1:
return (uint8_t*)tetrisBoot;
case 2:
return (uint8_t*)snakeBoot;
case 3:
return (uint8_t*)paintBoot;
}
return 0;
}
void changeOption(int8_t i){
int8_t temp = option+i;
if (temp<1) temp=3;
else if (temp>3) temp=1;
option=temp;
}