Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 25 additions & 0 deletions scripts/src/bus.lua
Original file line number Diff line number Diff line change
Expand Up @@ -900,6 +900,31 @@ if (BUSES["BBC_VSP"]~=null) then
end


---------------------------------------------------
--
--@src/devices/bus/bk/parallel.h,BUSES["BK_PARALLEL"] = true
---------------------------------------------------

if (BUSES["BK_PARALLEL"]~=null) then
files {
MAME_DIR .. "src/devices/bus/bk/parallel.cpp",
MAME_DIR .. "src/devices/bus/bk/parallel.h",
MAME_DIR .. "src/devices/bus/bk/carts.cpp",
MAME_DIR .. "src/devices/bus/bk/carts.h",
MAME_DIR .. "src/devices/bus/bk/ay.cpp",
MAME_DIR .. "src/devices/bus/bk/ay.h",
MAME_DIR .. "src/devices/bus/bk/covox.cpp",
MAME_DIR .. "src/devices/bus/bk/covox.h",
MAME_DIR .. "src/devices/bus/bk/joystick.cpp",
MAME_DIR .. "src/devices/bus/bk/joystick.h",
MAME_DIR .. "src/devices/bus/bk/loopback.cpp",
MAME_DIR .. "src/devices/bus/bk/loopback.h",
MAME_DIR .. "src/devices/bus/bk/printer.cpp",
MAME_DIR .. "src/devices/bus/bk/printer.h",
}
end


---------------------------------------------------
--
--@src/devices/bus/bw2/exp.h,BUSES["BW2"] = true
Expand Down
79 changes: 79 additions & 0 deletions src/devices/bus/bk/ay.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,79 @@
// license:BSD-3-Clause
// copyright-holders:Sergey Svishchev
/***************************************************************************
AY mod (1.667 MHz clock).
Variants of the mod used 1.5 or 1.75 MHz clock.
Reads are passed through to external slot, usually occupied by
joystick interface.
***************************************************************************/

#include "emu.h"
#include "ay.h"


//**************************************************************************
// CONSTANTS/MACROS
//**************************************************************************

#define VERBOSE 0


//**************************************************************************
// DEVICE DEFINITIONS
//**************************************************************************

DEFINE_DEVICE_TYPE(BK_AY, bk_ay_device, "bk_ay", "Single AY Interface")


//**************************************************************************
// LIVE DEVICE
//**************************************************************************

//-------------------------------------------------
// bk_ay_device - constructor
//-------------------------------------------------

bk_ay_device::bk_ay_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock)
: device_t(mconfig, BK_AY, tag, owner, clock)
, device_bk_parallel_interface(mconfig, *this)
, m_ay(*this, "ay")
, m_up(*this, "up")
{
}


//**************************************************************************
// IMPLEMENTATION
//**************************************************************************

void bk_ay_device::device_add_mconfig(machine_config &config)
{
SPEAKER(config, "lspeaker").front_left();
SPEAKER(config, "rspeaker").front_right();

YM2149(config, m_ay, 1667000);
m_ay->add_route(0, "rspeaker", 0.5);
m_ay->add_route(2, "rspeaker", 0.5);
m_ay->add_route(1, "lspeaker", 0.5);
m_ay->add_route(2, "lspeaker", 0.5);

BK_PARALLEL_SLOT(config, m_up, DERIVED_CLOCK(1, 1), bk_parallel_devices, nullptr);
}

uint16_t bk_ay_device::io_r()
{
return m_up->read() ^ 0xffff;
}

void bk_ay_device::io_w(uint16_t data, bool word)
{
if (word)
m_ay->address_w(data);
else
m_ay->data_w(data);
m_up->write(0, data ^ 0xffff, word);
}
50 changes: 50 additions & 0 deletions src/devices/bus/bk/ay.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
// license:BSD-3-Clause
// copyright-holders:Sergey Svishchev
/***************************************************************************

AY mod

***************************************************************************/

#ifndef MAME_BUS_BK_AY_H
#define MAME_BUS_BK_AY_H

#pragma once

#include "parallel.h"

#include "sound.h"
#include "sound/ay8910.h"
#include "speaker.h"


//**************************************************************************
// TYPE DEFINITIONS
//**************************************************************************

// ======================> bk_ay_device

class bk_ay_device : public device_t, public device_bk_parallel_interface
{
public:
// construction/destruction
bk_ay_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock);

protected:
virtual void device_start() override {};
virtual void device_reset() override {};

virtual uint16_t io_r() override;
virtual void io_w(uint16_t data, bool word) override;

