Bugfix for Customised DPAD using HAT (#647)
* Bug-fixes the 24-bit CPU parameter for WHDLoad Booter (moving prior to memory and variable name fix), and sets to FALSE where Z3 is used to fix compatibility. * Updated WHDLoad Booter, customisations from .uae file * Bug-fix for Joystick customisations - allows HAT controlled DPad buttons to be remapped.
This commit is contained in:
parent
ea4998ced0
commit
deff6ac91e
1 changed files with 24 additions and 13 deletions
|
@ -481,17 +481,35 @@ int find_retroarch(const TCHAR* find_setting, char* retroarch_file, host_input_b
|
|||
std::string line;
|
||||
std::string delimiter = " = ";
|
||||
auto tempbutton = -1;
|
||||
|
||||
|
||||
// read each line in
|
||||
while (std::getline(readFile, line))
|
||||
{
|
||||
const auto option = line.substr(0, line.find(delimiter));
|
||||
{
|
||||
if (strncmp(find_setting, "count_hats", 10) == 0)
|
||||
{
|
||||
auto param = line.substr(line.find(delimiter) + delimiter.length(), line.length());
|
||||
// remove leading "
|
||||
if (param.at(0) == '"')
|
||||
param.erase(0, 1);
|
||||
// remove trailing "
|
||||
if (param.at(param.length() - 1) == '"')
|
||||
param.erase(param.length() - 1, 1);
|
||||
|
||||
if (param.find("h") == 0)
|
||||
{
|
||||
tempbutton = 1;
|
||||
break;
|
||||
}
|
||||
|
||||
if (option != line) // exit if we got no result from splitting the string
|
||||
}
|
||||
|
||||
const auto option = line.substr(0, line.find(delimiter));
|
||||
// exit if we got no result from splitting the string
|
||||
if (option != line)
|
||||
{
|
||||
if (option != find_setting)
|
||||
continue;
|
||||
|
||||
|
||||
// using the " = " to work out which is the option, and which is the parameter.
|
||||
auto param = line.substr(line.find(delimiter) + delimiter.length(), line.length());
|
||||
|
||||
|
@ -507,14 +525,7 @@ int find_retroarch(const TCHAR* find_setting, char* retroarch_file, host_input_b
|
|||
if (param.find('h') != 0) // check it isn't some kind of hat starting 'h' (so if D-pad uses buttons)
|
||||
{
|
||||
tempbutton = abs(atol(param.c_str()));
|
||||
}
|
||||
|
||||
// gets the parameter
|
||||
if (strncmp(find_setting, "count_hats", 10) == 0 && param.find("h0") == 0)
|
||||
{
|
||||
tempbutton = 1;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if (option == find_setting)
|
||||
break;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue