Skip to content

Commit

Permalink
haiku: Compatibility cleanup
Browse files Browse the repository at this point in the history
* Drop custom boolean type, rely on bool.
* Clean up home path to consistent location
  • Loading branch information
kallisti5 committed Dec 14, 2014
1 parent 737d366 commit 5dfa250
Show file tree
Hide file tree
Showing 8 changed files with 21 additions and 31 deletions.
2 changes: 1 addition & 1 deletion src/PCEngine.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ PCEngine::InitPaths()

if (getenv("HOME")) {
#ifdef __HAIKU__
snprintf(config_basepath, PATH_MAX, "%s/config/huexpress", getenv("HOME"));
snprintf(config_basepath, PATH_MAX, "%s/config/settings/huexpress", getenv("HOME"));
#else
snprintf(config_basepath, PATH_MAX, "%s/.huexpress", getenv("HOME"));
#endif
Expand Down
6 changes: 1 addition & 5 deletions src/engine/pce.c
Original file line number Diff line number Diff line change
Expand Up @@ -1897,13 +1897,9 @@ InitPCE(char *name)
}
}

char home_directory[256];

strcpy(home_directory, getenv("HOME"));

switch (CD_emulation) {
case 0:
sprintf(sav_path, "%s/.huexpress/%ssav", home_directory,
sprintf(sav_path, "%s/%ssav", config_basepath,
short_cart_name);
break;
case 1:
Expand Down
16 changes: 8 additions & 8 deletions src/engine/pce.h
Original file line number Diff line number Diff line change
Expand Up @@ -169,10 +169,10 @@ extern uchar binbcd[0x100];
extern uint32 pce_cd_sectoraddy;

struct host_sound {
boolean stereo;
bool stereo;
uint32 freq;
uint16 sample_size;
boolean signed_sound;
bool signed_sound;
};

struct host_machine {
Expand All @@ -182,12 +182,12 @@ struct host_machine {
extern struct host_machine host;

struct hugo_options {
boolean want_fullscreen;
boolean want_fullscreen_aspect;
boolean configure_joypads;
boolean want_arcade_card_emulation;
boolean want_supergraphx_emulation;
boolean want_television_size_emulation;
bool want_fullscreen;
bool want_fullscreen_aspect;
bool configure_joypads;
bool want_arcade_card_emulation;
bool want_supergraphx_emulation;
bool want_television_size_emulation;
uint16 window_size;
uint32 want_snd_freq;
uint32 wanted_hardware_format;
Expand Down
2 changes: 1 addition & 1 deletion src/engine/shared_memory.h
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ typedef struct tagIO {

uchar psg_da_data[6][PSG_DIRECT_ACCESS_BUFSIZE];
uint16 psg_da_index[6], psg_da_count[6];
boolean psg_channel_disabled[6];
bool psg_channel_disabled[6];

/* TIMER */
uchar timer_reload, timer_start, timer_counter;
Expand Down
14 changes: 4 additions & 10 deletions src/includes/cleantypes.h
Original file line number Diff line number Diff line change
Expand Up @@ -21,19 +21,13 @@
#define __CLEANTYPES_H


#ifdef TRUE
#undef TRUE
#ifndef FALSE
# define FALSE 0
#endif

#ifdef FALSE
#undef FALSE
#ifndef TRUE
# define TRUE 1
#endif

typedef enum
{
FALSE,
TRUE
} boolean;

/*
* Set datatype sizes
Expand Down
4 changes: 2 additions & 2 deletions src/includes/osd_sdl_snd.h
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
extern Uint8 *stream;
extern Mix_Chunk *chunk;
extern SDL_AudioCVT cvt;
extern boolean Callback_Stop;
extern boolean USE_S16;
extern bool Callback_Stop;
extern bool USE_S16;

#endif
4 changes: 2 additions & 2 deletions src/osd_keyboard.c
Original file line number Diff line number Diff line change
Expand Up @@ -226,7 +226,7 @@ sdl_config_joypad_axis(short which, joymap axis, uint16 * bad_axes,
uint16 num_axes) {

uchar t;
boolean done = FALSE;
bool done = FALSE;

while (1) {
if (read (fileno (stdin), &t, 1) == -1)
Expand Down Expand Up @@ -289,7 +289,7 @@ sdl_config_joypad_button (short which, joymap button, uint16 * bad_buttons,
uint16 num_buttons)
{
uchar t;
boolean done = FALSE;
bool done = FALSE;

while (1) {
if (read (fileno (stdin), &t, 1) == -1)
Expand Down
4 changes: 2 additions & 2 deletions src/osd_sdl_snd.c
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@
Uint8 *stream;
Mix_Chunk *chunk;
SDL_AudioCVT cvt;
boolean Callback_Stop;
boolean USE_S16;
bool Callback_Stop;
bool USE_S16;


void
Expand Down

0 comments on commit 5dfa250

Please sign in to comment.