private:
virtual void device_add_mconfig(machine_config &config) override;

required_device<ym2149_device> m_ay;
required_device<bk_parallel_slot_device> m_up;
};

// device type definition
DECLARE_DEVICE_TYPE(BK_AY, bk_ay_device)

#endif // MAME_BUS_BK_AY_H
26 changes: 26 additions & 0 deletions src/devices/bus/bk/carts.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
// license:BSD-3-Clause
// copyright-holders:Sergey Svishchev
/***************************************************************************
BK parallel slot carts
***************************************************************************/

#include "emu.h"
#include "carts.h"

#include "ay.h"
#include "covox.h"
#include "joystick.h"
#include "loopback.h"
#include "printer.h"


void bk_parallel_devices(device_slot_interface &device)
{
device.option_add("ay", BK_AY);
device.option_add("covox", BK_COVOX);
device.option_add("joystick", BK_JOYSTICK);
device.option_add("loopback", BK_LOOPBACK);
device.option_add("printer", BK_PRINTER);
}
17 changes: 17 additions & 0 deletions src/devices/bus/bk/carts.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
// license:BSD-3-Clause
// copyright-holders:Sergey Svishchev
/***************************************************************************
BK parallel slot carts
***************************************************************************/

#ifndef MAME_BUS_BK_CARTS_H
#define MAME_BUS_BK_CARTS_H

#pragma once


void bk_parallel_devices(device_slot_interface &device);

#endif // MAME_BUS_BK_CARTS_H
72 changes: 72 additions & 0 deletions src/devices/bus/bk/covox.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,72 @@
// license:BSD-3-Clause
// copyright-holders:Sergey Svishchev
/***************************************************************************
Mono Covox interface with passthrough for loopback cart
(used by "In Your Space" demo.)
***************************************************************************/

#include "emu.h"
#include "covox.h"


//**************************************************************************
// CONSTANTS/MACROS
//**************************************************************************

#define VERBOSE 0


//**************************************************************************
// DEVICE DEFINITIONS
//**************************************************************************

DEFINE_DEVICE_TYPE(BK_COVOX, bk_covox_device, "bk_covox", "Mono Covox Interface")


//**************************************************************************
// LIVE DEVICE
//**************************************************************************

//-------------------------------------------------
// bk_covox_device - constructor
//-------------------------------------------------

bk_covox_device::bk_covox_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock)
: device_t(mconfig, BK_COVOX, tag, owner, clock)
, device_bk_parallel_interface(mconfig, *this)
, m_dac(*this, "dac")
, m_up(*this, "up")
{
}


//**************************************************************************
// IMPLEMENTATION
//**************************************************************************

void bk_covox_device::device_add_mconfig(machine_config &config)
{
SPEAKER(config, "covox").front_center();
DAC_8BIT_R2R(config, m_dac, 0).add_route(ALL_OUTPUTS, "covox", 0.5); // unknown DAC

BK_PARALLEL_SLOT(config, m_up, DERIVED_CLOCK(1, 1), bk_parallel_devices, nullptr);
}

void bk_covox_device::device_start()
{
save_item(NAME(m_data));
}

uint16_t bk_covox_device::io_r()
{
return m_up->read() ^ 0xffff;
}

void bk_covox_device::io_w(uint16_t data, bool word)
{
m_data = data;
m_dac->write(data);
m_up->write(0, data ^ 0xffff, word);
}
51 changes: 51 additions & 0 deletions src/devices/bus/bk/covox.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
// license:BSD-3-Clause
// copyright-holders:Sergey Svishchev
/***************************************************************************

Mono Covox interface

***************************************************************************/

#ifndef MAME_BUS_BK_COVOX_H
#define MAME_BUS_BK_COVOX_H

#pragma once

#include "parallel.h"

#include "sound/dac.h"
#include "speaker.h"


//**************************************************************************
// TYPE DEFINITIONS
//**************************************************************************

// ======================> bk_covox_device

class bk_covox_device : public device_t, public device_bk_parallel_interface
{
public:
// construction/destruction
bk_covox_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock);

protected:
virtual void device_start() override;
virtual void device_reset() override { m_data = 0; };

virtual uint16_t io_r() override;
virtual void io_w(uint16_t data, bool word) override;

private:
virtual void device_add_mconfig(machine_config &config) override;

required_device<dac_byte_interface> m_dac;
required_device<bk_parallel_slot_device> m_up;

uint16_t m_data;
};

// device type definition
DECLARE_DEVICE_TYPE(BK_COVOX, bk_covox_device)

#endif // MAME_BUS_BK_COVOX_H
Loading
Loading