Normalization of function names according to C standards
This commit is contained in:
parent
9babcb518d
commit
c0efbd9ccc
19 changed files with 221 additions and 219 deletions
|
@ -435,7 +435,7 @@ TCHAR *cfgfile_option_get(const TCHAR *s, const TCHAR *option)
|
||||||
return cfgfile_option_find_it(s, option, true);
|
return cfgfile_option_find_it(s, option, true);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void trimwsa(char* s)
|
static void trim_wsa(char* s)
|
||||||
{
|
{
|
||||||
/* Delete trailing whitespace. */
|
/* Delete trailing whitespace. */
|
||||||
int len = strlen(s);
|
int len = strlen(s);
|
||||||
|
@ -626,7 +626,7 @@ static TCHAR *cfgfile_get_multipath2 (struct multipath *mp, const TCHAR *path, c
|
||||||
if (!s) {
|
if (!s) {
|
||||||
TCHAR np[MAX_DPATH];
|
TCHAR np[MAX_DPATH];
|
||||||
_tcscpy (np, mp->path[i]);
|
_tcscpy (np, mp->path[i]);
|
||||||
fixtrailing (np);
|
fix_trailing (np);
|
||||||
_tcscat (np, file);
|
_tcscat (np, file);
|
||||||
//fullpath (np, sizeof np / sizeof (TCHAR));
|
//fullpath (np, sizeof np / sizeof (TCHAR));
|
||||||
s = my_strdup (np);
|
s = my_strdup (np);
|
||||||
|
@ -971,7 +971,7 @@ static void cfgfile_adjust_path(TCHAR *path, int maxsz, struct multipath *mp)
|
||||||
if (mp->path[i][0] && _tcscmp(mp->path[i], _T(".\\")) != 0 && _tcscmp(mp->path[i], _T("./")) != 0 && (path[0] != '/' && path[0] != '\\' && !_tcschr(path, ':'))) {
|
if (mp->path[i][0] && _tcscmp(mp->path[i], _T(".\\")) != 0 && _tcscmp(mp->path[i], _T("./")) != 0 && (path[0] != '/' && path[0] != '\\' && !_tcschr(path, ':'))) {
|
||||||
TCHAR np[MAX_DPATH];
|
TCHAR np[MAX_DPATH];
|
||||||
_tcscpy(np, mp->path[i]);
|
_tcscpy(np, mp->path[i]);
|
||||||
fixtrailing(np);
|
fix_trailing(np);
|
||||||
_tcscat(np, s);
|
_tcscat(np, s);
|
||||||
//fullpath(np, sizeof np / sizeof(TCHAR));
|
//fullpath(np, sizeof np / sizeof(TCHAR));
|
||||||
if (zfile_exists(np)) {
|
if (zfile_exists(np)) {
|
||||||
|
@ -2620,7 +2620,7 @@ static int cfgfile_multipath (const TCHAR *option, const TCHAR *value, const TCH
|
||||||
TCHAR *s = target_expand_environment (tmploc, NULL, 0);
|
TCHAR *s = target_expand_environment (tmploc, NULL, 0);
|
||||||
_tcsncpy (mp->path[i], s, MAX_DPATH - 1);
|
_tcsncpy (mp->path[i], s, MAX_DPATH - 1);
|
||||||
mp->path[i][MAX_DPATH - 1] = 0;
|
mp->path[i][MAX_DPATH - 1] = 0;
|
||||||
fixtrailing (mp->path[i]);
|
fix_trailing (mp->path[i]);
|
||||||
xfree (s);
|
xfree (s);
|
||||||
//target_multipath_modified(p);
|
//target_multipath_modified(p);
|
||||||
return 1;
|
return 1;
|
||||||
|
@ -5127,7 +5127,7 @@ static int cfgfile_load_2(struct uae_prefs* p, const TCHAR* filename, bool real,
|
||||||
|
|
||||||
while (cfg_fgets(linea, sizeof (linea), fh) != nullptr)
|
while (cfg_fgets(linea, sizeof (linea), fh) != nullptr)
|
||||||
{
|
{
|
||||||
trimwsa(linea);
|
trim_wsa(linea);
|
||||||
if (strlen(linea) > 0)
|
if (strlen(linea) > 0)
|
||||||
{
|
{
|
||||||
if (linea[0] == '#' || linea[0] == ';')
|
if (linea[0] == '#' || linea[0] == ';')
|
||||||
|
|
|
@ -923,7 +923,7 @@ static int set_filesys_unit_1 (int nr, struct uaedev_config_info *ci, bool custo
|
||||||
for (i = 0; i < MAX_FILESYSTEM_UNITS; i++) {
|
for (i = 0; i < MAX_FILESYSTEM_UNITS; i++) {
|
||||||
if (nr == i || !mountinfo.ui[i].open || mountinfo.ui[i].rootdir == NULL || is_hardfile (i) == FILESYS_CD)
|
if (nr == i || !mountinfo.ui[i].open || mountinfo.ui[i].rootdir == NULL || is_hardfile (i) == FILESYS_CD)
|
||||||
continue;
|
continue;
|
||||||
if (_tcslen(c.rootdir) > 0 && samepath(mountinfo.ui[i].rootdir, c.rootdir)) {
|
if (_tcslen(c.rootdir) > 0 && same_path(mountinfo.ui[i].rootdir, c.rootdir)) {
|
||||||
error_log (_T("directory/hardfile '%s' already added."), c.rootdir);
|
error_log (_T("directory/hardfile '%s' already added."), c.rootdir);
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
|
@ -38,13 +38,13 @@ extern void target_startup_msg(const TCHAR *title, const TCHAR *msg);
|
||||||
extern void target_cpu_speed(void);
|
extern void target_cpu_speed(void);
|
||||||
extern int target_sleep_nanos(int);
|
extern int target_sleep_nanos(int);
|
||||||
extern bool get_plugin_path (TCHAR *out, int size, const TCHAR *path);
|
extern bool get_plugin_path (TCHAR *out, int size, const TCHAR *path);
|
||||||
extern void stripslashes (TCHAR *p);
|
extern void strip_slashes (TCHAR *p);
|
||||||
extern void fixtrailing (TCHAR *p);
|
extern void fix_trailing (TCHAR *p);
|
||||||
extern void fullpath(TCHAR *path, int size);
|
extern void fullpath(TCHAR *path, int size);
|
||||||
extern void fullpath(TCHAR *path, int size, bool userelative);
|
extern void fullpath(TCHAR *path, int size, bool userelative);
|
||||||
extern void getpathpart (TCHAR *outpath, int size, const TCHAR *inpath);
|
extern void get_path_part (TCHAR *outpath, int size, const TCHAR *inpath);
|
||||||
extern void getfilepart (TCHAR *out, int size, const TCHAR *path);
|
extern void get_file_part (TCHAR *out, int size, const TCHAR *path);
|
||||||
extern bool samepath(const TCHAR *p1, const TCHAR *p2);
|
extern bool same_path(const TCHAR *p1, const TCHAR *p2);
|
||||||
extern bool target_isrelativemode(void);
|
extern bool target_isrelativemode(void);
|
||||||
extern uae_u32 getlocaltime (void);
|
extern uae_u32 getlocaltime (void);
|
||||||
extern bool isguiactive(void);
|
extern bool isguiactive(void);
|
||||||
|
|
|
@ -193,7 +193,7 @@ void logging_init(void)
|
||||||
{
|
{
|
||||||
static int started;
|
static int started;
|
||||||
static int first;
|
static int first;
|
||||||
char debugfilename[MAX_DPATH];
|
char debug_filename[MAX_DPATH];
|
||||||
|
|
||||||
if (first > 1)
|
if (first > 1)
|
||||||
{
|
{
|
||||||
|
@ -207,9 +207,9 @@ void logging_init(void)
|
||||||
debugfile = nullptr;
|
debugfile = nullptr;
|
||||||
}
|
}
|
||||||
|
|
||||||
sprintf(debugfilename, "%s", logfile_path);
|
sprintf(debug_filename, "%s", logfile_path);
|
||||||
if (!debugfile)
|
if (!debugfile)
|
||||||
debugfile = fopen(debugfilename, "wt");
|
debugfile = fopen(debug_filename, "wt");
|
||||||
|
|
||||||
first++;
|
first++;
|
||||||
write_log("AMIBERRY Logfile\n\n");
|
write_log("AMIBERRY Logfile\n\n");
|
||||||
|
@ -224,13 +224,13 @@ void logging_cleanup(void)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void stripslashes(TCHAR* p)
|
void strip_slashes(TCHAR* p)
|
||||||
{
|
{
|
||||||
while (_tcslen(p) > 0 && (p[_tcslen(p) - 1] == '\\' || p[_tcslen(p) - 1] == '/'))
|
while (_tcslen(p) > 0 && (p[_tcslen(p) - 1] == '\\' || p[_tcslen(p) - 1] == '/'))
|
||||||
p[_tcslen(p) - 1] = 0;
|
p[_tcslen(p) - 1] = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
void fixtrailing(TCHAR* p)
|
void fix_trailing(TCHAR* p)
|
||||||
{
|
{
|
||||||
if (_tcslen(p) == 0)
|
if (_tcslen(p) == 0)
|
||||||
return;
|
return;
|
||||||
|
@ -239,23 +239,23 @@ void fixtrailing(TCHAR* p)
|
||||||
_tcscat(p, "/");
|
_tcscat(p, "/");
|
||||||
}
|
}
|
||||||
|
|
||||||
bool samepath(const TCHAR* p1, const TCHAR* p2)
|
bool same_path(const TCHAR* p1, const TCHAR* p2)
|
||||||
{
|
{
|
||||||
if (!_tcsicmp(p1, p2))
|
if (!_tcsicmp(p1, p2))
|
||||||
return true;
|
return true;
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
void getpathpart(TCHAR* outpath, int size, const TCHAR* inpath)
|
void get_path_part(TCHAR* outpath, int size, const TCHAR* inpath)
|
||||||
{
|
{
|
||||||
_tcscpy(outpath, inpath);
|
_tcscpy(outpath, inpath);
|
||||||
auto* const p = _tcsrchr(outpath, '/');
|
auto* const p = _tcsrchr(outpath, '/');
|
||||||
if (p)
|
if (p)
|
||||||
p[0] = 0;
|
p[0] = 0;
|
||||||
fixtrailing(outpath);
|
fix_trailing(outpath);
|
||||||
}
|
}
|
||||||
|
|
||||||
void getfilepart(TCHAR* out, int size, const TCHAR* path)
|
void get_file_part(TCHAR* out, int size, const TCHAR* path)
|
||||||
{
|
{
|
||||||
out[0] = 0;
|
out[0] = 0;
|
||||||
const auto* const p = _tcsrchr(path, '/');
|
const auto* const p = _tcsrchr(path, '/');
|
||||||
|
@ -630,7 +630,7 @@ void get_saveimage_path(char* out, int size, int dir)
|
||||||
|
|
||||||
void get_configuration_path(char* out, int size)
|
void get_configuration_path(char* out, int size)
|
||||||
{
|
{
|
||||||
fixtrailing(config_path);
|
fix_trailing(config_path);
|
||||||
strncpy(out, config_path, size - 1);
|
strncpy(out, config_path, size - 1);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -641,7 +641,7 @@ void set_configuration_path(char* newpath)
|
||||||
|
|
||||||
void get_controllers_path(char* out, int size)
|
void get_controllers_path(char* out, int size)
|
||||||
{
|
{
|
||||||
fixtrailing(controllers_path);
|
fix_trailing(controllers_path);
|
||||||
strncpy(out, controllers_path, size - 1);
|
strncpy(out, controllers_path, size - 1);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -682,7 +682,7 @@ void set_logfile_path(char* newpath)
|
||||||
|
|
||||||
void get_rom_path(char* out, int size)
|
void get_rom_path(char* out, int size)
|
||||||
{
|
{
|
||||||
fixtrailing(rom_path);
|
fix_trailing(rom_path);
|
||||||
strncpy(out, rom_path, size - 1);
|
strncpy(out, rom_path, size - 1);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -693,7 +693,7 @@ void set_rom_path(char* newpath)
|
||||||
|
|
||||||
void get_rp9_path(char* out, int size)
|
void get_rp9_path(char* out, int size)
|
||||||
{
|
{
|
||||||
fixtrailing(rp9_path);
|
fix_trailing(rp9_path);
|
||||||
strncpy(out, rp9_path, size - 1);
|
strncpy(out, rp9_path, size - 1);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -724,7 +724,7 @@ int target_cfgfile_load(struct uae_prefs* p, const char* filename, int type, int
|
||||||
// Load rp9 config
|
// Load rp9 config
|
||||||
result = rp9_parse_file(p, filename);
|
result = rp9_parse_file(p, filename);
|
||||||
if (result)
|
if (result)
|
||||||
extractFileName(filename, last_loaded_config);
|
extract_filename(filename, last_loaded_config);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
@ -735,7 +735,7 @@ int target_cfgfile_load(struct uae_prefs* p, const char* filename, int type, int
|
||||||
result = cfgfile_load(p, filename, &config_type, 0, 1);
|
result = cfgfile_load(p, filename, &config_type, 0, 1);
|
||||||
}
|
}
|
||||||
if (result)
|
if (result)
|
||||||
extractFileName(filename, last_loaded_config);
|
extract_filename(filename, last_loaded_config);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (result)
|
if (result)
|
||||||
|
@ -785,7 +785,7 @@ int check_configfile(char* file)
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
void extractFileName(const char* str, char* buffer)
|
void extract_filename(const char* str, char* buffer)
|
||||||
{
|
{
|
||||||
const auto* p = str + strlen(str) - 1;
|
const auto* p = str + strlen(str) - 1;
|
||||||
while (*p != '/' && p >= str)
|
while (*p != '/' && p >= str)
|
||||||
|
@ -794,7 +794,7 @@ void extractFileName(const char* str, char* buffer)
|
||||||
strncpy(buffer, p, MAX_DPATH - 1);
|
strncpy(buffer, p, MAX_DPATH - 1);
|
||||||
}
|
}
|
||||||
|
|
||||||
void extractPath(char* str, char* buffer)
|
void extract_path(char* str, char* buffer)
|
||||||
{
|
{
|
||||||
strncpy(buffer, str, MAX_DPATH - 1);
|
strncpy(buffer, str, MAX_DPATH - 1);
|
||||||
auto* p = buffer + strlen(buffer) - 1;
|
auto* p = buffer + strlen(buffer) - 1;
|
||||||
|
@ -803,7 +803,7 @@ void extractPath(char* str, char* buffer)
|
||||||
p[1] = '\0';
|
p[1] = '\0';
|
||||||
}
|
}
|
||||||
|
|
||||||
void removeFileExtension(char* filename)
|
void remove_file_extension(char* filename)
|
||||||
{
|
{
|
||||||
auto* p = filename + strlen(filename) - 1;
|
auto* p = filename + strlen(filename) - 1;
|
||||||
while (p >= filename && *p != '.')
|
while (p >= filename && *p != '.')
|
||||||
|
@ -814,7 +814,7 @@ void removeFileExtension(char* filename)
|
||||||
*p = '\0';
|
*p = '\0';
|
||||||
}
|
}
|
||||||
|
|
||||||
void ReadDirectory(const char* path, std::vector<std::string>* dirs, std::vector<std::string>* files)
|
void read_directory(const char* path, std::vector<std::string>* dirs, std::vector<std::string>* files)
|
||||||
{
|
{
|
||||||
struct dirent* dent;
|
struct dirent* dent;
|
||||||
|
|
||||||
|
@ -1092,7 +1092,7 @@ void get_string(FILE* f, char* dst, int size)
|
||||||
strncpy(dst, buffer, size);
|
strncpy(dst, buffer, size);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void trimwsa(char* s)
|
static void trim_wsa(char* s)
|
||||||
{
|
{
|
||||||
/* Delete trailing whitespace. */
|
/* Delete trailing whitespace. */
|
||||||
int len = strlen(s);
|
int len = strlen(s);
|
||||||
|
@ -1139,7 +1139,7 @@ void load_amiberry_settings(void)
|
||||||
|
|
||||||
while (zfile_fgetsa(linea, sizeof linea, fh) != nullptr)
|
while (zfile_fgetsa(linea, sizeof linea, fh) != nullptr)
|
||||||
{
|
{
|
||||||
trimwsa(linea);
|
trim_wsa(linea);
|
||||||
if (strlen(linea) > 0)
|
if (strlen(linea) > 0)
|
||||||
{
|
{
|
||||||
if (!cfgfile_separate_linea(path, linea, option, value))
|
if (!cfgfile_separate_linea(path, linea, option, value))
|
||||||
|
|
|
@ -275,7 +275,7 @@ void RescanROMs()
|
||||||
get_rom_path(path, MAX_DPATH);
|
get_rom_path(path, MAX_DPATH);
|
||||||
|
|
||||||
load_keyring(&changed_prefs, path);
|
load_keyring(&changed_prefs, path);
|
||||||
ReadDirectory(path, nullptr, &files);
|
read_directory(path, nullptr, &files);
|
||||||
for (auto & file : files)
|
for (auto & file : files)
|
||||||
{
|
{
|
||||||
char tmppath[MAX_DPATH];
|
char tmppath[MAX_DPATH];
|
||||||
|
@ -320,7 +320,7 @@ void ReadConfigFileList(void)
|
||||||
|
|
||||||
// Read rp9 files
|
// Read rp9 files
|
||||||
get_rp9_path(path, MAX_DPATH);
|
get_rp9_path(path, MAX_DPATH);
|
||||||
ReadDirectory(path, nullptr, &files);
|
read_directory(path, nullptr, &files);
|
||||||
FilterFiles(&files, filter_rp9);
|
FilterFiles(&files, filter_rp9);
|
||||||
for (auto & file : files)
|
for (auto & file : files)
|
||||||
{
|
{
|
||||||
|
@ -328,14 +328,14 @@ void ReadConfigFileList(void)
|
||||||
strncpy(tmp->FullPath, path, MAX_DPATH - 1);
|
strncpy(tmp->FullPath, path, MAX_DPATH - 1);
|
||||||
strncat(tmp->FullPath, file.c_str(), MAX_DPATH - 1);
|
strncat(tmp->FullPath, file.c_str(), MAX_DPATH - 1);
|
||||||
strncpy(tmp->Name, file.c_str(), MAX_DPATH - 1);
|
strncpy(tmp->Name, file.c_str(), MAX_DPATH - 1);
|
||||||
removeFileExtension(tmp->Name);
|
remove_file_extension(tmp->Name);
|
||||||
strncpy(tmp->Description, _T("rp9"), MAX_DPATH - 1);
|
strncpy(tmp->Description, _T("rp9"), MAX_DPATH - 1);
|
||||||
ConfigFilesList.emplace_back(tmp);
|
ConfigFilesList.emplace_back(tmp);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Read standard config files
|
// Read standard config files
|
||||||
get_configuration_path(path, MAX_DPATH);
|
get_configuration_path(path, MAX_DPATH);
|
||||||
ReadDirectory(path, nullptr, &files);
|
read_directory(path, nullptr, &files);
|
||||||
FilterFiles(&files, filter_uae);
|
FilterFiles(&files, filter_uae);
|
||||||
for (auto & file : files)
|
for (auto & file : files)
|
||||||
{
|
{
|
||||||
|
@ -343,7 +343,7 @@ void ReadConfigFileList(void)
|
||||||
strncpy(tmp->FullPath, path, MAX_DPATH - 1);
|
strncpy(tmp->FullPath, path, MAX_DPATH - 1);
|
||||||
strncat(tmp->FullPath, file.c_str(), MAX_DPATH - 1);
|
strncat(tmp->FullPath, file.c_str(), MAX_DPATH - 1);
|
||||||
strncpy(tmp->Name, file.c_str(), MAX_DPATH - 1);
|
strncpy(tmp->Name, file.c_str(), MAX_DPATH - 1);
|
||||||
removeFileExtension(tmp->Name);
|
remove_file_extension(tmp->Name);
|
||||||
// If the user has many (thousands) of configs, this will take a long time
|
// If the user has many (thousands) of configs, this will take a long time
|
||||||
if (amiberry_options.read_config_descriptions)
|
if (amiberry_options.read_config_descriptions)
|
||||||
{
|
{
|
||||||
|
@ -469,14 +469,14 @@ int gui_update()
|
||||||
get_screenshot_path(screenshot_filename, MAX_DPATH - 1);
|
get_screenshot_path(screenshot_filename, MAX_DPATH - 1);
|
||||||
|
|
||||||
if (strlen(currprefs.floppyslots[0].df) > 0)
|
if (strlen(currprefs.floppyslots[0].df) > 0)
|
||||||
extractFileName(currprefs.floppyslots[0].df, tmp);
|
extract_filename(currprefs.floppyslots[0].df, tmp);
|
||||||
else
|
else
|
||||||
strncpy(tmp, last_loaded_config, MAX_DPATH - 1);
|
strncpy(tmp, last_loaded_config, MAX_DPATH - 1);
|
||||||
|
|
||||||
strncat(savestate_fname, tmp, MAX_DPATH - 1);
|
strncat(savestate_fname, tmp, MAX_DPATH - 1);
|
||||||
strncat(screenshot_filename, tmp, MAX_DPATH - 1);
|
strncat(screenshot_filename, tmp, MAX_DPATH - 1);
|
||||||
removeFileExtension(savestate_fname);
|
remove_file_extension(savestate_fname);
|
||||||
removeFileExtension(screenshot_filename);
|
remove_file_extension(screenshot_filename);
|
||||||
|
|
||||||
switch(currentStateNum)
|
switch(currentStateNum)
|
||||||
{
|
{
|
||||||
|
|
|
@ -993,7 +993,7 @@ static void unacquire_joystick(int num)
|
||||||
|
|
||||||
static const TCHAR* get_joystick_friendlyname(const int joy)
|
static const TCHAR* get_joystick_friendlyname(const int joy)
|
||||||
{
|
{
|
||||||
const auto tmp1 = new char[255];
|
auto* const tmp1 = new char[255];
|
||||||
for (auto n = 0; n < num_keys_as_joys; ++n)
|
for (auto n = 0; n < num_keys_as_joys; ++n)
|
||||||
{
|
{
|
||||||
if (joy == n)
|
if (joy == n)
|
||||||
|
@ -1119,61 +1119,62 @@ static int get_joystick_flags(int num)
|
||||||
|
|
||||||
static void read_joystick()
|
static void read_joystick()
|
||||||
{
|
{
|
||||||
for (auto joyid = 0; joyid < MAX_JPORTS; joyid++)
|
for (auto joy_id = 0; joy_id < MAX_JPORTS; joy_id++)
|
||||||
{
|
{
|
||||||
// First handle retroarch (or default) keys as Joystick...
|
// First handle retroarch (or default) keys as Joystick...
|
||||||
if (currprefs.jports[joyid].id >= JSEM_JOYS && currprefs.jports[joyid].id < JSEM_JOYS + num_keys_as_joys)
|
if (currprefs.jports[joy_id].id >= JSEM_JOYS && currprefs.jports[joy_id].id < JSEM_JOYS + num_keys_as_joys)
|
||||||
{
|
{
|
||||||
//
|
const auto host_key_id = currprefs.jports[joy_id].id - JSEM_JOYS;
|
||||||
const auto hostkeyid = currprefs.jports[joyid].id - JSEM_JOYS;
|
const auto* key_state = SDL_GetKeyboardState(nullptr);
|
||||||
auto keystate = SDL_GetKeyboardState(nullptr);
|
const auto kb = host_key_id;
|
||||||
auto kb = hostkeyid;
|
|
||||||
|
|
||||||
// cd32 red, blue, green, yellow
|
// cd32 red, blue, green, yellow
|
||||||
setjoybuttonstate(kb, 0, keystate[host_keyboard_buttons[kb].south_button] & 1); // b
|
setjoybuttonstate(kb, 0, key_state[host_keyboard_buttons[kb].south_button] & 1); // b
|
||||||
setjoybuttonstate(kb, 1, keystate[host_keyboard_buttons[kb].east_button] & 1); // a
|
setjoybuttonstate(kb, 1, key_state[host_keyboard_buttons[kb].east_button] & 1); // a
|
||||||
setjoybuttonstate(kb, 2, keystate[host_keyboard_buttons[kb].north_button] & 1); //y
|
setjoybuttonstate(kb, 2, key_state[host_keyboard_buttons[kb].north_button] & 1); //y
|
||||||
setjoybuttonstate(kb, 3, keystate[host_keyboard_buttons[kb].west_button] & 1); // x
|
setjoybuttonstate(kb, 3, key_state[host_keyboard_buttons[kb].west_button] & 1); // x
|
||||||
|
|
||||||
setjoybuttonstate(kb, 4, keystate[host_keyboard_buttons[kb].left_shoulder] & 1); // z
|
setjoybuttonstate(kb, 4, key_state[host_keyboard_buttons[kb].left_shoulder] & 1); // z
|
||||||
setjoybuttonstate(kb, 5, keystate[host_keyboard_buttons[kb].right_shoulder] & 1); // x
|
setjoybuttonstate(kb, 5, key_state[host_keyboard_buttons[kb].right_shoulder] & 1); // x
|
||||||
setjoybuttonstate(kb, 6, keystate[host_keyboard_buttons[kb].start_button] & 1); //num1
|
setjoybuttonstate(kb, 6, key_state[host_keyboard_buttons[kb].start_button] & 1); //num1
|
||||||
// up down left right
|
// up down left right
|
||||||
setjoybuttonstate(kb, 7, keystate[host_keyboard_buttons[kb].dpad_up] & 1);
|
setjoybuttonstate(kb, 7, key_state[host_keyboard_buttons[kb].dpad_up] & 1);
|
||||||
setjoybuttonstate(kb, 8, keystate[host_keyboard_buttons[kb].dpad_down] & 1);
|
setjoybuttonstate(kb, 8, key_state[host_keyboard_buttons[kb].dpad_down] & 1);
|
||||||
setjoybuttonstate(kb, 9, keystate[host_keyboard_buttons[kb].dpad_left] & 1);
|
setjoybuttonstate(kb, 9, key_state[host_keyboard_buttons[kb].dpad_left] & 1);
|
||||||
setjoybuttonstate(kb, 10, keystate[host_keyboard_buttons[kb].dpad_right] & 1);
|
setjoybuttonstate(kb, 10, key_state[host_keyboard_buttons[kb].dpad_right] & 1);
|
||||||
|
|
||||||
// stick left/right
|
// stick left/right
|
||||||
setjoybuttonstate(kb, 11, keystate[host_keyboard_buttons[kb].lstick_button] & 1);
|
setjoybuttonstate(kb, 11, key_state[host_keyboard_buttons[kb].lstick_button] & 1);
|
||||||
setjoybuttonstate(kb, 12, keystate[host_keyboard_buttons[kb].rstick_button] & 1);
|
setjoybuttonstate(kb, 12, key_state[host_keyboard_buttons[kb].rstick_button] & 1);
|
||||||
setjoybuttonstate(kb, 13, keystate[host_keyboard_buttons[kb].select_button] & 1); // num2
|
setjoybuttonstate(kb, 13, key_state[host_keyboard_buttons[kb].select_button] & 1); // num2
|
||||||
|
|
||||||
// hotkey?
|
// hotkey?
|
||||||
if (host_keyboard_buttons[kb].hotkey_button != -1 && keystate[host_keyboard_buttons[kb].hotkey_button] & 1)
|
if (host_keyboard_buttons[kb].hotkey_button != -1 && key_state[host_keyboard_buttons[kb].hotkey_button] & 1)
|
||||||
{
|
{
|
||||||
//held_offset = REMAP_BUTTONS;
|
//held_offset = REMAP_BUTTONS;
|
||||||
// menu button
|
// menu button
|
||||||
if (host_keyboard_buttons[kb].menu_button != -1)
|
if (host_keyboard_buttons[kb].menu_button != -1)
|
||||||
setjoybuttonstate(kb, 14, keystate[host_keyboard_buttons[kb].menu_button] & 1);
|
setjoybuttonstate(kb, 14, key_state[host_keyboard_buttons[kb].menu_button] & 1);
|
||||||
// quit button
|
// quit button
|
||||||
if (host_keyboard_buttons[kb].quit_button != -1)
|
if (host_keyboard_buttons[kb].quit_button != -1)
|
||||||
setjoybuttonstate(kb, 15, keystate[host_keyboard_buttons[kb].quit_button] & 1);
|
setjoybuttonstate(kb, 15, key_state[host_keyboard_buttons[kb].quit_button] & 1);
|
||||||
// reset button
|
// reset button
|
||||||
//setjoybuttonstate(kb, 30,keystate[host_keyboard_buttons[kb].reset_button] & 1) ;
|
//setjoybuttonstate(kb, 30,keystate[host_keyboard_buttons[kb].reset_button] & 1) ;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// this is what we actually use on the Pi (for joysticks :)
|
// this is what we actually use on the Pi (for joysticks :)
|
||||||
else if (jsem_isjoy(joyid, &currprefs) != -1)
|
else if (jsem_isjoy(joy_id, &currprefs) != -1)
|
||||||
{
|
{
|
||||||
// Now we handle real SDL joystick...
|
// Now we handle real SDL joystick...
|
||||||
const auto hostjoyid = currprefs.jports[joyid].id - JSEM_JOYS - num_keys_as_joys;
|
const auto host_joy_id = currprefs.jports[joy_id].id - JSEM_JOYS - num_keys_as_joys;
|
||||||
static struct host_input_button current_controller_map;
|
static struct host_input_button current_controller_map;
|
||||||
current_controller_map = host_input_buttons[hostjoyid];
|
current_controller_map = host_input_buttons[host_joy_id];
|
||||||
|
|
||||||
const auto joy_offset = num_keys_as_joys;
|
const auto joy_offset = num_keys_as_joys;
|
||||||
|
|
||||||
|
if (current_controller_map.hotkey_button != -1)
|
||||||
|
{
|
||||||
if (current_controller_map.east_button == current_controller_map.hotkey_button)
|
if (current_controller_map.east_button == current_controller_map.hotkey_button)
|
||||||
current_controller_map.east_button = -1;
|
current_controller_map.east_button = -1;
|
||||||
if (current_controller_map.south_button == current_controller_map.hotkey_button)
|
if (current_controller_map.south_button == current_controller_map.hotkey_button)
|
||||||
|
@ -1206,6 +1207,7 @@ static void read_joystick()
|
||||||
current_controller_map.left_shoulder = -1;
|
current_controller_map.left_shoulder = -1;
|
||||||
if (current_controller_map.right_shoulder == current_controller_map.hotkey_button)
|
if (current_controller_map.right_shoulder == current_controller_map.hotkey_button)
|
||||||
current_controller_map.right_shoulder = -1;
|
current_controller_map.right_shoulder = -1;
|
||||||
|
}
|
||||||
|
|
||||||
auto held_offset = 0;
|
auto held_offset = 0;
|
||||||
|
|
||||||
|
@ -1214,37 +1216,37 @@ static void read_joystick()
|
||||||
{
|
{
|
||||||
if (current_controller_map.menu_button != -1)
|
if (current_controller_map.menu_button != -1)
|
||||||
{
|
{
|
||||||
setjoybuttonstate(hostjoyid + joy_offset, 14,
|
setjoybuttonstate(host_joy_id + joy_offset, 14,
|
||||||
SDL_JoystickGetButton(joysticktable[hostjoyid],
|
SDL_JoystickGetButton(joysticktable[host_joy_id],
|
||||||
current_controller_map.menu_button) & 1);
|
current_controller_map.menu_button) & 1);
|
||||||
}
|
}
|
||||||
if (current_controller_map.quit_button != -1)
|
if (current_controller_map.quit_button != -1)
|
||||||
{
|
{
|
||||||
setjoybuttonstate(hostjoyid + joy_offset, 15,
|
setjoybuttonstate(host_joy_id + joy_offset, 15,
|
||||||
SDL_JoystickGetButton(joysticktable[hostjoyid],
|
SDL_JoystickGetButton(joysticktable[host_joy_id],
|
||||||
current_controller_map.quit_button) & 1);
|
current_controller_map.quit_button) & 1);
|
||||||
}
|
}
|
||||||
if (current_controller_map.reset_button != -1)
|
if (current_controller_map.reset_button != -1)
|
||||||
{
|
{
|
||||||
setjoybuttonstate(hostjoyid + joy_offset, 30,
|
setjoybuttonstate(host_joy_id + joy_offset, 30,
|
||||||
SDL_JoystickGetButton(joysticktable[hostjoyid],
|
SDL_JoystickGetButton(joysticktable[host_joy_id],
|
||||||
current_controller_map.reset_button) & 1);
|
current_controller_map.reset_button) & 1);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
// temporary solution for retroarch buttons inc. HOTKEY
|
// temporary solution for retroarch buttons inc. HOTKEY
|
||||||
else if (SDL_JoystickGetButton(joysticktable[hostjoyid], current_controller_map.hotkey_button) & 1)
|
else if (SDL_JoystickGetButton(joysticktable[host_joy_id], current_controller_map.hotkey_button) & 1)
|
||||||
{
|
{
|
||||||
held_offset = REMAP_BUTTONS;
|
held_offset = REMAP_BUTTONS;
|
||||||
setjoybuttonstate(hostjoyid + joy_offset, 14,
|
setjoybuttonstate(host_joy_id + joy_offset, 14,
|
||||||
SDL_JoystickGetButton(joysticktable[hostjoyid], current_controller_map.menu_button) &
|
SDL_JoystickGetButton(joysticktable[host_joy_id], current_controller_map.menu_button) &
|
||||||
1);
|
1);
|
||||||
// menu button
|
// menu button
|
||||||
setjoybuttonstate(hostjoyid + joy_offset, 15,
|
setjoybuttonstate(host_joy_id + joy_offset, 15,
|
||||||
SDL_JoystickGetButton(joysticktable[hostjoyid], current_controller_map.quit_button) &
|
SDL_JoystickGetButton(joysticktable[host_joy_id], current_controller_map.quit_button) &
|
||||||
1);
|
1);
|
||||||
// quit button
|
// quit button
|
||||||
setjoybuttonstate(hostjoyid + joy_offset, 30,
|
setjoybuttonstate(host_joy_id + joy_offset, 30,
|
||||||
SDL_JoystickGetButton(joysticktable[hostjoyid], current_controller_map.reset_button) &
|
SDL_JoystickGetButton(joysticktable[host_joy_id], current_controller_map.reset_button) &
|
||||||
1);
|
1);
|
||||||
// reset button
|
// reset button
|
||||||
}
|
}
|
||||||
|
@ -1261,7 +1263,7 @@ static void read_joystick()
|
||||||
held_offset = 0;
|
held_offset = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (SDL_JoystickNumAxes(joysticktable[hostjoyid]) > 0)
|
if (SDL_JoystickNumAxes(joysticktable[host_joy_id]) > 0)
|
||||||
{
|
{
|
||||||
int val;
|
int val;
|
||||||
|
|
||||||
|
@ -1275,21 +1277,21 @@ static void read_joystick()
|
||||||
// handle the X axis (left stick)
|
// handle the X axis (left stick)
|
||||||
if (current_controller_map.lstick_axis_x != -1)
|
if (current_controller_map.lstick_axis_x != -1)
|
||||||
{
|
{
|
||||||
val = SDL_JoystickGetAxis(joysticktable[hostjoyid], current_controller_map.lstick_axis_x);
|
val = SDL_JoystickGetAxis(joysticktable[host_joy_id], current_controller_map.lstick_axis_x);
|
||||||
if (current_controller_map.lstick_axis_x_invert != 0)
|
if (current_controller_map.lstick_axis_x_invert != 0)
|
||||||
val = val * -1;
|
val = val * -1;
|
||||||
|
|
||||||
setjoystickstate(hostjoyid + joy_offset, 0, val, upper_bound);
|
setjoystickstate(host_joy_id + joy_offset, 0, val, upper_bound);
|
||||||
}
|
}
|
||||||
|
|
||||||
// handle the Y axis
|
// handle the Y axis
|
||||||
if (current_controller_map.lstick_axis_y != -1)
|
if (current_controller_map.lstick_axis_y != -1)
|
||||||
{
|
{
|
||||||
val = SDL_JoystickGetAxis(joysticktable[hostjoyid], current_controller_map.lstick_axis_y);
|
val = SDL_JoystickGetAxis(joysticktable[host_joy_id], current_controller_map.lstick_axis_y);
|
||||||
if (current_controller_map.lstick_axis_y_invert != 0)
|
if (current_controller_map.lstick_axis_y_invert != 0)
|
||||||
val = val * -1;
|
val = val * -1;
|
||||||
|
|
||||||
setjoystickstate(hostjoyid + joy_offset, 1, val, upper_bound);
|
setjoystickstate(host_joy_id + joy_offset, 1, val, upper_bound);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
@ -1298,14 +1300,14 @@ static void read_joystick()
|
||||||
// handle the Y axis (left stick)
|
// handle the Y axis (left stick)
|
||||||
if (current_controller_map.lstick_axis_y != -1)
|
if (current_controller_map.lstick_axis_y != -1)
|
||||||
{
|
{
|
||||||
setjoybuttonstate(hostjoyid + joy_offset, 7 + held_offset,
|
setjoybuttonstate(host_joy_id + joy_offset, 7 + held_offset,
|
||||||
SDL_JoystickGetAxis(joysticktable[hostjoyid],
|
SDL_JoystickGetAxis(joysticktable[host_joy_id],
|
||||||
current_controller_map.lstick_axis_y) <=
|
current_controller_map.lstick_axis_y) <=
|
||||||
lower_bound
|
lower_bound
|
||||||
? 1
|
? 1
|
||||||
: 0);
|
: 0);
|
||||||
setjoybuttonstate(hostjoyid + joy_offset, 8 + held_offset,
|
setjoybuttonstate(host_joy_id + joy_offset, 8 + held_offset,
|
||||||
SDL_JoystickGetAxis(joysticktable[hostjoyid],
|
SDL_JoystickGetAxis(joysticktable[host_joy_id],
|
||||||
current_controller_map.lstick_axis_y) >=
|
current_controller_map.lstick_axis_y) >=
|
||||||
upper_bound
|
upper_bound
|
||||||
? 1
|
? 1
|
||||||
|
@ -1314,14 +1316,14 @@ static void read_joystick()
|
||||||
// handle the X axis
|
// handle the X axis
|
||||||
if (current_controller_map.lstick_axis_x != -1)
|
if (current_controller_map.lstick_axis_x != -1)
|
||||||
{
|
{
|
||||||
setjoybuttonstate(hostjoyid + joy_offset, 9 + held_offset,
|
setjoybuttonstate(host_joy_id + joy_offset, 9 + held_offset,
|
||||||
SDL_JoystickGetAxis(joysticktable[hostjoyid],
|
SDL_JoystickGetAxis(joysticktable[host_joy_id],
|
||||||
current_controller_map.lstick_axis_x) <=
|
current_controller_map.lstick_axis_x) <=
|
||||||
lower_bound
|
lower_bound
|
||||||
? 1
|
? 1
|
||||||
: 0);
|
: 0);
|
||||||
setjoybuttonstate(hostjoyid + joy_offset, 10 + held_offset,
|
setjoybuttonstate(host_joy_id + joy_offset, 10 + held_offset,
|
||||||
SDL_JoystickGetAxis(joysticktable[hostjoyid],
|
SDL_JoystickGetAxis(joysticktable[host_joy_id],
|
||||||
current_controller_map.lstick_axis_x) >=
|
current_controller_map.lstick_axis_x) >=
|
||||||
upper_bound
|
upper_bound
|
||||||
? 1
|
? 1
|
||||||
|
@ -1332,87 +1334,87 @@ static void read_joystick()
|
||||||
// right stick
|
// right stick
|
||||||
if (current_controller_map.rstick_axis_x != -1)
|
if (current_controller_map.rstick_axis_x != -1)
|
||||||
{
|
{
|
||||||
val = SDL_JoystickGetAxis(joysticktable[hostjoyid], current_controller_map.rstick_axis_x);
|
val = SDL_JoystickGetAxis(joysticktable[host_joy_id], current_controller_map.rstick_axis_x);
|
||||||
if (current_controller_map.rstick_axis_x_invert != 0)
|
if (current_controller_map.rstick_axis_x_invert != 0)
|
||||||
val = val * -1;
|
val = val * -1;
|
||||||
|
|
||||||
setjoystickstate(hostjoyid + joy_offset, 2, val, upper_bound);
|
setjoystickstate(host_joy_id + joy_offset, 2, val, upper_bound);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (current_controller_map.rstick_axis_y != -1)
|
if (current_controller_map.rstick_axis_y != -1)
|
||||||
{
|
{
|
||||||
val = SDL_JoystickGetAxis(joysticktable[hostjoyid], current_controller_map.rstick_axis_y);
|
val = SDL_JoystickGetAxis(joysticktable[host_joy_id], current_controller_map.rstick_axis_y);
|
||||||
if (current_controller_map.rstick_axis_y_invert != 0)
|
if (current_controller_map.rstick_axis_y_invert != 0)
|
||||||
val = val * -1;
|
val = val * -1;
|
||||||
|
|
||||||
setjoystickstate(hostjoyid + joy_offset, 3, val, upper_bound);
|
setjoystickstate(host_joy_id + joy_offset, 3, val, upper_bound);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
// cd32 red, blue, green, yellow
|
// cd32 red, blue, green, yellow
|
||||||
// south
|
// south
|
||||||
if (current_controller_map.south_button != -1)
|
if (current_controller_map.south_button != -1)
|
||||||
setjoybuttonstate(hostjoyid + joy_offset, 0 + held_offset,
|
setjoybuttonstate(host_joy_id + joy_offset, 0 + held_offset,
|
||||||
SDL_JoystickGetButton(joysticktable[hostjoyid],
|
SDL_JoystickGetButton(joysticktable[host_joy_id],
|
||||||
current_controller_map.south_button) & 1);
|
current_controller_map.south_button) & 1);
|
||||||
// east
|
// east
|
||||||
if (current_controller_map.east_button != -1)
|
if (current_controller_map.east_button != -1)
|
||||||
setjoybuttonstate(hostjoyid + joy_offset, 1 + held_offset,
|
setjoybuttonstate(host_joy_id + joy_offset, 1 + held_offset,
|
||||||
SDL_JoystickGetButton(joysticktable[hostjoyid],
|
SDL_JoystickGetButton(joysticktable[host_joy_id],
|
||||||
current_controller_map.east_button) & 1);
|
current_controller_map.east_button) & 1);
|
||||||
// west
|
// west
|
||||||
if (current_controller_map.west_button != -1)
|
if (current_controller_map.west_button != -1)
|
||||||
setjoybuttonstate(hostjoyid + joy_offset, 2 + held_offset,
|
setjoybuttonstate(host_joy_id + joy_offset, 2 + held_offset,
|
||||||
SDL_JoystickGetButton(joysticktable[hostjoyid],
|
SDL_JoystickGetButton(joysticktable[host_joy_id],
|
||||||
current_controller_map.west_button) & 1);
|
current_controller_map.west_button) & 1);
|
||||||
// north
|
// north
|
||||||
if (current_controller_map.north_button != -1)
|
if (current_controller_map.north_button != -1)
|
||||||
setjoybuttonstate(hostjoyid + joy_offset, 3 + held_offset,
|
setjoybuttonstate(host_joy_id + joy_offset, 3 + held_offset,
|
||||||
SDL_JoystickGetButton(joysticktable[hostjoyid],
|
SDL_JoystickGetButton(joysticktable[host_joy_id],
|
||||||
current_controller_map.north_button) & 1);
|
current_controller_map.north_button) & 1);
|
||||||
|
|
||||||
// cd32 rwd, ffw, start
|
// cd32 rwd, ffw, start
|
||||||
// left shoulder
|
// left shoulder
|
||||||
if (current_controller_map.left_shoulder != -1)
|
if (current_controller_map.left_shoulder != -1)
|
||||||
setjoybuttonstate(hostjoyid + joy_offset, 4 + held_offset,
|
setjoybuttonstate(host_joy_id + joy_offset, 4 + held_offset,
|
||||||
SDL_JoystickGetButton(joysticktable[hostjoyid],
|
SDL_JoystickGetButton(joysticktable[host_joy_id],
|
||||||
current_controller_map.left_shoulder) & 1);
|
current_controller_map.left_shoulder) & 1);
|
||||||
// right shoulder
|
// right shoulder
|
||||||
if (current_controller_map.right_shoulder != -1)
|
if (current_controller_map.right_shoulder != -1)
|
||||||
setjoybuttonstate(hostjoyid + joy_offset, 5 + held_offset,
|
setjoybuttonstate(host_joy_id + joy_offset, 5 + held_offset,
|
||||||
SDL_JoystickGetButton(joysticktable[hostjoyid],
|
SDL_JoystickGetButton(joysticktable[host_joy_id],
|
||||||
current_controller_map.right_shoulder) &
|
current_controller_map.right_shoulder) &
|
||||||
1);
|
1);
|
||||||
// start
|
// start
|
||||||
if (current_controller_map.start_button != -1)
|
if (current_controller_map.start_button != -1)
|
||||||
setjoybuttonstate(hostjoyid + joy_offset, 6 + held_offset,
|
setjoybuttonstate(host_joy_id + joy_offset, 6 + held_offset,
|
||||||
SDL_JoystickGetButton(joysticktable[hostjoyid],
|
SDL_JoystickGetButton(joysticktable[host_joy_id],
|
||||||
current_controller_map.start_button) & 1);
|
current_controller_map.start_button) & 1);
|
||||||
|
|
||||||
// up down left right
|
// up down left right
|
||||||
// HAT Handling *or* D-PAD buttons
|
// HAT Handling *or* D-PAD buttons
|
||||||
const int hat = SDL_JoystickGetHat(joysticktable[hostjoyid], 0);
|
const int hat = SDL_JoystickGetHat(joysticktable[host_joy_id], 0);
|
||||||
|
|
||||||
setjoybuttonstate(hostjoyid + joy_offset, 7 + held_offset, current_controller_map.dpad_up + 1
|
setjoybuttonstate(host_joy_id + joy_offset, 7 + held_offset, current_controller_map.dpad_up + 1
|
||||||
? SDL_JoystickGetButton(
|
? SDL_JoystickGetButton(
|
||||||
joysticktable[hostjoyid],
|
joysticktable[host_joy_id],
|
||||||
current_controller_map.dpad_up) &
|
current_controller_map.dpad_up) &
|
||||||
1
|
1
|
||||||
: hat & SDL_HAT_UP);
|
: hat & SDL_HAT_UP);
|
||||||
setjoybuttonstate(hostjoyid + joy_offset, 8 + held_offset, current_controller_map.dpad_down + 1
|
setjoybuttonstate(host_joy_id + joy_offset, 8 + held_offset, current_controller_map.dpad_down + 1
|
||||||
? SDL_JoystickGetButton(
|
? SDL_JoystickGetButton(
|
||||||
joysticktable[hostjoyid],
|
joysticktable[host_joy_id],
|
||||||
current_controller_map.dpad_down)
|
current_controller_map.dpad_down)
|
||||||
& 1
|
& 1
|
||||||
: hat & SDL_HAT_DOWN);
|
: hat & SDL_HAT_DOWN);
|
||||||
setjoybuttonstate(hostjoyid + joy_offset, 9 + held_offset, current_controller_map.dpad_left + 1
|
setjoybuttonstate(host_joy_id + joy_offset, 9 + held_offset, current_controller_map.dpad_left + 1
|
||||||
? SDL_JoystickGetButton(
|
? SDL_JoystickGetButton(
|
||||||
joysticktable[hostjoyid],
|
joysticktable[host_joy_id],
|
||||||
current_controller_map.dpad_left)
|
current_controller_map.dpad_left)
|
||||||
& 1
|
& 1
|
||||||
: hat & SDL_HAT_LEFT);
|
: hat & SDL_HAT_LEFT);
|
||||||
setjoybuttonstate(hostjoyid + joy_offset, 10 + held_offset, current_controller_map.dpad_right + 1
|
setjoybuttonstate(host_joy_id + joy_offset, 10 + held_offset, current_controller_map.dpad_right + 1
|
||||||
? SDL_JoystickGetButton(
|
? SDL_JoystickGetButton(
|
||||||
joysticktable[hostjoyid],
|
joysticktable[host_joy_id],
|
||||||
current_controller_map.
|
current_controller_map.
|
||||||
dpad_right) & 1
|
dpad_right) & 1
|
||||||
: hat & SDL_HAT_RIGHT);
|
: hat & SDL_HAT_RIGHT);
|
||||||
|
@ -1420,19 +1422,19 @@ static void read_joystick()
|
||||||
// stick left/right/select
|
// stick left/right/select
|
||||||
// left stick
|
// left stick
|
||||||
if (current_controller_map.lstick_button != -1)
|
if (current_controller_map.lstick_button != -1)
|
||||||
setjoybuttonstate(hostjoyid + joy_offset, 11 + held_offset,
|
setjoybuttonstate(host_joy_id + joy_offset, 11 + held_offset,
|
||||||
SDL_JoystickGetButton(joysticktable[hostjoyid],
|
SDL_JoystickGetButton(joysticktable[host_joy_id],
|
||||||
current_controller_map.lstick_button) & 1);
|
current_controller_map.lstick_button) & 1);
|
||||||
// right stick
|
// right stick
|
||||||
if (current_controller_map.rstick_button != -1)
|
if (current_controller_map.rstick_button != -1)
|
||||||
setjoybuttonstate(hostjoyid + joy_offset, 12 + held_offset,
|
setjoybuttonstate(host_joy_id + joy_offset, 12 + held_offset,
|
||||||
SDL_JoystickGetButton(joysticktable[hostjoyid],
|
SDL_JoystickGetButton(joysticktable[host_joy_id],
|
||||||
current_controller_map.rstick_button) & 1);
|
current_controller_map.rstick_button) & 1);
|
||||||
|
|
||||||
// select button
|
// select button
|
||||||
if (current_controller_map.select_button != -1)
|
if (current_controller_map.select_button != -1)
|
||||||
setjoybuttonstate(hostjoyid + 1, 13 + held_offset,
|
setjoybuttonstate(host_joy_id + 1, 13 + held_offset,
|
||||||
SDL_JoystickGetButton(joysticktable[hostjoyid],
|
SDL_JoystickGetButton(joysticktable[host_joy_id],
|
||||||
current_controller_map.select_button) & 1);
|
current_controller_map.select_button) & 1);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1756,14 +1758,14 @@ bool key_used_by_retroarch_joy(int scancode)
|
||||||
if (amiberry_options.input_keyboard_as_joystick_stop_keypresses)
|
if (amiberry_options.input_keyboard_as_joystick_stop_keypresses)
|
||||||
{
|
{
|
||||||
//currprefs.jports[port]
|
//currprefs.jports[port]
|
||||||
for (auto joyid = 0; joyid < MAX_JPORTS && !key_used; joyid++)
|
for (auto joy_id = 0; joy_id < MAX_JPORTS && !key_used; joy_id++)
|
||||||
{
|
{
|
||||||
// First handle retroarch (or default) keys as Joystick...
|
// First handle retroarch (or default) keys as Joystick...
|
||||||
if (currprefs.jports[joyid].id >= JSEM_JOYS && currprefs.jports[joyid].id < JSEM_JOYS +
|
if (currprefs.jports[joy_id].id >= JSEM_JOYS && currprefs.jports[joy_id].id < JSEM_JOYS +
|
||||||
num_keys_as_joys)
|
num_keys_as_joys)
|
||||||
{
|
{
|
||||||
const auto hostkeyid = currprefs.jports[joyid].id - JSEM_JOYS;
|
const auto host_key_id = currprefs.jports[joy_id].id - JSEM_JOYS;
|
||||||
auto kb = hostkeyid;
|
const auto kb = host_key_id;
|
||||||
key_used = host_keyboard_buttons[kb].south_button == scancode
|
key_used = host_keyboard_buttons[kb].south_button == scancode
|
||||||
|| host_keyboard_buttons[kb].east_button == scancode
|
|| host_keyboard_buttons[kb].east_button == scancode
|
||||||
|| host_keyboard_buttons[kb].north_button == scancode
|
|| host_keyboard_buttons[kb].north_button == scancode
|
||||||
|
|
|
@ -295,9 +295,9 @@ void cd_auto_prefs(struct uae_prefs* prefs, char* filepath)
|
||||||
// *** GAME DETECTION ***
|
// *** GAME DETECTION ***
|
||||||
write_log("\nCD Autoload: %s \n\n", filepath);
|
write_log("\nCD Autoload: %s \n\n", filepath);
|
||||||
|
|
||||||
extractFileName(filepath, last_loaded_config);
|
extract_filename(filepath, last_loaded_config);
|
||||||
extractFileName(filepath, game_name);
|
extract_filename(filepath, game_name);
|
||||||
removeFileExtension(game_name);
|
remove_file_extension(game_name);
|
||||||
|
|
||||||
// LOAD GAME SPECIFICS FOR EXISTING .UAE - USE SHA1 IF AVAILABLE
|
// LOAD GAME SPECIFICS FOR EXISTING .UAE - USE SHA1 IF AVAILABLE
|
||||||
// CONFIG LOAD IF .UAE IS IN CONFIG PATH
|
// CONFIG LOAD IF .UAE IS IN CONFIG PATH
|
||||||
|
@ -456,9 +456,9 @@ void whdload_auto_prefs(struct uae_prefs* prefs, char* filepath)
|
||||||
// REMOVE THE FILE PATH AND EXTENSION
|
// REMOVE THE FILE PATH AND EXTENSION
|
||||||
const auto* const filename = my_getfilepart(filepath);
|
const auto* const filename = my_getfilepart(filepath);
|
||||||
// SOMEWHERE HERE WE NEED TO SET THE GAME 'NAME' FOR SAVESTATE ETC PURPOSES
|
// SOMEWHERE HERE WE NEED TO SET THE GAME 'NAME' FOR SAVESTATE ETC PURPOSES
|
||||||
extractFileName(filepath, last_loaded_config);
|
extract_filename(filepath, last_loaded_config);
|
||||||
extractFileName(filepath, game_name);
|
extract_filename(filepath, game_name);
|
||||||
removeFileExtension(game_name);
|
remove_file_extension(game_name);
|
||||||
|
|
||||||
// LOAD GAME SPECIFICS FOR EXISTING .UAE - USE SHA1 IF AVAILABLE
|
// LOAD GAME SPECIFICS FOR EXISTING .UAE - USE SHA1 IF AVAILABLE
|
||||||
// CONFIG LOAD IF .UAE IS IN CONFIG PATH
|
// CONFIG LOAD IF .UAE IS IN CONFIG PATH
|
||||||
|
|
|
@ -621,7 +621,7 @@ bool EditFilesysHardfile(const int unit_no)
|
||||||
{
|
{
|
||||||
};
|
};
|
||||||
const auto bp = tweakbootpri(atoi(txtBootPri->getText().c_str()), chkAutoboot->isSelected() ? 1 : 0, 0);
|
const auto bp = tweakbootpri(atoi(txtBootPri->getText().c_str()), chkAutoboot->isSelected() ? 1 : 0, 0);
|
||||||
extractPath(const_cast<char *>(txtPath->getText().c_str()), currentDir);
|
extract_path(const_cast<char *>(txtPath->getText().c_str()), currentDir);
|
||||||
|
|
||||||
uci_set_defaults(&ci, false);
|
uci_set_defaults(&ci, false);
|
||||||
strncpy(ci.devname, const_cast<char *>(txtDevice->getText().c_str()), MAX_DPATH);
|
strncpy(ci.devname, const_cast<char *>(txtDevice->getText().c_str()), MAX_DPATH);
|
||||||
|
|
|
@ -434,7 +434,7 @@ bool EditFilesysVirtual(const int unit_no)
|
||||||
{
|
{
|
||||||
struct uaedev_config_info ci{};
|
struct uaedev_config_info ci{};
|
||||||
const auto bp = tweakbootpri(atoi(txtBootPri->getText().c_str()), chkAutoboot->isSelected() ? 1 : 0, 0);
|
const auto bp = tweakbootpri(atoi(txtBootPri->getText().c_str()), chkAutoboot->isSelected() ? 1 : 0, 0);
|
||||||
extractPath(const_cast<char *>(txtPath->getText().c_str()), currentDir);
|
extract_path(const_cast<char *>(txtPath->getText().c_str()), currentDir);
|
||||||
|
|
||||||
uci_set_defaults(&ci, true);
|
uci_set_defaults(&ci, true);
|
||||||
strncpy(ci.devname, const_cast<char *>(txtDevice->getText().c_str()), MAX_DPATH);
|
strncpy(ci.devname, const_cast<char *>(txtDevice->getText().c_str()), MAX_DPATH);
|
||||||
|
|
|
@ -51,8 +51,8 @@ bool LoadConfigByName(const char* name)
|
||||||
|
|
||||||
void SetLastActiveConfig(const char* filename)
|
void SetLastActiveConfig(const char* filename)
|
||||||
{
|
{
|
||||||
extractFileName(filename, last_active_config);
|
extract_filename(filename, last_active_config);
|
||||||
removeFileExtension(last_active_config);
|
remove_file_extension(last_active_config);
|
||||||
}
|
}
|
||||||
|
|
||||||
class ConfigsListModel : public gcn::ListModel
|
class ConfigsListModel : public gcn::ListModel
|
||||||
|
@ -288,7 +288,7 @@ void InitPanelConfig(const struct _ConfigCategory& category)
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
strcpy(last_active_config, last_loaded_config);
|
strcpy(last_active_config, last_loaded_config);
|
||||||
removeFileExtension(last_active_config);
|
remove_file_extension(last_active_config);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
txtName->setText(last_active_config);
|
txtName->setText(last_active_config);
|
||||||
|
|
|
@ -199,13 +199,13 @@ public:
|
||||||
strncpy(changed_prefs.floppyslots[i].df, tmp, MAX_DPATH);
|
strncpy(changed_prefs.floppyslots[i].df, tmp, MAX_DPATH);
|
||||||
disk_insert(i, tmp);
|
disk_insert(i, tmp);
|
||||||
AddFileToDiskList(tmp, 1);
|
AddFileToDiskList(tmp, 1);
|
||||||
extractPath(tmp, currentDir);
|
extract_path(tmp, currentDir);
|
||||||
|
|
||||||
if (i == 0 && chkLoadConfig->isSelected())
|
if (i == 0 && chkLoadConfig->isSelected())
|
||||||
{
|
{
|
||||||
// Search for config of disk
|
// Search for config of disk
|
||||||
extractFileName(changed_prefs.floppyslots[i].df, tmp);
|
extract_filename(changed_prefs.floppyslots[i].df, tmp);
|
||||||
removeFileExtension(tmp);
|
remove_file_extension(tmp);
|
||||||
LoadConfigByName(tmp);
|
LoadConfigByName(tmp);
|
||||||
}
|
}
|
||||||
AdjustDropDownControls();
|
AdjustDropDownControls();
|
||||||
|
@ -261,8 +261,8 @@ public:
|
||||||
// Search for config of disk
|
// Search for config of disk
|
||||||
char tmp[MAX_DPATH];
|
char tmp[MAX_DPATH];
|
||||||
|
|
||||||
extractFileName(changed_prefs.floppyslots[i].df, tmp);
|
extract_filename(changed_prefs.floppyslots[i].df, tmp);
|
||||||
removeFileExtension(tmp);
|
remove_file_extension(tmp);
|
||||||
LoadConfigByName(tmp);
|
LoadConfigByName(tmp);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -304,8 +304,8 @@ public:
|
||||||
char filename[MAX_DPATH];
|
char filename[MAX_DPATH];
|
||||||
char diskname[MAX_DPATH];
|
char diskname[MAX_DPATH];
|
||||||
|
|
||||||
extractFileName(changed_prefs.floppyslots[0].df, diskname);
|
extract_filename(changed_prefs.floppyslots[0].df, diskname);
|
||||||
removeFileExtension(diskname);
|
remove_file_extension(diskname);
|
||||||
|
|
||||||
get_configuration_path(filename, MAX_DPATH);
|
get_configuration_path(filename, MAX_DPATH);
|
||||||
strncat(filename, diskname, MAX_DPATH - 1);
|
strncat(filename, diskname, MAX_DPATH - 1);
|
||||||
|
@ -334,12 +334,12 @@ public:
|
||||||
strncpy(tmp, currentDir, MAX_DPATH);
|
strncpy(tmp, currentDir, MAX_DPATH);
|
||||||
if (SelectFile("Create 3.5'' DD disk file", tmp, diskfile_filter, true))
|
if (SelectFile("Create 3.5'' DD disk file", tmp, diskfile_filter, true))
|
||||||
{
|
{
|
||||||
extractFileName(tmp, diskname);
|
extract_filename(tmp, diskname);
|
||||||
removeFileExtension(diskname);
|
remove_file_extension(diskname);
|
||||||
diskname[31] = '\0';
|
diskname[31] = '\0';
|
||||||
disk_creatediskfile(&changed_prefs, tmp, 0, DRV_35_DD, -1, diskname, false, false, nullptr);
|
disk_creatediskfile(&changed_prefs, tmp, 0, DRV_35_DD, -1, diskname, false, false, nullptr);
|
||||||
AddFileToDiskList(tmp, 1);
|
AddFileToDiskList(tmp, 1);
|
||||||
extractPath(tmp, currentDir);
|
extract_path(tmp, currentDir);
|
||||||
}
|
}
|
||||||
cmdCreateDDDisk->requestFocus();
|
cmdCreateDDDisk->requestFocus();
|
||||||
}
|
}
|
||||||
|
@ -351,12 +351,12 @@ public:
|
||||||
strcpy(tmp, currentDir);
|
strcpy(tmp, currentDir);
|
||||||
if (SelectFile("Create 3.5'' HD disk file", tmp, diskfile_filter, true))
|
if (SelectFile("Create 3.5'' HD disk file", tmp, diskfile_filter, true))
|
||||||
{
|
{
|
||||||
extractFileName(tmp, diskname);
|
extract_filename(tmp, diskname);
|
||||||
removeFileExtension(diskname);
|
remove_file_extension(diskname);
|
||||||
diskname[31] = '\0';
|
diskname[31] = '\0';
|
||||||
disk_creatediskfile(&changed_prefs, tmp, 0, DRV_35_HD, -1, diskname, false, false, nullptr);
|
disk_creatediskfile(&changed_prefs, tmp, 0, DRV_35_HD, -1, diskname, false, false, nullptr);
|
||||||
AddFileToDiskList(tmp, 1);
|
AddFileToDiskList(tmp, 1);
|
||||||
extractPath(tmp, currentDir);
|
extract_path(tmp, currentDir);
|
||||||
}
|
}
|
||||||
cmdCreateHDDisk->requestFocus();
|
cmdCreateHDDisk->requestFocus();
|
||||||
}
|
}
|
||||||
|
|
|
@ -259,7 +259,7 @@ public:
|
||||||
changed_prefs.cdslots[0].inuse = true;
|
changed_prefs.cdslots[0].inuse = true;
|
||||||
changed_prefs.cdslots[0].type = SCSI_UNIT_IMAGE;
|
changed_prefs.cdslots[0].type = SCSI_UNIT_IMAGE;
|
||||||
AddFileToCDList(tmp, 1);
|
AddFileToCDList(tmp, 1);
|
||||||
extractPath(tmp, currentDir);
|
extract_path(tmp, currentDir);
|
||||||
|
|
||||||
AdjustDropDownControls();
|
AdjustDropDownControls();
|
||||||
}
|
}
|
||||||
|
|
|
@ -384,7 +384,7 @@ public:
|
||||||
changed_prefs.cdslots[0].inuse = true;
|
changed_prefs.cdslots[0].inuse = true;
|
||||||
changed_prefs.cdslots[0].type = SCSI_UNIT_IMAGE;
|
changed_prefs.cdslots[0].type = SCSI_UNIT_IMAGE;
|
||||||
AddFileToCDList(tmp, 1);
|
AddFileToCDList(tmp, 1);
|
||||||
extractPath(tmp, currentDir);
|
extract_path(tmp, currentDir);
|
||||||
|
|
||||||
AdjustDropDownControls();
|
AdjustDropDownControls();
|
||||||
}
|
}
|
||||||
|
@ -669,7 +669,7 @@ public:
|
||||||
strncpy(changed_prefs.floppyslots[i].df, tmp, MAX_DPATH);
|
strncpy(changed_prefs.floppyslots[i].df, tmp, MAX_DPATH);
|
||||||
disk_insert(i, tmp);
|
disk_insert(i, tmp);
|
||||||
AddFileToDiskList(tmp, 1);
|
AddFileToDiskList(tmp, 1);
|
||||||
extractPath(tmp, currentDir);
|
extract_path(tmp, currentDir);
|
||||||
|
|
||||||
AdjustDropDownControls();
|
AdjustDropDownControls();
|
||||||
}
|
}
|
||||||
|
|
|
@ -167,8 +167,8 @@ public:
|
||||||
if (SelectFile("Select System ROM", tmp, filter))
|
if (SelectFile("Select System ROM", tmp, filter))
|
||||||
{
|
{
|
||||||
const auto newrom = new AvailableROM();
|
const auto newrom = new AvailableROM();
|
||||||
extractFileName(tmp, newrom->Name);
|
extract_filename(tmp, newrom->Name);
|
||||||
removeFileExtension(newrom->Name);
|
remove_file_extension(newrom->Name);
|
||||||
strncpy(newrom->Path, tmp, MAX_DPATH - 1);
|
strncpy(newrom->Path, tmp, MAX_DPATH - 1);
|
||||||
newrom->ROMType = ROMTYPE_KICK;
|
newrom->ROMType = ROMTYPE_KICK;
|
||||||
lstAvailableROMs.push_back(newrom);
|
lstAvailableROMs.push_back(newrom);
|
||||||
|
@ -183,8 +183,8 @@ public:
|
||||||
if (SelectFile("Select Extended ROM", tmp, filter))
|
if (SelectFile("Select Extended ROM", tmp, filter))
|
||||||
{
|
{
|
||||||
const auto newrom = new AvailableROM();
|
const auto newrom = new AvailableROM();
|
||||||
extractFileName(tmp, newrom->Name);
|
extract_filename(tmp, newrom->Name);
|
||||||
removeFileExtension(newrom->Name);
|
remove_file_extension(newrom->Name);
|
||||||
strncpy(newrom->Path, tmp, MAX_DPATH - 1);
|
strncpy(newrom->Path, tmp, MAX_DPATH - 1);
|
||||||
newrom->ROMType = ROMTYPE_EXTCDTV;
|
newrom->ROMType = ROMTYPE_EXTCDTV;
|
||||||
lstAvailableROMs.push_back(newrom);
|
lstAvailableROMs.push_back(newrom);
|
||||||
|
@ -199,8 +199,8 @@ public:
|
||||||
if (SelectFile("Select Cartridge ROM", tmp, filter))
|
if (SelectFile("Select Cartridge ROM", tmp, filter))
|
||||||
{
|
{
|
||||||
const auto newrom = new AvailableROM();
|
const auto newrom = new AvailableROM();
|
||||||
extractFileName(tmp, newrom->Name);
|
extract_filename(tmp, newrom->Name);
|
||||||
removeFileExtension(newrom->Name);
|
remove_file_extension(newrom->Name);
|
||||||
strncpy(newrom->Path, tmp, MAX_DPATH - 1);
|
strncpy(newrom->Path, tmp, MAX_DPATH - 1);
|
||||||
newrom->ROMType = ROMTYPE_CD32CART;
|
newrom->ROMType = ROMTYPE_CD32CART;
|
||||||
lstAvailableROMs.push_back(newrom);
|
lstAvailableROMs.push_back(newrom);
|
||||||
|
@ -347,8 +347,8 @@ void RefreshPanelROM()
|
||||||
{
|
{
|
||||||
// ROM file not in the list of known ROMs -- let's add it
|
// ROM file not in the list of known ROMs -- let's add it
|
||||||
auto newrom = new AvailableROM();
|
auto newrom = new AvailableROM();
|
||||||
extractFileName(changed_prefs.romfile, newrom->Name);
|
extract_filename(changed_prefs.romfile, newrom->Name);
|
||||||
removeFileExtension(newrom->Name);
|
remove_file_extension(newrom->Name);
|
||||||
strncpy(newrom->Path, changed_prefs.romfile, MAX_DPATH - 1);
|
strncpy(newrom->Path, changed_prefs.romfile, MAX_DPATH - 1);
|
||||||
newrom->ROMType = ROMTYPE_KICK;
|
newrom->ROMType = ROMTYPE_KICK;
|
||||||
lstAvailableROMs.push_back(newrom);
|
lstAvailableROMs.push_back(newrom);
|
||||||
|
@ -364,8 +364,8 @@ void RefreshPanelROM()
|
||||||
{
|
{
|
||||||
// ROM file not in the list of known ROMs
|
// ROM file not in the list of known ROMs
|
||||||
auto newrom = new AvailableROM();
|
auto newrom = new AvailableROM();
|
||||||
extractFileName(changed_prefs.romextfile, newrom->Name);
|
extract_filename(changed_prefs.romextfile, newrom->Name);
|
||||||
removeFileExtension(newrom->Name);
|
remove_file_extension(newrom->Name);
|
||||||
strncpy(newrom->Path, changed_prefs.romextfile, MAX_DPATH - 1);
|
strncpy(newrom->Path, changed_prefs.romextfile, MAX_DPATH - 1);
|
||||||
newrom->ROMType = ROMTYPE_EXTCDTV;
|
newrom->ROMType = ROMTYPE_EXTCDTV;
|
||||||
lstAvailableROMs.push_back(newrom);
|
lstAvailableROMs.push_back(newrom);
|
||||||
|
|
|
@ -72,7 +72,7 @@ public:
|
||||||
|
|
||||||
void changeDir(const char* path)
|
void changeDir(const char* path)
|
||||||
{
|
{
|
||||||
ReadDirectory(path, &dirs, &files);
|
read_directory(path, &dirs, &files);
|
||||||
if (dirs.empty())
|
if (dirs.empty())
|
||||||
dirs.emplace_back("..");
|
dirs.emplace_back("..");
|
||||||
FilterFiles(&files, filefilter);
|
FilterFiles(&files, filefilter);
|
||||||
|
@ -146,7 +146,7 @@ static void checkfoldername(char* current)
|
||||||
static void checkfilename(char* current)
|
static void checkfilename(char* current)
|
||||||
{
|
{
|
||||||
char actfile[MAX_DPATH];
|
char actfile[MAX_DPATH];
|
||||||
extractFileName(current, actfile);
|
extract_filename(current, actfile);
|
||||||
for (auto i = 0; i < fileList->getNumberOfElements(); ++i)
|
for (auto i = 0; i < fileList->getNumberOfElements(); ++i)
|
||||||
{
|
{
|
||||||
if (!fileList->isDir(i) && !stricmp(fileList->getElementAt(i).c_str(), actfile))
|
if (!fileList->isDir(i) && !stricmp(fileList->getElementAt(i).c_str(), actfile))
|
||||||
|
@ -498,7 +498,7 @@ bool SelectFile(const char* title, char* value, const char* filter[], const bool
|
||||||
|
|
||||||
InitSelectFile(title);
|
InitSelectFile(title);
|
||||||
|
|
||||||
extractPath(value, workingDir);
|
extract_path(value, workingDir);
|
||||||
checkfoldername(workingDir);
|
checkfoldername(workingDir);
|
||||||
checkfilename(value);
|
checkfilename(value);
|
||||||
|
|
||||||
|
|
|
@ -80,7 +80,7 @@ public:
|
||||||
|
|
||||||
void changeDir(const char* path)
|
void changeDir(const char* path)
|
||||||
{
|
{
|
||||||
ReadDirectory(path, &dirs, nullptr);
|
read_directory(path, &dirs, nullptr);
|
||||||
if (dirs.empty())
|
if (dirs.empty())
|
||||||
dirs.emplace_back("..");
|
dirs.emplace_back("..");
|
||||||
}
|
}
|
||||||
|
|
|
@ -161,7 +161,7 @@ void ShowHelp(const char* title, const std::vector<std::string>& text);
|
||||||
bool LoadConfigByName(const char* name);
|
bool LoadConfigByName(const char* name);
|
||||||
ConfigFileInfo* SearchConfigInList(const char* name);
|
ConfigFileInfo* SearchConfigInList(const char* name);
|
||||||
|
|
||||||
extern void ReadDirectory(const char* path, vector<string>* dirs, vector<string>* files);
|
extern void read_directory(const char* path, vector<string>* dirs, vector<string>* files);
|
||||||
extern void FilterFiles(vector<string>* files, const char* filter[]);
|
extern void FilterFiles(vector<string>* files, const char* filter[]);
|
||||||
|
|
||||||
enum
|
enum
|
||||||
|
|
|
@ -81,9 +81,9 @@ extern void get_rp9_path(char* out, int size);
|
||||||
extern void get_savestate_path(char* out, int size);
|
extern void get_savestate_path(char* out, int size);
|
||||||
extern void get_screenshot_path(char* out, int size);
|
extern void get_screenshot_path(char* out, int size);
|
||||||
|
|
||||||
extern void extractFileName(const char* str, char* buffer);
|
extern void extract_filename(const char* str, char* buffer);
|
||||||
extern void extractPath(char* str, char* buffer);
|
extern void extract_path(char* str, char* buffer);
|
||||||
extern void removeFileExtension(char* filename);
|
extern void remove_file_extension(char* filename);
|
||||||
extern void ReadConfigFileList(void);
|
extern void ReadConfigFileList(void);
|
||||||
extern void RescanROMs(void);
|
extern void RescanROMs(void);
|
||||||
extern void SymlinkROMs(void);
|
extern void SymlinkROMs(void);
|
||||||
|
|
|
@ -222,9 +222,9 @@ static TCHAR *state_resolve_path(TCHAR *s, int type, bool newmode)
|
||||||
xfree(s);
|
xfree(s);
|
||||||
return my_strdup(tmp);
|
return my_strdup(tmp);
|
||||||
}
|
}
|
||||||
getfilepart(tmp, sizeof tmp / sizeof(TCHAR), s);
|
get_file_part(tmp, sizeof tmp / sizeof(TCHAR), s);
|
||||||
} else {
|
} else {
|
||||||
getfilepart (tmp, sizeof tmp / sizeof (TCHAR), s);
|
get_file_part (tmp, sizeof tmp / sizeof (TCHAR), s);
|
||||||
if (state_path_exists(tmp, type)) {
|
if (state_path_exists(tmp, type)) {
|
||||||
xfree (s);
|
xfree (s);
|
||||||
return my_strdup (tmp);
|
return my_strdup (tmp);
|
||||||
|
@ -241,14 +241,14 @@ static TCHAR *state_resolve_path(TCHAR *s, int type, bool newmode)
|
||||||
if (newpath == NULL || newpath[0] == 0)
|
if (newpath == NULL || newpath[0] == 0)
|
||||||
break;
|
break;
|
||||||
_tcscpy (tmp2, newpath);
|
_tcscpy (tmp2, newpath);
|
||||||
fixtrailing (tmp2);
|
fix_trailing (tmp2);
|
||||||
_tcscat (tmp2, tmp);
|
_tcscat (tmp2, tmp);
|
||||||
if (state_path_exists(tmp2, type)) {
|
if (state_path_exists(tmp2, type)) {
|
||||||
xfree (s);
|
xfree (s);
|
||||||
return my_strdup (tmp2);
|
return my_strdup (tmp2);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
getpathpart (tmp2, sizeof tmp2 / sizeof (TCHAR), savestate_fname);
|
get_path_part (tmp2, sizeof tmp2 / sizeof (TCHAR), savestate_fname);
|
||||||
_tcscat (tmp2, tmp);
|
_tcscat (tmp2, tmp);
|
||||||
if (state_path_exists(tmp2, type)) {
|
if (state_path_exists(tmp2, type)) {
|
||||||
xfree (s);
|
xfree (s);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue