Viewing File: <root>/src/mame/drivers/ironhors.c

    1  /***************************************************************************
    2  
    3      IronHorse
    4  
    5      driver by Mirko Buffoni
    6  
    7  ***************************************************************************/
    8  
    9  #include "emu.h"
   10  #include "cpu/z80/z80.h"
   11  #include "cpu/m6809/m6809.h"
   12  #include "sound/2203intf.h"
   13  #include "sound/discrete.h"
   14  #include "includes/konamipt.h"
   15  #include "includes/ironhors.h"
   16  
   17  /*************************************
   18   *
   19   *  Memory handlers
   20   *
   21   *************************************/
   22  
   23  TIMER_DEVICE_CALLBACK_MEMBER(ironhors_state::ironhors_irq)
   24  {
   25      int scanline = param;
   26  
   27      if (scanline == 240)
   28      {
   29          if (*m_interrupt_enable & 4)
   30              m_maincpu->set_input_line(M6809_FIRQ_LINE, HOLD_LINE);
   31      }
   32      else if (((scanline+16) % 64) == 0)
   33      {
   34          if (*m_interrupt_enable & 1)
   35              m_maincpu->set_input_line(INPUT_LINE_NMI, PULSE_LINE);
   36      }
   37  }
   38  
   39  WRITE8_MEMBER(ironhors_state::ironhors_sh_irqtrigger_w)
   40  {
   41      m_soundcpu->set_input_line_and_vector(0, HOLD_LINE, 0xff);
   42  }
   43  
   44  WRITE8_MEMBER(ironhors_state::ironhors_filter_w)
   45  {
   46      device_t *device = machine().device("disc_ih");
   47      discrete_sound_w(device, space, NODE_11, (data & 0x04) >> 2);
   48      discrete_sound_w(device, space, NODE_12, (data & 0x02) >> 1);
   49      discrete_sound_w(device, space, NODE_13, (data & 0x01) >> 0);
   50  }
   51  
   52  /*************************************
   53   *
   54   *  Address maps
   55   *
   56   *************************************/
   57  
   58  static ADDRESS_MAP_START( master_map, AS_PROGRAM, 8, ironhors_state )
   59      AM_RANGE(0x0000, 0x0002) AM_RAM
   60      AM_RANGE(0x0003, 0x0003) AM_RAM_WRITE(ironhors_charbank_w)
   61      AM_RANGE(0x0004, 0x0004) AM_RAM AM_SHARE("int_enable")
   62      AM_RANGE(0x0005, 0x001f) AM_RAM
   63      AM_RANGE(0x0020, 0x003f) AM_RAM AM_SHARE("scroll")
   64      AM_RANGE(0x0040, 0x005f) AM_RAM
   65      AM_RANGE(0x0060, 0x00df) AM_RAM
   66      AM_RANGE(0x0800, 0x0800) AM_WRITE(soundlatch_byte_w)
   67      AM_RANGE(0x0900, 0x0900) AM_READ_PORT("DSW3") AM_WRITE(ironhors_sh_irqtrigger_w)
   68      AM_RANGE(0x0a00, 0x0a00) AM_READ_PORT("DSW2") AM_WRITE(ironhors_palettebank_w)
   69      AM_RANGE(0x0b00, 0x0b00) AM_READ_PORT("DSW1") AM_WRITE(ironhors_flipscreen_w)
   70      AM_RANGE(0x0b01, 0x0b01) AM_READ_PORT("P2")
   71      AM_RANGE(0x0b02, 0x0b02) AM_READ_PORT("P1")
   72      AM_RANGE(0x0b03, 0x0b03) AM_READ_PORT("SYSTEM")
   73      AM_RANGE(0x1800, 0x1800) AM_WRITENOP // ???
   74      AM_RANGE(0x1a00, 0x1a01) AM_WRITENOP // ???
   75      AM_RANGE(0x1c00, 0x1dff) AM_WRITENOP // ???
   76      AM_RANGE(0x2000, 0x23ff) AM_RAM_WRITE(ironhors_colorram_w) AM_SHARE("colorram")
   77      AM_RANGE(0x2400, 0x27ff) AM_RAM_WRITE(ironhors_videoram_w) AM_SHARE("videoram")
   78      AM_RANGE(0x2800, 0x2fff) AM_RAM
   79      AM_RANGE(0x3000, 0x30ff) AM_RAM AM_SHARE("spriteram2")
   80      AM_RANGE(0x3100, 0x37ff) AM_RAM
   81      AM_RANGE(0x3800, 0x38ff) AM_RAM AM_SHARE("spriteram")
   82      AM_RANGE(0x3900, 0x3fff) AM_RAM
   83      AM_RANGE(0x4000, 0xffff) AM_ROM
   84  ADDRESS_MAP_END
   85  
   86  static ADDRESS_MAP_START( slave_map, AS_PROGRAM, 8, ironhors_state )
   87      AM_RANGE(0x0000, 0x3fff) AM_ROM
   88      AM_RANGE(0x4000, 0x43ff) AM_RAM
   89      AM_RANGE(0x8000, 0x8000) AM_READ(soundlatch_byte_r)
   90  ADDRESS_MAP_END
   91  
   92  static ADDRESS_MAP_START( slave_io_map, AS_IO, 8, ironhors_state )
   93      ADDRESS_MAP_GLOBAL_MASK(0xff)
   94      AM_RANGE(0x00, 0x01) AM_DEVREADWRITE_LEGACY("ym2203", ym2203_r, ym2203_w)
   95  ADDRESS_MAP_END
   96  
   97  static ADDRESS_MAP_START( farwest_master_map, AS_PROGRAM, 8, ironhors_state )
   98      AM_RANGE(0x0000, 0x0002) AM_RAM
   99      //20=31db
  100  
  101      AM_RANGE(0x0005, 0x001f) AM_RAM
  102      AM_RANGE(0x31db, 0x31fa) AM_RAM AM_SHARE("scroll")
  103      AM_RANGE(0x0040, 0x005f) AM_RAM
  104      AM_RANGE(0x0060, 0x00ff) AM_RAM
  105      AM_RANGE(0x0800, 0x0800) AM_WRITE(soundlatch_byte_w)
  106      AM_RANGE(0x0900, 0x0900) /*AM_READ_PORT("DSW3") */AM_WRITE(ironhors_sh_irqtrigger_w)
  107      AM_RANGE(0x0a00, 0x0a00) AM_READ_PORT("DSW2") //AM_WRITE(ironhors_palettebank_w)
  108      AM_RANGE(0x0b00, 0x0b00) AM_READ_PORT("DSW1") AM_WRITE(ironhors_flipscreen_w)
  109      AM_RANGE(0x0b01, 0x0b01) AM_READ_PORT("DSW2") //AM_WRITE(ironhors_palettebank_w)
  110      AM_RANGE(0x0b02, 0x0b02) AM_READ_PORT("P1")
  111      AM_RANGE(0x0b03, 0x0b03) AM_READ_PORT("SYSTEM")
  112  
  113  
  114  
  115      AM_RANGE(0x1800, 0x1800) AM_WRITE(ironhors_sh_irqtrigger_w)
  116      AM_RANGE(0x1a00, 0x1a00) AM_RAM AM_SHARE("int_enable")
  117      AM_RANGE(0x1a01, 0x1a01) AM_RAM_WRITE(ironhors_charbank_w)
  118      AM_RANGE(0x1a02, 0x1a02) AM_WRITE(ironhors_palettebank_w)
  119      AM_RANGE(0x0000, 0x1bff) AM_ROM
  120  //  AM_RANGE(0x1c00, 0x1fff) AM_RAM
  121      AM_RANGE(0x2000, 0x23ff) AM_RAM_WRITE(ironhors_colorram_w) AM_SHARE("colorram")
  122      AM_RANGE(0x2400, 0x27ff) AM_RAM_WRITE(ironhors_videoram_w) AM_SHARE("videoram")
  123      AM_RANGE(0x2800, 0x2fff) AM_RAM
  124      AM_RANGE(0x1c00, 0x1dff) AM_RAM AM_SHARE("spriteram2")
  125      AM_RANGE(0x3000, 0x38ff) AM_RAM
  126      AM_RANGE(0x1e00, 0x1eff) AM_RAM AM_SHARE("spriteram")
  127      AM_RANGE(0x3900, 0x3fff) AM_RAM
  128      AM_RANGE(0x4000, 0xffff) AM_ROM
  129  ADDRESS_MAP_END
  130  
  131  static ADDRESS_MAP_START( farwest_slave_map, AS_PROGRAM, 8, ironhors_state )
  132      AM_RANGE(0x0000, 0x3fff) AM_ROM
  133      AM_RANGE(0x4000, 0x43ff) AM_RAM
  134      AM_RANGE(0x8000, 0x8001) AM_DEVREADWRITE_LEGACY("ym2203", ym2203_r, ym2203_w)
  135  ADDRESS_MAP_END
  136  
  137  
  138  /*************************************
  139   *
  140   *  Input ports
  141   *
  142   *************************************/
  143  
  144  static INPUT_PORTS_START( dairesya )
  145      PORT_START("SYSTEM")
  146      KONAMI8_SYSTEM_UNK
  147  
  148      PORT_START("P1")
  149      KONAMI8_MONO_4WAY_B123_UNK
  150  
  151      PORT_START("P2")
  152      KONAMI8_COCKTAIL_4WAY_B123_UNK
  153  
  154      PORT_START("DSW1")
  155      KONAMI_COINAGE_LOC(DEF_STR( Free_Play ), "No Coin B", SW1)
  156      /* "No Coin B" = coins produce sound, but no effect on coin counter */
  157  
  158      PORT_START("DSW2")
  159      PORT_DIPNAME( 0x03, 0x02, DEF_STR( Lives ) )        PORT_DIPLOCATION("SW2:1,2")
  160      PORT_DIPSETTING(    0x03, "2" )
  161      PORT_DIPSETTING(    0x02, "3" )
  162      PORT_DIPSETTING(    0x01, "5" )
  163      PORT_DIPSETTING(    0x00, "7" )
  164      PORT_DIPNAME( 0x04, 0x00, DEF_STR( Cabinet ) )      PORT_DIPLOCATION("SW2:3")
  165      PORT_DIPSETTING(    0x00, DEF_STR( Upright ) )
  166      PORT_DIPSETTING(    0x04, DEF_STR( Cocktail ) )
  167      PORT_DIPNAME( 0x18, 0x18, DEF_STR( Bonus_Life ) )   PORT_DIPLOCATION("SW2:4,5")
  168      PORT_DIPSETTING(    0x18, "30K 70K+" )
  169      PORT_DIPSETTING(    0x10, "40K 80K+" )
  170      PORT_DIPSETTING(    0x08, "40K" )
  171      PORT_DIPSETTING(    0x00, "50K" )
  172      PORT_DIPNAME( 0x60, 0x40, DEF_STR( Difficulty ) )   PORT_DIPLOCATION("SW2:6,7")
  173      PORT_DIPSETTING(    0x60, DEF_STR( Easy ) )
  174      PORT_DIPSETTING(    0x40, DEF_STR( Normal ) )       // factory default (JP)
  175      PORT_DIPSETTING(    0x20, DEF_STR( Hard ) )         // factory default (US)
  176      PORT_DIPSETTING(    0x00, DEF_STR( Very_Hard ) )
  177      PORT_DIPNAME( 0x80, 0x00, DEF_STR( Demo_Sounds ) )  PORT_DIPLOCATION("SW2:8")
  178      PORT_DIPSETTING(    0x80, DEF_STR( Off ) )
  179      PORT_DIPSETTING(    0x00, DEF_STR( On ) )
  180  
  181      PORT_START("DSW3")
  182      PORT_DIPNAME( 0x01, 0x00, DEF_STR( Flip_Screen ) )  PORT_DIPLOCATION("SW3:1")
  183      PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
  184      PORT_DIPSETTING(    0x01, DEF_STR( On ) )
  185      PORT_DIPNAME( 0x02, 0x02, "Upright Controls" )      PORT_DIPLOCATION("SW3:2")
  186      PORT_DIPSETTING(    0x02, DEF_STR( Single ) )
  187      PORT_DIPSETTING(    0x00, DEF_STR( Dual ) )
  188      PORT_DIPNAME( 0x04, 0x04, "Button Layout" )         PORT_DIPLOCATION("SW3:3") // though US manual says unused
  189      PORT_DIPSETTING(    0x04, "Power Attack Squat" )
  190      PORT_DIPSETTING(    0x00, "Squat Attack Power" )
  191      PORT_BIT( 0xf8, IP_ACTIVE_LOW, IPT_UNUSED )
  192  INPUT_PORTS_END
  193  
  194  static INPUT_PORTS_START( ironhors )
  195      PORT_INCLUDE( dairesya )
  196  
  197      /* here button 3 for player 1 and 2 are exchanged */
  198      PORT_MODIFY("P1")
  199      PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_BUTTON3 ) PORT_COCKTAIL
  200  
  201      PORT_MODIFY("P2")
  202      PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_BUTTON3 )
  203  INPUT_PORTS_END
  204  
  205  
  206  
  207  /*************************************
  208   *
  209   *  Graphics definitions
  210   *
  211   *************************************/
  212  
  213  static const gfx_layout ironhors_charlayout =
  214  {
  215      8,8,
  216      RGN_FRAC(1,1),
  217      4,
  218      { 0, 1, 2, 3 },
  219      { 0*4, 1*4, 2*4, 3*4, 4*4, 5*4, 6*4, 7*4 },
  220      { 0*32, 1*32, 2*32, 3*32, 4*32, 5*32, 6*32, 7*32 },
  221      32*8
  222  };
  223  
  224  static const gfx_layout ironhors_spritelayout =
  225  {
  226      16,16,
  227      512,
  228      4,
  229      { 0, 1, 2, 3 },
  230      { 0*4, 1*4, 2*4, 3*4, 4*4, 5*4, 6*4, 7*4,
  231              32*8+0*4, 32*8+1*4, 32*8+2*4, 32*8+3*4, 32*8+4*4, 32*8+5*4, 32*8+6*4, 32*8+7*4 },
  232      { 0*32, 1*32, 2*32, 3*32, 4*32, 5*32, 6*32, 7*32,
  233              16*32, 17*32, 18*32, 19*32, 20*32, 21*32, 22*32, 23*32 },
  234      32*32
  235  };
  236  
  237  static GFXDECODE_START( ironhors )
  238      GFXDECODE_ENTRY( "gfx1", 0, ironhors_charlayout,         0, 16*8 )
  239      GFXDECODE_ENTRY( "gfx1", 0, ironhors_spritelayout, 16*8*16, 16*8 )
  240      GFXDECODE_ENTRY( "gfx1", 0, ironhors_charlayout,   16*8*16, 16*8 )  /* to handle 8x8 sprites */
  241  GFXDECODE_END
  242  
  243  
  244  static const gfx_layout farwest_charlayout =
  245  {
  246      8,8,    /* 8*8 characters */
  247      2048,   /* 2048 characters */
  248      4,  /* 4 bits per pixel */
  249      { 0, 2, 4, 6 }, /* the four bitplanes are packed in one byte */
  250      { 3*8+1, 3*8+0, 0*8+1, 0*8+0, 1*8+1, 1*8+0, 2*8+1, 2*8+0 },
  251      { 0*4*8, 1*4*8, 2*4*8, 3*4*8, 4*4*8, 5*4*8, 6*4*8, 7*4*8 },
  252      32*8    /* every char takes 32 consecutive bytes */
  253  };
  254  
  255  static const gfx_layout farwest_spritelayout =
  256  {
  257      16,16,  /* 16*16 sprites */
  258      512,    /* 512 sprites */
  259      4,  /* 4 bits per pixel */
  260      { 0, 512*32*8, 2*512*32*8, 3*512*32*8 },    /* the four bitplanes are separated */
  261      { 0, 1, 2, 3, 4, 5, 6, 7,
  262              16*8+0, 16*8+1, 16*8+2, 16*8+3, 16*8+4, 16*8+5, 16*8+6, 16*8+7 },
  263      { 0*8, 1*8, 2*8, 3*8, 4*8, 5*8, 6*8, 7*8,
  264              8*8, 9*8, 10*8, 11*8, 12*8, 13*8, 14*8, 15*8 },
  265      32*8    /* every sprite takes 32 consecutive bytes */
  266  };
  267  
  268  static const gfx_layout farwest_spritelayout2 =
  269  {
  270      8,8,    /* 8*8 characters */
  271      2048,   /* 2048 characters */
  272      4,  /* 4 bits per pixel */
  273      { 0, 2048*8*8, 2*2048*8*8, 3*2048*8*8 },    /* the four bitplanes are separated */
  274      { 0, 1, 2, 3, 4, 5, 6, 7 },
  275      { 0*8, 1*8, 2*8, 3*8, 4*8, 5*8, 6*8, 7*8 },
  276      8*8 /* every char takes 8 consecutive bytes */
  277  };
  278  
  279  static GFXDECODE_START( farwest )
  280      GFXDECODE_ENTRY( "gfx1", 0, farwest_charlayout,         0, 16*8 )
  281      GFXDECODE_ENTRY( "gfx2", 0, farwest_spritelayout, 16*8*16, 16*8 )
  282      GFXDECODE_ENTRY( "gfx2", 0, farwest_spritelayout2,16*8*16, 16*8 )  /* to handle 8x8 sprites */
  283  GFXDECODE_END
  284  
  285  
  286  /*************************************
  287   *
  288   *  Discrete sound
  289   *
  290   *************************************/
  291  
  292  static const discrete_mixer_desc ironhors_mixer_desc =
  293      {DISC_MIXER_IS_RESISTOR,
  294          {RES_K(2.2), RES_K(2.2), RES_K(2.2)},
  295          {0,0,0,0,0,0},  /* no variable resistors   */
  296          {0,0,0,0,0,0},  /* no node capacitors      */
  297          0, RES_K(1),   /* RF */
  298          0,
  299          0,
  300          0, 1};
  301  
  302  static const discrete_mixer_desc ironhors_mixer_desc_final =
  303      {DISC_MIXER_IS_RESISTOR,
  304          {RES_K(0.5), RES_K(1)},
  305          {0,0,0,0,0,0},  /* no variable resistors   */
  306          {CAP_U(4.7), CAP_U(4.7)},  /* node capacitors         */
  307          0, RES_K(1),   /* RF */
  308          0,
  309          0,
  310          0, 1};
  311  
  312  static DISCRETE_SOUND_START( ironhors )
  313  
  314      DISCRETE_INPUTX_STREAM(NODE_01, 0, 5.0, 0)
  315      DISCRETE_INPUTX_STREAM(NODE_02, 1, 5.0, 0)
  316      DISCRETE_INPUTX_STREAM(NODE_03, 2, 5.0, 0)
  317  
  318      DISCRETE_INPUTX_STREAM(NODE_04, 3, 1.0, 0)
  319  
  320      DISCRETE_INPUT_DATA(NODE_11)
  321      DISCRETE_INPUT_DATA(NODE_12)
  322      DISCRETE_INPUT_DATA(NODE_13)
  323  
  324      DISCRETE_RCFILTER_SW(NODE_21, 1, NODE_01, NODE_11, 1000, CAP_U(0.22), 0, 0, 0)
  325      DISCRETE_RCFILTER_SW(NODE_22, 1, NODE_02, NODE_12, 1000, CAP_U(0.22), 0, 0, 0)
  326      DISCRETE_RCFILTER_SW(NODE_23, 1, NODE_03, NODE_13, 1000, CAP_U(0.22), 0, 0, 0)
  327  
  328      DISCRETE_MIXER3(NODE_30, 1, NODE_21, NODE_22, NODE_23, &ironhors_mixer_desc)
  329  
  330      DISCRETE_RCFILTER(NODE_31,NODE_04, RES_K(1), CAP_N(33) )
  331      DISCRETE_MIXER2(NODE_33, 1, NODE_30, NODE_31, &ironhors_mixer_desc_final)
  332  
  333      DISCRETE_OUTPUT(NODE_33, 5.0 )
  334  
  335  DISCRETE_SOUND_END
  336  
  337  /*************************************
  338   *
  339   *  Machine driver
  340   *
  341   *************************************/
  342  
  343  static const ym2203_interface ym2203_config =
  344  {
  345      {
  346          AY8910_LEGACY_OUTPUT,
  347          AY8910_DEFAULT_LOADS,
  348          DEVCB_NULL,
  349          DEVCB_NULL,
  350          DEVCB_DRIVER_MEMBER(ironhors_state,ironhors_filter_w),
  351          DEVCB_NULL
  352      },
  353      DEVCB_NULL
  354  };
  355  
  356  
  357  void ironhors_state::machine_start()
  358  {
  359      m_maincpu = machine().device<cpu_device>("maincpu");
  360      m_soundcpu = machine().device<cpu_device>("soundcpu");
  361  
  362      save_item(NAME(m_palettebank));
  363      save_item(NAME(m_charbank));
  364      save_item(NAME(m_spriterambank));
  365  }
  366  
  367  void ironhors_state::machine_reset()
  368  {
  369      m_palettebank = 0;
  370      m_charbank = 0;
  371      m_spriterambank = 0;
  372  }
  373  
  374  static MACHINE_CONFIG_START( ironhors, ironhors_state )
  375  
  376      /* basic machine hardware */
  377      MCFG_CPU_ADD("maincpu", M6809,18432000/6)        /* 3.072 MHz??? mod by Shingo Suzuki 1999/10/15 */
  378      MCFG_CPU_PROGRAM_MAP(master_map)
  379      MCFG_TIMER_DRIVER_ADD_SCANLINE("scantimer", ironhors_state, ironhors_irq, "screen", 0, 1)
  380  
  381      MCFG_CPU_ADD("soundcpu",Z80,18432000/6)      /* 3.072 MHz */
  382      MCFG_CPU_PROGRAM_MAP(slave_map)
  383      MCFG_CPU_IO_MAP(slave_io_map)
  384  
  385  
  386      /* video hardware */
  387      MCFG_SCREEN_ADD("screen", RASTER)
  388      MCFG_SCREEN_REFRESH_RATE(30)
  389      MCFG_SCREEN_VBLANK_TIME(ATTOSECONDS_IN_USEC(0))
  390      MCFG_SCREEN_SIZE(32*8, 32*8)
  391      MCFG_SCREEN_VISIBLE_AREA(1*8, 31*8-1, 2*8, 30*8-1)
  392      MCFG_SCREEN_UPDATE_DRIVER(ironhors_state, screen_update_ironhors)
  393  
  394      MCFG_GFXDECODE(ironhors)
  395      MCFG_PALETTE_LENGTH(16*8*16+16*8*16)
  396  
  397  
  398      /* sound hardware */
  399      MCFG_SPEAKER_STANDARD_MONO("mono")
  400  
  401      MCFG_SOUND_ADD("ym2203", YM2203, 18432000/6)
  402      MCFG_SOUND_CONFIG(ym2203_config)
  403  
  404      MCFG_SOUND_ROUTE_EX(0, "disc_ih", 1.0, 0)
  405      MCFG_SOUND_ROUTE_EX(1, "disc_ih", 1.0, 1)
  406      MCFG_SOUND_ROUTE_EX(2, "disc_ih", 1.0, 2)
  407      MCFG_SOUND_ROUTE_EX(3, "disc_ih", 1.0, 3)
  408  
  409      MCFG_SOUND_ADD("disc_ih", DISCRETE, 0)
  410      MCFG_SOUND_CONFIG_DISCRETE(ironhors)
  411      MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.0)
  412  
  413  MACHINE_CONFIG_END
  414  
  415  TIMER_DEVICE_CALLBACK_MEMBER(ironhors_state::farwest_irq)
  416  {
  417      int scanline = param;
  418  
  419      if ((scanline % 2) == 1)
  420      {
  421          if (*m_interrupt_enable & 4)
  422              m_maincpu->set_input_line(M6809_FIRQ_LINE, HOLD_LINE);
  423      }
  424      else if ((scanline % 2) == 0)
  425      {
  426          if (*m_interrupt_enable & 1)
  427              m_maincpu->set_input_line(INPUT_LINE_NMI, PULSE_LINE);
  428      }
  429  }
  430  
  431  READ8_MEMBER(ironhors_state::farwest_soundlatch_r)
  432  {
  433      return soundlatch_byte_r(m_soundcpu->space(AS_PROGRAM), 0);
  434  }
  435  
  436  static const ym2203_interface farwest_ym2203_config =
  437  {
  438      {
  439          AY8910_LEGACY_OUTPUT,
  440          AY8910_DEFAULT_LOADS,
  441          DEVCB_NULL,
  442          DEVCB_DRIVER_MEMBER(ironhors_state,farwest_soundlatch_r),
  443          DEVCB_DRIVER_MEMBER(ironhors_state,ironhors_filter_w),
  444          DEVCB_NULL
  445      },
  446      DEVCB_NULL
  447  };
  448  
  449  
  450  
  451  static MACHINE_CONFIG_DERIVED( farwest, ironhors )
  452  
  453      MCFG_CPU_MODIFY("maincpu")
  454      MCFG_CPU_PROGRAM_MAP(farwest_master_map)
  455      MCFG_DEVICE_MODIFY("scantimer")
  456      MCFG_TIMER_DRIVER_CALLBACK(ironhors_state, farwest_irq)
  457  
  458      MCFG_CPU_MODIFY("soundcpu")
  459      MCFG_CPU_PROGRAM_MAP(farwest_slave_map)
  460      MCFG_CPU_IO_MAP(0)
  461  
  462      MCFG_GFXDECODE(farwest)
  463      MCFG_VIDEO_START_OVERRIDE(ironhors_state,farwest)
  464      MCFG_SCREEN_MODIFY("screen")
  465      MCFG_SCREEN_UPDATE_DRIVER(ironhors_state, screen_update_farwest)
  466  
  467      MCFG_SOUND_MODIFY("ym2203")
  468      MCFG_SOUND_CONFIG(farwest_ym2203_config)
  469  MACHINE_CONFIG_END
  470  
  471  
  472  
  473  /*************************************
  474   *
  475   *  ROM definition(s)
  476   *
  477   *************************************/
  478  
  479  ROM_START( ironhors )
  480      ROM_REGION( 0x10000, "maincpu", 0 )
  481      ROM_LOAD( "13c_h03.bin",  0x4000, 0x8000, CRC(24539af1) SHA1(1eb96a2cb03007665587d6ec114894ab4cafdb23) )
  482      ROM_LOAD( "12c_h02.bin",  0xc000, 0x4000, CRC(fab07f86) SHA1(9f599d32d473d873113b89f2b24a54a435dbcbe5) )
  483  
  484      ROM_REGION( 0x10000, "soundcpu", 0 )
  485      ROM_LOAD( "10c_h01.bin",  0x0000, 0x4000, CRC(2b17930f) SHA1(be7b21f050f6b74c75a33c9284455bbed5b03c63) )
  486  
  487      ROM_REGION( 0x20000, "gfx1", 0 )
  488      ROM_LOAD16_BYTE( "08f_h06.bin",  0x00000, 0x8000, CRC(f21d8c93) SHA1(4245fff5360e10441e11d0d207d510e5c317bb0e) )
  489      ROM_LOAD16_BYTE( "07f_h05.bin",  0x00001, 0x8000, CRC(60107859) SHA1(ab59b6be155d36811a37dc873abbd97cd0a4120d) )
  490      ROM_LOAD16_BYTE( "09f_h07.bin",  0x10000, 0x8000, CRC(c761ec73) SHA1(78266c9ff3ea74a59fd3ce84afb4f8a1164c8bba) )
  491      ROM_LOAD16_BYTE( "06f_h04.bin",  0x10001, 0x8000, CRC(c1486f61) SHA1(4b96aebe5d35fd1d73bde8576689addbb1ff66ed) )
  492  
  493      ROM_REGION( 0x0500, "proms", 0 )
  494      ROM_LOAD( "03f_h08.bin",  0x0000, 0x0100, CRC(9f6ddf83) SHA1(08a37182a974c5448156637f10fe60bfe5f225ad) ) /* palette red */
  495      ROM_LOAD( "04f_h09.bin",  0x0100, 0x0100, CRC(e6773825) SHA1(7523e7fa090d850fe79ff0069d3260c76645d65a) ) /* palette green */
  496      ROM_LOAD( "05f_h10.bin",  0x0200, 0x0100, CRC(30a57860) SHA1(3ec7535286c8bc65e203320f47e4ed6f1d3d61c9) ) /* palette blue */
  497      ROM_LOAD( "10f_h12.bin",  0x0300, 0x0100, CRC(5eb33e73) SHA1(f34916dc4617b0c48e0a7ac6ace97b35dfcf1c40) ) /* character lookup table */
  498      ROM_LOAD( "10f_h11.bin",  0x0400, 0x0100, CRC(a63e37d8) SHA1(1a0a76ecd14310125bdf41a8431d562ed498eb27) ) /* sprite lookup table */
  499  ROM_END
  500  
  501  ROM_START( dairesya )
  502      ROM_REGION( 0x10000, "maincpu", 0 )
  503      ROM_LOAD( "560-k03.13c",  0x4000, 0x8000, CRC(2ac6103b) SHA1(331e1be3f29df85d65081831c215743354d76778) )
  504      ROM_LOAD( "560-k02.12c",  0xc000, 0x4000, CRC(07bc13a9) SHA1(1d3a44ad41799f89bfa84cc05fbe0792e57305af) )
  505  
  506      ROM_REGION( 0x10000, "soundcpu", 0 )
  507      ROM_LOAD( "560-j01.10c",  0x0000, 0x4000, CRC(a203b223) SHA1(fd19ae55bda467a09151539be6dce3791c28f18a) )
  508  
  509      ROM_REGION( 0x20000, "gfx1", 0 )
  510      ROM_LOAD16_BYTE( "560-j06.8f",   0x00000, 0x8000, CRC(a6e8248d) SHA1(7df653bb3a2257c249c3cf2c3f4f324d687a6b39) )
  511      ROM_LOAD16_BYTE( "560-j05.7f",   0x00001, 0x8000, CRC(f75893d4) SHA1(dc71b912d9bf5104dc633f687c52043df37852f0) )
  512      ROM_LOAD16_BYTE( "560-k07.9f",   0x10000, 0x8000, CRC(c8a1b840) SHA1(753b6fcbb4b28bbb63a392cdef90568734eac9bd) )
  513      ROM_LOAD16_BYTE( "560-k04.6f",   0x10001, 0x8000, CRC(c883d856) SHA1(4c4f91b72dab841ec15ca62121ed0c0878dfff23) )
  514  
  515      ROM_REGION( 0x0500, "proms", 0 )
  516      ROM_LOAD( "03f_h08.bin",  0x0000, 0x0100, CRC(9f6ddf83) SHA1(08a37182a974c5448156637f10fe60bfe5f225ad) ) /* palette red */
  517      ROM_LOAD( "04f_h09.bin",  0x0100, 0x0100, CRC(e6773825) SHA1(7523e7fa090d850fe79ff0069d3260c76645d65a) ) /* palette green */
  518      ROM_LOAD( "05f_h10.bin",  0x0200, 0x0100, CRC(30a57860) SHA1(3ec7535286c8bc65e203320f47e4ed6f1d3d61c9) ) /* palette blue */
  519      ROM_LOAD( "10f_h12.bin",  0x0300, 0x0100, CRC(5eb33e73) SHA1(f34916dc4617b0c48e0a7ac6ace97b35dfcf1c40) ) /* character lookup table */
  520      ROM_LOAD( "10f_h11.bin",  0x0400, 0x0100, CRC(a63e37d8) SHA1(1a0a76ecd14310125bdf41a8431d562ed498eb27) ) /* sprite lookup table */
  521  ROM_END
  522  
  523  ROM_START( farwest )
  524      ROM_REGION( 0x12000, "maincpu", 0 ) /* 64k for code + 8k for extra ROM */
  525      ROM_LOAD( "ironhors.008", 0x04000, 0x4000, CRC(b1c8246c) SHA1(4ceb098bb0b4efcbe50bb4b23bd27a60dabf2b3e) )
  526      ROM_LOAD( "ironhors.009", 0x08000, 0x8000, CRC(ea34ecfc) SHA1(8c7f12e76d2b9eb592ebf1bfd3e16a6b130da8e5) )
  527      ROM_LOAD( "ironhors.007", 0x00000, 0x2000, CRC(471182b7) SHA1(48ff58cbbf971b257e8099ec331397cf73dc8325) )   /* don't know what this is for */
  528  
  529      ROM_REGION( 0x10000, "soundcpu", 0 )
  530      ROM_LOAD( "ironhors.010", 0x0000, 0x4000, CRC(a28231a6) SHA1(617e8fdf8129081c6a1bbbf140837a375a51da72) )
  531  
  532      ROM_REGION( 0x10000, "gfx1", 0 )
  533      ROM_LOAD( "ironhors.005", 0x00000, 0x8000, CRC(f77e5b83) SHA1(6c72732dc96c1652713b2aba6f0a2410f9457818) )
  534      ROM_LOAD( "ironhors.006", 0x08000, 0x8000, CRC(7bbc0b51) SHA1(9b4890f2d20a8ddf5ba3f4325df070509252e06e) )
  535  
  536      ROM_REGION( 0x10000, "gfx2", 0 )
  537      ROM_LOAD( "ironhors.001", 0x00000, 0x4000, CRC(a8fc21d3) SHA1(1e898aaccad1919bbacf8d7957f5a0761df20767) )
  538      ROM_LOAD( "ironhors.002", 0x04000, 0x4000, CRC(9c1e5593) SHA1(7d41d2224f0653e09d8728ccdec2df60f549e36e) )
  539      ROM_LOAD( "ironhors.003", 0x08000, 0x4000, CRC(3a0bf799) SHA1(b34d5c7edda06b8a579d6d390511781a43ffce83) )
  540      ROM_LOAD( "ironhors.004", 0x0c000, 0x4000, CRC(1fab18a3) SHA1(cc7ddf60b719e7c5a689f716ebee9bc04ade406a) )
  541  
  542      ROM_REGION( 0x0500, "proms", 0 )
  543      ROM_LOAD( "ironcol.003",  0x0000, 0x0100, CRC(3e3fca11) SHA1(c92737659f063889a2b210cfe5c294b8a4864489) ) /* palette red */
  544      ROM_LOAD( "ironcol.001",  0x0100, 0x0100, CRC(dfb13014) SHA1(d9f9a5bed1300faf7c3864d5c5ae07087de25824) ) /* palette green */
  545      ROM_LOAD( "ironcol.002",  0x0200, 0x0100, CRC(77c88430) SHA1(e3041945b14955de109a505d9aa9f79046bed6a8) ) /* palette blue */
  546      ROM_LOAD( "10f_h12.bin",  0x0300, 0x0100, CRC(5eb33e73) SHA1(f34916dc4617b0c48e0a7ac6ace97b35dfcf1c40) ) /* character lookup table */
  547      ROM_LOAD( "ironcol.005",  0x0400, 0x0100, CRC(15077b9c) SHA1(c7fe24e3d481150452ff774f3908510db9e28367) ) /* sprite lookup table */
  548  ROM_END
  549  
  550  
  551  /*************************************
  552   *
  553   *  Game driver(s)
  554   *
  555   *************************************/
  556  
  557  GAME( 1986, ironhors, 0,        ironhors, ironhors, driver_device, 0, ROT0, "Konami", "Iron Horse", 0 )
  558  GAME( 1986, dairesya, ironhors, ironhors, dairesya, driver_device, 0, ROT0, "Konami (Kawakusu license)", "Dai Ressya Goutou (Japan)", 0 )
  559  GAME( 1986, farwest,  ironhors, farwest,  ironhors, driver_device, 0, ROT0, "bootleg?", "Far West", GAME_NOT_WORKING )