-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathmain.cpp
80 lines (49 loc) · 1.44 KB
/
main.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
#include "Pokitto.h"
#include "PokittoCookie.h"
#include "src/Game.h"
#include "src/entities/Entities.h"
#include "src/data/Formations.h"
#include "src/images/Images.h"
#include "src/utils/Constants.h"
#include "src/utils/Utils.h"
#include "src/utils/Enums.h"
using PC = Pokitto::Core;
using PD = Pokitto::Display;
using PS = Pokitto::Sound;
Game game;
GameCookie cookie;
int main() {
// Initialise pokitto ..
cookie.begin("GALAXY", sizeof(cookie), (char*)&cookie);
PC::begin();
PD::loadRGBPalette(palettePico);
PD::persistence = true;
PD::setColor(5);
PC::setFrameRate(200);
PD::setFont(fontC64);
#if POK_HIGH_RAM == HIGH_RAM_MUSIC
memset(buffers[0], 128, BUFFER_SIZE);
memset(buffers[1], 128, BUFFER_SIZE);
memset(buffers[2], 128, BUFFER_SIZE);
memset(buffers[3], 128, BUFFER_SIZE);
#else
memset(&(buffers[0]), 128, BUFFER_SIZE);
memset(&(buffers[1]), 128, BUFFER_SIZE);
memset(&(buffers[2]), 128, BUFFER_SIZE);
memset(&(buffers[3]), 128, BUFFER_SIZE);
#endif
// Kick off the random number generator ..
srand(time(0));
// Has the cookie been initialised?
if (cookie.initialised != COOKIE_INITIALISED) {
cookie.initialise();
}
// Play game!
game.setup(&cookie);
while (PC::isRunning()) {
if (!PC::update()) continue;
PC::sound.updateStream();
game.loop();
}
return 0;
}