GTK+: Use lowercase true/false, bool in more places.

This commit is contained in:
Brandon Wright 2018-12-28 16:32:32 -06:00
parent 3eea50654f
commit fcdead0028
36 changed files with 441 additions and 453 deletions

View File

@ -26,8 +26,8 @@
#else // GTK+ 2.0 #else // GTK+ 2.0
#define GDK_WINDOWING_X11 #define GDK_WINDOWING_X11
#define GDK_IS_X11_WINDOW(window) TRUE #define GDK_IS_X11_WINDOW(window) true
#define GDK_IS_X11_DISPLAY(display) TRUE #define GDK_IS_X11_DISPLAY(display) true
#define gdk_x11_window_get_xid(window) GDK_WINDOW_XWINDOW (window) #define gdk_x11_window_get_xid(window) GDK_WINDOW_XWINDOW (window)
inline void gdk_window_get_geometry (GdkWindow *window, inline void gdk_window_get_geometry (GdkWindow *window,

View File

@ -98,7 +98,7 @@ GtkBuilderWindow::signal_connect (GtkBuilderWindowCallbacks *callbacks)
} }
void void
GtkBuilderWindow::enable_widget (const char *name, unsigned char state) GtkBuilderWindow::enable_widget (const char *name, bool state)
{ {
gtk_widget_set_sensitive (get_widget (name), state); gtk_widget_set_sensitive (get_widget (name), state);
} }
@ -150,8 +150,7 @@ GtkBuilderWindow::get_check (const char *name)
return 0; return 0;
} }
unsigned int int GtkBuilderWindow::get_entry_value(const char *name)
GtkBuilderWindow::get_entry_value (const char *name)
{ {
return atoi (gtk_entry_get_text (GTK_ENTRY (get_widget (name))));; return atoi (gtk_entry_get_text (GTK_ENTRY (get_widget (name))));;
} }
@ -181,7 +180,7 @@ GtkBuilderWindow::set_slider (const char *name, float value)
} }
void void
GtkBuilderWindow::set_check (const char *name, unsigned char value) GtkBuilderWindow::set_check (const char *name, bool value)
{ {
gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (get_widget (name)), gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (get_widget (name)),
value); value);
@ -245,8 +244,7 @@ GtkBuilderWindow::get_spin (const char *name)
return gtk_spin_button_get_value (GTK_SPIN_BUTTON (get_widget (name))); return gtk_spin_button_get_value (GTK_SPIN_BUTTON (get_widget (name)));
} }
int bool GtkBuilderWindow::has_focus(const char *widget)
GtkBuilderWindow::has_focus (const char *widget)
{ {
return gtk_widget_is_focus (get_widget (widget)); return gtk_widget_is_focus (get_widget (widget));
} }

View File

@ -28,23 +28,23 @@ class GtkBuilderWindow
int get_height (); int get_height ();
void signal_connect (GtkBuilderWindowCallbacks *callbacks); void signal_connect (GtkBuilderWindowCallbacks *callbacks);
void enable_widget (const char *name, unsigned char state); void enable_widget (const char *name, bool state);
void set_button_label (const char *name, const char *label); void set_button_label (const char *name, const char *label);
unsigned char get_check (const char *name); unsigned char get_check (const char *name);
unsigned int get_entry_value (const char *name); int get_entry_value (const char *name);
const char *get_entry_text (const char *name); const char *get_entry_text (const char *name);
unsigned char get_combo (const char *name); unsigned char get_combo (const char *name);
void combo_box_append (const char *name, const char *value); void combo_box_append (const char *name, const char *value);
void combo_box_append (GtkComboBox *combo, const char *value); void combo_box_append (GtkComboBox *combo, const char *value);
double get_spin (const char *name); double get_spin (const char *name);
float get_slider (const char *name); float get_slider (const char *name);
void set_check (const char *name, unsigned char value); void set_check (const char *name, bool value);
void set_entry_value (const char *name, unsigned int value); void set_entry_value (const char *name, unsigned int value);
void set_entry_text (const char *name, const char *text); void set_entry_text (const char *name, const char *text);
void set_combo (const char *name, unsigned char value); void set_combo (const char *name, unsigned char value);
void set_spin (const char *name, double value); void set_spin (const char *name, double value);
void set_slider (const char *name, float value); void set_slider (const char *name, float value);
int has_focus (const char *widget); bool has_focus (const char *widget);
protected: protected:
static void signal_connection_func (GtkBuilder *, GObject *, const gchar *, const char *, GObject *, GConnectFlags, gpointer); static void signal_connection_func (GtkBuilder *, GObject *, const gchar *, const char *, GObject *, GConnectFlags, gpointer);

View File

@ -135,10 +135,10 @@ Snes9xCheats::Snes9xCheats ()
g_signal_connect (view, "row-activated", G_CALLBACK (event_row_activated), (gpointer) this); g_signal_connect (view, "row-activated", G_CALLBACK (event_row_activated), (gpointer) this);
gtk_tree_view_set_reorderable (view, TRUE); gtk_tree_view_set_reorderable (view, true);
renderer = gtk_cell_renderer_toggle_new (); renderer = gtk_cell_renderer_toggle_new ();
gtk_cell_renderer_toggle_set_activatable (GTK_CELL_RENDERER_TOGGLE (renderer), TRUE); gtk_cell_renderer_toggle_set_activatable (GTK_CELL_RENDERER_TOGGLE (renderer), true);
gtk_tree_view_insert_column_with_attributes (view, gtk_tree_view_insert_column_with_attributes (view,
-1, -1,
"\xe2\x86\x91", "\xe2\x86\x91",
@ -146,7 +146,7 @@ Snes9xCheats::Snes9xCheats ()
"active", COLUMN_ENABLED, "active", COLUMN_ENABLED,
NULL); NULL);
GtkTreeViewColumn *column = gtk_tree_view_get_column (view, 0); GtkTreeViewColumn *column = gtk_tree_view_get_column (view, 0);
gtk_tree_view_column_set_clickable (column, TRUE); gtk_tree_view_column_set_clickable (column, true);
gtk_tree_view_column_set_alignment (column, 0.5f); gtk_tree_view_column_set_alignment (column, 0.5f);
g_signal_connect (column, "clicked", G_CALLBACK (event_enabled_column_clicked), (gpointer) this); g_signal_connect (column, "clicked", G_CALLBACK (event_enabled_column_clicked), (gpointer) this);
@ -163,7 +163,7 @@ Snes9xCheats::Snes9xCheats ()
"text", COLUMN_DESCRIPTION, "text", COLUMN_DESCRIPTION,
NULL); NULL);
column = gtk_tree_view_get_column (view, 1); column = gtk_tree_view_get_column (view, 1);
gtk_tree_view_column_set_resizable (column, TRUE); gtk_tree_view_column_set_resizable (column, true);
gtk_tree_view_column_set_min_width (column, 40); gtk_tree_view_column_set_min_width (column, 40);
renderer = gtk_cell_renderer_text_new (); renderer = gtk_cell_renderer_text_new ();
@ -174,7 +174,7 @@ Snes9xCheats::Snes9xCheats ()
"text", COLUMN_CHEAT, "text", COLUMN_CHEAT,
NULL); NULL);
column = gtk_tree_view_get_column (view, 2); column = gtk_tree_view_get_column (view, 2);
gtk_tree_view_column_set_resizable (column, TRUE); gtk_tree_view_column_set_resizable (column, true);
gtk_tree_view_column_set_min_width (column, 40); gtk_tree_view_column_set_min_width (column, 40);
store = gtk_list_store_new (NUM_COLS, store = gtk_list_store_new (NUM_COLS,

View File

@ -76,37 +76,37 @@ Snes9xConfig::Snes9xConfig ()
int Snes9xConfig::load_defaults () int Snes9xConfig::load_defaults ()
{ {
full_screen_on_open = 0; full_screen_on_open = false;
change_display_resolution = 0; change_display_resolution = false;
xrr_index = 0; xrr_index = 0;
scale_to_fit = 1; scale_to_fit = true;
maintain_aspect_ratio = 1; maintain_aspect_ratio = true;
aspect_ratio = 2; aspect_ratio = 2;
scale_method = 0; scale_method = 0;
overscan = 0; overscan = false;
save_sram_after_secs = 0; save_sram_after_secs = 0;
rom_loaded = 0; rom_loaded = false;
multithreading = 0; multithreading = false;
hw_accel = 0; hw_accel = 0;
allow_opengl = 0; allow_opengl = false;
allow_xv = 0; allow_xv = false;
allow_xrandr = 0; allow_xrandr = false;
force_inverted_byte_order = FALSE; force_inverted_byte_order = false;
hires_effect = HIRES_NORMAL; hires_effect = HIRES_NORMAL;
pause_emulation_on_switch = 0; pause_emulation_on_switch = false;
num_threads = 2; num_threads = 2;
mute_sound = FALSE; mute_sound = false;
mute_sound_turbo = FALSE; mute_sound_turbo = false;
fullscreen = FALSE; fullscreen = false;
ui_visible = TRUE; ui_visible = true;
statusbar_visible = FALSE; statusbar_visible = false;
default_esc_behavior = 1; default_esc_behavior = 1;
prevent_screensaver = FALSE; prevent_screensaver = false;
sound_driver = 0; sound_driver = 0;
sound_buffer_size = 32; sound_buffer_size = 32;
sound_playback_rate = 5; sound_playback_rate = 5;
sound_input_rate = 31950; sound_input_rate = 31950;
auto_input_rate = TRUE; auto_input_rate = true;
last_directory[0] = '\0'; last_directory[0] = '\0';
last_shader_directory[0] = '\0'; last_shader_directory[0] = '\0';
window_width = -1; window_width = -1;
@ -118,70 +118,70 @@ int Snes9xConfig::load_defaults ()
savestate_directory[0] = '\0'; savestate_directory[0] = '\0';
cheat_directory[0] = '\0'; cheat_directory[0] = '\0';
patch_directory[0] = '\0'; patch_directory[0] = '\0';
screensaver_needs_reset = FALSE; screensaver_needs_reset = false;
ntsc_setup = snes_ntsc_composite; ntsc_setup = snes_ntsc_composite;
ntsc_scanline_intensity = 1; ntsc_scanline_intensity = 1;
scanline_filter_intensity = 0; scanline_filter_intensity = 0;
Settings.BilinearFilter = FALSE; Settings.BilinearFilter = false;
netplay_activated = FALSE; netplay_activated = false;
netplay_server_up = FALSE; netplay_server_up = false;
netplay_is_server = FALSE; netplay_is_server = false;
netplay_sync_reset = TRUE; netplay_sync_reset = true;
netplay_send_rom = FALSE; netplay_send_rom = false;
netplay_default_port = 6096; netplay_default_port = 6096;
netplay_max_frame_loss = 10; netplay_max_frame_loss = 10;
netplay_last_rom [0] = '\0'; netplay_last_rom [0] = '\0';
netplay_last_host [0] = '\0'; netplay_last_host [0] = '\0';
netplay_last_port = 6096; netplay_last_port = 6096;
modal_dialogs = 1; modal_dialogs = true;
current_save_slot = 0; current_save_slot = 0;
S9xCheatsEnable (); S9xCheatsEnable ();
rewind_granularity = 5; rewind_granularity = 5;
rewind_buffer_size = 0; rewind_buffer_size = 0;
Settings.Rewinding = FALSE; Settings.Rewinding = false;
#ifdef USE_OPENGL #ifdef USE_OPENGL
sync_to_vblank = 1; sync_to_vblank = true;
use_pbos = 1; use_pbos = true;
pbo_format = 0; pbo_format = 0;
npot_textures = FALSE; npot_textures = false;
use_shaders = 0; use_shaders = false;
shader_filename[0] = '\0'; shader_filename[0] = '\0';
sync_every_frame = FALSE; sync_every_frame = false;
use_fences = FALSE; use_fences = false;
#endif #endif
/* Snes9X Variables */ /* Snes9X Variables */
Settings.MouseMaster = TRUE; Settings.MouseMaster = true;
Settings.SuperScopeMaster = TRUE; Settings.SuperScopeMaster = true;
Settings.JustifierMaster = TRUE; Settings.JustifierMaster = true;
Settings.MultiPlayer5Master = TRUE; Settings.MultiPlayer5Master = true;
Settings.UpAndDown = FALSE; Settings.UpAndDown = false;
Settings.AutoSaveDelay = 0; Settings.AutoSaveDelay = 0;
Settings.SkipFrames = 0; Settings.SkipFrames = 0;
Settings.Transparency = TRUE; Settings.Transparency = true;
Settings.DisplayFrameRate = FALSE; Settings.DisplayFrameRate = false;
Settings.SixteenBitSound = TRUE; Settings.SixteenBitSound = true;
Settings.Stereo = TRUE; Settings.Stereo = true;
Settings.ReverseStereo = FALSE; Settings.ReverseStereo = false;
Settings.SoundPlaybackRate = 44100; Settings.SoundPlaybackRate = 44100;
Settings.StopEmulation = TRUE; Settings.StopEmulation = true;
Settings.FrameTimeNTSC = 16666; Settings.FrameTimeNTSC = 16666;
Settings.FrameTimePAL = 20000; Settings.FrameTimePAL = 20000;
Settings.SupportHiRes = true; Settings.SupportHiRes = true;
Settings.FrameTime = Settings.FrameTimeNTSC; Settings.FrameTime = Settings.FrameTimeNTSC;
Settings.BlockInvalidVRAMAccessMaster = TRUE; Settings.BlockInvalidVRAMAccessMaster = true;
Settings.SoundSync = 0; Settings.SoundSync = false;
Settings.DynamicRateControl = FALSE; Settings.DynamicRateControl = false;
Settings.DynamicRateLimit = 5; Settings.DynamicRateLimit = 5;
Settings.InterpolationMethod = DSP_INTERPOLATION_GAUSSIAN; Settings.InterpolationMethod = DSP_INTERPOLATION_GAUSSIAN;
Settings.HDMATimingHack = 100; Settings.HDMATimingHack = 100;
Settings.SuperFXClockMultiplier = 100; Settings.SuperFXClockMultiplier = 100;
Settings.NetPlay = FALSE; Settings.NetPlay = false;
NetPlay.Paused = FALSE; NetPlay.Paused = false;
NetPlay.MaxFrameSkip = 10; NetPlay.MaxFrameSkip = 10;
Settings.DisplayPressedKeys = FALSE; Settings.DisplayPressedKeys = false;
#ifdef ALLOW_CPU_OVERCLOCK #ifdef ALLOW_CPU_OVERCLOCK
Settings.MaxSpriteTilesPerLine = 34; Settings.MaxSpriteTilesPerLine = 34;
Settings.OneClockCycle = 6; Settings.OneClockCycle = 6;
@ -669,9 +669,9 @@ int Snes9xConfig::load_config_file ()
#endif #endif
if (Settings.SkipFrames == THROTTLE_SOUND_SYNC) if (Settings.SkipFrames == THROTTLE_SOUND_SYNC)
Settings.SoundSync = 1; Settings.SoundSync = true;
else else
Settings.SoundSync = 0; Settings.SoundSync = false;
hires_effect = CLAMP (hires_effect, 0, 2); hires_effect = CLAMP (hires_effect, 0, 2);
Settings.DynamicRateLimit = CLAMP (Settings.DynamicRateLimit, 1, 1000); Settings.DynamicRateLimit = CLAMP (Settings.DynamicRateLimit, 1, 1000);
@ -703,7 +703,7 @@ void Snes9xConfig::rebind_keys ()
cmd = S9xGetPortCommandT (buf); cmd = S9xGetPortCommandT (buf);
S9xMapButton (bin[button_i].base_hex (), cmd, FALSE); S9xMapButton (bin[button_i].base_hex (), cmd, false);
} }
} }
@ -713,18 +713,18 @@ void Snes9xConfig::rebind_keys ()
cmd = S9xGetPortCommandT (buf); cmd = S9xGetPortCommandT (buf);
S9xMapButton (shortcut[i - NUM_JOYPAD_LINKS].base_hex (), S9xMapButton (shortcut[i - NUM_JOYPAD_LINKS].base_hex (),
cmd, cmd,
FALSE); false);
} }
cmd = S9xGetPortCommandT ("Pointer Mouse1+Superscope+Justifier1"); cmd = S9xGetPortCommandT ("Pointer Mouse1+Superscope+Justifier1");
S9xMapPointer (BINDING_MOUSE_POINTER, cmd, TRUE); S9xMapPointer (BINDING_MOUSE_POINTER, cmd, true);
cmd = S9xGetPortCommandT ("{Mouse1 L,Superscope Fire,Justifier1 Trigger}"); cmd = S9xGetPortCommandT ("{Mouse1 L,Superscope Fire,Justifier1 Trigger}");
S9xMapButton (BINDING_MOUSE_BUTTON0, cmd, FALSE); S9xMapButton (BINDING_MOUSE_BUTTON0, cmd, false);
cmd = S9xGetPortCommandT ("{Justifier1 AimOffscreen Trigger,Superscope AimOffscreen}"); cmd = S9xGetPortCommandT ("{Justifier1 AimOffscreen Trigger,Superscope AimOffscreen}");
S9xMapButton (BINDING_MOUSE_BUTTON1, cmd, FALSE); S9xMapButton (BINDING_MOUSE_BUTTON1, cmd, false);
cmd = S9xGetPortCommandT ("{Mouse1 R,Superscope Cursor,Justifier1 Start}"); cmd = S9xGetPortCommandT ("{Mouse1 R,Superscope Cursor,Justifier1 Start}");
S9xMapButton (BINDING_MOUSE_BUTTON2, cmd, FALSE); S9xMapButton (BINDING_MOUSE_BUTTON2, cmd, false);
} }

