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
|
// license:BSD-3-Clause
// copyright-holders:S. Smith,David Haywood,Fabio Priuli
#ifndef MAME_BUS_NEOGEO_ROM_H
#define MAME_BUS_NEOGEO_ROM_H
#pragma once
#include "slot.h"
#include "machine/nvram.h"
// ======================> neogeo_rom_device
class neogeo_rom_device : public device_t, public device_neogeo_cart_interface
{
public:
// construction/destruction
neogeo_rom_device(const machine_config &mconfig, const char *tag, device_t *owner, uint16_t clock);
// reading and writing
virtual uint16_t rom_r(offs_t offset) override;
virtual void banksel_w(uint16_t data) override;
protected:
neogeo_rom_device(const machine_config &mconfig, device_type type, const char *tag, device_t *owner, uint16_t clock);
// device-level overrides
virtual void device_start() override ATTR_COLD;
virtual void device_reset() override ATTR_COLD;
};
// device type definition
DECLARE_DEVICE_TYPE(NEOGEO_ROM, neogeo_rom_device)
/*************************************************
vliner
**************************************************/
class neogeo_vliner_cart_device : public neogeo_rom_device
{
public:
neogeo_vliner_cart_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock);
virtual uint16_t ram_r(offs_t offset) override { return m_cart_ram[offset]; }
virtual void ram_w(offs_t offset, uint16_t data, uint16_t mem_mask = ~0) override { COMBINE_DATA(&m_cart_ram[offset]); }
virtual int get_fixed_bank_type() override { return 0; }
protected:
virtual void device_start() override ATTR_COLD;
virtual void device_add_mconfig(machine_config &config) override ATTR_COLD;
private:
std::unique_ptr<uint16_t[]> m_cart_ram;
required_device<nvram_device> m_nvram;
};
DECLARE_DEVICE_TYPE(NEOGEO_VLINER_CART, neogeo_vliner_cart_device)
#endif // MAME_BUS_NEOGEO_ROM_H
|