diff options
author | Sebastian Leonhardt <sebastian.leonhardt@web.de> | 2016-01-08 01:05:36 +0100 |
---|---|---|
committer | Solomon Peachy <pizza@shaftnet.org> | 2024-06-30 17:24:16 -0400 |
commit | 102c3742487dba76ec72d5f56a2c3041344b2d68 (patch) | |
tree | 4931ad34d2cc0bac56d9984b9ead355d012ad63a /apps/plugins/xrick/system/system.h | |
parent | 6f1e67e5e318ba2fd0f5ec1892c7b6633ec6521c (diff) | |
download | rockbox-102c3742487dba76ec72d5f56a2c3041344b2d68.tar.gz rockbox-102c3742487dba76ec72d5f56a2c3041344b2d68.zip |
added xrick game
original xrick code by 'BigOrno' at:
http://www.bigorno.net/xrick/
Rockbox port, plus bugfixes at:
https://github.com/pierluigi-vicinanza/xrick
Further changes:
* Additonal fixes from g#3026
* Port to modern plugin API
* Add Pluginlib keymap fallback
* Support all >1bpp screens
* Fix build warnings in miniz
* Better error message when resources are missing
Change-Id: Id83928bc2539901b0221692f65cbca41389c58e7
Diffstat (limited to 'apps/plugins/xrick/system/system.h')
-rw-r--r-- | apps/plugins/xrick/system/system.h | 178 |
1 files changed, 178 insertions, 0 deletions
diff --git a/apps/plugins/xrick/system/system.h b/apps/plugins/xrick/system/system.h new file mode 100644 index 0000000000..d4dda3d5d4 --- /dev/null +++ b/apps/plugins/xrick/system/system.h | |||
@@ -0,0 +1,178 @@ | |||
1 | /* | ||
2 | * xrick/system/system.h | ||
3 | * | ||
4 | * Copyright (C) 1998-2002 BigOrno (bigorno@bigorno.net). | ||
5 | * Copyright (C) 2008-2014 Pierluigi Vicinanza. | ||
6 | * All rights reserved. | ||
7 | * | ||
8 | * The use and distribution terms for this software are contained in the file | ||
9 | * named README, which can be found in the root of this distribution. By | ||
10 | * using this software in any fashion, you are agreeing to be bound by the | ||
11 | * terms of this license. | ||
12 | * | ||
13 | * You must not remove this notice, or any other, from this software. | ||
14 | */ | ||
15 | |||
16 | #ifndef _SYSTEM_H | ||
17 | #define _SYSTEM_H | ||
18 | |||
19 | /* | ||
20 | * Detect GCC | ||
21 | */ | ||
22 | #ifdef __GNUC__ | ||
23 | /* | ||
24 | * make POSIX functions available | ||
25 | */ | ||
26 | # ifndef _POSIX_SOURCE | ||
27 | # define _POSIX_SOURCE | ||
28 | # endif | ||
29 | #endif | ||
30 | |||
31 | /* | ||
32 | * Detect Microsoft Visual C | ||
33 | */ | ||
34 | #ifdef _MSC_VER | ||
35 | /* | ||
36 | * FIXME disable "integral size mismatch in argument; conversion supplied" warning | ||
37 | * as long as the code has not been cleared -- there are so many of them... | ||
38 | */ | ||
39 | #pragma warning( disable : 4761 ) | ||
40 | #endif | ||
41 | |||
42 | /* | ||
43 | * Detect Microsoft Windows | ||
44 | */ | ||
45 | #if !defined( __WIN32__ ) && ( defined( WIN32 ) || defined( _WIN32 ) ) | ||
46 | #define __WIN32__ | ||
47 | #endif | ||
48 | |||
49 | #include "xrick/config.h" | ||
50 | #include "xrick/rects.h" | ||
51 | #include "xrick/data/img.h" | ||
52 | #ifdef ENABLE_SOUND | ||
53 | #include "xrick/data/sounds.h" | ||
54 | #endif | ||
55 | |||
56 | #include <stddef.h> /* size_t */ | ||
57 | #include <sys/types.h> /* off_t */ | ||
58 | |||
59 | /* | ||
60 | * main section | ||
61 | */ | ||
62 | extern bool sys_init(int, char **); | ||
63 | extern void sys_shutdown(void); | ||
64 | extern void sys_error(const char *, ...); | ||
65 | extern void sys_printf(const char *, ...); | ||
66 | extern void sys_snprintf(char *, size_t, const char *, ...); | ||
67 | extern size_t sys_strlen(const char *); | ||
68 | extern U32 sys_gettime(void); | ||
69 | extern void sys_yield(void); | ||
70 | extern bool sys_cacheData(void); | ||
71 | extern void sys_uncacheData(void); | ||
72 | |||
73 | /* | ||
74 | * memory section | ||
75 | */ | ||
76 | extern bool sysmem_init(void); | ||
77 | extern void sysmem_shutdown(void); | ||
78 | extern void *sysmem_push(size_t); | ||
79 | extern void sysmem_pop(void *); | ||
80 | |||
81 | /* | ||
82 | * video section | ||
83 | */ | ||
84 | #define SYSVID_ZOOM 2 | ||
85 | #define SYSVID_MAXZOOM 4 | ||
86 | #define SYSVID_WIDTH 320 | ||
87 | #define SYSVID_HEIGHT 200 | ||
88 | |||
89 | extern U8 *sysvid_fb; /* frame buffer */ | ||
90 | |||
91 | extern bool sysvid_init(void); | ||
92 | extern void sysvid_shutdown(void); | ||
93 | extern void sysvid_update(const rect_t *); | ||
94 | extern void sysvid_clear(void); | ||
95 | extern void sysvid_zoom(S8); | ||
96 | extern void sysvid_toggleFullscreen(void); | ||
97 | extern void sysvid_setGamePalette(void); | ||
98 | extern void sysvid_setPalette(img_color_t *, U16); | ||
99 | |||
100 | /* | ||
101 | * file management section | ||
102 | */ | ||
103 | typedef void *file_t; | ||
104 | |||
105 | extern const char *sysfile_defaultPath; | ||
106 | |||
107 | extern bool sysfile_setRootPath(const char *); | ||
108 | extern void sysfile_clearRootPath(void); | ||
109 | |||
110 | extern file_t sysfile_open(const char *); | ||
111 | extern int sysfile_seek(file_t file, long offset, int origin); | ||
112 | extern int sysfile_tell(file_t); | ||
113 | extern off_t sysfile_size(file_t); | ||
114 | extern int sysfile_read(file_t, void *, size_t, size_t); | ||
115 | extern void sysfile_close(file_t); | ||
116 | |||
117 | /* | ||
118 | * events section | ||
119 | */ | ||
120 | extern void sysevt_poll(void); | ||
121 | extern void sysevt_wait(void); | ||
122 | |||
123 | /* | ||
124 | * keyboard section | ||
125 | */ | ||
126 | extern U8 syskbd_up; | ||
127 | extern U8 syskbd_down; | ||
128 | extern U8 syskbd_left; | ||
129 | extern U8 syskbd_right; | ||
130 | extern U8 syskbd_pause; | ||
131 | extern U8 syskbd_end; | ||
132 | extern U8 syskbd_xtra; | ||
133 | extern U8 syskbd_fire; | ||
134 | |||
135 | /* | ||
136 | * sound section | ||
137 | */ | ||
138 | #ifdef ENABLE_SOUND | ||
139 | extern const U8 syssnd_period; /* time between each sound update, in millisecond */ | ||
140 | |||
141 | extern bool syssnd_init(void); | ||
142 | extern void syssnd_shutdown(void); | ||
143 | extern void syssnd_update(void); | ||
144 | extern void syssnd_vol(S8); | ||
145 | extern void syssnd_toggleMute(void); | ||
146 | extern void syssnd_play(sound_t *, S8); | ||
147 | extern void syssnd_pauseAll(bool); | ||
148 | extern void syssnd_stop(sound_t *); | ||
149 | extern void syssnd_stopAll(void); | ||
150 | #endif /* ENABLE_ SOUND */ | ||
151 | |||
152 | /* | ||
153 | * args section | ||
154 | */ | ||
155 | extern int sysarg_args_period; | ||
156 | extern int sysarg_args_map; | ||
157 | extern int sysarg_args_submap; | ||
158 | extern int sysarg_args_fullscreen; | ||
159 | extern int sysarg_args_zoom; | ||
160 | #ifdef ENABLE_SOUND | ||
161 | extern bool sysarg_args_nosound; | ||
162 | extern int sysarg_args_vol; | ||
163 | #endif /* ENABLE_ SOUND */ | ||
164 | extern const char *sysarg_args_data; | ||
165 | |||
166 | extern bool sysarg_init(int, char **); | ||
167 | |||
168 | /* | ||
169 | * joystick section | ||
170 | */ | ||
171 | #ifdef ENABLE_JOYSTICK | ||
172 | extern bool sysjoy_init(void); | ||
173 | extern void sysjoy_shutdown(void); | ||
174 | #endif | ||
175 | |||
176 | #endif /* ndef _SYSTEM_H */ | ||
177 | |||
178 | /* eof */ | ||