diff --git a/arc_file.c b/arc_file.c index c5e268e..fcb17d1 100644 --- a/arc_file.c +++ b/arc_file.c @@ -18,6 +18,7 @@ typedef struct { char vhdname[17]; char conf[MAX_CONF_SIZE]; char buttons_str[MAX_BUTTONS_SIZE+1]; + char cfg_file_n; } arc_t; static arc_t arc; @@ -39,7 +40,8 @@ const ini_var_t arc_ini_vars[] = { {"DIR", (void*)arc.dirname, STRING, 1, 16, 1}, {"VHD", (void*)arc.vhdname, STRING, 1, 16, 1}, {"CONF", (void*)arc_set_conf, CUSTOM_HANDLER, 0, 0, 1}, - {"BUTTONS", (void*)arc.buttons_str, STRING, 1, MAX_BUTTONS_SIZE, 1} + {"BUTTONS", (void*)arc.buttons_str, STRING, 1, MAX_BUTTONS_SIZE, 1}, + {"CFG_FILE_N", (void*)(&arc.cfg_file_n), UINT8, 0, 99, 1}, }; char arc_set_conf(char *c, char action, int tag) @@ -132,3 +134,8 @@ const char *arc_get_button(int index) } return 0; } + +char arc_get_cfg_file_n() +{ + return arc.cfg_file_n; +} diff --git a/arc_file.h b/arc_file.h index 7f4bf2a..d5c136c 100644 --- a/arc_file.h +++ b/arc_file.h @@ -17,5 +17,6 @@ char *arc_get_conf(); uint64_t arc_get_default(); const char *arc_get_buttons(); const char *arc_get_button(int index); +char arc_get_cfg_file_n(); #endif // ARC_FILE_H diff --git a/fpga.c b/fpga.c index c39efd6..d03805a 100644 --- a/fpga.c +++ b/fpga.c @@ -34,6 +34,7 @@ along with this program. If not, see . #include "osd.h" #include "fpga.h" #include "tos.h" +#include "arc_file.h" #include "mist_cfg.h" #include "settings.h" #include "usb/joymapping.h" @@ -1004,7 +1005,7 @@ unsigned char fpga_init(const char *name) { df[3].status = 0; config.kickstart[0]=0; - SetConfigurationFilename(0); // Use default config + SetConfigurationFilename(arc_get_cfg_file_n()); LoadConfiguration(0, 1); // Use slot-based config filename } // end of minimig setup