blob: 6b3c84566876eb86a67667ad41ccb4a83e2a6f15 (
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
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
|
// license:BSD-3-Clause
// copyright-holders:Barry Rodewald
/*********************************************************************
fmt_icmem.h
FM Towns IC Memory Card
*********************************************************************/
#ifndef MAME_MACHINE_FMT_ICMEM_H
#define MAME_MACHINE_FMT_ICMEM_H
#pragma once
//**************************************************************************
// INTERFACE CONFIGURATION MACROS
//**************************************************************************
#define MCFG_FMT_ICMEMCARD_ADD(_tag) \
MCFG_DEVICE_ADD(_tag, FMT_ICMEM, 0)
/***************************************************************************
FUNCTION PROTOTYPES
***************************************************************************/
class fmt_icmem_device : public device_t, public device_image_interface
{
public:
// construction/destruction
fmt_icmem_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock);
virtual iodevice_t image_type() const override { return IO_MEMCARD; }
virtual bool is_readable() const override { return true; }
virtual bool is_writeable() const override { return true; }
virtual bool is_creatable() const override { return true; }
virtual bool must_be_loaded() const override { return false; }
virtual bool is_reset_on_load() const override { return false; }
virtual const char *file_extensions() const override { return "icm"; }
virtual image_init_result call_load() override;
virtual void call_unload() override;
virtual image_init_result call_create(int format_type, util::option_resolution *format_options) override;
// device-level overrides
virtual void device_start() override;
DECLARE_READ8_MEMBER(static_mem_read);
DECLARE_WRITE8_MEMBER(static_mem_write);
DECLARE_READ8_MEMBER(mem_read);
DECLARE_WRITE8_MEMBER(mem_write);
DECLARE_READ8_MEMBER(status_r);
DECLARE_READ8_MEMBER(bank_r);
DECLARE_WRITE8_MEMBER(bank_w);
protected:
virtual ioport_constructor device_input_ports() const override;
private:
required_ioport m_writeprotect;
std::unique_ptr<uint8_t[]> m_memcard_ram;
bool m_change;
bool m_attr_select;
uint8_t m_detect;
uint8_t m_bank;
};
// device type definition
DECLARE_DEVICE_TYPE(FMT_ICMEM, fmt_icmem_device)
#endif // MAME_MACHINE_FMT_ICMEM_H
|