Formatting cleanup after merge

This commit is contained in:
Dimitris Panokostas 2020-05-23 21:23:59 +02:00
parent 6df92813e1
commit ec06c1ecaa
3 changed files with 320 additions and 252 deletions

View file

@ -1764,8 +1764,8 @@ void cfgfile_save_options(struct zfile* f, struct uae_prefs* p, int type)
for (i = 0; i < MAX_JPORTS; i++)
{
struct jport* jp = &p->jports[i];
int v = jp->id;
auto* jp = &p->jports[i];
auto v = jp->id;
TCHAR tmp1[MAX_DPATH], tmp2[MAX_DPATH];
if (v == JPORT_NONE)
{
@ -1836,7 +1836,7 @@ void cfgfile_save_options(struct zfile* f, struct uae_prefs* p, int type)
// this allows us to go through the available function keys
// currently only 'none' and 'hotkey'
for (int m = 0; m < 2; ++m)
for (auto m = 0; m < 2; ++m)
{
switch (m)
{
@ -1855,9 +1855,9 @@ void cfgfile_save_options(struct zfile* f, struct uae_prefs* p, int type)
}
// get all of the custom actions
for (int n = 0; n < 14; ++n) // loop through all buttons
for (auto n = 0; n < 14; ++n) // loop through all buttons
{
int b = 0;
auto b = 0;
switch (n)
{
case 0:
@ -2319,23 +2319,23 @@ void cfgfile_save_options(struct zfile* f, struct uae_prefs* p, int type)
cfgfile_dwrite_str(f, _T("uaeboard"), uaeboard[p->uaeboard]);
#ifdef AMIBERRY
cfg_write(_T("; "), f);
cfg_write(_T("; "), f);
cfg_write(_T("; *** WHDLoad Booter. Options"), f);
cfg_write(_T("; "), f);
//cfgfile_dwrite_bool , cfgfile_dwrite , cfgfile_dwrite_str
// i think these ^^ will only write if there is a variable to be written
// which we will want, after testing.
cfgfile_write_str (f, _T("whdload_slave"), p->whdbootprefs.slave);
cfgfile_write_bool (f, _T("whdload_showsplash"), p->whdbootprefs.showsplash);
cfgfile_write_bool (f, _T("whdload_buttonwait"), p->whdbootprefs.buttonwait);
cfgfile_write (f, _T("whdload_custom1"), _T("%d"), p->whdbootprefs.custom1);
cfgfile_write (f, _T("whdload_custom2"), _T("%d"), p->whdbootprefs.custom2);
cfgfile_write (f, _T("whdload_custom3"), _T("%d"), p->whdbootprefs.custom3);
cfgfile_write (f, _T("whdload_custom4"), _T("%d"), p->whdbootprefs.custom4);
cfgfile_write (f, _T("whdload_custom5"), _T("%d"), p->whdbootprefs.custom5);
cfgfile_write_str (f, _T("whdload_custom"), p->whdbootprefs.custom);
//cfgfile_dwrite_bool , cfgfile_dwrite , cfgfile_dwrite_str
// i think these ^^ will only write if there is a variable to be written
// which we will want, after testing.
cfgfile_write_str(f, _T("whdload_slave"), p->whdbootprefs.slave);
cfgfile_write_bool(f, _T("whdload_showsplash"), p->whdbootprefs.showsplash);
cfgfile_write_bool(f, _T("whdload_buttonwait"), p->whdbootprefs.buttonwait);
cfgfile_write(f, _T("whdload_custom1"), _T("%d"), p->whdbootprefs.custom1);
cfgfile_write(f, _T("whdload_custom2"), _T("%d"), p->whdbootprefs.custom2);
cfgfile_write(f, _T("whdload_custom3"), _T("%d"), p->whdbootprefs.custom3);
cfgfile_write(f, _T("whdload_custom4"), _T("%d"), p->whdbootprefs.custom4);
cfgfile_write(f, _T("whdload_custom5"), _T("%d"), p->whdbootprefs.custom5);
cfgfile_write_str(f, _T("whdload_custom"), p->whdbootprefs.custom);
#endif
}
@ -2830,11 +2830,11 @@ static int cfgfile_parse_host(struct uae_prefs* p, TCHAR* option, TCHAR* value)
#ifdef AMIBERRY
// custom options LOADING
for (int i = 0; i < 4; ++i) // Loop 1 ... all 4 joyports
for (auto i = 0; i < 4; ++i) // Loop 1 ... all 4 joyports
{
struct joypad_map_layout tempcustom = {};
for (int m = 0; m < 2; ++m) // Loop 2 ... none/hotkey function keys
for (auto m = 0; m < 2; ++m) // Loop 2 ... none/hotkey function keys
{
if (m == 0)
{
@ -2847,14 +2847,14 @@ static int cfgfile_parse_host(struct uae_prefs* p, TCHAR* option, TCHAR* value)
tempcustom = p->jports[i].amiberry_custom_hotkey;
}
for (int n = 0; n < 14; ++n) // Loop 3 ... all 14 buttons
for (auto n = 0; n < 14; ++n) // Loop 3 ... all 14 buttons
{
_stprintf(tmpbuf, "joyport%d_amiberry_custom_%s_%s", i, tmp1, button_remap_name[n]);
// this is where we need to check if we have this particular option!!
if (!_tcsncmp(option, _T(tmpbuf), sizeof(tmpbuf) / sizeof(TCHAR)))
{
int b = 0;
auto b = 0;
if (find_inputevent(value) > -1) { b = RemapEventList[find_inputevent(value)]; }
//else {b=0;}
@ -2889,15 +2889,15 @@ static int cfgfile_parse_host(struct uae_prefs* p, TCHAR* option, TCHAR* value)
} // close loop 1
/* Read in WHDLoad Options */
if (cfgfile_string(option, value, _T("whdload_slave"), p-> whdbootprefs.slave, sizeof p-> whdbootprefs.slave / sizeof (TCHAR))
|| cfgfile_string(option, value, _T("whdload_custom"), p-> whdbootprefs.custom, sizeof p-> whdbootprefs.custom / sizeof (TCHAR))
if (cfgfile_string(option, value, _T("whdload_slave"), p->whdbootprefs.slave, sizeof p->whdbootprefs.slave / sizeof(TCHAR))
|| cfgfile_string(option, value, _T("whdload_custom"), p->whdbootprefs.custom, sizeof p->whdbootprefs.custom / sizeof(TCHAR))
|| cfgfile_intval(option, value, _T("whdload_custom1"), &p->whdbootprefs.custom1, 1)
|| cfgfile_intval(option, value, _T("whdload_custom2"), &p->whdbootprefs.custom2, 1)
|| cfgfile_intval(option, value, _T("whdload_custom3"), &p->whdbootprefs.custom3, 1)
|| cfgfile_intval(option, value, _T("whdload_custom4"), &p->whdbootprefs.custom4, 1)
|| cfgfile_intval(option, value, _T("whdload_custom5"), &p->whdbootprefs.custom5, 1)
|| cfgfile_yesno(option, value, _T("whdload_buttonwait"), &p-> whdbootprefs.buttonwait)
|| cfgfile_yesno(option, value, _T("whdload_showsplash"), &p-> whdbootprefs.showsplash)
|| cfgfile_yesno(option, value, _T("whdload_buttonwait"), &p->whdbootprefs.buttonwait)
|| cfgfile_yesno(option, value, _T("whdload_showsplash"), &p->whdbootprefs.showsplash)
)
{
return 1;

View file

@ -24,7 +24,8 @@ extern long int version;
#define MAX_PATHS 8
struct multipath {
struct multipath
{
TCHAR path[MAX_PATHS][MAX_DPATH];
};
@ -40,8 +41,9 @@ struct multipath {
#define PATH_GEO 8
#define PATH_ROM 9
struct strlist {
struct strlist *next;
struct strlist
{
struct strlist* next;
TCHAR *option, *value;
int unknown;
};
@ -62,11 +64,12 @@ struct strlist {
#define INTERNALEVENT_COUNT 1
struct uae_input_device {
TCHAR *name;
TCHAR *configname;
struct uae_input_device
{
TCHAR* name;
TCHAR* configname;
uae_s16 eventid[MAX_INPUT_DEVICE_EVENTS][MAX_INPUT_SUB_EVENT_ALL];
TCHAR *custom[MAX_INPUT_DEVICE_EVENTS][MAX_INPUT_SUB_EVENT_ALL];
TCHAR* custom[MAX_INPUT_DEVICE_EVENTS][MAX_INPUT_SUB_EVENT_ALL];
uae_u64 flags[MAX_INPUT_DEVICE_EVENTS][MAX_INPUT_SUB_EVENT_ALL];
uae_s8 port[MAX_INPUT_DEVICE_EVENTS][MAX_INPUT_SUB_EVENT_ALL];
uae_s16 extra[MAX_INPUT_DEVICE_EVENTS];
@ -74,7 +77,8 @@ struct uae_input_device {
};
#ifdef AMIBERRY
struct joypad_map_layout {
struct joypad_map_layout
{
int south_action = 0;
int east_action = 0;
int west_action = 0;
@ -105,20 +109,26 @@ struct joypad_map_layout {
#define NORMAL_JPORTS 2
#define MAX_JPORT_NAME 128
#define MAX_JPORT_CONFIG 256
struct jport_custom {
struct jport_custom
{
TCHAR custom[MAX_DPATH];
};
struct inputdevconfig {
struct inputdevconfig
{
TCHAR name[MAX_JPORT_NAME];
TCHAR configname[MAX_JPORT_CONFIG];
TCHAR shortid[16];
};
struct jport {
struct jport
{
int id{};
int mode{}; // 0=def,1=mouse,2=joy,3=anajoy,4=lightpen
int submode;
int autofire{};
struct inputdevconfig idc {};
struct inputdevconfig idc{};
bool nokeyboardoverride{};
bool changed{};
#ifdef AMIBERRY
@ -179,6 +189,7 @@ struct cdslot
bool temporary;
int type;
};
struct floppyslot
{
TCHAR df[MAX_DPATH];
@ -190,7 +201,9 @@ struct floppyslot
#define ASPECTMULT 1024
#define WH_NATIVE 1
struct wh {
struct wh
{
int x, y;
int width, height;
int special;
@ -217,12 +230,15 @@ struct wh {
#define ISAUTOBOOT(ci) ((ci)->bootpri > BOOTPRI_NOAUTOBOOT)
#define ISAUTOMOUNT(ci) ((ci)->bootpri > BOOTPRI_NOAUTOMOUNT)
#define MAX_UAEDEV_BADBLOCKS 8
struct uaedev_badblock
{
uae_u32 first;
uae_u32 last;
};
struct uaedev_config_info {
struct uaedev_config_info
{
int type;
TCHAR devname[MAX_DPATH];
TCHAR volname[MAX_DPATH];
@ -276,9 +292,26 @@ struct uaedev_config_data
int unitnum; // scsi unit number (if tape currently)
};
enum { CP_GENERIC = 1, CP_CDTV, CP_CDTVCR, CP_CD32, CP_A500, CP_A500P, CP_A600,
CP_A1000, CP_A1200, CP_A2000, CP_A3000, CP_A3000T, CP_A4000, CP_A4000T,
CP_VELVET, CP_CASABLANCA, CP_DRACO };
enum
{
CP_GENERIC = 1,
CP_CDTV,
CP_CDTVCR,
CP_CD32,
CP_A500,
CP_A500P,
CP_A600,
CP_A1000,
CP_A1200,
CP_A2000,
CP_A3000,
CP_A3000T,
CP_A4000,
CP_A4000T,
CP_VELVET,
CP_CASABLANCA,
CP_DRACO
};
#define IDE_A600A1200 1
#define IDE_A4000 2
@ -320,6 +353,7 @@ enum { CP_GENERIC = 1, CP_CDTV, CP_CDTVCR, CP_CD32, CP_A500, CP_A500P, CP_A600,
#define MAX_CHIPSET_REFRESH_TOTAL (MAX_CHIPSET_REFRESH + 2)
#define CHIPSET_REFRESH_PAL (MAX_CHIPSET_REFRESH + 0)
#define CHIPSET_REFRESH_NTSC (MAX_CHIPSET_REFRESH + 1)
struct chipset_refresh
{
bool inuse;
@ -397,6 +431,7 @@ struct gfx_filterdata
#define MAX_EXPANSION_BOARDS 20
#define ROMCONFIG_CONFIGTEXT_LEN 256
struct boardromconfig;
struct romconfig
{
TCHAR romfile[MAX_DPATH];
@ -407,14 +442,16 @@ struct romconfig
int device_id;
int device_settings;
int subtype;
void *unitdata;
void* unitdata;
TCHAR configtext[ROMCONFIG_CONFIGTEXT_LEN];
uae_u16 manufacturer;
uae_u8 product;
uae_u8 autoconfig[16];
struct boardromconfig *back;
struct boardromconfig* back;
};
#define MAX_BOARD_ROMS 2
struct boardromconfig
{
int device_type;
@ -422,7 +459,9 @@ struct boardromconfig
int device_order;
struct romconfig roms[MAX_BOARD_ROMS];
};
#define MAX_RTG_BOARDS 1
struct rtgboardconfig
{
int rtg_index;
@ -431,13 +470,16 @@ struct rtgboardconfig
int device_order;
int monitor_id;
};
struct boardloadfile
{
uae_u32 loadoffset;
uae_u32 fileoffset, filesize;
TCHAR loadfile[MAX_DPATH];
};
#define MAX_ROM_BOARDS 4
struct romboard
{
uae_u32 size;
@ -445,7 +487,9 @@ struct romboard
uae_u32 end_address;
struct boardloadfile lf;
};
#define MAX_RAM_BOARDS 4
struct ramboard
{
uae_u32 size;
@ -462,6 +506,7 @@ struct ramboard
bool readonly;
struct boardloadfile lf;
};
struct expansion_params
{
int device_order;
@ -491,13 +536,13 @@ struct whdbooter
TCHAR custom[256];
bool buttonwait;
TCHAR slave[4096];
bool showsplash;
bool showsplash;
};
#endif
struct uae_prefs {
struct strlist *all_lines;
struct uae_prefs
{
struct strlist* all_lines;
TCHAR description[256];
TCHAR category[256];
@ -882,11 +927,11 @@ struct uae_prefs {
bool use_retroarch_reset;
bool use_retroarch_statebuttons;
// probably can be removed now? unless they are used by the new whd selector
// probably can be removed now? unless they are used by the new whd selector
TCHAR whdload_path[MAX_DPATH];
TCHAR whdload_file[MAX_DPATH];
struct whdbooter whdbootprefs;
struct whdbooter whdbootprefs;
#endif
@ -926,121 +971,123 @@ struct uae_prefs {
};
extern int config_changed;
extern void config_check_vsync (void);
extern void set_config_changed (void);
extern void config_check_vsync(void);
extern void set_config_changed(void);
/* Contains the filename of .uaerc */
//extern TCHAR optionsfile[];
extern void save_options (struct zfile *, struct uae_prefs *, int);
extern void save_options(struct zfile*, struct uae_prefs*, int);
extern void cfgfile_write (struct zfile *, const TCHAR *option, const TCHAR *format,...);
extern void cfgfile_dwrite (struct zfile *, const TCHAR *option, const TCHAR *format,...);
extern void cfgfile_target_write (struct zfile *, const TCHAR *option, const TCHAR *format,...);
extern void cfgfile_target_dwrite (struct zfile *, const TCHAR *option, const TCHAR *format,...);
extern void cfgfile_write(struct zfile*, const TCHAR* option, const TCHAR* format, ...);
extern void cfgfile_dwrite(struct zfile*, const TCHAR* option, const TCHAR* format, ...);
extern void cfgfile_target_write(struct zfile*, const TCHAR* option, const TCHAR* format, ...);
extern void cfgfile_target_dwrite(struct zfile*, const TCHAR* option, const TCHAR* format, ...);
extern void cfgfile_write_bool (struct zfile *f, const TCHAR *option, bool b);
extern void cfgfile_dwrite_bool (struct zfile *f,const TCHAR *option, bool b);
extern void cfgfile_target_write_bool (struct zfile *f, const TCHAR *option, bool b);
extern void cfgfile_target_dwrite_bool (struct zfile *f, const TCHAR *option, bool b);
extern void cfgfile_write_bool(struct zfile* f, const TCHAR* option, bool b);
extern void cfgfile_dwrite_bool(struct zfile* f, const TCHAR* option, bool b);
extern void cfgfile_target_write_bool(struct zfile* f, const TCHAR* option, bool b);
extern void cfgfile_target_dwrite_bool(struct zfile* f, const TCHAR* option, bool b);
extern void cfgfile_write_str (struct zfile *f, const TCHAR *option, const TCHAR *value);
extern void cfgfile_dwrite_str (struct zfile *f, const TCHAR *option, const TCHAR *value);
extern void cfgfile_target_write_str (struct zfile *f, const TCHAR *option, const TCHAR *value);
extern void cfgfile_target_dwrite_str (struct zfile *f, const TCHAR *option, const TCHAR *value);
extern void cfgfile_write_str(struct zfile* f, const TCHAR* option, const TCHAR* value);
extern void cfgfile_dwrite_str(struct zfile* f, const TCHAR* option, const TCHAR* value);
extern void cfgfile_target_write_str(struct zfile* f, const TCHAR* option, const TCHAR* value);
extern void cfgfile_target_dwrite_str(struct zfile* f, const TCHAR* option, const TCHAR* value);
extern void cfgfile_backup (const TCHAR *path);
extern struct uaedev_config_data *add_filesys_config (struct uae_prefs *p, int index, struct uaedev_config_info*);
extern bool get_hd_geometry (struct uaedev_config_info *);
extern void uci_set_defaults (struct uaedev_config_info *uci, bool rdb);
extern void cfgfile_backup(const TCHAR* path);
extern struct uaedev_config_data* add_filesys_config(struct uae_prefs* p, int index, struct uaedev_config_info*);
extern bool get_hd_geometry(struct uaedev_config_info*);
extern void uci_set_defaults(struct uaedev_config_info* uci, bool rdb);
extern void error_log (const TCHAR*, ...);
extern TCHAR *get_error_log (void);
extern bool is_error_log (void);
extern void error_log(const TCHAR*, ...);
extern TCHAR* get_error_log(void);
extern bool is_error_log(void);
extern void default_prefs (struct uae_prefs *, bool, int);
extern void discard_prefs (struct uae_prefs *, int);
extern void copy_prefs(struct uae_prefs *src, struct uae_prefs *dst);
extern int bip_a500 (struct uae_prefs *p, int rom);
extern int bip_a500plus (struct uae_prefs *p, int rom);
extern int bip_a1200 (struct uae_prefs *p, int rom);
extern int bip_a2000 (struct uae_prefs *p, int rom);
extern int bip_a4000 (struct uae_prefs *p, int rom);
extern int bip_cd32 (struct uae_prefs *p, int rom);
extern void default_prefs(struct uae_prefs*, bool, int);
extern void discard_prefs(struct uae_prefs*, int);
extern void copy_prefs(struct uae_prefs* src, struct uae_prefs* dst);
extern int bip_a500(struct uae_prefs* p, int rom);
extern int bip_a500plus(struct uae_prefs* p, int rom);
extern int bip_a1200(struct uae_prefs* p, int rom);
extern int bip_a2000(struct uae_prefs* p, int rom);
extern int bip_a4000(struct uae_prefs* p, int rom);
extern int bip_cd32(struct uae_prefs* p, int rom);
int parse_cmdline_option (struct uae_prefs *, TCHAR, const TCHAR*);
int parse_cmdline_option(struct uae_prefs*, TCHAR, const TCHAR*);
extern int cfgfile_separate_linea (const TCHAR *filename, char *line, TCHAR *line1b, TCHAR *line2b);
extern int cfgfile_yesno (const TCHAR *option, const TCHAR *value, const TCHAR *name, bool *location);
extern int cfgfile_intval (const TCHAR *option, const TCHAR *value, const TCHAR *name, int *location, int scale);
extern int cfgfile_strval (const TCHAR *option, const TCHAR *value, const TCHAR *name, int *location, const TCHAR *table[], int more);
extern int cfgfile_string (const TCHAR *option, const TCHAR *value, const TCHAR *name, TCHAR *location, int maxsz);
extern bool cfgfile_option_find(const TCHAR *s, const TCHAR *option);
extern TCHAR *cfgfile_option_get(const TCHAR *s, const TCHAR *option);
extern TCHAR *cfgfile_subst_path (const TCHAR *path, const TCHAR *subst, const TCHAR *file);
extern int cfgfile_separate_linea(const TCHAR* filename, char* line, TCHAR* line1b, TCHAR* line2b);
extern int cfgfile_yesno(const TCHAR* option, const TCHAR* value, const TCHAR* name, bool* location);
extern int cfgfile_intval(const TCHAR* option, const TCHAR* value, const TCHAR* name, int* location, int scale);
extern int cfgfile_strval(const TCHAR* option, const TCHAR* value, const TCHAR* name, int* location,
const TCHAR* table[], int more);
extern int cfgfile_string(const TCHAR* option, const TCHAR* value, const TCHAR* name, TCHAR* location, int maxsz);
extern bool cfgfile_option_find(const TCHAR* s, const TCHAR* option);
extern TCHAR* cfgfile_option_get(const TCHAR* s, const TCHAR* option);
extern TCHAR* cfgfile_subst_path(const TCHAR* path, const TCHAR* subst, const TCHAR* file);
extern TCHAR *target_expand_environment (const TCHAR *path, TCHAR *out, int maxlen);
extern int target_parse_option (struct uae_prefs *, const TCHAR *option, const TCHAR *value);
extern void target_save_options (struct zfile*, struct uae_prefs *);
extern void target_default_options (struct uae_prefs *, int type);
extern void target_fixup_options (struct uae_prefs *);
extern int target_cfgfile_load (struct uae_prefs *, const TCHAR *filename, int type, int isdefault);
extern void cfgfile_save_options (struct zfile *f, struct uae_prefs *p, int type);
extern int target_get_display (const TCHAR*);
extern const TCHAR *target_get_display_name (int, bool);
extern void target_multipath_modified(struct uae_prefs *);
extern void cfgfile_resolve_path_out_load(const TCHAR *path, TCHAR *out, int size, int type);
extern void cfgfile_resolve_path_load(TCHAR *path, int size, int type);
extern void cfgfile_resolve_path_out_save(const TCHAR *path, TCHAR *out, int size, int type);
extern void cfgfile_resolve_path_save(TCHAR *path, int size, int type);
extern TCHAR* target_expand_environment(const TCHAR* path, TCHAR* out, int maxlen);
extern int target_parse_option(struct uae_prefs*, const TCHAR* option, const TCHAR* value);
extern void target_save_options(struct zfile*, struct uae_prefs*);
extern void target_default_options(struct uae_prefs*, int type);
extern void target_fixup_options(struct uae_prefs*);
extern int target_cfgfile_load(struct uae_prefs*, const TCHAR* filename, int type, int isdefault);
extern void cfgfile_save_options(struct zfile* f, struct uae_prefs* p, int type);
extern int target_get_display(const TCHAR*);
extern const TCHAR* target_get_display_name(int, bool);
extern void target_multipath_modified(struct uae_prefs*);
extern void cfgfile_resolve_path_out_load(const TCHAR* path, TCHAR* out, int size, int type);
extern void cfgfile_resolve_path_load(TCHAR* path, int size, int type);
extern void cfgfile_resolve_path_out_save(const TCHAR* path, TCHAR* out, int size, int type);
extern void cfgfile_resolve_path_save(TCHAR* path, int size, int type);
extern struct uae_prefs *cfgfile_open(const TCHAR *filename, int *type);
extern void cfgfile_close(struct uae_prefs *p);
extern int cfgfile_load (struct uae_prefs *p, const TCHAR *filename, int *type, int ignorelink, int userconfig);
extern int cfgfile_save (struct uae_prefs *p, const TCHAR *filename, int);
extern void cfgfile_parse_line (struct uae_prefs *p, TCHAR *, int);
extern void cfgfile_parse_lines (struct uae_prefs *p, const TCHAR *, int);
extern int cfgfile_parse_option (struct uae_prefs *p, const TCHAR *option, TCHAR *value, int);
extern int cfgfile_get_description (struct uae_prefs *p, const TCHAR *filename, TCHAR *description, int *type);
extern void cfgfile_show_usage (void);
extern int cfgfile_searchconfig(const TCHAR *in, int index, TCHAR *out, int outsize);
extern uae_u32 cfgfile_uaelib(TrapContext *ctx, int mode, uae_u32 name, uae_u32 dst, uae_u32 maxlen);
extern uae_u32 cfgfile_uaelib_modify(TrapContext *ctx, uae_u32 mode, uae_u32 parms, uae_u32 size, uae_u32 out, uae_u32 outsize);
extern uae_u32 cfgfile_modify (uae_u32 index, const TCHAR *parms, uae_u32 size, TCHAR *out, uae_u32 outsize);
extern void cfgfile_addcfgparam (TCHAR *);
extern int built_in_prefs (struct uae_prefs *p, int model, int config, int compa, int romcheck);
extern int built_in_chipset_prefs (struct uae_prefs *p);
extern int built_in_cpuboard_prefs(struct uae_prefs *p);
extern struct uae_prefs* cfgfile_open(const TCHAR* filename, int* type);
extern void cfgfile_close(struct uae_prefs* p);
extern int cfgfile_load(struct uae_prefs* p, const TCHAR* filename, int* type, int ignorelink, int userconfig);
extern int cfgfile_save(struct uae_prefs* p, const TCHAR* filename, int);
extern void cfgfile_parse_line(struct uae_prefs* p, TCHAR*, int);
extern void cfgfile_parse_lines(struct uae_prefs* p, const TCHAR*, int);
extern int cfgfile_parse_option(struct uae_prefs* p, const TCHAR* option, TCHAR* value, int);
extern int cfgfile_get_description(struct uae_prefs* p, const TCHAR* filename, TCHAR* description, int* type);
extern void cfgfile_show_usage(void);
extern int cfgfile_searchconfig(const TCHAR* in, int index, TCHAR* out, int outsize);
extern uae_u32 cfgfile_uaelib(TrapContext* ctx, int mode, uae_u32 name, uae_u32 dst, uae_u32 maxlen);
extern uae_u32 cfgfile_uaelib_modify(TrapContext* ctx, uae_u32 mode, uae_u32 parms, uae_u32 size, uae_u32 out,
uae_u32 outsize);
extern uae_u32 cfgfile_modify(uae_u32 index, const TCHAR* parms, uae_u32 size, TCHAR* out, uae_u32 outsize);
extern void cfgfile_addcfgparam(TCHAR*);
extern int built_in_prefs(struct uae_prefs* p, int model, int config, int compa, int romcheck);
extern int built_in_chipset_prefs(struct uae_prefs* p);
extern int built_in_cpuboard_prefs(struct uae_prefs* p);
//extern int cmdlineparser (const TCHAR *s, TCHAR *outp[], int max);
extern void fixup_prefs_dimensions (struct uae_prefs *prefs);
extern void fixup_prefs (struct uae_prefs *prefs, bool userconfig);
extern void fixup_cpu (struct uae_prefs *prefs);
extern void cfgfile_compatibility_romtype(struct uae_prefs *p);
extern void cfgfile_compatibility_rtg(struct uae_prefs *p);
extern bool cfgfile_detect_art(struct uae_prefs *p, TCHAR *path);
extern const TCHAR *cfgfile_getconfigdata(int *len);
extern bool cfgfile_createconfigstore(struct uae_prefs *p);
extern void cfgfile_get_shader_config(struct uae_prefs *p, int rtg);
extern void fixup_prefs_dimensions(struct uae_prefs* prefs);
extern void fixup_prefs(struct uae_prefs* prefs, bool userconfig);
extern void fixup_cpu(struct uae_prefs* prefs);
extern void cfgfile_compatibility_romtype(struct uae_prefs* p);
extern void cfgfile_compatibility_rtg(struct uae_prefs* p);
extern bool cfgfile_detect_art(struct uae_prefs* p, TCHAR* path);
extern const TCHAR* cfgfile_getconfigdata(int* len);
extern bool cfgfile_createconfigstore(struct uae_prefs* p);
extern void cfgfile_get_shader_config(struct uae_prefs* p, int rtg);
#ifdef AMIBERRY
extern void whdload_auto_prefs (struct uae_prefs *prefs, char* filename);
extern void cd_auto_prefs (struct uae_prefs *prefs, char* filename);
extern void symlink_roms(struct uae_prefs *prefs);
extern void whdload_auto_prefs(struct uae_prefs* prefs, char* filename);
extern void cd_auto_prefs(struct uae_prefs* prefs, char* filename);
extern void symlink_roms(struct uae_prefs* prefs);
#endif
extern void check_prefs_changed_custom (void);
extern void check_prefs_changed_cpu (void);
extern void check_prefs_changed_audio (void);
extern void check_prefs_changed_cd (void);
extern int check_prefs_changed_gfx (void);
extern void check_prefs_changed_custom(void);
extern void check_prefs_changed_cpu(void);
extern void check_prefs_changed_audio(void);
extern void check_prefs_changed_cd(void);
extern int check_prefs_changed_gfx(void);
extern struct uae_prefs currprefs, changed_prefs;
extern int machdep_init (void);
extern void machdep_free (void);
extern int machdep_init(void);
extern void machdep_free(void);
#ifdef AMIBERRY
struct amiberry_customised_layout {
struct amiberry_customised_layout
{
// create structures for each 'function' button
struct joypad_map_layout none;
struct joypad_map_layout select;

View file

@ -19,12 +19,12 @@
#include "rommgr.h"
#include "zfile.h"
extern FILE *debugfile;
extern FILE* debugfile;
#include "fsdb.h"
#include <libxml/tree.h>
extern void SetLastActiveConfig(const char *filename);
extern void SetLastActiveConfig(const char* filename);
extern char currentDir[MAX_DPATH];
extern char last_loaded_config[MAX_DPATH];
@ -81,28 +81,28 @@ struct host_options
TCHAR fixed_cd32_width[256] = "nul\0";
};
static xmlNode *get_node(xmlNode *node, const char *name)
static xmlNode* get_node(xmlNode* node, const char* name)
{
for (auto curr_node = node; curr_node; curr_node = curr_node->next)
for (auto* curr_node = node; curr_node; curr_node = curr_node->next)
{
if (curr_node->type == XML_ELEMENT_NODE && strcmp(reinterpret_cast<const char *>(curr_node->name), name) == 0)
if (curr_node->type == XML_ELEMENT_NODE && strcmp(reinterpret_cast<const char*>(curr_node->name), name) == 0)
return curr_node->children;
}
return nullptr;
}
static bool get_value(xmlNode *node, const char *key, char *value, int max_size)
static bool get_value(xmlNode* node, const char* key, char* value, int max_size)
{
auto result = false;
for (auto curr_node = node; curr_node; curr_node = curr_node->next)
for (auto* curr_node = node; curr_node; curr_node = curr_node->next)
{
if (curr_node->type == XML_ELEMENT_NODE && strcmp(reinterpret_cast<const char *>(curr_node->name), key) == 0)
if (curr_node->type == XML_ELEMENT_NODE && strcmp(reinterpret_cast<const char*>(curr_node->name), key) == 0)
{
const auto content = xmlNodeGetContent(curr_node);
auto* const content = xmlNodeGetContent(curr_node);
if (content != nullptr)
{
strncpy(value, reinterpret_cast<char *>(content), max_size);
strncpy(value, reinterpret_cast<char*>(content), max_size);
xmlFree(content);
result = true;
}
@ -113,7 +113,7 @@ static bool get_value(xmlNode *node, const char *key, char *value, int max_size)
return result;
}
static TCHAR *parse_text(const TCHAR *s)
static TCHAR* parse_text(const TCHAR* s)
{
if (*s == '"' || *s == '\'')
{
@ -132,7 +132,7 @@ static TCHAR *parse_text(const TCHAR *s)
return my_strdup(s);
}
static TCHAR *parse_text_path(const TCHAR *s)
static TCHAR* parse_text_path(const TCHAR* s)
{
auto* s2 = parse_text(s);
auto* const s3 = target_expand_environment(s2, nullptr, 0);
@ -140,7 +140,7 @@ static TCHAR *parse_text_path(const TCHAR *s)
return s3;
}
long get_file_size(const std::string &filename)
long get_file_size(const std::string& filename)
{
struct stat stat_buf
{
@ -149,14 +149,14 @@ long get_file_size(const std::string &filename)
return rc == 0 ? stat_buf.st_size : -1;
}
void remove_char(char *array, int len, int index)
void remove_char(char* array, int len, int index)
{
for (auto i = index; i < len - 1; ++i)
array[i] = array[i + 1];
array[len - 1] = 0;
}
void parse_custom_settings(struct uae_prefs *p, char *InSettings)
void parse_custom_settings(struct uae_prefs* p, char* InSettings)
{
char temp_options[4096];
strcpy(temp_options, InSettings);
@ -176,15 +176,15 @@ void parse_custom_settings(struct uae_prefs *p, char *InSettings)
}
}
struct membuf : std::streambuf
struct membuf final : std::streambuf
{
membuf(char *begin, char *end)
membuf(char* begin, char* end)
{
this->setg(begin, begin, end);
}
};
std::string find_whdload_game_option(const TCHAR *find_setting, char *whd_options)
std::string find_whdload_game_option(const TCHAR* find_setting, char* whd_options)
{
char temp_options[4096];
char temp_setting[4096];
@ -225,7 +225,7 @@ std::string find_whdload_game_option(const TCHAR *find_setting, char *whd_option
return output;
}
struct game_options get_game_settings(char *HW)
struct game_options get_game_settings(char* HW)
{
struct game_options output_detail;
strcpy(output_detail.port0, find_whdload_game_option("PORT0", HW).c_str());
@ -252,7 +252,7 @@ struct game_options get_game_settings(char *HW)
return output_detail;
}
struct host_options get_host_settings(char *HW)
struct host_options get_host_settings(char* HW)
{
struct host_options output_detail;
strcpy(output_detail.controller1, find_whdload_game_option("CONTROLLER_1", HW).c_str());
@ -281,7 +281,7 @@ struct host_options get_host_settings(char *HW)
return output_detail;
}
void make_rom_symlink(const char *kick_short, char *kick_path, int kick_numb, struct uae_prefs *p)
void make_rom_symlink(const char* kick_short, char* kick_path, int kick_numb, struct uae_prefs* p)
{
char kick_long[MAX_DPATH];
int roms[2];
@ -294,7 +294,7 @@ void make_rom_symlink(const char *kick_short, char *kick_path, int kick_numb, st
if (!zfile_exists(kick_long))
{
roms[0] = kick_numb; // kickstart 1.2 A500
roms[0] = kick_numb; // kickstart 1.2 A500
const auto rom_test = configure_rom(p, roms, 0); // returns 0 or 1 if found or not found
if (rom_test == 1)
{
@ -304,7 +304,7 @@ void make_rom_symlink(const char *kick_short, char *kick_path, int kick_numb, st
}
}
void symlink_roms(struct uae_prefs *prefs)
void symlink_roms(struct uae_prefs* prefs)
{
// *** KICKSTARTS ***
//
@ -360,10 +360,10 @@ void symlink_roms(struct uae_prefs *prefs)
symlink(tmp, tmp2);
}
void cd_auto_prefs(struct uae_prefs *prefs, char *filepath)
void cd_auto_prefs(struct uae_prefs* prefs, char* filepath)
{
TCHAR game_name[MAX_DPATH];
TCHAR *txt2 = nullptr;
TCHAR* txt2 = nullptr;
TCHAR tmp[MAX_DPATH];
char config_path[MAX_DPATH];
char whd_config[255];
@ -405,7 +405,7 @@ void cd_auto_prefs(struct uae_prefs *prefs, char *filepath)
ifstream read_file(whd_config);
std::ifstream in(whd_config);
std::string contents((std::istreambuf_iterator<char>(in)),
std::istreambuf_iterator<char>());
std::istreambuf_iterator<char>());
_stprintf(hardware_settings, "%s", contents.c_str());
host_detail = get_host_settings(hardware_settings);
@ -475,7 +475,7 @@ void cd_auto_prefs(struct uae_prefs *prefs, char *filepath)
}
// APPLY SPECIAL CONFIG E.G. MOUSE OR ALT. JOYSTICK SETTINGS
for (auto &jport : prefs->jports)
for (auto& jport : prefs->jports)
{
jport.id = JPORT_NONE;
jport.idc.configname[0] = 0;
@ -534,10 +534,10 @@ void cd_auto_prefs(struct uae_prefs *prefs, char *filepath)
}
}
void whdload_auto_prefs(struct uae_prefs *prefs, char *filepath)
void whdload_auto_prefs(struct uae_prefs* prefs, char* filepath)
{
TCHAR game_name[MAX_DPATH];
TCHAR *txt2 = nullptr;
TCHAR* txt2 = nullptr;
TCHAR tmp[MAX_DPATH];
char boot_path[MAX_DPATH];
char save_path[MAX_DPATH];
@ -545,7 +545,7 @@ void whdload_auto_prefs(struct uae_prefs *prefs, char *filepath)
char whd_path[MAX_DPATH];
char kick_path[MAX_DPATH];
char uae_config[255];
char uae_config[255];
char whd_config[255];
char whd_startup[255];
@ -554,7 +554,8 @@ void whdload_auto_prefs(struct uae_prefs *prefs, char *filepath)
char hardware_settings[4096];
char custom_settings[4096];
char selected_slave[4096]; // note!! this should be global later on, and only collected from the XML if set to 'nothing'
char selected_slave[4096];
// note!! this should be global later on, and only collected from the XML if set to 'nothing'
char subpath[4096];
auto use_slave_libs = false;
@ -570,7 +571,7 @@ void whdload_auto_prefs(struct uae_prefs *prefs, char *filepath)
// this allows A600HD to be used to slow games down
int roms[2];
roms[0] = 15; // kickstart 2.05 A600HD .. 10
roms[0] = 15; // kickstart 2.05 A600HD .. 10
const auto rom_test = configure_rom(prefs, roms, 0); // returns 0 or 1 if found or not found
const auto a600_available = rom_test;
@ -594,20 +595,20 @@ void whdload_auto_prefs(struct uae_prefs *prefs, char *filepath)
strcat(uae_config, game_name);
strcat(uae_config, ".uae");
// AUTOBOOT files depreciated
// snprintf(whd_path, MAX_DPATH, "%s/whdboot/save-data/Autoboots/", start_path_data);
// strcpy(whd_startup, whd_path);
// strcat(whd_startup, game_name);
// strcat(whd_startup, ".auto-startup");
// setups for tmp folder.
// AUTOBOOT files depreciated
// snprintf(whd_path, MAX_DPATH, "%s/whdboot/save-data/Autoboots/", start_path_data);
// strcpy(whd_startup, whd_path);
// strcat(whd_startup, game_name);
// strcat(whd_startup, ".auto-startup");
// setups for tmp folder.
my_mkdir("/tmp/s");
my_mkdir("/tmp/c");
my_mkdir("/tmp/devs");
strcpy(whd_startup, "/tmp/s/startup-sequence");
my_mkdir("/tmp/devs");
strcpy(whd_startup, "/tmp/s/startup-sequence");
remove(whd_startup);
//my_unlink("/tmp/s/startup-sequence"); // startup-sequence is no longer a symlink
//my_unlink("/tmp/s/startup-sequence"); // startup-sequence is no longer a symlink
// LOAD HOST OPTIONS
snprintf(whd_path, MAX_DPATH, "%s/whdboot/WHDLoad", start_path_data);
@ -615,15 +616,15 @@ void whdload_auto_prefs(struct uae_prefs *prefs, char *filepath)
// are we using save-data/ ?
snprintf(kick_path, MAX_DPATH, "%s/whdboot/save-data/Kickstarts", start_path_data);
// if we have a config file, we will use it
// we will need it for the WHDLoad options too.
// if we have a config file, we will use it
// we will need it for the WHDLoad options too.
if (zfile_exists(uae_config))
{
write_log("WHDBooter - %s found. Loading Config for WHDload options.\n", uae_config);
target_cfgfile_load(&currprefs, uae_config, CONFIG_TYPE_ALL, 0);
}
write_log("WHDBooter - %s found. Loading Config for WHDload options.\n", uae_config);
target_cfgfile_load(&currprefs, uae_config, CONFIG_TYPE_ALL, 0);
}
// this should be made into it's own routine!! 1 (see repeat, above)
snprintf(whd_path, MAX_DPATH, "%s/whdboot/", start_path_data);
@ -636,7 +637,7 @@ void whdload_auto_prefs(struct uae_prefs *prefs, char *filepath)
ifstream read_file(whd_config);
std::ifstream in(whd_config);
std::string contents((std::istreambuf_iterator<char>(in)),
std::istreambuf_iterator<char>());
std::istreambuf_iterator<char>());
_stprintf(hardware_settings, "%s", contents.c_str());
write_log("WHDBooter - Loading hostprefs.conf.\n");
@ -663,7 +664,7 @@ void whdload_auto_prefs(struct uae_prefs *prefs, char *filepath)
while (game_node != nullptr)
{
auto* const attr = xmlGetProp(game_node, reinterpret_cast<const xmlChar *>("filename"));
auto* const attr = xmlGetProp(game_node, reinterpret_cast<const xmlChar*>("filename"));
if (attr != nullptr)
{
if (strcmpi(reinterpret_cast<const char *>(attr), game_name) == 0)
@ -675,7 +676,7 @@ void whdload_auto_prefs(struct uae_prefs *prefs, char *filepath)
if (xmlNodeGetContent(temp_node) != nullptr)
{
_stprintf(hardware_settings, "%s",
reinterpret_cast<const char *>(xmlNodeGetContent(temp_node)));
reinterpret_cast<const char*>(xmlNodeGetContent(temp_node)));
game_detail = get_game_settings(hardware_settings);
write_log("WHDBooter - Game H/W Settings: \n%s\n", hardware_settings);
@ -687,24 +688,25 @@ void whdload_auto_prefs(struct uae_prefs *prefs, char *filepath)
if (xmlNodeGetContent(temp_node) != nullptr)
{
_stprintf(custom_settings, "%s",
reinterpret_cast<const char *>(xmlNodeGetContent(temp_node)));
reinterpret_cast<const char*>(xmlNodeGetContent(temp_node)));
}
if (strlen(selected_slave) == 0)
{
temp_node = game_node->xmlChildrenNode;
temp_node = get_node(temp_node, "slave_default");
// use a selected slave if we have one
if (strlen(currprefs.whdbootprefs.slave) != 0)
{ strcpy(selected_slave, currprefs.whdbootprefs.slave);
write_log("WHDBooter - Config Selected Slave: %s \n", selected_slave);
}
// otherwise use the XML default
else if (xmlNodeGetContent(temp_node) != nullptr)
// use a selected slave if we have one
if (strlen(currprefs.whdbootprefs.slave) != 0)
{
strcpy(selected_slave, currprefs.whdbootprefs.slave);
write_log("WHDBooter - Config Selected Slave: %s \n", selected_slave);
}
// otherwise use the XML default
else if (xmlNodeGetContent(temp_node) != nullptr)
{
_stprintf(selected_slave, "%s",
reinterpret_cast<const char *>(xmlNodeGetContent(temp_node)));
reinterpret_cast<const char*>(xmlNodeGetContent(temp_node)));
write_log("WHDBooter - Default Slave: %s\n", selected_slave);
}
@ -714,7 +716,7 @@ void whdload_auto_prefs(struct uae_prefs *prefs, char *filepath)
if (xmlNodeGetContent(temp_node) != nullptr)
{
_stprintf(subpath, "%s",
reinterpret_cast<const char *>(xmlNodeGetContent(temp_node)));
reinterpret_cast<const char*>(xmlNodeGetContent(temp_node)));
write_log("WHDBooter - SubPath: %s\n", subpath);
}
@ -742,9 +744,9 @@ void whdload_auto_prefs(struct uae_prefs *prefs, char *filepath)
else
write_log("WHDBooter - Could not load whdload_db.xml - does not exist?\n");
_stprintf(whd_bootscript, "\n");
// currently, we have selected a slave, so we create a startup-sequence
// currently, we have selected a slave, so we create a startup-sequence
if (strlen(selected_slave) != 0)
{
_stprintf(whd_bootscript, " \n");
@ -761,30 +763,46 @@ void whdload_auto_prefs(struct uae_prefs *prefs, char *filepath)
_stprintf(whd_bootscript, "%sCD \"Games:%s\"\n", whd_bootscript, subpath);
_stprintf(whd_bootscript, "%sWHDLoad SLAVE=\"Games:%s/%s\"", whd_bootscript, subpath, selected_slave);
_stprintf(whd_bootscript, "%s PRELOAD NOWRITECACHE NOREQ", whd_bootscript);
// CUSTOM options
if (currprefs.whdbootprefs.custom1 > 0)
{ _stprintf(whd_bootscript, "%s CUSTOM1=%d", whd_bootscript, currprefs.whdbootprefs.custom1 ); }
if (currprefs.whdbootprefs.custom2 > 0)
{ _stprintf(whd_bootscript, "%s CUSTOM2=%d", whd_bootscript, currprefs.whdbootprefs.custom2 ); }
if (currprefs.whdbootprefs.custom3 > 0)
{ _stprintf(whd_bootscript, "%s CUSTOM3=%d", whd_bootscript, currprefs.whdbootprefs.custom3 ); }
if (currprefs.whdbootprefs.custom4 > 0)
{ _stprintf(whd_bootscript, "%s CUSTOM4=%d", whd_bootscript, currprefs.whdbootprefs.custom4 ); }
if (currprefs.whdbootprefs.custom5 > 0)
{ _stprintf(whd_bootscript, "%s CUSTOM5=%d", whd_bootscript, currprefs.whdbootprefs.custom5 ); }
if (strlen(currprefs.whdbootprefs.custom) != 0)
{ _stprintf(whd_bootscript, "%s CUSTOM=\"%s\"", whd_bootscript, currprefs.whdbootprefs.custom ); }
// BUTTONWAIT
if (currprefs.whdbootprefs.buttonwait == true)
{ _stprintf(whd_bootscript, "%s BUTTONWAIT", whd_bootscript); }
// SPLASH
if (currprefs.whdbootprefs.showsplash != true)
{_stprintf(whd_bootscript, "%s SPLASHDELAY=0", whd_bootscript);}
// SPECIAL SAVE PATH
// CUSTOM options
if (currprefs.whdbootprefs.custom1 > 0)
{
_stprintf(whd_bootscript, "%s CUSTOM1=%d", whd_bootscript, currprefs.whdbootprefs.custom1);
}
if (currprefs.whdbootprefs.custom2 > 0)
{
_stprintf(whd_bootscript, "%s CUSTOM2=%d", whd_bootscript, currprefs.whdbootprefs.custom2);
}
if (currprefs.whdbootprefs.custom3 > 0)
{
_stprintf(whd_bootscript, "%s CUSTOM3=%d", whd_bootscript, currprefs.whdbootprefs.custom3);
}
if (currprefs.whdbootprefs.custom4 > 0)
{
_stprintf(whd_bootscript, "%s CUSTOM4=%d", whd_bootscript, currprefs.whdbootprefs.custom4);
}
if (currprefs.whdbootprefs.custom5 > 0)
{
_stprintf(whd_bootscript, "%s CUSTOM5=%d", whd_bootscript, currprefs.whdbootprefs.custom5);
}
if (strlen(currprefs.whdbootprefs.custom) != 0)
{
_stprintf(whd_bootscript, "%s CUSTOM=\"%s\"", whd_bootscript, currprefs.whdbootprefs.custom);
}
// BUTTONWAIT
if (currprefs.whdbootprefs.buttonwait == true)
{
_stprintf(whd_bootscript, "%s BUTTONWAIT", whd_bootscript);
}
// SPLASH
if (currprefs.whdbootprefs.showsplash != true)
{
_stprintf(whd_bootscript, "%s SPLASHDELAY=0", whd_bootscript);
}
// SPECIAL SAVE PATH
_stprintf(whd_bootscript, "%s SAVEPATH=Saves:Savegames/ SAVEDIR=\"%s\"", whd_bootscript, subpath);
_stprintf(whd_bootscript, "%s\n", whd_bootscript);
@ -802,11 +820,11 @@ void whdload_auto_prefs(struct uae_prefs *prefs, char *filepath)
// now we should have a startup-file (if we don't, we are going to use the original booter)
if (zfile_exists(whd_startup))
{
// depreciated auto-startup bits
// write_log("WHDBooter - Found Auto-Startup to SymLink\n");
// // create a symlink to this as startup-sequence in /tmp/
// symlink(whd_startup, "/tmp/s/startup-sequence");
//
// depreciated auto-startup bits
// write_log("WHDBooter - Found Auto-Startup to SymLink\n");
// // create a symlink to this as startup-sequence in /tmp/
// symlink(whd_startup, "/tmp/s/startup-sequence");
//
// create a symlink to WHDLoad in /tmp/
snprintf(whd_path, MAX_DPATH, "%s/whdboot/WHDLoad", start_path_data);
symlink(whd_path, "/tmp/c/WHDLoad");
@ -858,9 +876,9 @@ void whdload_auto_prefs(struct uae_prefs *prefs, char *filepath)
write_log("WHDBooter - Host: Fixed CD32 Height: %s \n", host_detail.fixed_cd32_height);
write_log("WHDBooter - Host: Fixed CD32 Width : %s \n", host_detail.fixed_cd32_width);
#endif
// so remember, we already loaded a .uae config, so we dont need to do the below manual setup for hardware
if (zfile_exists(uae_config))
// so remember, we already loaded a .uae config, so we dont need to do the below manual setup for hardware
if (zfile_exists(uae_config))
{
write_log("WHDBooter - %s found; ignoring WHD Quickstart setup.\n", uae_config);
return;
@ -874,7 +892,7 @@ void whdload_auto_prefs(struct uae_prefs *prefs, char *filepath)
// SET THE BASE AMIGA (Expanded A600)
built_in_prefs(prefs, 2, 2, 0, 0);
else
// SET THE BASE AMIGA (Expanded A1200)
// SET THE BASE AMIGA (Expanded A1200)
{
built_in_prefs(prefs, 4, 1, 0, 0);
if (strcmpi(game_detail.fast, "nul") != 0 && (strcmpi(game_detail.cpu, "nul") == 0))
@ -895,7 +913,7 @@ void whdload_auto_prefs(struct uae_prefs *prefs, char *filepath)
prefs->chipset_mask = CSMASK_ECS_AGNUS | CSMASK_ECS_DENISE;
prefs->m68k_speed = 0;
}
// A1200
// A1200
else
_tcscpy(prefs->description, _T("AutoBoot Configuration [WHDLoad] [AGA]"));
@ -965,10 +983,12 @@ void whdload_auto_prefs(struct uae_prefs *prefs, char *filepath)
// APPLY THE SETTINGS FOR MOUSE/JOYSTICK ETC
// CD32
if (static_cast<bool>(is_cd32) && (strcmpi(game_detail.port0, "nul") == 0 || strcmpi(game_detail.port0, "cd32") == 0))
if (static_cast<bool>(is_cd32)
&& (strcmpi(game_detail.port0, "nul") == 0 || strcmpi(game_detail.port0, "cd32") == 0))
prefs->jports[0].mode = 7;
if (static_cast<bool>(is_cd32) && (strcmpi(game_detail.port1, "nul") == 0 || strcmpi(game_detail.port1, "cd32") == 0))
if (static_cast<bool>(is_cd32)
&& (strcmpi(game_detail.port1, "nul") == 0 || strcmpi(game_detail.port1, "cd32") == 0))
prefs->jports[1].mode = 7;
// JOY
@ -984,7 +1004,7 @@ void whdload_auto_prefs(struct uae_prefs *prefs, char *filepath)
prefs->jports[1].mode = 2;
// APPLY SPECIAL CONFIG E.G. MOUSE OR ALT. JOYSTICK SETTINGS
for (auto &jport : prefs->jports)
for (auto& jport : prefs->jports)
{
jport.id = JPORT_NONE;
jport.idc.configname[0] = 0;
@ -1001,7 +1021,7 @@ void whdload_auto_prefs(struct uae_prefs *prefs, char *filepath)
write_log("WHDBooter Option (Mouse Control): %s\n", txt2);
}
// PORT 0 - JOYSTICK GAMES
// PORT 0 - JOYSTICK GAMES
else if (!(strcmpi(host_detail.controller2, "nul") == 0))
{
_stprintf(txt2, "%s=%s", _T("joyport0"), _T(host_detail.controller2));
@ -1022,7 +1042,7 @@ void whdload_auto_prefs(struct uae_prefs *prefs, char *filepath)
cfgfile_parse_line(prefs, txt2, 0);
write_log("WHDBooter Option (Mouse Control): %s\n", txt2);
}
// PORT 1 - JOYSTICK GAMES
// PORT 1 - JOYSTICK GAMES
else if (!(strcmpi(host_detail.controller1, "nul") == 0))
{
_stprintf(txt2, "%s=%s", _T("joyport1"), _T(host_detail.controller1));
@ -1114,7 +1134,8 @@ void whdload_auto_prefs(struct uae_prefs *prefs, char *filepath)
}
// SOUND OPTIONS
if (strcmpi(host_detail.sound_on, "false") == 0 || strcmpi(host_detail.sound_on, "off") == 0 || strcmpi(host_detail.sound_on, "none") == 0)
if (strcmpi(host_detail.sound_on, "false") == 0 || strcmpi(host_detail.sound_on, "off") == 0 || strcmpi(
host_detail.sound_on, "none") == 0)
{
_stprintf(txt2, "sound_output=none");
cfgfile_parse_line(prefs, txt2, 0);
@ -1174,7 +1195,7 @@ void whdload_auto_prefs(struct uae_prefs *prefs, char *filepath)
cfgfile_parse_line(prefs, txt2, 0);
}
// COMPATIBLE CPU
// COMPATIBLE CPU
if (strcmpi(game_detail.cpu_comp, "true") == 0)
{
_stprintf(txt2, "cpu_compatible=true");
@ -1192,7 +1213,7 @@ void whdload_auto_prefs(struct uae_prefs *prefs, char *filepath)
_stprintf(txt2, "cpu_24bit_addressing=false");
cfgfile_parse_line(prefs, txt2, 0);
}
//FAST / Z3 MEMORY REQUIREMENTS
int temp_ram;
if (strcmpi(game_detail.fast, "nul") != 0)