src/mess/machine/ataricrt.c
| r11199 | r11200 | |
| 605 | 605 | DEVICE_IMAGE_LOAD( a5200_cart ) |
| 606 | 606 | { |
| 607 | 607 | UINT8 *mem = image.device().machine().region("maincpu")->base(); |
| 608 | | int size; |
| 608 | UINT32 size; |
| 609 | |
| 609 | 610 | if (image.software_entry() == NULL) |
| 610 | 611 | { |
| 611 | 612 | /* load an optional (dual) cartidge */ |
| 612 | 613 | size = image.fread(&mem[0x4000], 0x8000); |
| 613 | | } else { |
| 614 | } |
| 615 | else |
| 616 | { |
| 614 | 617 | size = image.get_software_region_length("rom"); |
| 615 | 618 | memcpy(mem + 0x4000, image.get_software_region("rom"), size); |
| 616 | 619 | } |
| 620 | |
| 617 | 621 | if (size<0x8000) memmove(mem+0x4000+0x8000-size, mem+0x4000, size); |
| 618 | 622 | // mirroring of smaller cartridges |
| 619 | 623 | if (size <= 0x1000) memcpy(mem+0xa000, mem+0xb000, 0x1000); |
| 620 | 624 | if (size <= 0x2000) memcpy(mem+0x8000, mem+0xa000, 0x2000); |
| 621 | 625 | if (size <= 0x4000) |
| 622 | 626 | { |
| 623 | | const char *info; |
| 627 | const char *info = hashfile_extrainfo(image); |
| 624 | 628 | memcpy(&mem[0x4000], &mem[0x8000], 0x4000); |
| 625 | | info = hashfile_extrainfo(image); |
| 626 | | if (strcmp(info, "") && !strcmp(info, "A13MIRRORING")) |
| 629 | if (info && !strcmp(info, "A13MIRRORING")) |
| 627 | 630 | { |
| 628 | 631 | memcpy(&mem[0x8000], &mem[0xa000], 0x2000); |
| 629 | 632 | memcpy(&mem[0x6000], &mem[0x4000], 0x2000); |
| 630 | 633 | } |
| 631 | 634 | } |
| 632 | | logerror("%s loaded cartridge '%s' size %dK\n", |
| 633 | | image.device().machine().system().name, image.filename() , size/1024); |
| 635 | logerror("A5200 loaded cartridge '%s' size %dK\n", image.filename() , size/1024); |
| 634 | 636 | return IMAGE_INIT_PASS; |
| 635 | 637 | } |
| 636 | 638 | |