snk6502, trackfld: Eliminate machine().device, remove some tag lookups, added more device finders, nw

This commit is contained in:
mooglyguy 2018-06-01 15:56:11 +02:00
parent dabbd32a62
commit 9c34fccdee
12 changed files with 256 additions and 283 deletions

View File

@ -15,9 +15,6 @@
#include "emu.h" #include "emu.h"
#include "audio/snk6502.h" #include "audio/snk6502.h"
#include "sound/sn76477.h"
#ifndef M_LN2 #ifndef M_LN2
#define M_LN2 0.69314718055994530942 #define M_LN2 0.69314718055994530942
#endif #endif
@ -133,14 +130,15 @@ DEFINE_DEVICE_TYPE(SNK6502, snk6502_sound_device, "snk6502_sound", "SNK6502 Cust
snk6502_sound_device::snk6502_sound_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) snk6502_sound_device::snk6502_sound_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock)
: device_t(mconfig, SNK6502, tag, owner, clock), : device_t(mconfig, SNK6502, tag, owner, clock),
device_sound_interface(mconfig, *this), device_sound_interface(mconfig, *this),
//m_tone_channels[CHANNELS],
m_tone_clock_expire(0), m_tone_clock_expire(0),
m_tone_clock(0), m_tone_clock(0),
m_tone_stream(nullptr), m_tone_stream(nullptr),
m_sn76477_2(*this, ":sn76477.2"),
m_discrete(*this, ":discrete"),
m_samples(*this, ":samples"), m_samples(*this, ":samples"),
m_ROM(nullptr), m_rom(*this, ":snk6502"),
m_Sound0StopOnRollover(0), m_sound0_stop_on_rollover(0),
m_LastPort1(0), m_last_port1(0),
m_hd38880_cmd(0), m_hd38880_cmd(0),
m_hd38880_addr(0), m_hd38880_addr(0),
m_hd38880_data_bytes(0), m_hd38880_data_bytes(0),
@ -155,8 +153,6 @@ snk6502_sound_device::snk6502_sound_device(const machine_config &mconfig, const
void snk6502_sound_device::device_start() void snk6502_sound_device::device_start()
{ {
m_ROM = machine().root_device().memregion("snk6502")->base();
// adjusted // adjusted
set_music_freq(43000); set_music_freq(43000);
@ -165,7 +161,7 @@ void snk6502_sound_device::device_start()
m_tone_stream = machine().sound().stream_alloc(*this, 0, 1, SAMPLE_RATE); m_tone_stream = machine().sound().stream_alloc(*this, 0, 1, SAMPLE_RATE);
for (int i = 0; i < CHANNELS; i++) for (int i = 0; i < NUM_CHANNELS; i++)
{ {
save_item(NAME(m_tone_channels[i].mute), i); save_item(NAME(m_tone_channels[i].mute), i);
save_item(NAME(m_tone_channels[i].offset), i); save_item(NAME(m_tone_channels[i].offset), i);
@ -177,8 +173,8 @@ void snk6502_sound_device::device_start()
} }
save_item(NAME(m_tone_clock)); save_item(NAME(m_tone_clock));
save_item(NAME(m_Sound0StopOnRollover)); save_item(NAME(m_sound0_stop_on_rollover));
save_item(NAME(m_LastPort1)); save_item(NAME(m_last_port1));
save_item(NAME(m_hd38880_cmd)); save_item(NAME(m_hd38880_cmd));
save_item(NAME(m_hd38880_addr)); save_item(NAME(m_hd38880_addr));
save_item(NAME(m_hd38880_data_bytes)); save_item(NAME(m_hd38880_data_bytes));
@ -189,7 +185,7 @@ inline void snk6502_sound_device::validate_tone_channel(int channel)
{ {
if (!m_tone_channels[channel].mute) if (!m_tone_channels[channel].mute)
{ {
uint8_t romdata = m_ROM[m_tone_channels[channel].base + m_tone_channels[channel].offset]; uint8_t romdata = m_rom->base()[m_tone_channels[channel].base + m_tone_channels[channel].offset];
if (romdata != 0xff) if (romdata != 0xff)
m_tone_channels[channel].sample_step = m_tone_channels[channel].sample_rate / (256 - romdata); m_tone_channels[channel].sample_step = m_tone_channels[channel].sample_rate / (256 - romdata);
@ -200,164 +196,105 @@ inline void snk6502_sound_device::validate_tone_channel(int channel)
void snk6502_sound_device::sasuke_build_waveform(int mask) void snk6502_sound_device::sasuke_build_waveform(int mask)
{ {
int bit0, bit1, bit2, bit3; const int bit0 = BIT(mask, 0);
int base; const int bit1 = BIT(mask, 1);
int i; const int bit2 = 1;
const int bit3 = BIT(mask, 2);
const int base = (bit0 + bit1 + bit2 + bit3 + 1) / 2;
mask &= 7; for (int i = 0; i < 16; i++)
//logerror("0: wave form = %d\n", mask);
bit0 = bit1 = bit3 = 0;
bit2 = 1;
if (mask & 1)
bit0 = 1;
if (mask & 2)
bit1 = 1;
if (mask & 4)
bit3 = 1;
base = (bit0 + bit1 + bit2 + bit3 + 1) / 2;
for (i = 0; i < 16; i++)
{ {
int data = 0; const int data = (bit0 & BIT(i, 0)) + (bit1 & BIT(i, 1)) + (bit2 & BIT(i, 2)) + (bit3 & BIT(i, 3));
if (i & 1)
data += bit0;
if (i & 2)
data += bit1;
if (i & 4)
data += bit2;
if (i & 8)
data += bit3;
//logerror(" %3d\n", data);
m_tone_channels[0].form[i] = data - base; m_tone_channels[0].form[i] = data - base;
} }
for (i = 0; i < 16; i++) for (int i = 0; i < 16; i++)
m_tone_channels[0].form[i] *= 65535 / 16; m_tone_channels[0].form[i] *= 65535 / 16;
} }
void snk6502_sound_device::satansat_build_waveform(int mask) void snk6502_sound_device::satansat_build_waveform(int mask)
{ {
int bit0, bit1, bit2, bit3;
int base;
int i;
mask &= 7;
//logerror("1: wave form = %d\n", mask); //logerror("1: wave form = %d\n", mask);
bit0 = bit1 = bit2 = 1; const int bit0 = 1;
bit3 = 0; const int bit1 = 1;
const int bit2 = 1;
const int bit3 = BIT(mask, 0);
const int base = (bit0 + bit1 + bit2 + bit3 + 1) / 2;
if (mask & 1) for (int i = 0; i < 16; i++)
bit3 = 1;
base = (bit0 + bit1 + bit2 + bit3 + 1) / 2;
for (i = 0; i < 16; i++)
{ {
int data = 0; const int data = (bit0 & BIT(i, 0)) + (bit1 & BIT(i, 1)) + (bit2 & BIT(i, 2)) + (bit3 & BIT(i, 3));
if (i & 1)
data += bit0;
if (i & 2)
data += bit1;
if (i & 4)
data += bit2;
if (i & 8)
data += bit3;
//logerror(" %3d\n", data);
m_tone_channels[1].form[i] = data - base; m_tone_channels[1].form[i] = data - base;
} }
for (i = 0; i < 16; i++) for (int i = 0; i < 16; i++)
m_tone_channels[1].form[i] *= 65535 / 16; m_tone_channels[1].form[i] *= 65535 / 16;
} }
void snk6502_sound_device::build_waveform(int channel, int mask) void snk6502_sound_device::build_waveform(int channel, int mask)
{ {
int bit0, bit1, bit2, bit3;
int base;
int i;
mask &= 15;
//logerror("%d: wave form = %d\n", channel, mask); //logerror("%d: wave form = %d\n", channel, mask);
bit0 = bit1 = bit2 = bit3 = 0; int bit0 = 0;
int bit1 = 0;
int bit2 = 0;
int bit3 = 0;
// bit 3 // bit 3
if (mask & (1 | 2)) if (BIT(mask, 0) || BIT(mask, 1))
bit3 = 8; bit3 = 8;
else if (mask & 4) else if (BIT(mask, 2))
bit3 = 4; bit3 = 4;
else if (mask & 8) else if (BIT(mask, 8))
bit3 = 2; bit3 = 2;
// bit 2 // bit 2
if (mask & 4) if (BIT(mask, 2))
bit2 = 8; bit2 = 8;
else if (mask & (2 | 8)) else if (BIT(mask, 1) || BIT(mask, 3))
bit2 = 4; bit2 = 4;
// bit 1 // bit 1
if (mask & 8) if (BIT(mask, 3))
bit1 = 8; bit1 = 8;
else if (mask & 4) else if (BIT(mask, 2))
bit1 = 4; bit1 = 4;
else if (mask & 2) else if (BIT(mask, 1))
bit1 = 2; bit1 = 2;
// bit 0 // bit 0
bit0 = bit1 / 2; bit0 = bit1 >> 1;
if (bit0 + bit1 + bit2 + bit3 < 16) if (bit0 + bit1 + bit2 + bit3 < 16)
{ {
bit0 *= 2; bit0 <<= 1;
bit1 *= 2; bit1 <<= 1;
bit2 *= 2; bit2 <<= 1;
bit3 *= 2; bit3 <<= 1;
} }
base = (bit0 + bit1 + bit2 + bit3 + 1) / 2; const int base = (bit0 + bit1 + bit2 + bit3 + 1) / 2;
for (i = 0; i < 16; i++) for (int i = 0; i < 16; i++)
{ {
/* special channel for fantasy */ /* special channel for fantasy */
if (channel == 2) if (channel == 2)
{ {
m_tone_channels[channel].form[i] = (i & 8) ? 7 : -8; m_tone_channels[channel].form[i] = BIT(i, 3) ? 7 : -8;
} }
else else
{ {
int data = 0; const int data = (bit0 & BIT(i, 0)) + (bit1 & BIT(i, 1)) + (bit2 & BIT(i, 2)) + (bit3 & BIT(i, 3));
if (i & 1)
data += bit0;
if (i & 2)
data += bit1;
if (i & 4)
data += bit2;
if (i & 8)
data += bit3;
//logerror(" %3d\n", data);
m_tone_channels[channel].form[i] = data - base; m_tone_channels[channel].form[i] = data - base;
} }
} }
for (i = 0; i < 16; i++) for (int i = 0; i < 16; i++)
m_tone_channels[channel].form[i] *= 65535 / 160; m_tone_channels[channel].form[i] *= 65535 / 160;
} }
void snk6502_sound_device::set_music_freq(int freq) void snk6502_sound_device::set_music_freq(int freq)
{ {
int i; for (int i = 0; i < NUM_CHANNELS; i++)
for (i = 0; i < CHANNELS; i++)
{ {
m_tone_channels[i].mute = 1; m_tone_channels[i].mute = 1;
m_tone_channels[i].offset = 0; m_tone_channels[i].offset = 0;
@ -401,25 +338,25 @@ WRITE8_MEMBER( snk6502_sound_device::sasuke_sound_w )
7 reset counter 7 reset counter
*/ */
if ((~data & 0x01) && (m_LastPort1 & 0x01)) if ((~data & 0x01) && (m_last_port1 & 0x01))
m_samples->start(0, 0); m_samples->start(0, 0);
if ((~data & 0x02) && (m_LastPort1 & 0x02)) if ((~data & 0x02) && (m_last_port1 & 0x02))
m_samples->start(1, 1); m_samples->start(1, 1);
if ((~data & 0x04) && (m_LastPort1 & 0x04)) if ((~data & 0x04) && (m_last_port1 & 0x04))
m_samples->start(2, 2); m_samples->start(2, 2);
if ((~data & 0x08) && (m_LastPort1 & 0x08)) if ((~data & 0x08) && (m_last_port1 & 0x08))
m_samples->start(3, 3); m_samples->start(3, 3);
if ((data & 0x80) && (~m_LastPort1 & 0x80)) if ((data & 0x80) && (~m_last_port1 & 0x80))
{ {
m_tone_channels[0].offset = 0; m_tone_channels[0].offset = 0;
m_tone_channels[0].mute = 0; m_tone_channels[0].mute = 0;
} }
if ((~data & 0x80) && (m_LastPort1 & 0x80)) if ((~data & 0x80) && (m_last_port1 & 0x80))
m_tone_channels[0].mute = 1; m_tone_channels[0].mute = 1;
m_LastPort1 = data; m_last_port1 = data;
break; break;
case 1: case 1:
@ -440,7 +377,7 @@ WRITE8_MEMBER( snk6502_sound_device::sasuke_sound_w )
m_tone_channels[0].base = 0x0000 + ((data & 0x70) << 4); m_tone_channels[0].base = 0x0000 + ((data & 0x70) << 4);
m_tone_channels[0].mask = 0xff; m_tone_channels[0].mask = 0xff;
m_Sound0StopOnRollover = 1; m_sound0_stop_on_rollover = 1;
/* bit 1-3 sound0 waveform control */ /* bit 1-3 sound0 waveform control */
sasuke_build_waveform((data & 0x0e) >> 1); sasuke_build_waveform((data & 0x0e) >> 1);
@ -463,7 +400,7 @@ WRITE8_MEMBER( snk6502_sound_device::satansat_sound_w )
/* bit 1 = to 76477 */ /* bit 1 = to 76477 */
/* bit 2 = analog sound trigger */ /* bit 2 = analog sound trigger */
if (data & 0x04 && !(m_LastPort1 & 0x04)) if (data & 0x04 && !(m_last_port1 & 0x04))
m_samples->start(0, 1); m_samples->start(0, 1);
if (data & 0x08) if (data & 0x08)
@ -478,7 +415,7 @@ WRITE8_MEMBER( snk6502_sound_device::satansat_sound_w )
/* bit 7 sound1 waveform control */ /* bit 7 sound1 waveform control */
satansat_build_waveform((data & 0x80) >> 7); satansat_build_waveform((data & 0x80) >> 7);
m_LastPort1 = data; m_last_port1 = data;
break; break;
case 1: case 1:
/* /*
@ -492,7 +429,7 @@ WRITE8_MEMBER( snk6502_sound_device::satansat_sound_w )
m_tone_channels[1].base = 0x0800 + ((data & 0x60) << 4); m_tone_channels[1].base = 0x0800 + ((data & 0x60) << 4);
m_tone_channels[1].mask = 0x1ff; m_tone_channels[1].mask = 0x1ff;
m_Sound0StopOnRollover = 1; m_sound0_stop_on_rollover = 1;
if (data & 0x01) if (data & 0x01)
m_tone_channels[0].mute = 0; m_tone_channels[0].mute = 0;
@ -532,17 +469,17 @@ WRITE8_MEMBER( snk6502_sound_device::vanguard_sound_w )
m_tone_channels[0].base = ((data & 0x07) << 8); m_tone_channels[0].base = ((data & 0x07) << 8);
m_tone_channels[0].mask = 0xff; m_tone_channels[0].mask = 0xff;
m_Sound0StopOnRollover = 1; m_sound0_stop_on_rollover = 1;
/* play noise samples requested by sound command byte */ /* play noise samples requested by sound command byte */
/* SHOT A */ /* SHOT A */
if (data & 0x20 && !(m_LastPort1 & 0x20)) if (data & 0x20 && !(m_last_port1 & 0x20))
m_samples->start(1, 0); m_samples->start(1, 0);
else if (!(data & 0x20) && m_LastPort1 & 0x20) else if (!(data & 0x20) && m_last_port1 & 0x20)
m_samples->stop(1); m_samples->stop(1);
/* BOMB */ /* BOMB */
if (data & 0x80 && !(m_LastPort1 & 0x80)) if (data & 0x80 && !(m_last_port1 & 0x80))
m_samples->start(2, 1); m_samples->start(2, 1);
if (data & 0x08) if (data & 0x08)
@ -557,9 +494,9 @@ WRITE8_MEMBER( snk6502_sound_device::vanguard_sound_w )
} }
/* SHOT B */ /* SHOT B */
machine().device<sn76477_device>("sn76477.2")->enable_w((data & 0x40) ? 0 : 1); m_sn76477_2->enable_w((data & 0x40) ? 0 : 1);
m_LastPort1 = data; m_last_port1 = data;
break; break;
case 1: case 1:
/* /*
@ -628,7 +565,7 @@ WRITE8_MEMBER( snk6502_sound_device::fantasy_sound_w )
m_tone_channels[0].base = 0x0000 + ((data & 0x07) << 8); m_tone_channels[0].base = 0x0000 + ((data & 0x07) << 8);
m_tone_channels[0].mask = 0xff; m_tone_channels[0].mask = 0xff;
m_Sound0StopOnRollover = 0; m_sound0_stop_on_rollover = 0;
if (data & 0x08) if (data & 0x08)
m_tone_channels[0].mute = 0; m_tone_channels[0].mute = 0;
@ -647,9 +584,9 @@ WRITE8_MEMBER( snk6502_sound_device::fantasy_sound_w )
} }
/* BOMB */ /* BOMB */
machine().device<discrete_device>("discrete")->write(space, FANTASY_BOMB_EN, data & 0x80); m_discrete->write(space, FANTASY_BOMB_EN, data & 0x80);
m_LastPort1 = data; m_last_port1 = data;
break; break;
case 1: case 1:
/* /*
@ -769,9 +706,7 @@ void snk6502_sound_device::speech_w(uint8_t data, const uint16_t *table, int sta
if (m_hd38880_data_bytes == 5 && !m_samples->playing(0)) if (m_hd38880_data_bytes == 5 && !m_samples->playing(0))
{ {
int i; for (int i = 0; i < 16; i++)
for (i = 0; i < 16; i++)
{ {
if (table[i] && table[i] == m_hd38880_addr) if (table[i] && table[i] == m_hd38880_addr)
{ {
@ -940,31 +875,29 @@ void snk6502_sound_device::sound_stream_update(sound_stream &stream, stream_samp
{ {
stream_sample_t *buffer = outputs[0]; stream_sample_t *buffer = outputs[0];
int i; for (int i = 0; i < NUM_CHANNELS; i++)
for (i = 0; i < CHANNELS; i++)
validate_tone_channel(i); validate_tone_channel(i);
while (samples-- > 0) while (samples-- > 0)
{ {
int32_t data = 0; int32_t data = 0;
for (i = 0; i < CHANNELS; i++) for (int i = 0; i < NUM_CHANNELS; i++)
{ {
TONE *voice = &m_tone_channels[i]; tone_t &voice = m_tone_channels[i];
int16_t *form = voice->form; int16_t *form = voice.form;
if (!voice->mute && voice->sample_step) if (!voice.mute && voice.sample_step)
{ {
int cur_pos = voice->sample_cur + voice->sample_step; int cur_pos = voice.sample_cur + voice.sample_step;
int prev = form[(voice->sample_cur >> FRAC_BITS) & 15]; int prev = form[(voice.sample_cur >> FRAC_BITS) & 15];
int cur = form[(cur_pos >> FRAC_BITS) & 15]; int cur = form[(cur_pos >> FRAC_BITS) & 15];
/* interpolate */ /* interpolate */
data += ((int32_t)prev * (FRAC_ONE - (cur_pos & FRAC_MASK)) data += ((int32_t)prev * (FRAC_ONE - (cur_pos & FRAC_MASK))
+ (int32_t)cur * (cur_pos & FRAC_MASK)) >> FRAC_BITS; + (int32_t)cur * (cur_pos & FRAC_MASK)) >> FRAC_BITS;
voice->sample_cur = cur_pos; voice.sample_cur = cur_pos;
} }
} }
@ -973,7 +906,7 @@ void snk6502_sound_device::sound_stream_update(sound_stream &stream, stream_samp
m_tone_clock += FRAC_ONE; m_tone_clock += FRAC_ONE;
if (m_tone_clock >= m_tone_clock_expire) if (m_tone_clock >= m_tone_clock_expire)
{ {
for (i = 0; i < CHANNELS; i++) for (int i = 0; i < NUM_CHANNELS; i++)
{ {
m_tone_channels[i].offset++; m_tone_channels[i].offset++;
m_tone_channels[i].offset &= m_tone_channels[i].mask; m_tone_channels[i].offset &= m_tone_channels[i].mask;
@ -981,7 +914,7 @@ void snk6502_sound_device::sound_stream_update(sound_stream &stream, stream_samp
validate_tone_channel(i); validate_tone_channel(i);
} }
if (m_tone_channels[0].offset == 0 && m_Sound0StopOnRollover) if (m_tone_channels[0].offset == 0 && m_sound0_stop_on_rollover)
m_tone_channels[0].mute = 1; m_tone_channels[0].mute = 1;
m_tone_clock -= m_tone_clock_expire; m_tone_clock -= m_tone_clock_expire;

View File

@ -12,7 +12,7 @@
#include "sound/discrete.h" #include "sound/discrete.h"
#include "sound/samples.h" #include "sound/samples.h"
#include "sound/sn76477.h"
class snk6502_sound_device : public device_t, public device_sound_interface class snk6502_sound_device : public device_t, public device_sound_interface
{ {
@ -38,9 +38,9 @@ protected:
virtual void sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples) override; virtual void sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples) override;
private: private:
static constexpr unsigned CHANNELS = 3; static constexpr unsigned NUM_CHANNELS = 3;
struct TONE struct tone_t
{ {
int mute; int mute;
int offset; int offset;
@ -53,15 +53,17 @@ private:
}; };
// internal state // internal state
TONE m_tone_channels[CHANNELS]; tone_t m_tone_channels[NUM_CHANNELS];
int32_t m_tone_clock_expire; int32_t m_tone_clock_expire;
int32_t m_tone_clock; int32_t m_tone_clock;
sound_stream * m_tone_stream; sound_stream * m_tone_stream;
optional_device<sn76477_device> m_sn76477_2;
optional_device<discrete_device> m_discrete;
optional_device<samples_device> m_samples; optional_device<samples_device> m_samples;
uint8_t *m_ROM; required_memory_region m_rom;
int m_Sound0StopOnRollover; int m_sound0_stop_on_rollover;
uint8_t m_LastPort1; uint8_t m_last_port1;
int m_hd38880_cmd; int m_hd38880_cmd;
uint32_t m_hd38880_addr; uint32_t m_hd38880_addr;

View File

@ -16,6 +16,8 @@ DEFINE_DEVICE_TYPE(TRACKFLD_AUDIO, trackfld_audio_device, "trackfld_audio", "Tra
trackfld_audio_device::trackfld_audio_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) trackfld_audio_device::trackfld_audio_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock)
: device_t(mconfig, TRACKFLD_AUDIO, tag, owner, clock) : device_t(mconfig, TRACKFLD_AUDIO, tag, owner, clock)
, device_sound_interface(mconfig, *this) , device_sound_interface(mconfig, *this)
, m_audiocpu(*this, finder_base::DUMMY_TAG)
, m_vlm(*this, finder_base::DUMMY_TAG)
, m_last_addr(0) , m_last_addr(0)
, m_last_irq(0) , m_last_irq(0)
{ {
@ -27,9 +29,6 @@ trackfld_audio_device::trackfld_audio_device(const machine_config &mconfig, cons
void trackfld_audio_device::device_start() void trackfld_audio_device::device_start()
{ {
m_audiocpu = machine().device<cpu_device>("audiocpu");
m_vlm = machine().device<vlm5030_device>("vlm");
/* sound */ /* sound */
save_item(NAME(m_last_addr)); save_item(NAME(m_last_addr));
save_item(NAME(m_last_irq)); save_item(NAME(m_last_irq));
@ -58,7 +57,7 @@ void trackfld_audio_device::device_reset()
READ8_MEMBER( trackfld_audio_device::trackfld_sh_timer_r ) READ8_MEMBER( trackfld_audio_device::trackfld_sh_timer_r )
{ {
uint32_t clock = machine().device<cpu_device>("audiocpu")->total_cycles() / TIMER_RATE; uint32_t clock = m_audiocpu->total_cycles() / TIMER_RATE;
return clock & 0xF; return clock & 0xF;
} }

View File

@ -11,6 +11,14 @@
class trackfld_audio_device : public device_t, public device_sound_interface class trackfld_audio_device : public device_t, public device_sound_interface
{ {
public: public:
template <typename T, typename U>
trackfld_audio_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock, T &&cpu_tag, U &&vlm_tag)
: trackfld_audio_device(mconfig, tag, owner, clock)
{
m_audiocpu.set_tag(std::forward<T>(cpu_tag));
m_vlm.set_tag(std::forward<U>(vlm_tag));
}
trackfld_audio_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); trackfld_audio_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock);
DECLARE_WRITE_LINE_MEMBER(sh_irqtrigger_w); DECLARE_WRITE_LINE_MEMBER(sh_irqtrigger_w);
@ -29,12 +37,12 @@ protected:
virtual void sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples) override; virtual void sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples) override;
private: private:
optional_device<cpu_device> m_audiocpu;
optional_device<vlm5030_device> m_vlm;
// internal state // internal state
int m_last_addr; int m_last_addr;
int m_last_irq; int m_last_irq;
cpu_device *m_audiocpu;
vlm5030_device *m_vlm;
}; };
DECLARE_DEVICE_TYPE(TRACKFLD_AUDIO, trackfld_audio_device) DECLARE_DEVICE_TYPE(TRACKFLD_AUDIO, trackfld_audio_device)

View File

@ -12,7 +12,6 @@ Based on drivers from Juno First emulator by Chris Hardy (chrish@kcbbs.gen.nz)
#include "includes/hyperspt.h" #include "includes/hyperspt.h"
#include "includes/konamipt.h" #include "includes/konamipt.h"
#include "audio/hyprolyb.h" #include "audio/hyprolyb.h"
#include "audio/trackfld.h"
#include "cpu/m6800/m6800.h" #include "cpu/m6800/m6800.h"
#include "cpu/m6809/m6809.h" #include "cpu/m6809/m6809.h"
@ -22,10 +21,8 @@ Based on drivers from Juno First emulator by Chris Hardy (chrish@kcbbs.gen.nz)
#include "machine/konami1.h" #include "machine/konami1.h"
#include "machine/nvram.h" #include "machine/nvram.h"
#include "machine/watchdog.h" #include "machine/watchdog.h"
#include "sound/dac.h"
#include "sound/volt_reg.h" #include "sound/volt_reg.h"
#include "screen.h"
#include "speaker.h" #include "speaker.h"
@ -88,8 +85,8 @@ void hyperspt_state::common_sound_map(address_map &map)
map(0x0000, 0x3fff).rom(); map(0x0000, 0x3fff).rom();
map(0x4000, 0x4fff).ram(); map(0x4000, 0x4fff).ram();
map(0x6000, 0x6000).r("soundlatch", FUNC(generic_latch_8_device::read)); map(0x6000, 0x6000).r("soundlatch", FUNC(generic_latch_8_device::read));
map(0x8000, 0x8000).r("trackfld_audio", FUNC(trackfld_audio_device::hyperspt_sh_timer_r)); map(0x8000, 0x8000).r(m_soundbrd, FUNC(trackfld_audio_device::hyperspt_sh_timer_r));
map(0xe000, 0xe000).w("dac", FUNC(dac_byte_interface::write)); map(0xe000, 0xe000).w(m_dac, FUNC(dac_byte_interface::write));
map(0xe001, 0xe001).w(this, FUNC(hyperspt_state::konami_SN76496_latch_w)); /* Loads the snd command into the snd latch */ map(0xe001, 0xe001).w(this, FUNC(hyperspt_state::konami_SN76496_latch_w)); /* Loads the snd command into the snd latch */
map(0xe002, 0xe002).w(this, FUNC(hyperspt_state::konami_SN76496_w)); /* This address triggers the SN chip to read the data port. */ map(0xe002, 0xe002).w(this, FUNC(hyperspt_state::konami_SN76496_w)); /* This address triggers the SN chip to read the data port. */
} }
@ -98,7 +95,7 @@ void hyperspt_state::hyperspt_sound_map(address_map &map)
{ {
common_sound_map(map); common_sound_map(map);
map(0xa000, 0xa000).w(m_vlm, FUNC(vlm5030_device::data_w)); /* speech data */ map(0xa000, 0xa000).w(m_vlm, FUNC(vlm5030_device::data_w)); /* speech data */
map(0xc000, 0xdfff).w("trackfld_audio", FUNC(trackfld_audio_device::hyperspt_sound_w)); /* speech and output control */ map(0xc000, 0xdfff).w(m_soundbrd, FUNC(trackfld_audio_device::hyperspt_sound_w)); /* speech and output control */
} }
void hyperspt_state::roadf_sound_map(address_map &map) void hyperspt_state::roadf_sound_map(address_map &map)
@ -298,15 +295,15 @@ WRITE_LINE_MEMBER(hyperspt_state::vblank_irq)
MACHINE_CONFIG_START(hyperspt_state::hyperspt) MACHINE_CONFIG_START(hyperspt_state::hyperspt)
/* basic machine hardware */ /* basic machine hardware */
MCFG_DEVICE_ADD("maincpu", KONAMI1, XTAL(18'432'000)/12) /* verified on pcb */ MCFG_DEVICE_ADD(m_maincpu, KONAMI1, XTAL(18'432'000)/12) /* verified on pcb */
MCFG_DEVICE_PROGRAM_MAP(hyperspt_map) MCFG_DEVICE_PROGRAM_MAP(hyperspt_map)
MCFG_DEVICE_ADD("audiocpu", Z80,XTAL(14'318'181)/4) /* verified on pcb */ MCFG_DEVICE_ADD(m_audiocpu, Z80,XTAL(14'318'181)/4) /* verified on pcb */
MCFG_DEVICE_PROGRAM_MAP(hyperspt_sound_map) MCFG_DEVICE_PROGRAM_MAP(hyperspt_sound_map)
MCFG_DEVICE_ADD("mainlatch", LS259, 0) // F2 MCFG_DEVICE_ADD("mainlatch", LS259, 0) // F2
MCFG_ADDRESSABLE_LATCH_Q0_OUT_CB(WRITELINE(*this, hyperspt_state, flipscreen_w)) MCFG_ADDRESSABLE_LATCH_Q0_OUT_CB(WRITELINE(*this, hyperspt_state, flipscreen_w))
MCFG_ADDRESSABLE_LATCH_Q1_OUT_CB(WRITELINE("trackfld_audio", trackfld_audio_device, sh_irqtrigger_w)) // SOUND ON MCFG_ADDRESSABLE_LATCH_Q1_OUT_CB(WRITELINE(m_soundbrd, trackfld_audio_device, sh_irqtrigger_w)) // SOUND ON
MCFG_ADDRESSABLE_LATCH_Q2_OUT_CB(NOOP) // END MCFG_ADDRESSABLE_LATCH_Q2_OUT_CB(NOOP) // END
MCFG_ADDRESSABLE_LATCH_Q3_OUT_CB(WRITELINE(*this, hyperspt_state, coin_counter_1_w)) // COIN 1 MCFG_ADDRESSABLE_LATCH_Q3_OUT_CB(WRITELINE(*this, hyperspt_state, coin_counter_1_w)) // COIN 1
MCFG_ADDRESSABLE_LATCH_Q4_OUT_CB(WRITELINE(*this, hyperspt_state, coin_counter_2_w)) // COIN 2 MCFG_ADDRESSABLE_LATCH_Q4_OUT_CB(WRITELINE(*this, hyperspt_state, coin_counter_2_w)) // COIN 2
@ -318,17 +315,17 @@ MACHINE_CONFIG_START(hyperspt_state::hyperspt)
MCFG_WATCHDOG_ADD("watchdog") MCFG_WATCHDOG_ADD("watchdog")
/* video hardware */ /* video hardware */
MCFG_SCREEN_ADD("screen", RASTER) MCFG_SCREEN_ADD(m_screen, RASTER)
MCFG_SCREEN_REFRESH_RATE(60) MCFG_SCREEN_REFRESH_RATE(60)
MCFG_SCREEN_VBLANK_TIME(ATTOSECONDS_IN_USEC(0)) MCFG_SCREEN_VBLANK_TIME(ATTOSECONDS_IN_USEC(0))
MCFG_SCREEN_SIZE(32*8, 32*8) MCFG_SCREEN_SIZE(32*8, 32*8)
MCFG_SCREEN_VISIBLE_AREA(0*8, 32*8-1, 2*8, 30*8-1) MCFG_SCREEN_VISIBLE_AREA(0*8, 32*8-1, 2*8, 30*8-1)
MCFG_SCREEN_UPDATE_DRIVER(hyperspt_state, screen_update) MCFG_SCREEN_UPDATE_DRIVER(hyperspt_state, screen_update)
MCFG_SCREEN_PALETTE("palette") MCFG_SCREEN_PALETTE(m_palette)
MCFG_SCREEN_VBLANK_CALLBACK(WRITELINE(*this, hyperspt_state, vblank_irq)) MCFG_SCREEN_VBLANK_CALLBACK(WRITELINE(*this, hyperspt_state, vblank_irq))
MCFG_DEVICE_ADD("gfxdecode", GFXDECODE, "palette", gfx_hyperspt) MCFG_DEVICE_ADD(m_gfxdecode, GFXDECODE, "palette", gfx_hyperspt)
MCFG_PALETTE_ADD("palette", 16*16+16*16) MCFG_PALETTE_ADD(m_palette, 16*16+16*16)
MCFG_PALETTE_INDIRECT_ENTRIES(32) MCFG_PALETTE_INDIRECT_ENTRIES(32)
MCFG_PALETTE_INIT_OWNER(hyperspt_state, hyperspt) MCFG_PALETTE_INIT_OWNER(hyperspt_state, hyperspt)
@ -337,16 +334,16 @@ MACHINE_CONFIG_START(hyperspt_state::hyperspt)
MCFG_GENERIC_LATCH_8_ADD("soundlatch") MCFG_GENERIC_LATCH_8_ADD("soundlatch")
MCFG_DEVICE_ADD("trackfld_audio", TRACKFLD_AUDIO, 0) MCFG_DEVICE_ADD(m_soundbrd, TRACKFLD_AUDIO, 0, m_audiocpu, m_vlm)
MCFG_DEVICE_ADD("dac", DAC_8BIT_R2R, 0) MCFG_SOUND_ROUTE(ALL_OUTPUTS, "speaker", 0.4) // unknown DAC MCFG_DEVICE_ADD(m_dac, DAC_8BIT_R2R, 0) MCFG_SOUND_ROUTE(ALL_OUTPUTS, "speaker", 0.4) // unknown DAC
MCFG_DEVICE_ADD("vref", VOLTAGE_REGULATOR, 0) MCFG_VOLTAGE_REGULATOR_OUTPUT(5.0) MCFG_DEVICE_ADD("vref", VOLTAGE_REGULATOR, 0) MCFG_VOLTAGE_REGULATOR_OUTPUT(5.0)
MCFG_SOUND_ROUTE(0, "dac", 1.0, DAC_VREF_POS_INPUT) MCFG_SOUND_ROUTE(0, "dac", -1.0, DAC_VREF_NEG_INPUT) MCFG_SOUND_ROUTE(0, "dac", 1.0, DAC_VREF_POS_INPUT) MCFG_SOUND_ROUTE(0, "dac", -1.0, DAC_VREF_NEG_INPUT)
MCFG_DEVICE_ADD("snsnd", SN76496, XTAL(14'318'181)/8) /* verified on pcb */ MCFG_DEVICE_ADD(m_sn, SN76496, XTAL(14'318'181)/8) /* verified on pcb */
MCFG_SOUND_ROUTE(ALL_OUTPUTS, "speaker", 1.0) MCFG_SOUND_ROUTE(ALL_OUTPUTS, "speaker", 1.0)
MCFG_DEVICE_ADD("vlm", VLM5030, XTAL(3'579'545)) /* verified on pcb */ MCFG_DEVICE_ADD(m_vlm, VLM5030, XTAL(3'579'545)) /* verified on pcb */
MCFG_SOUND_ROUTE(ALL_OUTPUTS, "speaker", 1.0) MCFG_SOUND_ROUTE(ALL_OUTPUTS, "speaker", 1.0)
MACHINE_CONFIG_END MACHINE_CONFIG_END
@ -378,8 +375,7 @@ MACHINE_CONFIG_START(hyperspt_state::hypersptb)
hyperspt(config); hyperspt(config);
MCFG_DEVICE_REMOVE("vlm") MCFG_DEVICE_REMOVE("vlm")
MCFG_DEVICE_MODIFY("audiocpu") m_audiocpu->set_addrmap(AS_PROGRAM, address_map_constructor(&std::remove_pointer_t<decltype(this)>::soundb_map, tag(), this));
MCFG_DEVICE_PROGRAM_MAP(soundb_map)
MCFG_DEVICE_ADD("adpcm", M6802, XTAL(14'318'181)/8) /* unknown clock */ MCFG_DEVICE_ADD("adpcm", M6802, XTAL(14'318'181)/8) /* unknown clock */
MCFG_DEVICE_PROGRAM_MAP(hyprolyb_adpcm_map) MCFG_DEVICE_PROGRAM_MAP(hyprolyb_adpcm_map)
@ -398,13 +394,12 @@ MACHINE_CONFIG_END
MACHINE_CONFIG_START(hyperspt_state::roadf) MACHINE_CONFIG_START(hyperspt_state::roadf)
hyperspt(config); hyperspt(config);
MCFG_DEVICE_MODIFY("maincpu") m_maincpu->set_addrmap(AS_PROGRAM, address_map_constructor(&std::remove_pointer_t<decltype(this)>::roadf_map, tag(), this));
MCFG_DEVICE_PROGRAM_MAP(roadf_map) m_audiocpu->set_addrmap(AS_PROGRAM, address_map_constructor(&std::remove_pointer_t<decltype(this)>::roadf_sound_map, tag(), this));
MCFG_GFXDECODE_MODIFY("gfxdecode", gfx_roadf) m_gfxdecode->set_info(gfx_roadf);
MCFG_VIDEO_START_OVERRIDE(hyperspt_state,roadf) MCFG_VIDEO_START_OVERRIDE(hyperspt_state,roadf)
MCFG_DEVICE_MODIFY("audiocpu")
MCFG_DEVICE_PROGRAM_MAP(roadf_sound_map)
MCFG_DEVICE_REMOVE("vlm") MCFG_DEVICE_REMOVE("vlm")
MACHINE_CONFIG_END MACHINE_CONFIG_END

View File

@ -43,7 +43,6 @@ CPU/Video Board Parts:
#include "emu.h" #include "emu.h"
#include "includes/sbasketb.h" #include "includes/sbasketb.h"
#include "includes/konamipt.h" #include "includes/konamipt.h"
#include "audio/trackfld.h"
#include "cpu/m6809/m6809.h" #include "cpu/m6809/m6809.h"
#include "cpu/z80/z80.h" #include "cpu/z80/z80.h"
@ -51,9 +50,8 @@ CPU/Video Board Parts:
#include "machine/gen_latch.h" #include "machine/gen_latch.h"
#include "machine/konami1.h" #include "machine/konami1.h"
#include "machine/watchdog.h" #include "machine/watchdog.h"
#include "sound/dac.h"
#include "sound/volt_reg.h" #include "sound/volt_reg.h"
#include "screen.h"
#include "speaker.h" #include "speaker.h"
@ -82,13 +80,13 @@ WRITE_LINE_MEMBER(sbasketb_state::irq_mask_w)
void sbasketb_state::sbasketb_map(address_map &map) void sbasketb_state::sbasketb_map(address_map &map)
{ {
map(0x2000, 0x2fff).ram(); map(0x2000, 0x2fff).ram();
map(0x3000, 0x33ff).ram().w(this, FUNC(sbasketb_state::sbasketb_colorram_w)).share("colorram"); map(0x3000, 0x33ff).ram().w(this, FUNC(sbasketb_state::sbasketb_colorram_w)).share(m_colorram);
map(0x3400, 0x37ff).ram().w(this, FUNC(sbasketb_state::sbasketb_videoram_w)).share("videoram"); map(0x3400, 0x37ff).ram().w(this, FUNC(sbasketb_state::sbasketb_videoram_w)).share(m_videoram);
map(0x3800, 0x39ff).ram().share("spriteram"); map(0x3800, 0x39ff).ram().share(m_spriteram);
map(0x3a00, 0x3bff).ram(); /* Probably unused, but initialized */ map(0x3a00, 0x3bff).ram(); /* Probably unused, but initialized */
map(0x3c00, 0x3c00).w("watchdog", FUNC(watchdog_timer_device::reset_w)); map(0x3c00, 0x3c00).w("watchdog", FUNC(watchdog_timer_device::reset_w));
map(0x3c10, 0x3c10).nopr(); /* ???? */ map(0x3c10, 0x3c10).nopr(); /* ???? */
map(0x3c20, 0x3c20).writeonly().share("palettebank"); map(0x3c20, 0x3c20).writeonly().share(m_palettebank);
map(0x3c80, 0x3c87).w("mainlatch", FUNC(ls259_device::write_d0)); map(0x3c80, 0x3c87).w("mainlatch", FUNC(ls259_device::write_d0));
map(0x3d00, 0x3d00).w("soundlatch", FUNC(generic_latch_8_device::write)); map(0x3d00, 0x3d00).w("soundlatch", FUNC(generic_latch_8_device::write));
map(0x3d80, 0x3d80).w(this, FUNC(sbasketb_state::sbasketb_sh_irqtrigger_w)); map(0x3d80, 0x3d80).w(this, FUNC(sbasketb_state::sbasketb_sh_irqtrigger_w));
@ -98,7 +96,7 @@ void sbasketb_state::sbasketb_map(address_map &map)
map(0x3e03, 0x3e03).nopr(); map(0x3e03, 0x3e03).nopr();
map(0x3e80, 0x3e80).portr("DSW2"); map(0x3e80, 0x3e80).portr("DSW2");
map(0x3f00, 0x3f00).portr("DSW1"); map(0x3f00, 0x3f00).portr("DSW1");
map(0x3f80, 0x3f80).writeonly().share("scroll"); map(0x3f80, 0x3f80).writeonly().share(m_scroll);
map(0x6000, 0xffff).rom(); map(0x6000, 0xffff).rom();
} }
@ -107,10 +105,10 @@ void sbasketb_state::sbasketb_sound_map(address_map &map)
map(0x0000, 0x1fff).rom(); map(0x0000, 0x1fff).rom();
map(0x4000, 0x43ff).ram(); map(0x4000, 0x43ff).ram();
map(0x6000, 0x6000).r("soundlatch", FUNC(generic_latch_8_device::read)); map(0x6000, 0x6000).r("soundlatch", FUNC(generic_latch_8_device::read));
map(0x8000, 0x8000).r("trackfld_audio", FUNC(trackfld_audio_device::hyperspt_sh_timer_r)); map(0x8000, 0x8000).r(m_soundbrd, FUNC(trackfld_audio_device::hyperspt_sh_timer_r));
map(0xa000, 0xa000).w(m_vlm, FUNC(vlm5030_device::data_w)); /* speech data */ map(0xa000, 0xa000).w(m_vlm, FUNC(vlm5030_device::data_w)); /* speech data */
map(0xc000, 0xdfff).w("trackfld_audio", FUNC(trackfld_audio_device::hyperspt_sound_w)); /* speech and output control */ map(0xc000, 0xdfff).w(m_soundbrd, FUNC(trackfld_audio_device::hyperspt_sound_w)); /* speech and output control */
map(0xe000, 0xe000).w("dac", FUNC(dac_byte_interface::write)); map(0xe000, 0xe000).w(m_dac, FUNC(dac_byte_interface::write));
map(0xe001, 0xe001).w(this, FUNC(sbasketb_state::konami_SN76496_latch_w)); /* Loads the snd command into the snd latch */ map(0xe001, 0xe001).w(this, FUNC(sbasketb_state::konami_SN76496_latch_w)); /* Loads the snd command into the snd latch */
map(0xe002, 0xe002).w(this, FUNC(sbasketb_state::konami_SN76496_w)); /* This address triggers the SN chip to read the data port. */ map(0xe002, 0xe002).w(this, FUNC(sbasketb_state::konami_SN76496_w)); /* This address triggers the SN chip to read the data port. */
} }
@ -197,10 +195,10 @@ WRITE_LINE_MEMBER(sbasketb_state::vblank_irq)
MACHINE_CONFIG_START(sbasketb_state::sbasketb) MACHINE_CONFIG_START(sbasketb_state::sbasketb)
/* basic machine hardware */ /* basic machine hardware */
MCFG_DEVICE_ADD("maincpu", KONAMI1, 1400000) /* 1.400 MHz ??? */ MCFG_DEVICE_ADD(m_maincpu, KONAMI1, 1400000) /* 1.400 MHz ??? */
MCFG_DEVICE_PROGRAM_MAP(sbasketb_map) MCFG_DEVICE_PROGRAM_MAP(sbasketb_map)
MCFG_DEVICE_ADD("audiocpu", Z80, XTAL(14'318'181) / 4) /* 3.5795 MHz */ MCFG_DEVICE_ADD(m_audiocpu, Z80, XTAL(14'318'181) / 4) /* 3.5795 MHz */
MCFG_DEVICE_PROGRAM_MAP(sbasketb_sound_map) MCFG_DEVICE_PROGRAM_MAP(sbasketb_sound_map)
MCFG_DEVICE_ADD("mainlatch", LS259, 0) // B3 MCFG_DEVICE_ADD("mainlatch", LS259, 0) // B3
@ -215,17 +213,17 @@ MACHINE_CONFIG_START(sbasketb_state::sbasketb)
MCFG_WATCHDOG_ADD("watchdog") MCFG_WATCHDOG_ADD("watchdog")
/* video hardware */ /* video hardware */
MCFG_SCREEN_ADD("screen", RASTER) MCFG_SCREEN_ADD(m_screen, RASTER)
MCFG_SCREEN_REFRESH_RATE(60) MCFG_SCREEN_REFRESH_RATE(60)
MCFG_SCREEN_VBLANK_TIME(ATTOSECONDS_IN_USEC(0)) MCFG_SCREEN_VBLANK_TIME(ATTOSECONDS_IN_USEC(0))
MCFG_SCREEN_SIZE(32*8, 32*8) MCFG_SCREEN_SIZE(32*8, 32*8)
MCFG_SCREEN_VISIBLE_AREA(0*8, 32*8-1, 2*8, 30*8-1) MCFG_SCREEN_VISIBLE_AREA(0*8, 32*8-1, 2*8, 30*8-1)
MCFG_SCREEN_UPDATE_DRIVER(sbasketb_state, screen_update_sbasketb) MCFG_SCREEN_UPDATE_DRIVER(sbasketb_state, screen_update_sbasketb)
MCFG_SCREEN_PALETTE("palette") MCFG_SCREEN_PALETTE(m_palette)
MCFG_SCREEN_VBLANK_CALLBACK(WRITELINE(*this, sbasketb_state, vblank_irq)) MCFG_SCREEN_VBLANK_CALLBACK(WRITELINE(*this, sbasketb_state, vblank_irq))
MCFG_DEVICE_ADD("gfxdecode", GFXDECODE, "palette", gfx_sbasketb) MCFG_DEVICE_ADD(m_gfxdecode, GFXDECODE, m_palette, gfx_sbasketb)
MCFG_PALETTE_ADD("palette", 16*16+16*16*16) MCFG_PALETTE_ADD(m_palette, 16*16+16*16*16)
MCFG_PALETTE_INDIRECT_ENTRIES(256) MCFG_PALETTE_INDIRECT_ENTRIES(256)
MCFG_PALETTE_INIT_OWNER(sbasketb_state, sbasketb) MCFG_PALETTE_INIT_OWNER(sbasketb_state, sbasketb)
@ -234,23 +232,22 @@ MACHINE_CONFIG_START(sbasketb_state::sbasketb)
MCFG_GENERIC_LATCH_8_ADD("soundlatch") MCFG_GENERIC_LATCH_8_ADD("soundlatch")
MCFG_DEVICE_ADD("trackfld_audio", TRACKFLD_AUDIO, 0) MCFG_DEVICE_ADD(m_soundbrd, TRACKFLD_AUDIO, 0, m_audiocpu, m_vlm)
MCFG_DEVICE_ADD("dac", DAC_8BIT_R2R, 0) MCFG_SOUND_ROUTE(ALL_OUTPUTS, "speaker", 0.4) // unknown DAC MCFG_DEVICE_ADD(m_dac, DAC_8BIT_R2R, 0) MCFG_SOUND_ROUTE(ALL_OUTPUTS, "speaker", 0.4) // unknown DAC
MCFG_DEVICE_ADD("vref", VOLTAGE_REGULATOR, 0) MCFG_VOLTAGE_REGULATOR_OUTPUT(5.0) MCFG_DEVICE_ADD("vref", VOLTAGE_REGULATOR, 0) MCFG_VOLTAGE_REGULATOR_OUTPUT(5.0)
MCFG_SOUND_ROUTE(0, "dac", 1.0, DAC_VREF_POS_INPUT) MCFG_SOUND_ROUTE(0, "dac", -1.0, DAC_VREF_NEG_INPUT) MCFG_SOUND_ROUTE(0, "dac", 1.0, DAC_VREF_POS_INPUT) MCFG_SOUND_ROUTE(0, "dac", -1.0, DAC_VREF_NEG_INPUT)
MCFG_DEVICE_ADD("snsnd", SN76489, XTAL(14'318'181) / 8) MCFG_DEVICE_ADD(m_sn, SN76489, XTAL(14'318'181) / 8)
MCFG_SOUND_ROUTE(ALL_OUTPUTS, "speaker", 1.0) MCFG_SOUND_ROUTE(ALL_OUTPUTS, "speaker", 1.0)
MCFG_DEVICE_ADD("vlm", VLM5030, XTAL(3'579'545)) /* Schematics say 3.58MHz, but board uses 3.579545MHz xtal */ MCFG_DEVICE_ADD(m_vlm, VLM5030, XTAL(3'579'545)) /* Schematics say 3.58MHz, but board uses 3.579545MHz xtal */
MCFG_SOUND_ROUTE(ALL_OUTPUTS, "speaker", 1.0) MCFG_SOUND_ROUTE(ALL_OUTPUTS, "speaker", 1.0)
MACHINE_CONFIG_END MACHINE_CONFIG_END
MACHINE_CONFIG_START(sbasketb_state::sbasketbu) MACHINE_CONFIG_START(sbasketb_state::sbasketbu)
sbasketb(config); sbasketb(config);
MCFG_DEVICE_REMOVE("maincpu") MCFG_DEVICE_REPLACE(m_maincpu, MC6809E, 1400000) /* 6809E at 1.400 MHz ??? */
MCFG_DEVICE_ADD("maincpu", MC6809E, 1400000) /* 6809E at 1.400 MHz ??? */
MCFG_DEVICE_PROGRAM_MAP(sbasketb_map) MCFG_DEVICE_PROGRAM_MAP(sbasketb_map)
MACHINE_CONFIG_END MACHINE_CONFIG_END

View File

@ -184,7 +184,6 @@ MAIN BOARD:
#include "includes/trackfld.h" #include "includes/trackfld.h"
#include "includes/konamipt.h" #include "includes/konamipt.h"
#include "audio/hyprolyb.h" #include "audio/hyprolyb.h"
#include "audio/trackfld.h"
#include "cpu/z80/z80.h" #include "cpu/z80/z80.h"
#include "cpu/m6800/m6800.h" #include "cpu/m6800/m6800.h"
@ -193,9 +192,7 @@ MAIN BOARD:
#include "machine/konami1.h" #include "machine/konami1.h"
#include "machine/nvram.h" #include "machine/nvram.h"
#include "machine/watchdog.h" #include "machine/watchdog.h"
#include "sound/dac.h"
#include "sound/volt_reg.h" #include "sound/volt_reg.h"
#include "screen.h"
#include "speaker.h" #include "speaker.h"
@ -216,11 +213,9 @@ WRITE_LINE_MEMBER(trackfld_state::coin_counter_2_w)
WRITE8_MEMBER(trackfld_state::questions_bank_w) WRITE8_MEMBER(trackfld_state::questions_bank_w)
{ {
int i; for (int i = 0; i < 8; i++)
for(i=0;i<8;i++)
{ {
if((data & 1 << i) == 0) // check first bit active low, change ROM bank according to the correlated bit if (!BIT(data, i)) // check first bit active low, change ROM bank according to the correlated bit
{ {
membank("bank1")->set_entry(i); membank("bank1")->set_entry(i);
return; return;
@ -246,15 +241,15 @@ void trackfld_state::main_map(address_map &map)
map(0x1282, 0x1282).mirror(0x007c).portr("IN1"); map(0x1282, 0x1282).mirror(0x007c).portr("IN1");
map(0x1283, 0x1283).mirror(0x007c).portr("DSW1"); map(0x1283, 0x1283).mirror(0x007c).portr("DSW1");
/* not used according to schems: AM_RANGE(0x1300, 0x1300) AM_MIRROR(0x007f) AM_READ_PORT("DSW3") */ /* not used according to schems: AM_RANGE(0x1300, 0x1300) AM_MIRROR(0x007f) AM_READ_PORT("DSW3") */
map(0x1800, 0x183f).ram().share("spriteram2"); map(0x1800, 0x183f).ram().share(m_spriteram2);
map(0x1840, 0x185f).ram().share("scroll"); map(0x1840, 0x185f).ram().share(m_scroll);
map(0x1860, 0x1bff).ram(); map(0x1860, 0x1bff).ram();
map(0x1c00, 0x1c3f).ram().share("spriteram"); map(0x1c00, 0x1c3f).ram().share(m_spriteram);
map(0x1c40, 0x1c5f).ram().share("scroll2"); map(0x1c40, 0x1c5f).ram().share(m_scroll2);
map(0x1c60, 0x1fff).ram(); map(0x1c60, 0x1fff).ram();
map(0x2800, 0x2fff).ram().share("nvram"); map(0x2800, 0x2fff).ram().share("nvram");
map(0x3000, 0x37ff).ram().w(this, FUNC(trackfld_state::trackfld_videoram_w)).share("videoram"); map(0x3000, 0x37ff).ram().w(this, FUNC(trackfld_state::trackfld_videoram_w)).share(m_videoram);
map(0x3800, 0x3fff).ram().w(this, FUNC(trackfld_state::trackfld_colorram_w)).share("colorram"); map(0x3800, 0x3fff).ram().w(this, FUNC(trackfld_state::trackfld_colorram_w)).share(m_colorram);
map(0x6000, 0xffff).rom(); map(0x6000, 0xffff).rom();
} }
@ -296,15 +291,15 @@ void trackfld_state::yieartf_map(address_map &map)
map(0x1282, 0x1282).mirror(0x007c).portr("IN1"); map(0x1282, 0x1282).mirror(0x007c).portr("IN1");
map(0x1283, 0x1283).mirror(0x007c).portr("DSW1"); map(0x1283, 0x1283).mirror(0x007c).portr("DSW1");
map(0x1300, 0x1300).mirror(0x007f).portr("DSW3"); map(0x1300, 0x1300).mirror(0x007f).portr("DSW3");
map(0x1800, 0x183f).ram().share("spriteram2"); map(0x1800, 0x183f).ram().share(m_spriteram2);
map(0x1840, 0x185f).ram().share("scroll"); map(0x1840, 0x185f).ram().share(m_scroll);
map(0x1860, 0x1bff).ram(); map(0x1860, 0x1bff).ram();
map(0x1c00, 0x1c3f).ram().share("spriteram"); map(0x1c00, 0x1c3f).ram().share(m_spriteram);
map(0x1c40, 0x1c5f).ram().share("scroll2"); map(0x1c40, 0x1c5f).ram().share(m_scroll2);
map(0x1c60, 0x1fff).ram(); map(0x1c60, 0x1fff).ram();
map(0x2800, 0x2fff).ram().share("nvram"); map(0x2800, 0x2fff).ram().share("nvram");
map(0x3000, 0x37ff).ram().w(this, FUNC(trackfld_state::trackfld_videoram_w)).share("videoram"); map(0x3000, 0x37ff).ram().w(this, FUNC(trackfld_state::trackfld_videoram_w)).share(m_videoram);
map(0x3800, 0x3fff).ram().w(this, FUNC(trackfld_state::trackfld_colorram_w)).share("colorram"); map(0x3800, 0x3fff).ram().w(this, FUNC(trackfld_state::trackfld_colorram_w)).share(m_colorram);
map(0x6000, 0xffff).rom(); map(0x6000, 0xffff).rom();
} }
@ -320,16 +315,16 @@ void trackfld_state::reaktor_map(address_map &map)
map(0x9281, 0x9281).portr("IN0"); map(0x9281, 0x9281).portr("IN0");
map(0x9282, 0x9282).portr("IN1"); map(0x9282, 0x9282).portr("IN1");
map(0x9283, 0x9283).portr("DSW1"); map(0x9283, 0x9283).portr("DSW1");
map(0x9800, 0x983f).ram().share("spriteram2"); map(0x9800, 0x983f).ram().share(m_spriteram2);
map(0x9840, 0x985f).ram().share("scroll"); map(0x9840, 0x985f).ram().share(m_scroll);
map(0x9860, 0x9bff).ram(); map(0x9860, 0x9bff).ram();
map(0x9c00, 0x9c3f).ram().share("spriteram"); map(0x9c00, 0x9c3f).ram().share(m_spriteram);
map(0x9c40, 0x9c5f).ram().share("scroll2"); map(0x9c40, 0x9c5f).ram().share(m_scroll2);
map(0x9c60, 0x9fff).ram(); map(0x9c60, 0x9fff).ram();
map(0xa800, 0xabff).ram(); map(0xa800, 0xabff).ram();
map(0xac00, 0xafff).ram().share("nvram"); map(0xac00, 0xafff).ram().share("nvram");
map(0xb000, 0xb7ff).ram().w(this, FUNC(trackfld_state::trackfld_videoram_w)).share("videoram"); map(0xb000, 0xb7ff).ram().w(this, FUNC(trackfld_state::trackfld_videoram_w)).share(m_videoram);
map(0xb800, 0xbfff).ram().w(this, FUNC(trackfld_state::trackfld_colorram_w)).share("colorram"); map(0xb800, 0xbfff).ram().w(this, FUNC(trackfld_state::trackfld_colorram_w)).share(m_colorram);
} }
/* Reaktor reads / writes some I/O ports, no idea what they're connected to, if anything */ /* Reaktor reads / writes some I/O ports, no idea what they're connected to, if anything */
@ -352,17 +347,17 @@ void trackfld_state::mastkin_map(address_map &map)
map(0x1281, 0x1281).portr("IN0"); map(0x1281, 0x1281).portr("IN0");
// AM_RANGE(0x1282, 0x1282) AM_READ_PORT("IN1") /* unused */ // AM_RANGE(0x1282, 0x1282) AM_READ_PORT("IN1") /* unused */
map(0x1283, 0x1283).portr("DSW1"); map(0x1283, 0x1283).portr("DSW1");
map(0x1800, 0x183f).ram().share("spriteram2"); map(0x1800, 0x183f).ram().share(m_spriteram2);
map(0x1840, 0x185f).ram().share("scroll"); map(0x1840, 0x185f).ram().share(m_scroll);
map(0x1860, 0x1bff).ram(); map(0x1860, 0x1bff).ram();
map(0x1c00, 0x1c3f).ram().share("spriteram"); map(0x1c00, 0x1c3f).ram().share(m_spriteram);
map(0x1c40, 0x1c5f).ram().share("scroll2"); map(0x1c40, 0x1c5f).ram().share(m_scroll2);
map(0x1c60, 0x1fff).ram(); map(0x1c60, 0x1fff).ram();
map(0x2000, 0x27ff).ram(); // initialized at POST map(0x2000, 0x27ff).ram(); // initialized at POST
map(0x2800, 0x2bff).ram(); map(0x2800, 0x2bff).ram();
map(0x2c00, 0x2fff).ram().share("nvram"); map(0x2c00, 0x2fff).ram().share("nvram");
map(0x3000, 0x37ff).ram().w(this, FUNC(trackfld_state::trackfld_videoram_w)).share("videoram"); map(0x3000, 0x37ff).ram().w(this, FUNC(trackfld_state::trackfld_videoram_w)).share(m_videoram);
map(0x3800, 0x3fff).ram().w(this, FUNC(trackfld_state::trackfld_colorram_w)).share("colorram"); map(0x3800, 0x3fff).ram().w(this, FUNC(trackfld_state::trackfld_colorram_w)).share(m_colorram);
map(0x6000, 0xffff).rom(); map(0x6000, 0xffff).rom();
} }
@ -377,16 +372,16 @@ void trackfld_state::wizzquiz_map(address_map &map)
map(0x1281, 0x1281).portr("IN0"); map(0x1281, 0x1281).portr("IN0");
map(0x1282, 0x1282).portr("IN1"); map(0x1282, 0x1282).portr("IN1");
map(0x1283, 0x1283).portr("DSW1"); map(0x1283, 0x1283).portr("DSW1");
map(0x1800, 0x183f).ram().share("spriteram2"); map(0x1800, 0x183f).ram().share(m_spriteram2);
map(0x1840, 0x185f).ram().share("scroll"); map(0x1840, 0x185f).ram().share(m_scroll);
map(0x1860, 0x1bff).ram(); map(0x1860, 0x1bff).ram();
map(0x1c00, 0x1c3f).ram().share("spriteram"); map(0x1c00, 0x1c3f).ram().share(m_spriteram);
map(0x1c40, 0x1c5f).ram().share("scroll2"); map(0x1c40, 0x1c5f).ram().share(m_scroll2);
map(0x1c60, 0x1fff).ram(); map(0x1c60, 0x1fff).ram();
map(0x2800, 0x2bff).ram(); map(0x2800, 0x2bff).ram();
map(0x2c00, 0x2fff).ram().share("nvram"); map(0x2c00, 0x2fff).ram().share("nvram");
map(0x3000, 0x37ff).ram().w(this, FUNC(trackfld_state::trackfld_videoram_w)).share("videoram"); map(0x3000, 0x37ff).ram().w(this, FUNC(trackfld_state::trackfld_videoram_w)).share(m_videoram);
map(0x3800, 0x3fff).ram().w(this, FUNC(trackfld_state::trackfld_colorram_w)).share("colorram"); map(0x3800, 0x3fff).ram().w(this, FUNC(trackfld_state::trackfld_colorram_w)).share(m_colorram);
map(0xc000, 0xc000).w(this, FUNC(trackfld_state::questions_bank_w)); map(0xc000, 0xc000).w(this, FUNC(trackfld_state::questions_bank_w));
map(0x6000, 0xdfff).bankr("bank1"); map(0x6000, 0xdfff).bankr("bank1");
map(0xe000, 0xffff).rom(); map(0xe000, 0xffff).rom();
@ -404,13 +399,13 @@ void trackfld_state::sound_map(address_map &map)
map(0x0000, 0x3fff).rom(); map(0x0000, 0x3fff).rom();
map(0x4000, 0x43ff).mirror(0x1c00).ram(); map(0x4000, 0x43ff).mirror(0x1c00).ram();
map(0x6000, 0x6000).mirror(0x1fff).r("soundlatch", FUNC(generic_latch_8_device::read)); map(0x6000, 0x6000).mirror(0x1fff).r("soundlatch", FUNC(generic_latch_8_device::read));
map(0x8000, 0x8000).mirror(0x1fff).r("trackfld_audio", FUNC(trackfld_audio_device::trackfld_sh_timer_r)); map(0x8000, 0x8000).mirror(0x1fff).r(m_soundbrd, FUNC(trackfld_audio_device::trackfld_sh_timer_r));
map(0xa000, 0xa000).mirror(0x1fff).w(this, FUNC(trackfld_state::konami_SN76496_latch_w)); map(0xa000, 0xa000).mirror(0x1fff).w(this, FUNC(trackfld_state::konami_SN76496_latch_w));
map(0xc000, 0xc000).mirror(0x1fff).r(this, FUNC(trackfld_state::trackfld_SN76496_r)).w(this, FUNC(trackfld_state::konami_SN76496_w)); map(0xc000, 0xc000).mirror(0x1fff).r(this, FUNC(trackfld_state::trackfld_SN76496_r)).w(this, FUNC(trackfld_state::konami_SN76496_w));
map(0xe000, 0xe000).mirror(0x1ff8).w("dac", FUNC(dac_byte_interface::write)); map(0xe000, 0xe000).mirror(0x1ff8).w(m_dac, FUNC(dac_byte_interface::write));
map(0xe001, 0xe001).mirror(0x1ff8).noprw(); /* watch dog ?; reaktor reads here */ map(0xe001, 0xe001).mirror(0x1ff8).noprw(); /* watch dog ?; reaktor reads here */
map(0xe002, 0xe002).mirror(0x1ff8).r("trackfld_audio", FUNC(trackfld_audio_device::trackfld_speech_r)); map(0xe002, 0xe002).mirror(0x1ff8).r(m_soundbrd, FUNC(trackfld_audio_device::trackfld_speech_r));
map(0xe003, 0xe003).mirror(0x1c78).select(0x0380).w("trackfld_audio", FUNC(trackfld_audio_device::trackfld_sound_w)); map(0xe003, 0xe003).mirror(0x1c78).select(0x0380).w(m_soundbrd, FUNC(trackfld_audio_device::trackfld_sound_w));
map(0xe004, 0xe004).mirror(0x1ff8).w(m_vlm, FUNC(vlm5030_device::data_w)); map(0xe004, 0xe004).mirror(0x1ff8).w(m_vlm, FUNC(vlm5030_device::data_w));
} }
@ -419,10 +414,10 @@ void trackfld_state::hyprolyb_sound_map(address_map &map)
map(0x0000, 0x3fff).rom(); map(0x0000, 0x3fff).rom();
map(0x4000, 0x43ff).mirror(0x1c00).ram(); map(0x4000, 0x43ff).mirror(0x1c00).ram();
map(0x6000, 0x6000).mirror(0x1fff).r("soundlatch", FUNC(generic_latch_8_device::read)); map(0x6000, 0x6000).mirror(0x1fff).r("soundlatch", FUNC(generic_latch_8_device::read));
map(0x8000, 0x8000).mirror(0x1fff).r("trackfld_audio", FUNC(trackfld_audio_device::trackfld_sh_timer_r)); map(0x8000, 0x8000).mirror(0x1fff).r(m_soundbrd, FUNC(trackfld_audio_device::trackfld_sh_timer_r));
map(0xa000, 0xa000).mirror(0x1fff).w(this, FUNC(trackfld_state::konami_SN76496_latch_w)); map(0xa000, 0xa000).mirror(0x1fff).w(this, FUNC(trackfld_state::konami_SN76496_latch_w));
map(0xc000, 0xc000).mirror(0x1fff).r(this, FUNC(trackfld_state::trackfld_SN76496_r)).w(this, FUNC(trackfld_state::konami_SN76496_w)); map(0xc000, 0xc000).mirror(0x1fff).r(this, FUNC(trackfld_state::trackfld_SN76496_r)).w(this, FUNC(trackfld_state::konami_SN76496_w));
map(0xe000, 0xe000).mirror(0x1ff8).w("dac", FUNC(dac_byte_interface::write)); map(0xe000, 0xe000).mirror(0x1ff8).w(m_dac, FUNC(dac_byte_interface::write));
map(0xe001, 0xe001).mirror(0x1ff8).noprw(); /* watch dog ?; reaktor reads here */ map(0xe001, 0xe001).mirror(0x1ff8).noprw(); /* watch dog ?; reaktor reads here */
map(0xe002, 0xe002).mirror(0x1ff8).r("hyprolyb_adpcm", FUNC(hyprolyb_adpcm_device::busy_r)); map(0xe002, 0xe002).mirror(0x1ff8).r("hyprolyb_adpcm", FUNC(hyprolyb_adpcm_device::busy_r));
map(0xe003, 0xe003).mirror(0x1ff8).nopw(); map(0xe003, 0xe003).mirror(0x1ff8).nopw();
@ -904,10 +899,10 @@ WRITE_LINE_MEMBER(trackfld_state::vblank_nmi)
MACHINE_CONFIG_START(trackfld_state::trackfld) MACHINE_CONFIG_START(trackfld_state::trackfld)
/* basic machine hardware */ /* basic machine hardware */
MCFG_DEVICE_ADD("maincpu", KONAMI1, MASTER_CLOCK/6/2) /* a guess for now */ MCFG_DEVICE_ADD(m_maincpu, KONAMI1, MASTER_CLOCK/6/2) /* a guess for now */
MCFG_DEVICE_PROGRAM_MAP(main_map) MCFG_DEVICE_PROGRAM_MAP(main_map)
MCFG_DEVICE_ADD("audiocpu", Z80, SOUND_CLOCK/4) MCFG_DEVICE_ADD(m_audiocpu, Z80, SOUND_CLOCK/4)
MCFG_DEVICE_PROGRAM_MAP(sound_map) MCFG_DEVICE_PROGRAM_MAP(sound_map)
MCFG_MACHINE_START_OVERRIDE(trackfld_state,trackfld) MCFG_MACHINE_START_OVERRIDE(trackfld_state,trackfld)
@ -928,17 +923,17 @@ MACHINE_CONFIG_START(trackfld_state::trackfld)
MCFG_WATCHDOG_ADD("watchdog") MCFG_WATCHDOG_ADD("watchdog")
/* video hardware */ /* video hardware */
MCFG_SCREEN_ADD("screen", RASTER) MCFG_SCREEN_ADD(m_screen, RASTER)
MCFG_SCREEN_REFRESH_RATE(60) MCFG_SCREEN_REFRESH_RATE(60)
MCFG_SCREEN_VBLANK_TIME(ATTOSECONDS_IN_USEC(0)) MCFG_SCREEN_VBLANK_TIME(ATTOSECONDS_IN_USEC(0))
MCFG_SCREEN_SIZE(32*8, 32*8) MCFG_SCREEN_SIZE(32*8, 32*8)
MCFG_SCREEN_VISIBLE_AREA(0*8, 32*8-1, 2*8, 30*8-1) MCFG_SCREEN_VISIBLE_AREA(0*8, 32*8-1, 2*8, 30*8-1)
MCFG_SCREEN_UPDATE_DRIVER(trackfld_state, screen_update_trackfld) MCFG_SCREEN_UPDATE_DRIVER(trackfld_state, screen_update_trackfld)
MCFG_SCREEN_PALETTE("palette") MCFG_SCREEN_PALETTE(m_palette)
MCFG_SCREEN_VBLANK_CALLBACK(WRITELINE(*this, trackfld_state, vblank_irq)) MCFG_SCREEN_VBLANK_CALLBACK(WRITELINE(*this, trackfld_state, vblank_irq))
MCFG_DEVICE_ADD("gfxdecode", GFXDECODE, "palette", gfx_trackfld) MCFG_DEVICE_ADD("gfxdecode", GFXDECODE, "palette", gfx_trackfld)
MCFG_PALETTE_ADD("palette", 16*16+16*16) MCFG_PALETTE_ADD(m_palette, 16*16+16*16)
MCFG_PALETTE_INDIRECT_ENTRIES(32) MCFG_PALETTE_INDIRECT_ENTRIES(32)
MCFG_PALETTE_INIT_OWNER(trackfld_state,trackfld) MCFG_PALETTE_INIT_OWNER(trackfld_state,trackfld)
MCFG_VIDEO_START_OVERRIDE(trackfld_state,trackfld) MCFG_VIDEO_START_OVERRIDE(trackfld_state,trackfld)
@ -948,16 +943,16 @@ MACHINE_CONFIG_START(trackfld_state::trackfld)
MCFG_GENERIC_LATCH_8_ADD("soundlatch") MCFG_GENERIC_LATCH_8_ADD("soundlatch")
MCFG_DEVICE_ADD("trackfld_audio", TRACKFLD_AUDIO, 0) MCFG_DEVICE_ADD(m_soundbrd, TRACKFLD_AUDIO, 0, m_audiocpu, m_vlm)
MCFG_DEVICE_ADD("dac", DAC_8BIT_R2R, 0) MCFG_SOUND_ROUTE(ALL_OUTPUTS, "speaker", 0.4) // ls374.8e + r34-r47(20k) + r35-r53(10k) + r54(20k) + upc324.8f MCFG_DEVICE_ADD(m_dac, DAC_8BIT_R2R, 0) MCFG_SOUND_ROUTE(ALL_OUTPUTS, "speaker", 0.4) // ls374.8e + r34-r47(20k) + r35-r53(10k) + r54(20k) + upc324.8f
MCFG_DEVICE_ADD("vref", VOLTAGE_REGULATOR, 0) MCFG_VOLTAGE_REGULATOR_OUTPUT(5.0) MCFG_DEVICE_ADD("vref", VOLTAGE_REGULATOR, 0) MCFG_VOLTAGE_REGULATOR_OUTPUT(5.0)
MCFG_SOUND_ROUTE(0, "dac", 1.0, DAC_VREF_POS_INPUT) MCFG_SOUND_ROUTE(0, "dac", -1.0, DAC_VREF_NEG_INPUT) MCFG_SOUND_ROUTE(0, "dac", 1.0, DAC_VREF_POS_INPUT) MCFG_SOUND_ROUTE(0, "dac", -1.0, DAC_VREF_NEG_INPUT)
MCFG_DEVICE_ADD("snsnd", SN76496, SOUND_CLOCK/8) MCFG_DEVICE_ADD(m_sn, SN76496, SOUND_CLOCK/8)
MCFG_SOUND_ROUTE(ALL_OUTPUTS, "speaker", 1.0) MCFG_SOUND_ROUTE(ALL_OUTPUTS, "speaker", 1.0)
MCFG_DEVICE_ADD("vlm", VLM5030, VLM_CLOCK) MCFG_DEVICE_ADD(m_vlm, VLM5030, VLM_CLOCK)
MCFG_DEVICE_ADDRESS_MAP(0, vlm_map) MCFG_DEVICE_ADDRESS_MAP(0, vlm_map)
MCFG_SOUND_ROUTE(ALL_OUTPUTS, "speaker", 1.0) MCFG_SOUND_ROUTE(ALL_OUTPUTS, "speaker", 1.0)
MACHINE_CONFIG_END MACHINE_CONFIG_END
@ -978,7 +973,7 @@ INTERRUPT_GEN_MEMBER(trackfld_state::yieartf_timer_irq)
MACHINE_CONFIG_START(trackfld_state::yieartf) MACHINE_CONFIG_START(trackfld_state::yieartf)
/* basic machine hardware */ /* basic machine hardware */
MCFG_DEVICE_ADD("maincpu", MC6809E, MASTER_CLOCK/6/2) /* a guess for now */ MCFG_DEVICE_ADD(m_maincpu, MC6809E, MASTER_CLOCK/6/2) /* a guess for now */
MCFG_DEVICE_PROGRAM_MAP(yieartf_map) MCFG_DEVICE_PROGRAM_MAP(yieartf_map)
MCFG_DEVICE_PERIODIC_INT_DRIVER(trackfld_state, yieartf_timer_irq, 480) MCFG_DEVICE_PERIODIC_INT_DRIVER(trackfld_state, yieartf_timer_irq, 480)
@ -1004,17 +999,17 @@ MACHINE_CONFIG_START(trackfld_state::yieartf)
MCFG_WATCHDOG_ADD("watchdog") MCFG_WATCHDOG_ADD("watchdog")
/* video hardware */ /* video hardware */
MCFG_SCREEN_ADD("screen", RASTER) MCFG_SCREEN_ADD(m_screen, RASTER)
MCFG_SCREEN_REFRESH_RATE(60) MCFG_SCREEN_REFRESH_RATE(60)
MCFG_SCREEN_VBLANK_TIME(ATTOSECONDS_IN_USEC(0)) MCFG_SCREEN_VBLANK_TIME(ATTOSECONDS_IN_USEC(0))
MCFG_SCREEN_SIZE(32*8, 32*8) MCFG_SCREEN_SIZE(32*8, 32*8)
MCFG_SCREEN_VISIBLE_AREA(0*8, 32*8-1, 2*8, 30*8-1) MCFG_SCREEN_VISIBLE_AREA(0*8, 32*8-1, 2*8, 30*8-1)
MCFG_SCREEN_UPDATE_DRIVER(trackfld_state, screen_update_trackfld) MCFG_SCREEN_UPDATE_DRIVER(trackfld_state, screen_update_trackfld)
MCFG_SCREEN_PALETTE("palette") MCFG_SCREEN_PALETTE(m_palette)
MCFG_SCREEN_VBLANK_CALLBACK(WRITELINE(*this, trackfld_state, vblank_irq)) MCFG_SCREEN_VBLANK_CALLBACK(WRITELINE(*this, trackfld_state, vblank_irq))
MCFG_DEVICE_ADD("gfxdecode", GFXDECODE, "palette", gfx_trackfld) MCFG_DEVICE_ADD("gfxdecode", GFXDECODE, "palette", gfx_trackfld)
MCFG_PALETTE_ADD("palette", 16*16+16*16) MCFG_PALETTE_ADD(m_palette, 16*16+16*16)
MCFG_PALETTE_INDIRECT_ENTRIES(32) MCFG_PALETTE_INDIRECT_ENTRIES(32)
MCFG_PALETTE_INIT_OWNER(trackfld_state,trackfld) MCFG_PALETTE_INIT_OWNER(trackfld_state,trackfld)
MCFG_VIDEO_START_OVERRIDE(trackfld_state,trackfld) MCFG_VIDEO_START_OVERRIDE(trackfld_state,trackfld)
@ -1024,16 +1019,16 @@ MACHINE_CONFIG_START(trackfld_state::yieartf)
MCFG_GENERIC_LATCH_8_ADD("soundlatch") MCFG_GENERIC_LATCH_8_ADD("soundlatch")
MCFG_DEVICE_ADD("trackfld_audio", TRACKFLD_AUDIO, 0) MCFG_DEVICE_ADD(m_soundbrd, TRACKFLD_AUDIO, 0, finder_base::DUMMY_TAG, m_vlm)
MCFG_DEVICE_ADD("dac", DAC_8BIT_R2R, 0) MCFG_SOUND_ROUTE(ALL_OUTPUTS, "speaker", 0.4) // ls374.8e + r34-r47(20k) + r35-r53(10k) + r54(20k) + upc324.8f MCFG_DEVICE_ADD(m_dac, DAC_8BIT_R2R, 0) MCFG_SOUND_ROUTE(ALL_OUTPUTS, "speaker", 0.4) // ls374.8e + r34-r47(20k) + r35-r53(10k) + r54(20k) + upc324.8f
MCFG_DEVICE_ADD("vref", VOLTAGE_REGULATOR, 0) MCFG_VOLTAGE_REGULATOR_OUTPUT(5.0) MCFG_DEVICE_ADD("vref", VOLTAGE_REGULATOR, 0) MCFG_VOLTAGE_REGULATOR_OUTPUT(5.0)
MCFG_SOUND_ROUTE(0, "dac", 1.0, DAC_VREF_POS_INPUT) MCFG_SOUND_ROUTE(0, "dac", -1.0, DAC_VREF_NEG_INPUT) MCFG_SOUND_ROUTE(0, "dac", 1.0, DAC_VREF_POS_INPUT) MCFG_SOUND_ROUTE(0, "dac", -1.0, DAC_VREF_NEG_INPUT)
MCFG_DEVICE_ADD("snsnd", SN76496, MASTER_CLOCK/6/2) MCFG_DEVICE_ADD(m_sn, SN76496, MASTER_CLOCK/6/2)
MCFG_SOUND_ROUTE(ALL_OUTPUTS, "speaker", 1.0) MCFG_SOUND_ROUTE(ALL_OUTPUTS, "speaker", 1.0)
MCFG_DEVICE_ADD("vlm", VLM5030, VLM_CLOCK) MCFG_DEVICE_ADD(m_vlm, VLM5030, VLM_CLOCK)
MCFG_DEVICE_ADDRESS_MAP(0, vlm_map) MCFG_DEVICE_ADDRESS_MAP(0, vlm_map)
MCFG_SOUND_ROUTE(ALL_OUTPUTS, "speaker", 1.0) MCFG_SOUND_ROUTE(ALL_OUTPUTS, "speaker", 1.0)
MACHINE_CONFIG_END MACHINE_CONFIG_END
@ -1066,8 +1061,7 @@ void trackfld_state::hyprolyb_adpcm_map(address_map &map)
MACHINE_CONFIG_START(trackfld_state::hyprolyb) MACHINE_CONFIG_START(trackfld_state::hyprolyb)
trackfld(config); trackfld(config);
MCFG_DEVICE_MODIFY("audiocpu") m_audiocpu->set_addrmap(AS_PROGRAM, address_map_constructor(&std::remove_pointer_t<decltype(this)>::hyprolyb_sound_map, tag(), this));
MCFG_DEVICE_PROGRAM_MAP(hyprolyb_sound_map)
MCFG_MACHINE_START_OVERRIDE(trackfld_state,trackfld) MCFG_MACHINE_START_OVERRIDE(trackfld_state,trackfld)
MCFG_MACHINE_RESET_OVERRIDE(trackfld_state,trackfld) MCFG_MACHINE_RESET_OVERRIDE(trackfld_state,trackfld)
@ -1098,7 +1092,7 @@ MACHINE_CONFIG_START(trackfld_state::mastkin)
trackfld(config); trackfld(config);
/* basic machine hardware */ /* basic machine hardware */
MCFG_DEVICE_REPLACE("maincpu", MC6809E, MASTER_CLOCK/6/2) /* a guess for now */ MCFG_DEVICE_REPLACE(m_maincpu, MC6809E, MASTER_CLOCK/6/2) /* a guess for now */
MCFG_DEVICE_PROGRAM_MAP(mastkin_map) MCFG_DEVICE_PROGRAM_MAP(mastkin_map)
MCFG_DEVICE_MODIFY("mainlatch") MCFG_DEVICE_MODIFY("mainlatch")
@ -1111,11 +1105,10 @@ MACHINE_CONFIG_START(trackfld_state::wizzquiz)
/* basic machine hardware */ /* basic machine hardware */
// right cpu? // right cpu?
MCFG_DEVICE_REPLACE("maincpu",M6800,2048000) /* 1.400 MHz ??? */ MCFG_DEVICE_REPLACE(m_maincpu, M6800, 2048000) /* 1.400 MHz ??? */
MCFG_DEVICE_PROGRAM_MAP(wizzquiz_map) MCFG_DEVICE_PROGRAM_MAP(wizzquiz_map)
MCFG_DEVICE_MODIFY("screen") m_screen->set_screen_vblank(DEVCB_WRITELINE(*this, trackfld_state, vblank_nmi));
MCFG_SCREEN_VBLANK_CALLBACK(WRITELINE(*this, trackfld_state, vblank_nmi))
MCFG_DEVICE_MODIFY("mainlatch") MCFG_DEVICE_MODIFY("mainlatch")
MCFG_ADDRESSABLE_LATCH_Q7_OUT_CB(WRITELINE(*this, trackfld_state, nmi_mask_w)) MCFG_ADDRESSABLE_LATCH_Q7_OUT_CB(WRITELINE(*this, trackfld_state, nmi_mask_w))
@ -1125,7 +1118,7 @@ MACHINE_CONFIG_START(trackfld_state::reaktor)
trackfld(config); trackfld(config);
/* basic machine hardware */ /* basic machine hardware */
MCFG_DEVICE_REPLACE("maincpu",Z80,MASTER_CLOCK/6) MCFG_DEVICE_REPLACE(m_maincpu, Z80, MASTER_CLOCK/6)
MCFG_DEVICE_PROGRAM_MAP(reaktor_map) MCFG_DEVICE_PROGRAM_MAP(reaktor_map)
MCFG_DEVICE_IO_MAP(reaktor_io_map) MCFG_DEVICE_IO_MAP(reaktor_io_map)
MACHINE_CONFIG_END MACHINE_CONFIG_END

