trunk/src/emu/tilemap.h
| r241919 | r241920 | |
| 36 | 36 | |
| 37 | 37 | category (optional): specifies one of 16 categories for the |
| 38 | 38 | pixels in the tile; the category controls which tiles are |
| 39 | | rendered during a tilemap::draw() call |
| 39 | rendered during a tilemap_draw() call |
| 40 | 40 | |
| 41 | 41 | group (optional): specifies one of 256 groups for pen mapping; |
| 42 | 42 | each pen in the tile is looked up in a table to determine |
| r241919 | r241920 | |
| 81 | 81 | all tiles rendered. |
| 82 | 82 | |
| 83 | 83 | Flagsmap = an 8bpp bitmap containing per-pixel flags, |
| 84 | | specifically the category (specified in bits 0-3) and the |
| 85 | | layer (specified in bits 4-6). |
| 84 | specifically the category (specified in bits 0-3) and |
| 85 | the layer (specified in bits 4-6). |
| 86 | 86 | |
| 87 | 87 | **************************************************************************** |
| 88 | 88 | |
| 89 | 89 | How to use a tilemap: |
| 90 | 90 | |
| 91 | | 1. First create a new tilemap by calling tilemap_manager::create(). |
| 92 | | The parameters are as follows: |
| 91 | 1. First create a new tilemap by calling tilemap_create(). The |
| 92 | parameters are as follows: |
| 93 | 93 | |
| 94 | | decoder = reference to your device_gfx_interface |
| 94 | tile_get_info = pointer to a callback function which accepts a |
| 95 | memory index and in return fills in a tile_info structure |
| 96 | that describes the characteristics of a tile; this function |
| 97 | will be called whenever a dirty tile needs to be rendered |
| 95 | 98 | |
| 96 | | tile_get_info = callback function which accepts a memory index |
| 97 | | and in return fills in a tile_data structure that describes |
| 98 | | the characteristics of a tile; this function will be called |
| 99 | | whenever a dirty tile needs to be rendered |
| 99 | mapper = pointer to a callback function which maps the logical |
| 100 | column and row to a memory index; several standard mappers |
| 101 | are provided, with tilemap_scan_rows being the most common |
| 100 | 102 | |
| 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 | | |
| 105 | 103 | tilewidth = the width, in pixels, of each individual tile |
| 106 | 104 | |
| 107 | 105 | tileheight = the height, in pixels, of each individual tile |
| r241919 | r241920 | |
| 114 | 112 | Common configuration tasks include: |
| 115 | 113 | |
| 116 | 114 | * marking one of the pens as transparent via |
| 117 | | tilemap_t::set_transparent_pen() |
| 115 | tilemap_set_transparent_pen() |
| 118 | 116 | |
| 119 | 117 | * performing more complex pen-to-layer mapping via |
| 120 | | tilemap_t::map_pen_to_layer() or |
| 121 | | tilemap_t::map_pens_to_layer() |
| 118 | tilemap_map_pen_to_layer() or |
| 119 | tilemap_map_pens_to_layer() |
| 122 | 120 | |
| 123 | 121 | * configuring global scroll offsets via |
| 124 | | tilemap_t::set_scrolldx() and tilemap_t::set_scrolldy() |
| 122 | tilemap_set_scrolldx() and tilemap_set_scrolldy() |
| 125 | 123 | |
| 126 | | * specifying a pointer that can be read back later (e.g. in |
| 127 | | your tile_get_info callback) via |
| 128 | | tilemap_t::set_user_data() |
| 124 | * specifying a pointer that is passed to your tile_get_info |
| 125 | callback via tilemap_set_user_data() |
| 129 | 126 | |
| 130 | 127 | * setting a global palette offset via |
| 131 | | tilemap_t::set_palette_offset() |
| 128 | tilemap_set_palette_offset() |
| 132 | 129 | |
| 133 | 130 | 3. In your memory write handlers for the tile memory, anytime tile |
| 134 | 131 | data is modified, you need to mark the tile dirty so that it is |
| 135 | 132 | re-rendered with the new data the next time the tilemap is drawn. |
| 136 | | Use tilemap_t::mark_tile_dirty() and pass in the memory index. |
| 133 | Use tilemap_mark_tile_dirty() and pass in the memory index. |
| 137 | 134 | |
| 138 | 135 | 4. In your handlers for scrolling, update the scroll values for the |
| 139 | | tilemap via tilemap_t::set_scrollx() and tilemap_t::set_scrolly(). |
| 136 | tilemap via tilemap_set_scrollx() and tilemap_set_scrolly(). |
| 140 | 137 | |
| 141 | 138 | 5. If any other major characteristics of the tilemap change (generally |
| 142 | 139 | any global state that is used by the tile_get_info callback but |
| 143 | 140 | which is not reported via other calls to the tilemap code), you |
| 144 | 141 | should invalidate the entire tilemap. You can do this by calling |
| 145 | | tilemap_t::mark_all_dirty(). |
| 142 | tilemap_mark_all_tiles_dirty(). |
| 146 | 143 | |
| 147 | 144 | 6. In your VIDEO_UPDATE callback, render the tiles by calling |
| 148 | | tilemap_t::draw() or tilemap_t::draw_roz(). If you need to do |
| 149 | | custom rendering and want access to the raw pixels, call |
| 150 | | tilemap_t::pixmap() to get a reference to the updated bitmap_ind16 |
| 145 | tilemap_draw() or tilemap_draw_roz(). If you need to do custom |
| 146 | rendering and want access to the raw pixels, call |
| 147 | tilemap_get_pixmap() to get a pointer to the updated bitmap_ind16 |
| 151 | 148 | containing the tilemap graphics. |
| 152 | 149 | |
| 153 | 150 | **************************************************************************** |
| r241919 | r241920 | |
| 160 | 157 | |
| 161 | 158 | tilemap_t *tmap; |
| 162 | 159 | UINT16 *my_tmap_memory; |
| 163 | | required_device<gfxdecode_device> gfxdecode; |
| 164 | 160 | |
| 165 | | TILE_GET_INFO_MEMBER( my_state::my_get_info ) |
| 161 | TILE_GET_INFO( my_get_info ) |
| 166 | 162 | { |
| 167 | | UINT16 tiledata = my_tmap_memory[tile_index]; |
| 163 | UINT8 tiledata = my_tmap_memory[tile_index]; |
| 168 | 164 | UINT8 code = tiledata & 0xff; |
| 169 | 165 | UINT8 color = (tiledata >> 8) & 0x1f; |
| 170 | 166 | UINT8 flipx = (tiledata >> 13) & 1; |
| r241919 | r241920 | |
| 172 | 168 | UINT8 category = (tiledata >> 15) & 1; |
| 173 | 169 | |
| 174 | 170 | // set the common info for the tile |
| 175 | | tileinfo.set( |
| 176 | | 1, // use gfxdecode->gfx(1) for tile graphics |
| 171 | SET_TILE_INFO( |
| 172 | 1, // use m_gfxdecode->gfx(1) for tile graphics |
| 177 | 173 | code, // the index of the graphics for this tile |
| 178 | 174 | color, // the color to use for this tile |
| 179 | 175 | (flipx ? TILE_FLIPX : 0) | // flags for this tile; also |
| 180 | | (flipy ? TILE_FLIPY : 0) // see the FLIP_YX macro |
| 176 | (flipy ? TILE_FLIPY : 0); // see the FLIP_YX macro |
| 181 | 177 | ); |
| 182 | 178 | |
| 183 | 179 | // set the category of each tile based on the high bit; this |
| r241919 | r241920 | |
| 185 | 181 | tileinfo.category = category; |
| 186 | 182 | } |
| 187 | 183 | |
| 188 | | VIDEO_START_MEMBER( my_state, my_driver ) |
| 184 | VIDEO_START( mydriver ) |
| 189 | 185 | { |
| 190 | 186 | // first create the tilemap |
| 191 | | tmap = &machine().tilemap().create( |
| 192 | | gfxdecode, |
| 193 | | tilemap_get_info_delegate(FUNC(my_state::my_get_info), this), |
| 194 | | TILEMAP_SCAN_ROWS, // standard row-major mapper |
| 187 | tmap = tilemap_create(machine, |
| 188 | my_get_info, // pointer to your get_info |
| 189 | tilemap_scan_rows, // standard row-major mapper |
| 195 | 190 | 8,8, // 8x8 tiles |
| 196 | 191 | 64,32); // 64 columns, 32 rows |
| 197 | 192 | |
| 198 | 193 | // then set the transparent pen; all other pens will default |
| 199 | 194 | // to being part of layer 0 |
| 200 | | tmap.set_transparent_pen(0); |
| 195 | tilemap_set_transparent_pen(tmap, 0); |
| 201 | 196 | } |
| 202 | 197 | |
| 203 | | UINT32 my_state::screen_update_mydriver( |
| 204 | | screen_device &screen, |
| 205 | | bitmap_ind16 &bitmap, |
| 206 | | const rectangle &cliprect) |
| 198 | SCREEN_UPDATE( mydriver ) |
| 207 | 199 | { |
| 208 | 200 | // draw the tilemap first, fully opaque since it needs to |
| 209 | 201 | // erase all previous pixels |
| 210 | | tmap->draw( |
| 211 | | screen, // destination screen |
| 202 | tilemap_draw( |
| 212 | 203 | bitmap, // destination bitmap |
| 213 | 204 | cliprect, // clipping rectangle |
| 214 | | TILEMAP_DRAW_OPAQUE); // flags |
| 205 | tmap, // tilemap to draw |
| 206 | TILEMAP_DRAW_OPAQUE, // flags |
| 207 | 0); // don't use priority_bitmap |
| 215 | 208 | |
| 216 | 209 | // next draw the sprites |
| 217 | 210 | my_draw_sprites(); |
| 218 | 211 | |
| 219 | 212 | // then draw the tiles which have priority over sprites |
| 220 | | tmap->draw( |
| 221 | | screen, // destination screen |
| 213 | tilemap_draw( |
| 222 | 214 | bitmap, // destination bitmap |
| 223 | 215 | cliprect, // clipping rectangle |
| 224 | | TILEMAP_DRAW_CATEGORY(1));// flags: draw category 1 |
| 216 | tmap, // tilemap to draw |
| 217 | TILEMAP_DRAW_CATEGORY(1),// flags: draw category 1 |
| 218 | 0); // don't use priority_bitmap |
| 225 | 219 | |
| 226 | 220 | return 0; |
| 227 | 221 | } |
| r241919 | r241920 | |
| 243 | 237 | |
| 244 | 238 | TILEMAP_TRANSPARENT: This described a tilemap with a single |
| 245 | 239 | transparent pen. To create the same effect, call |
| 246 | | tilemap_t::set_transparent_pen() to specify which pen is |
| 240 | tilemap_set_transparent_pen() to specify which pen is |
| 247 | 241 | transparent; all other pens will map to layer 0. |
| 248 | 242 | |
| 249 | 243 | TILEMAP_BITMASK: This type is no longer special; with the new |
| r241919 | r241920 | |
| 256 | 250 | also allowed for you to choose one of 4 mappings on a per-tile |
| 257 | 251 | basis. All of this functionality is now expanded: you can |
| 258 | 252 | specify one of 3 layers and can choose from one of 256 mappings |
| 259 | | on a per-tile basis. You just call tilemap_t::set_transmask(), |
| 253 | on a per-tile basis. You just call tilemap_set_transmask(), |
| 260 | 254 | which still exists but maps onto the new behavior. The "front" |
| 261 | 255 | layer is now "layer 0" and the "back" layer is now "layer 1". |
| 262 | 256 | |
| r241919 | r241920 | |
| 281 | 275 | TILEMAP_DRAW_LAYER0 is assumed. |
| 282 | 276 | |
| 283 | 277 | * If you want to render with alpha blending, you can call |
| 284 | | tilemap_t::draw() with the TILEMAP_DRAW_ALPHA flag. |
| 278 | tilemap_draw() with the TILEMAP_DRAW_ALPHA flag. |
| 285 | 279 | |
| 286 | 280 | * To configure more complex pen-to-layer mapping, use the |
| 287 | | tilemap_t::map_pens_to_layer() call. This call takes a group |
| 288 | | number so that you can configure 1 of the 256 groups |
| 289 | | independently. It also takes a pen and a mask; the mapping is |
| 290 | | updated for all pens where ((pennum & mask) == pen). To set all |
| 291 | | the pens in a group to the same value, pass a mask of 0. To set |
| 292 | | a single pen in a group, pass a mask of ~0. The helper function |
| 293 | | tilemap_t::map_pen_to_layer() does this for you. |
| 281 | tilemap_map_pens_to_layer() call. This call takes a group number |
| 282 | so that you can configure 1 of the 256 groups independently. |
| 283 | It also takes a pen and a mask; the mapping is updated for all |
| 284 | pens where ((pennum & mask) == pen). To set all the pens in a |
| 285 | group to the same value, pass a mask of 0. To set a single pen in |
| 286 | a group, pass a mask of ~0. The helper function |
| 287 | tilemap_map_pen_to_layer() does this for you. |
| 294 | 288 | |
| 295 | 289 | ***************************************************************************/ |
| 296 | 290 | |
| r241919 | r241920 | |
| 312 | 306 | #define TILEMAP_NUM_GROUPS 256 |
| 313 | 307 | |
| 314 | 308 | |
| 315 | | // these flags control tilemap_t::draw() behavior |
| 309 | // these flags control tilemap_draw() behavior |
| 316 | 310 | const UINT32 TILEMAP_DRAW_CATEGORY_MASK = 0x0f; // specify the category to draw |
| 317 | 311 | const UINT32 TILEMAP_DRAW_LAYER0 = 0x10; // draw layer 0 |
| 318 | 312 | const UINT32 TILEMAP_DRAW_LAYER1 = 0x20; // draw layer 1 |
| r241919 | r241920 | |
| 335 | 329 | const UINT8 TILE_FORCE_LAYER1 = TILEMAP_PIXEL_LAYER1; // force all pixels to be layer 1 (no transparency) |
| 336 | 330 | const UINT8 TILE_FORCE_LAYER2 = TILEMAP_PIXEL_LAYER2; // force all pixels to be layer 2 (no transparency) |
| 337 | 331 | |
| 338 | | // tilemap global flags, used by tilemap_t::set_flip() |
| 332 | // tilemap global flags, used by tilemap_set_flip() |
| 339 | 333 | const UINT32 TILEMAP_FLIPX = TILE_FLIPX; // draw the tilemap horizontally flipped |
| 340 | 334 | const UINT32 TILEMAP_FLIPY = TILE_FLIPY; // draw the tilemap vertically flipped |
| 341 | 335 | |
| r241919 | r241920 | |
| 773 | 767 | // MACROS |
| 774 | 768 | //************************************************************************** |
| 775 | 769 | |
| 776 | | // macros to help form flags for tilemap_t::draw |
| 770 | // macros to help form flags for tilemap_draw |
| 777 | 771 | #define TILEMAP_DRAW_CATEGORY(x) (x) // specify category to draw |
| 778 | 772 | #define TILEMAP_DRAW_ALPHA(x) (TILEMAP_DRAW_ALPHA_FLAG | (rgb_t::clamp(x) << 24)) |
| 779 | 773 | |
trunk/src/lib/util/plaparse.c
| r241919 | r241920 | |
| 4 | 4 | |
| 5 | 5 | plaparse.h |
| 6 | 6 | |
| 7 | | Simple parser for Berkeley standard PLA files into raw fusemaps. |
| 8 | | It supports no more than one output matrix, and is limited to |
| 9 | | keywords: i, o, p, phase, e |
| 7 | Parser for Berkeley standard PLA files into raw fusemaps. |
| 10 | 8 | |
| 11 | 9 | ***************************************************************************/ |
| 12 | 10 | |
| r241919 | r241920 | |
| 33 | 31 | |
| 34 | 32 | struct parse_info |
| 35 | 33 | { |
| 36 | | UINT32 inputs; /* number of input columns */ |
| 37 | | UINT32 outputs; /* number of output columns */ |
| 38 | | UINT32 terms; /* number of terms */ |
| 39 | | UINT32 xorval[JED_MAX_FUSES/64]; /* output polarity */ |
| 40 | | UINT32 xorptr; |
| 34 | UINT32 inputs; |
| 35 | UINT32 outputs; |
| 36 | UINT32 terms; |
| 41 | 37 | }; |
| 42 | 38 | |
| 43 | 39 | |
| r241919 | r241920 | |
| 61 | 57 | character stream |
| 62 | 58 | -------------------------------------------------*/ |
| 63 | 59 | |
| 64 | | static UINT32 suck_number(const UINT8 **cursrc, const UINT8 *srcend) |
| 60 | static UINT32 suck_number(const UINT8 **psrc) |
| 65 | 61 | { |
| 62 | const UINT8 *src = *psrc; |
| 66 | 63 | 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; |
| 74 | 64 | |
| 75 | 65 | // loop over and accumulate digits |
| 76 | | while (isdigit(**cursrc)) |
| 66 | while (isdigit(*src)) |
| 77 | 67 | { |
| 78 | | value = value * 10 + (**cursrc) - '0'; |
| 79 | | (*cursrc)++; |
| 68 | value = value * 10 + *src - '0'; |
| 69 | src++; |
| 80 | 70 | } |
| 81 | 71 | |
| 72 | // return a pointer to the string afterwards |
| 73 | *psrc = src; |
| 82 | 74 | return value; |
| 83 | 75 | } |
| 84 | 76 | |
| r241919 | r241920 | |
| 89 | 81 | ***************************************************************************/ |
| 90 | 82 | |
| 91 | 83 | /*------------------------------------------------- |
| 92 | | process_terms - process input/output matrix |
| 84 | process_field - process a single field |
| 93 | 85 | -------------------------------------------------*/ |
| 94 | 86 | |
| 95 | | static bool process_terms(jed_data *data, const UINT8 **cursrc, const UINT8 *srcend, parse_info *pinfo) |
| 87 | static void process_field(jed_data *data, const UINT8 *cursrc, const UINT8 *srcend, parse_info *pinfo) |
| 96 | 88 | { |
| 97 | | UINT32 curinput = 0; |
| 98 | | UINT32 curoutput = 0; |
| 99 | | bool outputs = false; |
| 89 | cursrc++; |
| 100 | 90 | |
| 101 | | while (*cursrc < srcend && **cursrc != '.' && **cursrc != '#') |
| 91 | // switch off of the field type |
| 92 | switch (*cursrc) |
| 102 | 93 | { |
| 103 | | switch (**cursrc) |
| 94 | // number of inputs |
| 95 | case 'i': |
| 96 | cursrc += 2; |
| 97 | pinfo->inputs = suck_number(&cursrc); |
| 98 | if (LOG_PARSE) printf("Inputs: %u\n", pinfo->inputs); |
| 99 | break; |
| 100 | |
| 101 | // number of outputs |
| 102 | case 'o': |
| 103 | cursrc += 2; |
| 104 | pinfo->outputs = suck_number(&cursrc); |
| 105 | if (LOG_PARSE) printf("Outputs: %u\n", pinfo->outputs); |
| 106 | break; |
| 107 | |
| 108 | // number of product terms |
| 109 | case 'p': |
| 104 | 110 | { |
| 105 | | case '-': |
| 106 | | if (!outputs) |
| 107 | | { |
| 108 | | curinput++; |
| 109 | | jed_set_fuse(data, data->numfuses++, 1); |
| 110 | | jed_set_fuse(data, data->numfuses++, 1); |
| 111 | cursrc += 2; |
| 112 | pinfo->terms = suck_number(&cursrc); |
| 113 | if (LOG_PARSE) printf("Terms: %u\n", pinfo->terms); |
| 111 | 114 | |
| 112 | | if (LOG_PARSE) printf("11"); |
| 113 | | } |
| 114 | | break; |
| 115 | UINT32 curfuse = 0; |
| 116 | bool outputs = false; |
| 115 | 117 | |
| 116 | | case '~': |
| 117 | | if (!outputs) |
| 118 | cursrc++; |
| 119 | while (cursrc < srcend && *cursrc != '.') |
| 120 | { |
| 121 | switch (*cursrc) |
| 118 | 122 | { |
| 119 | | curinput++; |
| 120 | | // this product term is inhibited |
| 121 | | jed_set_fuse(data, data->numfuses++, 0); |
| 122 | | jed_set_fuse(data, data->numfuses++, 0); |
| 123 | case '-': |
| 124 | if (!outputs) |
| 125 | { |
| 126 | jed_set_fuse(data, curfuse++, 1); |
| 127 | jed_set_fuse(data, curfuse++, 1); |
| 123 | 128 | |
| 124 | | if (LOG_PARSE) printf("00"); |
| 125 | | } |
| 126 | | break; |
| 129 | if (LOG_PARSE) printf("11"); |
| 130 | } |
| 131 | break; |
| 127 | 132 | |
| 128 | | case '1': |
| 129 | | if (outputs) |
| 130 | | { |
| 131 | | curoutput++; |
| 132 | | jed_set_fuse(data, data->numfuses++, 0); |
| 133 | case '1': |
| 134 | if (outputs) |
| 135 | { |
| 136 | jed_set_fuse(data, curfuse++, 0); |
| 133 | 137 | |
| 134 | | if (LOG_PARSE) printf("0"); |
| 135 | | } |
| 136 | | else |
| 137 | | { |
| 138 | | curinput++; |
| 139 | | jed_set_fuse(data, data->numfuses++, 1); |
| 140 | | jed_set_fuse(data, data->numfuses++, 0); |
| 138 | if (LOG_PARSE) printf("0"); |
| 139 | } |
| 140 | else |
| 141 | { |
| 142 | jed_set_fuse(data, curfuse++, 1); |
| 143 | jed_set_fuse(data, curfuse++, 0); |
| 141 | 144 | |
| 142 | | if (LOG_PARSE) printf("10"); |
| 143 | | } |
| 144 | | break; |
| 145 | if (LOG_PARSE) printf("10"); |
| 146 | } |
| 147 | break; |
| 145 | 148 | |
| 146 | | case '0': |
| 147 | | if (outputs) |
| 148 | | { |
| 149 | | curoutput++; |
| 150 | | jed_set_fuse(data, data->numfuses++, 1); |
| 149 | case '0': |
| 150 | if (outputs) |
| 151 | { |
| 152 | jed_set_fuse(data, curfuse++, 1); |
| 151 | 153 | |
| 152 | | if (LOG_PARSE) printf("1"); |
| 153 | | } |
| 154 | | else |
| 155 | | { |
| 156 | | curinput++; |
| 157 | | jed_set_fuse(data, data->numfuses++, 0); |
| 158 | | jed_set_fuse(data, data->numfuses++, 1); |
| 154 | if (LOG_PARSE) printf("1"); |
| 155 | } |
| 156 | else |
| 157 | { |
| 158 | jed_set_fuse(data, curfuse++, 0); |
| 159 | jed_set_fuse(data, curfuse++, 1); |
| 159 | 160 | |
| 160 | | if (LOG_PARSE) printf("01"); |
| 161 | | } |
| 162 | | break; |
| 161 | if (LOG_PARSE) printf("01"); |
| 162 | } |
| 163 | break; |
| 163 | 164 | |
| 164 | | case ' ': case '\t': |
| 165 | | if (curinput > 0 && !outputs) |
| 166 | | { |
| 165 | case ' ': |
| 167 | 166 | outputs = true; |
| 168 | 167 | if (LOG_PARSE) printf(" "); |
| 168 | break; |
| 169 | 169 | } |
| 170 | | break; |
| 171 | | |
| 172 | | default: |
| 173 | | break; |
| 174 | | } |
| 175 | 170 | |
| 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 | | |
| 200 | | static bool process_field(jed_data *data, const UINT8 **cursrc, const UINT8 *srcend, parse_info *pinfo) |
| 201 | | { |
| 202 | | (*cursrc)++; |
| 203 | | |
| 204 | | switch (**cursrc) |
| 205 | | { |
| 206 | | // number of inputs |
| 207 | | case 'i': case 'I': |
| 208 | | pinfo->inputs = suck_number(cursrc, srcend); |
| 209 | | if (pinfo->inputs == 0 || pinfo->inputs >= (JED_MAX_FUSES/2)) |
| 210 | | return false; |
| 211 | | |
| 212 | | if (LOG_PARSE) printf("Inputs: %u\n", pinfo->inputs); |
| 213 | | break; |
| 214 | | |
| 215 | | // number of outputs |
| 216 | | case 'o': case 'O': |
| 217 | | pinfo->outputs = suck_number(cursrc, srcend); |
| 218 | | if (pinfo->outputs == 0 || pinfo->outputs >= (JED_MAX_FUSES/2)) |
| 219 | | return false; |
| 220 | | |
| 221 | | if (LOG_PARSE) printf("Outputs: %u\n", pinfo->outputs); |
| 222 | | break; |
| 223 | | |
| 224 | | case 'p': case 'P': |
| 225 | | // output polarity (optional) |
| 226 | | if (tolower((*cursrc)[1]) == 'h' && tolower((*cursrc)[2]) == 'a' && tolower((*cursrc)[3]) == 's' && tolower((*cursrc)[4]) == 'e') |
| 227 | | { |
| 228 | | if (LOG_PARSE) printf("Phase...\n"); |
| 229 | | while (*cursrc < srcend && !iscrlf(**cursrc) && pinfo->xorptr < (JED_MAX_FUSES/2)) |
| 171 | if (iscrlf(*cursrc) && outputs) |
| 230 | 172 | { |
| 231 | | if (**cursrc == '0' || **cursrc == '1') |
| 232 | | { |
| 233 | | // 0 is negative |
| 234 | | if (**cursrc == '0') |
| 235 | | pinfo->xorval[pinfo->xorptr/32] |= 1 << (pinfo->xorptr & 31); |
| 236 | | pinfo->xorptr++; |
| 237 | | } |
| 238 | | |
| 239 | | (*cursrc)++; |
| 173 | outputs = false; |
| 174 | if (LOG_PARSE) printf("\n"); |
| 240 | 175 | } |
| 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; |
| 249 | 176 | |
| 250 | | if (LOG_PARSE) printf("Terms: %u\n", pinfo->terms); |
| 177 | cursrc++; |
| 251 | 178 | } |
| 179 | |
| 180 | data->numfuses = curfuse; |
| 252 | 181 | break; |
| 182 | } |
| 253 | 183 | |
| 254 | | // end of file (optional) |
| 255 | | case 'e': case 'E': |
| 184 | // end of file |
| 185 | case 'e': |
| 256 | 186 | if (LOG_PARSE) printf("End of file\n"); |
| 257 | 187 | break; |
| 258 | | |
| 259 | | default: |
| 260 | | return false; |
| 261 | 188 | } |
| 262 | | |
| 263 | | return true; |
| 189 | |
| 190 | cursrc++; |
| 264 | 191 | } |
| 265 | 192 | |
| 266 | 193 | |
| r241919 | r241920 | |
| 274 | 201 | { |
| 275 | 202 | const UINT8 *cursrc = (const UINT8 *)data; |
| 276 | 203 | const UINT8 *srcend = cursrc + length; |
| 277 | | |
| 204 | const UINT8 *scan; |
| 278 | 205 | parse_info pinfo; |
| 279 | | memset(&pinfo, 0, sizeof(pinfo)); |
| 280 | 206 | |
| 281 | 207 | result->numfuses = 0; |
| 282 | | memset(result->fusemap, 0, sizeof(result->fusemap)); |
| 208 | memset(result->fusemap, 0x00, sizeof(result->fusemap)); |
| 283 | 209 | |
| 284 | 210 | while (cursrc < srcend) |
| 285 | 211 | { |
| 286 | | switch (*cursrc) |
| 212 | if (*cursrc == '#') |
| 287 | 213 | { |
| 288 | | // comment line |
| 289 | | case '#': |
| 290 | | while (cursrc < srcend && !iscrlf(*cursrc)) |
| 291 | | cursrc++; |
| 292 | | break; |
| 293 | | |
| 294 | | // keyword |
| 295 | | case '.': |
| 296 | | if (!process_field(result, &cursrc, srcend, &pinfo)) |
| 297 | | return JEDERR_INVALID_DATA; |
| 298 | | break; |
| 299 | | |
| 300 | | // terms |
| 301 | | case '0': case '1': case '-': case '~': |
| 302 | | if (!process_terms(result, &cursrc, srcend, &pinfo)) |
| 303 | | return JEDERR_INVALID_DATA; |
| 304 | | break; |
| 305 | | |
| 306 | | default: |
| 214 | cursrc++; |
| 215 | while (cursrc < srcend && !iscrlf(*cursrc)) |
| 307 | 216 | cursrc++; |
| 308 | | break; |
| 309 | 217 | } |
| 310 | | } |
| 311 | | |
| 312 | | // write output polarity |
| 313 | | if (pinfo.xorptr > 0) |
| 314 | | { |
| 315 | | if (LOG_PARSE) printf("Polarity: "); |
| 316 | | |
| 317 | | for (int i = 0; i < pinfo.outputs; i++) |
| 218 | else if (*cursrc == '.') |
| 318 | 219 | { |
| 319 | | int bit = pinfo.xorval[i/32] >> (i & 31) & 1; |
| 320 | | jed_set_fuse(result, result->numfuses++, bit); |
| 321 | | if (LOG_PARSE) printf("%d", bit); |
| 220 | scan = cursrc; |
| 221 | while (scan < srcend && !iscrlf(*scan)) |
| 222 | scan++; |
| 223 | if (scan >= srcend) |
| 224 | return JEDERR_INVALID_DATA; |
| 225 | |
| 226 | process_field(result, cursrc, srcend, &pinfo); |
| 227 | |
| 228 | cursrc = scan + 1; |
| 322 | 229 | } |
| 323 | | if (LOG_PARSE) printf("\n"); |
| 230 | |
| 231 | cursrc++; |
| 324 | 232 | } |
| 325 | 233 | |
| 326 | 234 | return JEDERR_NONE; |
trunk/src/mame/drivers/dooyong.c
| r241919 | r241920 | |
| 84 | 84 | #include "sound/okim6295.h" |
| 85 | 85 | #include "includes/dooyong.h" |
| 86 | 86 | |
| 87 | | WRITE8_MEMBER(dooyong_z80_state::bankswitch_w) |
| 87 | WRITE8_MEMBER(dooyong_state::lastday_bankswitch_w) |
| 88 | 88 | { |
| 89 | 89 | membank("bank1")->set_entry(data & 0x07); |
| 90 | 90 | |
| 91 | 91 | if (data & 0xf8) popmessage("bankswitch %02x",data); |
| 92 | 92 | } |
| 93 | 93 | |
| 94 | | MACHINE_START_MEMBER(dooyong_z80_state, cpu_z80) |
| 94 | MACHINE_START_MEMBER(dooyong_state,lastday) |
| 95 | 95 | { |
| 96 | 96 | membank("bank1")->configure_entries(0, 8, memregion("maincpu")->base() + 0x10000, 0x4000); |
| 97 | 97 | } |
| 98 | 98 | |
| 99 | | WRITE8_MEMBER(dooyong_z80_state::flip_screen_w) |
| 99 | WRITE8_MEMBER(dooyong_state::flip_screen_w) |
| 100 | 100 | { |
| 101 | 101 | flip_screen_set(data); |
| 102 | 102 | } |
| 103 | 103 | |
| 104 | | MACHINE_RESET_MEMBER(dooyong_z80_ym2203_state, sound_ym2203) |
| 104 | MACHINE_RESET_MEMBER(dooyong_state,sound_ym2203) |
| 105 | 105 | { |
| 106 | | m_interrupt_line_1 = 0; |
| 107 | | m_interrupt_line_2 = 0; |
| 106 | m_interrupt_line_1=0; |
| 107 | m_interrupt_line_2=0; |
| 108 | 108 | } |
| 109 | 109 | |
| 110 | 110 | /*************************************************************************** |
| r241919 | r241920 | |
| 113 | 113 | |
| 114 | 114 | ***************************************************************************/ |
| 115 | 115 | |
| 116 | | static ADDRESS_MAP_START( lastday_map, AS_PROGRAM, 8, dooyong_z80_ym2203_state ) |
| 116 | static ADDRESS_MAP_START( lastday_map, AS_PROGRAM, 8, dooyong_state ) |
| 117 | 117 | AM_RANGE(0x0000, 0x7fff) AM_ROM |
| 118 | 118 | AM_RANGE(0x8000, 0xbfff) AM_ROMBANK("bank1") |
| 119 | | AM_RANGE(0xc000, 0xc007) AM_WRITE(bgscroll_w) |
| 120 | | AM_RANGE(0xc008, 0xc00f) AM_WRITE(fgscroll_w) |
| 119 | AM_RANGE(0xc000, 0xc007) AM_WRITE(dooyong_bgscroll8_w) |
| 120 | AM_RANGE(0xc008, 0xc00f) AM_WRITE(dooyong_fgscroll8_w) |
| 121 | 121 | AM_RANGE(0xc010, 0xc010) AM_READ_PORT("SYSTEM") |
| 122 | 122 | AM_RANGE(0xc010, 0xc010) AM_WRITE(lastday_ctrl_w) /* coin counter, flip screen */ |
| 123 | 123 | AM_RANGE(0xc011, 0xc011) AM_READ_PORT("P1") |
| 124 | | AM_RANGE(0xc011, 0xc011) AM_WRITE(bankswitch_w) |
| 124 | AM_RANGE(0xc011, 0xc011) AM_WRITE(lastday_bankswitch_w) |
| 125 | 125 | AM_RANGE(0xc012, 0xc012) AM_READ_PORT("P2") |
| 126 | 126 | AM_RANGE(0xc012, 0xc012) AM_WRITE(soundlatch_byte_w) |
| 127 | 127 | AM_RANGE(0xc013, 0xc013) AM_READ_PORT("DSWA") |
| 128 | 128 | AM_RANGE(0xc014, 0xc014) AM_READ_PORT("DSWB") |
| 129 | 129 | AM_RANGE(0xc800, 0xcfff) AM_RAM_DEVWRITE("palette", palette_device, write) AM_SHARE("palette") |
| 130 | | AM_RANGE(0xd000, 0xdfff) AM_RAM_WRITE(txvideoram_w) AM_SHARE("txvideoram") |
| 130 | AM_RANGE(0xd000, 0xdfff) AM_RAM_WRITE(dooyong_txvideoram8_w) AM_SHARE("txvideoram") |
| 131 | 131 | AM_RANGE(0xe000, 0xefff) AM_RAM |
| 132 | 132 | AM_RANGE(0xf000, 0xffff) AM_RAM AM_SHARE("spriteram") |
| 133 | 133 | ADDRESS_MAP_END |
| 134 | 134 | |
| 135 | | static ADDRESS_MAP_START( pollux_map, AS_PROGRAM, 8, dooyong_z80_ym2203_state ) |
| 135 | static ADDRESS_MAP_START( pollux_map, AS_PROGRAM, 8, dooyong_state ) |
| 136 | 136 | AM_RANGE(0x0000, 0x7fff) AM_ROM |
| 137 | 137 | AM_RANGE(0x8000, 0xbfff) AM_ROMBANK("bank1") |
| 138 | 138 | AM_RANGE(0xc000, 0xcfff) AM_RAM |
| 139 | 139 | AM_RANGE(0xd000, 0xdfff) AM_RAM AM_SHARE("spriteram") |
| 140 | | AM_RANGE(0xe000, 0xefff) AM_RAM_WRITE(txvideoram_w) AM_SHARE("txvideoram") |
| 141 | | AM_RANGE(0xf000, 0xf000) AM_READ_PORT("DSWA") AM_WRITE(bankswitch_w) |
| 140 | AM_RANGE(0xe000, 0xefff) AM_RAM_WRITE(dooyong_txvideoram8_w) AM_SHARE("txvideoram") |
| 141 | AM_RANGE(0xf000, 0xf000) AM_READ_PORT("DSWA") AM_WRITE(lastday_bankswitch_w) |
| 142 | 142 | AM_RANGE(0xf001, 0xf001) AM_READ_PORT("DSWB") |
| 143 | 143 | AM_RANGE(0xf002, 0xf002) AM_READ_PORT("P1") |
| 144 | 144 | AM_RANGE(0xf003, 0xf003) AM_READ_PORT("P2") |
| 145 | 145 | AM_RANGE(0xf004, 0xf004) AM_READ_PORT("SYSTEM") |
| 146 | 146 | AM_RANGE(0xf008, 0xf008) AM_WRITE(pollux_ctrl_w) /* coin counter, flip screen */ |
| 147 | 147 | AM_RANGE(0xf010, 0xf010) AM_WRITE(soundlatch_byte_w) |
| 148 | | AM_RANGE(0xf018, 0xf01f) AM_WRITE(bgscroll_w) |
| 149 | | AM_RANGE(0xf020, 0xf027) AM_WRITE(fgscroll_w) |
| 148 | AM_RANGE(0xf018, 0xf01f) AM_WRITE(dooyong_bgscroll8_w) |
| 149 | AM_RANGE(0xf020, 0xf027) AM_WRITE(dooyong_fgscroll8_w) |
| 150 | 150 | AM_RANGE(0xf800, 0xffff) AM_RAM_DEVWRITE("palette", palette_device, write) AM_SHARE("palette") |
| 151 | 151 | ADDRESS_MAP_END |
| 152 | 152 | |
| 153 | | static ADDRESS_MAP_START( gulfstrm_map, AS_PROGRAM, 8, dooyong_z80_ym2203_state ) |
| 153 | static ADDRESS_MAP_START( gulfstrm_map, AS_PROGRAM, 8, dooyong_state ) |
| 154 | 154 | AM_RANGE(0x0000, 0x7fff) AM_ROM |
| 155 | 155 | AM_RANGE(0x8000, 0xbfff) AM_ROMBANK("bank1") |
| 156 | 156 | AM_RANGE(0xc000, 0xcfff) AM_RAM |
| 157 | 157 | AM_RANGE(0xd000, 0xdfff) AM_RAM AM_SHARE("spriteram") |
| 158 | | AM_RANGE(0xe000, 0xefff) AM_RAM_WRITE(txvideoram_w) AM_SHARE("txvideoram") |
| 158 | AM_RANGE(0xe000, 0xefff) AM_RAM_WRITE(dooyong_txvideoram8_w) AM_SHARE("txvideoram") |
| 159 | 159 | AM_RANGE(0xf000, 0xf000) AM_READ_PORT("DSWA") |
| 160 | | AM_RANGE(0xf000, 0xf000) AM_WRITE(bankswitch_w) |
| 160 | AM_RANGE(0xf000, 0xf000) AM_WRITE(lastday_bankswitch_w) |
| 161 | 161 | AM_RANGE(0xf001, 0xf001) AM_READ_PORT("DSWB") |
| 162 | 162 | AM_RANGE(0xf002, 0xf002) AM_READ_PORT("P2") |
| 163 | 163 | AM_RANGE(0xf003, 0xf003) AM_READ_PORT("P1") |
| 164 | 164 | AM_RANGE(0xf004, 0xf004) AM_READ_PORT("SYSTEM") |
| 165 | 165 | AM_RANGE(0xf008, 0xf008) AM_WRITE(pollux_ctrl_w) /* coin counter, flip screen */ |
| 166 | 166 | AM_RANGE(0xf010, 0xf010) AM_WRITE(soundlatch_byte_w) |
| 167 | | AM_RANGE(0xf018, 0xf01f) AM_WRITE(bgscroll_w) |
| 168 | | AM_RANGE(0xf020, 0xf027) AM_WRITE(fgscroll_w) |
| 167 | AM_RANGE(0xf018, 0xf01f) AM_WRITE(dooyong_bgscroll8_w) |
| 168 | AM_RANGE(0xf020, 0xf027) AM_WRITE(dooyong_fgscroll8_w) |
| 169 | 169 | AM_RANGE(0xf800, 0xffff) AM_RAM_DEVWRITE("palette", palette_device, write) AM_SHARE("palette") |
| 170 | 170 | ADDRESS_MAP_END |
| 171 | 171 | |
| 172 | | static ADDRESS_MAP_START( bluehawk_map, AS_PROGRAM, 8, dooyong_z80_state ) |
| 172 | static ADDRESS_MAP_START( bluehawk_map, AS_PROGRAM, 8, dooyong_state ) |
| 173 | 173 | AM_RANGE(0x0000, 0x7fff) AM_ROM |
| 174 | 174 | AM_RANGE(0x8000, 0xbfff) AM_ROMBANK("bank1") |
| 175 | 175 | AM_RANGE(0xc000, 0xc000) AM_READ_PORT("DSWA") |
| r241919 | r241920 | |
| 178 | 178 | AM_RANGE(0xc002, 0xc002) AM_READ_PORT("P1") |
| 179 | 179 | AM_RANGE(0xc003, 0xc003) AM_READ_PORT("P2") |
| 180 | 180 | AM_RANGE(0xc004, 0xc004) AM_READ_PORT("SYSTEM") |
| 181 | | AM_RANGE(0xc008, 0xc008) AM_WRITE(bankswitch_w) |
| 181 | AM_RANGE(0xc008, 0xc008) AM_WRITE(lastday_bankswitch_w) |
| 182 | 182 | AM_RANGE(0xc010, 0xc010) AM_WRITE(soundlatch_byte_w) |
| 183 | | AM_RANGE(0xc018, 0xc01f) AM_WRITE(fg2scroll_w) |
| 184 | | AM_RANGE(0xc040, 0xc047) AM_WRITE(bgscroll_w) |
| 185 | | AM_RANGE(0xc048, 0xc04f) AM_WRITE(fgscroll_w) |
| 183 | AM_RANGE(0xc018, 0xc01f) AM_WRITE(dooyong_fg2scroll8_w) |
| 184 | AM_RANGE(0xc040, 0xc047) AM_WRITE(dooyong_bgscroll8_w) |
| 185 | AM_RANGE(0xc048, 0xc04f) AM_WRITE(dooyong_fgscroll8_w) |
| 186 | 186 | AM_RANGE(0xc800, 0xcfff) AM_RAM_DEVWRITE("palette", palette_device, write) AM_SHARE("palette") |
| 187 | | AM_RANGE(0xd000, 0xdfff) AM_RAM_WRITE(txvideoram_w) AM_SHARE("txvideoram") |
| 187 | AM_RANGE(0xd000, 0xdfff) AM_RAM_WRITE(dooyong_txvideoram8_w) AM_SHARE("txvideoram") |
| 188 | 188 | AM_RANGE(0xe000, 0xefff) AM_RAM AM_SHARE("spriteram") |
| 189 | 189 | AM_RANGE(0xf000, 0xffff) AM_RAM |
| 190 | 190 | ADDRESS_MAP_END |
| 191 | 191 | |
| 192 | | static ADDRESS_MAP_START( flytiger_map, AS_PROGRAM, 8, dooyong_z80_state ) |
| 192 | static ADDRESS_MAP_START( flytiger_map, AS_PROGRAM, 8, dooyong_state ) |
| 193 | 193 | AM_RANGE(0x0000, 0x7fff) AM_ROM |
| 194 | 194 | AM_RANGE(0x8000, 0xbfff) AM_ROMBANK("bank1") |
| 195 | 195 | AM_RANGE(0xc000, 0xcfff) AM_RAM AM_SHARE("spriteram") |
| 196 | 196 | AM_RANGE(0xd000, 0xdfff) AM_RAM |
| 197 | 197 | AM_RANGE(0xe000, 0xe000) AM_READ_PORT("P1") |
| 198 | | AM_RANGE(0xe000, 0xe000) AM_WRITE(bankswitch_w) |
| 198 | AM_RANGE(0xe000, 0xe000) AM_WRITE(lastday_bankswitch_w) |
| 199 | 199 | AM_RANGE(0xe002, 0xe002) AM_READ_PORT("P2") |
| 200 | 200 | AM_RANGE(0xe004, 0xe004) AM_READ_PORT("SYSTEM") |
| 201 | 201 | AM_RANGE(0xe006, 0xe006) AM_READ_PORT("DSWA") |
| 202 | 202 | AM_RANGE(0xe008, 0xe008) AM_READ_PORT("DSWB") |
| 203 | 203 | AM_RANGE(0xe010, 0xe010) AM_WRITE(flytiger_ctrl_w) /* coin counter, flip screen */ |
| 204 | 204 | AM_RANGE(0xe020, 0xe020) AM_WRITE(soundlatch_byte_w) |
| 205 | | AM_RANGE(0xe030, 0xe037) AM_WRITE(bgscroll_w) |
| 206 | | AM_RANGE(0xe040, 0xe047) AM_WRITE(fgscroll_w) |
| 205 | AM_RANGE(0xe030, 0xe037) AM_WRITE(dooyong_bgscroll8_w) |
| 206 | AM_RANGE(0xe040, 0xe047) AM_WRITE(dooyong_fgscroll8_w) |
| 207 | 207 | AM_RANGE(0xe800, 0xefff) AM_RAM_WRITE(paletteram_flytiger_w) AM_SHARE("flytiger_palram") |
| 208 | | AM_RANGE(0xf000, 0xffff) AM_RAM_WRITE(txvideoram_w) AM_SHARE("txvideoram") |
| 208 | AM_RANGE(0xf000, 0xffff) AM_RAM_WRITE(dooyong_txvideoram8_w) AM_SHARE("txvideoram") |
| 209 | 209 | ADDRESS_MAP_END |
| 210 | 210 | |
| 211 | | static ADDRESS_MAP_START( primella_map, AS_PROGRAM, 8, dooyong_z80_state ) |
| 211 | static ADDRESS_MAP_START( primella_map, AS_PROGRAM, 8, dooyong_state ) |
| 212 | 212 | AM_RANGE(0x0000, 0x7fff) AM_ROM |
| 213 | 213 | AM_RANGE(0x8000, 0xbfff) AM_ROMBANK("bank1") |
| 214 | 214 | AM_RANGE(0xc000, 0xcfff) AM_RAM |
| 215 | 215 | AM_RANGE(0xd000, 0xd3ff) AM_RAM /* what is this? looks like a palette? scratchpad RAM maybe? */ |
| 216 | | AM_RANGE(0xe000, 0xefff) AM_RAM_WRITE(txvideoram_w) AM_SHARE("txvideoram") |
| 216 | AM_RANGE(0xe000, 0xefff) AM_RAM_WRITE(dooyong_txvideoram8_w) AM_SHARE("txvideoram") |
| 217 | 217 | AM_RANGE(0xf000, 0xf7ff) AM_DEVWRITE("palette", palette_device, write) AM_SHARE("palette") |
| 218 | 218 | AM_RANGE(0xf800, 0xf800) AM_READ_PORT("DSWA") |
| 219 | 219 | AM_RANGE(0xf800, 0xf800) AM_WRITE(primella_ctrl_w) /* bank switch, flip screen etc */ |
| r241919 | r241920 | |
| 222 | 222 | AM_RANGE(0xf820, 0xf820) AM_READ_PORT("P1") |
| 223 | 223 | AM_RANGE(0xf830, 0xf830) AM_READ_PORT("P2") |
| 224 | 224 | AM_RANGE(0xf840, 0xf840) AM_READ_PORT("SYSTEM") |
| 225 | | AM_RANGE(0xfc00, 0xfc07) AM_WRITE(bgscroll_w) |
| 226 | | AM_RANGE(0xfc08, 0xfc0f) AM_WRITE(fgscroll_w) |
| 225 | AM_RANGE(0xfc00, 0xfc07) AM_WRITE(dooyong_bgscroll8_w) |
| 226 | AM_RANGE(0xfc08, 0xfc0f) AM_WRITE(dooyong_fgscroll8_w) |
| 227 | 227 | ADDRESS_MAP_END |
| 228 | 228 | |
| 229 | | static ADDRESS_MAP_START( rshark_map, AS_PROGRAM, 16, dooyong_68k_state ) |
| 229 | static ADDRESS_MAP_START( rshark_map, AS_PROGRAM, 16, dooyong_state ) |
| 230 | 230 | ADDRESS_MAP_GLOBAL_MASK(0xfffff) /* super-x needs this and is similar */ |
| 231 | 231 | AM_RANGE(0x000000, 0x03ffff) AM_ROM |
| 232 | 232 | AM_RANGE(0x040000, 0x04cfff) AM_RAM |
| 233 | | AM_RANGE(0x04d000, 0x04dfff) AM_RAM AM_SHARE("spriteram") |
| 233 | AM_RANGE(0x04d000, 0x04dfff) AM_RAM AM_SHARE("spriteram16") |
| 234 | 234 | AM_RANGE(0x04e000, 0x04ffff) AM_RAM |
| 235 | 235 | AM_RANGE(0x0c0002, 0x0c0003) AM_READ_PORT("DSW") |
| 236 | 236 | AM_RANGE(0x0c0004, 0x0c0005) AM_READ_PORT("P1_P2") |
| 237 | 237 | AM_RANGE(0x0c0006, 0x0c0007) AM_READ_PORT("SYSTEM") |
| 238 | | AM_RANGE(0x0c4000, 0x0c400f) AM_WRITE8(bgscroll_w, 0x00ff) |
| 239 | | AM_RANGE(0x0c4010, 0x0c401f) AM_WRITE8(bg2scroll_w, 0x00ff) |
| 238 | AM_RANGE(0x0c4000, 0x0c400f) AM_WRITE(dooyong_bgscroll16_w) |
| 239 | AM_RANGE(0x0c4010, 0x0c401f) AM_WRITE(dooyong_bg2scroll16_w) |
| 240 | 240 | AM_RANGE(0x0c8000, 0x0c8fff) AM_DEVWRITE("palette", palette_device, write) AM_SHARE("palette") |
| 241 | 241 | AM_RANGE(0x0c0012, 0x0c0013) AM_WRITE(soundlatch_word_w) |
| 242 | | AM_RANGE(0x0c0014, 0x0c0015) AM_WRITE(ctrl_w) /* flip screen + unknown stuff */ |
| 243 | | AM_RANGE(0x0cc000, 0x0cc00f) AM_WRITE8(fgscroll_w, 0x00ff) |
| 244 | | AM_RANGE(0x0cc010, 0x0cc01f) AM_WRITE8(fg2scroll_w, 0x00ff) |
| 242 | AM_RANGE(0x0c0014, 0x0c0015) AM_WRITE(rshark_ctrl_w) /* flip screen + unknown stuff */ |
| 243 | AM_RANGE(0x0cc000, 0x0cc00f) AM_WRITE(dooyong_fgscroll16_w) |
| 244 | AM_RANGE(0x0cc010, 0x0cc01f) AM_WRITE(dooyong_fg2scroll16_w) |
| 245 | 245 | ADDRESS_MAP_END |
| 246 | 246 | |
| 247 | | static ADDRESS_MAP_START( superx_map, AS_PROGRAM, 16, dooyong_68k_state ) |
| 247 | static ADDRESS_MAP_START( superx_map, AS_PROGRAM, 16, dooyong_state ) |
| 248 | 248 | ADDRESS_MAP_GLOBAL_MASK(0xfffff) |
| 249 | 249 | AM_RANGE(0x000000, 0x03ffff) AM_ROM |
| 250 | 250 | AM_RANGE(0x0d0000, 0x0dcfff) AM_RAM |
| 251 | | AM_RANGE(0x0dd000, 0x0ddfff) AM_RAM AM_SHARE("spriteram") |
| 251 | AM_RANGE(0x0dd000, 0x0ddfff) AM_RAM AM_SHARE("spriteram16") |
| 252 | 252 | AM_RANGE(0x0de000, 0x0dffff) AM_RAM |
| 253 | 253 | AM_RANGE(0x080002, 0x080003) AM_READ_PORT("DSW") |
| 254 | 254 | AM_RANGE(0x080004, 0x080005) AM_READ_PORT("P1_P2") |
| 255 | 255 | AM_RANGE(0x080006, 0x080007) AM_READ_PORT("SYSTEM") |
| 256 | | AM_RANGE(0x084000, 0x08400f) AM_WRITE8(bgscroll_w, 0x00ff) |
| 257 | | AM_RANGE(0x084010, 0x08401f) AM_WRITE8(bg2scroll_w, 0x00ff) |
| 256 | AM_RANGE(0x084000, 0x08400f) AM_WRITE(dooyong_bgscroll16_w) |
| 257 | AM_RANGE(0x084010, 0x08401f) AM_WRITE(dooyong_bg2scroll16_w) |
| 258 | 258 | AM_RANGE(0x088000, 0x088fff) AM_DEVWRITE("palette", palette_device, write) AM_SHARE("palette") |
| 259 | 259 | AM_RANGE(0x080012, 0x080013) AM_WRITE(soundlatch_word_w) |
| 260 | | AM_RANGE(0x080014, 0x080015) AM_WRITE(ctrl_w) /* flip screen + unknown stuff */ |
| 261 | | AM_RANGE(0x08c000, 0x08c00f) AM_WRITE8(fgscroll_w, 0x00ff) |
| 262 | | AM_RANGE(0x08c010, 0x08c01f) AM_WRITE8(fg2scroll_w, 0x00ff) |
| 260 | AM_RANGE(0x080014, 0x080015) AM_WRITE(rshark_ctrl_w) /* flip screen + unknown stuff */ |
| 261 | AM_RANGE(0x08c000, 0x08c00f) AM_WRITE(dooyong_fgscroll16_w) |
| 262 | AM_RANGE(0x08c010, 0x08c01f) AM_WRITE(dooyong_fg2scroll16_w) |
| 263 | 263 | ADDRESS_MAP_END |
| 264 | 264 | |
| 265 | | static ADDRESS_MAP_START( popbingo_map, AS_PROGRAM, 16, dooyong_68k_state ) |
| 265 | static ADDRESS_MAP_START( popbingo_map, AS_PROGRAM, 16, dooyong_state ) |
| 266 | 266 | ADDRESS_MAP_GLOBAL_MASK(0xfffff) |
| 267 | 267 | AM_RANGE(0x000000, 0x03ffff) AM_ROM |
| 268 | 268 | AM_RANGE(0x040000, 0x04cfff) AM_RAM |
| 269 | | AM_RANGE(0x04d000, 0x04dfff) AM_RAM AM_SHARE("spriteram") |
| 269 | AM_RANGE(0x04d000, 0x04dfff) AM_RAM AM_SHARE("spriteram16") |
| 270 | 270 | AM_RANGE(0x04e000, 0x04ffff) AM_RAM |
| 271 | 271 | AM_RANGE(0x0c0002, 0x0c0003) AM_READ_PORT("DSW") |
| 272 | 272 | AM_RANGE(0x0c0004, 0x0c0005) AM_READ_PORT("P1_P2") |
| 273 | 273 | AM_RANGE(0x0c0006, 0x0c0007) AM_READ_PORT("SYSTEM") |
| 274 | 274 | AM_RANGE(0x0c0012, 0x0c0013) AM_WRITE(soundlatch_word_w) |
| 275 | | AM_RANGE(0x0c0014, 0x0c0015) AM_WRITE(ctrl_w) |
| 275 | AM_RANGE(0x0c0014, 0x0c0015) AM_WRITE(rshark_ctrl_w) |
| 276 | 276 | AM_RANGE(0x0c0018, 0x0c001b) AM_WRITENOP // ? |
| 277 | | AM_RANGE(0x0c4000, 0x0c400f) AM_WRITE8(bgscroll_w, 0x00ff) |
| 278 | | AM_RANGE(0x0c4010, 0x0c401f) AM_WRITE8(bg2scroll_w, 0x00ff) // not used atm |
| 277 | AM_RANGE(0x0c4000, 0x0c400f) AM_WRITE(dooyong_bgscroll16_w) |
| 278 | AM_RANGE(0x0c4010, 0x0c401f) AM_WRITE(dooyong_bg2scroll16_w) // not used atm |
| 279 | 279 | AM_RANGE(0x0c8000, 0x0c8fff) AM_DEVWRITE("palette", palette_device, write) AM_SHARE("palette") |
| 280 | | AM_RANGE(0x0cc000, 0x0cc00f) AM_WRITE8(fgscroll_w, 0x00ff) // not used atm |
| 281 | | AM_RANGE(0x0cc010, 0x0cc01f) AM_WRITE8(fg2scroll_w, 0x00ff) // not used atm |
| 280 | AM_RANGE(0x0cc000, 0x0cc00f) AM_WRITE(dooyong_fgscroll16_w) // not used atm |
| 281 | AM_RANGE(0x0cc010, 0x0cc01f) AM_WRITE(dooyong_fg2scroll16_w) // not used atm |
| 282 | 282 | AM_RANGE(0x0dc000, 0x0dc01f) AM_RAM // registers of some kind? |
| 283 | 283 | ADDRESS_MAP_END |
| 284 | 284 | |
| 285 | | static ADDRESS_MAP_START( lastday_sound_map, AS_PROGRAM, 8, dooyong_z80_ym2203_state ) |
| 285 | static ADDRESS_MAP_START( lastday_sound_map, AS_PROGRAM, 8, dooyong_state ) |
| 286 | 286 | AM_RANGE(0x0000, 0x7fff) AM_ROM |
| 287 | 287 | AM_RANGE(0xc000, 0xc7ff) AM_RAM |
| 288 | 288 | AM_RANGE(0xc800, 0xc800) AM_READ(soundlatch_byte_r) |
| r241919 | r241920 | |
| 290 | 290 | AM_RANGE(0xf002, 0xf003) AM_DEVREADWRITE("ym2", ym2203_device, read, write) |
| 291 | 291 | ADDRESS_MAP_END |
| 292 | 292 | |
| 293 | | static ADDRESS_MAP_START( pollux_sound_map, AS_PROGRAM, 8, dooyong_z80_ym2203_state ) |
| 293 | static ADDRESS_MAP_START( pollux_sound_map, AS_PROGRAM, 8, dooyong_state ) |
| 294 | 294 | AM_RANGE(0x0000, 0xefff) AM_ROM |
| 295 | 295 | AM_RANGE(0xf000, 0xf7ff) AM_RAM |
| 296 | 296 | AM_RANGE(0xf800, 0xf800) AM_READ(soundlatch_byte_r) |
| r241919 | r241920 | |
| 772 | 772 | GFXDECODE_ENTRY( "gfx2", 0, popbingo_tilelayout, 256, 1 ) |
| 773 | 773 | GFXDECODE_END |
| 774 | 774 | |
| 775 | | READ8_MEMBER(dooyong_z80_ym2203_state::unk_r) |
| 775 | READ8_MEMBER(dooyong_state::unk_r) |
| 776 | 776 | { |
| 777 | 777 | return 0; |
| 778 | 778 | } |
| 779 | 779 | |
| 780 | | WRITE_LINE_MEMBER(dooyong_z80_ym2203_state::irqhandler_2203_1) |
| 780 | WRITE_LINE_MEMBER(dooyong_state::irqhandler_2203_1) |
| 781 | 781 | { |
| 782 | 782 | m_interrupt_line_1=state; |
| 783 | 783 | m_audiocpu->set_input_line(0, (m_interrupt_line_1 | m_interrupt_line_2) ? ASSERT_LINE : CLEAR_LINE); |
| 784 | 784 | } |
| 785 | 785 | |
| 786 | | WRITE_LINE_MEMBER(dooyong_z80_ym2203_state::irqhandler_2203_2) |
| 786 | WRITE_LINE_MEMBER(dooyong_state::irqhandler_2203_2) |
| 787 | 787 | { |
| 788 | 788 | m_interrupt_line_2=state; |
| 789 | 789 | m_audiocpu->set_input_line(0, (m_interrupt_line_1 | m_interrupt_line_2) ? ASSERT_LINE : CLEAR_LINE); |
| r241919 | r241920 | |
| 800 | 800 | MCFG_SPEAKER_STANDARD_MONO("mono") |
| 801 | 801 | |
| 802 | 802 | MCFG_SOUND_ADD("ym1", YM2203, 1500000) |
| 803 | | MCFG_YM2203_IRQ_HANDLER(WRITELINE(dooyong_z80_ym2203_state, irqhandler_2203_1)) |
| 804 | | MCFG_AY8910_PORT_A_READ_CB(READ8(dooyong_z80_ym2203_state, unk_r)) |
| 803 | MCFG_YM2203_IRQ_HANDLER(WRITELINE(dooyong_state,irqhandler_2203_1)) |
| 804 | MCFG_AY8910_PORT_A_READ_CB(READ8(dooyong_state, unk_r)) |
| 805 | 805 | MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.40) |
| 806 | 806 | |
| 807 | 807 | MCFG_SOUND_ADD("ym2", YM2203, 1500000) |
| 808 | | MCFG_YM2203_IRQ_HANDLER(WRITELINE(dooyong_z80_ym2203_state, irqhandler_2203_2)) |
| 809 | | MCFG_AY8910_PORT_A_READ_CB(READ8(dooyong_z80_ym2203_state, unk_r)) |
| 808 | MCFG_YM2203_IRQ_HANDLER(WRITELINE(dooyong_state, irqhandler_2203_2)) |
| 809 | MCFG_AY8910_PORT_A_READ_CB(READ8(dooyong_state, unk_r)) |
| 810 | 810 | MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.40) |
| 811 | 811 | MACHINE_CONFIG_END |
| 812 | 812 | |
| r241919 | r241920 | |
| 834 | 834 | MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.60) |
| 835 | 835 | MACHINE_CONFIG_END |
| 836 | 836 | |
| 837 | | static MACHINE_CONFIG_START( lastday, dooyong_z80_ym2203_state ) |
| 837 | static MACHINE_CONFIG_START( lastday, dooyong_state ) |
| 838 | 838 | |
| 839 | 839 | /* basic machine hardware */ |
| 840 | 840 | MCFG_CPU_ADD("maincpu", Z80, 8000000) /* ??? */ |
| r241919 | r241920 | |
| 844 | 844 | MCFG_CPU_ADD("audiocpu", Z80, 8000000) /* ??? */ |
| 845 | 845 | MCFG_CPU_PROGRAM_MAP(lastday_sound_map) |
| 846 | 846 | |
| 847 | | MCFG_MACHINE_START_OVERRIDE(dooyong_z80_state, cpu_z80) |
| 848 | | MCFG_MACHINE_RESET_OVERRIDE(dooyong_z80_ym2203_state, sound_ym2203) |
| 847 | MCFG_MACHINE_START_OVERRIDE(dooyong_state,lastday) |
| 848 | MCFG_MACHINE_RESET_OVERRIDE(dooyong_state,sound_ym2203) |
| 849 | 849 | |
| 850 | 850 | |
| 851 | 851 | /* video hardware */ |
| r241919 | r241920 | |
| 856 | 856 | MCFG_SCREEN_VBLANK_TIME(ATTOSECONDS_IN_USEC(0)) |
| 857 | 857 | MCFG_SCREEN_SIZE(64*8, 32*8) |
| 858 | 858 | MCFG_SCREEN_VISIBLE_AREA(8*8, (64-8)*8-1, 1*8, 31*8-1 ) |
| 859 | | MCFG_SCREEN_UPDATE_DRIVER(dooyong_z80_ym2203_state, screen_update_lastday) |
| 859 | MCFG_SCREEN_UPDATE_DRIVER(dooyong_state, screen_update_lastday) |
| 860 | 860 | MCFG_SCREEN_VBLANK_DEVICE("spriteram", buffered_spriteram8_device, vblank_copy_rising) |
| 861 | 861 | MCFG_SCREEN_PALETTE("palette") |
| 862 | 862 | |
| r241919 | r241920 | |
| 864 | 864 | MCFG_PALETTE_ADD("palette", 1024) |
| 865 | 865 | MCFG_PALETTE_FORMAT(xxxxBBBBGGGGRRRR) |
| 866 | 866 | |
| 867 | | MCFG_VIDEO_START_OVERRIDE(dooyong_z80_ym2203_state, lastday) |
| 867 | MCFG_VIDEO_START_OVERRIDE(dooyong_state,lastday) |
| 868 | 868 | |
| 869 | 869 | /* sound hardware */ |
| 870 | 870 | MCFG_SPEAKER_STANDARD_MONO("mono") |
| 871 | 871 | |
| 872 | 872 | MCFG_SOUND_ADD("ym1", YM2203, 4000000) |
| 873 | | MCFG_YM2203_IRQ_HANDLER(WRITELINE(dooyong_z80_ym2203_state, irqhandler_2203_1)) |
| 874 | | MCFG_AY8910_PORT_A_READ_CB(READ8(dooyong_z80_ym2203_state, unk_r)) |
| 873 | MCFG_YM2203_IRQ_HANDLER(WRITELINE(dooyong_state,irqhandler_2203_1)) |
| 874 | MCFG_AY8910_PORT_A_READ_CB(READ8(dooyong_state, unk_r)) |
| 875 | 875 | MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.40) |
| 876 | 876 | |
| 877 | 877 | MCFG_SOUND_ADD("ym2", YM2203, 4000000) |
| 878 | | MCFG_YM2203_IRQ_HANDLER(WRITELINE(dooyong_z80_ym2203_state, irqhandler_2203_2)) |
| 879 | | MCFG_AY8910_PORT_A_READ_CB(READ8(dooyong_z80_ym2203_state, unk_r)) |
| 878 | MCFG_YM2203_IRQ_HANDLER(WRITELINE(dooyong_state, irqhandler_2203_2)) |
| 879 | MCFG_AY8910_PORT_A_READ_CB(READ8(dooyong_state, unk_r)) |
| 880 | 880 | MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.40) |
| 881 | 881 | |
| 882 | 882 | MACHINE_CONFIG_END |
| 883 | 883 | |
| 884 | | static MACHINE_CONFIG_START( gulfstrm, dooyong_z80_ym2203_state ) |
| 884 | static MACHINE_CONFIG_START( gulfstrm, dooyong_state ) |
| 885 | 885 | |
| 886 | 886 | /* basic machine hardware */ |
| 887 | 887 | MCFG_CPU_ADD("maincpu", Z80, 8000000) /* ??? */ |
| r241919 | r241920 | |
| 891 | 891 | MCFG_CPU_ADD("audiocpu", Z80, 8000000) /* ??? */ |
| 892 | 892 | MCFG_CPU_PROGRAM_MAP(lastday_sound_map) |
| 893 | 893 | |
| 894 | | MCFG_MACHINE_START_OVERRIDE(dooyong_z80_state, cpu_z80) |
| 895 | | MCFG_MACHINE_RESET_OVERRIDE(dooyong_z80_ym2203_state, sound_ym2203) |
| 894 | MCFG_MACHINE_START_OVERRIDE(dooyong_state,lastday) |
| 895 | MCFG_MACHINE_RESET_OVERRIDE(dooyong_state,sound_ym2203) |
| 896 | 896 | |
| 897 | 897 | /* video hardware */ |
| 898 | 898 | MCFG_BUFFERED_SPRITERAM8_ADD("spriteram") |
| r241919 | r241920 | |
| 902 | 902 | MCFG_SCREEN_VBLANK_TIME(ATTOSECONDS_IN_USEC(2500) /* not accurate */) |
| 903 | 903 | MCFG_SCREEN_SIZE(64*8, 32*8) |
| 904 | 904 | MCFG_SCREEN_VISIBLE_AREA(8*8, (64-8)*8-1, 1*8, 31*8-1 ) |
| 905 | | MCFG_SCREEN_UPDATE_DRIVER(dooyong_z80_ym2203_state, screen_update_gulfstrm) |
| 905 | MCFG_SCREEN_UPDATE_DRIVER(dooyong_state, screen_update_gulfstrm) |
| 906 | 906 | MCFG_SCREEN_VBLANK_DEVICE("spriteram", buffered_spriteram8_device, vblank_copy_rising) |
| 907 | 907 | MCFG_SCREEN_PALETTE("palette") |
| 908 | 908 | |
| r241919 | r241920 | |
| 910 | 910 | MCFG_PALETTE_ADD("palette", 1024) |
| 911 | 911 | MCFG_PALETTE_FORMAT(xRRRRRGGGGGBBBBB) |
| 912 | 912 | |
| 913 | | MCFG_VIDEO_START_OVERRIDE(dooyong_z80_ym2203_state, gulfstrm) |
| 913 | MCFG_VIDEO_START_OVERRIDE(dooyong_state,gulfstrm) |
| 914 | 914 | |
| 915 | 915 | /* sound hardware */ |
| 916 | 916 | MCFG_FRAGMENT_ADD( sound_2203 ) |
| 917 | 917 | MACHINE_CONFIG_END |
| 918 | 918 | |
| 919 | | static MACHINE_CONFIG_START( pollux, dooyong_z80_ym2203_state ) |
| 919 | static MACHINE_CONFIG_START( pollux, dooyong_state ) |
| 920 | 920 | |
| 921 | 921 | /* basic machine hardware */ |
| 922 | 922 | MCFG_CPU_ADD("maincpu", Z80, 8000000) /* ??? */ |
| r241919 | r241920 | |
| 926 | 926 | MCFG_CPU_ADD("audiocpu", Z80, 8000000) /* ??? */ |
| 927 | 927 | MCFG_CPU_PROGRAM_MAP(pollux_sound_map) |
| 928 | 928 | |
| 929 | | MCFG_MACHINE_START_OVERRIDE(dooyong_z80_state, cpu_z80) |
| 930 | | MCFG_MACHINE_RESET_OVERRIDE(dooyong_z80_ym2203_state, sound_ym2203) |
| 929 | MCFG_MACHINE_START_OVERRIDE(dooyong_state,lastday) |
| 930 | MCFG_MACHINE_RESET_OVERRIDE(dooyong_state,sound_ym2203) |
| 931 | 931 | |
| 932 | 932 | /* video hardware */ |
| 933 | 933 | MCFG_BUFFERED_SPRITERAM8_ADD("spriteram") |
| r241919 | r241920 | |
| 937 | 937 | MCFG_SCREEN_VBLANK_TIME(ATTOSECONDS_IN_USEC(0)) |
| 938 | 938 | MCFG_SCREEN_SIZE(64*8, 32*8) |
| 939 | 939 | MCFG_SCREEN_VISIBLE_AREA(8*8, (64-8)*8-1, 1*8, 31*8-1 ) |
| 940 | | MCFG_SCREEN_UPDATE_DRIVER(dooyong_z80_ym2203_state, screen_update_pollux) |
| 940 | MCFG_SCREEN_UPDATE_DRIVER(dooyong_state, screen_update_pollux) |
| 941 | 941 | MCFG_SCREEN_VBLANK_DEVICE("spriteram", buffered_spriteram8_device, vblank_copy_rising) |
| 942 | 942 | MCFG_SCREEN_PALETTE("palette") |
| 943 | 943 | |
| r241919 | r241920 | |
| 945 | 945 | MCFG_PALETTE_ADD("palette", 1024) |
| 946 | 946 | MCFG_PALETTE_FORMAT(xRRRRRGGGGGBBBBB) |
| 947 | 947 | |
| 948 | | MCFG_VIDEO_START_OVERRIDE(dooyong_z80_ym2203_state, pollux) |
| 948 | MCFG_VIDEO_START_OVERRIDE(dooyong_state,pollux) |
| 949 | 949 | |
| 950 | 950 | /* sound hardware */ |
| 951 | 951 | MCFG_FRAGMENT_ADD( sound_2203 ) |
| 952 | 952 | MACHINE_CONFIG_END |
| 953 | 953 | |
| 954 | | static MACHINE_CONFIG_START( bluehawk, dooyong_z80_state ) |
| 954 | static MACHINE_CONFIG_START( bluehawk, dooyong_state ) |
| 955 | 955 | |
| 956 | 956 | /* basic machine hardware */ |
| 957 | 957 | MCFG_CPU_ADD("maincpu", Z80, 8000000) /* ??? */ |
| r241919 | r241920 | |
| 961 | 961 | MCFG_CPU_ADD("audiocpu", Z80, 4000000) /* ??? */ |
| 962 | 962 | MCFG_CPU_PROGRAM_MAP(bluehawk_sound_map) |
| 963 | 963 | |
| 964 | | MCFG_MACHINE_START_OVERRIDE(dooyong_z80_state, cpu_z80) |
| 964 | MCFG_MACHINE_START_OVERRIDE(dooyong_state,lastday) |
| 965 | 965 | |
| 966 | 966 | /* video hardware */ |
| 967 | 967 | MCFG_BUFFERED_SPRITERAM8_ADD("spriteram") |
| r241919 | r241920 | |
| 971 | 971 | MCFG_SCREEN_VBLANK_TIME(ATTOSECONDS_IN_USEC(0)) |
| 972 | 972 | MCFG_SCREEN_SIZE(64*8, 32*8) |
| 973 | 973 | MCFG_SCREEN_VISIBLE_AREA(8*8, (64-8)*8-1, 1*8, 31*8-1 ) |
| 974 | | MCFG_SCREEN_UPDATE_DRIVER(dooyong_z80_state, screen_update_bluehawk) |
| 974 | MCFG_SCREEN_UPDATE_DRIVER(dooyong_state, screen_update_bluehawk) |
| 975 | 975 | MCFG_SCREEN_VBLANK_DEVICE("spriteram", buffered_spriteram8_device, vblank_copy_rising) |
| 976 | 976 | MCFG_SCREEN_PALETTE("palette") |
| 977 | 977 | |
| r241919 | r241920 | |
| 979 | 979 | MCFG_PALETTE_ADD("palette", 1024) |
| 980 | 980 | MCFG_PALETTE_FORMAT(xRRRRRGGGGGBBBBB) |
| 981 | 981 | |
| 982 | | MCFG_VIDEO_START_OVERRIDE(dooyong_z80_state, bluehawk) |
| 982 | MCFG_VIDEO_START_OVERRIDE(dooyong_state,bluehawk) |
| 983 | 983 | |
| 984 | 984 | /* sound hardware */ |
| 985 | 985 | MCFG_FRAGMENT_ADD( sound_2151 ) |
| 986 | 986 | MACHINE_CONFIG_END |
| 987 | 987 | |
| 988 | | static MACHINE_CONFIG_START( flytiger, dooyong_z80_state ) |
| 988 | static MACHINE_CONFIG_START( flytiger, dooyong_state ) |
| 989 | 989 | |
| 990 | 990 | /* basic machine hardware */ |
| 991 | 991 | MCFG_CPU_ADD("maincpu", Z80, 8000000) /* ??? */ |
| r241919 | r241920 | |
| 995 | 995 | MCFG_CPU_ADD("audiocpu", Z80, 4000000) /* ??? */ |
| 996 | 996 | MCFG_CPU_PROGRAM_MAP(bluehawk_sound_map) |
| 997 | 997 | |
| 998 | | MCFG_MACHINE_START_OVERRIDE(dooyong_z80_state, cpu_z80) |
| 998 | MCFG_MACHINE_START_OVERRIDE(dooyong_state,lastday) |
| 999 | 999 | |
| 1000 | 1000 | /* video hardware */ |
| 1001 | 1001 | MCFG_BUFFERED_SPRITERAM8_ADD("spriteram") |
| r241919 | r241920 | |
| 1005 | 1005 | MCFG_SCREEN_VBLANK_TIME(ATTOSECONDS_IN_USEC(0)) |
| 1006 | 1006 | MCFG_SCREEN_SIZE(64*8, 32*8) |
| 1007 | 1007 | MCFG_SCREEN_VISIBLE_AREA(8*8, (64-8)*8-1, 1*8, 31*8-1 ) |
| 1008 | | MCFG_SCREEN_UPDATE_DRIVER(dooyong_z80_state, screen_update_flytiger) |
| 1008 | MCFG_SCREEN_UPDATE_DRIVER(dooyong_state, screen_update_flytiger) |
| 1009 | 1009 | MCFG_SCREEN_VBLANK_DEVICE("spriteram", buffered_spriteram8_device, vblank_copy_rising) |
| 1010 | 1010 | MCFG_SCREEN_PALETTE("palette") |
| 1011 | 1011 | |
| r241919 | r241920 | |
| 1013 | 1013 | MCFG_PALETTE_ADD("palette", 1024) |
| 1014 | 1014 | MCFG_PALETTE_FORMAT(xRRRRRGGGGGBBBBB) |
| 1015 | 1015 | |
| 1016 | | MCFG_VIDEO_START_OVERRIDE(dooyong_z80_state, flytiger) |
| 1016 | MCFG_VIDEO_START_OVERRIDE(dooyong_state,flytiger) |
| 1017 | 1017 | |
| 1018 | 1018 | /* sound hardware */ |
| 1019 | 1019 | MCFG_FRAGMENT_ADD( sound_2151 ) |
| 1020 | 1020 | MACHINE_CONFIG_END |
| 1021 | 1021 | |
| 1022 | | static MACHINE_CONFIG_START( primella, dooyong_z80_state ) |
| 1022 | static MACHINE_CONFIG_START( primella, dooyong_state ) |
| 1023 | 1023 | |
| 1024 | 1024 | /* basic machine hardware */ |
| 1025 | 1025 | MCFG_CPU_ADD("maincpu", Z80, 8000000) /* ??? */ |
| r241919 | r241920 | |
| 1029 | 1029 | MCFG_CPU_ADD("audiocpu", Z80, 4000000) /* ??? */ |
| 1030 | 1030 | MCFG_CPU_PROGRAM_MAP(bluehawk_sound_map) |
| 1031 | 1031 | |
| 1032 | | MCFG_MACHINE_START_OVERRIDE(dooyong_z80_state, cpu_z80) |
| 1032 | MCFG_MACHINE_START_OVERRIDE(dooyong_state,lastday) |
| 1033 | 1033 | |
| 1034 | 1034 | /* video hardware */ |
| 1035 | 1035 | MCFG_SCREEN_ADD("screen", RASTER) |
| r241919 | r241920 | |
| 1037 | 1037 | MCFG_SCREEN_VBLANK_TIME(ATTOSECONDS_IN_USEC(0)) |
| 1038 | 1038 | MCFG_SCREEN_SIZE(64*8, 32*8) |
| 1039 | 1039 | MCFG_SCREEN_VISIBLE_AREA(8*8, (64-8)*8-1, 0*8, 32*8-1 ) |
| 1040 | | MCFG_SCREEN_UPDATE_DRIVER(dooyong_z80_state, screen_update_primella) |
| 1040 | MCFG_SCREEN_UPDATE_DRIVER(dooyong_state, screen_update_primella) |
| 1041 | 1041 | MCFG_SCREEN_PALETTE("palette") |
| 1042 | 1042 | |
| 1043 | 1043 | MCFG_GFXDECODE_ADD("gfxdecode", "palette", primella) |
| 1044 | 1044 | MCFG_PALETTE_ADD("palette", 1024) |
| 1045 | 1045 | MCFG_PALETTE_FORMAT(xRRRRRGGGGGBBBBB) |
| 1046 | 1046 | |
| 1047 | | MCFG_VIDEO_START_OVERRIDE(dooyong_z80_state, primella) |
| 1047 | MCFG_VIDEO_START_OVERRIDE(dooyong_state,primella) |
| 1048 | 1048 | |
| 1049 | 1049 | /* sound hardware */ |
| 1050 | 1050 | MCFG_FRAGMENT_ADD( sound_2151 ) |
| 1051 | 1051 | MACHINE_CONFIG_END |
| 1052 | 1052 | |
| 1053 | | |
| 1054 | | TIMER_DEVICE_CALLBACK_MEMBER(dooyong_68k_state::scanline) |
| 1053 | TIMER_DEVICE_CALLBACK_MEMBER(dooyong_state::rshark_scanline) |
| 1055 | 1054 | { |
| 1056 | 1055 | int scanline = param; |
| 1057 | 1056 | |
| 1058 | | if (scanline == 248) // vblank-out irq |
| 1057 | if(scanline == 248) // vblank-out irq |
| 1059 | 1058 | m_maincpu->set_input_line(5, HOLD_LINE); |
| 1060 | 1059 | |
| 1061 | | if (scanline == 120) // timer irq? |
| 1060 | if(scanline == 120) // timer irq? |
| 1062 | 1061 | m_maincpu->set_input_line(6, HOLD_LINE); |
| 1063 | 1062 | } |
| 1064 | 1063 | |
| 1065 | 1064 | |
| 1066 | | static MACHINE_CONFIG_START( rshark, dooyong_68k_state ) |
| 1065 | static MACHINE_CONFIG_START( rshark, dooyong_state ) |
| 1067 | 1066 | |
| 1068 | 1067 | /* basic machine hardware */ |
| 1069 | 1068 | MCFG_CPU_ADD("maincpu", M68000, 8000000) /* measured on super-x */ |
| 1070 | 1069 | MCFG_CPU_PROGRAM_MAP(rshark_map) |
| 1071 | | MCFG_TIMER_DRIVER_ADD_SCANLINE("scantimer", dooyong_68k_state, scanline, "screen", 0, 1) |
| 1070 | MCFG_TIMER_DRIVER_ADD_SCANLINE("scantimer", dooyong_state, rshark_scanline, "screen", 0, 1) |
| 1072 | 1071 | |
| 1073 | 1072 | MCFG_CPU_ADD("audiocpu", Z80, 4000000) /* measured on super-x */ |
| 1074 | 1073 | MCFG_CPU_PROGRAM_MAP(bluehawk_sound_map) |
| 1075 | 1074 | |
| 1076 | 1075 | /* video hardware */ |
| 1077 | | MCFG_BUFFERED_SPRITERAM16_ADD("spriteram") |
| 1076 | MCFG_BUFFERED_SPRITERAM16_ADD("spriteram16") |
| 1078 | 1077 | |
| 1079 | 1078 | MCFG_SCREEN_ADD("screen", RASTER) |
| 1080 | 1079 | MCFG_SCREEN_REFRESH_RATE(60) |
| 1081 | 1080 | MCFG_SCREEN_VBLANK_TIME(ATTOSECONDS_IN_USEC(0)) |
| 1082 | 1081 | MCFG_SCREEN_SIZE(64*8, 32*8) |
| 1083 | 1082 | MCFG_SCREEN_VISIBLE_AREA(8*8, (64-8)*8-1, 1*8, 31*8-1 ) |
| 1084 | | MCFG_SCREEN_UPDATE_DRIVER(dooyong_68k_state, screen_update_rshark) |
| 1085 | | MCFG_SCREEN_VBLANK_DEVICE("spriteram", buffered_spriteram16_device, vblank_copy_rising) |
| 1083 | MCFG_SCREEN_UPDATE_DRIVER(dooyong_state, screen_update_rshark) |
| 1084 | MCFG_SCREEN_VBLANK_DEVICE("spriteram16", buffered_spriteram16_device, vblank_copy_rising) |
| 1086 | 1085 | MCFG_SCREEN_PALETTE("palette") |
| 1087 | 1086 | |
| 1088 | 1087 | MCFG_GFXDECODE_ADD("gfxdecode", "palette", rshark) |
| 1089 | 1088 | MCFG_PALETTE_ADD("palette", 2048) |
| 1090 | 1089 | MCFG_PALETTE_FORMAT(xRRRRRGGGGGBBBBB) |
| 1091 | 1090 | |
| 1092 | | MCFG_VIDEO_START_OVERRIDE(dooyong_68k_state, rshark) |
| 1091 | MCFG_VIDEO_START_OVERRIDE(dooyong_state,rshark) |
| 1093 | 1092 | |
| 1094 | 1093 | /* sound hardware */ |
| 1095 | 1094 | MCFG_FRAGMENT_ADD( sound_2151_m68k ) |
| 1096 | 1095 | MACHINE_CONFIG_END |
| 1097 | 1096 | |
| 1098 | | static MACHINE_CONFIG_START( superx, dooyong_68k_state ) // dif mem map |
| 1097 | static MACHINE_CONFIG_START( superx, dooyong_state ) // dif mem map |
| 1099 | 1098 | |
| 1100 | 1099 | /* basic machine hardware */ |
| 1101 | 1100 | MCFG_CPU_ADD("maincpu", M68000, 8000000) /* measured on super-x */ |
| 1102 | 1101 | MCFG_CPU_PROGRAM_MAP(superx_map) |
| 1103 | | MCFG_TIMER_DRIVER_ADD_SCANLINE("scantimer", dooyong_68k_state, scanline, "screen", 0, 1) |
| 1102 | MCFG_TIMER_DRIVER_ADD_SCANLINE("scantimer", dooyong_state, rshark_scanline, "screen", 0, 1) |
| 1104 | 1103 | |
| 1105 | 1104 | MCFG_CPU_ADD("audiocpu", Z80, 4000000) /* measured on super-x */ |
| 1106 | 1105 | MCFG_CPU_PROGRAM_MAP(bluehawk_sound_map) |
| 1107 | 1106 | |
| 1108 | 1107 | /* video hardware */ |
| 1109 | | MCFG_BUFFERED_SPRITERAM16_ADD("spriteram") |
| 1108 | MCFG_BUFFERED_SPRITERAM16_ADD("spriteram16") |
| 1110 | 1109 | |
| 1111 | 1110 | MCFG_SCREEN_ADD("screen", RASTER) |
| 1112 | 1111 | MCFG_SCREEN_REFRESH_RATE(60) |
| 1113 | 1112 | MCFG_SCREEN_VBLANK_TIME(ATTOSECONDS_IN_USEC(0)) |
| 1114 | 1113 | MCFG_SCREEN_SIZE(64*8, 32*8) |
| 1115 | 1114 | MCFG_SCREEN_VISIBLE_AREA(8*8, (64-8)*8-1, 1*8, 31*8-1 ) |
| 1116 | | MCFG_SCREEN_UPDATE_DRIVER(dooyong_68k_state, screen_update_rshark) |
| 1117 | | MCFG_SCREEN_VBLANK_DEVICE("spriteram", buffered_spriteram16_device, vblank_copy_rising) |
| 1115 | MCFG_SCREEN_UPDATE_DRIVER(dooyong_state, screen_update_rshark) |
| 1116 | MCFG_SCREEN_VBLANK_DEVICE("spriteram16", buffered_spriteram16_device, vblank_copy_rising) |
| 1118 | 1117 | MCFG_SCREEN_PALETTE("palette") |
| 1119 | 1118 | |
| 1120 | 1119 | MCFG_GFXDECODE_ADD("gfxdecode", "palette", rshark) |
| 1121 | 1120 | MCFG_PALETTE_ADD("palette", 2048) |
| 1122 | 1121 | MCFG_PALETTE_FORMAT(xRRRRRGGGGGBBBBB) |
| 1123 | 1122 | |
| 1124 | | MCFG_VIDEO_START_OVERRIDE(dooyong_68k_state, rshark) |
| 1123 | MCFG_VIDEO_START_OVERRIDE(dooyong_state,rshark) |
| 1125 | 1124 | |
| 1126 | 1125 | /* sound hardware */ |
| 1127 | 1126 | MCFG_FRAGMENT_ADD( sound_2151_m68k ) |
| 1128 | 1127 | MACHINE_CONFIG_END |
| 1129 | 1128 | |
| 1130 | | static MACHINE_CONFIG_START( popbingo, dooyong_68k_state ) |
| 1129 | static MACHINE_CONFIG_START( popbingo, dooyong_state ) |
| 1131 | 1130 | |
| 1132 | 1131 | /* basic machine hardware */ |
| 1133 | 1132 | MCFG_CPU_ADD("maincpu", M68000, 10000000) |
| 1134 | 1133 | MCFG_CPU_PROGRAM_MAP(popbingo_map) |
| 1135 | | MCFG_TIMER_DRIVER_ADD_SCANLINE("scantimer", dooyong_68k_state, scanline, "screen", 0, 1) |
| 1134 | MCFG_TIMER_DRIVER_ADD_SCANLINE("scantimer", dooyong_state, rshark_scanline, "screen", 0, 1) |
| 1136 | 1135 | |
| 1137 | 1136 | MCFG_CPU_ADD("audiocpu", Z80, 4000000) /* measured on super-x */ |
| 1138 | 1137 | MCFG_CPU_PROGRAM_MAP(bluehawk_sound_map) |
| 1139 | 1138 | |
| 1140 | 1139 | /* video hardware */ |
| 1141 | | MCFG_BUFFERED_SPRITERAM16_ADD("spriteram") |
| 1140 | MCFG_BUFFERED_SPRITERAM16_ADD("spriteram16") |
| 1142 | 1141 | |
| 1143 | 1142 | MCFG_SCREEN_ADD("screen", RASTER) |
| 1144 | 1143 | MCFG_SCREEN_REFRESH_RATE(60) |
| 1145 | 1144 | MCFG_SCREEN_VBLANK_TIME(ATTOSECONDS_IN_USEC(0)) |
| 1146 | 1145 | MCFG_SCREEN_SIZE(64*8, 32*8) |
| 1147 | 1146 | MCFG_SCREEN_VISIBLE_AREA(8*8, (64-8)*8-1, 1*8, 31*8-1 ) |
| 1148 | | MCFG_SCREEN_UPDATE_DRIVER(dooyong_68k_state, screen_update_popbingo) |
| 1149 | | MCFG_SCREEN_VBLANK_DEVICE("spriteram", buffered_spriteram16_device, vblank_copy_rising) |
| 1147 | MCFG_SCREEN_UPDATE_DRIVER(dooyong_state, screen_update_popbingo) |
| 1148 | MCFG_SCREEN_VBLANK_DEVICE("spriteram16", buffered_spriteram16_device, vblank_copy_rising) |
| 1150 | 1149 | MCFG_SCREEN_PALETTE("palette") |
| 1151 | 1150 | |
| 1152 | 1151 | MCFG_GFXDECODE_ADD("gfxdecode", "palette", popbingo) |
| 1153 | 1152 | MCFG_PALETTE_ADD("palette", 2048) |
| 1154 | 1153 | MCFG_PALETTE_FORMAT(xRRRRRGGGGGBBBBB) |
| 1155 | 1154 | |
| 1156 | | MCFG_VIDEO_START_OVERRIDE(dooyong_68k_state, popbingo) |
| 1155 | MCFG_VIDEO_START_OVERRIDE(dooyong_state,popbingo) |
| 1157 | 1156 | |
| 1158 | 1157 | /* sound hardware */ |
| 1159 | 1158 | MCFG_FRAGMENT_ADD( sound_2151_m68k ) |
trunk/src/mame/drivers/meritm.c
| r241919 | r241920 | |
| 94 | 94 | Pit Boss Superstar III 30 (c)1993 |
| 95 | 95 | Pit Boss Megastar (c)1994 |
| 96 | 96 | Pit Boss Supertouch 30 (c)1993/4 |
| 97 | | Pit Boss Megatouch (c)1994 |
| 98 | 97 | |
| 99 | 98 | Custom Program Versions (Superstar 30 / Supertouch 30): |
| 100 | 99 | |
| r241919 | r241920 | |
| 110 | 109 | |
| 111 | 110 | |
| 112 | 111 | CRT-260: |
| 112 | *Megatouch Video (c)1994? |
| 113 | 113 | Megatouch II (c)1994 |
| 114 | 114 | Megatouch III (c)1995 |
| 115 | 115 | Megatouch III Tournament Edition (c)1996 |
| r241919 | r241920 | |
| 1191 | 1191 | The Touchscreen Calibration routine doesn't seem to work? |
| 1192 | 1192 | |
| 1193 | 1193 | */ |
| 1194 | |
| 1194 | 1195 | ROM_START( mtjpoker ) /* Uses the CRT-258 touch controller board & Dallas DS1225Y NV SRAM */ |
| 1195 | 1196 | ROM_REGION( 0x80000, "maincpu", 0 ) |
| 1196 | 1197 | ROM_LOAD( "9132-00-02_u9-r0.u9", 0x00000, 0x10000, CRC(4ec683b6) SHA1(7cff76ba1517deede3dfa2a419e11fd603dcf695) ) /* 9132-00-02 R0 46 940416 */ |
| r241919 | r241920 | |
| 1212 | 1213 | Hold5 advances through the list. |
| 1213 | 1214 | Hi-Score will clear the High Scores |
| 1214 | 1215 | |
| 1215 | | Is the "Stand" & "Hi-Score" keys the same? Without a separate Stand key, you cannot set up the "TWIN" bonus feature |
| 1216 | Is the "Stand" & "Hi-Score" keys the same? Without a sperate Stand key, you cannot set up the "TWIN" bonus feature |
| 1216 | 1217 | |
| 1217 | 1218 | */ |
| 1219 | |
| 1218 | 1220 | ROM_START( americna ) /* Uses a small daughter card CRT-251 & Dallas DS1225Y NV SRAM */ |
| 1219 | 1221 | ROM_REGION( 0x80000, "maincpu", 0 ) |
| 1220 | 1222 | ROM_LOAD( "9131-00_u9-2.u9", 0x00000, 0x10000, CRC(8a741fb6) SHA1(2d77c67e5a0bdaf6199c31c4055df214672db3e1) ) /* 9131-00 U9-2 888020 */ |
| r241919 | r241920 | |
| 1229 | 1231 | ROM_LOAD( "9131-02_u11-0.u11", 0x20000, 0x10000, CRC(f137d70c) SHA1(8ec04ec17300aa3a6ef14bcca1ca1c2aec0eea18) ) |
| 1230 | 1232 | ROM_END |
| 1231 | 1233 | |
| 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 | |
| 1232 | 1259 | ROM_START( pitboss2 ) |
| 1233 | 1260 | ROM_REGION( 0x80000, "maincpu", 0 ) |
| 1234 | 1261 | ROM_LOAD( "9221-01_u9-0c.u9", 0x00000, 0x10000, CRC(a1b6ac15) SHA1(b7b395f3e7e14dbb84003e03bf7d054e795a7211) ) /* 9221-01C 880221 */ |
| r241919 | r241920 | |
| 1243 | 1270 | |
| 1244 | 1271 | ROM_START( spitboss ) |
| 1245 | 1272 | ROM_REGION( 0x80000, "maincpu", 0 ) |
| 1246 | | ROM_LOAD( "9221-02_u9-0a.u9", 0x00000, 0x10000, CRC(e0c45c9c) SHA1(534bff67c8fee08f1c348275de8977659efa9f69) ) /* 9221-02A 886021 */ |
| 1273 | ROM_LOAD( "9221-02_u9-0a.u9", 0x00000, 0x10000, CRC(e0c45c9c) SHA1(534bff67c8fee08f1c348275de8977659efa9f69) ) /* 9221-02A 886021 (actual, but should be 880621) */ |
| 1247 | 1274 | ROM_LOAD( "9221-02_u10-0.u10", 0x10000, 0x10000, CRC(ed010c58) SHA1(02750944a28c1c27ce2a9904d11b7e46272a940e) ) |
| 1248 | 1275 | ROM_LOAD( "9221-02_u11-0a.u11", 0x20000, 0x10000, CRC(0c65fa86) SHA1(7906a8d615116ca67bf370dfb2da8cb2389a313d) ) |
| 1249 | 1276 | ROM_LOAD( "9221-02_u12-0.u12", 0x30000, 0x10000, CRC(0cf95b0e) SHA1(c6ffc13703892b9ae0da39a02db37c4ec890f79e) ) |
| r241919 | r241920 | |
| 1267 | 1294 | |
| 1268 | 1295 | ROM_START( pitbosssa ) |
| 1269 | 1296 | ROM_REGION( 0x80000, "maincpu", 0 ) |
| 1270 | | ROM_LOAD( "9221-10_u9-0a.u9", 0x00000, 0x10000, CRC(41be6b30) SHA1(c4df87a599e310ce29ee9277e5adc916ff68f060) ) /* 9221-10-00A 090370 */ |
| 1297 | ROM_LOAD( "9221-10_u9-0a.u9", 0x00000, 0x10000, CRC(41be6b30) SHA1(c4df87a599e310ce29ee9277e5adc916ff68f060) ) /* 9221-10-00A 090370 (actual, but should be 090390) */ |
| 1271 | 1298 | ROM_LOAD( "9221-10_u10-0.u10", 0x10000, 0x10000, CRC(853a1a99) SHA1(45e33442aa7e51c05c9ac8b8458937ee3ff4c21d) ) |
| 1272 | 1299 | ROM_LOAD( "9221-10_u11-0a.u11", 0x20000, 0x10000, CRC(c9137469) SHA1(618680609bdffa92b919a2417bd3ec41a4c8bf2b) ) |
| 1273 | 1300 | ROM_LOAD( "9221-10_u12-0.u12", 0x30000, 0x10000, CRC(3577a203) SHA1(80f9c827ad9dea2c6af788bd3b46ab65e8c594eb) ) |
| r241919 | r241920 | |
| 1303 | 1330 | ROM_LOAD( "9233-00-01_u15-r0", 0x60000, 0x10000, CRC(5810840e) SHA1(bad6457752ac212c3c11360a13a8d3473662a287) ) |
| 1304 | 1331 | |
| 1305 | 1332 | ROM_REGION( 0x000022, "ds1204", 0 ) |
| 1306 | | ROM_LOAD( "9233-01_u1-r01_c1993_mii", 0x000000, 0x000022, BAD_DUMP CRC(93459659) SHA1(73ad4c3a7c52d3db3acb43662c535f8c2ed2376a) ) |
| 1333 | ROM_LOAD( "9233-01_u1-ro1_c1993_mii", 0x000000, 0x000022, BAD_DUMP CRC(93459659) SHA1(73ad4c3a7c52d3db3acb43662c535f8c2ed2376a) ) |
| 1307 | 1334 | |
| 1308 | 1335 | ROM_REGION( 0xc0000, "extra", 0 ) // question roms |
| 1309 | 1336 | ROM_LOAD( "qs9233-01_u7-r0", 0x00000, 0x40000, CRC(176dd688) SHA1(306cf78101219ef1122023a01d16dff5e9f2aecf) ) /* These 3 roms are on CRT-256 sattalite PCB */ |
| r241919 | r241920 | |
| 1311 | 1338 | ROM_LOAD( "qs9233-01_u5-r0", 0x80000, 0x40000, CRC(740b1274) SHA1(14eab68fc137b905a5a2739c7081900a48cba562) ) |
| 1312 | 1339 | ROM_END |
| 1313 | 1340 | |
| 1314 | | /* |
| 1315 | | Basically 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 | | |
| 1318 | | NOTE: 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 | | */ |
| 1321 | | ROM_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) ) |
| 1338 | | ROM_END |
| 1339 | | |
| 1340 | 1341 | ROM_START( pbst30 ) /* Dallas DS1204V security key attached to CRT-254 connected to J2 connector labeled 9234-10 U1-RO1 C1994 MII */ |
| 1341 | 1342 | ROM_REGION( 0x80000, "maincpu", 0 ) |
| 1342 | 1343 | ROM_LOAD( "9234-10-01_u9-r0", 0x00000, 0x10000, CRC(96f39c9a) SHA1(df698e94a5204cf050ceadc5c257ca5f68171114) ) /* 9234-10-01 032294 */ |
| r241919 | r241920 | |
| 1348 | 1349 | ROM_LOAD( "9234-10-01_u15-r0", 0x60000, 0x10000, CRC(9fbd8582) SHA1(c0f68c8a7cdca34c8736cefc71767c421bcaba8a) ) |
| 1349 | 1350 | |
| 1350 | 1351 | ROM_REGION( 0x000022, "ds1204", 0 ) |
| 1351 | | ROM_LOAD( "9234-10_u1-r01_c1994_mii", 0x000000, 0x000022, BAD_DUMP CRC(1c782f78) SHA1(8255afcffbe21a43f53cfb41867552681403ea47) ) |
| 1352 | ROM_LOAD( "9234-10_u1-ro1_c1994_mii", 0x000000, 0x000022, BAD_DUMP CRC(1c782f78) SHA1(8255afcffbe21a43f53cfb41867552681403ea47) ) |
| 1352 | 1353 | |
| 1353 | 1354 | ROM_REGION( 0xc0000, "extra", 0 ) // question roms |
| 1354 | 1355 | ROM_LOAD( "qs9234-01_u7-r0", 0x00000, 0x40000, CRC(c0534aaa) SHA1(4b3cbf03f29fd5b4b8fd423e73c0c8147692fa75) ) /* These 3 roms are on CRT-256 sattalite PCB */ |
| r241919 | r241920 | |
| 1356 | 1357 | ROM_LOAD( "qs9234-01_u5-r0", 0x80000, 0x40000, CRC(293fe305) SHA1(8a551ae8fb4fa4bf329128be1bfd6f1c3ff5a366) ) |
| 1357 | 1358 | ROM_END |
| 1358 | 1359 | |
| 1359 | | ROM_START( pbst30a ) /* Dallas DS1204V security key attached to CRT-254 connected to J2 connector labeled 9234-01 U1-RO1 C1993 MII */ |
| 1360 | ROM_START( pbst30b ) /* Dallas DS1204V security key attached to CRT-254 connected to J2 connector labeled 9234-01 U1-RO1 C1993 MII */ |
| 1360 | 1361 | ROM_REGION( 0x80000, "maincpu", 0 ) |
| 1361 | 1362 | ROM_LOAD( "9234-00-01_u9-r0a", 0x00000, 0x10000, CRC(5f058f95) SHA1(98382935340a076bdb1b20c7f16c25b6084599fe) ) /* 9234-00-01 122293 */ |
| 1362 | 1363 | ROM_LOAD( "9234-00-01_u10-r0", 0x10000, 0x10000, CRC(853a1a99) SHA1(45e33442aa7e51c05c9ac8b8458937ee3ff4c21d) ) |
| r241919 | r241920 | |
| 1367 | 1368 | ROM_LOAD( "9234-00-01_u15-r0a", 0x60000, 0x10000, CRC(f10f0d39) SHA1(2b5d5a93adb5251e09160b10c067b6e70289f608) ) |
| 1368 | 1369 | |
| 1369 | 1370 | ROM_REGION( 0x000022, "ds1204", 0 ) |
| 1370 | | ROM_LOAD( "9234-01_u1-r01_c1993_mii", 0x000000, 0x000022, BAD_DUMP CRC(74bf0546) SHA1(eb44a057cf797279ee3456a74e166fa711547ea4) ) |
| 1371 | ROM_LOAD( "9234-01_u1-ro1_c1993_mii", 0x000000, 0x000022, BAD_DUMP CRC(74bf0546) SHA1(eb44a057cf797279ee3456a74e166fa711547ea4) ) |
| 1371 | 1372 | |
| 1372 | 1373 | ROM_REGION( 0xc0000, "extra", 0 ) // question roms |
| 1373 | 1374 | ROM_LOAD( "qs9234-01_u7-r0", 0x00000, 0x40000, CRC(c0534aaa) SHA1(4b3cbf03f29fd5b4b8fd423e73c0c8147692fa75) ) /* These 3 roms are on CRT-256 sattalite PCB */ |
| r241919 | r241920 | |
| 1386 | 1387 | ROM_LOAD( "9243-00-01_u15-r0", 0x60000, 0x10000, CRC(27034061) SHA1(cff6be592a4a3ab01c204b081470f224e6186c4d) ) |
| 1387 | 1388 | ROM_RELOAD( 0x70000, 0x10000) |
| 1388 | 1389 | |
| 1390 | |
| 1389 | 1391 | ROM_REGION( 0xc0000, "extra", 0 ) // question roms |
| 1390 | 1392 | ROM_LOAD( "qs9243-00-01_u7-r0", 0x00000, 0x40000, CRC(35f4ca46) SHA1(87917b3017f505fae65d6bfa2c7d6fb503c2da6a) ) /* These 3 roms are on CRT-256 sattalite PCB */ |
| 1391 | 1393 | ROM_LOAD( "qs9243-00-01_u6-r0", 0x40000, 0x40000, CRC(606f1656) SHA1(7f1e3a698a34d3c3b8f9f2cd8d5224b6c096e941) ) |
| r241919 | r241920 | |
| 1424 | 1426 | 1- Great Draw Poker and 7 Stud Poker have been added to the program set |
| 1425 | 1427 | 2- On page 3-1 legend artwork has changed. PASS has been replaced with |
| 1426 | 1428 | PASS/PLAY and COLLECT/QUIT has been replaced with COLLECT/QUIT/RAISE |
| 1427 | | 3- 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 |
| 1429 | 3- 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 |
| 1429 | 1431 | players use. |
| 1430 | 1432 | |
| 1431 | 1433 | */ |
| 1434 | |
| 1432 | 1435 | ROM_START( pitbossm ) /* Dallas DS1204V security key attached to CRT-254 connected to J2 connector labeled 9244-00 U1-RO1 C1994 MII */ |
| 1433 | 1436 | ROM_REGION( 0x80000, "maincpu", 0 ) |
| 1434 | 1437 | ROM_LOAD( "9244-00-01_u9-r0", 0x00000, 0x10000, CRC(8317fea1) SHA1(eb84fdca7cd51883153561785571790d12d0d612) ) /* 9244-00-01 R0 940822 */ |
| r241919 | r241920 | |
| 1488 | 1491 | It's currently unknown how to access / enable those features or if it's possible to do so. |
| 1489 | 1492 | |
| 1490 | 1493 | */ |
| 1494 | |
| 1491 | 1495 | ROM_START( realbrod ) /* Dallas DS1204U-3 security key labeled 9131-20-00-U5-R0A */ |
| 1492 | 1496 | ROM_REGION( 0x400000, "maincpu", 0 ) |
| 1493 | 1497 | /* U32 Empty */ |
| r241919 | r241920 | |
| 1518 | 1522 | one PC16550DN |
| 1519 | 1523 | one PB255a or L5220574 |
| 1520 | 1524 | One Dallas DS1204 Data Key |
| 1521 | | One Dallas DS1225Y 64k Non-volatile SRAM (Mega Touch 4) |
| 1522 | | or Dallas DS1230Y 256K Non-volatile SRAM (Mega Touch 6) |
| 1525 | One Dallas DS1225Y 64k Non-volitile SRAM (Mega Touch 4) |
| 1526 | or Dallas DS1230Y 256K Non-volitile SRAM (Mega Touch 6) |
| 1523 | 1527 | or Dallas DS1644 32K NVRAM + RTC (Tournament sets) |
| 1524 | 1528 | Two Z80APIO (Z0842004PSC) |
| 1525 | 1529 | |
| r241919 | r241920 | |
| 2288 | 2292 | |
| 2289 | 2293 | /* CRT-250 + CRT-252 + CRT-256 + CRT-258 */ |
| 2290 | 2294 | GAME( 1994, mtjpoker, 0, meritm_crt250_crt252_crt258, mtjpoker, driver_device, 0, ROT0, "Merit", "Merit Touch Joker Poker (9132-00)", GAME_IMPERFECT_GRAPHICS ) |
| 2291 | | GAME( 1994, megat, 0, meritm_crt250_crt252_crt258, pbst30, driver_device, 0, ROT0, "Merit", "Pit Boss Megatouch (9234-20-01)", GAME_IMPERFECT_GRAPHICS ) |
| 2292 | 2295 | GAME( 1994, pbst30, 0, meritm_crt250_crt252_crt258, pbst30, driver_device, 0, ROT0, "Merit", "Pit Boss Supertouch 30 (9234-10-01)", GAME_IMPERFECT_GRAPHICS ) |
| 2293 | | GAME( 1993, pbst30a, pbst30, meritm_crt250_crt252_crt258, pbst30, driver_device, 0, ROT0, "Merit", "Pit Boss Supertouch 30 (9234-00-01)", GAME_IMPERFECT_GRAPHICS ) |
| 2296 | GAME( 1993, pbst30b, pbst30, meritm_crt250_crt252_crt258, pbst30, driver_device, 0, ROT0, "Merit", "Pit Boss Supertouch 30 (9234-00-01)", GAME_IMPERFECT_GRAPHICS ) |
| 2294 | 2297 | |
| 2295 | 2298 | /* CRT-250 + CRT-254 + CRT-256 */ |
| 2296 | 2299 | GAME( 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
| r241919 | r241920 | |
| 2661 | 2661 | */ |
| 2662 | 2662 | |
| 2663 | 2663 | static MACHINE_CONFIG_DERIVED( naomim4, naomi_base ) |
| 2664 | | MCFG_NAOMI_M4_BOARD_ADD("rom_board", ":pic_readout", "naomibd_eeprom", ":boardid", WRITE8(dc_state, g1_irq)) |
| 2664 | MCFG_NAOMI_M4_BOARD_ADD("rom_board", ":rom_key", "naomibd_eeprom", ":boardid", WRITE8(dc_state, g1_irq)) |
| 2665 | 2665 | MACHINE_CONFIG_END |
| 2666 | 2666 | |
| 2667 | 2667 | /* |
| r241919 | r241920 | |
| 5597 | 5597 | ROM_LOAD( "fpr-24333.ic8", 0x0000000, 0x4000000, CRC(a467b69c) SHA1(66a841b72ef1bb8cbabbfb1d14081b4dff14b1d3) ) |
| 5598 | 5598 | ROM_LOAD( "fpr-24334.ic9", 0x4000000, 0x4000000, CRC(13d2d1dc) SHA1(6a47cfaddf006e6ff46837fac956fbcc20619d79) ) |
| 5599 | 5599 | |
| 5600 | | // ROM_REGION( 4, "rom_key", 0 ) |
| 5601 | | // ROM_LOAD( "mushik2e-key.bin", 0, 4, CRC(b32a0633) SHA1(984c01e43cf359d8e8a0c6cb1a04c5dc3da47d39) ) |
| 5602 | | ROM_REGION( 20, "pic_readout", 0 ) // data obtained using a custom PIC reader |
| 5603 | | ROM_LOAD( "317-0437-com.ic3", 0, 20, NO_DUMP ) |
| 5600 | ROM_REGION( 4, "rom_key", 0 ) |
| 5601 | ROM_LOAD( "mushik2e-key.bin", 0, 4, CRC(b32a0633) SHA1(984c01e43cf359d8e8a0c6cb1a04c5dc3da47d39) ) |
| 5604 | 5602 | |
| 5605 | 5603 | ROM_REGION(0x4, "boardid", ROMREGION_ERASEVAL(0x02)) |
| 5606 | 5604 | ROM_END |
| r241919 | r241920 | |
| 5614 | 5612 | ROM_LOAD( "epr-24357.ic7", 0x0000000, 0x0400000, CRC(a2236d58) SHA1(3746b9d3c0f7ecf6340619bb8bf01f170ac4efb7) ) // EPR mode, overwrite FPR data |
| 5615 | 5613 | ROM_LOAD( "fpr-24334.ic9", 0x4000000, 0x4000000, CRC(13d2d1dc) SHA1(6a47cfaddf006e6ff46837fac956fbcc20619d79) ) |
| 5616 | 5614 | |
| 5617 | | // ROM_REGION( 4, "rom_key", 0 ) |
| 5618 | | // ROM_LOAD( "mushik2e-key.bin", 0, 4, CRC(b32a0633) SHA1(984c01e43cf359d8e8a0c6cb1a04c5dc3da47d39) ) |
| 5619 | | ROM_REGION( 20, "pic_readout", 0 ) // data obtained using a custom PIC reader |
| 5620 | | ROM_LOAD( "317-0437-com.ic3", 0, 20, NO_DUMP ) |
| 5615 | ROM_REGION( 4, "rom_key", 0 ) |
| 5616 | ROM_LOAD( "mushik2e-key.bin", 0, 4, CRC(b32a0633) SHA1(984c01e43cf359d8e8a0c6cb1a04c5dc3da47d39) ) |
| 5621 | 5617 | |
| 5622 | 5618 | ROM_REGION(0x4, "boardid", ROMREGION_ERASEVAL(0x82)) |
| 5623 | 5619 | ROM_END |
| r241919 | r241920 | |
| 5630 | 5626 | ROM_LOAD( "fpr-24338.ic8", 0x0000000, 0x4000000, CRC(1423c374) SHA1(e6a3f0eaccd13c161d07705bcd00f447f08fc186) ) |
| 5631 | 5627 | ROM_LOAD( "fpr-24339.ic9", 0x4000000, 0x4000000, CRC(11883792) SHA1(1782db04f74394f981f887ab1a95d687eb2c0b35) ) |
| 5632 | 5628 | |
| 5633 | | // ROM_REGION( 4, "rom_key", 0 ) |
| 5634 | | // ROM_LOAD( "zunou-key.bin", 0, 4, CRC(cbe35afb) SHA1(78877655800aae27661bf720e1c37d6c6f2e3d1c) ) |
| 5635 | | ROM_REGION( 20, "pic_readout", 0 ) // data obtained using a custom PIC reader |
| 5636 | | ROM_LOAD( "317-0435-jpn.ic3", 0, 20, NO_DUMP ) |
| 5629 | ROM_REGION( 4, "rom_key", 0 ) |
| 5630 | ROM_LOAD( "zunou-key.bin", 0, 4, CRC(cbe35afb) SHA1(78877655800aae27661bf720e1c37d6c6f2e3d1c) ) |
| 5637 | 5631 | |
| 5638 | 5632 | ROM_REGION(0x4, "boardid", ROMREGION_ERASEVAL(0x02)) |
| 5639 | 5633 | ROM_END |
| r241919 | r241920 | |
| 5648 | 5642 | ROM_LOAD( "fpr-24415.ic10", 0x8000000, 0x4000000, CRC(133c742c) SHA1(89f857a31731dc918afc72b6cb716f5c77cb9d6e) ) |
| 5649 | 5643 | ROM_LOAD( "fpr-24416.ic11", 0xc000000, 0x4000000, CRC(562fb88e) SHA1(172678e3e27cfad7f7e6217c4653a4ba119bfbdf) ) |
| 5650 | 5644 | |
| 5651 | | ROM_REGION( 20, "pic_readout", 0 ) // data obtained using a custom PIC reader |
| 5652 | | ROM_LOAD( "317-5129-jpn.ic3", 0, 20, CRC(b6191cea) SHA1(13e14ff013bf2728203641303141c016e82b10a3) ) |
| 5645 | ROM_REGION( 4, "rom_key", 0 ) |
| 5646 | ROM_LOAD( "sl2007-key.bin", 0, 4, CRC(d5d1e807) SHA1(8a0cc371729c622bb05c5d26b3e39ec31d29ace1) ) |
| 5653 | 5647 | |
| 5654 | 5648 | ROM_REGION(0x4, "boardid", ROMREGION_ERASEVAL(0x04)) |
| 5655 | 5649 | ROM_END |
| r241919 | r241920 | |
| 5664 | 5658 | ROM_LOAD( "fpr-24384.ic10", 0x8000000, 0x4000000, CRC(2e9116c4) SHA1(58903a33c4ce72a1f75aefcab94393fc2e8bd2d9) ) |
| 5665 | 5659 | ROM_LOAD( "fpr-24385.ic11", 0xc000000, 0x4000000, CRC(2b79f45d) SHA1(db97d980bf1590df4b983a4b7786977687238ef5) ) |
| 5666 | 5660 | |
| 5667 | | ROM_REGION( 20, "pic_readout", 0 ) // data obtained using a custom PIC reader |
| 5668 | | ROM_LOAD( "317-0495-com.ic3", 0, 20, CRC(675aca7b) SHA1(5127189e1f960abf9ed3f643158747d9abcaee1c) ) |
| 5661 | ROM_REGION( 4, "rom_key", 0 ) |
| 5662 | ROM_LOAD( "asndynmt-key.bin", 0, 4, CRC(bf5396a9) SHA1(0b27fdc800143fb977cb2f1e937078d7a7006939) ) |
| 5669 | 5663 | |
| 5670 | 5664 | ROM_REGION(0x4, "boardid", ROMREGION_ERASEVAL(0x04)) |
| 5671 | 5665 | ROM_END |
| r241919 | r241920 | |
| 5680 | 5674 | ROM_LOAD( "fpr-24439.ic10", 0x8000000, 0x4000000, CRC(c02040f9) SHA1(27ad2cb45e8a516433917f060ca9798412bb95f7) ) |
| 5681 | 5675 | // IC11 Populated, Empty |
| 5682 | 5676 | |
| 5683 | | ROM_REGION( 20, "pic_readout", 0 ) // data obtained using a custom PIC reader |
| 5684 | | ROM_LOAD( "317-5131-jpn.ic3", 0, 20, CRC(44ab8ca9) SHA1(c17b10041e70590547ed010dc16a4dd2510fcc80) ) |
| 5677 | ROM_REGION( 4, "rom_key", 0 ) |
| 5678 | ROM_LOAD( "illvelo-key.bin", 0, 4, CRC(e164952f) SHA1(6c0dfe567640e1e843a5d7bf858a24c101dfcf95) ) |
| 5685 | 5679 | |
| 5686 | 5680 | ROM_REGION(0x4, "boardid", ROMREGION_ERASEVAL(0x04)) |
| 5687 | 5681 | ROM_END |
| r241919 | r241920 | |
| 5696 | 5690 | ROM_LOAD( "ic10.bin", 0x8000000, 0x4000000, CRC(76fb945f) SHA1(448be0c3d9a7c3956dd51aca3c4d8d28f8cec227) ) |
| 5697 | 5691 | // IC11 Populated, Empty |
| 5698 | 5692 | |
| 5699 | | ROM_REGION( 20, "pic_readout", 0 ) // data obtained using a custom PIC reader |
| 5700 | | ROM_LOAD( "317-5132-jpn.ic3", 0, 20, CRC(f2089de5) SHA1(12af0681decb22bbfa4b3e01037c3503846f265a) ) |
| 5693 | ROM_REGION( 4, "rom_key", 0 ) |
| 5694 | ROM_LOAD( "mamonoro-key.bin", 0x000000, 0x000004, CRC(264ca27a) SHA1(3b81b9794d86697f8eac7ea6945d992564ad6199) ) |
| 5701 | 5695 | |
| 5702 | 5696 | ROM_REGION(0x4, "boardid", ROMREGION_ERASEVAL(0x04)) |
| 5703 | 5697 | ROM_END |
| r241919 | r241920 | |
| 5714 | 5708 | ROM_LOAD( "ic12.bin", 0x10000000, 0x4000000, CRC(b8a6bff2) SHA1(befbc2e917b3107f1c4bfb9169623282ff97bfb2) ) |
| 5715 | 5709 | ROM_LOAD( "ic13.bin", 0x14000000, 0x4000000, CRC(4886329f) SHA1(6ccf6fb83cfdbef3f85f6c06e641c38ff434d605) ) |
| 5716 | 5710 | |
| 5717 | | ROM_REGION( 20, "pic_readout", 0 ) // data obtained using a custom PIC reader |
| 5718 | | ROM_LOAD( "317-5133-jpn.ic3", 0, 20, CRC(3dc7d902) SHA1(bb70e80dff878bca3652088f3333079e0781f482) ) |
| 5711 | ROM_REGION( 4, "rom_key", 0 ) |
| 5712 | ROM_LOAD( "mbaa-key.bin", 0x000000, 0x000004, CRC(f4ad909f) SHA1(27ba44592c2642b5862a24f68c755ad4115e6047) ) |
| 5719 | 5713 | |
| 5720 | 5714 | ROM_REGION(0x4, "boardid", ROMREGION_ERASEVAL(0x06)) |
| 5721 | 5715 | ROM_END |
| r241919 | r241920 | |
| 5733 | 5727 | ROM_LOAD( "ic12.bin", 0x10000000, 0x4000000, CRC(b8a6bff2) SHA1(befbc2e917b3107f1c4bfb9169623282ff97bfb2) ) |
| 5734 | 5728 | ROM_LOAD( "ic13.bin", 0x14000000, 0x4000000, CRC(4886329f) SHA1(6ccf6fb83cfdbef3f85f6c06e641c38ff434d605) ) |
| 5735 | 5729 | |
| 5736 | | ROM_REGION( 20, "pic_readout", 0 ) // data obtained using a custom PIC reader |
| 5737 | | ROM_LOAD( "317-5133-jpn.ic3", 0, 20, CRC(3dc7d902) SHA1(bb70e80dff878bca3652088f3333079e0781f482) ) |
| 5730 | ROM_REGION( 4, "rom_key", 0 ) |
| 5731 | ROM_LOAD( "mbaa-key.bin", 0x000000, 0x000004, CRC(f4ad909f) SHA1(27ba44592c2642b5862a24f68c755ad4115e6047) ) |
| 5738 | 5732 | |
| 5739 | 5733 | ROM_REGION(0x4, "boardid", ROMREGION_ERASEVAL(0x86)) |
| 5740 | 5734 | ROM_END |
| r241919 | r241920 | |
| 5748 | 5742 | ROM_LOAD( "ic9.bin", 0x4000000, 0x4000000, CRC(16cf2e7a) SHA1(ff7c6540e4507f84e3128ba03be4826ba504678c) ) |
| 5749 | 5743 | // IC10 and IC11 Populated, Empty |
| 5750 | 5744 | |
| 5751 | | ROM_REGION( 20, "pic_readout", 0 ) // data obtained using a custom PIC reader |
| 5752 | | ROM_LOAD( "317-5138-jpn.ic3", 0, 20, CRC(babcc420) SHA1(653cdcfa388426f4ce03c76506046ec6fd070562) ) |
| 5745 | ROM_REGION( 4, "rom_key", 0 ) |
| 5746 | ROM_LOAD( "radirgyn-key.bin", 0x000000, 0x000004, CRC(c158cf3b) SHA1(c128646d7fee79fc10bf7bbaa23121f347df77f4) ) |
| 5753 | 5747 | |
| 5754 | 5748 | ROM_REGION(0x4, "boardid", ROMREGION_ERASEVAL(0x04)) |
| 5755 | 5749 | ROM_END |
| r241919 | r241920 | |
| 5763 | 5757 | ROM_LOAD( "ic9.bin", 0x4000000, 0x4000000, CRC(18c994d7) SHA1(159e1425b2fc645133814b0d26d93a90e9849b1a) ) |
| 5764 | 5758 | // IC10 and IC11 Populated, Empty |
| 5765 | 5759 | |
| 5766 | | ROM_REGION( 20, "pic_readout", 0 ) // data obtained using a custom PIC reader |
| 5767 | | ROM_LOAD( "317-5130-jpn.ic3", 0, 20, CRC(3e0c010b) SHA1(b6da97d4ecb228e73fb9a5ada837d0d6699ab0f1) ) |
| 5760 | ROM_REGION( 4, "rom_key", 0 ) |
| 5761 | ROM_LOAD( "ausfache-key.bin", 0, 4, CRC(93cdc793) SHA1(f0a0c321a3bdf8ca87cbd840a168a9057c08f16a) ) |
| 5768 | 5762 | |
| 5769 | 5763 | ROM_REGION(0x4, "boardid", ROMREGION_ERASEVAL(0x04)) |
| 5770 | 5764 | ROM_END |
| r241919 | r241920 | |
| 5783 | 5777 | ROM_REGION( 0x200000, "ioboard", 0) // touch screen I/O board, program disassembles as little-endian SH-4 |
| 5784 | 5778 | ROM_LOAD( "fpr24351.ic14", 0x000000, 0x200000, CRC(4d1b7b89) SHA1(965b8c6b5a2e7b3f1b1e2eac19c86000c3b66754) ) |
| 5785 | 5779 | |
| 5786 | | // ROM_REGION( 4, "rom_key", 0 ) |
| 5787 | | // ROM_LOAD( "pokasuka-key.bin", 0, 4, CRC(f00bcd61) SHA1(b8315b851656c2e0b7853979988d1c44eab0886b) ) |
| 5788 | | ROM_REGION( 20, "pic_readout", 0 ) // data obtained using a custom PIC reader |
| 5789 | | ROM_LOAD( "317-0461-com.ic3", 0, 20, NO_DUMP ) |
| 5780 | ROM_REGION( 4, "rom_key", 0 ) |
| 5781 | ROM_LOAD( "pokasuka-key.bin", 0, 4, CRC(f00bcd61) SHA1(b8315b851656c2e0b7853979988d1c44eab0886b) ) |
| 5790 | 5782 | |
| 5791 | 5783 | ROM_REGION(0x4, "boardid", ROMREGION_ERASEVAL(0x05)) |
| 5792 | 5784 | ROM_END |
| r241919 | r241920 | |
| 5805 | 5797 | ROM_REGION( 0x200000, "ioboard", 0) // touch screen I/O board, program disassembles as little-endian SH-4 |
| 5806 | 5798 | ROM_LOAD( "fpr24351.ic14", 0x000000, 0x200000, CRC(4d1b7b89) SHA1(965b8c6b5a2e7b3f1b1e2eac19c86000c3b66754) ) |
| 5807 | 5799 | |
| 5808 | | // ROM_REGION( 4, "rom_key", 0 ) |
| 5809 | | // ROM_LOAD( "pokasuka-key.bin", 0, 4, CRC(f00bcd61) SHA1(b8315b851656c2e0b7853979988d1c44eab0886b) ) |
| 5810 | | ROM_REGION( 20, "pic_readout", 0 ) // data obtained using a custom PIC reader |
| 5811 | | ROM_LOAD( "317-0461-com.ic3", 0, 20, NO_DUMP ) |
| 5800 | ROM_REGION( 4, "rom_key", 0 ) |
| 5801 | ROM_LOAD( "pokasuka-key.bin", 0, 4, CRC(f00bcd61) SHA1(b8315b851656c2e0b7853979988d1c44eab0886b) ) |
| 5812 | 5802 | |
| 5813 | 5803 | ROM_REGION(0x4, "boardid", ROMREGION_ERASEVAL(0x05)) |
| 5814 | 5804 | ROM_END |
| r241919 | r241920 | |
| 5826 | 5816 | ROM_LOAD( "fpr-24425.ic10", 0x08000000, 0x4000000, CRC(6223ebac) SHA1(64c0ec61c108acbb557e7d3837f578deba832cb6) ) |
| 5827 | 5817 | ROM_LOAD( "fpr-24426.ic11", 0x0c000000, 0x4000000, CRC(c78b0981) SHA1(f889acf9065566e11ff985a3b6c4824e364d57ae) ) |
| 5828 | 5818 | |
| 5829 | | ROM_REGION( 20, "pic_readout", 0 ) // data obtained using a custom PIC reader |
| 5830 | | ROM_LOAD( "317-0503-jpn.ic3", 0, 20, CRC(69fc3f47) SHA1(3a887c62e93fa264b307c954eb39a4fca1bdfad6) ) |
| 5819 | ROM_REGION( 4, "rom_key", 0 ) |
| 5820 | ROM_LOAD( "rhytngk-key.bin", 0x000000, 0x000004, CRC(e2560d28) SHA1(46fb9b47a0df3035f92db2b0c63a6e4e0745ad29) ) |
| 5831 | 5821 | |
| 5832 | 5822 | ROM_REGION(0x4, "boardid", ROMREGION_ERASEVAL(0x04)) |
| 5833 | 5823 | ROM_END |
trunk/src/mame/includes/dooyong.h
| r241919 | r241920 | |
| 5 | 5 | public: |
| 6 | 6 | dooyong_state(const machine_config &mconfig, device_type type, const char *tag) |
| 7 | 7 | : 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"), |
| 8 | 12 | m_maincpu(*this, "maincpu"), |
| 9 | 13 | m_audiocpu(*this, "audiocpu"), |
| 10 | 14 | m_gfxdecode(*this, "gfxdecode"), |
| 11 | | m_palette(*this, "palette") |
| 12 | | { } |
| 15 | m_palette(*this, "palette") { } |
| 13 | 16 | |
| 14 | | DECLARE_WRITE8_MEMBER(bgscroll_w); |
| 15 | | DECLARE_WRITE8_MEMBER(bg2scroll_w); |
| 16 | | DECLARE_WRITE8_MEMBER(fgscroll_w); |
| 17 | | DECLARE_WRITE8_MEMBER(fg2scroll_w); |
| 18 | | TILE_GET_INFO_MEMBER(get_bg_tile_info); |
| 19 | | TILE_GET_INFO_MEMBER(get_bg2_tile_info); |
| 20 | | TILE_GET_INFO_MEMBER(get_fg_tile_info); |
| 21 | | TILE_GET_INFO_MEMBER(get_fg2_tile_info); |
| 22 | | inline void get_tile_info(tile_data &tileinfo, int tile_index, UINT8 const *tilerom, UINT8 const *scroll, int graphics); |
| 23 | | inline void scroll8_w(offs_t offset, UINT8 data, UINT8 *scroll, tilemap_t *map); |
| 24 | | |
| 17 | optional_device<buffered_spriteram8_device> m_spriteram; |
| 18 | optional_device<buffered_spriteram16_device> m_spriteram16; |
| 19 | optional_shared_ptr<UINT8> m_txvideoram; |
| 20 | optional_shared_ptr<UINT8> m_paletteram_flytiger; |
| 21 | UINT8 m_sprites_disabled; |
| 22 | UINT8 m_flytiger_palette_bank; |
| 23 | UINT8 m_flytiger_pri; |
| 24 | UINT8 m_tx_pri; |
| 25 | UINT16 m_rshark_pri; |
| 25 | 26 | tilemap_t *m_bg_tilemap; |
| 26 | 27 | tilemap_t *m_bg2_tilemap; |
| 27 | 28 | tilemap_t *m_fg_tilemap; |
| r241919 | r241920 | |
| 35 | 36 | UINT8 *m_bg2_tilerom; |
| 36 | 37 | UINT8 *m_fg_tilerom; |
| 37 | 38 | UINT8 *m_fg2_tilerom; |
| 39 | UINT8 *m_bg_tilerom2; |
| 40 | UINT8 *m_bg2_tilerom2; |
| 41 | UINT8 *m_fg_tilerom2; |
| 42 | UINT8 *m_fg2_tilerom2; |
| 38 | 43 | int m_bg_gfx; |
| 39 | 44 | int m_bg2_gfx; |
| 40 | 45 | int m_fg_gfx; |
| 41 | 46 | int m_fg2_gfx; |
| 47 | int m_tx_tilemap_mode; |
| 42 | 48 | |
| 43 | | required_device<cpu_device> m_maincpu; |
| 44 | | required_device<cpu_device> m_audiocpu; |
| 45 | | required_device<gfxdecode_device> m_gfxdecode; |
| 46 | | required_device<palette_device> m_palette; |
| 47 | | }; |
| 49 | int m_interrupt_line_1; |
| 50 | int m_interrupt_line_2; |
| 48 | 51 | |
| 49 | | class dooyong_z80_state : public dooyong_state |
| 50 | | { |
| 51 | | public: |
| 52 | | dooyong_z80_state(const machine_config &mconfig, device_type type, const char *tag) |
| 53 | | : dooyong_state(mconfig, type, tag), |
| 54 | | m_txvideoram(*this, "txvideoram"), |
| 55 | | m_paletteram_flytiger(*this, "flytiger_palram"), |
| 56 | | m_spriteram(*this, "spriteram") |
| 57 | | { } |
| 58 | | |
| 59 | | enum |
| 60 | | { |
| 61 | | SPRITE_12BIT = 0x01, |
| 62 | | SPRITE_HEIGHT = 0x02, |
| 63 | | SPRITE_YSHIFT_BLUEHAWK = 0x04, |
| 64 | | SPRITE_YSHIFT_FLYTIGER = 0x08 |
| 65 | | }; |
| 66 | | |
| 52 | DECLARE_WRITE8_MEMBER(lastday_bankswitch_w); |
| 67 | 53 | DECLARE_WRITE8_MEMBER(flip_screen_w); |
| 68 | | DECLARE_WRITE8_MEMBER(bankswitch_w); |
| 69 | | DECLARE_WRITE8_MEMBER(txvideoram_w); |
| 54 | DECLARE_WRITE8_MEMBER(dooyong_bgscroll8_w); |
| 55 | DECLARE_WRITE8_MEMBER(dooyong_bg2scroll8_w); |
| 56 | DECLARE_WRITE8_MEMBER(dooyong_fgscroll8_w); |
| 57 | DECLARE_WRITE8_MEMBER(dooyong_fg2scroll8_w); |
| 58 | DECLARE_WRITE16_MEMBER(dooyong_bgscroll16_w); |
| 59 | DECLARE_WRITE16_MEMBER(dooyong_bg2scroll16_w); |
| 60 | DECLARE_WRITE16_MEMBER(dooyong_fgscroll16_w); |
| 61 | DECLARE_WRITE16_MEMBER(dooyong_fg2scroll16_w); |
| 62 | DECLARE_WRITE8_MEMBER(dooyong_txvideoram8_w); |
| 63 | DECLARE_WRITE8_MEMBER(lastday_ctrl_w); |
| 64 | DECLARE_WRITE8_MEMBER(pollux_ctrl_w); |
| 70 | 65 | DECLARE_WRITE8_MEMBER(primella_ctrl_w); |
| 71 | 66 | DECLARE_WRITE8_MEMBER(paletteram_flytiger_w); |
| 72 | 67 | 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); |
| 73 | 75 | TILE_GET_INFO_MEMBER(get_tx_tile_info); |
| 74 | | void draw_sprites(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect, unsigned extensions = 0); |
| 75 | | UINT32 screen_update_bluehawk(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); |
| 76 | | UINT32 screen_update_flytiger(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); |
| 77 | | UINT32 screen_update_primella(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); |
| 78 | | DECLARE_MACHINE_START(cpu_z80); |
| 76 | inline void lastday_get_tile_info(tile_data &tileinfo, int tile_index, const UINT8 *tilerom, UINT8 *scroll, int graphics); |
| 77 | inline void rshark_get_tile_info(tile_data &tileinfo, int tile_index, const UINT8 *tilerom1, const UINT8 *tilerom2, UINT8 *scroll, int graphics); |
| 78 | DECLARE_MACHINE_START(lastday); |
| 79 | DECLARE_MACHINE_RESET(sound_ym2203); |
| 80 | DECLARE_VIDEO_START(lastday); |
| 81 | DECLARE_VIDEO_START(gulfstrm); |
| 82 | DECLARE_VIDEO_START(pollux); |
| 79 | 83 | DECLARE_VIDEO_START(bluehawk); |
| 80 | 84 | DECLARE_VIDEO_START(flytiger); |
| 81 | 85 | DECLARE_VIDEO_START(primella); |
| 82 | | |
| 83 | | required_shared_ptr<UINT8> m_txvideoram; |
| 84 | | optional_shared_ptr<UINT8> m_paletteram_flytiger; |
| 85 | | UINT8 m_sprites_disabled; |
| 86 | | UINT8 m_flytiger_palette_bank; |
| 87 | | UINT8 m_flytiger_pri; |
| 88 | | UINT8 m_tx_pri; |
| 89 | | int m_tx_tilemap_mode; |
| 90 | | |
| 91 | | optional_device<buffered_spriteram8_device> m_spriteram; |
| 92 | | }; |
| 93 | | |
| 94 | | class dooyong_z80_ym2203_state : public dooyong_z80_state |
| 95 | | { |
| 96 | | public: |
| 97 | | dooyong_z80_ym2203_state(const machine_config &mconfig, device_type type, const char *tag) |
| 98 | | : dooyong_z80_state(mconfig, type, tag) |
| 99 | | { } |
| 100 | | |
| 101 | | DECLARE_WRITE8_MEMBER(lastday_ctrl_w); |
| 102 | | DECLARE_WRITE8_MEMBER(pollux_ctrl_w); |
| 103 | | DECLARE_WRITE_LINE_MEMBER(irqhandler_2203_1); |
| 104 | | DECLARE_WRITE_LINE_MEMBER(irqhandler_2203_2); |
| 105 | | DECLARE_READ8_MEMBER(unk_r); |
| 106 | | DECLARE_MACHINE_RESET(sound_ym2203); |
| 86 | DECLARE_VIDEO_START(rshark); |
| 87 | DECLARE_VIDEO_START(popbingo); |
| 107 | 88 | UINT32 screen_update_lastday(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); |
| 108 | 89 | UINT32 screen_update_gulfstrm(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); |
| 109 | 90 | UINT32 screen_update_pollux(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); |
| 110 | | DECLARE_VIDEO_START(lastday); |
| 111 | | DECLARE_VIDEO_START(gulfstrm); |
| 112 | | DECLARE_VIDEO_START(pollux); |
| 113 | | |
| 114 | | int m_interrupt_line_1; |
| 115 | | int m_interrupt_line_2; |
| 116 | | }; |
| 117 | | |
| 118 | | class dooyong_68k_state : public dooyong_state |
| 119 | | { |
| 120 | | public: |
| 121 | | dooyong_68k_state(const machine_config &mconfig, device_type type, const char *tag) |
| 122 | | : dooyong_state(mconfig, type, tag), |
| 123 | | m_spriteram(*this, "spriteram") |
| 124 | | { } |
| 125 | | |
| 126 | | DECLARE_WRITE16_MEMBER(ctrl_w); |
| 127 | | TIMER_DEVICE_CALLBACK_MEMBER(scanline); |
| 128 | | TILE_GET_INFO_MEMBER(rshark_get_bg_tile_info); |
| 129 | | TILE_GET_INFO_MEMBER(rshark_get_bg2_tile_info); |
| 130 | | TILE_GET_INFO_MEMBER(rshark_get_fg_tile_info); |
| 131 | | TILE_GET_INFO_MEMBER(rshark_get_fg2_tile_info); |
| 132 | | inline void rshark_get_tile_info(tile_data &tileinfo, int tile_index, UINT8 const *tilerom1, UINT8 const *tilerom2, UINT8 const *scroll, int graphics); |
| 133 | | void draw_sprites(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); |
| 91 | UINT32 screen_update_bluehawk(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); |
| 92 | UINT32 screen_update_flytiger(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); |
| 93 | UINT32 screen_update_primella(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); |
| 134 | 94 | UINT32 screen_update_rshark(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); |
| 135 | 95 | UINT32 screen_update_popbingo(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); |
| 136 | | DECLARE_VIDEO_START(rshark); |
| 137 | | DECLARE_VIDEO_START(popbingo); |
| 138 | | |
| 139 | | UINT8 *m_bg_tilerom2; |
| 140 | | UINT8 *m_bg2_tilerom2; |
| 141 | | UINT8 *m_fg_tilerom2; |
| 142 | | UINT8 *m_fg2_tilerom2; |
| 143 | | UINT16 m_bg2_priority; |
| 144 | | |
| 145 | | required_device<buffered_spriteram16_device> m_spriteram; |
| 96 | TIMER_DEVICE_CALLBACK_MEMBER(rshark_scanline); |
| 97 | inline void dooyong_scroll8_w(offs_t offset, UINT8 data, UINT8 *scroll, tilemap_t *map); |
| 98 | void draw_sprites(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect, int pollux_extensions); |
| 99 | void rshark_draw_sprites(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); |
| 100 | DECLARE_WRITE_LINE_MEMBER(irqhandler_2203_1); |
| 101 | DECLARE_WRITE_LINE_MEMBER(irqhandler_2203_2); |
| 102 | required_device<cpu_device> m_maincpu; |
| 103 | required_device<cpu_device> m_audiocpu; |
| 104 | required_device<gfxdecode_device> m_gfxdecode; |
| 105 | required_device<palette_device> m_palette; |
| 146 | 106 | }; |
trunk/src/mame/video/dooyong.c
| r241919 | r241920 | |
| 2 | 2 | #include "includes/dooyong.h" |
| 3 | 3 | |
| 4 | 4 | |
| 5 | | inline void dooyong_state::scroll8_w(offs_t offset, UINT8 data, UINT8 *scroll, tilemap_t *map) |
| 5 | inline void dooyong_state::dooyong_scroll8_w(offs_t offset, UINT8 data, UINT8 *scroll, tilemap_t *map) |
| 6 | 6 | { |
| 7 | 7 | UINT8 old = scroll[offset]; |
| 8 | 8 | if (old != data) |
| r241919 | r241920 | |
| 18 | 18 | break; |
| 19 | 19 | case 3: /* Low byte of y scroll */ |
| 20 | 20 | case 4: /* High byte of y scroll */ |
| 21 | | map->set_scrolly(0, (unsigned)scroll[3] | ((unsigned)scroll[4] << 8)); |
| 21 | map->set_scrolly(0, (int)scroll[3] | ((int)scroll[4] << 8)); |
| 22 | 22 | break; |
| 23 | 23 | case 6: /* Tilemap enable and mode control */ |
| 24 | 24 | map->enable(!(data & 0x10)); |
| r241919 | r241920 | |
| 43 | 43 | } |
| 44 | 44 | |
| 45 | 45 | |
| 46 | | /* These handle writes to the tilemap scroll registers. |
| 46 | /* These handle writes to the tilemap scroll registers in 8-bit machines. |
| 47 | 47 | There is one per tilemap, wrapping the above function that does the work. */ |
| 48 | 48 | |
| 49 | | WRITE8_MEMBER(dooyong_state::bgscroll_w) |
| 49 | WRITE8_MEMBER(dooyong_state::dooyong_bgscroll8_w) |
| 50 | 50 | { |
| 51 | | scroll8_w(offset, data, m_bgscroll8, m_bg_tilemap); |
| 51 | dooyong_scroll8_w(offset, data, m_bgscroll8, m_bg_tilemap); |
| 52 | 52 | } |
| 53 | 53 | |
| 54 | | WRITE8_MEMBER(dooyong_state::bg2scroll_w) |
| 54 | WRITE8_MEMBER(dooyong_state::dooyong_bg2scroll8_w) |
| 55 | 55 | { |
| 56 | | scroll8_w(offset, data, m_bg2scroll8, m_bg2_tilemap); |
| 56 | dooyong_scroll8_w(offset, data, m_bg2scroll8, m_bg2_tilemap); |
| 57 | 57 | } |
| 58 | 58 | |
| 59 | | WRITE8_MEMBER(dooyong_state::fgscroll_w) |
| 59 | WRITE8_MEMBER(dooyong_state::dooyong_fgscroll8_w) |
| 60 | 60 | { |
| 61 | | scroll8_w(offset, data, m_fgscroll8, m_fg_tilemap); |
| 61 | dooyong_scroll8_w(offset, data, m_fgscroll8, m_fg_tilemap); |
| 62 | 62 | } |
| 63 | 63 | |
| 64 | | WRITE8_MEMBER(dooyong_state::fg2scroll_w) |
| 64 | WRITE8_MEMBER(dooyong_state::dooyong_fg2scroll8_w) |
| 65 | 65 | { |
| 66 | | scroll8_w(offset, data, m_fg2scroll8, m_fg2_tilemap); |
| 66 | dooyong_scroll8_w(offset, data, m_fg2scroll8, m_fg2_tilemap); |
| 67 | 67 | } |
| 68 | 68 | |
| 69 | 69 | |
| 70 | | WRITE8_MEMBER(dooyong_z80_state::txvideoram_w) |
| 70 | /* These handle writes to the tilemap scroll registers in 16-bit machines. |
| 71 | This is just an 8-bit peripheral in a 16-bit machine. */ |
| 72 | |
| 73 | WRITE16_MEMBER(dooyong_state::dooyong_bgscroll16_w) |
| 71 | 74 | { |
| 75 | if (ACCESSING_BITS_0_7) dooyong_bgscroll8_w(space, offset, data & 0x00ff); |
| 76 | } |
| 77 | |
| 78 | WRITE16_MEMBER(dooyong_state::dooyong_bg2scroll16_w) |
| 79 | { |
| 80 | if (ACCESSING_BITS_0_7) dooyong_bg2scroll8_w(space, offset, data & 0x00ff); |
| 81 | } |
| 82 | |
| 83 | WRITE16_MEMBER(dooyong_state::dooyong_fgscroll16_w) |
| 84 | { |
| 85 | if (ACCESSING_BITS_0_7) dooyong_fgscroll8_w(space, offset, data & 0x00ff); |
| 86 | } |
| 87 | |
| 88 | WRITE16_MEMBER(dooyong_state::dooyong_fg2scroll16_w) |
| 89 | { |
| 90 | if (ACCESSING_BITS_0_7) dooyong_fg2scroll8_w(space, offset, data & 0x00ff); |
| 91 | } |
| 92 | |
| 93 | |
| 94 | WRITE8_MEMBER(dooyong_state::dooyong_txvideoram8_w) |
| 95 | { |
| 72 | 96 | if (m_txvideoram[offset] != data) |
| 73 | 97 | { |
| 74 | 98 | m_txvideoram[offset] = data; |
| r241919 | r241920 | |
| 82 | 106 | |
| 83 | 107 | /* Control registers seem to be different on every game */ |
| 84 | 108 | |
| 85 | | WRITE8_MEMBER(dooyong_z80_ym2203_state::lastday_ctrl_w) |
| 109 | WRITE8_MEMBER(dooyong_state::lastday_ctrl_w) |
| 86 | 110 | { |
| 87 | 111 | /* bits 0 and 1 are coin counters */ |
| 88 | 112 | coin_counter_w(machine(), 0, data & 0x01); |
| r241919 | r241920 | |
| 97 | 121 | flip_screen_set(data & 0x40); |
| 98 | 122 | } |
| 99 | 123 | |
| 100 | | WRITE8_MEMBER(dooyong_z80_ym2203_state::pollux_ctrl_w) |
| 124 | WRITE8_MEMBER(dooyong_state::pollux_ctrl_w) |
| 101 | 125 | { |
| 102 | 126 | /* bit 0 is flip screen */ |
| 103 | 127 | flip_screen_set(data & 0x01); |
| r241919 | r241920 | |
| 112 | 136 | /* bit 4 is used but unknown */ |
| 113 | 137 | } |
| 114 | 138 | |
| 115 | | WRITE8_MEMBER(dooyong_z80_state::primella_ctrl_w) |
| 139 | WRITE8_MEMBER(dooyong_state::primella_ctrl_w) |
| 116 | 140 | { |
| 117 | 141 | /* bits 0-2 select ROM bank */ |
| 118 | 142 | membank("bank1")->set_entry(data & 0x07); |
| r241919 | r241920 | |
| 128 | 152 | // logerror("%04x: bankswitch = %02x\n",space.device().safe_pc(),data&0xe0); |
| 129 | 153 | } |
| 130 | 154 | |
| 131 | | WRITE8_MEMBER(dooyong_z80_state::paletteram_flytiger_w) |
| 155 | WRITE8_MEMBER(dooyong_state::paletteram_flytiger_w) |
| 132 | 156 | { |
| 133 | 157 | if (m_flytiger_palette_bank) |
| 134 | 158 | { |
| r241919 | r241920 | |
| 139 | 163 | } |
| 140 | 164 | } |
| 141 | 165 | |
| 142 | | WRITE8_MEMBER(dooyong_z80_state::flytiger_ctrl_w) |
| 166 | WRITE8_MEMBER(dooyong_state::flytiger_ctrl_w) |
| 143 | 167 | { |
| 144 | 168 | /* bit 0 is flip screen */ |
| 145 | 169 | flip_screen_set(data & 0x01); |
| r241919 | r241920 | |
| 153 | 177 | m_flytiger_pri = data & 0x10; |
| 154 | 178 | } |
| 155 | 179 | |
| 180 | WRITE16_MEMBER(dooyong_state::rshark_ctrl_w) |
| 156 | 181 | |
| 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 | |
| 157 | 196 | /* These games all have ROM-based tilemaps for the backgrounds, title |
| 158 | 197 | screens and sometimes "bosses" and special attacks. There are three |
| 159 | 198 | schemes for tilemap encoding. The scheme is chosen based on the |
| r241919 | r241920 | |
| 164 | 203 | when the x scroll moves out of range (trying to decode the whole lot |
| 165 | 204 | at once uses hundreds of megabytes of RAM). */ |
| 166 | 205 | |
| 167 | | inline void dooyong_state::get_tile_info(tile_data &tileinfo, int tile_index, |
| 168 | | UINT8 const *tilerom, UINT8 const *scroll, int graphics) |
| 206 | inline void dooyong_state::lastday_get_tile_info(tile_data &tileinfo, int tile_index, |
| 207 | const UINT8 *tilerom, UINT8 *scroll, int graphics) |
| 169 | 208 | { |
| 170 | | int const offs = (tile_index + ((int)scroll[1] << 6)) * 2; |
| 171 | | int const attr = tilerom[offs]; |
| 209 | int offs = (tile_index + ((int)scroll[1] << 6)) * 2; |
| 210 | int attr = tilerom[offs]; |
| 172 | 211 | int code, color, flags; |
| 173 | 212 | if (scroll[6] & 0x20) |
| 174 | 213 | { /* lastday/gulfstrm/pollux/flytiger */ |
| r241919 | r241920 | |
| 182 | 221 | Y = y flip */ |
| 183 | 222 | code = tilerom[offs + 1] | ((attr & 0x01) << 8) | ((attr & 0x80) << 2); |
| 184 | 223 | color = (attr & 0x78) >> 3; |
| 185 | | flags = TILE_FLIPYX((attr & 0x06) >> 1); |
| 224 | flags = ((attr & 0x02) ? TILE_FLIPX : 0) | ((attr & 0x04) ? TILE_FLIPY : 0); |
| 186 | 225 | } |
| 187 | 226 | else |
| 188 | | { /* primella/popbingo */ |
| 227 | { |
| 228 | /* primella */ |
| 189 | 229 | /* Tiles take two bytes in ROM: |
| 190 | 230 | MSB LSB |
| 191 | 231 | [offs + 0x00] YXCC CCcc (Y flip, X flip, bits 3-0 of color code, bits 9-8 of gfx code) |
| r241919 | r241920 | |
| 205 | 245 | |
| 206 | 246 | code = tilerom[offs + 1] | ((attr & codemask) << 8); |
| 207 | 247 | color = (attr & palmask) >> 2; |
| 208 | | flags = TILE_FLIPYX((attr & 0xC0) >> 6); |
| 248 | flags = ((attr & 0x40) ? TILE_FLIPX : 0) | ((attr & 0x80) ? TILE_FLIPY : 0); |
| 209 | 249 | } |
| 210 | 250 | |
| 211 | | tileinfo.set(graphics, code, color, flags); |
| 251 | SET_TILE_INFO_MEMBER(graphics, code, color, flags); |
| 212 | 252 | } |
| 213 | 253 | |
| 254 | inline 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 | |
| 214 | 274 | TILE_GET_INFO_MEMBER(dooyong_state::get_bg_tile_info) |
| 215 | 275 | { |
| 216 | | get_tile_info(tileinfo, tile_index, m_bg_tilerom, m_bgscroll8, m_bg_gfx); |
| 276 | if (m_bg_tilerom2 != NULL) |
| 277 | rshark_get_tile_info(tileinfo, tile_index, m_bg_tilerom, m_bg_tilerom2, m_bgscroll8, m_bg_gfx); |
| 278 | else |
| 279 | lastday_get_tile_info(tileinfo, tile_index, m_bg_tilerom, m_bgscroll8, m_bg_gfx); |
| 217 | 280 | } |
| 218 | 281 | |
| 219 | 282 | TILE_GET_INFO_MEMBER(dooyong_state::get_bg2_tile_info) |
| 220 | 283 | { |
| 221 | | get_tile_info(tileinfo, tile_index, m_bg2_tilerom, m_bg2scroll8, m_bg2_gfx); |
| 284 | if (m_bg2_tilerom2 != NULL) |
| 285 | rshark_get_tile_info(tileinfo, tile_index, m_bg2_tilerom, m_bg2_tilerom2, m_bg2scroll8, m_bg2_gfx); |
| 286 | else |
| 287 | lastday_get_tile_info(tileinfo, tile_index, m_bg2_tilerom, m_bg2scroll8, m_bg2_gfx); |
| 222 | 288 | } |
| 223 | 289 | |
| 224 | 290 | TILE_GET_INFO_MEMBER(dooyong_state::get_fg_tile_info) |
| 225 | 291 | { |
| 226 | | get_tile_info(tileinfo, tile_index, m_fg_tilerom, m_fgscroll8, m_fg_gfx); |
| 292 | if (m_fg_tilerom2 != NULL) |
| 293 | rshark_get_tile_info(tileinfo, tile_index, m_fg_tilerom, m_fg_tilerom2, m_fgscroll8, m_fg_gfx); |
| 294 | else |
| 295 | lastday_get_tile_info(tileinfo, tile_index, m_fg_tilerom, m_fgscroll8, m_fg_gfx); |
| 227 | 296 | } |
| 228 | 297 | |
| 229 | 298 | TILE_GET_INFO_MEMBER(dooyong_state::get_fg2_tile_info) |
| 230 | 299 | { |
| 231 | | get_tile_info(tileinfo, tile_index, m_fg2_tilerom, m_fg2scroll8, m_fg2_gfx); |
| 300 | if (m_fg2_tilerom2 != NULL) |
| 301 | rshark_get_tile_info(tileinfo, tile_index, m_fg2_tilerom, m_fg2_tilerom2, m_fg2scroll8, m_fg2_gfx); |
| 302 | else |
| 303 | lastday_get_tile_info(tileinfo, tile_index, m_fg2_tilerom, m_fg2scroll8, m_fg2_gfx); |
| 232 | 304 | } |
| 233 | 305 | |
| 234 | | TILE_GET_INFO_MEMBER(dooyong_z80_state::get_tx_tile_info) |
| 306 | /* flytiger uses some palette banking technique or something maybe a trash protection */ |
| 307 | |
| 308 | TILE_GET_INFO_MEMBER(dooyong_state::flytiger_get_fg_tile_info) |
| 235 | 309 | { |
| 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 | |
| 321 | TILE_GET_INFO_MEMBER(dooyong_state::get_tx_tile_info) |
| 322 | { |
| 236 | 323 | /* Each tile takes two bytes of memory: |
| 237 | 324 | MSB LSB |
| 238 | 325 | [offs + 0x00] cccc cccc (bits 7-0 of gfx code) |
| 239 | 326 | [offs + 0x01] CCCC cccc (bits 3-0 of color code, bits 11-8 of gfx code) |
| 240 | 327 | c = gfx code |
| 241 | 328 | C = color code */ |
| 242 | | unsigned offs, attr; |
| 329 | int offs, attr, code, color; |
| 243 | 330 | if (m_tx_tilemap_mode == 0) |
| 244 | 331 | { /* lastday/gulfstrm/pollux/flytiger */ |
| 245 | 332 | offs = tile_index; |
| r241919 | r241920 | |
| 250 | 337 | offs = tile_index * 2; |
| 251 | 338 | attr = m_txvideoram[offs + 1]; |
| 252 | 339 | } |
| 253 | | int const code = m_txvideoram[offs] | ((attr & 0x0f) << 8); |
| 254 | | int const color = (attr & 0xf0) >> 4; |
| 340 | code = m_txvideoram[offs] | ((attr & 0x0f) << 8); |
| 341 | color = (attr & 0xf0) >> 4; |
| 255 | 342 | |
| 256 | | tileinfo.set(0, code, color, 0); |
| 343 | SET_TILE_INFO_MEMBER(0, code, color, 0); |
| 257 | 344 | } |
| 258 | 345 | |
| 259 | 346 | |
| 260 | | void dooyong_z80_state::draw_sprites(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect, unsigned extensions) |
| 347 | void dooyong_state::draw_sprites(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect, int pollux_extensions) |
| 261 | 348 | { |
| 262 | 349 | /* Sprites take 32 bytes each in memory: |
| 263 | 350 | MSB LSB |
| r241919 | r241920 | |
| 277 | 364 | w = width |
| 278 | 365 | X = x flip |
| 279 | 366 | Y = y flip |
| 280 | | * = alters y position in bluehawk and flytiger - see code below |
| 367 | * = alters y position in pollux and flytiger - see code below |
| 281 | 368 | bit 11 of gfx code only used by gulfstrm, pollux, bluehawk and flytiger |
| 282 | 369 | height only used by pollux, bluehawk and flytiger |
| 283 | 370 | x flip and y flip only used by pollux and flytiger */ |
| 284 | 371 | |
| 285 | | UINT8 const *const buffered_spriteram = m_spriteram->buffer(); |
| 286 | | for (int offs = 0; offs < m_spriteram->bytes(); offs += 32) |
| 372 | UINT8 *buffered_spriteram = m_spriteram->buffer(); |
| 373 | int offs; |
| 374 | |
| 375 | for (offs = 0; offs < m_spriteram->bytes(); offs += 32) |
| 287 | 376 | { |
| 288 | | int sx = buffered_spriteram[offs+3] | ((buffered_spriteram[offs+1] & 0x10) << 4); |
| 289 | | int sy = buffered_spriteram[offs+2]; |
| 290 | | int code = buffered_spriteram[offs] | ((buffered_spriteram[offs+1] & 0xe0) << 3); |
| 291 | | int const color = buffered_spriteram[offs+1] & 0x0f; |
| 377 | int sx, sy, code, color, pri; |
| 378 | int flipx = 0, flipy = 0, height = 0, y; |
| 379 | |
| 380 | sx = buffered_spriteram[offs+3] | ((buffered_spriteram[offs+1] & 0x10) << 4); |
| 381 | sy = buffered_spriteram[offs+2]; |
| 382 | code = buffered_spriteram[offs] | ((buffered_spriteram[offs+1] & 0xe0) << 3); |
| 383 | color = buffered_spriteram[offs+1] & 0x0f; |
| 292 | 384 | //TODO: This priority mechanism works for known games, but seems a bit strange. |
| 293 | 385 | //Are we missing something? (The obvious spare palette bit isn't it.) |
| 294 | | int const pri = (((color == 0x00) || (color == 0x0f)) ? 0xfc : 0xf0); |
| 386 | pri = (((color == 0x00) || (color == 0x0f)) ? 0xfc : 0xf0); |
| 295 | 387 | |
| 296 | | bool flipx = false, flipy = false; |
| 297 | | int height = 0; |
| 298 | | if (extensions) |
| 388 | if (pollux_extensions) |
| 299 | 389 | { |
| 300 | | UINT8 const ext = buffered_spriteram[offs+0x1c]; |
| 390 | /* gulfstrm, pollux, bluehawk, flytiger */ |
| 391 | code |= ((buffered_spriteram[offs+0x1c] & 0x01) << 11); |
| 301 | 392 | |
| 302 | | if (extensions & SPRITE_12BIT) |
| 303 | | code |= ((ext & 0x01) << 11); |
| 304 | | |
| 305 | | if (extensions & SPRITE_HEIGHT) |
| 393 | if (pollux_extensions >= 2) |
| 306 | 394 | { |
| 307 | | height = (ext & 0x70) >> 4; |
| 395 | /* pollux, bluehawk, flytiger */ |
| 396 | height = (buffered_spriteram[offs+0x1c] & 0x70) >> 4; |
| 308 | 397 | code &= ~height; |
| 309 | 398 | |
| 310 | | flipx = ext & 0x08; |
| 311 | | flipy = ext & 0x04; |
| 312 | | } |
| 399 | flipx = buffered_spriteram[offs+0x1c] & 0x08; |
| 400 | flipy = buffered_spriteram[offs+0x1c] & 0x04; |
| 313 | 401 | |
| 314 | | if (extensions & SPRITE_YSHIFT_BLUEHAWK) |
| 315 | | sy += 6 - ((~ext & 0x02) << 7); |
| 402 | if (pollux_extensions == 3) |
| 403 | { |
| 404 | /* bluehawk */ |
| 405 | sy += 6 - ((~buffered_spriteram[offs+0x1c] & 0x02) << 7); |
| 406 | } |
| 316 | 407 | |
| 317 | | if (extensions & SPRITE_YSHIFT_FLYTIGER) |
| 318 | | sy -=(ext & 0x02) << 7; |
| 408 | if (pollux_extensions == 4) |
| 409 | { |
| 410 | /* flytiger */ |
| 411 | sy -=(buffered_spriteram[offs+0x1c] & 0x02) << 7; |
| 412 | } |
| 413 | } |
| 319 | 414 | } |
| 320 | 415 | |
| 321 | 416 | if (flip_screen()) |
| r241919 | r241920 | |
| 326 | 421 | flipy = !flipy; |
| 327 | 422 | } |
| 328 | 423 | |
| 329 | | for (int y = 0; y <= height; y++) |
| 424 | for (y = 0; y <= height; y++) |
| 330 | 425 | { |
| 331 | 426 | m_gfxdecode->gfx(1)->prio_transpen(bitmap,cliprect, |
| 332 | 427 | code + y, |
| r241919 | r241920 | |
| 339 | 434 | } |
| 340 | 435 | } |
| 341 | 436 | |
| 437 | void dooyong_state::rshark_draw_sprites(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) |
| 438 | { |
| 439 | UINT16 *buffered_spriteram16 = m_spriteram16->buffer(); |
| 342 | 440 | |
| 343 | | UINT32 dooyong_z80_ym2203_state::screen_update_lastday(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) |
| 441 | /* Sprites take 8 16-bit words each in memory: |
| 442 | MSB LSB |
| 443 | [offs + 0] ???? ???? ???? ???E |
| 444 | [offs + 1] ???? ???? hhhh wwww |
| 445 | [offs + 2] ???? ???? ???? ???? |
| 446 | [offs + 3] cccc cccc cccc cccc |
| 447 | [offs + 4] ???? ???x xxxx xxxx |
| 448 | [offs + 5] ???? ???? ???? ???? |
| 449 | [offs + 6] ???? ???y yyyy yyyy |
| 450 | [offs + 7] ???? ???? ???? CCCC |
| 451 | ? = unused/unknown |
| 452 | E = enable |
| 453 | c = gfx code |
| 454 | x = x offset |
| 455 | y = y offset (signed) |
| 456 | C = color code |
| 457 | w = width |
| 458 | h = height */ |
| 459 | |
| 460 | int offs; |
| 461 | |
| 462 | for (offs = (m_spriteram16->bytes() / 2) - 8; offs >= 0; offs -= 8) |
| 463 | { |
| 464 | if (buffered_spriteram16[offs] & 0x0001) /* enable */ |
| 465 | { |
| 466 | int sx, sy, code, color, pri; |
| 467 | int flipx = 0, flipy = 0, width, height, x, y; |
| 468 | |
| 469 | sx = buffered_spriteram16[offs+4] & 0x01ff; |
| 470 | sy = (INT16)buffered_spriteram16[offs+6] & 0x01ff; |
| 471 | if (sy & 0x0100) sy |= ~(int)0x01ff; // Correctly sign-extend 9-bit number |
| 472 | code = buffered_spriteram16[offs+3]; |
| 473 | color = buffered_spriteram16[offs+7] & 0x000f; |
| 474 | //TODO: This priority mechanism works for known games, but seems a bit strange. |
| 475 | //Are we missing something? (The obvious spare palette bit isn't it.) |
| 476 | pri = (((color == 0x00) || (color == 0x0f)) ? 0xfc : 0xf0); |
| 477 | width = buffered_spriteram16[offs+1] & 0x000f; |
| 478 | height = (buffered_spriteram16[offs+1] & 0x00f0) >> 4; |
| 479 | |
| 480 | if (flip_screen()) |
| 481 | { |
| 482 | sx = 498 - (16 * width) - sx; |
| 483 | sy = 240 - (16 * height) - sy; |
| 484 | flipx = !flipx; |
| 485 | flipy = !flipy; |
| 486 | } |
| 487 | |
| 488 | for (y = 0; y <= height; y++) |
| 489 | { |
| 490 | int _y = sy + (16 * (flipy ? (height - y) : y)); |
| 491 | for (x = 0; x <= width; x++) |
| 492 | { |
| 493 | int _x = sx + (16 * (flipx ? (width - x) : x)); |
| 494 | m_gfxdecode->gfx(0)->prio_transpen(bitmap,cliprect, |
| 495 | code, |
| 496 | color, |
| 497 | flipx, flipy, |
| 498 | _x, _y, |
| 499 | screen.priority(), |
| 500 | pri, 15); |
| 501 | code++; |
| 502 | } |
| 503 | } |
| 504 | } |
| 505 | } |
| 506 | } |
| 507 | |
| 508 | |
| 509 | UINT32 dooyong_state::screen_update_lastday(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) |
| 344 | 510 | { |
| 345 | 511 | bitmap.fill(m_palette->black_pen(), cliprect); |
| 346 | 512 | screen.priority().fill(0, cliprect); |
| r241919 | r241920 | |
| 350 | 516 | m_tx_tilemap->draw(screen, bitmap, cliprect, 0, 4); |
| 351 | 517 | |
| 352 | 518 | if (!m_sprites_disabled) |
| 353 | | draw_sprites(screen, bitmap, cliprect); |
| 354 | | |
| 519 | draw_sprites(screen, bitmap, cliprect, 0); |
| 355 | 520 | return 0; |
| 356 | 521 | } |
| 357 | 522 | |
| 358 | | UINT32 dooyong_z80_ym2203_state::screen_update_gulfstrm(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) |
| 523 | UINT32 dooyong_state::screen_update_gulfstrm(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) |
| 359 | 524 | { |
| 360 | 525 | bitmap.fill(m_palette->black_pen(), cliprect); |
| 361 | 526 | screen.priority().fill(0, cliprect); |
| r241919 | r241920 | |
| 364 | 529 | m_fg_tilemap->draw(screen, bitmap, cliprect, 0, 2); |
| 365 | 530 | m_tx_tilemap->draw(screen, bitmap, cliprect, 0, 4); |
| 366 | 531 | |
| 367 | | draw_sprites(screen, bitmap, cliprect, SPRITE_12BIT); |
| 368 | | |
| 532 | draw_sprites(screen, bitmap, cliprect, 1); |
| 369 | 533 | return 0; |
| 370 | 534 | } |
| 371 | 535 | |
| 372 | | UINT32 dooyong_z80_ym2203_state::screen_update_pollux(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) |
| 536 | UINT32 dooyong_state::screen_update_pollux(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) |
| 373 | 537 | { |
| 374 | 538 | bitmap.fill(m_palette->black_pen(), cliprect); |
| 375 | 539 | screen.priority().fill(0, cliprect); |
| r241919 | r241920 | |
| 378 | 542 | m_fg_tilemap->draw(screen, bitmap, cliprect, 0, 2); |
| 379 | 543 | m_tx_tilemap->draw(screen, bitmap, cliprect, 0, 4); |
| 380 | 544 | |
| 381 | | draw_sprites(screen, bitmap, cliprect, SPRITE_12BIT | SPRITE_HEIGHT); |
| 382 | | |
| 545 | draw_sprites(screen, bitmap, cliprect, 2); |
| 383 | 546 | return 0; |
| 384 | 547 | } |
| 385 | 548 | |
| 386 | | UINT32 dooyong_z80_state::screen_update_flytiger(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) |
| 549 | UINT32 dooyong_state::screen_update_flytiger(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) |
| 387 | 550 | { |
| 388 | 551 | bitmap.fill(m_palette->black_pen(), cliprect); |
| 389 | 552 | screen.priority().fill(0, cliprect); |
| r241919 | r241920 | |
| 400 | 563 | } |
| 401 | 564 | m_tx_tilemap->draw(screen, bitmap, cliprect, 0, 4); |
| 402 | 565 | |
| 403 | | draw_sprites(screen, bitmap, cliprect, SPRITE_12BIT | SPRITE_HEIGHT | SPRITE_YSHIFT_FLYTIGER); |
| 404 | | |
| 566 | draw_sprites(screen, bitmap, cliprect, 4); |
| 405 | 567 | return 0; |
| 406 | 568 | } |
| 407 | 569 | |
| 408 | 570 | |
| 409 | | UINT32 dooyong_z80_state::screen_update_bluehawk(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) |
| 571 | UINT32 dooyong_state::screen_update_bluehawk(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) |
| 410 | 572 | { |
| 411 | 573 | bitmap.fill(m_palette->black_pen(), cliprect); |
| 412 | 574 | screen.priority().fill(0, cliprect); |
| r241919 | r241920 | |
| 416 | 578 | m_fg2_tilemap->draw(screen, bitmap, cliprect, 0, 4); |
| 417 | 579 | m_tx_tilemap->draw(screen, bitmap, cliprect, 0, 4); |
| 418 | 580 | |
| 419 | | draw_sprites(screen, bitmap, cliprect, SPRITE_12BIT | SPRITE_HEIGHT | SPRITE_YSHIFT_BLUEHAWK); |
| 420 | | |
| 581 | draw_sprites(screen, bitmap, cliprect, 3); |
| 421 | 582 | return 0; |
| 422 | 583 | } |
| 423 | 584 | |
| 424 | | UINT32 dooyong_z80_state::screen_update_primella(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) |
| 585 | UINT32 dooyong_state::screen_update_primella(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) |
| 425 | 586 | { |
| 426 | 587 | bitmap.fill(m_palette->black_pen(), cliprect); |
| 427 | 588 | |
| r241919 | r241920 | |
| 429 | 590 | if (m_tx_pri) m_tx_tilemap->draw(screen, bitmap, cliprect, 0, 0); |
| 430 | 591 | m_fg_tilemap->draw(screen, bitmap, cliprect, 0, 0); |
| 431 | 592 | if (!m_tx_pri) m_tx_tilemap->draw(screen, bitmap, cliprect, 0, 0); |
| 593 | return 0; |
| 594 | } |
| 432 | 595 | |
| 596 | UINT32 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); |
| 433 | 607 | return 0; |
| 434 | 608 | } |
| 435 | 609 | |
| 436 | | VIDEO_START_MEMBER(dooyong_z80_ym2203_state, lastday) |
| 610 | UINT32 dooyong_state::screen_update_popbingo(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) |
| 437 | 611 | { |
| 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 | |
| 622 | VIDEO_START_MEMBER(dooyong_state,lastday) |
| 623 | { |
| 438 | 624 | /* Configure tilemap callbacks */ |
| 439 | 625 | m_bg_tilerom = memregion("gfx5")->base(); |
| 440 | 626 | m_fg_tilerom = memregion("gfx6")->base(); |
| 627 | m_bg_tilerom2 = NULL; |
| 628 | m_fg_tilerom2 = NULL; |
| 441 | 629 | m_bg_gfx = 2; |
| 442 | 630 | m_fg_gfx = 3; |
| 443 | 631 | m_tx_tilemap_mode = 0; |
| r241919 | r241920 | |
| 447 | 635 | 32, 32, 32, 8); |
| 448 | 636 | m_fg_tilemap = &machine().tilemap().create(m_gfxdecode, tilemap_get_info_delegate(FUNC(dooyong_state::get_fg_tile_info),this), TILEMAP_SCAN_COLS, |
| 449 | 637 | 32, 32, 32, 8); |
| 450 | | m_tx_tilemap = &machine().tilemap().create(m_gfxdecode, tilemap_get_info_delegate(FUNC(dooyong_z80_state::get_tx_tile_info),this), TILEMAP_SCAN_COLS, |
| 638 | m_tx_tilemap = &machine().tilemap().create(m_gfxdecode, tilemap_get_info_delegate(FUNC(dooyong_state::get_tx_tile_info),this), TILEMAP_SCAN_COLS, |
| 451 | 639 | 8, 8, 64, 32); |
| 452 | 640 | |
| 453 | 641 | /* Configure tilemap transparency */ |
| r241919 | r241920 | |
| 470 | 658 | save_item(NAME(m_interrupt_line_2)); |
| 471 | 659 | } |
| 472 | 660 | |
| 473 | | VIDEO_START_MEMBER(dooyong_z80_ym2203_state, gulfstrm) |
| 661 | VIDEO_START_MEMBER(dooyong_state,gulfstrm) |
| 474 | 662 | { |
| 475 | 663 | /* Configure tilemap callbacks */ |
| 476 | 664 | m_bg_tilerom = memregion("gfx5")->base(); |
| 477 | 665 | m_fg_tilerom = memregion("gfx6")->base(); |
| 666 | m_bg_tilerom2 = NULL; |
| 667 | m_fg_tilerom2 = NULL; |
| 478 | 668 | m_bg_gfx = 2; |
| 479 | 669 | m_fg_gfx = 3; |
| 480 | 670 | m_tx_tilemap_mode = 0; |
| r241919 | r241920 | |
| 484 | 674 | 32, 32, 32, 8); |
| 485 | 675 | m_fg_tilemap = &machine().tilemap().create(m_gfxdecode, tilemap_get_info_delegate(FUNC(dooyong_state::get_fg_tile_info),this), TILEMAP_SCAN_COLS, |
| 486 | 676 | 32, 32, 32, 8); |
| 487 | | m_tx_tilemap = &machine().tilemap().create(m_gfxdecode, tilemap_get_info_delegate(FUNC(dooyong_z80_state::get_tx_tile_info),this), TILEMAP_SCAN_COLS, |
| 677 | m_tx_tilemap = &machine().tilemap().create(m_gfxdecode, tilemap_get_info_delegate(FUNC(dooyong_state::get_tx_tile_info),this), TILEMAP_SCAN_COLS, |
| 488 | 678 | 8, 8, 64, 32); |
| 489 | 679 | |
| 490 | 680 | /* Configure tilemap transparency */ |
| r241919 | r241920 | |
| 506 | 696 | save_item(NAME(m_interrupt_line_2)); |
| 507 | 697 | } |
| 508 | 698 | |
| 509 | | VIDEO_START_MEMBER(dooyong_z80_ym2203_state, pollux) |
| 699 | VIDEO_START_MEMBER(dooyong_state,pollux) |
| 510 | 700 | { |
| 511 | 701 | /* Configure tilemap callbacks */ |
| 512 | 702 | m_bg_tilerom = memregion("gfx5")->base(); |
| 513 | 703 | m_fg_tilerom = memregion("gfx6")->base(); |
| 704 | m_bg_tilerom2 = NULL; |
| 705 | m_fg_tilerom2 = NULL; |
| 514 | 706 | m_bg_gfx = 2; |
| 515 | 707 | m_fg_gfx = 3; |
| 516 | 708 | m_tx_tilemap_mode = 0; |
| r241919 | r241920 | |
| 520 | 712 | 32, 32, 32, 8); |
| 521 | 713 | m_fg_tilemap = &machine().tilemap().create(m_gfxdecode, tilemap_get_info_delegate(FUNC(dooyong_state::get_fg_tile_info),this), TILEMAP_SCAN_COLS, |
| 522 | 714 | 32, 32, 32, 8); |
| 523 | | m_tx_tilemap = &machine().tilemap().create(m_gfxdecode, tilemap_get_info_delegate(FUNC(dooyong_z80_state::get_tx_tile_info),this), TILEMAP_SCAN_COLS, |
| 715 | m_tx_tilemap = &machine().tilemap().create(m_gfxdecode, tilemap_get_info_delegate(FUNC(dooyong_state::get_tx_tile_info),this), TILEMAP_SCAN_COLS, |
| 524 | 716 | 8, 8, 64, 32); |
| 525 | 717 | |
| 526 | 718 | /* Configure tilemap transparency */ |
| r241919 | r241920 | |
| 539 | 731 | save_item(NAME(m_interrupt_line_2)); |
| 540 | 732 | } |
| 541 | 733 | |
| 542 | | VIDEO_START_MEMBER(dooyong_z80_state, bluehawk) |
| 734 | VIDEO_START_MEMBER(dooyong_state,bluehawk) |
| 543 | 735 | { |
| 544 | 736 | /* Configure tilemap callbacks */ |
| 545 | 737 | m_bg_tilerom = memregion("gfx3")->base() + 0x78000; |
| 546 | 738 | m_fg_tilerom = memregion("gfx4")->base() + 0x78000; |
| 547 | 739 | m_fg2_tilerom = memregion("gfx5")->base() + 0x38000; |
| 740 | m_bg_tilerom2 = NULL; |
| 741 | m_fg_tilerom2 = NULL; |
| 742 | m_fg2_tilerom2 = NULL; |
| 548 | 743 | m_bg_gfx = 2; |
| 549 | 744 | m_fg_gfx = 3; |
| 550 | 745 | m_fg2_gfx = 4; |
| r241919 | r241920 | |
| 557 | 752 | 32, 32, 32, 8); |
| 558 | 753 | m_fg2_tilemap = &machine().tilemap().create(m_gfxdecode, tilemap_get_info_delegate(FUNC(dooyong_state::get_fg2_tile_info),this), TILEMAP_SCAN_COLS, |
| 559 | 754 | 32, 32, 32, 8); |
| 560 | | m_tx_tilemap = &machine().tilemap().create(m_gfxdecode, tilemap_get_info_delegate(FUNC(dooyong_z80_state::get_tx_tile_info),this), TILEMAP_SCAN_COLS, |
| 755 | m_tx_tilemap = &machine().tilemap().create(m_gfxdecode, tilemap_get_info_delegate(FUNC(dooyong_state::get_tx_tile_info),this), TILEMAP_SCAN_COLS, |
| 561 | 756 | 8, 8, 64, 32); |
| 562 | 757 | |
| 563 | 758 | /* Configure tilemap transparency */ |
| r241919 | r241920 | |
| 576 | 771 | save_item(NAME(m_fg2scroll8)); |
| 577 | 772 | } |
| 578 | 773 | |
| 579 | | VIDEO_START_MEMBER(dooyong_z80_state, flytiger) |
| 774 | VIDEO_START_MEMBER(dooyong_state,flytiger) |
| 580 | 775 | { |
| 581 | 776 | /* Configure tilemap callbacks */ |
| 582 | 777 | m_bg_tilerom = memregion("gfx3")->base() + 0x78000; |
| 583 | 778 | m_fg_tilerom = memregion("gfx4")->base() + 0x78000; |
| 779 | m_bg_tilerom2 = NULL; |
| 780 | m_fg_tilerom2 = NULL; |
| 584 | 781 | m_bg_gfx = 2; |
| 585 | 782 | m_fg_gfx = 3; |
| 586 | 783 | m_tx_tilemap_mode = 0; |
| r241919 | r241920 | |
| 588 | 785 | /* Create tilemaps */ |
| 589 | 786 | m_bg_tilemap = &machine().tilemap().create(m_gfxdecode, tilemap_get_info_delegate(FUNC(dooyong_state::get_bg_tile_info),this), TILEMAP_SCAN_COLS, |
| 590 | 787 | 32, 32, 32, 8); |
| 591 | | m_fg_tilemap = &machine().tilemap().create(m_gfxdecode, tilemap_get_info_delegate(FUNC(dooyong_state::get_fg_tile_info),this), TILEMAP_SCAN_COLS, |
| 788 | m_fg_tilemap = &machine().tilemap().create(m_gfxdecode, tilemap_get_info_delegate(FUNC(dooyong_state::flytiger_get_fg_tile_info),this), TILEMAP_SCAN_COLS, |
| 592 | 789 | 32, 32, 32, 8); |
| 593 | | m_tx_tilemap = &machine().tilemap().create(m_gfxdecode, tilemap_get_info_delegate(FUNC(dooyong_z80_state::get_tx_tile_info),this), TILEMAP_SCAN_COLS, |
| 790 | m_tx_tilemap = &machine().tilemap().create(m_gfxdecode, tilemap_get_info_delegate(FUNC(dooyong_state::get_tx_tile_info),this), TILEMAP_SCAN_COLS, |
| 594 | 791 | 8, 8, 64, 32); |
| 595 | 792 | |
| 596 | 793 | /* Configure tilemap transparency */ |
| r241919 | r241920 | |
| 609 | 806 | save_item(NAME(m_flytiger_pri)); |
| 610 | 807 | } |
| 611 | 808 | |
| 612 | | VIDEO_START_MEMBER(dooyong_z80_state, primella) |
| 809 | VIDEO_START_MEMBER(dooyong_state,primella) |
| 613 | 810 | { |
| 614 | 811 | /* Configure tilemap callbacks */ |
| 615 | 812 | m_bg_tilerom = memregion("gfx2")->base() + memregion("gfx2")->bytes() - 0x8000; |
| 616 | 813 | m_fg_tilerom = memregion("gfx3")->base() + memregion("gfx3")->bytes() - 0x8000; |
| 814 | m_bg_tilerom2 = NULL; |
| 815 | m_fg_tilerom2 = NULL; |
| 617 | 816 | m_bg_gfx = 1; |
| 618 | 817 | m_fg_gfx = 2; |
| 619 | 818 | m_tx_tilemap_mode = 1; |
| r241919 | r241920 | |
| 623 | 822 | 32, 32, 32, 8); |
| 624 | 823 | m_fg_tilemap = &machine().tilemap().create(m_gfxdecode, tilemap_get_info_delegate(FUNC(dooyong_state::get_fg_tile_info),this), TILEMAP_SCAN_COLS, |
| 625 | 824 | 32, 32, 32, 8); |
| 626 | | m_tx_tilemap = &machine().tilemap().create(m_gfxdecode, tilemap_get_info_delegate(FUNC(dooyong_z80_state::get_tx_tile_info),this), TILEMAP_SCAN_COLS, |
| 825 | m_tx_tilemap = &machine().tilemap().create(m_gfxdecode, tilemap_get_info_delegate(FUNC(dooyong_state::get_tx_tile_info),this), TILEMAP_SCAN_COLS, |
| 627 | 826 | 8, 8, 64, 32); |
| 628 | 827 | |
| 629 | 828 | /* Configure tilemap transparency */ |
| r241919 | r241920 | |
| 641 | 840 | save_item(NAME(m_tx_pri)); |
| 642 | 841 | } |
| 643 | 842 | |
| 644 | | |
| 645 | | WRITE16_MEMBER(dooyong_68k_state::ctrl_w) |
| 843 | VIDEO_START_MEMBER(dooyong_state,rshark) |
| 646 | 844 | { |
| 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 | | |
| 660 | | inline 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 | | |
| 680 | | TILE_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 | | |
| 685 | | TILE_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 | | |
| 690 | | TILE_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 | | |
| 695 | | TILE_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 | | |
| 701 | | void 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 | | |
| 765 | | UINT32 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 | | |
| 780 | | UINT32 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 | | |
| 793 | | VIDEO_START_MEMBER(dooyong_68k_state, rshark) |
| 794 | | { |
| 795 | 845 | /* Configure tilemap callbacks */ |
| 796 | 846 | m_bg_tilerom = memregion("gfx5")->base(); |
| 797 | 847 | m_bg2_tilerom = memregion("gfx4")->base(); |
| r241919 | r241920 | |
| 807 | 857 | m_fg2_gfx = 1; |
| 808 | 858 | |
| 809 | 859 | /* Create tilemaps */ |
| 810 | | m_bg_tilemap = &machine().tilemap().create(m_gfxdecode, tilemap_get_info_delegate(FUNC(dooyong_68k_state::rshark_get_bg_tile_info),this), TILEMAP_SCAN_COLS, |
| 860 | m_bg_tilemap = &machine().tilemap().create(m_gfxdecode, tilemap_get_info_delegate(FUNC(dooyong_state::get_bg_tile_info),this), TILEMAP_SCAN_COLS, |
| 811 | 861 | 16, 16, 64, 32); |
| 812 | | m_bg2_tilemap = &machine().tilemap().create(m_gfxdecode, tilemap_get_info_delegate(FUNC(dooyong_68k_state::rshark_get_bg2_tile_info),this), TILEMAP_SCAN_COLS, |
| 862 | m_bg2_tilemap = &machine().tilemap().create(m_gfxdecode, tilemap_get_info_delegate(FUNC(dooyong_state::get_bg2_tile_info),this), TILEMAP_SCAN_COLS, |
| 813 | 863 | 16, 16, 64, 32); |
| 814 | | m_fg_tilemap = &machine().tilemap().create(m_gfxdecode, tilemap_get_info_delegate(FUNC(dooyong_68k_state::rshark_get_fg_tile_info),this), TILEMAP_SCAN_COLS, |
| 864 | m_fg_tilemap = &machine().tilemap().create(m_gfxdecode, tilemap_get_info_delegate(FUNC(dooyong_state::get_fg_tile_info),this), TILEMAP_SCAN_COLS, |
| 815 | 865 | 16, 16, 64, 32); |
| 816 | | m_fg2_tilemap = &machine().tilemap().create(m_gfxdecode, tilemap_get_info_delegate(FUNC(dooyong_68k_state::rshark_get_fg2_tile_info),this), TILEMAP_SCAN_COLS, |
| 866 | m_fg2_tilemap = &machine().tilemap().create(m_gfxdecode, tilemap_get_info_delegate(FUNC(dooyong_state::get_fg2_tile_info),this), TILEMAP_SCAN_COLS, |
| 817 | 867 | 16, 16, 64, 32); |
| 818 | 868 | |
| 819 | 869 | /* Configure tilemap transparency */ |
| r241919 | r241920 | |
| 831 | 881 | save_item(NAME(m_bg2scroll8)); |
| 832 | 882 | save_item(NAME(m_fgscroll8)); |
| 833 | 883 | save_item(NAME(m_fg2scroll8)); |
| 834 | | save_item(NAME(m_bg2_priority)); |
| 884 | save_item(NAME(m_rshark_pri)); |
| 835 | 885 | } |
| 836 | 886 | |
| 837 | | VIDEO_START_MEMBER(dooyong_68k_state, popbingo) |
| 887 | VIDEO_START_MEMBER(dooyong_state,popbingo) |
| 838 | 888 | { |
| 839 | 889 | /* Configure tilemap callbacks */ |
| 840 | 890 | m_bg_tilerom = memregion("gfx2")->base(); |
| r241919 | r241920 | |
| 855 | 905 | save_item(NAME(m_bg2scroll8)); // Not used atm |
| 856 | 906 | save_item(NAME(m_fgscroll8)); // Not used atm |
| 857 | 907 | save_item(NAME(m_fg2scroll8)); // Not used atm |
| 858 | | save_item(NAME(m_bg2_priority)); |
| 908 | save_item(NAME(m_rshark_pri)); |
| 859 | 909 | } |
trunk/src/mame/video/prehisle.c
| r241919 | r241920 | |
| 27 | 27 | switch (offset) |
| 28 | 28 | { |
| 29 | 29 | 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 |
| 34 | 34 | default: return 0; |
| 35 | 35 | } |
| 36 | 36 | } |
| r241919 | r241920 | |
| 54 | 54 | } |
| 55 | 55 | } |
| 56 | 56 | |
| 57 | | /* tile layout |
| 58 | | 0 xxxx.... color |
| 59 | | 0 ....x... flip x |
| 60 | | 0 .....xxx gfx code high bits |
| 61 | | 1 xxxxxxxx gfx code low bits |
| 62 | | */ |
| 63 | 57 | TILE_GET_INFO_MEMBER(prehisle_state::get_bg2_tile_info) |
| 64 | 58 | { |
| 65 | | UINT8 const *const tilerom = memregion("gfx5")->base(); |
| 59 | UINT8 *tilerom = memregion("gfx5")->base(); |
| 66 | 60 | |
| 67 | | int const offs = tile_index * 2; |
| 68 | | int const attr = tilerom[offs + 1] + (tilerom[offs] << 8); |
| 69 | | int const code = (attr & 0x7ff) | 0x800; |
| 70 | | int const color = attr >> 12; |
| 71 | | int const flags = (attr & 0x800) ? TILE_FLIPX : 0; |
| 61 | int offs = tile_index * 2; |
| 62 | int attr = tilerom[offs + 1] + (tilerom[offs] << 8); |
| 63 | int code = (attr & 0x7ff) | 0x800; |
| 64 | int color = attr >> 12; |
| 65 | int flags = (attr & 0x800) ? TILE_FLIPX : 0; |
| 72 | 66 | |
| 73 | 67 | SET_TILE_INFO_MEMBER(1, code, color, flags); |
| 74 | 68 | } |
| 75 | 69 | |
| 76 | | /* tile layout |
| 77 | | 0 xxxx.... ........ color |
| 78 | | 0 ....x... ........ flip y |
| 79 | | 0 .....xxx xxxxxxxx gfx code |
| 80 | | */ |
| 81 | 70 | TILE_GET_INFO_MEMBER(prehisle_state::get_bg_tile_info) |
| 82 | 71 | { |
| 83 | | int const attr = m_bg_videoram16[tile_index]; |
| 84 | | int const code = attr & 0x7ff; |
| 85 | | int const color = attr >> 12; |
| 86 | | int const flags = (attr & 0x800) ? TILE_FLIPY : 0; |
| 72 | int attr = m_bg_videoram16[tile_index]; |
| 73 | int code = attr & 0x7ff; |
| 74 | int color = attr >> 12; |
| 75 | int flags = (attr & 0x800) ? TILE_FLIPY : 0; |
| 87 | 76 | |
| 88 | 77 | SET_TILE_INFO_MEMBER(2, code, color, flags); |
| 89 | 78 | } |
| 90 | 79 | |
| 91 | | /* tile layout |
| 92 | | 0 xxxx.... ........ color |
| 93 | | 0 ....xxxx xxxxxxxx gfx code |
| 94 | | */ |
| 95 | 80 | TILE_GET_INFO_MEMBER(prehisle_state::get_fg_tile_info) |
| 96 | 81 | { |
| 97 | | int const attr = m_videoram[tile_index]; |
| 98 | | int const code = attr & 0xfff; |
| 99 | | int const color = attr >> 12; |
| 82 | int attr = m_videoram[tile_index]; |
| 83 | int code = attr & 0xfff; |
| 84 | int color = attr >> 12; |
| 100 | 85 | |
| 101 | 86 | SET_TILE_INFO_MEMBER(0, code, color, 0); |
| 102 | 87 | } |
| 103 | 88 | |
| 104 | 89 | void prehisle_state::video_start() |
| 105 | 90 | { |
| 106 | | // ROM-based background layer |
| 107 | | m_bg2_tilemap = &machine().tilemap().create( |
| 108 | | m_gfxdecode, |
| 109 | | tilemap_get_info_delegate(FUNC(prehisle_state::get_bg2_tile_info), this), |
| 110 | | TILEMAP_SCAN_COLS, // scan order |
| 111 | | 16, 16, // tile size |
| 112 | | 1024, 32); // tilemap size |
| 91 | m_bg2_tilemap = &machine().tilemap().create(m_gfxdecode, tilemap_get_info_delegate(FUNC(prehisle_state::get_bg2_tile_info),this), TILEMAP_SCAN_COLS, |
| 92 | 16, 16, 1024, 32); |
| 113 | 93 | |
| 114 | | // RAM-based background layer (overlays most sprites) |
| 115 | | m_bg_tilemap = &machine().tilemap().create( |
| 116 | | m_gfxdecode, |
| 117 | | tilemap_get_info_delegate(FUNC(prehisle_state::get_bg_tile_info), this), |
| 118 | | TILEMAP_SCAN_COLS, // scan order |
| 119 | | 16, 16, // tile size |
| 120 | | 256, 32); // tilemap size |
| 121 | | m_bg_tilemap->set_transparent_pen(15); |
| 94 | m_bg_tilemap = &machine().tilemap().create(m_gfxdecode, tilemap_get_info_delegate(FUNC(prehisle_state::get_bg_tile_info),this), TILEMAP_SCAN_COLS, |
| 95 | 16, 16, 256, 32); |
| 122 | 96 | |
| 123 | | // text layer |
| 124 | | m_fg_tilemap = &machine().tilemap().create( |
| 125 | | m_gfxdecode, |
| 126 | | tilemap_get_info_delegate(FUNC(prehisle_state::get_fg_tile_info), this), |
| 127 | | TILEMAP_SCAN_ROWS, // scan order |
| 128 | | 8, 8, // tile size |
| 129 | | 32, 32); // tilemap size |
| 97 | m_fg_tilemap = &machine().tilemap().create(m_gfxdecode, tilemap_get_info_delegate(FUNC(prehisle_state::get_fg_tile_info),this), TILEMAP_SCAN_ROWS, |
| 98 | 8, 8, 32, 32); |
| 99 | |
| 100 | m_bg_tilemap->set_transparent_pen(15); |
| 130 | 101 | m_fg_tilemap->set_transparent_pen(15); |
| 131 | 102 | |
| 132 | 103 | /* register for saving */ |
| r241919 | r241920 | |
| 134 | 105 | } |
| 135 | 106 | |
| 136 | 107 | /* sprite layout |
| 108 | o fedcba9876543210 |
| 137 | 109 | |
| 138 | | 0 .......x xxxxxxxx y, other bits unused? |
| 139 | | 1 .......x xxxxxxxx x, other bits unused? |
| 140 | | 2 x....... ........ flip y |
| 141 | | 2 .x...... ........ flip x |
| 142 | | 2 ..x..... ........ ? |
| 143 | | 2 ...xxxxx xxxxxxxx gfx code |
| 144 | | 3 xxxx.... ........ color+priority, other bits unknown |
| 110 | 0 .......xxxxxxxxx y, other bits unused? |
| 111 | 1 .......xxxxxxxxx x, other bits unused? |
| 112 | |
| 113 | 2 ...xxxxxxxxxxxxx code |
| 114 | 2 ..x............. ? |
| 115 | 2 .x.............. flipx |
| 116 | 2 x............... flipy |
| 117 | |
| 118 | 3 xxxx............ color+priority, other bits unknown |
| 145 | 119 | */ |
| 146 | | void prehisle_state::draw_sprites(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) |
| 120 | void prehisle_state::draw_sprites(bitmap_ind16 &bitmap, const rectangle &cliprect, int foreground ) |
| 147 | 121 | { |
| 148 | | UINT16 const *const spriteram16 = m_spriteram; |
| 122 | UINT16 *spriteram16 = m_spriteram; |
| 123 | int offs; |
| 149 | 124 | |
| 150 | | for (int offs = 0; offs < 1024; offs += 4) |
| 125 | for (offs = 0; offs < 1024; offs += 4) |
| 151 | 126 | { |
| 152 | | int const attr = spriteram16[offs + 2]; |
| 153 | | int const code = attr & 0x1fff; |
| 154 | | int const color = spriteram16[offs + 3] >> 12; |
| 155 | | int const priority = (color < 0x4) ? 0x04 : 0x06; |
| 156 | | bool flipx = attr & 0x4000; |
| 157 | | bool flipy = attr & 0x8000; |
| 158 | | int sx = spriteram16[offs + 1] & 0x1ff; |
| 159 | | int sy = spriteram16[offs] & 0x1ff; |
| 127 | int attr = spriteram16[offs + 2]; |
| 128 | int code = attr & 0x1fff; |
| 129 | int color = spriteram16[offs + 3] >> 12; |
| 130 | int priority = (color < 0x4); // correct? |
| 131 | int flipx = attr & 0x4000; |
| 132 | int flipy = attr & 0x8000; |
| 133 | int sx = spriteram16[offs + 1]&0x1ff; |
| 134 | int sy = spriteram16[offs]&0x1ff; |
| 160 | 135 | |
| 161 | 136 | // coordinates are 9-bit signed |
| 162 | | if (sx & 0x100) sx = -0x100 + (sx & 0xff); |
| 163 | | if (sy & 0x100) sy = -0x100 + (sy & 0xff); |
| 137 | if (sx&0x100) sx=-0x100+(sx&0xff); |
| 138 | if (sy&0x100) sy=-0x100+(sy&0xff); |
| 164 | 139 | |
| 165 | 140 | if (flip_screen()) |
| 166 | 141 | { |
| r241919 | r241920 | |
| 170 | 145 | flipy = !flipy; |
| 171 | 146 | } |
| 172 | 147 | |
| 173 | | m_gfxdecode->gfx(3)->prio_transpen( |
| 174 | | bitmap, cliprect, |
| 175 | | code, color, |
| 176 | | flipx, flipy, |
| 177 | | sx, sy, |
| 178 | | screen.priority(), priority, |
| 179 | | 15); // transparent pen |
| 148 | if ((foreground && priority) || (!foreground && !priority)) |
| 149 | { |
| 150 | m_gfxdecode->gfx(3)->transpen(bitmap,cliprect, code, color, flipx, flipy, sx, sy, 15); |
| 151 | } |
| 180 | 152 | } |
| 181 | 153 | } |
| 182 | 154 | |
| 183 | 155 | UINT32 prehisle_state::screen_update_prehisle(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) |
| 184 | 156 | { |
| 185 | | screen.priority().fill(0, cliprect); |
| 186 | | |
| 187 | 157 | m_bg2_tilemap->draw(screen, bitmap, cliprect, 0, 0); |
| 188 | | m_bg_tilemap->draw(screen, bitmap, cliprect, 0, 1); |
| 189 | | m_fg_tilemap->draw(screen, bitmap, cliprect, 0, 2); |
| 190 | | draw_sprites(screen, bitmap, cliprect); |
| 191 | | |
| 158 | draw_sprites(bitmap, cliprect, 0); |
| 159 | m_bg_tilemap->draw(screen, bitmap, cliprect, 0, 0); |
| 160 | draw_sprites(bitmap, cliprect, 1); |
| 161 | m_fg_tilemap->draw(screen, bitmap, cliprect, 0, 0); |
| 192 | 162 | return 0; |
| 193 | 163 | } |