summaryrefslogtreecommitdiffstatshomepage
path: root/src/devices/bus/mc10/ram.cpp
blob: f6a6f488955d23c5d701ec92e0ce5efb01291554 (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
76
77
78
// license:BSD-3-Clause
// copyright-holders:tim lindner
/***************************************************************************

    ram.cpp

    Code for emulating the Radio Shack 16K RAM Cartridge

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

#include "emu.h"
#include "ram.h"

// #include "machine/ram.h"

// #define VERBOSE (LOG_GENERAL )
#include "logmacro.h"


//**************************************************************************
//  TYPE DECLARATIONS
//**************************************************************************

namespace
{
	// ======================> mc10_pak_device

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

	protected:
		// device-level overrides
		virtual void device_start() override;
	private:
		memory_share_creator<u8> m_share;
	};
};



//**************************************************************************
//  GLOBAL VARIABLES
//**************************************************************************

DEFINE_DEVICE_TYPE_PRIVATE(MC10_PAK_RAM, device_mc10cart_interface, mc10_pak_ram_device, "mc10pakram", "Radio Shack 16K RAM Cartridge")



//-------------------------------------------------
//  mc10_pak_device - constructor
//-------------------------------------------------

mc10_pak_ram_device::mc10_pak_ram_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock)
	: device_t(mconfig, MC10_PAK_RAM, tag, owner, clock)
	, device_mc10cart_interface(mconfig, *this)
	, m_share(*this, "ext_ram", 1024*16, ENDIANNESS_BIG)
{
}



//**************************************************************************
//  MACHINE FRAGMENTS AND ADDRESS MAPS
//**************************************************************************

//-------------------------------------------------
//  device_start - device-specific startup
//-------------------------------------------------

void mc10_pak_ram_device::device_start()
{
	owning_slot().memspace().install_ram(0x5000, 0x8fff, &m_share[0]);
}