View File

@ -99,12 +99,10 @@ Sound: VLM5030 at 7B
#include "emu.h" #include "emu.h"
#include "includes/yiear.h" #include "includes/yiear.h"
#include "includes/konamipt.h" #include "includes/konamipt.h"
#include "audio/trackfld.h"
#include "cpu/m6809/m6809.h" #include "cpu/m6809/m6809.h"
#include "machine/watchdog.h" #include "machine/watchdog.h"
#include "sound/sn76496.h" #include "sound/sn76496.h"
#include "screen.h"
#include "speaker.h" #include "speaker.h"
@ -283,35 +281,35 @@ void yiear_state::machine_reset()
MACHINE_CONFIG_START(yiear_state::yiear) MACHINE_CONFIG_START(yiear_state::yiear)
/* basic machine hardware */ /* basic machine hardware */
MCFG_DEVICE_ADD("maincpu", MC6809E, XTAL(18'432'000)/12) /* verified on pcb */ MCFG_DEVICE_ADD(m_maincpu, MC6809E, XTAL(18'432'000)/12) /* verified on pcb */
MCFG_DEVICE_PROGRAM_MAP(main_map) MCFG_DEVICE_PROGRAM_MAP(main_map)
MCFG_DEVICE_PERIODIC_INT_DRIVER(yiear_state, yiear_nmi_interrupt, 480) /* music tempo (correct frequency unknown) */ MCFG_DEVICE_PERIODIC_INT_DRIVER(yiear_state, yiear_nmi_interrupt, 480) /* music tempo (correct frequency unknown) */
MCFG_WATCHDOG_ADD("watchdog") MCFG_WATCHDOG_ADD("watchdog")
/* video hardware */ /* video hardware */
MCFG_SCREEN_ADD("screen", RASTER) MCFG_SCREEN_ADD(m_screen, RASTER)
MCFG_SCREEN_REFRESH_RATE(60.58) /* verified on pcb */ MCFG_SCREEN_REFRESH_RATE(60.58) /* verified on pcb */
MCFG_SCREEN_VBLANK_TIME(ATTOSECONDS_IN_USEC(0)) MCFG_SCREEN_VBLANK_TIME(ATTOSECONDS_IN_USEC(0))
MCFG_SCREEN_SIZE(32*8, 32*8) MCFG_SCREEN_SIZE(32*8, 32*8)
MCFG_SCREEN_VISIBLE_AREA(0*8, 32*8-1, 2*8, 30*8-1) MCFG_SCREEN_VISIBLE_AREA(0*8, 32*8-1, 2*8, 30*8-1)
MCFG_SCREEN_UPDATE_DRIVER(yiear_state, screen_update_yiear) MCFG_SCREEN_UPDATE_DRIVER(yiear_state, screen_update_yiear)
MCFG_SCREEN_PALETTE("palette") MCFG_SCREEN_PALETTE(m_palette)
MCFG_SCREEN_VBLANK_CALLBACK(WRITELINE(*this, yiear_state, vblank_irq)) MCFG_SCREEN_VBLANK_CALLBACK(WRITELINE(*this, yiear_state, vblank_irq))
MCFG_DEVICE_ADD("gfxdecode", GFXDECODE, "palette", gfx_yiear) MCFG_DEVICE_ADD("gfxdecode", GFXDECODE, "palette", gfx_yiear)
MCFG_PALETTE_ADD("palette", 32) MCFG_PALETTE_ADD(m_palette, 32)
MCFG_PALETTE_INIT_OWNER(yiear_state, yiear) MCFG_PALETTE_INIT_OWNER(yiear_state, yiear)
/* sound hardware */ /* sound hardware */
SPEAKER(config, "mono").front_center(); SPEAKER(config, "mono").front_center();
MCFG_DEVICE_ADD("trackfld_audio", TRACKFLD_AUDIO, 0) MCFG_DEVICE_ADD(m_audio, TRACKFLD_AUDIO, 0, finder_base::DUMMY_TAG, m_vlm)
MCFG_DEVICE_ADD("snsnd", SN76489A, XTAL(18'432'000)/12) /* verified on pcb */ MCFG_DEVICE_ADD(m_sn, SN76489A, XTAL(18'432'000)/12) /* verified on pcb */
MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.0) MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.0)
MCFG_DEVICE_ADD("vlm", VLM5030, XTAL(3'579'545)) /* verified on pcb */ MCFG_DEVICE_ADD(m_vlm, VLM5030, XTAL(3'579'545)) /* verified on pcb */
MCFG_DEVICE_ADDRESS_MAP(0, vlm_map) MCFG_DEVICE_ADDRESS_MAP(0, vlm_map)
MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.0) MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.0)
MACHINE_CONFIG_END MACHINE_CONFIG_END

