~ubuntu-branches/debian/sid/mame/sid

« back to all changes in this revision

Viewing changes to mess/src/mame/drivers/aztarac.c

  • Committer: Package Import Robot
  • Author(s): Jordi Mallach, Jordi Mallach, Emmanuel Kasper
  • Date: 2011-12-19 22:56:27 UTC
  • mfrom: (0.1.2)
  • Revision ID: package-import@ubuntu.com-20111219225627-ub5oga1oys4ogqzm
Tags: 0.144-1
[ Jordi Mallach ]
* Fix syntax errors in DEP5 copyright file (lintian).
* Use a versioned copyright Format specification field.
* Update Vcs-* URLs.
* Move transitional packages to the new metapackages section, and make
  them priority extra.
* Remove references to GNU/Linux and MESS sources from copyright.
* Add build variables for s390x.
* Use .xz tarballs as it cuts 4MB for the upstream sources.
* Add nplayers.ini as a patch. Update copyright file to add CC-BY-SA-3.0.

[ Emmanuel Kasper ]
* New upstream release. Closes: #651538.
* Add Free Desktop compliant png icons of various sizes taken from
  the hydroxygen iconset
* Mess is now built from a new source package, to avoid possible source
  incompatibilities between mame and the mess overlay.
* Mame-tools are not built from the mame source package anymore, but
  from the mess source package

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
/***************************************************************************
2
 
 
3
 
    Centuri Aztarac hardware
4
 
 
5
 
    driver by Mathis Rosenhauer
6
 
    Thanks to David Fish for additional hardware information.
7
 
 
8
 
    Games supported:
9
 
        * Aztarac
10
 
 
11
 
    Known bugs:
12
 
        * none at this time
13
 
 
14
 
***************************************************************************/
15
 
 
16
 
#include "emu.h"
17
 
#include "cpu/z80/z80.h"
18
 
#include "cpu/m68000/m68000.h"
19
 
#include "video/vector.h"
20
 
#include "includes/aztarac.h"
21
 
#include "sound/ay8910.h"
22
 
#include "machine/nvram.h"
23
 
 
24
 
 
25
 
 
26
 
/*************************************
27
 
 *
28
 
 *  Machine init
29
 
 *
30
 
 *************************************/
31
 
 
32
 
static IRQ_CALLBACK(aztarac_irq_callback)
33
 
{
34
 
        return 0xc;
35
 
}
36
 
 
37
 
 
38
 
static MACHINE_RESET( aztarac )
39
 
{
40
 
        device_set_irq_callback(machine.device("maincpu"), aztarac_irq_callback);
41
 
}
42
 
 
43
 
 
44
 
 
45
 
/*************************************
46
 
 *
47
 
 *  NVRAM handler
48
 
 *
49
 
 *************************************/
50
 
 
51
 
static READ16_HANDLER( nvram_r )
52
 
{
53
 
        aztarac_state *state = space->machine().driver_data<aztarac_state>();
54
 
        return state->m_nvram[offset] | 0xfff0;
55
 
}
56
 
 
57
 
 
58
 
 
59
 
/*************************************
60
 
 *
61
 
 *  Input ports
62
 
 *
63
 
 *************************************/
64
 
 
65
 
static READ16_HANDLER( joystick_r )
66
 
{
67
 
    return (((input_port_read(space->machine(), "STICKZ") - 0xf) << 8) |
68
 
            ((input_port_read(space->machine(), "STICKY") - 0xf) & 0xff));
69
 
}
70
 
 
71
 
 
72
 
 
73
 
/*************************************
74
 
 *
75
 
 *  Main CPU memory handlers
76
 
 *
77
 
 *************************************/
78
 
 
79
 
static ADDRESS_MAP_START( main_map, AS_PROGRAM, 16 )
80
 
        AM_RANGE(0x000000, 0x00bfff) AM_ROM
81
 
        AM_RANGE(0x022000, 0x0220ff) AM_READ(nvram_r) AM_WRITEONLY AM_SHARE("nvram")
82
 
        AM_RANGE(0x027000, 0x027001) AM_READ(joystick_r)
83
 
        AM_RANGE(0x027004, 0x027005) AM_READ_PORT("INPUTS")
84
 
        AM_RANGE(0x027008, 0x027009) AM_READWRITE(aztarac_sound_r, aztarac_sound_w)
85
 
        AM_RANGE(0x02700c, 0x02700d) AM_READ_PORT("DIAL")
86
 
        AM_RANGE(0x02700e, 0x02700f) AM_READ(watchdog_reset16_r)
