From 895642d1bb34465a052787b8be21f31c95c17bf8 Mon Sep 17 00:00:00 2001 From: hap Date: Wed, 15 Feb 2023 20:47:24 +0100 Subject: source org: move m79amb to ramtek folder --- src/mame/arcade.flt | 2 +- src/mame/mame.lst | 6 +- src/mame/midw8080/m79amb.cpp | 280 --------------------------------- src/mame/midw8080/m79amb.h | 58 ------- src/mame/midw8080/m79amb_a.cpp | 345 ----------------------------------------- src/mame/pacman/pacman.cpp | 10 +- src/mame/ramtek/m79amb.cpp | 280 +++++++++++++++++++++++++++++++++ src/mame/ramtek/m79amb.h | 59 +++++++ src/mame/ramtek/m79amb_a.cpp | 345 +++++++++++++++++++++++++++++++++++++++++ src/mame/sega/segac2.cpp | 2 +- 10 files changed, 694 insertions(+), 693 deletions(-) delete mode 100644 src/mame/midw8080/m79amb.cpp delete mode 100644 src/mame/midw8080/m79amb.h delete mode 100644 src/mame/midw8080/m79amb_a.cpp create mode 100644 src/mame/ramtek/m79amb.cpp create mode 100644 src/mame/ramtek/m79amb.h create mode 100644 src/mame/ramtek/m79amb_a.cpp diff --git a/src/mame/arcade.flt b/src/mame/arcade.flt index 89721c320dd..5953b686663 100644 --- a/src/mame/arcade.flt +++ b/src/mame/arcade.flt @@ -582,7 +582,6 @@ midcoin/24cdjuke.cpp midcoin/wallc.cpp midcoin/wink.cpp midw8080/8080bw.cpp -midw8080/m79amb.cpp midw8080/mw8080bw.cpp midw8080/rotaryf.cpp midway/astrocde.cpp @@ -1183,6 +1182,7 @@ psikyo/psikyo.cpp psikyo/psikyo4.cpp psikyo/psikyosh.cpp ramtek/hitme.cpp +ramtek/m79amb.cpp ramtek/ramtek.cpp ramtek/starcrus.cpp rare/btoads.cpp diff --git a/src/mame/mame.lst b/src/mame/mame.lst index 370cc2a5eab..96f8b1a3ae1 100644 --- a/src/mame/mame.lst +++ b/src/mame/mame.lst @@ -26796,9 +26796,6 @@ vortex // 852 [1980] Zilec Electronics Ltd. yosakdon // (c) 1979 Yosaku To Donbei yosakdona // (c) 1979 Yosaku To Donbei -@source:midw8080/m79amb.cpp -m79amb // (c) 1977 RamTek - @source:midw8080/mw8080bw.cpp 280zzzap // 610 [1976] blueshrk // 742 [1978] @@ -37583,6 +37580,9 @@ hitme1 // (c) 05/1976 Ramtek mirco21 // (c) 08/1976 Mirco super21 // (c) 1978 Mirco +@source:ramtek/m79amb.cpp +m79amb // (c) 1977 RamTek + @source:ramtek/ramtek.cpp bballrmt // (c) 1974 Ramtek cleanswp // (c) 1974 Ramtek diff --git a/src/mame/midw8080/m79amb.cpp b/src/mame/midw8080/m79amb.cpp deleted file mode 100644 index fad5dad407d..00000000000 --- a/src/mame/midw8080/m79amb.cpp +++ /dev/null @@ -1,280 +0,0 @@ -// license:BSD-3-Clause -// copyright-holders:Al Kossow -/* Ramtek M79 Ambush - - -The following chart explains the settings of the eight switches on -the DIP switch. A plus(+) in the column means the toggle switch is -up on the plus side of the DIP switch. - - SWITCHES - | 12 | 345 | 678 | -------------------------------------------------| -Length of Game (seconds) | | | | - 60 | 00 | | | - 90 | 0+ | | | - 90 | +0 | | | - 120 | ++ | | | --------------------------+------+-------+-------| -Points for Extended Time | | | | - 1500 | | 000 | | - 2500 | | +00 | | - 3500 | | 0+0 | | - 5000 | | ++0 | | - NO extended time | | +++ | | --------------------------+------+-------+-------| -Coins Per Game | | | | - Free Play - two players | | | 0++ | - One Coin - two players | | | 0+0 | - One Coin - each player | | | 000 | - Two Coins - each player | | | +00 | -------------------------------------------------- - - -Based on extensive tests on location, the factory settings for the -most universal combinations are: - 60 second long game - 2500 points for extended play 12345678 - One coin each player 00+00000 - -Ports: - In: - 8000 DIP SW - 8002 D0=VBlank - 8004 Game Switch Inputs - 8005 Game Switch Inputs - - Out: - 8000 - 8001 Mask Sel (Manual calls it "Select All RAM") - 8002 Sound Control (According to Manual) - 8003 D0=SelfTest LED - - -The cabinet has backdrop artwork, a lightbulb for explosions, -and two large (paddles pretending to be) guns. - -*/ - -#include "emu.h" -#include "m79amb.h" - -#include "screen.h" -#include "speaker.h" - -void m79amb_state::machine_start() -{ - m_self_test.resolve(); -} - -void m79amb_state::ramtek_videoram_w(offs_t offset, uint8_t data) -{ - m_videoram[offset] = data & ~*m_mask; -} - -uint32_t m79amb_state::screen_update_ramtek(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect) -{ - for (offs_t offs = 0; offs < 0x2000; offs++) - { - uint8_t data = m_videoram[offs]; - int y = offs >> 5; - int x = (offs & 0x1f) << 3; - - for (int i = 0; i < 8; i++) - { - pen_t pen = (data & 0x80) ? rgb_t::white() : rgb_t::black(); - bitmap.pix(y, x) = pen; - - x++; - data <<= 1; - } - } - - return 0; -} - - -uint8_t m79amb_state::gray5bit_controller0_r() -{ - uint8_t port_data = ioport("8004")->read(); - uint8_t gun_pos = ioport("GUN1")->read(); - - return (port_data & 0xe0) | m_lut_gun1[gun_pos]; -} - -uint8_t m79amb_state::gray5bit_controller1_r() -{ - uint8_t port_data = ioport("8005")->read(); - uint8_t gun_pos = ioport("GUN2")->read(); - - return (port_data & 0xe0) | m_lut_gun2[gun_pos]; -} - -void m79amb_state::m79amb_8002_w(uint8_t data) -{ - /* D1 may also be watchdog reset */ - /* port goes to 0x7f to turn on explosion lamp */ - output().set_value("EXP_LAMP", data ? 1 : 0); -} - -void m79amb_state::main_map(address_map &map) -{ - map(0x0000, 0x1fff).rom(); - map(0x4000, 0x5fff).ram().w(FUNC(m79amb_state::ramtek_videoram_w)).share("videoram"); - map(0x6000, 0x63ff).ram(); /* ?? */ - map(0x8000, 0x8000).portr("8000").w(FUNC(m79amb_state::m79amb_8000_w)); - map(0x8001, 0x8001).writeonly().share("mask"); - map(0x8002, 0x8002).portr("8002").w(FUNC(m79amb_state::m79amb_8002_w)); - map(0x8003, 0x8003).w(FUNC(m79amb_state::m79amb_8003_w)); - map(0x8004, 0x8004).r(FUNC(m79amb_state::gray5bit_controller0_r)); - map(0x8005, 0x8005).r(FUNC(m79amb_state::gray5bit_controller1_r)); - map(0xc000, 0xc07f).ram(); /* ?? */ - map(0xc200, 0xc27f).ram(); /* ?? */ -} - - - -static INPUT_PORTS_START( m79amb ) - PORT_START("8000") - PORT_DIPNAME( 0x03, 0x00, DEF_STR( Game_Time )) PORT_DIPLOCATION("G6:!1,!2") - PORT_DIPSETTING( 0x00, "60 Seconds" ) - PORT_DIPSETTING( 0x01, "90 Seconds" ) - PORT_DIPSETTING( 0x02, "90 Seconds" ) - PORT_DIPSETTING( 0x03, "120 Seconds" ) - PORT_DIPNAME( 0x1c, 0x04, "Points for Extended Time" ) PORT_DIPLOCATION("G6:!3,!4,!5") - PORT_DIPSETTING( 0x00, "1500" ) - PORT_DIPSETTING( 0x04, "2500" ) - PORT_DIPSETTING( 0x08, "3500" ) - PORT_DIPSETTING( 0x0c, "5000" ) - PORT_DIPSETTING( 0x1c, "No Extended Time" ) - PORT_DIPNAME( 0xe0, 0x00, DEF_STR( Coinage )) PORT_DIPLOCATION("G6:!6,!7,!8") - PORT_DIPSETTING( 0x20, DEF_STR( 2C_1C )) - PORT_DIPSETTING( 0x00, DEF_STR( 1C_1C )) - PORT_DIPSETTING( 0x40, "1 Coin/2 Players") - PORT_DIPSETTING( 0xc0, DEF_STR( Free_Play )) - - PORT_START("8002") - PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_CUSTOM ) PORT_VBLANK("screen") - PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_START1 ) - PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_COIN1 ) - PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_TILT ) - PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_UNUSED ) - PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_UNUSED ) - PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNUSED ) - PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNUSED ) - - PORT_START("8004") - PORT_BIT( 0x1f, IP_ACTIVE_LOW, IPT_UNUSED ) // gun 1 here - PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_BUTTON1 ) - PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNKNOWN ) - PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNKNOWN ) - - PORT_START("8005") - PORT_BIT( 0x1f, IP_ACTIVE_LOW, IPT_UNUSED ) // gun 2 here - PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(2) - PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNKNOWN ) - PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNKNOWN ) - - // fake ports for the guns - PORT_START("GUN1") - PORT_BIT( 0xff, 0x80, IPT_PADDLE ) PORT_CROSSHAIR(X, (1.0-(19.0/256.0)), 19.0/256.0, 30.0/224.0) PORT_MINMAX(19,255) PORT_SENSITIVITY(50) PORT_KEYDELTA(5) PORT_CENTERDELTA(0) PORT_PLAYER(1) - - PORT_START("GUN2") - PORT_BIT( 0xff, 0x80, IPT_PADDLE ) PORT_CROSSHAIR(X, (1.0-(22.0/256.0)), 0.0, 30.0/224.0) PORT_MINMAX(0,234) PORT_SENSITIVITY(50) PORT_KEYDELTA(5) PORT_CENTERDELTA(0) PORT_PLAYER(2) -INPUT_PORTS_END - - -uint8_t m79amb_state::inta_r() -{ - m_maincpu->set_input_line(0, CLEAR_LINE); - - // Vector is RST 1 - return 0xcf; -} - -void m79amb_state::m79amb(machine_config &config) -{ - /* basic machine hardware */ - I8080(config, m_maincpu, 19.6608_MHz_XTAL / 10); - m_maincpu->set_addrmap(AS_PROGRAM, &m79amb_state::main_map); - m_maincpu->in_inta_func().set(FUNC(m79amb_state::inta_r)); - - /* video hardware */ - screen_device &screen(SCREEN(config, "screen", SCREEN_TYPE_RASTER)); - screen.set_raw(19.6608_MHz_XTAL / 4, 320, 0, 256, 262, 32, 256); - screen.set_screen_update(FUNC(m79amb_state::screen_update_ramtek)); - screen.screen_vblank().set_inputline(m_maincpu, 0, ASSERT_LINE); - - /* sound hardware */ - SPEAKER(config, "mono").front_center(); - - DISCRETE(config, m_discrete, m79amb_discrete).add_route(ALL_OUTPUTS, "mono", 1.0); -} - - - -ROM_START( m79amb ) - ROM_REGION( 0x2000, "maincpu", ROMREGION_INVERT ) - ROM_LOAD( "m79.10t", 0x0000, 0x0200, CRC(ccf30b1e) SHA1(c1a77f8dc81c491928f81121ca5c9b7f8753794f) ) - ROM_LOAD( "m79.9t", 0x0200, 0x0200, CRC(daf807dd) SHA1(16cd9d553bfb111c8380966cbde39dbddd5fe58c) ) - ROM_LOAD( "m79.8t", 0x0400, 0x0200, CRC(79fafa02) SHA1(440620f5be44febdd7c64014739dc71fb570cc92) ) - ROM_LOAD( "m79.7t", 0x0600, 0x0200, CRC(06f511f8) SHA1(a8dcaec0723b8ac9ad9474e3e931a23d7aa4ec23) ) - ROM_LOAD( "m79.6t", 0x0800, 0x0200, CRC(24634390) SHA1(bc5f2ae5a49904dde1bd5e6b134571bf1d912735) ) - ROM_LOAD( "m79.5t", 0x0a00, 0x0200, CRC(95252aa6) SHA1(e7ea598f864510557b511682a5d2223a512ff029) ) - ROM_LOAD( "m79.4t", 0x0c00, 0x0200, CRC(54cffb0f) SHA1(4a4ad921ef6324c927a2e4a9da624d8096b6d87b) ) - ROM_LOAD( "m79.3ta", 0x0e00, 0x0200, CRC(27db5ede) SHA1(890587181497ed6e1d45ed501790a6d4d3315f00) ) - ROM_LOAD( "m79.10u", 0x1000, 0x0200, CRC(e41d13d2) SHA1(cc2911f46a0465305e4c7bc08f55acd065f93534) ) - ROM_LOAD( "m79.9u", 0x1200, 0x0200, CRC(e35f5616) SHA1(394ad92ad7dd233ece17335cf20aef8861b41508) ) - ROM_LOAD( "m79.8u", 0x1400, 0x0200, CRC(14eafd7c) SHA1(ca2d17f6ae1c3ff461a1b2bc6f37622e70cdaae8) ) - ROM_LOAD( "m79.7u", 0x1600, 0x0200, CRC(b9864f25) SHA1(9330cf96b7bce13e0ee3ad746b00e82ef10c3989) ) - ROM_LOAD( "m79.6u", 0x1800, 0x0200, CRC(dd25197f) SHA1(13eaf40251de82e817f488a9de738aadd8f6715e) ) - ROM_LOAD( "m79.5u", 0x1a00, 0x0200, CRC(251545e2) SHA1(05a0d5e8f143ea376fb3c517cf5e9d0d3534b933) ) - ROM_LOAD( "m79.4u", 0x1c00, 0x0200, CRC(b5f55c75) SHA1(f478cde73ae961be7b58c769f035eef58fd45555) ) - ROM_LOAD( "m79.3u", 0x1e00, 0x0200, CRC(e968691a) SHA1(7024d10f2af195fc4050861706b1f3d22cb22a9c) ) -ROM_END - - - -/* grenade trajectory per gun position is inconsistent and sloppy in the game: - 0, 1, 3, 2, 6, 7, 5, 4 - gun position - 90.00, 90.00, 90.00, 90.00, 86.42, 86.42, 86.42, 86.42 - grenade trajectory (angle, est) - 18.0, 18.0, 18.0, 18.0, 27.2, 27.2, 27.2, 31.2 - crosses with y=28 (x, est) - - 12, 13, 15, 14, 10, 11, 9, 8, - 84.39, 84.39, 84.39, 80.87, 79.00, 80.87, 79.00, 79.00 - 41.9, 48.9, 56.8, 75.8, 87.2, 88.8, 101.6, 107.6 - - 24, 25, 27, 26, 30, 31, 29, 28, - 79.00, 79.00, 75.59, 75.59, 75.59, 73.72, 73.72, 73.72 - 114.1, 121.5, 138.8, 146.0, 152.7, 162.6, 167.6, 172.7 - - 20, 21, 23, 22, 18, 19, 17, 16 - 73.72, 70.08, 70.08, 70.08, 67.97, 67.97, 64.34, 64.34 - 181.6, 199.9, 205.4, 211.9, 223.5, 232.4, 254.0, 254.0 -*/ - -void m79amb_state::init_m79amb() -{ - static constexpr uint8_t lut_cross[0x20] = { - 19, 20, 21, 23, 25, 27, 29, 37, - 45, 53, 66, 82, 88, 95, 105, 111, - 118, 130, 142, 149, 158, 165, 170, 177, - 191, 203, 209, 218, 228, 243, 249, 255, - }; - - // gun positions - for (int i = 0, j = 0, k = 0xff; i < 0x20; i++) - { - const uint8_t gray = i ^ (i >> 1) ^ 0x1f; // 5-bit Gray code, inverted - - // gun 1, start at left 18 - while (j < 0x100 && j <= lut_cross[i]) - m_lut_gun1[j++] = gray; - - // gun 2, start at right 235 - while (k >= 0 && k >= 253 - lut_cross[i]) - m_lut_gun2[k--] = gray; - } -} - -GAME( 1977, m79amb, 0, m79amb, m79amb, m79amb_state, init_m79amb, ROT0, "Ramtek", "M-79 Ambush", MACHINE_IMPERFECT_SOUND | MACHINE_SUPPORTS_SAVE ) diff --git a/src/mame/midw8080/m79amb.h b/src/mame/midw8080/m79amb.h deleted file mode 100644 index 9bd67730225..00000000000 --- a/src/mame/midw8080/m79amb.h +++ /dev/null @@ -1,58 +0,0 @@ -// license:BSD-3-Clause -// copyright-holders:Al Kossow -#ifndef MAME_MIDW8080_M79AMB_H -#define MAME_MIDW8080_M79AMB_H - -#pragma once - -#include "cpu/i8085/i8085.h" -#include "sound/discrete.h" - -class m79amb_state : public driver_device -{ -public: - m79amb_state(const machine_config &mconfig, device_type type, const char *tag) - : driver_device(mconfig, type, tag), - m_videoram(*this, "videoram"), - m_mask(*this, "mask"), - m_discrete(*this, "discrete"), - m_maincpu(*this, "maincpu"), - m_self_test(*this, "SELF_TEST") - { } - - void m79amb(machine_config &config); - - void init_m79amb(); - -private: - void ramtek_videoram_w(offs_t offset, uint8_t data); - uint8_t gray5bit_controller0_r(); - uint8_t gray5bit_controller1_r(); - void m79amb_8000_w(uint8_t data); - void m79amb_8002_w(uint8_t data); - void m79amb_8003_w(uint8_t data); - uint8_t inta_r(); - - void machine_start() override; - - uint32_t screen_update_ramtek(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect); - void main_map(address_map &map); - - /* memory pointers */ - required_shared_ptr m_videoram; - required_shared_ptr m_mask; - required_device m_discrete; - required_device m_maincpu; - - output_finder<> m_self_test; - - /* misc */ - uint8_t m_lut_gun1[0x100]{}; - uint8_t m_lut_gun2[0x100]{}; -}; - -/*----------- defined in audio/m79amb.c -----------*/ - -DISCRETE_SOUND_EXTERN( m79amb_discrete ); - -#endif // MAME_MIDW8080_M79AMB_H diff --git a/src/mame/midw8080/m79amb_a.cpp b/src/mame/midw8080/m79amb_a.cpp deleted file mode 100644 index ff9f169f6c5..00000000000 --- a/src/mame/midw8080/m79amb_a.cpp +++ /dev/null @@ -1,345 +0,0 @@ -// license:BSD-3-Clause -// copyright-holders:Derrick Renaud -/************************************************************************ - * m79amb Sound System Analog emulation - * Nov 2008, Derrick Renaud - ************************************************************************/ - -#include "emu.h" -#include "m79amb.h" -#include "sound/discrete.h" - -#define TIME_OF_9602(r, c) (0.34 * (r) * (c) * (1.0 + 1.0 / (r))) -#define TIME_OF_9602_WITH_DIODE(r, c) (0.3 * (r) * (c)) - - -/* Discrete Sound Input Nodes */ -#define M79AMB_BOOM_EN NODE_01 -#define M79AMB_THUD_EN NODE_02 -#define M79AMB_SHOT_EN NODE_03 -#define M79AMB_MC_REV_EN NODE_04 -#define M79AMB_MC_CONTROL_EN NODE_05 -#define M79AMB_TANK_TRUCK_JEEP_EN NODE_06 -#define M79AMB_WHISTLE_A_EN NODE_07 -#define M79AMB_WHISTLE_B_EN NODE_08 - -/* Discrete Sound Output Nodes */ -#define M79AMB_BOOM_SND NODE_11 -#define M79AMB_THUD_SND NODE_12 -#define M79AMB_SHOT_SND NODE_13 -#define M79AMB_MC_SND NODE_14 -#define M79AMB_TANK_TRUCK_JEEP_SND NODE_15 -#define M79AMB_WHISTLE_A_SND NODE_16 -#define M79AMB_WHISTLE_B_SND NODE_17 - -/* Parts List - Resistors */ -#define M79AMB_R2 RES_K(5.6) -#define M79AMB_R6 220 -#define M79AMB_R9 RES_K(4.7) -#define M79AMB_R10 RES_K(2.2) -#define M79AMB_R12 RES_K(5.6) -#define M79AMB_R16 330 -#define M79AMB_R19 RES_K(4.7) -#define M79AMB_R20 RES_K(2.2) -#define M79AMB_R22 RES_K(3.3) -#define M79AMB_R26 100 -#define M79AMB_R29 RES_K(4.7) -#define M79AMB_R30 RES_K(1.5) -#define M79AMB_R35 RES_K(470) -#define M79AMB_R36 RES_K(39) -#define M79AMB_R37 RES_K(82) -#define M79AMB_R38 100 -#define M79AMB_R39 RES_K(10) -#define M79AMB_R41 RES_K(2.2) -#define M79AMB_R42 RES_K(10) -#define M79AMB_R43 220 -#define M79AMB_R44 RES_K(39) -#define M79AMB_R45 RES_K(82) -#define M79AMB_R46 RES_K(10) -#define M79AMB_R48 RES_K(2.2) -#define M79AMB_R49 RES_K(1) -#define M79AMB_R51 RES_K(39) -#define M79AMB_R52 RES_K(82) -#define M79AMB_R53 100 -#define M79AMB_R54 RES_K(10) -#define M79AMB_R57 RES_K(2.2) -#define M79AMB_R58 RES_K(2.2) -#define M79AMB_R59 RES_K(1) -#define M79AMB_R61 RES_K(39) -#define M79AMB_R62 RES_K(82) -#define M79AMB_R63 100 -#define M79AMB_R64 RES_K(10) -#define M79AMB_R67 RES_K(2.2) -#define M79AMB_R68 RES_K(2.2) -#define M79AMB_R69 RES_K(1) -#define M79AMB_R76 RES_K(2.7) -#define M79AMB_R77 RES_K(47) -#define M79AMB_R78 RES_K(47) -#define M79AMB_R79 RES_K(15) -#define M79AMB_R80 RES_K(22) -#define M79AMB_R81 RES_K(100) -#define M79AMB_R82 RES_K(100) -#define M79AMB_R83 RES_K(3.3) -#define M79AMB_R84 RES_K(50) -#define M79AMB_R86 470 - -/* Parts List - Capacitors */ -#define M79AMB_C2 CAP_U(39) -#define M79AMB_C3 CAP_U(22) -#define M79AMB_C6 CAP_U(0.1) -#define M79AMB_C8 CAP_U(39) -#define M79AMB_C9 CAP_U(22) -#define M79AMB_C12 CAP_U(0.1) -#define M79AMB_C14 CAP_U(4.7) -#define M79AMB_C15 CAP_U(3.3) -#define M79AMB_C18 CAP_U(0.1) -#define M79AMB_C20 CAP_U(2.2) -#define M79AMB_C21 CAP_U(1) -#define M79AMB_C22 CAP_U(22) -#define M79AMB_C23 CAP_U(0.01) -#define M79AMB_C25 CAP_U(2.2) -#define M79AMB_C26 CAP_U(22) -#define M79AMB_C27 CAP_U(0.47) -#define M79AMB_C28 CAP_U(0.1) -#define M79AMB_C29 CAP_U(22) -#define M79AMB_C30 CAP_U(0.03) -#define M79AMB_C31 CAP_U(0.1) -#define M79AMB_C32 CAP_U(0.1) -#define M79AMB_C33 CAP_U(22) -#define M79AMB_C34 CAP_U(0.03) -#define M79AMB_C35 CAP_U(0.1) -#define M79AMB_C36 CAP_U(0.1) -#define M79AMB_C37 CAP_P(500) -#define M79AMB_C41 CAP_U(0.1) -#define M79AMB_C42 CAP_U(15) - - -static const discrete_mixer_desc m79amb_final_mix = -{ - DISC_MIXER_IS_OP_AMP, - { - M79AMB_R76 + M79AMB_R9, - M79AMB_R77 + M79AMB_R19, - M79AMB_R78 + M79AMB_R29, - M79AMB_R79 + RES_2_PARALLEL(M79AMB_R41, M79AMB_R42 + M79AMB_R43), - M79AMB_R80 + RES_2_PARALLEL(M79AMB_R48, M79AMB_R49), - M79AMB_R81 + RES_2_PARALLEL(M79AMB_R59, M79AMB_R57 + M79AMB_R58), - M79AMB_R82 + RES_2_PARALLEL(M79AMB_R69, M79AMB_R67 + M79AMB_R68) - }, - {0}, /* no r_nodes */ - {M79AMB_C6, M79AMB_C12, M79AMB_C18, M79AMB_C23, M79AMB_C28, M79AMB_C32, M79AMB_C36}, - 0, - M79AMB_R83 + M79AMB_R84, - M79AMB_C37, - M79AMB_C42, - 0, - 1 /* gain */ -}; - -DISCRETE_SOUND_START( m79amb_discrete ) - /************************************************ - * Input register mapping - ************************************************/ - DISCRETE_INPUT_PULSE(M79AMB_BOOM_EN, 0) - DISCRETE_INPUT_PULSE(M79AMB_THUD_EN, 0) - DISCRETE_INPUT_PULSE(M79AMB_SHOT_EN, 0) - DISCRETE_INPUT_LOGIC(M79AMB_MC_REV_EN) - DISCRETE_INPUT_LOGIC(M79AMB_MC_CONTROL_EN) - DISCRETE_INPUT_LOGIC(M79AMB_TANK_TRUCK_JEEP_EN) - DISCRETE_INPUT_LOGIC(M79AMB_WHISTLE_A_EN) - DISCRETE_INPUT_LOGIC(M79AMB_WHISTLE_B_EN) - - /* Boom, Thud, Shot sounds need more accurate emulation */ - - /************************************************ - * Boom - ************************************************/ - DISCRETE_ONESHOT(NODE_20, - M79AMB_BOOM_EN, /* TRIG */ - 1, /* AMPL */ - TIME_OF_9602_WITH_DIODE(M79AMB_R2, M79AMB_C2), - DISC_ONESHOT_REDGE | DISC_ONESHOT_RETRIG | DISC_OUT_ACTIVE_HIGH) - DISCRETE_RCDISC2(NODE_21, - NODE_20, /* Q1 base */ - 0, /* Q1 off, C3 discharges */ - M79AMB_R9 + M79AMB_R10, /* discharges through amp/filter circuit */ - 12, /* Q1 on, C3 charges */ - M79AMB_R6, /* Q2 on */ - M79AMB_C3) /* controls amplitude */ - DISCRETE_NOISE(M79AMB_BOOM_SND, - 1, /* ENAB */ - 800, /* FREQ - Guess*/ - NODE_21, /* AMP */ - 0) /* BIAS - fake AC is fine*/ - - /************************************************ - * Thud - ************************************************/ - DISCRETE_ONESHOT(NODE_30, - M79AMB_THUD_EN, /* TRIG */ - 1, /* AMPL */ - TIME_OF_9602_WITH_DIODE(M79AMB_R12, M79AMB_C8), - DISC_ONESHOT_REDGE | DISC_ONESHOT_RETRIG | DISC_OUT_ACTIVE_HIGH) - DISCRETE_RCDISC2(NODE_31, - NODE_30, /* Q4 base */ - 0, /* Q4 off, C9 discharges */ - M79AMB_R19 + M79AMB_R20, /* discharges through amp/filter circuit */ - 12, /* Q4 on, C9 charges */ - M79AMB_R16, /* Q5 on */ - M79AMB_C9) /* controls amplitude */ - DISCRETE_NOISE(M79AMB_THUD_SND, - 1, /* ENAB */ - 500, /* FREQ - Guess*/ - NODE_31, /* AMP */ - 0) /* BIAS - fake AC is fine*/ - - /************************************************ - * Shot - ************************************************/ - DISCRETE_ONESHOT(NODE_40, - M79AMB_SHOT_EN, /* TRIG */ - 1, /* AMPL */ - TIME_OF_9602_WITH_DIODE(M79AMB_R22, M79AMB_C14), - DISC_ONESHOT_REDGE | DISC_ONESHOT_RETRIG | DISC_OUT_ACTIVE_HIGH) - DISCRETE_RCDISC2(NODE_41, - NODE_40, /* Q7 base */ - 0, /* Q7 off, C15 discharges */ - M79AMB_R29 + M79AMB_R30, /* discharges through amp/filter circuit */ - 12, /* Q7 on, C15 charges */ - M79AMB_R26, /* Q8 on */ - M79AMB_C15) /* controls amplitude */ - DISCRETE_NOISE(M79AMB_SHOT_SND, - 1, /* ENAB */ - 1000, /* FREQ - Guess*/ - NODE_41, /* AMP */ - 0) /* BIAS - fake AC is fine*/ - - /************************************************ - * MC - ************************************************/ - /* not the best implementation of the pin 5 charge circuit, but it is within tolerance */ - DISCRETE_RCDISC2(NODE_50, - M79AMB_MC_REV_EN, - /* R35 can be ignored on discharge */ - RES_VOLTAGE_DIVIDER(M79AMB_R36 + M79AMB_R37, M79AMB_R38) * 12, /* Q12 on */ - RES_2_PARALLEL(M79AMB_R36 + M79AMB_R37, M79AMB_R38), /* Q12 on */ - 12.0 * RES_VOLTAGE_DIVIDER(M79AMB_R36, M79AMB_R35), /* Q12 off */ - RES_2_PARALLEL(M79AMB_R36, M79AMB_R35) + M79AMB_R37, /* Q12 off */ - M79AMB_C20) - /* cap charge to B+ ratio changes voltage on pin 5 */ - /* (iR36 + iR35 + iR37) * R36||R35||R37 where iR35 = 0/R35 = 0 */ - DISCRETE_TRANSFORM4(NODE_51, 12.0 / M79AMB_R36, NODE_50, M79AMB_R37, RES_3_PARALLEL(M79AMB_R36, M79AMB_R35, M79AMB_R37), "012/+3*") - DISCRETE_566(NODE_52, /* IC U3, pin 4 */ - NODE_51, /* IC U3, pin 5 */ - M79AMB_R39, M79AMB_C21, - 12, 0, 12, /* VPOS,VNEG,VCHARGE */ - DISC_566_OUT_DC | DISC_566_OUT_TRIANGLE) - DISCRETE_CRFILTER(NODE_53, - NODE_52, M79AMB_R41 + M79AMB_R42 + M79AMB_R43, M79AMB_C22) - DISCRETE_MULTIPLY(NODE_54, NODE_53, M79AMB_MC_CONTROL_EN) - DISCRETE_GAIN(M79AMB_MC_SND, NODE_54, RES_VOLTAGE_DIVIDER(M79AMB_R41 + M79AMB_R42, 2200))//M79AMB_R43)) - - /************************************************ - * Tank, Truck, Jeep - ************************************************/ - DISCRETE_566(NODE_60, /* IC U4, pin 4 */ - 12.0 * RES_VOLTAGE_DIVIDER(M79AMB_R44, M79AMB_R45), /* IC U5, pin 5 */ - M79AMB_R46, M79AMB_C25, - 12, 0, 12, /* VPOS,VNEG,VCHARGE */ - DISC_566_OUT_DC | DISC_566_OUT_TRIANGLE) - DISCRETE_ONOFF(NODE_61, - M79AMB_TANK_TRUCK_JEEP_EN, /* Q16, Q17 */ - NODE_60) - DISCRETE_CRFILTER(NODE_62, - NODE_61, M79AMB_R48 + M79AMB_R49, M79AMB_C26) - DISCRETE_GAIN(NODE_63, NODE_62, RES_VOLTAGE_DIVIDER(M79AMB_R48, M79AMB_R49)) - DISCRETE_RCFILTER(M79AMB_TANK_TRUCK_JEEP_SND, - NODE_63, RES_2_PARALLEL(M79AMB_R48, M79AMB_R49), M79AMB_C27) - - /************************************************ - * Whisle A - ************************************************/ - DISCRETE_RCDISC2(NODE_70, - M79AMB_WHISTLE_A_EN, - RES_VOLTAGE_DIVIDER(M79AMB_R51 + M79AMB_R52, M79AMB_R53) * 12, /* Q15 on */ - RES_2_PARALLEL(M79AMB_R53, M79AMB_R51 + M79AMB_R52), /* Q15 on */ - 12, M79AMB_R51 + M79AMB_R52, /* Q15 off */ - M79AMB_C29) - /* cap charge to B+ ratio changes voltage on pin 5 */ - DISCRETE_TRANSFORM3(NODE_71, 12, NODE_70, RES_VOLTAGE_DIVIDER(M79AMB_R51, M79AMB_R52), "01-2*1+") - DISCRETE_566(NODE_72, /* IC U5, pin 4 */ - NODE_71, /* IC U5, pin 5 */ - M79AMB_R54, M79AMB_C30, - 12, 0, 12, /* VPOS,VNEG,VCHARGE */ - DISC_566_OUT_DC | DISC_566_OUT_TRIANGLE) - DISCRETE_CRFILTER(NODE_73, - NODE_72, M79AMB_R57 + M79AMB_R58 + M79AMB_R59, M79AMB_C31) - DISCRETE_MULTIPLY(NODE_74, NODE_73, M79AMB_WHISTLE_A_EN) /* Q16, Q17 */ - DISCRETE_GAIN(M79AMB_WHISTLE_A_SND, NODE_74, RES_VOLTAGE_DIVIDER(M79AMB_R57 + M79AMB_R58, M79AMB_R59)) - - /************************************************ - * Whisle B - ************************************************/ - DISCRETE_RCDISC2(NODE_80, - M79AMB_WHISTLE_B_EN, - RES_VOLTAGE_DIVIDER(M79AMB_R61 + M79AMB_R62, M79AMB_R63) * 12, /* Q18 on */ - RES_2_PARALLEL(M79AMB_R63, M79AMB_R61 + M79AMB_R62), /* Q18 on */ - 12, M79AMB_R61 + M79AMB_R62, /* Q18 off */ - M79AMB_C33) - /* cap charge to B+ ratio changes voltage on pin 5 */ - DISCRETE_TRANSFORM3(NODE_81, 12, NODE_80, RES_VOLTAGE_DIVIDER(M79AMB_R61, M79AMB_R62), "01-2*1+") - DISCRETE_566(NODE_82, /* IC U5, pin 4 */ - NODE_81, /* IC U5, pin 5 */ - M79AMB_R64, M79AMB_C34, - 12, 0, 12, /* VPOS,VNEG,VCHARGE */ - DISC_566_OUT_DC | DISC_566_OUT_TRIANGLE) - DISCRETE_CRFILTER(NODE_83, - NODE_82, M79AMB_R67 + M79AMB_R68 + M79AMB_R69, M79AMB_C35) - DISCRETE_MULTIPLY(NODE_84, NODE_83, M79AMB_WHISTLE_B_EN) /* Q19, Q20*/ - DISCRETE_GAIN(M79AMB_WHISTLE_B_SND, NODE_84, RES_VOLTAGE_DIVIDER(M79AMB_R67 + M79AMB_R68, M79AMB_R69)) - - /************************************************ - * Mixer - ************************************************/ - DISCRETE_MIXER7(NODE_90, /* IC U7, pin 6 */ - 1, /* ENAB */ - M79AMB_BOOM_SND, - M79AMB_THUD_SND, - M79AMB_SHOT_SND, - M79AMB_MC_SND, - M79AMB_TANK_TRUCK_JEEP_SND, - M79AMB_WHISTLE_A_SND, - M79AMB_WHISTLE_B_SND, - &m79amb_final_mix) - DISCRETE_RCFILTER(NODE_91, - NODE_90, M79AMB_R86, M79AMB_C41) - - DISCRETE_OUTPUT(NODE_91, 32000.0/5) - -DISCRETE_SOUND_END - - -/* the ports are guessed from operation */ -/* the schematics do not show the actual hookup */ - -void m79amb_state::m79amb_8000_w(uint8_t data) -{ - /* these values are not latched */ - /* they are pulsed when the port is addressed */ - /* the discrete system will just trigger from them */ - m_discrete->write(M79AMB_SHOT_EN, data & 0x01); - m_discrete->write(M79AMB_BOOM_EN, data & 0x02); - m_discrete->write(M79AMB_THUD_EN, data & 0x04); -} - -void m79amb_state::m79amb_8003_w(uint8_t data) -{ - /* Self Test goes low on reset and lights LED */ - /* LED goes off on pass */ - m_self_test = BIT(data, 0); - m_discrete->write(M79AMB_MC_REV_EN, data & 0x02); - m_discrete->write(M79AMB_MC_CONTROL_EN, data & 0x04); - m_discrete->write(M79AMB_TANK_TRUCK_JEEP_EN, data & 0x08); - m_discrete->write(M79AMB_WHISTLE_B_EN, data & 0x10); - m_discrete->write(M79AMB_WHISTLE_A_EN, data & 0x20); -} diff --git a/src/mame/pacman/pacman.cpp b/src/mame/pacman/pacman.cpp index be414e0c741..aa6ada3031b 100644 --- a/src/mame/pacman/pacman.cpp +++ b/src/mame/pacman/pacman.cpp @@ -7304,8 +7304,8 @@ ROM_START( bwcasino ) // Pac-Man PCB conversion kit. Includes a small daughterca ROM_RELOAD( 0x1000, 0x1000 ) // Not Used?? ROM_REGION( 0x0120, "proms", 0 ) - ROM_LOAD( "7_f_b.w.c.7f", 0x0000, 0x0020, CRC(133bb744) SHA1(da4074f3ea30202973f0b6c9ad05a992bb44eafd) ) // labeled 7 F B.W.C. with sinlge red dot - ROM_LOAD( "4_a_b.w.c.4a", 0x0020, 0x0100, CRC(8e29208f) SHA1(a30a405fbd43d27a8d403f6c3545178564dede5d) ) // labeled 4 A B.W.C. with sinlge red dot + ROM_LOAD( "7_f_b.w.c.7f", 0x0000, 0x0020, CRC(133bb744) SHA1(da4074f3ea30202973f0b6c9ad05a992bb44eafd) ) // labeled 7 F B.W.C. with single red dot + ROM_LOAD( "4_a_b.w.c.4a", 0x0020, 0x0100, CRC(8e29208f) SHA1(a30a405fbd43d27a8d403f6c3545178564dede5d) ) // labeled 4 A B.W.C. with single red dot ROM_REGION( 0x0200, "namco", 0 ) // Sound PROMs ROM_LOAD( "82s126.1m", 0x0000, 0x0100, CRC(a9cc86bf) SHA1(bbcec0570aeceb582ff8238a4bc8546a23430081) ) @@ -7332,7 +7332,7 @@ ROM_START( newpuc2 ) ROM_REGION( 0x0120, "proms", 0 ) ROM_LOAD( "82s123.7f", 0x0000, 0x0020, CRC(2fc650bd) SHA1(8d0268dee78e47c712202b0ec4f1f51109b1f2a5) ) - ROM_LOAD( "82s126.4a", 0x0020, 0x0100, CRC(3eb3a8e4) SHA1(19097b5f60d1030f8b82d9f1d3a241f93e5c75d6) ) + ROM_LOAD( "82s126.4a", 0x0020, 0x0100, CRC(3eb3a8e4) SHA1(19097b5f60d1030f8b82d9f1d3a241f93e5c75d6) ) ROM_REGION( 0x0200, "namco", 0 ) // Sound PROMs ROM_LOAD( "82s126.1m", 0x0000, 0x0100, CRC(a9cc86bf) SHA1(bbcec0570aeceb582ff8238a4bc8546a23430081) ) @@ -7359,7 +7359,7 @@ ROM_START( newpuc2b ) ROM_REGION( 0x0120, "proms", 0 ) ROM_LOAD( "82s123.7f", 0x0000, 0x0020, CRC(2fc650bd) SHA1(8d0268dee78e47c712202b0ec4f1f51109b1f2a5) ) - ROM_LOAD( "82s126.4a", 0x0020, 0x0100, CRC(3eb3a8e4) SHA1(19097b5f60d1030f8b82d9f1d3a241f93e5c75d6) ) + ROM_LOAD( "82s126.4a", 0x0020, 0x0100, CRC(3eb3a8e4) SHA1(19097b5f60d1030f8b82d9f1d3a241f93e5c75d6) ) ROM_REGION( 0x0200, "namco", 0 ) // Sound PROMs ROM_LOAD( "82s126.1m", 0x0000, 0x0100, CRC(a9cc86bf) SHA1(bbcec0570aeceb582ff8238a4bc8546a23430081) ) @@ -7385,7 +7385,7 @@ ROM_START( pacuman ) ROM_REGION( 0x0120, "proms", 0 ) ROM_LOAD( "82s123.7f", 0x0000, 0x0020, CRC(2fc650bd) SHA1(8d0268dee78e47c712202b0ec4f1f51109b1f2a5) ) - ROM_LOAD( "82s126.4a", 0x0020, 0x0100, CRC(3eb3a8e4) SHA1(19097b5f60d1030f8b82d9f1d3a241f93e5c75d6) ) + ROM_LOAD( "82s126.4a", 0x0020, 0x0100, CRC(3eb3a8e4) SHA1(19097b5f60d1030f8b82d9f1d3a241f93e5c75d6) ) ROM_REGION( 0x0200, "namco", 0 ) // Sound PROMs ROM_LOAD( "82s126.1m", 0x0000, 0x0100, CRC(a9cc86bf) SHA1(bbcec0570aeceb582ff8238a4bc8546a23430081) ) diff --git a/src/mame/ramtek/m79amb.cpp b/src/mame/ramtek/m79amb.cpp new file mode 100644 index 00000000000..fad5dad407d --- /dev/null +++ b/src/mame/ramtek/m79amb.cpp @@ -0,0 +1,280 @@ +// license:BSD-3-Clause +// copyright-holders:Al Kossow +/* Ramtek M79 Ambush + + +The following chart explains the settings of the eight switches on +the DIP switch. A plus(+) in the column means the toggle switch is +up on the plus side of the DIP switch. + + SWITCHES + | 12 | 345 | 678 | +------------------------------------------------| +Length of Game (seconds) | | | | + 60 | 00 | | | + 90 | 0+ | | | + 90 | +0 | | | + 120 | ++ | | | +-------------------------+------+-------+-------| +Points for Extended Time | | | | + 1500 | | 000 | | + 2500 | | +00 | | + 3500 | | 0+0 | | + 5000 | | ++0 | | + NO extended time | | +++ | | +-------------------------+------+-------+-------| +Coins Per Game | | | | + Free Play - two players | | | 0++ | + One Coin - two players | | | 0+0 | + One Coin - each player | | | 000 | + Two Coins - each player | | | +00 | +------------------------------------------------- + + +Based on extensive tests on location, the factory settings for the +most universal combinations are: + 60 second long game + 2500 points for extended play 12345678 + One coin each player 00+00000 + +Ports: + In: + 8000 DIP SW + 8002 D0=VBlank + 8004 Game Switch Inputs + 8005 Game Switch Inputs + + Out: + 8000 + 8001 Mask Sel (Manual calls it "Select All RAM") + 8002 Sound Control (According to Manual) + 8003 D0=SelfTest LED + + +The cabinet has backdrop artwork, a lightbulb for explosions, +and two large (paddles pretending to be) guns. + +*/ + +#include "emu.h" +#include "m79amb.h" + +#include "screen.h" +#include "speaker.h" + +void m79amb_state::machine_start() +{ + m_self_test.resolve(); +} + +void m79amb_state::ramtek_videoram_w(offs_t offset, uint8_t data) +{ + m_videoram[offset] = data & ~*m_mask; +} + +uint32_t m79amb_state::screen_update_ramtek(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect) +{ + for (offs_t offs = 0; offs < 0x2000; offs++) + { + uint8_t data = m_videoram[offs]; + int y = offs >> 5; + int x = (offs & 0x1f) << 3; + + for (int i = 0; i < 8; i++) + { + pen_t pen = (data & 0x80) ? rgb_t::white() : rgb_t::black(); + bitmap.pix(y, x) = pen; + + x++; + data <<= 1; + } + } + + return 0; +} + + +uint8_t m79amb_state::gray5bit_controller0_r() +{ + uint8_t port_data = ioport("8004")->read(); + uint8_t gun_pos = ioport("GUN1")->read(); + + return (port_data & 0xe0) | m_lut_gun1[gun_pos]; +} + +uint8_t m79amb_state::gray5bit_controller1_r() +{ + uint8_t port_data = ioport("8005")->read(); + uint8_t gun_pos = ioport("GUN2")->read(); + + return (port_data & 0xe0) | m_lut_gun2[gun_pos]; +} + +void m79amb_state::m79amb_8002_w(uint8_t data) +{ + /* D1 may also be watchdog reset */ + /* port goes to 0x7f to turn on explosion lamp */ + output().set_value("EXP_LAMP", data ? 1 : 0); +} + +void m79amb_state::main_map(address_map &map) +{ + map(0x0000, 0x1fff).rom(); + map(0x4000, 0x5fff).ram().w(FUNC(m79amb_state::ramtek_videoram_w)).share("videoram"); + map(0x6000, 0x63ff).ram(); /* ?? */ + map(0x8000, 0x8000).portr("8000").w(FUNC(m79amb_state::m79amb_8000_w)); + map(0x8001, 0x8001).writeonly().share("mask"); + map(0x8002, 0x8002).portr("8002").w(FUNC(m79amb_state::m79amb_8002_w)); + map(0x8003, 0x8003).w(FUNC(m79amb_state::m79amb_8003_w)); + map(0x8004, 0x8004).r(FUNC(m79amb_state::gray5bit_controller0_r)); + map(0x8005, 0x8005).r(FUNC(m79amb_state::gray5bit_controller1_r)); + map(0xc000, 0xc07f).ram(); /* ?? */ + map(0xc200, 0xc27f).ram(); /* ?? */ +} + + + +static INPUT_PORTS_START( m79amb ) + PORT_START("8000") + PORT_DIPNAME( 0x03, 0x00, DEF_STR( Game_Time )) PORT_DIPLOCATION("G6:!1,!2") + PORT_DIPSETTING( 0x00, "60 Seconds" ) + PORT_DIPSETTING( 0x01, "90 Seconds" ) + PORT_DIPSETTING( 0x02, "90 Seconds" ) + PORT_DIPSETTING( 0x03, "120 Seconds" ) + PORT_DIPNAME( 0x1c, 0x04, "Points for Extended Time" ) PORT_DIPLOCATION("G6:!3,!4,!5") + PORT_DIPSETTING( 0x00, "1500" ) + PORT_DIPSETTING( 0x04, "2500" ) + PORT_DIPSETTING( 0x08, "3500" ) + PORT_DIPSETTING( 0x0c, "5000" ) + PORT_DIPSETTING( 0x1c, "No Extended Time" ) + PORT_DIPNAME( 0xe0, 0x00, DEF_STR( Coinage )) PORT_DIPLOCATION("G6:!6,!7,!8") + PORT_DIPSETTING( 0x20, DEF_STR( 2C_1C )) + PORT_DIPSETTING( 0x00, DEF_STR( 1C_1C )) + PORT_DIPSETTING( 0x40, "1 Coin/2 Players") + PORT_DIPSETTING( 0xc0, DEF_STR( Free_Play )) + + PORT_START("8002") + PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_CUSTOM ) PORT_VBLANK("screen") + PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_START1 ) + PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_COIN1 ) + PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_TILT ) + PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_UNUSED ) + PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_UNUSED ) + PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNUSED ) + PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNUSED ) + + PORT_START("8004") + PORT_BIT( 0x1f, IP_ACTIVE_LOW, IPT_UNUSED ) // gun 1 here + PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_BUTTON1 ) + PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNKNOWN ) + PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNKNOWN ) + + PORT_START("8005") + PORT_BIT( 0x1f, IP_ACTIVE_LOW, IPT_UNUSED ) // gun 2 here + PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(2) + PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNKNOWN ) + PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNKNOWN ) + + // fake ports for the guns + PORT_START("GUN1") + PORT_BIT( 0xff, 0x80, IPT_PADDLE ) PORT_CROSSHAIR(X, (1.0-(19.0/256.0)), 19.0/256.0, 30.0/224.0) PORT_MINMAX(19,255) PORT_SENSITIVITY(50) PORT_KEYDELTA(5) PORT_CENTERDELTA(0) PORT_PLAYER(1) + + PORT_START("GUN2") + PORT_BIT( 0xff, 0x80, IPT_PADDLE ) PORT_CROSSHAIR(X, (1.0-(22.0/256.0)), 0.0, 30.0/224.0) PORT_MINMAX(0,234) PORT_SENSITIVITY(50) PORT_KEYDELTA(5) PORT_CENTERDELTA(0) PORT_PLAYER(2) +INPUT_PORTS_END + + +uint8_t m79amb_state::inta_r() +{ + m_maincpu->set_input_line(0, CLEAR_LINE); + + // Vector is RST 1 + return 0xcf; +} + +void m79amb_state::m79amb(machine_config &config) +{ + /* basic machine hardware */ + I8080(config, m_maincpu, 19.6608_MHz_XTAL / 10); + m_maincpu->set_addrmap(AS_PROGRAM, &m79amb_state::main_map); + m_maincpu->in_inta_func().set(FUNC(m79amb_state::inta_r)); + + /* video hardware */ + screen_device &screen(SCREEN(config, "screen", SCREEN_TYPE_RASTER)); + screen.set_raw(19.6608_MHz_XTAL / 4, 320, 0, 256, 262, 32, 256); + screen.set_screen_update(FUNC(m79amb_state::screen_update_ramtek)); + screen.screen_vblank().set_inputline(m_maincpu, 0, ASSERT_LINE); + + /* sound hardware */ + SPEAKER(config, "mono").front_center(); + + DISCRETE(config, m_discrete, m79amb_discrete).add_route(ALL_OUTPUTS, "mono", 1.0); +} + + + +ROM_START( m79amb ) + ROM_REGION( 0x2000, "maincpu", ROMREGION_INVERT ) + ROM_LOAD( "m79.10t", 0x0000, 0x0200, CRC(ccf30b1e) SHA1(c1a77f8dc81c491928f81121ca5c9b7f8753794f) ) + ROM_LOAD( "m79.9t", 0x0200, 0x0200, CRC(daf807dd) SHA1(16cd9d553bfb111c8380966cbde39dbddd5fe58c) ) + ROM_LOAD( "m79.8t", 0x0400, 0x0200, CRC(79fafa02) SHA1(440620f5be44febdd7c64014739dc71fb570cc92) ) + ROM_LOAD( "m79.7t", 0x0600, 0x0200, CRC(06f511f8) SHA1(a8dcaec0723b8ac9ad9474e3e931a23d7aa4ec23) ) + ROM_LOAD( "m79.6t", 0x0800, 0x0200, CRC(24634390) SHA1(bc5f2ae5a49904dde1bd5e6b134571bf1d912735) ) + ROM_LOAD( "m79.5t", 0x0a00, 0x0200, CRC(95252aa6) SHA1(e7ea598f864510557b511682a5d2223a512ff029) ) + ROM_LOAD( "m79.4t", 0x0c00, 0x0200, CRC(54cffb0f) SHA1(4a4ad921ef6324c927a2e4a9da624d8096b6d87b) ) + ROM_LOAD( "m79.3ta", 0x0e00, 0x0200, CRC(27db5ede) SHA1(890587181497ed6e1d45ed501790a6d4d3315f00) ) + ROM_LOAD( "m79.10u", 0x1000, 0x0200, CRC(e41d13d2) SHA1(cc2911f46a0465305e4c7bc08f55acd065f93534) ) + ROM_LOAD( "m79.9u", 0x1200, 0x0200, CRC(e35f5616) SHA1(394ad92ad7dd233ece17335cf20aef8861b41508) ) + ROM_LOAD( "m79.8u", 0x1400, 0x0200, CRC(14eafd7c) SHA1(ca2d17f6ae1c3ff461a1b2bc6f37622e70cdaae8) ) + ROM_LOAD( "m79.7u", 0x1600, 0x0200, CRC(b9864f25) SHA1(9330cf96b7bce13e0ee3ad746b00e82ef10c3989) ) + ROM_LOAD( "m79.6u", 0x1800, 0x0200, CRC(dd25197f) SHA1(13eaf40251de82e817f488a9de738aadd8f6715e) ) + ROM_LOAD( "m79.5u", 0x1a00, 0x0200, CRC(251545e2) SHA1(05a0d5e8f143ea376fb3c517cf5e9d0d3534b933) ) + ROM_LOAD( "m79.4u", 0x1c00, 0x0200, CRC(b5f55c75) SHA1(f478cde73ae961be7b58c769f035eef58fd45555) ) + ROM_LOAD( "m79.3u", 0x1e00, 0x0200, CRC(e968691a) SHA1(7024d10f2af195fc4050861706b1f3d22cb22a9c) ) +ROM_END + + + +/* grenade trajectory per gun position is inconsistent and sloppy in the game: + 0, 1, 3, 2, 6, 7, 5, 4 - gun position + 90.00, 90.00, 90.00, 90.00, 86.42, 86.42, 86.42, 86.42 - grenade trajectory (angle, est) + 18.0, 18.0, 18.0, 18.0, 27.2, 27.2, 27.2, 31.2 - crosses with y=28 (x, est) + + 12, 13, 15, 14, 10, 11, 9, 8, + 84.39, 84.39, 84.39, 80.87, 79.00, 80.87, 79.00, 79.00 + 41.9, 48.9, 56.8, 75.8, 87.2, 88.8, 101.6, 107.6 + + 24, 25, 27, 26, 30, 31, 29, 28, + 79.00, 79.00, 75.59, 75.59, 75.59, 73.72, 73.72, 73.72 + 114.1, 121.5, 138.8, 146.0, 152.7, 162.6, 167.6, 172.7 + + 20, 21, 23, 22, 18, 19, 17, 16 + 73.72, 70.08, 70.08, 70.08, 67.97, 67.97, 64.34, 64.34 + 181.6, 199.9, 205.4, 211.9, 223.5, 232.4, 254.0, 254.0 +*/ + +void m79amb_state::init_m79amb() +{ + static constexpr uint8_t lut_cross[0x20] = { + 19, 20, 21, 23, 25, 27, 29, 37, + 45, 53, 66, 82, 88, 95, 105, 111, + 118, 130, 142, 149, 158, 165, 170, 177, + 191, 203, 209, 218, 228, 243, 249, 255, + }; + + // gun positions + for (int i = 0, j = 0, k = 0xff; i < 0x20; i++) + { + const uint8_t gray = i ^ (i >> 1) ^ 0x1f; // 5-bit Gray code, inverted + + // gun 1, start at left 18 + while (j < 0x100 && j <= lut_cross[i]) + m_lut_gun1[j++] = gray; + + // gun 2, start at right 235 + while (k >= 0 && k >= 253 - lut_cross[i]) + m_lut_gun2[k--] = gray; + } +} + +GAME( 1977, m79amb, 0, m79amb, m79amb, m79amb_state, init_m79amb, ROT0, "Ramtek", "M-79 Ambush", MACHINE_IMPERFECT_SOUND | MACHINE_SUPPORTS_SAVE ) diff --git a/src/mame/ramtek/m79amb.h b/src/mame/ramtek/m79amb.h new file mode 100644 index 00000000000..4e0aba6c134 --- /dev/null +++ b/src/mame/ramtek/m79amb.h @@ -0,0 +1,59 @@ +// license:BSD-3-Clause +// copyright-holders:Al Kossow +#ifndef MAME_RAMTEK_M79AMB_H +#define MAME_RAMTEK_M79AMB_H + +#pragma once + +#include "cpu/i8085/i8085.h" +#include "sound/discrete.h" + +class m79amb_state : public driver_device +{ +public: + m79amb_state(const machine_config &mconfig, device_type type, const char *tag) : + driver_device(mconfig, type, tag), + m_videoram(*this, "videoram"), + m_mask(*this, "mask"), + m_discrete(*this, "discrete"), + m_maincpu(*this, "maincpu"), + m_self_test(*this, "SELF_TEST") + { } + + void m79amb(machine_config &config); + + void init_m79amb(); + +protected: + void machine_start() override; + +private: + void ramtek_videoram_w(offs_t offset, uint8_t data); + uint8_t gray5bit_controller0_r(); + uint8_t gray5bit_controller1_r(); + void m79amb_8000_w(uint8_t data); + void m79amb_8002_w(uint8_t data); + void m79amb_8003_w(uint8_t data); + uint8_t inta_r(); + + uint32_t screen_update_ramtek(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect); + void main_map(address_map &map); + + /* memory pointers */ + required_shared_ptr m_videoram; + required_shared_ptr m_mask; + required_device m_discrete; + required_device m_maincpu; + + output_finder<> m_self_test; + + /* misc */ + uint8_t m_lut_gun1[0x100]{}; + uint8_t m_lut_gun2[0x100]{}; +}; + +/*----------- defined in audio/m79amb.c -----------*/ + +DISCRETE_SOUND_EXTERN( m79amb_discrete ); + +#endif // MAME_RAMTEK_M79AMB_H diff --git a/src/mame/ramtek/m79amb_a.cpp b/src/mame/ramtek/m79amb_a.cpp new file mode 100644 index 00000000000..ff9f169f6c5 --- /dev/null +++ b/src/mame/ramtek/m79amb_a.cpp @@ -0,0 +1,345 @@ +// license:BSD-3-Clause +// copyright-holders:Derrick Renaud +/************************************************************************ + * m79amb Sound System Analog emulation + * Nov 2008, Derrick Renaud + ************************************************************************/ + +#include "emu.h" +#include "m79amb.h" +#include "sound/discrete.h" + +#define TIME_OF_9602(r, c) (0.34 * (r) * (c) * (1.0 + 1.0 / (r))) +#define TIME_OF_9602_WITH_DIODE(r, c) (0.3 * (r) * (c)) + + +/* Discrete Sound Input Nodes */ +#define M79AMB_BOOM_EN NODE_01 +#define M79AMB_THUD_EN NODE_02 +#define M79AMB_SHOT_EN NODE_03 +#define M79AMB_MC_REV_EN NODE_04 +#define M79AMB_MC_CONTROL_EN NODE_05 +#define M79AMB_TANK_TRUCK_JEEP_EN NODE_06 +#define M79AMB_WHISTLE_A_EN NODE_07 +#define M79AMB_WHISTLE_B_EN NODE_08 + +/* Discrete Sound Output Nodes */ +#define M79AMB_BOOM_SND NODE_11 +#define M79AMB_THUD_SND NODE_12 +#define M79AMB_SHOT_SND NODE_13 +#define M79AMB_MC_SND NODE_14 +#define M79AMB_TANK_TRUCK_JEEP_SND NODE_15 +#define M79AMB_WHISTLE_A_SND NODE_16 +#define M79AMB_WHISTLE_B_SND NODE_17 + +/* Parts List - Resistors */ +#define M79AMB_R2 RES_K(5.6) +#define M79AMB_R6 220 +#define M79AMB_R9 RES_K(4.7) +#define M79AMB_R10 RES_K(2.2) +#define M79AMB_R12 RES_K(5.6) +#define M79AMB_R16 330 +#define M79AMB_R19 RES_K(4.7) +#define M79AMB_R20 RES_K(2.2) +#define M79AMB_R22 RES_K(3.3) +#define M79AMB_R26 100 +#define M79AMB_R29 RES_K(4.7) +#define M79AMB_R30 RES_K(1.5) +#define M79AMB_R35 RES_K(470) +#define M79AMB_R36 RES_K(39) +#define M79AMB_R37 RES_K(82) +#define M79AMB_R38 100 +#define M79AMB_R39 RES_K(10) +#define M79AMB_R41 RES_K(2.2) +#define M79AMB_R42 RES_K(10) +#define M79AMB_R43 220 +#define M79AMB_R44 RES_K(39) +#define M79AMB_R45 RES_K(82) +#define M79AMB_R46 RES_K(10) +#define M79AMB_R48 RES_K(2.2) +#define M79AMB_R49 RES_K(1) +#define M79AMB_R51 RES_K(39) +#define M79AMB_R52 RES_K(82) +#define M79AMB_R53 100 +#define M79AMB_R54 RES_K(10) +#define M79AMB_R57 RES_K(2.2) +#define M79AMB_R58 RES_K(2.2) +#define M79AMB_R59 RES_K(1) +#define M79AMB_R61 RES_K(39) +#define M79AMB_R62 RES_K(82) +#define M79AMB_R63 100 +#define M79AMB_R64 RES_K(10) +#define M79AMB_R67 RES_K(2.2) +#define M79AMB_R68 RES_K(2.2) +#define M79AMB_R69 RES_K(1) +#define M79AMB_R76 RES_K(2.7) +#define M79AMB_R77 RES_K(47) +#define M79AMB_R78 RES_K(47) +#define M79AMB_R79 RES_K(15) +#define M79AMB_R80 RES_K(22) +#define M79AMB_R81 RES_K(100) +#define M79AMB_R82 RES_K(100) +#define M79AMB_R83 RES_K(3.3) +#define M79AMB_R84 RES_K(50) +#define M79AMB_R86 470 + +/* Parts List - Capacitors */ +#define M79AMB_C2 CAP_U(39) +#define M79AMB_C3 CAP_U(22) +#define M79AMB_C6 CAP_U(0.1) +#define M79AMB_C8 CAP_U(39) +#define M79AMB_C9 CAP_U(22) +#define M79AMB_C12 CAP_U(0.1) +#define M79AMB_C14 CAP_U(4.7) +#define M79AMB_C15 CAP_U(3.3) +#define M79AMB_C18 CAP_U(0.1) +#define M79AMB_C20 CAP_U(2.2) +#define M79AMB_C21 CAP_U(1) +#define M79AMB_C22 CAP_U(22) +#define M79AMB_C23 CAP_U(0.01) +#define M79AMB_C25 CAP_U(2.2) +#define M79AMB_C26 CAP_U(22) +#define M79AMB_C27 CAP_U(0.47) +#define M79AMB_C28 CAP_U(0.1) +#define M79AMB_C29 CAP_U(22) +#define M79AMB_C30 CAP_U(0.03) +#define M79AMB_C31 CAP_U(0.1) +#define M79AMB_C32 CAP_U(0.1) +#define M79AMB_C33 CAP_U(22) +#define M79AMB_C34 CAP_U(0.03) +#define M79AMB_C35 CAP_U(0.1) +#define M79AMB_C36 CAP_U(0.1) +#define M79AMB_C37 CAP_P(500) +#define M79AMB_C41 CAP_U(0.1) +#define M79AMB_C42 CAP_U(15) + + +static const discrete_mixer_desc m79amb_final_mix = +{ + DISC_MIXER_IS_OP_AMP, + { + M79AMB_R76 + M79AMB_R9, + M79AMB_R77 + M79AMB_R19, + M79AMB_R78 + M79AMB_R29, + M79AMB_R79 + RES_2_PARALLEL(M79AMB_R41, M79AMB_R42 + M79AMB_R43), + M79AMB_R80 + RES_2_PARALLEL(M79AMB_R48, M79AMB_R49), + M79AMB_R81 + RES_2_PARALLEL(M79AMB_R59, M79AMB_R57 + M79AMB_R58), + M79AMB_R82 + RES_2_PARALLEL(M79AMB_R69, M79AMB_R67 + M79AMB_R68) + }, + {0}, /* no r_nodes */ + {M79AMB_C6, M79AMB_C12, M79AMB_C18, M79AMB_C23, M79AMB_C28, M79AMB_C32, M79AMB_C36}, + 0, + M79AMB_R83 + M79AMB_R84, + M79AMB_C37, + M79AMB_C42, + 0, + 1 /* gain */ +}; + +DISCRETE_SOUND_START( m79amb_discrete ) + /************************************************ + * Input register mapping + ************************************************/ + DISCRETE_INPUT_PULSE(M79AMB_BOOM_EN, 0) + DISCRETE_INPUT_PULSE(M79AMB_THUD_EN, 0) + DISCRETE_INPUT_PULSE(M79AMB_SHOT_EN, 0) + DISCRETE_INPUT_LOGIC(M79AMB_MC_REV_EN) + DISCRETE_INPUT_LOGIC(M79AMB_MC_CONTROL_EN) + DISCRETE_INPUT_LOGIC(M79AMB_TANK_TRUCK_JEEP_EN) + DISCRETE_INPUT_LOGIC(M79AMB_WHISTLE_A_EN) + DISCRETE_INPUT_LOGIC(M79AMB_WHISTLE_B_EN) + + /* Boom, Thud, Shot sounds need more accurate emulation */ + + /************************************************ + * Boom + ************************************************/ + DISCRETE_ONESHOT(NODE_20, + M79AMB_BOOM_EN, /* TRIG */ + 1, /* AMPL */ + TIME_OF_9602_WITH_DIODE(M79AMB_R2, M79AMB_C2), + DISC_ONESHOT_REDGE | DISC_ONESHOT_RETRIG | DISC_OUT_ACTIVE_HIGH) + DISCRETE_RCDISC2(NODE_21, + NODE_20, /* Q1 base */ + 0, /* Q1 off, C3 discharges */ + M79AMB_R9 + M79AMB_R10, /* discharges through amp/filter circuit */ + 12, /* Q1 on, C3 charges */ + M79AMB_R6, /* Q2 on */ + M79AMB_C3) /* controls amplitude */ + DISCRETE_NOISE(M79AMB_BOOM_SND, + 1, /* ENAB */ + 800, /* FREQ - Guess*/ + NODE_21, /* AMP */ + 0) /* BIAS - fake AC is fine*/ + + /************************************************ + * Thud + ************************************************/ + DISCRETE_ONESHOT(NODE_30, + M79AMB_THUD_EN, /* TRIG */ + 1, /* AMPL */ + TIME_OF_9602_WITH_DIODE(M79AMB_R12, M79AMB_C8), + DISC_ONESHOT_REDGE | DISC_ONESHOT_RETRIG | DISC_OUT_ACTIVE_HIGH) + DISCRETE_RCDISC2(NODE_31, + NODE_30, /* Q4 base */ + 0, /* Q4 off, C9 discharges */ + M79AMB_R19 + M79AMB_R20, /* discharges through amp/filter circuit */ + 12, /* Q4 on, C9 charges */ + M79AMB_R16, /* Q5 on */ + M79AMB_C9) /* controls amplitude */ + DISCRETE_NOISE(M79AMB_THUD_SND, + 1, /* ENAB */ + 500, /* FREQ - Guess*/ + NODE_31, /* AMP */ + 0) /* BIAS - fake AC is fine*/ + + /************************************************ + * Shot + ************************************************/ + DISCRETE_ONESHOT(NODE_40, + M79AMB_SHOT_EN, /* TRIG */ + 1, /* AMPL */ + TIME_OF_9602_WITH_DIODE(M79AMB_R22, M79AMB_C14), + DISC_ONESHOT_REDGE | DISC_ONESHOT_RETRIG | DISC_OUT_ACTIVE_HIGH) + DISCRETE_RCDISC2(NODE_41, + NODE_40, /* Q7 base */ + 0, /* Q7 off, C15 discharges */ + M79AMB_R29 + M79AMB_R30, /* discharges through amp/filter circuit */ + 12, /* Q7 on, C15 charges */ + M79AMB_R26, /* Q8 on */ + M79AMB_C15) /* controls amplitude */ + DISCRETE_NOISE(M79AMB_SHOT_SND, + 1, /* ENAB */ + 1000, /* FREQ - Guess*/ + NODE_41, /* AMP */ + 0) /* BIAS - fake AC is fine*/ + + /************************************************ + * MC + ************************************************/ + /* not the best implementation of the pin 5 charge circuit, but it is within tolerance */ + DISCRETE_RCDISC2(NODE_50, + M79AMB_MC_REV_EN, + /* R35 can be ignored on discharge */ + RES_VOLTAGE_DIVIDER(M79AMB_R36 + M79AMB_R37, M79AMB_R38) * 12, /* Q12 on */ + RES_2_PARALLEL(M79AMB_R36 + M79AMB_R37, M79AMB_R38), /* Q12 on */ + 12.0 * RES_VOLTAGE_DIVIDER(M79AMB_R36, M79AMB_R35), /* Q12 off */ + RES_2_PARALLEL(M79AMB_R36, M79AMB_R35) + M79AMB_R37, /* Q12 off */ + M79AMB_C20) + /* cap charge to B+ ratio changes voltage on pin 5 */ + /* (iR36 + iR35 + iR37) * R36||R35||R37 where iR35 = 0/R35 = 0 */ + DISCRETE_TRANSFORM4(NODE_51, 12.0 / M79AMB_R36, NODE_50, M79AMB_R37, RES_3_PARALLEL(M79AMB_R36, M79AMB_R35, M79AMB_R37), "012/+3*") + DISCRETE_566(NODE_52, /* IC U3, pin 4 */ + NODE_51, /* IC U3, pin 5 */ + M79AMB_R39, M79AMB_C21, + 12, 0, 12, /* VPOS,VNEG,VCHARGE */ + DISC_566_OUT_DC | DISC_566_OUT_TRIANGLE) + DISCRETE_CRFILTER(NODE_53, + NODE_52, M79AMB_R41 + M79AMB_R42 + M79AMB_R43, M79AMB_C22) + DISCRETE_MULTIPLY(NODE_54, NODE_53, M79AMB_MC_CONTROL_EN) + DISCRETE_GAIN(M79AMB_MC_SND, NODE_54, RES_VOLTAGE_DIVIDER(M79AMB_R41 + M79AMB_R42, 2200))//M79AMB_R43)) + + /************************************************ + * Tank, Truck, Jeep + ************************************************/ + DISCRETE_566(NODE_60, /* IC U4, pin 4 */ + 12.0 * RES_VOLTAGE_DIVIDER(M79AMB_R44, M79AMB_R45), /* IC U5, pin 5 */ + M79AMB_R46, M79AMB_C25, + 12, 0, 12, /* VPOS,VNEG,VCHARGE */ + DISC_566_OUT_DC | DISC_566_OUT_TRIANGLE) + DISCRETE_ONOFF(NODE_61, + M79AMB_TANK_TRUCK_JEEP_EN, /* Q16, Q17 */ + NODE_60) + DISCRETE_CRFILTER(NODE_62, + NODE_61, M79AMB_R48 + M79AMB_R49, M79AMB_C26) + DISCRETE_GAIN(NODE_63, NODE_62, RES_VOLTAGE_DIVIDER(M79AMB_R48, M79AMB_R49)) + DISCRETE_RCFILTER(M79AMB_TANK_TRUCK_JEEP_SND, + NODE_63, RES_2_PARALLEL(M79AMB_R48, M79AMB_R49), M79AMB_C27) + + /************************************************ + * Whisle A + ************************************************/ + DISCRETE_RCDISC2(NODE_70, + M79AMB_WHISTLE_A_EN, + RES_VOLTAGE_DIVIDER(M79AMB_R51 + M79AMB_R52, M79AMB_R53) * 12, /* Q15 on */ + RES_2_PARALLEL(M79AMB_R53, M79AMB_R51 + M79AMB_R52), /* Q15 on */ + 12, M79AMB_R51 + M79AMB_R52, /* Q15 off */ + M79AMB_C29) + /* cap charge to B+ ratio changes voltage on pin 5 */ + DISCRETE_TRANSFORM3(NODE_71, 12, NODE_70, RES_VOLTAGE_DIVIDER(M79AMB_R51, M79AMB_R52), "01-2*1+") + DISCRETE_566(NODE_72, /* IC U5, pin 4 */ + NODE_71, /* IC U5, pin 5 */ + M79AMB_R54, M79AMB_C30, + 12, 0, 12, /* VPOS,VNEG,VCHARGE */ + DISC_566_OUT_DC | DISC_566_OUT_TRIANGLE) + DISCRETE_CRFILTER(NODE_73, + NODE_72, M79AMB_R57 + M79AMB_R58 + M79AMB_R59, M79AMB_C31) + DISCRETE_MULTIPLY(NODE_74, NODE_73, M79AMB_WHISTLE_A_EN) /* Q16, Q17 */ + DISCRETE_GAIN(M79AMB_WHISTLE_A_SND, NODE_74, RES_VOLTAGE_DIVIDER(M79AMB_R57 + M79AMB_R58, M79AMB_R59)) + + /************************************************ + * Whisle B + ************************************************/ + DISCRETE_RCDISC2(NODE_80, + M79AMB_WHISTLE_B_EN, + RES_VOLTAGE_DIVIDER(M79AMB_R61 + M79AMB_R62, M79AMB_R63) * 12, /* Q18 on */ + RES_2_PARALLEL(M79AMB_R63, M79AMB_R61 + M79AMB_R62), /* Q18 on */ + 12, M79AMB_R61 + M79AMB_R62, /* Q18 off */ + M79AMB_C33) + /* cap charge to B+ ratio changes voltage on pin 5 */ + DISCRETE_TRANSFORM3(NODE_81, 12, NODE_80, RES_VOLTAGE_DIVIDER(M79AMB_R61, M79AMB_R62), "01-2*1+") + DISCRETE_566(NODE_82, /* IC U5, pin 4 */ + NODE_81, /* IC U5, pin 5 */ + M79AMB_R64, M79AMB_C34, + 12, 0, 12, /* VPOS,VNEG,VCHARGE */ + DISC_566_OUT_DC | DISC_566_OUT_TRIANGLE) + DISCRETE_CRFILTER(NODE_83, + NODE_82, M79AMB_R67 + M79AMB_R68 + M79AMB_R69, M79AMB_C35) + DISCRETE_MULTIPLY(NODE_84, NODE_83, M79AMB_WHISTLE_B_EN) /* Q19, Q20*/ + DISCRETE_GAIN(M79AMB_WHISTLE_B_SND, NODE_84, RES_VOLTAGE_DIVIDER(M79AMB_R67 + M79AMB_R68, M79AMB_R69)) + + /************************************************ + * Mixer + ************************************************/ + DISCRETE_MIXER7(NODE_90, /* IC U7, pin 6 */ + 1, /* ENAB */ + M79AMB_BOOM_SND, + M79AMB_THUD_SND, + M79AMB_SHOT_SND, + M79AMB_MC_SND, + M79AMB_TANK_TRUCK_JEEP_SND, + M79AMB_WHISTLE_A_SND, + M79AMB_WHISTLE_B_SND, + &m79amb_final_mix) + DISCRETE_RCFILTER(NODE_91, + NODE_90, M79AMB_R86, M79AMB_C41) + + DISCRETE_OUTPUT(NODE_91, 32000.0/5) + +DISCRETE_SOUND_END + + +/* the ports are guessed from operation */ +/* the schematics do not show the actual hookup */ + +void m79amb_state::m79amb_8000_w(uint8_t data) +{ + /* these values are not latched */ + /* they are pulsed when the port is addressed */ + /* the discrete system will just trigger from them */ + m_discrete->write(M79AMB_SHOT_EN, data & 0x01); + m_discrete->write(M79AMB_BOOM_EN, data & 0x02); + m_discrete->write(M79AMB_THUD_EN, data & 0x04); +} + +void m79amb_state::m79amb_8003_w(uint8_t data) +{ + /* Self Test goes low on reset and lights LED */ + /* LED goes off on pass */ + m_self_test = BIT(data, 0); + m_discrete->write(M79AMB_MC_REV_EN, data & 0x02); + m_discrete->write(M79AMB_MC_CONTROL_EN, data & 0x04); + m_discrete->write(M79AMB_TANK_TRUCK_JEEP_EN, data & 0x08); + m_discrete->write(M79AMB_WHISTLE_B_EN, data & 0x10); + m_discrete->write(M79AMB_WHISTLE_A_EN, data & 0x20); +} diff --git a/src/mame/sega/segac2.cpp b/src/mame/sega/segac2.cpp index 848e54f5f9a..594684132bd 100644 --- a/src/mame/sega/segac2.cpp +++ b/src/mame/sega/segac2.cpp @@ -2910,7 +2910,7 @@ GAME( 1992, wwmarine, 0, segac2, wwmarine, wwmarine_state, init_no // not really sure how this should hook up, things like the 'sold out' flags could be mechanical sensors, or from another MCU / CPU board in the actual popcorn part of the machine? GAME( 1992, anpanman, 0, segac2, anpanman, segac2_state, init_noprot, ROT0, "Sega", "Soreike! Anpanman Popcorn Koujou (Rev B)", MACHINE_MECHANICAL ) // 'Mechanical' part isn't emulated -GAME( 1993, sonicpop, 0, segac2, sonicpop, segac2_state, init_noprot, ROT0, "Sega", "SegaSonic Popcorn Shop (Rev B)", MACHINE_MECHANICAL ) // region DSW for USA / Export / Japan, still speaks Japanese tho. 'Mechanical' part isn't emulated +GAME( 1993, sonicpop, 0, segac2, sonicpop, segac2_state, init_noprot, ROT0, "Sega", "SegaSonic Popcorn Shop (Rev B)", MACHINE_MECHANICAL ) // region DSW for USA / Export / Japan, still speaks Japanese tho. English voice version is known to exist. 'Mechanical' part isn't emulated GAME( 1993, sonicfgt, 0, segac2, sonicfgt, segac2_state, init_noprot, ROT0, "Sega", "SegaSonic Cosmo Fighter (World)", 0 ) GAME( 1993, sonicfgtj, sonicfgt, segac2, sonicfgt, segac2_state, init_noprot, ROT0, "Sega", "SegaSonic Cosmo Fighter (Japan)", 0 ) -- cgit v1.2.3