View File

@ -52,109 +52,109 @@ class Snes9xConfig
void joystick_register_centers (); void joystick_register_centers ();
/* Screen options */ /* Screen options */
unsigned char full_screen_on_open; bool full_screen_on_open;
unsigned char change_display_resolution; bool change_display_resolution;
unsigned char fullscreen; bool fullscreen;
unsigned char ui_visible; bool ui_visible;
unsigned char statusbar_visible; bool statusbar_visible;
unsigned char default_esc_behavior; int default_esc_behavior;
unsigned char prevent_screensaver; bool prevent_screensaver;
int xrr_index; int xrr_index;
unsigned char scale_to_fit; bool scale_to_fit;
unsigned char maintain_aspect_ratio; bool maintain_aspect_ratio;
int aspect_ratio; int aspect_ratio;
unsigned int scale_method; int scale_method;
unsigned char overscan; bool overscan;
unsigned char multithreading; bool multithreading;
int hires_effect; int hires_effect;
unsigned char force_inverted_byte_order; bool force_inverted_byte_order;
snes_ntsc_setup_t ntsc_setup; snes_ntsc_setup_t ntsc_setup;
unsigned char ntsc_format; int ntsc_format;
float ntsc_hue; float ntsc_hue;
float ntsc_saturation; float ntsc_saturation;
float ntsc_contrast; float ntsc_contrast;
float ntsc_brightness; float ntsc_brightness;
float ntsc_sharpness; float ntsc_sharpness;
float ntsc_artifacts; float ntsc_artifacts;
float ntsc_gamma; float ntsc_gamma;
float ntsc_resolution; float ntsc_resolution;
float ntsc_fringing; float ntsc_fringing;
float ntsc_bleed; float ntsc_bleed;
float ntsc_merge_fields; float ntsc_merge_fields;
unsigned int ntsc_scanline_intensity; int ntsc_scanline_intensity;
unsigned int scanline_filter_intensity; int scanline_filter_intensity;
unsigned char hw_accel; int hw_accel;
unsigned char allow_opengl; bool allow_opengl;
unsigned char allow_xv; bool allow_xv;
unsigned char allow_xrandr; bool allow_xrandr;
/* Data options */ /* Data options */
unsigned char save_sram_after_secs; int save_sram_after_secs;
char sram_directory [PATH_MAX]; char sram_directory [PATH_MAX];
char savestate_directory [PATH_MAX]; char savestate_directory [PATH_MAX];
char cheat_directory [PATH_MAX]; char cheat_directory [PATH_MAX];
char patch_directory [PATH_MAX]; char patch_directory [PATH_MAX];
char export_directory [PATH_MAX]; char export_directory [PATH_MAX];
char last_directory [PATH_MAX]; char last_directory [PATH_MAX];
char last_shader_directory [PATH_MAX]; char last_shader_directory [PATH_MAX];
/* Controls */ /* Controls */
JoypadBinding pad[NUM_JOYPADS]; JoypadBinding pad[NUM_JOYPADS];
Binding shortcut[NUM_EMU_LINKS]; Binding shortcut[NUM_EMU_LINKS];
/* Netplay */ /* Netplay */
int netplay_is_server; bool netplay_is_server;
int netplay_sync_reset; bool netplay_sync_reset;
int netplay_send_rom; bool netplay_send_rom;
int netplay_default_port; int netplay_default_port;
int netplay_max_frame_loss; int netplay_max_frame_loss;
char netplay_last_rom [PATH_MAX]; char netplay_last_rom [PATH_MAX];
char netplay_last_host [PATH_MAX]; char netplay_last_host [PATH_MAX];
int netplay_last_port; int netplay_last_port;
int netplay_activated; bool netplay_activated;
int netplay_server_up; bool netplay_server_up;
/* Operational */ /* Operational */
int sound_driver; int sound_driver;
int mute_sound; bool mute_sound;
int mute_sound_turbo; bool mute_sound_turbo;
int sound_buffer_size; int sound_buffer_size;
int sound_playback_rate; int sound_playback_rate;
int auto_input_rate; bool auto_input_rate;
int sound_input_rate; int sound_input_rate;
int rom_loaded; bool rom_loaded;
int window_width, window_height; int window_width, window_height;
int preferences_width, preferences_height; int preferences_width, preferences_height;
int pause_emulation_on_switch; bool pause_emulation_on_switch;
int num_threads; int num_threads;
unsigned char screensaver_needs_reset; bool screensaver_needs_reset;
int modal_dialogs; bool modal_dialogs;
int pointer_is_visible; bool pointer_is_visible;
gint64 pointer_timestamp; gint64 pointer_timestamp;
unsigned int rewind_granularity; unsigned int rewind_granularity;
unsigned int rewind_buffer_size; unsigned int rewind_buffer_size;
int current_save_slot; int current_save_slot;
XRRScreenResources *xrr_screen_resources; XRRScreenResources *xrr_screen_resources;
XRRCrtcInfo *xrr_crtc_info; XRRCrtcInfo *xrr_crtc_info;
#ifdef USE_OPENGL #ifdef USE_OPENGL
unsigned char sync_to_vblank; bool sync_to_vblank;
unsigned char use_pbos; bool use_pbos;
int pbo_format; int pbo_format;
unsigned char npot_textures; bool npot_textures;
unsigned char use_shaders; bool use_shaders;
char shader_filename[PATH_MAX]; char shader_filename[PATH_MAX];
unsigned char sync_every_frame; bool sync_every_frame;
unsigned char use_fences; bool use_fences;
#endif #endif
JoyDevice **joystick; JoyDevice **joystick;
int joystick_threshold; int joystick_threshold;
}; };
std::string get_config_dir (); std::string get_config_dir ();

View File