87
 
        AM_RANGE(0xff8000, 0xffafff) AM_RAM AM_BASE_MEMBER(aztarac_state, m_vectorram)
88
 
        AM_RANGE(0xffb000, 0xffb001) AM_WRITE(aztarac_ubr_w)
89
 
        AM_RANGE(0xffe000, 0xffffff) AM_RAM
90
 
ADDRESS_MAP_END
91
 
 
92
 
 
93
 
 
94
 
/*************************************
95
 
 *
96
 
 *  Sound CPU memory handlers
97
 
 *
98
 
 *************************************/
99
 
 
100
 
static ADDRESS_MAP_START( sound_map, AS_PROGRAM, 8 )
101
 
        AM_RANGE(0x0000, 0x1fff) AM_ROM
102
 
        AM_RANGE(0x8000, 0x87ff) AM_RAM
103
 
        AM_RANGE(0x8800, 0x8800) AM_READ(aztarac_snd_command_r)
104
 
        AM_RANGE(0x8c00, 0x8c01) AM_DEVREADWRITE("ay1", ay8910_r, ay8910_data_address_w)
105
 
        AM_RANGE(0x8c02, 0x8c03) AM_DEVREADWRITE("ay2", ay8910_r, ay8910_data_address_w)
106
 
        AM_RANGE(0x8c04, 0x8c05) AM_DEVREADWRITE("ay3", ay8910_r, ay8910_data_address_w)
107
 
        AM_RANGE(0x8c06, 0x8c07) AM_DEVREADWRITE("ay4", ay8910_r, ay8910_data_address_w)
108
 
        AM_RANGE(0x9000, 0x9000) AM_READWRITE(aztarac_snd_status_r, aztarac_snd_status_w)
109
 
ADDRESS_MAP_END
110
 
 
111
 
 
112
 
 
113
 
/*************************************
114
 
 *
115
 
 *  Port definitions
116
 
 *
117
 
 *************************************/
118
 
 
119
 
static INPUT_PORTS_START( aztarac )
120
 
        PORT_START("STICKZ")
121
 
        PORT_BIT( 0x1f, 0xf, IPT_AD_STICK_Z ) PORT_MINMAX(0,0x1e) PORT_SENSITIVITY(100) PORT_KEYDELTA(1)
122
 
 
123
 
        PORT_START("STICKY")
124
 
        PORT_BIT( 0x1f, 0xf, IPT_AD_STICK_Y ) PORT_MINMAX(0,0x1e) PORT_SENSITIVITY(100) PORT_KEYDELTA(1) PORT_REVERSE
125
 
 
126
 
        PORT_START("DIAL")
127
 
        PORT_BIT( 0xff, 0x00, IPT_DIAL ) PORT_SENSITIVITY(25) PORT_KEYDELTA(10) PORT_CODE_DEC(KEYCODE_Z) PORT_CODE_INC(KEYCODE_X) PORT_REVERSE
128
 
 
129
 
        PORT_START("INPUTS")
130
 
        PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_BUTTON1 )
131
 
        PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_BUTTON2 )
132
 
        PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_START1 )
133
 
        PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_START2 )
134
 
        PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_COIN1 )
135
 
        PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_UNKNOWN )
136
 
        PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNKNOWN )
137
 
        PORT_SERVICE_NO_TOGGLE(0x80, IP_ACTIVE_LOW)
138
 
INPUT_PORTS_END
139
 
 
140
 
 
141
 
 
142
 
/*************************************
143
 
 *
144
 
 *  Machine drivers
145
 
 *
146
 
 *************************************/
147
 
 
148
 
static MACHINE_CONFIG_START( aztarac, aztarac_state )
149
 
 
150
 
        /* basic machine hardware */
151
 
        MCFG_CPU_ADD("maincpu", M68000, 8000000)
152
 
        MCFG_CPU_PROGRAM_MAP(main_map)
153
 
        MCFG_CPU_VBLANK_INT("screen", irq4_line_hold)
154
 
 
155
 
        MCFG_CPU_ADD("audiocpu", Z80, 2000000)
156
 
        MCFG_CPU_PROGRAM_MAP(sound_map)
157
 
        MCFG_CPU_PERIODIC_INT(aztarac_snd_timed_irq, 100)
158
 
 
159
 
        MCFG_MACHINE_RESET(aztarac)
160
 
        MCFG_NVRAM_ADD_1FILL("nvram")
161
 
 
162
 
        /* video hardware */
163
 
        MCFG_SCREEN_ADD("screen", VECTOR)
164
 
        MCFG_SCREEN_REFRESH_RATE(40)
165
 
        MCFG_SCREEN_SIZE(400, 300)
