-destroyr: Added netlist sound. [Ryan Holtz]

This commit is contained in:
Ryan Holtz 2020-08-11 19:48:30 +02:00
parent 03ea613fd8
commit add6f68bec
6 changed files with 2925 additions and 66 deletions

View File

@ -1200,6 +1200,8 @@ files {
MAME_DIR .. "src/mame/drivers/cybstorm.cpp",
MAME_DIR .. "src/mame/includes/cybstorm.h",
MAME_DIR .. "src/mame/video/cybstorm.cpp",
MAME_DIR .. "src/mame/audio/nl_destroyr.cpp",
MAME_DIR .. "src/mame/audio/nl_destroyr.h",
MAME_DIR .. "src/mame/drivers/destroyr.cpp",
MAME_DIR .. "src/mame/drivers/dragrace.cpp",
MAME_DIR .. "src/mame/includes/dragrace.h",

View File

@ -161,6 +161,10 @@ files{
MAME_DIR .. "src/mame/audio/nl_flyball.h",
MAME_DIR .. "src/mame/drivers/flyball.cpp",
MAME_DIR .. "src/mame/audio/nl_destroyr.cpp",
MAME_DIR .. "src/mame/audio/nl_destroyr.h",
MAME_DIR .. "src/mame/drivers/destroyr.cpp",
MAME_DIR .. "src/mame/drivers/hazeltin.cpp",
MAME_DIR .. "src/mame/drivers/1942.cpp",

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,316 @@
// license:BSD-3-Clause
// copyright-holders:Ryan Holtz
//
// Netlist for Atari's Destroyer
//
// Derived from the schematics in the manual.
//
// Known problems/issues:
// * Sonar sound effect appears to be more noisy than a real cabinet. Unsure, as yet, why.
//
#include "netlist/devices/net_lib.h"
static NETLIST_START(LM324_VM5V12_DIP)
OPAMP(A, "LM324_M5V12V")
OPAMP(B, "LM324_M5V12V")
OPAMP(C, "LM324_M5V12V")
OPAMP(D, "LM324_M5V12V")
DIPPINS( /* +--------------+ */
A.OUT, /* |1 ++ 14| */ D.OUT,
A.MINUS, /* |2 13| */ D.MINUS,
A.PLUS, /* |3 12| */ D.PLUS,
A.VCC, /* |4 11| */ A.GND,
B.PLUS, /* |5 10| */ C.PLUS,
B.MINUS, /* |6 9| */ C.MINUS,
B.OUT, /* |7 8| */ C.OUT
/* +--------------+ */
)
NET_C(A.GND, B.GND, C.GND, D.GND)
NET_C(A.VCC, B.VCC, C.VCC, D.VCC)
NETLIST_END()
static NETLIST_START(NE556_DIP)
NE555(A)
NE555(B)
NET_C(A.GND, B.GND)
NET_C(A.VCC, B.VCC)
DIPPINS( /* +--------------+ */
A.DISCH, /* 1DISCH |1 ++ 14| VCC */ A.VCC,
A.THRESH, /* 1THRES |2 13| 2DISCH */ B.DISCH,
A.CONT, /* 1CONT |3 12| 2THRES */ B.THRESH,
A.RESET, /* 1RESET |4 NE556 11| 2CONT */ B.CONT,
A.OUT, /* 1OUT |5 10| 2RESET */ B.RESET,
A.TRIG, /* 1TRIG |6 9| 2OUT */ B.OUT,
A.GND, /* GND |7 8| 2TRIG */ B.TRIG
/* +--------------+ */
)
NETLIST_END()
NETLIST_START(destroyr)
SOLVER(Solver, 48000)
ANALOG_INPUT(V5, 5)
ANALOG_INPUT(VM5, -5)
ANALOG_INPUT(V12, 12)
ALIAS(VCC, V5)
CLOCK(H256, 15750)
CLOCK(V8, 984.375)
NET_C(VCC, H256.VCC, V8.VCC)
NET_C(GND, H256.GND, V8.GND)
NET_MODEL("LM324_M5V12V OPAMP(TYPE=3 VLH=1.1 VLL=0.11 FPF=5 UGF=50k SLEW=0.3M RI=1000k RO=50 DAB=0.00075)")
LOCAL_SOURCE(NE556_DIP)
LOCAL_SOURCE(LM324_VM5V12_DIP)
TTL_INPUT(MOTOR_SPEED, 0)
TTL_INPUT(NOISE, 0)
TTL_INPUT(ATTRACT, 0)
TTL_INPUT(SONGATE, 0)
TTL_INPUT(LAUNCH, 0)
TTL_INPUT(EXPLO, 0)
TTL_INPUT(SONLAT, 0)
TTL_INPUT(HE, 0)
TTL_INPUT(LE, 0)
NET_C(VCC, MOTOR_SPEED.VCC, NOISE.VCC, ATTRACT.VCC, SONGATE.VCC, LAUNCH.VCC, EXPLO.VCC, SONLAT.VCC, HE.VCC, LE.VCC)
NET_C(GND, MOTOR_SPEED.GND, NOISE.GND, ATTRACT.GND, SONGATE.GND, LAUNCH.GND, EXPLO.GND, SONLAT.GND, HE.GND, LE.GND)
RES(R39, 220)
RES(R40, 220)
RES(R41, RES_K(2.2))
RES(R42, RES_K(39))
RES(R43, RES_K(150))
RES(R44, 820)
RES(R54, RES_K(10))
RES(R59, RES_K(470))
RES(R60, RES_K(470))
RES(R61, RES_K(10))
RES(R62, RES_K(10))
RES(R63, RES_M(10))
RES(R64, RES_K(100))
RES(R65, RES_K(100))
RES(R66, RES_K(100))
RES(R67, RES_K(10))
RES(R68, RES_K(10))
RES(R69, RES_K(10))
RES(R70, RES_K(3.3))
RES(R71, RES_K(15))
RES(R72, RES_K(33))
RES(R73, RES_K(10))
RES(R74, RES_K(100))
RES(R75, RES_K(33))
RES(R76, RES_K(22))
RES(R77, RES_K(47))
RES(R78, RES_K(5.6))
RES(R79, RES_K(33))
RES(R80, RES_K(3.9))
RES(R81, RES_K(3.9))
RES(R82, RES_K(2.2))
RES(R83, RES_K(330))
RES(R86, 680)
RES(R88, RES_K(2.7))
RES(R89, RES_K(10))
RES(R92, RES_K(2.2))
RES(R93, RES_K(2.2))
RES(R94, RES_K(68))
POT(R95, RES_K(50))
CAP(C38, CAP_U(10))
CAP(C39, CAP_U(0.1))
CAP(C40, CAP_U(0.1))
CAP(C48, CAP_U(10))
CAP(C49, CAP_P(330))
CAP(C51, CAP_P(330))
CAP(C52, CAP_U(0.1))
CAP(C53, CAP_U(10))
CAP(C56, CAP_U(0.22))
CAP(C57, CAP_U(0.22))
CAP(C58, CAP_U(0.22))
CAP(C59, CAP_U(0.1))
CAP(C61, CAP_U(0.22))
CAP(C62, CAP_U(0.022))
CAP(C63, CAP_U(22))
CAP(C64, CAP_U(0.022))
CAP(C66, CAP_U(10))
CAP(C71, CAP_U(0.1))
CAP(C72, CAP_U(0.1))
CAP(C74, CAP_U(0.22))
//CAP(C81, CAP_U(0.1))
CAP(C85, CAP_U(22))
DIODE(CR2, "1N914")
QBJT_EB(Q4, "2N3643")
QBJT_EB(Q6, "2N3643")
TTL_7486_DIP(IC_L7)
TTL_74164_DIP(IC_L9)
TTL_74164_DIP(IC_M9)
TTL_7402_DIP(IC_K8) // Should be a 7428 positive-NOR gate
TTL_7432_DIP(IC_M8)
TTL_7400_DIP(IC_A9)
TTL_7404_DIP(IC_K9)
NET_C(VCC, IC_L9.14, IC_M9.14, IC_L7.14, IC_K8.14, IC_M8.14, IC_K9.14, IC_A9.14)
NET_C(GND, IC_L9.7, IC_M9.7, IC_L7.7, IC_K8.7, IC_M8.7, IC_K9.7, IC_A9.7)
SUBMODEL(NE556_DIP, IC_H8)
NET_C(VCC, IC_H8.14)
NET_C(GND, IC_H8.7)
MC3340_DIP(IC_D10)
NET_C(VCC, IC_D10.8)
NET_C(VM5, IC_D10.3)
CD4066_DIP(IC_E9)
NET_C(VCC, IC_E9.14)
NET_C(GND, IC_E9.7)
SUBMODEL(LM324_VM5V12_DIP, IC_C9)
SUBMODEL(LM324_VM5V12_DIP, IC_H9)
NET_C(V12, IC_C9.4, IC_H9.4)
NET_C(VM5, IC_C9.11, IC_H9.11)
// Tie off unused gates and pins
NET_C(GND, IC_L7.1, IC_L7.2)
NET_C(GND, IC_L7.4, IC_L7.5)
NET_C(GND, IC_L7.9, IC_L7.10)
NET_C(GND, IC_M8.4, IC_M8.5)
NET_C(GND, IC_M8.9, IC_M8.10)
NET_C(GND, IC_M8.12, IC_M8.13)
NET_C(GND, IC_A9.1, IC_A9.2)
NET_C(GND, IC_A9.9, IC_A9.10)
NET_C(GND, IC_A9.12, IC_A9.13)
NET_C(GND, IC_K9.1, IC_K9.5, IC_K9.9, IC_K9.11, IC_K9.13)
NET_C(GND, IC_H8.5, IC_H8.9)
NET_C(VCC, IC_H8.4, IC_H8.10)
// Noise Clock
NET_C(H256.Q, IC_K8.2)
NET_C(EXPLO.Q, IC_K8.3)
NET_C(V8.Q, IC_K8.5)
NET_C(SONLAT.Q, IC_K8.6)
NET_C(IC_K8.1, IC_M8.1)
NET_C(IC_K8.4, IC_M8.2)
ALIAS(NOISECLK, IC_M8.3)
// Noise
NET_C(NOISE.Q, IC_L9.9, IC_M9.9)
NET_C(NOISECLK, IC_L9.8, IC_M9.8)
NET_C(IC_M9.12, IC_K9.3)
NET_C(IC_K9.4, IC_L7.13)
NET_C(IC_M9.11, IC_L7.12)
ALIAS(RNOISE, IC_M9.11)
NET_C(IC_L7.11, IC_L9.1, IC_L9.2)
NET_C(IC_L9.13, IC_M9.1, IC_M9.2)
// Explosions
NET_C(SONLAT.Q, IC_K8.9)
NET_C(EXPLO.Q, IC_K8.8)
NET_C(IC_K8.10, CR2.A, R39.2, IC_K8.11)
NET_C(RNOISE, IC_K8.12)
NET_C(V5, R39.1, R68.1)
NET_C(IC_K8.13, IC_E9.5)
NET_C(CR2.K, C38.1, IC_E9.4)
NET_C(GND, C38.2, R70.2, R61.2, C48.2, R73.2, R86.2, C53.2, R67.2, Q6.E, Q4.E, C85.2)
NET_C(IC_E9.3, R74.1, IC_E9.11, R71.1)
NET_C(LE.Q, IC_E9.13)
NET_C(HE.Q, IC_E9.12)
NET_C(R71.2, C52.1, R70.1)
NET_C(C52.2, R66.1)
NET_C(R66.2, IC_H9.10, R63.1)
NET_C(IC_H9.9, R64.1, R65.1)
NET_C(IC_H9.8, R64.2, R60.1)
NET_C(R60.2, C49.1, IC_H9.6)
NET_C(C49.2, IC_H9.7, R59.1, R63.2, R72.1)
NET_C(IC_H9.5, IC_H9.3, R62.2, R61.1, C48.1)
NET_C(V12, R62.1)
NET_C(R59.2, C51.1, IC_H9.2)
NET_C(IC_H9.1, C51.2, R65.2)
NET_C(SONGATE.Q, IC_E9.6)
NET_C(R72.2, R73.1, IC_E9.8, R82.1)
NET_C(R74.2, R86.1, C71.1, C72.1)
NET_C(R68.2, R67.1, C53.1, IC_H9.12, IC_C9.3)
NET_C(C71.2, R83.1, IC_H9.13)
NET_C(C72.2, R83.2, IC_H9.14, R69.1)
NET_C(R69.2, IC_E9.1)
NET_C(IC_E9.2, R79.1, IC_C9.2)
NET_C(IC_C9.1, R79.2, C61.1)
NET_C(C61.2, R78.1)
NET_C(IC_E9.10, C57.1)
NET_C(C57.2, R77.1)
NET_C(IC_E9.9, C56.1)
NET_C(C56.2, R76.1)
// Launch
NET_C(RNOISE, IC_A9.4)
NET_C(LAUNCH.Q, IC_A9.5)
NET_C(IC_A9.6, R81.1)
NET_C(R81.2, C64.1)
NET_C(C64.2, IC_C9.9, R80.1, C62.1)
NET_C(C62.2, R80.2, IC_C9.8, C58.1)
NET_C(GND, IC_C9.10)
NET_C(C58.2, R75.1)
// Motor
NET_C(MOTOR_SPEED.Q, R44.1)
NET_C(R44.2, R40.2, IC_H8.3, IC_H8.11, C63.1)
NET_C(V5, R40.1, R41.1, R54.1, R89.1)
NET_C(R41.2, R42.1, IC_H8.1)
NET_C(R42.2, IC_H8.2, IC_H8.6, C39.1, IC_C9.5)
NET_C(R54.2, R43.1, IC_H8.13)
NET_C(R43.2, IC_H8.8, IC_H8.12, C40.1, IC_C9.12)
NET_C(C63.2, IC_C9.13, IC_C9.14, C66.2)
NET_C(GND, C39.2, C40.2)
NET_C(IC_C9.6, IC_C9.7, C59.2)
NET_C(C59.1, IC_D10.1)
NET_C(C66.1, R88.2, R89.2, IC_D10.2)
NET_C(VM5, R88.1)
NET_C(IC_D10.6, Q4.C)
NET_C(IC_D10.7, C74.1)
NET_C(C74.2, R94.1)
// Attract Mute
NET_C(ATTRACT.Q, R92.1, R93.1)
NET_C(R92.2, C85.1, Q4.B)
NET_C(R93.2, Q6.B)
NET_C(Q6.C, R82.2)
// Mixer
NET_C(GND, R95.1)
NET_C(R94.2, R75.2, R76.2, R77.2, R78.2, R95.3)
ALIAS(OUTPUT, R95.2)
// Unconnected pins
HINT(IC_A9.3, NC)
HINT(IC_A9.8, NC)
HINT(IC_A9.11, NC)
HINT(IC_K9.2, NC)
HINT(IC_K9.6, NC)
HINT(IC_K9.8, NC)
HINT(IC_K9.10, NC)
HINT(IC_K9.12, NC)
HINT(IC_L9.3, NC)
HINT(IC_L9.4, NC)
HINT(IC_L9.5, NC)
HINT(IC_L9.6, NC)
HINT(IC_L9.10, NC)
HINT(IC_L9.11, NC)
HINT(IC_L9.12, NC)
HINT(IC_M9.3, NC)
HINT(IC_M9.4, NC)
HINT(IC_M9.5, NC)
HINT(IC_M9.6, NC)
HINT(IC_M9.10, NC)
HINT(IC_M9.13, NC)
HINT(IC_L7.3, NC)
HINT(IC_L7.6, NC)
HINT(IC_L7.8, NC)
HINT(IC_M8.6, NC)
HINT(IC_M8.8, NC)
HINT(IC_M8.11, NC)
NETLIST_END()

View File

@ -0,0 +1,10 @@
// license:BSD-3-Clause
// copyright-holders:Ryan Holtz
#ifndef MAME_AUDIO_NL_DESTROYR_H
#define MAME_AUDIO_NL_DESTROYR_H
#pragma once
NETLIST_EXTERNAL(destroyr)
#endif // MAME_AUDIO_NL_DESTROYR_H

View File

@ -18,6 +18,11 @@ TODO:
#include "machine/watchdog.h"
#include "emupal.h"
#include "screen.h"
#include "speaker.h"
#include "machine/netlist.h"
#include "netlist/nl_setup.h"
#include "audio/nl_destroyr.h"
#include "destroyr.lh"
@ -25,27 +30,40 @@ TODO:
class destroyr_state : public driver_device
{
public:
destroyr_state(const machine_config &mconfig, device_type type, const char *tag) :
driver_device(mconfig, type, tag),
m_maincpu(*this, "maincpu"),
m_watchdog(*this, "watchdog"),
m_gfxdecode(*this, "gfxdecode"),
m_screen(*this, "screen"),
m_palette(*this, "palette"),
m_alpha_num_ram(*this, "alpha_nuram"),
m_major_obj_ram(*this, "major_obj_ram"),
m_minor_obj_ram(*this, "minor_obj_ram")
destroyr_state(const machine_config &mconfig, device_type type, const char *tag)
: driver_device(mconfig, type, tag)
, m_maincpu(*this, "maincpu")
, m_watchdog(*this, "watchdog")
, m_gfxdecode(*this, "gfxdecode")
, m_screen(*this, "screen")
, m_palette(*this, "palette")
, m_inputs(*this, "IN%u", 0U)
, m_paddle(*this, "PADDLE")
, m_alpha_num_ram(*this, "alpha_nuram")
, m_major_obj_ram(*this, "major_obj_ram")
, m_minor_obj_ram(*this, "minor_obj_ram")
, m_sound_motor_speed(*this, "sound_nl:motor_speed")
, m_sound_noise(*this, "sound_nl:noise")
, m_sound_attract(*this, "sound_nl:attract")
, m_sound_songate(*this, "sound_nl:songate")
, m_sound_launch(*this, "sound_nl:launch")
, m_sound_explo(*this, "sound_nl:explo")
, m_sound_sonlat(*this, "sound_nl:sonlat")
, m_sound_hexplo(*this, "sound_nl:hexplo")
, m_sound_lexplo(*this, "sound_nl:lexplo")
{ }
void destroyr(machine_config &config);
private:
virtual void machine_start() override;
virtual void machine_reset() override;
virtual void device_timer(emu_timer &timer, device_timer_id id, int param, void *ptr) override;
enum
{
TIMER_DESTROYR_DIAL,
TIMER_DESTROYR_FRAME
};
static const device_timer_id TIMER_DIAL = 0;
static const device_timer_id TIMER_FRAME = 1;
void main_map(address_map &map);
void misc_w(uint8_t data);
void cursor_load_w(uint8_t data);
@ -53,30 +71,38 @@ private:
uint8_t input_r(offs_t offset);
uint8_t scanline_r();
void destroyr_palette(palette_device &palette) const;
void palette_init(palette_device &palette) const;
uint32_t screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
TIMER_CALLBACK_MEMBER(dial_callback);
TIMER_CALLBACK_MEMBER(frame_callback);
virtual void machine_start() override;
virtual void machine_reset() override;
virtual void device_timer(emu_timer &timer, device_timer_id id, int param, void *ptr) override;
void destroyr_map(address_map &map);
/* devices */
required_device<cpu_device> m_maincpu;
required_device<watchdog_timer_device> m_watchdog;
required_device<gfxdecode_device> m_gfxdecode;
required_device<screen_device> m_screen;
required_device<palette_device> m_palette;
required_ioport_array<3> m_inputs;
required_ioport m_paddle;
/* memory pointers */
required_shared_ptr<uint8_t> m_alpha_num_ram;
required_shared_ptr<uint8_t> m_major_obj_ram;
required_shared_ptr<uint8_t> m_minor_obj_ram;
/* audio triggers */
required_device<netlist_mame_logic_input_device> m_sound_motor_speed;
required_device<netlist_mame_logic_input_device> m_sound_noise;
required_device<netlist_mame_logic_input_device> m_sound_attract;
required_device<netlist_mame_logic_input_device> m_sound_songate;
required_device<netlist_mame_logic_input_device> m_sound_launch;
required_device<netlist_mame_logic_input_device> m_sound_explo;
required_device<netlist_mame_logic_input_device> m_sound_sonlat;
required_device<netlist_mame_logic_input_device> m_sound_hexplo;
required_device<netlist_mame_logic_input_device> m_sound_lexplo;
/* video-related */
int m_cursor;
int m_wavemod;
@ -85,8 +111,6 @@ private:
int m_potmask[2];
int m_potsense[2];
int m_attract;
int m_motor_speed;
int m_noise;
emu_timer *m_dial_timer;
emu_timer *m_frame_timer;
};
@ -94,12 +118,10 @@ private:
uint32_t destroyr_state::screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect)
{
int i, j;
bitmap.fill(0, cliprect);
/* draw major objects */
for (i = 0; i < 16; i++)
for (int i = 0; i < 16; i++)
{
int attr = m_major_obj_ram[2 * i + 0] ^ 0xff;
int horz = m_major_obj_ram[2 * i + 1];
@ -123,9 +145,9 @@ uint32_t destroyr_state::screen_update(screen_device &screen, bitmap_ind16 &bitm
}
/* draw alpha numerics */
for (i = 0; i < 8; i++)
for (int i = 0; i < 8; i++)
{
for (j = 0; j < 32; j++)
for (int j = 0; j < 32; j++)
{
int num = m_alpha_num_ram[32 * i + j];
@ -134,7 +156,7 @@ uint32_t destroyr_state::screen_update(screen_device &screen, bitmap_ind16 &bitm
}
/* draw minor objects */
for (i = 0; i < 2; i++)
for (int i = 0; i < 2; i++)
{
int num = i << 4 | (m_minor_obj_ram[i + 0] & 0xf);
int horz = 256 - m_minor_obj_ram[i + 2];
@ -144,13 +166,13 @@ uint32_t destroyr_state::screen_update(screen_device &screen, bitmap_ind16 &bitm
}
/* draw waves */
for (i = 0; i < 4; i++)
for (int i = 0; i < 4; i++)
{
m_gfxdecode->gfx(3)->transpen(bitmap,cliprect, m_wavemod ? 1 : 0, 0, 0, 0, 64 * i, 0x4e, 0);
}
/* draw cursor */
for (i = 0; i < 256; i++)
for (int i = 0; i < 256; i++)
{
if (i & 4)
bitmap.pix16(m_cursor ^ 0xff, i) = 7;
@ -163,10 +185,10 @@ void destroyr_state::device_timer(emu_timer &timer, device_timer_id id, int para
{
switch (id)
{
case TIMER_DESTROYR_DIAL:
case TIMER_DIAL:
dial_callback(ptr, param);
break;
case TIMER_DESTROYR_FRAME:
case TIMER_FRAME:
frame_callback(ptr, param);
break;
default:
@ -201,7 +223,7 @@ TIMER_CALLBACK_MEMBER(destroyr_state::frame_callback)
m_potsense[1] = 0;
/* PCB supports two dials, but cab has only got one */
m_dial_timer->adjust(m_screen->time_until_pos(ioport("PADDLE")->read()));
m_dial_timer->adjust(m_screen->time_until_pos(m_paddle->read()));
m_frame_timer->adjust(m_screen->time_until_pos(0));
}
@ -217,20 +239,19 @@ void destroyr_state::machine_reset()
m_potsense[0] = 0;
m_potsense[1] = 0;
m_attract = 0;
m_motor_speed = 0;
m_noise = 0;
}
void destroyr_state::misc_w(uint8_t data)
{
/* bits 0 to 2 connect to the sound circuits */
m_attract = data & 0x01;
m_noise = data & 0x02;
m_motor_speed = data & 0x04;
m_potmask[0] = data & 0x08;
m_wavemod = data & 0x10;
m_potmask[1] = data & 0x20;
m_attract = BIT(data, 0);
m_sound_attract->write(m_attract);
m_sound_noise->write(BIT(data, 1));
m_sound_motor_speed->write(BIT(data, 2));
m_potmask[0] = BIT(data, 3);
m_wavemod = BIT(data, 4);
m_potmask[1] = BIT(data, 5);
machine().bookkeeping().coin_lockout_w(0, !m_attract);
machine().bookkeeping().coin_lockout_w(1, !m_attract);
@ -254,18 +275,14 @@ uint8_t destroyr_state::input_r(offs_t offset)
{
if (offset & 1)
{
return ioport("IN1")->read();
return m_inputs[1]->read();
}
else
{
uint8_t ret = ioport("IN0")->read();
if (m_potsense[0] && m_potmask[0])
ret |= 4;
if (m_potsense[1] && m_potmask[1])
ret |= 8;
uint8_t ret = m_inputs[0]->read();
ret |= (m_potsense[0] && m_potmask[0]) ? (1 << 2) : 0;
ret |= (m_potsense[1] && m_potmask[1]) ? (1 << 3) : 0;
return ret;
}
}
@ -277,7 +294,7 @@ uint8_t destroyr_state::scanline_r()
}
void destroyr_state::destroyr_map(address_map &map)
void destroyr_state::main_map(address_map &map)
{
map.global_mask(0x7fff);
map(0x0000, 0x00ff).mirror(0xf00).ram();
@ -438,7 +455,7 @@ static GFXDECODE_START( gfx_destroyr )
GFXDECODE_END
void destroyr_state::destroyr_palette(palette_device &palette) const
void destroyr_state::palette_init(palette_device &palette) const
{
palette.set_pen_color(0, rgb_t(0x00, 0x00, 0x00)); // major objects
palette.set_pen_color(1, rgb_t(0x50, 0x50, 0x50));
@ -453,14 +470,12 @@ void destroyr_state::destroyr_palette(palette_device &palette) const
void destroyr_state::machine_start()
{
m_dial_timer = timer_alloc(TIMER_DESTROYR_DIAL);
m_frame_timer = timer_alloc(TIMER_DESTROYR_FRAME);
m_dial_timer = timer_alloc(TIMER_DIAL);
m_frame_timer = timer_alloc(TIMER_FRAME);
save_item(NAME(m_cursor));
save_item(NAME(m_wavemod));
save_item(NAME(m_attract));
save_item(NAME(m_motor_speed));
save_item(NAME(m_noise));
save_item(NAME(m_potmask));
save_item(NAME(m_potsense));
}
@ -469,18 +484,18 @@ void destroyr_state::destroyr(machine_config &config)
{
/* basic machine hardware */
M6800(config, m_maincpu, XTAL(12'096'000) / 16);
m_maincpu->set_addrmap(AS_PROGRAM, &destroyr_state::destroyr_map);
m_maincpu->set_addrmap(AS_PROGRAM, &destroyr_state::main_map);
m_maincpu->set_periodic_int(FUNC(destroyr_state::irq0_line_assert), attotime::from_hz(4*60));
f9334_device &outlatch(F9334(config, "outlatch")); // F8
outlatch.q_out_cb<0>().set_output("led0").invert(); // LED 1
outlatch.q_out_cb<1>().set_output("led1").invert(); // LED 2 (no second LED present on cab)
// Q2 => songate
// Q3 => launch
// Q4 => explosion
// Q5 => sonar
// Q6 => high explosion
// Q7 => low explosion
outlatch.q_out_cb<2>().set(m_sound_songate, FUNC(netlist_mame_logic_input_device::write));
outlatch.q_out_cb<3>().set(m_sound_launch, FUNC(netlist_mame_logic_input_device::write));
outlatch.q_out_cb<4>().set(m_sound_explo, FUNC(netlist_mame_logic_input_device::write));
outlatch.q_out_cb<5>().set(m_sound_sonlat, FUNC(netlist_mame_logic_input_device::write));
outlatch.q_out_cb<6>().set(m_sound_hexplo, FUNC(netlist_mame_logic_input_device::write));
outlatch.q_out_cb<7>().set(m_sound_lexplo, FUNC(netlist_mame_logic_input_device::write));
WATCHDOG_TIMER(config, m_watchdog);
@ -493,9 +508,26 @@ void destroyr_state::destroyr(machine_config &config)
m_screen->set_palette(m_palette);
GFXDECODE(config, m_gfxdecode, m_palette, gfx_destroyr);
PALETTE(config, m_palette, FUNC(destroyr_state::destroyr_palette), 8);
PALETTE(config, m_palette, FUNC(destroyr_state::palette_init), 8);
/* sound hardware */
SPEAKER(config, "mono").front_center();
NETLIST_SOUND(config, "sound_nl", 48000)
.set_source(NETLIST_NAME(destroyr))
.add_route(ALL_OUTPUTS, "mono", 1.0);
NETLIST_LOGIC_INPUT(config, "sound_nl:motor_speed", "MOTOR_SPEED.IN", 0);
NETLIST_LOGIC_INPUT(config, "sound_nl:noise", "NOISE.IN", 0);
NETLIST_LOGIC_INPUT(config, "sound_nl:attract", "ATTRACT.IN", 0);
NETLIST_LOGIC_INPUT(config, "sound_nl:songate", "SONGATE.IN", 0);
NETLIST_LOGIC_INPUT(config, "sound_nl:launch", "LAUNCH.IN", 0);
NETLIST_LOGIC_INPUT(config, "sound_nl:explo", "EXPLO.IN", 0);
NETLIST_LOGIC_INPUT(config, "sound_nl:sonlat", "SONLAT.IN", 0);
NETLIST_LOGIC_INPUT(config, "sound_nl:hexplo", "HE.IN", 0);
NETLIST_LOGIC_INPUT(config, "sound_nl:lexplo", "LE.IN", 0);
NETLIST_STREAM_OUTPUT(config, "sound_nl:cout0", 0, "OUTPUT").set_mult_offset(32767.0, 0.0);
}
@ -549,5 +581,5 @@ ROM_START( destroyr1 )
ROM_END
GAMEL( 1977, destroyr, 0, destroyr, destroyr, destroyr_state, empty_init, ORIENTATION_FLIP_X, "Atari", "Destroyer (version O2)", MACHINE_NO_SOUND | MACHINE_SUPPORTS_SAVE, layout_destroyr )
GAMEL( 1977, destroyr1, destroyr, destroyr, destroyr, destroyr_state, empty_init, ORIENTATION_FLIP_X, "Atari", "Destroyer (version O1)", MACHINE_NO_SOUND | MACHINE_SUPPORTS_SAVE, layout_destroyr )
GAMEL( 1977, destroyr, 0, destroyr, destroyr, destroyr_state, empty_init, ORIENTATION_FLIP_X, "Atari", "Destroyer (version O2)", MACHINE_SUPPORTS_SAVE, layout_destroyr )
GAMEL( 1977, destroyr1, destroyr, destroyr, destroyr, destroyr_state, empty_init, ORIENTATION_FLIP_X, "Atari", "Destroyer (version O1)", MACHINE_SUPPORTS_SAVE, layout_destroyr )