1 // license:BSD-3-Clause
2 // copyright-holders:Curt Coder
3 /**********************************************************************
4 
5     C64 switchable 8K cartridge emulation
6 
7 **********************************************************************/
8 
9 #ifndef MAME_BUS_C64_SW8K_H
10 #define MAME_BUS_C64_SW8K_H
11 
12 #pragma once
13 
14 
15 #include "exp.h"
16 
17 
18 
19 //**************************************************************************
20 //  TYPE DEFINITIONS
21 //**************************************************************************
22 
23 // ======================> c64_switchable_8k_cartridge_device
24 
25 class c64_switchable_8k_cartridge_device : public device_t,
26 											public device_c64_expansion_card_interface
27 {
28 public:
29 	// construction/destruction
30 	c64_switchable_8k_cartridge_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock);
31 
32 	// optional information overrides
33 	virtual ioport_constructor device_input_ports() const override;
34 
35 protected:
36 	// device-level overrides
37 	virtual void device_start() override;
38 	virtual void device_reset() override;
39 
40 	// device_c64_expansion_card_interface overrides
41 	virtual uint8_t c64_cd_r(offs_t offset, uint8_t data, int sphi2, int ba, int roml, int romh, int io1, int io2) override;
42 
43 private:
44 	required_ioport m_sw;
45 
46 	int m_bank;
47 };
48 
49 
50 // device type definition
51 DECLARE_DEVICE_TYPE(C64_SW8K, c64_switchable_8k_cartridge_device)
52 
53 
54 #endif // MAME_BUS_C64_SW8K_H
55