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
79
80
81
82
83
84
85
86
87
88
|
// license:BSD-3-Clause
// copyright-holders:S. Smith,David Haywood,Fabio Priuli
/***********************************************************************************************************
Neo Geo cart emulation
Standard cart type, possibly with bankswitch in the area beyond 0x100000
(We also include here V-Liner, which uses a standard cart + RAM + some custom input)
***********************************************************************************************************/
#include "emu.h"
#include "rom.h"
//-------------------------------------------------
// neogeo_rom_device - constructor
//-------------------------------------------------
const device_type NEOGEO_ROM = &device_creator<neogeo_rom_device>;
neogeo_rom_device::neogeo_rom_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT16 clock, const char *shortname, const char *source) :
device_t(mconfig, type, name, tag, owner, clock, shortname, source),
device_neogeo_cart_interface(mconfig, *this)
{}
neogeo_rom_device::neogeo_rom_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT16 clock) :
device_t(mconfig, NEOGEO_ROM, "Neo Geo Standard Carts", tag, owner, clock, "neocart_rom", __FILE__),
device_neogeo_cart_interface(mconfig, *this)
{}
//-------------------------------------------------
// mapper specific start/reset
//-------------------------------------------------
void neogeo_rom_device::device_start()
{
}
void neogeo_rom_device::device_reset()
{
}
/*-------------------------------------------------
mapper specific handlers
-------------------------------------------------*/
READ16_MEMBER(neogeo_rom_device::rom_r)
{
// to speed up access to ROM, the access to ROM are actually replaced in the driver
// by accesses to the maincpu rom region, where we have anyway copied the rom content
UINT16* rom = (get_rom_size()) ? get_rom_base() : get_region_rom_base();
return rom[offset];
}
WRITE16_MEMBER(neogeo_rom_device::banksel_w)
{
// to speed up access to ROM, the banking is taken care of at driver level
// by mapping higher banks to the corresponding offset in maincpu rom region
}
/*************************************************
V-Liner : this is plain NeoGeo cart + RAM
**************************************************/
const device_type NEOGEO_VLINER_CART = &device_creator<neogeo_vliner_cart>;
neogeo_vliner_cart::neogeo_vliner_cart(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) :
neogeo_rom_device(mconfig, NEOGEO_VLINER_CART, "Neo Geo V-Liner Cart", tag, owner, clock, "neocart_vliner", __FILE__)
{}
void neogeo_vliner_cart::device_start()
{
save_item(NAME(m_cart_ram));
}
void neogeo_vliner_cart::device_reset()
{
memset(m_cart_ram, 0, 0x2000);
}
|