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
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
|
/*********************************************************************
a2arcadeboard.c
Implementation of the Third Millenium Engineering Arcade Board
*********************************************************************/
#include "emu.h"
#include "machine/a2arcadebd.h"
/***************************************************************************
PARAMETERS
***************************************************************************/
#define TMS_TAG "arcbd_tms"
#define AY_TAG "arcbd_ay"
#define SCREEN_TAG "screen"
//**************************************************************************
// GLOBAL VARIABLES
//**************************************************************************
const device_type A2BUS_ARCADEBOARD = &device_creator<a2bus_arcboard_device>;
static const ay8910_interface arcadeboard_ay8910_interface =
{
AY8910_LEGACY_OUTPUT,
AY8910_DEFAULT_LOADS,
DEVCB_NULL
};
static TMS9928A_INTERFACE(arcadeboard_tms9918a_interface)
{
SCREEN_TAG,
0x4000, // 16k of VRAM
DEVCB_NULL // VBL interrupt
};
MACHINE_CONFIG_FRAGMENT( arcadeboard )
MCFG_TMS9928A_ADD( TMS_TAG, TMS9918A, arcadeboard_tms9918a_interface )
MCFG_TMS9928A_SCREEN_ADD_NTSC( SCREEN_TAG )
MCFG_SCREEN_UPDATE_DEVICE( TMS_TAG, tms9918a_device, screen_update )
MCFG_SPEAKER_STANDARD_MONO("mono")
MCFG_SOUND_ADD(AY_TAG, AY8910, 1022727)
MCFG_SOUND_CONFIG(arcadeboard_ay8910_interface)
MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.0)
MACHINE_CONFIG_END
//-------------------------------------------------
// machine_config_additions - device-specific
// machine configurations
//-------------------------------------------------
machine_config_constructor a2bus_arcboard_device::device_mconfig_additions() const
{
return MACHINE_CONFIG_NAME( arcadeboard );
}
//**************************************************************************
// LIVE DEVICE
//**************************************************************************
a2bus_arcboard_device::a2bus_arcboard_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) :
device_t(mconfig, A2BUS_ARCADEBOARD, "Third Millenium Engineering Arcade Board", tag, owner, clock),
device_a2bus_card_interface(mconfig, *this),
m_tms(*this, TMS_TAG),
m_ay(*this, AY_TAG)
{
m_shortname = "a2arcbd";
}
a2bus_arcboard_device::a2bus_arcboard_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock) :
device_t(mconfig, type, name, tag, owner, clock),
device_a2bus_card_interface(mconfig, *this),
m_tms(*this, TMS_TAG),
m_ay(*this, AY_TAG)
{
m_shortname = "a2arcbd";
}
//-------------------------------------------------
// device_start - device-specific startup
//-------------------------------------------------
void a2bus_arcboard_device::device_start()
{
// set_a2bus_device makes m_slot valid
set_a2bus_device();
}
void a2bus_arcboard_device::device_reset()
{
}
/*
C0nx map:
0 - TMS read vram
1 - TMS read status
2 - TMS write vram
3 - TMS write register
5 - AY register select
6 - AY data
*/
UINT8 a2bus_arcboard_device::read_c0nx(address_space &space, UINT8 offset)
{
switch (offset)
{
case 0:
return m_tms->vram_read(space, 0);
case 1:
return m_tms->register_read(space, 0);
case 6:
return ay8910_r(m_ay, space, 0);
}
return 0xff;
}
void a2bus_arcboard_device::write_c0nx(address_space &space, UINT8 offset, UINT8 data)
{
switch (offset)
{
case 2:
m_tms->vram_write(space, 0, data);
break;
case 3:
m_tms->register_write(space, 0, data);
break;
case 5:
ay8910_address_w(m_ay, space, 0, data);
break;
case 6:
ay8910_data_w(m_ay, space, 0, data);
break;
}
}
|