+void adjust_ranges_amiga(struct emulator_config *cfg) {
+ cfg->mapped_high = 0;
+ cfg->mapped_low = 0;
+ cfg->custom_high = 0;
+ cfg->custom_low = 0;
+
+ // Set up the min/max ranges for mapped reads/writes
+ if (gayle_emulation_enabled) {
+ cfg->mapped_low = GAYLEBASE;
+ cfg->mapped_high = GAYLEBASE + GAYLESIZE;
+ }
+ for (int i = 0; i < MAX_NUM_MAPPED_ITEMS; i++) {
+ if (cfg->map_type[i] != MAPTYPE_NONE) {
+ if ((cfg->map_offset[i] != 0 && cfg->map_offset[i] < cfg->mapped_low) || cfg->mapped_low == 0)
+ cfg->mapped_low = cfg->map_offset[i];
+ if (cfg->map_offset[i] + cfg->map_size[i] > cfg->mapped_high)
+ cfg->mapped_high = cfg->map_offset[i] + cfg->map_size[i];
+ }
+ }
+
+ if (ac_z2_pic_count && !ac_z2_done) {
+ if (cfg->custom_low == 0)
+ cfg->custom_low = AC_Z2_BASE;
+ else
+ cfg->custom_low = min(cfg->custom_low, AC_Z2_BASE);
+ cfg->custom_high = max(cfg->custom_high, AC_Z2_BASE + AC_SIZE);
+ }
+ if (ac_z3_pic_count && !ac_z3_done) {
+ if (cfg->custom_low == 0)
+ cfg->custom_low = AC_Z3_BASE;
+ else
+ cfg->custom_low = min(cfg->custom_low, AC_Z3_BASE);
+ cfg->custom_high = max(cfg->custom_high, AC_Z3_BASE + AC_SIZE);
+ }
+
+ printf("Platform custom range: %.8X-%.8X\n", cfg->custom_low, cfg->custom_high);
+ printf("Platform mapped range: %.8X-%.8X\n", cfg->mapped_low, cfg->mapped_high);
+}
+