@ -159,11 +159,11 @@ bool S9xIsMousePluggedIn ()
bool S9xGrabJoysticks () bool S9xGrabJoysticks ()
{ {
if (joystick_lock) if (joystick_lock)
return FALSE; return false;
joystick_lock++; joystick_lock++;
return TRUE; return true;
} }
void S9xReleaseJoysticks () void S9xReleaseJoysticks ()
@ -200,21 +200,21 @@ static void change_slot (int difference)
void S9xHandlePortCommand (s9xcommand_t cmd, int16 data1, int16 data2) void S9xHandlePortCommand (s9xcommand_t cmd, int16 data1, int16 data2)
{ {
static bool quit_binding_down = FALSE; static bool quit_binding_down = false;
if (data1 == TRUE) if (data1 == true)
{ {
if (cmd.port[0] == PORT_QUIT) if (cmd.port[0] == PORT_QUIT)
quit_binding_down = TRUE; quit_binding_down = true;
else if (cmd.port[0] == PORT_REWIND) else if (cmd.port[0] == PORT_REWIND)
Settings.Rewinding = TRUE; Settings.Rewinding = true;
} }
if (data1 == FALSE) /* Release */ if (data1 == false) /* Release */
{ {
if (cmd.port[0] != PORT_QUIT) if (cmd.port[0] != PORT_QUIT)
{ {
quit_binding_down = FALSE; quit_binding_down = false;
} }
if (cmd.port[0] == PORT_COMMAND_FULLSCREEN) if (cmd.port[0] == PORT_COMMAND_FULLSCREEN)
@ -242,7 +242,7 @@ void S9xHandlePortCommand (s9xcommand_t cmd, int16 data1, int16 data2)
else if (cmd.port[0] == PORT_REWIND) else if (cmd.port[0] == PORT_REWIND)
{ {
Settings.Rewinding = FALSE; Settings.Rewinding = false;
} }
else if (cmd.port[0] == PORT_SEEK_TO_FRAME) else if (cmd.port[0] == PORT_SEEK_TO_FRAME)
@ -477,7 +477,7 @@ void S9xProcessEvents (bool8 block)
{ {
binding = Binding (i, event.parameter, 0); binding = Binding (i, event.parameter, 0);
S9xReportButton (binding.hex (), event.state == JOY_PRESSED ? 1 : 0); S9xReportButton (binding.hex (), event.state == JOY_PRESSED ? 1 : 0);
gui_config->screensaver_needs_reset = TRUE; gui_config->screensaver_needs_reset = true;
} }
} }

View File

@ -92,30 +92,28 @@ typedef struct Calibration
class JoyDevice class JoyDevice
{ {
public: public:
JoyDevice (unsigned int device_num); JoyDevice (unsigned int device_num);
~JoyDevice (); ~JoyDevice ();
int get_event (JoyEvent *event); int get_event (JoyEvent *event);
void flush (); void flush ();
void handle_event (SDL_Event *event); void handle_event (SDL_Event *event);
void register_centers (); void register_centers ();
SDL_Joystick *filedes; SDL_Joystick *filedes;
Calibration *calibration; Calibration *calibration;
std::queue<JoyEvent> queue; std::queue<JoyEvent> queue;
int mode; int mode;
int joynum; int joynum;
int num_axes; int num_axes;
int num_hats; int num_hats;
int *axis; int *axis;
int *hat; int *hat;
bool enabled; bool enabled;
private:
void poll_events ();
void add_event (unsigned int parameter, unsigned int state);
private:
void poll_events ();
void add_event (unsigned int parameter, unsigned int state);
}; };
void S9xDeinitInputDevices (); void S9xDeinitInputDevices ();

View File

@ -1204,7 +1204,7 @@ thread_worker (gpointer data,
break; break;
} }
job->complete = 1; job->complete = true;
} }
static void static void
@ -1215,7 +1215,7 @@ create_thread_pool ()
pool = g_thread_pool_new (thread_worker, pool = g_thread_pool_new (thread_worker,
NULL, NULL,
gui_config->num_threads - 1, gui_config->num_threads - 1,
TRUE, true,
NULL); NULL);
} }
} }
@ -1245,7 +1245,7 @@ internal_threaded_convert (void *src_buffer,
job[i].width = width; job[i].width = width;
job[i].height = height / gui_config->num_threads; job[i].height = height / gui_config->num_threads;
job[i].bpp = bpp; job[i].bpp = bpp;
job[i].complete = 0; job[i].complete = false;
g_thread_pool_push (pool, (gpointer) &(job[i]), NULL); g_thread_pool_push (pool, (gpointer) &(job[i]), NULL);
} }
@ -1307,7 +1307,7 @@ internal_threaded_convert_mask (void *src_buffer,
job[i].inv_rmask = inv_rmask; job[i].inv_rmask = inv_rmask;
job[i].inv_gmask = inv_gmask; job[i].inv_gmask = inv_gmask;
job[i].inv_bmask = inv_bmask; job[i].inv_bmask = inv_bmask;
job[i].complete = 0; job[i].complete = false;
g_thread_pool_push (pool, (gpointer) &(job[i]), NULL); g_thread_pool_push (pool, (gpointer) &(job[i]), NULL);
} }
@ -1363,7 +1363,7 @@ internal_threaded_filter (uint8 *src_buffer,
for (i = 0; i < gui_config->num_threads - 1; i++) for (i = 0; i < gui_config->num_threads - 1; i++)
{ {
job[i].operation_type = JOB_FILTER; job[i].operation_type = JOB_FILTER;
job[i].complete = 0; job[i].complete = false;
job[i].width = width; job[i].width = width;
job[i].src_pitch = src_pitch; job[i].src_pitch = src_pitch;
job[i].dst_pitch = dst_pitch; job[i].dst_pitch = dst_pitch;
@ -1548,7 +1548,7 @@ S9xQueryDrivers ()
{ {
GdkDisplay *display = gtk_widget_get_display (GTK_WIDGET (top_level->get_window())); GdkDisplay *display = gtk_widget_get_display (GTK_WIDGET (top_level->get_window()));
gui_config->allow_xv = 0; gui_config->allow_xv = false;
#if defined(USE_XV) && defined(GDK_WINDOWING_X11) #if defined(USE_XV) && defined(GDK_WINDOWING_X11)
if (GDK_IS_X11_DISPLAY (display)) if (GDK_IS_X11_DISPLAY (display))
gui_config->allow_xv = S9xXVDisplayDriver::query_availability (); gui_config->allow_xv = S9xXVDisplayDriver::query_availability ();
@ -1557,17 +1557,17 @@ S9xQueryDrivers ()
#ifdef USE_OPENGL #ifdef USE_OPENGL
gui_config->allow_opengl = S9xOpenGLDisplayDriver::query_availability (); gui_config->allow_opengl = S9xOpenGLDisplayDriver::query_availability ();
#else #else
gui_config->allow_opengl = 0; gui_config->allow_opengl = false;
#endif #endif
gui_config->allow_xrandr = 0; gui_config->allow_xrandr = false;
#ifdef GDK_WINDOWING_X11 #ifdef GDK_WINDOWING_X11
if (GDK_IS_X11_DISPLAY (display)) if (GDK_IS_X11_DISPLAY (display))
{ {
Display *dpy = gdk_x11_display_get_xdisplay (gtk_widget_get_display (GTK_WIDGET (top_level->get_window()))); Display *dpy = gdk_x11_display_get_xdisplay (gtk_widget_get_display (GTK_WIDGET (top_level->get_window())));
Window xid = gdk_x11_window_get_xid (gtk_widget_get_window (GTK_WIDGET (top_level->get_window()))); Window xid = gdk_x11_window_get_xid (gtk_widget_get_window (GTK_WIDGET (top_level->get_window())));
gui_config->allow_xrandr = 1; gui_config->allow_xrandr = true;
gui_config->xrr_screen_resources = XRRGetScreenResourcesCurrent (dpy, xid); gui_config->xrr_screen_resources = XRRGetScreenResourcesCurrent (dpy, xid);
gui_config->xrr_crtc_info = XRRGetCrtcInfo (dpy, gui_config->xrr_crtc_info = XRRGetCrtcInfo (dpy,
gui_config->xrr_screen_resources, gui_config->xrr_screen_resources,
@ -1646,7 +1646,7 @@ S9xDeinitUpdate (int width, int height)
driver->update (width, height, yoffset); driver->update (width, height, yoffset);
return TRUE; return true;
} }
static void static void
@ -1722,7 +1722,7 @@ S9xDeinitDisplay ()
GFX.Screen = NULL; GFX.Screen = NULL;
if (pool) if (pool)
g_thread_pool_free (pool, FALSE, TRUE); g_thread_pool_free (pool, false, true);
} }
void void
@ -1755,13 +1755,13 @@ bool8
S9xContinueUpdate (int width, int height) S9xContinueUpdate (int width, int height)
{ {
S9xDeinitUpdate (width, height); S9xDeinitUpdate (width, height);
return TRUE; return true;
} }
bool8 bool8
S9xInitUpdate () S9xInitUpdate ()
{ {
return TRUE; return true;
} }
void void
@ -1894,7 +1894,7 @@ static void S9xGTKDisplayString (const char *string, int linesFromBottom,
void void
S9xInitDisplay (int argc, char **argv) S9xInitDisplay (int argc, char **argv)
{ {
Settings.SupportHiRes = TRUE; Settings.SupportHiRes = true;
S9xBlit2xSaIFilterInit (); S9xBlit2xSaIFilterInit ();
#ifdef USE_HQ2X #ifdef USE_HQ2X
S9xBlitHQ2xFilterInit (); S9xBlitHQ2xFilterInit ();

View File

@ -82,7 +82,7 @@ typedef struct thread_job_t
int line_start; int line_start;
int line_end; int line_end;
volatile int complete; volatile bool complete;
} }
thread_job_t; thread_job_t;

View File

@ -358,7 +358,7 @@ void S9xOpenGLDisplayDriver::update_texture_size (int width, int height)
} }
} }
int S9xOpenGLDisplayDriver::load_shaders (const char *shader_file) bool S9xOpenGLDisplayDriver::load_shaders (const char *shader_file)
{ {
int length = strlen (shader_file); int length = strlen (shader_file);
@ -374,20 +374,20 @@ int S9xOpenGLDisplayDriver::load_shaders (const char *shader_file)
npot = true; npot = true;
if (glsl_shader->param.size () > 0) if (glsl_shader->param.size () > 0)
window->enable_widget ("shader_parameters_item", TRUE); window->enable_widget ("shader_parameters_item", true);
setlocale (LC_ALL, ""); setlocale (LC_ALL, "");
return 1; return true;
} }
delete glsl_shader; delete glsl_shader;
} }
setlocale (LC_ALL, ""); setlocale (LC_ALL, "");
return 0; return false;
} }
int S9xOpenGLDisplayDriver::opengl_defaults () bool S9xOpenGLDisplayDriver::opengl_defaults()
{ {
npot = false; npot = false;
using_pbos = false; using_pbos = false;
@ -528,7 +528,7 @@ int S9xOpenGLDisplayDriver::opengl_defaults ()
glClearColor (0.0, 0.0, 0.0, 0.0); glClearColor (0.0, 0.0, 0.0, 0.0);
return 1; return true;
} }
void S9xOpenGLDisplayDriver::refresh (int width, int height) void S9xOpenGLDisplayDriver::refresh (int width, int height)
@ -544,7 +544,7 @@ void S9xOpenGLDisplayDriver::resize ()
output_window_height = context->height; output_window_height = context->height;
} }
int S9xOpenGLDisplayDriver::create_context () bool S9xOpenGLDisplayDriver::create_context()
{ {
gdk_window = gtk_widget_get_window (drawing_area); gdk_window = gtk_widget_get_window (drawing_area);
@ -562,10 +562,10 @@ int S9xOpenGLDisplayDriver::create_context ()
#endif #endif
if (!context->attach (drawing_area)) if (!context->attach (drawing_area))
return 0; return false;
if (!context->create_context ()) if (!context->create_context ())
return 0; return false;
output_window_width = context->width; output_window_width = context->width;
output_window_height = context->height; output_window_height = context->height;
@ -592,7 +592,7 @@ int S9xOpenGLDisplayDriver::create_context ()
if (version >= 31 || epoxy_has_gl_extension ("GL_ARB_sync")) if (version >= 31 || epoxy_has_gl_extension ("GL_ARB_sync"))
fences = true; fences = true;
return 1; return true;
} }
int S9xOpenGLDisplayDriver::init () int S9xOpenGLDisplayDriver::init ()
@ -666,7 +666,7 @@ void S9xOpenGLDisplayDriver::deinit ()
if (using_glsl_shaders) if (using_glsl_shaders)
{ {
window->enable_widget ("shader_parameters_item", FALSE); window->enable_widget ("shader_parameters_item", false);
gtk_shader_parameters_dialog_close (); gtk_shader_parameters_dialog_close ();
glsl_shader->destroy(); glsl_shader->destroy();
delete glsl_shader; delete glsl_shader;

View File

@ -44,11 +44,11 @@ class S9xOpenGLDisplayDriver : public S9xDisplayDriver
bool is_ready (); bool is_ready ();
private: private:
int opengl_defaults (); bool opengl_defaults ();
void swap_buffers (); void swap_buffers ();
int load_shaders (const char *); bool load_shaders (const char *);
void update_texture_size (int width, int height); void update_texture_size (int width, int height);
int create_context (); bool create_context ();
void resize (); void resize ();
GLuint stock_program; GLuint stock_program;

View File

@ -217,7 +217,7 @@ S9xXVDisplayDriver::update_image_size (int width, int height)
} }
} }
shm.readOnly = FALSE; shm.readOnly = false;
xv_image->data = shm.shmaddr; xv_image->data = shm.shmaddr;
@ -442,7 +442,7 @@ S9xXVDisplayDriver::init ()
return -1; return -1;
} }
shm.readOnly = FALSE; shm.readOnly = false;
xv_image->data = shm.shmaddr; xv_image->data = shm.shmaddr;

View File

