forked from multimediamike/dreamroq
-
Notifications
You must be signed in to change notification settings - Fork 0
/
main.c
executable file
·56 lines (43 loc) · 1.13 KB
/
main.c
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
#include <dc/pvr.h>
#include <dc/maple.h>
#include <dc/video.h>
#include <dc/maple/controller.h>
#include <arch/arch.h>
#include <stdlib.h>
#include "roq-player.h"
extern uint8 romdisk[];
KOS_INIT_ROMDISK(romdisk);
static roq_player_t* player;
static void frame_cb() {
maple_device_t *dev;
cont_state_t *state;
dev = maple_enum_type(0, MAPLE_FUNC_CONTROLLER);
if(dev) {
state = (cont_state_t *)maple_dev_status(dev);
if(state) {
if(state->buttons & CONT_START) {
arch_exit();
}
else if(state->buttons & CONT_A) {
player_play(player, frame_cb);
}
else if(state->buttons & CONT_B) {
player_stop(player);
}
else if(state->buttons & CONT_X) {
player_pause(player);
}
}
}
}
int main()
{
vid_set_mode(DM_640x480_NTSC_IL, PM_RGB565);
if(player_init()) {
player = player_create("/rd/roguelogo.roq");
//player_set_loop(player, 1);
player_play(player, frame_cb);
player_shutdown(player);
}
return 0;
}