diswitch.c: Fix crash issues and and cleanup
- Partial rewrite to clean up dipswitch struct to prevent potential crashes - Fix problems on vs games without dipswitch to cause core to crash - Create dipswitch struct based on new core options layout
This commit is contained in:
File diff suppressed because it is too large
Load Diff
@@ -3,8 +3,9 @@
|
||||
|
||||
#include <libretro.h>
|
||||
|
||||
void set_dipswitch_variables(unsigned *index, struct retro_core_option_definition *vars);
|
||||
size_t set_dipswitch_variables(unsigned current_index, struct retro_core_option_definition *vars);
|
||||
void update_dipswitch(void);
|
||||
void DPSW_Cleanup(void);
|
||||
|
||||
extern retro_environment_t environ_cb;
|
||||
|
||||
|
||||
@@ -759,7 +759,8 @@ static void set_variables(void)
|
||||
}
|
||||
|
||||
/* Append dipswitch settings to core options if available */
|
||||
set_dipswitch_variables(&index, option_defs_us);
|
||||
index += set_dipswitch_variables(index, option_defs_us);
|
||||
option_defs_us[index] = option_defs_empty;
|
||||
|
||||
libretro_set_core_options(environ_cb);
|
||||
}
|
||||
@@ -987,6 +988,7 @@ void retro_deinit (void)
|
||||
ps2 = NULL;
|
||||
#endif
|
||||
libretro_supports_bitmasks = false;
|
||||
DPSW_Cleanup();
|
||||
}
|
||||
|
||||
void retro_reset(void)
|
||||
|
||||
Reference in New Issue
Block a user