@ -306,7 +306,7 @@ S9xOpenSnapshotFile (const char *fname, bool8 read_only, STREAM *file)
if (read_only) if (read_only)
{ {
if ((*file = OPEN_STREAM (filename, "rb"))) if ((*file = OPEN_STREAM (filename, "rb")))
return (TRUE); return (true);
else else
fprintf (stderr, fprintf (stderr,
"Failed to open file stream for reading. (%s)\n", "Failed to open file stream for reading. (%s)\n",
@ -316,7 +316,7 @@ S9xOpenSnapshotFile (const char *fname, bool8 read_only, STREAM *file)
{ {
if ((*file = OPEN_STREAM (filename, "wb"))) if ((*file = OPEN_STREAM (filename, "wb")))
{ {
return (TRUE); return (true);
} }
else else
{ {
@ -335,20 +335,20 @@ S9xOpenSnapshotFile (const char *fname, bool8 read_only, STREAM *file)
{ {
sprintf (command, "gzip -d <\"%s\"", filename); sprintf (command, "gzip -d <\"%s\"", filename);
if (*file = popen (command, "r")) if (*file = popen (command, "r"))
return (TRUE); return (true);
} }
else else
{ {
sprintf (command, "gzip --best >\"%s\"", filename); sprintf (command, "gzip --best >\"%s\"", filename);
if (*file = popen (command, "wb")) if (*file = popen (command, "wb"))
return (TRUE); return (true);
} }
fprintf (stderr, "gzip: Couldn't open snapshot file:\n%s\n", filename); fprintf (stderr, "gzip: Couldn't open snapshot file:\n%s\n", filename);
#endif #endif
return (FALSE); return (false);
} }
void S9xCloseSnapshotFile (STREAM file) void S9xCloseSnapshotFile (STREAM file)

View File

@ -30,7 +30,7 @@ S9xNetplayPreconnect ()
} }
NetPlay.MaxBehindFrameCount = gui_config->netplay_max_frame_loss; NetPlay.MaxBehindFrameCount = gui_config->netplay_max_frame_loss;
NetPlay.Waiting4EmulationThread = FALSE; NetPlay.Waiting4EmulationThread = false;
} }
static void static void
@ -43,7 +43,7 @@ S9xNetplayConnect ()
uint32 flags = CPU.Flags; uint32 flags = CPU.Flags;
if (*(gui_config->netplay_last_rom) && if (*(gui_config->netplay_last_rom) &&
top_level->try_open_rom (gui_config->netplay_last_rom)) !top_level->try_open_rom (gui_config->netplay_last_rom))
{ {
return; return;
} }
@ -65,12 +65,12 @@ S9xNetplayConnect ()
gtk_widget_destroy (msg); gtk_widget_destroy (msg);
} }
gui_config->netplay_activated = TRUE; gui_config->netplay_activated = true;
/* If no rom is specified, assume we'll get it from the server */ /* If no rom is specified, assume we'll get it from the server */
if (*(gui_config->netplay_last_rom) == 0) if (*(gui_config->netplay_last_rom) == 0)
{ {
Settings.StopEmulation = FALSE; Settings.StopEmulation = false;
S9xROMLoaded (); S9xROMLoaded ();
} }
@ -94,8 +94,8 @@ S9xNetplayStopServer ()
S9xNPStopServer (); S9xNPStopServer ();
g_thread_join (npthread); g_thread_join (npthread);
Settings.NetPlayServer = FALSE; Settings.NetPlayServer = false;
gui_config->netplay_server_up = FALSE; gui_config->netplay_server_up = false;
} }
void void
@ -112,8 +112,8 @@ S9xNetplayDisconnect ()
S9xNetplayStopServer (); S9xNetplayStopServer ();
} }
gui_config->netplay_activated = FALSE; gui_config->netplay_activated = false;
NetPlay.Paused = FALSE; NetPlay.Paused = false;
top_level->configure_widgets (); top_level->configure_widgets ();
} }
@ -136,12 +136,12 @@ S9xNetplayStartServer ()
flags = CPU.Flags; flags = CPU.Flags;
if (*(gui_config->netplay_last_rom) == 0 || if (*(gui_config->netplay_last_rom) == 0 ||
top_level->try_open_rom (gui_config->netplay_last_rom)) !top_level->try_open_rom (gui_config->netplay_last_rom))
{ {
return; return;
} }
Settings.NetPlayServer = TRUE; Settings.NetPlayServer = true;
NPServer.SyncByReset = gui_config->netplay_sync_reset; NPServer.SyncByReset = gui_config->netplay_sync_reset;
NPServer.SendROMImageOnConnect = gui_config->netplay_send_rom; NPServer.SendROMImageOnConnect = gui_config->netplay_send_rom;
@ -158,8 +158,8 @@ S9xNetplayStartServer ()
S9xROMLoaded (); S9xROMLoaded ();
gui_config->netplay_activated = TRUE; gui_config->netplay_activated = true;
gui_config->netplay_server_up = TRUE; gui_config->netplay_server_up = true;
CPU.Flags = flags; CPU.Flags = flags;
@ -215,7 +215,7 @@ S9xNetplaySyncSpeed ()
// No heartbeats already arrived, have to wait for one. // No heartbeats already arrived, have to wait for one.
NetPlay.PendingWait4Sync = !S9xNPWaitForHeartBeatDelay (100); NetPlay.PendingWait4Sync = !S9xNPWaitForHeartBeatDelay (100);
IPPU.RenderThisFrame = TRUE; IPPU.RenderThisFrame = true;
IPPU.SkippedFrames = 0; IPPU.SkippedFrames = 0;
} }
else else
@ -230,16 +230,16 @@ S9xNetplaySyncSpeed ()
{ {
if ((unsigned int) difference <= (NetPlay.MaxBehindFrameCount / 2)) if ((unsigned int) difference <= (NetPlay.MaxBehindFrameCount / 2))
{ {
NetPlay.Waiting4EmulationThread = FALSE; NetPlay.Waiting4EmulationThread = false;
S9xNPSendPause (FALSE); S9xNPSendPause (false);
} }
} }
else else
{ {
if ((unsigned int) difference >= (NetPlay.MaxBehindFrameCount)) if ((unsigned int) difference >= (NetPlay.MaxBehindFrameCount))
{ {
NetPlay.Waiting4EmulationThread = TRUE; NetPlay.Waiting4EmulationThread = true;
S9xNPSendPause (TRUE); S9xNPSendPause (true);
} }
} }
@ -248,11 +248,11 @@ S9xNetplaySyncSpeed ()
if (IPPU.SkippedFrames < NetPlay.MaxFrameSkip) if (IPPU.SkippedFrames < NetPlay.MaxFrameSkip)
{ {
IPPU.SkippedFrames++; IPPU.SkippedFrames++;
IPPU.RenderThisFrame = FALSE; IPPU.RenderThisFrame = false;
} }
else else
{ {
IPPU.RenderThisFrame = TRUE; IPPU.RenderThisFrame = true;
IPPU.SkippedFrames = 0; IPPU.SkippedFrames = 0;
} }
} }
@ -269,7 +269,7 @@ S9xNetplaySyncSpeed ()
int int
S9xNetplayPush () S9xNetplayPush ()
{ {
static int statusbar_state = FALSE; static int statusbar_state = false;
if (gui_config->netplay_activated && if (gui_config->netplay_activated &&
(!Settings.NetPlay || !NetPlay.Connected)) (!Settings.NetPlay || !NetPlay.Connected))
@ -280,26 +280,26 @@ S9xNetplayPush ()
if (NetPlay.PendingWait4Sync && !S9xNPWaitForHeartBeatDelay (100)) if (NetPlay.PendingWait4Sync && !S9xNPWaitForHeartBeatDelay (100))
{ {
S9xProcessEvents (FALSE); S9xProcessEvents (false);
S9xSoundStop (); S9xSoundStop ();
NetPlay.Paused = TRUE; NetPlay.Paused = true;
if (statusbar_state == FALSE) if (statusbar_state == false)
{ {
top_level->update_statusbar (); top_level->update_statusbar ();
statusbar_state = TRUE; statusbar_state = true;
} }
return 1; return 1;
} }
NetPlay.Paused = FALSE; NetPlay.Paused = false;
if (statusbar_state) if (statusbar_state)
{ {
top_level->update_statusbar (); top_level->update_statusbar ();
statusbar_state = FALSE; statusbar_state = false;
} }
S9xSoundStart (); S9xSoundStart ();
@ -314,7 +314,7 @@ S9xNetplayPush ()
if (NetPlay.PendingWait4Sync) if (NetPlay.PendingWait4Sync)
{ {
NetPlay.PendingWait4Sync = FALSE; NetPlay.PendingWait4Sync = false;
NetPlay.FrameCount++; NetPlay.FrameCount++;
S9xNPStepJoypadHistory (); S9xNPStepJoypadHistory ();
} }

View File

@ -62,18 +62,18 @@ Snes9xNetplayDialog::update_state ()
{ {
if (get_check ("host_radio")) if (get_check ("host_radio"))
{ {
enable_widget ("connect_box", FALSE); enable_widget ("connect_box", false);
enable_widget ("default_port_box", TRUE); enable_widget ("default_port_box", true);
enable_widget ("sync_reset", TRUE); enable_widget ("sync_reset", true);
enable_widget ("send_image", TRUE); enable_widget ("send_image", true);
} }
else else
{ {
enable_widget ("connect_box", TRUE); enable_widget ("connect_box", true);
enable_widget ("default_port_box", FALSE); enable_widget ("default_port_box", false);
enable_widget ("sync_reset", FALSE); enable_widget ("sync_reset", false);
enable_widget ("send_image", FALSE); enable_widget ("send_image", false);
} }
} }
@ -108,8 +108,7 @@ Snes9xNetplayDialog::settings_from_dialog ()
config->save_config_file (); config->save_config_file ();
} }
int bool Snes9xNetplayDialog::show()
Snes9xNetplayDialog::show ()
{ {
int result; int result;
@ -123,12 +122,12 @@ Snes9xNetplayDialog::show ()
{ {
settings_from_dialog (); settings_from_dialog ();
return TRUE; return true;
} }
else else
{ {
return FALSE; return false;
} }
} }

View File

@ -15,7 +15,7 @@ class Snes9xNetplayDialog : public GtkBuilderWindow
public: public:
Snes9xNetplayDialog (Snes9xConfig *config); Snes9xNetplayDialog (Snes9xConfig *config);
~Snes9xNetplayDialog (); ~Snes9xNetplayDialog ();
int show (); bool show ();
void update_state (); void update_state ();
private: private:

View File

