Fixed #97, #75, #63 now actually saving/loading Custom Control settings properly

This commit is contained in:
Dimitris Panokostas 2017-04-22 18:43:05 +02:00
parent eeea4d17ba
commit 17119973ca
4 changed files with 26 additions and 39 deletions

View file

@ -69,7 +69,6 @@
<ProjectFile>Amiberry.vcxproj</ProjectFile>
<RemoteBuildEnvironment>
<Records />
<EnvironmentSetupFiles />
</RemoteBuildEnvironment>
<ParallelJobCount>1</ParallelJobCount>
</Build>

View file

@ -2473,30 +2473,6 @@ static int cfgfile_parse_host(struct uae_prefs *p, TCHAR *option, TCHAR *value)
if (cfgfile_intval(option, value, "button_for_quit", &p->button_for_quit, 1))
return 1;
if (cfgfile_yesno(option, value, "amiberry.custom_controls", &p->customControls, true))
return 1;
if (cfgfile_intval(option, value, "amiberry.custom_up", &p->custom_up, 1))
return 1;
if (cfgfile_intval(option, value, "amiberry.custom_down", &p->custom_down, 1))
return 1;
if (cfgfile_intval(option, value, "amiberry.custom_left", &p->custom_left, 1))
return 1;
if (cfgfile_intval(option, value, "amiberry.custom_right", &p->custom_right, 1))
return 1;
if (cfgfile_intval(option, value, "amiberry.custom_a", &p->custom_a, 1))
return 1;
if (cfgfile_intval(option, value, "amiberry.custom_b", &p->custom_b, 1))
return 1;
if (cfgfile_intval(option, value, "amiberry.custom_x", &p->custom_x, 1))
return 1;
if (cfgfile_intval(option, value, "amiberry.custom_y", &p->custom_y, 1))
return 1;
if (cfgfile_intval(option, value, "amiberry.custom_l", &p->custom_l, 1))
return 1;
if (cfgfile_intval(option, value, "amiberry.custom_r", &p->custom_r, 1))
return 1;
if (cfgfile_intval(option, value, "amiberry.custom_play", &p->custom_play, 1))
return 1;
#endif
return 0;
}

View file

@ -321,19 +321,31 @@ int target_parse_option(struct uae_prefs* p, const char* option, const char* val
if (cfgfile_intval(option, value, "button_for_quit", &p->button_for_quit, 1))
return 1;
int result = cfgfile_yesno(option, value, "amiberry.custom_controls", &p->customControls)
|| cfgfile_intval(option, value, "amiberry.custom_up", &p->custom_up, 1)
|| cfgfile_intval(option, value, "amiberry.custom_down", &p->custom_down, 1)
|| cfgfile_intval(option, value, "amiberry.custom_left", &p->custom_left, 1)
|| cfgfile_intval(option, value, "amiberry.custom_right", &p->custom_right, 1)
|| cfgfile_intval(option, value, "amiberry.custom_a", &p->custom_a, 1)
|| cfgfile_intval(option, value, "amiberry.custom_b", &p->custom_b, 1)
|| cfgfile_intval(option, value, "amiberry.custom_x", &p->custom_x, 1)
|| cfgfile_intval(option, value, "amiberry.custom_y", &p->custom_y, 1)
|| cfgfile_intval(option, value, "amiberry.custom_l", &p->custom_l, 1)
|| cfgfile_intval(option, value, "amiberry.custom_r", &p->custom_r, 1)
|| cfgfile_intval(option, value, "amiberry.custom_play", &p->custom_play, 1);
return result;
if (cfgfile_yesno(option, value, "custom_controls", &p->customControls))
return 1;
if (cfgfile_intval(option, value, "custom_up", &p->custom_up, 1))
return 1;
if (cfgfile_intval(option, value, "custom_down", &p->custom_down, 1))
return 1;
if (cfgfile_intval(option, value, "custom_left", &p->custom_left, 1))
return 1;
if (cfgfile_intval(option, value, "custom_right", &p->custom_right, 1))
return 1;
if (cfgfile_intval(option, value, "custom_a", &p->custom_a, 1))
return 1;
if (cfgfile_intval(option, value, "custom_b", &p->custom_b, 1))
return 1;
if (cfgfile_intval(option, value, "custom_x", &p->custom_x, 1))
return 1;
if (cfgfile_intval(option, value, "custom_y", &p->custom_y, 1))
return 1;
if (cfgfile_intval(option, value, "custom_l", &p->custom_l, 1))
return 1;
if (cfgfile_intval(option, value, "custom_r", &p->custom_r, 1))
return 1;
if (cfgfile_intval(option, value, "custom_play", &p->custom_play, 1))
return 1;
return 0;
}
void fetch_datapath(char* out, int size)

View file

@ -9,7 +9,7 @@
#pragma once
#include "SDL.h"
#define TARGET_NAME "Amiberry"
#define TARGET_NAME "amiberry"
#define NO_MAIN_IN_MAIN_C