(nw) nascom1/2: cassette fixed ; added more cassette wav sounds

This commit is contained in:
Robbbert 2019-06-29 22:34:42 +10:00
parent 7a3eb11ab1
commit 4064f2ba82
20 changed files with 82 additions and 39 deletions

View File

@ -292,7 +292,7 @@ void cp1_state::cp1(machine_config &config)
CASSETTE(config, m_cassette);
m_cassette->set_default_state(CASSETTE_STOPPED | CASSETTE_SPEAKER_ENABLED | CASSETTE_MOTOR_ENABLED);
SPEAKER(config, "mono").front_center();
WAVE(config, "wave", m_cassette).add_route(ALL_OUTPUTS, "mono", 0.05);
WAVE(config, "wave", m_cassette).add_route(ALL_OUTPUTS, "mono", 0.50);
QUICKLOAD(config, "quickload").set_handler(snapquick_load_delegate(&QUICKLOAD_LOAD_NAME(cp1_state, quickload), this), "obj", attotime::from_seconds(1));
}

View File

@ -90,8 +90,8 @@ private:
DECLARE_WRITE8_MEMBER( d6800_keyboard_w );
DECLARE_WRITE_LINE_MEMBER( d6800_screen_w );
uint32_t screen_update_d6800(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
TIMER_DEVICE_CALLBACK_MEMBER(d6800_c);
TIMER_DEVICE_CALLBACK_MEMBER(d6800_p);
TIMER_DEVICE_CALLBACK_MEMBER(kansas_w);
TIMER_DEVICE_CALLBACK_MEMBER(kansas_r);
DECLARE_QUICKLOAD_LOAD_MEMBER( d6800 );
void d6800_map(address_map &map);
@ -239,7 +239,7 @@ uint32_t d6800_state::screen_update_d6800(screen_device &screen, bitmap_ind16 &b
/* NE556 */
TIMER_DEVICE_CALLBACK_MEMBER(d6800_state::d6800_c)
TIMER_DEVICE_CALLBACK_MEMBER(d6800_state::kansas_w)
{
m_cass_data[3]++;
@ -257,7 +257,7 @@ TIMER_DEVICE_CALLBACK_MEMBER(d6800_state::d6800_c)
/* PIA6821 Interface */
TIMER_DEVICE_CALLBACK_MEMBER(d6800_state::d6800_p)
TIMER_DEVICE_CALLBACK_MEMBER(d6800_state::kansas_r)
{
m_rtc++;
if (m_rtc > 159)
@ -425,7 +425,7 @@ MACHINE_CONFIG_START(d6800_state::d6800)
/* sound hardware */
SPEAKER(config, "mono").front_center();
WAVE(config, "wave", m_cass).add_route(ALL_OUTPUTS, "mono", 0.50);
WAVE(config, "wave", m_cass).add_route(ALL_OUTPUTS, "mono", 0.05);
BEEP(config, "beeper", 1200).add_route(ALL_OUTPUTS, "mono", 0.50);
/* devices */
@ -441,8 +441,8 @@ MACHINE_CONFIG_START(d6800_state::d6800)
CASSETTE(config, m_cass);
m_cass->set_default_state(CASSETTE_STOPPED | CASSETTE_MOTOR_ENABLED | CASSETTE_SPEAKER_MUTED);
TIMER(config, "d6800_c").configure_periodic(FUNC(d6800_state::d6800_c), attotime::from_hz(4800));
TIMER(config, "d6800_p").configure_periodic(FUNC(d6800_state::d6800_p), attotime::from_hz(40000));
TIMER(config, "kansas_w").configure_periodic(FUNC(d6800_state::kansas_w), attotime::from_hz(4800));
TIMER(config, "kansas_r").configure_periodic(FUNC(d6800_state::kansas_r), attotime::from_hz(40000));
/* quickload */
MCFG_QUICKLOAD_ADD("quickload", d6800_state, d6800, "bin,c8,ch8", attotime::from_seconds(1))

View File

@ -221,7 +221,7 @@ void dai_state::dai(machine_config &config)
/* sound hardware */
SPEAKER(config, "mono").front_center();
WAVE(config, "wave", m_cassette).add_route(ALL_OUTPUTS, "mono", 0.25);
WAVE(config, "wave", m_cassette).add_route(ALL_OUTPUTS, "mono", 0.05);
SPEAKER(config, "lspeaker").front_left();
SPEAKER(config, "rspeaker").front_right();
DAI_SOUND(config, m_sound).add_route(0, "lspeaker", 0.50).add_route(1, "rspeaker", 0.50);

View File

@ -242,7 +242,7 @@ void dauphin_state::dauphin(machine_config &config)
/* sound hardware */
SPEAKER(config, "mono").front_center();
SPEAKER_SOUND(config, m_speaker).add_route(ALL_OUTPUTS, "mono", 1.00);
WAVE(config, "wave", m_cass).add_route(ALL_OUTPUTS, "mono", 0.25);
WAVE(config, "wave", m_cass).add_route(ALL_OUTPUTS, "mono", 0.05);
/* cassette */
CASSETTE(config, m_cass);

View File

@ -220,7 +220,7 @@ void dragon_state::dragon_base(machine_config &config)
m_sam->res_rd_callback().set(FUNC(dragon_state::sam_read));
CASSETTE(config, m_cassette);
m_cassette->set_formats(coco_cassette_formats);
m_cassette->set_default_state(CASSETTE_PLAY | CASSETTE_MOTOR_DISABLED | CASSETTE_SPEAKER_MUTED);
m_cassette->set_default_state(CASSETTE_PLAY | CASSETTE_MOTOR_DISABLED | CASSETTE_SPEAKER_ENABLED);
m_cassette->set_interface("dragon_cass");
PRINTER(config, m_printer, 0);

View File

@ -37,6 +37,8 @@
// Features
#include "imagedev/cassette.h"
#include "bus/rs232/rs232.h"
#include "sound/wave.h"
#include "speaker.h"
#include "emupal.h"
#include "screen.h"
@ -587,7 +589,9 @@ void e100_state::e100(machine_config &config)
* E100 supports cassette through the 'LOAD' and 'SAVE' commands with no arguments
*/
CASSETTE(config, m_cassette);
m_cassette->set_default_state(CASSETTE_STOPPED | CASSETTE_SPEAKER_MUTED | CASSETTE_MOTOR_ENABLED);
m_cassette->set_default_state(CASSETTE_STOPPED | CASSETTE_SPEAKER_ENABLED | CASSETTE_MOTOR_ENABLED);
SPEAKER(config, "mono").front_center();
WAVE(config, "wave", m_cassette).add_route(ALL_OUTPUTS, "mono", 0.05);
/* screen TODO: simplify the screen config, look at zx.cpp */
screen_device &screen(SCREEN(config, "screen", SCREEN_TYPE_RASTER));

View File

@ -16,8 +16,10 @@
#include "emu.h"
#include "includes/elf.h"
#include "elf2.lh"
#include "screen.h"
#include "sound/wave.h"
#include "speaker.h"
#include "elf2.lh"
#define RUN \
BIT(m_special->read(), 0)
@ -273,7 +275,9 @@ void elf2_state::elf2(machine_config &config)
DM9368(config, m_led_l, 0).update_cb().set(FUNC(elf2_state::digit_w<1>));
CASSETTE(config, m_cassette);
m_cassette->set_default_state(CASSETTE_STOPPED | CASSETTE_MOTOR_ENABLED | CASSETTE_SPEAKER_MUTED);
m_cassette->set_default_state(CASSETTE_STOPPED | CASSETTE_MOTOR_ENABLED | CASSETTE_SPEAKER_ENABLED);
SPEAKER(config, "mono").front_center();
WAVE(config, "wave", m_cassette).add_route(ALL_OUTPUTS, "mono", 0.05);
QUICKLOAD(config, "quickload").set_handler(snapquick_load_delegate(&QUICKLOAD_LOAD_NAME(elf2_state, elf), this), "bin");

View File

@ -606,7 +606,7 @@ void elwro800_state::elwro800(machine_config &config)
/* sound hardware */
SPEAKER(config, "mono").front_center();
WAVE(config, "wave", m_cassette).add_route(ALL_OUTPUTS, "mono", 0.25);
WAVE(config, "wave", m_cassette).add_route(ALL_OUTPUTS, "mono", 0.05);
SPEAKER_SOUND(config, "speaker").add_route(ALL_OUTPUTS, "mono", 0.50);
CASSETTE(config, m_cassette);

View File

@ -161,6 +161,7 @@ Notes: (All IC's shown)
#include "machine/ram.h"
#include "sound/dave.h"
#include "video/nick.h"
#include "sound/wave.h"
#include "softlist.h"
#include "speaker.h"
@ -600,6 +601,8 @@ void ep64_state::ep64(machine_config &config)
m_dave->irq_wr().set_inputline(Z80_TAG, INPUT_LINE_IRQ0);
m_dave->add_route(0, "lspeaker", 0.25);
m_dave->add_route(1, "rspeaker", 0.25);
WAVE(config, "wave1", m_cassette1).add_route(ALL_OUTPUTS, "lspeaker", 0.05);
WAVE(config, "wave2", m_cassette2).add_route(ALL_OUTPUTS, "rspeaker", 0.05);
// devices
EP64_EXPANSION_BUS_SLOT(config, m_exp, nullptr);

View File

@ -37,6 +37,7 @@
#include "emu.h"
#include "includes/eti660.h"
#include "sound/wave.h"
#include "screen.h"
#include "speaker.h"
@ -328,7 +329,8 @@ MACHINE_CONFIG_START(eti660_state::eti660)
m_pia->irqb_handler().set_inputline(m_maincpu, COSMAC_INPUT_LINE_INT).invert();
CASSETTE(config, m_cassette);
m_cassette->set_default_state(CASSETTE_STOPPED | CASSETTE_MOTOR_ENABLED | CASSETTE_SPEAKER_MUTED);
m_cassette->set_default_state(CASSETTE_STOPPED | CASSETTE_MOTOR_ENABLED | CASSETTE_SPEAKER_ENABLED);
WAVE(config, "wave", m_cassette).add_route(ALL_OUTPUTS, "mono", 0.05);
/* internal ram */
RAM(config, RAM_TAG).set_default_size("3K");

View File

@ -35,6 +35,7 @@
#include "machine/i8155.h"
#include "machine/i8355.h"
#include "machine/ram.h"
#include "sound/wave.h"
#include "speaker.h"
/* Memory Maps */
@ -201,6 +202,7 @@ void exp85_state::exp85(machine_config &config)
CASSETTE(config, m_cassette);
m_cassette->set_default_state(CASSETTE_STOPPED | CASSETTE_MOTOR_ENABLED | CASSETTE_SPEAKER_ENABLED);
WAVE(config, "wave", m_cassette).add_route(ALL_OUTPUTS, "mono", 0.05);
RS232_PORT(config, "rs232", default_rs232_devices, "terminal").set_option_device_input_defaults("terminal", DEVICE_INPUT_DEFAULTS_NAME(terminal));

View File

@ -2047,7 +2047,7 @@ void fm7_state::fm7(machine_config &config)
SPEAKER(config, "mono").front_center();
AY8910(config, m_psg, 4.9152_MHz_XTAL / 4).add_route(ALL_OUTPUTS,"mono", 1.00);
BEEP(config, "beeper", 1200).add_route(ALL_OUTPUTS, "mono", 0.50);
WAVE(config, "wave", m_cassette).add_route(ALL_OUTPUTS, "mono", 0.25);
WAVE(config, "wave", m_cassette).add_route(ALL_OUTPUTS, "mono", 0.05);
MCFG_MACHINE_START_OVERRIDE(fm7_state,fm7)
@ -2100,7 +2100,7 @@ void fm7_state::fm8(machine_config &config)
SPEAKER(config, "mono").front_center();
BEEP(config, m_beeper, 1200).add_route(ALL_OUTPUTS, "mono", 0.50);
WAVE(config, "wave", m_cassette).add_route(ALL_OUTPUTS, "mono", 0.25);
WAVE(config, "wave", m_cassette).add_route(ALL_OUTPUTS, "mono", 0.05);
MCFG_MACHINE_START_OVERRIDE(fm7_state,fm7)
@ -2153,7 +2153,7 @@ void fm7_state::fm77av(machine_config &config)
m_ym->port_b_read_callback().set(FUNC(fm7_state::fm77av_joy_2_r));
m_ym->add_route(ALL_OUTPUTS,"mono", 1.00);
BEEP(config, "beeper", 1200).add_route(ALL_OUTPUTS, "mono", 0.50);
WAVE(config, "wave", m_cassette).add_route(ALL_OUTPUTS, "mono", 0.25);
WAVE(config, "wave", m_cassette).add_route(ALL_OUTPUTS, "mono", 0.05);
MCFG_MACHINE_START_OVERRIDE(fm7_state,fm77av)
@ -2216,7 +2216,7 @@ void fm7_state::fm11(machine_config &config)
SPEAKER(config, "mono").front_center();
BEEP(config, m_beeper, 1200).add_route(ALL_OUTPUTS, "mono", 0.50);
WAVE(config, "wave", m_cassette).add_route(ALL_OUTPUTS, "mono", 0.25);
WAVE(config, "wave", m_cassette).add_route(ALL_OUTPUTS, "mono", 0.05);
MCFG_MACHINE_START_OVERRIDE(fm7_state,fm11)
@ -2269,7 +2269,7 @@ void fm7_state::fm16beta(machine_config &config)
SPEAKER(config, "mono").front_center();
BEEP(config, m_beeper, 1200).add_route(ALL_OUTPUTS, "mono", 0.50);
WAVE(config, "wave", m_cassette).add_route(ALL_OUTPUTS, "mono", 0.25);
WAVE(config, "wave", m_cassette).add_route(ALL_OUTPUTS, "mono", 0.05);
MCFG_MACHINE_START_OVERRIDE(fm7_state,fm16)

View File

@ -45,6 +45,7 @@
#include "sound/beep.h"
#include "bus/centronics/ctronics.h"
#include "imagedev/cassette.h"
#include "sound/wave.h"
#include "emupal.h"
#include "screen.h"
#include "speaker.h"
@ -681,6 +682,7 @@ void fp1100_state::fp1100(machine_config &config)
/* Cassette */
CASSETTE(config, m_cass);
m_cass->set_default_state(CASSETTE_PLAY | CASSETTE_MOTOR_DISABLED | CASSETTE_SPEAKER_ENABLED);
WAVE(config, "wave", m_cass).add_route(ALL_OUTPUTS, "mono", 0.05);
TIMER(config, "kansas_w").configure_periodic(FUNC(fp1100_state::kansas_w), attotime::from_hz(4800)); // cass write
}

View File

@ -200,7 +200,7 @@ MACHINE_CONFIG_START(galaxy_state::galaxy)
MCFG_SNAPSHOT_ADD("snapshot", galaxy_state, galaxy, "gal")
SPEAKER(config, "mono").front_center();
WAVE(config, "wave", m_cassette).add_route(ALL_OUTPUTS, "mono", 0.25);
WAVE(config, "wave", m_cassette).add_route(ALL_OUTPUTS, "mono", 0.05);
CASSETTE(config, m_cassette);
m_cassette->set_formats(gtp_cassette_formats);
@ -240,7 +240,7 @@ MACHINE_CONFIG_START(galaxy_state::galaxyp)
/* sound hardware */
SPEAKER(config, "mono").front_center();
AY8910(config, "ay8910", XTAL/4); // FIXME: really no output routes for this AY?
WAVE(config, "wave", "cassette").add_route(ALL_OUTPUTS, "mono", 0.25);
WAVE(config, "wave", "cassette").add_route(ALL_OUTPUTS, "mono", 0.05);
CASSETTE(config, m_cassette);
m_cassette->set_formats(gtp_cassette_formats);

View File

@ -334,7 +334,7 @@ void h8_state::h8(machine_config &config)
/* sound hardware */
SPEAKER(config, "mono").front_center();
BEEP(config, m_beep, H8_BEEP_FRQ).add_route(ALL_OUTPUTS, "mono", 1.00);
WAVE(config, "wave", m_cass).add_route(ALL_OUTPUTS, "mono", 0.25);
WAVE(config, "wave", m_cass).add_route(ALL_OUTPUTS, "mono", 0.05);
/* Devices */
I8251(config, m_uart, 0);

View File

@ -776,7 +776,7 @@ MACHINE_CONFIG_START(homelab_state::homelab)
voltage_regulator_device &vref(VOLTAGE_REGULATOR(config, "vref", 0));
vref.add_route(0, "dac", 1.0, DAC_VREF_POS_INPUT);
WAVE(config, "wave", m_cass).add_route(ALL_OUTPUTS, "speaker", 0.25);
WAVE(config, "wave", m_cass).add_route(ALL_OUTPUTS, "speaker", 0.05);
CASSETTE(config, m_cass);
MCFG_QUICKLOAD_ADD("quickload", homelab_state, homelab, "htp", attotime::from_seconds(2))
@ -809,7 +809,7 @@ MACHINE_CONFIG_START(homelab_state::homelab3)
voltage_regulator_device &vref(VOLTAGE_REGULATOR(config, "vref", 0));
vref.add_route(0, "dac", 1.0, DAC_VREF_POS_INPUT);
WAVE(config, "wave", m_cass).add_route(ALL_OUTPUTS, "speaker", 0.25);
WAVE(config, "wave", m_cass).add_route(ALL_OUTPUTS, "speaker", 0.05);
CASSETTE(config, m_cass);
MCFG_QUICKLOAD_ADD("quickload", homelab_state, homelab, "htp", attotime::from_seconds(2))
@ -842,7 +842,7 @@ MACHINE_CONFIG_START(homelab_state::brailab4)
voltage_regulator_device &vref(VOLTAGE_REGULATOR(config, "vref", 0));
vref.add_route(0, "dac", 1.0, DAC_VREF_POS_INPUT);
WAVE(config, "wave", m_cass).add_route(ALL_OUTPUTS, "speaker", 0.25);
WAVE(config, "wave", m_cass).add_route(ALL_OUTPUTS, "speaker", 0.05);
MEA8000(config, "mea8000", 3840000).add_route(ALL_OUTPUTS, "speaker", 1.0);

View File

@ -442,7 +442,7 @@ void instruct_state::instruct(machine_config &config)
/* cassette */
CASSETTE(config, m_cass);
SPEAKER(config, "mono").front_center();
WAVE(config, "wave", m_cass).add_route(ALL_OUTPUTS, "mono", 0.25);
WAVE(config, "wave", m_cass).add_route(ALL_OUTPUTS, "mono", 0.05);
}
/* ROM definition */

View File

@ -154,7 +154,7 @@ void interact_state::interact(machine_config &config)
CASSETTE(config, m_cassette);
m_cassette->set_formats(hector_cassette_formats);
m_cassette->set_default_state(CASSETTE_STOPPED | CASSETTE_MASK_SPEAKER);
m_cassette->set_default_state(CASSETTE_STOPPED | CASSETTE_SPEAKER_ENABLED);
m_cassette->set_interface("interact_cass");
SOFTWARE_LIST(config, "cass_list").set_original("interact");
@ -190,7 +190,7 @@ void interact_state::hector1(machine_config &config)
CASSETTE(config, m_cassette);
m_cassette->set_formats(hector_cassette_formats);
m_cassette->set_default_state(CASSETTE_STOPPED | CASSETTE_MASK_SPEAKER);
m_cassette->set_default_state(CASSETTE_STOPPED | CASSETTE_SPEAKER_ENABLED);
m_cassette->set_interface("interact_cass");
/* printer */

View File

@ -51,6 +51,7 @@ ToDo:
#include "machine/pic8259.h"
#include "machine/timer.h"
#include "sound/spkrdev.h"
#include "sound/wave.h"
// cartridge slot
#include "bus/iq151/iq151.h"
@ -411,6 +412,7 @@ void iq151_state::iq151(machine_config &config)
/* sound hardware */
SPEAKER(config, "mono").front_center();
SPEAKER_SOUND(config, m_speaker).add_route(ALL_OUTPUTS, "mono", 0.50);
WAVE(config, "wave", m_cassette).add_route(ALL_OUTPUTS, "mono", 0.05);
PIC8259(config, m_pic, 0);
m_pic->out_int_callback().set_inputline(m_maincpu, 0);

View File

@ -1,12 +1,24 @@
// license:GPL-2.0+
// copyright-holders:Dirk Best,Paul Danials
/***************************************************************************
/******************************************************************************************************
Nascom 1/2/3
Nascom 1/2/3
Single board computer
Single board computer
***************************************************************************/
To Do:
- TTY
- Nascom2 has two dipswitch banks, and a memory control header
- Nascom3 (Gemini), nothing usable found
Cassette:
It outputs a string of pulses at 1953.125Hz to indicate a 1, and blank tape for 0. This means that
no tape will present a 0 to the UART instead of the expected 1 (idle). Part of the cassette
schematic is missing, so a few liberties have been taken. The result is you can save a file and
load it back. Haven't found wav files on the net to test with.
*****************************************************************************************************/
#include "emu.h"
@ -87,6 +99,7 @@ private:
uint8_t m_kb_control;
bool m_cassinbit, m_cassoutbit, m_cassold;
u16 m_cass_cnt[2];
u8 m_port00;
TIMER_DEVICE_CALLBACK_MEMBER(kansas_r);
DECLARE_READ_LINE_MEMBER(nascom1_hd6402_si);
@ -162,8 +175,10 @@ READ8_MEMBER( nascom_state::nascom1_port_00_r )
WRITE8_MEMBER( nascom_state::nascom1_port_00_w )
{
m_cass->change_state(
(data & 0x10) ? CASSETTE_MOTOR_ENABLED : CASSETTE_MOTOR_DISABLED, CASSETTE_MASK_MOTOR);
u8 bits = data ^ m_port00;
if (BIT(bits, 4))
m_cass->change_state(BIT(data, 4) ? CASSETTE_MOTOR_ENABLED : CASSETTE_MOTOR_DISABLED, CASSETTE_MASK_MOTOR);
// d0 falling edge: increment keyboard matrix column select counter
if (m_kb_control & ~data & 1)
@ -193,7 +208,7 @@ WRITE8_MEMBER( nascom_state::nascom1_port_01_w )
READ8_MEMBER( nascom_state::nascom1_port_02_r )
{
uint8_t data = 0x31;
uint8_t data = 0x31; // bits 0,4,5 not used
m_hd6402->write_swe(0);
data |= m_hd6402->or_r( ) ? 0x02 : 0;
@ -224,7 +239,7 @@ WRITE_LINE_MEMBER( nascom_state::kansas_w )
if (m_cassoutbit)
m_cass->output(BIT(m_cass_cnt[0], 0) ? -1.0 : +1.0); // 1953.125Hz
else
m_cass->output(0.0);
m_cass->output(1.0);
m_cass_cnt[0]++;
}
@ -240,11 +255,18 @@ TIMER_DEVICE_CALLBACK_MEMBER( nascom_state::kansas_r )
if (cass_ws != m_cassold)
{
m_cassold = cass_ws;
m_cassinbit = (m_cass_cnt[1] < 40) ? 1 : 0;
m_cassinbit = 1;
m_cass_cnt[1] = 0;
}
else
if (m_cass_cnt[1] > 10)
{
m_cass_cnt[1] = 10;
m_cassinbit = !cass_ws;
}
}
// This stuff has never been connected up - what's it for?
DEVICE_IMAGE_LOAD_MEMBER( nascom_state, nascom1_cassette )
{
m_tape_size = image.length();
@ -377,6 +399,7 @@ void nascom_state::machine_reset()
{
m_kb_select = 0;
m_kb_control = 0;
m_port00 = 0;
// Set up hd6402 pins
m_hd6402->write_swe(1);
@ -705,6 +728,7 @@ void nascom_state::nascom(machine_config &config)
AY31015(config, m_hd6402);
m_hd6402->read_si_callback().set(FUNC(nascom_state::nascom1_hd6402_si));
m_hd6402->write_so_callback().set(FUNC(nascom_state::nascom1_hd6402_so));
m_hd6402->set_auto_rdav(true);
clock_device &uart_clock(CLOCK(config, "uart_clock", (16_MHz_XTAL / 16) / 256));
uart_clock.signal_handler().set(FUNC(nascom_state::kansas_w));