I want to set a default value for an environmental variable, but there seems to be no way to do this. It seems to default to the first option provided to it, so I solved this problem as follows:
environ_cb = cb;
// TODO: Sets the default value to 4, this is very hackish, but there doesn't seem to be a better way.
retro_variable vars[] = {
{ "sfb_max_players", "Maximum number of players allowed (Requires restart); 4|2|3|1|5|6|7|8" },
{ nullptr, nullptr },
};
cb(RETRO_ENVIRONMENT_SET_VARIABLES, vars);
vars[0] = { "sfb_max_players", "Maximum number of players allowed (Requires restart); 1|2|3|4|5|6|7|8" };
cb(RETRO_ENVIRONMENT_SET_VARIABLES, vars);
The code should give sfb_max_players
the option of 1,2,3,4,5,6,7, or 8, with 4 being the default value. The solution I chose is very hacky, is there a better solution?