Previous 199869 Revisions Next

r18460 Thursday 11th October, 2012 at 19:24:09 UTC by Mariusz Wojcieszek
Improved inputs in 3X3 Puzzle [Stephh]
[src/mame/drivers]3x3puzzl.c

trunk/src/mame/drivers/3x3puzzl.c
r18459r18460
333x3 Puzzle
44Ace
55
6Driver by Mariusz Wojcieszek and David Haywood
6Driver by Mariusz Wojcieszek, David Haywood and Stephh
77
88Typical and simple Korean hardware.....
99
r18459r18460
2222has adult graphics (sets provided are 'Normal' and 'Enterprise')
2323
2424
25
26todo:
27 verify dips
28
2925***************************************************************************/
3026
3127
r18459r18460
7369
7470   int       m_oki_bank;
7571
76   DECLARE_READ16_HANDLER(_880000_r);
7772   DECLARE_WRITE16_HANDLER(gfx_ctrl_w);
7873   DECLARE_WRITE16_HANDLER(tilemap1_scrollx_w);
7974   DECLARE_WRITE16_HANDLER(tilemap1_scrolly_w);
r18459r18460
137132{
138133   // bit 5 (0x20) cleared when palette is written
139134   // bit 4 (0x10) screen width - 1: 512 pixels, 0: 320 pixels
140   // bit 3 (0x08) is set when 0x400000/0x480000 is written
135   // bit 3 (0x08) is set when tilemap scroll registers are written
141136   // bit 1 (0x02) OKI banking
142137
143138   if ( BIT(data,4) )
r18459r18460
183178   return 0;
184179}
185180
186
187READ16_MEMBER(_3x3puzzle_state::_880000_r)
188{
189   return 0xffff; // ???
190}
191
192181static ADDRESS_MAP_START( _3x3puzzle_map, AS_PROGRAM, 16, _3x3puzzle_state )
193182   AM_RANGE(0x000000, 0x03ffff) AM_ROM
194183   AM_RANGE(0x100000, 0x10ffff) AM_RAM
r18459r18460
204193   AM_RANGE(0x600000, 0x600001) AM_READ_PORT("DSW01")
205194   AM_RANGE(0x700000, 0x700001) AM_DEVREADWRITE8("oki", okim6295_device, read, write, 0x00ff)
206195   AM_RANGE(0x800000, 0x800001) AM_WRITE(gfx_ctrl_w)
207   AM_RANGE(0x880000, 0x880001) AM_READ( _880000_r )
196   AM_RANGE(0x880000, 0x880001) AM_READNOP // read, but no tested afterwards
208197ADDRESS_MAP_END
209198
210199static INPUT_PORTS_START( _3x3puzzle )
211200   PORT_START("P1")
212   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_PLAYER(1)
213   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_PLAYER(1)
214   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_PLAYER(1)
215   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_PLAYER(1)
216   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(1)
217   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_PLAYER(1) // needed for 2nd game
218   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNKNOWN )
219   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNKNOWN )
201   PORT_BIT( 0x0001, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_PLAYER(1)
202   PORT_BIT( 0x0002, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_PLAYER(1)
203   PORT_BIT( 0x0004, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_PLAYER(1)
204   PORT_BIT( 0x0008, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_PLAYER(1)
205   PORT_BIT( 0x0010, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(1)
206   PORT_BIT( 0x0020, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_PLAYER(1)
207   PORT_BIT( 0x0040, IP_ACTIVE_LOW, IPT_UNUSED )
208   PORT_BIT( 0x0080, IP_ACTIVE_LOW, IPT_UNUSED )
220209
210   PORT_BIT( 0x0100, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_PLAYER(2)
211   PORT_BIT( 0x0200, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_PLAYER(2)
212   PORT_BIT( 0x0400, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_PLAYER(2)
213   PORT_BIT( 0x0800, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_PLAYER(2)
214   PORT_BIT( 0x1000, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(2)
215   PORT_BIT( 0x2000, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_PLAYER(2)
216   PORT_BIT( 0x4000, IP_ACTIVE_LOW, IPT_UNUSED )
217   PORT_BIT( 0x8000, IP_ACTIVE_LOW, IPT_UNUSED )
218
221219   PORT_START("SYS")
222220   PORT_BIT( 0x0001, IP_ACTIVE_LOW, IPT_COIN1 )
223221   PORT_BIT( 0x0002, IP_ACTIVE_LOW, IPT_COIN2 )
224   PORT_BIT( 0x0004, IP_ACTIVE_LOW, IPT_UNKNOWN ) // must be active_low or coins won't work
222   PORT_BIT( 0x0004, IP_ACTIVE_LOW, IPT_SERVICE1 )
225223   PORT_BIT( 0x0008, IP_ACTIVE_LOW, IPT_UNKNOWN ) // must be active_low or coins won't work
226224   PORT_BIT( 0xfff0, IP_ACTIVE_LOW, IPT_UNKNOWN )
227225
r18459r18460
229227   PORT_BIT( 0xff, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_VBLANK("screen")
230228 
231229    PORT_START("DSW01")
232    PORT_DIPNAME( 0x0001, 0x0001, "DSW0:0" )
230    PORT_DIPNAME( 0x0001, 0x0001, DEF_STR( Unused ) )
233231    PORT_DIPSETTING(      0x0001, DEF_STR( Off ) )
234232    PORT_DIPSETTING(      0x0000, DEF_STR( On ) )
235    PORT_DIPNAME( 0x0002, 0x0002, "DSW0:1" )
233    PORT_DIPNAME( 0x0002, 0x0002, DEF_STR( Unused ) )
236234    PORT_DIPSETTING(      0x0002, DEF_STR( Off ) )
237235    PORT_DIPSETTING(      0x0000, DEF_STR( On ) )
238    PORT_DIPNAME( 0x0004, 0x0004, "DSW0:2" )
236    PORT_DIPNAME( 0x0004, 0x0004, DEF_STR( Unused ) )
239237    PORT_DIPSETTING(      0x0004, DEF_STR( Off ) )
240238    PORT_DIPSETTING(      0x0000, DEF_STR( On ) )
241    PORT_DIPNAME( 0x0008, 0x0008, "DSW0:3" )
239    PORT_DIPNAME( 0x0008, 0x0008, DEF_STR( Unused ) )
242240    PORT_DIPSETTING(      0x0008, DEF_STR( Off ) )
243241    PORT_DIPSETTING(      0x0000, DEF_STR( On ) )
244    PORT_DIPNAME( 0x0010, 0x0010, "DSW0:4" )
242    PORT_DIPNAME( 0x0010, 0x0010, DEF_STR( Unused ) )
245243    PORT_DIPSETTING(      0x0010, DEF_STR( Off ) )
246244    PORT_DIPSETTING(      0x0000, DEF_STR( On ) )
247    PORT_DIPNAME( 0x0020, 0x0020, "DSW0:5" )
245    PORT_DIPNAME( 0x0020, 0x0020, DEF_STR( Unused ) )
248246    PORT_DIPSETTING(      0x0020, DEF_STR( Off ) )
249247    PORT_DIPSETTING(      0x0000, DEF_STR( On ) )
250    PORT_DIPNAME( 0x0040, 0x0040, "DSW0:6" )
248    PORT_DIPNAME( 0x0040, 0x0040, DEF_STR( Unused ) )
251249    PORT_DIPSETTING(      0x0040, DEF_STR( Off ) )
252250    PORT_DIPSETTING(      0x0000, DEF_STR( On ) )
253    PORT_DIPNAME( 0x0080, 0x0080, "DSW0:7" )
251    PORT_DIPNAME( 0x0080, 0x0080, DEF_STR( Unused ) )
254252    PORT_DIPSETTING(      0x0080, DEF_STR( Off ) )
255253    PORT_DIPSETTING(      0x0000, DEF_STR( On ) )
256    PORT_DIPNAME( 0x0100, 0x0100, "DSW1:0" ) // coinage
257    PORT_DIPSETTING(      0x0100, DEF_STR( Off ) )
258    PORT_DIPSETTING(      0x0000, DEF_STR( On ) )
259    PORT_DIPNAME( 0x0200, 0x0200, "DSW1:1" ) // coinage
260    PORT_DIPSETTING(      0x0200, DEF_STR( Off ) )
261    PORT_DIPSETTING(      0x0000, DEF_STR( On ) )
254   PORT_DIPNAME( 0x0300, 0x0300, DEF_STR( Coinage ) )
255   PORT_DIPSETTING(      0x0300, DEF_STR( 1C_1C ) )
256   PORT_DIPSETTING(      0x0200, DEF_STR( 1C_2C ) )
257   PORT_DIPSETTING(      0x0100, DEF_STR( 2C_1C ) )
258   PORT_DIPSETTING(      0x0000, DEF_STR( 3C_1C ) )
262259   PORT_DIPNAME( 0x0400, 0x0000, DEF_STR( Demo_Sounds ) )
263260    PORT_DIPSETTING(      0x0400, DEF_STR( Off ) )
264261    PORT_DIPSETTING(      0x0000, DEF_STR( On ) )
265    PORT_DIPNAME( 0x0800, 0x0800, "DSW1:3" )
266    PORT_DIPSETTING(      0x0800, DEF_STR( Off ) )
267    PORT_DIPSETTING(      0x0000, DEF_STR( On ) )
268    PORT_DIPNAME( 0x1000, 0x1000, "DSW1:4" )
269    PORT_DIPSETTING(      0x1000, DEF_STR( Off ) )
270    PORT_DIPSETTING(      0x0000, DEF_STR( On ) )
271    PORT_DIPNAME( 0x2000, 0x2000, "DSW1:5" )
262   PORT_DIPNAME( 0x1800, 0x1800, DEF_STR( Difficulty ) )
263   PORT_DIPSETTING(      0x1800, DEF_STR( Normal ) )
264   PORT_DIPSETTING(      0x1000, DEF_STR( Easy ) )
265   PORT_DIPSETTING(      0x0800, DEF_STR( Easiest ) )
266   PORT_DIPSETTING(      0x0000, DEF_STR( Hard ) )
267    PORT_DIPNAME( 0x2000, 0x2000, DEF_STR( Unused ) )
272268    PORT_DIPSETTING(      0x2000, DEF_STR( Off ) )
273269    PORT_DIPSETTING(      0x0000, DEF_STR( On ) )
274    PORT_DIPNAME( 0x4000, 0x4000, "DSW1:6" )
270    PORT_DIPNAME( 0x4000, 0x4000, "Free Play / Debug mode" )
275271    PORT_DIPSETTING(      0x4000, DEF_STR( Off ) )
276272    PORT_DIPSETTING(      0x0000, DEF_STR( On ) )
277    PORT_DIPNAME( 0x8000, 0x8000, "DSW1:7" )
273    PORT_DIPNAME( 0x8000, 0x8000, DEF_STR( Unused ) )
278274    PORT_DIPSETTING(      0x8000, DEF_STR( Off ) )
279275    PORT_DIPSETTING(      0x0000, DEF_STR( On ) )
280276INPUT_PORTS_END

Previous 199869 Revisions Next


© 1997-2024 The MAME Team