166
 
        MCFG_SCREEN_VISIBLE_AREA(0, 1024-1, 0, 768-1)
167
 
        MCFG_SCREEN_UPDATE(vector)
168
 
 
169
 
        MCFG_VIDEO_START(aztarac)
170
 
 
171
 
        /* sound hardware */
172
 
        MCFG_SPEAKER_STANDARD_MONO("mono")
173
 
 
174
 
        MCFG_SOUND_ADD("ay1", AY8910, 2000000)
175
 
        MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.15)
176
 
 
177
 
        MCFG_SOUND_ADD("ay2", AY8910, 2000000)
178
 
        MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.15)
179
 
 
180
 
        MCFG_SOUND_ADD("ay3", AY8910, 2000000)
181
 
        MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.15)
182
 
 
183
 
        MCFG_SOUND_ADD("ay4", AY8910, 2000000)
184
 
        MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.15)
185
 
MACHINE_CONFIG_END
186
 
 
187
 
 
188
 
 
189
 
/*************************************
190
 
 *
191
 
 *  ROM definitions
192
 
 *
193
 
 *************************************/
194
 
 
195
 
ROM_START( aztarac )
196
 
        ROM_REGION( 0xc000, "maincpu", 0 )
197
 
        ROM_LOAD16_BYTE( "l8_6.bin", 0x000000, 0x001000, CRC(25f8da18) SHA1(e8179ba3683e39c8225b549ead74c8af2d0a0b3e) )
198
 
        ROM_LOAD16_BYTE( "n8_0.bin", 0x000001, 0x001000, CRC(04e20626) SHA1(2b6a04992037257830df2c01a6da748fb4449f79) )
199
 
        ROM_LOAD16_BYTE( "l7_7.bin", 0x002000, 0x001000, CRC(230e244c) SHA1(42283a368144acf2aad2ef390e312e0951c3ea64) )
200
 
        ROM_LOAD16_BYTE( "n7_1.bin", 0x002001, 0x001000, CRC(37b12697) SHA1(da288b077902e3205600a021c3fac5730f9fb832) )
201
 
        ROM_LOAD16_BYTE( "l6_8.bin", 0x004000, 0x001000, CRC(1293fb9d) SHA1(5a8d512372fd38f1a55f990f5c3eb51833c463d8) )
202
 
        ROM_LOAD16_BYTE( "n6_2.bin", 0x004001, 0x001000, CRC(712c206a) SHA1(eb29f161189c14d84896502940e3ab6cc3bd1cd0) )
203
 
        ROM_LOAD16_BYTE( "l5_9.bin", 0x006000, 0x001000, CRC(743a6501) SHA1(da83a8f756466bcd94d4b0cc28a1a1858e9532f3) )
204
 
        ROM_LOAD16_BYTE( "n5_3.bin", 0x006001, 0x001000, CRC(a65cbf99) SHA1(dd06f98c0989604bd4ac6317e545e1fcf6722e75) )
205
 
        ROM_LOAD16_BYTE( "l4_a.bin", 0x008000, 0x001000, CRC(9cf1b0a1) SHA1(dd644026f49d8430c0b4cf4c750dc33c013c19fc) )
206
 
        ROM_LOAD16_BYTE( "n4_4.bin", 0x008001, 0x001000, CRC(5f0080d5) SHA1(fb1303f9a02067faea2ac4d523051c416de9cf35) )
207
 
        ROM_LOAD16_BYTE( "l3_b.bin", 0x00a000, 0x001000, CRC(8cc7f7fa) SHA1(fefb9a4fdd63878bc5d8138e3e8456cb6638425a) )
208
 
        ROM_LOAD16_BYTE( "n3_5.bin", 0x00a001, 0x001000, CRC(40452376) SHA1(1d058b7ecd2bbff3393950aab9215b262908475b) )
209
 
 
210
 
        ROM_REGION( 0x10000, "audiocpu", 0 )
211
 
        ROM_LOAD( "j4_c.bin", 0x0000, 0x1000, CRC(e897dfcd) SHA1(750df3d08512d8098a13ec62677831efa164c126) )
212
 
        ROM_LOAD( "j3_d.bin", 0x1000, 0x1000, CRC(4016de77) SHA1(7232ec003f1b9d3623d762f3270108a1d1837846) )
213
 
ROM_END
214
 
 
215
 
 
216
 
 
217
 
/*************************************
218
 
 *
219
 
 *  Game drivers
220
 
 *
221
 
 *************************************/
222
 
 
223
 
GAME( 1983, aztarac, 0, aztarac, aztarac, 0, ROT0, "Centuri", "Aztarac", 0 )