forked from rofl0r/gnuboy
-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathsys.h
More file actions
114 lines (89 loc) · 2.87 KB
/
sys.h
File metadata and controls
114 lines (89 loc) · 2.87 KB
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
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
#ifndef VID_H
#define VID_H
#include <SDL/SDL.h>
#include <SDL/SDL_ttf.h>
#include <SDL/SDL_image.h>
/// -------------- DEFINES --------------
#define MIN(a,b) (((a)<(b))?(a):(b))
#define MAX(a,b) (((a)>(b))?(a):(b))
#define ABS(x) (((x) < 0) ? (-x) : (x))
#define GB_SCREEN_WIDTH 160
#define GB_SCREEN_HEIGHT 144
#define RES_HW_SCREEN_HORIZONTAL 240
#define RES_HW_SCREEN_VERTICAL 240
#define SCREEN_HORIZONTAL_SIZE RES_HW_SCREEN_HORIZONTAL
#define SCREEN_VERTICAL_SIZE RES_HW_SCREEN_VERTICAL
typedef enum{
MENU_TYPE_VOLUME,
MENU_TYPE_BRIGHTNESS,
MENU_TYPE_SAVE,
MENU_TYPE_LOAD,
MENU_TYPE_ASPECT_RATIO,
MENU_TYPE_EXIT,
MENU_TYPE_POWERDOWN,
NB_MENU_TYPES,
} ENUM_MENU_TYPE;
///------ Definition of the different resume options
#define RESUME_OPTIONS \
X(RESUME_YES, "RESUME GAME") \
X(RESUME_NO, "NEW GAME") \
X(NB_RESUME_OPTIONS, "")
////------ Enumeration of the different resume options ------
#undef X
#define X(a, b) a,
typedef enum {RESUME_OPTIONS} ENUM_RESUME_OPTIONS;
////------ Defines to be shared -------
#define STEP_CHANGE_VOLUME 10
#define STEP_CHANGE_BRIGHTNESS 10
#define NOTIF_SECONDS_DISP 2
////------ Menu commands -------
#define SHELL_CMD_VOLUME_GET "volume get"
#define SHELL_CMD_VOLUME_SET "volume set"
#define SHELL_CMD_BRIGHTNESS_GET "brightness get"
#define SHELL_CMD_BRIGHTNESS_SET "brightness set"
#define SHELL_CMD_NOTIF_SET "notif set"
#define SHELL_CMD_AUDIO_AMP_ON "audio_amp on"
#define SHELL_CMD_AUDIO_AMP_OFF "audio_amp off"
#define SHELL_CMD_POWERDOWN "powerdown"
#define SHELL_CMD_POWERDOWN_HANDLE "powerdown handle"
#define SHELL_CMD_INSTANT_PLAY "instant_play"
#define SHELL_CMD_KEYMAP_DEFAULT "keymap default"
#define SHELL_CMD_KEYMAP_RESUME "keymap resume"
////------ Global variables -------
extern int volume_percentage;
extern int brightness_percentage;
extern int stop_menu_loop;
/* stuff implemented by the different sys/ backends */
void vid_begin();
void vid_end();
void vid_flip();
void vid_init();
void vid_preinit();
void vid_close();
void vid_setpal(int i, int r, int g, int b);
void vid_settitle(char *title);
SDL_Surface * vid_getwindow();
void pcm_init();
int pcm_submit();
void pcm_close();
void ev_poll();
void sys_checkdir(char *path, int wr);
void sys_sleep(int us);
void sys_sanitize(char *s);
void joy_init();
void joy_poll();
void joy_close();
void kb_init();
void kb_poll();
void kb_close();
void init_menu_SDL();
void deinit_menu_SDL();
void init_menu_zones();
void init_menu_system_values();
void run_menu_loop();
int launch_resume_menu_loop();
/* FIXME these have different prototype for obsolete ( == M$ ) platforms */
#include <sys/time.h>
int sys_elapsed(struct timeval *prev);
void sys_initpath();
#endif