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
13 changes: 10 additions & 3 deletions src/devices/bus/qbus/dvk_kgd.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ DEFINE_DEVICE_TYPE(DVK_KGD, dvk_kgd_device, "kgd", "DVK KGD framebuffer")
dvk_kgd_device::dvk_kgd_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock)
: device_t(mconfig, DVK_KGD, tag, owner, clock)
, device_qbus_card_interface(mconfig, *this)
, m_installed(false)
, m_screen(*this, "screen")
{
}
Expand Down Expand Up @@ -80,17 +81,17 @@ void dvk_kgd_device::device_add_mconfig(machine_config &config)

void dvk_kgd_device::device_start()
{
m_bus->install_device(0176640, 0176647, read16sm_delegate(*this, FUNC(dvk_kgd_device::read)),
write16sm_delegate(*this, FUNC(dvk_kgd_device::write)));

// save state
save_item(NAME(m_installed));
save_item(NAME(m_cr));
save_item(NAME(m_dr));
save_item(NAME(m_ar));
save_item(NAME(m_ct));

m_videoram_base = std::make_unique<uint8_t[]>(16384);
m_videoram = m_videoram_base.get();

m_installed = false;
}


Expand All @@ -100,6 +101,12 @@ void dvk_kgd_device::device_start()

void dvk_kgd_device::device_reset()
{
if (!m_installed)
{
m_bus->install_device(0176640, 0176647, read16sm_delegate(*this, FUNC(dvk_kgd_device::read)),
write16sm_delegate(*this, FUNC(dvk_kgd_device::write)));
m_installed = true;
}
m_cr = m_dr = m_ar = m_ct = 0;
}

Expand Down
2 changes: 2 additions & 0 deletions src/devices/bus/qbus/dvk_kgd.h
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,8 @@ class dvk_kgd_device : public device_t,
virtual void device_reset() override ATTR_COLD;
virtual void device_add_mconfig(machine_config &config) override ATTR_COLD;

bool m_installed;

required_device<screen_device> m_screen;

private:
Expand Down
14 changes: 11 additions & 3 deletions src/devices/bus/qbus/dvk_mx.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,7 @@ dvk_mx_device::dvk_mx_device(const machine_config &mconfig, const char *tag, dev
: device_t(mconfig, DVK_MX, tag, owner, clock)
, device_qbus_card_interface(mconfig, *this)
, m_connectors(*this, "%u", 0U)
, m_installed(false)
{
}

Expand Down Expand Up @@ -126,18 +127,18 @@ void dvk_mx_device::device_start()
}

// save state
save_item(NAME(m_installed));
save_item(NAME(m_mxcs));
save_item(NAME(m_rbuf));
save_item(NAME(m_wbuf));
save_item(NAME(selected_drive));

m_timer_2khz = timer_alloc(FUNC(dvk_mx_device::twokhz_tick), this);

m_bus->install_device(0177130, 0177133, read16sm_delegate(*this, FUNC(dvk_mx_device::read)),
write16sm_delegate(*this, FUNC(dvk_mx_device::write)));

m_mxcs = 0;
selected_drive = -1;

m_installed = false;
}

//-------------------------------------------------
Expand All @@ -146,6 +147,13 @@ void dvk_mx_device::device_start()

