| Previous | 199869 Revisions | Next |
| r17670 Thursday 6th September, 2012 at 06:19:32 UTC by Aaron Giles |
|---|
| gfx_element is now a class. Accessors are provided for all necessary elements. Updated some of the more, ah, creative uses/abuses of the gfx_elements. [Aaron Giles] |
| [src/emu] | drawgfx.c drawgfx.h drawgfxm.h emupal.c emupal.h tilemap.c tilemap.h uigfx.c video.c |
| [src/emu/machine] | tc009xlvc.c |
| [src/mame/drivers] | 1945kiii.c ace.c acefruit.c amaticmg.c aristmk4.c avt.c blackt96.c bmcpokr.c bnstars.c buster.c chsuper.c cmmb.c coinmvga.c coolridr.c cps3.c cvs.c cybertnk.c cyclemb.c ddealer.c deco_ld.c dmndrby.c dominob.c dreamwld.c drtomy.c fastfred.c flipjack.c galaxian.c gamecstl.c igs017.c jackpool.c jclub2.c liberate.c limenko.c mastboy.c mediagx.c mirax.c mogura.c mpoker.c mpu4vid.c murogmbl.c mwarr.c namcoic.c namcos23.c neoprint.c pgm.c pinkiri8.c poo.c powerbal.c rabbit.c raiden2.c rgum.c segas16b.c segas18.c srmp5.c srmp6.c ssv.c sub.c summit.c suprnova.c taito_l.c tasman.c tmmjprd.c trvmadns.c vamphalf.c vpoker.c |
| [src/mame/includes] | namcos2.h |
| [src/mame/machine] | atarigen.c megacd.c |
| [src/mame/video] | aerofgt.c angelkds.c appoooh.c arcadecl.c armedf.c atarimo.c atarisy1.c bankp.c battlera.c battlex.c bbusters.c bigstrkb.c bionicc.c btime.c buggychl.c bwing.c cave.c cclimber.c champbas.c cheekyms.c circus.c combatsc.c ddragon.c deco32.c deco_mlc.c decocass.c djmain.c docastle.c drgnmst.c equites.c exerion.c f1gp.c fcombat.c finalizr.c fitfight.c flower.c foodf.c fuukifg2.c fuukifg3.c gaelco.c gaelco2.c gaiden.c galaxold.c gaplus.c glass.c gng.c goldstar.c gottlieb.c gp9001.c gradius3.c grchamp.c hng64.c hyprduel.c jalblend.c jalblend.h kaneko_spr.c kaneko_spr.h kickgoal.c kncljoe.c konamigx.c konamiic.c konicdev.c lemmings.c m10.c m52.c macrossp.c madalien.c mainsnk.c marineb.c mcr.c mcr68.c mermaid.c metro.c mrflea.c ms32.c mugsmash.c munchmo.c mustache.c mystston.c mystwarr.c namcona1.c namcos1.c namcos22.c namcos86.c nemesis.c ninjakd2.c nova2001.c oneshot.c othunder.c pacland.c pirates.c playmark.c plygonet.c polepos.c polyplay.c psikyo4.c psikyosh.c rainbow.c relief.c rungun.c sderby.c segag80r.c segaic24.c seibuspi.c seta.c seta2.c shadfrce.c shangkid.c shootout.c sidearms.c silkroad.c slapshot.c snk.c snk6502.c snk68.c spbactn.c spdodgeb.c speedspn.c splash.c sprint2.c sprint4.c sslam.c ssv.c st0016.c st0020.c starshp1.c stlforce.c stvvdp2.c suprnova.c suprslam.c tail2nos.c taito_f2.c taito_f3.c taito_l.c taitoic.c taitojc.c taitosj.c taotaido.c targeth.c tatsumi.c tceptor.c tecmo16.c terracre.c tetrisp2.c thepit.c thoop2.c tiamc1.c toaplan1.c toaplan2.c tryout.c ultratnk.c usgames.c vball.c vulgus.c wecleman.c wgp.c williams.c wrally.c wwfsstar.c wwfwfest.c xevious.c xxmissio.c zac2650.c zaxxon.c |
| [src/mess/drivers] | a5105.c b16.c fp6000.c jr200.c mz2500.c paso1600.c pc88va.c pv1000.c smc777.c supracan.c vboy.c x1.c |
| [src/mess/machine] | cgenie.c |
| [src/mess/video] | 911_vdt.c apple1.c cbmb.c iq151_video32.c iq151_video64.c mz700.c vdc8563.c x68k.c |
| r17669 | r17670 | |
|---|---|---|
| 1911 | 1911 | |
| 1912 | 1912 | static void segacd_mark_tiles_dirty(running_machine& machine, int offset) |
| 1913 | 1913 | { |
| 1914 | gfx_element_mark_dirty(machine.gfx[0], (offset*2)/(SEGACD_BYTES_PER_TILE16)); | |
| 1915 | gfx_element_mark_dirty(machine.gfx[1], (offset*2)/(SEGACD_BYTES_PER_TILE16)); | |
| 1916 | gfx_element_mark_dirty(machine.gfx[2], (offset*2)/(SEGACD_BYTES_PER_TILE16)); | |
| 1917 | gfx_element_mark_dirty(machine.gfx[3], (offset*2)/(SEGACD_BYTES_PER_TILE16)); | |
| 1918 | gfx_element_mark_dirty(machine.gfx[4], (offset*2)/(SEGACD_BYTES_PER_TILE16)); | |
| 1919 | gfx_element_mark_dirty(machine.gfx[5], (offset*2)/(SEGACD_BYTES_PER_TILE16)); | |
| 1920 | gfx_element_mark_dirty(machine.gfx[6], (offset*2)/(SEGACD_BYTES_PER_TILE16)); | |
| 1921 | gfx_element_mark_dirty(machine.gfx[7], (offset*2)/(SEGACD_BYTES_PER_TILE16)); | |
| 1914 | machine.gfx[0]->mark_dirty((offset*2)/(SEGACD_BYTES_PER_TILE16)); | |
| 1915 | machine.gfx[1]->mark_dirty((offset*2)/(SEGACD_BYTES_PER_TILE16)); | |
| 1916 | machine.gfx[2]->mark_dirty((offset*2)/(SEGACD_BYTES_PER_TILE16)); | |
| 1917 | machine.gfx[3]->mark_dirty((offset*2)/(SEGACD_BYTES_PER_TILE16)); | |
| 1918 | machine.gfx[4]->mark_dirty((offset*2)/(SEGACD_BYTES_PER_TILE16)); | |
| 1919 | machine.gfx[5]->mark_dirty((offset*2)/(SEGACD_BYTES_PER_TILE16)); | |
| 1920 | machine.gfx[6]->mark_dirty((offset*2)/(SEGACD_BYTES_PER_TILE16)); | |
| 1921 | machine.gfx[7]->mark_dirty((offset*2)/(SEGACD_BYTES_PER_TILE16)); | |
| 1922 | 1922 | |
| 1923 | gfx_element_mark_dirty(machine.gfx[8], (offset*2)/(SEGACD_BYTES_PER_TILE32)); | |
| 1924 | gfx_element_mark_dirty(machine.gfx[9], (offset*2)/(SEGACD_BYTES_PER_TILE32)); | |
| 1925 | gfx_element_mark_dirty(machine.gfx[10],(offset*2)/(SEGACD_BYTES_PER_TILE32)); | |
| 1926 | gfx_element_mark_dirty(machine.gfx[11],(offset*2)/(SEGACD_BYTES_PER_TILE32)); | |
| 1927 | gfx_element_mark_dirty(machine.gfx[12],(offset*2)/(SEGACD_BYTES_PER_TILE32)); | |
| 1928 | gfx_element_mark_dirty(machine.gfx[13],(offset*2)/(SEGACD_BYTES_PER_TILE32)); | |
| 1929 | gfx_element_mark_dirty(machine.gfx[14],(offset*2)/(SEGACD_BYTES_PER_TILE32)); | |
| 1930 | gfx_element_mark_dirty(machine.gfx[15],(offset*2)/(SEGACD_BYTES_PER_TILE32)); | |
| 1923 | machine.gfx[8]->mark_dirty((offset*2)/(SEGACD_BYTES_PER_TILE32)); | |
| 1924 | machine.gfx[9]->mark_dirty((offset*2)/(SEGACD_BYTES_PER_TILE32)); | |
| 1925 | machine.gfx[10]->mark_dirty((offset*2)/(SEGACD_BYTES_PER_TILE32)); | |
| 1926 | machine.gfx[11]->mark_dirty((offset*2)/(SEGACD_BYTES_PER_TILE32)); | |
| 1927 | machine.gfx[12]->mark_dirty((offset*2)/(SEGACD_BYTES_PER_TILE32)); | |
| 1928 | machine.gfx[13]->mark_dirty((offset*2)/(SEGACD_BYTES_PER_TILE32)); | |
| 1929 | machine.gfx[14]->mark_dirty((offset*2)/(SEGACD_BYTES_PER_TILE32)); | |
| 1930 | machine.gfx[15]->mark_dirty((offset*2)/(SEGACD_BYTES_PER_TILE32)); | |
| 1931 | 1931 | } |
| 1932 | 1932 | |
| 1933 | 1933 | |
| r17669 | r17670 | |
| 2072 | 2072 | int tile_region, tileno; |
| 2073 | 2073 | SCD_GET_TILE_INFO_16x16_1x1(tile_region,tileno,(int)tile_index); |
| 2074 | 2074 | |
| 2075 | const gfx_element *gfx = machine.gfx[tile_region]; | |
| 2076 | tileno %= gfx->total_elements; | |
| 2075 | gfx_element *gfx = machine.gfx[tile_region]; | |
| 2076 | tileno %= gfx->elements(); | |
| 2077 | 2077 | |
| 2078 | 2078 | if (tileno==0) return 0x00; |
| 2079 | 2079 | |
| 2080 | const UINT8* srcdata = gfx | |
| 2080 | const UINT8* srcdata = gfx-> | |
| 2081 | 2081 | return srcdata[((ypos&((1<<tilesize)-1))*(1<<tilesize))+(xpos&((1<<tilesize)-1))]; |
| 2082 | 2082 | } |
| 2083 | 2083 | |
| r17669 | r17670 | |
| 2111 | 2111 | int tile_region, tileno; |
| 2112 | 2112 | SCD_GET_TILE_INFO_32x32_1x1(tile_region,tileno,(int)tile_index); |
| 2113 | 2113 | |
| 2114 | const gfx_element *gfx = machine.gfx[tile_region]; | |
| 2115 | tileno %= gfx->total_elements; | |
| 2114 | gfx_element *gfx = machine.gfx[tile_region]; | |
| 2115 | tileno %= gfx->elements(); | |
| 2116 | 2116 | |
| 2117 | 2117 | if (tileno==0) return 0x00; // does this apply in this mode? |
| 2118 | 2118 | |
| 2119 | const UINT8* srcdata = gfx | |
| 2119 | const UINT8* srcdata = gfx-> | |
| 2120 | 2120 | return srcdata[((ypos&((1<<tilesize)-1))*(1<<tilesize))+(xpos&((1<<tilesize)-1))]; |
| 2121 | 2121 | } |
| 2122 | 2122 | |
| r17669 | r17670 | |
| 2150 | 2150 | int tile_region, tileno; |
| 2151 | 2151 | SCD_GET_TILE_INFO_16x16_16x16(tile_region,tileno,(int)tile_index); |
| 2152 | 2152 | |
| 2153 | const gfx_element *gfx = machine.gfx[tile_region]; | |
| 2154 | tileno %= gfx->total_elements; | |
| 2153 | gfx_element *gfx = machine.gfx[tile_region]; | |
| 2154 | tileno %= gfx->elements(); | |
| 2155 | 2155 | |
| 2156 | 2156 | if (tileno==0) return 0x00; // does this apply in this mode |
| 2157 | 2157 | |
| 2158 | const UINT8* srcdata = gfx | |
| 2158 | const UINT8* srcdata = gfx-> | |
| 2159 | 2159 | return srcdata[((ypos&((1<<tilesize)-1))*(1<<tilesize))+(xpos&((1<<tilesize)-1))]; |
| 2160 | 2160 | } |
| 2161 | 2161 | |
| r17669 | r17670 | |
| 2189 | 2189 | int tile_region, tileno; |
| 2190 | 2190 | SCD_GET_TILE_INFO_32x32_16x16(tile_region,tileno,(int)tile_index); |
| 2191 | 2191 | |
| 2192 | const gfx_element *gfx = machine.gfx[tile_region]; | |
| 2193 | tileno %= gfx->total_elements; | |
| 2192 | gfx_element *gfx = machine.gfx[tile_region]; | |
| 2193 | tileno %= gfx->elements(); | |
| 2194 | 2194 | |
| 2195 | 2195 | if (tileno==0) return 0x00; |
| 2196 | 2196 | |
| 2197 | const UINT8* srcdata = gfx | |
| 2197 | const UINT8* srcdata = gfx-> | |
| 2198 | 2198 | return srcdata[((ypos&((1<<tilesize)-1))*(1<<tilesize))+(xpos&((1<<tilesize)-1))]; |
| 2199 | 2199 | } |
| 2200 | 2200 | |
| r17669 | r17670 | |
| 2286 | 2286 | |
| 2287 | 2287 | |
| 2288 | 2288 | /* create the char set (gfx will then be updated dynamically from RAM) */ |
| 2289 | machine.gfx[0] = gfx_element_alloc(machine, &sega_16x16_r00_f0_layout, (UINT8 *)segacd_dataram, 0, 0); | |
| 2290 | machine.gfx[1] = gfx_element_alloc(machine, &sega_16x16_r01_f0_layout, (UINT8 *)segacd_dataram, 0, 0); | |
| 2291 | machine.gfx[2] = gfx_element_alloc(machine, &sega_16x16_r10_f0_layout, (UINT8 *)segacd_dataram, 0, 0); | |
| 2292 | machine.gfx[3] = gfx_element_alloc(machine, &sega_16x16_r11_f0_layout, (UINT8 *)segacd_dataram, 0, 0); | |
| 2293 | machine.gfx[4] = gfx_element_alloc(machine, &sega_16x16_r00_f1_layout, (UINT8 *)segacd_dataram, 0, 0); | |
| 2294 | machine.gfx[5] = gfx_element_alloc(machine, &sega_16x16_r11_f1_layout, (UINT8 *)segacd_dataram, 0, 0); | |
| 2295 | machine.gfx[6] = gfx_element_alloc(machine, &sega_16x16_r10_f1_layout, (UINT8 *)segacd_dataram, 0, 0); | |
| 2296 | machine.gfx[7] = gfx_element_alloc(machine, &sega_16x16_r01_f1_layout, (UINT8 *)segacd_dataram, 0, 0); | |
| 2289 | machine.gfx[0] = auto_alloc(machine, gfx_element(machine, sega_16x16_r00_f0_layout, (UINT8 *)segacd_dataram, 0, 0)); | |
| 2290 | machine.gfx[1] = auto_alloc(machine, gfx_element(machine, sega_16x16_r01_f0_layout, (UINT8 *)segacd_dataram, 0, 0)); | |
| 2291 | machine.gfx[2] = auto_alloc(machine, gfx_element(machine, sega_16x16_r10_f0_layout, (UINT8 *)segacd_dataram, 0, 0)); | |
| 2292 | machine.gfx[3] = auto_alloc(machine, gfx_element(machine, sega_16x16_r11_f0_layout, (UINT8 *)segacd_dataram, 0, 0)); | |
| 2293 | machine.gfx[4] = auto_alloc(machine, gfx_element(machine, sega_16x16_r00_f1_layout, (UINT8 *)segacd_dataram, 0, 0)); | |
| 2294 | machine.gfx[5] = auto_alloc(machine, gfx_element(machine, sega_16x16_r11_f1_layout, (UINT8 *)segacd_dataram, 0, 0)); | |
| 2295 | machine.gfx[6] = auto_alloc(machine, gfx_element(machine, sega_16x16_r10_f1_layout, (UINT8 *)segacd_dataram, 0, 0)); | |
| 2296 | machine.gfx[7] = auto_alloc(machine, gfx_element(machine, sega_16x16_r01_f1_layout, (UINT8 *)segacd_dataram, 0, 0)); | |
| 2297 | 2297 | |
| 2298 | machine.gfx[8] = gfx_element_alloc(machine, &sega_32x32_r00_f0_layout, (UINT8 *)segacd_dataram, 0, 0); | |
| 2299 | machine.gfx[9] = gfx_element_alloc(machine, &sega_32x32_r01_f0_layout, (UINT8 *)segacd_dataram, 0, 0); | |
| 2300 | machine.gfx[10]= gfx_element_alloc(machine, &sega_32x32_r10_f0_layout, (UINT8 *)segacd_dataram, 0, 0); | |
| 2301 | machine.gfx[11]= gfx_element_alloc(machine, &sega_32x32_r11_f0_layout, (UINT8 *)segacd_dataram, 0, 0); | |
| 2302 | machine.gfx[12]= gfx_element_alloc(machine, &sega_32x32_r00_f1_layout, (UINT8 *)segacd_dataram, 0, 0); | |
| 2303 | machine.gfx[13]= gfx_element_alloc(machine, &sega_32x32_r11_f1_layout, (UINT8 *)segacd_dataram, 0, 0); | |
| 2304 | machine.gfx[14]= gfx_element_alloc(machine, &sega_32x32_r10_f1_layout, (UINT8 *)segacd_dataram, 0, 0); | |
| 2305 | machine.gfx[15]= gfx_element_alloc(machine, &sega_32x32_r01_f1_layout, (UINT8 *)segacd_dataram, 0, 0); | |
| 2298 | machine.gfx[8] = auto_alloc(machine, gfx_element(machine, sega_32x32_r00_f0_layout, (UINT8 *)segacd_dataram, 0, 0)); | |
| 2299 | machine.gfx[9] = auto_alloc(machine, gfx_element(machine, sega_32x32_r01_f0_layout, (UINT8 *)segacd_dataram, 0, 0)); | |
| 2300 | machine.gfx[10]= auto_alloc(machine, gfx_element(machine, sega_32x32_r10_f0_layout, (UINT8 *)segacd_dataram, 0, 0)); | |
| 2301 | machine.gfx[11]= auto_alloc(machine, gfx_element(machine, sega_32x32_r11_f0_layout, (UINT8 *)segacd_dataram, 0, 0)); | |
| 2302 | machine.gfx[12]= auto_alloc(machine, gfx_element(machine, sega_32x32_r00_f1_layout, (UINT8 *)segacd_dataram, 0, 0)); | |
| 2303 | machine.gfx[13]= auto_alloc(machine, gfx_element(machine, sega_32x32_r11_f1_layout, (UINT8 *)segacd_dataram, 0, 0)); | |
| 2304 | machine.gfx[14]= auto_alloc(machine, gfx_element(machine, sega_32x32_r10_f1_layout, (UINT8 *)segacd_dataram, 0, 0)); | |
| 2305 | machine.gfx[15]= auto_alloc(machine, gfx_element(machine, sega_32x32_r01_f1_layout, (UINT8 *)segacd_dataram, 0, 0)); | |
| 2306 | 2306 | |
| 2307 | 2307 | segacd_stampmap[0] = tilemap_create(machine, get_stampmap_16x16_1x1_tile_info, TILEMAP_SCAN_ROWS, 16, 16, 16, 16); |
| 2308 | 2308 | segacd_stampmap[1] = tilemap_create(machine, get_stampmap_32x32_1x1_tile_info, TILEMAP_SCAN_ROWS, 32, 32, 8, 8); |
| r17669 | r17670 | |
|---|---|---|
| 1516 | 1516 | int c, x, y; |
| 1517 | 1517 | |
| 1518 | 1518 | /* allocate memory for the assembled data */ |
| 1519 | srcdata = auto_alloc_array(machine, UINT8, gx0-> | |
| 1519 | srcdata = auto_alloc_array(machine, UINT8, gx0-> | |
| 1520 | 1520 | |
| 1521 | 1521 | /* loop over elements */ |
| 1522 | 1522 | dest = srcdata; |
| 1523 | for (c = 0; c < gx0-> | |
| 1523 | for (c = 0; c < gx0-> | |
| 1524 | 1524 | { |
| 1525 | const UINT8 *c0base = gfx_element_get_data(gx0, c); | |
| 1526 | const UINT8 *c1base = gfx_element_get_data(gx1, c); | |
| 1525 | const UINT8 *c0base = gx0->get_data(c); | |
| 1526 | const UINT8 *c1base = gx1->get_data(c); | |
| 1527 | 1527 | |
| 1528 | 1528 | /* loop over height */ |
| 1529 | for (y = 0; y < gx0->height; y++) | |
| 1529 | for (y = 0; y < gx0->height(); y++) | |
| 1530 | 1530 | { |
| 1531 | 1531 | const UINT8 *c0 = c0base; |
| 1532 | 1532 | const UINT8 *c1 = c1base; |
| 1533 | 1533 | |
| 1534 | for (x = 0; x < gx0->width; x++) | |
| 1534 | for (x = 0; x < gx0->width(); x++) | |
| 1535 | 1535 | *dest++ = (*c0++ & mask0) | (*c1++ & mask1); |
| 1536 | c0base += gx0->line_modulo; | |
| 1537 | c1base += gx1->line_modulo; | |
| 1536 | c0base += gx0->rowbytes(); | |
| 1537 | c1base += gx1->rowbytes(); | |
| 1538 | 1538 | } |
| 1539 | 1539 | } |
| 1540 | ||
| 1541 | // int newdepth = gx0->depth() * gx1->depth(); | |
| 1542 | int granularity = gx0->granularity(); | |
| 1543 | gx0->set_raw_layout(srcdata, gx0->width(), gx0->height(), gx0->elements(), 8 * gx0->width(), 8 * gx0->width() * gx0->height()); | |
| 1544 | gx0->set_granularity(granularity); | |
| 1540 | 1545 | |
| 1541 | 1546 | /* free the second graphics element */ |
| 1542 | gfx_element_free(gx1); | |
| 1543 | 1547 | machine.gfx[gfx1] = NULL; |
| 1544 | ||
| 1545 | /* create a simple target layout */ | |
| 1546 | gx0->layout.planes = 8; | |
| 1547 | for (x = 0; x < 8; x++) | |
| 1548 | gx0->layout.planeoffset[x] = x; | |
| 1549 | for (x = 0; x < gx0->width; x++) | |
| 1550 | gx0->layout.xoffset[x] = 8 * x; | |
| 1551 | for (y = 0; y < gx0->height; y++) | |
| 1552 | gx0->layout.yoffset[y] = 8 * y * gx0->width; | |
| 1553 | gx0->layout.charincrement = 8 * gx0->width * gx0->height; | |
| 1554 | ||
| 1555 | /* make the assembled data our new source data */ | |
| 1556 | gfx_element_set_source(gx0, srcdata); | |
| 1548 | auto_free(machine, gx1); | |
| 1557 | 1549 | } |
| 1558 | 1550 | |
| 1559 | 1551 |
| r17669 | r17670 | |
|---|---|---|
| 170 | 170 | |
| 171 | 171 | public: |
| 172 | 172 | // general |
| 173 | void zdrawgfxzoom(bitmap_ind16 &dest_bmp, const rectangle &clip, const gfx_element *gfx, UINT32 code, UINT32 color, int flipx, int flipy, int sx, int sy, int scalex, int scaley, int zpos); | |
| 174 | void zdrawgfxzoom(bitmap_rgb32 &dest_bmp, const rectangle &clip, const gfx_element *gfx, UINT32 code, UINT32 color, int flipx, int flipy, int sx, int sy, int scalex, int scaley, int zpos); | |
| 173 | void zdrawgfxzoom(bitmap_ind16 &dest_bmp, const rectangle &clip, gfx_element *gfx, UINT32 code, UINT32 color, int flipx, int flipy, int sx, int sy, int scalex, int scaley, int zpos); | |
| 174 | void zdrawgfxzoom(bitmap_rgb32 &dest_bmp, const rectangle &clip, gfx_element *gfx, UINT32 code, UINT32 color, int flipx, int flipy, int sx, int sy, int scalex, int scaley, int zpos); | |
| 175 | 175 | }; |
| 176 | 176 | |
| 177 | 177 | class namcos2_state : public namcos2_shared_state |
| r17669 | r17670 | |
|---|---|---|
| 108 | 108 | { |
| 109 | 109 | targeth_state *state = machine.driver_data<targeth_state>(); |
| 110 | 110 | int i; |
| 111 | | |
| 111 | | |
| 112 | 112 | |
| 113 | 113 | for (i = 3; i < (0x1000 - 6)/2; i += 4){ |
| 114 | 114 | int sx = state->m_spriteram[i+2] & 0x03ff; |
| r17669 | r17670 | |
|---|---|---|
| 108 | 108 | for (offs = state->m_spriteram.bytes() / 2 - 8; offs >= 0; offs -= 8) |
| 109 | 109 | { |
| 110 | 110 | int tile = spriteram[offs]; |
| 111 | if (tile < screen.machine().gfx[1]-> | |
| 111 | if (tile < screen.machine().gfx[1]-> | |
| 112 | 112 | { |
| 113 | 113 | int sx,sy,color,data1; |
| 114 | 114 |
| r17669 | r17670 | |
|---|---|---|
| 28 | 28 | { |
| 29 | 29 | const UINT8 *color_prom = machine.root_device().memregion("proms")->base(); |
| 30 | 30 | int i; |
| 31 | #define TOTAL_COLORS(gfxn) (machine.gfx[gfxn]-> | |
| 31 | #define TOTAL_COLORS(gfxn) (machine.gfx[gfxn]-> | |
| 32 | 32 | |
| 33 | 33 | machine.colortable = colortable_alloc(machine, 128+1); |
| 34 | 34 | |
| r17669 | r17670 | |
| 69 | 69 | /* background tiles */ |
| 70 | 70 | for (i = 0;i < TOTAL_COLORS(1);i++) |
| 71 | 71 | { |
| 72 | colortable_entry_set_value(machine.colortable, machine.gfx[1]->color | |
| 72 | colortable_entry_set_value(machine.colortable, machine.gfx[1]->color | |
| 73 | 73 | (color_prom[0] & 0x0f) | ((color_prom[TOTAL_COLORS(1)] & 0x0f) << 4)); |
| 74 | 74 | |
| 75 | 75 | color_prom++; |
| r17669 | r17670 | |
| 81 | 81 | { |
| 82 | 82 | int c = (color_prom[0] & 0x0f) | ((color_prom[TOTAL_COLORS(2)] & 0x0f) << 4); |
| 83 | 83 | |
| 84 | colortable_entry_set_value(machine.colortable, machine.gfx[2]->color | |
| 84 | colortable_entry_set_value(machine.colortable, machine.gfx[2]->color | |
| 85 | 85 | (c & 0x80) ? (c & 0x7f) : 0x80); |
| 86 | 86 | |
| 87 | 87 | color_prom++; |
| r17669 | r17670 | |
| 91 | 91 | /* foreground characters */ |
| 92 | 92 | for (i = 0;i < TOTAL_COLORS(0);i++) |
| 93 | 93 | { |
| 94 | colortable_entry_set_value(machine.colortable, machine.gfx[0]->color | |
| 94 | colortable_entry_set_value(machine.colortable, machine.gfx[0]->color | |
| 95 | 95 | (i % 2 != 0) ? (i / 2) : 0x80); |
| 96 | 96 | } |
| 97 | 97 | } |
| r17669 | r17670 | |
| 142 | 142 | /* background tiles */ |
| 143 | 143 | for (i = 0;i < TOTAL_COLORS(1);i++) |
| 144 | 144 | { |
| 145 | colortable_entry_set_value(machine.colortable, machine.gfx[1]->color | |
| 145 | colortable_entry_set_value(machine.colortable, machine.gfx[1]->color | |
| 146 | 146 | (color_prom[0] & 0x0f) | ((color_prom[0x400] & 0x0f) << 4)); |
| 147 | 147 | |
| 148 | 148 | color_prom++; |
| r17669 | r17670 | |
| 154 | 154 | { |
| 155 | 155 | int c = (color_prom[0] & 0x0f) | ((color_prom[0x400] & 0x0f) << 4); |
| 156 | 156 | |
| 157 | colortable_entry_set_value(machine.colortable, machine.gfx[2]->color | |
| 157 | colortable_entry_set_value(machine.colortable, machine.gfx[2]->color | |
| 158 | 158 | (c & 0x80) ? (c & 0x7f) : 0x80); |
| 159 | 159 | |
| 160 | 160 | color_prom++; |
| r17669 | r17670 | |
| 163 | 163 | /* foreground characters */ |
| 164 | 164 | for (i = 0;i < TOTAL_COLORS(0);i++) |
| 165 | 165 | { |
| 166 | colortable_entry_set_value(machine.colortable, machine.gfx[0]->color | |
| 166 | colortable_entry_set_value(machine.colortable, machine.gfx[0]->color | |
| 167 | 167 | (i % 2 != 0) ? (i / 2) : 0x80); |
| 168 | 168 | } |
| 169 | 169 | } |
| r17669 | r17670 | |
|---|---|---|
| 20 | 20 | VIDEO_START( mlc ) |
| 21 | 21 | { |
| 22 | 22 | deco_mlc_state *state = machine.driver_data<deco_mlc_state>(); |
| 23 | if (machine.gfx[0]-> | |
| 23 | if (machine.gfx[0]-> | |
| 24 | 24 | state->m_colour_mask=0x7f; |
| 25 | else if (machine.gfx[0]-> | |
| 25 | else if (machine.gfx[0]-> | |
| 26 | 26 | state->m_colour_mask=0x3f; |
| 27 | 27 | else |
| 28 | 28 | state->m_colour_mask=0x1f; |
| r17669 | r17670 | |
| 62 | 62 | #endif |
| 63 | 63 | |
| 64 | 64 | static void mlc_drawgfxzoom( |
| 65 | bitmap_rgb32 &dest_bmp,const rectangle &clip, | |
| 65 | bitmap_rgb32 &dest_bmp,const rectangle &clip, | |
| 66 | 66 | UINT32 code1,UINT32 code2, UINT32 color,int flipx,int flipy,int sx,int sy, |
| 67 | 67 | int transparent_color,int use8bpp, |
| 68 | 68 | int scalex, int scaley,int alpha) |
| r17669 | r17670 | |
| 85 | 85 | { |
| 86 | 86 | if( gfx ) |
| 87 | 87 | { |
| 88 | const pen_t *pal = &gfx->machine().pens[gfx->color_base + gfx->color_granularity * (color % gfx->total_colors)]; | |
| 89 | const UINT8 *code_base1 = gfx_element_get_data(gfx, code1 % gfx->total_elements); | |
| 90 | const UINT8 *code_base2 = gfx_element_get_data(gfx, code2 % gfx->total_elements); | |
| 88 | const pen_t *pal = &gfx->machine().pens[gfx->colorbase() + gfx->granularity() * (color % gfx->colors())]; | |
| 89 | const UINT8 *code_base1 = gfx->get_data(code1 % gfx->elements()); | |
| 90 | const UINT8 *code_base2 = gfx->get_data(code2 % gfx->elements()); | |
| 91 | 91 | |
| 92 | int sprite_screen_height = (scaley*gfx->height+(sy&0xffff))>>16; | |
| 93 | int sprite_screen_width = (scalex*gfx->width+(sx&0xffff))>>16; | |
| 92 | int sprite_screen_height = (scaley*gfx->height()+(sy&0xffff))>>16; | |
| 93 | int sprite_screen_width = (scalex*gfx->width()+(sx&0xffff))>>16; | |
| 94 | 94 | |
| 95 | 95 | sx>>=16; |
| 96 | 96 | sy>>=16; |
| r17669 | r17670 | |
| 98 | 98 | if (sprite_screen_width && sprite_screen_height) |
| 99 | 99 | { |
| 100 | 100 | /* compute sprite increment per screen pixel */ |
| 101 | int dx = (gfx->width<<16)/sprite_screen_width; | |
| 102 | int dy = (gfx->height<<16)/sprite_screen_height; | |
| 101 | int dx = (gfx->width()<<16)/sprite_screen_width; | |
| 102 | int dy = (gfx->height()<<16)/sprite_screen_height; | |
| 103 | 103 | |
| 104 | 104 | int ex = sx+sprite_screen_width; |
| 105 | 105 | int ey = sy+sprite_screen_height; |
| r17669 | r17670 | |
| 161 | 161 | { |
| 162 | 162 | for( y=sy; y<ey; y++ ) |
| 163 | 163 | { |
| 164 | const UINT8 *source1 = code_base1 + (y_index>>16) * gfx->line_modulo; | |
| 165 | const UINT8 *source2 = code_base2 + (y_index>>16) * gfx->line_modulo; | |
| 164 | const UINT8 *source1 = code_base1 + (y_index>>16) * gfx->rowbytes(); | |
| 165 | const UINT8 *source2 = code_base2 + (y_index>>16) * gfx->rowbytes(); | |
| 166 | 166 | UINT32 *dest = &dest_bmp.pix32(y); |
| 167 | 167 | |
| 168 | 168 | int x, x_index = x_index_base; |
| r17669 | r17670 | |
| 189 | 189 | { |
| 190 | 190 | for( y=sy; y<ey; y++ ) |
| 191 | 191 | { |
| 192 | const UINT8 *source = code_base1 + (y_index>>16) * gfx-> | |
| 192 | const UINT8 *source = code_base1 + (y_index>>16) * gfx->r | |
| 193 | 193 | UINT32 *dest = &dest_bmp.pix32(y); |
| 194 | 194 | |
| 195 | 195 | int x, x_index = x_index_base; |
| r17669 | r17670 | |
|---|---|---|
| 135 | 135 | break; |
| 136 | 136 | } |
| 137 | 137 | |
| 138 | | |
| 138 | | |
| 139 | 139 | } |
| 140 | 140 | |
| 141 | 141 | WRITE8_MEMBER(tryout_state::tryout_vram_bankswitch_w) |
| r17669 | r17670 | |
| 174 | 174 | state->m_vram=auto_alloc_array(machine, UINT8, 8 * 0x800); |
| 175 | 175 | state->m_vram_gfx=auto_alloc_array(machine, UINT8, 0x6000); |
| 176 | 176 | |
| 177 | | |
| 177 | | |
| 178 | 178 | |
| 179 | 179 | state->m_fg_tilemap->set_transparent_pen(0); |
| 180 | 180 | } |
| r17669 | r17670 | |
|---|---|---|
| 89 | 89 | assert(gfx_index != MAX_GFX_ELEMENTS); |
| 90 | 90 | |
| 91 | 91 | // decode the ttl layer's gfx |
| 92 | machine.gfx[gfx_index] = gfx_element | |
| 92 | machine.gfx[gfx_index] = auto_alloc(machine, gfx_element | |
| 93 | 93 | state->m_ttl_gfx_index = gfx_index; |
| 94 | 94 | |
| 95 | 95 | // create the tilemap |
| r17669 | r17670 | |
|---|---|---|
| 863 | 863 | int i, scrolly; |
| 864 | 864 | int y, x; |
| 865 | 865 | int count; |
| 866 | | |
| 866 | | |
| 867 | 867 | |
| 868 | 868 | state->m_bg1_tilemap->set_scroll_rows(256); |
| 869 | 869 | scrolly = state->m_bg1scrolly; |
| r17669 | r17670 | |
|---|---|---|
| 138 | 138 | { |
| 139 | 139 | int sx, sy, flipx, flipy, code, color; |
| 140 | 140 | |
| 141 | if (machine.gfx[1]-> | |
| 141 | if (machine.gfx[1]-> | |
| 142 | 142 | { |
| 143 | 143 | /* spriteram |
| 144 | 144 |
| r17669 | r17670 | |
|---|---|---|
| 87 | 87 | WRITE8_MEMBER(mainsnk_state::mainsnk_c600_w) |
| 88 | 88 | { |
| 89 | 89 | int bank; |
| 90 | int total_elements = machine().gfx[0]-> | |
| 90 | int total_elements = machine().gfx[0]-> | |
| 91 | 91 | |
| 92 | 92 | flip_screen_set(~data & 0x80); |
| 93 | 93 | |
| r17669 | r17670 | |
| 126 | 126 | static void draw_sprites(running_machine &machine, bitmap_ind16 &bitmap, const rectangle &cliprect, int scrollx, int scrolly ) |
| 127 | 127 | { |
| 128 | 128 | mainsnk_state *state = machine.driver_data<mainsnk_state>(); |
| 129 | | |
| 129 | | |
| 130 | 130 | const UINT8 *source, *finish; |
| 131 | 131 | source = state->m_spriteram; |
| 132 | 132 | finish = source + 25*4; |
| r17669 | r17670 | |
|---|---|---|
| 178 | 178 | * |
| 179 | 179 | *************************************/ |
| 180 | 180 | |
| 181 | static void draw_sprites(bitmap_ind16 &bitmap, const rectangle &cliprect, | |
| 181 | static void draw_sprites(bitmap_ind16 &bitmap, const rectangle &cliprect, | |
| 182 | 182 | { |
| 183 | 183 | mystston_state *state = gfx->machine().driver_data<mystston_state>(); |
| 184 | 184 | int offs; |
| r17669 | r17670 | |
|---|---|---|
| 25 | 25 | static void draw_sprites(running_machine &machine, bitmap_ind16 &bitmap, const rectangle &cliprect) |
| 26 | 26 | { |
| 27 | 27 | sslam_state *state = machine.driver_data<sslam_state>(); |
| 28 | | |
| 28 | | |
| 29 | 29 | UINT16 *source = state->m_spriteram; |
| 30 | 30 | UINT16 *finish = source + 0x1000/2; |
| 31 | 31 |
| r17669 | r17670 | |
|---|---|---|
| 164 | 164 | |
| 165 | 165 | rect.min_x = get_sprite_x(video_ram, i); |
| 166 | 166 | rect.min_y = get_sprite_y(video_ram, i); |
| 167 | rect.max_x = get_sprite_x(video_ram, i) + screen.machine().gfx[1]->width - 1; | |
| 168 | rect.max_y = get_sprite_y(video_ram, i) + screen.machine().gfx[1]->height - 1; | |
| 167 | rect.max_x = get_sprite_x(video_ram, i) + screen.machine().gfx[1]->width() - 1; | |
| 168 | rect.max_y = get_sprite_y(video_ram, i) + screen.machine().gfx[1]->height() - 1; | |
| 169 | 169 | |
| 170 | 170 | rect &= visarea; |
| 171 | 171 |
| r17669 | r17670 | |
|---|---|---|
| 209 | 209 | COMBINE_DATA( &m_video_dma_address ); |
| 210 | 210 | } |
| 211 | 211 | |
| 212 | static void drawgfx_blend(bitmap_rgb32 &bitmap, const rectangle &cliprect, | |
| 212 | static void drawgfx_blend(bitmap_rgb32 &bitmap, const rectangle &cliprect, | |
| 213 | 213 | { |
| 214 | 214 | seibuspi_state *state = gfx->machine().driver_data<seibuspi_state>(); |
| 215 | const pen_t *pens = &gfx->machine().pens[gfx->color | |
| 215 | const pen_t *pens = &gfx->machine().pens[gfx->color | |
| 216 | 216 | const UINT8 *dp; |
| 217 | 217 | int i, j; |
| 218 | 218 | int x1, x2; |
| r17669 | r17670 | |
| 220 | 220 | int px, py; |
| 221 | 221 | int xd = 1, yd = 1; |
| 222 | 222 | |
| 223 | int width = gfx->width; | |
| 224 | int height = gfx->height; | |
| 223 | int width = gfx->width(); | |
| 224 | int height = gfx->height(); | |
| 225 | 225 | |
| 226 | 226 | x1 = sx; |
| 227 | 227 | x2 = sx + width - 1; |
| r17669 | r17670 | |
| 287 | 287 | y2 = cliprect.max_y; |
| 288 | 288 | } |
| 289 | 289 | |
| 290 | if (gfx-> | |
| 290 | if (gfx-> | |
| 291 | 291 | { |
| 292 | 292 | code &= 0xffff; |
| 293 | 293 | } |
| 294 | 294 | |
| 295 | dp = gfx | |
| 295 | dp = gfx-> | |
| 296 | 296 | |
| 297 | 297 | // draw |
| 298 | 298 | for (j=y1; j <= y2; j++) |
| r17669 | r17670 | |
| 344 | 344 | int a; |
| 345 | 345 | int priority; |
| 346 | 346 | int x,y, x1, y1; |
| 347 | | |
| 347 | | |
| 348 | 348 | |
| 349 | 349 | if( state->m_layer_enable & 0x10 ) |
| 350 | 350 | return; |
| r17669 | r17670 | |
|---|---|---|
| 56 | 56 | if (machine().gfx[m_gfx_index] == 0) |
| 57 | 57 | break; |
| 58 | 58 | |
| 59 | machine().gfx[m_gfx_index] = gfx_element | |
| 59 | machine().gfx[m_gfx_index] = auto_alloc(machine(), gfx_element | |
| 60 | 60 | |
| 61 | machine().gfx[m_gfx_index]-> | |
| 61 | machine().gfx[m_gfx_index]->set | |
| 62 | 62 | |
| 63 | 63 | save_pointer(NAME(m_st0020_gfxram), 4 * 0x100000/2); |
| 64 | 64 | save_pointer(NAME(m_st0020_spriteram), 0x80000/2); |
| r17669 | r17670 | |
| 89 | 89 | |
| 90 | 90 | offset += m_st0020_gfxram_bank * 0x100000/2; |
| 91 | 91 | COMBINE_DATA(&m_st0020_gfxram[offset]); |
| 92 | | |
| 92 | | |
| 93 | 93 | } |
| 94 | 94 | |
| 95 | 95 | READ16_MEMBER(st0020_device::st0020_sprram_r) |
| r17669 | r17670 | |
| 178 | 178 | dst /= 16*8; |
| 179 | 179 | while (len--) |
| 180 | 180 | { |
| 181 | | |
| 181 | | |
| 182 | 182 | dst++; |
| 183 | 183 | } |
| 184 | 184 | } |
| r17669 | r17670 | |
|---|---|---|
| 61 | 61 | /* color_prom now points to the beginning of the lookup table */ |
| 62 | 62 | |
| 63 | 63 | /* characters use colors 0xf0-0xff */ |
| 64 | for (i = 0;i < machine.gfx[0]->total_colors * machine.gfx[0]->color_granularity;i++) | |
| 65 | colortable_entry_set_value(machine.colortable, machine.gfx[0]->color_base + i, 0xf0 + (*color_prom++ & 0x0f)); | |
| 64 | for (i = 0;i < machine.gfx[0]->colors() * machine.gfx[0]->granularity();i++) | |
| 65 | colortable_entry_set_value(machine.colortable, machine.gfx[0]->colorbase() + i, 0xf0 + (*color_prom++ & 0x0f)); | |
| 66 | 66 | |
| 67 | 67 | /* sprites */ |
| 68 | for (i = 0;i < machine.gfx[1]-> | |
| 68 | for (i = 0;i < machine.gfx[1]-> | |
| 69 | 69 | { |
| 70 | colortable_entry_set_value(machine.colortable, machine.gfx[1]->color | |
| 70 | colortable_entry_set_value(machine.colortable, machine.gfx[1]->color | |
| 71 | 71 | color_prom++; |
| 72 | 72 | } |
| 73 | 73 | } |
| r17669 | r17670 | |
|---|---|---|
| 2443 | 2443 | } |
| 2444 | 2444 | |
| 2445 | 2445 | static void stv_vdp2_drawgfxzoom( |
| 2446 | bitmap_rgb32 &dest_bmp,const rectangle &clip, | |
| 2446 | bitmap_rgb32 &dest_bmp,const rectangle &clip, | |
| 2447 | 2447 | UINT32 code,UINT32 color,int flipx,int flipy,int sx,int sy, |
| 2448 | 2448 | int transparency,int transparent_color,int scalex, int scaley, |
| 2449 | 2449 | int sprite_screen_width, int sprite_screen_height, int alpha) |
| r17669 | r17670 | |
| 2452 | 2452 | |
| 2453 | 2453 | if (!scalex || !scaley) return; |
| 2454 | 2454 | |
| 2455 | if (gfx->pen_usage && transparency == STV_TRANSPARENCY_PEN) | |
| 2455 | if (gfx->has_pen_usage() && transparency == STV_TRANSPARENCY_PEN) | |
| 2456 | 2456 | { |
| 2457 | 2457 | int transmask = 0; |
| 2458 | 2458 | |
| 2459 | 2459 | transmask = 1 << (transparent_color & 0xff); |
| 2460 | 2460 | |
| 2461 | if ((gfx->pen_usage | |
| 2461 | if ((gfx->pen_usage(code) & ~transmask) == 0) | |
| 2462 | 2462 | /* character is totally transparent, no need to draw */ |
| 2463 | 2463 | return; |
| 2464 | else if ((gfx->pen_usage | |
| 2464 | else if ((gfx->pen_usage(code) & transmask) == 0) | |
| 2465 | 2465 | /* character is totally opaque, can disable transparency */ |
| 2466 | 2466 | transparency = STV_TRANSPARENCY_NONE; |
| 2467 | 2467 | } |
| r17669 | r17670 | |
| 2480 | 2480 | |
| 2481 | 2481 | if( gfx ) |
| 2482 | 2482 | { |
| 2483 | const pen_t *pal = &gfx->machine().pens[gfx->color_base + gfx->color_granularity * (color % gfx->total_colors)]; | |
| 2484 | const UINT8 *source_base = gfx_element_get_data(gfx, code % gfx->total_elements); | |
| 2483 | const pen_t *pal = &gfx->machine().pens[gfx->colorbase() + gfx->granularity() * (color % gfx->colors())]; | |
| 2484 | const UINT8 *source_base = gfx->get_data(code % gfx->elements()); | |
| 2485 | 2485 | |
| 2486 | //int sprite_screen_height = (scaley*gfx->height+0x8000)>>16; | |
| 2487 | //int sprite_screen_width = (scalex*gfx->width+0x8000)>>16; | |
| 2486 | //int sprite_screen_height = (scaley*gfx->height()+0x8000)>>16; | |
| 2487 | //int sprite_screen_width = (scalex*gfx->width()+0x8000)>>16; | |
| 2488 | 2488 | |
| 2489 | 2489 | if (sprite_screen_width && sprite_screen_height) |
| 2490 | 2490 | { |
| 2491 | 2491 | /* compute sprite increment per screen pixel */ |
| 2492 | //int dx = (gfx->width<<16)/sprite_screen_width; | |
| 2493 | //int dy = (gfx->height<<16)/sprite_screen_height; | |
| 2492 | //int dx = (gfx->width()<<16)/sprite_screen_width; | |
| 2493 | //int dy = (gfx->height()<<16)/sprite_screen_height; | |
| 2494 | 2494 | int dx = stv2_current_tilemap.incx; |
| 2495 | 2495 | int dy = stv2_current_tilemap.incy; |
| 2496 | 2496 | |
| r17669 | r17670 | |
| 2553 | 2553 | { |
| 2554 | 2554 | for( y=sy; y<ey; y++ ) |
| 2555 | 2555 | { |
| 2556 | const UINT8 *source = source_base + (y_index>>16) * gfx-> | |
| 2556 | const UINT8 *source = source_base + (y_index>>16) * gfx->r | |
| 2557 | 2557 | UINT32 *dest = &dest_bmp.pix32(y); |
| 2558 | 2558 | |
| 2559 | 2559 | int x, x_index = x_index_base; |
| r17669 | r17670 | |
| 2572 | 2572 | { |
| 2573 | 2573 | for( y=sy; y<ey; y++ ) |
| 2574 | 2574 | { |
| 2575 | const UINT8 *source = source_base + (y_index>>16) * gfx-> | |
| 2575 | const UINT8 *source = source_base + (y_index>>16) * gfx->r | |
| 2576 | 2576 | UINT32 *dest = &dest_bmp.pix32(y); |
| 2577 | 2577 | |
| 2578 | 2578 | int x, x_index = x_index_base; |
| r17669 | r17670 | |
| 2592 | 2592 | { |
| 2593 | 2593 | for( y=sy; y<ey; y++ ) |
| 2594 | 2594 | { |
| 2595 | const UINT8 *source = source_base + (y_index>>16) * gfx-> | |
| 2595 | const UINT8 *source = source_base + (y_index>>16) * gfx->r | |
| 2596 | 2596 | UINT32 *dest = &dest_bmp.pix32(y); |
| 2597 | 2597 | |
| 2598 | 2598 | int x, x_index = x_index_base; |
| r17669 | r17670 | |
| 2612 | 2612 | { |
| 2613 | 2613 | for( y=sy; y<ey; y++ ) |
| 2614 | 2614 | { |
| 2615 | const UINT8 *source = source_base + (y_index>>16) * gfx-> | |
| 2615 | const UINT8 *source = source_base + (y_index>>16) * gfx->r | |
| 2616 | 2616 | UINT32 *dest = &dest_bmp.pix32(y); |
| 2617 | 2617 | |
| 2618 | 2618 | int x, x_index = x_index_base; |
| r17669 | r17670 | |
| 5373 | 5373 | gfxdata[offset*4+2] = (data & 0x0000ff00) >> 8; |
| 5374 | 5374 | gfxdata[offset*4+3] = (data & 0x000000ff) >> 0; |
| 5375 | 5375 | |
| 5376 | gfx_element_mark_dirty(space->machine().gfx[0], offset/8); | |
| 5377 | gfx_element_mark_dirty(space->machine().gfx[1], offset/8); | |
| 5378 | gfx_element_mark_dirty(space->machine().gfx[2], offset/8); | |
| 5379 | gfx_element_mark_dirty(space->machine().gfx[3], offset/8); | |
| 5376 | space->machine().gfx[0]->mark_dirty(offset/8); | |
| 5377 | space->machine().gfx[1]->mark_dirty(offset/8); | |
| 5378 | space->machine().gfx[2]->mark_dirty(offset/8); | |
| 5379 | space->machine().gfx[3]->mark_dirty(offset/8); | |
| 5380 | 5380 | |
| 5381 | 5381 | /* 8-bit tiles overlap, so this affects the previous one as well */ |
| 5382 | 5382 | if (offset/8 != 0) |
| 5383 | 5383 | { |
| 5384 | gfx_element_mark_dirty(space->machine().gfx[2], offset/8 - 1); | |
| 5385 | gfx_element_mark_dirty(space->machine().gfx[3], offset/8 - 1); | |
| 5384 | space->machine().gfx[2]->mark_dirty(offset/8 - 1); | |
| 5385 | space->machine().gfx[3]->mark_dirty(offset/8 - 1); | |
| 5386 | 5386 | } |
| 5387 | 5387 | |
| 5388 | 5388 | if ( stv_rbg_cache_data.watch_vdp2_vram_writes ) |
| r17669 | r17670 | |
| 5761 | 5761 | gfxdata[offset*4+2] = (data & 0x0000ff00) >> 8; |
| 5762 | 5762 | gfxdata[offset*4+3] = (data & 0x000000ff) >> 0; |
| 5763 | 5763 | |
| 5764 | gfx_element_mark_dirty(machine.gfx[0], offset/8); | |
| 5765 | gfx_element_mark_dirty(machine.gfx[1], offset/8); | |
| 5766 | gfx_element_mark_dirty(machine.gfx[2], offset/8); | |
| 5767 | gfx_element_mark_dirty(machine.gfx[3], offset/8); | |
| 5764 | machine.gfx[0]->mark_dirty(offset/8); | |
| 5765 | machine.gfx[1]->mark_dirty(offset/8); | |
| 5766 | machine.gfx[2]->mark_dirty(offset/8); | |
| 5767 | machine.gfx[3]->mark_dirty(offset/8); | |
| 5768 | 5768 | |
| 5769 | 5769 | /* 8-bit tiles overlap, so this affects the previous one as well */ |
| 5770 | 5770 | if (offset/8 != 0) |
| 5771 | 5771 | { |
| 5772 | gfx_element_mark_dirty(machine.gfx[2], offset/8 - 1); | |
| 5773 | gfx_element_mark_dirty(machine.gfx[3], offset/8 - 1); | |
| 5772 | machine.gfx[2]->mark_dirty(offset/8 - 1); | |
| 5773 | machine.gfx[3]->mark_dirty(offset/8 - 1); | |
| 5774 | 5774 | } |
| 5775 | 5775 | |
| 5776 | 5776 | } |
| r17669 | r17670 | |
| 5799 | 5799 | state->m_vdp2_cram = auto_alloc_array_clear(machine, UINT32, 0x080000/4 ); |
| 5800 | 5800 | state->m_vdp2.gfx_decode = auto_alloc_array(machine, UINT8, 0x100000 ); |
| 5801 | 5801 | |
| 5802 | // machine.gfx[0]->color_granularity=4; | |
| 5803 | // machine.gfx[1]->color_granularity=4; | |
| 5802 | // machine.gfx[0]->granularity()=4; | |
| 5803 | // machine.gfx[1]->granularity()=4; | |
| 5804 | 5804 | |
| 5805 | 5805 | memset( &stv_rbg_cache_data, 0, sizeof(stv_rbg_cache_data)); |
| 5806 | 5806 | stv_rbg_cache_data.is_cache_dirty = 3; |
| r17669 | r17670 | |
| 5824 | 5824 | debug.l_en = 0xff; |
| 5825 | 5825 | debug.error = 0xffffffff; |
| 5826 | 5826 | debug.roz = 0; |
| 5827 | gfx_element_set_source(machine.gfx[0], state->m_vdp2.gfx_decode); | |
| 5828 | gfx_element_set_source(machine.gfx[1], state->m_vdp2.gfx_decode); | |
| 5829 | gfx_element_set_source(machine.gfx[2], state->m_vdp2.gfx_decode); | |
| 5830 | gfx_element_set_source(machine.gfx[3], state->m_vdp2.gfx_decode); | |
| 5831 | gfx_element_set_source(machine.gfx[4], state->m_vdp1.gfx_decode); | |
| 5832 | gfx_element_set_source(machine.gfx[5], state->m_vdp1.gfx_decode); | |
| 5833 | gfx_element_set_source(machine.gfx[6], state->m_vdp1.gfx_decode); | |
| 5834 | gfx_element_set_source(machine.gfx[7], state->m_vdp1.gfx_decode); | |
| 5827 | machine.gfx[0]->set_source(state->m_vdp2.gfx_decode); | |
| 5828 | machine.gfx[1]->set_source(state->m_vdp2.gfx_decode); | |
| 5829 | machine.gfx[2]->set_source(state->m_vdp2.gfx_decode); | |
| 5830 | machine.gfx[3]->set_source(state->m_vdp2.gfx_decode); | |
| 5831 | machine.gfx[4]->set_source(state->m_vdp1.gfx_decode); | |
| 5832 | machine.gfx[5]->set_source(state->m_vdp1.gfx_decode); | |
| 5833 | machine.gfx[6]->set_source(state->m_vdp1.gfx_decode); | |
| 5834 | machine.gfx[7]->set_source(state->m_vdp1.gfx_decode); | |
| 5835 | 5835 | } |
| 5836 | 5836 | |
| 5837 | 5837 | void stv_vdp2_dynamic_res_change(running_machine &machine) |
| r17669 | r17670 | |
| 6711 | 6711 | |
| 6712 | 6712 | for (tilecode = 0;tilecode<0x8000;tilecode++) |
| 6713 | 6713 | { |
| 6714 | | |
| 6714 | | |
| 6715 | 6715 | } |
| 6716 | 6716 | |
| 6717 | 6717 | for (tilecode = 0;tilecode<0x2000;tilecode++) |
| 6718 | 6718 | { |
| 6719 | | |
| 6719 | | |
| 6720 | 6720 | } |
| 6721 | 6721 | |
| 6722 | 6722 | for (tilecode = 0;tilecode<0x4000;tilecode++) |
| 6723 | 6723 | { |
| 6724 | | |
| 6724 | | |
| 6725 | 6725 | } |
| 6726 | 6726 | |
| 6727 | 6727 | for (tilecode = 0;tilecode<0x1000;tilecode++) |
| 6728 | 6728 | { |
| 6729 | | |
| 6729 | | |
| 6730 | 6730 | } |
| 6731 | 6731 | |
| 6732 | 6732 | /* vdp 1 ... doesn't have to be tile based */ |
| 6733 | 6733 | |
| 6734 | 6734 | for (tilecode = 0;tilecode<0x8000;tilecode++) |
| 6735 | 6735 | { |
| 6736 | | |
| 6736 | | |
| 6737 | 6737 | } |
| 6738 | 6738 | for (tilecode = 0;tilecode<0x2000;tilecode++) |
| 6739 | 6739 | { |
| 6740 | | |
| 6740 | | |
| 6741 | 6741 | } |
| 6742 | 6742 | for (tilecode = 0;tilecode<0x4000;tilecode++) |
| 6743 | 6743 | { |
| 6744 | | |
| 6744 | | |
| 6745 | 6745 | } |
| 6746 | 6746 | for (tilecode = 0;tilecode<0x1000;tilecode++) |
| 6747 | 6747 | { |
| 6748 | | |
| 6748 | | |
| 6749 | 6749 | } |
| 6750 | 6750 | } |
| 6751 | 6751 |
| r17669 | r17670 | |
|---|---|---|
| 368 | 368 | state->m_tilemap_bitmap_higher.allocate(320,240); |
| 369 | 369 | state->m_tilemap_bitmapflags_higher.allocate(320,240); |
| 370 | 370 | |
| 371 | machine.gfx[2]->color_granularity=256; | |
| 372 | machine.gfx[3]->color_granularity=256; | |
| 371 | machine.gfx[2]->set_granularity(256); | |
| 372 | machine.gfx[3]->set_granularity(256); | |
| 373 | 373 | } |
| 374 | 374 | |
| 375 | 375 | VIDEO_RESET( skns ) |
| r17669 | r17670 | |
|---|---|---|
| 160 | 160 | |
| 161 | 161 | ***************************************************************************/ |
| 162 | 162 | |
| 163 | static void seta_drawgfx( bitmap_ind16 &bitmap, const rectangle &cliprect, | |
| 163 | static void seta_drawgfx( bitmap_ind16 &bitmap, const rectangle &cliprect, | |
| 164 | 164 | UINT32 code,UINT32 color,int flipx,int flipy,int x0,int y0, |
| 165 | 165 | int shadow_depth ) |
| 166 | 166 | { |
| r17669 | r17670 | |
| 170 | 170 | int sx, x1, dx; |
| 171 | 171 | int sy, y1, dy; |
| 172 | 172 | |
| 173 | addr = gfx_element_get_data(gfx, code % gfx->total_elements); | |
| 174 | color = gfx->color_granularity * (color % gfx->total_colors); | |
| 173 | addr = gfx->get_data(code % gfx->elements()); | |
| 174 | color = gfx->granularity() * (color % gfx->colors()); | |
| 175 | 175 | |
| 176 | if ( flipx ) { x1 = x0-1; x0 += gfx->width-1; dx = -1; } | |
| 177 | else { x1 = x0 + gfx->width; dx = 1; } | |
| 176 | if ( flipx ) { x1 = x0-1; x0 += gfx->width()-1; dx = -1; } | |
| 177 | else { x1 = x0 + gfx->width(); dx = 1; } | |
| 178 | 178 | |
| 179 | if ( flipy ) { y1 = y0-1; y0 += gfx->height-1; dy = -1; } | |
| 180 | else { y1 = y0 + gfx->height; dy = 1; } | |
| 179 | if ( flipy ) { y1 = y0-1; y0 += gfx->height()-1; dy = -1; } | |
| 180 | else { y1 = y0 + gfx->height(); dy = 1; } | |
| 181 | 181 | |
| 182 | 182 | #define SETA_DRAWGFX(SETPIXELCOLOR) \ |
| 183 | 183 | for ( sy = y0; sy != y1; sy += dy ) \ |
| r17669 | r17670 | |
| 196 | 196 | } \ |
| 197 | 197 | } \ |
| 198 | 198 | \ |
| 199 | addr += gfx-> | |
| 199 | addr += gfx->r | |
| 200 | 200 | } |
| 201 | 201 | |
| 202 | 202 | if (shadow_depth) |
| r17669 | r17670 | |
| 224 | 224 | // for ( ; s1 < end; s1+=4 ) |
| 225 | 225 | for ( ; s1 < buffered_spriteram16 + 0x4000/2; s1+=4 ) // more reasonable (and it cures MAME lockup in e.g. funcube3 boot) |
| 226 | 226 | { |
| 227 | | |
| 227 | | |
| 228 | 228 | int num = s1[0]; |
| 229 | 229 | int xoffs = s1[1]; |
| 230 | 230 | int yoffs = s1[2]; |
| r17669 | r17670 | |
| 446 | 446 | { |
| 447 | 447 | seta2_state *state = machine.driver_data<seta2_state>(); |
| 448 | 448 | |
| 449 | machine.gfx[2]->color_granularity = 16; | |
| 450 | machine.gfx[3]->color_granularity = 16; | |
| 451 | machine.gfx[4]->color_granularity = 16; | |
| 452 | machine.gfx[5]->color_granularity = 16; | |
| 449 | machine.gfx[2]->set_granularity(16); | |
| 450 | machine.gfx[3]->set_granularity(16); | |
| 451 | machine.gfx[4]->set_granularity(16); | |
| 452 | machine.gfx[5]->set_granularity(16); | |
| 453 | 453 | |
| 454 | 454 | state->m_buffered_spriteram = auto_alloc_array(machine, UINT16, state->m_spriteram.bytes()/2); |
| 455 | 455 |
| r17669 | r17670 | |
|---|---|---|
| 94 | 94 | { |
| 95 | 95 | shootout_state *state = machine.driver_data<shootout_state>(); |
| 96 | 96 | UINT8 *spriteram = state->m_spriteram; |
| 97 | | |
| 97 | | |
| 98 | 98 | const UINT8 *source = spriteram+127*4; |
| 99 | 99 | int count; |
| 100 | 100 |
| r17669 | r17670 | |
|---|---|---|
| 7 | 7 | static void draw_sprites( running_machine &machine, bitmap_ind16 &bitmap, const rectangle &cliprect, int layer ) |
| 8 | 8 | { |
| 9 | 9 | fitfight_state *state = machine.driver_data<fitfight_state>(); |
| 10 | | |
| 10 | | |
| 11 | 11 | UINT16 *source = state->m_spriteram; |
| 12 | 12 | UINT16 *finish = source + 0x800 / 2; |
| 13 | 13 |
| r17669 | r17670 | |
|---|---|---|
| 35 | 35 | { |
| 36 | 36 | terracre_state *state = machine.driver_data<terracre_state>(); |
| 37 | 37 | const UINT8 *spritepalettebank = state->memregion("user1")->base(); |
| 38 | | |
| 38 | | |
| 39 | 39 | const UINT16 *pSource = state->m_spriteram; |
| 40 | 40 | int i; |
| 41 | 41 | int transparent_pen; |
| 42 | 42 | |
| 43 | if( pGfx-> | |
| 43 | if( pGfx-> | |
| 44 | 44 | { /* HORE HORE Kid */ |
| 45 | 45 | transparent_pen = 0xf; |
| 46 | 46 | } |
| r17669 | r17670 | |
|---|---|---|
| 147 | 147 | |
| 148 | 148 | |
| 149 | 149 | INLINE void dragngun_drawgfxzoom( |
| 150 | bitmap_rgb32 &dest_bmp,const rectangle &clip, | |
| 150 | bitmap_rgb32 &dest_bmp,const rectangle &clip, | |
| 151 | 151 | UINT32 code,UINT32 color,int flipx,int flipy,int sx,int sy, |
| 152 | 152 | int transparent_color, |
| 153 | 153 | int scalex, int scaley,bitmap_ind8 *pri_buffer,UINT32 pri_mask, int sprite_screen_width, int sprite_screen_height, UINT8 alpha ) |
| r17669 | r17670 | |
| 170 | 170 | { |
| 171 | 171 | if( gfx ) |
| 172 | 172 | { |
| 173 | const pen_t *pal = &gfx->machine().pens[gfx->color_base + gfx->color_granularity * (color % gfx->total_colors)]; | |
| 174 | const UINT8 *code_base = gfx_element_get_data(gfx, code % gfx->total_elements); | |
| 173 | const pen_t *pal = &gfx->machine().pens[gfx->colorbase() + gfx->granularity() * (color % gfx->colors())]; | |
| 174 | const UINT8 *code_base = gfx->get_data(code % gfx->elements()); | |
| 175 | 175 | |
| 176 | 176 | if (sprite_screen_width && sprite_screen_height) |
| 177 | 177 | { |
| 178 | 178 | /* compute sprite increment per screen pixel */ |
| 179 | int dx = (gfx->width<<16)/sprite_screen_width; | |
| 180 | int dy = (gfx->height<<16)/sprite_screen_height; | |
| 179 | int dx = (gfx->width()<<16)/sprite_screen_width; | |
| 180 | int dy = (gfx->height()<<16)/sprite_screen_height; | |
| 181 | 181 | |
| 182 | 182 | int ex = sx+sprite_screen_width; |
| 183 | 183 | int ey = sy+sprite_screen_height; |
| r17669 | r17670 | |
| 240 | 240 | { |
| 241 | 241 | for( y=sy; y<ey; y++ ) |
| 242 | 242 | { |
| 243 | const UINT8 *source = code_base + (y_index>>16) * gfx-> | |
| 243 | const UINT8 *source = code_base + (y_index>>16) * gfx->r | |
| 244 | 244 | UINT32 *dest = &dest_bmp.pix32(y); |
| 245 | 245 | UINT8 *pri = &pri_buffer->pix8(y); |
| 246 | 246 | |
| r17669 | r17670 | |
| 264 | 264 | { |
| 265 | 265 | for( y=sy; y<ey; y++ ) |
| 266 | 266 | { |
| 267 | const UINT8 *source = code_base + (y_index>>16) * gfx-> | |
| 267 | const UINT8 *source = code_base + (y_index>>16) * gfx->r | |
| 268 | 268 | UINT32 *dest = &dest_bmp.pix32(y); |
| 269 | 269 | |
| 270 | 270 | int x, x_index = x_index_base; |
| r17669 | r17670 | |
| 287 | 287 | { |
| 288 | 288 | for( y=sy; y<ey; y++ ) |
| 289 | 289 | { |
| 290 | const UINT8 *source = code_base + (y_index>>16) * gfx-> | |
| 290 | const UINT8 *source = code_base + (y_index>>16) * gfx->r | |
| 291 | 291 | UINT32 *dest = &dest_bmp.pix32(y); |
| 292 | 292 | UINT8 *pri = &pri_buffer->pix8(y); |
| 293 | 293 | |
| r17669 | r17670 | |
| 311 | 311 | { |
| 312 | 312 | for( y=sy; y<ey; y++ ) |
| 313 | 313 | { |
| 314 | const UINT8 *source = code_base + (y_index>>16) * gfx-> | |
| 314 | const UINT8 *source = code_base + (y_index>>16) * gfx->r | |
| 315 | 315 | UINT32 *dest = &dest_bmp.pix32(y); |
| 316 | 316 | |
| 317 | 317 | int x, x_index = x_index_base; |
| r17669 | r17670 | |
| 697 | 697 | blending support - it can't be done in-place on the final framebuffer |
| 698 | 698 | without a lot of support bitmaps. |
| 699 | 699 | */ |
| 700 | static void mixDualAlphaSprites(bitmap_rgb32 &bitmap, const rectangle &cliprect, | |
| 700 | static void mixDualAlphaSprites(bitmap_rgb32 &bitmap, const rectangle &cliprect, | |
| 701 | 701 | { |
| 702 | 702 | deco32_state *state = gfx0->machine().driver_data<deco32_state>(); |
| 703 | 703 | running_machine &machine = gfx0->machine(); |
| 704 | 704 | const pen_t *pens = machine.pens; |
| 705 | const pen_t *pal0 = &pens[gfx0->color_base]; | |
| 706 | const pen_t *pal1 = &pens[gfx1->color_base]; | |
| 707 | const pen_t *pal2 = &pens[machine.gfx[(state->m_pri&1) ? 1 : 2]->color_base]; | |
| 705 | const pen_t *pal0 = &pens[gfx0->colorbase()]; | |
| 706 | const pen_t *pal1 = &pens[gfx1->colorbase()]; | |
| 707 | const pen_t *pal2 = &pens[machine.gfx[(state->m_pri&1) ? 1 : 2]->colorbase()]; | |
| 708 | 708 | int x,y; |
| 709 | 709 | bitmap_ind16& sprite0_mix_bitmap = machine.device<decospr_device>("spritegen1")->get_sprite_temp_bitmap(); |
| 710 | 710 | bitmap_ind16& sprite1_mix_bitmap = machine.device<decospr_device>("spritegen2")->get_sprite_temp_bitmap(); |
| r17669 | r17670 | |
| 723 | 723 | UINT16 priColAlphaPal1=sprite1[x]; |
| 724 | 724 | UINT16 pri0=(priColAlphaPal0&0x6000)>>13; |
| 725 | 725 | UINT16 pri1=(priColAlphaPal1&0x6000)>>13; |
| 726 | UINT16 col0=((priColAlphaPal0&0x1f00)>>8) % gfx0->total_colors; | |
| 727 | UINT16 col1=((priColAlphaPal1&0x0f00)>>8) % gfx1->total_colors; | |
| 726 | UINT16 col0=((priColAlphaPal0&0x1f00)>>8) % gfx0->colors(); | |
| 727 | UINT16 col1=((priColAlphaPal1&0x0f00)>>8) % gfx1->colors(); | |
| 728 | 728 | UINT16 alpha1=priColAlphaPal1&0x8000; |
| 729 | 729 | |
| 730 | 730 | // Apply sprite bitmap 0 according to priority rules |
| r17669 | r17670 | |
| 740 | 740 | */ |
| 741 | 741 | if ((pri0&0x3)==0 || (pri0&0x3)==1 || ((pri0&0x3)==2 && mixAlphaTilemap)) // Spri0 on top of everything, or under alpha playfield |
| 742 | 742 | { |
| 743 | destLine[x]=pal0[(priColAlphaPal0&0xff) + (gfx0-> | |
| 743 | destLine[x]=pal0[(priColAlphaPal0&0xff) + (gfx0-> | |
| 744 | 744 | } |
| 745 | 745 | else if ((pri0&0x3)==2) // Spri0 under top playfield |
| 746 | 746 | { |
| 747 | 747 | if (tilemapPri[x]<4) |
| 748 | destLine[x]=pal0[(priColAlphaPal0&0xff) + (gfx0-> | |
| 748 | destLine[x]=pal0[(priColAlphaPal0&0xff) + (gfx0-> | |
| 749 | 749 | } |
| 750 | 750 | else // Spri0 under top & middle playfields |
| 751 | 751 | { |
| 752 | 752 | if (tilemapPri[x]<2) |
| 753 | destLine[x]=pal0[(priColAlphaPal0&0xff) + (gfx0-> | |
| 753 | destLine[x]=pal0[(priColAlphaPal0&0xff) + (gfx0-> | |
| 754 | 754 | } |
| 755 | 755 | } |
| 756 | 756 | |
| r17669 | r17670 | |
| 780 | 780 | if (pri1==0 && (((priColAlphaPal0&0xff)==0 || ((pri0&0x3)!=0 && (pri0&0x3)!=1 && (pri0&0x3)!=2)))) |
| 781 | 781 | { |
| 782 | 782 | if ((state->m_pri&1)==0 || ((state->m_pri&1)==1 && tilemapPri[x]<4) || ((state->m_pri&1)==1 && mixAlphaTilemap)) |
| 783 | destLine[x]=alpha_blend_r32(destLine[x], pal1[(priColAlphaPal1&0xff) + (gfx1-> | |
| 783 | destLine[x]=alpha_blend_r32(destLine[x], pal1[(priColAlphaPal1&0xff) + (gfx1-> | |
| 784 | 784 | } |
| 785 | 785 | else if (pri1==1 && ((priColAlphaPal0&0xff)==0 || ((pri0&0x3)!=0 && (pri0&0x3)!=1 && (pri0&0x3)!=2))) |
| 786 | destLine[x]=alpha_blend_r32(destLine[x], pal1[(priColAlphaPal1&0xff) + (gfx1-> | |
| 786 | destLine[x]=alpha_blend_r32(destLine[x], pal1[(priColAlphaPal1&0xff) + (gfx1-> | |
| 787 | 787 | else if (pri1==2)// TOdo |
| 788 | destLine[x]=alpha_blend_r32(destLine[x], pal1[(priColAlphaPal1&0xff) + (gfx1-> | |
| 788 | destLine[x]=alpha_blend_r32(destLine[x], pal1[(priColAlphaPal1&0xff) + (gfx1-> | |
| 789 | 789 | else if (pri1==3)// TOdo |
| 790 | destLine[x]=alpha_blend_r32(destLine[x], pal1[(priColAlphaPal1&0xff) + (gfx1-> | |
| 790 | destLine[x]=alpha_blend_r32(destLine[x], pal1[(priColAlphaPal1&0xff) + (gfx1-> | |
| 791 | 791 | } |
| 792 | 792 | else |
| 793 | 793 | { |
| r17669 | r17670 | |
| 797 | 797 | Pri 0 - Under sprite 0 pri 0, over all tilemaps |
| 798 | 798 | */ |
| 799 | 799 | if (pri1==0 && ((priColAlphaPal0&0xff)==0 || ((pri0&0x3)!=0))) |
| 800 | destLine[x]=pal1[(priColAlphaPal1&0xff) + (gfx1-> | |
| 800 | destLine[x]=pal1[(priColAlphaPal1&0xff) + (gfx1-> | |
| 801 | 801 | else if (pri1==1) // todo |
| 802 | destLine[x]=pal1[(priColAlphaPal1&0xff) + (gfx1-> | |
| 802 | destLine[x]=pal1[(priColAlphaPal1&0xff) + (gfx1-> | |
| 803 | 803 | else if (pri1==2) // todo |
| 804 | destLine[x]=pal1[(priColAlphaPal1&0xff) + (gfx1-> | |
| 804 | destLine[x]=pal1[(priColAlphaPal1&0xff) + (gfx1-> | |
| 805 | 805 | else if (pri1==3) // todo |
| 806 | destLine[x]=pal1[(priColAlphaPal1&0xff) + (gfx1-> | |
| 806 | destLine[x]=pal1[(priColAlphaPal1&0xff) + (gfx1-> | |
| 807 | 807 | } |
| 808 | 808 | } |
| 809 | 809 |
| r17669 | r17670 | |
|---|---|---|
| 184 | 184 | |
| 185 | 185 | static void draw_sprites(running_machine &machine, grchamp_state *state, bitmap_ind16 &bitmap, const rectangle &cliprect) |
| 186 | 186 | { |
| 187 | | |
| 187 | | |
| 188 | 188 | int bank = (state->m_cpu0_out[0] & 0x20) ? 0x40 : 0x00; |
| 189 | 189 | const UINT8 *source = state->m_spriteram + 0x40; |
| 190 | 190 | const UINT8 *finish = source + 0x40; |
| r17669 | r17670 | |
| 246 | 246 | |
| 247 | 247 | */ |
| 248 | 248 | const UINT8 *prom = machine.root_device().memregion("proms")->base() + 0x20; |
| 249 | | |
| 249 | | |
| 250 | 250 | int change = (state->m_cpu0_out[0] & 0x20) << 3; |
| 251 | 251 | int num; |
| 252 | 252 | |
| r17669 | r17670 | |
| 278 | 278 | int code = (codeflip & 0x3f) + (change >> 2); |
| 279 | 279 | int yflip = (codeflip & 0x80) ? 0x0f : 0x00; |
| 280 | 280 | int xflip = (codeflip & 0x40) ? 0x0f : 0x00; |
| 281 | const UINT8 *src = gfx | |
| 281 | const UINT8 *src = gfx-> | |
| 282 | 282 | |
| 283 | 283 | /* the third byte is: color in bits 0-2 */ |
| 284 | 284 | int color = (state->m_spriteram[0x42 + (dataoffs & ~0x20)] & 0x07) << 2; |
| r17669 | r17670 | |
| 322 | 322 | int dy = sy + ~y; |
| 323 | 323 | int color = (state->m_spriteram[0x01 + dataoffs] & 0x07) << 2; |
| 324 | 324 | int code = state->m_videoram[hprime | ((dy & 0xf8) << 2)] + change; |
| 325 | const UINT8 *src = gfx | |
| 325 | const UINT8 *src = gfx-> | |
| 326 | 326 | int x; |
| 327 | 327 | |
| 328 | 328 | /* draw 8 pixels */ |
| r17669 | r17670 | |
|---|---|---|
| 434 | 434 | { |
| 435 | 435 | zaxxon_state *state = machine.driver_data<zaxxon_state>(); |
| 436 | 436 | UINT8 *spriteram = state->m_spriteram; |
| 437 | | |
| 437 | | |
| 438 | 438 | int flip = state->flip_screen(); |
| 439 | 439 | int flipmask = flip ? 0xff : 0x00; |
| 440 | 440 | int offs; |
| r17669 | r17670 | |
|---|---|---|
| 361 | 361 | }; |
| 362 | 362 | |
| 363 | 363 | gaiden_state *state = machine.driver_data<gaiden_state>(); |
| 364 | | |
| 364 | | |
| 365 | 365 | const UINT16 *source = (NUM_SPRITES - 1) * 8 + state->m_spriteram; |
| 366 | 366 | int count = NUM_SPRITES; |
| 367 | 367 | |
| r17669 | r17670 | |
| 435 | 435 | |
| 436 | 436 | pdrawgfx_transpen_raw(bitmap_sp, cliprect, gfx, |
| 437 | 437 | number + layout[row][col], |
| 438 | gfx->color | |
| 438 | gfx->color | |
| 439 | 439 | flipx, flipy, |
| 440 | 440 | sx, sy, |
| 441 | 441 | machine.priority_bitmap, priority_mask, 0); |
| r17669 | r17670 | |
| 455 | 455 | |
| 456 | 456 | pdrawgfx_transpen_raw(bitmap, cliprect, gfx, |
| 457 | 457 | number + layout[row][col], |
| 458 | gfx->color | |
| 458 | gfx->color | |
| 459 | 459 | flipx, flipy, |
| 460 | 460 | sx, sy, |
| 461 | 461 | machine.priority_bitmap, priority_mask, 0); |
| r17669 | r17670 | |
| 483 | 483 | }; |
| 484 | 484 | |
| 485 | 485 | gaiden_state *state = machine.driver_data<gaiden_state>(); |
| 486 | | |
| 486 | | |
| 487 | 487 | const UINT16 *source = (NUM_SPRITES - 1) * 8 + state->m_spriteram; |
| 488 | 488 | int count = NUM_SPRITES; |
| 489 | 489 | |
| r17669 | r17670 | |
| 556 | 556 | |
| 557 | 557 | pdrawgfx_transpen_raw(bitmap_sp, cliprect, gfx, |
| 558 | 558 | number + layout[row][col], |
| 559 | gfx->color | |
| 559 | gfx->color | |
| 560 | 560 | flipx, flipy, |
| 561 | 561 | sx, sy, |
| 562 | 562 | machine.priority_bitmap, priority_mask, 0); |
| r17669 | r17670 | |
| 576 | 576 | |
| 577 | 577 | pdrawgfx_transpen_raw(bitmap, cliprect, gfx, |
| 578 | 578 | number + layout[row][col], |
| 579 | gfx->color | |
| 579 | gfx->color | |
| 580 | 580 | flipx, flipy, |
| 581 | 581 | sx, sy, |
| 582 | 582 | machine.priority_bitmap, priority_mask, 0); |
| r17669 | r17670 | |
| 635 | 635 | |
| 636 | 636 | pdrawgfx_transpen_raw(bitmap,cliprect,machine.gfx[3], |
| 637 | 637 | code, |
| 638 | machine.gfx[3]->color | |
| 638 | machine.gfx[3]->color | |
| 639 | 639 | flipx,flipy,x,y, |
| 640 | 640 | machine.priority_bitmap, priority_mask,15); |
| 641 | 641 | |
| 642 | 642 | /* wrap x*/ |
| 643 | 643 | pdrawgfx_transpen_raw(bitmap,cliprect,machine.gfx[3], |
| 644 | 644 | code, |
| 645 | machine.gfx[3]->color | |
| 645 | machine.gfx[3]->color | |
| 646 | 646 | flipx,flipy,x-512,y, |
| 647 | 647 | machine.priority_bitmap, priority_mask,15); |
| 648 | 648 |
| r17669 | r17670 | |
|---|---|---|
| 62 | 62 | static void draw_sprite(running_machine &machine, const UINT8 *source, bitmap_ind16 &bitmap, const rectangle &cliprect) |
| 63 | 63 | { |
| 64 | 64 | shangkid_state *state = machine.driver_data<shangkid_state>(); |
| 65 | | |
| 65 | | |
| 66 | 66 | int transparent_pen; |
| 67 | 67 | int bank_index; |
| 68 | 68 | int c,r; |
| r17669 | r17670 | |
|---|---|---|
| 98 | 98 | |
| 99 | 99 | /* Draw the sprites. */ |
| 100 | 100 | { |
| 101 | const gfx_element *gfx1 = screen.machine().gfx[1]; | |
| 102 | const gfx_element *gfx2 = screen.machine().gfx[2]; | |
| 101 | gfx_element *gfx1 = screen.machine().gfx[1]; | |
| 102 | gfx_element *gfx2 = screen.machine().gfx[2]; | |
| 103 | 103 | |
| 104 | 104 | UINT8 *sr = state->m_spriterambank ? state->m_spriteram_2 : state->m_spriteram; |
| 105 | 105 |
| r17669 | r17670 | |
|---|---|---|
| 547 | 547 | } |
| 548 | 548 | |
| 549 | 549 | |
| 550 | static void cclimber_draw_sprites(bitmap_ind16 &bitmap, const rectangle &cliprect, | |
| 550 | static void cclimber_draw_sprites(bitmap_ind16 &bitmap, const rectangle &cliprect, | |
| 551 | 551 | { |
| 552 | 552 | cclimber_state *state = gfx->machine().driver_data<cclimber_state>(); |
| 553 | 553 | int offs; |
| r17669 | r17670 | |
| 588 | 588 | } |
| 589 | 589 | |
| 590 | 590 | |
| 591 | static void toprollr_draw_sprites(bitmap_ind16 &bitmap, const rectangle &cliprect, | |
| 591 | static void toprollr_draw_sprites(bitmap_ind16 &bitmap, const rectangle &cliprect, | |
| 592 | 592 | { |
| 593 | 593 | cclimber_state *state = gfx->machine().driver_data<cclimber_state>(); |
| 594 | 594 | int offs; |
| r17669 | r17670 | |
| 626 | 626 | } |
| 627 | 627 | |
| 628 | 628 | |
| 629 | static void swimmer_draw_sprites(bitmap_ind16 &bitmap, const rectangle &cliprect, | |
| 629 | static void swimmer_draw_sprites(bitmap_ind16 &bitmap, const rectangle &cliprect, | |
| 630 | 630 | { |
| 631 | 631 | cclimber_state *state = gfx->machine().driver_data<cclimber_state>(); |
| 632 | 632 | int offs; |
| r17669 | r17670 | |
|---|---|---|
| 57 | 57 | static void draw_sprites(running_machine &machine, bitmap_ind16 &bitmap, const rectangle &cliprect ) |
| 58 | 58 | { |
| 59 | 59 | speedspn_state *state = machine.driver_data<speedspn_state>(); |
| 60 | | |
| 60 | | |
| 61 | 61 | UINT8 *source = state->m_vidram+ 0x1000; |
| 62 | 62 | UINT8 *finish = source + 0x1000; |
| 63 | 63 |
| r17669 | r17670 | |
|---|---|---|
| 261 | 261 | old_word = m_shaperam[offset]; |
| 262 | 262 | COMBINE_DATA( &m_shaperam[offset] ); |
| 263 | 263 | if( m_shaperam[offset]!=old_word ) |
| 264 | | |
| 264 | | |
| 265 | 265 | } |
| 266 | 266 | } |
| 267 | 267 | else if( type == 0x02 ) |
| r17669 | r17670 | |
| 270 | 270 | COMBINE_DATA( &m_cgram[offset] ); |
| 271 | 271 | if( m_cgram[offset]!=old_word ) |
| 272 | 272 | { |
| 273 | gfx_element_mark_dirty(machine().gfx[0], offset/0x20); | |
| 274 | gfx_element_mark_dirty(machine().gfx[1], offset/0x20); | |
| 273 | machine().gfx[0]->mark_dirty(offset/0x20); | |
| 274 | machine().gfx[1]->mark_dirty(offset/0x20); | |
| 275 | 275 | } |
| 276 | 276 | } |
| 277 | 277 | } /* namcona1_gfxram_w */ |
| r17669 | r17670 | |
| 298 | 298 | state->m_shaperam = auto_alloc_array(machine, UINT16, 0x2000*4/2 ); |
| 299 | 299 | state->m_cgram = auto_alloc_array(machine, UINT16, 0x1000*0x40/2 ); |
| 300 | 300 | |
| 301 | machine.gfx[0] = gfx_element_alloc( machine, &cg_layout_8bpp, (UINT8 *)state->m_cgram, machine.total_colors()/256, 0 ); | |
| 302 | machine.gfx[1] = gfx_element_alloc( machine, &cg_layout_4bpp, (UINT8 *)state->m_cgram, machine.total_colors()/16, 0 ); | |
| 303 | machine.gfx[2] = gfx_element_alloc( machine, &shape_layout, (UINT8 *)state->m_shaperam, machine.total_colors()/2, 0 ); | |
| 301 | machine.gfx[0] = auto_alloc( machine, gfx_element( machine, cg_layout_8bpp, (UINT8 *)state->m_cgram, machine.total_colors()/256, 0 )); | |
| 302 | machine.gfx[1] = auto_alloc( machine, gfx_element( machine, cg_layout_4bpp, (UINT8 *)state->m_cgram, machine.total_colors()/16, 0 )); | |
| 303 | machine.gfx[2] = auto_alloc( machine, gfx_element( machine, shape_layout, (UINT8 *)state->m_shaperam, machine.total_colors()/2, 0 )); | |
| 304 | 304 | |
| 305 | 305 | } /* namcona1_vh_start */ |
| 306 | 306 | |
| r17669 | r17670 | |
| 318 | 318 | int bOpaque, |
| 319 | 319 | int gfx_region ) |
| 320 | 320 | { |
| 321 | const gfx_element *gfx = machine.gfx[gfx_region]; | |
| 322 | const gfx_element *mask = machine.gfx[2]; | |
| 321 | gfx_element *gfx = machine.gfx[gfx_region]; | |
| 322 | gfx_element *mask = machine.gfx[2]; | |
| 323 | 323 | |
| 324 | int pal_base = gfx->color_base + gfx->color_granularity * (color % gfx->total_colors); | |
| 325 | const UINT8 *source_base = gfx_element_get_data(gfx, (code % gfx->total_elements)); | |
| 326 | const UINT8 *mask_base = gfx_element_get_data(mask, (code % mask->total_elements)); | |
| 324 | int pal_base = gfx->colorbase() + gfx->granularity() * (color % gfx->colors()); | |
| 325 | const UINT8 *source_base = gfx->get_data((code % gfx->elements())); | |
| 326 | const UINT8 *mask_base = mask->get_data((code % mask->elements())); | |
| 327 | 327 | |
| 328 | int sprite_screen_height = ((1<<16)*gfx->height+0x8000)>>16; | |
| 329 | int sprite_screen_width = ((1<<16)*gfx->width+0x8000)>>16; | |
| 328 | int sprite_screen_height = ((1<<16)*gfx->height()+0x8000)>>16; | |
| 329 | int sprite_screen_width = ((1<<16)*gfx->width()+0x8000)>>16; | |
| 330 | 330 | |
| 331 | 331 | if (sprite_screen_width && sprite_screen_height) |
| 332 | 332 | { |
| 333 | 333 | /* compute sprite increment per screen pixel */ |
| 334 | int dx = (gfx->width<<16)/sprite_screen_width; | |
| 335 | int dy = (gfx->height<<16)/sprite_screen_height; | |
| 334 | int dx = (gfx->width()<<16)/sprite_screen_width; | |
| 335 | int dy = (gfx->height()<<16)/sprite_screen_height; | |
| 336 | 336 | |
| 337 | 337 | int ex = sx+sprite_screen_width; |
| 338 | 338 | int ey = sy+sprite_screen_height; |
| r17669 | r17670 | |
| 390 | 390 | |
| 391 | 391 | for( y=sy; y<ey; y++ ) |
| 392 | 392 | { |
| 393 | const UINT8 *source = source_base + (y_index>>16) * gfx->line_modulo; | |
| 394 | const UINT8 *mask_addr = mask_base + (y_index>>16) * mask->line_modulo; | |
| 393 | const UINT8 *source = source_base + (y_index>>16) * gfx->rowbytes(); | |
| 394 | const UINT8 *mask_addr = mask_base + (y_index>>16) * mask->rowbytes(); | |
| 395 | 395 | UINT16 *dest = &dest_bmp.pix16(y); |
| 396 | 396 | UINT8 *pri = &machine.priority_bitmap.pix8(y); |
| 397 | 397 | |
| r17669 | r17670 | |
| 566 | 566 | gfx_element *pGfx; |
| 567 | 567 | |
| 568 | 568 | pGfx = machine.gfx[0]; |
| 569 | paldata = &machine.pens[pGfx->color | |
| 569 | paldata = &machine.pens[pGfx->color | |
| 570 | 570 | |
| 571 | 571 | /* draw one scanline at a time */ |
| 572 | 572 | clip.min_x = cliprect.min_x; |
| r17669 | r17670 | |
|---|---|---|
| 117 | 117 | { |
| 118 | 118 | foodf_state *state = screen.machine().driver_data<foodf_state>(); |
| 119 | 119 | int offs; |
| 120 | | |
| 120 | | |
| 121 | 121 | bitmap_ind8 &priority_bitmap = screen.machine().priority_bitmap; |
| 122 | 122 | UINT16 *spriteram16 = state->m_spriteram; |
| 123 | 123 |
| r17669 | r17670 | |
|---|---|---|
| 266 | 266 | ***************************************************************************/ |
| 267 | 267 | |
| 268 | 268 | /* custom code to handle color cycling effect, handled by m_spr_pal_clut */ |
| 269 | void armedf_drawgfx(running_machine &machine, bitmap_ind16 &dest_bmp,const rectangle &clip, | |
| 269 | void armedf_drawgfx(running_machine &machine, bitmap_ind16 &dest_bmp,const rectangle &clip, | |
| 270 | 270 | UINT32 code,UINT32 color, UINT32 clut,int flipx,int flipy,int offsx,int offsy, |
| 271 | 271 | int transparent_color) |
| 272 | 272 | { |
| 273 | 273 | armedf_state *state = machine.driver_data<armedf_state>(); |
| 274 | const pen_t *pal = &gfx->machine().pens[gfx->color_base + gfx->color_granularity * (color % gfx->total_colors)]; | |
| 275 | const UINT8 *source_base = gfx_element_get_data(gfx, code % gfx->total_elements); | |
| 274 | const pen_t *pal = &gfx->machine().pens[gfx->colorbase() + gfx->granularity() * (color % gfx->colors())]; | |
| 275 | const UINT8 *source_base = gfx->get_data(code % gfx->elements()); | |
| 276 | 276 | int x_index_base, y_index, sx, sy, ex, ey; |
| 277 | 277 | int xinc, yinc; |
| 278 | 278 | |
| 279 | 279 | xinc = flipx ? -1 : 1; |
| 280 | 280 | yinc = flipy ? -1 : 1; |
| 281 | 281 | |
| 282 | x_index_base = flipx ? gfx->width-1 : 0; | |
| 283 | y_index = flipy ? gfx->height-1 : 0; | |
| 282 | x_index_base = flipx ? gfx->width()-1 : 0; | |
| 283 | y_index = flipy ? gfx->height()-1 : 0; | |
| 284 | 284 | |
| 285 | 285 | /* start coordinates */ |
| 286 | 286 | sx = offsx; |
| 287 | 287 | sy = offsy; |
| 288 | 288 | |
| 289 | 289 | /* end coordinates */ |
| 290 | ex = sx + gfx->width; | |
| 291 | ey = sy + gfx->height; | |
| 290 | ex = sx + gfx->width(); | |
| 291 | ey = sy + gfx->height(); | |
| 292 | 292 | |
| 293 | 293 | if (sx < clip.min_x) |
| 294 | 294 | { /* clip left */ |
| r17669 | r17670 | |
| 319 | 319 | { |
| 320 | 320 | for (y = sy; y < ey; y++) |
| 321 | 321 | { |
| 322 | const UINT8 *source = source_base + y_index*gfx-> | |
| 322 | const UINT8 *source = source_base + y_index*gfx->r | |
| 323 | 323 | UINT16 *dest = &dest_bmp.pix16(y); |
| 324 | 324 | int x_index = x_index_base; |
| 325 | 325 | for (x = sx; x < ex; x++) |
| r17669 | r17670 | |
|---|---|---|
| 116 | 116 | |
| 117 | 117 | rect.min_x = horz - 15; |
| 118 | 118 | rect.min_y = vert - 15; |
| 119 | rect.max_x = horz - 15 + screen.machine().gfx[1]->width - 1; | |
| 120 | rect.max_y = vert - 15 + screen.machine().gfx[1]->height - 1; | |
| 119 | rect.max_x = horz - 15 + screen.machine().gfx[1]->width() - 1; | |
| 120 | rect.max_y = vert - 15 + screen.machine().gfx[1]->height() - 1; | |
| 121 | 121 | |
| 122 | 122 | rect &= screen.machine().primary_screen->visible_area(); |
| 123 | 123 |
| r17669 | r17670 | |
|---|---|---|
| 203 | 203 | /* bit 7 unknown (used) */ |
| 204 | 204 | } |
| 205 | 205 | |
| 206 | static void appoooh_draw_sprites( bitmap_ind16 &dest_bmp, const rectangle &cliprect, | |
| 206 | static void appoooh_draw_sprites( bitmap_ind16 &dest_bmp, const rectangle &cliprect, | |
| 207 | 207 | { |
| 208 | 208 | appoooh_state *state = gfx->machine().driver_data<appoooh_state>(); |
| 209 | 209 | int offs; |
| r17669 | r17670 | |
| 235 | 235 | } |
| 236 | 236 | } |
| 237 | 237 | |
| 238 | static void robowres_draw_sprites( bitmap_ind16 &dest_bmp, const rectangle &cliprect, | |
| 238 | static void robowres_draw_sprites( bitmap_ind16 &dest_bmp, const rectangle &cliprect, | |
| 239 | 239 | { |
| 240 | 240 | appoooh_state *state = gfx->machine().driver_data<appoooh_state>(); |
| 241 | 241 | int offs; |
| r17669 | r17670 | |
|---|---|---|
| 410 | 410 | { |
| 411 | 411 | if (screen.machine().root_device().memregion("user1")->base()) |
| 412 | 412 | { |
| 413 | | |
| 413 | | |
| 414 | 414 | int girlyscroll = (INT8)((state->m_cm_girl_scroll & 0xf0)); |
| 415 | 415 | int girlxscroll = (INT8)((state->m_cm_girl_scroll & 0x0f)<<4); |
| 416 | 416 | |
| r17669 | r17670 | |
| 453 | 453 | { |
| 454 | 454 | if (screen.machine().root_device().memregion("user1")->base()) |
| 455 | 455 | { |
| 456 | | |
| 456 | | |
| 457 | 457 | int girlyscroll = (INT8)((state->m_cm_girl_scroll & 0xf0)); |
| 458 | 458 | int girlxscroll = (INT8)((state->m_cm_girl_scroll & 0x0f)<<4); |
| 459 | 459 |
| r17669 | r17670 | |
|---|---|---|
| 255 | 255 | } |
| 256 | 256 | |
| 257 | 257 | |
| 258 | gfx | |
| 258 | gfx-> | |
| 259 | 259 | |
| 260 | 260 | { |
| 261 | 261 | // passes the priority as the upper bits of the colour |
| r17669 | r17670 | |
|---|---|---|
| 91 | 91 | |
| 92 | 92 | drawgfx_transpen_raw(bitmap, cliprect, machine.gfx[2], |
| 93 | 93 | code + layout[row][col], |
| 94 | machine.gfx[2]->color | |
| 94 | machine.gfx[2]->color | |
| 95 | 95 | flipx, flipy, |
| 96 | 96 | x, y, |
| 97 | 97 | 0); |
| r17669 | r17670 | |
| 134 | 134 | |
| 135 | 135 | drawgfx_transpen_raw(state->m_tile_bitmap_bg, cliprect, screen.machine().gfx[1], |
| 136 | 136 | code, |
| 137 | screen.machine().gfx[1]->color | |
| 137 | screen.machine().gfx[1]->color | |
| 138 | 138 | 0, 0, |
| 139 | 139 | 16 * sx, 8 * sy, |
| 140 | 140 | (UINT32)-1); |
| r17669 | r17670 | |
| 161 | 161 | |
| 162 | 162 | drawgfx_transpen_raw(state->m_tile_bitmap_bg, cliprect, screen.machine().gfx[1], |
| 163 | 163 | code, |
| 164 | screen.machine().gfx[1]->color | |
| 164 | screen.machine().gfx[1]->color | |
| 165 | 165 | 0, 0, |
| 166 | 166 | 16 * sx, 8 * sy, |
| 167 | 167 | 0); |
| r17669 | r17670 | |
| 195 | 195 | |
| 196 | 196 | drawgfx_transpen_raw(state->m_tile_bitmap_fg, cliprect, screen.machine().gfx[0], |
| 197 | 197 | code, |
| 198 | screen.machine().gfx[0]->color | |
| 198 | screen.machine().gfx[0]->color | |
| 199 | 199 | 0, 0, |
| 200 | 200 | 16 * sx, 8 * sy, |
| 201 | 201 | 0); |
| r17669 | r17670 | |
|---|---|---|
| 237 | 237 | { |
| 238 | 238 | mo->gfxelement[idx] = auto_alloc(mo->machine(), gfx_element(mo->machine())); |
| 239 | 239 | memcpy(mo->gfxelement[idx], mo->machine().gfx[idx], sizeof(*mo->gfxelement[idx])); |
| 240 | mo->gfxgranularity[idx] = mo->gfxelement[idx]->color_granularity; | |
| 241 | mo->gfxelement[idx]->color_granularity = 1; | |
| 242 | mo->gfxelement[idx]->color_base = 0; | |
| 243 | mo->gfxelement[idx]->total_colors = 65536; | |
| 240 | mo->gfxgranularity[idx] = mo->gfxelement[idx]->granularity(); | |
| 241 | mo->gfxelement[idx]->set_granularity(1); | |
| 242 | mo->gfxelement[idx]->set_colorbase(0); | |
| 243 | mo->gfxelement[idx]->set_colors(65536); | |
| 244 | 244 | } |
| 245 | 245 | |
| 246 | 246 | |
| r17669 | r17670 | |
| 368 | 368 | mo->entrybits = compute_log(mo->entrycount); |
| 369 | 369 | mo->bankcount = desc->banks; |
| 370 | 370 | |
| 371 | mo->tilewidth = gfx->width; | |
| 372 | mo->tileheight = gfx->height; | |
| 371 | mo->tilewidth = gfx->width(); | |
| 372 | mo->tileheight = gfx->height(); | |
| 373 | 373 | mo->tilexshift = compute_log(mo->tilewidth); |
| 374 | 374 | mo->tileyshift = compute_log(mo->tileheight); |
| 375 | 375 | mo->bitmapwidth = round_to_powerof2(mo->xposmask.mask); |
| r17669 | r17670 | |
| 383 | 383 | mo->sliprammask = mo->slipramsize - 1; |
| 384 | 384 | |
| 385 | 385 | mo->palettebase = desc->palettebase; |
| 386 | mo->maxcolors = desc->maxcolors / gfx-> | |
| 386 | mo->maxcolors = desc->maxcolors / gfx-> | |
| 387 | 387 | mo->transpen = desc->transpen; |
| 388 | 388 | |
| 389 | 389 | mo->bank = 0; |
| r17669 | r17670 | |
| 742 | 742 | static int mo_render_object(atarimo_data *mo, const atarimo_entry *entry, const rectangle &cliprect) |
| 743 | 743 | { |
| 744 | 744 | int gfxindex = mo->gfxlookup[EXTRACT_DATA(entry, mo->gfxmask)]; |
| 745 | | |
| 745 | | |
| 746 | 746 | bitmap_ind16 &bitmap = *mo->bitmap; |
| 747 | 747 | int x, y, sx, sy; |
| 748 | 748 |
| r17669 | r17670 | |
|---|---|---|
| 133 | 133 | **- End of Comments -*/ |
| 134 | 134 | |
| 135 | 135 | wwfsstar_state *state = machine.driver_data<wwfsstar_state>(); |
| 136 | | |
| 136 | | |
| 137 | 137 | UINT16 *source = state->m_spriteram; |
| 138 | 138 | UINT16 *finish = source + 0x3ff/2; |
| 139 | 139 |
| r17669 | r17670 | |
|---|---|---|
| 425 | 425 | UINT32 code,UINT32 color,int flipx,int sx,int sy, |
| 426 | 426 | int sizex,int sizey) |
| 427 | 427 | { |
| 428 | const gfx_element *gfx = machine.gfx[big ? 3 : 2]; | |
| 429 | const UINT8 *gfxdata = gfx_element_get_data(gfx, code % gfx->total_elements); | |
| 428 | gfx_element *gfx = machine.gfx[big ? 3 : 2]; | |
| 429 | const UINT8 *gfxdata = gfx->get_data(code % gfx->elements()); | |
| 430 | 430 | UINT8 *scaling_rom = machine.root_device().memregion("gfx6")->base(); |
| 431 | 431 | UINT32 transmask = colortable_get_transpen_mask(machine.colortable, gfx, color, 0x1f); |
| 432 | int coloroffs = gfx->color | |
| 432 | int coloroffs = gfx->color | |
| 433 | 433 | int x,y; |
| 434 | 434 | |
| 435 | 435 | if (flipx) flipx = big ? 0x1f : 0x0f; |
| r17669 | r17670 | |
| 448 | 448 | const UINT8 *src; |
| 449 | 449 | |
| 450 | 450 | if (!big) dy >>= 1; |
| 451 | src = gfxdata + dy * gfx-> | |
| 451 | src = gfxdata + dy * gfx->r | |
| 452 | 452 | |
| 453 | 453 | for (x = (big ? 0x40 : 0x20);x > 0;x--) |
| 454 | 454 | { |
| r17669 | r17670 | |
|---|---|---|
| 1439 | 1439 | |
| 1440 | 1440 | if (offset < 0x1000 / 2) |
| 1441 | 1441 | { |
| 1442 | | |
| 1442 | | |
| 1443 | 1443 | #if 0 |
| 1444 | 1444 | if (!tc0080vco->has_tx) |
| 1445 | 1445 | { |
| r17669 | r17670 | |
| 1470 | 1470 | |
| 1471 | 1471 | else if (offset < 0x11000 / 2) |
| 1472 | 1472 | { |
| 1473 | | |
| 1473 | | |
| 1474 | 1474 | #if 0 |
| 1475 | 1475 | if (!tc0080vco->has_tx) |
| 1476 | 1476 | { |
| r17669 | r17670 | |
| 1902 | 1902 | tc0080vco->scroll_ram = tc0080vco->ram + 0x20800 / 2; |
| 1903 | 1903 | |
| 1904 | 1904 | /* create the char set (gfx will then be updated dynamically from RAM) */ |
| 1905 | device->machine().gfx[tc0080vco->tx_gfx] = gfx_element | |
| 1905 | device->machine().gfx[tc0080vco->tx_gfx] = auto_alloc(device->machine(), gfx_element | |
| 1906 | 1906 | |
| 1907 | 1907 | device->save_pointer(NAME(tc0080vco->ram), TC0080VCO_RAM_SIZE / 2); |
| 1908 | 1908 | device->machine().save().register_postload(save_prepost_delegate(FUNC(tc0080vco_postload), tc0080vco)); |
| r17669 | r17670 | |
| 2173 | 2173 | else if (offset < 0x3000) |
| 2174 | 2174 | tc0100scn->tilemap[2][0]->mark_tile_dirty((offset & 0x0fff)); |
| 2175 | 2175 | else if (offset < 0x3800) |
| 2176 | | |
| 2176 | | |
| 2177 | 2177 | else if (offset >= 0x4000 && offset < 0x6000) |
| 2178 | 2178 | tc0100scn->tilemap[1][0]->mark_tile_dirty((offset & 0x1fff) / 2); |
| 2179 | 2179 | } |
| r17669 | r17670 | |
| 2184 | 2184 | else if (offset >= 0x4000 && offset < 0x8000) |
| 2185 | 2185 | tc0100scn->tilemap[1][1]->mark_tile_dirty((offset & 0x3fff) / 2); |
| 2186 | 2186 | else if (offset >= 0x8800 && offset < 0x9000) |
| 2187 | | |
| 2187 | | |
| 2188 | 2188 | else if (offset >= 0x9000) |
| 2189 | 2189 | tc0100scn->tilemap[2][1]->mark_tile_dirty((offset & 0x0fff)); |
| 2190 | 2190 | } |
| r17669 | r17670 | |
| 2246 | 2246 | tc0100scn_dirty_tilemaps(device); |
| 2247 | 2247 | |
| 2248 | 2248 | /* reset the pointer to the text characters (and dirty them all) */ |
| 2249 | | |
| 2249 | | |
| 2250 | 2250 | } |
| 2251 | 2251 | |
| 2252 | 2252 | break; |
| r17669 | r17670 | |
| 2491 | 2491 | tc0100scn->bg_col_mult = 1; /* multiplier for when bg gfx != 4bpp */ |
| 2492 | 2492 | tc0100scn->tx_col_mult = 1; /* multiplier needed when bg gfx is 6bpp */ |
| 2493 | 2493 | |
| 2494 | if (device->machine().gfx[intf->gfxnum]-> | |
| 2494 | if (device->machine().gfx[intf->gfxnum]-> | |
| 2495 | 2495 | tc0100scn->bg_col_mult = 8; |
| 2496 | 2496 | |
| 2497 | if (device->machine().gfx[intf->gfxnum]-> | |
| 2497 | if (device->machine().gfx[intf->gfxnum]-> | |
| 2498 | 2498 | tc0100scn->tx_col_mult = 4; |
| 2499 | 2499 | |
| 2500 | //logerror("TC0100SCN bg gfx granularity %04x: multiplier %04x\n", device->machine().gfx[intf->gfxnum]-> | |
| 2500 | //logerror("TC0100SCN bg gfx granularity %04x: multiplier %04x\n", device->machine().gfx[intf->gfxnum]-> | |
| 2501 | 2501 | |
| 2502 | 2502 | tc0100scn->ram = auto_alloc_array_clear(device->machine(), UINT16, TC0100SCN_RAM_SIZE / 2); |
| 2503 | 2503 | |
| r17669 | r17670 | |
| 2507 | 2507 | /* we call this here, so that they can be modified at VIDEO_START*/ |
| 2508 | 2508 | |
| 2509 | 2509 | /* create the char set (gfx will then be updated dynamically from RAM) */ |
| 2510 | device->machine().gfx[tc0100scn->tx_gfx] = gfx_element | |
| 2510 | device->machine().gfx[tc0100scn->tx_gfx] = auto_alloc(device->machine(), gfx_element | |
| 2511 | 2511 | |
| 2512 | 2512 | device->save_pointer(NAME(tc0100scn->ram), TC0100SCN_RAM_SIZE / 2); |
| 2513 | 2513 | device->save_item(NAME(tc0100scn->ctrl)); |
| r17669 | r17670 | |
| 2976 | 2976 | } |
| 2977 | 2977 | else if (offset <= 0x7fff) |
| 2978 | 2978 | { |
| 2979 | | |
| 2979 | | |
| 2980 | 2980 | } |
| 2981 | 2981 | } |
| 2982 | 2982 | else |
| r17669 | r17670 | |
| 2994 | 2994 | } |
| 2995 | 2995 | else if (offset <= 0x7fff) |
| 2996 | 2996 | { |
| 2997 | | |
| 2997 | | |
| 2998 | 2998 | } |
| 2999 | 2999 | } |
| 3000 | 3000 | } |
| r17669 | r17670 | |
| 3717 | 3717 | tc0480scp_set_layer_ptrs(tc0480scp); |
| 3718 | 3718 | |
| 3719 | 3719 | /* create the char set (gfx will then be updated dynamically from RAM) */ |
| 3720 | device->machine().gfx[tc0480scp->tx_gfx] = gfx_element | |
| 3720 | device->machine().gfx[tc0480scp->tx_gfx] = auto_alloc(device->machine(), gfx_element | |
| 3721 | 3721 | |
| 3722 | 3722 | device->save_pointer(NAME(tc0480scp->ram), TC0480SCP_RAM_SIZE / 2); |
| 3723 | 3723 | device->save_item(NAME(tc0480scp->ctrl)); |
| r17669 | r17670 | |
|---|---|---|
| 285 | 285 | int sprite_xoffs = state->m_spriteram[0x07f5] + ((state->m_spriteram[0x07f4] & 1) << 8); |
| 286 | 286 | int sprite_yoffs = state->m_spriteram[0x07f7]; |
| 287 | 287 | |
| 288 | int bank_sprites = machine.gfx[2]-> | |
| 288 | int bank_sprites = machine.gfx[2]-> | |
| 289 | 289 | |
| 290 | 290 | while (source >= finish) |
| 291 | 291 | { |
| r17669 | r17670 | |
| 323 | 323 | |
| 324 | 324 | sy++; /* sprites are buffered and delayed by one scanline */ |
| 325 | 325 | |
| 326 | gfx | |
| 326 | gfx-> | |
| 327 | 327 | pdrawgfx_transpen( bitmap, cliprect,gfx, |
| 328 | 328 | sprite, |
| 329 | 329 | color, |
| r17669 | r17670 | |
| 371 | 371 | |
| 372 | 372 | screen.machine().priority_bitmap.fill(0, cliprect); |
| 373 | 373 | |
| 374 | bitmap.fill(screen.machine().gfx[0]->color | |
| 374 | bitmap.fill(screen.machine().gfx[0]->color | |
| 375 | 375 | |
| 376 | 376 | for (layer = 0;layer < 8;layer++) |
| 377 | 377 | { |
| r17669 | r17670 | |
|---|---|---|
| 118 | 118 | { |
| 119 | 119 | btime_state *state = machine.driver_data<btime_state>(); |
| 120 | 120 | |
| 121 | if (machine.gfx[0]->srcdata == NULL) | |
| 122 | gfx_element_set_source(machine.gfx[0], state->m_deco_charram); | |
| 123 | if (machine.gfx[1]->srcdata == NULL) | |
| 124 | gfx_element_set_source(machine.gfx[1], state->m_deco_charram); | |
| 121 | if (machine.gfx[0]->srcdata() == NULL) | |
| 122 | machine.gfx[0]->set_source(state->m_deco_charram); | |
| 123 | if (machine.gfx[1]->srcdata() == NULL) | |
| 124 | machine.gfx[1]->set_source(state->m_deco_charram); | |
| 125 | 125 | } |
| 126 | 126 | |
| 127 | 127 | |
| r17669 | r17670 | |
| 221 | 221 | offset &= 0x1fff; |
| 222 | 222 | |
| 223 | 223 | /* dirty sprite */ |
| 224 | | |
| 224 | | |
| 225 | 225 | |
| 226 | 226 | /* diry char */ |
| 227 | | |
| 227 | | |
| 228 | 228 | } |
| 229 | 229 | |
| 230 | 230 | WRITE8_MEMBER(btime_state::bnj_background_w) |
| r17669 | r17670 | |
|---|---|---|
| 269 | 269 | { |
| 270 | 270 | nova2001_state *state = machine.driver_data<nova2001_state>(); |
| 271 | 271 | UINT8 *spriteram = state->m_spriteram; |
| 272 | | |
| 272 | | |
| 273 | 273 | int offs; |
| 274 | 274 | |
| 275 | 275 | for (offs = 0; offs < 0x800; offs += 32) |
| r17669 | r17670 | |
| 307 | 307 | { |
| 308 | 308 | nova2001_state *state = machine.driver_data<nova2001_state>(); |
| 309 | 309 | UINT8 *spriteram = state->m_spriteram; |
| 310 | | |
| 310 | | |
| 311 | 311 | int offs; |
| 312 | 312 | |
| 313 | 313 | for (offs = 0; offs < 0x800; offs += 32) |
| r17669 | r17670 | |
|---|---|---|
| 307 | 307 | |
| 308 | 308 | rect.min_x = sx; |
| 309 | 309 | rect.min_y = sy; |
| 310 | rect.max_x = sx + screen.machine().gfx[1]->width - 1; | |
| 311 | rect.max_y = sy + screen.machine().gfx[1]->height - 1; | |
| 310 | rect.max_x = sx + screen.machine().gfx[1]->width() - 1; | |
| 311 | rect.max_y = sy + screen.machine().gfx[1]->height() - 1; | |
| 312 | 312 | |
| 313 | 313 | rect &= visarea; |
| 314 | 314 | |
| r17669 | r17670 | |
| 410 | 410 | |
| 411 | 411 | rect.min_x = sx; |
| 412 | 412 | rect.min_y = sy; |
| 413 | rect.max_x = sx + screen.machine().gfx[1]->width - 1; | |
| 414 | rect.max_y = sy + screen.machine().gfx[1]->height - 1; | |
| 413 | rect.max_x = sx + screen.machine().gfx[1]->width() - 1; | |
| 414 | rect.max_y = sy + screen.machine().gfx[1]->height() - 1; | |
| 415 | 415 | |
| 416 | 416 | rect &= visarea; |
| 417 | 417 | |
| r17669 | r17670 | |
| 491 | 491 | |
| 492 | 492 | rect.min_x = sx; |
| 493 | 493 | rect.min_y = sy; |
| 494 | rect.max_x = sx + screen.machine().gfx[1]->width - 1; | |
| 495 | rect.max_y = sy + screen.machine().gfx[1]->height - 1; | |
| 494 | rect.max_x = sx + screen.machine().gfx[1]->width() - 1; | |
| 495 | rect.max_y = sy + screen.machine().gfx[1]->height() - 1; | |
| 496 | 496 | |
| 497 | 497 | rect &= visarea; |
| 498 | 498 |
| r17669 | r17670 | |
|---|---|---|
| 95 | 95 | { |
| 96 | 96 | kickgoal_state *state = machine.driver_data<kickgoal_state>(); |
| 97 | 97 | UINT16 *spriteram = state->m_spriteram; |
| 98 | | |
| 98 | | |
| 99 | 99 | int offs; |
| 100 | 100 | |
| 101 | 101 | for (offs = 0; offs < state->m_spriteram.bytes() / 2; offs += 4) |
| r17669 | r17670 | |
|---|---|---|
| 150 | 150 | break; |
| 151 | 151 | } |
| 152 | 152 | |
| 153 | return gfx | |
| 153 | return gfx-> | |
| 154 | 154 | } |
| 155 | 155 | |
| 156 | 156 | static void bbusters_draw_block(running_machine &machine, bitmap_ind16 &dest,int x,int y,int size,int flipx,int flipy,UINT32 sprite,int color,int bank,int block) |
| 157 | 157 | { |
| 158 | 158 | bbusters_state *state = machine.driver_data<bbusters_state>(); |
| 159 | 159 | gfx_element *gfx = machine.gfx[bank]; |
| 160 | pen_t pen_base = gfx->color | |
| 160 | pen_t pen_base = gfx->color | |
| 161 | 161 | UINT32 xinc=(state->m_scale_line_count * 0x10000 ) / size; |
| 162 | 162 | UINT8 pixel; |
| 163 | 163 | int x_index; |
| r17669 | r17670 | |
|---|---|---|
| 183 | 183 | // bermudat, tdfever use FFFF to blank the background. |
| 184 | 184 | // (still call SET_TILE_INFO, otherwise problems might occur on boot when |
| 185 | 185 | // the tile data hasn't been initialised) |
| 186 | if (code >= machine.gfx[1]-> | |
| 186 | if (code >= machine.gfx[1]-> | |
| 187 | 187 | tileinfo.pen_data = state->m_empty_tile; |
| 188 | 188 | } |
| 189 | 189 | |
| r17669 | r17670 | |
| 718 | 718 | const int scrollx, const int scrolly, const int from, const int to) |
| 719 | 719 | { |
| 720 | 720 | snk_state *state = machine.driver_data<snk_state>(); |
| 721 | | |
| 721 | | |
| 722 | 722 | const UINT8 *source, *finish; |
| 723 | 723 | |
| 724 | 724 | source = state->m_spriteram + from*4; |
| r17669 | r17670 | |
| 763 | 763 | { |
| 764 | 764 | snk_state *state = machine.driver_data<snk_state>(); |
| 765 | 765 | UINT8 *spriteram = state->m_spriteram; |
| 766 | const gfx_element *gfx = machine.gfx[2]; | |
| 767 | const int size = gfx->width; | |
| 766 | gfx_element *gfx = machine.gfx[2]; | |
| 767 | const int size = gfx->width(); | |
| 768 | 768 | int tile_number, attributes, color, sx, sy; |
| 769 | 769 | int xflip,yflip; |
| 770 | 770 | int offs; |
| r17669 | r17670 | |
| 787 | 787 | xflip = 0; |
| 788 | 788 | yflip = 0; |
| 789 | 789 | |
| 790 | if (gfx-> | |
| 790 | if (gfx-> | |
| 791 | 791 | { |
| 792 | 792 | tile_number |= (attributes & 0x40) << 2; |
| 793 | 793 | } |
| 794 | 794 | |
| 795 | if (gfx-> | |
| 795 | if (gfx-> | |
| 796 | 796 | { |
| 797 | 797 | tile_number |= (attributes & 0x20) << 4; |
| 798 | 798 | } |
| r17669 | r17670 | |
| 828 | 828 | const int start, const int xscroll, const int yscroll, const UINT8 *source, const int gfxnum ) |
| 829 | 829 | { |
| 830 | 830 | snk_state *state = machine.driver_data<snk_state>(); |
| 831 | const gfx_element *gfx = machine.gfx[gfxnum]; | |
| 832 | const int size = gfx->width; | |
| 831 | gfx_element *gfx = machine.gfx[gfxnum]; | |
| 832 | const int size = gfx->width(); | |
| 833 | 833 | int tile_number, attributes, color, sx, sy; |
| 834 | 834 | int which, finish; |
| 835 | 835 | |
| r17669 | r17670 | |
| 900 | 900 | const int xscroll, const int yscroll, const UINT8 *source, const int gfxnum, const int hw_xflip, const int from, const int to ) |
| 901 | 901 | { |
| 902 | 902 | snk_state *state = machine.driver_data<snk_state>(); |
| 903 | const gfx_element *gfx = machine.gfx[gfxnum]; | |
| 904 | const int size = gfx->width; | |
| 903 | gfx_element *gfx = machine.gfx[gfxnum]; | |
| 904 | const int size = gfx->width(); | |
| 905 | 905 | int tile_number, attributes, sx, sy, color; |
| 906 | 906 | int which; |
| 907 | 907 | int flipx, flipy; |
| r17669 | r17670 | |
|---|---|---|
| 494 | 494 | |
| 495 | 495 | for (i = 0; i < 0x20; i++) |
| 496 | 496 | { |
| 497 | gfx_element gfx(machine); | |
| 498 | ||
| 499 | 497 | if (!(state->m_videoregs[0x02 / 2] & 0x8000)) |
| 500 | 498 | { |
| 501 | 499 | src = state->m_spriteram + (sprites - 1) * (8 / 2); |
| r17669 | r17670 | |
| 569 | 567 | if ((gfxstart + width * height - 1) >= gfx_size) |
| 570 | 568 | continue; |
| 571 | 569 | |
| 572 | gfx_element | |
| 570 | gfx_element | |
| 573 | 571 | |
| 574 | 572 | pdrawgfxzoom_transpen(bitmap,cliprect, &gfx, |
| 575 | 573 | 0, |
| r17669 | r17670 | |
| 585 | 583 | if ((gfxstart + width / 2 * height - 1) >= gfx_size) |
| 586 | 584 | continue; |
| 587 | 585 | |
| 588 | gfx_element | |
| 586 | gfx_element | |
| 589 | 587 | |
| 590 | 588 | pdrawgfxzoom_transpen(bitmap,cliprect, &gfx, |
| 591 | 589 | 0, |
| r17669 | r17670 | |
|---|---|---|
| 67 | 67 | /* set the intial scroll offset */ |
| 68 | 68 | atarimo_set_xscroll(0, -12); |
| 69 | 69 | atarimo_set_yscroll(0, 0x110); |
| 70 | state->m_has_mo = (machine.gfx[0]-> | |
| 70 | state->m_has_mo = (machine.gfx[0]-> | |
| 71 | 71 | } |
| 72 | 72 | |
| 73 | 73 |
| r17669 | r17670 | |
|---|---|---|
| 31 | 31 | */ |
| 32 | 32 | |
| 33 | 33 | suprslam_state *state = machine.driver_data<suprslam_state>(); |
| 34 | | |
| 34 | | |
| 35 | 35 | UINT16 *source = state->m_spriteram; |
| 36 | 36 | UINT16 *source2 = state->m_spriteram; |
| 37 | 37 | UINT16 *finish = source + 0x2000/2; |
| r17669 | r17670 | |
|---|---|---|
| 94 | 94 | memset(char_ram, 0, 0x80000); |
| 95 | 95 | memset(tile_ram, 0, 0x10000); |
| 96 | 96 | |
| 97 | machine().gfx[char_gfx_index] = gfx_element | |
| 97 | machine().gfx[char_gfx_index] = auto_alloc(machine(), gfx_element | |
| 98 | 98 | |
| 99 | 99 | save_pointer(NAME(tile_ram), 0x10000/2); |
| 100 | 100 | save_pointer(NAME(char_ram), 0x80000/2); |
| r17669 | r17670 | |
| 550 | 550 | UINT16 old = char_ram[offset]; |
| 551 | 551 | COMBINE_DATA(char_ram + offset); |
| 552 | 552 | if(old != char_ram[offset]) |
| 553 | | |
| 553 | | |
| 554 | 554 | } |
| 555 | 555 | |
| 556 | 556 | READ32_MEMBER(segas24_tile::tile32_r) |
| r17669 | r17670 | |
|---|---|---|
| 38 | 38 | state->m_vram_tilemap->set_transparent_pen(0); |
| 39 | 39 | state->m_bitmap0.fill(0x100); |
| 40 | 40 | |
| 41 | | |
| 41 | | |
| 42 | 42 | |
| 43 | 43 | machine.device<decospr_device>("spritegen")->alloc_sprite_bitmap(); |
| 44 | 44 | machine.device<decospr_device>("spritegen2")->alloc_sprite_bitmap(); |
| r17669 | r17670 | |
| 97 | 97 | |
| 98 | 98 | /* Copy pixel to buffer for easier decoding later */ |
| 99 | 99 | tile = ((sx / 8) * 32) + (sy / 8); |
| 100 | | |
| 100 | | |
| 101 | 101 | m_vram_buffer[(tile * 64) + ((sx & 7)) + ((sy & 7) * 8)] = (src >> 8) & 0xf; |
| 102 | 102 | |
| 103 | 103 | sx += 1; /* Update both pixels in the word */ |
| r17669 | r17670 | |
|---|---|---|
| 23 | 23 | m_charram[offset + 0x1800] = data; |
| 24 | 24 | |
| 25 | 25 | if ((m_layers_ctrl & (16|8|4|2)) != (16|8|4|2)) |
| 26 | | |
| 26 | | |
| 27 | 27 | |
| 28 | 28 | if(!(m_layers_ctrl & 1)) { |
| 29 | 29 | m_tileram[offset] = data; |
| r17669 | r17670 | |
| 153 | 153 | state_save_register_global(machine, state->m_bg_vshift); |
| 154 | 154 | state_save_register_global(machine, state->m_bg_hshift); |
| 155 | 155 | |
| 156 | | |
| 156 | | |
| 157 | 157 | } |
| 158 | 158 | |
| 159 | 159 | static void draw_sprites(running_machine &machine, bitmap_ind16 &bitmap, const rectangle &cliprect) |
| r17669 | r17670 | |
|---|---|---|
| 934 | 934 | ***************************************************************************/ |
| 935 | 935 | |
| 936 | 936 | // custom function to draw a single sprite. needed to keep correct sprites - sprites and sprites - tilemaps priorities |
| 937 | static void toaplan1_draw_sprite_custom(bitmap_ind16 &dest_bmp,const rectangle &clip, | |
| 937 | static void toaplan1_draw_sprite_custom(bitmap_ind16 &dest_bmp,const rectangle &clip, | |
| 938 | 938 | UINT32 code,UINT32 color,int flipx,int flipy,int sx,int sy, |
| 939 | 939 | int priority) |
| 940 | 940 | { |
| 941 | int pal_base = gfx->color_base + gfx->color_granularity * (color % gfx->total_colors); | |
| 942 | const UINT8 *source_base = gfx_element_get_data(gfx, code % gfx->total_elements); | |
| 941 | int pal_base = gfx->colorbase() + gfx->granularity() * (color % gfx->colors()); | |
| 942 | const UINT8 *source_base = gfx->get_data(code % gfx->elements()); | |
| 943 | 943 | bitmap_ind8 &priority_bitmap = gfx->machine().priority_bitmap; |
| 944 | int sprite_screen_height = ((1<<16)*gfx->height+0x8000)>>16; | |
| 945 | int sprite_screen_width = ((1<<16)*gfx->width+0x8000)>>16; | |
| 944 | int sprite_screen_height = ((1<<16)*gfx->height()+0x8000)>>16; | |
| 945 | int sprite_screen_width = ((1<<16)*gfx->width()+0x8000)>>16; | |
| 946 | 946 | |
| 947 | 947 | if (sprite_screen_width && sprite_screen_height) |
| 948 | 948 | { |
| 949 | 949 | /* compute sprite increment per screen pixel */ |
| 950 | int dx = (gfx->width<<16)/sprite_screen_width; | |
| 951 | int dy = (gfx->height<<16)/sprite_screen_height; | |
| 950 | int dx = (gfx->width()<<16)/sprite_screen_width; | |
| 951 | int dy = (gfx->height()<<16)/sprite_screen_height; | |
| 952 | 952 | |
| 953 | 953 | int ex = sx+sprite_screen_width; |
| 954 | 954 | int ey = sy+sprite_screen_height; |
| r17669 | r17670 | |
| 1006 | 1006 | |
| 1007 | 1007 | for( y=sy; y<ey; y++ ) |
| 1008 | 1008 | { |
| 1009 | const UINT8 *source = source_base + (y_index>>16) * gfx-> | |
| 1009 | const UINT8 *source = source_base + (y_index>>16) * gfx->r | |
| 1010 | 1010 | UINT16 *dest = &dest_bmp.pix16(y); |
| 1011 | 1011 | UINT8 *pri = &priority_bitmap.pix8(y); |
| 1012 | 1012 |
| r17669 | r17670 | |
|---|---|---|
| 194 | 194 | 3, rg_resistances, state->m_gweights, 220, 0, |
| 195 | 195 | 2, b_resistances, state->m_bweights, 220, 0); |
| 196 | 196 | |
| 197 | | |
| 197 | | |
| 198 | 198 | |
| 199 | 199 | /* allocate paletteram */ |
| 200 | 200 | state->m_generic_paletteram_8.allocate(0x80); |
| r17669 | r17670 | |
| 270 | 270 | |
| 271 | 271 | /* track which characters are dirty */ |
| 272 | 272 | if (offset & 0x800) |
| 273 | | |
| 273 | | |
| 274 | 274 | } |
| 275 | 275 | |
| 276 | 276 |
| r17669 | r17670 | |
|---|---|---|
| 62 | 62 | WRITE32_MEMBER(taitojc_state::taitojc_char_w) |
| 63 | 63 | { |
| 64 | 64 | COMBINE_DATA(m_char_ram + offset); |
| 65 | | |
| 65 | | |
| 66 | 66 | } |
| 67 | 67 | |
| 68 | 68 | // Object data format: |
| r17669 | r17670 | |
| 320 | 320 | state->m_tile_ram = auto_alloc_array_clear(machine, UINT32, 0x4000/4); |
| 321 | 321 | |
| 322 | 322 | /* create the char set (gfx will then be updated dynamically from RAM) */ |
| 323 | machine.gfx[state->m_gfx_index] = gfx_element | |
| 323 | machine.gfx[state->m_gfx_index] = auto_alloc(machine, gfx_element | |
| 324 | 324 | |
| 325 | 325 | state->m_texture = auto_alloc_array(machine, UINT8, 0x400000); |
| 326 | 326 |
| r17669 | r17670 | |
|---|---|---|
| 206 | 206 | bionicc_state *state = machine.driver_data<bionicc_state>(); |
| 207 | 207 | UINT16 *buffered_spriteram = state->m_spriteram->buffer(); |
| 208 | 208 | int offs; |
| 209 | | |
| 209 | | |
| 210 | 210 | |
| 211 | 211 | for (offs = (state->m_spriteram->bytes() - 8) / 2; offs >= 0; offs -= 4) |
| 212 | 212 | { |
| r17669 | r17670 | |
|---|---|---|
| 390 | 390 | { |
| 391 | 391 | playmark_state *state = machine.driver_data<playmark_state>(); |
| 392 | 392 | int offs, start_offset = state->m_spriteram.bytes() / 2 - 4; |
| 393 | int height = machine.gfx[0]->height; | |
| 394 | int colordiv = machine.gfx[0]->color_granularity / 16; | |
| 393 | int height = machine.gfx[0]->height(); | |
| 394 | int colordiv = machine.gfx[0]->granularity() / 16; | |
| 395 | 395 | UINT16 *spriteram = state->m_spriteram; |
| 396 | 396 | |
| 397 | 397 | // find the "end of list" to draw the sprites in reverse order |
| r17669 | r17670 | |
| 434 | 434 | { |
| 435 | 435 | playmark_state *state = machine.driver_data<playmark_state>(); |
| 436 | 436 | int offs, start_offset = state->m_spriteram.bytes() / 2 - 4; |
| 437 | int height = machine.gfx[0]->height; | |
| 437 | int height = machine.gfx[0]->height(); | |
| 438 | 438 | UINT16 *spriteram = state->m_spriteram; |
| 439 | 439 | |
| 440 | 440 | // find the "end of list" to draw the sprites in reverse order |
| r17669 | r17670 | |
|---|---|---|
| 112 | 112 | WRITE8_MEMBER(st0016_state::st0016_character_ram_w) |
| 113 | 113 | { |
| 114 | 114 | st0016_charram[ST0016_CHAR_BANK_SIZE*st0016_char_bank+offset]=data; |
| 115 | | |
| 115 | | |
| 116 | 116 | } |
| 117 | 117 | |
| 118 | 118 | READ8_MEMBER(st0016_state::st0016_vregs_r) |
| r17669 | r17670 | |
| 360 | 360 | tileno = (code+i0++)&ST0016_CHAR_BANK_MASK ; |
| 361 | 361 | |
| 362 | 362 | gfxoffs = 0; |
| 363 | srcgfx= gfx | |
| 363 | srcgfx= gfx-> | |
| 364 | 364 | |
| 365 | 365 | for (yloop=0; yloop<8; yloop++) |
| 366 | 366 | { |
| r17669 | r17670 | |
| 450 | 450 | assert(gfx_index != MAX_GFX_ELEMENTS); |
| 451 | 451 | |
| 452 | 452 | /* create the char set (gfx will then be updated dynamically from RAM) */ |
| 453 | machine.gfx[gfx_index] = gfx_element | |
| 453 | machine.gfx[gfx_index] = auto_alloc(machine, gfx_element | |
| 454 | 454 | st0016_ramgfx = gfx_index; |
| 455 | 455 | |
| 456 | 456 | spr_dx=0; |
| r17669 | r17670 | |
| 526 | 526 | ypos = y*8+spr_dy;//+((st0016_vregs[j+2]==0xaf)?0x50:0);//hack for mayjinsen title screen |
| 527 | 527 | xpos = x*8+spr_dx; |
| 528 | 528 | gfxoffs = 0; |
| 529 | srcgfx= gfx | |
| 529 | srcgfx= gfx-> | |
| 530 | 530 | |
| 531 | 531 | for (yloop=0; yloop<8; yloop++) |
| 532 | 532 | { |
| r17669 | r17670 | |
|---|---|---|
| 63 | 63 | static void draw_sprites( running_machine &machine, bitmap_ind16 &bitmap, const rectangle &cliprect ) |
| 64 | 64 | { |
| 65 | 65 | battlex_state *state = machine.driver_data<battlex_state>(); |
| 66 | | |
| 66 | | |
| 67 | 67 | UINT8 *source = state->m_spriteram; |
| 68 | 68 | UINT8 *finish = state->m_spriteram + 0x200; |
| 69 | 69 |
| r17669 | r17670 | |
|---|---|---|
| 43 | 43 | static void draw_sprites( running_machine &machine, bitmap_ind16 &bitmap, const rectangle &cliprect ) |
| 44 | 44 | { |
| 45 | 45 | mrflea_state *state = machine.driver_data<mrflea_state>(); |
| 46 | | |
| 46 | | |
| 47 | 47 | const UINT8 *source = state->m_spriteram; |
| 48 | 48 | const UINT8 *finish = source + 0x100; |
| 49 | 49 | rectangle clip = machine.primary_screen->visible_area(); |
| r17669 | r17670 | |
| 75 | 75 | { |
| 76 | 76 | mrflea_state *state = machine.driver_data<mrflea_state>(); |
| 77 | 77 | const UINT8 *source = state->m_videoram; |
| 78 | | |
| 78 | | |
| 79 | 79 | int sx, sy; |
| 80 | 80 | int base = 0; |
| 81 | 81 |
| r17669 | r17670 | |
|---|---|---|
| 166 | 166 | { |
| 167 | 167 | glass_state *state = machine.driver_data<glass_state>(); |
| 168 | 168 | int i; |
| 169 | | |
| 169 | | |
| 170 | 170 | |
| 171 | 171 | for (i = 3; i < (0x1000 - 6) / 2; i += 4) |
| 172 | 172 | { |
| r17669 | r17670 | |
|---|---|---|
| 76 | 76 | static void truxton2_postload(running_machine &machine) |
| 77 | 77 | { |
| 78 | 78 | for (int i = 0; i < 1024; i++) |
| 79 | | |
| 79 | | |
| 80 | 80 | } |
| 81 | 81 | |
| 82 | 82 | VIDEO_START( toaplan2 ) |
| r17669 | r17670 | |
| 112 | 112 | VIDEO_START_CALL( toaplan2 ); |
| 113 | 113 | |
| 114 | 114 | /* Create the Text tilemap for this game */ |
| 115 | | |
| 115 | | |
| 116 | 116 | machine.save().register_postload(save_prepost_delegate(FUNC(truxton2_postload), &machine)); |
| 117 | 117 | |
| 118 | 118 | truxton2_create_tx_tilemap(machine); |
| r17669 | r17670 | |
| 177 | 177 | |
| 178 | 178 | /* Create the Text tilemap for this game */ |
| 179 | 179 | state->m_tx_gfxram16.allocate(RAIZING_TX_GFXRAM_SIZE/2); |
| 180 | | |
| 180 | | |
| 181 | 181 | machine.save().register_postload(save_prepost_delegate(FUNC(truxton2_postload), &machine)); |
| 182 | 182 | |
| 183 | 183 | truxton2_create_tx_tilemap(machine); |
| r17669 | r17670 | |
| 246 | 246 | { |
| 247 | 247 | int code = offset/32; |
| 248 | 248 | COMBINE_DATA(&m_tx_gfxram16[offset]); |
| 249 | | |
| 249 | | |
| 250 | 250 | } |
| 251 | 251 | } |
| 252 | 252 | |
| r17669 | r17670 | |
| 268 | 268 | memcpy(dest, m_mainram16, m_mainram16.bytes()); |
| 269 | 269 | |
| 270 | 270 | for (int i = 0; i < 1024; i++) |
| 271 | | |
| 271 | | |
| 272 | 272 | } |
| 273 | 273 | |
| 274 | 274 | WRITE16_MEMBER(toaplan2_state::batrider_unknown_dma_w) |
| r17669 | r17670 | |
|---|---|---|
| 124 | 124 | { |
| 125 | 125 | gaelco_state *state = machine.driver_data<gaelco_state>(); |
| 126 | 126 | int i, x, y, ex, ey; |
| 127 | | |
| 127 | | |
| 128 | 128 | |
| 129 | 129 | static const int x_offset[2] = {0x0,0x2}; |
| 130 | 130 | static const int y_offset[2] = {0x0,0x1}; |
| r17669 | r17670 | |
|---|---|---|
| 610 | 610 | if ((road>>8) != 0x04) continue; |
| 611 | 611 | road &= YMASK; |
| 612 | 612 | |
| 613 | src_ptr = gfx_element_get_data(machine.gfx[1], (road << 3)); | |
| 614 | gfx_element_get_data(machine.gfx[1], (road << 3) + 1); | |
| 615 | gfx_element_get_data(machine.gfx[1], (road << 3) + 2); | |
| 616 | gfx_element_get_data(machine.gfx[1], (road << 3) + 3); | |
| 617 | gfx_element_get_data(machine.gfx[1], (road << 3) + 4); | |
| 618 | gfx_element_get_data(machine.gfx[1], (road << 3) + 5); | |
| 619 | gfx_element_get_data(machine.gfx[1], (road << 3) + 6); | |
| 620 | gfx_element_get_data(machine.gfx[1], (road << 3) + 7); | |
| 613 | src_ptr = machine.gfx[1]->get_data((road << 3)); | |
| 614 | machine.gfx[1]->get_data((road << 3) + 1); | |
| 615 | machine.gfx[1]->get_data((road << 3) + 2); | |
| 616 | machine.gfx[1]->get_data((road << 3) + 3); | |
| 617 | machine.gfx[1]->get_data((road << 3) + 4); | |
| 618 | machine.gfx[1]->get_data((road << 3) + 5); | |
| 619 | machine.gfx[1]->get_data((road << 3) + 6); | |
| 620 | machine.gfx[1]->get_data((road << 3) + 7); | |
| 621 | 621 | mdy = ((road * MIDCURB_DY) >> 8) * bitmap.rowpixels(); |
| 622 | 622 | tdy = ((road * TOPCURB_DY) >> 8) * bitmap.rowpixels(); |
| 623 | 623 | |
| r17669 | r17670 | |
| 656 | 656 | |
| 657 | 657 | // blends two 8x8x16bpp direct RGB tilemaps |
| 658 | 658 | static void draw_cloud(bitmap_rgb32 &bitmap, |
| 659 | | |
| 659 | | |
| 660 | 660 | UINT16 *tm_base, |
| 661 | 661 | int x0, int y0, // target coordinate |
| 662 | 662 | int xcount, int ycount, // number of tiles to draw in x and y |
| r17669 | r17670 | |
| 677 | 677 | |
| 678 | 678 | if (alpha > 0x1f) return; |
| 679 | 679 | |
| 680 | tilew = gfx->width; | |
| 681 | tileh = gfx->height; | |
| 680 | tilew = gfx->width(); | |
| 681 | tileh = gfx->height(); | |
| 682 | 682 | |
| 683 | 683 | tmmaskx = (1<<tmw_l2) - 1; |
| 684 | 684 | tmmasky = (1<<tmh_l2) - 1; |
| r17669 | r17670 | |
| 693 | 693 | |
| 694 | 694 | dst_base = &bitmap.pix32(y0+dy, x0+dx); |
| 695 | 695 | |
| 696 | pal_base = gfx->machine().pens + pal_offset * gfx-> | |
| 696 | pal_base = gfx->machine().pens + pal_offset * gfx-> | |
| 697 | 697 | |
| 698 | 698 | alpha <<= 6; |
| 699 | 699 | |
| r17669 | r17670 | |
| 713 | 713 | // Wec Le Mans specific: decodes tile color in EAX |
| 714 | 714 | UINT16 tile_color = ((tiledata >> 5) & 0x78) + (tiledata >> 12); |
| 715 | 715 | |
| 716 | src_ptr = gfx_element_get_data(gfx, tile_index); | |
| 717 | pal_ptr = pal_base + tile_color * gfx->color_granularity; | |
| 716 | src_ptr = gfx->get_data(tile_index); | |
| 717 | pal_ptr = pal_base + tile_color * gfx->granularity(); | |
| 718 | 718 | dst_ptr = dst_base + j * tilew; |
| 719 | 719 | |
| 720 | 720 | /* alpha case */ |
| r17669 | r17670 | |
| 967 | 967 | state->m_txt_tilemap->set_scrolly(0, -BMP_PAD ); |
| 968 | 968 | |
| 969 | 969 | // patches out a mysterious pixel floating in the sky (tile decoding bug?) |
| 970 | * | |
| 970 | * | |
| 971 | 971 | } |
| 972 | 972 | |
| 973 | 973 | // Callbacks for the K051316 |
| r17669 | r17670 | |
|---|---|---|
| 69 | 69 | /* color_prom now points to the beginning of the lookup table */ |
| 70 | 70 | |
| 71 | 71 | /* charset #1 lookup table */ |
| 72 | for (i = 0; i < machine.gfx[0]->total_colors * machine.gfx[0]->color_granularity; i++) | |
| 73 | colortable_entry_set_value(machine.colortable, machine.gfx[0]->color_base + i, *color_prom++ & 0x0f); | |
| 72 | for (i = 0; i < machine.gfx[0]->colors() * machine.gfx[0]->granularity(); i++) | |
| 73 | colortable_entry_set_value(machine.colortable, machine.gfx[0]->colorbase() + i, *color_prom++ & 0x0f); | |
| 74 | 74 | |
| 75 | 75 | color_prom += 128; /* skip the bottom half of the PROM - seems to be not used */ |
| 76 | 76 | |
| 77 | 77 | /* charset #2 lookup table */ |
| 78 | for (i = 0; i < machine.gfx[1]->total_colors * machine.gfx[1]->color_granularity; i++) | |
| 79 | colortable_entry_set_value(machine.colortable, machine.gfx[1]->color_base + i, *color_prom++ & 0x0f); | |
| 78 | for (i = 0; i < machine.gfx[1]->colors() * machine.gfx[1]->granularity(); i++) | |
| 79 | colortable_entry_set_value(machine.colortable, machine.gfx[1]->colorbase() + i, *color_prom++ & 0x0f); | |
| 80 | 80 | |
| 81 | 81 | /* the bottom half of the PROM seems to be not used */ |
| 82 | 82 | } |
| r17669 | r17670 | |
|---|---|---|
| 50 | 50 | static void draw_status( running_machine &machine, bitmap_ind16 &bitmap, const rectangle &cliprect ) |
| 51 | 51 | { |
| 52 | 52 | munchmo_state *state = machine.driver_data<munchmo_state>(); |
| 53 | | |
| 53 | | |
| 54 | 54 | int row; |
| 55 | 55 | |
| 56 | 56 | for (row = 0; row < 4; row++) |
| r17669 | r17670 | |
| 83 | 83 | */ |
| 84 | 84 | munchmo_state *state = machine.driver_data<munchmo_state>(); |
| 85 | 85 | UINT8 *rom = state->memregion("gfx2")->base(); |
| 86 | | |
| 86 | | |
| 87 | 87 | int offs; |
| 88 | 88 | |
| 89 | 89 | for (offs = 0; offs < 0x100; offs++) |
| r17669 | r17670 | |
| 121 | 121 | int flags = state->m_vreg[7]; /* XB?????? */ |
| 122 | 122 | int xadjust = - 128 - 16 - ((flags & 0x80) ? 1 : 0); |
| 123 | 123 | int bank = (flags & 0x40) ? 1 : 0; |
| 124 | | |
| 124 | | |
| 125 | 125 | int color_base = state->m_palette_bank * 4 + 3; |
| 126 | 126 | int i, j; |
| 127 | 127 | int firstsprite = state->m_vreg[4] & 0x3f; |
| r17669 | r17670 | |
|---|---|---|
| 418 | 418 | if (ysize > 0x100 - ty) |
| 419 | 419 | ysize = 0x100 - ty; |
| 420 | 420 | |
| 421 | gfx | |
| 421 | gfx-> | |
| 422 | 422 | |
| 423 | 423 | { |
| 424 | 424 | primask = 0; |
| r17669 | r17670 | |
|---|---|---|
| 60 | 60 | static void draw_sprites( running_machine &machine, bitmap_ind16 &bitmap,const rectangle &cliprect ) |
| 61 | 61 | { |
| 62 | 62 | drgnmst_state *state = machine.driver_data<drgnmst_state>(); |
| 63 | | |
| 63 | | |
| 64 | 64 | UINT16 *source = state->m_spriteram; |
| 65 | 65 | UINT16 *finish = source + 0x800 / 2; |
| 66 | 66 |
| r17669 | r17670 | |
|---|---|---|
| 768 | 768 | |
| 769 | 769 | static void |
| 770 | 770 | poly3d_DrawSprite( |
| 771 | bitmap_rgb32 &dest_bmp, | |
| 771 | bitmap_rgb32 &dest_bmp, | |
| 772 | 772 | UINT32 color, int flipx, int flipy, int sx, int sy, |
| 773 | 773 | int scalex, int scaley, int cz_factor, int prioverchar, int alpha ) |
| 774 | 774 | { |
| 775 | 775 | namcos22_state *state = gfx->machine().driver_data<namcos22_state>(); |
| 776 | int sprite_screen_height = (scaley*gfx->height+0x8000)>>16; | |
| 777 | int sprite_screen_width = (scalex*gfx->width+0x8000)>>16; | |
| 776 | int sprite_screen_height = (scaley*gfx->height()+0x8000)>>16; | |
| 777 | int sprite_screen_width = (scalex*gfx->width()+0x8000)>>16; | |
| 778 | 778 | if (sprite_screen_width && sprite_screen_height) |
| 779 | 779 | { |
| 780 | 780 | float fsx = sx; |
| 781 | 781 | float fsy = sy; |
| 782 | float fwidth = gfx->width; | |
| 783 | float fheight = gfx->height; | |
| 782 | float fwidth = gfx->width(); | |
| 783 | float fheight = gfx->height(); | |
| 784 | 784 | float fsw = sprite_screen_width; |
| 785 | 785 | float fsh = sprite_screen_height; |
| 786 | 786 | poly_extra_data *extra = (poly_extra_data *)poly_get_extra_data(state->m_poly); |
| r17669 | r17670 | |
| 793 | 793 | extra->machine = &gfx->machine(); |
| 794 | 794 | extra->alpha = alpha; |
| 795 | 795 | extra->prioverchar = 2 | prioverchar; |
| 796 | extra->line_modulo = gfx-> | |
| 796 | extra->line_modulo = gfx->r | |
| 797 | 797 | extra->flipx = flipx; |
| 798 | 798 | extra->flipy = flipy; |
| 799 | extra->pens = &gfx->machine().pens[gfx->color | |
| 799 | extra->pens = &gfx->machine().pens[gfx->color | |
| 800 | 800 | extra->priority_bitmap = &gfx->machine().priority_bitmap; |
| 801 | extra->source = gfx | |
| 801 | extra->source = gfx-> | |
| 802 | 802 | |
| 803 | 803 | vert[0].x = fsx; |
| 804 | 804 | vert[0].y = fsy; |
| r17669 | r17670 | |
| 1466 | 1466 | } /* namcos22_draw_direct_poly */ |
| 1467 | 1467 | |
| 1468 | 1468 | static void |
| 1469 | Prepare3dTexture( running_machine &machine, void *pTilemapROM, void *pTextureROM ) | |
| 1469 | Prepare3dTexture( running_machine &machine, void *pTilemapROM, const void *pTextureROM ) | |
| 1470 | 1470 | { |
| 1471 | 1471 | namcos22_state *state = machine.driver_data<namcos22_state>(); |
| 1472 | 1472 | int i; |
| r17669 | r17670 | |
| 2699 | 2699 | WRITE32_MEMBER(namcos22_state::namcos22_cgram_w) |
| 2700 | 2700 | { |
| 2701 | 2701 | COMBINE_DATA( &m_cgram[offset] ); |
| 2702 | | |
| 2702 | | |
| 2703 | 2703 | } |
| 2704 | 2704 | |
| 2705 | 2705 | READ32_MEMBER(namcos22_state::namcos22_paletteram_r) |
| r17669 | r17670 | |
| 2737 | 2737 | state->m_mbDSPisActive = 0; |
| 2738 | 2738 | memset( state->m_polygonram, 0xcc, 0x20000 ); |
| 2739 | 2739 | |
| 2740 | for (code = 0; code < machine.gfx[GFX_TEXTURE_TILE]->total_elements; code++) | |
| 2741 | gfx_element_decode(machine.gfx[GFX_TEXTURE_TILE], code); | |
| 2740 | for (code = 0; code < machine.gfx[GFX_TEXTURE_TILE]->elements(); code++) | |
| 2741 | machine.gfx[GFX_TEXTURE_TILE]->decode(code); | |
| 2742 | 2742 | |
| 2743 | Prepare3dTexture(machine, state->memregion("textilemap")->base(), machine.gfx[GFX_TEXTURE_TILE]->g | |
| 2743 | Prepare3dTexture(machine, state->memregion("textilemap")->base(), machine.gfx[GFX_TEXTURE_TILE]->get_data(0) ); | |
| 2744 | 2744 | state->m_dirtypal = auto_alloc_array(machine, UINT8, NAMCOS22_PALETTE_SIZE/4); |
| 2745 | 2745 | state->m_mPtRomSize = state->memregion("pointrom")->bytes()/3; |
| 2746 | 2746 | state->m_mpPolyL = state->memregion("pointrom")->base(); |
| r17669 | r17670 | |
| 2751 | 2751 | machine.add_notifier(MACHINE_NOTIFY_RESET, machine_notify_delegate(FUNC(namcos22_reset), &machine)); |
| 2752 | 2752 | machine.add_notifier(MACHINE_NOTIFY_EXIT, machine_notify_delegate(FUNC(namcos22_exit), &machine)); |
| 2753 | 2753 | |
| 2754 | | |
| 2754 | | |
| 2755 | 2755 | } |
| 2756 | 2756 | |
| 2757 | 2757 | VIDEO_START( namcos22 ) |
| r17669 | r17670 | |
|---|---|---|
| 483 | 483 | |
| 484 | 484 | state->m_bg_tilemap->set_scroll_cols(32); |
| 485 | 485 | |
| 486 | state->m_color_mask = (machine.gfx[0]-> | |
| 486 | state->m_color_mask = (machine.gfx[0]-> | |
| 487 | 487 | } |
| 488 | 488 | |
| 489 | 489 | VIDEO_START( galaxold ) |
| r17669 | r17670 | |
|---|---|---|
| 352 | 352 | UINT8 small_sprite, col, flipx, flipy; |
| 353 | 353 | UINT16 code, bigsprite, map_index; |
| 354 | 354 | // UINT16 rotate = 0; |
| 355 | UINT16 tile_mask = (machine.gfx[0]-> | |
| 355 | UINT16 tile_mask = (machine.gfx[0]-> | |
| 356 | 356 | static const int primasks[2] = {0x0, 0xfffc}; /* fff0 => under rhs of road only */ |
| 357 | 357 | |
| 358 | 358 | for (offs = 0x1ff; offs >= 0; offs--) |
| r17669 | r17670 | |
|---|---|---|
| 664 | 664 | switch (bpp) |
| 665 | 665 | { |
| 666 | 666 | case 4: |
| 667 | machine.gfx[gfx_index] = gfx_element | |
| 667 | machine.gfx[gfx_index] = auto_alloc(machine, gfx_element | |
| 668 | 668 | break; |
| 669 | 669 | |
| 670 | 670 | case 5: |
| 671 | machine.gfx[gfx_index] = gfx_element | |
| 671 | machine.gfx[gfx_index] = auto_alloc(machine, gfx_element | |
| 672 | 672 | break; |
| 673 | 673 | |
| 674 | 674 | case 6: |
| 675 | machine.gfx[gfx_index] = gfx_element | |
| 675 | machine.gfx[gfx_index] = auto_alloc(machine, gfx_element | |
| 676 | 676 | break; |
| 677 | 677 | |
| 678 | 678 | default: |
| r17669 | r17670 | |
| 680 | 680 | } |
| 681 | 681 | |
| 682 | 682 | /* set the color information */ |
| 683 | machine.gfx[gfx_index]-> | |
| 683 | machine.gfx[gfx_index]->set | |
| 684 | 684 | state->m_bank_color_shift[gfx_index] = bpp - 3; |
| 685 | 685 | |
| 686 | 686 | /* set the entry and return it */ |
| r17669 | r17670 | |
|---|---|---|
| 141 | 141 | #endif |
| 142 | 142 | |
| 143 | 143 | |
| 144 | static void ssv_drawgfx( bitmap_ind16 &bitmap, const rectangle &cliprect, | |
| 144 | static void ssv_drawgfx( bitmap_ind16 &bitmap, const rectangle &cliprect, | |
| 145 | 145 | UINT32 code,UINT32 color,int flipx,int flipy,int x0,int y0, |
| 146 | 146 | int shadow ) |
| 147 | 147 | { |
| r17669 | r17670 | |
| 152 | 152 | int sx, x1, dx; |
| 153 | 153 | int sy, y1, dy; |
| 154 | 154 | |
| 155 | addr = gfx_element_get_data(gfx, code % gfx->total_elements); | |
| 156 | color = gfx->color_granularity * (color % gfx->total_colors); | |
| 155 | addr = gfx->get_data(code % gfx->elements()); | |
| 156 | color = gfx->granularity() * (color % gfx->colors()); | |
| 157 | 157 | |
| 158 | if ( flipx ) { x1 = x0-1; x0 += gfx->width-1; dx = -1; } | |
| 159 | else { x1 = x0 + gfx->width; dx = 1; } | |
| 158 | if ( flipx ) { x1 = x0-1; x0 += gfx->width()-1; dx = -1; } | |
| 159 | else { x1 = x0 + gfx->width(); dx = 1; } | |
| 160 | 160 | |
| 161 | if ( flipy ) { y1 = y0-1; y0 += gfx->height-1; dy = -1; } | |
| 162 | else { y1 = y0 + gfx->height; dy = 1; } | |
| 161 | if ( flipy ) { y1 = y0-1; y0 += gfx->height()-1; dy = -1; } | |
| 162 | else { y1 = y0 + gfx->height(); dy = 1; } | |
| 163 | 163 | |
| 164 | 164 | #define SSV_DRAWGFX(SETPIXELCOLOR) \ |
| 165 | 165 | for ( sy = y0; sy != y1; sy += dy ) \ |
| r17669 | r17670 | |
| 178 | 178 | } \ |
| 179 | 179 | } \ |
| 180 | 180 | \ |
| 181 | addr += gfx-> | |
| 181 | addr += gfx->r | |
| 182 | 182 | } |
| 183 | 183 | |
| 184 | 184 | if (shadow) |
| r17669 | r17670 | |
| 194 | 194 | |
| 195 | 195 | VIDEO_START( ssv ) |
| 196 | 196 | { |
| 197 | machine.gfx[0]-> | |
| 197 | machine.gfx[0]->set | |
| 198 | 198 | } |
| 199 | 199 | |
| 200 | 200 | VIDEO_START( eaglshot ) |
| r17669 | r17670 | |
| 204 | 204 | |
| 205 | 205 | state->m_eaglshot_gfxram = auto_alloc_array(machine, UINT16, 16 * 0x40000 / 2); |
| 206 | 206 | |
| 207 | gfx_element_set_source(machine.gfx[0], (UINT8 *)state->m_eaglshot_gfxram); | |
| 208 | gfx_element_set_source(machine.gfx[1], (UINT8 *)state->m_eaglshot_gfxram); | |
| 207 | machine.gfx[0]->set_source((UINT8 *)state->m_eaglshot_gfxram); | |
| 208 | machine.gfx[1]->set_source((UINT8 *)state->m_eaglshot_gfxram); | |
| 209 | 209 | } |
| 210 | 210 | |
| 211 | 211 | static TILE_GET_INFO( get_tile_info_0 ) |
| r17669 | r17670 | |
|---|---|---|
| 261 | 261 | auto_free(machine, buffer); |
| 262 | 262 | |
| 263 | 263 | /* decode the graphics */ |
| 264 | machine.gfx[gfx_index] = gfx_element | |
| 264 | machine.gfx[gfx_index] = auto_alloc(machine, gfx_element | |
| 265 | 265 | } |
| 266 | 266 | |
| 267 | 267 | static void decode_sprite(running_machine &machine, int gfx_index, const gfx_layout *layout, const void *data) |
| 268 | 268 | { |
| 269 | 269 | /* decode the graphics */ |
| 270 | machine.gfx[gfx_index] = gfx_element | |
| 270 | machine.gfx[gfx_index] = auto_alloc(machine, gfx_element | |
| 271 | 271 | } |
| 272 | 272 | |
| 273 | 273 | // fix sprite order |
| r17669 | r17670 | |
|---|---|---|
| 163 | 163 | } |
| 164 | 164 | else if (((tile & 0x00f00000) == 0x00f00000) && (state->m_support_8bpp)) /* draw tile as 8bpp */ |
| 165 | 165 | { |
| 166 | | |
| 166 | | |
| 167 | 167 | UINT32 tile2 = big ? ((tile & 0xfffff) + 8*(code & 0xf)) : |
| 168 | 168 | ((tile & 0xfffff) + 2*(code & 0xf)); |
| 169 | 169 | const UINT8* data; |
| 170 | 170 | UINT8 flipxy = (code & 0x6000) >> 13; |
| 171 | 171 | |
| 172 | if (tile2 < gfx1->total_elements) | |
| 173 | data = gfx_element_get_data(gfx1, tile2); | |
| 172 | if (tile2 < gfx1->elements()) | |
| 173 | data = gfx1->get_data(tile2); | |
| 174 | 174 | else |
| 175 | 175 | { |
| 176 | 176 | *pix |= 0; |
| r17669 | r17670 | |
| 196 | 196 | } |
| 197 | 197 | else |
| 198 | 198 | { |
| 199 | | |
| 199 | | |
| 200 | 200 | UINT32 tile2 = big ? ((tile & 0xfffff) + 4*(code & 0xf)) : |
| 201 | 201 | ((tile & 0xfffff) + (code & 0xf)); |
| 202 | 202 | const UINT8* data; |
| 203 | 203 | UINT8 flipxy = (code & 0x6000) >> 13; |
| 204 | 204 | |
| 205 | if (tile2 < gfx1->total_elements) | |
| 206 | data = gfx_element_get_data(gfx1, tile2); | |
| 205 | if (tile2 < gfx1->elements()) | |
| 206 | data = gfx1->get_data(tile2); | |
| 207 | 207 | else |
| 208 | 208 | { |
| 209 | 209 | *pix |= 0; |
| r17669 | r17670 | |
| 468 | 468 | |
| 469 | 469 | for (i = 0; i < 0x20; i++) |
| 470 | 470 | { |
| 471 | gfx_element gfx(machine); | |
| 472 | ||
| 473 | 471 | if (!(state->m_videoregs[0x02/2] & 0x8000)) |
| 474 | 472 | { |
| 475 | 473 | src = state->m_spriteram + (sprites - 1) * (8 / 2); |
| r17669 | r17670 | |
| 541 | 539 | if ((gfxstart + width * height - 1) >= gfx_size) |
| 542 | 540 | continue; |
| 543 | 541 | |
| 544 | gfx_element | |
| 542 | gfx_element | |
| 545 | 543 | |
| 546 | 544 | pdrawgfxzoom_transpen( bitmap,cliprect, &gfx, |
| 547 | 545 | 0, |
| r17669 | r17670 | |
| 557 | 555 | if ((gfxstart + width / 2 * height - 1) >= gfx_size) |
| 558 | 556 | continue; |
| 559 | 557 | |
| 560 | gfx_element | |
| 558 | gfx_element | |
| 561 | 559 | |
| 562 | 560 | pdrawgfxzoom_transpen( bitmap,cliprect, &gfx, |
| 563 | 561 | 0, |
| r17669 | r17670 | |
|---|---|---|
| 136 | 136 | angelkds_state *state = machine.driver_data<angelkds_state>(); |
| 137 | 137 | const UINT8 *source = state->m_spriteram + 0x100 - 4; |
| 138 | 138 | const UINT8 *finish = state->m_spriteram; |
| 139 | | |
| 139 | | |
| 140 | 140 | |
| 141 | 141 | while (source >= finish) |
| 142 | 142 | { |
| r17669 | r17670 | |
|---|---|---|
| 46 | 46 | { |
| 47 | 47 | usgames_state *state = machine.driver_data<usgames_state>(); |
| 48 | 48 | state->m_tilemap = tilemap_create(machine, get_usgames_tile_info,TILEMAP_SCAN_ROWS, 8, 8,64,32); |
| 49 | | |
| 49 | | |
| 50 | 50 | } |
| 51 | 51 | |
| 52 | 52 | |
| r17669 | r17670 | |
| 59 | 59 | WRITE8_MEMBER(usgames_state::usgames_charram_w) |
| 60 | 60 | { |
| 61 | 61 | m_charram[offset] = data; |
| 62 | | |
| 62 | | |
| 63 | 63 | } |
| 64 | 64 | |
| 65 | 65 |
| r17669 | r17670 | |
|---|---|---|
| 124 | 124 | */ |
| 125 | 125 | |
| 126 | 126 | shadfrce_state *state = machine.driver_data<shadfrce_state>(); |
| 127 | | |
| 127 | | |
| 128 | 128 | UINT16 *finish = state->m_spvideoram_old; |
| 129 | 129 | UINT16 *source = finish + 0x2000/2 - 8; |
| 130 | 130 | int hcount; |
| r17669 | r17670 | |
|---|---|---|
| 347 | 347 | static void draw_sprites(running_machine& machine, bitmap_ind16 &bitmap) |
| 348 | 348 | { |
| 349 | 349 | ninjakd2_state *state = machine.driver_data<ninjakd2_state>(); |
| 350 | | |
| 350 | | |
| 351 | 351 | int const big_xshift = state->m_robokid_sprites ? 1 : 0; |
| 352 | 352 | int const big_yshift = state->m_robokid_sprites ? 0 : 1; |
| 353 | 353 |
| r17669 | r17670 | |
|---|---|---|
| 342 | 342 | rect.max_y = ypos + 2 * BGHEIGHT - 1; |
| 343 | 343 | } |
| 344 | 344 | |
| 345 | bitmap.fill(machine.gfx[image]->color | |
| 345 | bitmap.fill(machine.gfx[image]->color | |
| 346 | 346 | } |
| 347 | 347 | |
| 348 | 348 |
| r17669 | r17670 | |
|---|---|---|
| 108 | 108 | { |
| 109 | 109 | gng_state *state = machine.driver_data<gng_state>(); |
| 110 | 110 | UINT8 *buffered_spriteram = state->m_spriteram->buffer(); |
| 111 | | |
| 111 | | |
| 112 | 112 | int offs; |
| 113 | 113 | |
| 114 | 114 |
| r17669 | r17670 | |
|---|---|---|
| 85 | 85 | } |
| 86 | 86 | |
| 87 | 87 | template<class _BitmapClass> |
| 88 | void jal_blend_drawgfx_common(_BitmapClass &dest_bmp,const rectangle &clip, | |
| 88 | void jal_blend_drawgfx_common(_BitmapClass &dest_bmp,const rectangle &clip, | |
| 89 | 89 | UINT32 code,UINT32 color,int flipx,int flipy,int offsx,int offsy, |
| 90 | 90 | int transparent_color) |
| 91 | 91 | { |
| r17669 | r17670 | |
| 98 | 98 | /* Start drawing */ |
| 99 | 99 | if (gfx) |
| 100 | 100 | { |
| 101 | const pen_t *pal = &gfx->machine().pens[gfx->color_base + gfx->color_granularity * (color % gfx->total_colors)]; | |
| 102 | const UINT8 *alpha = &jal_blend_table[gfx->color_granularity * (color % gfx->total_colors)]; | |
| 103 | const UINT8 *source_base = gfx_element_get_data(gfx, code % gfx->total_elements); | |
| 101 | const pen_t *pal = &gfx->machine().pens[gfx->colorbase() + gfx->granularity() * (color % gfx->colors())]; | |
| 102 | const UINT8 *alpha = &jal_blend_table[gfx->granularity() * (color % gfx->colors())]; | |
| 103 | const UINT8 *source_base = gfx->get_data(code % gfx->elements()); | |
| 104 | 104 | int x_index_base, y_index, sx, sy, ex, ey; |
| 105 | 105 | int xinc, yinc; |
| 106 | 106 | |
| 107 | 107 | xinc = flipx ? -1 : 1; |
| 108 | 108 | yinc = flipy ? -1 : 1; |
| 109 | 109 | |
| 110 | x_index_base = flipx ? gfx->width-1 : 0; | |
| 111 | y_index = flipy ? gfx->height-1 : 0; | |
| 110 | x_index_base = flipx ? gfx->width()-1 : 0; | |
| 111 | y_index = flipy ? gfx->height()-1 : 0; | |
| 112 | 112 | |
| 113 | 113 | /* start coordinates */ |
| 114 | 114 | sx = offsx; |
| 115 | 115 | sy = offsy; |
| 116 | 116 | |
| 117 | 117 | /* end coordinates */ |
| 118 | ex = sx + gfx->width; | |
| 119 | ey = sy + gfx->height; | |
| 118 | ex = sx + gfx->width(); | |
| 119 | ey = sy + gfx->height(); | |
| 120 | 120 | |
| 121 | 121 | if (sx < clip.min_x) |
| 122 | 122 | { /* clip left */ |
| r17669 | r17670 | |
| 147 | 147 | /* taken from case 7: TRANSPARENCY_ALPHARANGE */ |
| 148 | 148 | for (y = sy; y < ey; y++) |
| 149 | 149 | { |
| 150 | const UINT8 *source = source_base + y_index*gfx-> | |
| 150 | const UINT8 *source = source_base + y_index*gfx->r | |
| 151 | 151 | typename _BitmapClass::pixel_t *dest = &dest_bmp.pix(y); |
| 152 | 152 | int x_index = x_index_base; |
| 153 | 153 | for (x = sx; x < ex; x++) |
| r17669 | r17670 | |
| 174 | 174 | } |
| 175 | 175 | } |
| 176 | 176 | |
| 177 | void jal_blend_drawgfx(bitmap_ind16 &dest_bmp,const rectangle &clip, | |
| 177 | void jal_blend_drawgfx(bitmap_ind16 &dest_bmp,const rectangle &clip, | |
| 178 | 178 | UINT32 code,UINT32 color,int flipx,int flipy,int offsx,int offsy, |
| 179 | 179 | int transparent_color) |
| 180 | 180 | { jal_blend_drawgfx_common(dest_bmp, clip, gfx, code, color, flipx, flipy, offsx, offsy, transparent_color); } |
| 181 | void jal_blend_drawgfx(bitmap_rgb32 &dest_bmp,const rectangle &clip, | |
| 181 | void jal_blend_drawgfx(bitmap_rgb32 &dest_bmp,const rectangle &clip, | |
| 182 | 182 | UINT32 code,UINT32 color,int flipx,int flipy,int offsx,int offsy, |
| 183 | 183 | int transparent_color) |
| 184 | 184 | { jal_blend_drawgfx_common(dest_bmp, clip, gfx, code, color, flipx, flipy, offsx, offsy, transparent_color); } |
| r17669 | r17670 | |
|---|---|---|
| 2 | 2 | void jal_blend_set(int color, UINT8 val); |
| 3 | 3 | |
| 4 | 4 | rgb_t jal_blend_func(rgb_t dest, rgb_t addMe, UINT8 alpha); |
| 5 | void jal_blend_drawgfx(bitmap_ind16 &dest_bmp,const rectangle &clip, | |
| 5 | void jal_blend_drawgfx(bitmap_ind16 &dest_bmp,const rectangle &clip, | |
| 6 | 6 | UINT32 code,UINT32 color,int flipx,int flipy,int offsx,int offsy, |
| 7 | 7 | int transparent_color); |
| 8 | void jal_blend_drawgfx(bitmap_rgb32 &dest_bmp,const rectangle &clip, | |
| 8 | void jal_blend_drawgfx(bitmap_rgb32 &dest_bmp,const rectangle &clip, | |
| 9 | 9 | UINT32 code,UINT32 color,int flipx,int flipy,int offsx,int offsy, |
| 10 | 10 | int transparent_color); |
| r17669 | r17670 | |
|---|---|---|
| 183 | 183 | kncljoe_state *state = machine.driver_data<kncljoe_state>(); |
| 184 | 184 | UINT8 *spriteram = state->m_spriteram; |
| 185 | 185 | rectangle clip = cliprect; |
| 186 | | |
| 186 | | |
| 187 | 187 | int i, j; |
| 188 | 188 | static const int pribase[4]={0x0180, 0x0080, 0x0100, 0x0000}; |
| 189 | 189 | const rectangle &visarea = machine.primary_screen->visible_area(); |
| r17669 | r17670 | |
|---|---|---|
| 152 | 152 | { |
| 153 | 153 | spdodgeb_state *state = machine.driver_data<spdodgeb_state>(); |
| 154 | 154 | UINT8 *spriteram = state->m_spriteram; |
| 155 | | |
| 155 | | |
| 156 | 156 | UINT8 *src; |
| 157 | 157 | int i; |
| 158 | 158 |
| r17669 | r17670 | |
|---|---|---|
| 678 | 678 | |
| 679 | 679 | PALETTE_INIT( setaroul ) |
| 680 | 680 | { |
| 681 | machine.gfx[0]->color_granularity=16; | |
| 682 | machine.gfx[1]->color_granularity=16; | |
| 681 | machine.gfx[0]->set_granularity(16); | |
| 682 | machine.gfx[1]->set_granularity(16); | |
| 683 | 683 | |
| 684 | 684 | PALETTE_INIT_CALL(inttoote); |
| 685 | 685 | } |
| r17669 | r17670 | |
| 773 | 773 | static void draw_tilemap_palette_effect(running_machine &machine, bitmap_ind16 &bitmap, const rectangle &cliprect, tilemap_t *tilemap, int scrollx, int scrolly, int gfxnum, int flipscreen) |
| 774 | 774 | { |
| 775 | 775 | int y; |
| 776 | | |
| 776 | | |
| 777 | 777 | const bitmap_ind16 &src_bitmap = tilemap->pixmap(); |
| 778 | 778 | int width_mask, height_mask; |
| 779 | int opaque_mask = gfx_tilemap->color_granularity - 1; | |
| 780 | int pixel_effect_mask = gfx_tilemap->color_base + (gfx_tilemap->total_colors - 1) * gfx_tilemap->color_granularity; | |
| 779 | int opaque_mask = gfx_tilemap->granularity() - 1; | |
| 780 | int pixel_effect_mask = gfx_tilemap->colorbase() + (gfx_tilemap->colors() - 1) * gfx_tilemap->granularity(); | |
| 781 | 781 | int p; |
| 782 | 782 | |
| 783 | 783 | width_mask = src_bitmap.width() - 1; |
| r17669 | r17670 | |
|---|---|---|
| 114 | 114 | static void draw_sprites(running_machine &machine, bitmap_ind16 &bitmap, const rectangle &cliprect) |
| 115 | 115 | { |
| 116 | 116 | vball_state *state = machine.driver_data<vball_state>(); |
| 117 | | |
| 117 | | |
| 118 | 118 | UINT8 *src = state->m_spriteram; |
| 119 | 119 | int i; |
| 120 | 120 |
| r17669 | r17670 | |
|---|---|---|
| 102 | 102 | assert(state->m_ttl_gfx_index != MAX_GFX_ELEMENTS); |
| 103 | 103 | |
| 104 | 104 | /* decode the ttl layer's gfx */ |
| 105 | machine.gfx[state->m_ttl_gfx_index] = gfx_element | |
| 105 | machine.gfx[state->m_ttl_gfx_index] = auto_alloc(machine, gfx_element | |
| 106 | 106 | |
| 107 | 107 | /* create the tilemap */ |
| 108 | 108 | state->m_ttl_tilemap = tilemap_create(machine, ttl_get_tile_info, plygonet_scan, 8, 8, 64, 32); |
| r17669 | r17670 | |
|---|---|---|
| 267 | 267 | { |
| 268 | 268 | int w = sprite_data[i].width; |
| 269 | 269 | int h = sprite_data[i].height; |
| 270 | | |
| 270 | | |
| 271 | 271 | } |
| 272 | 272 | } |
| 273 | 273 | } |
| r17669 | r17670 | |
| 284 | 284 | { |
| 285 | 285 | int w = sprite_data[i].width; |
| 286 | 286 | int h = sprite_data[i].height; |
| 287 | | |
| 287 | | |
| 288 | 288 | } |
| 289 | 289 | } |
| 290 | 290 | state->m_background->mark_all_dirty(); |
| r17669 | r17670 | |
| 310 | 310 | memset(state->m_charram, 0, state->m_charram.bytes()); |
| 311 | 311 | memset(state->m_blank_tile, 0, ARRAY_LENGTH(state->m_blank_tile)); |
| 312 | 312 | |
| 313 | gfx_element_set_source(machine.gfx[0], (UINT8 *)state->m_charram.target()); | |
| 314 | gfx_element_set_source(machine.gfx[1], (UINT8 *)state->m_charram.target()); | |
| 315 | gfx_element_set_source(machine.gfx[2], (UINT8 *)state->m_charram.target()); | |
| 316 | gfx_element_set_source(machine.gfx[3], (UINT8 *)state->m_charram.target()); | |
| 317 | gfx_element_set_source(machine.gfx[4], (UINT8 *)state->m_charram.target()); | |
| 318 | gfx_element_set_source(machine.gfx[5], (UINT8 *)state->m_charram.target()); | |
| 319 | gfx_element_set_source(machine.gfx[6], (UINT8 *)state->m_charram.target()); | |
| 320 | gfx_element_set_source(machine.gfx[7], (UINT8 *)state->m_charram.target()); | |
| 313 | machine.gfx[0]->set_source((UINT8 *)state->m_charram.target()); | |
| 314 | machine.gfx[1]->set_source((UINT8 *)state->m_charram.target()); | |
| 315 | machine.gfx[2]->set_source((UINT8 *)state->m_charram.target()); | |
| 316 | machine.gfx[3]->set_source((UINT8 *)state->m_charram.target()); | |
| 317 | machine.gfx[4]->set_source((UINT8 *)state->m_charram.target()); | |
| 318 | machine.gfx[5]->set_source((UINT8 *)state->m_charram.target()); | |
| 319 | machine.gfx[6]->set_source((UINT8 *)state->m_charram.target()); | |
| 320 | machine.gfx[7]->set_source((UINT8 *)state->m_charram.target()); | |
| 321 | 321 | |
| 322 | 322 | /* Set up save state */ |
| 323 | 323 | machine.save().register_postload(save_prepost_delegate(FUNC(nemesis_postload), &machine)); |
| r17669 | r17670 | |
|---|---|---|
| 107 | 107 | } |
| 108 | 108 | |
| 109 | 109 | |
| 110 | static void draw_sprites( running_machine &machine, bitmap_ind16 &bitmap, const rectangle &cliprect, | |
| 110 | static void draw_sprites( running_machine &machine, bitmap_ind16 &bitmap, const rectangle &cliprect, | |
| 111 | 111 | { |
| 112 | 112 | cheekyms_state *state = machine.driver_data<cheekyms_state>(); |
| 113 | 113 | offs_t offs; |
| r17669 | r17670 | |
|---|---|---|
| 31 | 31 | state->m_current_scanline=0; |
| 32 | 32 | state->m_irq_enable=state->m_rcr_enable=state->m_sb_enable=state->m_bb_enable=0; |
| 33 | 33 | |
| 34 | gfx_element_set_source(machine.gfx[0], state->m_HuC6270_vram); | |
| 35 | gfx_element_set_source(machine.gfx[1], state->m_HuC6270_vram); | |
| 36 | gfx_element_set_source(machine.gfx[2], state->m_blank_tile); | |
| 34 | machine.gfx[0]->set_source(state->m_HuC6270_vram); | |
| 35 | machine.gfx[1]->set_source(state->m_HuC6270_vram); | |
| 36 | machine.gfx[2]->set_source(state->m_blank_tile); | |
| 37 | 37 | } |
| 38 | 38 | |
| 39 | 39 | /******************************************************************************/ |
| r17669 | r17670 | |
| 125 | 125 | case 2: /* VRAM */ |
| 126 | 126 | if (m_HuC6270_vram[(m_HuC6270_registers[0]<<1)|1]!=data) { |
| 127 | 127 | m_HuC6270_vram[(m_HuC6270_registers[0]<<1)|1]=data; |
| 128 | gfx_element_mark_dirty(machine().gfx[0], m_HuC6270_registers[0]>>4); | |
| 129 | gfx_element_mark_dirty(machine().gfx[1], m_HuC6270_registers[0]>>6); | |
| 128 | machine().gfx[0]->mark_dirty(m_HuC6270_registers[0]>>4); | |
| 129 | machine().gfx[1]->mark_dirty(m_HuC6270_registers[0]>>6); | |
| 130 | 130 | } |
| 131 | 131 | if (m_HuC6270_registers[0]<0x1000) m_vram_dirty[m_HuC6270_registers[0]]=1; |
| 132 | 132 | return; |
| r17669 | r17670 | |
| 185 | 185 | case 2: /* VWR - VRAM */ |
| 186 | 186 | if (m_HuC6270_vram[(m_HuC6270_registers[0]<<1)|0]!=data) { |
| 187 | 187 | m_HuC6270_vram[(m_HuC6270_registers[0]<<1)|0]=data; |
| 188 | gfx_element_mark_dirty(machine().gfx[0], m_HuC6270_registers[0]>>4); | |
| 189 | gfx_element_mark_dirty(machine().gfx[1], m_HuC6270_registers[0]>>6); | |
| 188 | machine().gfx[0]->mark_dirty(m_HuC6270_registers[0]>>4); | |
| 189 | machine().gfx[1]->mark_dirty(m_HuC6270_registers[0]>>6); | |
| 190 | 190 | if (m_HuC6270_registers[0]<0x1000) m_vram_dirty[m_HuC6270_registers[0]]=1; |
| 191 | 191 | } |
| 192 | 192 | m_HuC6270_registers[0]+=m_inc_value; |
| r17669 | r17670 | |
| 306 | 306 | int offs,code,scrollx,scrolly,mx,my; |
| 307 | 307 | |
| 308 | 308 | /* if any tiles changed, redraw the VRAM */ |
| 309 | if (screen.machine().gfx[0]->dirtyseq != state->m_tile_dirtyseq) | |
| 309 | if (screen.machine().gfx[0]->dirtyseq() != state->m_tile_dirtyseq) | |
| 310 | 310 | { |
| 311 | state->m_tile_dirtyseq = screen.machine().gfx[0]->dirtyseq; | |
| 311 | state->m_tile_dirtyseq = screen.machine().gfx[0]->dirtyseq(); | |
| 312 | 312 | memset(state->m_vram_dirty, 1, 0x1000); |
| 313 | 313 | } |
| 314 | 314 |
| r17669 | r17670 | |
|---|---|---|
| 29 | 29 | static void draw_sprites(running_machine &machine, bitmap_ind16 &bitmap, const rectangle &cliprect ) |
| 30 | 30 | { |
| 31 | 31 | flower_state *state = machine.driver_data<flower_state>(); |
| 32 | | |
| 32 | | |
| 33 | 33 | UINT8 *source = state->m_spriteram + 0x200; |
| 34 | 34 | UINT8 *finish = source - 0x200; |
| 35 | 35 |
| r17669 | r17670 | |
|---|---|---|
| 344 | 344 | |
| 345 | 345 | sy++; /* sprites are buffered and delayed by one scanline */ |
| 346 | 346 | |
| 347 | gfx | |
| 347 | gfx-> | |
| 348 | 348 | if (color != 0x7f) |
| 349 | 349 | pdrawgfx_transpen( bitmap, cliprect, gfx, |
| 350 | 350 | sprite, |
| r17669 | r17670 | |
|---|---|---|
| 67 | 67 | { |
| 68 | 68 | othunder_state *state = machine.driver_data<othunder_state>(); |
| 69 | 69 | UINT16 *spritemap = (UINT16 *)state->memregion("user1")->base(); |
| 70 | UINT16 tile_mask = (machine.gfx[0]-> | |
| 70 | UINT16 tile_mask = (machine.gfx[0]-> | |
| 71 | 71 | UINT16 *spriteram16 = state->m_spriteram; |
| 72 | 72 | int offs, data, tilenum, color, flipx, flipy; |
| 73 | 73 | int x, y, priority, curx, cury; |
| r17669 | r17670 | |
|---|---|---|
| 50 | 50 | |
| 51 | 51 | for (i = 0; i < 0x20000; i += 64) |
| 52 | 52 | { |
| 53 | | |
| 53 | | |
| 54 | 54 | } |
| 55 | 55 | } |
| 56 | 56 | |
| r17669 | r17670 | |
| 94 | 94 | |
| 95 | 95 | COMBINE_DATA(&m_zoomdata[offset]); |
| 96 | 96 | if (oldword != m_zoomdata[offset]) |
| 97 | | |
| 97 | | |
| 98 | 98 | } |
| 99 | 99 | |
| 100 | 100 | WRITE16_MEMBER(tail2nos_state::tail2nos_gfxbank_w) |
| r17669 | r17670 | |
|---|---|---|
| 333 | 333 | { |
| 334 | 334 | sprite_ptr->code = code; |
| 335 | 335 | sprite_ptr->color = color; |
| 336 | if (machine.gfx[0]-> | |
| 336 | if (machine.gfx[0]-> | |
| 337 | 337 | sprite_ptr->color /= 4; |
| 338 | 338 | sprite_ptr->flipx = flipx; |
| 339 | 339 | sprite_ptr->flipy = flipy; |
| r17669 | r17670 | |
|---|---|---|
| 103 | 103 | /* color_prom now points to the beginning of the lookup table */ |
| 104 | 104 | |
| 105 | 105 | for (i = 0;i < 0x400;i++) |
| 106 | colortable_entry_set_value(machine.colortable, machine.gfx[0]->color | |
| 106 | colortable_entry_set_value(machine.colortable, machine.gfx[0]->color | |
| 107 | 107 | |
| 108 | 108 | /* Background */ |
| 109 | 109 | for (i = 0;i < 0x400;i++) |
| 110 | colortable_entry_set_value(machine.colortable, machine.gfx[1]->color | |
| 110 | colortable_entry_set_value(machine.colortable, machine.gfx[1]->color | |
| 111 | 111 | |
| 112 | 112 | /* Sprites */ |
| 113 | 113 | for (i = 0;i < 0x400;i++) |
| 114 | colortable_entry_set_value(machine.colortable, machine.gfx[2]->color | |
| 114 | colortable_entry_set_value(machine.colortable, machine.gfx[2]->color | |
| 115 | 115 | |
| 116 | 116 | state->m_palette_bank = 0; |
| 117 | 117 | switch_palette(machine); |
| r17669 | r17670 | |
| 207 | 207 | |
| 208 | 208 | /* create one group per color code; for each group, set the transparency mask |
| 209 | 209 | to correspond to the pens that are 0x7f or 0xff */ |
| 210 | assert(machine.gfx[0]->total_colors <= TILEMAP_NUM_GROUPS); | |
| 211 | for (color = 0; color < machine.gfx[0]->total_colors; color++) | |
| 210 | assert(machine.gfx[0]->colors() <= TILEMAP_NUM_GROUPS); | |
| 211 | for (color = 0; color < machine.gfx[0]->colors(); color++) | |
| 212 | 212 | { |
| 213 | 213 | UINT32 mask = colortable_get_transpen_mask(machine.colortable, machine.gfx[0], color, 0x7f); |
| 214 | 214 | mask |= colortable_get_transpen_mask(machine.colortable, machine.gfx[0], color, 0xff); |
| r17669 | r17670 | |
|---|---|---|
| 53 | 53 | **- End Sprite Format -*/ |
| 54 | 54 | |
| 55 | 55 | psikyo4_state *state = machine.driver_data<psikyo4_state>(); |
| 56 | | |
| 56 | | |
| 57 | 57 | UINT32 *source = state->m_spriteram; |
| 58 | 58 | UINT16 *list = (UINT16 *)state->m_spriteram.target() + 0x2c00/2 + 0x04/2; /* 0x2c00/0x2c02 what are these for, pointers? one for each screen */ |
| 59 | 59 | UINT16 listlen = (0xc00/2 - 0x04/2), listcntr = 0; |
| r17669 | r17670 | |
| 143 | 143 | |
| 144 | 144 | VIDEO_START( psikyo4 ) |
| 145 | 145 | { |
| 146 | machine.gfx[0]-> | |
| 146 | machine.gfx[0]->set | |
| 147 | 147 | } |
| r17669 | r17670 | |
|---|---|---|
| 172 | 172 | { |
| 173 | 173 | sidearms_state *state = machine.driver_data<sidearms_state>(); |
| 174 | 174 | UINT8 *buffered_spriteram = state->m_spriteram->buffer(); |
| 175 | | |
| 175 | | |
| 176 | 176 | int offs, attr, color, code, x, y, flipx, flipy; |
| 177 | 177 | |
| 178 | 178 | flipy = flipx = state->m_flipon; |
| r17669 | r17670 | |
|---|---|---|
| 187 | 187 | state->m_sprite_sprite_collbitmap1.allocate(32,32); |
| 188 | 188 | state->m_sprite_sprite_collbitmap2.allocate(32,32); |
| 189 | 189 | |
| 190 | gfx_element_set_source(machine.gfx[0], state->m_characterram); | |
| 191 | gfx_element_set_source(machine.gfx[1], state->m_characterram); | |
| 192 | gfx_element_set_source(machine.gfx[2], state->m_characterram + 0x1800); | |
| 193 | gfx_element_set_source(machine.gfx[3], state->m_characterram + 0x1800); | |
| 190 | machine.gfx[0]->set_source(state->m_characterram); | |
| 191 | machine.gfx[1]->set_source(state->m_characterram); | |
| 192 | machine.gfx[2]->set_source(state->m_characterram + 0x1800); | |
| 193 | machine.gfx[3]->set_source(state->m_characterram + 0x1800); | |
| 194 | 194 | |
| 195 | 195 | compute_draw_order(machine); |
| 196 | 196 | } |
| r17669 | r17670 | |
| 224 | 224 | { |
| 225 | 225 | if (offset < 0x1800) |
| 226 | 226 | { |
| 227 | gfx_element_mark_dirty(machine().gfx[0], (offset / 8) & 0xff); | |
| 228 | gfx_element_mark_dirty(machine().gfx[1], (offset / 32) & 0x3f); | |
| 227 | machine().gfx[0]->mark_dirty((offset / 8) & 0xff); | |
| 228 | machine().gfx[1]->mark_dirty((offset / 32) & 0x3f); | |
| 229 | 229 | } |
| 230 | 230 | else |
| 231 | 231 | { |
| 232 | gfx_element_mark_dirty(machine().gfx[2], (offset / 8) & 0xff); | |
| 233 | gfx_element_mark_dirty(machine().gfx[3], (offset / 32) & 0x3f); | |
| 232 | machine().gfx[2]->mark_dirty((offset / 8) & 0xff); | |
| 233 | machine().gfx[3]->mark_dirty((offset / 32) & 0x3f); | |
| 234 | 234 | } |
| 235 | 235 | |
| 236 | 236 | m_characterram[offset] = data; |
| r17669 | r17670 | |
| 263 | 263 | } |
| 264 | 264 | |
| 265 | 265 | |
| 266 | INLINE | |
| 266 | INLINE | |
| 267 | 267 | { |
| 268 | 268 | taitosj_state *state = machine.driver_data<taitosj_state>(); |
| 269 | 269 | offs_t offs = which * 4; |
| r17669 | r17670 | |
|---|---|---|
| 213 | 213 | { |
| 214 | 214 | splash_state *state = machine.driver_data<splash_state>(); |
| 215 | 215 | int i; |
| 216 | | |
| 216 | | |
| 217 | 217 | |
| 218 | 218 | for (i = 0; i < 0x400; i += 4){ |
| 219 | 219 | int sx = state->m_spriteram[i+2] & 0xff; |
| r17669 | r17670 | |
| 234 | 234 | { |
| 235 | 235 | splash_state *state = machine.driver_data<splash_state>(); |
| 236 | 236 | int i; |
| 237 | | |
| 237 | | |
| 238 | 238 | |
| 239 | 239 | for (i = 0; i < 0x400; i += 4){ |
| 240 | 240 | int sx = state->m_spriteram[i+2] & 0xff; |
| r17669 | r17670 | |
|---|---|---|
| 53 | 53 | state->m_fg_tilemap->set_transparent_pen(0xff); |
| 54 | 54 | |
| 55 | 55 | state->m_zoomdata = (UINT16 *)state->memregion("gfx4")->base(); |
| 56 | | |
| 56 | | |
| 57 | 57 | |
| 58 | 58 | // state->save_pointer(NAME(state->m_zoomdata), state->memregion("gfx4")->bytes()); |
| 59 | 59 | } |
| r17669 | r17670 | |
| 69 | 69 | state->m_fg_tilemap->set_transparent_pen(0xff); |
| 70 | 70 | |
| 71 | 71 | state->m_zoomdata = (UINT16 *)state->memregion("gfx4")->base(); |
| 72 | | |
| 72 | | |
| 73 | 73 | |
| 74 | 74 | // state->save_pointer(NAME(state->m_zoomdata), state->memregion("gfx4")->bytes()); |
| 75 | 75 | } |
| r17669 | r17670 | |
| 103 | 103 | WRITE16_MEMBER(f1gp_state::f1gp_zoomdata_w) |
| 104 | 104 | { |
| 105 | 105 | COMBINE_DATA(&m_zoomdata[offset]); |
| 106 | | |
| 106 | | |
| 107 | 107 | } |
| 108 | 108 | |
| 109 | 109 | READ16_MEMBER(f1gp_state::f1gp_rozvideoram_r) |
| r17669 | r17670 | |
|---|---|---|
| 10 | 10 | #include "includes/snk6502.h" |
| 11 | 11 | |
| 12 | 12 | |
| 13 | #define TOTAL_COLORS(m,gfxn) ((m).gfx[gfxn]-> | |
| 13 | #define TOTAL_COLORS(m,gfxn) ((m).gfx[gfxn]-> | |
| 14 | 14 | #define COLOR(m,gfxn,offs) ((m).config().m_gfxdecodeinfo[gfxn].color_codes_start + offs) |
| 15 | 15 | |
| 16 | 16 | |
| r17669 | r17670 | |
| 103 | 103 | if (m_charram[offset] != data) |
| 104 | 104 | { |
| 105 | 105 | m_charram[offset] = data; |
| 106 | | |
| 106 | | |
| 107 | 107 | } |
| 108 | 108 | } |
| 109 | 109 | |
| r17669 | r17670 | |
| 183 | 183 | |
| 184 | 184 | state->m_fg_tilemap->set_transparent_pen(0); |
| 185 | 185 | |
| 186 | | |
| 186 | | |
| 187 | 187 | } |
| 188 | 188 | |
| 189 | 189 | VIDEO_START( pballoon ) |
| r17669 | r17670 | |
| 320 | 320 | |
| 321 | 321 | state->m_fg_tilemap->set_transparent_pen(0); |
| 322 | 322 | |
| 323 | | |
| 323 | | |
| 324 | 324 | } |
| r17669 | r17670 | |
|---|---|---|
| 33 | 33 | { |
| 34 | 34 | if (m_characterram[offset] != data) |
| 35 | 35 | { |
| 36 | | |
| 36 | | |
| 37 | 37 | |
| 38 | 38 | m_characterram[offset] = data; |
| 39 | 39 | } |
| r17669 | r17670 | |
| 42 | 42 | VIDEO_START( polyplay ) |
| 43 | 43 | { |
| 44 | 44 | polyplay_state *state = machine.driver_data<polyplay_state>(); |
| 45 | | |
| 45 | | |
| 46 | 46 | } |
| 47 | 47 | |
| 48 | 48 |
| r17669 | r17670 | |
|---|---|---|
| 43 | 43 | |
| 44 | 44 | offset=offset%0xc000; |
| 45 | 45 | |
| 46 | | |
| 46 | | |
| 47 | 47 | } |
| 48 | 48 | |
| 49 | 49 | |
| r17669 | r17670 | |
| 209 | 209 | |
| 210 | 210 | state->m_tx_layer->set_transparent_pen(0); |
| 211 | 211 | |
| 212 | | |
| 212 | | |
| 213 | 213 | } |
| 214 | 214 | |
| 215 | 215 | VIDEO_START( cyclwarr ) |
| r17669 | r17670 | |
| 239 | 239 | |
| 240 | 240 | template<class _BitmapClass> |
| 241 | 241 | INLINE void roundupt_drawgfxzoomrotate(tatsumi_state *state, |
| 242 | _BitmapClass &dest_bmp, const rectangle &clip, | |
| 242 | _BitmapClass &dest_bmp, const rectangle &clip, | |
| 243 | 243 | UINT32 code,UINT32 color,int flipx,int flipy,UINT32 ssx,UINT32 ssy, |
| 244 | 244 | int scalex, int scaley, int rotate, int write_priority_only ) |
| 245 | 245 | { |
| r17669 | r17670 | |
| 261 | 261 | { |
| 262 | 262 | if( gfx ) |
| 263 | 263 | { |
| 264 | const pen_t *pal = &gfx->machine().pens[gfx->color_base + gfx->color_granularity * (color % gfx->total_colors)]; | |
| 265 | const UINT8 *shadow_pens = state->m_shadow_pen_array + (gfx->color_granularity * (color % gfx->total_colors)); | |
| 266 | const UINT8 *code_base = gfx_element_get_data(gfx, code % gfx->total_elements); | |
| 264 | const pen_t *pal = &gfx->machine().pens[gfx->colorbase() + gfx->granularity() * (color % gfx->colors())]; | |
| 265 | const UINT8 *shadow_pens = state->m_shadow_pen_array + (gfx->granularity() * (color % gfx->colors())); | |
| 266 | const UINT8 *code_base = gfx->get_data(code % gfx->elements()); | |
| 267 | 267 | |
| 268 | 268 | int block_size = 8 * scalex; |
| 269 | 269 | int sprite_screen_height = ((ssy&0xffff)+block_size)>>16; |
| r17669 | r17670 | |
| 272 | 272 | if (sprite_screen_width && sprite_screen_height) |
| 273 | 273 | { |
| 274 | 274 | /* compute sprite increment per screen pixel */ |
| 275 | int dx = (gfx->width<<16)/sprite_screen_width; | |
| 276 | int dy = (gfx->height<<16)/sprite_screen_height; | |
| 275 | int dx = (gfx->width()<<16)/sprite_screen_width; | |
| 276 | int dy = (gfx->height()<<16)/sprite_screen_height; | |
| 277 | 277 | |
| 278 | 278 | int sx;//=ssx>>16; |
| 279 | 279 | int sy;//=ssy>>16; |
| r17669 | r17670 | |
| 384 | 384 | int x, x_index = x_index_base; |
| 385 | 385 | for( x=sx; x<ex; x++ ) |
| 386 | 386 | { |
| 387 | const UINT8 *source = code_base + (cy>>16) * gfx-> | |
| 387 | const UINT8 *source = code_base + (cy>>16) * gfx->r | |
| 388 | 388 | int c = source[(cx >> 16)]; |
| 389 | 389 | if( c != transparent_color ) |
| 390 | 390 | { |
| r17669 | r17670 | |
| 407 | 407 | { |
| 408 | 408 | for( y=sy; y<ey; y++ ) |
| 409 | 409 | { |
| 410 | const UINT8 *source = code_base + (y_index>>16) * gfx-> | |
| 410 | const UINT8 *source = code_base + (y_index>>16) * gfx->r | |
| 411 | 411 | typename _BitmapClass::pixel_t *dest = &dest_bmp.pix(y); |
| 412 | 412 | |
| 413 | 413 | int x, x_index = x_index_base; |
| r17669 | r17670 | |
|---|---|---|
| 1165 | 1165 | |
| 1166 | 1166 | memcpy(&gl, layout, sizeof(gl)); |
| 1167 | 1167 | gl.total = total; |
| 1168 | machine.gfx[gfx_index] = gfx_element | |
| 1168 | machine.gfx[gfx_index] = auto_alloc(machine, gfx_element | |
| 1169 | 1169 | } |
| 1170 | 1170 | |
| 1171 | 1171 | /***************************************************************************/ |
| r17669 | r17670 | |
| 2114 | 2114 | fatalerror("Unsupported bpp"); |
| 2115 | 2115 | } |
| 2116 | 2116 | |
| 2117 | machine.gfx[gfx_index]-> | |
| 2117 | machine.gfx[gfx_index]->set | |
| 2118 | 2118 | |
| 2119 | 2119 | K056832_memory_region = gfx_memory_region; |
| 2120 | 2120 | K056832_gfxnum = gfx_index; |
| r17669 | r17670 | |
| 2621 | 2621 | int count, src_pitch, src_modulo; |
| 2622 | 2622 | int dst_pitch; |
| 2623 | 2623 | int line; |
| 2624 | | |
| 2624 | | |
| 2625 | 2625 | int offs, mask; |
| 2626 | 2626 | |
| 2627 | 2627 | #define LINE_WIDTH 512 |
| r17669 | r17670 | |
| 2635 | 2635 | pixmap = K056832_pixmap[page]; |
| 2636 | 2636 | pal_ptr = machine.pens; |
| 2637 | 2637 | src_gfx = machine.gfx[K056832_gfxnum]; |
| 2638 | src_pitch = src_gfx-> | |
| 2638 | src_pitch = src_gfx->r | |
| 2639 | 2639 | src_modulo = src_gfx->char_modulo; |
| 2640 | 2640 | dst_pitch = pixmap->rowpixels; |
| 2641 | 2641 |
| r17669 | r17670 | |
|---|---|---|
| 202 | 202 | // pow has 0x4000 tiles and independent x/y flipping |
| 203 | 203 | // the other games have > 0x4000 tiles and flipping in only one direction |
| 204 | 204 | // (globally selected) |
| 205 | int const is_pow = (machine.gfx[1]-> | |
| 205 | int const is_pow = (machine.gfx[1]-> | |
| 206 | 206 | int offs; |
| 207 | 207 | |
| 208 | 208 | for (offs = 0; offs < 0x800; offs += 0x40) |
| r17669 | r17670 | |
|---|---|---|
| 153 | 153 | |
| 154 | 154 | state->m_headlight_bitmap = auto_bitmap_ind16_alloc(machine, 128, 128); |
| 155 | 155 | |
| 156 | | |
| 156 | | |
| 157 | 157 | |
| 158 | 158 | drawgfx_opaque(*state->m_headlight_bitmap, state->m_headlight_bitmap->cliprect(), machine.gfx[2], 0, 0, 0, 0, 0x00, 0x00); |
| 159 | 159 | drawgfx_opaque(*state->m_headlight_bitmap, state->m_headlight_bitmap->cliprect(), machine.gfx[2], 0, 0, 0, 1, 0x00, 0x40); |
| r17669 | r17670 | |
| 246 | 246 | WRITE8_MEMBER(madalien_state::madalien_charram_w) |
| 247 | 247 | { |
| 248 | 248 | m_charram[offset] = data; |
| 249 | | |
| 249 | | |
| 250 | 250 | } |
| 251 | 251 | |
| 252 | 252 |
| r17669 | r17670 | |
|---|---|---|
| 101 | 101 | oneshot_state *state = machine.driver_data<oneshot_state>(); |
| 102 | 102 | const UINT16 *source = state->m_sprites; |
| 103 | 103 | const UINT16 *finish = source + (0x1000 / 2); |
| 104 | | |
| 104 | | |
| 105 | 105 | |
| 106 | 106 | int xpos, ypos; |
| 107 | 107 |
| r17669 | r17670 | |
|---|---|---|
| 100 | 100 | stlforce_state *state = machine.driver_data<stlforce_state>(); |
| 101 | 101 | const UINT16 *source = state->m_spriteram+0x0; |
| 102 | 102 | const UINT16 *finish = state->m_spriteram+0x800; |
| 103 | | |
| 103 | | |
| 104 | 104 | int ypos, xpos, attr, num; |
| 105 | 105 | |
| 106 | 106 | while (source<finish) |
| r17669 | r17670 | |
|---|---|---|
| 26 | 26 | int code = (data & 0x3ff) | ((data >> 4) & 0xc00); |
| 27 | 27 | int color = (~data >> 12) & 3; |
| 28 | 28 | SET_TILE_INFO(0, code, color, TILE_FLIPYX((data >> 10) & 3)); |
| 29 | if (machine.gfx[0]-> | |
| 29 | if (machine.gfx[0]-> | |
| 30 | 30 | tileinfo.category = (data >> 15) & 1; |
| 31 | 31 | } |
| 32 | 32 | |
| r17669 | r17670 | |
| 86 | 86 | state->m_fg_tilemap->set_transparent_pen(0); |
| 87 | 87 | |
| 88 | 88 | /* allocate memory for the assembled gfx data */ |
| 89 | srcdata0 = auto_alloc_array(machine, UINT8, gfx0->total_elements * gfx0->width * gfx0->height); | |
| 90 | srcdata2 = auto_alloc_array(machine, UINT8, gfx2->total_elements * gfx2->width * gfx2->height); | |
| 89 | srcdata0 = auto_alloc_array(machine, UINT8, gfx0->elements() * gfx0->width() * gfx0->height()); | |
| 90 | srcdata2 = auto_alloc_array(machine, UINT8, gfx2->elements() * gfx2->width() * gfx2->height()); | |
| 91 | 91 | |
| 92 | 92 | /* "colorize" each code */ |
| 93 | 93 | dest0 = srcdata0; |
| 94 | 94 | dest2 = srcdata2; |
| 95 | for (code = 0; code < gfx0-> | |
| 95 | for (code = 0; code < gfx0-> | |
| 96 | 96 | { |
| 97 | 97 | const UINT8 *coldata = colordatabase + code * 32; |
| 98 | const UINT8 *gfxdata0 = gfx_element_get_data(gfx0, code); | |
| 99 | const UINT8 *gfxdata2 = gfx_element_get_data(gfx2, code); | |
| 98 | const UINT8 *gfxdata0 = gfx0->get_data(code); | |
| 99 | const UINT8 *gfxdata2 = gfx2->get_data(code); | |
| 100 | 100 | |
| 101 | 101 | /* assume 16 rows */ |
| 102 | 102 | for (y = 0; y < 16; y++) |
| r17669 | r17670 | |
| 122 | 122 | } |
| 123 | 123 | |
| 124 | 124 | /* advance */ |
| 125 | gfxdata0 += gfx0->line_modulo; | |
| 126 | gfxdata2 += gfx2->line_modulo; | |
| 125 | gfxdata0 += gfx0->rowbytes(); | |
| 126 | gfxdata2 += gfx2->rowbytes(); | |
| 127 | 127 | } |
| 128 | 128 | } |
| 129 | 129 | |
| 130 | /* create a simple target layout */ | |
| 131 | gfx0->layout.planes = gfx2->layout.planes = 8; | |
| 132 | for (x = 0; x < 8; x++) | |
| 133 | gfx0->layout.planeoffset[x] = gfx2->layout.planeoffset[x] = x; | |
| 134 | for (x = 0; x < gfx0->width; x++) | |
| 135 | gfx0->layout.xoffset[x] = gfx2->layout.xoffset[x] = 8 * x; | |
| 136 | for (y = 0; y < gfx0->height; y++) | |
| 137 | gfx0->layout.yoffset[y] = gfx2->layout.yoffset[y] = 8 * y * gfx0->width; | |
| 138 | gfx0->layout.charincrement = gfx2->layout.charincrement = 8 * gfx0->width * gfx0->height; | |
| 139 | ||
| 140 | 130 | /* make the assembled data our new source data */ |
| 141 | gfx_element_set_source(gfx0, srcdata0); | |
| 142 | gfx_element_set_source(gfx2, srcdata2); | |
| 131 | gfx0->set_raw_layout(srcdata0, gfx0->width(), gfx0->height(), gfx0->elements(), 8 * gfx0->width(), 8 * gfx0->width() * gfx0->height()); | |
| 132 | gfx2->set_raw_layout(srcdata2, gfx2->width(), gfx2->height(), gfx2->elements(), 8 * gfx2->width(), 8 * gfx2->width() * gfx2->height()); | |
| 143 | 133 | } |
| 144 | 134 | |
| 145 | 135 |
| r17669 | r17670 | |
|---|---|---|
| 10 | 10 | static void draw_sprites(running_machine &machine, bitmap_ind16 &bitmap, const rectangle &cliprect) |
| 11 | 11 | { |
| 12 | 12 | silkroad_state *state = machine.driver_data<silkroad_state>(); |
| 13 | | |
| 13 | | |
| 14 | 14 | UINT32 *source = state->m_sprram; |
| 15 | 15 | UINT32 *finish = source + 0x1000/4; |
| 16 | 16 |
| r17669 | r17670 | |
|---|---|---|
| 400 | 400 | } |
| 401 | 401 | pdrawgfx_transpen_raw(bitmap,cliprect,machine.gfx[2], |
| 402 | 402 | code + layout[y][x], |
| 403 | machine.gfx[2]->color | |
| 403 | machine.gfx[2]->color | |
| 404 | 404 | flipx,flipy, |
| 405 | 405 | sx,sy, |
| 406 | 406 | machine.priority_bitmap, priority_mask,0); |
| r17669 | r17670 | |
| 408 | 408 | /* wrap around x */ |
| 409 | 409 | pdrawgfx_transpen_raw(bitmap,cliprect,machine.gfx[2], |
| 410 | 410 | code + layout[y][x], |
| 411 | machine.gfx[2]->color | |
| 411 | machine.gfx[2]->color | |
| 412 | 412 | flipx,flipy, |
| 413 | 413 | sx-512,sy, |
| 414 | 414 | machine.priority_bitmap, priority_mask,0); |
| r17669 | r17670 | |
| 416 | 416 | /* wrap around x */ |
| 417 | 417 | pdrawgfx_transpen_raw(bitmap,cliprect,machine.gfx[2], |
| 418 | 418 | code + layout[y][x], |
| 419 | machine.gfx[2]->color | |
| 419 | machine.gfx[2]->color | |
| 420 | 420 | flipx,flipy, |
| 421 | 421 | sx+512,sy, |
| 422 | 422 | machine.priority_bitmap, priority_mask,0); |
| r17669 | r17670 | |
| 443 | 443 | } |
| 444 | 444 | pdrawgfx_transpen_raw(bitmap,cliprect,machine.gfx[2], |
| 445 | 445 | code + layout[y][x], |
| 446 | machine.gfx[2]->color | |
| 446 | machine.gfx[2]->color | |
| 447 | 447 | flipx,flipy, |
| 448 | 448 | sx,sy, |
| 449 | 449 | machine.priority_bitmap, priority_mask,0); |
| r17669 | r17670 | |
| 451 | 451 | /* wrap around x */ |
| 452 | 452 | pdrawgfx_transpen_raw(bitmap,cliprect,machine.gfx[2], |
| 453 | 453 | code + layout[y][x], |
| 454 | machine.gfx[2]->color | |
| 454 | machine.gfx[2]->color | |
| 455 | 455 | flipx,flipy, |
| 456 | 456 | sx-512,sy, |
| 457 | 457 | machine.priority_bitmap, priority_mask,0); |
| r17669 | r17670 | |
| 459 | 459 | /* wrap around x */ |
| 460 | 460 | pdrawgfx_transpen_raw(bitmap,cliprect,machine.gfx[2], |
| 461 | 461 | code + layout[y][x], |
| 462 | machine.gfx[2]->color | |
| 462 | machine.gfx[2]->color | |
| 463 | 463 | flipx,flipy, |
| 464 | 464 | sx+512,sy, |
| 465 | 465 | machine.priority_bitmap, priority_mask,0); |
| r17669 | r17670 | |
|---|---|---|
| 119 | 119 | |
| 120 | 120 | rect.min_x = horz - 15; |
| 121 | 121 | rect.min_y = vert - 15; |
| 122 | rect.max_x = horz - 15 + screen.machine().gfx[1]->width - 1; | |
| 123 | rect.max_y = vert - 15 + screen.machine().gfx[1]->height - 1; | |
| 122 | rect.max_x = horz - 15 + screen.machine().gfx[1]->width() - 1; | |
| 123 | rect.max_y = vert - 15 + screen.machine().gfx[1]->height() - 1; | |
| 124 | 124 | |
| 125 | 125 | rect &= screen.machine().primary_screen->visible_area(); |
| 126 | 126 |
| r17669 | r17670 | |
|---|---|---|
| 183 | 183 | a single transparent pen, storing the alpha value |
| 184 | 184 | in alpha field of ARGB32, negative alpha implies alphatable |
| 185 | 185 | -------------------------------------------------*/ |
| 186 | static void drawgfx_alphastore(bitmap_rgb32 &dest, const rectangle &cliprect, | |
| 186 | static void drawgfx_alphastore(bitmap_rgb32 &dest, const rectangle &cliprect, | |
| 187 | 187 | UINT32 code, UINT32 color, int flipx, int flipy, INT32 destx, INT32 desty, |
| 188 | 188 | int fixedalpha) |
| 189 | 189 | { |
| r17669 | r17670 | |
| 205 | 205 | } |
| 206 | 206 | |
| 207 | 207 | /* get final code and color, and grab lookup tables */ |
| 208 | code %= gfx->total_elements; | |
| 209 | color %= gfx->total_colors; | |
| 210 | paldata = &gfx->machine().pens[gfx->color_base + gfx->color_granularity * color]; | |
| 208 | code %= gfx->elements(); | |
| 209 | color %= gfx->colors(); | |
| 210 | paldata = &gfx->machine().pens[gfx->colorbase() + gfx->granularity() * color]; | |
| 211 | 211 | |
| 212 | 212 | /* early out if completely transparent */ |
| 213 | if (gfx->pen_usage | |
| 213 | if (gfx->has_pen_usage() | |
| 214 | 214 | return; |
| 215 | 215 | |
| 216 | 216 | if (fixedalpha >= 0) |
| r17669 | r17670 | |
| 229 | 229 | a fixed alpha value, or if alpha==-1 then uses |
| 230 | 230 | the per-pen alphatable[] array |
| 231 | 231 | -------------------------------------------------*/ |
| 232 | static void drawgfx_alphatable(bitmap_rgb32 &dest, const rectangle &cliprect, | |
| 232 | static void drawgfx_alphatable(bitmap_rgb32 &dest, const rectangle &cliprect, | |
| 233 | 233 | UINT32 code, UINT32 color, int flipx, int flipy, INT32 destx, INT32 desty, |
| 234 | 234 | int fixedalpha) |
| 235 | 235 | { |
| r17669 | r17670 | |
| 251 | 251 | assert(alphatable != NULL); |
| 252 | 252 | |
| 253 | 253 | /* get final code and color, and grab lookup tables */ |
| 254 | code %= gfx->total_elements; | |
| 255 | color %= gfx->total_colors; | |
| 256 | paldata = &gfx->machine().pens[gfx->color_base + gfx->color_granularity * color]; | |
| 254 | code %= gfx->elements(); | |
| 255 | color %= gfx->colors(); | |
| 256 | paldata = &gfx->machine().pens[gfx->colorbase() + gfx->granularity() * color]; | |
| 257 | 257 | |
| 258 | 258 | /* early out if completely transparent */ |
| 259 | if (gfx->pen_usage | |
| 259 | if (gfx->has_pen_usage() | |
| 260 | 260 | return; |
| 261 | 261 | |
| 262 | 262 | DRAWGFX_CORE(UINT32, PIXEL_OP_REMAP_TRANS0_ALPHATABLE32, NO_PRIORITY); |
| r17669 | r17670 | |
| 515 | 515 | /* Note that Level 5-4 of sbomberb boss is perfect! (Alpha blended zoomed) as well as S1945II logo */ |
| 516 | 516 | /* pixel is only plotted if z is >= priority_buffer[y][x] */ |
| 517 | 517 | static void psikyosh_drawgfxzoom( running_machine &machine, |
| 518 | bitmap_rgb32 &dest_bmp,const rectangle &clip, | |
| 518 | bitmap_rgb32 &dest_bmp,const rectangle &clip, | |
| 519 | 519 | UINT32 code,UINT32 color,int flipx,int flipy,int offsx,int offsy, |
| 520 | 520 | int alpha, int zoomx, int zoomy, int wide, int high, UINT32 z) |
| 521 | 521 | { |
| r17669 | r17670 | |
| 554 | 554 | { |
| 555 | 555 | for (xtile = xstart; xtile != xend; xtile += xinc) |
| 556 | 556 | { |
| 557 | const pen_t *pal = &gfx->machine().pens[gfx->color_base + gfx->color_granularity * (color % gfx->total_colors)]; | |
| 558 | const UINT8 *code_base = gfx_element_get_data(gfx, (code + code_offset++) % gfx->total_elements); | |
| 557 | const pen_t *pal = &gfx->machine().pens[gfx->colorbase() + gfx->granularity() * (color % gfx->colors())]; | |
| 558 | const UINT8 *code_base = gfx->get_data((code + code_offset++) % gfx->elements()); | |
| 559 | 559 | |
| 560 | 560 | int x_index_base, y_index, sx, sy, ex, ey; |
| 561 | 561 | |
| 562 | if (flipx) { x_index_base = gfx->width - 1; } | |
| 562 | if (flipx) { x_index_base = gfx->width() - 1; } | |
| 563 | 563 | else { x_index_base = 0; } |
| 564 | 564 | |
| 565 | if (flipy) { y_index = gfx->height-1; } | |
| 565 | if (flipy) { y_index = gfx->height()-1; } | |
| 566 | 566 | else { y_index = 0; } |
| 567 | 567 | |
| 568 | 568 | /* start coordinates */ |
| 569 | sx = offsx + xtile * gfx->width; | |
| 570 | sy = offsy + ytile * gfx->height; | |
| 569 | sx = offsx + xtile * gfx->width(); | |
| 570 | sy = offsy + ytile * gfx->height(); | |
| 571 | 571 | |
| 572 | 572 | /* end coordinates */ |
| 573 | ex = sx + gfx->width; | |
| 574 | ey = sy + gfx->height; | |
| 573 | ex = sx + gfx->width(); | |
| 574 | ey = sy + gfx->height(); | |
| 575 | 575 | |
| 576 | 576 | if (sx < myclip.min_x) |
| 577 | 577 | { /* clip left */ |
| r17669 | r17670 | |
| 606 | 606 | { |
| 607 | 607 | if (z > 0) |
| 608 | 608 | { |
| 609 | const UINT8 *source = code_base + (y_index) * gfx-> | |
| 609 | const UINT8 *source = code_base + (y_index) * gfx->r | |
| 610 | 610 | UINT32 *dest = &dest_bmp.pix32(sy, sx); |
| 611 | 611 | UINT16 *pri = &state->m_z_bitmap.pix16(sy, sx); |
| 612 | int src_modulo = yinc * gfx-> | |
| 612 | int src_modulo = yinc * gfx->r | |
| 613 | 613 | int dst_modulo = dest_bmp.rowpixels() - (ex - sx); |
| 614 | 614 | |
| 615 | 615 | for (y = sy; y < ey; y++) |
| r17669 | r17670 | |
| 637 | 637 | } |
| 638 | 638 | else |
| 639 | 639 | { |
| 640 | const UINT8 *source = code_base + y_index * gfx-> | |
| 640 | const UINT8 *source = code_base + y_index * gfx->r | |
| 641 | 641 | UINT32 *dest = &dest_bmp.pix32(sy, sx); |
| 642 | int src_modulo = yinc * gfx-> | |
| 642 | int src_modulo = yinc * gfx->r | |
| 643 | 643 | int dst_modulo = dest_bmp.rowpixels() - (ex - sx); |
| 644 | 644 | |
| 645 | 645 | for (y = sy; y < ey; y++) |
| r17669 | r17670 | |
| 665 | 665 | { |
| 666 | 666 | if (z > 0) |
| 667 | 667 | { |
| 668 | const UINT8 *source = code_base + y_index * gfx-> | |
| 668 | const UINT8 *source = code_base + y_index * gfx->r | |
| 669 | 669 | UINT32 *dest = &dest_bmp.pix32(sy, sx); |
| 670 | 670 | UINT16 *pri = &state->m_z_bitmap.pix16(sy, sx); |
| 671 | int src_modulo = yinc * gfx-> | |
| 671 | int src_modulo = yinc * gfx->r | |
| 672 | 672 | int dst_modulo = dest_bmp.rowpixels() - (ex - sx); |
| 673 | 673 | |
| 674 | 674 | for (y = sy; y < ey; y++) |
| r17669 | r17670 | |
| 696 | 696 | } |
| 697 | 697 | else |
| 698 | 698 | { |
| 699 | const UINT8 *source = code_base + y_index * gfx-> | |
| 699 | const UINT8 *source = code_base + y_index * gfx->r | |
| 700 | 700 | UINT32 *dest = &dest_bmp.pix32(sy, sx); |
| 701 | int src_modulo = yinc * gfx-> | |
| 701 | int src_modulo = yinc * gfx->r | |
| 702 | 702 | int dst_modulo = dest_bmp.rowpixels() - (ex - sx); |
| 703 | 703 | |
| 704 | 704 | for (y = sy; y < ey; y++) |
| r17669 | r17670 | |
| 725 | 725 | { |
| 726 | 726 | if (z > 0) |
| 727 | 727 | { |
| 728 | const UINT8 *source = code_base + y_index * gfx-> | |
| 728 | const UINT8 *source = code_base + y_index * gfx->r | |
| 729 | 729 | UINT32 *dest = &dest_bmp.pix32(sy, sx); |
| 730 | 730 | UINT16 *pri = &state->m_z_bitmap.pix16(sy, sx); |
| 731 | int src_modulo = yinc * gfx-> | |
| 731 | int src_modulo = yinc * gfx->r | |
| 732 | 732 | int dst_modulo = dest_bmp.rowpixels() - (ex - sx); |
| 733 | 733 | |
| 734 | 734 | for (y = sy; y < ey; y++) |
| r17669 | r17670 | |
| 760 | 760 | } |
| 761 | 761 | else |
| 762 | 762 | { |
| 763 | const UINT8 *source = code_base + y_index * gfx-> | |
| 763 | const UINT8 *source = code_base + y_index * gfx->r | |
| 764 | 764 | UINT32 *dest = &dest_bmp.pix32(sy, sx); |
| 765 | int src_modulo = yinc * gfx-> | |
| 765 | int src_modulo = yinc * gfx->r | |
| 766 | 766 | int dst_modulo = dest_bmp.rowpixels() - (ex - sx); |
| 767 | 767 | |
| 768 | 768 | for (y = sy; y < ey; y++) |
| r17669 | r17670 | |
| 800 | 800 | { |
| 801 | 801 | for (xtile = 0; xtile < wide; xtile++) |
| 802 | 802 | { |
| 803 | const UINT8 *code_base = gfx_element_get_data(gfx, (code + code_offset++) % gfx->total_elements); | |
| 804 | for (ypixel = 0; ypixel < gfx->height; ypixel++) | |
| 803 | const UINT8 *code_base = gfx->get_data((code + code_offset++) % gfx->elements()); | |
| 804 | for (ypixel = 0; ypixel < gfx->height(); ypixel++) | |
| 805 | 805 | { |
| 806 | const UINT8 *source = code_base + ypixel * gfx->line_modulo; | |
| 807 | UINT8 *dest = &state->m_zoom_bitmap.pix8(ypixel + ytile*gfx->height); | |
| 806 | const UINT8 *source = code_base + ypixel * gfx->rowbytes(); | |
| 807 | UINT8 *dest = &state->m_zoom_bitmap.pix8(ypixel + ytile*gfx->height()); | |
| 808 | 808 | |
| 809 | for (xpixel = 0; xpixel < gfx->width; xpixel++) | |
| 809 | for (xpixel = 0; xpixel < gfx->width(); xpixel++) | |
| 810 | 810 | { |
| 811 | dest[xpixel + xtile*gfx->width] = source[xpixel]; | |
| 811 | dest[xpixel + xtile*gfx->width()] = source[xpixel]; | |
| 812 | 812 | } |
| 813 | 813 | } |
| 814 | 814 | } |
| r17669 | r17670 | |
| 817 | 817 | /* Start drawing */ |
| 818 | 818 | if (gfx) |
| 819 | 819 | { |
| 820 | const pen_t *pal = &gfx->machine().pens[gfx->color | |
| 820 | const pen_t *pal = &gfx->machine().pens[gfx->color | |
| 821 | 821 | |
| 822 | int sprite_screen_height = ((high * gfx->height * (0x400 * 0x400)) / zoomy + 0x200) >> 10; /* Round up to nearest pixel */ | |
| 823 | int sprite_screen_width = ((wide * gfx->width * (0x400 * 0x400)) / zoomx + 0x200) >> 10; | |
| 822 | int sprite_screen_height = ((high * gfx->height() * (0x400 * 0x400)) / zoomy + 0x200) >> 10; /* Round up to nearest pixel */ | |
| 823 | int sprite_screen_width = ((wide * gfx->width() * (0x400 * 0x400)) / zoomx + 0x200) >> 10; | |
| 824 | 824 | |
| 825 | 825 | if (sprite_screen_width && sprite_screen_height) |
| 826 | 826 | { |
| r17669 | r17670 | |
| 1084 | 1084 | |
| 1085 | 1085 | |
| 1086 | 1086 | psikyosh_state *state = machine.driver_data<psikyosh_state>(); |
| 1087 | | |
| 1087 | | |
| 1088 | 1088 | UINT32 *src = state->m_spriteram->buffer(); /* Use buffered spriteram */ |
| 1089 | 1089 | UINT16 *list = (UINT16 *)src + 0x3800 / 2; |
| 1090 | 1090 | UINT16 listlen = 0x800/2; |
| r17669 | r17670 | |
| 1229 | 1229 | state->m_bg_bitmap.allocate(32*16, 32*16); /* temp buffer for assembling tilemaps */ |
| 1230 | 1230 | state->m_bg_zoom = auto_alloc_array(machine, UINT16, 256); |
| 1231 | 1231 | |
| 1232 | machine.gfx[1]-> | |
| 1232 | machine.gfx[1]->set | |
| 1233 | 1233 | |
| 1234 | 1234 | /* Pens 0xc0-0xff have a gradient of alpha values associated with them */ |
| 1235 | 1235 | int i; |
| r17669 | r17670 | |
|---|---|---|
| 329 | 329 | equites_state *state = machine.driver_data<equites_state>(); |
| 330 | 330 | const UINT8 * const xrom = state->memregion("user2")->base(); |
| 331 | 331 | const UINT8 * const yrom = xrom + 0x100; |
| 332 | | |
| 332 | | |
| 333 | 333 | int offs; |
| 334 | 334 | |
| 335 | 335 | // note that sprites are actually 30x30, contained in 32x32 squares. The outer edge is not used. |
| r17669 | r17670 | |
| 350 | 350 | |
| 351 | 351 | // const UINT8 * const xromline = xrom + (scalex << 4); |
| 352 | 352 | const UINT8 * const yromline = yrom + (scaley << 4) + (15 - scaley); |
| 353 | const UINT8* const srcgfx = gfx_element_get_data(gfx, tile); | |
| 354 | const pen_t *paldata = &machine.pens[gfx->color_base + gfx->color_granularity * color]; | |
| 353 | const UINT8* const srcgfx = gfx->get_data(tile); | |
| 354 | const pen_t *paldata = &machine.pens[gfx->colorbase() + gfx->granularity() * color]; | |
| 355 | 355 | int x,yy; |
| 356 | 356 | |
| 357 | 357 | sy += 16; |
| r17669 | r17670 | |
| 385 | 385 | if (bx >= cliprect.min_x && bx <= cliprect.max_x) |
| 386 | 386 | { |
| 387 | 387 | int xx = scalex ? (x * 29 + scalex) / (scalex << 1) + 1 : 16; // FIXME This is wrong. Should use the PROM. |
| 388 | int const offset = (fx ? (31 - xx) : xx) + ((fy ^ yhalf) ? (16 + line) : (15 - line) ) * gfx-> | |
| 388 | int const offset = (fx ? (31 - xx) : xx) + ((fy ^ yhalf) ? (16 + line) : (15 - line) ) * gfx->r | |
| 389 | 389 | |
| 390 | 390 | int pen = srcgfx[offset]; |
| 391 | 391 |
| r17669 | r17670 | |
|---|---|---|
| 64 | 64 | |
| 65 | 65 | for (i = 0; i < 0x20000; i += 16) |
| 66 | 66 | { |
| 67 | | |
| 67 | | |
| 68 | 68 | } |
| 69 | 69 | } |
| 70 | 70 | |
| r17669 | r17670 | |
| 84 | 84 | /* re-decode the sprites because the ROMs are connected to the custom IC differently |
| 85 | 85 | from how they are connected to the CPU. */ |
| 86 | 86 | for (i = 0; i < TOTAL_SPRITES; i++) |
| 87 | | |
| 87 | | |
| 88 | 88 | |
| 89 | | |
| 89 | | |
| 90 | 90 | |
| 91 | 91 | machine.save().register_postload(save_prepost_delegate(FUNC(gradius3_postload), &machine)); |
| 92 | 92 | } |
| r17669 | r17670 | |
| 113 | 113 | COMBINE_DATA(&m_gfxram[offset]); |
| 114 | 114 | |
| 115 | 115 | if (oldword != m_gfxram[offset]) |
| 116 | | |
| 116 | | |
| 117 | 117 | } |
| 118 | 118 | |
| 119 | 119 | /*************************************************************************** |
| r17669 | r17670 | |
|---|---|---|
| 188 | 188 | decocass_state *state = space->machine().driver_data<decocass_state>(); |
| 189 | 189 | state->m_charram[offset] = data; |
| 190 | 190 | /* dirty sprite */ |
| 191 | | |
| 191 | | |
| 192 | 192 | /* dirty char */ |
| 193 | | |
| 193 | | |
| 194 | 194 | } |
| 195 | 195 | |
| 196 | 196 | |
| r17669 | r17670 | |
| 222 | 222 | decocass_state *state = space->machine().driver_data<decocass_state>(); |
| 223 | 223 | state->m_tileram[offset] = data; |
| 224 | 224 | /* dirty tile (64 bytes per tile) */ |
| 225 | | |
| 225 | | |
| 226 | 226 | /* first 1KB of tile RAM is shared with tilemap RAM */ |
| 227 | 227 | if (offset < state->m_bgvideoram_size) |
| 228 | 228 | mark_bg_tile_dirty(space->machine(), offset); |
| r17669 | r17670 | |
| 233 | 233 | decocass_state *state = space->machine().driver_data<decocass_state>(); |
| 234 | 234 | state->m_objectram[offset] = data; |
| 235 | 235 | /* dirty the object */ |
| 236 | gfx_element_mark_dirty(space->machine().gfx[3], 0); | |
| 237 | gfx_element_mark_dirty(space->machine().gfx[3], 1); | |
| 236 | space->machine().gfx[3]->mark_dirty(0); | |
| 237 | space->machine().gfx[3]->mark_dirty(1); | |
| 238 | 238 | } |
| 239 | 239 | |
| 240 | 240 | WRITE8_HANDLER( decocass_bgvideoram_w ) |
| r17669 | r17670 | |
| 510 | 510 | state->m_bgvideoram = state->m_tileram; |
| 511 | 511 | state->m_bgvideoram_size = 0x0400; /* d000-d3ff */ |
| 512 | 512 | |
| 513 | gfx_element_set_source(machine.gfx[0], state->m_charram); | |
| 514 | gfx_element_set_source(machine.gfx[1], state->m_charram); | |
| 515 | gfx_element_set_source(machine.gfx[2], state->m_tileram); | |
| 516 | gfx_element_set_source(machine.gfx[3], state->m_objectram); | |
| 513 | machine.gfx[0]->set_source(state->m_charram); | |
| 514 | machine.gfx[1]->set_source(state->m_charram); | |
| 515 | machine.gfx[2]->set_source(state->m_tileram); | |
| 516 | machine.gfx[3]->set_source(state->m_objectram); | |
| 517 | 517 | |
| 518 | 518 | /* This should ensure that the fake 17th tile is left blank |
| 519 | 519 | * now that dirty-tile tracking is handled by the core */ |
| 520 | | |
| 520 | | |
| 521 | 521 | } |
| 522 | 522 | |
| 523 | 523 | SCREEN_UPDATE_IND16( decocass ) |
| r17669 | r17670 | |
|---|---|---|
| 22 | 22 | int gfxnum; |
| 23 | 23 | |
| 24 | 24 | for (gfxnum = 0; gfxnum < ARRAY_LENGTH(machine.gfx); gfxnum++) |
| 25 | if (machine.gfx[gfxnum] != NULL && machine.gfx[gfxnum]->srcdata == s) | |
| 25 | if (machine.gfx[gfxnum] != NULL && machine.gfx[gfxnum]->srcdata() == s) | |
| 26 | 26 | break; |
| 27 | 27 | assert(gfxnum != ARRAY_LENGTH(machine.gfx)); |
| 28 | 28 | |
| r17669 | r17670 | |
| 55 | 55 | d += 5; |
| 56 | 56 | } |
| 57 | 57 | |
| 58 | | |
| 58 | | |
| 59 | 59 | } |
| 60 | 60 | |
| 61 | 61 |
| r17669 | r17670 | |
|---|---|---|
| 1239 | 1239 | |
| 1240 | 1240 | memcpy(&gl, layout, sizeof(gl)); |
| 1241 | 1241 | gl.total = total; |
| 1242 | machine.gfx[gfx_index] = gfx_element | |
| 1242 | machine.gfx[gfx_index] = auto_alloc(machine, gfx_element | |
| 1243 | 1243 | } |
| 1244 | 1244 | |
| 1245 | 1245 | |
| r17669 | r17670 | |
| 1426 | 1426 | const UINT8 *source, int base_color, int global_x_offset, int bank_base, UINT32 pri_mask ) |
| 1427 | 1427 | { |
| 1428 | 1428 | k007121_state *k007121 = k007121_get_safe_token(device); |
| 1429 | // | |
| 1429 | // | |
| 1430 | 1430 | bitmap_ind8 &priority_bitmap = gfx->machine().priority_bitmap; |
| 1431 | 1431 | int flipscreen = k007121->flipscreen; |
| 1432 | 1432 | int i, num, inc, offs[5]; |
| r17669 | r17670 | |
| 3092 | 3092 | flipy = !flipy; |
| 3093 | 3093 | } |
| 3094 | 3094 | |
| 3095 | drawmode_table[k051960->gfx-> | |
| 3095 | drawmode_table[k051960->gfx-> | |
| 3096 | 3096 | |
| 3097 | 3097 | if (zoomx == 0x10000 && zoomy == 0x10000) |
| 3098 | 3098 | { |
| r17669 | r17670 | |
| 3678 | 3678 | ox -= (zoomx * w) >> 13; |
| 3679 | 3679 | oy -= (zoomy * h) >> 13; |
| 3680 | 3680 | |
| 3681 | drawmode_table[k053245->gfx-> | |
| 3681 | drawmode_table[k053245->gfx-> | |
| 3682 | 3682 | |
| 3683 | 3683 | for (y = 0; y < h; y++) |
| 3684 | 3684 | { |
| r17669 | r17670 | |
| 3928 | 3928 | ox -= (zoomx * w) >> 13; |
| 3929 | 3929 | oy -= (zoomy * h) >> 13; |
| 3930 | 3930 | |
| 3931 | drawmode_table[machine.gfx[0]-> | |
| 3931 | drawmode_table[machine.gfx[0]-> | |
| 3932 | 3932 | |
| 3933 | 3933 | for (y = 0; y < h; y++) |
| 3934 | 3934 | { |
| r17669 | r17670 | |
| 4739 | 4739 | ox -= (zoomx * w) >> 13; |
| 4740 | 4740 | oy -= (zoomy * h) >> 13; |
| 4741 | 4741 | |
| 4742 | drawmode_table[k053246->gfx-> | |
| 4742 | drawmode_table[k053246->gfx-> | |
| 4743 | 4743 | |
| 4744 | 4744 | for (y = 0; y < h; y++) |
| 4745 | 4745 | { |
| r17669 | r17670 | |
| 7034 | 7034 | int count, src_pitch, src_modulo; |
| 7035 | 7035 | int dst_pitch; |
| 7036 | 7036 | int line; |
| 7037 | | |
| 7037 | | |
| 7038 | 7038 | int offs, mask; |
| 7039 | 7039 | |
| 7040 | 7040 | #define LINE_WIDTH 512 |
| r17669 | r17670 | |
| 7048 | 7048 | pixmap = k056832->pixmap[page]; |
| 7049 | 7049 | pal_ptr = machine.pens; |
| 7050 | 7050 | src_gfx = machine.gfx[k056832->gfxnum]; |
| 7051 | src_pitch = src_gfx-> | |
| 7051 | src_pitch = src_gfx->r | |
| 7052 | 7052 | src_modulo = src_gfx->char_modulo; |
| 7053 | 7053 | dst_pitch = pixmap->rowpixels; |
| 7054 | 7054 | |
| r17669 | r17670 | |
| 7887 | 7887 | fatalerror("Unsupported bpp"); |
| 7888 | 7888 | } |
| 7889 | 7889 | |
| 7890 | machine.gfx[intf->gfx_num]-> | |
| 7890 | machine.gfx[intf->gfx_num]->set | |
| 7891 | 7891 | |
| 7892 | 7892 | /* deinterleave the graphics, if needed */ |
| 7893 | 7893 | deinterleave_gfx(machine, intf->gfx_memory_region, intf->deinterleave); |
| r17669 | r17670 | |
| 9861 | 9861 | |
| 9862 | 9862 | COMBINE_DATA(k001604->char_ram + addr); |
| 9863 | 9863 | |
| 9864 | gfx_element_mark_dirty(device->machine().gfx[k001604->gfx_index[0]], addr / 32); | |
| 9865 | gfx_element_mark_dirty(device->machine().gfx[k001604->gfx_index[1]], addr / 128); | |
| 9864 | device->machine().gfx[k001604->gfx_index[0]]->mark_dirty(addr / 32); | |
| 9865 | device->machine().gfx[k001604->gfx_index[1]]->mark_dirty(addr / 128); | |
| 9866 | 9866 | } |
| 9867 | 9867 | |
| 9868 | 9868 | WRITE32_DEVICE_HANDLER( k001604_reg_w ) |
| r17669 | r17670 | |
| 9937 | 9937 | k001604->layer_8x8[0]->set_transparent_pen(0); |
| 9938 | 9938 | k001604->layer_8x8[1]->set_transparent_pen(0); |
| 9939 | 9939 | |
| 9940 | device->machine().gfx[k001604->gfx_index[0]] = gfx_element_alloc(device->machine(), &k001604_char_layout_layer_8x8, (UINT8*)&k001604->char_ram[0], device->machine().total_colors() / 16, 0); | |
| 9941 | device->machine().gfx[k001604->gfx_index[1]] = gfx_element_alloc(device->machine(), &k001604_char_layout_layer_16x16, (UINT8*)&k001604->char_ram[0], device->machine().total_colors() / 16, 0); | |
| 9940 | device->machine().gfx[k001604->gfx_index[0]] = auto_alloc(device->machine(), gfx_element(device->machine(), k001604_char_layout_layer_8x8, (UINT8*)&k001604->char_ram[0], device->machine().total_colors() / 16, 0)); | |
| 9941 | device->machine().gfx[k001604->gfx_index[1]] = auto_alloc(device->machine(), gfx_element(device->machine(), k001604_char_layout_layer_16x16, (UINT8*)&k001604->char_ram[0], device->machine().total_colors() / 16, 0)); | |
| 9942 | 9942 | |
| 9943 | 9943 | device->save_pointer(NAME(k001604->reg), 0x400 / 4); |
| 9944 | 9944 | device->save_pointer(NAME(k001604->char_ram), 0x200000 / 4); |
| r17669 | r17670 | |
| 10133 | 10133 | UINT32 addr = offset + (bank * (0x40000/4)); |
| 10134 | 10134 | |
| 10135 | 10135 | COMBINE_DATA(k037122->char_ram + addr); |
| 10136 | | |
| 10136 | | |
| 10137 | 10137 | } |
| 10138 | 10138 | |
| 10139 | 10139 | READ32_DEVICE_HANDLER( k037122_reg_r ) |
| r17669 | r17670 | |
| 10179 | 10179 | k037122->layer[0]->set_transparent_pen(0); |
| 10180 | 10180 | k037122->layer[1]->set_transparent_pen(0); |
| 10181 | 10181 | |
| 10182 | device->machine().gfx[k037122->gfx_index] = gfx_element | |
| 10182 | device->machine().gfx[k037122->gfx_index] = auto_alloc(device->machine(), gfx_element | |
| 10183 | 10183 | |
| 10184 | 10184 | device->save_pointer(NAME(k037122->reg), 0x400 / 4); |
| 10185 | 10185 | device->save_pointer(NAME(k037122->char_ram), 0x200000 / 4); |
| r17669 | r17670 | |
|---|---|---|
| 19 | 19 | int offs, pri_code; |
| 20 | 20 | int sortedlist[NUM_SPRITES]; |
| 21 | 21 | |
| 22 | machine.gfx[0]->color | |
| 22 | machine.gfx[0]->set_color | |
| 23 | 23 | |
| 24 | 24 | for (offs = 0; offs < NUM_SPRITES; offs++) |
| 25 | 25 | sortedlist[offs] = -1; |
| r17669 | r17670 | |
|---|---|---|
| 102 | 102 | { |
| 103 | 103 | mustache_state *state = machine.driver_data<mustache_state>(); |
| 104 | 104 | rectangle clip = cliprect; |
| 105 | | |
| 105 | | |
| 106 | 106 | const rectangle &visarea = machine.primary_screen->visible_area(); |
| 107 | 107 | UINT8 *spriteram = state->m_spriteram; |
| 108 | 108 | int offs; |
| r17669 | r17670 | |
|---|---|---|
| 377 | 377 | |
| 378 | 378 | |
| 379 | 379 | INLINE void zdrawgfxzoom32GP( |
| 380 | bitmap_rgb32 &bitmap, const rectangle &cliprect, | |
| 380 | bitmap_rgb32 &bitmap, const rectangle &cliprect, | |
| 381 | 381 | UINT32 code, UINT32 color, int flipx, int flipy, int sx, int sy, |
| 382 | 382 | int scalex, int scaley, int alpha, int drawmode, int zcode, int pri) |
| 383 | 383 | { |
| r17669 | r17670 | |
| 416 | 416 | if (!scalex || !scaley) return; |
| 417 | 417 | |
| 418 | 418 | // find shadow pens and cull invisible shadows |
| 419 | granularity = shdpen = gfx-> | |
| 419 | granularity = shdpen = gfx-> | |
| 420 | 420 | shdpen--; |
| 421 | 421 | |
| 422 | 422 | if (zcode >= 0) |
| r17669 | r17670 | |
| 440 | 440 | src_pitch = 16; |
| 441 | 441 | src_fw = 16; |
| 442 | 442 | src_fh = 16; |
| 443 | src_base = gfx | |
| 443 | src_base = gfx-> | |
| 444 | 444 | |
| 445 | pal_base = gfx->machine().pens + gfx->color | |
| 445 | pal_base = gfx->machine().pens + gfx->color | |
| 446 | 446 | shd_base = gfx->machine().shadow_table; |
| 447 | 447 | |
| 448 | 448 | dst_ptr = &bitmap.pix32(0); |
| r17669 | r17670 | |
|---|---|---|
| 515 | 515 | static void bootleg_draw_sprites( running_machine &machine, bitmap_ind16 &bitmap, const rectangle &cliprect, const UINT8 *source, int circuit ) |
| 516 | 516 | { |
| 517 | 517 | address_space *space = machine.device("maincpu")->memory().space(AS_PROGRAM); |
| 518 | | |
| 518 | | |
| 519 | 519 | |
| 520 | 520 | int limit = circuit ? (space->read_byte(0xc2) * 256 + space->read_byte(0xc3)) : (space->read_byte(0xc0) * 256 + space->read_byte(0xc1)); |
| 521 | 521 | const UINT8 *finish; |
| r17669 | r17670 | |
|---|---|---|
| 20 | 20 | state->save_item(NAME(state->m_tmp_bitmap1)); |
| 21 | 21 | state->save_item(NAME(state->m_tmp_bitmap2)); |
| 22 | 22 | |
| 23 | | |
| 23 | | |
| 24 | 24 | } |
| 25 | 25 | |
| 26 | 26 | |
| r17669 | r17670 | |
| 30 | 30 | if (m_charram[offset] != data) |
| 31 | 31 | { |
| 32 | 32 | m_charram[offset] = data; |
| 33 | | |
| 33 | | |
| 34 | 34 | } |
| 35 | 35 | } |
| 36 | 36 | |
| r17669 | r17670 | |
| 205 | 205 | code = 8 * (lookup[pos] | ((lookup[pos + 1] & 0x07) << 8)); |
| 206 | 206 | realflipy = (lookup[pos + 1] & 0x80) ? !flipy : flipy; |
| 207 | 207 | code += (realflipy ? (charline ^ 7) : charline); |
| 208 | pendata = | |
| 208 | pendata = | |
| 209 | 209 | |
| 210 | 210 | for (x = 0; x < 16; x++) |
| 211 | 211 | { |
| r17669 | r17670 | |
|---|---|---|
| 393 | 393 | |
| 394 | 394 | rect.min_x = get_sprite_hpos(state, 13); |
| 395 | 395 | rect.min_y = get_sprite_vpos(state, 13); |
| 396 | rect.max_x = rect.min_x + screen.machine().gfx[1]->width - 1; | |
| 397 | rect.max_y = rect.min_y + screen.machine().gfx[1]->height - 1; | |
| 396 | rect.max_x = rect.min_x + screen.machine().gfx[1]->width() - 1; | |
| 397 | rect.max_y = rect.min_y + screen.machine().gfx[1]->height() - 1; | |
| 398 | 398 | |
| 399 | 399 | rect &= state->m_helper.cliprect(); |
| 400 | 400 |
| r17669 | r17670 | |
|---|---|---|
| 17 | 17 | **- End of Comments -*/ |
| 18 | 18 | |
| 19 | 19 | bigstrkb_state *state = machine.driver_data<bigstrkb_state>(); |
| 20 | | |
| 20 | | |
| 21 | 21 | UINT16 *source = state->m_spriteram; |
| 22 | 22 | UINT16 *finish = source + 0x800/2; |
| 23 | 23 |
| r17669 | r17670 | |
|---|---|---|
| 283 | 283 | m_spritebank_buffered[7] = m_spritebank_buffered[6] + 0x400; |
| 284 | 284 | } |
| 285 | 285 | |
| 286 | static void taito_f2_tc360_spritemixdraw( running_machine &machine, bitmap_ind16 &dest_bmp, const rectangle &clip, | |
| 286 | static void taito_f2_tc360_spritemixdraw( running_machine &machine, bitmap_ind16 &dest_bmp, const rectangle &clip, | |
| 287 | 287 | UINT32 code, UINT32 color, int flipx, int flipy, int sx, int sy, int scalex, int scaley ) |
| 288 | 288 | { |
| 289 | 289 | taitof2_state *state = machine.driver_data<taitof2_state>(); |
| 290 | int pal_base = gfx->color_base + gfx->color_granularity * (color % gfx->total_colors); | |
| 291 | const UINT8 *source_base = gfx_element_get_data(gfx, code % gfx->total_elements); | |
| 290 | int pal_base = gfx->colorbase() + gfx->granularity() * (color % gfx->colors()); | |
| 291 | const UINT8 *source_base = gfx->get_data(code % gfx->elements()); | |
| 292 | 292 | bitmap_ind8 &priority_bitmap = gfx->machine().priority_bitmap; |
| 293 | int sprite_screen_height = (scaley * gfx->height + 0x8000) >> 16; | |
| 294 | int sprite_screen_width = (scalex * gfx->width + 0x8000) >> 16; | |
| 293 | int sprite_screen_height = (scaley * gfx->height() + 0x8000) >> 16; | |
| 294 | int sprite_screen_width = (scalex * gfx->width() + 0x8000) >> 16; | |
| 295 | 295 | |
| 296 | 296 | if (!scalex || !scaley) |
| 297 | 297 | return; |
| r17669 | r17670 | |
| 299 | 299 | if (sprite_screen_width && sprite_screen_height) |
| 300 | 300 | { |
| 301 | 301 | /* compute sprite increment per screen pixel */ |
| 302 | int dx = (gfx->width << 16) / sprite_screen_width; | |
| 303 | int dy = (gfx->height << 16) / sprite_screen_height; | |
| 302 | int dx = (gfx->width() << 16) / sprite_screen_width; | |
| 303 | int dy = (gfx->height() << 16) / sprite_screen_height; | |
| 304 | 304 | |
| 305 | 305 | int ex = sx + sprite_screen_width; |
| 306 | 306 | int ey = sy + sprite_screen_height; |
| r17669 | r17670 | |
| 359 | 359 | |
| 360 | 360 | for (y = sy; y < ey; y++) |
| 361 | 361 | { |
| 362 | const UINT8 *source = source_base + (y_index >> 16) * gfx-> | |
| 362 | const UINT8 *source = source_base + (y_index >> 16) * gfx->r | |
| 363 | 363 | UINT16 *dest = &dest_bmp.pix16(y); |
| 364 | 364 | UINT8 *pri = &priority_bitmap.pix8(y); |
| 365 | 365 | |
| r17669 | r17670 | |
| 759 | 759 | { |
| 760 | 760 | sprite_ptr->code = code; |
| 761 | 761 | sprite_ptr->color = color; |
| 762 | if (machine.gfx[0]-> | |
| 762 | if (machine.gfx[0]-> | |
| 763 | 763 | sprite_ptr->color /= 4; |
| 764 | 764 | sprite_ptr->flipx = flipx; |
| 765 | 765 | sprite_ptr->flipy = flipy; |
| r17669 | r17670 | |
|---|---|---|
| 109 | 109 | if (m_charram[offset] != data) |
| 110 | 110 | { |
| 111 | 111 | m_charram[offset] = data; |
| 112 | | |
| 112 | | |
| 113 | 113 | } |
| 114 | 114 | } |
| 115 | 115 | |
| r17669 | r17670 | |
| 163 | 163 | state->m_bg_tilemap->set_transparent_pen(0); |
| 164 | 164 | state->m_bg_tilemap->set_scrolldx(0, 318 - 256); |
| 165 | 165 | |
| 166 | | |
| 166 | | |
| 167 | 167 | |
| 168 | 168 | /* save some state */ |
| 169 | 169 | state_save_register_global(machine, state->m_background_priority); |
| r17669 | r17670 | |
| 190 | 190 | state->m_bg_tilemap->set_transparent_pen(0); |
| 191 | 191 | state->m_bg_tilemap->set_scrolldx(0, 318 - 256); |
| 192 | 192 | |
| 193 | | |
| 193 | | |
| 194 | 194 | |
| 195 | 195 | /* save some state */ |
| 196 | 196 | state_save_register_global(machine, state->m_background_priority); |
| r17669 | r17670 | |
|---|---|---|
| 155 | 155 | static void draw_sprites( running_machine& machine, bitmap_ind16 &bitmap,const rectangle &cliprect ) |
| 156 | 156 | { |
| 157 | 157 | ddragon_state *state = machine.driver_data<ddragon_state>(); |
| 158 | | |
| 158 | | |
| 159 | 159 | |
| 160 | 160 | UINT8 *src; |
| 161 | 161 | int i; |
| r17669 | r17670 | |
|---|---|---|
| 82 | 82 | } |
| 83 | 83 | |
| 84 | 84 | |
| 85 | static void draw_sprites(bitmap_ind16 &bitmap, const rectangle &cliprect, | |
| 85 | static void draw_sprites(bitmap_ind16 &bitmap, const rectangle &cliprect, | |
| 86 | 86 | { |
| 87 | 87 | xxmissio_state *state = gfx->machine().driver_data<xxmissio_state>(); |
| 88 | 88 | int offs; |
| r17669 | r17670 | |
|---|---|---|
| 28 | 28 | mugsmash_state *state = machine.driver_data<mugsmash_state>(); |
| 29 | 29 | const UINT16 *source = state->m_spriteram; |
| 30 | 30 | const UINT16 *finish = source + 0x2000; |
| 31 | | |
| 31 | | |
| 32 | 32 | |
| 33 | 33 | while (source < finish) |
| 34 | 34 | { |
| r17669 | r17670 | |
|---|---|---|
| 92 | 92 | while (0) \ |
| 93 | 93 | |
| 94 | 94 | |
| 95 | static void pdrawgfx_transpen_additive(bitmap_rgb32 &dest, const rectangle &cliprect, | |
| 95 | static void pdrawgfx_transpen_additive(bitmap_rgb32 &dest, const rectangle &cliprect, | |
| 96 | 96 | UINT32 code, UINT32 color, int flipx, int flipy, INT32 destx, INT32 desty, |
| 97 | 97 | bitmap_ind8 &priority, UINT32 pmask, UINT32 transpen) |
| 98 | 98 | { |
| r17669 | r17670 | |
| 103 | 103 | assert(gfx != NULL); |
| 104 | 104 | |
| 105 | 105 | /* get final code and color, and grab lookup tables */ |
| 106 | code %= gfx->total_elements; | |
| 107 | color %= gfx->total_colors; | |
| 108 | paldata = &gfx->machine().pens[gfx->color_base + gfx->color_granularity * color]; | |
| 106 | code %= gfx->elements(); | |
| 107 | color %= gfx->colors(); | |
| 108 | paldata = &gfx->machine().pens[gfx->colorbase() + gfx->granularity() * color]; | |
| 109 | 109 | |
| 110 | 110 | /* use pen usage to optimize */ |
| 111 | if (gfx->pen_usage | |
| 111 | if (gfx->has_pen_usage() | |
| 112 | 112 | { |
| 113 | UINT32 usage = gfx->pen_usage | |
| 113 | UINT32 usage = gfx->pen_usage(code); | |
| 114 | 114 | |
| 115 | 115 | /* fully transparent; do nothing */ |
| 116 | 116 | if ((usage & ~(1 << transpen)) == 0) |
| r17669 | r17670 | |
| 125 | 125 | } |
| 126 | 126 | |
| 127 | 127 | |
| 128 | static void pdrawgfxzoom_transpen_additive(bitmap_rgb32 &dest, const rectangle &cliprect, | |
| 128 | static void pdrawgfxzoom_transpen_additive(bitmap_rgb32 &dest, const rectangle &cliprect, | |
| 129 | 129 | UINT32 code, UINT32 color, int flipx, int flipy, INT32 destx, INT32 desty, |
| 130 | 130 | UINT32 scalex, UINT32 scaley, bitmap_ind8 &priority, UINT32 pmask, |
| 131 | 131 | UINT32 transpen) |
| r17669 | r17670 | |
| 145 | 145 | assert(gfx != NULL); |
| 146 | 146 | |
| 147 | 147 | /* get final code and color, and grab lookup tables */ |
| 148 | code %= gfx->total_elements; | |
| 149 | color %= gfx->total_colors; | |
| 150 | paldata = &gfx->machine().pens[gfx->color_base + gfx->color_granularity * color]; | |
| 148 | code %= gfx->elements(); | |
| 149 | color %= gfx->colors(); | |
| 150 | paldata = &gfx->machine().pens[gfx->colorbase() + gfx->granularity() * color]; | |
| 151 | 151 | |
| 152 | 152 | /* use pen usage to optimize */ |
| 153 | if (gfx->pen_usage | |
| 153 | if (gfx->has_pen_usage() | |
| 154 | 154 | { |
| 155 | UINT32 usage = gfx->pen_usage | |
| 155 | UINT32 usage = gfx->pen_usage(code); | |
| 156 | 156 | |
| 157 | 157 | /* fully transparent; do nothing */ |
| 158 | 158 | if ((usage & ~(1 << transpen)) == 0) |
| r17669 | r17670 | |
| 210 | 210 | static void draw_sprites(running_machine &machine, bitmap_rgb32 &bitmap, const rectangle &cliprect) |
| 211 | 211 | { |
| 212 | 212 | hng64_state *state = machine.driver_data<hng64_state>(); |
| 213 | | |
| 213 | | |
| 214 | 214 | UINT32 *source = state->m_spriteram; |
| 215 | 215 | UINT32 *finish = state->m_spriteram + 0xc000/4; |
| 216 | 216 |
| r17669 | r17670 | |
|---|---|---|
| 158 | 158 | state->m_scrb_tilemap->set_transparent_pen(0); |
| 159 | 159 | state->m_scrc_tilemap->set_transparent_pen(0); |
| 160 | 160 | |
| 161 | machine.gfx[0]->color_granularity = 64; | |
| 162 | machine.gfx[1]->color_granularity = 64; | |
| 163 | machine.gfx[2]->color_granularity = 64; | |
| 164 | machine.gfx[3]->color_granularity = 64; | |
| 161 | machine.gfx[0]->set_granularity(64); | |
| 162 | machine.gfx[1]->set_granularity(64); | |
| 163 | machine.gfx[2]->set_granularity(64); | |
| 164 | machine.gfx[3]->set_granularity(64); | |
| 165 | 165 | |
| 166 | 166 | state->save_pointer(NAME(state->m_spriteram_old), state->m_spriteram.bytes() / 4); |
| 167 | 167 | state->save_pointer(NAME(state->m_spriteram_old2), state->m_spriteram.bytes() / 4); |
| r17669 | r17670 | |
| 172 | 172 | static void draw_sprites(running_machine &machine, bitmap_rgb32 &bitmap, const rectangle &cliprect, int priority ) |
| 173 | 173 | { |
| 174 | 174 | macrossp_state *state = machine.driver_data<macrossp_state>(); |
| 175 | | |
| 175 | | |
| 176 | 176 | // UINT32 *source = state->m_spriteram; |
| 177 | 177 | UINT32 *source = state->m_spriteram_old2; /* buffers by two frames */ |
| 178 | 178 | UINT32 *finish = source + state->m_spriteram.bytes() / 4; |
| r17669 | r17670 | |
|---|---|---|
| 149 | 149 | |
| 150 | 150 | void taitol_chardef14_m( running_machine &machine, int offset ) |
| 151 | 151 | { |
| 152 | | |
| 152 | | |
| 153 | 153 | } |
| 154 | 154 | |
| 155 | 155 | void taitol_chardef15_m( running_machine &machine, int offset ) |
| 156 | 156 | { |
| 157 | | |
| 157 | | |
| 158 | 158 | } |
| 159 | 159 | |
| 160 | 160 | void taitol_chardef16_m( running_machine &machine, int offset ) |
| 161 | 161 | { |
| 162 | | |
| 162 | | |
| 163 | 163 | } |
| 164 | 164 | |
| 165 | 165 | void taitol_chardef17_m( running_machine &machine, int offset ) |
| 166 | 166 | { |
| 167 | | |
| 167 | | |
| 168 | 168 | } |
| 169 | 169 | |
| 170 | 170 | void taitol_chardef1c_m( running_machine &machine, int offset ) |
| 171 | 171 | { |
| 172 | | |
| 172 | | |
| 173 | 173 | } |
| 174 | 174 | |
| 175 | 175 | void taitol_chardef1d_m( running_machine &machine, int offset ) |
| 176 | 176 | { |
| 177 | | |
| 177 | | |
| 178 | 178 | } |
| 179 | 179 | |
| 180 | 180 | void taitol_chardef1e_m( running_machine &machine, int offset ) |
| 181 | 181 | { |
| 182 | | |
| 182 | | |
| 183 | 183 | } |
| 184 | 184 | |
| 185 | 185 | void taitol_chardef1f_m( running_machine &machine, int offset ) |
| 186 | 186 | { |
| 187 | | |
| 187 | | |
| 188 | 188 | } |
| 189 | 189 | |
| 190 | 190 | void taitol_bg18_m( running_machine &machine, int offset ) |
| r17669 | r17670 | |
|---|---|---|
| 162 | 162 | int code2 = code; |
| 163 | 163 | |
| 164 | 164 | int color = ((flags >> 1) & 0x03) | ((code >> 5) & 0x04) | (code & 0x08) | (state->m_sprite_palette * 16); |
| 165 | | |
| 165 | | |
| 166 | 166 | |
| 167 | 167 | if (state->m_cocktail_flip) |
| 168 | 168 | { |
| 169 | x = 64 * 8 - gfx->width - x; | |
| 170 | y = 32 * 8 - gfx->height - y; | |
| 171 | if (wide) y -= gfx->height; | |
| 169 | x = 64 * 8 - gfx->width() - x; | |
| 170 | y = 32 * 8 - gfx->height() - y; | |
| 171 | if (wide) y -= gfx->height(); | |
| 172 | 172 | xflip = !xflip; |
| 173 | 173 | yflip = !yflip; |
| 174 | 174 | } |
| r17669 | r17670 | |
| 180 | 180 | else |
| 181 | 181 | code &= ~0x10, code2 |= 0x10; |
| 182 | 182 | |
| 183 | drawgfx_transpen(bitmap, cliprect, gfx, code2, color, xflip, yflip, x, y + gfx->height, 0); | |
| 183 | drawgfx_transpen(bitmap, cliprect, gfx, code2, color, xflip, yflip, x, y + gfx->height(), 0); | |
| 184 | 184 | } |
| 185 | 185 | |
| 186 | 186 | if(flags&0x10) |
| 187 | 187 | { |
| 188 | drawgfx_transpen(bitmap, cliprect, gfx, code2 + 16, color, xflip, yflip, x, y + gfx->height, 0); | |
| 189 | drawgfx_transpen(bitmap, cliprect, gfx, code2 + 16 * 2, color, xflip, yflip, x, y + 2 * gfx->height, 0); | |
| 190 | drawgfx_transpen(bitmap, cliprect, gfx, code2 + 16 * 3, color, xflip, yflip, x, y + 3 * gfx->height, 0); | |
| 188 | drawgfx_transpen(bitmap, cliprect, gfx, code2 + 16, color, xflip, yflip, x, y + gfx->height(), 0); | |
| 189 | drawgfx_transpen(bitmap, cliprect, gfx, code2 + 16 * 2, color, xflip, yflip, x, y + 2 * gfx->height(), 0); | |
| 190 | drawgfx_transpen(bitmap, cliprect, gfx, code2 + 16 * 3, color, xflip, yflip, x, y + 3 * gfx->height(), 0); | |
| 191 | 191 | |
| 192 | 192 | } |
| 193 | 193 |
| r17669 | r17670 | |
|---|---|---|
| 151 | 151 | { |
| 152 | 152 | thoop2_state *state = machine.driver_data<thoop2_state>(); |
| 153 | 153 | int j, x, y, ex, ey; |
| 154 | | |
| 154 | | |
| 155 | 155 | |
| 156 | 156 | static const int x_offset[2] = {0x0,0x2}; |
| 157 | 157 | static const int y_offset[2] = {0x0,0x1}; |
| r17669 | r17670 | |
|---|---|---|
| 165 | 165 | **- End of Comments -*/ |
| 166 | 166 | |
| 167 | 167 | UINT16 *buffered_spriteram16 = state->m_spriteram->buffer(); |
| 168 | | |
| 168 | | |
| 169 | 169 | UINT16 *source = buffered_spriteram16; |
| 170 | 170 | UINT16 *finish = source + 0x2000/2; |
| 171 | 171 |
| r17669 | r17670 | |
|---|---|---|
| 214 | 214 | |
| 215 | 215 | if (!state->m_flipscreen_y) |
| 216 | 216 | { |
| 217 | sy = 256 - screen.machine().gfx[gfx]->width - sy; | |
| 217 | sy = 256 - screen.machine().gfx[gfx]->width() - sy; | |
| 218 | 218 | flipy = !flipy; |
| 219 | 219 | } |
| 220 | 220 | |
| r17669 | r17670 | |
| 257 | 257 | |
| 258 | 258 | if (!state->m_flipscreen_y) |
| 259 | 259 | { |
| 260 | sy = 256 - screen.machine().gfx[1]->width - sy; | |
| 260 | sy = 256 - screen.machine().gfx[1]->width() - sy; | |
| 261 | 261 | flipy = !flipy; |
| 262 | 262 | } |
| 263 | 263 | |
| r17669 | r17670 | |
| 284 | 284 | |
| 285 | 285 | if (!state->m_flipscreen_y) |
| 286 | 286 | { |
| 287 | sy = 256 - screen.machine().gfx[2]->width - sy; | |
| 287 | sy = 256 - screen.machine().gfx[2]->width() - sy; | |
| 288 | 288 | flipy = !flipy; |
| 289 | 289 | } |
| 290 | 290 | |
| r17669 | r17670 | |
| 353 | 353 | |
| 354 | 354 | if (!state->m_flipscreen_y) |
| 355 | 355 | { |
| 356 | sy = 256 - screen.machine().gfx[gfx]->width - sy; | |
| 356 | sy = 256 - screen.machine().gfx[gfx]->width() - sy; | |
| 357 | 357 | flipy = !flipy; |
| 358 | 358 | } |
| 359 | 359 | |
| r17669 | r17670 | |
| 396 | 396 | |
| 397 | 397 | if (!state->m_flipscreen_y) |
| 398 | 398 | { |
| 399 | sy = 256 - screen.machine().gfx[1]->width - sy; | |
| 399 | sy = 256 - screen.machine().gfx[1]->width() - sy; | |
| 400 | 400 | flipy = !flipy; |
| 401 | 401 | } |
| 402 | 402 | |
| 403 | 403 | if (state->m_flipscreen_x) |
| 404 | 404 | { |
| 405 | sx = 256 - screen.machine().gfx[1]->width - sx; | |
| 405 | sx = 256 - screen.machine().gfx[1]->width() - sx; | |
| 406 | 406 | flipx = !flipx; |
| 407 | 407 | } |
| 408 | 408 | |
| r17669 | r17670 | |
| 456 | 456 | |
| 457 | 457 | if (!state->m_flipscreen_y) |
| 458 | 458 | { |
| 459 | sy = 256 - screen.machine().gfx[gfx]->width - sy; | |
| 459 | sy = 256 - screen.machine().gfx[gfx]->width() - sy; | |
| 460 | 460 | flipy = !flipy; |
| 461 | 461 | } |
| 462 | 462 |
| r17669 | r17670 | |
|---|---|---|
| 105 | 105 | state->m_tilemap[2]->set_transparent_pen(0x0f); // 4 bits |
| 106 | 106 | state->m_tilemap[3]->set_transparent_pen(0x0f); // 4 bits |
| 107 | 107 | |
| 108 | machine.gfx[2]-> | |
| 108 | machine.gfx[2]->set | |
| 109 | 109 | } |
| 110 | 110 | |
| 111 | 111 | |
| r17669 | r17670 | |
| 140 | 140 | { |
| 141 | 141 | fuuki16_state *state = screen.machine().driver_data<fuuki16_state>(); |
| 142 | 142 | int offs; |
| 143 | | |
| 143 | | |
| 144 | 144 | bitmap_ind8 &priority_bitmap = screen.machine().priority_bitmap; |
| 145 | 145 | const rectangle &visarea = screen.visible_area(); |
| 146 | 146 | UINT16 *spriteram16 = state->m_spriteram; |
| r17669 | r17670 | |
|---|---|---|
| 52 | 52 | |
| 53 | 53 | |
| 54 | 54 | /* characters use colors 32-47 (?) */ |
| 55 | for (i = 0;i < machine.gfx[0]->total_colors * machine.gfx[0]->color_granularity;i++) | |
| 56 | colortable_entry_set_value(machine.colortable, machine.gfx[0]->color_base + i, 32 + *color_prom++); | |
| 55 | for (i = 0;i < machine.gfx[0]->colors() * machine.gfx[0]->granularity();i++) | |
| 56 | colortable_entry_set_value(machine.colortable, machine.gfx[0]->colorbase() + i, 32 + *color_prom++); | |
| 57 | 57 | |
| 58 | 58 | /* sprites use colors 16-31 */ |
| 59 | for (i = 0;i < machine.gfx[2]->total_colors * machine.gfx[2]->color_granularity;i++) | |
| 60 | colortable_entry_set_value(machine.colortable, machine.gfx[2]->color_base + i, 16 + *color_prom++); | |
| 59 | for (i = 0;i < machine.gfx[2]->colors() * machine.gfx[2]->granularity();i++) | |
| 60 | colortable_entry_set_value(machine.colortable, machine.gfx[2]->colorbase() + i, 16 + *color_prom++); | |
| 61 | 61 | |
| 62 | 62 | /* background tiles use colors 0-15, 64-79, 128-143, 192-207 in four banks */ |
| 63 | for (i = 0;i < machine.gfx[1]-> | |
| 63 | for (i = 0;i < machine.gfx[1]-> | |
| 64 | 64 | { |
| 65 | colortable_entry_set_value(machine.colortable, machine.gfx[1]->color_base + 0*32*8 + i, *color_prom); | |
| 66 | colortable_entry_set_value(machine.colortable, machine.gfx[1]->color_base + 1*32*8 + i, *color_prom + 64); | |
| 67 | colortable_entry_set_value(machine.colortable, machine.gfx[1]->color_base + 2*32*8 + i, *color_prom + 128); | |
| 68 | colortable_entry_set_value(machine.colortable, machine.gfx[1]->color_base + 3*32*8 + i, *color_prom + 192); | |
| 65 | colortable_entry_set_value(machine.colortable, machine.gfx[1]->colorbase() + 0*32*8 + i, *color_prom); | |
| 66 | colortable_entry_set_value(machine.colortable, machine.gfx[1]->colorbase() + 1*32*8 + i, *color_prom + 64); | |
| 67 | colortable_entry_set_value(machine.colortable, machine.gfx[1]->colorbase() + 2*32*8 + i, *color_prom + 128); | |
| 68 | colortable_entry_set_value(machine.colortable, machine.gfx[1]->colorbase() + 3*32*8 + i, *color_prom + 192); | |
| 69 | 69 | color_prom++; |
| 70 | 70 | } |
| 71 | 71 | } |
| r17669 | r17670 | |
|---|---|---|
| 67 | 67 | sderby_state *state = machine.driver_data<sderby_state>(); |
| 68 | 68 | UINT16 *spriteram16 = state->m_spriteram; |
| 69 | 69 | int offs; |
| 70 | int height = machine.gfx[0]->height; | |
| 71 | int colordiv = machine.gfx[0]->color_granularity / 16; | |
| 70 | int height = machine.gfx[0]->height(); | |
| 71 | int colordiv = machine.gfx[0]->granularity() / 16; | |
| 72 | 72 | |
| 73 | 73 | for (offs = 4;offs < state->m_spriteram.bytes()/2;offs += 4) |
| 74 | 74 | { |
| r17669 | r17670 | |
|---|---|---|
| 63 | 63 | static void draw_sprite_collision( running_machine &machine, bitmap_ind16 &bitmap, const rectangle &cliprect ) |
| 64 | 64 | { |
| 65 | 65 | circus_state *state = machine.driver_data<circus_state>(); |
| 66 | const gfx_element *sprite_gfx = machine.gfx[1]; | |
| 67 | const UINT8 *sprite_data = gfx_element_get_data(sprite_gfx, state->m_clown_z); | |
| 66 | gfx_element *sprite_gfx = machine.gfx[1]; | |
| 67 | const UINT8 *sprite_data = sprite_gfx->get_data(state->m_clown_z); | |
| 68 | 68 | int sx, sy, dx, dy; |
| 69 | 69 | int pixel, collision = 0; |
| 70 | 70 | |
| r17669 | r17670 | |
| 79 | 79 | dx = state->m_clown_y + sx; |
| 80 | 80 | if (dx>=0 && dx<bitmap.width()) |
| 81 | 81 | { |
| 82 | pixel = sprite_data[sy * sprite_gfx-> | |
| 82 | pixel = sprite_data[sy * sprite_gfx->r | |
| 83 | 83 | if (pixel) |
| 84 | 84 | { |
| 85 | 85 | collision |= bitmap.pix16(dy, dx); |
| r17669 | r17670 | |
|---|---|---|
| 31 | 31 | WRITE8_MEMBER(zac2650_state::zac_s2636_w) |
| 32 | 32 | { |
| 33 | 33 | m_s2636_0_ram[offset] = data; |
| 34 | gfx_element_mark_dirty(machine().gfx[1], offset/8); | |
| 35 | gfx_element_mark_dirty(machine().gfx[2], offset/8); | |
| 34 | machine().gfx[1]->mark_dirty(offset/8); | |
| 35 | machine().gfx[2]->mark_dirty(offset/8); | |
| 36 | 36 | if (offset == 0xc7) |
| 37 | 37 | { |
| 38 | 38 | s2636_soundport_w(machine().device("s2636snd"), 0, data); |
| r17669 | r17670 | |
| 71 | 71 | |
| 72 | 72 | /* Get fingerprint */ |
| 73 | 73 | |
| 74 | for (x = fx; x < fx + machine.gfx[expand]->width; x++) | |
| 74 | for (x = fx; x < fx + machine.gfx[expand]->width(); x++) | |
| 75 | 75 | { |
| 76 | for (y = fy; y < fy + machine.gfx[expand]->height; y++) | |
| 76 | for (y = fy; y < fy + machine.gfx[expand]->height(); y++) | |
| 77 | 77 | { |
| 78 | 78 | if (visarea.contains(x, y)) |
| 79 | 79 | Checksum += state->m_spritebitmap.pix16(y, x); |
| r17669 | r17670 | |
| 90 | 90 | |
| 91 | 91 | /* Remove fingerprint */ |
| 92 | 92 | |
| 93 | for (x = fx; x < fx + machine.gfx[expand]->width; x++) | |
| 93 | for (x = fx; x < fx + machine.gfx[expand]->width(); x++) | |
| 94 | 94 | { |
| 95 | for (y = fy; y < fy + machine.gfx[expand]->height; y++) | |
| 95 | for (y = fy; y < fy + machine.gfx[expand]->height(); y++) | |
| 96 | 96 | { |
| 97 | 97 | if (visarea.contains(x, y)) |
| 98 | 98 | Checksum -= state->m_spritebitmap.pix16(y, x); |
| r17669 | r17670 | |
| 129 | 129 | machine.primary_screen->register_screen_bitmap(state->m_bitmap); |
| 130 | 130 | machine.primary_screen->register_screen_bitmap(state->m_spritebitmap); |
| 131 | 131 | |
| 132 | gfx_element_set_source(machine.gfx[1], state->m_s2636_0_ram); | |
| 133 | gfx_element_set_source(machine.gfx[2], state->m_s2636_0_ram); | |
| 132 | machine.gfx[1]->set_source(state->m_s2636_0_ram); | |
| 133 | machine.gfx[2]->set_source(state->m_s2636_0_ram); | |
| 134 | 134 | } |
| 135 | 135 | |
| 136 | 136 | static void draw_sprites(running_machine &machine, bitmap_ind16 &bitmap, const rectangle &cliprect) |
| r17669 | r17670 | |
| 172 | 172 | 0,0, |
| 173 | 173 | bx,by, 0); |
| 174 | 174 | |
| 175 | for (x = bx; x < bx + machine.gfx[expand]->width; x++) | |
| 175 | for (x = bx; x < bx + machine.gfx[expand]->width(); x++) | |
| 176 | 176 | { |
| 177 | for (y = by; y < by + machine.gfx[expand]->height; y++) | |
| 177 | for (y = by; y < by + machine.gfx[expand]->height(); y++) | |
| 178 | 178 | { |
| 179 | 179 | if (visarea.contains(x, y)) |
| 180 | 180 | if (bitmap.pix16(y, x) != state->m_bitmap.pix16(y, x)) |
| r17669 | r17670 | |
|---|---|---|
| 41 | 41 | int x,y; |
| 42 | 42 | |
| 43 | 43 | UINT16 *source = &state->m_spriteram_older[spriteno*4]; |
| 44 | | |
| 44 | | |
| 45 | 45 | |
| 46 | 46 | |
| 47 | 47 | int yzoom = (source[0] & 0xf000) >> 12; |
| r17669 | r17670 | |
|---|---|---|
| 87 | 87 | relief_state *state = machine.driver_data<relief_state>(); |
| 88 | 88 | |
| 89 | 89 | /* MOs are 5bpp but with a 4-bit color granularity */ |
| 90 | machine.gfx[1]-> | |
| 90 | machine.gfx[1]->set | |
| 91 | 91 | |
| 92 | 92 | /* initialize the playfield */ |
| 93 | 93 | state->m_playfield_tilemap = tilemap_create(machine, get_playfield_tile_info, TILEMAP_SCAN_COLS, 8,8, 64,64); |
| r17669 | r17670 | |
|---|---|---|
| 649 | 649 | state->m_pf_line_inf = auto_alloc_array(machine, struct f3_playfield_line_inf, 5); |
| 650 | 650 | state->m_sa_line_inf = auto_alloc_array(machine, struct f3_spritealpha_line_inf, 1); |
| 651 | 651 | machine.primary_screen->register_screen_bitmap(state->m_pri_alp_bitmap); |
| 652 | state->m_tile_opaque_sp = auto_alloc_array(machine, UINT8, machine.gfx[2]-> | |
| 652 | state->m_tile_opaque_sp = auto_alloc_array(machine, UINT8, machine.gfx[2]-> | |
| 653 | 653 | for (i=0; i<8; i++) |
| 654 | state->m_tile_opaque_pf[i] = auto_alloc_array(machine, UINT8, machine.gfx[1]-> | |
| 654 | state->m_tile_opaque_pf[i] = auto_alloc_array(machine, UINT8, machine.gfx[1]-> | |
| 655 | 655 | |
| 656 | 656 | |
| 657 | 657 | state->m_vram_layer->set_transparent_pen(0); |
| r17669 | r17670 | |
| 659 | 659 | |
| 660 | 660 | /* Palettes have 4 bpp indexes despite up to 6 bpp data. The unused */ |
| 661 | 661 | /* top bits in the gfx data are cleared later. */ |
| 662 | machine.gfx[1]->color_granularity=16; | |
| 663 | machine.gfx[2]->color_granularity=16; | |
| 662 | machine.gfx[1]->set_granularity(16); | |
| 663 | machine.gfx[2]->set_granularity(16); | |
| 664 | 664 | |
| 665 | 665 | state->m_flipscreen = 0; |
| 666 | 666 | memset(state->m_spriteram16_buffered,0,0x10000); |
| r17669 | r17670 | |
| 669 | 669 | state_save_register_global_array(machine, state->m_f3_control_0); |
| 670 | 670 | state_save_register_global_array(machine, state->m_f3_control_1); |
| 671 | 671 | |
| 672 | gfx_element_set_source(machine.gfx[0], (UINT8 *)state->m_f3_vram); | |
| 673 | gfx_element_set_source(machine.gfx[3], (UINT8 *)state->m_f3_pivot_ram); | |
| 672 | machine.gfx[0]->set_source((UINT8 *)state->m_f3_vram); | |
| 673 | machine.gfx[3]->set_source((UINT8 *)state->m_f3_pivot_ram); | |
| 674 | 674 | |
| 675 | 675 | state->m_f3_skip_this_frame=0; |
| 676 | 676 | |
| r17669 | r17670 | |
| 679 | 679 | init_alpha_blend_func(machine); |
| 680 | 680 | |
| 681 | 681 | { |
| 682 | | |
| 682 | | |
| 683 | 683 | int c; |
| 684 | 684 | |
| 685 | for (c = 0;c < sprite_gfx-> | |
| 685 | for (c = 0;c < sprite_gfx-> | |
| 686 | 686 | { |
| 687 | 687 | int x,y; |
| 688 | 688 | int chk_trans_or_opa=0; |
| 689 | const UINT8 *dp = gfx_element_get_data(sprite_gfx, c); | |
| 690 | for (y = 0;y < sprite_gfx->height;y++) | |
| 689 | const UINT8 *dp = sprite_gfx->get_data(c); | |
| 690 | for (y = 0;y < sprite_gfx->height();y++) | |
| 691 | 691 | { |
| 692 | for (x = 0;x < sprite_gfx->width;x++) | |
| 692 | for (x = 0;x < sprite_gfx->width();x++) | |
| 693 | 693 | { |
| 694 | 694 | if(!dp[x]) chk_trans_or_opa|=2; |
| 695 | 695 | else chk_trans_or_opa|=1; |
| 696 | 696 | } |
| 697 | dp += sprite_gfx-> | |
| 697 | dp += sprite_gfx->r | |
| 698 | 698 | } |
| 699 | 699 | if(chk_trans_or_opa==1) state->m_tile_opaque_sp[c]=1; |
| 700 | 700 | else state->m_tile_opaque_sp[c]=0; |
| r17669 | r17670 | |
| 703 | 703 | |
| 704 | 704 | |
| 705 | 705 | { |
| 706 | | |
| 706 | | |
| 707 | 707 | int c; |
| 708 | 708 | |
| 709 | for (c = 0;c < pf_gfx-> | |
| 709 | for (c = 0;c < pf_gfx-> | |
| 710 | 710 | { |
| 711 | 711 | int x,y; |
| 712 | 712 | int extra_planes; /* 0 = 4bpp, 1=5bpp, 2=?, 3=6bpp */ |
| r17669 | r17670 | |
| 715 | 715 | { |
| 716 | 716 | int chk_trans_or_opa=0; |
| 717 | 717 | UINT8 extra_mask = ((extra_planes << 4) | 0x0f); |
| 718 | const UINT8 *dp = gfx | |
| 718 | const UINT8 *dp = pf_gfx-> | |
| 719 | 719 | |
| 720 | for (y = 0;y < pf_gfx->height;y++) | |
| 720 | for (y = 0;y < pf_gfx->height();y++) | |
| 721 | 721 | { |
| 722 | for (x = 0;x < pf_gfx->width;x++) | |
| 722 | for (x = 0;x < pf_gfx->width();x++) | |
| 723 | 723 | { |
| 724 | 724 | if(!(dp[x] & extra_mask)) |
| 725 | 725 | chk_trans_or_opa|=2; |
| 726 | 726 | else |
| 727 | 727 | chk_trans_or_opa|=1; |
| 728 | 728 | } |
| 729 | dp += pf_gfx-> | |
| 729 | dp += pf_gfx->r | |
| 730 | 730 | } |
| 731 | 731 | state->m_tile_opaque_pf[extra_planes][c]=chk_trans_or_opa; |
| 732 | 732 | } |
| r17669 | r17670 | |
| 814 | 814 | WRITE16_MEMBER(taito_f3_state::f3_vram_w) |
| 815 | 815 | { |
| 816 | 816 | COMBINE_DATA(&m_f3_vram[offset]); |
| 817 | | |
| 817 | | |
| 818 | 818 | } |
| 819 | 819 | |
| 820 | 820 | READ16_MEMBER(taito_f3_state::f3_pivot_r) |
| r17669 | r17670 | |
| 825 | 825 | WRITE16_MEMBER(taito_f3_state::f3_pivot_w) |
| 826 | 826 | { |
| 827 | 827 | COMBINE_DATA(&m_f3_pivot_ram[offset]); |
| 828 | | |
| 828 | | |
| 829 | 829 | } |
| 830 | 830 | |
| 831 | 831 | READ16_MEMBER(taito_f3_state::f3_lineram_r) |
| r17669 | r17670 | |
| 1567 | 1567 | alpha_mode=line_t->alpha_mode[line]; |
| 1568 | 1568 | if(!alpha_mode) return; |
| 1569 | 1569 | |
| 1570 | total_elements=machine.gfx[1]-> | |
| 1570 | total_elements=machine.gfx[1]-> | |
| 1571 | 1571 | |
| 1572 | 1572 | tile_index=x_index_fx>>16; |
| 1573 | 1573 | tile_num=(((line_t->x_zoom[line]*320+(x_index_fx & 0xffff)+0xffff)>>16)+(tile_index%16)+15)/16; |
| r17669 | r17670 | |
| 2580 | 2580 | pri++; |
| 2581 | 2581 | |
| 2582 | 2582 | INLINE void f3_drawgfx( |
| 2583 | bitmap_rgb32 &dest_bmp,const rectangle &clip, | |
| 2583 | bitmap_rgb32 &dest_bmp,const rectangle &clip, | |
| 2584 | 2584 | int code, |
| 2585 | 2585 | int color, |
| 2586 | 2586 | int flipx,int flipy, |
| r17669 | r17670 | |
| 2599 | 2599 | |
| 2600 | 2600 | if( gfx ) |
| 2601 | 2601 | { |
| 2602 | const pen_t *pal = &gfx->machine().pens[gfx->color_base + gfx->color_granularity * (color % gfx->total_colors)]; | |
| 2603 | const UINT8 *code_base = gfx_element_get_data(gfx, code % gfx->total_elements); | |
| 2602 | const pen_t *pal = &gfx->machine().pens[gfx->colorbase() + gfx->granularity() * (color % gfx->colors())]; | |
| 2603 | const UINT8 *code_base = gfx->get_data(code % gfx->elements()); | |
| 2604 | 2604 | |
| 2605 | 2605 | { |
| 2606 | 2606 | /* compute sprite increment per screen pixel */ |
| r17669 | r17670 | |
| 2662 | 2662 | // if (dest_bmp.bpp == 32) |
| 2663 | 2663 | { |
| 2664 | 2664 | int y=ey-sy; |
| 2665 | int x=(ex-sx-1)|(state->m_tile_opaque_sp[code % gfx-> | |
| 2665 | int x=(ex-sx-1)|(state->m_tile_opaque_sp[code % gfx-> | |
| 2666 | 2666 | const UINT8 *source0 = code_base + y_index * 16 + x_index_base; |
| 2667 | 2667 | UINT32 *dest0 = &dest_bmp.pix32(sy, sx); |
| 2668 | 2668 | UINT8 *pri0 = &state->m_pri_alp_bitmap.pix8(sy, sx); |
| r17669 | r17670 | |
| 2730 | 2730 | |
| 2731 | 2731 | |
| 2732 | 2732 | INLINE void f3_drawgfxzoom( |
| 2733 | bitmap_rgb32 &dest_bmp,const rectangle &clip, | |
| 2733 | bitmap_rgb32 &dest_bmp,const rectangle &clip, | |
| 2734 | 2734 | int code, |
| 2735 | 2735 | int color, |
| 2736 | 2736 | int flipx,int flipy, |
| r17669 | r17670 | |
| 2750 | 2750 | |
| 2751 | 2751 | if( gfx ) |
| 2752 | 2752 | { |
| 2753 | const pen_t *pal = &gfx->machine().pens[gfx->color_base + gfx->color_granularity * (color % gfx->total_colors)]; | |
| 2754 | const UINT8 *code_base = gfx_element_get_data(gfx, code % gfx->total_elements); | |
| 2753 | const pen_t *pal = &gfx->machine().pens[gfx->colorbase() + gfx->granularity() * (color % gfx->colors())]; | |
| 2754 | const UINT8 *code_base = gfx->get_data(code % gfx->elements()); | |
| 2755 | 2755 | |
| 2756 | 2756 | { |
| 2757 | 2757 | /* compute sprite increment per screen pixel */ |
| r17669 | r17670 | |
| 3122 | 3122 | { |
| 3123 | 3123 | taito_f3_state *state = machine.driver_data<taito_f3_state>(); |
| 3124 | 3124 | const struct tempsprite *sprite_ptr; |
| 3125 | | |
| 3125 | | |
| 3126 | 3126 | |
| 3127 | 3127 | sprite_ptr = state->m_sprite_end; |
| 3128 | 3128 | state->m_sprite_pri_usage=0; |
| r17669 | r17670 | |
|---|---|---|
| 343 | 343 | gaelco2_state *state = screen.machine().driver_data<gaelco2_state>(); |
| 344 | 344 | UINT16 *buffered_spriteram16 = state->m_spriteram->buffer(); |
| 345 | 345 | int j, x, y, ex, ey, px, py; |
| 346 | | |
| 346 | | |
| 347 | 347 | |
| 348 | 348 | /* get sprite ram start and end offsets */ |
| 349 | 349 | int start_offset = (state->m_vregs[1] & 0x10)*0x100; |
| r17669 | r17670 | |
| 392 | 392 | } else { /* last palette entry is reserved for shadows and highlights */ |
| 393 | 393 | |
| 394 | 394 | /* get a pointer to the current sprite's gfx data */ |
| 395 | const UINT8 *gfx_src = gfx | |
| 395 | const UINT8 *gfx_src = gfx-> | |
| 396 | 396 | |
| 397 | for (py = 0; py < gfx->height; py++){ | |
| 397 | for (py = 0; py < gfx->height(); py++){ | |
| 398 | 398 | /* get a pointer to the current line in the screen bitmap */ |
| 399 | 399 | int ypos = ((sy + ey*16 + py) & 0x1ff); |
| 400 | 400 | UINT16 *srcy = &bitmap.pix16(ypos); |
| 401 | 401 | |
| 402 | int gfx_py = yflip ? (gfx->height - 1 - py) : py; | |
| 402 | int gfx_py = yflip ? (gfx->height() - 1 - py) : py; | |
| 403 | 403 | |
| 404 | 404 | if ((ypos < cliprect.min_y) || (ypos > cliprect.max_y)) continue; |
| 405 | 405 | |
| 406 | for (px = 0; px < gfx->width; px++){ | |
| 406 | for (px = 0; px < gfx->width(); px++){ | |
| 407 | 407 | /* get current pixel */ |
| 408 | 408 | int xpos = (((sx + ex*16 + px) & 0x3ff) + spr_x_adjust) & 0x3ff; |
| 409 | 409 | UINT16 *pixel = srcy + xpos; |
| 410 | 410 | int src_color = *pixel; |
| 411 | 411 | |
| 412 | int gfx_px = xflip ? (gfx->width - 1 - px) : px; | |
| 412 | int gfx_px = xflip ? (gfx->width() - 1 - px) : px; | |
| 413 | 413 | |
| 414 | 414 | /* get asociated pen for the current sprite pixel */ |
| 415 | int gfx_pen = gfx_src[gfx-> | |
| 415 | int gfx_pen = gfx_src[gfx->r | |
| 416 | 416 | |
| 417 | 417 | if ((gfx_pen == 0) || (gfx_pen >= 16)) continue; |
| 418 | 418 |
| r17669 | r17670 | |
|---|---|---|
| 196 | 196 | { |
| 197 | 197 | champbas_state *state = machine.driver_data<champbas_state>(); |
| 198 | 198 | int offs; |
| 199 | | |
| 199 | | |
| 200 | 200 | |
| 201 | 201 | for (offs = state->m_spriteram.bytes() - 2; offs >= 0; offs -= 2) |
| 202 | 202 | { |
| r17669 | r17670 | |
|---|---|---|
| 254 | 254 | { |
| 255 | 255 | mcr_state *state = machine.driver_data<mcr_state>(); |
| 256 | 256 | UINT8 *spriteram = state->m_spriteram; |
| 257 | | |
| 257 | | |
| 258 | 258 | int offs; |
| 259 | 259 | |
| 260 | 260 | /* render the sprites into the bitmap, ORing together */ |
| r17669 | r17670 | |
| 288 | 288 | for (y = 0; y < 32; y++, sy = (sy + 1) & 0x1ff) |
| 289 | 289 | if (sy >= cliprect.min_y && sy <= cliprect.max_y) |
| 290 | 290 | { |
| 291 | const UINT8 *src = gfx | |
| 291 | const UINT8 *src = gfx-> | |
| 292 | 292 | UINT16 *dst = &bitmap.pix16(sy); |
| 293 | 293 | UINT8 *pri = &machine.priority_bitmap.pix8(sy); |
| 294 | 294 | |
| r17669 | r17670 | |
| 327 | 327 | { |
| 328 | 328 | mcr_state *state = machine.driver_data<mcr_state>(); |
| 329 | 329 | UINT8 *spriteram = state->m_spriteram; |
| 330 | | |
| 330 | | |
| 331 | 331 | int offs; |
| 332 | 332 | |
| 333 | 333 | /* render the sprites into the bitmap, working from topmost to bottommost */ |
| r17669 | r17670 | |
| 336 | 336 | int code, color, x, y, sx, sy, hflip, vflip; |
| 337 | 337 | |
| 338 | 338 | /* extract the bits of information */ |
| 339 | code = (spriteram[offs + 2] + 256 * ((spriteram[offs + 1] >> 3) & 0x01)) % gfx-> | |
| 339 | code = (spriteram[offs + 2] + 256 * ((spriteram[offs + 1] >> 3) & 0x01)) % gfx-> | |
| 340 | 340 | color = (((~spriteram[offs + 1] & 3) << 4) & sprmask) | colormask; |
| 341 | 341 | hflip = (spriteram[offs + 1] & 0x10) ? 31 : 0; |
| 342 | 342 | vflip = (spriteram[offs + 1] & 0x20) ? 31 : 0; |
| r17669 | r17670 | |
| 360 | 360 | for (y = 0; y < 32; y++, sy = (sy + 1) & 0x1ff) |
| 361 | 361 | if (sy >= 2 && sy >= cliprect.min_y && sy <= cliprect.max_y) |
| 362 | 362 | { |
| 363 | const UINT8 *src = gfx | |
| 363 | const UINT8 *src = gfx-> | |
| 364 | 364 | UINT16 *dst = &bitmap.pix16(sy); |
| 365 | 365 | UINT8 *pri = &machine.priority_bitmap.pix8(sy); |
| 366 | 366 |
| r17669 | r17670 | |
|---|---|---|
| 96 | 96 | { |
| 97 | 97 | offs = offset; |
| 98 | 98 | if (offset < 0x1000) |
| 99 | | |
| 99 | | |
| 100 | 100 | else |
| 101 | | |
| 101 | | |
| 102 | 102 | } |
| 103 | 103 | |
| 104 | 104 | (m_srbase[m_srbank])[offs] = data; |
| r17669 | r17670 | |
| 173 | 173 | static TILE_GET_INFO( get_fgtileinfo ) |
| 174 | 174 | { |
| 175 | 175 | bwing_state *state = machine.driver_data<bwing_state>(); |
| 176 | tileinfo.pen_data = gfx_element_get_data(machine.gfx[2], state->m_fgdata[tile_index] & (BW_NTILES - 1)); | |
| 177 | tileinfo.palette_base = machine.gfx[2]->color_base + ((state->m_fgdata[tile_index] >> 7) << 3); | |
| 176 | tileinfo.pen_data = machine.gfx[2]->get_data(state->m_fgdata[tile_index] & (BW_NTILES - 1)); | |
| 177 | tileinfo.palette_base = machine.gfx[2]->colorbase() + ((state->m_fgdata[tile_index] >> 7) << 3); | |
| 178 | 178 | } |
| 179 | 179 | |
| 180 | 180 | static TILE_GET_INFO( get_bgtileinfo ) |
| 181 | 181 | { |
| 182 | 182 | bwing_state *state = machine.driver_data<bwing_state>(); |
| 183 | tileinfo.pen_data = gfx_element_get_data(machine.gfx[3], state->m_bgdata[tile_index] & (BW_NTILES - 1)); | |
| 184 | tileinfo.palette_base = machine.gfx[3]->color_base + ((state->m_bgdata[tile_index] >> 7) << 3); | |
| 183 | tileinfo.pen_data = machine.gfx[3]->get_data(state->m_bgdata[tile_index] & (BW_NTILES - 1)); | |
| 184 | tileinfo.palette_base = machine.gfx[3]->colorbase() + ((state->m_bgdata[tile_index] >> 7) << 3); | |
| 185 | 185 | } |
| 186 | 186 | |
| 187 | 187 | static TILE_GET_INFO( get_charinfo ) |
| r17669 | r17670 | |
| 199 | 199 | VIDEO_START( bwing ) |
| 200 | 200 | { |
| 201 | 201 | bwing_state *state = machine.driver_data<bwing_state>(); |
| 202 | UINT32 *dwptr; | |
| 202 | // UINT32 *dwptr; | |
| 203 | 203 | int i; |
| 204 | 204 | |
| 205 | 205 | state->m_charmap = tilemap_create(machine, get_charinfo, TILEMAP_SCAN_COLS, 8, 8, 32, 32); |
| r17669 | r17670 | |
| 224 | 224 | state->m_sreg[i] = 0; |
| 225 | 225 | |
| 226 | 226 | // state->m_fgfx = machine.gfx[2]; |
| 227 | | |
| 227 | | |
| 228 | 228 | |
| 229 | 229 | // state->m_bgfx = machine.gfx[3]; |
| 230 | gfx_element_set_source(machine.gfx[3], state->m_srbase[1] + 0x1000); | |
| 231 | ||
| 232 | dwptr = machine.gfx[2]->pen_usage; | |
| 230 | machine.gfx[3]->set_source(state->m_srbase[1] + 0x1000); | |
| 231 | /* | |
| 232 | WTF?? | |
| 233 | ||
| 234 | dwptr = machine.gfx[2]->pen_usage(); | |
| 233 | 235 | if (dwptr) |
| 234 | 236 | { |
| 235 | 237 | dwptr[0] = 0; |
| 236 | 238 | for(i = 1; i < BW_NTILES; i++) |
| 237 | 239 | dwptr[i] = -1; |
| 238 | 240 | } |
| 241 | */ | |
| 239 | 242 | } |
| 240 | 243 | |
| 241 | 244 | //**************************************************************************** |
| r17669 | r17670 | |
|---|---|---|
| 442 | 442 | |
| 443 | 443 | state->m_background_color = machine.config().m_gfxdecodeinfo[0].color_codes_start + |
| 444 | 444 | (machine.config().m_gfxdecodeinfo[0].total_color_codes - 1) * |
| 445 | machine.gfx[0]-> | |
| 445 | machine.gfx[0]-> | |
| 446 | 446 | |
| 447 | 447 | switch (state->m_kludge) |
| 448 | 448 | { |
| r17669 | r17670 | |
|---|---|---|
| 378 | 378 | static TILE_GET_INFO( get_tile_info ) |
| 379 | 379 | { |
| 380 | 380 | williams_state *state = machine.driver_data<williams_state>(); |
| 381 | int mask = machine.gfx[0]-> | |
| 381 | int mask = machine.gfx[0]-> | |
| 382 | 382 | int data = state->m_williams2_tileram[tile_index]; |
| 383 | 383 | int y = (tile_index >> 1) & 7; |
| 384 | 384 | int color = 0; |
| r17669 | r17670 | |
|---|---|---|
| 110 | 110 | state->m_tilemap[2]->set_transparent_pen(0x0f); // 4 bits |
| 111 | 111 | state->m_tilemap[3]->set_transparent_pen(0x0f); // 4 bits |
| 112 | 112 | |
| 113 | //machine.gfx[1]->color_granularity = 16; /* 256 colour tiles with palette selectable on 16 colour boundaries */ | |
| 114 | //machine.gfx[2]->color_granularity = 16; | |
| 113 | //machine.gfx[1]->set_granularity(16); /* 256 colour tiles with palette selectable on 16 colour boundaries */ | |
| 114 | //machine.gfx[2]->set_granularity(16); | |
| 115 | 115 | } |
| 116 | 116 | |
| 117 | 117 | |
| r17669 | r17670 | |
| 147 | 147 | { |
| 148 | 148 | fuuki32_state *state = screen.machine().driver_data<fuuki32_state>(); |
| 149 | 149 | int offs; |
| 150 | | |
| 150 | | |
| 151 | 151 | bitmap_ind8 &priority_bitmap = screen.machine().priority_bitmap; |
| 152 | 152 | const rectangle &visarea = screen.visible_area(); |
| 153 | 153 | int max_x = visarea.max_x + 1; |
| r17669 | r17670 | |
|---|---|---|
| 218 | 218 | } |
| 219 | 219 | |
| 220 | 220 | // custom function to draw a single sprite. needed to keep correct sprites - sprites and sprites - tilemaps priorities |
| 221 | void kaneko16_sprite_device::kaneko16_draw_sprites_custom(bitmap_ind16 &dest_bmp,const rectangle &clip, | |
| 221 | void kaneko16_sprite_device::kaneko16_draw_sprites_custom(bitmap_ind16 &dest_bmp,const rectangle &clip, | |
| 222 | 222 | UINT32 code,UINT32 color,int flipx,int flipy,int sx,int sy, |
| 223 | 223 | int priority) |
| 224 | 224 | { |
| 225 | pen_t pen_base = gfx->color_base + gfx->color_granularity * (color % gfx->total_colors); | |
| 226 | const UINT8 *source_base = gfx_element_get_data(gfx, code % gfx->total_elements); | |
| 225 | pen_t pen_base = gfx->colorbase() + gfx->granularity() * (color % gfx->colors()); | |
| 226 | const UINT8 *source_base = gfx->get_data(code % gfx->elements()); | |
| 227 | 227 | bitmap_ind8 &priority_bitmap = gfx->machine().priority_bitmap; |
| 228 | int sprite_screen_height = ((1<<16)*gfx->height+0x8000)>>16; | |
| 229 | int sprite_screen_width = ((1<<16)*gfx->width+0x8000)>>16; | |
| 228 | int sprite_screen_height = ((1<<16)*gfx->height()+0x8000)>>16; | |
| 229 | int sprite_screen_width = ((1<<16)*gfx->width()+0x8000)>>16; | |
| 230 | 230 | |
| 231 | 231 | if (sprite_screen_width && sprite_screen_height) |
| 232 | 232 | { |
| 233 | 233 | /* compute sprite increment per screen pixel */ |
| 234 | int dx = (gfx->width<<16)/sprite_screen_width; | |
| 235 | int dy = (gfx->height<<16)/sprite_screen_height; | |
| 234 | int dx = (gfx->width()<<16)/sprite_screen_width; | |
| 235 | int dy = (gfx->height()<<16)/sprite_screen_height; | |
| 236 | 236 | |
| 237 | 237 | int ex = sx+sprite_screen_width; |
| 238 | 238 | int ey = sy+sprite_screen_height; |
| r17669 | r17670 | |
| 290 | 290 | |
| 291 | 291 | for( y=sy; y<ey; y++ ) |
| 292 | 292 | { |
| 293 | const UINT8 *source = source_base + (y_index>>16) * gfx-> | |
| 293 | const UINT8 *source = source_base + (y_index>>16) * gfx->r | |
| 294 | 294 | UINT16 *dest = &dest_bmp.pix16(y); |
| 295 | 295 | UINT8 *pri = &priority_bitmap.pix8(y); |
| 296 | 296 |
| r17669 | r17670 | |
|---|---|---|
| 109 | 109 | static TILE_GET_INFO( get_tile_info ) |
| 110 | 110 | { |
| 111 | 111 | thepit_state *state = machine.driver_data<thepit_state>(); |
| 112 | UINT8 fore_color = state->m_colorram[tile_index] % machine.gfx[0]-> | |
| 112 | UINT8 fore_color = state->m_colorram[tile_index] % machine.gfx[0]-> | |
| 113 | 113 | UINT8 code = state->m_videoram[tile_index]; |
| 114 | 114 | SET_TILE_INFO(2 * state->m_graphics_bank, code, fore_color, 0); |
| 115 | 115 | } |
| r17669 | r17670 | |
|---|---|---|
| 82 | 82 | |
| 83 | 83 | void kaneko16_draw_sprites(running_machine &machine, bitmap_ind16 &bitmap, const rectangle &cliprect, UINT16* spriteram16, int spriteram16_bytes); |
| 84 | 84 | |
| 85 | void kaneko16_draw_sprites_custom(bitmap_ind16 &dest_bmp,const rectangle &clip, | |
| 85 | void kaneko16_draw_sprites_custom(bitmap_ind16 &dest_bmp,const rectangle &clip, | |
| 86 | 86 | UINT32 code,UINT32 color,int flipx,int flipy,int sx,int sy, |
| 87 | 87 | int priority); |
| 88 | 88 |
| r17669 | r17670 | |
|---|---|---|
| 74 | 74 | static void draw_sprites(running_machine &machine, bitmap_ind16 &bitmap, const rectangle &cliprect) |
| 75 | 75 | { |
| 76 | 76 | pirates_state *state = machine.driver_data<pirates_state>(); |
| 77 | | |
| 77 | | |
| 78 | 78 | UINT16 *source = state->m_spriteram + 4; |
| 79 | 79 | UINT16 *finish = source + 0x800/2-4; |
| 80 | 80 |
| r17669 | r17670 | |
|---|---|---|
| 372 | 372 | int code2 = code; |
| 373 | 373 | |
| 374 | 374 | int color = ((flags >> 1) & 0x03) | ((code >> 5) & 0x04) | (code & 0x08) | (state->m_sprite_palette * 16); |
| 375 | | |
| 375 | | |
| 376 | 376 | |
| 377 | 377 | if (state->m_cocktail_flip) |
| 378 | 378 | { |
| 379 | x = 64*8 - gfx->width - x; | |
| 380 | y = 32*8 - gfx->height - y; | |
| 381 | if (wide) y -= gfx->height; | |
| 379 | x = 64*8 - gfx->width() - x; | |
| 380 | y = 32*8 - gfx->height() - y; | |
| 381 | if (wide) y -= gfx->height(); | |
| 382 | 382 | xflip = !xflip; |
| 383 | 383 | yflip = !yflip; |
| 384 | 384 | } |
| r17669 | r17670 | |
| 390 | 390 | else |
| 391 | 391 | code &= ~0x10, code2 |= 0x10; |
| 392 | 392 | |
| 393 | drawgfx_transmask(bitmap, cliprect, gfx, code2, color, xflip, yflip, x, y + gfx->height, | |
| 393 | drawgfx_transmask(bitmap, cliprect, gfx, code2, color, xflip, yflip, x, y + gfx->height(), | |
| 394 | 394 | colortable_get_transpen_mask(screen.machine().colortable, gfx, color, 0x10)); |
| 395 | 395 | } |
| 396 | 396 |
| r17669 | r17670 | |
|---|---|---|
| 108 | 108 | { |
| 109 | 109 | wrally_state *state = machine.driver_data<wrally_state>(); |
| 110 | 110 | int i, px, py; |
| 111 | | |
| 111 | | |
| 112 | 112 | |
| 113 | 113 | for (i = 6/2; i < (0x1000 - 6)/2; i += 4) { |
| 114 | 114 | int sx = state->m_spriteram[i+2] & 0x03ff; |
| r17669 | r17670 | |
| 135 | 135 | sx - 0x0f,sy,0); |
| 136 | 136 | } else { |
| 137 | 137 | /* get a pointer to the current sprite's gfx data */ |
| 138 | const UINT8 *gfx_src = gfx | |
| 138 | const UINT8 *gfx_src = gfx-> | |
| 139 | 139 | |
| 140 | for (py = 0; py < gfx->height; py++){ | |
| 140 | for (py = 0; py < gfx->height(); py++){ | |
| 141 | 141 | /* get a pointer to the current line in the screen bitmap */ |
| 142 | 142 | int ypos = ((sy + py) & 0x1ff); |
| 143 | 143 | UINT16 *srcy = &bitmap.pix16(ypos); |
| 144 | 144 | |
| 145 | int gfx_py = yflip ? (gfx->height - 1 - py) : py; | |
| 145 | int gfx_py = yflip ? (gfx->height() - 1 - py) : py; | |
| 146 | 146 | |
| 147 | 147 | if ((ypos < cliprect.min_y) || (ypos > cliprect.max_y)) continue; |
| 148 | 148 | |
| 149 | for (px = 0; px < gfx->width; px++){ | |
| 149 | for (px = 0; px < gfx->width(); px++){ | |
| 150 | 150 | /* get current pixel */ |
| 151 | 151 | int xpos = (((sx + px) & 0x3ff) - 0x0f) & 0x3ff; |
| 152 | 152 | UINT16 *pixel = srcy + xpos; |
| 153 | 153 | int src_color = *pixel; |
| 154 | 154 | |
| 155 | int gfx_px = xflip ? (gfx->width - 1 - px) : px; | |
| 155 | int gfx_px = xflip ? (gfx->width() - 1 - px) : px; | |
| 156 | 156 | |
| 157 | 157 | /* get asociated pen for the current sprite pixel */ |
| 158 | int gfx_pen = gfx_src[gfx-> | |
| 158 | int gfx_pen = gfx_src[gfx->r | |
| 159 | 159 | |
| 160 | 160 | /* pens 8..15 are used to select a palette */ |
| 161 | 161 | if ((gfx_pen < 8) || (gfx_pen >= 16)) continue; |
| r17669 | r17670 | |
|---|---|---|
| 758 | 758 | |
| 759 | 759 | void gp9001vdp_device::draw_sprites( running_machine &machine, bitmap_ind16 &bitmap, const rectangle &cliprect, const UINT8* primap ) |
| 760 | 760 | { |
| 761 | | |
| 761 | | |
| 762 | 762 | |
| 763 | 763 | int offs, old_x, old_y; |
| 764 | 764 | |
| r17669 | r17670 | |
| 866 | 866 | flipx,flipy, |
| 867 | 867 | sx,sy,0); |
| 868 | 868 | */ |
| 869 | sprite %= gfx->total_elements; | |
| 870 | color %= gfx->total_colors; | |
| 869 | sprite %= gfx->elements(); | |
| 870 | color %= gfx->colors(); | |
| 871 | 871 | |
| 872 | 872 | { |
| 873 | 873 | int yy, xx; |
| 874 | const pen_t *paldata = &gfx->machine().pens[gfx->color_base + gfx->color_granularity * color]; | |
| 875 | const UINT8* srcdata = gfx_element_get_data(gfx, sprite); | |
| 874 | const pen_t *paldata = &gfx->machine().pens[gfx->colorbase() + gfx->granularity() * color]; | |
| 875 | const UINT8* srcdata = gfx->get_data(sprite); | |
| 876 | 876 | int count = 0; |
| 877 | 877 | int ystart, yend, yinc; |
| 878 | 878 | int xstart, xend, xinc; |
| r17669 | r17670 | |
|---|---|---|
| 73 | 73 | if (m_chargen[offset] != data) |
| 74 | 74 | { |
| 75 | 75 | m_chargen[offset] = data; |
| 76 | gfx | |
| 76 | m_back_gfx-> | |
| 77 | 77 | } |
| 78 | 78 | } |
| 79 | 79 | |
| r17669 | r17670 | |
| 84 | 84 | if (m_chargen[offset] != data) |
| 85 | 85 | { |
| 86 | 86 | m_chargen[offset] = data; |
| 87 | | |
| 87 | | |
| 88 | 88 | } |
| 89 | 89 | } |
| 90 | 90 | |
| r17669 | r17670 | |
| 109 | 109 | state->m_tx_tilemap->set_scrolldx(0, 62); |
| 110 | 110 | state->m_tx_tilemap->set_scrolldy(0, 0); |
| 111 | 111 | |
| 112 | state->m_back_gfx = gfx_element | |
| 112 | state->m_back_gfx = auto_alloc(machine, gfx_element | |
| 113 | 113 | |
| 114 | 114 | machine.gfx[1] = state->m_back_gfx; |
| 115 | 115 | return ; |
| r17669 | r17670 | |
| 119 | 119 | { |
| 120 | 120 | m10_state *state = machine.driver_data<m10_state>(); |
| 121 | 121 | |
| 122 | machine.gfx[0] = gfx_element | |
| 122 | machine.gfx[0] = auto_alloc(machine, gfx_element | |
| 123 | 123 | |
| 124 | 124 | state->m_tx_tilemap = tilemap_create(machine, get_tile_info,tilemap_scan, 8, 8, 32, 32); |
| 125 | 125 | state->m_tx_tilemap->set_scrolldx(0, 116); |
| r17669 | r17670 | |
|---|---|---|
| 236 | 236 | } |
| 237 | 237 | } |
| 238 | 238 | |
| 239 | static void draw_char(bitmap_rgb32 &bitmap, const rectangle &cliprect, | |
| 239 | static void draw_char(bitmap_rgb32 &bitmap, const rectangle &cliprect, | |
| 240 | 240 | { |
| 241 | 241 | int i,j; |
| 242 | 242 | const UINT8 *dp; |
| 243 | 243 | int index = 0; |
| 244 | 244 | const pen_t *pens = gfx->machine().pens; |
| 245 | 245 | |
| 246 | dp = gfx | |
| 246 | dp = gfx-> | |
| 247 | 247 | |
| 248 | 248 | for (j=y; j < y+8; j++) |
| 249 | 249 | { |
| r17669 | r17670 | |
| 252 | 252 | { |
| 253 | 253 | UINT8 pen = dp[index++]; |
| 254 | 254 | if (pen) |
| 255 | p[i] = pens[gfx->color | |
| 255 | p[i] = pens[gfx->color | |
| 256 | 256 | else |
| 257 | 257 | { |
| 258 | 258 | if (((att >> 4) & 7) > 0) |
| 259 | p[i] = pens[gfx->color | |
| 259 | p[i] = pens[gfx->color | |
| 260 | 260 | } |
| 261 | 261 | } |
| 262 | 262 | } |
| r17669 | r17670 | |
| 357 | 357 | { |
| 358 | 358 | mediagx_state *state = machine.driver_data<mediagx_state>(); |
| 359 | 359 | int i, j; |
| 360 | | |
| 360 | | |
| 361 | 361 | UINT32 *cga = state->m_cga_ram; |
| 362 | 362 | int index = 0; |
| 363 | 363 |
| r17669 | r17670 | |
|---|---|---|
| 40 | 40 | static SCREEN_UPDATE_IND16(summit) |
| 41 | 41 | { |
| 42 | 42 | summit_state *state = screen.machine().driver_data<summit_state>(); |
| 43 | | |
| 43 | | |
| 44 | 44 | int count = 0x0000; |
| 45 | 45 | |
| 46 | 46 | int y,x; |
| r17669 | r17670 | |
|---|---|---|
| 412 | 412 | mwarr_state *state = machine.driver_data<mwarr_state>(); |
| 413 | 413 | const UINT16 *source = state->m_sprites_buffer + 0x800 - 4; |
| 414 | 414 | const UINT16 *finish = state->m_sprites_buffer; |
| 415 | | |
| 415 | | |
| 416 | 416 | int x, y, color, flipx, dy, pri, pri_mask, i; |
| 417 | 417 | |
| 418 | 418 | while (source >= finish) |
| r17669 | r17670 | |
|---|---|---|
| 250 | 250 | static SCREEN_UPDATE_IND16( coinmvga ) |
| 251 | 251 | { |
| 252 | 252 | coinmvga_state *state = screen.machine().driver_data<coinmvga_state>(); |
| 253 | | |
| 253 | | |
| 254 | 254 | int count = 0x04000/2; |
| 255 | 255 | |
| 256 | 256 | int y,x; |
| r17669 | r17670 | |
|---|---|---|
| 127 | 127 | static MACHINE_START( imago ) |
| 128 | 128 | { |
| 129 | 129 | fastfred_state *state = machine.driver_data<fastfred_state>(); |
| 130 | | |
| 130 | | |
| 131 | 131 | } |
| 132 | 132 | |
| 133 | 133 | WRITE8_MEMBER(fastfred_state::imago_dma_irq_w) |
| r17669 | r17670 | |
| 154 | 154 | sprites_data = rom[m_imago_sprites_address + 0x2000*2 + m_imago_sprites_bank * 0x1000]; |
| 155 | 155 | m_imago_sprites[offset + 0x800*2] = sprites_data; |
| 156 | 156 | |
| 157 | | |
| 157 | | |
| 158 | 158 | } |
| 159 | 159 | |
| 160 | 160 | READ8_MEMBER(fastfred_state::imago_sprites_offset_r) |
| r17669 | r17670 | |
|---|---|---|
| 289 | 289 | { |
| 290 | 290 | cybertnk_state *state = screen.machine().driver_data<cybertnk_state>(); |
| 291 | 291 | int i; |
| 292 | | |
| 292 | | |
| 293 | 293 | |
| 294 | 294 | |
| 295 | 295 | for (i=0;i<0x1000/4;i+=4) |
| r17669 | r17670 | |
|---|---|---|
| 204 | 204 | { |
| 205 | 205 | pinkiri8_state *state = screen.machine().driver_data<pinkiri8_state>(); |
| 206 | 206 | int col_bank; |
| 207 | | |
| 207 | | |
| 208 | 208 | |
| 209 | 209 | /* update palette */ |
| 210 | 210 | for (int pen = 0; pen < 0x800 ; pen++) |
| r17669 | r17670 | |
|---|---|---|
| 59 | 59 | |
| 60 | 60 | UINT32 chsuper_state::screen_update( screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect ) |
| 61 | 61 | { |
| 62 | | |
| 62 | | |
| 63 | 63 | int count = 0x0000; |
| 64 | 64 | int y,x; |
| 65 | 65 |
| r17669 | r17670 | |
|---|---|---|
| 314 | 314 | { |
| 315 | 315 | igs017_state *state = machine.driver_data<igs017_state>(); |
| 316 | 316 | // prepare GfxElement on the fly |
| 317 | gfx_element gfx(machine); | |
| 318 | 317 | |
| 319 | 318 | // Bounds checking |
| 320 | 319 | if ( addr + dimx * dimy >= state->m_sprites_gfx_size ) |
| 321 | 320 | return; |
| 322 | 321 | |
| 323 | gfx_element | |
| 322 | gfx_element | |
| 324 | 323 | |
| 325 | 324 | drawgfx_transpen( bitmap,cliprect, &gfx, |
| 326 | 325 | 0, color, |
| r17669 | r17670 | |
|---|---|---|
| 461 | 461 | static SCREEN_UPDATE_IND16( amaticmg ) |
| 462 | 462 | { |
| 463 | 463 | amaticmg_state *state = screen.machine().driver_data<amaticmg_state>(); |
| 464 | | |
| 464 | | |
| 465 | 465 | int y,x; |
| 466 | 466 | int count = 0; |
| 467 | 467 | |
| r17669 | r17670 | |
| 487 | 487 | static SCREEN_UPDATE_IND16( amaticmg2 ) |
| 488 | 488 | { |
| 489 | 489 | amaticmg_state *state = screen.machine().driver_data<amaticmg_state>(); |
| 490 | | |
| 490 | | |
| 491 | 491 | int y,x; |
| 492 | 492 | int count = 16; |
| 493 | 493 |
| r17669 | r17670 | |
|---|---|---|
| 508 | 508 | avt_state *state = screen.machine().driver_data<avt_state>(); |
| 509 | 509 | int x,y; |
| 510 | 510 | int count; |
| 511 | | |
| 511 | | |
| 512 | 512 | |
| 513 | 513 | count = 0; |
| 514 | 514 |
| r17669 | r17670 | |
|---|---|---|
| 3602 | 3602 | |
| 3603 | 3603 | glcopy.total = (gfx2_size_needed / glcopy.charincrement)*8; |
| 3604 | 3604 | |
| 3605 | machine.gfx[1] = gfx_element | |
| 3605 | machine.gfx[1] = auto_alloc(machine, gfx_element | |
| 3606 | 3606 | |
| 3607 | 3607 | |
| 3608 | 3608 | } |
| r17669 | r17670 | |
|---|---|---|
| 140 | 140 | static SCREEN_UPDATE_IND16(sub) |
| 141 | 141 | { |
| 142 | 142 | sub_state *state = screen.machine().driver_data<sub_state>(); |
| 143 | const gfx_element *gfx = screen.machine().gfx[0]; | |
| 144 | const gfx_element *gfx_1 = screen.machine().gfx[1]; | |
| 143 | gfx_element *gfx = screen.machine().gfx[0]; | |
| 144 | gfx_element *gfx_1 = screen.machine().gfx[1]; | |
| 145 | 145 | int y,x; |
| 146 | 146 | int count = 0; |
| 147 | 147 |
| r17669 | r17670 | |
|---|---|---|
| 208 | 208 | mpoker_state *state = screen.machine().driver_data<mpoker_state>(); |
| 209 | 209 | int y,x; |
| 210 | 210 | int count; |
| 211 | | |
| 211 | | |
| 212 | 212 | |
| 213 | 213 | count = 0; |
| 214 | 214 | for (y=0;y<32;y++) |
| r17669 | r17670 | |
|---|---|---|
| 349 | 349 | dmndrby_state *state = screen.machine().driver_data<dmndrby_state>(); |
| 350 | 350 | int x,y,count; |
| 351 | 351 | int off,scrolly; |
| 352 | const gfx_element *gfx = screen.machine().gfx[0]; | |
| 353 | const gfx_element *sprites = screen.machine().gfx[1]; | |
| 354 | const gfx_element *track = screen.machine().gfx[2]; | |
| 352 | gfx_element *gfx = screen.machine().gfx[0]; | |
| 353 | gfx_element *sprites = screen.machine().gfx[1]; | |
| 354 | gfx_element *track = screen.machine().gfx[2]; | |
| 355 | 355 | |
| 356 | 356 | bitmap.fill(get_black_pen(screen.machine()), cliprect); |
| 357 | 357 |
| r17669 | r17670 | |
|---|---|---|
| 76 | 76 | { |
| 77 | 77 | cmmb_state *state = screen.machine().driver_data<cmmb_state>(); |
| 78 | 78 | UINT8 *videoram = state->m_videoram; |
| 79 | | |
| 79 | | |
| 80 | 80 | int count = 0x00000; |
| 81 | 81 | |
| 82 | 82 | int y,x; |
| r17669 | r17670 | |
| 113 | 113 | offset&=0xfff; |
| 114 | 114 | |
| 115 | 115 | /* dirty char */ |
| 116 | gfx_element_mark_dirty(machine().gfx[0], offset >> 4); | |
| 117 | gfx_element_mark_dirty(machine().gfx[1], offset >> 5); | |
| 116 | machine().gfx[0]->mark_dirty(offset >> 4); | |
| 117 | machine().gfx[1]->mark_dirty(offset >> 5); | |
| 118 | 118 | } |
| 119 | 119 | |
| 120 | 120 |
| r17669 | r17670 | |
|---|---|---|
| 42 | 42 | { |
| 43 | 43 | rgum_state *state = screen.machine().driver_data<rgum_state>(); |
| 44 | 44 | int x,y,count; |
| 45 | | |
| 45 | | |
| 46 | 46 | |
| 47 | 47 | count = 0; |
| 48 | 48 |
| r17669 | r17670 | |
|---|---|---|
| 1463 | 1463 | WRITE32_MEMBER(namcos23_state::s23_txtchar_w) |
| 1464 | 1464 | { |
| 1465 | 1465 | COMBINE_DATA(&m_charram[offset]); |
| 1466 | | |
| 1466 | | |
| 1467 | 1467 | } |
| 1468 | 1468 | |
| 1469 | 1469 | static UINT8 nthbyte( const UINT32 *pSource, int offs ) |
| r17669 | r17670 | |
| 2398 | 2398 | static VIDEO_START( ss23 ) |
| 2399 | 2399 | { |
| 2400 | 2400 | namcos23_state *state = machine.driver_data<namcos23_state>(); |
| 2401 | | |
| 2401 | | |
| 2402 | 2402 | state->m_bgtilemap = tilemap_create(machine, TextTilemapGetInfo, TILEMAP_SCAN_ROWS, 16, 16, 64, 64); |
| 2403 | 2403 | state->m_bgtilemap->set_transparent_pen(0xf); |
| 2404 | 2404 | |
| r17669 | r17670 | |
| 2424 | 2424 | render_run( screen.machine(), bitmap ); |
| 2425 | 2425 | |
| 2426 | 2426 | gfx_element *gfx = screen.machine().gfx[0]; |
| 2427 | | |
| 2427 | | |
| 2428 | 2428 | |
| 2429 | 2429 | state->m_bgtilemap->draw(bitmap, cliprect, 0/*flags*/, 0/*priority*/ ); /* opaque */ |
| 2430 | 2430 | return 0; |
| r17669 | r17670 | |
|---|---|---|
| 157 | 157 | offset &= 0x7ff; |
| 158 | 158 | |
| 159 | 159 | /* dirty char */ |
| 160 | gfx_element_mark_dirty(machine().gfx[0], offset >> 3); | |
| 161 | // gfx_element_mark_dirty(machine().gfx[0], (offset | 0x1800) >> 3); | |
| 160 | machine().gfx[0]->mark_dirty(offset >> 3); | |
| 161 | // machine().gfx[0]->mark_dirty((offset | 0x1800) >> 3); | |
| 162 | 162 | } |
| 163 | 163 | |
| 164 | 164 | WRITE8_MEMBER(liberate_state::prosoccr_char_bank_w) |
| r17669 | r17670 | |
| 223 | 223 | offset &= 0x7ff; |
| 224 | 224 | |
| 225 | 225 | /* dirty char */ |
| 226 | gfx_element_mark_dirty(machine().gfx[3], (offset + 0x800) >> 3); | |
| 227 | gfx_element_mark_dirty(machine().gfx[3 + 4], (offset + 0x800) >> 5); | |
| 226 | machine().gfx[3]->mark_dirty((offset + 0x800) >> 3); | |
| 227 | machine().gfx[3 + 4]->mark_dirty((offset + 0x800) >> 5); | |
| 228 | 228 | } |
| 229 | 229 | |
| 230 | 230 |
| r17669 | r17670 | |
|---|---|---|
| 588 | 588 | static void draw_sprites(screen_device &screen, bitmap_ind16 &bitmap) |
| 589 | 589 | { |
| 590 | 590 | vamphalf_state *state = screen.machine().driver_data<vamphalf_state>(); |
| 591 | | |
| 591 | | |
| 592 | 592 | UINT32 cnt; |
| 593 | 593 | int block, offs; |
| 594 | 594 | int code,color,x,y,fx,fy; |
| r17669 | r17670 | |
| 674 | 674 | static void draw_sprites_aoh(screen_device &screen, bitmap_ind16 &bitmap) |
| 675 | 675 | { |
| 676 | 676 | vamphalf_state *state = screen.machine().driver_data<vamphalf_state>(); |
| 677 | | |
| 677 | | |
| 678 | 678 | UINT32 cnt; |
| 679 | 679 | int block, offs; |
| 680 | 680 | int code,color,x,y,fx,fy; |
| r17669 | r17670 | |
|---|---|---|
| 486 | 486 | else |
| 487 | 487 | pri_mask = 0xfe; |
| 488 | 488 | |
| 489 | gfx | |
| 489 | gfx-> | |
| 490 | 490 | pdrawgfxzoom_transpen(bitmap, cliprect, gfx, |
| 491 | 491 | code, |
| 492 | 492 | color, |
| r17669 | r17670 | |
| 1488 | 1488 | decrypt_ms32_tx(machine(), 0x00020,0x7e, "gfx7"); |
| 1489 | 1489 | decrypt_ms32_bg(machine(), 0x00001,0x9b, "gfx6"); |
| 1490 | 1490 | |
| 1491 | m | |
| 1491 | m | |
| 1492 | 1492 | } |
| 1493 | 1493 | |
| 1494 | 1494 | GAME( 1997, bnstars1, 0, bnstars, bnstars, bnstars_state, bnstars, ROT0, "Jaleco", "Vs. Janshi Brandnew Stars", GAME_IMPERFECT_GRAPHICS | GAME_NO_SOUND ) |
| r17669 | r17670 | |
|---|---|---|
| 31 | 31 | static SCREEN_UPDATE_IND16(buster) |
| 32 | 32 | { |
| 33 | 33 | buster_state *state = screen.machine().driver_data<buster_state>(); |
| 34 | | |
| 34 | | |
| 35 | 35 | int count = 0x0000; |
| 36 | 36 | |
| 37 | 37 | int y,x; |
| r17669 | r17670 | |
|---|---|---|
| 484 | 484 | static VIDEO_START(mastboy) |
| 485 | 485 | { |
| 486 | 486 | mastboy_state *state = machine.driver_data<mastboy_state>(); |
| 487 | | |
| 487 | | |
| 488 | 488 | } |
| 489 | 489 | |
| 490 | 490 | static SCREEN_UPDATE_IND16(mastboy) |
| r17669 | r17670 | |
| 589 | 589 | m_vram[offs] = data^0xff; |
| 590 | 590 | |
| 591 | 591 | /* Decode the new tile */ |
| 592 | | |
| 592 | | |
| 593 | 593 | } |
| 594 | 594 | } |
| 595 | 595 | else |
| r17669 | r17670 | |
|---|---|---|
| 229 | 229 | state->m_tmap->set_transparent_pen(0); |
| 230 | 230 | state->m_tmap2->set_transparent_pen(0); |
| 231 | 231 | |
| 232 | machine.gfx[0]-> | |
| 232 | machine.gfx[0]->set | |
| 233 | 233 | } |
| 234 | 234 | |
| 235 | 235 | static SCREEN_UPDATE_IND16( darkhors ) |
| r17669 | r17670 | |
|---|---|---|
| 324 | 324 | static VIDEO_START(aristmk4) |
| 325 | 325 | { |
| 326 | 326 | int tile; |
| 327 | for (tile = 0; tile < machine.gfx[0]-> | |
| 327 | for (tile = 0; tile < machine.gfx[0]-> | |
| 328 | 328 | { |
| 329 | | |
| 329 | | |
| 330 | 330 | } |
| 331 | 331 | } |
| 332 | 332 | |
| r17669 | r17670 | |
| 368 | 368 | static SCREEN_UPDATE_IND16(aristmk4) |
| 369 | 369 | { |
| 370 | 370 | aristmk4_state *state = screen.machine().driver_data<aristmk4_state>(); |
| 371 | | |
| 371 | | |
| 372 | 372 | int x,y; |
| 373 | 373 | int count = 0; |
| 374 | 374 | int color; |
| r17669 | r17670 | |
| 385 | 385 | tile = (state->m_mkiv_vram[count+1]|state->m_mkiv_vram[count]<<8) & 0x3ff; |
| 386 | 386 | bgtile = (state->m_mkiv_vram[count+1]|state->m_mkiv_vram[count]<<8) & 0xff; // first 256 tiles |
| 387 | 387 | uBackgroundColour(screen.machine()); // read sw7 |
| 388 | gfx | |
| 388 | gfx-> | |
| 389 | 389 | // as we only update the background, not the entire display. |
| 390 | 390 | flipx = ((state->m_mkiv_vram[count]) & 0x04); |
| 391 | 391 | flipy = ((state->m_mkiv_vram[count]) & 0x08); |
| r17669 | r17670 | |
|---|---|---|
| 95 | 95 | static SCREEN_UPDATE_IND16(murogmbl) |
| 96 | 96 | { |
| 97 | 97 | murogmbl_state *state = screen.machine().driver_data<murogmbl_state>(); |
| 98 | | |
| 98 | | |
| 99 | 99 | int count = 0; |
| 100 | 100 | |
| 101 | 101 | int y, x; |
| r17669 | r17670 | |
|---|---|---|
| 200 | 200 | SCREEN_UPDATE_IND16( bmcpokr ) |
| 201 | 201 | { |
| 202 | 202 | bmcpokr_state *state = screen.machine().driver_data<bmcpokr_state>(); |
| 203 | | |
| 203 | | |
| 204 | 204 | |
| 205 | 205 | int count = 0; |
| 206 | 206 | for (int y=0;y<32;y++) |
| r17669 | r17670 | |
|---|---|---|
| 99 | 99 | static void draw_sprites( running_machine &machine, bitmap_ind16 &bitmap, const rectangle &cliprect ) |
| 100 | 100 | { |
| 101 | 101 | k3_state *state = machine.driver_data<k3_state>(); |
| 102 | | |
| 102 | | |
| 103 | 103 | UINT16 *source = state->m_spriteram_1; |
| 104 | 104 | UINT16 *source2 = state->m_spriteram_2; |
| 105 | 105 | UINT16 *finish = source + 0x1000 / 2; |
| r17669 | r17670 | |
|---|---|---|
| 273 | 273 | /**************************************************************************************/ |
| 274 | 274 | |
| 275 | 275 | void namcos2_shared_state::zdrawgfxzoom( |
| 276 | bitmap_ind16 &dest_bmp,const rectangle &clip, | |
| 276 | bitmap_ind16 &dest_bmp,const rectangle &clip, | |
| 277 | 277 | UINT32 code,UINT32 color,int flipx,int flipy,int sx,int sy, |
| 278 | 278 | int scalex, int scaley, int zpos ) |
| 279 | 279 | { |
| r17669 | r17670 | |
| 283 | 283 | if( gfx ) |
| 284 | 284 | { |
| 285 | 285 | int shadow_offset = (gfx->machine().config().m_video_attributes&VIDEO_HAS_SHADOWS)?gfx->machine().total_colors():0; |
| 286 | const pen_t *pal = &gfx->machine().pens[gfx->color_base + gfx->color_granularity * (color % gfx->total_colors)]; | |
| 287 | const UINT8 *source_base = gfx_element_get_data(gfx, code % gfx->total_elements); | |
| 288 | int sprite_screen_height = (scaley*gfx->height+0x8000)>>16; | |
| 289 | int sprite_screen_width = (scalex*gfx->width+0x8000)>>16; | |
| 286 | const pen_t *pal = &gfx->machine().pens[gfx->colorbase() + gfx->granularity() * (color % gfx->colors())]; | |
| 287 | const UINT8 *source_base = gfx->get_data(code % gfx->elements()); | |
| 288 | int sprite_screen_height = (scaley*gfx->height()+0x8000)>>16; | |
| 289 | int sprite_screen_width = (scalex*gfx->width()+0x8000)>>16; | |
| 290 | 290 | if (sprite_screen_width && sprite_screen_height) |
| 291 | 291 | { |
| 292 | 292 | /* compute sprite increment per screen pixel */ |
| 293 | int dx = (gfx->width<<16)/sprite_screen_width; | |
| 294 | int dy = (gfx->height<<16)/sprite_screen_height; | |
| 293 | int dx = (gfx->width()<<16)/sprite_screen_width; | |
| 294 | int dy = (gfx->height()<<16)/sprite_screen_height; | |
| 295 | 295 | |
| 296 | 296 | int ex = sx+sprite_screen_width; |
| 297 | 297 | int ey = sy+sprite_screen_height; |
| r17669 | r17670 | |
| 350 | 350 | { |
| 351 | 351 | for( y=sy; y<ey; y++ ) |
| 352 | 352 | { |
| 353 | const UINT8 *source = source_base + (y_index>>16) * gfx-> | |
| 353 | const UINT8 *source = source_base + (y_index>>16) * gfx->r | |
| 354 | 354 | UINT16 *dest = &dest_bmp.pix16(y); |
| 355 | 355 | UINT8 *pri = &priority_bitmap.pix8(y); |
| 356 | 356 | int x, x_index = x_index_base; |
| r17669 | r17670 | |
| 415 | 415 | } /* zdrawgfxzoom */ |
| 416 | 416 | |
| 417 | 417 | void namcos2_shared_state::zdrawgfxzoom( |
| 418 | bitmap_rgb32 &dest_bmp,const rectangle &clip, | |
| 418 | bitmap_rgb32 &dest_bmp,const rectangle &clip, | |
| 419 | 419 | UINT32 code,UINT32 color,int flipx,int flipy,int sx,int sy, |
| 420 | 420 | int scalex, int scaley, int zpos ) |
| 421 | 421 | { |
| r17669 | r17670 | |
| 482 | 482 | gfx_element *gfx = machine().gfx[rgn]; |
| 483 | 483 | |
| 484 | 484 | if( (word0&0x0200)==0 ) |
| 485 | gfx | |
| 485 | gfx-> | |
| 486 | 486 | else |
| 487 | gfx | |
| 487 | gfx-> | |
| 488 | 488 | |
| 489 | 489 | zdrawgfxzoom( |
| 490 | 490 | bitmap, |
| r17669 | r17670 | |
| 1344 | 1344 | else |
| 1345 | 1345 | { |
| 1346 | 1346 | offset -= 0x10000/2; |
| 1347 | gfx | |
| 1347 | m_gfx-> | |
| 1348 | 1348 | } |
| 1349 | 1349 | } |
| 1350 | 1350 | |
| r17669 | r17670 | |
| 1445 | 1445 | void namco_c45_road_device::device_start() |
| 1446 | 1446 | { |
| 1447 | 1447 | // create a gfx_element describing the road graphics |
| 1448 | m_gfx = gfx_element | |
| 1448 | m_gfx = auto_alloc(machine(), gfx_element | |
| 1449 | 1449 | |
| 1450 | 1450 | // create a tilemap for the road |
| 1451 | 1451 | m_tilemap = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(namco_c45_road_device::get_road_info), this), |
| r17669 | r17670 | |
| 1459 | 1459 | |
| 1460 | 1460 | void namco_c45_road_device::device_stop() |
| 1461 | 1461 | { |
| 1462 | | |
| 1462 | au | |
| 1463 | 1463 | } |
| 1464 | 1464 | |
| 1465 | 1465 |
| r17669 | r17670 | |
|---|---|---|
| 175 | 175 | state->m_cur_rombank = state->m_cur_rombank2 = 0; |
| 176 | 176 | state->membank("bank1")->set_base(machine.root_device().memregion("maincpu")->base()); |
| 177 | 177 | |
| 178 | | |
| 178 | | |
| 179 | 179 | |
| 180 | 180 | state->m_adpcm_pos = 0; |
| 181 | 181 | state->m_adpcm_data = -1; |
| r17669 | r17670 | |
|---|---|---|
| 212 | 212 | { |
| 213 | 213 | if (state->m_tileduty[i] == 1) |
| 214 | 214 | { |
| 215 | | |
| 215 | | |
| 216 | 216 | state->m_tileduty[i] = 0; |
| 217 | 217 | } |
| 218 | 218 | } |
| r17669 | r17670 | |
|---|---|---|
| 156 | 156 | static void cyclemb_draw_tilemap(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) |
| 157 | 157 | { |
| 158 | 158 | cyclemb_state *state = screen.machine().driver_data<cyclemb_state>(); |
| 159 | | |
| 159 | | |
| 160 | 160 | int x,y,count; |
| 161 | 161 | UINT8 flip_screen = state->flip_screen(); |
| 162 | 162 | |
| r17669 | r17670 | |
| 257 | 257 | static void skydest_draw_tilemap(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) |
| 258 | 258 | { |
| 259 | 259 | cyclemb_state *state = screen.machine().driver_data<cyclemb_state>(); |
| 260 | | |
| 260 | | |
| 261 | 261 | int x,y; |
| 262 | 262 | //UINT8 flip_screen = state->flip_screen(); |
| 263 | 263 |
| r17669 | r17670 | |
|---|---|---|
| 532 | 532 | mpu4vid_state *state = space->machine().driver_data<mpu4vid_state>(); |
| 533 | 533 | COMBINE_DATA(&state->m_vid_vidram[offset]); |
| 534 | 534 | offset <<= 1; |
| 535 | gfx_element_mark_dirty(space->machine().gfx[state->m_gfx_index+0], offset/0x20); | |
| 536 | gfx_element_mark_dirty(space->machine().gfx[state->m_gfx_index+1], offset/0x20); | |
| 537 | gfx_element_mark_dirty(space->machine().gfx[state->m_gfx_index+2], offset/0x20); | |
| 538 | gfx_element_mark_dirty(space->machine().gfx[state->m_gfx_index+3], offset/0x20); | |
| 535 | space->machine().gfx[state->m_gfx_index+0]->mark_dirty(offset/0x20); | |
| 536 | space->machine().gfx[state->m_gfx_index+1]->mark_dirty(offset/0x20); | |
| 537 | space->machine().gfx[state->m_gfx_index+2]->mark_dirty(offset/0x20); | |
| 538 | space->machine().gfx[state->m_gfx_index+3]->mark_dirty(offset/0x20); | |
| 539 | 539 | } |
| 540 | 540 | |
| 541 | 541 | |
| r17669 | r17670 | |
| 557 | 557 | assert(state->m_gfx_index != MAX_GFX_ELEMENTS); |
| 558 | 558 | |
| 559 | 559 | /* create the char set (gfx will then be updated dynamically from RAM) */ |
| 560 | machine.gfx[state->m_gfx_index+0] = gfx_element_alloc(machine, &mpu4_vid_char_8x8_layout, reinterpret_cast<UINT8 *>(state->m_vid_vidram.target()), machine.total_colors() / 16, 0); | |
| 561 | machine.gfx[state->m_gfx_index+1] = gfx_element_alloc(machine, &mpu4_vid_char_8x16_layout, reinterpret_cast<UINT8 *>(state->m_vid_vidram.target()), machine.total_colors() / 16, 0); | |
| 562 | machine.gfx[state->m_gfx_index+2] = gfx_element_alloc(machine, &mpu4_vid_char_16x8_layout, reinterpret_cast<UINT8 *>(state->m_vid_vidram.target()), machine.total_colors() / 16, 0); | |
| 563 | machine.gfx[state->m_gfx_index+3] = gfx_element_alloc(machine, &mpu4_vid_char_16x16_layout, reinterpret_cast<UINT8 *>(state->m_vid_vidram.target()), machine.total_colors() / 16, 0); | |
| 560 | machine.gfx[state->m_gfx_index+0] = auto_alloc(machine, gfx_element(machine, mpu4_vid_char_8x8_layout, reinterpret_cast<UINT8 *>(state->m_vid_vidram.target()), machine.total_colors() / 16, 0)); | |
| 561 | machine.gfx[state->m_gfx_index+1] = auto_alloc(machine, gfx_element(machine, mpu4_vid_char_8x16_layout, reinterpret_cast<UINT8 *>(state->m_vid_vidram.target()), machine.total_colors() / 16, 0)); | |
| 562 | machine.gfx[state->m_gfx_index+2] = auto_alloc(machine, gfx_element(machine, mpu4_vid_char_16x8_layout, reinterpret_cast<UINT8 *>(state->m_vid_vidram.target()), machine.total_colors() / 16, 0)); | |
| 563 | machine.gfx[state->m_gfx_index+3] = auto_alloc(machine, gfx_element(machine, mpu4_vid_char_16x16_layout, reinterpret_cast<UINT8 *>(state->m_vid_vidram.target()), machine.total_colors() / 16, 0)); | |
| 564 | 564 | |
| 565 | 565 | state->m_scn2674->init_stuff(); |
| 566 | 566 |
| r17669 | r17670 | |
|---|---|---|
| 161 | 161 | WRITE8_MEMBER(trvmadns_state::trvmadns_gfxram_w) |
| 162 | 162 | { |
| 163 | 163 | m_gfxram[offset] = data; |
| 164 | | |
| 164 | | |
| 165 | 165 | } |
| 166 | 166 | |
| 167 | 167 | WRITE8_MEMBER(trvmadns_state::trvmadns_palette_w) |
| r17669 | r17670 | |
| 287 | 287 | |
| 288 | 288 | // fg_tilemap->set_transparent_pen(1); |
| 289 | 289 | |
| 290 | | |
| 290 | | |
| 291 | 291 | } |
| 292 | 292 | |
| 293 | 293 | static SCREEN_UPDATE_IND16( trvmadns ) |
| 294 | 294 | { |
| 295 | 295 | trvmadns_state *state = screen.machine().driver_data<trvmadns_state>(); |
| 296 | 296 | int x,y,count; |
| 297 | | |
| 297 | | |
| 298 | 298 | |
| 299 | 299 | bitmap.fill(0xd, cliprect); |
| 300 | 300 |
| r17669 | r17670 | |
|---|---|---|
| 396 | 396 | // tile banking |
| 397 | 397 | if (offset < 8) |
| 398 | 398 | { |
| 399 | int maxbanks = machine().gfx[0]-> | |
| 399 | int maxbanks = machine().gfx[0]-> | |
| 400 | 400 | if (data >= maxbanks) |
| 401 | 401 | data %= maxbanks; |
| 402 | 402 | segaic16_tilemap_set_bank(machine(), 0, offset, data); |
| r17669 | r17670 | |
|---|---|---|
| 334 | 334 | { |
| 335 | 335 | coolridr_state *state = screen.machine().driver_data<coolridr_state>(); |
| 336 | 336 | /* planes seems to basically be at 0x8000 and 0x28000... */ |
| 337 | | |
| 337 | | |
| 338 | 338 | UINT32 count; |
| 339 | 339 | int y,x; |
| 340 | 340 | |
| r17669 | r17670 | |
| 691 | 691 | gfx[offset*4+2] = (m_h1_charram[offset] & 0x0000ff00) >> 8; |
| 692 | 692 | gfx[offset*4+3] = (m_h1_charram[offset] & 0x000000ff) >> 0; |
| 693 | 693 | |
| 694 | | |
| 694 | | |
| 695 | 695 | } |
| 696 | 696 | } |
| 697 | 697 |
| r17669 | r17670 | |
|---|---|---|
| 95 | 95 | { |
| 96 | 96 | tmmjprd_state *state = machine.driver_data<tmmjprd_state>(); |
| 97 | 97 | int xpos,ypos,tileno,xflip,yflip, colr; |
| 98 | | |
| 98 | | |
| 99 | 99 | int xoffs; |
| 100 | 100 | // int todraw = (state->m_spriteregs[5]&0x0fff0000)>>16; // how many sprites to draw (start/end reg..) what is the other half? |
| 101 | 101 |
| r17669 | r17670 | |
|---|---|---|
| 669 | 669 | |
| 670 | 670 | COMBINE_DATA(&m_v3t_ram[offset]); |
| 671 | 671 | |
| 672 | gfx_element_mark_dirty(machine().gfx[1], offset/0x40); | |
| 673 | gfx_element_mark_dirty(machine().gfx[3], offset/0x20); | |
| 672 | machine().gfx[1]->mark_dirty(offset/0x40); | |
| 673 | machine().gfx[3]->mark_dirty(offset/0x20); | |
| 674 | 674 | |
| 675 | 675 | data = m_v3t_ram[offset]; |
| 676 | 676 | // i think we need to swap around to decode .. endian issues? |
| r17669 | r17670 | |
|---|---|---|
| 118 | 118 | int x; |
| 119 | 119 | static const int spriteskip[] = { 1, 2, 4 }; |
| 120 | 120 | int spritesize = spriteskip[ color - 5 ]; |
| 121 | | |
| 121 | | |
| 122 | 122 | |
| 123 | 123 | for( x = 0; x < 16; x++ ) |
| 124 | 124 | { |
| 125 | 125 | int sprite = ( state->m_spriteram[ ( spriteindex / 64 ) % 6 ] & 0xf ) ^ 0xf; |
| 126 | const UINT8 *gfxdata = gfx | |
| 126 | const UINT8 *gfxdata = gfx-> | |
| 127 | 127 | |
| 128 | 128 | for( y = 0; y < 8; y++ ) |
| 129 | 129 | { |
| 130 | 130 | UINT16 *dst = &bitmap.pix16(y + ( row * 8 ), x + ( col * 16 ) ); |
| 131 | *( dst ) = *( gfxdata + ( ( spriterow + y ) * gfx-> | |
| 131 | *( dst ) = *( gfxdata + ( ( spriterow + y ) * gfx->r | |
| 132 | 132 | } |
| 133 | 133 | |
| 134 | 134 | spriteindex += spritesize; |
| r17669 | r17670 | |
|---|---|---|
| 319 | 319 | SET_TILE_INFO(0,tile,color,0); |
| 320 | 320 | } |
| 321 | 321 | |
| 322 | static void draw_single_sprite(bitmap_ind16 &dest_bmp,const rectangle &clip, | |
| 322 | static void draw_single_sprite(bitmap_ind16 &dest_bmp,const rectangle &clip, | |
| 323 | 323 | UINT32 code,UINT32 color,int flipx,int flipy,int sx,int sy, |
| 324 | 324 | int priority) |
| 325 | 325 | { |
| 326 | 326 | limenko_state *state = gfx->machine().driver_data<limenko_state>(); |
| 327 | int pal_base = gfx->color_base + gfx->color_granularity * (color % gfx->total_colors); | |
| 328 | const UINT8 *source_base = gfx_element_get_data(gfx, code % gfx->total_elements); | |
| 327 | int pal_base = gfx->colorbase() + gfx->granularity() * (color % gfx->colors()); | |
| 328 | const UINT8 *source_base = gfx->get_data(code % gfx->elements()); | |
| 329 | 329 | |
| 330 | int sprite_screen_height = ((1<<16)*gfx->height+0x8000)>>16; | |
| 331 | int sprite_screen_width = ((1<<16)*gfx->width+0x8000)>>16; | |
| 330 | int sprite_screen_height = ((1<<16)*gfx->height()+0x8000)>>16; | |
| 331 | int sprite_screen_width = ((1<<16)*gfx->width()+0x8000)>>16; | |
| 332 | 332 | |
| 333 | 333 | if (sprite_screen_width && sprite_screen_height) |
| 334 | 334 | { |
| 335 | 335 | /* compute sprite increment per screen pixel */ |
| 336 | int dx = (gfx->width<<16)/sprite_screen_width; | |
| 337 | int dy = (gfx->height<<16)/sprite_screen_height; | |
| 336 | int dx = (gfx->width()<<16)/sprite_screen_width; | |
| 337 | int dy = (gfx->height()<<16)/sprite_screen_height; | |
| 338 | 338 | |
| 339 | 339 | int ex = sx+sprite_screen_width; |
| 340 | 340 | int ey = sy+sprite_screen_height; |
| r17669 | r17670 | |
| 392 | 392 | |
| 393 | 393 | for( y=sy; y<ey; y++ ) |
| 394 | 394 | { |
| 395 | const UINT8 *source = source_base + (y_index>>16) * gfx-> | |
| 395 | const UINT8 *source = source_base + (y_index>>16) * gfx->r | |
| 396 | 396 | UINT16 *dest = &dest_bmp.pix16(y); |
| 397 | 397 | UINT8 *pri = &state->m_sprites_bitmap_pri.pix8(y); |
| 398 | 398 | |
| r17669 | r17670 | |
| 428 | 428 | UINT8 *gfx_max = base_gfx + state->memregion("gfx1")->bytes(); |
| 429 | 429 | |
| 430 | 430 | UINT8 *gfxdata; |
| 431 | gfx_element gfx(machine); | |
| 432 | 431 | |
| 433 | 432 | for(i = 0; i <= count*2; i += 2) |
| 434 | 433 | { |
| r17669 | r17670 | |
| 463 | 462 | continue; |
| 464 | 463 | |
| 465 | 464 | /* prepare GfxElement on the fly */ |
| 466 | gfx_element | |
| 465 | gfx_element | |
| 467 | 466 | |
| 468 | 467 | draw_single_sprite(state->m_sprites_bitmap,cliprect,&gfx,0,color,flipx,flipy,x,y,pri); |
| 469 | 468 |
| r17669 | r17670 | |
|---|---|---|
| 78 | 78 | poo_state *state = screen.machine().driver_data<poo_state>(); |
| 79 | 79 | int y,x; |
| 80 | 80 | int count; |
| 81 | | |
| 81 | | |
| 82 | 82 | |
| 83 | 83 | count = 0; |
| 84 | 84 |
| r17669 | r17670 | |
|---|---|---|
| 78 | 78 | { |
| 79 | 79 | drtomy_state *state = machine.driver_data<drtomy_state>(); |
| 80 | 80 | int i, x, y, ex, ey; |
| 81 | | |
| 81 | | |
| 82 | 82 | |
| 83 | 83 | static const int x_offset[2] = {0x0, 0x2}; |
| 84 | 84 | static const int y_offset[2] = {0x0, 0x1}; |
| r17669 | r17670 | |
|---|---|---|
| 2939 | 2939 | |
| 2940 | 2940 | for (x=0;x<0x200;x++) |
| 2941 | 2941 | { |
| 2942 | | |
| 2942 | | |
| 2943 | 2943 | } |
| 2944 | 2944 | |
| 2945 | 2945 | for (x=0;x<0x80;x++) |
| 2946 | 2946 | { |
| 2947 | | |
| 2947 | | |
| 2948 | 2948 | } |
| 2949 | 2949 | } |
| 2950 | 2950 |
| r17669 | r17670 | |
|---|---|---|
| 57 | 57 | { |
| 58 | 58 | #if CUSTOM_DRAW |
| 59 | 59 | kongambl_state *state = screen.machine().driver_data<kongambl_state>(); |
| 60 | | |
| 60 | | |
| 61 | 61 | UINT32 count; |
| 62 | 62 | |
| 63 | 63 | count = 0; |
| r17669 | r17670 | |
|---|---|---|
| 629 | 629 | { |
| 630 | 630 | UINT16 *source = sprites + sprites_cur_start/2 - 4; |
| 631 | 631 | |
| 632 | | |
| 632 | | |
| 633 | 633 | |
| 634 | 634 | // static int ytlim = 1; |
| 635 | 635 | // static int xtlim = 1; |
| r17669 | r17670 | |
|---|---|---|
| 80 | 80 | static VIDEO_START( mogura ) |
| 81 | 81 | { |
| 82 | 82 | mogura_state *state = machine.driver_data<mogura_state>(); |
| 83 | | |
| 83 | | |
| 84 | 84 | state->m_tilemap = tilemap_create(machine, get_mogura_tile_info, TILEMAP_SCAN_ROWS, 8, 8, 64, 32); |
| 85 | 85 | } |
| 86 | 86 | |
| r17669 | r17670 | |
| 120 | 120 | { |
| 121 | 121 | m_gfxram[offset] = data ; |
| 122 | 122 | |
| 123 | | |
| 123 | | |
| 124 | 124 | } |
| 125 | 125 | |
| 126 | 126 |
| r17669 | r17670 | |
|---|---|---|
| 181 | 181 | |
| 182 | 182 | static void ddealer_draw_video_layer( running_machine &machine, UINT16* vreg_base, UINT16* top, UINT16* bottom, bitmap_ind16 &bitmap, const rectangle &cliprect, int flipy) |
| 183 | 183 | { |
| 184 | | |
| 184 | | |
| 185 | 185 | |
| 186 | 186 | INT16 sx, sy; |
| 187 | 187 | int x,y, count; |
| r17669 | r17670 | |
|---|---|---|
| 136 | 136 | { |
| 137 | 137 | vpoker_state *state = screen.machine().driver_data<vpoker_state>(); |
| 138 | 138 | UINT8 *videoram = state->m_videoram; |
| 139 | | |
| 139 | | |
| 140 | 140 | int count = 0x0000; |
| 141 | 141 | |
| 142 | 142 | int y,x; |
| r17669 | r17670 | |
|---|---|---|
| 410 | 410 | |
| 411 | 411 | static void copy_from_nvram(running_machine &machine); |
| 412 | 412 | |
| 413 | INLINE void cps3_drawgfxzoom(bitmap_rgb32 &dest_bmp,const rectangle &clip, | |
| 413 | INLINE void cps3_drawgfxzoom(bitmap_rgb32 &dest_bmp,const rectangle &clip, | |
| 414 | 414 | unsigned int code,unsigned int color,int flipx,int flipy,int sx,int sy, |
| 415 | 415 | int transparency,int transparent_color, |
| 416 | 416 | int scalex, int scaley,bitmap_ind8 *pri_buffer,UINT32 pri_mask) |
| r17669 | r17670 | |
| 447 | 447 | { |
| 448 | 448 | if( gfx ) |
| 449 | 449 | { |
| 450 | // const pen_t *pal = &gfx->colortable[gfx->color_granularity * (color % gfx->total_colors)]; | |
| 451 | UINT32 palbase = (gfx->color_granularity * color) & 0x1ffff; | |
| 450 | // const pen_t *pal = &gfx->colortable[gfx->granularity() * (color % gfx->colors())]; | |
| 451 | UINT32 palbase = (gfx->granularity() * color) & 0x1ffff; | |
| 452 | 452 | const pen_t *pal = &state->m_mame_colours[palbase]; |
| 453 | const UINT8 *source_base = gfx | |
| 453 | const UINT8 *source_base = gfx-> | |
| 454 | 454 | |
| 455 | int sprite_screen_height = (scaley*gfx->height+0x8000)>>16; | |
| 456 | int sprite_screen_width = (scalex*gfx->width+0x8000)>>16; | |
| 455 | int sprite_screen_height = (scaley*gfx->height()+0x8000)>>16; | |
| 456 | int sprite_screen_width = (scalex*gfx->width()+0x8000)>>16; | |
| 457 | 457 | |
| 458 | 458 | if (sprite_screen_width && sprite_screen_height) |
| 459 | 459 | { |
| 460 | 460 | /* compute sprite increment per screen pixel */ |
| 461 | int dx = (gfx->width<<16)/sprite_screen_width; | |
| 462 | int dy = (gfx->height<<16)/sprite_screen_height; | |
| 461 | int dx = (gfx->width()<<16)/sprite_screen_width; | |
| 462 | int dy = (gfx->height()<<16)/sprite_screen_height; | |
| 463 | 463 | |
| 464 | 464 | int ex = sx+sprite_screen_width; |
| 465 | 465 | int ey = sy+sprite_screen_height; |
| r17669 | r17670 | |
| 520 | 520 | { |
| 521 | 521 | for( y=sy; y<ey; y++ ) |
| 522 | 522 | { |
| 523 | const UINT8 *source = source_base + (y_index>>16) * gfx-> | |
| 523 | const UINT8 *source = source_base + (y_index>>16) * gfx->r | |
| 524 | 524 | UINT32 *dest = &dest_bmp.pix32(y); |
| 525 | 525 | |
| 526 | 526 | int x, x_index = x_index_base; |
| r17669 | r17670 | |
| 539 | 539 | { |
| 540 | 540 | for( y=sy; y<ey; y++ ) |
| 541 | 541 | { |
| 542 | const UINT8 *source = source_base + (y_index>>16) * gfx-> | |
| 542 | const UINT8 *source = source_base + (y_index>>16) * gfx->r | |
| 543 | 543 | UINT32 *dest = &dest_bmp.pix32(y); |
| 544 | 544 | |
| 545 | 545 | int x, x_index = x_index_base; |
| r17669 | r17670 | |
| 559 | 559 | { |
| 560 | 560 | for( y=sy; y<ey; y++ ) |
| 561 | 561 | { |
| 562 | const UINT8 *source = source_base + (y_index>>16) * gfx-> | |
| 562 | const UINT8 *source = source_base + (y_index>>16) * gfx->r | |
| 563 | 563 | UINT32 *dest = &dest_bmp.pix32(y); |
| 564 | 564 | |
| 565 | 565 | int x, x_index = x_index_base; |
| r17669 | r17670 | |
| 579 | 579 | { |
| 580 | 580 | for( y=sy; y<ey; y++ ) |
| 581 | 581 | { |
| 582 | const UINT8 *source = source_base + (y_index>>16) * gfx-> | |
| 582 | const UINT8 *source = source_base + (y_index>>16) * gfx->r | |
| 583 | 583 | UINT32 *dest = &dest_bmp.pix32(y); |
| 584 | 584 | |
| 585 | 585 | int x, x_index = x_index_base; |
| r17669 | r17670 | |
| 589 | 589 | if( c != transparent_color ) |
| 590 | 590 | { |
| 591 | 591 | /* blending isn't 100% understood */ |
| 592 | if (gfx-> | |
| 592 | if (gfx-> | |
| 593 | 593 | { |
| 594 | 594 | // OK for sfiii2 spotlight |
| 595 | 595 | if (c&0x01) dest[x] |= 0x2000; |
| r17669 | r17670 | |
| 827 | 827 | state_save_register_global_pointer(machine, state->m_char_ram, 0x800000 /4); |
| 828 | 828 | |
| 829 | 829 | /* create the char set (gfx will then be updated dynamically from RAM) */ |
| 830 | machine.gfx[0] = gfx_element | |
| 830 | machine.gfx[0] = auto_alloc(machine, gfx_element | |
| 831 | 831 | |
| 832 | 832 | //decode_ssram(); |
| 833 | 833 | |
| 834 | 834 | /* create the char set (gfx will then be updated dynamically from RAM) */ |
| 835 | machine.gfx[1] = gfx_element_alloc(machine, &cps3_tiles16x16_layout, (UINT8 *)state->m_char_ram, machine.total_colors() / 64, 0); | |
| 836 | machine.gfx[1]->color_granularity = 64; | |
| 835 | machine.gfx[1] = auto_alloc(machine, gfx_element(machine, cps3_tiles16x16_layout, (UINT8 *)state->m_char_ram, machine.total_colors() / 64, 0)); | |
| 836 | machine.gfx[1]->set_granularity(64); | |
| 837 | 837 | |
| 838 | 838 | //decode_charram(); |
| 839 | 839 | |
| r17669 | r17670 | |
| 926 | 926 | yflip = (dat & 0x00000800)>>11; |
| 927 | 927 | xflip = (dat & 0x00001000)>>12; |
| 928 | 928 | |
| 929 | if (!bpp) machine.gfx[1]->color_granularity=256; | |
| 930 | else machine.gfx[1]->color_granularity=64; | |
| 929 | if (!bpp) machine.gfx[1]->set_granularity(256); | |
| 930 | else machine.gfx[1]->set_granularity(64); | |
| 931 | 931 | |
| 932 | 932 | cps3_drawgfxzoom(bitmap,clip,machine.gfx[1],tileno,colour,xflip,yflip,(x*16)-scrollx%16,drawline-tilesubline,CPS3_TRANSPARENCY_PEN_INDEX,0, 0x10000, 0x10000, NULL, 0); |
| 933 | 933 | } |
| r17669 | r17670 | |
| 1157 | 1157 | /* use the bpp value from the main list or the sublists? */ |
| 1158 | 1158 | if (whichbpp) |
| 1159 | 1159 | { |
| 1160 | if (!global_bpp) screen.machine().gfx[1]->color_granularity=256; | |
| 1161 | else screen.machine().gfx[1]->color_granularity=64; | |
| 1160 | if (!global_bpp) screen.machine().gfx[1]->set_granularity(256); | |
| 1161 | else screen.machine().gfx[1]->set_granularity(64); | |
| 1162 | 1162 | } |
| 1163 | 1163 | else |
| 1164 | 1164 | { |
| 1165 | if (!bpp) screen.machine().gfx[1]->color_granularity=256; | |
| 1166 | else screen.machine().gfx[1]->color_granularity=64; | |
| 1165 | if (!bpp) screen.machine().gfx[1]->set_granularity(256); | |
| 1166 | else screen.machine().gfx[1]->set_granularity(64); | |
| 1167 | 1167 | } |
| 1168 | 1168 | |
| 1169 | 1169 | { |
| r17669 | r17670 | |
| 1264 | 1264 | // we only want to endian-flip the character data, the tilemap info is fine |
| 1265 | 1265 | data = LITTLE_ENDIANIZE_INT32(data); |
| 1266 | 1266 | mem_mask = LITTLE_ENDIANIZE_INT32(mem_mask); |
| 1267 | | |
| 1267 | | |
| 1268 | 1268 | } |
| 1269 | 1269 | |
| 1270 | 1270 | COMBINE_DATA(&m_ss_ram[offset]); |
| r17669 | r17670 | |
| 1356 | 1356 | mem_mask = LITTLE_ENDIANIZE_INT32(mem_mask); |
| 1357 | 1357 | data = LITTLE_ENDIANIZE_INT32(data); |
| 1358 | 1358 | COMBINE_DATA(&m_char_ram[fulloffset]); |
| 1359 | | |
| 1359 | | |
| 1360 | 1360 | } |
| 1361 | 1361 | |
| 1362 | 1362 | /* FLASH ROM ACCESS */ |
| r17669 | r17670 | |
| 1822 | 1822 | while (state->m_rle_length) |
| 1823 | 1823 | { |
| 1824 | 1824 | dest[((destination+tranfercount)&0x7fffff)^3] = (state->m_last_normal_byte&0x3f); |
| 1825 | | |
| 1825 | | |
| 1826 | 1826 | //printf("RLE WRite Byte %08x, %02x\n", destination+tranfercount, real_byte); |
| 1827 | 1827 | |
| 1828 | 1828 | tranfercount++; |
| r17669 | r17670 | |
| 1841 | 1841 | //printf("Write Normal Data\n"); |
| 1842 | 1842 | dest[(destination&0x7fffff)^3] = real_byte; |
| 1843 | 1843 | state->m_last_normal_byte = real_byte; |
| 1844 | | |
| 1844 | | |
| 1845 | 1845 | return 1; |
| 1846 | 1846 | } |
| 1847 | 1847 | } |
| r17669 | r17670 | |
| 1912 | 1912 | for(i=0;i<rle;++i) |
| 1913 | 1913 | { |
| 1914 | 1914 | destRAM[(dst_offset&0x7fffff)^3] = state->m_lastb; |
| 1915 | | |
| 1915 | | |
| 1916 | 1916 | |
| 1917 | 1917 | dst_offset++; |
| 1918 | 1918 | ++l; |
| r17669 | r17670 | |
| 1926 | 1926 | state->m_lastb2=state->m_lastb; |
| 1927 | 1927 | state->m_lastb=b; |
| 1928 | 1928 | destRAM[(dst_offset&0x7fffff)^3] = b; |
| 1929 | | |
| 1929 | | |
| 1930 | 1930 | return 1; |
| 1931 | 1931 | } |
| 1932 | 1932 | } |
| r17669 | r17670 | |
|---|---|---|
| 73 | 73 | { |
| 74 | 74 | neoprint_state *state = machine.driver_data<neoprint_state>(); |
| 75 | 75 | int i, y, x; |
| 76 | | |
| 76 | | |
| 77 | 77 | INT16 scrollx, scrolly; |
| 78 | 78 | |
| 79 | 79 | i = (state->m_npvidregs[((layer*8)+0x06)/2] & 7) * 0x1000/4; |
| r17669 | r17670 | |
|---|---|---|
| 930 | 930 | |
| 931 | 931 | offset += (m_scroll[0x76/2] & 0xf) * 0x40000/2; |
| 932 | 932 | COMBINE_DATA(&m_eaglshot_gfxram[offset]); |
| 933 | gfx_element_mark_dirty(machine().gfx[0], offset / (16*8/2)); | |
| 934 | gfx_element_mark_dirty(machine().gfx[1], offset / (16*8/2)); | |
| 933 | machine().gfx[0]->mark_dirty(offset / (16*8/2)); | |
| 934 | machine().gfx[1]->mark_dirty(offset / (16*8/2)); | |
| 935 | 935 | } |
| 936 | 936 | |
| 937 | 937 |
| r17669 | r17670 | |
|---|---|---|
| 149 | 149 | |
| 150 | 150 | static void draw_sprites(running_machine &machine, bitmap_rgb32 &bitmap, const rectangle &cliprect, UINT8 *spriteram, UINT16 tile_bank ) |
| 151 | 151 | { |
| 152 | | |
| 152 | | |
| 153 | 153 | int i,spr_offs,x,y,col,fx,fy; |
| 154 | 154 | |
| 155 | 155 | /* |
| r17669 | r17670 | |
| 195 | 195 | static SCREEN_UPDATE_RGB32( rblaster ) |
| 196 | 196 | { |
| 197 | 197 | deco_ld_state *state = screen.machine().driver_data<deco_ld_state>(); |
| 198 | | |
| 198 | | |
| 199 | 199 | int y,x; |
| 200 | 200 | |
| 201 | 201 | bitmap.fill(0, cliprect); |
| r17669 | r17670 | |
|---|---|---|
| 166 | 166 | { |
| 167 | 167 | offset |= (0 * 0x800) | 0x400 | m_character_ram_page_start; |
| 168 | 168 | m_character_ram[offset] = data; |
| 169 | | |
| 169 | | |
| 170 | 170 | } |
| 171 | 171 | else |
| 172 | 172 | s2636_work_ram_w(m_s2636_0, offset, data); |
| r17669 | r17670 | |
| 189 | 189 | { |
| 190 | 190 | offset |= (1 * 0x800) | 0x400 | m_character_ram_page_start; |
| 191 | 191 | m_character_ram[offset] = data; |
| 192 | | |
| 192 | | |
| 193 | 193 | } |
| 194 | 194 | else |
| 195 | 195 | s2636_work_ram_w(m_s2636_1, offset, data); |
| r17669 | r17670 | |
| 212 | 212 | { |
| 213 | 213 | offset |= (2 * 0x800) | 0x400 | m_character_ram_page_start; |
| 214 | 214 | m_character_ram[offset] = data; |
| 215 | | |
| 215 | | |
| 216 | 216 | } |
| 217 | 217 | else |
| 218 | 218 | s2636_work_ram_w(m_s2636_2, offset, data); |
| r17669 | r17670 | |
| 994 | 994 | |
| 995 | 995 | /* allocate memory */ |
| 996 | 996 | if (machine.gfx[1] != NULL) |
| 997 | | |
| 997 | | |
| 998 | 998 | |
| 999 | 999 | start_393hz_timer(machine); |
| 1000 | 1000 |
| r17669 | r17670 | |
|---|---|---|
| 393 | 393 | playmark_state *state = machine.driver_data<playmark_state>(); |
| 394 | 394 | UINT16 *spriteram = state->m_spriteram; |
| 395 | 395 | int offs; |
| 396 | int height = machine.gfx[0]->height; | |
| 396 | int height = machine.gfx[0]->height(); | |
| 397 | 397 | |
| 398 | 398 | for (offs = 4; offs < state->m_spriteram.bytes() / 2; offs += 4) |
| 399 | 399 | { |
| r17669 | r17670 | |
|---|---|---|
| 179 | 179 | { |
| 180 | 180 | blackt96_state *state = machine.driver_data<blackt96_state>(); |
| 181 | 181 | /* the very first 'page' in the spriteram contains the x/y positions for each tile strip */ |
| 182 | const gfx_element *gfxbg = machine.gfx[0]; | |
| 183 | const gfx_element *gfxspr = machine.gfx[1]; | |
| 182 | gfx_element *gfxbg = machine.gfx[0]; | |
| 183 | gfx_element *gfxspr = machine.gfx[1]; | |
| 184 | 184 | |
| 185 | 185 | int base = column * (0x80/2); |
| 186 | 186 | base += page * 2; |
| r17669 | r17670 | |
| 225 | 225 | blackt96_state *state = screen.machine().driver_data<blackt96_state>(); |
| 226 | 226 | int count; |
| 227 | 227 | int x,y; |
| 228 | | |
| 228 | | |
| 229 | 229 | |
| 230 | 230 | bitmap.fill(get_black_pen(screen.machine()), cliprect); |
| 231 | 231 |
| r17669 | r17670 | |
|---|---|---|
| 82 | 82 | static VIDEO_START( ace ) |
| 83 | 83 | { |
| 84 | 84 | aceal_state *state = machine.driver_data<aceal_state>(); |
| 85 | gfx_element_set_source(machine.gfx[1], state->m_characterram); | |
| 86 | gfx_element_set_source(machine.gfx[2], state->m_characterram); | |
| 87 | gfx_element_set_source(machine.gfx[3], state->m_characterram); | |
| 88 | gfx_element_set_source(machine.gfx[4], state->m_scoreram); | |
| 85 | machine.gfx[1]->set_source(state->m_characterram); | |
| 86 | machine.gfx[2]->set_source(state->m_characterram); | |
| 87 | machine.gfx[3]->set_source(state->m_characterram); | |
| 88 | machine.gfx[4]->set_source(state->m_scoreram); | |
| 89 | 89 | } |
| 90 | 90 | |
| 91 | 91 | static SCREEN_UPDATE_IND16( ace ) |
| r17669 | r17670 | |
| 144 | 144 | popmessage("write to %04x data = %02x\n", 0x8000 + offset, data); |
| 145 | 145 | } |
| 146 | 146 | m_characterram[offset] = data; |
| 147 | gfx_element_mark_dirty(machine().gfx[1], 0); | |
| 148 | gfx_element_mark_dirty(machine().gfx[2], 0); | |
| 149 | gfx_element_mark_dirty(machine().gfx[3], 0); | |
| 147 | machine().gfx[1]->mark_dirty(0); | |
| 148 | machine().gfx[2]->mark_dirty(0); | |
| 149 | machine().gfx[3]->mark_dirty(0); | |
| 150 | 150 | } |
| 151 | 151 | } |
| 152 | 152 | |
| 153 | 153 | WRITE8_MEMBER(aceal_state::ace_scoreram_w) |
| 154 | 154 | { |
| 155 | 155 | m_scoreram[offset] = data; |
| 156 | | |
| 156 | | |
| 157 | 157 | } |
| 158 | 158 | |
| 159 | 159 | READ8_MEMBER(aceal_state::unk_r) |
| r17669 | r17670 | |
| 323 | 323 | |
| 324 | 324 | static void ace_postload(running_machine &machine) |
| 325 | 325 | { |
| 326 | gfx_element_mark_dirty(machine.gfx[1], 0); | |
| 327 | gfx_element_mark_dirty(machine.gfx[2], 0); | |
| 328 | gfx_element_mark_dirty(machine.gfx[3], 0); | |
| 329 | gfx_element_mark_dirty(machine.gfx[4], 0); | |
| 326 | machine.gfx[1]->mark_dirty(0); | |
| 327 | machine.gfx[2]->mark_dirty(0); | |
| 328 | machine.gfx[3]->mark_dirty(0); | |
| 329 | machine.gfx[4]->mark_dirty(0); | |
| 330 | 330 | } |
| 331 | 331 | |
| 332 | 332 | static MACHINE_START( ace ) |
| r17669 | r17670 | |
|---|---|---|
| 165 | 165 | static void draw_sprites( running_machine &machine, bitmap_ind16 &bitmap, const rectangle &cliprect ) |
| 166 | 166 | { |
| 167 | 167 | dreamwld_state *state = machine.driver_data<dreamwld_state>(); |
| 168 | | |
| 168 | | |
| 169 | 169 | UINT32 *source = state->m_spritebuf1; |
| 170 | 170 | UINT32 *finish = state->m_spritebuf1 + 0x1000 / 4; |
| 171 | 171 | UINT16 *redirect = (UINT16 *)state->memregion("spritelut")->base(); |
| r17669 | r17670 | |
|---|---|---|
| 191 | 191 | { |
| 192 | 192 | for (x=0;x<32;x++) |
| 193 | 193 | { |
| 194 | | |
| 194 | | |
| 195 | 195 | int tile = state->m_bank << 8 | state->m_vram[x+y*0x100]; |
| 196 | 196 | int color = state->m_cram[x+y*0x100] & 0x3f; |
| 197 | 197 |
| r17669 | r17670 | |
|---|---|---|
| 88 | 88 | |
| 89 | 89 | static VIDEO_START( dominob ) |
| 90 | 90 | { |
| 91 | machine.gfx[0]-> | |
| 91 | machine.gfx[0]->set | |
| 92 | 92 | } |
| 93 | 93 | |
| 94 | 94 | static void draw_sprites( running_machine &machine, bitmap_ind16 &bitmap, const rectangle &cliprect ) |
| r17669 | r17670 | |
|---|---|---|
| 46 | 46 | static SCREEN_UPDATE_IND16(jackpool) |
| 47 | 47 | { |
| 48 | 48 | jackpool_state *state = screen.machine().driver_data<jackpool_state>(); |
| 49 | | |
| 49 | | |
| 50 | 50 | int count;// = 0x00000/2; |
| 51 | 51 | |
| 52 | 52 | int y,x; |
| r17669 | r17670 | |
|---|---|---|
| 163 | 163 | static void draw_tilemap(running_machine &machine, bitmap_ind16 &bitmap, const rectangle &cliprect, UINT8 draw_flag) |
| 164 | 164 | { |
| 165 | 165 | mirax_state *state = machine.driver_data<mirax_state>(); |
| 166 | | |
| 166 | | |
| 167 | 167 | int y,x; |
| 168 | 168 | int res_x,res_y,wrapy; |
| 169 | 169 |
| r17669 | r17670 | |
|---|---|---|
| 137 | 137 | palette_set_color(machine, i, cga_palette[i]); |
| 138 | 138 | } |
| 139 | 139 | |
| 140 | static void draw_char(bitmap_ind16 &bitmap, const rectangle &cliprect, | |
| 140 | static void draw_char(bitmap_ind16 &bitmap, const rectangle &cliprect, | |
| 141 | 141 | { |
| 142 | 142 | int i,j; |
| 143 | 143 | const UINT8 *dp; |
| 144 | 144 | int index = 0; |
| 145 | dp = gfx | |
| 145 | dp = gfx-> | |
| 146 | 146 | |
| 147 | 147 | for (j=y; j < y+8; j++) |
| 148 | 148 | { |
| r17669 | r17670 | |
| 152 | 152 | { |
| 153 | 153 | UINT8 pen = dp[index++]; |
| 154 | 154 | if (pen) |
| 155 | p[i] = gfx->color | |
| 155 | p[i] = gfx->color | |
| 156 | 156 | else |
| 157 | p[i] = gfx->color | |
| 157 | p[i] = gfx->color | |
| 158 | 158 | } |
| 159 | 159 | } |
| 160 | 160 | } |
| r17669 | r17670 | |
| 163 | 163 | { |
| 164 | 164 | gamecstl_state *state = screen.machine().driver_data<gamecstl_state>(); |
| 165 | 165 | int i, j; |
| 166 | | |
| 166 | | |
| 167 | 167 | UINT32 *cga = state->m_cga_ram; |
| 168 | 168 | int index = 0; |
| 169 | 169 |
| r17669 | r17670 | |
|---|---|---|
| 6872 | 6872 | if (dest == memregion("gfx1")->base()) |
| 6873 | 6873 | { |
| 6874 | 6874 | // we need to re-decode the tiles if writing to this area to keep MAME happy |
| 6875 | | |
| 6875 | | |
| 6876 | 6876 | } |
| 6877 | 6877 | } |
| 6878 | 6878 | } |
| r17669 | r17670 | |
|---|---|---|
| 162 | 162 | state->m_sprram_old = auto_alloc_array_clear(machine, UINT16, 0x80000/2); |
| 163 | 163 | |
| 164 | 164 | /* create the char set (gfx will then be updated dynamically from RAM) */ |
| 165 | machine.gfx[0] = gfx_element_alloc(machine, &tiles8x8_layout, (UINT8*)state->m_tileram, machine.total_colors() / 256, 0); | |
| 166 | machine.gfx[0]->color_granularity=256; | |
| 165 | machine.gfx[0] = auto_alloc(machine, gfx_element(machine, tiles8x8_layout, (UINT8*)state->m_tileram, machine.total_colors() / 256, 0)); | |
| 166 | machine.gfx[0]->set_granularity(256); | |
| 167 | 167 | |
| 168 | 168 | state->m_brightness = 0x60; |
| 169 | 169 | } |
| r17669 | r17670 | |
| 391 | 391 | for(i=0;i<rle;++i) |
| 392 | 392 | { |
| 393 | 393 | tram[dst_offset + state->m_destl] = state->m_lastb; |
| 394 | | |
| 394 | | |
| 395 | 395 | |
| 396 | 396 | dst_offset++; |
| 397 | 397 | ++l; |
| r17669 | r17670 | |
| 405 | 405 | state->m_lastb2 = state->m_lastb; |
| 406 | 406 | state->m_lastb = b; |
| 407 | 407 | tram[dst_offset + state->m_destl] = b; |
| 408 | | |
| 408 | | |
| 409 | 409 | |
| 410 | 410 | return 1; |
| 411 | 411 | } |
| r17669 | r17670 | |
|---|---|---|
| 265 | 265 | { |
| 266 | 266 | rabbit_state *state = machine.driver_data<rabbit_state>(); |
| 267 | 267 | int xpos,ypos,tileno,xflip,yflip, colr; |
| 268 | | |
| 268 | | |
| 269 | 269 | int todraw = (state->m_spriteregs[5]&0x0fff0000)>>16; // how many sprites to draw (start/end reg..) what is the other half? |
| 270 | 270 | |
| 271 | 271 | UINT32 *source = (state->m_spriteram+ (todraw*2))-2; |
| r17669 | r17670 | |
|---|---|---|
| 114 | 114 | // iterate over all used gfx types and set the dirty flag if any of them have changed |
| 115 | 115 | for (int gfxnum = 0; usedmask != 0; usedmask >>= 1, gfxnum++) |
| 116 | 116 | if ((usedmask & 1) != 0) |
| 117 | if (m_gfx_dirtyseq[gfxnum] != machine().gfx[gfxnum]->dirtyseq) | |
| 117 | if (m_gfx_dirtyseq[gfxnum] != machine().gfx[gfxnum]->dirtyseq()) | |
| 118 | 118 | { |
| 119 | m_gfx_dirtyseq[gfxnum] = machine().gfx[gfxnum]->dirtyseq; | |
| 119 | m_gfx_dirtyseq[gfxnum] = machine().gfx[gfxnum]->dirtyseq(); | |
| 120 | 120 | isdirty = true; |
| 121 | 121 | } |
| 122 | 122 | |
| r17669 | r17670 | |
| 756 | 756 | if (m_tileinfo.gfxnum != 0xff && (m_gfx_used & (1 << m_tileinfo.gfxnum)) == 0) |
| 757 | 757 | { |
| 758 | 758 | m_gfx_used |= 1 << m_tileinfo.gfxnum; |
| 759 | m_gfx_dirtyseq[m_tileinfo.gfxnum] = machine().gfx[m_tileinfo.gfxnum]->dirtyseq; | |
| 759 | m_gfx_dirtyseq[m_tileinfo.gfxnum] = machine().gfx[m_tileinfo.gfxnum]->dirtyseq(); | |
| 760 | 760 | } |
| 761 | 761 | |
| 762 | 762 | g_profiler.stop(); |
| r17669 | r17670 | |
|---|---|---|
| 408 | 408 | |
| 409 | 409 | void set(running_machine &machine, int _gfxnum, int rawcode, int rawcolor, int _flags) |
| 410 | 410 | { |
| 411 | const gfx_element *gfx = machine.gfx[_gfxnum]; | |
| 412 | int code = rawcode % gfx->total_elements; | |
| 413 | pen_data = gfx_element_get_data(gfx, code); | |
| 414 | palette_base = gfx->color_base + gfx->color_granularity * rawcolor; | |
| 411 | gfx_element *gfx = machine.gfx[_gfxnum]; | |
| 412 | int code = rawcode % gfx->elements(); | |
| 413 | pen_data = gfx->get_data(code); | |
| 414 | palette_base = gfx->colorbase() + gfx->granularity() * rawcolor; | |
| 415 | 415 | flags = _flags; |
| 416 | 416 | gfxnum = _gfxnum; |
| 417 | 417 | } |
| 418 | 418 | |
| 419 | void set(running_machine &machine, | |
| 419 | void set(running_machine &machine, | |
| 420 | 420 | { |
| 421 | int code = rawcode % gfx.total_elements; | |
| 422 | pen_data = gfx_element_get_data(&gfx, code); | |
| 423 | palette_base = gfx.color_base + gfx.color_granularity * rawcolor; | |
| 421 | int code = rawcode % gfx.elements(); | |
| 422 | pen_data = gfx.get_data(code); | |
| 423 | palette_base = gfx.colorbase() + gfx.granularity() * rawcolor; | |
| 424 | 424 | flags = _flags; |
| 425 | 425 | } |
| 426 | 426 | }; |
| r17669 | r17670 | |
|---|---|---|
| 528 | 528 | |
| 529 | 529 | // free all the graphics elements |
| 530 | 530 | for (int i = 0; i < MAX_GFX_ELEMENTS; i++) |
| 531 | | |
| 531 | au | |
| 532 | 532 | |
| 533 | 533 | // free the snapshot target |
| 534 | 534 | machine().render().target_free(m_snap_target); |
| r17669 | r17670 | |
|---|---|---|
| 434 | 434 | color |
| 435 | 435 | -------------------------------------------------*/ |
| 436 | 436 | |
| 437 | UINT32 colortable_get_transpen_mask(colortable_t *ctable, | |
| 437 | UINT32 colortable_get_transpen_mask(colortable_t *ctable, | |
| 438 | 438 | { |
| 439 | UINT32 entry = gfx->color | |
| 439 | UINT32 entry = gfx->color | |
| 440 | 440 | UINT32 mask = 0; |
| 441 | 441 | UINT32 count, bit; |
| 442 | 442 | |
| 443 | 443 | /* make sure we are in range */ |
| 444 | 444 | assert(ctable != NULL); |
| 445 | 445 | assert(entry < ctable->entries); |
| 446 | assert(gfx-> | |
| 446 | assert(gfx-> | |
| 447 | 447 | |
| 448 | 448 | /* either gfx->color_depth entries or as many as we can get up until the end */ |
| 449 | count = MIN(gfx-> | |
| 449 | count = MIN(gfx-> | |
| 450 | 450 | |
| 451 | 451 | /* set a bit anywhere the transcolor matches */ |
| 452 | 452 | for (bit = 0; bit < count; bit++) |
| r17669 | r17670 | |
| 465 | 465 | (each group maps to a gfx color) |
| 466 | 466 | -------------------------------------------------*/ |
| 467 | 467 | |
| 468 | void colortable_configure_tilemap_groups(colortable_t *ctable, tilemap_t *tmap, | |
| 468 | void colortable_configure_tilemap_groups(colortable_t *ctable, tilemap_t *tmap, | |
| 469 | 469 | { |
| 470 | 470 | int color; |
| 471 | 471 | |
| 472 | 472 | assert(ctable != NULL); |
| 473 | 473 | assert(gfx != NULL); |
| 474 | 474 | assert(tmap != NULL); |
| 475 | assert(gfx-> | |
| 475 | assert(gfx-> | |
| 476 | 476 | |
| 477 | 477 | /* iterate over all colors in the tilemap */ |
| 478 | for (color = 0; color < gfx-> | |
| 478 | for (color = 0; color < gfx-> | |
| 479 | 479 | tmap->set_transmask(color, colortable_get_transpen_mask(ctable, gfx, color, transcolor), 0); |
| 480 | 480 | } |
| 481 | 481 |
| r17669 | r17670 | |
|---|---|---|
| 166 | 166 | rgb_t colortable_palette_get_color(colortable_t *ctable, UINT32 entry); |
| 167 | 167 | |
| 168 | 168 | /* return a 32-bit transparency mask for a given gfx element and color */ |
| 169 | UINT32 colortable_get_transpen_mask(colortable_t *ctable, | |
| 169 | UINT32 colortable_get_transpen_mask(colortable_t *ctable, | |
| 170 | 170 | |
| 171 | 171 | /* configure groups in a tilemap to represent transparency based on colortable entries (each group maps to a gfx color) */ |
| 172 | void colortable_configure_tilemap_groups(colortable_t *ctable, tilemap_t *tmap, | |
| 172 | void colortable_configure_tilemap_groups(colortable_t *ctable, tilemap_t *tmap, | |
| 173 | 173 | |
| 174 | 174 | /* return the number of entries in a colortable */ |
| 175 | 175 | UINT32 colortable_palette_get_size(colortable_t *ctable); |
| r17669 | r17670 | |
|---|---|---|
| 84 | 84 | |
| 85 | 85 | /* graphics set handling */ |
| 86 | 86 | static void gfxset_handle_keys(running_machine &machine, ui_gfx_state *state, int xcells, int ycells); |
| 87 | static void gfxset_draw_item(running_machine &machine, | |
| 87 | static void gfxset_draw_item(running_machine &machine, | |
| 88 | 88 | static void gfxset_update_bitmap(running_machine &machine, ui_gfx_state *state, int xcells, int ycells, gfx_element *gfx); |
| 89 | 89 | static void gfxset_handler(running_machine &machine, render_container *container, ui_gfx_state *state); |
| 90 | 90 | |
| r17669 | r17670 | |
| 473 | 473 | cellboxheight = (cellboxbounds.y1 - cellboxbounds.y0) * (float)targheight; |
| 474 | 474 | |
| 475 | 475 | /* compute the number of source pixels in a cell */ |
| 476 | cellxpix = 1 + ((state->gfxset.rotate[state->gfxset.set] & ORIENTATION_SWAP_XY) ? gfx->height : gfx->width); | |
| 477 | cellypix = 1 + ((state->gfxset.rotate[state->gfxset.set] & ORIENTATION_SWAP_XY) ? gfx->width : gfx->height); | |
| 476 | cellxpix = 1 + ((state->gfxset.rotate[state->gfxset.set] & ORIENTATION_SWAP_XY) ? gfx->height() : gfx->width()); | |
| 477 | cellypix = 1 + ((state->gfxset.rotate[state->gfxset.set] & ORIENTATION_SWAP_XY) ? gfx->width() : gfx->height()); | |
| 478 | 478 | |
| 479 | 479 | /* compute the largest pixel scale factor that still fits */ |
| 480 | 480 | xcells = state->gfxset.count[set]; |
| r17669 | r17670 | |
| 513 | 513 | |
| 514 | 514 | /* figure out the title and expand the outer box to fit */ |
| 515 | 515 | for (x = 0; x < MAX_GFX_ELEMENTS && machine.gfx[x] != NULL; x++) ; |
| 516 | sprintf(title, "GFX %d/%d %dx%d COLOR %X", state->gfxset.set, x - 1, gfx->width, gfx->height, state->gfxset.color[set]); | |
| 516 | sprintf(title, "GFX %d/%d %dx%d COLOR %X", state->gfxset.set, x - 1, gfx->width(), gfx->height(), state->gfxset.color[set]); | |
| 517 | 517 | titlewidth = ui_font->string_width(chheight, machine.render().ui_aspect(), title); |
| 518 | 518 | x0 = 0.0f; |
| 519 | 519 | if (boxbounds.x1 - boxbounds.x0 < titlewidth + chwidth) |
| r17669 | r17670 | |
| 550 | 550 | for (y = 0; y < ycells; y += 1 + skip) |
| 551 | 551 | |
| 552 | 552 | /* only display if there is data to show */ |
| 553 | if (state->gfxset.offset[set] + y * xcells < gfx-> | |
| 553 | if (state->gfxset.offset[set] + y * xcells < gfx-> | |
| 554 | 554 | { |
| 555 | 555 | char buffer[10]; |
| 556 | 556 | |
| r17669 | r17670 | |
| 645 | 645 | if (ui_input_pressed_repeat(machine, IPT_UI_HOME, 4)) |
| 646 | 646 | state->gfxset.offset[set] = 0; |
| 647 | 647 | if (ui_input_pressed_repeat(machine, IPT_UI_END, 4)) |
| 648 | state->gfxset.offset[set] = gfx-> | |
| 648 | state->gfxset.offset[set] = gfx-> | |
| 649 | 649 | |
| 650 | 650 | /* clamp within range */ |
| 651 | if (state->gfxset.offset[set] + xcells * ycells > ((gfx->total_elements + xcells - 1) / xcells) * xcells) | |
| 652 | state->gfxset.offset[set] = ((gfx->total_elements + xcells - 1) / xcells) * xcells - xcells * ycells; | |
| 651 | if (state->gfxset.offset[set] + xcells * ycells > ((gfx->elements() + xcells - 1) / xcells) * xcells) | |
| 652 | state->gfxset.offset[set] = ((gfx->elements() + xcells - 1) / xcells) * xcells - xcells * ycells; | |
| 653 | 653 | if (state->gfxset.offset[set] < 0) |
| 654 | 654 | state->gfxset.offset[set] = 0; |
| 655 | 655 | |
| r17669 | r17670 | |
| 660 | 660 | state->gfxset.color[set] += 1; |
| 661 | 661 | |
| 662 | 662 | /* clamp within range */ |
| 663 | if (state->gfxset.color[set] >= (int)gfx->total_colors) | |
| 664 | state->gfxset.color[set] = gfx->total_colors - 1; | |
| 663 | if (state->gfxset.color[set] >= (int)gfx->colors()) | |
| 664 | state->gfxset.color[set] = gfx->colors() - 1; | |
| 665 | 665 | if (state->gfxset.color[set] < 0) |
| 666 | 666 | state->gfxset.color[set] = 0; |
| 667 | 667 | |
| r17669 | r17670 | |
| 689 | 689 | int x, y; |
| 690 | 690 | |
| 691 | 691 | /* compute the number of source pixels in a cell */ |
| 692 | cellxpix = 1 + ((state->gfxset.rotate[set] & ORIENTATION_SWAP_XY) ? gfx->height : gfx->width); | |
| 693 | cellypix = 1 + ((state->gfxset.rotate[set] & ORIENTATION_SWAP_XY) ? gfx->width : gfx->height); | |
| 692 | cellxpix = 1 + ((state->gfxset.rotate[set] & ORIENTATION_SWAP_XY) ? gfx->height() : gfx->width()); | |
| 693 | cellypix = 1 + ((state->gfxset.rotate[set] & ORIENTATION_SWAP_XY) ? gfx->width() : gfx->height()); | |
| 694 | 694 | |
| 695 | 695 | /* realloc the bitmap if it is too small */ |
| 696 | 696 | if (state->bitmap == NULL || state->texture == NULL || state->bitmap->bpp() != 32 || state->bitmap->width() != cellxpix * xcells || state->bitmap->height() != cellypix * ycells) |
| r17669 | r17670 | |
| 720 | 720 | cellbounds.set(0, state->bitmap->width() - 1, y * cellypix, (y + 1) * cellypix - 1); |
| 721 | 721 | |
| 722 | 722 | /* only display if there is data to show */ |
| 723 | if (state->gfxset.offset[set] + y * xcells < gfx-> | |
| 723 | if (state->gfxset.offset[set] + y * xcells < gfx-> | |
| 724 | 724 | { |
| 725 | 725 | /* draw the individual cells */ |
| 726 | 726 | for (x = 0; x < xcells; x++) |
| r17669 | r17670 | |
| 732 | 732 | cellbounds.max_x = (x + 1) * cellxpix - 1; |
| 733 | 733 | |
| 734 | 734 | /* only render if there is data */ |
| 735 | if (index < gfx-> | |
| 735 | if (index < gfx-> | |
| 736 | 736 | gfxset_draw_item(machine, gfx, index, *state->bitmap, cellbounds.min_x, cellbounds.min_y, state->gfxset.color[set], state->gfxset.rotate[set]); |
| 737 | 737 | |
| 738 | 738 | /* otherwise, fill with transparency */ |
| r17669 | r17670 | |
| 758 | 758 | the view |
| 759 | 759 | -------------------------------------------------*/ |
| 760 | 760 | |
| 761 | static void gfxset_draw_item(running_machine &machine, | |
| 761 | static void gfxset_draw_item(running_machine &machine, | |
| 762 | 762 | { |
| 763 | 763 | static const pen_t default_palette[] = |
| 764 | 764 | { |
| 765 | 765 | MAKE_RGB(0,0,0), MAKE_RGB(0,0,255), MAKE_RGB(0,255,0), MAKE_RGB(0,255,255), |
| 766 | 766 | MAKE_RGB(255,0,0), MAKE_RGB(255,0,255), MAKE_RGB(255,255,0), MAKE_RGB(255,255,255) |
| 767 | 767 | }; |
| 768 | int width = (rotate & ORIENTATION_SWAP_XY) ? gfx->height : gfx->width; | |
| 769 | int height = (rotate & ORIENTATION_SWAP_XY) ? gfx->width : gfx->height; | |
| 768 | int width = (rotate & ORIENTATION_SWAP_XY) ? gfx->height() : gfx->width(); | |
| 769 | int height = (rotate & ORIENTATION_SWAP_XY) ? gfx->width() : gfx->height(); | |
| 770 | 770 | const rgb_t *palette = (machine.total_colors() != 0) ? palette_entry_list_raw(machine.palette) : NULL; |
| 771 | 771 | UINT32 palette_mask = ~0; |
| 772 | 772 | int x, y; |
| 773 | 773 | |
| 774 | 774 | if (palette != NULL) |
| 775 | palette += gfx->color | |
| 775 | palette += gfx->color | |
| 776 | 776 | else |
| 777 | 777 | { |
| 778 | 778 | palette = default_palette; |
| r17669 | r17670 | |
| 783 | 783 | for (y = 0; y < height; y++) |
| 784 | 784 | { |
| 785 | 785 | UINT32 *dest = &bitmap.pix32(dsty + y, dstx); |
| 786 | const UINT8 *src = gfx | |
| 786 | const UINT8 *src = gfx-> | |
| 787 | 787 | |
| 788 | 788 | /* loop over columns in the cell */ |
| 789 | 789 | for (x = 0; x < width; x++) |
| r17669 | r17670 | |
| 795 | 795 | if (!(rotate & ORIENTATION_SWAP_XY)) |
| 796 | 796 | { |
| 797 | 797 | if (rotate & ORIENTATION_FLIP_X) |
| 798 | effx = gfx->width - 1 - effx; | |
| 798 | effx = gfx->width() - 1 - effx; | |
| 799 | 799 | if (rotate & ORIENTATION_FLIP_Y) |
| 800 | effy = gfx->height - 1 - effy; | |
| 800 | effy = gfx->height() - 1 - effy; | |
| 801 | 801 | } |
| 802 | 802 | else |
| 803 | 803 | { |
| 804 | 804 | int temp; |
| 805 | 805 | if (rotate & ORIENTATION_FLIP_X) |
| 806 | effx = gfx->height - 1 - effx; | |
| 806 | effx = gfx->height() - 1 - effx; | |
| 807 | 807 | if (rotate & ORIENTATION_FLIP_Y) |
| 808 | effy = gfx->width - 1 - effy; | |
| 808 | effy = gfx->width() - 1 - effy; | |
| 809 | 809 | temp = effx; effx = effy; effy = temp; |
| 810 | 810 | } |
| 811 | 811 | |
| 812 | 812 | /* get a pointer to the start of this source row */ |
| 813 | s = src + effy * gfx-> | |
| 813 | s = src + effy * gfx->r | |
| 814 | 814 | |
| 815 | 815 | /* extract the pixel */ |
| 816 | 816 | *dest++ = 0xff000000 | palette[s[effx] & palette_mask]; |
| r17669 | r17670 | |
|---|---|---|
| 83 | 83 | WRITE8_MEMBER(tc0091lvc_device::tc0091lvc_pcg1_w) |
| 84 | 84 | { |
| 85 | 85 | m_pcg1_ram[offset] = data; |
| 86 | | |
| 86 | | |
| 87 | 87 | tx_tilemap->mark_all_dirty(); |
| 88 | 88 | } |
| 89 | 89 | |
| r17669 | r17670 | |
| 95 | 95 | WRITE8_MEMBER(tc0091lvc_device::tc0091lvc_pcg2_w) |
| 96 | 96 | { |
| 97 | 97 | m_pcg2_ram[offset] = data; |
| 98 | | |
| 98 | | |
| 99 | 99 | tx_tilemap->mark_all_dirty(); |
| 100 | 100 | } |
| 101 | 101 | |
| r17669 | r17670 | |
| 108 | 108 | { |
| 109 | 109 | m_vram0[offset] = data; |
| 110 | 110 | bg0_tilemap->mark_tile_dirty(offset/2); |
| 111 | | |
| 111 | | |
| 112 | 112 | tx_tilemap->mark_all_dirty(); |
| 113 | 113 | |
| 114 | 114 | } |
| r17669 | r17670 | |
| 122 | 122 | { |
| 123 | 123 | m_vram1[offset] = data; |
| 124 | 124 | bg1_tilemap->mark_tile_dirty(offset/2); |
| 125 | | |
| 125 | | |
| 126 | 126 | tx_tilemap->mark_all_dirty(); |
| 127 | 127 | } |
| 128 | 128 | |
| r17669 | r17670 | |
| 135 | 135 | { |
| 136 | 136 | m_tvram[offset] = data; |
| 137 | 137 | tx_tilemap->mark_tile_dirty(offset/2); |
| 138 | | |
| 138 | | |
| 139 | 139 | tx_tilemap->mark_all_dirty(); |
| 140 | 140 | } |
| 141 | 141 | |
| r17669 | r17670 | |
| 147 | 147 | WRITE8_MEMBER(tc0091lvc_device::tc0091lvc_spr_w) |
| 148 | 148 | { |
| 149 | 149 | m_sprram[offset] = data; |
| 150 | | |
| 150 | | |
| 151 | 151 | tx_tilemap->mark_all_dirty(); |
| 152 | 152 | } |
| 153 | 153 | |
| r17669 | r17670 | |
| 276 | 276 | |
| 277 | 277 | //printf("m_gfx_index %d\n", m_gfx_index); |
| 278 | 278 | |
| 279 | machine().gfx[m_gfx_index] = gfx_element | |
| 279 | machine().gfx[m_gfx_index] = auto_alloc(machine(), gfx_element | |
| 280 | 280 | } |
| 281 | 281 | |
| 282 | 282 | void tc0091lvc_device::device_reset() |
| r17669 | r17670 | |
| 292 | 292 | |
| 293 | 293 | void tc0091lvc_device::draw_sprites( running_machine &machine, bitmap_ind16 &bitmap, const rectangle &cliprect, UINT8 global_flip ) |
| 294 | 294 | { |
| 295 | | |
| 295 | | |
| 296 | 296 | int count; |
| 297 | 297 | |
| 298 | 298 | for(count=0;count<0x3e7;count+=8) |
| r17669 | r17670 | |
|---|---|---|
| 25 | 25 | |
| 26 | 26 | |
| 27 | 27 | /*************************************************************************** |
| 28 | FUNCTION PROTOTYPES | |
| 29 | ***************************************************************************/ | |
| 30 | ||
| 31 | static void decodechar(const gfx_element *gfx, UINT32 code, const UINT8 *src); | |
| 32 | ||
| 33 | ||
| 34 | ||
| 35 | /*************************************************************************** | |
| 36 | 28 | INLINE FUNCTIONS |
| 37 | 29 | ***************************************************************************/ |
| 38 | 30 | |
| r17669 | r17670 | |
| 208 | 200 | glcopy.total = total; |
| 209 | 201 | |
| 210 | 202 | // allocate the graphics |
| 211 | machine.gfx[curgfx] = gfx_element | |
| 203 | machine.gfx[curgfx] = auto_alloc(machine, gfx_element | |
| 212 | 204 | } |
| 213 | 205 | } |
| 214 | 206 | |
| 215 | 207 | |
| 216 | 208 | |
| 217 | /*------------------------------------------------- | |
| 218 | gfx_element_alloc - allocate a gfx_element structure | |
| 219 | based on a given layout | |
| 220 | -------------------------------------------------*/ | |
| 209 | //------------------------------------------------- | |
| 210 | // gfx_element - constructor | |
| 211 | //------------------------------------------------- | |
| 221 | 212 | |
| 222 | gfx_element *gfx_element_alloc(running_machine &machine, const gfx_layout *gl, const UINT8 *srcdata, UINT32 total_colors, UINT32 color_base) | |
| 213 | gfx_element::gfx_element(running_machine &machine) | |
| 214 | : m_width(0), | |
| 215 | m_height(0), | |
| 216 | m_startx(0), | |
| 217 | m_starty(0), | |
| 218 | m_origwidth(0), | |
| 219 | m_origheight(0), | |
| 220 | m_total_elements(0), | |
| 221 | m_color_base(0), | |
| 222 | m_color_depth(0), | |
| 223 | m_color_granularity(0), | |
| 224 | m_total_colors(0), | |
| 225 | m_line_modulo(0), | |
| 226 | m_char_modulo(0), | |
| 227 | m_srcdata(NULL), | |
| 228 | m_dirtyseq(1), | |
| 229 | m_gfxdata(NULL), | |
| 230 | m_layout_is_raw(false), | |
| 231 | m_layout_planes(0), | |
| 232 | m_layout_charincrement(0), | |
| 233 | m_machine(machine) | |
| 223 | 234 | { |
| 224 | int israw = (gl->planeoffset[0] == GFX_RAW); | |
| 225 | int planes = gl->planes; | |
| 226 | UINT16 width = gl->width; | |
| 227 | UINT16 height = gl->height; | |
| 228 | UINT32 total = gl->total; | |
| 229 | gfx_element *gfx; | |
| 235 | } | |
| 230 | 236 | |
| 231 | // allocate memory for the gfx_element structure | |
| 232 | gfx = auto_alloc_clear(machine, gfx_element(machine)); | |
| 237 | gfx_element::gfx_element(running_machine &machine, UINT8 *base, UINT32 width, UINT32 height, UINT32 rowbytes, UINT32 color_base, UINT32 color_granularity) | |
| 238 | : m_width(width), | |
| 239 | m_height(height), | |
| 240 | m_startx(0), | |
| 241 | m_starty(0), | |
| 242 | m_origwidth(width), | |
| 243 | m_origheight(height), | |
| 244 | m_total_elements(1), | |
| 245 | m_color_base(color_base), | |
| 246 | m_color_depth(color_granularity), | |
| 247 | m_color_granularity(color_granularity), | |
| 248 | m_total_colors((machine.total_colors() - color_base) / color_granularity), | |
| 249 | m_line_modulo(rowbytes), | |
| 250 | m_char_modulo(0), | |
| 251 | m_srcdata(base), | |
| 252 | m_dirtyseq(1), | |
| 253 | m_gfxdata(NULL), | |
| 254 | m_layout_is_raw(false), | |
| 255 | m_layout_planes(0), | |
| 256 | m_layout_charincrement(0), | |
| 257 | m_machine(machine) | |
| 258 | { | |
| 259 | } | |
| 233 | 260 | |
| 234 | // fill in the data | |
| 235 | gfx->width = width; | |
| 236 | gfx->height = height; | |
| 261 | gfx_element::gfx_element(running_machine &machine, const gfx_layout &gl, const UINT8 *srcdata, UINT32 total_colors, UINT32 color_base) | |
| 262 | : m_width(0), | |
| 263 | m_height(0), | |
| 264 | m_startx(0), | |
| 265 | m_starty(0), | |
| 266 | m_origwidth(0), | |
| 267 | m_origheight(0), | |
| 268 | m_total_elements(0), | |
| 269 | m_color_base(color_base), | |
| 270 | m_color_depth(0), | |
| 271 | m_color_granularity(0), | |
| 272 | m_total_colors(total_colors), | |
| 273 | m_line_modulo(0), | |
| 274 | m_char_modulo(0), | |
| 275 | m_srcdata(NULL), | |
| 276 | m_dirtyseq(1), | |
| 277 | m_gfxdata(NULL), | |
| 278 | m_layout_is_raw(false), | |
| 279 | m_layout_planes(0), | |
| 280 | m_layout_charincrement(0), | |
| 281 | m_machine(machine) | |
| 282 | { | |
| 283 | // set the layout | |
| 284 | set_layout(gl, srcdata); | |
| 285 | } | |
| 237 | 286 | |
| 238 | gfx->origwidth = width; | |
| 239 | gfx->origheight = height; | |
| 240 | gfx->total_elements = total; | |
| 241 | 287 | |
| 242 | gfx->color_base = color_base; | |
| 243 | gfx->color_depth = 1 << planes; | |
| 244 | gfx->color_granularity = 1 << planes; | |
| 245 | gfx->total_colors = total_colors; | |
| 288 | //------------------------------------------------- | |
| 289 | // set_layout - set the layout for a gfx_element | |
| 290 | //------------------------------------------------- | |
| 246 | 291 | |
| 247 | gfx->srcdata = srcdata; | |
| 292 | void gfx_element::set_layout(const gfx_layout &gl, const UINT8 *srcdata) | |
| 293 | { | |
| 294 | // configure ourselves | |
| 295 | m_width = m_origwidth = gl.width; | |
| 296 | m_height = m_origheight = gl.height; | |
| 297 | m_startx = m_starty = 0; | |
| 298 | m_total_elements = gl.total; | |
| 299 | m_color_depth = m_color_granularity = 1 << gl.planes; | |
| 248 | 300 | |
| 249 | // copy the layout | |
| 250 | gfx->layout = *gl; | |
| 251 | if (gfx->layout.extxoffs != NULL) | |
| 252 | { | |
| 253 | if (gfx->layout.width < ARRAY_LENGTH(gfx->layout.xoffset)) | |
| 254 | { | |
| 255 | memcpy(gfx->layout.xoffset, gfx->layout.extxoffs, sizeof(gfx->layout.xoffset[0]) * gfx->layout.width); | |
| 256 | gfx->layout.extxoffs = NULL; | |
| 257 | } | |
| 258 | else | |
| 259 | { | |
| 260 | UINT32 *buffer = auto_alloc_array(machine, UINT32, gfx->layout.width); | |
| 261 | memcpy(buffer, gfx->layout.extxoffs, sizeof(gfx->layout.extxoffs[0]) * gfx->layout.width); | |
| 262 | gfx->layout.extxoffs = buffer; | |
| 263 | } | |
| 264 | } | |
| 301 | // copy data from the layout | |
| 302 | m_layout_is_raw = (gl.planeoffset[0] == GFX_RAW); | |
| 303 | m_layout_planes = gl.planes; | |
| 304 | m_layout_charincrement = gl.charincrement; | |
| 305 | m_layout_planeoffset.resize(m_layout_planes); | |
| 306 | m_layout_xoffset.resize(m_width); | |
| 307 | m_layout_yoffset.resize(m_height); | |
| 265 | 308 | |
| 266 | if (gfx->layout.extyoffs != NULL) | |
| 267 | { | |
| 268 | if (gfx->layout.height < ARRAY_LENGTH(gfx->layout.yoffset)) | |
| 269 | { | |
| 270 | memcpy(gfx->layout.yoffset, gfx->layout.extyoffs, sizeof(gfx->layout.yoffset[0]) * gfx->layout.height); | |
| 271 | gfx->layout.extyoffs = NULL; | |
| 272 | } | |
| 273 | else | |
| 274 | { | |
| 275 | UINT32 *buffer = auto_alloc_array(machine, UINT32, gfx->layout.height); | |
| 276 | memcpy(buffer, gfx->layout.extyoffs, sizeof(gfx->layout.extyoffs[0]) * gfx->layout.height); | |
| 277 | gfx->layout.extyoffs = buffer; | |
| 278 | } | |
| 279 | } | |
| 280 | ||
| 281 | // allocate a pen usage array for entries with 32 pens or less | |
| 282 | if (gfx->color_depth <= 32) | |
| 283 | gfx->pen_usage = auto_alloc_array(machine, UINT32, gfx->total_elements); | |
| 284 | ||
| 285 | // allocate a dirty array | |
| 286 | gfx->dirty = auto_alloc_array(machine, UINT8, gfx->total_elements); | |
| 287 | memset(gfx->dirty, 1, gfx->total_elements * sizeof(*gfx->dirty)); | |
| 288 | ||
| 289 | 309 | // raw graphics case |
| 290 | if (israw) | |
| 310 | if (m_layout_is_raw) | |
| 291 | 311 | { |
| 292 | 312 | // modulos are determined for us by the layout |
| 293 | gfx->line_modulo = (gl->extyoffs ? gl->extyoffs[0] : gl->yoffset[0]) / 8; | |
| 294 | gfx->char_modulo = gl->charincrement / 8; | |
| 313 | m_line_modulo = ((gl.extyoffs != NULL) ? gl.extyoffs[0] : gl.yoffset[0]) / 8; | |
| 314 | m_char_modulo = gl.charincrement / 8; | |
| 295 | 315 | |
| 296 | // don't free the data because we will get a pointer at decode time | |
| 297 | gfx->flags |= GFX_ELEMENT_DONT_FREE; | |
| 298 | ||
| 299 | 316 | // RAW graphics must have a pointer up front |
| 300 | gfx->gfxdata = (UINT8 *)gfx->srcdata; | |
| 317 | assert(srcdata != NULL); | |
| 318 | m_gfxdata_allocated.reset(); | |
| 319 | m_gfxdata = const_cast<UINT8 *>(m_srcdata); | |
| 301 | 320 | } |
| 302 | 321 | |
| 303 | 322 | // decoded graphics case |
| 304 | 323 | else |
| 305 | 324 | { |
| 325 | // copy offsets | |
| 326 | for (int p = 0; p < m_layout_planes; p++) | |
| 327 | m_layout_planeoffset[p] = gl.planeoffset[p]; | |
| 328 | for (int y = 0; y < m_height; y++) | |
| 329 | m_layout_yoffset[y] = gl.yoffs(y); | |
| 330 | for (int x = 0; x < m_width; x++) | |
| 331 | m_layout_xoffset[x] = gl.xoffs(x); | |
| 332 | ||
| 306 | 333 | // we get to pick our own modulos |
| 307 | gfx->line_modulo = gfx->origwidth; | |
| 308 | gfx->char_modulo = gfx->line_modulo * gfx->origheight; | |
| 334 | m_line_modulo = m_origwidth; | |
| 335 | m_char_modulo = m_line_modulo * m_origheight; | |
| 309 | 336 | |
| 310 | 337 | // allocate memory for the data |
| 311 | gfx->gfxdata = auto_alloc_array(machine, UINT8, gfx->total_elements * gfx->char_modulo); | |
| 338 | m_gfxdata_allocated.resize(m_total_elements * m_char_modulo); | |
| 339 | m_gfxdata = &m_gfxdata_allocated[0]; | |
| 312 | 340 | } |
| 313 | 341 | |
| 314 | return gfx; | |
| 315 | } | |
| 342 | // mark everything dirty | |
| 343 | m_dirty.resize(m_total_elements); | |
| 344 | memset(m_dirty, 1, m_total_elements); | |
| 316 | 345 | |
| 317 | ||
| 318 | /*------------------------------------------------- | |
| 319 | gfx_element_decode - update a single code in | |
| 320 | a gfx_element | |
| 321 | -------------------------------------------------*/ | |
| 322 | ||
| 323 | void gfx_element_decode(const gfx_element *gfx, UINT32 code) | |
| 324 | { | |
| 325 | decodechar(gfx, code, gfx->srcdata); | |
| 346 | // allocate a pen usage array for entries with 32 pens or less | |
| 347 | if (m_color_depth <= 32) | |
| 348 | m_pen_usage.resize(m_total_elements); | |
| 349 | else | |
| 350 | m_pen_usage.reset(); | |
| 351 | ||
| 352 | // set the source | |
| 353 | set_source(srcdata); | |
| 326 | 354 | } |
| 327 | 355 | |
| 328 | 356 | |
| 329 | /*------------------------------------------------- | |
| 330 | gfx_element_free - free a gfx_element | |
| 331 | -------------------------------------------------*/ | |
| 357 | //------------------------------------------------- | |
| 358 | // set_raw_layout - set the layout for a gfx_element | |
| 359 | //------------------------------------------------- | |
| 332 | 360 | |
| 333 | void gfx_element_ | |
| 361 | void gfx_element::set_ | |
| 334 | 362 | { |
| 335 | // ignore NULL frees | |
| 336 | if (gfx == NULL) | |
| 337 | return; | |
| 338 | ||
| 339 | // free our data | |
| 340 | auto_free(gfx->machine(), gfx->layout.extyoffs); | |
| 341 | auto_free(gfx->machine(), gfx->layout.extxoffs); | |
| 342 | auto_free(gfx->machine(), gfx->pen_usage); | |
| 343 | auto_free(gfx->machine(), gfx->dirty); | |
| 344 | auto_free(gfx->machine(), gfx->gfxdata); | |
| 345 | auto_free(gfx->machine(), gfx); | |
| 363 | gfx_layout layout = { 0 }; | |
| 364 | layout.width = width; | |
| 365 | layout.height = height; | |
| 366 | layout.total = total; | |
| 367 | layout.planes = 8; | |
| 368 | layout.planeoffset[0] = GFX_RAW; | |
| 369 | layout.yoffset[0] = linemod; | |
| 370 | layout.charincrement = charmod; | |
| 371 | set_layout(layout, srcdata); | |
| 346 | 372 | } |
| 347 | 373 | |
| 348 | 374 | |
| 349 | /*------------------------------------------------- | |
| 350 | gfx_element_build_temporary - create a | |
| 351 | temporary one-off gfx_element | |
| 352 | -------------------------------------------------*/ | |
| 375 | //------------------------------------------------- | |
| 376 | // set_source_clip - set a source clipping rect | |
| 377 | //------------------------------------------------- | |
| 353 | 378 | |
| 354 | void gfx_element | |
| 379 | void gfx_element::s | |
| 355 | 380 | { |
| 356 | static UINT8 not_dirty = 0; | |
| 381 | assert(xoffs < m_origwidth); | |
| 382 | assert(yoffs < m_origheight); | |
| 383 | assert(xoffs + width <= m_origwidth); | |
| 384 | assert(yoffs + height <= m_origheight); | |
| 357 | 385 | |
| 358 | gfx->width = width; | |
| 359 | gfx->height = height; | |
| 360 | gfx->startx = 0; | |
| 361 | gfx->starty = 0; | |
| 362 | ||
| 363 | gfx->origwidth = width; | |
| 364 | gfx->origheight = height; | |
| 365 | gfx->flags = flags; | |
| 366 | gfx->total_elements = 1; | |
| 367 | ||
| 368 | gfx->color_base = color_base; | |
| 369 | gfx->color_depth = color_granularity; | |
| 370 | gfx->color_granularity = color_granularity; | |
| 371 | gfx->total_colors = (machine.total_colors() - color_base) / color_granularity; | |
| 372 | ||
| 373 | gfx->pen_usage = NULL; | |
| 374 | ||
| 375 | gfx->gfxdata = base; | |
| 376 | gfx->line_modulo = rowbytes; | |
| 377 | gfx->char_modulo = 0; | |
| 378 | gfx->srcdata = base; | |
| 379 | gfx->dirty = ¬_dirty; | |
| 380 | gfx->dirtyseq = 0; | |
| 386 | m_width = width; | |
| 387 | m_height = height; | |
| 388 | m_startx = xoffs; | |
| 389 | m_starty = yoffs; | |
| 381 | 390 | } |
| 382 | 391 | |
| 383 | 392 | |
| 384 | /*------------------------------------------------- | |
| 385 | calc_penusage - calculate the pen usage for | |
| 386 | a given graphics tile | |
| 387 | -------------------------------------------------*/ | |
| 393 | //------------------------------------------------- | |
| 394 | // decode - decode a single character | |
| 395 | //------------------------------------------------- | |
| 388 | 396 | |
| 389 | ||
| 397 | ||
| 390 | 398 | { |
| 391 | const UINT8 *dp = gfx->gfxdata + code * gfx->char_modulo; | |
| 392 | UINT32 usage = 0; | |
| 393 | int x, y; | |
| 394 | ||
| 395 | // if nothing allocated, don't do it | |
| 396 | if (gfx->pen_usage == NULL) | |
| 397 | return; | |
| 398 | ||
| 399 | for (y = 0; y < gfx->origheight; y++) | |
| 399 | // don't decode GFX_RAW | |
| 400 | if (!m_layout_is_raw) | |
| 400 | 401 | { |
| 401 | for (x = 0; x < gfx->origwidth; x++) | |
| 402 | usage |= 1 << dp[x]; | |
| 403 | ||
| 404 | dp += gfx->line_modulo; | |
| 405 | } | |
| 406 | ||
| 407 | // store the final result | |
| 408 | gfx->pen_usage[code] = usage; | |
| 409 | } | |
| 410 | ||
| 411 | ||
| 412 | /*------------------------------------------------- | |
| 413 | decodechar - decode a single character based | |
| 414 | on a specified layout | |
| 415 | -------------------------------------------------*/ | |
| 416 | ||
| 417 | static void decodechar(const gfx_element *gfx, UINT32 code, const UINT8 *src) | |
| 418 | { | |
| 419 | const gfx_layout *gl = &gfx->layout; | |
| 420 | int israw = (gl->planeoffset[0] == GFX_RAW); | |
| 421 | int planes = gl->planes; | |
| 422 | UINT32 charincrement = gl->charincrement; | |
| 423 | const UINT32 *poffset = gl->planeoffset; | |
| 424 | const UINT32 *xoffset = gl->extxoffs ? gl->extxoffs : gl->xoffset; | |
| 425 | const UINT32 *yoffset = gl->extyoffs ? gl->extyoffs : gl->yoffset; | |
| 426 | UINT8 *dp = gfx->gfxdata + code * gfx->char_modulo; | |
| 427 | int plane, x, y; | |
| 428 | ||
| 429 | if (!israw) | |
| 430 | { | |
| 431 | 402 | // zap the data to 0 |
| 432 | memset(dp, 0, gfx->char_modulo); | |
| 433 | for (plane = 0; plane < planes; plane++) | |
| 403 | UINT8 *decode_base = m_gfxdata + code * m_char_modulo; | |
| 404 | memset(decode_base, 0, m_char_modulo); | |
| 405 | ||
| 406 | // iterate over planes | |
| 407 | for (int plane = 0; plane < m_layout_planes; plane++) | |
| 434 | 408 | { |
| 435 | int planebit = 1 << (planes - 1 - plane); | |
| 436 | int planeoffs = code * charincrement + poffset[plane]; | |
| 409 | int planebit = 1 << (m_layout_planes - 1 - plane); | |
| 410 | int planeoffs = code * m_layout_charincrement + m_layout_planeoffset[plane]; | |
| 437 | 411 | |
| 438 | for (y = 0; y < gfx->origheight; y++) | |
| 412 | // iterate over rows | |
| 413 | for (int y = 0; y < m_origheight; y++) | |
| 439 | 414 | { |
| 440 | int yoffs = planeoffs + yoffset[y]; | |
| 441 | ||
| 442 | dp = gfx->gfxdata + code * gfx->char_modulo + y * gfx->line_modulo; | |
| 443 | for (x = 0; x < gfx->origwidth; x++) | |
| 444 | if (readbit(src, yoffs + xoffset[x])) | |
| 415 | int yoffs = planeoffs + m_layout_yoffset[y]; | |
| 416 | UINT8 *dp = decode_base + y * rowbytes(); | |
| 417 | ||
| 418 | // iterate over columns | |
| 419 | for (int x = 0; x < m_origwidth; x++) | |
| 420 | if (readbit(m_srcdata, yoffs + m_layout_xoffset[x])) | |
| 445 | 421 | dp[x] |= planebit; |
| 446 | 422 | } |
| 447 | 423 | } |
| 448 | 424 | } |
| 449 | 425 | |
| 450 | // compute pen usage | |
| 451 | calc_penusage(gfx, code); | |
| 426 | // (re)compute pen usage | |
| 427 | if (code < m_pen_usage.count()) | |
| 428 | { | |
| 429 | // iterate over data, creating a bitmask of live pens | |
| 430 | const UINT8 *dp = m_gfxdata + code * m_char_modulo; | |
| 431 | UINT32 usage = 0; | |
| 432 | for (int y = 0; y < m_origheight; y++) | |
| 433 | { | |
| 434 | for (int x = 0; x < m_origwidth; x++) | |
| 435 | usage |= 1 << dp[x]; | |
| 436 | dp += m_line_modulo; | |
| 437 | } | |
| 452 | 438 | |
| 439 | // store the final result | |
| 440 | m_pen_usage[code] = usage; | |
| 441 | } | |
| 442 | ||
| 453 | 443 | // no longer dirty |
| 454 | | |
| 444 | m_ | |
| 455 | 445 | } |
| 456 | 446 | |
| 457 | 447 | |
| 448 | ||
| 458 | 449 | /*************************************************************************** |
| 459 | 450 | DRAWGFX IMPLEMENTATIONS |
| 460 | 451 | ***************************************************************************/ |
| r17669 | r17670 | |
| 464 | 455 | no transparency |
| 465 | 456 | -------------------------------------------------*/ |
| 466 | 457 | |
| 467 | void drawgfx_opaque(bitmap_ind16 &dest, const rectangle &cliprect, | |
| 458 | void drawgfx_opaque(bitmap_ind16 &dest, const rectangle &cliprect, | |
| 468 | 459 | UINT32 code, UINT32 color, int flipx, int flipy, INT32 destx, INT32 desty) |
| 469 | 460 | { |
| 470 | const pen_t *paldata = &gfx->machine().pens[gfx->color_base + gfx->color_granularity * (color % gfx->total_colors)]; | |
| 471 | code %= gfx->total_elements; | |
| 461 | const pen_t *paldata = &gfx->machine().pens[gfx->colorbase() + gfx->granularity() * (color % gfx->colors())]; | |
| 462 | code %= gfx->elements(); | |
| 472 | 463 | DECLARE_NO_PRIORITY; |
| 473 | 464 | DRAWGFX_CORE(UINT16, PIXEL_OP_REMAP_OPAQUE, NO_PRIORITY); |
| 474 | 465 | } |
| 475 | 466 | |
| 476 | void drawgfx_opaque(bitmap_rgb32 &dest, const rectangle &cliprect, | |
| 467 | void drawgfx_opaque(bitmap_rgb32 &dest, const rectangle &cliprect, | |
| 477 | 468 | UINT32 code, UINT32 color, int flipx, int flipy, INT32 destx, INT32 desty) |
| 478 | 469 | { |
| 479 | const pen_t *paldata = &gfx->machine().pens[gfx->color_base + gfx->color_granularity * (color % gfx->total_colors)]; | |
| 480 | code %= gfx->total_elements; | |
| 470 | const pen_t *paldata = &gfx->machine().pens[gfx->colorbase() + gfx->granularity() * (color % gfx->colors())]; | |
| 471 | code %= gfx->elements(); | |
| 481 | 472 | DECLARE_NO_PRIORITY; |
| 482 | 473 | DRAWGFX_CORE(UINT32, PIXEL_OP_REMAP_OPAQUE, NO_PRIORITY); |
| 483 | 474 | } |
| r17669 | r17670 | |
| 488 | 479 | a single transparent pen |
| 489 | 480 | -------------------------------------------------*/ |
| 490 | 481 | |
| 491 | void drawgfx_transpen(bitmap_ind16 &dest, const rectangle &cliprect, | |
| 482 | void drawgfx_transpen(bitmap_ind16 &dest, const rectangle &cliprect, | |
| 492 | 483 | UINT32 code, UINT32 color, int flipx, int flipy, INT32 destx, INT32 desty, |
| 493 | 484 | UINT32 transpen) |
| 494 | 485 | { |
| r17669 | r17670 | |
| 497 | 488 | return drawgfx_opaque(dest, cliprect, gfx, code, color, flipx, flipy, destx, desty); |
| 498 | 489 | |
| 499 | 490 | // use pen usage to optimize |
| 500 | code %= gfx->total_elements; | |
| 501 | if (gfx->pen_usage != NULL && !gfx->dirty[code]) | |
| 491 | code %= gfx->elements(); | |
| 492 | if (gfx->has_pen_usage()) | |
| 502 | 493 | { |
| 503 | 494 | // fully transparent; do nothing |
| 504 | UINT32 usage = gfx->pen_usage | |
| 495 | UINT32 usage = gfx->pen_usage(code); | |
| 505 | 496 | if ((usage & ~(1 << transpen)) == 0) |
| 506 | 497 | return; |
| 507 | 498 | |
| r17669 | r17670 | |
| 511 | 502 | } |
| 512 | 503 | |
| 513 | 504 | // render |
| 514 | const pen_t *paldata = &gfx->machine().pens[gfx->color | |
| 505 | const pen_t *paldata = &gfx->machine().pens[gfx->color | |
| 515 | 506 | DECLARE_NO_PRIORITY; |
| 516 | 507 | DRAWGFX_CORE(UINT16, PIXEL_OP_REMAP_TRANSPEN, NO_PRIORITY); |
| 517 | 508 | } |
| 518 | 509 | |
| 519 | void drawgfx_transpen(bitmap_rgb32 &dest, const rectangle &cliprect, | |
| 510 | void drawgfx_transpen(bitmap_rgb32 &dest, const rectangle &cliprect, | |
| 520 | 511 | UINT32 code, UINT32 color, int flipx, int flipy, INT32 destx, INT32 desty, |
| 521 | 512 | UINT32 transpen) |
| 522 | 513 | { |
| r17669 | r17670 | |
| 525 | 516 | return drawgfx_opaque(dest, cliprect, gfx, code, color, flipx, flipy, destx, desty); |
| 526 | 517 | |
| 527 | 518 | // use pen usage to optimize |
| 528 | code %= gfx->total_elements; | |
| 529 | if (gfx->pen_usage != NULL && !gfx->dirty[code]) | |
| 519 | code %= gfx->elements(); | |
| 520 | if (gfx->has_pen_usage()) | |
| 530 | 521 | { |
| 531 | 522 | // fully transparent; do nothing |
| 532 | UINT32 usage = gfx->pen_usage | |
| 523 | UINT32 usage = gfx->pen_usage(code); | |
| 533 | 524 | if ((usage & ~(1 << transpen)) == 0) |
| 534 | 525 | return; |
| 535 | 526 | |
| r17669 | r17670 | |
| 539 | 530 | } |
| 540 | 531 | |
| 541 | 532 | // render |
| 542 | const pen_t *paldata = &gfx->machine().pens[gfx->color | |
| 533 | const pen_t *paldata = &gfx->machine().pens[gfx->color | |
| 543 | 534 | DECLARE_NO_PRIORITY; |
| 544 | 535 | DRAWGFX_CORE(UINT32, PIXEL_OP_REMAP_TRANSPEN, NO_PRIORITY); |
| 545 | 536 | } |
| r17669 | r17670 | |
| 551 | 542 | lookups |
| 552 | 543 | -------------------------------------------------*/ |
| 553 | 544 | |
| 554 | void drawgfx_transpen_raw(bitmap_ind16 &dest, const rectangle &cliprect, | |
| 545 | void drawgfx_transpen_raw(bitmap_ind16 &dest, const rectangle &cliprect, | |
| 555 | 546 | UINT32 code, UINT32 color, int flipx, int flipy, INT32 destx, INT32 desty, |
| 556 | 547 | UINT32 transpen) |
| 557 | 548 | { |
| 558 | 549 | // early out if completely transparent |
| 559 | code %= gfx->total_elements; | |
| 560 | if (gfx->pen_usage != NULL && !gfx->dirty[code] && (gfx->pen_usage[code] & ~(1 << transpen)) == 0) | |
| 550 | code %= gfx->elements(); | |
| 551 | if (gfx->has_pen_usage() && (gfx->pen_usage(code) & ~(1 << transpen)) == 0) | |
| 561 | 552 | return; |
| 562 | 553 | |
| 563 | 554 | // render |
| r17669 | r17670 | |
| 565 | 556 | DRAWGFX_CORE(UINT16, PIXEL_OP_REBASE_TRANSPEN, NO_PRIORITY); |
| 566 | 557 | } |
| 567 | 558 | |
| 568 | void drawgfx_transpen_raw(bitmap_rgb32 &dest, const rectangle &cliprect, | |
| 559 | void drawgfx_transpen_raw(bitmap_rgb32 &dest, const rectangle &cliprect, | |
| 569 | 560 | UINT32 code, UINT32 color, int flipx, int flipy, INT32 destx, INT32 desty, |
| 570 | 561 | UINT32 transpen) |
| 571 | 562 | { |
| 572 | 563 | // early out if completely transparent |
| 573 | code %= gfx->total_elements; | |
| 574 | if (gfx->pen_usage != NULL && !gfx->dirty[code] && (gfx->pen_usage[code] & ~(1 << transpen)) == 0) | |
| 564 | code %= gfx->elements(); | |
| 565 | if (gfx->has_pen_usage() && (gfx->pen_usage(code) & ~(1 << transpen)) == 0) | |
| 575 | 566 | return; |
| 576 | 567 | |
| 577 | 568 | // render |
| r17669 | r17670 | |
| 586 | 577 | a mask |
| 587 | 578 | -------------------------------------------------*/ |
| 588 | 579 | |
| 589 | void drawgfx_transmask(bitmap_ind16 &dest, const rectangle &cliprect, | |
| 580 | void drawgfx_transmask(bitmap_ind16 &dest, const rectangle &cliprect, | |
| 590 | 581 | UINT32 code, UINT32 color, int flipx, int flipy, INT32 destx, INT32 desty, |
| 591 | 582 | UINT32 transmask) |
| 592 | 583 | { |
| r17669 | r17670 | |
| 595 | 586 | return drawgfx_opaque(dest, cliprect, gfx, code, color, flipx, flipy, destx, desty); |
| 596 | 587 | |
| 597 | 588 | // use pen usage to optimize |
| 598 | code %= gfx->total_elements; | |
| 599 | if (gfx->pen_usage != NULL && !gfx->dirty[code]) | |
| 589 | code %= gfx->elements(); | |
| 590 | if (gfx->has_pen_usage()) | |
| 600 | 591 | { |
| 601 | 592 | // fully transparent; do nothing |
| 602 | UINT32 usage = gfx->pen_usage | |
| 593 | UINT32 usage = gfx->pen_usage(code); | |
| 603 | 594 | if ((usage & ~transmask) == 0) |
| 604 | 595 | return; |
| 605 | 596 | |
| r17669 | r17670 | |
| 609 | 600 | } |
| 610 | 601 | |
| 611 | 602 | // render |
| 612 | const pen_t *paldata = &gfx->machine().pens[gfx->color | |
| 603 | const pen_t *paldata = &gfx->machine().pens[gfx->color | |
| 613 | 604 | DECLARE_NO_PRIORITY; |
| 614 | 605 | DRAWGFX_CORE(UINT16, PIXEL_OP_REMAP_TRANSMASK, NO_PRIORITY); |
| 615 | 606 | } |
| 616 | 607 | |
| 617 | void drawgfx_transmask(bitmap_rgb32 &dest, const rectangle &cliprect, | |
| 608 | void drawgfx_transmask(bitmap_rgb32 &dest, const rectangle &cliprect, | |
| 618 | 609 | UINT32 code, UINT32 color, int flipx, int flipy, INT32 destx, INT32 desty, |
| 619 | 610 | UINT32 transmask) |
| 620 | 611 | { |
| r17669 | r17670 | |
| 623 | 614 | return drawgfx_opaque(dest, cliprect, gfx, code, color, flipx, flipy, destx, desty); |
| 624 | 615 | |
| 625 | 616 | // use pen usage to optimize |
| 626 | code %= gfx->total_elements; | |
| 627 | if (gfx->pen_usage != NULL && !gfx->dirty[code]) | |
| 617 | code %= gfx->elements(); | |
| 618 | if (gfx->has_pen_usage()) | |
| 628 | 619 | { |
| 629 | 620 | // fully transparent; do nothing |
| 630 | UINT32 usage = gfx->pen_usage | |
| 621 | UINT32 usage = gfx->pen_usage(code); | |
| 631 | 622 | if ((usage & ~transmask) == 0) |
| 632 | 623 | return; |
| 633 | 624 | |
| r17669 | r17670 | |
| 637 | 628 | } |
| 638 | 629 | |
| 639 | 630 | // render |
| 640 | const pen_t *paldata = &gfx->machine().pens[gfx->color | |
| 631 | const pen_t *paldata = &gfx->machine().pens[gfx->color | |
| 641 | 632 | DECLARE_NO_PRIORITY; |
| 642 | 633 | DRAWGFX_CORE(UINT32, PIXEL_OP_REMAP_TRANSMASK, NO_PRIORITY); |
| 643 | 634 | } |
| r17669 | r17670 | |
| 649 | 640 | transparent, opaque, or shadowing |
| 650 | 641 | -------------------------------------------------*/ |
| 651 | 642 | |
| 652 | void drawgfx_transtable(bitmap_ind16 &dest, const rectangle &cliprect, | |
| 643 | void drawgfx_transtable(bitmap_ind16 &dest, const rectangle &cliprect, | |
| 653 | 644 | UINT32 code, UINT32 color, int flipx, int flipy, INT32 destx, INT32 desty, |
| 654 | 645 | const UINT8 *pentable, const pen_t *shadowtable) |
| 655 | 646 | { |
| 656 | 647 | assert(pentable != NULL); |
| 657 | 648 | |
| 658 | 649 | // render |
| 659 | const pen_t *paldata = &gfx->machine().pens[gfx->color_base + gfx->color_granularity * (color % gfx->total_colors)]; | |
| 660 | code %= gfx->total_elements; | |
| 650 | const pen_t *paldata = &gfx->machine().pens[gfx->colorbase() + gfx->granularity() * (color % gfx->colors())]; | |
| 651 | code %= gfx->elements(); | |
| 661 | 652 | DECLARE_NO_PRIORITY; |
| 662 | 653 | DRAWGFX_CORE(UINT16, PIXEL_OP_REMAP_TRANSTABLE16, NO_PRIORITY); |
| 663 | 654 | } |
| 664 | 655 | |
| 665 | void drawgfx_transtable(bitmap_rgb32 &dest, const rectangle &cliprect, | |
| 656 | void drawgfx_transtable(bitmap_rgb32 &dest, const rectangle &cliprect, | |
| 666 | 657 | UINT32 code, UINT32 color, int flipx, int flipy, INT32 destx, INT32 desty, |
| 667 | 658 | const UINT8 *pentable, const pen_t *shadowtable) |
| 668 | 659 | { |
| 669 | 660 | assert(pentable != NULL); |
| 670 | 661 | |
| 671 | 662 | // render |
| 672 | const pen_t *paldata = &gfx->machine().pens[gfx->color_base + gfx->color_granularity * (color % gfx->total_colors)]; | |
| 673 | code %= gfx->total_elements; | |
| 663 | const pen_t *paldata = &gfx->machine().pens[gfx->colorbase() + gfx->granularity() * (color % gfx->colors())]; | |
| 664 | code %= gfx->elements(); | |
| 674 | 665 | DECLARE_NO_PRIORITY; |
| 675 | 666 | DRAWGFX_CORE(UINT32, PIXEL_OP_REMAP_TRANSTABLE32, NO_PRIORITY); |
| 676 | 667 | } |
| r17669 | r17670 | |
| 682 | 673 | remaining pixels with a fixed alpha value |
| 683 | 674 | -------------------------------------------------*/ |
| 684 | 675 | |
| 685 | void drawgfx_alpha(bitmap_rgb32 &dest, const rectangle &cliprect, | |
| 676 | void drawgfx_alpha(bitmap_rgb32 &dest, const rectangle &cliprect, | |
| 686 | 677 | UINT32 code, UINT32 color, int flipx, int flipy, INT32 destx, INT32 desty, |
| 687 | 678 | UINT32 transpen, UINT8 alpha) |
| 688 | 679 | { |
| r17669 | r17670 | |
| 691 | 682 | return drawgfx_transpen(dest, cliprect, gfx, code, color, flipx, flipy, destx, desty, transpen); |
| 692 | 683 | |
| 693 | 684 | // early out if completely transparent |
| 694 | code %= gfx->total_elements; | |
| 695 | if (gfx->pen_usage != NULL && !gfx->dirty[code] && (gfx->pen_usage[code] & ~(1 << transpen)) == 0) | |
| 685 | code %= gfx->elements(); | |
| 686 | if (gfx->has_pen_usage() && (gfx->pen_usage(code) & ~(1 << transpen)) == 0) | |
| 696 | 687 | return; |
| 697 | 688 | |
| 698 | 689 | // get final code and color, and grab lookup tables |
| 699 | const pen_t *paldata = &gfx->machine().pens[gfx->color | |
| 690 | const pen_t *paldata = &gfx->machine().pens[gfx->color | |
| 700 | 691 | DECLARE_NO_PRIORITY; |
| 701 | 692 | DRAWGFX_CORE(UINT32, PIXEL_OP_REMAP_TRANSPEN_ALPHA32, NO_PRIORITY); |
| 702 | 693 | } |
| r17669 | r17670 | |
| 712 | 703 | element with no transparency |
| 713 | 704 | -------------------------------------------------*/ |
| 714 | 705 | |
| 715 | void drawgfxzoom_opaque(bitmap_ind16 &dest, const rectangle &cliprect, | |
| 706 | void drawgfxzoom_opaque(bitmap_ind16 &dest, const rectangle &cliprect, | |
| 716 | 707 | UINT32 code, UINT32 color, int flipx, int flipy, INT32 destx, INT32 desty, |
| 717 | 708 | UINT32 scalex, UINT32 scaley) |
| 718 | 709 | { |
| r17669 | r17670 | |
| 721 | 712 | return drawgfx_opaque(dest, cliprect, gfx, code, color, flipx, flipy, destx, desty); |
| 722 | 713 | |
| 723 | 714 | // render |
| 724 | const pen_t *paldata = &gfx->machine().pens[gfx->color_base + gfx->color_granularity * (color % gfx->total_colors)]; | |
| 725 | code %= gfx->total_elements; | |
| 715 | const pen_t *paldata = &gfx->machine().pens[gfx->colorbase() + gfx->granularity() * (color % gfx->colors())]; | |
| 716 | code %= gfx->elements(); | |
| 726 | 717 | DECLARE_NO_PRIORITY; |
| 727 | 718 | DRAWGFXZOOM_CORE(UINT16, PIXEL_OP_REMAP_OPAQUE, NO_PRIORITY); |
| 728 | 719 | } |
| 729 | 720 | |
| 730 | void drawgfxzoom_opaque(bitmap_rgb32 &dest, const rectangle &cliprect, | |
| 721 | void drawgfxzoom_opaque(bitmap_rgb32 &dest, const rectangle &cliprect, | |
| 731 | 722 | UINT32 code, UINT32 color, int flipx, int flipy, INT32 destx, INT32 desty, |
| 732 | 723 | UINT32 scalex, UINT32 scaley) |
| 733 | 724 | { |
| r17669 | r17670 | |
| 736 | 727 | return drawgfx_opaque(dest, cliprect, gfx, code, color, flipx, flipy, destx, desty); |
| 737 | 728 | |
| 738 | 729 | // render |
| 739 | const pen_t *paldata = &gfx->machine().pens[gfx->color_base + gfx->color_granularity * (color % gfx->total_colors)]; | |
| 740 | code %= gfx->total_elements; | |
| 730 | const pen_t *paldata = &gfx->machine().pens[gfx->colorbase() + gfx->granularity() * (color % gfx->colors())]; | |
| 731 | code %= gfx->elements(); | |
| 741 | 732 | DECLARE_NO_PRIORITY; |
| 742 | 733 | DRAWGFXZOOM_CORE(UINT32, PIXEL_OP_REMAP_OPAQUE, NO_PRIORITY); |
| 743 | 734 | } |
| r17669 | r17670 | |
| 748 | 739 | element with a single transparent pen |
| 749 | 740 | -------------------------------------------------*/ |
| 750 | 741 | |
| 751 | void drawgfxzoom_transpen(bitmap_ind16 &dest, const rectangle &cliprect, | |
| 742 | void drawgfxzoom_transpen(bitmap_ind16 &dest, const rectangle &cliprect, | |
| 752 | 743 | UINT32 code, UINT32 color, int flipx, int flipy, INT32 destx, INT32 desty, |
| 753 | 744 | UINT32 scalex, UINT32 scaley, UINT32 transpen) |
| 754 | 745 | { |
| r17669 | r17670 | |
| 761 | 752 | return drawgfxzoom_opaque(dest, cliprect, gfx, code, color, flipx, flipy, destx, desty, scalex, scaley); |
| 762 | 753 | |
| 763 | 754 | // use pen usage to optimize |
| 764 | code %= gfx->total_elements; | |
| 765 | if (gfx->pen_usage != NULL && !gfx->dirty[code]) | |
| 755 | code %= gfx->elements(); | |
| 756 | if (gfx->has_pen_usage()) | |
| 766 | 757 | { |
| 767 | 758 | // fully transparent; do nothing |
| 768 | UINT32 usage = gfx->pen_usage | |
| 759 | UINT32 usage = gfx->pen_usage(code); | |
| 769 | 760 | if ((usage & ~(1 << transpen)) == 0) |
| 770 | 761 | return; |
| 771 | 762 | |
| r17669 | r17670 | |
| 775 | 766 | } |
| 776 | 767 | |
| 777 | 768 | // render |
| 778 | const pen_t *paldata = &gfx->machine().pens[gfx->color | |
| 769 | const pen_t *paldata = &gfx->machine().pens[gfx->color | |
| 779 | 770 | DECLARE_NO_PRIORITY; |
| 780 | 771 | DRAWGFXZOOM_CORE(UINT16, PIXEL_OP_REMAP_TRANSPEN, NO_PRIORITY); |
| 781 | 772 | } |
| 782 | 773 | |
| 783 | void drawgfxzoom_transpen(bitmap_rgb32 &dest, const rectangle &cliprect, | |
| 774 | void drawgfxzoom_transpen(bitmap_rgb32 &dest, const rectangle &cliprect, | |
| 784 | 775 | UINT32 code, UINT32 color, int flipx, int flipy, INT32 destx, INT32 desty, |
| 785 | 776 | UINT32 scalex, UINT32 scaley, UINT32 transpen) |
| 786 | 777 | { |
| r17669 | r17670 | |
| 793 | 784 | return drawgfxzoom_opaque(dest, cliprect, gfx, code, color, flipx, flipy, destx, desty, scalex, scaley); |
| 794 | 785 | |
| 795 | 786 | // use pen usage to optimize |
| 796 | code %= gfx->total_elements; | |
| 797 | if (gfx->pen_usage != NULL && !gfx->dirty[code]) | |
| 787 | code %= gfx->elements(); | |
| 788 | if (gfx->has_pen_usage()) | |
| 798 | 789 | { |
| 799 | 790 | // fully transparent; do nothing |
| 800 | UINT32 usage = gfx->pen_usage | |
| 791 | UINT32 usage = gfx->pen_usage(code); | |
| 801 | 792 | if ((usage & ~(1 << transpen)) == 0) |
| 802 | 793 | return; |
| 803 | 794 | |
| r17669 | r17670 | |
| 807 | 798 | } |
| 808 | 799 | |
| 809 | 800 | // render |
| 810 | const pen_t *paldata = &gfx->machine().pens[gfx->color | |
| 801 | const pen_t *paldata = &gfx->machine().pens[gfx->color | |
| 811 | 802 | DECLARE_NO_PRIORITY; |
| 812 | 803 | DRAWGFXZOOM_CORE(UINT32, PIXEL_OP_REMAP_TRANSPEN, NO_PRIORITY); |
| 813 | 804 | } |
| r17669 | r17670 | |
| 819 | 810 | color lookups |
| 820 | 811 | -------------------------------------------------*/ |
| 821 | 812 | |
| 822 | void drawgfxzoom_transpen_raw(bitmap_ind16 &dest, const rectangle &cliprect, | |
| 813 | void drawgfxzoom_transpen_raw(bitmap_ind16 &dest, const rectangle &cliprect, | |
| 823 | 814 | UINT32 code, UINT32 color, int flipx, int flipy, INT32 destx, INT32 desty, |
| 824 | 815 | UINT32 scalex, UINT32 scaley, UINT32 transpen) |
| 825 | 816 | { |
| r17669 | r17670 | |
| 828 | 819 | return drawgfx_transpen_raw(dest, cliprect, gfx, code, color, flipx, flipy, destx, desty, transpen); |
| 829 | 820 | |
| 830 | 821 | // early out if completely transparent |
| 831 | code %= gfx->total_elements; | |
| 832 | if (gfx->pen_usage != NULL && !gfx->dirty[code] && (gfx->pen_usage[code] & ~(1 << transpen)) == 0) | |
| 822 | code %= gfx->elements(); | |
| 823 | if (gfx->has_pen_usage() && (gfx->pen_usage(code) & ~(1 << transpen)) == 0) | |
| 833 | 824 | return; |
| 834 | 825 | |
| 835 | 826 | // render |
| r17669 | r17670 | |
| 837 | 828 | DRAWGFXZOOM_CORE(UINT16, PIXEL_OP_REBASE_TRANSPEN, NO_PRIORITY); |
| 838 | 829 | } |
| 839 | 830 | |
| 840 | void drawgfxzoom_transpen_raw(bitmap_rgb32 &dest, const rectangle &cliprect, | |
| 831 | void drawgfxzoom_transpen_raw(bitmap_rgb32 &dest, const rectangle &cliprect, | |
| 841 | 832 | UINT32 code, UINT32 color, int flipx, int flipy, INT32 destx, INT32 desty, |
| 842 | 833 | UINT32 scalex, UINT32 scaley, UINT32 transpen) |
| 843 | 834 | { |
| r17669 | r17670 | |
| 846 | 837 | return drawgfx_transpen_raw(dest, cliprect, gfx, code, color, flipx, flipy, destx, desty, transpen); |
| 847 | 838 | |
| 848 | 839 | // early out if completely transparent |
| 849 | code %= gfx->total_elements; | |
| 850 | if (gfx->pen_usage != NULL && !gfx->dirty[code] && (gfx->pen_usage[code] & ~(1 << transpen)) == 0) | |
| 840 | code %= gfx->elements(); | |
| 841 | if (gfx->has_pen_usage() && (gfx->pen_usage(code) & ~(1 << transpen)) == 0) | |
| 851 | 842 | return; |
| 852 | 843 | |
| 853 | 844 | // render |
| r17669 | r17670 | |
| 862 | 853 | provided as a mask |
| 863 | 854 | -------------------------------------------------*/ |
| 864 | 855 | |
| 865 | void drawgfxzoom_transmask(bitmap_ind16 &dest, const rectangle &cliprect, | |
| 856 | void drawgfxzoom_transmask(bitmap_ind16 &dest, const rectangle &cliprect, | |
| 866 | 857 | UINT32 code, UINT32 color, int flipx, int flipy, INT32 destx, INT32 desty, |
| 867 | 858 | UINT32 scalex, UINT32 scaley, UINT32 transmask) |
| 868 | 859 | { |
| r17669 | r17670 | |
| 875 | 866 | return drawgfxzoom_opaque(dest, cliprect, gfx, code, color, flipx, flipy, destx, desty, scalex, scaley); |
| 876 | 867 | |
| 877 | 868 | // use pen usage to optimize |
| 878 | code %= gfx->total_elements; | |
| 879 | if (gfx->pen_usage != NULL && !gfx->dirty[code]) | |
| 869 | code %= gfx->elements(); | |
| 870 | if (gfx->has_pen_usage()) | |
| 880 | 871 | { |
| 881 | 872 | // fully transparent; do nothing |
| 882 | UINT32 usage = gfx->pen_usage | |
| 873 | UINT32 usage = gfx->pen_usage(code); | |
| 883 | 874 | if ((usage & ~transmask) == 0) |
| 884 | 875 | return; |
| 885 | 876 | |
| r17669 | r17670 | |
| 889 | 880 | } |
| 890 | 881 | |
| 891 | 882 | // render |
| 892 | const pen_t *paldata = &gfx->machine().pens[gfx->color | |
| 883 | const pen_t *paldata = &gfx->machine().pens[gfx->color | |
| 893 | 884 | DECLARE_NO_PRIORITY; |
| 894 | 885 | DRAWGFXZOOM_CORE(UINT16, PIXEL_OP_REMAP_TRANSMASK, NO_PRIORITY); |
| 895 | 886 | } |
| 896 | 887 | |
| 897 | void drawgfxzoom_transmask(bitmap_rgb32 &dest, const rectangle &cliprect, | |
| 888 | void drawgfxzoom_transmask(bitmap_rgb32 &dest, const rectangle &cliprect, | |
| 898 | 889 | UINT32 code, UINT32 color, int flipx, int flipy, INT32 destx, INT32 desty, |
| 899 | 890 | UINT32 scalex, UINT32 scaley, UINT32 transmask) |
| 900 | 891 | { |
| r17669 | r17670 | |
| 907 | 898 | return drawgfxzoom_opaque(dest, cliprect, gfx, code, color, flipx, flipy, destx, desty, scalex, scaley); |
| 908 | 899 | |
| 909 | 900 | // use pen usage to optimize |
| 910 | code %= gfx->total_elements; | |
| 911 | if (gfx->pen_usage != NULL && !gfx->dirty[code]) | |
| 901 | code %= gfx->elements(); | |
| 902 | if (gfx->has_pen_usage()) | |
| 912 | 903 | { |
| 913 | 904 | // fully transparent; do nothing |
| 914 | UINT32 usage = gfx->pen_usage | |
| 905 | UINT32 usage = gfx->pen_usage(code); | |
| 915 | 906 | if ((usage & ~transmask) == 0) |
| 916 | 907 | return; |
| 917 | 908 | |
| r17669 | r17670 | |
| 921 | 912 | } |
| 922 | 913 | |
| 923 | 914 | // render |
| 924 | const pen_t *paldata = &gfx->machine().pens[gfx->color | |
| 915 | const pen_t *paldata = &gfx->machine().pens[gfx->color | |
| 925 | 916 | DECLARE_NO_PRIORITY; |
| 926 | 917 | DRAWGFXZOOM_CORE(UINT32, PIXEL_OP_REMAP_TRANSMASK, NO_PRIORITY); |
| 927 | 918 | } |
| r17669 | r17670 | |
| 933 | 924 | are transparent, opaque, or shadowing |
| 934 | 925 | -------------------------------------------------*/ |
| 935 | 926 | |
| 936 | void drawgfxzoom_transtable(bitmap_ind16 &dest, const rectangle &cliprect, | |
| 927 | void drawgfxzoom_transtable(bitmap_ind16 &dest, const rectangle &cliprect, | |
| 937 | 928 | UINT32 code, UINT32 color, int flipx, int flipy, INT32 destx, INT32 desty, |
| 938 | 929 | UINT32 scalex, UINT32 scaley, const UINT8 *pentable, const pen_t *shadowtable) |
| 939 | 930 | { |
| r17669 | r17670 | |
| 944 | 935 | return drawgfx_transtable(dest, cliprect, gfx, code, color, flipx, flipy, destx, desty, pentable, shadowtable); |
| 945 | 936 | |
| 946 | 937 | // render |
| 947 | const pen_t *paldata = &gfx->machine().pens[gfx->color_base + gfx->color_granularity * (color % gfx->total_colors)]; | |
| 948 | code %= gfx->total_elements; | |
| 938 | const pen_t *paldata = &gfx->machine().pens[gfx->colorbase() + gfx->granularity() * (color % gfx->colors())]; | |
| 939 | code %= gfx->elements(); | |
| 949 | 940 | DECLARE_NO_PRIORITY; |
| 950 | 941 | DRAWGFXZOOM_CORE(UINT16, PIXEL_OP_REMAP_TRANSTABLE16, NO_PRIORITY); |
| 951 | 942 | } |
| 952 | 943 | |
| 953 | void drawgfxzoom_transtable(bitmap_rgb32 &dest, const rectangle &cliprect, | |
| 944 | void drawgfxzoom_transtable(bitmap_rgb32 &dest, const rectangle &cliprect, | |
| 954 | 945 | UINT32 code, UINT32 color, int flipx, int flipy, INT32 destx, INT32 desty, |
| 955 | 946 | UINT32 scalex, UINT32 scaley, const UINT8 *pentable, const pen_t *shadowtable) |
| 956 | 947 | { |
| r17669 | r17670 | |
| 961 | 952 | return drawgfx_transtable(dest, cliprect, gfx, code, color, flipx, flipy, destx, desty, pentable, shadowtable); |
| 962 | 953 | |
| 963 | 954 | // render |
| 964 | const pen_t *paldata = &gfx->machine().pens[gfx->color_base + gfx->color_granularity * (color % gfx->total_colors)]; | |
| 965 | code %= gfx->total_elements; | |
| 955 | const pen_t *paldata = &gfx->machine().pens[gfx->colorbase() + gfx->granularity() * (color % gfx->colors())]; | |
| 956 | code %= gfx->elements(); | |
| 966 | 957 | DECLARE_NO_PRIORITY; |
| 967 | 958 | DRAWGFXZOOM_CORE(UINT32, PIXEL_OP_REMAP_TRANSTABLE32, NO_PRIORITY); |
| 968 | 959 | } |
| r17669 | r17670 | |
| 974 | 965 | the remaining pixels with a fixed alpha value |
| 975 | 966 | -------------------------------------------------*/ |
| 976 | 967 | |
| 977 | void drawgfxzoom_alpha(bitmap_rgb32 &dest, const rectangle &cliprect, | |
| 968 | void drawgfxzoom_alpha(bitmap_rgb32 &dest, const rectangle &cliprect, | |
| 978 | 969 | UINT32 code, UINT32 color, int flipx, int flipy, INT32 destx, INT32 desty, |
| 979 | 970 | UINT32 scalex, UINT32 scaley, UINT32 transpen, UINT8 alpha) |
| 980 | 971 | { |
| r17669 | r17670 | |
| 987 | 978 | return drawgfxzoom_transpen(dest, cliprect, gfx, code, color, flipx, flipy, destx, desty, scalex, scaley, transpen); |
| 988 | 979 | |
| 989 | 980 | // early out if completely transparent |
| 990 | code %= gfx->total_elements; | |
| 991 | if (gfx->pen_usage != NULL && !gfx->dirty[code] && (gfx->pen_usage[code] & ~(1 << transpen)) == 0) | |
| 981 | code %= gfx->elements(); | |
| 982 | if (gfx->has_pen_usage() && (gfx->pen_usage(code) & ~(1 << transpen)) == 0) | |
| 992 | 983 | return; |
| 993 | 984 | |
| 994 | 985 | // render |
| 995 | const pen_t *paldata = &gfx->machine().pens[gfx->color | |
| 986 | const pen_t *paldata = &gfx->machine().pens[gfx->color | |
| 996 | 987 | DECLARE_NO_PRIORITY; |
| 997 | 988 | DRAWGFXZOOM_CORE(UINT32, PIXEL_OP_REMAP_TRANSPEN_ALPHA32, NO_PRIORITY); |
| 998 | 989 | } |
| r17669 | r17670 | |
| 1009 | 1000 | bitmap |
| 1010 | 1001 | -------------------------------------------------*/ |
| 1011 | 1002 | |
| 1012 | void pdrawgfx_opaque(bitmap_ind16 &dest, const rectangle &cliprect, | |
| 1003 | void pdrawgfx_opaque(bitmap_ind16 &dest, const rectangle &cliprect, | |
| 1013 | 1004 | UINT32 code, UINT32 color, int flipx, int flipy, INT32 destx, INT32 desty, |
| 1014 | 1005 | bitmap_ind8 &priority, UINT32 pmask) |
| 1015 | 1006 | { |
| r17669 | r17670 | |
| 1017 | 1008 | pmask |= 1 << 31; |
| 1018 | 1009 | |
| 1019 | 1010 | // render |
| 1020 | const pen_t *paldata = &gfx->machine().pens[gfx->color_base + gfx->color_granularity * (color % gfx->total_colors)]; | |
| 1021 | code %= gfx->total_elements; | |
| 1011 | const pen_t *paldata = &gfx->machine().pens[gfx->colorbase() + gfx->granularity() * (color % gfx->colors())]; | |
| 1012 | code %= gfx->elements(); | |
| 1022 | 1013 | DRAWGFX_CORE(UINT16, PIXEL_OP_REMAP_OPAQUE_PRIORITY, UINT8); |
| 1023 | 1014 | } |
| 1024 | 1015 | |
| 1025 | void pdrawgfx_opaque(bitmap_rgb32 &dest, const rectangle &cliprect, | |
| 1016 | void pdrawgfx_opaque(bitmap_rgb32 &dest, const rectangle &cliprect, | |
| 1026 | 1017 | UINT32 code, UINT32 color, int flipx, int flipy, INT32 destx, INT32 desty, |
| 1027 | 1018 | bitmap_ind8 &priority, UINT32 pmask) |
| 1028 | 1019 | { |
| r17669 | r17670 | |
| 1030 | 1021 | pmask |= 1 << 31; |
| 1031 | 1022 | |
| 1032 | 1023 | // render |
| 1033 | const pen_t *paldata = &gfx->machine().pens[gfx->color_base + gfx->color_granularity * (color % gfx->total_colors)]; | |
| 1034 | code %= gfx->total_elements; | |
| 1024 | const pen_t *paldata = &gfx->machine().pens[gfx->colorbase() + gfx->granularity() * (color % gfx->colors())]; | |
| 1025 | code %= gfx->elements(); | |
| 1035 | 1026 | DRAWGFX_CORE(UINT32, PIXEL_OP_REMAP_OPAQUE_PRIORITY, UINT8); |
| 1036 | 1027 | } |
| 1037 | 1028 | |
| r17669 | r17670 | |
| 1042 | 1033 | priority bitmap |
| 1043 | 1034 | -------------------------------------------------*/ |
| 1044 | 1035 | |
| 1045 | void pdrawgfx_transpen(bitmap_ind16 &dest, const rectangle &cliprect, | |
| 1036 | void pdrawgfx_transpen(bitmap_ind16 &dest, const rectangle &cliprect, | |
| 1046 | 1037 | UINT32 code, UINT32 color, int flipx, int flipy, INT32 destx, INT32 desty, |
| 1047 | 1038 | bitmap_ind8 &priority, UINT32 pmask, UINT32 transpen) |
| 1048 | 1039 | { |
| r17669 | r17670 | |
| 1051 | 1042 | return pdrawgfx_opaque(dest, cliprect, gfx, code, color, flipx, flipy, destx, desty, priority, pmask); |
| 1052 | 1043 | |
| 1053 | 1044 | // use pen usage to optimize |
| 1054 | code %= gfx->total_elements; | |
| 1055 | if (gfx->pen_usage != NULL && !gfx->dirty[code]) | |
| 1045 | code %= gfx->elements(); | |
| 1046 | if (gfx->has_pen_usage()) | |
| 1056 | 1047 | { |
| 1057 | 1048 | // fully transparent; do nothing |
| 1058 | UINT32 usage = gfx->pen_usage | |
| 1049 | UINT32 usage = gfx->pen_usage(code); | |
| 1059 | 1050 | if ((usage & ~(1 << transpen)) == 0) |
| 1060 | 1051 | return; |
| 1061 | 1052 | |
| r17669 | r17670 | |
| 1068 | 1059 | pmask |= 1 << 31; |
| 1069 | 1060 | |
| 1070 | 1061 | // render |
| 1071 | const pen_t *paldata = &gfx->machine().pens[gfx->color | |
| 1062 | const pen_t *paldata = &gfx->machine().pens[gfx->color | |
| 1072 | 1063 | DRAWGFX_CORE(UINT16, PIXEL_OP_REMAP_TRANSPEN_PRIORITY, UINT8); |
| 1073 | 1064 | } |
| 1074 | 1065 | |
| 1075 | void pdrawgfx_transpen(bitmap_rgb32 &dest, const rectangle &cliprect, | |
| 1066 | void pdrawgfx_transpen(bitmap_rgb32 &dest, const rectangle &cliprect, | |
| 1076 | 1067 | UINT32 code, UINT32 color, int flipx, int flipy, INT32 destx, INT32 desty, |
| 1077 | 1068 | bitmap_ind8 &priority, UINT32 pmask, UINT32 transpen) |
| 1078 | 1069 | { |
| r17669 | r17670 | |
| 1081 | 1072 | return pdrawgfx_opaque(dest, cliprect, gfx, code, color, flipx, flipy, destx, desty, priority, pmask); |
| 1082 | 1073 | |
| 1083 | 1074 | // use pen usage to optimize |
| 1084 | code %= gfx->total_elements; | |
| 1085 | if (gfx->pen_usage != NULL && !gfx->dirty[code]) | |
| 1075 | code %= gfx->elements(); | |
| 1076 | if (gfx->has_pen_usage()) | |
| 1086 | 1077 | { |
| 1087 | 1078 | // fully transparent; do nothing |
| 1088 | UINT32 usage = gfx->pen_usage | |
| 1079 | UINT32 usage = gfx->pen_usage(code); | |
| 1089 | 1080 | if ((usage & ~(1 << transpen)) == 0) |
| 1090 | 1081 | return; |
| 1091 | 1082 | |
| r17669 | r17670 | |
| 1098 | 1089 | pmask |= 1 << 31; |
| 1099 | 1090 | |
| 1100 | 1091 | // render |
| 1101 | const pen_t *paldata = &gfx->machine().pens[gfx->color | |
| 1092 | const pen_t *paldata = &gfx->machine().pens[gfx->color | |
| 1102 | 1093 | DRAWGFX_CORE(UINT32, PIXEL_OP_REMAP_TRANSPEN_PRIORITY, UINT8); |
| 1103 | 1094 | } |
| 1104 | 1095 | |
| r17669 | r17670 | |
| 1109 | 1100 | lookups, checking against the priority bitmap |
| 1110 | 1101 | -------------------------------------------------*/ |
| 1111 | 1102 | |
| 1112 | void pdrawgfx_transpen_raw(bitmap_ind16 &dest, const rectangle &cliprect, | |
| 1103 | void pdrawgfx_transpen_raw(bitmap_ind16 &dest, const rectangle &cliprect, | |
| 1113 | 1104 | UINT32 code, UINT32 color, int flipx, int flipy, INT32 destx, INT32 desty, |
| 1114 | 1105 | bitmap_ind8 &priority, UINT32 pmask, UINT32 transpen) |
| 1115 | 1106 | { |
| 1116 | 1107 | // early out if completely transparent |
| 1117 | code %= gfx->total_elements; | |
| 1118 | if (gfx->pen_usage != NULL && !gfx->dirty[code] && (gfx->pen_usage[code] & ~(1 << transpen)) == 0) | |
| 1108 | code %= gfx->elements(); | |
| 1109 | if (gfx->has_pen_usage() && (gfx->pen_usage(code) & ~(1 << transpen)) == 0) | |
| 1119 | 1110 | return; |
| 1120 | 1111 | |
| 1121 | 1112 | // high bit of the mask is implicitly on |
| r17669 | r17670 | |
| 1125 | 1116 | DRAWGFX_CORE(UINT16, PIXEL_OP_REBASE_TRANSPEN_PRIORITY, UINT8); |
| 1126 | 1117 | } |
| 1127 | 1118 | |
| 1128 | void pdrawgfx_transpen_raw(bitmap_rgb32 &dest, const rectangle &cliprect, | |
| 1119 | void pdrawgfx_transpen_raw(bitmap_rgb32 &dest, const rectangle &cliprect, | |
| 1129 | 1120 | UINT32 code, UINT32 color, int flipx, int flipy, INT32 destx, INT32 desty, |
| 1130 | 1121 | bitmap_ind8 &priority, UINT32 pmask, UINT32 transpen) |
| 1131 | 1122 | { |
| 1132 | 1123 | // early out if completely transparent |
| 1133 | code %= gfx->total_elements; | |
| 1134 | if (gfx->pen_usage != NULL && !gfx->dirty[code] && (gfx->pen_usage[code] & ~(1 << transpen)) == 0) | |
| 1124 | code %= gfx->elements(); | |
| 1125 | if (gfx->has_pen_usage() && (gfx->pen_usage(code) & ~(1 << transpen)) == 0) | |
| 1135 | 1126 | return; |
| 1136 | 1127 | |
| 1137 | 1128 | // high bit of the mask is implicitly on |
| r17669 | r17670 | |
| 1148 | 1139 | a mask, checking against the priority bitmap |
| 1149 | 1140 | -------------------------------------------------*/ |
| 1150 | 1141 | |
| 1151 | void pdrawgfx_transmask(bitmap_ind16 &dest, const rectangle &cliprect, | |
| 1142 | void pdrawgfx_transmask(bitmap_ind16 &dest, const rectangle &cliprect, | |
| 1152 | 1143 | UINT32 code, UINT32 color, int flipx, int flipy, INT32 destx, INT32 desty, |
| 1153 | 1144 | bitmap_ind8 &priority, UINT32 pmask, UINT32 transmask) |
| 1154 | 1145 | { |
| r17669 | r17670 | |
| 1157 | 1148 | return pdrawgfx_opaque(dest, cliprect, gfx, code, color, flipx, flipy, destx, desty, priority, pmask); |
| 1158 | 1149 | |
| 1159 | 1150 | // use pen usage to optimize |
| 1160 | code %= gfx->total_elements; | |
| 1161 | if (gfx->pen_usage != NULL && !gfx->dirty[code]) | |
| 1151 | code %= gfx->elements(); | |
| 1152 | if (gfx->has_pen_usage()) | |
| 1162 | 1153 | { |
| 1163 | 1154 | // fully transparent; do nothing |
| 1164 | UINT32 usage = gfx->pen_usage | |
| 1155 | UINT32 usage = gfx->pen_usage(code); | |
| 1165 | 1156 | if ((usage & ~transmask) == 0) |
| 1166 | 1157 | return; |
| 1167 | 1158 | |
| r17669 | r17670 | |
| 1174 | 1165 | pmask |= 1 << 31; |
| 1175 | 1166 | |
| 1176 | 1167 | // render |
| 1177 | const pen_t *paldata = &gfx->machine().pens[gfx->color | |
| 1168 | const pen_t *paldata = &gfx->machine().pens[gfx->color | |
| 1178 | 1169 | DRAWGFX_CORE(UINT16, PIXEL_OP_REMAP_TRANSMASK_PRIORITY, UINT8); |
| 1179 | 1170 | } |
| 1180 | 1171 | |
| 1181 | void pdrawgfx_transmask(bitmap_rgb32 &dest, const rectangle &cliprect, | |
| 1172 | void pdrawgfx_transmask(bitmap_rgb32 &dest, const rectangle &cliprect, | |
| 1182 | 1173 | UINT32 code, UINT32 color, int flipx, int flipy, INT32 destx, INT32 desty, |
| 1183 | 1174 | bitmap_ind8 &priority, UINT32 pmask, UINT32 transmask) |
| 1184 | 1175 | { |
| r17669 | r17670 | |
| 1187 | 1178 | return pdrawgfx_opaque(dest, cliprect, gfx, code, color, flipx, flipy, destx, desty, priority, pmask); |
| 1188 | 1179 | |
| 1189 | 1180 | // use pen usage to optimize |
| 1190 | code %= gfx->total_elements; | |
| 1191 | if (gfx->pen_usage != NULL && !gfx->dirty[code]) | |
| 1181 | code %= gfx->elements(); | |
| 1182 | if (gfx->has_pen_usage()) | |
| 1192 | 1183 | { |
| 1193 | 1184 | // fully transparent; do nothing |
| 1194 | UINT32 usage = gfx->pen_usage | |
| 1185 | UINT32 usage = gfx->pen_usage(code); | |
| 1195 | 1186 | if ((usage & ~transmask) == 0) |
| 1196 | 1187 | return; |
| 1197 | 1188 | |
| r17669 | r17670 | |
| 1204 | 1195 | pmask |= 1 << 31; |
| 1205 | 1196 | |
| 1206 | 1197 | // render |
| 1207 | const pen_t *paldata = &gfx->machine().pens[gfx->color | |
| 1198 | const pen_t *paldata = &gfx->machine().pens[gfx->color | |
| 1208 | 1199 | DRAWGFX_CORE(UINT32, PIXEL_OP_REMAP_TRANSMASK_PRIORITY, UINT8); |
| 1209 | 1200 | } |
| 1210 | 1201 | |
| r17669 | r17670 | |
| 1216 | 1207 | against the priority bitmap |
| 1217 | 1208 | -------------------------------------------------*/ |
| 1218 | 1209 | |
| 1219 | void pdrawgfx_transtable(bitmap_ind16 &dest, const rectangle &cliprect, | |
| 1210 | void pdrawgfx_transtable(bitmap_ind16 &dest, const rectangle &cliprect, | |
| 1220 | 1211 | UINT32 code, UINT32 color, int flipx, int flipy, INT32 destx, INT32 desty, |
| 1221 | 1212 | bitmap_ind8 &priority, UINT32 pmask, const UINT8 *pentable, const pen_t *shadowtable) |
| 1222 | 1213 | { |
| r17669 | r17670 | |
| 1226 | 1217 | pmask |= 1 << 31; |
| 1227 | 1218 | |
| 1228 | 1219 | // render |
| 1229 | const pen_t *paldata = &gfx->machine().pens[gfx->color_base + gfx->color_granularity * (color % gfx->total_colors)]; | |
| 1230 | code %= gfx->total_elements; | |
| 1220 | const pen_t *paldata = &gfx->machine().pens[gfx->colorbase() + gfx->granularity() * (color % gfx->colors())]; | |
| 1221 | code %= gfx->elements(); | |
| 1231 | 1222 | DRAWGFX_CORE(UINT16, PIXEL_OP_REMAP_TRANSTABLE16_PRIORITY, UINT8); |
| 1232 | 1223 | } |
| 1233 | 1224 | |
| 1234 | void pdrawgfx_transtable(bitmap_rgb32 &dest, const rectangle &cliprect, | |
| 1225 | void pdrawgfx_transtable(bitmap_rgb32 &dest, const rectangle &cliprect, | |
| 1235 | 1226 | UINT32 code, UINT32 color, int flipx, int flipy, INT32 destx, INT32 desty, |
| 1236 | 1227 | bitmap_ind8 &priority, UINT32 pmask, const UINT8 *pentable, const pen_t *shadowtable) |
| 1237 | 1228 | { |
| r17669 | r17670 | |
| 1241 | 1232 | pmask |= 1 << 31; |
| 1242 | 1233 | |
| 1243 | 1234 | // render |
| 1244 | const pen_t *paldata = &gfx->machine().pens[gfx->color_base + gfx->color_granularity * (color % gfx->total_colors)]; | |
| 1245 | code %= gfx->total_elements; | |
| 1235 | const pen_t *paldata = &gfx->machine().pens[gfx->colorbase() + gfx->granularity() * (color % gfx->colors())]; | |
| 1236 | code %= gfx->elements(); | |
| 1246 | 1237 | DRAWGFX_CORE(UINT32, PIXEL_OP_REMAP_TRANSTABLE32_PRIORITY, UINT8); |
| 1247 | 1238 | } |
| 1248 | 1239 | |
| r17669 | r17670 | |
| 1254 | 1245 | checking against the priority bitmap |
| 1255 | 1246 | -------------------------------------------------*/ |
| 1256 | 1247 | |
| 1257 | void pdrawgfx_alpha(bitmap_rgb32 &dest, const rectangle &cliprect, | |
| 1248 | void pdrawgfx_alpha(bitmap_rgb32 &dest, const rectangle &cliprect, | |
| 1258 | 1249 | UINT32 code, UINT32 color, int flipx, int flipy, INT32 destx, INT32 desty, |
| 1259 | 1250 | bitmap_ind8 &priority, UINT32 pmask, UINT32 transpen, UINT8 alpha) |
| 1260 | 1251 | { |
| r17669 | r17670 | |
| 1263 | 1254 | return pdrawgfx_transpen(dest, cliprect, gfx, code, color, flipx, flipy, destx, desty, priority, pmask, transpen); |
| 1264 | 1255 | |
| 1265 | 1256 | // early out if completely transparent |
| 1266 | code %= gfx->total_elements; | |
| 1267 | if (gfx->pen_usage != NULL && !gfx->dirty[code] && (gfx->pen_usage[code] & ~(1 << transpen)) == 0) | |
| 1257 | code %= gfx->elements(); | |
| 1258 | if (gfx->has_pen_usage() && (gfx->pen_usage(code) & ~(1 << transpen)) == 0) | |
| 1268 | 1259 | return; |
| 1269 | 1260 | |
| 1270 | 1261 | // high bit of the mask is implicitly on |
| 1271 | 1262 | pmask |= 1 << 31; |
| 1272 | 1263 | |
| 1273 | 1264 | // render |
| 1274 | const pen_t *paldata = &gfx->machine().pens[gfx->color | |
| 1265 | const pen_t *paldata = &gfx->machine().pens[gfx->color | |
| 1275 | 1266 | DRAWGFX_CORE(UINT32, PIXEL_OP_REMAP_TRANSPEN_ALPHA32_PRIORITY, UINT8); |
| 1276 | 1267 | } |
| 1277 | 1268 | |
| r17669 | r17670 | |
| 1287 | 1278 | the priority bitmap |
| 1288 | 1279 | -------------------------------------------------*/ |
| 1289 | 1280 | |
| 1290 | void pdrawgfxzoom_opaque(bitmap_ind16 &dest, const rectangle &cliprect, | |
| 1281 | void pdrawgfxzoom_opaque(bitmap_ind16 &dest, const rectangle &cliprect, | |
| 1291 | 1282 | UINT32 code, UINT32 color, int flipx, int flipy, INT32 destx, INT32 desty, |
| 1292 | 1283 | UINT32 scalex, UINT32 scaley, bitmap_ind8 &priority, UINT32 pmask) |
| 1293 | 1284 | { |
| r17669 | r17670 | |
| 1299 | 1290 | pmask |= 1 << 31; |
| 1300 | 1291 | |
| 1301 | 1292 | // render |
| 1302 | const pen_t *paldata = &gfx->machine().pens[gfx->color_base + gfx->color_granularity * (color % gfx->total_colors)]; | |
| 1303 | code %= gfx->total_elements; | |
| 1293 | const pen_t *paldata = &gfx->machine().pens[gfx->colorbase() + gfx->granularity() * (color % gfx->colors())]; | |
| 1294 | code %= gfx->elements(); | |
| 1304 | 1295 | DRAWGFXZOOM_CORE(UINT16, PIXEL_OP_REMAP_OPAQUE_PRIORITY, UINT8); |
| 1305 | 1296 | } |
| 1306 | 1297 | |
| 1307 | void pdrawgfxzoom_opaque(bitmap_rgb32 &dest, const rectangle &cliprect, | |
| 1298 | void pdrawgfxzoom_opaque(bitmap_rgb32 &dest, const rectangle &cliprect, | |
| 1308 | 1299 | UINT32 code, UINT32 color, int flipx, int flipy, INT32 destx, INT32 desty, |
| 1309 | 1300 | UINT32 scalex, UINT32 scaley, bitmap_ind8 &priority, UINT32 pmask) |
| 1310 | 1301 | { |
| r17669 | r17670 | |
| 1316 | 1307 | pmask |= 1 << 31; |
| 1317 | 1308 | |
| 1318 | 1309 | // render |
| 1319 | const pen_t *paldata = &gfx->machine().pens[gfx->color_base + gfx->color_granularity * (color % gfx->total_colors)]; | |
| 1320 | code %= gfx->total_elements; | |
| 1310 | const pen_t *paldata = &gfx->machine().pens[gfx->colorbase() + gfx->granularity() * (color % gfx->colors())]; | |
| 1311 | code %= gfx->elements(); | |
| 1321 | 1312 | DRAWGFXZOOM_CORE(UINT32, PIXEL_OP_REMAP_OPAQUE_PRIORITY, UINT8); |
| 1322 | 1313 | } |
| 1323 | 1314 | |
| r17669 | r17670 | |
| 1328 | 1319 | checking against the priority bitmap |
| 1329 | 1320 | -------------------------------------------------*/ |
| 1330 | 1321 | |
| 1331 | void pdrawgfxzoom_transpen(bitmap_ind16 &dest, const rectangle &cliprect, | |
| 1322 | void pdrawgfxzoom_transpen(bitmap_ind16 &dest, const rectangle &cliprect, | |
| 1332 | 1323 | UINT32 code, UINT32 color, int flipx, int flipy, INT32 destx, INT32 desty, |
| 1333 | 1324 | UINT32 scalex, UINT32 scaley, bitmap_ind8 &priority, UINT32 pmask, |
| 1334 | 1325 | UINT32 transpen) |
| r17669 | r17670 | |
| 1342 | 1333 | return pdrawgfxzoom_opaque(dest, cliprect, gfx, code, color, flipx, flipy, destx, desty, scalex, scaley, priority, pmask); |
| 1343 | 1334 | |
| 1344 | 1335 | // use pen usage to optimize |
| 1345 | code %= gfx->total_elements; | |
| 1346 | if (gfx->pen_usage != NULL && !gfx->dirty[code]) | |
| 1336 | code %= gfx->elements(); | |
| 1337 | if (gfx->has_pen_usage()) | |
| 1347 | 1338 | { |
| 1348 | 1339 | // fully transparent; do nothing |
| 1349 | UINT32 usage = gfx->pen_usage | |
| 1340 | UINT32 usage = gfx->pen_usage(code); | |
| 1350 | 1341 | if ((usage & ~(1 << transpen)) == 0) |
| 1351 | 1342 | return; |
| 1352 | 1343 | |
| r17669 | r17670 | |
| 1359 | 1350 | pmask |= 1 << 31; |
| 1360 | 1351 | |
| 1361 | 1352 | // render |
| 1362 | const pen_t *paldata = &gfx->machine().pens[gfx->color | |
| 1353 | const pen_t *paldata = &gfx->machine().pens[gfx->color | |
| 1363 | 1354 | DRAWGFXZOOM_CORE(UINT16, PIXEL_OP_REMAP_TRANSPEN_PRIORITY, UINT8); |
| 1364 | 1355 | } |
| 1365 | 1356 | |
| 1366 | void pdrawgfxzoom_transpen(bitmap_rgb32 &dest, const rectangle &cliprect, | |
| 1357 | void pdrawgfxzoom_transpen(bitmap_rgb32 &dest, const rectangle &cliprect, | |
| 1367 | 1358 | UINT32 code, UINT32 color, int flipx, int flipy, INT32 destx, INT32 desty, |
| 1368 | 1359 | UINT32 scalex, UINT32 scaley, bitmap_ind8 &priority, UINT32 pmask, |
| 1369 | 1360 | UINT32 transpen) |
| r17669 | r17670 | |
| 1377 | 1368 | return pdrawgfxzoom_opaque(dest, cliprect, gfx, code, color, flipx, flipy, destx, desty, scalex, scaley, priority, pmask); |
| 1378 | 1369 | |
| 1379 | 1370 | // use pen usage to optimize |
| 1380 | code %= gfx->total_elements; | |
| 1381 | if (gfx->pen_usage != NULL && !gfx->dirty[code]) | |
| 1371 | code %= gfx->elements(); | |
| 1372 | if (gfx->has_pen_usage()) | |
| 1382 | 1373 | { |
| 1383 | 1374 | // fully transparent; do nothing |
| 1384 | UINT32 usage = gfx->pen_usage | |
| 1375 | UINT32 usage = gfx->pen_usage(code); | |
| 1385 | 1376 | if ((usage & ~(1 << transpen)) == 0) |
| 1386 | 1377 | return; |
| 1387 | 1378 | |
| r17669 | r17670 | |
| 1394 | 1385 | pmask |= 1 << 31; |
| 1395 | 1386 | |
| 1396 | 1387 | // render |
| 1397 | const pen_t *paldata = &gfx->machine().pens[gfx->color | |
| 1388 | const pen_t *paldata = &gfx->machine().pens[gfx->color | |
| 1398 | 1389 | DRAWGFXZOOM_CORE(UINT32, PIXEL_OP_REMAP_TRANSPEN_PRIORITY, UINT8); |
| 1399 | 1390 | } |
| 1400 | 1391 | |
| r17669 | r17670 | |
| 1406 | 1397 | bitmap |
| 1407 | 1398 | -------------------------------------------------*/ |
| 1408 | 1399 | |
| 1409 | void pdrawgfxzoom_transpen_raw(bitmap_ind16 &dest, const rectangle &cliprect, | |
| 1400 | void pdrawgfxzoom_transpen_raw(bitmap_ind16 &dest, const rectangle &cliprect, | |
| 1410 | 1401 | UINT32 code, UINT32 color, int flipx, int flipy, INT32 destx, INT32 desty, |
| 1411 | 1402 | UINT32 scalex, UINT32 scaley, bitmap_ind8 &priority, UINT32 pmask, |
| 1412 | 1403 | UINT32 transpen) |
| r17669 | r17670 | |
| 1416 | 1407 | return pdrawgfx_transpen_raw(dest, cliprect, gfx, code, color, flipx, flipy, destx, desty, priority, pmask, transpen); |
| 1417 | 1408 | |
| 1418 | 1409 | // early out if completely transparent |
| 1419 | code %= gfx->total_elements; | |
| 1420 | if (gfx->pen_usage != NULL && !gfx->dirty[code] && (gfx->pen_usage[code] & ~(1 << transpen)) == 0) | |
| 1410 | code %= gfx->elements(); | |
| 1411 | if (gfx->has_pen_usage() && (gfx->pen_usage(code) & ~(1 << transpen)) == 0) | |
| 1421 | 1412 | return; |
| 1422 | 1413 | |
| 1423 | 1414 | // high bit of the mask is implicitly on |
| r17669 | r17670 | |
| 1427 | 1418 | DRAWGFXZOOM_CORE(UINT16, PIXEL_OP_REBASE_TRANSPEN_PRIORITY, UINT8); |
| 1428 | 1419 | } |
| 1429 | 1420 | |
| 1430 | void pdrawgfxzoom_transpen_raw(bitmap_rgb32 &dest, const rectangle &cliprect, | |
| 1421 | void pdrawgfxzoom_transpen_raw(bitmap_rgb32 &dest, const rectangle &cliprect, | |
| 1431 | 1422 | UINT32 code, UINT32 color, int flipx, int flipy, INT32 destx, INT32 desty, |
| 1432 | 1423 | UINT32 scalex, UINT32 scaley, bitmap_ind8 &priority, UINT32 pmask, |
| 1433 | 1424 | UINT32 transpen) |
| r17669 | r17670 | |
| 1437 | 1428 | return pdrawgfx_transpen_raw(dest, cliprect, gfx, code, color, flipx, flipy, destx, desty, priority, pmask, transpen); |
| 1438 | 1429 | |
| 1439 | 1430 | // early out if completely transparent |
| 1440 | code %= gfx->total_elements; | |
| 1441 | if (gfx->pen_usage != NULL && !gfx->dirty[code] && (gfx->pen_usage[code] & ~(1 << transpen)) == 0) | |
| 1431 | code %= gfx->elements(); | |
| 1432 | if (gfx->has_pen_usage() && (gfx->pen_usage(code) & ~(1 << transpen)) == 0) | |
| 1442 | 1433 | return; |
| 1443 | 1434 | |
| 1444 | 1435 | // high bit of the mask is implicitly on |
| r17669 | r17670 | |
| 1456 | 1447 | priority bitmap |
| 1457 | 1448 | -------------------------------------------------*/ |
| 1458 | 1449 | |
| 1459 | void pdrawgfxzoom_transmask(bitmap_ind16 &dest, const rectangle &cliprect, | |
| 1450 | void pdrawgfxzoom_transmask(bitmap_ind16 &dest, const rectangle &cliprect, | |
| 1460 | 1451 | UINT32 code, UINT32 color, int flipx, int flipy, INT32 destx, INT32 desty, |
| 1461 | 1452 | UINT32 scalex, UINT32 scaley, bitmap_ind8 &priority, UINT32 pmask, |
| 1462 | 1453 | UINT32 transmask) |
| r17669 | r17670 | |
| 1470 | 1461 | return pdrawgfxzoom_opaque(dest, cliprect, gfx, code, color, flipx, flipy, destx, desty, scalex, scaley, priority, pmask); |
| 1471 | 1462 | |
| 1472 | 1463 | // use pen usage to optimize |
| 1473 | code %= gfx->total_elements; | |
| 1474 | if (gfx->pen_usage != NULL && !gfx->dirty[code]) | |
| 1464 | code %= gfx->elements(); | |
| 1465 | if (gfx->has_pen_usage()) | |
| 1475 | 1466 | { |
| 1476 | 1467 | // fully transparent; do nothing |
| 1477 | UINT32 usage = gfx->pen_usage | |
| 1468 | UINT32 usage = gfx->pen_usage(code); | |
| 1478 | 1469 | if ((usage & ~transmask) == 0) |
| 1479 | 1470 | return; |
| 1480 | 1471 | |
| r17669 | r17670 | |
| 1487 | 1478 | pmask |= 1 << 31; |
| 1488 | 1479 | |
| 1489 | 1480 | // render |
| 1490 | const pen_t *paldata = &gfx->machine().pens[gfx->color | |
| 1481 | const pen_t *paldata = &gfx->machine().pens[gfx->color | |
| 1491 | 1482 | DRAWGFXZOOM_CORE(UINT16, PIXEL_OP_REMAP_TRANSMASK_PRIORITY, UINT8); |
| 1492 | 1483 | } |
| 1493 | 1484 | |
| 1494 | void pdrawgfxzoom_transmask(bitmap_rgb32 &dest, const rectangle &cliprect, | |
| 1485 | void pdrawgfxzoom_transmask(bitmap_rgb32 &dest, const rectangle &cliprect, | |
| 1495 | 1486 | UINT32 code, UINT32 color, int flipx, int flipy, INT32 destx, INT32 desty, |
| 1496 | 1487 | UINT32 scalex, UINT32 scaley, bitmap_ind8 &priority, UINT32 pmask, |
| 1497 | 1488 | UINT32 transmask) |
| r17669 | r17670 | |
| 1505 | 1496 | return pdrawgfxzoom_opaque(dest, cliprect, gfx, code, color, flipx, flipy, destx, desty, scalex, scaley, priority, pmask); |
| 1506 | 1497 | |
| 1507 | 1498 | // use pen usage to optimize |
| 1508 | code %= gfx->total_elements; | |
| 1509 | if (gfx->pen_usage != NULL && !gfx->dirty[code]) | |
| 1499 | code %= gfx->elements(); | |
| 1500 | if (gfx->has_pen_usage()) | |
| 1510 | 1501 | { |
| 1511 | 1502 | // fully transparent; do nothing |
| 1512 | UINT32 usage = gfx->pen_usage | |
| 1503 | UINT32 usage = gfx->pen_usage(code); | |
| 1513 | 1504 | if ((usage & ~transmask) == 0) |
| 1514 | 1505 | return; |
| 1515 | 1506 | |
| r17669 | r17670 | |
| 1522 | 1513 | pmask |= 1 << 31; |
| 1523 | 1514 | |
| 1524 | 1515 | // render |
| 1525 | const pen_t *paldata = &gfx->machine().pens[gfx->color | |
| 1516 | const pen_t *paldata = &gfx->machine().pens[gfx->color | |
| 1526 | 1517 | DRAWGFXZOOM_CORE(UINT32, PIXEL_OP_REMAP_TRANSMASK_PRIORITY, UINT8); |
| 1527 | 1518 | } |
| 1528 | 1519 | |
| r17669 | r17670 | |
| 1534 | 1525 | checking against the priority bitmap |
| 1535 | 1526 | -------------------------------------------------*/ |
| 1536 | 1527 | |
| 1537 | void pdrawgfxzoom_transtable(bitmap_ind16 &dest, const rectangle &cliprect, | |
| 1528 | void pdrawgfxzoom_transtable(bitmap_ind16 &dest, const rectangle &cliprect, | |
| 1538 | 1529 | UINT32 code, UINT32 color, int flipx, int flipy, INT32 destx, INT32 desty, |
| 1539 | 1530 | UINT32 scalex, UINT32 scaley, bitmap_ind8 &priority, UINT32 pmask, |
| 1540 | 1531 | const UINT8 *pentable, const pen_t *shadowtable) |
| r17669 | r17670 | |
| 1549 | 1540 | pmask |= 1 << 31; |
| 1550 | 1541 | |
| 1551 | 1542 | // render |
| 1552 | const pen_t *paldata = &gfx->machine().pens[gfx->color_base + gfx->color_granularity * (color % gfx->total_colors)]; | |
| 1553 | code %= gfx->total_elements; | |
| 1543 | const pen_t *paldata = &gfx->machine().pens[gfx->colorbase() + gfx->granularity() * (color % gfx->colors())]; | |
| 1544 | code %= gfx->elements(); | |
| 1554 | 1545 | DRAWGFXZOOM_CORE(UINT16, PIXEL_OP_REMAP_TRANSTABLE16_PRIORITY, UINT8); |
| 1555 | 1546 | } |
| 1556 | 1547 | |
| 1557 | void pdrawgfxzoom_transtable(bitmap_rgb32 &dest, const rectangle &cliprect, | |
| 1548 | void pdrawgfxzoom_transtable(bitmap_rgb32 &dest, const rectangle &cliprect, | |
| 1558 | 1549 | UINT32 code, UINT32 color, int flipx, int flipy, INT32 destx, INT32 desty, |
| 1559 | 1550 | UINT32 scalex, UINT32 scaley, bitmap_ind8 &priority, UINT32 pmask, |
| 1560 | 1551 | const UINT8 *pentable, const pen_t *shadowtable) |
| r17669 | r17670 | |
| 1569 | 1560 | pmask |= 1 << 31; |
| 1570 | 1561 | |
| 1571 | 1562 | // render |
| 1572 | const pen_t *paldata = &gfx->machine().pens[gfx->color_base + gfx->color_granularity * (color % gfx->total_colors)]; | |
| 1573 | code %= gfx->total_elements; | |
| 1563 | const pen_t *paldata = &gfx->machine().pens[gfx->colorbase() + gfx->granularity() * (color % gfx->colors())]; | |
| 1564 | code %= gfx->elements(); | |
| 1574 | 1565 | DRAWGFXZOOM_CORE(UINT32, PIXEL_OP_REMAP_TRANSTABLE32_PRIORITY, UINT8); |
| 1575 | 1566 | } |
| 1576 | 1567 | |
| r17669 | r17670 | |
| 1583 | 1574 | bitmap |
| 1584 | 1575 | -------------------------------------------------*/ |
| 1585 | 1576 | |
| 1586 | void pdrawgfxzoom_alpha(bitmap_rgb32 &dest, const rectangle &cliprect, | |
| 1577 | void pdrawgfxzoom_alpha(bitmap_rgb32 &dest, const rectangle &cliprect, | |
| 1587 | 1578 | UINT32 code, UINT32 color, int flipx, int flipy, INT32 destx, INT32 desty, |
| 1588 | 1579 | UINT32 scalex, UINT32 scaley, bitmap_ind8 &priority, UINT32 pmask, |
| 1589 | 1580 | UINT32 transpen, UINT8 alpha) |
| r17669 | r17670 | |
| 1597 | 1588 | return pdrawgfxzoom_transpen(dest, cliprect, gfx, code, color, flipx, flipy, destx, desty, scalex, scaley, priority, pmask, transpen); |
| 1598 | 1589 | |
| 1599 | 1590 | // early out if completely transparent |
| 1600 | code %= gfx->total_elements; | |
| 1601 | if (gfx->pen_usage != NULL && !gfx->dirty[code] && (gfx->pen_usage[code] & ~(1 << transpen)) == 0) | |
| 1591 | code %= gfx->elements(); | |
| 1592 | if (gfx->has_pen_usage() && (gfx->pen_usage(code) & ~(1 << transpen)) == 0) | |
| 1602 | 1593 | return; |
| 1603 | 1594 | |
| 1604 | 1595 | // high bit of the mask is implicitly on |
| 1605 | 1596 | pmask |= 1 << 31; |
| 1606 | 1597 | |
| 1607 | 1598 | // render |
| 1608 | const pen_t *paldata = &gfx->machine().pens[gfx->color | |
| 1599 | const pen_t *paldata = &gfx->machine().pens[gfx->color | |
| 1609 | 1600 | DRAWGFXZOOM_CORE(UINT32, PIXEL_OP_REMAP_TRANSPEN_ALPHA32_PRIORITY, UINT8); |
| 1610 | 1601 | } |
| 1611 | 1602 |
| r17669 | r17670 | |
|---|---|---|
| 31 | 31 | #define EXTENDED_XOFFS { 0 } |
| 32 | 32 | #define EXTENDED_YOFFS { 0 } |
| 33 | 33 | |
| 34 | #define GFX_ELEMENT_DONT_FREE 1 /* gfxdata was not malloc()ed, so don't free it on exit */ | |
| 35 | ||
| 36 | 34 | #define GFX_RAW 0x12345678 |
| 37 | /* When planeoffset[0] is set to GFX_RAW, the gfx data is left as-is, with no conversion. | |
| 38 | No buffer is allocated for the decoded data, and gfxdata is set to point to the source | |
| 39 | data. | |
| 40 | xoffset[0] is an optional displacement (*8) from the beginning of the source data, while | |
| 41 | yoffset[0] is the line modulo (*8) and charincrement the char modulo (*8). They are *8 | |
| 42 | for consistency with the usual behaviour, but the bottom 3 bits are not used. | |
| 35 | // When planeoffset[0] is set to GFX_RAW, the gfx data is left as-is, with no conversion. | |
| 36 | // No buffer is allocated for the decoded data, and gfxdata is set to point to the source | |
| 37 | // data. | |
| 38 | // xoffset[0] is an optional displacement (*8) from the beginning of the source data, while | |
| 39 | // yoffset[0] is the line modulo (*8) and charincrement the char modulo (*8). They are *8 | |
| 40 | // for consistency with the usual behaviour, but the bottom 3 bits are not used. | |
| 43 | 41 | |
| 44 | This special mode can be used to save memory in games that require several different | |
| 45 | handlings of the same ROM data (e.g. metro.c can use both 4bpp and 8bpp tiles, and both | |
| 46 | 8x8 and 16x16; cps.c has 8x8, 16x16 and 32x32 tiles all fetched from the same ROMs). | |
| 47 | */ | |
| 42 | // This special mode can be used to save memory in games that require several different | |
| 43 | // handlings of the same ROM data (e.g. metro.c can use both 4bpp and 8bpp tiles, and both | |
| 44 | // 8x8 and 16x16; cps.c has 8x8, 16x16 and 32x32 tiles all fetched from the same ROMs). | |
| 48 | 45 | |
| 49 | 46 | enum |
| 50 | 47 | { |
| r17669 | r17670 | |
| 59 | 56 | MACROS |
| 60 | 57 | ***************************************************************************/ |
| 61 | 58 | |
| 62 | /* these macros describe gfx_layouts in terms of fractions of a region */ | |
| 63 | /* they can be used for total, planeoffset, xoffset, yoffset */ | |
| 59 | // these macros describe gfx_layouts in terms of fractions of a region | |
| 60 | // they can be used for total, planeoffset, xoffset, yoffset | |
| 64 | 61 | #define RGN_FRAC(num,den) (0x80000000 | (((num) & 0x0f) << 27) | (((den) & 0x0f) << 23)) |
| 65 | 62 | #define IS_FRAC(offset) ((offset) & 0x80000000) |
| 66 | 63 | #define FRAC_NUM(offset) (((offset) >> 27) & 0x0f) |
| 67 | 64 | #define FRAC_DEN(offset) (((offset) >> 23) & 0x0f) |
| 68 | 65 | #define FRAC_OFFSET(offset) ((offset) & 0x007fffff) |
| 69 | 66 | |
| 70 | / | |
| 67 | // these macros are useful in gfx_layouts | |
| 71 | 68 | #define STEP2(START,STEP) (START),(START)+(STEP) |
| 72 | 69 | #define STEP4(START,STEP) STEP2(START,STEP),STEP2((START)+2*(STEP),STEP) |
| 73 | 70 | #define STEP8(START,STEP) STEP4(START,STEP),STEP4((START)+4*(STEP),STEP) |
| r17669 | r17670 | |
| 81 | 78 | #define STEP2048(START,STEP) STEP1024(START,STEP),STEP1024((START)+1024*(STEP),STEP) |
| 82 | 79 | |
| 83 | 80 | |
| 84 | / | |
| 81 | // these macros are used for declaring gfx_decode_entry_entry info arrays. | |
| 85 | 82 | #define GFXDECODE_NAME( name ) gfxdecodeinfo_##name |
| 86 | 83 | #define GFXDECODE_EXTERN( name ) extern const gfx_decode_entry GFXDECODE_NAME(name)[] |
| 87 | 84 | #define GFXDECODE_START( name ) const gfx_decode_entry GFXDECODE_NAME(name)[] = { |
| r17669 | r17670 | |
| 89 | 86 | #define GFXDECODE_SCALE(region,offset,layout,start,colors,xscale,yscale) { region, offset, &layout, start, colors, xscale, yscale }, |
| 90 | 87 | #define GFXDECODE_END { 0 } }; |
| 91 | 88 | |
| 92 | / | |
| 89 | // these macros are used for declaring gfx_layout structures. | |
| 93 | 90 | #define GFXLAYOUT_RAW( name, width, height, linemod, charmod ) \ |
| 94 | 91 | const gfx_layout name = { width, height, RGN_FRAC(1,1), 8, { GFX_RAW }, { 0 }, { linemod }, charmod }; |
| 95 | 92 | |
| r17669 | r17670 | |
| 99 | 96 | TYPE DEFINITIONS |
| 100 | 97 | ***************************************************************************/ |
| 101 | 98 | |
| 102 | typedef struct _gfx_layout gfx_layout; | |
| 103 | struct _gfx_layout | |
| 99 | struct gfx_layout | |
| 104 | 100 | { |
| 105 | UINT16 width; /* pixel width of each element */ | |
| 106 | UINT16 height; /* pixel height of each element */ | |
| 107 | UINT32 total; /* total number of elements, or RGN_FRAC() */ | |
| 108 | UINT16 planes; /* number of bitplanes */ | |
| 109 | UINT32 planeoffset[MAX_GFX_PLANES]; /* bit offset of each bitplane */ | |
| 110 | UINT32 xoffset[MAX_GFX_SIZE]; /* bit offset of each horizontal pixel */ | |
| 111 | UINT32 yoffset[MAX_GFX_SIZE]; /* bit offset of each vertical pixel */ | |
| 112 | UINT32 charincrement; /* distance between two consecutive elements (in bits) */ | |
| 113 | const UINT32 * extxoffs; /* extended X offset array for really big layouts */ | |
| 114 | const UINT32 * extyoffs; /* extended Y offset array for really big layouts */ | |
| 101 | UINT32 xoffs(int x) const { return (extxoffs != NULL) ? extxoffs[x] : xoffset[x]; } | |
| 102 | UINT32 yoffs(int y) const { return (extyoffs != NULL) ? extyoffs[y] : yoffset[y]; } | |
| 103 | ||
| 104 | UINT16 width; // pixel width of each element | |
| 105 | UINT16 height; // pixel height of each element | |
| 106 | UINT32 total; // total number of elements, or RGN_FRAC() | |
| 107 | UINT16 planes; // number of bitplanes | |
| 108 | UINT32 planeoffset[MAX_GFX_PLANES]; // bit offset of each bitplane | |
| 109 | UINT32 xoffset[MAX_GFX_SIZE]; // bit offset of each horizontal pixel | |
| 110 | UINT32 yoffset[MAX_GFX_SIZE]; // bit offset of each vertical pixel | |
| 111 | UINT32 charincrement; // distance between two consecutive elements (in bits) | |
| 112 | const UINT32 * extxoffs; // extended X offset array for really big layouts | |
| 113 | const UINT32 * extyoffs; // extended Y offset array for really big layouts | |
| 115 | 114 | }; |
| 116 | 115 | |
| 117 | 116 | |
| 118 | 117 | class gfx_element |
| 119 | 118 | { |
| 120 | 119 | public: |
| 121 | gfx_element(running_machine &machine) | |
| 122 | : m_machine(machine) { } | |
| 120 | // construction/destruction | |
| 121 | gfx_element(running_machine &machine); | |
| 122 | gfx_element(running_machine &machine, const gfx_layout &gl, const UINT8 *srcdata, UINT32 total_colors, UINT32 color_base); | |
| 123 | gfx_element(running_machine &machine, UINT8 *base, UINT32 width, UINT32 height, UINT32 rowbytes, UINT32 color_base, UINT32 color_granularity); | |
| 123 | 124 | |
| 125 | // getters | |
| 124 | 126 | running_machine &machine() const { return m_machine; } |
| 127 | UINT16 width() const { return m_width; } | |
| 128 | UINT16 height() const { return m_height; } | |
| 129 | UINT32 elements() const { return m_total_elements; } | |
| 130 | UINT32 colorbase() const { return m_color_base; } | |
| 131 | UINT16 depth() const { return m_color_depth; } | |
| 132 | UINT16 granularity() const { return m_color_granularity; } | |
| 133 | UINT32 colors() const { return m_total_colors; } | |
| 134 | UINT32 rowbytes() const { return m_line_modulo; } | |
| 135 | bool has_pen_usage() const { return (m_pen_usage.count() > 0); } | |
| 136 | ||
| 137 | // a bit gross that people muck with this stuff... | |
| 138 | const UINT8 *srcdata() const { return m_srcdata; } | |
| 139 | UINT32 dirtyseq() const { return m_dirtyseq; } | |
| 140 | UINT32 *pen_usage() { return &m_pen_usage[0]; } | |
| 125 | 141 | |
| 126 | UINT16 width; /* current pixel width of each element (changeble with source clipping) */ | |
| 127 | UINT16 height; /* current pixel height of each element (changeble with source clipping) */ | |
| 128 | UINT16 startx; /* current source clip X offset */ | |
| 129 | UINT16 starty; /* current source clip Y offset */ | |
| 142 | // setters | |
| 143 | void set_layout(const gfx_layout &gl, const UINT8 *srcdata); | |
| 144 | void set_raw_layout(const UINT8 *srcdata, UINT32 width, UINT32 height, UINT32 total, UINT32 linemod, UINT32 charmod); | |
| 145 | void set_source(const UINT8 *source) { m_srcdata = source; if (m_layout_is_raw) m_gfxdata = const_cast<UINT8 *>(source); memset(m_dirty, 1, elements()); } | |
| 146 | void set_colors(UINT32 colors) { m_total_colors = colors; } | |
| 147 | void set_colorbase(UINT16 colorbase) { m_color_base = colorbase; } | |
| 148 | void set_granularity(UINT16 granularity) { m_color_granularity = granularity; } | |
| 149 | void set_source_clip(UINT32 xoffs, UINT32 width, UINT32 yoffs, UINT32 height); | |
| 130 | 150 | |
| 131 | UINT16 origwidth; /* starting pixel width of each element */ | |
| 132 | UINT16 origheight; /* staring pixel height of each element */ | |
| 133 | UINT8 flags; /* one of the GFX_ELEMENT_* flags above */ | |
| 134 | UINT32 total_elements; /* total number of decoded elements */ | |
| 151 | // operations | |
| 152 | void mark_dirty(UINT32 code) { if (code < elements()) { m_dirty[code] = 1; m_dirtyseq++; } } | |
| 153 | void mark_all_dirty() { memset(&m_dirty[0], 1, elements()); } | |
| 154 | void decode(UINT32 code); | |
| 135 | 155 | |
| 136 | UINT32 color_base; /* base color for rendering */ | |
| 137 | UINT16 color_depth; /* number of colors each pixel can represent */ | |
| 138 | UINT16 color_granularity; /* number of colors for each color code */ | |
| 139 | UINT32 total_colors; /* number of color codes */ | |
| 156 | const UINT8 *get_data(UINT32 code) | |
| 157 | { | |
| 158 | assert(code < elements()); | |
| 159 | if (m_dirty[code]) decode(code); | |
| 160 | return m_gfxdata + code * m_char_modulo + m_starty * m_line_modulo + m_startx; | |
| 161 | } | |
| 162 | ||
| 163 | UINT32 pen_usage(UINT32 code) | |
| 164 | { | |
| 165 | assert(code < m_pen_usage.count()); | |
| 166 | if (m_dirty[code]) decode(code); | |
| 167 | return m_pen_usage[code]; | |
| 168 | } | |
| 169 | ||
| 170 | private: | |
| 171 | // internal state | |
| 172 | UINT16 m_width; // current pixel width of each element (changeble with source clipping) | |
| 173 | UINT16 m_height; // current pixel height of each element (changeble with source clipping) | |
| 174 | UINT16 m_startx; // current source clip X offset | |
| 175 | UINT16 m_starty; // current source clip Y offset | |
| 140 | 176 | |
| 141 | UINT32 * pen_usage; /* bitmask of pens that are used (pens 0-31 only) */ | |
| 177 | UINT16 m_origwidth; // starting pixel width of each element | |
| 178 | UINT16 m_origheight; // staring pixel height of each element | |
| 179 | UINT32 m_total_elements; // total number of decoded elements | |
| 142 | 180 | |
| 143 | UINT8 * gfxdata; /* pixel data, 8bpp */ | |
| 144 | UINT32 line_modulo; /* bytes between each row of data */ | |
| 145 | UINT32 char_modulo; /* bytes between each element */ | |
| 146 | const UINT8 * srcdata; /* pointer to the source data for decoding */ | |
| 147 | UINT8 * dirty; /* dirty array for detecting tiles that need decoding */ | |
| 148 | UINT32 dirtyseq; /* sequence number; incremented each time a tile is dirtied */ | |
| 181 | UINT32 m_color_base; // base color for rendering | |
| 182 | UINT16 m_color_depth; // number of colors each pixel can represent | |
| 183 | UINT16 m_color_granularity; // number of colors for each color code | |
| 184 | UINT32 m_total_colors; // number of color codes | |
| 149 | 185 | |
| 150 | gfx_layout layout; /* copy of the original layout */ | |
| 186 | UINT32 m_line_modulo; // bytes between each row of data | |
| 187 | UINT32 m_char_modulo; // bytes between each element | |
| 188 | const UINT8 * m_srcdata; // pointer to the source data for decoding | |
| 189 | UINT32 m_dirtyseq; // sequence number; incremented each time a tile is dirtied | |
| 151 | 190 | |
| 152 | private: | |
| 153 | running_machine &m_machine; /* pointer to the owning machine */ | |
| 191 | UINT8 * m_gfxdata; // pointer to decoded pixel data, 8bpp | |
| 192 | dynamic_buffer m_gfxdata_allocated; // allocated decoded pixel data, 8bpp | |
| 193 | dynamic_buffer m_dirty; // dirty array for detecting chars that need decoding | |
| 194 | dynamic_array<UINT32> m_pen_usage; // bitmask of pens that are used (pens 0-31 only) | |
| 195 | ||
| 196 | bool m_layout_is_raw; // raw layout? | |
| 197 | UINT8 m_layout_planes; // bit planes in the layout | |
| 198 | UINT32 m_layout_charincrement; // per-character increment in source data | |
| 199 | dynamic_array<UINT32> m_layout_planeoffset;// plane offsets | |
| 200 | dynamic_array<UINT32> m_layout_xoffset; // X offsets | |
| 201 | dynamic_array<UINT32> m_layout_yoffset; // Y offsets | |
| 202 | ||
| 203 | running_machine &m_machine; // pointer to the owning machine | |
| 154 | 204 | }; |
| 155 | 205 | |
| 156 | 206 | |
| 157 | 207 | struct gfx_decode_entry |
| 158 | 208 | { |
| 159 | const char * memory_region; /* memory region where the data resides */ | |
| 160 | UINT32 start; /* offset of beginning of data to decode */ | |
| 161 | const gfx_layout *gfxlayout; /* pointer to gfx_layout describing the layout; NULL marks the end of the array */ | |
| 162 | UINT16 color_codes_start; /* offset in the color lookup table where color codes start */ | |
| 163 | UINT16 total_color_codes; /* total number of color codes */ | |
| 164 | UINT8 xscale; /* optional horizontal scaling factor; 0 means 1x */ | |
| 165 | UINT8 yscale; /* optional vertical scaling factor; 0 means 1x */ | |
| 209 | const char * memory_region; // memory region where the data resides | |
| 210 | UINT32 start; // offset of beginning of data to decode | |
| 211 | const gfx_layout *gfxlayout; // pointer to gfx_layout describing the layout; NULL marks the end of the array | |
| 212 | UINT16 color_codes_start; // offset in the color lookup table where color codes start | |
| 213 | UINT16 total_color_codes; // total number of color codes | |
| 214 | UINT8 xscale; // optional horizontal scaling factor; 0 means 1x | |
| 215 | UINT8 yscale; // optional vertical scaling factor; 0 means 1x | |
| 166 | 216 | }; |
| 167 | 217 | |
| 168 | 218 | |
| r17669 | r17670 | |
| 172 | 222 | ***************************************************************************/ |
| 173 | 223 | |
| 174 | 224 | |
| 175 | / | |
| 225 | // ----- graphics elements ----- | |
| 176 | 226 | |
| 177 | / | |
| 227 | // allocate memory for the graphics elements referenced by a machine | |
| 178 | 228 | void gfx_init(running_machine &machine); |
| 179 | 229 | |
| 180 | /* allocate a gfx_element structure based on a given layout */ | |
| 181 | gfx_element *gfx_element_alloc(running_machine &machine, const gfx_layout *gl, const UINT8 *srcdata, UINT32 total_colors, UINT32 color_base); | |
| 182 | 230 | |
| 183 | /* update a single code in a gfx_element */ | |
| 184 | void gfx_element_decode(const gfx_element *gfx, UINT32 code); | |
| 185 | 231 | |
| 186 | /* free a gfx_element */ | |
| 187 | void gfx_element_free(gfx_element *gfx); | |
| 232 | // ----- core graphics drawing ----- | |
| 188 | 233 | |
| 189 | /* create a temporary one-off gfx_element */ | |
| 190 | void gfx_element_build_temporary(gfx_element *gfx, running_machine &machine, UINT8 *base, UINT32 width, UINT32 height, UINT32 rowbytes, UINT32 color_base, UINT32 color_granularity, UINT32 flags); | |
| 234 | // specific drawgfx implementations for each transparency type | |
| 235 | void drawgfx_opaque(bitmap_ind16 &dest, const rectangle &cliprect, gfx_element *gfx, UINT32 code, UINT32 color, int flipx, int flipy, INT32 destx, INT32 desty); | |
| 236 | void drawgfx_opaque(bitmap_rgb32 &dest, const rectangle &cliprect, gfx_element *gfx, UINT32 code, UINT32 color, int flipx, int flipy, INT32 destx, INT32 desty); | |
| 237 | void drawgfx_transpen(bitmap_ind16 &dest, const rectangle &cliprect, gfx_element *gfx, UINT32 code, UINT32 color, int flipx, int flipy, INT32 destx, INT32 desty, UINT32 transpen); | |
| 238 | void drawgfx_transpen(bitmap_rgb32 &dest, const rectangle &cliprect, gfx_element *gfx, UINT32 code, UINT32 color, int flipx, int flipy, INT32 destx, INT32 desty, UINT32 transpen); | |
| 239 | void drawgfx_transpen_raw(bitmap_ind16 &dest, const rectangle &cliprect, gfx_element *gfx, UINT32 code, UINT32 color, int flipx, int flipy, INT32 destx, INT32 desty, UINT32 transpen); | |
| 240 | void drawgfx_transpen_raw(bitmap_rgb32 &dest, const rectangle &cliprect, gfx_element *gfx, UINT32 code, UINT32 color, int flipx, int flipy, INT32 destx, INT32 desty, UINT32 transpen); | |
| 241 | void drawgfx_transmask(bitmap_ind16 &dest, const rectangle &cliprect, gfx_element *gfx, UINT32 code, UINT32 color, int flipx, int flipy, INT32 destx, INT32 desty, UINT32 transmask); | |
| 242 | void drawgfx_transmask(bitmap_rgb32 &dest, const rectangle &cliprect, gfx_element *gfx, UINT32 code, UINT32 color, int flipx, int flipy, INT32 destx, INT32 desty, UINT32 transmask); | |
| 243 | void drawgfx_transtable(bitmap_ind16 &dest, const rectangle &cliprect, gfx_element *gfx, UINT32 code, UINT32 color, int flipx, int flipy, INT32 destx, INT32 desty, const UINT8 *pentable, const pen_t *shadowtable); | |
| 244 | void drawgfx_transtable(bitmap_rgb32 &dest, const rectangle &cliprect, gfx_element *gfx, UINT32 code, UINT32 color, int flipx, int flipy, INT32 destx, INT32 desty, const UINT8 *pentable, const pen_t *shadowtable); | |
| 245 | void drawgfx_alpha(bitmap_rgb32 &dest, const rectangle &cliprect, gfx_element *gfx, UINT32 code, UINT32 color, int flipx, int flipy, INT32 destx, INT32 desty, UINT32 transpen, UINT8 alpha); | |
| 191 | 246 | |
| 192 | 247 | |
| 193 | 248 | |
| 194 | / | |
| 249 | // ----- zoomed graphics drawing ----- | |
| 195 | 250 | |
| 196 | /* specific drawgfx implementations for each transparency type */ | |
| 197 | void drawgfx_opaque(bitmap_ind16 &dest, const rectangle &cliprect, const gfx_element *gfx, UINT32 code, UINT32 color, int flipx, int flipy, INT32 destx, INT32 desty); | |
| 198 | void drawgfx_opaque(bitmap_rgb32 &dest, const rectangle &cliprect, const gfx_element *gfx, UINT32 code, UINT32 color, int flipx, int flipy, INT32 destx, INT32 desty); | |
| 199 | void drawgfx_transpen(bitmap_ind16 &dest, const rectangle &cliprect, const gfx_element *gfx, UINT32 code, UINT32 color, int flipx, int flipy, INT32 destx, INT32 desty, UINT32 transpen); | |
| 200 | void drawgfx_transpen(bitmap_rgb32 &dest, const rectangle &cliprect, const gfx_element *gfx, UINT32 code, UINT32 color, int flipx, int flipy, INT32 destx, INT32 desty, UINT32 transpen); | |
| 201 | void drawgfx_transpen_raw(bitmap_ind16 &dest, const rectangle &cliprect, const gfx_element *gfx, UINT32 code, UINT32 color, int flipx, int flipy, INT32 destx, INT32 desty, UINT32 transpen); | |
| 202 | void drawgfx_transpen_raw(bitmap_rgb32 &dest, const rectangle &cliprect, const gfx_element *gfx, UINT32 code, UINT32 color, int flipx, int flipy, INT32 destx, INT32 desty, UINT32 transpen); | |
| 203 | void drawgfx_transmask(bitmap_ind16 &dest, const rectangle &cliprect, const gfx_element *gfx, UINT32 code, UINT32 color, int flipx, int flipy, INT32 destx, INT32 desty, UINT32 transmask); | |
| 204 | void drawgfx_transmask(bitmap_rgb32 &dest, const rectangle &cliprect, const gfx_element *gfx, UINT32 code, UINT32 color, int flipx, int flipy, INT32 destx, INT32 desty, UINT32 transmask); | |
| 205 | void drawgfx_transtable(bitmap_ind16 &dest, const rectangle &cliprect, const gfx_element *gfx, UINT32 code, UINT32 color, int flipx, int flipy, INT32 destx, INT32 desty, const UINT8 *pentable, const pen_t *shadowtable); | |
| 206 | void drawgfx_transtable(bitmap_rgb32 &dest, const rectangle &cliprect, const gfx_element *gfx, UINT32 code, UINT32 color, int flipx, int flipy, INT32 destx, INT32 desty, const UINT8 *pentable, const pen_t *shadowtable); | |
| 207 | void drawgfx_alpha(bitmap_rgb32 &dest, const rectangle &cliprect, const gfx_element *gfx, UINT32 code, UINT32 color, int flipx, int flipy, INT32 destx, INT32 desty, UINT32 transpen, UINT8 alpha); | |
| 251 | // specific drawgfxzoom implementations for each transparency type | |
| 252 | void drawgfxzoom_opaque(bitmap_ind16 &dest, const rectangle &cliprect, gfx_element *gfx, UINT32 code, UINT32 color, int flipx, int flipy, INT32 destx, INT32 desty, UINT32 scalex, UINT32 scaley); | |
| 253 | void drawgfxzoom_opaque(bitmap_rgb32 &dest, const rectangle &cliprect, gfx_element *gfx, UINT32 code, UINT32 color, int flipx, int flipy, INT32 destx, INT32 desty, UINT32 scalex, UINT32 scaley); | |
| 254 | void drawgfxzoom_transpen(bitmap_ind16 &dest, const rectangle &cliprect, gfx_element *gfx, UINT32 code, UINT32 color, int flipx, int flipy, INT32 destx, INT32 desty, UINT32 scalex, UINT32 scaley, UINT32 transpen); | |
| 255 | void drawgfxzoom_transpen(bitmap_rgb32 &dest, const rectangle &cliprect, gfx_element *gfx, UINT32 code, UINT32 color, int flipx, int flipy, INT32 destx, INT32 desty, UINT32 scalex, UINT32 scaley, UINT32 transpen); | |
| 256 | void drawgfxzoom_transpen_raw(bitmap_ind16 &dest, const rectangle &cliprect, gfx_element *gfx, UINT32 code, UINT32 color, int flipx, int flipy, INT32 destx, INT32 desty, UINT32 scalex, UINT32 scaley, UINT32 transpen); | |
| 257 | void drawgfxzoom_transpen_raw(bitmap_rgb32 &dest, const rectangle &cliprect, gfx_element *gfx, UINT32 code, UINT32 color, int flipx, int flipy, INT32 destx, INT32 desty, UINT32 scalex, UINT32 scaley, UINT32 transpen); | |
| 258 | void drawgfxzoom_transmask(bitmap_ind16 &dest, const rectangle &cliprect, gfx_element *gfx, UINT32 code, UINT32 color, int flipx, int flipy, INT32 destx, INT32 desty, UINT32 scalex, UINT32 scaley, UINT32 transmask); | |
| 259 | void drawgfxzoom_transmask(bitmap_rgb32 &dest, const rectangle &cliprect, gfx_element *gfx, UINT32 code, UINT32 color, int flipx, int flipy, INT32 destx, INT32 desty, UINT32 scalex, UINT32 scaley, UINT32 transmask); | |
| 260 | void drawgfxzoom_transtable(bitmap_ind16 &dest, const rectangle &cliprect, gfx_element *gfx, UINT32 code, UINT32 color, int flipx, int flipy, INT32 destx, INT32 desty, UINT32 scalex, UINT32 scaley, const UINT8 *pentable, const pen_t *shadowtable); | |
| 261 | void drawgfxzoom_transtable(bitmap_rgb32 &dest, const rectangle &cliprect, gfx_element *gfx, UINT32 code, UINT32 color, int flipx, int flipy, INT32 destx, INT32 desty, UINT32 scalex, UINT32 scaley, const UINT8 *pentable, const pen_t *shadowtable); | |
| 262 | void drawgfxzoom_alpha(bitmap_rgb32 &dest, const rectangle &cliprect, gfx_element *gfx, UINT32 code, UINT32 color, int flipx, int flipy, INT32 destx, INT32 desty, UINT32 scalex, UINT32 scaley, UINT32 transpen, UINT8 alpha); | |
| 208 | 263 | |
| 209 | 264 | |
| 210 | 265 | |
| 211 | / | |
| 266 | // ----- priority masked graphics drawing ----- | |
| 212 | 267 | |
| 213 | /* specific drawgfxzoom implementations for each transparency type */ | |
| 214 | void drawgfxzoom_opaque(bitmap_ind16 &dest, const rectangle &cliprect, const gfx_element *gfx, UINT32 code, UINT32 color, int flipx, int flipy, INT32 destx, INT32 desty, UINT32 scalex, UINT32 scaley); | |
| 215 | void drawgfxzoom_opaque(bitmap_rgb32 &dest, const rectangle &cliprect, const gfx_element *gfx, UINT32 code, UINT32 color, int flipx, int flipy, INT32 destx, INT32 desty, UINT32 scalex, UINT32 scaley); | |
| 216 | void drawgfxzoom_transpen(bitmap_ind16 &dest, const rectangle &cliprect, const gfx_element *gfx, UINT32 code, UINT32 color, int flipx, int flipy, INT32 destx, INT32 desty, UINT32 scalex, UINT32 scaley, UINT32 transpen); | |
| 217 | void drawgfxzoom_transpen(bitmap_rgb32 &dest, const rectangle &cliprect, const gfx_element *gfx, UINT32 code, UINT32 color, int flipx, int flipy, INT32 destx, INT32 desty, UINT32 scalex, UINT32 scaley, UINT32 transpen); | |
| 218 | void drawgfxzoom_transpen_raw(bitmap_ind16 &dest, const rectangle &cliprect, const gfx_element *gfx, UINT32 code, UINT32 color, int flipx, int flipy, INT32 destx, INT32 desty, UINT32 scalex, UINT32 scaley, UINT32 transpen); | |
| 219 | void drawgfxzoom_transpen_raw(bitmap_rgb32 &dest, const rectangle &cliprect, const gfx_element *gfx, UINT32 code, UINT32 color, int flipx, int flipy, INT32 destx, INT32 desty, UINT32 scalex, UINT32 scaley, UINT32 transpen); | |
| 220 | void drawgfxzoom_transmask(bitmap_ind16 &dest, const rectangle &cliprect, const gfx_element *gfx, UINT32 code, UINT32 color, int flipx, int flipy, INT32 destx, INT32 desty, UINT32 scalex, UINT32 scaley, UINT32 transmask); | |
| 221 | void drawgfxzoom_transmask(bitmap_rgb32 &dest, const rectangle &cliprect, const gfx_element *gfx, UINT32 code, UINT32 color, int flipx, int flipy, INT32 destx, INT32 desty, UINT32 scalex, UINT32 scaley, UINT32 transmask); | |
| 222 | void drawgfxzoom_transtable(bitmap_ind16 &dest, const rectangle &cliprect, const gfx_element *gfx, UINT32 code, UINT32 color, int flipx, int flipy, INT32 destx, INT32 desty, UINT32 scalex, UINT32 scaley, const UINT8 *pentable, const pen_t *shadowtable); | |
| 223 | void drawgfxzoom_transtable(bitmap_rgb32 &dest, const rectangle &cliprect, const gfx_element *gfx, UINT32 code, UINT32 color, int flipx, int flipy, INT32 destx, INT32 desty, UINT32 scalex, UINT32 scaley, const UINT8 *pentable, const pen_t *shadowtable); | |
| 224 | void drawgfxzoom_alpha(bitmap_rgb32 &dest, const rectangle &cliprect, const gfx_element *gfx, UINT32 code, UINT32 color, int flipx, int flipy, INT32 destx, INT32 desty, UINT32 scalex, UINT32 scaley, UINT32 transpen, UINT8 alpha); | |
| 268 | // specific pdrawgfx implementations for each transparency type | |
| 269 | void pdrawgfx_opaque(bitmap_ind16 &dest, const rectangle &cliprect, gfx_element *gfx, UINT32 code, UINT32 color, int flipx, int flipy, INT32 destx, INT32 desty, bitmap_ind8 &priority, UINT32 pmask); | |
| 270 | void pdrawgfx_opaque(bitmap_rgb32 &dest, const rectangle &cliprect, gfx_element *gfx, UINT32 code, UINT32 color, int flipx, int flipy, INT32 destx, INT32 desty, bitmap_ind8 &priority, UINT32 pmask); | |
| 271 | void pdrawgfx_transpen(bitmap_ind16 &dest, const rectangle &cliprect, gfx_element *gfx, UINT32 code, UINT32 color, int flipx, int flipy, INT32 destx, INT32 desty, bitmap_ind8 &priority, UINT32 pmask, UINT32 transpen); | |
| 272 | void pdrawgfx_transpen(bitmap_rgb32 &dest, const rectangle &cliprect, gfx_element *gfx, UINT32 code, UINT32 color, int flipx, int flipy, INT32 destx, INT32 desty, bitmap_ind8 &priority, UINT32 pmask, UINT32 transpen); | |
| 273 | void pdrawgfx_transpen_raw(bitmap_ind16 &dest, const rectangle &cliprect, gfx_element *gfx, UINT32 code, UINT32 color, int flipx, int flipy, INT32 destx, INT32 desty, bitmap_ind8 &priority, UINT32 pmask, UINT32 transpen); | |
| 274 | void pdrawgfx_transpen_raw(bitmap_rgb32 &dest, const rectangle &cliprect, gfx_element *gfx, UINT32 code, UINT32 color, int flipx, int flipy, INT32 destx, INT32 desty, bitmap_ind8 &priority, UINT32 pmask, UINT32 transpen); | |
| 275 | void pdrawgfx_transmask(bitmap_ind16 &dest, const rectangle &cliprect, gfx_element *gfx, UINT32 code, UINT32 color, int flipx, int flipy, INT32 destx, INT32 desty, bitmap_ind8 &priority, UINT32 pmask, UINT32 transmask); | |
| 276 | void pdrawgfx_transmask(bitmap_rgb32 &dest, const rectangle &cliprect, gfx_element *gfx, UINT32 code, UINT32 color, int flipx, int flipy, INT32 destx, INT32 desty, bitmap_ind8 &priority, UINT32 pmask, UINT32 transmask); | |
| 277 | void pdrawgfx_transtable(bitmap_ind16 &dest, const rectangle &cliprect, gfx_element *gfx, UINT32 code, UINT32 color, int flipx, int flipy, INT32 destx, INT32 desty, bitmap_ind8 &priority, UINT32 pmask, const UINT8 *pentable, const pen_t *shadowtable); | |
| 278 | void pdrawgfx_transtable(bitmap_rgb32 &dest, const rectangle &cliprect, gfx_element *gfx, UINT32 code, UINT32 color, int flipx, int flipy, INT32 destx, INT32 desty, bitmap_ind8 &priority, UINT32 pmask, const UINT8 *pentable, const pen_t *shadowtable); | |
| 279 | void pdrawgfx_alpha(bitmap_rgb32 &dest, const rectangle &cliprect, gfx_element *gfx, UINT32 code, UINT32 color, int flipx, int flipy, INT32 destx, INT32 desty, bitmap_ind8 &priority, UINT32 pmask, UINT32 transpen, UINT8 alpha); | |
| 225 | 280 | |
| 226 | 281 | |
| 227 | 282 | |
| 228 | / | |
| 283 | // ----- priority masked zoomed graphics drawing ----- | |
| 229 | 284 | |
| 230 | /* specific pdrawgfx implementations for each transparency type */ | |
| 231 | void pdrawgfx_opaque(bitmap_ind16 &dest, const rectangle &cliprect, const gfx_element *gfx, UINT32 code, UINT32 color, int flipx, int flipy, INT32 destx, INT32 desty, bitmap_ind8 &priority, UINT32 pmask); | |
| 232 | void pdrawgfx_opaque(bitmap_rgb32 &dest, const rectangle &cliprect, const gfx_element *gfx, UINT32 code, UINT32 color, int flipx, int flipy, INT32 destx, INT32 desty, bitmap_ind8 &priority, UINT32 pmask); | |
| 233 | void pdrawgfx_transpen(bitmap_ind16 &dest, const rectangle &cliprect, const gfx_element *gfx, UINT32 code, UINT32 color, int flipx, int flipy, INT32 destx, INT32 desty, bitmap_ind8 &priority, UINT32 pmask, UINT32 transpen); | |
| 234 | void pdrawgfx_transpen(bitmap_rgb32 &dest, const rectangle &cliprect, const gfx_element *gfx, UINT32 code, UINT32 color, int flipx, int flipy, INT32 destx, INT32 desty, bitmap_ind8 &priority, UINT32 pmask, UINT32 transpen); | |
| 235 | void pdrawgfx_transpen_raw(bitmap_ind16 &dest, const rectangle &cliprect, const gfx_element *gfx, UINT32 code, UINT32 color, int flipx, int flipy, INT32 destx, INT32 desty, bitmap_ind8 &priority, UINT32 pmask, UINT32 transpen); | |
| 236 | void pdrawgfx_transpen_raw(bitmap_rgb32 &dest, const rectangle &cliprect, const gfx_element *gfx, UINT32 code, UINT32 color, int flipx, int flipy, INT32 destx, INT32 desty, bitmap_ind8 &priority, UINT32 pmask, UINT32 transpen); | |
| 237 | void pdrawgfx_transmask(bitmap_ind16 &dest, const rectangle &cliprect, const gfx_element *gfx, UINT32 code, UINT32 color, int flipx, int flipy, INT32 destx, INT32 desty, bitmap_ind8 &priority, UINT32 pmask, UINT32 transmask); | |
| 238 | void pdrawgfx_transmask(bitmap_rgb32 &dest, const rectangle &cliprect, const gfx_element *gfx, UINT32 code, UINT32 color, int flipx, int flipy, INT32 destx, INT32 desty, bitmap_ind8 &priority, UINT32 pmask, UINT32 transmask); | |
| 239 | void pdrawgfx_transtable(bitmap_ind16 &dest, const rectangle &cliprect, const gfx_element *gfx, UINT32 code, UINT32 color, int flipx, int flipy, INT32 destx, INT32 desty, bitmap_ind8 &priority, UINT32 pmask, const UINT8 *pentable, const pen_t *shadowtable); | |
| 240 | void pdrawgfx_transtable(bitmap_rgb32 &dest, const rectangle &cliprect, const gfx_element *gfx, UINT32 code, UINT32 color, int flipx, int flipy, INT32 destx, INT32 desty, bitmap_ind8 &priority, UINT32 pmask, const UINT8 *pentable, const pen_t *shadowtable); | |
| 241 | void pdrawgfx_alpha(bitmap_rgb32 &dest, const rectangle &cliprect, const gfx_element *gfx, UINT32 code, UINT32 color, int flipx, int flipy, INT32 destx, INT32 desty, bitmap_ind8 &priority, UINT32 pmask, UINT32 transpen, UINT8 alpha); | |
| 285 | // specific pdrawgfxzoom implementations for each transparency type | |
| 286 | void pdrawgfxzoom_opaque(bitmap_ind16 &dest, const rectangle &cliprect, gfx_element *gfx, UINT32 code, UINT32 color, int flipx, int flipy, INT32 destx, INT32 desty, UINT32 scalex, UINT32 scaley, bitmap_ind8 &priority, UINT32 pmask); | |
| 287 | void pdrawgfxzoom_opaque(bitmap_rgb32 &dest, const rectangle &cliprect, gfx_element *gfx, UINT32 code, UINT32 color, int flipx, int flipy, INT32 destx, INT32 desty, UINT32 scalex, UINT32 scaley, bitmap_ind8 &priority, UINT32 pmask); | |
| 288 | void pdrawgfxzoom_transpen(bitmap_ind16 &dest, const rectangle &cliprect, gfx_element *gfx, UINT32 code, UINT32 color, int flipx, int flipy, INT32 destx, INT32 desty, UINT32 scalex, UINT32 scaley, bitmap_ind8 &priority, UINT32 pmask, UINT32 transpen); | |
| 289 | void pdrawgfxzoom_transpen(bitmap_rgb32 &dest, const rectangle &cliprect, gfx_element *gfx, UINT32 code, UINT32 color, int flipx, int flipy, INT32 destx, INT32 desty, UINT32 scalex, UINT32 scaley, bitmap_ind8 &priority, UINT32 pmask, UINT32 transpen); | |
| 290 | void pdrawgfxzoom_transpen_raw(bitmap_ind16 &dest, const rectangle &cliprect, gfx_element *gfx, UINT32 code, UINT32 color, int flipx, int flipy, INT32 destx, INT32 desty, UINT32 scalex, UINT32 scaley, bitmap_ind8 &priority, UINT32 pmask, UINT32 transpen); | |
| 291 | void pdrawgfxzoom_transpen_raw(bitmap_rgb32 &dest, const rectangle &cliprect, gfx_element *gfx, UINT32 code, UINT32 color, int flipx, int flipy, INT32 destx, INT32 desty, UINT32 scalex, UINT32 scaley, bitmap_ind8 &priority, UINT32 pmask, UINT32 transpen); | |
| 292 | void pdrawgfxzoom_transmask(bitmap_ind16 &dest, const rectangle &cliprect, gfx_element *gfx, UINT32 code, UINT32 color, int flipx, int flipy, INT32 destx, INT32 desty, UINT32 scalex, UINT32 scaley, bitmap_ind8 &priority, UINT32 pmask, UINT32 transmask); | |
| 293 | void pdrawgfxzoom_transmask(bitmap_rgb32 &dest, const rectangle &cliprect, gfx_element *gfx, UINT32 code, UINT32 color, int flipx, int flipy, INT32 destx, INT32 desty, UINT32 scalex, UINT32 scaley, bitmap_ind8 &priority, UINT32 pmask, UINT32 transmask); | |
| 294 | void pdrawgfxzoom_transtable(bitmap_ind16 &dest, const rectangle &cliprect, gfx_element *gfx, UINT32 code, UINT32 color, int flipx, int flipy, INT32 destx, INT32 desty, UINT32 scalex, UINT32 scaley, bitmap_ind8 &priority, UINT32 pmask, const UINT8 *pentable, const pen_t *shadowtable); | |
| 295 | void pdrawgfxzoom_transtable(bitmap_rgb32 &dest, const rectangle &cliprect, gfx_element *gfx, UINT32 code, UINT32 color, int flipx, int flipy, INT32 destx, INT32 desty, UINT32 scalex, UINT32 scaley, bitmap_ind8 &priority, UINT32 pmask, const UINT8 *pentable, const pen_t *shadowtable); | |
| 296 | void pdrawgfxzoom_alpha(bitmap_rgb32 &dest, const rectangle &cliprect, gfx_element *gfx, UINT32 code, UINT32 color, int flipx, int flipy, INT32 destx, INT32 desty, UINT32 scalex, UINT32 scaley, bitmap_ind8 &priority, UINT32 pmask, UINT32 transpen, UINT8 alpha); | |
| 242 | 297 | |
| 243 | 298 | |
| 244 | 299 | |
| 245 | / | |
| 300 | // ----- | |
| 246 | 301 | |
| 247 | /* specific pdrawgfxzoom implementations for each transparency type */ | |
| 248 | void pdrawgfxzoom_opaque(bitmap_ind16 &dest, const rectangle &cliprect, const gfx_element *gfx, UINT32 code, UINT32 color, int flipx, int flipy, INT32 destx, INT32 desty, UINT32 scalex, UINT32 scaley, bitmap_ind8 &priority, UINT32 pmask); | |
| 249 | void pdrawgfxzoom_opaque(bitmap_rgb32 &dest, const rectangle &cliprect, const gfx_element *gfx, UINT32 code, UINT32 color, int flipx, int flipy, INT32 destx, INT32 desty, UINT32 scalex, UINT32 scaley, bitmap_ind8 &priority, UINT32 pmask); | |
| 250 | void pdrawgfxzoom_transpen(bitmap_ind16 &dest, const rectangle &cliprect, const gfx_element *gfx, UINT32 code, UINT32 color, int flipx, int flipy, INT32 destx, INT32 desty, UINT32 scalex, UINT32 scaley, bitmap_ind8 &priority, UINT32 pmask, UINT32 transpen); | |
| 251 | void pdrawgfxzoom_transpen(bitmap_rgb32 &dest, const rectangle &cliprect, const gfx_element *gfx, UINT32 code, UINT32 color, int flipx, int flipy, INT32 destx, INT32 desty, UINT32 scalex, UINT32 scaley, bitmap_ind8 &priority, UINT32 pmask, UINT32 transpen); | |
| 252 | void pdrawgfxzoom_transpen_raw(bitmap_ind16 &dest, const rectangle &cliprect, const gfx_element *gfx, UINT32 code, UINT32 color, int flipx, int flipy, INT32 destx, INT32 desty, UINT32 scalex, UINT32 scaley, bitmap_ind8 &priority, UINT32 pmask, UINT32 transpen); | |
| 253 | void pdrawgfxzoom_transpen_raw(bitmap_rgb32 &dest, const rectangle &cliprect, const gfx_element *gfx, UINT32 code, UINT32 color, int flipx, int flipy, INT32 destx, INT32 desty, UINT32 scalex, UINT32 scaley, bitmap_ind8 &priority, UINT32 pmask, UINT32 transpen); | |
| 254 | void pdrawgfxzoom_transmask(bitmap_ind16 &dest, const rectangle &cliprect, const gfx_element *gfx, UINT32 code, UINT32 color, int flipx, int flipy, INT32 destx, INT32 desty, UINT32 scalex, UINT32 scaley, bitmap_ind8 &priority, UINT32 pmask, UINT32 transmask); | |
| 255 | void pdrawgfxzoom_transmask(bitmap_rgb32 &dest, const rectangle &cliprect, const gfx_element *gfx, UINT32 code, UINT32 color, int flipx, int flipy, INT32 destx, INT32 desty, UINT32 scalex, UINT32 scaley, bitmap_ind8 &priority, UINT32 pmask, UINT32 transmask); | |
| 256 | void pdrawgfxzoom_transtable(bitmap_ind16 &dest, const rectangle &cliprect, const gfx_element *gfx, UINT32 code, UINT32 color, int flipx, int flipy, INT32 destx, INT32 desty, UINT32 scalex, UINT32 scaley, bitmap_ind8 &priority, UINT32 pmask, const UINT8 *pentable, const pen_t *shadowtable); | |
| 257 | void pdrawgfxzoom_transtable(bitmap_rgb32 &dest, const rectangle &cliprect, const gfx_element *gfx, UINT32 code, UINT32 color, int flipx, int flipy, INT32 destx, INT32 desty, UINT32 scalex, UINT32 scaley, bitmap_ind8 &priority, UINT32 pmask, const UINT8 *pentable, const pen_t *shadowtable); | |
| 258 | void pdrawgfxzoom_alpha(bitmap_rgb32 &dest, const rectangle &cliprect, const gfx_element *gfx, UINT32 code, UINT32 color, int flipx, int flipy, INT32 destx, INT32 desty, UINT32 scalex, UINT32 scaley, bitmap_ind8 &priority, UINT32 pmask, UINT32 transpen, UINT8 alpha); | |
| 259 | ||
| 260 | ||
| 261 | ||
| 262 | /* ----- scanline copying ----- */ | |
| 263 | ||
| 264 | /* copy pixels from an 8bpp buffer to a single scanline of a bitmap */ | |
| 302 | // copy pixels from an 8bpp buffer to a single scanline of a bitmap | |
| 265 | 303 | void draw_scanline8(bitmap_ind16 &bitmap, INT32 destx, INT32 desty, INT32 length, const UINT8 *srcptr, const pen_t *paldata); |
| 266 | 304 | void draw_scanline8(bitmap_rgb32 &bitmap, INT32 destx, INT32 desty, INT32 length, const UINT8 *srcptr, const pen_t *paldata); |
| 267 | 305 | |
| 268 | / | |
| 306 | // copy pixels from a 16bpp buffer to a single scanline of a bitmap | |
| 269 | 307 | void draw_scanline16(bitmap_ind16 &bitmap, INT32 destx, INT32 desty, INT32 length, const UINT16 *srcptr, const pen_t *paldata); |
| 270 | 308 | void draw_scanline16(bitmap_rgb32 &bitmap, INT32 destx, INT32 desty, INT32 length, const UINT16 *srcptr, const pen_t *paldata); |
| 271 | 309 | |
| 272 | / | |
| 310 | // copy pixels from a 32bpp buffer to a single scanline of a bitmap | |
| 273 | 311 | void draw_scanline32(bitmap_ind16 &bitmap, INT32 destx, INT32 desty, INT32 length, const UINT32 *srcptr, const pen_t *paldata); |
| 274 | 312 | void draw_scanline32(bitmap_rgb32 &bitmap, INT32 destx, INT32 desty, INT32 length, const UINT32 *srcptr, const pen_t *paldata); |
| 275 | 313 | |
| 276 | 314 | |
| 277 | 315 | |
| 278 | / | |
| 316 | // ----- scanline extraction ----- | |
| 279 | 317 | |
| 280 | / | |
| 318 | // copy pixels from a single scanline of a bitmap to an 8bpp buffer | |
| 281 | 319 | void extract_scanline8(bitmap_ind16 &bitmap, INT32 srcx, INT32 srcy, INT32 length, UINT8 *destptr); |
| 282 | 320 | void extract_scanline8(bitmap_rgb32 &bitmap, INT32 srcx, INT32 srcy, INT32 length, UINT8 *destptr); |
| 283 | 321 | |
| 284 | / | |
| 322 | // copy pixels from a single scanline of a bitmap to a 16bpp buffer | |
| 285 | 323 | void extract_scanline16(bitmap_ind16 &bitmap, INT32 srcx, INT32 srcy, INT32 length, UINT16 *destptr); |
| 286 | 324 | void extract_scanline16(bitmap_rgb32 &bitmap, INT32 srcx, INT32 srcy, INT32 length, UINT16 *destptr); |
| 287 | 325 | |
| 288 | / | |
| 326 | // copy pixels from a single scanline of a bitmap to a 32bpp buffer | |
| 289 | 327 | void extract_scanline32(bitmap_ind16 &bitmap, INT32 srcx, INT32 srcy, INT32 length, UINT32 *destptr); |
| 290 | 328 | void extract_scanline32(bitmap_rgb32 &bitmap, INT32 srcx, INT32 srcy, INT32 length, UINT32 *destptr); |
| 291 | 329 | |
| 292 | 330 | |
| 293 | 331 | |
| 294 | / | |
| 332 | // ----- bitmap copying ----- | |
| 295 | 333 | |
| 296 | / | |
| 334 | // copy from one bitmap to another, copying all unclipped pixels | |
| 297 | 335 | void copybitmap(bitmap_ind16 &dest, bitmap_ind16 &src, int flipx, int flipy, INT32 destx, INT32 desty, const rectangle &cliprect); |
| 298 | 336 | void copybitmap(bitmap_rgb32 &dest, bitmap_rgb32 &src, int flipx, int flipy, INT32 destx, INT32 desty, const rectangle &cliprect); |
| 299 | 337 | |
| 300 | / | |
| 338 | // copy from one bitmap to another, copying all unclipped pixels except those that match transpen | |
| 301 | 339 | void copybitmap_trans(bitmap_ind16 &dest, bitmap_ind16 &src, int flipx, int flipy, INT32 destx, INT32 desty, const rectangle &cliprect, UINT32 transpen); |
| 302 | 340 | void copybitmap_trans(bitmap_rgb32 &dest, bitmap_rgb32 &src, int flipx, int flipy, INT32 destx, INT32 desty, const rectangle &cliprect, UINT32 transpen); |
| 303 | 341 | |
| r17669 | r17670 | |
| 313 | 351 | scrolls as a whole in at least one direction. |
| 314 | 352 | */ |
| 315 | 353 | |
| 316 | / | |
| 354 | // copy from one bitmap to another, copying all unclipped pixels, and applying scrolling to one or more rows/columns | |
| 317 | 355 | void copyscrollbitmap(bitmap_ind16 &dest, bitmap_ind16 &src, UINT32 numrows, const INT32 *rowscroll, UINT32 numcols, const INT32 *colscroll, const rectangle &cliprect); |
| 318 | 356 | void copyscrollbitmap(bitmap_rgb32 &dest, bitmap_rgb32 &src, UINT32 numrows, const INT32 *rowscroll, UINT32 numcols, const INT32 *colscroll, const rectangle &cliprect); |
| 319 | 357 | |
| 320 | / | |
| 358 | // copy from one bitmap to another, copying all unclipped pixels except those that match transpen, and applying scrolling to one or more rows/columns | |
| 321 | 359 | void copyscrollbitmap_trans(bitmap_ind16 &dest, bitmap_ind16 &src, UINT32 numrows, const INT32 *rowscroll, UINT32 numcols, const INT32 *colscroll, const rectangle &cliprect, UINT32 transpen); |
| 322 | 360 | void copyscrollbitmap_trans(bitmap_rgb32 &dest, bitmap_rgb32 &src, UINT32 numrows, const INT32 *rowscroll, UINT32 numcols, const INT32 *colscroll, const rectangle &cliprect, UINT32 transpen); |
| 323 | 361 | |
| r17669 | r17670 | |
| 350 | 388 | copy. This is obtained by setting the wraparound parameter to true. |
| 351 | 389 | */ |
| 352 | 390 | |
| 353 | / | |
| 391 | // copy from one bitmap to another, with zoom and rotation, copying all unclipped pixels | |
| 354 | 392 | void copyrozbitmap(bitmap_ind16 &dest, const rectangle &cliprect, bitmap_ind16 &src, INT32 startx, INT32 starty, INT32 incxx, INT32 incxy, INT32 incyx, INT32 incyy, int wraparound); |
| 355 | 393 | void copyrozbitmap(bitmap_rgb32 &dest, const rectangle &cliprect, bitmap_rgb32 &src, INT32 startx, INT32 starty, INT32 incxx, INT32 incxy, INT32 incyx, INT32 incyy, int wraparound); |
| 356 | 394 | |
| 357 | / | |
| 395 | // copy from one bitmap to another, with zoom and rotation, copying all unclipped pixels whose values do not match transpen | |
| 358 | 396 | void copyrozbitmap_trans(bitmap_ind16 &dest, const rectangle &cliprect, bitmap_ind16 &src, INT32 startx, INT32 starty, INT32 incxx, INT32 incxy, INT32 incyx, INT32 incyy, int wraparound, UINT32 transparent_color); |
| 359 | 397 | void copyrozbitmap_trans(bitmap_rgb32 &dest, const rectangle &cliprect, bitmap_rgb32 &src, INT32 startx, INT32 starty, INT32 incxx, INT32 incxy, INT32 incyx, INT32 incyy, int wraparound, UINT32 transparent_color); |
| 360 | 398 | |
| r17669 | r17670 | |
| 364 | 402 | INLINE FUNCTIONS |
| 365 | 403 | ***************************************************************************/ |
| 366 | 404 | |
| 367 | /*------------------------------------------------- | |
| 368 | gfx_element_set_source - set a pointer to | |
| 369 | the source of a gfx_element | |
| 370 | -------------------------------------------------*/ | |
| 405 | //------------------------------------------------- | |
| 406 | // alpha_blend_r16 - alpha blend two 16-bit | |
| 407 | // 5-5-5 RGB pixels | |
| 408 | //------------------------------------------------- | |
| 371 | 409 | |
| 372 | IN | |
| 410 | inline UINT32 | |
| 373 | 411 | { |
| 374 | gfx->srcdata = source; | |
| 375 | memset(gfx->dirty, 1, gfx->total_elements); | |
| 376 | } | |
| 377 | ||
| 378 | ||
| 379 | /*------------------------------------------------- | |
| 380 | gfx_element_get_data - return a pointer to | |
| 381 | the base of the given code within a | |
| 382 | gfx_element, decoding it if it is dirty | |
| 383 | -------------------------------------------------*/ | |
| 384 | ||
| 385 | INLINE const UINT8 *gfx_element_get_data(const gfx_element *gfx, UINT32 code) | |
| 386 | { | |
| 387 | assert(code < gfx->total_elements); | |
| 388 | if (gfx->dirty[code]) | |
| 389 | gfx_element_decode(gfx, code); | |
| 390 | return gfx->gfxdata + code * gfx->char_modulo + gfx->starty * gfx->line_modulo + gfx->startx; | |
| 391 | } | |
| 392 | ||
| 393 | ||
| 394 | /*------------------------------------------------- | |
| 395 | gfx_element_mark_dirty - mark a code of a | |
| 396 | gfx_element dirty | |
| 397 | -------------------------------------------------*/ | |
| 398 | ||
| 399 | INLINE void gfx_element_mark_dirty(gfx_element *gfx, UINT32 code) | |
| 400 | { | |
| 401 | if (code < gfx->total_elements) | |
| 402 | { | |
| 403 | gfx->dirty[code] = 1; | |
| 404 | gfx->dirtyseq++; | |
| 405 | } | |
| 406 | } | |
| 407 | ||
| 408 | ||
| 409 | /*------------------------------------------------- | |
| 410 | gfx_element_set_source_clip - set a source | |
| 411 | clipping area to apply to subsequent renders | |
| 412 | -------------------------------------------------*/ | |
| 413 | ||
| 414 | INLINE void gfx_element_set_source_clip(gfx_element *gfx, UINT32 xoffs, UINT32 width, UINT32 yoffs, UINT32 height) | |
| 415 | { | |
| 416 | assert(xoffs < gfx->origwidth); | |
| 417 | assert(yoffs < gfx->origheight); | |
| 418 | assert(xoffs + width <= gfx->origwidth); | |
| 419 | assert(yoffs + height <= gfx->origheight); | |
| 420 | ||
| 421 | gfx->width = width; | |
| 422 | gfx->height = height; | |
| 423 | gfx->startx = xoffs; | |
| 424 | gfx->starty = yoffs; | |
| 425 | } | |
| 426 | ||
| 427 | ||
| 428 | /*------------------------------------------------- | |
| 429 | alpha_blend_r16 - alpha blend two 16-bit | |
| 430 | 5-5-5 RGB pixels | |
| 431 | -------------------------------------------------*/ | |
| 432 | ||
| 433 | INLINE UINT32 alpha_blend_r16(UINT32 d, UINT32 s, UINT8 level) | |
| 434 | { | |
| 435 | 412 | int alphad = 256 - level; |
| 436 | 413 | return ((((s & 0x001f) * level + (d & 0x001f) * alphad) >> 8)) | |
| 437 | 414 | ((((s & 0x03e0) * level + (d & 0x03e0) * alphad) >> 8) & 0x03e0) | |
| r17669 | r17670 | |
| 439 | 416 | } |
| 440 | 417 | |
| 441 | 418 | |
| 442 | /*------------------------------------------------- | |
| 443 | alpha_blend_r32 - alpha blend two 32-bit | |
| 444 | 8-8-8 RGB pixels | |
| 445 | -------------------------------------------------*/ | |
| 419 | //------------------------------------------------- | |
| 420 | // alpha_blend_r16 - alpha blend two 32-bit | |
| 421 | // 8-8-8 RGB pixels | |
| 422 | //------------------------------------------------- | |
| 446 | 423 | |
| 447 | ||
| 424 | inline UINT32 alpha_blend_r32(UINT32 d, UINT32 s, UINT8 level) | |
| 448 | 425 | { |
| 449 | 426 | int alphad = 256 - level; |
| 450 | 427 | return ((((s & 0x0000ff) * level + (d & 0x0000ff) * alphad) >> 8)) | |
| r17669 | r17670 | |
| 453 | 430 | } |
| 454 | 431 | |
| 455 | 432 | |
| 456 | #endif / | |
| 433 | #endif // __DRAWGFX_H__ |
| r17669 | r17670 | |
|---|---|---|
| 338 | 338 | |
| 339 | 339 | bitmap_t &dest - the bitmap to render to |
| 340 | 340 | const rectangle &cliprect - a clipping rectangle (assumed to be clipped to the size of 'dest') |
| 341 | | |
| 341 | | |
| 342 | 342 | UINT32 code - index of the entry within gfx_element |
| 343 | 343 | UINT32 color - index of the color within gfx_element |
| 344 | 344 | int flipx - non-zero means render right-to-left instead of left-to-right |
| r17669 | r17670 | |
| 363 | 363 | assert(gfx != NULL); \ |
| 364 | 364 | assert(!PRIORITY_VALID(PRIORITY_TYPE) || priority.valid()); \ |
| 365 | 365 | assert(dest.cliprect().contains(cliprect)); \ |
| 366 | assert(code < gfx-> | |
| 366 | assert(code < gfx-> | |
| 367 | 367 | \ |
| 368 | 368 | /* ignore empty/invalid cliprects */ \ |
| 369 | 369 | if (cliprect.empty()) \ |
| 370 | 370 | break; \ |
| 371 | 371 | \ |
| 372 | 372 | /* compute final pixel in X and exit if we are entirely clipped */ \ |
| 373 | destendx = destx + gfx->width - 1; \ | |
| 373 | destendx = destx + gfx->width() - 1; \ | |
| 374 | 374 | if (destx > cliprect.max_x || destendx < cliprect.min_x) \ |
| 375 | 375 | break; \ |
| 376 | 376 | \ |
| r17669 | r17670 | |
| 387 | 387 | destendx = cliprect.max_x; \ |
| 388 | 388 | \ |
| 389 | 389 | /* compute final pixel in Y and exit if we are entirely clipped */ \ |
| 390 | destendy = desty + gfx->height - 1; \ | |
| 390 | destendy = desty + gfx->height() - 1; \ | |
| 391 | 391 | if (desty > cliprect.max_y || destendy < cliprect.min_y) \ |
| 392 | 392 | break; \ |
| 393 | 393 | \ |
| r17669 | r17670 | |
| 405 | 405 | \ |
| 406 | 406 | /* apply X flipping */ \ |
| 407 | 407 | if (flipx) \ |
| 408 | srcx = gfx->width - 1 - srcx; \ | |
| 408 | srcx = gfx->width() - 1 - srcx; \ | |
| 409 | 409 | \ |
| 410 | 410 | /* apply Y flipping */ \ |
| 411 | dy = gfx-> | |
| 411 | dy = gfx->r | |
| 412 | 412 | if (flipy) \ |
| 413 | 413 | { \ |
| 414 | srcy = gfx->height - 1 - srcy; \ | |
| 414 | srcy = gfx->height() - 1 - srcy; \ | |
| 415 | 415 | dy = -dy; \ |
| 416 | 416 | } \ |
| 417 | 417 | \ |
| 418 | 418 | /* fetch the source data */ \ |
| 419 | srcdata = gfx | |
| 419 | srcdata = gfx-> | |
| 420 | 420 | \ |
| 421 | 421 | /* compute how many blocks of 4 pixels we have */ \ |
| 422 | 422 | UINT32 numblocks = (destendx + 1 - destx) / 4; \ |
| 423 | 423 | UINT32 leftovers = (destendx + 1 - destx) - 4 * numblocks; \ |
| 424 | 424 | \ |
| 425 | 425 | /* adjust srcdata to point to the first source pixel of the row */ \ |
| 426 | srcdata += srcy * gfx-> | |
| 426 | srcdata += srcy * gfx->r | |
| 427 | 427 | \ |
| 428 | 428 | /* non-flipped 8bpp case */ \ |
| 429 | 429 | if (!flipx) \ |
| r17669 | r17670 | |
| 509 | 509 | |
| 510 | 510 | bitmap_t &dest - the bitmap to render to |
| 511 | 511 | const rectangle &cliprect - a clipping rectangle (assumed to be clipped to the size of 'dest') |
| 512 | | |
| 512 | | |
| 513 | 513 | UINT32 code - index of the entry within gfx_element |
| 514 | 514 | UINT32 color - index of the color within gfx_element |
| 515 | 515 | int flipx - non-zero means render right-to-left instead of left-to-right |
| r17669 | r17670 | |
| 543 | 543 | break; \ |
| 544 | 544 | \ |
| 545 | 545 | /* compute scaled size */ \ |
| 546 | dstwidth = (scalex * gfx->width + 0x8000) >> 16; \ | |
| 547 | dstheight = (scaley * gfx->height + 0x8000) >> 16; \ | |
| 546 | dstwidth = (scalex * gfx->width() + 0x8000) >> 16; \ | |
| 547 | dstheight = (scaley * gfx->height() + 0x8000) >> 16; \ | |
| 548 | 548 | if (dstwidth < 1 || dstheight < 1) \ |
| 549 | 549 | break; \ |
| 550 | 550 | \ |
| 551 | 551 | /* compute 16.16 source steps in dx and dy */ \ |
| 552 | dx = (gfx->width << 16) / dstwidth; \ | |
| 553 | dy = (gfx->height << 16) / dstheight; \ | |
| 552 | dx = (gfx->width() << 16) / dstwidth; \ | |
| 553 | dy = (gfx->height() << 16) / dstheight; \ | |
| 554 | 554 | \ |
| 555 | 555 | /* compute final pixel in X and exit if we are entirely clipped */ \ |
| 556 | 556 | destendx = destx + dstwidth - 1; \ |
| r17669 | r17670 | |
| 604 | 604 | } \ |
| 605 | 605 | \ |
| 606 | 606 | /* fetch the source data */ \ |
| 607 | srcdata = gfx | |
| 607 | srcdata = gfx-> | |
| 608 | 608 | \ |
| 609 | 609 | /* compute how many blocks of 4 pixels we have */ \ |
| 610 | 610 | UINT32 numblocks = (destendx + 1 - destx) / 4; \ |
| r17669 | r17670 | |
| 615 | 615 | { \ |
| 616 | 616 | PRIORITY_TYPE *priptr = PRIORITY_ADDR(priority, PRIORITY_TYPE, cury, destx); \ |
| 617 | 617 | PIXEL_TYPE *destptr = &dest.pixt<PIXEL_TYPE>(cury, destx); \ |
| 618 | const UINT8 *srcptr = srcdata + (srcy >> 16) * gfx-> | |
| 618 | const UINT8 *srcptr = srcdata + (srcy >> 16) * gfx->r | |
| 619 | 619 | INT32 cursrcx = srcx; \ |
| 620 | 620 | srcy += dy; \ |
| 621 | 621 | \ |
| r17669 | r17670 | |
|---|---|---|
| 576 | 576 | state->m_fontram[offset] = data; |
| 577 | 577 | |
| 578 | 578 | /* convert eight pixels */ |
| 579 | dp = | |
| 579 | dp = const_cast<UINT8 *>(space->machine().gfx[0]->get_data | |
| 580 | 580 | dp[0] = (data & 0x80) ? 1 : 0; |
| 581 | 581 | dp[1] = (data & 0x40) ? 1 : 0; |
| 582 | 582 | dp[2] = (data & 0x20) ? 1 : 0; |
| r17669 | r17670 | |
|---|---|---|
| 505 | 505 | void vdt911_refresh(device_t *device, bitmap_ind16 &bitmap, const rectangle &cliprect, int x, int y) |
| 506 | 506 | { |
| 507 | 507 | vdt_t *vdt = get_safe_token(device); |
| 508 | | |
| 508 | | |
| 509 | 509 | int height = (vdt->screen_size == char_960) ? 12 : /*25*/24; |
| 510 | 510 | int use_8bit_charcodes = USES_8BIT_CHARCODES(vdt); |
| 511 | 511 | int address = 0; |
| r17669 | r17670 | |
|---|---|---|
| 48 | 48 | // if( i < 176 || i > 223 ) |
| 49 | 49 | { |
| 50 | 50 | int y; |
| 51 | for( y = 0; y < machine.gfx[0]->height; y++ ) { | |
| 52 | machine.gfx[0]->gfxdata[(i * machine.gfx[0]->height + y) * machine.gfx[0]->width + 8] = 0; | |
| 53 | machine.gfx[1]->gfxdata[(i * machine.gfx[1]->height + y) * machine.gfx[1]->width + 8] = 0; | |
| 51 | for( y = 0; y < machine.gfx[0]->height(); y++ ) { | |
| 52 | *const_cast<UINT8 *>(machine.gfx[0]->get_data(i) + y * machine.gfx[0]->rowbytes() + 8) = 0; | |
| 53 | *const_cast<UINT8 *>(machine.gfx[1]->get_data(i) + y * machine.gfx[1]->rowbytes() + 8) = 0; | |
| 54 | 54 | } |
| 55 | 55 | } |
| 56 | 56 | } |
| r17669 | r17670 | |
| 71 | 71 | |
| 72 | 72 | for( i = 0; i < x_count; i++ ) { |
| 73 | 73 | if ( i == cursor_x ) { |
| 74 | bitmap.plot_box( device->machine().gfx[state->m_font]->width * i, y, device->machine().gfx[state->m_font]->width, 1, palette[1] ); | |
| 74 | bitmap.plot_box( device->machine().gfx[state->m_font]->width() * i, y, device->machine().gfx[state->m_font]->width(), 1, palette[1] ); | |
| 75 | 75 | } else { |
| 76 | drawgfx_opaque( bitmap, cliprect, device->machine().gfx[state->m_font], videoram[(ma+i )& 0x7ff], 0, 0, 0, device->machine().gfx[state->m_font]->width * i, y-ra ); | |
| 76 | drawgfx_opaque( bitmap, cliprect, device->machine().gfx[state->m_font], videoram[(ma+i )& 0x7ff], 0, 0, 0, device->machine().gfx[state->m_font]->width() * i, y-ra ); | |
| 77 | 77 | } |
| 78 | 78 | } |
| 79 | 79 | } |
| r17669 | r17670 | |
| 87 | 87 | |
| 88 | 88 | for( i = 0; i < x_count; i++ ) { |
| 89 | 89 | if ( i == cursor_x ) { |
| 90 | bitmap.plot_box( device->machine().gfx[state->m_font]->width * i, y, device->machine().gfx[state->m_font]->width, 1, palette[1] ); | |
| 90 | bitmap.plot_box( device->machine().gfx[state->m_font]->width() * i, y, device->machine().gfx[state->m_font]->width(), 1, palette[1] ); | |
| 91 | 91 | } else { |
| 92 | drawgfx_opaque( bitmap, cliprect, device->machine().gfx[state->m_font], videoram[(ma+i) & 0x7ff], 0, 0, 0, device->machine().gfx[state->m_font]->width * i, y-ra ); | |
| 92 | drawgfx_opaque( bitmap, cliprect, device->machine().gfx[state->m_font], videoram[(ma+i) & 0x7ff], 0, 0, 0, device->machine().gfx[state->m_font]->width() * i, y-ra ); | |
| 93 | 93 | } |
| 94 | 94 | } |
| 95 | 95 | } |
| r17669 | r17670 | |
|---|---|---|
| 63 | 63 | m_videoram = (UINT8*)memregion("videoram")->base(); |
| 64 | 64 | m_chargen = (UINT8*)memregion("chargen")->base(); |
| 65 | 65 | |
| 66 | machine().gfx[0] = gfx_element | |
| 66 | machine().gfx[0] = auto_alloc(machine(), gfx_element | |
| 67 | 67 | } |
| 68 | 68 | |
| 69 | 69 | //------------------------------------------------- |
| r17669 | r17670 | |
|---|---|---|
| 79 | 79 | VIDEO_START( mz800 ) |
| 80 | 80 | { |
| 81 | 81 | mz_state *mz = machine.driver_data<mz_state>(); |
| 82 | | |
| 82 | | |
| 83 | 83 | } |
| 84 | 84 | |
| 85 | 85 | SCREEN_UPDATE_IND16( mz800 ) |
| r17669 | r17670 | |
| 131 | 131 | { |
| 132 | 132 | m_cgram[offset] = data; |
| 133 | 133 | |
| 134 | | |
| 134 | | |
| 135 | 135 | } |
| r17669 | r17670 | |
|---|---|---|
| 1144 | 1144 | break; |
| 1145 | 1145 | |
| 1146 | 1146 | /* create the char set (gfx will then be updated dynamically from RAM) */ |
| 1147 | machine.gfx[gfx_index] = gfx_element | |
| 1147 | machine.gfx[gfx_index] = auto_alloc(machine, gfx_element | |
| 1148 | 1148 | |
| 1149 | 1149 | gfx_index++; |
| 1150 | 1150 | |
| 1151 | machine.gfx[gfx_index] = gfx_element_alloc(machine, &x68k_pcg_16, state->memregion("user1")->base(), 32, 0); | |
| 1152 | machine.gfx[gfx_index]->total_colors = 32; | |
| 1151 | machine.gfx[gfx_index] = auto_alloc(machine, gfx_element(machine, x68k_pcg_16, state->memregion("user1")->base(), 32, 0)); | |
| 1152 | machine.gfx[gfx_index]->set_colors(32); | |
| 1153 | 1153 | |
| 1154 | 1154 | /* Tilemaps */ |
| 1155 | 1155 | state->m_bg0_8 = tilemap_create(machine, x68k_get_bg0_tile,TILEMAP_SCAN_ROWS,8,8,64,64); |
| r17669 | r17670 | |
| 1211 | 1211 | { |
| 1212 | 1212 | if(state->m_video.tile16_dirty[x] != 0) |
| 1213 | 1213 | { |
| 1214 | | |
| 1214 | | |
| 1215 | 1215 | state->m_video.tile16_dirty[x] = 0; |
| 1216 | 1216 | } |
| 1217 | 1217 | if(state->m_video.tile8_dirty[x] != 0) |
| 1218 | 1218 | { |
| 1219 | | |
| 1219 | | |
| 1220 | 1220 | state->m_video.tile8_dirty[x] = 0; |
| 1221 | 1221 | } |
| 1222 | 1222 | } |
| r17669 | r17670 | |
|---|---|---|
| 187 | 187 | terminal_t *term; |
| 188 | 188 | int char_width, char_height; |
| 189 | 189 | |
| 190 | char_width = machine.gfx[gfx]->width; | |
| 191 | char_height = machine.gfx[gfx]->height; | |
| 190 | char_width = machine.gfx[gfx]->width(); | |
| 191 | char_height = machine.gfx[gfx]->height(); | |
| 192 | 192 | |
| 193 | 193 | term = (terminal_t *) auto_alloc_array(machine, char, sizeof(terminal_t) - sizeof(term->mem) |
| 194 | 194 | + (num_cols * num_rows * sizeof(termchar_t))); |
| r17669 | r17670 | |
|---|---|---|
| 63 | 63 | m_videoram = (UINT8*)memregion("videoram")->base(); |
| 64 | 64 | m_chargen = (UINT8*)memregion("chargen")->base(); |
| 65 | 65 | |
| 66 | machine().gfx[0] = gfx_element | |
| 66 | machine().gfx[0] = auto_alloc(machine(), gfx_element | |
| 67 | 67 | } |
| 68 | 68 | |
| 69 | 69 | //------------------------------------------------- |
| r17669 | r17670 | |
|---|---|---|
| 416 | 416 | if (vdc8563->dirty[i]) |
| 417 | 417 | { |
| 418 | 418 | drawgfx_opaque(bitmap,rect,machine.gfx[0], vdc8563->ram[i], FRAMECOLOR | (MONOCOLOR << 4), 0, 0, |
| 419 | machine.gfx[0]->width * x + 8, height * y + height); | |
| 419 | machine.gfx[0]->width() * x + 8, height * y + height); | |
| 420 | 420 | |
| 421 | 421 | if ((vdc8563->cursor_on) && (i == (CRTC6845_CURSOR_POS & vdc8563->mask))) |
| 422 | 422 | { |
| r17669 | r17670 | |
| 425 | 425 | k = CRTC6845_CURSOR_BOTTOM - CRTC6845_CURSOR_TOP + 1; |
| 426 | 426 | |
| 427 | 427 | if (k > 0) |
| 428 | bitmap.plot_box(machine.gfx[0]->width * x + 8, height * y + height + CRTC6845_CURSOR_TOP, machine.gfx[0]->width, k, FRAMECOLOR); | |
| 428 | bitmap.plot_box(machine.gfx[0]->width() * x + 8, height * y + height + CRTC6845_CURSOR_TOP, machine.gfx[0]->width(), k, FRAMECOLOR); | |
| 429 | 429 | } |
| 430 | 430 | |
| 431 | 431 | vdc8563->dirty[i] = 0; |
| r17669 | r17670 | |
| 485 | 485 | k = CRTC6845_CURSOR_BOTTOM - CRTC6845_CURSOR_TOP + 1; |
| 486 | 486 | |
| 487 | 487 | if (k > 0) |
| 488 | bitmap.plot_box(machine.gfx[0]->width * x + 8, height * y + height + CRTC6845_CURSOR_TOP, machine.gfx[0]->width, | |
| 488 | bitmap.plot_box(machine.gfx[0]->width() * x + 8, height * y + height + CRTC6845_CURSOR_TOP, machine.gfx[0]->width(), | |
| 489 | 489 | k, 0x10 | (vdc8563->ram[j] & 0x0f)); |
| 490 | 490 | } |
| 491 | 491 | |
| r17669 | r17670 | |
| 524 | 524 | if (vdc8563->dirty[k]) |
| 525 | 525 | { |
| 526 | 526 | drawgfx_opaque(bitmap, rect, machine.gfx[1], vdc8563->ram[k], FRAMECOLOR | (MONOCOLOR << 4), 0, 0, |
| 527 | machine.gfx[0]->width * x + 8, height * y + height + j); | |
| 527 | machine.gfx[0]->width() * x + 8, height * y + height + j); | |
| 528 | 528 | vdc8563->dirty[k] = 0; |
| 529 | 529 | } |
| 530 | 530 | } |
| r17669 | r17670 | |
| 556 | 556 | { |
| 557 | 557 | if (full_refresh || vdc8563->fontdirty[i]) |
| 558 | 558 | { |
| 559 | | |
| 559 | | |
| 560 | 560 | vdc8563->fontdirty[i] = 0; |
| 561 | 561 | } |
| 562 | 562 | } |
| r17669 | r17670 | |
| 572 | 572 | int h = CRTC6845_CHAR_LINES; |
| 573 | 573 | int height = CRTC6845_CHAR_HEIGHT; |
| 574 | 574 | |
| 575 | bitmap.plot_box(0, 0, device->machine().gfx[0]->width * (w + 2), height, FRAMECOLOR); | |
| 575 | bitmap.plot_box(0, 0, device->machine().gfx[0]->width() * (w + 2), height, FRAMECOLOR); | |
| 576 | 576 | |
| 577 | bitmap.plot_box(0, height, device->machine().gfx[0]->width, height * h, FRAMECOLOR); | |
| 577 | bitmap.plot_box(0, height, device->machine().gfx[0]->width(), height * h, FRAMECOLOR); | |
| 578 | 578 | |
| 579 | bitmap.plot_box(device->machine().gfx[0]->width * (w + 1), height, device->machine().gfx[0]->width, height * h, FRAMECOLOR); | |
| 579 | bitmap.plot_box(device->machine().gfx[0]->width() * (w + 1), height, device->machine().gfx[0]->width(), height * h, FRAMECOLOR); | |
| 580 | 580 | |
| 581 | bitmap.plot_box(0, height * (h + 1), device->machine().gfx[0]->width * (w + 2), height, FRAMECOLOR); | |
| 581 | bitmap.plot_box(0, height * (h + 1), device->machine().gfx[0]->width() * (w + 2), height, FRAMECOLOR); | |
| 582 | 582 | } |
| 583 | 583 | |
| 584 | 584 | vdc8563->changed = 0; |
| r17669 | r17670 | |
|---|---|---|
| 540 | 540 | if(knj_offset >= 0x50000/2 && knj_offset <= 0x53fff/2) // TODO: there's an area that can be write protected |
| 541 | 541 | { |
| 542 | 542 | COMBINE_DATA(&knj_ram[knj_offset]); |
| 543 | gfx_element_mark_dirty(machine().gfx[0], (knj_offset * 2) / 8); | |
| 544 | gfx_element_mark_dirty(machine().gfx[1], (knj_offset * 2) / 32); | |
| 543 | machine().gfx[0]->mark_dirty((knj_offset * 2) / 8); | |
| 544 | machine().gfx[1]->mark_dirty((knj_offset * 2) / 32); | |
| 545 | 545 | } |
| 546 | 546 | } |
| 547 | 547 | break; |
| r17669 | r17670 | |
|---|---|---|
| 1171 | 1171 | |
| 1172 | 1172 | pcg_offset &= 0x7ff; |
| 1173 | 1173 | |
| 1174 | | |
| 1174 | | |
| 1175 | 1175 | } |
| 1176 | 1176 | else // Compatible Mode |
| 1177 | 1177 | { |
| r17669 | r17670 | |
| 1188 | 1188 | |
| 1189 | 1189 | pcg_offset &= 0x7ff; |
| 1190 | 1190 | |
| 1191 | | |
| 1191 | | |
| 1192 | 1192 | } |
| 1193 | 1193 | } |
| 1194 | 1194 | } |
| r17669 | r17670 | |
| 2476 | 2476 | for(i=0;i<0x1800;i++) |
| 2477 | 2477 | { |
| 2478 | 2478 | PCG_RAM[i] = 0; |
| 2479 | | |
| 2479 | | |
| 2480 | 2480 | } |
| 2481 | 2481 | |
| 2482 | 2482 | state->m_is_turbo = 0; |
| r17669 | r17670 | |
|---|---|---|
| 312 | 312 | |
| 313 | 313 | pcg[vram_index] = data; |
| 314 | 314 | |
| 315 | | |
| 315 | | |
| 316 | 316 | } |
| 317 | 317 | |
| 318 | 318 | READ8_MEMBER(smc777_state::smc777_fbuf_r) |
| r17669 | r17670 | |
|---|---|---|
| 901 | 901 | UINT8 *pcg_ram = memregion("pcg")->base(); |
| 902 | 902 | pcg_ram[offset] = data; |
| 903 | 903 | if((offset & 0x1800) == 0x0000) |
| 904 | | |
| 904 | | |
| 905 | 905 | else |
| 906 | | |
| 906 | | |
| 907 | 907 | } |
| 908 | 908 | break; |
| 909 | 909 | } |
| r17669 | r17670 | |
|---|---|---|
| 982 | 982 | if(mem_mask & 0xff00) |
| 983 | 983 | pcg_ram[(offset<<1)+0] = (data & 0xff00) >> 8; |
| 984 | 984 | |
| 985 | | |
| 985 | | |
| 986 | 986 | for(i=0;i<0x800;i++) |
| 987 | | |
| 987 | | |
| 988 | 988 | |
| 989 | 989 | } |
| 990 | 990 |
| r17669 | r17670 | |
|---|---|---|
| 147 | 147 | { |
| 148 | 148 | |
| 149 | 149 | m_char_rom[offset] = data; |
| 150 | | |
| 150 | | |
| 151 | 151 | } |
| 152 | 152 | |
| 153 | 153 | WRITE8_MEMBER(fp6000_state::fp6000_6845_address_w) |
| r17669 | r17670 | |
|---|---|---|
| 117 | 117 | UINT8 *gfxram = memregion( "gfxram" )->base(); |
| 118 | 118 | |
| 119 | 119 | gfxram[ offset ] = data; |
| 120 | | |
| 120 | | |
| 121 | 121 | } |
| 122 | 122 | |
| 123 | 123 |
| r17669 | r17670 | |
|---|---|---|
| 144 | 144 | { |
| 145 | 145 | m_char_rom[m_pcg_addr | m_pcg_internal_addr] = data; |
| 146 | 146 | |
| 147 | | |
| 147 | | |
| 148 | 148 | |
| 149 | 149 | m_pcg_internal_addr++; |
| 150 | 150 | m_pcg_internal_addr&=7; |
| r17669 | r17670 | |
|---|---|---|
| 170 | 170 | WRITE8_MEMBER( paso1600_state::paso1600_pcg_w ) |
| 171 | 171 | { |
| 172 | 172 | m_p_pcg[offset] = data; |
| 173 | | |
| 173 | | |
| 174 | 174 | } |
| 175 | 175 | |
| 176 | 176 | WRITE8_MEMBER( paso1600_state::paso1600_6845_address_w ) |
| r17669 | r17670 | |
|---|---|---|
| 187 | 187 | UINT8 *pcg = memregion("pcg")->base(); |
| 188 | 188 | |
| 189 | 189 | pcg[offset+0x000] = data; |
| 190 | | |
| 190 | | |
| 191 | 191 | } |
| 192 | 192 | |
| 193 | 193 | WRITE8_MEMBER(jr200_state::jr200_pcg_2_w) |
| r17669 | r17670 | |
| 195 | 195 | UINT8 *pcg = memregion("pcg")->base(); |
| 196 | 196 | |
| 197 | 197 | pcg[offset+0x400] = data; |
| 198 | | |
| 198 | | |
| 199 | 199 | } |
| 200 | 200 | |
| 201 | 201 | READ8_MEMBER(jr200_state::jr200_bios_char_r) |
| r17669 | r17670 | |
| 212 | 212 | |
| 213 | 213 | /* TODO: writing is presumably controlled by an I/O bit */ |
| 214 | 214 | // gfx[offset] = data; |
| 215 | // | |
| 215 | // | |
| 216 | 216 | } |
| 217 | 217 | |
| 218 | 218 | /* |
| r17669 | r17670 | |
| 496 | 496 | gfx_ram[i] = gfx_rom[i]; |
| 497 | 497 | |
| 498 | 498 | for(i=0;i<0x800;i+=8) |
| 499 | | |
| 499 | | |
| 500 | 500 | } |
| 501 | 501 | |
| 502 | 502 |
| r17669 | r17670 | |
|---|---|---|
| 504 | 504 | int sprite_xflip = (supracan_vram[i+1] & 0x0800) >> 11; |
| 505 | 505 | int sprite_yflip = (supracan_vram[i+1] & 0x0400) >> 10; |
| 506 | 506 | //int xscale = (supracan_vram[i+2] & 0xf000) >> 12; |
| 507 | | |
| 507 | | |
| 508 | 508 | |
| 509 | 509 | |
| 510 | 510 | |
| r17669 | r17670 | |
| 1096 | 1096 | write_swapped_byte(offset*2, (data & 0x00ff)); |
| 1097 | 1097 | |
| 1098 | 1098 | // mark tiles of each depth as dirty |
| 1099 | gfx_element_mark_dirty(machine().gfx[0], (offset*2)/(64)); | |
| 1100 | gfx_element_mark_dirty(machine().gfx[1], (offset*2)/(32)); | |
| 1101 | gfx_element_mark_dirty(machine().gfx[2], (offset*2)/(16)); | |
| 1102 | gfx_element_mark_dirty(machine().gfx[3], (offset*2)/(512)); | |
| 1103 | gfx_element_mark_dirty(machine().gfx[4], (offset*2)/(8)); | |
| 1099 | machine().gfx[0]->mark_dirty((offset*2)/(64)); | |
| 1100 | machine().gfx[1]->mark_dirty((offset*2)/(32)); | |
| 1101 | machine().gfx[2]->mark_dirty((offset*2)/(16)); | |
| 1102 | machine().gfx[3]->mark_dirty((offset*2)/(512)); | |
| 1103 | machine().gfx[4]->mark_dirty((offset*2)/(8)); | |
| 1104 | 1104 | |
| 1105 | 1105 | } |
| 1106 | 1106 |
| r17669 | r17670 | |
|---|---|---|
| 105 | 105 | { |
| 106 | 106 | m_char_rom[offset] = data; |
| 107 | 107 | |
| 108 | | |
| 108 | | |
| 109 | 109 | } |
| 110 | 110 | |
| 111 | 111 | static ADDRESS_MAP_START( b16_map, AS_PROGRAM, 16, b16_state) |
| Previous | 199869 Revisions | Next |