"rom",
"ram",
"register",
- "ram (no alloc)",
+ "ram_noalloc",
+ "wtcram",
};
const char *config_item_names[CONFITEM_NUM] = {
cfg->map_high[index] = addr + size;
cfg->map_mirror[index] = mirr_addr;
if (strlen(map_id)) {
+ if (cfg->map_id[index]) {
+ free(cfg->map_id[index]);
+ }
cfg->map_id[index] = (char *)malloc(strlen(map_id) + 1);
strcpy(cfg->map_id[index], map_id);
}
printf("[CFG] Adding %d byte (%d MB) RAM mapping %s...\n", size, size / 1024 / 1024, map_id);
cfg->map_data[index] = (unsigned char *)filename;
break;
+ case MAPTYPE_RAM_WTC:
+ printf("[CFG] Allocating %d bytes for Write-Through Cached RAM mapping (%.1f MB)...\n", size, (float)size / 1024.0f / 1024.0f);
+ goto alloc_mapram;
+ break;
case MAPTYPE_RAM:
printf("[CFG] Allocating %d bytes for RAM mapping (%d MB)...\n", size, size / 1024 / 1024);
+alloc_mapram:
cfg->map_data[index] = (unsigned char *)malloc(size);
if (!cfg->map_data[index]) {
printf("[CFG] ERROR: Unable to allocate memory for mapped RAM!\n");
goto mapping_failed;
}
memset(cfg->map_data[index], 0x00, size);
+ if (type == MAPTYPE_RAM_WTC) {
+ // This may look a bit weird, but it adds a read range for the WTC RAM. Writes still go through to the mapped read/write functions.
+ m68k_add_rom_range(cfg->map_offset[index], cfg->map_high[index], cfg->map_data[index]);
+ }
break;
case MAPTYPE_ROM:
in = fopen(filename, "rb");