void dvk_mx_device::device_reset()
{
if (!m_installed)
{
m_bus->install_device(0177130, 0177133, read16sm_delegate(*this, FUNC(dvk_mx_device::read)),
write16sm_delegate(*this, FUNC(dvk_mx_device::write)));
m_installed = true;
}

m_rbuf = m_wbuf = 0;

m_mxcs &= ~MXCSR_ERR;
Expand Down
2 changes: 2 additions & 0 deletions src/devices/bus/qbus/dvk_mx.h
Original file line number Diff line number Diff line change
Expand Up @@ -126,6 +126,8 @@ class dvk_mx_device : public device_t, public device_qbus_card_interface

required_device_array<floppy_connector, 4> m_connectors;

bool m_installed;

uint16_t m_mxcs;
uint16_t m_rbuf;
uint16_t m_wbuf;
Expand Down
21 changes: 15 additions & 6 deletions src/devices/bus/qbus/pc11.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@ const char* pc11_regnames[] = {
pc11_device::pc11_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock)
: paper_tape_reader_device(mconfig, DEC_PC11, tag, owner, clock)
, device_qbus_card_interface(mconfig, *this)
, m_installed(false)
, m_rxvec(070)
, m_txvec(074)
{
Expand All @@ -69,12 +70,8 @@ pc11_device::pc11_device(const machine_config &mconfig, const char *tag, device_

void pc11_device::device_start()
{
m_bus->install_device(0177550, 0177557, read16sm_delegate(*this, FUNC(pc11_device::read)),
write16sm_delegate(*this, FUNC(pc11_device::write)));

// resolve callbacks

// save state
save_item(NAME(m_installed));
save_item(NAME(m_rcsr));
save_item(NAME(m_rbuf));
save_item(NAME(m_tcsr));
Expand All @@ -83,6 +80,11 @@ void pc11_device::device_start()
// about 300 cps
m_read_timer = timer_alloc(FUNC(pc11_device::read_tick), this);
m_read_timer->adjust(attotime::from_usec(333), 0, attotime::from_usec(333));

m_fd = nullptr;
m_rcsr = CSR_ERR;

m_installed = false;
}


Expand All @@ -94,7 +96,14 @@ void pc11_device::device_reset()
{
LOG("Reset, rxvec %03o txvec %03o\n", m_rxvec, m_txvec);

m_rcsr = m_rbuf = m_tbuf = 0;
if (!m_installed)
{
m_bus->install_device(0177550, 0177557, read16sm_delegate(*this, FUNC(pc11_device::read)),
write16sm_delegate(*this, FUNC(pc11_device::write)));
m_installed = true;
}

m_rbuf = m_tbuf = 0;
m_tcsr = CSR_DONE;
m_rxrdy = m_txrdy = CLEAR_LINE;

Expand Down
1 change: 1 addition & 0 deletions src/devices/bus/qbus/pc11.h
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,7 @@ class pc11_device : public paper_tape_reader_device,
TIMER_CALLBACK_MEMBER(read_tick);

private:
bool m_installed;
int m_rxvec;
int m_txvec;

Expand Down
8 changes: 7 additions & 1 deletion src/devices/bus/qbus/qbus.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,8 @@ qbus_device::qbus_device(const machine_config &mconfig, const char *tag, device_
device_z80daisy_interface(mconfig, *this),
m_program_config("a18", ENDIANNESS_BIG, 16, 16, 0, address_map_constructor()),
m_space(*this, finder_base::DUMMY_TAG, -1),
m_out_bus_error_cb(*this),
m_out_bevnt_cb(*this),
m_out_birq4_cb(*this),
m_out_birq5_cb(*this),
m_out_birq6_cb(*this),
Expand All @@ -124,6 +126,7 @@ device_memory_interface::space_config_vector qbus_device::memory_space_config()

void qbus_device::device_start()
{
m_view = nullptr;
}


Expand Down Expand Up @@ -156,7 +159,10 @@ void qbus_device::add_card(device_qbus_card_interface &card)

void qbus_device::install_device(offs_t start, offs_t end, read16sm_delegate rhandler, write16sm_delegate whandler, uint32_t mask)
{
m_space->install_readwrite_handler(start, end, rhandler, whandler, mask);
if (m_view)
m_view->install_readwrite_handler(start, end, rhandler, whandler, mask);
else
m_space->install_readwrite_handler(start, end, rhandler, whandler, mask);
}


Expand Down
10 changes: 10 additions & 0 deletions src/devices/bus/qbus/qbus.h
Original file line number Diff line number Diff line change
Expand Up @@ -71,10 +71,14 @@ class qbus_device : public device_t,

// inline configuration
template <typename T> void set_space(T &&tag, int spacenum) { m_space.set_tag(std::forward<T>(tag), spacenum); }
void set_view(memory_view::memory_view_entry &view) { m_view = &view; };

virtual space_config_vector memory_space_config() const override;
address_space &program_space() const { return *m_space; }

auto bus_error_callback() { return m_out_bus_error_cb.bind(); }

auto bevnt() { return m_out_bevnt_cb.bind(); }
auto birq4() { return m_out_birq4_cb.bind(); }
auto birq5() { return m_out_birq6_cb.bind(); }
auto birq6() { return m_out_birq6_cb.bind(); }
Expand All @@ -84,7 +88,9 @@ class qbus_device : public device_t,
void install_device(offs_t start, offs_t end, read16sm_delegate rhandler, write16sm_delegate whandler, uint32_t mask=0xffffffff);

void init_w();
void bus_error_w(int state) { m_out_bus_error_cb(state); }

void bevnt_w(int state) { m_out_bevnt_cb(state); }
void birq4_w(int state) { m_out_birq4_cb(state); }
void birq5_w(int state) { m_out_birq5_cb(state); }
void birq6_w(int state) { m_out_birq6_cb(state); }
Expand All @@ -106,10 +112,14 @@ class qbus_device : public device_t,

// internal state
required_address_space m_space;
memory_view::memory_view_entry *m_view;

private:
using card_vector = std::vector<std::reference_wrapper<device_qbus_card_interface> >;

devcb_write_line m_out_bus_error_cb;

devcb_write_line m_out_bevnt_cb;
devcb_write_line m_out_birq4_cb;
devcb_write_line m_out_birq5_cb;
devcb_write_line m_out_birq6_cb;
Expand Down
Loading