1 /* gngb, a game boy color emulator 2 * Copyright (C) 2001 Peponas Thomas & Peponas Mathieu 3 * 4 * This program is free software; you can redistribute it and/or modify 5 * it under the terms of the GNU General Public License as published by 6 * the Free Software Foundation; either version 2 of the License, or 7 * (at your option) any later version. 8 * 9 * This program is distributed in the hope that it will be useful, 10 * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 * GNU Library General Public License for more details. 13 * 14 * You should have received a copy of the GNU General Public License 15 * along with this program; if not, write to the Free Software 16 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 17 */ 18 19 #ifndef EMU_H 20 #define EMU_H 21 22 #include "global.h" 23 #include <SDL_keysym.h> 24 #include <stdlib.h> 25 #include "fileio.h" 26 27 // GAMEBOY TYPE 28 29 #define UNKNOW 0x00 30 #define NORMAL_GAMEBOY 0x01 31 #define SUPER_GAMEBOY 0x02 32 #define COLOR_GAMEBOY 0x04 33 #define COLOR_GAMEBOY_ONLY 0x0c 34 35 typedef struct { 36 int autoframeskip; /* auto frameskip */ 37 int throttle; 38 int sleep_idle; 39 40 int fs; /* fullscreen */ 41 int sound; 42 int color_filter; 43 int rumble_on; 44 int serial_on; 45 int gb_done; 46 int joy_no; 47 int use_joy; 48 int gl; 49 int yuv; 50 int yuv_type; 51 int video_flag; 52 int filter; 53 int delay_int; 54 int show_fps; 55 int show_keycode; 56 int res_w,res_h; 57 int yuv_interline_int; 58 int sample_rate; 59 int gb_type; 60 int const_cycle; 61 int gdma_cycle; 62 int save_movie; 63 int play_movie; 64 Sint32 pal[5][4]; 65 }GNGB_CONF; 66 67 extern GNGB_CONF conf; 68 69 extern SDL_Joystick *sdl_joy; 70 71 extern Uint16 key[SDLK_LAST]; 72 extern Sint16 *joy_axis; 73 extern Uint8 *joy_but; 74 75 #define PAD_UP 0 76 #define PAD_DOWN 1 77 #define PAD_LEFT 2 78 #define PAD_RIGHT 3 79 #define PAD_A 4 80 #define PAD_B 5 81 #define PAD_START 6 82 #define PAD_SELECT 7 83 84 extern Uint8 jmap[8]; 85 extern Uint16 kmap[8]; 86 87 /* Movie */ 88 89 typedef struct _pad_save { 90 Uint8 pad; 91 struct _pad_save *next; 92 }PAD_SAVE; 93 94 typedef struct _gngb_movie { 95 char name[256]; 96 int len; 97 GNGB_FILE *stream; 98 PAD_SAVE *first_pad; 99 PAD_SAVE *last_pad; 100 }GNGB_MOVIE; 101 102 extern GNGB_MOVIE gngb_movie; 103 104 void print_help(void); 105 106 void setup_default_conf(void); 107 void open_conf(void); 108 void check_option(int argc,char *argv[]); 109 void update_key(void); 110 111 void emu_init(void); 112 void emu_run(void); 113 void emu_reset(void); 114 void emu_pause(void); 115 void emu_quit(void); 116 117 #endif 118 119 120