@ -40,7 +40,7 @@ snes9x_preferences_open (GtkWidget *widget,
config->rebind_keys (); config->rebind_keys ();
window->update_accels (); window->update_accels ();
return TRUE; return true;
} }
static void static void
@ -59,7 +59,7 @@ static void
event_control_toggle (GtkToggleButton *widget, gpointer data) event_control_toggle (GtkToggleButton *widget, gpointer data)
{ {
Snes9xPreferences *window = (Snes9xPreferences *) data; Snes9xPreferences *window = (Snes9xPreferences *) data;
static unsigned char toggle_lock = 0; static bool toggle_lock = false;
const gchar *name; const gchar *name;
bool state; bool state;
@ -72,7 +72,7 @@ event_control_toggle (GtkToggleButton *widget, gpointer data)
name = gtk_buildable_get_name (GTK_BUILDABLE (widget)); name = gtk_buildable_get_name (GTK_BUILDABLE (widget));
state = gtk_toggle_button_get_active (widget); state = gtk_toggle_button_get_active (widget);
toggle_lock = 1; toggle_lock = true;
for (int i = 0; b_links[i].button_name; i++) for (int i = 0; b_links[i].button_name; i++)
{ {
@ -80,13 +80,13 @@ event_control_toggle (GtkToggleButton *widget, gpointer data)
{ {
gtk_toggle_button_set_active ( gtk_toggle_button_set_active (
GTK_TOGGLE_BUTTON (window->get_widget (b_links[i].button_name)), GTK_TOGGLE_BUTTON (window->get_widget (b_links[i].button_name)),
FALSE); false);
} }
} }
gtk_toggle_button_set_active (widget, state); gtk_toggle_button_set_active (widget, state);
toggle_lock = 0; toggle_lock = false;
} }
static gboolean static gboolean
@ -100,7 +100,7 @@ event_key_press (GtkWidget *widget, GdkEventKey *event, gpointer user_data)
if ((focus = window->get_focused_binding ()) < 0) if ((focus = window->get_focused_binding ()) < 0)
{ {
return FALSE; /* Don't keep key for ourselves */ return false; /* Don't keep key for ourselves */
} }
/* Allow modifier keys to be used if page is set to the joypad bindings. */ /* Allow modifier keys to be used if page is set to the joypad bindings. */
@ -118,7 +118,7 @@ event_key_press (GtkWidget *widget, GdkEventKey *event, gpointer user_data)
event->keyval == GDK_Alt_L || event->keyval == GDK_Alt_L ||
event->keyval == GDK_Alt_R) event->keyval == GDK_Alt_R)
{ {
return FALSE; return false;
} }
} }
@ -134,13 +134,13 @@ event_key_press (GtkWidget *widget, GdkEventKey *event, gpointer user_data)
else else
{ {
window->focus_next (); window->focus_next ();
return TRUE; return true;
} }
} }
window->store_binding (b_links[focus].button_name, key_binding); window->store_binding (b_links[focus].button_name, key_binding);
return TRUE; return true;
} }
static void static void
@ -402,14 +402,14 @@ poll_joystick (gpointer data)
binding); binding);
window->config->flush_joysticks (); window->config->flush_joysticks ();
return TRUE; return true;
} }
} }
} }
} }
return TRUE; return true;
} }
void void
@ -450,11 +450,11 @@ event_auto_input_rate_toggled (GtkToggleButton *togglebutton, gpointer data)
if (gtk_toggle_button_get_active (togglebutton)) if (gtk_toggle_button_get_active (togglebutton))
{ {
preferences->set_slider("sound_input_rate", top_level->get_auto_input_rate ()); preferences->set_slider("sound_input_rate", top_level->get_auto_input_rate ());
gtk_widget_set_sensitive (preferences->get_widget("sound_input_rate"), FALSE); gtk_widget_set_sensitive (preferences->get_widget("sound_input_rate"), false);
} }
else else
{ {
gtk_widget_set_sensitive (preferences->get_widget("sound_input_rate"), TRUE); gtk_widget_set_sensitive (preferences->get_widget("sound_input_rate"), true);
} }
} }
@ -644,11 +644,11 @@ Snes9xPreferences::move_settings_to_dialog ()
if (top_level->get_auto_input_rate () == 0) if (top_level->get_auto_input_rate () == 0)
{ {
config->auto_input_rate = 0; config->auto_input_rate = 0;
gtk_widget_set_sensitive (get_widget ("auto_input_rate"), FALSE); gtk_widget_set_sensitive (get_widget ("auto_input_rate"), false);
} }
set_check ("auto_input_rate", config->auto_input_rate); set_check ("auto_input_rate", config->auto_input_rate);
gtk_widget_set_sensitive (get_widget("sound_input_rate"), gtk_widget_set_sensitive (get_widget("sound_input_rate"),
config->auto_input_rate ? FALSE : TRUE); config->auto_input_rate ? false : true);
set_spin ("sound_buffer_size", config->sound_buffer_size); set_spin ("sound_buffer_size", config->sound_buffer_size);
if (Settings.SkipFrames == THROTTLE_SOUND_SYNC) if (Settings.SkipFrames == THROTTLE_SOUND_SYNC)
@ -736,13 +736,13 @@ Snes9xPreferences::move_settings_to_dialog ()
void void
Snes9xPreferences::get_settings_from_dialog () Snes9xPreferences::get_settings_from_dialog ()
{ {
int sound_needs_restart = 0; bool sound_needs_restart = false;
int gfx_needs_restart = 0; bool gfx_needs_restart = false;
int sound_sync = 0; bool sound_sync = false;
Settings.SkipFrames = get_combo ("frameskip_combo"); Settings.SkipFrames = get_combo ("frameskip_combo");
if (Settings.SkipFrames == THROTTLE_SOUND_SYNC) if (Settings.SkipFrames == THROTTLE_SOUND_SYNC)
sound_sync = 1; sound_sync = true;
if ((config->sound_driver != get_combo ("sound_driver")) || if ((config->sound_driver != get_combo ("sound_driver")) ||
(config->mute_sound != get_check ("mute_sound_check")) || (config->mute_sound != get_check ("mute_sound_check")) ||
@ -754,7 +754,7 @@ Snes9xPreferences::get_settings_from_dialog ()
(Settings.SoundSync != sound_sync) || (Settings.SoundSync != sound_sync) ||
(Settings.DynamicRateControl != get_check ("dynamic_rate_control"))) (Settings.DynamicRateControl != get_check ("dynamic_rate_control")))
{ {
sound_needs_restart = 1; sound_needs_restart = true;
} }
if ((config->change_display_resolution != get_check ("change_display_resolution") || if ((config->change_display_resolution != get_check ("change_display_resolution") ||
@ -775,13 +775,13 @@ Snes9xPreferences::get_settings_from_dialog ()
config->change_display_resolution = get_check ("change_display_resolution"); config->change_display_resolution = get_check ("change_display_resolution");
if (config->multithreading != get_check ("multithreading")) if (config->multithreading != get_check ("multithreading"))
gfx_needs_restart = 1; gfx_needs_restart = true;
if (config->hw_accel != hw_accel_value (get_combo ("hw_accel"))) if (config->hw_accel != hw_accel_value (get_combo ("hw_accel")))
gfx_needs_restart = 1; gfx_needs_restart = true;
if (config->force_inverted_byte_order != get_check ("force_inverted_byte_order")) if (config->force_inverted_byte_order != get_check ("force_inverted_byte_order"))
gfx_needs_restart = 1; gfx_needs_restart = true;
config->full_screen_on_open = get_check ("full_screen_on_open"); config->full_screen_on_open = get_check ("full_screen_on_open");
Settings.DisplayFrameRate = get_check ("show_frame_rate"); Settings.DisplayFrameRate = get_check ("show_frame_rate");
@ -858,7 +858,7 @@ Snes9xPreferences::get_settings_from_dialog ()
config->use_shaders != get_check ("use_shaders") || config->use_shaders != get_check ("use_shaders") ||
get_check ("use_shaders")) get_check ("use_shaders"))
{ {
gfx_needs_restart = 1; gfx_needs_restart = true;
} }
config->sync_to_vblank = get_check ("sync_to_vblank"); config->sync_to_vblank = get_check ("sync_to_vblank");
@ -1017,7 +1017,7 @@ Snes9xPreferences::show ()
{ {
gint result; gint result;
GtkWidget *combo; GtkWidget *combo;
int close_dialog; bool close_dialog;
guint source_id = -1; guint source_id = -1;
#ifdef GDK_WINDOWING_X11 #ifdef GDK_WINDOWING_X11
@ -1112,7 +1112,7 @@ Snes9xPreferences::show ()
if (config->preferences_width > 0 && config->preferences_height > 0) if (config->preferences_width > 0 && config->preferences_height > 0)
resize (config->preferences_width, config->preferences_height); resize (config->preferences_width, config->preferences_height);
for (close_dialog = 0; !close_dialog; ) for (close_dialog = false; !close_dialog; )
{ {
gtk_widget_show (window); gtk_widget_show (window);
result = gtk_dialog_run (GTK_DIALOG (window)); result = gtk_dialog_run (GTK_DIALOG (window));
@ -1125,7 +1125,7 @@ Snes9xPreferences::show ()
case GTK_RESPONSE_OK: case GTK_RESPONSE_OK:
get_settings_from_dialog (); get_settings_from_dialog ();
config->save_config_file (); config->save_config_file ();
close_dialog = 1; close_dialog = true;
gtk_widget_hide (window); gtk_widget_hide (window);
break; break;
@ -1138,7 +1138,7 @@ Snes9xPreferences::show ()
case GTK_RESPONSE_CLOSE: case GTK_RESPONSE_CLOSE:
case GTK_RESPONSE_DELETE_EVENT: case GTK_RESPONSE_DELETE_EVENT:
gtk_widget_hide (window); gtk_widget_hide (window);
close_dialog = 1; close_dialog = true;
break; break;
default: default:

View File

@ -35,8 +35,8 @@ class Snes9xPreferences : public GtkBuilderWindow
Snes9xConfig *config; Snes9xConfig *config;
GtkToggleButton *last_toggled; GtkToggleButton *last_toggled;
int awaiting_key; bool awaiting_key;
int polling_joystick; bool polling_joystick;
JoypadBinding pad[NUM_JOYPADS]; JoypadBinding pad[NUM_JOYPADS];
Binding shortcut[NUM_EMU_LINKS]; Binding shortcut[NUM_EMU_LINKS];

View File

@ -112,7 +112,7 @@ int main (int argc, char *argv[])
gui_config->rebind_keys (); gui_config->rebind_keys ();
top_level->update_accels (); top_level->update_accels ();
Settings.Paused = TRUE; Settings.Paused = true;
g_timeout_add (100, S9xPauseFunc, NULL); g_timeout_add (100, S9xPauseFunc, NULL);
g_timeout_add (10000, S9xScreenSaverCheckFunc, NULL); g_timeout_add (10000, S9xScreenSaverCheckFunc, NULL);
@ -150,7 +150,7 @@ int main (int argc, char *argv[])
int S9xOpenROM (const char *rom_filename) int S9xOpenROM (const char *rom_filename)
{ {
uint32 flags; uint32 flags;
bool8 loaded; bool loaded;
if (gui_config->rom_loaded) if (gui_config->rom_loaded)
{ {
@ -161,7 +161,7 @@ int S9xOpenROM (const char *rom_filename)
flags = CPU.Flags; flags = CPU.Flags;
loaded = FALSE; loaded = false;
if (Settings.Multi) if (Settings.Multi)
loaded = Memory.LoadMultiCart (Settings.CartAName, Settings.CartBName); loaded = Memory.LoadMultiCart (Settings.CartAName, Settings.CartBName);
@ -198,10 +198,10 @@ int S9xOpenROM (const char *rom_filename)
{ {
fprintf (stderr, _("Error opening: %s\n"), rom_filename); fprintf (stderr, _("Error opening: %s\n"), rom_filename);
loaded = FALSE; loaded = false;
} }
else else
loaded = TRUE; loaded = true;
} }
if (loaded) if (loaded)
@ -211,7 +211,7 @@ int S9xOpenROM (const char *rom_filename)
else else
{ {
CPU.Flags = flags; CPU.Flags = flags;
Settings.Paused = 1; Settings.Paused = true;
S9xNoROMLoaded (); S9xNoROMLoaded ();
top_level->refresh (); top_level->refresh ();
@ -233,12 +233,12 @@ int S9xOpenROM (const char *rom_filename)
void S9xROMLoaded () void S9xROMLoaded ()
{ {
gui_config->rom_loaded = TRUE; gui_config->rom_loaded = true;
top_level->configure_widgets (); top_level->configure_widgets ();
if (gui_config->full_screen_on_open) if (gui_config->full_screen_on_open)
{ {
Settings.Paused = FALSE; Settings.Paused = false;
top_level->enter_fullscreen_mode (); top_level->enter_fullscreen_mode ();
} }
@ -248,7 +248,7 @@ void S9xROMLoaded ()
void S9xNoROMLoaded () void S9xNoROMLoaded ()
{ {
S9xSoundStop (); S9xSoundStop ();
gui_config->rom_loaded = FALSE; gui_config->rom_loaded = false;
S9xDisplayRefresh (-1, -1); S9xDisplayRefresh (-1, -1);
top_level->configure_widgets (); top_level->configure_widgets ();
top_level->update_statusbar (); top_level->update_statusbar ();
@ -256,10 +256,10 @@ void S9xNoROMLoaded ()
static gboolean S9xPauseFunc (gpointer data) static gboolean S9xPauseFunc (gpointer data)
{ {
S9xProcessEvents (TRUE); S9xProcessEvents (true);
if (!gui_config->rom_loaded) if (!gui_config->rom_loaded)
return TRUE; return true;
if (!S9xNetplayPush ()) if (!S9xNetplayPush ())
{ {
@ -271,12 +271,12 @@ static gboolean S9xPauseFunc (gpointer data)
/* Clear joystick queues */ /* Clear joystick queues */
gui_config->flush_joysticks (); gui_config->flush_joysticks ();
S9xSetSoundMute (FALSE); S9xSetSoundMute (false);
S9xSoundStart (); S9xSoundStart ();
if (Settings.NetPlay && NetPlay.Connected) if (Settings.NetPlay && NetPlay.Connected)
{ {
S9xNPSendPause (FALSE); S9xNPSendPause (false);
} }
/* Resume high-performance callback */ /* Resume high-performance callback */
@ -285,10 +285,10 @@ static gboolean S9xPauseFunc (gpointer data)
NULL, NULL,
NULL); NULL);
top_level->update_statusbar (); top_level->update_statusbar ();
return FALSE; return false;
} }
return TRUE; return true;
} }
gboolean S9xIdleFunc (gpointer data) gboolean S9xIdleFunc (gpointer data)
@ -302,20 +302,20 @@ gboolean S9xIdleFunc (gpointer data)
if (Settings.NetPlay && NetPlay.Connected) if (Settings.NetPlay && NetPlay.Connected)
{ {
S9xNPSendPause (TRUE); S9xNPSendPause (true);
} }
/* Move to a timer-based function to use less CPU */ /* Move to a timer-based function to use less CPU */
g_timeout_add (100, S9xPauseFunc, NULL); g_timeout_add (100, S9xPauseFunc, NULL);
top_level->update_statusbar (); top_level->update_statusbar ();
return FALSE; return false;
} }
S9xCheckPointerTimer (); S9xCheckPointerTimer ();
S9xProcessEvents (TRUE); S9xProcessEvents (true);
if (!S9xDisplayDriverIsReady ()) if (!S9xDisplayDriverIsReady ())
return TRUE; return true;
S9xThrottle (); S9xThrottle ();
@ -335,19 +335,19 @@ gboolean S9xIdleFunc (gpointer data)
else if(IPPU.TotalEmulatedFrames % gui_config->rewind_granularity == 0) else if(IPPU.TotalEmulatedFrames % gui_config->rewind_granularity == 0)
state_manager.push(); state_manager.push();
static int muted_from_turbo = FALSE; static int muted_from_turbo = false;
static int mute_saved_state = FALSE; static int mute_saved_state = false;
if (Settings.TurboMode && !muted_from_turbo && gui_config->mute_sound_turbo) if (Settings.TurboMode && !muted_from_turbo && gui_config->mute_sound_turbo)
{ {
muted_from_turbo = TRUE; muted_from_turbo = true;
mute_saved_state = Settings.Mute; mute_saved_state = Settings.Mute;
S9xSetSoundMute (TRUE); S9xSetSoundMute (true);
} }
if (!Settings.TurboMode && muted_from_turbo) if (!Settings.TurboMode && muted_from_turbo)
{ {
muted_from_turbo = FALSE; muted_from_turbo = false;
Settings.Mute = mute_saved_state; Settings.Mute = mute_saved_state;
} }
@ -356,7 +356,7 @@ gboolean S9xIdleFunc (gpointer data)
S9xNetplayPop (); S9xNetplayPop ();
} }
return TRUE; return true;
} }
gboolean S9xScreenSaverCheckFunc (gpointer data) gboolean S9xScreenSaverCheckFunc (gpointer data)
@ -367,7 +367,7 @@ gboolean S9xScreenSaverCheckFunc (gpointer data)
gui_config->prevent_screensaver)) gui_config->prevent_screensaver))
top_level->reset_screensaver (); top_level->reset_screensaver ();
return TRUE; return true;
} }
/* Snes9x core hooks */ /* Snes9x core hooks */
@ -450,7 +450,7 @@ void S9xParseArg (char **argv, int &i, int argc)
} }
else if (!strcasecmp (argv[i], "-mutesound")) else if (!strcasecmp (argv[i], "-mutesound"))
{ {
gui_config->mute_sound = TRUE; gui_config->mute_sound = true;
} }
} }
@ -466,7 +466,7 @@ static void S9xThrottle ()
if (Settings.HighSpeedSeek > 0) if (Settings.HighSpeedSeek > 0)
{ {
Settings.HighSpeedSeek--; Settings.HighSpeedSeek--;
IPPU.RenderThisFrame = FALSE; IPPU.RenderThisFrame = false;
IPPU.SkippedFrames = 0; IPPU.SkippedFrames = 0;
frame_clock = now; frame_clock = now;
@ -481,12 +481,12 @@ static void S9xThrottle ()
{ {
IPPU.FrameSkip = 0; IPPU.FrameSkip = 0;
IPPU.SkippedFrames = 0; IPPU.SkippedFrames = 0;
IPPU.RenderThisFrame = TRUE; IPPU.RenderThisFrame = true;
} }
else else
{ {
IPPU.SkippedFrames++; IPPU.SkippedFrames++;
IPPU.RenderThisFrame = FALSE; IPPU.RenderThisFrame = false;
} }
frame_clock = now; frame_clock = now;
@ -494,7 +494,7 @@ static void S9xThrottle ()
return; return;
} }
IPPU.RenderThisFrame = TRUE; IPPU.RenderThisFrame = true;
if (now - frame_clock > 500000) if (now - frame_clock > 500000)
{ {
@ -535,7 +535,7 @@ static void S9xThrottle ()
if (IPPU.SkippedFrames < 8) if (IPPU.SkippedFrames < 8)
{ {
IPPU.RenderThisFrame = FALSE; IPPU.RenderThisFrame = false;
frame_clock += Settings.FrameTime; frame_clock += Settings.FrameTime;
return; return;
} }
@ -570,7 +570,7 @@ static void S9xCheckPointerTimer ()
if (g_get_monotonic_time () - gui_config->pointer_timestamp > 1000000) if (g_get_monotonic_time () - gui_config->pointer_timestamp > 1000000)
{ {
top_level->hide_mouse_cursor (); top_level->hide_mouse_cursor ();
gui_config->pointer_is_visible = FALSE; gui_config->pointer_is_visible = false;
} }
} }
@ -583,7 +583,7 @@ void S9xExit ()
S9xPortSoundDeinit (); S9xPortSoundDeinit ();
Settings.StopEmulation = TRUE; Settings.StopEmulation = true;
if (gui_config->rom_loaded) if (gui_config->rom_loaded)
{ {

View File

@ -38,7 +38,7 @@ event_main_window_delete (GtkWidget *widget,
{ {
S9xExit (); S9xExit ();
return TRUE; return true;
} }
static gboolean static gboolean
@ -50,7 +50,7 @@ event_main_window_state_event (GtkWidget *widget,
window->fullscreen_state = event->new_window_state & GDK_WINDOW_STATE_FULLSCREEN; window->fullscreen_state = event->new_window_state & GDK_WINDOW_STATE_FULLSCREEN;
window->maximized_state = event->new_window_state & GDK_WINDOW_STATE_MAXIMIZED; window->maximized_state = event->new_window_state & GDK_WINDOW_STATE_MAXIMIZED;
return FALSE; return false;
} }
static gboolean static gboolean
@ -60,7 +60,7 @@ event_continue_item_activate (GtkWidget *widget, gpointer data)
window->unpause_from_user (); window->unpause_from_user ();
return TRUE; return true;
} }
static gboolean static gboolean
@ -72,7 +72,7 @@ event_open_cheats (GtkWidget *widget, gpointer data)
cheats->show (); cheats->show ();
delete cheats; delete cheats;
return TRUE; return true;
} }
static gboolean static gboolean
@ -80,7 +80,7 @@ event_open_multicart (GtkWidget *widget, gpointer data)
{ {
((Snes9xWindow *) data)->open_multicart_dialog (); ((Snes9xWindow *) data)->open_multicart_dialog ();
return TRUE; return true;
} }
static gboolean static gboolean
@ -90,7 +90,7 @@ event_rom_info (GtkWidget *widget, gpointer data)
window->show_rom_info (); window->show_rom_info ();
return TRUE; return true;
} }
static gboolean static gboolean
@ -100,7 +100,7 @@ event_toggle_interface (GtkWidget *widget, gpointer data)
window->toggle_ui (); window->toggle_ui ();
return TRUE; return true;
} }
static gboolean static gboolean
@ -108,7 +108,7 @@ event_show_statusbar (GtkWidget *widget, gpointer data)
{ {
((Snes9xWindow *) data)->toggle_statusbar (); ((Snes9xWindow *) data)->toggle_statusbar ();
return TRUE; return true;
} }
static gboolean static gboolean
@ -116,7 +116,7 @@ event_sync_clients (GtkWidget *widget, gpointer data)
{ {
S9xNetplaySyncClients (); S9xNetplaySyncClients ();
return TRUE; return true;
} }
static gboolean static gboolean
@ -126,7 +126,7 @@ event_pause_item_activate (GtkWidget *widget, gpointer data)
window->pause_from_user (); window->pause_from_user ();
return TRUE; return true;
} }
static gboolean static gboolean
@ -134,7 +134,7 @@ event_open_netplay (GtkWidget *widget, gpointer data)
{ {
S9xNetplayDialogOpen (); S9xNetplayDialogOpen ();
return TRUE; return true;
} }
#if GTK_MAJOR_VERSION >= 3 #if GTK_MAJOR_VERSION >= 3
@ -146,11 +146,11 @@ event_drawingarea_draw (GtkWidget *widget,
Snes9xWindow *window = (Snes9xWindow *) data; Snes9xWindow *window = (Snes9xWindow *) data;
window->cr = cr; window->cr = cr;
window->cairo_owned = FALSE; window->cairo_owned = false;
window->expose (); window->expose ();
window->cr = NULL; window->cr = NULL;
return TRUE; return true;
} }
#else #else
@ -162,7 +162,7 @@ event_drawingarea_expose (GtkWidget *widget,
{ {
((Snes9xWindow *) data)->expose (); ((Snes9xWindow *) data)->expose ();
return TRUE; return true;
} }
#endif #endif
@ -178,7 +178,7 @@ event_key (GtkWidget *widget, GdkEventKey *event, gpointer data)
/* Ignore multiple identical keypresses to discard repeating keys */ /* Ignore multiple identical keypresses to discard repeating keys */
if (event->keyval == keyval && event->type == type) if (event->keyval == keyval && event->type == type)
{ {
return TRUE; return true;
} }
/* Provide escape key to get out of fullscreen */ /* Provide escape key to get out of fullscreen */
@ -194,7 +194,7 @@ event_key (GtkWidget *widget, GdkEventKey *event, gpointer data)
window->toggle_ui (); window->toggle_ui ();
} }
return TRUE; return true;
} }
keyval = event->keyval; keyval = event->keyval;
@ -213,10 +213,10 @@ event_key (GtkWidget *widget, GdkEventKey *event, gpointer data)
if (cmd.type != S9xNoMapping) if (cmd.type != S9xNoMapping)
{ {
S9xReportButton (b.hex (), (event->type == GDK_KEY_PRESS)); S9xReportButton (b.hex (), (event->type == GDK_KEY_PRESS));
return TRUE; return true;
} }
return FALSE; /* Pass the key to GTK */ return false; /* Pass the key to GTK */
} }
gboolean gboolean
@ -230,20 +230,20 @@ event_motion_notify (GtkWidget *widget,
window->last_width <= 0 || window->last_width <= 0 ||
window->last_height <= 0) window->last_height <= 0)
{ {
return FALSE; return false;
} }
if (window->mouse_grabbed) if (window->mouse_grabbed)
{ {
if (event->x_root == window->mouse_reported_x && if (event->x_root == window->mouse_reported_x &&
event->y_root == window->mouse_reported_y) event->y_root == window->mouse_reported_y)
return FALSE; return false;
window->mouse_loc_x += (event->x_root - window->mouse_reported_x); window->mouse_loc_x += (event->x_root - window->mouse_reported_x);
window->mouse_loc_y += (event->y_root - window->mouse_reported_y); window->mouse_loc_y += (event->y_root - window->mouse_reported_y);
window->center_mouse (); window->center_mouse ();
return FALSE; return false;
} }
#if GTK_CHECK_VERSION(3,10,0) #if GTK_CHECK_VERSION(3,10,0)
@ -268,7 +268,7 @@ event_motion_notify (GtkWidget *widget,
window->config->pointer_timestamp = g_get_monotonic_time (); window->config->pointer_timestamp = g_get_monotonic_time ();
return FALSE; return false;
} }
gboolean gboolean
@ -289,7 +289,7 @@ event_button_press (GtkWidget *widget,
break; break;
} }
return FALSE; return false;
} }
gboolean gboolean
@ -310,7 +310,7 @@ event_button_release (GtkWidget *widget,
break; break;
} }
return FALSE; return false;
} }
static void static void
@ -359,9 +359,9 @@ static void
event_record_movie (GtkWidget *widget, gpointer data) event_record_movie (GtkWidget *widget, gpointer data)
{ {
if (S9xMovieActive ()) if (S9xMovieActive ())
S9xMovieStop (FALSE); S9xMovieStop (false);
S9xMovieCreate (S9xChooseMovieFilename (FALSE), S9xMovieCreate (S9xChooseMovieFilename (false),
0xFF, 0xFF,
MOVIE_OPT_FROM_RESET, MOVIE_OPT_FROM_RESET,
NULL, NULL,
@ -372,9 +372,9 @@ static void
event_open_movie (GtkWidget *widget, gpointer data) event_open_movie (GtkWidget *widget, gpointer data)
{ {
if (S9xMovieActive ()) if (S9xMovieActive ())
S9xMovieStop (FALSE); S9xMovieStop (false);
S9xMovieOpen (S9xChooseMovieFilename (TRUE), FALSE); S9xMovieOpen (S9xChooseMovieFilename (true), false);
} }
static void static void
@ -391,7 +391,7 @@ static void
event_stop_recording (GtkWidget *widget, gpointer data) event_stop_recording (GtkWidget *widget, gpointer data)
{ {
if (S9xMovieActive ()) if (S9xMovieActive ())
S9xMovieStop (FALSE); S9xMovieStop (false);
} }
static void static void
@ -483,17 +483,17 @@ event_save_spc (GtkWidget *widget, gpointer data)
static gboolean static gboolean
event_focus_in (GtkWidget *widget, GdkEventFocus *event, gpointer data) event_focus_in (GtkWidget *widget, GdkEventFocus *event, gpointer data)
{ {
((Snes9xWindow *) data)->focus_notify (TRUE); ((Snes9xWindow *) data)->focus_notify (true);
return FALSE; return false;
} }
static gboolean static gboolean
event_focus_out (GtkWidget *widget, GdkEventFocus *event, gpointer data) event_focus_out (GtkWidget *widget, GdkEventFocus *event, gpointer data)
{ {
((Snes9xWindow *) data)->focus_notify (FALSE); ((Snes9xWindow *) data)->focus_notify (false);
return FALSE; return false;
} }
static void static void
@ -609,11 +609,11 @@ Snes9xWindow::Snes9xWindow (Snes9xConfig *config) :
recent_menu = NULL; recent_menu = NULL;
fullscreen_state = 0; fullscreen_state = 0;
maximized_state = 0; maximized_state = 0;
focused = 1; focused = true;
paused_from_focus_loss = 0; paused_from_focus_loss = false;
cr = NULL; cr = NULL;
cairo_owned = 0; cairo_owned = false;
mouse_grabbed = 0; mouse_grabbed = false;
if (gtk_icon_theme_has_icon (gtk_icon_theme_get_default (), "snes9x")) if (gtk_icon_theme_has_icon (gtk_icon_theme_get_default (), "snes9x"))
{ {
@ -633,16 +633,16 @@ Snes9xWindow::Snes9xWindow (Snes9xConfig *config) :
drawing_area = GTK_DRAWING_AREA (get_widget ("drawingarea")); drawing_area = GTK_DRAWING_AREA (get_widget ("drawingarea"));
#if GTK_MAJOR_VERSION < 3 #if GTK_MAJOR_VERSION < 3
gtk_widget_set_double_buffered (GTK_WIDGET (drawing_area), FALSE); gtk_widget_set_double_buffered (GTK_WIDGET (drawing_area), false);
gtk_widget_set_app_paintable (GTK_WIDGET (drawing_area), TRUE); gtk_widget_set_app_paintable (GTK_WIDGET (drawing_area), true);
#endif #endif
gtk_widget_realize (window); gtk_widget_realize (window);
gtk_widget_realize (GTK_WIDGET (drawing_area)); gtk_widget_realize (GTK_WIDGET (drawing_area));
#if GTK_MAJOR_VERSION < 3 #if GTK_MAJOR_VERSION < 3
gdk_window_set_back_pixmap (gtk_widget_get_window (window), NULL, FALSE); gdk_window_set_back_pixmap (gtk_widget_get_window (window), NULL, false);
gdk_window_set_back_pixmap (gtk_widget_get_window (GTK_WIDGET (drawing_area)), NULL, FALSE); gdk_window_set_back_pixmap (gtk_widget_get_window (GTK_WIDGET (drawing_area)), NULL, false);
#endif #endif
gtk_check_menu_item_set_active ( gtk_check_menu_item_set_active (
@ -653,7 +653,7 @@ Snes9xWindow::Snes9xWindow (Snes9xConfig *config) :
gtk_widget_hide (get_widget ("shader_parameters_separator")); gtk_widget_hide (get_widget ("shader_parameters_separator"));
gtk_widget_hide (get_widget ("shader_parameters_item")); gtk_widget_hide (get_widget ("shader_parameters_item"));
#else #else
enable_widget ("shader_parameters_item", FALSE); enable_widget ("shader_parameters_item", false);
#endif #endif
#if GTK_MAJOR_VERSION >= 3 #if GTK_MAJOR_VERSION >= 3
@ -735,21 +735,21 @@ Snes9xWindow::expose ()
} }
void void
Snes9xWindow::focus_notify (int state) Snes9xWindow::focus_notify (bool state)
{ {
focused = state ? 1 : 0; focused = state;
if (!state && config->pause_emulation_on_switch) if (!state && config->pause_emulation_on_switch)
{ {
sys_pause++; sys_pause++;
propagate_pause_state (); propagate_pause_state ();
paused_from_focus_loss = TRUE; paused_from_focus_loss = true;
} }
if (state && paused_from_focus_loss) if (state && paused_from_focus_loss)
{ {
unpause_from_focus_change (); unpause_from_focus_change ();
paused_from_focus_loss = FALSE; paused_from_focus_loss = false;
} }
} }
@ -791,7 +791,7 @@ Snes9xWindow::open_multicart_dialog ()
else else
Settings.CartBName[0] = '\0'; Settings.CartBName[0] = '\0';
Settings.Multi = TRUE; Settings.Multi = true;
if (S9xOpenROM (NULL)) if (S9xOpenROM (NULL))
{ {
@ -908,7 +908,7 @@ Snes9xWindow::open_rom_dialog ()
if (filename) if (filename)
{ {
Settings.Multi = FALSE; Settings.Multi = false;
try_open_rom (filename); try_open_rom (filename);
g_free (filename); g_free (filename);
@ -917,12 +917,11 @@ Snes9xWindow::open_rom_dialog ()
unpause_from_focus_change (); unpause_from_focus_change ();
} }
int bool Snes9xWindow::try_open_rom(const char *filename)
Snes9xWindow::try_open_rom (const char *filename)
{ {
pause_from_focus_change (); pause_from_focus_change ();
Settings.Multi = FALSE; Settings.Multi = false;
if (S9xOpenROM (filename)) if (S9xOpenROM (filename))
{ {
@ -940,7 +939,7 @@ Snes9xWindow::try_open_rom (const char *filename)
unpause_from_focus_change (); unpause_from_focus_change ();
return 1; return false;
} }
else else
{ {
@ -954,7 +953,7 @@ Snes9xWindow::try_open_rom (const char *filename)
(gchar *) "Snes9x", (gchar *) "Snes9x",
NULL, NULL,
(gchar **) groups, (gchar **) groups,
FALSE false
}; };
gchar *u_filename; gchar *u_filename;
@ -978,7 +977,7 @@ Snes9xWindow::try_open_rom (const char *filename)
this->unpause_from_focus_change (); this->unpause_from_focus_change ();
return 0; return true;
} }
void void
@ -1265,7 +1264,7 @@ statusbar_timeout (gpointer data)
gtk_statusbar_get_context_id (GTK_STATUSBAR (data), gtk_statusbar_get_context_id (GTK_STATUSBAR (data),
"info")); "info"));
return FALSE; return false;
} }
void void
@ -1419,7 +1418,7 @@ Snes9xWindow::configure_widgets ()
{ {
enable_widget ("fullscreen_item", config->rom_loaded); enable_widget ("fullscreen_item", config->rom_loaded);
config->ui_visible = TRUE; config->ui_visible = true;
if (!config->fullscreen) if (!config->fullscreen)
{ {
@ -1438,7 +1437,7 @@ Snes9xWindow::configure_widgets ()
} }
else else
{ {
enable_widget ("fullscreen_item", TRUE); enable_widget ("fullscreen_item", true);
gtk_widget_show (get_widget ("hide_ui")); gtk_widget_show (get_widget ("hide_ui"));
@ -1491,7 +1490,7 @@ Snes9xWindow::reset_screensaver ()
} }
#endif #endif
config->screensaver_needs_reset = FALSE; config->screensaver_needs_reset = false;
} }
void void
@ -1674,7 +1673,7 @@ Snes9xWindow::enter_fullscreen_mode ()
/* If we're running a game, disable ui when entering fullscreen */ /* If we're running a game, disable ui when entering fullscreen */
if (!Settings.Paused && config->rom_loaded) if (!Settings.Paused && config->rom_loaded)
config->ui_visible = FALSE; config->ui_visible = false;
configure_widgets (); configure_widgets ();
} }
@ -1792,7 +1791,7 @@ Snes9xWindow::hide_mouse_cursor ()
gdk_window_set_cursor (gtk_widget_get_window (GTK_WIDGET (drawing_area)), gdk_window_set_cursor (gtk_widget_get_window (GTK_WIDGET (drawing_area)),
empty_cursor); empty_cursor);
config->pointer_is_visible = FALSE; config->pointer_is_visible = false;
} }
void void
@ -1800,7 +1799,7 @@ Snes9xWindow::show_mouse_cursor ()
{ {
gdk_window_set_cursor (gtk_widget_get_window (GTK_WIDGET (drawing_area)), gdk_window_set_cursor (gtk_widget_get_window (GTK_WIDGET (drawing_area)),
NULL); NULL);
config->pointer_is_visible = TRUE; config->pointer_is_visible = true;
} }
void void
@ -1846,7 +1845,7 @@ Snes9xWindow::toggle_grab_mouse ()
#if GTK_MAJOR_VERSION < 3 #if GTK_MAJOR_VERSION < 3
if (!mouse_grabbed) if (!mouse_grabbed)
{ {
gdk_pointer_grab (gdk_window, TRUE, (GdkEventMask) 1020, gdk_window, empty_cursor, GDK_CURRENT_TIME); gdk_pointer_grab (gdk_window, true, (GdkEventMask) 1020, gdk_window, empty_cursor, GDK_CURRENT_TIME);
center_mouse (); center_mouse ();
} }
else else
@ -1860,7 +1859,7 @@ Snes9xWindow::toggle_grab_mouse ()
GdkDevice *pointer = gdk_device_manager_get_client_pointer (manager); GdkDevice *pointer = gdk_device_manager_get_client_pointer (manager);
if (!mouse_grabbed) if (!mouse_grabbed)
gdk_device_grab (pointer, gdk_window, GDK_OWNERSHIP_NONE, TRUE, gdk_device_grab (pointer, gdk_window, GDK_OWNERSHIP_NONE, true,
(GdkEventMask) 1020, empty_cursor, GDK_CURRENT_TIME); (GdkEventMask) 1020, empty_cursor, GDK_CURRENT_TIME);
else else
gdk_device_ungrab (pointer, GDK_CURRENT_TIME); gdk_device_ungrab (pointer, GDK_CURRENT_TIME);
@ -1868,7 +1867,7 @@ Snes9xWindow::toggle_grab_mouse ()
GdkSeat *seat = gdk_display_get_default_seat (gdk_display); GdkSeat *seat = gdk_display_get_default_seat (gdk_display);
if (!mouse_grabbed) if (!mouse_grabbed)
gdk_seat_grab (seat, gdk_window, GDK_SEAT_CAPABILITY_ALL_POINTING, TRUE, gdk_seat_grab (seat, gdk_window, GDK_SEAT_CAPABILITY_ALL_POINTING, true,
empty_cursor, NULL, NULL, NULL); empty_cursor, NULL, NULL, NULL);
else else
gdk_seat_ungrab (seat); gdk_seat_ungrab (seat);
@ -1876,7 +1875,7 @@ Snes9xWindow::toggle_grab_mouse ()
S9xReportPointer (BINDING_MOUSE_POINTER, 0, 0); S9xReportPointer (BINDING_MOUSE_POINTER, 0, 0);
mouse_loc_x = 0; mouse_loc_y = 0; mouse_loc_x = 0; mouse_loc_y = 0;
mouse_grabbed ^= 1; mouse_grabbed = !mouse_grabbed;
if (mouse_grabbed) if (mouse_grabbed)
center_mouse (); center_mouse ();
} }
@ -1896,8 +1895,8 @@ Snes9xWindow::show ()
GtkRecentChooser *chooser = GTK_RECENT_CHOOSER (recent_menu); GtkRecentChooser *chooser = GTK_RECENT_CHOOSER (recent_menu);
gtk_recent_filter_add_group (filter, "cartridge"); gtk_recent_filter_add_group (filter, "cartridge");
gtk_recent_chooser_set_local_only (chooser, TRUE); gtk_recent_chooser_set_local_only (chooser, true);
gtk_recent_chooser_set_show_icons (chooser, FALSE); gtk_recent_chooser_set_show_icons (chooser, false);
gtk_recent_chooser_set_sort_type (chooser, GTK_RECENT_SORT_MRU); gtk_recent_chooser_set_sort_type (chooser, GTK_RECENT_SORT_MRU);
gtk_recent_chooser_add_filter (chooser, filter); gtk_recent_chooser_add_filter (chooser, filter);
@ -1927,14 +1926,14 @@ Snes9xWindow::propagate_pause_state ()
{ {
S9xSoundStart (); S9xSoundStart ();
if (config->rom_loaded) if (config->rom_loaded)
enable_widget ("pause_item", TRUE); enable_widget ("pause_item", true);
S9xDisplayClearBuffers (); S9xDisplayClearBuffers ();
} }
else else
{ {
S9xSoundStop (); S9xSoundStop ();
enable_widget ("pause_item", FALSE); enable_widget ("pause_item", false);
} }
@ -1972,24 +1971,23 @@ Snes9xWindow::unpause_from_focus_change ()
void void
Snes9xWindow::pause_from_user () Snes9xWindow::pause_from_user ()
{ {
user_pause = TRUE; user_pause = true;
propagate_pause_state (); propagate_pause_state ();
} }
void void
Snes9xWindow::unpause_from_user () Snes9xWindow::unpause_from_user ()
{ {
user_pause = FALSE; user_pause = false;
propagate_pause_state (); propagate_pause_state ();
} }
unsigned char bool Snes9xWindow::is_paused()
Snes9xWindow::is_paused ()
{ {
if (user_pause || sys_pause || Settings.Paused || !(config->rom_loaded)) if (user_pause || sys_pause || Settings.Paused || !(config->rom_loaded))
return TRUE; return true;
return FALSE; return false;
} }
void void
@ -2015,7 +2013,7 @@ Snes9xWindow::set_menu_item_accel_to_binding (const char *name,
gtk_accel_map_change_entry (str, gtk_accel_map_change_entry (str,
0, 0,
(GdkModifierType) 0, (GdkModifierType) 0,
TRUE); true);
return; return;
} }
@ -2045,7 +2043,7 @@ Snes9xWindow::set_menu_item_accel_to_binding (const char *name,
gtk_accel_map_change_entry (str, gtk_accel_map_change_entry (str,
bin.get_key (), bin.get_key (),
bin.get_gdk_modifiers (), bin.get_gdk_modifiers (),
TRUE); true);
} }
} }
@ -2119,7 +2117,7 @@ Snes9xWindow::get_cairo ()
cr = gdk_drawing_context_get_cairo_context (gdk_drawing_context); cr = gdk_drawing_context_get_cairo_context (gdk_drawing_context);
#endif #endif
cairo_owned = TRUE; cairo_owned = true;
return cr; return cr;
} }
@ -2134,7 +2132,7 @@ Snes9xWindow::release_cairo ()
gdk_window_end_draw_frame (gtk_widget_get_window (GTK_WIDGET (drawing_area)), gdk_drawing_context); gdk_window_end_draw_frame (gtk_widget_get_window (GTK_WIDGET (drawing_area)), gdk_drawing_context);
cairo_region_destroy (cairo_region); cairo_region_destroy (cairo_region);
#endif #endif
cairo_owned = FALSE; cairo_owned = false;
cr = NULL; cr = NULL;
} }
} }

