2010-09-25 17:46:12 +02:00
|
|
|
#ifndef __GTK_CONFIG_H
|
|
|
|
#define __GTK_CONFIG_H
|
|
|
|
|
2010-09-26 11:19:15 +02:00
|
|
|
#include <sys/time.h>
|
2010-09-25 17:46:12 +02:00
|
|
|
#include <libxml/parser.h>
|
|
|
|
#include <X11/Xlib.h>
|
|
|
|
#include <X11/extensions/Xrandr.h>
|
|
|
|
|
|
|
|
#include "gtk_control.h"
|
|
|
|
#include "snes_ntsc.h"
|
|
|
|
|
|
|
|
#define HWA_NONE 0
|
|
|
|
#define HWA_OPENGL 1
|
|
|
|
#define HWA_XV 2
|
|
|
|
|
2011-01-23 23:25:46 +01:00
|
|
|
#define HIRES_MERGE 0
|
|
|
|
#define HIRES_NORMAL 1
|
|
|
|
#define HIRES_SCALE 2
|
|
|
|
|
2010-09-25 17:46:12 +02:00
|
|
|
#define ESC_TOGGLE_MENUBAR 0
|
|
|
|
#define ESC_EXIT_FULLSCREEN 1
|
|
|
|
#define ESC_EXIT_SNES9X 2
|
|
|
|
|
|
|
|
class Snes9xConfig
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
Snes9xConfig (void);
|
|
|
|
int load_config_file (void);
|
|
|
|
int save_config_file (void);
|
|
|
|
int load_defaults (void);
|
|
|
|
void reconfigure (void);
|
|
|
|
void rebind_keys (void);
|
|
|
|
|
|
|
|
/* XML parsers */
|
|
|
|
int parse_snes9x (xmlNodePtr node);
|
|
|
|
int parse_preferences (xmlNodePtr node);
|
|
|
|
int parse_option (xmlNodePtr node);
|
|
|
|
int parse_joypad (xmlNodePtr node);
|
|
|
|
int parse_binding (xmlNodePtr node, int joypad_number);
|
|
|
|
int parse_controls (xmlNodePtr node);
|
|
|
|
int set_option (const char *name, const char *value);
|
|
|
|
|
|
|
|
#ifdef USE_JOYSTICK
|
|
|
|
void flush_joysticks (void);
|
|
|
|
void set_joystick_mode (int mode);
|
|
|
|
void joystick_register_centers (void);
|
|
|
|
int parse_calibration (xmlNodePtr node);
|
|
|
|
int parse_axis (xmlNodePtr node, int joystick_number);
|
|
|
|
#endif
|
|
|
|
|
|
|
|
/* Screen options */
|
|
|
|
unsigned char full_screen_on_open;
|
|
|
|
unsigned char change_display_resolution;
|
|
|
|
unsigned char fullscreen;
|
|
|
|
unsigned char ui_visible;
|
|
|
|
unsigned char statusbar_visible;
|
|
|
|
unsigned char default_esc_behavior;
|
|
|
|
unsigned char prevent_screensaver;
|
2018-04-29 01:36:40 +02:00
|
|
|
int xrr_index;
|
2010-09-25 17:46:12 +02:00
|
|
|
unsigned char scale_to_fit;
|
|
|
|
unsigned char maintain_aspect_ratio;
|
|
|
|
int aspect_ratio;
|
|
|
|
unsigned int scale_method;
|
|
|
|
unsigned char overscan;
|
|
|
|
unsigned char multithreading;
|
2011-01-23 23:25:46 +01:00
|
|
|
int hires_effect;
|
2010-09-25 17:46:12 +02:00
|
|
|
unsigned char force_inverted_byte_order;
|
|
|
|
|
|
|
|
snes_ntsc_setup_t ntsc_setup;
|
|
|
|
unsigned char ntsc_format;
|
|
|
|
float ntsc_hue;
|
|
|
|
float ntsc_saturation;
|
|
|
|
float ntsc_contrast;
|
|
|
|
float ntsc_brightness;
|
|
|
|
float ntsc_sharpness;
|
|
|
|
float ntsc_artifacts;
|
|
|
|
float ntsc_gamma;
|
|
|
|
float ntsc_resolution;
|
|
|
|
float ntsc_fringing;
|
|
|
|
float ntsc_bleed;
|
|
|
|
float ntsc_merge_fields;
|
|
|
|
unsigned int ntsc_scanline_intensity;
|
|
|
|
unsigned int scanline_filter_intensity;
|
2010-11-18 13:31:27 +01:00
|
|
|
unsigned char bilinear_filter;
|
2010-09-25 17:46:12 +02:00
|
|
|
unsigned char hw_accel;
|
|
|
|
unsigned char allow_opengl;
|
|
|
|
unsigned char allow_xv;
|
|
|
|
unsigned char allow_xrandr;
|
|
|
|
|
|
|
|
/* Data options */
|
|
|
|
unsigned char save_sram_after_secs;
|
2010-09-26 11:19:15 +02:00
|
|
|
char sram_directory [PATH_MAX];
|
|
|
|
char savestate_directory [PATH_MAX];
|
|
|
|
char cheat_directory [PATH_MAX];
|
|
|
|
char patch_directory [PATH_MAX];
|
|
|
|
char export_directory [PATH_MAX];
|
2010-09-25 17:46:12 +02:00
|
|
|
char last_directory [PATH_MAX];
|
|
|
|
|
|
|
|
/* Controls */
|
|
|
|
JoypadBinding pad[NUM_JOYPADS];
|
|
|
|
Binding shortcut[NUM_EMU_LINKS];
|
|
|
|
|
|
|
|
/* Netplay */
|
|
|
|
int netplay_is_server;
|
|
|
|
int netplay_sync_reset;
|
|
|
|
int netplay_send_rom;
|
|
|
|
int netplay_default_port;
|
|
|
|
int netplay_max_frame_loss;
|
|
|
|
char netplay_last_rom [PATH_MAX];
|
|
|
|
char netplay_last_host [PATH_MAX];
|
|
|
|
int netplay_last_port;
|
|
|
|
int netplay_activated;
|
|
|
|
int netplay_server_up;
|
|
|
|
|
|
|
|
/* Operational */
|
|
|
|
int sound_driver;
|
|
|
|
int mute_sound;
|
2016-08-02 17:31:05 +02:00
|
|
|
int mute_sound_turbo;
|
2010-09-25 17:46:12 +02:00
|
|
|
int sound_buffer_size;
|
|
|
|
int sound_playback_rate;
|
2018-05-02 23:53:54 +02:00
|
|
|
int auto_input_rate;
|
2010-09-25 17:46:12 +02:00
|
|
|
int sound_input_rate;
|
|
|
|
int rom_loaded;
|
|
|
|
int window_width, window_height;
|
|
|
|
int preferences_width, preferences_height;
|
|
|
|
int pause_emulation_on_switch;
|
|
|
|
int num_threads;
|
|
|
|
unsigned char screensaver_needs_reset;
|
2010-10-30 16:21:26 +02:00
|
|
|
int modal_dialogs;
|
2010-09-25 17:46:12 +02:00
|
|
|
|
2010-09-26 11:19:15 +02:00
|
|
|
int pointer_is_visible;
|
|
|
|
struct timeval pointer_timestamp;
|
2014-06-27 10:36:36 +02:00
|
|
|
|
2016-10-09 04:33:34 +02:00
|
|
|
unsigned int rewind_granularity;
|
|
|
|
unsigned int rewind_buffer_size;
|
2010-09-26 11:19:15 +02:00
|
|
|
|
2018-04-29 01:36:40 +02:00
|
|
|
XRRScreenResources *xrr_screen_resources;
|
|
|
|
XRRCrtcInfo *xrr_crtc_info;
|
2010-09-25 17:46:12 +02:00
|
|
|
|
|
|
|
#ifdef USE_OPENGL
|
|
|
|
unsigned char sync_to_vblank;
|
|
|
|
unsigned char opengl_activated;
|
|
|
|
unsigned char use_pbos;
|
|
|
|
int pbo_format;
|
|
|
|
unsigned char npot_textures;
|
2010-09-26 11:19:15 +02:00
|
|
|
unsigned char use_shaders;
|
|
|
|
char fragment_shader[PATH_MAX];
|
|
|
|
char vertex_shader[PATH_MAX];
|
|
|
|
unsigned char sync_every_frame;
|
2010-09-25 17:46:12 +02:00
|
|
|
#endif
|
|
|
|
|
|
|
|
#ifdef USE_JOYSTICK
|
|
|
|
JoyDevice **joystick;
|
|
|
|
int joystick_threshold;
|
|
|
|
#endif
|
|
|
|
|
|
|
|
};
|
|
|
|
|
|
|
|
char *get_config_dir (void);
|
|
|
|
char *get_config_file_name (void);
|
|
|
|
|
|
|
|
#endif /* __GTK_CONFIG_H */
|