1 // license:BSD-3-Clause
2 // copyright-holders:David Haywood
3 
4 #ifndef MAME_BUS_PSX_PARALLEL_H
5 #define MAME_BUS_PSX_PARALLEL_H
6 
7 #pragma once
8 
9 //**************************************************************************
10 //  TYPE DEFINITIONS
11 //**************************************************************************
12 
13 // ======================> psx_parallel_slot_device
14 
15 class psx_parallel_interface;
16 
17 class psx_parallel_slot_device : public device_t, public device_single_card_slot_interface<psx_parallel_interface>
18 {
19 public:
20 	// construction/destruction
21 	template <typename T>
psx_parallel_slot_device(machine_config const & mconfig,char const * tag,device_t * owner,T && opts,char const * dflt)22 	psx_parallel_slot_device(machine_config const &mconfig, char const *tag, device_t *owner, T &&opts, char const *dflt)
23 		: psx_parallel_slot_device(mconfig, tag, owner, (uint32_t)0)
24 	{
25 		option_reset();
26 		opts(*this);
27 		set_default_option(dflt);
28 		set_fixed(false);
29 	}
30 	psx_parallel_slot_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock);
31 	virtual ~psx_parallel_slot_device();
32 
33 	uint16_t exp_r(offs_t offset);
34 	void exp_w(offs_t offset, uint16_t data);
35 
hascard()36 	bool hascard() const { return bool(m_card); }
37 
38 protected:
39 	// device-level overrides
40 	virtual void device_start() override;
41 
42 private:
43 	psx_parallel_interface *m_card;
44 };
45 
46 
47 // ======================> psx_parallel_interface
48 
49 class psx_parallel_interface : public device_interface
50 {
51 public:
52 	// construction/destruction
53 	virtual ~psx_parallel_interface();
54 
55 	// reading and writing
56 	virtual uint16_t exp_r(offs_t offset, uint16_t mem_mask = ~0) { return 0xff; }
57 	virtual void exp_w(offs_t offset, uint16_t data, uint16_t mem_mask = ~0) { }
58 
59 protected:
60 	psx_parallel_interface(const machine_config &mconfig, device_t &device);
61 };
62 
63 
64 // device type definition
65 DECLARE_DEVICE_TYPE(PSX_PARALLEL_SLOT, psx_parallel_slot_device)
66 
67 void psx_parallel_devices(device_slot_interface &device);
68 
69 
70 #endif // MAME_BUS_PSX_PARALLEL_H
71