1 /*
2 Driver For DECO ASTRO FIGHTER/TOMAHAWK 777
3
4 Initial Version
5
6 Lee Taylor 28/11/1997
7
8
9 Astro Fighter Sets:
10
11 The differences are minor. From newest to oldest:
12
13 Main Set: 16Kbit ROMs
14 Green/Hollow empty fuel bar.
15 60 points for every bomb destroyed.
16
17 Set 2: 8Kbit ROMs
18 Blue/Solid empty fuel bar.
19 60 points for every bomb destroyed.
20
21 Set 3: 8Kbit ROMs
22 Blue/Solid empty fuel bar.
23 300 points for every seven bombs destroyed.
24
25
26 To Do!!
27 Figure out the correct vblank interval. The one I'm using seems to be
28 ok for Astro Fighter, but the submarine in Tomahawk flickers.
29 Maybe the video rate should 57FPS as the Burger Time games?
30
31 Rotation Support
32
33 Also....
34 I know there must be at least one other rom set for Astro Fighter
35 I have played one that stoped between waves to show the next enemy
36 */
37
38 #include "driver.h"
39 #include "vidhrdw/generic.h"
40
41 extern unsigned char *astrof_color;
42 extern unsigned char *tomahawk_protection;
43
44 PALETTE_INIT( astrof );
45 VIDEO_START( astrof );
46 VIDEO_UPDATE( astrof );
47 WRITE_HANDLER( astrof_videoram_w );
48 WRITE_HANDLER( tomahawk_videoram_w );
49 WRITE_HANDLER( astrof_video_control1_w );
50 WRITE_HANDLER( astrof_video_control2_w );
51 WRITE_HANDLER( tomahawk_video_control2_w );
52 READ_HANDLER( tomahawk_protection_r );
53 WRITE_HANDLER( astrof_sample1_w );
54 WRITE_HANDLER( astrof_sample2_w );
55
56 extern struct Samplesinterface astrof_samples_interface;
57 extern struct Samplesinterface tomahawk_samples_interface;
58
MEMORY_READ_START(readmem)59 static MEMORY_READ_START( readmem )
60 { 0x0000, 0x03ff, MRA_RAM },
61 { 0x4000, 0x5fff, MRA_RAM },
62 { 0xa000, 0xa000, input_port_0_r },
63 { 0xa001, 0xa001, input_port_1_r }, /* IN1 */
64 { 0xa003, 0xa003, tomahawk_protection_r }, // Only on Tomahawk
65 { 0xd000, 0xffff, MRA_ROM },
66 MEMORY_END
67
68 static MEMORY_WRITE_START( astrof_writemem )
69 { 0x0000, 0x03ff, MWA_RAM },
70 { 0x4000, 0x5fff, astrof_videoram_w, &videoram, &videoram_size },
71 { 0x8003, 0x8003, MWA_RAM, &astrof_color },
72 { 0x8004, 0x8004, astrof_video_control1_w },
73 { 0x8005, 0x8005, astrof_video_control2_w },
74 { 0x8006, 0x8006, astrof_sample1_w },
75 { 0x8007, 0x8007, astrof_sample2_w },
76 MEMORY_END
77
78 static MEMORY_WRITE_START( tomahawk_writemem )
79 { 0x0000, 0x03ff, MWA_RAM },
80 { 0x4000, 0x5fff, tomahawk_videoram_w, &videoram, &videoram_size },
81 { 0x8003, 0x8003, MWA_RAM, &astrof_color },
82 { 0x8004, 0x8004, astrof_video_control1_w },
83 { 0x8005, 0x8005, tomahawk_video_control2_w },
84 { 0x8006, 0x8006, MWA_NOP }, // Sound triggers
85 { 0x8007, 0x8007, MWA_RAM, &tomahawk_protection },
86 MEMORY_END
87
88
89
90 /***************************************************************************
91
92 These games don't have VBlank interrupts.
93 Interrupts are still used by the game: but they are related to coin
94 slots.
95
96 ***************************************************************************/
97 static INTERRUPT_GEN( astrof_interrupt )
98 {
99 if (readinputport(2) & 1) /* Coin */
100 cpu_set_irq_line(0, IRQ_LINE_NMI, PULSE_LINE);
101 }
102
103
104 INPUT_PORTS_START( astrof )
105 PORT_START /* IN0 */
106 PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_START1 )
107 PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_START2 )
108 /* Player 1 Controls */
109 PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT | IPF_2WAY )
110 PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT | IPF_2WAY )
111 PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_BUTTON1 )
112 /* Player 2 Controls */
113 PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT | IPF_2WAY | IPF_COCKTAIL )
114 PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT | IPF_2WAY | IPF_COCKTAIL )
115 PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_BUTTON1 | IPF_COCKTAIL )
116
117 PORT_START /* DSW0 */
118 PORT_DIPNAME( 0x03, 0x00, DEF_STR( Lives ) )
119 PORT_DIPSETTING( 0x00, "3" )
120 PORT_DIPSETTING( 0x01, "4" )
121 PORT_DIPSETTING( 0x02, "5" )
122 PORT_DIPSETTING( 0x03, "6" )
123
124 PORT_DIPNAME( 0x0c, 0x00, DEF_STR( Coinage ) )
125 PORT_DIPSETTING( 0x08, DEF_STR( 2C_1C ) )
126 PORT_DIPSETTING( 0x00, DEF_STR( 1C_1C ) )
127 PORT_DIPSETTING( 0x04, DEF_STR( 1C_2C ) )
128 /* 0x0c gives 2 Coins/1 Credit */
129
130 PORT_DIPNAME( 0x30, 0x00, DEF_STR( Bonus_Life ) )
131 PORT_DIPSETTING( 0x00, "3000" )
132 PORT_DIPSETTING( 0x10, "5000" )
133 PORT_DIPSETTING( 0x20, "7000" )
134 PORT_DIPSETTING( 0x30, "None" )
135
136 PORT_DIPNAME( 0x40, 0x00, DEF_STR( Difficulty ) )
137 PORT_DIPSETTING( 0x00, "Easy" )
138 PORT_DIPSETTING( 0x40, "Hard" )
139
140 PORT_BIT ( 0x80, IP_ACTIVE_LOW, IPT_VBLANK )
141
142 PORT_START /* FAKE */
143 /* The coin slots are not memory mapped. Coin insertion causes a NMI. */
144 /* This fake input port is used by the interrupt */
145 /* handler to be notified of coin insertions. We use IMPULSE to */
146 /* trigger exactly one interrupt, without having to check when the */
147 /* user releases the key. */
148 /* The cabinet selector is not memory mapped, but just disables the */
149 /* screen flip logic */
150 PORT_BIT_IMPULSE( 0x01, IP_ACTIVE_HIGH, IPT_COIN1, 1 )
151 PORT_DIPNAME( 0x02, 0x00, DEF_STR( Cabinet ) )
152 PORT_DIPSETTING( 0x00, DEF_STR( Upright ) )
153 PORT_DIPSETTING( 0x02, DEF_STR( Cocktail ) )
154 INPUT_PORTS_END
155
156
157 INPUT_PORTS_START( tomahawk )
158 PORT_START /* IN0 */
159 PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT | IPF_4WAY )
160 PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT | IPF_4WAY )
161 PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN | IPF_4WAY )
162 PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_JOYSTICK_UP | IPF_4WAY )
163 PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_BUTTON1 )
164 PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_START1 )
165 PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_START2 )
166 PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNUSED )
167
168 PORT_START /* DSW0 */
169 PORT_DIPNAME( 0x03, 0x00, DEF_STR( Lives ) )
170 PORT_DIPSETTING( 0x00, "3" )
171 PORT_DIPSETTING( 0x01, "4" )
172 PORT_DIPSETTING( 0x02, "5" )
173 PORT_DIPSETTING( 0x03, "6" )
174
175 PORT_DIPNAME( 0x0c, 0x00, DEF_STR( Coinage ) )
176 PORT_DIPSETTING( 0x08, DEF_STR( 2C_1C ) )
177 PORT_DIPSETTING( 0x00, DEF_STR( 1C_1C ) )
178 PORT_DIPSETTING( 0x04, DEF_STR( 1C_2C ) )
179 /* 0x0c gives 2 Coins/1 Credit */
180
181 PORT_DIPNAME( 0x30, 0x00, DEF_STR( Bonus_Life ) )
182 PORT_DIPSETTING( 0x00, "5000" )
183 PORT_DIPSETTING( 0x10, "7000" )
184 PORT_DIPSETTING( 0x20, "10000" )
185 PORT_DIPSETTING( 0x30, "None" )
186
187 PORT_DIPNAME( 0x40, 0x00, DEF_STR( Difficulty ) ) /* Only on Tomahawk 777 */
188 PORT_DIPSETTING( 0x00, "Easy" )
189 PORT_DIPSETTING( 0x40, "Hard" )
190
191 PORT_BIT ( 0x80, IP_ACTIVE_LOW, IPT_VBLANK )
192
193 PORT_START /* FAKE */
194 /* The coin slots are not memory mapped. Coin insertion causes a NMI. */
195 /* This fake input port is used by the interrupt */
196 /* handler to be notified of coin insertions. We use IMPULSE to */
197 /* trigger exactly one interrupt, without having to check when the */
198 /* user releases the key. */
199 /* The cabinet selector is not memory mapped, but just disables the */
200 /* screen flip logic */
201 PORT_BIT_IMPULSE( 0x01, IP_ACTIVE_HIGH, IPT_COIN1, 1 )
202 PORT_DIPNAME( 0x02, 0x00, DEF_STR( Cabinet ) )
203 PORT_DIPSETTING( 0x00, DEF_STR( Upright ) )
204 PORT_DIPSETTING( 0x02, DEF_STR( Cocktail ) )
205 INPUT_PORTS_END
206
207
208 static MACHINE_DRIVER_START( astrof )
209
210 /* basic machine hardware */
211 MDRV_CPU_ADD_TAG("main", M6502, 10595000/16) /* 0.66 MHz */
212 MDRV_CPU_MEMORY(readmem,astrof_writemem)
213 MDRV_CPU_VBLANK_INT(astrof_interrupt,1)
214
215 MDRV_FRAMES_PER_SECOND(60)
216 MDRV_VBLANK_DURATION(3400)
217
218 /* video hardware */
219 MDRV_VIDEO_ATTRIBUTES(VIDEO_TYPE_RASTER)
220 MDRV_SCREEN_SIZE(256, 256)
221 MDRV_VISIBLE_AREA(8, 256-1-8, 8, 256-1-8)
222 MDRV_PALETTE_LENGTH(16)
223
224 MDRV_PALETTE_INIT(astrof)
225 MDRV_VIDEO_START(astrof)
226 MDRV_VIDEO_UPDATE(astrof)
227
228 /* sound hardware */
229 MDRV_SOUND_ADD_TAG("samples", SAMPLES, astrof_samples_interface)
230 MACHINE_DRIVER_END
231
232
233 static MACHINE_DRIVER_START( tomahawk )
234
235 /* basic machine hardware */
236 MDRV_IMPORT_FROM(astrof)
237 MDRV_CPU_MODIFY("main")
238 MDRV_CPU_MEMORY(readmem,tomahawk_writemem)
239
240 /* video hardware */
241 MDRV_PALETTE_LENGTH(32)
242
243 /* sound hardware */
244 MDRV_SOUND_REPLACE("samples", SAMPLES, tomahawk_samples_interface)
245 MACHINE_DRIVER_END
246
247
248
249 /***************************************************************************
250
251 Game driver(s)
252
253 ***************************************************************************/
254
255 ROM_START( astrof )
256 ROM_REGION( 0x10000, REGION_CPU1, 0 ) /* 64k for code */
257 ROM_LOAD( "afii.6", 0xd000, 0x0800, CRC(d6cd13a4) SHA1(359b00b02f4256f1138c8526214c6a34d2e5b47a) )
258 ROM_LOAD( "afii.5", 0xd800, 0x0800, CRC(6fd3c4df) SHA1(73aad03e2588ac9f249d5751eb4a7c7cd12fd3b9) )
259 ROM_LOAD( "afii.4", 0xe000, 0x0800, CRC(9612dae3) SHA1(8ee1797c212e06c381972b7b555f240ff317d75d) )
260 ROM_LOAD( "afii.3", 0xe800, 0x0800, CRC(5a0fef42) SHA1(92a575abdf17bbb5ed6bc67479049523a985aa75) )
261 ROM_LOAD( "afii.2", 0xf000, 0x0800, CRC(69f8a4fc) SHA1(9f9a935f19187640018009ade92f8993912ef6c2) )
262 ROM_LOAD( "afii.1", 0xf800, 0x0800, CRC(322c09d2) SHA1(89723e3d998ff9cb9b174bca4b072b412b290c04) )
263
264 ROM_REGION( 0x0020, REGION_PROMS, 0 )
265 ROM_LOAD( "astrf.clr", 0x0000, 0x0020, CRC(61329fd1) SHA1(15782d8757d4dda5a8b97815e94c90218f0e08dd) )
266 ROM_END
267
268 ROM_START( astrof2 )
269 ROM_REGION( 0x10000, REGION_CPU1, 0 ) /* 64k for code */
270 ROM_LOAD( "kei2", 0xd000, 0x0400, CRC(9f0bd355) SHA1(45db9229dcd8bbd366ff13c683625c3d1c175598) )
271 ROM_LOAD( "keii", 0xd400, 0x0400, CRC(71f229f0) SHA1(be426360567066df01fb428dc5cd2d6ef01a4cf7) )
272 ROM_LOAD( "kei0", 0xd800, 0x0400, CRC(88114f7c) SHA1(e64ae3cac92d2a3c02edc8e81c88d5d275e89293) )
273 ROM_LOAD( "af579.08", 0xdc00, 0x0400, CRC(9793c124) SHA1(ae0352ed13fa21a00181669e92f9e66c938e4843) )
274 ROM_LOAD( "ke8", 0xe000, 0x0400, CRC(08e44b12) SHA1(0e156fff081ae74321597eca1a02920bfc464651) )
275 ROM_LOAD( "ke7", 0xe400, 0x0400, CRC(8a42d62c) SHA1(f5c0043be113c88f87deee3a2acd7d778a569e4f) )
276 ROM_LOAD( "ke6", 0xe800, 0x0400, CRC(3e9aa743) SHA1(5f473afee7a416bb6f4e658cf8e46f8362ae3bba) )
277 ROM_LOAD( "ke5", 0xec00, 0x0400, CRC(712a4557) SHA1(66a19378782c3911b8740ca25451ce84e1096fd0) )
278 ROM_LOAD( "ke4", 0xf000, 0x0400, CRC(ad06f306) SHA1(d6ab7cba97658a46a63846a203eb89d9fc367e4f) )
279 ROM_LOAD( "ke3", 0xf400, 0x0400, CRC(680b91b4) SHA1(004fd0f6564c19277632adec42bcf1054d043e4a) )
280 ROM_LOAD( "ke2", 0xf800, 0x0400, CRC(2c4cab1a) SHA1(3171764a17f2c5fda39f0b32ccce60bc107d306e) )
281 ROM_LOAD( "af583.00", 0xfc00, 0x0400, CRC(f699dda3) SHA1(e595cb93df40f64f7521afa51a879d53e1d04126) )
282
283 ROM_REGION( 0x0020, REGION_PROMS, 0 )
284 ROM_LOAD( "astrf.clr", 0x0000, 0x0020, CRC(61329fd1) SHA1(15782d8757d4dda5a8b97815e94c90218f0e08dd) )
285 ROM_END
286
287 ROM_START( astrof3 )
288 ROM_REGION( 0x10000, REGION_CPU1, 0 ) /* 64k for code */
289 ROM_LOAD( "kei2", 0xd000, 0x0400, CRC(9f0bd355) SHA1(45db9229dcd8bbd366ff13c683625c3d1c175598) )
290 ROM_LOAD( "keii", 0xd400, 0x0400, CRC(71f229f0) SHA1(be426360567066df01fb428dc5cd2d6ef01a4cf7) )
291 ROM_LOAD( "kei0", 0xd800, 0x0400, CRC(88114f7c) SHA1(e64ae3cac92d2a3c02edc8e81c88d5d275e89293) )
292 ROM_LOAD( "ke9", 0xdc00, 0x0400, CRC(29cbaea6) SHA1(da29e8156218884195b16839be9ad1e98a8348ac) )
293 ROM_LOAD( "ke8", 0xe000, 0x0400, CRC(08e44b12) SHA1(0e156fff081ae74321597eca1a02920bfc464651) )
294 ROM_LOAD( "ke7", 0xe400, 0x0400, CRC(8a42d62c) SHA1(f5c0043be113c88f87deee3a2acd7d778a569e4f) )
295 ROM_LOAD( "ke6", 0xe800, 0x0400, CRC(3e9aa743) SHA1(5f473afee7a416bb6f4e658cf8e46f8362ae3bba) )
296 ROM_LOAD( "ke5", 0xec00, 0x0400, CRC(712a4557) SHA1(66a19378782c3911b8740ca25451ce84e1096fd0) )
297 ROM_LOAD( "ke4", 0xf000, 0x0400, CRC(ad06f306) SHA1(d6ab7cba97658a46a63846a203eb89d9fc367e4f) )
298 ROM_LOAD( "ke3", 0xf400, 0x0400, CRC(680b91b4) SHA1(004fd0f6564c19277632adec42bcf1054d043e4a) )
299 ROM_LOAD( "ke2", 0xf800, 0x0400, CRC(2c4cab1a) SHA1(3171764a17f2c5fda39f0b32ccce60bc107d306e) )
300 ROM_LOAD( "kei", 0xfc00, 0x0400, CRC(fce4718d) SHA1(3a313328609f6bef644a2d906d8ca74c5d52058b) )
301
302 ROM_REGION( 0x0020, REGION_PROMS, 0 )
303 ROM_LOAD( "astrf.clr", 0x0000, 0x0020, CRC(61329fd1) SHA1(15782d8757d4dda5a8b97815e94c90218f0e08dd) )
304 ROM_END
305
306 ROM_START( tomahawk )
307 ROM_REGION( 0x10000, REGION_CPU1, 0 ) /* 64k for code */
308 ROM_LOAD( "l8-1", 0xdc00, 0x0400, CRC(7c911661) SHA1(3fc75bb0e6a89d41d76f82eeb0fde7d33809dddf) )
309 ROM_LOAD( "l7-1", 0xe000, 0x0400, CRC(adeffb69) SHA1(8ff7ada883825a8b56cae3368ce377228922ab1d) )
310 ROM_LOAD( "l6-1", 0xe400, 0x0400, CRC(9116e59d) SHA1(22a6d410fff8534b3aa7eb2ed0a8c096c890acf5) )
311 ROM_LOAD( "l5-1", 0xe800, 0x0400, CRC(01e4c7c4) SHA1(fbb37539d08284bae6454cd57650e8507a88acdb) )
312 ROM_LOAD( "l4-1", 0xec00, 0x0400, CRC(d9f69cb0) SHA1(d6a2dcaf867f33068e7d7ad7a3faf62a360456a6) )
313 ROM_LOAD( "l3-1", 0xf000, 0x0400, CRC(7ce7183f) SHA1(949c7b696fe215b68af450299c91e90fb27b0141) )
314 ROM_LOAD( "l2-1", 0xf400, 0x0400, CRC(43fea29d) SHA1(6890311440089a16d2e4d502855670723df41e16) )
315 ROM_LOAD( "l1-1", 0xf800, 0x0400, CRC(f2096ba9) SHA1(566f6d49cdacb5e39c40eb3773640270ef5f272c) )
316 ROM_LOAD( "l0-1", 0xfc00, 0x0400, CRC(42edbc28) SHA1(bab1fe8591509783dfdd4f53b9159263b9201970) )
317
318 ROM_REGION( 0x0020, REGION_PROMS, 0 )
319 ROM_LOAD( "t777.clr", 0x0000, 0x0020, CRC(d6a528fd) SHA1(5fc08252a2d7c5405f601efbfb7d84bec328d733) )
320 ROM_END
321
322 ROM_START( tomahaw5 )
323 ROM_REGION( 0x10000, REGION_CPU1, 0 ) /* 64k for code */
324 ROM_LOAD( "thawk.l8", 0xdc00, 0x0400, CRC(b01dab4b) SHA1(d8b4266359a3b18d649f539fad8dce4d73cec412) )
325 ROM_LOAD( "thawk.l7", 0xe000, 0x0400, CRC(3a6549e8) SHA1(2ba622d78596c72998784432cf8fbbe733c50ce5) )
326 ROM_LOAD( "thawk.l6", 0xe400, 0x0400, CRC(863e47f7) SHA1(e8e48560c217025796be20f51c50ec276dba3eb5) )
327 ROM_LOAD( "thawk.l5", 0xe800, 0x0400, CRC(de0183bc) SHA1(7cb8d013750c8fb423ab2759443f805bc8440d53) )
328 ROM_LOAD( "thawk.l4", 0xec00, 0x0400, CRC(11e9c7ea) SHA1(9dbdce7d518891aa8b08dca50d4e8aaec89cc038) )
329 ROM_LOAD( "thawk.l3", 0xf000, 0x0400, CRC(ec44d388) SHA1(7dda9db5ce2271988e9316dacf4b6ccbb72f50c9) )
330 ROM_LOAD( "thawk.l2", 0xf400, 0x0400, CRC(dc0a0f54) SHA1(8e5c94706768ffafaba96382f2e757ecb825799f) )
331 ROM_LOAD( "thawk.l1", 0xf800, 0x0400, CRC(1d9dab9c) SHA1(54dd91164db0489bd5984f10d4f0254184302ae4) )
332 ROM_LOAD( "thawk.l0", 0xfc00, 0x0400, CRC(d21a1eba) SHA1(ce9ad7a1a3b069ef4eb8b5ce569e52c488a224f2) )
333
334 ROM_REGION( 0x0020, REGION_PROMS, 0 )
335 ROM_LOAD( "t777.clr", 0x0000, 0x0020, CRC(d6a528fd) SHA1(5fc08252a2d7c5405f601efbfb7d84bec328d733) )
336 ROM_END
337
338
339
340 GAME( 1979, astrof, 0, astrof, astrof, 0, ROT90, "Data East", "Astro Fighter (set 1)" )
341 GAME( 1979, astrof2, astrof, astrof, astrof, 0, ROT90, "Data East", "Astro Fighter (set 2)" )
342 GAME( 1979, astrof3, astrof, astrof, astrof, 0, ROT90, "Data East", "Astro Fighter (set 3)" )
343 GAMEX(1980, tomahawk, 0, tomahawk, tomahawk, 0, ROT90, "Data East", "Tomahawk 777 (Revision 1)", GAME_NO_SOUND )
344 GAMEX(1980, tomahaw5, tomahawk, tomahawk, tomahawk, 0, ROT90, "Data East", "Tomahawk 777 (Revision 5)", GAME_NO_SOUND )
345