Previous 199869 Revisions Next

r33408 Saturday 15th November, 2014 at 18:24:37 UTC by Emmanuel Vadot
Add chip name for confirmed acan dumps
[hash]supracan.xml
[src/emu]tilemap.h
[src/emu/machine]pla.h
[src/lib/util]plaparse.c
[src/mame]mame.lst mame.mak
[src/mame/drivers]alinvade.c dooyong.c meritm.c naomi.c prehisle.c
[src/mame/includes]dooyong.h prehisle.h
[src/mame/layout]alinvade.lay
[src/mame/machine]naomim4.c naomim4.h
[src/mame/video]dooyong.c prehisle.c
[src/mess/drivers]mc1502.c

trunk/hash/supracan.xml
r241919r241920
2323      <info name="alt_title" value="邪惡之子" />
2424      <part name="cart" interface="supracan_cart">
2525         <dataarea name="rom" width="16" endianness="big" size="2097152">
26            <rom loadflag="load16_word_swap" name="sonevil.bin" size="2097152" crc="9f6119a7" sha1="67ae9e7f99e1c3054ea54d53dbbba7792ef45134" offset="0" />
26            <rom loadflag="load16_word_swap" name="16005.cu5" size="2097152" crc="9f6119a7" sha1="67ae9e7f99e1c3054ea54d53dbbba7792ef45134" offset="0" />
2727         </dataarea>
2828      </part>
2929   </software>
r241919r241920
6262      <info name="alt_title" value="嘻遊記" />
6363      <part name="cart" interface="supracan_cart">
6464         <dataarea name="rom" width="16" endianness="big" size="2097152">
65            <rom loadflag="load16_word_swap" name="jttlaugh.bin" size="2097152" crc="cee25eea" sha1="fc82fc3a7d55571494cd62d8807160e22cf437bc" offset="0" />
65            <rom loadflag="load16_word_swap" name="16002.cu2" size="2097152" crc="cee25eea" sha1="fc82fc3a7d55571494cd62d8807160e22cf437bc" offset="0" />
6666         </dataarea>
6767      </part>
6868   </software>
trunk/src/emu/machine/pla.h
r241919r241920
5454// macros for known (and used) devices
5555
5656// 82S100, 82S101, PLS100, PLS101
57// 16x48x8 PLA, 28-pin:
58/*           _____   _____
59     FE   1 |*    \_/     | 28  Vcc
60     I7   2 |             | 27  I8
61     I6   3 |             | 26  I9
62     I5   4 |             | 25  I10
63     I4   5 |             | 24  I11
64     I3   6 |    82S100   | 23  I12
65     I2   7 |    82S101   | 22  I13
66     I1   8 |    PLS100   | 21  I14
67     I0   9 |    PLS101   | 20  I15
68     F7  10 |             | 19  _CE
69     F6  11 |             | 18  F0
70     F5  12 |             | 17  F1
71     F4  13 |             | 16  F2
72    GND  14 |_____________| 15  F3
73*/
57// 16x48x8 PLA, 28-pin
7458#define MCFG_PLS100_ADD(_tag) \
7559   MCFG_PLA_ADD(_tag, 16, 8, 48)
7660
trunk/src/emu/tilemap.h
r241919r241920
3636
3737            category (optional): specifies one of 16 categories for the
3838                pixels in the tile; the category controls which tiles are
39                rendered during a tilemap::draw() call
39                rendered during a tilemap_draw() call
4040
4141            group (optional): specifies one of 256 groups for pen mapping;
4242                each pen in the tile is looked up in a table to determine
r241919r241920
8181            all tiles rendered.
8282
8383        Flagsmap = an 8bpp bitmap containing per-pixel flags,
84            specifically the category (specified in bits 0-3) and the
85            layer (specified in bits 4-6).
84            specifically the category (specified in bits 0-3) and
85            the layer (specified in bits 4-6).
8686
8787****************************************************************************
8888
8989    How to use a tilemap:
9090
91    1. First create a new tilemap by calling tilemap_manager::create().
92        The parameters are as follows:
91    1. First create a new tilemap by calling tilemap_create(). The
92        parameters are as follows:
9393
94        decoder = reference to your device_gfx_interface
94        tile_get_info = pointer to a callback function which accepts a
95            memory index and in return fills in a tile_info structure
96            that describes the characteristics of a tile; this function
97            will be called whenever a dirty tile needs to be rendered
9598
96        tile_get_info = callback function which accepts a memory index
97            and in return fills in a tile_data structure that describes
98            the characteristics of a tile; this function will be called
99            whenever a dirty tile needs to be rendered
99        mapper = pointer to a callback function which maps the logical
100            column and row to a memory index; several standard mappers
101            are provided, with tilemap_scan_rows being the most common
100102
101        mapper = callback function which maps the logical column and row
102            to a memory index; several standard mappers are provided,
103            with TILEMAP_SCAN_ROWS being the most common
104
105103        tilewidth = the width, in pixels, of each individual tile
106104
107105        tileheight = the height, in pixels, of each individual tile
r241919r241920
114112        Common configuration tasks include:
115113
116114            * marking one of the pens as transparent via
117                tilemap_t::set_transparent_pen()
115                tilemap_set_transparent_pen()
118116
119117            * performing more complex pen-to-layer mapping via
120                tilemap_t::map_pen_to_layer() or
121                tilemap_t::map_pens_to_layer()
118                tilemap_map_pen_to_layer() or
119                tilemap_map_pens_to_layer()
122120
123121            * configuring global scroll offsets via
124                tilemap_t::set_scrolldx() and tilemap_t::set_scrolldy()
122                tilemap_set_scrolldx() and tilemap_set_scrolldy()
125123
126            * specifying a pointer that can be read back later (e.g. in
127                your tile_get_info callback) via
128                tilemap_t::set_user_data()
124            * specifying a pointer that is passed to your tile_get_info
125                callback via tilemap_set_user_data()
129126
130127            * setting a global palette offset via
131                tilemap_t::set_palette_offset()
128                tilemap_set_palette_offset()
132129
133130    3. In your memory write handlers for the tile memory, anytime tile
134131        data is modified, you need to mark the tile dirty so that it is
135132        re-rendered with the new data the next time the tilemap is drawn.
136        Use tilemap_t::mark_tile_dirty() and pass in the memory index.
133        Use tilemap_mark_tile_dirty() and pass in the memory index.
137134
138135    4. In your handlers for scrolling, update the scroll values for the
139        tilemap via tilemap_t::set_scrollx() and tilemap_t::set_scrolly().
136        tilemap via tilemap_set_scrollx() and tilemap_set_scrolly().
140137
141138    5. If any other major characteristics of the tilemap change (generally
142139        any global state that is used by the tile_get_info callback but
143140        which is not reported via other calls to the tilemap code), you
144141        should invalidate the entire tilemap. You can do this by calling
145        tilemap_t::mark_all_dirty().
142        tilemap_mark_all_tiles_dirty().
146143
147144    6. In your VIDEO_UPDATE callback, render the tiles by calling
148        tilemap_t::draw() or tilemap_t::draw_roz(). If you need to do
149        custom rendering and want access to the raw pixels, call
150        tilemap_t::pixmap() to get a reference to the updated bitmap_ind16
145        tilemap_draw() or tilemap_draw_roz(). If you need to do custom
146        rendering and want access to the raw pixels, call
147        tilemap_get_pixmap() to get a pointer to the updated bitmap_ind16
151148        containing the tilemap graphics.
152149
153150****************************************************************************
r241919r241920
160157
161158        tilemap_t *tmap;
162159        UINT16 *my_tmap_memory;
163        required_device<gfxdecode_device> gfxdecode;
164160
165        TILE_GET_INFO_MEMBER( my_state::my_get_info )
161        TILE_GET_INFO( my_get_info )
166162        {
167            UINT16 tiledata = my_tmap_memory[tile_index];
163            UINT8 tiledata = my_tmap_memory[tile_index];
168164            UINT8 code = tiledata & 0xff;
169165            UINT8 color = (tiledata >> 8) & 0x1f;
170166            UINT8 flipx = (tiledata >> 13) & 1;
r241919r241920
172168            UINT8 category = (tiledata >> 15) & 1;
173169
174170            // set the common info for the tile
175            tileinfo.set(
176                1,              // use gfxdecode->gfx(1) for tile graphics
171            SET_TILE_INFO(
172                1,              // use m_gfxdecode->gfx(1) for tile graphics
177173                code,           // the index of the graphics for this tile
178174                color,          // the color to use for this tile
179175                (flipx ? TILE_FLIPX : 0) |  // flags for this tile; also
180                (flipy ? TILE_FLIPY : 0)    // see the FLIP_YX macro
176                (flipy ? TILE_FLIPY : 0);   // see the FLIP_YX macro
181177            );
182178
183179            // set the category of each tile based on the high bit; this
r241919r241920
185181            tileinfo.category = category;
186182        }
187183
188        VIDEO_START_MEMBER( my_state, my_driver )
184        VIDEO_START( mydriver )
189185        {
190186            // first create the tilemap
191            tmap = &machine().tilemap().create(
192                    gfxdecode,
193                    tilemap_get_info_delegate(FUNC(my_state::my_get_info), this),
194                    TILEMAP_SCAN_ROWS,      // standard row-major mapper
187            tmap = tilemap_create(machine,
188                    my_get_info,            // pointer to your get_info
189                    tilemap_scan_rows,      // standard row-major mapper
195190                    8,8,                    // 8x8 tiles
196191                    64,32);                 // 64 columns, 32 rows
197192
198193            // then set the transparent pen; all other pens will default
199194            // to being part of layer 0
200            tmap.set_transparent_pen(0);
195            tilemap_set_transparent_pen(tmap, 0);
201196        }
202197
203        UINT32 my_state::screen_update_mydriver(
204            screen_device &screen,
205            bitmap_ind16 &bitmap,
206            const rectangle &cliprect)
198        SCREEN_UPDATE( mydriver )
207199        {
208200            // draw the tilemap first, fully opaque since it needs to
209201            // erase all previous pixels
210            tmap->draw(
211                screen,                 // destination screen
202            tilemap_draw(
212203                bitmap,                 // destination bitmap
213204                cliprect,               // clipping rectangle
214                TILEMAP_DRAW_OPAQUE);   // flags
205                tmap,                   // tilemap to draw
206                TILEMAP_DRAW_OPAQUE,    // flags
207                0);                     // don't use priority_bitmap
215208
216209            // next draw the sprites
217210            my_draw_sprites();
218211
219212            // then draw the tiles which have priority over sprites
220            tmap->draw(
221                screen,                 // destination screen
213            tilemap_draw(
222214                bitmap,                 // destination bitmap
223215                cliprect,               // clipping rectangle
224                TILEMAP_DRAW_CATEGORY(1));// flags: draw category 1
216                tmap,                   // tilemap to draw
217                TILEMAP_DRAW_CATEGORY(1),// flags: draw category 1
218                0);                     // don't use priority_bitmap
225219
226220            return 0;
227221        }
r241919r241920
243237
244238        TILEMAP_TRANSPARENT: This described a tilemap with a single
245239            transparent pen. To create the same effect, call
246            tilemap_t::set_transparent_pen() to specify which pen is
240            tilemap_set_transparent_pen() to specify which pen is
247241            transparent; all other pens will map to layer 0.
248242
249243        TILEMAP_BITMASK: This type is no longer special; with the new
r241919r241920
256250            also allowed for you to choose one of 4 mappings on a per-tile
257251            basis. All of this functionality is now expanded: you can
258252            specify one of 3 layers and can choose from one of 256 mappings
259            on a per-tile basis. You just call tilemap_t::set_transmask(),
253            on a per-tile basis. You just call tilemap_set_transmask(),
260254            which still exists but maps onto the new behavior. The "front"
261255            layer is now "layer 0" and the "back" layer is now "layer 1".
262256
r241919r241920
281275        TILEMAP_DRAW_LAYER0 is assumed.
282276
283277    * If you want to render with alpha blending, you can call
284        tilemap_t::draw() with the TILEMAP_DRAW_ALPHA flag.
278        tilemap_draw() with the TILEMAP_DRAW_ALPHA flag.
285279
286280    * To configure more complex pen-to-layer mapping, use the
287        tilemap_t::map_pens_to_layer() call. This call takes a group
288        number so that you can configure 1 of the 256 groups
289        independently. It also takes a pen and a mask; the mapping is
290        updated for all pens where ((pennum & mask) == pen). To set all
291        the pens in a group to the same value, pass a mask of 0. To set
292        a single pen in a group, pass a mask of ~0. The helper function
293        tilemap_t::map_pen_to_layer() does this for you.
281        tilemap_map_pens_to_layer() call. This call takes a group number
282        so that you can configure 1 of the 256 groups independently.
283        It also takes a pen and a mask; the mapping is updated for all
284        pens where ((pennum & mask) == pen). To set all the pens in a
285        group to the same value, pass a mask of 0. To set a single pen in
286        a group, pass a mask of ~0. The helper function
287        tilemap_map_pen_to_layer() does this for you.
294288
295289***************************************************************************/
296290
r241919r241920
312306#define TILEMAP_NUM_GROUPS              256
313307
314308
315// these flags control tilemap_t::draw() behavior
309// these flags control tilemap_draw() behavior
316310const UINT32 TILEMAP_DRAW_CATEGORY_MASK = 0x0f;     // specify the category to draw
317311const UINT32 TILEMAP_DRAW_LAYER0 = 0x10;            // draw layer 0
318312const UINT32 TILEMAP_DRAW_LAYER1 = 0x20;            // draw layer 1
r241919r241920
335329const UINT8 TILE_FORCE_LAYER1 = TILEMAP_PIXEL_LAYER1; // force all pixels to be layer 1 (no transparency)
336330const UINT8 TILE_FORCE_LAYER2 = TILEMAP_PIXEL_LAYER2; // force all pixels to be layer 2 (no transparency)
337331
338// tilemap global flags, used by tilemap_t::set_flip()
332// tilemap global flags, used by tilemap_set_flip()
339333const UINT32 TILEMAP_FLIPX = TILE_FLIPX;            // draw the tilemap horizontally flipped
340334const UINT32 TILEMAP_FLIPY = TILE_FLIPY;            // draw the tilemap vertically flipped
341335
r241919r241920
773767//  MACROS
774768//**************************************************************************
775769
776// macros to help form flags for tilemap_t::draw
770// macros to help form flags for tilemap_draw
777771#define TILEMAP_DRAW_CATEGORY(x)        (x)     // specify category to draw
778772#define TILEMAP_DRAW_ALPHA(x)           (TILEMAP_DRAW_ALPHA_FLAG | (rgb_t::clamp(x) << 24))
779773
trunk/src/lib/util/plaparse.c
r241919r241920
44
55    plaparse.h
66
7    Simple parser for Berkeley standard PLA files into raw fusemaps.
8    It supports no more than one output matrix, and is limited to
9    keywords: i, o, p, phase, e
7    Parser for Berkeley standard PLA files into raw fusemaps.
108
119***************************************************************************/
1210
r241919r241920
3331
3432struct parse_info
3533{
36   UINT32  inputs;     /* number of input columns */
37   UINT32  outputs;    /* number of output columns */
38   UINT32  terms;      /* number of terms */
39   UINT32  xorval[JED_MAX_FUSES/64];   /* output polarity */
40   UINT32  xorptr;
34   UINT32  inputs;
35   UINT32  outputs;
36   UINT32  terms;
4137};
4238
4339
r241919r241920
6157    character stream
6258-------------------------------------------------*/
6359
64static UINT32 suck_number(const UINT8 **cursrc, const UINT8 *srcend)
60static UINT32 suck_number(const UINT8 **psrc)
6561{
62   const UINT8 *src = *psrc;
6663   UINT32 value = 0;
67   (*cursrc)++;
68   
69   // find first digit
70   while (*cursrc < srcend && !iscrlf(**cursrc) && !isdigit(**cursrc))
71      (*cursrc)++;
72   if (*cursrc >= srcend)
73      return 0;
7464
7565   // loop over and accumulate digits
76   while (isdigit(**cursrc))
66   while (isdigit(*src))
7767   {
78      value = value * 10 + (**cursrc) - '0';
79      (*cursrc)++;
68      value = value * 10 + *src - '0';
69      src++;
8070   }
8171
72   // return a pointer to the string afterwards
73   *psrc = src;
8274   return value;
8375}
8476
r241919r241920
8981***************************************************************************/
9082
9183/*-------------------------------------------------
92    process_terms - process input/output matrix
84    process_field - process a single field
9385-------------------------------------------------*/
9486
95static bool process_terms(jed_data *data, const UINT8 **cursrc, const UINT8 *srcend, parse_info *pinfo)
87static void process_field(jed_data *data, const UINT8 *cursrc, const UINT8 *srcend, parse_info *pinfo)
9688{
97   UINT32 curinput = 0;
98   UINT32 curoutput = 0;
99   bool outputs = false;
89   cursrc++;
10090
101   while (*cursrc < srcend && **cursrc != '.' && **cursrc != '#')
91   // switch off of the field type
92   switch (*cursrc)
10293   {
103      switch (**cursrc)
94      // number of inputs
95      case 'i':
96         cursrc += 2;
97         pinfo->inputs = suck_number(&cursrc);
98         if (LOG_PARSE) printf("Inputs: %u\n", pinfo->inputs);
99         break;
100
101      // number of outputs
102      case 'o':
103         cursrc += 2;
104         pinfo->outputs = suck_number(&cursrc);
105         if (LOG_PARSE) printf("Outputs: %u\n", pinfo->outputs);
106         break;
107
108      // number of product terms
109      case 'p':
104110      {
105         case '-':
106            if (!outputs)
107            {
108               curinput++;
109               jed_set_fuse(data, data->numfuses++, 1);
110               jed_set_fuse(data, data->numfuses++, 1);
111         cursrc += 2;
112         pinfo->terms = suck_number(&cursrc);
113         if (LOG_PARSE) printf("Terms: %u\n", pinfo->terms);
111114
112               if (LOG_PARSE) printf("11");
113            }
114            break;
115         UINT32 curfuse = 0;
116         bool outputs = false;
115117
116         case '~':
117            if (!outputs)
118         cursrc++;
119         while (cursrc < srcend && *cursrc != '.')
120         {
121            switch (*cursrc)
118122            {
119               curinput++;
120               // this product term is inhibited
121               jed_set_fuse(data, data->numfuses++, 0);
122               jed_set_fuse(data, data->numfuses++, 0);
123            case '-':
124               if (!outputs)
125               {
126                  jed_set_fuse(data, curfuse++, 1);
127                  jed_set_fuse(data, curfuse++, 1);
123128
124               if (LOG_PARSE) printf("00");
125            }
126            break;
129                  if (LOG_PARSE) printf("11");
130               }
131               break;
127132
128         case '1':
129            if (outputs)
130            {
131               curoutput++;
132               jed_set_fuse(data, data->numfuses++, 0);
133            case '1':
134               if (outputs)
135               {
136                  jed_set_fuse(data, curfuse++, 0);
133137
134               if (LOG_PARSE) printf("0");
135            }
136            else
137            {
138               curinput++;
139               jed_set_fuse(data, data->numfuses++, 1);
140               jed_set_fuse(data, data->numfuses++, 0);
138                  if (LOG_PARSE) printf("0");
139               }
140               else
141               {
142                  jed_set_fuse(data, curfuse++, 1);
143                  jed_set_fuse(data, curfuse++, 0);
141144
142               if (LOG_PARSE) printf("10");
143            }
144            break;
145                  if (LOG_PARSE) printf("10");
146               }
147               break;
145148
146         case '0':
147            if (outputs)
148            {
149               curoutput++;
150               jed_set_fuse(data, data->numfuses++, 1);
149            case '0':
150               if (outputs)
151               {
152                  jed_set_fuse(data, curfuse++, 1);
151153
152               if (LOG_PARSE) printf("1");
153            }
154            else
155            {
156               curinput++;
157               jed_set_fuse(data, data->numfuses++, 0);
158               jed_set_fuse(data, data->numfuses++, 1);
154                  if (LOG_PARSE) printf("1");
155               }
156               else
157               {
158                  jed_set_fuse(data, curfuse++, 0);
159                  jed_set_fuse(data, curfuse++, 1);
159160
160               if (LOG_PARSE) printf("01");
161            }
162            break;
161                  if (LOG_PARSE) printf("01");
162               }
163               break;
163164
164         case ' ': case '\t':
165            if (curinput > 0 && !outputs)
166            {
165            case ' ':
167166               outputs = true;
168167               if (LOG_PARSE) printf(" ");
168               break;
169169            }
170            break;
171     
172         default:
173            break;
174      }
175170
176      if (iscrlf(**cursrc) && outputs)
177      {
178         outputs = false;
179         if (LOG_PARSE) printf("\n");
180         
181         if (curinput != pinfo->inputs || curoutput != pinfo->outputs)
182            return false;
183
184         curinput = 0;
185         curoutput = 0;
186      }
187
188      (*cursrc)++;
189   }
190   
191   return true;
192}
193
194
195
196/*-------------------------------------------------
197    process_field - process a single field
198-------------------------------------------------*/
199
200static bool process_field(jed_data *data, const UINT8 **cursrc, const UINT8 *srcend, parse_info *pinfo)
201{
202   (*cursrc)++;
203
204   switch (**cursrc)
205   {
206      // number of inputs
207      case 'i': case 'I':
208         pinfo->inputs = suck_number(cursrc, srcend);
209         if (pinfo->inputs == 0 || pinfo->inputs >= (JED_MAX_FUSES/2))
210            return false;
211
212         if (LOG_PARSE) printf("Inputs: %u\n", pinfo->inputs);
213         break;
214
215      // number of outputs
216      case 'o': case 'O':
217         pinfo->outputs = suck_number(cursrc, srcend);
218         if (pinfo->outputs == 0 || pinfo->outputs >= (JED_MAX_FUSES/2))
219            return false;
220
221         if (LOG_PARSE) printf("Outputs: %u\n", pinfo->outputs);
222         break;
223
224      case 'p': case 'P':
225         // output polarity (optional)
226         if (tolower((*cursrc)[1]) == 'h' && tolower((*cursrc)[2]) == 'a' && tolower((*cursrc)[3]) == 's' && tolower((*cursrc)[4]) == 'e')
227         {
228            if (LOG_PARSE) printf("Phase...\n");
229            while (*cursrc < srcend && !iscrlf(**cursrc) && pinfo->xorptr < (JED_MAX_FUSES/2))
171            if (iscrlf(*cursrc) && outputs)
230172            {
231               if (**cursrc == '0' || **cursrc == '1')
232               {
233                  // 0 is negative
234                  if (**cursrc == '0')
235                     pinfo->xorval[pinfo->xorptr/32] |= 1 << (pinfo->xorptr & 31);
236                  pinfo->xorptr++;
237               }
238               
239               (*cursrc)++;
173               outputs = false;
174               if (LOG_PARSE) printf("\n");
240175            }
241         }
242         
243         // or number of product terms (optional)
244         else
245         {
246            pinfo->terms = suck_number(cursrc, srcend);
247            if (pinfo->terms == 0 || pinfo->terms >= (JED_MAX_FUSES/2))
248               return false;
249176
250            if (LOG_PARSE) printf("Terms: %u\n", pinfo->terms);
177            cursrc++;
251178         }
179
180         data->numfuses = curfuse;
252181         break;
182      }
253183
254      // end of file (optional)
255      case 'e': case 'E':
184      // end of file
185      case 'e':
256186         if (LOG_PARSE) printf("End of file\n");
257187         break;
258     
259      default:
260         return false;
261188   }
262   
263   return true;
189
190   cursrc++;
264191}
265192
266193
r241919r241920
274201{
275202   const UINT8 *cursrc = (const UINT8 *)data;
276203   const UINT8 *srcend = cursrc + length;
277   
204   const UINT8 *scan;
278205   parse_info pinfo;
279   memset(&pinfo, 0, sizeof(pinfo));
280206
281207   result->numfuses = 0;
282   memset(result->fusemap, 0, sizeof(result->fusemap));
208   memset(result->fusemap, 0x00, sizeof(result->fusemap));
283209
284210   while (cursrc < srcend)
285211   {
286      switch (*cursrc)
212      if (*cursrc == '#')
287213      {
288         // comment line
289         case '#':
290            while (cursrc < srcend && !iscrlf(*cursrc))
291               cursrc++;
292            break;
293
294         // keyword
295         case '.':
296            if (!process_field(result, &cursrc, srcend, &pinfo))
297               return JEDERR_INVALID_DATA;
298            break;
299         
300         // terms
301         case '0': case '1': case '-': case '~':
302            if (!process_terms(result, &cursrc, srcend, &pinfo))
303               return JEDERR_INVALID_DATA;
304            break;
305         
306         default:
214         cursrc++;
215         while (cursrc < srcend && !iscrlf(*cursrc))
307216            cursrc++;
308            break;
309217      }
310   }
311   
312   // write output polarity
313   if (pinfo.xorptr > 0)
314   {
315      if (LOG_PARSE) printf("Polarity: ");
316     
317      for (int i = 0; i < pinfo.outputs; i++)
218      else if (*cursrc == '.')
318219      {
319         int bit = pinfo.xorval[i/32] >> (i & 31) & 1;
320         jed_set_fuse(result, result->numfuses++, bit);
321         if (LOG_PARSE) printf("%d", bit);
220         scan = cursrc;
221         while (scan < srcend && !iscrlf(*scan))
222            scan++;
223         if (scan >= srcend)
224            return JEDERR_INVALID_DATA;
225
226         process_field(result, cursrc, srcend, &pinfo);
227
228         cursrc = scan + 1;
322229      }
323      if (LOG_PARSE) printf("\n");
230
231      cursrc++;
324232   }
325233
326234   return JEDERR_NONE;
trunk/src/mame/drivers/alinvade.c
r241919r241920
1313
1414#include "emu.h"
1515#include "cpu/m6502/m6502.h"
16#include "alinvade.lh"
1716
1817class alinvade_state : public driver_device
1918{
r241919r241920
191190ROM_END
192191
193192
194GAMEL( 198?, alinvade,  0,    alinvade, alinvade, driver_device,  0, ROT90, "Forbes?", "Alien Invaders", GAME_UNEMULATED_PROTECTION | GAME_NO_SOUND, layout_alinvade )
193GAME( 198?, alinvade,  0,    alinvade, alinvade, driver_device,  0, ROT90, "Forbes?", "Alien Invaders", GAME_UNEMULATED_PROTECTION | GAME_NO_SOUND )
trunk/src/mame/drivers/dooyong.c
r241919r241920
8484#include "sound/okim6295.h"
8585#include "includes/dooyong.h"
8686
87WRITE8_MEMBER(dooyong_z80_state::bankswitch_w)
87WRITE8_MEMBER(dooyong_state::lastday_bankswitch_w)
8888{
8989   membank("bank1")->set_entry(data & 0x07);
9090
9191   if (data & 0xf8) popmessage("bankswitch %02x",data);
9292}
9393
94MACHINE_START_MEMBER(dooyong_z80_state, cpu_z80)
94MACHINE_START_MEMBER(dooyong_state,lastday)
9595{
9696   membank("bank1")->configure_entries(0, 8, memregion("maincpu")->base() + 0x10000, 0x4000);
9797}
9898
99WRITE8_MEMBER(dooyong_z80_state::flip_screen_w)
99WRITE8_MEMBER(dooyong_state::flip_screen_w)
100100{
101101   flip_screen_set(data);
102102}
103103
104MACHINE_RESET_MEMBER(dooyong_z80_ym2203_state, sound_ym2203)
104MACHINE_RESET_MEMBER(dooyong_state,sound_ym2203)
105105{
106   m_interrupt_line_1 = 0;
107   m_interrupt_line_2 = 0;
106   m_interrupt_line_1=0;
107   m_interrupt_line_2=0;
108108}
109109
110110/***************************************************************************
r241919r241920
113113
114114***************************************************************************/
115115
116static ADDRESS_MAP_START( lastday_map, AS_PROGRAM, 8, dooyong_z80_ym2203_state )
116static ADDRESS_MAP_START( lastday_map, AS_PROGRAM, 8, dooyong_state )
117117   AM_RANGE(0x0000, 0x7fff) AM_ROM
118118   AM_RANGE(0x8000, 0xbfff) AM_ROMBANK("bank1")
119   AM_RANGE(0xc000, 0xc007) AM_WRITE(bgscroll_w)
120   AM_RANGE(0xc008, 0xc00f) AM_WRITE(fgscroll_w)
119   AM_RANGE(0xc000, 0xc007) AM_WRITE(dooyong_bgscroll8_w)
120   AM_RANGE(0xc008, 0xc00f) AM_WRITE(dooyong_fgscroll8_w)
121121   AM_RANGE(0xc010, 0xc010) AM_READ_PORT("SYSTEM")
122122   AM_RANGE(0xc010, 0xc010) AM_WRITE(lastday_ctrl_w)   /* coin counter, flip screen */
123123   AM_RANGE(0xc011, 0xc011) AM_READ_PORT("P1")
124   AM_RANGE(0xc011, 0xc011) AM_WRITE(bankswitch_w)
124   AM_RANGE(0xc011, 0xc011) AM_WRITE(lastday_bankswitch_w)
125125   AM_RANGE(0xc012, 0xc012) AM_READ_PORT("P2")
126126   AM_RANGE(0xc012, 0xc012) AM_WRITE(soundlatch_byte_w)
127127   AM_RANGE(0xc013, 0xc013) AM_READ_PORT("DSWA")
128128   AM_RANGE(0xc014, 0xc014) AM_READ_PORT("DSWB")
129129   AM_RANGE(0xc800, 0xcfff) AM_RAM_DEVWRITE("palette", palette_device, write) AM_SHARE("palette")
130   AM_RANGE(0xd000, 0xdfff) AM_RAM_WRITE(txvideoram_w) AM_SHARE("txvideoram")
130   AM_RANGE(0xd000, 0xdfff) AM_RAM_WRITE(dooyong_txvideoram8_w) AM_SHARE("txvideoram")
131131   AM_RANGE(0xe000, 0xefff) AM_RAM
132132   AM_RANGE(0xf000, 0xffff) AM_RAM AM_SHARE("spriteram")
133133ADDRESS_MAP_END
134134
135static ADDRESS_MAP_START( pollux_map, AS_PROGRAM, 8, dooyong_z80_ym2203_state )
135static ADDRESS_MAP_START( pollux_map, AS_PROGRAM, 8, dooyong_state )
136136   AM_RANGE(0x0000, 0x7fff) AM_ROM
137137   AM_RANGE(0x8000, 0xbfff) AM_ROMBANK("bank1")
138138   AM_RANGE(0xc000, 0xcfff) AM_RAM
139139   AM_RANGE(0xd000, 0xdfff) AM_RAM AM_SHARE("spriteram")
140   AM_RANGE(0xe000, 0xefff) AM_RAM_WRITE(txvideoram_w) AM_SHARE("txvideoram")
141   AM_RANGE(0xf000, 0xf000) AM_READ_PORT("DSWA") AM_WRITE(bankswitch_w)
140   AM_RANGE(0xe000, 0xefff) AM_RAM_WRITE(dooyong_txvideoram8_w) AM_SHARE("txvideoram")
141   AM_RANGE(0xf000, 0xf000) AM_READ_PORT("DSWA") AM_WRITE(lastday_bankswitch_w)
142142   AM_RANGE(0xf001, 0xf001) AM_READ_PORT("DSWB")
143143   AM_RANGE(0xf002, 0xf002) AM_READ_PORT("P1")
144144   AM_RANGE(0xf003, 0xf003) AM_READ_PORT("P2")
145145   AM_RANGE(0xf004, 0xf004) AM_READ_PORT("SYSTEM")
146146   AM_RANGE(0xf008, 0xf008) AM_WRITE(pollux_ctrl_w)    /* coin counter, flip screen */
147147   AM_RANGE(0xf010, 0xf010) AM_WRITE(soundlatch_byte_w)
148   AM_RANGE(0xf018, 0xf01f) AM_WRITE(bgscroll_w)
149   AM_RANGE(0xf020, 0xf027) AM_WRITE(fgscroll_w)
148   AM_RANGE(0xf018, 0xf01f) AM_WRITE(dooyong_bgscroll8_w)
149   AM_RANGE(0xf020, 0xf027) AM_WRITE(dooyong_fgscroll8_w)
150150   AM_RANGE(0xf800, 0xffff) AM_RAM_DEVWRITE("palette", palette_device, write) AM_SHARE("palette")
151151ADDRESS_MAP_END
152152
153static ADDRESS_MAP_START( gulfstrm_map, AS_PROGRAM, 8, dooyong_z80_ym2203_state )
153static ADDRESS_MAP_START( gulfstrm_map, AS_PROGRAM, 8, dooyong_state )
154154   AM_RANGE(0x0000, 0x7fff) AM_ROM
155155   AM_RANGE(0x8000, 0xbfff) AM_ROMBANK("bank1")
156156   AM_RANGE(0xc000, 0xcfff) AM_RAM
157157   AM_RANGE(0xd000, 0xdfff) AM_RAM AM_SHARE("spriteram")
158   AM_RANGE(0xe000, 0xefff) AM_RAM_WRITE(txvideoram_w) AM_SHARE("txvideoram")
158   AM_RANGE(0xe000, 0xefff) AM_RAM_WRITE(dooyong_txvideoram8_w) AM_SHARE("txvideoram")
159159   AM_RANGE(0xf000, 0xf000) AM_READ_PORT("DSWA")
160   AM_RANGE(0xf000, 0xf000) AM_WRITE(bankswitch_w)
160   AM_RANGE(0xf000, 0xf000) AM_WRITE(lastday_bankswitch_w)
161161   AM_RANGE(0xf001, 0xf001) AM_READ_PORT("DSWB")
162162   AM_RANGE(0xf002, 0xf002) AM_READ_PORT("P2")
163163   AM_RANGE(0xf003, 0xf003) AM_READ_PORT("P1")
164164   AM_RANGE(0xf004, 0xf004) AM_READ_PORT("SYSTEM")
165165   AM_RANGE(0xf008, 0xf008) AM_WRITE(pollux_ctrl_w)    /* coin counter, flip screen */
166166   AM_RANGE(0xf010, 0xf010) AM_WRITE(soundlatch_byte_w)
167   AM_RANGE(0xf018, 0xf01f) AM_WRITE(bgscroll_w)
168   AM_RANGE(0xf020, 0xf027) AM_WRITE(fgscroll_w)
167   AM_RANGE(0xf018, 0xf01f) AM_WRITE(dooyong_bgscroll8_w)
168   AM_RANGE(0xf020, 0xf027) AM_WRITE(dooyong_fgscroll8_w)
169169   AM_RANGE(0xf800, 0xffff) AM_RAM_DEVWRITE("palette", palette_device, write) AM_SHARE("palette")
170170ADDRESS_MAP_END
171171
172static ADDRESS_MAP_START( bluehawk_map, AS_PROGRAM, 8, dooyong_z80_state )
172static ADDRESS_MAP_START( bluehawk_map, AS_PROGRAM, 8, dooyong_state )
173173   AM_RANGE(0x0000, 0x7fff) AM_ROM
174174   AM_RANGE(0x8000, 0xbfff) AM_ROMBANK("bank1")
175175   AM_RANGE(0xc000, 0xc000) AM_READ_PORT("DSWA")
r241919r241920
178178   AM_RANGE(0xc002, 0xc002) AM_READ_PORT("P1")
179179   AM_RANGE(0xc003, 0xc003) AM_READ_PORT("P2")
180180   AM_RANGE(0xc004, 0xc004) AM_READ_PORT("SYSTEM")
181   AM_RANGE(0xc008, 0xc008) AM_WRITE(bankswitch_w)
181   AM_RANGE(0xc008, 0xc008) AM_WRITE(lastday_bankswitch_w)
182182   AM_RANGE(0xc010, 0xc010) AM_WRITE(soundlatch_byte_w)
183   AM_RANGE(0xc018, 0xc01f) AM_WRITE(fg2scroll_w)
184   AM_RANGE(0xc040, 0xc047) AM_WRITE(bgscroll_w)
185   AM_RANGE(0xc048, 0xc04f) AM_WRITE(fgscroll_w)
183   AM_RANGE(0xc018, 0xc01f) AM_WRITE(dooyong_fg2scroll8_w)
184   AM_RANGE(0xc040, 0xc047) AM_WRITE(dooyong_bgscroll8_w)
185   AM_RANGE(0xc048, 0xc04f) AM_WRITE(dooyong_fgscroll8_w)
186186   AM_RANGE(0xc800, 0xcfff) AM_RAM_DEVWRITE("palette", palette_device, write) AM_SHARE("palette")
187   AM_RANGE(0xd000, 0xdfff) AM_RAM_WRITE(txvideoram_w) AM_SHARE("txvideoram")
187   AM_RANGE(0xd000, 0xdfff) AM_RAM_WRITE(dooyong_txvideoram8_w) AM_SHARE("txvideoram")
188188   AM_RANGE(0xe000, 0xefff) AM_RAM AM_SHARE("spriteram")
189189   AM_RANGE(0xf000, 0xffff) AM_RAM
190190ADDRESS_MAP_END
191191
192static ADDRESS_MAP_START( flytiger_map, AS_PROGRAM, 8, dooyong_z80_state )
192static ADDRESS_MAP_START( flytiger_map, AS_PROGRAM, 8, dooyong_state )
193193   AM_RANGE(0x0000, 0x7fff) AM_ROM
194194   AM_RANGE(0x8000, 0xbfff) AM_ROMBANK("bank1")
195195   AM_RANGE(0xc000, 0xcfff) AM_RAM AM_SHARE("spriteram")
196196   AM_RANGE(0xd000, 0xdfff) AM_RAM
197197   AM_RANGE(0xe000, 0xe000) AM_READ_PORT("P1")
198   AM_RANGE(0xe000, 0xe000) AM_WRITE(bankswitch_w)
198   AM_RANGE(0xe000, 0xe000) AM_WRITE(lastday_bankswitch_w)
199199   AM_RANGE(0xe002, 0xe002) AM_READ_PORT("P2")
200200   AM_RANGE(0xe004, 0xe004) AM_READ_PORT("SYSTEM")
201201   AM_RANGE(0xe006, 0xe006) AM_READ_PORT("DSWA")
202202   AM_RANGE(0xe008, 0xe008) AM_READ_PORT("DSWB")
203203   AM_RANGE(0xe010, 0xe010) AM_WRITE(flytiger_ctrl_w)  /* coin counter, flip screen */
204204   AM_RANGE(0xe020, 0xe020) AM_WRITE(soundlatch_byte_w)
205   AM_RANGE(0xe030, 0xe037) AM_WRITE(bgscroll_w)
206   AM_RANGE(0xe040, 0xe047) AM_WRITE(fgscroll_w)
205   AM_RANGE(0xe030, 0xe037) AM_WRITE(dooyong_bgscroll8_w)
206   AM_RANGE(0xe040, 0xe047) AM_WRITE(dooyong_fgscroll8_w)
207207   AM_RANGE(0xe800, 0xefff) AM_RAM_WRITE(paletteram_flytiger_w) AM_SHARE("flytiger_palram")
208   AM_RANGE(0xf000, 0xffff) AM_RAM_WRITE(txvideoram_w) AM_SHARE("txvideoram")
208   AM_RANGE(0xf000, 0xffff) AM_RAM_WRITE(dooyong_txvideoram8_w) AM_SHARE("txvideoram")
209209ADDRESS_MAP_END
210210
211static ADDRESS_MAP_START( primella_map, AS_PROGRAM, 8, dooyong_z80_state )
211static ADDRESS_MAP_START( primella_map, AS_PROGRAM, 8, dooyong_state )
212212   AM_RANGE(0x0000, 0x7fff) AM_ROM
213213   AM_RANGE(0x8000, 0xbfff) AM_ROMBANK("bank1")
214214   AM_RANGE(0xc000, 0xcfff) AM_RAM
215215   AM_RANGE(0xd000, 0xd3ff) AM_RAM /* what is this? looks like a palette? scratchpad RAM maybe? */
216   AM_RANGE(0xe000, 0xefff) AM_RAM_WRITE(txvideoram_w) AM_SHARE("txvideoram")
216   AM_RANGE(0xe000, 0xefff) AM_RAM_WRITE(dooyong_txvideoram8_w) AM_SHARE("txvideoram")
217217   AM_RANGE(0xf000, 0xf7ff) AM_DEVWRITE("palette", palette_device, write) AM_SHARE("palette")
218218   AM_RANGE(0xf800, 0xf800) AM_READ_PORT("DSWA")
219219   AM_RANGE(0xf800, 0xf800) AM_WRITE(primella_ctrl_w)  /* bank switch, flip screen etc */
r241919r241920
222222   AM_RANGE(0xf820, 0xf820) AM_READ_PORT("P1")
223223   AM_RANGE(0xf830, 0xf830) AM_READ_PORT("P2")
224224   AM_RANGE(0xf840, 0xf840) AM_READ_PORT("SYSTEM")
225   AM_RANGE(0xfc00, 0xfc07) AM_WRITE(bgscroll_w)
226   AM_RANGE(0xfc08, 0xfc0f) AM_WRITE(fgscroll_w)
225   AM_RANGE(0xfc00, 0xfc07) AM_WRITE(dooyong_bgscroll8_w)
226   AM_RANGE(0xfc08, 0xfc0f) AM_WRITE(dooyong_fgscroll8_w)
227227ADDRESS_MAP_END
228228
229static ADDRESS_MAP_START( rshark_map, AS_PROGRAM, 16, dooyong_68k_state )
229static ADDRESS_MAP_START( rshark_map, AS_PROGRAM, 16, dooyong_state )
230230   ADDRESS_MAP_GLOBAL_MASK(0xfffff)    /* super-x needs this and is similar */
231231   AM_RANGE(0x000000, 0x03ffff) AM_ROM
232232   AM_RANGE(0x040000, 0x04cfff) AM_RAM
233   AM_RANGE(0x04d000, 0x04dfff) AM_RAM AM_SHARE("spriteram")
233   AM_RANGE(0x04d000, 0x04dfff) AM_RAM AM_SHARE("spriteram16")
234234   AM_RANGE(0x04e000, 0x04ffff) AM_RAM
235235   AM_RANGE(0x0c0002, 0x0c0003) AM_READ_PORT("DSW")
236236   AM_RANGE(0x0c0004, 0x0c0005) AM_READ_PORT("P1_P2")
237237   AM_RANGE(0x0c0006, 0x0c0007) AM_READ_PORT("SYSTEM")
238   AM_RANGE(0x0c4000, 0x0c400f) AM_WRITE8(bgscroll_w, 0x00ff)
239   AM_RANGE(0x0c4010, 0x0c401f) AM_WRITE8(bg2scroll_w, 0x00ff)
238   AM_RANGE(0x0c4000, 0x0c400f) AM_WRITE(dooyong_bgscroll16_w)
239   AM_RANGE(0x0c4010, 0x0c401f) AM_WRITE(dooyong_bg2scroll16_w)
240240   AM_RANGE(0x0c8000, 0x0c8fff) AM_DEVWRITE("palette", palette_device, write) AM_SHARE("palette")
241241   AM_RANGE(0x0c0012, 0x0c0013) AM_WRITE(soundlatch_word_w)
242   AM_RANGE(0x0c0014, 0x0c0015) AM_WRITE(ctrl_w)    /* flip screen + unknown stuff */
243   AM_RANGE(0x0cc000, 0x0cc00f) AM_WRITE8(fgscroll_w, 0x00ff)
244   AM_RANGE(0x0cc010, 0x0cc01f) AM_WRITE8(fg2scroll_w, 0x00ff)
242   AM_RANGE(0x0c0014, 0x0c0015) AM_WRITE(rshark_ctrl_w)    /* flip screen + unknown stuff */
243   AM_RANGE(0x0cc000, 0x0cc00f) AM_WRITE(dooyong_fgscroll16_w)
244   AM_RANGE(0x0cc010, 0x0cc01f) AM_WRITE(dooyong_fg2scroll16_w)
245245ADDRESS_MAP_END
246246
247static ADDRESS_MAP_START( superx_map, AS_PROGRAM, 16, dooyong_68k_state )
247static ADDRESS_MAP_START( superx_map, AS_PROGRAM, 16, dooyong_state )
248248   ADDRESS_MAP_GLOBAL_MASK(0xfffff)
249249   AM_RANGE(0x000000, 0x03ffff) AM_ROM
250250   AM_RANGE(0x0d0000, 0x0dcfff) AM_RAM
251   AM_RANGE(0x0dd000, 0x0ddfff) AM_RAM AM_SHARE("spriteram")
251   AM_RANGE(0x0dd000, 0x0ddfff) AM_RAM AM_SHARE("spriteram16")
252252   AM_RANGE(0x0de000, 0x0dffff) AM_RAM
253253   AM_RANGE(0x080002, 0x080003) AM_READ_PORT("DSW")
254254   AM_RANGE(0x080004, 0x080005) AM_READ_PORT("P1_P2")
255255   AM_RANGE(0x080006, 0x080007) AM_READ_PORT("SYSTEM")
256   AM_RANGE(0x084000, 0x08400f) AM_WRITE8(bgscroll_w, 0x00ff)
257   AM_RANGE(0x084010, 0x08401f) AM_WRITE8(bg2scroll_w, 0x00ff)
256   AM_RANGE(0x084000, 0x08400f) AM_WRITE(dooyong_bgscroll16_w)
257   AM_RANGE(0x084010, 0x08401f) AM_WRITE(dooyong_bg2scroll16_w)
258258   AM_RANGE(0x088000, 0x088fff) AM_DEVWRITE("palette", palette_device, write) AM_SHARE("palette")
259259   AM_RANGE(0x080012, 0x080013) AM_WRITE(soundlatch_word_w)
260   AM_RANGE(0x080014, 0x080015) AM_WRITE(ctrl_w)    /* flip screen + unknown stuff */
261   AM_RANGE(0x08c000, 0x08c00f) AM_WRITE8(fgscroll_w, 0x00ff)
262   AM_RANGE(0x08c010, 0x08c01f) AM_WRITE8(fg2scroll_w, 0x00ff)
260   AM_RANGE(0x080014, 0x080015) AM_WRITE(rshark_ctrl_w)    /* flip screen + unknown stuff */
261   AM_RANGE(0x08c000, 0x08c00f) AM_WRITE(dooyong_fgscroll16_w)
262   AM_RANGE(0x08c010, 0x08c01f) AM_WRITE(dooyong_fg2scroll16_w)
263263ADDRESS_MAP_END
264264
265static ADDRESS_MAP_START( popbingo_map, AS_PROGRAM, 16, dooyong_68k_state )
265static ADDRESS_MAP_START( popbingo_map, AS_PROGRAM, 16, dooyong_state )
266266   ADDRESS_MAP_GLOBAL_MASK(0xfffff)
267267   AM_RANGE(0x000000, 0x03ffff) AM_ROM
268268   AM_RANGE(0x040000, 0x04cfff) AM_RAM
269   AM_RANGE(0x04d000, 0x04dfff) AM_RAM AM_SHARE("spriteram")
269   AM_RANGE(0x04d000, 0x04dfff) AM_RAM AM_SHARE("spriteram16")
270270   AM_RANGE(0x04e000, 0x04ffff) AM_RAM
271271   AM_RANGE(0x0c0002, 0x0c0003) AM_READ_PORT("DSW")
272272   AM_RANGE(0x0c0004, 0x0c0005) AM_READ_PORT("P1_P2")
273273   AM_RANGE(0x0c0006, 0x0c0007) AM_READ_PORT("SYSTEM")
274274   AM_RANGE(0x0c0012, 0x0c0013) AM_WRITE(soundlatch_word_w)
275   AM_RANGE(0x0c0014, 0x0c0015) AM_WRITE(ctrl_w)
275   AM_RANGE(0x0c0014, 0x0c0015) AM_WRITE(rshark_ctrl_w)
276276   AM_RANGE(0x0c0018, 0x0c001b) AM_WRITENOP // ?
277   AM_RANGE(0x0c4000, 0x0c400f) AM_WRITE8(bgscroll_w, 0x00ff)
278   AM_RANGE(0x0c4010, 0x0c401f) AM_WRITE8(bg2scroll_w, 0x00ff) // not used atm
277   AM_RANGE(0x0c4000, 0x0c400f) AM_WRITE(dooyong_bgscroll16_w)
278   AM_RANGE(0x0c4010, 0x0c401f) AM_WRITE(dooyong_bg2scroll16_w) // not used atm
279279   AM_RANGE(0x0c8000, 0x0c8fff) AM_DEVWRITE("palette", palette_device, write) AM_SHARE("palette")
280   AM_RANGE(0x0cc000, 0x0cc00f) AM_WRITE8(fgscroll_w, 0x00ff) // not used atm
281   AM_RANGE(0x0cc010, 0x0cc01f) AM_WRITE8(fg2scroll_w, 0x00ff) // not used atm
280   AM_RANGE(0x0cc000, 0x0cc00f) AM_WRITE(dooyong_fgscroll16_w) // not used atm
281   AM_RANGE(0x0cc010, 0x0cc01f) AM_WRITE(dooyong_fg2scroll16_w) // not used atm
282282   AM_RANGE(0x0dc000, 0x0dc01f) AM_RAM // registers of some kind?
283283ADDRESS_MAP_END
284284
285static ADDRESS_MAP_START( lastday_sound_map, AS_PROGRAM, 8, dooyong_z80_ym2203_state )
285static ADDRESS_MAP_START( lastday_sound_map, AS_PROGRAM, 8, dooyong_state )
286286   AM_RANGE(0x0000, 0x7fff) AM_ROM
287287   AM_RANGE(0xc000, 0xc7ff) AM_RAM
288288   AM_RANGE(0xc800, 0xc800) AM_READ(soundlatch_byte_r)
r241919r241920
290290   AM_RANGE(0xf002, 0xf003) AM_DEVREADWRITE("ym2", ym2203_device, read, write)
291291ADDRESS_MAP_END
292292
293static ADDRESS_MAP_START( pollux_sound_map, AS_PROGRAM, 8, dooyong_z80_ym2203_state )
293static ADDRESS_MAP_START( pollux_sound_map, AS_PROGRAM, 8, dooyong_state )
294294   AM_RANGE(0x0000, 0xefff) AM_ROM
295295   AM_RANGE(0xf000, 0xf7ff) AM_RAM
296296   AM_RANGE(0xf800, 0xf800) AM_READ(soundlatch_byte_r)
r241919r241920
772772   GFXDECODE_ENTRY( "gfx2", 0, popbingo_tilelayout, 256,  1 )
773773GFXDECODE_END
774774
775READ8_MEMBER(dooyong_z80_ym2203_state::unk_r)
775READ8_MEMBER(dooyong_state::unk_r)
776776{
777777   return 0;
778778}
779779
780WRITE_LINE_MEMBER(dooyong_z80_ym2203_state::irqhandler_2203_1)
780WRITE_LINE_MEMBER(dooyong_state::irqhandler_2203_1)
781781{
782782   m_interrupt_line_1=state;
783783   m_audiocpu->set_input_line(0, (m_interrupt_line_1 | m_interrupt_line_2) ? ASSERT_LINE : CLEAR_LINE);
784784}
785785
786WRITE_LINE_MEMBER(dooyong_z80_ym2203_state::irqhandler_2203_2)
786WRITE_LINE_MEMBER(dooyong_state::irqhandler_2203_2)
787787{
788788   m_interrupt_line_2=state;
789789   m_audiocpu->set_input_line(0, (m_interrupt_line_1 | m_interrupt_line_2) ? ASSERT_LINE : CLEAR_LINE);
r241919r241920
800800   MCFG_SPEAKER_STANDARD_MONO("mono")
801801
802802   MCFG_SOUND_ADD("ym1", YM2203, 1500000)
803   MCFG_YM2203_IRQ_HANDLER(WRITELINE(dooyong_z80_ym2203_state, irqhandler_2203_1))
804   MCFG_AY8910_PORT_A_READ_CB(READ8(dooyong_z80_ym2203_state, unk_r))
803   MCFG_YM2203_IRQ_HANDLER(WRITELINE(dooyong_state,irqhandler_2203_1))
804   MCFG_AY8910_PORT_A_READ_CB(READ8(dooyong_state, unk_r))
805805   MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.40)
806806
807807   MCFG_SOUND_ADD("ym2", YM2203, 1500000)
808   MCFG_YM2203_IRQ_HANDLER(WRITELINE(dooyong_z80_ym2203_state, irqhandler_2203_2))
809   MCFG_AY8910_PORT_A_READ_CB(READ8(dooyong_z80_ym2203_state, unk_r))
808   MCFG_YM2203_IRQ_HANDLER(WRITELINE(dooyong_state, irqhandler_2203_2))
809   MCFG_AY8910_PORT_A_READ_CB(READ8(dooyong_state, unk_r))
810810   MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.40)
811811MACHINE_CONFIG_END
812812
r241919r241920
834834   MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.60)
835835MACHINE_CONFIG_END
836836
837static MACHINE_CONFIG_START( lastday, dooyong_z80_ym2203_state )
837static MACHINE_CONFIG_START( lastday, dooyong_state )
838838
839839   /* basic machine hardware */
840840   MCFG_CPU_ADD("maincpu", Z80, 8000000)   /* ??? */
r241919r241920
844844   MCFG_CPU_ADD("audiocpu", Z80, 8000000)  /* ??? */
845845   MCFG_CPU_PROGRAM_MAP(lastday_sound_map)
846846
847   MCFG_MACHINE_START_OVERRIDE(dooyong_z80_state, cpu_z80)
848   MCFG_MACHINE_RESET_OVERRIDE(dooyong_z80_ym2203_state, sound_ym2203)
847   MCFG_MACHINE_START_OVERRIDE(dooyong_state,lastday)
848   MCFG_MACHINE_RESET_OVERRIDE(dooyong_state,sound_ym2203)
849849
850850
851851   /* video hardware */
r241919r241920
856856   MCFG_SCREEN_VBLANK_TIME(ATTOSECONDS_IN_USEC(0))
857857   MCFG_SCREEN_SIZE(64*8, 32*8)
858858   MCFG_SCREEN_VISIBLE_AREA(8*8, (64-8)*8-1, 1*8, 31*8-1 )
859   MCFG_SCREEN_UPDATE_DRIVER(dooyong_z80_ym2203_state, screen_update_lastday)
859   MCFG_SCREEN_UPDATE_DRIVER(dooyong_state, screen_update_lastday)
860860   MCFG_SCREEN_VBLANK_DEVICE("spriteram", buffered_spriteram8_device, vblank_copy_rising)
861861   MCFG_SCREEN_PALETTE("palette")
862862
r241919r241920
864864   MCFG_PALETTE_ADD("palette", 1024)
865865   MCFG_PALETTE_FORMAT(xxxxBBBBGGGGRRRR)
866866
867   MCFG_VIDEO_START_OVERRIDE(dooyong_z80_ym2203_state, lastday)
867   MCFG_VIDEO_START_OVERRIDE(dooyong_state,lastday)
868868
869869   /* sound hardware */
870870   MCFG_SPEAKER_STANDARD_MONO("mono")
871871
872872   MCFG_SOUND_ADD("ym1", YM2203, 4000000)
873   MCFG_YM2203_IRQ_HANDLER(WRITELINE(dooyong_z80_ym2203_state, irqhandler_2203_1))
874   MCFG_AY8910_PORT_A_READ_CB(READ8(dooyong_z80_ym2203_state, unk_r))
873   MCFG_YM2203_IRQ_HANDLER(WRITELINE(dooyong_state,irqhandler_2203_1))
874   MCFG_AY8910_PORT_A_READ_CB(READ8(dooyong_state, unk_r))
875875   MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.40)
876876
877877   MCFG_SOUND_ADD("ym2", YM2203, 4000000)
878   MCFG_YM2203_IRQ_HANDLER(WRITELINE(dooyong_z80_ym2203_state, irqhandler_2203_2))
879   MCFG_AY8910_PORT_A_READ_CB(READ8(dooyong_z80_ym2203_state, unk_r))
878   MCFG_YM2203_IRQ_HANDLER(WRITELINE(dooyong_state, irqhandler_2203_2))
879   MCFG_AY8910_PORT_A_READ_CB(READ8(dooyong_state, unk_r))
880880   MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.40)
881881
882882MACHINE_CONFIG_END
883883
884static MACHINE_CONFIG_START( gulfstrm, dooyong_z80_ym2203_state )
884static MACHINE_CONFIG_START( gulfstrm, dooyong_state )
885885
886886   /* basic machine hardware */
887887   MCFG_CPU_ADD("maincpu", Z80, 8000000)   /* ??? */
r241919r241920
891891   MCFG_CPU_ADD("audiocpu", Z80, 8000000)  /* ??? */
892892   MCFG_CPU_PROGRAM_MAP(lastday_sound_map)
893893
894   MCFG_MACHINE_START_OVERRIDE(dooyong_z80_state, cpu_z80)
895   MCFG_MACHINE_RESET_OVERRIDE(dooyong_z80_ym2203_state, sound_ym2203)
894   MCFG_MACHINE_START_OVERRIDE(dooyong_state,lastday)
895   MCFG_MACHINE_RESET_OVERRIDE(dooyong_state,sound_ym2203)
896896
897897   /* video hardware */
898898   MCFG_BUFFERED_SPRITERAM8_ADD("spriteram")
r241919r241920
902902   MCFG_SCREEN_VBLANK_TIME(ATTOSECONDS_IN_USEC(2500) /* not accurate */)
903903   MCFG_SCREEN_SIZE(64*8, 32*8)
904904   MCFG_SCREEN_VISIBLE_AREA(8*8, (64-8)*8-1, 1*8, 31*8-1 )
905   MCFG_SCREEN_UPDATE_DRIVER(dooyong_z80_ym2203_state, screen_update_gulfstrm)
905   MCFG_SCREEN_UPDATE_DRIVER(dooyong_state, screen_update_gulfstrm)
906906   MCFG_SCREEN_VBLANK_DEVICE("spriteram", buffered_spriteram8_device, vblank_copy_rising)
907907   MCFG_SCREEN_PALETTE("palette")
908908
r241919r241920
910910   MCFG_PALETTE_ADD("palette", 1024)
911911   MCFG_PALETTE_FORMAT(xRRRRRGGGGGBBBBB)
912912
913   MCFG_VIDEO_START_OVERRIDE(dooyong_z80_ym2203_state, gulfstrm)
913   MCFG_VIDEO_START_OVERRIDE(dooyong_state,gulfstrm)
914914
915915   /* sound hardware */
916916   MCFG_FRAGMENT_ADD( sound_2203 )
917917MACHINE_CONFIG_END
918918
919static MACHINE_CONFIG_START( pollux, dooyong_z80_ym2203_state )
919static MACHINE_CONFIG_START( pollux, dooyong_state )
920920
921921   /* basic machine hardware */
922922   MCFG_CPU_ADD("maincpu", Z80, 8000000)   /* ??? */
r241919r241920
926926   MCFG_CPU_ADD("audiocpu", Z80, 8000000)  /* ??? */
927927   MCFG_CPU_PROGRAM_MAP(pollux_sound_map)
928928
929   MCFG_MACHINE_START_OVERRIDE(dooyong_z80_state, cpu_z80)
930   MCFG_MACHINE_RESET_OVERRIDE(dooyong_z80_ym2203_state, sound_ym2203)
929   MCFG_MACHINE_START_OVERRIDE(dooyong_state,lastday)
930   MCFG_MACHINE_RESET_OVERRIDE(dooyong_state,sound_ym2203)
931931
932932   /* video hardware */
933933   MCFG_BUFFERED_SPRITERAM8_ADD("spriteram")
r241919r241920
937937   MCFG_SCREEN_VBLANK_TIME(ATTOSECONDS_IN_USEC(0))
938938   MCFG_SCREEN_SIZE(64*8, 32*8)
939939   MCFG_SCREEN_VISIBLE_AREA(8*8, (64-8)*8-1, 1*8, 31*8-1 )
940   MCFG_SCREEN_UPDATE_DRIVER(dooyong_z80_ym2203_state, screen_update_pollux)
940   MCFG_SCREEN_UPDATE_DRIVER(dooyong_state, screen_update_pollux)
941941   MCFG_SCREEN_VBLANK_DEVICE("spriteram", buffered_spriteram8_device, vblank_copy_rising)
942942   MCFG_SCREEN_PALETTE("palette")
943943
r241919r241920
945945   MCFG_PALETTE_ADD("palette", 1024)
946946   MCFG_PALETTE_FORMAT(xRRRRRGGGGGBBBBB)
947947
948   MCFG_VIDEO_START_OVERRIDE(dooyong_z80_ym2203_state, pollux)
948   MCFG_VIDEO_START_OVERRIDE(dooyong_state,pollux)
949949
950950   /* sound hardware */
951951   MCFG_FRAGMENT_ADD( sound_2203 )
952952MACHINE_CONFIG_END
953953
954static MACHINE_CONFIG_START( bluehawk, dooyong_z80_state )
954static MACHINE_CONFIG_START( bluehawk, dooyong_state )
955955
956956   /* basic machine hardware */
957957   MCFG_CPU_ADD("maincpu", Z80, 8000000)   /* ??? */
r241919r241920
961961   MCFG_CPU_ADD("audiocpu", Z80, 4000000)  /* ??? */
962962   MCFG_CPU_PROGRAM_MAP(bluehawk_sound_map)
963963
964   MCFG_MACHINE_START_OVERRIDE(dooyong_z80_state, cpu_z80)
964   MCFG_MACHINE_START_OVERRIDE(dooyong_state,lastday)
965965
966966   /* video hardware */
967967   MCFG_BUFFERED_SPRITERAM8_ADD("spriteram")
r241919r241920
971971   MCFG_SCREEN_VBLANK_TIME(ATTOSECONDS_IN_USEC(0))
972972   MCFG_SCREEN_SIZE(64*8, 32*8)
973973   MCFG_SCREEN_VISIBLE_AREA(8*8, (64-8)*8-1, 1*8, 31*8-1 )
974   MCFG_SCREEN_UPDATE_DRIVER(dooyong_z80_state, screen_update_bluehawk)
974   MCFG_SCREEN_UPDATE_DRIVER(dooyong_state, screen_update_bluehawk)
975975   MCFG_SCREEN_VBLANK_DEVICE("spriteram", buffered_spriteram8_device, vblank_copy_rising)
976976   MCFG_SCREEN_PALETTE("palette")
977977
r241919r241920
979979   MCFG_PALETTE_ADD("palette", 1024)
980980   MCFG_PALETTE_FORMAT(xRRRRRGGGGGBBBBB)
981981
982   MCFG_VIDEO_START_OVERRIDE(dooyong_z80_state, bluehawk)
982   MCFG_VIDEO_START_OVERRIDE(dooyong_state,bluehawk)
983983
984984   /* sound hardware */
985985   MCFG_FRAGMENT_ADD( sound_2151 )
986986MACHINE_CONFIG_END
987987
988static MACHINE_CONFIG_START( flytiger, dooyong_z80_state )
988static MACHINE_CONFIG_START( flytiger, dooyong_state )
989989
990990   /* basic machine hardware */
991991   MCFG_CPU_ADD("maincpu", Z80, 8000000)   /* ??? */
r241919r241920
995995   MCFG_CPU_ADD("audiocpu", Z80, 4000000)  /* ??? */
996996   MCFG_CPU_PROGRAM_MAP(bluehawk_sound_map)
997997
998   MCFG_MACHINE_START_OVERRIDE(dooyong_z80_state, cpu_z80)
998   MCFG_MACHINE_START_OVERRIDE(dooyong_state,lastday)
999999
10001000   /* video hardware */
10011001   MCFG_BUFFERED_SPRITERAM8_ADD("spriteram")
r241919r241920
10051005   MCFG_SCREEN_VBLANK_TIME(ATTOSECONDS_IN_USEC(0))
10061006   MCFG_SCREEN_SIZE(64*8, 32*8)
10071007   MCFG_SCREEN_VISIBLE_AREA(8*8, (64-8)*8-1, 1*8, 31*8-1 )
1008   MCFG_SCREEN_UPDATE_DRIVER(dooyong_z80_state, screen_update_flytiger)
1008   MCFG_SCREEN_UPDATE_DRIVER(dooyong_state, screen_update_flytiger)
10091009   MCFG_SCREEN_VBLANK_DEVICE("spriteram", buffered_spriteram8_device, vblank_copy_rising)
10101010   MCFG_SCREEN_PALETTE("palette")
10111011
r241919r241920
10131013   MCFG_PALETTE_ADD("palette", 1024)
10141014   MCFG_PALETTE_FORMAT(xRRRRRGGGGGBBBBB)
10151015
1016   MCFG_VIDEO_START_OVERRIDE(dooyong_z80_state, flytiger)
1016   MCFG_VIDEO_START_OVERRIDE(dooyong_state,flytiger)
10171017
10181018   /* sound hardware */
10191019   MCFG_FRAGMENT_ADD( sound_2151 )
10201020MACHINE_CONFIG_END
10211021
1022static MACHINE_CONFIG_START( primella, dooyong_z80_state )
1022static MACHINE_CONFIG_START( primella, dooyong_state )
10231023
10241024   /* basic machine hardware */
10251025   MCFG_CPU_ADD("maincpu", Z80, 8000000)   /* ??? */
r241919r241920
10291029   MCFG_CPU_ADD("audiocpu", Z80, 4000000)  /* ??? */
10301030   MCFG_CPU_PROGRAM_MAP(bluehawk_sound_map)
10311031
1032   MCFG_MACHINE_START_OVERRIDE(dooyong_z80_state, cpu_z80)
1032   MCFG_MACHINE_START_OVERRIDE(dooyong_state,lastday)
10331033
10341034   /* video hardware */
10351035   MCFG_SCREEN_ADD("screen", RASTER)
r241919r241920
10371037   MCFG_SCREEN_VBLANK_TIME(ATTOSECONDS_IN_USEC(0))
10381038   MCFG_SCREEN_SIZE(64*8, 32*8)
10391039   MCFG_SCREEN_VISIBLE_AREA(8*8, (64-8)*8-1, 0*8, 32*8-1 )
1040   MCFG_SCREEN_UPDATE_DRIVER(dooyong_z80_state, screen_update_primella)
1040   MCFG_SCREEN_UPDATE_DRIVER(dooyong_state, screen_update_primella)
10411041   MCFG_SCREEN_PALETTE("palette")
10421042
10431043   MCFG_GFXDECODE_ADD("gfxdecode", "palette", primella)
10441044   MCFG_PALETTE_ADD("palette", 1024)
10451045   MCFG_PALETTE_FORMAT(xRRRRRGGGGGBBBBB)
10461046
1047   MCFG_VIDEO_START_OVERRIDE(dooyong_z80_state, primella)
1047   MCFG_VIDEO_START_OVERRIDE(dooyong_state,primella)
10481048
10491049   /* sound hardware */
10501050   MCFG_FRAGMENT_ADD( sound_2151 )
10511051MACHINE_CONFIG_END
10521052
1053
1054TIMER_DEVICE_CALLBACK_MEMBER(dooyong_68k_state::scanline)
1053TIMER_DEVICE_CALLBACK_MEMBER(dooyong_state::rshark_scanline)
10551054{
10561055   int scanline = param;
10571056
1058   if (scanline == 248) // vblank-out irq
1057   if(scanline == 248) // vblank-out irq
10591058      m_maincpu->set_input_line(5, HOLD_LINE);
10601059
1061   if (scanline == 120) // timer irq?
1060   if(scanline == 120) // timer irq?
10621061      m_maincpu->set_input_line(6, HOLD_LINE);
10631062}
10641063
10651064
1066static MACHINE_CONFIG_START( rshark, dooyong_68k_state )
1065static MACHINE_CONFIG_START( rshark, dooyong_state )
10671066
10681067   /* basic machine hardware */
10691068   MCFG_CPU_ADD("maincpu", M68000, 8000000)    /* measured on super-x */
10701069   MCFG_CPU_PROGRAM_MAP(rshark_map)
1071   MCFG_TIMER_DRIVER_ADD_SCANLINE("scantimer", dooyong_68k_state, scanline, "screen", 0, 1)
1070   MCFG_TIMER_DRIVER_ADD_SCANLINE("scantimer", dooyong_state, rshark_scanline, "screen", 0, 1)
10721071
10731072   MCFG_CPU_ADD("audiocpu", Z80, 4000000)  /* measured on super-x */
10741073   MCFG_CPU_PROGRAM_MAP(bluehawk_sound_map)
10751074
10761075   /* video hardware */
1077   MCFG_BUFFERED_SPRITERAM16_ADD("spriteram")
1076   MCFG_BUFFERED_SPRITERAM16_ADD("spriteram16")
10781077
10791078   MCFG_SCREEN_ADD("screen", RASTER)
10801079   MCFG_SCREEN_REFRESH_RATE(60)
10811080   MCFG_SCREEN_VBLANK_TIME(ATTOSECONDS_IN_USEC(0))
10821081   MCFG_SCREEN_SIZE(64*8, 32*8)
10831082   MCFG_SCREEN_VISIBLE_AREA(8*8, (64-8)*8-1, 1*8, 31*8-1 )
1084   MCFG_SCREEN_UPDATE_DRIVER(dooyong_68k_state, screen_update_rshark)
1085   MCFG_SCREEN_VBLANK_DEVICE("spriteram", buffered_spriteram16_device, vblank_copy_rising)
1083   MCFG_SCREEN_UPDATE_DRIVER(dooyong_state, screen_update_rshark)
1084   MCFG_SCREEN_VBLANK_DEVICE("spriteram16", buffered_spriteram16_device, vblank_copy_rising)
10861085   MCFG_SCREEN_PALETTE("palette")
10871086
10881087   MCFG_GFXDECODE_ADD("gfxdecode", "palette", rshark)
10891088   MCFG_PALETTE_ADD("palette", 2048)
10901089   MCFG_PALETTE_FORMAT(xRRRRRGGGGGBBBBB)
10911090
1092   MCFG_VIDEO_START_OVERRIDE(dooyong_68k_state, rshark)
1091   MCFG_VIDEO_START_OVERRIDE(dooyong_state,rshark)
10931092
10941093   /* sound hardware */
10951094   MCFG_FRAGMENT_ADD( sound_2151_m68k )
10961095MACHINE_CONFIG_END
10971096
1098static MACHINE_CONFIG_START( superx, dooyong_68k_state ) // dif mem map
1097static MACHINE_CONFIG_START( superx, dooyong_state ) // dif mem map
10991098
11001099   /* basic machine hardware */
11011100   MCFG_CPU_ADD("maincpu", M68000, 8000000)    /* measured on super-x */
11021101   MCFG_CPU_PROGRAM_MAP(superx_map)
1103   MCFG_TIMER_DRIVER_ADD_SCANLINE("scantimer", dooyong_68k_state, scanline, "screen", 0, 1)
1102   MCFG_TIMER_DRIVER_ADD_SCANLINE("scantimer", dooyong_state, rshark_scanline, "screen", 0, 1)
11041103
11051104   MCFG_CPU_ADD("audiocpu", Z80, 4000000)  /* measured on super-x */
11061105   MCFG_CPU_PROGRAM_MAP(bluehawk_sound_map)
11071106
11081107   /* video hardware */
1109   MCFG_BUFFERED_SPRITERAM16_ADD("spriteram")
1108   MCFG_BUFFERED_SPRITERAM16_ADD("spriteram16")
11101109
11111110   MCFG_SCREEN_ADD("screen", RASTER)
11121111   MCFG_SCREEN_REFRESH_RATE(60)
11131112   MCFG_SCREEN_VBLANK_TIME(ATTOSECONDS_IN_USEC(0))
11141113   MCFG_SCREEN_SIZE(64*8, 32*8)
11151114   MCFG_SCREEN_VISIBLE_AREA(8*8, (64-8)*8-1, 1*8, 31*8-1 )
1116   MCFG_SCREEN_UPDATE_DRIVER(dooyong_68k_state, screen_update_rshark)
1117   MCFG_SCREEN_VBLANK_DEVICE("spriteram", buffered_spriteram16_device, vblank_copy_rising)
1115   MCFG_SCREEN_UPDATE_DRIVER(dooyong_state, screen_update_rshark)
1116   MCFG_SCREEN_VBLANK_DEVICE("spriteram16", buffered_spriteram16_device, vblank_copy_rising)
11181117   MCFG_SCREEN_PALETTE("palette")
11191118
11201119   MCFG_GFXDECODE_ADD("gfxdecode", "palette", rshark)
11211120   MCFG_PALETTE_ADD("palette", 2048)
11221121   MCFG_PALETTE_FORMAT(xRRRRRGGGGGBBBBB)
11231122
1124   MCFG_VIDEO_START_OVERRIDE(dooyong_68k_state, rshark)
1123   MCFG_VIDEO_START_OVERRIDE(dooyong_state,rshark)
11251124
11261125   /* sound hardware */
11271126   MCFG_FRAGMENT_ADD( sound_2151_m68k )
11281127MACHINE_CONFIG_END
11291128
1130static MACHINE_CONFIG_START( popbingo, dooyong_68k_state )
1129static MACHINE_CONFIG_START( popbingo, dooyong_state )
11311130
11321131   /* basic machine hardware */
11331132   MCFG_CPU_ADD("maincpu", M68000, 10000000)
11341133   MCFG_CPU_PROGRAM_MAP(popbingo_map)
1135   MCFG_TIMER_DRIVER_ADD_SCANLINE("scantimer", dooyong_68k_state, scanline, "screen", 0, 1)
1134   MCFG_TIMER_DRIVER_ADD_SCANLINE("scantimer", dooyong_state, rshark_scanline, "screen", 0, 1)
11361135
11371136   MCFG_CPU_ADD("audiocpu", Z80, 4000000)  /* measured on super-x */
11381137   MCFG_CPU_PROGRAM_MAP(bluehawk_sound_map)
11391138
11401139   /* video hardware */
1141   MCFG_BUFFERED_SPRITERAM16_ADD("spriteram")
1140   MCFG_BUFFERED_SPRITERAM16_ADD("spriteram16")
11421141
11431142   MCFG_SCREEN_ADD("screen", RASTER)
11441143   MCFG_SCREEN_REFRESH_RATE(60)
11451144   MCFG_SCREEN_VBLANK_TIME(ATTOSECONDS_IN_USEC(0))
11461145   MCFG_SCREEN_SIZE(64*8, 32*8)
11471146   MCFG_SCREEN_VISIBLE_AREA(8*8, (64-8)*8-1, 1*8, 31*8-1 )
1148   MCFG_SCREEN_UPDATE_DRIVER(dooyong_68k_state, screen_update_popbingo)
1149   MCFG_SCREEN_VBLANK_DEVICE("spriteram", buffered_spriteram16_device, vblank_copy_rising)
1147   MCFG_SCREEN_UPDATE_DRIVER(dooyong_state, screen_update_popbingo)
1148   MCFG_SCREEN_VBLANK_DEVICE("spriteram16", buffered_spriteram16_device, vblank_copy_rising)
11501149   MCFG_SCREEN_PALETTE("palette")
11511150
11521151   MCFG_GFXDECODE_ADD("gfxdecode", "palette", popbingo)
11531152   MCFG_PALETTE_ADD("palette", 2048)
11541153   MCFG_PALETTE_FORMAT(xRRRRRGGGGGBBBBB)
11551154
1156   MCFG_VIDEO_START_OVERRIDE(dooyong_68k_state, popbingo)
1155   MCFG_VIDEO_START_OVERRIDE(dooyong_state,popbingo)
11571156
11581157   /* sound hardware */
11591158   MCFG_FRAGMENT_ADD( sound_2151_m68k )
trunk/src/mame/drivers/meritm.c
r241919r241920
9494  Pit Boss Superstar III 30 (c)1993
9595  Pit Boss Megastar (c)1994
9696  Pit Boss Supertouch 30 (c)1993/4
97  Pit Boss Megatouch (c)1994
9897
9998Custom Program Versions (Superstar 30 / Supertouch 30):
10099
r241919r241920
110109
111110
112111  CRT-260:
112  *Megatouch Video (c)1994?
113113  Megatouch II (c)1994
114114  Megatouch III (c)1995
115115  Megatouch III Tournament Edition (c)1996
r241919r241920
11911191The Touchscreen Calibration routine doesn't seem to work?
11921192
11931193*/
1194
11941195ROM_START( mtjpoker ) /* Uses the CRT-258 touch controller board & Dallas DS1225Y NV SRAM */
11951196   ROM_REGION( 0x80000, "maincpu", 0 )
11961197   ROM_LOAD( "9132-00-02_u9-r0.u9", 0x00000, 0x10000, CRC(4ec683b6) SHA1(7cff76ba1517deede3dfa2a419e11fd603dcf695) ) /* 9132-00-02 R0 46  940416 */
r241919r241920
12121213 Hold5 advances through the list.
12131214 Hi-Score will clear the High Scores
12141215
1215Is the "Stand" & "Hi-Score" keys the same? Without a separate Stand key, you cannot set up the "TWIN" bonus feature
1216Is the "Stand" & "Hi-Score" keys the same? Without a sperate Stand key, you cannot set up the "TWIN" bonus feature
12161217
12171218*/
1219
12181220ROM_START( americna ) /* Uses a small daughter card CRT-251 & Dallas DS1225Y NV SRAM */
12191221   ROM_REGION( 0x80000, "maincpu", 0 )
12201222   ROM_LOAD( "9131-00_u9-2.u9",   0x00000, 0x10000, CRC(8a741fb6) SHA1(2d77c67e5a0bdaf6199c31c4055df214672db3e1) ) /* 9131-00 U9-2  888020 */
r241919r241920
12291231   ROM_LOAD( "9131-02_u11-0.u11", 0x20000, 0x10000, CRC(f137d70c) SHA1(8ec04ec17300aa3a6ef14bcca1ca1c2aec0eea18) )
12301232ROM_END
12311233
1234/*
1235    Pit Boss II - Merit Industries Inc. 1988
1236    ----------------------------------------
1237
1238    All eproms are 27C512
1239
1240    One 8 bank dip switch.
1241
1242    Two YAMAHA V9938 Video Processors.
1243
1244    21.47727 MHz Crystal
1245
1246    CPU Z80
1247
1248    Audio AY8930
1249
1250    Two Z80A-PIO
1251
1252    One bq4010YMA-150 NVRAM
1253    Eight V53C464AP80 (41464) RAMS
1254
1255    One PAL16L8AN
1256    One PAL20L10NC
1257*/
1258
12321259ROM_START( pitboss2 )
12331260   ROM_REGION( 0x80000, "maincpu", 0 )
12341261   ROM_LOAD( "9221-01_u9-0c.u9",  0x00000, 0x10000, CRC(a1b6ac15) SHA1(b7b395f3e7e14dbb84003e03bf7d054e795a7211) ) /* 9221-01C  880221 */
r241919r241920
12431270
12441271ROM_START( spitboss )
12451272   ROM_REGION( 0x80000, "maincpu", 0 )
1246   ROM_LOAD( "9221-02_u9-0a.u9",   0x00000, 0x10000, CRC(e0c45c9c) SHA1(534bff67c8fee08f1c348275de8977659efa9f69) ) /* 9221-02A   886021 */
1273   ROM_LOAD( "9221-02_u9-0a.u9",   0x00000, 0x10000, CRC(e0c45c9c) SHA1(534bff67c8fee08f1c348275de8977659efa9f69) ) /* 9221-02A   886021 (actual, but should be 880621) */
12471274   ROM_LOAD( "9221-02_u10-0.u10",  0x10000, 0x10000, CRC(ed010c58) SHA1(02750944a28c1c27ce2a9904d11b7e46272a940e) )
12481275   ROM_LOAD( "9221-02_u11-0a.u11", 0x20000, 0x10000, CRC(0c65fa86) SHA1(7906a8d615116ca67bf370dfb2da8cb2389a313d) )
12491276   ROM_LOAD( "9221-02_u12-0.u12",  0x30000, 0x10000, CRC(0cf95b0e) SHA1(c6ffc13703892b9ae0da39a02db37c4ec890f79e) )
r241919r241920
12671294
12681295ROM_START( pitbosssa )
12691296   ROM_REGION( 0x80000, "maincpu", 0 )
1270   ROM_LOAD( "9221-10_u9-0a.u9",   0x00000, 0x10000, CRC(41be6b30) SHA1(c4df87a599e310ce29ee9277e5adc916ff68f060) ) /* 9221-10-00A  090370 */
1297   ROM_LOAD( "9221-10_u9-0a.u9",   0x00000, 0x10000, CRC(41be6b30) SHA1(c4df87a599e310ce29ee9277e5adc916ff68f060) ) /* 9221-10-00A  090370 (actual, but should be 090390) */
12711298   ROM_LOAD( "9221-10_u10-0.u10",  0x10000, 0x10000, CRC(853a1a99) SHA1(45e33442aa7e51c05c9ac8b8458937ee3ff4c21d) )
12721299   ROM_LOAD( "9221-10_u11-0a.u11", 0x20000, 0x10000, CRC(c9137469) SHA1(618680609bdffa92b919a2417bd3ec41a4c8bf2b) )
12731300   ROM_LOAD( "9221-10_u12-0.u12",  0x30000, 0x10000, CRC(3577a203) SHA1(80f9c827ad9dea2c6af788bd3b46ab65e8c594eb) )
r241919r241920
13031330   ROM_LOAD( "9233-00-01_u15-r0", 0x60000, 0x10000, CRC(5810840e) SHA1(bad6457752ac212c3c11360a13a8d3473662a287) )
13041331
13051332   ROM_REGION( 0x000022, "ds1204", 0 )
1306   ROM_LOAD( "9233-01_u1-r01_c1993_mii", 0x000000, 0x000022, BAD_DUMP CRC(93459659) SHA1(73ad4c3a7c52d3db3acb43662c535f8c2ed2376a) )
1333   ROM_LOAD( "9233-01_u1-ro1_c1993_mii", 0x000000, 0x000022, BAD_DUMP CRC(93459659) SHA1(73ad4c3a7c52d3db3acb43662c535f8c2ed2376a) )
13071334
13081335   ROM_REGION( 0xc0000, "extra", 0 ) // question roms
13091336   ROM_LOAD( "qs9233-01_u7-r0",  0x00000, 0x40000, CRC(176dd688) SHA1(306cf78101219ef1122023a01d16dff5e9f2aecf) ) /* These 3 roms are on CRT-256 sattalite PCB */
r241919r241920
13111338   ROM_LOAD( "qs9233-01_u5-r0",  0x80000, 0x40000, CRC(740b1274) SHA1(14eab68fc137b905a5a2739c7081900a48cba562) )
13121339ROM_END
13131340
1314/*
1315Basically this Pit Boss Megatouch set is Pit Boss Supertouch 30 v2.0 but marks the first time Merit
1316 started using the Megatouch name.
1317
1318NOTE: Once again U10, U12 & U13 doesn't change between this set and the Pit Boss Supertouch 30 sets
1319      and the question roms are the same data with a new label and game number ID
1320*/
1321ROM_START( megat ) /* Dallas DS1204V security key attached to CRT-254 connected to J2 connector labeled 9234-20 U1-RO C1994 MII */
1322   ROM_REGION( 0x80000, "maincpu", 0 )
1323   ROM_LOAD( "9234-20-01_u9-r0a",  0x00000, 0x10000, CRC(5a9fd092) SHA1(756b6a925dafb17451e7dc37c95a26d09ecfe2d7) ) /* 9234-20-01 R0A 940519 */
1324   ROM_LOAD( "9234-20-01_u10-r0a", 0x10000, 0x10000, CRC(853a1a99) SHA1(45e33442aa7e51c05c9ac8b8458937ee3ff4c21d) ) /* Also found as PBC U10 */
1325   ROM_LOAD( "9234-20-01_u11-r0a", 0x20000, 0x10000, CRC(8bd5f6bb) SHA1(95b23d7d14207fcafc01ee975400ebdd1e7b5ad5) )
1326   ROM_LOAD( "9234-20-01_u12-r0a", 0x30000, 0x10000, CRC(b9fb4203) SHA1(84b514d9739d9c2ab1081cfc7cdedb41155ee038) ) /* Also found as PBC U12 */
1327   ROM_LOAD( "9234-20-01_u13-r0a", 0x40000, 0x10000, CRC(574fb3c7) SHA1(213741df3055b97ddd9889c2aa3d3e863e2c86d3) ) /* Also found as PBC U13 */
1328   ROM_LOAD( "9234-20-01_u14-r0a", 0x50000, 0x10000, CRC(40d78506) SHA1(5e1d8e4ef8aa02faa2a323f5e988bf56d4747b60) )
1329   ROM_LOAD( "9234-20-01_u15-r0a", 0x60000, 0x10000, CRC(9adc67b8) SHA1(271e6b6473eeea01f2923ef82c192a583bb5e338) )
1330
1331   ROM_REGION( 0x000022, "ds1204", 0 )
1332   ROM_LOAD( "9234-20_u1-r0_c1994_mii", 0x000000, 0x000022, BAD_DUMP CRC(6cbdbde1) SHA1(b076ee21fc792a5e85cdaed427bc41554568811e) )
1333
1334   ROM_REGION( 0xc0000, "extra", 0 ) // question roms
1335   ROM_LOAD( "qs9234-20_u7-r0",  0x00000, 0x40000, CRC(c0534aaa) SHA1(4b3cbf03f29fd5b4b8fd423e73c0c8147692fa75) ) /* These 3 roms are on CRT-256 sattalite PCB */
1336   ROM_LOAD( "qs9234-20_u6-r0",  0x40000, 0x40000, CRC(fe2cd934) SHA1(623011dc53ed6eefefa0725dba6fd1efee2077c1) ) /* Same data as Pit Boss Supertouch 30 sets, different label - verified */
1337   ROM_LOAD( "qs9234-20_u5-r0",  0x80000, 0x40000, CRC(293fe305) SHA1(8a551ae8fb4fa4bf329128be1bfd6f1c3ff5a366) )
1338ROM_END
1339
13401341ROM_START( pbst30 ) /* Dallas DS1204V security key attached to CRT-254 connected to J2 connector labeled 9234-10 U1-RO1 C1994 MII */
13411342   ROM_REGION( 0x80000, "maincpu", 0 )
13421343   ROM_LOAD( "9234-10-01_u9-r0",  0x00000, 0x10000, CRC(96f39c9a) SHA1(df698e94a5204cf050ceadc5c257ca5f68171114) ) /* 9234-10-01 032294 */
r241919r241920
13481349   ROM_LOAD( "9234-10-01_u15-r0", 0x60000, 0x10000, CRC(9fbd8582) SHA1(c0f68c8a7cdca34c8736cefc71767c421bcaba8a) )
13491350
13501351   ROM_REGION( 0x000022, "ds1204", 0 )
1351   ROM_LOAD( "9234-10_u1-r01_c1994_mii", 0x000000, 0x000022, BAD_DUMP CRC(1c782f78) SHA1(8255afcffbe21a43f53cfb41867552681403ea47) )
1352   ROM_LOAD( "9234-10_u1-ro1_c1994_mii", 0x000000, 0x000022, BAD_DUMP CRC(1c782f78) SHA1(8255afcffbe21a43f53cfb41867552681403ea47) )
13521353
13531354   ROM_REGION( 0xc0000, "extra", 0 ) // question roms
13541355   ROM_LOAD( "qs9234-01_u7-r0",  0x00000, 0x40000, CRC(c0534aaa) SHA1(4b3cbf03f29fd5b4b8fd423e73c0c8147692fa75) ) /* These 3 roms are on CRT-256 sattalite PCB */
r241919r241920
13561357   ROM_LOAD( "qs9234-01_u5-r0",  0x80000, 0x40000, CRC(293fe305) SHA1(8a551ae8fb4fa4bf329128be1bfd6f1c3ff5a366) )
13571358ROM_END
13581359
1359ROM_START( pbst30a ) /* Dallas DS1204V security key attached to CRT-254 connected to J2 connector labeled 9234-01 U1-RO1 C1993 MII */
1360ROM_START( pbst30b ) /* Dallas DS1204V security key attached to CRT-254 connected to J2 connector labeled 9234-01 U1-RO1 C1993 MII */
13601361   ROM_REGION( 0x80000, "maincpu", 0 )
13611362   ROM_LOAD( "9234-00-01_u9-r0a",  0x00000, 0x10000, CRC(5f058f95) SHA1(98382935340a076bdb1b20c7f16c25b6084599fe) ) /* 9234-00-01  122293 */
13621363   ROM_LOAD( "9234-00-01_u10-r0",  0x10000, 0x10000, CRC(853a1a99) SHA1(45e33442aa7e51c05c9ac8b8458937ee3ff4c21d) )
r241919r241920
13671368   ROM_LOAD( "9234-00-01_u15-r0a", 0x60000, 0x10000, CRC(f10f0d39) SHA1(2b5d5a93adb5251e09160b10c067b6e70289f608) )
13681369
13691370   ROM_REGION( 0x000022, "ds1204", 0 )
1370   ROM_LOAD( "9234-01_u1-r01_c1993_mii", 0x000000, 0x000022, BAD_DUMP CRC(74bf0546) SHA1(eb44a057cf797279ee3456a74e166fa711547ea4) )
1371   ROM_LOAD( "9234-01_u1-ro1_c1993_mii", 0x000000, 0x000022, BAD_DUMP CRC(74bf0546) SHA1(eb44a057cf797279ee3456a74e166fa711547ea4) )
13711372
13721373   ROM_REGION( 0xc0000, "extra", 0 ) // question roms
13731374   ROM_LOAD( "qs9234-01_u7-r0",  0x00000, 0x40000, CRC(c0534aaa) SHA1(4b3cbf03f29fd5b4b8fd423e73c0c8147692fa75) ) /* These 3 roms are on CRT-256 sattalite PCB */
r241919r241920
13861387   ROM_LOAD( "9243-00-01_u15-r0", 0x60000, 0x10000, CRC(27034061) SHA1(cff6be592a4a3ab01c204b081470f224e6186c4d) )
13871388   ROM_RELOAD(     0x70000, 0x10000)
13881389
1390
13891391   ROM_REGION( 0xc0000, "extra", 0 ) // question roms
13901392   ROM_LOAD( "qs9243-00-01_u7-r0",  0x00000, 0x40000, CRC(35f4ca46) SHA1(87917b3017f505fae65d6bfa2c7d6fb503c2da6a) ) /* These 3 roms are on CRT-256 sattalite PCB */
13911393   ROM_LOAD( "qs9243-00-01_u6-r0",  0x40000, 0x40000, CRC(606f1656) SHA1(7f1e3a698a34d3c3b8f9f2cd8d5224b6c096e941) )
r241919r241920
142414261- Great Draw Poker and 7 Stud Poker have been added to the program set
142514272- On page 3-1 legend artwork has changed. PASS has been replaced with
14261428   PASS/PLAY and COLLECT/QUIT has been replaced with COLLECT/QUIT/RAISE
14273- An additional Solitaire Instruction decal has been added to the kit.
1428   This new Instruction decal is to be mounted in a visible location for
14293- An additional Solitaire Instruction decal has beed added to the kit.
1430   This new Instruction decal is to be mounted in a visivle loction for
14291431   players use.
14301432
14311433*/
1434
14321435ROM_START( pitbossm ) /* Dallas DS1204V security key attached to CRT-254 connected to J2 connector labeled 9244-00 U1-RO1 C1994 MII */
14331436   ROM_REGION( 0x80000, "maincpu", 0 )
14341437   ROM_LOAD( "9244-00-01_u9-r0",  0x00000, 0x10000, CRC(8317fea1) SHA1(eb84fdca7cd51883153561785571790d12d0d612) ) /* 9244-00-01 R0  940822 */
r241919r241920
14881491It's currently unknown how to access / enable those features or if it's possible to do so.
14891492
14901493*/
1494
14911495ROM_START( realbrod ) /* Dallas DS1204U-3 security key labeled 9131-20-00-U5-R0A */
14921496   ROM_REGION( 0x400000, "maincpu", 0 )
14931497   /* U32 Empty */
r241919r241920
15181522             one PC16550DN
15191523             one PB255a or L5220574
15201524             One Dallas DS1204 Data Key
1521             One Dallas DS1225Y 64k Non-volatile SRAM (Mega Touch 4)
1522              or Dallas DS1230Y 256K Non-volatile SRAM (Mega Touch 6)
1525             One Dallas DS1225Y 64k Non-volitile SRAM (Mega Touch 4)
1526              or Dallas DS1230Y 256K Non-volitile SRAM (Mega Touch 6)
15231527              or Dallas DS1644 32K NVRAM + RTC (Tournament sets)
15241528             Two Z80APIO (Z0842004PSC)
15251529
r241919r241920
22882292
22892293/* CRT-250 + CRT-252 + CRT-256 + CRT-258 */
22902294GAME( 1994, mtjpoker,  0,        meritm_crt250_crt252_crt258, mtjpoker,   driver_device, 0,  ROT0, "Merit", "Merit Touch Joker Poker (9132-00)", GAME_IMPERFECT_GRAPHICS )
2291GAME( 1994, megat,     0,        meritm_crt250_crt252_crt258, pbst30,     driver_device, 0,  ROT0, "Merit", "Pit Boss Megatouch (9234-20-01)", GAME_IMPERFECT_GRAPHICS )
22922295GAME( 1994, pbst30,    0,        meritm_crt250_crt252_crt258, pbst30,     driver_device, 0,  ROT0, "Merit", "Pit Boss Supertouch 30 (9234-10-01)", GAME_IMPERFECT_GRAPHICS )
2293GAME( 1993, pbst30a,   pbst30,   meritm_crt250_crt252_crt258, pbst30,     driver_device, 0,  ROT0, "Merit", "Pit Boss Supertouch 30 (9234-00-01)", GAME_IMPERFECT_GRAPHICS )
2296GAME( 1993, pbst30b,   pbst30,   meritm_crt250_crt252_crt258, pbst30,     driver_device, 0,  ROT0, "Merit", "Pit Boss Supertouch 30 (9234-00-01)", GAME_IMPERFECT_GRAPHICS )
22942297
22952298/* CRT-250 + CRT-254 + CRT-256 */
22962299GAME( 1993, pbss330,   0,        meritm_crt250_questions, pbss330,  driver_device, 0, ROT0, "Merit", "Pit Boss Superstar III 30 (9233-00-01)", GAME_IMPERFECT_GRAPHICS )
trunk/src/mame/drivers/naomi.c
r241919r241920
26612661 */
26622662
26632663static MACHINE_CONFIG_DERIVED( naomim4, naomi_base )
2664   MCFG_NAOMI_M4_BOARD_ADD("rom_board", ":pic_readout", "naomibd_eeprom", ":boardid", WRITE8(dc_state, g1_irq))
2664   MCFG_NAOMI_M4_BOARD_ADD("rom_board", ":rom_key", "naomibd_eeprom", ":boardid", WRITE8(dc_state, g1_irq))
26652665MACHINE_CONFIG_END
26662666
26672667/*
r241919r241920
55975597   ROM_LOAD( "fpr-24333.ic8", 0x0000000, 0x4000000, CRC(a467b69c) SHA1(66a841b72ef1bb8cbabbfb1d14081b4dff14b1d3) )
55985598   ROM_LOAD( "fpr-24334.ic9", 0x4000000, 0x4000000, CRC(13d2d1dc) SHA1(6a47cfaddf006e6ff46837fac956fbcc20619d79) )
55995599
5600   // ROM_REGION( 4, "rom_key", 0 )
5601   // ROM_LOAD( "mushik2e-key.bin", 0, 4, CRC(b32a0633) SHA1(984c01e43cf359d8e8a0c6cb1a04c5dc3da47d39) )
5602   ROM_REGION( 20, "pic_readout", 0 ) // data obtained using a custom PIC reader
5603   ROM_LOAD( "317-0437-com.ic3", 0, 20, NO_DUMP )
5600   ROM_REGION( 4, "rom_key", 0 )
5601   ROM_LOAD( "mushik2e-key.bin", 0, 4, CRC(b32a0633) SHA1(984c01e43cf359d8e8a0c6cb1a04c5dc3da47d39) )
56045602
56055603   ROM_REGION(0x4, "boardid", ROMREGION_ERASEVAL(0x02))
56065604ROM_END
r241919r241920
56145612   ROM_LOAD( "epr-24357.ic7", 0x0000000, 0x0400000, CRC(a2236d58) SHA1(3746b9d3c0f7ecf6340619bb8bf01f170ac4efb7) ) // EPR mode, overwrite FPR data
56155613   ROM_LOAD( "fpr-24334.ic9", 0x4000000, 0x4000000, CRC(13d2d1dc) SHA1(6a47cfaddf006e6ff46837fac956fbcc20619d79) )
56165614
5617   // ROM_REGION( 4, "rom_key", 0 )
5618   // ROM_LOAD( "mushik2e-key.bin", 0, 4, CRC(b32a0633) SHA1(984c01e43cf359d8e8a0c6cb1a04c5dc3da47d39) )
5619   ROM_REGION( 20, "pic_readout", 0 ) // data obtained using a custom PIC reader
5620   ROM_LOAD( "317-0437-com.ic3", 0, 20, NO_DUMP )
5615   ROM_REGION( 4, "rom_key", 0 )
5616   ROM_LOAD( "mushik2e-key.bin", 0, 4, CRC(b32a0633) SHA1(984c01e43cf359d8e8a0c6cb1a04c5dc3da47d39) )
56215617
56225618   ROM_REGION(0x4, "boardid", ROMREGION_ERASEVAL(0x82))
56235619ROM_END
r241919r241920
56305626   ROM_LOAD( "fpr-24338.ic8", 0x0000000, 0x4000000, CRC(1423c374) SHA1(e6a3f0eaccd13c161d07705bcd00f447f08fc186) )
56315627   ROM_LOAD( "fpr-24339.ic9", 0x4000000, 0x4000000, CRC(11883792) SHA1(1782db04f74394f981f887ab1a95d687eb2c0b35) )
56325628
5633   // ROM_REGION( 4, "rom_key", 0 )
5634   // ROM_LOAD( "zunou-key.bin", 0, 4, CRC(cbe35afb) SHA1(78877655800aae27661bf720e1c37d6c6f2e3d1c) )
5635   ROM_REGION( 20, "pic_readout", 0 ) // data obtained using a custom PIC reader
5636   ROM_LOAD( "317-0435-jpn.ic3", 0, 20, NO_DUMP )
5629   ROM_REGION( 4, "rom_key", 0 )
5630   ROM_LOAD( "zunou-key.bin", 0, 4, CRC(cbe35afb) SHA1(78877655800aae27661bf720e1c37d6c6f2e3d1c) )
56375631
56385632   ROM_REGION(0x4, "boardid", ROMREGION_ERASEVAL(0x02))
56395633ROM_END
r241919r241920
56485642   ROM_LOAD( "fpr-24415.ic10", 0x8000000, 0x4000000, CRC(133c742c) SHA1(89f857a31731dc918afc72b6cb716f5c77cb9d6e) )
56495643   ROM_LOAD( "fpr-24416.ic11", 0xc000000, 0x4000000, CRC(562fb88e) SHA1(172678e3e27cfad7f7e6217c4653a4ba119bfbdf) )
56505644
5651   ROM_REGION( 20, "pic_readout", 0 ) // data obtained using a custom PIC reader
5652   ROM_LOAD( "317-5129-jpn.ic3", 0, 20, CRC(b6191cea) SHA1(13e14ff013bf2728203641303141c016e82b10a3) )
5645   ROM_REGION( 4, "rom_key", 0 )
5646   ROM_LOAD( "sl2007-key.bin", 0, 4, CRC(d5d1e807) SHA1(8a0cc371729c622bb05c5d26b3e39ec31d29ace1) )
56535647
56545648   ROM_REGION(0x4, "boardid", ROMREGION_ERASEVAL(0x04))
56555649ROM_END
r241919r241920
56645658   ROM_LOAD( "fpr-24384.ic10", 0x8000000, 0x4000000, CRC(2e9116c4) SHA1(58903a33c4ce72a1f75aefcab94393fc2e8bd2d9) )
56655659   ROM_LOAD( "fpr-24385.ic11", 0xc000000, 0x4000000, CRC(2b79f45d) SHA1(db97d980bf1590df4b983a4b7786977687238ef5) )
56665660
5667   ROM_REGION( 20, "pic_readout", 0 ) // data obtained using a custom PIC reader
5668   ROM_LOAD( "317-0495-com.ic3", 0, 20, CRC(675aca7b) SHA1(5127189e1f960abf9ed3f643158747d9abcaee1c) )
5661   ROM_REGION( 4, "rom_key", 0 )
5662   ROM_LOAD( "asndynmt-key.bin", 0, 4, CRC(bf5396a9) SHA1(0b27fdc800143fb977cb2f1e937078d7a7006939) )
56695663
56705664   ROM_REGION(0x4, "boardid", ROMREGION_ERASEVAL(0x04))
56715665ROM_END
r241919r241920
56805674   ROM_LOAD( "fpr-24439.ic10", 0x8000000, 0x4000000, CRC(c02040f9) SHA1(27ad2cb45e8a516433917f060ca9798412bb95f7) )
56815675   // IC11 Populated, Empty
56825676
5683   ROM_REGION( 20, "pic_readout", 0 ) // data obtained using a custom PIC reader
5684   ROM_LOAD( "317-5131-jpn.ic3", 0, 20, CRC(44ab8ca9) SHA1(c17b10041e70590547ed010dc16a4dd2510fcc80) )
5677   ROM_REGION( 4, "rom_key", 0 )
5678   ROM_LOAD( "illvelo-key.bin", 0, 4, CRC(e164952f) SHA1(6c0dfe567640e1e843a5d7bf858a24c101dfcf95) )
56855679
56865680   ROM_REGION(0x4, "boardid", ROMREGION_ERASEVAL(0x04))
56875681ROM_END
r241919r241920
56965690   ROM_LOAD( "ic10.bin", 0x8000000, 0x4000000, CRC(76fb945f) SHA1(448be0c3d9a7c3956dd51aca3c4d8d28f8cec227) )
56975691   // IC11 Populated, Empty
56985692
5699   ROM_REGION( 20, "pic_readout", 0 ) // data obtained using a custom PIC reader
5700   ROM_LOAD( "317-5132-jpn.ic3", 0, 20, CRC(f2089de5) SHA1(12af0681decb22bbfa4b3e01037c3503846f265a) )
5693   ROM_REGION( 4, "rom_key", 0 )
5694   ROM_LOAD( "mamonoro-key.bin", 0x000000, 0x000004, CRC(264ca27a) SHA1(3b81b9794d86697f8eac7ea6945d992564ad6199) )
57015695
57025696   ROM_REGION(0x4, "boardid", ROMREGION_ERASEVAL(0x04))
57035697ROM_END
r241919r241920
57145708   ROM_LOAD( "ic12.bin",     0x10000000, 0x4000000, CRC(b8a6bff2) SHA1(befbc2e917b3107f1c4bfb9169623282ff97bfb2) )
57155709   ROM_LOAD( "ic13.bin",     0x14000000, 0x4000000, CRC(4886329f) SHA1(6ccf6fb83cfdbef3f85f6c06e641c38ff434d605) )
57165710
5717   ROM_REGION( 20, "pic_readout", 0 ) // data obtained using a custom PIC reader
5718   ROM_LOAD( "317-5133-jpn.ic3", 0, 20, CRC(3dc7d902) SHA1(bb70e80dff878bca3652088f3333079e0781f482) )
5711   ROM_REGION( 4, "rom_key", 0 )
5712   ROM_LOAD( "mbaa-key.bin", 0x000000, 0x000004, CRC(f4ad909f) SHA1(27ba44592c2642b5862a24f68c755ad4115e6047) )
57195713
57205714   ROM_REGION(0x4, "boardid", ROMREGION_ERASEVAL(0x06))
57215715ROM_END
r241919r241920
57335727   ROM_LOAD( "ic12.bin",     0x10000000, 0x4000000, CRC(b8a6bff2) SHA1(befbc2e917b3107f1c4bfb9169623282ff97bfb2) )
57345728   ROM_LOAD( "ic13.bin",     0x14000000, 0x4000000, CRC(4886329f) SHA1(6ccf6fb83cfdbef3f85f6c06e641c38ff434d605) )
57355729
5736   ROM_REGION( 20, "pic_readout", 0 ) // data obtained using a custom PIC reader
5737   ROM_LOAD( "317-5133-jpn.ic3", 0, 20, CRC(3dc7d902) SHA1(bb70e80dff878bca3652088f3333079e0781f482) )
5730   ROM_REGION( 4, "rom_key", 0 )
5731   ROM_LOAD( "mbaa-key.bin", 0x000000, 0x000004, CRC(f4ad909f) SHA1(27ba44592c2642b5862a24f68c755ad4115e6047) )
57385732
57395733   ROM_REGION(0x4, "boardid", ROMREGION_ERASEVAL(0x86))
57405734ROM_END
r241919r241920
57485742   ROM_LOAD( "ic9.bin", 0x4000000, 0x4000000, CRC(16cf2e7a) SHA1(ff7c6540e4507f84e3128ba03be4826ba504678c) )
57495743   // IC10 and IC11 Populated, Empty
57505744
5751   ROM_REGION( 20, "pic_readout", 0 ) // data obtained using a custom PIC reader
5752   ROM_LOAD( "317-5138-jpn.ic3", 0, 20, CRC(babcc420) SHA1(653cdcfa388426f4ce03c76506046ec6fd070562) )
5745   ROM_REGION( 4, "rom_key", 0 )
5746   ROM_LOAD( "radirgyn-key.bin", 0x000000, 0x000004, CRC(c158cf3b) SHA1(c128646d7fee79fc10bf7bbaa23121f347df77f4) )
57535747
57545748   ROM_REGION(0x4, "boardid", ROMREGION_ERASEVAL(0x04))
57555749ROM_END
r241919r241920
57635757   ROM_LOAD( "ic9.bin",    0x4000000, 0x4000000, CRC(18c994d7) SHA1(159e1425b2fc645133814b0d26d93a90e9849b1a) )
57645758   // IC10 and IC11 Populated, Empty
57655759
5766   ROM_REGION( 20, "pic_readout", 0 ) // data obtained using a custom PIC reader
5767   ROM_LOAD( "317-5130-jpn.ic3", 0, 20, CRC(3e0c010b) SHA1(b6da97d4ecb228e73fb9a5ada837d0d6699ab0f1) )
5760   ROM_REGION( 4, "rom_key", 0 )
5761   ROM_LOAD( "ausfache-key.bin", 0, 4, CRC(93cdc793) SHA1(f0a0c321a3bdf8ca87cbd840a168a9057c08f16a) )
57685762
57695763   ROM_REGION(0x4, "boardid", ROMREGION_ERASEVAL(0x04))
57705764ROM_END
r241919r241920
57835777   ROM_REGION( 0x200000, "ioboard", 0) // touch screen I/O board, program disassembles as little-endian SH-4
57845778   ROM_LOAD( "fpr24351.ic14", 0x000000, 0x200000, CRC(4d1b7b89) SHA1(965b8c6b5a2e7b3f1b1e2eac19c86000c3b66754) )
57855779
5786   // ROM_REGION( 4, "rom_key", 0 )
5787   // ROM_LOAD( "pokasuka-key.bin", 0, 4, CRC(f00bcd61) SHA1(b8315b851656c2e0b7853979988d1c44eab0886b) )
5788   ROM_REGION( 20, "pic_readout", 0 ) // data obtained using a custom PIC reader
5789   ROM_LOAD( "317-0461-com.ic3", 0, 20, NO_DUMP )
5780   ROM_REGION( 4, "rom_key", 0 )
5781   ROM_LOAD( "pokasuka-key.bin", 0, 4, CRC(f00bcd61) SHA1(b8315b851656c2e0b7853979988d1c44eab0886b) )
57905782
57915783   ROM_REGION(0x4, "boardid", ROMREGION_ERASEVAL(0x05))
57925784ROM_END
r241919r241920
58055797   ROM_REGION( 0x200000, "ioboard", 0) // touch screen I/O board, program disassembles as little-endian SH-4
58065798   ROM_LOAD( "fpr24351.ic14", 0x000000, 0x200000, CRC(4d1b7b89) SHA1(965b8c6b5a2e7b3f1b1e2eac19c86000c3b66754) )
58075799
5808   // ROM_REGION( 4, "rom_key", 0 )
5809   // ROM_LOAD( "pokasuka-key.bin", 0, 4, CRC(f00bcd61) SHA1(b8315b851656c2e0b7853979988d1c44eab0886b) )
5810   ROM_REGION( 20, "pic_readout", 0 ) // data obtained using a custom PIC reader
5811   ROM_LOAD( "317-0461-com.ic3", 0, 20, NO_DUMP )
5800   ROM_REGION( 4, "rom_key", 0 )
5801   ROM_LOAD( "pokasuka-key.bin", 0, 4, CRC(f00bcd61) SHA1(b8315b851656c2e0b7853979988d1c44eab0886b) )
58125802
58135803   ROM_REGION(0x4, "boardid", ROMREGION_ERASEVAL(0x05))
58145804ROM_END
r241919r241920
58265816   ROM_LOAD( "fpr-24425.ic10", 0x08000000, 0x4000000, CRC(6223ebac) SHA1(64c0ec61c108acbb557e7d3837f578deba832cb6) )
58275817   ROM_LOAD( "fpr-24426.ic11", 0x0c000000, 0x4000000, CRC(c78b0981) SHA1(f889acf9065566e11ff985a3b6c4824e364d57ae) )
58285818
5829   ROM_REGION( 20, "pic_readout", 0 ) // data obtained using a custom PIC reader
5830   ROM_LOAD( "317-0503-jpn.ic3", 0, 20, CRC(69fc3f47) SHA1(3a887c62e93fa264b307c954eb39a4fca1bdfad6) )
5819   ROM_REGION( 4, "rom_key", 0 )
5820   ROM_LOAD( "rhytngk-key.bin", 0x000000, 0x000004, CRC(e2560d28) SHA1(46fb9b47a0df3035f92db2b0c63a6e4e0745ad29) )
58315821
58325822   ROM_REGION(0x4, "boardid", ROMREGION_ERASEVAL(0x04))
58335823ROM_END
trunk/src/mame/drivers/prehisle.c
r241919r241920
100100   PORT_DIPNAME( 0x01, 0x01, DEF_STR( Flip_Screen ) )  PORT_DIPLOCATION("SW1:1")
101101   PORT_DIPSETTING(    0x01, DEF_STR( Off ) )
102102   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
103   PORT_DIPNAME( 0x02, 0x02, DEF_STR( Level_Select ) ) PORT_DIPLOCATION("SW1:2")
103   PORT_DIPNAME( 0x02, 0x02, DEF_STR( Level_Select ) )     PORT_DIPLOCATION("SW1:2")
104104   PORT_DIPSETTING(    0x02, DEF_STR( Off ) )
105105   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
106106   PORT_DIPNAME( 0x04, 0x04, DEF_STR( Bonus_Life ) )   PORT_DIPLOCATION("SW1:3")
r241919r241920
126126   PORT_DIPSETTING(    0x03, DEF_STR( Standard ) )
127127   PORT_DIPSETTING(    0x01, "Middle" )
128128   PORT_DIPSETTING(    0x00, DEF_STR( Difficult ) )
129   PORT_DIPNAME( 0x0c, 0x0c, "Game Mode" )             PORT_DIPLOCATION("SW2:3,4")
129   PORT_DIPNAME( 0x0c, 0x0c, "Game Mode" )         PORT_DIPLOCATION("SW2:3,4")
130130   PORT_DIPSETTING(    0x08, "Demo Sounds Off" )
131131   PORT_DIPSETTING(    0x0c, "Demo Sounds On" )
132132   PORT_DIPSETTING(    0x00, "Freeze" )
r241919r241920
136136   PORT_DIPSETTING(    0x20, "150K 300K" )
137137   PORT_DIPSETTING(    0x10, "300K 500K" )
138138   PORT_DIPSETTING(    0x00, DEF_STR( None ) )
139   PORT_DIPNAME( 0x40, 0x40, DEF_STR( Allow_Continue ) ) PORT_DIPLOCATION("SW2:7")
139   PORT_DIPNAME( 0x40, 0x40, DEF_STR( Allow_Continue ) )   PORT_DIPLOCATION("SW2:7")
140140   PORT_DIPSETTING(    0x00, DEF_STR( No ) )
141141   PORT_DIPSETTING(    0x40, DEF_STR( Yes ) )
142142   PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_VBLANK("screen")
trunk/src/mame/includes/dooyong.h
r241919r241920
55public:
66   dooyong_state(const machine_config &mconfig, device_type type, const char *tag)
77      : driver_device(mconfig, type, tag),
8         m_spriteram(*this, "spriteram"),
9         m_spriteram16(*this, "spriteram16") ,
10      m_txvideoram(*this, "txvideoram"),
11      m_paletteram_flytiger(*this, "flytiger_palram"),
812      m_maincpu(*this, "maincpu"),
913      m_audiocpu(*this, "audiocpu"),
1014      m_gfxdecode(*this, "gfxdecode"),
11      m_palette(*this, "palette")
12   { }
15      m_palette(*this, "palette")  { }
1316
14   DECLARE_WRITE8_MEMBER(bgscroll_w);
15   DECLARE_WRITE8_MEMBER(bg2scroll_w);
16   DECLARE_WRITE8_MEMBER(fgscroll_w);
17   DECLARE_WRITE8_MEMBER(fg2scroll_w);
18   TILE_GET_INFO_MEMBER(get_bg_tile_info);
19   TILE_GET_INFO_MEMBER(get_bg2_tile_info);
20   TILE_GET_INFO_MEMBER(get_fg_tile_info);
21   TILE_GET_INFO_MEMBER(get_fg2_tile_info);
22   inline void get_tile_info(tile_data &tileinfo, int tile_index, UINT8 const *tilerom, UINT8 const *scroll, int graphics);
23   inline void scroll8_w(offs_t offset, UINT8 data, UINT8 *scroll, tilemap_t *map);
24
17   optional_device<buffered_spriteram8_device> m_spriteram;
18   optional_device<buffered_spriteram16_device> m_spriteram16;
19   optional_shared_ptr<UINT8> m_txvideoram;
20   optional_shared_ptr<UINT8> m_paletteram_flytiger;
21   UINT8 m_sprites_disabled;
22   UINT8 m_flytiger_palette_bank;
23   UINT8 m_flytiger_pri;
24   UINT8 m_tx_pri;
25   UINT16 m_rshark_pri;
2526   tilemap_t *m_bg_tilemap;
2627   tilemap_t *m_bg2_tilemap;
2728   tilemap_t *m_fg_tilemap;
r241919r241920
3536   UINT8 *m_bg2_tilerom;
3637   UINT8 *m_fg_tilerom;
3738   UINT8 *m_fg2_tilerom;
39   UINT8 *m_bg_tilerom2;
40   UINT8 *m_bg2_tilerom2;
41   UINT8 *m_fg_tilerom2;
42   UINT8 *m_fg2_tilerom2;
3843   int m_bg_gfx;
3944   int m_bg2_gfx;
4045   int m_fg_gfx;
4146   int m_fg2_gfx;
47   int m_tx_tilemap_mode;
4248
43   required_device<cpu_device> m_maincpu;
44   required_device<cpu_device> m_audiocpu;
45   required_device<gfxdecode_device> m_gfxdecode;
46   required_device<palette_device> m_palette;
47};
49   int m_interrupt_line_1;
50   int m_interrupt_line_2;
4851
49class dooyong_z80_state : public dooyong_state
50{
51public:
52   dooyong_z80_state(const machine_config &mconfig, device_type type, const char *tag)
53      : dooyong_state(mconfig, type, tag),
54      m_txvideoram(*this, "txvideoram"),
55      m_paletteram_flytiger(*this, "flytiger_palram"),
56      m_spriteram(*this, "spriteram")
57   { }
58
59   enum
60   {
61      SPRITE_12BIT = 0x01,
62      SPRITE_HEIGHT = 0x02,
63      SPRITE_YSHIFT_BLUEHAWK = 0x04,
64      SPRITE_YSHIFT_FLYTIGER = 0x08
65   };
66
52   DECLARE_WRITE8_MEMBER(lastday_bankswitch_w);
6753   DECLARE_WRITE8_MEMBER(flip_screen_w);
68   DECLARE_WRITE8_MEMBER(bankswitch_w);
69   DECLARE_WRITE8_MEMBER(txvideoram_w);
54   DECLARE_WRITE8_MEMBER(dooyong_bgscroll8_w);
55   DECLARE_WRITE8_MEMBER(dooyong_bg2scroll8_w);
56   DECLARE_WRITE8_MEMBER(dooyong_fgscroll8_w);
57   DECLARE_WRITE8_MEMBER(dooyong_fg2scroll8_w);
58   DECLARE_WRITE16_MEMBER(dooyong_bgscroll16_w);
59   DECLARE_WRITE16_MEMBER(dooyong_bg2scroll16_w);
60   DECLARE_WRITE16_MEMBER(dooyong_fgscroll16_w);
61   DECLARE_WRITE16_MEMBER(dooyong_fg2scroll16_w);
62   DECLARE_WRITE8_MEMBER(dooyong_txvideoram8_w);
63   DECLARE_WRITE8_MEMBER(lastday_ctrl_w);
64   DECLARE_WRITE8_MEMBER(pollux_ctrl_w);
7065   DECLARE_WRITE8_MEMBER(primella_ctrl_w);
7166   DECLARE_WRITE8_MEMBER(paletteram_flytiger_w);
7267   DECLARE_WRITE8_MEMBER(flytiger_ctrl_w);
68   DECLARE_WRITE16_MEMBER(rshark_ctrl_w);
69   DECLARE_READ8_MEMBER(unk_r);
70   TILE_GET_INFO_MEMBER(get_bg_tile_info);
71   TILE_GET_INFO_MEMBER(get_bg2_tile_info);
72   TILE_GET_INFO_MEMBER(get_fg_tile_info);
73   TILE_GET_INFO_MEMBER(get_fg2_tile_info);
74   TILE_GET_INFO_MEMBER(flytiger_get_fg_tile_info);
7375   TILE_GET_INFO_MEMBER(get_tx_tile_info);
74   void draw_sprites(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect, unsigned extensions = 0);
75   UINT32 screen_update_bluehawk(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
76   UINT32 screen_update_flytiger(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
77   UINT32 screen_update_primella(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
78   DECLARE_MACHINE_START(cpu_z80);
76   inline void lastday_get_tile_info(tile_data &tileinfo, int tile_index, const UINT8 *tilerom, UINT8 *scroll, int graphics);
77   inline void rshark_get_tile_info(tile_data &tileinfo, int tile_index, const UINT8 *tilerom1, const UINT8 *tilerom2, UINT8 *scroll, int graphics);
78   DECLARE_MACHINE_START(lastday);
79   DECLARE_MACHINE_RESET(sound_ym2203);
80   DECLARE_VIDEO_START(lastday);
81   DECLARE_VIDEO_START(gulfstrm);
82   DECLARE_VIDEO_START(pollux);
7983   DECLARE_VIDEO_START(bluehawk);
8084   DECLARE_VIDEO_START(flytiger);
8185   DECLARE_VIDEO_START(primella);
82
83   required_shared_ptr<UINT8> m_txvideoram;
84   optional_shared_ptr<UINT8> m_paletteram_flytiger;
85   UINT8 m_sprites_disabled;
86   UINT8 m_flytiger_palette_bank;
87   UINT8 m_flytiger_pri;
88   UINT8 m_tx_pri;
89   int m_tx_tilemap_mode;
90
91   optional_device<buffered_spriteram8_device> m_spriteram;
92};
93
94class dooyong_z80_ym2203_state : public dooyong_z80_state
95{
96public:
97   dooyong_z80_ym2203_state(const machine_config &mconfig, device_type type, const char *tag)
98      : dooyong_z80_state(mconfig, type, tag)
99   { }
100
101   DECLARE_WRITE8_MEMBER(lastday_ctrl_w);
102   DECLARE_WRITE8_MEMBER(pollux_ctrl_w);
103   DECLARE_WRITE_LINE_MEMBER(irqhandler_2203_1);
104   DECLARE_WRITE_LINE_MEMBER(irqhandler_2203_2);
105   DECLARE_READ8_MEMBER(unk_r);
106   DECLARE_MACHINE_RESET(sound_ym2203);
86   DECLARE_VIDEO_START(rshark);
87   DECLARE_VIDEO_START(popbingo);
10788   UINT32 screen_update_lastday(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
10889   UINT32 screen_update_gulfstrm(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
10990   UINT32 screen_update_pollux(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
110   DECLARE_VIDEO_START(lastday);
111   DECLARE_VIDEO_START(gulfstrm);
112   DECLARE_VIDEO_START(pollux);
113
114   int m_interrupt_line_1;
115   int m_interrupt_line_2;
116};
117
118class dooyong_68k_state : public dooyong_state
119{
120public:
121   dooyong_68k_state(const machine_config &mconfig, device_type type, const char *tag)
122      : dooyong_state(mconfig, type, tag),
123      m_spriteram(*this, "spriteram")
124   { }
125
126   DECLARE_WRITE16_MEMBER(ctrl_w);
127   TIMER_DEVICE_CALLBACK_MEMBER(scanline);
128   TILE_GET_INFO_MEMBER(rshark_get_bg_tile_info);
129   TILE_GET_INFO_MEMBER(rshark_get_bg2_tile_info);
130   TILE_GET_INFO_MEMBER(rshark_get_fg_tile_info);
131   TILE_GET_INFO_MEMBER(rshark_get_fg2_tile_info);
132   inline void rshark_get_tile_info(tile_data &tileinfo, int tile_index, UINT8 const *tilerom1, UINT8 const *tilerom2, UINT8 const *scroll, int graphics);
133   void draw_sprites(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
91   UINT32 screen_update_bluehawk(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
92   UINT32 screen_update_flytiger(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
93   UINT32 screen_update_primella(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
13494   UINT32 screen_update_rshark(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
13595   UINT32 screen_update_popbingo(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
136   DECLARE_VIDEO_START(rshark);
137   DECLARE_VIDEO_START(popbingo);
138
139   UINT8 *m_bg_tilerom2;
140   UINT8 *m_bg2_tilerom2;
141   UINT8 *m_fg_tilerom2;
142   UINT8 *m_fg2_tilerom2;
143   UINT16 m_bg2_priority;
144
145   required_device<buffered_spriteram16_device> m_spriteram;
96   TIMER_DEVICE_CALLBACK_MEMBER(rshark_scanline);
97   inline void dooyong_scroll8_w(offs_t offset, UINT8 data, UINT8 *scroll, tilemap_t *map);
98   void draw_sprites(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect, int pollux_extensions);
99   void rshark_draw_sprites(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
100   DECLARE_WRITE_LINE_MEMBER(irqhandler_2203_1);
101   DECLARE_WRITE_LINE_MEMBER(irqhandler_2203_2);
102   required_device<cpu_device> m_maincpu;
103   required_device<cpu_device> m_audiocpu;
104   required_device<gfxdecode_device> m_gfxdecode;
105   required_device<palette_device> m_palette;
146106};
trunk/src/mame/includes/prehisle.h
r241919r241920
2323   tilemap_t *m_bg2_tilemap;
2424   tilemap_t *m_bg_tilemap;
2525   tilemap_t *m_fg_tilemap;
26
2726   DECLARE_WRITE16_MEMBER(prehisle_sound16_w);
2827   DECLARE_WRITE16_MEMBER(prehisle_bg_videoram16_w);
2928   DECLARE_WRITE16_MEMBER(prehisle_fg_videoram16_w);
r241919r241920
3635   TILE_GET_INFO_MEMBER(get_fg_tile_info);
3736   virtual void video_start();
3837   UINT32 screen_update_prehisle(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
39   void draw_sprites(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
38   void draw_sprites(bitmap_ind16 &bitmap, const rectangle &cliprect, int foreground );
4039   DECLARE_WRITE_LINE_MEMBER(irqhandler);
41
4240   required_device<cpu_device> m_maincpu;
4341   required_device<cpu_device> m_audiocpu;
4442   required_device<upd7759_device> m_upd7759;
trunk/src/mame/layout/alinvade.lay
r241919r241920
1<?xml version="1.0"?>
2<mamelayout version="2">
3   <element name="overlay">
4      <rect>
5         <bounds left="0" top="0" right="127" bottom="23" />
6         <color red="1" green="1" blue="0.60" />
7      </rect>
8      <rect>
9         <bounds left="0" top="24" right="127" bottom="82" />
10         <color red="0.25" green="1" blue="0.65" />
11      </rect>
12      <rect>
13         <bounds left="0" top="83" right="127" bottom="127" />
14         <color red="1" green="0.125" blue="0.125" />
15      </rect>
16   </element>
17
18   <view name="Color Overlay">
19      <screen index="0">
20         <bounds left="0" top="0" right="3" bottom="4" />
21      </screen>
22      <overlay name="overlay" element="overlay">
23         <bounds left="0" top="0" right="3" bottom="4" />
24      </overlay>
25   </view>
26</mamelayout>
trunk/src/mame/machine/naomim4.c
r241919r241920
1616// phase is indeed a nibble-based linear combination.
1717// With that block cipher, a stream cipher is constructed by feeding the output result of the 1st round
1818// of a certain 16-bits block as a whitening value for the next block. The cart dependent data used by
19// the algorithm is a 32-bits key stored in the PIC16C621A. The hardware auto-reset the feed value
19// the algorithm is comprised by a 16-bits "key" and a 16-bits IV (initialization vector) --though they
20// will be merged in a only 32-bits number in the code--. The hardware auto-reset the feed value
2021// to the cart-based IV every 16 blocks (32 bytes); that reset is not address-based, but index-based.
2122
2223const device_type NAOMI_M4_BOARD = &device_creator<naomi_m4_board>;
2324
2425const UINT8 naomi_m4_board::k_sboxes[4][16] = {
25   {9,8,2,11,1,14,5,15,12,6,0,3,7,13,10,4},
26   {2,10,0,15,14,1,11,3,7,12,13,8,4,9,5,6},
27   {4,11,3,8,7,2,15,13,1,5,14,9,6,12,0,10},
28   {1,13,8,2,0,5,6,14,4,11,15,10,12,3,7,9}
26   {13,14,1,11,7,9,10,0,15,6,4,5,8,2,12,3},
27   {12,3,14,6,7,15,2,13,1,4,11,0,9,10,8,5},
28   {6,12,0,10,1,5,14,9,7,2,15,13,4,11,3,8},
29   {9,12,8,7,10,4,0,15,1,11,14,2,13,5,6,3}
2930};
3031
3132// from S29GL512N datasheet
r241919r241920
6667   key = tempkey & 0xffff;
6768#else
6869   const UINT8 *key_data = memregion(key_tag)->base();
69   subkey1 = (key_data[17] << 8) | key_data[16];
70   subkey2 = (key_data[19] << 8) | key_data[18];
70   key = (key_data[2] << 8) | key_data[3];
71   iv = (key_data[0] << 8) | key_data[1];
7172#endif
7273   buffer = auto_alloc_array(machine(), UINT8, BUFFER_SIZE);
7374   enc_init();
r241919r241920
116117   encryption = false;
117118   cfi_mode = false;
118119   counter = 0;
119   iv = 0;
120   cur_iv = 0;
120121}
121122
122123void naomi_m4_board::board_setup_address(UINT32 address, bool is_dma)
r241919r241920
175176void naomi_m4_board::enc_reset()
176177{
177178   buffer_actual_size = 0;
178   iv = 0;
179   cur_iv = iv;
179180   counter = 0;
180181}
181182
182UINT16 naomi_m4_board::decrypt_one_round(UINT16 word, UINT16 subkey)
183{
184   return one_round[word ^ subkey] ^ subkey ;
185}
186
187183void naomi_m4_board::enc_fill()
188184{
189185   const UINT8 *base = m_region->base() + rom_cur_address;
190186   while(buffer_actual_size < BUFFER_SIZE) {
191187      UINT16 enc = base[0] | (base[1] << 8);
192      UINT16 dec = iv;
193      iv = decrypt_one_round(enc ^ iv, subkey1);
194      dec ^= decrypt_one_round(iv, subkey2);
195     
188      UINT16 output_whitening = key ^ cur_iv;
189      cur_iv = one_round[enc ^ cur_iv];
190      UINT16 dec = one_round[key ^ cur_iv] ^ output_whitening;
191
196192      buffer[buffer_actual_size++] = dec;
197193      buffer[buffer_actual_size++] = dec >> 8;
198194
r241919r241920
202198      counter++;
203199      if(counter == 16) {
204200         counter = 0;
205         iv = 0;
201         cur_iv = iv;
206202      }
207203   }
208204}
trunk/src/mame/machine/naomim4.h
r241919r241920
3232   static const UINT8 k_sboxes[4][16];
3333
3434   const char *key_tag;
35   UINT16 subkey1, subkey2;
35   UINT16 key, iv;
3636   UINT16 *one_round;
3737
3838   UINT8 *buffer;
3939   UINT32 rom_cur_address, buffer_actual_size;
40   UINT16 iv;
40   UINT16 cur_iv;
4141   UINT8 counter;
4242   bool encryption;
4343   bool cfi_mode;
r241919r241920
4545   void enc_init();
4646   void enc_reset();
4747   void enc_fill();
48   UINT16 decrypt_one_round(UINT16 word, UINT16 subkey);
4948};
5049
5150extern const device_type NAOMI_M4_BOARD;
trunk/src/mame/mame.lst
r241919r241920
1053110531pitbossma       // (c) 1994 Merit
1053210532pbss330         // (c) 1994 Merit
1053310533pbst30          // (c) 1994 Merit
10534pbst30a         // (c) 1993 Merit
10534pbst30b         // (c) 1993 Merit
1053510535realbrod        // (c) 1995 Merit
1053610536mtjpoker        // (c) 1994 Merit
10537megat           // (c) 1994 Merit
1053810537megat2          // (c) 1994 Merit
1053910538megat2a         // (c) 1994 Merit
1054010539megat2b         // (c) 1994 Merit
trunk/src/mame/mame.mak
r241919r241920
24802480
24812481$(DRIVERS)/acefruit.o:  $(LAYOUT)/sidewndr.lh
24822482
2483$(DRIVERS)/alinvade.o:  $(LAYOUT)/alinvade.lh
2484
24852483$(DRIVERS)/allied.o:    $(LAYOUT)/allied.lh
24862484
24872485$(DRIVERS)/amaticmg.o:  $(LAYOUT)/suprstar.lh
trunk/src/mame/video/dooyong.c
r241919r241920
22#include "includes/dooyong.h"
33
44
5inline void dooyong_state::scroll8_w(offs_t offset, UINT8 data, UINT8 *scroll, tilemap_t *map)
5inline void dooyong_state::dooyong_scroll8_w(offs_t offset, UINT8 data, UINT8 *scroll, tilemap_t *map)
66{
77   UINT8 old = scroll[offset];
88   if (old != data)
r241919r241920
1818         break;
1919      case 3: /* Low byte of y scroll */
2020      case 4: /* High byte of y scroll */
21         map->set_scrolly(0, (unsigned)scroll[3] | ((unsigned)scroll[4] << 8));
21         map->set_scrolly(0, (int)scroll[3] | ((int)scroll[4] << 8));
2222         break;
2323      case 6: /* Tilemap enable and mode control */
2424         map->enable(!(data & 0x10));
r241919r241920
4343}
4444
4545
46/* These handle writes to the tilemap scroll registers.
46/* These handle writes to the tilemap scroll registers in 8-bit machines.
4747   There is one per tilemap, wrapping the above function that does the work. */
4848
49WRITE8_MEMBER(dooyong_state::bgscroll_w)
49WRITE8_MEMBER(dooyong_state::dooyong_bgscroll8_w)
5050{
51   scroll8_w(offset, data, m_bgscroll8, m_bg_tilemap);
51   dooyong_scroll8_w(offset, data, m_bgscroll8, m_bg_tilemap);
5252}
5353
54WRITE8_MEMBER(dooyong_state::bg2scroll_w)
54WRITE8_MEMBER(dooyong_state::dooyong_bg2scroll8_w)
5555{
56   scroll8_w(offset, data, m_bg2scroll8, m_bg2_tilemap);
56   dooyong_scroll8_w(offset, data, m_bg2scroll8, m_bg2_tilemap);
5757}
5858
59WRITE8_MEMBER(dooyong_state::fgscroll_w)
59WRITE8_MEMBER(dooyong_state::dooyong_fgscroll8_w)
6060{
61   scroll8_w(offset, data, m_fgscroll8, m_fg_tilemap);
61   dooyong_scroll8_w(offset, data, m_fgscroll8, m_fg_tilemap);
6262}
6363
64WRITE8_MEMBER(dooyong_state::fg2scroll_w)
64WRITE8_MEMBER(dooyong_state::dooyong_fg2scroll8_w)
6565{
66   scroll8_w(offset, data, m_fg2scroll8, m_fg2_tilemap);
66   dooyong_scroll8_w(offset, data, m_fg2scroll8, m_fg2_tilemap);
6767}
6868
6969
70WRITE8_MEMBER(dooyong_z80_state::txvideoram_w)
70/* These handle writes to the tilemap scroll registers in 16-bit machines.
71   This is just an 8-bit peripheral in a 16-bit machine. */
72
73WRITE16_MEMBER(dooyong_state::dooyong_bgscroll16_w)
7174{
75   if (ACCESSING_BITS_0_7) dooyong_bgscroll8_w(space, offset, data & 0x00ff);
76}
77
78WRITE16_MEMBER(dooyong_state::dooyong_bg2scroll16_w)
79{
80   if (ACCESSING_BITS_0_7) dooyong_bg2scroll8_w(space, offset, data & 0x00ff);
81}
82
83WRITE16_MEMBER(dooyong_state::dooyong_fgscroll16_w)
84{
85   if (ACCESSING_BITS_0_7) dooyong_fgscroll8_w(space, offset, data & 0x00ff);
86}
87
88WRITE16_MEMBER(dooyong_state::dooyong_fg2scroll16_w)
89{
90   if (ACCESSING_BITS_0_7) dooyong_fg2scroll8_w(space, offset, data & 0x00ff);
91}
92
93
94WRITE8_MEMBER(dooyong_state::dooyong_txvideoram8_w)
95{
7296   if (m_txvideoram[offset] != data)
7397   {
7498      m_txvideoram[offset] = data;
r241919r241920
82106
83107/* Control registers seem to be different on every game */
84108
85WRITE8_MEMBER(dooyong_z80_ym2203_state::lastday_ctrl_w)
109WRITE8_MEMBER(dooyong_state::lastday_ctrl_w)
86110{
87111   /* bits 0 and 1 are coin counters */
88112   coin_counter_w(machine(), 0, data & 0x01);
r241919r241920
97121   flip_screen_set(data & 0x40);
98122}
99123
100WRITE8_MEMBER(dooyong_z80_ym2203_state::pollux_ctrl_w)
124WRITE8_MEMBER(dooyong_state::pollux_ctrl_w)
101125{
102126   /* bit 0 is flip screen */
103127   flip_screen_set(data & 0x01);
r241919r241920
112136   /* bit 4 is used but unknown */
113137}
114138
115WRITE8_MEMBER(dooyong_z80_state::primella_ctrl_w)
139WRITE8_MEMBER(dooyong_state::primella_ctrl_w)
116140{
117141   /* bits 0-2 select ROM bank */
118142   membank("bank1")->set_entry(data & 0x07);
r241919r241920
128152//  logerror("%04x: bankswitch = %02x\n",space.device().safe_pc(),data&0xe0);
129153}
130154
131WRITE8_MEMBER(dooyong_z80_state::paletteram_flytiger_w)
155WRITE8_MEMBER(dooyong_state::paletteram_flytiger_w)
132156{
133157   if (m_flytiger_palette_bank)
134158   {
r241919r241920
139163   }
140164}
141165
142WRITE8_MEMBER(dooyong_z80_state::flytiger_ctrl_w)
166WRITE8_MEMBER(dooyong_state::flytiger_ctrl_w)
143167{
144168   /* bit 0 is flip screen */
145169   flip_screen_set(data & 0x01);
r241919r241920
153177   m_flytiger_pri = data & 0x10;
154178}
155179
180WRITE16_MEMBER(dooyong_state::rshark_ctrl_w)
156181
182{
183   if (ACCESSING_BITS_0_7)
184   {
185      /* bit 0 flips screen */
186      flip_screen_set(data & 0x0001);
187
188      /* bit 4 changes tilemaps priority */
189      m_rshark_pri = data & 0x0010;
190
191      /* bit 5 used but unknown */
192   }
193}
194
195
157196/* These games all have ROM-based tilemaps for the backgrounds, title
158197   screens and sometimes "bosses" and special attacks. There are three
159198   schemes for tilemap encoding.  The scheme is chosen based on the
r241919r241920
164203   when the x scroll moves out of range (trying to decode the whole lot
165204   at once uses hundreds of megabytes of RAM). */
166205
167inline void dooyong_state::get_tile_info(tile_data &tileinfo, int tile_index,
168      UINT8 const *tilerom, UINT8 const *scroll, int graphics)
206inline void dooyong_state::lastday_get_tile_info(tile_data &tileinfo, int tile_index,
207      const UINT8 *tilerom, UINT8 *scroll, int graphics)
169208{
170   int const offs = (tile_index + ((int)scroll[1] << 6)) * 2;
171   int const attr = tilerom[offs];
209   int offs = (tile_index + ((int)scroll[1] << 6)) * 2;
210   int attr = tilerom[offs];
172211   int code, color, flags;
173212   if (scroll[6] & 0x20)
174213   {   /* lastday/gulfstrm/pollux/flytiger */
r241919r241920
182221         Y = y flip */
183222      code = tilerom[offs + 1] | ((attr & 0x01) << 8) | ((attr & 0x80) << 2);
184223      color = (attr & 0x78) >> 3;
185      flags = TILE_FLIPYX((attr & 0x06) >> 1);
224      flags = ((attr & 0x02) ? TILE_FLIPX : 0) | ((attr & 0x04) ? TILE_FLIPY : 0);
186225   }
187226   else
188   {   /* primella/popbingo */
227   {
228      /* primella */
189229      /* Tiles take two bytes in ROM:
190230                       MSB   LSB
191231         [offs + 0x00] YXCC CCcc    (Y flip, X flip, bits 3-0 of color code, bits 9-8 of gfx code)
r241919r241920
205245
206246      code = tilerom[offs + 1] | ((attr & codemask) << 8);
207247      color = (attr & palmask) >> 2;
208      flags = TILE_FLIPYX((attr & 0xC0) >> 6);
248      flags = ((attr & 0x40) ? TILE_FLIPX : 0) | ((attr & 0x80) ? TILE_FLIPY : 0);
209249   }
210250
211   tileinfo.set(graphics, code, color, flags);
251   SET_TILE_INFO_MEMBER(graphics, code, color, flags);
212252}
213253
254inline void dooyong_state::rshark_get_tile_info(tile_data &tileinfo, int tile_index,
255      const UINT8 *tilerom1, const UINT8 *tilerom2, UINT8 *scroll, int graphics)
256{
257      /* Tiles take two bytes in tile ROM 1:
258                       MSB   LSB
259         [offs + 0x00] YX?c cccc    (Y flip, X flip, bits 12-8 of gfx code)
260         [offs + 0x01] cccc cccc    (bits 7-0 of gfx code)
261         ? = unused/unknown
262         c = gfx code
263         X = x flip
264         Y = y flip */
265   int offs = tile_index + ((int)scroll[1] << 9);
266   int attr = tilerom1[offs * 2];
267   int code = tilerom1[(offs * 2) + 1] | ((attr & 0x1f) << 8);
268   int color = tilerom2[offs] & 0x0f;
269   int flags = ((attr & 0x40) ? TILE_FLIPX : 0) | ((attr & 0x80) ? TILE_FLIPY : 0);
270
271   SET_TILE_INFO_MEMBER(graphics, code, color, flags);
272}
273
214274TILE_GET_INFO_MEMBER(dooyong_state::get_bg_tile_info)
215275{
216   get_tile_info(tileinfo, tile_index, m_bg_tilerom, m_bgscroll8, m_bg_gfx);
276   if (m_bg_tilerom2 != NULL)
277      rshark_get_tile_info(tileinfo, tile_index, m_bg_tilerom, m_bg_tilerom2, m_bgscroll8, m_bg_gfx);
278   else
279      lastday_get_tile_info(tileinfo, tile_index, m_bg_tilerom, m_bgscroll8, m_bg_gfx);
217280}
218281
219282TILE_GET_INFO_MEMBER(dooyong_state::get_bg2_tile_info)
220283{
221   get_tile_info(tileinfo, tile_index, m_bg2_tilerom, m_bg2scroll8, m_bg2_gfx);
284   if (m_bg2_tilerom2 != NULL)
285      rshark_get_tile_info(tileinfo, tile_index, m_bg2_tilerom, m_bg2_tilerom2, m_bg2scroll8, m_bg2_gfx);
286   else
287      lastday_get_tile_info(tileinfo, tile_index, m_bg2_tilerom, m_bg2scroll8, m_bg2_gfx);
222288}
223289
224290TILE_GET_INFO_MEMBER(dooyong_state::get_fg_tile_info)
225291{
226   get_tile_info(tileinfo, tile_index, m_fg_tilerom, m_fgscroll8, m_fg_gfx);
292   if (m_fg_tilerom2 != NULL)
293      rshark_get_tile_info(tileinfo, tile_index, m_fg_tilerom, m_fg_tilerom2, m_fgscroll8, m_fg_gfx);
294   else
295      lastday_get_tile_info(tileinfo, tile_index, m_fg_tilerom, m_fgscroll8, m_fg_gfx);
227296}
228297
229298TILE_GET_INFO_MEMBER(dooyong_state::get_fg2_tile_info)
230299{
231   get_tile_info(tileinfo, tile_index, m_fg2_tilerom, m_fg2scroll8, m_fg2_gfx);
300   if (m_fg2_tilerom2 != NULL)
301      rshark_get_tile_info(tileinfo, tile_index, m_fg2_tilerom, m_fg2_tilerom2, m_fg2scroll8, m_fg2_gfx);
302   else
303      lastday_get_tile_info(tileinfo, tile_index, m_fg2_tilerom, m_fg2scroll8, m_fg2_gfx);
232304}
233305
234TILE_GET_INFO_MEMBER(dooyong_z80_state::get_tx_tile_info)
306/* flytiger uses some palette banking technique or something maybe a trash protection */
307
308TILE_GET_INFO_MEMBER(dooyong_state::flytiger_get_fg_tile_info)
235309{
310   const UINT8 *tilerom = m_fg_tilerom;
311
312   int offs = (tile_index + (m_fgscroll8[1] << 6)) * 2;
313   int attr = tilerom[offs];
314   int code = tilerom[offs + 1] | ((attr & 0x01) << 8) | ((attr & 0x80) << 2);
315   int color = (attr & 0x78) >> 3;
316   int flags = ((attr & 0x02) ? TILE_FLIPX : 0) | ((attr & 0x04) ? TILE_FLIPY : 0);
317
318   SET_TILE_INFO_MEMBER(m_fg_gfx, code, color, flags);
319}
320
321TILE_GET_INFO_MEMBER(dooyong_state::get_tx_tile_info)
322{
236323   /* Each tile takes two bytes of memory:
237324                    MSB   LSB
238325      [offs + 0x00] cccc cccc    (bits 7-0 of gfx code)
239326      [offs + 0x01] CCCC cccc    (bits 3-0 of color code, bits 11-8 of gfx code)
240327      c = gfx code
241328      C = color code */
242   unsigned offs, attr;
329   int offs, attr, code, color;
243330   if (m_tx_tilemap_mode == 0)
244331   {   /* lastday/gulfstrm/pollux/flytiger */
245332      offs = tile_index;
r241919r241920
250337      offs = tile_index * 2;
251338      attr = m_txvideoram[offs + 1];
252339   }
253   int const code = m_txvideoram[offs] | ((attr & 0x0f) << 8);
254   int const color = (attr & 0xf0) >> 4;
340   code = m_txvideoram[offs] | ((attr & 0x0f) << 8);
341   color = (attr & 0xf0) >> 4;
255342
256   tileinfo.set(0, code, color, 0);
343   SET_TILE_INFO_MEMBER(0, code, color, 0);
257344}
258345
259346
260void dooyong_z80_state::draw_sprites(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect, unsigned extensions)
347void dooyong_state::draw_sprites(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect, int pollux_extensions)
261348{
262349   /* Sprites take 32 bytes each in memory:
263350                    MSB   LSB
r241919r241920
277364      w = width
278365      X = x flip
279366      Y = y flip
280      * = alters y position in bluehawk and flytiger - see code below
367      * = alters y position in pollux and flytiger - see code below
281368      bit 11 of gfx code only used by gulfstrm, pollux, bluehawk and flytiger
282369      height only used by pollux, bluehawk and flytiger
283370      x flip and y flip only used by pollux and flytiger */
284371
285   UINT8 const *const buffered_spriteram = m_spriteram->buffer();
286   for (int offs = 0; offs < m_spriteram->bytes(); offs += 32)
372   UINT8 *buffered_spriteram = m_spriteram->buffer();
373   int offs;
374
375   for (offs = 0; offs < m_spriteram->bytes(); offs += 32)
287376   {
288      int sx = buffered_spriteram[offs+3] | ((buffered_spriteram[offs+1] & 0x10) << 4);
289      int sy = buffered_spriteram[offs+2];
290      int code = buffered_spriteram[offs] | ((buffered_spriteram[offs+1] & 0xe0) << 3);
291      int const color = buffered_spriteram[offs+1] & 0x0f;
377      int sx, sy, code, color, pri;
378      int flipx = 0, flipy = 0, height = 0, y;
379
380      sx = buffered_spriteram[offs+3] | ((buffered_spriteram[offs+1] & 0x10) << 4);
381      sy = buffered_spriteram[offs+2];
382      code = buffered_spriteram[offs] | ((buffered_spriteram[offs+1] & 0xe0) << 3);
383      color = buffered_spriteram[offs+1] & 0x0f;
292384      //TODO: This priority mechanism works for known games, but seems a bit strange.
293385      //Are we missing something?  (The obvious spare palette bit isn't it.)
294      int const pri = (((color == 0x00) || (color == 0x0f)) ? 0xfc : 0xf0);
386      pri = (((color == 0x00) || (color == 0x0f)) ? 0xfc : 0xf0);
295387
296      bool flipx = false, flipy = false;
297      int height = 0;
298      if (extensions)
388      if (pollux_extensions)
299389      {
300         UINT8 const ext = buffered_spriteram[offs+0x1c];
390         /* gulfstrm, pollux, bluehawk, flytiger */
391         code |= ((buffered_spriteram[offs+0x1c] & 0x01) << 11);
301392
302         if (extensions & SPRITE_12BIT)
303            code |= ((ext & 0x01) << 11);
304
305         if (extensions & SPRITE_HEIGHT)
393         if (pollux_extensions >= 2)
306394         {
307            height = (ext & 0x70) >> 4;
395            /* pollux, bluehawk, flytiger */
396            height = (buffered_spriteram[offs+0x1c] & 0x70) >> 4;
308397            code &= ~height;
309398
310            flipx = ext & 0x08;
311            flipy = ext & 0x04;
312         }
399            flipx = buffered_spriteram[offs+0x1c] & 0x08;
400            flipy = buffered_spriteram[offs+0x1c] & 0x04;
313401
314         if (extensions & SPRITE_YSHIFT_BLUEHAWK)
315            sy += 6 - ((~ext & 0x02) << 7);
402            if (pollux_extensions == 3)
403            {
404               /* bluehawk */
405               sy += 6 - ((~buffered_spriteram[offs+0x1c] & 0x02) << 7);
406            }
316407
317         if (extensions & SPRITE_YSHIFT_FLYTIGER)
318            sy -=(ext & 0x02) << 7;
408            if (pollux_extensions == 4)
409            {
410               /* flytiger */
411               sy -=(buffered_spriteram[offs+0x1c] & 0x02) << 7;
412            }
413         }
319414      }
320415
321416      if (flip_screen())
r241919r241920
326421         flipy = !flipy;
327422      }
328423
329      for (int y = 0; y <= height; y++)
424      for (y = 0; y <= height; y++)
330425      {
331426         m_gfxdecode->gfx(1)->prio_transpen(bitmap,cliprect,
332427               code + y,
r241919r241920
339434   }
340435}
341436
437void dooyong_state::rshark_draw_sprites(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect)
438{
439   UINT16 *buffered_spriteram16 = m_spriteram16->buffer();
342440
343UINT32 dooyong_z80_ym2203_state::screen_update_lastday(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect)
441   /* Sprites take 8 16-bit words each in memory:
442                 MSB             LSB
443      [offs + 0] ???? ???? ???? ???E
444      [offs + 1] ???? ???? hhhh wwww
445      [offs + 2] ???? ???? ???? ????
446      [offs + 3] cccc cccc cccc cccc
447      [offs + 4] ???? ???x xxxx xxxx
448      [offs + 5] ???? ???? ???? ????
449      [offs + 6] ???? ???y yyyy yyyy
450      [offs + 7] ???? ???? ???? CCCC
451      ? = unused/unknown
452      E = enable
453      c = gfx code
454      x = x offset
455      y = y offset (signed)
456      C = color code
457      w = width
458      h = height */
459
460   int offs;
461
462   for (offs = (m_spriteram16->bytes() / 2) - 8; offs >= 0; offs -= 8)
463   {
464      if (buffered_spriteram16[offs] & 0x0001)    /* enable */
465      {
466         int sx, sy, code, color, pri;
467         int flipx = 0, flipy = 0, width, height, x, y;
468
469         sx = buffered_spriteram16[offs+4] & 0x01ff;
470         sy = (INT16)buffered_spriteram16[offs+6] & 0x01ff;
471         if (sy & 0x0100) sy |= ~(int)0x01ff;    // Correctly sign-extend 9-bit number
472         code = buffered_spriteram16[offs+3];
473         color = buffered_spriteram16[offs+7] & 0x000f;
474         //TODO: This priority mechanism works for known games, but seems a bit strange.
475         //Are we missing something?  (The obvious spare palette bit isn't it.)
476         pri = (((color == 0x00) || (color == 0x0f)) ? 0xfc : 0xf0);
477         width = buffered_spriteram16[offs+1] & 0x000f;
478         height = (buffered_spriteram16[offs+1] & 0x00f0) >> 4;
479
480         if (flip_screen())
481         {
482            sx = 498 - (16 * width) - sx;
483            sy = 240 - (16 * height) - sy;
484            flipx = !flipx;
485            flipy = !flipy;
486         }
487
488         for (y = 0; y <= height; y++)
489         {
490            int _y = sy + (16 * (flipy ? (height - y) : y));
491            for (x = 0; x <= width; x++)
492            {
493               int _x = sx + (16 * (flipx ? (width - x) : x));
494               m_gfxdecode->gfx(0)->prio_transpen(bitmap,cliprect,
495                     code,
496                     color,
497                     flipx, flipy,
498                     _x, _y,
499                     screen.priority(),
500                     pri, 15);
501               code++;
502            }
503         }
504      }
505   }
506}
507
508
509UINT32 dooyong_state::screen_update_lastday(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect)
344510{
345511   bitmap.fill(m_palette->black_pen(), cliprect);
346512   screen.priority().fill(0, cliprect);
r241919r241920
350516   m_tx_tilemap->draw(screen, bitmap, cliprect, 0, 4);
351517
352518   if (!m_sprites_disabled)
353      draw_sprites(screen, bitmap, cliprect);
354
519      draw_sprites(screen, bitmap, cliprect, 0);
355520   return 0;
356521}
357522
358UINT32 dooyong_z80_ym2203_state::screen_update_gulfstrm(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect)
523UINT32 dooyong_state::screen_update_gulfstrm(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect)
359524{
360525   bitmap.fill(m_palette->black_pen(), cliprect);
361526   screen.priority().fill(0, cliprect);
r241919r241920
364529   m_fg_tilemap->draw(screen, bitmap, cliprect, 0, 2);
365530   m_tx_tilemap->draw(screen, bitmap, cliprect, 0, 4);
366531
367   draw_sprites(screen, bitmap, cliprect, SPRITE_12BIT);
368
532   draw_sprites(screen, bitmap, cliprect, 1);
369533   return 0;
370534}
371535
372UINT32 dooyong_z80_ym2203_state::screen_update_pollux(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect)
536UINT32 dooyong_state::screen_update_pollux(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect)
373537{
374538   bitmap.fill(m_palette->black_pen(), cliprect);
375539   screen.priority().fill(0, cliprect);
r241919r241920
378542   m_fg_tilemap->draw(screen, bitmap, cliprect, 0, 2);
379543   m_tx_tilemap->draw(screen, bitmap, cliprect, 0, 4);
380544
381   draw_sprites(screen, bitmap, cliprect, SPRITE_12BIT | SPRITE_HEIGHT);
382
545   draw_sprites(screen, bitmap, cliprect, 2);
383546   return 0;
384547}
385548
386UINT32 dooyong_z80_state::screen_update_flytiger(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect)
549UINT32 dooyong_state::screen_update_flytiger(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect)
387550{
388551   bitmap.fill(m_palette->black_pen(), cliprect);
389552   screen.priority().fill(0, cliprect);
r241919r241920
400563   }
401564   m_tx_tilemap->draw(screen, bitmap, cliprect, 0, 4);
402565
403   draw_sprites(screen, bitmap, cliprect, SPRITE_12BIT | SPRITE_HEIGHT | SPRITE_YSHIFT_FLYTIGER);
404
566   draw_sprites(screen, bitmap, cliprect, 4);
405567   return 0;
406568}
407569
408570
409UINT32 dooyong_z80_state::screen_update_bluehawk(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect)
571UINT32 dooyong_state::screen_update_bluehawk(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect)
410572{
411573   bitmap.fill(m_palette->black_pen(), cliprect);
412574   screen.priority().fill(0, cliprect);
r241919r241920
416578   m_fg2_tilemap->draw(screen, bitmap, cliprect, 0, 4);
417579   m_tx_tilemap->draw(screen, bitmap, cliprect, 0, 4);
418580
419   draw_sprites(screen, bitmap, cliprect, SPRITE_12BIT | SPRITE_HEIGHT | SPRITE_YSHIFT_BLUEHAWK);
420
581   draw_sprites(screen, bitmap, cliprect, 3);
421582   return 0;
422583}
423584
424UINT32 dooyong_z80_state::screen_update_primella(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect)
585UINT32 dooyong_state::screen_update_primella(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect)
425586{
426587   bitmap.fill(m_palette->black_pen(), cliprect);
427588
r241919r241920
429590   if (m_tx_pri) m_tx_tilemap->draw(screen, bitmap, cliprect, 0, 0);
430591   m_fg_tilemap->draw(screen, bitmap, cliprect, 0, 0);
431592   if (!m_tx_pri) m_tx_tilemap->draw(screen, bitmap, cliprect, 0, 0);
593   return 0;
594}
432595
596UINT32 dooyong_state::screen_update_rshark(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect)
597{
598   bitmap.fill(m_palette->black_pen(), cliprect);
599   screen.priority().fill(0, cliprect);
600
601   m_bg_tilemap->draw(screen, bitmap, cliprect, 0, 1);
602   m_bg2_tilemap->draw(screen, bitmap, cliprect, 0, (m_rshark_pri ? 2 : 1));
603   m_fg_tilemap->draw(screen, bitmap, cliprect, 0, 2);
604   m_fg2_tilemap->draw(screen, bitmap, cliprect, 0, 2);
605
606   rshark_draw_sprites(screen, bitmap, cliprect);
433607   return 0;
434608}
435609
436VIDEO_START_MEMBER(dooyong_z80_ym2203_state, lastday)
610UINT32 dooyong_state::screen_update_popbingo(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect)
437611{
612   bitmap.fill(m_palette->black_pen(), cliprect);
613   screen.priority().fill(0, cliprect);
614
615   m_bg_tilemap->draw(screen, bitmap, cliprect, 0, 1);
616
617   rshark_draw_sprites(screen, bitmap, cliprect);
618   return 0;
619}
620
621
622VIDEO_START_MEMBER(dooyong_state,lastday)
623{
438624   /* Configure tilemap callbacks */
439625   m_bg_tilerom = memregion("gfx5")->base();
440626   m_fg_tilerom = memregion("gfx6")->base();
627   m_bg_tilerom2 = NULL;
628   m_fg_tilerom2 = NULL;
441629   m_bg_gfx = 2;
442630   m_fg_gfx = 3;
443631   m_tx_tilemap_mode = 0;
r241919r241920
447635         32, 32, 32, 8);
448636   m_fg_tilemap = &machine().tilemap().create(m_gfxdecode, tilemap_get_info_delegate(FUNC(dooyong_state::get_fg_tile_info),this), TILEMAP_SCAN_COLS,
449637         32, 32, 32, 8);
450   m_tx_tilemap = &machine().tilemap().create(m_gfxdecode, tilemap_get_info_delegate(FUNC(dooyong_z80_state::get_tx_tile_info),this), TILEMAP_SCAN_COLS,
638   m_tx_tilemap = &machine().tilemap().create(m_gfxdecode, tilemap_get_info_delegate(FUNC(dooyong_state::get_tx_tile_info),this), TILEMAP_SCAN_COLS,
451639         8, 8, 64, 32);
452640
453641   /* Configure tilemap transparency */
r241919r241920
470658   save_item(NAME(m_interrupt_line_2));
471659}
472660
473VIDEO_START_MEMBER(dooyong_z80_ym2203_state, gulfstrm)
661VIDEO_START_MEMBER(dooyong_state,gulfstrm)
474662{
475663   /* Configure tilemap callbacks */
476664   m_bg_tilerom = memregion("gfx5")->base();
477665   m_fg_tilerom = memregion("gfx6")->base();
666   m_bg_tilerom2 = NULL;
667   m_fg_tilerom2 = NULL;
478668   m_bg_gfx = 2;
479669   m_fg_gfx = 3;
480670   m_tx_tilemap_mode = 0;
r241919r241920
484674         32, 32, 32, 8);
485675   m_fg_tilemap = &machine().tilemap().create(m_gfxdecode, tilemap_get_info_delegate(FUNC(dooyong_state::get_fg_tile_info),this), TILEMAP_SCAN_COLS,
486676         32, 32, 32, 8);
487   m_tx_tilemap = &machine().tilemap().create(m_gfxdecode, tilemap_get_info_delegate(FUNC(dooyong_z80_state::get_tx_tile_info),this), TILEMAP_SCAN_COLS,
677   m_tx_tilemap = &machine().tilemap().create(m_gfxdecode, tilemap_get_info_delegate(FUNC(dooyong_state::get_tx_tile_info),this), TILEMAP_SCAN_COLS,
488678         8, 8, 64, 32);
489679
490680   /* Configure tilemap transparency */
r241919r241920
506696   save_item(NAME(m_interrupt_line_2));
507697}
508698
509VIDEO_START_MEMBER(dooyong_z80_ym2203_state, pollux)
699VIDEO_START_MEMBER(dooyong_state,pollux)
510700{
511701   /* Configure tilemap callbacks */
512702   m_bg_tilerom = memregion("gfx5")->base();
513703   m_fg_tilerom = memregion("gfx6")->base();
704   m_bg_tilerom2 = NULL;
705   m_fg_tilerom2 = NULL;
514706   m_bg_gfx = 2;
515707   m_fg_gfx = 3;
516708   m_tx_tilemap_mode = 0;
r241919r241920
520712         32, 32, 32, 8);
521713   m_fg_tilemap = &machine().tilemap().create(m_gfxdecode, tilemap_get_info_delegate(FUNC(dooyong_state::get_fg_tile_info),this), TILEMAP_SCAN_COLS,
522714         32, 32, 32, 8);
523   m_tx_tilemap = &machine().tilemap().create(m_gfxdecode, tilemap_get_info_delegate(FUNC(dooyong_z80_state::get_tx_tile_info),this), TILEMAP_SCAN_COLS,
715   m_tx_tilemap = &machine().tilemap().create(m_gfxdecode, tilemap_get_info_delegate(FUNC(dooyong_state::get_tx_tile_info),this), TILEMAP_SCAN_COLS,
524716         8, 8, 64, 32);
525717
526718   /* Configure tilemap transparency */
r241919r241920
539731   save_item(NAME(m_interrupt_line_2));
540732}
541733
542VIDEO_START_MEMBER(dooyong_z80_state, bluehawk)
734VIDEO_START_MEMBER(dooyong_state,bluehawk)
543735{
544736   /* Configure tilemap callbacks */
545737   m_bg_tilerom = memregion("gfx3")->base() + 0x78000;
546738   m_fg_tilerom = memregion("gfx4")->base() + 0x78000;
547739   m_fg2_tilerom = memregion("gfx5")->base() + 0x38000;
740   m_bg_tilerom2 = NULL;
741   m_fg_tilerom2 = NULL;
742   m_fg2_tilerom2 = NULL;
548743   m_bg_gfx = 2;
549744   m_fg_gfx = 3;
550745   m_fg2_gfx = 4;
r241919r241920
557752         32, 32, 32, 8);
558753   m_fg2_tilemap = &machine().tilemap().create(m_gfxdecode, tilemap_get_info_delegate(FUNC(dooyong_state::get_fg2_tile_info),this), TILEMAP_SCAN_COLS,
559754         32, 32, 32, 8);
560   m_tx_tilemap = &machine().tilemap().create(m_gfxdecode, tilemap_get_info_delegate(FUNC(dooyong_z80_state::get_tx_tile_info),this), TILEMAP_SCAN_COLS,
755   m_tx_tilemap = &machine().tilemap().create(m_gfxdecode, tilemap_get_info_delegate(FUNC(dooyong_state::get_tx_tile_info),this), TILEMAP_SCAN_COLS,
561756         8, 8, 64, 32);
562757
563758   /* Configure tilemap transparency */
r241919r241920
576771   save_item(NAME(m_fg2scroll8));
577772}
578773
579VIDEO_START_MEMBER(dooyong_z80_state, flytiger)
774VIDEO_START_MEMBER(dooyong_state,flytiger)
580775{
581776   /* Configure tilemap callbacks */
582777   m_bg_tilerom = memregion("gfx3")->base() + 0x78000;
583778   m_fg_tilerom = memregion("gfx4")->base() + 0x78000;
779   m_bg_tilerom2 = NULL;
780   m_fg_tilerom2 = NULL;
584781   m_bg_gfx = 2;
585782   m_fg_gfx = 3;
586783   m_tx_tilemap_mode = 0;
r241919r241920
588785   /* Create tilemaps */
589786   m_bg_tilemap = &machine().tilemap().create(m_gfxdecode, tilemap_get_info_delegate(FUNC(dooyong_state::get_bg_tile_info),this), TILEMAP_SCAN_COLS,
590787         32, 32, 32, 8);
591   m_fg_tilemap = &machine().tilemap().create(m_gfxdecode, tilemap_get_info_delegate(FUNC(dooyong_state::get_fg_tile_info),this), TILEMAP_SCAN_COLS,
788   m_fg_tilemap = &machine().tilemap().create(m_gfxdecode, tilemap_get_info_delegate(FUNC(dooyong_state::flytiger_get_fg_tile_info),this), TILEMAP_SCAN_COLS,
592789         32, 32, 32, 8);
593   m_tx_tilemap = &machine().tilemap().create(m_gfxdecode, tilemap_get_info_delegate(FUNC(dooyong_z80_state::get_tx_tile_info),this), TILEMAP_SCAN_COLS,
790   m_tx_tilemap = &machine().tilemap().create(m_gfxdecode, tilemap_get_info_delegate(FUNC(dooyong_state::get_tx_tile_info),this), TILEMAP_SCAN_COLS,
594791         8, 8, 64, 32);
595792
596793   /* Configure tilemap transparency */
r241919r241920
609806   save_item(NAME(m_flytiger_pri));
610807}
611808
612VIDEO_START_MEMBER(dooyong_z80_state, primella)
809VIDEO_START_MEMBER(dooyong_state,primella)
613810{
614811   /* Configure tilemap callbacks */
615812   m_bg_tilerom = memregion("gfx2")->base() + memregion("gfx2")->bytes() - 0x8000;
616813   m_fg_tilerom = memregion("gfx3")->base() + memregion("gfx3")->bytes() - 0x8000;
814   m_bg_tilerom2 = NULL;
815   m_fg_tilerom2 = NULL;
617816   m_bg_gfx = 1;
618817   m_fg_gfx = 2;
619818   m_tx_tilemap_mode = 1;
r241919r241920
623822         32, 32, 32, 8);
624823   m_fg_tilemap = &machine().tilemap().create(m_gfxdecode, tilemap_get_info_delegate(FUNC(dooyong_state::get_fg_tile_info),this), TILEMAP_SCAN_COLS,
625824         32, 32, 32, 8);
626   m_tx_tilemap = &machine().tilemap().create(m_gfxdecode, tilemap_get_info_delegate(FUNC(dooyong_z80_state::get_tx_tile_info),this), TILEMAP_SCAN_COLS,
825   m_tx_tilemap = &machine().tilemap().create(m_gfxdecode, tilemap_get_info_delegate(FUNC(dooyong_state::get_tx_tile_info),this), TILEMAP_SCAN_COLS,
627826         8, 8, 64, 32);
628827
629828   /* Configure tilemap transparency */
r241919r241920
641840   save_item(NAME(m_tx_pri));
642841}
643842
644
645WRITE16_MEMBER(dooyong_68k_state::ctrl_w)
843VIDEO_START_MEMBER(dooyong_state,rshark)
646844{
647   if (ACCESSING_BITS_0_7)
648   {
649      /* bit 0 flips screen */
650      flip_screen_set(data & 0x0001);
651
652      /* bit 4 changes tilemaps priority */
653      m_bg2_priority = data & 0x0010;
654
655      /* bit 5 used but unknown */
656   }
657}
658
659
660inline void dooyong_68k_state::rshark_get_tile_info(tile_data &tileinfo, int tile_index,
661      UINT8 const *tilerom1, UINT8 const *tilerom2, UINT8 const *scroll, int graphics)
662{
663      /* Tiles take two bytes in tile ROM 1:
664                       MSB   LSB
665         [offs + 0x00] YX?c cccc    (Y flip, X flip, bits 12-8 of gfx code)
666         [offs + 0x01] cccc cccc    (bits 7-0 of gfx code)
667         ? = unused/unknown
668         c = gfx code
669         X = x flip
670         Y = y flip */
671   int const offs = tile_index + ((int)scroll[1] << 9);
672   int const attr = tilerom1[offs * 2];
673   int const code = tilerom1[(offs * 2) + 1] | ((attr & 0x1f) << 8);
674   int const color = tilerom2[offs] & 0x0f;
675   int const flags = TILE_FLIPYX((attr & 0xC0) >> 6);
676
677   tileinfo.set(graphics, code, color, flags);
678}
679
680TILE_GET_INFO_MEMBER(dooyong_68k_state::rshark_get_bg_tile_info)
681{
682   rshark_get_tile_info(tileinfo, tile_index, m_bg_tilerom, m_bg_tilerom2, m_bgscroll8, m_bg_gfx);
683}
684
685TILE_GET_INFO_MEMBER(dooyong_68k_state::rshark_get_bg2_tile_info)
686{
687   rshark_get_tile_info(tileinfo, tile_index, m_bg2_tilerom, m_bg2_tilerom2, m_bg2scroll8, m_bg2_gfx);
688}
689
690TILE_GET_INFO_MEMBER(dooyong_68k_state::rshark_get_fg_tile_info)
691{
692   rshark_get_tile_info(tileinfo, tile_index, m_fg_tilerom, m_fg_tilerom2, m_fgscroll8, m_fg_gfx);
693}
694
695TILE_GET_INFO_MEMBER(dooyong_68k_state::rshark_get_fg2_tile_info)
696{
697   rshark_get_tile_info(tileinfo, tile_index, m_fg2_tilerom, m_fg2_tilerom2, m_fg2scroll8, m_fg2_gfx);
698}
699
700
701void dooyong_68k_state::draw_sprites(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect)
702{
703   /* Sprites take 8 16-bit words each in memory:
704                 MSB             LSB
705      [offs + 0] ???? ???? ???? ???E
706      [offs + 1] ???? ???? hhhh wwww
707      [offs + 2] ???? ???? ???? ????
708      [offs + 3] cccc cccc cccc cccc
709      [offs + 4] ???? ???x xxxx xxxx
710      [offs + 5] ???? ???? ???? ????
711      [offs + 6] ???? ???y yyyy yyyy
712      [offs + 7] ???? ???? ???? CCCC
713      ? = unused/unknown
714      E = enable
715      c = gfx code
716      x = x offset
717      y = y offset (signed)
718      C = color code
719      w = width
720      h = height */
721
722   UINT16 const *const buffered_spriteram = m_spriteram->buffer();
723   for (int offs = (m_spriteram->bytes() / 2) - 8; offs >= 0; offs -= 8)
724   {
725      if (buffered_spriteram[offs] & 0x0001)    /* enable */
726      {
727         int code = buffered_spriteram[offs+3];
728         int const color = buffered_spriteram[offs+7] & 0x000f;
729         //TODO: This priority mechanism works for known games, but seems a bit strange.
730         //Are we missing something?  (The obvious spare palette bit isn't it.)
731         int const pri = (((color == 0x00) || (color == 0x0f)) ? 0xfc : 0xf0);
732         int const width = buffered_spriteram[offs+1] & 0x000f;
733         int const height = (buffered_spriteram[offs+1] & 0x00f0) >> 4;
734
735         bool const flip = flip_screen();
736         int sx = buffered_spriteram[offs+4] & 0x01ff;
737         int sy = (INT16)buffered_spriteram[offs+6] & 0x01ff;
738         if (sy & 0x0100) sy |= ~(int)0x01ff;    // Correctly sign-extend 9-bit number
739         if (flip)
740         {
741            sx = 498 - (16 * width) - sx;
742            sy = 240 - (16 * height) - sy;
743         }
744
745         for (int y = 0; y <= height; y++)
746         {
747            int const _y = sy + (16 * (flip ? (height - y) : y));
748            for (int x = 0; x <= width; x++)
749            {
750               int const _x = sx + (16 * (flip ? (width - x) : x));
751               m_gfxdecode->gfx(0)->prio_transpen(bitmap,cliprect,
752                     code,
753                     color,
754                     flip, flip,
755                     _x, _y,
756                     screen.priority(),
757                     pri, 15);
758               code++;
759            }
760         }
761      }
762   }
763}
764
765UINT32 dooyong_68k_state::screen_update_rshark(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect)
766{
767   bitmap.fill(m_palette->black_pen(), cliprect);
768   screen.priority().fill(0, cliprect);
769
770   m_bg_tilemap->draw(screen, bitmap, cliprect, 0, 1);
771   m_bg2_tilemap->draw(screen, bitmap, cliprect, 0, (m_bg2_priority ? 2 : 1));
772   m_fg_tilemap->draw(screen, bitmap, cliprect, 0, 2);
773   m_fg2_tilemap->draw(screen, bitmap, cliprect, 0, 2);
774
775   draw_sprites(screen, bitmap, cliprect);
776
777   return 0;
778}
779
780UINT32 dooyong_68k_state::screen_update_popbingo(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect)
781{
782   bitmap.fill(m_palette->black_pen(), cliprect);
783   screen.priority().fill(0, cliprect);
784
785   m_bg_tilemap->draw(screen, bitmap, cliprect, 0, 1);
786
787   draw_sprites(screen, bitmap, cliprect);
788
789   return 0;
790}
791
792
793VIDEO_START_MEMBER(dooyong_68k_state, rshark)
794{
795845   /* Configure tilemap callbacks */
796846   m_bg_tilerom = memregion("gfx5")->base();
797847   m_bg2_tilerom = memregion("gfx4")->base();
r241919r241920
807857   m_fg2_gfx = 1;
808858
809859   /* Create tilemaps */
810   m_bg_tilemap = &machine().tilemap().create(m_gfxdecode, tilemap_get_info_delegate(FUNC(dooyong_68k_state::rshark_get_bg_tile_info),this), TILEMAP_SCAN_COLS,
860   m_bg_tilemap = &machine().tilemap().create(m_gfxdecode, tilemap_get_info_delegate(FUNC(dooyong_state::get_bg_tile_info),this), TILEMAP_SCAN_COLS,
811861         16, 16, 64, 32);
812   m_bg2_tilemap = &machine().tilemap().create(m_gfxdecode, tilemap_get_info_delegate(FUNC(dooyong_68k_state::rshark_get_bg2_tile_info),this), TILEMAP_SCAN_COLS,
862   m_bg2_tilemap = &machine().tilemap().create(m_gfxdecode, tilemap_get_info_delegate(FUNC(dooyong_state::get_bg2_tile_info),this), TILEMAP_SCAN_COLS,
813863         16, 16, 64, 32);
814   m_fg_tilemap = &machine().tilemap().create(m_gfxdecode, tilemap_get_info_delegate(FUNC(dooyong_68k_state::rshark_get_fg_tile_info),this), TILEMAP_SCAN_COLS,
864   m_fg_tilemap = &machine().tilemap().create(m_gfxdecode, tilemap_get_info_delegate(FUNC(dooyong_state::get_fg_tile_info),this), TILEMAP_SCAN_COLS,
815865         16, 16, 64, 32);
816   m_fg2_tilemap = &machine().tilemap().create(m_gfxdecode, tilemap_get_info_delegate(FUNC(dooyong_68k_state::rshark_get_fg2_tile_info),this), TILEMAP_SCAN_COLS,
866   m_fg2_tilemap = &machine().tilemap().create(m_gfxdecode, tilemap_get_info_delegate(FUNC(dooyong_state::get_fg2_tile_info),this), TILEMAP_SCAN_COLS,
817867         16, 16, 64, 32);
818868
819869   /* Configure tilemap transparency */
r241919r241920
831881   save_item(NAME(m_bg2scroll8));
832882   save_item(NAME(m_fgscroll8));
833883   save_item(NAME(m_fg2scroll8));
834   save_item(NAME(m_bg2_priority));
884   save_item(NAME(m_rshark_pri));
835885}
836886
837VIDEO_START_MEMBER(dooyong_68k_state, popbingo)
887VIDEO_START_MEMBER(dooyong_state,popbingo)
838888{
839889   /* Configure tilemap callbacks */
840890   m_bg_tilerom = memregion("gfx2")->base();
r241919r241920
855905   save_item(NAME(m_bg2scroll8));  // Not used atm
856906   save_item(NAME(m_fgscroll8));   // Not used atm
857907   save_item(NAME(m_fg2scroll8));  // Not used atm
858   save_item(NAME(m_bg2_priority));
908   save_item(NAME(m_rshark_pri));
859909}
trunk/src/mame/video/prehisle.c
r241919r241920
2727   switch (offset)
2828   {
2929   case 0x08: return ioport("P2")->read();                     // Player 2
30   case 0x10: return ioport("COIN")->read();                   // Coins, Tilt, Service
31   case 0x20: return ioport("P1")->read() ^ m_invert_controls; // Player 1
32   case 0x21: return ioport("DSW0")->read();                   // DIPs
33   case 0x22: return ioport("DSW1")->read();                   // DIPs + VBLANK
30   case 0x10: return ioport("COIN")->read();                       // Coins, Tilt, Service
31   case 0x20: return ioport("P1")->read() ^ m_invert_controls;     // Player 1
32   case 0x21: return ioport("DSW0")->read();                       // DIPs
33   case 0x22: return ioport("DSW1")->read();                       // DIPs + VBLANK
3434   default: return 0;
3535   }
3636}
r241919r241920
5454   }
5555}
5656
57/* tile layout
580  xxxx....  color
590  ....x...  flip x
600  .....xxx  gfx code high bits
611  xxxxxxxx  gfx code low bits
62*/
6357TILE_GET_INFO_MEMBER(prehisle_state::get_bg2_tile_info)
6458{
65   UINT8 const *const tilerom = memregion("gfx5")->base();
59   UINT8 *tilerom = memregion("gfx5")->base();
6660
67   int const offs = tile_index * 2;
68   int const attr = tilerom[offs + 1] + (tilerom[offs] << 8);
69   int const code = (attr & 0x7ff) | 0x800;
70   int const color = attr >> 12;
71   int const flags = (attr & 0x800) ? TILE_FLIPX : 0;
61   int offs = tile_index * 2;
62   int attr = tilerom[offs + 1] + (tilerom[offs] << 8);
63   int code = (attr & 0x7ff) | 0x800;
64   int color = attr >> 12;
65   int flags = (attr & 0x800) ? TILE_FLIPX : 0;
7266
7367   SET_TILE_INFO_MEMBER(1, code, color, flags);
7468}
7569
76/* tile layout
770  xxxx.... ........  color
780  ....x... ........  flip y
790  .....xxx xxxxxxxx  gfx code
80*/
8170TILE_GET_INFO_MEMBER(prehisle_state::get_bg_tile_info)
8271{
83   int const attr = m_bg_videoram16[tile_index];
84   int const code = attr & 0x7ff;
85   int const color = attr >> 12;
86   int const flags = (attr & 0x800) ? TILE_FLIPY : 0;
72   int attr = m_bg_videoram16[tile_index];
73   int code = attr & 0x7ff;
74   int color = attr >> 12;
75   int flags = (attr & 0x800) ? TILE_FLIPY : 0;
8776
8877   SET_TILE_INFO_MEMBER(2, code, color, flags);
8978}
9079
91/* tile layout
920  xxxx.... ........  color
930  ....xxxx xxxxxxxx  gfx code
94*/
9580TILE_GET_INFO_MEMBER(prehisle_state::get_fg_tile_info)
9681{
97   int const attr = m_videoram[tile_index];
98   int const code = attr & 0xfff;
99   int const color = attr >> 12;
82   int attr = m_videoram[tile_index];
83   int code = attr & 0xfff;
84   int color = attr >> 12;
10085
10186   SET_TILE_INFO_MEMBER(0, code, color, 0);
10287}
10388
10489void prehisle_state::video_start()
10590{
106   // ROM-based background layer
107   m_bg2_tilemap = &machine().tilemap().create(
108         m_gfxdecode,
109         tilemap_get_info_delegate(FUNC(prehisle_state::get_bg2_tile_info), this),
110         TILEMAP_SCAN_COLS,      // scan order
111         16, 16,                 // tile size
112         1024, 32);              // tilemap size
91   m_bg2_tilemap = &machine().tilemap().create(m_gfxdecode, tilemap_get_info_delegate(FUNC(prehisle_state::get_bg2_tile_info),this), TILEMAP_SCAN_COLS,
92         16, 16, 1024, 32);
11393
114   // RAM-based background layer (overlays most sprites)
115   m_bg_tilemap = &machine().tilemap().create(
116         m_gfxdecode,
117         tilemap_get_info_delegate(FUNC(prehisle_state::get_bg_tile_info), this),
118         TILEMAP_SCAN_COLS,      // scan order
119         16, 16,                 // tile size
120         256, 32);               // tilemap size
121   m_bg_tilemap->set_transparent_pen(15);
94   m_bg_tilemap = &machine().tilemap().create(m_gfxdecode, tilemap_get_info_delegate(FUNC(prehisle_state::get_bg_tile_info),this), TILEMAP_SCAN_COLS,
95         16, 16, 256, 32);
12296
123   // text layer
124   m_fg_tilemap = &machine().tilemap().create(
125         m_gfxdecode,
126         tilemap_get_info_delegate(FUNC(prehisle_state::get_fg_tile_info), this),
127         TILEMAP_SCAN_ROWS,      // scan order
128         8, 8,                   // tile size
129         32, 32);                // tilemap size
97   m_fg_tilemap = &machine().tilemap().create(m_gfxdecode, tilemap_get_info_delegate(FUNC(prehisle_state::get_fg_tile_info),this), TILEMAP_SCAN_ROWS,
98         8, 8, 32, 32);
99
100   m_bg_tilemap->set_transparent_pen(15);
130101   m_fg_tilemap->set_transparent_pen(15);
131102
132103   /* register for saving */
r241919r241920
134105}
135106
136107/* sprite layout
108o fedcba9876543210
137109
1380  .......x xxxxxxxx  y, other bits unused?
1391  .......x xxxxxxxx  x, other bits unused?
1402  x....... ........  flip y
1412  .x...... ........  flip x
1422  ..x..... ........  ?
1432  ...xxxxx xxxxxxxx  gfx code
1443  xxxx.... ........  color+priority, other bits unknown
1100 .......xxxxxxxxx y, other bits unused?
1111 .......xxxxxxxxx x, other bits unused?
112
1132 ...xxxxxxxxxxxxx code
1142 ..x............. ?
1152 .x.............. flipx
1162 x............... flipy
117
1183 xxxx............ color+priority, other bits unknown
145119*/
146void prehisle_state::draw_sprites(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect)
120void prehisle_state::draw_sprites(bitmap_ind16 &bitmap, const rectangle &cliprect, int foreground )
147121{
148   UINT16 const *const spriteram16 = m_spriteram;
122   UINT16 *spriteram16 = m_spriteram;
123   int offs;
149124
150   for (int offs = 0; offs < 1024; offs += 4)
125   for (offs = 0; offs < 1024; offs += 4)
151126   {
152      int const attr = spriteram16[offs + 2];
153      int const code = attr & 0x1fff;
154      int const color = spriteram16[offs + 3] >> 12;
155      int const priority = (color < 0x4) ? 0x04 : 0x06;
156      bool flipx = attr & 0x4000;
157      bool flipy = attr & 0x8000;
158      int sx = spriteram16[offs + 1] & 0x1ff;
159      int sy = spriteram16[offs] & 0x1ff;
127      int attr = spriteram16[offs + 2];
128      int code = attr & 0x1fff;
129      int color = spriteram16[offs + 3] >> 12;
130      int priority = (color < 0x4); // correct?
131      int flipx = attr & 0x4000;
132      int flipy = attr & 0x8000;
133      int sx = spriteram16[offs + 1]&0x1ff;
134      int sy = spriteram16[offs]&0x1ff;
160135
161136      // coordinates are 9-bit signed
162      if (sx & 0x100) sx = -0x100 + (sx & 0xff);
163      if (sy & 0x100) sy = -0x100 + (sy & 0xff);
137      if (sx&0x100) sx=-0x100+(sx&0xff);
138      if (sy&0x100) sy=-0x100+(sy&0xff);
164139
165140      if (flip_screen())
166141      {
r241919r241920
170145         flipy = !flipy;
171146      }
172147
173      m_gfxdecode->gfx(3)->prio_transpen(
174         bitmap, cliprect,
175         code, color,
176         flipx, flipy,
177         sx, sy,
178         screen.priority(), priority,
179         15); // transparent pen
148      if ((foreground && priority) || (!foreground && !priority))
149      {
150         m_gfxdecode->gfx(3)->transpen(bitmap,cliprect, code, color, flipx, flipy, sx, sy, 15);
151      }
180152   }
181153}
182154
183155UINT32 prehisle_state::screen_update_prehisle(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect)
184156{
185   screen.priority().fill(0, cliprect);
186
187157   m_bg2_tilemap->draw(screen, bitmap, cliprect, 0, 0);
188   m_bg_tilemap->draw(screen, bitmap, cliprect, 0, 1);
189   m_fg_tilemap->draw(screen, bitmap, cliprect, 0, 2);
190   draw_sprites(screen, bitmap, cliprect);
191
158   draw_sprites(bitmap, cliprect, 0);
159   m_bg_tilemap->draw(screen, bitmap, cliprect, 0, 0);
160   draw_sprites(bitmap, cliprect, 1);
161   m_fg_tilemap->draw(screen, bitmap, cliprect, 0, 0);
192162   return 0;
193163}
trunk/src/mess/drivers/mc1502.c
r241919r241920
254254   MCFG_MACHINE_RESET_OVERRIDE( mc1502_state, mc1502 )
255255
256256   MCFG_DEVICE_ADD("pit8253", PIT8253, 0)
257   MCFG_PIT8253_CLK0(XTAL_16MHz/12) /* heartbeat IRQ */
257   MCFG_PIT8253_CLK0(XTAL_15MHz/12) /* heartbeat IRQ */
258258   MCFG_PIT8253_OUT0_HANDLER(DEVWRITELINE("pic8259", pic8259_device, ir0_w))
259259   MCFG_PIT8253_CLK1(XTAL_16MHz/12) /* serial port */
260260   MCFG_PIT8253_OUT1_HANDLER(WRITELINE(mc1502_state, mc1502_pit8253_out1_changed))
r241919r241920
296296   MCFG_ISA_OUT_IRQ5_CB(DEVWRITELINE("pic8259", pic8259_device, ir5_w))
297297   MCFG_ISA_OUT_IRQ6_CB(DEVWRITELINE("pic8259", pic8259_device, ir6_w))
298298   MCFG_ISA_OUT_IRQ7_CB(DEVWRITELINE("pic8259", pic8259_device, ir7_w))
299
300   MCFG_ISA8_SLOT_ADD("isa", "board0", mc1502_isa8_cards, "cga_mc1502", true)
301299   MCFG_ISA8_SLOT_ADD("isa", "isa1", mc1502_isa8_cards, "fdc", false)
302300   MCFG_ISA8_SLOT_ADD("isa", "isa2", mc1502_isa8_cards, "rom", false)
301   /* video hardware (only 1 chargen in ROM; CGA_FONT dip always 1 */
302   MCFG_ISA8_SLOT_ADD("isa", "isa3", mc1502_isa8_cards, "cga_mc1502", false)
303303
304   /* sound hardware */
304305   MCFG_SPEAKER_STANDARD_MONO("mono")
305306   MCFG_SOUND_WAVE_ADD(WAVE_TAG, "cassette")
306307   MCFG_SOUND_ADD("speaker", SPEAKER_SOUND, 0)
r241919r241920
322323   MCFG_SOFTWARE_LIST_ADD("flop_list","mc1502_flop")
323324//  MCFG_SOFTWARE_LIST_ADD("cass_list","mc1502_cass")
324325
326   /* internal ram */
325327   MCFG_RAM_ADD(RAM_TAG)
326328   MCFG_RAM_DEFAULT_SIZE("608K")                   /* 96 base + 512 on expansion card */
327329   MCFG_RAM_EXTRA_OPTIONS("96K")


Previous 199869 Revisions Next


© 1997-2024 The MAME Team