trunk/src/mame/drivers/jaguar.c
| r32640 | r32641 | |
| 340 | 340 | #include "sound/dac.h" |
| 341 | 341 | #include "includes/jaguar.h" |
| 342 | 342 | #include "emuopts.h" |
| 343 | | #include "imagedev/cartslot.h" |
| 344 | 343 | #include "imagedev/snapquik.h" |
| 345 | 344 | #include "sound/dac.h" |
| 346 | 345 | #include "machine/eepromser.h" |
| 347 | 346 | #include "sound/cdda.h" |
| 348 | 347 | #include "cdrom.h" |
| 349 | 348 | #include "imagedev/chd_cd.h" |
| 349 | #include "bus/generic/slot.h" |
| 350 | #include "bus/generic/carts.h" |
| 350 | 351 | |
| 351 | 352 | |
| 352 | 353 | #define COJAG_CLOCK XTAL_52MHz |
| r32640 | r32641 | |
| 1880 | 1881 | MCFG_QUICKLOAD_ADD("quickload", jaguar_state, jaguar, "abs,bin,cof,jag,prg", 2) |
| 1881 | 1882 | |
| 1882 | 1883 | /* cartridge */ |
| 1883 | | MCFG_CARTSLOT_ADD("cart") |
| 1884 | | MCFG_CARTSLOT_EXTENSION_LIST("j64,rom") |
| 1885 | | MCFG_CARTSLOT_INTERFACE("jaguar_cart") |
| 1886 | | MCFG_CARTSLOT_LOAD(jaguar_state,jaguar_cart) |
| 1884 | MCFG_GENERIC_CARTSLOT_ADD("cartslot", generic_plain_slot, "jaguar_cart") |
| 1885 | MCFG_GENERIC_EXTENSIONS("j64,rom,bin") |
| 1886 | MCFG_GENERIC_LOAD(jaguar_state, jaguar_cart) |
| 1887 | 1887 | |
| 1888 | 1888 | /* software lists */ |
| 1889 | 1889 | MCFG_SOFTWARE_LIST_ADD("cart_list","jaguar") |
| r32640 | r32641 | |
| 2045 | 2045 | { |
| 2046 | 2046 | /* Initialize for no cartridge present */ |
| 2047 | 2047 | m_using_cart = false; |
| 2048 | | memset( m_cart_base, 0, memshare("cart")->bytes() ); |
| 2048 | memset(m_cart_base, 0, memshare("cart")->bytes()); |
| 2049 | 2049 | } |
| 2050 | 2050 | |
| 2051 | 2051 | DEVICE_IMAGE_LOAD_MEMBER( jaguar_state, jaguar_cart ) |
| 2052 | 2052 | { |
| 2053 | | return cart_load(image); |
| 2054 | | } |
| 2055 | | |
| 2056 | | int jaguar_state::cart_load(device_image_interface &image) |
| 2057 | | { |
| 2058 | 2053 | UINT32 size, load_offset = 0; |
| 2059 | 2054 | |
| 2060 | 2055 | if (image.software_entry() == NULL) |
| r32640 | r32641 | |
| 2064 | 2059 | /* .rom files load & run at 802000 */ |
| 2065 | 2060 | if (!core_stricmp(image.filetype(), "rom")) |
| 2066 | 2061 | { |
| 2067 | | load_offset = 0x2000; // fix load address |
| 2068 | | m_cart_base[0x101]=0x802000; // fix exec address |
| 2062 | load_offset = 0x2000; // fix load address |
| 2063 | m_cart_base[0x101] = 0x802000; // fix exec address |
| 2069 | 2064 | } |
| 2070 | 2065 | |
| 2071 | 2066 | /* Load cart into memory */ |
| 2072 | | image.fread( &memregion("maincpu")->base()[0x800000+load_offset], size); |
| 2067 | image.fread(&memregion("maincpu")->base()[0x800000 + load_offset], size); |
| 2073 | 2068 | } |
| 2074 | 2069 | else |
| 2075 | 2070 | { |
| r32640 | r32641 | |
| 2084 | 2079 | |
| 2085 | 2080 | /* Skip the logo */ |
| 2086 | 2081 | m_using_cart = true; |
| 2087 | | // m_cart_base[0x102] = 1; |
| 2082 | // m_cart_base[0x102] = 1; |
| 2088 | 2083 | |
| 2089 | 2084 | /* Transfer control to the bios */ |
| 2090 | 2085 | m_maincpu->set_pc(m_rom_base[1]); |
| r32640 | r32641 | |
| 2106 | 2101 | ROM_START( jaguar ) |
| 2107 | 2102 | ROM_REGION( 0x1000000, "maincpu", 0 ) /* 4MB for RAM at 0 */ |
| 2108 | 2103 | ROM_LOAD16_WORD( "jagboot.rom", 0xe00000, 0x020000, CRC(fb731aaa) SHA1(f8991b0c385f4e5002fa2a7e2f5e61e8c5213356) ) |
| 2109 | | ROM_CART_LOAD("cart", 0x800000, 0x600000, ROM_NOMIRROR) |
| 2110 | 2104 | |
| 2111 | 2105 | ROM_REGION16_BE( 0x1000, "waverom", 0 ) |
| 2112 | 2106 | ROM_LOAD16_WORD("jagwave.rom", 0x0000, 0x1000, CRC(7a25ee5b) SHA1(58117e11fd6478c521fbd3fdbe157f39567552f0) ) |
| r32640 | r32641 | |
| 2115 | 2109 | ROM_START( jaguarcd ) |
| 2116 | 2110 | ROM_REGION( 0x1000000, "maincpu", 0 ) |
| 2117 | 2111 | ROM_LOAD16_WORD( "jagboot.rom", 0xe00000, 0x020000, CRC(fb731aaa) SHA1(f8991b0c385f4e5002fa2a7e2f5e61e8c5213356) ) |
| 2118 | | ROM_CART_LOAD("cart", 0x800000, 0x600000, ROM_NOMIRROR) // TODO: needs to be removed (CD BIOS runs in the cart space) |
| 2112 | // TODO: cart needs to be removed (CD BIOS runs in the cart space) |
| 2119 | 2113 | |
| 2120 | 2114 | ROM_REGION(0x40000, "cdbios", 0 ) |
| 2121 | 2115 | ROM_SYSTEM_BIOS( 0, "default", "Jaguar CD" ) |
trunk/src/mess/drivers/megadriv.c
| r32640 | r32641 | |
| 4 | 4 | #include "sound/sn76496.h" |
| 5 | 5 | |
| 6 | 6 | #include "imagedev/chd_cd.h" |
| 7 | | #include "imagedev/cartslot.h" |
| 8 | 7 | |
| 8 | #include "bus/generic/slot.h" |
| 9 | #include "bus/generic/carts.h" |
| 10 | |
| 9 | 11 | #include "formats/imageutl.h" |
| 10 | 12 | |
| 11 | 13 | |
| r32640 | r32641 | |
| 465 | 467 | |
| 466 | 468 | /****************************************** 32X emulation ****************************************/ |
| 467 | 469 | |
| 468 | | // FIXME: non-softlist loading should keep using ROM_CART_LOAD in the ROM definitions, |
| 469 | | // once we better integrate softlist with the old loading procedures |
| 470 | 470 | DEVICE_IMAGE_LOAD_MEMBER( md_cons_state, _32x_cart ) |
| 471 | 471 | { |
| 472 | 472 | UINT32 length; |
| r32640 | r32641 | |
| 555 | 555 | MCFG_SOUND_ROUTE(ALL_OUTPUTS, "lspeaker", (0.25)/2) |
| 556 | 556 | MCFG_SOUND_ROUTE(ALL_OUTPUTS, "rspeaker", (0.25)/2) |
| 557 | 557 | |
| 558 | | MCFG_CARTSLOT_ADD("cart") |
| 559 | | MCFG_CARTSLOT_EXTENSION_LIST("32x,bin") |
| 560 | | MCFG_CARTSLOT_MANDATORY |
| 561 | | MCFG_CARTSLOT_INTERFACE("_32x_cart") |
| 562 | | MCFG_CARTSLOT_LOAD(md_cons_state, _32x_cart) |
| 558 | MCFG_GENERIC_CARTSLOT_ADD("cartslot", generic_plain_slot, "_32x_cart") |
| 559 | MCFG_GENERIC_EXTENSIONS("32x,bin") |
| 560 | MCFG_GENERIC_MANDATORY |
| 561 | MCFG_GENERIC_LOAD(md_cons_state, _32x_cart) |
| 563 | 562 | |
| 564 | 563 | MCFG_SOFTWARE_LIST_ADD("cart_list","32x") |
| 565 | 564 | MCFG_SOFTWARE_LIST_FILTER("cart_list","NTSC-U") |
| r32640 | r32641 | |
| 597 | 596 | MCFG_SOUND_ROUTE(ALL_OUTPUTS, "lspeaker", (0.25)/2) |
| 598 | 597 | MCFG_SOUND_ROUTE(ALL_OUTPUTS, "rspeaker", (0.25)/2) |
| 599 | 598 | |
| 600 | | MCFG_CARTSLOT_ADD("cart") |
| 601 | | MCFG_CARTSLOT_EXTENSION_LIST("32x,bin") |
| 602 | | MCFG_CARTSLOT_MANDATORY |
| 603 | | MCFG_CARTSLOT_INTERFACE("_32x_cart") |
| 604 | | MCFG_CARTSLOT_LOAD(md_cons_state, _32x_cart) |
| 599 | MCFG_GENERIC_CARTSLOT_ADD("cartslot", generic_plain_slot, "_32x_cart") |
| 600 | MCFG_GENERIC_EXTENSIONS("32x,bin") |
| 601 | MCFG_GENERIC_MANDATORY |
| 602 | MCFG_GENERIC_LOAD(md_cons_state, _32x_cart) |
| 605 | 603 | |
| 606 | 604 | MCFG_SOFTWARE_LIST_ADD("cart_list","32x") |
| 607 | 605 | MCFG_SOFTWARE_LIST_FILTER("cart_list","NTSC-J") |
| r32640 | r32641 | |
| 639 | 637 | MCFG_SOUND_ROUTE(ALL_OUTPUTS, "lspeaker", (0.25)/2) |
| 640 | 638 | MCFG_SOUND_ROUTE(ALL_OUTPUTS, "rspeaker", (0.25)/2) |
| 641 | 639 | |
| 642 | | MCFG_CARTSLOT_ADD("cart") |
| 643 | | MCFG_CARTSLOT_EXTENSION_LIST("32x,bin") |
| 644 | | MCFG_CARTSLOT_MANDATORY |
| 645 | | MCFG_CARTSLOT_INTERFACE("_32x_cart") |
| 646 | | MCFG_CARTSLOT_LOAD(md_cons_state, _32x_cart) |
| 640 | MCFG_GENERIC_CARTSLOT_ADD("cartslot", generic_plain_slot, "_32x_cart") |
| 641 | MCFG_GENERIC_EXTENSIONS("32x,bin") |
| 642 | MCFG_GENERIC_MANDATORY |
| 643 | MCFG_GENERIC_LOAD(md_cons_state, _32x_cart) |
| 647 | 644 | |
| 648 | 645 | MCFG_SOFTWARE_LIST_ADD("cart_list","32x") |
| 649 | 646 | MCFG_SOFTWARE_LIST_FILTER("cart_list","PAL") |
| r32640 | r32641 | |
| 748 | 745 | |
| 749 | 746 | MCFG_MACHINE_START_OVERRIDE(md_cons_state, ms_megacd) |
| 750 | 747 | |
| 751 | | MCFG_DEVICE_MODIFY("cart") |
| 752 | | MCFG_CARTSLOT_NOT_MANDATORY |
| 748 | MCFG_DEVICE_REMOVE("cartslot") |
| 749 | MCFG_GENERIC_CARTSLOT_ADD("cartslot", generic_plain_slot, "_32x_cart") |
| 750 | MCFG_GENERIC_EXTENSIONS("32x,bin") |
| 751 | MCFG_GENERIC_LOAD(md_cons_state, _32x_cart) |
| 753 | 752 | |
| 754 | 753 | //MCFG_QUANTUM_PERFECT_CPU("32x_master_sh2") |
| 755 | 754 | MACHINE_CONFIG_END |
trunk/src/mess/drivers/microvsn.c
| r32640 | r32641 | |
| 17 | 17 | #include "cpu/mcs48/mcs48.h" |
| 18 | 18 | #include "cpu/tms0980/tms0980.h" |
| 19 | 19 | #include "sound/dac.h" |
| 20 | | #include "imagedev/cartslot.h" |
| 21 | 20 | #include "rendlay.h" |
| 22 | 21 | |
| 22 | #include "bus/generic/slot.h" |
| 23 | #include "bus/generic/carts.h" |
| 23 | 24 | |
| 25 | |
| 24 | 26 | #define LOG 0 |
| 25 | 27 | |
| 26 | 28 | |
| r32640 | r32641 | |
| 31 | 33 | : driver_device(mconfig, type, tag), |
| 32 | 34 | m_dac( *this, "dac" ), |
| 33 | 35 | m_i8021( *this, "maincpu1" ), |
| 34 | | m_tms1100( *this, "maincpu2" ) { } |
| 36 | m_tms1100( *this, "maincpu2" ), |
| 37 | m_cart(*this, "cartslot") |
| 38 | { } |
| 35 | 39 | |
| 36 | 40 | UINT32 screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); |
| 37 | 41 | |
| r32640 | r32641 | |
| 40 | 44 | DECLARE_MACHINE_RESET(microvision); |
| 41 | 45 | |
| 42 | 46 | void screen_vblank(screen_device &screen, bool state); |
| 43 | | DECLARE_DEVICE_IMAGE_LOAD_MEMBER( microvision_cart ); |
| 47 | DECLARE_DEVICE_IMAGE_LOAD_MEMBER( microvsn_cart ); |
| 44 | 48 | |
| 45 | 49 | // i8021 interface |
| 46 | 50 | DECLARE_WRITE8_MEMBER(i8021_p0_write); |
| r32640 | r32641 | |
| 86 | 90 | required_device<dac_device> m_dac; |
| 87 | 91 | required_device<cpu_device> m_i8021; |
| 88 | 92 | required_device<cpu_device> m_tms1100; |
| 93 | required_device<generic_slot_device> m_cart; |
| 89 | 94 | |
| 90 | 95 | // Timers |
| 91 | 96 | static const device_timer_id TIMER_PADDLE = 0; |
| r32640 | r32641 | |
| 507 | 512 | }; |
| 508 | 513 | |
| 509 | 514 | |
| 510 | | DEVICE_IMAGE_LOAD_MEMBER(microvision_state,microvision_cart) |
| 515 | DEVICE_IMAGE_LOAD_MEMBER(microvision_state, microvsn_cart) |
| 511 | 516 | { |
| 512 | 517 | UINT8 *rom1 = memregion("maincpu1")->base(); |
| 513 | 518 | UINT8 *rom2 = memregion("maincpu2")->base(); |
| 514 | | UINT32 file_size; |
| 519 | UINT32 file_size = m_cart->common_get_size("rom"); |
| 515 | 520 | m_pla = 0; |
| 516 | 521 | |
| 517 | | if (image.software_entry() == NULL) |
| 518 | | { |
| 519 | | file_size = image.length(); |
| 520 | | } |
| 521 | | else |
| 522 | | { |
| 523 | | file_size = image.get_software_region_length("rom"); |
| 524 | | } |
| 525 | | |
| 526 | 522 | if ( file_size != 1024 && file_size != 2048 ) |
| 527 | 523 | { |
| 528 | 524 | image.seterror(IMAGE_ERROR_UNSPECIFIED, "Invalid rom file size"); |
| r32640 | r32641 | |
| 532 | 528 | /* Read cartridge */ |
| 533 | 529 | if (image.software_entry() == NULL) |
| 534 | 530 | { |
| 535 | | if (image.fread( rom1, file_size) != file_size) |
| 531 | if (image.fread(rom1, file_size) != file_size) |
| 536 | 532 | { |
| 537 | 533 | image.seterror(IMAGE_ERROR_UNSPECIFIED, "Unable to fully read from file"); |
| 538 | 534 | return IMAGE_INIT_FAIL; |
| r32640 | r32641 | |
| 546 | 542 | // Get PLA type |
| 547 | 543 | const char *pla = image.get_feature("pla"); |
| 548 | 544 | |
| 549 | | if ( pla ) |
| 550 | | { |
| 545 | if (pla) |
| 551 | 546 | m_pla = 1; |
| 552 | | } |
| 553 | 547 | |
| 554 | | tms1xxx_cpu_device::set_output_pla( m_tms1100, m_pla ? microvision_output_pla_1 : microvision_output_pla_0 ); |
| 548 | tms1xxx_cpu_device::set_output_pla(m_tms1100, m_pla ? microvision_output_pla_1 : microvision_output_pla_0); |
| 555 | 549 | |
| 556 | 550 | // Set default setting for PCB type and RC type |
| 557 | 551 | m_pcb_type = microvision_state::PCB_TYPE_UNKNOWN; |
| r32640 | r32641 | |
| 560 | 554 | // Detect settings for PCB type |
| 561 | 555 | const char *pcb = image.get_feature("pcb"); |
| 562 | 556 | |
| 563 | | if ( pcb != NULL ) |
| 557 | if (pcb) |
| 564 | 558 | { |
| 565 | 559 | static const struct { const char *pcb_name; microvision_state::pcb_type pcbtype; } pcb_types[] = |
| 566 | 560 | { |
| r32640 | r32641 | |
| 570 | 564 | { "7924952D02", microvision_state::PCB_TYPE_7924952D02 } |
| 571 | 565 | }; |
| 572 | 566 | |
| 573 | | for (int i = 0; i < ARRAY_LENGTH(pcb_types) && m_pcb_type == microvision_state::PCB_TYPE_UNKNOWN; i++ ) |
| 567 | for (int i = 0; i < ARRAY_LENGTH(pcb_types) && m_pcb_type == microvision_state::PCB_TYPE_UNKNOWN; i++) |
| 574 | 568 | { |
| 575 | 569 | if (!core_stricmp(pcb, pcb_types[i].pcb_name)) |
| 576 | 570 | { |
| r32640 | r32641 | |
| 582 | 576 | // Detect settings for RC types |
| 583 | 577 | const char *rc = image.get_feature("rc"); |
| 584 | 578 | |
| 585 | | if ( rc != NULL ) |
| 579 | if (rc) |
| 586 | 580 | { |
| 587 | 581 | static const struct { const char *rc_name; microvision_state::rc_type rctype; } rc_types[] = |
| 588 | 582 | { |
| r32640 | r32641 | |
| 591 | 585 | { "100pf/39.4K", microvision_state::RC_TYPE_100PF_39_4K } |
| 592 | 586 | }; |
| 593 | 587 | |
| 594 | | for ( int i = 0; i < ARRAY_LENGTH(rc_types) && m_rc_type == microvision_state::RC_TYPE_UNKNOWN; i++ ) |
| 588 | for (int i = 0; i < ARRAY_LENGTH(rc_types) && m_rc_type == microvision_state::RC_TYPE_UNKNOWN; i++) |
| 595 | 589 | { |
| 596 | 590 | if (!core_stricmp(rc, rc_types[i].rc_name)) |
| 597 | 591 | { |
| r32640 | r32641 | |
| 602 | 596 | } |
| 603 | 597 | |
| 604 | 598 | // Mirror rom data to maincpu2 region |
| 605 | | memcpy( rom2, rom1, file_size ); |
| 599 | memcpy(rom2, rom1, file_size); |
| 606 | 600 | |
| 607 | 601 | // Based on file size select cpu: |
| 608 | 602 | // - 1024 -> I8021 |
| 609 | 603 | // - 2048 -> TI TMS1100 |
| 610 | 604 | |
| 611 | | switch ( file_size ) |
| 605 | switch (file_size) |
| 612 | 606 | { |
| 613 | 607 | case 1024: |
| 614 | 608 | m_cpu_type = microvision_state::CPU_TYPE_I8021; |
| r32640 | r32641 | |
| 689 | 683 | MCFG_SOUND_ADD("dac", DAC, 0) |
| 690 | 684 | MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.0) |
| 691 | 685 | |
| 692 | | MCFG_CARTSLOT_ADD("cart") |
| 693 | | MCFG_CARTSLOT_EXTENSION_LIST("bin") |
| 694 | | MCFG_CARTSLOT_MANDATORY |
| 695 | | MCFG_CARTSLOT_INTERFACE("microvision_cart") |
| 696 | | MCFG_CARTSLOT_LOAD(microvision_state,microvision_cart) |
| 686 | MCFG_GENERIC_CARTSLOT_ADD("cartslot", generic_plain_slot, "microvision_cart") |
| 687 | MCFG_GENERIC_MANDATORY |
| 688 | MCFG_GENERIC_LOAD(microvision_state, microvsn_cart) |
| 697 | 689 | |
| 698 | 690 | /* Software lists */ |
| 699 | 691 | MCFG_SOFTWARE_LIST_ADD("cart_list","microvision") |
trunk/src/mess/drivers/thomson.c
| r32640 | r32641 | |
| 715 | 715 | |
| 716 | 716 | |
| 717 | 717 | /* cartridge */ |
| 718 | | MCFG_CARTSLOT_ADD("cart") |
| 719 | | MCFG_CARTSLOT_EXTENSION_LIST("m7,rom") |
| 720 | | MCFG_CARTSLOT_NOT_MANDATORY |
| 721 | | MCFG_CARTSLOT_LOAD(thomson_state,to7_cartridge) |
| 722 | | MCFG_CARTSLOT_INTERFACE("to7_cart") |
| 718 | MCFG_GENERIC_CARTSLOT_ADD("cartslot", generic_plain_slot, "to7_cart") |
| 719 | MCFG_GENERIC_EXTENSIONS("m7,rom") |
| 720 | MCFG_GENERIC_LOAD(thomson_state, to7_cartridge) |
| 721 | |
| 723 | 722 | MCFG_SOFTWARE_LIST_ADD("cart_list","to7_cart") |
| 724 | 723 | |
| 725 | 724 | /* internal ram */ |
| r32640 | r32641 | |
| 906 | 905 | MCFG_DEVICE_MODIFY("mc6846") |
| 907 | 906 | MCFG_MC6846_OUT_PORT_CB(WRITE8(thomson_state, to770_timer_port_out)) |
| 908 | 907 | |
| 909 | | MCFG_CARTSLOT_MODIFY("cart") |
| 910 | | MCFG_CARTSLOT_INTERFACE("to770_cart") |
| 908 | MCFG_DEVICE_REMOVE("cartslot") |
| 909 | MCFG_GENERIC_CARTSLOT_ADD("cartslot", generic_plain_slot, "to770_cart") |
| 910 | MCFG_GENERIC_EXTENSIONS("m7,rom") |
| 911 | MCFG_GENERIC_LOAD(thomson_state, to7_cartridge) |
| 912 | |
| 911 | 913 | MCFG_DEVICE_REMOVE("cart_list") |
| 912 | 914 | MCFG_SOFTWARE_LIST_ADD("cart_list","to770_cart") |
| 913 | 915 | |
| r32640 | r32641 | |
| 1103 | 1105 | MCFG_PIA_CB2_HANDLER(NULL) |
| 1104 | 1106 | MCFG_PIA_IRQB_HANDLER(WRITELINE(thomson_state, thom_irq_1)) /* WARNING: differs from TO7 ! */ |
| 1105 | 1107 | |
| 1106 | | MCFG_CARTSLOT_MODIFY("cart") |
| 1107 | | MCFG_CARTSLOT_EXTENSION_LIST("m5,rom") |
| 1108 | | MCFG_CARTSLOT_LOAD(thomson_state,mo5_cartridge) |
| 1109 | | MCFG_CARTSLOT_INTERFACE("mo5_cart") |
| 1108 | MCFG_DEVICE_REMOVE("cartslot") |
| 1109 | MCFG_GENERIC_CARTSLOT_ADD("cartslot", generic_plain_slot, "mo5_cart") |
| 1110 | MCFG_GENERIC_EXTENSIONS("m5,rom") |
| 1111 | MCFG_GENERIC_LOAD(thomson_state, mo5_cartridge) |
| 1110 | 1112 | |
| 1111 | 1113 | MCFG_DEVICE_REMOVE("cart_list") |
| 1112 | 1114 | MCFG_SOFTWARE_LIST_ADD("cart_list","mo5_cart") |
| r32640 | r32641 | |
| 2179 | 2181 | |
| 2180 | 2182 | MCFG_CENTRONICS_OUTPUT_LATCH_ADD("cent_data_out", "centronics") |
| 2181 | 2183 | |
| 2182 | | MCFG_CARTSLOT_MODIFY("cart") |
| 2183 | | MCFG_CARTSLOT_EXTENSION_LIST("m5,rom") |
| 2184 | | MCFG_CARTSLOT_LOAD(thomson_state, mo5_cartridge) |
| 2184 | MCFG_DEVICE_REMOVE("cartslot") |
| 2185 | MCFG_GENERIC_CARTSLOT_ADD("cartslot", generic_plain_slot, "mo5_cart") |
| 2186 | MCFG_GENERIC_EXTENSIONS("m5,rom") |
| 2187 | MCFG_GENERIC_LOAD(thomson_state, mo5_cartridge) |
| 2185 | 2188 | |
| 2186 | 2189 | /* internal ram */ |
| 2187 | 2190 | MCFG_RAM_MODIFY(RAM_TAG) |
| r32640 | r32641 | |
| 2420 | 2423 | MCFG_DEVICE_ADD("cent_data_in", INPUT_BUFFER, 0) |
| 2421 | 2424 | MCFG_CENTRONICS_OUTPUT_LATCH_ADD("cent_data_out", "centronics") |
| 2422 | 2425 | |
| 2423 | | MCFG_CARTSLOT_MODIFY("cart") |
| 2424 | | MCFG_CARTSLOT_EXTENSION_LIST("m5,rom") |
| 2425 | | MCFG_CARTSLOT_LOAD(thomson_state, mo5_cartridge) |
| 2426 | MCFG_DEVICE_REMOVE("cartslot") |
| 2427 | MCFG_GENERIC_CARTSLOT_ADD("cartslot", generic_plain_slot, "mo5_cart") |
| 2428 | MCFG_GENERIC_EXTENSIONS("m5,rom") |
| 2429 | MCFG_GENERIC_LOAD(thomson_state, mo5_cartridge) |
| 2426 | 2430 | |
| 2427 | 2431 | /* internal ram */ |
| 2428 | 2432 | MCFG_RAM_MODIFY(RAM_TAG) |
trunk/src/mess/drivers/ngp.c
| r32640 | r32641 | |
| 98 | 98 | #include "emu.h" |
| 99 | 99 | #include "cpu/tlcs900/tlcs900.h" |
| 100 | 100 | #include "cpu/z80/z80.h" |
| 101 | | #include "imagedev/cartslot.h" |
| 102 | 101 | #include "sound/t6w28.h" |
| 103 | 102 | #include "sound/dac.h" |
| 104 | 103 | #include "video/k1ge.h" |
| 105 | 104 | #include "rendlay.h" |
| 106 | 105 | |
| 106 | #include "bus/generic/slot.h" |
| 107 | #include "bus/generic/carts.h" |
| 108 | |
| 107 | 109 | enum flash_state |
| 108 | 110 | { |
| 109 | 111 | F_READ, /* xxxx F0 or 5555 AA 2AAA 55 5555 F0 */ |
| r32640 | r32641 | |
| 124 | 126 | ngp_state(const machine_config &mconfig, device_type type, const char *tag) |
| 125 | 127 | : driver_device(mconfig, type, tag), |
| 126 | 128 | device_nvram_interface(mconfig, *this), |
| 127 | | m_tlcs900( *this, "maincpu" ), |
| 128 | | m_z80( *this, "soundcpu" ), |
| 129 | | m_t6w28( *this, "t6w28" ), |
| 130 | | m_dac_l( *this, "dac_l" ), |
| 131 | | m_dac_r( *this, "dac_r" ), |
| 132 | | m_mainram( *this, "mainram" ), |
| 133 | | m_k1ge( *this, "k1ge" ), |
| 134 | | m_io_controls( *this, "Controls" ), |
| 135 | | m_io_power( *this, "Power" ) , |
| 136 | | m_maincpu(*this, "maincpu") { |
| 129 | m_tlcs900(*this, "maincpu"), |
| 130 | m_z80(*this, "soundcpu"), |
| 131 | m_t6w28(*this, "t6w28"), |
| 132 | m_dac_l(*this, "dac_l"), |
| 133 | m_dac_r(*this, "dac_r"), |
| 134 | m_cart(*this, "cartslot"), |
| 135 | m_mainram(*this, "mainram"), |
| 136 | m_k1ge(*this, "k1ge"), |
| 137 | m_io_controls(*this, "Controls"), |
| 138 | m_io_power(*this, "Power") , |
| 139 | m_maincpu(*this, "maincpu") |
| 140 | { |
| 137 | 141 | m_flash_chip[0].present = 0; |
| 138 | 142 | m_flash_chip[0].state = F_READ; |
| 139 | 143 | m_flash_chip[0].data = NULL; |
| r32640 | r32641 | |
| 167 | 171 | required_device<t6w28_device> m_t6w28; |
| 168 | 172 | required_device<dac_device> m_dac_l; |
| 169 | 173 | required_device<dac_device> m_dac_r; |
| 174 | required_device<generic_slot_device> m_cart; |
| 170 | 175 | required_shared_ptr<UINT8> m_mainram; |
| 171 | 176 | required_device<k1ge_device> m_k1ge; |
| 172 | 177 | |
| r32640 | r32641 | |
| 542 | 547 | AM_RANGE( 0x004000, 0x006fff ) AM_RAM AM_SHARE("mainram") /* work ram */ |
| 543 | 548 | AM_RANGE( 0x007000, 0x007fff ) AM_RAM AM_SHARE("share1") /* shared with sound cpu */ |
| 544 | 549 | AM_RANGE( 0x008000, 0x00bfff ) AM_DEVREADWRITE("k1ge", k1ge_device, read, write) /* video chip */ |
| 545 | | AM_RANGE( 0x200000, 0x3fffff ) AM_ROM AM_WRITE(flash0_w) AM_REGION("cart", 0) /* cart area #1 */ |
| 546 | | AM_RANGE( 0x800000, 0x9fffff ) AM_ROM AM_WRITE(flash1_w) AM_REGION("cart", 0x200000) /* cart area #2 */ |
| 550 | AM_RANGE( 0x200000, 0x3fffff ) AM_WRITE(flash0_w) /* cart area #1 */ |
| 551 | AM_RANGE( 0x800000, 0x9fffff ) AM_WRITE(flash1_w) /* cart area #2 */ |
| 547 | 552 | AM_RANGE( 0xff0000, 0xffffff ) AM_ROM AM_REGION("maincpu", 0) /* system rom */ |
| 548 | 553 | ADDRESS_MAP_END |
| 549 | 554 | |
| r32640 | r32641 | |
| 637 | 642 | |
| 638 | 643 | void ngp_state::machine_start() |
| 639 | 644 | { |
| 640 | | UINT8 *cart = memregion("cart")->base(); |
| 645 | if (m_cart->exists()) |
| 646 | { |
| 647 | astring region_tag; |
| 648 | UINT8 *cart = memregion(region_tag.cpy(m_cart->tag()).cat(GENERIC_ROM_REGION_TAG))->base(); |
| 641 | 649 | |
| 642 | | m_flash_chip[0].data = cart; |
| 643 | | m_flash_chip[0].org_data[0] = m_flash_chip[0].data[0]; |
| 644 | | m_flash_chip[0].org_data[1] = m_flash_chip[0].data[1]; |
| 645 | | m_flash_chip[0].org_data[2] = m_flash_chip[0].data[2]; |
| 646 | | m_flash_chip[0].org_data[3] = m_flash_chip[0].data[3]; |
| 647 | | m_flash_chip[0].org_data[4] = m_flash_chip[0].data[0x7c000]; |
| 648 | | m_flash_chip[0].org_data[5] = m_flash_chip[0].data[0x7c001]; |
| 649 | | m_flash_chip[0].org_data[6] = m_flash_chip[0].data[0x7c002]; |
| 650 | | m_flash_chip[0].org_data[7] = m_flash_chip[0].data[0x7c003]; |
| 651 | | m_flash_chip[0].org_data[8] = m_flash_chip[0].data[0xfc000]; |
| 652 | | m_flash_chip[0].org_data[9] = m_flash_chip[0].data[0xfc001]; |
| 653 | | m_flash_chip[0].org_data[10] = m_flash_chip[0].data[0xfc002]; |
| 654 | | m_flash_chip[0].org_data[11] = m_flash_chip[0].data[0xfc003]; |
| 655 | | m_flash_chip[0].org_data[12] = m_flash_chip[0].data[0x1fc000]; |
| 656 | | m_flash_chip[0].org_data[13] = m_flash_chip[0].data[0x1fc001]; |
| 657 | | m_flash_chip[0].org_data[14] = m_flash_chip[0].data[0x1fc002]; |
| 658 | | m_flash_chip[0].org_data[15] = m_flash_chip[0].data[0x1fc003]; |
| 650 | m_maincpu->space(AS_PROGRAM).install_read_bank(0x200000, 0x3fffff, "flash0"); |
| 651 | m_maincpu->space(AS_PROGRAM).install_read_bank(0x800000, 0x9fffff, "flash1"); |
| 652 | membank("flash0")->set_base(cart); |
| 653 | membank("flash1")->set_base(cart + 0x200000); |
| 654 | |
| 655 | m_flash_chip[0].data = cart; |
| 656 | m_flash_chip[0].org_data[0] = m_flash_chip[0].data[0]; |
| 657 | m_flash_chip[0].org_data[1] = m_flash_chip[0].data[1]; |
| 658 | m_flash_chip[0].org_data[2] = m_flash_chip[0].data[2]; |
| 659 | m_flash_chip[0].org_data[3] = m_flash_chip[0].data[3]; |
| 660 | m_flash_chip[0].org_data[4] = m_flash_chip[0].data[0x7c000]; |
| 661 | m_flash_chip[0].org_data[5] = m_flash_chip[0].data[0x7c001]; |
| 662 | m_flash_chip[0].org_data[6] = m_flash_chip[0].data[0x7c002]; |
| 663 | m_flash_chip[0].org_data[7] = m_flash_chip[0].data[0x7c003]; |
| 664 | m_flash_chip[0].org_data[8] = m_flash_chip[0].data[0xfc000]; |
| 665 | m_flash_chip[0].org_data[9] = m_flash_chip[0].data[0xfc001]; |
| 666 | m_flash_chip[0].org_data[10] = m_flash_chip[0].data[0xfc002]; |
| 667 | m_flash_chip[0].org_data[11] = m_flash_chip[0].data[0xfc003]; |
| 668 | m_flash_chip[0].org_data[12] = m_flash_chip[0].data[0x1fc000]; |
| 669 | m_flash_chip[0].org_data[13] = m_flash_chip[0].data[0x1fc001]; |
| 670 | m_flash_chip[0].org_data[14] = m_flash_chip[0].data[0x1fc002]; |
| 671 | m_flash_chip[0].org_data[15] = m_flash_chip[0].data[0x1fc003]; |
| 672 | |
| 673 | m_flash_chip[1].data = cart + 0x200000; |
| 674 | m_flash_chip[1].org_data[0] = m_flash_chip[1].data[0]; |
| 675 | m_flash_chip[1].org_data[1] = m_flash_chip[1].data[1]; |
| 676 | m_flash_chip[1].org_data[2] = m_flash_chip[1].data[2]; |
| 677 | m_flash_chip[1].org_data[3] = m_flash_chip[1].data[3]; |
| 678 | m_flash_chip[1].org_data[4] = m_flash_chip[1].data[0x7c000]; |
| 679 | m_flash_chip[1].org_data[5] = m_flash_chip[1].data[0x7c001]; |
| 680 | m_flash_chip[1].org_data[6] = m_flash_chip[1].data[0x7c002]; |
| 681 | m_flash_chip[1].org_data[7] = m_flash_chip[1].data[0x7c003]; |
| 682 | m_flash_chip[1].org_data[8] = m_flash_chip[1].data[0xfc000]; |
| 683 | m_flash_chip[1].org_data[9] = m_flash_chip[1].data[0xfc001]; |
| 684 | m_flash_chip[1].org_data[10] = m_flash_chip[1].data[0xfc002]; |
| 685 | m_flash_chip[1].org_data[11] = m_flash_chip[1].data[0xfc003]; |
| 686 | m_flash_chip[1].org_data[12] = m_flash_chip[1].data[0x1fc000]; |
| 687 | m_flash_chip[1].org_data[13] = m_flash_chip[1].data[0x1fc001]; |
| 688 | m_flash_chip[1].org_data[14] = m_flash_chip[1].data[0x1fc002]; |
| 689 | m_flash_chip[1].org_data[15] = m_flash_chip[1].data[0x1fc003]; |
| 690 | } |
| 691 | else |
| 692 | { |
| 693 | m_maincpu->space(AS_PROGRAM).unmap_read(0x200000, 0x3fffff); |
| 694 | m_maincpu->space(AS_PROGRAM).unmap_read(0x800000, 0x9fffff); |
| 695 | } |
| 659 | 696 | |
| 660 | | m_flash_chip[1].data = cart + 0x200000; |
| 661 | | m_flash_chip[1].org_data[0] = m_flash_chip[1].data[0]; |
| 662 | | m_flash_chip[1].org_data[1] = m_flash_chip[1].data[1]; |
| 663 | | m_flash_chip[1].org_data[2] = m_flash_chip[1].data[2]; |
| 664 | | m_flash_chip[1].org_data[3] = m_flash_chip[1].data[3]; |
| 665 | | m_flash_chip[1].org_data[4] = m_flash_chip[1].data[0x7c000]; |
| 666 | | m_flash_chip[1].org_data[5] = m_flash_chip[1].data[0x7c001]; |
| 667 | | m_flash_chip[1].org_data[6] = m_flash_chip[1].data[0x7c002]; |
| 668 | | m_flash_chip[1].org_data[7] = m_flash_chip[1].data[0x7c003]; |
| 669 | | m_flash_chip[1].org_data[8] = m_flash_chip[1].data[0xfc000]; |
| 670 | | m_flash_chip[1].org_data[9] = m_flash_chip[1].data[0xfc001]; |
| 671 | | m_flash_chip[1].org_data[10] = m_flash_chip[1].data[0xfc002]; |
| 672 | | m_flash_chip[1].org_data[11] = m_flash_chip[1].data[0xfc003]; |
| 673 | | m_flash_chip[1].org_data[12] = m_flash_chip[1].data[0x1fc000]; |
| 674 | | m_flash_chip[1].org_data[13] = m_flash_chip[1].data[0x1fc001]; |
| 675 | | m_flash_chip[1].org_data[14] = m_flash_chip[1].data[0x1fc002]; |
| 676 | | m_flash_chip[1].org_data[15] = m_flash_chip[1].data[0x1fc003]; |
| 677 | | |
| 678 | 697 | m_seconds_timer = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(ngp_state::ngp_seconds_callback),this)); |
| 679 | 698 | m_seconds_timer->adjust( attotime::from_seconds(1), 0, attotime::from_seconds(1) ); |
| 680 | 699 | |
| r32640 | r32641 | |
| 719 | 738 | |
| 720 | 739 | DEVICE_IMAGE_LOAD_MEMBER( ngp_state, ngp_cart ) |
| 721 | 740 | { |
| 722 | | UINT8 *cart = memregion("cart")->base(); |
| 723 | | UINT32 filesize; |
| 724 | | |
| 725 | | if (image.software_entry() == NULL) |
| 741 | UINT32 size = m_cart->common_get_size("rom"); |
| 742 | |
| 743 | if (size != 0x8000 && size != 0x80000 && size != 0x100000 && size != 0x200000 && size != 0x400000) |
| 726 | 744 | { |
| 727 | | filesize = image.length(); |
| 728 | | |
| 729 | | if (filesize != 0x8000 && filesize != 0x80000 && filesize != 0x100000 && filesize != 0x200000 && filesize != 0x400000) |
| 730 | | { |
| 731 | | image.seterror(IMAGE_ERROR_UNSPECIFIED, "Incorrect or not support cartridge size"); |
| 732 | | return IMAGE_INIT_FAIL; |
| 733 | | } |
| 734 | | |
| 735 | | if (image.fread( cart, filesize) != filesize) |
| 736 | | { |
| 737 | | image.seterror(IMAGE_ERROR_UNSPECIFIED, "Error loading file"); |
| 738 | | return IMAGE_INIT_FAIL; |
| 739 | | } |
| 745 | image.seterror(IMAGE_ERROR_UNSPECIFIED, "Unsupported cartridge size"); |
| 746 | return IMAGE_INIT_FAIL; |
| 740 | 747 | } |
| 741 | | else |
| 742 | | { |
| 743 | | filesize = image.get_software_region_length("rom"); |
| 744 | | memcpy(cart, image.get_software_region("rom"), filesize); |
| 745 | | } |
| 746 | | |
| 748 | |
| 749 | // alloc 0x400000 ROM to simplify mapping in the address map |
| 750 | m_cart->rom_alloc(0x400000, GENERIC_ROM8_WIDTH, ENDIANNESS_LITTLE); |
| 751 | m_cart->common_load_rom(m_cart->get_rom_base(), size, "rom"); |
| 752 | |
| 747 | 753 | //printf("%2x%2x - %x - %x\n", (unsigned int) memregion("cart")->u8(0x20), (unsigned int) memregion("cart")->u8(0x21), |
| 748 | 754 | // (unsigned int) memregion("cart")->u8(0x22), (unsigned int) memregion("cart")->u8(0x23)); |
| 749 | 755 | m_flash_chip[0].manufacturer_id = 0x98; |
| 750 | | switch( filesize ) |
| 756 | m_flash_chip[0].present = 1; |
| 757 | m_flash_chip[0].state = F_READ; |
| 758 | |
| 759 | switch (size) |
| 751 | 760 | { |
| 752 | 761 | case 0x8000: |
| 753 | 762 | case 0x80000: |
| r32640 | r32641 | |
| 757 | 766 | m_flash_chip[0].device_id = 0x2c; |
| 758 | 767 | break; |
| 759 | 768 | case 0x200000: |
| 769 | case 0x400000: |
| 760 | 770 | m_flash_chip[0].device_id = 0x2f; |
| 761 | 771 | break; |
| 762 | | case 0x400000: |
| 763 | | m_flash_chip[0].device_id = 0x2f; |
| 772 | } |
| 773 | |
| 774 | if (size == 0x400000) |
| 775 | { |
| 764 | 776 | m_flash_chip[1].manufacturer_id = 0x98; |
| 765 | 777 | m_flash_chip[1].device_id = 0x2f; |
| 766 | | m_flash_chip[1].present = 0; |
| 778 | m_flash_chip[1].present = 1; |
| 767 | 779 | m_flash_chip[1].state = F_READ; |
| 768 | | break; |
| 769 | 780 | } |
| 770 | 781 | |
| 771 | | m_flash_chip[0].present = 1; |
| 772 | | m_flash_chip[0].state = F_READ; |
| 773 | | |
| 774 | 782 | return IMAGE_INIT_PASS; |
| 775 | 783 | } |
| 776 | 784 | |
| r32640 | r32641 | |
| 841 | 849 | MCFG_SCREEN_MODIFY("screen") |
| 842 | 850 | MCFG_SCREEN_PALETTE("k1ge:palette") |
| 843 | 851 | |
| 844 | | MCFG_CARTSLOT_ADD("cart") |
| 845 | | MCFG_CARTSLOT_EXTENSION_LIST("bin,ngp,npc,ngc") |
| 846 | | MCFG_CARTSLOT_NOT_MANDATORY |
| 847 | | MCFG_CARTSLOT_LOAD(ngp_state, ngp_cart) |
| 848 | | MCFG_CARTSLOT_INTERFACE("ngp_cart") |
| 849 | | MCFG_CARTSLOT_UNLOAD(ngp_state, ngp_cart) |
| 852 | MCFG_GENERIC_CARTSLOT_ADD("cartslot", generic_plain_slot, "ngp_cart") |
| 853 | MCFG_GENERIC_EXTENSIONS("bin,ngp,npc,ngc") |
| 854 | MCFG_GENERIC_LOAD(ngp_state, ngp_cart) |
| 855 | MCFG_GENERIC_UNLOAD(ngp_state, ngp_cart) |
| 850 | 856 | |
| 851 | 857 | /* software lists */ |
| 852 | 858 | MCFG_SOFTWARE_LIST_ADD("cart_list","ngp") |
| r32640 | r32641 | |
| 860 | 866 | MCFG_SCREEN_MODIFY("screen") |
| 861 | 867 | MCFG_SCREEN_PALETTE("k1ge:palette") |
| 862 | 868 | |
| 863 | | MCFG_CARTSLOT_ADD("cart") |
| 864 | | MCFG_CARTSLOT_EXTENSION_LIST("bin,ngp,npc,ngc") |
| 865 | | MCFG_CARTSLOT_NOT_MANDATORY |
| 866 | | MCFG_CARTSLOT_LOAD(ngp_state,ngp_cart) |
| 867 | | MCFG_CARTSLOT_INTERFACE("ngp_cart") |
| 868 | | MCFG_CARTSLOT_UNLOAD(ngp_state,ngp_cart) |
| 869 | MCFG_GENERIC_CARTSLOT_ADD("cartslot", generic_plain_slot, "ngp_cart") |
| 870 | MCFG_GENERIC_EXTENSIONS("bin,ngp,npc,ngc") |
| 871 | MCFG_GENERIC_LOAD(ngp_state, ngp_cart) |
| 872 | MCFG_GENERIC_UNLOAD(ngp_state, ngp_cart) |
| 869 | 873 | |
| 870 | 874 | /* software lists */ |
| 871 | 875 | MCFG_SOFTWARE_LIST_ADD("cart_list","ngpc") |
| r32640 | r32641 | |
| 876 | 880 | ROM_START( ngp ) |
| 877 | 881 | ROM_REGION( 0x10000, "maincpu" , 0 ) |
| 878 | 882 | ROM_LOAD( "ngp_bios.ngp", 0x0000, 0x10000, CRC(6232df8d) SHA1(2f6429b68446536d8b03f35d02f1e98beb6460a0) ) |
| 879 | | |
| 880 | | ROM_REGION( 0x400000, "cart", ROMREGION_ERASEFF ) |
| 881 | 883 | ROM_END |
| 882 | 884 | |
| 883 | 885 | |
| 884 | 886 | ROM_START( ngpc ) |
| 885 | 887 | ROM_REGION( 0x10000, "maincpu", 0 ) |
| 886 | 888 | ROM_LOAD( "ngpcbios.rom", 0x0000, 0x10000, CRC(6eeb6f40) SHA1(edc13192054a59be49c6d55f83b70e2510968e86) ) |
| 887 | | |
| 888 | | ROM_REGION( 0x400000, "cart", ROMREGION_ERASEFF ) |
| 889 | 889 | ROM_END |
| 890 | 890 | |
| 891 | 891 | |