diff --git a/.gitattributes b/.gitattributes index 082f78d7483..48b530c8753 100644 --- a/.gitattributes +++ b/.gitattributes @@ -2755,6 +2755,7 @@ src/mame/drivers/mpoker.c svneol=native#text/plain src/mame/drivers/mpu2.c svneol=native#text/plain src/mame/drivers/mpu3.c svneol=native#text/plain src/mame/drivers/mpu4.c svneol=native#text/plain +src/mame/drivers/mpu4hw.c svneol=native#text/plain src/mame/drivers/mpu4vid.c svneol=native#text/plain src/mame/drivers/mpu5.c svneol=native#text/plain src/mame/drivers/mpu5hw.c svneol=native#text/plain diff --git a/src/mame/drivers/maygayep.c b/src/mame/drivers/maygayep.c index c3fd770825c..cd27848ad89 100644 --- a/src/mame/drivers/maygayep.c +++ b/src/mame/drivers/maygayep.c @@ -92,8 +92,8 @@ MACHINE_CONFIG_END ROM_START( ep_simp ) ROM_REGION( 0x080000, "maincpu", 0 ) - ROM_LOAD16_BYTE( "sim256g0", 0x00000, 0x020000, CRC(8b5b266a) SHA1(358a98f1cd4fc65a4dfe7e9436eeca5f0649de15) ) - ROM_LOAD16_BYTE( "sim256g1", 0x00001, 0x020000, CRC(a4ec81bb) SHA1(bac8475def260f53e0fd25037752295ba04c88de) ) + ROM_LOAD16_BYTE( "sa980256.g0", 0x000000, 0x020000, CRC(8b5b266a) SHA1(358a98f1cd4fc65a4dfe7e9436eeca5f0649de15) ) + ROM_LOAD16_BYTE( "sa980256.g1", 0x000001, 0x020000, CRC(a4ec81bb) SHA1(bac8475def260f53e0fd25037752295ba04c88de) ) EP_SIMP_SOUND ROM_END @@ -153,13 +153,6 @@ ROM_START( ep_simph ) EP_SIMP_SOUND ROM_END -ROM_START( ep_simpi ) - ROM_REGION( 0x080000, "maincpu", 0 ) - ROM_LOAD16_BYTE( "sa980256.g0", 0x000000, 0x020000, CRC(8b5b266a) SHA1(358a98f1cd4fc65a4dfe7e9436eeca5f0649de15) ) - ROM_LOAD16_BYTE( "sa980256.g1", 0x000001, 0x020000, CRC(a4ec81bb) SHA1(bac8475def260f53e0fd25037752295ba04c88de) ) - EP_SIMP_SOUND -ROM_END - ROM_START( ep_simpj ) ROM_REGION( 0x080000, "maincpu", 0 ) ROM_LOAD16_BYTE( "sa990077.g0", 0x000000, 0x020000, CRC(d8c221e5) SHA1(acce206e28451d26805abdfead4bdb6ed5605a65) ) @@ -277,10 +270,10 @@ ROM_END ROM_START( ep_wipeo ) ROM_REGION( 0x080000, "maincpu", 0 ) - ROM_LOAD16_BYTE( "wipeoutgame0.bin", 0x000000, 0x020000, CRC(12c623e5) SHA1(3473adea1b4e93f1d848a8af996a7e18b3c0ee21) ) - ROM_LOAD16_BYTE( "wipeoutgame1.bin", 0x000001, 0x020000, CRC(1c768ee3) SHA1(19aed3ef546597b51e2c781791cf225e364da5c5) ) - ROM_LOAD16_BYTE( "wipeoutgame2.bin", 0x040000, 0x020000, CRC(7914c95c) SHA1(8c3a212cf4dd8bbbd58aad77052dda81719308f1) ) - ROM_LOAD16_BYTE( "wipeoutgame3.bin", 0x040001, 0x020000, CRC(0c45a675) SHA1(155c458620aa2ea8aaf4ff18a09b62df3f50b508) ) + ROM_LOAD16_BYTE( "i00nwo18.g0", 0x000000, 0x020000, CRC(12c623e5) SHA1(3473adea1b4e93f1d848a8af996a7e18b3c0ee21) ) + ROM_LOAD16_BYTE( "i00nwo18.g1", 0x000001, 0x020000, CRC(1c768ee3) SHA1(19aed3ef546597b51e2c781791cf225e364da5c5) ) + ROM_LOAD16_BYTE( "i00nwo18.g2", 0x040000, 0x020000, CRC(7914c95c) SHA1(8c3a212cf4dd8bbbd58aad77052dda81719308f1) ) + ROM_LOAD16_BYTE( "i00nwo18.g3", 0x040001, 0x020000, CRC(0c45a675) SHA1(155c458620aa2ea8aaf4ff18a09b62df3f50b508) ) EP_WIPEO_SOUND ROM_END @@ -307,15 +300,6 @@ ROM_START( ep_wipeoc ) EP_WIPEO_SOUND ROM_END -ROM_START( ep_wipeod ) - ROM_REGION( 0x080000, "maincpu", 0 ) - ROM_LOAD16_BYTE( "i00nwo18.g0", 0x000000, 0x020000, CRC(12c623e5) SHA1(3473adea1b4e93f1d848a8af996a7e18b3c0ee21) ) - ROM_LOAD16_BYTE( "i00nwo18.g1", 0x000001, 0x020000, CRC(1c768ee3) SHA1(19aed3ef546597b51e2c781791cf225e364da5c5) ) - ROM_LOAD16_BYTE( "i00nwo18.g2", 0x040000, 0x020000, CRC(7914c95c) SHA1(8c3a212cf4dd8bbbd58aad77052dda81719308f1) ) - ROM_LOAD16_BYTE( "i00nwo18.g3", 0x040001, 0x020000, CRC(0c45a675) SHA1(155c458620aa2ea8aaf4ff18a09b62df3f50b508) ) - EP_WIPEO_SOUND -ROM_END - ROM_START( ep_wipeoe ) ROM_REGION( 0x080000, "maincpu", 0 ) ROM_LOAD16_BYTE( "i00pwo15.g0", 0x000000, 0x020000, CRC(d1f446f4) SHA1(c0cf204c08f26a2231fc5a7f61d876d487fb41d7) ) @@ -1173,8 +1157,8 @@ ROM_END ROM_START( ep_cflow ) ROM_REGION( 0x080000, "maincpu", 0 ) - ROM_LOAD16_BYTE( "cfl260g0", 0x00000, 0x020000, CRC(2e1c35f0) SHA1(03dddea4dad0d78d50d549865fcad428d80c25ad) ) - ROM_LOAD16_BYTE( "cfl260g1", 0x00001, 0x020000, CRC(8b543c6f) SHA1(ac4dea7ab7092f0d02569d10c9369dbe1f05a53e) ) + ROM_LOAD16_BYTE( "sa980260.g0", 0x00000, 0x020000, CRC(2e1c35f0) SHA1(03dddea4dad0d78d50d549865fcad428d80c25ad) ) // cfl260g0 + ROM_LOAD16_BYTE( "sa980260.g1", 0x00001, 0x020000, CRC(8b543c6f) SHA1(ac4dea7ab7092f0d02569d10c9369dbe1f05a53e) ) // cfl260g1 MISSING_SOUND ROM_END @@ -1185,13 +1169,6 @@ ROM_START( ep_cflowa ) MISSING_SOUND ROM_END -ROM_START( ep_cflowb ) - ROM_REGION( 0x080000, "maincpu", 0 ) - ROM_LOAD16_BYTE( "sa980260.g0", 0x00000, 0x020000, CRC(2e1c35f0) SHA1(03dddea4dad0d78d50d549865fcad428d80c25ad) ) - ROM_LOAD16_BYTE( "sa980260.g1", 0x00001, 0x020000, CRC(8b543c6f) SHA1(ac4dea7ab7092f0d02569d10c9369dbe1f05a53e) ) - MISSING_SOUND -ROM_END - ROM_START( ep_cflowc ) ROM_REGION( 0x080000, "maincpu", 0 ) ROM_LOAD16_BYTE( "sa990134.g0", 0x00000, 0x020000, CRC(b4a41f3c) SHA1(de8211ae63ed1b4b899ca11dd502e151eecd6a64) ) @@ -2654,6 +2631,10 @@ ROM_START( ep_gridrd ) ROM_END +#define EP_HHCLB_SOUND \ + ROM_REGION( 0x100000, "ymz", 0 ) /* guess based on name */ \ + ROM_LOAD( "h_house.s0", 0x000000, 0x080000, CRC(387fb6bb) SHA1(e532a74792792c17347560cdc5aa890223b99abc) ) \ + ROM_LOAD( "h_house.s1", 0x080000, 0x080000, CRC(a8df24cb) SHA1(b57590c128ce7cc40050ed1149741ca2c16e656b) ) \ ROM_START( ep_hhclb ) @@ -2662,27 +2643,34 @@ ROM_START( ep_hhclb ) ROM_LOAD16_BYTE( "msc02044.g1", 0x000001, 0x020000, CRC(e5d8437b) SHA1(10f863b522f75b9540b0a08bc33ee51ad4f4df79) ) ROM_LOAD16_BYTE( "msc02044.g2", 0x040000, 0x020000, CRC(d5af8708) SHA1(e13e085186b90bea81a171e92f6056cb3c3245ab) ) ROM_LOAD16_BYTE( "msc02044.g3", 0x040001, 0x020000, CRC(493e0979) SHA1(d2b20ee23dc2a2eaf6963a2f536d5303c2037570) ) + EP_HHCLB_SOUND +ROM_END - ROM_REGION( 0x080000, "altrevs", 0 ) /* split into clones later */ +ROM_START( ep_hhclba ) + ROM_REGION( 0x080000, "maincpu", 0 ) ROM_LOAD16_BYTE( "msc02045.g0", 0x000000, 0x020000, CRC(a32f2ae1) SHA1(44961cc4af575dbcb894372ebdf5b080b5964c14) ) ROM_LOAD16_BYTE( "msc02045.g1", 0x000001, 0x020000, CRC(cd34bfcc) SHA1(d32a085220b5b8d0896d765852244cec0299c331) ) ROM_LOAD16_BYTE( "msc02045.g2", 0x040000, 0x020000, CRC(d5af8708) SHA1(e13e085186b90bea81a171e92f6056cb3c3245ab) ) ROM_LOAD16_BYTE( "msc02045.g3", 0x040001, 0x020000, CRC(493e0979) SHA1(d2b20ee23dc2a2eaf6963a2f536d5303c2037570) ) + EP_HHCLB_SOUND +ROM_END +ROM_START( ep_hhclbb ) + ROM_REGION( 0x080000, "maincpu", 0 ) ROM_LOAD( "h_h0use.0", 0x0000, 0x020000, CRC(71476052) SHA1(d97785b7e64c30d4bfdd12ffd68e3d1f1e9dd311) ) ROM_LOAD( "h_house.1", 0x0000, 0x020000, CRC(5b2d7fd7) SHA1(885221d0ec354dc6bb8813fddd8db1729ec07d3b) ) ROM_LOAD( "h_house.2", 0x0000, 0x020000, CRC(3277bba8) SHA1(b6b7005d3a056f9bcbc6960b50cb7acabe1781dd) ) ROM_LOAD( "h_house.3", 0x0000, 0x020000, CRC(262e99ea) SHA1(a34a23bd9137e5cb5bddaad6f8f08f3753e1b0e0) ) + EP_HHCLB_SOUND +ROM_END + +ROM_START( ep_hhclbc ) + ROM_REGION( 0x080000, "maincpu", 0 ) ROM_LOAD( "h_house.g0", 0x000000, 0x020000, CRC(71476052) SHA1(d97785b7e64c30d4bfdd12ffd68e3d1f1e9dd311) ) ROM_LOAD( "h_house.g1", 0x000001, 0x020000, CRC(5b2d7fd7) SHA1(885221d0ec354dc6bb8813fddd8db1729ec07d3b) ) ROM_LOAD( "h_house.g2", 0x040000, 0x020000, CRC(3277bba8) SHA1(b6b7005d3a056f9bcbc6960b50cb7acabe1781dd) ) ROM_LOAD( "h_house.g3", 0x040001, 0x020000, CRC(9acfcbe8) SHA1(bada40fc9886aa59c6c9a793ef904d9d82a9efe5) ) - - - ROM_REGION( 0x100000, "ymz", 0 ) - // guess based on name - ROM_LOAD( "h_house.s0", 0x000000, 0x080000, CRC(387fb6bb) SHA1(e532a74792792c17347560cdc5aa890223b99abc) ) - ROM_LOAD( "h_house.s1", 0x080000, 0x080000, CRC(a8df24cb) SHA1(b57590c128ce7cc40050ed1149741ca2c16e656b) ) + EP_HHCLB_SOUND ROM_END @@ -2693,8 +2681,11 @@ ROM_START( ep_hvns ) ROM_LOAD16_BYTE( "i02nha05.g1", 0x000001, 0x020000, CRC(9873ebd1) SHA1(7b8f890dc8f4309ee04ed73209054222938696d8) ) ROM_LOAD16_BYTE( "i02nha05.g2", 0x040000, 0x020000, CRC(ad48d982) SHA1(8281abb862c2da5650fa0e126a61f690ef943a54) ) ROM_LOAD16_BYTE( "i02nha05.g3", 0x040001, 0x020000, CRC(ee793d9f) SHA1(b53df0207645bf0652f247a9f1599766c1703167) ) + MISSING_SOUND +ROM_END - ROM_REGION( 0x080000, "altrevs", 0 ) /* split into clones later */ +ROM_START( ep_hvnsa ) + ROM_REGION( 0x080000, "maincpu", 0 ) ROM_LOAD16_BYTE( "i02pha06.g0", 0x000000, 0x020000, CRC(3dd8672f) SHA1(d88cdf2e056d145eba98d9bcc6c26f89dbc97369) ) ROM_LOAD16_BYTE( "i02pha06.g1", 0x000001, 0x020000, CRC(73edbfe9) SHA1(a564e8664c61c785fe5a6b0c89996bdb9b1bdfac) ) ROM_LOAD16_BYTE( "i02pha06.g2", 0x040000, 0x020000, CRC(ad48d982) SHA1(8281abb862c2da5650fa0e126a61f690ef943a54) ) @@ -2711,24 +2702,50 @@ ROM_START( ep_highv ) ROM_LOAD16_BYTE( "i00phv27.g1", 0x000001, 0x020000, CRC(745b7ff5) SHA1(ba95f005b8c6bcf7f895883aeb41bf0562c8dd25) ) ROM_LOAD16_BYTE( "i00phv27.g2", 0x040000, 0x020000, CRC(8bbeba8d) SHA1(d5f39c5acd6ffe11c0b2427b950dd3c8320792ec) ) ROM_LOAD16_BYTE( "i00phv27.g3", 0x040001, 0x020000, CRC(a6b747f6) SHA1(6e194a2c0cef6fb812fbd68df5779a36633b0290) ) + MISSING_SOUND +ROM_END - ROM_REGION( 0x080000, "altrevs", 0 ) /* split into clones later */ +ROM_START( ep_highva ) + ROM_REGION( 0x080000, "maincpu", 0 ) ROM_LOAD16_BYTE( "i00nhv22.g0", 0x000000, 0x020000, CRC(4f97ea5c) SHA1(32744b8875362b5854338e9bbba0be7361c0661d) ) ROM_LOAD16_BYTE( "i00nhv22.g1", 0x000001, 0x020000, CRC(2c9a11f7) SHA1(f632dbe8387885adac31a3c3c14b25708250e4ad) ) + MISSING_SOUND +ROM_END + +ROM_START( ep_highvb ) + ROM_REGION( 0x080000, "maincpu", 0 ) ROM_LOAD16_BYTE( "i00nhv24.g0", 0x000000, 0x020000, CRC(4f97ea5c) SHA1(32744b8875362b5854338e9bbba0be7361c0661d) ) ROM_LOAD16_BYTE( "i00nhv24.g1", 0x000001, 0x020000, CRC(20d7bfc6) SHA1(39d573b5ddefe30b9805f4ecad1cc5a7e3505d63) ) + MISSING_SOUND +ROM_END + +ROM_START( ep_highvc ) + ROM_REGION( 0x080000, "maincpu", 0 ) ROM_LOAD16_BYTE( "i00nhv26.g0", 0x000000, 0x020000, CRC(1a022252) SHA1(1f1c4263459688e4418f98358b05e0f917c2a356) ) ROM_LOAD16_BYTE( "i00nhv26.g1", 0x000001, 0x020000, CRC(9fc52bcd) SHA1(eefdb1f8f7af993363efa2b666b887bed89f038d) ) ROM_LOAD16_BYTE( "i00nhv26.g2", 0x040000, 0x020000, CRC(8bbeba8d) SHA1(d5f39c5acd6ffe11c0b2427b950dd3c8320792ec) ) ROM_LOAD16_BYTE( "i00nhv26.g3", 0x040001, 0x020000, CRC(a6b747f6) SHA1(6e194a2c0cef6fb812fbd68df5779a36633b0290) ) + MISSING_SOUND +ROM_END + +ROM_START( ep_highvd ) + ROM_REGION( 0x080000, "maincpu", 0 ) ROM_LOAD16_BYTE( "i00phv23.g0", 0x000000, 0x020000, CRC(4f97ea5c) SHA1(32744b8875362b5854338e9bbba0be7361c0661d) ) ROM_LOAD16_BYTE( "i00phv23.g1", 0x000001, 0x020000, CRC(c70445cf) SHA1(b038c596e3c62638f641bf6848446a0b0827dd3e) ) + MISSING_SOUND +ROM_END + +ROM_START( ep_highve ) + ROM_REGION( 0x080000, "maincpu", 0 ) ROM_LOAD16_BYTE( "i00phv25.g0", 0x000000, 0x020000, CRC(4f97ea5c) SHA1(32744b8875362b5854338e9bbba0be7361c0661d) ) ROM_LOAD16_BYTE( "i00phv25.g1", 0x000001, 0x020000, CRC(cb49ebfe) SHA1(1de1042dee5a3b36cd09bfc0f175c0a3ab1bb095) ) + MISSING_SOUND +ROM_END - ROM_LOAD( "hi_volt.g0", 0x000000, 0x020000, CRC(863a7c78) SHA1(2de7fed4bd78508c1ae985ad97a4a265d5789c78) ) - ROM_LOAD( "hi_volt.g1", 0x000001, 0x020000, CRC(7c579950) SHA1(37e6edbfd0d969002fd98d2be824a9b85223d0ec) ) - +ROM_START( ep_highvf ) + ROM_REGION( 0x080000, "maincpu", 0 ) + ROM_LOAD16_BYTE( "hi_volt.g0", 0x000000, 0x020000, CRC(863a7c78) SHA1(2de7fed4bd78508c1ae985ad97a4a265d5789c78) ) + ROM_LOAD16_BYTE( "hi_volt.g1", 0x000001, 0x020000, CRC(7c579950) SHA1(37e6edbfd0d969002fd98d2be824a9b85223d0ec) ) MISSING_SOUND ROM_END @@ -2739,50 +2756,103 @@ ROM_START( ep_hogmn ) ROM_REGION( 0x080000, "maincpu", 0 ) ROM_LOAD16_BYTE( "i99nhm14.g0", 0x000000, 0x020000, CRC(51022b50) SHA1(47cb0d9b4a6012f87e12f07e2adcdd841d1e336a) ) ROM_LOAD16_BYTE( "i99nhm14.g1", 0x000001, 0x020000, CRC(dcdbabc3) SHA1(7ee8529787f68de5973fad385b5821c523a87294) ) + MISSING_SOUND +ROM_END - ROM_REGION( 0x080000, "altrevs", 0 ) /* split into clones later */ +ROM_START( ep_hogmna ) + ROM_REGION( 0x080000, "maincpu", 0 ) ROM_LOAD16_BYTE( "i99nhm16.g0", 0x000000, 0x020000, CRC(51022b50) SHA1(47cb0d9b4a6012f87e12f07e2adcdd841d1e336a) ) ROM_LOAD16_BYTE( "i99nhm16.g1", 0x000001, 0x020000, CRC(d09605f2) SHA1(f4c9ac144c43fd653a73394b70ddde3cae5ed2db) ) + MISSING_SOUND +ROM_END + +ROM_START( ep_hogmnb ) + ROM_REGION( 0x080000, "maincpu", 0 ) ROM_LOAD16_BYTE( "i99phm15.g0", 0x000000, 0x020000, CRC(51022b50) SHA1(47cb0d9b4a6012f87e12f07e2adcdd841d1e336a) ) ROM_LOAD16_BYTE( "i99phm15.g1", 0x000001, 0x020000, CRC(3745fffb) SHA1(f2e9839fa54a0d9a98158ea6352d4c10cf9fa78b) ) + MISSING_SOUND +ROM_END + +ROM_START( ep_hogmnc ) + ROM_REGION( 0x080000, "maincpu", 0 ) ROM_LOAD16_BYTE( "i99phm17.g0", 0x000000, 0x020000, CRC(51022b50) SHA1(47cb0d9b4a6012f87e12f07e2adcdd841d1e336a) ) ROM_LOAD16_BYTE( "i99phm17.g1", 0x000001, 0x020000, CRC(51022b50) SHA1(47cb0d9b4a6012f87e12f07e2adcdd841d1e336a) ) MISSING_SOUND ROM_END +#define EP_HOMER_SOUND \ + ROM_REGION( 0x100000, "ymz", 0 ) \ + ROM_LOAD( "homer.sn0", 0x000000, 0x080000, CRC(f276596d) SHA1(675679271da7dc71f0e93a8ce519c1a6214a467b) ) \ + ROM_LOAD( "homer.sn1", 0x080000, 0x080000, CRC(1820f976) SHA1(32c1af52906dd40494a002a66eb314bec74b3361) ) \ - -ROM_START( ep_hmmlt ) +ROM_START( ep_homer ) ROM_REGION( 0x080000, "maincpu", 0 ) - ROM_LOAD16_BYTE( "hom70g0", 0x000000, 0x020000, CRC(cd838170) SHA1(2dcb8729dafa69c4afe335cc48822341bd58fc4f) ) - ROM_LOAD16_BYTE( "hom70g1", 0x000001, 0x020000, CRC(36dad5a7) SHA1(d7ebe242d2364270ba2ff203fb068d159c7f6f97) ) - - ROM_REGION( 0x080000, "altrevs", 0 ) /* split into clones later */ - ROM_LOAD16_BYTE( "msa02180.g0", 0x000000, 0x020000, CRC(5e43d5e7) SHA1(6141654f549e21ae5fc08cc8106f0f0a60a962a6) ) - ROM_LOAD16_BYTE( "msa02180.g1", 0x000001, 0x020000, CRC(78f84d26) SHA1(7f82bbf32d2f892e813296ab2c4be1e21c4b560b) ) - ROM_LOAD16_BYTE( "msa02181.g0", 0x000000, 0x020000, CRC(f5a8a68f) SHA1(4adb5cd05690a76e520d3f38b652f2565cc35db0) ) - ROM_LOAD16_BYTE( "msa02181.g1", 0x000001, 0x020000, CRC(eaceca55) SHA1(77fcad1150f2607f4b39f51757fff732651be508) ) - ROM_LOAD16_BYTE( "msa02182.g0", 0x000000, 0x020000, CRC(ec0b8c7f) SHA1(4967fb5b9ba315e6900cc06b31ad068dba4ba501) ) - ROM_LOAD16_BYTE( "msa02182.g1", 0x000001, 0x020000, CRC(cda805b0) SHA1(b5d027d597bf8d97df98f9d72c5d377e5eee9af5) ) - ROM_LOAD16_BYTE( "msa02183.g0", 0x000000, 0x020000, CRC(82d9e9cf) SHA1(1c32d3dd34f522847541986bacf5ef86f005dec1) ) - ROM_LOAD16_BYTE( "msa02183.g1", 0x000001, 0x020000, CRC(10941569) SHA1(1819bd08e6d2049597e01a76c3b5444f5cba2e2f) ) - ROM_LOAD16_BYTE( "msa03310.g0", 0x000000, 0x020000, CRC(6d0ef840) SHA1(9ae8c0d0cd834af0cb9b2e3d0e116c63a4b1c6e4) ) - ROM_LOAD16_BYTE( "msa03310.g1", 0x000001, 0x020000, CRC(477707ff) SHA1(f4a78ddc2811e837969dfdc8b58d530bcbc54d13) ) - ROM_LOAD16_BYTE( "msa03311.g0", 0x000000, 0x020000, CRC(d6b0294d) SHA1(7081262e9ec98c0fd3fef1152988fefce2855849) ) - ROM_LOAD16_BYTE( "msa03311.g1", 0x000001, 0x020000, CRC(24d5dc7b) SHA1(060bc49b55dc97ae25677c8299d6f5381ca551d6) ) - ROM_LOAD16_BYTE( "msa03312.g0", 0x000000, 0x020000, CRC(ef90bd0e) SHA1(6d3242348139a31bfdf3a686ccc7f04332fc829e) ) - ROM_LOAD16_BYTE( "msa03312.g1", 0x000001, 0x020000, CRC(18780d61) SHA1(3f3a643cc2cac1f01660f8c5d3ddeaa70d2a4b3a) ) - ROM_LOAD16_BYTE( "msa03313.g0", 0x000000, 0x020000, CRC(a1e99c74) SHA1(569dd73821807026ad257d29aa338271a1da8477) ) - ROM_LOAD16_BYTE( "msa03313.g1", 0x000001, 0x020000, CRC(7b70fa94) SHA1(c223d396e63310c5e9a167577996a81a12ddbc8c) ) ROM_LOAD16_BYTE( "sa000070.g0", 0x000000, 0x020000, CRC(cd838170) SHA1(2dcb8729dafa69c4afe335cc48822341bd58fc4f) ) ROM_LOAD16_BYTE( "sa000070.g1", 0x000001, 0x020000, CRC(36dad5a7) SHA1(d7ebe242d2364270ba2ff203fb068d159c7f6f97) ) + EP_HOMER_SOUND +ROM_END +ROM_START( ep_homera ) + ROM_REGION( 0x080000, "maincpu", 0 ) + ROM_LOAD16_BYTE( "msa02180.g0", 0x000000, 0x020000, CRC(5e43d5e7) SHA1(6141654f549e21ae5fc08cc8106f0f0a60a962a6) ) + ROM_LOAD16_BYTE( "msa02180.g1", 0x000001, 0x020000, CRC(78f84d26) SHA1(7f82bbf32d2f892e813296ab2c4be1e21c4b560b) ) + EP_HOMER_SOUND +ROM_END + +ROM_START( ep_homerb ) + ROM_REGION( 0x080000, "maincpu", 0 ) + ROM_LOAD16_BYTE( "msa02181.g0", 0x000000, 0x020000, CRC(f5a8a68f) SHA1(4adb5cd05690a76e520d3f38b652f2565cc35db0) ) + ROM_LOAD16_BYTE( "msa02181.g1", 0x000001, 0x020000, CRC(eaceca55) SHA1(77fcad1150f2607f4b39f51757fff732651be508) ) + EP_HOMER_SOUND +ROM_END + +ROM_START( ep_homerc ) + ROM_REGION( 0x080000, "maincpu", 0 ) + ROM_LOAD16_BYTE( "msa02182.g0", 0x000000, 0x020000, CRC(ec0b8c7f) SHA1(4967fb5b9ba315e6900cc06b31ad068dba4ba501) ) + ROM_LOAD16_BYTE( "msa02182.g1", 0x000001, 0x020000, CRC(cda805b0) SHA1(b5d027d597bf8d97df98f9d72c5d377e5eee9af5) ) + EP_HOMER_SOUND +ROM_END + +ROM_START( ep_homerd ) + ROM_REGION( 0x080000, "maincpu", 0 ) + ROM_LOAD16_BYTE( "msa02183.g0", 0x000000, 0x020000, CRC(82d9e9cf) SHA1(1c32d3dd34f522847541986bacf5ef86f005dec1) ) + ROM_LOAD16_BYTE( "msa02183.g1", 0x000001, 0x020000, CRC(10941569) SHA1(1819bd08e6d2049597e01a76c3b5444f5cba2e2f) ) + EP_HOMER_SOUND +ROM_END + +ROM_START( ep_homere ) + ROM_REGION( 0x080000, "maincpu", 0 ) + ROM_LOAD16_BYTE( "msa03310.g0", 0x000000, 0x020000, CRC(6d0ef840) SHA1(9ae8c0d0cd834af0cb9b2e3d0e116c63a4b1c6e4) ) + ROM_LOAD16_BYTE( "msa03310.g1", 0x000001, 0x020000, CRC(477707ff) SHA1(f4a78ddc2811e837969dfdc8b58d530bcbc54d13) ) + EP_HOMER_SOUND +ROM_END + +ROM_START( ep_homerf ) + ROM_REGION( 0x080000, "maincpu", 0 ) + ROM_LOAD16_BYTE( "msa03311.g0", 0x000000, 0x020000, CRC(d6b0294d) SHA1(7081262e9ec98c0fd3fef1152988fefce2855849) ) + ROM_LOAD16_BYTE( "msa03311.g1", 0x000001, 0x020000, CRC(24d5dc7b) SHA1(060bc49b55dc97ae25677c8299d6f5381ca551d6) ) + EP_HOMER_SOUND +ROM_END + +ROM_START( ep_homerg ) + ROM_REGION( 0x080000, "maincpu", 0 ) + ROM_LOAD16_BYTE( "msa03312.g0", 0x000000, 0x020000, CRC(ef90bd0e) SHA1(6d3242348139a31bfdf3a686ccc7f04332fc829e) ) + ROM_LOAD16_BYTE( "msa03312.g1", 0x000001, 0x020000, CRC(18780d61) SHA1(3f3a643cc2cac1f01660f8c5d3ddeaa70d2a4b3a) ) + EP_HOMER_SOUND +ROM_END + +ROM_START( ep_homerh ) + ROM_REGION( 0x080000, "maincpu", 0 ) + ROM_LOAD16_BYTE( "msa03313.g0", 0x000000, 0x020000, CRC(a1e99c74) SHA1(569dd73821807026ad257d29aa338271a1da8477) ) + ROM_LOAD16_BYTE( "msa03313.g1", 0x000001, 0x020000, CRC(7b70fa94) SHA1(c223d396e63310c5e9a167577996a81a12ddbc8c) ) + EP_HOMER_SOUND +ROM_END + +ROM_START( ep_homeri ) + ROM_REGION( 0x080000, "maincpu", 0 ) ROM_LOAD16_BYTE( "homer.g0", 0x000000, 0x020000, CRC(f3414194) SHA1(446daaa729377dce2cbb70b31c7c651f245d5455) ) ROM_LOAD16_BYTE( "homer.g1", 0x000001, 0x020000, CRC(9a1c2fc2) SHA1(5166eb40797ceaa3a58f35b1a48f1b50c7684733) ) - - ROM_REGION( 0x100000, "ymz", 0 ) - ROM_LOAD( "homer.sn0", 0x000000, 0x080000, CRC(f276596d) SHA1(675679271da7dc71f0e93a8ce519c1a6214a467b) ) - ROM_LOAD( "homer.sn1", 0x080000, 0x080000, CRC(1820f976) SHA1(32c1af52906dd40494a002a66eb314bec74b3361) ) + EP_HOMER_SOUND ROM_END @@ -2794,8 +2864,11 @@ ROM_START( ep_htdgs ) ROM_LOAD16_BYTE( "i02nht04.g1", 0x000001, 0x020000, CRC(633e8071) SHA1(5c259e6241007cf0e7e7ee70b771834138e03c8f) ) ROM_LOAD16_BYTE( "i02nht04.g2", 0x040000, 0x020000, CRC(7dd6ab73) SHA1(5263834b9f566979f68d1efb2eb8c8b53e62da19) ) ROM_LOAD16_BYTE( "i02nht04.g3", 0x040001, 0x020000, CRC(1e7e309e) SHA1(1e34fc88e88f3a65d70d0cdb6cfdda7e7cd0f5cf) ) + MISSING_SOUND +ROM_END - ROM_REGION( 0x080000, "altrevs", 0 ) /* split into clones later */ +ROM_START( ep_htdgsa ) + ROM_REGION( 0x080000, "maincpu", 0 ) ROM_LOAD16_BYTE( "i02pht05.g0", 0x000000, 0x020000, CRC(80ef03f7) SHA1(00be10668f4d6e1ddad3997b3b45bfe814c59289) ) ROM_LOAD16_BYTE( "i02pht05.g1", 0x000001, 0x020000, CRC(88a0d449) SHA1(9bbceaaeb42802cfe661877327c94004663c7f2b) ) ROM_LOAD16_BYTE( "i02pht05.g2", 0x040000, 0x020000, CRC(7dd6ab73) SHA1(5263834b9f566979f68d1efb2eb8c8b53e62da19) ) @@ -2812,8 +2885,11 @@ ROM_START( ep_hubbl ) ROM_LOAD16_BYTE( "ghb01_1.bin", 0x000001, 0x020000, CRC(ad78b0d2) SHA1(fe5f38d8cbb892f5e5149d340dee24a8b2ccec45) ) ROM_LOAD16_BYTE( "ghb01_2.bin", 0x040000, 0x020000, CRC(c31cdd3d) SHA1(07793b5e90364ca2d655ecb7562c8b6948d0e83c) ) ROM_LOAD16_BYTE( "ghb01_3.bin", 0x040001, 0x020000, CRC(052fbc2f) SHA1(e198639752ae790a8c9bd1b67b7805479d88bf4c) ) + MISSING_SOUND +ROM_END - ROM_REGION( 0x080000, "altrevs", 0 ) /* split into clones later */ +ROM_START( ep_hubbla ) + ROM_REGION( 0x080000, "maincpu", 0 ) ROM_LOAD16_BYTE( "ghb02_0.bin", 0x000000, 0x020000, CRC(8dbe4c7a) SHA1(f84089a6d8fc048e0721eb1375050e8ff553f852) ) ROM_LOAD16_BYTE( "ghb02_1.bin", 0x000001, 0x020000, CRC(46e6e4ea) SHA1(ddffa3aae9065c5af49f10d82d40187ae22bcefa) ) ROM_LOAD16_BYTE( "ghb02_2.bin", 0x040000, 0x020000, CRC(c31cdd3d) SHA1(07793b5e90364ca2d655ecb7562c8b6948d0e83c) ) @@ -2821,51 +2897,76 @@ ROM_START( ep_hubbl ) MISSING_SOUND ROM_END - +#define EP_HURIC_SOUND \ + ROM_REGION( 0x100000, "ymz", 0 ) /* one of these pairs is probably a different game */ \ + ROM_LOAD( "huricane.sn0", 0x000000, 0x080000, CRC(b34b4667) SHA1(8b0b7b3668506de8433aa662556118a8b0e203d6) ) \ + ROM_LOAD( "huricane.sn1", 0x080000, 0x080000, CRC(324e255d) SHA1(6a30a512f19774b99bdbc14026a3b1cbfb65fe6d) ) \ + ROM_LOAD( "hurrican.s0", 0x000000, 0x080000, CRC(a50f8fa5) SHA1(bde27c5b536cdc97384adb3c2eb842d1c31eddde) ) \ + ROM_LOAD( "hurrican.s1", 0x080000, 0x080000, CRC(22412ebf) SHA1(36fa6da835f2a1f005d08b8e1c6bde9b0fb3ef6b) ) \ ROM_START( ep_huric ) ROM_REGION( 0x080000, "maincpu", 0 ) ROM_LOAD16_BYTE( "i00nhu22.g0", 0x000000, 0x020000, CRC(f2d002f8) SHA1(f00b4f8fc0b69d81a2d5a1e02e1e428f1a446e82) ) ROM_LOAD16_BYTE( "i00nhu22.g1", 0x000001, 0x020000, CRC(570bca8c) SHA1(a9068817df689ef98980a2d7ad50d31983beff7f) ) + EP_HURIC_SOUND +ROM_END - ROM_REGION( 0x080000, "altrevs", 0 ) /* split into clones later */ +ROM_START( ep_hurica ) + ROM_REGION( 0x080000, "maincpu", 0 ) ROM_LOAD16_BYTE( "i00nhu24.g0", 0x000000, 0x020000, CRC(f2d002f8) SHA1(f00b4f8fc0b69d81a2d5a1e02e1e428f1a446e82) ) ROM_LOAD16_BYTE( "i00nhu24.g1", 0x000001, 0x020000, CRC(5b4664bd) SHA1(881b998949c21e033b3c0b2127b3552abe388e7e) ) + EP_HURIC_SOUND +ROM_END + +ROM_START( ep_huricb ) + ROM_REGION( 0x080000, "maincpu", 0 ) ROM_LOAD16_BYTE( "i00nhu26.g0", 0x000000, 0x020000, CRC(301fc753) SHA1(e829657a22270ee5202fbbe1b7e435fe7829f760) ) ROM_LOAD16_BYTE( "i00nhu26.g1", 0x000001, 0x020000, CRC(11273c81) SHA1(e6ecf638c200a9e52416b7d4e4bd4c035418e4a4) ) ROM_LOAD16_BYTE( "i00nhu26.g2", 0x040000, 0x020000, CRC(fde78ab3) SHA1(9eb3a38bafaf2a10657421da00629c89723db93a) ) ROM_LOAD16_BYTE( "i00nhu26.g3", 0x040001, 0x020000, CRC(18e3ec99) SHA1(0f79fc837afe1953e0e49c8a191baf44b5ac11be) ) + EP_HURIC_SOUND +ROM_END + +ROM_START( ep_huricc ) + ROM_REGION( 0x080000, "maincpu", 0 ) ROM_LOAD16_BYTE( "i00phu23.g0", 0x000000, 0x020000, CRC(f2d002f8) SHA1(f00b4f8fc0b69d81a2d5a1e02e1e428f1a446e82) ) ROM_LOAD16_BYTE( "i00phu23.g1", 0x000001, 0x020000, CRC(bc959eb4) SHA1(8324141a8cf6d9f18e732fd7e5666a3783c39230) ) + EP_HURIC_SOUND +ROM_END + +ROM_START( ep_huricd ) + ROM_REGION( 0x080000, "maincpu", 0 ) ROM_LOAD16_BYTE( "i00phu25.g0", 0x000000, 0x020000, CRC(f2d002f8) SHA1(f00b4f8fc0b69d81a2d5a1e02e1e428f1a446e82) ) ROM_LOAD16_BYTE( "i00phu25.g1", 0x000001, 0x020000, CRC(b0d83085) SHA1(9c681228da7ae89df3a7de1a759aaf27eb001dd1) ) + EP_HURIC_SOUND +ROM_END + +ROM_START( ep_hurice ) + ROM_REGION( 0x080000, "maincpu", 0 ) ROM_LOAD16_BYTE( "i00phu27.g0", 0x000000, 0x020000, CRC(301fc753) SHA1(e829657a22270ee5202fbbe1b7e435fe7829f760) ) ROM_LOAD16_BYTE( "i00phu27.g1", 0x000001, 0x020000, CRC(fab968b9) SHA1(e281309b414fdeaed2cc13eeef75f0a1ef733854) ) ROM_LOAD16_BYTE( "i00phu27.g2", 0x040000, 0x020000, CRC(fde78ab3) SHA1(9eb3a38bafaf2a10657421da00629c89723db93a) ) ROM_LOAD16_BYTE( "i00phu27.g3", 0x040001, 0x020000, CRC(18e3ec99) SHA1(0f79fc837afe1953e0e49c8a191baf44b5ac11be) ) - - ROM_REGION( 0x100000, "ymz", 0 ) - // one of these pairs is probably a different game - ROM_LOAD( "huricane.sn0", 0x000000, 0x080000, CRC(b34b4667) SHA1(8b0b7b3668506de8433aa662556118a8b0e203d6) ) - ROM_LOAD( "huricane.sn1", 0x080000, 0x080000, CRC(324e255d) SHA1(6a30a512f19774b99bdbc14026a3b1cbfb65fe6d) ) - ROM_LOAD( "hurrican.s0", 0x000000, 0x080000, CRC(a50f8fa5) SHA1(bde27c5b536cdc97384adb3c2eb842d1c31eddde) ) - ROM_LOAD( "hurrican.s1", 0x080000, 0x080000, CRC(22412ebf) SHA1(36fa6da835f2a1f005d08b8e1c6bde9b0fb3ef6b) ) - - + EP_HURIC_SOUND ROM_END + + ROM_START( ep_hyst ) ROM_REGION( 0x080000, "maincpu", 0 ) ROM_LOAD16_BYTE( "i01nhy13.g0", 0x000000, 0x020000, CRC(fb370893) SHA1(aea6c410f7426e2a3bdd54c784d0f48e22e212be) ) ROM_LOAD16_BYTE( "i01nhy13.g1", 0x000001, 0x020000, CRC(73434105) SHA1(1b908589b12d6f8feeb8f1415e38589ae11b103f) ) ROM_LOAD16_BYTE( "i01nhy13.g2", 0x040000, 0x020000, CRC(70f52648) SHA1(8233c2185034be43a0818f137fa20ddf09543b18) ) ROM_LOAD16_BYTE( "i01nhy13.g3", 0x040001, 0x020000, CRC(6c469fa8) SHA1(fe3ae2a2e72fcf54982b30205526e6cf5a11d113) ) + MISSING_SOUND +ROM_END - ROM_REGION( 0x080000, "altrevs", 0 ) /* split into clones later */ +ROM_START( ep_hysta ) + ROM_REGION( 0x080000, "maincpu", 0 ) ROM_LOAD16_BYTE( "i01phy14.g0", 0x000000, 0x020000, CRC(fb370893) SHA1(aea6c410f7426e2a3bdd54c784d0f48e22e212be) ) ROM_LOAD16_BYTE( "i01phy14.g1", 0x000001, 0x020000, CRC(98dd153d) SHA1(b303cb7a807eb928562d04a48b35a06b79d7a9b1) ) ROM_LOAD16_BYTE( "i01phy14.g2", 0x040000, 0x020000, CRC(70f52648) SHA1(8233c2185034be43a0818f137fa20ddf09543b18) ) @@ -2882,40 +2983,83 @@ ROM_START( ep_icebg ) ROM_LOAD16_BYTE( "msa02234.g1", 0x000001, 0x020000, CRC(6b94f722) SHA1(0af64c7e5285de158b153581baa3fc1831f89740) ) ROM_LOAD16_BYTE( "msa02234.g2", 0x040000, 0x020000, CRC(a01880b5) SHA1(50e5e44088b171a98424cea86e8482dc5a5401ee) ) ROM_LOAD16_BYTE( "msa02234.g3", 0x040001, 0x020000, CRC(a9369209) SHA1(e6c691266c5ca2db5193be0ef92720dae479eb8b) ) + MISSING_SOUND +ROM_END - ROM_REGION( 0x080000, "altrevs", 0 ) /* split into clones later */ +ROM_START( ep_icebga ) + ROM_REGION( 0x080000, "maincpu", 0 ) ROM_LOAD16_BYTE( "msa02235.g0", 0x000000, 0x020000, CRC(5358ad0e) SHA1(551a37c1bc45cd362237324986184683757ff725) ) ROM_LOAD16_BYTE( "msa02235.g1", 0x000001, 0x020000, CRC(31b5aebb) SHA1(09a6b0650e3f144f4c56c340ddaa8486ed14450c) ) ROM_LOAD16_BYTE( "msa02235.g2", 0x040000, 0x020000, CRC(a01880b5) SHA1(50e5e44088b171a98424cea86e8482dc5a5401ee) ) ROM_LOAD16_BYTE( "msa02235.g3", 0x040001, 0x020000, CRC(a9369209) SHA1(e6c691266c5ca2db5193be0ef92720dae479eb8b) ) + MISSING_SOUND +ROM_END + +ROM_START( ep_icebgb ) + ROM_REGION( 0x080000, "maincpu", 0 ) ROM_LOAD16_BYTE( "msa02240.g0", 0x000000, 0x020000, CRC(c46daa51) SHA1(fe2104761d60f991b133946d11ea8c197127e356) ) ROM_LOAD16_BYTE( "msa02240.g1", 0x000001, 0x020000, CRC(4539d934) SHA1(43207468fc0ddb506266b6b610e067b847f806da) ) ROM_LOAD16_BYTE( "msa02240.g2", 0x040000, 0x020000, CRC(18329ff8) SHA1(fd6e3f00561a812fd9fe21ccabd21a88dd8388a3) ) ROM_LOAD16_BYTE( "msa02240.g3", 0x040001, 0x020000, CRC(c9a11d2e) SHA1(1129f3ad2e62f13eb5250a196d2a8ec574dad588) ) + MISSING_SOUND +ROM_END + +ROM_START( ep_icebgc ) + ROM_REGION( 0x080000, "maincpu", 0 ) ROM_LOAD16_BYTE( "msa02241.g0", 0x000000, 0x020000, CRC(b58e1659) SHA1(2a62e167b43411f687a827141493288a948bc8fd) ) ROM_LOAD16_BYTE( "msa02241.g1", 0x000001, 0x020000, CRC(69740e8e) SHA1(921ae1add38e9ac6c9632c7fd71486480b6c92bf) ) ROM_LOAD16_BYTE( "msa02241.g2", 0x040000, 0x020000, CRC(18329ff8) SHA1(fd6e3f00561a812fd9fe21ccabd21a88dd8388a3) ) ROM_LOAD16_BYTE( "msa02241.g3", 0x040001, 0x020000, CRC(c9a11d2e) SHA1(1129f3ad2e62f13eb5250a196d2a8ec574dad588) ) + MISSING_SOUND +ROM_END + +ROM_START( ep_icebgd ) + ROM_REGION( 0x080000, "maincpu", 0 ) ROM_LOAD16_BYTE( "msa02256.g0", 0x000000, 0x020000, CRC(010a41c8) SHA1(750cad7cec4cf40a7eec6b1b30a53fd911690139) ) ROM_LOAD16_BYTE( "msa02256.g1", 0x000001, 0x020000, CRC(cbc7d405) SHA1(f6cfc2bbcae5ccde77f5b16f15e1af942eb438a3) ) ROM_LOAD16_BYTE( "msa02256.g2", 0x040000, 0x020000, CRC(2110809b) SHA1(9a23901c578ca237067ad912947df47d7112709f) ) ROM_LOAD16_BYTE( "msa02256.g3", 0x040001, 0x020000, CRC(450b8bc6) SHA1(1c099b692fde54584183e9c306d21194f51823ad) ) + MISSING_SOUND +ROM_END + +ROM_START( ep_icebge ) + ROM_REGION( 0x080000, "maincpu", 0 ) ROM_LOAD16_BYTE( "msa02257.g0", 0x000000, 0x020000, CRC(db495d9b) SHA1(295825d08b77ab8d87d936b522b2f36fbcc5749f) ) ROM_LOAD16_BYTE( "msa02257.g1", 0x000001, 0x020000, CRC(9bfad602) SHA1(04971c5d57da21f1acada9903050da00a258923a) ) ROM_LOAD16_BYTE( "msa02257.g2", 0x040000, 0x020000, CRC(2110809b) SHA1(9a23901c578ca237067ad912947df47d7112709f) ) ROM_LOAD16_BYTE( "msa02257.g3", 0x040001, 0x020000, CRC(450b8bc6) SHA1(1c099b692fde54584183e9c306d21194f51823ad) ) + MISSING_SOUND +ROM_END + +ROM_START( ep_icebgf ) + ROM_REGION( 0x080000, "maincpu", 0 ) ROM_LOAD16_BYTE( "msa03304.g0", 0x000000, 0x020000, CRC(d38cbb80) SHA1(595cc4ea91d4552495adb51586ada82ba1c2be03) ) ROM_LOAD16_BYTE( "msa03304.g1", 0x000001, 0x020000, CRC(0ab3bd1f) SHA1(4dbc01aee01c1a6af7a5deb804b45de5b65e334d) ) ROM_LOAD16_BYTE( "msa03304.g2", 0x040000, 0x020000, CRC(433b7c7e) SHA1(2c2825892bf6c4545fbca5a4dc776fd3147373c2) ) ROM_LOAD16_BYTE( "msa03304.g3", 0x040001, 0x020000, CRC(d59e6ab0) SHA1(6a7ea535b4ee4ec4de792f8992f6fd8f885a5055) ) + MISSING_SOUND +ROM_END + +ROM_START( ep_icebgg ) + ROM_REGION( 0x080000, "maincpu", 0 ) ROM_LOAD16_BYTE( "msa03305.g0", 0x000000, 0x020000, CRC(7867c8e8) SHA1(e76583b1367f6f85ebd04a5531240a745942b3a1) ) ROM_LOAD16_BYTE( "msa03305.g1", 0x000001, 0x020000, CRC(e7e67097) SHA1(def18f6592e666754785e4770dd84c4ea8e42ecb) ) ROM_LOAD16_BYTE( "msa03305.g2", 0x040000, 0x020000, CRC(433b7c7e) SHA1(2c2825892bf6c4545fbca5a4dc776fd3147373c2) ) ROM_LOAD16_BYTE( "msa03305.g3", 0x040001, 0x020000, CRC(d59e6ab0) SHA1(6a7ea535b4ee4ec4de792f8992f6fd8f885a5055) ) + MISSING_SOUND +ROM_END + +ROM_START( ep_icebgh ) + ROM_REGION( 0x080000, "maincpu", 0 ) ROM_LOAD16_BYTE( "msa03323.g0", 0x000000, 0x020000, CRC(307777d4) SHA1(99af73b8ede92ad68af2e9fff7c1a8f8507adb50) ) ROM_LOAD16_BYTE( "msa03323.g1", 0x000001, 0x020000, CRC(ece3a31b) SHA1(af566b42d7c9a49dd400caed391c06eda959ea4b) ) ROM_LOAD16_BYTE( "msa03323.g2", 0x040000, 0x020000, CRC(8a4111ca) SHA1(f107d6491ee1d7bcf19c513d97971d82c16250b2) ) ROM_LOAD16_BYTE( "msa03323.g3", 0x040001, 0x020000, CRC(ea4b3432) SHA1(a4c832adcfd7835493683387c3de7546a38bc036) ) + MISSING_SOUND +ROM_END + +ROM_START( ep_icebgi ) + ROM_REGION( 0x080000, "maincpu", 0 ) ROM_LOAD16_BYTE( "msa03324.g0", 0x000000, 0x020000, CRC(d505234e) SHA1(edf1047ce38f68208f7eeb31b76a5989bc9e8325) ) ROM_LOAD16_BYTE( "msa03324.g1", 0x000001, 0x020000, CRC(4c06195d) SHA1(c7d47fe63ab11a4a426c5d9d2031e8d8edaef9c0) ) ROM_LOAD16_BYTE( "msa03324.g2", 0x040000, 0x020000, CRC(8a4111ca) SHA1(f107d6491ee1d7bcf19c513d97971d82c16250b2) ) @@ -5269,11 +5413,10 @@ GAME( 1999, ep_simpe, ep_simp, maygayep, maygayep, 0, ROT0, "Maygay", GAME( 1999, ep_simpf, ep_simp, maygayep, maygayep, 0, ROT0, "Maygay", "The Simpsons (Maygay) (EPOCH) (set 7)",GAME_IS_SKELETON_MECHANICAL ) GAME( 1999, ep_simpg, ep_simp, maygayep, maygayep, 0, ROT0, "Maygay", "The Simpsons (Maygay) (EPOCH) (set 8)",GAME_IS_SKELETON_MECHANICAL ) GAME( 1999, ep_simph, ep_simp, maygayep, maygayep, 0, ROT0, "Maygay", "The Simpsons (Maygay) (EPOCH) (set 9)",GAME_IS_SKELETON_MECHANICAL ) -GAME( 1999, ep_simpi, ep_simp, maygayep, maygayep, 0, ROT0, "Maygay", "The Simpsons (Maygay) (EPOCH) (set 10)",GAME_IS_SKELETON_MECHANICAL ) -GAME( 1999, ep_simpj, ep_simp, maygayep, maygayep, 0, ROT0, "Maygay", "The Simpsons (Maygay) (EPOCH) (set 11)",GAME_IS_SKELETON_MECHANICAL ) -GAME( 1999, ep_simpk, ep_simp, maygayep, maygayep, 0, ROT0, "Maygay", "The Simpsons (Maygay) (EPOCH) (set 12)",GAME_IS_SKELETON_MECHANICAL ) -GAME( 1999, ep_simpl, ep_simp, maygayep, maygayep, 0, ROT0, "Maygay", "The Simpsons (Maygay) (EPOCH) (set 13)",GAME_IS_SKELETON_MECHANICAL ) -GAME( 1999, ep_simpm, ep_simp, maygayep, maygayep, 0, ROT0, "Maygay", "The Simpsons (Maygay) (EPOCH) (set 14)",GAME_IS_SKELETON_MECHANICAL ) +GAME( 1999, ep_simpj, ep_simp, maygayep, maygayep, 0, ROT0, "Maygay", "The Simpsons (Maygay) (EPOCH) (set 10)",GAME_IS_SKELETON_MECHANICAL ) +GAME( 1999, ep_simpk, ep_simp, maygayep, maygayep, 0, ROT0, "Maygay", "The Simpsons (Maygay) (EPOCH) (set 11)",GAME_IS_SKELETON_MECHANICAL ) +GAME( 1999, ep_simpl, ep_simp, maygayep, maygayep, 0, ROT0, "Maygay", "The Simpsons (Maygay) (EPOCH) (set 12)",GAME_IS_SKELETON_MECHANICAL ) +GAME( 1999, ep_simpm, ep_simp, maygayep, maygayep, 0, ROT0, "Maygay", "The Simpsons (Maygay) (EPOCH) (set 13)",GAME_IS_SKELETON_MECHANICAL ) GAME( 199?, ep_dblim, 0, maygayep, maygayep, 0, ROT0, "Maygay", "Double Impact (Maygay - Impulse) (EPOCH) (set 1)",GAME_IS_SKELETON_MECHANICAL ) GAME( 199?, ep_dblima, ep_dblim, maygayep, maygayep, 0, ROT0, "Maygay", "Double Impact (Maygay - Impulse) (EPOCH) (set 2)",GAME_IS_SKELETON_MECHANICAL ) @@ -5290,8 +5433,7 @@ GAME( 199?, ep_wipeo, 0, maygayep, maygayep, 0, ROT0, "Maygay", "Wip GAME( 199?, ep_wipeoa, ep_wipeo, maygayep, maygayep, 0, ROT0, "Maygay", "Wipeout (Maygay) (EPOCH) (set 2)",GAME_IS_SKELETON_MECHANICAL ) GAME( 199?, ep_wipeob, ep_wipeo, maygayep, maygayep, 0, ROT0, "Maygay", "Wipeout (Maygay) (EPOCH) (set 3)",GAME_IS_SKELETON_MECHANICAL ) GAME( 199?, ep_wipeoc, ep_wipeo, maygayep, maygayep, 0, ROT0, "Maygay", "Wipeout (Maygay) (EPOCH) (set 4)",GAME_IS_SKELETON_MECHANICAL ) -GAME( 199?, ep_wipeod, ep_wipeo, maygayep, maygayep, 0, ROT0, "Maygay", "Wipeout (Maygay) (EPOCH) (set 5)",GAME_IS_SKELETON_MECHANICAL ) -GAME( 199?, ep_wipeoe, ep_wipeo, maygayep, maygayep, 0, ROT0, "Maygay", "Wipeout (Maygay) (EPOCH) (set 6)",GAME_IS_SKELETON_MECHANICAL ) +GAME( 199?, ep_wipeoe, ep_wipeo, maygayep, maygayep, 0, ROT0, "Maygay", "Wipeout (Maygay) (EPOCH) (set 5)",GAME_IS_SKELETON_MECHANICAL ) GAME( 199?, ep_bingb, 0, maygayep, maygayep, 0, ROT0, "Maygay", "Bingo Belle (Maygay) (EPOCH) (set 1)",GAME_IS_SKELETON_MECHANICAL ) GAME( 199?, ep_bingba, ep_bingb, maygayep, maygayep, 0, ROT0, "Maygay", "Bingo Belle (Maygay) (EPOCH) (set 2)",GAME_IS_SKELETON_MECHANICAL ) @@ -5312,9 +5454,8 @@ GAME( 199?, ep_cfallf, ep_cfall, maygayep, maygayep, 0, ROT0, "Maygay", GAME( 199?, ep_cflow, 0, maygayep, maygayep, 0, ROT0, "Maygay", "Cash Flow (Maygay) (EPOCH) (set 1)",GAME_IS_SKELETON_MECHANICAL ) GAME( 199?, ep_cflowa, ep_cflow, maygayep, maygayep, 0, ROT0, "Maygay", "Cash Flow (Maygay) (EPOCH) (set 2)",GAME_IS_SKELETON_MECHANICAL ) -GAME( 199?, ep_cflowb, ep_cflow, maygayep, maygayep, 0, ROT0, "Maygay", "Cash Flow (Maygay) (EPOCH) (set 3)",GAME_IS_SKELETON_MECHANICAL ) -GAME( 199?, ep_cflowc, ep_cflow, maygayep, maygayep, 0, ROT0, "Maygay", "Cash Flow (Maygay) (EPOCH) (set 4)",GAME_IS_SKELETON_MECHANICAL ) -GAME( 199?, ep_cflowd, ep_cflow, maygayep, maygayep, 0, ROT0, "Maygay", "Cash Flow (Maygay) (EPOCH) (set 5)",GAME_IS_SKELETON_MECHANICAL ) +GAME( 199?, ep_cflowc, ep_cflow, maygayep, maygayep, 0, ROT0, "Maygay", "Cash Flow (Maygay) (EPOCH) (set 3)",GAME_IS_SKELETON_MECHANICAL ) +GAME( 199?, ep_cflowd, ep_cflow, maygayep, maygayep, 0, ROT0, "Maygay", "Cash Flow (Maygay) (EPOCH) (set 4)",GAME_IS_SKELETON_MECHANICAL ) GAME( 199?, ep_doubl, 0, maygayep, maygayep, 0, ROT0, "Maygay", "Double Top (Maygay) (EPOCH) (set 1)",GAME_IS_SKELETON_MECHANICAL ) GAME( 199?, ep_doubla, ep_doubl, maygayep, maygayep, 0, ROT0, "Maygay", "Double Top (Maygay) (EPOCH) (set 2)",GAME_IS_SKELETON_MECHANICAL ) @@ -5551,16 +5692,65 @@ GAME( 199?, ep_gridrb, ep_gridr, maygayep, maygayep, 0, ROT0, "Maygay", GAME( 199?, ep_gridrc, ep_gridr, maygayep, maygayep, 0, ROT0, "Maygay", "Gridrunner (Maygay - Impulse) (EPOCH) (set 4)",GAME_IS_SKELETON_MECHANICAL ) GAME( 199?, ep_gridrd, ep_gridr, maygayep, maygayep, 0, ROT0, "Maygay", "Gridrunner (Maygay - Impulse) (EPOCH) (set 5)",GAME_IS_SKELETON_MECHANICAL ) -GAME( 199?, ep_hhclb, 0, maygayep, maygayep, 0, ROT0, "Maygay", "Haunted House Club (Maygay) (EPOCH)",GAME_IS_SKELETON_MECHANICAL ) -GAME( 199?, ep_hvns, 0, maygayep, maygayep, 0, ROT0, "Maygay", "Heavens Above (Maygay) (EPOCH)",GAME_IS_SKELETON_MECHANICAL ) -GAME( 199?, ep_highv, 0, maygayep, maygayep, 0, ROT0, "Maygay", "High Voltage (Maygay - Impulse) (EPOCH)",GAME_IS_SKELETON_MECHANICAL ) -GAME( 199?, ep_hogmn, 0, maygayep, maygayep, 0, ROT0, "Maygay", "Hog Money (Maygay - Impulse) (EPOCH)",GAME_IS_SKELETON_MECHANICAL ) -GAME( 199?, ep_hmmlt, 0, maygayep, maygayep, 0, ROT0, "Maygay", "Homer's Meltdown (Maygay) (EPOCH)",GAME_IS_SKELETON_MECHANICAL ) -GAME( 199?, ep_htdgs, 0, maygayep, maygayep, 0, ROT0, "Maygay", "Hot Dogs (Maygay) (EPOCH)",GAME_IS_SKELETON_MECHANICAL ) -GAME( 199?, ep_hubbl, 0, maygayep, maygayep, 0, ROT0, "Maygay", "Hubble Bubble (Maygay) (EPOCH)",GAME_IS_SKELETON_MECHANICAL ) -GAME( 199?, ep_huric, 0, maygayep, maygayep, 0, ROT0, "Maygay", "Hurricane (Maygay - Impulse) (EPOCH)",GAME_IS_SKELETON_MECHANICAL ) -GAME( 199?, ep_hyst, 0, maygayep, maygayep, 0, ROT0, "Maygay", "Hysteria (Maygay - Impulse) (EPOCH)",GAME_IS_SKELETON_MECHANICAL ) -GAME( 199?, ep_icebg, 0, maygayep, maygayep, 0, ROT0, "Maygay", "Ice Burger (Maygay) (EPOCH)",GAME_IS_SKELETON_MECHANICAL ) +GAME( 199?, ep_hhclb, 0, maygayep, maygayep, 0, ROT0, "Maygay", "Haunted House Club (Maygay) (EPOCH) (set 1)",GAME_IS_SKELETON_MECHANICAL ) +GAME( 199?, ep_hhclba, ep_hhclb, maygayep, maygayep, 0, ROT0, "Maygay", "Haunted House Club (Maygay) (EPOCH) (set 2)",GAME_IS_SKELETON_MECHANICAL ) +GAME( 199?, ep_hhclbb, ep_hhclb, maygayep, maygayep, 0, ROT0, "Maygay", "Haunted House Club (Maygay) (EPOCH) (set 3)",GAME_IS_SKELETON_MECHANICAL ) +GAME( 199?, ep_hhclbc, ep_hhclb, maygayep, maygayep, 0, ROT0, "Maygay", "Haunted House Club (Maygay) (EPOCH) (set 4)",GAME_IS_SKELETON_MECHANICAL ) + +GAME( 199?, ep_hvns, 0, maygayep, maygayep, 0, ROT0, "Maygay", "Heavens Above (Maygay) (EPOCH) (set 1)",GAME_IS_SKELETON_MECHANICAL ) +GAME( 199?, ep_hvnsa, ep_hvns, maygayep, maygayep, 0, ROT0, "Maygay", "Heavens Above (Maygay) (EPOCH) (set 2)",GAME_IS_SKELETON_MECHANICAL ) + +GAME( 199?, ep_highv, 0, maygayep, maygayep, 0, ROT0, "Maygay", "High Voltage (Maygay - Impulse) (EPOCH) (set 1)",GAME_IS_SKELETON_MECHANICAL ) +GAME( 199?, ep_highva, ep_highv, maygayep, maygayep, 0, ROT0, "Maygay", "High Voltage (Maygay - Impulse) (EPOCH) (set 2)",GAME_IS_SKELETON_MECHANICAL ) +GAME( 199?, ep_highvb, ep_highv, maygayep, maygayep, 0, ROT0, "Maygay", "High Voltage (Maygay - Impulse) (EPOCH) (set 3)",GAME_IS_SKELETON_MECHANICAL ) +GAME( 199?, ep_highvc, ep_highv, maygayep, maygayep, 0, ROT0, "Maygay", "High Voltage (Maygay - Impulse) (EPOCH) (set 4)",GAME_IS_SKELETON_MECHANICAL ) +GAME( 199?, ep_highvd, ep_highv, maygayep, maygayep, 0, ROT0, "Maygay", "High Voltage (Maygay - Impulse) (EPOCH) (set 5)",GAME_IS_SKELETON_MECHANICAL ) +GAME( 199?, ep_highve, ep_highv, maygayep, maygayep, 0, ROT0, "Maygay", "High Voltage (Maygay - Impulse) (EPOCH) (set 6)",GAME_IS_SKELETON_MECHANICAL ) +GAME( 199?, ep_highvf, ep_highv, maygayep, maygayep, 0, ROT0, "Maygay", "High Voltage (Maygay - Impulse) (EPOCH) (set 7)",GAME_IS_SKELETON_MECHANICAL ) + +GAME( 199?, ep_hogmn, 0, maygayep, maygayep, 0, ROT0, "Maygay", "Hog Money (Maygay - Impulse) (EPOCH) (set 1)",GAME_IS_SKELETON_MECHANICAL ) +GAME( 199?, ep_hogmna, ep_hogmn, maygayep, maygayep, 0, ROT0, "Maygay", "Hog Money (Maygay - Impulse) (EPOCH) (set 2)",GAME_IS_SKELETON_MECHANICAL ) +GAME( 199?, ep_hogmnb, ep_hogmn, maygayep, maygayep, 0, ROT0, "Maygay", "Hog Money (Maygay - Impulse) (EPOCH) (set 3)",GAME_IS_SKELETON_MECHANICAL ) +GAME( 199?, ep_hogmnc, ep_hogmn, maygayep, maygayep, 0, ROT0, "Maygay", "Hog Money (Maygay - Impulse) (EPOCH) (set 4)",GAME_IS_SKELETON_MECHANICAL ) + +GAME( 199?, ep_homer, 0, maygayep, maygayep, 0, ROT0, "Maygay", "The Simpsons - Homer's Meltdown (Maygay) (EPOCH) (set 1)",GAME_IS_SKELETON_MECHANICAL ) +GAME( 199?, ep_homera, ep_homer, maygayep, maygayep, 0, ROT0, "Maygay", "The Simpsons - Homer's Meltdown (Maygay) (EPOCH) (set 2)",GAME_IS_SKELETON_MECHANICAL ) +GAME( 199?, ep_homerb, ep_homer, maygayep, maygayep, 0, ROT0, "Maygay", "The Simpsons - Homer's Meltdown (Maygay) (EPOCH) (set 3)",GAME_IS_SKELETON_MECHANICAL ) +GAME( 199?, ep_homerc, ep_homer, maygayep, maygayep, 0, ROT0, "Maygay", "The Simpsons - Homer's Meltdown (Maygay) (EPOCH) (set 4)",GAME_IS_SKELETON_MECHANICAL ) +GAME( 199?, ep_homerd, ep_homer, maygayep, maygayep, 0, ROT0, "Maygay", "The Simpsons - Homer's Meltdown (Maygay) (EPOCH) (set 5)",GAME_IS_SKELETON_MECHANICAL ) +GAME( 199?, ep_homere, ep_homer, maygayep, maygayep, 0, ROT0, "Maygay", "The Simpsons - Homer's Meltdown (Maygay) (EPOCH) (set 6)",GAME_IS_SKELETON_MECHANICAL ) +GAME( 199?, ep_homerf, ep_homer, maygayep, maygayep, 0, ROT0, "Maygay", "The Simpsons - Homer's Meltdown (Maygay) (EPOCH) (set 7)",GAME_IS_SKELETON_MECHANICAL ) +GAME( 199?, ep_homerg, ep_homer, maygayep, maygayep, 0, ROT0, "Maygay", "The Simpsons - Homer's Meltdown (Maygay) (EPOCH) (set 8)",GAME_IS_SKELETON_MECHANICAL ) +GAME( 199?, ep_homerh, ep_homer, maygayep, maygayep, 0, ROT0, "Maygay", "The Simpsons - Homer's Meltdown (Maygay) (EPOCH) (set 9)",GAME_IS_SKELETON_MECHANICAL ) +GAME( 199?, ep_homeri, ep_homer, maygayep, maygayep, 0, ROT0, "Maygay", "The Simpsons - Homer's Meltdown (Maygay) (EPOCH) (set 10)",GAME_IS_SKELETON_MECHANICAL ) + +GAME( 199?, ep_htdgs, 0, maygayep, maygayep, 0, ROT0, "Maygay", "Hot Dogs (Maygay) (EPOCH) (set 1)",GAME_IS_SKELETON_MECHANICAL ) +GAME( 199?, ep_htdgsa, ep_htdgs, maygayep, maygayep, 0, ROT0, "Maygay", "Hot Dogs (Maygay) (EPOCH) (set 2)",GAME_IS_SKELETON_MECHANICAL ) + +GAME( 199?, ep_hubbl, 0, maygayep, maygayep, 0, ROT0, "Maygay", "Hubble Bubble (Maygay) (EPOCH) (set 1)",GAME_IS_SKELETON_MECHANICAL ) +GAME( 199?, ep_hubbla, ep_hubbl, maygayep, maygayep, 0, ROT0, "Maygay", "Hubble Bubble (Maygay) (EPOCH) (set 2)",GAME_IS_SKELETON_MECHANICAL ) + +GAME( 199?, ep_huric, 0, maygayep, maygayep, 0, ROT0, "Maygay", "Hurricane (Maygay - Impulse) (EPOCH) (set 1)",GAME_IS_SKELETON_MECHANICAL ) +GAME( 199?, ep_hurica, ep_huric, maygayep, maygayep, 0, ROT0, "Maygay", "Hurricane (Maygay - Impulse) (EPOCH) (set 2)",GAME_IS_SKELETON_MECHANICAL ) +GAME( 199?, ep_huricb, ep_huric, maygayep, maygayep, 0, ROT0, "Maygay", "Hurricane (Maygay - Impulse) (EPOCH) (set 3)",GAME_IS_SKELETON_MECHANICAL ) +GAME( 199?, ep_huricc, ep_huric, maygayep, maygayep, 0, ROT0, "Maygay", "Hurricane (Maygay - Impulse) (EPOCH) (set 4)",GAME_IS_SKELETON_MECHANICAL ) +GAME( 199?, ep_huricd, ep_huric, maygayep, maygayep, 0, ROT0, "Maygay", "Hurricane (Maygay - Impulse) (EPOCH) (set 5)",GAME_IS_SKELETON_MECHANICAL ) +GAME( 199?, ep_hurice, ep_huric, maygayep, maygayep, 0, ROT0, "Maygay", "Hurricane (Maygay - Impulse) (EPOCH) (set 6)",GAME_IS_SKELETON_MECHANICAL ) + +GAME( 199?, ep_hyst, 0, maygayep, maygayep, 0, ROT0, "Maygay", "Hysteria (Maygay - Impulse) (EPOCH) (set 1)",GAME_IS_SKELETON_MECHANICAL ) +GAME( 199?, ep_hysta, ep_hyst, maygayep, maygayep, 0, ROT0, "Maygay", "Hysteria (Maygay - Impulse) (EPOCH) (set 2)",GAME_IS_SKELETON_MECHANICAL ) + +GAME( 199?, ep_icebg, 0, maygayep, maygayep, 0, ROT0, "Maygay", "Ice Burger (Maygay) (EPOCH) (set 1)",GAME_IS_SKELETON_MECHANICAL ) +GAME( 199?, ep_icebga, ep_icebg, maygayep, maygayep, 0, ROT0, "Maygay", "Ice Burger (Maygay) (EPOCH) (set 2)",GAME_IS_SKELETON_MECHANICAL ) +GAME( 199?, ep_icebgb, ep_icebg, maygayep, maygayep, 0, ROT0, "Maygay", "Ice Burger (Maygay) (EPOCH) (set 3)",GAME_IS_SKELETON_MECHANICAL ) +GAME( 199?, ep_icebgc, ep_icebg, maygayep, maygayep, 0, ROT0, "Maygay", "Ice Burger (Maygay) (EPOCH) (set 4)",GAME_IS_SKELETON_MECHANICAL ) +GAME( 199?, ep_icebgd, ep_icebg, maygayep, maygayep, 0, ROT0, "Maygay", "Ice Burger (Maygay) (EPOCH) (set 5)",GAME_IS_SKELETON_MECHANICAL ) +GAME( 199?, ep_icebge, ep_icebg, maygayep, maygayep, 0, ROT0, "Maygay", "Ice Burger (Maygay) (EPOCH) (set 6)",GAME_IS_SKELETON_MECHANICAL ) +GAME( 199?, ep_icebgf, ep_icebg, maygayep, maygayep, 0, ROT0, "Maygay", "Ice Burger (Maygay) (EPOCH) (set 7)",GAME_IS_SKELETON_MECHANICAL ) +GAME( 199?, ep_icebgg, ep_icebg, maygayep, maygayep, 0, ROT0, "Maygay", "Ice Burger (Maygay) (EPOCH) (set 8)",GAME_IS_SKELETON_MECHANICAL ) +GAME( 199?, ep_icebgh, ep_icebg, maygayep, maygayep, 0, ROT0, "Maygay", "Ice Burger (Maygay) (EPOCH) (set 9)",GAME_IS_SKELETON_MECHANICAL ) +GAME( 199?, ep_icebgi, ep_icebg, maygayep, maygayep, 0, ROT0, "Maygay", "Ice Burger (Maygay) (EPOCH) (set 10)",GAME_IS_SKELETON_MECHANICAL ) + GAME( 199?, ep_inca, 0, maygayep, maygayep, 0, ROT0, "Maygay", "Inca Dinka Do (Maygay - Extreme) (EPOCH)",GAME_IS_SKELETON_MECHANICAL ) GAME( 199?, ep_itjb2, 0, maygayep, maygayep, 0, ROT0, "Maygay", "Italian Job 2 (Maygay) (EPOCH)",GAME_IS_SKELETON_MECHANICAL ) GAME( 199?, ep_ijcl, 0, maygayep, maygayep, 0, ROT0, "Maygay", "Italian Job Club (Maygay) (EPOCH)",GAME_IS_SKELETON_MECHANICAL ) diff --git a/src/mame/drivers/mpu4.c b/src/mame/drivers/mpu4.c index 0da54ae598b..28b85d6ff21 100644 --- a/src/mame/drivers/mpu4.c +++ b/src/mame/drivers/mpu4.c @@ -1,2983 +1,44 @@ -/* Note 19/07/11 DH - - added lots of sets +/* these are the MPU4 set listings / set specific code, for hardware emulation see mpu4hw.c */ - these are mostly unsorted and need to be split into clones - the original source of these was a mess, assume things to be mislabled, bad, duplicated, or otherwise - badly organized. a lot of work is needed to sort them out, especially the Barcrest sets! Some of this - stuff MIGHT be in the wrong driver, or missing roms (sound roms especially) +/* todo: driver inits (basic hw reel, protection configs etc.) should probably be moved here + once the actual code for them is cleaned up and can be put into neater structures + like bfm_sc4 + + due to the vast number of sets here this might be further split up by manufacturer + */ -/*********************************************************************************************************** - Barcrest MPU4 highly preliminary driver by J.Wallace, and Anonymous. - - This is the core driver, no video specific stuff should go in here. - This driver holds all the mechanical games. - - 06-2011: Fixed boneheaded interface glitch that was causing samples to not be cancelled correctly. - Added the ability to read each segment of an LED display separately, this may be necessary for some - games that use them as surrogate lamp lines. - New persistence 'hack' to stop light flicker for the small extender. - 05-2011: Add better OKI emulation - 04-2011: More accurate gamball code, fixed ROM banking (Project Amber), added BwB CHR simulator (Amber) - This is still a hard coded system, but significantly different to Barcrest's version. - Started adding support for the Crystal Gaming program card, and the link keys for setting parameters. - 03-2011: Lamp timing fixes, support for all known expansion cards added. - 01-2011: Adding the missing 'OKI' sound card, and documented it, but it needs a 6376 rewrite. - 09-2007: Haze: Added Deal 'Em video support. - 03-08-2007: J Wallace: Removed audio filter for now, since sound is more accurate without them. - Connect 4 now has the right sound. - 03-07-2007: J Wallace: Several major changes, including input relabelling, and system timer improvements. - 06-2007: Atari Ace, many cleanups and optimizations of I/O routines - 09-06-2007: J Wallace: Fixed 50Hz detection circuit. - 17-02-2007: J Wallace: Added Deal 'Em - still needs some work. - 10-02-2007: J Wallace: Improved input timing. - 30-01-2007: J Wallace: Characteriser rewritten to run the 'extra' data needed by some games. - 24-01-2007: J Wallace: With thanks to Canonman and HIGHWAYMAN/System 80, I was able to confirm a seemingly - ghastly misuse of a PIA is actually on the real hardware. This fixes the meters. - -See http://agemame.mameworld.info/techinfo/mpu4.php for Information. - ---- Board Setup --- - -The MPU4 BOARD is the driver board, originally designed to run Fruit Machines made by the Barcrest Group, but later -licensed to other firms as a general purpose unit (even some old Photo-Me booths used the unit). - -This board uses a ~1.72 Mhz 6809B CPU, and a number of PIA6821 chips for multiplexing inputs and the like. - -To some extent, the hardware feels like a revision of the MPU3 design, integrating into the base unit features that were -previously added through expansion ports. However, there is no backwards compatibility, and the entire memory map has been -reworked. - -Like MPU3, a 6840PTM is used for internal timing, and other miscellaneous control functions, including as a crude analogue sound device -(a square wave from the PTM being used as the alarm sound generator). However, the main sound functionality is provided by -dedicated hardware (an AY8913). - -A MPU4 GAME CARD (cartridge) plugs into the MPU4 board containing the game, and a protection PAL (the 'characteriser'). -This PAL, as well as protecting the games, also controlled some of the lamp address matrix for many games, and acted as -an anti-tampering device which helped to prevent the hacking of certain titles in a manner which broke UK gaming laws. - -Like MPU3, over the years developers have added more capabilities through the spare inputs and outputs provided. These provided -support for more reels, lamps and LEDs through daughtercards. -Several solutions were released depending on the manufacturer of the machine, all are emulated here. - -In later revisions of the main board (MOD4 onwards), the AY8913 was removed entirely, as two official alternatives for sound had been produced. -In one, a YM2413 is built into the gameboard, and in the other an OKI MSM6376 is interfaced with a PIA and PTM to allow sophisticated -sampled sound. - -The lamping and input handling side of the machine rely entirely on a column by column 'strobe' system, with lights and LEDs selected in turn. -In the inputs there are two orange connectors (sampled every 8ms) and two black ones (sampled every 16ms), giving 32 multiplexed inputs. - -In addition there are two auxiliary ports that can be accessed separately to these and are bidirectional - ---- Preliminary MPU4 Memorymap --- - -(NV) indicates an item which is not present on the video version, which has a Comms card instead. - - hex |r/w| D D D D D D D D | - location | | 7 6 5 4 3 2 1 0 | function ------------+---+-----------------+-------------------------------------------------------------------------- - 0000-07FF |R/W| D D D D D D D D | 2k RAM ------------+---+-----------------+-------------------------------------------------------------------------- - 0800 |R/W| | Characteriser (Security PAL) (NV) ------------+---+-----------------+-------------------------------------------------------------------------- - 0850 ? | W | ??????????????? | page latch (NV) ------------+---+-----------------+-------------------------------------------------------------------------- - 0880 |R/W| D D D D D D D D | PIA6821 on soundboard (Oki MSM6376 clocked by 6840 (8C0)) - | | | port A = ?? - | | | port B (882) - | | | b7 = NAR - | | | b6 = 0 if OKI busy, 1 if OKI ready - | | | b5 = volume control clock - | | | b4 = volume control direction (0= up, 1 = down) - | | | b3 = ?? - | | | b2 = ?? - | | | b1 = 2ch - | | | b0 = ST ------------+---+-----------------+-------------------------------------------------------------------------- - 08C0 | | | MC6840 on sound board ------------+---+-----------------+-------------------------------------------------------------------------- - 0900- |R/W| D D D D D D D D | MC6840 PTM IC2 - - - Clock1 <-------------------------------------- - | | - V | - Output1 ---> Clock2 | - | - Output2 --+-> Clock3 | - | | - | Output3 ---> 'to audio amp' ?? - | - +--------> CA1 IC3 ( - -IRQ line connected to CPU - ------------+---+-----------------+-------------------------------------------------------------------------- - 0A00-0A03 |R/W| D D D D D D D D | PIA6821 IC3 port A Lamp Drives 1,2,3,4,6,7,8,9 (sic)(IC14) - | | | - | | | CA1 <= output2 from PTM6840 (IC2) - | | | CA2 => alpha data - | | | - | | | port B Lamp Drives 10,11,12,13,14,15,16,17 (sic)(IC13) - | | | - | | | CB2 => alpha reset (clock on Dutch systems) - | | | ------------+---+-----------------+-------------------------------------------------------------------------- - 0B00-0B03 |R/W| D D D D D D D D | PIA6821 IC4 port A = data for 7seg leds (pins 10 - 17, via IC32) - | | | - | | | CA1 INPUT, 50 Hz input (used to generate IRQ) - | | | CA2 OUTPUT, connected to pin2 74LS138 CE for multiplexer - | | | (B on LED strobe multiplexer) - | | | IRQA connected to IRQ of CPU - | | | port B - | | | PB7 = INPUT, serial port Receive data (Rx) - | | | PB6 = INPUT, reel A sensor - | | | PB5 = INPUT, reel B sensor - | | | PB4 = INPUT, reel C sensor - | | | PB3 = INPUT, reel D sensor - | | | PB2 = INPUT, Connected to CA1 (50Hz signal) - | | | PB1 = INPUT, undercurrent sense - | | | PB0 = INPUT, overcurrent sense - | | | - | | | CB1 INPUT, used to generate IRQ on edge of serial input line - | | | CB2 OUTPUT, enable signal for reel optics - | | | IRQB connected to IRQ of CPU - | | | ------------+---+-----------------+-------------------------------------------------------------------------- - 0C00-0C03 |R/W| D D D D D D D D | PIA6821 IC5 port A - | | | - | | | PA0-PA7, INPUT AUX1 connector - | | | - | | | CA2 OUTPUT, serial port Transmit line - | | | CA1 not connected - | | | IRQA connected to IRQ of CPU - | | | - | | | port B - | | | - | | | PB0-PB7 INPUT, AUX2 connector - | | | - | | | CB1 INPUT, connected to PB7 (Aux2 connector pin 4) - | | | - | | | CB2 OUTPUT, AY8913 chip select line - | | | IRQB connected to IRQ of CPU - | | | ------------+---+-----------------+-------------------------------------------------------------------------- - 0D00-0D03 |R/W| D D D D D D D D | PIA6821 IC6 - | | | - | | | port A - | | | - | | | PA0 - PA7 (INPUT/OUTPUT) data port AY8913 sound chip - | | | - | | | CA1 INPUT, not connected - | | | CA2 OUTPUT, BC1 pin AY8913 sound chip - | | | IRQA , connected to IRQ CPU - | | | - | | | port B - | | | - | | | PB0-PB3 OUTPUT, reel A - | | | PB4-PB7 OUTPUT, reel B - | | | - | | | CB1 INPUT, not connected - | | | CB2 OUTPUT, B01R pin AY8913 sound chip - | | | IRQB , connected to IRQ CPU - | | | ------------+---+-----------------+-------------------------------------------------------------------------- - 0E00-0E03 |R/W| D D D D D D D D | PIA6821 IC7 - | | | - | | | port A - | | | - | | | PA0-PA3 OUTPUT, reel C - | | | PA4-PA7 OUTPUT, reel D - | | | CA1 INPUT, not connected - | | | CA2 OUTPUT, A on LED strobe multiplexer - | | | IRQA , connected to IRQ CPU - | | | - | | | port B - | | | - | | | PB0-PB6 OUTPUT mech meter 1-7 or reel E + F - | | | PB7 Voltage drop sensor - | | | CB1 INPUT, not connected - | | | CB2 OUTPUT,mech meter 8 - | | | IRQB , connected to IRQ CPU - | | | ------------+---+-----------------+-------------------------------------------------------------------------- - 0F00-0F03 |R/W| D D D D D D D D | PIA6821 IC8 - | | | - | | | port A - | | | - | | | PA0-PA7 INPUT multiplexed inputs data - | | | - | | | CA1 INPUT, not connected - | | | CA2 OUTPUT, C on LED strobe multiplexer - | | | IRQA connected to IRQ CPU - | | | - | | | port B - | | | - | | | PB0-PB7 OUTPUT triacs outputs connector PL6 - | | | used for slides / hoppers - | | | - | | | CB1 INPUT, not connected - | | | CB2 OUTPUT, pin1 alpha display PL7 (clock signal) - | | | IRQB connected to IRQ CPU - | | | ------------+---+-----------------+-------------------------------------------------------------------------- - 1000-FFFF | R | D D D D D D D D | ROM (can be bank switched by 0x850 in 8 banks of 64 k ) (NV) ------------+---+-----------------+-------------------------------------------------------------------------- - -TODO: - Distinguish door switches using manual - - Complete stubs for hoppers (needs slightly better 68681 emulation, and new 'hoppers' device emulation) - - It seems that the MPU4 core program relies on some degree of persistence when switching strobes and handling - writes to the various hardware ports. This explains the occasional lamping/LED blackout and switching bugs - For now, we're ignoring any extra writes to strobes, as the alternative is to assign a timer to *everything* and - start modelling the individual hysteresis curves of filament lamps. - - Fix BwB characteriser, need to be able to calculate stabiliser bytes. Anyone fancy reading 6809 source? - - Strange bug in Andy's Great Escape - Mystery nudge sound effect is not played, mpu4 latches in silence instead (?) -***********************************************************************************************************/ #include "emu.h" -#include "machine/6821pia.h" -#include "machine/6840ptm.h" -#include "machine/nvram.h" -#include "cpu/m6809/m6809.h" -#include "sound/ay8910.h" -#include "sound/okim6376.h" -#include "sound/2413intf.h" -#include "sound/upd7759.h" -#include "machine/steppers.h" -#include "machine/roc10937.h" -#include "machine/meters.h" -#include "includes/mpu4.h" - - -#include "video/awpvid.h" //Fruit Machines Only -#include "connect4.lh" #include "gamball.lh" -#include "mpu4.lh" -#include "mpu4ext.lh" - - -static TIMER_CALLBACK( ic24_timeout ); - - -/* -LED Segments related to pins (5 is not connected): -Unlike the controllers emulated in the layout code, each -segment of an MPU4 LED can be set individually, even -being used as individual lamps. However, we can get away -with settings like this in the majority of cases. - _9_ - | | - 3 8 - | | - _2_ - | | - 4 7 - |_ _| - 6 1 - -8 display enables (pins 10 - 17) -*/ - -static void lamp_extend_small(mpu4_state *state, int data) -{ - int lamp_ext_data,column,i; - column = data & 0x07; - - lamp_ext_data = 0x1f - ((data & 0xf8) >> 3);//remove the mux lines from the data - - if ((state->m_lamp_strobe_ext_persistence == 0)) - //One write to reset the drive lines, one with the data, one to clear the lines, so only the 2nd write does anything - //Once again, lamp persistences would take care of this, but we can't do that - { - for (i = 0; i < 5; i++) - { - output_set_lamp_value((8*column)+i+128,((lamp_ext_data & (1 << i)) != 0)); - } - } - state->m_lamp_strobe_ext_persistence ++; - if ((state->m_lamp_strobe_ext_persistence == 3)||(state->m_lamp_strobe_ext!=column)) - { - state->m_lamp_strobe_ext_persistence = 0; - state->m_lamp_strobe_ext=column; - } -} - -static void lamp_extend_large(mpu4_state *state, int data,int column,int active) -{ - int lampbase,i,bit7; - - state->m_lamp_sense = 0; - bit7 = data & 0x80; - if ( bit7 != state->m_last_b7 ) - { - state->m_card_live = 1; - //depending on bit 7, we can access one of two 'blocks' of 64 lamps - lampbase = bit7 ? 0 : 64; - if ( data & 0x3f ) - { - state->m_lamp_sense = 1; - } - if ( active ) - { - if (state->m_lamp_strobe_ext != column) - { - for (i = 0; i < 8; i++) - {//CHECK, this includes bit 7 - output_set_lamp_value((8*column)+i+128+lampbase ,(data & (1 << i)) != 0); - } - state->m_lamp_strobe_ext = column; - } - } - state->m_last_b7 = bit7; - } - else - { - state->m_card_live = 0; - } -} - -static void led_write_latch(mpu4_state *state, int latch, int data, int column) -{ - int diff,i,j; - - diff = (latch ^ state->m_last_latch) & latch; - column = 7 - column; // like main board, these are wired up in reverse - data = ~data;//inverted drive lines? - - for(i=0; i<5; i++) - { - if (diff & (1<m_last_latch = diff; -} - - -static void update_meters(mpu4_state *state) -{ - int meter; - int data = ((state->m_mmtr_data & 0x7f) | state->m_remote_meter); - switch (state->m_reel_mux) - { - case STANDARD_REEL: - // Change nothing - break; - case FIVE_REEL_5TO8: - stepper_update(4, ((data >> 4) & 0x0f)); - data = (data & 0x0F); //Strip reel data from meter drives, leaving active elements - awp_draw_reel(4); - break; - case FIVE_REEL_8TO5: - stepper_update(4, (((data & 0x01) + ((data & 0x08) >> 2) + ((data & 0x20) >> 3) + ((data & 0x80) >> 4)) & 0x0f)) ; - data = 0x00; //Strip all reel data from meter drives, nothing is connected - awp_draw_reel(4); - break; - case FIVE_REEL_3TO6: - stepper_update(4, ((data >> 2) & 0x0f)); - data = 0x00; //Strip all reel data from meter drives - awp_draw_reel(4); - break; - case SIX_REEL_1TO8: - stepper_update(4, (data & 0x0f)); - stepper_update(5, ((data >> 4) & 0x0f)); - data = 0x00; //Strip all reel data from meter drives - awp_draw_reel(4); - awp_draw_reel(5); - break; - case SIX_REEL_5TO8: - stepper_update(4, ((data >> 4) & 0x0f)); - data = 0x00; //Strip all reel data from meter drives - awp_draw_reel(4); - break; - case SEVEN_REEL: - stepper_update(0, (((data & 0x01) + ((data & 0x08) >> 2) + ((data & 0x20) >> 3) + ((data & 0x80) >> 4)) & 0x0f)) ; - data = 0x00; //Strip all reel data from meter drives - awp_draw_reel(0); - break; - case FLUTTERBOX: //The backbox fan assembly fits in a reel unit sized box, wired to the remote meter pin, so we can handle it here - output_set_value("flutterbox", data & 0x80); - data &= ~0x80; //Strip flutterbox data from meter drives - } - - MechMtr_update(7, (data & 0x80)); - for (meter = 0; meter < 4; meter ++) - { - MechMtr_update(meter, (data & (1 << meter))); - } - if (state->m_reel_mux == STANDARD_REEL) - { - for (meter = 4; meter < 7; meter ++) - { - MechMtr_update(meter, (data & (1 << meter))); - } - } -} - -/* called if board is reset */ -void mpu4_stepper_reset(mpu4_state *state) -{ - int pattern = 0,reel; - for (reel = 0; reel < 6; reel++) - { - stepper_reset_position(reel); - if(!state->m_reel_mux) - { - if (stepper_optic_state(reel)) pattern |= 1<m_optic_pattern = pattern; -} - - -static MACHINE_RESET( mpu4 ) -{ - mpu4_state *state = machine.driver_data(); - state->m_vfd->reset(); - - mpu4_stepper_reset(state); - - state->m_lamp_strobe = 0; - state->m_lamp_strobe2 = 0; - state->m_led_strobe = 0; - state->m_mmtr_data = 0; - state->m_remote_meter = 0; - - state->m_IC23GC = 0; - state->m_IC23GB = 0; - state->m_IC23GA = 0; - state->m_IC23G1 = 1; - state->m_IC23G2A = 0; - state->m_IC23G2B = 0; - - state->m_prot_col = 0; - state->m_chr_counter = 0; - state->m_chr_value = 0; - - - /* init rom bank, some games don't set this, and will assume bank 0,set 0 */ - { - UINT8 *rom = state->memregion("maincpu")->base(); - - state->membank("bank1")->configure_entries(0, 8, &rom[0x01000], 0x10000); - - state->membank("bank1")->set_entry(0); - machine.device("maincpu")->reset(); - } -} - - -/* 6809 IRQ handler */ -WRITE_LINE_MEMBER(mpu4_state::cpu0_irq) -{ - /* The PIA and PTM IRQ lines are all connected to a common PCB track, leading directly to the 6809 IRQ line. */ - int combined_state = m_pia3->irq_a_state() | m_pia3->irq_b_state() | - m_pia4->irq_a_state() | m_pia4->irq_b_state() | - m_pia5->irq_a_state() | m_pia5->irq_b_state() | - m_pia6->irq_a_state() | m_pia6->irq_b_state() | - m_pia7->irq_a_state() | m_pia7->irq_b_state() | - m_pia8->irq_a_state() | m_pia8->irq_b_state() | - m_6840ptm->irq_state(); - - if (!m_link7a_connected) //7B = IRQ, 7A = FIRQ, both = NMI - { - cputag_set_input_line(machine(), "maincpu", M6809_IRQ_LINE, combined_state ? ASSERT_LINE : CLEAR_LINE); - LOG(("6809 int%d \n", combined_state)); - } - else - { - cputag_set_input_line(machine(), "maincpu", M6809_FIRQ_LINE, combined_state ? ASSERT_LINE : CLEAR_LINE); - LOG(("6809 fint%d \n", combined_state)); - } -} - -/* Bankswitching -The MOD 4 ROM cards are set up to handle 8 separate ROM pages, arranged as 2 sets of 4. -The bankswitch selects which of the 4 pages in the set is active, while the bankset -switches between the sets. -It appears that the cards were originally intended to be used in a 'half' page setup, -where the two halves of the ROM space could be mixed and matched as appropriate. -However, there is no evidence to suggest this was ever implemented. -The controls for it exist however, in the form of the Soundboard PIA CB2 pin, which is -used in some cabinets instead of the main control. -*/ -WRITE8_MEMBER(mpu4_state::bankswitch_w) -{ -// printf("bank %02x\n", data); - - m_pageval = (data & 0x03); - membank("bank1")->set_entry((m_pageval + (m_pageset ? 4 : 0)) & 0x07); -} - - -READ8_MEMBER(mpu4_state::bankswitch_r) -{ - return membank("bank1")->entry(); -} - - -WRITE8_MEMBER(mpu4_state::bankset_w) -{ - m_pageval = (data - 2);//writes 2 and 3, to represent 0 and 1 - a hangover from the half page design? - membank("bank1")->set_entry((m_pageval + (m_pageset ? 4 : 0)) & 0x07); -} - - -/* IC2 6840 PTM handler */ -WRITE8_MEMBER(mpu4_state::ic2_o1_callback) -{ - m_6840ptm->set_c2(data); /* copy output value to IC2 c2 - this output is the clock for timer2 */ - /* 1200Hz System interrupt timer */ -} - - -WRITE8_MEMBER(mpu4_state::ic2_o2_callback) -{ - m_pia3->ca1_w(data); /* copy output value to IC3 ca1 */ - /* the output from timer2 is the input clock for timer3 */ - /* miscellaneous interrupts generated here */ - m_6840ptm->set_c3(data); -} - - -WRITE8_MEMBER(mpu4_state::ic2_o3_callback) -{ - /* the output from timer3 is used as a square wave for the alarm output - and as an external clock source for timer 1! */ - /* also runs lamp fade */ - m_6840ptm->set_c1(data); -} - - -static const ptm6840_interface ptm_ic2_intf = -{ - MPU4_MASTER_CLOCK / 4, - { 0, 0, 0 }, - { DEVCB_DRIVER_MEMBER(mpu4_state,ic2_o1_callback), - DEVCB_DRIVER_MEMBER(mpu4_state,ic2_o2_callback), - DEVCB_DRIVER_MEMBER(mpu4_state,ic2_o3_callback) }, - DEVCB_DRIVER_LINE_MEMBER(mpu4_state,cpu0_irq) -}; - - -/* 6821 PIA handlers */ -/* IC3, lamp data lines + alpha numeric display */ -WRITE8_MEMBER(mpu4_state::pia_ic3_porta_w) -{ - int i; - LOG_IC3(("%s: IC3 PIA Port A Set to %2x (lamp strobes 1 - 9)\n", machine().describe_context(),data)); - - if(m_ic23_active) - { - if (m_lamp_strobe != m_input_strobe) - { - // Because of the nature of the lamping circuit, there is an element of persistance - // As a consequence, the lamp column data can change before the input strobe without - // causing the relevant lamps to black out. - - for (i = 0; i < 8; i++) - { - output_set_lamp_value((8*m_input_strobe)+i, ((data & (1 << i)) !=0)); - } - m_lamp_strobe = m_input_strobe; - } - } -} - -WRITE8_MEMBER(mpu4_state::pia_ic3_portb_w) -{ - int i; - LOG_IC3(("%s: IC3 PIA Port B Set to %2x (lamp strobes 10 - 17)\n", machine().describe_context(),data)); - - if(m_ic23_active) - { - if (m_lamp_strobe2 != m_input_strobe) - { - for (i = 0; i < 8; i++) - { - output_set_lamp_value((8*m_input_strobe)+i+64, ((data & (1 << i)) !=0)); - } - m_lamp_strobe2 = m_input_strobe; - } - - if (m_led_lamp) - { - /* Some games (like Connect 4) use 'programmable' LED displays, built from light display lines in section 2. */ - /* These are mostly low-tech machines, where such wiring proved cheaper than an extender card */ - /* TODO: replace this with 'segment' lamp masks, to make it more generic */ - UINT8 pled_segs[2] = {0,0}; - - static const int lamps1[8] = { 106, 107, 108, 109, 104, 105, 110, 133 }; - static const int lamps2[8] = { 114, 115, 116, 117, 112, 113, 118, 119 }; - - for (i = 0; i < 8; i++) - { - if (output_get_lamp_value(lamps1[i])) pled_segs[0] |= (1 << i); - if (output_get_lamp_value(lamps2[i])) pled_segs[1] |= (1 << i); - } - - output_set_digit_value(8,pled_segs[0]); - output_set_digit_value(9,pled_segs[1]); - } - } -} - -WRITE_LINE_MEMBER(mpu4_state::pia_ic3_ca2_w) -{ - LOG_IC3(("%s: IC3 PIA Write CA2 (alpha data), %02X\n", machine().describe_context(),state)); - - m_alpha_data_line = state; -} - - -WRITE_LINE_MEMBER(mpu4_state::pia_ic3_cb2_w) -{ - LOG_IC3(("%s: IC3 PIA Write CB (alpha reset), %02X\n",machine().describe_context(),state)); -// DM Data pin A - if ( !state ) - { - m_vfd->reset(); - } -} - - -static const pia6821_interface pia_ic3_intf = -{ - DEVCB_NULL, /* port A in */ - DEVCB_NULL, /* port B in */ - DEVCB_NULL, /* line CA1 in */ - DEVCB_NULL, /* line CB1 in */ - DEVCB_NULL, /* line CA2 in */ - DEVCB_NULL, /* line CB2 in */ - DEVCB_DRIVER_MEMBER(mpu4_state,pia_ic3_porta_w), /* port A out */ - DEVCB_DRIVER_MEMBER(mpu4_state,pia_ic3_portb_w), /* port B out */ - DEVCB_DRIVER_LINE_MEMBER(mpu4_state,pia_ic3_ca2_w), /* line CA2 out */ - DEVCB_DRIVER_LINE_MEMBER(mpu4_state,pia_ic3_cb2_w), /* port CB2 out */ - DEVCB_DRIVER_LINE_MEMBER(mpu4_state,cpu0_irq), /* IRQA */ - DEVCB_DRIVER_LINE_MEMBER(mpu4_state,cpu0_irq) /* IRQB */ -}; - - -/* -IC23 emulation - -IC23 is a 74LS138 1-of-8 Decoder - -It is used as a multiplexer for the LEDs, lamp selects and inputs.*/ - -static void ic23_update(mpu4_state *state) -{ - if (!state->m_IC23G2A) - { - if (!state->m_IC23G2B) - { - if (state->m_IC23G1) - { - if ( state->m_IC23GA ) state->m_input_strobe |= 0x01; - else state->m_input_strobe &= ~0x01; - - if ( state->m_IC23GB ) state->m_input_strobe |= 0x02; - else state->m_input_strobe &= ~0x02; - - if ( state->m_IC23GC ) state->m_input_strobe |= 0x04; - else state->m_input_strobe &= ~0x04; - } - } - } - else - if ((state->m_IC23G2A)||(state->m_IC23G2B)) - { - state->m_input_strobe = 0x00; - } -} - - -/* -IC24 emulation - -IC24 is a 74LS122 pulse generator - -CLEAR and B2 are tied high and A1 and A2 tied low, meaning any pulse -on B1 will give a low pulse on the output pin. -*/ -static void ic24_output(mpu4_state *state, int data) -{ - state->m_IC23G2A = data; - ic23_update(state); -} - - -static void ic24_setup(mpu4_state *state) -{ - if (state->m_IC23GA) - { - double duration = TIME_OF_74LS123((220*1000),(0.1*0.000001)); - { - state->m_ic23_active=1; - ic24_output(state, 0); - state->m_ic24_timer->adjust(attotime::from_double(duration)); - } - } -} - - -static TIMER_CALLBACK( ic24_timeout ) -{ - mpu4_state *state = machine.driver_data(); - state->m_ic23_active=0; - ic24_output(state, 1); -} - - -/* IC4, 7 seg leds, 50Hz timer reel sensors, current sensors */ -WRITE8_MEMBER(mpu4_state::pia_ic4_porta_w) -{ - int i; - if(m_ic23_active) - { - if (((m_lamp_extender == NO_EXTENDER)||(m_lamp_extender == SMALL_CARD)||(m_lamp_extender == LARGE_CARD_C))&& (m_led_extender == NO_EXTENDER)) - { - if(m_led_strobe != m_input_strobe) - { - for(i=0; i<8; i++) - { - output_set_indexed_value("mpu4led",((7 - m_input_strobe) * 8) +i,(data & (1 << i)) !=0); - } - output_set_digit_value(7 - m_input_strobe,data); - } - m_led_strobe = m_input_strobe; - } - } -} - -WRITE8_MEMBER(mpu4_state::pia_ic4_portb_w) -{ - if (m_reel_mux) - { - /* A write here connects one reel (and only one) - to the optic test circuit. This allows 8 reels - to be supported instead of 4. */ - if (m_reel_mux == SEVEN_REEL) - { - m_active_reel= reel_mux_table7[(data >> 4) & 0x07]; - } - else - m_active_reel= reel_mux_table[(data >> 4) & 0x07]; - } -} - -READ8_MEMBER(mpu4_state::pia_ic4_portb_r) -{ - pia6821_device *pia = machine().device("pia_ic4"); - if ( m_serial_data ) - { - m_ic4_input_b |= 0x80; - pia->cb1_w(1); - } - else - { - m_ic4_input_b &= ~0x80; - pia->cb1_w(0); - } - - if (!m_reel_mux) - { - if ( m_optic_pattern & 0x01 ) m_ic4_input_b |= 0x40; /* reel A tab */ - else m_ic4_input_b &= ~0x40; - - if ( m_optic_pattern & 0x02 ) m_ic4_input_b |= 0x20; /* reel B tab */ - else m_ic4_input_b &= ~0x20; - - if ( m_optic_pattern & 0x04 ) m_ic4_input_b |= 0x10; /* reel C tab */ - else m_ic4_input_b &= ~0x10; - - if ( m_optic_pattern & 0x08 ) m_ic4_input_b |= 0x08; /* reel D tab */ - else m_ic4_input_b &= ~0x08; - - } - else - { - if (stepper_optic_state(m_active_reel)) - { - m_ic4_input_b |= 0x08; - } - else - { - m_ic4_input_b &= ~0x08; - } - } - if ( m_signal_50hz ) m_ic4_input_b |= 0x04; /* 50 Hz */ - else m_ic4_input_b &= ~0x04; - - if (m_ic4_input_b & 0x02) - { - m_ic4_input_b &= ~0x02; - } - else - { - m_ic4_input_b |= 0x02; //Pulse the overcurrent line with every read to show the CPU each lamp has lit - } - #ifdef UNUSED_FUNCTION - if ( lamp_undercurrent ) m_ic4_input_b |= 0x01; - #endif - - LOG_IC3(("%s: IC4 PIA Read of Port B %x\n",machine().describe_context(),m_ic4_input_b)); - return m_ic4_input_b; -} - - -WRITE_LINE_MEMBER(mpu4_state::pia_ic4_ca2_w) -{ - mpu4_state *drvstate = machine().driver_data(); - LOG_IC3(("%s: IC4 PIA Write CA (input MUX strobe /LED B), %02X\n", machine().describe_context(),state)); - - m_IC23GB = state; - ic23_update(drvstate); -} - -WRITE_LINE_MEMBER(mpu4_state::pia_ic4_cb2_w) -{ - LOG_IC3(("%s: IC4 PIA Write CA (input MUX strobe /LED B), %02X\n", machine().describe_context(),state)); - m_reel_flag=state; -} -static const pia6821_interface pia_ic4_intf = -{ - DEVCB_NULL, /* port A in */ - DEVCB_DRIVER_MEMBER(mpu4_state,pia_ic4_portb_r), /* port B in */ - DEVCB_NULL, /* line CA1 in */ - DEVCB_NULL, /* line CB1 in */ - DEVCB_NULL, /* line CA2 in */ - DEVCB_NULL, /* line CB2 in */ - DEVCB_DRIVER_MEMBER(mpu4_state,pia_ic4_porta_w), /* port A out */ - DEVCB_DRIVER_MEMBER(mpu4_state,pia_ic4_portb_w), /* port B out */ - DEVCB_DRIVER_LINE_MEMBER(mpu4_state,pia_ic4_ca2_w), /* line CA2 out */ - DEVCB_DRIVER_LINE_MEMBER(mpu4_state,pia_ic4_cb2_w), /* line CB2 out */ - DEVCB_DRIVER_LINE_MEMBER(mpu4_state,cpu0_irq), /* IRQA */ - DEVCB_DRIVER_LINE_MEMBER(mpu4_state,cpu0_irq) /* IRQB */ -}; - -/* IC5, AUX ports, coin lockouts and AY sound chip select (MODs below 4 only) */ -READ8_MEMBER(mpu4_state::pia_ic5_porta_r) -{ - if (m_lamp_extender == LARGE_CARD_A) - { - if (m_lamp_sense && m_ic23_active) - { - m_aux1_input |= 0x40; - } - else - { - m_aux1_input &= ~0x40; //Pulse the overcurrent line with every read to show the CPU each lamp has lit - } - } - if (m_hopper == HOPPER_NONDUART_A) - { -/* if (hopper1_active) - { - m_aux1_input |= 0x04; - } - else - { - m_aux1_input &= ~0x04; - }*/ - } - LOG(("%s: IC5 PIA Read of Port A (AUX1)\n",machine().describe_context())); - - return machine().root_device().ioport("AUX1")->read()|m_aux1_input; -} - -WRITE8_MEMBER(mpu4_state::pia_ic5_porta_w) -{ - int i; - mpu4_state *state = machine().driver_data(); - pia6821_device *pia_ic4 = machine().device("pia_ic4"); - if (m_hopper == HOPPER_NONDUART_A) - { - //hopper1_drive_sensor(data&0x10); - } - switch (m_lamp_extender) - { - case NO_EXTENDER: - if (m_led_extender == CARD_B) - { - led_write_latch(state, data & 0x1f, pia_ic4->a_output(),m_input_strobe); - } - else if ((m_led_extender != CARD_A)||(m_led_extender != NO_EXTENDER)) - { - for(i=0; i<8; i++) - { - output_set_indexed_value("mpu4led",((m_input_strobe + 8) * 8) +i,(data & (1 << i)) !=0); - } - output_set_digit_value((m_input_strobe+8),data); - } - break; - case SMALL_CARD: - if(m_ic23_active) - { - lamp_extend_small(state,data); - } - break; - case LARGE_CARD_A: - lamp_extend_large(state,data,m_input_strobe,m_ic23_active); - break; - case LARGE_CARD_B: - lamp_extend_large(state,data,m_input_strobe,m_ic23_active); - if ((m_ic23_active) && m_card_live) - { - for(i=0; i<8; i++) - { - output_set_indexed_value("mpu4led",(((8*(m_last_b7 >>7))+ m_input_strobe) * 8) +i,(~data & (1 << i)) !=0); - } - output_set_digit_value(((8*(m_last_b7 >>7))+m_input_strobe),~data); - } - break; - case LARGE_CARD_C: - lamp_extend_large(state,data,m_input_strobe,m_ic23_active); - break; - } - if (m_reel_mux == SIX_REEL_5TO8) - { - stepper_update(4, data&0x0F); - stepper_update(5, (data >> 4)&0x0F); - awp_draw_reel(4); - awp_draw_reel(5); - } - else - if (m_reel_mux == SEVEN_REEL) - { - stepper_update(1, data&0x0F); - stepper_update(2, (data >> 4)&0x0F); - awp_draw_reel(1); - awp_draw_reel(2); - } - - if (mame_stricmp(machine().system().name, "m4gambal") == 0) - { - /* The 'Gamball' device is a unique piece of mechanical equipment, designed to - provide a truly fair hi-lo gamble for an AWP. Functionally, it consists of - a ping-pong ball or similar enclosed in the machine's backbox, on a platform with 12 - holes. When the low 4 bytes of AUX1 are triggered, this fires the ball out from the - hole it's currently in, to land in another. Landing in the same hole causes the machine to - refire the ball. The ball detection is done by the high 4 bytes of AUX1. - Here we call the MAME RNG, once to pick a row, once to pick from the four pockets within it. We - then trigger the switches corresponding to the correct number. This appears to be the best way - of making the game fair, short of simulating the physics of a bouncing ball ;)*/ - if (data & 0x0f) - { - switch ((machine().rand()>>5) % 0x3) - { - case 0x00: //Top row - { - switch (machine().rand() & 0x3) - { - case 0x00: //7 - m_aux1_input = (m_aux1_input & 0x0f); - m_aux1_input|= 0xa0; - break; - case 0x01://4 - m_aux1_input = (m_aux1_input & 0x0f); - m_aux1_input|= 0xb0; - break; - case 0x02://9 - m_aux1_input = (m_aux1_input & 0x0f); - m_aux1_input|= 0xc0; - break; - case 0x03://8 - m_aux1_input = (m_aux1_input & 0x0f); - m_aux1_input|= 0xd0; - break; - } - } - case 0x01: //Middle row - note switches don't match pattern - { - switch (machine().rand() & 0x3) - { - case 0x00://12 - m_aux1_input = (m_aux1_input & 0x0f); - m_aux1_input|= 0x40; - break; - case 0x01://1 - m_aux1_input = (m_aux1_input & 0x0f); - m_aux1_input|= 0x50; - break; - case 0x02://11 - m_aux1_input = (m_aux1_input & 0x0f); - m_aux1_input|= 0x80; - break; - case 0x03://2 - m_aux1_input = (m_aux1_input & 0x0f); - m_aux1_input|= 0x90; - break; - } - } - case 0x02: //Bottom row - { - switch (machine().rand() & 0x3) - { - case 0x00://5 - m_aux1_input = (m_aux1_input & 0x0f); - m_aux1_input|= 0x00; - break; - case 0x01://10 - m_aux1_input = (m_aux1_input & 0x0f); - m_aux1_input|= 0x10; - break; - case 0x02://3 - m_aux1_input = (m_aux1_input & 0x0f); - m_aux1_input|= 0x20; - break; - case 0x03://6 - m_aux1_input = (m_aux1_input & 0x0f); - m_aux1_input|= 0x30; - break; - } - } - } - } - } -} - -WRITE8_MEMBER(mpu4_state::pia_ic5_portb_w) -{ - if (m_hopper == HOPPER_NONDUART_B) - { - //hopper1_drive_motor(data &0x01) - //hopper1_drive_sensor(data &0x08) - } - if (m_led_extender == CARD_A) - { - // led_write_latch(state, data & 0x07, pia_get_output_a(pia_ic4),m_input_strobe) - } - -} -READ8_MEMBER(mpu4_state::pia_ic5_portb_r) -{ - pia6821_device *pia_ic5 = machine().device("pia_ic5"); - if (m_hopper == HOPPER_NONDUART_B) - {/* - if (hopper1_active) - { - m_aux2_input |= 0x08; - } - else - { - m_aux2_input &= ~0x08; - }*/ - } - - LOG(("%s: IC5 PIA Read of Port B (coin input AUX2)\n",machine().describe_context())); - coin_lockout_w(machine(), 0, (pia_ic5->b_output() & 0x01) ); - coin_lockout_w(machine(), 1, (pia_ic5->b_output() & 0x02) ); - coin_lockout_w(machine(), 2, (pia_ic5->b_output() & 0x04) ); - coin_lockout_w(machine(), 3, (pia_ic5->b_output() & 0x08) ); - return machine().root_device().ioport("AUX2")->read() | m_aux2_input; -} - - -WRITE_LINE_MEMBER(mpu4_state::pia_ic5_ca2_w) -{ - LOG(("%s: IC5 PIA Write CA2 (Serial Tx) %2x\n",machine().describe_context(),state)); - m_serial_data = state; -} - - -/* --------------------------------------- - AY Chip sound function selection - - --------------------------------------- -The databus of the AY sound chip is connected to IC6 Port A. -Data is read from/written to the AY chip through this port. - -If this sounds familiar, Amstrad did something very similar with their home computers. - -The PSG function, defined by the BC1,BC2 and BDIR signals, is controlled by CA2 and CB2 of IC6. - -PSG function selection: ------------------------ -BDIR = IC6 CB2 and BC1 = IC6 CA2 - -Pin | PSG Function -BDIR BC1 | -0 0 | Inactive -0 1 | Read from selected PSG register. When function is set, the PSG will make the register data available to Port A. -1 0 | Write to selected PSG register. When set, the PSG will take the data at Port A and write it into the selected PSG register. -1 1 | Select PSG register. When set, the PSG will take the data at Port A and select a register. -*/ - -/* PSG function selected */ -static void update_ay(device_t *device) -{ - device_t *ay = device->machine().device("ay8913"); - if (!ay) return; - - mpu4_state *state = device->machine().driver_data(); - pia6821_device *pia = downcast(device); - if (!pia->cb2_output()) - { - switch (state->m_ay8913_address) - { - case 0x00: - { - /* Inactive */ - break; - } - case 0x01: - { /* CA2 = 1 CB2 = 0? : Read from selected PSG register and make the register data available to Port A */ - pia6821_device *pia_ic6 = device->machine().device("pia_ic6"); - LOG(("AY8913 address = %d \n",pia_ic6->a_output()&0x0f)); - break; - } - case 0x02: - {/* CA2 = 0 CB2 = 1? : Write to selected PSG register and write data to Port A */ - pia6821_device *pia_ic6 = device->machine().device("pia_ic6"); - device_t *ay = device->machine().device("ay8913"); - ay8910_data_w(ay, 0, pia_ic6->a_output()); - LOG(("AY Chip Write \n")); - break; - } - case 0x03: - {/* CA2 = 1 CB2 = 1? : The register will now be selected and the user can read from or write to it. - The register will remain selected until another is chosen.*/ - pia6821_device *pia_ic6 = device->machine().device("pia_ic6"); - device_t *ay = device->machine().device("ay8913"); - ay8910_address_w(ay, 0, pia_ic6->a_output()); - LOG(("AY Chip Select \n")); - break; - } - default: - { - LOG(("AY Chip error \n")); - } - } - } -} - - -WRITE_LINE_MEMBER(mpu4_state::pia_ic5_cb2_w) -{ - device_t *device = machine().device("pia_ic5"); - update_ay(device); -} - - -static const pia6821_interface pia_ic5_intf = -{ - DEVCB_DRIVER_MEMBER(mpu4_state,pia_ic5_porta_r), /* port A in */ - DEVCB_DRIVER_MEMBER(mpu4_state,pia_ic5_portb_r), /* port B in */ - DEVCB_NULL, /* line CA1 in */ - DEVCB_NULL, /* line CB1 in */ - DEVCB_NULL, /* line CA2 in */ - DEVCB_NULL, /* line CB2 in */ - DEVCB_DRIVER_MEMBER(mpu4_state,pia_ic5_porta_w), /* port A out */ - DEVCB_DRIVER_MEMBER(mpu4_state,pia_ic5_portb_w), /* port B out */ - DEVCB_DRIVER_LINE_MEMBER(mpu4_state,pia_ic5_ca2_w), /* line CA2 out */ - DEVCB_DRIVER_LINE_MEMBER(mpu4_state,pia_ic5_cb2_w), /* port CB2 out */ - DEVCB_DRIVER_LINE_MEMBER(mpu4_state,cpu0_irq), /* IRQA */ - DEVCB_DRIVER_LINE_MEMBER(mpu4_state,cpu0_irq) /* IRQB */ -}; - - -/* IC6, Reel A and B and AY registers (MODs below 4 only) */ -WRITE8_MEMBER(mpu4_state::pia_ic6_portb_w) -{ - LOG(("%s: IC6 PIA Port B Set to %2x (Reel A and B)\n", machine().describe_context(),data)); - - if (m_reel_mux == SEVEN_REEL) - { - stepper_update(3, data&0x0F); - stepper_update(4, (data >> 4)&0x0F); - awp_draw_reel(3); - awp_draw_reel(4); - } - else if (m_reels) - { - stepper_update(0, data & 0x0F ); - stepper_update(1, (data>>4) & 0x0F ); - awp_draw_reel(0); - awp_draw_reel(1); - } - - if (m_reel_flag && (m_reel_mux == STANDARD_REEL) && m_reels) - { - if ( stepper_optic_state(0) ) m_optic_pattern |= 0x01; - else m_optic_pattern &= ~0x01; - - if ( stepper_optic_state(1) ) m_optic_pattern |= 0x02; - else m_optic_pattern &= ~0x02; - } -} - - -WRITE8_MEMBER(mpu4_state::pia_ic6_porta_w) -{ - device_t *device = machine().device("pia_ic6"); - LOG(("%s: IC6 PIA Write A %2x\n", machine().describe_context(),data)); - if (m_mod_number <4) - { - m_ay_data = data; - update_ay(device); - } -} - - -WRITE_LINE_MEMBER(mpu4_state::pia_ic6_ca2_w) -{ - device_t *device = machine().device("pia_ic6"); - LOG(("%s: IC6 PIA write CA2 %2x (AY8913 BC1)\n", machine().describe_context(),state)); - if (m_mod_number <4) - { - if ( state ) m_ay8913_address |= 0x01; - else m_ay8913_address &= ~0x01; - update_ay(device); - } -} - - -WRITE_LINE_MEMBER(mpu4_state::pia_ic6_cb2_w) -{ - device_t *device = machine().device("pia_ic6"); - LOG(("%s: IC6 PIA write CB2 %2x (AY8913 BCDIR)\n", machine().describe_context(),state)); - if (m_mod_number <4) - { - if ( state ) m_ay8913_address |= 0x02; - else m_ay8913_address &= ~0x02; - update_ay(device); - } -} - - -static const pia6821_interface pia_ic6_intf = -{ - DEVCB_NULL, /* port A in */ - DEVCB_NULL, /* port B in */ - DEVCB_NULL, /* line CA1 in */ - DEVCB_NULL, /* line CB1 in */ - DEVCB_NULL, /* line CA2 in */ - DEVCB_NULL, /* line CB2 in */ - DEVCB_DRIVER_MEMBER(mpu4_state,pia_ic6_porta_w), /* port A out */ - DEVCB_DRIVER_MEMBER(mpu4_state,pia_ic6_portb_w), /* port B out */ - DEVCB_DRIVER_LINE_MEMBER(mpu4_state,pia_ic6_ca2_w), /* line CA2 out */ - DEVCB_DRIVER_LINE_MEMBER(mpu4_state,pia_ic6_cb2_w), /* port CB2 out */ - DEVCB_DRIVER_LINE_MEMBER(mpu4_state,cpu0_irq), /* IRQA */ - DEVCB_DRIVER_LINE_MEMBER(mpu4_state,cpu0_irq) /* IRQB */ -}; - - -/* IC7 Reel C and D, mechanical meters/Reel E and F, input strobe bit A */ -WRITE8_MEMBER(mpu4_state::pia_ic7_porta_w) -{ - LOG(("%s: IC7 PIA Port A Set to %2x (Reel C and D)\n", machine().describe_context(),data)); - if (m_reel_mux == SEVEN_REEL) - { - stepper_update(5, data&0x0F); - stepper_update(6, (data >> 4)&0x0F); - awp_draw_reel(5); - awp_draw_reel(6); - } - else if (m_reels) - { - stepper_update(2, data & 0x0F ); - stepper_update(3, (data>>4) & 0x0F ); - awp_draw_reel(2); - awp_draw_reel(3); - } - - if (m_reel_flag && (m_reel_mux == STANDARD_REEL) && m_reels) - { - if ( stepper_optic_state(2) ) m_optic_pattern |= 0x04; - else m_optic_pattern &= ~0x04; - if ( stepper_optic_state(3) ) m_optic_pattern |= 0x08; - else m_optic_pattern &= ~0x08; - } -} - -WRITE8_MEMBER(mpu4_state::pia_ic7_portb_w) -{ - if (m_hopper == HOPPER_DUART_A) - { - //duart write data - } - else if (m_hopper == HOPPER_NONDUART_A) - { - //hoppr1_drive_motor(data & 0x10); - } - - m_mmtr_data = data; -} - -READ8_MEMBER(mpu4_state::pia_ic7_portb_r) -{ -/* The meters are connected to a voltage drop sensor, where current -flowing through them also passes through pin B7, meaning that when -any meter is activated, pin B7 goes high. -As for why they connected this to an output port rather than using -CB1, no idea, although it proved of benefit when the reel multiplexer was designed -as it allows a separate meter to be used when the rest of the port is blocked. -This appears to have confounded the schematic drawer, who has assumed that -all eight meters are driven from this port, giving the 8 line driver chip -9 connections in total. */ - - //This may be overkill, but the meter sensing is VERY picky - - int combined_meter = MechMtr_GetActivity(0) | MechMtr_GetActivity(1) | - MechMtr_GetActivity(2) | MechMtr_GetActivity(3) | - MechMtr_GetActivity(4) | MechMtr_GetActivity(5) | - MechMtr_GetActivity(6) | MechMtr_GetActivity(7); - - if(combined_meter) - { - return 0x80; - } - else - { - return 0x00; - } -} - -WRITE_LINE_MEMBER(mpu4_state::pia_ic7_ca2_w) -{ - mpu4_state *drvstate = machine().driver_data(); - LOG(("%s: IC7 PIA write CA2 %2x (input strobe bit 0 / LED A)\n", machine().describe_context(),state)); - - m_IC23GA = state; - ic24_setup(drvstate); - ic23_update(drvstate); -} - -WRITE_LINE_MEMBER(mpu4_state::pia_ic7_cb2_w) -{ - m_remote_meter = state?0x80:0x00; -} - -static const pia6821_interface pia_ic7_intf = -{ - DEVCB_NULL, /* port A in */ - DEVCB_DRIVER_MEMBER(mpu4_state,pia_ic7_portb_r), /* port B in */ - DEVCB_NULL, /* line CA1 in */ - DEVCB_NULL, /* line CB1 in */ - DEVCB_NULL, /* line CA2 in */ - DEVCB_NULL, /* line CB2 in */ - DEVCB_DRIVER_MEMBER(mpu4_state,pia_ic7_porta_w), /* port A out */ - DEVCB_DRIVER_MEMBER(mpu4_state,pia_ic7_portb_w), /* port B out */ - DEVCB_DRIVER_LINE_MEMBER(mpu4_state,pia_ic7_ca2_w), /* line CA2 out */ - DEVCB_DRIVER_LINE_MEMBER(mpu4_state,pia_ic7_cb2_w), /* line CB2 out */ - DEVCB_DRIVER_LINE_MEMBER(mpu4_state,cpu0_irq), /* IRQA */ - DEVCB_DRIVER_LINE_MEMBER(mpu4_state,cpu0_irq) /* IRQB */ -}; - - -/* IC8, Inputs, TRIACS, alpha clock */ -READ8_MEMBER(mpu4_state::pia_ic8_porta_r) -{ - static const char *const portnames[] = { "ORANGE1", "ORANGE2", "BLACK1", "BLACK2", "ORANGE1", "ORANGE2", "DIL1", "DIL2" }; - pia6821_device *pia_ic5 = machine().device("pia_ic5"); - - LOG_IC8(("%s: IC8 PIA Read of Port A (MUX input data)\n", machine().describe_context())); -/* The orange inputs are polled twice as often as the black ones, for reasons of efficiency. - This is achieved via connecting every input line to an AND gate, thus allowing two strobes - to represent each orange input bank (strobes are active low). */ - pia_ic5->cb1_w(machine().root_device().ioport("AUX2")->read() & 0x80); - return machine().root_device().ioport(portnames[m_input_strobe])->read(); -} - - -WRITE8_MEMBER(mpu4_state::pia_ic8_portb_w) -{ - if (m_hopper == HOPPER_DUART_B) - { -// duart.drive_sensor(data & 0x04, data & 0x01, 0, 0); - } - else if (m_hopper == HOPPER_DUART_C) - { -// duart.drive_sensor(data & 0x04, data & 0x01, data & 0x04, data & 0x02); - } - int i; - LOG_IC8(("%s: IC8 PIA Port B Set to %2x (OUTPUT PORT, TRIACS)\n", machine().describe_context(),data)); - for (i = 0; i < 8; i++) - { - output_set_indexed_value("triac", i, data & (1 << i)); - } -} - -WRITE_LINE_MEMBER(mpu4_state::pia_ic8_ca2_w) -{ - mpu4_state *drvstate = machine().driver_data(); - LOG_IC8(("%s: IC8 PIA write CA2 (input_strobe bit 2 / LED C) %02X\n", machine().describe_context(), state & 0xFF)); - - m_IC23GC = state; - ic23_update(drvstate); -} - - -WRITE_LINE_MEMBER(mpu4_state::pia_ic8_cb2_w) -{ - LOG_IC8(("%s: IC8 PIA write CB2 (alpha clock) %02X\n", machine().describe_context(), state & 0xFF)); - - // DM Data pin B - if (m_alpha_clock != state) - { - if (!m_alpha_clock)//falling edge - { - m_vfd->shift_data(m_alpha_data_line?0:1); - } - } - m_alpha_clock = state; -} - - -static const pia6821_interface pia_ic8_intf = -{ - DEVCB_DRIVER_MEMBER(mpu4_state,pia_ic8_porta_r), /* port A in */ - DEVCB_NULL, /* port B in */ - DEVCB_NULL, /* line CA1 in */ - DEVCB_NULL, /* line CB1 in */ - DEVCB_NULL, /* line CA2 in */ - DEVCB_NULL, /* line CB2 in */ - DEVCB_NULL, /* port A out */ - DEVCB_DRIVER_MEMBER(mpu4_state,pia_ic8_portb_w), /* port B out */ - DEVCB_DRIVER_LINE_MEMBER(mpu4_state,pia_ic8_ca2_w), /* line CA2 out */ - DEVCB_DRIVER_LINE_MEMBER(mpu4_state,pia_ic8_cb2_w), /* port CB2 out */ - DEVCB_DRIVER_LINE_MEMBER(mpu4_state,cpu0_irq), /* IRQA */ - DEVCB_DRIVER_LINE_MEMBER(mpu4_state,cpu0_irq) /* IRQB */ -}; - -// universal sampled sound program card PCB 683077 -// Sampled sound card, using a PIA and PTM for timing and data handling -WRITE8_MEMBER(mpu4_state::pia_gb_porta_w) -{ - device_t *msm6376 = machine().device("msm6376"); - LOG_SS(("%s: GAMEBOARD: PIA Port A Set to %2x\n", machine().describe_context(),data)); - okim6376_w(msm6376, 0, data); -} - -WRITE8_MEMBER(mpu4_state::pia_gb_portb_w) -{ - device_t *msm6376 = machine().device("msm6376"); - okim6376_device *msm = machine().device("msm6376"); - - int changed = m_expansion_latch^data; - - LOG_SS(("%s: GAMEBOARD: PIA Port B Set to %2x\n", machine().describe_context(),data)); - - if ( changed & 0x20) - { // digital volume clock line changed - if ( !(data & 0x20) ) - { // changed from high to low, - if ( !(data & 0x10) )//down - { - if ( m_global_volume < 32 ) m_global_volume++; //steps unknown - } - else - {//up - if ( m_global_volume > 0 ) m_global_volume--; - } - - { - float percent = (32-m_global_volume)/32.0; - msm->set_output_gain(0, percent); - msm->set_output_gain(1, percent); - } - } - } - okim6376_ch2_w(msm6376,data&0x02); - okim6376_st_w(msm6376,data&0x01); -} -READ8_MEMBER(mpu4_state::pia_gb_portb_r) -{ - device_t *msm6376 = machine().device("msm6376"); - LOG_SS(("%s: GAMEBOARD: PIA Read of Port B\n",machine().describe_context())); - int data=0; - // b7 NAR - we can load another address into Channel 1 - // b6, 1 = OKI ready, 0 = OKI busy - // b5, vol clock - // b4, 1 = Vol down, 0 = Vol up - // - - if ( okim6376_nar_r(msm6376) ) data |= 0x80; - else data &= ~0x80; - - if ( okim6376_busy_r(msm6376) ) data |= 0x40; - else data &= ~0x40; - - return ( data | m_expansion_latch ); -} - -WRITE_LINE_MEMBER(mpu4_state::pia_gb_ca2_w) -{ - LOG_SS(("%s: GAMEBOARD: OKI RESET data = %02X\n", machine().describe_context(), state)); - -// reset line -} - -WRITE_LINE_MEMBER(mpu4_state::pia_gb_cb2_w) -{ - //Some BWB games use this to drive the bankswitching - if (m_bwb_bank) - { - m_pageval = state; - membank("bank1")->set_entry((m_pageval + (m_pageset ? 4 : 0)) & 0x07); - } -} - -static const pia6821_interface pia_ic4ss_intf = -{ - DEVCB_NULL, /* port A in */ - DEVCB_DRIVER_MEMBER(mpu4_state,pia_gb_portb_r), /* port B in */ - DEVCB_NULL, /* line CA1 in */ - DEVCB_NULL, /* line CB1 in */ - DEVCB_NULL, /* line CA2 in */ - DEVCB_NULL, /* line CB2 in */ - DEVCB_DRIVER_MEMBER(mpu4_state,pia_gb_porta_w), /* port A out */ - DEVCB_DRIVER_MEMBER(mpu4_state,pia_gb_portb_w), /* port B out */ - DEVCB_DRIVER_LINE_MEMBER(mpu4_state,pia_gb_ca2_w), /* line CA2 out */ - DEVCB_DRIVER_LINE_MEMBER(mpu4_state,pia_gb_cb2_w), /* line CB2 out */ - DEVCB_NULL, /* IRQA */ - DEVCB_NULL /* IRQB */ -}; - -//Sampled sound timer -/* -The MSM6376 sound chip is configured in a slightly strange way, to enable dynamic -sample rate changes (8Khz, 10.6 Khz, 16 KHz) by varying the clock. -According to the BwB programmer's guide, the formula is: -MSM6376 clock frequency:- -freq = (1720000/((t3L+1)(t3H+1)))*[(t3H(T3L+1)+1)/(2(t1+1))] -where [] means rounded up integer, -t3L is the LSB of Clock 3, -t3H is the MSB of Clock 3, -and t1 is the initial value in clock 1. -*/ - -//O3 -> G1 O1 -> c2 o2 -> c1 -WRITE8_MEMBER(mpu4_state::ic3ss_o1_callback) -{ - device_t * device = machine().device("ptm_ic3ss"); - downcast(device)->set_c2(data); -} - - -WRITE8_MEMBER(mpu4_state::ic3ss_o2_callback)//Generates 'beep' tone -{ - device_t * device = machine().device("ptm_ic3ss"); - downcast(device)->set_c1(data);//? -} - - -WRITE8_MEMBER(mpu4_state::ic3ss_o3_callback) -{ - //downcast(device)->set_g1(data); /* this output is the clock for timer1 */ -} - -/* This is a bit of a cheat - since we don't clock into the OKI chip directly, we need to -calculate the oscillation frequency in advance. We're running the timer for interrupt -purposes, but the frequency calculation is done by plucking the values out as they are written.*/ -WRITE8_MEMBER(mpu4_state::ic3ss_w) -{ - device_t *ic3ss = machine().device("ptm_ic3ss"); - downcast(ic3ss)->write(offset,data); - device_t *msm6376 = machine().device("msm6376"); - - if (offset == 3) - { - m_t1 = data; - } - if (offset == 6) - { - m_t3h = data; - } - if (offset == 7) - { - m_t3l = data; - } - - float num = (1720000/((m_t3l + 1)*(m_t3h + 1))); - float denom1 = ((m_t3h *(m_t3l + 1)+ 1)/(2*(m_t1 + 1))); - - int denom2 = denom1 +0.5;//need to round up, this gives same precision as chip - int freq=num*denom2; - - if (freq) - { - okim6376_set_frequency(msm6376, freq); - } -} - - -static const ptm6840_interface ptm_ic3ss_intf = -{ - MPU4_MASTER_CLOCK / 4, - { 0, 0, 0 }, - { DEVCB_DRIVER_MEMBER(mpu4_state,ic3ss_o1_callback), - DEVCB_DRIVER_MEMBER(mpu4_state,ic3ss_o2_callback), - DEVCB_DRIVER_MEMBER(mpu4_state,ic3ss_o3_callback) }, - DEVCB_NULL//LINE(cpu1_ptm_irq) -}; - -/* input ports for MPU4 board */ -INPUT_PORTS_START( mpu4 ) - PORT_START("ORANGE1") - PORT_BIT(0x01, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("00")// 20p level - PORT_BIT(0x02, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("01")// 100p level - PORT_BIT(0x04, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("02")// Token 1 level - PORT_BIT(0x08, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("03")// Token 2 level - PORT_BIT(0x10, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("04") - PORT_CONFNAME( 0xE0, 0x00, "Stake Key" ) - PORT_CONFSETTING( 0x00, "Not fitted / 5p" ) - PORT_CONFSETTING( 0x20, "10p" ) - PORT_CONFSETTING( 0x40, "20p" ) - PORT_CONFSETTING( 0x60, "25p" ) - PORT_CONFSETTING( 0x80, "30p" ) - PORT_CONFSETTING( 0xA0, "40p" ) - PORT_CONFSETTING( 0xC0, "50p" ) - PORT_CONFSETTING( 0xE0, "1 GBP" ) - - PORT_START("ORANGE2") - PORT_CONFNAME( 0x0F, 0x00, "Jackpot / Prize Key" ) - PORT_CONFSETTING( 0x00, "Not fitted" ) - PORT_CONFSETTING( 0x01, "3 GBP" ) - PORT_CONFSETTING( 0x02, "4 GBP" ) - PORT_CONFSETTING( 0x08, "5 GBP" ) - PORT_CONFSETTING( 0x03, "6 GBP" ) - PORT_CONFSETTING( 0x04, "6 GBP Token" ) - PORT_CONFSETTING( 0x05, "8 GBP" ) - PORT_CONFSETTING( 0x06, "8 GBP Token" ) - PORT_CONFSETTING( 0x07, "10 GBP" ) - PORT_CONFSETTING( 0x09, "15 GBP" ) - PORT_CONFSETTING( 0x0A, "25 GBP" ) - PORT_CONFSETTING( 0x0B, "25 GBP (Licensed Betting Office Profile)" ) - PORT_CONFSETTING( 0x0C, "35 GBP" ) - PORT_CONFSETTING( 0x0D, "70 GBP" ) - PORT_CONFSETTING( 0x0E, "Reserved" ) - PORT_CONFSETTING( 0x0F, "Reserved" ) - - PORT_CONFNAME( 0xF0, 0x00, "Percentage Key" ) - PORT_CONFSETTING( 0x00, "Not fitted / 68% (Invalid for UK Games)" ) - PORT_CONFSETTING( 0x10, "70" ) - PORT_CONFSETTING( 0x20, "72" ) - PORT_CONFSETTING( 0x30, "74" ) - PORT_CONFSETTING( 0x40, "76" ) - PORT_CONFSETTING( 0x50, "78" ) - PORT_CONFSETTING( 0x60, "80" ) - PORT_CONFSETTING( 0x70, "82" ) - PORT_CONFSETTING( 0x80, "84" ) - PORT_CONFSETTING( 0x90, "86" ) - PORT_CONFSETTING( 0xA0, "88" ) - PORT_CONFSETTING( 0xB0, "90" ) - PORT_CONFSETTING( 0xC0, "92" ) - PORT_CONFSETTING( 0xD0, "94" ) - PORT_CONFSETTING( 0xE0, "96" ) - PORT_CONFSETTING( 0xF0, "98" ) - - PORT_START("BLACK1") - PORT_BIT(0x01, IP_ACTIVE_HIGH, IPT_BUTTON1) PORT_NAME("Hi") - PORT_BIT(0x02, IP_ACTIVE_HIGH, IPT_BUTTON2) PORT_NAME("Lo") - PORT_BIT(0x04, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("18") - PORT_BIT(0x08, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("19") - PORT_BIT(0x10, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("20") - PORT_BIT(0x20, IP_ACTIVE_HIGH, IPT_SERVICE) PORT_NAME("Test Button") PORT_CODE(KEYCODE_W) - PORT_BIT(0x40, IP_ACTIVE_HIGH, IPT_SERVICE) PORT_NAME("Refill Key") PORT_CODE(KEYCODE_R) PORT_TOGGLE - PORT_BIT(0x80, IP_ACTIVE_HIGH, IPT_INTERLOCK) PORT_NAME("Cashbox (Back) Door") PORT_CODE(KEYCODE_Q) PORT_TOGGLE - - PORT_START("BLACK2") - PORT_BIT(0x01, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("24") - PORT_BIT(0x02, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("25") - PORT_BIT(0x04, IP_ACTIVE_HIGH, IPT_BUTTON3) PORT_NAME("Cancel") - PORT_BIT(0x08, IP_ACTIVE_HIGH, IPT_BUTTON4) PORT_NAME("Hold 1") - PORT_BIT(0x10, IP_ACTIVE_HIGH, IPT_BUTTON5) PORT_NAME("Hold 2") - PORT_BIT(0x20, IP_ACTIVE_HIGH, IPT_BUTTON6) PORT_NAME("Hold 3") - PORT_BIT(0x40, IP_ACTIVE_HIGH, IPT_BUTTON7) PORT_NAME("Hold 4") - PORT_BIT(0x80, IP_ACTIVE_HIGH, IPT_START1) - - PORT_START("DIL1") - PORT_DIPNAME( 0x01, 0x00, DEF_STR( Unused ) ) PORT_DIPLOCATION("DIL1:01") - PORT_DIPSETTING( 0x00, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x01, DEF_STR( On ) ) - PORT_DIPNAME( 0x02, 0x00, DEF_STR( Unused ) ) PORT_DIPLOCATION("DIL1:02") - PORT_DIPSETTING( 0x00, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x02, DEF_STR( On ) ) - PORT_DIPNAME( 0x04, 0x00, DEF_STR( Unused ) ) PORT_DIPLOCATION("DIL1:03") - PORT_DIPSETTING( 0x00, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x04, DEF_STR( On ) ) - PORT_DIPNAME( 0x08, 0x00, DEF_STR( Unused ) ) PORT_DIPLOCATION("DIL1:04") - PORT_DIPSETTING( 0x00, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x08, DEF_STR( On ) ) - PORT_DIPNAME( 0xF0, 0x00, "Target Percentage (if key not fitted)" )PORT_DIPLOCATION("DIL1:05,06,07,08") - PORT_DIPSETTING( 0x00, "Unset (Program Optimum)" ) - PORT_DIPSETTING( 0x10, "70" ) - PORT_DIPSETTING( 0x20, "72" ) - PORT_DIPSETTING( 0x30, "74" ) - PORT_DIPSETTING( 0x40, "76" ) - PORT_DIPSETTING( 0x50, "78" ) - PORT_DIPSETTING( 0x60, "80" ) - PORT_DIPSETTING( 0x70, "82" ) - PORT_DIPSETTING( 0x80, "84" ) - PORT_DIPSETTING( 0x90, "86" ) - PORT_DIPSETTING( 0xA0, "88" ) - PORT_DIPSETTING( 0xB0, "90" ) - PORT_DIPSETTING( 0xC0, "92" ) - PORT_DIPSETTING( 0xD0, "94" ) - PORT_DIPSETTING( 0xE0, "96" ) - PORT_DIPSETTING( 0xF0, "98" ) - - PORT_START("DIL2") - PORT_DIPNAME( 0x01, 0x00, "Token Lockout when full" ) PORT_DIPLOCATION("DIL2:01") - PORT_DIPSETTING( 0x00, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x01, DEF_STR( On ) ) - PORT_DIPNAME( 0x02, 0x00, DEF_STR( Unused )) PORT_DIPLOCATION("DIL2:02") - PORT_DIPSETTING( 0x00, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x02, DEF_STR( On ) ) - PORT_DIPNAME( 0x04, 0x00, "Scottish Coin Handling" ) PORT_DIPLOCATION("DIL2:03")//20p payout - PORT_DIPSETTING( 0x00, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x04, DEF_STR( On ) ) - PORT_DIPNAME( 0x08, 0x08, "Out of Credit Display Inhibit" ) PORT_DIPLOCATION("DIL2:04") // many games need this on to boot - PORT_DIPSETTING( 0x00, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x08, DEF_STR( On ) ) - PORT_DIPNAME( 0x10, 0x00, "OCD Audio Enable" ) PORT_DIPLOCATION("DIL2:05") - PORT_DIPSETTING( 0x00, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x10, DEF_STR( On ) ) - PORT_DIPNAME( 0x20, 0x00, "Coin Alarm Inhibit" ) PORT_DIPLOCATION("DIL2:06") - PORT_DIPSETTING( 0x00, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x20, DEF_STR( On ) ) - PORT_DIPNAME( 0x40, 0x00, "Token Refill Level Inhibit" ) PORT_DIPLOCATION("DIL2:07") - PORT_DIPSETTING( 0x00, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x40, DEF_STR( On ) ) - PORT_DIPNAME( 0x80, 0x00, "Single Credit Entry" ) PORT_DIPLOCATION("DIL2:08") - PORT_DIPSETTING( 0x00, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x80, DEF_STR( On ) ) - - PORT_START("AUX1") - PORT_BIT(0x01, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("0") - PORT_BIT(0x02, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("1") - PORT_BIT(0x04, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("2") - PORT_BIT(0x08, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("3") - PORT_BIT(0x10, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("4") - PORT_BIT(0x20, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("5") - PORT_BIT(0x40, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("6") - PORT_BIT(0x80, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("7") - - PORT_START("AUX2") - PORT_BIT(0x01, IP_ACTIVE_HIGH, IPT_SPECIAL) - PORT_BIT(0x02, IP_ACTIVE_HIGH, IPT_SPECIAL) - PORT_BIT(0x04, IP_ACTIVE_HIGH, IPT_SPECIAL) - PORT_BIT(0x08, IP_ACTIVE_HIGH, IPT_SPECIAL) - PORT_BIT(0x10, IP_ACTIVE_HIGH, IPT_COIN1) PORT_NAME("10p")PORT_IMPULSE(5) - PORT_BIT(0x20, IP_ACTIVE_HIGH, IPT_COIN2) PORT_NAME("20p")PORT_IMPULSE(5) - PORT_BIT(0x40, IP_ACTIVE_HIGH, IPT_COIN3) PORT_NAME("50p")PORT_IMPULSE(5) - PORT_BIT(0x80, IP_ACTIVE_HIGH, IPT_COIN4) PORT_NAME("100p")PORT_IMPULSE(5) -INPUT_PORTS_END - -INPUT_PORTS_START( mpu4jackpot8tkn ) - PORT_INCLUDE( mpu4 ) - - PORT_MODIFY("ORANGE2") - PORT_CONFNAME( 0x0F, 0x06, "Jackpot / Prize Key" ) - PORT_CONFSETTING( 0x00, "Not fitted" ) - PORT_CONFSETTING( 0x01, "3 GBP" ) - PORT_CONFSETTING( 0x02, "4 GBP" ) - PORT_CONFSETTING( 0x08, "5 GBP" ) - PORT_CONFSETTING( 0x03, "6 GBP" ) - PORT_CONFSETTING( 0x04, "6 GBP Token" ) - PORT_CONFSETTING( 0x05, "8 GBP" ) - PORT_CONFSETTING( 0x06, "8 GBP Token" ) - PORT_CONFSETTING( 0x07, "10 GBP" ) - PORT_CONFSETTING( 0x09, "15 GBP" ) - PORT_CONFSETTING( 0x0A, "25 GBP" ) - PORT_CONFSETTING( 0x0B, "25 GBP (Licensed Betting Office Profile)" ) - PORT_CONFSETTING( 0x0C, "35 GBP" ) - PORT_CONFSETTING( 0x0D, "70 GBP" ) - PORT_CONFSETTING( 0x0E, "Reserved" ) - PORT_CONFSETTING( 0x0F, "Reserved" ) -INPUT_PORTS_END - -INPUT_PORTS_START( mpu4jackpot8per ) - PORT_INCLUDE( mpu4 ) - - PORT_MODIFY("ORANGE2") - PORT_CONFNAME( 0x0F, 0x06, "Jackpot / Prize Key" ) - PORT_CONFSETTING( 0x00, "Not fitted" ) - PORT_CONFSETTING( 0x01, "3 GBP" ) - PORT_CONFSETTING( 0x02, "4 GBP" ) - PORT_CONFSETTING( 0x08, "5 GBP" ) - PORT_CONFSETTING( 0x03, "6 GBP" ) - PORT_CONFSETTING( 0x04, "6 GBP Token" ) - PORT_CONFSETTING( 0x05, "8 GBP" ) - PORT_CONFSETTING( 0x06, "8 GBP Token" ) - PORT_CONFSETTING( 0x07, "10 GBP" ) - PORT_CONFSETTING( 0x09, "15 GBP" ) - PORT_CONFSETTING( 0x0A, "25 GBP" ) - PORT_CONFSETTING( 0x0B, "25 GBP (Licensed Betting Office Profile)" ) - PORT_CONFSETTING( 0x0C, "35 GBP" ) - PORT_CONFSETTING( 0x0D, "70 GBP" ) - PORT_CONFSETTING( 0x0E, "Reserved" ) - PORT_CONFSETTING( 0x0F, "Reserved" ) - - PORT_CONFNAME( 0xF0, 0x10, "Percentage Key" ) - PORT_CONFSETTING( 0x00, "Not fitted / 68% (Invalid for UK Games)" ) - PORT_CONFSETTING( 0x10, "70" ) - PORT_CONFSETTING( 0x20, "72" ) - PORT_CONFSETTING( 0x30, "74" ) - PORT_CONFSETTING( 0x40, "76" ) - PORT_CONFSETTING( 0x50, "78" ) - PORT_CONFSETTING( 0x60, "80" ) - PORT_CONFSETTING( 0x70, "82" ) - PORT_CONFSETTING( 0x80, "84" ) - PORT_CONFSETTING( 0x90, "86" ) - PORT_CONFSETTING( 0xA0, "88" ) - PORT_CONFSETTING( 0xB0, "90" ) - PORT_CONFSETTING( 0xC0, "92" ) - PORT_CONFSETTING( 0xD0, "94" ) - PORT_CONFSETTING( 0xE0, "96" ) - PORT_CONFSETTING( 0xF0, "98" ) -INPUT_PORTS_END - - -static INPUT_PORTS_START( connect4 ) - PORT_START("ORANGE1") - PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("00") - PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("01") - PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("02") - PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("03") - PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("04") - PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("05") - PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("06") - PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("07") - - PORT_START("ORANGE2") - PORT_BIT(0x01, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("08") - PORT_BIT(0x02, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("09") - PORT_BIT(0x04, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("10") - PORT_BIT(0x08, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("11") - PORT_BIT(0x10, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("12") - PORT_BIT(0x20, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("13") - PORT_BIT(0x40, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("14") - PORT_BIT(0x80, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("15") - - PORT_START("BLACK1") - PORT_BIT(0x01, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("16") - PORT_BIT(0x02, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("17") - PORT_BIT(0x04, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("18") - PORT_BIT(0x08, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("19") - PORT_BIT(0x10, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("20") - PORT_BIT(0x20, IP_ACTIVE_HIGH, IPT_SERVICE) PORT_NAME("Test Switch") - PORT_BIT(0x40, IP_ACTIVE_HIGH, IPT_SERVICE) PORT_NAME("Refill Key") PORT_CODE(KEYCODE_R) PORT_TOGGLE - PORT_BIT(0x80, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Door Switch?") PORT_TOGGLE - - PORT_START("BLACK2") - PORT_BIT(0x01, IP_ACTIVE_HIGH, IPT_BUTTON1) PORT_NAME("Select") - PORT_BIT(0x02, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("25") - PORT_BIT(0x04, IP_ACTIVE_HIGH, IPT_START2) PORT_NAME("Pass") - PORT_BIT(0x08, IP_ACTIVE_HIGH, IPT_START1) PORT_NAME("Play") - PORT_BIT(0x10, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("28") - PORT_BIT(0x20, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("29") - PORT_BIT(0x40, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("30") - PORT_BIT(0x80, IP_ACTIVE_HIGH, IPT_BUTTON2) PORT_NAME("Drop") - - PORT_START("DIL1") - PORT_DIPNAME( 0x80, 0x00, "DIL101" ) PORT_DIPLOCATION("DIL1:01") - PORT_DIPSETTING( 0x00, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x80, DEF_STR( On ) ) - PORT_DIPNAME( 0x40, 0x00, "DIL102" ) PORT_DIPLOCATION("DIL1:02") - PORT_DIPSETTING( 0x00, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x40, DEF_STR( On ) ) - PORT_DIPNAME( 0x20, 0x00, "DIL103" ) PORT_DIPLOCATION("DIL1:03") - PORT_DIPSETTING( 0x00, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x20, DEF_STR( On ) ) - PORT_DIPNAME( 0x10, 0x00, "DIL104" ) PORT_DIPLOCATION("DIL1:04") - PORT_DIPSETTING( 0x00, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x10, DEF_STR( On ) ) - PORT_DIPNAME( 0x08, 0x00, "DIL105" ) PORT_DIPLOCATION("DIL1:05") - PORT_DIPSETTING( 0x00, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x08, DEF_STR( On ) ) - PORT_DIPNAME( 0x04, 0x00, "DIL106" ) PORT_DIPLOCATION("DIL1:06") - PORT_DIPSETTING( 0x00, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x04, DEF_STR( On ) ) - PORT_DIPNAME( 0x02, 0x00, "DIL107" ) PORT_DIPLOCATION("DIL1:07") - PORT_DIPSETTING( 0x00, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x02, DEF_STR( On ) ) - PORT_DIPNAME( 0x01, 0x00, "DIL108" ) PORT_DIPLOCATION("DIL1:08") - PORT_DIPSETTING( 0x00, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x01, DEF_STR( On ) ) - - PORT_START("DIL2") - PORT_DIPNAME( 0x80, 0x00, "DIL201" ) PORT_DIPLOCATION("DIL2:01") - PORT_DIPSETTING( 0x00, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x80, DEF_STR( On ) ) - PORT_DIPNAME( 0x40, 0x00, "DIL202" ) PORT_DIPLOCATION("DIL2:02") - PORT_DIPSETTING( 0x00, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x40, DEF_STR( On ) ) - PORT_DIPNAME( 0x20, 0x00, "DIL203" ) PORT_DIPLOCATION("DIL2:03") - PORT_DIPSETTING( 0x00, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x20, DEF_STR( On ) ) - PORT_DIPNAME( 0x10, 0x00, "DIL204" ) PORT_DIPLOCATION("DIL2:04") - PORT_DIPSETTING( 0x00, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x10, DEF_STR( On ) ) - PORT_DIPNAME( 0x08, 0x00, "DIL205" ) PORT_DIPLOCATION("DIL2:05") - PORT_DIPSETTING( 0x00, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x08, DEF_STR( On ) ) - PORT_DIPNAME( 0x04, 0x00, "DIL206" ) PORT_DIPLOCATION("DIL2:06") - PORT_DIPSETTING( 0x00, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x04, DEF_STR( On ) ) - PORT_DIPNAME( 0x02, 0x00, "DIL207" ) PORT_DIPLOCATION("DIL2:07") - PORT_DIPSETTING( 0x00, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x02, DEF_STR( On ) ) - PORT_DIPNAME( 0x01, 0x00, "DIL208" ) PORT_DIPLOCATION("DIL2:08") - PORT_DIPSETTING( 0x00, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x01, DEF_STR( On ) ) - - PORT_START("AUX1") - PORT_BIT(0x01, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("0") - PORT_BIT(0x02, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("1") - PORT_BIT(0x04, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("2") - PORT_BIT(0x08, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("3") - PORT_BIT(0x10, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("4") - PORT_BIT(0x20, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("5") - PORT_BIT(0x40, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("6") - PORT_BIT(0x80, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("7") - - PORT_START("AUX2") - PORT_BIT(0x01, IP_ACTIVE_HIGH, IPT_SPECIAL) - PORT_BIT(0x02, IP_ACTIVE_HIGH, IPT_SPECIAL) - PORT_BIT(0x04, IP_ACTIVE_HIGH, IPT_SPECIAL) - PORT_BIT(0x08, IP_ACTIVE_HIGH, IPT_SPECIAL) - PORT_BIT(0x10, IP_ACTIVE_HIGH, IPT_COIN1) PORT_NAME("10p")PORT_IMPULSE(5) - PORT_BIT(0x20, IP_ACTIVE_HIGH, IPT_COIN2) PORT_NAME("20p")PORT_IMPULSE(5) - PORT_BIT(0x40, IP_ACTIVE_HIGH, IPT_COIN3) PORT_NAME("50p")PORT_IMPULSE(5) - PORT_BIT(0x80, IP_ACTIVE_HIGH, IPT_COIN4) PORT_NAME("100p")PORT_IMPULSE(5) -INPUT_PORTS_END - -static INPUT_PORTS_START( gamball ) - PORT_START("ORANGE1") - PORT_BIT(0x01, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("00")// 20p level - PORT_BIT(0x02, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("01")// 100p level - PORT_BIT(0x04, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("02")// Token 1 level - PORT_BIT(0x08, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("03")// Token 2 level - PORT_BIT(0x10, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("04") - PORT_CONFNAME( 0xE0, 0x00, "Stake Key" ) - PORT_CONFSETTING( 0x00, "Not fitted / 5p" ) - PORT_CONFSETTING( 0x20, "10p" ) - PORT_CONFSETTING( 0x40, "20p" ) - PORT_CONFSETTING( 0x60, "25p" ) - PORT_CONFSETTING( 0x80, "30p" ) - PORT_CONFSETTING( 0xA0, "40p" ) - PORT_CONFSETTING( 0xC0, "50p" ) - PORT_CONFSETTING( 0xE0, "1 GBP" ) - - PORT_START("ORANGE2") - PORT_CONFNAME( 0x0F, 0x00, "Jackpot / Prize Key" ) - PORT_CONFSETTING( 0x00, "Not fitted" ) - PORT_CONFSETTING( 0x01, "3 GBP" ) - PORT_CONFSETTING( 0x02, "4 GBP" ) - PORT_CONFSETTING( 0x08, "5 GBP" ) - PORT_CONFSETTING( 0x03, "6 GBP" ) - PORT_CONFSETTING( 0x04, "6 GBP Token" ) - PORT_CONFSETTING( 0x05, "8 GBP" ) - PORT_CONFSETTING( 0x06, "8 GBP Token" ) - PORT_CONFSETTING( 0x07, "10 GBP" ) - PORT_CONFSETTING( 0x09, "15 GBP" ) - PORT_CONFSETTING( 0x0A, "25 GBP" ) - PORT_CONFSETTING( 0x0B, "25 GBP (Licensed Betting Office Profile)" ) - PORT_CONFSETTING( 0x0C, "35 GBP" ) - PORT_CONFSETTING( 0x0D, "70 GBP" ) - PORT_CONFSETTING( 0x0E, "Reserved" ) - PORT_CONFSETTING( 0x0F, "Reserved" ) - - PORT_CONFNAME( 0xF0, 0x00, "Percentage Key" ) - PORT_CONFSETTING( 0x00, "As Option Switches" ) - PORT_CONFSETTING( 0x10, "70" ) - PORT_CONFSETTING( 0x20, "72" ) - PORT_CONFSETTING( 0x30, "74" ) - PORT_CONFSETTING( 0x40, "76" ) - PORT_CONFSETTING( 0x50, "78" ) - PORT_CONFSETTING( 0x60, "80" ) - PORT_CONFSETTING( 0x70, "82" ) - PORT_CONFSETTING( 0x80, "84" ) - PORT_CONFSETTING( 0x90, "86" ) - PORT_CONFSETTING( 0xA0, "88" ) - PORT_CONFSETTING( 0xB0, "90" ) - PORT_CONFSETTING( 0xC0, "92" ) - PORT_CONFSETTING( 0xD0, "94" ) - PORT_CONFSETTING( 0xE0, "96" ) - PORT_CONFSETTING( 0xF0, "98" ) - - PORT_START("BLACK1") - PORT_BIT(0x01, IP_ACTIVE_HIGH, IPT_BUTTON1) PORT_NAME("Hi") - PORT_BIT(0x02, IP_ACTIVE_HIGH, IPT_BUTTON2) PORT_NAME("Lo") - PORT_BIT(0x04, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("18") - PORT_BIT(0x08, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("19") - PORT_BIT(0x10, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("20") - PORT_BIT(0x20, IP_ACTIVE_HIGH, IPT_SERVICE) PORT_NAME("Test Button") PORT_CODE(KEYCODE_W) - PORT_BIT(0x40, IP_ACTIVE_HIGH, IPT_SERVICE) PORT_NAME("Refill Key") PORT_CODE(KEYCODE_R) PORT_TOGGLE - PORT_BIT(0x80, IP_ACTIVE_HIGH, IPT_INTERLOCK) PORT_NAME("Cashbox Door") PORT_CODE(KEYCODE_Q) PORT_TOGGLE - - PORT_START("BLACK2") - PORT_BIT(0x01, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("24") - PORT_BIT(0x02, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("25") - PORT_BIT(0x04, IP_ACTIVE_HIGH, IPT_BUTTON3) PORT_NAME("Cancel/Collect") - PORT_BIT(0x08, IP_ACTIVE_HIGH, IPT_BUTTON4) PORT_NAME("Hold/Nudge 1") - PORT_BIT(0x10, IP_ACTIVE_HIGH, IPT_BUTTON5) PORT_NAME("Hold/Nudge 2") - PORT_BIT(0x20, IP_ACTIVE_HIGH, IPT_BUTTON6) PORT_NAME("Hold/Nudge 3") - PORT_BIT(0x40, IP_ACTIVE_HIGH, IPT_BUTTON7) PORT_NAME("Hold/Nudge 4") - PORT_BIT(0x80, IP_ACTIVE_HIGH, IPT_START1) - - PORT_START("DIL1") - PORT_DIPNAME( 0x80, 0x00, "DIL101" ) PORT_DIPLOCATION("DIL1:01") - PORT_DIPSETTING( 0x00, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x80, DEF_STR( On ) ) - PORT_DIPNAME( 0x40, 0x00, "DIL102" ) PORT_DIPLOCATION("DIL1:02") - PORT_DIPSETTING( 0x00, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x40, DEF_STR( On ) ) - PORT_DIPNAME( 0x20, 0x00, "DIL103" ) PORT_DIPLOCATION("DIL1:03") - PORT_DIPSETTING( 0x00, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x20, DEF_STR( On ) ) - PORT_DIPNAME( 0x10, 0x00, "DIL104" ) PORT_DIPLOCATION("DIL1:04") - PORT_DIPSETTING( 0x00, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x10, DEF_STR( On ) ) - PORT_DIPNAME( 0x08, 0x00, "DIL105" ) PORT_DIPLOCATION("DIL1:05") - PORT_DIPSETTING( 0x00, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x08, DEF_STR( On ) ) - PORT_DIPNAME( 0x04, 0x00, "DIL106" ) PORT_DIPLOCATION("DIL1:06") - PORT_DIPSETTING( 0x00, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x04, DEF_STR( On ) ) - PORT_DIPNAME( 0x02, 0x00, "DIL107" ) PORT_DIPLOCATION("DIL1:07") - PORT_DIPSETTING( 0x00, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x02, DEF_STR( On ) ) - PORT_DIPNAME( 0x01, 0x00, "DIL108" ) PORT_DIPLOCATION("DIL1:08") - PORT_DIPSETTING( 0x00, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x01, DEF_STR( On ) ) - - PORT_START("DIL2") - PORT_DIPNAME( 0x80, 0x00, "DIL201" ) PORT_DIPLOCATION("DIL2:01") - PORT_DIPSETTING( 0x00, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x80, DEF_STR( On ) ) - PORT_DIPNAME( 0x40, 0x00, "DIL202" ) PORT_DIPLOCATION("DIL2:02") - PORT_DIPSETTING( 0x00, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x40, DEF_STR( On ) ) - PORT_DIPNAME( 0x20, 0x00, "DIL203" ) PORT_DIPLOCATION("DIL2:03") - PORT_DIPSETTING( 0x00, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x20, DEF_STR( On ) ) - PORT_DIPNAME( 0x10, 0x00, "DIL204" ) PORT_DIPLOCATION("DIL2:04") - PORT_DIPSETTING( 0x00, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x10, DEF_STR( On ) ) - PORT_DIPNAME( 0x08, 0x00, "DIL205" ) PORT_DIPLOCATION("DIL2:05") - PORT_DIPSETTING( 0x00, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x08, DEF_STR( On ) ) - PORT_DIPNAME( 0x04, 0x00, "DIL206" ) PORT_DIPLOCATION("DIL2:06") - PORT_DIPSETTING( 0x00, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x04, DEF_STR( On ) ) - PORT_DIPNAME( 0x02, 0x00, "DIL207" ) PORT_DIPLOCATION("DIL2:07") - PORT_DIPSETTING( 0x00, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x02, DEF_STR( On ) ) - PORT_DIPNAME( 0x01, 0x00, "DIL208" ) PORT_DIPLOCATION("DIL2:08") - PORT_DIPSETTING( 0x00, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x01, DEF_STR( On ) ) - - PORT_START("AUX1") - PORT_BIT(0xFF, IP_ACTIVE_HIGH, IPT_SPECIAL)//Handled by Gamball unit - - PORT_START("AUX2") - PORT_BIT(0x01, IP_ACTIVE_HIGH, IPT_SPECIAL) - PORT_BIT(0x02, IP_ACTIVE_HIGH, IPT_SPECIAL) - PORT_BIT(0x04, IP_ACTIVE_HIGH, IPT_SPECIAL) - PORT_BIT(0x08, IP_ACTIVE_HIGH, IPT_SPECIAL) - PORT_BIT(0x10, IP_ACTIVE_HIGH, IPT_COIN1) PORT_NAME("10p")PORT_IMPULSE(5) - PORT_BIT(0x20, IP_ACTIVE_HIGH, IPT_COIN2) PORT_NAME("20p")PORT_IMPULSE(5) - PORT_BIT(0x40, IP_ACTIVE_HIGH, IPT_COIN3) PORT_NAME("50p")PORT_IMPULSE(5) - PORT_BIT(0x80, IP_ACTIVE_HIGH, IPT_COIN4) PORT_NAME("100p")PORT_IMPULSE(5) -INPUT_PORTS_END - -static INPUT_PORTS_START( grtecp ) - PORT_START("ORANGE1") - PORT_BIT(0x01, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("00")// 20p level - PORT_BIT(0x02, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("01")// 100p level - PORT_BIT(0x04, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("02")// Token 1 level - PORT_BIT(0x08, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("03")// Token 2 level - PORT_BIT(0x10, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("04") - PORT_CONFNAME( 0xE0, 0x00, "Stake Key" ) - PORT_CONFSETTING( 0x00, "Not fitted / 5p" ) - PORT_CONFSETTING( 0x20, "10p" ) - PORT_CONFSETTING( 0x40, "20p" ) - PORT_CONFSETTING( 0x60, "25p" ) - PORT_CONFSETTING( 0x80, "30p" ) - PORT_CONFSETTING( 0xA0, "40p" ) - PORT_CONFSETTING( 0xC0, "50p" ) - PORT_CONFSETTING( 0xE0, "1 GBP" ) - - PORT_START("ORANGE2") - PORT_CONFNAME( 0x0F, 0x00, "Jackpot / Prize Key" ) - PORT_CONFSETTING( 0x00, "Not fitted" ) - PORT_CONFSETTING( 0x01, "3 GBP" ) - PORT_CONFSETTING( 0x02, "4 GBP" ) - PORT_CONFSETTING( 0x08, "5 GBP" ) - PORT_CONFSETTING( 0x03, "6 GBP" ) - PORT_CONFSETTING( 0x04, "6 GBP Token" ) - PORT_CONFSETTING( 0x05, "8 GBP" ) - PORT_CONFSETTING( 0x06, "8 GBP Token" ) - PORT_CONFSETTING( 0x07, "10 GBP" ) - PORT_CONFSETTING( 0x09, "15 GBP" ) - PORT_CONFSETTING( 0x0A, "25 GBP" ) - PORT_CONFSETTING( 0x0B, "25 GBP (Licensed Betting Office Profile)" ) - PORT_CONFSETTING( 0x0C, "35 GBP" ) - PORT_CONFSETTING( 0x0D, "70 GBP" ) - PORT_CONFSETTING( 0x0E, "Reserved" ) - PORT_CONFSETTING( 0x0F, "Reserved" ) - - PORT_CONFNAME( 0xF0, 0x00, "Percentage Key" ) - PORT_CONFSETTING( 0x00, "As Option Switches" ) - PORT_CONFSETTING( 0x10, "70" ) - PORT_CONFSETTING( 0x20, "72" ) - PORT_CONFSETTING( 0x30, "74" ) - PORT_CONFSETTING( 0x40, "76" ) - PORT_CONFSETTING( 0x50, "78" ) - PORT_CONFSETTING( 0x60, "80" ) - PORT_CONFSETTING( 0x70, "82" ) - PORT_CONFSETTING( 0x80, "84" ) - PORT_CONFSETTING( 0x90, "86" ) - PORT_CONFSETTING( 0xA0, "88" ) - PORT_CONFSETTING( 0xB0, "90" ) - PORT_CONFSETTING( 0xC0, "92" ) - PORT_CONFSETTING( 0xD0, "94" ) - PORT_CONFSETTING( 0xE0, "96" ) - PORT_CONFSETTING( 0xF0, "98" ) - - PORT_START("BLACK1") - PORT_BIT(0x01, IP_ACTIVE_HIGH, IPT_UNUSED) - PORT_BIT(0x02, IP_ACTIVE_HIGH, IPT_UNUSED) - PORT_BIT(0x04, IP_ACTIVE_HIGH, IPT_UNUSED) - PORT_BIT(0x08, IP_ACTIVE_HIGH, IPT_UNUSED) - PORT_BIT(0x10, IP_ACTIVE_HIGH, IPT_UNUSED) - PORT_BIT(0x20, IP_ACTIVE_HIGH, IPT_SERVICE) PORT_NAME("Test Button") PORT_CODE(KEYCODE_W) - PORT_BIT(0x40, IP_ACTIVE_HIGH, IPT_SERVICE) PORT_NAME("Refill Key") PORT_CODE(KEYCODE_R) PORT_TOGGLE - PORT_BIT(0x80, IP_ACTIVE_HIGH, IPT_INTERLOCK) PORT_NAME("Cashbox (Back) Door") PORT_CODE(KEYCODE_Q) PORT_TOGGLE - - PORT_START("BLACK2") - PORT_BIT(0x01, IP_ACTIVE_HIGH, IPT_BUTTON1) PORT_NAME("Collect/Cancel") - PORT_BIT(0x02, IP_ACTIVE_HIGH, IPT_BUTTON2) PORT_NAME("Hold 1") - PORT_BIT(0x04, IP_ACTIVE_HIGH, IPT_BUTTON3) PORT_NAME("Hold 2") - PORT_BIT(0x08, IP_ACTIVE_HIGH, IPT_BUTTON4) PORT_NAME("Hold 3") - PORT_BIT(0x10, IP_ACTIVE_HIGH, IPT_BUTTON5) PORT_NAME("Hi") - PORT_BIT(0x20, IP_ACTIVE_HIGH, IPT_BUTTON6) PORT_NAME("Lo") - PORT_BIT(0x40, IP_ACTIVE_HIGH, IPT_BUTTON7) PORT_NAME("Exchange") - PORT_BIT(0x80, IP_ACTIVE_HIGH, IPT_START1) - - PORT_START("DIL1") - PORT_DIPNAME( 0x01, 0x00, DEF_STR( Unused ) ) PORT_DIPLOCATION("DIL1:01") - PORT_DIPSETTING( 0x00, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x01, DEF_STR( On ) ) - PORT_DIPNAME( 0x02, 0x00, DEF_STR( Unused ) ) PORT_DIPLOCATION("DIL1:02") - PORT_DIPSETTING( 0x00, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x02, DEF_STR( On ) ) - PORT_DIPNAME( 0x04, 0x00, DEF_STR( Unused ) ) PORT_DIPLOCATION("DIL1:03") - PORT_DIPSETTING( 0x00, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x04, DEF_STR( On ) ) - PORT_DIPNAME( 0x08, 0x00, DEF_STR( Unused ) ) PORT_DIPLOCATION("DIL1:04") - PORT_DIPSETTING( 0x00, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x08, DEF_STR( On ) ) - PORT_DIPNAME( 0xF0, 0x00, "Target Percentage (if key not fitted)" )PORT_DIPLOCATION("DIL1:05,06,07,08") - PORT_DIPSETTING( 0x00, "Unset (Program Optimum)" ) - PORT_DIPSETTING( 0x10, "70" ) - PORT_DIPSETTING( 0x20, "72" ) - PORT_DIPSETTING( 0x30, "74" ) - PORT_DIPSETTING( 0x40, "76" ) - PORT_DIPSETTING( 0x50, "78" ) - PORT_DIPSETTING( 0x60, "80" ) - PORT_DIPSETTING( 0x70, "82" ) - PORT_DIPSETTING( 0x80, "84" ) - PORT_DIPSETTING( 0x90, "86" ) - PORT_DIPSETTING( 0xA0, "88" ) - PORT_DIPSETTING( 0xB0, "90" ) - PORT_DIPSETTING( 0xC0, "92" ) - PORT_DIPSETTING( 0xD0, "94" ) - PORT_DIPSETTING( 0xE0, "96" ) - PORT_DIPSETTING( 0xF0, "98" ) - - PORT_START("DIL2") - PORT_DIPNAME( 0x01, 0x00, "Token Lockout when full" ) PORT_DIPLOCATION("DIL2:01") - PORT_DIPSETTING( 0x00, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x01, DEF_STR( On ) ) - PORT_DIPNAME( 0x02, 0x00, DEF_STR( Unused )) PORT_DIPLOCATION("DIL2:02") - PORT_DIPSETTING( 0x00, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x02, DEF_STR( On ) ) - PORT_DIPNAME( 0x04, 0x00, "Scottish Coin Handling" ) PORT_DIPLOCATION("DIL2:03")//20p payout - PORT_DIPSETTING( 0x00, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x04, DEF_STR( On ) ) - PORT_DIPNAME( 0x08, 0x00, "Out of Credit Display Inhibit" ) PORT_DIPLOCATION("DIL2:04") - PORT_DIPSETTING( 0x00, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x08, DEF_STR( On ) ) - PORT_DIPNAME( 0x10, 0x00, "OCD Audio Enable" ) PORT_DIPLOCATION("DIL2:05") - PORT_DIPSETTING( 0x00, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x10, DEF_STR( On ) ) - PORT_DIPNAME( 0x20, 0x00, "Coin Alarm Inhibit" ) PORT_DIPLOCATION("DIL2:06") - PORT_DIPSETTING( 0x00, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x20, DEF_STR( On ) ) - PORT_DIPNAME( 0x40, 0x00, "Token Refill Level Inhibit" ) PORT_DIPLOCATION("DIL2:07") - PORT_DIPSETTING( 0x00, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x40, DEF_STR( On ) ) - PORT_DIPNAME( 0x80, 0x00, "Single Credit Entry" ) PORT_DIPLOCATION("DIL2:08") - PORT_DIPSETTING( 0x00, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x80, DEF_STR( On ) ) - - PORT_START("AUX1") - PORT_BIT(0x01, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("0") - PORT_BIT(0x02, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("1") - PORT_BIT(0x04, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("2") - PORT_BIT(0x08, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("3") - PORT_BIT(0x10, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("4") - PORT_BIT(0x20, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("5") - PORT_BIT(0x40, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("6") - PORT_BIT(0x80, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("7") - - PORT_START("AUX2") - PORT_BIT(0x01, IP_ACTIVE_HIGH, IPT_SPECIAL) - PORT_BIT(0x02, IP_ACTIVE_HIGH, IPT_SPECIAL) - PORT_BIT(0x04, IP_ACTIVE_HIGH, IPT_SPECIAL) - PORT_BIT(0x08, IP_ACTIVE_HIGH, IPT_SPECIAL) - PORT_BIT(0x10, IP_ACTIVE_HIGH, IPT_COIN1) PORT_NAME("10p")PORT_IMPULSE(5) - PORT_BIT(0x20, IP_ACTIVE_HIGH, IPT_COIN2) PORT_NAME("20p")PORT_IMPULSE(5) - PORT_BIT(0x40, IP_ACTIVE_HIGH, IPT_COIN3) PORT_NAME("50p")PORT_IMPULSE(5) - PORT_BIT(0x80, IP_ACTIVE_HIGH, IPT_COIN4) PORT_NAME("100p")PORT_IMPULSE(5) -INPUT_PORTS_END - -static const stepper_interface barcrest_reel_interface = -{ - BARCREST_48STEP_REEL, - 1, - 3, - 0x00, - 2 -}; - -static const stepper_interface barcrest_opto1_interface = -{ - BARCREST_48STEP_REEL, - 4, - 12, - 0x00, - 2 -}; - -static const stepper_interface barcrest_opto2_interface = -{ - BARCREST_48STEP_REEL, - 92, - 3, - 0x00, - 2 -}; - -static const stepper_interface barcrest_opto3_interface = -{ - BARCREST_48STEP_REEL, - 0, - 5, - 0x00, - 2 -}; - -static const stepper_interface bwb_opto1_interface = -{ - BARCREST_48STEP_REEL, - 96, - 3, - 0x00, - 2 -}; - -/* -Characteriser (CHR) - -As built, the CHR is a PAL which can perform basic bit manipulation according to -an as yet unknown unique key. However, the programmers decided to best use this protection device in read/write/compare -cycles, storing almost the entire 'hidden' data table in the ROMs in plain sight. Only later rebuilds by BwB -avoided this 'feature' of the development kit, and will need a different setup. - -This information has been used to generate the CHR tables loaded by the programs, until a key can be determined. - -For most Barcrest games, the following method was used: - -The initial 'PALTEST' routine as found in the Barcrest programs simply writes the first 'call' to the CHR space, -to read back the 'response'. There is no attempt to alter the order or anything else, just -a simple runthrough of the entire data table. The only 'catch' in this is to note that the CHR chip always scans -through the table starting at the last accessed data value, unless 00 is used to reset to the beginning. This is obviously -a simplification, in fact the PAL does bit manipulation with some latching. - -However, a final 8 byte row, that controls the lamp matrix is not tested - to date, no-one outside of Barcrest knows -how this is generated, and currently trial and error is the only sensible method. It is noted that the default, -of all 00, is sometimes the correct answer, particularly in non-Barcrest use of the CHR chip, though when used normally, -there are again fixed call values. -*/ - - -WRITE8_MEMBER(mpu4_state::characteriser_w) -{ - int x; - int call=data; - LOG_CHR_FULL(("%04x Characteriser write offset %02X data %02X", cpu_get_previouspc(&space.device()),offset,data)); - if (!m_current_chr_table) - { - logerror("No Characteriser Table @ %04x\n", cpu_get_previouspc(&space.device())); - return; - } - - - - if (offset == 0) - { - { - if (call == 0) - { - m_prot_col = 0; - } - else - { - for (x = m_prot_col; x < 64; x++) - { - if (m_current_chr_table[(x)].call == call) - { - m_prot_col = x; - LOG_CHR(("Characteriser find column %02X\n",m_prot_col)); - break; - } - } - } - } - } - else if (offset == 2) - { - LOG_CHR(("Characteriser write 2 data %02X\n",data)); - switch (call) - // Rather than the search strategy, we can map the calls directly here. Note that they are hex versions of the square number series - { - case 0x00: - m_lamp_col = 0; - break; - case 0x01: - m_lamp_col = 1; - break; - case 0x04: - m_lamp_col = 2; - break; - case 0x09: - m_lamp_col = 3; - break; - case 0x10: - m_lamp_col = 4; - break; - case 0x19: - m_lamp_col = 5; - break; - case 0x24: - m_lamp_col = 6; - break; - case 0x31: - m_lamp_col = 7; - break; - } - LOG_CHR(("Characteriser find 2 column %02X\n",m_lamp_col)); - } -} - - -READ8_MEMBER(mpu4_state::characteriser_r) -{ - if (!m_current_chr_table) - { - logerror("No Characteriser Table @ %04x", cpu_get_previouspc(&space.device())); - - /* a cheat ... many early games use a standard check */ - int addr = cpu_get_reg(&space.device(), M6809_X); - if ((addr>=0x800) && (addr<=0xfff)) return 0x00; // prevent recursion, only care about ram/rom areas for this cheat. - - UINT8 ret = space.read_byte(addr); - logerror(" (returning %02x)",ret); - - logerror("\n"); - - return ret; - } - - LOG_CHR(("Characteriser read offset %02X \n",offset)); - if (offset == 0) - { - LOG_CHR(("Characteriser read data %02X \n",m_current_chr_table[m_prot_col].response)); - return m_current_chr_table[m_prot_col].response; - } - if (offset == 3) - { - LOG_CHR(("Characteriser read data off 3 %02X \n",m_current_chr_table[m_lamp_col+64].response)); - return m_current_chr_table[m_lamp_col+64].response; - } - return 0; -} - -/* -BwB Characteriser (CHR) - -The BwB method of protection is considerably different to the Barcrest one, with any -incorrect behaviour manifesting in ridiculously large payouts. The hardware is the -same, however the main weakness of the software has been eliminated. - -In fact, the software seems deliberately designed to mislead, but is (fortunately for -us) prone to similar weaknesses that allow a per game solution. - -Project Amber performed a source analysis (available on request) which appears to make things work. -Said weaknesses (A Cheats Guide according to Project Amber) - -The common initialisation sequence is "00 04 04 0C 0C 1C 14 2C 5C 2C" - 0 1 2 3 4 5 6 7 8 -Using debug search for the first read from said string (best to find it first). - -At this point, the X index on the CPU is at the magic number address. - -The subsequent calls for each can be found based on the magic address - - (0) = ( (BWBMagicAddress)) - (1) = ( (BWBMagicAddress + 1)) - (2) = ( (BWBMagicAddress + 2)) - (3) = ( (BWBMagicAddress + 4)) - (4) = ( (BWBMagicAddress - 5)) - (5) = ( (BWBMagicAddress - 4)) - (6) = ( (BWBMagicAddress - 3)) - (7) = ( (BWBMagicAddress - 2)) - (8) = ( (BWBMagicAddress - 1)) - -These return the standard init sequence as above. - -For ease of understanding, we use three tables, one holding the common responses -and two holding the appropriate call and response pairs for the two stages of operation -*/ - - -WRITE8_MEMBER(mpu4_state::bwb_characteriser_w) -{ - int x; - int call=data; - LOG_CHR_FULL(("%04x Characteriser write offset %02X data %02X \n", cpu_get_previouspc(&space.device()),offset,data)); - if (!m_current_chr_table) - fatalerror("No Characteriser Table @ %04x\n", cpu_get_previouspc(&space.device())); - - if ((offset & 0x3f)== 0)//initialisation is always at 0x800 - { - if (!m_chr_state) - { - m_chr_state=1; - m_chr_counter=0; - } - if (call == 0) - { - m_init_col ++; - } - else - { - m_init_col =0; - } - } - - m_chr_value = machine().rand(); - for (x = 0; x < 4; x++) - { - if (m_current_chr_table[(x)].call == call) - { - if (x == 0) // reinit - { - m_bwb_return = 0; - } - m_chr_value = bwb_chr_table_common[(m_bwb_return)]; - m_bwb_return++; - break; - } - } -} - -READ8_MEMBER(mpu4_state::bwb_characteriser_r) -{ - - LOG_CHR(("Characteriser read offset %02X \n",offset)); - - - if (offset ==0) - { - switch (m_chr_counter) - { - case 6: - case 13: - case 20: - case 27: - case 34: - { - return m_bwb_chr_table1[(((m_chr_counter + 1) / 7) - 1)].response; - break; - } - default: - { - if (m_chr_counter > 34) - { - m_chr_counter = 35; - m_chr_state = 2; - } - m_chr_counter ++; - return m_chr_value; - } - } - } - else - { - return m_chr_value; - } -} - -/* Common configurations */ - -WRITE8_MEMBER(mpu4_state::mpu4_ym2413_w) -{ - device_t *ym = machine().device("ym2413"); - if (ym) ym2413_w(ym,offset,data); -} - -READ8_MEMBER(mpu4_state::mpu4_ym2413_r) -{ -// device_t *ym = machine().device("ym2413"); -// return ym2413_read(ym,offset); - return 0xff; -} - - -void mpu4_install_mod4yam_space(address_space *space) -{ - mpu4_state *state = space->machine().driver_data(); - space->install_read_handler(0x0880, 0x0882, read8_delegate(FUNC(mpu4_state::mpu4_ym2413_r),state)); - space->install_write_handler(0x0880, 0x0881, write8_delegate(FUNC(mpu4_state::mpu4_ym2413_w),state)); -} - -void mpu4_install_mod4oki_space(address_space *space) -{ - mpu4_state *state = space->machine().driver_data(); - pia6821_device *pia_ic4ss = space->machine().device("pia_ic4ss"); - ptm6840_device *ptm_ic3ss = space->machine().device("ptm_ic3ss"); - - space->install_readwrite_handler(0x0880, 0x0883, 0, 0, read8_delegate(FUNC(pia6821_device::read), pia_ic4ss), write8_delegate(FUNC(pia6821_device::write), pia_ic4ss)); - space->install_read_handler(0x08c0, 0x08c7, 0, 0, read8_delegate(FUNC(ptm6840_device::read), ptm_ic3ss)); - space->install_write_handler(0x08c0, 0x08c7, 0, 0, write8_delegate(FUNC(mpu4_state::ic3ss_w),state)); -} - -void mpu4_install_mod4bwb_space(address_space *space) -{ - mpu4_state *state = space->machine().driver_data(); - space->install_readwrite_handler(0x0810, 0x0810, 0, 0, read8_delegate(FUNC(mpu4_state::bwb_characteriser_r),state),write8_delegate(FUNC(mpu4_state::bwb_characteriser_w),state)); - mpu4_install_mod4oki_space(space); -} - - -void mpu4_config_common(running_machine &machine) -{ - mpu4_state *state = machine.driver_data(); - state->m_ic24_timer = machine.scheduler().timer_alloc(FUNC(ic24_timeout)); - state->m_lamp_strobe_ext_persistence = 0; - /* setup 8 mechanical meters */ - MechMtr_config(machine,8); - -} - -static void mpu4_config_common_reels(running_machine &machine,int reels) -{ - int n; - /* setup n default 96 half step reels, using the standard optic flag */ - for ( n = 0; n < reels; n++ ) - { - stepper_config(machine, n, &barcrest_reel_interface); - } -} - -MACHINE_START( mod2 ) -{ - mpu4_state *state = machine.driver_data(); - mpu4_config_common(machine); - - state->m_link7a_connected=0; - state->m_mod_number=2; -} - -static MACHINE_START( mpu4yam ) -{ - mpu4_state *state = machine.driver_data(); - address_space *space = machine.device("maincpu")->memory().space(AS_PROGRAM); - mpu4_config_common(machine); - - state->m_link7a_connected=0; - state->m_mod_number=4; - mpu4_install_mod4yam_space(space); -} - -static MACHINE_START( mpu4oki ) -{ - mpu4_state *state = machine.driver_data(); - address_space *space = machine.device("maincpu")->memory().space(AS_PROGRAM); - mpu4_config_common(machine); - - state->m_link7a_connected=0; - state->m_mod_number=4; - mpu4_install_mod4oki_space(space); -} - -static MACHINE_START( mpu4bwb ) -{ - mpu4_state *state = machine.driver_data(); - address_space *space = machine.device("maincpu")->memory().space(AS_PROGRAM); - mpu4_config_common(machine); - - state->m_link7a_connected=0; - state->m_mod_number=4; - mpu4_install_mod4bwb_space(space); -} - -static MACHINE_START( mpu4cry ) -{ - mpu4_state *state = machine.driver_data(); - mpu4_config_common(machine); - - state->m_link7a_connected=0; - state->m_mod_number=4; -} - -/* CHR Tables */ - -static mpu4_chr_table ccelbr_data[72] = { -{0x00, 0x00},{0x1a, 0x84},{0x04, 0x8c},{0x10, 0xb8},{0x18, 0x74},{0x0f, 0x80},{0x13, 0x1c},{0x1b, 0xb4}, -{0x03, 0xd8},{0x07, 0x74},{0x17, 0x00},{0x1d, 0xd4},{0x36, 0xc8},{0x35, 0x78},{0x2b, 0xa4},{0x28, 0x4c}, -{0x39, 0xe0},{0x21, 0xdc},{0x22, 0xf4},{0x25, 0x88},{0x2c, 0x78},{0x29, 0x24},{0x31, 0x84},{0x34, 0xcc}, -{0x0a, 0xb8},{0x1f, 0x74},{0x06, 0x90},{0x0e, 0x48},{0x1c, 0xa0},{0x12, 0x1c},{0x1e, 0x24},{0x0d, 0x94}, -{0x14, 0xc8},{0x0a, 0xb8},{0x19, 0x74},{0x15, 0x00},{0x06, 0x94},{0x0f, 0x48},{0x08, 0x30},{0x1b, 0x90}, -{0x1e, 0x08},{0x04, 0x60},{0x01, 0xd4},{0x0c, 0x58},{0x18, 0xf4},{0x1a, 0x18},{0x11, 0x74},{0x0b, 0x80}, -{0x03, 0xdc},{0x17, 0x74},{0x10, 0xd0},{0x1d, 0x58},{0x0e, 0x24},{0x07, 0x94},{0x12, 0xd8},{0x09, 0x34}, -{0x0d, 0x90},{0x1f, 0x58},{0x16, 0xf4},{0x05, 0x88},{0x13, 0x38},{0x1c, 0x24},{0x02, 0xd4},{0x00, 0x00}, -{0x00, 0x00},{0x01, 0x50},{0x04, 0x00},{0x09, 0x50},{0x10, 0x10},{0x19, 0x40},{0x24, 0x04},{0x31, 0x00} -}; - -static mpu4_chr_table gmball_data[72] = { -{0x00, 0x00},{0x1a, 0x0c},{0x04, 0x50},{0x10, 0x90},{0x18, 0xb0},{0x0f, 0x38},{0x13, 0xd4},{0x1b, 0xa0}, -{0x03, 0xbc},{0x07, 0xd4},{0x17, 0x30},{0x1d, 0x90},{0x36, 0x38},{0x35, 0xc4},{0x2b, 0xac},{0x28, 0x70}, -{0x39, 0x98},{0x21, 0xdc},{0x22, 0xdc},{0x25, 0x54},{0x2c, 0x80},{0x29, 0xb4},{0x31, 0x38},{0x34, 0xcc}, -{0x0a, 0xe8},{0x1f, 0xf8},{0x06, 0xd4},{0x0e, 0x30},{0x1c, 0x00},{0x12, 0x84},{0x1e, 0x2c},{0x0d, 0xc8}, -{0x14, 0xf8},{0x0a, 0x4c},{0x19, 0x58},{0x15, 0xd4},{0x06, 0xa8},{0x0f, 0x78},{0x08, 0x44},{0x1b, 0x0c}, -{0x1e, 0x48},{0x04, 0x50},{0x01, 0x98},{0x0c, 0xd4},{0x18, 0xb0},{0x1a, 0xa0},{0x11, 0xa4},{0x0b, 0x3c}, -{0x03, 0xdc},{0x17, 0xd4},{0x10, 0xb8},{0x1d, 0xd4},{0x0e, 0x30},{0x07, 0x88},{0x12, 0xe0},{0x09, 0x24}, -{0x0d, 0x8c},{0x1f, 0xf8},{0x16, 0xcc},{0x05, 0x70},{0x13, 0x90},{0x1c, 0x20},{0x02, 0x9c},{0x00, 0x00}, -{0x00, 0x00},{0x01, 0x18},{0x04, 0x08},{0x09, 0x10},{0x10, 0x00},{0x19, 0x18},{0x24, 0x08},{0x31, 0x00} -}; - -static mpu4_chr_table grtecp_data[72] = { -{0x00, 0x00},{0x1a, 0x84},{0x04, 0xa4},{0x10, 0xac},{0x18, 0x70},{0x0f, 0x80},{0x13, 0x2c},{0x1b, 0xc0}, -{0x03, 0xbc},{0x07, 0x5c},{0x17, 0x5c},{0x1d, 0x5c},{0x36, 0xdc},{0x35, 0x5c},{0x2b, 0xcc},{0x28, 0x68}, -{0x39, 0xd0},{0x21, 0xb8},{0x22, 0xdc},{0x25, 0x54},{0x2c, 0x08},{0x29, 0x58},{0x31, 0x54},{0x34, 0x90}, -{0x0a, 0xb8},{0x1f, 0x5c},{0x06, 0x5c},{0x0e, 0x44},{0x1c, 0x84},{0x12, 0xac},{0x1e, 0xe0},{0x0d, 0xbc}, -{0x14, 0xcc},{0x0a, 0xe8},{0x19, 0x70},{0x15, 0x00},{0x06, 0x8c},{0x0f, 0x70},{0x08, 0x00},{0x1b, 0x84}, -{0x1e, 0xa4},{0x04, 0xa4},{0x01, 0xbc},{0x0c, 0xdc},{0x18, 0x5c},{0x1a, 0xcc},{0x11, 0xe8},{0x0b, 0xe0}, -{0x03, 0xbc},{0x17, 0x4c},{0x10, 0xc8},{0x1d, 0xf8},{0x0e, 0xd4},{0x07, 0xa8},{0x12, 0x68},{0x09, 0x40}, -{0x0d, 0x0c},{0x1f, 0xd8},{0x16, 0xdc},{0x05, 0x54},{0x13, 0x98},{0x1c, 0x44},{0x02, 0x9c},{0x00, 0x00}, -{0x00, 0x00},{0x01, 0x18},{0x04, 0x00},{0x09, 0x18},{0x10, 0x08},{0x19, 0x10},{0x24, 0x00},{0x31, 0x00} -}; - -static mpu4_chr_table oldtmr_data[72] = { -{0x00, 0x00},{0x1a, 0x90},{0x04, 0xc0},{0x10, 0x54},{0x18, 0xa4},{0x0f, 0xf0},{0x13, 0x64},{0x1b, 0x90}, -{0x03, 0xe4},{0x07, 0xd4},{0x17, 0x60},{0x1d, 0xb4},{0x36, 0xc0},{0x35, 0x70},{0x2b, 0x80},{0x28, 0x74}, -{0x39, 0xa4},{0x21, 0xf4},{0x22, 0xe4},{0x25, 0xd0},{0x2c, 0x64},{0x29, 0x10},{0x31, 0x20},{0x34, 0x90}, -{0x0a, 0xe4},{0x1f, 0xf4},{0x06, 0xc4},{0x0e, 0x70},{0x1c, 0x00},{0x12, 0x14},{0x1e, 0x00},{0x0d, 0x14}, -{0x14, 0xa0},{0x0a, 0xf0},{0x19, 0x64},{0x15, 0x10},{0x06, 0x84},{0x0f, 0x70},{0x08, 0x00},{0x1b, 0x90}, -{0x1e, 0x40},{0x04, 0x90},{0x01, 0xe4},{0x0c, 0xf4},{0x18, 0x64},{0x1a, 0x90},{0x11, 0x64},{0x0b, 0x90}, -{0x03, 0xe4},{0x17, 0x50},{0x10, 0x24},{0x1d, 0xb4},{0x0e, 0xe0},{0x07, 0xd4},{0x12, 0xe4},{0x09, 0x50}, -{0x0d, 0x04},{0x1f, 0xb4},{0x16, 0xc0},{0x05, 0xd0},{0x13, 0x64},{0x1c, 0x90},{0x02, 0xe4},{0x00, 0x00}, -{0x00, 0x00},{0x01, 0x00},{0x04, 0x00},{0x09, 0x00},{0x10, 0x00},{0x19, 0x10},{0x24, 0x00},{0x31, 0x00} -}; - -static const bwb_chr_table blsbys_data1[5] = { -//Magic number 724A - -// PAL Codes -// 0 1 2 3 4 5 6 7 8 -// ?? ?? 20 0F 24 3C 36 27 09 - - {0x67},{0x17},{0x0f},{0x24},{0x3c}, -}; - -static mpu4_chr_table blsbys_data[8] = { -{0xEF, 0x02},{0x81, 0x00},{0xCE, 0x00},{0x00, 0x2e}, -{0x06, 0x20},{0xC6, 0x0f},{0xF8, 0x24},{0x8E, 0x3c}, -}; - -// set percentage and other options. 2e 20 0f -// PAL Codes -// 0 1 2 3 4 5 6 7 8 -// 42 2E 20 0F 24 3C 36 27 09 - // 6 0 7 0 8 0 7 0 0 8 -//request 36 42 27 42 09 42 27 42 42 09 -//verify 00 04 04 0C 0C 1C 14 2C 5C 2C - -static DRIVER_INIT (m_oldtmr) -{ - mpu4_state *state = machine.driver_data(); - state->m_reel_mux=SIX_REEL_1TO8; - state->m_reels = 6; - - stepper_config(machine, 0, &barcrest_opto1_interface); - stepper_config(machine, 1, &barcrest_opto1_interface); - stepper_config(machine, 2, &barcrest_opto1_interface); - stepper_config(machine, 3, &barcrest_opto1_interface); - stepper_config(machine, 4, &barcrest_opto1_interface); - stepper_config(machine, 5, &barcrest_opto1_interface); - - state->m_current_chr_table = oldtmr_data; -} - -static DRIVER_INIT (m_ccelbr) -{ - mpu4_state *state = machine.driver_data(); - state->m_reel_mux=STANDARD_REEL; - state->m_reels = 4; - // setup 4 default 96 half step reels /////////////////////////////////// - mpu4_config_common_reels(machine,4); - - state->m_current_chr_table = ccelbr_data; -} - -static DRIVER_INIT (m_gmball) -{ - mpu4_state *state = machine.driver_data(); - state->m_reel_mux=STANDARD_REEL; - state->m_reels = 4; - // setup 4 default 96 half step reels /////////////////////////////////// - mpu4_config_common_reels(machine,4); - - state->m_current_chr_table = gmball_data; -} - -static DRIVER_INIT (m_grtecp) -{ - mpu4_state *state = machine.driver_data(); - state->m_reel_mux=FIVE_REEL_5TO8; - state->m_reels = 5; - state->m_lamp_extender=SMALL_CARD; - // setup 4 default 96 half step reels with the mux board - mpu4_config_common_reels(machine,5); - state->m_current_chr_table = grtecp_data; -} - -static DRIVER_INIT (m_blsbys) -{ - mpu4_state *state = machine.driver_data(); - state->m_bwb_bank=1; - state->m_reel_mux=FIVE_REEL_5TO8; - state->m_reels = 5; - stepper_config(machine, 0, &bwb_opto1_interface); - stepper_config(machine, 1, &bwb_opto1_interface); - stepper_config(machine, 2, &bwb_opto1_interface); - stepper_config(machine, 3, &bwb_opto1_interface); - stepper_config(machine, 4, &bwb_opto1_interface); - state->m_bwb_chr_table1 = blsbys_data1; - state->m_current_chr_table = blsbys_data; -} - -static DRIVER_INIT (m4tst2) -{ - mpu4_state *state = machine.driver_data(); - state->m_reel_mux=STANDARD_REEL; - state->m_reels = 4; - mpu4_config_common_reels(machine,4); -} - -static DRIVER_INIT (m4tst) -{ - mpu4_state *state = machine.driver_data(); - state->m_reel_mux=STANDARD_REEL; - state->m_reels = 4; - mpu4_config_common_reels(machine,4); -} - -static DRIVER_INIT (connect4) -{ - mpu4_state *state = machine.driver_data(); - state->m_reels = 0; //reel-free game - state->m_led_lamp=1; -} - - - -static DRIVER_INIT (m4default) -{ - mpu4_state *state = machine.driver_data(); - state->m_reel_mux=STANDARD_REEL; - state->m_reels = 4; - mpu4_config_common_reels(machine,4); - state->m_bwb_bank=0; -} - -static DRIVER_INIT( m4default_bigbank ) -{ - address_space *space = machine.device("maincpu")->memory().space(AS_PROGRAM); - mpu4_state *state = machine.driver_data(); - DRIVER_INIT_CALL(m4default); - state->m_bwb_bank=1; - space->install_write_handler(0x0858, 0x0858, 0, 0, write8_delegate(FUNC(mpu4_state::bankswitch_w),state)); - space->install_write_handler(0x0878, 0x0878, 0, 0, write8_delegate(FUNC(mpu4_state::bankset_w),state)); -} - -READ8_MEMBER(mpu4_state::crystal_sound_r) -{ - return machine().rand(); -} -//this may be a YMZ280B -WRITE8_MEMBER(mpu4_state::crystal_sound_w) -{ - printf("crystal_sound_w %02x\n",data); -} - -static DRIVER_INIT (m_frkstn) -{ - address_space *space = machine.device("maincpu")->memory().space(AS_PROGRAM); - mpu4_state *state = machine.driver_data(); - DRIVER_INIT_CALL(m4default_bigbank); - space->install_read_handler(0x0880, 0x0880, 0, 0, read8_delegate(FUNC(mpu4_state::crystal_sound_r),state)); - space->install_write_handler(0x0881, 0x0881, 0, 0, write8_delegate(FUNC(mpu4_state::crystal_sound_w),state)); -} - -/* generate a 50 Hz signal (based on an RC time) */ -TIMER_DEVICE_CALLBACK( gen_50hz ) -{ - mpu4_state *state = timer.machine().driver_data(); - /* Although reported as a '50Hz' signal, the fact that both rising and - falling edges of the pulse are used means the timer actually gives a 100Hz - oscillating signal.*/ - state->m_signal_50hz = state->m_signal_50hz?0:1; - timer.machine().device("pia_ic4")->ca1_w(state->m_signal_50hz); /* signal is connected to IC4 CA1 */ - - update_meters(state);//run at 100Hz to sync with PIAs -} - -static ADDRESS_MAP_START( mpu4_memmap, AS_PROGRAM, 8, mpu4_state ) - AM_RANGE(0x0000, 0x07ff) AM_RAM AM_SHARE("nvram") - AM_RANGE(0x0800, 0x0810) AM_READWRITE(characteriser_r,characteriser_w) - AM_RANGE(0x0850, 0x0850) AM_READWRITE(bankswitch_r,bankswitch_w) /* write bank (rom page select) */ -/* AM_RANGE(0x08e0, 0x08e7) AM_READWRITE_LEGACY(68681_duart_r,68681_duart_w) */ //Runs hoppers - AM_RANGE(0x0900, 0x0907) AM_DEVREADWRITE("ptm_ic2", ptm6840_device, read, write)/* PTM6840 IC2 */ - AM_RANGE(0x0a00, 0x0a03) AM_DEVREADWRITE("pia_ic3", pia6821_device, read, write) /* PIA6821 IC3 */ - AM_RANGE(0x0b00, 0x0b03) AM_DEVREADWRITE("pia_ic4", pia6821_device, read, write) /* PIA6821 IC4 */ - AM_RANGE(0x0c00, 0x0c03) AM_DEVREADWRITE("pia_ic5", pia6821_device, read, write) /* PIA6821 IC5 */ - AM_RANGE(0x0d00, 0x0d03) AM_DEVREADWRITE("pia_ic6", pia6821_device, read, write) /* PIA6821 IC6 */ - AM_RANGE(0x0e00, 0x0e03) AM_DEVREADWRITE("pia_ic7", pia6821_device, read, write) /* PIA6821 IC7 */ - AM_RANGE(0x0f00, 0x0f03) AM_DEVREADWRITE("pia_ic8", pia6821_device, read, write) /* PIA6821 IC8 */ - AM_RANGE(0x1000, 0xffff) AM_ROMBANK("bank1") /* 64k paged ROM (4 pages) */ -ADDRESS_MAP_END - -const ay8910_interface ay8910_config = -{ - AY8910_SINGLE_OUTPUT, - {820,0,0}, - DEVCB_NULL, - DEVCB_NULL, - DEVCB_NULL, - DEVCB_NULL -}; - -MACHINE_CONFIG_FRAGMENT( mpu4_common ) - MCFG_TIMER_ADD_PERIODIC("50hz",gen_50hz, attotime::from_hz(100)) - - MCFG_MSC1937_ADD("vfd",0,LEFT_TO_RIGHT) - /* 6840 PTM */ - MCFG_PTM6840_ADD("ptm_ic2", ptm_ic2_intf) - - MCFG_PIA6821_ADD("pia_ic3", pia_ic3_intf) - MCFG_PIA6821_ADD("pia_ic4", pia_ic4_intf) - MCFG_PIA6821_ADD("pia_ic5", pia_ic5_intf) - MCFG_PIA6821_ADD("pia_ic6", pia_ic6_intf) - MCFG_PIA6821_ADD("pia_ic7", pia_ic7_intf) - MCFG_PIA6821_ADD("pia_ic8", pia_ic8_intf) -MACHINE_CONFIG_END - -MACHINE_CONFIG_FRAGMENT( mpu4_common2 ) - MCFG_PTM6840_ADD("ptm_ic3ss", ptm_ic3ss_intf) - MCFG_PIA6821_ADD("pia_ic4ss", pia_ic4ss_intf) -MACHINE_CONFIG_END - -/* machine driver for MOD 2 board */ -MACHINE_CONFIG_START( mpu4base, mpu4_state ) - - MCFG_MACHINE_START(mod2 ) - MCFG_MACHINE_RESET(mpu4) - MCFG_CPU_ADD("maincpu", M6809, MPU4_MASTER_CLOCK/4) - MCFG_CPU_PROGRAM_MAP(mpu4_memmap) - - - MCFG_FRAGMENT_ADD(mpu4_common) - - - MCFG_SPEAKER_STANDARD_STEREO("lspeaker", "rspeaker") - - MCFG_NVRAM_ADD_0FILL("nvram") - - MCFG_SCREEN_ADD("screen", RASTER) - MCFG_SCREEN_REFRESH_RATE(60) - MCFG_SCREEN_VBLANK_TIME(ATTOSECONDS_IN_USEC(0)) - MCFG_SCREEN_UPDATE_DRIVER(mpu4_state, screen_update) - MCFG_SCREEN_SIZE(64*8, 32*8) - MCFG_SCREEN_VISIBLE_AREA(8*8, 48*8-1, 2*8, 30*8-1) - MCFG_PALETTE_LENGTH(0x200) - - - MCFG_DEFAULT_LAYOUT(layout_mpu4) -MACHINE_CONFIG_END - - - MACHINE_CONFIG_DERIVED( mod2 , mpu4base ) - MCFG_SOUND_ADD("ay8913",AY8913, MPU4_MASTER_CLOCK/4) - MCFG_SOUND_CONFIG(ay8910_config) - MCFG_SOUND_ROUTE(ALL_OUTPUTS, "lspeaker", 1.0) - MCFG_SOUND_ROUTE(ALL_OUTPUTS, "rspeaker", 1.0) - -MACHINE_CONFIG_END - - - - -static MACHINE_CONFIG_DERIVED( mod4yam, mpu4base ) - MCFG_MACHINE_START(mpu4yam) - - MCFG_SOUND_ADD("ym2413", YM2413, MPU4_MASTER_CLOCK/4) - MCFG_SOUND_ROUTE(ALL_OUTPUTS, "lspeaker", 1.0) - MCFG_SOUND_ROUTE(ALL_OUTPUTS, "rspeaker", 1.0) -MACHINE_CONFIG_END - -static MACHINE_CONFIG_DERIVED( mod4oki, mpu4base ) - MCFG_MACHINE_START(mpu4oki) - - MCFG_FRAGMENT_ADD(mpu4_common2) - - MCFG_SOUND_ADD("msm6376", OKIM6376, 128000) //16KHz sample Can also be 85430 at 10.5KHz and 64000 at 8KHz - MCFG_SOUND_ROUTE(ALL_OUTPUTS, "lspeaker", 1.0) - MCFG_SOUND_ROUTE(ALL_OUTPUTS, "rspeaker", 1.0) -MACHINE_CONFIG_END - -static MACHINE_CONFIG_DERIVED( bwboki, mod4oki ) - MCFG_MACHINE_START(mpu4bwb) -MACHINE_CONFIG_END - -static MACHINE_CONFIG_DERIVED(mpu4crys, mod2 ) - MCFG_MACHINE_START(mpu4cry) - - MCFG_SOUND_ADD("upd", UPD7759, UPD7759_STANDARD_CLOCK) - MCFG_SOUND_ROUTE(ALL_OUTPUTS, "lspeaker", 1.0) - MCFG_SOUND_ROUTE(ALL_OUTPUTS, "rspeaker", 1.0) -MACHINE_CONFIG_END - - - - - - +#include "connect4.lh" + +MACHINE_CONFIG_EXTERN( mod4oki ); +MACHINE_CONFIG_EXTERN( mod4yam ); +MACHINE_CONFIG_EXTERN( mpu4crys ); +MACHINE_CONFIG_EXTERN( bwboki ); +MACHINE_CONFIG_EXTERN( mod2 ); + +INPUT_PORTS_EXTERN( mpu4 ); +INPUT_PORTS_EXTERN( mpu4jackpot8tkn ); +INPUT_PORTS_EXTERN( mpu4jackpot8per ); +INPUT_PORTS_EXTERN( grtecp ); +INPUT_PORTS_EXTERN( gamball ); +INPUT_PORTS_EXTERN( connect4 ); + +extern DRIVER_INIT( m_oldtmr ); +extern DRIVER_INIT( m_ccelbr ); +extern DRIVER_INIT( m_gmball ); +extern DRIVER_INIT( m_grtecp ); +extern DRIVER_INIT( m_blsbys ); +extern DRIVER_INIT( m4tst2 ); +extern DRIVER_INIT( m4tst ); +extern DRIVER_INIT( connect4 ); +extern DRIVER_INIT( m4default ); +extern DRIVER_INIT( m4default_bigbank ); +extern DRIVER_INIT( m_frkstn ); +extern DRIVER_INIT( crystal ); +extern DRIVER_INIT( crystali ); ROM_START( m4conn4 ) ROM_REGION( 0x10000, "maincpu", ROMREGION_ERASE00 ) @@ -15175,42 +12236,6 @@ ROM_END - -// thanks to Project Amber for descramble information -void descramble_crystal( UINT8* region, int start, int end, UINT8 extra_xor) -{ - for (int i=start;ibase(), 0x0000, 0x10000, 0x00); -} - -DRIVER_INIT( crystali ) -{ - DRIVER_INIT_CALL(m_frkstn); - descramble_crystal(machine.root_device().memregion( "maincpu" )->base(), 0x0000, 0x10000, 0xff); // invert after decrypt?! -} - - /* Barcrest */ GAME( 198?, m4tst, 0, mod2 , mpu4, m4tst, ROT0, "Barcrest","MPU4 Unit Test (Program 4)",GAME_MECHANICAL ) GAME( 198?, m4tst2, 0, mod2 , mpu4, m4tst2, ROT0, "Barcrest","MPU4 Unit Test (Program 2)",GAME_MECHANICAL ) diff --git a/src/mame/drivers/mpu4hw.c b/src/mame/drivers/mpu4hw.c new file mode 100644 index 00000000000..7bdabfb40d7 --- /dev/null +++ b/src/mame/drivers/mpu4hw.c @@ -0,0 +1,3016 @@ +/* MPU4 hardware emulation + for sets see mpu4.c +*/ + +/* Note 19/07/11 DH + - added lots of sets + + these are mostly unsorted and need to be split into clones + the original source of these was a mess, assume things to be mislabled, bad, duplicated, or otherwise + badly organized. a lot of work is needed to sort them out, especially the Barcrest sets! Some of this + stuff MIGHT be in the wrong driver, or missing roms (sound roms especially) +*/ + +/*********************************************************************************************************** + Barcrest MPU4 highly preliminary driver by J.Wallace, and Anonymous. + + This is the core driver, no video specific stuff should go in here. + This driver holds all the mechanical games. + + 06-2011: Fixed boneheaded interface glitch that was causing samples to not be cancelled correctly. + Added the ability to read each segment of an LED display separately, this may be necessary for some + games that use them as surrogate lamp lines. + New persistence 'hack' to stop light flicker for the small extender. + 05-2011: Add better OKI emulation + 04-2011: More accurate gamball code, fixed ROM banking (Project Amber), added BwB CHR simulator (Amber) + This is still a hard coded system, but significantly different to Barcrest's version. + Started adding support for the Crystal Gaming program card, and the link keys for setting parameters. + 03-2011: Lamp timing fixes, support for all known expansion cards added. + 01-2011: Adding the missing 'OKI' sound card, and documented it, but it needs a 6376 rewrite. + 09-2007: Haze: Added Deal 'Em video support. + 03-08-2007: J Wallace: Removed audio filter for now, since sound is more accurate without them. + Connect 4 now has the right sound. + 03-07-2007: J Wallace: Several major changes, including input relabelling, and system timer improvements. + 06-2007: Atari Ace, many cleanups and optimizations of I/O routines + 09-06-2007: J Wallace: Fixed 50Hz detection circuit. + 17-02-2007: J Wallace: Added Deal 'Em - still needs some work. + 10-02-2007: J Wallace: Improved input timing. + 30-01-2007: J Wallace: Characteriser rewritten to run the 'extra' data needed by some games. + 24-01-2007: J Wallace: With thanks to Canonman and HIGHWAYMAN/System 80, I was able to confirm a seemingly + ghastly misuse of a PIA is actually on the real hardware. This fixes the meters. + +See http://agemame.mameworld.info/techinfo/mpu4.php for Information. + +--- Board Setup --- + +The MPU4 BOARD is the driver board, originally designed to run Fruit Machines made by the Barcrest Group, but later +licensed to other firms as a general purpose unit (even some old Photo-Me booths used the unit). + +This board uses a ~1.72 Mhz 6809B CPU, and a number of PIA6821 chips for multiplexing inputs and the like. + +To some extent, the hardware feels like a revision of the MPU3 design, integrating into the base unit features that were +previously added through expansion ports. However, there is no backwards compatibility, and the entire memory map has been +reworked. + +Like MPU3, a 6840PTM is used for internal timing, and other miscellaneous control functions, including as a crude analogue sound device +(a square wave from the PTM being used as the alarm sound generator). However, the main sound functionality is provided by +dedicated hardware (an AY8913). + +A MPU4 GAME CARD (cartridge) plugs into the MPU4 board containing the game, and a protection PAL (the 'characteriser'). +This PAL, as well as protecting the games, also controlled some of the lamp address matrix for many games, and acted as +an anti-tampering device which helped to prevent the hacking of certain titles in a manner which broke UK gaming laws. + +Like MPU3, over the years developers have added more capabilities through the spare inputs and outputs provided. These provided +support for more reels, lamps and LEDs through daughtercards. +Several solutions were released depending on the manufacturer of the machine, all are emulated here. + +In later revisions of the main board (MOD4 onwards), the AY8913 was removed entirely, as two official alternatives for sound had been produced. +In one, a YM2413 is built into the gameboard, and in the other an OKI MSM6376 is interfaced with a PIA and PTM to allow sophisticated +sampled sound. + +The lamping and input handling side of the machine rely entirely on a column by column 'strobe' system, with lights and LEDs selected in turn. +In the inputs there are two orange connectors (sampled every 8ms) and two black ones (sampled every 16ms), giving 32 multiplexed inputs. + +In addition there are two auxiliary ports that can be accessed separately to these and are bidirectional + +--- Preliminary MPU4 Memorymap --- + +(NV) indicates an item which is not present on the video version, which has a Comms card instead. + + hex |r/w| D D D D D D D D | + location | | 7 6 5 4 3 2 1 0 | function +-----------+---+-----------------+-------------------------------------------------------------------------- + 0000-07FF |R/W| D D D D D D D D | 2k RAM +-----------+---+-----------------+-------------------------------------------------------------------------- + 0800 |R/W| | Characteriser (Security PAL) (NV) +-----------+---+-----------------+-------------------------------------------------------------------------- + 0850 ? | W | ??????????????? | page latch (NV) +-----------+---+-----------------+-------------------------------------------------------------------------- + 0880 |R/W| D D D D D D D D | PIA6821 on soundboard (Oki MSM6376 clocked by 6840 (8C0)) + | | | port A = ?? + | | | port B (882) + | | | b7 = NAR + | | | b6 = 0 if OKI busy, 1 if OKI ready + | | | b5 = volume control clock + | | | b4 = volume control direction (0= up, 1 = down) + | | | b3 = ?? + | | | b2 = ?? + | | | b1 = 2ch + | | | b0 = ST +-----------+---+-----------------+-------------------------------------------------------------------------- + 08C0 | | | MC6840 on sound board +-----------+---+-----------------+-------------------------------------------------------------------------- + 0900- |R/W| D D D D D D D D | MC6840 PTM IC2 + + + Clock1 <-------------------------------------- + | | + V | + Output1 ---> Clock2 | + | + Output2 --+-> Clock3 | + | | + | Output3 ---> 'to audio amp' ?? + | + +--------> CA1 IC3 ( + +IRQ line connected to CPU + +-----------+---+-----------------+-------------------------------------------------------------------------- + 0A00-0A03 |R/W| D D D D D D D D | PIA6821 IC3 port A Lamp Drives 1,2,3,4,6,7,8,9 (sic)(IC14) + | | | + | | | CA1 <= output2 from PTM6840 (IC2) + | | | CA2 => alpha data + | | | + | | | port B Lamp Drives 10,11,12,13,14,15,16,17 (sic)(IC13) + | | | + | | | CB2 => alpha reset (clock on Dutch systems) + | | | +-----------+---+-----------------+-------------------------------------------------------------------------- + 0B00-0B03 |R/W| D D D D D D D D | PIA6821 IC4 port A = data for 7seg leds (pins 10 - 17, via IC32) + | | | + | | | CA1 INPUT, 50 Hz input (used to generate IRQ) + | | | CA2 OUTPUT, connected to pin2 74LS138 CE for multiplexer + | | | (B on LED strobe multiplexer) + | | | IRQA connected to IRQ of CPU + | | | port B + | | | PB7 = INPUT, serial port Receive data (Rx) + | | | PB6 = INPUT, reel A sensor + | | | PB5 = INPUT, reel B sensor + | | | PB4 = INPUT, reel C sensor + | | | PB3 = INPUT, reel D sensor + | | | PB2 = INPUT, Connected to CA1 (50Hz signal) + | | | PB1 = INPUT, undercurrent sense + | | | PB0 = INPUT, overcurrent sense + | | | + | | | CB1 INPUT, used to generate IRQ on edge of serial input line + | | | CB2 OUTPUT, enable signal for reel optics + | | | IRQB connected to IRQ of CPU + | | | +-----------+---+-----------------+-------------------------------------------------------------------------- + 0C00-0C03 |R/W| D D D D D D D D | PIA6821 IC5 port A + | | | + | | | PA0-PA7, INPUT AUX1 connector + | | | + | | | CA2 OUTPUT, serial port Transmit line + | | | CA1 not connected + | | | IRQA connected to IRQ of CPU + | | | + | | | port B + | | | + | | | PB0-PB7 INPUT, AUX2 connector + | | | + | | | CB1 INPUT, connected to PB7 (Aux2 connector pin 4) + | | | + | | | CB2 OUTPUT, AY8913 chip select line + | | | IRQB connected to IRQ of CPU + | | | +-----------+---+-----------------+-------------------------------------------------------------------------- + 0D00-0D03 |R/W| D D D D D D D D | PIA6821 IC6 + | | | + | | | port A + | | | + | | | PA0 - PA7 (INPUT/OUTPUT) data port AY8913 sound chip + | | | + | | | CA1 INPUT, not connected + | | | CA2 OUTPUT, BC1 pin AY8913 sound chip + | | | IRQA , connected to IRQ CPU + | | | + | | | port B + | | | + | | | PB0-PB3 OUTPUT, reel A + | | | PB4-PB7 OUTPUT, reel B + | | | + | | | CB1 INPUT, not connected + | | | CB2 OUTPUT, B01R pin AY8913 sound chip + | | | IRQB , connected to IRQ CPU + | | | +-----------+---+-----------------+-------------------------------------------------------------------------- + 0E00-0E03 |R/W| D D D D D D D D | PIA6821 IC7 + | | | + | | | port A + | | | + | | | PA0-PA3 OUTPUT, reel C + | | | PA4-PA7 OUTPUT, reel D + | | | CA1 INPUT, not connected + | | | CA2 OUTPUT, A on LED strobe multiplexer + | | | IRQA , connected to IRQ CPU + | | | + | | | port B + | | | + | | | PB0-PB6 OUTPUT mech meter 1-7 or reel E + F + | | | PB7 Voltage drop sensor + | | | CB1 INPUT, not connected + | | | CB2 OUTPUT,mech meter 8 + | | | IRQB , connected to IRQ CPU + | | | +-----------+---+-----------------+-------------------------------------------------------------------------- + 0F00-0F03 |R/W| D D D D D D D D | PIA6821 IC8 + | | | + | | | port A + | | | + | | | PA0-PA7 INPUT multiplexed inputs data + | | | + | | | CA1 INPUT, not connected + | | | CA2 OUTPUT, C on LED strobe multiplexer + | | | IRQA connected to IRQ CPU + | | | + | | | port B + | | | + | | | PB0-PB7 OUTPUT triacs outputs connector PL6 + | | | used for slides / hoppers + | | | + | | | CB1 INPUT, not connected + | | | CB2 OUTPUT, pin1 alpha display PL7 (clock signal) + | | | IRQB connected to IRQ CPU + | | | +-----------+---+-----------------+-------------------------------------------------------------------------- + 1000-FFFF | R | D D D D D D D D | ROM (can be bank switched by 0x850 in 8 banks of 64 k ) (NV) +-----------+---+-----------------+-------------------------------------------------------------------------- + +TODO: - Distinguish door switches using manual + - Complete stubs for hoppers (needs slightly better 68681 emulation, and new 'hoppers' device emulation) + - It seems that the MPU4 core program relies on some degree of persistence when switching strobes and handling + writes to the various hardware ports. This explains the occasional lamping/LED blackout and switching bugs + For now, we're ignoring any extra writes to strobes, as the alternative is to assign a timer to *everything* and + start modelling the individual hysteresis curves of filament lamps. + - Fix BwB characteriser, need to be able to calculate stabiliser bytes. Anyone fancy reading 6809 source? + - Strange bug in Andy's Great Escape - Mystery nudge sound effect is not played, mpu4 latches in silence instead (?) +***********************************************************************************************************/ +#include "emu.h" +#include "machine/6821pia.h" +#include "machine/6840ptm.h" +#include "machine/nvram.h" + +#include "cpu/m6809/m6809.h" +#include "sound/ay8910.h" +#include "sound/okim6376.h" +#include "sound/2413intf.h" +#include "sound/upd7759.h" +#include "machine/steppers.h" +#include "machine/roc10937.h" +#include "machine/meters.h" +#include "includes/mpu4.h" + + +#include "video/awpvid.h" //Fruit Machines Only + +#include "mpu4.lh" +#include "mpu4ext.lh" + + +static TIMER_CALLBACK( ic24_timeout ); + + +/* +LED Segments related to pins (5 is not connected): +Unlike the controllers emulated in the layout code, each +segment of an MPU4 LED can be set individually, even +being used as individual lamps. However, we can get away +with settings like this in the majority of cases. + _9_ + | | + 3 8 + | | + _2_ + | | + 4 7 + |_ _| + 6 1 + +8 display enables (pins 10 - 17) +*/ + +static void lamp_extend_small(mpu4_state *state, int data) +{ + int lamp_ext_data,column,i; + column = data & 0x07; + + lamp_ext_data = 0x1f - ((data & 0xf8) >> 3);//remove the mux lines from the data + + if ((state->m_lamp_strobe_ext_persistence == 0)) + //One write to reset the drive lines, one with the data, one to clear the lines, so only the 2nd write does anything + //Once again, lamp persistences would take care of this, but we can't do that + { + for (i = 0; i < 5; i++) + { + output_set_lamp_value((8*column)+i+128,((lamp_ext_data & (1 << i)) != 0)); + } + } + state->m_lamp_strobe_ext_persistence ++; + if ((state->m_lamp_strobe_ext_persistence == 3)||(state->m_lamp_strobe_ext!=column)) + { + state->m_lamp_strobe_ext_persistence = 0; + state->m_lamp_strobe_ext=column; + } +} + +static void lamp_extend_large(mpu4_state *state, int data,int column,int active) +{ + int lampbase,i,bit7; + + state->m_lamp_sense = 0; + bit7 = data & 0x80; + if ( bit7 != state->m_last_b7 ) + { + state->m_card_live = 1; + //depending on bit 7, we can access one of two 'blocks' of 64 lamps + lampbase = bit7 ? 0 : 64; + if ( data & 0x3f ) + { + state->m_lamp_sense = 1; + } + if ( active ) + { + if (state->m_lamp_strobe_ext != column) + { + for (i = 0; i < 8; i++) + {//CHECK, this includes bit 7 + output_set_lamp_value((8*column)+i+128+lampbase ,(data & (1 << i)) != 0); + } + state->m_lamp_strobe_ext = column; + } + } + state->m_last_b7 = bit7; + } + else + { + state->m_card_live = 0; + } +} + +static void led_write_latch(mpu4_state *state, int latch, int data, int column) +{ + int diff,i,j; + + diff = (latch ^ state->m_last_latch) & latch; + column = 7 - column; // like main board, these are wired up in reverse + data = ~data;//inverted drive lines? + + for(i=0; i<5; i++) + { + if (diff & (1<m_last_latch = diff; +} + + +static void update_meters(mpu4_state *state) +{ + int meter; + int data = ((state->m_mmtr_data & 0x7f) | state->m_remote_meter); + switch (state->m_reel_mux) + { + case STANDARD_REEL: + // Change nothing + break; + case FIVE_REEL_5TO8: + stepper_update(4, ((data >> 4) & 0x0f)); + data = (data & 0x0F); //Strip reel data from meter drives, leaving active elements + awp_draw_reel(4); + break; + case FIVE_REEL_8TO5: + stepper_update(4, (((data & 0x01) + ((data & 0x08) >> 2) + ((data & 0x20) >> 3) + ((data & 0x80) >> 4)) & 0x0f)) ; + data = 0x00; //Strip all reel data from meter drives, nothing is connected + awp_draw_reel(4); + break; + case FIVE_REEL_3TO6: + stepper_update(4, ((data >> 2) & 0x0f)); + data = 0x00; //Strip all reel data from meter drives + awp_draw_reel(4); + break; + case SIX_REEL_1TO8: + stepper_update(4, (data & 0x0f)); + stepper_update(5, ((data >> 4) & 0x0f)); + data = 0x00; //Strip all reel data from meter drives + awp_draw_reel(4); + awp_draw_reel(5); + break; + case SIX_REEL_5TO8: + stepper_update(4, ((data >> 4) & 0x0f)); + data = 0x00; //Strip all reel data from meter drives + awp_draw_reel(4); + break; + case SEVEN_REEL: + stepper_update(0, (((data & 0x01) + ((data & 0x08) >> 2) + ((data & 0x20) >> 3) + ((data & 0x80) >> 4)) & 0x0f)) ; + data = 0x00; //Strip all reel data from meter drives + awp_draw_reel(0); + break; + case FLUTTERBOX: //The backbox fan assembly fits in a reel unit sized box, wired to the remote meter pin, so we can handle it here + output_set_value("flutterbox", data & 0x80); + data &= ~0x80; //Strip flutterbox data from meter drives + } + + MechMtr_update(7, (data & 0x80)); + for (meter = 0; meter < 4; meter ++) + { + MechMtr_update(meter, (data & (1 << meter))); + } + if (state->m_reel_mux == STANDARD_REEL) + { + for (meter = 4; meter < 7; meter ++) + { + MechMtr_update(meter, (data & (1 << meter))); + } + } +} + +/* called if board is reset */ +void mpu4_stepper_reset(mpu4_state *state) +{ + int pattern = 0,reel; + for (reel = 0; reel < 6; reel++) + { + stepper_reset_position(reel); + if(!state->m_reel_mux) + { + if (stepper_optic_state(reel)) pattern |= 1<m_optic_pattern = pattern; +} + + +static MACHINE_RESET( mpu4 ) +{ + mpu4_state *state = machine.driver_data(); + state->m_vfd->reset(); + + mpu4_stepper_reset(state); + + state->m_lamp_strobe = 0; + state->m_lamp_strobe2 = 0; + state->m_led_strobe = 0; + state->m_mmtr_data = 0; + state->m_remote_meter = 0; + + state->m_IC23GC = 0; + state->m_IC23GB = 0; + state->m_IC23GA = 0; + state->m_IC23G1 = 1; + state->m_IC23G2A = 0; + state->m_IC23G2B = 0; + + state->m_prot_col = 0; + state->m_chr_counter = 0; + state->m_chr_value = 0; + + + /* init rom bank, some games don't set this, and will assume bank 0,set 0 */ + { + UINT8 *rom = state->memregion("maincpu")->base(); + + state->membank("bank1")->configure_entries(0, 8, &rom[0x01000], 0x10000); + + state->membank("bank1")->set_entry(0); + machine.device("maincpu")->reset(); + } +} + + +/* 6809 IRQ handler */ +WRITE_LINE_MEMBER(mpu4_state::cpu0_irq) +{ + /* The PIA and PTM IRQ lines are all connected to a common PCB track, leading directly to the 6809 IRQ line. */ + int combined_state = m_pia3->irq_a_state() | m_pia3->irq_b_state() | + m_pia4->irq_a_state() | m_pia4->irq_b_state() | + m_pia5->irq_a_state() | m_pia5->irq_b_state() | + m_pia6->irq_a_state() | m_pia6->irq_b_state() | + m_pia7->irq_a_state() | m_pia7->irq_b_state() | + m_pia8->irq_a_state() | m_pia8->irq_b_state() | + m_6840ptm->irq_state(); + + if (!m_link7a_connected) //7B = IRQ, 7A = FIRQ, both = NMI + { + cputag_set_input_line(machine(), "maincpu", M6809_IRQ_LINE, combined_state ? ASSERT_LINE : CLEAR_LINE); + LOG(("6809 int%d \n", combined_state)); + } + else + { + cputag_set_input_line(machine(), "maincpu", M6809_FIRQ_LINE, combined_state ? ASSERT_LINE : CLEAR_LINE); + LOG(("6809 fint%d \n", combined_state)); + } +} + +/* Bankswitching +The MOD 4 ROM cards are set up to handle 8 separate ROM pages, arranged as 2 sets of 4. +The bankswitch selects which of the 4 pages in the set is active, while the bankset +switches between the sets. +It appears that the cards were originally intended to be used in a 'half' page setup, +where the two halves of the ROM space could be mixed and matched as appropriate. +However, there is no evidence to suggest this was ever implemented. +The controls for it exist however, in the form of the Soundboard PIA CB2 pin, which is +used in some cabinets instead of the main control. +*/ +WRITE8_MEMBER(mpu4_state::bankswitch_w) +{ +// printf("bank %02x\n", data); + + m_pageval = (data & 0x03); + membank("bank1")->set_entry((m_pageval + (m_pageset ? 4 : 0)) & 0x07); +} + + +READ8_MEMBER(mpu4_state::bankswitch_r) +{ + return membank("bank1")->entry(); +} + + +WRITE8_MEMBER(mpu4_state::bankset_w) +{ + m_pageval = (data - 2);//writes 2 and 3, to represent 0 and 1 - a hangover from the half page design? + membank("bank1")->set_entry((m_pageval + (m_pageset ? 4 : 0)) & 0x07); +} + + +/* IC2 6840 PTM handler */ +WRITE8_MEMBER(mpu4_state::ic2_o1_callback) +{ + m_6840ptm->set_c2(data); /* copy output value to IC2 c2 + this output is the clock for timer2 */ + /* 1200Hz System interrupt timer */ +} + + +WRITE8_MEMBER(mpu4_state::ic2_o2_callback) +{ + m_pia3->ca1_w(data); /* copy output value to IC3 ca1 */ + /* the output from timer2 is the input clock for timer3 */ + /* miscellaneous interrupts generated here */ + m_6840ptm->set_c3(data); +} + + +WRITE8_MEMBER(mpu4_state::ic2_o3_callback) +{ + /* the output from timer3 is used as a square wave for the alarm output + and as an external clock source for timer 1! */ + /* also runs lamp fade */ + m_6840ptm->set_c1(data); +} + + +static const ptm6840_interface ptm_ic2_intf = +{ + MPU4_MASTER_CLOCK / 4, + { 0, 0, 0 }, + { DEVCB_DRIVER_MEMBER(mpu4_state,ic2_o1_callback), + DEVCB_DRIVER_MEMBER(mpu4_state,ic2_o2_callback), + DEVCB_DRIVER_MEMBER(mpu4_state,ic2_o3_callback) }, + DEVCB_DRIVER_LINE_MEMBER(mpu4_state,cpu0_irq) +}; + + +/* 6821 PIA handlers */ +/* IC3, lamp data lines + alpha numeric display */ +WRITE8_MEMBER(mpu4_state::pia_ic3_porta_w) +{ + int i; + LOG_IC3(("%s: IC3 PIA Port A Set to %2x (lamp strobes 1 - 9)\n", machine().describe_context(),data)); + + if(m_ic23_active) + { + if (m_lamp_strobe != m_input_strobe) + { + // Because of the nature of the lamping circuit, there is an element of persistance + // As a consequence, the lamp column data can change before the input strobe without + // causing the relevant lamps to black out. + + for (i = 0; i < 8; i++) + { + output_set_lamp_value((8*m_input_strobe)+i, ((data & (1 << i)) !=0)); + } + m_lamp_strobe = m_input_strobe; + } + } +} + +WRITE8_MEMBER(mpu4_state::pia_ic3_portb_w) +{ + int i; + LOG_IC3(("%s: IC3 PIA Port B Set to %2x (lamp strobes 10 - 17)\n", machine().describe_context(),data)); + + if(m_ic23_active) + { + if (m_lamp_strobe2 != m_input_strobe) + { + for (i = 0; i < 8; i++) + { + output_set_lamp_value((8*m_input_strobe)+i+64, ((data & (1 << i)) !=0)); + } + m_lamp_strobe2 = m_input_strobe; + } + + if (m_led_lamp) + { + /* Some games (like Connect 4) use 'programmable' LED displays, built from light display lines in section 2. */ + /* These are mostly low-tech machines, where such wiring proved cheaper than an extender card */ + /* TODO: replace this with 'segment' lamp masks, to make it more generic */ + UINT8 pled_segs[2] = {0,0}; + + static const int lamps1[8] = { 106, 107, 108, 109, 104, 105, 110, 133 }; + static const int lamps2[8] = { 114, 115, 116, 117, 112, 113, 118, 119 }; + + for (i = 0; i < 8; i++) + { + if (output_get_lamp_value(lamps1[i])) pled_segs[0] |= (1 << i); + if (output_get_lamp_value(lamps2[i])) pled_segs[1] |= (1 << i); + } + + output_set_digit_value(8,pled_segs[0]); + output_set_digit_value(9,pled_segs[1]); + } + } +} + +WRITE_LINE_MEMBER(mpu4_state::pia_ic3_ca2_w) +{ + LOG_IC3(("%s: IC3 PIA Write CA2 (alpha data), %02X\n", machine().describe_context(),state)); + + m_alpha_data_line = state; +} + + +WRITE_LINE_MEMBER(mpu4_state::pia_ic3_cb2_w) +{ + LOG_IC3(("%s: IC3 PIA Write CB (alpha reset), %02X\n",machine().describe_context(),state)); +// DM Data pin A + if ( !state ) + { + m_vfd->reset(); + } +} + + +static const pia6821_interface pia_ic3_intf = +{ + DEVCB_NULL, /* port A in */ + DEVCB_NULL, /* port B in */ + DEVCB_NULL, /* line CA1 in */ + DEVCB_NULL, /* line CB1 in */ + DEVCB_NULL, /* line CA2 in */ + DEVCB_NULL, /* line CB2 in */ + DEVCB_DRIVER_MEMBER(mpu4_state,pia_ic3_porta_w), /* port A out */ + DEVCB_DRIVER_MEMBER(mpu4_state,pia_ic3_portb_w), /* port B out */ + DEVCB_DRIVER_LINE_MEMBER(mpu4_state,pia_ic3_ca2_w), /* line CA2 out */ + DEVCB_DRIVER_LINE_MEMBER(mpu4_state,pia_ic3_cb2_w), /* port CB2 out */ + DEVCB_DRIVER_LINE_MEMBER(mpu4_state,cpu0_irq), /* IRQA */ + DEVCB_DRIVER_LINE_MEMBER(mpu4_state,cpu0_irq) /* IRQB */ +}; + + +/* +IC23 emulation + +IC23 is a 74LS138 1-of-8 Decoder + +It is used as a multiplexer for the LEDs, lamp selects and inputs.*/ + +static void ic23_update(mpu4_state *state) +{ + if (!state->m_IC23G2A) + { + if (!state->m_IC23G2B) + { + if (state->m_IC23G1) + { + if ( state->m_IC23GA ) state->m_input_strobe |= 0x01; + else state->m_input_strobe &= ~0x01; + + if ( state->m_IC23GB ) state->m_input_strobe |= 0x02; + else state->m_input_strobe &= ~0x02; + + if ( state->m_IC23GC ) state->m_input_strobe |= 0x04; + else state->m_input_strobe &= ~0x04; + } + } + } + else + if ((state->m_IC23G2A)||(state->m_IC23G2B)) + { + state->m_input_strobe = 0x00; + } +} + + +/* +IC24 emulation + +IC24 is a 74LS122 pulse generator + +CLEAR and B2 are tied high and A1 and A2 tied low, meaning any pulse +on B1 will give a low pulse on the output pin. +*/ +static void ic24_output(mpu4_state *state, int data) +{ + state->m_IC23G2A = data; + ic23_update(state); +} + + +static void ic24_setup(mpu4_state *state) +{ + if (state->m_IC23GA) + { + double duration = TIME_OF_74LS123((220*1000),(0.1*0.000001)); + { + state->m_ic23_active=1; + ic24_output(state, 0); + state->m_ic24_timer->adjust(attotime::from_double(duration)); + } + } +} + + +static TIMER_CALLBACK( ic24_timeout ) +{ + mpu4_state *state = machine.driver_data(); + state->m_ic23_active=0; + ic24_output(state, 1); +} + + +/* IC4, 7 seg leds, 50Hz timer reel sensors, current sensors */ +WRITE8_MEMBER(mpu4_state::pia_ic4_porta_w) +{ + int i; + if(m_ic23_active) + { + if (((m_lamp_extender == NO_EXTENDER)||(m_lamp_extender == SMALL_CARD)||(m_lamp_extender == LARGE_CARD_C))&& (m_led_extender == NO_EXTENDER)) + { + if(m_led_strobe != m_input_strobe) + { + for(i=0; i<8; i++) + { + output_set_indexed_value("mpu4led",((7 - m_input_strobe) * 8) +i,(data & (1 << i)) !=0); + } + output_set_digit_value(7 - m_input_strobe,data); + } + m_led_strobe = m_input_strobe; + } + } +} + +WRITE8_MEMBER(mpu4_state::pia_ic4_portb_w) +{ + if (m_reel_mux) + { + /* A write here connects one reel (and only one) + to the optic test circuit. This allows 8 reels + to be supported instead of 4. */ + if (m_reel_mux == SEVEN_REEL) + { + m_active_reel= reel_mux_table7[(data >> 4) & 0x07]; + } + else + m_active_reel= reel_mux_table[(data >> 4) & 0x07]; + } +} + +READ8_MEMBER(mpu4_state::pia_ic4_portb_r) +{ + pia6821_device *pia = machine().device("pia_ic4"); + if ( m_serial_data ) + { + m_ic4_input_b |= 0x80; + pia->cb1_w(1); + } + else + { + m_ic4_input_b &= ~0x80; + pia->cb1_w(0); + } + + if (!m_reel_mux) + { + if ( m_optic_pattern & 0x01 ) m_ic4_input_b |= 0x40; /* reel A tab */ + else m_ic4_input_b &= ~0x40; + + if ( m_optic_pattern & 0x02 ) m_ic4_input_b |= 0x20; /* reel B tab */ + else m_ic4_input_b &= ~0x20; + + if ( m_optic_pattern & 0x04 ) m_ic4_input_b |= 0x10; /* reel C tab */ + else m_ic4_input_b &= ~0x10; + + if ( m_optic_pattern & 0x08 ) m_ic4_input_b |= 0x08; /* reel D tab */ + else m_ic4_input_b &= ~0x08; + + } + else + { + if (stepper_optic_state(m_active_reel)) + { + m_ic4_input_b |= 0x08; + } + else + { + m_ic4_input_b &= ~0x08; + } + } + if ( m_signal_50hz ) m_ic4_input_b |= 0x04; /* 50 Hz */ + else m_ic4_input_b &= ~0x04; + + if (m_ic4_input_b & 0x02) + { + m_ic4_input_b &= ~0x02; + } + else + { + m_ic4_input_b |= 0x02; //Pulse the overcurrent line with every read to show the CPU each lamp has lit + } + #ifdef UNUSED_FUNCTION + if ( lamp_undercurrent ) m_ic4_input_b |= 0x01; + #endif + + LOG_IC3(("%s: IC4 PIA Read of Port B %x\n",machine().describe_context(),m_ic4_input_b)); + return m_ic4_input_b; +} + + +WRITE_LINE_MEMBER(mpu4_state::pia_ic4_ca2_w) +{ + mpu4_state *drvstate = machine().driver_data(); + LOG_IC3(("%s: IC4 PIA Write CA (input MUX strobe /LED B), %02X\n", machine().describe_context(),state)); + + m_IC23GB = state; + ic23_update(drvstate); +} + +WRITE_LINE_MEMBER(mpu4_state::pia_ic4_cb2_w) +{ + LOG_IC3(("%s: IC4 PIA Write CA (input MUX strobe /LED B), %02X\n", machine().describe_context(),state)); + m_reel_flag=state; +} +static const pia6821_interface pia_ic4_intf = +{ + DEVCB_NULL, /* port A in */ + DEVCB_DRIVER_MEMBER(mpu4_state,pia_ic4_portb_r), /* port B in */ + DEVCB_NULL, /* line CA1 in */ + DEVCB_NULL, /* line CB1 in */ + DEVCB_NULL, /* line CA2 in */ + DEVCB_NULL, /* line CB2 in */ + DEVCB_DRIVER_MEMBER(mpu4_state,pia_ic4_porta_w), /* port A out */ + DEVCB_DRIVER_MEMBER(mpu4_state,pia_ic4_portb_w), /* port B out */ + DEVCB_DRIVER_LINE_MEMBER(mpu4_state,pia_ic4_ca2_w), /* line CA2 out */ + DEVCB_DRIVER_LINE_MEMBER(mpu4_state,pia_ic4_cb2_w), /* line CB2 out */ + DEVCB_DRIVER_LINE_MEMBER(mpu4_state,cpu0_irq), /* IRQA */ + DEVCB_DRIVER_LINE_MEMBER(mpu4_state,cpu0_irq) /* IRQB */ +}; + +/* IC5, AUX ports, coin lockouts and AY sound chip select (MODs below 4 only) */ +READ8_MEMBER(mpu4_state::pia_ic5_porta_r) +{ + if (m_lamp_extender == LARGE_CARD_A) + { + if (m_lamp_sense && m_ic23_active) + { + m_aux1_input |= 0x40; + } + else + { + m_aux1_input &= ~0x40; //Pulse the overcurrent line with every read to show the CPU each lamp has lit + } + } + if (m_hopper == HOPPER_NONDUART_A) + { +/* if (hopper1_active) + { + m_aux1_input |= 0x04; + } + else + { + m_aux1_input &= ~0x04; + }*/ + } + LOG(("%s: IC5 PIA Read of Port A (AUX1)\n",machine().describe_context())); + + return machine().root_device().ioport("AUX1")->read()|m_aux1_input; +} + +WRITE8_MEMBER(mpu4_state::pia_ic5_porta_w) +{ + int i; + mpu4_state *state = machine().driver_data(); + pia6821_device *pia_ic4 = machine().device("pia_ic4"); + if (m_hopper == HOPPER_NONDUART_A) + { + //hopper1_drive_sensor(data&0x10); + } + switch (m_lamp_extender) + { + case NO_EXTENDER: + if (m_led_extender == CARD_B) + { + led_write_latch(state, data & 0x1f, pia_ic4->a_output(),m_input_strobe); + } + else if ((m_led_extender != CARD_A)||(m_led_extender != NO_EXTENDER)) + { + for(i=0; i<8; i++) + { + output_set_indexed_value("mpu4led",((m_input_strobe + 8) * 8) +i,(data & (1 << i)) !=0); + } + output_set_digit_value((m_input_strobe+8),data); + } + break; + case SMALL_CARD: + if(m_ic23_active) + { + lamp_extend_small(state,data); + } + break; + case LARGE_CARD_A: + lamp_extend_large(state,data,m_input_strobe,m_ic23_active); + break; + case LARGE_CARD_B: + lamp_extend_large(state,data,m_input_strobe,m_ic23_active); + if ((m_ic23_active) && m_card_live) + { + for(i=0; i<8; i++) + { + output_set_indexed_value("mpu4led",(((8*(m_last_b7 >>7))+ m_input_strobe) * 8) +i,(~data & (1 << i)) !=0); + } + output_set_digit_value(((8*(m_last_b7 >>7))+m_input_strobe),~data); + } + break; + case LARGE_CARD_C: + lamp_extend_large(state,data,m_input_strobe,m_ic23_active); + break; + } + if (m_reel_mux == SIX_REEL_5TO8) + { + stepper_update(4, data&0x0F); + stepper_update(5, (data >> 4)&0x0F); + awp_draw_reel(4); + awp_draw_reel(5); + } + else + if (m_reel_mux == SEVEN_REEL) + { + stepper_update(1, data&0x0F); + stepper_update(2, (data >> 4)&0x0F); + awp_draw_reel(1); + awp_draw_reel(2); + } + + if (mame_stricmp(machine().system().name, "m4gambal") == 0) + { + /* The 'Gamball' device is a unique piece of mechanical equipment, designed to + provide a truly fair hi-lo gamble for an AWP. Functionally, it consists of + a ping-pong ball or similar enclosed in the machine's backbox, on a platform with 12 + holes. When the low 4 bytes of AUX1 are triggered, this fires the ball out from the + hole it's currently in, to land in another. Landing in the same hole causes the machine to + refire the ball. The ball detection is done by the high 4 bytes of AUX1. + Here we call the MAME RNG, once to pick a row, once to pick from the four pockets within it. We + then trigger the switches corresponding to the correct number. This appears to be the best way + of making the game fair, short of simulating the physics of a bouncing ball ;)*/ + if (data & 0x0f) + { + switch ((machine().rand()>>5) % 0x3) + { + case 0x00: //Top row + { + switch (machine().rand() & 0x3) + { + case 0x00: //7 + m_aux1_input = (m_aux1_input & 0x0f); + m_aux1_input|= 0xa0; + break; + case 0x01://4 + m_aux1_input = (m_aux1_input & 0x0f); + m_aux1_input|= 0xb0; + break; + case 0x02://9 + m_aux1_input = (m_aux1_input & 0x0f); + m_aux1_input|= 0xc0; + break; + case 0x03://8 + m_aux1_input = (m_aux1_input & 0x0f); + m_aux1_input|= 0xd0; + break; + } + } + case 0x01: //Middle row - note switches don't match pattern + { + switch (machine().rand() & 0x3) + { + case 0x00://12 + m_aux1_input = (m_aux1_input & 0x0f); + m_aux1_input|= 0x40; + break; + case 0x01://1 + m_aux1_input = (m_aux1_input & 0x0f); + m_aux1_input|= 0x50; + break; + case 0x02://11 + m_aux1_input = (m_aux1_input & 0x0f); + m_aux1_input|= 0x80; + break; + case 0x03://2 + m_aux1_input = (m_aux1_input & 0x0f); + m_aux1_input|= 0x90; + break; + } + } + case 0x02: //Bottom row + { + switch (machine().rand() & 0x3) + { + case 0x00://5 + m_aux1_input = (m_aux1_input & 0x0f); + m_aux1_input|= 0x00; + break; + case 0x01://10 + m_aux1_input = (m_aux1_input & 0x0f); + m_aux1_input|= 0x10; + break; + case 0x02://3 + m_aux1_input = (m_aux1_input & 0x0f); + m_aux1_input|= 0x20; + break; + case 0x03://6 + m_aux1_input = (m_aux1_input & 0x0f); + m_aux1_input|= 0x30; + break; + } + } + } + } + } +} + +WRITE8_MEMBER(mpu4_state::pia_ic5_portb_w) +{ + if (m_hopper == HOPPER_NONDUART_B) + { + //hopper1_drive_motor(data &0x01) + //hopper1_drive_sensor(data &0x08) + } + if (m_led_extender == CARD_A) + { + // led_write_latch(state, data & 0x07, pia_get_output_a(pia_ic4),m_input_strobe) + } + +} +READ8_MEMBER(mpu4_state::pia_ic5_portb_r) +{ + pia6821_device *pia_ic5 = machine().device("pia_ic5"); + if (m_hopper == HOPPER_NONDUART_B) + {/* + if (hopper1_active) + { + m_aux2_input |= 0x08; + } + else + { + m_aux2_input &= ~0x08; + }*/ + } + + LOG(("%s: IC5 PIA Read of Port B (coin input AUX2)\n",machine().describe_context())); + coin_lockout_w(machine(), 0, (pia_ic5->b_output() & 0x01) ); + coin_lockout_w(machine(), 1, (pia_ic5->b_output() & 0x02) ); + coin_lockout_w(machine(), 2, (pia_ic5->b_output() & 0x04) ); + coin_lockout_w(machine(), 3, (pia_ic5->b_output() & 0x08) ); + return machine().root_device().ioport("AUX2")->read() | m_aux2_input; +} + + +WRITE_LINE_MEMBER(mpu4_state::pia_ic5_ca2_w) +{ + LOG(("%s: IC5 PIA Write CA2 (Serial Tx) %2x\n",machine().describe_context(),state)); + m_serial_data = state; +} + + +/* --------------------------------------- + AY Chip sound function selection - + --------------------------------------- +The databus of the AY sound chip is connected to IC6 Port A. +Data is read from/written to the AY chip through this port. + +If this sounds familiar, Amstrad did something very similar with their home computers. + +The PSG function, defined by the BC1,BC2 and BDIR signals, is controlled by CA2 and CB2 of IC6. + +PSG function selection: +----------------------- +BDIR = IC6 CB2 and BC1 = IC6 CA2 + +Pin | PSG Function +BDIR BC1 | +0 0 | Inactive +0 1 | Read from selected PSG register. When function is set, the PSG will make the register data available to Port A. +1 0 | Write to selected PSG register. When set, the PSG will take the data at Port A and write it into the selected PSG register. +1 1 | Select PSG register. When set, the PSG will take the data at Port A and select a register. +*/ + +/* PSG function selected */ +static void update_ay(device_t *device) +{ + device_t *ay = device->machine().device("ay8913"); + if (!ay) return; + + mpu4_state *state = device->machine().driver_data(); + pia6821_device *pia = downcast(device); + if (!pia->cb2_output()) + { + switch (state->m_ay8913_address) + { + case 0x00: + { + /* Inactive */ + break; + } + case 0x01: + { /* CA2 = 1 CB2 = 0? : Read from selected PSG register and make the register data available to Port A */ + pia6821_device *pia_ic6 = device->machine().device("pia_ic6"); + LOG(("AY8913 address = %d \n",pia_ic6->a_output()&0x0f)); + break; + } + case 0x02: + {/* CA2 = 0 CB2 = 1? : Write to selected PSG register and write data to Port A */ + pia6821_device *pia_ic6 = device->machine().device("pia_ic6"); + device_t *ay = device->machine().device("ay8913"); + ay8910_data_w(ay, 0, pia_ic6->a_output()); + LOG(("AY Chip Write \n")); + break; + } + case 0x03: + {/* CA2 = 1 CB2 = 1? : The register will now be selected and the user can read from or write to it. + The register will remain selected until another is chosen.*/ + pia6821_device *pia_ic6 = device->machine().device("pia_ic6"); + device_t *ay = device->machine().device("ay8913"); + ay8910_address_w(ay, 0, pia_ic6->a_output()); + LOG(("AY Chip Select \n")); + break; + } + default: + { + LOG(("AY Chip error \n")); + } + } + } +} + + +WRITE_LINE_MEMBER(mpu4_state::pia_ic5_cb2_w) +{ + device_t *device = machine().device("pia_ic5"); + update_ay(device); +} + + +static const pia6821_interface pia_ic5_intf = +{ + DEVCB_DRIVER_MEMBER(mpu4_state,pia_ic5_porta_r), /* port A in */ + DEVCB_DRIVER_MEMBER(mpu4_state,pia_ic5_portb_r), /* port B in */ + DEVCB_NULL, /* line CA1 in */ + DEVCB_NULL, /* line CB1 in */ + DEVCB_NULL, /* line CA2 in */ + DEVCB_NULL, /* line CB2 in */ + DEVCB_DRIVER_MEMBER(mpu4_state,pia_ic5_porta_w), /* port A out */ + DEVCB_DRIVER_MEMBER(mpu4_state,pia_ic5_portb_w), /* port B out */ + DEVCB_DRIVER_LINE_MEMBER(mpu4_state,pia_ic5_ca2_w), /* line CA2 out */ + DEVCB_DRIVER_LINE_MEMBER(mpu4_state,pia_ic5_cb2_w), /* port CB2 out */ + DEVCB_DRIVER_LINE_MEMBER(mpu4_state,cpu0_irq), /* IRQA */ + DEVCB_DRIVER_LINE_MEMBER(mpu4_state,cpu0_irq) /* IRQB */ +}; + + +/* IC6, Reel A and B and AY registers (MODs below 4 only) */ +WRITE8_MEMBER(mpu4_state::pia_ic6_portb_w) +{ + LOG(("%s: IC6 PIA Port B Set to %2x (Reel A and B)\n", machine().describe_context(),data)); + + if (m_reel_mux == SEVEN_REEL) + { + stepper_update(3, data&0x0F); + stepper_update(4, (data >> 4)&0x0F); + awp_draw_reel(3); + awp_draw_reel(4); + } + else if (m_reels) + { + stepper_update(0, data & 0x0F ); + stepper_update(1, (data>>4) & 0x0F ); + awp_draw_reel(0); + awp_draw_reel(1); + } + + if (m_reel_flag && (m_reel_mux == STANDARD_REEL) && m_reels) + { + if ( stepper_optic_state(0) ) m_optic_pattern |= 0x01; + else m_optic_pattern &= ~0x01; + + if ( stepper_optic_state(1) ) m_optic_pattern |= 0x02; + else m_optic_pattern &= ~0x02; + } +} + + +WRITE8_MEMBER(mpu4_state::pia_ic6_porta_w) +{ + device_t *device = machine().device("pia_ic6"); + LOG(("%s: IC6 PIA Write A %2x\n", machine().describe_context(),data)); + if (m_mod_number <4) + { + m_ay_data = data; + update_ay(device); + } +} + + +WRITE_LINE_MEMBER(mpu4_state::pia_ic6_ca2_w) +{ + device_t *device = machine().device("pia_ic6"); + LOG(("%s: IC6 PIA write CA2 %2x (AY8913 BC1)\n", machine().describe_context(),state)); + if (m_mod_number <4) + { + if ( state ) m_ay8913_address |= 0x01; + else m_ay8913_address &= ~0x01; + update_ay(device); + } +} + + +WRITE_LINE_MEMBER(mpu4_state::pia_ic6_cb2_w) +{ + device_t *device = machine().device("pia_ic6"); + LOG(("%s: IC6 PIA write CB2 %2x (AY8913 BCDIR)\n", machine().describe_context(),state)); + if (m_mod_number <4) + { + if ( state ) m_ay8913_address |= 0x02; + else m_ay8913_address &= ~0x02; + update_ay(device); + } +} + + +static const pia6821_interface pia_ic6_intf = +{ + DEVCB_NULL, /* port A in */ + DEVCB_NULL, /* port B in */ + DEVCB_NULL, /* line CA1 in */ + DEVCB_NULL, /* line CB1 in */ + DEVCB_NULL, /* line CA2 in */ + DEVCB_NULL, /* line CB2 in */ + DEVCB_DRIVER_MEMBER(mpu4_state,pia_ic6_porta_w), /* port A out */ + DEVCB_DRIVER_MEMBER(mpu4_state,pia_ic6_portb_w), /* port B out */ + DEVCB_DRIVER_LINE_MEMBER(mpu4_state,pia_ic6_ca2_w), /* line CA2 out */ + DEVCB_DRIVER_LINE_MEMBER(mpu4_state,pia_ic6_cb2_w), /* port CB2 out */ + DEVCB_DRIVER_LINE_MEMBER(mpu4_state,cpu0_irq), /* IRQA */ + DEVCB_DRIVER_LINE_MEMBER(mpu4_state,cpu0_irq) /* IRQB */ +}; + + +/* IC7 Reel C and D, mechanical meters/Reel E and F, input strobe bit A */ +WRITE8_MEMBER(mpu4_state::pia_ic7_porta_w) +{ + LOG(("%s: IC7 PIA Port A Set to %2x (Reel C and D)\n", machine().describe_context(),data)); + if (m_reel_mux == SEVEN_REEL) + { + stepper_update(5, data&0x0F); + stepper_update(6, (data >> 4)&0x0F); + awp_draw_reel(5); + awp_draw_reel(6); + } + else if (m_reels) + { + stepper_update(2, data & 0x0F ); + stepper_update(3, (data>>4) & 0x0F ); + awp_draw_reel(2); + awp_draw_reel(3); + } + + if (m_reel_flag && (m_reel_mux == STANDARD_REEL) && m_reels) + { + if ( stepper_optic_state(2) ) m_optic_pattern |= 0x04; + else m_optic_pattern &= ~0x04; + if ( stepper_optic_state(3) ) m_optic_pattern |= 0x08; + else m_optic_pattern &= ~0x08; + } +} + +WRITE8_MEMBER(mpu4_state::pia_ic7_portb_w) +{ + if (m_hopper == HOPPER_DUART_A) + { + //duart write data + } + else if (m_hopper == HOPPER_NONDUART_A) + { + //hoppr1_drive_motor(data & 0x10); + } + + m_mmtr_data = data; +} + +READ8_MEMBER(mpu4_state::pia_ic7_portb_r) +{ +/* The meters are connected to a voltage drop sensor, where current +flowing through them also passes through pin B7, meaning that when +any meter is activated, pin B7 goes high. +As for why they connected this to an output port rather than using +CB1, no idea, although it proved of benefit when the reel multiplexer was designed +as it allows a separate meter to be used when the rest of the port is blocked. +This appears to have confounded the schematic drawer, who has assumed that +all eight meters are driven from this port, giving the 8 line driver chip +9 connections in total. */ + + //This may be overkill, but the meter sensing is VERY picky + + int combined_meter = MechMtr_GetActivity(0) | MechMtr_GetActivity(1) | + MechMtr_GetActivity(2) | MechMtr_GetActivity(3) | + MechMtr_GetActivity(4) | MechMtr_GetActivity(5) | + MechMtr_GetActivity(6) | MechMtr_GetActivity(7); + + if(combined_meter) + { + return 0x80; + } + else + { + return 0x00; + } +} + +WRITE_LINE_MEMBER(mpu4_state::pia_ic7_ca2_w) +{ + mpu4_state *drvstate = machine().driver_data(); + LOG(("%s: IC7 PIA write CA2 %2x (input strobe bit 0 / LED A)\n", machine().describe_context(),state)); + + m_IC23GA = state; + ic24_setup(drvstate); + ic23_update(drvstate); +} + +WRITE_LINE_MEMBER(mpu4_state::pia_ic7_cb2_w) +{ + m_remote_meter = state?0x80:0x00; +} + +static const pia6821_interface pia_ic7_intf = +{ + DEVCB_NULL, /* port A in */ + DEVCB_DRIVER_MEMBER(mpu4_state,pia_ic7_portb_r), /* port B in */ + DEVCB_NULL, /* line CA1 in */ + DEVCB_NULL, /* line CB1 in */ + DEVCB_NULL, /* line CA2 in */ + DEVCB_NULL, /* line CB2 in */ + DEVCB_DRIVER_MEMBER(mpu4_state,pia_ic7_porta_w), /* port A out */ + DEVCB_DRIVER_MEMBER(mpu4_state,pia_ic7_portb_w), /* port B out */ + DEVCB_DRIVER_LINE_MEMBER(mpu4_state,pia_ic7_ca2_w), /* line CA2 out */ + DEVCB_DRIVER_LINE_MEMBER(mpu4_state,pia_ic7_cb2_w), /* line CB2 out */ + DEVCB_DRIVER_LINE_MEMBER(mpu4_state,cpu0_irq), /* IRQA */ + DEVCB_DRIVER_LINE_MEMBER(mpu4_state,cpu0_irq) /* IRQB */ +}; + + +/* IC8, Inputs, TRIACS, alpha clock */ +READ8_MEMBER(mpu4_state::pia_ic8_porta_r) +{ + static const char *const portnames[] = { "ORANGE1", "ORANGE2", "BLACK1", "BLACK2", "ORANGE1", "ORANGE2", "DIL1", "DIL2" }; + pia6821_device *pia_ic5 = machine().device("pia_ic5"); + + LOG_IC8(("%s: IC8 PIA Read of Port A (MUX input data)\n", machine().describe_context())); +/* The orange inputs are polled twice as often as the black ones, for reasons of efficiency. + This is achieved via connecting every input line to an AND gate, thus allowing two strobes + to represent each orange input bank (strobes are active low). */ + pia_ic5->cb1_w(machine().root_device().ioport("AUX2")->read() & 0x80); + return machine().root_device().ioport(portnames[m_input_strobe])->read(); +} + + +WRITE8_MEMBER(mpu4_state::pia_ic8_portb_w) +{ + if (m_hopper == HOPPER_DUART_B) + { +// duart.drive_sensor(data & 0x04, data & 0x01, 0, 0); + } + else if (m_hopper == HOPPER_DUART_C) + { +// duart.drive_sensor(data & 0x04, data & 0x01, data & 0x04, data & 0x02); + } + int i; + LOG_IC8(("%s: IC8 PIA Port B Set to %2x (OUTPUT PORT, TRIACS)\n", machine().describe_context(),data)); + for (i = 0; i < 8; i++) + { + output_set_indexed_value("triac", i, data & (1 << i)); + } +} + +WRITE_LINE_MEMBER(mpu4_state::pia_ic8_ca2_w) +{ + mpu4_state *drvstate = machine().driver_data(); + LOG_IC8(("%s: IC8 PIA write CA2 (input_strobe bit 2 / LED C) %02X\n", machine().describe_context(), state & 0xFF)); + + m_IC23GC = state; + ic23_update(drvstate); +} + + +WRITE_LINE_MEMBER(mpu4_state::pia_ic8_cb2_w) +{ + LOG_IC8(("%s: IC8 PIA write CB2 (alpha clock) %02X\n", machine().describe_context(), state & 0xFF)); + + // DM Data pin B + if (m_alpha_clock != state) + { + if (!m_alpha_clock)//falling edge + { + m_vfd->shift_data(m_alpha_data_line?0:1); + } + } + m_alpha_clock = state; +} + + +static const pia6821_interface pia_ic8_intf = +{ + DEVCB_DRIVER_MEMBER(mpu4_state,pia_ic8_porta_r), /* port A in */ + DEVCB_NULL, /* port B in */ + DEVCB_NULL, /* line CA1 in */ + DEVCB_NULL, /* line CB1 in */ + DEVCB_NULL, /* line CA2 in */ + DEVCB_NULL, /* line CB2 in */ + DEVCB_NULL, /* port A out */ + DEVCB_DRIVER_MEMBER(mpu4_state,pia_ic8_portb_w), /* port B out */ + DEVCB_DRIVER_LINE_MEMBER(mpu4_state,pia_ic8_ca2_w), /* line CA2 out */ + DEVCB_DRIVER_LINE_MEMBER(mpu4_state,pia_ic8_cb2_w), /* port CB2 out */ + DEVCB_DRIVER_LINE_MEMBER(mpu4_state,cpu0_irq), /* IRQA */ + DEVCB_DRIVER_LINE_MEMBER(mpu4_state,cpu0_irq) /* IRQB */ +}; + +// universal sampled sound program card PCB 683077 +// Sampled sound card, using a PIA and PTM for timing and data handling +WRITE8_MEMBER(mpu4_state::pia_gb_porta_w) +{ + device_t *msm6376 = machine().device("msm6376"); + LOG_SS(("%s: GAMEBOARD: PIA Port A Set to %2x\n", machine().describe_context(),data)); + okim6376_w(msm6376, 0, data); +} + +WRITE8_MEMBER(mpu4_state::pia_gb_portb_w) +{ + device_t *msm6376 = machine().device("msm6376"); + okim6376_device *msm = machine().device("msm6376"); + + int changed = m_expansion_latch^data; + + LOG_SS(("%s: GAMEBOARD: PIA Port B Set to %2x\n", machine().describe_context(),data)); + + if ( changed & 0x20) + { // digital volume clock line changed + if ( !(data & 0x20) ) + { // changed from high to low, + if ( !(data & 0x10) )//down + { + if ( m_global_volume < 32 ) m_global_volume++; //steps unknown + } + else + {//up + if ( m_global_volume > 0 ) m_global_volume--; + } + + { + float percent = (32-m_global_volume)/32.0; + msm->set_output_gain(0, percent); + msm->set_output_gain(1, percent); + } + } + } + okim6376_ch2_w(msm6376,data&0x02); + okim6376_st_w(msm6376,data&0x01); +} +READ8_MEMBER(mpu4_state::pia_gb_portb_r) +{ + device_t *msm6376 = machine().device("msm6376"); + LOG_SS(("%s: GAMEBOARD: PIA Read of Port B\n",machine().describe_context())); + int data=0; + // b7 NAR - we can load another address into Channel 1 + // b6, 1 = OKI ready, 0 = OKI busy + // b5, vol clock + // b4, 1 = Vol down, 0 = Vol up + // + + if ( okim6376_nar_r(msm6376) ) data |= 0x80; + else data &= ~0x80; + + if ( okim6376_busy_r(msm6376) ) data |= 0x40; + else data &= ~0x40; + + return ( data | m_expansion_latch ); +} + +WRITE_LINE_MEMBER(mpu4_state::pia_gb_ca2_w) +{ + LOG_SS(("%s: GAMEBOARD: OKI RESET data = %02X\n", machine().describe_context(), state)); + +// reset line +} + +WRITE_LINE_MEMBER(mpu4_state::pia_gb_cb2_w) +{ + //Some BWB games use this to drive the bankswitching + if (m_bwb_bank) + { + m_pageval = state; + membank("bank1")->set_entry((m_pageval + (m_pageset ? 4 : 0)) & 0x07); + } +} + +static const pia6821_interface pia_ic4ss_intf = +{ + DEVCB_NULL, /* port A in */ + DEVCB_DRIVER_MEMBER(mpu4_state,pia_gb_portb_r), /* port B in */ + DEVCB_NULL, /* line CA1 in */ + DEVCB_NULL, /* line CB1 in */ + DEVCB_NULL, /* line CA2 in */ + DEVCB_NULL, /* line CB2 in */ + DEVCB_DRIVER_MEMBER(mpu4_state,pia_gb_porta_w), /* port A out */ + DEVCB_DRIVER_MEMBER(mpu4_state,pia_gb_portb_w), /* port B out */ + DEVCB_DRIVER_LINE_MEMBER(mpu4_state,pia_gb_ca2_w), /* line CA2 out */ + DEVCB_DRIVER_LINE_MEMBER(mpu4_state,pia_gb_cb2_w), /* line CB2 out */ + DEVCB_NULL, /* IRQA */ + DEVCB_NULL /* IRQB */ +}; + +//Sampled sound timer +/* +The MSM6376 sound chip is configured in a slightly strange way, to enable dynamic +sample rate changes (8Khz, 10.6 Khz, 16 KHz) by varying the clock. +According to the BwB programmer's guide, the formula is: +MSM6376 clock frequency:- +freq = (1720000/((t3L+1)(t3H+1)))*[(t3H(T3L+1)+1)/(2(t1+1))] +where [] means rounded up integer, +t3L is the LSB of Clock 3, +t3H is the MSB of Clock 3, +and t1 is the initial value in clock 1. +*/ + +//O3 -> G1 O1 -> c2 o2 -> c1 +WRITE8_MEMBER(mpu4_state::ic3ss_o1_callback) +{ + device_t * device = machine().device("ptm_ic3ss"); + downcast(device)->set_c2(data); +} + + +WRITE8_MEMBER(mpu4_state::ic3ss_o2_callback)//Generates 'beep' tone +{ + device_t * device = machine().device("ptm_ic3ss"); + downcast(device)->set_c1(data);//? +} + + +WRITE8_MEMBER(mpu4_state::ic3ss_o3_callback) +{ + //downcast(device)->set_g1(data); /* this output is the clock for timer1 */ +} + +/* This is a bit of a cheat - since we don't clock into the OKI chip directly, we need to +calculate the oscillation frequency in advance. We're running the timer for interrupt +purposes, but the frequency calculation is done by plucking the values out as they are written.*/ +WRITE8_MEMBER(mpu4_state::ic3ss_w) +{ + device_t *ic3ss = machine().device("ptm_ic3ss"); + downcast(ic3ss)->write(offset,data); + device_t *msm6376 = machine().device("msm6376"); + + if (offset == 3) + { + m_t1 = data; + } + if (offset == 6) + { + m_t3h = data; + } + if (offset == 7) + { + m_t3l = data; + } + + float num = (1720000/((m_t3l + 1)*(m_t3h + 1))); + float denom1 = ((m_t3h *(m_t3l + 1)+ 1)/(2*(m_t1 + 1))); + + int denom2 = denom1 +0.5;//need to round up, this gives same precision as chip + int freq=num*denom2; + + if (freq) + { + okim6376_set_frequency(msm6376, freq); + } +} + + +static const ptm6840_interface ptm_ic3ss_intf = +{ + MPU4_MASTER_CLOCK / 4, + { 0, 0, 0 }, + { DEVCB_DRIVER_MEMBER(mpu4_state,ic3ss_o1_callback), + DEVCB_DRIVER_MEMBER(mpu4_state,ic3ss_o2_callback), + DEVCB_DRIVER_MEMBER(mpu4_state,ic3ss_o3_callback) }, + DEVCB_NULL//LINE(cpu1_ptm_irq) +}; + +/* input ports for MPU4 board */ +INPUT_PORTS_START( mpu4 ) + PORT_START("ORANGE1") + PORT_BIT(0x01, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("00")// 20p level + PORT_BIT(0x02, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("01")// 100p level + PORT_BIT(0x04, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("02")// Token 1 level + PORT_BIT(0x08, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("03")// Token 2 level + PORT_BIT(0x10, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("04") + PORT_CONFNAME( 0xE0, 0x00, "Stake Key" ) + PORT_CONFSETTING( 0x00, "Not fitted / 5p" ) + PORT_CONFSETTING( 0x20, "10p" ) + PORT_CONFSETTING( 0x40, "20p" ) + PORT_CONFSETTING( 0x60, "25p" ) + PORT_CONFSETTING( 0x80, "30p" ) + PORT_CONFSETTING( 0xA0, "40p" ) + PORT_CONFSETTING( 0xC0, "50p" ) + PORT_CONFSETTING( 0xE0, "1 GBP" ) + + PORT_START("ORANGE2") + PORT_CONFNAME( 0x0F, 0x00, "Jackpot / Prize Key" ) + PORT_CONFSETTING( 0x00, "Not fitted" ) + PORT_CONFSETTING( 0x01, "3 GBP" ) + PORT_CONFSETTING( 0x02, "4 GBP" ) + PORT_CONFSETTING( 0x08, "5 GBP" ) + PORT_CONFSETTING( 0x03, "6 GBP" ) + PORT_CONFSETTING( 0x04, "6 GBP Token" ) + PORT_CONFSETTING( 0x05, "8 GBP" ) + PORT_CONFSETTING( 0x06, "8 GBP Token" ) + PORT_CONFSETTING( 0x07, "10 GBP" ) + PORT_CONFSETTING( 0x09, "15 GBP" ) + PORT_CONFSETTING( 0x0A, "25 GBP" ) + PORT_CONFSETTING( 0x0B, "25 GBP (Licensed Betting Office Profile)" ) + PORT_CONFSETTING( 0x0C, "35 GBP" ) + PORT_CONFSETTING( 0x0D, "70 GBP" ) + PORT_CONFSETTING( 0x0E, "Reserved" ) + PORT_CONFSETTING( 0x0F, "Reserved" ) + + PORT_CONFNAME( 0xF0, 0x00, "Percentage Key" ) + PORT_CONFSETTING( 0x00, "Not fitted / 68% (Invalid for UK Games)" ) + PORT_CONFSETTING( 0x10, "70" ) + PORT_CONFSETTING( 0x20, "72" ) + PORT_CONFSETTING( 0x30, "74" ) + PORT_CONFSETTING( 0x40, "76" ) + PORT_CONFSETTING( 0x50, "78" ) + PORT_CONFSETTING( 0x60, "80" ) + PORT_CONFSETTING( 0x70, "82" ) + PORT_CONFSETTING( 0x80, "84" ) + PORT_CONFSETTING( 0x90, "86" ) + PORT_CONFSETTING( 0xA0, "88" ) + PORT_CONFSETTING( 0xB0, "90" ) + PORT_CONFSETTING( 0xC0, "92" ) + PORT_CONFSETTING( 0xD0, "94" ) + PORT_CONFSETTING( 0xE0, "96" ) + PORT_CONFSETTING( 0xF0, "98" ) + + PORT_START("BLACK1") + PORT_BIT(0x01, IP_ACTIVE_HIGH, IPT_BUTTON1) PORT_NAME("Hi") + PORT_BIT(0x02, IP_ACTIVE_HIGH, IPT_BUTTON2) PORT_NAME("Lo") + PORT_BIT(0x04, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("18") + PORT_BIT(0x08, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("19") + PORT_BIT(0x10, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("20") + PORT_BIT(0x20, IP_ACTIVE_HIGH, IPT_SERVICE) PORT_NAME("Test Button") PORT_CODE(KEYCODE_W) + PORT_BIT(0x40, IP_ACTIVE_HIGH, IPT_SERVICE) PORT_NAME("Refill Key") PORT_CODE(KEYCODE_R) PORT_TOGGLE + PORT_BIT(0x80, IP_ACTIVE_HIGH, IPT_INTERLOCK) PORT_NAME("Cashbox (Back) Door") PORT_CODE(KEYCODE_Q) PORT_TOGGLE + + PORT_START("BLACK2") + PORT_BIT(0x01, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("24") + PORT_BIT(0x02, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("25") + PORT_BIT(0x04, IP_ACTIVE_HIGH, IPT_BUTTON3) PORT_NAME("Cancel") + PORT_BIT(0x08, IP_ACTIVE_HIGH, IPT_BUTTON4) PORT_NAME("Hold 1") + PORT_BIT(0x10, IP_ACTIVE_HIGH, IPT_BUTTON5) PORT_NAME("Hold 2") + PORT_BIT(0x20, IP_ACTIVE_HIGH, IPT_BUTTON6) PORT_NAME("Hold 3") + PORT_BIT(0x40, IP_ACTIVE_HIGH, IPT_BUTTON7) PORT_NAME("Hold 4") + PORT_BIT(0x80, IP_ACTIVE_HIGH, IPT_START1) + + PORT_START("DIL1") + PORT_DIPNAME( 0x01, 0x00, DEF_STR( Unused ) ) PORT_DIPLOCATION("DIL1:01") + PORT_DIPSETTING( 0x00, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x01, DEF_STR( On ) ) + PORT_DIPNAME( 0x02, 0x00, DEF_STR( Unused ) ) PORT_DIPLOCATION("DIL1:02") + PORT_DIPSETTING( 0x00, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x02, DEF_STR( On ) ) + PORT_DIPNAME( 0x04, 0x00, DEF_STR( Unused ) ) PORT_DIPLOCATION("DIL1:03") + PORT_DIPSETTING( 0x00, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x04, DEF_STR( On ) ) + PORT_DIPNAME( 0x08, 0x00, DEF_STR( Unused ) ) PORT_DIPLOCATION("DIL1:04") + PORT_DIPSETTING( 0x00, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x08, DEF_STR( On ) ) + PORT_DIPNAME( 0xF0, 0x00, "Target Percentage (if key not fitted)" )PORT_DIPLOCATION("DIL1:05,06,07,08") + PORT_DIPSETTING( 0x00, "Unset (Program Optimum)" ) + PORT_DIPSETTING( 0x10, "70" ) + PORT_DIPSETTING( 0x20, "72" ) + PORT_DIPSETTING( 0x30, "74" ) + PORT_DIPSETTING( 0x40, "76" ) + PORT_DIPSETTING( 0x50, "78" ) + PORT_DIPSETTING( 0x60, "80" ) + PORT_DIPSETTING( 0x70, "82" ) + PORT_DIPSETTING( 0x80, "84" ) + PORT_DIPSETTING( 0x90, "86" ) + PORT_DIPSETTING( 0xA0, "88" ) + PORT_DIPSETTING( 0xB0, "90" ) + PORT_DIPSETTING( 0xC0, "92" ) + PORT_DIPSETTING( 0xD0, "94" ) + PORT_DIPSETTING( 0xE0, "96" ) + PORT_DIPSETTING( 0xF0, "98" ) + + PORT_START("DIL2") + PORT_DIPNAME( 0x01, 0x00, "Token Lockout when full" ) PORT_DIPLOCATION("DIL2:01") + PORT_DIPSETTING( 0x00, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x01, DEF_STR( On ) ) + PORT_DIPNAME( 0x02, 0x00, DEF_STR( Unused )) PORT_DIPLOCATION("DIL2:02") + PORT_DIPSETTING( 0x00, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x02, DEF_STR( On ) ) + PORT_DIPNAME( 0x04, 0x00, "Scottish Coin Handling" ) PORT_DIPLOCATION("DIL2:03")//20p payout + PORT_DIPSETTING( 0x00, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x04, DEF_STR( On ) ) + PORT_DIPNAME( 0x08, 0x08, "Out of Credit Display Inhibit" ) PORT_DIPLOCATION("DIL2:04") // many games need this on to boot + PORT_DIPSETTING( 0x00, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x08, DEF_STR( On ) ) + PORT_DIPNAME( 0x10, 0x00, "OCD Audio Enable" ) PORT_DIPLOCATION("DIL2:05") + PORT_DIPSETTING( 0x00, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x10, DEF_STR( On ) ) + PORT_DIPNAME( 0x20, 0x00, "Coin Alarm Inhibit" ) PORT_DIPLOCATION("DIL2:06") + PORT_DIPSETTING( 0x00, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x20, DEF_STR( On ) ) + PORT_DIPNAME( 0x40, 0x00, "Token Refill Level Inhibit" ) PORT_DIPLOCATION("DIL2:07") + PORT_DIPSETTING( 0x00, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x40, DEF_STR( On ) ) + PORT_DIPNAME( 0x80, 0x00, "Single Credit Entry" ) PORT_DIPLOCATION("DIL2:08") + PORT_DIPSETTING( 0x00, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x80, DEF_STR( On ) ) + + PORT_START("AUX1") + PORT_BIT(0x01, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("0") + PORT_BIT(0x02, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("1") + PORT_BIT(0x04, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("2") + PORT_BIT(0x08, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("3") + PORT_BIT(0x10, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("4") + PORT_BIT(0x20, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("5") + PORT_BIT(0x40, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("6") + PORT_BIT(0x80, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("7") + + PORT_START("AUX2") + PORT_BIT(0x01, IP_ACTIVE_HIGH, IPT_SPECIAL) + PORT_BIT(0x02, IP_ACTIVE_HIGH, IPT_SPECIAL) + PORT_BIT(0x04, IP_ACTIVE_HIGH, IPT_SPECIAL) + PORT_BIT(0x08, IP_ACTIVE_HIGH, IPT_SPECIAL) + PORT_BIT(0x10, IP_ACTIVE_HIGH, IPT_COIN1) PORT_NAME("10p")PORT_IMPULSE(5) + PORT_BIT(0x20, IP_ACTIVE_HIGH, IPT_COIN2) PORT_NAME("20p")PORT_IMPULSE(5) + PORT_BIT(0x40, IP_ACTIVE_HIGH, IPT_COIN3) PORT_NAME("50p")PORT_IMPULSE(5) + PORT_BIT(0x80, IP_ACTIVE_HIGH, IPT_COIN4) PORT_NAME("100p")PORT_IMPULSE(5) +INPUT_PORTS_END + +INPUT_PORTS_START( mpu4jackpot8tkn ) + PORT_INCLUDE( mpu4 ) + + PORT_MODIFY("ORANGE2") + PORT_CONFNAME( 0x0F, 0x06, "Jackpot / Prize Key" ) + PORT_CONFSETTING( 0x00, "Not fitted" ) + PORT_CONFSETTING( 0x01, "3 GBP" ) + PORT_CONFSETTING( 0x02, "4 GBP" ) + PORT_CONFSETTING( 0x08, "5 GBP" ) + PORT_CONFSETTING( 0x03, "6 GBP" ) + PORT_CONFSETTING( 0x04, "6 GBP Token" ) + PORT_CONFSETTING( 0x05, "8 GBP" ) + PORT_CONFSETTING( 0x06, "8 GBP Token" ) + PORT_CONFSETTING( 0x07, "10 GBP" ) + PORT_CONFSETTING( 0x09, "15 GBP" ) + PORT_CONFSETTING( 0x0A, "25 GBP" ) + PORT_CONFSETTING( 0x0B, "25 GBP (Licensed Betting Office Profile)" ) + PORT_CONFSETTING( 0x0C, "35 GBP" ) + PORT_CONFSETTING( 0x0D, "70 GBP" ) + PORT_CONFSETTING( 0x0E, "Reserved" ) + PORT_CONFSETTING( 0x0F, "Reserved" ) +INPUT_PORTS_END + +INPUT_PORTS_START( mpu4jackpot8per ) + PORT_INCLUDE( mpu4 ) + + PORT_MODIFY("ORANGE2") + PORT_CONFNAME( 0x0F, 0x06, "Jackpot / Prize Key" ) + PORT_CONFSETTING( 0x00, "Not fitted" ) + PORT_CONFSETTING( 0x01, "3 GBP" ) + PORT_CONFSETTING( 0x02, "4 GBP" ) + PORT_CONFSETTING( 0x08, "5 GBP" ) + PORT_CONFSETTING( 0x03, "6 GBP" ) + PORT_CONFSETTING( 0x04, "6 GBP Token" ) + PORT_CONFSETTING( 0x05, "8 GBP" ) + PORT_CONFSETTING( 0x06, "8 GBP Token" ) + PORT_CONFSETTING( 0x07, "10 GBP" ) + PORT_CONFSETTING( 0x09, "15 GBP" ) + PORT_CONFSETTING( 0x0A, "25 GBP" ) + PORT_CONFSETTING( 0x0B, "25 GBP (Licensed Betting Office Profile)" ) + PORT_CONFSETTING( 0x0C, "35 GBP" ) + PORT_CONFSETTING( 0x0D, "70 GBP" ) + PORT_CONFSETTING( 0x0E, "Reserved" ) + PORT_CONFSETTING( 0x0F, "Reserved" ) + + PORT_CONFNAME( 0xF0, 0x10, "Percentage Key" ) + PORT_CONFSETTING( 0x00, "Not fitted / 68% (Invalid for UK Games)" ) + PORT_CONFSETTING( 0x10, "70" ) + PORT_CONFSETTING( 0x20, "72" ) + PORT_CONFSETTING( 0x30, "74" ) + PORT_CONFSETTING( 0x40, "76" ) + PORT_CONFSETTING( 0x50, "78" ) + PORT_CONFSETTING( 0x60, "80" ) + PORT_CONFSETTING( 0x70, "82" ) + PORT_CONFSETTING( 0x80, "84" ) + PORT_CONFSETTING( 0x90, "86" ) + PORT_CONFSETTING( 0xA0, "88" ) + PORT_CONFSETTING( 0xB0, "90" ) + PORT_CONFSETTING( 0xC0, "92" ) + PORT_CONFSETTING( 0xD0, "94" ) + PORT_CONFSETTING( 0xE0, "96" ) + PORT_CONFSETTING( 0xF0, "98" ) +INPUT_PORTS_END + + +INPUT_PORTS_START( connect4 ) + PORT_START("ORANGE1") + PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("00") + PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("01") + PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("02") + PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("03") + PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("04") + PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("05") + PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("06") + PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("07") + + PORT_START("ORANGE2") + PORT_BIT(0x01, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("08") + PORT_BIT(0x02, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("09") + PORT_BIT(0x04, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("10") + PORT_BIT(0x08, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("11") + PORT_BIT(0x10, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("12") + PORT_BIT(0x20, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("13") + PORT_BIT(0x40, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("14") + PORT_BIT(0x80, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("15") + + PORT_START("BLACK1") + PORT_BIT(0x01, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("16") + PORT_BIT(0x02, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("17") + PORT_BIT(0x04, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("18") + PORT_BIT(0x08, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("19") + PORT_BIT(0x10, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("20") + PORT_BIT(0x20, IP_ACTIVE_HIGH, IPT_SERVICE) PORT_NAME("Test Switch") + PORT_BIT(0x40, IP_ACTIVE_HIGH, IPT_SERVICE) PORT_NAME("Refill Key") PORT_CODE(KEYCODE_R) PORT_TOGGLE + PORT_BIT(0x80, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Door Switch?") PORT_TOGGLE + + PORT_START("BLACK2") + PORT_BIT(0x01, IP_ACTIVE_HIGH, IPT_BUTTON1) PORT_NAME("Select") + PORT_BIT(0x02, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("25") + PORT_BIT(0x04, IP_ACTIVE_HIGH, IPT_START2) PORT_NAME("Pass") + PORT_BIT(0x08, IP_ACTIVE_HIGH, IPT_START1) PORT_NAME("Play") + PORT_BIT(0x10, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("28") + PORT_BIT(0x20, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("29") + PORT_BIT(0x40, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("30") + PORT_BIT(0x80, IP_ACTIVE_HIGH, IPT_BUTTON2) PORT_NAME("Drop") + + PORT_START("DIL1") + PORT_DIPNAME( 0x80, 0x00, "DIL101" ) PORT_DIPLOCATION("DIL1:01") + PORT_DIPSETTING( 0x00, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x80, DEF_STR( On ) ) + PORT_DIPNAME( 0x40, 0x00, "DIL102" ) PORT_DIPLOCATION("DIL1:02") + PORT_DIPSETTING( 0x00, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x40, DEF_STR( On ) ) + PORT_DIPNAME( 0x20, 0x00, "DIL103" ) PORT_DIPLOCATION("DIL1:03") + PORT_DIPSETTING( 0x00, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x20, DEF_STR( On ) ) + PORT_DIPNAME( 0x10, 0x00, "DIL104" ) PORT_DIPLOCATION("DIL1:04") + PORT_DIPSETTING( 0x00, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x10, DEF_STR( On ) ) + PORT_DIPNAME( 0x08, 0x00, "DIL105" ) PORT_DIPLOCATION("DIL1:05") + PORT_DIPSETTING( 0x00, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x08, DEF_STR( On ) ) + PORT_DIPNAME( 0x04, 0x00, "DIL106" ) PORT_DIPLOCATION("DIL1:06") + PORT_DIPSETTING( 0x00, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x04, DEF_STR( On ) ) + PORT_DIPNAME( 0x02, 0x00, "DIL107" ) PORT_DIPLOCATION("DIL1:07") + PORT_DIPSETTING( 0x00, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x02, DEF_STR( On ) ) + PORT_DIPNAME( 0x01, 0x00, "DIL108" ) PORT_DIPLOCATION("DIL1:08") + PORT_DIPSETTING( 0x00, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x01, DEF_STR( On ) ) + + PORT_START("DIL2") + PORT_DIPNAME( 0x80, 0x00, "DIL201" ) PORT_DIPLOCATION("DIL2:01") + PORT_DIPSETTING( 0x00, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x80, DEF_STR( On ) ) + PORT_DIPNAME( 0x40, 0x00, "DIL202" ) PORT_DIPLOCATION("DIL2:02") + PORT_DIPSETTING( 0x00, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x40, DEF_STR( On ) ) + PORT_DIPNAME( 0x20, 0x00, "DIL203" ) PORT_DIPLOCATION("DIL2:03") + PORT_DIPSETTING( 0x00, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x20, DEF_STR( On ) ) + PORT_DIPNAME( 0x10, 0x00, "DIL204" ) PORT_DIPLOCATION("DIL2:04") + PORT_DIPSETTING( 0x00, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x10, DEF_STR( On ) ) + PORT_DIPNAME( 0x08, 0x00, "DIL205" ) PORT_DIPLOCATION("DIL2:05") + PORT_DIPSETTING( 0x00, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x08, DEF_STR( On ) ) + PORT_DIPNAME( 0x04, 0x00, "DIL206" ) PORT_DIPLOCATION("DIL2:06") + PORT_DIPSETTING( 0x00, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x04, DEF_STR( On ) ) + PORT_DIPNAME( 0x02, 0x00, "DIL207" ) PORT_DIPLOCATION("DIL2:07") + PORT_DIPSETTING( 0x00, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x02, DEF_STR( On ) ) + PORT_DIPNAME( 0x01, 0x00, "DIL208" ) PORT_DIPLOCATION("DIL2:08") + PORT_DIPSETTING( 0x00, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x01, DEF_STR( On ) ) + + PORT_START("AUX1") + PORT_BIT(0x01, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("0") + PORT_BIT(0x02, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("1") + PORT_BIT(0x04, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("2") + PORT_BIT(0x08, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("3") + PORT_BIT(0x10, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("4") + PORT_BIT(0x20, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("5") + PORT_BIT(0x40, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("6") + PORT_BIT(0x80, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("7") + + PORT_START("AUX2") + PORT_BIT(0x01, IP_ACTIVE_HIGH, IPT_SPECIAL) + PORT_BIT(0x02, IP_ACTIVE_HIGH, IPT_SPECIAL) + PORT_BIT(0x04, IP_ACTIVE_HIGH, IPT_SPECIAL) + PORT_BIT(0x08, IP_ACTIVE_HIGH, IPT_SPECIAL) + PORT_BIT(0x10, IP_ACTIVE_HIGH, IPT_COIN1) PORT_NAME("10p")PORT_IMPULSE(5) + PORT_BIT(0x20, IP_ACTIVE_HIGH, IPT_COIN2) PORT_NAME("20p")PORT_IMPULSE(5) + PORT_BIT(0x40, IP_ACTIVE_HIGH, IPT_COIN3) PORT_NAME("50p")PORT_IMPULSE(5) + PORT_BIT(0x80, IP_ACTIVE_HIGH, IPT_COIN4) PORT_NAME("100p")PORT_IMPULSE(5) +INPUT_PORTS_END + +INPUT_PORTS_START( gamball ) + PORT_START("ORANGE1") + PORT_BIT(0x01, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("00")// 20p level + PORT_BIT(0x02, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("01")// 100p level + PORT_BIT(0x04, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("02")// Token 1 level + PORT_BIT(0x08, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("03")// Token 2 level + PORT_BIT(0x10, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("04") + PORT_CONFNAME( 0xE0, 0x00, "Stake Key" ) + PORT_CONFSETTING( 0x00, "Not fitted / 5p" ) + PORT_CONFSETTING( 0x20, "10p" ) + PORT_CONFSETTING( 0x40, "20p" ) + PORT_CONFSETTING( 0x60, "25p" ) + PORT_CONFSETTING( 0x80, "30p" ) + PORT_CONFSETTING( 0xA0, "40p" ) + PORT_CONFSETTING( 0xC0, "50p" ) + PORT_CONFSETTING( 0xE0, "1 GBP" ) + + PORT_START("ORANGE2") + PORT_CONFNAME( 0x0F, 0x00, "Jackpot / Prize Key" ) + PORT_CONFSETTING( 0x00, "Not fitted" ) + PORT_CONFSETTING( 0x01, "3 GBP" ) + PORT_CONFSETTING( 0x02, "4 GBP" ) + PORT_CONFSETTING( 0x08, "5 GBP" ) + PORT_CONFSETTING( 0x03, "6 GBP" ) + PORT_CONFSETTING( 0x04, "6 GBP Token" ) + PORT_CONFSETTING( 0x05, "8 GBP" ) + PORT_CONFSETTING( 0x06, "8 GBP Token" ) + PORT_CONFSETTING( 0x07, "10 GBP" ) + PORT_CONFSETTING( 0x09, "15 GBP" ) + PORT_CONFSETTING( 0x0A, "25 GBP" ) + PORT_CONFSETTING( 0x0B, "25 GBP (Licensed Betting Office Profile)" ) + PORT_CONFSETTING( 0x0C, "35 GBP" ) + PORT_CONFSETTING( 0x0D, "70 GBP" ) + PORT_CONFSETTING( 0x0E, "Reserved" ) + PORT_CONFSETTING( 0x0F, "Reserved" ) + + PORT_CONFNAME( 0xF0, 0x00, "Percentage Key" ) + PORT_CONFSETTING( 0x00, "As Option Switches" ) + PORT_CONFSETTING( 0x10, "70" ) + PORT_CONFSETTING( 0x20, "72" ) + PORT_CONFSETTING( 0x30, "74" ) + PORT_CONFSETTING( 0x40, "76" ) + PORT_CONFSETTING( 0x50, "78" ) + PORT_CONFSETTING( 0x60, "80" ) + PORT_CONFSETTING( 0x70, "82" ) + PORT_CONFSETTING( 0x80, "84" ) + PORT_CONFSETTING( 0x90, "86" ) + PORT_CONFSETTING( 0xA0, "88" ) + PORT_CONFSETTING( 0xB0, "90" ) + PORT_CONFSETTING( 0xC0, "92" ) + PORT_CONFSETTING( 0xD0, "94" ) + PORT_CONFSETTING( 0xE0, "96" ) + PORT_CONFSETTING( 0xF0, "98" ) + + PORT_START("BLACK1") + PORT_BIT(0x01, IP_ACTIVE_HIGH, IPT_BUTTON1) PORT_NAME("Hi") + PORT_BIT(0x02, IP_ACTIVE_HIGH, IPT_BUTTON2) PORT_NAME("Lo") + PORT_BIT(0x04, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("18") + PORT_BIT(0x08, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("19") + PORT_BIT(0x10, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("20") + PORT_BIT(0x20, IP_ACTIVE_HIGH, IPT_SERVICE) PORT_NAME("Test Button") PORT_CODE(KEYCODE_W) + PORT_BIT(0x40, IP_ACTIVE_HIGH, IPT_SERVICE) PORT_NAME("Refill Key") PORT_CODE(KEYCODE_R) PORT_TOGGLE + PORT_BIT(0x80, IP_ACTIVE_HIGH, IPT_INTERLOCK) PORT_NAME("Cashbox Door") PORT_CODE(KEYCODE_Q) PORT_TOGGLE + + PORT_START("BLACK2") + PORT_BIT(0x01, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("24") + PORT_BIT(0x02, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("25") + PORT_BIT(0x04, IP_ACTIVE_HIGH, IPT_BUTTON3) PORT_NAME("Cancel/Collect") + PORT_BIT(0x08, IP_ACTIVE_HIGH, IPT_BUTTON4) PORT_NAME("Hold/Nudge 1") + PORT_BIT(0x10, IP_ACTIVE_HIGH, IPT_BUTTON5) PORT_NAME("Hold/Nudge 2") + PORT_BIT(0x20, IP_ACTIVE_HIGH, IPT_BUTTON6) PORT_NAME("Hold/Nudge 3") + PORT_BIT(0x40, IP_ACTIVE_HIGH, IPT_BUTTON7) PORT_NAME("Hold/Nudge 4") + PORT_BIT(0x80, IP_ACTIVE_HIGH, IPT_START1) + + PORT_START("DIL1") + PORT_DIPNAME( 0x80, 0x00, "DIL101" ) PORT_DIPLOCATION("DIL1:01") + PORT_DIPSETTING( 0x00, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x80, DEF_STR( On ) ) + PORT_DIPNAME( 0x40, 0x00, "DIL102" ) PORT_DIPLOCATION("DIL1:02") + PORT_DIPSETTING( 0x00, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x40, DEF_STR( On ) ) + PORT_DIPNAME( 0x20, 0x00, "DIL103" ) PORT_DIPLOCATION("DIL1:03") + PORT_DIPSETTING( 0x00, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x20, DEF_STR( On ) ) + PORT_DIPNAME( 0x10, 0x00, "DIL104" ) PORT_DIPLOCATION("DIL1:04") + PORT_DIPSETTING( 0x00, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x10, DEF_STR( On ) ) + PORT_DIPNAME( 0x08, 0x00, "DIL105" ) PORT_DIPLOCATION("DIL1:05") + PORT_DIPSETTING( 0x00, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x08, DEF_STR( On ) ) + PORT_DIPNAME( 0x04, 0x00, "DIL106" ) PORT_DIPLOCATION("DIL1:06") + PORT_DIPSETTING( 0x00, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x04, DEF_STR( On ) ) + PORT_DIPNAME( 0x02, 0x00, "DIL107" ) PORT_DIPLOCATION("DIL1:07") + PORT_DIPSETTING( 0x00, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x02, DEF_STR( On ) ) + PORT_DIPNAME( 0x01, 0x00, "DIL108" ) PORT_DIPLOCATION("DIL1:08") + PORT_DIPSETTING( 0x00, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x01, DEF_STR( On ) ) + + PORT_START("DIL2") + PORT_DIPNAME( 0x80, 0x00, "DIL201" ) PORT_DIPLOCATION("DIL2:01") + PORT_DIPSETTING( 0x00, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x80, DEF_STR( On ) ) + PORT_DIPNAME( 0x40, 0x00, "DIL202" ) PORT_DIPLOCATION("DIL2:02") + PORT_DIPSETTING( 0x00, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x40, DEF_STR( On ) ) + PORT_DIPNAME( 0x20, 0x00, "DIL203" ) PORT_DIPLOCATION("DIL2:03") + PORT_DIPSETTING( 0x00, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x20, DEF_STR( On ) ) + PORT_DIPNAME( 0x10, 0x00, "DIL204" ) PORT_DIPLOCATION("DIL2:04") + PORT_DIPSETTING( 0x00, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x10, DEF_STR( On ) ) + PORT_DIPNAME( 0x08, 0x00, "DIL205" ) PORT_DIPLOCATION("DIL2:05") + PORT_DIPSETTING( 0x00, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x08, DEF_STR( On ) ) + PORT_DIPNAME( 0x04, 0x00, "DIL206" ) PORT_DIPLOCATION("DIL2:06") + PORT_DIPSETTING( 0x00, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x04, DEF_STR( On ) ) + PORT_DIPNAME( 0x02, 0x00, "DIL207" ) PORT_DIPLOCATION("DIL2:07") + PORT_DIPSETTING( 0x00, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x02, DEF_STR( On ) ) + PORT_DIPNAME( 0x01, 0x00, "DIL208" ) PORT_DIPLOCATION("DIL2:08") + PORT_DIPSETTING( 0x00, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x01, DEF_STR( On ) ) + + PORT_START("AUX1") + PORT_BIT(0xFF, IP_ACTIVE_HIGH, IPT_SPECIAL)//Handled by Gamball unit + + PORT_START("AUX2") + PORT_BIT(0x01, IP_ACTIVE_HIGH, IPT_SPECIAL) + PORT_BIT(0x02, IP_ACTIVE_HIGH, IPT_SPECIAL) + PORT_BIT(0x04, IP_ACTIVE_HIGH, IPT_SPECIAL) + PORT_BIT(0x08, IP_ACTIVE_HIGH, IPT_SPECIAL) + PORT_BIT(0x10, IP_ACTIVE_HIGH, IPT_COIN1) PORT_NAME("10p")PORT_IMPULSE(5) + PORT_BIT(0x20, IP_ACTIVE_HIGH, IPT_COIN2) PORT_NAME("20p")PORT_IMPULSE(5) + PORT_BIT(0x40, IP_ACTIVE_HIGH, IPT_COIN3) PORT_NAME("50p")PORT_IMPULSE(5) + PORT_BIT(0x80, IP_ACTIVE_HIGH, IPT_COIN4) PORT_NAME("100p")PORT_IMPULSE(5) +INPUT_PORTS_END + +INPUT_PORTS_START( grtecp ) + PORT_START("ORANGE1") + PORT_BIT(0x01, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("00")// 20p level + PORT_BIT(0x02, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("01")// 100p level + PORT_BIT(0x04, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("02")// Token 1 level + PORT_BIT(0x08, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("03")// Token 2 level + PORT_BIT(0x10, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("04") + PORT_CONFNAME( 0xE0, 0x00, "Stake Key" ) + PORT_CONFSETTING( 0x00, "Not fitted / 5p" ) + PORT_CONFSETTING( 0x20, "10p" ) + PORT_CONFSETTING( 0x40, "20p" ) + PORT_CONFSETTING( 0x60, "25p" ) + PORT_CONFSETTING( 0x80, "30p" ) + PORT_CONFSETTING( 0xA0, "40p" ) + PORT_CONFSETTING( 0xC0, "50p" ) + PORT_CONFSETTING( 0xE0, "1 GBP" ) + + PORT_START("ORANGE2") + PORT_CONFNAME( 0x0F, 0x00, "Jackpot / Prize Key" ) + PORT_CONFSETTING( 0x00, "Not fitted" ) + PORT_CONFSETTING( 0x01, "3 GBP" ) + PORT_CONFSETTING( 0x02, "4 GBP" ) + PORT_CONFSETTING( 0x08, "5 GBP" ) + PORT_CONFSETTING( 0x03, "6 GBP" ) + PORT_CONFSETTING( 0x04, "6 GBP Token" ) + PORT_CONFSETTING( 0x05, "8 GBP" ) + PORT_CONFSETTING( 0x06, "8 GBP Token" ) + PORT_CONFSETTING( 0x07, "10 GBP" ) + PORT_CONFSETTING( 0x09, "15 GBP" ) + PORT_CONFSETTING( 0x0A, "25 GBP" ) + PORT_CONFSETTING( 0x0B, "25 GBP (Licensed Betting Office Profile)" ) + PORT_CONFSETTING( 0x0C, "35 GBP" ) + PORT_CONFSETTING( 0x0D, "70 GBP" ) + PORT_CONFSETTING( 0x0E, "Reserved" ) + PORT_CONFSETTING( 0x0F, "Reserved" ) + + PORT_CONFNAME( 0xF0, 0x00, "Percentage Key" ) + PORT_CONFSETTING( 0x00, "As Option Switches" ) + PORT_CONFSETTING( 0x10, "70" ) + PORT_CONFSETTING( 0x20, "72" ) + PORT_CONFSETTING( 0x30, "74" ) + PORT_CONFSETTING( 0x40, "76" ) + PORT_CONFSETTING( 0x50, "78" ) + PORT_CONFSETTING( 0x60, "80" ) + PORT_CONFSETTING( 0x70, "82" ) + PORT_CONFSETTING( 0x80, "84" ) + PORT_CONFSETTING( 0x90, "86" ) + PORT_CONFSETTING( 0xA0, "88" ) + PORT_CONFSETTING( 0xB0, "90" ) + PORT_CONFSETTING( 0xC0, "92" ) + PORT_CONFSETTING( 0xD0, "94" ) + PORT_CONFSETTING( 0xE0, "96" ) + PORT_CONFSETTING( 0xF0, "98" ) + + PORT_START("BLACK1") + PORT_BIT(0x01, IP_ACTIVE_HIGH, IPT_UNUSED) + PORT_BIT(0x02, IP_ACTIVE_HIGH, IPT_UNUSED) + PORT_BIT(0x04, IP_ACTIVE_HIGH, IPT_UNUSED) + PORT_BIT(0x08, IP_ACTIVE_HIGH, IPT_UNUSED) + PORT_BIT(0x10, IP_ACTIVE_HIGH, IPT_UNUSED) + PORT_BIT(0x20, IP_ACTIVE_HIGH, IPT_SERVICE) PORT_NAME("Test Button") PORT_CODE(KEYCODE_W) + PORT_BIT(0x40, IP_ACTIVE_HIGH, IPT_SERVICE) PORT_NAME("Refill Key") PORT_CODE(KEYCODE_R) PORT_TOGGLE + PORT_BIT(0x80, IP_ACTIVE_HIGH, IPT_INTERLOCK) PORT_NAME("Cashbox (Back) Door") PORT_CODE(KEYCODE_Q) PORT_TOGGLE + + PORT_START("BLACK2") + PORT_BIT(0x01, IP_ACTIVE_HIGH, IPT_BUTTON1) PORT_NAME("Collect/Cancel") + PORT_BIT(0x02, IP_ACTIVE_HIGH, IPT_BUTTON2) PORT_NAME("Hold 1") + PORT_BIT(0x04, IP_ACTIVE_HIGH, IPT_BUTTON3) PORT_NAME("Hold 2") + PORT_BIT(0x08, IP_ACTIVE_HIGH, IPT_BUTTON4) PORT_NAME("Hold 3") + PORT_BIT(0x10, IP_ACTIVE_HIGH, IPT_BUTTON5) PORT_NAME("Hi") + PORT_BIT(0x20, IP_ACTIVE_HIGH, IPT_BUTTON6) PORT_NAME("Lo") + PORT_BIT(0x40, IP_ACTIVE_HIGH, IPT_BUTTON7) PORT_NAME("Exchange") + PORT_BIT(0x80, IP_ACTIVE_HIGH, IPT_START1) + + PORT_START("DIL1") + PORT_DIPNAME( 0x01, 0x00, DEF_STR( Unused ) ) PORT_DIPLOCATION("DIL1:01") + PORT_DIPSETTING( 0x00, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x01, DEF_STR( On ) ) + PORT_DIPNAME( 0x02, 0x00, DEF_STR( Unused ) ) PORT_DIPLOCATION("DIL1:02") + PORT_DIPSETTING( 0x00, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x02, DEF_STR( On ) ) + PORT_DIPNAME( 0x04, 0x00, DEF_STR( Unused ) ) PORT_DIPLOCATION("DIL1:03") + PORT_DIPSETTING( 0x00, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x04, DEF_STR( On ) ) + PORT_DIPNAME( 0x08, 0x00, DEF_STR( Unused ) ) PORT_DIPLOCATION("DIL1:04") + PORT_DIPSETTING( 0x00, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x08, DEF_STR( On ) ) + PORT_DIPNAME( 0xF0, 0x00, "Target Percentage (if key not fitted)" )PORT_DIPLOCATION("DIL1:05,06,07,08") + PORT_DIPSETTING( 0x00, "Unset (Program Optimum)" ) + PORT_DIPSETTING( 0x10, "70" ) + PORT_DIPSETTING( 0x20, "72" ) + PORT_DIPSETTING( 0x30, "74" ) + PORT_DIPSETTING( 0x40, "76" ) + PORT_DIPSETTING( 0x50, "78" ) + PORT_DIPSETTING( 0x60, "80" ) + PORT_DIPSETTING( 0x70, "82" ) + PORT_DIPSETTING( 0x80, "84" ) + PORT_DIPSETTING( 0x90, "86" ) + PORT_DIPSETTING( 0xA0, "88" ) + PORT_DIPSETTING( 0xB0, "90" ) + PORT_DIPSETTING( 0xC0, "92" ) + PORT_DIPSETTING( 0xD0, "94" ) + PORT_DIPSETTING( 0xE0, "96" ) + PORT_DIPSETTING( 0xF0, "98" ) + + PORT_START("DIL2") + PORT_DIPNAME( 0x01, 0x00, "Token Lockout when full" ) PORT_DIPLOCATION("DIL2:01") + PORT_DIPSETTING( 0x00, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x01, DEF_STR( On ) ) + PORT_DIPNAME( 0x02, 0x00, DEF_STR( Unused )) PORT_DIPLOCATION("DIL2:02") + PORT_DIPSETTING( 0x00, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x02, DEF_STR( On ) ) + PORT_DIPNAME( 0x04, 0x00, "Scottish Coin Handling" ) PORT_DIPLOCATION("DIL2:03")//20p payout + PORT_DIPSETTING( 0x00, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x04, DEF_STR( On ) ) + PORT_DIPNAME( 0x08, 0x00, "Out of Credit Display Inhibit" ) PORT_DIPLOCATION("DIL2:04") + PORT_DIPSETTING( 0x00, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x08, DEF_STR( On ) ) + PORT_DIPNAME( 0x10, 0x00, "OCD Audio Enable" ) PORT_DIPLOCATION("DIL2:05") + PORT_DIPSETTING( 0x00, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x10, DEF_STR( On ) ) + PORT_DIPNAME( 0x20, 0x00, "Coin Alarm Inhibit" ) PORT_DIPLOCATION("DIL2:06") + PORT_DIPSETTING( 0x00, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x20, DEF_STR( On ) ) + PORT_DIPNAME( 0x40, 0x00, "Token Refill Level Inhibit" ) PORT_DIPLOCATION("DIL2:07") + PORT_DIPSETTING( 0x00, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x40, DEF_STR( On ) ) + PORT_DIPNAME( 0x80, 0x00, "Single Credit Entry" ) PORT_DIPLOCATION("DIL2:08") + PORT_DIPSETTING( 0x00, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x80, DEF_STR( On ) ) + + PORT_START("AUX1") + PORT_BIT(0x01, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("0") + PORT_BIT(0x02, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("1") + PORT_BIT(0x04, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("2") + PORT_BIT(0x08, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("3") + PORT_BIT(0x10, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("4") + PORT_BIT(0x20, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("5") + PORT_BIT(0x40, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("6") + PORT_BIT(0x80, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("7") + + PORT_START("AUX2") + PORT_BIT(0x01, IP_ACTIVE_HIGH, IPT_SPECIAL) + PORT_BIT(0x02, IP_ACTIVE_HIGH, IPT_SPECIAL) + PORT_BIT(0x04, IP_ACTIVE_HIGH, IPT_SPECIAL) + PORT_BIT(0x08, IP_ACTIVE_HIGH, IPT_SPECIAL) + PORT_BIT(0x10, IP_ACTIVE_HIGH, IPT_COIN1) PORT_NAME("10p")PORT_IMPULSE(5) + PORT_BIT(0x20, IP_ACTIVE_HIGH, IPT_COIN2) PORT_NAME("20p")PORT_IMPULSE(5) + PORT_BIT(0x40, IP_ACTIVE_HIGH, IPT_COIN3) PORT_NAME("50p")PORT_IMPULSE(5) + PORT_BIT(0x80, IP_ACTIVE_HIGH, IPT_COIN4) PORT_NAME("100p")PORT_IMPULSE(5) +INPUT_PORTS_END + +static const stepper_interface barcrest_reel_interface = +{ + BARCREST_48STEP_REEL, + 1, + 3, + 0x00, + 2 +}; + +static const stepper_interface barcrest_opto1_interface = +{ + BARCREST_48STEP_REEL, + 4, + 12, + 0x00, + 2 +}; + +static const stepper_interface barcrest_opto2_interface = +{ + BARCREST_48STEP_REEL, + 92, + 3, + 0x00, + 2 +}; + +static const stepper_interface barcrest_opto3_interface = +{ + BARCREST_48STEP_REEL, + 0, + 5, + 0x00, + 2 +}; + +static const stepper_interface bwb_opto1_interface = +{ + BARCREST_48STEP_REEL, + 96, + 3, + 0x00, + 2 +}; + +/* +Characteriser (CHR) + +As built, the CHR is a PAL which can perform basic bit manipulation according to +an as yet unknown unique key. However, the programmers decided to best use this protection device in read/write/compare +cycles, storing almost the entire 'hidden' data table in the ROMs in plain sight. Only later rebuilds by BwB +avoided this 'feature' of the development kit, and will need a different setup. + +This information has been used to generate the CHR tables loaded by the programs, until a key can be determined. + +For most Barcrest games, the following method was used: + +The initial 'PALTEST' routine as found in the Barcrest programs simply writes the first 'call' to the CHR space, +to read back the 'response'. There is no attempt to alter the order or anything else, just +a simple runthrough of the entire data table. The only 'catch' in this is to note that the CHR chip always scans +through the table starting at the last accessed data value, unless 00 is used to reset to the beginning. This is obviously +a simplification, in fact the PAL does bit manipulation with some latching. + +However, a final 8 byte row, that controls the lamp matrix is not tested - to date, no-one outside of Barcrest knows +how this is generated, and currently trial and error is the only sensible method. It is noted that the default, +of all 00, is sometimes the correct answer, particularly in non-Barcrest use of the CHR chip, though when used normally, +there are again fixed call values. +*/ + + +WRITE8_MEMBER(mpu4_state::characteriser_w) +{ + int x; + int call=data; + LOG_CHR_FULL(("%04x Characteriser write offset %02X data %02X", cpu_get_previouspc(&space.device()),offset,data)); + if (!m_current_chr_table) + { + logerror("No Characteriser Table @ %04x\n", cpu_get_previouspc(&space.device())); + return; + } + + + + if (offset == 0) + { + { + if (call == 0) + { + m_prot_col = 0; + } + else + { + for (x = m_prot_col; x < 64; x++) + { + if (m_current_chr_table[(x)].call == call) + { + m_prot_col = x; + LOG_CHR(("Characteriser find column %02X\n",m_prot_col)); + break; + } + } + } + } + } + else if (offset == 2) + { + LOG_CHR(("Characteriser write 2 data %02X\n",data)); + switch (call) + // Rather than the search strategy, we can map the calls directly here. Note that they are hex versions of the square number series + { + case 0x00: + m_lamp_col = 0; + break; + case 0x01: + m_lamp_col = 1; + break; + case 0x04: + m_lamp_col = 2; + break; + case 0x09: + m_lamp_col = 3; + break; + case 0x10: + m_lamp_col = 4; + break; + case 0x19: + m_lamp_col = 5; + break; + case 0x24: + m_lamp_col = 6; + break; + case 0x31: + m_lamp_col = 7; + break; + } + LOG_CHR(("Characteriser find 2 column %02X\n",m_lamp_col)); + } +} + + +READ8_MEMBER(mpu4_state::characteriser_r) +{ + if (!m_current_chr_table) + { + logerror("No Characteriser Table @ %04x", cpu_get_previouspc(&space.device())); + + /* a cheat ... many early games use a standard check */ + int addr = cpu_get_reg(&space.device(), M6809_X); + if ((addr>=0x800) && (addr<=0xfff)) return 0x00; // prevent recursion, only care about ram/rom areas for this cheat. + + UINT8 ret = space.read_byte(addr); + logerror(" (returning %02x)",ret); + + logerror("\n"); + + return ret; + } + + LOG_CHR(("Characteriser read offset %02X \n",offset)); + if (offset == 0) + { + LOG_CHR(("Characteriser read data %02X \n",m_current_chr_table[m_prot_col].response)); + return m_current_chr_table[m_prot_col].response; + } + if (offset == 3) + { + LOG_CHR(("Characteriser read data off 3 %02X \n",m_current_chr_table[m_lamp_col+64].response)); + return m_current_chr_table[m_lamp_col+64].response; + } + return 0; +} + +/* +BwB Characteriser (CHR) + +The BwB method of protection is considerably different to the Barcrest one, with any +incorrect behaviour manifesting in ridiculously large payouts. The hardware is the +same, however the main weakness of the software has been eliminated. + +In fact, the software seems deliberately designed to mislead, but is (fortunately for +us) prone to similar weaknesses that allow a per game solution. + +Project Amber performed a source analysis (available on request) which appears to make things work. +Said weaknesses (A Cheats Guide according to Project Amber) + +The common initialisation sequence is "00 04 04 0C 0C 1C 14 2C 5C 2C" + 0 1 2 3 4 5 6 7 8 +Using debug search for the first read from said string (best to find it first). + +At this point, the X index on the CPU is at the magic number address. + +The subsequent calls for each can be found based on the magic address + + (0) = ( (BWBMagicAddress)) + (1) = ( (BWBMagicAddress + 1)) + (2) = ( (BWBMagicAddress + 2)) + (3) = ( (BWBMagicAddress + 4)) + (4) = ( (BWBMagicAddress - 5)) + (5) = ( (BWBMagicAddress - 4)) + (6) = ( (BWBMagicAddress - 3)) + (7) = ( (BWBMagicAddress - 2)) + (8) = ( (BWBMagicAddress - 1)) + +These return the standard init sequence as above. + +For ease of understanding, we use three tables, one holding the common responses +and two holding the appropriate call and response pairs for the two stages of operation +*/ + + +WRITE8_MEMBER(mpu4_state::bwb_characteriser_w) +{ + int x; + int call=data; + LOG_CHR_FULL(("%04x Characteriser write offset %02X data %02X \n", cpu_get_previouspc(&space.device()),offset,data)); + if (!m_current_chr_table) + fatalerror("No Characteriser Table @ %04x\n", cpu_get_previouspc(&space.device())); + + if ((offset & 0x3f)== 0)//initialisation is always at 0x800 + { + if (!m_chr_state) + { + m_chr_state=1; + m_chr_counter=0; + } + if (call == 0) + { + m_init_col ++; + } + else + { + m_init_col =0; + } + } + + m_chr_value = machine().rand(); + for (x = 0; x < 4; x++) + { + if (m_current_chr_table[(x)].call == call) + { + if (x == 0) // reinit + { + m_bwb_return = 0; + } + m_chr_value = bwb_chr_table_common[(m_bwb_return)]; + m_bwb_return++; + break; + } + } +} + +READ8_MEMBER(mpu4_state::bwb_characteriser_r) +{ + + LOG_CHR(("Characteriser read offset %02X \n",offset)); + + + if (offset ==0) + { + switch (m_chr_counter) + { + case 6: + case 13: + case 20: + case 27: + case 34: + { + return m_bwb_chr_table1[(((m_chr_counter + 1) / 7) - 1)].response; + break; + } + default: + { + if (m_chr_counter > 34) + { + m_chr_counter = 35; + m_chr_state = 2; + } + m_chr_counter ++; + return m_chr_value; + } + } + } + else + { + return m_chr_value; + } +} + +/* Common configurations */ + +WRITE8_MEMBER(mpu4_state::mpu4_ym2413_w) +{ + device_t *ym = machine().device("ym2413"); + if (ym) ym2413_w(ym,offset,data); +} + +READ8_MEMBER(mpu4_state::mpu4_ym2413_r) +{ +// device_t *ym = machine().device("ym2413"); +// return ym2413_read(ym,offset); + return 0xff; +} + + +void mpu4_install_mod4yam_space(address_space *space) +{ + mpu4_state *state = space->machine().driver_data(); + space->install_read_handler(0x0880, 0x0882, read8_delegate(FUNC(mpu4_state::mpu4_ym2413_r),state)); + space->install_write_handler(0x0880, 0x0881, write8_delegate(FUNC(mpu4_state::mpu4_ym2413_w),state)); +} + +void mpu4_install_mod4oki_space(address_space *space) +{ + mpu4_state *state = space->machine().driver_data(); + pia6821_device *pia_ic4ss = space->machine().device("pia_ic4ss"); + ptm6840_device *ptm_ic3ss = space->machine().device("ptm_ic3ss"); + + space->install_readwrite_handler(0x0880, 0x0883, 0, 0, read8_delegate(FUNC(pia6821_device::read), pia_ic4ss), write8_delegate(FUNC(pia6821_device::write), pia_ic4ss)); + space->install_read_handler(0x08c0, 0x08c7, 0, 0, read8_delegate(FUNC(ptm6840_device::read), ptm_ic3ss)); + space->install_write_handler(0x08c0, 0x08c7, 0, 0, write8_delegate(FUNC(mpu4_state::ic3ss_w),state)); +} + +void mpu4_install_mod4bwb_space(address_space *space) +{ + mpu4_state *state = space->machine().driver_data(); + space->install_readwrite_handler(0x0810, 0x0810, 0, 0, read8_delegate(FUNC(mpu4_state::bwb_characteriser_r),state),write8_delegate(FUNC(mpu4_state::bwb_characteriser_w),state)); + mpu4_install_mod4oki_space(space); +} + + +void mpu4_config_common(running_machine &machine) +{ + mpu4_state *state = machine.driver_data(); + state->m_ic24_timer = machine.scheduler().timer_alloc(FUNC(ic24_timeout)); + state->m_lamp_strobe_ext_persistence = 0; + /* setup 8 mechanical meters */ + MechMtr_config(machine,8); + +} + +static void mpu4_config_common_reels(running_machine &machine,int reels) +{ + int n; + /* setup n default 96 half step reels, using the standard optic flag */ + for ( n = 0; n < reels; n++ ) + { + stepper_config(machine, n, &barcrest_reel_interface); + } +} + +MACHINE_START( mod2 ) +{ + mpu4_state *state = machine.driver_data(); + mpu4_config_common(machine); + + state->m_link7a_connected=0; + state->m_mod_number=2; +} + +static MACHINE_START( mpu4yam ) +{ + mpu4_state *state = machine.driver_data(); + address_space *space = machine.device("maincpu")->memory().space(AS_PROGRAM); + mpu4_config_common(machine); + + state->m_link7a_connected=0; + state->m_mod_number=4; + mpu4_install_mod4yam_space(space); +} + +static MACHINE_START( mpu4oki ) +{ + mpu4_state *state = machine.driver_data(); + address_space *space = machine.device("maincpu")->memory().space(AS_PROGRAM); + mpu4_config_common(machine); + + state->m_link7a_connected=0; + state->m_mod_number=4; + mpu4_install_mod4oki_space(space); +} + +static MACHINE_START( mpu4bwb ) +{ + mpu4_state *state = machine.driver_data(); + address_space *space = machine.device("maincpu")->memory().space(AS_PROGRAM); + mpu4_config_common(machine); + + state->m_link7a_connected=0; + state->m_mod_number=4; + mpu4_install_mod4bwb_space(space); +} + +static MACHINE_START( mpu4cry ) +{ + mpu4_state *state = machine.driver_data(); + mpu4_config_common(machine); + + state->m_link7a_connected=0; + state->m_mod_number=4; +} + +/* CHR Tables */ + +static mpu4_chr_table ccelbr_data[72] = { +{0x00, 0x00},{0x1a, 0x84},{0x04, 0x8c},{0x10, 0xb8},{0x18, 0x74},{0x0f, 0x80},{0x13, 0x1c},{0x1b, 0xb4}, +{0x03, 0xd8},{0x07, 0x74},{0x17, 0x00},{0x1d, 0xd4},{0x36, 0xc8},{0x35, 0x78},{0x2b, 0xa4},{0x28, 0x4c}, +{0x39, 0xe0},{0x21, 0xdc},{0x22, 0xf4},{0x25, 0x88},{0x2c, 0x78},{0x29, 0x24},{0x31, 0x84},{0x34, 0xcc}, +{0x0a, 0xb8},{0x1f, 0x74},{0x06, 0x90},{0x0e, 0x48},{0x1c, 0xa0},{0x12, 0x1c},{0x1e, 0x24},{0x0d, 0x94}, +{0x14, 0xc8},{0x0a, 0xb8},{0x19, 0x74},{0x15, 0x00},{0x06, 0x94},{0x0f, 0x48},{0x08, 0x30},{0x1b, 0x90}, +{0x1e, 0x08},{0x04, 0x60},{0x01, 0xd4},{0x0c, 0x58},{0x18, 0xf4},{0x1a, 0x18},{0x11, 0x74},{0x0b, 0x80}, +{0x03, 0xdc},{0x17, 0x74},{0x10, 0xd0},{0x1d, 0x58},{0x0e, 0x24},{0x07, 0x94},{0x12, 0xd8},{0x09, 0x34}, +{0x0d, 0x90},{0x1f, 0x58},{0x16, 0xf4},{0x05, 0x88},{0x13, 0x38},{0x1c, 0x24},{0x02, 0xd4},{0x00, 0x00}, +{0x00, 0x00},{0x01, 0x50},{0x04, 0x00},{0x09, 0x50},{0x10, 0x10},{0x19, 0x40},{0x24, 0x04},{0x31, 0x00} +}; + +static mpu4_chr_table gmball_data[72] = { +{0x00, 0x00},{0x1a, 0x0c},{0x04, 0x50},{0x10, 0x90},{0x18, 0xb0},{0x0f, 0x38},{0x13, 0xd4},{0x1b, 0xa0}, +{0x03, 0xbc},{0x07, 0xd4},{0x17, 0x30},{0x1d, 0x90},{0x36, 0x38},{0x35, 0xc4},{0x2b, 0xac},{0x28, 0x70}, +{0x39, 0x98},{0x21, 0xdc},{0x22, 0xdc},{0x25, 0x54},{0x2c, 0x80},{0x29, 0xb4},{0x31, 0x38},{0x34, 0xcc}, +{0x0a, 0xe8},{0x1f, 0xf8},{0x06, 0xd4},{0x0e, 0x30},{0x1c, 0x00},{0x12, 0x84},{0x1e, 0x2c},{0x0d, 0xc8}, +{0x14, 0xf8},{0x0a, 0x4c},{0x19, 0x58},{0x15, 0xd4},{0x06, 0xa8},{0x0f, 0x78},{0x08, 0x44},{0x1b, 0x0c}, +{0x1e, 0x48},{0x04, 0x50},{0x01, 0x98},{0x0c, 0xd4},{0x18, 0xb0},{0x1a, 0xa0},{0x11, 0xa4},{0x0b, 0x3c}, +{0x03, 0xdc},{0x17, 0xd4},{0x10, 0xb8},{0x1d, 0xd4},{0x0e, 0x30},{0x07, 0x88},{0x12, 0xe0},{0x09, 0x24}, +{0x0d, 0x8c},{0x1f, 0xf8},{0x16, 0xcc},{0x05, 0x70},{0x13, 0x90},{0x1c, 0x20},{0x02, 0x9c},{0x00, 0x00}, +{0x00, 0x00},{0x01, 0x18},{0x04, 0x08},{0x09, 0x10},{0x10, 0x00},{0x19, 0x18},{0x24, 0x08},{0x31, 0x00} +}; + +static mpu4_chr_table grtecp_data[72] = { +{0x00, 0x00},{0x1a, 0x84},{0x04, 0xa4},{0x10, 0xac},{0x18, 0x70},{0x0f, 0x80},{0x13, 0x2c},{0x1b, 0xc0}, +{0x03, 0xbc},{0x07, 0x5c},{0x17, 0x5c},{0x1d, 0x5c},{0x36, 0xdc},{0x35, 0x5c},{0x2b, 0xcc},{0x28, 0x68}, +{0x39, 0xd0},{0x21, 0xb8},{0x22, 0xdc},{0x25, 0x54},{0x2c, 0x08},{0x29, 0x58},{0x31, 0x54},{0x34, 0x90}, +{0x0a, 0xb8},{0x1f, 0x5c},{0x06, 0x5c},{0x0e, 0x44},{0x1c, 0x84},{0x12, 0xac},{0x1e, 0xe0},{0x0d, 0xbc}, +{0x14, 0xcc},{0x0a, 0xe8},{0x19, 0x70},{0x15, 0x00},{0x06, 0x8c},{0x0f, 0x70},{0x08, 0x00},{0x1b, 0x84}, +{0x1e, 0xa4},{0x04, 0xa4},{0x01, 0xbc},{0x0c, 0xdc},{0x18, 0x5c},{0x1a, 0xcc},{0x11, 0xe8},{0x0b, 0xe0}, +{0x03, 0xbc},{0x17, 0x4c},{0x10, 0xc8},{0x1d, 0xf8},{0x0e, 0xd4},{0x07, 0xa8},{0x12, 0x68},{0x09, 0x40}, +{0x0d, 0x0c},{0x1f, 0xd8},{0x16, 0xdc},{0x05, 0x54},{0x13, 0x98},{0x1c, 0x44},{0x02, 0x9c},{0x00, 0x00}, +{0x00, 0x00},{0x01, 0x18},{0x04, 0x00},{0x09, 0x18},{0x10, 0x08},{0x19, 0x10},{0x24, 0x00},{0x31, 0x00} +}; + +static mpu4_chr_table oldtmr_data[72] = { +{0x00, 0x00},{0x1a, 0x90},{0x04, 0xc0},{0x10, 0x54},{0x18, 0xa4},{0x0f, 0xf0},{0x13, 0x64},{0x1b, 0x90}, +{0x03, 0xe4},{0x07, 0xd4},{0x17, 0x60},{0x1d, 0xb4},{0x36, 0xc0},{0x35, 0x70},{0x2b, 0x80},{0x28, 0x74}, +{0x39, 0xa4},{0x21, 0xf4},{0x22, 0xe4},{0x25, 0xd0},{0x2c, 0x64},{0x29, 0x10},{0x31, 0x20},{0x34, 0x90}, +{0x0a, 0xe4},{0x1f, 0xf4},{0x06, 0xc4},{0x0e, 0x70},{0x1c, 0x00},{0x12, 0x14},{0x1e, 0x00},{0x0d, 0x14}, +{0x14, 0xa0},{0x0a, 0xf0},{0x19, 0x64},{0x15, 0x10},{0x06, 0x84},{0x0f, 0x70},{0x08, 0x00},{0x1b, 0x90}, +{0x1e, 0x40},{0x04, 0x90},{0x01, 0xe4},{0x0c, 0xf4},{0x18, 0x64},{0x1a, 0x90},{0x11, 0x64},{0x0b, 0x90}, +{0x03, 0xe4},{0x17, 0x50},{0x10, 0x24},{0x1d, 0xb4},{0x0e, 0xe0},{0x07, 0xd4},{0x12, 0xe4},{0x09, 0x50}, +{0x0d, 0x04},{0x1f, 0xb4},{0x16, 0xc0},{0x05, 0xd0},{0x13, 0x64},{0x1c, 0x90},{0x02, 0xe4},{0x00, 0x00}, +{0x00, 0x00},{0x01, 0x00},{0x04, 0x00},{0x09, 0x00},{0x10, 0x00},{0x19, 0x10},{0x24, 0x00},{0x31, 0x00} +}; + +static const bwb_chr_table blsbys_data1[5] = { +//Magic number 724A + +// PAL Codes +// 0 1 2 3 4 5 6 7 8 +// ?? ?? 20 0F 24 3C 36 27 09 + + {0x67},{0x17},{0x0f},{0x24},{0x3c}, +}; + +static mpu4_chr_table blsbys_data[8] = { +{0xEF, 0x02},{0x81, 0x00},{0xCE, 0x00},{0x00, 0x2e}, +{0x06, 0x20},{0xC6, 0x0f},{0xF8, 0x24},{0x8E, 0x3c}, +}; + +// set percentage and other options. 2e 20 0f +// PAL Codes +// 0 1 2 3 4 5 6 7 8 +// 42 2E 20 0F 24 3C 36 27 09 + // 6 0 7 0 8 0 7 0 0 8 +//request 36 42 27 42 09 42 27 42 42 09 +//verify 00 04 04 0C 0C 1C 14 2C 5C 2C + +DRIVER_INIT (m_oldtmr) +{ + mpu4_state *state = machine.driver_data(); + state->m_reel_mux=SIX_REEL_1TO8; + state->m_reels = 6; + + stepper_config(machine, 0, &barcrest_opto1_interface); + stepper_config(machine, 1, &barcrest_opto1_interface); + stepper_config(machine, 2, &barcrest_opto1_interface); + stepper_config(machine, 3, &barcrest_opto1_interface); + stepper_config(machine, 4, &barcrest_opto1_interface); + stepper_config(machine, 5, &barcrest_opto1_interface); + + state->m_current_chr_table = oldtmr_data; +} + +DRIVER_INIT (m_ccelbr) +{ + mpu4_state *state = machine.driver_data(); + state->m_reel_mux=STANDARD_REEL; + state->m_reels = 4; + // setup 4 default 96 half step reels /////////////////////////////////// + mpu4_config_common_reels(machine,4); + + state->m_current_chr_table = ccelbr_data; +} + +DRIVER_INIT (m_gmball) +{ + mpu4_state *state = machine.driver_data(); + state->m_reel_mux=STANDARD_REEL; + state->m_reels = 4; + // setup 4 default 96 half step reels /////////////////////////////////// + mpu4_config_common_reels(machine,4); + + state->m_current_chr_table = gmball_data; +} + +DRIVER_INIT (m_grtecp) +{ + mpu4_state *state = machine.driver_data(); + state->m_reel_mux=FIVE_REEL_5TO8; + state->m_reels = 5; + state->m_lamp_extender=SMALL_CARD; + // setup 4 default 96 half step reels with the mux board + mpu4_config_common_reels(machine,5); + state->m_current_chr_table = grtecp_data; +} + +DRIVER_INIT (m_blsbys) +{ + mpu4_state *state = machine.driver_data(); + state->m_bwb_bank=1; + state->m_reel_mux=FIVE_REEL_5TO8; + state->m_reels = 5; + stepper_config(machine, 0, &bwb_opto1_interface); + stepper_config(machine, 1, &bwb_opto1_interface); + stepper_config(machine, 2, &bwb_opto1_interface); + stepper_config(machine, 3, &bwb_opto1_interface); + stepper_config(machine, 4, &bwb_opto1_interface); + state->m_bwb_chr_table1 = blsbys_data1; + state->m_current_chr_table = blsbys_data; +} + +DRIVER_INIT (m4tst2) +{ + mpu4_state *state = machine.driver_data(); + state->m_reel_mux=STANDARD_REEL; + state->m_reels = 4; + mpu4_config_common_reels(machine,4); +} + +DRIVER_INIT (m4tst) +{ + mpu4_state *state = machine.driver_data(); + state->m_reel_mux=STANDARD_REEL; + state->m_reels = 4; + mpu4_config_common_reels(machine,4); +} + +DRIVER_INIT (connect4) +{ + mpu4_state *state = machine.driver_data(); + state->m_reels = 0; //reel-free game + state->m_led_lamp=1; +} + + + +DRIVER_INIT (m4default) +{ + mpu4_state *state = machine.driver_data(); + state->m_reel_mux=STANDARD_REEL; + state->m_reels = 4; + mpu4_config_common_reels(machine,4); + state->m_bwb_bank=0; +} + +DRIVER_INIT( m4default_bigbank ) +{ + address_space *space = machine.device("maincpu")->memory().space(AS_PROGRAM); + mpu4_state *state = machine.driver_data(); + DRIVER_INIT_CALL(m4default); + state->m_bwb_bank=1; + space->install_write_handler(0x0858, 0x0858, 0, 0, write8_delegate(FUNC(mpu4_state::bankswitch_w),state)); + space->install_write_handler(0x0878, 0x0878, 0, 0, write8_delegate(FUNC(mpu4_state::bankset_w),state)); +} + + + + + +READ8_MEMBER(mpu4_state::crystal_sound_r) +{ + return machine().rand(); +} +//this may be a YMZ280B +WRITE8_MEMBER(mpu4_state::crystal_sound_w) +{ + printf("crystal_sound_w %02x\n",data); +} + +DRIVER_INIT (m_frkstn) +{ + address_space *space = machine.device("maincpu")->memory().space(AS_PROGRAM); + mpu4_state *state = machine.driver_data(); + DRIVER_INIT_CALL(m4default_bigbank); + space->install_read_handler(0x0880, 0x0880, 0, 0, read8_delegate(FUNC(mpu4_state::crystal_sound_r),state)); + space->install_write_handler(0x0881, 0x0881, 0, 0, write8_delegate(FUNC(mpu4_state::crystal_sound_w),state)); +} + +// thanks to Project Amber for descramble information +void descramble_crystal( UINT8* region, int start, int end, UINT8 extra_xor) +{ + for (int i=start;ibase(), 0x0000, 0x10000, 0x00); +} + +DRIVER_INIT( crystali ) +{ + DRIVER_INIT_CALL(m_frkstn); + descramble_crystal(machine.root_device().memregion( "maincpu" )->base(), 0x0000, 0x10000, 0xff); // invert after decrypt?! +} + +/* generate a 50 Hz signal (based on an RC time) */ +TIMER_DEVICE_CALLBACK( gen_50hz ) +{ + mpu4_state *state = timer.machine().driver_data(); + /* Although reported as a '50Hz' signal, the fact that both rising and + falling edges of the pulse are used means the timer actually gives a 100Hz + oscillating signal.*/ + state->m_signal_50hz = state->m_signal_50hz?0:1; + timer.machine().device("pia_ic4")->ca1_w(state->m_signal_50hz); /* signal is connected to IC4 CA1 */ + + update_meters(state);//run at 100Hz to sync with PIAs +} + +static ADDRESS_MAP_START( mpu4_memmap, AS_PROGRAM, 8, mpu4_state ) + AM_RANGE(0x0000, 0x07ff) AM_RAM AM_SHARE("nvram") + AM_RANGE(0x0800, 0x0810) AM_READWRITE(characteriser_r,characteriser_w) + AM_RANGE(0x0850, 0x0850) AM_READWRITE(bankswitch_r,bankswitch_w) /* write bank (rom page select) */ +/* AM_RANGE(0x08e0, 0x08e7) AM_READWRITE_LEGACY(68681_duart_r,68681_duart_w) */ //Runs hoppers + AM_RANGE(0x0900, 0x0907) AM_DEVREADWRITE("ptm_ic2", ptm6840_device, read, write)/* PTM6840 IC2 */ + AM_RANGE(0x0a00, 0x0a03) AM_DEVREADWRITE("pia_ic3", pia6821_device, read, write) /* PIA6821 IC3 */ + AM_RANGE(0x0b00, 0x0b03) AM_DEVREADWRITE("pia_ic4", pia6821_device, read, write) /* PIA6821 IC4 */ + AM_RANGE(0x0c00, 0x0c03) AM_DEVREADWRITE("pia_ic5", pia6821_device, read, write) /* PIA6821 IC5 */ + AM_RANGE(0x0d00, 0x0d03) AM_DEVREADWRITE("pia_ic6", pia6821_device, read, write) /* PIA6821 IC6 */ + AM_RANGE(0x0e00, 0x0e03) AM_DEVREADWRITE("pia_ic7", pia6821_device, read, write) /* PIA6821 IC7 */ + AM_RANGE(0x0f00, 0x0f03) AM_DEVREADWRITE("pia_ic8", pia6821_device, read, write) /* PIA6821 IC8 */ + AM_RANGE(0x1000, 0xffff) AM_ROMBANK("bank1") /* 64k paged ROM (4 pages) */ +ADDRESS_MAP_END + +const ay8910_interface ay8910_config = +{ + AY8910_SINGLE_OUTPUT, + {820,0,0}, + DEVCB_NULL, + DEVCB_NULL, + DEVCB_NULL, + DEVCB_NULL +}; + +MACHINE_CONFIG_FRAGMENT( mpu4_common ) + MCFG_TIMER_ADD_PERIODIC("50hz",gen_50hz, attotime::from_hz(100)) + + MCFG_MSC1937_ADD("vfd",0,LEFT_TO_RIGHT) + /* 6840 PTM */ + MCFG_PTM6840_ADD("ptm_ic2", ptm_ic2_intf) + + MCFG_PIA6821_ADD("pia_ic3", pia_ic3_intf) + MCFG_PIA6821_ADD("pia_ic4", pia_ic4_intf) + MCFG_PIA6821_ADD("pia_ic5", pia_ic5_intf) + MCFG_PIA6821_ADD("pia_ic6", pia_ic6_intf) + MCFG_PIA6821_ADD("pia_ic7", pia_ic7_intf) + MCFG_PIA6821_ADD("pia_ic8", pia_ic8_intf) +MACHINE_CONFIG_END + +MACHINE_CONFIG_FRAGMENT( mpu4_common2 ) + MCFG_PTM6840_ADD("ptm_ic3ss", ptm_ic3ss_intf) + MCFG_PIA6821_ADD("pia_ic4ss", pia_ic4ss_intf) +MACHINE_CONFIG_END + +/* machine driver for MOD 2 board */ +MACHINE_CONFIG_START( mpu4base, mpu4_state ) + + MCFG_MACHINE_START(mod2 ) + MCFG_MACHINE_RESET(mpu4) + MCFG_CPU_ADD("maincpu", M6809, MPU4_MASTER_CLOCK/4) + MCFG_CPU_PROGRAM_MAP(mpu4_memmap) + + + MCFG_FRAGMENT_ADD(mpu4_common) + + + MCFG_SPEAKER_STANDARD_STEREO("lspeaker", "rspeaker") + + MCFG_NVRAM_ADD_0FILL("nvram") + + MCFG_SCREEN_ADD("screen", RASTER) + MCFG_SCREEN_REFRESH_RATE(60) + MCFG_SCREEN_VBLANK_TIME(ATTOSECONDS_IN_USEC(0)) + MCFG_SCREEN_UPDATE_DRIVER(mpu4_state, screen_update) + MCFG_SCREEN_SIZE(64*8, 32*8) + MCFG_SCREEN_VISIBLE_AREA(8*8, 48*8-1, 2*8, 30*8-1) + MCFG_PALETTE_LENGTH(0x200) + + + MCFG_DEFAULT_LAYOUT(layout_mpu4) +MACHINE_CONFIG_END + + + MACHINE_CONFIG_DERIVED( mod2 , mpu4base ) + MCFG_SOUND_ADD("ay8913",AY8913, MPU4_MASTER_CLOCK/4) + MCFG_SOUND_CONFIG(ay8910_config) + MCFG_SOUND_ROUTE(ALL_OUTPUTS, "lspeaker", 1.0) + MCFG_SOUND_ROUTE(ALL_OUTPUTS, "rspeaker", 1.0) + +MACHINE_CONFIG_END + + + + +MACHINE_CONFIG_DERIVED( mod4yam, mpu4base ) + MCFG_MACHINE_START(mpu4yam) + + MCFG_SOUND_ADD("ym2413", YM2413, MPU4_MASTER_CLOCK/4) + MCFG_SOUND_ROUTE(ALL_OUTPUTS, "lspeaker", 1.0) + MCFG_SOUND_ROUTE(ALL_OUTPUTS, "rspeaker", 1.0) +MACHINE_CONFIG_END + +MACHINE_CONFIG_DERIVED( mod4oki, mpu4base ) + MCFG_MACHINE_START(mpu4oki) + + MCFG_FRAGMENT_ADD(mpu4_common2) + + MCFG_SOUND_ADD("msm6376", OKIM6376, 128000) //16KHz sample Can also be 85430 at 10.5KHz and 64000 at 8KHz + MCFG_SOUND_ROUTE(ALL_OUTPUTS, "lspeaker", 1.0) + MCFG_SOUND_ROUTE(ALL_OUTPUTS, "rspeaker", 1.0) +MACHINE_CONFIG_END + +MACHINE_CONFIG_DERIVED( bwboki, mod4oki ) + MCFG_MACHINE_START(mpu4bwb) +MACHINE_CONFIG_END + +MACHINE_CONFIG_DERIVED(mpu4crys, mod2 ) + MCFG_MACHINE_START(mpu4cry) + + MCFG_SOUND_ADD("upd", UPD7759, UPD7759_STANDARD_CLOCK) + MCFG_SOUND_ROUTE(ALL_OUTPUTS, "lspeaker", 1.0) + MCFG_SOUND_ROUTE(ALL_OUTPUTS, "rspeaker", 1.0) +MACHINE_CONFIG_END + diff --git a/src/mame/mame.lst b/src/mame/mame.lst index d788b57a967..7ab0cb1738a 100644 --- a/src/mame/mame.lst +++ b/src/mame/mame.lst @@ -17792,7 +17792,6 @@ ep_simpe // ep_simpf // ep_simpg // ep_simph // -ep_simpi // ep_simpj // ep_simpk // ep_simpl // @@ -17809,7 +17808,6 @@ ep_wipeo // Wipeout (Maygay) ep_wipeoa // ep_wipeob // ep_wipeoc // -ep_wipeod // ep_wipeoe // ep_bingb // Bingo Belle (Maygay) ep_bingba // @@ -17826,7 +17824,6 @@ ep_cfalle // ep_cfallf // ep_cflow // Cash Flow (Maygay) ep_cflowa // -ep_cflowb // ep_cflowc // ep_cflowd // ep_doubl // Double Top (Maygay) @@ -18019,15 +18016,54 @@ ep_gridrb // ep_gridrc // ep_gridrd // ep_hhclb // Haunted House Club (Maygay) +ep_hhclba // +ep_hhclbb // +ep_hhclbc // ep_hvns // Heavens Above (Maygay) +ep_hvnsa // ep_highv // High Voltage (Maygay - Impulse) +ep_highva // +ep_highvb // +ep_highvc // +ep_highvd // +ep_highve // +ep_highvf // ep_hogmn // Hog Money (Maygay - Impulse) -ep_hmmlt // Homer's Meltdown (Maygay) +ep_hogmna // +ep_hogmnb // +ep_hogmnc // +ep_homer // Homer's Meltdown (Maygay) +ep_homera // +ep_homerb // +ep_homerc // +ep_homerd // +ep_homere // +ep_homerf // +ep_homerg // +ep_homerh // +ep_homeri // ep_htdgs // Hot Dogs (Maygay) +ep_htdgsa // ep_hubbl // Hubble Bubble (Maygay) +ep_hubbla // ep_huric // Hurricane (Maygay - Impulse) +ep_hurica // +ep_huricb // +ep_huricc // +ep_huricd // +ep_hurice // ep_hyst // Hysteria (Maygay - Impulse) +ep_hysta // ep_icebg // Ice Burger (Maygay) +ep_icebga // +ep_icebgb // +ep_icebgc // +ep_icebgd // +ep_icebge // +ep_icebgf // +ep_icebgg // +ep_icebgh // +ep_icebgi // ep_inca // Inca Dinka Do (Maygay - Extreme) ep_itjb2 // Italian Job 2 (Maygay) ep_ijcl // Italian Job Club (Maygay) diff --git a/src/mame/mame.mak b/src/mame/mame.mak index 7f9a07d9999..ac7e42143ec 100644 --- a/src/mame/mame.mak +++ b/src/mame/mame.mak @@ -506,7 +506,7 @@ $(MAMEOBJ)/atlus.a: \ $(MAMEOBJ)/barcrest.a: \ $(DRIVERS)/mpu2.o \ $(DRIVERS)/mpu3.o \ - $(DRIVERS)/mpu4.o \ + $(DRIVERS)/mpu4hw.o $(DRIVERS)/mpu4.o \ $(DRIVERS)/mpu4vid.o \ $(DRIVERS)/mpu5hw.o $(DRIVERS)/mpu5.o \ $(VIDEO)/awpvid.o \ @@ -2068,11 +2068,12 @@ $(DRIVERS)/mcr3.o: $(LAYOUT)/turbotag.lh $(DRIVERS)/mpoker.o: $(LAYOUT)/mpoker.lh -$(DRIVERS)/mpu4.o: $(LAYOUT)/mpu4.lh \ - $(LAYOUT)/connect4.lh \ - $(LAYOUT)/mpu4ext.lh \ +$(DRIVERS)/mpu4.o: $(LAYOUT)/connect4.lh \ $(LAYOUT)/gamball.lh +$(DRIVERS)/mpu4hw.o: $(LAYOUT)/mpu4.lh \ + $(LAYOUT)/mpu4ext.lh + $(DRIVERS)/mpu4vid.o: $(LAYOUT)/crmaze2p.lh \ $(LAYOUT)/crmaze4p.lh