View File

@ -21,10 +21,10 @@ class Snes9xWindow : public GtkBuilderWindow
/* Pause related functions */ /* Pause related functions */
void pause_from_focus_change (); void pause_from_focus_change ();
void unpause_from_focus_change (); void unpause_from_focus_change ();
void focus_notify (int state); void focus_notify (bool state);
void pause_from_user (); void pause_from_user ();
void unpause_from_user (); void unpause_from_user ();
unsigned char is_paused (); bool is_paused ();
void propagate_pause_state (); void propagate_pause_state ();
/* Fullscreen functions */ /* Fullscreen functions */
@ -45,7 +45,7 @@ class Snes9xWindow : public GtkBuilderWindow
void load_state_dialog (); void load_state_dialog ();
void configure_widgets (); void configure_widgets ();
void save_spc_dialog (); void save_spc_dialog ();
int try_open_rom (const char *filename); bool try_open_rom (const char *filename);
const char *open_movie_dialog (bool readonly); const char *open_movie_dialog (bool readonly);
void movie_seek_dialog (); void movie_seek_dialog ();
void open_multicart_dialog (); void open_multicart_dialog ();
@ -80,17 +80,17 @@ class Snes9xWindow : public GtkBuilderWindow
int nfs_width, nfs_height, nfs_x, nfs_y; int nfs_width, nfs_height, nfs_x, nfs_y;
int fullscreen_state; int fullscreen_state;
int maximized_state; int maximized_state;
int focused; bool focused;
int paused_from_focus_loss; bool paused_from_focus_loss;
uint16 mouse_loc_x, mouse_loc_y; uint16 mouse_loc_x, mouse_loc_y;
uint16 mouse_reported_x, mouse_reported_y; uint16 mouse_reported_x, mouse_reported_y;
int mouse_grabbed; bool mouse_grabbed;
GdkPixbuf *icon, *splash; GdkPixbuf *icon, *splash;
GdkCursor *default_cursor, *empty_cursor; GdkCursor *default_cursor, *empty_cursor;
GtkDrawingArea *drawing_area; GtkDrawingArea *drawing_area;
GtkWidget *recent_menu; GtkWidget *recent_menu;
cairo_t *cr; cairo_t *cr;
int cairo_owned; bool cairo_owned;
#if GTK_MAJOR_VERSION >= 3 #if GTK_MAJOR_VERSION >= 3
GdkDrawingContext *gdk_drawing_context; GdkDrawingContext *gdk_drawing_context;
cairo_region_t *cairo_region; cairo_region_t *cairo_region;

