src/mame/drivers/neogeo.c
| r14277 | r14278 | |
| 1285 | 1285 | { |
| 1286 | 1286 | // create memory regions |
| 1287 | 1287 | size = image.get_software_region_length("maincpu"); |
| 1288 | | image.device().machine().region_free("maincpu"); |
| 1289 | | image.device().machine().region_alloc("maincpu",size, 2, ENDIANNESS_BIG); |
| 1288 | image.device().machine().region_free(":maincpu"); |
| 1289 | image.device().machine().region_alloc(":maincpu",size, 2, ENDIANNESS_BIG); |
| 1290 | 1290 | memcpy(image.device().machine().region("maincpu")->base(),image.get_software_region("maincpu"),size); |
| 1291 | 1291 | |
| 1292 | 1292 | // for whatever reason (intentional, or design flaw) software loaded via software lists is swapped in endianess vs. the standard ROM loading, regardless of the above. Swap it to keep consistency |
| r14277 | r14278 | |
| 1297 | 1297 | } |
| 1298 | 1298 | |
| 1299 | 1299 | size = image.get_software_region_length("fixed"); |
| 1300 | | image.device().machine().region_free("fixed"); |
| 1301 | | image.device().machine().region_alloc("fixed",size,1, ENDIANNESS_LITTLE); |
| 1300 | image.device().machine().region_free(":fixed"); |
| 1301 | image.device().machine().region_alloc(":fixed",size,1, ENDIANNESS_LITTLE); |
| 1302 | 1302 | memcpy(image.device().machine().region("fixed")->base(),image.get_software_region("fixed"),size); |
| 1303 | 1303 | |
| 1304 | 1304 | if(image.get_software_region("audiocpu") != NULL) |
| 1305 | 1305 | { |
| 1306 | 1306 | size = image.get_software_region_length("audiocpu"); |
| 1307 | | image.device().machine().region_free("audiocpu"); |
| 1308 | | image.device().machine().region_alloc("audiocpu",size+0x10000,1, ENDIANNESS_LITTLE); |
| 1307 | image.device().machine().region_free(":audiocpu"); |
| 1308 | image.device().machine().region_alloc(":audiocpu",size+0x10000,1, ENDIANNESS_LITTLE); |
| 1309 | 1309 | memcpy(image.device().machine().region("audiocpu")->base(),image.get_software_region("audiocpu"),size); |
| 1310 | 1310 | memcpy(image.device().machine().region("audiocpu")->base()+0x10000,image.get_software_region("audiocpu"),size); // avoid reloading in XML, should just improve banking instead tho? |
| 1311 | 1311 | } |
| 1312 | 1312 | |
| 1313 | 1313 | |
| 1314 | 1314 | size = image.get_software_region_length("ymsnd"); |
| 1315 | | image.device().machine().region_free("ymsnd"); |
| 1316 | | image.device().machine().region_alloc("ymsnd",size,1, ENDIANNESS_LITTLE); |
| 1315 | image.device().machine().region_free(":ymsnd"); |
| 1316 | image.device().machine().region_alloc(":ymsnd",size,1, ENDIANNESS_LITTLE); |
| 1317 | 1317 | memcpy(image.device().machine().region("ymsnd")->base(),image.get_software_region("ymsnd"),size); |
| 1318 | 1318 | if(image.get_software_region("ymsnd.deltat") != NULL) |
| 1319 | 1319 | { |
| 1320 | 1320 | size = image.get_software_region_length("ymsnd.deltat"); |
| 1321 | | image.device().machine().region_free("ymsnd.deltat"); |
| 1322 | | image.device().machine().region_alloc("ymsnd.deltat",size,1, ENDIANNESS_LITTLE); |
| 1321 | image.device().machine().region_free(":ymsnd.deltat"); |
| 1322 | image.device().machine().region_alloc(":ymsnd.deltat",size,1, ENDIANNESS_LITTLE); |
| 1323 | 1323 | memcpy(image.device().machine().region("ymsnd.deltat")->base(),image.get_software_region("ymsnd.deltat"),size); |
| 1324 | 1324 | } |
| 1325 | 1325 | else |
| 1326 | | image.device().machine().region_free("ymsnd.deltat"); // removing the region will fix sound glitches in non-Delta-T games |
| 1326 | image.device().machine().region_free(":ymsnd.deltat"); // removing the region will fix sound glitches in non-Delta-T games |
| 1327 | 1327 | ym->reset(); |
| 1328 | 1328 | size = image.get_software_region_length("sprites"); |
| 1329 | | image.device().machine().region_free("sprites"); |
| 1330 | | image.device().machine().region_alloc("sprites",size,1, ENDIANNESS_LITTLE); |
| 1329 | image.device().machine().region_free(":sprites"); |
| 1330 | image.device().machine().region_alloc(":sprites",size,1, ENDIANNESS_LITTLE); |
| 1331 | 1331 | memcpy(image.device().machine().region("sprites")->base(),image.get_software_region("sprites"),size); |
| 1332 | 1332 | if(image.get_software_region("audiocrypt") != NULL) // encrypted Z80 code |
| 1333 | 1333 | { |
| 1334 | 1334 | size = image.get_software_region_length("audiocrypt"); |
| 1335 | | image.device().machine().region_alloc("audiocrypt",size,1, ENDIANNESS_LITTLE); |
| 1335 | image.device().machine().region_alloc(":audiocrypt",size,1, ENDIANNESS_LITTLE); |
| 1336 | 1336 | memcpy(image.device().machine().region("audiocrypt")->base(),image.get_software_region("audiocrypt"),size); |
| 1337 | 1337 | // allocate the audiocpu region to decrypt data into |
| 1338 | | image.device().machine().region_free("audiocpu"); |
| 1339 | | image.device().machine().region_alloc("audiocpu",size+0x10000,1, ENDIANNESS_LITTLE); |
| 1338 | image.device().machine().region_free(":audiocpu"); |
| 1339 | image.device().machine().region_alloc(":audiocpu",size+0x10000,1, ENDIANNESS_LITTLE); |
| 1340 | 1340 | } |
| 1341 | 1341 | |
| 1342 | 1342 | // setup cartridge ROM area |