summaryrefslogtreecommitdiffstatshomepage
path: root/src/devices/bus/pofo/hpc102.h
blob: e0ba50074e43c0ebdeaffbd799df3fd0b36df35f (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
57
58
// license:BSD-3-Clause
// copyright-holders:Curt Coder
/**********************************************************************

    Atari Portfolio HPC-102 serial interface emulation

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

#ifndef MAME_BUS_POFO_HPC102_H
#define MAME_BUS_POFO_HPC102_H

#pragma once

#include "exp.h"
#include "bus/rs232/rs232.h"
#include "machine/ins8250.h"



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

// ======================> pofo_hpc102_device

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

	// optional information overrides
	virtual machine_config_constructor device_mconfig_additions() const override;

protected:
	// device-level overrides
	virtual void device_start() override;
	virtual void device_reset() override;

	// device_portfolio_expansion_slot_interface overrides
	bool pdet() override { return 1; }

	virtual uint8_t eack_r() override;

	virtual uint8_t nrdi_r(address_space &space, offs_t offset, uint8_t data, bool iom, bool bcom, bool ncc1) override;
	virtual void nwri_w(address_space &space, offs_t offset, uint8_t data, bool iom, bool bcom, bool ncc1) override;

private:
	required_device<ins8250_device> m_uart;

	uint8_t m_vector;
};


// device type definition
DECLARE_DEVICE_TYPE(POFO_HPC102, pofo_hpc102_device)

#endif // MAME_BUS_POFO_HPC102_H