X-Git-Url: https://git.sesse.net/?a=blobdiff_plain;f=memory_mapped.c;h=c3a02be902f0163df9ddc7887f009c174270c4a4;hb=5291e047a1f54dfc049eee474ed51d0ca879dd28;hp=3764631f2c9d8bbf6cd81c6b4df1e2d0bb9efe4c;hpb=dfa1c598ba0c050538d5e90db4d5c50e080efe70;p=pistorm diff --git a/memory_mapped.c b/memory_mapped.c index 3764631..c3a02be 100644 --- a/memory_mapped.c +++ b/memory_mapped.c @@ -1,3 +1,5 @@ +// SPDX-License-Identifier: MIT + #include "config_file/config_file.h" #include "m68k.h" #include "platforms/amiga/Gayle.h" @@ -24,7 +26,7 @@ inline int handle_mapped_read(struct emulator_config *cfg, unsigned int addr, un if (cfg->map_type[i] == MAPTYPE_NONE) continue; else if (ovl && cfg->map_type[i] == MAPTYPE_ROM) { - if (cfg->map_mirror[i] != -1 && CHKRANGE(addr, cfg->map_mirror[i], cfg->map_size[i])) { + if (cfg->map_mirror[i] != ((unsigned int)-1) && CHKRANGE(addr, cfg->map_mirror[i], cfg->map_size[i])) { read_addr = cfg->map_data[i] + ((addr - cfg->map_mirror[i]) % cfg->rom_size[i]); goto read_value; }