trunk/src/mess/drivers/sms.c
| r29589 | r29590 | |
| 371 | 371 | PORT_INCLUDE( sg1000m3 ) |
| 372 | 372 | |
| 373 | 373 | PORT_START("RESET") |
| 374 | | PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_SERVICE1 ) PORT_NAME("Reset Button") |
| 374 | PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_SERVICE2 ) PORT_NAME("Reset Button") |
| 375 | 375 | INPUT_PORTS_END |
| 376 | 376 | |
| 377 | 377 | static INPUT_PORTS_START( smsj ) |
| 378 | 378 | PORT_INCLUDE( sg1000m3 ) |
| 379 | 379 | |
| 380 | 380 | //PORT_START("RAPID") |
| 381 | | //PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_SERVICE1 ) PORT_NAME("Rapid Button") /* Not implemented */ |
| 381 | //PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_SERVICE2 ) PORT_NAME("Rapid Button") /* Not implemented */ |
| 382 | 382 | INPUT_PORTS_END |
| 383 | 383 | |
| 384 | 384 | static INPUT_PORTS_START( smssdisp ) |
| 385 | | PORT_INCLUDE( sms ) |
| 385 | PORT_INCLUDE( sms1 ) |
| 386 | 386 | |
| 387 | 387 | PORT_START("DSW") |
| 388 | 388 | PORT_DIPNAME( 0x07, 0x07, "Timer 1 length" ) |
| r29589 | r29590 | |
| 408 | 408 | PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_UNKNOWN ) // READY, must be high |
| 409 | 409 | |
| 410 | 410 | PORT_START("GAMESEL1") |
| 411 | | PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_OTHER ) PORT_NAME("Game 03") PORT_CODE(KEYCODE_B) |
| 412 | | PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_OTHER ) PORT_NAME("Game 02") PORT_CODE(KEYCODE_G) |
| 413 | | PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_OTHER ) PORT_NAME("Game 01") PORT_CODE(KEYCODE_T) |
| 414 | | PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_OTHER ) PORT_NAME("Game 00") PORT_CODE(KEYCODE_5) |
| 415 | | PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_OTHER ) PORT_NAME("Game 07") PORT_CODE(KEYCODE_N) |
| 416 | | PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_OTHER ) PORT_NAME("Game 06") PORT_CODE(KEYCODE_H) |
| 417 | | PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_OTHER ) PORT_NAME("Game 05") PORT_CODE(KEYCODE_Y) |
| 418 | | PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_OTHER ) PORT_NAME("Game 04") PORT_CODE(KEYCODE_6) |
| 411 | PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_OTHER ) PORT_NAME("Game 03") PORT_CODE(KEYCODE_N) |
| 412 | PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_OTHER ) PORT_NAME("Game 02") PORT_CODE(KEYCODE_H) |
| 413 | PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_OTHER ) PORT_NAME("Game 01") PORT_CODE(KEYCODE_Y) |
| 414 | PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_OTHER ) PORT_NAME("Game 00") PORT_CODE(KEYCODE_6) |
| 415 | PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_OTHER ) PORT_NAME("Game 07") PORT_CODE(KEYCODE_M) |
| 416 | PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_OTHER ) PORT_NAME("Game 06") PORT_CODE(KEYCODE_J) |
| 417 | PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_OTHER ) PORT_NAME("Game 05") PORT_CODE(KEYCODE_U) |
| 418 | PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_OTHER ) PORT_NAME("Game 04") PORT_CODE(KEYCODE_7) |
| 419 | 419 | |
| 420 | 420 | PORT_START("GAMESEL2") |
| 421 | | PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_OTHER ) PORT_NAME("Game 11") PORT_CODE(KEYCODE_M) |
| 422 | | PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_OTHER ) PORT_NAME("Game 10") PORT_CODE(KEYCODE_J) |
| 423 | | PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_OTHER ) PORT_NAME("Game 09") PORT_CODE(KEYCODE_U) |
| 424 | | PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_OTHER ) PORT_NAME("Game 08") PORT_CODE(KEYCODE_7) |
| 425 | | PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_OTHER ) PORT_NAME("Game 15") PORT_CODE(KEYCODE_COMMA) |
| 426 | | PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_OTHER ) PORT_NAME("Game 14") PORT_CODE(KEYCODE_K) |
| 427 | | PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_OTHER ) PORT_NAME("Game 13") PORT_CODE(KEYCODE_I) |
| 428 | | PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_OTHER ) PORT_NAME("Game 12") PORT_CODE(KEYCODE_8) |
| 421 | PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_OTHER ) PORT_NAME("Game 11") PORT_CODE(KEYCODE_COMMA) |
| 422 | PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_OTHER ) PORT_NAME("Game 10") PORT_CODE(KEYCODE_K) |
| 423 | PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_OTHER ) PORT_NAME("Game 09") PORT_CODE(KEYCODE_I) |
| 424 | PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_OTHER ) PORT_NAME("Game 08") PORT_CODE(KEYCODE_8) |
| 425 | PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_OTHER ) PORT_NAME("Game 15") PORT_CODE(KEYCODE_STOP) |
| 426 | PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_OTHER ) PORT_NAME("Game 14") PORT_CODE(KEYCODE_L) |
| 427 | PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_OTHER ) PORT_NAME("Game 13") PORT_CODE(KEYCODE_O) |
| 428 | PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_OTHER ) PORT_NAME("Game 12") PORT_CODE(KEYCODE_9) |
| 429 | 429 | INPUT_PORTS_END |
| 430 | 430 | |
| 431 | 431 | static INPUT_PORTS_START( gg ) |
| r29589 | r29590 | |
| 606 | 606 | MCFG_SMS_EXPANSION_ADD("exp", sms_expansion_devices, NULL) |
| 607 | 607 | MACHINE_CONFIG_END |
| 608 | 608 | |
| 609 | | static MACHINE_CONFIG_START( sms_sdisp, smssdisp_state ) |
| 610 | | /* basic machine hardware */ |
| 611 | | MCFG_CPU_ADD("maincpu", Z80, XTAL_53_693175MHz/15) |
| 612 | | MCFG_CPU_PROGRAM_MAP(sms_mem) |
| 613 | | MCFG_CPU_IO_MAP(sms_io) |
| 609 | static MACHINE_CONFIG_DERIVED_CLASS( sms_sdisp, sms1_ntsc, smssdisp_state ) |
| 614 | 610 | |
| 615 | | MCFG_QUANTUM_TIME(attotime::from_hz(60)) |
| 611 | MCFG_DEVICE_MODIFY("sms_vdp") |
| 612 | MCFG_SEGA315_5124_INT_CB(WRITELINE(smssdisp_state, sms_store_int_callback)) |
| 616 | 613 | |
| 617 | | MCFG_MACHINE_START_OVERRIDE(sms_state,sms) |
| 618 | | MCFG_MACHINE_RESET_OVERRIDE(sms_state,sms) |
| 619 | | |
| 620 | | /* sound hardware */ |
| 621 | | MCFG_SPEAKER_STANDARD_MONO("mono") |
| 622 | | |
| 623 | | MCFG_SOUND_ADD("segapsg", SEGAPSG, XTAL_53_693175MHz/15) |
| 624 | | MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.00) |
| 625 | | |
| 626 | | /* video hardware */ |
| 627 | | MCFG_SCREEN_ADD("screen", RASTER) |
| 628 | | MCFG_SCREEN_RAW_PARAMS(XTAL_53_693175MHz/10, \ |
| 629 | | SEGA315_5124_WIDTH , SEGA315_5124_LBORDER_START + SEGA315_5124_LBORDER_WIDTH - 2, SEGA315_5124_LBORDER_START + SEGA315_5124_LBORDER_WIDTH + 256 + 10, \ |
| 630 | | SEGA315_5124_HEIGHT_NTSC, SEGA315_5124_TBORDER_START + SEGA315_5124_NTSC_224_TBORDER_HEIGHT, SEGA315_5124_TBORDER_START + SEGA315_5124_NTSC_224_TBORDER_HEIGHT + 224) |
| 631 | | MCFG_SCREEN_UPDATE_DRIVER(sms_state, screen_update_sms) |
| 632 | | |
| 633 | | MCFG_DEVICE_ADD("sms_vdp", SEGA315_5246, 0) |
| 634 | | MCFG_SEGA315_5246_SET_SCREEN("screen") |
| 635 | | MCFG_SEGA315_5246_IS_PAL(false) |
| 636 | | MCFG_SEGA315_5246_INT_CB(WRITELINE(smssdisp_state, sms_store_int_callback)) |
| 637 | | MCFG_SEGA315_5246_PAUSE_CB(WRITELINE(sms_state, sms_pause_callback)) |
| 638 | | |
| 639 | 614 | MCFG_CPU_ADD("control", Z80, XTAL_53_693175MHz/15) |
| 640 | 615 | MCFG_CPU_PROGRAM_MAP(sms_store_mem) |
| 641 | 616 | /* Both CPUs seem to communicate with the VDP etc? */ |
| 642 | 617 | MCFG_CPU_IO_MAP(sms_io) |
| 643 | 618 | |
| 644 | | MCFG_SMS_CARTRIDGE_ADD("slot", sms_cart, NULL) // should be mandatory? |
| 619 | MCFG_DEVICE_REMOVE("mycard") |
| 620 | MCFG_DEVICE_REMOVE("exp") |
| 621 | |
| 645 | 622 | MCFG_SMS_CARTRIDGE_ADD("slot2", sms_cart, NULL) |
| 646 | 623 | MCFG_SMS_CARTRIDGE_ADD("slot3", sms_cart, NULL) |
| 647 | 624 | MCFG_SMS_CARTRIDGE_ADD("slot4", sms_cart, NULL) |
| r29589 | r29590 | |
| 674 | 651 | MCFG_SMS_CARD_ADD("slot30", sms_cart, NULL) |
| 675 | 652 | MCFG_SMS_CARD_ADD("slot31", sms_cart, NULL) |
| 676 | 653 | MCFG_SMS_CARD_ADD("slot32", sms_cart, NULL) |
| 677 | | |
| 678 | | MCFG_SOFTWARE_LIST_ADD("cart_list","sms") |
| 679 | | |
| 680 | | MCFG_SMS_CONTROL_PORT_ADD(CONTROL1_TAG, sms_control_port_devices, "joypad") |
| 681 | | MCFG_SMS_CONTROL_PORT_TH_INPUT_HANDLER(WRITELINE(sms_state, sms_ctrl1_th_input)) |
| 682 | | MCFG_SMS_CONTROL_PORT_PIXEL_HANDLER(READ32(sms_state, sms_pixel_color)) |
| 683 | | |
| 684 | | MCFG_SMS_CONTROL_PORT_ADD(CONTROL2_TAG, sms_control_port_devices, "joypad") |
| 685 | | MCFG_SMS_CONTROL_PORT_TH_INPUT_HANDLER(WRITELINE(sms_state, sms_ctrl2_th_input)) |
| 686 | | MCFG_SMS_CONTROL_PORT_PIXEL_HANDLER(READ32(sms_state, sms_pixel_color)) |
| 687 | 654 | MACHINE_CONFIG_END |
| 688 | 655 | |
| 689 | 656 | static MACHINE_CONFIG_START( sms_pal_base, sms_state ) |