Mercurial > repos > blastem
comparison romdb.c @ 2403:8171409b62ef
Fix incorrect manipulation of lock-on cart memory map
author | Michael Pavone <pavone@retrodev.com> |
---|---|
date | Mon, 01 Jan 2024 20:02:41 -0800 |
parents | 49b7ead35482 |
children |
comparison
equal
deleted
inserted
replaced
2402:49b7ead35482 | 2403:8171409b62ef |
---|---|
860 continue; | 860 continue; |
861 } | 861 } |
862 *map = lock_info.map[i]; | 862 *map = lock_info.map[i]; |
863 if (map->start < 0x200000) { | 863 if (map->start < 0x200000) { |
864 if (map->buffer) { | 864 if (map->buffer) { |
865 uint8_t *buf = map->buffer; | 865 uint32_t mask = (map->flags & MMAP_AUX_BUFF) ? map->aux_mask : map->mask; |
866 buf += (0x200000 - map->start) & ((map->flags & MMAP_AUX_BUFF) ? map->aux_mask : map->mask); | 866 if (mask < 0x3FFFFF) { |
867 map->buffer = buf; | 867 uint8_t *buf = map->buffer; |
868 buf += (0x200000 - map->start) & mask; | |
869 map->buffer = buf; | |
870 } | |
868 } | 871 } |
869 map->start = 0x200000; | 872 map->start = 0x200000; |
870 } | 873 } |
871 map++; | 874 map++; |
872 state->index++; | 875 state->index++; |