View File

@ -132,8 +132,8 @@ bool gtk_shader_parameters_dialog (GtkWindow *parent)
#if GTK_MAJOR_VERSION >= 3 #if GTK_MAJOR_VERSION >= 3
gtk_widget_set_hexpand (scrolled_window, TRUE); gtk_widget_set_hexpand (scrolled_window, true);
gtk_widget_set_vexpand (scrolled_window, TRUE); gtk_widget_set_vexpand (scrolled_window, true);
gtk_widget_set_margin_start (scrolled_window, 5); gtk_widget_set_margin_start (scrolled_window, 5);
gtk_widget_set_margin_end (scrolled_window, 5); gtk_widget_set_margin_end (scrolled_window, 5);
gtk_widget_set_margin_top (scrolled_window, 5); gtk_widget_set_margin_top (scrolled_window, 5);
@ -141,7 +141,7 @@ bool gtk_shader_parameters_dialog (GtkWindow *parent)
GtkWidget *vbox = gtk_box_new (GTK_ORIENTATION_VERTICAL, 0); GtkWidget *vbox = gtk_box_new (GTK_ORIENTATION_VERTICAL, 0);
GtkWidget *grid = gtk_grid_new (); GtkWidget *grid = gtk_grid_new ();
gtk_grid_set_row_homogeneous (GTK_GRID (grid), TRUE); gtk_grid_set_row_homogeneous (GTK_GRID (grid), true);
gtk_grid_set_column_spacing (GTK_GRID (grid), 12); gtk_grid_set_column_spacing (GTK_GRID (grid), 12);
gtk_container_add (GTK_CONTAINER (vbox), grid); gtk_container_add (GTK_CONTAINER (vbox), grid);
gtk_container_add (GTK_CONTAINER (scrolled_window), vbox); gtk_container_add (GTK_CONTAINER (scrolled_window), vbox);
@ -165,10 +165,10 @@ bool gtk_shader_parameters_dialog (GtkWindow *parent)
else else
{ {
GtkWidget *scale = gtk_scale_new_with_range (GTK_ORIENTATION_HORIZONTAL, p->min, p->max, p->step); GtkWidget *scale = gtk_scale_new_with_range (GTK_ORIENTATION_HORIZONTAL, p->min, p->max, p->step);
gtk_widget_set_hexpand (scale, TRUE); gtk_widget_set_hexpand (scale, true);
gtk_grid_attach (GTK_GRID (grid), scale, 1, i, 1, 1); gtk_grid_attach (GTK_GRID (grid), scale, 1, i, 1, 1);
gtk_scale_set_value_pos (GTK_SCALE (scale), GTK_POS_LEFT); gtk_scale_set_value_pos (GTK_SCALE (scale), GTK_POS_LEFT);
gtk_scale_set_draw_value (GTK_SCALE (scale), TRUE); gtk_scale_set_draw_value (GTK_SCALE (scale), true);
gtk_scale_set_digits (GTK_SCALE (scale), 3); gtk_scale_set_digits (GTK_SCALE (scale), 3);
gtk_range_set_value (GTK_RANGE (scale), p->val); gtk_range_set_value (GTK_RANGE (scale), p->val);
g_signal_connect_data (G_OBJECT (scale), g_signal_connect_data (G_OBJECT (scale),
@ -180,8 +180,8 @@ bool gtk_shader_parameters_dialog (GtkWindow *parent)
} }
} }
#else #else
GtkWidget *vbox = gtk_vbox_new (FALSE, 5); GtkWidget *vbox = gtk_vbox_new (false, 5);
GtkWidget *table = gtk_table_new (params->size (), 2, FALSE); GtkWidget *table = gtk_table_new (params->size (), 2, false);
gtk_table_set_row_spacings (GTK_TABLE (table), 5); gtk_table_set_row_spacings (GTK_TABLE (table), 5);
gtk_table_set_col_spacings (GTK_TABLE (table), 12); gtk_table_set_col_spacings (GTK_TABLE (table), 12);
gtk_container_add (GTK_CONTAINER (vbox), table); gtk_container_add (GTK_CONTAINER (vbox), table);
@ -210,7 +210,7 @@ bool gtk_shader_parameters_dialog (GtkWindow *parent)
GtkWidget *scale = gtk_hscale_new_with_range (p->min, p->max, p->step); GtkWidget *scale = gtk_hscale_new_with_range (p->min, p->max, p->step);
gtk_table_attach (GTK_TABLE (table), scale, 1, 2, i, i + 1, (GtkAttachOptions) (GTK_EXPAND | GTK_FILL), GTK_FILL, 0, 0); gtk_table_attach (GTK_TABLE (table), scale, 1, 2, i, i + 1, (GtkAttachOptions) (GTK_EXPAND | GTK_FILL), GTK_FILL, 0, 0);
gtk_scale_set_value_pos (GTK_SCALE (scale), GTK_POS_LEFT); gtk_scale_set_value_pos (GTK_SCALE (scale), GTK_POS_LEFT);
gtk_scale_set_draw_value (GTK_SCALE (scale), TRUE); gtk_scale_set_draw_value (GTK_SCALE (scale), true);
gtk_scale_set_digits (GTK_SCALE (scale), 3); gtk_scale_set_digits (GTK_SCALE (scale), 3);
gtk_range_set_value (GTK_RANGE (scale), p->val); gtk_range_set_value (GTK_RANGE (scale), p->val);
g_signal_connect_data (G_OBJECT (scale), g_signal_connect_data (G_OBJECT (scale),

View File

@ -146,7 +146,7 @@ S9xPortSoundInit ()
S9xInitSound (gui_config->sound_buffer_size, 0); S9xInitSound (gui_config->sound_buffer_size, 0);
S9xSetSoundMute (FALSE); S9xSetSoundMute (false);
} }
else else
{ {
@ -191,7 +191,7 @@ bool8
S9xOpenSoundDevice () S9xOpenSoundDevice ()
{ {
if (gui_config->mute_sound) if (gui_config->mute_sound)
return FALSE; return false;
gui_config->sound_buffer_size = CLAMP (gui_config->sound_buffer_size, 2, 256); gui_config->sound_buffer_size = CLAMP (gui_config->sound_buffer_size, 2, 256);

View File

@ -15,7 +15,7 @@ class S9xSoundDriver
virtual ~S9xSoundDriver () {} virtual ~S9xSoundDriver () {}
virtual void init () = 0; virtual void init () = 0;
virtual void terminate () = 0; virtual void terminate () = 0;
virtual bool8 open_device () = 0; virtual bool open_device () = 0;
virtual void start () = 0; virtual void start () = 0;
virtual void stop () = 0; virtual void stop () = 0;
}; };

View File

@ -60,8 +60,7 @@ S9xAlsaSoundDriver::stop ()
{ {
} }
bool8 bool S9xAlsaSoundDriver::open_device()
S9xAlsaSoundDriver::open_device ()
{ {
int err; int err;
unsigned int periods = 8; unsigned int periods = 8;
@ -152,7 +151,7 @@ S9xAlsaSoundDriver::open_device ()
S9xSetSamplesAvailableCallback (alsa_samples_available, this); S9xSetSamplesAvailableCallback (alsa_samples_available, this);
return TRUE; return true;
close_fail: close_fail:
snd_pcm_drain (pcm); snd_pcm_drain (pcm);
@ -162,7 +161,7 @@ close_fail:
fail: fail:
printf ("Failed: %s\n", snd_strerror (err)); printf ("Failed: %s\n", snd_strerror (err));
return FALSE; return false;
} }
void void

View File

@ -17,7 +17,7 @@ class S9xAlsaSoundDriver : public S9xSoundDriver
S9xAlsaSoundDriver (); S9xAlsaSoundDriver ();
void init (); void init ();
void terminate (); void terminate ();
bool8 open_device (); bool open_device ();
void start (); void start ();
void stop (); void stop ();
void samples_available (); void samples_available ();

View File

@ -59,8 +59,7 @@ S9xOSSSoundDriver::stop ()
{ {
} }
bool8 bool S9xOSSSoundDriver::open_device()
S9xOSSSoundDriver::open_device ()
{ {
int temp; int temp;
audio_buf_info info; audio_buf_info info;
@ -169,7 +168,7 @@ S9xOSSSoundDriver::open_device ()
S9xSetSamplesAvailableCallback (oss_samples_available, this); S9xSetSamplesAvailableCallback (oss_samples_available, this);
return TRUE; return true;
close_fail: close_fail:
@ -178,7 +177,7 @@ close_fail:
fail: fail:
printf ("failed\n"); printf ("failed\n");
return FALSE; return false;
} }
void void

View File

@ -16,7 +16,7 @@ class S9xOSSSoundDriver : public S9xSoundDriver
S9xOSSSoundDriver (); S9xOSSSoundDriver ();
void init (); void init ();
void terminate (); void terminate ();
bool8 open_device (); bool open_device ();
void start (); void start ();
void stop (); void stop ();
void samples_available (); void samples_available ();

View File

@ -83,8 +83,7 @@ S9xPortAudioSoundDriver::stop ()
} }
} }
bool8 bool S9xPortAudioSoundDriver::open_device()
S9xPortAudioSoundDriver::open_device ()
{ {
PaStreamParameters param; PaStreamParameters param;
const PaDeviceInfo *device_info; const PaDeviceInfo *device_info;
@ -101,7 +100,7 @@ S9xPortAudioSoundDriver::open_device ()
fprintf (stderr, fprintf (stderr,
"Couldn't reset audio stream.\nError: %s\n", "Couldn't reset audio stream.\nError: %s\n",
Pa_GetErrorText (err)); Pa_GetErrorText (err));
return TRUE; return true;
} }
audio_stream = NULL; audio_stream = NULL;
@ -171,7 +170,7 @@ S9xPortAudioSoundDriver::open_device ()
{ {
fprintf (stderr, fprintf (stderr,
"Couldn't initialize sound\n"); "Couldn't initialize sound\n");
return FALSE; return false;
} }
S9xSetSamplesAvailableCallback (port_audio_samples_available_callback, this); S9xSetSamplesAvailableCallback (port_audio_samples_available_callback, this);
@ -179,7 +178,7 @@ S9xPortAudioSoundDriver::open_device ()
fflush (stdout); fflush (stdout);
fflush (stderr); fflush (stderr);
return TRUE; return true;
} }
void void

