Previous 15994 Revisions Next

r7523 Saturday 6th March, 2010 at 22:11:22 UTC by Fabio Priuli
[SNES] Added very preliminary driver_data class to snes. Eventually, this will lead to emulation of additional controllers in MESS.
[src/mame/drivers]nss.c snesb.c
[src/mame/includes]snes.h
[src/mame/machine]snes.c
[src/mess/drivers]snes.c

src/mame/machine/snes.c
r7522r7523
1919#include "cpu/superfx/superfx.h"
2020#include "cpu/g65816/g65816.h"
2121
22
2223/* -- Globals -- */
2324UINT8  *snes_ram = NULL;      /* 65816 ram */
2425UINT8  *spc_ram = NULL;         /* spc700 ram */
r7522r7523
3031UINT8  spc_port_in[4];   /* Port for sending data to the SPC700 */
3132UINT8  spc_port_out[4];   /* Port for receiving data from the SPC700 */
3233static UINT8 snes_hdma_chnl;   /* channels enabled for HDMA */
33static UINT8 joy1l, joy1h, joy2l, joy2h, joy3l, joy3h, joy4l, joy4h;
3434static UINT8 read_ophct = 0, read_opvct = 0;
3535static emu_timer *snes_scanline_timer;
3636static emu_timer *snes_hblank_timer;
r7522r7523
5151
5252struct snes_cart_info snes_cart;
5353
54static struct
55{
56   UINT8 low;
57   UINT8 high;
58   UINT32 value;
59   UINT8 oldrol;
60} joypad[4];
61
6254// add-on chip emulators
6355#include "machine/snesdsp1.c"
6456#include "machine/snesdsp2.c"
r7522r7523
134126
135127static TIMER_CALLBACK( snes_scanline_tick )
136128{
129   snes_state *state = (snes_state *)machine->driver_data;
130
137131   /* Increase current line - we want to latch on this line during it, not after it */
138132   snes_ppu.beam.current_vert = video_screen_get_vpos(machine->primary_screen);
139133
r7522r7523
204198   /* three lines after start of vblank we update the controllers (value from snes9x) */
205199   if (snes_ppu.beam.current_vert == snes_ppu.beam.last_visible_line + 2)
206200   {
207      int i;
208
209      joypad[0].low  = input_port_read(machine, "PAD1L");
210      joypad[0].high = input_port_read(machine, "PAD1H");
211      joypad[1].low  = input_port_read(machine, "PAD2L");
212      joypad[1].high = input_port_read(machine, "PAD2H");
213      joypad[2].low  = input_port_read(machine, "PAD3L");
214      joypad[2].high = input_port_read(machine, "PAD3H");
215      joypad[3].low  = input_port_read(machine, "PAD4L");
216      joypad[3].high = input_port_read(machine, "PAD4H");
217
218      // avoid sending signals that could crash games
219      for (i = 0; i < 4; i++)
220      {
221         // if left, no right
222         if (joypad[i].high & 2)   joypad[i].high &= ~1;
223         // if up, no down
224         if (joypad[i].high & 8)   joypad[i].high &= ~4;
225      }
226
227      // is automatic reading on?
228      if (snes_ram[NMITIMEN] & 1)
229      {
230         joy1l = joypad[0].low;
231         joy1h = joypad[0].high;
232         joy2l = joypad[1].low;
233         joy2h = joypad[1].high;
234         joy3l = joypad[2].low;
235         joy3h = joypad[2].high;
236         joy4l = joypad[3].low;
237         joy4h = joypad[3].high;
238
239         // make sure oldrol starts returning all 1s because the auto-read reads it :-)
240         joypad[0].oldrol = 16;
241         joypad[1].oldrol = 16;
242      }
243
201      state->io_read(machine);
244202      snes_ram[HVBJOY] &= 0xfe;      /* Clear busy bit */
245203   }
246204
r7522r7523
387345 */
388346READ8_HANDLER( snes_r_io )
389347{
348   snes_state *state = (snes_state *)space->machine->driver_data;
390349   UINT8 value = 0;
391350
392351   // APU is mirrored from 2140 to 217f
r7522r7523
641600               return 0 | (snes_open_bus_r(space, 0) & 0xfc); //correct?
642601            }
643602
644            if (joypad[0].oldrol >= 16)
645               value = 0x01;
646            else
647               value = ((joypad[0].low | (joypad[0].high << 8)) >> (15 - joypad[0].oldrol++)) & 0x01;
603            value = state->oldjoy1_read(space->machine);
648604
649605            return (value & 0x03) | (snes_open_bus_r(space, 0) & 0xfc); //correct?
650606         }
r7522r7523
655611               return 0 | 0x1c | (snes_open_bus_r(space, 0) & 0xe0); //correct?
656612            }
657613
658            if (joypad[1].oldrol >= 16)
659               value = 0x01;
660            else
661               value = ((joypad[1].low | (joypad[1].high << 8)) >> (15 - joypad[1].oldrol++)) & 0x01;
614            value = state->oldjoy2_read(space->machine);
662615
663616            return value | 0x1c | (snes_open_bus_r(space, 0) & 0xe0); //correct?
664617         }
r7522r7523
689642      case RDMPYH:      /* Product/Remainder of mult/div result (high) */
690643         return snes_ram[offset];
691644      case JOY1L:         /* Joypad 1 status register (low) */
692         return joy1l;
645         return state->joy1l;
693646      case JOY1H:         /* Joypad 1 status register (high) */
694         return joy1h;
647         return state->joy1h;
695648      case JOY2L:         /* Joypad 2 status register (low) */
696         return joy2l;
649         return state->joy2l;
697650      case JOY2H:         /* Joypad 2 status register (high) */
698         return joy2h;
651         return state->joy2h;
699652      case JOY3L:         /* Joypad 3 status register (low) */
700         return joy3l;
653         return state->joy3l;
701654      case JOY3H:         /* Joypad 3 status register (high) */
702         return joy3h;
655         return state->joy3h;
703656      case JOY4L:         /* Joypad 4 status register (low) */
704         return joy4l;
657         return state->joy4l;
705658      case JOY4H:         /* Joypad 4 status register (high) */
706         return joy4h;
659         return state->joy4h;
707660      case DMAP0:
708661      case DMAP1:
709662      case DMAP2:
r7522r7523
762715 */
763716WRITE8_HANDLER( snes_w_io )
764717{
718   snes_state *state = (snes_state *)space->machine->driver_data;
719
765720   // APU is mirrored from 2140 to 217f
766721   if (offset >= APU00 && offset < WMDATA)
767722   {
r7522r7523
13101265      case OLDJOY1:   /* Old NES joystick support */
13111266         if (((!(data & 0x1)) && (snes_ram[offset] & 0x1)))
13121267         {
1313            joypad[0].oldrol = 0;
1314            joypad[1].oldrol = 0;
1315            joypad[2].oldrol = 0;
1316            joypad[3].oldrol = 0;
1268            state->joypad[0].oldrol = 0;
1269            state->joypad[1].oldrol = 0;
1270            state->joypad[2].oldrol = 0;
1271            state->joypad[3].oldrol = 0;
13171272         }
13181273         break;
13191274      case NMITIMEN:   /* Flag for v-blank, timer int. and joy read */
r7522r7523
20151970
20161971/*************************************
20171972
1973    Input Callbacks
1974
1975*************************************/
1976
1977static void nss_io_read( running_machine *machine )
1978{
1979   snes_state *state = (snes_state *)machine->driver_data;
1980   int i;
1981
1982   state->joypad[0].low  = input_port_read(machine, "SERIAL1_DATA1_L");
1983   state->joypad[0].high = input_port_read(machine, "SERIAL1_DATA1_H");
1984   state->joypad[1].low  = input_port_read(machine, "SERIAL2_DATA1_L");
1985   state->joypad[1].high = input_port_read(machine, "SERIAL2_DATA1_H");
1986   state->joypad[2].low  = input_port_read(machine, "SERIAL1_DATA2_L");
1987   state->joypad[2].high = input_port_read(machine, "SERIAL1_DATA2_H");
1988   state->joypad[3].low  = input_port_read(machine, "SERIAL2_DATA2_L");
1989   state->joypad[3].high = input_port_read(machine, "SERIAL2_DATA2_H");
1990
1991   // avoid sending signals that could crash games
1992   for (i = 0; i < 4; i++)
1993   {
1994      // if left, no right
1995      if (state->joypad[i].high & 2)
1996         state->joypad[i].high &= ~1;
1997      // if up, no down
1998      if (state->joypad[i].high & 8)
1999         state->joypad[i].high &= ~4;
2000   }
2001
2002   // is automatic reading on?
2003   if (snes_ram[NMITIMEN] & 1)
2004   {
2005      state->joy1l = state->joypad[0].low;
2006      state->joy1h = state->joypad[0].high;
2007      state->joy2l = state->joypad[1].low;
2008      state->joy2h = state->joypad[1].high;
2009      state->joy3l = state->joypad[2].low;
2010      state->joy3h = state->joypad[2].high;
2011      state->joy4l = state->joypad[3].low;
2012      state->joy4h = state->joypad[3].high;
2013
2014      // make sure oldrol starts returning all 1s because the auto-read reads it :-)
2015      state->joypad[0].oldrol = 16;
2016      state->joypad[1].oldrol = 16;
2017   }
2018
2019}
2020
2021static UINT8 nss_oldjoy1_read( running_machine *machine )
2022{
2023   snes_state *state = (snes_state *)machine->driver_data;
2024   UINT8 res;
2025
2026   // joysticks
2027   if (state->joypad[0].oldrol >= 16)
2028      res = 0x01;
2029   else
2030      res = ((state->joypad[0].low | (state->joypad[0].high << 8)) >> (15 - state->joypad[0].oldrol++)) & 0x01;
2031
2032   return res;
2033}
2034
2035static UINT8 nss_oldjoy2_read( running_machine *machine )
2036{
2037   snes_state *state = (snes_state *)machine->driver_data;
2038   UINT8 res;
2039
2040   if (state->joypad[1].oldrol >= 16)
2041      res = 0x01;
2042   else
2043      res = ((state->joypad[1].low | (state->joypad[1].high << 8)) >> (15 - state->joypad[1].oldrol++)) & 0x01;
2044
2045   return res;
2046}
2047
2048/*************************************
2049
20182050    Driver Init
20192051
20202052*************************************/
r7522r7523
20442076
20452077static void snes_init_ram(running_machine *machine)
20462078{
2079   snes_state *state = (snes_state *)machine->driver_data;
20472080   const address_space *cpu0space = cputag_get_address_space(machine, "maincpu", ADDRESS_SPACE_PROGRAM);
20482081   int i, j;
20492082
r7522r7523
20752108   snes_ppu.ppu2_version = 3;   // 5C78 chip version number, read by STAT78, only '2' & '3' encountered so far.
20762109   cgram_address = 0;
20772110   vram_read_offset = 2;
2078   joy1l = joy1h = joy2l = joy2h = joy3l = joy3h = 0;
20792111
2112   state->joy1l = state->joy1h = state->joy2l = state->joy2h = state->joy3l = state->joy3h = 0;
2113   state->joypad[0].low = state->joypad[1].low = state->joypad[2].low = state->joypad[3].low = 0;
2114   state->joypad[0].high = state->joypad[1].high = state->joypad[2].high = state->joypad[3].high = 0;
2115
2116   state->io_read = nss_io_read;
2117   state->oldjoy1_read = nss_oldjoy1_read;
2118   state->oldjoy2_read = nss_oldjoy2_read;
2119
20802120   /* Inititialize mosaic table */
20812121   for (j = 0; j < 16; j++)
20822122   {
src/mame/includes/snes.h
r7522r7523
355355#define DSP_FIR_C6      0x6F
356356#define DSP_FIR_C7      0x7F
357357
358struct snes_controller_port
359{
360   UINT8 low;
361   UINT8 high;
362   UINT8 oldrol;
363};
364
365typedef void (*snes_io_read)(running_machine *machine);
366typedef UINT8 (*snes_oldjoy_read)(running_machine *machine);
367
368class snes_state
369{
370public:
371   static void *alloc(running_machine &machine) { return auto_alloc_clear(&machine, snes_state(machine)); }
372
373   snes_state(running_machine &machine) { }
374
375   /* input-related */
376   UINT8                 joy1l, joy1h, joy2l, joy2h, joy3l, joy3h, joy4l, joy4h;
377   snes_controller_port  joypad[4];
378
379   /* input callbacks (to allow MESS to have its own input handlers) */
380   snes_io_read          io_read;
381   snes_oldjoy_read      oldjoy1_read, oldjoy2_read;
382};
383
358384/* Special chips, checked at init and used in memory handlers */
359385enum
360386{
src/mame/drivers/snesb.c
r7522r7523
289289   AM_RANGE(0xffc0, 0xffff) AM_READ(spc_ipl_r)
290290ADDRESS_MAP_END
291291
292static INPUT_PORTS_START( kinstb )
293   PORT_START("PAD1L")      /* IN 0 : Joypad 1 - L */
292static INPUT_PORTS_START( snes_common )
293   PORT_START("SERIAL1_DATA1_L")
294294   PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_BUTTON3 ) PORT_NAME("P1 Button A") PORT_PLAYER(1)
295295   PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_BUTTON4 ) PORT_NAME("P1 Button X") PORT_PLAYER(1)
296296   PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_BUTTON5 ) PORT_NAME("P1 Button L") PORT_PLAYER(1)
297297   PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_BUTTON6 ) PORT_NAME("P1 Button R") PORT_PLAYER(1)
298   PORT_START("PAD1H")      /* IN 1 : Joypad 1 - H */
298   PORT_START("SERIAL1_DATA1_H")
299299   PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_BUTTON1 ) PORT_NAME("P1 Button B") PORT_PLAYER(1)
300300   PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_BUTTON2 ) PORT_NAME("P1 Button Y") PORT_PLAYER(1)
301301   PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_SERVICE1 ) PORT_NAME("P1 Select")
r7522r7523
305305   PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_JOYSTICK_LEFT ) PORT_PLAYER(1)
306306   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_JOYSTICK_RIGHT ) PORT_PLAYER(1)
307307
308   PORT_START("PAD2L")      /* IN 2 : Joypad 2 - L */
308   PORT_START("SERIAL2_DATA1_L")
309309   PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_BUTTON3 ) PORT_NAME("P2 Button A") PORT_PLAYER(2)
310310   PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_BUTTON4 ) PORT_NAME("P2 Button X") PORT_PLAYER(2)
311311   PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_BUTTON5 ) PORT_NAME("P2 Button L") PORT_PLAYER(2)
312312   PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_BUTTON6 ) PORT_NAME("P2 Button R") PORT_PLAYER(2)
313   PORT_START("PAD2H")      /* IN 3 : Joypad 2 - H */
313   PORT_START("SERIAL2_DATA1_H")
314314   PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_BUTTON1 ) PORT_NAME("P2 Button B") PORT_PLAYER(2)
315315   PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_BUTTON2 ) PORT_NAME("P2 Button Y") PORT_PLAYER(2)
316316   PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_SERVICE2 ) PORT_NAME("P2 Select")
r7522r7523
320320   PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_JOYSTICK_LEFT ) PORT_PLAYER(2)
321321   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_JOYSTICK_RIGHT ) PORT_PLAYER(2)
322322
323   PORT_START("PAD3L")      /* IN 4 : Joypad 3 - L */
324   PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_BUTTON3 ) PORT_NAME("P3 Button A") PORT_PLAYER(3)
325   PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_BUTTON4 ) PORT_NAME("P3 Button X") PORT_PLAYER(3)
326   PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_BUTTON5 ) PORT_NAME("P3 Button L") PORT_PLAYER(3)
327   PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_BUTTON6 ) PORT_NAME("P3 Button R") PORT_PLAYER(3)
328   PORT_START("PAD3H")      /* IN 5 : Joypad 3 - H */
329   PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_BUTTON1 ) PORT_NAME("P3 Button B") PORT_PLAYER(3)
330   PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_BUTTON2 ) PORT_NAME("P3 Button Y") PORT_PLAYER(3)
331   PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_SERVICE3 ) PORT_NAME("P3 Select")
332   PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_START3 ) PORT_NAME("P3 Start")
333   PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_JOYSTICK_UP ) PORT_PLAYER(3)
334   PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_JOYSTICK_DOWN ) PORT_PLAYER(3)
335   PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_JOYSTICK_LEFT ) PORT_PLAYER(3)
336   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_JOYSTICK_RIGHT ) PORT_PLAYER(3)
323   PORT_START("SERIAL1_DATA2_L")
324   PORT_BIT( 0xff, IP_ACTIVE_HIGH, IPT_UNUSED )
325   PORT_START("SERIAL1_DATA2_H")
326   PORT_BIT( 0xff, IP_ACTIVE_HIGH, IPT_UNUSED )
337327
338   PORT_START("PAD4L")      /* IN 6 : Joypad 4 - L */
339   PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_BUTTON3 ) PORT_NAME("P4 Button A") PORT_PLAYER(4)
340   PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_BUTTON4 ) PORT_NAME("P4 Button X") PORT_PLAYER(4)
341   PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_BUTTON5 ) PORT_NAME("P4 Button L") PORT_PLAYER(4)
342   PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_BUTTON6 ) PORT_NAME("P4 Button R") PORT_PLAYER(4)
343   PORT_START("PAD4H")      /* IN 7 : Joypad 4 - H */
344   PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_BUTTON1 ) PORT_NAME("P4 Button B") PORT_PLAYER(4)
345   PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_BUTTON2 ) PORT_NAME("P4 Button Y") PORT_PLAYER(4)
346   PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_SERVICE4 ) PORT_NAME("P4 Select")
347   PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_START4 ) PORT_NAME("P4 Start")
348   PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_JOYSTICK_UP ) PORT_PLAYER(4)
349   PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_JOYSTICK_DOWN ) PORT_PLAYER(4)
350   PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_JOYSTICK_LEFT ) PORT_PLAYER(4)
351   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_JOYSTICK_RIGHT ) PORT_PLAYER(4)
328   PORT_START("SERIAL2_DATA2_L")
329   PORT_BIT( 0xff, IP_ACTIVE_HIGH, IPT_UNUSED )
330   PORT_START("SERIAL2_DATA2_H")
331   PORT_BIT( 0xff, IP_ACTIVE_HIGH, IPT_UNUSED )
352332
333#ifdef SNES_LAYER_DEBUG
353334   PORT_START("INTERNAL")      /* IN 8 : Internal switches */
354   PORT_DIPNAME( 0x1, 0x1, "Enforce 32 sprites/line" )
355   PORT_DIPSETTING(   0x0, DEF_STR( No )  )
356   PORT_DIPSETTING(   0x1, DEF_STR( Yes ) )
335   PORT_CONFNAME( 0x1, 0x1, "Enforce 32 sprites/line" )
336   PORT_CONFSETTING(   0x0, DEF_STR( No )  )
337   PORT_CONFSETTING(   0x1, DEF_STR( Yes ) )
357338
358#ifdef SNES_LAYER_DEBUG
359339   PORT_START("DEBUG1")   /* IN 9 : debug switches */
360   PORT_DIPNAME( 0x3, 0x0, "Browse tiles" )
361   PORT_DIPSETTING(   0x0, DEF_STR( Off ) )
362   PORT_DIPSETTING(   0x1, "2bpl"  )
363   PORT_DIPSETTING(   0x2, "4bpl"  )
364   PORT_DIPSETTING(   0x3, "8bpl"  )
365   PORT_DIPNAME( 0xc, 0x0, "Browse maps" )
366   PORT_DIPSETTING(   0x0, DEF_STR( Off ) )
367   PORT_DIPSETTING(   0x4, "2bpl"  )
368   PORT_DIPSETTING(   0x8, "4bpl"  )
369   PORT_DIPSETTING(   0xc, "8bpl"  )
340   PORT_CONFNAME( 0x3, 0x0, "Browse tiles" )
341   PORT_CONFSETTING(   0x0, DEF_STR( Off ) )
342   PORT_CONFSETTING(   0x1, "2bpl"  )
343   PORT_CONFSETTING(   0x2, "4bpl"  )
344   PORT_CONFSETTING(   0x3, "8bpl"  )
345   PORT_CONFNAME( 0xc, 0x0, "Browse maps" )
346   PORT_CONFSETTING(   0x0, DEF_STR( Off ) )
347   PORT_CONFSETTING(   0x4, "2bpl"  )
348   PORT_CONFSETTING(   0x8, "4bpl"  )
349   PORT_CONFSETTING(   0xc, "8bpl"  )
370350
371351   PORT_START("DEBUG2")   /* IN 10 : debug switches */
372352   PORT_BIT( 0x1, IP_ACTIVE_HIGH, IPT_BUTTON7 ) PORT_NAME("Toggle BG 1") PORT_PLAYER(2)
r7522r7523
383363   PORT_BIT( 0x2, IP_ACTIVE_HIGH, IPT_BUTTON10 ) PORT_NAME("Pal next")
384364   PORT_BIT( 0x4, IP_ACTIVE_HIGH, IPT_BUTTON7 ) PORT_NAME("Toggle Transparency") PORT_PLAYER(4)
385365#endif
366INPUT_PORTS_END
386367
387   PORT_START("DSW")   /* IN 12 : dip-switches */
388368
389   PORT_START("COIN")   /* IN 13 : coins */
369static INPUT_PORTS_START( kinstb )
370   PORT_INCLUDE(snes_common)
371
372   PORT_START("DSW")
373
374   PORT_START("COIN")
390375   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_COIN1 )
391376   PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_COIN2 )
392377
r7522r7523
394379
395380
396381static INPUT_PORTS_START( ffight2b )
397   PORT_START("PAD1L")      /* IN 0 : Joypad 1 - L */
398   PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_BUTTON3 ) PORT_NAME("P1 Button A") PORT_PLAYER(1)
399   PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_BUTTON4 ) PORT_NAME("P1 Button X") PORT_PLAYER(1)
400   PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_BUTTON5 ) PORT_NAME("P1 Button L") PORT_PLAYER(1)
401   PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_BUTTON6 ) PORT_NAME("P1 Button R") PORT_PLAYER(1)
402   PORT_START("PAD1H")      /* IN 1 : Joypad 1 - H */
403   PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_BUTTON1 ) PORT_NAME("P1 Button B") PORT_PLAYER(1)
404   PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_BUTTON2 ) PORT_NAME("P1 Button Y") PORT_PLAYER(1)
405   PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_SERVICE1 ) PORT_NAME("P1 Select")
406   PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_START1 ) PORT_NAME("P1 Start")
407   PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_JOYSTICK_UP ) PORT_PLAYER(1)
408   PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_JOYSTICK_DOWN ) PORT_PLAYER(1)
409   PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_JOYSTICK_LEFT ) PORT_PLAYER(1)
410   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_JOYSTICK_RIGHT ) PORT_PLAYER(1)
382   PORT_INCLUDE(snes_common)
411383
412   PORT_START("PAD2L")      /* IN 2 : Joypad 2 - L */
413   PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_BUTTON3 ) PORT_NAME("P2 Button A") PORT_PLAYER(2)
414   PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_BUTTON4 ) PORT_NAME("P2 Button X") PORT_PLAYER(2)
415   PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_BUTTON5 ) PORT_NAME("P2 Button L") PORT_PLAYER(2)
416   PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_BUTTON6 ) PORT_NAME("P2 Button R") PORT_PLAYER(2)
417   PORT_START("PAD2H")      /* IN 3 : Joypad 2 - H */
418   PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_BUTTON1 ) PORT_NAME("P2 Button B") PORT_PLAYER(2)
419   PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_BUTTON2 ) PORT_NAME("P2 Button Y") PORT_PLAYER(2)
420   PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_SERVICE2 ) PORT_NAME("P2 Select")
421   PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_START2 ) PORT_NAME("P2 Start")
422   PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_JOYSTICK_UP ) PORT_PLAYER(2)
423   PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_JOYSTICK_DOWN ) PORT_PLAYER(2)
424   PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_JOYSTICK_LEFT ) PORT_PLAYER(2)
425   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_JOYSTICK_RIGHT ) PORT_PLAYER(2)
426
427   PORT_START("PAD3L")      /* IN 4 : Joypad 3 - L */
428   PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_BUTTON3 ) PORT_NAME("P3 Button A") PORT_PLAYER(3)
429   PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_BUTTON4 ) PORT_NAME("P3 Button X") PORT_PLAYER(3)
430   PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_BUTTON5 ) PORT_NAME("P3 Button L") PORT_PLAYER(3)
431   PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_BUTTON6 ) PORT_NAME("P3 Button R") PORT_PLAYER(3)
432   PORT_START("PAD3H")      /* IN 5 : Joypad 3 - H */
433   PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_BUTTON1 ) PORT_NAME("P3 Button B") PORT_PLAYER(3)
434   PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_BUTTON2 ) PORT_NAME("P3 Button Y") PORT_PLAYER(3)
435   PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_SERVICE3 ) PORT_NAME("P3 Select")
436   PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_START3 ) PORT_NAME("P3 Start")
437   PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_JOYSTICK_UP ) PORT_PLAYER(3)
438   PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_JOYSTICK_DOWN ) PORT_PLAYER(3)
439   PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_JOYSTICK_LEFT ) PORT_PLAYER(3)
440   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_JOYSTICK_RIGHT ) PORT_PLAYER(3)
441
442   PORT_START("PAD4L")      /* IN 6 : Joypad 4 - L */
443   PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_BUTTON3 ) PORT_NAME("P4 Button A") PORT_PLAYER(4)
444   PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_BUTTON4 ) PORT_NAME("P4 Button X") PORT_PLAYER(4)
445   PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_BUTTON5 ) PORT_NAME("P4 Button L") PORT_PLAYER(4)
446   PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_BUTTON6 ) PORT_NAME("P4 Button R") PORT_PLAYER(4)
447   PORT_START("PAD4H")      /* IN 7 : Joypad 4 - H */
448   PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_BUTTON1 ) PORT_NAME("P4 Button B") PORT_PLAYER(4)
449   PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_BUTTON2 ) PORT_NAME("P4 Button Y") PORT_PLAYER(4)
450   PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_SERVICE4 ) PORT_NAME("P4 Select")
451   PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_START4 ) PORT_NAME("P4 Start")
452   PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_JOYSTICK_UP ) PORT_PLAYER(4)
453   PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_JOYSTICK_DOWN ) PORT_PLAYER(4)
454   PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_JOYSTICK_LEFT ) PORT_PLAYER(4)
455   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_JOYSTICK_RIGHT ) PORT_PLAYER(4)
456
457   PORT_START("INTERNAL")      /* IN 8 : Internal switches */
458   PORT_DIPNAME( 0x1, 0x1, "Enforce 32 sprites/line" )
459   PORT_DIPSETTING(   0x0, DEF_STR( No )  )
460   PORT_DIPSETTING(   0x1, DEF_STR( Yes ) )
461
462#ifdef SNES_LAYER_DEBUG
463   PORT_START("DEBUG1")   /* IN 9 : debug switches */
464   PORT_DIPNAME( 0x3, 0x0, "Browse tiles" )
465   PORT_DIPSETTING(   0x0, DEF_STR( Off ) )
466   PORT_DIPSETTING(   0x1, "2bpl"  )
467   PORT_DIPSETTING(   0x2, "4bpl"  )
468   PORT_DIPSETTING(   0x3, "8bpl"  )
469   PORT_DIPNAME( 0xc, 0x0, "Browse maps" )
470   PORT_DIPSETTING(   0x0, DEF_STR( Off ) )
471   PORT_DIPSETTING(   0x4, "2bpl"  )
472   PORT_DIPSETTING(   0x8, "4bpl"  )
473   PORT_DIPSETTING(   0xc, "8bpl"  )
474
475   PORT_START("DEBUG2")   /* IN 10 : debug switches */
476   PORT_BIT( 0x1, IP_ACTIVE_HIGH, IPT_BUTTON7 ) PORT_NAME("Toggle BG 1") PORT_PLAYER(2)
477   PORT_BIT( 0x2, IP_ACTIVE_HIGH, IPT_BUTTON8 ) PORT_NAME("Toggle BG 2") PORT_PLAYER(2)
478   PORT_BIT( 0x4, IP_ACTIVE_HIGH, IPT_BUTTON9 ) PORT_NAME("Toggle BG 3") PORT_PLAYER(2)
479   PORT_BIT( 0x8, IP_ACTIVE_HIGH, IPT_BUTTON10 ) PORT_NAME("Toggle BG 4") PORT_PLAYER(2)
480   PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_BUTTON7 ) PORT_NAME("Toggle Objects") PORT_PLAYER(3)
481   PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_BUTTON8 ) PORT_NAME("Toggle Main/Sub") PORT_PLAYER(3)
482   PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_BUTTON9 ) PORT_NAME("Toggle Back col") PORT_PLAYER(3)
483   PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_BUTTON10 ) PORT_NAME("Toggle Windows") PORT_PLAYER(3)
484
485   PORT_START("DEBUG3")   /* IN 11 : debug input */
486   PORT_BIT( 0x1, IP_ACTIVE_HIGH, IPT_BUTTON9 ) PORT_NAME("Pal prev")
487   PORT_BIT( 0x2, IP_ACTIVE_HIGH, IPT_BUTTON10 ) PORT_NAME("Pal next")
488   PORT_BIT( 0x4, IP_ACTIVE_HIGH, IPT_BUTTON7 ) PORT_NAME("Toggle Transparency") PORT_PLAYER(4)
489#endif
490
491   PORT_START("DSW")   /* IN 12 : dip-switches */
384   PORT_START("DSW")
492385   PORT_DIPNAME( 0x01, 0x01, "Player Bonus" ) PORT_DIPLOCATION("SW1:1")
493386   PORT_DIPSETTING(    0x01, DEF_STR( No ) )
494387   PORT_DIPSETTING(    0x00, DEF_STR( Yes ) )
r7522r7523
507400   PORT_DIPSETTING(    0x40, DEF_STR( 3C_1C ) )
508401   PORT_DIPSETTING(    0x60, DEF_STR( 2C_1C ) )
509402   PORT_DIPSETTING(    0x00, DEF_STR( 1C_1C ) )
510/*  PORT_DIPSETTING(    0xe0, DEF_STR( 1C_1C ) ) */
403   /*  PORT_DIPSETTING(    0xe0, DEF_STR( 1C_1C ) ) */
511404   PORT_DIPSETTING(    0xc0, DEF_STR( 1C_2C ) )
512405   PORT_DIPSETTING(    0xa0, DEF_STR( 1C_3C ) )
513406   PORT_DIPSETTING(    0x80, DEF_STR( 1C_4C ) )
514407
515   PORT_START("COIN")   /* IN 13 : coins */
408   PORT_START("COIN")
516409   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_COIN1 )
517410   PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_COIN2 )
518
519411INPUT_PORTS_END
520412
521413
522414static INPUT_PORTS_START( sblast2b )
523   PORT_START("PAD1L")      /* IN 0 : Joypad 1 - L */
524   PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_BUTTON3 ) PORT_NAME("P1 Button A") PORT_PLAYER(1)
525   PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_BUTTON4 ) PORT_NAME("P1 Button X") PORT_PLAYER(1)
526   PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_BUTTON5 ) PORT_NAME("P1 Button L") PORT_PLAYER(1)
527   PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_BUTTON6 ) PORT_NAME("P1 Button R") PORT_PLAYER(1)
528   PORT_START("PAD1H")      /* IN 1 : Joypad 1 - H */
529   PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_BUTTON1 ) PORT_NAME("P1 Button B") PORT_PLAYER(1)
530   PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_BUTTON2 ) PORT_NAME("P1 Button Y") PORT_PLAYER(1)
531   PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_SERVICE1 ) PORT_NAME("P1 Select")
532   PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_START1 ) PORT_NAME("P1 Start")
533   PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_JOYSTICK_UP ) PORT_PLAYER(1)
534   PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_JOYSTICK_DOWN ) PORT_PLAYER(1)
535   PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_JOYSTICK_LEFT ) PORT_PLAYER(1)
536   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_JOYSTICK_RIGHT ) PORT_PLAYER(1)
415   PORT_INCLUDE(snes_common)
537416
538   PORT_START("PAD2L")      /* IN 2 : Joypad 2 - L */
539   PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_BUTTON3 ) PORT_NAME("P2 Button A") PORT_PLAYER(2)
540   PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_BUTTON4 ) PORT_NAME("P2 Button X") PORT_PLAYER(2)
541   PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_BUTTON5 ) PORT_NAME("P2 Button L") PORT_PLAYER(2)
542   PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_BUTTON6 ) PORT_NAME("P2 Button R") PORT_PLAYER(2)
543   PORT_START("PAD2H")      /* IN 3 : Joypad 2 - H */
544   PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_BUTTON1 ) PORT_NAME("P2 Button B") PORT_PLAYER(2)
545   PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_BUTTON2 ) PORT_NAME("P2 Button Y") PORT_PLAYER(2)
546   PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_SERVICE2 ) PORT_NAME("P2 Select")
547   PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_START2 ) PORT_NAME("P2 Start")
548   PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_JOYSTICK_UP ) PORT_PLAYER(2)
549   PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_JOYSTICK_DOWN ) PORT_PLAYER(2)
550   PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_JOYSTICK_LEFT ) PORT_PLAYER(2)
551   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_JOYSTICK_RIGHT ) PORT_PLAYER(2)
552
553   PORT_START("PAD3L")      /* IN 4 : Joypad 3 - L */
554   PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_BUTTON3 ) PORT_NAME("P3 Button A") PORT_PLAYER(3)
555   PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_BUTTON4 ) PORT_NAME("P3 Button X") PORT_PLAYER(3)
556   PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_BUTTON5 ) PORT_NAME("P3 Button L") PORT_PLAYER(3)
557   PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_BUTTON6 ) PORT_NAME("P3 Button R") PORT_PLAYER(3)
558   PORT_START("PAD3H")      /* IN 5 : Joypad 3 - H */
559   PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_BUTTON1 ) PORT_NAME("P3 Button B") PORT_PLAYER(3)
560   PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_BUTTON2 ) PORT_NAME("P3 Button Y") PORT_PLAYER(3)
561   PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_SERVICE3 ) PORT_NAME("P3 Select")
562   PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_START3 ) PORT_NAME("P3 Start")
563   PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_JOYSTICK_UP ) PORT_PLAYER(3)
564   PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_JOYSTICK_DOWN ) PORT_PLAYER(3)
565   PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_JOYSTICK_LEFT ) PORT_PLAYER(3)
566   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_JOYSTICK_RIGHT ) PORT_PLAYER(3)
567
568   PORT_START("PAD4L")      /* IN 6 : Joypad 4 - L */
569   PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_BUTTON3 ) PORT_NAME("P4 Button A") PORT_PLAYER(4)
570   PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_BUTTON4 ) PORT_NAME("P4 Button X") PORT_PLAYER(4)
571   PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_BUTTON5 ) PORT_NAME("P4 Button L") PORT_PLAYER(4)
572   PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_BUTTON6 ) PORT_NAME("P4 Button R") PORT_PLAYER(4)
573   PORT_START("PAD4H")      /* IN 7 : Joypad 4 - H */
574   PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_BUTTON1 ) PORT_NAME("P4 Button B") PORT_PLAYER(4)
575   PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_BUTTON2 ) PORT_NAME("P4 Button Y") PORT_PLAYER(4)
576   PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_SERVICE4 ) PORT_NAME("P4 Select")
577   PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_START4 ) PORT_NAME("P4 Start")
578   PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_JOYSTICK_UP ) PORT_PLAYER(4)
579   PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_JOYSTICK_DOWN ) PORT_PLAYER(4)
580   PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_JOYSTICK_LEFT ) PORT_PLAYER(4)
581   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_JOYSTICK_RIGHT ) PORT_PLAYER(4)
582
583   PORT_START("INTERNAL")      /* IN 8 : Internal switches */
584   PORT_DIPNAME( 0x1, 0x1, "Enforce 32 sprites/line" )
585   PORT_DIPSETTING(   0x0, DEF_STR( No )  )
586   PORT_DIPSETTING(   0x1, DEF_STR( Yes ) )
587
588#ifdef SNES_LAYER_DEBUG
589   PORT_START("DEBUG1")   /* IN 9 : debug switches */
590   PORT_DIPNAME( 0x3, 0x0, "Browse tiles" )
591   PORT_DIPSETTING(   0x0, DEF_STR( Off ) )
592   PORT_DIPSETTING(   0x1, "2bpl"  )
593   PORT_DIPSETTING(   0x2, "4bpl"  )
594   PORT_DIPSETTING(   0x3, "8bpl"  )
595   PORT_DIPNAME( 0xc, 0x0, "Browse maps" )
596   PORT_DIPSETTING(   0x0, DEF_STR( Off ) )
597   PORT_DIPSETTING(   0x4, "2bpl"  )
598   PORT_DIPSETTING(   0x8, "4bpl"  )
599   PORT_DIPSETTING(   0xc, "8bpl"  )
600
601   PORT_START("DEBUG2")   /* IN 10 : debug switches */
602   PORT_BIT( 0x1, IP_ACTIVE_HIGH, IPT_BUTTON7 ) PORT_NAME("Toggle BG 1") PORT_PLAYER(2)
603   PORT_BIT( 0x2, IP_ACTIVE_HIGH, IPT_BUTTON8 ) PORT_NAME("Toggle BG 2") PORT_PLAYER(2)
604   PORT_BIT( 0x4, IP_ACTIVE_HIGH, IPT_BUTTON9 ) PORT_NAME("Toggle BG 3") PORT_PLAYER(2)
605   PORT_BIT( 0x8, IP_ACTIVE_HIGH, IPT_BUTTON10 ) PORT_NAME("Toggle BG 4") PORT_PLAYER(2)
606   PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_BUTTON7 ) PORT_NAME("Toggle Objects") PORT_PLAYER(3)
607   PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_BUTTON8 ) PORT_NAME("Toggle Main/Sub") PORT_PLAYER(3)
608   PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_BUTTON9 ) PORT_NAME("Toggle Back col") PORT_PLAYER(3)
609   PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_BUTTON10 ) PORT_NAME("Toggle Windows") PORT_PLAYER(3)
610
611   PORT_START("DEBUG3")   /* IN 11 : debug input */
612   PORT_BIT( 0x1, IP_ACTIVE_HIGH, IPT_BUTTON9 ) PORT_NAME("Pal prev")
613   PORT_BIT( 0x2, IP_ACTIVE_HIGH, IPT_BUTTON10 ) PORT_NAME("Pal next")
614   PORT_BIT( 0x4, IP_ACTIVE_HIGH, IPT_BUTTON7 ) PORT_NAME("Toggle Transparency") PORT_PLAYER(4)
615#endif
616
617   PORT_START("DSW")   /* IN 12 : dip-switches */
417   PORT_START("DSW")
618418   PORT_DIPUNKNOWN_DIPLOC( 0x01, 0x01, "SW1:1" )
619419   PORT_DIPUNKNOWN_DIPLOC( 0x02, 0x02, "SW1:2" )
620420   PORT_DIPUNKNOWN_DIPLOC( 0x04, 0x04, "SW1:3" )
r7522r7523
624424   PORT_DIPUNKNOWN_DIPLOC( 0x40, 0x40, "SW1:7" )
625425   PORT_DIPUNKNOWN_DIPLOC( 0x80, 0x80, "SW1:8" )
626426
627   PORT_START("COIN")   /* IN 13 : coins */
427   PORT_START("COIN")
628428   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_COIN1 )
629429   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_COIN2 )
630430
r7522r7523
632432
633433
634434static INPUT_PORTS_START( iron )
635   PORT_START("PAD1L")      /* IN 0 : Joypad 1 - L */
636   PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_BUTTON3 ) PORT_NAME("P1 Button A") PORT_PLAYER(1)
637   PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_BUTTON4 ) PORT_NAME("P1 Button X") PORT_PLAYER(1)
638   PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_BUTTON5 ) PORT_NAME("P1 Button L") PORT_PLAYER(1)
639   PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_BUTTON6 ) PORT_NAME("P1 Button R") PORT_PLAYER(1)
640   PORT_START("PAD1H")      /* IN 1 : Joypad 1 - H */
641   PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_BUTTON1 ) PORT_NAME("P1 Button B") PORT_PLAYER(1)
642   PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_BUTTON2 ) PORT_NAME("P1 Button Y") PORT_PLAYER(1)
643   PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_SERVICE1 ) PORT_NAME("P1 Select")
644   PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_START1 ) PORT_NAME("P1 Start")
645   PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_JOYSTICK_UP ) PORT_PLAYER(1)
646   PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_JOYSTICK_DOWN ) PORT_PLAYER(1)
647   PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_JOYSTICK_LEFT ) PORT_PLAYER(1)
648   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_JOYSTICK_RIGHT ) PORT_PLAYER(1)
435   PORT_INCLUDE(snes_common)
649436
650   PORT_START("PAD2L")      /* IN 2 : Joypad 2 - L */
651   PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_BUTTON3 ) PORT_NAME("P2 Button A") PORT_PLAYER(2)
652   PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_BUTTON4 ) PORT_NAME("P2 Button X") PORT_PLAYER(2)
653   PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_BUTTON5 ) PORT_NAME("P2 Button L") PORT_PLAYER(2)
654   PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_BUTTON6 ) PORT_NAME("P2 Button R") PORT_PLAYER(2)
655   PORT_START("PAD2H")      /* IN 3 : Joypad 2 - H */
656   PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_BUTTON1 ) PORT_NAME("P2 Button B") PORT_PLAYER(2)
657   PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_BUTTON2 ) PORT_NAME("P2 Button Y") PORT_PLAYER(2)
658   PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_SERVICE2 ) PORT_NAME("P2 Select")
659   PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_START2 ) PORT_NAME("P2 Start")
660   PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_JOYSTICK_UP ) PORT_PLAYER(2)
661   PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_JOYSTICK_DOWN ) PORT_PLAYER(2)
662   PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_JOYSTICK_LEFT ) PORT_PLAYER(2)
663   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_JOYSTICK_RIGHT ) PORT_PLAYER(2)
664
665   PORT_START("PAD3L")      /* IN 4 : Joypad 3 - L */
666   PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_BUTTON3 ) PORT_NAME("P3 Button A") PORT_PLAYER(3)
667   PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_BUTTON4 ) PORT_NAME("P3 Button X") PORT_PLAYER(3)
668   PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_BUTTON5 ) PORT_NAME("P3 Button L") PORT_PLAYER(3)
669   PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_BUTTON6 ) PORT_NAME("P3 Button R") PORT_PLAYER(3)
670   PORT_START("PAD3H")      /* IN 5 : Joypad 3 - H */
671   PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_BUTTON1 ) PORT_NAME("P3 Button B") PORT_PLAYER(3)
672   PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_BUTTON2 ) PORT_NAME("P3 Button Y") PORT_PLAYER(3)
673   PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_SERVICE3 ) PORT_NAME("P3 Select")
674   PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_START3 ) PORT_NAME("P3 Start")
675   PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_JOYSTICK_UP ) PORT_PLAYER(3)
676   PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_JOYSTICK_DOWN ) PORT_PLAYER(3)
677   PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_JOYSTICK_LEFT ) PORT_PLAYER(3)
678   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_JOYSTICK_RIGHT ) PORT_PLAYER(3)
679
680   PORT_START("PAD4L")      /* IN 6 : Joypad 4 - L */
681   PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_BUTTON3 ) PORT_NAME("P4 Button A") PORT_PLAYER(4)
682   PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_BUTTON4 ) PORT_NAME("P4 Button X") PORT_PLAYER(4)
683   PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_BUTTON5 ) PORT_NAME("P4 Button L") PORT_PLAYER(4)
684   PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_BUTTON6 ) PORT_NAME("P4 Button R") PORT_PLAYER(4)
685   PORT_START("PAD4H")      /* IN 7 : Joypad 4 - H */
686   PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_BUTTON1 ) PORT_NAME("P4 Button B") PORT_PLAYER(4)
687   PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_BUTTON2 ) PORT_NAME("P4 Button Y") PORT_PLAYER(4)
688   PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_SERVICE4 ) PORT_NAME("P4 Select")
689   PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_START4 ) PORT_NAME("P4 Start")
690   PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_JOYSTICK_UP ) PORT_PLAYER(4)
691   PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_JOYSTICK_DOWN ) PORT_PLAYER(4)
692   PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_JOYSTICK_LEFT ) PORT_PLAYER(4)
693   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_JOYSTICK_RIGHT ) PORT_PLAYER(4)
694
695   PORT_START("INTERNAL")      /* IN 8 : Internal switches */
696   PORT_DIPNAME( 0x1, 0x1, "Enforce 32 sprites/line" )
697   PORT_DIPSETTING(   0x0, DEF_STR( No )  )
698   PORT_DIPSETTING(   0x1, DEF_STR( Yes ) )
699
700#ifdef SNES_LAYER_DEBUG
701   PORT_START("DEBUG1")   /* IN 9 : debug switches */
702   PORT_DIPNAME( 0x3, 0x0, "Browse tiles" )
703   PORT_DIPSETTING(   0x0, DEF_STR( Off ) )
704   PORT_DIPSETTING(   0x1, "2bpl"  )
705   PORT_DIPSETTING(   0x2, "4bpl"  )
706   PORT_DIPSETTING(   0x3, "8bpl"  )
707   PORT_DIPNAME( 0xc, 0x0, "Browse maps" )
708   PORT_DIPSETTING(   0x0, DEF_STR( Off ) )
709   PORT_DIPSETTING(   0x4, "2bpl"  )
710   PORT_DIPSETTING(   0x8, "4bpl"  )
711   PORT_DIPSETTING(   0xc, "8bpl"  )
712
713   PORT_START("DEBUG2")   /* IN 10 : debug switches */
714   PORT_BIT( 0x1, IP_ACTIVE_HIGH, IPT_BUTTON7 ) PORT_NAME("Toggle BG 1") PORT_PLAYER(2)
715   PORT_BIT( 0x2, IP_ACTIVE_HIGH, IPT_BUTTON8 ) PORT_NAME("Toggle BG 2") PORT_PLAYER(2)
716   PORT_BIT( 0x4, IP_ACTIVE_HIGH, IPT_BUTTON9 ) PORT_NAME("Toggle BG 3") PORT_PLAYER(2)
717   PORT_BIT( 0x8, IP_ACTIVE_HIGH, IPT_BUTTON10 ) PORT_NAME("Toggle BG 4") PORT_PLAYER(2)
718   PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_BUTTON7 ) PORT_NAME("Toggle Objects") PORT_PLAYER(3)
719   PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_BUTTON8 ) PORT_NAME("Toggle Main/Sub") PORT_PLAYER(3)
720   PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_BUTTON9 ) PORT_NAME("Toggle Back col") PORT_PLAYER(3)
721   PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_BUTTON10 ) PORT_NAME("Toggle Windows") PORT_PLAYER(3)
722
723   PORT_START("DEBUG3")   /* IN 11 : debug input */
724   PORT_BIT( 0x1, IP_ACTIVE_HIGH, IPT_BUTTON9 ) PORT_NAME("Pal prev")
725   PORT_BIT( 0x2, IP_ACTIVE_HIGH, IPT_BUTTON10 ) PORT_NAME("Pal next")
726   PORT_BIT( 0x4, IP_ACTIVE_HIGH, IPT_BUTTON7 ) PORT_NAME("Toggle Transparency") PORT_PLAYER(4)
727#endif
728
729   PORT_START("DSW1")   /* IN 12 : dip-switches */
437   PORT_START("DSW1")
730438   PORT_DIPUNKNOWN_DIPLOC( 0x01, 0x01, "SW1:1" )
731439   PORT_DIPUNKNOWN_DIPLOC( 0x02, 0x02, "SW1:2" )
732440   PORT_DIPUNKNOWN_DIPLOC( 0x04, 0x04, "SW1:3" )
r7522r7523
736444   PORT_DIPUNKNOWN_DIPLOC( 0x40, 0x40, "SW1:7" )
737445   PORT_DIPUNKNOWN_DIPLOC( 0x80, 0x80, "SW1:8" )
738446
739   PORT_START("DSW2")   /* IN 13 : dip-switches */
447   PORT_START("DSW2")
740448   PORT_DIPUNKNOWN_DIPLOC( 0x01, 0x01, "SW2:1" )
741449   PORT_DIPUNKNOWN_DIPLOC( 0x02, 0x02, "SW2:2" )
742450   PORT_DIPUNKNOWN_DIPLOC( 0x04, 0x04, "SW2:3" )
r7522r7523
746454   PORT_DIPUNKNOWN_DIPLOC( 0x40, 0x40, "SW2:7" )
747455   PORT_DIPUNKNOWN_DIPLOC( 0x80, 0x80, "SW2:8" )
748456
749   PORT_START("COIN")   /* IN 14 : coins */
457   PORT_START("COIN")
750458   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_COIN1 )
751459   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_COIN2 )
752
753460INPUT_PORTS_END
754461
755462static INPUT_PORTS_START( denseib )
756   PORT_START("PAD1L")      /* IN 0 : Joypad 1 - L */
757   PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_BUTTON3 ) PORT_NAME("P1 Button A") PORT_PLAYER(1)
758   PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_BUTTON4 ) PORT_NAME("P1 Button X") PORT_PLAYER(1)
759   PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_BUTTON5 ) PORT_NAME("P1 Button L") PORT_PLAYER(1)
760   PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_BUTTON6 ) PORT_NAME("P1 Button R") PORT_PLAYER(1)
761   PORT_START("PAD1H")      /* IN 1 : Joypad 1 - H */
762   PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_BUTTON1 ) PORT_NAME("P1 Button B") PORT_PLAYER(1)
763   PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_BUTTON2 ) PORT_NAME("P1 Button Y") PORT_PLAYER(1)
764   PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_SERVICE1 ) PORT_NAME("P1 Select")
765   PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_START1 ) PORT_NAME("P1 Start")
766   PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_JOYSTICK_UP ) PORT_PLAYER(1)
767   PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_JOYSTICK_DOWN ) PORT_PLAYER(1)
768   PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_JOYSTICK_LEFT ) PORT_PLAYER(1)
769   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_JOYSTICK_RIGHT ) PORT_PLAYER(1)
463   PORT_INCLUDE(snes_common)
770464
771   PORT_START("PAD2L")      /* IN 2 : Joypad 2 - L */
772   PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_BUTTON3 ) PORT_NAME("P2 Button A") PORT_PLAYER(2)
773   PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_BUTTON4 ) PORT_NAME("P2 Button X") PORT_PLAYER(2)
774   PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_BUTTON5 ) PORT_NAME("P2 Button L") PORT_PLAYER(2)
775   PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_BUTTON6 ) PORT_NAME("P2 Button R") PORT_PLAYER(2)
776   PORT_START("PAD2H")      /* IN 3 : Joypad 2 - H */
777   PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_BUTTON1 ) PORT_NAME("P2 Button B") PORT_PLAYER(2)
778   PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_BUTTON2 ) PORT_NAME("P2 Button Y") PORT_PLAYER(2)
779   PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_SERVICE2 ) PORT_NAME("P2 Select")
780   PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_START2 ) PORT_NAME("P2 Start")
781   PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_JOYSTICK_UP ) PORT_PLAYER(2)
782   PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_JOYSTICK_DOWN ) PORT_PLAYER(2)
783   PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_JOYSTICK_LEFT ) PORT_PLAYER(2)
784   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_JOYSTICK_RIGHT ) PORT_PLAYER(2)
785
786   PORT_START("PAD3L")      /* IN 4 : Joypad 3 - L */
787   PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_BUTTON3 ) PORT_NAME("P3 Button A") PORT_PLAYER(3)
788   PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_BUTTON4 ) PORT_NAME("P3 Button X") PORT_PLAYER(3)
789   PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_BUTTON5 ) PORT_NAME("P3 Button L") PORT_PLAYER(3)
790   PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_BUTTON6 ) PORT_NAME("P3 Button R") PORT_PLAYER(3)
791   PORT_START("PAD3H")      /* IN 5 : Joypad 3 - H */
792   PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_BUTTON1 ) PORT_NAME("P3 Button B") PORT_PLAYER(3)
793   PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_BUTTON2 ) PORT_NAME("P3 Button Y") PORT_PLAYER(3)
794   PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_SERVICE3 ) PORT_NAME("P3 Select")
795   PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_START3 ) PORT_NAME("P3 Start")
796   PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_JOYSTICK_UP ) PORT_PLAYER(3)
797   PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_JOYSTICK_DOWN ) PORT_PLAYER(3)
798   PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_JOYSTICK_LEFT ) PORT_PLAYER(3)
799   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_JOYSTICK_RIGHT ) PORT_PLAYER(3)
800
801   PORT_START("PAD4L")      /* IN 6 : Joypad 4 - L */
802   PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_BUTTON3 ) PORT_NAME("P4 Button A") PORT_PLAYER(4)
803   PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_BUTTON4 ) PORT_NAME("P4 Button X") PORT_PLAYER(4)
804   PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_BUTTON5 ) PORT_NAME("P4 Button L") PORT_PLAYER(4)
805   PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_BUTTON6 ) PORT_NAME("P4 Button R") PORT_PLAYER(4)
806   PORT_START("PAD4H")      /* IN 7 : Joypad 4 - H */
807   PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_BUTTON1 ) PORT_NAME("P4 Button B") PORT_PLAYER(4)
808   PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_BUTTON2 ) PORT_NAME("P4 Button Y") PORT_PLAYER(4)
809   PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_SERVICE4 ) PORT_NAME("P4 Select")
810   PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_START4 ) PORT_NAME("P4 Start")
811   PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_JOYSTICK_UP ) PORT_PLAYER(4)
812   PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_JOYSTICK_DOWN ) PORT_PLAYER(4)
813   PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_JOYSTICK_LEFT ) PORT_PLAYER(4)
814   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_JOYSTICK_RIGHT ) PORT_PLAYER(4)
815
816   PORT_START("INTERNAL")      /* IN 8 : Internal switches */
817   PORT_DIPNAME( 0x1, 0x1, "Enforce 32 sprites/line" )
818   PORT_DIPSETTING(   0x0, DEF_STR( No )  )
819   PORT_DIPSETTING(   0x1, DEF_STR( Yes ) )
820
821#ifdef SNES_LAYER_DEBUG
822   PORT_START("DEBUG1")   /* IN 9 : debug switches */
823   PORT_DIPNAME( 0x3, 0x0, "Browse tiles" )
824   PORT_DIPSETTING(   0x0, DEF_STR( Off ) )
825   PORT_DIPSETTING(   0x1, "2bpl"  )
826   PORT_DIPSETTING(   0x2, "4bpl"  )
827   PORT_DIPSETTING(   0x3, "8bpl"  )
828   PORT_DIPNAME( 0xc, 0x0, "Browse maps" )
829   PORT_DIPSETTING(   0x0, DEF_STR( Off ) )
830   PORT_DIPSETTING(   0x4, "2bpl"  )
831   PORT_DIPSETTING(   0x8, "4bpl"  )
832   PORT_DIPSETTING(   0xc, "8bpl"  )
833
834   PORT_START("DEBUG2")   /* IN 10 : debug switches */
835   PORT_BIT( 0x1, IP_ACTIVE_HIGH, IPT_BUTTON7 ) PORT_NAME("Toggle BG 1") PORT_PLAYER(2)
836   PORT_BIT( 0x2, IP_ACTIVE_HIGH, IPT_BUTTON8 ) PORT_NAME("Toggle BG 2") PORT_PLAYER(2)
837   PORT_BIT( 0x4, IP_ACTIVE_HIGH, IPT_BUTTON9 ) PORT_NAME("Toggle BG 3") PORT_PLAYER(2)
838   PORT_BIT( 0x8, IP_ACTIVE_HIGH, IPT_BUTTON10 ) PORT_NAME("Toggle BG 4") PORT_PLAYER(2)
839   PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_BUTTON7 ) PORT_NAME("Toggle Objects") PORT_PLAYER(3)
840   PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_BUTTON8 ) PORT_NAME("Toggle Main/Sub") PORT_PLAYER(3)
841   PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_BUTTON9 ) PORT_NAME("Toggle Back col") PORT_PLAYER(3)
842   PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_BUTTON10 ) PORT_NAME("Toggle Windows") PORT_PLAYER(3)
843
844   PORT_START("DEBUG3")   /* IN 11 : debug input */
845   PORT_BIT( 0x1, IP_ACTIVE_HIGH, IPT_BUTTON9 ) PORT_NAME("Pal prev")
846   PORT_BIT( 0x2, IP_ACTIVE_HIGH, IPT_BUTTON10 ) PORT_NAME("Pal next")
847   PORT_BIT( 0x4, IP_ACTIVE_HIGH, IPT_BUTTON7 ) PORT_NAME("Toggle Transparency") PORT_PLAYER(4)
848#endif
849
850   PORT_START("DSW1")   /* IN 12 : dip-switches */
465   PORT_START("DSW1")
851466   PORT_DIPUNKNOWN_DIPLOC( 0x01, 0x01, "SW1:1" )
852467   PORT_DIPUNKNOWN_DIPLOC( 0x02, 0x02, "SW1:2" )
853468   PORT_DIPUNKNOWN_DIPLOC( 0x04, 0x04, "SW1:3" )
r7522r7523
857472   PORT_DIPUNKNOWN_DIPLOC( 0x40, 0x40, "SW1:7" )
858473   PORT_DIPUNKNOWN_DIPLOC( 0x80, 0x80, "SW1:8" )
859474
860   PORT_START("COIN")   /* IN 14 : coins */
475   PORT_START("COIN")
861476   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_COIN1 )
862477   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_COIN2 )
863
864478INPUT_PORTS_END
865479
866480
867481static MACHINE_DRIVER_START( kinstb )
482
483   /* driver data */
484   MDRV_DRIVER_DATA(snes_state)
485
868486   /* basic machine hardware */
869487   MDRV_CPU_ADD("maincpu", G65816, 3580000)   /* 2.68Mhz, also 3.58Mhz */
870488   MDRV_CPU_PROGRAM_MAP(snesb_map)
r7522r7523
899517   INT32 i;
900518   UINT8 *rom = memory_region(machine, "user3");
901519
902   for(i=0;i<0x400000;i++)
520   for (i = 0; i < 0x400000; i++)
903521   {
904      rom[i]=BITSWAP8(rom[i],5,0,6,1,7,4,3,2);
522      rom[i] = BITSWAP8(rom[i], 5, 0, 6, 1, 7, 4, 3, 2);
905523   }
906524
907   shared_ram=auto_alloc_array(machine, INT8, 0x100);
525   shared_ram = auto_alloc_array(machine, INT8, 0x100);
908526   memory_install_readwrite8_handler(cputag_get_address_space(machine, "maincpu", ADDRESS_SPACE_PROGRAM), 0x781000, 0x7810ff, 0, 0, sharedram_r, sharedram_w);
909527
910528   DRIVER_INIT_CALL(snes_hirom);
r7522r7523
915533   INT32 i;
916534   UINT8 *rom = memory_region(machine, "user3");
917535
918   for(i=0;i<0x200000;i++)
536   for(i = 0; i < 0x200000; i++)
919537   {
920      rom[i]=rom[i]^0xff;
538      rom[i] = rom[i] ^ 0xff;
921539
922      if (i<0x10000) /* 0x00000 - 0x0ffff */
540      if (i < 0x10000) /* 0x00000 - 0x0ffff */
923541      {
924         rom[i]=BITSWAP8(rom[i],3,1,6,4,7,0,2,5);
542         rom[i] = BITSWAP8(rom[i],3,1,6,4,7,0,2,5);
925543      }
926      else if (i<0x20000) /* 0x10000 - 0x1ffff */
544      else if (i < 0x20000) /* 0x10000 - 0x1ffff */
927545      {
928         rom[i]=BITSWAP8(rom[i],3,7,0,5,1,6,2,4);
546         rom[i] = BITSWAP8(rom[i],3,7,0,5,1,6,2,4);
929547      }
930
931      else if (i<0x30000) /* 0x20000 - 0x2ffff */
548      else if (i < 0x30000) /* 0x20000 - 0x2ffff */
932549      {
933         rom[i]=BITSWAP8(rom[i],1,7,6,4,5,2,3,0);
550         rom[i] = BITSWAP8(rom[i],1,7,6,4,5,2,3,0);
934551      }
935      else if (i<0x40000) /* 0x30000 - 0x3ffff */
552      else if (i < 0x40000) /* 0x30000 - 0x3ffff */
936553      {
937         rom[i]=BITSWAP8(rom[i],0,3,2,5,4,6,7,1);
554         rom[i] = BITSWAP8(rom[i],0,3,2,5,4,6,7,1);
938555      }
939      else if (i<0x150000)
556      else if (i < 0x150000)
940557      {
941         rom[i]=BITSWAP8(rom[i],6,4,0,5,1,3,2,7);
558         rom[i] = BITSWAP8(rom[i],6,4,0,5,1,3,2,7);
942559      }
943560   }
944561
945562   /*  boot vector */
946   rom[0x7ffd]=0x89;
947   rom[0x7ffc]=0x54;
563   rom[0x7ffd] = 0x89;
564   rom[0x7ffc] = 0x54;
948565
949   ffight2b_coins=0;
566   ffight2b_coins = 0;
950567   memory_install_read8_handler(cputag_get_address_space(machine, "maincpu", ADDRESS_SPACE_PROGRAM), 0x7eadce, 0x7eadce, 0, 0, ffight2b_coin_r);
951568
952
953569   DRIVER_INIT_CALL(snes);
954570}
955571
r7522r7523
976592   int i, cipherText, plainText, newAddress;
977593   UINT8 *src = memory_region(machine, "user7");
978594   UINT8 *dst = memory_region(machine, "user3");
979   for (i=0; i<0x80000*3; i++)
980    {
981       cipherText = src[i];
982       plainText = data_substitution0[cipherText&0xf]|data_substitution1[cipherText>>4];
983      newAddress = (address_substitution_high[i>>15]<<15)|(i&0x7fc0)|(address_substitution_low[i&0x3f]);
984595
985      if(newAddress<0x10000)
596   for (i =0; i < 0x80000 * 3; i++)
597   {
598          cipherText = src[i];
599          plainText = data_substitution0[cipherText & 0xf] | data_substitution1[cipherText >> 4];
600      newAddress = (address_substitution_high[i >> 15] << 15) | (i & 0x7fc0) | (address_substitution_low[i & 0x3f]);
601
602      if (newAddress < 0x10000)
986603      {
987604         plainText = BITSWAP8(plainText, 6,3,5,4,2,0,7,1) ^ 0xff;
988605      }
989      else
990      if(newAddress<0x20000)
606      else if (newAddress < 0x20000)
991607      {
992608         plainText =   BITSWAP8(plainText, 4,0,7,6,3,1,2,5) ^ 0xff;
993609      }
994      else
995      if(newAddress<0x30000)
610      else if (newAddress < 0x30000)
996611      {
997612         plainText =   BITSWAP8(plainText, 5,7,6,1,4,3,0,2);
998613      }
999      else
1000      if(newAddress<0x40000)
614      else if (newAddress < 0x40000)
1001615      {
1002616         plainText = BITSWAP8(plainText, 3,1,2,0,5,6,4,7) ^ 0xff;
1003617      }
1004        dst[newAddress] = plainText;
1005    }
618      dst[newAddress] = plainText;
619   }
1006620
1007621   /*  boot vector */
1008    dst[0xfffc]=0xc0;
1009    dst[0xfffd]=0x7a;
622   dst[0xfffc] = 0xc0;
623   dst[0xfffd] = 0x7a;
1010624
1011625   /*  protection checks */
1012626   memory_install_read8_handler(cputag_get_address_space(machine, "maincpu", ADDRESS_SPACE_PROGRAM), 0x75bd37, 0x75bd37, 0, 0, sb2b_75bd37_r);
r7522r7523
1014628
1015629   /* extra inputs */
1016630   memory_install_read8_handler(cputag_get_address_space(machine, "maincpu", ADDRESS_SPACE_PROGRAM), 0x770071, 0x770071, 0, 0, sb2b_770071_r);
1017    memory_install_read8_handler(cputag_get_address_space(machine, "maincpu", ADDRESS_SPACE_PROGRAM), 0x770079, 0x770079, 0, 0, sb2b_770079_r);
631   memory_install_read8_handler(cputag_get_address_space(machine, "maincpu", ADDRESS_SPACE_PROGRAM), 0x770079, 0x770079, 0, 0, sb2b_770079_r);
1018632
1019    /* handler to read boot code */
1020    memory_install_read8_handler(cputag_get_address_space(machine, "maincpu", ADDRESS_SPACE_PROGRAM), 0x007000, 0x007fff, 0, 0, sb2b_7xxx_r);
633   /* handler to read boot code */
634   memory_install_read8_handler(cputag_get_address_space(machine, "maincpu", ADDRESS_SPACE_PROGRAM), 0x007000, 0x007fff, 0, 0, sb2b_7xxx_r);
1021635
1022636   DRIVER_INIT_CALL(snes_hirom);
1023637}
r7522r7523
1027641   INT32 i;
1028642   UINT8 *rom = memory_region(machine, "user3");
1029643
1030   for(i=0;i<0x140000;i++)
644   for (i = 0; i < 0x140000; i++)
1031645   {
1032      if(i<0x80000)
646      if(i < 0x80000)
1033647      {
1034         rom[i]=BITSWAP8(rom[i]^0xff,2,7,1,6,3,0,5,4);
648         rom[i] = BITSWAP8(rom[i]^0xff,2,7,1,6,3,0,5,4);
1035649      }
1036650      else
1037651      {
1038         rom[i]=BITSWAP8(rom[i],6,3,0,5,1,4,7,2);
652         rom[i] = BITSWAP8(rom[i],6,3,0,5,1,4,7,2);
1039653      }
1040654   }
1041655
r7522r7523
1053667   UINT8 *rom = memory_region(machine, "user3");
1054668
1055669   /* there is more to this, 0x800 based block swaps? */
1056   for(i=0;i<0x200000;i++)
670   for (i = 0; i < 0x200000; i++)
1057671   {
1058      rom[i]=rom[i]^0x55;
672      rom[i] = rom[i]^0x55;
1059673   }
1060674
1061675   DRIVER_INIT_CALL(snes);
r7522r7523
1063677
1064678static DRIVER_INIT( denseib )
1065679{
1066
1067680   UINT8 *rom = memory_region(machine, "user3");
1068
1069681   INT32 i;
1070   for(i=0;i<0x200000;i++)
682
683   for (i = 0; i < 0x200000; i++)
1071684   {
1072      rom[i]=rom[i]^0xff;
1073      switch(i>>16)
685      rom[i] = rom[i] ^ 0xff;
686      switch (i >> 16)
1074687      {
1075         case 0x00: rom[i]=BITSWAP8(rom[i],1,7,0,6,3,4,5,2); break;
1076         case 0x01: rom[i]=BITSWAP8(rom[i],3,4,7,2,0,6,5,1); break;
1077         case 0x02: rom[i]=BITSWAP8(rom[i],5,4,2,1,7,0,6,3); break;
1078         case 0x03: rom[i]=BITSWAP8(rom[i],0,1,3,7,2,6,5,4); break;
688         case 0x00: rom[i] = BITSWAP8(rom[i],1,7,0,6,3,4,5,2); break;
689         case 0x01: rom[i] = BITSWAP8(rom[i],3,4,7,2,0,6,5,1); break;
690         case 0x02: rom[i] = BITSWAP8(rom[i],5,4,2,1,7,0,6,3); break;
691         case 0x03: rom[i] = BITSWAP8(rom[i],0,1,3,7,2,6,5,4); break;
1079692
1080         default:   rom[i]=BITSWAP8(rom[i],4,5,1,0,2,3,7,6); break;
693         default:   rom[i] = BITSWAP8(rom[i],4,5,1,0,2,3,7,6); break;
1081694      }
1082695   }
1083696
1084    /*  boot vector */
1085    rom[0xfffc]=0x40;
1086    rom[0xfffd]=0xf7;
697   /*  boot vector */
698   rom[0xfffc] = 0x40;
699   rom[0xfffd] = 0xf7;
1087700
1088701   /* extra inputs */
1089702   memory_install_read8_handler(cputag_get_address_space(machine, "maincpu", ADDRESS_SPACE_PROGRAM), 0x770071, 0x770071, 0, 0, denseib_770071_r);
1090    memory_install_read8_handler(cputag_get_address_space(machine, "maincpu", ADDRESS_SPACE_PROGRAM), 0x770079, 0x770079, 0, 0, denseib_770079_r);
703   memory_install_read8_handler(cputag_get_address_space(machine, "maincpu", ADDRESS_SPACE_PROGRAM), 0x770079, 0x770079, 0, 0, denseib_770079_r);
1091704
1092
1093705   DRIVER_INIT_CALL(snes_hirom);
1094706}
1095707
src/mame/drivers/nss.c
r7522r7523
327327ADDRESS_MAP_END
328328
329329static INPUT_PORTS_START( snes )
330   PORT_START("PAD1L")      /* IN 0 : Joypad 1 - L */
330   PORT_START("SERIAL1_DATA1_L")
331331   PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_BUTTON3 ) PORT_NAME("P1 Button A") PORT_PLAYER(1)
332332   PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_BUTTON4 ) PORT_NAME("P1 Button X") PORT_PLAYER(1)
333333   PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_BUTTON5 ) PORT_NAME("P1 Button L") PORT_PLAYER(1)
334334   PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_BUTTON6 ) PORT_NAME("P1 Button R") PORT_PLAYER(1)
335   PORT_START("PAD1H")      /* IN 1 : Joypad 1 - H */
335   PORT_START("SERIAL1_DATA1_H")
336336   PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_BUTTON1 ) PORT_NAME("P1 Button B") PORT_PLAYER(1)
337337   PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_BUTTON2 ) PORT_NAME("P1 Button Y") PORT_PLAYER(1)
338338   PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_SERVICE1 ) PORT_NAME("P1 Select")
r7522r7523
342342   PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_JOYSTICK_LEFT ) PORT_PLAYER(1)
343343   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_JOYSTICK_RIGHT ) PORT_PLAYER(1)
344344
345   PORT_START("PAD2L")      /* IN 2 : Joypad 2 - L */
345   PORT_START("SERIAL2_DATA1_L")
346346   PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_BUTTON3 ) PORT_NAME("P2 Button A") PORT_PLAYER(2)
347347   PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_BUTTON4 ) PORT_NAME("P2 Button X") PORT_PLAYER(2)
348348   PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_BUTTON5 ) PORT_NAME("P2 Button L") PORT_PLAYER(2)
349349   PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_BUTTON6 ) PORT_NAME("P2 Button R") PORT_PLAYER(2)
350   PORT_START("PAD2H")      /* IN 3 : Joypad 2 - H */
350   PORT_START("SERIAL2_DATA1_H")
351351   PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_BUTTON1 ) PORT_NAME("P2 Button B") PORT_PLAYER(2)
352352   PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_BUTTON2 ) PORT_NAME("P2 Button Y") PORT_PLAYER(2)
353353   PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_SERVICE2 ) PORT_NAME("P2 Select")
r7522r7523
357357   PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_JOYSTICK_LEFT ) PORT_PLAYER(2)
358358   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_JOYSTICK_RIGHT ) PORT_PLAYER(2)
359359
360   PORT_START("PAD3L")      /* IN 4 : Joypad 3 - L */
361   PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_BUTTON3 ) PORT_NAME("P3 Button A") PORT_PLAYER(3)
362   PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_BUTTON4 ) PORT_NAME("P3 Button X") PORT_PLAYER(3)
363   PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_BUTTON5 ) PORT_NAME("P3 Button L") PORT_PLAYER(3)
364   PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_BUTTON6 ) PORT_NAME("P3 Button R") PORT_PLAYER(3)
365   PORT_START("PAD3H")      /* IN 5 : Joypad 3 - H */
366   PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_BUTTON1 ) PORT_NAME("P3 Button B") PORT_PLAYER(3)
367   PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_BUTTON2 ) PORT_NAME("P3 Button Y") PORT_PLAYER(3)
368   PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_SERVICE3 ) PORT_NAME("P3 Select")
369   PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_START3 ) PORT_NAME("P3 Start")
370   PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_JOYSTICK_UP ) PORT_PLAYER(3)
371   PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_JOYSTICK_DOWN ) PORT_PLAYER(3)
372   PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_JOYSTICK_LEFT ) PORT_PLAYER(3)
373   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_JOYSTICK_RIGHT ) PORT_PLAYER(3)
360   PORT_START("SERIAL1_DATA2_L")
361   PORT_BIT( 0xff, IP_ACTIVE_HIGH, IPT_UNUSED )
362   PORT_START("SERIAL1_DATA2_H")
363   PORT_BIT( 0xff, IP_ACTIVE_HIGH, IPT_UNUSED )
374364
375   PORT_START("PAD4L")      /* IN 6 : Joypad 4 - L */
376   PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_BUTTON3 ) PORT_NAME("P4 Button A") PORT_PLAYER(4)
377   PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_BUTTON4 ) PORT_NAME("P4 Button X") PORT_PLAYER(4)
378   PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_BUTTON5 ) PORT_NAME("P4 Button L") PORT_PLAYER(4)
379   PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_BUTTON6 ) PORT_NAME("P4 Button R") PORT_PLAYER(4)
380   PORT_START("PAD4H")      /* IN 7 : Joypad 4 - H */
381   PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_BUTTON1 ) PORT_NAME("P4 Button B") PORT_PLAYER(4)
382   PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_BUTTON2 ) PORT_NAME("P4 Button Y") PORT_PLAYER(4)
383   PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_SERVICE4 ) PORT_NAME("P4 Select")
384   PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_START4 ) PORT_NAME("P4 Start")
385   PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_JOYSTICK_UP ) PORT_PLAYER(4)
386   PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_JOYSTICK_DOWN ) PORT_PLAYER(4)
387   PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_JOYSTICK_LEFT ) PORT_PLAYER(4)
388   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_JOYSTICK_RIGHT ) PORT_PLAYER(4)
365   PORT_START("SERIAL2_DATA2_L")
366   PORT_BIT( 0xff, IP_ACTIVE_HIGH, IPT_UNUSED )
367   PORT_START("SERIAL2_DATA2_H")
368   PORT_BIT( 0xff, IP_ACTIVE_HIGH, IPT_UNUSED )
389369
390   PORT_START("DSW")   /* IN 8 : dip-switches */
370   PORT_START("DSW")
391371   PORT_DIPNAME( 0x03, 0x00, DEF_STR( Difficulty ) )
392372   PORT_DIPSETTING(    0x00, DEF_STR( Normal ) )
393373   PORT_DIPSETTING(    0x03, DEF_STR( Hard )  )
r7522r7523
410390INPUT_PORTS_END
411391
412392static MACHINE_DRIVER_START( snes )
393
394   /* driver data */
395   MDRV_DRIVER_DATA(snes_state)
396
413397   /* basic machine hardware */
414398   MDRV_CPU_ADD("maincpu", G65816, 3580000)   /* 2.68Mhz, also 3.58Mhz */
415399   MDRV_CPU_PROGRAM_MAP(snes_map)
src/mess/drivers/snes.c
r7522r7523
8989***************************************************************************/
9090
9191static INPUT_PORTS_START( snes )
92   PORT_START("PAD1L")      /* Joypad 1 - L */
93   PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_BUTTON3 ) PORT_NAME("P1 Button A")  PORT_PLAYER(1)
94   PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_BUTTON4 ) PORT_NAME("P1 Button X")  PORT_PLAYER(1)
95   PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_BUTTON5 ) PORT_NAME("P1 Button L")  PORT_PLAYER(1)
96   PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_BUTTON6 ) PORT_NAME("P1 Button R")  PORT_PLAYER(1)
97
98   PORT_START("PAD1H")      /* Joypad 1 - H */
99   PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_BUTTON1 ) PORT_NAME("P1 Button B")  PORT_PLAYER(1)
100   PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_BUTTON2 ) PORT_NAME("P1 Button Y")  PORT_PLAYER(1)
101   PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_SELECT ) PORT_PLAYER(1)
102   PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_START ) PORT_PLAYER(1)
92   PORT_START("SERIAL1_DATA1_L")
93   PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_BUTTON3 ) PORT_NAME("P1 Button A") PORT_PLAYER(1)
94   PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_BUTTON4 ) PORT_NAME("P1 Button X") PORT_PLAYER(1)
95   PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_BUTTON5 ) PORT_NAME("P1 Button L") PORT_PLAYER(1)
96   PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_BUTTON6 ) PORT_NAME("P1 Button R") PORT_PLAYER(1)
97   PORT_START("SERIAL1_DATA1_H")
98   PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_BUTTON1 ) PORT_NAME("P1 Button B") PORT_PLAYER(1)
99   PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_BUTTON2 ) PORT_NAME("P1 Button Y") PORT_PLAYER(1)
100   PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_SERVICE1 ) PORT_NAME("P1 Select")
101   PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_START1 ) PORT_NAME("P1 Start")
103102   PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_JOYSTICK_UP ) PORT_PLAYER(1)
104103   PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_JOYSTICK_DOWN ) PORT_PLAYER(1)
105104   PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_JOYSTICK_LEFT ) PORT_PLAYER(1)
106105   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_JOYSTICK_RIGHT ) PORT_PLAYER(1)
107106
108   PORT_START("PAD2L")      /* Joypad 2 - L */
109   PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_BUTTON3 ) PORT_NAME("P2 Button A")  PORT_PLAYER(2)
110   PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_BUTTON4 ) PORT_NAME("P2 Button X")  PORT_PLAYER(2)
111   PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_BUTTON5 ) PORT_NAME("P2 Button L")  PORT_PLAYER(2)
112   PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_BUTTON6 ) PORT_NAME("P2 Button R")  PORT_PLAYER(2)
113
114   PORT_START("PAD2H")      /* Joypad 2 - H */
115   PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_BUTTON1 ) PORT_NAME("P2 Button B")  PORT_PLAYER(2)
116   PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_BUTTON2 ) PORT_NAME("P2 Button Y")  PORT_PLAYER(2)
117   PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_SELECT ) PORT_PLAYER(2)
118   PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_START ) PORT_PLAYER(2)
107   PORT_START("SERIAL2_DATA1_L")
108   PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_BUTTON3 ) PORT_NAME("P2 Button A") PORT_PLAYER(2)
109   PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_BUTTON4 ) PORT_NAME("P2 Button X") PORT_PLAYER(2)
110   PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_BUTTON5 ) PORT_NAME("P2 Button L") PORT_PLAYER(2)
111   PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_BUTTON6 ) PORT_NAME("P2 Button R") PORT_PLAYER(2)
112   PORT_START("SERIAL2_DATA1_H")
113   PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_BUTTON1 ) PORT_NAME("P2 Button B") PORT_PLAYER(2)
114   PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_BUTTON2 ) PORT_NAME("P2 Button Y") PORT_PLAYER(2)
115   PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_SERVICE2 ) PORT_NAME("P2 Select")
116   PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_START2 ) PORT_NAME("P2 Start")
119117   PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_JOYSTICK_UP ) PORT_PLAYER(2)
120118   PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_JOYSTICK_DOWN ) PORT_PLAYER(2)
121119   PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_JOYSTICK_LEFT ) PORT_PLAYER(2)
122120   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_JOYSTICK_RIGHT ) PORT_PLAYER(2)
123121
124   PORT_START("PAD3L")      /* Joypad 3 - L */
125   PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_BUTTON3 ) PORT_NAME("P3 Button A")  PORT_PLAYER(3)
126   PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_BUTTON4 ) PORT_NAME("P3 Button X")  PORT_PLAYER(3)
127   PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_BUTTON5 ) PORT_NAME("P3 Button L")  PORT_PLAYER(3)
128   PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_BUTTON6 ) PORT_NAME("P3 Button R")  PORT_PLAYER(3)
122   PORT_START("SERIAL1_DATA2_L")
123   PORT_BIT( 0xff, IP_ACTIVE_HIGH, IPT_UNUSED )
124   PORT_START("SERIAL1_DATA2_H")
125   PORT_BIT( 0xff, IP_ACTIVE_HIGH, IPT_UNUSED )
129126
130   PORT_START("PAD3H")      /* Joypad 3 - H */
131   PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_BUTTON1 ) PORT_NAME("P3 Button B")  PORT_PLAYER(3)
132   PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_BUTTON2 ) PORT_NAME("P3 Button Y")  PORT_PLAYER(3)
133   PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_SELECT ) PORT_PLAYER(3)
134   PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_START ) PORT_PLAYER(3)
135   PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_JOYSTICK_UP ) PORT_PLAYER(3)
136   PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_JOYSTICK_DOWN ) PORT_PLAYER(3)
137   PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_JOYSTICK_LEFT ) PORT_PLAYER(3)
138   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_JOYSTICK_RIGHT ) PORT_PLAYER(3)
127   PORT_START("SERIAL2_DATA2_L")
128   PORT_BIT( 0xff, IP_ACTIVE_HIGH, IPT_UNUSED )
129   PORT_START("SERIAL2_DATA2_H")
130   PORT_BIT( 0xff, IP_ACTIVE_HIGH, IPT_UNUSED )
139131
140   PORT_START("PAD4L")      /* Joypad 4 - L */
141   PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_BUTTON3 ) PORT_NAME("P4 Button A")  PORT_PLAYER(4)
142   PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_BUTTON4 ) PORT_NAME("P4 Button X")  PORT_PLAYER(4)
143   PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_BUTTON5 ) PORT_NAME("P4 Button L")  PORT_PLAYER(4)
144   PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_BUTTON6 ) PORT_NAME("P4 Button R")  PORT_PLAYER(4)
145
146   PORT_START("PAD4H")      /* Joypad 4 - H */
147   PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_BUTTON1 ) PORT_NAME("P4 Button B")  PORT_PLAYER(4)
148   PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_BUTTON2 ) PORT_NAME("P4 Button Y")  PORT_PLAYER(4)
149   PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_SELECT ) PORT_PLAYER(4)
150   PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_START ) PORT_PLAYER(4)
151   PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_JOYSTICK_UP ) PORT_PLAYER(4)
152   PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_JOYSTICK_DOWN ) PORT_PLAYER(4)
153   PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_JOYSTICK_LEFT ) PORT_PLAYER(4)
154   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_JOYSTICK_RIGHT ) PORT_PLAYER(4)
155
156   PORT_START("INTERNAL")   /* Configuration */
132#ifdef SNES_LAYER_DEBUG
133   PORT_START("INTERNAL")
157134   PORT_CONFNAME( 0x1, 0x1, "Enforce 32 sprites/line" )
158135   PORT_CONFSETTING(   0x0, DEF_STR( No ) )
159136   PORT_CONFSETTING(   0x1, DEF_STR( Yes ) )
160137
161#ifdef SNES_LAYER_DEBUG
162   PORT_START("DEBUG1")   /* debug switches */
138   PORT_START("DEBUG1")
163139   PORT_DIPNAME( 0x3, 0x0, "Browse tiles" )
164140   PORT_DIPSETTING(   0x0, DEF_STR( Off ) )
165141   PORT_DIPSETTING(   0x1, "2bpl" )
r7522r7523
171147   PORT_DIPSETTING(   0x8, "4bpl" )
172148   PORT_DIPSETTING(   0xc, "8bpl" )
173149
174   PORT_START("DEBUG2")   /* debug switches */
150   PORT_START("DEBUG2")
175151   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_OTHER ) PORT_NAME("Toggle BG 1") PORT_CODE(KEYCODE_1_PAD)
176152   PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_OTHER ) PORT_NAME("Toggle BG 2") PORT_CODE(KEYCODE_2_PAD)
177153   PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_OTHER ) PORT_NAME("Toggle BG 3") PORT_CODE(KEYCODE_3_PAD)
r7522r7523
181157   PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_OTHER ) PORT_NAME("Toggle Back col") PORT_CODE(KEYCODE_7_PAD)
182158   PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_OTHER ) PORT_NAME("Toggle Windows") PORT_CODE(KEYCODE_8_PAD)
183159
184   PORT_START("DEBUG3")   /* IN 11 : debug input */
160   PORT_START("DEBUG3")
185161   PORT_BIT( 0x1, IP_ACTIVE_HIGH, IPT_OTHER ) PORT_NAME("Pal prev") PORT_CODE(KEYCODE_B)
186162   PORT_BIT( 0x2, IP_ACTIVE_HIGH, IPT_OTHER ) PORT_NAME("Pal next") PORT_CODE(KEYCODE_N)
187163   PORT_BIT( 0x4, IP_ACTIVE_HIGH, IPT_OTHER ) PORT_NAME("Toggle Transparency") PORT_CODE(KEYCODE_9_PAD)
188164
189   PORT_START("DEBUG4")   /* debug switches */
165   PORT_START("DEBUG4")
190166   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_OTHER ) PORT_NAME("Toggle Mode 0 draw")
191167   PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_OTHER ) PORT_NAME("Toggle Mode 1 draw")
192168   PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_OTHER ) PORT_NAME("Toggle Mode 2 draw")
r7522r7523
207183
208184
209185static MACHINE_DRIVER_START( snes )
186
187   /* driver data */
188   MDRV_DRIVER_DATA(snes_state)
189
210190   /* basic machine hardware */
211191   MDRV_CPU_ADD("maincpu", G65816, MCLK_NTSC/6)   /* 2.68 MHz, also 3.58 MHz */
212192   MDRV_CPU_PROGRAM_MAP(snes_map)
r7522r7523
334314
335315***************************************************************************/
336316
337/*    YEAR  NAME     PARENT  COMPAT  MACHINE  INPUT  INIT  COMPANY     FULLNAME                                      FLAGS */
338CONS( 1989, snes,    0,      0,      snes,    snes,  0,    "Nintendo", "Super Nintendo Entertainment System / Super Famicom (NTSC)", GAME_IMPERFECT_GRAPHICS | GAME_IMPERFECT_SOUND )
339CONS( 1989, snessfx, snes,   0,      snessfx, snes,  0,    "Nintendo", "Super Nintendo Entertainment System / Super Famicom (NTSC), SuperFX", GAME_IMPERFECT_GRAPHICS | GAME_IMPERFECT_SOUND )
340CONS( 1991, snespal, snes,   0,      snespal, snes,  0,    "Nintendo", "Super Nintendo Entertainment System (PAL)",  GAME_IMPERFECT_GRAPHICS | GAME_IMPERFECT_SOUND )
341CONS( 1991, snespsfx,snes,   0,      snespsfx,snes,  0,    "Nintendo", "Super Nintendo Entertainment System (PAL), SuperFX",  GAME_IMPERFECT_GRAPHICS | GAME_IMPERFECT_SOUND )
342CONS( 199?, sfcbox,  snes,   0,      snes,    snes,  0,    "Nintendo", "Super Famicom Box (NTSC)", GAME_NOT_WORKING )
317/*    YEAR  NAME      PARENT  COMPAT  MACHINE   INPUT  INIT  COMPANY     FULLNAME                                      FLAGS */
318CONS( 1989, snes,     0,      0,      snes,     snes,  0,    "Nintendo", "Super Nintendo Entertainment System / Super Famicom (NTSC)", GAME_IMPERFECT_GRAPHICS | GAME_IMPERFECT_SOUND )
319CONS( 1989, snessfx,  snes,   0,      snessfx,  snes,  0,    "Nintendo", "Super Nintendo Entertainment System / Super Famicom (NTSC, w/SuperFX)", GAME_IMPERFECT_GRAPHICS | GAME_IMPERFECT_SOUND )
320CONS( 1991, snespal,  snes,   0,      snespal,  snes,  0,    "Nintendo", "Super Nintendo Entertainment System (PAL)",  GAME_IMPERFECT_GRAPHICS | GAME_IMPERFECT_SOUND )
321CONS( 1991, snespsfx, snes,   0,      snespsfx, snes,  0,    "Nintendo", "Super Nintendo Entertainment System (PAL, w/SuperFX)",  GAME_IMPERFECT_GRAPHICS | GAME_IMPERFECT_SOUND )
322CONS( 199?, sfcbox,   snes,   0,      snes,     snes,  0,    "Nintendo", "Super Famicom Box (NTSC)", GAME_NOT_WORKING )

Previous 15994 Revisions Next


© 1998-2018 The MESS Team