mirror of
https://github.com/holub/mame
synced 2025-05-28 16:43:04 +03:00
a8sio: Radical excision of interface brain damage (nw)
a1050: Fix bad copy/paste (nw)
This commit is contained in:
parent
f1bd8930be
commit
08215864bb
@ -41,48 +41,7 @@
|
||||
// GLOBAL VARIABLES
|
||||
//**************************************************************************
|
||||
|
||||
DEFINE_DEVICE_TYPE(A8SIO_SLOT, a8sio_slot_device, "a8sio_slot", "Atari 8 bit SIO Slot")
|
||||
|
||||
//**************************************************************************
|
||||
// LIVE DEVICE
|
||||
//**************************************************************************
|
||||
|
||||
//-------------------------------------------------
|
||||
// a8sio_slot_device - constructor
|
||||
//-------------------------------------------------
|
||||
a8sio_slot_device::a8sio_slot_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock)
|
||||
: a8sio_slot_device(mconfig, A8SIO_SLOT, tag, owner, clock)
|
||||
{
|
||||
}
|
||||
|
||||
a8sio_slot_device::a8sio_slot_device(const machine_config &mconfig, device_type type, const char *tag, device_t *owner, uint32_t clock) :
|
||||
device_t(mconfig, type, tag, owner, clock),
|
||||
device_slot_interface(mconfig, *this), m_a8sio_tag(nullptr), m_a8sio_slottag(nullptr)
|
||||
{
|
||||
}
|
||||
|
||||
//-------------------------------------------------
|
||||
// device_start - device-specific startup
|
||||
//-------------------------------------------------
|
||||
|
||||
void a8sio_slot_device::device_start()
|
||||
{
|
||||
device_a8sio_card_interface *dev = dynamic_cast<device_a8sio_card_interface *>(get_card_device());
|
||||
|
||||
if (dev)
|
||||
{
|
||||
dev->set_a8sio_tag(m_a8sio_tag, m_a8sio_slottag);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
//**************************************************************************
|
||||
// GLOBAL VARIABLES
|
||||
//**************************************************************************
|
||||
|
||||
DEFINE_DEVICE_TYPE(A8SIO, a8sio_device, "a8sio", "Atari 8 bit SIO")
|
||||
|
||||
DEFINE_DEVICE_TYPE(A8SIO, a8sio_device, "a8sio", "Atari 8 bit SIO Slot")
|
||||
|
||||
//**************************************************************************
|
||||
// LIVE DEVICE
|
||||
@ -93,12 +52,8 @@ DEFINE_DEVICE_TYPE(A8SIO, a8sio_device, "a8sio", "Atari 8 bit SIO")
|
||||
//-------------------------------------------------
|
||||
|
||||
a8sio_device::a8sio_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock)
|
||||
: a8sio_device(mconfig, A8SIO, tag, owner, clock)
|
||||
{
|
||||
}
|
||||
|
||||
a8sio_device::a8sio_device(const machine_config &mconfig, device_type type, const char *tag, device_t *owner, uint32_t clock)
|
||||
: device_t(mconfig, type, tag, owner, clock)
|
||||
: device_t(mconfig, A8SIO, tag, owner, clock)
|
||||
, device_slot_interface(mconfig, *this)
|
||||
, m_out_clock_in_cb(*this)
|
||||
, m_out_data_in_cb(*this)
|
||||
, m_out_proceed_cb(*this)
|
||||
@ -109,20 +64,34 @@ a8sio_device::a8sio_device(const machine_config &mconfig, device_type type, cons
|
||||
}
|
||||
|
||||
//-------------------------------------------------
|
||||
// device_start - device-specific startup
|
||||
// device_resolve_objects - resolve objects that
|
||||
// may be needed for other devices to set
|
||||
// initial conditions at start time
|
||||
//-------------------------------------------------
|
||||
|
||||
void a8sio_device::device_start()
|
||||
void a8sio_device::device_resolve_objects()
|
||||
{
|
||||
m_device = dynamic_cast<device_a8sio_card_interface *>(get_card_device());
|
||||
|
||||
if (m_device)
|
||||
{
|
||||
m_device->set_a8sio_device(this);
|
||||
}
|
||||
|
||||
// resolve callbacks
|
||||
m_out_clock_in_cb.resolve_safe();
|
||||
m_out_data_in_cb.resolve_safe();
|
||||
m_out_proceed_cb.resolve_safe();
|
||||
m_out_audio_in_cb.resolve_safe();
|
||||
m_out_interrupt_cb.resolve_safe();
|
||||
}
|
||||
|
||||
// clear slot
|
||||
m_device = nullptr;
|
||||
//-------------------------------------------------
|
||||
// device_start - device-specific startup
|
||||
//-------------------------------------------------
|
||||
|
||||
void a8sio_device::device_start()
|
||||
{
|
||||
}
|
||||
|
||||
//-------------------------------------------------
|
||||
@ -135,12 +104,7 @@ void a8sio_device::device_reset()
|
||||
|
||||
device_a8sio_card_interface *a8sio_device::get_a8sio_card()
|
||||
{
|
||||
return m_device;
|
||||
}
|
||||
|
||||
void a8sio_device::add_a8sio_card(device_a8sio_card_interface *card)
|
||||
{
|
||||
m_device = card;
|
||||
return m_device;
|
||||
}
|
||||
|
||||
WRITE_LINE_MEMBER( a8sio_device::clock_in_w )
|
||||
@ -204,7 +168,6 @@ WRITE_LINE_MEMBER( a8sio_device::interrupt_w )
|
||||
device_a8sio_card_interface::device_a8sio_card_interface(const machine_config &mconfig, device_t &device)
|
||||
: device_slot_card_interface(mconfig, device)
|
||||
, m_a8sio(nullptr)
|
||||
, m_a8sio_tag(nullptr), m_a8sio_slottag(nullptr)
|
||||
{
|
||||
}
|
||||
|
||||
@ -217,10 +180,9 @@ device_a8sio_card_interface::~device_a8sio_card_interface()
|
||||
{
|
||||
}
|
||||
|
||||
void device_a8sio_card_interface::set_a8sio_device()
|
||||
void device_a8sio_card_interface::set_a8sio_device(a8sio_device *sio)
|
||||
{
|
||||
m_a8sio = dynamic_cast<a8sio_device *>(device().machine().device(m_a8sio_tag));
|
||||
m_a8sio->add_a8sio_card(this);
|
||||
m_a8sio = sio;
|
||||
}
|
||||
|
||||
WRITE_LINE_MEMBER( device_a8sio_card_interface::clock_out_w )
|
||||
|
@ -37,46 +37,21 @@
|
||||
|
||||
void a8sio_cards(device_slot_interface &device);
|
||||
|
||||
class a8sio_slot_device : public device_t,
|
||||
class device_a8sio_card_interface;
|
||||
|
||||
class a8sio_device : public device_t,
|
||||
public device_slot_interface
|
||||
{
|
||||
public:
|
||||
// construction/destruction
|
||||
a8sio_slot_device(machine_config const &mconfig, char const *tag, device_t *owner, char const *dflt)
|
||||
: a8sio_slot_device(mconfig, tag, owner, (uint32_t)0)
|
||||
a8sio_device(machine_config const &mconfig, char const *tag, device_t *owner, char const *dflt)
|
||||
: a8sio_device(mconfig, tag, owner, (uint32_t)0)
|
||||
{
|
||||
option_reset();
|
||||
a8sio_cards(*this);
|
||||
set_default_option(dflt);
|
||||
set_fixed(false);
|
||||
}
|
||||
a8sio_slot_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock);
|
||||
|
||||
// inline configuration
|
||||
void set_a8sio_slot(const char *tag, const char *slottag) { m_a8sio_tag = tag; m_a8sio_slottag = slottag; }
|
||||
|
||||
protected:
|
||||
a8sio_slot_device(const machine_config &mconfig, device_type type, const char *tag, device_t *owner, uint32_t clock);
|
||||
|
||||
// device-level overrides
|
||||
virtual void device_start() override;
|
||||
|
||||
// configuration
|
||||
const char *m_a8sio_tag;
|
||||
const char *m_a8sio_slottag;
|
||||
};
|
||||
|
||||
|
||||
// device type definition
|
||||
DECLARE_DEVICE_TYPE(A8SIO_SLOT, a8sio_slot_device)
|
||||
|
||||
|
||||
class device_a8sio_card_interface;
|
||||
|
||||
class a8sio_device : public device_t
|
||||
{
|
||||
public:
|
||||
// construction/destruction
|
||||
a8sio_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock);
|
||||
|
||||
// inline configuration
|
||||
@ -86,7 +61,6 @@ public:
|
||||
auto proceed() { return m_out_proceed_cb.bind(); }
|
||||
auto interrupt() { return m_out_interrupt_cb.bind(); }
|
||||
|
||||
void add_a8sio_card(device_a8sio_card_interface *card);
|
||||
device_a8sio_card_interface *get_a8sio_card();
|
||||
|
||||
DECLARE_WRITE_LINE_MEMBER( clock_in_w ); // pin 1
|
||||
@ -103,6 +77,7 @@ protected:
|
||||
a8sio_device(const machine_config &mconfig, device_type type, const char *tag, device_t *owner, uint32_t clock);
|
||||
|
||||
// device-level overrides
|
||||
virtual void device_resolve_objects() override;
|
||||
virtual void device_start() override;
|
||||
virtual void device_reset() override;
|
||||
|
||||
@ -126,10 +101,7 @@ public:
|
||||
// construction/destruction
|
||||
virtual ~device_a8sio_card_interface();
|
||||
|
||||
void set_a8sio_device();
|
||||
|
||||
// inline configuration
|
||||
void set_a8sio_tag(const char *tag, const char *slottag) { m_a8sio_tag = tag; m_a8sio_slottag = slottag; }
|
||||
void set_a8sio_device(a8sio_device *sio);
|
||||
|
||||
virtual DECLARE_WRITE_LINE_MEMBER( clock_out_w );
|
||||
virtual DECLARE_WRITE_LINE_MEMBER( data_out_w );
|
||||
@ -141,8 +113,6 @@ public:
|
||||
device_a8sio_card_interface(const machine_config &mconfig, device_t &device);
|
||||
|
||||
a8sio_device *m_a8sio;
|
||||
const char *m_a8sio_tag;
|
||||
const char *m_a8sio_slottag;
|
||||
};
|
||||
|
||||
#endif // MAME_BUS_A800_A8SIO_H
|
||||
|
@ -37,7 +37,7 @@ void atari1050_device::mem_map(address_map &map)
|
||||
map(0x0000, 0x007f).mirror(0x0900).ram(); // MCM6810
|
||||
map(0x0080, 0x00ff).mirror(0x0900).m(m_pia, FUNC(mos6532_new_device::ram_map));
|
||||
map(0x0280, 0x029f).mirror(0x0960).m(m_pia, FUNC(mos6532_new_device::io_map));
|
||||
map(0x0400, 0x0403).mirror(0x087c).rw(m_fdc, FUNC(wd2793_device::read), FUNC(fd1771_device::write));
|
||||
map(0x0400, 0x0403).mirror(0x087c).rw(m_fdc, FUNC(wd2793_device::read), FUNC(wd2793_device::write));
|
||||
map(0x1000, 0x1fff).rom().region("rom", 0);
|
||||
}
|
||||
|
||||
|
@ -57,8 +57,6 @@ a8sio_cassette_device::a8sio_cassette_device(const machine_config &mconfig, devi
|
||||
|
||||
void a8sio_cassette_device::device_start()
|
||||
{
|
||||
set_a8sio_device();
|
||||
|
||||
save_item(NAME(m_old_cass_signal));
|
||||
save_item(NAME(m_signal_count));
|
||||
|
||||
|
@ -2129,16 +2129,15 @@ void a400_state::atari_common_nodac(machine_config &config)
|
||||
PIA6821(config, m_pia, 0);
|
||||
m_pia->readpa_handler().set_ioport("djoy_0_1");
|
||||
m_pia->readpb_handler().set_ioport("djoy_2_3");
|
||||
m_pia->ca2_handler().set("a8sio", FUNC(a8sio_device::motor_w));
|
||||
m_pia->ca2_handler().set("sio", FUNC(a8sio_device::motor_w));
|
||||
m_pia->cb2_handler().set("fdc", FUNC(atari_fdc_device::pia_cb2_w));
|
||||
m_pia->cb2_handler().append("a8sio", FUNC(a8sio_device::command_w));
|
||||
m_pia->cb2_handler().append("sio", FUNC(a8sio_device::command_w));
|
||||
|
||||
a8sio_device &a8sio(A8SIO(config, "a8sio", 0));
|
||||
//a8sio.clock_in().set("pokey", FUNC(pokey_device::bclk_w));
|
||||
a8sio.data_in().set("pokey", FUNC(pokey_device::sid_w));
|
||||
a8sio.proceed().set(m_pia, FUNC(pia6821_device::ca1_w));
|
||||
a8sio.interrupt().set(m_pia, FUNC(pia6821_device::cb1_w));
|
||||
A8SIO_SLOT(config, "sio", nullptr).set_a8sio_slot("a8sio", "sio");
|
||||
a8sio_device &sio(A8SIO(config, "sio", nullptr));
|
||||
//sio.clock_in().set("pokey", FUNC(pokey_device::bclk_w));
|
||||
sio.data_in().set("pokey", FUNC(pokey_device::sid_w));
|
||||
sio.proceed().set(m_pia, FUNC(pia6821_device::ca1_w));
|
||||
sio.interrupt().set(m_pia, FUNC(pia6821_device::cb1_w));
|
||||
|
||||
/* sound hardware */
|
||||
SPEAKER(config, "speaker").front_center();
|
||||
@ -2153,8 +2152,8 @@ void a400_state::atari_common_nodac(machine_config &config)
|
||||
m_pokey->pot_r<7>().set_ioport("analog_7");
|
||||
m_pokey->serin_r().set("fdc", FUNC(atari_fdc_device::serin_r));
|
||||
m_pokey->serout_w().set("fdc", FUNC(atari_fdc_device::serout_w));
|
||||
//m_pokey->oclk_w().set("a8sio", FUNC(a8sio_device::clock_out_w));
|
||||
//m_pokey->sod_w().set("a8sio", FUNC(a8sio_device::data_out_w));
|
||||
//m_pokey->oclk_w().set("sio", FUNC(a8sio_device::clock_out_w));
|
||||
//m_pokey->sod_w().set("sio", FUNC(a8sio_device::data_out_w));
|
||||
m_pokey->set_keyboard_callback(FUNC(a400_state::a800_keyboard));
|
||||
m_pokey->set_interrupt_callback(FUNC(a400_state::interrupt_cb));
|
||||
m_pokey->add_route(ALL_OUTPUTS, "speaker", 1.0);
|
||||
|
Loading…
Reference in New Issue
Block a user