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

    1  /***************************************************************************
    2  
    3      Atari Asteroids hardware
    4  
    5      Games supported:
    6          * Asteroids
    7          * Asteroids Deluxe
    8          * Lunar Lander
    9  
   10      Known bugs:
   11          * the ERROR message in Asteroids Deluxe self test is related to a pokey problem
   12  
   13  Information from a Tech Tip:
   14  
   15  Asteroids Modification:
   16  
   17  As a result of inquires regarding the achievement of extremely high scores on Asteroids,
   18  we have developed a modification that will accomplish the following:
   19    When the small flying saucer enters the screen, it fires immediately in the direction
   20      of the player. The missiles also have a wraparound capability.
   21    Originally, the program was entered so that the saucer would go one-sixth of the way
   22      across the screen before firing, without the wraparound capability.
   23  
   24  There are two revisions currently in the field, ROM revision 02 has the flip-flop capability,
   25    version 01 does not.
   26  Kits are available immediately from your Atari Distributor.  To determine which kit you
   27    require, check ROMs on your Asteroids PCB.  If ROM code is "-01" order kit no. 08-0303009.
   28    If ROM code is "-02", order no. 08-0303008.
   29  
   30  For kit 08-0303009 (from rev 01) swap the following:
   31  
   32   035127-01 --> 035127-02
   33   035143-01 --> 035143-02
   34   035144-01 --> 034144-04E
   35   035145-01 --> 034145-04E
   36  
   37  For kit 08-0303008 (from rev 02) swap the following:
   38  
   39   035144-02 --> 034144-04E
   40   035145-02 --> 034145-04E
   41  
   42    A rom set was found labeled:
   43  
   44      035144-02-03
   45      035145-02-03
   46  
   47    However, when dumped they matched the rev 02 set.
   48  
   49  There is not a rev 03 known or dumped. An Asteroids rev 03 is not mentioned in any known Atari docs found to date.
   50  
   51      Asteroids-deluxe state-prom added by HIGHWAYMAN.
   52      The prom pcb location is:C8 and is 256x4
   53      (i need to update the dump, this one is read in 8bit-mode)
   54  ****************************************************************************
   55  
   56      Asteroids Memory Map (preliminary)
   57  
   58      Asteroids settings:
   59  
   60      0 = OFF  1 = ON  X = Don't Care  $ = Atari suggests
   61  
   62  
   63      8 SWITCH DIP
   64      87654321
   65      --------
   66      XXXXXX11   English
   67      XXXXXX10   German
   68      XXXXXX01   French
   69      XXXXXX00   Spanish
   70      XXXXX1XX   4-ship game
   71      XXXXX0XX   3-ship game
   72      11XXXXXX   Free Play
   73      10XXXXXX   1 Coin  for 2 Plays
   74      01XXXXXX   1 Coin  for 1 Play
   75      00XXXXXX   2 Coins for 1 Play
   76  
   77      Asteroids Deluxe settings:
   78  
   79      0 = OFF  1 = ON  X = Don't Care  $ = Atari suggests
   80  
   81  
   82      8 SWITCH DIP (R5)
   83      87654321
   84      --------
   85      XXXXXX11   English $
   86      XXXXXX10   German
   87      XXXXXX01   French
   88      XXXXXX00   Spanish
   89      XXXX11XX   2-4 ships
   90      XXXX10XX   3-5 ships $
   91      XXXX01XX   4-6 ships
   92      XXXX00XX   5-7 ships
   93      XXX1XXXX   1-play minimum $
   94      XXX0XXXX   2-play minimum
   95      XX1XXXXX   Easier gameplay for first 30000 points +
   96      XX0XXXXX   Hard gameplay throughout the game      +
   97      11XXXXXX   Bonus ship every 10,000 points $ !
   98      10XXXXXX   Bonus ship every 12,000 points !
   99      01XXXXXX   Bonus ship every 15,000 points !
  100      00XXXXXX   No bonus ships (adds one ship at game start)
  101  
  102      + only with the newer romset
  103      ! not "every", but "at", e.g. only once.
  104  
  105      Thanks to Gregg Woodcock for the info.
  106  
  107      8 SWITCH DIP (L8)
  108      87654321
  109      --------
  110      XXXXXX11   Free Play
  111      XXXXXX10   1 Coin = 2 Plays
  112      XXXXXX01   1 Coin = 1 Play
  113      XXXXXX00   2 Coins = 1 Play $
  114      XXXX11XX   Right coin mech * 1 $
  115      XXXX10XX   Right coin mech * 4
  116      XXXX01XX   Right coin mech * 5
  117      XXXX00XX   Right coin mech * 6
  118      XXX1XXXX   Center coin mech * 1 $
  119      XXX0XXXX   Center coin mech * 2
  120      111XXXXX   No bonus coins
  121      110XXXXX   For every 2 coins inserted, game logic adds 1 more coin
  122      101XXXXX   For every 4 coins inserted, game logic adds 1 more coin
  123      100XXXXX   For every 4 coins inserted, game logic adds 2 more coins $
  124      011XXXXX   For every 5 coins inserted, game logic adds 1 more coin
  125  
  126  ****************************************************************************
  127  
  128      Lunar Lander Memory Map (preliminary)
  129  
  130      Lunar Lander settings:
  131  
  132      0 = OFF  1 = ON  x = Don't Care  $ = Atari suggests
  133  
  134  
  135      8 SWITCH DIP (P8) with -01 ROMs on PCB
  136      87654321
  137      --------
  138      11xxxxxx   450 fuel units per coin
  139      10xxxxxx   600 fuel units per coin
  140      01xxxxxx   750 fuel units per coin  $
  141      00xxxxxx   900 fuel units per coin
  142      xxx0xxxx   Free play
  143      xxx1xxxx   Coined play as determined by toggles 7 & 8  $
  144      xxxx00xx   German instructions
  145      xxxx01xx   Spanish instructions
  146      xxxx10xx   French instructions
  147      xxxx11xx   English instructions  $
  148      xxxxxx11   Right coin == 1 credit/coin  $
  149      xxxxxx10   Right coin == 4 credit/coin
  150      xxxxxx01   Right coin == 5 credit/coin
  151      xxxxxx00   Right coin == 6 credit/coin
  152                 (Left coin always registers 1 credit/coin)
  153  
  154  
  155      8 SWITCH DIP (P8) with -02 ROMs on PCB
  156      87654321
  157      --------
  158      11x1xxxx   450 fuel units per coin
  159      10x1xxxx   600 fuel units per coin
  160      01x1xxxx   750 fuel units per coin  $
  161      00x1xxxx   900 fuel units per coin
  162      11x0xxxx   1100 fuel units per coin
  163      10x0xxxx   1300 fuel units per coin
  164      01x0xxxx   1550 fuel units per coin
  165      00x0xxxx   1800 fuel units per coin
  166      xx0xxxxx   Free play
  167      xx1xxxxx   Coined play as determined by toggles 5, 7, & 8  $
  168      xxxx00xx   German instructions
  169      xxxx01xx   Spanish instructions
  170      xxxx10xx   French instructions
  171      xxxx11xx   English instructions  $
  172      xxxxxx11   Right coin == 1 credit/coin  $
  173      xxxxxx10   Right coin == 4 credit/coin
  174      xxxxxx01   Right coin == 5 credit/coin
  175      xxxxxx00   Right coin == 6 credit/coin
  176                 (Left coin always registers 1 credit/coin)
  177  
  178     DIP locations verified from manual for:
  179      - asteroid
  180      - llander
  181      - llander1
  182      - astdelux
  183  
  184  ***************************************************************************/
  185  
  186  #include "emu.h"
  187  #include "cpu/m6502/m6502.h"
  188  #include "video/vector.h"
  189  #include "video/avgdvg.h"
  190  #include "machine/atari_vg.h"
  191  #include "includes/asteroid.h"
  192  #include "sound/discrete.h"
  193  #include "sound/pokey.h"
  194  
  195  #include "astdelux.lh"
  196  
  197  #define MASTER_CLOCK (XTAL_12_096MHz)
  198  #define CLOCK_3KHZ  (MASTER_CLOCK / 4096)
  199  
  200  /*************************************
  201   *
  202   *  Coin counters
  203   *
  204   *************************************/
  205  
  206  WRITE8_MEMBER(asteroid_state::astdelux_coin_counter_w)
  207  {
  208      coin_counter_w(machine(), offset,data);
  209  }
  210  
  211  
  212  
  213  /*************************************
  214   *
  215   *  Lunar Lander LEDs/lamps
  216   *
  217   *************************************/
  218  
  219  WRITE8_MEMBER(asteroid_state::llander_led_w)
  220  {
  221      static const char *const lampname[] =
  222      {
  223          "lamp0", "lamp1", "lamp2", "lamp3", "lamp4"
  224      };
  225      int i;
  226  
  227      for (i = 0; i < 5; i++)
  228          output_set_value(lampname[i], (data >> (4 - i)) & 1);
  229  }
  230  
  231  
  232  /*************************************
  233   *
  234   *  Main CPU memory handlers
  235   *
  236   *************************************/
  237  
  238  static ADDRESS_MAP_START( asteroid_map, AS_PROGRAM, 8, asteroid_state )
  239      ADDRESS_MAP_GLOBAL_MASK(0x7fff)
  240      AM_RANGE(0x0000, 0x01ff) AM_RAM
  241      AM_RANGE(0x0200, 0x02ff) AM_RAMBANK("bank1") AM_SHARE("ram1")
  242      AM_RANGE(0x0300, 0x03ff) AM_RAMBANK("bank2") AM_SHARE("ram2")
  243      AM_RANGE(0x2000, 0x2007) AM_READ(asteroid_IN0_r)    /* IN0 */
  244      AM_RANGE(0x2400, 0x2407) AM_READ(asteroid_IN1_r)    /* IN1 */
  245      AM_RANGE(0x2800, 0x2803) AM_READ(asteroid_DSW1_r)   /* DSW1 */
  246      AM_RANGE(0x3000, 0x3000) AM_WRITE_LEGACY(avgdvg_go_w)
  247      AM_RANGE(0x3200, 0x3200) AM_WRITE(asteroid_bank_switch_w)
  248      AM_RANGE(0x3400, 0x3400) AM_WRITE(watchdog_reset_w)
  249      AM_RANGE(0x3600, 0x3600) AM_WRITE(asteroid_explode_w)
  250      AM_RANGE(0x3a00, 0x3a00) AM_WRITE(asteroid_thump_w)
  251      AM_RANGE(0x3c00, 0x3c05) AM_WRITE(asteroid_sounds_w)
  252      AM_RANGE(0x3e00, 0x3e00) AM_WRITE(asteroid_noise_reset_w)
  253      AM_RANGE(0x4000, 0x47ff) AM_RAM AM_SHARE("vectorram") AM_REGION("maincpu", 0x4000)
  254      AM_RANGE(0x5000, 0x57ff) AM_ROM                     /* vector rom */
  255      AM_RANGE(0x6800, 0x7fff) AM_ROM
  256  ADDRESS_MAP_END
  257  
  258  
  259  static ADDRESS_MAP_START( astdelux_map, AS_PROGRAM, 8, asteroid_state )
  260      ADDRESS_MAP_GLOBAL_MASK(0x7fff)
  261      AM_RANGE(0x0000, 0x01ff) AM_RAM
  262      AM_RANGE(0x0200, 0x02ff) AM_RAMBANK("bank1") AM_SHARE("ram1")
  263      AM_RANGE(0x0300, 0x03ff) AM_RAMBANK("bank2") AM_SHARE("ram2")
  264      AM_RANGE(0x2000, 0x2007) AM_READ(asteroid_IN0_r)    /* IN0 */
  265      AM_RANGE(0x2400, 0x2407) AM_READ(asteroid_IN1_r)    /* IN1 */
  266      AM_RANGE(0x2800, 0x2803) AM_READ(asteroid_DSW1_r)   /* DSW1 */
  267      AM_RANGE(0x2c00, 0x2c0f) AM_DEVREADWRITE("pokey", pokey_device, read, write)
  268      AM_RANGE(0x2c40, 0x2c7f) AM_DEVREAD("earom", atari_vg_earom_device, read)
  269      AM_RANGE(0x3000, 0x3000) AM_WRITE_LEGACY(avgdvg_go_w)
  270      AM_RANGE(0x3200, 0x323f) AM_DEVWRITE("earom", atari_vg_earom_device, write)
  271      AM_RANGE(0x3400, 0x3400) AM_WRITE(watchdog_reset_w)
  272      AM_RANGE(0x3600, 0x3600) AM_WRITE(asteroid_explode_w)
  273      AM_RANGE(0x3a00, 0x3a00) AM_DEVWRITE("earom", atari_vg_earom_device, ctrl_w)
  274      AM_RANGE(0x3c00, 0x3c01) AM_WRITE(astdelux_led_w)
  275      AM_RANGE(0x3c03, 0x3c03) AM_WRITE(astdelux_sounds_w)
  276      AM_RANGE(0x3c04, 0x3c04) AM_WRITE(astdelux_bank_switch_w)
  277      AM_RANGE(0x3c05, 0x3c07) AM_WRITE(astdelux_coin_counter_w)
  278      AM_RANGE(0x3e00, 0x3e00) AM_WRITE(asteroid_noise_reset_w)
  279      AM_RANGE(0x4000, 0x47ff) AM_RAM AM_SHARE("vectorram") AM_REGION("maincpu", 0x4000)
  280      AM_RANGE(0x4800, 0x57ff) AM_ROM                     /* vector rom */
  281      AM_RANGE(0x6000, 0x7fff) AM_ROM
  282  ADDRESS_MAP_END
  283  
  284  
  285  static ADDRESS_MAP_START( llander_map, AS_PROGRAM, 8, asteroid_state )
  286      ADDRESS_MAP_GLOBAL_MASK(0x7fff)
  287      AM_RANGE(0x0000, 0x00ff) AM_RAM AM_MIRROR(0x1f00)
  288      AM_RANGE(0x2000, 0x2000) AM_READ_PORT("IN0")
  289      AM_RANGE(0x2400, 0x2407) AM_READ(asteroid_IN1_r)    /* IN1 */
  290      AM_RANGE(0x2800, 0x2803) AM_READ(asteroid_DSW1_r)   /* DSW1 */
  291      AM_RANGE(0x2c00, 0x2c00) AM_READ_PORT("THRUST")
  292      AM_RANGE(0x3000, 0x3000) AM_WRITE_LEGACY(avgdvg_go_w)
  293      AM_RANGE(0x3200, 0x3200) AM_WRITE(llander_led_w)
  294      AM_RANGE(0x3400, 0x3400) AM_WRITE(watchdog_reset_w)
  295      AM_RANGE(0x3c00, 0x3c00) AM_WRITE(llander_sounds_w)
  296      AM_RANGE(0x3e00, 0x3e00) AM_WRITE(llander_snd_reset_w)
  297      AM_RANGE(0x4000, 0x47ff) AM_RAM AM_SHARE("vectorram") AM_REGION("maincpu", 0x4000)
  298      AM_RANGE(0x4800, 0x5fff) AM_ROM                     /* vector rom */
  299      AM_RANGE(0x6000, 0x7fff) AM_ROM
  300  ADDRESS_MAP_END
  301  
  302  
  303  
  304  /*************************************
  305   *
  306   *  Port definitions
  307   *
  308   *************************************/
  309  
  310  CUSTOM_INPUT_MEMBER(asteroid_state::clock_r)
  311  {
  312      return (machine().device<cpu_device>("maincpu")->total_cycles() & 0x100) ? 1 : 0;
  313  }
  314  
  315  static INPUT_PORTS_START( asteroid )
  316      PORT_START("IN0")
  317      PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_UNKNOWN )
  318      /* Bit 2 is the 3 KHz source and Bit 3 the VG_HALT bit    */
  319      PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM_MEMBER(DEVICE_SELF, asteroid_state,clock_r, NULL)
  320      PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_SPECIAL ) PORT_CUSTOM(avgdvg_done_r, NULL)
  321      PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_BUTTON5 ) PORT_CODE(KEYCODE_SPACE) PORT_CODE(JOYCODE_BUTTON3)       /* hyperspace */
  322      PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_BUTTON3 ) PORT_CODE(KEYCODE_LCONTROL) PORT_CODE(JOYCODE_BUTTON1)    /* fire */
  323      PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_SERVICE ) PORT_NAME("Diagnostic Step") PORT_CODE(KEYCODE_F1)
  324      PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_TILT )
  325      PORT_SERVICE( 0x80, IP_ACTIVE_HIGH )
  326  
  327      PORT_START("IN1")
  328      PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_COIN1 )
  329      PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_COIN2 )
  330      PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_COIN3 )
  331      PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_START1 )
  332      PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_START2 )
  333      PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_BUTTON4 ) PORT_CODE(KEYCODE_LALT) PORT_CODE(JOYCODE_BUTTON2)        /* thrust */
  334      PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_BUTTON2 ) PORT_CODE(KEYCODE_RIGHT) PORT_CODE(JOYCODE_X_RIGHT_SWITCH)/* right */
  335      PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_BUTTON1 ) PORT_CODE(KEYCODE_LEFT) PORT_CODE(JOYCODE_X_LEFT_SWITCH)  /* left */
  336  
  337      PORT_START("DSW1")
  338      PORT_DIPNAME( 0x03, 0x00, DEF_STR( Language ) ) PORT_DIPLOCATION("SW:1,2")
  339      PORT_DIPSETTING (   0x00, DEF_STR( English ) )
  340      PORT_DIPSETTING (   0x01, DEF_STR( German ) )
  341      PORT_DIPSETTING (   0x02, DEF_STR( French ) )
  342      PORT_DIPSETTING (   0x03, DEF_STR( Spanish ) )
  343      PORT_DIPNAME( 0x04, 0x04, DEF_STR( Lives ) )    PORT_DIPLOCATION("SW:3")
  344      PORT_DIPSETTING (   0x04, "3" )
  345      PORT_DIPSETTING (   0x00, "4" )
  346      PORT_DIPNAME( 0x08, 0x00, "Center Mech" )       PORT_DIPLOCATION("SW:4") /* Left/Center for 3-door mech */
  347      PORT_DIPSETTING (   0x00, "X 1" )
  348      PORT_DIPSETTING (   0x08, "X 2" )
  349      PORT_DIPNAME( 0x30, 0x00, "Right Mech" )        PORT_DIPLOCATION("SW:5,6")
  350      PORT_DIPSETTING (   0x00, "X 1" )
  351      PORT_DIPSETTING (   0x10, "X 4" )
  352      PORT_DIPSETTING (   0x20, "X 5" )
  353      PORT_DIPSETTING (   0x30, "X 6" )
  354      PORT_DIPNAME( 0xc0, 0x80, DEF_STR( Coinage ) )  PORT_DIPLOCATION("SW:7,8")
  355      PORT_DIPSETTING (   0xc0, DEF_STR( 2C_1C ) )
  356      PORT_DIPSETTING (   0x80, DEF_STR( 1C_1C ) )
  357      PORT_DIPSETTING (   0x40, DEF_STR( 1C_2C ) )
  358      PORT_DIPSETTING (   0x00, DEF_STR( Free_Play ) )
  359  INPUT_PORTS_END
  360  
  361  
  362  static INPUT_PORTS_START( asteroidb )
  363      PORT_INCLUDE( asteroid )
  364  
  365      PORT_MODIFY("IN0")
  366      PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_UNKNOWN )    /* resets */
  367      PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_UNKNOWN )    /* resets */
  368      PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_TILT )
  369      PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_UNKNOWN )
  370      PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_UNKNOWN )
  371      PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_UNKNOWN )
  372      PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNKNOWN )
  373      /* Bit 7 is VG_HALT */
  374      PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_SPECIAL ) PORT_CUSTOM(avgdvg_done_r, NULL)
  375  
  376      PORT_MODIFY("IN1")
  377      PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_START1 )
  378      PORT_BIT( 0x02, IP_ACTIVE_LOW,  IPT_COIN1 )
  379      PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_BUTTON4 ) PORT_CODE(KEYCODE_LALT) PORT_CODE(JOYCODE_BUTTON2)            /* thrust */
  380      PORT_BIT( 0x08, IP_ACTIVE_LOW,  IPT_COIN2 )
  381      PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_BUTTON3 ) PORT_CODE(KEYCODE_LCONTROL) PORT_CODE(JOYCODE_BUTTON1)        /* fire */
  382  
  383      PORT_MODIFY("DSW1")
  384      PORT_DIPUNKNOWN_DIPLOC( 0x08, 0x08, "SW:4" )
  385      PORT_DIPUNKNOWN_DIPLOC( 0x10, 0x10, "SW:5" )
  386      PORT_DIPUNKNOWN_DIPLOC( 0x20, 0x20, "SW:6" )
  387  
  388      PORT_START("HS") /* hyperspace */
  389      PORT_BIT( 0x7f, IP_ACTIVE_LOW, IPT_UNUSED )
  390      PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_BUTTON5 ) PORT_CODE(KEYCODE_SPACE) PORT_CODE(JOYCODE_BUTTON3)            /* hyperspace */
  391  INPUT_PORTS_END
  392  
  393  
  394  static INPUT_PORTS_START( asterock )
  395      PORT_INCLUDE( asteroid )
  396  
  397      PORT_MODIFY("IN0")
  398      /* Bit 0 is VG_HALT and Bit 2 is the 3 KHz source */
  399      PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_SPECIAL ) PORT_CUSTOM(avgdvg_done_r, NULL)
  400      PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_UNKNOWN )
  401      PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM_MEMBER(DEVICE_SELF, asteroid_state,clock_r, NULL)
  402      PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_BUTTON5 ) PORT_CODE(KEYCODE_SPACE) PORT_CODE(JOYCODE_BUTTON3)        /* hyperspace */
  403      PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_BUTTON3 ) PORT_CODE(KEYCODE_LCONTROL) PORT_CODE(JOYCODE_BUTTON1)     /* fire */
  404      PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_SERVICE ) PORT_NAME("Diagnostic Step") PORT_CODE(KEYCODE_F1)
  405      PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_TILT )
  406      PORT_SERVICE( 0x80, IP_ACTIVE_LOW )
  407  
  408      PORT_MODIFY("DSW1")
  409      PORT_DIPNAME( 0x03, 0x03, DEF_STR( Language ) )                 PORT_DIPLOCATION("SW:1,2")
  410      PORT_DIPSETTING(    0x00, DEF_STR( English ) )
  411      PORT_DIPSETTING(    0x01, DEF_STR( French ) )
  412      PORT_DIPSETTING(    0x02, DEF_STR( German ) )
  413      PORT_DIPSETTING(    0x03, DEF_STR( Italian ) )
  414      PORT_DIPNAME( 0x0c, 0x04, DEF_STR( Lives ) )                    PORT_DIPLOCATION("SW:3,4")
  415      PORT_DIPSETTING(    0x00, "2" )
  416      PORT_DIPSETTING(    0x04, "3" )
  417      PORT_DIPSETTING(    0x08, "4" )
  418      PORT_DIPSETTING(    0x0c, "5" )
  419      PORT_DIPNAME( 0x10, 0x00, "Records Table" )                     PORT_DIPLOCATION("SW:5")
  420      PORT_DIPSETTING(    0x00, DEF_STR( Normal ) )
  421      PORT_DIPSETTING(    0x10, "Special" )
  422      PORT_DIPNAME( 0x20, 0x00, "Coin Mode" )                         PORT_DIPLOCATION("SW:6")
  423      PORT_DIPSETTING (   0x00, DEF_STR( Normal ) )
  424      PORT_DIPSETTING (   0x20, "Special" )
  425      PORT_DIPNAME( 0xc0, 0x80, DEF_STR( Coinage ) )                  PORT_DIPLOCATION("SW:7,8")
  426      PORT_DIPSETTING (   0xc0, DEF_STR( 2C_1C ) )                    PORT_CONDITION("DSW1",0x20,EQUALS,0x00)
  427      PORT_DIPSETTING (   0x80, DEF_STR( 1C_1C ) )                    PORT_CONDITION("DSW1",0x20,EQUALS,0x00)
  428      PORT_DIPSETTING (   0x40, DEF_STR( 1C_2C ) )                    PORT_CONDITION("DSW1",0x20,EQUALS,0x00)
  429  //  PORT_DIPSETTING (   0x00, DEF_STR( 1C_1C ) )                    PORT_CONDITION("DSW1",0x20,EQUALS,0x00)
  430      PORT_DIPSETTING (   0xc0, "Coin A 2/1 Coin B 2/1 Coin C 1/1" )  PORT_CONDITION("DSW1",0x20,NOTEQUALS,0x00)
  431      PORT_DIPSETTING (   0x80, "Coin A 1/1 Coin B 1/1 Coin C 1/2" )  PORT_CONDITION("DSW1",0x20,NOTEQUALS,0x00)
  432      PORT_DIPSETTING (   0x40, "Coin A 1/2 Coin B 1/2 Coin C 1/4" )  PORT_CONDITION("DSW1",0x20,NOTEQUALS,0x00)
  433  //  PORT_DIPSETTING (   0x00, "Coin A 1/1 Coin B 1/1 Coin C 1/2" )  PORT_CONDITION("DSW1",0x20,NOTEQUALS,0x00)
  434  INPUT_PORTS_END
  435  
  436  
  437  static INPUT_PORTS_START( astdelux )
  438      PORT_START("IN0")
  439      PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_UNUSED ) /* According to schematics */
  440      /* Bit 2 is the 3 KHz source and Bit 3 the VG_HALT bit    */
  441      PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM_MEMBER(DEVICE_SELF, asteroid_state,clock_r, NULL)
  442      PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_SPECIAL ) PORT_CUSTOM(avgdvg_done_r, NULL)
  443      PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_BUTTON5 ) PORT_CODE(KEYCODE_SPACE) PORT_CODE(JOYCODE_BUTTON3)       /* hyperspace */
  444      PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_BUTTON3 ) PORT_CODE(KEYCODE_LCONTROL) PORT_CODE(JOYCODE_BUTTON1)    /* fire */
  445      PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_SERVICE ) PORT_NAME("Diagnostic Step") PORT_CODE(KEYCODE_F1)
  446      PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_TILT )
  447      PORT_SERVICE( 0x80, IP_ACTIVE_HIGH )
  448  
  449      PORT_START("IN1")
  450      PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_COIN1 ) /* Coin Left */
  451      PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_COIN2 ) /* Coin Center */
  452      PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_COIN3 ) /* Coin Right */
  453      PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_START1 )
  454      PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_START2 )
  455      PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_BUTTON4 ) PORT_CODE(KEYCODE_LALT) PORT_CODE(JOYCODE_BUTTON2)        /* thrust */
  456      PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_BUTTON2 ) PORT_CODE(KEYCODE_RIGHT) PORT_CODE(JOYCODE_X_RIGHT_SWITCH)/* right */
  457      PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_BUTTON1 ) PORT_CODE(KEYCODE_LEFT) PORT_CODE(JOYCODE_X_LEFT_SWITCH)  /* left */
  458  
  459      PORT_START("DSW1")
  460      PORT_DIPNAME( 0x03, 0x00, DEF_STR( Language ) )     PORT_DIPLOCATION("R5:1,2")
  461      PORT_DIPSETTING (   0x00, DEF_STR( English ) )
  462      PORT_DIPSETTING (   0x01, DEF_STR( German ) )
  463      PORT_DIPSETTING (   0x02, DEF_STR( French ) )
  464      PORT_DIPSETTING (   0x03, DEF_STR( Spanish ) )
  465      /*  Default lives is 2,3,4,5. Values incremented by 1 if Bonus Life set to None or Coinage set to 2C_1C.
  466          Incremented by 2 if both are set at the same time. PORT_CONDITION() can only test for 1 switch at a time. */
  467      PORT_DIPNAME( 0x0c, 0x00, DEF_STR( Lives ) )        PORT_DIPLOCATION("R5:3,4") /* Default is 2 or 3 depending on manual version */
  468      PORT_DIPSETTING (   0x00, "2-4" )
  469      PORT_DIPSETTING (   0x04, "3-5" )
  470      PORT_DIPSETTING (   0x08, "4-6" )
  471      PORT_DIPSETTING (   0x0c, "5-7" )
  472      PORT_DIPNAME( 0x10, 0x00, "Minimum Plays" )         PORT_DIPLOCATION("R5:5")
  473      PORT_DIPSETTING (   0x00, "1" )
  474      PORT_DIPSETTING (   0x10, "2" )
  475      PORT_DIPNAME( 0x20, 0x00, DEF_STR( Difficulty ) )   PORT_DIPLOCATION("R5:6") /* Listed as "Unused" */
  476      PORT_DIPSETTING (   0x00, DEF_STR( Hard ) )
  477      PORT_DIPSETTING (   0x20, DEF_STR( Easy ) )
  478      PORT_DIPNAME( 0xc0, 0x00, DEF_STR( Bonus_Life ) )   PORT_DIPLOCATION("R5:7,8")
  479      PORT_DIPSETTING (   0x00, "10000" )
  480      PORT_DIPSETTING (   0x40, "12000" )
  481      PORT_DIPSETTING (   0x80, "15000" )
  482      PORT_DIPSETTING (   0xc0, DEF_STR( None ) )
  483  
  484      PORT_START("DSW2")
  485      PORT_DIPNAME( 0x03, 0x01, DEF_STR( Coinage ) )      PORT_DIPLOCATION("L8:1,2")
  486      PORT_DIPSETTING (   0x00, DEF_STR( 2C_1C ) )
  487      PORT_DIPSETTING (   0x01, DEF_STR( 1C_1C ) )
  488      PORT_DIPSETTING (   0x02, DEF_STR( 1C_2C ) )
  489      PORT_DIPSETTING (   0x03, DEF_STR( Free_Play ) )
  490      PORT_DIPNAME( 0x0c, 0x0c, "Right Coin" )            PORT_DIPLOCATION("L8:3,4")
  491      PORT_DIPSETTING (   0x00, "X 6" )
  492      PORT_DIPSETTING (   0x04, "X 5" )
  493      PORT_DIPSETTING (   0x08, "X 4" )
  494      PORT_DIPSETTING (   0x0c, "X 1" )
  495      PORT_DIPNAME( 0x10, 0x10, "Center Coin" )           PORT_DIPLOCATION("L8:5") /* "Left Coin" in a 2-mech door */
  496      PORT_DIPSETTING (   0x00, "X 2" )
  497      PORT_DIPSETTING (   0x10, "X 1" )
  498      PORT_DIPNAME( 0xe0, 0xe0, "Bonus Coins" )           PORT_DIPLOCATION("L8:6,7,8")
  499      PORT_DIPSETTING (   0x60, "1 Coin Each 5 Coins" )
  500      PORT_DIPSETTING (   0x80, "2 Coins Each 4 Coins" )
  501      PORT_DIPSETTING (   0xa0, "1 Coin Each 4 Coins" )
  502      PORT_DIPSETTING (   0xc0, "1 Coin Each 2 Coins" )
  503      PORT_DIPSETTING (   0xe0, DEF_STR( None ) )
  504  
  505      /* The manual includes a 3rd DIP controlling the number & configuration of coin counters, defined as: */
  506  #if 0
  507      PORT_START("DSW3")                                  // 4-Toggle switch located on game PCB at M12
  508      PORT_DIPNAME( 0x03, 0x00, "Coin Counters" )             PORT_DIPLOCATION("M12:1,2")
  509      PORT_DIPSETTING (   0x00, "1=Left, Center & Right" )    // "For games having these coin doors: Thai 1Baht/1Baht, German 1DM/1DM, US 25c/25c,
  510                                                              // Belgian or French 5Fr/5Fr, Swiss or French 1Fr/1Fr, US 25c/25c/25c,
  511                                                              // Japanese 100Y/100Y, Swedish 1Kr/1Kr, UK 10P/10P, Australian 20c/20c, or Italian 100L/100L."
  512      PORT_DIPSETTING (   0x01, "1=Left & Center, 2=Right" )  // "For games having these coin doors: German 2DM/1DM, German 1DM/5DM, US 25c/25c/1$, or US 25c/1$."
  513      PORT_DIPSETTING (   0x02, "1=Left, 2=Center & Right" )  // "No coin door is currently designed for this configuration."
  514      PORT_DIPSETTING (   0x03, "1=Left, 2=Center, 3=Right" ) // "For games having these coin doors: German 1DM/2DM/5DM."
  515      PORT_DIPUNUSED_DIPLOC( 0x04, 0x04, "M12:3" )            // Listed as "Unused"
  516      PORT_DIPUNUSED_DIPLOC( 0x08, 0x08, "M12:4" )            // Listed as "Unused"
  517  #endif
  518  INPUT_PORTS_END
  519  
  520  
  521  static INPUT_PORTS_START( llander )
  522      PORT_START("IN0")
  523      /* Bit 0 is VG_HALT */
  524      PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM(avgdvg_done_r, NULL)
  525      PORT_SERVICE( 0x02, IP_ACTIVE_LOW )
  526      PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_TILT )
  527      /* Of the rest, Bit 6 is the 3KHz source. 3,4 and 5 are unknown */
  528      PORT_BIT( 0x38, IP_ACTIVE_LOW, IPT_UNKNOWN )
  529      PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM_MEMBER(DEVICE_SELF, asteroid_state,clock_r, NULL)
  530      PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_SERVICE ) PORT_NAME("Diagnostic Step") PORT_CODE(KEYCODE_F1)
  531  
  532      PORT_START("IN1")
  533      PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_START1 )
  534      PORT_BIT( 0x02, IP_ACTIVE_LOW,  IPT_COIN1 )
  535      PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_COIN2 )
  536      PORT_BIT( 0x08, IP_ACTIVE_LOW,  IPT_COIN3 )
  537      PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_START2 )  PORT_NAME("Select Game")
  538      PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_BUTTON3 ) PORT_NAME("Abort")
  539      PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_BUTTON2 ) PORT_CODE(KEYCODE_RIGHT) PORT_CODE(JOYCODE_X_RIGHT_SWITCH)    /* right */
  540      PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_BUTTON1 ) PORT_CODE(KEYCODE_LEFT) PORT_CODE(JOYCODE_X_LEFT_SWITCH)      /* left */
  541  
  542      PORT_START("DSW1")
  543      PORT_DIPNAME( 0x03, 0x00, "Right Coin" )            PORT_DIPLOCATION("P8:1,2") /* "Left Coin Mech always registers X 1" */
  544      PORT_DIPSETTING (   0x00, "X 1" )
  545      PORT_DIPSETTING (   0x01, "X 4" )
  546      PORT_DIPSETTING (   0x02, "X 5" )
  547      PORT_DIPSETTING (   0x03, "X 6" )
  548      PORT_DIPNAME( 0x0c, 0x00, DEF_STR( Language ) )     PORT_DIPLOCATION("P8:3,4")
  549      PORT_DIPSETTING (   0x00, DEF_STR( English ) )
  550      PORT_DIPSETTING (   0x04, DEF_STR( French ) )
  551      PORT_DIPSETTING (   0x08, DEF_STR( Spanish ) )
  552      PORT_DIPSETTING (   0x0c, DEF_STR( German ) )
  553      PORT_DIPNAME( 0x20, 0x00, DEF_STR( Coinage ) )      PORT_DIPLOCATION("P8:6")
  554      PORT_DIPSETTING (   0x00, DEF_STR( Normal ) )
  555      PORT_DIPSETTING (   0x20, DEF_STR( Free_Play ) )
  556      PORT_DIPNAME( 0xd0, 0x80, "Fuel Units Per Coin" )   PORT_DIPLOCATION("P8:5,7,8")
  557      PORT_DIPSETTING (   0x00, "450" )
  558      PORT_DIPSETTING (   0x40, "600" )
  559      PORT_DIPSETTING (   0x80, "750" )
  560      PORT_DIPSETTING (   0xc0, "900" )
  561      PORT_DIPSETTING (   0x10, "1100" )
  562      PORT_DIPSETTING (   0x50, "1300" )
  563      PORT_DIPSETTING (   0x90, "1550" )
  564      PORT_DIPSETTING (   0xd0, "1800" )
  565  
  566      /* The next one is a potentiometer */
  567      /* The way the DAC/counter circuit always tries to self center at the voltage derived from the thrust control, */
  568      /* I don't think it ever expected to get to 0xff. We can not emulate the external DAC circuit exactly, */
  569      /* so changing the range to 0xfe seems to solve the problem. */
  570      /* The thrust control is basically a hand operated pedal. */
  571      /* so IPT_PEDAL is used because it more accurately emulates the control then using IPT_PADDLE */
  572      PORT_START("THRUST")
  573      PORT_BIT( 0xff, 0x00, IPT_PEDAL ) PORT_MINMAX(0,254) PORT_SENSITIVITY(100) PORT_KEYDELTA(10)
  574  INPUT_PORTS_END
  575  
  576  
  577  static INPUT_PORTS_START( llander1 )
  578      PORT_INCLUDE( llander )
  579  
  580      PORT_MODIFY("DSW1")
  581      PORT_DIPNAME( 0x10, 0x00, DEF_STR( Coinage ) )      PORT_DIPLOCATION("P8:5") /* "Left Coin Mech always registers X 1" */
  582      PORT_DIPSETTING (   0x00, DEF_STR( Normal ) )
  583      PORT_DIPSETTING (   0x10, DEF_STR( Free_Play ) )
  584      PORT_DIPUNUSED_DIPLOC( 0x20, 0x20, "P8:6" )         /* Listed as "Unused" */
  585      PORT_DIPNAME( 0xc0, 0x80, "Fuel units" )            PORT_DIPLOCATION("P8:7,8")
  586      PORT_DIPSETTING (   0x00, "450" )
  587      PORT_DIPSETTING (   0x40, "600" )
  588      PORT_DIPSETTING (   0x80, "750" )
  589      PORT_DIPSETTING (   0xc0, "900" )
  590  INPUT_PORTS_END
  591  
  592  
  593  
  594  /*************************************
  595   *
  596   *  Sound interfaces
  597   *
  598   *************************************/
  599  
  600  static const pokey_interface pokey_config =
  601  {
  602      { DEVCB_NULL },
  603      DEVCB_INPUT_PORT("DSW2")
  604  };
  605  
  606  
  607  
  608  /*************************************
  609   *
  610   *  Machine drivers
  611   *
  612   *************************************/
  613  
  614  static MACHINE_CONFIG_START( asteroid, asteroid_state )
  615  
  616      /* basic machine hardware */
  617      MCFG_CPU_ADD("maincpu", M6502, MASTER_CLOCK/8)
  618      MCFG_CPU_PROGRAM_MAP(asteroid_map)
  619      MCFG_CPU_PERIODIC_INT_DRIVER(asteroid_state, asteroid_interrupt,  (double)MASTER_CLOCK/4096/12)
  620  
  621  
  622      /* video hardware */
  623      MCFG_SCREEN_ADD("screen", VECTOR)
  624      MCFG_SCREEN_REFRESH_RATE(60)
  625      MCFG_SCREEN_SIZE(400,300)
  626      MCFG_SCREEN_VISIBLE_AREA(522, 1566, 394, 1182)
  627      MCFG_SCREEN_UPDATE_STATIC(vector)
  628  
  629      MCFG_VIDEO_START(dvg)
  630  
  631      /* sound hardware */
  632      MCFG_SPEAKER_STANDARD_MONO("mono")
  633  
  634      MCFG_SOUND_ADD("discrete", DISCRETE, 0)
  635      MCFG_SOUND_CONFIG_DISCRETE(asteroid)
  636      MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.4)
  637  MACHINE_CONFIG_END
  638  
  639  static MACHINE_CONFIG_DERIVED( asterock, asteroid )
  640  
  641      /* basic machine hardware */
  642      MCFG_CPU_MODIFY("maincpu")
  643      MCFG_CPU_PERIODIC_INT_DRIVER(asteroid_state, asterock_interrupt,  (double)MASTER_CLOCK/4096/12)
  644  MACHINE_CONFIG_END
  645  
  646  
  647  static MACHINE_CONFIG_DERIVED( astdelux, asteroid )
  648  
  649      /* basic machine hardware */
  650      MCFG_CPU_MODIFY("maincpu")
  651      MCFG_CPU_PROGRAM_MAP(astdelux_map)
  652  
  653      MCFG_ATARIVGEAROM_ADD("earom")
  654  
  655      /* sound hardware */
  656      MCFG_SOUND_REPLACE("discrete", DISCRETE, 0)
  657      MCFG_SOUND_CONFIG_DISCRETE(astdelux)
  658      MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.0)
  659  
  660      MCFG_POKEY_ADD("pokey", MASTER_CLOCK/8)
  661      MCFG_POKEY_CONFIG(pokey_config)
  662      MCFG_POKEY_OUTPUT_RC(RES_K(10), CAP_U(0.015), 5.0)
  663      MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.0)
  664  MACHINE_CONFIG_END
  665  
  666  
  667  static MACHINE_CONFIG_DERIVED( llander, asteroid )
  668  
  669      /* basic machine hardware */
  670      MCFG_CPU_MODIFY("maincpu")
  671      MCFG_CPU_PROGRAM_MAP(llander_map)
  672      MCFG_CPU_PERIODIC_INT_DRIVER(asteroid_state, llander_interrupt,  (double)MASTER_CLOCK/4096/12)
  673  
  674      MCFG_MACHINE_RESET(avgdvg)
  675  
  676      MCFG_SCREEN_MODIFY("screen")
  677      MCFG_SCREEN_REFRESH_RATE(40)
  678      MCFG_SCREEN_VISIBLE_AREA(522, 1566, 270, 1070)
  679      MCFG_SCREEN_UPDATE_STATIC(vector)
  680  
  681      MCFG_VIDEO_START(dvg)
  682  
  683      /* sound hardware */
  684      MCFG_SOUND_REPLACE("discrete", DISCRETE, 0)
  685      MCFG_SOUND_CONFIG_DISCRETE(llander)
  686      MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.0)
  687  MACHINE_CONFIG_END
  688  
  689  
  690  
  691  /*************************************
  692   *
  693   *  ROM definitions
  694   *
  695   *************************************/
  696  
  697  ROM_START( asteroid )
  698      ROM_REGION( 0x8000, "maincpu", 0 )
  699      ROM_LOAD( "035145-04e.ef2", 0x6800, 0x0800, CRC(b503eaf7) SHA1(5369dcfe01c0b9e48b15a96a0de8d23ee8ef9145) )
  700      ROM_LOAD( "035144-04e.h2",  0x7000, 0x0800, CRC(25233192) SHA1(51b2865fa897cdaa84ac6500c4b4833a80827019) )
  701      ROM_LOAD( "035143-02.j2",   0x7800, 0x0800, CRC(312caa02) SHA1(1ce2eac1ab90b972e3f1fc3d250908f26328d6cb) )
  702      /* Vector ROM */
  703      ROM_LOAD( "035127-02.np3",  0x5000, 0x0800, CRC(8b71fd9e) SHA1(8cd5005e531eafa361d6b7e9eed159d164776c70) )
  704  
  705      /* DVG PROM */
  706      ROM_REGION( 0x100, "user1", 0 )
  707      ROM_LOAD( "034602-01.c8",   0x0000, 0x0100, CRC(97953db8) SHA1(8cbded64d1dd35b18c4d5cece00f77e7b2cab2ad) )
  708  ROM_END
  709  
  710  ROM_START( asteroid2 )
  711      ROM_REGION( 0x8000, "maincpu", 0 )
  712      ROM_LOAD( "035145-02.ef2",  0x6800, 0x0800, CRC(0cc75459) SHA1(2af85c9689b878155004da47fedbde5853a18723) )
  713      ROM_LOAD( "035144-02.h2",   0x7000, 0x0800, CRC(096ed35c) SHA1(064d680ded7f30c543f93ae5ca85f90d550f73e5) )
  714      ROM_LOAD( "035143-02.j2",   0x7800, 0x0800, CRC(312caa02) SHA1(1ce2eac1ab90b972e3f1fc3d250908f26328d6cb) )
  715      /* Vector ROM */
  716      ROM_LOAD( "035127-02.np3",  0x5000, 0x0800, CRC(8b71fd9e) SHA1(8cd5005e531eafa361d6b7e9eed159d164776c70) )
  717  
  718      /* DVG PROM */
  719      ROM_REGION( 0x100, "user1", 0 )
  720      ROM_LOAD( "034602-01.c8",   0x0000, 0x0100, CRC(97953db8) SHA1(8cbded64d1dd35b18c4d5cece00f77e7b2cab2ad) )
  721  ROM_END
  722  
  723  ROM_START( asteroid1 )
  724      ROM_REGION( 0x8000, "maincpu", 0 )
  725      ROM_LOAD( "035145-01.ef2",  0x6800, 0x0800, CRC(e9bfda64) SHA1(291dc567ebb31b35df83d9fb87f4080f251ff9c8) )
  726      ROM_LOAD( "035144-01.h2",   0x7000, 0x0800, CRC(e53c28a9) SHA1(d9f081e73511ec43377f0c6457747f15a470d4dc) )
  727      ROM_LOAD( "035143-01.j2",   0x7800, 0x0800, CRC(7d4e3d05) SHA1(d88000e904e158efde50e453e2889ecd2cb95f24) )
  728      /* Vector ROM */
  729      ROM_LOAD( "035127-01.np3",  0x5000, 0x0800, CRC(99699366) SHA1(9b2828fc1cef7727f65fa65e1e11e309b7c98792) )
  730  
  731      /* DVG PROM */
  732      ROM_REGION( 0x100, "user1", 0 )
  733      ROM_LOAD( "034602-01.c8",   0x0000, 0x0100, CRC(97953db8) SHA1(8cbded64d1dd35b18c4d5cece00f77e7b2cab2ad) )
  734  ROM_END
  735  
  736  ROM_START( asteroidb )
  737      ROM_REGION( 0x8000, "maincpu", 0 )
  738      ROM_LOAD( "035145ll.de1",  0x6800, 0x0800, CRC(605fc0f2) SHA1(8d897a3b75bd1f2537470f0a34a97a8c0853ee08) )
  739      ROM_LOAD( "035144ll.c1",   0x7000, 0x0800, CRC(e106de77) SHA1(003e99d095bd4df6fae243ea1dd5b12f3eb974f1) )
  740      ROM_LOAD( "035143ll.b1",   0x7800, 0x0800, CRC(6b1d8594) SHA1(ff3cd93f1bc5734bface285e442125b395602d7d) )
  741      /* Vector ROM */
  742      ROM_LOAD( "035127-01.np3", 0x5000, 0x0800, CRC(99699366) SHA1(9b2828fc1cef7727f65fa65e1e11e309b7c98792) )
  743  
  744      /* DVG PROM */
  745      ROM_REGION( 0x100, "user1", 0 )
  746      ROM_LOAD( "034602-01.c8",  0x0000, 0x0100, CRC(97953db8) SHA1(8cbded64d1dd35b18c4d5cece00f77e7b2cab2ad) )
  747  ROM_END
  748  
  749  ROM_START( asterock )
  750      ROM_REGION( 0x8000, "maincpu", 0 )
  751      ROM_LOAD( "10505.2",       0x6800, 0x0400, CRC(cdf720c6) SHA1(85fe748096478e28a06bd98ff3aad73ab21b22a4) )
  752      ROM_LOAD( "10505.3",       0x6c00, 0x0400, CRC(ee58bdf0) SHA1(80094cb5dafd327aff6658ede33106f0493a809d) )
  753      ROM_LOAD( "10505.4",       0x7000, 0x0400, CRC(8d3e421e) SHA1(5f5719ab84d4755e69bef205d313b455bc59c413) )
  754      ROM_LOAD( "10505.5",       0x7400, 0x0400, CRC(d2ce7672) SHA1(b6012e09b2439a614a55bcf23be0692c42830e21) )
  755      ROM_LOAD( "10505.6",       0x7800, 0x0400, CRC(74103c87) SHA1(e568b5ac573a6d0474cf672b3c62abfbd3320799) )
  756      ROM_LOAD( "10505.7",       0x7c00, 0x0400, CRC(75a39768) SHA1(bf22998fd692fb01964d8894e421435c55d746a0) )
  757      /* Vector ROM */
  758      ROM_LOAD( "10505.0",       0x5000, 0x0400, CRC(6bd2053f) SHA1(790f2858f44bbb1854e2d9d549e29f4815c4665b) )
  759      ROM_LOAD( "10505.1",       0x5400, 0x0400, CRC(231ce201) SHA1(710f4c19864d725ba1c9ea447a97e84001a679f7) )
  760  
  761      /* DVG PROM */
  762      ROM_REGION( 0x100, "user1", 0 )
  763      ROM_LOAD( "034602-01.c8",  0x0000, 0x0100, CRC(97953db8) SHA1(8cbded64d1dd35b18c4d5cece00f77e7b2cab2ad) )
  764  ROM_END
  765  
  766  ROM_START( asterockv )
  767      ROM_REGION( 0x8000, "maincpu", 0 )
  768      ROM_LOAD( "10505.2",       0x6800, 0x0400, CRC(cdf720c6) SHA1(85fe748096478e28a06bd98ff3aad73ab21b22a4) )
  769      ROM_LOAD( "10505.3",       0x6c00, 0x0400, CRC(ee58bdf0) SHA1(80094cb5dafd327aff6658ede33106f0493a809d) )
  770      ROM_LOAD( "10505.4",       0x7000, 0x0400, CRC(8d3e421e) SHA1(5f5719ab84d4755e69bef205d313b455bc59c413) )
  771      ROM_LOAD( "10505.5",       0x7400, 0x0400, CRC(d2ce7672) SHA1(b6012e09b2439a614a55bcf23be0692c42830e21) )
  772      ROM_LOAD( "10505.6",       0x7800, 0x0400, CRC(74103c87) SHA1(e568b5ac573a6d0474cf672b3c62abfbd3320799) )
  773      ROM_LOAD( "10505.7",       0x7c00, 0x0400, CRC(75a39768) SHA1(bf22998fd692fb01964d8894e421435c55d746a0) )
  774      /* Vector ROM */
  775      ROM_LOAD( "videotronas.0", 0x5000, 0x0400, CRC(d1ac90b5) SHA1(7209027d2099c75c6336605ae80491ffc5673674) ) // only this rom differs from Sidam's Asterock
  776      ROM_LOAD( "10505.1",       0x5400, 0x0400, CRC(231ce201) SHA1(710f4c19864d725ba1c9ea447a97e84001a679f7) )
  777  
  778      /* DVG PROM */
  779      ROM_REGION( 0x100, "user1", 0 )
  780      ROM_LOAD( "034602-01.c8",  0x0000, 0x0100, CRC(97953db8) SHA1(8cbded64d1dd35b18c4d5cece00f77e7b2cab2ad) )
  781  ROM_END
  782  
  783  ROM_START( meteorts )
  784      ROM_REGION( 0x8000, "maincpu", 0 )
  785      ROM_LOAD( "m0_c1.bin",    0x6800, 0x0800, CRC(dff88688) SHA1(7f4148a580fb6f605499c99e7dde7068eca1651a) )
  786      ROM_LOAD( "m1_f1.bin",    0x7000, 0x0800, CRC(e53c28a9) SHA1(d9f081e73511ec43377f0c6457747f15a470d4dc) )
  787      ROM_LOAD( "m2_j1.bin",    0x7800, 0x0800, CRC(64bd0408) SHA1(141d053cb4cce3fece98293136928b527d3ade0f) )
  788      /* Vector ROM */
  789      ROM_LOAD( "mv_np3.bin",   0x5000, 0x0800, CRC(11d1c4ae) SHA1(433c2c05b92094bbe102c356d7f1a907db13da67) )
  790  
  791      /* DVG PROM */
  792      ROM_REGION( 0x100, "user1", 0 )
  793      ROM_LOAD( "034602-01.c8",    0x0000, 0x0100, CRC(97953db8) SHA1(8cbded64d1dd35b18c4d5cece00f77e7b2cab2ad) )
  794  ROM_END
  795  
  796  ROM_START( meteorho )
  797      ROM_REGION( 0x8000, "maincpu", 0 )
  798      ROM_LOAD( "g.bin",    0x6800, 0x0400, CRC(7420421b) SHA1(e84a340c0cbc8816bbe43120bc8e692d2a3db0ab) )
  799      ROM_LOAD( "h.bin",    0x6c00, 0x0400, CRC(a6aa56bc) SHA1(8298e1667c3bd9af9e0be7d53c00d73ef59d742e) )
  800      ROM_LOAD( "f.bin",    0x7000, 0x0400, CRC(2711bd52) SHA1(219499b9b8dcc221173f9b9a34c9e6f2fb936231) )
  801      ROM_LOAD( "d.bin",    0x7400, 0x0400, CRC(9f169db9) SHA1(b6a4a8ea9d48c6b1faebf104faae7c67b2b060b5) )
  802      ROM_LOAD( "c.bin",    0x7800, 0x0400, CRC(bd99556a) SHA1(8c712b205125c0c2a45dbb4fa9e5e5302c5bbd1b) )
  803      ROM_LOAD( "e.bin",    0x7c00, 0x0400, CRC(10fdfe9a) SHA1(9db4b3ab904e66d3622ec98e13ef6baf5d4f7099) )
  804      /* Vector ROM */
  805      ROM_LOAD( "a.bin",    0x5000, 0x0400, CRC(d7822110) SHA1(bf6c5e622fdc16c39a1d8f23fc029abaa1e99b19) )
  806      ROM_LOAD( "b.bin",    0x5400, 0x0400, CRC(d62b2887) SHA1(8832953c7166d2f0ed1067c43ebf369db4a4aa70) )
  807  
  808      /* DVG PROM */
  809      ROM_REGION( 0x100, "user1", 0 )
  810      ROM_LOAD( "prom.bin",   0x0000, 0x0100, CRC(9e237193) SHA1(f663e12d5db0fa50ea49d03591475ae0a7168bc0) )
  811  ROM_END
  812  
  813  ROM_START( hyperspc )
  814      ROM_REGION( 0x8000, "maincpu", 0 )
  815      ROM_LOAD( "035145-01.bin",   0x6800, 0x0800, CRC(e9bfda64) SHA1(291dc567ebb31b35df83d9fb87f4080f251ff9c8) )
  816      ROM_LOAD( "035144-01.bin",   0x7000, 0x0800, CRC(e53c28a9) SHA1(d9f081e73511ec43377f0c6457747f15a470d4dc) )
  817      ROM_LOAD( "035143-01.bin",   0x7800, 0x0800, CRC(7d4e3d05) SHA1(d88000e904e158efde50e453e2889ecd2cb95f24) )
  818      /* Vector ROM */
  819      ROM_LOAD( "035127-01.bin",   0x5000, 0x0800, CRC(7dec48bd) SHA1(8bc926a763ff80b101b2e1c24d45615c3daf67d5) )
  820  
  821      /* DVG PROM */
  822      ROM_REGION( 0x100, "user1", 0 )
  823      ROM_LOAD( "034602-01.c8",   0x0000, 0x0100, CRC(97953db8) SHA1(8cbded64d1dd35b18c4d5cece00f77e7b2cab2ad) )
  824  ROM_END
  825  
  826  
  827  ROM_START( astdelux )
  828      ROM_REGION( 0x8000, "maincpu", 0 )
  829      ROM_LOAD( "036430-02.d1",  0x6000, 0x0800, CRC(a4d7a525) SHA1(abe262193ec8e1981be36928e9a89a8ac95cd0ad) )
  830      ROM_LOAD( "036431-02.ef1", 0x6800, 0x0800, CRC(d4004aae) SHA1(aa2099b8fc62a79879efeea70ea1e9ed77e3e6f0) )
  831      ROM_LOAD( "036432-02.fh1", 0x7000, 0x0800, CRC(6d720c41) SHA1(198218cd2f43f8b83e4463b1f3a8aa49da5015e4) )
  832      ROM_LOAD( "036433-03.j1",  0x7800, 0x0800, CRC(0dcc0be6) SHA1(bf10ffb0c4870e777d6b509cbede35db8bb6b0b8) )
  833      /* Vector ROM */
  834      ROM_LOAD( "036800-02.r2",  0x4800, 0x0800, CRC(bb8cabe1) SHA1(cebaa1b91b96e8b80f2b2c17c6fd31fa9f156386) )
  835      ROM_LOAD( "036799-01.np2", 0x5000, 0x0800, CRC(7d511572) SHA1(1956a12bccb5d3a84ce0c1cc10c6ad7f64e30b40) )
  836  
  837      /* DVG PROM */
  838      ROM_REGION( 0x100, "user1", 0 )
  839      ROM_LOAD( "034602-01.c8",  0x0000, 0x0100, CRC(97953db8) SHA1(8cbded64d1dd35b18c4d5cece00f77e7b2cab2ad) )
  840  ROM_END
  841  
  842  ROM_START( astdelux2 )
  843      ROM_REGION( 0x8000, "maincpu", 0 )
  844      ROM_LOAD( "036430-01.d1",  0x6000, 0x0800, CRC(8f5dabc6) SHA1(5d7543e19acab99ddb63c0ffd60f54d7a0f267f5) )
  845      ROM_LOAD( "036431-01.ef1", 0x6800, 0x0800, CRC(157a8516) SHA1(9041d8c2369d004f198681e02b59a923fa8f70c9) )
  846      ROM_LOAD( "036432-01.fh1", 0x7000, 0x0800, CRC(fdea913c) SHA1(ded0138a20d80317d67add5bb2a64e6274e0e409) )
  847      ROM_LOAD( "036433-02.j1",  0x7800, 0x0800, CRC(d8db74e3) SHA1(52b64e867df98d14742eb1817b59931bb7f941d9) )
  848      /* Vector ROM */
  849      ROM_LOAD( "036800-01.r2",  0x4800, 0x0800, CRC(3b597407) SHA1(344fea2e5d84acce365d76daed61e96b9b6b37cc) )
  850      ROM_LOAD( "036799-01.np2", 0x5000, 0x0800, CRC(7d511572) SHA1(1956a12bccb5d3a84ce0c1cc10c6ad7f64e30b40) )
  851  
  852      /* DVG PROM */
  853      ROM_REGION( 0x100, "user1", 0 )
  854      ROM_LOAD( "034602-01.c8",  0x0000, 0x0100, CRC(97953db8) SHA1(8cbded64d1dd35b18c4d5cece00f77e7b2cab2ad) )
  855  ROM_END
  856  
  857  /***************************************************************************
  858  
  859  Asteroids Deluxe revision 1 romset
  860  ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  861  
  862  I have had a number of Asteroids deluxe pcbs pass through my hands, every one i have come across has had
  863  a revision -01 marked romset apart from the rom at J1, this is always marked -02.
  864  
  865  This revision 2 rom in that location works fine, and i believe was a
  866  factory upgrade, and production fit on 99% of pcbs.
  867  
  868  This pcb was from a cabinet with a serial number of 000967, so its an early one, and
  869  it has a completely -01 romset on the pcb.
  870  
  871  Coincidentally i went through a pile of my manuals and came across some service bulletins which might
  872  explain why there is this mismatch in revision numbers, it seems Atari released the game, and found
  873  they needed to change default settings becasue of earnings potential in their default
  874  first set (revision 1), not once, but twice! then they changed the romset altogether. The documents
  875  in question are CO-174-02 (2 pages, 3 sides). this document shows what i think was the final revision
  876  of roms to be produced, they consist of a wholly -02 romset, with the expection being a -03 rom at
  877  location J1.
  878  
  879  So, anyhow, find in this file, the FIRST revision of rom -01 in J1. This pcb contained the following
  880  roms in the following locations :
  881  
  882  all roms are TMS 2516, marked with silver atari labels 'ATARI 8105 ' then the info below:
  883  
  884  R2   = 036800 01E
  885  N/P2 = 036799 01E
  886  J1   = 036433 01E
  887  F/H1 = 036432 01E
  888  E/F1 = 036431 01E
  889  D1   = 036430 01E
  890  
  891  Dumped 24/08/05
  892  by Andy Welburn
  893  www.andys-arcade.com
  894  */
  895  ROM_START( astdelux1 )
  896      ROM_REGION( 0x8000, "maincpu", 0 )
  897      ROM_LOAD( "036430-01.d1",  0x6000, 0x0800, CRC(8f5dabc6) SHA1(5d7543e19acab99ddb63c0ffd60f54d7a0f267f5) )
  898      ROM_LOAD( "036431-01.ef1", 0x6800, 0x0800, CRC(157a8516) SHA1(9041d8c2369d004f198681e02b59a923fa8f70c9) )
  899      ROM_LOAD( "036432-01.fh1", 0x7000, 0x0800, CRC(fdea913c) SHA1(ded0138a20d80317d67add5bb2a64e6274e0e409) )
  900      ROM_LOAD( "036433-01.j1",  0x7800, 0x0800, CRC(ef09bac7) SHA1(6a4b37dbfe4e6badc4e81036b1430da2e9cb8ca4) )
  901      /* Vector ROM */
  902      ROM_LOAD( "036800-01.r2",  0x4800, 0x0800, CRC(3b597407) SHA1(344fea2e5d84acce365d76daed61e96b9b6b37cc) )
  903      ROM_LOAD( "036799-01.np2", 0x5000, 0x0800, CRC(7d511572) SHA1(1956a12bccb5d3a84ce0c1cc10c6ad7f64e30b40) )
  904  
  905      /* DVG PROM */
  906      ROM_REGION( 0x100, "user1", 0 )
  907      ROM_LOAD( "034602-01.c8",  0x0000, 0x0100, CRC(97953db8) SHA1(8cbded64d1dd35b18c4d5cece00f77e7b2cab2ad) )
  908  ROM_END
  909  
  910  
  911  ROM_START( llander )
  912      ROM_REGION( 0x8000, "maincpu", 0 )
  913      ROM_LOAD( "034572-02.f1",  0x6000, 0x0800, CRC(b8763eea) SHA1(5a15eaeaf825ccdf9ce013a6789cf51da20f785c) )
  914      ROM_LOAD( "034571-02.de1", 0x6800, 0x0800, CRC(77da4b2f) SHA1(4be6cef5af38734d580cbfb7e4070fe7981ddfd6) )
  915      ROM_LOAD( "034570-01.c1",  0x7000, 0x0800, CRC(2724e591) SHA1(ecf4430a0040c227c896aa2cd81ee03960b4d641) )
  916      ROM_LOAD( "034569-02.b1",  0x7800, 0x0800, CRC(72837a4e) SHA1(9b21ba5e1518079c326ca6e15b9993e6c4483caa) )
  917      /* Vector ROM */
  918      ROM_LOAD( "034599-01.r3",  0x4800, 0x0800, CRC(355a9371) SHA1(6ecb40169b797d9eb623bcb17872f745b1bf20fa) )
  919      ROM_LOAD( "034598-01.np3", 0x5000, 0x0800, CRC(9c4ffa68) SHA1(eb4ffc289d254f699f821df3146aa2c6cd78597f) )
  920      /* This _should_ be the rom for international versions.  Unfortunately, is it not currently available. */
  921      ROM_LOAD( "034597-01.m3",  0x5800, 0x0800, NO_DUMP )
  922  
  923      /* DVG PROM */
  924      ROM_REGION( 0x100, "user1", 0 )
  925      ROM_LOAD( "034602-01.c8",  0x0000, 0x0100, CRC(97953db8) SHA1(8cbded64d1dd35b18c4d5cece00f77e7b2cab2ad) )
  926  ROM_END
  927  
  928  ROM_START( llander1 )
  929      ROM_REGION( 0x8000, "maincpu", 0 )
  930      ROM_LOAD( "034572-01.f1",  0x6000, 0x0800, CRC(2aff3140) SHA1(4fc8aae640ce655417c11d9a3121aae9a1238e7c) )
  931      ROM_LOAD( "034571-01.de1", 0x6800, 0x0800, CRC(493e24b7) SHA1(125a2c335338ccabababef12fd7096ef4b605a31) )
  932      ROM_LOAD( "034570-01.c1",  0x7000, 0x0800, CRC(2724e591) SHA1(ecf4430a0040c227c896aa2cd81ee03960b4d641) )
  933      ROM_LOAD( "034569-01.b1",  0x7800, 0x0800, CRC(b11a7d01) SHA1(8f2935dbe04ee68815d69ea9e71853b5a145d7c3) )
  934      /* Vector ROM */
  935      ROM_LOAD( "034599-01.r3",  0x4800, 0x0800, CRC(355a9371) SHA1(6ecb40169b797d9eb623bcb17872f745b1bf20fa) )
  936      ROM_LOAD( "034598-01.np3", 0x5000, 0x0800, CRC(9c4ffa68) SHA1(eb4ffc289d254f699f821df3146aa2c6cd78597f) )
  937      /* This _should_ be the rom for international versions.  Unfortunately, is it not currently available. */
  938      ROM_LOAD( "034597-01.m3",  0x5800, 0x0800, NO_DUMP )
  939  
  940      /* DVG PROM */
  941      ROM_REGION( 0x100, "user1", 0 )
  942      ROM_LOAD( "034602-01.c8",  0x0000, 0x0100, CRC(97953db8) SHA1(8cbded64d1dd35b18c4d5cece00f77e7b2cab2ad) )
  943  ROM_END
  944  
  945  
  946  
  947  /*************************************
  948   *
  949   *  Driver initialization
  950   *
  951   *************************************/
  952  
  953  DRIVER_INIT_MEMBER(asteroid_state,asteroidb)
  954  {
  955      machine().device("maincpu")->memory().space(AS_PROGRAM).install_read_port(0x2000, 0x2000, "IN0");
  956      machine().device("maincpu")->memory().space(AS_PROGRAM).install_read_port(0x2003, 0x2003, "HS");
  957  }
  958  
  959  
  960  DRIVER_INIT_MEMBER(asteroid_state,asterock)
  961  {
  962      machine().device("maincpu")->memory().space(AS_PROGRAM).install_read_handler(0x2000, 0x2007, read8_delegate(FUNC(asteroid_state::asterock_IN0_r),this));
  963  }
  964  
  965  
  966  
  967  /*************************************
  968   *
  969   *  Game drivers
  970   *
  971   *************************************/
  972  
  973  GAME( 1979, asteroid,  0,         asteroid,  asteroid,  driver_device,  0,         ROT0, "Atari",   "Asteroids (rev 4)",        GAME_SUPPORTS_SAVE )
  974  GAME( 1979, asteroid2, asteroid,  asteroid,  asteroid,  driver_device,  0,         ROT0, "Atari",   "Asteroids (rev 2)",        GAME_SUPPORTS_SAVE )
  975  GAME( 1979, asteroid1, asteroid,  asteroid,  asteroid,  driver_device,  0,         ROT0, "Atari",   "Asteroids (rev 1)",        GAME_SUPPORTS_SAVE )
  976  GAME( 1979, asteroidb, asteroid,  asteroid,  asteroidb, asteroid_state, asteroidb, ROT0, "bootleg", "Asteroids (bootleg on Lunar Lander hardware)",  GAME_SUPPORTS_SAVE )
  977  GAME( 1979, asterock,  asteroid,  asterock,  asterock,  asteroid_state, asterock,  ROT0, "bootleg (Sidam)",     "Asterock (Sidam bootleg of Asteroids)",     GAME_SUPPORTS_SAVE )
  978  GAME( 1979, asterockv, asteroid,  asterock,  asterock,  asteroid_state, asterock,  ROT0, "bootleg (Videotron)", "Asterock (Videotron bootleg of Asteroids)", GAME_SUPPORTS_SAVE )
  979  GAME( 1979, meteorts,  asteroid,  asteroid,  asteroid,  driver_device,  0,         ROT0, "bootleg (VGG)",       "Meteorites (bootleg of Asteroids)", GAME_SUPPORTS_SAVE )
  980  GAME( 1979, meteorho,  asteroid,  asteroid,  asteroid,  driver_device,  0,         ROT0, "bootleg (Hoei)",      "Meteor (bootleg of Asteroids)",     GAME_SUPPORTS_SAVE )
  981  GAME( 1979, hyperspc,  asteroid,  asteroid,  asteroid,  driver_device,  0,         ROT0, "bootleg (Rumiano)",   "Hyperspace (bootleg of Asteroids)", GAME_SUPPORTS_SAVE )
  982  GAMEL(1980, astdelux,  0,         astdelux,  astdelux,  driver_device,  0,         ROT0, "Atari",   "Asteroids Deluxe (rev 3)", GAME_SUPPORTS_SAVE, layout_astdelux )
  983  GAMEL(1980, astdelux2, astdelux,  astdelux,  astdelux,  driver_device,  0,         ROT0, "Atari",   "Asteroids Deluxe (rev 2)", GAME_SUPPORTS_SAVE, layout_astdelux )
  984  GAMEL(1980, astdelux1, astdelux,  astdelux,  astdelux,  driver_device,  0,         ROT0, "Atari",   "Asteroids Deluxe (rev 1)", GAME_SUPPORTS_SAVE, layout_astdelux )
  985  GAME( 1979, llander,   0,         llander,   llander,   driver_device,  0,         ROT0, "Atari",   "Lunar Lander (rev 2)",     GAME_SUPPORTS_SAVE )
  986  GAME( 1979, llander1,  llander,   llander,   llander1,  driver_device,  0,         ROT0, "Atari",   "Lunar Lander (rev 1)",     GAME_SUPPORTS_SAVE )