summaryrefslogtreecommitdiffstats
path: root/src/mame/machine/vt1682_uio.h
blob: ef86aaaa2f253cbc23cbefcd1039874ffea9900d (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
// license:BSD-3-Clause
// copyright-holders:David Haywood

#ifndef MAME_MACHINE_VT1682_UIO_H
#define MAME_MACHINE_VT1682_UIO_H

#pragma once

DECLARE_DEVICE_TYPE(VT_VT1682_UIO, vrt_vt1682_uio_device)

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

	auto porta_out() { return m_porta_out.bind(); }
	auto porta_in() { return m_porta_in.bind(); }
	auto portb_out() { return m_portb_out.bind(); }
	auto portb_in() { return m_portb_in.bind(); }

	uint8_t inteact_2129_uio_a_data_r();
	void inteact_2129_uio_a_data_w(uint8_t data);
	uint8_t inteact_212a_uio_a_direction_r();
	void inteact_212a_uio_a_direction_w(uint8_t data);
	uint8_t inteact_212b_uio_a_attribute_r();
	void inteact_212b_uio_a_attribute_w(uint8_t data);

	uint8_t inteact_2149_uio_b_data_r();
	void inteact_2149_uio_b_data_w(uint8_t data);
	uint8_t inteact_214a_uio_b_direction_r();
	void inteact_214a_uio_b_direction_w(uint8_t data);
	uint8_t inteact_214b_uio_b_attribute_r();
	void inteact_214b_uio_b_attribute_w(uint8_t data);

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

private:
	devcb_write8 m_porta_out;
	devcb_read8 m_porta_in;
	devcb_write8 m_portb_out;
	devcb_read8 m_portb_in;

	uint8_t m_2129_uio_a_data;
	uint8_t m_212a_uio_a_direction;
	uint8_t m_212b_uio_a_attribute;

	uint8_t m_2149_uio_b_data;
	uint8_t m_214a_uio_b_direction;
	uint8_t m_214b_uio_b_attribute;

};

#endif // MAME_MACHINE_VT1682_UIO_H
span class="w"> nullptr) { setWindowTitle("Debug: All Breakpoints"); if (parent) { QPoint parentPos = parent->pos(); setGeometry(parentPos.x()+100, parentPos.y()+100, 800, 400); } // // The main frame and its input and breakpoints widgets // QFrame *mainWindowFrame = new QFrame(this); // The main breakpoints view m_breakpointsView = new DebuggerView(DVT_BREAK_POINTS, m_machine, this); // Layout QVBoxLayout *vLayout = new QVBoxLayout(mainWindowFrame); vLayout->setObjectName("vlayout"); vLayout->setSpacing(3); vLayout->setContentsMargins(2,2,2,2); vLayout->addWidget(m_breakpointsView); setCentralWidget(mainWindowFrame); // // Menu bars // QActionGroup *typeGroup = new QActionGroup(this); typeGroup->setObjectName("typegroup"); QAction *typeBreak = new QAction("Breakpoints", this); typeBreak->setObjectName("typebreak"); typeBreak->setCheckable(true); typeBreak->setActionGroup(typeGroup); typeBreak->setShortcut(QKeySequence("Ctrl+1")); QAction *typeWatch = new QAction("Watchpoints", this); typeWatch->setObjectName("typewatch"); typeWatch->setCheckable(true); typeWatch->setActionGroup(typeGroup); typeWatch->setShortcut(QKeySequence("Ctrl+2")); QAction *typeRegister = new QAction("Registerpoints", this); typeRegister->setObjectName("typeregister"); typeRegister->setCheckable(true); typeRegister->setActionGroup(typeGroup); typeRegister->setShortcut(QKeySequence("Ctrl+3")); typeBreak->setChecked(true); connect(typeGroup, &QActionGroup::triggered, this, &BreakpointsWindow::typeChanged); // Assemble the options menu QMenu *optionsMenu = menuBar()->addMenu("&Options"); optionsMenu->addActions(typeGroup->actions()); } BreakpointsWindow::~BreakpointsWindow() { } void BreakpointsWindow::saveConfigurationToNode(util::xml::data_node &node) { WindowQt::saveConfigurationToNode(node); node.set_attribute_int(osd::debugger::ATTR_WINDOW_TYPE, osd::debugger::WINDOW_TYPE_POINTS_VIEWER); if (m_breakpointsView) { switch (m_breakpointsView->view()->type()) { case DVT_BREAK_POINTS: node.set_attribute_int(osd::debugger::ATTR_WINDOW_POINTS_TYPE, 0); break; case DVT_WATCH_POINTS: node.set_attribute_int(osd::debugger::ATTR_WINDOW_POINTS_TYPE, 1); break; case DVT_REGISTER_POINTS: node.set_attribute_int(osd::debugger::ATTR_WINDOW_POINTS_TYPE, 2); break; default: break; } } } void BreakpointsWindow::typeChanged(QAction* changedTo) { // Clean delete m_breakpointsView; m_breakpointsView = nullptr; // Create if (changedTo->text() == "Breakpoints") { m_breakpointsView = new DebuggerView(DVT_BREAK_POINTS, m_machine, this); setWindowTitle("Debug: All Breakpoints"); } else if (changedTo->text() == "Watchpoints") { m_breakpointsView = new DebuggerView(DVT_WATCH_POINTS, m_machine, this); setWindowTitle("Debug: All Watchpoints"); } else if (changedTo->text() == "Registerpoints") { m_breakpointsView = new DebuggerView(DVT_REGISTER_POINTS, m_machine, this); setWindowTitle("Debug: All Registerpoints"); } // Re-register QVBoxLayout *layout = findChild<QVBoxLayout *>("vlayout"); layout->addWidget(m_breakpointsView); } //========================================================================= // BreakpointsWindowQtConfig //========================================================================= void BreakpointsWindowQtConfig::applyToQWidget(QWidget* widget) { WindowQtConfig::applyToQWidget(widget); BreakpointsWindow *window = dynamic_cast<BreakpointsWindow *>(widget); QActionGroup *typeGroup = window->findChild<QActionGroup *>("typegroup"); typeGroup->actions()[m_bwType]->trigger(); } void BreakpointsWindowQtConfig::recoverFromXmlNode(util::xml::data_node const &node) { WindowQtConfig::recoverFromXmlNode(node); m_bwType = node.get_attribute_int(osd::debugger::ATTR_WINDOW_POINTS_TYPE, m_bwType); }