X-Git-Url: https://git.sesse.net/?a=blobdiff_plain;f=memory_mapped.c;h=3764631f2c9d8bbf6cd81c6b4df1e2d0bb9efe4c;hb=cfff241e2359701d1735da9199a76e0429d5625b;hp=bf424060898e29f166991a4af7f9b62707b48ad9;hpb=20b1a1fa0b8142b5be8e8dbbbbd6d71a9f2a931e;p=pistorm diff --git a/memory_mapped.c b/memory_mapped.c index bf42406..3764631 100644 --- a/memory_mapped.c +++ b/memory_mapped.c @@ -1,6 +1,6 @@ #include "config_file/config_file.h" #include "m68k.h" -#include "Gayle.h" +#include "platforms/amiga/Gayle.h" #include #define CHKRANGE(a, b, c) a >= (unsigned int)b && a < (unsigned int)(b + c) @@ -24,12 +24,12 @@ 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_ABS(addr, cfg->map_mirror[i], cfg->map_high[i])) { + if (cfg->map_mirror[i] != -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; } } - else if (CHKRANGE_ABS(addr, cfg->map_offset[i], cfg->map_high[i])) { + if (CHKRANGE_ABS(addr, cfg->map_offset[i], cfg->map_high[i])) { switch(cfg->map_type[i]) { case MAPTYPE_ROM: read_addr = cfg->map_data[i] + ((addr - cfg->map_offset[i]) % cfg->rom_size[i]);