changeset 2402:49b7ead35482

Fix asan violation that occurs when locking on a cart with its own mapper hardware
author Michael Pavone <pavone@retrodev.com>
date Mon, 01 Jan 2024 19:50:20 -0800
parents 34b4ff091891
children 8171409b62ef
files romdb.c
diffstat 1 files changed, 3 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/romdb.c	Mon Jan 01 19:27:31 2024 -0800
+++ b/romdb.c	Mon Jan 01 19:50:20 2024 -0800
@@ -469,6 +469,7 @@
 {
 	rom_info info;
 	info.mapper_type = MAPPER_NONE;
+	info.mapper_start_index = 0;
 	info.name = get_header_name(rom);
 	info.regions = get_header_regions(rom);
 	info.is_save_lock_on = 0;
@@ -834,6 +835,8 @@
 			//skip this entry if there is no lock on cartridge attached
 			return;
 		}
+		//TODO: detect if this conflicts with host cart mapper
+		state->info->mapper_start_index = lock_info.mapper_start_index;
 		uint32_t matching_chunks = 0;
 		for (int i = 0; i < lock_info.map_chunks; i++)
 		{