View File

@ -19,7 +19,7 @@ class S9xPortAudioSoundDriver : public S9xSoundDriver
S9xPortAudioSoundDriver (); S9xPortAudioSoundDriver ();
void init (); void init ();
void terminate (); void terminate ();
bool8 open_device (); bool open_device ();
void start (); void start ();
void stop (); void stop ();
void samples_available (); void samples_available ();

View File

@ -116,8 +116,7 @@ stream_state_callback (pa_stream *p, void *userdata)
} }
} }
bool8 bool S9xPulseSoundDriver::open_device()
S9xPulseSoundDriver::open_device ()
{ {
int err = PA_ERR_UNKNOWN; int err = PA_ERR_UNKNOWN;
pa_sample_spec ss; pa_sample_spec ss;
@ -201,7 +200,7 @@ S9xPulseSoundDriver::open_device ()
unlock (); unlock ();
return TRUE; return true;
error3: error3:
pa_stream_disconnect (stream); pa_stream_disconnect (stream);
@ -215,7 +214,7 @@ error1:
error0: error0:
printf ("Failed: %s\n", pa_strerror (err)); printf ("Failed: %s\n", pa_strerror (err));
return FALSE; return false;
} }
void void

View File

@ -17,7 +17,7 @@ class S9xPulseSoundDriver : public S9xSoundDriver
S9xPulseSoundDriver (); S9xPulseSoundDriver ();
void init (); void init ();
void terminate (); void terminate ();
bool8 open_device (); bool open_device ();
void start (); void start ();
void stop (); void stop ();
void samples_available (); void samples_available ();

View File

@ -77,8 +77,7 @@ S9xSDLSoundDriver::stop ()
} }
} }
bool8 bool S9xSDLSoundDriver::open_device()
S9xSDLSoundDriver::open_device ()
{ {
audiospec = (SDL_AudioSpec *) malloc (sizeof (SDL_AudioSpec)); audiospec = (SDL_AudioSpec *) malloc (sizeof (SDL_AudioSpec));
@ -101,12 +100,12 @@ S9xSDLSoundDriver::open_device ()
free (audiospec); free (audiospec);
audiospec = NULL; audiospec = NULL;
return FALSE; return false;
} }
printf ("OK\n"); printf ("OK\n");
S9xSetSamplesAvailableCallback (samples_available, NULL); S9xSetSamplesAvailableCallback (samples_available, NULL);
return TRUE; return true;
} }

View File

@ -18,7 +18,7 @@ class S9xSDLSoundDriver : public S9xSoundDriver
S9xSDLSoundDriver (); S9xSDLSoundDriver ();
void init (); void init ();
void terminate (); void terminate ();
bool8 open_device (); bool open_device ();
void start (); void start ();
void stop (); void stop ();
void mix (unsigned char *output, int bytes); void mix (unsigned char *output, int bytes);

View File

@ -169,7 +169,7 @@ bool WaylandEGLContext::create_context ()
} }
wl_surface_set_buffer_scale (child, scale); wl_surface_set_buffer_scale (child, scale);
gdk_window_invalidate_rect (gdk_window, NULL, FALSE); gdk_window_invalidate_rect (gdk_window, NULL, false);
return true; return true;
} }