trunk/src/mess/drivers/ngp.c
| r20778 | r20779 | |
| 128 | 128 | , m_t6w28( *this, "t6w28" ) |
| 129 | 129 | , m_dac_l( *this, "dac_l" ) |
| 130 | 130 | , m_dac_r( *this, "dac_r" ) |
| 131 | | { } |
| 131 | { |
| 132 | m_flash_chip[0].present = 0; |
| 133 | m_flash_chip[0].state = F_READ; |
| 134 | m_flash_chip[0].data = NULL; |
| 132 | 135 | |
| 136 | m_flash_chip[1].present = 0; |
| 137 | m_flash_chip[1].state = F_READ; |
| 138 | m_flash_chip[1].data = NULL; |
| 139 | } |
| 140 | |
| 133 | 141 | virtual void machine_start(); |
| 134 | 142 | virtual void machine_reset(); |
| 135 | 143 | |
| r20778 | r20779 | |
| 174 | 182 | DECLARE_INPUT_CHANGED_MEMBER(power_callback); |
| 175 | 183 | TIMER_CALLBACK_MEMBER(ngp_seconds_callback); |
| 176 | 184 | |
| 177 | | DECLARE_DEVICE_IMAGE_START_MEMBER( ngp_cart ); |
| 178 | 185 | DECLARE_DEVICE_IMAGE_LOAD_MEMBER( ngp_cart); |
| 179 | 186 | DECLARE_DEVICE_IMAGE_UNLOAD_MEMBER( ngp_cart ); |
| 180 | 187 | }; |
| r20778 | r20779 | |
| 612 | 619 | |
| 613 | 620 | void ngp_state::machine_start() |
| 614 | 621 | { |
| 622 | UINT8 *cart = memregion("cart")->base(); |
| 623 | |
| 624 | m_flash_chip[0].data = cart; |
| 625 | m_flash_chip[0].org_data[0] = m_flash_chip[0].data[0]; |
| 626 | m_flash_chip[0].org_data[1] = m_flash_chip[0].data[1]; |
| 627 | m_flash_chip[0].org_data[2] = m_flash_chip[0].data[2]; |
| 628 | m_flash_chip[0].org_data[3] = m_flash_chip[0].data[3]; |
| 629 | m_flash_chip[0].org_data[4] = m_flash_chip[0].data[0x7c000]; |
| 630 | m_flash_chip[0].org_data[5] = m_flash_chip[0].data[0x7c001]; |
| 631 | m_flash_chip[0].org_data[6] = m_flash_chip[0].data[0x7c002]; |
| 632 | m_flash_chip[0].org_data[7] = m_flash_chip[0].data[0x7c003]; |
| 633 | m_flash_chip[0].org_data[8] = m_flash_chip[0].data[0xfc000]; |
| 634 | m_flash_chip[0].org_data[9] = m_flash_chip[0].data[0xfc001]; |
| 635 | m_flash_chip[0].org_data[10] = m_flash_chip[0].data[0xfc002]; |
| 636 | m_flash_chip[0].org_data[11] = m_flash_chip[0].data[0xfc003]; |
| 637 | m_flash_chip[0].org_data[12] = m_flash_chip[0].data[0x1fc000]; |
| 638 | m_flash_chip[0].org_data[13] = m_flash_chip[0].data[0x1fc001]; |
| 639 | m_flash_chip[0].org_data[14] = m_flash_chip[0].data[0x1fc002]; |
| 640 | m_flash_chip[0].org_data[15] = m_flash_chip[0].data[0x1fc003]; |
| 641 | |
| 642 | m_flash_chip[1].data = cart + 0x200000; |
| 643 | m_flash_chip[1].org_data[0] = m_flash_chip[1].data[0]; |
| 644 | m_flash_chip[1].org_data[1] = m_flash_chip[1].data[1]; |
| 645 | m_flash_chip[1].org_data[2] = m_flash_chip[1].data[2]; |
| 646 | m_flash_chip[1].org_data[3] = m_flash_chip[1].data[3]; |
| 647 | m_flash_chip[1].org_data[4] = m_flash_chip[1].data[0x7c000]; |
| 648 | m_flash_chip[1].org_data[5] = m_flash_chip[1].data[0x7c001]; |
| 649 | m_flash_chip[1].org_data[6] = m_flash_chip[1].data[0x7c002]; |
| 650 | m_flash_chip[1].org_data[7] = m_flash_chip[1].data[0x7c003]; |
| 651 | m_flash_chip[1].org_data[8] = m_flash_chip[1].data[0xfc000]; |
| 652 | m_flash_chip[1].org_data[9] = m_flash_chip[1].data[0xfc001]; |
| 653 | m_flash_chip[1].org_data[10] = m_flash_chip[1].data[0xfc002]; |
| 654 | m_flash_chip[1].org_data[11] = m_flash_chip[1].data[0xfc003]; |
| 655 | m_flash_chip[1].org_data[12] = m_flash_chip[1].data[0x1fc000]; |
| 656 | m_flash_chip[1].org_data[13] = m_flash_chip[1].data[0x1fc001]; |
| 657 | m_flash_chip[1].org_data[14] = m_flash_chip[1].data[0x1fc002]; |
| 658 | m_flash_chip[1].org_data[15] = m_flash_chip[1].data[0x1fc003]; |
| 659 | |
| 615 | 660 | m_seconds_timer = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(ngp_state::ngp_seconds_callback),this)); |
| 616 | 661 | m_seconds_timer->adjust( attotime::from_seconds(1), 0, attotime::from_seconds(1) ); |
| 617 | 662 | } |
| r20778 | r20779 | |
| 634 | 679 | } |
| 635 | 680 | |
| 636 | 681 | |
| 637 | | DEVICE_IMAGE_START_MEMBER( ngp_state, ngp_cart ) |
| 638 | | { |
| 639 | | UINT8 *cart = memregion("cart")->base(); |
| 640 | | |
| 641 | | m_flash_chip[0].present = 0; |
| 642 | | m_flash_chip[0].state = F_READ; |
| 643 | | m_flash_chip[0].data = cart; |
| 644 | | |
| 645 | | m_flash_chip[1].present = 0; |
| 646 | | m_flash_chip[1].state = F_READ; |
| 647 | | m_flash_chip[1].data = cart + 0x200000; |
| 648 | | } |
| 649 | | |
| 650 | | |
| 651 | 682 | DEVICE_IMAGE_LOAD_MEMBER( ngp_state, ngp_cart ) |
| 652 | 683 | { |
| 684 | UINT8 *cart = memregion("cart")->base(); |
| 653 | 685 | UINT32 filesize; |
| 654 | 686 | |
| 655 | 687 | if (image.software_entry() == NULL) |
| r20778 | r20779 | |
| 662 | 694 | return IMAGE_INIT_FAIL; |
| 663 | 695 | } |
| 664 | 696 | |
| 665 | | if (image.fread( machine().root_device().memregion("cart")->base(), filesize) != filesize) |
| 697 | if (image.fread( cart, filesize) != filesize) |
| 666 | 698 | { |
| 667 | 699 | image.seterror(IMAGE_ERROR_UNSPECIFIED, "Error loading file"); |
| 668 | 700 | return IMAGE_INIT_FAIL; |
| r20778 | r20779 | |
| 671 | 703 | else |
| 672 | 704 | { |
| 673 | 705 | filesize = image.get_software_region_length("rom"); |
| 674 | | memcpy(machine().root_device().memregion("cart")->base(), image.get_software_region("rom"), filesize); |
| 706 | memcpy(cart, image.get_software_region("rom"), filesize); |
| 675 | 707 | } |
| 676 | 708 | |
| 677 | 709 | //printf("%2x%2x - %x - %x\n", (unsigned int) image.device().machine().root_device().memregion("cart")->u8(0x20), (unsigned int) image.device().machine().root_device().memregion("cart")->u8(0x21), |
| r20778 | r20779 | |
| 698 | 730 | break; |
| 699 | 731 | } |
| 700 | 732 | |
| 701 | | m_flash_chip[0].org_data[0] = m_flash_chip[0].data[0]; |
| 702 | | m_flash_chip[0].org_data[1] = m_flash_chip[0].data[1]; |
| 703 | | m_flash_chip[0].org_data[2] = m_flash_chip[0].data[2]; |
| 704 | | m_flash_chip[0].org_data[3] = m_flash_chip[0].data[3]; |
| 705 | | m_flash_chip[0].org_data[4] = m_flash_chip[0].data[0x7c000]; |
| 706 | | m_flash_chip[0].org_data[5] = m_flash_chip[0].data[0x7c001]; |
| 707 | | m_flash_chip[0].org_data[6] = m_flash_chip[0].data[0x7c002]; |
| 708 | | m_flash_chip[0].org_data[7] = m_flash_chip[0].data[0x7c003]; |
| 709 | | m_flash_chip[0].org_data[8] = m_flash_chip[0].data[0xfc000]; |
| 710 | | m_flash_chip[0].org_data[9] = m_flash_chip[0].data[0xfc001]; |
| 711 | | m_flash_chip[0].org_data[10] = m_flash_chip[0].data[0xfc002]; |
| 712 | | m_flash_chip[0].org_data[11] = m_flash_chip[0].data[0xfc003]; |
| 713 | | m_flash_chip[0].org_data[12] = m_flash_chip[0].data[0x1fc000]; |
| 714 | | m_flash_chip[0].org_data[13] = m_flash_chip[0].data[0x1fc001]; |
| 715 | | m_flash_chip[0].org_data[14] = m_flash_chip[0].data[0x1fc002]; |
| 716 | | m_flash_chip[0].org_data[15] = m_flash_chip[0].data[0x1fc003]; |
| 717 | | |
| 718 | | m_flash_chip[1].org_data[0] = m_flash_chip[1].data[0]; |
| 719 | | m_flash_chip[1].org_data[1] = m_flash_chip[1].data[1]; |
| 720 | | m_flash_chip[1].org_data[2] = m_flash_chip[1].data[2]; |
| 721 | | m_flash_chip[1].org_data[3] = m_flash_chip[1].data[3]; |
| 722 | | m_flash_chip[1].org_data[4] = m_flash_chip[1].data[0x7c000]; |
| 723 | | m_flash_chip[1].org_data[5] = m_flash_chip[1].data[0x7c001]; |
| 724 | | m_flash_chip[1].org_data[6] = m_flash_chip[1].data[0x7c002]; |
| 725 | | m_flash_chip[1].org_data[7] = m_flash_chip[1].data[0x7c003]; |
| 726 | | m_flash_chip[1].org_data[8] = m_flash_chip[1].data[0xfc000]; |
| 727 | | m_flash_chip[1].org_data[9] = m_flash_chip[1].data[0xfc001]; |
| 728 | | m_flash_chip[1].org_data[10] = m_flash_chip[1].data[0xfc002]; |
| 729 | | m_flash_chip[1].org_data[11] = m_flash_chip[1].data[0xfc003]; |
| 730 | | m_flash_chip[1].org_data[12] = m_flash_chip[1].data[0x1fc000]; |
| 731 | | m_flash_chip[1].org_data[13] = m_flash_chip[1].data[0x1fc001]; |
| 732 | | m_flash_chip[1].org_data[14] = m_flash_chip[1].data[0x1fc002]; |
| 733 | | m_flash_chip[1].org_data[15] = m_flash_chip[1].data[0x1fc003]; |
| 734 | | |
| 735 | 733 | m_flash_chip[0].present = 1; |
| 736 | 734 | m_flash_chip[0].state = F_READ; |
| 737 | 735 | |
| r20778 | r20779 | |
| 805 | 803 | MCFG_CARTSLOT_ADD("cart") |
| 806 | 804 | MCFG_CARTSLOT_EXTENSION_LIST("bin,ngp,npc,ngc") |
| 807 | 805 | MCFG_CARTSLOT_NOT_MANDATORY |
| 808 | | MCFG_CARTSLOT_START(ngp_state, ngp_cart) |
| 809 | 806 | MCFG_CARTSLOT_LOAD(ngp_state, ngp_cart) |
| 810 | 807 | MCFG_CARTSLOT_INTERFACE("ngp_cart") |
| 811 | 808 | MCFG_CARTSLOT_UNLOAD(ngp_state, ngp_cart) |
| r20778 | r20779 | |
| 826 | 823 | MCFG_CARTSLOT_ADD("cart") |
| 827 | 824 | MCFG_CARTSLOT_EXTENSION_LIST("bin,ngp,npc,ngc") |
| 828 | 825 | MCFG_CARTSLOT_NOT_MANDATORY |
| 829 | | MCFG_CARTSLOT_START(ngp_state,ngp_cart) |
| 830 | 826 | MCFG_CARTSLOT_LOAD(ngp_state,ngp_cart) |
| 831 | 827 | MCFG_CARTSLOT_INTERFACE("ngp_cart") |
| 832 | 828 | MCFG_CARTSLOT_UNLOAD(ngp_state,ngp_cart) |
trunk/src/mess/drivers/nc.c
| r20778 | r20779 | |
| 1609 | 1609 | MCFG_CARTSLOT_ADD("cart") |
| 1610 | 1610 | MCFG_CARTSLOT_EXTENSION_LIST("crd,card") |
| 1611 | 1611 | MCFG_CARTSLOT_NOT_MANDATORY |
| 1612 | | MCFG_CARTSLOT_START(nc_state,nc_pcmcia_card) |
| 1613 | 1612 | MCFG_CARTSLOT_LOAD(nc_state,nc_pcmcia_card) |
| 1614 | 1613 | MCFG_CARTSLOT_UNLOAD(nc_state,nc_pcmcia_card) |
| 1615 | 1614 | |
| r20778 | r20779 | |
| 1703 | 1702 | ROM_END |
| 1704 | 1703 | |
| 1705 | 1704 | /* YEAR NAME PARENT COMPAT MACHINE INPUT INIT COMPANY FULLNAME FLAGS */ |
| 1706 | | COMP( 1992, nc100, 0, 0, nc100, nc100, driver_device, 0, "Amstrad plc", "NC100", 0 ) |
| 1707 | | COMP( 1992, nc150, nc100, 0, nc100, nc100, driver_device, 0, "Amstrad plc", "NC150", 0 ) |
| 1708 | | COMP( 1993, nc200, 0, 0, nc200, nc200, driver_device, 0, "Amstrad plc", "NC200", GAME_NOT_WORKING ) // boot hangs while checking the MC146818 UIP (update in progress) bit |
| 1705 | COMP( 1992, nc100, 0, 0, nc100, nc100, nc_state, nc, "Amstrad plc", "NC100", 0 ) |
| 1706 | COMP( 1992, nc150, nc100, 0, nc100, nc100, nc_state, nc, "Amstrad plc", "NC150", 0 ) |
| 1707 | COMP( 1993, nc200, 0, 0, nc200, nc200, nc_state, nc, "Amstrad plc", "NC200", GAME_NOT_WORKING ) // boot hangs while checking the MC146818 UIP (update in progress) bit |
trunk/src/mess/drivers/sms.c
| r20778 | r20779 | |
| 402 | 402 | MCFG_CARTSLOT_EXTENSION_LIST("sms,bin") |
| 403 | 403 | MCFG_CARTSLOT_NOT_MANDATORY |
| 404 | 404 | MCFG_CARTSLOT_INTERFACE("sms_cart") |
| 405 | | MCFG_CARTSLOT_START(sms_state,sms_cart) |
| 406 | 405 | MCFG_CARTSLOT_LOAD(sms_state,sms_cart) |
| 407 | 406 | |
| 408 | 407 | MCFG_SOFTWARE_LIST_ADD("cart_list","sms") |
| r20778 | r20779 | |
| 413 | 412 | MCFG_CARTSLOT_EXTENSION_LIST("gg,bin") |
| 414 | 413 | MCFG_CARTSLOT_MANDATORY |
| 415 | 414 | MCFG_CARTSLOT_INTERFACE("gamegear_cart") |
| 416 | | MCFG_CARTSLOT_START(sms_state,sms_cart) |
| 417 | 415 | MCFG_CARTSLOT_LOAD(sms_state,sms_cart) |
| 418 | 416 | |
| 419 | 417 | MCFG_SOFTWARE_LIST_ADD("cart_list","gamegear") |
| r20778 | r20779 | |
| 495 | 493 | MCFG_CARTSLOT_EXTENSION_LIST("sms,bin") \ |
| 496 | 494 | MCFG_CARTSLOT_NOT_MANDATORY \ |
| 497 | 495 | MCFG_CARTSLOT_INTERFACE("sms_cart") \ |
| 498 | | MCFG_CARTSLOT_START(sms_state,sms_cart) \ |
| 499 | 496 | MCFG_CARTSLOT_LOAD(sms_state,sms_cart) |
| 500 | 497 | |
| 501 | 498 | static MACHINE_CONFIG_DERIVED( sms_sdisp, sms2_ntsc ) |
| r20778 | r20779 | |
| 512 | 509 | MCFG_CARTSLOT_EXTENSION_LIST("sms,bin") |
| 513 | 510 | MCFG_CARTSLOT_MANDATORY |
| 514 | 511 | MCFG_CARTSLOT_INTERFACE("sms_cart") |
| 515 | | MCFG_CARTSLOT_START(sms_state,sms_cart) |
| 516 | 512 | MCFG_CARTSLOT_LOAD(sms_state,sms_cart) |
| 517 | 513 | |
| 518 | 514 | MCFG_SMSSDISP_CARTSLOT_ADD("cart2") |
| r20778 | r20779 | |
| 617 | 613 | MCFG_CARTSLOT_MODIFY("cart1") |
| 618 | 614 | MCFG_CARTSLOT_EXTENSION_LIST("sms,bin,sg") |
| 619 | 615 | MCFG_CARTSLOT_MANDATORY |
| 620 | | MCFG_CARTSLOT_START(sms_state,sms_cart) |
| 621 | 616 | MCFG_CARTSLOT_LOAD(sms_state,sms_cart) |
| 622 | 617 | MACHINE_CONFIG_END |
| 623 | 618 | |
trunk/src/mess/drivers/gb.c
| r20778 | r20779 | |
| 590 | 590 | MCFG_CARTSLOT_EXTENSION_LIST("gb,gmb,cgb,gbc,sgb,bin") |
| 591 | 591 | MCFG_CARTSLOT_NOT_MANDATORY |
| 592 | 592 | MCFG_CARTSLOT_INTERFACE("gameboy_cart") |
| 593 | | MCFG_CARTSLOT_START(gb_state,gb_cart) |
| 594 | 593 | MCFG_CARTSLOT_LOAD(gb_state,gb_cart) |
| 595 | 594 | MCFG_SOFTWARE_LIST_ADD("cart_list","gameboy") |
| 596 | 595 | MCFG_SOFTWARE_LIST_COMPATIBLE_ADD("gbc_list","gbcolor") |
| r20778 | r20779 | |
| 648 | 647 | MCFG_CARTSLOT_EXTENSION_LIST("gb,gmb,cgb,gbc,sgb,bin") |
| 649 | 648 | MCFG_CARTSLOT_NOT_MANDATORY |
| 650 | 649 | MCFG_CARTSLOT_INTERFACE("gameboy_cart") |
| 651 | | MCFG_CARTSLOT_START(gb_state,gb_cart) |
| 652 | 650 | MCFG_CARTSLOT_LOAD(gb_state,gb_cart) |
| 653 | 651 | MCFG_SOFTWARE_LIST_ADD("cart_list","gbcolor") |
| 654 | 652 | MCFG_SOFTWARE_LIST_COMPATIBLE_ADD("gb_list","gameboy") |
| r20778 | r20779 | |
| 731 | 729 | ROM_END |
| 732 | 730 | |
| 733 | 731 | /* YEAR NAME PARENT COMPAT MACHINE INPUT INIT COMPANY FULLNAME */ |
| 734 | | CONS( 1990, gameboy, 0, 0, gameboy, gameboy, driver_device, 0, "Nintendo", "Game Boy", 0) |
| 735 | | CONS( 1994, supergb, gameboy, 0, supergb, gameboy, driver_device, 0, "Nintendo", "Super Game Boy", 0) |
| 736 | | CONS( 1996, gbpocket, gameboy, 0, gbpocket, gameboy, driver_device, 0, "Nintendo", "Game Boy Pocket", 0) |
| 737 | | CONS( 1997, gblight, gameboy, 0, gbpocket, gameboy, driver_device, 0, "Nintendo", "Game Boy Light", 0) |
| 738 | | CONS( 1998, gbcolor, gameboy, 0, gbcolor, gameboy, driver_device, 0, "Nintendo", "Game Boy Color", GAME_IMPERFECT_GRAPHICS) |
| 732 | CONS( 1990, gameboy, 0, 0, gameboy, gameboy, gb_state, gb, "Nintendo", "Game Boy", 0) |
| 733 | CONS( 1994, supergb, gameboy, 0, supergb, gameboy, gb_state, gb, "Nintendo", "Super Game Boy", 0) |
| 734 | CONS( 1996, gbpocket, gameboy, 0, gbpocket, gameboy, gb_state, gb, "Nintendo", "Game Boy Pocket", 0) |
| 735 | CONS( 1997, gblight, gameboy, 0, gbpocket, gameboy, gb_state, gb, "Nintendo", "Game Boy Light", 0) |
| 736 | CONS( 1998, gbcolor, gameboy, 0, gbcolor, gameboy, gb_state, gb, "Nintendo", "Game Boy Color", GAME_IMPERFECT_GRAPHICS) |
| 739 | 737 | |
| 740 | 738 | /* Sound is not 100% yet, it generates some sounds which could be ok. Since we're lacking a real |
| 741 | 739 | system there's no way to verify. Same goes for the colors of the LCD. We are no using the default |
| 742 | 740 | Game Boy green colors */ |
| 743 | | CONS( 1993, megaduck, 0, 0, megaduck, gameboy, driver_device, 0, "Creatronic/Videojet/Timlex/Cougar", "MegaDuck/Cougar Boy" , 0) |
| 741 | CONS( 1993, megaduck, 0, 0, megaduck, gameboy, gb_state, gb, "Creatronic/Videojet/Timlex/Cougar", "MegaDuck/Cougar Boy" , 0) |
trunk/src/mess/drivers/wswan.c
| r20778 | r20779 | |
| 155 | 155 | MCFG_CARTSLOT_EXTENSION_LIST("ws,wsc,bin") |
| 156 | 156 | MCFG_CARTSLOT_MANDATORY |
| 157 | 157 | MCFG_CARTSLOT_INTERFACE("wswan_cart") |
| 158 | | MCFG_CARTSLOT_START(wswan_state,wswan_cart) |
| 159 | 158 | MCFG_CARTSLOT_LOAD(wswan_state,wswan_cart) |
| 160 | 159 | |
| 161 | 160 | /* software lists */ |
| r20778 | r20779 | |
| 195 | 194 | ROM_END |
| 196 | 195 | |
| 197 | 196 | /* YEAR NAME PARENT COMPAT MACHINE INPUT INIT COMPANY FULLNAME*/ |
| 198 | | CONS( 1999, wswan, 0, 0, wswan, wswan, driver_device, 0, "Bandai", "WonderSwan", GAME_IMPERFECT_SOUND ) |
| 199 | | CONS( 2000, wscolor, wswan, 0, wscolor, wswan, driver_device, 0, "Bandai", "WonderSwan Color", GAME_IMPERFECT_SOUND ) |
| 197 | CONS( 1999, wswan, 0, 0, wswan, wswan, wswan_state, wswan, "Bandai", "WonderSwan", GAME_IMPERFECT_SOUND ) |
| 198 | CONS( 2000, wscolor, wswan, 0, wscolor, wswan, wswan_state, wswan, "Bandai", "WonderSwan Color", GAME_IMPERFECT_SOUND ) |
trunk/src/mess/drivers/scv.c
| r20778 | r20779 | |
| 17 | 17 | scv_state(const machine_config &mconfig, device_type type, const char *tag) |
| 18 | 18 | : driver_device(mconfig, type, tag) |
| 19 | 19 | , m_videoram(*this,"videoram") |
| 20 | , m_cart_rom_size(0) |
| 21 | , m_cart_ram(NULL) |
| 22 | , m_cart_ram_size(0) |
| 20 | 23 | , m_maincpu(*this, "maincpu") |
| 21 | 24 | , m_upd1771c(*this, "upd1771c") |
| 22 | 25 | , m_pa0(*this, "PA0") |
| r20778 | r20779 | |
| 57 | 60 | virtual void palette_init(); |
| 58 | 61 | UINT32 screen_update_scv(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); |
| 59 | 62 | TIMER_CALLBACK_MEMBER(scv_vb_callback); |
| 60 | | DECLARE_DEVICE_IMAGE_START_MEMBER( scv_cart ); |
| 61 | 63 | DECLARE_DEVICE_IMAGE_LOAD_MEMBER( scv_cart ); |
| 62 | 64 | |
| 63 | 65 | protected: |
| r20778 | r20779 | |
| 360 | 362 | } |
| 361 | 363 | |
| 362 | 364 | |
| 363 | | DEVICE_IMAGE_START_MEMBER( scv_state, scv_cart ) |
| 364 | | { |
| 365 | | m_cart_rom = memregion( "cart" )->base(); |
| 366 | | m_cart_rom_size = 0; |
| 367 | | m_cart_ram = NULL; |
| 368 | | m_cart_ram_size = 0; |
| 369 | | } |
| 370 | | |
| 371 | | |
| 372 | 365 | DEVICE_IMAGE_LOAD_MEMBER( scv_state, scv_cart ) |
| 373 | 366 | { |
| 367 | UINT8 *cart = memregion( "cart" )->base(); |
| 368 | |
| 374 | 369 | if ( image.software_entry() == NULL ) |
| 375 | 370 | { |
| 376 | | UINT8 *cart = image.device().machine().root_device().memregion( "cart" )->base(); |
| 377 | 371 | int size = image.length(); |
| 378 | 372 | |
| 379 | 373 | if ( size > memregion( "cart" )->bytes() ) |
| r20778 | r20779 | |
| 388 | 382 | return IMAGE_INIT_FAIL; |
| 389 | 383 | } |
| 390 | 384 | |
| 391 | | m_cart_rom = cart; |
| 392 | 385 | m_cart_rom_size = size; |
| 393 | | m_cart_ram = NULL; |
| 394 | | m_cart_ram_size = 0; |
| 395 | 386 | } |
| 396 | 387 | else |
| 397 | 388 | { |
| 398 | | m_cart_rom = image.get_software_region( "rom" ); |
| 399 | 389 | m_cart_rom_size = image.get_software_region_length( "rom" ); |
| 400 | | m_cart_ram = image.get_software_region( "ram" ); |
| 390 | memcpy( cart, image.get_software_region( "rom" ), m_cart_rom_size ); |
| 401 | 391 | m_cart_ram_size = image.get_software_region_length( "ram" ); |
| 392 | if ( m_cart_ram_size > 0 ) |
| 393 | { |
| 394 | m_cart_ram = auto_alloc_array_clear( machine(), UINT8, m_cart_ram_size ); |
| 395 | } |
| 402 | 396 | } |
| 403 | 397 | |
| 404 | 398 | return IMAGE_INIT_PASS; |
| r20778 | r20779 | |
| 799 | 793 | |
| 800 | 794 | void scv_state::machine_start() |
| 801 | 795 | { |
| 796 | m_cart_rom = memregion( "cart" )->base(); |
| 802 | 797 | m_vb_timer = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(scv_state::scv_vb_callback),this)); |
| 803 | 798 | } |
| 804 | 799 | |
| r20778 | r20779 | |
| 859 | 854 | MCFG_CARTSLOT_EXTENSION_LIST( "bin" ) |
| 860 | 855 | MCFG_CARTSLOT_NOT_MANDATORY |
| 861 | 856 | MCFG_CARTSLOT_INTERFACE("scv_cart") |
| 862 | | MCFG_CARTSLOT_START( scv_state, scv_cart ) |
| 863 | 857 | MCFG_CARTSLOT_LOAD( scv_state, scv_cart ) |
| 864 | 858 | |
| 865 | 859 | /* Software lists */ |
trunk/src/mess/machine/a7800.c
| r20778 | r20779 | |
| 68 | 68 | DRIVER INIT |
| 69 | 69 | ***************************************************************************/ |
| 70 | 70 | |
| 71 | | static void a7800_driver_init(running_machine &machine, int ispal, int lines) |
| 71 | void a7800_state::a7800_driver_init(int ispal, int lines) |
| 72 | 72 | { |
| 73 | | a7800_state *state = machine.driver_data<a7800_state>(); |
| 74 | | address_space& space = machine.device("maincpu")->memory().space(AS_PROGRAM); |
| 75 | | state->m_ROM = state->memregion("maincpu")->base(); |
| 76 | | state->m_ispal = ispal; |
| 77 | | state->m_lines = lines; |
| 78 | | state->m_p1_one_button = 1; |
| 79 | | state->m_p2_one_button = 1; |
| 73 | address_space& space = machine().device("maincpu")->memory().space(AS_PROGRAM); |
| 74 | m_ROM = memregion("maincpu")->base(); |
| 75 | m_ispal = ispal; |
| 76 | m_lines = lines; |
| 77 | m_p1_one_button = 1; |
| 78 | m_p2_one_button = 1; |
| 80 | 79 | |
| 81 | 80 | /* standard banks */ |
| 82 | | state->membank("bank5")->set_base(&state->m_ROM[0x2040]); /* RAM0 */ |
| 83 | | state->membank("bank6")->set_base(&state->m_ROM[0x2140]); /* RAM1 */ |
| 84 | | state->membank("bank7")->set_base(&state->m_ROM[0x2000]); /* MAINRAM */ |
| 81 | membank("bank5")->set_base(&m_ROM[0x2040]); /* RAM0 */ |
| 82 | membank("bank6")->set_base(&m_ROM[0x2140]); /* RAM1 */ |
| 83 | membank("bank7")->set_base(&m_ROM[0x2000]); /* MAINRAM */ |
| 85 | 84 | |
| 86 | 85 | /* Brutal hack put in as a consequence of new memory system; fix this */ |
| 87 | 86 | space.install_readwrite_bank(0x0480, 0x04FF,"bank10"); |
| 88 | | state->membank("bank10")->set_base(state->m_ROM + 0x0480); |
| 87 | membank("bank10")->set_base(m_ROM + 0x0480); |
| 89 | 88 | space.install_readwrite_bank(0x1800, 0x27FF, "bank11"); |
| 90 | | state->membank("bank11")->set_base(state->m_ROM + 0x1800); |
| 89 | membank("bank11")->set_base(m_ROM + 0x1800); |
| 90 | |
| 91 | m_bios_bkup = NULL; |
| 92 | m_cart_bkup = NULL; |
| 93 | |
| 94 | /* Allocate memory for BIOS bank switching */ |
| 95 | m_bios_bkup = auto_alloc_array_clear(machine(), UINT8, 0x4000); |
| 96 | m_cart_bkup = auto_alloc_array(machine(), UINT8, 0x4000); |
| 97 | |
| 98 | /* save the BIOS so we can switch it in and out */ |
| 99 | memcpy( m_bios_bkup, m_ROM + 0xC000, 0x4000 ); |
| 100 | |
| 101 | /* Initialize cart area to "no data" */ |
| 102 | memset( m_cart_bkup, 0xFF, 0x4000 ); |
| 103 | |
| 104 | /* defaults for PAL bios without cart */ |
| 105 | m_cart_type = 0; |
| 106 | m_stick_type = 1; |
| 91 | 107 | } |
| 92 | 108 | |
| 93 | 109 | |
| 94 | 110 | DRIVER_INIT_MEMBER(a7800_state,a7800_ntsc) |
| 95 | 111 | { |
| 96 | | a7800_driver_init(machine(), FALSE, 262); |
| 112 | a7800_driver_init(FALSE, 262); |
| 97 | 113 | } |
| 98 | 114 | |
| 99 | 115 | |
| 100 | 116 | DRIVER_INIT_MEMBER(a7800_state,a7800_pal) |
| 101 | 117 | { |
| 102 | | a7800_driver_init(machine(), TRUE, 312); |
| 118 | a7800_driver_init(TRUE, 312); |
| 103 | 119 | } |
| 104 | 120 | |
| 105 | 121 | |
| r20778 | r20779 | |
| 191 | 207 | } |
| 192 | 208 | |
| 193 | 209 | |
| 194 | | DEVICE_IMAGE_START_MEMBER( a7800_state, a7800_cart ) |
| 195 | | { |
| 196 | | UINT8 *memory = memregion("maincpu")->base(); |
| 197 | | |
| 198 | | m_bios_bkup = NULL; |
| 199 | | m_cart_bkup = NULL; |
| 200 | | |
| 201 | | /* Allocate memory for BIOS bank switching */ |
| 202 | | m_bios_bkup = auto_alloc_array_clear(machine(), UINT8, 0x4000); |
| 203 | | m_cart_bkup = auto_alloc_array(machine(), UINT8, 0x4000); |
| 204 | | |
| 205 | | /* save the BIOS so we can switch it in and out */ |
| 206 | | memcpy( m_bios_bkup, memory + 0xC000, 0x4000 ); |
| 207 | | |
| 208 | | /* Initialize cart area to "no data" */ |
| 209 | | memset( m_cart_bkup, 0xFF, 0x4000 ); |
| 210 | | |
| 211 | | /* defaults for PAL bios without cart */ |
| 212 | | m_cart_type = 0; |
| 213 | | m_stick_type = 1; |
| 214 | | } |
| 215 | | |
| 216 | 210 | struct a7800_pcb |
| 217 | 211 | { |
| 218 | 212 | const char *pcb_name; |