summaryrefslogtreecommitdiff
path: root/apps/plugins/xrick/system/system.h
diff options
context:
space:
mode:
Diffstat (limited to 'apps/plugins/xrick/system/system.h')
-rw-r--r--apps/plugins/xrick/system/system.h178
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 */
62extern bool sys_init(int, char **);
63extern void sys_shutdown(void);
64extern void sys_error(const char *, ...);
65extern void sys_printf(const char *, ...);
66extern void sys_snprintf(char *, size_t, const char *, ...);
67extern size_t sys_strlen(const char *);
68extern U32 sys_gettime(void);
69extern void sys_yield(void);
70extern bool sys_cacheData(void);
71extern void sys_uncacheData(void);
72
73/*
74 * memory section
75 */
76extern bool sysmem_init(void);
77extern void sysmem_shutdown(void);
78extern void *sysmem_push(size_t);
79extern 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
89extern U8 *sysvid_fb; /* frame buffer */
90
91extern bool sysvid_init(void);
92extern void sysvid_shutdown(void);
93extern void sysvid_update(const rect_t *);
94extern void sysvid_clear(void);
95extern void sysvid_zoom(S8);
96extern void sysvid_toggleFullscreen(void);
97extern void sysvid_setGamePalette(void);
98extern void sysvid_setPalette(img_color_t *, U16);
99
100/*
101 * file management section
102 */
103typedef void *file_t;
104
105extern const char *sysfile_defaultPath;
106
107extern bool sysfile_setRootPath(const char *);
108extern void sysfile_clearRootPath(void);
109
110extern file_t sysfile_open(const char *);
111extern int sysfile_seek(file_t file, long offset, int origin);
112extern int sysfile_tell(file_t);
113extern off_t sysfile_size(file_t);
114extern int sysfile_read(file_t, void *, size_t, size_t);
115extern void sysfile_close(file_t);
116
117/*
118 * events section
119 */
120extern void sysevt_poll(void);
121extern void sysevt_wait(void);
122
123/*
124 * keyboard section
125 */
126extern U8 syskbd_up;
127extern U8 syskbd_down;
128extern U8 syskbd_left;
129extern U8 syskbd_right;
130extern U8 syskbd_pause;
131extern U8 syskbd_end;
132extern U8 syskbd_xtra;
133extern U8 syskbd_fire;
134
135/*
136 * sound section
137 */
138#ifdef ENABLE_SOUND
139extern const U8 syssnd_period; /* time between each sound update, in millisecond */
140
141extern bool syssnd_init(void);
142extern void syssnd_shutdown(void);
143extern void syssnd_update(void);
144extern void syssnd_vol(S8);
145extern void syssnd_toggleMute(void);
146extern void syssnd_play(sound_t *, S8);
147extern void syssnd_pauseAll(bool);
148extern void syssnd_stop(sound_t *);
149extern void syssnd_stopAll(void);
150#endif /* ENABLE_ SOUND */
151
152/*
153 * args section
154 */
155extern int sysarg_args_period;
156extern int sysarg_args_map;
157extern int sysarg_args_submap;
158extern int sysarg_args_fullscreen;
159extern int sysarg_args_zoom;
160#ifdef ENABLE_SOUND
161extern bool sysarg_args_nosound;
162extern int sysarg_args_vol;
163#endif /* ENABLE_ SOUND */
164extern const char *sysarg_args_data;
165
166extern bool sysarg_init(int, char **);
167
168/*
169 * joystick section
170 */
171#ifdef ENABLE_JOYSTICK
172extern bool sysjoy_init(void);
173extern void sysjoy_shutdown(void);
174#endif
175
176#endif /* ndef _SYSTEM_H */
177
178/* eof */