trunk/src/mame/drivers/fcrash.c
| r21901 | r21902 | |
| 63 | 63 | #include "sound/msm5205.h" |
| 64 | 64 | #include "sound/2151intf.h" |
| 65 | 65 | #include "sound/okim6295.h" |
| 66 | #include "machine/eeprom.h" |
| 66 | 67 | |
| 68 | static const eeprom_interface qsound_eeprom_interface = |
| 69 | { |
| 70 | 7, /* address bits */ |
| 71 | 8, /* data bits */ |
| 72 | "0110", /* read command */ |
| 73 | "0101", /* write command */ |
| 74 | "0111" /* erase command */ |
| 75 | }; |
| 67 | 76 | |
| 68 | 77 | WRITE16_MEMBER( cps_state::fcrash_soundlatch_w ) |
| 69 | 78 | { |
| r21901 | r21902 | |
| 483 | 492 | AM_RANGE(0xff0000, 0xffffff) AM_RAM |
| 484 | 493 | ADDRESS_MAP_END |
| 485 | 494 | |
| 495 | static ADDRESS_MAP_START( sgyxz_map, AS_PROGRAM, 16, cps_state ) |
| 496 | AM_RANGE(0x000000, 0x3fffff) AM_ROM |
| 497 | AM_RANGE(0x800030, 0x800031) AM_WRITE(cps1_coinctrl_w) |
| 498 | AM_RANGE(0x800100, 0x80013f) AM_RAM AM_SHARE("cps_a_regs") /* CPS-A custom */ |
| 499 | AM_RANGE(0x800140, 0x80017f) AM_RAM AM_SHARE("cps_b_regs") /* CPS-B custom */ |
| 500 | AM_RANGE(0x880000, 0x880001) AM_READ_PORT("IN1") /* Player input ports */ |
| 501 | AM_RANGE(0x880006, 0x88000d) AM_READ(cps1_dsw_r) /* System input ports / Dip Switches */ |
| 502 | AM_RANGE(0x88000e, 0x88000f) AM_WRITE(cps1_soundlatch_w) |
| 503 | AM_RANGE(0x880e78, 0x880e79) AM_READ(cps1_in2_r) /* Player 3 controls (later games) */ |
| 504 | AM_RANGE(0x890000, 0x890001) AM_WRITE(cps1_soundlatch2_w) |
| 505 | AM_RANGE(0x900000, 0x92ffff) AM_RAM_WRITE(cps1_gfxram_w) AM_SHARE("gfxram") |
| 506 | AM_RANGE(0xf1c004, 0xf1c005) AM_WRITE(cpsq_coinctrl2_w) /* Coin control2 (later games) */ |
| 507 | AM_RANGE(0xf1c006, 0xf1c007) AM_READ_PORT("EEPROMIN") AM_WRITE_PORT("EEPROMOUT") |
| 508 | AM_RANGE(0xff0000, 0xffffff) AM_RAM |
| 509 | ADDRESS_MAP_END |
| 510 | |
| 486 | 511 | static ADDRESS_MAP_START( sound_map, AS_PROGRAM, 8, cps_state ) |
| 487 | 512 | AM_RANGE(0x0000, 0x7fff) AM_ROM |
| 488 | 513 | AM_RANGE(0x8000, 0xbfff) AM_ROMBANK("bank1") |
| r21901 | r21902 | |
| 526 | 551 | AM_RANGE(0xe800, 0xe800) AM_WRITE(fcrash_msm5205_1_data_w) |
| 527 | 552 | ADDRESS_MAP_END |
| 528 | 553 | |
| 554 | static ADDRESS_MAP_START( sgyxz_sound_map, AS_PROGRAM, 8, cps_state ) |
| 555 | AM_RANGE(0x0000, 0x7fff) AM_ROM |
| 556 | AM_RANGE(0x8000, 0xbfff) AM_ROMBANK("bank1") |
| 557 | AM_RANGE(0xd000, 0xd7ff) AM_RAM |
| 558 | AM_RANGE(0xf000, 0xf001) AM_DEVREADWRITE("2151", ym2151_device, read, write) |
| 559 | AM_RANGE(0xf002, 0xf002) AM_DEVREADWRITE("oki", okim6295_device, read, write) |
| 560 | AM_RANGE(0xf004, 0xf004) AM_WRITE(cps1_snd_bankswitch_w) |
| 561 | AM_RANGE(0xf006, 0xf006) AM_WRITE(cps1_oki_pin7_w) /* controls pin 7 of OKI chip */ |
| 562 | AM_RANGE(0xf008, 0xf008) AM_READ(soundlatch_byte_r) /* Sound command */ |
| 563 | AM_RANGE(0xf00a, 0xf00a) AM_READ(soundlatch2_byte_r) /* Sound timer fade */ |
| 564 | ADDRESS_MAP_END |
| 529 | 565 | |
| 566 | |
| 530 | 567 | #define CPS1_COINAGE_1 \ |
| 531 | 568 | PORT_DIPNAME( 0x07, 0x07, DEF_STR( Coin_A ) ) \ |
| 532 | 569 | PORT_DIPSETTING( 0x00, DEF_STR( 4C_1C ) ) \ |
| r21901 | r21902 | |
| 935 | 972 | PORT_DIPSETTING( 0x00, DEF_STR( Test ) ) |
| 936 | 973 | INPUT_PORTS_END |
| 937 | 974 | |
| 975 | static INPUT_PORTS_START( sgyxz ) |
| 976 | PORT_START ("IN0") |
| 977 | PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_COIN1 ) |
| 978 | PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_COIN2 ) |
| 979 | PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_SERVICE1 ) |
| 980 | PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_UNKNOWN ) |
| 981 | PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_START1 ) |
| 982 | PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_START2 ) |
| 983 | PORT_SERVICE_NO_TOGGLE( 0x40, IP_ACTIVE_LOW ) |
| 984 | PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNKNOWN ) |
| 938 | 985 | |
| 986 | PORT_START ("DSWA") |
| 987 | PORT_DIPNAME( 0x03, 0x00, "Play Mode" ) |
| 988 | PORT_DIPSETTING( 0x00, DEF_STR( Normal ) ) |
| 989 | PORT_DIPSETTING( 0x03, "Tournament" ) |
| 990 | PORT_BIT( 0xfc, IP_ACTIVE_LOW, IPT_UNKNOWN ) |
| 991 | |
| 992 | PORT_START ("DSWB") |
| 993 | PORT_DIPNAME( 0x03, 0x03, DEF_STR( Coinage ) ) |
| 994 | PORT_DIPSETTING( 0x03, DEF_STR( 1C_1C ) ) |
| 995 | PORT_DIPSETTING( 0x02, DEF_STR( 1C_2C ) ) |
| 996 | PORT_DIPSETTING( 0x01, DEF_STR( 1C_3C ) ) |
| 997 | PORT_DIPSETTING( 0x00, DEF_STR( 1C_4C ) ) |
| 998 | PORT_BIT( 0xfc, IP_ACTIVE_LOW, IPT_UNKNOWN ) |
| 999 | |
| 1000 | PORT_START ("DSWC") |
| 1001 | PORT_BIT( 0xff, IP_ACTIVE_HIGH, IPT_UNKNOWN ) |
| 1002 | |
| 1003 | PORT_START ("IN1") |
| 1004 | PORT_BIT( 0x0001, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_8WAY PORT_PLAYER(1) |
| 1005 | PORT_BIT( 0x0002, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_8WAY PORT_PLAYER(1) |
| 1006 | PORT_BIT( 0x0004, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_8WAY PORT_PLAYER(1) |
| 1007 | PORT_BIT( 0x0008, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_8WAY PORT_PLAYER(1) |
| 1008 | PORT_BIT( 0x0010, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(1) |
| 1009 | PORT_BIT( 0x0020, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_PLAYER(1) |
| 1010 | PORT_BIT( 0x0040, IP_ACTIVE_LOW, IPT_BUTTON3 ) PORT_PLAYER(1) |
| 1011 | PORT_BIT( 0x0080, IP_ACTIVE_LOW, IPT_UNKNOWN ) |
| 1012 | PORT_BIT( 0x0100, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_8WAY PORT_PLAYER(2) |
| 1013 | PORT_BIT( 0x0200, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_8WAY PORT_PLAYER(2) |
| 1014 | PORT_BIT( 0x0400, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_8WAY PORT_PLAYER(2) |
| 1015 | PORT_BIT( 0x0800, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_8WAY PORT_PLAYER(2) |
| 1016 | PORT_BIT( 0x1000, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(2) |
| 1017 | PORT_BIT( 0x2000, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_PLAYER(2) |
| 1018 | PORT_BIT( 0x4000, IP_ACTIVE_LOW, IPT_BUTTON3 ) PORT_PLAYER(2) |
| 1019 | PORT_BIT( 0x8000, IP_ACTIVE_LOW, IPT_UNKNOWN ) |
| 1020 | |
| 1021 | PORT_START ("IN2") /* Player 3 */ |
| 1022 | PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_8WAY PORT_PLAYER(3) |
| 1023 | PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_8WAY PORT_PLAYER(3) |
| 1024 | PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_8WAY PORT_PLAYER(3) |
| 1025 | PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_8WAY PORT_PLAYER(3) |
| 1026 | PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(3) |
| 1027 | PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_PLAYER(3) |
| 1028 | PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_COIN3 ) |
| 1029 | PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_START3 ) |
| 1030 | |
| 1031 | PORT_START( "EEPROMIN" ) |
| 1032 | PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_READ_LINE_DEVICE_MEMBER("eeprom", eeprom_device, read_bit) |
| 1033 | |
| 1034 | PORT_START( "EEPROMOUT" ) |
| 1035 | PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_OUTPUT ) PORT_WRITE_LINE_DEVICE_MEMBER("eeprom", eeprom_device, write_bit) |
| 1036 | PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_OUTPUT ) PORT_WRITE_LINE_DEVICE_MEMBER("eeprom", eeprom_device, set_clock_line) |
| 1037 | PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_OUTPUT ) PORT_WRITE_LINE_DEVICE_MEMBER("eeprom", eeprom_device, set_cs_line) |
| 1038 | INPUT_PORTS_END |
| 1039 | |
| 1040 | |
| 939 | 1041 | static const msm5205_interface msm5205_interface1 = |
| 940 | 1042 | { |
| 941 | 1043 | m5205_int1, /* interrupt function */ |
| r21901 | r21902 | |
| 978 | 1080 | save_item(NAME(m_sample_select2)); |
| 979 | 1081 | } |
| 980 | 1082 | |
| 1083 | MACHINE_START_MEMBER(cps_state,sgyxz) |
| 1084 | { |
| 1085 | MACHINE_START_CALL_MEMBER(kodb); |
| 1086 | m_layer_scroll1x_offset = 0x40; |
| 1087 | m_layer_scroll2x_offset = 0x40; |
| 1088 | m_layer_scroll3x_offset = 0x40; |
| 1089 | membank("bank1")->configure_entries(0, 2, memregion("audiocpu")->base() + 0x10000, 0x4000); |
| 1090 | } |
| 1091 | |
| 981 | 1092 | MACHINE_START_MEMBER(cps_state,kodb) |
| 982 | 1093 | { |
| 983 | 1094 | m_maincpu = machine().device<cpu_device>("maincpu"); |
| r21901 | r21902 | |
| 1554 | 1665 | static MACHINE_CONFIG_START( sgyxz, cps_state ) |
| 1555 | 1666 | /* basic machine hardware */ |
| 1556 | 1667 | MCFG_CPU_ADD("maincpu", M68000, 12000000) |
| 1557 | | MCFG_CPU_PROGRAM_MAP(fcrash_map) |
| 1668 | MCFG_CPU_PROGRAM_MAP(sgyxz_map) |
| 1558 | 1669 | MCFG_CPU_VBLANK_INT_DRIVER("screen", cps_state, cps1_interrupt) |
| 1559 | 1670 | |
| 1560 | | // MCFG_CPU_ADD("audiocpu", Z80, 3579545) |
| 1561 | | // MCFG_CPU_PROGRAM_MAP(sub_map) |
| 1671 | MCFG_CPU_ADD("audiocpu", Z80, 3579545) |
| 1672 | MCFG_CPU_PROGRAM_MAP(sgyxz_sound_map) |
| 1562 | 1673 | |
| 1563 | | MCFG_MACHINE_START_OVERRIDE(cps_state,kodb) |
| 1674 | MCFG_MACHINE_START_OVERRIDE(cps_state,sgyxz) |
| 1564 | 1675 | |
| 1565 | 1676 | /* video hardware */ |
| 1566 | 1677 | MCFG_SCREEN_ADD("screen", RASTER) |
| r21901 | r21902 | |
| 1570 | 1681 | MCFG_SCREEN_VISIBLE_AREA(8*8, (64-8)*8-1, 2*8, 30*8-1 ) |
| 1571 | 1682 | MCFG_SCREEN_UPDATE_DRIVER(cps_state, screen_update_fcrash) |
| 1572 | 1683 | MCFG_SCREEN_VBLANK_DRIVER(cps_state, screen_eof_cps1) |
| 1573 | | |
| 1574 | 1684 | MCFG_GFXDECODE(cps1) |
| 1575 | 1685 | MCFG_PALETTE_LENGTH(0xc00) |
| 1686 | MCFG_VIDEO_START_OVERRIDE(cps_state,cps1) |
| 1576 | 1687 | |
| 1577 | | MCFG_VIDEO_START_OVERRIDE(cps_state,cps1) |
| 1688 | MCFG_EEPROM_ADD("eeprom", qsound_eeprom_interface) |
| 1689 | |
| 1690 | /* sound hardware */ |
| 1691 | MCFG_SPEAKER_STANDARD_MONO("mono") |
| 1692 | |
| 1693 | MCFG_YM2151_ADD("2151", XTAL_3_579545MHz) /* verified on pcb */ |
| 1694 | MCFG_YM2151_IRQ_HANDLER(INPUTLINE("audiocpu", 0)) |
| 1695 | MCFG_SOUND_ROUTE(0, "mono", 0.35) |
| 1696 | MCFG_SOUND_ROUTE(1, "mono", 0.35) |
| 1697 | |
| 1698 | /* CPS PPU is fed by a 16mhz clock,pin 117 outputs a 4mhz clock which is divided by 4 using 2 74ls74 */ |
| 1699 | MCFG_OKIM6295_ADD("oki", XTAL_16MHz/4/4, OKIM6295_PIN7_HIGH) // pin 7 can be changed by the game code, see f006 on z80 |
| 1700 | MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.30) |
| 1578 | 1701 | MACHINE_CONFIG_END |
| 1579 | 1702 | |
| 1580 | 1703 | |
| 1581 | 1704 | |
| 1582 | 1705 | ROM_START( sgyxz ) |
| 1583 | 1706 | ROM_REGION( 0x400000, "maincpu", 0 ) /* 68000 Code */ |
| 1584 | | ROM_LOAD16_BYTE( "sgyxz_prg1.bin", 0x000001, 0x80000, CRC(d8511929) SHA1(4de9263778f327693f4d1e21b48e43806f673487) ) |
| 1585 | | ROM_LOAD16_BYTE( "sgyxz_prg2.bin", 0x000000, 0x80000, CRC(95429c83) SHA1(e981624d018132e5625a66113b6ac4fc44e55cf7) ) |
| 1707 | ROM_LOAD16_BYTE( "sgyxz_prg1.bin", 0x000001, 0x20000, CRC(d8511929) SHA1(4de9263778f327693f4d1e21b48e43806f673487) ) |
| 1708 | ROM_CONTINUE( 0x80001, 0x20000 ) |
| 1709 | ROM_CONTINUE( 0x40001, 0x20000 ) |
| 1710 | ROM_CONTINUE( 0xc0001, 0x20000 ) |
| 1711 | ROM_LOAD16_BYTE( "sgyxz_prg2.bin", 0x000000, 0x20000, CRC(95429c83) SHA1(e981624d018132e5625a66113b6ac4fc44e55cf7) ) |
| 1712 | ROM_CONTINUE( 0x80000, 0x20000 ) |
| 1713 | ROM_CONTINUE( 0x40000, 0x20000 ) |
| 1714 | ROM_CONTINUE( 0xc0000, 0x20000 ) |
| 1715 | ROM_FILL(0x708da, 4, 0xff) // patch out protections |
| 1716 | ROM_FILL(0xf11ea, 1, 0x60) |
| 1717 | ROM_FILL(0x00007, 1, 0xa2) // start address |
| 1718 | ROM_FILL(0x02448, 1, 0x07) // transitions |
| 1586 | 1719 | |
| 1587 | 1720 | ROM_REGION( 0x400000, "gfx", 0 ) |
| 1588 | | ROM_LOAD16_BYTE("sgyxz_gfx1.bin", 0x000000, 0x200000, CRC(a60be9f6) SHA1(2298a4b6a2c83b76dc106a1efa19606b298d378a) ) // 'picture 1' |
| 1589 | | ROM_LOAD16_BYTE("sgyxz_gfx2.bin", 0x000001, 0x200000, CRC(6ad9d048) SHA1(d47212d28d0a1ce349e4c59e5d0d99c541b3458e) ) // 'picture 2' |
| 1721 | ROMX_LOAD("sgyxz_gfx1.bin", 0x000000, 0x80000, CRC(a60be9f6) SHA1(2298a4b6a2c83b76dc106a1efa19606b298d378a), ROM_GROUPWORD | ROM_SKIP(6) ) // 'picture 1' |
| 1722 | ROM_CONTINUE( 0x000004, 0x80000 ) |
| 1723 | ROM_CONTINUE( 0x200000, 0x80000 ) |
| 1724 | ROM_CONTINUE( 0x200004, 0x80000 ) |
| 1725 | ROMX_LOAD("sgyxz_gfx2.bin", 0x000002, 0x80000, CRC(6ad9d048) SHA1(d47212d28d0a1ce349e4c59e5d0d99c541b3458e), ROM_GROUPWORD | ROM_SKIP(6) ) // 'picture 2' |
| 1726 | ROM_CONTINUE( 0x000006, 0x80000 ) |
| 1727 | ROM_CONTINUE( 0x200002, 0x80000 ) |
| 1728 | ROM_CONTINUE( 0x200006, 0x80000 ) |
| 1590 | 1729 | |
| 1591 | | ROM_REGION( 0x10000, "audiocpu", 0 ) /* Z80 code */ |
| 1730 | ROM_REGION( 0x20000, "audiocpu", 0 ) /* Z80 code */ |
| 1592 | 1731 | ROM_LOAD( "sgyxz_snd2.bin", 0x00000, 0x10000, CRC(210c376f) SHA1(0d937c86078d0a106f5636b7daf5fc0266c2c2ec) ) |
| 1732 | ROM_RELOAD( 0x8000, 0x10000 ) |
| 1593 | 1733 | |
| 1594 | 1734 | ROM_REGION( 0x040000, "oki", 0 ) /* Samples */ |
| 1595 | 1735 | ROM_LOAD( "sgyxz_snd1.bin", 0x00000, 0x40000, CRC(c15ac0f2) SHA1(8d9e5519d9820e4ac4f70555088c80e64d052c9d) ) |
| r21901 | r21902 | |
| 1679 | 1819 | GAME( 1990, cawingb2, cawing, cawingbl, cawingbl, cps_state, cawingbl, ROT0, "bootleg", "Carrier Air Wing (bootleg with 2xYM2203 + 2xMSM205 set 2)", GAME_SUPPORTS_SAVE ) |
| 1680 | 1820 | GAME( 1992, sf2mdt, sf2ce, sf2mdt, sf2mdt, cps_state, sf2mdt, ROT0, "bootleg", "Street Fighter II': Magic Delta Turbo (bootleg, set 1)", GAME_IMPERFECT_GRAPHICS | GAME_SUPPORTS_SAVE ) // 920313 - based on (heavily modified) World version |
| 1681 | 1821 | GAME( 1992, sf2mdta, sf2ce, sf2mdt, sf2mdt, cps_state, sf2mdta, ROT0, "bootleg", "Street Fighter II': Magic Delta Turbo (bootleg, set 2)", GAME_IMPERFECT_GRAPHICS | GAME_SUPPORTS_SAVE ) // 920313 - based on World version |
| 1682 | | GAME( 199?, sgyxz, wof, sgyxz, fcrash, cps_state, cps1, ROT0, "bootleg (All-In Electronic)", "Warriors of Fate ('sgyxz' bootleg)", GAME_NOT_WORKING | GAME_NO_SOUND ) |
| 1822 | GAME( 1999, sgyxz, wof, sgyxz, sgyxz, cps_state, cps1, ROT0, "bootleg (All-In Electronic)", "Warriors of Fate ('sgyxz' bootleg)", GAME_IMPERFECT_GRAPHICS | GAME_SUPPORTS_SAVE ) // 921005 - Sangokushi 2 |