1 // license:BSD-3-Clause
2 // copyright-holders:Nicola Salmoria
3 /***************************************************************************
4
5 Bank Panic / Combat Hawk hardware
6 Sega & Sanritsu
7 1984 - 1987
8
9 driver by Nicola Salmoria
10
11
12 PCB Layout (Comba Hawk)
13 -----------------------
14
15 C2-00170-A BANK PANIC (screened on PCB)
16 834-6381 COMBAT HAWK (sticker)
17 SANRITSU VIDEO GAME - screened on PCB
18
19 |------------------------------------------------------------------------|
20 | PR-10902 PR-10900 |
21 | PAL (315-5073) |
22 | |
23 | PAL (315-5074) EPR-10907 |
24 | |
25 | 2016 EPR-10908 EPR-10903 |
26 | 2|
27 | EPR-10909 EPR-10904 2|
28 | ||
29 | EPR-10910 PR-10901 EPR-10905 SW1 W|
30 | A|
31 | Y|
32 | EPR-10911 2016 EPR-10906 SN76489 |
33 | |
34 | SN76489 |
35 | EPR-10912 |
36 | SN76489 |
37 | 2016 EPR-10913 Z80 |
38 | VOL |
39 |15.468MHz EPR-10914 555 358 HA1377A|
40 |------------------------------------------------------------------------|
41
42 Notes:
43 2016 - 2kx8 SRAM
44 Z80 clock - 2.578MHz [15.468/6]
45 SN76489 clock - 2.578MHz [15.468/6]
46 VSync - 60Hz
47 HSync - 15.36kHz
48 SW1 - 8-position DIP switch
49
50 ROMs
51 ----
52
53 PR-10900 - ?
54 PR-10901 - 82S129 BIPOLAR PROM
55 PR-10902 - 82S129 BIPOLAR PROM
56 EPR-10907-14 & 3 - 2764 EPROM
57 EPR-10904-6 - 27128 EPROM
58 315-5073 - PAL16L4 (protected)
59 315-5074 - PAL10L8 (read OK)
60
61
62
63 ---------------------------------------------------
64
65 Bank Panic memory map (preliminary)
66 Similar to Appoooh
67
68
69 0000-dfff ROM
70 e000-e7ff RAM
71 f000-f3ff Video RAM #1
72 f400-f7ff Color RAM #1
73 f800-fbff Video RAM #2
74 fc00-ffff Color RAM #2
75
76 I/O
77 read:
78 00 IN0
79 01 IN1
80 02 IN2
81 04 DSW
82
83 write:
84 00 SN76496 #1
85 01 SN76496 #2
86 02 SN76496 #3
87 05 horizontal scroll
88 07 bit 0-1 = at least one of these two controls the playfield priority
89 bit 2-3 = ?
90 bit 4 = NMI enable
91 bit 5 = flip screen
92 bit 6-7 = ?
93
94 ***************************************************************************/
95
96 #include "emu.h"
97 #include "includes/bankp.h"
98
99 #include "cpu/z80/z80.h"
100 #include "sound/sn76496.h"
101 #include "screen.h"
102 #include "speaker.h"
103
104
105 #define MASTER_CLOCK XTAL(15'468'480)
106
107 // Video timing
108 // PCB measured: H = 15.61khz V = 60.99hz, +/- 0.01hz
109 // --> VTOTAL should be OK, HTOTAL not 100% certain
110 #define PIXEL_CLOCK MASTER_CLOCK/3
111
112 #define HTOTAL 330
113 #define HBEND 0+3*8
114 #define HBSTART 224+3*8
115
116 #define VTOTAL 256
117 #define VBEND 0+2*8
118 #define VBSTART 224+2*8
119
120
121 /*************************************
122 *
123 * Address maps
124 *
125 *************************************/
126
bankp_map(address_map & map)127 void bankp_state::bankp_map(address_map &map)
128 {
129 map(0x0000, 0xdfff).rom();
130 map(0xe000, 0xefff).ram();
131 map(0xf000, 0xf3ff).ram().w(FUNC(bankp_state::videoram_w)).share("videoram");
132 map(0xf400, 0xf7ff).ram().w(FUNC(bankp_state::colorram_w)).share("colorram");
133 map(0xf800, 0xfbff).ram().w(FUNC(bankp_state::videoram2_w)).share("videoram2");
134 map(0xfc00, 0xffff).ram().w(FUNC(bankp_state::colorram2_w)).share("colorram2");
135 }
136
bankp_io_map(address_map & map)137 void bankp_state::bankp_io_map(address_map &map)
138 {
139 map.global_mask(0xff);
140 map(0x00, 0x00).portr("IN0").w("sn1", FUNC(sn76489_device::write));
141 map(0x01, 0x01).portr("IN1").w("sn2", FUNC(sn76489_device::write));
142 map(0x02, 0x02).portr("IN2").w("sn3", FUNC(sn76489_device::write));
143 map(0x04, 0x04).portr("DSW1");
144 map(0x05, 0x05).w(FUNC(bankp_state::scroll_w));
145 map(0x07, 0x07).w(FUNC(bankp_state::out_w));
146 }
147
148
149 /*************************************
150 *
151 * Input ports
152 *
153 *************************************/
154
155 static INPUT_PORTS_START( bankp )
156 PORT_START("IN0")
157 PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_UNUSED )
158 PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_JOYSTICK_RIGHT ) PORT_2WAY
159 PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_UNUSED )
160 PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_JOYSTICK_LEFT ) PORT_2WAY
161 PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_BUTTON1 )
162 PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_COIN1 )
163 PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_SERVICE1 )
164 PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_BUTTON2 )
165
166 PORT_START("IN1")
167 PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_UNUSED )
168 PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_JOYSTICK_RIGHT ) PORT_2WAY PORT_COCKTAIL
169 PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_UNUSED )
170 PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_JOYSTICK_LEFT ) PORT_2WAY PORT_COCKTAIL
171 PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_BUTTON1 ) PORT_COCKTAIL
172 PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_START1 )
173 PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_START2 )
174 PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_BUTTON2 ) PORT_COCKTAIL
175
176 PORT_START("IN2")
177 PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_BUTTON3 )
178 PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_BUTTON3 ) PORT_COCKTAIL
179 PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_COIN2 )
180 PORT_BIT( 0xf8, IP_ACTIVE_HIGH, IPT_UNUSED )
181
182 PORT_START("DSW1")
183 PORT_DIPNAME( 0x03, 0x00, "Coin Switch 1" ) PORT_DIPLOCATION("SW1:1,2")
184 PORT_DIPSETTING( 0x03, DEF_STR( 3C_1C ) )
185 PORT_DIPSETTING( 0x02, DEF_STR( 2C_1C ) )
186 PORT_DIPSETTING( 0x00, DEF_STR( 1C_1C ) )
187 PORT_DIPSETTING( 0x01, DEF_STR( 1C_2C ) )
188 PORT_DIPNAME( 0x04, 0x00, "Coin Switch 2" ) PORT_DIPLOCATION("SW1:3")
189 PORT_DIPSETTING( 0x04, DEF_STR( 2C_1C ) )
190 PORT_DIPSETTING( 0x00, DEF_STR( 1C_1C ) )
191 PORT_DIPNAME( 0x08, 0x00, DEF_STR( Lives ) ) PORT_DIPLOCATION("SW1:4")
192 PORT_DIPSETTING( 0x00, "3" )
193 PORT_DIPSETTING( 0x08, "4" )
194 PORT_DIPNAME( 0x10, 0x00, DEF_STR( Bonus_Life ) ) PORT_DIPLOCATION("SW1:5")
195 PORT_DIPSETTING( 0x00, "70K 200K 500K" ) /* and 900K 1500K 2000K */
196 PORT_DIPSETTING( 0x10, "100K 400K 800K" ) /* and 1200K 2000K 3000K */
197 PORT_DIPNAME( 0x20, 0x00, DEF_STR( Difficulty ) ) PORT_DIPLOCATION("SW1:6")
198 PORT_DIPSETTING( 0x00, DEF_STR( Easy ) )
199 PORT_DIPSETTING( 0x20, DEF_STR( Hard ) )
200 PORT_DIPNAME( 0x40, 0x40, DEF_STR( Demo_Sounds ) ) PORT_DIPLOCATION("SW1:7")
201 PORT_DIPSETTING( 0x00, DEF_STR( Off ) )
202 PORT_DIPSETTING( 0x40, DEF_STR( On ) )
203 PORT_DIPNAME( 0x80, 0x80, DEF_STR( Cabinet ) ) PORT_DIPLOCATION("SW1:8")
204 PORT_DIPSETTING( 0x80, DEF_STR( Upright ) )
205 PORT_DIPSETTING( 0x00, DEF_STR( Cocktail ) )
206 INPUT_PORTS_END
207
208 static INPUT_PORTS_START( combh )
209 PORT_INCLUDE( bankp )
210
211 PORT_MODIFY("IN0")
212 PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_JOYSTICK_UP ) PORT_2WAY
213 PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_UNUSED )
214 PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_JOYSTICK_DOWN ) PORT_2WAY
215 PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_UNUSED )
216
217 PORT_MODIFY("IN1")
218 PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_JOYSTICK_UP ) PORT_2WAY PORT_COCKTAIL
219 PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_UNUSED )
220 PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_JOYSTICK_DOWN ) PORT_2WAY PORT_COCKTAIL
221 PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_UNUSED )
222
223 PORT_MODIFY("DSW1")
224 PORT_DIPNAME( 0x01, 0x00, DEF_STR( Flip_Screen ) ) PORT_DIPLOCATION("SW1:1")
225 PORT_DIPSETTING( 0x00, DEF_STR( Off ) )
226 PORT_DIPSETTING( 0x01, DEF_STR( On ) )
227 PORT_DIPNAME( 0x06, 0x00, DEF_STR( Coinage ) ) PORT_DIPLOCATION("SW1:2,3")
228 PORT_DIPSETTING( 0x06, DEF_STR( 2C_1C ) )
229 PORT_DIPSETTING( 0x00, DEF_STR( 1C_1C ) )
230 PORT_DIPSETTING( 0x02, DEF_STR( 1C_2C ) )
231 PORT_DIPSETTING( 0x04, DEF_STR( 1C_3C ) )
232 PORT_DIPNAME( 0x10, 0x10, DEF_STR( Cabinet ) ) PORT_DIPLOCATION("SW1:5")
233 PORT_DIPSETTING( 0x10, DEF_STR( Upright ) )
234 PORT_DIPSETTING( 0x00, DEF_STR( Cocktail ) )
235 PORT_DIPUNUSED_DIPLOC( 0x20, IP_ACTIVE_HIGH, "SW1:6" )
236 PORT_DIPNAME( 0x40, 0x00, DEF_STR( Difficulty ) ) PORT_DIPLOCATION("SW1:7")
237 PORT_DIPSETTING( 0x00, DEF_STR( Easy ) )
238 PORT_DIPSETTING( 0x40, DEF_STR( Hard ) )
239 PORT_DIPNAME( 0x80, 0x00, "Fuel" ) PORT_DIPLOCATION("SW1:8")
240 PORT_DIPSETTING( 0x00, "120 Units" )
241 PORT_DIPSETTING( 0x80, "90 Units" )
242 INPUT_PORTS_END
243
244
245 /*************************************
246 *
247 * Graphics definitions
248 *
249 *************************************/
250
251 static const gfx_layout charlayout =
252 {
253 8,8, /* 8*8 characters */
254 1024, /* 1024 characters */
255 2, /* 2 bits per pixel */
256 { 0, 4 }, /* the bitplanes are packed in one byte */
257 { STEP4(8*8+3,-1), STEP4(0*8+3,-1) },
258 { STEP8(0*8,8) },
259 16*8 /* every char takes 8 consecutive bytes */
260 };
261 static const gfx_layout charlayout2 =
262 {
263 8,8, /* 8*8 characters */
264 2048, /* 2048 characters */
265 3, /* 3 bits per pixel */
266 { 0, 2048*8*8, 2*2048*8*8 }, /* the bitplanes are separated */
267 { STEP8(7,-1) },
268 { STEP8(0*8,8) },
269 8*8 /* every char takes 8 consecutive bytes */
270 };
271
272 static GFXDECODE_START( gfx_bankp )
273 GFXDECODE_ENTRY( "gfx1", 0, charlayout, 0, 32 )
274 GFXDECODE_ENTRY( "gfx2", 0, charlayout2, 32*4, 16 )
275 GFXDECODE_END
276
277 /*************************************
278 *
279 * Machine driver
280 *
281 *************************************/
282
machine_reset()283 void bankp_state::machine_reset()
284 {
285 m_scroll_x = 0;
286 m_priority = 0;
287 m_nmi_mask = 0;
288 }
289
INTERRUPT_GEN_MEMBER(bankp_state::vblank_irq)290 INTERRUPT_GEN_MEMBER(bankp_state::vblank_irq)
291 {
292 if(m_nmi_mask)
293 device.execute().pulse_input_line(INPUT_LINE_NMI, attotime::zero);
294 }
295
bankp(machine_config & config)296 void bankp_state::bankp(machine_config &config)
297 {
298 /* basic machine hardware */
299 Z80(config, m_maincpu, MASTER_CLOCK/6);
300 m_maincpu->set_addrmap(AS_PROGRAM, &bankp_state::bankp_map);
301 m_maincpu->set_addrmap(AS_IO, &bankp_state::bankp_io_map);
302 m_maincpu->set_vblank_int("screen", FUNC(bankp_state::vblank_irq));
303
304
305 /* video hardware */
306 screen_device &screen(SCREEN(config, "screen", SCREEN_TYPE_RASTER));
307 screen.set_raw(PIXEL_CLOCK, HTOTAL, HBEND, HBSTART, VTOTAL, VBEND, VBSTART);
308 screen.set_screen_update(FUNC(bankp_state::screen_update));
309 screen.set_palette(m_palette);
310
311 GFXDECODE(config, m_gfxdecode, m_palette, gfx_bankp);
312 PALETTE(config, m_palette, FUNC(bankp_state::bankp_palette), 32*4+16*8, 32);
313
314 /* sound hardware */
315 SPEAKER(config, "mono").front_center();
316
317 SN76489(config, "sn1", MASTER_CLOCK/6).add_route(ALL_OUTPUTS, "mono", 1.0);
318
319 SN76489(config, "sn2", MASTER_CLOCK/6).add_route(ALL_OUTPUTS, "mono", 1.0);
320
321 SN76489(config, "sn3", MASTER_CLOCK/6).add_route(ALL_OUTPUTS, "mono", 1.0);
322 }
323
324
325
326 /*************************************
327 *
328 * ROM definition(s)
329 *
330 *************************************/
331
332 ROM_START( bankp )
333 ROM_REGION( 0x10000, "maincpu", 0 )
334 ROM_LOAD( "epr-6175.7e", 0x0000, 0x4000, CRC(044552b8) SHA1(8d50ba062483d4789cfd3ed86cea53dff0ff6968) )
335 ROM_LOAD( "epr-6174.7f", 0x4000, 0x4000, CRC(d29b1598) SHA1(8c1ee4d23d8d6f93af3e22f2cba189b0055994fb) )
336 ROM_LOAD( "epr-6173.7h", 0x8000, 0x4000, CRC(b8405d38) SHA1(0f62a972f38b4ddcea77eb0e1d76c70ddbcb7b11) )
337 ROM_LOAD( "epr-6176.7d", 0xc000, 0x2000, CRC(c98ac200) SHA1(1bdb87868deebe03da18280e617530c24118da1c) )
338
339 ROM_REGION( 0x04000, "gfx1", 0 )
340 ROM_LOAD( "epr-6165.5l", 0x0000, 0x2000, CRC(aef34a93) SHA1(513895cd3144977b3d9b5ac7f2bf40384d69e157) ) /* playfield #1 chars */
341 ROM_LOAD( "epr-6166.5k", 0x2000, 0x2000, CRC(ca13cb11) SHA1(3aca0b0d3f052a742e1cd0b96bfad834e78fcd7d) )
342
343 ROM_REGION( 0x0c000, "gfx2", 0 )
344 ROM_LOAD( "epr-6172.5b", 0x0000, 0x2000, CRC(c4c4878b) SHA1(423143d81408eda96f87bdc3a306517c473cbe00) ) /* playfield #2 chars */
345 ROM_LOAD( "epr-6171.5d", 0x2000, 0x2000, CRC(a18165a1) SHA1(9a7513ea84f9231edba4e637df28a1705c8cdeb0) )
346 ROM_LOAD( "epr-6170.5e", 0x4000, 0x2000, CRC(b58aa8fa) SHA1(432b43cd9af4e3dab579cfd191b731aa11ceb121) )
347 ROM_LOAD( "epr-6169.5f", 0x6000, 0x2000, CRC(1aa37fce) SHA1(6e2402683145de8972a53c9ec01da9a422392bed) )
348 ROM_LOAD( "epr-6168.5h", 0x8000, 0x2000, CRC(05f3a867) SHA1(9da11c3cea967c5f0d7397c0ff4f87b4b1446c4c) )
349 ROM_LOAD( "epr-6167.5i", 0xa000, 0x2000, CRC(3fa337e1) SHA1(5fdc45436be27cceb5157bd6201c30e3de28fd7b) )
350
351 ROM_REGION( 0x0220, "proms", 0 )
352 ROM_LOAD( "pr-6177.8a", 0x0000, 0x020, CRC(eb70c5ae) SHA1(13613dad6c14004278f777d6f3f62712a2a85773) ) /* palette */
353 ROM_LOAD( "pr-6178.6f", 0x0020, 0x100, CRC(0acca001) SHA1(54c354d825a24a9085867b114a2cd6835baebe55) ) /* charset #1 lookup table */
354 ROM_LOAD( "pr-6179.5a", 0x0120, 0x100, CRC(e53bafdb) SHA1(7a414f6db5476dd7d0217e5b846ed931381eda02) ) /* charset #2 lookup table */
355
356 ROM_REGION( 0x025c, "user1", 0 )
357 ROM_LOAD( "315-5074.2c.bin", 0x0000, 0x025b, CRC(2e57bbba) SHA1(c3e45e8a972342779442e50872a2f5f2d61e9c0a) )
358 ROM_LOAD( "315-5073.pal16l4", 0x0000, 0x0001, NO_DUMP ) /* read protected */
359 ROM_END
360
361
362 ROM_START( combh )
363 ROM_REGION( 0x10000, "maincpu", 0 )
364 ROM_LOAD( "epr-10904.7e", 0x0000, 0x4000, CRC(4b106335) SHA1(1cdfac301b52ccd98d09b52089bb2a45fc9afdbb) )
365 ROM_LOAD( "epr-10905.7f", 0x4000, 0x4000, CRC(a76fc390) SHA1(9ffc453010ffb93db5f549e3cc1e0a4eb39ac61c) )
366 ROM_LOAD( "epr-10906.7h", 0x8000, 0x4000, CRC(16d54885) SHA1(e00fc618bb1a1f8c160fe2a0d4de6d9750313643) )
367 ROM_LOAD( "epr-10903.7d", 0xc000, 0x2000, CRC(b7a59cab) SHA1(6321fa9bdf580d76267b13fcf7dc066a45e0c926) )
368
369 ROM_REGION( 0x04000, "gfx1", 0 )
370 ROM_LOAD( "epr-10914.5l", 0x0000, 0x2000, CRC(7d7a2340) SHA1(7411131bf929eaf11e12047eea74158daf8dd274) )
371 ROM_LOAD( "epr-10913.5k", 0x2000, 0x2000, CRC(d5c1a8ae) SHA1(4f05fd183918bcc5e7b312df5a22f92756cec01d) )
372
373 ROM_REGION( 0x0c000, "gfx2", 0 )
374 ROM_LOAD( "epr-10907.5b", 0x0000, 0x2000, CRC(08e5eea3) SHA1(1ab46f9f390a4d8647b0bc07bff66f4d7f47b19e) )
375 ROM_LOAD( "epr-10908.5d", 0x2000, 0x2000, CRC(d9e413f5) SHA1(c9eb038eed97fcdb56c368f5540b372a1c7b4250) )
376 ROM_LOAD( "epr-10909.5e", 0x4000, 0x2000, CRC(fec7962c) SHA1(1e58cb19d3a80164a9968e42eea0503364dad017) )
377 ROM_LOAD( "epr-10910.5f", 0x6000, 0x2000, CRC(33db0fa7) SHA1(51f73a216d1349fd194bcc166bfbc7a39935f1bf) )
378 ROM_LOAD( "epr-10911.5h", 0x8000, 0x2000, CRC(565d9e6d) SHA1(99071eaacfc571eb55e199f2f723fe6ef109b07a) )
379 ROM_LOAD( "epr-10912.5i", 0xa000, 0x2000, CRC(cbe22738) SHA1(2dbdb593882ec66e783411f02941ce822e1c62a1) )
380
381 ROM_REGION( 0x0220, "proms", 0 )
382 ROM_LOAD( "pr-10900.8a", 0x0000, 0x020, CRC(f95fcd66) SHA1(ed7bf6691a942f344b0230310876a63a68606922) ) /* palette */
383 ROM_LOAD( "pr-10901.6f", 0x0020, 0x100, CRC(6fd981c8) SHA1(0bd2e7b72fd5e055224a675108e2e706cd6f6e5a) ) /* charset #2 lookup table */
384 ROM_LOAD( "pr-10902.5a", 0x0120, 0x100, CRC(84d6bded) SHA1(67d9c4c7d7c84eb54ec655a4cf1768ca0cbb047d) ) /* charset #1 lookup table */
385
386 ROM_REGION( 0x025c, "user1", 0 )
387 ROM_LOAD( "315-5074.2c.bin", 0x0000, 0x025b, CRC(2e57bbba) SHA1(c3e45e8a972342779442e50872a2f5f2d61e9c0a) )
388 ROM_LOAD( "315-5073.pal16l4", 0x0000, 0x0001, NO_DUMP ) /* read protected */
389 ROM_END
390
391
392 /*************************************
393 *
394 * Game driver(s)
395 *
396 *************************************/
397
398 GAME( 1984, bankp, 0, bankp, bankp, bankp_state, empty_init, ROT0, "Sanritsu / Sega", "Bank Panic", MACHINE_SUPPORTS_SAVE )
399 GAME( 1987, combh, 0, bankp, combh, bankp_state, empty_init, ROT270, "Sanritsu / Sega", "Combat Hawk", MACHINE_SUPPORTS_SAVE )
400