Previous 199869 Revisions Next

r33409 Sunday 16th November, 2014 at 06:57:47 UTC by Miodrag Milanović
Merge pull request #48 from evadot/fix_acan_name

Add chip name for confirmed acan dumps
[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/src/emu/machine/pla.h
r241920r241921
5454// macros for known (and used) devices
5555
5656// 82S100, 82S101, PLS100, PLS101
57// 16x48x8 PLA, 28-pin
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*/
5874#define MCFG_PLS100_ADD(_tag) \
5975   MCFG_PLA_ADD(_tag, 16, 8, 48)
6076
trunk/src/emu/tilemap.h
r241920r241921
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
r241920r241921
8181            all tiles rendered.
8282
8383        Flagsmap = an 8bpp bitmap containing per-pixel flags,
84            specifically the category (specified in bits 0-3) and
85            the layer (specified in bits 4-6).
84            specifically the category (specified in bits 0-3) and the
85            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_create(). The
92        parameters are as follows:
91    1. First create a new tilemap by calling tilemap_manager::create().
92        The parameters are as follows:
9393
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
94        decoder = reference to your device_gfx_interface
9895
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
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
102100
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
103105        tilewidth = the width, in pixels, of each individual tile
104106
105107        tileheight = the height, in pixels, of each individual tile
r241920r241921
112114        Common configuration tasks include:
113115
114116            * marking one of the pens as transparent via
115                tilemap_set_transparent_pen()
117                tilemap_t::set_transparent_pen()
116118
117119            * performing more complex pen-to-layer mapping via
118                tilemap_map_pen_to_layer() or
119                tilemap_map_pens_to_layer()
120                tilemap_t::map_pen_to_layer() or
121                tilemap_t::map_pens_to_layer()
120122
121123            * configuring global scroll offsets via
122                tilemap_set_scrolldx() and tilemap_set_scrolldy()
124                tilemap_t::set_scrolldx() and tilemap_t::set_scrolldy()
123125
124            * specifying a pointer that is passed to your tile_get_info
125                callback via tilemap_set_user_data()
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()
126129
127130            * setting a global palette offset via
128                tilemap_set_palette_offset()
131                tilemap_t::set_palette_offset()
129132
130133    3. In your memory write handlers for the tile memory, anytime tile
131134        data is modified, you need to mark the tile dirty so that it is
132135        re-rendered with the new data the next time the tilemap is drawn.
133        Use tilemap_mark_tile_dirty() and pass in the memory index.
136        Use tilemap_t::mark_tile_dirty() and pass in the memory index.
134137
135138    4. In your handlers for scrolling, update the scroll values for the
136        tilemap via tilemap_set_scrollx() and tilemap_set_scrolly().
139        tilemap via tilemap_t::set_scrollx() and tilemap_t::set_scrolly().
137140
138141    5. If any other major characteristics of the tilemap change (generally
139142        any global state that is used by the tile_get_info callback but
140143        which is not reported via other calls to the tilemap code), you
141144        should invalidate the entire tilemap. You can do this by calling
142        tilemap_mark_all_tiles_dirty().
145        tilemap_t::mark_all_dirty().
143146
144147    6. In your VIDEO_UPDATE callback, render the tiles by calling
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
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
148151        containing the tilemap graphics.
149152
150153****************************************************************************
r241920r241921
157160
158161        tilemap_t *tmap;
159162        UINT16 *my_tmap_memory;
163        required_device<gfxdecode_device> gfxdecode;
160164
161        TILE_GET_INFO( my_get_info )
165        TILE_GET_INFO_MEMBER( my_state::my_get_info )
162166        {
163            UINT8 tiledata = my_tmap_memory[tile_index];
167            UINT16 tiledata = my_tmap_memory[tile_index];
164168            UINT8 code = tiledata & 0xff;
165169            UINT8 color = (tiledata >> 8) & 0x1f;
166170            UINT8 flipx = (tiledata >> 13) & 1;
r241920r241921
168172            UINT8 category = (tiledata >> 15) & 1;
169173
170174            // set the common info for the tile
171            SET_TILE_INFO(
172                1,              // use m_gfxdecode->gfx(1) for tile graphics
175            tileinfo.set(
176                1,              // use gfxdecode->gfx(1) for tile graphics
173177                code,           // the index of the graphics for this tile
174178                color,          // the color to use for this tile
175179                (flipx ? TILE_FLIPX : 0) |  // flags for this tile; also
176                (flipy ? TILE_FLIPY : 0);   // see the FLIP_YX macro
180                (flipy ? TILE_FLIPY : 0)    // see the FLIP_YX macro
177181            );
178182
179183            // set the category of each tile based on the high bit; this
r241920r241921
181185            tileinfo.category = category;
182186        }
183187
184        VIDEO_START( mydriver )
188        VIDEO_START_MEMBER( my_state, my_driver )
185189        {
186190            // first create the tilemap
187            tmap = tilemap_create(machine,
188                    my_get_info,            // pointer to your get_info
189                    tilemap_scan_rows,      // standard row-major mapper
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
190195                    8,8,                    // 8x8 tiles
191196                    64,32);                 // 64 columns, 32 rows
192197
193198            // then set the transparent pen; all other pens will default
194199            // to being part of layer 0
195            tilemap_set_transparent_pen(tmap, 0);
200            tmap.set_transparent_pen(0);
196201        }
197202
198        SCREEN_UPDATE( mydriver )
203        UINT32 my_state::screen_update_mydriver(
204            screen_device &screen,
205            bitmap_ind16 &bitmap,
206            const rectangle &cliprect)
199207        {
200208            // draw the tilemap first, fully opaque since it needs to
201209            // erase all previous pixels
202            tilemap_draw(
210            tmap->draw(
211                screen,                 // destination screen
203212                bitmap,                 // destination bitmap
204213                cliprect,               // clipping rectangle
205                tmap,                   // tilemap to draw
206                TILEMAP_DRAW_OPAQUE,    // flags
207                0);                     // don't use priority_bitmap
214                TILEMAP_DRAW_OPAQUE);   // flags
208215
209216            // next draw the sprites
210217            my_draw_sprites();
211218
212219            // then draw the tiles which have priority over sprites
213            tilemap_draw(
220            tmap->draw(
221                screen,                 // destination screen
214222                bitmap,                 // destination bitmap
215223                cliprect,               // clipping rectangle
216                tmap,                   // tilemap to draw
217                TILEMAP_DRAW_CATEGORY(1),// flags: draw category 1
218                0);                     // don't use priority_bitmap
224                TILEMAP_DRAW_CATEGORY(1));// flags: draw category 1
219225
220226            return 0;
221227        }
r241920r241921
237243
238244        TILEMAP_TRANSPARENT: This described a tilemap with a single
239245            transparent pen. To create the same effect, call
240            tilemap_set_transparent_pen() to specify which pen is
246            tilemap_t::set_transparent_pen() to specify which pen is
241247            transparent; all other pens will map to layer 0.
242248
243249        TILEMAP_BITMASK: This type is no longer special; with the new
r241920r241921
250256            also allowed for you to choose one of 4 mappings on a per-tile
251257            basis. All of this functionality is now expanded: you can
252258            specify one of 3 layers and can choose from one of 256 mappings
253            on a per-tile basis. You just call tilemap_set_transmask(),
259            on a per-tile basis. You just call tilemap_t::set_transmask(),
254260            which still exists but maps onto the new behavior. The "front"
255261            layer is now "layer 0" and the "back" layer is now "layer 1".
256262
r241920r241921
275281        TILEMAP_DRAW_LAYER0 is assumed.
276282
277283    * If you want to render with alpha blending, you can call
278        tilemap_draw() with the TILEMAP_DRAW_ALPHA flag.
284        tilemap_t::draw() with the TILEMAP_DRAW_ALPHA flag.
279285
280286    * To configure more complex pen-to-layer mapping, use the
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.
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.
288294
289295***************************************************************************/
290296
r241920r241921
306312#define TILEMAP_NUM_GROUPS              256
307313
308314
309// these flags control tilemap_draw() behavior
315// these flags control tilemap_t::draw() behavior
310316const UINT32 TILEMAP_DRAW_CATEGORY_MASK = 0x0f;     // specify the category to draw
311317const UINT32 TILEMAP_DRAW_LAYER0 = 0x10;            // draw layer 0
312318const UINT32 TILEMAP_DRAW_LAYER1 = 0x20;            // draw layer 1
r241920r241921
329335const UINT8 TILE_FORCE_LAYER1 = TILEMAP_PIXEL_LAYER1; // force all pixels to be layer 1 (no transparency)
330336const UINT8 TILE_FORCE_LAYER2 = TILEMAP_PIXEL_LAYER2; // force all pixels to be layer 2 (no transparency)
331337
332// tilemap global flags, used by tilemap_set_flip()
338// tilemap global flags, used by tilemap_t::set_flip()
333339const UINT32 TILEMAP_FLIPX = TILE_FLIPX;            // draw the tilemap horizontally flipped
334340const UINT32 TILEMAP_FLIPY = TILE_FLIPY;            // draw the tilemap vertically flipped
335341
r241920r241921
767773//  MACROS
768774//**************************************************************************
769775
770// macros to help form flags for tilemap_draw
776// macros to help form flags for tilemap_t::draw
771777#define TILEMAP_DRAW_CATEGORY(x)        (x)     // specify category to draw
772778#define TILEMAP_DRAW_ALPHA(x)           (TILEMAP_DRAW_ALPHA_FLAG | (rgb_t::clamp(x) << 24))
773779
trunk/src/lib/util/plaparse.c
r241920r241921
44
55    plaparse.h
66
7    Parser for Berkeley standard PLA files into raw fusemaps.
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
810
911***************************************************************************/
1012
r241920r241921
3133
3234struct parse_info
3335{
34   UINT32  inputs;
35   UINT32  outputs;
36   UINT32  terms;
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;
3741};
3842
3943
r241920r241921
5761    character stream
5862-------------------------------------------------*/
5963
60static UINT32 suck_number(const UINT8 **psrc)
64static UINT32 suck_number(const UINT8 **cursrc, const UINT8 *srcend)
6165{
62   const UINT8 *src = *psrc;
6366   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;
6474
6575   // loop over and accumulate digits
66   while (isdigit(*src))
76   while (isdigit(**cursrc))
6777   {
68      value = value * 10 + *src - '0';
69      src++;
78      value = value * 10 + (**cursrc) - '0';
79      (*cursrc)++;
7080   }
7181
72   // return a pointer to the string afterwards
73   *psrc = src;
7482   return value;
7583}
7684
r241920r241921
8189***************************************************************************/
8290
8391/*-------------------------------------------------
84    process_field - process a single field
92    process_terms - process input/output matrix
8593-------------------------------------------------*/
8694
87static void process_field(jed_data *data, const UINT8 *cursrc, const UINT8 *srcend, parse_info *pinfo)
95static bool process_terms(jed_data *data, const UINT8 **cursrc, const UINT8 *srcend, parse_info *pinfo)
8896{
89   cursrc++;
97   UINT32 curinput = 0;
98   UINT32 curoutput = 0;
99   bool outputs = false;
90100
91   // switch off of the field type
92   switch (*cursrc)
101   while (*cursrc < srcend && **cursrc != '.' && **cursrc != '#')
93102   {
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':
103      switch (**cursrc)
110104      {
111         cursrc += 2;
112         pinfo->terms = suck_number(&cursrc);
113         if (LOG_PARSE) printf("Terms: %u\n", pinfo->terms);
105         case '-':
106            if (!outputs)
107            {
108               curinput++;
109               jed_set_fuse(data, data->numfuses++, 1);
110               jed_set_fuse(data, data->numfuses++, 1);
114111
115         UINT32 curfuse = 0;
116         bool outputs = false;
112               if (LOG_PARSE) printf("11");
113            }
114            break;
117115
118         cursrc++;
119         while (cursrc < srcend && *cursrc != '.')
120         {
121            switch (*cursrc)
116         case '~':
117            if (!outputs)
122118            {
123            case '-':
124               if (!outputs)
125               {
126                  jed_set_fuse(data, curfuse++, 1);
127                  jed_set_fuse(data, curfuse++, 1);
119               curinput++;
120               // this product term is inhibited
121               jed_set_fuse(data, data->numfuses++, 0);
122               jed_set_fuse(data, data->numfuses++, 0);
128123
129                  if (LOG_PARSE) printf("11");
130               }
131               break;
124               if (LOG_PARSE) printf("00");
125            }
126            break;
132127
133            case '1':
134               if (outputs)
135               {
136                  jed_set_fuse(data, curfuse++, 0);
128         case '1':
129            if (outputs)
130            {
131               curoutput++;
132               jed_set_fuse(data, data->numfuses++, 0);
137133
138                  if (LOG_PARSE) printf("0");
139               }
140               else
141               {
142                  jed_set_fuse(data, curfuse++, 1);
143                  jed_set_fuse(data, curfuse++, 0);
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);
144141
145                  if (LOG_PARSE) printf("10");
146               }
147               break;
142               if (LOG_PARSE) printf("10");
143            }
144            break;
148145
149            case '0':
150               if (outputs)
151               {
152                  jed_set_fuse(data, curfuse++, 1);
146         case '0':
147            if (outputs)
148            {
149               curoutput++;
150               jed_set_fuse(data, data->numfuses++, 1);
153151
154                  if (LOG_PARSE) printf("1");
155               }
156               else
157               {
158                  jed_set_fuse(data, curfuse++, 0);
159                  jed_set_fuse(data, curfuse++, 1);
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);
160159
161                  if (LOG_PARSE) printf("01");
162               }
163               break;
160               if (LOG_PARSE) printf("01");
161            }
162            break;
164163
165            case ' ':
164         case ' ': case '\t':
165            if (curinput > 0 && !outputs)
166            {
166167               outputs = true;
167168               if (LOG_PARSE) printf(" ");
168               break;
169169            }
170            break;
171     
172         default:
173            break;
174      }
170175
171            if (iscrlf(*cursrc) && outputs)
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))
172230            {
173               outputs = false;
174               if (LOG_PARSE) printf("\n");
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)++;
175240            }
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;
176249
177            cursrc++;
250            if (LOG_PARSE) printf("Terms: %u\n", pinfo->terms);
178251         }
179
180         data->numfuses = curfuse;
181252         break;
182      }
183253
184      // end of file
185      case 'e':
254      // end of file (optional)
255      case 'e': case 'E':
186256         if (LOG_PARSE) printf("End of file\n");
187257         break;
258     
259      default:
260         return false;
188261   }
189
190   cursrc++;
262   
263   return true;
191264}
192265
193266
r241920r241921
201274{
202275   const UINT8 *cursrc = (const UINT8 *)data;
203276   const UINT8 *srcend = cursrc + length;
204   const UINT8 *scan;
277   
205278   parse_info pinfo;
279   memset(&pinfo, 0, sizeof(pinfo));
206280
207281   result->numfuses = 0;
208   memset(result->fusemap, 0x00, sizeof(result->fusemap));
282   memset(result->fusemap, 0, sizeof(result->fusemap));
209283
210284   while (cursrc < srcend)
211285   {
212      if (*cursrc == '#')
286      switch (*cursrc)
213287      {
214         cursrc++;
215         while (cursrc < srcend && !iscrlf(*cursrc))
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:
216307            cursrc++;
308            break;
217309      }
218      else if (*cursrc == '.')
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++)
219318      {
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;
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);
229322      }
230
231      cursrc++;
323      if (LOG_PARSE) printf("\n");
232324   }
233325
234326   return JEDERR_NONE;
trunk/src/mame/drivers/alinvade.c
r241920r241921
1313
1414#include "emu.h"
1515#include "cpu/m6502/m6502.h"
16#include "alinvade.lh"
1617
1718class alinvade_state : public driver_device
1819{
r241920r241921
190191ROM_END
191192
192193
193GAME( 198?, alinvade,  0,    alinvade, alinvade, driver_device,  0, ROT90, "Forbes?", "Alien Invaders", GAME_UNEMULATED_PROTECTION | GAME_NO_SOUND )
194GAMEL( 198?, alinvade,  0,    alinvade, alinvade, driver_device,  0, ROT90, "Forbes?", "Alien Invaders", GAME_UNEMULATED_PROTECTION | GAME_NO_SOUND, layout_alinvade )
trunk/src/mame/drivers/dooyong.c
r241920r241921
8484#include "sound/okim6295.h"
8585#include "includes/dooyong.h"
8686
87WRITE8_MEMBER(dooyong_state::lastday_bankswitch_w)
87WRITE8_MEMBER(dooyong_z80_state::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_state,lastday)
94MACHINE_START_MEMBER(dooyong_z80_state, cpu_z80)
9595{
9696   membank("bank1")->configure_entries(0, 8, memregion("maincpu")->base() + 0x10000, 0x4000);
9797}
9898
99WRITE8_MEMBER(dooyong_state::flip_screen_w)
99WRITE8_MEMBER(dooyong_z80_state::flip_screen_w)
100100{
101101   flip_screen_set(data);
102102}
103103
104MACHINE_RESET_MEMBER(dooyong_state,sound_ym2203)
104MACHINE_RESET_MEMBER(dooyong_z80_ym2203_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/***************************************************************************
r241920r241921
113113
114114***************************************************************************/
115115
116static ADDRESS_MAP_START( lastday_map, AS_PROGRAM, 8, dooyong_state )
116static ADDRESS_MAP_START( lastday_map, AS_PROGRAM, 8, dooyong_z80_ym2203_state )
117117   AM_RANGE(0x0000, 0x7fff) AM_ROM
118118   AM_RANGE(0x8000, 0xbfff) AM_ROMBANK("bank1")
119   AM_RANGE(0xc000, 0xc007) AM_WRITE(dooyong_bgscroll8_w)
120   AM_RANGE(0xc008, 0xc00f) AM_WRITE(dooyong_fgscroll8_w)
119   AM_RANGE(0xc000, 0xc007) AM_WRITE(bgscroll_w)
120   AM_RANGE(0xc008, 0xc00f) AM_WRITE(fgscroll_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(lastday_bankswitch_w)
124   AM_RANGE(0xc011, 0xc011) AM_WRITE(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(dooyong_txvideoram8_w) AM_SHARE("txvideoram")
130   AM_RANGE(0xd000, 0xdfff) AM_RAM_WRITE(txvideoram_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_state )
135static ADDRESS_MAP_START( pollux_map, AS_PROGRAM, 8, dooyong_z80_ym2203_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(dooyong_txvideoram8_w) AM_SHARE("txvideoram")
141   AM_RANGE(0xf000, 0xf000) AM_READ_PORT("DSWA") AM_WRITE(lastday_bankswitch_w)
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)
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(dooyong_bgscroll8_w)
149   AM_RANGE(0xf020, 0xf027) AM_WRITE(dooyong_fgscroll8_w)
148   AM_RANGE(0xf018, 0xf01f) AM_WRITE(bgscroll_w)
149   AM_RANGE(0xf020, 0xf027) AM_WRITE(fgscroll_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_state )
153static ADDRESS_MAP_START( gulfstrm_map, AS_PROGRAM, 8, dooyong_z80_ym2203_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(dooyong_txvideoram8_w) AM_SHARE("txvideoram")
158   AM_RANGE(0xe000, 0xefff) AM_RAM_WRITE(txvideoram_w) AM_SHARE("txvideoram")
159159   AM_RANGE(0xf000, 0xf000) AM_READ_PORT("DSWA")
160   AM_RANGE(0xf000, 0xf000) AM_WRITE(lastday_bankswitch_w)
160   AM_RANGE(0xf000, 0xf000) AM_WRITE(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(dooyong_bgscroll8_w)
168   AM_RANGE(0xf020, 0xf027) AM_WRITE(dooyong_fgscroll8_w)
167   AM_RANGE(0xf018, 0xf01f) AM_WRITE(bgscroll_w)
168   AM_RANGE(0xf020, 0xf027) AM_WRITE(fgscroll_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_state )
172static ADDRESS_MAP_START( bluehawk_map, AS_PROGRAM, 8, dooyong_z80_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")
r241920r241921
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(lastday_bankswitch_w)
181   AM_RANGE(0xc008, 0xc008) AM_WRITE(bankswitch_w)
182182   AM_RANGE(0xc010, 0xc010) AM_WRITE(soundlatch_byte_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)
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)
186186   AM_RANGE(0xc800, 0xcfff) AM_RAM_DEVWRITE("palette", palette_device, write) AM_SHARE("palette")
187   AM_RANGE(0xd000, 0xdfff) AM_RAM_WRITE(dooyong_txvideoram8_w) AM_SHARE("txvideoram")
187   AM_RANGE(0xd000, 0xdfff) AM_RAM_WRITE(txvideoram_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_state )
192static ADDRESS_MAP_START( flytiger_map, AS_PROGRAM, 8, dooyong_z80_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(lastday_bankswitch_w)
198   AM_RANGE(0xe000, 0xe000) AM_WRITE(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(dooyong_bgscroll8_w)
206   AM_RANGE(0xe040, 0xe047) AM_WRITE(dooyong_fgscroll8_w)
205   AM_RANGE(0xe030, 0xe037) AM_WRITE(bgscroll_w)
206   AM_RANGE(0xe040, 0xe047) AM_WRITE(fgscroll_w)
207207   AM_RANGE(0xe800, 0xefff) AM_RAM_WRITE(paletteram_flytiger_w) AM_SHARE("flytiger_palram")
208   AM_RANGE(0xf000, 0xffff) AM_RAM_WRITE(dooyong_txvideoram8_w) AM_SHARE("txvideoram")
208   AM_RANGE(0xf000, 0xffff) AM_RAM_WRITE(txvideoram_w) AM_SHARE("txvideoram")
209209ADDRESS_MAP_END
210210
211static ADDRESS_MAP_START( primella_map, AS_PROGRAM, 8, dooyong_state )
211static ADDRESS_MAP_START( primella_map, AS_PROGRAM, 8, dooyong_z80_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(dooyong_txvideoram8_w) AM_SHARE("txvideoram")
216   AM_RANGE(0xe000, 0xefff) AM_RAM_WRITE(txvideoram_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 */
r241920r241921
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(dooyong_bgscroll8_w)
226   AM_RANGE(0xfc08, 0xfc0f) AM_WRITE(dooyong_fgscroll8_w)
225   AM_RANGE(0xfc00, 0xfc07) AM_WRITE(bgscroll_w)
226   AM_RANGE(0xfc08, 0xfc0f) AM_WRITE(fgscroll_w)
227227ADDRESS_MAP_END
228228
229static ADDRESS_MAP_START( rshark_map, AS_PROGRAM, 16, dooyong_state )
229static ADDRESS_MAP_START( rshark_map, AS_PROGRAM, 16, dooyong_68k_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("spriteram16")
233   AM_RANGE(0x04d000, 0x04dfff) AM_RAM AM_SHARE("spriteram")
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_WRITE(dooyong_bgscroll16_w)
239   AM_RANGE(0x0c4010, 0x0c401f) AM_WRITE(dooyong_bg2scroll16_w)
238   AM_RANGE(0x0c4000, 0x0c400f) AM_WRITE8(bgscroll_w, 0x00ff)
239   AM_RANGE(0x0c4010, 0x0c401f) AM_WRITE8(bg2scroll_w, 0x00ff)
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(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)
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)
245245ADDRESS_MAP_END
246246
247static ADDRESS_MAP_START( superx_map, AS_PROGRAM, 16, dooyong_state )
247static ADDRESS_MAP_START( superx_map, AS_PROGRAM, 16, dooyong_68k_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("spriteram16")
251   AM_RANGE(0x0dd000, 0x0ddfff) AM_RAM AM_SHARE("spriteram")
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_WRITE(dooyong_bgscroll16_w)
257   AM_RANGE(0x084010, 0x08401f) AM_WRITE(dooyong_bg2scroll16_w)
256   AM_RANGE(0x084000, 0x08400f) AM_WRITE8(bgscroll_w, 0x00ff)
257   AM_RANGE(0x084010, 0x08401f) AM_WRITE8(bg2scroll_w, 0x00ff)
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(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)
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)
263263ADDRESS_MAP_END
264264
265static ADDRESS_MAP_START( popbingo_map, AS_PROGRAM, 16, dooyong_state )
265static ADDRESS_MAP_START( popbingo_map, AS_PROGRAM, 16, dooyong_68k_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("spriteram16")
269   AM_RANGE(0x04d000, 0x04dfff) AM_RAM AM_SHARE("spriteram")
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(rshark_ctrl_w)
275   AM_RANGE(0x0c0014, 0x0c0015) AM_WRITE(ctrl_w)
276276   AM_RANGE(0x0c0018, 0x0c001b) AM_WRITENOP // ?
277   AM_RANGE(0x0c4000, 0x0c400f) AM_WRITE(dooyong_bgscroll16_w)
278   AM_RANGE(0x0c4010, 0x0c401f) AM_WRITE(dooyong_bg2scroll16_w) // not used atm
277   AM_RANGE(0x0c4000, 0x0c400f) AM_WRITE8(bgscroll_w, 0x00ff)
278   AM_RANGE(0x0c4010, 0x0c401f) AM_WRITE8(bg2scroll_w, 0x00ff) // not used atm
279279   AM_RANGE(0x0c8000, 0x0c8fff) AM_DEVWRITE("palette", palette_device, write) AM_SHARE("palette")
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
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
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_state )
285static ADDRESS_MAP_START( lastday_sound_map, AS_PROGRAM, 8, dooyong_z80_ym2203_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)
r241920r241921
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_state )
293static ADDRESS_MAP_START( pollux_sound_map, AS_PROGRAM, 8, dooyong_z80_ym2203_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)
r241920r241921
772772   GFXDECODE_ENTRY( "gfx2", 0, popbingo_tilelayout, 256,  1 )
773773GFXDECODE_END
774774
775READ8_MEMBER(dooyong_state::unk_r)
775READ8_MEMBER(dooyong_z80_ym2203_state::unk_r)
776776{
777777   return 0;
778778}
779779
780WRITE_LINE_MEMBER(dooyong_state::irqhandler_2203_1)
780WRITE_LINE_MEMBER(dooyong_z80_ym2203_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_state::irqhandler_2203_2)
786WRITE_LINE_MEMBER(dooyong_z80_ym2203_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);
r241920r241921
800800   MCFG_SPEAKER_STANDARD_MONO("mono")
801801
802802   MCFG_SOUND_ADD("ym1", YM2203, 1500000)
803   MCFG_YM2203_IRQ_HANDLER(WRITELINE(dooyong_state,irqhandler_2203_1))
804   MCFG_AY8910_PORT_A_READ_CB(READ8(dooyong_state, unk_r))
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))
805805   MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.40)
806806
807807   MCFG_SOUND_ADD("ym2", YM2203, 1500000)
808   MCFG_YM2203_IRQ_HANDLER(WRITELINE(dooyong_state, irqhandler_2203_2))
809   MCFG_AY8910_PORT_A_READ_CB(READ8(dooyong_state, unk_r))
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))
810810   MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.40)
811811MACHINE_CONFIG_END
812812
r241920r241921
834834   MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.60)
835835MACHINE_CONFIG_END
836836
837static MACHINE_CONFIG_START( lastday, dooyong_state )
837static MACHINE_CONFIG_START( lastday, dooyong_z80_ym2203_state )
838838
839839   /* basic machine hardware */
840840   MCFG_CPU_ADD("maincpu", Z80, 8000000)   /* ??? */
r241920r241921
844844   MCFG_CPU_ADD("audiocpu", Z80, 8000000)  /* ??? */
845845   MCFG_CPU_PROGRAM_MAP(lastday_sound_map)
846846
847   MCFG_MACHINE_START_OVERRIDE(dooyong_state,lastday)
848   MCFG_MACHINE_RESET_OVERRIDE(dooyong_state,sound_ym2203)
847   MCFG_MACHINE_START_OVERRIDE(dooyong_z80_state, cpu_z80)
848   MCFG_MACHINE_RESET_OVERRIDE(dooyong_z80_ym2203_state, sound_ym2203)
849849
850850
851851   /* video hardware */
r241920r241921
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_state, screen_update_lastday)
859   MCFG_SCREEN_UPDATE_DRIVER(dooyong_z80_ym2203_state, screen_update_lastday)
860860   MCFG_SCREEN_VBLANK_DEVICE("spriteram", buffered_spriteram8_device, vblank_copy_rising)
861861   MCFG_SCREEN_PALETTE("palette")
862862
r241920r241921
864864   MCFG_PALETTE_ADD("palette", 1024)
865865   MCFG_PALETTE_FORMAT(xxxxBBBBGGGGRRRR)
866866
867   MCFG_VIDEO_START_OVERRIDE(dooyong_state,lastday)
867   MCFG_VIDEO_START_OVERRIDE(dooyong_z80_ym2203_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_state,irqhandler_2203_1))
874   MCFG_AY8910_PORT_A_READ_CB(READ8(dooyong_state, unk_r))
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))
875875   MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.40)
876876
877877   MCFG_SOUND_ADD("ym2", YM2203, 4000000)
878   MCFG_YM2203_IRQ_HANDLER(WRITELINE(dooyong_state, irqhandler_2203_2))
879   MCFG_AY8910_PORT_A_READ_CB(READ8(dooyong_state, unk_r))
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))
880880   MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.40)
881881
882882MACHINE_CONFIG_END
883883
884static MACHINE_CONFIG_START( gulfstrm, dooyong_state )
884static MACHINE_CONFIG_START( gulfstrm, dooyong_z80_ym2203_state )
885885
886886   /* basic machine hardware */
887887   MCFG_CPU_ADD("maincpu", Z80, 8000000)   /* ??? */
r241920r241921
891891   MCFG_CPU_ADD("audiocpu", Z80, 8000000)  /* ??? */
892892   MCFG_CPU_PROGRAM_MAP(lastday_sound_map)
893893
894   MCFG_MACHINE_START_OVERRIDE(dooyong_state,lastday)
895   MCFG_MACHINE_RESET_OVERRIDE(dooyong_state,sound_ym2203)
894   MCFG_MACHINE_START_OVERRIDE(dooyong_z80_state, cpu_z80)
895   MCFG_MACHINE_RESET_OVERRIDE(dooyong_z80_ym2203_state, sound_ym2203)
896896
897897   /* video hardware */
898898   MCFG_BUFFERED_SPRITERAM8_ADD("spriteram")
r241920r241921
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_state, screen_update_gulfstrm)
905   MCFG_SCREEN_UPDATE_DRIVER(dooyong_z80_ym2203_state, screen_update_gulfstrm)
906906   MCFG_SCREEN_VBLANK_DEVICE("spriteram", buffered_spriteram8_device, vblank_copy_rising)
907907   MCFG_SCREEN_PALETTE("palette")
908908
r241920r241921
910910   MCFG_PALETTE_ADD("palette", 1024)
911911   MCFG_PALETTE_FORMAT(xRRRRRGGGGGBBBBB)
912912
913   MCFG_VIDEO_START_OVERRIDE(dooyong_state,gulfstrm)
913   MCFG_VIDEO_START_OVERRIDE(dooyong_z80_ym2203_state, gulfstrm)
914914
915915   /* sound hardware */
916916   MCFG_FRAGMENT_ADD( sound_2203 )
917917MACHINE_CONFIG_END
918918
919static MACHINE_CONFIG_START( pollux, dooyong_state )
919static MACHINE_CONFIG_START( pollux, dooyong_z80_ym2203_state )
920920
921921   /* basic machine hardware */
922922   MCFG_CPU_ADD("maincpu", Z80, 8000000)   /* ??? */
r241920r241921
926926   MCFG_CPU_ADD("audiocpu", Z80, 8000000)  /* ??? */
927927   MCFG_CPU_PROGRAM_MAP(pollux_sound_map)
928928
929   MCFG_MACHINE_START_OVERRIDE(dooyong_state,lastday)
930   MCFG_MACHINE_RESET_OVERRIDE(dooyong_state,sound_ym2203)
929   MCFG_MACHINE_START_OVERRIDE(dooyong_z80_state, cpu_z80)
930   MCFG_MACHINE_RESET_OVERRIDE(dooyong_z80_ym2203_state, sound_ym2203)
931931
932932   /* video hardware */
933933   MCFG_BUFFERED_SPRITERAM8_ADD("spriteram")
r241920r241921
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_state, screen_update_pollux)
940   MCFG_SCREEN_UPDATE_DRIVER(dooyong_z80_ym2203_state, screen_update_pollux)
941941   MCFG_SCREEN_VBLANK_DEVICE("spriteram", buffered_spriteram8_device, vblank_copy_rising)
942942   MCFG_SCREEN_PALETTE("palette")
943943
r241920r241921
945945   MCFG_PALETTE_ADD("palette", 1024)
946946   MCFG_PALETTE_FORMAT(xRRRRRGGGGGBBBBB)
947947
948   MCFG_VIDEO_START_OVERRIDE(dooyong_state,pollux)
948   MCFG_VIDEO_START_OVERRIDE(dooyong_z80_ym2203_state, pollux)
949949
950950   /* sound hardware */
951951   MCFG_FRAGMENT_ADD( sound_2203 )
952952MACHINE_CONFIG_END
953953
954static MACHINE_CONFIG_START( bluehawk, dooyong_state )
954static MACHINE_CONFIG_START( bluehawk, dooyong_z80_state )
955955
956956   /* basic machine hardware */
957957   MCFG_CPU_ADD("maincpu", Z80, 8000000)   /* ??? */
r241920r241921
961961   MCFG_CPU_ADD("audiocpu", Z80, 4000000)  /* ??? */
962962   MCFG_CPU_PROGRAM_MAP(bluehawk_sound_map)
963963
964   MCFG_MACHINE_START_OVERRIDE(dooyong_state,lastday)
964   MCFG_MACHINE_START_OVERRIDE(dooyong_z80_state, cpu_z80)
965965
966966   /* video hardware */
967967   MCFG_BUFFERED_SPRITERAM8_ADD("spriteram")
r241920r241921
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_state, screen_update_bluehawk)
974   MCFG_SCREEN_UPDATE_DRIVER(dooyong_z80_state, screen_update_bluehawk)
975975   MCFG_SCREEN_VBLANK_DEVICE("spriteram", buffered_spriteram8_device, vblank_copy_rising)
976976   MCFG_SCREEN_PALETTE("palette")
977977
r241920r241921
979979   MCFG_PALETTE_ADD("palette", 1024)
980980   MCFG_PALETTE_FORMAT(xRRRRRGGGGGBBBBB)
981981
982   MCFG_VIDEO_START_OVERRIDE(dooyong_state,bluehawk)
982   MCFG_VIDEO_START_OVERRIDE(dooyong_z80_state, bluehawk)
983983
984984   /* sound hardware */
985985   MCFG_FRAGMENT_ADD( sound_2151 )
986986MACHINE_CONFIG_END
987987
988static MACHINE_CONFIG_START( flytiger, dooyong_state )
988static MACHINE_CONFIG_START( flytiger, dooyong_z80_state )
989989
990990   /* basic machine hardware */
991991   MCFG_CPU_ADD("maincpu", Z80, 8000000)   /* ??? */
r241920r241921
995995   MCFG_CPU_ADD("audiocpu", Z80, 4000000)  /* ??? */
996996   MCFG_CPU_PROGRAM_MAP(bluehawk_sound_map)
997997
998   MCFG_MACHINE_START_OVERRIDE(dooyong_state,lastday)
998   MCFG_MACHINE_START_OVERRIDE(dooyong_z80_state, cpu_z80)
999999
10001000   /* video hardware */
10011001   MCFG_BUFFERED_SPRITERAM8_ADD("spriteram")
r241920r241921
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_state, screen_update_flytiger)
1008   MCFG_SCREEN_UPDATE_DRIVER(dooyong_z80_state, screen_update_flytiger)
10091009   MCFG_SCREEN_VBLANK_DEVICE("spriteram", buffered_spriteram8_device, vblank_copy_rising)
10101010   MCFG_SCREEN_PALETTE("palette")
10111011
r241920r241921
10131013   MCFG_PALETTE_ADD("palette", 1024)
10141014   MCFG_PALETTE_FORMAT(xRRRRRGGGGGBBBBB)
10151015
1016   MCFG_VIDEO_START_OVERRIDE(dooyong_state,flytiger)
1016   MCFG_VIDEO_START_OVERRIDE(dooyong_z80_state, flytiger)
10171017
10181018   /* sound hardware */
10191019   MCFG_FRAGMENT_ADD( sound_2151 )
10201020MACHINE_CONFIG_END
10211021
1022static MACHINE_CONFIG_START( primella, dooyong_state )
1022static MACHINE_CONFIG_START( primella, dooyong_z80_state )
10231023
10241024   /* basic machine hardware */
10251025   MCFG_CPU_ADD("maincpu", Z80, 8000000)   /* ??? */
r241920r241921
10291029   MCFG_CPU_ADD("audiocpu", Z80, 4000000)  /* ??? */
10301030   MCFG_CPU_PROGRAM_MAP(bluehawk_sound_map)
10311031
1032   MCFG_MACHINE_START_OVERRIDE(dooyong_state,lastday)
1032   MCFG_MACHINE_START_OVERRIDE(dooyong_z80_state, cpu_z80)
10331033
10341034   /* video hardware */
10351035   MCFG_SCREEN_ADD("screen", RASTER)
r241920r241921
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_state, screen_update_primella)
1040   MCFG_SCREEN_UPDATE_DRIVER(dooyong_z80_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_state,primella)
1047   MCFG_VIDEO_START_OVERRIDE(dooyong_z80_state, primella)
10481048
10491049   /* sound hardware */
10501050   MCFG_FRAGMENT_ADD( sound_2151 )
10511051MACHINE_CONFIG_END
10521052
1053TIMER_DEVICE_CALLBACK_MEMBER(dooyong_state::rshark_scanline)
1053
1054TIMER_DEVICE_CALLBACK_MEMBER(dooyong_68k_state::scanline)
10541055{
10551056   int scanline = param;
10561057
1057   if(scanline == 248) // vblank-out irq
1058   if (scanline == 248) // vblank-out irq
10581059      m_maincpu->set_input_line(5, HOLD_LINE);
10591060
1060   if(scanline == 120) // timer irq?
1061   if (scanline == 120) // timer irq?
10611062      m_maincpu->set_input_line(6, HOLD_LINE);
10621063}
10631064
10641065
1065static MACHINE_CONFIG_START( rshark, dooyong_state )
1066static MACHINE_CONFIG_START( rshark, dooyong_68k_state )
10661067
10671068   /* basic machine hardware */
10681069   MCFG_CPU_ADD("maincpu", M68000, 8000000)    /* measured on super-x */
10691070   MCFG_CPU_PROGRAM_MAP(rshark_map)
1070   MCFG_TIMER_DRIVER_ADD_SCANLINE("scantimer", dooyong_state, rshark_scanline, "screen", 0, 1)
1071   MCFG_TIMER_DRIVER_ADD_SCANLINE("scantimer", dooyong_68k_state, scanline, "screen", 0, 1)
10711072
10721073   MCFG_CPU_ADD("audiocpu", Z80, 4000000)  /* measured on super-x */
10731074   MCFG_CPU_PROGRAM_MAP(bluehawk_sound_map)
10741075
10751076   /* video hardware */
1076   MCFG_BUFFERED_SPRITERAM16_ADD("spriteram16")
1077   MCFG_BUFFERED_SPRITERAM16_ADD("spriteram")
10771078
10781079   MCFG_SCREEN_ADD("screen", RASTER)
10791080   MCFG_SCREEN_REFRESH_RATE(60)
10801081   MCFG_SCREEN_VBLANK_TIME(ATTOSECONDS_IN_USEC(0))
10811082   MCFG_SCREEN_SIZE(64*8, 32*8)
10821083   MCFG_SCREEN_VISIBLE_AREA(8*8, (64-8)*8-1, 1*8, 31*8-1 )
1083   MCFG_SCREEN_UPDATE_DRIVER(dooyong_state, screen_update_rshark)
1084   MCFG_SCREEN_VBLANK_DEVICE("spriteram16", buffered_spriteram16_device, vblank_copy_rising)
1084   MCFG_SCREEN_UPDATE_DRIVER(dooyong_68k_state, screen_update_rshark)
1085   MCFG_SCREEN_VBLANK_DEVICE("spriteram", buffered_spriteram16_device, vblank_copy_rising)
10851086   MCFG_SCREEN_PALETTE("palette")
10861087
10871088   MCFG_GFXDECODE_ADD("gfxdecode", "palette", rshark)
10881089   MCFG_PALETTE_ADD("palette", 2048)
10891090   MCFG_PALETTE_FORMAT(xRRRRRGGGGGBBBBB)
10901091
1091   MCFG_VIDEO_START_OVERRIDE(dooyong_state,rshark)
1092   MCFG_VIDEO_START_OVERRIDE(dooyong_68k_state, rshark)
10921093
10931094   /* sound hardware */
10941095   MCFG_FRAGMENT_ADD( sound_2151_m68k )
10951096MACHINE_CONFIG_END
10961097
1097static MACHINE_CONFIG_START( superx, dooyong_state ) // dif mem map
1098static MACHINE_CONFIG_START( superx, dooyong_68k_state ) // dif mem map
10981099
10991100   /* basic machine hardware */
11001101   MCFG_CPU_ADD("maincpu", M68000, 8000000)    /* measured on super-x */
11011102   MCFG_CPU_PROGRAM_MAP(superx_map)
1102   MCFG_TIMER_DRIVER_ADD_SCANLINE("scantimer", dooyong_state, rshark_scanline, "screen", 0, 1)
1103   MCFG_TIMER_DRIVER_ADD_SCANLINE("scantimer", dooyong_68k_state, scanline, "screen", 0, 1)
11031104
11041105   MCFG_CPU_ADD("audiocpu", Z80, 4000000)  /* measured on super-x */
11051106   MCFG_CPU_PROGRAM_MAP(bluehawk_sound_map)
11061107
11071108   /* video hardware */
1108   MCFG_BUFFERED_SPRITERAM16_ADD("spriteram16")
1109   MCFG_BUFFERED_SPRITERAM16_ADD("spriteram")
11091110
11101111   MCFG_SCREEN_ADD("screen", RASTER)
11111112   MCFG_SCREEN_REFRESH_RATE(60)
11121113   MCFG_SCREEN_VBLANK_TIME(ATTOSECONDS_IN_USEC(0))
11131114   MCFG_SCREEN_SIZE(64*8, 32*8)
11141115   MCFG_SCREEN_VISIBLE_AREA(8*8, (64-8)*8-1, 1*8, 31*8-1 )
1115   MCFG_SCREEN_UPDATE_DRIVER(dooyong_state, screen_update_rshark)
1116   MCFG_SCREEN_VBLANK_DEVICE("spriteram16", buffered_spriteram16_device, vblank_copy_rising)
1116   MCFG_SCREEN_UPDATE_DRIVER(dooyong_68k_state, screen_update_rshark)
1117   MCFG_SCREEN_VBLANK_DEVICE("spriteram", buffered_spriteram16_device, vblank_copy_rising)
11171118   MCFG_SCREEN_PALETTE("palette")
11181119
11191120   MCFG_GFXDECODE_ADD("gfxdecode", "palette", rshark)
11201121   MCFG_PALETTE_ADD("palette", 2048)
11211122   MCFG_PALETTE_FORMAT(xRRRRRGGGGGBBBBB)
11221123
1123   MCFG_VIDEO_START_OVERRIDE(dooyong_state,rshark)
1124   MCFG_VIDEO_START_OVERRIDE(dooyong_68k_state, rshark)
11241125
11251126   /* sound hardware */
11261127   MCFG_FRAGMENT_ADD( sound_2151_m68k )
11271128MACHINE_CONFIG_END
11281129
1129static MACHINE_CONFIG_START( popbingo, dooyong_state )
1130static MACHINE_CONFIG_START( popbingo, dooyong_68k_state )
11301131
11311132   /* basic machine hardware */
11321133   MCFG_CPU_ADD("maincpu", M68000, 10000000)
11331134   MCFG_CPU_PROGRAM_MAP(popbingo_map)
1134   MCFG_TIMER_DRIVER_ADD_SCANLINE("scantimer", dooyong_state, rshark_scanline, "screen", 0, 1)
1135   MCFG_TIMER_DRIVER_ADD_SCANLINE("scantimer", dooyong_68k_state, scanline, "screen", 0, 1)
11351136
11361137   MCFG_CPU_ADD("audiocpu", Z80, 4000000)  /* measured on super-x */
11371138   MCFG_CPU_PROGRAM_MAP(bluehawk_sound_map)
11381139
11391140   /* video hardware */
1140   MCFG_BUFFERED_SPRITERAM16_ADD("spriteram16")
1141   MCFG_BUFFERED_SPRITERAM16_ADD("spriteram")
11411142
11421143   MCFG_SCREEN_ADD("screen", RASTER)
11431144   MCFG_SCREEN_REFRESH_RATE(60)
11441145   MCFG_SCREEN_VBLANK_TIME(ATTOSECONDS_IN_USEC(0))
11451146   MCFG_SCREEN_SIZE(64*8, 32*8)
11461147   MCFG_SCREEN_VISIBLE_AREA(8*8, (64-8)*8-1, 1*8, 31*8-1 )
1147   MCFG_SCREEN_UPDATE_DRIVER(dooyong_state, screen_update_popbingo)
1148   MCFG_SCREEN_VBLANK_DEVICE("spriteram16", buffered_spriteram16_device, vblank_copy_rising)
1148   MCFG_SCREEN_UPDATE_DRIVER(dooyong_68k_state, screen_update_popbingo)
1149   MCFG_SCREEN_VBLANK_DEVICE("spriteram", buffered_spriteram16_device, vblank_copy_rising)
11491150   MCFG_SCREEN_PALETTE("palette")
11501151
11511152   MCFG_GFXDECODE_ADD("gfxdecode", "palette", popbingo)
11521153   MCFG_PALETTE_ADD("palette", 2048)
11531154   MCFG_PALETTE_FORMAT(xRRRRRGGGGGBBBBB)
11541155
1155   MCFG_VIDEO_START_OVERRIDE(dooyong_state,popbingo)
1156   MCFG_VIDEO_START_OVERRIDE(dooyong_68k_state, popbingo)
11561157
11571158   /* sound hardware */
11581159   MCFG_FRAGMENT_ADD( sound_2151_m68k )
trunk/src/mame/drivers/meritm.c
r241920r241921
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
9798
9899Custom Program Versions (Superstar 30 / Supertouch 30):
99100
r241920r241921
109110
110111
111112  CRT-260:
112  *Megatouch Video (c)1994?
113113  Megatouch II (c)1994
114114  Megatouch III (c)1995
115115  Megatouch III Tournament Edition (c)1996
r241920r241921
11911191The Touchscreen Calibration routine doesn't seem to work?
11921192
11931193*/
1194
11951194ROM_START( mtjpoker ) /* Uses the CRT-258 touch controller board & Dallas DS1225Y NV SRAM */
11961195   ROM_REGION( 0x80000, "maincpu", 0 )
11971196   ROM_LOAD( "9132-00-02_u9-r0.u9", 0x00000, 0x10000, CRC(4ec683b6) SHA1(7cff76ba1517deede3dfa2a419e11fd603dcf695) ) /* 9132-00-02 R0 46  940416 */
r241920r241921
12131212 Hold5 advances through the list.
12141213 Hi-Score will clear the High Scores
12151214
1216Is the "Stand" & "Hi-Score" keys the same? Without a sperate Stand key, you cannot set up the "TWIN" bonus feature
1215Is the "Stand" & "Hi-Score" keys the same? Without a separate Stand key, you cannot set up the "TWIN" bonus feature
12171216
12181217*/
1219
12201218ROM_START( americna ) /* Uses a small daughter card CRT-251 & Dallas DS1225Y NV SRAM */
12211219   ROM_REGION( 0x80000, "maincpu", 0 )
12221220   ROM_LOAD( "9131-00_u9-2.u9",   0x00000, 0x10000, CRC(8a741fb6) SHA1(2d77c67e5a0bdaf6199c31c4055df214672db3e1) ) /* 9131-00 U9-2  888020 */
r241920r241921
12311229   ROM_LOAD( "9131-02_u11-0.u11", 0x20000, 0x10000, CRC(f137d70c) SHA1(8ec04ec17300aa3a6ef14bcca1ca1c2aec0eea18) )
12321230ROM_END
12331231
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
12591232ROM_START( pitboss2 )
12601233   ROM_REGION( 0x80000, "maincpu", 0 )
12611234   ROM_LOAD( "9221-01_u9-0c.u9",  0x00000, 0x10000, CRC(a1b6ac15) SHA1(b7b395f3e7e14dbb84003e03bf7d054e795a7211) ) /* 9221-01C  880221 */
r241920r241921
12701243
12711244ROM_START( spitboss )
12721245   ROM_REGION( 0x80000, "maincpu", 0 )
1273   ROM_LOAD( "9221-02_u9-0a.u9",   0x00000, 0x10000, CRC(e0c45c9c) SHA1(534bff67c8fee08f1c348275de8977659efa9f69) ) /* 9221-02A   886021 (actual, but should be 880621) */
1246   ROM_LOAD( "9221-02_u9-0a.u9",   0x00000, 0x10000, CRC(e0c45c9c) SHA1(534bff67c8fee08f1c348275de8977659efa9f69) ) /* 9221-02A   886021 */
12741247   ROM_LOAD( "9221-02_u10-0.u10",  0x10000, 0x10000, CRC(ed010c58) SHA1(02750944a28c1c27ce2a9904d11b7e46272a940e) )
12751248   ROM_LOAD( "9221-02_u11-0a.u11", 0x20000, 0x10000, CRC(0c65fa86) SHA1(7906a8d615116ca67bf370dfb2da8cb2389a313d) )
12761249   ROM_LOAD( "9221-02_u12-0.u12",  0x30000, 0x10000, CRC(0cf95b0e) SHA1(c6ffc13703892b9ae0da39a02db37c4ec890f79e) )
r241920r241921
12941267
12951268ROM_START( pitbosssa )
12961269   ROM_REGION( 0x80000, "maincpu", 0 )
1297   ROM_LOAD( "9221-10_u9-0a.u9",   0x00000, 0x10000, CRC(41be6b30) SHA1(c4df87a599e310ce29ee9277e5adc916ff68f060) ) /* 9221-10-00A  090370 (actual, but should be 090390) */
1270   ROM_LOAD( "9221-10_u9-0a.u9",   0x00000, 0x10000, CRC(41be6b30) SHA1(c4df87a599e310ce29ee9277e5adc916ff68f060) ) /* 9221-10-00A  090370 */
12981271   ROM_LOAD( "9221-10_u10-0.u10",  0x10000, 0x10000, CRC(853a1a99) SHA1(45e33442aa7e51c05c9ac8b8458937ee3ff4c21d) )
12991272   ROM_LOAD( "9221-10_u11-0a.u11", 0x20000, 0x10000, CRC(c9137469) SHA1(618680609bdffa92b919a2417bd3ec41a4c8bf2b) )
13001273   ROM_LOAD( "9221-10_u12-0.u12",  0x30000, 0x10000, CRC(3577a203) SHA1(80f9c827ad9dea2c6af788bd3b46ab65e8c594eb) )
r241920r241921
13301303   ROM_LOAD( "9233-00-01_u15-r0", 0x60000, 0x10000, CRC(5810840e) SHA1(bad6457752ac212c3c11360a13a8d3473662a287) )
13311304
13321305   ROM_REGION( 0x000022, "ds1204", 0 )
1333   ROM_LOAD( "9233-01_u1-ro1_c1993_mii", 0x000000, 0x000022, BAD_DUMP CRC(93459659) SHA1(73ad4c3a7c52d3db3acb43662c535f8c2ed2376a) )
1306   ROM_LOAD( "9233-01_u1-r01_c1993_mii", 0x000000, 0x000022, BAD_DUMP CRC(93459659) SHA1(73ad4c3a7c52d3db3acb43662c535f8c2ed2376a) )
13341307
13351308   ROM_REGION( 0xc0000, "extra", 0 ) // question roms
13361309   ROM_LOAD( "qs9233-01_u7-r0",  0x00000, 0x40000, CRC(176dd688) SHA1(306cf78101219ef1122023a01d16dff5e9f2aecf) ) /* These 3 roms are on CRT-256 sattalite PCB */
r241920r241921
13381311   ROM_LOAD( "qs9233-01_u5-r0",  0x80000, 0x40000, CRC(740b1274) SHA1(14eab68fc137b905a5a2739c7081900a48cba562) )
13391312ROM_END
13401313
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
13411340ROM_START( pbst30 ) /* Dallas DS1204V security key attached to CRT-254 connected to J2 connector labeled 9234-10 U1-RO1 C1994 MII */
13421341   ROM_REGION( 0x80000, "maincpu", 0 )
13431342   ROM_LOAD( "9234-10-01_u9-r0",  0x00000, 0x10000, CRC(96f39c9a) SHA1(df698e94a5204cf050ceadc5c257ca5f68171114) ) /* 9234-10-01 032294 */
r241920r241921
13491348   ROM_LOAD( "9234-10-01_u15-r0", 0x60000, 0x10000, CRC(9fbd8582) SHA1(c0f68c8a7cdca34c8736cefc71767c421bcaba8a) )
13501349
13511350   ROM_REGION( 0x000022, "ds1204", 0 )
1352   ROM_LOAD( "9234-10_u1-ro1_c1994_mii", 0x000000, 0x000022, BAD_DUMP CRC(1c782f78) SHA1(8255afcffbe21a43f53cfb41867552681403ea47) )
1351   ROM_LOAD( "9234-10_u1-r01_c1994_mii", 0x000000, 0x000022, BAD_DUMP CRC(1c782f78) SHA1(8255afcffbe21a43f53cfb41867552681403ea47) )
13531352
13541353   ROM_REGION( 0xc0000, "extra", 0 ) // question roms
13551354   ROM_LOAD( "qs9234-01_u7-r0",  0x00000, 0x40000, CRC(c0534aaa) SHA1(4b3cbf03f29fd5b4b8fd423e73c0c8147692fa75) ) /* These 3 roms are on CRT-256 sattalite PCB */
r241920r241921
13571356   ROM_LOAD( "qs9234-01_u5-r0",  0x80000, 0x40000, CRC(293fe305) SHA1(8a551ae8fb4fa4bf329128be1bfd6f1c3ff5a366) )
13581357ROM_END
13591358
1360ROM_START( pbst30b ) /* Dallas DS1204V security key attached to CRT-254 connected to J2 connector labeled 9234-01 U1-RO1 C1993 MII */
1359ROM_START( pbst30a ) /* Dallas DS1204V security key attached to CRT-254 connected to J2 connector labeled 9234-01 U1-RO1 C1993 MII */
13611360   ROM_REGION( 0x80000, "maincpu", 0 )
13621361   ROM_LOAD( "9234-00-01_u9-r0a",  0x00000, 0x10000, CRC(5f058f95) SHA1(98382935340a076bdb1b20c7f16c25b6084599fe) ) /* 9234-00-01  122293 */
13631362   ROM_LOAD( "9234-00-01_u10-r0",  0x10000, 0x10000, CRC(853a1a99) SHA1(45e33442aa7e51c05c9ac8b8458937ee3ff4c21d) )
r241920r241921
13681367   ROM_LOAD( "9234-00-01_u15-r0a", 0x60000, 0x10000, CRC(f10f0d39) SHA1(2b5d5a93adb5251e09160b10c067b6e70289f608) )
13691368
13701369   ROM_REGION( 0x000022, "ds1204", 0 )
1371   ROM_LOAD( "9234-01_u1-ro1_c1993_mii", 0x000000, 0x000022, BAD_DUMP CRC(74bf0546) SHA1(eb44a057cf797279ee3456a74e166fa711547ea4) )
1370   ROM_LOAD( "9234-01_u1-r01_c1993_mii", 0x000000, 0x000022, BAD_DUMP CRC(74bf0546) SHA1(eb44a057cf797279ee3456a74e166fa711547ea4) )
13721371
13731372   ROM_REGION( 0xc0000, "extra", 0 ) // question roms
13741373   ROM_LOAD( "qs9234-01_u7-r0",  0x00000, 0x40000, CRC(c0534aaa) SHA1(4b3cbf03f29fd5b4b8fd423e73c0c8147692fa75) ) /* These 3 roms are on CRT-256 sattalite PCB */
r241920r241921
13871386   ROM_LOAD( "9243-00-01_u15-r0", 0x60000, 0x10000, CRC(27034061) SHA1(cff6be592a4a3ab01c204b081470f224e6186c4d) )
13881387   ROM_RELOAD(     0x70000, 0x10000)
13891388
1390
13911389   ROM_REGION( 0xc0000, "extra", 0 ) // question roms
13921390   ROM_LOAD( "qs9243-00-01_u7-r0",  0x00000, 0x40000, CRC(35f4ca46) SHA1(87917b3017f505fae65d6bfa2c7d6fb503c2da6a) ) /* These 3 roms are on CRT-256 sattalite PCB */
13931391   ROM_LOAD( "qs9243-00-01_u6-r0",  0x40000, 0x40000, CRC(606f1656) SHA1(7f1e3a698a34d3c3b8f9f2cd8d5224b6c096e941) )
r241920r241921
142614241- Great Draw Poker and 7 Stud Poker have been added to the program set
142714252- On page 3-1 legend artwork has changed. PASS has been replaced with
14281426   PASS/PLAY and COLLECT/QUIT has been replaced with COLLECT/QUIT/RAISE
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
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
14311429   players use.
14321430
14331431*/
1434
14351432ROM_START( pitbossm ) /* Dallas DS1204V security key attached to CRT-254 connected to J2 connector labeled 9244-00 U1-RO1 C1994 MII */
14361433   ROM_REGION( 0x80000, "maincpu", 0 )
14371434   ROM_LOAD( "9244-00-01_u9-r0",  0x00000, 0x10000, CRC(8317fea1) SHA1(eb84fdca7cd51883153561785571790d12d0d612) ) /* 9244-00-01 R0  940822 */
r241920r241921
14911488It's currently unknown how to access / enable those features or if it's possible to do so.
14921489
14931490*/
1494
14951491ROM_START( realbrod ) /* Dallas DS1204U-3 security key labeled 9131-20-00-U5-R0A */
14961492   ROM_REGION( 0x400000, "maincpu", 0 )
14971493   /* U32 Empty */
r241920r241921
15221518             one PC16550DN
15231519             one PB255a or L5220574
15241520             One Dallas DS1204 Data Key
1525             One Dallas DS1225Y 64k Non-volitile SRAM (Mega Touch 4)
1526              or Dallas DS1230Y 256K Non-volitile SRAM (Mega Touch 6)
1521             One Dallas DS1225Y 64k Non-volatile SRAM (Mega Touch 4)
1522              or Dallas DS1230Y 256K Non-volatile SRAM (Mega Touch 6)
15271523              or Dallas DS1644 32K NVRAM + RTC (Tournament sets)
15281524             Two Z80APIO (Z0842004PSC)
15291525
r241920r241921
22922288
22932289/* CRT-250 + CRT-252 + CRT-256 + CRT-258 */
22942290GAME( 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 )
22952292GAME( 1994, pbst30,    0,        meritm_crt250_crt252_crt258, pbst30,     driver_device, 0,  ROT0, "Merit", "Pit Boss Supertouch 30 (9234-10-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 )
2293GAME( 1993, pbst30a,   pbst30,   meritm_crt250_crt252_crt258, pbst30,     driver_device, 0,  ROT0, "Merit", "Pit Boss Supertouch 30 (9234-00-01)", GAME_IMPERFECT_GRAPHICS )
22972294
22982295/* CRT-250 + CRT-254 + CRT-256 */
22992296GAME( 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
r241920r241921
26612661 */
26622662
26632663static MACHINE_CONFIG_DERIVED( naomim4, naomi_base )
2664   MCFG_NAOMI_M4_BOARD_ADD("rom_board", ":rom_key", "naomibd_eeprom", ":boardid", WRITE8(dc_state, g1_irq))
2664   MCFG_NAOMI_M4_BOARD_ADD("rom_board", ":pic_readout", "naomibd_eeprom", ":boardid", WRITE8(dc_state, g1_irq))
26652665MACHINE_CONFIG_END
26662666
26672667/*
r241920r241921
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) )
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 )
56025604
56035605   ROM_REGION(0x4, "boardid", ROMREGION_ERASEVAL(0x02))
56045606ROM_END
r241920r241921
56125614   ROM_LOAD( "epr-24357.ic7", 0x0000000, 0x0400000, CRC(a2236d58) SHA1(3746b9d3c0f7ecf6340619bb8bf01f170ac4efb7) ) // EPR mode, overwrite FPR data
56135615   ROM_LOAD( "fpr-24334.ic9", 0x4000000, 0x4000000, CRC(13d2d1dc) SHA1(6a47cfaddf006e6ff46837fac956fbcc20619d79) )
56145616
5615   ROM_REGION( 4, "rom_key", 0 )
5616   ROM_LOAD( "mushik2e-key.bin", 0, 4, CRC(b32a0633) SHA1(984c01e43cf359d8e8a0c6cb1a04c5dc3da47d39) )
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 )
56175621
56185622   ROM_REGION(0x4, "boardid", ROMREGION_ERASEVAL(0x82))
56195623ROM_END
r241920r241921
56265630   ROM_LOAD( "fpr-24338.ic8", 0x0000000, 0x4000000, CRC(1423c374) SHA1(e6a3f0eaccd13c161d07705bcd00f447f08fc186) )
56275631   ROM_LOAD( "fpr-24339.ic9", 0x4000000, 0x4000000, CRC(11883792) SHA1(1782db04f74394f981f887ab1a95d687eb2c0b35) )
56285632
5629   ROM_REGION( 4, "rom_key", 0 )
5630   ROM_LOAD( "zunou-key.bin", 0, 4, CRC(cbe35afb) SHA1(78877655800aae27661bf720e1c37d6c6f2e3d1c) )
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 )
56315637
56325638   ROM_REGION(0x4, "boardid", ROMREGION_ERASEVAL(0x02))
56335639ROM_END
r241920r241921
56425648   ROM_LOAD( "fpr-24415.ic10", 0x8000000, 0x4000000, CRC(133c742c) SHA1(89f857a31731dc918afc72b6cb716f5c77cb9d6e) )
56435649   ROM_LOAD( "fpr-24416.ic11", 0xc000000, 0x4000000, CRC(562fb88e) SHA1(172678e3e27cfad7f7e6217c4653a4ba119bfbdf) )
56445650
5645   ROM_REGION( 4, "rom_key", 0 )
5646   ROM_LOAD( "sl2007-key.bin", 0, 4, CRC(d5d1e807) SHA1(8a0cc371729c622bb05c5d26b3e39ec31d29ace1) )
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) )
56475653
56485654   ROM_REGION(0x4, "boardid", ROMREGION_ERASEVAL(0x04))
56495655ROM_END
r241920r241921
56585664   ROM_LOAD( "fpr-24384.ic10", 0x8000000, 0x4000000, CRC(2e9116c4) SHA1(58903a33c4ce72a1f75aefcab94393fc2e8bd2d9) )
56595665   ROM_LOAD( "fpr-24385.ic11", 0xc000000, 0x4000000, CRC(2b79f45d) SHA1(db97d980bf1590df4b983a4b7786977687238ef5) )
56605666
5661   ROM_REGION( 4, "rom_key", 0 )
5662   ROM_LOAD( "asndynmt-key.bin", 0, 4, CRC(bf5396a9) SHA1(0b27fdc800143fb977cb2f1e937078d7a7006939) )
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) )
56635669
56645670   ROM_REGION(0x4, "boardid", ROMREGION_ERASEVAL(0x04))
56655671ROM_END
r241920r241921
56745680   ROM_LOAD( "fpr-24439.ic10", 0x8000000, 0x4000000, CRC(c02040f9) SHA1(27ad2cb45e8a516433917f060ca9798412bb95f7) )
56755681   // IC11 Populated, Empty
56765682
5677   ROM_REGION( 4, "rom_key", 0 )
5678   ROM_LOAD( "illvelo-key.bin", 0, 4, CRC(e164952f) SHA1(6c0dfe567640e1e843a5d7bf858a24c101dfcf95) )
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) )
56795685
56805686   ROM_REGION(0x4, "boardid", ROMREGION_ERASEVAL(0x04))
56815687ROM_END
r241920r241921
56905696   ROM_LOAD( "ic10.bin", 0x8000000, 0x4000000, CRC(76fb945f) SHA1(448be0c3d9a7c3956dd51aca3c4d8d28f8cec227) )
56915697   // IC11 Populated, Empty
56925698
5693   ROM_REGION( 4, "rom_key", 0 )
5694   ROM_LOAD( "mamonoro-key.bin", 0x000000, 0x000004, CRC(264ca27a) SHA1(3b81b9794d86697f8eac7ea6945d992564ad6199) )
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) )
56955701
56965702   ROM_REGION(0x4, "boardid", ROMREGION_ERASEVAL(0x04))
56975703ROM_END
r241920r241921
57085714   ROM_LOAD( "ic12.bin",     0x10000000, 0x4000000, CRC(b8a6bff2) SHA1(befbc2e917b3107f1c4bfb9169623282ff97bfb2) )
57095715   ROM_LOAD( "ic13.bin",     0x14000000, 0x4000000, CRC(4886329f) SHA1(6ccf6fb83cfdbef3f85f6c06e641c38ff434d605) )
57105716
5711   ROM_REGION( 4, "rom_key", 0 )
5712   ROM_LOAD( "mbaa-key.bin", 0x000000, 0x000004, CRC(f4ad909f) SHA1(27ba44592c2642b5862a24f68c755ad4115e6047) )
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) )
57135719
57145720   ROM_REGION(0x4, "boardid", ROMREGION_ERASEVAL(0x06))
57155721ROM_END
r241920r241921
57275733   ROM_LOAD( "ic12.bin",     0x10000000, 0x4000000, CRC(b8a6bff2) SHA1(befbc2e917b3107f1c4bfb9169623282ff97bfb2) )
57285734   ROM_LOAD( "ic13.bin",     0x14000000, 0x4000000, CRC(4886329f) SHA1(6ccf6fb83cfdbef3f85f6c06e641c38ff434d605) )
57295735
5730   ROM_REGION( 4, "rom_key", 0 )
5731   ROM_LOAD( "mbaa-key.bin", 0x000000, 0x000004, CRC(f4ad909f) SHA1(27ba44592c2642b5862a24f68c755ad4115e6047) )
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) )
57325738
57335739   ROM_REGION(0x4, "boardid", ROMREGION_ERASEVAL(0x86))
57345740ROM_END
r241920r241921
57425748   ROM_LOAD( "ic9.bin", 0x4000000, 0x4000000, CRC(16cf2e7a) SHA1(ff7c6540e4507f84e3128ba03be4826ba504678c) )
57435749   // IC10 and IC11 Populated, Empty
57445750
5745   ROM_REGION( 4, "rom_key", 0 )
5746   ROM_LOAD( "radirgyn-key.bin", 0x000000, 0x000004, CRC(c158cf3b) SHA1(c128646d7fee79fc10bf7bbaa23121f347df77f4) )
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) )
57475753
57485754   ROM_REGION(0x4, "boardid", ROMREGION_ERASEVAL(0x04))
57495755ROM_END
r241920r241921
57575763   ROM_LOAD( "ic9.bin",    0x4000000, 0x4000000, CRC(18c994d7) SHA1(159e1425b2fc645133814b0d26d93a90e9849b1a) )
57585764   // IC10 and IC11 Populated, Empty
57595765
5760   ROM_REGION( 4, "rom_key", 0 )
5761   ROM_LOAD( "ausfache-key.bin", 0, 4, CRC(93cdc793) SHA1(f0a0c321a3bdf8ca87cbd840a168a9057c08f16a) )
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) )
57625768
57635769   ROM_REGION(0x4, "boardid", ROMREGION_ERASEVAL(0x04))
57645770ROM_END
r241920r241921
57775783   ROM_REGION( 0x200000, "ioboard", 0) // touch screen I/O board, program disassembles as little-endian SH-4
57785784   ROM_LOAD( "fpr24351.ic14", 0x000000, 0x200000, CRC(4d1b7b89) SHA1(965b8c6b5a2e7b3f1b1e2eac19c86000c3b66754) )
57795785
5780   ROM_REGION( 4, "rom_key", 0 )
5781   ROM_LOAD( "pokasuka-key.bin", 0, 4, CRC(f00bcd61) SHA1(b8315b851656c2e0b7853979988d1c44eab0886b) )
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 )
57825790
57835791   ROM_REGION(0x4, "boardid", ROMREGION_ERASEVAL(0x05))
57845792ROM_END
r241920r241921
57975805   ROM_REGION( 0x200000, "ioboard", 0) // touch screen I/O board, program disassembles as little-endian SH-4
57985806   ROM_LOAD( "fpr24351.ic14", 0x000000, 0x200000, CRC(4d1b7b89) SHA1(965b8c6b5a2e7b3f1b1e2eac19c86000c3b66754) )
57995807
5800   ROM_REGION( 4, "rom_key", 0 )
5801   ROM_LOAD( "pokasuka-key.bin", 0, 4, CRC(f00bcd61) SHA1(b8315b851656c2e0b7853979988d1c44eab0886b) )
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 )
58025812
58035813   ROM_REGION(0x4, "boardid", ROMREGION_ERASEVAL(0x05))
58045814ROM_END
r241920r241921
58165826   ROM_LOAD( "fpr-24425.ic10", 0x08000000, 0x4000000, CRC(6223ebac) SHA1(64c0ec61c108acbb557e7d3837f578deba832cb6) )
58175827   ROM_LOAD( "fpr-24426.ic11", 0x0c000000, 0x4000000, CRC(c78b0981) SHA1(f889acf9065566e11ff985a3b6c4824e364d57ae) )
58185828
5819   ROM_REGION( 4, "rom_key", 0 )
5820   ROM_LOAD( "rhytngk-key.bin", 0x000000, 0x000004, CRC(e2560d28) SHA1(46fb9b47a0df3035f92db2b0c63a6e4e0745ad29) )
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) )
58215831
58225832   ROM_REGION(0x4, "boardid", ROMREGION_ERASEVAL(0x04))
58235833ROM_END
trunk/src/mame/drivers/prehisle.c
r241920r241921
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")
r241920r241921
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" )
r241920r241921
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
r241920r241921
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"),
128      m_maincpu(*this, "maincpu"),
139      m_audiocpu(*this, "audiocpu"),
1410      m_gfxdecode(*this, "gfxdecode"),
15      m_palette(*this, "palette")  { }
11      m_palette(*this, "palette")
12   { }
1613
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;
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
2625   tilemap_t *m_bg_tilemap;
2726   tilemap_t *m_bg2_tilemap;
2827   tilemap_t *m_fg_tilemap;
r241920r241921
3635   UINT8 *m_bg2_tilerom;
3736   UINT8 *m_fg_tilerom;
3837   UINT8 *m_fg2_tilerom;
39   UINT8 *m_bg_tilerom2;
40   UINT8 *m_bg2_tilerom2;
41   UINT8 *m_fg_tilerom2;
42   UINT8 *m_fg2_tilerom2;
4338   int m_bg_gfx;
4439   int m_bg2_gfx;
4540   int m_fg_gfx;
4641   int m_fg2_gfx;
47   int m_tx_tilemap_mode;
4842
49   int m_interrupt_line_1;
50   int m_interrupt_line_2;
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};
5148
52   DECLARE_WRITE8_MEMBER(lastday_bankswitch_w);
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
5367   DECLARE_WRITE8_MEMBER(flip_screen_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);
68   DECLARE_WRITE8_MEMBER(bankswitch_w);
69   DECLARE_WRITE8_MEMBER(txvideoram_w);
6570   DECLARE_WRITE8_MEMBER(primella_ctrl_w);
6671   DECLARE_WRITE8_MEMBER(paletteram_flytiger_w);
6772   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);
7573   TILE_GET_INFO_MEMBER(get_tx_tile_info);
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);
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);
8379   DECLARE_VIDEO_START(bluehawk);
8480   DECLARE_VIDEO_START(flytiger);
8581   DECLARE_VIDEO_START(primella);
86   DECLARE_VIDEO_START(rshark);
87   DECLARE_VIDEO_START(popbingo);
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);
88107   UINT32 screen_update_lastday(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
89108   UINT32 screen_update_gulfstrm(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
90109   UINT32 screen_update_pollux(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);
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);
94134   UINT32 screen_update_rshark(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
95135   UINT32 screen_update_popbingo(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
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;
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;
106146};
trunk/src/mame/includes/prehisle.h
r241920r241921
2323   tilemap_t *m_bg2_tilemap;
2424   tilemap_t *m_bg_tilemap;
2525   tilemap_t *m_fg_tilemap;
26
2627   DECLARE_WRITE16_MEMBER(prehisle_sound16_w);
2728   DECLARE_WRITE16_MEMBER(prehisle_bg_videoram16_w);
2829   DECLARE_WRITE16_MEMBER(prehisle_fg_videoram16_w);
r241920r241921
3536   TILE_GET_INFO_MEMBER(get_fg_tile_info);
3637   virtual void video_start();
3738   UINT32 screen_update_prehisle(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
38   void draw_sprites(bitmap_ind16 &bitmap, const rectangle &cliprect, int foreground );
39   void draw_sprites(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
3940   DECLARE_WRITE_LINE_MEMBER(irqhandler);
41
4042   required_device<cpu_device> m_maincpu;
4143   required_device<cpu_device> m_audiocpu;
4244   required_device<upd7759_device> m_upd7759;
trunk/src/mame/layout/alinvade.lay
r0r241921
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
r241920r241921
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 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
19// the algorithm is a 32-bits key stored in the PIC16C621A. The hardware auto-reset the feed value
2120// to the cart-based IV every 16 blocks (32 bytes); that reset is not address-based, but index-based.
2221
2322const device_type NAOMI_M4_BOARD = &device_creator<naomi_m4_board>;
2423
2524const UINT8 naomi_m4_board::k_sboxes[4][16] = {
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}
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}
3029};
3130
3231// from S29GL512N datasheet
r241920r241921
6766   key = tempkey & 0xffff;
6867#else
6968   const UINT8 *key_data = memregion(key_tag)->base();
70   key = (key_data[2] << 8) | key_data[3];
71   iv = (key_data[0] << 8) | key_data[1];
69   subkey1 = (key_data[17] << 8) | key_data[16];
70   subkey2 = (key_data[19] << 8) | key_data[18];
7271#endif
7372   buffer = auto_alloc_array(machine(), UINT8, BUFFER_SIZE);
7473   enc_init();
r241920r241921
117116   encryption = false;
118117   cfi_mode = false;
119118   counter = 0;
120   cur_iv = 0;
119   iv = 0;
121120}
122121
123122void naomi_m4_board::board_setup_address(UINT32 address, bool is_dma)
r241920r241921
176175void naomi_m4_board::enc_reset()
177176{
178177   buffer_actual_size = 0;
179   cur_iv = iv;
178   iv = 0;
180179   counter = 0;
181180}
182181
182UINT16 naomi_m4_board::decrypt_one_round(UINT16 word, UINT16 subkey)
183{
184   return one_round[word ^ subkey] ^ subkey ;
185}
186
183187void naomi_m4_board::enc_fill()
184188{
185189   const UINT8 *base = m_region->base() + rom_cur_address;
186190   while(buffer_actual_size < BUFFER_SIZE) {
187191      UINT16 enc = base[0] | (base[1] << 8);
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
192      UINT16 dec = iv;
193      iv = decrypt_one_round(enc ^ iv, subkey1);
194      dec ^= decrypt_one_round(iv, subkey2);
195     
192196      buffer[buffer_actual_size++] = dec;
193197      buffer[buffer_actual_size++] = dec >> 8;
194198
r241920r241921
198202      counter++;
199203      if(counter == 16) {
200204         counter = 0;
201         cur_iv = iv;
205         iv = 0;
202206      }
203207   }
204208}
trunk/src/mame/machine/naomim4.h
r241920r241921
3232   static const UINT8 k_sboxes[4][16];
3333
3434   const char *key_tag;
35   UINT16 key, iv;
35   UINT16 subkey1, subkey2;
3636   UINT16 *one_round;
3737
3838   UINT8 *buffer;
3939   UINT32 rom_cur_address, buffer_actual_size;
40   UINT16 cur_iv;
40   UINT16 iv;
4141   UINT8 counter;
4242   bool encryption;
4343   bool cfi_mode;
r241920r241921
4545   void enc_init();
4646   void enc_reset();
4747   void enc_fill();
48   UINT16 decrypt_one_round(UINT16 word, UINT16 subkey);
4849};
4950
5051extern const device_type NAOMI_M4_BOARD;
trunk/src/mame/mame.lst
r241920r241921
1053110531pitbossma       // (c) 1994 Merit
1053210532pbss330         // (c) 1994 Merit
1053310533pbst30          // (c) 1994 Merit
10534pbst30b         // (c) 1993 Merit
10534pbst30a         // (c) 1993 Merit
1053510535realbrod        // (c) 1995 Merit
1053610536mtjpoker        // (c) 1994 Merit
10537megat           // (c) 1994 Merit
1053710538megat2          // (c) 1994 Merit
1053810539megat2a         // (c) 1994 Merit
1053910540megat2b         // (c) 1994 Merit
trunk/src/mame/mame.mak
r241920r241921
24802480
24812481$(DRIVERS)/acefruit.o:  $(LAYOUT)/sidewndr.lh
24822482
2483$(DRIVERS)/alinvade.o:  $(LAYOUT)/alinvade.lh
2484
24832485$(DRIVERS)/allied.o:    $(LAYOUT)/allied.lh
24842486
24852487$(DRIVERS)/amaticmg.o:  $(LAYOUT)/suprstar.lh
trunk/src/mame/video/dooyong.c
r241920r241921
22#include "includes/dooyong.h"
33
44
5inline void dooyong_state::dooyong_scroll8_w(offs_t offset, UINT8 data, UINT8 *scroll, tilemap_t *map)
5inline void dooyong_state::scroll8_w(offs_t offset, UINT8 data, UINT8 *scroll, tilemap_t *map)
66{
77   UINT8 old = scroll[offset];
88   if (old != data)
r241920r241921
1818         break;
1919      case 3: /* Low byte of y scroll */
2020      case 4: /* High byte of y scroll */
21         map->set_scrolly(0, (int)scroll[3] | ((int)scroll[4] << 8));
21         map->set_scrolly(0, (unsigned)scroll[3] | ((unsigned)scroll[4] << 8));
2222         break;
2323      case 6: /* Tilemap enable and mode control */
2424         map->enable(!(data & 0x10));
r241920r241921
4343}
4444
4545
46/* These handle writes to the tilemap scroll registers in 8-bit machines.
46/* These handle writes to the tilemap scroll registers.
4747   There is one per tilemap, wrapping the above function that does the work. */
4848
49WRITE8_MEMBER(dooyong_state::dooyong_bgscroll8_w)
49WRITE8_MEMBER(dooyong_state::bgscroll_w)
5050{
51   dooyong_scroll8_w(offset, data, m_bgscroll8, m_bg_tilemap);
51   scroll8_w(offset, data, m_bgscroll8, m_bg_tilemap);
5252}
5353
54WRITE8_MEMBER(dooyong_state::dooyong_bg2scroll8_w)
54WRITE8_MEMBER(dooyong_state::bg2scroll_w)
5555{
56   dooyong_scroll8_w(offset, data, m_bg2scroll8, m_bg2_tilemap);
56   scroll8_w(offset, data, m_bg2scroll8, m_bg2_tilemap);
5757}
5858
59WRITE8_MEMBER(dooyong_state::dooyong_fgscroll8_w)
59WRITE8_MEMBER(dooyong_state::fgscroll_w)
6060{
61   dooyong_scroll8_w(offset, data, m_fgscroll8, m_fg_tilemap);
61   scroll8_w(offset, data, m_fgscroll8, m_fg_tilemap);
6262}
6363
64WRITE8_MEMBER(dooyong_state::dooyong_fg2scroll8_w)
64WRITE8_MEMBER(dooyong_state::fg2scroll_w)
6565{
66   dooyong_scroll8_w(offset, data, m_fg2scroll8, m_fg2_tilemap);
66   scroll8_w(offset, data, m_fg2scroll8, m_fg2_tilemap);
6767}
6868
6969
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)
70WRITE8_MEMBER(dooyong_z80_state::txvideoram_w)
7471{
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{
9672   if (m_txvideoram[offset] != data)
9773   {
9874      m_txvideoram[offset] = data;
r241920r241921
10682
10783/* Control registers seem to be different on every game */
10884
109WRITE8_MEMBER(dooyong_state::lastday_ctrl_w)
85WRITE8_MEMBER(dooyong_z80_ym2203_state::lastday_ctrl_w)
11086{
11187   /* bits 0 and 1 are coin counters */
11288   coin_counter_w(machine(), 0, data & 0x01);
r241920r241921
12197   flip_screen_set(data & 0x40);
12298}
12399
124WRITE8_MEMBER(dooyong_state::pollux_ctrl_w)
100WRITE8_MEMBER(dooyong_z80_ym2203_state::pollux_ctrl_w)
125101{
126102   /* bit 0 is flip screen */
127103   flip_screen_set(data & 0x01);
r241920r241921
136112   /* bit 4 is used but unknown */
137113}
138114
139WRITE8_MEMBER(dooyong_state::primella_ctrl_w)
115WRITE8_MEMBER(dooyong_z80_state::primella_ctrl_w)
140116{
141117   /* bits 0-2 select ROM bank */
142118   membank("bank1")->set_entry(data & 0x07);
r241920r241921
152128//  logerror("%04x: bankswitch = %02x\n",space.device().safe_pc(),data&0xe0);
153129}
154130
155WRITE8_MEMBER(dooyong_state::paletteram_flytiger_w)
131WRITE8_MEMBER(dooyong_z80_state::paletteram_flytiger_w)
156132{
157133   if (m_flytiger_palette_bank)
158134   {
r241920r241921
163139   }
164140}
165141
166WRITE8_MEMBER(dooyong_state::flytiger_ctrl_w)
142WRITE8_MEMBER(dooyong_z80_state::flytiger_ctrl_w)
167143{
168144   /* bit 0 is flip screen */
169145   flip_screen_set(data & 0x01);
r241920r241921
177153   m_flytiger_pri = data & 0x10;
178154}
179155
180WRITE16_MEMBER(dooyong_state::rshark_ctrl_w)
181156
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
196157/* These games all have ROM-based tilemaps for the backgrounds, title
197158   screens and sometimes "bosses" and special attacks. There are three
198159   schemes for tilemap encoding.  The scheme is chosen based on the
r241920r241921
203164   when the x scroll moves out of range (trying to decode the whole lot
204165   at once uses hundreds of megabytes of RAM). */
205166
206inline void dooyong_state::lastday_get_tile_info(tile_data &tileinfo, int tile_index,
207      const UINT8 *tilerom, UINT8 *scroll, int graphics)
167inline void dooyong_state::get_tile_info(tile_data &tileinfo, int tile_index,
168      UINT8 const *tilerom, UINT8 const *scroll, int graphics)
208169{
209   int offs = (tile_index + ((int)scroll[1] << 6)) * 2;
210   int attr = tilerom[offs];
170   int const offs = (tile_index + ((int)scroll[1] << 6)) * 2;
171   int const attr = tilerom[offs];
211172   int code, color, flags;
212173   if (scroll[6] & 0x20)
213174   {   /* lastday/gulfstrm/pollux/flytiger */
r241920r241921
221182         Y = y flip */
222183      code = tilerom[offs + 1] | ((attr & 0x01) << 8) | ((attr & 0x80) << 2);
223184      color = (attr & 0x78) >> 3;
224      flags = ((attr & 0x02) ? TILE_FLIPX : 0) | ((attr & 0x04) ? TILE_FLIPY : 0);
185      flags = TILE_FLIPYX((attr & 0x06) >> 1);
225186   }
226187   else
227   {
228      /* primella */
188   {   /* primella/popbingo */
229189      /* Tiles take two bytes in ROM:
230190                       MSB   LSB
231191         [offs + 0x00] YXCC CCcc    (Y flip, X flip, bits 3-0 of color code, bits 9-8 of gfx code)
r241920r241921
245205
246206      code = tilerom[offs + 1] | ((attr & codemask) << 8);
247207      color = (attr & palmask) >> 2;
248      flags = ((attr & 0x40) ? TILE_FLIPX : 0) | ((attr & 0x80) ? TILE_FLIPY : 0);
208      flags = TILE_FLIPYX((attr & 0xC0) >> 6);
249209   }
250210
251   SET_TILE_INFO_MEMBER(graphics, code, color, flags);
211   tileinfo.set(graphics, code, color, flags);
252212}
253213
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
274214TILE_GET_INFO_MEMBER(dooyong_state::get_bg_tile_info)
275215{
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);
216   get_tile_info(tileinfo, tile_index, m_bg_tilerom, m_bgscroll8, m_bg_gfx);
280217}
281218
282219TILE_GET_INFO_MEMBER(dooyong_state::get_bg2_tile_info)
283220{
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);
221   get_tile_info(tileinfo, tile_index, m_bg2_tilerom, m_bg2scroll8, m_bg2_gfx);
288222}
289223
290224TILE_GET_INFO_MEMBER(dooyong_state::get_fg_tile_info)
291225{
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);
226   get_tile_info(tileinfo, tile_index, m_fg_tilerom, m_fgscroll8, m_fg_gfx);
296227}
297228
298229TILE_GET_INFO_MEMBER(dooyong_state::get_fg2_tile_info)
299230{
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);
231   get_tile_info(tileinfo, tile_index, m_fg2_tilerom, m_fg2scroll8, m_fg2_gfx);
304232}
305233
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)
234TILE_GET_INFO_MEMBER(dooyong_z80_state::get_tx_tile_info)
309235{
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{
323236   /* Each tile takes two bytes of memory:
324237                    MSB   LSB
325238      [offs + 0x00] cccc cccc    (bits 7-0 of gfx code)
326239      [offs + 0x01] CCCC cccc    (bits 3-0 of color code, bits 11-8 of gfx code)
327240      c = gfx code
328241      C = color code */
329   int offs, attr, code, color;
242   unsigned offs, attr;
330243   if (m_tx_tilemap_mode == 0)
331244   {   /* lastday/gulfstrm/pollux/flytiger */
332245      offs = tile_index;
r241920r241921
337250      offs = tile_index * 2;
338251      attr = m_txvideoram[offs + 1];
339252   }
340   code = m_txvideoram[offs] | ((attr & 0x0f) << 8);
341   color = (attr & 0xf0) >> 4;
253   int const code = m_txvideoram[offs] | ((attr & 0x0f) << 8);
254   int const color = (attr & 0xf0) >> 4;
342255
343   SET_TILE_INFO_MEMBER(0, code, color, 0);
256   tileinfo.set(0, code, color, 0);
344257}
345258
346259
347void dooyong_state::draw_sprites(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect, int pollux_extensions)
260void dooyong_z80_state::draw_sprites(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect, unsigned extensions)
348261{
349262   /* Sprites take 32 bytes each in memory:
350263                    MSB   LSB
r241920r241921
364277      w = width
365278      X = x flip
366279      Y = y flip
367      * = alters y position in pollux and flytiger - see code below
280      * = alters y position in bluehawk and flytiger - see code below
368281      bit 11 of gfx code only used by gulfstrm, pollux, bluehawk and flytiger
369282      height only used by pollux, bluehawk and flytiger
370283      x flip and y flip only used by pollux and flytiger */
371284
372   UINT8 *buffered_spriteram = m_spriteram->buffer();
373   int offs;
374
375   for (offs = 0; offs < m_spriteram->bytes(); offs += 32)
285   UINT8 const *const buffered_spriteram = m_spriteram->buffer();
286   for (int offs = 0; offs < m_spriteram->bytes(); offs += 32)
376287   {
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;
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;
384292      //TODO: This priority mechanism works for known games, but seems a bit strange.
385293      //Are we missing something?  (The obvious spare palette bit isn't it.)
386      pri = (((color == 0x00) || (color == 0x0f)) ? 0xfc : 0xf0);
294      int const pri = (((color == 0x00) || (color == 0x0f)) ? 0xfc : 0xf0);
387295
388      if (pollux_extensions)
296      bool flipx = false, flipy = false;
297      int height = 0;
298      if (extensions)
389299      {
390         /* gulfstrm, pollux, bluehawk, flytiger */
391         code |= ((buffered_spriteram[offs+0x1c] & 0x01) << 11);
300         UINT8 const ext = buffered_spriteram[offs+0x1c];
392301
393         if (pollux_extensions >= 2)
302         if (extensions & SPRITE_12BIT)
303            code |= ((ext & 0x01) << 11);
304
305         if (extensions & SPRITE_HEIGHT)
394306         {
395            /* pollux, bluehawk, flytiger */
396            height = (buffered_spriteram[offs+0x1c] & 0x70) >> 4;
307            height = (ext & 0x70) >> 4;
397308            code &= ~height;
398309
399            flipx = buffered_spriteram[offs+0x1c] & 0x08;
400            flipy = buffered_spriteram[offs+0x1c] & 0x04;
310            flipx = ext & 0x08;
311            flipy = ext & 0x04;
312         }
401313
402            if (pollux_extensions == 3)
403            {
404               /* bluehawk */
405               sy += 6 - ((~buffered_spriteram[offs+0x1c] & 0x02) << 7);
406            }
314         if (extensions & SPRITE_YSHIFT_BLUEHAWK)
315            sy += 6 - ((~ext & 0x02) << 7);
407316
408            if (pollux_extensions == 4)
409            {
410               /* flytiger */
411               sy -=(buffered_spriteram[offs+0x1c] & 0x02) << 7;
412            }
413         }
317         if (extensions & SPRITE_YSHIFT_FLYTIGER)
318            sy -=(ext & 0x02) << 7;
414319      }
415320
416321      if (flip_screen())
r241920r241921
421326         flipy = !flipy;
422327      }
423328
424      for (y = 0; y <= height; y++)
329      for (int y = 0; y <= height; y++)
425330      {
426331         m_gfxdecode->gfx(1)->prio_transpen(bitmap,cliprect,
427332               code + y,
r241920r241921
434339   }
435340}
436341
437void dooyong_state::rshark_draw_sprites(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect)
438{
439   UINT16 *buffered_spriteram16 = m_spriteram16->buffer();
440342
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)
343UINT32 dooyong_z80_ym2203_state::screen_update_lastday(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect)
510344{
511345   bitmap.fill(m_palette->black_pen(), cliprect);
512346   screen.priority().fill(0, cliprect);
r241920r241921
516350   m_tx_tilemap->draw(screen, bitmap, cliprect, 0, 4);
517351
518352   if (!m_sprites_disabled)
519      draw_sprites(screen, bitmap, cliprect, 0);
353      draw_sprites(screen, bitmap, cliprect);
354
520355   return 0;
521356}
522357
523UINT32 dooyong_state::screen_update_gulfstrm(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect)
358UINT32 dooyong_z80_ym2203_state::screen_update_gulfstrm(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect)
524359{
525360   bitmap.fill(m_palette->black_pen(), cliprect);
526361   screen.priority().fill(0, cliprect);
r241920r241921
529364   m_fg_tilemap->draw(screen, bitmap, cliprect, 0, 2);
530365   m_tx_tilemap->draw(screen, bitmap, cliprect, 0, 4);
531366
532   draw_sprites(screen, bitmap, cliprect, 1);
367   draw_sprites(screen, bitmap, cliprect, SPRITE_12BIT);
368
533369   return 0;
534370}
535371
536UINT32 dooyong_state::screen_update_pollux(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect)
372UINT32 dooyong_z80_ym2203_state::screen_update_pollux(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect)
537373{
538374   bitmap.fill(m_palette->black_pen(), cliprect);
539375   screen.priority().fill(0, cliprect);
r241920r241921
542378   m_fg_tilemap->draw(screen, bitmap, cliprect, 0, 2);
543379   m_tx_tilemap->draw(screen, bitmap, cliprect, 0, 4);
544380
545   draw_sprites(screen, bitmap, cliprect, 2);
381   draw_sprites(screen, bitmap, cliprect, SPRITE_12BIT | SPRITE_HEIGHT);
382
546383   return 0;
547384}
548385
549UINT32 dooyong_state::screen_update_flytiger(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect)
386UINT32 dooyong_z80_state::screen_update_flytiger(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect)
550387{
551388   bitmap.fill(m_palette->black_pen(), cliprect);
552389   screen.priority().fill(0, cliprect);
r241920r241921
563400   }
564401   m_tx_tilemap->draw(screen, bitmap, cliprect, 0, 4);
565402
566   draw_sprites(screen, bitmap, cliprect, 4);
403   draw_sprites(screen, bitmap, cliprect, SPRITE_12BIT | SPRITE_HEIGHT | SPRITE_YSHIFT_FLYTIGER);
404
567405   return 0;
568406}
569407
570408
571UINT32 dooyong_state::screen_update_bluehawk(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect)
409UINT32 dooyong_z80_state::screen_update_bluehawk(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect)
572410{
573411   bitmap.fill(m_palette->black_pen(), cliprect);
574412   screen.priority().fill(0, cliprect);
r241920r241921
578416   m_fg2_tilemap->draw(screen, bitmap, cliprect, 0, 4);
579417   m_tx_tilemap->draw(screen, bitmap, cliprect, 0, 4);
580418
581   draw_sprites(screen, bitmap, cliprect, 3);
419   draw_sprites(screen, bitmap, cliprect, SPRITE_12BIT | SPRITE_HEIGHT | SPRITE_YSHIFT_BLUEHAWK);
420
582421   return 0;
583422}
584423
585UINT32 dooyong_state::screen_update_primella(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect)
424UINT32 dooyong_z80_state::screen_update_primella(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect)
586425{
587426   bitmap.fill(m_palette->black_pen(), cliprect);
588427
r241920r241921
590429   if (m_tx_pri) m_tx_tilemap->draw(screen, bitmap, cliprect, 0, 0);
591430   m_fg_tilemap->draw(screen, bitmap, cliprect, 0, 0);
592431   if (!m_tx_pri) m_tx_tilemap->draw(screen, bitmap, cliprect, 0, 0);
593   return 0;
594}
595432
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);
607433   return 0;
608434}
609435
610UINT32 dooyong_state::screen_update_popbingo(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect)
436VIDEO_START_MEMBER(dooyong_z80_ym2203_state, lastday)
611437{
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{
624438   /* Configure tilemap callbacks */
625439   m_bg_tilerom = memregion("gfx5")->base();
626440   m_fg_tilerom = memregion("gfx6")->base();
627   m_bg_tilerom2 = NULL;
628   m_fg_tilerom2 = NULL;
629441   m_bg_gfx = 2;
630442   m_fg_gfx = 3;
631443   m_tx_tilemap_mode = 0;
r241920r241921
635447         32, 32, 32, 8);
636448   m_fg_tilemap = &machine().tilemap().create(m_gfxdecode, tilemap_get_info_delegate(FUNC(dooyong_state::get_fg_tile_info),this), TILEMAP_SCAN_COLS,
637449         32, 32, 32, 8);
638   m_tx_tilemap = &machine().tilemap().create(m_gfxdecode, tilemap_get_info_delegate(FUNC(dooyong_state::get_tx_tile_info),this), TILEMAP_SCAN_COLS,
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,
639451         8, 8, 64, 32);
640452
641453   /* Configure tilemap transparency */
r241920r241921
658470   save_item(NAME(m_interrupt_line_2));
659471}
660472
661VIDEO_START_MEMBER(dooyong_state,gulfstrm)
473VIDEO_START_MEMBER(dooyong_z80_ym2203_state, gulfstrm)
662474{
663475   /* Configure tilemap callbacks */
664476   m_bg_tilerom = memregion("gfx5")->base();
665477   m_fg_tilerom = memregion("gfx6")->base();
666   m_bg_tilerom2 = NULL;
667   m_fg_tilerom2 = NULL;
668478   m_bg_gfx = 2;
669479   m_fg_gfx = 3;
670480   m_tx_tilemap_mode = 0;
r241920r241921
674484         32, 32, 32, 8);
675485   m_fg_tilemap = &machine().tilemap().create(m_gfxdecode, tilemap_get_info_delegate(FUNC(dooyong_state::get_fg_tile_info),this), TILEMAP_SCAN_COLS,
676486         32, 32, 32, 8);
677   m_tx_tilemap = &machine().tilemap().create(m_gfxdecode, tilemap_get_info_delegate(FUNC(dooyong_state::get_tx_tile_info),this), TILEMAP_SCAN_COLS,
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,
678488         8, 8, 64, 32);
679489
680490   /* Configure tilemap transparency */
r241920r241921
696506   save_item(NAME(m_interrupt_line_2));
697507}
698508
699VIDEO_START_MEMBER(dooyong_state,pollux)
509VIDEO_START_MEMBER(dooyong_z80_ym2203_state, pollux)
700510{
701511   /* Configure tilemap callbacks */
702512   m_bg_tilerom = memregion("gfx5")->base();
703513   m_fg_tilerom = memregion("gfx6")->base();
704   m_bg_tilerom2 = NULL;
705   m_fg_tilerom2 = NULL;
706514   m_bg_gfx = 2;
707515   m_fg_gfx = 3;
708516   m_tx_tilemap_mode = 0;
r241920r241921
712520         32, 32, 32, 8);
713521   m_fg_tilemap = &machine().tilemap().create(m_gfxdecode, tilemap_get_info_delegate(FUNC(dooyong_state::get_fg_tile_info),this), TILEMAP_SCAN_COLS,
714522         32, 32, 32, 8);
715   m_tx_tilemap = &machine().tilemap().create(m_gfxdecode, tilemap_get_info_delegate(FUNC(dooyong_state::get_tx_tile_info),this), TILEMAP_SCAN_COLS,
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,
716524         8, 8, 64, 32);
717525
718526   /* Configure tilemap transparency */
r241920r241921
731539   save_item(NAME(m_interrupt_line_2));
732540}
733541
734VIDEO_START_MEMBER(dooyong_state,bluehawk)
542VIDEO_START_MEMBER(dooyong_z80_state, bluehawk)
735543{
736544   /* Configure tilemap callbacks */
737545   m_bg_tilerom = memregion("gfx3")->base() + 0x78000;
738546   m_fg_tilerom = memregion("gfx4")->base() + 0x78000;
739547   m_fg2_tilerom = memregion("gfx5")->base() + 0x38000;
740   m_bg_tilerom2 = NULL;
741   m_fg_tilerom2 = NULL;
742   m_fg2_tilerom2 = NULL;
743548   m_bg_gfx = 2;
744549   m_fg_gfx = 3;
745550   m_fg2_gfx = 4;
r241920r241921
752557         32, 32, 32, 8);
753558   m_fg2_tilemap = &machine().tilemap().create(m_gfxdecode, tilemap_get_info_delegate(FUNC(dooyong_state::get_fg2_tile_info),this), TILEMAP_SCAN_COLS,
754559         32, 32, 32, 8);
755   m_tx_tilemap = &machine().tilemap().create(m_gfxdecode, tilemap_get_info_delegate(FUNC(dooyong_state::get_tx_tile_info),this), TILEMAP_SCAN_COLS,
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,
756561         8, 8, 64, 32);
757562
758563   /* Configure tilemap transparency */
r241920r241921
771576   save_item(NAME(m_fg2scroll8));
772577}
773578
774VIDEO_START_MEMBER(dooyong_state,flytiger)
579VIDEO_START_MEMBER(dooyong_z80_state, flytiger)
775580{
776581   /* Configure tilemap callbacks */
777582   m_bg_tilerom = memregion("gfx3")->base() + 0x78000;
778583   m_fg_tilerom = memregion("gfx4")->base() + 0x78000;
779   m_bg_tilerom2 = NULL;
780   m_fg_tilerom2 = NULL;
781584   m_bg_gfx = 2;
782585   m_fg_gfx = 3;
783586   m_tx_tilemap_mode = 0;
r241920r241921
785588   /* Create tilemaps */
786589   m_bg_tilemap = &machine().tilemap().create(m_gfxdecode, tilemap_get_info_delegate(FUNC(dooyong_state::get_bg_tile_info),this), TILEMAP_SCAN_COLS,
787590         32, 32, 32, 8);
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,
591   m_fg_tilemap = &machine().tilemap().create(m_gfxdecode, tilemap_get_info_delegate(FUNC(dooyong_state::get_fg_tile_info),this), TILEMAP_SCAN_COLS,
789592         32, 32, 32, 8);
790   m_tx_tilemap = &machine().tilemap().create(m_gfxdecode, tilemap_get_info_delegate(FUNC(dooyong_state::get_tx_tile_info),this), TILEMAP_SCAN_COLS,
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,
791594         8, 8, 64, 32);
792595
793596   /* Configure tilemap transparency */
r241920r241921
806609   save_item(NAME(m_flytiger_pri));
807610}
808611
809VIDEO_START_MEMBER(dooyong_state,primella)
612VIDEO_START_MEMBER(dooyong_z80_state, primella)
810613{
811614   /* Configure tilemap callbacks */
812615   m_bg_tilerom = memregion("gfx2")->base() + memregion("gfx2")->bytes() - 0x8000;
813616   m_fg_tilerom = memregion("gfx3")->base() + memregion("gfx3")->bytes() - 0x8000;
814   m_bg_tilerom2 = NULL;
815   m_fg_tilerom2 = NULL;
816617   m_bg_gfx = 1;
817618   m_fg_gfx = 2;
818619   m_tx_tilemap_mode = 1;
r241920r241921
822623         32, 32, 32, 8);
823624   m_fg_tilemap = &machine().tilemap().create(m_gfxdecode, tilemap_get_info_delegate(FUNC(dooyong_state::get_fg_tile_info),this), TILEMAP_SCAN_COLS,
824625         32, 32, 32, 8);
825   m_tx_tilemap = &machine().tilemap().create(m_gfxdecode, tilemap_get_info_delegate(FUNC(dooyong_state::get_tx_tile_info),this), TILEMAP_SCAN_COLS,
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,
826627         8, 8, 64, 32);
827628
828629   /* Configure tilemap transparency */
r241920r241921
840641   save_item(NAME(m_tx_pri));
841642}
842643
843VIDEO_START_MEMBER(dooyong_state,rshark)
644
645WRITE16_MEMBER(dooyong_68k_state::ctrl_w)
844646{
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{
845795   /* Configure tilemap callbacks */
846796   m_bg_tilerom = memregion("gfx5")->base();
847797   m_bg2_tilerom = memregion("gfx4")->base();
r241920r241921
857807   m_fg2_gfx = 1;
858808
859809   /* Create tilemaps */
860   m_bg_tilemap = &machine().tilemap().create(m_gfxdecode, tilemap_get_info_delegate(FUNC(dooyong_state::get_bg_tile_info),this), TILEMAP_SCAN_COLS,
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,
861811         16, 16, 64, 32);
862   m_bg2_tilemap = &machine().tilemap().create(m_gfxdecode, tilemap_get_info_delegate(FUNC(dooyong_state::get_bg2_tile_info),this), TILEMAP_SCAN_COLS,
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,
863813         16, 16, 64, 32);
864   m_fg_tilemap = &machine().tilemap().create(m_gfxdecode, tilemap_get_info_delegate(FUNC(dooyong_state::get_fg_tile_info),this), TILEMAP_SCAN_COLS,
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,
865815         16, 16, 64, 32);
866   m_fg2_tilemap = &machine().tilemap().create(m_gfxdecode, tilemap_get_info_delegate(FUNC(dooyong_state::get_fg2_tile_info),this), TILEMAP_SCAN_COLS,
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,
867817         16, 16, 64, 32);
868818
869819   /* Configure tilemap transparency */
r241920r241921
881831   save_item(NAME(m_bg2scroll8));
882832   save_item(NAME(m_fgscroll8));
883833   save_item(NAME(m_fg2scroll8));
884   save_item(NAME(m_rshark_pri));
834   save_item(NAME(m_bg2_priority));
885835}
886836
887VIDEO_START_MEMBER(dooyong_state,popbingo)
837VIDEO_START_MEMBER(dooyong_68k_state, popbingo)
888838{
889839   /* Configure tilemap callbacks */
890840   m_bg_tilerom = memregion("gfx2")->base();
r241920r241921
905855   save_item(NAME(m_bg2scroll8));  // Not used atm
906856   save_item(NAME(m_fgscroll8));   // Not used atm
907857   save_item(NAME(m_fg2scroll8));  // Not used atm
908   save_item(NAME(m_rshark_pri));
858   save_item(NAME(m_bg2_priority));
909859}
trunk/src/mame/video/prehisle.c
r241920r241921
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}
r241920r241921
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*/
5763TILE_GET_INFO_MEMBER(prehisle_state::get_bg2_tile_info)
5864{
59   UINT8 *tilerom = memregion("gfx5")->base();
65   UINT8 const *const tilerom = memregion("gfx5")->base();
6066
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;
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;
6672
6773   SET_TILE_INFO_MEMBER(1, code, color, flags);
6874}
6975
76/* tile layout
770  xxxx.... ........  color
780  ....x... ........  flip y
790  .....xxx xxxxxxxx  gfx code
80*/
7081TILE_GET_INFO_MEMBER(prehisle_state::get_bg_tile_info)
7182{
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;
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;
7687
7788   SET_TILE_INFO_MEMBER(2, code, color, flags);
7889}
7990
91/* tile layout
920  xxxx.... ........  color
930  ....xxxx xxxxxxxx  gfx code
94*/
8095TILE_GET_INFO_MEMBER(prehisle_state::get_fg_tile_info)
8196{
82   int attr = m_videoram[tile_index];
83   int code = attr & 0xfff;
84   int color = attr >> 12;
97   int const attr = m_videoram[tile_index];
98   int const code = attr & 0xfff;
99   int const color = attr >> 12;
85100
86101   SET_TILE_INFO_MEMBER(0, code, color, 0);
87102}
88103
89104void prehisle_state::video_start()
90105{
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);
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
93113
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);
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);
96122
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);
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
101130   m_fg_tilemap->set_transparent_pen(15);
102131
103132   /* register for saving */
r241920r241921
105134}
106135
107136/* sprite layout
108o fedcba9876543210
109137
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
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
119145*/
120void prehisle_state::draw_sprites(bitmap_ind16 &bitmap, const rectangle &cliprect, int foreground )
146void prehisle_state::draw_sprites(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect)
121147{
122   UINT16 *spriteram16 = m_spriteram;
123   int offs;
148   UINT16 const *const spriteram16 = m_spriteram;
124149
125   for (offs = 0; offs < 1024; offs += 4)
150   for (int offs = 0; offs < 1024; offs += 4)
126151   {
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;
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;
135160
136161      // coordinates are 9-bit signed
137      if (sx&0x100) sx=-0x100+(sx&0xff);
138      if (sy&0x100) sy=-0x100+(sy&0xff);
162      if (sx & 0x100) sx = -0x100 + (sx & 0xff);
163      if (sy & 0x100) sy = -0x100 + (sy & 0xff);
139164
140165      if (flip_screen())
141166      {
r241920r241921
145170         flipy = !flipy;
146171      }
147172
148      if ((foreground && priority) || (!foreground && !priority))
149      {
150         m_gfxdecode->gfx(3)->transpen(bitmap,cliprect, code, color, flipx, flipy, sx, sy, 15);
151      }
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
152180   }
153181}
154182
155183UINT32 prehisle_state::screen_update_prehisle(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect)
156184{
185   screen.priority().fill(0, cliprect);
186
157187   m_bg2_tilemap->draw(screen, bitmap, cliprect, 0, 0);
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);
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
162192   return 0;
163193}
trunk/src/mess/drivers/mc1502.c
r241920r241921
254254   MCFG_MACHINE_RESET_OVERRIDE( mc1502_state, mc1502 )
255255
256256   MCFG_DEVICE_ADD("pit8253", PIT8253, 0)
257   MCFG_PIT8253_CLK0(XTAL_15MHz/12) /* heartbeat IRQ */
257   MCFG_PIT8253_CLK0(XTAL_16MHz/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))
r241920r241921
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)
299301   MCFG_ISA8_SLOT_ADD("isa", "isa1", mc1502_isa8_cards, "fdc", false)
300302   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 */
305304   MCFG_SPEAKER_STANDARD_MONO("mono")
306305   MCFG_SOUND_WAVE_ADD(WAVE_TAG, "cassette")
307306   MCFG_SOUND_ADD("speaker", SPEAKER_SOUND, 0)
r241920r241921
323322   MCFG_SOFTWARE_LIST_ADD("flop_list","mc1502_flop")
324323//  MCFG_SOFTWARE_LIST_ADD("cass_list","mc1502_cass")
325324
326   /* internal ram */
327325   MCFG_RAM_ADD(RAM_TAG)
328326   MCFG_RAM_DEFAULT_SIZE("608K")                   /* 96 base + 512 on expansion card */
329327   MCFG_RAM_EXTRA_OPTIONS("96K")


Previous 199869 Revisions Next


© 1997-2024 The MAME Team