View File

@ -1,9 +1,13 @@
// license:BSD-3-Clause // license:BSD-3-Clause
// copyright-holders:Chris Hardy // copyright-holders:Chris Hardy
#include "audio/trackfld.h"
#include "sound/dac.h"
#include "sound/sn76496.h" #include "sound/sn76496.h"
#include "sound/vlm5030.h" #include "sound/vlm5030.h"
#include "screen.h"
class hyperspt_state : public driver_device class hyperspt_state : public driver_device
{ {
public: public:
@ -14,8 +18,12 @@ public:
m_videoram(*this, "videoram"), m_videoram(*this, "videoram"),
m_colorram(*this, "colorram"), m_colorram(*this, "colorram"),
m_maincpu(*this, "maincpu"), m_maincpu(*this, "maincpu"),
m_audiocpu(*this, "audiocpu"),
m_soundbrd(*this, "trackfld_audio"),
m_dac(*this, "dac"),
m_sn(*this, "snsnd"), m_sn(*this, "snsnd"),
m_vlm(*this, "vlm"), m_vlm(*this, "vlm"),
m_screen(*this, "screen"),
m_gfxdecode(*this, "gfxdecode"), m_gfxdecode(*this, "gfxdecode"),
m_palette(*this, "palette") { } m_palette(*this, "palette") { }
@ -27,8 +35,12 @@ public:
/* devices */ /* devices */
required_device<cpu_device> m_maincpu; required_device<cpu_device> m_maincpu;
required_device<cpu_device> m_audiocpu;
optional_device<trackfld_audio_device> m_soundbrd;
required_device<dac_8bit_r2r_device> m_dac;
optional_device<sn76496_device> m_sn; optional_device<sn76496_device> m_sn;
optional_device<vlm5030_device> m_vlm; optional_device<vlm5030_device> m_vlm;
required_device<screen_device> m_screen;
required_device<gfxdecode_device> m_gfxdecode; required_device<gfxdecode_device> m_gfxdecode;
required_device<palette_device> m_palette; required_device<palette_device> m_palette;

View File

@ -1,9 +1,13 @@
// license:BSD-3-Clause // license:BSD-3-Clause
// copyright-holders:Zsolt Vasvari // copyright-holders:Zsolt Vasvari
#include "audio/trackfld.h"
#include "sound/dac.h"
#include "sound/sn76496.h" #include "sound/sn76496.h"
#include "sound/vlm5030.h" #include "sound/vlm5030.h"
#include "screen.h"
class sbasketb_state : public driver_device class sbasketb_state : public driver_device
{ {
public: public:
@ -16,8 +20,11 @@ public:
m_scroll(*this, "scroll"), m_scroll(*this, "scroll"),
m_maincpu(*this, "maincpu"), m_maincpu(*this, "maincpu"),
m_audiocpu(*this, "audiocpu"), m_audiocpu(*this, "audiocpu"),
m_soundbrd(*this, "trackfld_audio"),
m_dac(*this, "dac"),
m_sn(*this, "snsnd"), m_sn(*this, "snsnd"),
m_vlm(*this, "vlm"), m_vlm(*this, "vlm"),
m_screen(*this, "screen"),
m_gfxdecode(*this, "gfxdecode"), m_gfxdecode(*this, "gfxdecode"),
m_palette(*this, "palette") { } m_palette(*this, "palette") { }
@ -31,8 +38,11 @@ public:
/* devices */ /* devices */
required_device<cpu_device> m_maincpu; required_device<cpu_device> m_maincpu;
required_device<cpu_device> m_audiocpu; required_device<cpu_device> m_audiocpu;
required_device<trackfld_audio_device> m_soundbrd;
required_device<dac_8bit_r2r_device> m_dac;
required_device<sn76489_device> m_sn; required_device<sn76489_device> m_sn;
required_device<vlm5030_device> m_vlm; required_device<vlm5030_device> m_vlm;
required_device<screen_device> m_screen;
required_device<gfxdecode_device> m_gfxdecode; required_device<gfxdecode_device> m_gfxdecode;
required_device<palette_device> m_palette; required_device<palette_device> m_palette;

View File

@ -6,9 +6,13 @@
***************************************************************************/ ***************************************************************************/
#include "audio/trackfld.h"
#include "sound/dac.h"
#include "sound/sn76496.h" #include "sound/sn76496.h"
#include "sound/vlm5030.h" #include "sound/vlm5030.h"
#include "screen.h"
class trackfld_state : public driver_device class trackfld_state : public driver_device
{ {
public: public:
@ -21,8 +25,12 @@ public:
m_videoram(*this, "videoram"), m_videoram(*this, "videoram"),
m_colorram(*this, "colorram"), m_colorram(*this, "colorram"),
m_maincpu(*this, "maincpu"), m_maincpu(*this, "maincpu"),
m_audiocpu(*this, "audiocpu"),
m_soundbrd(*this, "trackfld_audio"),
m_sn(*this, "snsnd"), m_sn(*this, "snsnd"),
m_vlm(*this, "vlm"), m_vlm(*this, "vlm"),
m_dac(*this, "dac"),
m_screen(*this, "screen"),
m_gfxdecode(*this, "gfxdecode"), m_gfxdecode(*this, "gfxdecode"),
m_palette(*this, "palette") { } m_palette(*this, "palette") { }
@ -72,8 +80,12 @@ private:
/* devices */ /* devices */
required_device<cpu_device> m_maincpu; required_device<cpu_device> m_maincpu;
optional_device<cpu_device> m_audiocpu;
optional_device<trackfld_audio_device> m_soundbrd;
optional_device<sn76496_device> m_sn; optional_device<sn76496_device> m_sn;
optional_device<vlm5030_device> m_vlm; optional_device<vlm5030_device> m_vlm;
required_device<dac_8bit_r2r_device> m_dac;
required_device<screen_device> m_screen;
required_device<gfxdecode_device> m_gfxdecode; required_device<gfxdecode_device> m_gfxdecode;
required_device<palette_device> m_palette; required_device<palette_device> m_palette;

View File

@ -1,9 +1,17 @@
// license:BSD-3-Clause // license:BSD-3-Clause
// copyright-holders:Phil Stroffolino // copyright-holders:Phil Stroffolino
// thanks-to:Enrique Sanchez // thanks-to:Enrique Sanchez
#ifndef MAME_INCLUDES_YIEAR
#define MAME_INCLUDES_YIEAR
#pragma once
#include "audio/trackfld.h"
#include "sound/sn76496.h" #include "sound/sn76496.h"
#include "sound/vlm5030.h" #include "sound/vlm5030.h"
#include "screen.h"
class yiear_state : public driver_device class yiear_state : public driver_device
{ {
public: public:
@ -13,9 +21,11 @@ public:
m_spriteram2(*this, "spriteram2"), m_spriteram2(*this, "spriteram2"),
m_videoram(*this, "videoram"), m_videoram(*this, "videoram"),
m_maincpu(*this, "maincpu"), m_maincpu(*this, "maincpu"),
m_audio(*this, "trackfld_audio"),
m_sn(*this, "snsnd"), m_sn(*this, "snsnd"),
m_vlm(*this, "vlm"), m_vlm(*this, "vlm"),
m_gfxdecode(*this, "gfxdecode"), m_gfxdecode(*this, "gfxdecode"),
m_screen(*this, "screen"),
m_palette(*this, "palette") { } m_palette(*this, "palette") { }
/* memory pointers */ /* memory pointers */
@ -25,9 +35,11 @@ public:
/* devices */ /* devices */
required_device<cpu_device> m_maincpu; required_device<cpu_device> m_maincpu;
required_device<trackfld_audio_device> m_audio;
required_device<sn76489a_device> m_sn; required_device<sn76489a_device> m_sn;
required_device<vlm5030_device> m_vlm; required_device<vlm5030_device> m_vlm;
required_device<gfxdecode_device> m_gfxdecode; required_device<gfxdecode_device> m_gfxdecode;
required_device<screen_device> m_screen;
required_device<palette_device> m_palette; required_device<palette_device> m_palette;
/* video-related */ /* video-related */
@ -56,3 +68,5 @@ public:
void main_map(address_map &map); void main_map(address_map &map);
void vlm_map(address_map &map); void vlm_map(address_map &map);
}; };
#endif // MAME_INCLUDES_YIEAR