Commit 67ade86
committed
input remapping: reset in-memory state on every content load (fix d4c8611 incomplete)
Commit d4c8611 ("Fix remapping default reset on close content")
added a defaults-reset to config_load_remap, but the new branch
fires only when sys_info->info.library_name is empty. In the
reproducer reported against the original 9eb083a regression
(open content -> unbind ABXY in Quick Menu without saving a
remap file -> close content -> reopen same content), the core
is reinitialized and runloop_event_init_core() calls
retro_get_system_info() at runloop.c:4745 BEFORE the
config_load_remap() call at runloop.c:4828. By the time
config_load_remap runs, sys_info->info.library_name is already
re-populated with the new core's name, so the new guard does
not fire, no tier file exists, and the function falls through
to 'return false' without ever resetting the per-port
input_remap_ids[][] arrays. The unsaved unbinds from the
previous session persist into the new one.
Move the reset above the early-return guards so it fires on
every entry to config_load_remap, regardless of whether a
core name is set or a remap directory is configured. This
is the load-path counterpart to input_remapping_cache_global_config()
in runloop_event_init_core: that function caches global
input settings on every content load so they can be restored
on unload; this reset clears the per-port remap arrays on
every content load so unsaved in-menu edits from a previous
session do not bleed through.
input_remapping_load_file() already calls
input_remapping_set_defaults(false) itself (configuration.c:6986)
before applying a tier file's bindings, so the double-reset
on the found-file path is harmless - it just clears arrays
that are about to be overwritten. The menu remap-file
removal sites in menu_cbs_ok.c that 9eb083a was actually
targeting are unaffected, since this is the load path, not
the delete path.1 parent 3cbdaa2 commit 67ade86
1 file changed
Lines changed: 18 additions & 8 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
5046 | 5046 | | |
5047 | 5047 | | |
5048 | 5048 | | |
5049 | | - | |
5050 | | - | |
5051 | | - | |
5052 | | - | |
5053 | | - | |
5054 | | - | |
| 5049 | + | |
| 5050 | + | |
| 5051 | + | |
| 5052 | + | |
| 5053 | + | |
| 5054 | + | |
| 5055 | + | |
| 5056 | + | |
| 5057 | + | |
| 5058 | + | |
| 5059 | + | |
| 5060 | + | |
| 5061 | + | |
| 5062 | + | |
| 5063 | + | |
5055 | 5064 | | |
5056 | | - | |
5057 | | - | |
| 5065 | + | |
| 5066 | + | |
| 5067 | + | |
5058 | 5068 | | |
5059 | 5069 | | |
5060 | 5070 | | |
| |||
0 commit comments