1 /***************************************************************************
2
3 Notes:
4 - Several people claim that colors are wrong, but the way the color PROMs
5 are used seems correct.
6
7
8 Pooyan memory map (preliminary)
9
10 driver by Allard Van Der Bas
11
12 Thanks must go to Mike Cuddy for providing information on this one.
13
14 Sound processor memory map.
15 0x3000-0x33ff RAM.
16 AY-8910 #1 : reg 0x5000
17 wr 0x4000
18 rd 0x4000
19
20 AY-8910 #2 : reg 0x7000
21 wr 0x6000
22 rd 0x6000
23
24 Main processor memory map.
25 0000-7fff ROM
26 8000-83ff color RAM
27 8400-87ff video RAM
28 8800-8fff RAM
29 9000-97ff sprite RAM (only areas 0x9010 and 0x9410 are used).
30
31 memory mapped ports:
32
33 read:
34 0xA000 Dipswitch 2 adddbtll
35 a = attract mode
36 ddd = difficulty 0=easy, 7=hardest.
37 b = bonus setting (easy/hard)
38 t = table / upright
39 ll = lives: 11=3, 10=4, 01=5, 00=255.
40
41 0xA0E0 llllrrrr
42 l == left coin mech, r = right coinmech.
43
44 0xA080 IN0 Port
45 0xA0A0 IN1 Port
46 0xA0C0 IN2 Port
47
48 write:
49 0xA100 command for the audio CPU.
50 0xA180 NMI enable. (0xA180 == 1 = deliver NMI to CPU).
51
52 0xA181 interrupt trigger on audio CPU.
53
54 0xA183 maybe reset sound cpu?
55
56 0xA184 ????
57
58 0xA187 Flip screen
59
60 interrupts:
61 standard NMI at 0x66
62
63 ***************************************************************************/
64
65 #include "driver.h"
66 #include "vidhrdw/generic.h"
67 #include "sndhrdw/timeplt.h"
68
69
70 extern WRITE_HANDLER( pooyan_videoram_w );
71 extern WRITE_HANDLER( pooyan_colorram_w );
72 extern WRITE_HANDLER( pooyan_flipscreen_w );
73
74 extern PALETTE_INIT( pooyan );
75 extern VIDEO_START( pooyan );
76 extern VIDEO_UPDATE( pooyan );
77
78
MEMORY_READ_START(readmem)79 static MEMORY_READ_START( readmem )
80 { 0x0000, 0x7fff, MRA_ROM },
81 { 0x8000, 0x8fff, MRA_RAM }, /* color and video RAM */
82 { 0xa000, 0xa000, input_port_4_r }, /* DSW2 */
83 { 0xa080, 0xa080, input_port_0_r }, /* IN0 */
84 { 0xa0a0, 0xa0a0, input_port_1_r }, /* IN1 */
85 { 0xa0c0, 0xa0c0, input_port_2_r }, /* IN2 */
86 { 0xa0e0, 0xa0e0, input_port_3_r }, /* DSW1 */
87 MEMORY_END
88
89 static MEMORY_WRITE_START( writemem )
90 { 0x0000, 0x7fff, MWA_ROM },
91 { 0x8000, 0x83ff, pooyan_colorram_w, &colorram },
92 { 0x8400, 0x87ff, pooyan_videoram_w, &videoram },
93 { 0x8800, 0x8fff, MWA_RAM },
94 { 0x9010, 0x903f, MWA_RAM, &spriteram, &spriteram_size },
95 { 0x9410, 0x943f, MWA_RAM, &spriteram_2 },
96 { 0xa000, 0xa000, MWA_NOP }, /* watchdog reset? */
97 { 0xa100, 0xa100, soundlatch_w },
98 { 0xa180, 0xa180, interrupt_enable_w },
99 { 0xa181, 0xa181, timeplt_sh_irqtrigger_w },
100 { 0xa187, 0xa187, pooyan_flipscreen_w },
101 MEMORY_END
102
103
104 INPUT_PORTS_START( pooyan )
105 PORT_START /* IN0 */
106 PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_COIN1 )
107 PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_COIN2 )
108 PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_SERVICE1 )
109 PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_START1 )
110 PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_START2 )
111 PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_UNKNOWN )
112 PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNKNOWN )
113 PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNKNOWN )
114
115 PORT_START /* IN1 */
116 PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_UNKNOWN )
117 PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_UNKNOWN )
118 PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_JOYSTICK_UP | IPF_2WAY )
119 PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN | IPF_2WAY )
120 PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_BUTTON1 )
121 PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_UNKNOWN )
122 PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNKNOWN )
123 PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNKNOWN )
124
125 PORT_START /* IN2 */
126 PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_UNKNOWN )
127 PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_UNKNOWN )
128 PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_JOYSTICK_UP | IPF_2WAY | IPF_COCKTAIL )
129 PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN | IPF_2WAY | IPF_COCKTAIL )
130 PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_BUTTON1 | IPF_COCKTAIL )
131 PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_UNKNOWN )
132 PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNKNOWN )
133 PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNKNOWN )
134
135 PORT_START /* DSW0 */
136 PORT_DIPNAME( 0x0f, 0x0f, DEF_STR( Coin_A ) )
137 PORT_DIPSETTING( 0x02, DEF_STR( 4C_1C ) )
138 PORT_DIPSETTING( 0x05, DEF_STR( 3C_1C ) )
139 PORT_DIPSETTING( 0x08, DEF_STR( 2C_1C ) )
140 PORT_DIPSETTING( 0x04, DEF_STR( 3C_2C ) )
141 PORT_DIPSETTING( 0x01, DEF_STR( 4C_3C ) )
142 PORT_DIPSETTING( 0x0f, DEF_STR( 1C_1C ) )
143 PORT_DIPSETTING( 0x03, DEF_STR( 3C_4C ) )
144 PORT_DIPSETTING( 0x07, DEF_STR( 2C_3C ) )
145 PORT_DIPSETTING( 0x0e, DEF_STR( 1C_2C ) )
146 PORT_DIPSETTING( 0x06, DEF_STR( 2C_5C ) )
147 PORT_DIPSETTING( 0x0d, DEF_STR( 1C_3C ) )
148 PORT_DIPSETTING( 0x0c, DEF_STR( 1C_4C ) )
149 PORT_DIPSETTING( 0x0b, DEF_STR( 1C_5C ) )
150 PORT_DIPSETTING( 0x0a, DEF_STR( 1C_6C ) )
151 PORT_DIPSETTING( 0x09, DEF_STR( 1C_7C ) )
152 PORT_DIPSETTING( 0x00, DEF_STR( Free_Play ) )
153 PORT_DIPNAME( 0xf0, 0xf0, DEF_STR( Coin_B ) )
154 PORT_DIPSETTING( 0x00, "Attract Mode - No Play" )
155 PORT_DIPSETTING( 0x20, DEF_STR( 4C_1C ) )
156 PORT_DIPSETTING( 0x50, DEF_STR( 3C_1C ) )
157 PORT_DIPSETTING( 0x80, DEF_STR( 2C_1C ) )
158 PORT_DIPSETTING( 0x40, DEF_STR( 3C_2C ) )
159 PORT_DIPSETTING( 0x10, DEF_STR( 4C_3C ) )
160 PORT_DIPSETTING( 0xf0, DEF_STR( 1C_1C ) )
161 PORT_DIPSETTING( 0x30, DEF_STR( 3C_4C ) )
162 PORT_DIPSETTING( 0x70, DEF_STR( 2C_3C ) )
163 PORT_DIPSETTING( 0xe0, DEF_STR( 1C_2C ) )
164 PORT_DIPSETTING( 0x60, DEF_STR( 2C_5C ) )
165 PORT_DIPSETTING( 0xd0, DEF_STR( 1C_3C ) )
166 PORT_DIPSETTING( 0xc0, DEF_STR( 1C_4C ) )
167 PORT_DIPSETTING( 0xb0, DEF_STR( 1C_5C ) )
168 PORT_DIPSETTING( 0xa0, DEF_STR( 1C_6C ) )
169 PORT_DIPSETTING( 0x90, DEF_STR( 1C_7C ) )
170
171 PORT_START /* DSW1 */
172 PORT_DIPNAME( 0x03, 0x03, DEF_STR( Lives ) )
173 PORT_DIPSETTING( 0x03, "3" )
174 PORT_DIPSETTING( 0x02, "4" )
175 PORT_DIPSETTING( 0x01, "5" )
176 PORT_BITX( 0, 0x00, IPT_DIPSWITCH_SETTING | IPF_CHEAT, "255", IP_KEY_NONE, IP_JOY_NONE )
177 PORT_DIPNAME( 0x04, 0x00, DEF_STR( Cabinet ) )
178 PORT_DIPSETTING( 0x00, DEF_STR( Upright ) )
179 PORT_DIPSETTING( 0x04, DEF_STR( Cocktail ) )
180 PORT_DIPNAME( 0x08, 0x08, DEF_STR( Bonus_Life ) )
181 PORT_DIPSETTING( 0x08, "50000 80000" )
182 PORT_DIPSETTING( 0x00, "30000 70000" )
183 PORT_DIPNAME( 0x70, 0x70, DEF_STR( Difficulty ) )
184 PORT_DIPSETTING( 0x70, "Easiest" )
185 PORT_DIPSETTING( 0x60, "Easier" )
186 PORT_DIPSETTING( 0x50, "Easy" )
187 PORT_DIPSETTING( 0x40, "Normal" )
188 PORT_DIPSETTING( 0x30, "Medium" )
189 PORT_DIPSETTING( 0x20, "Difficult" )
190 PORT_DIPSETTING( 0x10, "Hard" )
191 PORT_DIPSETTING( 0x00, "Hardest" )
192 PORT_DIPNAME( 0x80, 0x00, DEF_STR( Demo_Sounds ) )
193 PORT_DIPSETTING( 0x80, DEF_STR( Off ) )
194 PORT_DIPSETTING( 0x00, DEF_STR( On ) )
195 INPUT_PORTS_END
196
197
198
199 static struct GfxLayout charlayout =
200 {
201 8,8, /* 8*8 characters */
202 256, /* 256 characters */
203 4, /* 4 bits per pixel */
204 { 0x1000*8+4, 0x1000*8+0, 4, 0 },
205 { 0, 1, 2, 3, 8*8+0,8*8+1,8*8+2,8*8+3 },
206 { 0*8, 1*8, 2*8, 3*8, 4*8, 5*8, 6*8, 7*8 },
207 16*8 /* every char takes 16 consecutive bytes */
208 };
209 static struct GfxLayout spritelayout =
210 {
211 16,16, /* 16*16 sprites */
212 64, /* 64 sprites */
213 4, /* 4 bits per pixel */
214 { 0x1000*8+4, 0x1000*8+0, 4, 0 },
215 { 0, 1, 2, 3, 8*8+0, 8*8+1, 8*8+2, 8*8+3,
216 16*8+0, 16*8+1, 16*8+2, 16*8+3, 24*8+0, 24*8+1, 24*8+2, 24*8+3 },
217 { 0*8, 1*8, 2*8, 3*8, 4*8, 5*8, 6*8, 7*8,
218 32*8, 33*8, 34*8, 35*8, 36*8, 37*8, 38*8, 39*8 },
219 64*8 /* every sprite takes 64 consecutive bytes */
220 };
221
222
223
224 static struct GfxDecodeInfo gfxdecodeinfo[] =
225 {
226 { REGION_GFX1, 0, &charlayout, 0, 16 },
227 { REGION_GFX2, 0, &spritelayout, 16*16, 16 },
228 { -1 } /* end of array */
229 };
230
231
232
233 static MACHINE_DRIVER_START( pooyan )
234
235 /* basic machine hardware */
236 MDRV_CPU_ADD(Z80, 3072000) /* 3.072 MHz (?) */
237 MDRV_CPU_MEMORY(readmem,writemem)
238 MDRV_CPU_VBLANK_INT(nmi_line_pulse,1)
239
240 MDRV_CPU_ADD(Z80,14318180/8)
241 MDRV_CPU_FLAGS(CPU_AUDIO_CPU) /* 1.789772727 MHz */ \
242 MDRV_CPU_MEMORY(timeplt_sound_readmem,timeplt_sound_writemem)
243
244 MDRV_FRAMES_PER_SECOND(60)
245 MDRV_VBLANK_DURATION(DEFAULT_60HZ_VBLANK_DURATION)
246
247 /* video hardware */
248 MDRV_VIDEO_ATTRIBUTES(VIDEO_TYPE_RASTER)
249 MDRV_SCREEN_SIZE(32*8, 32*8)
250 MDRV_VISIBLE_AREA(0*8, 32*8-1, 2*8, 30*8-1)
251 MDRV_GFXDECODE(gfxdecodeinfo)
252 MDRV_PALETTE_LENGTH(32)
253 MDRV_COLORTABLE_LENGTH(16*16+16*16)
254
255 MDRV_PALETTE_INIT(pooyan)
256 MDRV_VIDEO_START(pooyan)
257 MDRV_VIDEO_UPDATE(pooyan)
258
259 /* sound hardware */
260 MDRV_SOUND_ADD(AY8910, timeplt_ay8910_interface)
261 MACHINE_DRIVER_END
262
263
264
265 /***************************************************************************
266
267 Game driver(s)
268
269 ***************************************************************************/
270
271 ROM_START( pooyan )
272 ROM_REGION( 0x10000, REGION_CPU1, 0 ) /* 64k for code */
273 ROM_LOAD( "1.4a", 0x0000, 0x2000, CRC(bb319c63) SHA1(5401b8ef586127c8cf5a431e5c44e38be2254a98) )
274 ROM_LOAD( "2.5a", 0x2000, 0x2000, CRC(a1463d98) SHA1(b23cc7e61276c61a78e80fe08c7f0c8adadf2ffe) )
275 ROM_LOAD( "3.6a", 0x4000, 0x2000, CRC(fe1a9e08) SHA1(5206893760f188ac71a5e6bd42561cf25fcc3d49) )
276 ROM_LOAD( "4.7a", 0x6000, 0x2000, CRC(9e0f9bcc) SHA1(4d9707423ad531ac535db432e329b3d52cbb4559) )
277
278 ROM_REGION( 0x10000, REGION_CPU2, 0 ) /* 64k for the audio CPU */
279 ROM_LOAD( "xx.7a", 0x0000, 0x1000, CRC(fbe2b368) SHA1(5689a84ef110bdc0039ad1a6c5778e0b8eccfce0) )
280 ROM_LOAD( "xx.8a", 0x1000, 0x1000, CRC(e1795b3d) SHA1(9ab4e5362f9f7d9b46b750e14b1d9d71c57be40f) )
281
282 ROM_REGION( 0x2000, REGION_GFX1, ROMREGION_DISPOSE )
283 ROM_LOAD( "8.10g", 0x0000, 0x1000, CRC(931b29eb) SHA1(0325c1c1fdb44e0044b82b7c79b5eeabf5c11ce7) )
284 ROM_LOAD( "7.9g", 0x1000, 0x1000, CRC(bbe6d6e4) SHA1(de5447d59a99c4c08c4f40c0b7dd3c3c609c11d4) )
285
286 ROM_REGION( 0x2000, REGION_GFX2, ROMREGION_DISPOSE )
287 ROM_LOAD( "6.9a", 0x0000, 0x1000, CRC(b2d8c121) SHA1(189ad488869f34d7a38b82ef70eb805acfe04312) )
288 ROM_LOAD( "5.8a", 0x1000, 0x1000, CRC(1097c2b6) SHA1(c815f0d27593efd23923511bdd13835456ef7f76) )
289
290 ROM_REGION( 0x0220, REGION_PROMS, 0 )
291 ROM_LOAD( "pooyan.pr1", 0x0000, 0x0020, CRC(a06a6d0e) SHA1(ae131320b66d76d4bc9108da6708f6f874b2e123) ) /* palette */
292 ROM_LOAD( "pooyan.pr2", 0x0020, 0x0100, CRC(82748c0b) SHA1(9ce8eb92e482eba5a9077e9db99841d65b011346) ) /* sprites */
293 ROM_LOAD( "pooyan.pr3", 0x0120, 0x0100, CRC(8cd4cd60) SHA1(e0188ecd5b53a8e6e28c1de80def676740772334) ) /* characters */
294 ROM_END
295
296 ROM_START( pooyans )
297 ROM_REGION( 0x10000, REGION_CPU1, 0 ) /* 64k for code */
298 ROM_LOAD( "ic22_a4.cpu", 0x0000, 0x2000, CRC(916ae7d7) SHA1(e96eba381e6ad228acf4b74240d618f9d0bae39d) )
299 ROM_LOAD( "ic23_a5.cpu", 0x2000, 0x2000, CRC(8fe38c61) SHA1(4588f9f80a5884e056a1d429785c7331e92d5654) )
300 ROM_LOAD( "ic24_a6.cpu", 0x4000, 0x2000, CRC(2660218a) SHA1(606b10a4bab2432e20471440105e04d15d384570) )
301 ROM_LOAD( "ic25_a7.cpu", 0x6000, 0x2000, CRC(3d2a10ad) SHA1(962c621a19e9797b8f3d12c150aa0b90958c9498) )
302
303 ROM_REGION( 0x10000, REGION_CPU2, 0 ) /* 64k for the audio CPU */
304 ROM_LOAD( "xx.7a", 0x0000, 0x1000, CRC(fbe2b368) SHA1(5689a84ef110bdc0039ad1a6c5778e0b8eccfce0) )
305 ROM_LOAD( "xx.8a", 0x1000, 0x1000, CRC(e1795b3d) SHA1(9ab4e5362f9f7d9b46b750e14b1d9d71c57be40f) )
306
307 ROM_REGION( 0x2000, REGION_GFX1, ROMREGION_DISPOSE )
308 ROM_LOAD( "ic13_g10.cpu", 0x0000, 0x1000, CRC(7433aea9) SHA1(a5ad6311f097fefb6e7b747ebe9d01d72d7755d0) )
309 ROM_LOAD( "ic14_g9.cpu", 0x1000, 0x1000, CRC(87c1789e) SHA1(7637a9604a3ad4f9a27105d87252de3d923672aa) )
310
311 ROM_REGION( 0x2000, REGION_GFX2, ROMREGION_DISPOSE )
312 ROM_LOAD( "6.9a", 0x0000, 0x1000, CRC(b2d8c121) SHA1(189ad488869f34d7a38b82ef70eb805acfe04312) )
313 ROM_LOAD( "5.8a", 0x1000, 0x1000, CRC(1097c2b6) SHA1(c815f0d27593efd23923511bdd13835456ef7f76) )
314
315 ROM_REGION( 0x0220, REGION_PROMS, 0 )
316 ROM_LOAD( "pooyan.pr1", 0x0000, 0x0020, CRC(a06a6d0e) SHA1(ae131320b66d76d4bc9108da6708f6f874b2e123) ) /* palette */
317 ROM_LOAD( "pooyan.pr2", 0x0020, 0x0100, CRC(82748c0b) SHA1(9ce8eb92e482eba5a9077e9db99841d65b011346) ) /* sprites */
318 ROM_LOAD( "pooyan.pr3", 0x0120, 0x0100, CRC(8cd4cd60) SHA1(e0188ecd5b53a8e6e28c1de80def676740772334) ) /* characters */
319 ROM_END
320
321 ROM_START( pootan )
322 ROM_REGION( 0x10000, REGION_CPU1, 0 ) /* 64k for code */
323 ROM_LOAD( "poo_ic22.bin", 0x0000, 0x2000, CRC(41b23a24) SHA1(366efcc45613391c1ab1514654ecac1ae3d39d0e) )
324 ROM_LOAD( "poo_ic23.bin", 0x2000, 0x2000, CRC(c9d94661) SHA1(af1e818335adb4398ea0dc41be0d6399999f3946) )
325 ROM_LOAD( "3.6a", 0x4000, 0x2000, CRC(fe1a9e08) SHA1(5206893760f188ac71a5e6bd42561cf25fcc3d49) )
326 ROM_LOAD( "poo_ic25.bin", 0x6000, 0x2000, CRC(8ae459ef) SHA1(995eba204bbb82da20063b965bf79a64441a907a) )
327
328 ROM_REGION( 0x10000, REGION_CPU2, 0 ) /* 64k for the audio CPU */
329 ROM_LOAD( "xx.7a", 0x0000, 0x1000, CRC(fbe2b368) SHA1(5689a84ef110bdc0039ad1a6c5778e0b8eccfce0) )
330 ROM_LOAD( "xx.8a", 0x1000, 0x1000, CRC(e1795b3d) SHA1(9ab4e5362f9f7d9b46b750e14b1d9d71c57be40f) )
331
332 ROM_REGION( 0x2000, REGION_GFX1, ROMREGION_DISPOSE )
333 ROM_LOAD( "poo_ic13.bin", 0x0000, 0x1000, CRC(0be802e4) SHA1(07adc17bcb7332ddc00b7c71bf4919eda80b0bdb) )
334 ROM_LOAD( "poo_ic14.bin", 0x1000, 0x1000, CRC(cba29096) SHA1(b5a4cf75089cf04f7361e00074816facd57452b2) )
335
336 ROM_REGION( 0x2000, REGION_GFX2, ROMREGION_DISPOSE )
337 ROM_LOAD( "6.9a", 0x0000, 0x1000, CRC(b2d8c121) SHA1(189ad488869f34d7a38b82ef70eb805acfe04312) )
338 ROM_LOAD( "5.8a", 0x1000, 0x1000, CRC(1097c2b6) SHA1(c815f0d27593efd23923511bdd13835456ef7f76) )
339
340 ROM_REGION( 0x0220, REGION_PROMS, 0 )
341 ROM_LOAD( "pooyan.pr1", 0x0000, 0x0020, CRC(a06a6d0e) SHA1(ae131320b66d76d4bc9108da6708f6f874b2e123) ) /* palette */
342 ROM_LOAD( "pooyan.pr2", 0x0020, 0x0100, CRC(82748c0b) SHA1(9ce8eb92e482eba5a9077e9db99841d65b011346) ) /* sprites */
343 ROM_LOAD( "pooyan.pr3", 0x0120, 0x0100, CRC(8cd4cd60) SHA1(e0188ecd5b53a8e6e28c1de80def676740772334) ) /* characters */
344 ROM_END
345
346
347
348 GAME( 1982, pooyan, 0, pooyan, pooyan, 0, ROT270, "Konami", "Pooyan" )
349 GAME( 1982, pooyans, pooyan, pooyan, pooyan, 0, ROT270, "[Konami] (Stern license)", "Pooyan (Stern)" )
350 GAME( 1982, pootan, pooyan, pooyan, pooyan, 0, ROT270, "bootleg", "Pootan" )
351