19 # include <sys/nearptr.h>
24 # include <sys/stat.h>
27 # include <SDL_mixer.h>
30 # include <sys/stat.h>
32 # include <SDL/SDL_mixer.h>
37 #define KEY_PL1_LEFT 0xcb
38 #define KEY_PL1_RIGHT 0xcd
39 #define KEY_PL1_JUMP 0xc8
40 #define KEY_PL2_LEFT 0x1e
41 #define KEY_PL2_RIGHT 0x20
42 #define KEY_PL2_JUMP 0x11
44 #define KEY_PL1_LEFT SDLK_LEFT
45 #define KEY_PL1_RIGHT SDLK_RIGHT
46 #define KEY_PL1_JUMP SDLK_UP
47 #define KEY_PL2_LEFT SDLK_a
48 #define KEY_PL2_RIGHT SDLK_d
49 #define KEY_PL2_JUMP SDLK_w
50 #define KEY_PL3_LEFT SDLK_j
51 #define KEY_PL3_RIGHT SDLK_l
52 #define KEY_PL3_JUMP SDLK_i
53 #define KEY_PL4_LEFT SDLK_KP4
54 #define KEY_PL4_RIGHT SDLK_KP6
55 #define KEY_PL4_JUMP SDLK_KP8
59 #define NUM_OBJECTS 200
61 #define NUM_LEFTOVERS 50
66 #define OBJ_YEL_BUTFLY 3
67 #define OBJ_PINK_BUTFLY 4
70 #define OBJ_FLESH_TRACE 7
72 #define OBJ_ANIM_SPRING 0
73 #define OBJ_ANIM_SPLASH 1
74 #define OBJ_ANIM_SMOKE 2
75 #define OBJ_ANIM_YEL_BUTFLY_RIGHT 3
76 #define OBJ_ANIM_YEL_BUTFLY_LEFT 4
77 #define OBJ_ANIM_PINK_BUTFLY_RIGHT 5
78 #define OBJ_ANIM_PINK_BUTFLY_LEFT 6
79 #define OBJ_ANIM_FLESH_TRACE 7
92 #define SFX_JUMP_FREQ 15000
93 #define SFX_LAND_FREQ 15000
94 #define SFX_DEATH_FREQ 20000
95 #define SFX_SPRING_FREQ 15000
96 #define SFX_SPLASH_FREQ 12000
97 #define SFX_FLY_FREQ 12000
101 int joy_enabled, mouse_enabled;
102 int no_sound, no_gore, fireworks;
104 int draw_page, view_page;
114 char *pob_backbuf[2];
118 int action_left,action_up,action_right;
119 int enabled, dead_flag;
124 char direction, jump_ready, jump_abort, in_water;
125 int anim, frame, frame_tick, image;
158 int but1, but2, but3;
161 char datfile_name[2048];
163 char *background_pic;
172 void fireworks(void);
177 void steer_players(void);
178 void position_player(int player_num);
179 void fireworks(void);
180 void add_object(int type, int x, int y, int x_add, int y_add, int anim, int frame);
181 void update_objects(void);
182 int add_pob(int page, int x, int y, int image, char *pob_data);
183 void draw_flies(int page);
184 void draw_pobs(int page);
185 void redraw_flies_background(int page);
186 void redraw_pob_backgrounds(int page);
187 int add_leftovers(int page, int x, int y, int image, char *pob_data);
188 void draw_leftovers(int page);
189 int init_level(int level, char *pal);
190 void deinit_level(void);
191 int init_program(int argc, char *argv[], char *pal);
192 void deinit_program(void);
193 unsigned short rnd(unsigned short max);
194 int read_level(void);
195 FILE *dat_open(char *file_name, char *dat_name, char *mode);
196 int dat_filelen(char *file_name, char *dat_name);
197 void write_calib_data(void);
202 void update_player_actions(void);
203 void init_inputs(void);
204 int calib_joy(char type);
210 void menu_deinit(void);
215 void open_screen(void);
216 void wait_vrt(int mix);
217 void flippage(int page);
218 void clear_page(int page, int color);
219 void clear_lines(int page, int y, int count, int color);
220 void setpalette(int index, int count, char *palette);
221 void fillpalette(int red, int green, int blue);
223 void get_block(char page, short x, short y, short width, short height, char *buffer);
224 void put_block(char page, short x, short y, short width, short height, char *buffer);
226 void get_block(int page, int x, int y, int width, int height, char *buffer);
227 void put_block(int page, int x, int y, int width, int height, char *buffer);
229 void put_text(int page, int x, int y, char *text, int align);
230 void put_pob(int page, int x, int y, int image, char *pob_data, int mask, char *mask_pic);
231 int pob_col(int x1, int y1, int image1, char *pob_data1, int x2, int y2, int image2, char *pob_data2);
232 int pob_width(int image, char *pob_data);
233 int pob_height(int image, char *pob_data);
234 int pob_hs_x(int image, char *pob_data);
235 int pob_hs_y(int image, char *pob_data);
236 int read_pcx(FILE * handle, char *buffer, int buf_len, char *pal);
242 long filelength(int handle);
245 char *get_vgaptr(int, int, int);
246 int intr_sysupdate();
251 extern char last_keys[50];
253 int hook_keyb_handler(void);
254 void remove_keyb_handler(void);
255 int key_pressed(int key);