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 JNB_HEIGHT 256
40 #define KEY_PL1_LEFT 0xcb
41 #define KEY_PL1_RIGHT 0xcd
42 #define KEY_PL1_JUMP 0xc8
43 #define KEY_PL2_LEFT 0x1e
44 #define KEY_PL2_RIGHT 0x20
45 #define KEY_PL2_JUMP 0x11
47 #define KEY_PL1_LEFT SDLK_LEFT
48 #define KEY_PL1_RIGHT SDLK_RIGHT
49 #define KEY_PL1_JUMP SDLK_UP
50 #define KEY_PL2_LEFT SDLK_a
51 #define KEY_PL2_RIGHT SDLK_d
52 #define KEY_PL2_JUMP SDLK_w
53 #define KEY_PL3_LEFT SDLK_j
54 #define KEY_PL3_RIGHT SDLK_l
55 #define KEY_PL3_JUMP SDLK_i
56 #define KEY_PL4_LEFT SDLK_KP4
57 #define KEY_PL4_RIGHT SDLK_KP6
58 #define KEY_PL4_JUMP SDLK_KP8
62 #define NUM_OBJECTS 200
64 #define NUM_LEFTOVERS 50
69 #define OBJ_YEL_BUTFLY 3
70 #define OBJ_PINK_BUTFLY 4
73 #define OBJ_FLESH_TRACE 7
75 #define OBJ_ANIM_SPRING 0
76 #define OBJ_ANIM_SPLASH 1
77 #define OBJ_ANIM_SMOKE 2
78 #define OBJ_ANIM_YEL_BUTFLY_RIGHT 3
79 #define OBJ_ANIM_YEL_BUTFLY_LEFT 4
80 #define OBJ_ANIM_PINK_BUTFLY_RIGHT 5
81 #define OBJ_ANIM_PINK_BUTFLY_LEFT 6
82 #define OBJ_ANIM_FLESH_TRACE 7
97 #define SFX_JUMP_FREQ 15000
98 #define SFX_LAND_FREQ 15000
99 #define SFX_DEATH_FREQ 20000
100 #define SFX_SPRING_FREQ 15000
101 #define SFX_SPLASH_FREQ 12000
102 #define SFX_FLY_FREQ 12000
112 int joy_enabled, mouse_enabled;
113 int no_sound, no_gore, fireworks;
115 int draw_page, view_page;
125 char *pob_backbuf[2];
129 int action_left,action_up,action_right;
130 int enabled, dead_flag;
135 char direction, jump_ready, jump_abort, in_water;
136 int anim, frame, frame_tick, image;
156 } objects[NUM_OBJECTS];
169 int but1, but2, but3;
172 char datfile_name[2048];
174 char *background_pic;
183 void fireworks(void);
188 void steer_players(void);
189 void position_player(int player_num);
190 void fireworks(void);
191 void add_object(int type, int x, int y, int x_add, int y_add, int anim, int frame);
192 void update_objects(void);
193 int add_pob(int page, int x, int y, int image, char *pob_data);
194 void draw_flies(int page);
195 void draw_pobs(int page);
196 void redraw_flies_background(int page);
197 void redraw_pob_backgrounds(int page);
198 int add_leftovers(int page, int x, int y, int image, char *pob_data);
199 void draw_leftovers(int page);
200 int init_level(int level, char *pal);
201 void deinit_level(void);
202 int init_program(int argc, char *argv[], char *pal);
203 void deinit_program(void);
204 unsigned short rnd(unsigned short max);
205 int read_level(void);
206 FILE *dat_open(char *file_name, char *dat_name, char *mode);
207 int dat_filelen(char *file_name, char *dat_name);
208 void write_calib_data(void);
213 void update_player_actions(void);
214 void init_inputs(void);
215 int calib_joy(char type);
221 void menu_deinit(void);
226 void open_screen(void);
227 void wait_vrt(int mix);
228 void flippage(int page);
229 void clear_page(int page, int color);
230 void clear_lines(int page, int y, int count, int color);
231 int get_pixel(int page, int x, int y);
232 void set_pixel(int page, int x, int y, int color);
233 void setpalette(int index, int count, char *palette);
234 void fillpalette(int red, int green, int blue);
236 void get_block(char page, short x, short y, short width, short height, char *buffer);
237 void put_block(char page, short x, short y, short width, short height, char *buffer);
239 void get_block(int page, int x, int y, int width, int height, char *buffer);
240 void put_block(int page, int x, int y, int width, int height, char *buffer);
242 void put_text(int page, int x, int y, char *text, int align);
243 void put_pob(int page, int x, int y, int image, char *pob_data, int mask, char *mask_pic);
244 int pob_col(int x1, int y1, int image1, char *pob_data1, int x2, int y2, int image2, char *pob_data2);
245 int pob_width(int image, char *pob_data);
246 int pob_height(int image, char *pob_data);
247 int pob_hs_x(int image, char *pob_data);
248 int pob_hs_y(int image, char *pob_data);
249 int read_pcx(FILE * handle, char *buffer, int buf_len, char *pal);
255 long filelength(int handle);
258 int intr_sysupdate();
263 extern char last_keys[50];
265 int hook_keyb_handler(void);
266 void remove_keyb_handler(void);
267 int key_pressed(int key);