20 # include <sys/nearptr.h>
25 # include <sys/stat.h>
28 # include <SDL_mixer.h>
31 # include <sys/stat.h>
33 # include <SDL/SDL_mixer.h>
38 #define JNB_HEIGHT 256
41 #define KEY_PL1_LEFT 0xcb
42 #define KEY_PL1_RIGHT 0xcd
43 #define KEY_PL1_JUMP 0xc8
44 #define KEY_PL2_LEFT 0x1e
45 #define KEY_PL2_RIGHT 0x20
46 #define KEY_PL2_JUMP 0x11
48 #define KEY_PL1_LEFT SDLK_LEFT
49 #define KEY_PL1_RIGHT SDLK_RIGHT
50 #define KEY_PL1_JUMP SDLK_UP
51 #define KEY_PL2_LEFT SDLK_a
52 #define KEY_PL2_RIGHT SDLK_d
53 #define KEY_PL2_JUMP SDLK_w
54 #define KEY_PL3_LEFT SDLK_j
55 #define KEY_PL3_RIGHT SDLK_l
56 #define KEY_PL3_JUMP SDLK_i
57 #define KEY_PL4_LEFT SDLK_KP4
58 #define KEY_PL4_RIGHT SDLK_KP6
59 #define KEY_PL4_JUMP SDLK_KP8
63 #define NUM_OBJECTS 200
65 #define NUM_LEFTOVERS 50
70 #define OBJ_YEL_BUTFLY 3
71 #define OBJ_PINK_BUTFLY 4
74 #define OBJ_FLESH_TRACE 7
76 #define OBJ_ANIM_SPRING 0
77 #define OBJ_ANIM_SPLASH 1
78 #define OBJ_ANIM_SMOKE 2
79 #define OBJ_ANIM_YEL_BUTFLY_RIGHT 3
80 #define OBJ_ANIM_YEL_BUTFLY_LEFT 4
81 #define OBJ_ANIM_PINK_BUTFLY_RIGHT 5
82 #define OBJ_ANIM_PINK_BUTFLY_LEFT 6
83 #define OBJ_ANIM_FLESH_TRACE 7
98 #define SFX_JUMP_FREQ 15000
99 #define SFX_LAND_FREQ 15000
100 #define SFX_DEATH_FREQ 20000
101 #define SFX_SPRING_FREQ 15000
102 #define SFX_SPLASH_FREQ 12000
103 #define SFX_FLY_FREQ 12000
113 int joy_enabled, mouse_enabled;
114 int no_sound, no_gore, fireworks;
116 int draw_page, view_page;
126 char *pob_backbuf[2];
130 int action_left,action_up,action_right;
131 int enabled, dead_flag;
136 char direction, jump_ready, jump_abort, in_water;
137 int anim, frame, frame_tick, image;
157 } objects[NUM_OBJECTS];
170 int but1, but2, but3;
173 char datfile_name[2048];
175 char *background_pic;
184 void fireworks(void);
189 void steer_players(void);
190 void position_player(int player_num);
191 void fireworks(void);
192 void add_object(int type, int x, int y, int x_add, int y_add, int anim, int frame);
193 void update_objects(void);
194 int add_pob(int page, int x, int y, int image, char *pob_data);
195 void draw_flies(int page);
196 void draw_pobs(int page);
197 void redraw_flies_background(int page);
198 void redraw_pob_backgrounds(int page);
199 int add_leftovers(int page, int x, int y, int image, char *pob_data);
200 void draw_leftovers(int page);
201 int init_level(int level, char *pal);
202 void deinit_level(void);
203 int init_program(int argc, char *argv[], char *pal);
204 void deinit_program(void);
205 unsigned short rnd(unsigned short max);
206 int read_level(void);
207 FILE *dat_open(char *file_name, char *dat_name, char *mode);
208 int dat_filelen(char *file_name, char *dat_name);
209 void write_calib_data(void);
214 void update_player_actions(void);
215 void init_inputs(void);
216 int calib_joy(char type);
222 void menu_deinit(void);
227 void open_screen(void);
228 void wait_vrt(int mix);
229 void draw_begin(void);
231 void flippage(int page);
232 void draw_begin(void);
234 void clear_lines(int page, int y, int count, int color);
235 int get_pixel(int page, int x, int y);
236 void set_pixel(int page, int x, int y, int color);
237 void setpalette(int index, int count, char *palette);
238 void fillpalette(int red, int green, int blue);
240 void get_block(char page, short x, short y, short width, short height, char *buffer);
241 void put_block(char page, short x, short y, short width, short height, char *buffer);
243 void get_block(int page, int x, int y, int width, int height, char *buffer);
244 void put_block(int page, int x, int y, int width, int height, char *buffer);
246 void put_text(int page, int x, int y, char *text, int align);
247 void put_pob(int page, int x, int y, int image, char *pob_data, int mask, char *mask_pic);
248 int pob_col(int x1, int y1, int image1, char *pob_data1, int x2, int y2, int image2, char *pob_data2);
249 int pob_width(int image, char *pob_data);
250 int pob_height(int image, char *pob_data);
251 int pob_hs_x(int image, char *pob_data);
252 int pob_hs_y(int image, char *pob_data);
253 int read_pcx(FILE * handle, char *buffer, int buf_len, char *pal);
254 void register_background(char *pixels);
260 long filelength(int handle);
263 int intr_sysupdate();
268 extern char last_keys[50];
270 int hook_keyb_handler(void);
271 void remove_keyb_handler(void);
272 int key_pressed(int key);