trunk/src/mess/machine/megacd.c
| r31745 | r31746 | |
| 909 | 909 | |
| 910 | 910 | void sega_segacd_device::segacd_mark_tiles_dirty(int offset) |
| 911 | 911 | { |
| 912 | | gfx(0)->mark_dirty((offset*2)/(SEGACD_BYTES_PER_TILE16)); |
| 913 | | gfx(1)->mark_dirty((offset*2)/(SEGACD_BYTES_PER_TILE16)); |
| 914 | | gfx(2)->mark_dirty((offset*2)/(SEGACD_BYTES_PER_TILE16)); |
| 915 | | gfx(3)->mark_dirty((offset*2)/(SEGACD_BYTES_PER_TILE16)); |
| 916 | | gfx(4)->mark_dirty((offset*2)/(SEGACD_BYTES_PER_TILE16)); |
| 917 | | gfx(5)->mark_dirty((offset*2)/(SEGACD_BYTES_PER_TILE16)); |
| 918 | | gfx(6)->mark_dirty((offset*2)/(SEGACD_BYTES_PER_TILE16)); |
| 919 | | gfx(7)->mark_dirty((offset*2)/(SEGACD_BYTES_PER_TILE16)); |
| 912 | m_gfx[0]->mark_dirty((offset*2)/(SEGACD_BYTES_PER_TILE16)); |
| 913 | m_gfx[1]->mark_dirty((offset*2)/(SEGACD_BYTES_PER_TILE16)); |
| 914 | m_gfx[2]->mark_dirty((offset*2)/(SEGACD_BYTES_PER_TILE16)); |
| 915 | m_gfx[3]->mark_dirty((offset*2)/(SEGACD_BYTES_PER_TILE16)); |
| 916 | m_gfx[4]->mark_dirty((offset*2)/(SEGACD_BYTES_PER_TILE16)); |
| 917 | m_gfx[5]->mark_dirty((offset*2)/(SEGACD_BYTES_PER_TILE16)); |
| 918 | m_gfx[6]->mark_dirty((offset*2)/(SEGACD_BYTES_PER_TILE16)); |
| 919 | m_gfx[7]->mark_dirty((offset*2)/(SEGACD_BYTES_PER_TILE16)); |
| 920 | 920 | |
| 921 | | gfx(8)->mark_dirty((offset*2)/(SEGACD_BYTES_PER_TILE32)); |
| 922 | | gfx(9)->mark_dirty((offset*2)/(SEGACD_BYTES_PER_TILE32)); |
| 923 | | gfx(10)->mark_dirty((offset*2)/(SEGACD_BYTES_PER_TILE32)); |
| 924 | | gfx(11)->mark_dirty((offset*2)/(SEGACD_BYTES_PER_TILE32)); |
| 925 | | gfx(12)->mark_dirty((offset*2)/(SEGACD_BYTES_PER_TILE32)); |
| 926 | | gfx(13)->mark_dirty((offset*2)/(SEGACD_BYTES_PER_TILE32)); |
| 927 | | gfx(14)->mark_dirty((offset*2)/(SEGACD_BYTES_PER_TILE32)); |
| 928 | | gfx(15)->mark_dirty((offset*2)/(SEGACD_BYTES_PER_TILE32)); |
| 921 | m_gfx[8]->mark_dirty((offset*2)/(SEGACD_BYTES_PER_TILE32)); |
| 922 | m_gfx[9]->mark_dirty((offset*2)/(SEGACD_BYTES_PER_TILE32)); |
| 923 | m_gfx[10]->mark_dirty((offset*2)/(SEGACD_BYTES_PER_TILE32)); |
| 924 | m_gfx[11]->mark_dirty((offset*2)/(SEGACD_BYTES_PER_TILE32)); |
| 925 | m_gfx[12]->mark_dirty((offset*2)/(SEGACD_BYTES_PER_TILE32)); |
| 926 | m_gfx[13]->mark_dirty((offset*2)/(SEGACD_BYTES_PER_TILE32)); |
| 927 | m_gfx[14]->mark_dirty((offset*2)/(SEGACD_BYTES_PER_TILE32)); |
| 928 | m_gfx[15]->mark_dirty((offset*2)/(SEGACD_BYTES_PER_TILE32)); |
| 929 | 929 | } |
| 930 | 930 | |
| 931 | 931 | |
| r31745 | r31746 | |
| 1060 | 1060 | int tile_region, tileno; |
| 1061 | 1061 | SCD_GET_TILE_INFO_16x16_1x1(tile_region,tileno,(int)tile_index); |
| 1062 | 1062 | |
| 1063 | | tileno %= gfx(tile_region)->elements(); |
| 1063 | tileno %= m_gfx[tile_region]->elements(); |
| 1064 | 1064 | |
| 1065 | 1065 | if (tileno==0) return 0x00; |
| 1066 | 1066 | |
| 1067 | | const UINT8* srcdata = gfx(tile_region)->get_data(tileno); |
| 1067 | const UINT8* srcdata = m_gfx[tile_region]->get_data(tileno); |
| 1068 | 1068 | return srcdata[((ypos&((1<<tilesize)-1))*(1<<tilesize))+(xpos&((1<<tilesize)-1))]; |
| 1069 | 1069 | } |
| 1070 | 1070 | |
| r31745 | r31746 | |
| 1098 | 1098 | int tile_region, tileno; |
| 1099 | 1099 | SCD_GET_TILE_INFO_32x32_1x1(tile_region,tileno,(int)tile_index); |
| 1100 | 1100 | |
| 1101 | | tileno %= gfx(tile_region)->elements(); |
| 1101 | tileno %= m_gfx[tile_region]->elements(); |
| 1102 | 1102 | |
| 1103 | 1103 | if (tileno==0) return 0x00; // does this apply in this mode? |
| 1104 | 1104 | |
| 1105 | | const UINT8* srcdata = gfx(tile_region)->get_data(tileno); |
| 1105 | const UINT8* srcdata = m_gfx[tile_region]->get_data(tileno); |
| 1106 | 1106 | return srcdata[((ypos&((1<<tilesize)-1))*(1<<tilesize))+(xpos&((1<<tilesize)-1))]; |
| 1107 | 1107 | } |
| 1108 | 1108 | |
| r31745 | r31746 | |
| 1136 | 1136 | int tile_region, tileno; |
| 1137 | 1137 | SCD_GET_TILE_INFO_16x16_16x16(tile_region,tileno,(int)tile_index); |
| 1138 | 1138 | |
| 1139 | | tileno %= gfx(tile_region)->elements(); |
| 1139 | tileno %= m_gfx[tile_region]->elements(); |
| 1140 | 1140 | |
| 1141 | 1141 | if (tileno==0) return 0x00; // does this apply in this mode |
| 1142 | 1142 | |
| 1143 | | const UINT8* srcdata = gfx(tile_region)->get_data(tileno); |
| 1143 | const UINT8* srcdata = m_gfx[tile_region]->get_data(tileno); |
| 1144 | 1144 | return srcdata[((ypos&((1<<tilesize)-1))*(1<<tilesize))+(xpos&((1<<tilesize)-1))]; |
| 1145 | 1145 | } |
| 1146 | 1146 | |
| r31745 | r31746 | |
| 1174 | 1174 | int tile_region, tileno; |
| 1175 | 1175 | SCD_GET_TILE_INFO_32x32_16x16(tile_region,tileno,(int)tile_index); |
| 1176 | 1176 | |
| 1177 | | tileno %= gfx(tile_region)->elements(); |
| 1177 | tileno %= m_gfx[tile_region]->elements(); |
| 1178 | 1178 | |
| 1179 | 1179 | if (tileno==0) return 0x00; |
| 1180 | 1180 | |
| 1181 | | const UINT8* srcdata = gfx(tile_region)->get_data(tileno); |
| 1181 | const UINT8* srcdata = m_gfx[tile_region]->get_data(tileno); |
| 1182 | 1182 | return srcdata[((ypos&((1<<tilesize)-1))*(1<<tilesize))+(xpos&((1<<tilesize)-1))]; |
| 1183 | 1183 | } |
| 1184 | 1184 | |
trunk/src/mame/video/k053250.c
| r31745 | r31746 | |
| 3 | 3 | const device_type K053250 = &device_creator<k053250_device>; |
| 4 | 4 | |
| 5 | 5 | k053250_device::k053250_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) |
| 6 | | : device_t(mconfig, K053250, "K053250 Road Generator", tag, owner, clock, "k053250", __FILE__), |
| 6 | : device_t(mconfig, K053250, "K053250 LVC", tag, owner, clock, "k053250", __FILE__), |
| 7 | 7 | device_gfx_interface(mconfig, *this), |
| 8 | 8 | device_video_interface(mconfig, *this) |
| 9 | 9 | { |
| r31745 | r31746 | |
| 351 | 351 | linedata_offs += line_start * linedata_adv; // pre-advance line info offset for the clipped region |
| 352 | 352 | |
| 353 | 353 | // load physical palette base |
| 354 | | pal_base = palette()->pens() + (colorbase << 4) % palette()->entries(); |
| 354 | pal_base = m_palette->pens() + (colorbase << 4) % m_palette->entries(); |
| 355 | 355 | |
| 356 | 356 | // walk the target bitmap within the visible area vertically or horizontally, one line at a time |
| 357 | 357 | for (line_pos=line_start; line_pos <= line_end; linedata_offs += linedata_adv, line_pos++) |
trunk/src/mame/video/k053244_k053245.c
| r31745 | r31746 | |
| 121 | 121 | |
| 122 | 122 | /* decode the graphics */ |
| 123 | 123 | decode_gfx(); |
| 124 | | gfx(0)->set_colors(palette()->entries() / gfx(0)->depth()); |
| 124 | m_gfx[0]->set_colors(m_palette->entries() / m_gfx[0]->depth()); |
| 125 | 125 | |
| 126 | | if (VERBOSE && !(palette()->shadows_enabled())) |
| 126 | if (VERBOSE && !(m_palette->shadows_enabled())) |
| 127 | 127 | popmessage("driver should use VIDEO_HAS_SHADOWS"); |
| 128 | 128 | |
| 129 | 129 | m_ramsize = 0x800; |
| r31745 | r31746 | |
| 456 | 456 | ox -= (zoomx * w) >> 13; |
| 457 | 457 | oy -= (zoomy * h) >> 13; |
| 458 | 458 | |
| 459 | | drawmode_table[gfx(0)->granularity() - 1] = shadow ? DRAWMODE_SHADOW : DRAWMODE_SOURCE; |
| 459 | drawmode_table[m_gfx[0]->granularity() - 1] = shadow ? DRAWMODE_SHADOW : DRAWMODE_SOURCE; |
| 460 | 460 | |
| 461 | 461 | for (y = 0; y < h; y++) |
| 462 | 462 | { |
| r31745 | r31746 | |
| 520 | 520 | |
| 521 | 521 | if (zoomx == 0x10000 && zoomy == 0x10000) |
| 522 | 522 | { |
| 523 | | gfx(0)->prio_transtable(bitmap,cliprect, |
| 523 | m_gfx[0]->prio_transtable(bitmap,cliprect, |
| 524 | 524 | c,color, |
| 525 | 525 | fx,fy, |
| 526 | 526 | sx,sy, |
| r31745 | r31746 | |
| 529 | 529 | } |
| 530 | 530 | else |
| 531 | 531 | { |
| 532 | | gfx(0)->prio_zoom_transtable(bitmap,cliprect, |
| 532 | m_gfx[0]->prio_zoom_transtable(bitmap,cliprect, |
| 533 | 533 | c,color, |
| 534 | 534 | fx,fy, |
| 535 | 535 | sx,sy, |
trunk/src/mame/video/gp9001.c
| r31745 | r31746 | |
| 677 | 677 | |
| 678 | 678 | if (sp.use_sprite_buffer) source = sp.vram16_buffer; |
| 679 | 679 | else source = m_spriteram; |
| 680 | | gfx_element *spritegfx = gfx(1); |
| 681 | | int total_elements = spritegfx->elements(); |
| 682 | | int total_colors = spritegfx->colors(); |
| 680 | int total_elements = m_gfx[1]->elements(); |
| 681 | int total_colors = m_gfx[1]->colors(); |
| 683 | 682 | |
| 684 | 683 | int old_x = (-(sp.scrollx)) & 0x1ff; |
| 685 | 684 | int old_y = (-(sp.scrolly)) & 0x1ff; |
| r31745 | r31746 | |
| 780 | 779 | */ |
| 781 | 780 | sprite %= total_elements; |
| 782 | 781 | color %= total_colors; |
| 783 | | const pen_t *paldata = &palette()->pen(color * 16); |
| 782 | const pen_t *paldata = &m_palette->pen(color * 16); |
| 784 | 783 | { |
| 785 | 784 | int yy, xx; |
| 786 | | const UINT8* srcdata = spritegfx->get_data(sprite); |
| 785 | const UINT8* srcdata = m_gfx[1]->get_data(sprite); |
| 787 | 786 | int count = 0; |
| 788 | 787 | int ystart, yend, yinc; |
| 789 | 788 | int xstart, xend, xinc; |
trunk/src/mame/video/k051960.c
| r31745 | r31746 | |
| 2 | 2 | Konami 051960/051937 |
| 3 | 3 | ------------- |
| 4 | 4 | Sprite generators. Designed to work in pair. The 051960 manages the sprite |
| 5 | | list and produces and address that is fed to the gfx ROMs. The data from the |
| 5 | list and produces an address that is fed to the gfx ROMs. The data from the |
| 6 | 6 | ROMs is sent to the 051937, along with color code and other stuff from the |
| 7 | 7 | 051960. The 051937 outputs up to 12 bits of palette index, plus "shadow" and |
| 8 | 8 | transparency information. |
| r31745 | r31746 | |
| 16 | 16 | or more of the "color attribute" bits of the sprites as bank selectors. |
| 17 | 17 | Moreover a few games store the gfx data in the ROMs in a format different from |
| 18 | 18 | the one expected by the 051960, and use external logic to reorder the address |
| 19 | | lines. |
| 19 | and/or data lines. |
| 20 | 20 | The 051960 can also genenrate IRQ, FIRQ and NMI signals. |
| 21 | 21 | |
| 22 | 22 | memory map: |
| r31745 | r31746 | |
| 75 | 75 | 128*8 |
| 76 | 76 | }; |
| 77 | 77 | |
| 78 | // cuebrick, mia and tmnt connect the lower four output lines from the K051937 |
| 79 | // (i.e. the ones outputting ROM data rather than attribute data) to the mixer |
| 80 | // in reverse order. |
| 78 | 81 | const gfx_layout k051960_device::spritelayout_reverse = |
| 79 | 82 | { |
| 80 | 83 | 16,16, |
| r31745 | r31746 | |
| 88 | 91 | 128*8 |
| 89 | 92 | }; |
| 90 | 93 | |
| 94 | // In gradius3, the gfx ROMs are directly connected to one of the 68K CPUs |
| 95 | // rather than being read the usual way; moreover, the ROM data lines are |
| 96 | // connected in different ways to the 68K and to the K051937. |
| 97 | // Rather than copy the ROM region and bitswap one copy, we (currently) |
| 98 | // just use an alternate gfx layout for this game. |
| 91 | 99 | const gfx_layout k051960_device::spritelayout_gradius3 = |
| 92 | 100 | { |
| 93 | 101 | 16,16, |
| r31745 | r31746 | |
| 160 | 168 | m_sprite_size = region()->bytes(); |
| 161 | 169 | |
| 162 | 170 | decode_gfx(); |
| 163 | | gfx(0)->set_colors(palette()->entries() / gfx(0)->depth()); |
| 171 | m_gfx[0]->set_colors(m_palette->entries() / m_gfx[0]->depth()); |
| 164 | 172 | |
| 165 | | if (VERBOSE && !(palette()->shadows_enabled())) |
| 173 | if (VERBOSE && !(m_palette->shadows_enabled())) |
| 166 | 174 | popmessage("driver should use VIDEO_HAS_SHADOWS"); |
| 167 | 175 | |
| 168 | 176 | m_ram = auto_alloc_array_clear(machine(), UINT8, 0x400); |
| r31745 | r31746 | |
| 455 | 463 | flipy = !flipy; |
| 456 | 464 | } |
| 457 | 465 | |
| 458 | | drawmode_table[gfx(0)->granularity() - 1] = shadow ? DRAWMODE_SHADOW : DRAWMODE_SOURCE; |
| 466 | drawmode_table[m_gfx[0]->granularity() - 1] = shadow ? DRAWMODE_SHADOW : DRAWMODE_SOURCE; |
| 459 | 467 | |
| 460 | 468 | if (zoomx == 0x10000 && zoomy == 0x10000) |
| 461 | 469 | { |
| r31745 | r31746 | |
| 481 | 489 | c += yoffset[y]; |
| 482 | 490 | |
| 483 | 491 | if (max_priority == -1) |
| 484 | | gfx(0)->prio_transtable(bitmap,cliprect, |
| 492 | m_gfx[0]->prio_transtable(bitmap,cliprect, |
| 485 | 493 | c,color, |
| 486 | 494 | flipx,flipy, |
| 487 | 495 | sx & 0x1ff,sy, |
| 488 | 496 | priority_bitmap,pri, |
| 489 | 497 | drawmode_table); |
| 490 | 498 | else |
| 491 | | gfx(0)->transtable(bitmap,cliprect, |
| 499 | m_gfx[0]->transtable(bitmap,cliprect, |
| 492 | 500 | c,color, |
| 493 | 501 | flipx,flipy, |
| 494 | 502 | sx & 0x1ff,sy, |
| r31745 | r31746 | |
| 522 | 530 | c += yoffset[y]; |
| 523 | 531 | |
| 524 | 532 | if (max_priority == -1) |
| 525 | | gfx(0)->prio_zoom_transtable(bitmap,cliprect, |
| 533 | m_gfx[0]->prio_zoom_transtable(bitmap,cliprect, |
| 526 | 534 | c,color, |
| 527 | 535 | flipx,flipy, |
| 528 | 536 | sx & 0x1ff,sy, |
| r31745 | r31746 | |
| 530 | 538 | priority_bitmap,pri, |
| 531 | 539 | drawmode_table); |
| 532 | 540 | else |
| 533 | | gfx(0)->zoom_transtable(bitmap,cliprect, |
| 541 | m_gfx[0]->zoom_transtable(bitmap,cliprect, |
| 534 | 542 | c,color, |
| 535 | 543 | flipx,flipy, |
| 536 | 544 | sx & 0x1ff,sy, |
trunk/src/mame/video/k052109.h
| r31745 | r31746 | |
| 26 | 26 | static void set_k052109_callback(device_t &device, k052109_cb_delegate callback) { downcast<k052109_device &>(device).m_k052109_cb = callback; } |
| 27 | 27 | static void set_ram(device_t &device, bool ram); |
| 28 | 28 | |
| 29 | | // static configuration |
| 30 | | static void static_set_gfxdecode_tag(device_t &device, const char *tag); |
| 31 | | static void static_set_palette_tag(device_t &device, const char *tag); |
| 32 | | |
| 33 | 29 | /* |
| 34 | | You don't have to decode the graphics: the vh_start() routines will do that |
| 35 | | for you, using the plane order passed. |
| 36 | | Of course the ROM data must be in the correct order. This is a way to ensure |
| 37 | | that the ROM test will pass. |
| 38 | | The konami_rom_deinterleave() function in konami_helper.h will do the reorganization for |
| 39 | | you in most cases (but see tmnt.c for additional bit rotations or byte |
| 40 | | permutations which may be required). |
| 41 | | |
| 42 | 30 | The callback is passed: |
| 43 | 31 | - layer number (0 = FIX, 1 = A, 2 = B) |
| 44 | 32 | - bank (range 0-3, output of the pins CAB1 and CAB2) |