Previous 15994 Revisions Next

r13799 Saturday 31st December, 2011 at 21:54:29 UTC by Aaron Giles
MESS version of MAME r14882 (includes the MAME changes files as well):

Bulk converted cliprect * to cliprect & across the system. This makes
cliprects mandatory everywhere. In general, cliprects were being
correctly passed through the video side of most drivers already, so
it is mostly a semantic change. Note that with my previous change,
bitmaps have cliprects, so if you just want to clip to the bitmap's
boundaries, pass bitmap->cliprect() instead of NULL (which is no
longer permitted). [Aaron Giles]

Note that in MESS there were a number of drivers ignoring the
cliprect passed to SCREEN_UPDATE. This is now rectified.
[src/emu]drawgfx.c drawgfx.h drawgfxm.h screen.c screen.h tilemap.c tilemap.h
[src/emu/cpu/tms34010]tms34010.c
[src/emu/machine]ldcore.c s3c24xx.c
[src/emu/sound]cdp1864.c cdp1864.h cdp1869.c cdp1869.h mos6560.c mos6560.h
[src/emu/video]315_5124.c 315_5124.h cdp1861.c cdp1861.h cdp1862.c cdp1862.h crt9021.c crt9021.h h63484.c h63484.h hd44102.c hd44102.h hd61830.c hd61830.h i8275.c i8275.h k053250.c k053250.h mc6845.c mc6845.h msm6255.c msm6255.h pc_vga.c poly.c poly.h psx.c psx.h s2636.c s2636.h saa5050.c saa5050.h sed1330.c sed1330.h tms9928a.c tms9928a.h upd3301.c upd3301.h voodoo.c voodoo.h
[src/mame/drivers]1945kiii.c ace.c acefruit.c acommand.c adp.c albazc.c aristmk6.c astinvad.c astrocorp.c astrof.c atarisy4.c backfire.c bestleag.c bfcobra.c bingor.c blackt96.c bmcbowl.c bnstars.c boxer.c cabaret.c cardline.c cb2001.c champbwl.c chanbara.c chsuper.c cntsteer.c cobra.c coolridr.c cps3.c cshooter.c csplayh5.c cubeqst.c cybertnk.c dacholer.c darkhors.c dblewing.c ddealer.c ddenlovr.c destroyr.c discoboy.c diverboy.c dmndrby.c dominob.c dotrikun.c dreamwld.c drtomy.c dunhuang.c dwarfd.c dynadice.c egghunt.c esh.c fcrash.c feversoc.c firebeat.c firefox.c flyball.c galaxi.c galaxia.c galgame.c galpani3.c gamecstl.c gpworld.c guab.c halleys.c hitpoker.c hvyunit.c igs009.c igs011.c igs017.c igs_m027.c igspoker.c intrscti.c istellar.c itgambl2.c itgambl3.c jackie.c jalmah.c jangou.c jchan.c jollyjgr.c jpmsys5.c kingdrby.c kinst.c konamim2.c kongambl.c laserbat.c lastfght.c lgp.c limenko.c littlerb.c looping.c luckgrln.c m63.c magicard.c majorpkr.c marinedt.c maygayv1.c mediagx.c meritm.c midas.c mirage.c mirax.c missb2.c missile.c mjsister.c mlanding.c mogura.c monzagp.c mpu4vid.c multfish.c murogem.c mwarr.c namcoic.c namcos23.c neoprint.c nightgal.c nmg5.c norautp.c nwk-tr.c nyny.c olibochu.c panicr.c pasha2.c pcxt.c photon2.c pinkiri8.c powerbal.c progolf.c pturn.c pzletime.c quizpun2.c r2dx_v33.c rabbit.c raiden2.c sbowling.c segald.c sfbonus.c sigmab98.c skylncr.c snowbros.c speglsht.c spoker.c srmp5.c srmp6.c statriv2.c subsino.c subsino2.c superwng.c suprgolf.c taitotz.c taitowlf.c tmaster.c tmmjprd.c tonton.c trvmadns.c tugboat.c umipoker.c vamphalf.c vcombat.c vmetal.c wheelfir.c whitestar.c witch.c zr107.c
[src/mame/includes]cidelsa.h galaxian.h galaxold.h genesis.h kaneko16.h konamigx.h ladybug.h metro.h namcoic.h pk8000.h raiden2.h st0016.h suprnova.h zodiack.h
[src/mame/video]1942.c 1943.c 20pacgal.c 40love.c aeroboto.c aerofgt.c ajax.c aliens.c alpha68k.c ambush.c amiga.c amigaaga.c amspdwy.c angelkds.c appoooh.c aquarium.c arcadecl.c archimds.c argus.c arkanoid.c armedf.c asterix.c astrocde.c asuka.c atarifb.c atarig42.c atarigt.c atarigx2.c atarimo.c atarimo.h atarisy2.c bagman.c balsente.c baraduke.c batman.c battlane.c battlera.c battlex.c beezer.c bfm_adr2.c bigevglf.c bigstrkb.c bionicc.c bishi.c bking.c blktiger.c blmbycar.c blockhl.c bloodbro.c blueprnt.c bogeyman.c bombjack.c boogwing.c bosco.c bottom9.c brkthru.c bsktball.c btime.c bublbobl.c buggychl.c bwing.c cabal.c canyon.c capbowl.c carpolo.c cave.c cbasebal.c ccastles.c cclimber.c centiped.c chaknpop.c champbas.c cheekyms.c chqflag.c circus.c circusc.c cischeat.c citycon.c cloak.c cloud9.c clshroad.c cninja.c combatsc.c commando.c compgolf.c contra.c cop01.c copsnrob.c cosmic.c cps1.c crospang.c crshrace.c cvs.c cyberbal.c darius.c darkmist.c darkseal.c dassault.c dbz.c dc.c dcheese.c dcon.c dday.c ddragon.c ddragon3.c ddribble.c deadang.c dec0.c dec8.c decbac06.c decbac06.h deckarn.c deckarn.h decmxc06.c decmxc06.h deco16ic.c deco16ic.h deco32.c deco_mlc.c decocass.c decocomn.c decocomn.h decospr.c decospr.h deniam.c dietgo.c digdug.c djmain.c dkong.c docastle.c dogfgt.c dooyong.c dragrace.c drgnmst.c dribling.c dynax.c dynduke.c eprom.c equites.c esd16.c espial.c esripsys.c exedexes.c exerion.c exidy.c exidy440.c exprraid.c exzisus.c f1gp.c fantland.c fastfred.c fastlane.c finalizr.c firetrap.c firetrk.c fitfight.c flkatck.c flower.c flstory.c freekick.c fromance.c funkybee.c funkyjet.c funybubl.c fuukifg2.c fuukifg3.c gaelco.c gaelco2.c gaelco3d.c gaiden.c galaga.c galastrm.c galaxian.c galaxold.c galivan.c galpani2.c galpanic.c galspnbl.c gaplus.c gberet.c gcpinbal.c genesis.c gijoe.c ginganin.c gladiatr.c glass.c gng.c goal92.c goindol.c goldstar.c gotcha.c gottlieb.c gotya.c gp9001.c gp9001.h gradius3.c grchamp.c gridlee.c groundfx.c gstriker.c gsword.c gticlub.c gticlub.h gunbustr.c gunsmoke.c gyruss.c hcastle.c higemaru.c himesiki.c hnayayoi.c hng64.c holeland.c homedata.c homerun.c hyhoo.c hyperspt.c hyprduel.c ikki.c inufuku.c irobot.c ironhors.c itech32.c itech8.c jack.c jackal.c jaguar.c jailbrek.c jalblend.c jalblend.h jedi.c kan_panb.c kan_pand.c kan_pand.h kaneko16.c kangaroo.c karnov.c kchamp.c kickgoal.c kingobox.c kncljoe.c konamigx.c konamiic.c konamiic.h konicdev.c konicdev.h ksayakyu.c kyugo.c labyrunr.c ladybug.c ladyfrog.c lasso.c lastduel.c legionna.c leland.c lemmings.c lethal.c liberate.c lkage.c lockon.c lordgun.c lsasquad.c lwings.c m10.c m107.c m52.c m57.c m58.c m62.c m72.c m90.c m92.c macrossp.c madalien.c magmax.c mainevt.c mainsnk.c malzak.c mappy.c mario.c markham.c matmania.c mcatadv.c mcr.c mcr3.c mcr68.c meadows.c megasys1.c megazone.c mermaid.c metlclsh.c metro.c mexico86.c midvunit.c midzeus.c midzeus2.c mikie.c mitchell.c mjkjidai.c model1.c model2.c model3.c momoko.c moo.c mrdo.c mrflea.c mrjong.c ms32.c msisaac.c mugsmash.c munchmo.c mustache.c mystston.c namcofl.c namcona1.c namconb1.c namcos1.c namcos2.c namcos21.c namcos22.c namcos86.c naughtyb.c nemesis.c neogeo.c ninjakd2.c ninjaw.c nmk16.c nova2001.c nycaptor.c ohmygod.c oneshot.c opwolf.c orbit.c othldrby.c othunder.c overdriv.c pacland.c pacman.c pandoras.c paradise.c parodius.c pastelg.c pbaction.c pcktgal.c pgm.c pingpong.c pirates.c pitnrun.c pk8000.c pktgaldx.c playch10.c playmark.c plygonet.c pokechmp.c polepos.c policetr.c poolshrk.c pooyan.c popeye.c popper.c portrait.c powerins.c ppu2c0x.c prehisle.c psikyo.c psikyo4.c psikyosh.c psychic5.c punchout.c pushman.c qdrmfgp.c quasar.c quizdna.c raiden.c rainbow.c rallyx.c rampart.c rastan.c realbrk.c redclash.c relief.c renegade.c retofinv.c rltennis.c rocnrope.c rohga.c rollerg.c rollrace.c route16.c rpunch.c rungun.c sauro.c sbasketb.c scotrsht.c sderby.c sega16sp.c segag80r.c segahang.c segaic16.c segaic16.h segaic24.c segaic24.h segaorun.c segas16a.c segas16b.c segas18.c segas24.c segas32.c segaxbd.c segaybd.c sei_crtc.c seibuspi.c seicross.c senjyo.c seta.c seta001.c seta001.h seta2.c sf.c shadfrce.c shangha3.c shangkid.c shaolins.c shootout.c sidearms.c sidepckt.c silkroad.c simpl156.c simpsons.c sknsspr.c sknsspr.h skydiver.c skyfox.c skykid.c skyraid.c slapfght.c slapshot.c snes.c snk.c snk68.c solomon.c sonson.c spacefb.c spbactn.c spcforce.c spdodgeb.c speedatk.c speedbal.c speedspn.c splash.c sprcros2.c sprint2.c sprint4.c sprint8.c spy.c srmp2.c srumbler.c sshangha.c sslam.c ssozumo.c sspeedr.c ssrj.c ssv.c st0016.c stactics.c starcrus.c starshp1.c stfight.c stlforce.c strnskil.c stvvdp1.c stvvdp2.c suna16.c suna8.c supbtime.c superchs.c superqix.c suprloco.c suprnova.c suprridr.c suprslam.c surpratk.c system1.c system16.c tagteam.c tail2nos.c taito_b.c taito_f2.c taito_f3.c taito_h.c taito_l.c taito_o.c taito_z.c taitoair.c taitoic.c taitoic.h taitojc.c taitosj.c tank8.c tankbatt.c tankbust.c taotaido.c targeth.c tatsumi.c taxidriv.c tbowl.c tceptor.c tecmo.c tecmo16.c tecmosys.c tehkanwc.c terracre.c tetrisp2.c thedeep.c thepit.c thief.c thoop2.c thunderj.c thunderx.c tiamc1.c tigeroad.c timelimt.c timeplt.c tmnt.c tnzs.c toaplan1.c toaplan2.c toki.c toobin.c topspeed.c toypop.c tp84.c trackfld.c travrusa.c triplhnt.c tryout.c tsamurai.c tubep.c tumbleb.c tumblep.c tunhunt.c turbo.c tutankhm.c twin16.c twincobr.c ultratnk.c undrfire.c unico.c vastar.c vball.c vendetta.c vicdual.c videopin.c vigilant.c volfied.c vulgus.c warpwarp.c warriorb.c wc90.c wc90b.c wecleman.c welltris.c wgp.c williams.c wiz.c wolfpack.c wrally.c wwfsstar.c wwfwfest.c xain.c xevious.c xexex.c xmen.c xorworld.c xxmissio.c ygv608.c yiear.c yunsun16.c yunsung8.c zac2650.c zaccaria.c zaxxon.c zerozone.c zodiack.c
[src/mess/audio]ted7360.c ted7360.h
[src/mess/drivers]a5105.c a6809.c alphatro.c apexc.c apf.c apricot.c apricotp.c atom.c ax20.c bw12.c bw2.c cosmicos.c dim68k.c elf.c eti660.c h19.c if800.c jr200.c lcmate2.c m20.c mc10.c mc1000.c micronic.c mycom.c mz2500.c mz6500.c p2000t.c pasopia7.c pc2000.c pc6001.c pc8001.c pc8801.c pc88va.c pc9801.c phc25.c poly.c psion.c px4.c ql.c qx10.c scv.c smc777.c spc1000.c studio2.c supracan.c tandy2k.c ti990_10.c ti990_4.c tmc2000e.c trs80m2.c vboy.c vg5k.c victor9k.c vii.c vip.c vt240.c vtech1.c x1.c z100.c zrt80.c
[src/mess/includes]abc1600.h abc80.h abc80x.h newbrain.h pc1512.h portfoli.h tmc600.h
[src/mess/machine]c64_xl80.c c64_xl80.h coco12.c coco3.c comx_clm.c comx_clm.h ecb_grip.c ecb_grip.h s3c44b0.c teleprinter.c terminal.c z80ne.c
[src/mess/video]733_asr.c 911_vdt.c 911_vdt.h abc1600.c abc80.c abc800.c abc802.c abc806.c ac1.c apple1.c apple2.c apple2gs.c aquarius.c arcadia.c bbc.c cgenie.c comx35.c crtc_ega.c crtc_ega.h ef9345.c ef9345.h electron.c galeb.c gime.c gime.h hd44780.c hd44780.h hd66421.c hd66421.h intv.c k1ge.c k1ge.h kramermc.c kyocera.c mc6847.c mc6847.h mikromik.c mz700.c nascom1.c newbrain.c newport.c p2000m.c pc1251.c pc1350.c pc1401.c pc1403.c pc1512.c pc8401a.c pcw.c pdp1.c pet.c t6a04.c t6a04.h tmc1800.c tx0.c upd7220.c upd7220.h ut88.c v1050.c vdc8563.c vdc8563.h vic4567.c vic4567.h vic6567.c vic6567.h vtech2.c vtvideo.c vtvideo.h x68k.c zx8301.c zx8301.h

src/mame/includes/suprnova.h
r13798r13799
7474
7575void skns_sprite_kludge(int x, int y);
7676void skns_draw_sprites(
77   running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect,
77   running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect,
7878   UINT32* spriteram_source, size_t spriteram_size,
7979   UINT8* gfx_source, size_t gfx_length,
8080   UINT32* sprite_regs );
src/mame/includes/kaneko16.h
r13798r13799
165165READ16_HANDLER ( kaneko16_sprites_regs_r );
166166WRITE16_HANDLER( kaneko16_sprites_regs_w );
167167
168void kaneko16_draw_sprites(running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect);
168void kaneko16_draw_sprites(running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect);
169169
170170READ16_HANDLER ( kaneko16_bg15_select_r );
171171WRITE16_HANDLER( kaneko16_bg15_select_w );
src/mame/includes/galaxian.h
r13798r13799
2828/* video extension callbacks */
2929typedef void (*galaxian_extend_tile_info_func)(running_machine &machine, UINT16 *code, UINT8 *color, UINT8 attrib, UINT8 x);
3030typedef void (*galaxian_extend_sprite_info_func)(running_machine &machine, const UINT8 *base, UINT8 *sx, UINT8 *sy, UINT8 *flipx, UINT8 *flipy, UINT16 *code, UINT8 *color);
31typedef void (*galaxian_draw_bullet_func)(running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect, int offs, int x, int y);
32typedef void (*galaxian_draw_background_func)(running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect);
31typedef void (*galaxian_draw_bullet_func)(running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect, int offs, int x, int y);
32typedef void (*galaxian_draw_background_func)(running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect);
3333
3434
3535class galaxian_state : public driver_device
r13798r13799
105105TIMER_DEVICE_CALLBACK( galaxian_stars_blink_timer );
106106
107107/* special purpose background rendering */
108void galaxian_draw_background(running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect);
109void frogger_draw_background(running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect);
110//void amidar_draw_background(running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect);
111void turtles_draw_background(running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect);
112void scramble_draw_background(running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect);
113void anteater_draw_background(running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect);
114void jumpbug_draw_background(running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect);
108void galaxian_draw_background(running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect);
109void frogger_draw_background(running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect);
110//void amidar_draw_background(running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect);
111void turtles_draw_background(running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect);
112void scramble_draw_background(running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect);
113void anteater_draw_background(running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect);
114void jumpbug_draw_background(running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect);
115115
116116/* special purpose bullet rendering */
117void galaxian_draw_bullet(running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect, int offs, int x, int y);
118void mshuttle_draw_bullet(running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect, int offs, int x, int y);
119void scramble_draw_bullet(running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect, int offs, int x, int y);
120void theend_draw_bullet(running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect, int offs, int x, int y);
117void galaxian_draw_bullet(running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect, int offs, int x, int y);
118void mshuttle_draw_bullet(running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect, int offs, int x, int y);
119void scramble_draw_bullet(running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect, int offs, int x, int y);
120void theend_draw_bullet(running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect, int offs, int x, int y);
121121
122122/* generic extensions */
123123void upper_extend_tile_info(running_machine &machine, UINT16 *code, UINT8 *color, UINT8 attrib, UINT8 x);
src/mame/includes/raiden2.h
r13798r13799
109109
110110   UINT16 cop_hit_status;
111111
112   void draw_sprites(running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect ,int pri_mask );
112   void draw_sprites(running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect ,int pri_mask );
113113   UINT8 cop_calculate_collsion_detection(running_machine &machine);
114114
115115};
src/mame/includes/zodiack.h
r13798r13799
3131   DECLARE_WRITE8_MEMBER(attributes_w);
3232   DECLARE_WRITE8_MEMBER(flipscreen_w);
3333
34   void draw_bullets(bitmap_t *bitmap, const rectangle *cliprect);
35   void draw_sprites(bitmap_t *bitmap, const rectangle *cliprect);
34   void draw_bullets(bitmap_t *bitmap, const rectangle &cliprect);
35   void draw_sprites(bitmap_t *bitmap, const rectangle &cliprect);
3636
3737   // devices
3838   required_device<z80_device> m_maincpu;
src/mame/includes/st0016.h
r13798r13799
5757READ8_HANDLER   (st0016_vregs_r);
5858WRITE8_HANDLER   (st0016_vregs_w);
5959
60void st0016_draw_screen(screen_device &screen, bitmap_t *bitmap, const rectangle *cliprect);
60void st0016_draw_screen(screen_device &screen, bitmap_t *bitmap, const rectangle &cliprect);
6161VIDEO_START(st0016);
6262SCREEN_UPDATE(st0016);
src/mame/includes/galaxold.h
r13798r13799
5656
5757   UINT8 m_timer_adjusted;
5858   UINT8 m_darkplnt_bullet_color;
59   void (*m_draw_bullets)(running_machine &,bitmap_t *,const rectangle *, int, int, int);   /* function to call to draw a bullet */
59   void (*m_draw_bullets)(running_machine &,bitmap_t *,const rectangle &, int, int, int);   /* function to call to draw a bullet */
6060
6161   UINT8 m_background_enable;
6262   UINT8 m_background_red;
6363   UINT8 m_background_green;
6464   UINT8 m_background_blue;
65   void (*m_draw_background)(running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect);   /* function to call to draw the background */
65   void (*m_draw_background)(running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect);   /* function to call to draw the background */
6666   UINT16 m_rockclim_v;
6767   UINT16 m_rockclim_h;
6868   int m_dambustr_bg_split_line;
r13798r13799
7272   int m_dambustr_char_bank;
7373   bitmap_t *m_dambustr_tmpbitmap;
7474
75   void (*m_draw_stars)(running_machine &machine, bitmap_t *, const rectangle *);      /* function to call to draw the star layer */
75   void (*m_draw_stars)(running_machine &machine, bitmap_t *, const rectangle &);      /* function to call to draw the star layer */
7676   int m_stars_colors_start;
7777   INT32 m_stars_scrollpos;
7878   UINT8 m_stars_on;
r13798r13799
142142VIDEO_START( ad2083 );
143143
144144void galaxold_init_stars(running_machine &machine, int colors_offset);
145void galaxold_draw_stars(running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect);
145void galaxold_draw_stars(running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect);
146146
147147SCREEN_UPDATE( galaxold );
148148SCREEN_UPDATE( dambustr );
src/mame/includes/metro.h
r13798r13799
9898
9999SCREEN_UPDATE( metro );
100100
101void metro_draw_sprites(running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect);
101void metro_draw_sprites(running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect);
src/mame/includes/pk8000.h
r13798r13799
1818
1919PALETTE_INIT( pk8000 );
2020
21UINT32 pk8000_video_update(screen_device &screen, bitmap_t *bitmap, const rectangle *cliprect, UINT8 *videomem);
21UINT32 pk8000_video_update(screen_device &screen, bitmap_t *bitmap, const rectangle &cliprect, UINT8 *videomem);
src/mame/includes/namcoic.h
r13798r13799
9393void namco_tilemap_init(
9494      running_machine &machine, int gfxbank, void *pMaskROM,
9595      void (*cb)( running_machine &machine, UINT16 code, int *gfx, int *mask) );
96void namco_tilemap_draw( bitmap_t *bitmap, const rectangle *cliprect, int pri );
96void namco_tilemap_draw( bitmap_t *bitmap, const rectangle &cliprect, int pri );
9797void namco_tilemap_invalidate( void );
9898WRITE16_HANDLER( namco_tilemapvideoram16_w );
9999READ16_HANDLER( namco_tilemapvideoram16_r );
r13798r13799
113113/***********************************************************************************/
114114
115115/* Namco System II Sprite Rendering */
116void namcos2_draw_sprites( running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect, int pri, int control );
116void namcos2_draw_sprites( running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect, int pri, int control );
117117
118void namcos2_draw_sprites_metalhawk( running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect, int pri );
118void namcos2_draw_sprites_metalhawk( running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect, int pri );
119119
120120/***********************************************************************************/
121121/* C355 Motion Object Emulation */
122122
123123/* for palXOR, supply either 0x0 (normal) or 0xf (palette mapping reversed) */
124124void namco_obj_init( running_machine &machine, int gfxbank, int palXOR, int (*code2tile)( running_machine &machine, int code ) );
125void namco_obj_draw( running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect, int pri );
125void namco_obj_draw( running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect, int pri );
126126
127127WRITE16_HANDLER( namco_obj16_w );
128128READ16_HANDLER( namco_obj16_r );
r13798r13799
142142/* C169 ROZ Layer Emulation */
143143
144144void namco_roz_init( running_machine &machine, int gfxbank, const char *maskregion );
145void namco_roz_draw( bitmap_t *bitmap, const rectangle *cliprect, int pri );
145void namco_roz_draw( bitmap_t *bitmap, const rectangle &cliprect, int pri );
146146
147147READ16_HANDLER( namco_rozcontrol16_r );
148148WRITE16_HANDLER( namco_rozcontrol16_w );
r13798r13799
165165
166166void namco_road_init( running_machine &machine, int gfxbank );
167167void namco_road_set_transparent_color(pen_t pen);
168void namco_road_draw( running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect, int pri );
168void namco_road_draw( running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect, int pri );
169169
170170READ16_HANDLER( namco_road16_r );
171171WRITE16_HANDLER( namco_road16_w );
src/mame/includes/konamigx.h
r13798r13799
7373#define GXSUB_5BPP      0x05   //  32 colors
7474#define GXSUB_8BPP      0x08   // 256 colors
7575
76void konamigx_mixer(running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect,
76void konamigx_mixer(running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect,
7777               tilemap_t *sub1, int sub1flags,
7878               tilemap_t *sub2, int sub2flags,
7979               int mixerflags, bitmap_t* extra_bitmap, int rushingheroes_hack);
src/mame/includes/ladybug.h
r13798r13799
8080void redclash_set_stars_enable(running_machine &machine, UINT8 on);
8181void redclash_update_stars_state(running_machine &machine);
8282void redclash_set_stars_speed(running_machine &machine, UINT8 speed);
83void redclash_draw_stars(running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect, UINT8 palette_offset, UINT8 sraider, UINT8 firstx, UINT8 lastx);
83void redclash_draw_stars(running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect, UINT8 palette_offset, UINT8 sraider, UINT8 firstx, UINT8 lastx);
src/mame/includes/cidelsa.h
r13798r13799
5151   virtual void machine_reset();
5252
5353   virtual void video_start();
54   virtual bool screen_update(screen_device &screen, bitmap_t &bitmap, const rectangle &cliprect) { m_vis->update_screen(&bitmap, &cliprect); return false; }
54   virtual bool screen_update(screen_device &screen, bitmap_t &bitmap, const rectangle &cliprect) { m_vis->update_screen(&bitmap, cliprect); return false; }
5555
5656   DECLARE_WRITE8_MEMBER( cdp1869_w );
5757   DECLARE_WRITE8_MEMBER( destryer_out1_w );
src/mame/includes/genesis.h
r13798r13799
77extern UINT8 genesis_vdp_regs[32];
88
99void system18_vdp_start(running_machine &machine);
10void system18_vdp_update(bitmap_t *bitmap, const rectangle *cliprect);
10void system18_vdp_update(bitmap_t *bitmap, const rectangle &cliprect);
1111
1212READ16_HANDLER ( genesis_vdp_r );
1313WRITE16_HANDLER( genesis_vdp_w );
src/mame/video/targeth.c
r13798r13799
105105      3  | xx------ -------- | not used?
106106*/
107107
108static void draw_sprites(running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect)
108static void draw_sprites(running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect)
109109{
110110   targeth_state *state = machine.driver_data<targeth_state>();
111111   int i;
src/mame/video/nycaptor.c
r13798r13799
167167   tilemap_set_scrolly(state->m_bg_tilemap, offset, data);
168168}
169169
170static void draw_sprites( running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect, int pri )
170static void draw_sprites( running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect, int pri )
171171{
172172   nycaptor_state *state = machine.driver_data<nycaptor_state>();
173173   int i;
src/mame/video/rainbow.c
r13798r13799
5252   layer[0] = 0;
5353   layer[1] = 1;
5454
55   screen.machine().priority_bitmap->fill(0, *cliprect);
55   screen.machine().priority_bitmap->fill(0, cliprect);
5656
5757   pc080sn_tilemap_draw(state->m_pc080sn, bitmap, cliprect, layer[0], TILEMAP_DRAW_OPAQUE, 1);
5858   pc080sn_tilemap_draw(state->m_pc080sn, bitmap, cliprect, layer[1], 0, 2);
r13798r13799
102102   layer[0] = 0;
103103   layer[1] = 1;
104104
105   screen.machine().priority_bitmap->fill(0, *cliprect);
105   screen.machine().priority_bitmap->fill(0, cliprect);
106106
107107   pc080sn_tilemap_draw(state->m_pc080sn, bitmap, cliprect, layer[0], TILEMAP_DRAW_OPAQUE, 0);
108108
src/mame/video/mitchell.c
r13798r13799
300300
301301***************************************************************************/
302302
303static void draw_sprites( running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect )
303static void draw_sprites( running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect )
304304{
305305   mitchell_state *state = machine.driver_data<mitchell_state>();
306306   int offs, sx, sy;
r13798r13799
332332{
333333   mitchell_state *state = screen.machine().driver_data<mitchell_state>();
334334
335   bitmap->fill(0, *cliprect);
335   bitmap->fill(0, cliprect);
336336   tilemap_draw(bitmap, cliprect, state->m_bg_tilemap, 0, 0);
337337   draw_sprites(screen.machine(), bitmap, cliprect);
338338   return 0;
src/mame/video/galspnbl.c
r13798r13799
2929 *    4    | xxxxxxxxxxxxxxxx | x position
3030 *    5,6,7|                  | unused
3131 */
32static void draw_sprites( running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect, int priority )
32static void draw_sprites( running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect, int priority )
3333{
3434   galspnbl_state *state = machine.driver_data<galspnbl_state>();
3535   UINT16 *spriteram = state->m_spriteram;
r13798r13799
8484}
8585
8686
87static void draw_background( running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect )
87static void draw_background( running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect )
8888{
8989   galspnbl_state *state = machine.driver_data<galspnbl_state>();
9090   offs_t offs;
src/mame/video/xevious.c
r13798r13799
414414
415415***************************************************************************/
416416
417static void draw_sprites(running_machine &machine, bitmap_t *bitmap,const rectangle *cliprect)
417static void draw_sprites(running_machine &machine, bitmap_t *bitmap,const rectangle &cliprect)
418418{
419419   xevious_state *state =  machine.driver_data<xevious_state>();
420420
src/mame/video/blktiger.c
r13798r13799
199199
200200***************************************************************************/
201201
202static void draw_sprites( running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect )
202static void draw_sprites( running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect )
203203{
204204//  blktiger_state *state = machine.driver_data<blktiger_state>();
205205   UINT8 *buffered_spriteram = machine.generic.buffered_spriteram.u8;
r13798r13799
234234{
235235   blktiger_state *state = screen.machine().driver_data<blktiger_state>();
236236
237   bitmap->fill(1023, *cliprect);
237   bitmap->fill(1023, cliprect);
238238
239239   if (state->m_bgon)
240240      tilemap_draw(bitmap, cliprect, state->m_screen_layout ? state->m_bg_tilemap8x4 : state->m_bg_tilemap4x8, TILEMAP_DRAW_LAYER1, 0);
src/mame/video/dynduke.c
r13798r13799
137137   }
138138}
139139
140static void draw_sprites(running_machine &machine, bitmap_t *bitmap,const rectangle *cliprect,int pri)
140static void draw_sprites(running_machine &machine, bitmap_t *bitmap,const rectangle &cliprect,int pri)
141141{
142142   dynduke_state *state = machine.driver_data<dynduke_state>();
143143   UINT16 *buffered_spriteram16 = machine.generic.buffered_spriteram.u16;
r13798r13799
175175   }
176176}
177177
178static void draw_background(running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect, int pri )
178static void draw_background(running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect, int pri )
179179{
180180   dynduke_state *state = machine.driver_data<dynduke_state>();
181181   /* The transparency / palette handling on the background layer is very strange */
r13798r13799
186186   /* if we're disabled, don't draw */
187187   if (!state->m_back_enable)
188188   {
189      bitmap->fill(get_black_pen(machine), *cliprect);
189      bitmap->fill(get_black_pen(machine), cliprect);
190190      return;
191191   }
192192
src/mame/video/deco_mlc.c
r13798r13799
217217   }
218218}
219219
220static void draw_sprites(running_machine& machine, bitmap_t *bitmap,const rectangle *cliprect)
220static void draw_sprites(running_machine& machine, bitmap_t *bitmap,const rectangle &cliprect)
221221{
222222   deco_mlc_state *state = machine.driver_data<deco_mlc_state>();
223223   UINT32 *index_ptr=0;
r13798r13799
310310      user_clip.min_x=state->m_mlc_clip_ram[(clipper*4)+2];
311311      user_clip.max_x=state->m_mlc_clip_ram[(clipper*4)+3];
312312
313      user_clip &= *cliprect;
313      user_clip &= cliprect;
314314
315315      /* Any colours out of range (for the bpp value) trigger 'shadow' mode */
316316      if (color & (state->m_colour_mask+1))
r13798r13799
491491//      if (lastRasterMode!=0 && rasterDirty)
492492//      {
493493//          blitRaster(machine, bitmap, rasterMode);
494//          temp_bitmap->fill(0, *cliprect);
494//          temp_bitmap->fill(0, cliprect);
495495//          rasterDirty=0;
496496//      }
497497//      lastRasterMode=rasterMode;
r13798r13799
514514
515515SCREEN_UPDATE( mlc )
516516{
517//  temp_bitmap->fill(0, *cliprect);
518   bitmap->fill(screen.machine().pens[0], *cliprect); /* Pen 0 fill colour confirmed from Skull Fang level 2 */
517//  temp_bitmap->fill(0, cliprect);
518   bitmap->fill(screen.machine().pens[0], cliprect); /* Pen 0 fill colour confirmed from Skull Fang level 2 */
519519   draw_sprites(screen.machine(),bitmap,cliprect);
520520   return 0;
521521}
src/mame/video/tunhunt.c
r13798r13799
200200   }
201201}
202202
203static void draw_motion_object(running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect)
203static void draw_motion_object(running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect)
204204{
205205/*
206206 *      VSTRLO  0x1202
r13798r13799
272272   );
273273}
274274
275static void draw_box(running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect)
275static void draw_box(running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect)
276276{
277277/*
278278    This is unnecessarily slow, but the box priorities aren't completely understood,
r13798r13799
302302
303303   for( y=0; y<256; y++ )
304304   {
305      if (0xff-y >= cliprect->min_y && 0xff-y <= cliprect->max_y)
305      if (0xff-y >= cliprect.min_y && 0xff-y <= cliprect.max_y)
306306         for( x=0; x<256; x++ )
307307         {
308308            color = 0;
r13798r13799
319319                  z = x0; /* give priority to rightmost spans */
320320               }
321321            }
322            if (x >= cliprect->min_x && x <= cliprect->max_x)
322            if (x >= cliprect.min_x && x <= cliprect.max_x)
323323               bitmap->pix16(0xff-y, x) = color;
324324         }
325325   }
r13798r13799
328328/* "shell" graphics are 16x16 pixel tiles used for player shots and targeting cursor */
329329static void draw_shell(running_machine &machine,
330330      bitmap_t *bitmap,
331      const rectangle *cliprect,
331      const rectangle &cliprect,
332332      int picture_code,
333333      int hposition,
334334      int vstart,
src/mame/video/tryout.c
r13798r13799
182182   tilemap_set_transparent_pen(state->m_fg_tilemap,0);
183183}
184184
185static void draw_sprites(running_machine &machine, bitmap_t *bitmap,const rectangle *cliprect)
185static void draw_sprites(running_machine &machine, bitmap_t *bitmap,const rectangle &cliprect)
186186{
187187   tryout_state *state = machine.driver_data<tryout_state>();
188188   UINT8 *spriteram = state->m_spriteram;
r13798r13799
254254   if(!(state->m_gfx_control[0] & 0x8)) // screen disable
255255   {
256256      /* TODO: Color might be different, needs a video from an original pcb. */
257      bitmap->fill(screen.machine().pens[0x10], *cliprect);
257      bitmap->fill(screen.machine().pens[0x10], cliprect);
258258   }
259259   else
260260   {
src/mame/video/rungun.c
r13798r13799
107107{
108108   rungun_state *state = screen.machine().driver_data<rungun_state>();
109109
110   bitmap->fill(get_black_pen(screen.machine()), *cliprect);
111   screen.machine().priority_bitmap->fill(0, *cliprect);
110   bitmap->fill(get_black_pen(screen.machine()), cliprect);
111   screen.machine().priority_bitmap->fill(0, cliprect);
112112
113113   k053936_zoom_draw(state->m_k053936, bitmap, cliprect, state->m_936_tilemap, 0, 0, 1);
114114
src/mame/video/eprom.c
r13798r13799
243243
244244   if (state->m_video_disable)
245245   {
246      bitmap->fill(get_black_pen(screen.machine()), *cliprect);
246      bitmap->fill(get_black_pen(screen.machine()), cliprect);
247247      return 0;
248248   }
249249
r13798r13799
398398
399399   if (state->m_video_disable)
400400   {
401      bitmap->fill(get_black_pen(screen.machine()), *cliprect);
401      bitmap->fill(get_black_pen(screen.machine()), cliprect);
402402      return 0;
403403   }
404404
src/mame/video/skyfox.c
r13798r13799
159159
160160***************************************************************************/
161161
162static void draw_sprites( running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect )
162static void draw_sprites( running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect )
163163{
164164   skyfox_state *state = machine.driver_data<skyfox_state>();
165165   int offs;
r13798r13799
238238
239239***************************************************************************/
240240
241static void draw_background(running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect)
241static void draw_background(running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect)
242242{
243243   skyfox_state *state = machine.driver_data<skyfox_state>();
244244   UINT8 *RAM = machine.region("gfx2")->base();
r13798r13799
283283
284284SCREEN_UPDATE( skyfox )
285285{
286   bitmap->fill(255, *cliprect);   // the bg is black
286   bitmap->fill(255, cliprect);   // the bg is black
287287   draw_background(screen.machine(), bitmap, cliprect);
288288   draw_sprites(screen.machine(), bitmap, cliprect);
289289   return 0;
src/mame/video/bublbobl.c
r13798r13799
2525   /* the background character columns is stored in the area dd00-dd3f */
2626
2727   /* This clears & redraws the entire screen each pass */
28   bitmap->fill(255, *cliprect);
28   bitmap->fill(255, cliprect);
2929
3030   if (!state->m_video_enable)
3131      return 0;
src/mame/video/aerofgt.c
r13798r13799
333333
334334***************************************************************************/
335335
336static void aerofgt_draw_sprites( running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect, int priority )
336static void aerofgt_draw_sprites( running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect, int priority )
337337{
338338   aerofgt_state *state = machine.driver_data<aerofgt_state>();
339339   int offs;
r13798r13799
404404   }
405405}
406406
407static void turbofrc_draw_sprites( running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect, int chip, int chip_disabled_pri )
407static void turbofrc_draw_sprites( running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect, int chip, int chip_disabled_pri )
408408{
409409   aerofgt_state *state = machine.driver_data<aerofgt_state>();
410410   int attr_start, base, first;
r13798r13799
489489   }
490490}
491491
492static void spinlbrk_draw_sprites( running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect, int chip, int chip_disabled_pri )
492static void spinlbrk_draw_sprites( running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect, int chip, int chip_disabled_pri )
493493{
494494   aerofgt_state *state = machine.driver_data<aerofgt_state>();
495495   int attr_start, base, first;
r13798r13799
573573   }
574574}
575575
576static void aerfboo2_draw_sprites( running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect, int chip, int chip_disabled_pri )
576static void aerfboo2_draw_sprites( running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect, int chip, int chip_disabled_pri )
577577{
578578   aerofgt_state *state = machine.driver_data<aerofgt_state>();
579579   int attr_start, base, first;
r13798r13799
658658   }
659659}
660660
661static void pspikesb_draw_sprites( running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect )
661static void pspikesb_draw_sprites( running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect )
662662{
663663   aerofgt_state *state = machine.driver_data<aerofgt_state>();
664664   int i;
r13798r13799
693693   }
694694}
695695
696static void spikes91_draw_sprites( running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect )
696static void spikes91_draw_sprites( running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect )
697697{
698698   aerofgt_state *state = machine.driver_data<aerofgt_state>();
699699   int i;
r13798r13799
735735   }
736736}
737737
738static void aerfboot_draw_sprites( running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect )
738static void aerfboot_draw_sprites( running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect )
739739{
740740   aerofgt_state *state = machine.driver_data<aerofgt_state>();
741741   int attr_start, last;
r13798r13799
849849      tilemap_set_scrollx(state->m_bg1_tilemap, (i + scrolly) & 0xff, state->m_rasterram[i]);
850850   tilemap_set_scrolly(state->m_bg1_tilemap, 0, scrolly);
851851
852   screen.machine().priority_bitmap->fill(0, *cliprect);
852   screen.machine().priority_bitmap->fill(0, cliprect);
853853
854854   tilemap_draw(bitmap, cliprect, state->m_bg1_tilemap, 0, 0);
855855   turbofrc_draw_sprites(screen.machine(), bitmap, cliprect, 0, -1);
r13798r13799
922922   tilemap_set_scrollx(state->m_bg2_tilemap, 0, state->m_bg2scrollx - 4);
923923   tilemap_set_scrolly(state->m_bg2_tilemap, 0, state->m_bg2scrolly);
924924
925   screen.machine().priority_bitmap->fill(0, *cliprect);
925   screen.machine().priority_bitmap->fill(0, cliprect);
926926
927927   tilemap_draw(bitmap, cliprect, state->m_bg1_tilemap, 0, 0);
928928   tilemap_draw(bitmap, cliprect, state->m_bg2_tilemap, 0, 0);
r13798r13799
948948   tilemap_set_scrollx(state->m_bg2_tilemap, 0, state->m_bg2scrollx - 4);
949949//  tilemap_set_scrolly(state->m_bg2_tilemap, 0, state->m_bg2scrolly);
950950
951   screen.machine().priority_bitmap->fill(0, *cliprect);
951   screen.machine().priority_bitmap->fill(0, cliprect);
952952
953953   tilemap_draw(bitmap, cliprect, state->m_bg1_tilemap, 0, 0);
954954   tilemap_draw(bitmap, cliprect, state->m_bg2_tilemap, 0, 1);
r13798r13799
975975   tilemap_set_scrollx(state->m_bg2_tilemap, 0, state->m_bg2scrollx - 7);
976976   tilemap_set_scrolly(state->m_bg2_tilemap, 0, state->m_bg2scrolly + 2);
977977
978   screen.machine().priority_bitmap->fill(0, *cliprect);
978   screen.machine().priority_bitmap->fill(0, cliprect);
979979
980980   tilemap_draw(bitmap, cliprect, state->m_bg1_tilemap, 0, 0);
981981   tilemap_draw(bitmap, cliprect, state->m_bg2_tilemap, 0, 1);
r13798r13799
996996   tilemap_set_scrollx(state->m_bg2_tilemap, 0, state->m_rasterram[0x0200] - 20);
997997   tilemap_set_scrolly(state->m_bg2_tilemap, 0, state->m_bg2scrolly);
998998
999   screen.machine().priority_bitmap->fill(0, *cliprect);
999   screen.machine().priority_bitmap->fill(0, cliprect);
10001000
10011001   tilemap_draw(bitmap, cliprect, state->m_bg1_tilemap, 0, 0);
10021002
r13798r13799
10241024   tilemap_set_scrollx(state->m_bg2_tilemap, 0, state->m_bg2scrollx + 172);
10251025   tilemap_set_scrolly(state->m_bg2_tilemap, 0, state->m_bg2scrolly + 2);
10261026
1027   screen.machine().priority_bitmap->fill(0, *cliprect);
1027   screen.machine().priority_bitmap->fill(0, cliprect);
10281028
10291029   tilemap_draw(bitmap, cliprect, state->m_bg1_tilemap, 0, 0);
10301030   tilemap_draw(bitmap, cliprect, state->m_bg2_tilemap, 0, 1);
r13798r13799
10481048   tilemap_set_scrollx(state->m_bg2_tilemap, 0, state->m_bg2scrollx - 7);
10491049   tilemap_set_scrolly(state->m_bg2_tilemap, 0, state->m_bg2scrolly + 2);
10501050
1051   screen.machine().priority_bitmap->fill(0, *cliprect);
1051   screen.machine().priority_bitmap->fill(0, cliprect);
10521052
10531053   tilemap_draw(bitmap, cliprect, state->m_bg1_tilemap, 0, 0);
10541054   tilemap_draw(bitmap, cliprect, state->m_bg2_tilemap, 0, 1);
r13798r13799
10721072      tilemap_set_scrollx(state->m_bg1_tilemap, (i + scrolly) & 0xff, state->m_rasterram[i]);
10731073   tilemap_set_scrolly(state->m_bg1_tilemap, 0, scrolly);
10741074
1075   screen.machine().priority_bitmap->fill(0, *cliprect);
1075   screen.machine().priority_bitmap->fill(0, cliprect);
10761076
10771077   if (state->m_wbbc97_bitmap_enable)
10781078   {
src/mame/video/rocnrope.c
r13798r13799
122122   state->m_bg_tilemap = tilemap_create(machine, get_bg_tile_info, tilemap_scan_rows, 8, 8, 32, 32);
123123}
124124
125static void draw_sprites(running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect )
125static void draw_sprites(running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect )
126126{
127127   rocnrope_state *state = machine.driver_data<rocnrope_state>();
128128   UINT8 *spriteram = state->m_spriteram;
src/mame/video/docastle.c
r13798r13799
132132   video_start_common(machine, 0xff00);
133133}
134134
135static void draw_sprites( running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect )
135static void draw_sprites( running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect )
136136{
137137   docastle_state *state = machine.driver_data<docastle_state>();
138138   int offs;
src/mame/video/mainsnk.c
r13798r13799
125125
126126
127127
128static void draw_sprites(running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect, int scrollx, int scrolly )
128static void draw_sprites(running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect, int scrollx, int scrolly )
129129{
130130   mainsnk_state *state = machine.driver_data<mainsnk_state>();
131131   const gfx_element *gfx = machine.gfx[1];
src/mame/video/mystston.c
r13798r13799
179179 *
180180 *************************************/
181181
182static void draw_sprites(bitmap_t *bitmap, const rectangle *cliprect, const gfx_element *gfx, int flip)
182static void draw_sprites(bitmap_t *bitmap, const rectangle &cliprect, const gfx_element *gfx, int flip)
183183{
184184   mystston_state *state = gfx->machine().driver_data<mystston_state>();
185185   int offs;
src/mame/video/ygv608.c
r13798r13799
547547   machine.add_notifier(MACHINE_NOTIFY_EXIT, machine_notify_delegate(FUNC(ygv608_exit), &machine));
548548}
549549
550static void draw_sprites(running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect)
550static void draw_sprites(running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect)
551551{
552552#ifdef _ENABLE_SPRITES
553553
r13798r13799
564564    return;
565565
566566  /* draw sprites */
567  spriteClip &= *cliprect;
567  spriteClip &= cliprect;
568568  sa = &ygv608.sprite_attribute_table.s[YGV608_MAX_SPRITES-1];
569569  for( i=0; i<YGV608_MAX_SPRITES; i++, sa-- )
570570  {
r13798r13799
600600       logerror( "SZ_8X8: sprite=%d\n", code );
601601       code = 0;
602602      }
603      drawgfx_transpen( bitmap, &spriteClip,machine.gfx[GFX_8X8_4BIT],
603      drawgfx_transpen( bitmap, spriteClip,machine.gfx[GFX_8X8_4BIT],
604604          code+namcond1_gfxbank*0x10000,
605605          color,
606606          flipx,flipy,
607607          sx,sy,0x00);
608608      // redraw with wrap-around
609609      if( sx > 512-8 )
610        drawgfx_transpen( bitmap, &spriteClip,machine.gfx[GFX_8X8_4BIT],
610        drawgfx_transpen( bitmap, spriteClip,machine.gfx[GFX_8X8_4BIT],
611611           code+namcond1_gfxbank*0x10000,
612612           color,
613613           flipx,flipy,
614614           sx-512,sy,0x00);
615615      if( sy > 512-8 )
616        drawgfx_transpen( bitmap, &spriteClip,machine.gfx[GFX_8X8_4BIT],
616        drawgfx_transpen( bitmap, spriteClip,machine.gfx[GFX_8X8_4BIT],
617617           code+namcond1_gfxbank*0x10000,
618618           color,
619619           flipx,flipy,
r13798r13799
630630       logerror( "SZ_8X8: sprite=%d\n", code );
631631       code = 0;
632632      }
633      drawgfx_transpen( bitmap, &spriteClip,machine.gfx[GFX_16X16_4BIT],
633      drawgfx_transpen( bitmap, spriteClip,machine.gfx[GFX_16X16_4BIT],
634634          code+namcond1_gfxbank*0x4000,
635635          color,
636636          flipx,flipy,
637637          sx,sy,0x00);
638638      // redraw with wrap-around
639639      if( sx > 512-16 )
640        drawgfx_transpen( bitmap, &spriteClip,machine.gfx[GFX_16X16_4BIT],
640        drawgfx_transpen( bitmap, spriteClip,machine.gfx[GFX_16X16_4BIT],
641641           code+namcond1_gfxbank*0x4000,
642642           color,
643643           flipx,flipy,
644644           sx-512,sy,0x00);
645645      if( sy > 512-16 )
646        drawgfx_transpen( bitmap, &spriteClip,machine.gfx[GFX_16X16_4BIT],
646        drawgfx_transpen( bitmap, spriteClip,machine.gfx[GFX_16X16_4BIT],
647647           code+namcond1_gfxbank*0x4000,
648648           color,
649649           flipx,flipy,
r13798r13799
660660     logerror( "SZ_32X32: sprite=%d\n", code );
661661   code = 0;
662662      }
663      drawgfx_transpen( bitmap, &spriteClip,machine.gfx[GFX_32X32_4BIT],
663      drawgfx_transpen( bitmap, spriteClip,machine.gfx[GFX_32X32_4BIT],
664664          code+namcond1_gfxbank*0x1000,
665665          color,
666666          flipx,flipy,
667667          sx,sy,0x00);
668668      // redraw with wrap-around
669669      if( sx > 512-32 )
670        drawgfx_transpen( bitmap, &spriteClip,machine.gfx[GFX_32X32_4BIT],
670        drawgfx_transpen( bitmap, spriteClip,machine.gfx[GFX_32X32_4BIT],
671671           code+namcond1_gfxbank*0x1000,
672672           color,
673673           flipx,flipy,
674674           sx-512,sy,0x00);
675675      if( sy > 512-32 )
676        drawgfx_transpen( bitmap, &spriteClip,machine.gfx[GFX_32X32_4BIT],
676        drawgfx_transpen( bitmap, spriteClip,machine.gfx[GFX_32X32_4BIT],
677677           code+namcond1_gfxbank*0x1000,
678678           color,
679679           flipx,flipy,
r13798r13799
690690       logerror( "SZ_64X64: sprite=%d\n", code );
691691       code = 0;
692692      }
693      drawgfx_transpen( bitmap, &spriteClip,machine.gfx[GFX_64X64_4BIT],
693      drawgfx_transpen( bitmap, spriteClip,machine.gfx[GFX_64X64_4BIT],
694694          code+namcond1_gfxbank*0x400,
695695          color,
696696          flipx,flipy,
697697          sx,sy,0x00);
698698      // redraw with wrap-around
699699      if( sx > 512-64 )
700        drawgfx_transpen( bitmap, &spriteClip,machine.gfx[GFX_64X64_4BIT],
700        drawgfx_transpen( bitmap, spriteClip,machine.gfx[GFX_64X64_4BIT],
701701           code+namcond1_gfxbank*0x400,
702702           color,
703703           flipx,flipy,
704704           sx-512,sy,0x00);
705705      if( sy > 512-64 )
706        drawgfx_transpen( bitmap, &spriteClip,machine.gfx[GFX_64X64_4BIT],
706        drawgfx_transpen( bitmap, spriteClip,machine.gfx[GFX_64X64_4BIT],
707707           code+namcond1_gfxbank*0x400,
708708           color,
709709           flipx,flipy,
r13798r13799
750750   finalclip.min_x = finalclip.min_y = 0;
751751   finalclip.max_x = screen.width() - 1;
752752   finalclip.max_y = screen.height() - 1;
753   finalclip &= *cliprect;
754   cliprect = &finalclip;
753   finalclip &= cliprect;
755754
756755   // punt if not initialized
757756   if (ygv608.page_x == 0 || ygv608.page_y == 0)
758757   {
759      bitmap->fill(0, *cliprect);
758      bitmap->fill(0, finalclip);
760759      return 0;
761760   }
762761
r13798r13799
808807      tilemap_set_scroll_cols( tilemap_B, ygv608.page_x );
809808
810809      // now clear the screen in case we change to 1-plane mode
811      work_bitmap->fill(0, *cliprect );
810      work_bitmap->fill(0, finalclip );
812811
813812      // reset resize flag
814813      ygv608.tilemap_resize = 0;
r13798r13799
861860   if ((ygv608.regs.s.r7 & r7_md) & MD_1PLANE)
862861   {
863862      // If the background tilemap is disabled, we need to clear the bitmap to black
864      work_bitmap->fill(0, *cliprect);
863      work_bitmap->fill(0, finalclip);
865864//      work_bitmap->fill(1, *visarea);
866865   }
867866   else
868867#endif
869      tilemap_draw( work_bitmap,cliprect, tilemap_B, 0, 0 );
868      tilemap_draw( work_bitmap,finalclip, tilemap_B, 0, 0 );
870869
871870#ifdef _ENABLE_ROTATE_ZOOM
872871
r13798r13799
882881  cos_theta = (double)ygv608.dx / (double)0x10000;
883882
884883  if( ygv608.regs.s.zron )
885    copyrozbitmap( bitmap, cliprect, work_bitmap,
884    copyrozbitmap( bitmap, finalclip, work_bitmap,
886885                   ( visarea.min_x << 16 ) +
887886                    ygv608.ax + 0x10000 * r *
888887                    ( -sin( alpha ) * cos_theta + cos( alpha ) * sin_theta ),
r13798r13799
892891                   ygv608.dx, ygv608.dxy, ygv608.dyx, ygv608.dy, 0);
893892  else
894893#endif
895    copybitmap( bitmap, work_bitmap, 0, 0, 0, 0, cliprect);
894    copybitmap( bitmap, work_bitmap, 0, 0, 0, 0, finalclip);
896895
897896  // for some reason we can't use an opaque tilemap_A
898897  // so use a transparent but clear the work bitmap first
r13798r13799
901900
902901   if ((ygv608.regs.s.r11 & r11_prm) == PRM_ASBDEX ||
903902      (ygv608.regs.s.r11 & r11_prm) == PRM_ASEBDX )
904      draw_sprites(screen.machine(), bitmap,cliprect );
903      draw_sprites(screen.machine(), bitmap,finalclip );
905904
906   tilemap_draw( work_bitmap,cliprect, tilemap_A, 0, 0 );
905   tilemap_draw( work_bitmap,finalclip, tilemap_A, 0, 0 );
907906
908907#ifdef _ENABLE_ROTATE_ZOOM
909908  if( ygv608.regs.s.zron )
910    copyrozbitmap_trans( bitmap, cliprect, work_bitmap,
909    copyrozbitmap_trans( bitmap, finalclip, work_bitmap,
911910                   ygv608.ax, // + ( visarea.min_x << 16 ),
912911                   ygv608.ay, // + ( visarea.min_y << 16 ),
913912                   ygv608.dx, ygv608.dxy, ygv608.dyx, ygv608.dy, 0,
914913                   0 );
915914  else
916915#endif
917    copybitmap_trans( bitmap, work_bitmap, 0, 0, 0, 0, cliprect, 0 );
916    copybitmap_trans( bitmap, work_bitmap, 0, 0, 0, 0, finalclip, 0 );
918917
919918   if ((ygv608.regs.s.r11 & r11_prm) == PRM_SABDEX ||
920919      (ygv608.regs.s.r11 & r11_prm) == PRM_SEABDX)
921      draw_sprites(screen.machine(), bitmap,cliprect );
920      draw_sprites(screen.machine(), bitmap,finalclip );
922921
923922
924923#ifdef _SHOW_VIDEO_DEBUG
src/mame/video/rampart.c
r13798r13799
1010#include "includes/rampart.h"
1111
1212
13static void rampart_bitmap_render(running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect);
13static void rampart_bitmap_render(running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect);
1414
1515/*************************************
1616 *
r13798r13799
109109 *
110110 *************************************/
111111
112static void rampart_bitmap_render(running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect)
112static void rampart_bitmap_render(running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect)
113113{
114114   rampart_state *state = machine.driver_data<rampart_state>();
115115   int x, y;
116116
117117   /* update any dirty scanlines */
118   for (y = cliprect->min_y; y <= cliprect->max_y; y++)
118   for (y = cliprect.min_y; y <= cliprect.max_y; y++)
119119   {
120120      const UINT16 *src = &state->m_bitmap[256 * y];
121121      UINT16 *dst = &bitmap->pix16(y);
122122
123123      /* regenerate the line */
124      for (x = cliprect->min_x & ~1; x <= cliprect->max_x; x += 2)
124      for (x = cliprect.min_x & ~1; x <= cliprect.max_x; x += 2)
125125      {
126126         int bits = src[(x - 8) / 2];
127127         dst[x + 0] = bits >> 8;
src/mame/video/stvvdp1.c
r13798r13799
705705   *ng2 = g2;
706706}
707707
708static void stv_vdp1_setup_shading(running_machine &machine,const struct spoint* q, const rectangle *cliprect)
708static void stv_vdp1_setup_shading(running_machine &machine,const struct spoint* q, const rectangle &cliprect)
709709{
710710   INT32 x1, x2, delta, cury, limy;
711711   INT32 r1, g1, b1, r2, g2, b2;
r13798r13799
865865
866866   for ( cury = stv_vdp1_shading_data->sy; cury <= stv_vdp1_shading_data->ey; cury++ )
867867   {
868      while( (stv_vdp1_shading_data->scanline[cury].x[0] >> 16) < cliprect->min_x )
868      while( (stv_vdp1_shading_data->scanline[cury].x[0] >> 16) < cliprect.min_x )
869869      {
870870         stv_vdp1_shading_data->scanline[cury].x[0] += (1 << FRAC_SHIFT);
871871         stv_vdp1_shading_data->scanline[cury].b[0] += stv_vdp1_shading_data->scanline[cury].db;
r13798r13799
11231123}
11241124
11251125
1126static void vdp1_fill_slope(running_machine &machine, const rectangle *cliprect, int patterndata, int xsize,
1126static void vdp1_fill_slope(running_machine &machine, const rectangle &cliprect, int patterndata, int xsize,
11271127                     INT32 x1, INT32 x2, INT32 sl1, INT32 sl2, INT32 *nx1, INT32 *nx2,
11281128                     INT32 u1, INT32 u2, INT32 slu1, INT32 slu2, INT32 *nu1, INT32 *nu2,
11291129                     INT32 v1, INT32 v2, INT32 slv1, INT32 slv2, INT32 *nv1, INT32 *nv2,
11301130                     INT32 _y1, INT32 y2)
11311131{
1132   if(_y1 > cliprect->max_y)
1132   if(_y1 > cliprect.max_y)
11331133      return;
11341134
1135   if(y2 <= cliprect->min_y) {
1135   if(y2 <= cliprect.min_y) {
11361136      int delta = y2-_y1;
11371137      *nx1 = x1+delta*sl1;
11381138      *nu1 = u1+delta*slu1;
r13798r13799
11431143      return;
11441144   }
11451145
1146   if(y2 > cliprect->max_y)
1147      y2 = cliprect->max_y+1;
1146   if(y2 > cliprect.max_y)
1147      y2 = cliprect.max_y+1;
11481148
1149   if(_y1 < cliprect->min_y) {
1150      int delta = cliprect->min_y - _y1;
1149   if(_y1 < cliprect.min_y) {
1150      int delta = cliprect.min_y - _y1;
11511151      x1 += delta*sl1;
11521152      u1 += delta*slu1;
11531153      v1 += delta*slv1;
11541154      x2 += delta*sl2;
11551155      u2 += delta*slu2;
11561156      v2 += delta*slv2;
1157      _y1 = cliprect->min_y;
1157      _y1 = cliprect.min_y;
11581158   }
11591159
11601160   if(x1 > x2 || (x1==x2 && sl1 > sl2)) {
r13798r13799
11911191   }
11921192
11931193   while(_y1 < y2) {
1194      if(_y1 >= cliprect->min_y) {
1194      if(_y1 >= cliprect.min_y) {
11951195         INT32 slux = 0, slvx = 0;
11961196         int xx1 = x1>>FRAC_SHIFT;
11971197         int xx2 = x2>>FRAC_SHIFT;
r13798r13799
12021202            slux = (u2-u1)/delta;
12031203            slvx = (v2-v1)/delta;
12041204         }
1205         if(xx1 <= cliprect->max_x || xx2 >= cliprect->min_x) {
1206            if(xx1 < cliprect->min_x) {
1207               int delta = cliprect->min_x-xx1;
1205         if(xx1 <= cliprect.max_x || xx2 >= cliprect.min_x) {
1206            if(xx1 < cliprect.min_x) {
1207               int delta = cliprect.min_x-xx1;
12081208               u += slux*delta;
12091209               v += slvx*delta;
1210               xx1 = cliprect->min_x;
1210               xx1 = cliprect.min_x;
12111211            }
1212            if(xx2 > cliprect->max_x)
1213               xx2 = cliprect->max_x;
1212            if(xx2 > cliprect.max_x)
1213               xx2 = cliprect.max_x;
12141214
12151215            while(xx1 <= xx2) {
12161216               drawpixel(machine,xx1,_y1,
r13798r13799
12391239   *nv2 = v2;
12401240}
12411241
1242static void vdp1_fill_line(running_machine &machine, const rectangle *cliprect, int patterndata, int xsize, INT32 y,
1242static void vdp1_fill_line(running_machine &machine, const rectangle &cliprect, int patterndata, int xsize, INT32 y,
12431243                     INT32 x1, INT32 x2, INT32 u1, INT32 u2, INT32 v1, INT32 v2)
12441244{
12451245   int xx1 = x1>>FRAC_SHIFT;
12461246   int xx2 = x2>>FRAC_SHIFT;
12471247
1248   if(y > cliprect->max_y || y < cliprect->min_y)
1248   if(y > cliprect.max_y || y < cliprect.min_y)
12491249      return;
12501250
1251   if(xx1 <= cliprect->max_x || xx2 >= cliprect->min_x) {
1251   if(xx1 <= cliprect.max_x || xx2 >= cliprect.min_x) {
12521252      INT32 slux = 0, slvx = 0;
12531253      INT32 u = u1;
12541254      INT32 v = v1;
r13798r13799
12571257         slux = (u2-u1)/delta;
12581258         slvx = (v2-v1)/delta;
12591259      }
1260      if(xx1 < cliprect->min_x) {
1261         int delta = cliprect->min_x-xx1;
1260      if(xx1 < cliprect.min_x) {
1261         int delta = cliprect.min_x-xx1;
12621262         u += slux*delta;
12631263         v += slvx*delta;
1264         xx1 = cliprect->min_x;
1264         xx1 = cliprect.min_x;
12651265      }
1266      if(xx2 > cliprect->max_x)
1267         xx2 = cliprect->max_x;
1266      if(xx2 > cliprect.max_x)
1267         xx2 = cliprect.max_x;
12681268
12691269      while(xx1 <= xx2) {
12701270         drawpixel(machine,xx1,y,
r13798r13799
12771277   }
12781278}
12791279
1280static void vdp1_fill_quad(running_machine &machine, const rectangle *cliprect, int patterndata, int xsize, const struct spoint *q)
1280static void vdp1_fill_quad(running_machine &machine, const rectangle &cliprect, int patterndata, int xsize, const struct spoint *q)
12811281{
12821282   INT32 sl1, sl2, slu1, slu2, slv1, slv2, cury, limy, x1, x2, u1, u2, v1, v2, delta;
12831283   int pmin, pmax, i, ps1, ps2;
r13798r13799
13211321      return;
13221322   }
13231323
1324   if(cury > cliprect->max_y)
1324   if(cury > cliprect.max_y)
13251325      return;
1326   if(limy <= cliprect->min_y)
1326   if(limy <= cliprect.min_y)
13271327      return;
13281328
1329   if(limy > cliprect->max_y)
1330      limy = cliprect->max_y;
1329   if(limy > cliprect.max_y)
1330      limy = cliprect.max_y;
13311331
13321332   ps1 = pmin+4;
13331333   ps2 = pmin;
r13798r13799
14281428   return (INT32)(INT16)v + state->m_vdp1.local_y;
14291429}
14301430
1431static void stv_vdp1_draw_line(running_machine &machine, const rectangle *cliprect)
1431static void stv_vdp1_draw_line(running_machine &machine, const rectangle &cliprect)
14321432{
14331433   struct spoint q[4];
14341434
r13798r13799
14471447   vdp1_fill_quad(machine, cliprect, 0, 1, q);
14481448}
14491449
1450static void stv_vdp1_draw_poly_line(running_machine &machine, const rectangle *cliprect)
1450static void stv_vdp1_draw_poly_line(running_machine &machine, const rectangle &cliprect)
14511451{
14521452   struct spoint q[4];
14531453
r13798r13799
15101510
15111511}
15121512
1513static void stv_vpd1_draw_distorted_sprite(running_machine &machine, const rectangle *cliprect)
1513static void stv_vpd1_draw_distorted_sprite(running_machine &machine, const rectangle &cliprect)
15141514{
15151515   struct spoint q[4];
15161516
r13798r13799
15681568   vdp1_fill_quad(machine, cliprect, patterndata, xsize, q);
15691569}
15701570
1571static void stv_vpd1_draw_scaled_sprite(running_machine &machine, const rectangle *cliprect)
1571static void stv_vpd1_draw_scaled_sprite(running_machine &machine, const rectangle &cliprect)
15721572{
15731573   struct spoint q[4];
15741574
r13798r13799
17161716}
17171717
17181718
1719static void stv_vpd1_draw_normal_sprite(running_machine &machine, const rectangle *cliprect, int sprite_type)
1719static void stv_vpd1_draw_normal_sprite(running_machine &machine, const rectangle &cliprect, int sprite_type)
17201720{
17211721   //UINT16 *destline;
17221722   //saturn_state *state = machine.driver_data<saturn_state>();
r13798r13799
17471747
17481748   if (VDP1_LOG) logerror ("Drawing Normal Sprite x %04x y %04x xsize %04x ysize %04x patterndata %06x\n",x,y,xsize,ysize,patterndata);
17491749
1750   if ( x > cliprect->max_x ) return;
1751   if ( y > cliprect->max_y ) return;
1750   if ( x > cliprect.max_x ) return;
1751   if ( y > cliprect.max_y ) return;
17521752
17531753   shading = stv_read_gouraud_table(machine);
17541754   if ( shading )
r13798r13799
17751775      duy = -xsize;
17761776      u += xsize*(ysize-1);
17771777   }
1778   if ( y < cliprect->min_y ) //clip y
1778   if ( y < cliprect.min_y ) //clip y
17791779   {
1780      u += xsize*(cliprect->min_y - y);
1781      ysize -= (cliprect->min_y - y);
1782      y = cliprect->min_y;
1780      u += xsize*(cliprect.min_y - y);
1781      ysize -= (cliprect.min_y - y);
1782      y = cliprect.min_y;
17831783   }
1784   if ( x < cliprect->min_x ) //clip x
1784   if ( x < cliprect.min_x ) //clip x
17851785   {
1786      u += dux*(cliprect->min_x - x);
1787      xsize -= (cliprect->min_x - x);
1788      x = cliprect->min_x;
1786      u += dux*(cliprect.min_x - x);
1787      xsize -= (cliprect.min_x - x);
1788      x = cliprect.min_x;
17891789   }
1790   maxdrawypos = MIN(y+ysize-1,cliprect->max_y);
1791   maxdrawxpos = MIN(x+xsize-1,cliprect->max_x);
1790   maxdrawypos = MIN(y+ysize-1,cliprect.max_y);
1791   maxdrawxpos = MIN(x+xsize-1,cliprect.max_x);
17921792   for (drawypos = y; drawypos <= maxdrawypos; drawypos++ )
17931793   {
17941794      //destline = state->m_vdp1.framebuffer_draw_lines[drawypos];
r13798r13799
19611961            case 0x0000:
19621962               if (VDP1_LOG) logerror ("Sprite List Normal Sprite (%d %d)\n",stv2_current_sprite.CMDXA,stv2_current_sprite.CMDYA);
19631963               stv2_current_sprite.ispoly = 0;
1964               stv_vpd1_draw_normal_sprite(machine, cliprect, 0);
1964               stv_vpd1_draw_normal_sprite(machine, *cliprect, 0);
19651965               break;
19661966
19671967            case 0x0001:
19681968               if (VDP1_LOG) logerror ("Sprite List Scaled Sprite (%d %d)\n",stv2_current_sprite.CMDXA,stv2_current_sprite.CMDYA);
19691969               stv2_current_sprite.ispoly = 0;
1970               stv_vpd1_draw_scaled_sprite(machine, cliprect);
1970               stv_vpd1_draw_scaled_sprite(machine, *cliprect);
19711971               break;
19721972
19731973            case 0x0002:
r13798r13799
19791979               if (VDP1_LOG) logerror ("CMDPMOD = %04x\n",stv2_current_sprite.CMDPMOD);
19801980
19811981               stv2_current_sprite.ispoly = 0;
1982               stv_vpd1_draw_distorted_sprite(machine, cliprect);
1982               stv_vpd1_draw_distorted_sprite(machine, *cliprect);
19831983               break;
19841984
19851985            case 0x0004:
19861986               if (VDP1_LOG) logerror ("Sprite List Polygon\n");
19871987               stv2_current_sprite.ispoly = 1;
1988               stv_vpd1_draw_distorted_sprite(machine, cliprect);
1988               stv_vpd1_draw_distorted_sprite(machine, *cliprect);
19891989               break;
19901990
19911991            case 0x0005:
19921992               if (VDP1_LOG) logerror ("Sprite List Polyline\n");
19931993               stv2_current_sprite.ispoly = 1;
1994               stv_vdp1_draw_poly_line(machine, cliprect);
1994               stv_vdp1_draw_poly_line(machine, *cliprect);
19951995               break;
19961996
19971997            case 0x0006:
19981998               if (VDP1_LOG) logerror ("Sprite List Line\n");
19991999               stv2_current_sprite.ispoly = 1;
2000               stv_vdp1_draw_line(machine, cliprect);
2000               stv_vdp1_draw_line(machine, *cliprect);
20012001               break;
20022002
20032003            case 0x0008:
src/mame/video/senjyo.c
r13798r13799
175175
176176***************************************************************************/
177177
178static void draw_bgbitmap(running_machine &machine, bitmap_t *bitmap,const rectangle *cliprect)
178static void draw_bgbitmap(running_machine &machine, bitmap_t *bitmap,const rectangle &cliprect)
179179{
180180   senjyo_state *state = machine.driver_data<senjyo_state>();
181181   int x,y,pen,strwid,count;
182182
183183
184184   if (state->m_bgstripes == 0xff)   /* off */
185      bitmap->fill(0, *cliprect);
185      bitmap->fill(0, cliprect);
186186   else
187187   {
188188      int flip = flip_screen_get(machine);
r13798r13799
212212   }
213213}
214214
215static void draw_radar(running_machine &machine,bitmap_t *bitmap,const rectangle *cliprect)
215static void draw_radar(running_machine &machine,bitmap_t *bitmap,const rectangle &cliprect)
216216{
217217   senjyo_state *state = machine.driver_data<senjyo_state>();
218218   int offs,x;
r13798r13799
232232               sy = 255 - sy;
233233            }
234234
235            if (sy >= cliprect->min_y && sy <= cliprect->max_y &&
236               sx >= cliprect->min_x && sx <= cliprect->max_x)
235            if (sy >= cliprect.min_y && sy <= cliprect.max_y &&
236               sx >= cliprect.min_x && sx <= cliprect.max_x)
237237               bitmap->pix16(sy, sx) = offs < 0x200 ? 512 : 513;
238238         }
239239}
240240
241static void draw_sprites(running_machine &machine, bitmap_t *bitmap,const rectangle *cliprect,int priority)
241static void draw_sprites(running_machine &machine, bitmap_t *bitmap,const rectangle &cliprect,int priority)
242242{
243243   senjyo_state *state = machine.driver_data<senjyo_state>();
244244   UINT8 *spriteram = state->m_spriteram;
src/mame/video/yiear.c
r13798r13799
105105   state->m_bg_tilemap = tilemap_create(machine, get_bg_tile_info, tilemap_scan_rows, 8, 8, 32, 32);
106106}
107107
108static void draw_sprites( running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect )
108static void draw_sprites( running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect )
109109{
110110   yiear_state *state = machine.driver_data<yiear_state>();
111111   UINT8 *spriteram = state->m_spriteram;
src/mame/video/segaxbd.c
r13798r13799
4141   /* if no drawing is happening, fill with black and get out */
4242   if (!segaic16_display_enable)
4343   {
44      bitmap->fill(get_black_pen(screen.machine()), *cliprect);
44      bitmap->fill(get_black_pen(screen.machine()), cliprect);
4545      return 0;
4646   }
4747
4848   /* reset priorities */
49   screen.machine().priority_bitmap->fill(0, *cliprect);
49   screen.machine().priority_bitmap->fill(0, cliprect);
5050
5151   /* draw the low priority road layer */
5252   segaic16_road_draw(0, bitmap, cliprect, SEGAIC16_ROAD_BACKGROUND);
src/mame/video/sonson.c
r13798r13799
140140   tilemap_set_scroll_rows(state->m_bg_tilemap, 32);
141141}
142142
143static void draw_sprites( running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect )
143static void draw_sprites( running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect )
144144{
145145   sonson_state *state = machine.driver_data<sonson_state>();
146146   UINT8 *spriteram = state->m_spriteram;
src/mame/video/sslam.c
r13798r13799
2222   palette_set_color_rgb(space->machine(), offset, pal5bit(r), pal5bit(g), pal5bit(b));
2323}
2424
25static void draw_sprites(running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect)
25static void draw_sprites(running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect)
2626{
2727   sslam_state *state = machine.driver_data<sslam_state>();
2828   const gfx_element *gfx = machine.gfx[0];
r13798r13799
197197
198198   if (!(state->m_regs[6] & 1))
199199   {
200      bitmap->fill(get_black_pen(screen.machine()), *cliprect);
200      bitmap->fill(get_black_pen(screen.machine()), cliprect);
201201      return 0;
202202   }
203203
r13798r13799
214214   if (state->m_regs[2]+2 > 0x8c8)
215215   {
216216      rectangle md_clip;
217      md_clip.min_x = cliprect->min_x;
218      md_clip.max_x = cliprect->max_x - (state->m_regs[2]+2 - 0x8c8);
219      md_clip.min_y = cliprect->min_y;
220      md_clip.max_y = cliprect->max_y;
217      md_clip.min_x = cliprect.min_x;
218      md_clip.max_x = cliprect.max_x - (state->m_regs[2]+2 - 0x8c8);
219      md_clip.min_y = cliprect.min_y;
220      md_clip.max_y = cliprect.max_y;
221221
222      tilemap_draw(bitmap,&md_clip,state->m_md_tilemap,0,0);
222      tilemap_draw(bitmap,md_clip,state->m_md_tilemap,0,0);
223223   }
224224   else
225225   {
r13798r13799
237237
238238   if (!(state->m_regs[6] & 1))
239239   {
240      bitmap->fill(get_black_pen(screen.machine()), *cliprect);
240      bitmap->fill(get_black_pen(screen.machine()), cliprect);
241241      return 0;
242242   }
243243
src/mame/video/simpl156.c
r13798r13799
3333
3434   deco16ic_pf_update(state->m_deco_tilegen1, state->m_pf1_rowscroll, state->m_pf2_rowscroll);
3535
36   bitmap->fill(256, *cliprect);
36   bitmap->fill(256, cliprect);
3737
3838   deco16ic_tilemap_2_draw(state->m_deco_tilegen1, bitmap, cliprect, 0, 2);
3939   deco16ic_tilemap_1_draw(state->m_deco_tilegen1, bitmap, cliprect, 0, 4);
src/mame/video/hcastle.c
r13798r13799
210210
211211/*****************************************************************************/
212212
213static void draw_sprites(running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect, UINT8 *sbank, int bank )
213static void draw_sprites(running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect, UINT8 *sbank, int bank )
214214{
215215   hcastle_state *state = machine.driver_data<hcastle_state>();
216216   device_t *k007121 = bank ? state->m_k007121_2 : state->m_k007121_1;
src/mame/video/deadang.c
r13798r13799
8787   tilemap_set_transparent_pen(state->m_text_layer, 15);
8888}
8989
90static void draw_sprites(running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect)
90static void draw_sprites(running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect)
9191{
9292   deadang_state *state = machine.driver_data<deadang_state>();
9393   UINT16 *spriteram16 = state->m_spriteram;
r13798r13799
156156   tilemap_set_enable(state->m_pf2_layer,!(state->m_scroll_ram[0x34]&4));
157157   flip_screen_set(screen.machine(),  state->m_scroll_ram[0x34]&0x40 );
158158
159   bitmap->fill(get_black_pen(screen.machine()), *cliprect);
160   screen.machine().priority_bitmap->fill(0, *cliprect);
159   bitmap->fill(get_black_pen(screen.machine()), cliprect);
160   screen.machine().priority_bitmap->fill(0, cliprect);
161161   tilemap_draw(bitmap,cliprect,state->m_pf3_layer,0,1);
162162   tilemap_draw(bitmap,cliprect,state->m_pf1_layer,0,2);
163163   tilemap_draw(bitmap,cliprect,state->m_pf2_layer,0,4);
src/mame/video/copsnrob.c
r13798r13799
121121      {
122122         if (val & mask1)
123123         {
124            for (y = cliprect->min_y; y <= cliprect->max_y; y++)
124            for (y = cliprect.min_y; y <= cliprect.max_y; y++)
125125               if (state->m_bulletsram[y] & mask2)
126126                  bitmap->pix16(y, 256 - x) = 1;
127127         }
src/mame/video/twincobr.c
r13798r13799
458458    Sprite Handlers
459459***************************************************************************/
460460
461static void draw_sprites(running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect, int priority )
461static void draw_sprites(running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect, int priority )
462462{
463463   twincobr_state *state = machine.driver_data<twincobr_state>();
464464   int offs;
r13798r13799
504504
505505   if (state->m_wardner_sprite_hack) wardner_sprite_priority_hack(screen.machine());
506506
507   bitmap->fill(0, *cliprect);
507   bitmap->fill(0, cliprect);
508508
509509   tilemap_draw(bitmap,cliprect,state->m_bg_tilemap,TILEMAP_DRAW_OPAQUE,0);
510510   draw_sprites(screen.machine(), bitmap,cliprect,0x0400);
src/mame/video/bking.c
r13798r13799
293293      xld = state->m_xld1;
294294      yld = state->m_yld1;
295295
296      drawgfx_opaque(state->m_tmp_bitmap2, &rect, screen.machine().gfx[2],
296      drawgfx_opaque(state->m_tmp_bitmap2, rect, screen.machine().gfx[2],
297297         state->m_ball1_pic,
298298         0,
299299         0, 0,
r13798r13799
307307      xld = state->m_xld2;
308308      yld = state->m_yld2;
309309
310      drawgfx_opaque(state->m_tmp_bitmap2, &rect, screen.machine().gfx[3],
310      drawgfx_opaque(state->m_tmp_bitmap2, rect, screen.machine().gfx[3],
311311         state->m_ball2_pic,
312312         0,
313313         0, 0,
r13798r13799
319319   tilemap_set_scrollx(state->m_bg_tilemap, 0, flip_screen_get(screen.machine()) ? -xld : xld);
320320   tilemap_set_scrolly(state->m_bg_tilemap, 0, flip_screen_get(screen.machine()) ? -yld : yld);
321321
322   tilemap_draw(state->m_tmp_bitmap1, &rect, state->m_bg_tilemap, 0, 0);
322   tilemap_draw(state->m_tmp_bitmap1, rect, state->m_bg_tilemap, 0, 0);
323323
324324   tilemap_set_scrollx(state->m_bg_tilemap, 0, 0);
325325   tilemap_set_scrolly(state->m_bg_tilemap, 0, 0);
src/mame/video/galpani2.c
r13798r13799
158158}
159159#endif
160160
161   bitmap->fill(0, *cliprect);
162   screen.machine().priority_bitmap->fill(0, *cliprect);
161   bitmap->fill(0, cliprect);
162   screen.machine().priority_bitmap->fill(0, cliprect);
163163
164164   if (layers_ctrl & 0x1)
165165   {
src/mame/video/labyrunr.c
r13798r13799
188188
189189   set_pens(screen.machine());
190190
191   screen.machine().priority_bitmap->fill(0, *cliprect);
192   bitmap->fill(get_black_pen(screen.machine()), *cliprect);
191   screen.machine().priority_bitmap->fill(0, cliprect);
192   bitmap->fill(get_black_pen(screen.machine()), cliprect);
193193
194194   if (~k007121_ctrlram_r(state->m_k007121, 3) & 0x20)
195195   {
r13798r13799
198198      finalclip0 = state->m_clip0;
199199      finalclip1 = state->m_clip1;
200200
201      finalclip0 &= *cliprect;
202      finalclip1 &= *cliprect;
201      finalclip0 &= cliprect;
202      finalclip1 &= cliprect;
203203
204204      tilemap_set_scrollx(state->m_layer0, 0, ctrl_0 - 40);
205205      tilemap_set_scrollx(state->m_layer1, 0, 0);
r13798r13799
213213            tilemap_set_scrolly(state->m_layer0, (i + 2) & 0x1f, k007121_ctrlram_r(state->m_k007121, 2));
214214      }
215215
216      tilemap_draw(bitmap, &finalclip0, state->m_layer0, TILEMAP_DRAW_OPAQUE, 0);
216      tilemap_draw(bitmap, finalclip0, state->m_layer0, TILEMAP_DRAW_OPAQUE, 0);
217217      k007121_sprites_draw(state->m_k007121, bitmap, cliprect, screen.machine().gfx[0], screen.machine().colortable, state->m_spriteram,(k007121_ctrlram_r(state->m_k007121, 6) & 0x30) * 2, 40,0,(k007121_ctrlram_r(state->m_k007121, 3) & 0x40) >> 5);
218218      /* we ignore the transparency because layer1 is drawn only at the top of the screen also covering sprites */
219      tilemap_draw(bitmap, &finalclip1, state->m_layer1, TILEMAP_DRAW_OPAQUE, 0);
219      tilemap_draw(bitmap, finalclip1, state->m_layer1, TILEMAP_DRAW_OPAQUE, 0);
220220   }
221221   else
222222   {
r13798r13799
224224      rectangle finalclip3;
225225
226226      /* custom cliprects needed for the weird effect used in the endinq sequence to hide and show the needed part of text */
227      finalclip0.min_y = finalclip1.min_y = cliprect->min_y;
228      finalclip0.max_y = finalclip1.max_y = cliprect->max_y;
227      finalclip0.min_y = finalclip1.min_y = cliprect.min_y;
228      finalclip0.max_y = finalclip1.max_y = cliprect.max_y;
229229
230230      if(k007121_ctrlram_r(state->m_k007121, 1) & 1)
231231      {
232         finalclip0.min_x = cliprect->max_x - ctrl_0 + 8;
233         finalclip0.max_x = cliprect->max_x;
232         finalclip0.min_x = cliprect.max_x - ctrl_0 + 8;
233         finalclip0.max_x = cliprect.max_x;
234234
235235         if(ctrl_0 >= 40)
236236         {
237            finalclip1.min_x = cliprect->min_x;
237            finalclip1.min_x = cliprect.min_x;
238238         }
239239         else
240240         {
r13798r13799
243243            finalclip1.min_x = 40 - ctrl_0;
244244         }
245245
246         finalclip1.max_x = cliprect->max_x - ctrl_0 + 8;
246         finalclip1.max_x = cliprect.max_x - ctrl_0 + 8;
247247
248248      }
249249      else
250250      {
251251         if(ctrl_0 >= 40)
252252         {
253            finalclip0.min_x = cliprect->min_x;
253            finalclip0.min_x = cliprect.min_x;
254254         }
255255         else
256256         {
r13798r13799
259259            finalclip0.min_x = 40 - ctrl_0;
260260         }
261261
262         finalclip0.max_x = cliprect->max_x - ctrl_0 + 8;
262         finalclip0.max_x = cliprect.max_x - ctrl_0 + 8;
263263
264         finalclip1.min_x = cliprect->max_x - ctrl_0 + 8;
265         finalclip1.max_x = cliprect->max_x;
264         finalclip1.min_x = cliprect.max_x - ctrl_0 + 8;
265         finalclip1.max_x = cliprect.max_x;
266266      }
267267
268268      if(use_clip3[0] || use_clip3[1])
269269      {
270         finalclip3.min_y = cliprect->min_y;
271         finalclip3.max_y = cliprect->max_y;
272         finalclip3.min_x = cliprect->min_x;
270         finalclip3.min_y = cliprect.min_y;
271         finalclip3.max_y = cliprect.max_y;
272         finalclip3.min_x = cliprect.min_x;
273273         finalclip3.max_x = 40 - ctrl_0 - 8;
274274      }
275275
276276      tilemap_set_scrollx(state->m_layer0, 0, ctrl_0 - 40);
277277      tilemap_set_scrollx(state->m_layer1, 0, ctrl_0 - 40);
278278
279      tilemap_draw(bitmap, &finalclip0, state->m_layer0, 0, 1);
279      tilemap_draw(bitmap, finalclip0, state->m_layer0, 0, 1);
280280      if(use_clip3[0])
281         tilemap_draw(bitmap, &finalclip3, state->m_layer0, 0, 1);
281         tilemap_draw(bitmap, finalclip3, state->m_layer0, 0, 1);
282282
283      tilemap_draw(bitmap, &finalclip1, state->m_layer1, 0, 1);
283      tilemap_draw(bitmap, finalclip1, state->m_layer1, 0, 1);
284284      if(use_clip3[1])
285         tilemap_draw(bitmap, &finalclip3, state->m_layer1, 0, 1);
285         tilemap_draw(bitmap, finalclip3, state->m_layer1, 0, 1);
286286
287287      k007121_sprites_draw(state->m_k007121, bitmap, cliprect, screen.machine().gfx[0], screen.machine().colortable, state->m_spriteram, (k007121_ctrlram_r(state->m_k007121, 6) & 0x30) * 2,40,0,(k007121_ctrlram_r(state->m_k007121, 3) & 0x40) >> 5);
288288   }
src/mame/video/taito_o.c
r13798r13799
2525};
2626
2727
28static void parentj_draw_sprites( running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect, int priority )
28static void parentj_draw_sprites( running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect, int priority )
2929{
3030   /* Y chain size is 16/32?/64/64? pixels. X chain size
3131       is always 64 pixels. */
r13798r13799
144144
145145   tc0080vco_tilemap_update(state->m_tc0080vco);
146146
147   bitmap->fill(0, *cliprect);
147   bitmap->fill(0, cliprect);
148148
149149   tc0080vco_tilemap_draw(state->m_tc0080vco, bitmap, cliprect, 0, TILEMAP_DRAW_OPAQUE, 0);
150150
src/mame/video/thief.c
r13798r13799
116116
117117   if (tms9927_screen_reset(screen.machine().device("tms")))
118118   {
119      bitmap->fill(get_black_pen(screen.machine()), *cliprect);
119      bitmap->fill(get_black_pen(screen.machine()), cliprect);
120120      return 0;
121121   }
122122
src/mame/video/ccastles.c
r13798r13799
274274   int x, y, offs;
275275
276276   /* draw the sprites */
277   state->m_spritebitmap->fill(0x0f, *cliprect);
277   state->m_spritebitmap->fill(0x0f, cliprect);
278278   for (offs = 0; offs < 320/2; offs += 4)
279279   {
280280      int x = spriteaddr[offs + 3];
r13798r13799
286286   }
287287
288288   /* draw the bitmap to the screen, looping over Y */
289   for (y = cliprect->min_y; y <= cliprect->max_y; y++)
289   for (y = cliprect.min_y; y <= cliprect.max_y; y++)
290290   {
291291      UINT16 *dst = &bitmap->pix16(y);
292292
293293      /* if we're in the VBLANK region, just fill with black */
294294      if (state->m_syncprom[y] & 1)
295295      {
296         for (x = cliprect->min_x; x <= cliprect->max_x; x++)
296         for (x = cliprect.min_x; x <= cliprect.max_x; x++)
297297            dst[x] = black;
298298      }
299299
r13798r13799
310310         src = &state->m_videoram[effy * 128];
311311
312312         /* loop over X */
313         for (x = cliprect->min_x; x <= cliprect->max_x; x++)
313         for (x = cliprect.min_x; x <= cliprect.max_x; x++)
314314         {
315315            /* if we're in the HBLANK region, just store black */
316316            if (x >= 256)
src/mame/video/ddragon3.c
r13798r13799
116116 *   6,7| unused
117117 */
118118
119static void draw_sprites( running_machine& machine, bitmap_t *bitmap, const rectangle *cliprect )
119static void draw_sprites( running_machine& machine, bitmap_t *bitmap, const rectangle &cliprect )
120120{
121121   ddragon3_state *state = machine.driver_data<ddragon3_state>();
122122   UINT16 *source = state->m_spriteram;
src/mame/video/sprint2.c
r13798r13799
8484}
8585
8686
87static UINT8 collision_check(sprint2_state *state, colortable_t *colortable, rectangle* rect)
87static UINT8 collision_check(sprint2_state *state, colortable_t *colortable, rectangle& rect)
8888{
8989   UINT8 data = 0;
9090
9191   int x;
9292   int y;
9393
94   for (y = rect->min_y; y <= rect->max_y; y++)
95      for (x = rect->min_x; x <= rect->max_x; x++)
94   for (y = rect.min_y; y <= rect.max_y; y++)
95      for (x = rect.min_x; x <= rect.max_x; x++)
9696      {
9797         UINT16 a = colortable_entry_get_value(colortable, state->m_helper->pix16(y, x));
9898
r13798r13799
180180
181181      /* check for sprite-tilemap collisions */
182182
183      tilemap_draw(state->m_helper, &rect, state->m_bg_tilemap, 0, 0);
183      tilemap_draw(state->m_helper, rect, state->m_bg_tilemap, 0, 0);
184184
185      drawgfx_transpen(state->m_helper, &rect, screen.machine().gfx[1],
185      drawgfx_transpen(state->m_helper, rect, screen.machine().gfx[1],
186186         get_sprite_code(video_ram, i),
187187         0,
188188         0, 0,
189189         get_sprite_x(video_ram, i),
190190         get_sprite_y(video_ram, i), 1);
191191
192      state->m_collision[i] |= collision_check(state, screen.machine().colortable, &rect);
192      state->m_collision[i] |= collision_check(state, screen.machine().colortable, rect);
193193
194194      /* check for sprite-sprite collisions */
195195
196196      for (j = 0; j < 4; j++)
197197         if (j != i)
198198         {
199            drawgfx_transpen(state->m_helper, &rect, screen.machine().gfx[1],
199            drawgfx_transpen(state->m_helper, rect, screen.machine().gfx[1],
200200               get_sprite_code(video_ram, j),
201201               1,
202202               0, 0,
r13798r13799
204204               get_sprite_y(video_ram, j), 0);
205205         }
206206
207      drawgfx_transpen(state->m_helper, &rect, screen.machine().gfx[1],
207      drawgfx_transpen(state->m_helper, rect, screen.machine().gfx[1],
208208         get_sprite_code(video_ram, i),
209209         0,
210210         0, 0,
211211         get_sprite_x(video_ram, i),
212212         get_sprite_y(video_ram, i), 1);
213213
214      state->m_collision[i] |= collision_check(state, screen.machine().colortable, &rect);
214      state->m_collision[i] |= collision_check(state, screen.machine().colortable, rect);
215215   }
216216}
src/mame/video/decbac06.c
r13798r13799
192192
193193void deco_bac06_device::custom_tilemap_draw(running_machine &machine,
194194                        bitmap_t *bitmap,
195                        const rectangle *cliprect,
195                        const rectangle &cliprect,
196196                        tilemap_t *tilemap_ptr,
197197                        const UINT16 *rowscroll_ptr,
198198                        const UINT16 *colscroll_ptr,
r13798r13799
258258   else
259259      src_y = scrolly;
260260
261   for (y=0; y<=cliprect->max_y; y++) {
261   for (y=0; y<=cliprect.max_y; y++) {
262262      if (row_scroll_enabled)
263263         src_x=scrollx + rowscroll_ptr[(src_y >> (control1[3]&0xf))&(0x1ff>>(control1[3]&0xf))];
264264      else
r13798r13799
267267      if (flip_screen_get(machine))
268268         src_x=(src_bitmap->width() - 256) - src_x;
269269
270      for (x=0; x<=cliprect->max_x; x++) {
270      for (x=0; x<=cliprect.max_x; x++) {
271271         if (col_scroll_enabled)
272272            column_offset=colscroll_ptr[((src_x >> 3) >> (control1[2]&0xf))&(0x3f>>(control1[2]&0xf))];
273273
r13798r13799
288288   }
289289}
290290
291void deco_bac06_device::deco_bac06_pf_draw(running_machine &machine,bitmap_t *bitmap,const rectangle *cliprect,int flags,UINT16 penmask, UINT16 pencondition,UINT16 colprimask, UINT16 colpricondition)
291void deco_bac06_device::deco_bac06_pf_draw(running_machine &machine,bitmap_t *bitmap,const rectangle &cliprect,int flags,UINT16 penmask, UINT16 pencondition,UINT16 colprimask, UINT16 colpricondition)
292292{
293293   tilemap_t* tm = 0;
294294
r13798r13799
322322}
323323
324324// used for pocket gal bootleg, which doesn't set registers properly and simply expects a fixed size tilemap.
325void deco_bac06_device::deco_bac06_pf_draw_bootleg(running_machine &machine,bitmap_t *bitmap,const rectangle *cliprect,int flags, int mode, int type)
325void deco_bac06_device::deco_bac06_pf_draw_bootleg(running_machine &machine,bitmap_t *bitmap,const rectangle &cliprect,int flags, int mode, int type)
326326{
327327   tilemap_t* tm = 0;
328328   if (!mode) tm = pf8x8_tilemap[type];
src/mame/video/dragrace.c
r13798r13799
5656
5757   for (y = 0; y < 256; y += 4)
5858   {
59      rectangle rect = *cliprect;
59      rectangle rect = cliprect;
6060
6161      int xl = state->m_position_ram[y + 0] & 15;
6262      int xh = state->m_position_ram[y + 1] & 15;
r13798r13799
6969      if (rect.min_y < y + 0) rect.min_y = y + 0;
7070      if (rect.max_y > y + 3) rect.max_y = y + 3;
7171
72      tilemap_draw(bitmap, &rect, state->m_bg_tilemap, 0, 0);
72      tilemap_draw(bitmap, rect, state->m_bg_tilemap, 0, 0);
7373   }
7474   return 0;
7575}
src/mame/video/decbac06.h
r13798r13799
2121   UINT16 pf_control_0[8];
2222   UINT16 pf_control_1[8];
2323
24   void deco_bac06_pf_draw(running_machine &machine,bitmap_t *bitmap,const rectangle *cliprect,int flags,UINT16 penmask, UINT16 pencondition,UINT16 colprimask, UINT16 colpricondition);
25   void deco_bac06_pf_draw_bootleg(running_machine &machine,bitmap_t *bitmap,const rectangle *cliprect,int flags, int mode, int type);
24   void deco_bac06_pf_draw(running_machine &machine,bitmap_t *bitmap,const rectangle &cliprect,int flags,UINT16 penmask, UINT16 pencondition,UINT16 colprimask, UINT16 colpricondition);
25   void deco_bac06_pf_draw_bootleg(running_machine &machine,bitmap_t *bitmap,const rectangle &cliprect,int flags, int mode, int type);
2626
2727   UINT8 get_flip_state(void) { return pf_control_0[0]&0x80; };
2828   void set_colmask(int data) { m_gfxcolmask = data; }
r13798r13799
4343
4444   void custom_tilemap_draw(running_machine &machine,
4545                     bitmap_t *bitmap,
46                     const rectangle *cliprect,
46                     const rectangle &cliprect,
4747                     tilemap_t *tilemap_ptr,
4848                     const UINT16 *rowscroll_ptr,
4949                     const UINT16 *colscroll_ptr,
src/mame/video/orbit.c
r13798r13799
3737}
3838
3939
40static void draw_sprites( running_machine &machine, bitmap_t* bitmap, const rectangle* cliprect )
40static void draw_sprites( running_machine &machine, bitmap_t* bitmap, const rectangle &cliprect )
4141{
4242   orbit_state *state = machine.driver_data<orbit_state>();
4343   const UINT8* p = state->m_sprite_ram;
src/mame/video/ambush.c
r13798r13799
4747}
4848
4949
50static void draw_chars( running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect, int priority )
50static void draw_chars( running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect, int priority )
5151{
5252   ambush_state *state = machine.driver_data<ambush_state>();
5353   int offs, transpen;
r13798r13799
9292   ambush_state *state = screen.machine().driver_data<ambush_state>();
9393   int offs;
9494
95   bitmap->fill(0, *cliprect);
95   bitmap->fill(0, cliprect);
9696
9797   /* Draw the characters */
9898   draw_chars(screen.machine(), bitmap, cliprect, 0x00);
src/mame/video/policetr.c
r13798r13799
351351SCREEN_UPDATE( policetr )
352352{
353353   policetr_state *state = screen.machine().driver_data<policetr_state>();
354   int width = cliprect->max_x - cliprect->min_x + 1;
354   int width = cliprect.max_x - cliprect.min_x + 1;
355355   int y;
356356
357357   /* render all the scanlines from the dstbitmap to MAME's bitmap */
358   for (y = cliprect->min_y; y <= cliprect->max_y; y++)
359      draw_scanline8(bitmap, cliprect->min_x, y, width, &state->m_dstbitmap[DSTBITMAP_WIDTH * y + cliprect->min_x], NULL);
358   for (y = cliprect.min_y; y <= cliprect.max_y; y++)
359      draw_scanline8(bitmap, cliprect.min_x, y, width, &state->m_dstbitmap[DSTBITMAP_WIDTH * y + cliprect.min_x], NULL);
360360
361361   return 0;
362362}
src/mame/video/seibuspi.c
r13798r13799
218218   COMBINE_DATA( &state->m_video_dma_address );
219219}
220220
221static void drawgfx_blend(bitmap_t *bitmap, const rectangle *cliprect, const gfx_element *gfx, UINT32 code, UINT32 color, int flipx, int flipy, int sx, int sy)
221static void drawgfx_blend(bitmap_t *bitmap, const rectangle &cliprect, const gfx_element *gfx, UINT32 code, UINT32 color, int flipx, int flipy, int sx, int sy)
222222{
223223   seibuspi_state *state = gfx->machine().driver_data<seibuspi_state>();
224224   const pen_t *pens = &gfx->machine().pens[gfx->color_base];
r13798r13799
237237   y1 = sy;
238238   y2 = sy + height - 1;
239239
240   if (x1 > cliprect->max_x || x2 < cliprect->min_x)
240   if (x1 > cliprect.max_x || x2 < cliprect.min_x)
241241   {
242242      return;
243243   }
244   if (y1 > cliprect->max_y || y2 < cliprect->min_y)
244   if (y1 > cliprect.max_y || y2 < cliprect.min_y)
245245   {
246246      return;
247247   }
r13798r13799
261261   }
262262
263263   // clip x
264   if (x1 < cliprect->min_x)
264   if (x1 < cliprect.min_x)
265265   {
266266      if (flipx)
267267      {
268         px = width - (cliprect->min_x - x1) - 1;
268         px = width - (cliprect.min_x - x1) - 1;
269269      }
270270      else
271271      {
272         px = (cliprect->min_x - x1);
272         px = (cliprect.min_x - x1);
273273      }
274      x1 = cliprect->min_x;
274      x1 = cliprect.min_x;
275275   }
276   if (x2 > cliprect->max_x)
276   if (x2 > cliprect.max_x)
277277   {
278      x2 = cliprect->max_x;
278      x2 = cliprect.max_x;
279279   }
280280
281281   // clip y
282   if (y1 < cliprect->min_y)
282   if (y1 < cliprect.min_y)
283283   {
284284      if (flipy)
285285      {
286         py = height - (cliprect->min_y - y1) - 1;
286         py = height - (cliprect.min_y - y1) - 1;
287287      }
288288      else
289289      {
290         py = (cliprect->min_y - y1);
290         py = (cliprect.min_y - y1);
291291      }
292      y1 = cliprect->min_y;
292      y1 = cliprect.min_y;
293293   }
294   if (y2 > cliprect->max_y)
294   if (y2 > cliprect.max_y)
295295   {
296      y2 = cliprect->max_y;
296      y2 = cliprect.max_y;
297297   }
298298
299299   if (gfx->total_elements <= 0x10000)
r13798r13799
343343   { 7*16, 6*16, 5*16, 4*16, 3*16, 2*16, 1*16, 0*16 }
344344};
345345
346static void draw_sprites(running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect, int pri_mask)
346static void draw_sprites(running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect, int pri_mask)
347347{
348348   seibuspi_state *state = machine.driver_data<seibuspi_state>();
349349   INT16 xpos, ypos;
r13798r13799
558558#endif
559559
560560
561static void combine_tilemap(running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect, tilemap_t *tile, int x, int y, int opaque, INT16 *rowscroll)
561static void combine_tilemap(running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect, tilemap_t *tile, int x, int y, int opaque, INT16 *rowscroll)
562562{
563563   seibuspi_state *state = machine.driver_data<seibuspi_state>();
564564   int i,j;
r13798r13799
574574   xscroll_mask = pen_bitmap->width() - 1;
575575   yscroll_mask = pen_bitmap->height() - 1;
576576
577   for (j=cliprect->min_y; j <= cliprect->max_y; j++)
577   for (j=cliprect.min_y; j <= cliprect.max_y; j++)
578578   {
579579      int rx = x;
580580      if (rowscroll)
r13798r13799
585585      d = &bitmap->pix32(j);
586586      s = &pen_bitmap->pix16((j+y) & yscroll_mask);
587587      t = &flags_bitmap->pix8((j+y) & yscroll_mask);
588      for (i=cliprect->min_x+rx; i <= cliprect->max_x+rx; i++)
588      for (i=cliprect.min_x+rx; i <= cliprect.max_x+rx; i++)
589589      {
590590         if (opaque || (t[i & xscroll_mask] & (TILEMAP_PIXEL_LAYER0 | TILEMAP_PIXEL_LAYER1)))
591591         {
r13798r13799
622622   }
623623
624624   if( state->m_layer_enable & 0x1 )
625      bitmap->fill(0, *cliprect);
625      bitmap->fill(0, cliprect);
626626
627627   if (!(state->m_layer_enable & 0x1))
628628      combine_tilemap(screen.machine(), bitmap, cliprect, state->m_back_layer, state->m_spi_scrollram[0] & 0xffff, (state->m_spi_scrollram[0] >> 16) & 0xffff, 1, back_rowscroll);
r13798r13799
672672
673673SCREEN_UPDATE( sys386f2 )
674674{
675   bitmap->fill(0, *cliprect);
675   bitmap->fill(0, cliprect);
676676   draw_sprites(screen.machine(), bitmap, cliprect, 0);
677677   draw_sprites(screen.machine(), bitmap, cliprect, 1);
678678   draw_sprites(screen.machine(), bitmap, cliprect, 2);
src/mame/video/sauro.c
r13798r13799
106106   state->m_palette_bank = 0;
107107}
108108
109static void sauro_draw_sprites(running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect)
109static void sauro_draw_sprites(running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect)
110110{
111111   sauro_state *state = machine.driver_data<sauro_state>();
112112   UINT8 *spriteram = state->m_spriteram;
r13798r13799
174174       8, 8, 32, 32);
175175}
176176
177static void trckydoc_draw_sprites(running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect)
177static void trckydoc_draw_sprites(running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect)
178178{
179179   sauro_state *state = machine.driver_data<sauro_state>();
180180   UINT8 *spriteram = state->m_spriteram;
src/mame/video/gaplus.c
r13798r13799
253253   }
254254}
255255
256static void draw_sprites(running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect )
256static void draw_sprites(running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect )
257257{
258258   gaplus_state *state = machine.driver_data<gaplus_state>();
259259   UINT8 *spriteram = state->m_spriteram + 0x780;
r13798r13799
313313   /* flip screen control is embedded in RAM */
314314   flip_screen_set(screen.machine(), state->m_spriteram[0x1f7f-0x800] & 1);
315315
316   bitmap->fill(0, *cliprect);
316   bitmap->fill(0, cliprect);
317317
318318   starfield_render(screen.machine(), bitmap);
319319
src/mame/video/carpolo.c
r13798r13799
167167 *
168168 *************************************/
169169
170static void draw_alpha_line(running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect,
170static void draw_alpha_line(running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect,
171171                     int alpha_line, int video_line)
172172{
173173   carpolo_state *state = machine.driver_data<carpolo_state>();
r13798r13799
198198}
199199
200200
201static void draw_sprite(running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect,
201static void draw_sprite(running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect,
202202                  UINT8 x, UINT8 y, int bank, int code, int col)
203203{
204204   int remapped_code, flipy;
r13798r13799
363363      state->m_sprite_sprite_collision_bitmap1->fill(0);
364364      state->m_sprite_sprite_collision_bitmap2->fill(0);
365365
366      drawgfx_opaque(state->m_sprite_sprite_collision_bitmap1,0,machine.gfx[0],
366      drawgfx_opaque(state->m_sprite_sprite_collision_bitmap1,state->m_sprite_sprite_collision_bitmap1->cliprect(),machine.gfx[0],
367367            code1,0,
368368            0,flipy1,
369369            x1,y1);
370370
371      drawgfx_opaque(state->m_sprite_sprite_collision_bitmap2,0,machine.gfx[0],
371      drawgfx_opaque(state->m_sprite_sprite_collision_bitmap2,state->m_sprite_sprite_collision_bitmap2->cliprect(),machine.gfx[0],
372372            code2,0,
373373            0,flipy2,
374374            x2,y2);
r13798r13799
417417      state->m_sprite_goal_collision_bitmap1->fill(0);
418418      state->m_sprite_goal_collision_bitmap2->fill(0);
419419
420      drawgfx_opaque(state->m_sprite_goal_collision_bitmap1,0,machine.gfx[0],
420      drawgfx_opaque(state->m_sprite_goal_collision_bitmap1,state->m_sprite_goal_collision_bitmap1->cliprect(),machine.gfx[0],
421421            code1,0,
422422            0,flipy1,
423423            x1,y1);
424424
425      drawgfxzoom_transpen(state->m_sprite_goal_collision_bitmap2,0,machine.gfx[1],
425      drawgfxzoom_transpen(state->m_sprite_goal_collision_bitmap2,state->m_sprite_goal_collision_bitmap2->cliprect(),machine.gfx[1],
426426               0,0,
427427               0,0,
428428               x2,y2,
r13798r13799
475475      state->m_sprite_goal_collision_bitmap1->fill(0);
476476      state->m_sprite_goal_collision_bitmap2->fill(0);
477477
478      drawgfx_opaque(state->m_sprite_goal_collision_bitmap1,0,machine.gfx[0],
478      drawgfx_opaque(state->m_sprite_goal_collision_bitmap1,state->m_sprite_goal_collision_bitmap1->cliprect(),machine.gfx[0],
479479            code1,0,
480480            0,flipy1,
481481            x1,y1);
482482
483      drawgfxzoom_transpen(state->m_sprite_goal_collision_bitmap2,0,machine.gfx[1],
483      drawgfxzoom_transpen(state->m_sprite_goal_collision_bitmap2,state->m_sprite_goal_collision_bitmap2->cliprect(),machine.gfx[1],
484484               0,1,
485485               1,0,
486486               x2,y2,
r13798r13799
521521   x1 = 240 - x1;
522522   y1 = 240 - y1;
523523
524   drawgfx_opaque(state->m_sprite_border_collision_bitmap,0,machine.gfx[0],
524   drawgfx_opaque(state->m_sprite_border_collision_bitmap,state->m_sprite_border_collision_bitmap->cliprect(),machine.gfx[0],
525525         code1,0,
526526         0,flipy1,
527527         0,0);
src/mame/video/speedatk.c
r13798r13799
9595   UINT16 tile;
9696   UINT8 color, region;
9797
98   bitmap->fill(0, *cliprect);
98   bitmap->fill(0, cliprect);
9999
100100   count = (state->m_crtc_vreg[0x0c]<<8)|(state->m_crtc_vreg[0x0d] & 0xff);
101101
src/mame/video/sknsspr.c
r13798r13799
7878   int step_spr = step;            \
7979   int bxs = 0, bys = 0;            \
8080   rectangle clip;               \
81   clip.min_x = cliprect->min_x<<6;               \
82   clip.max_x = (cliprect->max_x+1)<<6;               \
83   clip.min_y = cliprect->min_y<<6;               \
84   clip.max_y = (cliprect->max_y+1)<<6;               \
81   clip.min_x = cliprect.min_x<<6;               \
82   clip.max_x = (cliprect.max_x+1)<<6;               \
83   clip.min_y = cliprect.min_y<<6;               \
84   clip.max_y = (cliprect.max_y+1)<<6;               \
8585   sx <<= 6;               \
8686   sy <<= 6;               \
8787   x <<= 6;               \
r13798r13799
165165      old2 += 0x40;            \
166166   }
167167
168static void blit_nf_z(bitmap_t *bitmap, const rectangle *cliprect, const UINT8 *src, int x, int y, int sx, int sy, UINT16 zx_m, UINT16 zx_s, UINT16 zy_m, UINT16 zy_s, int colour)
168static void blit_nf_z(bitmap_t *bitmap, const rectangle &cliprect, const UINT8 *src, int x, int y, int sx, int sy, UINT16 zx_m, UINT16 zx_s, UINT16 zy_m, UINT16 zy_s, int colour)
169169{
170170   z_decls(sx);
171171   z_clamp_x_min();
r13798r13799
179179   }
180180}
181181
182static void blit_fy_z(bitmap_t *bitmap, const rectangle *cliprect, const UINT8 *src, int x, int y, int sx, int sy, UINT16 zx_m, UINT16 zx_s, UINT16 zy_m, UINT16 zy_s, int colour)
182static void blit_fy_z(bitmap_t *bitmap, const rectangle &cliprect, const UINT8 *src, int x, int y, int sx, int sy, UINT16 zx_m, UINT16 zx_s, UINT16 zy_m, UINT16 zy_s, int colour)
183183{
184184   z_decls(sx);
185185   z_clamp_x_min();
r13798r13799
193193   }
194194}
195195
196static void blit_fx_z(bitmap_t *bitmap, const rectangle *cliprect, const UINT8 *src, int x, int y, int sx, int sy, UINT16 zx_m, UINT16 zx_s, UINT16 zy_m, UINT16 zy_s, int colour)
196static void blit_fx_z(bitmap_t *bitmap, const rectangle &cliprect, const UINT8 *src, int x, int y, int sx, int sy, UINT16 zx_m, UINT16 zx_s, UINT16 zy_m, UINT16 zy_s, int colour)
197197{
198198   z_decls(sx);
199199   z_clamp_x_max();
r13798r13799
207207   }
208208}
209209
210static void blit_fxy_z(bitmap_t *bitmap, const rectangle *cliprect, const UINT8 *src, int x, int y, int sx, int sy, UINT16 zx_m, UINT16 zx_s, UINT16 zy_m, UINT16 zy_s, int colour)
210static void blit_fxy_z(bitmap_t *bitmap, const rectangle &cliprect, const UINT8 *src, int x, int y, int sx, int sy, UINT16 zx_m, UINT16 zx_s, UINT16 zy_m, UINT16 zy_s, int colour)
211211{
212212   z_decls(sx);
213213   z_clamp_x_max();
r13798r13799
221221   }
222222}
223223
224static void (*const blit_z[4])(bitmap_t *bitmap, const rectangle *cliprect, const UINT8 *src, int x, int y, int sx, int sy, UINT16 zx_m, UINT16 zx_s, UINT16 zy_m, UINT16 zy_s, int colour) = {
224static void (*const blit_z[4])(bitmap_t *bitmap, const rectangle &cliprect, const UINT8 *src, int x, int y, int sx, int sy, UINT16 zx_m, UINT16 zx_s, UINT16 zy_m, UINT16 zy_s, int colour) = {
225225   blit_nf_z,
226226   blit_fy_z,
227227   blit_fx_z,
228228   blit_fxy_z,
229229};
230230
231void sknsspr_device::skns_draw_sprites(running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect, UINT32* spriteram_source, size_t spriteram_size, UINT8* gfx_source, size_t gfx_length, UINT32* sprite_regs)
231void sknsspr_device::skns_draw_sprites(running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect, UINT32* spriteram_source, size_t spriteram_size, UINT8* gfx_source, size_t gfx_length, UINT32* sprite_regs)
232232{
233233   /*- SPR RAM Format -**
234234
r13798r13799
475475
476476                  for (xx = 0; xx<xsize; xx++)
477477                  {
478                     if ((sx+xx < (cliprect->max_x+1)) && (sx+xx >= cliprect->min_x))
478                     if ((sx+xx < (cliprect.max_x+1)) && (sx+xx >= cliprect.min_x))
479479                     {
480480                        for (yy = 0; yy<ysize; yy++)
481481                        {
482                           if ((sy+yy < (cliprect->max_y+1)) && (sy+yy >= cliprect->min_y))
482                           if ((sy+yy < (cliprect.max_y+1)) && (sy+yy >= cliprect.min_y))
483483                           {
484484                              int pix;
485485                              pix = decodebuffer[xsize*yy+xx];
r13798r13799
495495
496496                  for (xx = 0; xx<xsize; xx++)
497497                  {
498                     if ((sx+xx < (cliprect->max_x+1)) && (sx+xx >= cliprect->min_x))
498                     if ((sx+xx < (cliprect.max_x+1)) && (sx+xx >= cliprect.min_x))
499499                     {
500500                        for (yy = 0; yy<ysize; yy++)
501501                        {
502                           if ((sy+(ysize-1-yy) < (cliprect->max_y+1)) && (sy+(ysize-1-yy) >= cliprect->min_y))
502                           if ((sy+(ysize-1-yy) < (cliprect.max_y+1)) && (sy+(ysize-1-yy) >= cliprect.min_y))
503503                           {
504504                              int pix;
505505                              pix = decodebuffer[xsize*yy+xx];
r13798r13799
515515
516516                  for (xx = 0; xx<xsize; xx++)
517517                  {
518                     if ( (sx+(xsize-1-xx) < (cliprect->max_x+1)) && (sx+(xsize-1-xx) >= cliprect->min_x))
518                     if ( (sx+(xsize-1-xx) < (cliprect.max_x+1)) && (sx+(xsize-1-xx) >= cliprect.min_x))
519519                     {
520520                        for (yy = 0; yy<ysize; yy++)
521521                        {
522                           if ((sy+yy < (cliprect->max_y+1)) && (sy+yy >= cliprect->min_y))
522                           if ((sy+yy < (cliprect.max_y+1)) && (sy+yy >= cliprect.min_y))
523523                           {
524524                              int pix;
525525                              pix = decodebuffer[xsize*yy+xx];
r13798r13799
536536
537537                  for (xx = 0; xx<xsize; xx++)
538538                  {
539                     if ((sx+(xsize-1-xx) < (cliprect->max_x+1)) && (sx+(xsize-1-xx) >= cliprect->min_x))
539                     if ((sx+(xsize-1-xx) < (cliprect.max_x+1)) && (sx+(xsize-1-xx) >= cliprect.min_x))
540540                     {
541541                        for (yy = 0; yy<ysize; yy++)
542542                        {
543                           if ((sy+(ysize-1-yy) < (cliprect->max_y+1)) && (sy+(ysize-1-yy) >= cliprect->min_y))
543                           if ((sy+(ysize-1-yy) < (cliprect.max_y+1)) && (sy+(ysize-1-yy) >= cliprect.min_y))
544544                           {
545545                              int pix;
546546                              pix = decodebuffer[xsize*yy+xx];
src/mame/video/system1.c
r13798r13799
369369 *
370370 *************************************/
371371
372static void draw_sprites(running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect, int xoffset)
372static void draw_sprites(running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect, int xoffset)
373373{
374374   system1_state *state = machine.driver_data<system1_state>();
375375   UINT32 gfxbanks = machine.region("sprites")->bytes() / 0x8000;
r13798r13799
421421         srcaddr += stride;
422422
423423         /* skip if outside of our clipping area */
424         if (y < cliprect->min_y || y > cliprect->max_y)
424         if (y < cliprect.min_y || y > cliprect.max_y)
425425            continue;
426426
427427         /* iterate over X */
r13798r13799
455455               for (i = 0; i < 2; i++)
456456               {
457457                  int effx = flipscreen ? 0x1fe - (x + i) : (x + i);
458                  if (effx >= cliprect->min_x && effx <= cliprect->max_x)
458                  if (effx >= cliprect.min_x && effx <= cliprect.max_x)
459459                  {
460460                     int prevpix = destbase[effx];
461461
r13798r13799
476476               for (i = 0; i < 2; i++)
477477               {
478478                  int effx = flipscreen ? 0x1fe - (x + 2 + i) : (x + 2 + i);
479                  if (effx >= cliprect->min_x && effx <= cliprect->max_x)
479                  if (effx >= cliprect.min_x && effx <= cliprect.max_x)
480480                  {
481481                     int prevpix = destbase[effx];
482482
r13798r13799
499499 *
500500 *************************************/
501501
502static void video_update_common(screen_device &screen, bitmap_t *bitmap, const rectangle *cliprect, bitmap_t *fgpixmap, bitmap_t **bgpixmaps, const int *bgrowscroll, int bgyscroll, int spritexoffs)
502static void video_update_common(screen_device &screen, bitmap_t *bitmap, const rectangle &cliprect, bitmap_t *fgpixmap, bitmap_t **bgpixmaps, const int *bgrowscroll, int bgyscroll, int spritexoffs)
503503{
504504   system1_state *state = screen.machine().driver_data<system1_state>();
505505   const UINT8 *lookup = screen.machine().region("proms")->base();
506506   int x, y;
507507
508508   /* first clear the sprite bitmap and draw sprites within this area */
509   state->m_sprite_bitmap->fill(0, *cliprect);
509   state->m_sprite_bitmap->fill(0, cliprect);
510510   draw_sprites(screen.machine(), state->m_sprite_bitmap, cliprect, spritexoffs);
511511
512512   /* iterate over rows */
513   for (y = cliprect->min_y; y <= cliprect->max_y; y++)
513   for (y = cliprect.min_y; y <= cliprect.max_y; y++)
514514   {
515515      UINT16 *fgbase = &fgpixmap->pix16(y & 0xff);
516516      UINT16 *sprbase = &state->m_sprite_bitmap->pix16(y & 0xff);
r13798r13799
524524      bgbase[1] = &bgpixmaps[(bgy >> 8) * 2 + 1]->pix16(bgy & 0xff);
525525
526526      /* iterate over pixels */
527      for (x = cliprect->min_x; x <= cliprect->max_x; x++)
527      for (x = cliprect.min_x; x <= cliprect.max_x; x++)
528528      {
529529         int bgx = ((x - bgxscroll) / 2) & 0x1ff;
530530         UINT16 fgpix = fgbase[x / 2];
src/mame/video/powerins.c
r13798r13799
263263#define SIGN_EXTEND_POS(_var_)   {_var_ &= 0x3ff; if (_var_ > 0x1ff) _var_ -= 0x400;}
264264
265265
266static void draw_sprites(running_machine &machine, bitmap_t *bitmap,const rectangle *cliprect)
266static void draw_sprites(running_machine &machine, bitmap_t *bitmap,const rectangle &cliprect)
267267{
268268   powerins_state *state = machine.driver_data<powerins_state>();
269269   UINT16 *source = state->m_spriteram + 0x8000/2;
r13798r13799
368368#endif
369369
370370   if (layers_ctrl&1)      tilemap_draw(bitmap,cliprect, state->m_tilemap_0, 0, 0);
371   else               bitmap->fill(0, *cliprect);
371   else               bitmap->fill(0, cliprect);
372372   if (layers_ctrl&8)      draw_sprites(screen.machine(),bitmap,cliprect);
373373   if (layers_ctrl&2)      tilemap_draw(bitmap,cliprect, state->m_tilemap_1, 0, 0);
374374   return 0;
src/mame/video/stvvdp2.c
r13798r13799
114114
115115static void refresh_palette_data(running_machine &machine);
116116static int stv_vdp2_window_process(running_machine &machine,int x,int y);
117static int stv_vdp2_apply_window_on_layer(running_machine &machine,rectangle *cliprect);
117static int stv_vdp2_apply_window_on_layer(running_machine &machine,rectangle &cliprect);
118118static void stv_vdp2_get_window0_coordinates(running_machine &machine,UINT16 *s_x, UINT16 *e_x, UINT16 *s_y, UINT16 *e_y);
119static void stv_vdp2_check_tilemap(running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect);
119static void stv_vdp2_check_tilemap(running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect);
120120
121121enum
122122{
r13798r13799
24472447}
24482448
24492449static void stv_vdp2_drawgfxzoom(
2450      bitmap_t *dest_bmp,const rectangle *clip,const gfx_element *gfx,
2450      bitmap_t *dest_bmp,const rectangle &clip,const gfx_element *gfx,
24512451      UINT32 code,UINT32 color,int flipx,int flipy,int sx,int sy,
24522452      int transparency,int transparent_color,int scalex, int scaley,
24532453      int sprite_screen_width, int sprite_screen_height, int alpha)
r13798r13799
24792479
24802480
24812481   /* KW 991012 -- Added code to force clip to bitmap boundary */
2482   if(clip)
2483   {
2484      myclip = *clip;
2485      myclip &= dest_bmp->cliprect();
2486      clip=&myclip;
2487   }
2482   myclip = clip;
2483   myclip &= dest_bmp->cliprect();
24882484
24892485   if( gfx )
24902486   {
r13798r13799
25282524            y_index = 0;
25292525         }
25302526
2531         if( clip )
2532         {
2533            if( sx < clip->min_x)
2534            { /* clip left */
2535               int pixels = clip->min_x-sx;
2536               sx += pixels;
2537               x_index_base += pixels*dx;
2538            }
2539            if( sy < clip->min_y )
2540            { /* clip top */
2541               int pixels = clip->min_y-sy;
2542               sy += pixels;
2543               y_index += pixels*dy;
2544            }
2545            /* NS 980211 - fixed incorrect clipping */
2546            if( ex > clip->max_x+1 )
2547            { /* clip right */
2548               int pixels = ex-clip->max_x-1;
2549               ex -= pixels;
2550            }
2551            if( ey > clip->max_y+1 )
2552            { /* clip bottom */
2553               int pixels = ey-clip->max_y-1;
2554               ey -= pixels;
2555            }
2527         if( sx < myclip.min_x)
2528         { /* clip left */
2529            int pixels = myclip.min_x-sx;
2530            sx += pixels;
2531            x_index_base += pixels*dx;
25562532         }
2533         if( sy < myclip.min_y )
2534         { /* clip top */
2535            int pixels = myclip.min_y-sy;
2536            sy += pixels;
2537            y_index += pixels*dy;
2538         }
2539         /* NS 980211 - fixed incorrect clipping */
2540         if( ex > myclip.max_x+1 )
2541         { /* clip right */
2542            int pixels = ex-myclip.max_x-1;
2543            ex -= pixels;
2544         }
2545         if( ey > myclip.max_y+1 )
2546         { /* clip bottom */
2547            int pixels = ey-myclip.max_y-1;
2548            ey -= pixels;
2549         }
25572550
25582551         if( ex>sx )
25592552         { /* skip if inner loop doesn't draw anything */
r13798r13799
27672760   *rgb = (_r << 10) |  (_g << 5) | _b;
27682761}
27692762
2770static void stv_vdp2_drawgfx_rgb555( bitmap_t *dest_bmp, const rectangle *clip, running_machine &machine, UINT32 code, int flipx, int flipy,
2763static void stv_vdp2_drawgfx_rgb555( bitmap_t *dest_bmp, const rectangle &clip, running_machine &machine, UINT32 code, int flipx, int flipy,
27712764                            int sx, int sy, int transparency, int alpha)
27722765{
27732766   saturn_state *state = machine.driver_data<saturn_state>();
r13798r13799
27802773   sprite_screen_width = sprite_screen_height = 8;
27812774
27822775   /* KW 991012 -- Added code to force clip to bitmap boundary */
2783   if(clip)
2776   myclip = clip;
2777   myclip &= dest_bmp->cliprect();
2778
27842779   {
2785      myclip = *clip;
2786      myclip &= dest_bmp->cliprect();
2787      clip=&myclip;
2788   }
2789   {
27902780      int dx = stv2_current_tilemap.incx;
27912781      int dy = stv2_current_tilemap.incy;
27922782
r13798r13799
28162806         y_index = 0;
28172807      }
28182808
2819      if( clip )
2820      {
2821         if( sx < clip->min_x)
2822         { /* clip left */
2823            int pixels = clip->min_x-sx;
2824            sx += pixels;
2825            x_index_base += pixels*dx;
2826         }
2827         if( sy < clip->min_y )
2828         { /* clip top */
2829            int pixels = clip->min_y-sy;
2830            sy += pixels;
2831            y_index += pixels*dy;
2832         }
2833         /* NS 980211 - fixed incorrect clipping */
2834         if( ex > clip->max_x+1 )
2835         { /* clip right */
2836            int pixels = ex-clip->max_x-1;
2837            ex -= pixels;
2838         }
2839         if( ey > clip->max_y+1 )
2840         { /* clip bottom */
2841            int pixels = ey-clip->max_y-1;
2842            ey -= pixels;
2843         }
2809      if( sx < myclip.min_x)
2810      { /* clip left */
2811         int pixels = myclip.min_x-sx;
2812         sx += pixels;
2813         x_index_base += pixels*dx;
28442814      }
2815      if( sy < myclip.min_y )
2816      { /* clip top */
2817         int pixels = myclip.min_y-sy;
2818         sy += pixels;
2819         y_index += pixels*dy;
2820      }
2821      /* NS 980211 - fixed incorrect clipping */
2822      if( ex > myclip.max_x+1 )
2823      { /* clip right */
2824         int pixels = ex-myclip.max_x-1;
2825         ex -= pixels;
2826      }
2827      if( ey > myclip.max_y+1 )
2828      { /* clip bottom */
2829         int pixels = ey-myclip.max_y-1;
2830         ey -= pixels;
2831      }
28452832
28462833      if( ex>sx )
28472834      { /* skip if inner loop doesn't draw anything */
r13798r13799
28862873}
28872874
28882875
2889static void stv_vdp2_drawgfx_rgb888( bitmap_t *dest_bmp, const rectangle *clip, running_machine &machine, UINT32 code, int flipx, int flipy,
2876static void stv_vdp2_drawgfx_rgb888( bitmap_t *dest_bmp, const rectangle &clip, running_machine &machine, UINT32 code, int flipx, int flipy,
28902877                            int sx, int sy, int transparency, int alpha)
28912878{
28922879   saturn_state *state = machine.driver_data<saturn_state>();
r13798r13799
28992886   sprite_screen_width = sprite_screen_height = 8;
29002887
29012888   /* KW 991012 -- Added code to force clip to bitmap boundary */
2902   if(clip)
2889   myclip = clip;
2890   myclip &= dest_bmp->cliprect();
29032891   {
2904      myclip = *clip;
2905      myclip &= dest_bmp->cliprect();
2906      clip=&myclip;
2907   }
2908   {
29092892      int dx = stv2_current_tilemap.incx;
29102893      int dy = stv2_current_tilemap.incy;
29112894
r13798r13799
29352918         y_index = 0;
29362919      }
29372920
2938      if( clip )
2939      {
2940         if( sx < clip->min_x)
2941         { /* clip left */
2942            int pixels = clip->min_x-sx;
2943            sx += pixels;
2944            x_index_base += pixels*dx;
2945         }
2946         if( sy < clip->min_y )
2947         { /* clip top */
2948            int pixels = clip->min_y-sy;
2949            sy += pixels;
2950            y_index += pixels*dy;
2951         }
2952         /* NS 980211 - fixed incorrect clipping */
2953         if( ex > clip->max_x+1 )
2954         { /* clip right */
2955            int pixels = ex-clip->max_x-1;
2956            ex -= pixels;
2957         }
2958         if( ey > clip->max_y+1 )
2959         { /* clip bottom */
2960            int pixels = ey-clip->max_y-1;
2961            ey -= pixels;
2962         }
2921      if( sx < myclip.min_x)
2922      { /* clip left */
2923         int pixels = myclip.min_x-sx;
2924         sx += pixels;
2925         x_index_base += pixels*dx;
29632926      }
2927      if( sy < myclip.min_y )
2928      { /* clip top */
2929         int pixels = myclip.min_y-sy;
2930         sy += pixels;
2931         y_index += pixels*dy;
2932      }
2933      /* NS 980211 - fixed incorrect clipping */
2934      if( ex > myclip.max_x+1 )
2935      { /* clip right */
2936         int pixels = ex-myclip.max_x-1;
2937         ex -= pixels;
2938      }
2939      if( ey > myclip.max_y+1 )
2940      { /* clip bottom */
2941         int pixels = ey-myclip.max_y-1;
2942         ey -= pixels;
2943      }
29642944
29652945      if( ex>sx )
29662946      { /* skip if inner loop doesn't draw anything */
r13798r13799
30102990
30112991}
30122992
3013static void stv_vdp2_draw_basic_bitmap(running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect)
2993static void stv_vdp2_draw_basic_bitmap(running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect)
30142994{
30152995   saturn_state *state = machine.driver_data<saturn_state>();
30162996
r13798r13799
31333113         {
31343114            //int gfx_wraparound = -1;
31353115
3136            gfxdata += xlinesize*cliprect->min_y;
3116            gfxdata += xlinesize*cliprect.min_y;
31373117
3138            for (ycnt = cliprect->min_y; ycnt <= cliprect->max_y; ycnt++)
3118            for (ycnt = cliprect.min_y; ycnt <= cliprect.max_y; ycnt++)
31393119            {
3140               for (xcnt = cliprect->min_x; xcnt <= cliprect->max_x; xcnt++)
3120               for (xcnt = cliprect.min_x; xcnt <= cliprect.max_x; xcnt++)
31413121               {
31423122                  int xs = xcnt & xsizemask;
31433123
r13798r13799
31783158         else
31793159         {
31803160            int xx, xs, yy=0;
3181            for (ycnt = cliprect->min_y; ycnt <= cliprect->max_y; yy+=stv2_current_tilemap.incy, ycnt++ )
3161            for (ycnt = cliprect.min_y; ycnt <= cliprect.max_y; yy+=stv2_current_tilemap.incy, ycnt++ )
31823162            {
31833163               gfxdata += xlinesize*(yy>>16);
31843164               yy &= 0xffff;
31853165
31863166               destline = &bitmap->pix16(ycnt);
31873167               xx = 0;
3188               for (xcnt = cliprect->min_x; xcnt <= cliprect->max_x; xx+=stv2_current_tilemap.incx, xcnt++)
3168               for (xcnt = cliprect.min_x; xcnt <= cliprect.max_x; xx+=stv2_current_tilemap.incx, xcnt++)
31893169               {
31903170                  xs = xx >> 16;
31913171                  tw = stv_vdp2_window_process(machine,xcnt,ycnt);
r13798r13799
32493229         if ( stv2_current_tilemap.incx == 0x10000 && stv2_current_tilemap.incy == 0x10000 )
32503230         {
32513231            /* adjust for cliprect */
3252            gfxdata += xlinesize*cliprect->min_y;
3232            gfxdata += xlinesize*cliprect.min_y;
32533233
3254            for (ycnt = cliprect->min_y; ycnt <= cliprect->max_y; ycnt++)
3234            for (ycnt = cliprect.min_y; ycnt <= cliprect.max_y; ycnt++)
32553235            {
32563236               destline = &bitmap->pix16(ycnt);
32573237
3258               for (xcnt = cliprect->min_x; xcnt <= cliprect->max_x; xcnt++)
3238               for (xcnt = cliprect.min_x; xcnt <= cliprect.max_x; xcnt++)
32593239               {
32603240                  int r,g,b;
32613241                  int xs = xcnt & xsizemask;
r13798r13799
32943274         {
32953275            int xx, xs, yy=0;
32963276
3297            for (ycnt = cliprect->min_y; ycnt <= cliprect->max_y; yy+=stv2_current_tilemap.incy, ycnt++ )
3277            for (ycnt = cliprect.min_y; ycnt <= cliprect.max_y; yy+=stv2_current_tilemap.incy, ycnt++ )
32983278            {
32993279               gfxdata += xlinesize*(yy>>16);
33003280               yy &= 0xffff;
33013281
33023282               destline = &bitmap->pix16(ycnt);
33033283               xx = 0;
3304               for (xcnt = cliprect->min_x; xcnt <= cliprect->max_x; xx+=stv2_current_tilemap.incx, xcnt++)
3284               for (xcnt = cliprect.min_x; xcnt <= cliprect.max_x; xx+=stv2_current_tilemap.incx, xcnt++)
33053285               {
33063286                  int r,g,b;
33073287
r13798r13799
33453325        */
33463326        case 4:
33473327         /* adjust for cliprect */
3348         gfxdata += xlinesize*(cliprect->min_y);
3328         gfxdata += xlinesize*(cliprect.min_y);
33493329
3350         for (ycnt = cliprect->min_y; ycnt <= cliprect->max_y; ycnt++)
3330         for (ycnt = cliprect.min_y; ycnt <= cliprect.max_y; ycnt++)
33513331         {
33523332            destline = &bitmap->pix16(ycnt);
33533333
3354            for (xcnt = cliprect->min_x; xcnt <= cliprect->max_x; xcnt++)
3334            for (xcnt = cliprect.min_x; xcnt <= cliprect.max_x; xcnt++)
33553335            {
33563336               int r,g,b;
33573337               int xs = xcnt & xsizemask;
r13798r13799
35653545   *_map = map;
35663546}
35673547
3568static void stv_vdp2_draw_basic_tilemap(running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect)
3548static void stv_vdp2_draw_basic_tilemap(running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect)
35693549{
35703550   saturn_state *state = machine.driver_data<saturn_state>();
35713551   /* hopefully this is easier to follow than it is efficient .. */
r13798r13799
37993779      {
38003780         int drawyposinc = tilesizey*(stv2_current_tilemap.tile_size ? 2 : 1);
38013781         drawypos = -(stv2_current_tilemap.scrolly*scaley);
3802         while( ((drawypos + drawyposinc) >> 16) < cliprect->min_y )
3782         while( ((drawypos + drawyposinc) >> 16) < cliprect.min_y )
38033783         {
38043784            drawypos += drawyposinc;
38053785            y++;
r13798r13799
38103790      {
38113791         drawypos += tilesizey*(stv2_current_tilemap.tile_size ? 2 : 1);
38123792      }
3813      if ((drawypos >> 16) > cliprect->max_y) break;
3793      if ((drawypos >> 16) > cliprect.max_y) break;
38143794
38153795      ypageoffs = y & (pgtiles_y-1);
38163796
r13798r13799
38223802         {
38233803            int drawxposinc = tilesizex*(stv2_current_tilemap.tile_size ? 2 : 1);
38243804            drawxpos = -(stv2_current_tilemap.scrollx*scalex);
3825            while( ((drawxpos + drawxposinc) >> 16) < cliprect->min_x )
3805            while( ((drawxpos + drawxposinc) >> 16) < cliprect.min_x )
38263806            {
38273807               drawxpos += drawxposinc;
38283808               x++;
r13798r13799
38333813         {
38343814            drawxpos+=tilesizex*(stv2_current_tilemap.tile_size ? 2 : 1);
38353815         }
3836         if ( (drawxpos >> 16) > cliprect->max_x ) break;
3816         if ( (drawxpos >> 16) > cliprect.max_x ) break;
38373817
38383818         xpageoffs = x & (pgtiles_x-1);
38393819
r13798r13799
40163996
40173997      if ( LOG_VDP2 )
40183998      {
4019         logerror( "Layer RBG%d, size %d x %d\n", stv2_current_tilemap.layer_name & 0x7f, cliprect->max_x + 1, cliprect->max_y + 1 );
3999         logerror( "Layer RBG%d, size %d x %d\n", stv2_current_tilemap.layer_name & 0x7f, cliprect.max_x + 1, cliprect.max_y + 1 );
40204000         logerror( "Tiles: min %08X, max %08X\n", tilecodemin, tilecodemax );
40214001         logerror( "MAP size in dwords %08X\n", mpsize_dwords );
40224002         for (i = 0; i < stv2_current_tilemap.map_count; i++)
r13798r13799
40574037   }
40584038
40594039
4060static void stv_vdp2_check_tilemap_with_linescroll(running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect)
4040static void stv_vdp2_check_tilemap_with_linescroll(running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect)
40614041{
40624042   saturn_state *state = machine.driver_data<saturn_state>();
40634043   rectangle mycliprect;
4064   int cur_line = cliprect->min_y;
4044   int cur_line = cliprect.min_y;
40654045   int address;
40664046   int active_functions = 0;
40674047   INT32 scroll_values[3], prev_scroll_values[3];
r13798r13799
40874067   stv2_current_tilemap.linezoom_enable = 0;
40884068
40894069   // prepare working clipping rectangle
4090   memcpy( &mycliprect, cliprect, sizeof(rectangle) );
4070   memcpy( &mycliprect, &cliprect, sizeof(rectangle) );
40914071
40924072   // calculate the number of active functions
40934073   if ( linescroll_enable ) active_functions++;
r13798r13799
40994079   if ( linezoom_enable ) active_functions++;
41004080
41014081   // address of data table
4102   address = stv2_current_tilemap.linescroll_table_address + active_functions*4*cliprect->min_y;
4082   address = stv2_current_tilemap.linescroll_table_address + active_functions*4*cliprect.min_y;
41034083
41044084   // get the first scroll values
41054085   for ( i = 0; i < active_functions; i++ )
r13798r13799
41154095      }
41164096   }
41174097
4118   while( cur_line <= cliprect->max_y )
4098   while( cur_line <= cliprect.max_y )
41194099   {
41204100      lines = 0;
41214101      do
r13798r13799
41464126         {
41474127            scroll_values_equal &= (scroll_values[i] == prev_scroll_values[i]);
41484128         }
4149      } while( scroll_values_equal && ((cur_line + lines) <= cliprect->max_y) );
4129      } while( scroll_values_equal && ((cur_line + lines) <= cliprect.max_y) );
41504130
41514131      // determined how many lines can be drawn
41524132      // prepare clipping rectangle
r13798r13799
41814161
41824162//      if ( LOG_VDP2 ) logerror( "Linescroll: y < %d, %d >, scrollx = %d, scrolly = %d, incx = %f\n", mycliprect.min_y, mycliprect.max_y, stv2_current_tilemap.scrollx, stv2_current_tilemap.scrolly, (float)stv2_current_tilemap.incx/65536.0 );
41834163      // render current tilemap portion
4184      stv_vdp2_check_tilemap(machine, bitmap, &mycliprect );
4164      stv_vdp2_check_tilemap(machine, bitmap, mycliprect );
41854165
41864166      // update parameters for next iteration
41874167      memcpy( prev_scroll_values, scroll_values, sizeof(scroll_values));
r13798r13799
41894169   }
41904170}
41914171
4192static void stv_vdp2_draw_line(running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect)
4172static void stv_vdp2_draw_line(running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect)
41934173{
41944174   saturn_state *state = machine.driver_data<saturn_state>();
41954175   int x,y;
r13798r13799
42034183   {
42044184      base_mask = STV_VDP2_VRAMSZ ? 0x7ffff : 0x3ffff;
42054185
4206      for(y=cliprect->min_y;y<=cliprect->max_y;y++)
4186      for(y=cliprect.min_y;y<=cliprect.max_y;y++)
42074187      {
42084188         base_offs = (STV_VDP2_LCTA & base_mask) << 1;
42094189
42104190         if(STV_VDP2_LCCLMD)
42114191            base_offs += (y / interlace) << 1;
42124192
4213         for(x=cliprect->min_x;x<=cliprect->max_x;x++)
4193         for(x=cliprect.min_x;x<=cliprect.max_x;x++)
42144194         {
42154195            UINT16 pen;
42164196
r13798r13799
42234203   }
42244204}
42254205
4226static void stv_vdp2_draw_mosaic(running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect, UINT8 is_roz)
4206static void stv_vdp2_draw_mosaic(running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect, UINT8 is_roz)
42274207{
42284208   saturn_state *state = machine.driver_data<saturn_state>();
42294209   int x,y,xi,yi;
r13798r13799
42424222   if(STV_VDP2_LSMD == 3)
42434223      v_size <<= 1;
42444224
4245   for(y=cliprect->min_y;y<=cliprect->max_y;y+=v_size)
4225   for(y=cliprect.min_y;y<=cliprect.max_y;y+=v_size)
42464226   {
4247      for(x=cliprect->min_x;x<=cliprect->max_x;x+=h_size)
4227      for(x=cliprect.min_x;x<=cliprect.max_x;x+=h_size)
42484228      {
42494229         pix = bitmap->pix16(y, x);
42504230
r13798r13799
42554235   }
42564236}
42574237
4258static void stv_vdp2_check_tilemap(running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect)
4238static void stv_vdp2_check_tilemap(running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect)
42594239{
42604240   /* the idea is here we check the tilemap capabilities / whats enabled and call an appropriate tilemap drawing routine, or
42614241      at the very list throw up a few errors if the tilemaps want to do something we don't support yet */
r13798r13799
42634243
42644244//  int window_applied = 0;
42654245   rectangle mycliprect;
4266   mycliprect.min_x = cliprect->min_x;
4267   mycliprect.max_x = cliprect->max_x;
4268   mycliprect.min_y = cliprect->min_y;
4269   mycliprect.max_y = cliprect->max_y;
4246   mycliprect.min_x = cliprect.min_x;
4247   mycliprect.max_x = cliprect.max_x;
4248   mycliprect.min_y = cliprect.min_y;
4249   mycliprect.max_y = cliprect.max_y;
42704250
42714251   if ( stv2_current_tilemap.linescroll_enable ||
42724252       stv2_current_tilemap.vertical_linescroll_enable ||
r13798r13799
42774257   }
42784258
42794259//  window_applied =
4280   stv_vdp2_apply_window_on_layer(machine,&mycliprect);
4260   stv_vdp2_apply_window_on_layer(machine,mycliprect);
42814261
42824262   if (stv2_current_tilemap.bitmap_enable) // this layer is a bitmap
42834263   {
r13798r13799
42854265      //if ( window_applied && stv2_current_tilemap.colour_depth != 4)
42864266      //  stv2_current_tilemap.window_control = 0;
42874267
4288      stv_vdp2_draw_basic_bitmap(machine, bitmap, &mycliprect);
4268      stv_vdp2_draw_basic_bitmap(machine, bitmap, mycliprect);
42894269   }
42904270   else
42914271   {
4292      stv_vdp2_draw_basic_tilemap(machine, bitmap, &mycliprect);
4272      stv_vdp2_draw_basic_tilemap(machine, bitmap, mycliprect);
42934273   }
42944274
42954275   /* post-processing functions (TODO: needs layer bitmaps to be individual planes to work correctly) */
r13798r13799
43694349   }
43704350}
43714351
4372static void stv_vdp2_draw_rotation_screen(running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect, int iRP);
4352static void stv_vdp2_draw_rotation_screen(running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect, int iRP);
43734353
43744354
43754355static void stv_vdp2_copy_roz_bitmap(bitmap_t *bitmap,
43764356                            running_machine &machine,
43774357                            bitmap_t *roz_bitmap,
4378                            const rectangle *cliprect,
4358                            const rectangle &cliprect,
43794359                            int iRP,
43804360                            int planesizex,
43814361                            int planesizey,
r13798r13799
45104490   xp = mul_fixed32( RP.A, RP.px - RP.cx ) + mul_fixed32( RP.B, RP.py - RP.cy ) + mul_fixed32( RP.C, RP.pz - RP.cz ) + RP.cx + RP.mx;
45114491   yp = mul_fixed32( RP.D, RP.px - RP.cx ) + mul_fixed32( RP.E, RP.py - RP.cy ) + mul_fixed32( RP.F, RP.pz - RP.cz ) + RP.cy + RP.my;
45124492
4513   for (vcnt = cliprect->min_y; vcnt <= cliprect->max_y; vcnt++ )
4493   for (vcnt = cliprect.min_y; vcnt <= cliprect.max_y; vcnt++ )
45144494   {
45154495      /*xsp = RP.A * ( ( RP.xst + RP.dxst * (vcnt << 16) ) - RP.px ) +
45164496              RP.B * ( ( RP.yst + RP.dyst * (vcnt << 16) ) - RP.py ) +
r13798r13799
46014581         dxs = mul_fixed32( kx, mul_fixed32( dx, 1 << (16-hcnt_shift)));
46024582         dys = mul_fixed32( ky, mul_fixed32( dy, 1 << (16-hcnt_shift)));
46034583
4604         for (hcnt = cliprect->min_x; hcnt <= cliprect->max_x; xs+=dxs, ys+=dys, hcnt++ )
4584         for (hcnt = cliprect.min_x; hcnt <= cliprect.max_x; xs+=dxs, ys+=dys, hcnt++ )
46054585         {
46064586            x = xs >> 16;
46074587            y = ys >> 16;
r13798r13799
46494629      }
46504630      else
46514631      {
4652         for (hcnt = cliprect->min_x; hcnt <= cliprect->max_x; hcnt++ )
4632         for (hcnt = cliprect.min_x; hcnt <= cliprect.max_x; hcnt++ )
46534633         {
46544634            switch( coeff_table_size )
46554635            {
r13798r13799
47604740   }
47614741}
47624742
4763static void stv_vdp2_draw_NBG0(running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect)
4743static void stv_vdp2_draw_NBG0(running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect)
47644744{
47654745   saturn_state *state = machine.driver_data<saturn_state>();
47664746   UINT32 base_mask;
r13798r13799
48624842      stv_vdp2_check_tilemap(machine, bitmap, cliprect);
48634843}
48644844
4865static void stv_vdp2_draw_NBG1(running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect)
4845static void stv_vdp2_draw_NBG1(running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect)
48664846{
48674847   saturn_state *state = machine.driver_data<saturn_state>();
48684848   UINT32 base_mask;
r13798r13799
49604940   stv_vdp2_check_tilemap(machine, bitmap, cliprect);
49614941}
49624942
4963static void stv_vdp2_draw_NBG2(running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect)
4943static void stv_vdp2_draw_NBG2(running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect)
49644944{
49654945   saturn_state *state = machine.driver_data<saturn_state>();
49664946
r13798r13799
50655045   stv_vdp2_check_tilemap(machine, bitmap, cliprect);
50665046}
50675047
5068static void stv_vdp2_draw_NBG3(running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect)
5048static void stv_vdp2_draw_NBG3(running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect)
50695049{
50705050   saturn_state *state = machine.driver_data<saturn_state>();
50715051   /*
r13798r13799
51705150}
51715151
51725152
5173static void stv_vdp2_draw_rotation_screen(running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect, int iRP)
5153static void stv_vdp2_draw_rotation_screen(running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect, int iRP)
51745154{
51755155   saturn_state *state = machine.driver_data<saturn_state>();
51765156   rectangle roz_clip_rect, mycliprect;
r13798r13799
53135293         memcmp(&stv_rbg_cache_data.layer_data[iRP-1],&stv2_current_tilemap,sizeof(stv2_current_tilemap)) != 0 )
53145294      {
53155295         state->m_vdp2.roz_bitmap[iRP-1]->fill(get_black_pen(machine), roz_clip_rect );
5316         stv_vdp2_check_tilemap(machine, state->m_vdp2.roz_bitmap[iRP-1], &roz_clip_rect);
5296         stv_vdp2_check_tilemap(machine, state->m_vdp2.roz_bitmap[iRP-1], roz_clip_rect);
53175297         // prepare cache data
53185298         stv_rbg_cache_data.watch_vdp2_vram_writes |= iRP;
53195299         stv_rbg_cache_data.is_cache_dirty &= ~iRP;
r13798r13799
53345314         stv2_current_tilemap.transparency = STV_TRANSPARENCY_ALPHA;
53355315      }
53365316
5337      mycliprect.min_x = cliprect->min_x;
5338      mycliprect.max_x = cliprect->max_x;
5339      mycliprect.min_y = cliprect->min_y;
5340      mycliprect.max_y = cliprect->max_y;
5317      mycliprect.min_x = cliprect.min_x;
5318      mycliprect.max_x = cliprect.max_x;
5319      mycliprect.min_y = cliprect.min_y;
5320      mycliprect.max_y = cliprect.max_y;
53415321
53425322      if ( window_control )
53435323      {
53445324         stv2_current_tilemap.window_control = window_control;
5345         stv_vdp2_apply_window_on_layer(machine,&mycliprect);
5325         stv_vdp2_apply_window_on_layer(machine,mycliprect);
53465326      }
53475327
53485328      stv2_current_tilemap.fade_control = fade_control;
53495329
53505330      g_profiler.start(PROFILER_USER2);
5351      stv_vdp2_copy_roz_bitmap(bitmap, machine, state->m_vdp2.roz_bitmap[iRP-1], &mycliprect, iRP, planesizex, planesizey, planerenderedsizex, planerenderedsizey );
5331      stv_vdp2_copy_roz_bitmap(bitmap, machine, state->m_vdp2.roz_bitmap[iRP-1], mycliprect, iRP, planesizex, planesizey, planerenderedsizex, planerenderedsizey );
53525332      g_profiler.stop();
53535333   }
53545334
53555335}
53565336
5357static void stv_vdp2_draw_RBG0(running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect)
5337static void stv_vdp2_draw_RBG0(running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect)
53585338{
53595339   saturn_state *state = machine.driver_data<saturn_state>();
53605340   /*
r13798r13799
54575437
54585438}
54595439
5460static void stv_vdp2_draw_back(running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect)
5440static void stv_vdp2_draw_back(running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect)
54615441{
54625442   saturn_state *state = machine.driver_data<saturn_state>();
54635443   int x,y;
r13798r13799
54715451
54725452   /* draw black if BDCLMD and DISP are cleared */
54735453   if(!(STV_VDP2_BDCLMD) && !(STV_VDP2_DISP))
5474      bitmap->fill(get_black_pen(machine), *cliprect);
5454      bitmap->fill(get_black_pen(machine), cliprect);
54755455   else
54765456   {
54775457      base_mask = STV_VDP2_VRAMSZ ? 0x7ffff : 0x3ffff;
54785458
5479      for(y=cliprect->min_y;y<=cliprect->max_y;y++)
5459      for(y=cliprect.min_y;y<=cliprect.max_y;y++)
54805460      {
54815461         base_offs = ((STV_VDP2_BKTA ) & base_mask) << 1;
54825462         if(STV_VDP2_BKCLMD)
54835463            base_offs += ((y / interlace) << 1);
54845464
5485         for(x=cliprect->min_x;x<=cliprect->max_x;x++)
5465         for(x=cliprect.min_x;x<=cliprect.max_x;x++)
54865466         {
54875467            int r,g,b;
54885468            UINT16 dot;
r13798r13799
62476227   return stv2_current_tilemap.window_control & 1 ? (w0_pix & w1_pix) : (w0_pix | w1_pix);
62486228}
62496229
6250static int stv_vdp2_apply_window_on_layer(running_machine &machine,rectangle *cliprect)
6230static int stv_vdp2_apply_window_on_layer(running_machine &machine,rectangle &cliprect)
62516231{
62526232   //saturn_state *state = machine.driver_data<saturn_state>();
62536233   UINT16 s_x=0,e_x=0,s_y=0,e_y=0;
r13798r13799
62576237      /* w0, transparent outside supported */
62586238      stv_vdp2_get_window0_coordinates(machine,&s_x, &e_x, &s_y, &e_y);
62596239
6260      if ( s_x > cliprect->min_x ) cliprect->min_x = s_x;
6261      if ( e_x < cliprect->max_x ) cliprect->max_x = e_x;
6262      if ( s_y > cliprect->min_y ) cliprect->min_y = s_y;
6263      if ( e_y < cliprect->max_y ) cliprect->max_y = e_y;
6240      if ( s_x > cliprect.min_x ) cliprect.min_x = s_x;
6241      if ( e_x < cliprect.max_x ) cliprect.max_x = e_x;
6242      if ( s_y > cliprect.min_y ) cliprect.min_y = s_y;
6243      if ( e_y < cliprect.max_y ) cliprect.max_y = e_y;
62646244
62656245      return 1;
62666246   }
r13798r13799
62696249      /* w1, transparent outside supported */
62706250      stv_vdp2_get_window1_coordinates(machine,&s_x, &e_x, &s_y, &e_y);
62716251
6272      if ( s_x > cliprect->min_x ) cliprect->min_x = s_x;
6273      if ( e_x < cliprect->max_x ) cliprect->max_x = e_x;
6274      if ( s_y > cliprect->min_y ) cliprect->min_y = s_y;
6275      if ( e_y < cliprect->max_y ) cliprect->max_y = e_y;
6252      if ( s_x > cliprect.min_x ) cliprect.min_x = s_x;
6253      if ( e_x < cliprect.max_x ) cliprect.max_x = e_x;
6254      if ( s_y > cliprect.min_y ) cliprect.min_y = s_y;
6255      if ( e_y < cliprect.max_y ) cliprect.max_y = e_y;
62766256
62776257      return 1;
62786258   }
r13798r13799
62876267static int      stv_sprite_priorities_usage_valid;
62886268static UINT8   stv_sprite_priorities_in_fb_line[512][8];
62896269
6290static void draw_sprites(running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect, UINT8 pri)
6270static void draw_sprites(running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect, UINT8 pri)
62916271{
62926272   saturn_state *state = machine.driver_data<saturn_state>();
62936273   int x,y,r,g,b;
r13798r13799
64006380                                (STV_VDP2_SPW0A * 0x10) |
64016381                                (STV_VDP2_SPW1A * 0x20) |
64026382                                (STV_VDP2_SPSWA * 0x40);
6403   mycliprect.min_x = cliprect->min_x;
6404   mycliprect.max_x = cliprect->max_x;
6405   mycliprect.min_y = cliprect->min_y;
6406   mycliprect.max_y = cliprect->max_y;
6383   mycliprect.min_x = cliprect.min_x;
6384   mycliprect.max_x = cliprect.max_x;
6385   mycliprect.min_y = cliprect.min_y;
6386   mycliprect.max_y = cliprect.max_y;
64076387
6408   stv_vdp2_apply_window_on_layer(machine,&mycliprect);
6388   stv_vdp2_apply_window_on_layer(machine,mycliprect);
64096389
64106390   if (interlace_framebuffer == 0 && double_x == 0 )
64116391   {
r13798r13799
70607040   }
70617041}
70627042
7063static void vdp2_draw_back(running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect)
7043static void vdp2_draw_back(running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect)
70647044{
70657045   saturn_state *state = machine.driver_data<saturn_state>();
70667046   int x,y;
r13798r13799
70727052
70737053   /* draw black if BDCLMD and DISP are cleared */
70747054   if(!(STV_VDP2_BDCLMD) && !(STV_VDP2_DISP))
7075      bitmap->fill(get_black_pen(machine), *cliprect);
7055      bitmap->fill(get_black_pen(machine), cliprect);
70767056   else
70777057   {
70787058      base_mask = STV_VDP2_VRAMSZ ? 0x7ffff : 0x3ffff;
70797059
7080      for(y=cliprect->min_y;y<=cliprect->max_y;y++)
7060      for(y=cliprect.min_y;y<=cliprect.max_y;y++)
70817061      {
70827062         base_offs = ((STV_VDP2_BKTA ) & base_mask) << 1;
70837063         if(STV_VDP2_BKCLMD)
70847064            base_offs += ((y / interlace) << 1);
70857065
7086         for(x=cliprect->min_x;x<=cliprect->max_x;x++)
7066         for(x=cliprect.min_x;x<=cliprect.max_x;x++)
70877067         {
70887068            int r,g,b;
70897069            UINT16 dot;
r13798r13799
72707250}
72717251
72727252/* now copy the vram buffer to the screen buffer, apply post-processing at this stage */
7273static void draw_normal_screen(running_machine &machine, bitmap_t *bitmap,const rectangle *cliprect, UINT8 layer_name)
7253static void draw_normal_screen(running_machine &machine, bitmap_t *bitmap,const rectangle &cliprect, UINT8 layer_name)
72747254{
72757255   int x,y;
72767256   int r,g,b;
72777257
72787258
7279   for(y=0;y<=cliprect->max_y;y++)
7259   for(y=0;y<=cliprect.max_y;y++)
72807260   {
7281      for(x=0;x<=cliprect->max_x;x++)
7261      for(x=0;x<=cliprect.max_x;x++)
72827262      {
72837263         if(layer_tpen[layer_name][(x)+(y)*XB_SIZE])
72847264         {
src/mame/video/sknsspr.h
r13798r13799
33{
44public:
55   sknsspr_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
6   void skns_draw_sprites(running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect, UINT32* spriteram_source, size_t spriteram_size, UINT8* gfx_source, size_t gfx_length, UINT32* sprite_regs);
6   void skns_draw_sprites(running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect, UINT32* spriteram_source, size_t spriteram_size, UINT8* gfx_source, size_t gfx_length, UINT32* sprite_regs);
77   void skns_sprite_kludge(int x, int y);
88
99protected:
src/mame/video/exedexes.c
r13798r13799
184184   colortable_configure_tilemap_groups(machine.colortable, state->m_tx_tilemap, machine.gfx[0], 0xcf);
185185}
186186
187static void draw_sprites( running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect, int priority )
187static void draw_sprites( running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect, int priority )
188188{
189189   exedexes_state *state = machine.driver_data<exedexes_state>();
190190   UINT8 *buffered_spriteram = machine.generic.buffered_spriteram.u8;
r13798r13799
226226      tilemap_draw(bitmap, cliprect, state->m_bg_tilemap, 0, 0);
227227   }
228228   else
229      bitmap->fill(0, *cliprect);
229      bitmap->fill(0, cliprect);
230230
231231   draw_sprites(screen.machine(), bitmap, cliprect, 1);
232232
src/mame/video/jedi.c
r13798r13799
8888}
8989
9090
91static void do_pen_lookup(jedi_state *state, bitmap_t *bitmap, const rectangle *cliprect)
91static void do_pen_lookup(jedi_state *state, bitmap_t *bitmap, const rectangle &cliprect)
9292{
9393   int y, x;
9494   pen_t pens[NUM_PENS];
9595
9696   get_pens(state, pens);
9797
98   for (y = cliprect->min_y; y <= cliprect->max_y; y++)
99      for(x = cliprect->min_x; x <= cliprect->max_x; x++)
98   for (y = cliprect.min_y; y <= cliprect.max_y; y++)
99      for(x = cliprect.min_x; x <= cliprect.max_x; x++)
100100         bitmap->pix32(y, x) = pens[bitmap->pix32(y, x)];
101101}
102102
r13798r13799
132132 *
133133 *************************************/
134134
135static void draw_background_and_text(running_machine &machine, jedi_state *state, bitmap_t *bitmap, const rectangle *cliprect)
135static void draw_background_and_text(running_machine &machine, jedi_state *state, bitmap_t *bitmap, const rectangle &cliprect)
136136{
137137   int y;
138138   int background_line_buffer[0x200];   /* RAM chip at 2A */
r13798r13799
149149
150150   memset(background_line_buffer, 0, 0x200 * sizeof(int));
151151
152   for (y = cliprect->min_y; y <= cliprect->max_y; y++)
152   for (y = cliprect.min_y; y <= cliprect.max_y; y++)
153153   {
154154      int x;
155155      int bg_last_col = 0;
156156
157      for (x = cliprect->min_x; x <= cliprect->max_x; x += 2)
157      for (x = cliprect.min_x; x <= cliprect.max_x; x += 2)
158158      {
159159         int tx_col1, tx_col2, bg_col;
160160         int bg_tempcol;
r13798r13799
232232 *
233233 *************************************/
234234
235static void draw_sprites(running_machine &machine, jedi_state *state, bitmap_t *bitmap, const rectangle *cliprect)
235static void draw_sprites(running_machine &machine, jedi_state *state, bitmap_t *bitmap, const rectangle &cliprect)
236236{
237237   offs_t offs;
238238   UINT8 *spriteram = state->m_spriteram;
r13798r13799
276276         int i;
277277         UINT16 x = spriteram[offs + 0x100] + ((spriteram[offs + 0x40] & 0x01) << 8) - 2;
278278
279         if ((y < cliprect->min_y) || (y > cliprect->max_y))
279         if ((y < cliprect.min_y) || (y > cliprect.max_y))
280280            continue;
281281
282282         if (flip_x)
r13798r13799
333333
334334   /* if no video, clear it all to black */
335335   if (*state->m_video_off & 0x01)
336      bitmap->fill(RGB_BLACK, *cliprect);
336      bitmap->fill(RGB_BLACK, cliprect);
337337   else
338338   {
339339      /* draw the background/text layers, followed by the sprites
src/mame/video/suprnova.c
r13798r13799
66
77
88/* draws ROZ with linescroll OR columnscroll to 16-bit indexed bitmap */
9static void suprnova_draw_roz(bitmap_t* bitmap, bitmap_t* bitmapflags, const rectangle *cliprect, tilemap_t *tmap, UINT32 startx, UINT32 starty, int incxx, int incxy, int incyx, int incyy, int wraparound, int columnscroll, UINT32* scrollram)
9static void suprnova_draw_roz(bitmap_t* bitmap, bitmap_t* bitmapflags, const rectangle &cliprect, tilemap_t *tmap, UINT32 startx, UINT32 starty, int incxx, int incxy, int incyx, int incyy, int wraparound, int columnscroll, UINT32* scrollram)
1010{
1111   //bitmap_t *destbitmap = bitmap;
1212   bitmap_t *srcbitmap = tilemap_get_pixmap(tmap);
r13798r13799
3030   //int destadvance = destbitmap->bpp / 8;
3131
3232   /* pre-advance based on the cliprect */
33   startx += cliprect->min_x * incxx + cliprect->min_y * incyx;
34   starty += cliprect->min_x * incxy + cliprect->min_y * incyy;
33   startx += cliprect.min_x * incxx + cliprect.min_y * incyx;
34   starty += cliprect.min_x * incxy + cliprect.min_y * incyy;
3535
3636   /* extract start/end points */
37   sx = cliprect->min_x;
38   sy = cliprect->min_y;
39   ex = cliprect->max_x;
40   ey = cliprect->max_y;
37   sx = cliprect.min_x;
38   sy = cliprect.min_y;
39   ex = cliprect.max_x;
40   ey = cliprect.max_y;
4141
4242   {
4343      /* loop over rows */
r13798r13799
391391   state->m_alt_enable_background = state->m_alt_enable_sprites = 1;
392392}
393393
394static void supernova_draw_a( running_machine &machine, bitmap_t *bitmap, bitmap_t* bitmap_flags, const rectangle *cliprect, int tran )
394static void supernova_draw_a( running_machine &machine, bitmap_t *bitmap, bitmap_t* bitmap_flags, const rectangle &cliprect, int tran )
395395{
396396   skns_state *state = machine.driver_data<skns_state>();
397397   int enable_a  = (state->m_v3_regs[0x10/4] >> 0) & 0x0001;
r13798r13799
422422   }
423423}
424424
425static void supernova_draw_b( running_machine &machine, bitmap_t *bitmap, bitmap_t* bitmap_flags, const rectangle *cliprect, int tran )
425static void supernova_draw_b( running_machine &machine, bitmap_t *bitmap, bitmap_t* bitmap_flags, const rectangle &cliprect, int tran )
426426{
427427   skns_state *state = machine.driver_data<skns_state>();
428428   int enable_b  = (state->m_v3_regs[0x34/4] >> 0) & 0x0001;
r13798r13799
459459
460460   palette_update(screen.machine());
461461
462   bitmap->fill(get_black_pen(screen.machine()), *cliprect);
462   bitmap->fill(get_black_pen(screen.machine()), cliprect);
463463   state->m_tilemap_bitmap_lower->fill(0);
464464   state->m_tilemap_bitmapflags_lower->fill(0);
465465   state->m_tilemap_bitmap_higher->fill(0);
r13798r13799
628628      }
629629   }
630630
631   state->m_sprite_bitmap->fill(0x0000, *cliprect);
631   state->m_sprite_bitmap->fill(0x0000, cliprect);
632632
633633   if (state->m_alt_enable_sprites)
634634      state->m_spritegen->skns_draw_sprites(screen.machine(), state->m_sprite_bitmap, cliprect, screen.machine().generic.spriteram.u32, screen.machine().generic.spriteram_size, screen.machine().region("gfx1")->base(), screen.machine().region ("gfx1")->bytes(), state->m_spc_regs );
src/mame/video/seta2.c
r13798r13799
161161
162162***************************************************************************/
163163
164static void seta_drawgfx(   bitmap_t *bitmap, const rectangle *cliprect, const gfx_element *gfx,
164static void seta_drawgfx(   bitmap_t *bitmap, const rectangle &cliprect, const gfx_element *gfx,
165165                     UINT32 code,UINT32 color,int flipx,int flipy,int x0,int y0,
166166                     int shadow_depth )
167167{
r13798r13799
183183#define SETA_DRAWGFX(SETPIXELCOLOR)                                    \
184184   for ( sy = y0; sy != y1; sy += dy )                                 \
185185   {                                                         \
186      if ( sy >= cliprect->min_y && sy <= cliprect->max_y )               \
186      if ( sy >= cliprect.min_y && sy <= cliprect.max_y )               \
187187      {                                                      \
188188         source   =   addr;                                       \
189189         dest   =   &bitmap->pix16(sy);                     \
r13798r13799
192192         {                                                   \
193193            pen = *source++;                                    \
194194                                                            \
195            if ( pen && sx >= cliprect->min_x && sx <= cliprect->max_x )   \
195            if ( pen && sx >= cliprect.min_x && sx <= cliprect.max_x )   \
196196               SETPIXELCOLOR                                    \
197197         }                                                   \
198198      }                                                      \
r13798r13799
212212   }
213213}
214214
215static void draw_sprites(running_machine &machine, bitmap_t *bitmap,const rectangle *cliprect)
215static void draw_sprites(running_machine &machine, bitmap_t *bitmap,const rectangle &cliprect)
216216{
217217   // Sprites list
218218
r13798r13799
328328            clip.min_x = (clip.min_x & 0x1ff) - (clip.min_x & 0x200);
329329            clip.max_x = clip.min_x + width * 0x10 - 1;
330330
331            if (clip.min_x > cliprect->max_x)   continue;
332            if (clip.max_x < cliprect->min_x)   continue;
333            if (clip.min_x < cliprect->min_x)   clip.min_x = cliprect->min_x;
334            if (clip.max_x > cliprect->max_x)   clip.max_x = cliprect->max_x;
331            if (clip.min_x > cliprect.max_x)   continue;
332            if (clip.max_x < cliprect.min_x)   continue;
333            if (clip.min_x < cliprect.min_x)   clip.min_x = cliprect.min_x;
334            if (clip.max_x > cliprect.max_x)   clip.max_x = cliprect.max_x;
335335
336336            // sprite clipping region (y)
337337            clip.min_y = ((sy + yoffs) & 0x1ff) - state->m_yoffset;
338338            clip.max_y = clip.min_y + height * 0x10 - 1;
339339
340            if (clip.min_y > cliprect->max_y)   continue;
341            if (clip.max_y < cliprect->min_y)   continue;
342            if (clip.min_y < cliprect->min_y)   clip.min_y = cliprect->min_y;
343            if (clip.max_y > cliprect->max_y)   clip.max_y = cliprect->max_y;
340            if (clip.min_y > cliprect.max_y)   continue;
341            if (clip.max_y < cliprect.min_y)   continue;
342            if (clip.min_y < cliprect.min_y)   clip.min_y = cliprect.min_y;
343            if (clip.max_y > cliprect.max_y)   clip.max_y = cliprect.max_y;
344344
345345            dx = sx + (scrollx & 0x3ff) + xoffs + 0x10;
346346
r13798r13799
375375
376376                        dst_x = (dst_x & 0x1ff) - (dst_x & 0x200);
377377
378                        seta_drawgfx(bitmap, &clip, gfx,
378                        seta_drawgfx(bitmap, clip, gfx,
379379                              code ^ tx ^ (ty<<1),
380380                              color,
381381                              flipx, flipy,
r13798r13799
483483   seta2_state *state = screen.machine().driver_data<seta2_state>();
484484
485485   // Black or pen 0?
486   bitmap->fill(screen.machine().pens[0], *cliprect);
486   bitmap->fill(screen.machine().pens[0], cliprect);
487487
488488   if ( (state->m_vregs[0x30/2] & 1) == 0 )   // 1 = BLANK SCREEN
489489      draw_sprites(screen.machine(), bitmap, cliprect);
src/mame/video/flkatck.c
r13798r13799
165165   }
166166
167167   /* compute clipping */
168   clip[0] &= *cliprect;
169   clip[1] &= *cliprect;
168   clip[0] &= cliprect;
169   clip[1] &= cliprect;
170170
171171   /* draw the graphics */
172   tilemap_draw(bitmap, &clip[0], state->m_k007121_tilemap[0], 0, 0);
172   tilemap_draw(bitmap, clip[0], state->m_k007121_tilemap[0], 0, 0);
173173   k007121_sprites_draw(state->m_k007121, bitmap, cliprect, screen.machine().gfx[0], NULL, &state->m_k007121_ram[0x1000], 0, 40, 0, (UINT32)-1);
174   tilemap_draw(bitmap, &clip[1], state->m_k007121_tilemap[1], 0, 0);
174   tilemap_draw(bitmap, clip[1], state->m_k007121_tilemap[1], 0, 0);
175175   return 0;
176176}
src/mame/video/namcofl.c
r13798r13799
8686
8787   namcofl_install_palette(screen.machine());
8888
89   bitmap->fill(get_black_pen(screen.machine()), *cliprect );
89   bitmap->fill(get_black_pen(screen.machine()), cliprect );
9090
9191   for( pri=0; pri<16; pri++ )
9292   {
src/mame/video/dynax.c
r13798r13799
10001000
10011001***************************************************************************/
10021002
1003static void hanamai_copylayer( running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect, int i )
1003static void hanamai_copylayer( running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect, int i )
10041004{
10051005   dynax_state *state = machine.driver_data<dynax_state>();
10061006   int color;
r13798r13799
10641064}
10651065
10661066
1067static void jantouki_copylayer( running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect, int i, int y )
1067static void jantouki_copylayer( running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect, int i, int y )
10681068{
10691069   dynax_state *state = machine.driver_data<dynax_state>();
10701070   int color, scrollx, scrolly, palettes, palbank;
r13798r13799
11061106         UINT16 *dst;
11071107         UINT16 *dstbase = &bitmap->pix16(sy);
11081108
1109         if ((sy < cliprect->min_y) || (sy > cliprect->max_y))
1109         if ((sy < cliprect.min_y) || (sy > cliprect.max_y))
11101110         {
11111111            src1 += 256;
11121112            src2 += 256;
r13798r13799
11391139}
11401140
11411141
1142static void mjdialq2_copylayer( running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect, int i )
1142static void mjdialq2_copylayer( running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect, int i )
11431143{
11441144   dynax_state *state = machine.driver_data<dynax_state>();
11451145   int color;
r13798r13799
12271227    I,O        -  Change palette (-,+)
12281228    J,K & N,M  -  Change "tile"  (-,+, slow & fast)
12291229    R          -  move "tile" to the next 1/8th of the gfx  */
1230static int debug_viewer( running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect )
1230static int debug_viewer( running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect )
12311231{
12321232
12331233#ifdef MAME_DEBUG
r13798r13799
12551255      state->m_blit_palettes = (c & 0xf) * 0x111;
12561256      state->m_blit_palbank  = (c >>  4) & 1;
12571257
1258      bitmap->fill(0, *cliprect);
1258      bitmap->fill(0, cliprect);
12591259      memset(state->m_pixmap[0][0], 0, sizeof(UINT8) * 0x100 * 0x100);
12601260
12611261      if (state->m_layer_layout != LAYOUT_MJDIALQ2)
12621262         memset(state->m_pixmap[0][1], 0, sizeof(UINT8) * 0x100 * 0x100);
12631263      for (state->m_hanamai_layer_half = 0; state->m_hanamai_layer_half < 2; state->m_hanamai_layer_half++)
1264         blitter_drawgfx(machine, 0, 1, "gfx1", i, 0, cliprect->min_x, cliprect->min_y, 3, 0);
1264         blitter_drawgfx(machine, 0, 1, "gfx1", i, 0, cliprect.min_x, cliprect.min_y, 3, 0);
12651265
12661266      if (state->m_layer_layout != LAYOUT_MJDIALQ2)
12671267         hanamai_copylayer(machine, bitmap, cliprect, 0);
r13798r13799
12891289
12901290   layers_ctrl &= debug_mask(screen.machine());
12911291
1292   bitmap->fill((state->m_blit_backpen & 0xff) + (state->m_blit_palbank & 1) * 256, *cliprect);
1292   bitmap->fill((state->m_blit_backpen & 0xff) + (state->m_blit_palbank & 1) * 256, cliprect);
12931293
12941294   /* bit 4 = display enable? */
12951295   if (!(state->m_hanamai_priority & 0x10))
r13798r13799
13261326
13271327   layers_ctrl &= debug_mask(screen.machine());
13281328
1329   bitmap->fill((state->m_blit_backpen & 0xff) + (state->m_blit_palbank & 0x0f) * 256, *cliprect);
1329   bitmap->fill((state->m_blit_backpen & 0xff) + (state->m_blit_palbank & 0x0f) * 256, cliprect);
13301330
13311331   pri = state->m_hanamai_priority >> 4;
13321332
r13798r13799
13611361
13621362   layers_ctrl &= debug_mask(screen.machine());
13631363
1364   bitmap->fill((state->m_blit_backpen & 0xff) + (state->m_blit_palbank & 1) * 256, *cliprect);
1364   bitmap->fill((state->m_blit_backpen & 0xff) + (state->m_blit_palbank & 1) * 256, cliprect);
13651365
13661366   if (BIT(layers_ctrl, 0))   hanamai_copylayer(screen.machine(), bitmap, cliprect, 0);
13671367   if (BIT(layers_ctrl, 1))   hanamai_copylayer(screen.machine(), bitmap, cliprect, 1);
r13798r13799
13791379
13801380   layers_ctrl &= debug_mask(screen.machine());
13811381
1382   bitmap->fill((state->m_blit_backpen & 0xff) + (state->m_blit_palbank & 1) * 256, *cliprect);
1382   bitmap->fill((state->m_blit_backpen & 0xff) + (state->m_blit_palbank & 1) * 256, cliprect);
13831383
13841384//  if (BIT(layers_ctrl, 0))   jantouki_copylayer(screen.machine(), bitmap, cliprect, 3, 0);
13851385   if (BIT(layers_ctrl, 1))   jantouki_copylayer(screen.machine(), bitmap, cliprect, 2, 0);
r13798r13799
13981398
13991399   layers_ctrl &= debug_mask(screen.machine());
14001400
1401   bitmap->fill((state->m_blit_backpen & 0xff) + (state->m_blit_palbank & 1) * 256, *cliprect);
1401   bitmap->fill((state->m_blit_backpen & 0xff) + (state->m_blit_palbank & 1) * 256, cliprect);
14021402
14031403   if (BIT(layers_ctrl, 0))   jantouki_copylayer(screen.machine(), bitmap, cliprect, 3, 0);
14041404   if (BIT(layers_ctrl, 4))   jantouki_copylayer(screen.machine(), bitmap, cliprect, 7, 0);
r13798r13799
14191419
14201420   layers_ctrl &= debug_mask(screen.machine());
14211421
1422   bitmap->fill((state->m_blit_backpen & 0xff) + (state->m_blit_palbank & 1) * 256, *cliprect);
1422   bitmap->fill((state->m_blit_backpen & 0xff) + (state->m_blit_palbank & 1) * 256, cliprect);
14231423
14241424   if (BIT(layers_ctrl, 0))   mjdialq2_copylayer(screen.machine(), bitmap, cliprect, 0);
14251425   if (BIT(layers_ctrl, 1))   mjdialq2_copylayer(screen.machine(), bitmap, cliprect, 1);
r13798r13799
14431443   // format and let SCREEN_UPDATE(ddenlovr) do the final compositing (priorities + palettes)
14441444   for (layer = 0; layer < 4; layer++)
14451445   {
1446      bitmap->fill(0, *cliprect);
1446      bitmap->fill(0, cliprect);
14471447      hanamai_copylayer(screen.machine(), bitmap, cliprect, layer);
14481448
14491449      for (y = 0; y < 256; y++)
src/mame/video/shootout.c
r13798r13799
9191   tilemap_set_transparent_pen( state->m_foreground, 0 );
9292}
9393
94static void draw_sprites(running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect, int bank_bits )
94static void draw_sprites(running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect, int bank_bits )
9595{
9696   shootout_state *state = machine.driver_data<shootout_state>();
9797   UINT8 *spriteram = state->m_spriteram;
r13798r13799
175175{
176176   shootout_state *state = screen.machine().driver_data<shootout_state>();
177177
178   screen.machine().priority_bitmap->fill(0, *cliprect);
178   screen.machine().priority_bitmap->fill(0, cliprect);
179179
180180   tilemap_draw(bitmap,cliprect,state->m_background,0,0);
181181   tilemap_draw(bitmap,cliprect,state->m_foreground,0,1);
r13798r13799
187187{
188188   shootout_state *state = screen.machine().driver_data<shootout_state>();
189189
190   screen.machine().priority_bitmap->fill(0, *cliprect);
190   screen.machine().priority_bitmap->fill(0, cliprect);
191191
192192   tilemap_draw(bitmap,cliprect,state->m_background,0,0);
193193   tilemap_draw(bitmap,cliprect,state->m_foreground,0,1);
src/mame/video/contra.c
r13798r13799
301301
302302***************************************************************************/
303303
304static void draw_sprites(running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect, int bank )
304static void draw_sprites(running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect, int bank )
305305{
306306   contra_state *state = machine.driver_data<contra_state>();
307307   device_t *k007121 = bank ? state->m_k007121_2 : state->m_k007121_1;
r13798r13799
327327   rectangle fg_finalclip = state->m_fg_clip;
328328   rectangle tx_finalclip = state->m_tx_clip;
329329
330   bg_finalclip &= *cliprect;
331   fg_finalclip &= *cliprect;
332   tx_finalclip &= *cliprect;
330   bg_finalclip &= cliprect;
331   fg_finalclip &= cliprect;
332   tx_finalclip &= cliprect;
333333
334334   set_pens(screen.machine());
335335
r13798r13799
338338   tilemap_set_scrollx(state->m_bg_tilemap, 0, ctrl_2_0 - 40);
339339   tilemap_set_scrolly(state->m_bg_tilemap, 0, ctrl_2_2);
340340
341   tilemap_draw(bitmap, &bg_finalclip, state->m_bg_tilemap, 0 ,0);
342   tilemap_draw(bitmap, &fg_finalclip, state->m_fg_tilemap, 0 ,0);
341   tilemap_draw(bitmap, bg_finalclip, state->m_bg_tilemap, 0 ,0);
342   tilemap_draw(bitmap, fg_finalclip, state->m_fg_tilemap, 0 ,0);
343343   draw_sprites(screen.machine(),bitmap,cliprect, 0);
344344   draw_sprites(screen.machine(),bitmap,cliprect, 1);
345   tilemap_draw(bitmap, &tx_finalclip, state->m_tx_tilemap, 0 ,0);
345   tilemap_draw(bitmap, tx_finalclip, state->m_tx_tilemap, 0 ,0);
346346   return 0;
347347}
src/mame/video/volfied.c
r13798r13799
132132{
133133   volfied_state *state = screen.machine().driver_data<volfied_state>();
134134
135   screen.machine().priority_bitmap->fill(0, *cliprect);
135   screen.machine().priority_bitmap->fill(0, cliprect);
136136   refresh_pixel_layer(screen.machine(), bitmap);
137137   pc090oj_draw_sprites(state->m_pc090oj, bitmap, cliprect, 0);
138138   return 0;
src/mame/video/paradise.c
r13798r13799
192192   state->m_priority = data;
193193}
194194
195static void draw_sprites( running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect )
195static void draw_sprites( running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect )
196196{
197197   paradise_state *state = machine.driver_data<paradise_state>();
198198   UINT8 *spriteram = state->m_spriteram;
r13798r13799
259259}
260260#endif
261261
262   bitmap->fill(get_black_pen(screen.machine()), *cliprect);
262   bitmap->fill(get_black_pen(screen.machine()), cliprect);
263263
264264   if (!(state->m_priority & 4))   /* Screen blanking */
265265      return 0;
r13798r13799
296296{
297297   paradise_state *state = screen.machine().driver_data<paradise_state>();
298298
299   bitmap->fill(get_black_pen(screen.machine()), *cliprect);
299   bitmap->fill(get_black_pen(screen.machine()), cliprect);
300300
301301   if (!(state->m_priority & 2))   /* Screen blanking */
302302      return 0;
r13798r13799
328328{
329329   paradise_state *state = screen.machine().driver_data<paradise_state>();
330330
331   bitmap->fill(get_black_pen(screen.machine()), *cliprect);
331   bitmap->fill(get_black_pen(screen.machine()), cliprect);
332332   tilemap_draw(bitmap, cliprect, state->m_tilemap_0, 0, 0);
333333   tilemap_draw(bitmap, cliprect, state->m_tilemap_1, 0, 0);
334334   tilemap_draw(bitmap, cliprect, state->m_tilemap_2, 0, 0);
src/mame/video/dribling.c
r13798r13799
6666   int x, y;
6767
6868   /* loop over rows */
69   for (y = cliprect->min_y; y <= cliprect->max_y; y++)
69   for (y = cliprect.min_y; y <= cliprect.max_y; y++)
7070   {
7171      UINT16 *dst = &bitmap->pix16(y);
7272
7373      /* loop over columns */
74      for (x = cliprect->min_x; x <= cliprect->max_x; x++)
74      for (x = cliprect.min_x; x <= cliprect.max_x; x++)
7575      {
7676         int b7 = prombase[(x >> 3) | ((y >> 3) << 5)] & 1;
7777         int b6 = state->m_abca;
src/mame/video/balsente.c
r13798r13799
126126 *
127127 *************************************/
128128
129static void draw_one_sprite(running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect, UINT8 *sprite)
129static void draw_one_sprite(running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect, UINT8 *sprite)
130130{
131131   balsente_state *state = machine.driver_data<balsente_state>();
132132   int flags = sprite[0];
r13798r13799
143143   /* loop over y */
144144   for (y = 0; y < 16; y++, ypos = (ypos + 1) & 255)
145145   {
146      if (ypos >= (16 + BALSENTE_VBEND) && ypos >= cliprect->min_y && ypos <= cliprect->max_y)
146      if (ypos >= (16 + BALSENTE_VBEND) && ypos >= cliprect.min_y && ypos <= cliprect.max_y)
147147      {
148148         const pen_t *pens = &machine.pens[state->m_palettebank_vis * 256];
149149         UINT8 *old = &state->m_expanded_videoram[(ypos - BALSENTE_VBEND) * 256 + xpos];
r13798r13799
217217   int y, i;
218218
219219   /* draw scanlines from the VRAM directly */
220   for (y = cliprect->min_y; y <= cliprect->max_y; y++)
220   for (y = cliprect.min_y; y <= cliprect.max_y; y++)
221221      draw_scanline8(bitmap, 0, y, 256, &state->m_expanded_videoram[(y - BALSENTE_VBEND) * 256], pens);
222222
223223   /* draw the sprite images */
src/mame/video/itech32.c
r13798r13799
14361436   int y;
14371437
14381438   /* loop over height */
1439   for (y = cliprect->min_y; y <= cliprect->max_y; y++)
1439   for (y = cliprect.min_y; y <= cliprect.max_y; y++)
14401440   {
14411441      UINT16 *src1 = &state->m_videoplane[0][compute_safe_address(state, VIDEO_DISPLAY_XORIGIN1, VIDEO_DISPLAY_YORIGIN1 + y)];
14421442
r13798r13799
14481448         int x;
14491449
14501450         /* blend the pixels in the scanline; color xxFF is transparent */
1451         for (x = cliprect->min_x; x <= cliprect->max_x; x++)
1451         for (x = cliprect.min_x; x <= cliprect.max_x; x++)
14521452         {
14531453            UINT16 pixel = src1[x];
14541454            if ((pixel & 0xff) == 0xff)
r13798r13799
14571457         }
14581458
14591459         /* draw from the buffer */
1460         draw_scanline16(bitmap, cliprect->min_x, y, cliprect->max_x - cliprect->min_x + 1, &scanline[cliprect->min_x], NULL);
1460         draw_scanline16(bitmap, cliprect.min_x, y, cliprect.max_x - cliprect.min_x + 1, &scanline[cliprect.min_x], NULL);
14611461      }
14621462
14631463      /* otherwise, draw directly from VRAM */
14641464      else
1465         draw_scanline16(bitmap, cliprect->min_x, y, cliprect->max_x - cliprect->min_x + 1, &src1[cliprect->min_x], NULL);
1465         draw_scanline16(bitmap, cliprect.min_x, y, cliprect.max_x - cliprect.min_x + 1, &src1[cliprect.min_x], NULL);
14661466   }
14671467   return 0;
14681468}
src/mame/video/mexico86.c
r13798r13799
2727   /* Bubble Bobble doesn't have a real video RAM. All graphics (characters */
2828   /* and sprites) are stored in the same memory region, and information on */
2929   /* the background character columns is stored inthe area dd00-dd3f */
30   bitmap->fill(255, *cliprect);
30   bitmap->fill(255, cliprect);
3131
3232   sx = 0;
3333
r13798r13799
109109   int goffs, code, color, y;
110110   int tx, ty;
111111
112   bitmap->fill(get_black_pen(screen.machine()), *cliprect);
112   bitmap->fill(get_black_pen(screen.machine()), cliprect);
113113   sx = 0;
114114   for (offs = 0; offs < state->m_objectram_size; offs += 4)
115115   {
src/mame/video/chaknpop.c
r13798r13799
183183  Screen refresh
184184***************************************************************************/
185185
186static void draw_sprites( running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect )
186static void draw_sprites( running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect )
187187{
188188   chaknpop_state *state = machine.driver_data<chaknpop_state>();
189189   int offs;
r13798r13799
218218   }
219219}
220220
221static void draw_bitmap( running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect )
221static void draw_bitmap( running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect )
222222{
223223   chaknpop_state *state = machine.driver_data<chaknpop_state>();
224224   int dx = state->m_flip_x ? -1 : 1;
src/mame/video/fitfight.c
r13798r13799
44#include "includes/fitfight.h"
55
66
7static void draw_sprites( running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect, int layer )
7static void draw_sprites( running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect, int layer )
88{
99   fitfight_state *state = machine.driver_data<fitfight_state>();
1010   const gfx_element *gfx = machine.gfx[3];
r13798r13799
126126   vblank = (state->m_fof_700000[0] & 0x8000);
127127
128128   if (vblank > 0)
129      bitmap->fill(get_black_pen(screen.machine()), *cliprect);
129      bitmap->fill(get_black_pen(screen.machine()), cliprect);
130130   else {
131131//      if (screen.machine().input().code_pressed(KEYCODE_Q))
132132//          scrollbak = ((state->m_fof_a00000[0] & 0xff00) >> 5) - ((state->m_fof_700000[0] & 0x0038) >> 3);
src/mame/video/sspeedr.c
r13798r13799
181181}
182182
183183
184static void draw_drones(running_machine &machine, bitmap_t* bitmap, const rectangle* cliprect)
184static void draw_drones(running_machine &machine, bitmap_t* bitmap, const rectangle &cliprect)
185185{
186186   sspeedr_state *state = machine.driver_data<sspeedr_state>();
187187   static const UINT8 code[6] =
r13798r13799
221221}
222222
223223
224static void draw_driver(running_machine &machine, bitmap_t* bitmap, const rectangle* cliprect)
224static void draw_driver(running_machine &machine, bitmap_t* bitmap, const rectangle &cliprect)
225225{
226226   sspeedr_state *state = machine.driver_data<sspeedr_state>();
227227   int x;
src/mame/video/terracre.c
r13798r13799
3131   SET_TILE_INFO( 0,data&0xff,0,0 );
3232}
3333
34static void draw_sprites(running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect )
34static void draw_sprites(running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect )
3535{
3636   terracre_state *state = machine.driver_data<terracre_state>();
3737   const UINT8 *spritepalettebank = machine.region("user1")->base();
r13798r13799
206206{
207207   terracre_state *state = screen.machine().driver_data<terracre_state>();
208208   if( state->m_xscroll&0x2000 )
209      bitmap->fill(get_black_pen(screen.machine()), *cliprect );
209      bitmap->fill(get_black_pen(screen.machine()), cliprect );
210210   else
211211      tilemap_draw( bitmap,cliprect, state->m_background, 0, 0 );
212212
src/mame/video/ddribble.c
r13798r13799
176176
177177***************************************************************************/
178178
179static void draw_sprites( running_machine& machine, bitmap_t *bitmap, const rectangle *cliprect, UINT8* source, int lenght, int gfxset, int flipscreen )
179static void draw_sprites( running_machine& machine, bitmap_t *bitmap, const rectangle &cliprect, UINT8* source, int lenght, int gfxset, int flipscreen )
180180{
181181   gfx_element *gfx = machine.gfx[gfxset];
182182   const UINT8 *finish = source + lenght;
src/mame/video/undrfire.c
r13798r13799
6464
6565***************************************************************/
6666
67static void draw_sprites(running_machine &machine, bitmap_t *bitmap,const rectangle *cliprect,const int *primasks,int x_offs,int y_offs)
67static void draw_sprites(running_machine &machine, bitmap_t *bitmap,const rectangle &cliprect,const int *primasks,int x_offs,int y_offs)
6868{
6969   undrfire_state *state = machine.driver_data<undrfire_state>();
7070   UINT32 *spriteram32 = state->m_spriteram;
r13798r13799
208208}
209209
210210
211static void draw_sprites_cbombers(running_machine &machine, bitmap_t *bitmap,const rectangle *cliprect,const int *primasks,int x_offs,int y_offs)
211static void draw_sprites_cbombers(running_machine &machine, bitmap_t *bitmap,const rectangle &cliprect,const int *primasks,int x_offs,int y_offs)
212212{
213213   undrfire_state *state = machine.driver_data<undrfire_state>();
214214   UINT32 *spriteram32 = state->m_spriteram;
r13798r13799
408408   pivlayer[1] = pivlayer[0] ^ 1;
409409   pivlayer[2] = 2;
410410
411   screen.machine().priority_bitmap->fill(0, *cliprect);
412   bitmap->fill(0, *cliprect);   /* wrong color? */
411   screen.machine().priority_bitmap->fill(0, cliprect);
412   bitmap->fill(0, cliprect);   /* wrong color? */
413413
414414
415415/* The "PIV" chip seems to be a renamed TC0100SCN. It has a
r13798r13799
551551   pivlayer[1] = pivlayer[0] ^ 1;
552552   pivlayer[2] = 2;
553553
554   screen.machine().priority_bitmap->fill(0, *cliprect);
555   bitmap->fill(0, *cliprect);   /* wrong color? */
554   screen.machine().priority_bitmap->fill(0, cliprect);
555   bitmap->fill(0, cliprect);   /* wrong color? */
556556
557557
558558/* The "PIV" chip seems to be a renamed TC0100SCN. It has a
src/mame/video/amiga.c
r13798r13799
10041004   int y;
10051005
10061006   /* render each scanline in the visible region */
1007   for (y = cliprect->min_y; y <= cliprect->max_y; y++)
1007   for (y = cliprect.min_y; y <= cliprect.max_y; y++)
10081008      amiga_render_scanline(screen.machine(), bitmap, y);
10091009
10101010   return 0;
src/mame/video/deco32.c
r13798r13799
152152
153153
154154INLINE void dragngun_drawgfxzoom(
155      bitmap_t *dest_bmp,const rectangle *clip,const gfx_element *gfx,
155      bitmap_t *dest_bmp,const rectangle &clip,const gfx_element *gfx,
156156      UINT32 code,UINT32 color,int flipx,int flipy,int sx,int sy,
157157      int transparent_color,
158158      int scalex, int scaley,bitmap_t *pri_buffer,UINT32 pri_mask, int sprite_screen_width, int  sprite_screen_height, UINT8 alpha )
r13798r13799
169169    */
170170
171171   /* KW 991012 -- Added code to force clip to bitmap boundary */
172   if(clip)
173   {
174      myclip = *clip;
175      myclip &= dest_bmp->cliprect();
176      clip=&myclip;
177   }
172   myclip = clip;
173   myclip &= dest_bmp->cliprect();
178174
179175   {
180176      if( gfx )
r13798r13799
214210               y_index = 0;
215211            }
216212
217            if( clip )
218            {
219               if( sx < clip->min_x)
220               { /* clip left */
221                  int pixels = clip->min_x-sx;
222                  sx += pixels;
223                  x_index_base += pixels*dx;
224               }
225               if( sy < clip->min_y )
226               { /* clip top */
227                  int pixels = clip->min_y-sy;
228                  sy += pixels;
229                  y_index += pixels*dy;
230               }
231               /* NS 980211 - fixed incorrect clipping */
232               if( ex > clip->max_x+1 )
233               { /* clip right */
234                  int pixels = ex-clip->max_x-1;
235                  ex -= pixels;
236               }
237               if( ey > clip->max_y+1 )
238               { /* clip bottom */
239                  int pixels = ey-clip->max_y-1;
240                  ey -= pixels;
241               }
213            if( sx < clip.min_x)
214            { /* clip left */
215               int pixels = clip.min_x-sx;
216               sx += pixels;
217               x_index_base += pixels*dx;
242218            }
219            if( sy < clip.min_y )
220            { /* clip top */
221               int pixels = clip.min_y-sy;
222               sy += pixels;
223               y_index += pixels*dy;
224            }
225            /* NS 980211 - fixed incorrect clipping */
226            if( ex > clip.max_x+1 )
227            { /* clip right */
228               int pixels = ex-clip.max_x-1;
229               ex -= pixels;
230            }
231            if( ey > clip.max_y+1 )
232            { /* clip bottom */
233               int pixels = ey-clip.max_y-1;
234               ey -= pixels;
235            }
243236
244237            if( ex>sx )
245238            { /* skip if inner loop doesn't draw anything */
r13798r13799
344337   }
345338}
346339
347static void dragngun_draw_sprites(running_machine& machine, bitmap_t *bitmap, const rectangle *cliprect, const UINT32 *spritedata)
340static void dragngun_draw_sprites(running_machine& machine, bitmap_t *bitmap, const rectangle &cliprect, const UINT32 *spritedata)
348341{
349342   dragngun_state *state = machine.driver_data<dragngun_state>();
350343   const UINT32 *layout_ram;
r13798r13799
596589
597590   tilemap_set_flip_all(screen.machine(),flip_screen_get(screen.machine()) ? (TILEMAP_FLIPY | TILEMAP_FLIPX) : 0);
598591
599   screen.machine().priority_bitmap->fill(0, *cliprect);
600   bitmap->fill(screen.machine().pens[0x000], *cliprect); // Palette index not confirmed
592   screen.machine().priority_bitmap->fill(0, cliprect);
593   bitmap->fill(screen.machine().pens[0x000], cliprect); // Palette index not confirmed
601594
602595   deco16ic_set_pf1_8bpp_mode(state->m_deco_tilegen2, 1);
603596
r13798r13799
631624   state->m_deco_tilegen1 = screen.machine().device("tilegen1");
632625   state->m_deco_tilegen2 = screen.machine().device("tilegen2");
633626
634   bitmap->fill(get_black_pen(screen.machine()), *cliprect);
627   bitmap->fill(get_black_pen(screen.machine()), cliprect);
635628
636629   deco16ic_pf_update(state->m_deco_tilegen1, state->m_pf1_rowscroll, state->m_pf2_rowscroll);
637630   deco16ic_pf_update(state->m_deco_tilegen2, state->m_pf3_rowscroll, state->m_pf4_rowscroll);
r13798r13799
652645   // with the concept of generic tilemap code.
653646   //
654647   // for now we only draw these 2 layers on the last update call
655   if (cliprect->max_y == 247)
648   if (cliprect.max_y == 247)
656649   {
657650      rectangle clip;
658      clip.min_x = cliprect->min_x;
659      clip.max_x = cliprect->max_x;
651      clip.min_x = cliprect.min_x;
652      clip.max_x = cliprect.max_x;
660653      clip.min_y = 8;
661654      clip.max_y = 247;
662655
663      dragngun_draw_sprites(screen.machine(),bitmap,&clip,screen.machine().generic.buffered_spriteram.u32);
664      deco16ic_tilemap_1_draw(state->m_deco_tilegen1, bitmap, &clip, 0, 0);
656      dragngun_draw_sprites(screen.machine(),bitmap,clip,screen.machine().generic.buffered_spriteram.u32);
657      deco16ic_tilemap_1_draw(state->m_deco_tilegen1, bitmap, clip, 0, 0);
665658
666659   }
667660
r13798r13799
675668   state->m_deco_tilegen1 = screen.machine().device("tilegen1");
676669   state->m_deco_tilegen2 = screen.machine().device("tilegen2");
677670
678   screen.machine().priority_bitmap->fill(0, *cliprect);
679   bitmap->fill(screen.machine().pens[0x000], *cliprect); // Palette index not confirmed
671   screen.machine().priority_bitmap->fill(0, cliprect);
672   bitmap->fill(screen.machine().pens[0x000], cliprect); // Palette index not confirmed
680673
681674   deco16ic_pf_update(state->m_deco_tilegen1, state->m_pf1_rowscroll, state->m_pf2_rowscroll);
682675   deco16ic_pf_update(state->m_deco_tilegen2, state->m_pf3_rowscroll, state->m_pf4_rowscroll);
r13798r13799
713706    blending support - it can't be done in-place on the final framebuffer
714707    without a lot of support bitmaps.
715708*/
716static void mixDualAlphaSprites(bitmap_t *bitmap, const rectangle *cliprect, const gfx_element *gfx0, const gfx_element *gfx1, int mixAlphaTilemap)
709static void mixDualAlphaSprites(bitmap_t *bitmap, const rectangle &cliprect, const gfx_element *gfx0, const gfx_element *gfx1, int mixAlphaTilemap)
717710{
718711   deco32_state *state = gfx0->machine().driver_data<deco32_state>();
719712   running_machine &machine = gfx0->machine();
r13798r13799
863856   if (state->m_ace_ram_dirty)
864857      updateAceRam(screen.machine());
865858
866   screen.machine().priority_bitmap->fill(0, *cliprect);
859   screen.machine().priority_bitmap->fill(0, cliprect);
867860
868   bitmap->fill(screen.machine().pens[0x200], *cliprect);
861   bitmap->fill(screen.machine().pens[0x200], cliprect);
869862
870863   /* Draw sprites to temporary bitmaps, saving alpha & priority info for later mixing */
871864   screen.machine().device<decospr_device>("spritegen1")->set_pix_raw_shift(8);
r13798r13799
876869
877870
878871   /* Render alpha-blended tilemap to separate buffer for proper mixing */
879   state->m_tilemap_alpha_bitmap->fill(0, *cliprect);
872   state->m_tilemap_alpha_bitmap->fill(0, cliprect);
880873
881874   /* Draw playfields & sprites */
882875   if (state->m_pri&2)
src/mame/video/malzak.c
r13798r13799
5454   {
5555      int y;
5656
57      for (y = cliprect->min_y; y <= cliprect->max_y / 2; y++)
57      for (y = cliprect.min_y; y <= cliprect.max_y / 2; y++)
5858      {
5959         int x;
6060
61         for (x = cliprect->min_x; x <= cliprect->max_x / 2; x++)
61         for (x = cliprect.min_x; x <= cliprect.max_x / 2; x++)
6262         {
6363            int pixel0 = s2636_0_bitmap->pix16(y, x);
6464            int pixel1 = s2636_1_bitmap->pix16(y, x);
src/mame/video/midzeus.c
r13798r13799
343343   {
344344      const void *base = waveram1_ptr_from_expanded_addr(zeusbase[0xcc]);
345345      int xoffs = screen.visible_area().min_x;
346      for (y = cliprect->min_y; y <= cliprect->max_y; y++)
346      for (y = cliprect.min_y; y <= cliprect.max_y; y++)
347347      {
348348         UINT16 *dest = &bitmap->pix16(y);
349         for (x = cliprect->min_x; x <= cliprect->max_x; x++)
349         for (x = cliprect.min_x; x <= cliprect.max_x; x++)
350350            dest[x] = WAVERAM_READPIX(base, y, x - xoffs) & 0x7fff;
351351      }
352352   }
r13798r13799
364364      if (yoffs < 0) yoffs = 0;
365365      base = waveram0_ptr_from_block_addr(yoffs << 12);
366366
367      for (y = cliprect->min_y; y <= cliprect->max_y; y++)
367      for (y = cliprect.min_y; y <= cliprect.max_y; y++)
368368      {
369369         UINT16 *dest = &bitmap->pix16(y);
370         for (x = cliprect->min_x; x <= cliprect->max_x; x++)
370         for (x = cliprect.min_x; x <= cliprect.max_x; x++)
371371         {
372372            UINT8 tex = get_texel_8bit(base, y, x, texel_width);
373373            dest[x] = (tex << 8) | tex;
r13798r13799
653653               extra->solidcolor = zeusbase[0x00];
654654               extra->zoffset = 0x7fff;
655655
656               poly_render_quad(poly, NULL, &zeus_cliprect, render_poly_solid_fixedz, 0, &vert[0], &vert[1], &vert[2], &vert[3]);
656               poly_render_quad(poly, NULL, zeus_cliprect, render_poly_solid_fixedz, 0, &vert[0], &vert[1], &vert[2], &vert[3]);
657657               poly_wait(poly, "Normal");
658658            }
659659            else
r13798r13799
12751275   extra->transcolor = ((ctrl_word >> 16) & 1) ? 0 : 0x100;
12761276   extra->palbase = waveram0_ptr_from_block_addr(zeus_palbase);
12771277
1278   poly_render_quad_fan(poly, NULL, &zeus_cliprect, callback, 4, numverts, &clipvert[0]);
1278   poly_render_quad_fan(poly, NULL, zeus_cliprect, callback, 4, numverts, &clipvert[0]);
12791279}
12801280
12811281
src/mame/video/grchamp.c
r13798r13799
168168   return result?(1<<which):0;
169169}
170170
171static void draw_fog(grchamp_state *state, bitmap_t *bitmap, const rectangle *cliprect, int fog)
171static void draw_fog(grchamp_state *state, bitmap_t *bitmap, const rectangle &cliprect, int fog)
172172{
173173   int x,y,offs;
174174
r13798r13799
185185   }
186186}
187187
188static void draw_sprites(running_machine &machine, grchamp_state *state, bitmap_t *bitmap, const rectangle *cliprect)
188static void draw_sprites(running_machine &machine, grchamp_state *state, bitmap_t *bitmap, const rectangle &cliprect)
189189{
190190   const gfx_element *gfx = machine.gfx[5];
191191   int bank = (state->m_cpu0_out[0] & 0x20) ? 0x40 : 0x00;
r13798r13799
395395   cxmask = (state->m_cpu1_out[3] & 0x20) ? 0xff : 0x1ff;
396396
397397   /* iterate over scanlines */
398   for (y = cliprect->min_y; y <= cliprect->max_y; y++)
398   for (y = cliprect.min_y; y <= cliprect.max_y; y++)
399399   {
400400      /* select either left or right tilemaps based on Y */
401401      bitmap_t *lrpixmap = (y < 128) ? lpixmap : rpixmap;
r13798r13799
412412      draw_objects(screen.machine(), state, y, objdata);
413413
414414      /* iterate over columns */
415      for (x = cliprect->min_x; x <= cliprect->max_x; x++)
415      for (x = cliprect.min_x; x <= cliprect.max_x; x++)
416416      {
417417         rgb_t finalpix;
418418         int headbit = 0;
src/mame/video/argus.c
r13798r13799
851851   }
852852}
853853
854static void argus_draw_sprites(running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect, int priority)
854static void argus_draw_sprites(running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect, int priority)
855855{
856856   argus_state *state = machine.driver_data<argus_state>();
857857   UINT8 *spriteram = state->m_spriteram;
r13798r13799
894894}
895895
896896#if 1
897static void valtric_draw_mosaic(screen_device &screen, bitmap_t *bitmap, const rectangle *cliprect)
897static void valtric_draw_mosaic(screen_device &screen, bitmap_t *bitmap, const rectangle &cliprect)
898898{
899899   argus_state *state = screen.machine().driver_data<argus_state>();
900900
r13798r13799
943943   }
944944}
945945#else
946static void valtric_draw_mosaic(screen_device &screen, bitmap_t *bitmap, const rectangle *cliprect)
946static void valtric_draw_mosaic(screen_device &screen, bitmap_t *bitmap, const rectangle &cliprect)
947947{
948948   argus_state *state = screen.machine().driver_data<argus_state>();
949949   int step = 0x10 - (state->m_valtric_mosaic & 0x0f);
r13798r13799
984984}
985985#endif
986986
987static void valtric_draw_sprites(running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect)
987static void valtric_draw_sprites(running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect)
988988{
989989   argus_state *state = machine.driver_data<argus_state>();
990990   UINT8 *spriteram = state->m_spriteram;
r13798r13799
10241024   }
10251025}
10261026
1027static void butasan_draw_sprites(running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect)
1027static void butasan_draw_sprites(running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect)
10281028{
10291029   argus_state *state = machine.driver_data<argus_state>();
10301030   UINT8 *spriteram = state->m_spriteram;
r13798r13799
12141214   if (state->m_bg_status & 1)   /* Backgound enable */
12151215      valtric_draw_mosaic(screen, bitmap, cliprect);
12161216   else
1217      bitmap->fill(get_black_pen(screen.machine()), *cliprect);
1217      bitmap->fill(get_black_pen(screen.machine()), cliprect);
12181218   valtric_draw_sprites(screen.machine(), bitmap, cliprect);
12191219   tilemap_draw(bitmap, cliprect, state->m_tx_tilemap,  0, 0);
12201220   return 0;
r13798r13799
12281228   if (state->m_bg_status & 1)   /* Backgound enable */
12291229      tilemap_draw(bitmap, cliprect, state->m_bg0_tilemap, 0, 0);
12301230   else
1231      bitmap->fill(get_black_pen(screen.machine()), *cliprect);
1231      bitmap->fill(get_black_pen(screen.machine()), cliprect);
12321232   if (state->m_butasan_bg1_status & 1) tilemap_draw(bitmap, cliprect, state->m_bg1_tilemap, 0, 0);
12331233   butasan_draw_sprites(screen.machine(), bitmap, cliprect);
12341234   tilemap_draw(bitmap, cliprect, state->m_tx_tilemap,  0, 0);
src/mame/video/lkage.c
r13798r13799
104104}
105105
106106
107static void draw_sprites( running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect )
107static void draw_sprites( running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect )
108108{
109109   lkage_state *state = machine.driver_data<lkage_state>();
110110   const UINT8 *source = state->m_spriteram;
r13798r13799
215215   tilemap_set_scrollx(state->m_bg_tilemap, 0, state->m_scroll[4]);
216216   tilemap_set_scrolly(state->m_bg_tilemap, 0, state->m_scroll[5]);
217217
218   screen.machine().priority_bitmap->fill(0, *cliprect);
218   screen.machine().priority_bitmap->fill(0, cliprect);
219219   if ((state->m_vreg[2] & 0xf0) == 0xf0)
220220   {
221221      tilemap_draw(bitmap, cliprect, state->m_bg_tilemap, 0, 1);
src/mame/video/zaxxon.c
r13798r13799
322322 *
323323 *************************************/
324324
325static void draw_background(running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect, int skew)
325static void draw_background(running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect, int skew)
326326{
327327   zaxxon_state *state = machine.driver_data<zaxxon_state>();
328328
r13798r13799
345345         flipoffs += 7;
346346
347347      /* loop over visible rows */
348      for (y = cliprect->min_y; y <= cliprect->max_y; y++)
348      for (y = cliprect.min_y; y <= cliprect.max_y; y++)
349349      {
350350         UINT16 *dst = &bitmap->pix16(y);
351351         int srcx, srcy, vf;
r13798r13799
360360         src = &pixmap->pix16(srcy & ymask);
361361
362362         /* loop over visible colums */
363         for (x = cliprect->min_x; x <= cliprect->max_x; x++)
363         for (x = cliprect.min_x; x <= cliprect.max_x; x++)
364364         {
365365            /* start with HF = flipped H signals */
366366            srcx = x ^ flipmask;
r13798r13799
384384
385385   /* if not enabled, fill the background with black */
386386   else
387      bitmap->fill(get_black_pen(machine), *cliprect);
387      bitmap->fill(get_black_pen(machine), cliprect);
388388}
389389
390390
r13798r13799
440440}
441441
442442
443static void draw_sprites(running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect, UINT16 flipxmask, UINT16 flipymask)
443static void draw_sprites(running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect, UINT16 flipxmask, UINT16 flipymask)
444444{
445445   zaxxon_state *state = machine.driver_data<zaxxon_state>();
446446   UINT8 *spriteram = state->m_spriteram;
src/mame/video/gaiden.c
r13798r13799
311311   in the bitmaps? */
312312static void blendbitmaps(running_machine &machine,
313313      bitmap_t *dest,bitmap_t *src1,bitmap_t *src2,bitmap_t *src3,
314      int sx,int sy,const rectangle *cliprect)
314      int sx,int sy,const rectangle &cliprect)
315315{
316316   int y,x;
317317   const pen_t *paldata = machine.pens;
318318
319   for (y = cliprect->min_y; y <= cliprect->max_y; y++)
319   for (y = cliprect.min_y; y <= cliprect.max_y; y++)
320320   {
321321      UINT32 *dd  = &dest->pix32(y);
322322      UINT16 *sd1 = &src1->pix16(y);
323323      UINT16 *sd2 = &src2->pix16(y);
324324      UINT16 *sd3 = &src3->pix16(y);
325325
326      for (x = cliprect->min_x; x <= cliprect->max_x; x++)
326      for (x = cliprect.min_x; x <= cliprect.max_x; x++)
327327      {
328328         if (sd3[x])
329329         {
r13798r13799
367367
368368#define NUM_SPRITES 256
369369
370static void gaiden_draw_sprites( running_machine &machine, bitmap_t *bitmap_bg, bitmap_t *bitmap_fg, bitmap_t *bitmap_sp, const rectangle *cliprect )
370static void gaiden_draw_sprites( running_machine &machine, bitmap_t *bitmap_bg, bitmap_t *bitmap_fg, bitmap_t *bitmap_sp, const rectangle &cliprect )
371371{
372372   static const UINT8 layout[8][8] =
373373   {
r13798r13799
489489}
490490
491491
492static void raiga_draw_sprites( running_machine &machine, bitmap_t *bitmap_bg, bitmap_t *bitmap_fg, bitmap_t *bitmap_sp, const rectangle *cliprect )
492static void raiga_draw_sprites( running_machine &machine, bitmap_t *bitmap_bg, bitmap_t *bitmap_fg, bitmap_t *bitmap_sp, const rectangle &cliprect )
493493{
494494   static const UINT8 layout[8][8] =
495495   {
r13798r13799
629629 *         |---------x------- | x position (high bit)
630630 */
631631
632static void drgnbowl_draw_sprites(running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect)
632static void drgnbowl_draw_sprites(running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect)
633633{
634634   gaiden_state *state = machine.driver_data<gaiden_state>();
635635   UINT16 *spriteram = state->m_spriteram;
r13798r13799
673673SCREEN_UPDATE( gaiden )
674674{
675675   gaiden_state *state = screen.machine().driver_data<gaiden_state>();
676   screen.machine().priority_bitmap->fill(0, *cliprect);
676   screen.machine().priority_bitmap->fill(0, cliprect);
677677
678   state->m_tile_bitmap_bg->fill(0x200, *cliprect);
679   state->m_tile_bitmap_fg->fill(0, *cliprect);
680   state->m_sprite_bitmap->fill(0, *cliprect);
678   state->m_tile_bitmap_bg->fill(0x200, cliprect);
679   state->m_tile_bitmap_fg->fill(0, cliprect);
680   state->m_sprite_bitmap->fill(0, cliprect);
681681
682682   /* draw tilemaps into a 16-bit bitmap */
683683   tilemap_draw(state->m_tile_bitmap_bg, cliprect, state->m_background, 0, 1);
r13798r13799
699699SCREEN_UPDATE( raiga )
700700{
701701   gaiden_state *state = screen.machine().driver_data<gaiden_state>();
702   screen.machine().priority_bitmap->fill(0, *cliprect);
702   screen.machine().priority_bitmap->fill(0, cliprect);
703703
704   state->m_tile_bitmap_bg->fill(0x200, *cliprect);
705   state->m_tile_bitmap_fg->fill(0, *cliprect);
706   state->m_sprite_bitmap->fill(0, *cliprect);
704   state->m_tile_bitmap_bg->fill(0x200, cliprect);
705   state->m_tile_bitmap_fg->fill(0, cliprect);
706   state->m_sprite_bitmap->fill(0, cliprect);
707707
708708   /* draw tilemaps into a 16-bit bitmap */
709709   tilemap_draw(state->m_tile_bitmap_bg, cliprect, state->m_background, 0, 1);
r13798r13799
724724SCREEN_UPDATE( drgnbowl )
725725{
726726   gaiden_state *state = screen.machine().driver_data<gaiden_state>();
727   screen.machine().priority_bitmap->fill(0, *cliprect);
727   screen.machine().priority_bitmap->fill(0, cliprect);
728728
729729   tilemap_draw(bitmap, cliprect, state->m_background, 0, 1);
730730   tilemap_draw(bitmap, cliprect, state->m_foreground, 0, 2);
src/mame/video/shangkid.c
r13798r13799
6060   tilemap_mark_tile_dirty( state->m_background, offset&0x7ff );
6161}
6262
63static void draw_sprite(running_machine &machine, const UINT8 *source, bitmap_t *bitmap, const rectangle *cliprect)
63static void draw_sprite(running_machine &machine, const UINT8 *source, bitmap_t *bitmap, const rectangle &cliprect)
6464{
6565   shangkid_state *state = machine.driver_data<shangkid_state>();
6666   const gfx_element *gfx;
r13798r13799
172172   }
173173}
174174
175static void shangkid_draw_sprites(running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect)
175static void shangkid_draw_sprites(running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect)
176176{
177177   shangkid_state *state = machine.driver_data<shangkid_state>();
178178   const UINT8 *source, *finish;
r13798r13799
235235}
236236
237237
238static void dynamski_draw_background(running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect, int pri )
238static void dynamski_draw_background(running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect, int pri )
239239{
240240   shangkid_state *state = machine.driver_data<shangkid_state>();
241241   UINT8 *videoram = state->m_videoram;
r13798r13799
289289   }
290290}
291291
292static void dynamski_draw_sprites(running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect )
292static void dynamski_draw_sprites(running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect )
293293{
294294   shangkid_state *state = machine.driver_data<shangkid_state>();
295295   UINT8 *videoram = state->m_videoram;
src/mame/video/trackfld.c
r13798r13799
192192
193193
194194
195static void draw_sprites( running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect )
195static void draw_sprites( running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect )
196196{
197197   trackfld_state *state = machine.driver_data<trackfld_state>();
198198   UINT8 *spriteram = state->m_spriteram;
src/mame/video/fastfred.c
r13798r13799
231231 *
232232 *************************************/
233233
234static void draw_sprites(running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect)
234static void draw_sprites(running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect)
235235{
236236   const rectangle spritevisiblearea(2*8, 32*8-1, 2*8, 30*8-1);
237237   const rectangle spritevisibleareaflipx(0*8, 30*8-1, 2*8, 30*8-1);
r13798r13799
287287         flipy = !flipy;
288288      }
289289
290      drawgfx_transpen(bitmap,flip_screen_x_get(machine) ? &spritevisibleareaflipx : &spritevisiblearea,machine.gfx[1],
290      drawgfx_transpen(bitmap,flip_screen_x_get(machine) ? spritevisibleareaflipx : spritevisiblearea,machine.gfx[1],
291291            code,
292292            state->m_colorbank | (state->m_spriteram[offs + 2] & 0x07),
293293            flipx,flipy,
r13798r13799
299299SCREEN_UPDATE( fastfred )
300300{
301301   fastfred_state *state = screen.machine().driver_data<fastfred_state>();
302   bitmap->fill(*state->m_background_color, *cliprect);
302   bitmap->fill(*state->m_background_color, cliprect);
303303   tilemap_draw(bitmap,cliprect,state->m_bg_tilemap,0,0);
304304   draw_sprites(screen.machine(), bitmap, cliprect);
305305
src/mame/video/karnov.c
r13798r13799
7272   tilemap_set_flip_all(machine, state->m_flipscreen ? (TILEMAP_FLIPY | TILEMAP_FLIPX) : 0);
7373}
7474
75static void draw_background( running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect )
75static void draw_background( running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect )
7676{
7777   karnov_state *state = machine.driver_data<karnov_state>();
7878   int my, mx, offs, color, tile, fx, fy;
r13798r13799
100100      color = tile >> 12;
101101      tile = tile & 0x7ff;
102102      if (state->m_flipscreen)
103         drawgfx_opaque(state->m_bitmap_f, 0, machine.gfx[1],tile,
103         drawgfx_opaque(state->m_bitmap_f, state->m_bitmap_f->cliprect(), machine.gfx[1],tile,
104104            color, fx, fy, 496-16*mx,496-16*my);
105105      else
106         drawgfx_opaque(state->m_bitmap_f, 0, machine.gfx[1],tile,
106         drawgfx_opaque(state->m_bitmap_f, state->m_bitmap_f->cliprect(), machine.gfx[1],tile,
107107            color, fx, fy, 16*mx,16*my);
108108   }
109109
src/mame/video/lwings.c
r13798r13799
184184   return sx || sy;
185185}
186186
187static void lwings_draw_sprites( running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect )
187static void lwings_draw_sprites( running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect )
188188{
189189   UINT8 *buffered_spriteram = machine.generic.buffered_spriteram.u8;
190190   int offs;
r13798r13799
220220   }
221221}
222222
223static void trojan_draw_sprites( running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect )
223static void trojan_draw_sprites( running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect )
224224{
225225   lwings_state *state = machine.driver_data<lwings_state>();
226226   UINT8 *buffered_spriteram = machine.generic.buffered_spriteram.u8;
src/mame/video/punchout.c
r13798r13799
205205
206206
207207
208static void draw_big_sprite(running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect, int palette)
208static void draw_big_sprite(running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect, int palette)
209209{
210210   punchout_state *state = machine.driver_data<punchout_state>();
211211   int zoom;
r13798r13799
249249}
250250
251251
252static void armwrest_draw_big_sprite(running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect, int palette)
252static void armwrest_draw_big_sprite(running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect, int palette)
253253{
254254   punchout_state *state = machine.driver_data<punchout_state>();
255255   int zoom;
r13798r13799
296296   }
297297}
298298
299static void drawbs2(running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect)
299static void drawbs2(running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect)
300300{
301301   punchout_state *state = machine.driver_data<punchout_state>();
302302   int sx,sy;
src/mame/video/tecmo.c
r13798r13799
169169
170170***************************************************************************/
171171
172static void draw_sprites(running_machine &machine, bitmap_t *bitmap,const rectangle *cliprect)
172static void draw_sprites(running_machine &machine, bitmap_t *bitmap,const rectangle &cliprect)
173173{
174174   tecmo_state *state = machine.driver_data<tecmo_state>();
175175   UINT8 *spriteram = state->m_spriteram;
r13798r13799
251251SCREEN_UPDATE( tecmo )
252252{
253253   tecmo_state *state = screen.machine().driver_data<tecmo_state>();
254   screen.machine().priority_bitmap->fill(0, *cliprect);
255   bitmap->fill(0x100, *cliprect);
254   screen.machine().priority_bitmap->fill(0, cliprect);
255   bitmap->fill(0x100, cliprect);
256256   tilemap_draw(bitmap,cliprect,state->m_bg_tilemap,0,1);
257257   tilemap_draw(bitmap,cliprect,state->m_fg_tilemap,0,2);
258258   tilemap_draw(bitmap,cliprect,state->m_tx_tilemap,0,4);
src/mame/video/segaybd.c
r13798r13799
4747   /* if no drawing is happening, fill with black and get out */
4848   if (!segaic16_display_enable)
4949   {
50      bitmap->fill(get_black_pen(screen.machine()), *cliprect);
50      bitmap->fill(get_black_pen(screen.machine()), cliprect);
5151      return 0;
5252   }
5353
5454   /* draw the yboard sprites */
5555   yboard_clip.min_x = yboard_clip.min_y = 0;
5656   yboard_clip.max_x = yboard_clip.max_y = 511;
57   segaic16_sprites_draw(screen, state->m_tmp_bitmap, &yboard_clip, 1);
57   segaic16_sprites_draw(screen, state->m_tmp_bitmap, yboard_clip, 1);
5858
5959   /* apply rotation */
6060   segaic16_rotate_draw(screen.machine(), 0, bitmap, cliprect, state->m_tmp_bitmap);
src/mame/video/galpanic.c
r13798r13799
4545}
4646
4747
48static void comad_draw_sprites(running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect)
48static void comad_draw_sprites(running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect)
4949{
5050   galpanic_state *state = machine.driver_data<galpanic_state>();
5151   UINT16 *spriteram16 = state->m_spriteram;
r13798r13799
8383   }
8484}
8585
86static void draw_fgbitmap(running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect)
86static void draw_fgbitmap(running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect)
8787{
8888   galpanic_state *state = machine.driver_data<galpanic_state>();
8989   int offs;
r13798r13799
125125
126126//  if(galpanic_clear_sprites)
127127   {
128      state->m_sprites_bitmap->fill(0, *cliprect);
128      state->m_sprites_bitmap->fill(0, cliprect);
129129      comad_draw_sprites(screen.machine(),bitmap,cliprect);
130130   }
131131//  else
src/mame/video/finalizr.c
r13798r13799
214214
215215   {
216216      const rectangle &visarea = screen.visible_area();
217      rectangle clip = *cliprect;
217      rectangle clip = cliprect;
218218
219219      /* draw top status region */
220220      clip.min_x = visarea.min_x;
221221      clip.max_x = visarea.min_x + 31;
222222      tilemap_set_scrolldx(state->m_fg_tilemap,  0,-32);
223      tilemap_draw(bitmap, &clip, state->m_fg_tilemap, 0, 0);
223      tilemap_draw(bitmap, clip, state->m_fg_tilemap, 0, 0);
224224   }
225225   return 0;
226226}
src/mame/video/xorworld.c
r13798r13799
9696      1  | xxxx---- -------- | sprite color
9797*/
9898
99static void draw_sprites(running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect )
99static void draw_sprites(running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect )
100100{
101101   xorworld_state *state = machine.driver_data<xorworld_state>();
102102   UINT16 *spriteram16 = state->m_spriteram;
src/mame/video/cclimber.c
r13798r13799
487487}
488488
489489
490static void draw_playfield(running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect)
490static void draw_playfield(running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect)
491491{
492492   cclimber_state *state = machine.driver_data<cclimber_state>();
493493   int i;
r13798r13799
502502}
503503
504504
505static void cclimber_draw_bigsprite(running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect)
505static void cclimber_draw_bigsprite(running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect)
506506{
507507   cclimber_state *state = machine.driver_data<cclimber_state>();
508508   UINT8 x = state->m_bigsprite_control[3] - 8;
r13798r13799
528528}
529529
530530
531static void toprollr_draw_bigsprite(running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect)
531static void toprollr_draw_bigsprite(running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect)
532532{
533533   cclimber_state *state = machine.driver_data<cclimber_state>();
534534   UINT8 x = state->m_bigsprite_control[3] - 8;
r13798r13799
545545}
546546
547547
548static void cclimber_draw_sprites(bitmap_t *bitmap, const rectangle *cliprect, const gfx_element *gfx)
548static void cclimber_draw_sprites(bitmap_t *bitmap, const rectangle &cliprect, const gfx_element *gfx)
549549{
550550   cclimber_state *state = gfx->machine().driver_data<cclimber_state>();
551551   int offs;
r13798r13799
586586}
587587
588588
589static void toprollr_draw_sprites(bitmap_t *bitmap, const rectangle *cliprect, const gfx_element *gfx)
589static void toprollr_draw_sprites(bitmap_t *bitmap, const rectangle &cliprect, const gfx_element *gfx)
590590{
591591   cclimber_state *state = gfx->machine().driver_data<cclimber_state>();
592592   int offs;
r13798r13799
624624}
625625
626626
627static void swimmer_draw_sprites(bitmap_t *bitmap, const rectangle *cliprect, const gfx_element *gfx)
627static void swimmer_draw_sprites(bitmap_t *bitmap, const rectangle &cliprect, const gfx_element *gfx)
628628{
629629   cclimber_state *state = gfx->machine().driver_data<cclimber_state>();
630630   int offs;
r13798r13799
665665SCREEN_UPDATE( cclimber )
666666{
667667   cclimber_state *state = screen.machine().driver_data<cclimber_state>();
668   bitmap->fill(CCLIMBER_BG_PEN, *cliprect);
668   bitmap->fill(CCLIMBER_BG_PEN, cliprect);
669669   draw_playfield(screen.machine(), bitmap, cliprect);
670670
671671   /* draw the "big sprite" under the regular sprites */
r13798r13799
733733         rectangle split_rect_left(0, 0xff - SWIMMER_BG_SPLIT, 0, 0xff);
734734         rectangle split_rect_right(0x100 - SWIMMER_BG_SPLIT, 0xff, 0, 0xff);
735735
736         split_rect_left &= *cliprect;
736         split_rect_left &= cliprect;
737737         bitmap->fill(SWIMMER_SIDE_BG_PEN, split_rect_left);
738738
739         split_rect_right &= *cliprect;
739         split_rect_right &= cliprect;
740740         bitmap->fill(CCLIMBER_BG_PEN, split_rect_right);
741741      }
742742      else
r13798r13799
744744         rectangle split_rect_left(0, SWIMMER_BG_SPLIT - 1, 0, 0xff);
745745         rectangle split_rect_right(SWIMMER_BG_SPLIT, 0xff, 0, 0xff);
746746
747         split_rect_left &= *cliprect;
747         split_rect_left &= cliprect;
748748         bitmap->fill(CCLIMBER_BG_PEN, split_rect_left);
749749
750         split_rect_right &= *cliprect;
750         split_rect_right &= cliprect;
751751         bitmap->fill(SWIMMER_SIDE_BG_PEN, split_rect_right);
752752      }
753753   }
754754   else
755      bitmap->fill(CCLIMBER_BG_PEN, *cliprect);
755      bitmap->fill(CCLIMBER_BG_PEN, cliprect);
756756
757757   draw_playfield(screen.machine(), bitmap, cliprect);
758758
r13798r13799
777777SCREEN_UPDATE( toprollr )
778778{
779779   cclimber_state *state = screen.machine().driver_data<cclimber_state>();
780   rectangle scroll_area_clip = *cliprect;
780   rectangle scroll_area_clip = cliprect;
781781   scroll_area_clip.min_x = 4*8;
782782   scroll_area_clip.max_x = 29*8-1;
783783
784   bitmap->fill(CCLIMBER_BG_PEN, *cliprect);
784   bitmap->fill(CCLIMBER_BG_PEN, cliprect);
785785
786786   tilemap_set_scrollx(state->m_toproller_bg_tilemap, 0, state->m_toprollr_bg_videoram[0]);
787787   tilemap_set_flip(state->m_toproller_bg_tilemap, (CCLIMBER_FLIP_X ? TILEMAP_FLIPX : 0) |
788788                                 (CCLIMBER_FLIP_Y ? TILEMAP_FLIPY : 0));
789789   tilemap_mark_all_tiles_dirty(state->m_toproller_bg_tilemap);
790   tilemap_draw(bitmap, &scroll_area_clip, state->m_toproller_bg_tilemap, 0, 0);
790   tilemap_draw(bitmap, scroll_area_clip, state->m_toproller_bg_tilemap, 0, 0);
791791
792792   /* draw the "big sprite" over the regular sprites */
793793   if ((state->m_bigsprite_control[1] & 0x20))
794794   {
795      toprollr_draw_sprites(bitmap, &scroll_area_clip, screen.machine().gfx[1]);
796      toprollr_draw_bigsprite(screen.machine(), bitmap, &scroll_area_clip);
795      toprollr_draw_sprites(bitmap, scroll_area_clip, screen.machine().gfx[1]);
796      toprollr_draw_bigsprite(screen.machine(), bitmap, scroll_area_clip);
797797   }
798798
799799   /* draw the "big sprite" under the regular sprites */
800800   else
801801   {
802      toprollr_draw_bigsprite(screen.machine(), bitmap, &scroll_area_clip);
803      toprollr_draw_sprites(bitmap, &scroll_area_clip, screen.machine().gfx[1]);
802      toprollr_draw_bigsprite(screen.machine(), bitmap, scroll_area_clip);
803      toprollr_draw_sprites(bitmap, scroll_area_clip, screen.machine().gfx[1]);
804804   }
805805
806806   tilemap_mark_all_tiles_dirty(state->m_pf_tilemap);
src/mame/video/speedspn.c
r13798r13799
5959}
6060
6161
62static void draw_sprites(running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect )
62static void draw_sprites(running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect )
6363{
6464   speedspn_state *state = machine.driver_data<speedspn_state>();
6565   const gfx_element *gfx = machine.gfx[1];
r13798r13799
9898   speedspn_state *state = screen.machine().driver_data<speedspn_state>();
9999   if (state->m_display_disable)
100100   {
101      bitmap->fill(get_black_pen(screen.machine()), *cliprect);
101      bitmap->fill(get_black_pen(screen.machine()), cliprect);
102102      return 0;
103103   }
104104
src/mame/video/segaorun.c
r13798r13799
5252SCREEN_UPDATE( shangon )
5353{
5454   /* reset priorities */
55   screen.machine().priority_bitmap->fill(0, *cliprect);
55   screen.machine().priority_bitmap->fill(0, cliprect);
5656
5757   /* draw the low priority road layer */
5858   segaic16_road_draw(0, bitmap, cliprect, SEGAIC16_ROAD_BACKGROUND);
r13798r13799
8585   /* if no drawing is happening, fill with black and get out */
8686   if (!segaic16_display_enable)
8787   {
88      bitmap->fill(get_black_pen(screen.machine()), *cliprect);
88      bitmap->fill(get_black_pen(screen.machine()), cliprect);
8989      return 0;
9090   }
9191
9292   /* reset priorities */
93   screen.machine().priority_bitmap->fill(0, *cliprect);
93   screen.machine().priority_bitmap->fill(0, cliprect);
9494
9595   /* draw the low priority road layer */
9696   segaic16_road_draw(0, bitmap, cliprect, SEGAIC16_ROAD_BACKGROUND);
src/mame/video/amigaaga.c
r13798r13799
865865   int y;
866866
867867   /* render each scanline in the visible region */
868   for (y = cliprect->min_y; y <= cliprect->max_y; y++)
868   for (y = cliprect.min_y; y <= cliprect.max_y; y++)
869869      amiga_aga_render_scanline(screen.machine(), bitmap, y);
870870
871871   return 0;
src/mame/video/gticlub.c
r13798r13799
541541static void render_polygons(running_machine &machine)
542542{
543543   int i, j;
544   const rectangle &visarea = machine.primary_screen->visible_area();
544   const rectangle visarea = machine.primary_screen->visible_area();
545545
546546//  mame_printf_debug("K001005_fifo_ptr = %08X\n", K001005_3d_fifo_ptr);
547547
r13798r13799
582582         ++index;
583583
584584         extra->color = color;
585         poly_render_triangle(poly, K001005_bitmap[K001005_bitmap_page], &visarea, draw_scanline, 1, &v[0], &v[1], &v[2]);
586         poly_render_triangle(poly, K001005_bitmap[K001005_bitmap_page], &visarea, draw_scanline, 1, &v[0], &v[2], &v[3]);
587//          poly_render_polygon(poly, K001005_bitmap[K001005_bitmap_page],  &visarea, draw_scanline, 1, 4, v);
585         poly_render_triangle(poly, K001005_bitmap[K001005_bitmap_page], visarea, draw_scanline, 1, &v[0], &v[1], &v[2]);
586         poly_render_triangle(poly, K001005_bitmap[K001005_bitmap_page], visarea, draw_scanline, 1, &v[0], &v[2], &v[3]);
587//          poly_render_polygon(poly, K001005_bitmap[K001005_bitmap_page],  visarea, draw_scanline, 1, 4, v);
588588
589589         i = index - 1;
590590      }
r13798r13799
689689
690690         if (num_verts < 3)
691691         {
692            poly_render_triangle(poly, K001005_bitmap[K001005_bitmap_page], &visarea, draw_scanline_tex, 4, &prev_v[2], &v[0], &v[1]);
692            poly_render_triangle(poly, K001005_bitmap[K001005_bitmap_page], visarea, draw_scanline_tex, 4, &prev_v[2], &v[0], &v[1]);
693693            if (prev_poly_type)
694               poly_render_triangle(poly, K001005_bitmap[K001005_bitmap_page], &visarea, draw_scanline_tex, 4, &prev_v[2], &prev_v[3], &v[0]);
694               poly_render_triangle(poly, K001005_bitmap[K001005_bitmap_page], visarea, draw_scanline_tex, 4, &prev_v[2], &prev_v[3], &v[0]);
695695//              if (prev_poly_type)
696//                  poly_render_quad(poly, K001005_bitmap[K001005_bitmap_page], &visarea, draw_scanline_tex, 4, &prev_v[2], &prev_v[3], &v[0], &v[1]);
696//                  poly_render_quad(poly, K001005_bitmap[K001005_bitmap_page], visarea, draw_scanline_tex, 4, &prev_v[2], &prev_v[3], &v[0], &v[1]);
697697//              else
698//                  poly_render_triangle(poly, K001005_bitmap[K001005_bitmap_page], &visarea, draw_scanline_tex, 4, &prev_v[2], &v[0], &v[1]);
698//                  poly_render_triangle(poly, K001005_bitmap[K001005_bitmap_page], visarea, draw_scanline_tex, 4, &prev_v[2], &v[0], &v[1]);
699699
700700            memcpy(&prev_v[0], &prev_v[2], sizeof(poly_vertex));
701701            memcpy(&prev_v[1], &prev_v[3], sizeof(poly_vertex));
r13798r13799
704704         }
705705         else
706706         {
707            poly_render_triangle(poly, K001005_bitmap[K001005_bitmap_page], &visarea, draw_scanline_tex, 4, &v[0], &v[1], &v[2]);
707            poly_render_triangle(poly, K001005_bitmap[K001005_bitmap_page], visarea, draw_scanline_tex, 4, &v[0], &v[1], &v[2]);
708708            if (num_verts > 3)
709               poly_render_triangle(poly, K001005_bitmap[K001005_bitmap_page], &visarea, draw_scanline_tex, 4, &v[2], &v[3], &v[0]);
710//              poly_render_polygon(poly, K001005_bitmap[K001005_bitmap_page], &visarea, draw_scanline_tex, 4, num_verts, v);
709               poly_render_triangle(poly, K001005_bitmap[K001005_bitmap_page], visarea, draw_scanline_tex, 4, &v[2], &v[3], &v[0]);
710//              poly_render_polygon(poly, K001005_bitmap[K001005_bitmap_page], visarea, draw_scanline_tex, 4, num_verts, v);
711711
712712            memcpy(prev_v, v, sizeof(poly_vertex) * 4);
713713         }
r13798r13799
788788
789789            extra->color = color;
790790
791            poly_render_triangle(poly, K001005_bitmap[K001005_bitmap_page], &visarea, draw_scanline_tex, 4, &v[0], &v[1], &v[2]);
791            poly_render_triangle(poly, K001005_bitmap[K001005_bitmap_page], visarea, draw_scanline_tex, 4, &v[0], &v[1], &v[2]);
792792            if (new_verts > 1)
793               poly_render_triangle(poly, K001005_bitmap[K001005_bitmap_page], &visarea, draw_scanline_tex, 4, &v[2], &v[3], &v[0]);
794//              poly_render_polygon(poly, K001005_bitmap[K001005_bitmap_page], &visarea, draw_scanline_tex, 4, new_verts + 2, v);
793               poly_render_triangle(poly, K001005_bitmap[K001005_bitmap_page], visarea, draw_scanline_tex, 4, &v[2], &v[3], &v[0]);
794//              poly_render_polygon(poly, K001005_bitmap[K001005_bitmap_page], visarea, draw_scanline_tex, 4, new_verts + 2, v);
795795
796796            memcpy(prev_v, v, sizeof(poly_vertex) * 4);
797797         };
r13798r13799
847847
848848         extra->color = color;
849849
850         poly_render_triangle(poly, K001005_bitmap[K001005_bitmap_page], &visarea, draw_scanline, 1, &v[0], &v[1], &v[2]);
850         poly_render_triangle(poly, K001005_bitmap[K001005_bitmap_page], visarea, draw_scanline, 1, &v[0], &v[1], &v[2]);
851851         if (num_verts > 3)
852            poly_render_triangle(poly, K001005_bitmap[K001005_bitmap_page], &visarea, draw_scanline, 1, &v[2], &v[3], &v[0]);
853//          poly_render_polygon(poly, K001005_bitmap[K001005_bitmap_page], &visarea, draw_scanline, 1, num_verts, v);
852            poly_render_triangle(poly, K001005_bitmap[K001005_bitmap_page], visarea, draw_scanline, 1, &v[2], &v[3], &v[0]);
853//          poly_render_polygon(poly, K001005_bitmap[K001005_bitmap_page], visarea, draw_scanline, 1, num_verts, v);
854854
855855         memcpy(prev_v, v, sizeof(poly_vertex) * 4);
856856
r13798r13799
906906
907907            extra->color = color;
908908
909            poly_render_triangle(poly, K001005_bitmap[K001005_bitmap_page], &visarea, draw_scanline, 1, &v[0], &v[1], &v[2]);
909            poly_render_triangle(poly, K001005_bitmap[K001005_bitmap_page], visarea, draw_scanline, 1, &v[0], &v[1], &v[2]);
910910            if (new_verts > 1)
911               poly_render_triangle(poly, K001005_bitmap[K001005_bitmap_page], &visarea, draw_scanline, 1, &v[0], &v[2], &v[3]);
912//              poly_render_polygon(poly, K001005_bitmap[K001005_bitmap_page], &visarea, draw_scanline, 1, new_verts + 2, v);
911               poly_render_triangle(poly, K001005_bitmap[K001005_bitmap_page], visarea, draw_scanline, 1, &v[0], &v[2], &v[3]);
912//              poly_render_polygon(poly, K001005_bitmap[K001005_bitmap_page], visarea, draw_scanline, 1, new_verts + 2, v);
913913
914914            memcpy(prev_v, v, sizeof(poly_vertex) * 4);
915915         };
r13798r13799
934934   }
935935}
936936
937void K001005_draw(bitmap_t *bitmap, const rectangle *cliprect)
937void K001005_draw(bitmap_t *bitmap, const rectangle &cliprect)
938938{
939939   int i, j;
940940
941   memcpy(&K001005_cliprect, cliprect, sizeof(rectangle));
941   memcpy(&K001005_cliprect, &cliprect, sizeof(rectangle));
942942
943   for (j=cliprect->min_y; j <= cliprect->max_y; j++)
943   for (j=cliprect.min_y; j <= cliprect.max_y; j++)
944944   {
945945      UINT32 *bmp = &bitmap->pix32(j);
946946      UINT32 *src = &K001005_bitmap[K001005_bitmap_page^1]->pix32(j);
947947
948      for (i=cliprect->min_x; i <= cliprect->max_x; i++)
948      for (i=cliprect.min_x; i <= cliprect.max_x; i++)
949949      {
950950         if (src[i] & 0xff000000)
951951         {
r13798r13799
10511051
10521052SCREEN_UPDATE( hangplt )
10531053{
1054   bitmap->fill(screen.machine().pens[0], *cliprect);
1054   bitmap->fill(screen.machine().pens[0], cliprect);
10551055
10561056   if (strcmp(screen.tag(), "lscreen") == 0)
10571057   {
src/mame/video/cloak.c
r13798r13799
188188   machine.save().register_postload(save_prepost_delegate(FUNC(set_current_bitmap_videoram_pointer), state));
189189}
190190
191static void draw_bitmap(running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect)
191static void draw_bitmap(running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect)
192192{
193193   cloak_state *state = machine.driver_data<cloak_state>();
194194   int x, y;
195195
196   for (y = cliprect->min_y; y <= cliprect->max_y; y++)
197      for (x = cliprect->min_x; x <= cliprect->max_x; x++)
196   for (y = cliprect.min_y; y <= cliprect.max_y; y++)
197      for (x = cliprect.min_x; x <= cliprect.max_x; x++)
198198      {
199199         pen_t pen = state->m_current_bitmap_videoram_displayed[(y << 8) | x] & 0x07;
200200
r13798r13799
203203      }
204204}
205205
206static void draw_sprites(running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect)
206static void draw_sprites(running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect)
207207{
208208   cloak_state *state = machine.driver_data<cloak_state>();
209209   UINT8 *spriteram = state->m_spriteram;
src/mame/video/namcona1.c
r13798r13799
312312
313313static void pdraw_tile(running_machine &machine,
314314      bitmap_t *dest_bmp,
315      const rectangle *clip,
315      const rectangle &clip,
316316      UINT32 code,
317317      int color,
318318      int sx, int sy,
r13798r13799
364364         y_index = 0;
365365      }
366366
367      if( clip )
368      {
369         if( sx < clip->min_x)
370         { /* clip left */
371            int pixels = clip->min_x-sx;
372            sx += pixels;
373            x_index_base += pixels*dx;
374         }
375         if( sy < clip->min_y )
376         { /* clip top */
377            int pixels = clip->min_y-sy;
378            sy += pixels;
379            y_index += pixels*dy;
380         }
381         /* NS 980211 - fixed incorrect clipping */
382         if( ex > clip->max_x+1 )
383         { /* clip right */
384            int pixels = ex-clip->max_x-1;
385            ex -= pixels;
386         }
387         if( ey > clip->max_y+1 )
388         { /* clip bottom */
389            int pixels = ey-clip->max_y-1;
390            ey -= pixels;
391         }
367      if( sx < clip.min_x)
368      { /* clip left */
369         int pixels = clip.min_x-sx;
370         sx += pixels;
371         x_index_base += pixels*dx;
392372      }
373      if( sy < clip.min_y )
374      { /* clip top */
375         int pixels = clip.min_y-sy;
376         sy += pixels;
377         y_index += pixels*dy;
378      }
379      /* NS 980211 - fixed incorrect clipping */
380      if( ex > clip.max_x+1 )
381      { /* clip right */
382         int pixels = ex-clip.max_x-1;
383         ex -= pixels;
384      }
385      if( ey > clip.max_y+1 )
386      { /* clip bottom */
387         int pixels = ey-clip.max_y-1;
388         ey -= pixels;
389      }
393390
394391      if( ex>sx )
395392      { /* skip if inner loop doesn't draw anything */
r13798r13799
456453   }
457454} /* pdraw_tile */
458455
459static void draw_sprites(running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect)
456static void draw_sprites(running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect)
460457{
461458   namcona1_state *state = machine.driver_data<namcona1_state>();
462459   int which;
r13798r13799
553550   } /* next x */
554551} /* draw_pixel_line */
555552
556static void draw_background(running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect, int which, int primask )
553static void draw_background(running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect, int which, int primask )
557554{
558555   namcona1_state *state = machine.driver_data<namcona1_state>();
559556   UINT16 *videoram = state->m_videoram;
r13798r13799
576573   paldata = &machine.pens[pGfx->color_base + pGfx->color_granularity * state->m_tilemap_palette_bank[which]];
577574
578575   /* draw one scanline at a time */
579   clip.min_x = cliprect->min_x;
580   clip.max_x = cliprect->max_x;
576   clip.min_x = cliprect.min_x;
577   clip.max_x = cliprect.max_x;
581578   scrollx = 0;
582579   scrolly = 0;
583580   for( line=0; line<256; line++ )
r13798r13799
597594         scrolly = (ydata - line)&0x1ff;
598595      }
599596
600      if (line >= cliprect->min_y && line <= cliprect->max_y)
597      if (line >= cliprect.min_y && line <= cliprect.max_y)
601598      {
602599         if( xdata == 0xc001 )
603600         {
r13798r13799
624621               int dy = -8; /* vertical adjust */
625622               UINT32 startx = (xoffset<<12)+incxx*dx+incyx*dy;
626623               UINT32 starty = (yoffset<<12)+incxy*dx+incyy*dy;
627               tilemap_draw_roz_primask(bitmap, &clip, state->m_roz_tilemap,
624               tilemap_draw_roz_primask(bitmap, clip, state->m_roz_tilemap,
628625                  startx, starty, incxx, incxy, incyx, incyy, 0, 0, primask, 0);
629626            }
630627            else
631628            {
632629               tilemap_set_scrollx( state->m_bg_tilemap[which], 0, scrollx );
633630               tilemap_set_scrolly( state->m_bg_tilemap[which], 0, scrolly );
634               tilemap_draw_primask( bitmap, &clip, state->m_bg_tilemap[which], 0, primask, 0 );
631               tilemap_draw_primask( bitmap, clip, state->m_bg_tilemap[which], 0, primask, 0 );
635632            }
636633         }
637634      }
r13798r13799
677674         }
678675      }
679676
680      screen.machine().priority_bitmap->fill(0, *cliprect );
677      screen.machine().priority_bitmap->fill(0, cliprect );
681678
682      bitmap->fill(0xff, *cliprect ); /* background color? */
679      bitmap->fill(0xff, cliprect ); /* background color? */
683680
684681      for( priority = 0; priority<8; priority++ )
685682      {
src/mame/video/gticlub.h
r13798r13799
11void gticlub_led_setreg(int offset, UINT8 data);
22
3void K001005_draw(bitmap_t *bitmap, const rectangle *cliprect);
3void K001005_draw(bitmap_t *bitmap, const rectangle &cliprect);
44void K001005_swap_buffers(running_machine &machine);
55void K001005_init(running_machine &machine);
66void K001005_preprocess_texture_data(UINT8 *rom, int length, int gticlub);
src/mame/video/bsktball.c
r13798r13799
3333   state->m_bg_tilemap = tilemap_create(machine, get_bg_tile_info, tilemap_scan_rows, 8, 8, 32, 32);
3434}
3535
36static void draw_sprites( running_machine &machine,  bitmap_t *bitmap, const rectangle *cliprect )
36static void draw_sprites( running_machine &machine,  bitmap_t *bitmap, const rectangle &cliprect )
3737{
3838   bsktball_state *state = machine.driver_data<bsktball_state>();
3939   int mot;
src/mame/video/armedf.c
r13798r13799
277277***************************************************************************/
278278
279279/* custom code to handle color cycling effect, handled by m_spr_pal_clut */
280void armedf_drawgfx(running_machine &machine, bitmap_t *dest_bmp,const rectangle *clip,const gfx_element *gfx,
280void armedf_drawgfx(running_machine &machine, bitmap_t *dest_bmp,const rectangle &clip,const gfx_element *gfx,
281281                     UINT32 code,UINT32 color, UINT32 clut,int flipx,int flipy,int offsx,int offsy,
282282                     int transparent_color)
283283{
r13798r13799
301301   ex = sx + gfx->width;
302302   ey = sy + gfx->height;
303303
304   if (clip)
305   {
306      if (sx < clip->min_x)
307      { /* clip left */
308         int pixels = clip->min_x-sx;
309         sx += pixels;
310         x_index_base += xinc*pixels;
311      }
312      if (sy < clip->min_y)
313      { /* clip top */
314         int pixels = clip->min_y-sy;
315         sy += pixels;
316         y_index += yinc*pixels;
317      }
318      /* NS 980211 - fixed incorrect clipping */
319      if (ex > clip->max_x+1)
320      { /* clip right */
321         ex = clip->max_x+1;
322      }
323      if (ey > clip->max_y+1)
324      { /* clip bottom */
325         ey = clip->max_y+1;
326      }
304   if (sx < clip.min_x)
305   { /* clip left */
306      int pixels = clip.min_x-sx;
307      sx += pixels;
308      x_index_base += xinc*pixels;
327309   }
310   if (sy < clip.min_y)
311   { /* clip top */
312      int pixels = clip.min_y-sy;
313      sy += pixels;
314      y_index += yinc*pixels;
315   }
316   /* NS 980211 - fixed incorrect clipping */
317   if (ex > clip.max_x+1)
318   { /* clip right */
319      ex = clip.max_x+1;
320   }
321   if (ey > clip.max_y+1)
322   { /* clip bottom */
323      ey = clip.max_y+1;
324   }
328325
329326   if (ex > sx)
330327   { /* skip if inner loop doesn't draw anything */
r13798r13799
351348}
352349
353350
354static void draw_sprites( running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect, int priority )
351static void draw_sprites( running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect, int priority )
355352{
356353   UINT16 *buffered_spriteram = machine.generic.buffered_spriteram.u16;
357354   armedf_state *state = machine.driver_data<armedf_state>();
r13798r13799
411408
412409   }
413410
414   bitmap->fill(0xff, *cliprect );
411   bitmap->fill(0xff, cliprect );
415412
416413   tilemap_draw(bitmap, cliprect, state->m_tx_tilemap, TILEMAP_DRAW_CATEGORY(1), 0);
417414
src/mame/video/dkong.c
r13798r13799
559559
560560***************************************************************************/
561561
562static void draw_sprites(running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect, UINT32 mask_bank, UINT32 shift_bits)
562static void draw_sprites(running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect, UINT32 mask_bank, UINT32 shift_bits)
563563{
564564   dkong_state *state = machine.driver_data<dkong_state>();
565565   int offs;
r13798r13799
607607     *
608608     */
609609
610   scanline_vf = (cliprect->max_y - 1) & 0xFF;
611   scanline_vfc = (cliprect->max_y - 1) & 0xFF;
612   scanline = cliprect->max_y & 0xFF;
610   scanline_vf = (cliprect.max_y - 1) & 0xFF;
611   scanline_vfc = (cliprect.max_y - 1) & 0xFF;
612   scanline = cliprect.max_y & 0xFF;
613613
614614   if (state->m_flip)
615615   {
r13798r13799
805805
806806}
807807
808static void radarscp_draw_background(running_machine &machine, dkong_state *state, bitmap_t *bitmap, const rectangle *cliprect)
808static void radarscp_draw_background(running_machine &machine, dkong_state *state, bitmap_t *bitmap, const rectangle &cliprect)
809809{
810810   const UINT8    *htable = NULL;
811811   int          x,y;
r13798r13799
815815   if (state->m_hardware_type == HARDWARE_TRS01)
816816      htable = state->m_gfx4;
817817
818   y = cliprect->min_y;
819   while (y <= cliprect->max_y)
818   y = cliprect.min_y;
819   while (y <= cliprect.max_y)
820820   {
821      x = cliprect->min_x;
822      while (x <= cliprect->max_x)
821      x = cliprect.min_x;
822      while (x <= cliprect.max_x)
823823      {
824824         pixel = &bitmap->pix16(y, x);
825825         draw_ok = !(*pixel & 0x01) && !(*pixel & 0x02);
src/mame/video/sprint4.c
r13798r13799
118118
119119      rect &= screen.machine().primary_screen->visible_area();
120120
121      tilemap_draw(state->m_helper, &rect, state->m_playfield, 0, 0);
121      tilemap_draw(state->m_helper, rect, state->m_playfield, 0, 0);
122122
123123      if (i & 1)
124124         bank = 32;
125125
126      drawgfx_transpen(state->m_helper, &rect, screen.machine().gfx[1],
126      drawgfx_transpen(state->m_helper, rect, screen.machine().gfx[1],
127127         (code >> 3) | bank,
128128         4,
129129         0, 0,
src/mame/video/appoooh.c
r13798r13799
207207   /* bit 7 unknown (used) */
208208}
209209
210static void appoooh_draw_sprites( bitmap_t *dest_bmp, const rectangle *cliprect, const gfx_element *gfx, UINT8 *sprite )
210static void appoooh_draw_sprites( bitmap_t *dest_bmp, const rectangle &cliprect, const gfx_element *gfx, UINT8 *sprite )
211211{
212212   int offs;
213213   int flipy = flip_screen_get(gfx->machine());
r13798r13799
238238   }
239239}
240240
241static void robowres_draw_sprites( bitmap_t *dest_bmp, const rectangle *cliprect, const gfx_element *gfx, UINT8 *sprite )
241static void robowres_draw_sprites( bitmap_t *dest_bmp, const rectangle &cliprect, const gfx_element *gfx, UINT8 *sprite )
242242{
243243   int offs;
244244   int flipy = flip_screen_get(gfx->machine());
src/mame/video/skyraid.c
r13798r13799
1616}
1717
1818
19static void draw_text(running_machine &machine, bitmap_t* bitmap, const rectangle* cliprect)
19static void draw_text(running_machine &machine, bitmap_t* bitmap, const rectangle &cliprect)
2020{
2121   skyraid_state *state = machine.driver_data<skyraid_state>();
2222   const UINT8* p = state->m_alpha_num_ram;
r13798r13799
3636}
3737
3838
39static void draw_terrain(running_machine &machine, bitmap_t* bitmap, const rectangle *cliprect)
39static void draw_terrain(running_machine &machine, bitmap_t* bitmap, const rectangle &cliprect)
4040{
4141   skyraid_state *state = machine.driver_data<skyraid_state>();
4242   const UINT8* p = machine.region("user1")->base();
r13798r13799
7272}
7373
7474
75static void draw_sprites(running_machine &machine, bitmap_t* bitmap, const rectangle* cliprect)
75static void draw_sprites(running_machine &machine, bitmap_t* bitmap, const rectangle &cliprect)
7676{
7777   skyraid_state *state = machine.driver_data<skyraid_state>();
7878   int i;
r13798r13799
9494}
9595
9696
97static void draw_missiles(running_machine &machine, bitmap_t* bitmap, const rectangle* cliprect)
97static void draw_missiles(running_machine &machine, bitmap_t* bitmap, const rectangle &cliprect)
9898{
9999   skyraid_state *state = machine.driver_data<skyraid_state>();
100100   int i;
r13798r13799
142142{
143143   skyraid_state *state = screen.machine().driver_data<skyraid_state>();
144144
145   bitmap->fill(0, *cliprect);
145   bitmap->fill(0, cliprect);
146146
147   draw_terrain(screen.machine(), state->m_helper, NULL);
148   draw_sprites(screen.machine(), state->m_helper, NULL);
149   draw_missiles(screen.machine(), state->m_helper, NULL);
147   draw_terrain(screen.machine(), state->m_helper, cliprect);
148   draw_sprites(screen.machine(), state->m_helper, cliprect);
149   draw_missiles(screen.machine(), state->m_helper, cliprect);
150150   draw_trapezoid(screen.machine(), bitmap, state->m_helper);
151151   draw_text(screen.machine(), bitmap, cliprect);
152152   return 0;
src/mame/video/travrusa.c
r13798r13799
293293
294294***************************************************************************/
295295
296static void draw_sprites(running_machine &machine, bitmap_t *bitmap,const rectangle *cliprect)
296static void draw_sprites(running_machine &machine, bitmap_t *bitmap,const rectangle &cliprect)
297297{
298298   travrusa_state *state = machine.driver_data<travrusa_state>();
299299   int offs;
300300   const rectangle spritevisiblearea(1*8, 31*8-1, 0*8, 24*8-1);
301301   const rectangle spritevisibleareaflip(1*8, 31*8-1, 8*8, 32*8-1);
302   rectangle clip = *cliprect;
302   rectangle clip = cliprect;
303303   if (flip_screen_get(machine))
304304      clip &= spritevisibleareaflip;
305305   else
r13798r13799
323323         flipy = !flipy;
324324      }
325325
326      drawgfx_transpen(bitmap, &clip, machine.gfx[1],
326      drawgfx_transpen(bitmap, clip, machine.gfx[1],
327327            code,
328328            attr & 0x0f,
329329            flipx, flipy,
src/mame/video/metlclsh.c
r13798r13799
174174
175175***************************************************************************/
176176
177static void draw_sprites( running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect )
177static void draw_sprites( running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect )
178178{
179179   metlclsh_state *state = machine.driver_data<metlclsh_state>();
180180   UINT8 *spriteram = state->m_spriteram;
r13798r13799
246246{
247247   metlclsh_state *state = screen.machine().driver_data<metlclsh_state>();
248248
249   bitmap->fill(0x10, *cliprect);
249   bitmap->fill(0x10, cliprect);
250250
251251   tilemap_draw(bitmap, cliprect, state->m_fg_tilemap, 1, 0);   // low priority tiles of foreground
252252
src/mame/video/aliens.c
r13798r13799
8181
8282   k052109_tilemap_update(state->m_k052109);
8383
84   screen.machine().priority_bitmap->fill(0, *cliprect);
85   bitmap->fill(state->m_layer_colorbase[1] * 16, *cliprect);
84   screen.machine().priority_bitmap->fill(0, cliprect);
85   bitmap->fill(state->m_layer_colorbase[1] * 16, cliprect);
8686
8787   k052109_tilemap_draw(state->m_k052109, bitmap, cliprect, 1, 0, 1);
8888   k052109_tilemap_draw(state->m_k052109, bitmap, cliprect, 2, 0, 2);
src/mame/video/beezer.c
r13798r13799
2525   UINT8 *videoram = state->m_videoram;
2626   int x,y;
2727
28   for (y = cliprect->min_y; y <= cliprect->max_y; y++)
29      for (x = cliprect->min_x; x <= cliprect->max_x; x+=2)
28   for (y = cliprect.min_y; y <= cliprect.max_y; y++)
29      for (x = cliprect.min_x; x <= cliprect.max_x; x+=2)
3030      {
3131         bitmap->pix16(y, x+1) = videoram[0x80*x+y] & 0x0f;
3232         bitmap->pix16(y, x+0) = videoram[0x80*x+y] >> 4;
src/mame/video/kaneko16.c
r13798r13799
420420}
421421
422422// custom function to draw a single sprite. needed to keep correct sprites - sprites and sprites - tilemaps priorities
423static void kaneko16_draw_sprites_custom(bitmap_t *dest_bmp,const rectangle *clip,const gfx_element *gfx,
423static void kaneko16_draw_sprites_custom(bitmap_t *dest_bmp,const rectangle &clip,const gfx_element *gfx,
424424      UINT32 code,UINT32 color,int flipx,int flipy,int sx,int sy,
425425      int priority)
426426{
r13798r13799
462462         y_index = 0;
463463      }
464464
465      if( clip )
466      {
467         if( sx < clip->min_x)
468         { /* clip left */
469            int pixels = clip->min_x-sx;
470            sx += pixels;
471            x_index_base += pixels*dx;
472         }
473         if( sy < clip->min_y )
474         { /* clip top */
475            int pixels = clip->min_y-sy;
476            sy += pixels;
477            y_index += pixels*dy;
478         }
479         /* NS 980211 - fixed incorrect clipping */
480         if( ex > clip->max_x+1 )
481         { /* clip right */
482            int pixels = ex-clip->max_x-1;
483            ex -= pixels;
484         }
485         if( ey > clip->max_y+1 )
486         { /* clip bottom */
487            int pixels = ey-clip->max_y-1;
488            ey -= pixels;
489         }
465      if( sx < clip.min_x)
466      { /* clip left */
467         int pixels = clip.min_x-sx;
468         sx += pixels;
469         x_index_base += pixels*dx;
490470      }
471      if( sy < clip.min_y )
472      { /* clip top */
473         int pixels = clip.min_y-sy;
474         sy += pixels;
475         y_index += pixels*dy;
476      }
477      /* NS 980211 - fixed incorrect clipping */
478      if( ex > clip.max_x+1 )
479      { /* clip right */
480         int pixels = ex-clip.max_x-1;
481         ex -= pixels;
482      }
483      if( ey > clip.max_y+1 )
484      { /* clip bottom */
485         int pixels = ey-clip.max_y-1;
486         ey -= pixels;
487      }
491488
492489      if( ex>sx )
493490      { /* skip if inner loop doesn't draw anything */
r13798r13799
520517
521518/* Build a list of sprites to display & draw them */
522519
523void kaneko16_draw_sprites(running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect)
520void kaneko16_draw_sprites(running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect)
524521{
525522   kaneko16_state *state = machine.driver_data<kaneko16_state>();
526523   /* Sprites *must* be parsed from the first in RAM to the last,
r13798r13799
855852
856853***************************************************************************/
857854
858static void kaneko16_prepare_first_tilemap_chip(running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect)
855static void kaneko16_prepare_first_tilemap_chip(running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect)
859856{
860857   kaneko16_state *state = machine.driver_data<kaneko16_state>();
861858   /* Set Up FIRST Tilemap chip */
r13798r13799
896893
897894}
898895
899static void kaneko16_prepare_second_tilemap_chip(running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect)
896static void kaneko16_prepare_second_tilemap_chip(running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect)
900897{
901898   kaneko16_state *state = machine.driver_data<kaneko16_state>();
902899   /* Set Up SECOND Tilemap chip */
r13798r13799
936933   }
937934}
938935
939static void kaneko16_render_first_tilemap_chip(running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect, int pri)
936static void kaneko16_render_first_tilemap_chip(running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect, int pri)
940937{
941938   kaneko16_state *state = machine.driver_data<kaneko16_state>();
942939   tilemap_draw_primask(bitmap,cliprect, state->m_tmap[0], pri, pri, 0);
943940   tilemap_draw_primask(bitmap,cliprect, state->m_tmap[1], pri, pri, 0);
944941}
945942
946static void kaneko16_render_second_tilemap_chip(running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect, int pri)
943static void kaneko16_render_second_tilemap_chip(running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect, int pri)
947944{
948945   kaneko16_state *state = machine.driver_data<kaneko16_state>();
949946   if (state->m_tmap[2])
r13798r13799
953950   }
954951}
955952
956static void kaneko16_render_sprites(running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect)
953static void kaneko16_render_sprites(running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect)
957954{
958955   kaneko16_state *state = machine.driver_data<kaneko16_state>();
959956   /* Sprites last (rendered with pdrawgfx, so they can slip
r13798r13799
967964   }
968965   else
969966   {
970      state->m_sprites_bitmap->fill(0, *cliprect);
967      state->m_sprites_bitmap->fill(0, cliprect);
971968      kaneko16_draw_sprites(machine,bitmap,cliprect);
972969   }
973970}
974971
975static void kaneko16_render_15bpp_bitmap(running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect)
972static void kaneko16_render_15bpp_bitmap(running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect)
976973{
977974   kaneko16_state *state = machine.driver_data<kaneko16_state>();
978975   if (state->m_bg15_bitmap)
r13798r13799
993990   }
994991}
995992
996static void kaneko16_fill_bitmap(running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect)
993static void kaneko16_fill_bitmap(running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect)
997994{
998995   kaneko16_state *state = machine.driver_data<kaneko16_state>();
999996   if(state->m_sprite_type == 1)
1000      bitmap->fill(0x7f00, *cliprect);
997      bitmap->fill(0x7f00, cliprect);
1001998   else
1002999      /* Fill the bitmap with pen 0. This is wrong, but will work most of
10031000           the times. To do it right, each pixel should be drawn with pen 0
10041001           of the bottomost tile that covers it (which is pretty tricky to do) */
1005      bitmap->fill(0, *cliprect);
1002      bitmap->fill(0, cliprect);
10061003}
10071004
10081005static SCREEN_UPDATE( common )
10091006{
10101007   int i;
10111008
1012   screen.machine().priority_bitmap->fill(0, *cliprect);
1009   screen.machine().priority_bitmap->fill(0, cliprect);
10131010
10141011   kaneko16_prepare_first_tilemap_chip(screen.machine(), bitmap, cliprect);
10151012   kaneko16_prepare_second_tilemap_chip(screen.machine(), bitmap, cliprect);
src/mame/video/dbz.c
r13798r13799
135135
136136   konami_sortlayers5(layer, state->m_layerpri);
137137
138   screen.machine().priority_bitmap->fill(0, *cliprect);
138   screen.machine().priority_bitmap->fill(0, cliprect);
139139
140140   for (plane = 0; plane < 5; plane++)
141141   {
src/mame/video/goldstar.c
r13798r13799
393393   goldstar_state *state = screen.machine().driver_data<goldstar_state>();
394394   int i;
395395
396   bitmap->fill(get_black_pen(screen.machine()), *cliprect);
396   bitmap->fill(get_black_pen(screen.machine()), cliprect);
397397
398398   if (!state->m_cm_enable_reg &0x01)
399399      return 0;
r13798r13799
413413      const rectangle visible2(0*8, (14+48)*8-1, 12*8, (12+7)*8-1);
414414      const rectangle visible3(0*8, (14+48)*8-1, 20*8, (20+7)*8-1);
415415
416      tilemap_draw(bitmap, &visible1, state->m_reel1_tilemap, 0, 0);
417      tilemap_draw(bitmap, &visible2, state->m_reel2_tilemap, 0, 0);
418      tilemap_draw(bitmap, &visible3, state->m_reel3_tilemap, 0, 0);
416      tilemap_draw(bitmap, visible1, state->m_reel1_tilemap, 0, 0);
417      tilemap_draw(bitmap, visible2, state->m_reel2_tilemap, 0, 0);
418      tilemap_draw(bitmap, visible3, state->m_reel3_tilemap, 0, 0);
419419   }
420420
421421   if (state->m_cm_enable_reg &0x04)
r13798r13799
444444   goldstar_state *state = screen.machine().driver_data<goldstar_state>();
445445   int i;
446446
447   bitmap->fill(get_black_pen(screen.machine()), *cliprect);
447   bitmap->fill(get_black_pen(screen.machine()), cliprect);
448448
449449   if (!state->m_cm_enable_reg &0x01)
450450      return 0;
r13798r13799
458458
459459
460460      const rectangle visible1(0*8, (14+48)*8-1,  3*8,  (4+7)*8-1);
461      tilemap_draw(bitmap, &visible1, state->m_reel1_tilemap, 0, 0);
461      tilemap_draw(bitmap, visible1, state->m_reel1_tilemap, 0, 0);
462462   }
463463
464464   if (state->m_cm_enable_reg &0x04)
r13798r13799
487487   goldstar_state *state = screen.machine().driver_data<goldstar_state>();
488488   int i;
489489
490   bitmap->fill(get_black_pen(screen.machine()), *cliprect);
490   bitmap->fill(get_black_pen(screen.machine()), cliprect);
491491
492492   if (!state->m_cm_enable_reg &0x01)
493493      return 0;
r13798r13799
508508         const rectangle visible1alt(0*8, (16+48)*8-1,  4*8,  16*8-1);
509509         const rectangle visible2alt(0*8, (16+48)*8-1, 16*8,  28*8-1);
510510
511         tilemap_draw(bitmap, &visible1alt, state->m_reel1_tilemap, 0, 0);
512         tilemap_draw(bitmap, &visible2alt, state->m_reel2_tilemap, 0, 0);
511         tilemap_draw(bitmap, visible1alt, state->m_reel1_tilemap, 0, 0);
512         tilemap_draw(bitmap, visible2alt, state->m_reel2_tilemap, 0, 0);
513513         //tilemap_draw(bitmap, &magical_visible3, state->m_reel3_tilemap, 0, 0);
514514      }
515515      else
r13798r13799
526526         const rectangle visible2(0*8, (14+48)*8-1, 12*8, (12+8)*8-1);
527527         const rectangle visible3(0*8, (14+48)*8-1, 20*8, (20+8)*8-1);
528528
529         tilemap_draw(bitmap, &visible1, state->m_reel1_tilemap, 0, 0);
530         tilemap_draw(bitmap, &visible2, state->m_reel2_tilemap, 0, 0);
531         tilemap_draw(bitmap, &visible3, state->m_reel3_tilemap, 0, 0);
529         tilemap_draw(bitmap, visible1, state->m_reel1_tilemap, 0, 0);
530         tilemap_draw(bitmap, visible2, state->m_reel2_tilemap, 0, 0);
531         tilemap_draw(bitmap, visible3, state->m_reel3_tilemap, 0, 0);
532532      }
533533   }
534534
r13798r13799
546546   goldstar_state *state = screen.machine().driver_data<goldstar_state>();
547547   int i;
548548
549   bitmap->fill(get_black_pen(screen.machine()), *cliprect);
549   bitmap->fill(get_black_pen(screen.machine()), cliprect);
550550
551551   if (!state->m_cm_enable_reg &0x01)
552552      return 0;
r13798r13799
581581         const rectangle visible2(0*8, (14+48)*8-1, 10*8, (10+7)*8-1);
582582         const rectangle visible3(0*8, (14+48)*8-1, 17*8, (17+7)*8-1);
583583
584         tilemap_draw(bitmap, &visible1, state->m_reel1_tilemap, 0, 0);
585         tilemap_draw(bitmap, &visible2, state->m_reel2_tilemap, 0, 0);
586         tilemap_draw(bitmap, &visible3, state->m_reel3_tilemap, 0, 0);
584         tilemap_draw(bitmap, visible1, state->m_reel1_tilemap, 0, 0);
585         tilemap_draw(bitmap, visible2, state->m_reel2_tilemap, 0, 0);
586         tilemap_draw(bitmap, visible3, state->m_reel3_tilemap, 0, 0);
587587      }
588588   }
589589
r13798r13799
600600   goldstar_state *state = screen.machine().driver_data<goldstar_state>();
601601   int i;
602602
603   bitmap->fill(get_black_pen(screen.machine()), *cliprect);
603   bitmap->fill(get_black_pen(screen.machine()), cliprect);
604604
605605   if (!state->m_cm_enable_reg &0x01)
606606      return 0;
r13798r13799
618618      const rectangle visible2(0*8, (14+48)*8-1, 11*8, (12+7)*8-1);   /* 4 pixels less for reel2 */
619619      const rectangle visible3(0*8, (14+48)*8-1, 19*8, (19+7)*8-1);   /* 8 pixels less for reel3 */
620620
621      tilemap_draw(bitmap, &visible1, state->m_reel1_tilemap, 0, 0);
622      tilemap_draw(bitmap, &visible2, state->m_reel2_tilemap, 0, 0);
623      tilemap_draw(bitmap, &visible3, state->m_reel3_tilemap, 0, 0);
621      tilemap_draw(bitmap, visible1, state->m_reel1_tilemap, 0, 0);
622      tilemap_draw(bitmap, visible2, state->m_reel2_tilemap, 0, 0);
623      tilemap_draw(bitmap, visible3, state->m_reel3_tilemap, 0, 0);
624624   }
625625
626626   if (state->m_cm_enable_reg &0x02)
r13798r13799
636636   goldstar_state *state = screen.machine().driver_data<goldstar_state>();
637637   int i;
638638
639   bitmap->fill(get_black_pen(screen.machine()), *cliprect);
639   bitmap->fill(get_black_pen(screen.machine()), cliprect);
640640
641641   if (!state->m_cm_enable_reg &0x01)
642642      return 0;
r13798r13799
654654      const rectangle visible2(0*8, (14+48)*8-1, 10*8, (10+6)*8-1);
655655      const rectangle visible3(0*8, (14+48)*8-1, 16*8, (16+6)*8-1);
656656
657      tilemap_draw(bitmap, &visible1, state->m_reel1_tilemap, 0, 0);
658      tilemap_draw(bitmap, &visible2, state->m_reel2_tilemap, 0, 0);
659      tilemap_draw(bitmap, &visible3, state->m_reel3_tilemap, 0, 0);
657      tilemap_draw(bitmap, visible1, state->m_reel1_tilemap, 0, 0);
658      tilemap_draw(bitmap, visible2, state->m_reel2_tilemap, 0, 0);
659      tilemap_draw(bitmap, visible3, state->m_reel3_tilemap, 0, 0);
660660   }
661661
662662   if (state->m_cm_enable_reg &0x04)
src/mame/video/wc90.c
r13798r13799
167167   { 15, 14, 13, 12, 11, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1, 0 }
168168};
169169
170static void draw_sprite_16x16(running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect, int code,
170static void draw_sprite_16x16(running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect, int code,
171171                       int sx, int sy, int bank, int flags ) {
172172   WC90_DRAW_SPRITE( code, sx, sy );
173173}
174174
175static void draw_sprite_16x32(running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect, int code,
175static void draw_sprite_16x32(running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect, int code,
176176                       int sx, int sy, int bank, int flags ) {
177177   if ( bank & 2 ) {
178178      WC90_DRAW_SPRITE( code+1, sx, sy+16 );
r13798r13799
183183   }
184184}
185185
186static void draw_sprite_16x64(running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect, int code,
186static void draw_sprite_16x64(running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect, int code,
187187                       int sx, int sy, int bank, int flags ) {
188188   if ( bank & 2 ) {
189189      WC90_DRAW_SPRITE( code+3, sx, sy+48 );
r13798r13799
198198   }
199199}
200200
201static void draw_sprite_32x16(running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect, int code,
201static void draw_sprite_32x16(running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect, int code,
202202                       int sx, int sy, int bank, int flags ) {
203203   if ( bank & 1 ) {
204204      WC90_DRAW_SPRITE( code+1, sx+16, sy );
r13798r13799
209209   }
210210}
211211
212static void draw_sprite_32x32(running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect, int code,
212static void draw_sprite_32x32(running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect, int code,
213213                       int sx, int sy, int bank, int flags ) {
214214
215215   const char *p = p32x32[ bank&3 ];
r13798r13799
220220   WC90_DRAW_SPRITE( code+p[3], sx+16, sy+16 );
221221}
222222
223static void draw_sprite_32x64(running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect, int code,
223static void draw_sprite_32x64(running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect, int code,
224224                       int sx, int sy, int bank, int flags ) {
225225
226226   const char *p = p32x64[ bank&3 ];
r13798r13799
235235   WC90_DRAW_SPRITE( code+p[7], sx+16, sy+48 );
236236}
237237
238static void draw_sprite_64x16(running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect, int code,
238static void draw_sprite_64x16(running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect, int code,
239239                       int sx, int sy, int bank, int flags ) {
240240   if ( bank & 1 ) {
241241      WC90_DRAW_SPRITE( code+3, sx+48, sy );
r13798r13799
250250   }
251251}
252252
253static void draw_sprite_64x32(running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect, int code,
253static void draw_sprite_64x32(running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect, int code,
254254                       int sx, int sy, int bank, int flags ) {
255255
256256   const char *p = p64x32[ bank&3 ];
r13798r13799
265265   WC90_DRAW_SPRITE( code+p[7], sx+48, sy+16 );
266266}
267267
268static void draw_sprite_64x64(running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect, int code,
268static void draw_sprite_64x64(running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect, int code,
269269                       int sx, int sy, int bank, int flags ) {
270270
271271   const char *p = p64x64[ bank&3 ];
r13798r13799
289289   WC90_DRAW_SPRITE( code+p[15], sx+48, sy+48 );
290290}
291291
292static void draw_sprite_invalid(running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect, int code,
292static void draw_sprite_invalid(running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect, int code,
293293                                 int sx, int sy, int bank, int flags ) {
294294   logerror("8 pixel sprite size not supported\n" );
295295}
296296
297typedef void (*draw_sprites_func)(running_machine &, bitmap_t *, const rectangle *, int, int, int, int, int );
297typedef void (*draw_sprites_func)(running_machine &, bitmap_t *, const rectangle &, int, int, int, int, int );
298298
299299static const draw_sprites_func draw_sprites_proc[16] = {
300300   draw_sprite_invalid,   /* 0000 = 08x08 */
r13798r13799
315315   draw_sprite_64x64      /* 1111 = 64x64 */
316316};
317317
318static void draw_sprites(running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect, int priority )
318static void draw_sprites(running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect, int priority )
319319{
320320   wc90_state *state = machine.driver_data<wc90_state>();
321321   UINT8 *spriteram = state->m_spriteram;
src/mame/video/ms32.c
r13798r13799
205205
206206
207207/* SPRITES based on tetrisp2 for now, readd priority bits later */
208static void draw_sprites(running_machine &machine, bitmap_t *bitmap, bitmap_t *bitmap_pri, const rectangle *cliprect, UINT16 *sprram_top, size_t sprram_size, int gfxnum, int reverseorder)
208static void draw_sprites(running_machine &machine, bitmap_t *bitmap, bitmap_t *bitmap_pri, const rectangle &cliprect, UINT16 *sprram_top, size_t sprram_size, int gfxnum, int reverseorder)
209209{
210210   int tx, ty, sx, sy, flipx, flipy;
211211   int xsize, ysize;
r13798r13799
275275}
276276
277277
278static void draw_roz(running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect,int priority)
278static void draw_roz(running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect,int priority)
279279{
280280   ms32_state *state = machine.driver_data<ms32_state>();
281281   /* TODO: registers 0x40/4 / 0x44/4 and 0x50/4 / 0x54/4 are used, meaning unknown */
r13798r13799
285285      rectangle my_clip;
286286      int y,maxy;
287287
288      my_clip.min_x = cliprect->min_x;
289      my_clip.max_x = cliprect->max_x;
288      my_clip.min_x = cliprect.min_x;
289      my_clip.max_x = cliprect.max_x;
290290
291      y = cliprect->min_y;
292      maxy = cliprect->max_y;
291      y = cliprect.min_y;
292      maxy = cliprect.max_y;
293293
294294      while (y <= maxy)
295295      {
r13798r13799
317317         if (incxx & 0x10000) incxx |= ~0x1ffff;
318318         if (incxy & 0x10000) incxy |= ~0x1ffff;
319319
320         tilemap_draw_roz(bitmap, &my_clip, state->m_roz_tilemap,
320         tilemap_draw_roz(bitmap, my_clip, state->m_roz_tilemap,
321321               (start2x+startx+offsx)<<16, (start2y+starty+offsy)<<16,
322322               incxx<<8, incxy<<8, 0, 0,
323323               1, // Wrap
r13798r13799
392392   tilemap_set_scrolly(state->m_bg_tilemap_alt, 0, scrolly);
393393
394394
395   screen.machine().priority_bitmap->fill(0, *cliprect);
395   screen.machine().priority_bitmap->fill(0, cliprect);
396396
397397
398398
399399   /* TODO: 0 is correct for gametngk, but break f1superb scrolling grid (text at
400400       top and bottom of the screen becomes black on black) */
401   state->m_temp_bitmap_tilemaps->fill(0, *cliprect);   /* bg color */
401   state->m_temp_bitmap_tilemaps->fill(0, cliprect);   /* bg color */
402402
403403   /* clear our sprite bitmaps */
404   state->m_temp_bitmap_sprites->fill(0, *cliprect);
405   state->m_temp_bitmap_sprites_pri->fill(0, *cliprect);
404   state->m_temp_bitmap_sprites->fill(0, cliprect);
405   state->m_temp_bitmap_sprites_pri->fill(0, cliprect);
406406
407407   draw_sprites(screen.machine(), state->m_temp_bitmap_sprites, state->m_temp_bitmap_sprites_pri, cliprect, state->m_sprram_16, 0x20000, 0, state->m_reverse_sprite_order);
408408
r13798r13799
485485
486486      UINT32* dstptr_bitmap;
487487
488      bitmap->fill(0, *cliprect);
488      bitmap->fill(0, cliprect);
489489
490490      for (yy=0;yy<height;yy++)
491491      {
src/mame/video/darkseal.c
r13798r13799
6464   darkseal_state *state = screen.machine().driver_data<darkseal_state>();
6565   tilemap_set_flip_all(screen.machine(),state->m_flipscreen ? (TILEMAP_FLIPY | TILEMAP_FLIPX) : 0);
6666
67   bitmap->fill(get_black_pen(screen.machine()), *cliprect);
67   bitmap->fill(get_black_pen(screen.machine()), cliprect);
6868
6969   deco16ic_pf_update(state->m_deco_tilegen1, state->m_pf1_rowscroll, state->m_pf1_rowscroll);
7070   deco16ic_pf_update(state->m_deco_tilegen2, state->m_pf3_rowscroll, state->m_pf3_rowscroll);
src/mame/video/20pacgal.c
r13798r13799
7373}
7474
7575
76static void do_pen_lookup(running_machine &machine, const _20pacgal_state *state, bitmap_t *bitmap, const rectangle *cliprect)
76static void do_pen_lookup(running_machine &machine, const _20pacgal_state *state, bitmap_t *bitmap, const rectangle &cliprect)
7777{
7878   int y, x;
7979   pen_t pens[NUM_PENS + NUM_STAR_PENS];
8080
8181   get_pens(machine, state, pens);
8282
83   for (y = cliprect->min_y; y <= cliprect->max_y; y++)
84      for(x = cliprect->min_x; x <= cliprect->max_x; x++)
83   for (y = cliprect.min_y; y <= cliprect.max_y; y++)
84      for(x = cliprect.min_x; x <= cliprect.max_x; x++)
8585         bitmap->pix32(y, x) = pens[bitmap->pix32(y, x)];
8686}
8787
r13798r13799
349349 *
350350 */
351351
352static void draw_stars(_20pacgal_state *state, bitmap_t *bitmap, const rectangle *cliprect )
352static void draw_stars(_20pacgal_state *state, bitmap_t *bitmap, const rectangle &cliprect )
353353{
354354   if ( (state->m_stars_ctrl[0] >> 5) & 1 )
355355   {
r13798r13799
391391
392392         if (((lfsr & 0xffc0) == star_seta) || ((lfsr & 0xffc0) == star_setb))
393393         {
394            if (y >= cliprect->min_y && y <= cliprect->max_y)
394            if (y >= cliprect.min_y && y <= cliprect.max_y)
395395               bitmap->pix32(y, x) = NUM_PENS + (lfsr & 0x3f);
396396            cnt++;
397397         }
r13798r13799
410410{
411411   _20pacgal_state *state = screen.machine().driver_data<_20pacgal_state>();
412412
413   bitmap->fill(0, *cliprect);
413   bitmap->fill(0, cliprect);
414414   draw_stars(state, bitmap,cliprect);
415415   draw_chars(state, bitmap);
416416   draw_sprites(screen.machine(),state, bitmap);
src/mame/video/seicross.c
r13798r13799
9797   tilemap_set_scroll_cols(state->m_bg_tilemap, 32);
9898}
9999
100static void draw_sprites(running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect )
100static void draw_sprites(running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect )
101101{
102102   seicross_state *state = machine.driver_data<seicross_state>();
103103   UINT8 *spriteram = state->m_spriteram;
src/mame/video/spbactn.c
r13798r13799
77
88static void blendbitmaps(running_machine &machine,
99      bitmap_t *dest,bitmap_t *src1,bitmap_t *src2,
10      const rectangle *cliprect)
10      const rectangle &cliprect)
1111{
1212   int y,x;
1313   const pen_t *paldata = machine.pens;
1414
15   for (y = cliprect->min_y; y <= cliprect->max_y; y++)
15   for (y = cliprect.min_y; y <= cliprect.max_y; y++)
1616   {
1717      UINT32 *dd  = &dest->pix32(y);
1818      UINT16 *sd1 = &src1->pix16(y);
1919      UINT16 *sd2 = &src2->pix16(y);
2020
21      for (x = cliprect->min_x; x <= cliprect->max_x; x++)
21      for (x = cliprect.min_x; x <= cliprect.max_x; x++)
2222      {
2323         if (sd2[x])
2424         {
r13798r13799
3535
3636
3737/* from gals pinball (which was in turn from ninja gaiden) */
38static int draw_sprites(running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect, int priority)
38static int draw_sprites(running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect, int priority)
3939{
4040   static const UINT8 layout[8][8] =
4141   {
r13798r13799
123123   spbactn_state *state = screen.machine().driver_data<spbactn_state>();
124124   int offs, sx, sy;
125125
126   state->m_tile_bitmap_fg->fill(0, *cliprect);
126   state->m_tile_bitmap_fg->fill(0, cliprect);
127127
128128   /* draw table bg gfx */
129129   for (sx = sy = offs = 0; offs < 0x4000 / 2; offs++)
src/mame/video/system16.c
r13798r13799
641641   int offset_bg0x = 187;
642642   int offset_bg0y = 0;
643643
644   bitmap->fill(get_black_pen(screen.machine()), *cliprect);
644   bitmap->fill(get_black_pen(screen.machine()), cliprect);
645645
646646   // I can't bring myself to care about dirty tile marking on something which runs at a bazillion % speed anyway, clean code is better
647647   tilemap_mark_all_tiles_dirty(state->m_bg_tilemaps[0]);
r13798r13799
699699   int offset_bg0x = 5;
700700   int offset_bg0y = 32;
701701
702   bitmap->fill(get_black_pen(screen.machine()), *cliprect);
702   bitmap->fill(get_black_pen(screen.machine()), cliprect);
703703
704704   // I can't bring myself to care about dirty tile marking on something which runs at a bazillion % speed anyway, clean code is better
705705   tilemap_mark_all_tiles_dirty(state->m_bg_tilemaps[0]);
r13798r13799
736736
737737   if (!state->m_refreshenable)
738738   {
739      bitmap->fill(0, *cliprect);
739      bitmap->fill(0, cliprect);
740740      return 0;
741741   }
742742
743743   update_page(screen.machine());
744744
745   screen.machine().priority_bitmap->fill(0, *cliprect);
745   screen.machine().priority_bitmap->fill(0, cliprect);
746746
747747   tilemap_set_scrollx(state->m_background, 0, -320 - state->m_bg_scrollx);
748748   tilemap_set_scrolly(state->m_background, 0, -256 + state->m_bg_scrolly + state->m_back_yscroll);
r13798r13799
782782
783783   if (!state->m_refreshenable)
784784   {
785      bitmap->fill(get_black_pen(screen.machine()), *cliprect);
785      bitmap->fill(get_black_pen(screen.machine()), cliprect);
786786      return 0;
787787   }
788788
r13798r13799
790790
791791   screen.machine().priority_bitmap->fill(0);
792792
793   bitmap->fill(0, *cliprect);
793   bitmap->fill(0, cliprect);
794794
795795   tilemap_draw(bitmap, cliprect, state->m_background, TILEMAP_DRAW_OPAQUE, 0);
796796   tilemap_draw(bitmap, cliprect, state->m_background, TILEMAP_DRAW_OPAQUE | 1, 0);   //??
src/mame/video/atarimo.c
r13798r13799
142142    STATIC FUNCTION DECLARATIONS
143143***************************************************************************/
144144
145static int mo_render_object(atarimo_data *mo, const atarimo_entry *entry, const rectangle *cliprect);
145static int mo_render_object(atarimo_data *mo, const atarimo_entry *entry, const rectangle &cliprect);
146146
147147
148148
r13798r13799
550550    cliprect.
551551---------------------------------------------------------------*/
552552
553static void erase_dirty_grid(atarimo_data *mo, const rectangle *cliprect)
553static void erase_dirty_grid(atarimo_data *mo, const rectangle &cliprect)
554554{
555   int sx = cliprect->min_x >> mo->tilexshift;
556   int ex = cliprect->max_x >> mo->tilexshift;
557   int sy = cliprect->min_y >> mo->tileyshift;
558   int ey = cliprect->max_y >> mo->tileyshift;
555   int sx = cliprect.min_x >> mo->tilexshift;
556   int ex = cliprect.max_x >> mo->tilexshift;
557   int sy = cliprect.min_y >> mo->tileyshift;
558   int ey = cliprect.max_y >> mo->tileyshift;
559559   int y;
560560
561561   /* loop over all grid rows that intersect our cliprect */
562562   for (y = sy; y <= ey; y++)
563563   {
564564      /* get the base pointer and memset the row */
565      UINT8 *dirtybase = get_dirty_base(mo, cliprect->min_x, y << mo->tileyshift);
565      UINT8 *dirtybase = get_dirty_base(mo, cliprect.min_x, y << mo->tileyshift);
566566      memset(dirtybase, 0, ex - sx + 1);
567567   }
568568}
r13798r13799
573573    series of cliprects.
574574---------------------------------------------------------------*/
575575
576static void convert_dirty_grid_to_rects(atarimo_data *mo, const rectangle *cliprect, atarimo_rect_list *rectlist)
576static void convert_dirty_grid_to_rects(atarimo_data *mo, const rectangle &cliprect, atarimo_rect_list *rectlist)
577577{
578   int sx = cliprect->min_x >> mo->tilexshift;
579   int ex = cliprect->max_x >> mo->tilexshift;
580   int sy = cliprect->min_y >> mo->tileyshift;
581   int ey = cliprect->max_y >> mo->tileyshift;
578   int sx = cliprect.min_x >> mo->tilexshift;
579   int ex = cliprect.max_x >> mo->tilexshift;
580   int sy = cliprect.min_y >> mo->tileyshift;
581   int ey = cliprect.max_y >> mo->tileyshift;
582582   int tilewidth = 1 << mo->tilexshift;
583583   int tileheight = 1 << mo->tileyshift;
584584   rectangle *rect;
r13798r13799
592592   /* loop over all grid rows that intersect our cliprect */
593593   for (y = sy; y <= ey; y++)
594594   {
595      UINT8 *dirtybase = get_dirty_base(mo, cliprect->min_x, y << mo->tileyshift);
595      UINT8 *dirtybase = get_dirty_base(mo, cliprect.min_x, y << mo->tileyshift);
596596      int can_add_to_existing = 0;
597597
598598      /* loop over all grid columns that intersect our cliprect */
r13798r13799
636636    destination bitmap.
637637---------------------------------------------------------------*/
638638
639bitmap_t *atarimo_render(int map, const rectangle *cliprect, atarimo_rect_list *rectlist)
639bitmap_t *atarimo_render(int map, const rectangle &cliprect, atarimo_rect_list *rectlist)
640640{
641641   atarimo_data *mo = atarimo[map];
642642   int startband, stopband, band, i;
r13798r13799
651651   }
652652
653653   /* compute start/stop bands */
654   startband = ((cliprect->min_y + mo->yscroll - mo->slipoffset) & mo->bitmapymask) >> mo->slipshift;
655   stopband = ((cliprect->max_y + mo->yscroll - mo->slipoffset) & mo->bitmapymask) >> mo->slipshift;
654   startband = ((cliprect.min_y + mo->yscroll - mo->slipoffset) & mo->bitmapymask) >> mo->slipshift;
655   stopband = ((cliprect.max_y + mo->yscroll - mo->slipoffset) & mo->bitmapymask) >> mo->slipshift;
656656   if (startband > stopband)
657657      startband -= mo->bitmapheight >> mo->slipshift;
658658   if (!mo->slipshift)
r13798r13799
672672      if (!mo->slipshift)
673673      {
674674         link = 0;
675         bandclip = *cliprect;
675         bandclip = cliprect;
676676      }
677677
678678      /* otherwise, grab the SLIP and compute the bandrect */
r13798r13799
682682         link = (mo->slip_ram[slipentry] >> mo->linkmask.shift) & mo->linkmask.mask;
683683
684684         /* start with the cliprect */
685         bandclip = *cliprect;
685         bandclip = cliprect;
686686
687687         /* compute minimum Y and wrap around if necessary */
688688         bandclip.min_y = ((band << mo->slipshift) - mo->yscroll + mo->slipoffset) & mo->bitmapymask;
r13798r13799
693693         bandclip.max_y = bandclip.min_y + (1 << mo->slipshift) - 1;
694694
695695         /* keep within the cliprect */
696         bandclip &= *cliprect;
696         bandclip &= cliprect;
697697      }
698698
699699      /* if this matches the last link, we don't need to re-process the list */
r13798r13799
718718
719719      /* render the mos */
720720      for (current = first; current != last; current += step)
721         mo_render_object(mo, *current, &bandclip);
721         mo_render_object(mo, *current, bandclip);
722722   }
723723
724724   /* convert the dirty grid to a rectlist */
r13798r13799
726726
727727   /* clip the rectlist */
728728   for (i = 0, rect = rectlist->rect; i < rectlist->numrects; i++, rect++)
729      *rect &= *cliprect;
729      *rect &= cliprect;
730730
731731   /* return the bitmap */
732732   return mo->bitmap;
r13798r13799
739739    to the destination.
740740---------------------------------------------------------------*/
741741
742static int mo_render_object(atarimo_data *mo, const atarimo_entry *entry, const rectangle *cliprect)
742static int mo_render_object(atarimo_data *mo, const atarimo_entry *entry, const rectangle &cliprect)
743743{
744744   int gfxindex = mo->gfxlookup[EXTRACT_DATA(entry, mo->gfxmask)];
745745   const gfx_element *gfx = mo->gfxelement[gfxindex];
r13798r13799
838838      for (y = 0, sy = ypos; y < height; y++, sy += yadv)
839839      {
840840         /* clip the Y coordinate */
841         if (sy <= cliprect->min_y - mo->tileheight)
841         if (sy <= cliprect.min_y - mo->tileheight)
842842         {
843843            code += width;
844844            continue;
845845         }
846         else if (sy > cliprect->max_y)
846         else if (sy > cliprect.max_y)
847847            break;
848848
849849         /* loop over the width */
850850         for (x = 0, sx = xpos; x < width; x++, sx += xadv, code++)
851851         {
852852            /* clip the X coordinate */
853            if (sx <= -cliprect->min_x - mo->tilewidth || sx > cliprect->max_x)
853            if (sx <= -cliprect.min_x - mo->tilewidth || sx > cliprect.max_x)
854854               continue;
855855
856856            /* draw the sprite */
r13798r13799
874874      for (x = 0, sx = xpos; x < width; x++, sx += xadv)
875875      {
876876         /* clip the X coordinate */
877         if (sx <= cliprect->min_x - mo->tilewidth)
877         if (sx <= cliprect.min_x - mo->tilewidth)
878878         {
879879            code += height;
880880            continue;
881881         }
882         else if (sx > cliprect->max_x)
882         else if (sx > cliprect.max_x)
883883            break;
884884
885885         /* loop over the height */
r13798r13799
887887         for (y = 0, sy = ypos; y < height; y++, sy += yadv, code++)
888888         {
889889            /* clip the X coordinate */
890            if (sy <= -cliprect->min_y - mo->tileheight || sy > cliprect->max_y)
890            if (sy <= -cliprect.min_y - mo->tileheight || sy > cliprect.max_y)
891891               continue;
892892
893893            /* draw the sprite */
src/mame/video/deniam.c
r13798r13799
214214 *   c  | ---------------- | zoomy like in System 16?
215215 *   e  | ---------------- |
216216 */
217static void draw_sprites( running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect )
217static void draw_sprites( running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect )
218218{
219219   deniam_state *state = machine.driver_data<deniam_state>();
220220   int offs;
r13798r13799
269269               {
270270                  if (rom[i] & 0x0f)
271271                  {
272                     if (sx + x >= cliprect->min_x && sx + x <= cliprect->max_x &&
273                        y >= cliprect->min_y && y <= cliprect->max_y)
272                     if (sx + x >= cliprect.min_x && sx + x <= cliprect.max_x &&
273                        y >= cliprect.min_y && y <= cliprect.max_y)
274274                     {
275275                        if ((machine.priority_bitmap->pix8(y, sx + x) & primask) == 0)
276276                           bitmap->pix16(y, sx + x) = color * 16 + (rom[i] & 0x0f);
r13798r13799
289289               {
290290                  if (rom[i] & 0xf0)
291291                  {
292                     if (sx + x >= cliprect->min_x && sx + x <= cliprect->max_x &&
293                        y >= cliprect->min_y && y <= cliprect->max_y)
292                     if (sx + x >= cliprect.min_x && sx + x <= cliprect.max_x &&
293                        y >= cliprect.min_y && y <= cliprect.max_y)
294294                     {
295295                        if ((machine.priority_bitmap->pix8(y, sx + x) & primask) == 0)
296296                           bitmap->pix16(y, sx + x) = color * 16+(rom[i] >> 4);
r13798r13799
313313               {
314314                  if (rom[i] & 0xf0)
315315                  {
316                     if (sx + x >= cliprect->min_x && sx + x <= cliprect->max_x &&
317                        y >= cliprect->min_y && y <= cliprect->max_y)
316                     if (sx + x >= cliprect.min_x && sx + x <= cliprect.max_x &&
317                        y >= cliprect.min_y && y <= cliprect.max_y)
318318                     {
319319                        if ((machine.priority_bitmap->pix8(y, sx + x) & primask) == 0)
320320                           bitmap->pix16(y, sx + x) = color * 16 + (rom[i] >> 4);
r13798r13799
333333               {
334334                  if (rom[i] & 0x0f)
335335                  {
336                     if (sx + x >= cliprect->min_x && sx + x <= cliprect->max_x &&
337                        y >= cliprect->min_y && y <= cliprect->max_y)
336                     if (sx + x >= cliprect.min_x && sx + x <= cliprect.max_x &&
337                        y >= cliprect.min_y && y <= cliprect.max_y)
338338                     {
339339                        if ((machine.priority_bitmap->pix8(y, sx + x) & primask) == 0)
340340                           bitmap->pix16(y, sx + x) = color * 16 + (rom[i] & 0x0f);
r13798r13799
407407   tilemap_set_scrollx(state->m_fg_tilemap, 0, fg_scrollx & 0x1ff);
408408   tilemap_set_scrolly(state->m_fg_tilemap, 0, fg_scrolly & 0x0ff);
409409
410   screen.machine().priority_bitmap->fill(0, *cliprect);
410   screen.machine().priority_bitmap->fill(0, cliprect);
411411
412412   tilemap_draw(bitmap, cliprect, state->m_bg_tilemap, 0, 1);
413413   tilemap_draw(bitmap, cliprect, state->m_fg_tilemap, 0, 2);
src/mame/video/atarimo.h
r13798r13799
3232***************************************************************************/
3333
3434/* callback for special processing */
35typedef int (*atarimo_special_func)(bitmap_t *bitmap, const rectangle *clip, int code, int color, int xpos, int ypos, rectangle *mobounds);
35typedef int (*atarimo_special_func)(bitmap_t *bitmap, const rectangle &clip, int code, int color, int xpos, int ypos, rectangle *mobounds);
3636
3737/* description for a four-word mask */
3838typedef struct _atarimo_entry atarimo_entry;
r13798r13799
100100UINT8 *atarimo_get_gfx_lookup(int map, int *size);
101101
102102/* core processing */
103bitmap_t *atarimo_render(int map, const rectangle *cliprect, atarimo_rect_list *rectlist);
103bitmap_t *atarimo_render(int map, const rectangle &cliprect, atarimo_rect_list *rectlist);
104104
105105/* atrribute setters */
106106void atarimo_set_bank(int map, int bank);
src/mame/video/mcr3.c
r13798r13799
205205 *
206206 *************************************/
207207
208static void mcr3_update_sprites(running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect, int color_mask, int code_xor, int dx, int dy)
208static void mcr3_update_sprites(running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect, int color_mask, int code_xor, int dx, int dy)
209209{
210210   mcr3_state *state = machine.driver_data<mcr3_state>();
211211   UINT8 *spriteram = state->m_spriteram;
212212   int offs;
213213
214   machine.priority_bitmap->fill(1, *cliprect);
214   machine.priority_bitmap->fill(1, cliprect);
215215
216216   /* loop over sprite RAM */
217217   for (offs = state->m_spriteram_size - 4; offs >= 0; offs -= 4)
src/mame/video/prehisle.c
r13798r13799
128128
1291293 xxxx............ color+priority, other bits unknown
130130*/
131static void draw_sprites(running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect, int foreground )
131static void draw_sprites(running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect, int foreground )
132132{
133133   prehisle_state *state = machine.driver_data<prehisle_state>();
134134   UINT16 *spriteram16 = state->m_spriteram;
src/mame/video/simpsons.c
r13798r13799
144144
145145   konami_sortlayers3(layer, state->m_layerpri);
146146
147   screen.machine().priority_bitmap->fill(0, *cliprect);
148   bitmap->fill(16 * bg_colorbase, *cliprect);
147   screen.machine().priority_bitmap->fill(0, cliprect);
148   bitmap->fill(16 * bg_colorbase, cliprect);
149149   k052109_tilemap_draw(state->m_k052109, bitmap, cliprect, layer[0], 0, 1);
150150   k052109_tilemap_draw(state->m_k052109, bitmap, cliprect, layer[1], 0, 2);
151151   k052109_tilemap_draw(state->m_k052109, bitmap, cliprect, layer[2], 0, 4);
src/mame/video/wwfsstar.c
r13798r13799
111111 sprite colour marking could probably be improved..
112112*******************************************************************************/
113113
114static void draw_sprites(running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect )
114static void draw_sprites(running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect )
115115{
116116   /*- SPR RAM Format -**
117117
src/mame/video/polepos.c
r13798r13799
490490   }
491491}
492492
493static void draw_sprites(running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect )
493static void draw_sprites(running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect )
494494{
495495   polepos_state *state = machine.driver_data<polepos_state>();
496496   UINT16 *posmem = &state->m_sprite16_memory[0x380];
r13798r13799
523523SCREEN_UPDATE( polepos )
524524{
525525   polepos_state *state = screen.machine().driver_data<polepos_state>();
526   rectangle clip = *cliprect;
526   rectangle clip = cliprect;
527527   clip.max_y = 127;
528   tilemap_draw(bitmap,&clip,state->m_bg_tilemap,0,0);
528   tilemap_draw(bitmap,clip,state->m_bg_tilemap,0,0);
529529   draw_road(screen.machine(), bitmap);
530530   draw_sprites(screen.machine(), bitmap,cliprect);
531531   tilemap_draw(bitmap,cliprect,state->m_tx_tilemap,0,0);
src/mame/video/model1.c
r13798r13799
433433}
434434
435435
436static void draw_quads(model1_state *state, bitmap_t *bitmap, const rectangle *cliprect)
436static void draw_quads(model1_state *state, bitmap_t *bitmap, const rectangle &cliprect)
437437{
438438   struct view *view = state->m_view;
439439   int count = state->m_quadpt - state->m_quaddb;
r13798r13799
444444   int save_x2 = view->x2;
445445   int save_y1 = view->y1;
446446   int save_y2 = view->y2;
447   view->x1 = MAX(view->x1, cliprect->min_x);
448   view->x2 = MIN(view->x2, cliprect->max_x);
449   view->y1 = MAX(view->y1, cliprect->min_y);
450   view->y2 = MIN(view->y2, cliprect->max_y);
447   view->x1 = MAX(view->x1, cliprect.min_x);
448   view->x2 = MIN(view->x2, cliprect.max_x);
449   view->y1 = MAX(view->y1, cliprect.min_y);
450   view->y2 = MIN(view->y2, cliprect.max_y);
451451
452452   for(i=0; i<count; i++) {
453453      struct quad_m1 *q = state->m_quadind[i];
r13798r13799
11191119   return list+2;
11201120}
11211121
1122static void draw_objects(model1_state *state, bitmap_t *bitmap, const rectangle *cliprect)
1122static void draw_objects(model1_state *state, bitmap_t *bitmap, const rectangle &cliprect)
11231123{
11241124   if(state->m_quadpt != state->m_quaddb) {
11251125      LOG_TGP(("VIDEO: sort&draw\n"));
r13798r13799
11311131   state->m_pointpt = state->m_pointdb;
11321132}
11331133
1134static UINT16 *draw_direct(model1_state *state, bitmap_t *bitmap, const rectangle *cliprect, UINT16 *list)
1134static UINT16 *draw_direct(model1_state *state, bitmap_t *bitmap, const rectangle &cliprect, UINT16 *list)
11351135{
11361136   UINT16 *res;
11371137
r13798r13799
11841184   LOG_TGP(("VIDEO: control=%08x\n", (state->m_listctl[1]<<16)|state->m_listctl[0]));
11851185}
11861186
1187static void tgp_render(running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect)
1187static void tgp_render(running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect)
11881188{
11891189   model1_state *state = machine.driver_data<model1_state>();
11901190   struct view *view = state->m_view;
r13798r13799
15191519   view->ayys = sin(view->ayy);
15201520
15211521   screen.machine().priority_bitmap->fill(0);
1522   bitmap->fill(screen.machine().pens[0], *cliprect);
1522   bitmap->fill(screen.machine().pens[0], cliprect);
15231523
15241524   segas24_tile *tile = screen.machine().device<segas24_tile>("tile");
15251525   tile->draw(bitmap, cliprect, 6, 0, 0);
src/mame/video/taito_b.c
r13798r13799
141141}
142142
143143
144static void draw_sprites( running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect )
144static void draw_sprites( running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect )
145145{
146146/*  Sprite format: (16 bytes per sprite)
147147  offs:             bits:
r13798r13799
270270}
271271
272272
273static void draw_framebuffer( running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect, int priority )
273static void draw_framebuffer( running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect, int priority )
274274{
275275   taitob_state *state = machine.driver_data<taitob_state>();
276   rectangle myclip = *cliprect;
276   rectangle myclip = cliprect;
277277   int x, y;
278278   UINT8 video_control = tc0180vcu_get_videoctrl(state->m_tc0180vcu, 0);
279279   UINT8 framebuffer_page = tc0180vcu_get_fb_page(state->m_tc0180vcu, 0);
r13798r13799
382382
383383   if ((video_control & 0x20) == 0)
384384   {
385      bitmap->fill(0, *cliprect);
385      bitmap->fill(0, cliprect);
386386      return 0;
387387   }
388388
r13798r13799
421421   /* Video blanked? */
422422   if (!(video_control & 0x20))
423423   {
424      bitmap->fill(0, *cliprect);
424      bitmap->fill(0, cliprect);
425425      return 0;
426426   }
427427
r13798r13799
436436      draw_framebuffer(screen.machine(), state->m_realpunc_bitmap, cliprect, 0);
437437
438438   /* Copy the intermediate bitmap to the output bitmap, applying the palette */
439   for (y = 0; y <= cliprect->max_y; y++)
440      for (x = 0; x <= cliprect->max_x; x++)
439   for (y = 0; y <= cliprect.max_y; y++)
440      for (x = 0; x <= cliprect.max_x; x++)
441441         bitmap->pix32(y, x) = palette[state->m_realpunc_bitmap->pix16(y, x)];
442442
443443   /* Draw the 15bpp raw CRTC frame buffer directly to the output bitmap */
r13798r13799
451451//      scrollx = taitob_scroll[0];
452452//      scrolly = taitob_scroll[1];
453453
454      for (y = 0; y <= cliprect->max_y; y++)
454      for (y = 0; y <= cliprect.max_y; y++)
455455      {
456456         int addr = base + (y*stride);
457         for (x = 0; x <= cliprect->max_x; x++)
457         for (x = 0; x <= cliprect.max_x; x++)
458458         {
459459            int r, g, b;
460460            UINT16 srcpix = hd63484_ram_r(hd63484, addr++, 0xffff);
r13798r13799
473473   /* Draw the 15bpp raw output of the camera ADCs (TODO) */
474474   else if (state->m_realpunc_video_ctrl & 0x0004)
475475   {
476      for (y = 0; y <= cliprect->max_y; y++)
476      for (y = 0; y <= cliprect.max_y; y++)
477477      {
478         for (x = 0; x <= cliprect->max_x; x++)
478         for (x = 0; x <= cliprect.max_x; x++)
479479            bitmap->pix32(y, x) = MAKE_RGB(0x00, 0x00, 0x00);
480480      }
481481   }
482482
483483   /* Clear the indexed bitmap and draw the final indexed layers */
484   state->m_realpunc_bitmap->fill(0, *cliprect);
484   state->m_realpunc_bitmap->fill(0, cliprect);
485485
486486   if (!(state->m_realpunc_video_ctrl & 0x0001))
487487      draw_framebuffer(screen.machine(), state->m_realpunc_bitmap, cliprect, 0);
r13798r13799
489489   tc0180vcu_tilemap_draw(state->m_tc0180vcu, state->m_realpunc_bitmap, cliprect, 2, 0);
490490
491491   /* Merge the indexed layers with the output bitmap */
492   for (y = 0; y <= cliprect->max_y; y++)
492   for (y = 0; y <= cliprect.max_y; y++)
493493   {
494      for (x = 0; x <= cliprect->max_x; x++)
494      for (x = 0; x <= cliprect.max_x; x++)
495495      {
496496         if (state->m_realpunc_bitmap->pix16(y, x))
497497            bitmap->pix32(y, x) = palette[state->m_realpunc_bitmap->pix16(y, x)];
r13798r13799
518518      tc0180vcu_set_fb_page(state->m_tc0180vcu, 0, framebuffer_page);
519519   }
520520
521   draw_sprites(screen.machine(), state->m_framebuffer[framebuffer_page], &screen.machine().primary_screen->visible_area());
521   draw_sprites(screen.machine(), state->m_framebuffer[framebuffer_page], screen.machine().primary_screen->visible_area());
522522}
src/mame/video/jackal.c
r13798r13799
7979   state->m_bg_tilemap = tilemap_create(machine, get_bg_tile_info, tilemap_scan_rows, 8, 8, 32, 32);
8080}
8181
82static void draw_background( running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect )
82static void draw_background( running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect )
8383{
8484   jackal_state *state = machine.driver_data<jackal_state>();
8585   UINT8 *RAM = machine.region("master")->base();
r13798r13799
117117
118118#define DRAW_SPRITE(bank, code, sx, sy) drawgfx_transpen(bitmap, cliprect, machine.gfx[bank], code, color, flipx, flipy, sx, sy, 0);
119119
120static void draw_sprites_region( running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect, const UINT8 *sram, int length, int bank )
120static void draw_sprites_region( running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect, const UINT8 *sram, int length, int bank )
121121{
122122   int offs;
123123
r13798r13799
201201   }
202202}
203203
204static void draw_sprites( running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect )
204static void draw_sprites( running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect )
205205{
206206   jackal_state *state = machine.driver_data<jackal_state>();
207207   UINT8 *RAM = machine.region("master")->base();
src/mame/video/tank8.c
r13798r13799
128128}
129129
130130
131static void draw_sprites(running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect)
131static void draw_sprites(running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect)
132132{
133133   tank8_state *state = machine.driver_data<tank8_state>();
134134   int i;
r13798r13799
151151}
152152
153153
154static void draw_bullets(running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect)
154static void draw_bullets(running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect)
155155{
156156   tank8_state *state = machine.driver_data<tank8_state>();
157157   int i;
r13798r13799
170170      rect.max_x = rect.min_x + 3;
171171      rect.max_y = rect.min_y + 4;
172172
173      if (rect.min_x < cliprect->min_x)
174         rect.min_x = cliprect->min_x;
175      if (rect.min_y < cliprect->min_y)
176         rect.min_y = cliprect->min_y;
177      if (rect.max_x > cliprect->max_x)
178         rect.max_x = cliprect->max_x;
179      if (rect.max_y > cliprect->max_y)
180         rect.max_y = cliprect->max_y;
173      if (rect.min_x < cliprect.min_x)
174         rect.min_x = cliprect.min_x;
175      if (rect.min_y < cliprect.min_y)
176         rect.min_y = cliprect.min_y;
177      if (rect.max_x > cliprect.max_x)
178         rect.max_x = cliprect.max_x;
179      if (rect.max_y > cliprect.max_y)
180         rect.max_y = cliprect.max_y;
181181
182182      bitmap->fill((i << 1) | 0x01, rect);
183183   }
r13798r13799
209209   int y;
210210   const rectangle &visarea = screen.machine().primary_screen->visible_area();
211211
212   tilemap_draw(state->m_helper1, &visarea, state->m_tilemap, 0, 0);
212   tilemap_draw(state->m_helper1, visarea, state->m_tilemap, 0, 0);
213213
214214   state->m_helper2->fill(8, visarea);
215215   state->m_helper3->fill(8, visarea);
216216
217   draw_sprites(screen.machine(), state->m_helper2, &visarea);
218   draw_bullets(screen.machine(), state->m_helper3, &visarea);
217   draw_sprites(screen.machine(), state->m_helper2, visarea);
218   draw_bullets(screen.machine(), state->m_helper3, visarea);
219219
220220   for (y = visarea.min_y; y <= visarea.max_y; y++)
221221   {
src/mame/video/taitoic.c
r13798r13799
501501
502502/* These scanline drawing routines lifted from Taito F3: optimise / merge ? */
503503
504INLINE void taitoic_drawscanline( bitmap_t *bitmap, const rectangle *cliprect, int x, int y,
504INLINE void taitoic_drawscanline( bitmap_t *bitmap, const rectangle &cliprect, int x, int y,
505505      const UINT16 *src, int transparent, UINT32 orient, bitmap_t *priority, int pri)
506506{
507507   UINT16 *dsti = &bitmap->pix16(y, x);
508508   UINT8 *dstp = &priority->pix8(y, x);
509   int length = cliprect->max_x - cliprect->min_x + 1;
509   int length = cliprect.max_x - cliprect.min_x + 1;
510510
511   src += cliprect->min_x;
512   dsti += cliprect->min_x;
513   dstp += cliprect->min_x;
511   src += cliprect.min_x;
512   dsti += cliprect.min_x;
513   dstp += cliprect.min_x;
514514   if (transparent)
515515   {
516516      while (length--)
r13798r13799
834834}
835835
836836
837static void topspeed_custom_draw( device_t *device, bitmap_t *bitmap, const rectangle *cliprect, int layer, int flags,
837static void topspeed_custom_draw( device_t *device, bitmap_t *bitmap, const rectangle &cliprect, int layer, int flags,
838838                     UINT32 priority, UINT16 *color_ctrl_ram )
839839{
840840   pc080sn_state *pc080sn = pc080sn_get_safe_token(device);
r13798r13799
852852   int flip = 0;
853853   int machine_flip = 0;   /* for  ROT 180 ? */
854854
855   int min_x = cliprect->min_x;
856   int max_x = cliprect->max_x;
857   int min_y = cliprect->min_y;
858   int max_y = cliprect->max_y;
855   int min_x = cliprect.min_x;
856   int max_x = cliprect.max_x;
857   int min_y = cliprect.min_y;
858   int max_y = cliprect.max_y;
859859   int screen_width = max_x - min_x + 1;
860860   int width_mask = 0x1ff;   /* underlying tilemap */
861861
r13798r13799
928928   while ((!machine_flip && y <= max_y) || (machine_flip && y >= min_y));
929929}
930930
931void pc080sn_tilemap_draw( device_t *device, bitmap_t *bitmap, const rectangle *cliprect, int layer, int flags, UINT32 priority )
931void pc080sn_tilemap_draw( device_t *device, bitmap_t *bitmap, const rectangle &cliprect, int layer, int flags, UINT32 priority )
932932{
933933   pc080sn_state *pc080sn = pc080sn_get_safe_token(device);
934934   tilemap_draw(bitmap, cliprect, pc080sn->tilemap[layer], flags, priority);
935935}
936936
937void pc080sn_tilemap_draw_offset( device_t *device, bitmap_t *bitmap, const rectangle *cliprect, int layer, int flags, UINT32 priority, int xoffs, int yoffs )
937void pc080sn_tilemap_draw_offset( device_t *device, bitmap_t *bitmap, const rectangle &cliprect, int layer, int flags, UINT32 priority, int xoffs, int yoffs )
938938{
939939   pc080sn_state *pc080sn = pc080sn_get_safe_token(device);
940940   int basedx = -16 - pc080sn->xoffs;
r13798r13799
949949   tilemap_set_scrolldy(pc080sn->tilemap[layer], basedy, basedyflip);
950950}
951951
952void pc080sn_tilemap_draw_special( device_t *device, bitmap_t *bitmap, const rectangle *cliprect, int layer, int flags, UINT32 priority, UINT16 *ram )
952void pc080sn_tilemap_draw_special( device_t *device, bitmap_t *bitmap, const rectangle &cliprect, int layer, int flags, UINT32 priority, UINT16 *ram )
953953{
954954   topspeed_custom_draw(device, bitmap, cliprect, layer, flags, priority, ram);
955955}
r13798r13799
11221122}
11231123
11241124
1125void pc090oj_draw_sprites( device_t *device, bitmap_t *bitmap, const rectangle *cliprect, int pri_type )
1125void pc090oj_draw_sprites( device_t *device, bitmap_t *bitmap, const rectangle &cliprect, int pri_type )
11261126{
11271127   pc090oj_state *pc090oj = pc090oj_get_safe_token(device);
11281128   int offs, priority = 0;
r13798r13799
15281528
15291529/* NB: orientation_flipx code in following routine has not been tested */
15301530
1531static void tc0080vco_bg0_tilemap_draw( device_t *device, bitmap_t *bitmap, const rectangle *cliprect, int flags, UINT32 priority )
1531static void tc0080vco_bg0_tilemap_draw( device_t *device, bitmap_t *bitmap, const rectangle &cliprect, int flags, UINT32 priority )
15321532{
15331533   tc0080vco_state *tc0080vco = tc0080vco_get_safe_token(device);
15341534   UINT16 zoom = tc0080vco->scroll_ram[6];
r13798r13799
15571557      int flip = tc0080vco->flipscreen;
15581558      int machine_flip = 0;   /* for  ROT 180 ? */
15591559
1560      int min_x = cliprect->min_x;
1561      int max_x = cliprect->max_x;
1562      int min_y = cliprect->min_y;
1563      int max_y = cliprect->max_y;
1560      int min_x = cliprect.min_x;
1561      int max_x = cliprect.max_x;
1562      int min_y = cliprect.min_y;
1563      int max_y = cliprect.max_y;
15641564      int screen_width = max_x + 1;
15651565      int width_mask = 0x3ff;   /* underlying tilemap */
15661566
r13798r13799
16811681}                                                               \
16821682while (0)                                                         \
16831683
1684static void tc0080vco_bg1_tilemap_draw( device_t *device, bitmap_t *bitmap, const rectangle *cliprect, int flags, UINT32 priority )
1684static void tc0080vco_bg1_tilemap_draw( device_t *device, bitmap_t *bitmap, const rectangle &cliprect, int flags, UINT32 priority )
16851685{
16861686   tc0080vco_state *tc0080vco = tc0080vco_get_safe_token(device);
16871687   UINT8 layer = 1;
16881688   UINT16 zoom = tc0080vco->scroll_ram[6 + layer];
1689   int min_x = cliprect->min_x;
1690   int max_x = cliprect->max_x;
1691   int min_y = cliprect->min_y;
1692   int max_y = cliprect->max_y;
1689   int min_x = cliprect.min_x;
1690   int max_x = cliprect.max_x;
1691   int min_y = cliprect.min_y;
1692   int max_y = cliprect.max_y;
16931693   int zoomx, zoomy;
16941694
16951695   zoomx = (zoom & 0xff00) >> 8;
r13798r13799
17671767}
17681768
17691769
1770void tc0080vco_tilemap_draw( device_t *device, bitmap_t *bitmap, const rectangle *cliprect, int layer, int flags, UINT32 priority )
1770void tc0080vco_tilemap_draw( device_t *device, bitmap_t *bitmap, const rectangle &cliprect, int layer, int flags, UINT32 priority )
17711771{
17721772   tc0080vco_state *tc0080vco = tc0080vco_get_safe_token(device);
17731773   int disable = 0x00;   /* possibly layer disable bits do exist ?? */
r13798r13799
23262326      tilemap_set_scrollx(tc0100scn->tilemap[1][tc0100scn->dblwidth], (j + tc0100scn->fgscrolly) & 0x1ff, tc0100scn->fgscrollx - tc0100scn->fgscroll_ram[j]);
23272327}
23282328
2329static void tc0100scn_tilemap_draw_fg( device_t *device, bitmap_t *bitmap, const rectangle *cliprect, tilemap_t* tmap, int flags, UINT32 priority )
2329static void tc0100scn_tilemap_draw_fg( device_t *device, bitmap_t *bitmap, const rectangle &cliprect, tilemap_t* tmap, int flags, UINT32 priority )
23302330{
23312331   tc0100scn_state *tc0100scn = tc0100scn_get_safe_token(device);
23322332   const bitmap_t *src_bitmap = tilemap_get_pixmap(tmap);
r13798r13799
23422342   if (tc0100scn->ctrl[0x7] & 1) // Flipscreen
23432343      src_y = (256 - src_y) & height_mask;
23442344
2345   //We use cliprect->max_y and cliprect->max_x to support games which use more than 1 screen
2345   //We use cliprect.max_y and cliprect.max_x to support games which use more than 1 screen
23462346
23472347   // Row offsets are 'screen space' 0-255 regardless of Y scroll
2348   for (y = 0; y <= cliprect->max_y; y++)
2348   for (y = 0; y <= cliprect.max_y; y++)
23492349   {
2350      src_x = (tc0100scn->fgscrollx - tc0100scn->fgscroll_ram[(y + scrolly_delta) & 0x1ff] + scrollx_delta + cliprect->min_x) & width_mask;
2350      src_x = (tc0100scn->fgscrollx - tc0100scn->fgscroll_ram[(y + scrolly_delta) & 0x1ff] + scrollx_delta + cliprect.min_x) & width_mask;
23512351      if (tc0100scn->ctrl[0x7] & 1) // Flipscreen
23522352         src_x = (256 - 64 - src_x) & width_mask;
23532353
23542354      // Col offsets are 'tilemap' space 0-511, and apply to blocks of 8 pixels at once
2355      for (x = 0; x <= (cliprect->max_x - cliprect->min_x); x++)
2355      for (x = 0; x <= (cliprect.max_x - cliprect.min_x); x++)
23562356      {
23572357         column_offset = tc0100scn->colscroll_ram[(src_x & 0x3ff) / 8];
23582358         p = src_bitmap->pix16((src_y - column_offset) & height_mask, src_x);
23592359
23602360         if ((p & 0xf)!= 0 || (flags & TILEMAP_DRAW_OPAQUE))
23612361         {
2362            bitmap->pix16(y, x + cliprect->min_x) = p;
2362            bitmap->pix16(y, x + cliprect.min_x) = p;
23632363            if (device->machine().priority_bitmap)
23642364            {
23652365               UINT8 *pri = &device->machine().priority_bitmap->pix8(y);
2366               pri[x + cliprect->min_x] |= priority;
2366               pri[x + cliprect.min_x] |= priority;
23672367            }
23682368         }
23692369         src_x = (src_x + 1) & width_mask;
r13798r13799
23722372   }
23732373}
23742374
2375int tc0100scn_tilemap_draw( device_t *device, bitmap_t *bitmap, const rectangle *cliprect, int layer, int flags, UINT32 priority )
2375int tc0100scn_tilemap_draw( device_t *device, bitmap_t *bitmap, const rectangle &cliprect, int layer, int flags, UINT32 priority )
23762376{
23772377   tc0100scn_state *tc0100scn = tc0100scn_get_safe_token(device);
23782378   int disable = tc0100scn->ctrl[6] & 0xf7;
2379   rectangle clip = *cliprect;
2379   rectangle clip = cliprect;
23802380   clip &= tc0100scn->cliprect;
23812381
23822382#if 0
r13798r13799
23892389      case 0:
23902390         if (disable & 0x01)
23912391            return 1;
2392         tilemap_draw(bitmap, &clip, tc0100scn->tilemap[0][tc0100scn->dblwidth], flags, priority);
2392         tilemap_draw(bitmap, clip, tc0100scn->tilemap[0][tc0100scn->dblwidth], flags, priority);
23932393         break;
23942394      case 1:
23952395         if (disable & 0x02)
23962396            return 1;
2397         tc0100scn_tilemap_draw_fg(device, bitmap, &clip, tc0100scn->tilemap[1][tc0100scn->dblwidth], flags, priority);
2397         tc0100scn_tilemap_draw_fg(device, bitmap, clip, tc0100scn->tilemap[1][tc0100scn->dblwidth], flags, priority);
23982398         break;
23992399      case 2:
24002400         if (disable & 0x04)
24012401            return 1;
2402         tilemap_draw(bitmap, &clip, tc0100scn->tilemap[2][tc0100scn->dblwidth], flags, priority);
2402         tilemap_draw(bitmap, clip, tc0100scn->tilemap[2][tc0100scn->dblwidth], flags, priority);
24032403         break;
24042404   }
24052405   return 0;
r13798r13799
26332633   tc0280grd_tilemap_update(device, base_color);
26342634}
26352635
2636static void zoom_draw( device_t *device, bitmap_t *bitmap, const rectangle *cliprect, int xoffset, int yoffset, UINT32 priority, int xmultiply )
2636static void zoom_draw( device_t *device, bitmap_t *bitmap, const rectangle &cliprect, int xoffset, int yoffset, UINT32 priority, int xmultiply )
26372637{
26382638   tc0280grd_state *tc0280grd = tc0280grd_get_safe_token(device);
26392639   UINT32 startx, starty;
r13798r13799
26682668         0, priority);
26692669}
26702670
2671void tc0280grd_zoom_draw( device_t *device, bitmap_t *bitmap, const rectangle *cliprect, int xoffset, int yoffset, UINT32 priority )
2671void tc0280grd_zoom_draw( device_t *device, bitmap_t *bitmap, const rectangle &cliprect, int xoffset, int yoffset, UINT32 priority )
26722672{
26732673   zoom_draw(device, bitmap, cliprect, xoffset, yoffset, priority, 2);
26742674}
26752675
2676void tc0430grw_zoom_draw( device_t *device, bitmap_t *bitmap, const rectangle *cliprect, int xoffset, int yoffset, UINT32 priority )
2676void tc0430grw_zoom_draw( device_t *device, bitmap_t *bitmap, const rectangle &cliprect, int xoffset, int yoffset, UINT32 priority )
26772677{
26782678   zoom_draw(device, bitmap, cliprect, xoffset, yoffset, priority, 1);
26792679}
r13798r13799
32363236
32373237**********************************************************************/
32383238
3239static void tc0480scp_bg01_draw( device_t *device, bitmap_t *bitmap, const rectangle *cliprect, int layer, int flags, UINT32 priority )
3239static void tc0480scp_bg01_draw( device_t *device, bitmap_t *bitmap, const rectangle &cliprect, int layer, int flags, UINT32 priority )
32403240{
32413241   /* X-axis zoom offers expansion only: 0 = no zoom, 0xff = max
32423242       Y-axis zoom offers expansion/compression: 0x7f = no zoom, 0xff = max
r13798r13799
32643264      int x_index, x_step;
32653265      int machine_flip = 0;   /* for  ROT 180 ? */
32663266
3267      UINT16 screen_width = 512; //cliprect->max_x - cliprect->min_x + 1;
3268      UINT16 min_y = cliprect->min_y;
3269      UINT16 max_y = cliprect->max_y;
3267      UINT16 screen_width = 512; //cliprect.max_x - cliprect.min_x + 1;
3268      UINT16 min_y = cliprect.min_y;
3269      UINT16 max_y = cliprect.max_y;
32703270
32713271      int width_mask = 0x1ff;
32723272      if (tc0480scp->dblwidth)
r13798r13799
33853385
33863386****************************************************************/
33873387
3388static void tc0480scp_bg23_draw( device_t *device, bitmap_t *bitmap, const rectangle *cliprect, int layer, int flags, UINT32 priority )
3388static void tc0480scp_bg23_draw( device_t *device, bitmap_t *bitmap, const rectangle &cliprect, int layer, int flags, UINT32 priority )
33893389{
33903390   tc0480scp_state *tc0480scp = tc0480scp_get_safe_token(device);
33913391   bitmap_t *srcbitmap = tilemap_get_pixmap(tc0480scp->tilemap[layer][tc0480scp->dblwidth]);
r13798r13799
34003400   int flipscreen = tc0480scp->pri_reg & 0x40;
34013401   int machine_flip = 0;   /* for  ROT 180 ? */
34023402
3403   UINT16 screen_width = 512; //cliprect->max_x - cliprect->min_x + 1;
3404   UINT16 min_y = cliprect->min_y;
3405   UINT16 max_y = cliprect->max_y;
3403   UINT16 screen_width = 512; //cliprect.max_x - cliprect.min_x + 1;
3404   UINT16 min_y = cliprect.min_y;
3405   UINT16 max_y = cliprect.max_y;
34063406
34073407   int width_mask = 0x1ff;
34083408   if (tc0480scp->dblwidth)
r13798r13799
35073507}
35083508
35093509
3510void tc0480scp_tilemap_draw( device_t *device, bitmap_t *bitmap, const rectangle *cliprect, int layer, int flags, UINT32 priority )
3510void tc0480scp_tilemap_draw( device_t *device, bitmap_t *bitmap, const rectangle &cliprect, int layer, int flags, UINT32 priority )
35113511{
35123512   tc0480scp_state *tc0480scp = tc0480scp_get_safe_token(device);
35133513
r13798r13799
39513951
39523952******************************************************************************/
39533953
3954void tc0150rod_draw( device_t *device, bitmap_t *bitmap, const rectangle *cliprect, int y_offs, int palette_offs, int type, int road_trans, UINT32 low_priority, UINT32 high_priority )
3954void tc0150rod_draw( device_t *device, bitmap_t *bitmap, const rectangle &cliprect, int y_offs, int palette_offs, int type, int road_trans, UINT32 low_priority, UINT32 high_priority )
39553955{
39563956   tc0150rod_state *tc0150rod = tc0150rod_get_safe_token(device);
39573957
r13798r13799
39783978   int left_edge, right_edge, begin, end, right_over, left_over;
39793979   int line_needs_drawing, draw_top_road_line, background_only;
39803980
3981   int min_x = cliprect->min_x;
3982   int max_x = cliprect->max_x;
3983   int min_y = cliprect->min_y;
3984   int max_y = cliprect->max_y;
3981   int min_x = cliprect.min_x;
3982   int max_x = cliprect.max_x;
3983   int min_y = cliprect.min_y;
3984   int max_y = cliprect.max_y;
39853985   int screen_width = max_x - min_x + 1;
39863986
39873987   int y = min_y;
r13798r13799
50145014      tilemap_mark_tile_dirty(tc0180vcu->tilemap[2], offset & 0x7ff);
50155015}
50165016
5017void tc0180vcu_tilemap_draw( device_t *device, bitmap_t *bitmap, const rectangle *cliprect, int tmap_num, int plane )
5017void tc0180vcu_tilemap_draw( device_t *device, bitmap_t *bitmap, const rectangle &cliprect, int tmap_num, int plane )
50185018{
50195019   tc0180vcu_state *tc0180vcu = tc0180vcu_get_safe_token(device);
50205020
r13798r13799
50355035      lines_per_block = 256 - (tc0180vcu->ctrl[2 + plane] >> 8);
50365036      number_of_blocks = 256 / lines_per_block;
50375037
5038      my_clip.min_x = cliprect->min_x;
5039      my_clip.max_x = cliprect->max_x;
5038      my_clip.min_x = cliprect.min_x;
5039      my_clip.max_x = cliprect.max_x;
50405040
50415041      for (i = 0; i < number_of_blocks; i++)
50425042      {
r13798r13799
50525052            my_clip.max_y = bitmap->height() - 1 - i * lines_per_block;
50535053         }
50545054
5055         my_clip &= *cliprect;
5055         my_clip &= cliprect;
50565056
50575057         if (my_clip.min_y <= my_clip.max_y)
50585058         {
50595059            tilemap_set_scrollx(tc0180vcu->tilemap[tmap_num], 0, -scrollx);
50605060            tilemap_set_scrolly(tc0180vcu->tilemap[tmap_num], 0, -scrolly);
5061            tilemap_draw(bitmap, &my_clip, tc0180vcu->tilemap[tmap_num], 0, 0);
5061            tilemap_draw(bitmap, my_clip, tc0180vcu->tilemap[tmap_num], 0, 0);
50625062         }
50635063      }
50645064   }
src/mame/video/namcos86.c
r13798r13799
28228215   xxxxxxxx  Y position
283283*/
284284
285static void draw_sprites(running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect)
285static void draw_sprites(running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect)
286286{
287287   namcos86_state *state = machine.driver_data<namcos86_state>();
288288   const UINT8 *source = &state->m_spriteram[0x0800-0x20];   /* the last is NOT a sprite */
r13798r13799
376376   set_scroll(screen.machine(), 2);
377377   set_scroll(screen.machine(), 3);
378378
379   screen.machine().priority_bitmap->fill(0, *cliprect);
379   screen.machine().priority_bitmap->fill(0, cliprect);
380380
381   bitmap->fill(screen.machine().gfx[0]->color_base + 8*state->m_backcolor+7, *cliprect);
381   bitmap->fill(screen.machine().gfx[0]->color_base + 8*state->m_backcolor+7, cliprect);
382382
383383   for (layer = 0;layer < 8;layer++)
384384   {
src/mame/video/suna8.c
r13798r13799
202202
203203***************************************************************************/
204204
205static void draw_normal_sprites(running_machine &machine, bitmap_t *bitmap,const rectangle *cliprect)
205static void draw_normal_sprites(running_machine &machine, bitmap_t *bitmap,const rectangle &cliprect)
206206{
207207   suna8_state *state = machine.driver_data<suna8_state>();
208208   UINT8 *spriteram = state->m_spriteram;
r13798r13799
336336   }
337337}
338338
339static void draw_text_sprites(running_machine &machine, bitmap_t *bitmap,const rectangle *cliprect)
339static void draw_text_sprites(running_machine &machine, bitmap_t *bitmap,const rectangle &cliprect)
340340{
341341   suna8_state *state = machine.driver_data<suna8_state>();
342342   UINT8 *spriteram = state->m_spriteram;
r13798r13799
415415SCREEN_UPDATE( suna8 )
416416{
417417   /* see hardhead, hardhea2 test mode (press button 2 for both players) */
418   bitmap->fill(0xff, *cliprect);
418   bitmap->fill(0xff, cliprect);
419419
420420#ifdef MAME_DEBUG
421421#if TILEMAPS
src/mame/video/qdrmfgp.c
r13798r13799
6060SCREEN_UPDATE( qdrmfgp )
6161{
6262   device_t *k056832 = screen.machine().device("k056832");
63   bitmap->fill(get_black_pen(screen.machine()), *cliprect);
63   bitmap->fill(get_black_pen(screen.machine()), cliprect);
6464
6565   k056832_tilemap_draw(k056832, bitmap, cliprect, 3, 0, 1);
6666   k056832_tilemap_draw(k056832, bitmap, cliprect, 2, 0, 2);
src/mame/video/btime.c
r13798r13799
301301}
302302
303303
304static void draw_chars( running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect, UINT8 transparency, UINT8 color, int priority )
304static void draw_chars( running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect, UINT8 transparency, UINT8 color, int priority )
305305{
306306   btime_state *state = machine.driver_data<btime_state>();
307307   offs_t offs;
r13798r13799
332332   }
333333}
334334
335static void draw_sprites( running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect, UINT8 color,
335static void draw_sprites( running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect, UINT8 color,
336336                   UINT8 sprite_y_adjust, UINT8 sprite_y_adjust_flip_screen,
337337                   UINT8 *sprite_ram, offs_t interleave )
338338{
r13798r13799
382382}
383383
384384
385static void draw_background( running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect, UINT8* tmap, UINT8 color )
385static void draw_background( running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect, UINT8* tmap, UINT8 color )
386386{
387387   btime_state *state = machine.driver_data<btime_state>();
388388   int i;
r13798r13799
513513            sy = 256 - sy;
514514         }
515515
516         drawgfx_opaque(state->m_background_bitmap, 0, screen.machine().gfx[2],
516         drawgfx_opaque(state->m_background_bitmap, state->m_background_bitmap->cliprect(), screen.machine().gfx[2],
517517               (state->m_bnj_backgroundram[offs] >> 4) + ((offs & 0x80) >> 3) + 32,
518518               0,
519519               flip_screen_get(screen.machine()), flip_screen_get(screen.machine()),
src/mame/video/taitoic.h
r13798r13799
180180void pc080sn_set_scroll(device_t *device, int tilemap_num, int scrollx, int scrolly);
181181void pc080sn_set_trans_pen(device_t *device, int tilemap_num, int pen);
182182void pc080sn_tilemap_update(device_t *device);
183void pc080sn_tilemap_draw(device_t *device, bitmap_t *bitmap, const rectangle *cliprect, int layer, int flags, UINT32 priority);
184void pc080sn_tilemap_draw_offset(device_t *device, bitmap_t *bitmap, const rectangle *cliprect, int layer, int flags, UINT32 priority, int xoffs, int yoffs);
183void pc080sn_tilemap_draw(device_t *device, bitmap_t *bitmap, const rectangle &cliprect, int layer, int flags, UINT32 priority);
184void pc080sn_tilemap_draw_offset(device_t *device, bitmap_t *bitmap, const rectangle &cliprect, int layer, int flags, UINT32 priority, int xoffs, int yoffs);
185185
186186/* For Topspeed */
187void pc080sn_tilemap_draw_special(device_t *device, bitmap_t *bitmap, const rectangle *cliprect, int layer, int flags, UINT32 priority, UINT16 *ram);
187void pc080sn_tilemap_draw_special(device_t *device, bitmap_t *bitmap, const rectangle &cliprect, int layer, int flags, UINT32 priority, UINT16 *ram);
188188
189189
190190/**  PC090OJ  **/
r13798r13799
193193
194194void pc090oj_set_sprite_ctrl(device_t *device, UINT16 sprctrl);
195195void pc090oj_eof_callback(device_t *device);
196void pc090oj_draw_sprites(device_t *device, bitmap_t *bitmap, const rectangle *cliprect, int pri_type);
196void pc090oj_draw_sprites(device_t *device, bitmap_t *bitmap, const rectangle &cliprect, int pri_type);
197197
198198
199199/** TC0080VCO **/
r13798r13799
201201WRITE16_DEVICE_HANDLER( tc0080vco_word_w );
202202
203203void tc0080vco_tilemap_update(device_t *device);
204void tc0080vco_tilemap_draw(device_t *device, bitmap_t *bitmap, const rectangle *cliprect, int layer, int flags, UINT32 priority);
204void tc0080vco_tilemap_draw(device_t *device, bitmap_t *bitmap, const rectangle &cliprect, int layer, int flags, UINT32 priority);
205205
206206READ16_DEVICE_HANDLER( tc0080vco_cram_0_r );
207207READ16_DEVICE_HANDLER( tc0080vco_cram_1_r );
r13798r13799
239239WRITE32_DEVICE_HANDLER( tc0100scn_ctrl_long_w );
240240
241241void tc0100scn_tilemap_update(device_t *device);
242int tc0100scn_tilemap_draw(device_t *device, bitmap_t *bitmap, const rectangle *cliprect, int layer, int flags, UINT32 priority);
242int tc0100scn_tilemap_draw(device_t *device, bitmap_t *bitmap, const rectangle &cliprect, int layer, int flags, UINT32 priority);
243243
244244/* returns 0 or 1 depending on the lowest priority tilemap set in the internal
245245   register. Use this function to draw tilemaps in the correct order. */
r13798r13799
251251WRITE16_DEVICE_HANDLER( tc0280grd_word_w );
252252WRITE16_DEVICE_HANDLER( tc0280grd_ctrl_word_w );
253253void tc0280grd_tilemap_update(device_t *device, int base_color);
254void tc0280grd_zoom_draw(device_t *device, bitmap_t *bitmap, const rectangle *cliprect, int xoffset, int yoffset, UINT32 priority);
254void tc0280grd_zoom_draw(device_t *device, bitmap_t *bitmap, const rectangle &cliprect, int xoffset, int yoffset, UINT32 priority);
255255
256256READ16_DEVICE_HANDLER( tc0430grw_word_r );
257257WRITE16_DEVICE_HANDLER( tc0430grw_word_w );
258258WRITE16_DEVICE_HANDLER( tc0430grw_ctrl_word_w );
259259void tc0430grw_tilemap_update(device_t *device, int base_color);
260void tc0430grw_zoom_draw(device_t *device, bitmap_t *bitmap, const rectangle *cliprect, int xoffset, int yoffset, UINT32 priority);
260void tc0430grw_zoom_draw(device_t *device, bitmap_t *bitmap, const rectangle &cliprect, int xoffset, int yoffset, UINT32 priority);
261261
262262
263263/** TC0360PRI **/
r13798r13799
282282WRITE32_DEVICE_HANDLER( tc0480scp_ctrl_long_w );
283283
284284void tc0480scp_tilemap_update(device_t *device);
285void tc0480scp_tilemap_draw(device_t *device, bitmap_t *bitmap, const rectangle *cliprect, int layer, int flags, UINT32 priority);
285void tc0480scp_tilemap_draw(device_t *device, bitmap_t *bitmap, const rectangle &cliprect, int layer, int flags, UINT32 priority);
286286
287287/* Returns the priority order of the bg tilemaps set in the internal
288288   register. The order in which the four layers should be drawn is
r13798r13799
296296/** TC0150ROD **/
297297READ16_DEVICE_HANDLER( tc0150rod_word_r );
298298WRITE16_DEVICE_HANDLER( tc0150rod_word_w );
299void tc0150rod_draw(device_t *device, bitmap_t *bitmap, const rectangle *cliprect, int y_offs, int palette_offs, int type, int road_trans, UINT32 low_priority, UINT32 high_priority);
299void tc0150rod_draw(device_t *device, bitmap_t *bitmap, const rectangle &cliprect, int y_offs, int palette_offs, int type, int road_trans, UINT32 low_priority, UINT32 high_priority);
300300
301301
302302/** TC0110PCR **/
r13798r13799
317317WRITE16_DEVICE_HANDLER( tc0180vcu_scroll_w );
318318READ16_DEVICE_HANDLER( tc0180vcu_word_r );
319319WRITE16_DEVICE_HANDLER( tc0180vcu_word_w );
320void tc0180vcu_tilemap_draw(device_t *device, bitmap_t *bitmap, const rectangle *cliprect, int tmap_num, int plane);
320void tc0180vcu_tilemap_draw(device_t *device, bitmap_t *bitmap, const rectangle &cliprect, int tmap_num, int plane);
src/mame/video/nova2001.c
r13798r13799
270270 *
271271 *************************************/
272272
273static void nova2001_draw_sprites(running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect )
273static void nova2001_draw_sprites(running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect )
274274{
275275   nova2001_state *state = machine.driver_data<nova2001_state>();
276276   UINT8 *spriteram = state->m_spriteram;
r13798r13799
308308   }
309309}
310310
311static void pkunwar_draw_sprites(running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect )
311static void pkunwar_draw_sprites(running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect )
312312{
313313   nova2001_state *state = machine.driver_data<nova2001_state>();
314314   UINT8 *spriteram = state->m_spriteram;
src/mame/video/cps1.c
r13798r13799
22982298}
22992299
23002300
2301static void cps1_render_sprites( running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect )
2301static void cps1_render_sprites( running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect )
23022302{
23032303   cps_state *state = machine.driver_data<cps_state>();
23042304
r13798r13799
25412541   state->m_cps2_last_sprite_offset = state->m_cps2_obj_size / 2 - 4;
25422542}
25432543
2544static void cps2_render_sprites( running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect, int *primasks )
2544static void cps2_render_sprites( running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect, int *primasks )
25452545{
25462546   cps_state *state = machine.driver_data<cps_state>();
25472547
r13798r13799
26902690
26912691
26922692
2693static void cps1_render_stars( screen_device &screen, bitmap_t *bitmap, const rectangle *cliprect )
2693static void cps1_render_stars( screen_device &screen, bitmap_t *bitmap, const rectangle &cliprect )
26942694{
26952695   cps_state *state = screen.machine().driver_data<cps_state>();
26962696   int offs;
r13798r13799
27232723
27242724            col = ((col & 0xe0) >> 1) + (screen.frame_number() / 16 & 0x0f);
27252725
2726            if (sx >= cliprect->min_x && sx <= cliprect->max_x &&
2727               sy >= cliprect->min_y && sy <= cliprect->max_y)
2726            if (sx >= cliprect.min_x && sx <= cliprect.max_x &&
2727               sy >= cliprect.min_y && sy <= cliprect.max_y)
27282728               bitmap->pix16(sy, sx) = 0xa00 + col;
27292729         }
27302730      }
r13798r13799
27492749
27502750            col = ((col & 0xe0) >> 1) + (screen.frame_number() / 16 & 0x0f);
27512751
2752            if (sx >= cliprect->min_x && sx <= cliprect->max_x &&
2753               sy >= cliprect->min_y && sy <= cliprect->max_y)
2752            if (sx >= cliprect.min_x && sx <= cliprect.max_x &&
2753               sy >= cliprect.min_y && sy <= cliprect.max_y)
27542754               bitmap->pix16(sy, sx) = 0x800 + col;
27552755         }
27562756      }
r13798r13799
27582758}
27592759
27602760
2761static void cps1_render_layer( running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect, int layer, int primask )
2761static void cps1_render_layer( running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect, int layer, int primask )
27622762{
27632763   cps_state *state = machine.driver_data<cps_state>();
27642764   switch (layer)
r13798r13799
27742774   }
27752775}
27762776
2777static void cps1_render_high_layer( running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect, int layer )
2777static void cps1_render_high_layer( running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect, int layer )
27782778{
27792779   cps_state *state = machine.driver_data<cps_state>();
27802780   switch (layer)
r13798r13799
28512851   {
28522852      // CPS1 games use pen 0xbff as background color; this is used in 3wonders,
28532853      // mtwins (explosion during attract), mercs (intermission).
2854      bitmap->fill(0xbff, *cliprect);
2854      bitmap->fill(0xbff, cliprect);
28552855   }
28562856   else
28572857   {
r13798r13799
28602860      // Maybe Capcom changed the background handling due to the problems that
28612861      // it caused on several monitors (because the background extended into the
28622862      // blanking area instead of going black, causing the monitor to clip).
2863      bitmap->fill(get_black_pen(screen.machine()), *cliprect);
2863      bitmap->fill(get_black_pen(screen.machine()), cliprect);
28642864   }
28652865
28662866   cps1_render_stars(screen, bitmap, cliprect);
r13798r13799
28702870   l1 = (layercontrol >> 0x08) & 03;
28712871   l2 = (layercontrol >> 0x0a) & 03;
28722872   l3 = (layercontrol >> 0x0c) & 03;
2873   screen.machine().priority_bitmap->fill(0, *cliprect);
2873   screen.machine().priority_bitmap->fill(0, cliprect);
28742874
28752875   if (state->m_cps_version == 1)
28762876   {
src/mame/video/starcrus.c
r13798r13799
184184
185185   /* Draw ship 1 */
186186   drawgfx_opaque(state->m_ship1_vid,
187         &clip,
187         clip,
188188         machine.gfx[8+((state->m_s1_sprite&0x04)>>2)],
189189         (state->m_s1_sprite&0x03)^0x03,
190190         0,
r13798r13799
193193
194194   /* Draw ship 2 */
195195   drawgfx_opaque(state->m_ship2_vid,
196         &clip,
196         clip,
197197         machine.gfx[10+((state->m_s2_sprite&0x04)>>2)],
198198         (state->m_s2_sprite&0x03)^0x03,
199199         0,
r13798r13799
241241   {
242242      /* Draw score/projectile 1 */
243243      drawgfx_opaque(state->m_proj1_vid,
244            &clip,
244            clip,
245245            machine.gfx[(state->m_p1_sprite&0x0c)>>2],
246246            (state->m_p1_sprite&0x03)^0x03,
247247            0,
r13798r13799
253253   {
254254      /* Draw score/projectile 2 */
255255      drawgfx_opaque(state->m_proj2_vid,
256            &clip,
256            clip,
257257            machine.gfx[4+((state->m_p2_sprite&0x0c)>>2)],
258258            (state->m_p2_sprite&0x03)^0x03,
259259            0,
r13798r13799
301301
302302   /* Draw ship 1 */
303303   drawgfx_opaque(state->m_ship1_vid,
304         &clip,
304         clip,
305305         machine.gfx[8+((state->m_s1_sprite&0x04)>>2)],
306306         (state->m_s1_sprite&0x03)^0x03,
307307         0,
r13798r13799
312312   {
313313      /* Draw projectile 1 */
314314      drawgfx_opaque(state->m_proj1_vid,
315            &clip,
315            clip,
316316            machine.gfx[(state->m_p1_sprite&0x0c)>>2],
317317            (state->m_p1_sprite&0x03)^0x03,
318318            0,
r13798r13799
324324   {
325325      /* Draw projectile 2 */
326326      drawgfx_opaque(state->m_proj2_vid,
327            &clip,
327            clip,
328328            machine.gfx[4+((state->m_p2_sprite&0x0c)>>2)],
329329            (state->m_p2_sprite&0x03)^0x03,
330330            0,
r13798r13799
378378
379379   /* Draw ship 2 */
380380   drawgfx_opaque(state->m_ship2_vid,
381         &clip,
381         clip,
382382         machine.gfx[10+((state->m_s2_sprite&0x04)>>2)],
383383         (state->m_s2_sprite&0x03)^0x03,
384384         0,
r13798r13799
389389   {
390390      /* Draw projectile 1 */
391391      drawgfx_opaque(state->m_proj1_vid,
392            &clip,
392            clip,
393393            machine.gfx[(state->m_p1_sprite&0x0c)>>2],
394394            (state->m_p1_sprite&0x03)^0x03,
395395            0,
r13798r13799
401401   {
402402      /* Draw projectile 2 */
403403      drawgfx_opaque(state->m_proj2_vid,
404            &clip,
404            clip,
405405            machine.gfx[4+((state->m_p2_sprite&0x0c)>>2)],
406406            (state->m_p2_sprite&0x03)^0x03,
407407            0,
r13798r13799
429429{
430430   starcrus_state *state = screen.machine().driver_data<starcrus_state>();
431431
432   bitmap->fill(0, *cliprect);
432   bitmap->fill(0, cliprect);
433433
434434   /* Draw ship 1 */
435435   drawgfx_transpen(bitmap,
r13798r13799
472472         0);
473473
474474   /* Collision detection */
475   if (cliprect->max_y == screen.visible_area().max_y)
475   if (cliprect.max_y == screen.visible_area().max_y)
476476   {
477477      state->m_collision_reg = 0x00;
478478
src/mame/video/yunsun16.c
r13798r13799
136136
137137***************************************************************************/
138138
139static void draw_sprites( running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect )
139static void draw_sprites( running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect )
140140{
141141   yunsun16_state *state = machine.driver_data<yunsun16_state>();
142142   int offs;
r13798r13799
212212
213213   //popmessage("%04X", *state->m_priorityram);
214214
215   screen.machine().priority_bitmap->fill(0, *cliprect);
215   screen.machine().priority_bitmap->fill(0, cliprect);
216216
217217   if ((*state->m_priorityram & 0x0c) == 4)
218218   {
src/mame/video/wiz.c
r13798r13799
9797   state->m_flipy = data;
9898}
9999
100static void draw_background(running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect, int bank, int colortype)
100static void draw_background(running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect, int bank, int colortype)
101101{
102102   wiz_state *state = machine.driver_data<wiz_state>();
103103   UINT8 *videoram = state->m_videoram;
r13798r13799
138138   }
139139}
140140
141static void draw_foreground(running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect, int colortype)
141static void draw_foreground(running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect, int colortype)
142142{
143143   wiz_state *state = machine.driver_data<wiz_state>();
144144   int offs;
r13798r13799
178178}
179179
180180static void draw_sprites(running_machine &machine, bitmap_t *bitmap,
181                   const rectangle *cliprect, UINT8* sprite_ram,
181                   const rectangle &cliprect, UINT8* sprite_ram,
182182                         int bank)
183183{
184184   wiz_state *state = machine.driver_data<wiz_state>();
r13798r13799
209209SCREEN_UPDATE( kungfut )
210210{
211211   wiz_state *state = screen.machine().driver_data<wiz_state>();
212   bitmap->fill(state->m_bgpen, *cliprect);
212   bitmap->fill(state->m_bgpen, cliprect);
213213   draw_background(screen.machine(), bitmap, cliprect, 2 + state->m_char_bank[0] , 0);
214214   draw_foreground(screen.machine(), bitmap, cliprect, 0);
215215   draw_sprites(screen.machine(), bitmap, cliprect, state->m_spriteram2, 4);
r13798r13799
221221{
222222   wiz_state *state = screen.machine().driver_data<wiz_state>();
223223   int bank;
224   const rectangle* visible_area;
225224
226   bitmap->fill(state->m_bgpen, *cliprect);
225   bitmap->fill(state->m_bgpen, cliprect);
227226   draw_background(screen.machine(), bitmap, cliprect, 2 + ((state->m_char_bank[0] << 1) | state->m_char_bank[1]), 0);
228227   draw_foreground(screen.machine(), bitmap, cliprect, 0);
229228
230229   const rectangle spritevisiblearea(2*8, 32*8-1, 2*8, 30*8-1);
231230   const rectangle spritevisibleareaflipx(0*8, 30*8-1, 2*8, 30*8-1);
232   visible_area = state->m_flipx ? &spritevisibleareaflipx : &spritevisiblearea;
231   const rectangle &visible_area = state->m_flipx ? spritevisibleareaflipx : spritevisiblearea;
233232
234233   bank = 7 + *state->m_sprite_bank;
235234
r13798r13799
242241SCREEN_UPDATE( stinger )
243242{
244243   wiz_state *state = screen.machine().driver_data<wiz_state>();
245   bitmap->fill(state->m_bgpen, *cliprect);
244   bitmap->fill(state->m_bgpen, cliprect);
246245   draw_background(screen.machine(), bitmap, cliprect, 2 + state->m_char_bank[0], 1);
247246   draw_foreground(screen.machine(), bitmap, cliprect, 1);
248247   draw_sprites(screen.machine(), bitmap, cliprect, state->m_spriteram2, 4);
src/mame/video/stactics.c
r13798r13799
236236}
237237
238238
239static void draw_background(stactics_state *state, bitmap_t *bitmap, const rectangle *cliprect)
239static void draw_background(stactics_state *state, bitmap_t *bitmap, const rectangle &cliprect)
240240{
241241   int y;
242242
243   bitmap->fill(0, *cliprect);
243   bitmap->fill(0, cliprect);
244244
245245   /* for every row */
246246   for (y = 0; y < 0x100; y++)
src/mame/video/mermaid.c
r13798r13799
188188   state->m_helper2 = machine.primary_screen->alloc_compatible_bitmap();
189189}
190190
191static void draw_sprites( running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect )
191static void draw_sprites( running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect )
192192{
193193   const rectangle spritevisiblearea(0 * 8, 26 * 8 - 1, 2 * 8, 30 * 8 - 1);
194194   const rectangle flip_spritevisiblearea(6 * 8, 31 * 8 - 1, 2 * 8, 30 * 8 - 1);
r13798r13799
225225         sy = 240 - sy;
226226      }
227227
228      drawgfx_transpen(bitmap, (flip_screen_x_get(machine) ? &flip_spritevisiblearea : &spritevisiblearea),
228      drawgfx_transpen(bitmap, (flip_screen_x_get(machine) ? flip_spritevisiblearea : spritevisiblearea),
229229         machine.gfx[1], code, color, flipx, flipy, sx, sy, 0);
230230   }
231231}
r13798r13799
240240   return 0;
241241}
242242
243static UINT8 collision_check( running_machine &machine, rectangle* rect )
243static UINT8 collision_check( running_machine &machine, rectangle& rect )
244244{
245245   mermaid_state *state = machine.driver_data<mermaid_state>();
246246   UINT8 data = 0;
r13798r13799
248248   int x;
249249   int y;
250250
251   for (y = rect->min_y; y <= rect->max_y; y++)
252      for (x = rect->min_x; x <= rect->max_x; x++)
251   for (y = rect.min_y; y <= rect.max_y; y++)
252      for (x = rect.min_x; x <= rect.max_x; x++)
253253      {
254254         UINT16 a = colortable_entry_get_value(machine.colortable, state->m_helper->pix16(y, x)) & 0x3f;
255255         UINT16 b = colortable_entry_get_value(machine.colortable, state->m_helper2->pix16(y, x)) & 0x3f;
r13798r13799
327327      state->m_helper->fill(0, rect);
328328      state->m_helper2->fill(0, rect);
329329
330      tilemap_draw(state->m_helper, &rect, state->m_bg_tilemap, 0, 0);
330      tilemap_draw(state->m_helper, rect, state->m_bg_tilemap, 0, 0);
331331
332      drawgfx_transpen(state->m_helper2, &rect, screen.machine().gfx[1], code, 0, flipx, flipy, sx, sy, 0);
332      drawgfx_transpen(state->m_helper2, rect, screen.machine().gfx[1], code, 0, flipx, flipy, sx, sy, 0);
333333
334      state->m_coll_bit2 |= collision_check(screen.machine(), &rect);
334      state->m_coll_bit2 |= collision_check(screen.machine(), rect);
335335
336336      // check collision sprite - foreground
337337
338338      state->m_helper->fill(0, rect);
339339      state->m_helper2->fill(0, rect);
340340
341      tilemap_draw(state->m_helper, &rect, state->m_fg_tilemap, 0, 0);
341      tilemap_draw(state->m_helper, rect, state->m_fg_tilemap, 0, 0);
342342
343      drawgfx_transpen(state->m_helper2, &rect, screen.machine().gfx[1], code, 0, flipx, flipy, sx, sy, 0);
343      drawgfx_transpen(state->m_helper2, rect, screen.machine().gfx[1], code, 0, flipx, flipy, sx, sy, 0);
344344
345      state->m_coll_bit1 |= collision_check(screen.machine(), &rect);
345      state->m_coll_bit1 |= collision_check(screen.machine(), rect);
346346
347347      // check collision sprite - sprite
348348
r13798r13799
378378               sy2 = 240 - sy2;
379379            }
380380
381            drawgfx_transpen(state->m_helper, &rect, screen.machine().gfx[1], code2, 0, flipx2, flipy2, sx2, sy2, 0);
381            drawgfx_transpen(state->m_helper, rect, screen.machine().gfx[1], code2, 0, flipx2, flipy2, sx2, sy2, 0);
382382         }
383383
384      drawgfx_transpen(state->m_helper2, &rect, screen.machine().gfx[1], code, 0, flipx, flipy, sx, sy, 0);
384      drawgfx_transpen(state->m_helper2, rect, screen.machine().gfx[1], code, 0, flipx, flipy, sx, sy, 0);
385385
386      state->m_coll_bit0 |= collision_check(screen.machine(), &rect);
386      state->m_coll_bit0 |= collision_check(screen.machine(), rect);
387387   }
388388
389389   // check for bit 3 (sprite-sprite)
r13798r13799
466466               sy2 = 240 - sy2;
467467            }
468468
469            drawgfx_transpen(state->m_helper, &rect, screen.machine().gfx[1], code2, 0, flipx2, flipy2, sx2, sy2, 0);
469            drawgfx_transpen(state->m_helper, rect, screen.machine().gfx[1], code2, 0, flipx2, flipy2, sx2, sy2, 0);
470470         }
471471
472      drawgfx_transpen(state->m_helper2, &rect, screen.machine().gfx[1], code, 0, flipx, flipy, sx, sy, 0);
472      drawgfx_transpen(state->m_helper2, rect, screen.machine().gfx[1], code, 0, flipx, flipy, sx, sy, 0);
473473
474      state->m_coll_bit3 |= collision_check(screen.machine(), &rect);
474      state->m_coll_bit3 |= collision_check(screen.machine(), rect);
475475   }
476476
477477   // check for bit 6
r13798r13799
554554               sy2 = 240 - sy2;
555555            }
556556
557            drawgfx_transpen(state->m_helper, &rect, screen.machine().gfx[1], code2, 0, flipx2, flipy2, sx2, sy2, 0);
557            drawgfx_transpen(state->m_helper, rect, screen.machine().gfx[1], code2, 0, flipx2, flipy2, sx2, sy2, 0);
558558         }
559559
560      drawgfx_transpen(state->m_helper2, &rect, screen.machine().gfx[1], code, 0, flipx, flipy, sx, sy, 0);
560      drawgfx_transpen(state->m_helper2, rect, screen.machine().gfx[1], code, 0, flipx, flipy, sx, sy, 0);
561561
562      state->m_coll_bit6 |= collision_check(screen.machine(), &rect);
562      state->m_coll_bit6 |= collision_check(screen.machine(), rect);
563563   }
564564
565565}
src/mame/video/gaelco3d.c
r13798r13799
459459        if (screen.machine().input().code_pressed(KEYCODE_DOWN) && yv < 0x40000)
460460            yv += 4;
461461
462        for (y = cliprect->min_y; y <= cliprect->max_y; y++)
462        for (y = cliprect.min_y; y <= cliprect.max_y; y++)
463463        {
464464            UINT16 *dest = &bitmap->pix16(y);
465            for (x = cliprect->min_x; x <= cliprect->max_x; x++)
465            for (x = cliprect.min_x; x <= cliprect.max_x; x++)
466466            {
467                int offs = (yv + y - cliprect->min_y) * 4096 + xv + x - cliprect->min_x;
467                int offs = (yv + y - cliprect.min_y) * 4096 + xv + x - cliprect.min_x;
468468                if (offs < length)
469469                    dest[x] = base[offs];
470470                else
src/mame/video/dcon.c
r13798r13799
151151   state->m_gfx_bank_select = 0;
152152}
153153
154static void draw_sprites(running_machine& machine, bitmap_t *bitmap,const rectangle *cliprect)
154static void draw_sprites(running_machine& machine, bitmap_t *bitmap,const rectangle &cliprect)
155155{
156156   dcon_state *state = machine.driver_data<dcon_state>();
157157   UINT16 *spriteram16 = state->m_spriteram;
r13798r13799
280280SCREEN_UPDATE( dcon )
281281{
282282   dcon_state *state = screen.machine().driver_data<dcon_state>();
283   screen.machine().priority_bitmap->fill(0, *cliprect);
283   screen.machine().priority_bitmap->fill(0, cliprect);
284284
285285   /* Setup the tilemaps */
286286   tilemap_set_scrollx( state->m_background_layer,0, state->m_scroll_ram[0] );
r13798r13799
293293   if ((state->m_enable&1)!=1)
294294      tilemap_draw(bitmap,cliprect,state->m_background_layer,0,0);
295295   else
296      bitmap->fill(15, *cliprect); /* Should always be black, not pen 15 */
296      bitmap->fill(15, cliprect); /* Should always be black, not pen 15 */
297297
298298   tilemap_draw(bitmap,cliprect,state->m_midground_layer,0,1);
299299   tilemap_draw(bitmap,cliprect,state->m_foreground_layer,0,2);
r13798r13799
307307{
308308   dcon_state *state = screen.machine().driver_data<dcon_state>();
309309
310   screen.machine().priority_bitmap->fill(0, *cliprect);
310   screen.machine().priority_bitmap->fill(0, cliprect);
311311
312312   /* Gfx banking */
313313   if (state->m_last_gfx_bank!=state->m_gfx_bank_select)
r13798r13799
329329   if ((state->m_enable&1)!=1)
330330      tilemap_draw(bitmap,cliprect,state->m_background_layer,0,0);
331331   else
332      bitmap->fill(15, *cliprect); /* Should always be black, not pen 15 */
332      bitmap->fill(15, cliprect); /* Should always be black, not pen 15 */
333333
334334   tilemap_draw(bitmap,cliprect,state->m_midground_layer,0,1);
335335   tilemap_draw(bitmap,cliprect,state->m_foreground_layer,0,2);
src/mame/video/kickgoal.c
r13798r13799
9292
9393
9494
95static void kickgoal_draw_sprites( running_machine &machine, bitmap_t *bitmap,const rectangle *cliprect )
95static void kickgoal_draw_sprites( running_machine &machine, bitmap_t *bitmap,const rectangle &cliprect )
9696{
9797   kickgoal_state *state = machine.driver_data<kickgoal_state>();
9898   UINT16 *spriteram = state->m_spriteram;
r13798r13799
225225}
226226
227227
228static void actionhw_draw_sprites(running_machine &machine, bitmap_t *bitmap,const rectangle *cliprect)
228static void actionhw_draw_sprites(running_machine &machine, bitmap_t *bitmap,const rectangle &cliprect)
229229{
230230   kickgoal_state *state = machine.driver_data<kickgoal_state>();
231231   UINT16 *spriteram = state->m_spriteram;
src/mame/video/itech8.c
r13798r13799
622622   /* if we're blanked, just fill with black */
623623   if (tms_state.blanked)
624624   {
625      bitmap->fill(get_black_pen(screen.machine()), *cliprect);
625      bitmap->fill(get_black_pen(screen.machine()), cliprect);
626626      return 0;
627627   }
628628
r13798r13799
630630   /*    top layer @ 0x00000 is only 4bpp, colors come from the first 16 palettes */
631631   /* bottom layer @ 0x20000 is full 8bpp */
632632   page_offset = tms_state.dispstart & 0x0ffff;
633   for (y = cliprect->min_y; y <= cliprect->max_y; y++)
633   for (y = cliprect.min_y; y <= cliprect.max_y; y++)
634634   {
635635      UINT8 *base0 = &tms_state.vram[(0x00000 + page_offset + y * 256) & 0x3ffff];
636636      UINT8 *base2 = &tms_state.vram[(0x20000 + page_offset + y * 256) & 0x3ffff];
637637      UINT32 *dest = &bitmap->pix32(y);
638638
639      for (x = cliprect->min_x; x <= cliprect->max_x; x++)
639      for (x = cliprect.min_x; x <= cliprect.max_x; x++)
640640      {
641641         int pix0 = base0[x] & 0x0f;
642642         dest[x] = pens[pix0 ? pix0 : base2[x]];
r13798r13799
659659   /* if we're blanked, just fill with black */
660660   if (tms_state.blanked)
661661   {
662      bitmap->fill(get_black_pen(screen.machine()), *cliprect);
662      bitmap->fill(get_black_pen(screen.machine()), cliprect);
663663      return 0;
664664   }
665665
r13798r13799
669669   /* 4bpp pixels are packed 2 to a byte */
670670   /* xscroll is set via a separate register */
671671   page_offset = (tms_state.dispstart & 0x0ffff) | state->m_grmatch_xscroll;
672   for (y = cliprect->min_y; y <= cliprect->max_y; y++)
672   for (y = cliprect.min_y; y <= cliprect.max_y; y++)
673673   {
674674      UINT8 *base0 = &tms_state.vram[0x00000 + ((page_offset + y * 256) & 0xffff)];
675675      UINT8 *base2 = &tms_state.vram[0x20000 + ((page_offset + y * 256) & 0xffff)];
676676      UINT32 *dest = &bitmap->pix32(y);
677677
678      for (x = cliprect->min_x & ~1; x <= cliprect->max_x; x += 2)
678      for (x = cliprect.min_x & ~1; x <= cliprect.max_x; x += 2)
679679      {
680680         UINT8 pix0 = base0[x / 2];
681681         UINT8 pix2 = base2[x / 2];
r13798r13799
709709   /* if we're blanked, just fill with black */
710710   if (tms_state.blanked)
711711   {
712      bitmap->fill(get_black_pen(screen.machine()), *cliprect);
712      bitmap->fill(get_black_pen(screen.machine()), cliprect);
713713      return 0;
714714   }
715715
716716   /* there are two pages, each of which is a full 8bpp */
717717   /* page index is selected by the top bit of the page_select register */
718718   page_offset = ((state->m_page_select & 0x80) << 10) | (tms_state.dispstart & 0x0ffff);
719   for (y = cliprect->min_y; y <= cliprect->max_y; y++)
719   for (y = cliprect.min_y; y <= cliprect.max_y; y++)
720720   {
721721      UINT8 *base = &tms_state.vram[(page_offset + y * 256) & 0x3ffff];
722722      UINT32 *dest = &bitmap->pix32(y);
723723
724      for (x = cliprect->min_x; x <= cliprect->max_x; x++)
724      for (x = cliprect.min_x; x <= cliprect.max_x; x++)
725725         dest[x] = pens[base[x]];
726726   }
727727   return 0;
r13798r13799
742742   /* if we're blanked, just fill with black */
743743   if (tms_state.blanked)
744744   {
745      bitmap->fill(get_black_pen(screen.machine()), *cliprect);
745      bitmap->fill(get_black_pen(screen.machine()), cliprect);
746746      return 0;
747747   }
748748
r13798r13799
751751   /* the upper 4 bits were latched on each write into a separate bitmap */
752752   /* page index is selected by the top bit of the page_select register */
753753   page_offset = ((~state->m_page_select & 0x80) << 10) | (tms_state.dispstart & 0x0ffff);
754   for (y = cliprect->min_y; y <= cliprect->max_y; y++)
754   for (y = cliprect.min_y; y <= cliprect.max_y; y++)
755755   {
756756      UINT8 *base = &tms_state.vram[(page_offset + y * 256) & 0x3ffff];
757757      UINT8 *latch = &tms_state.latchram[(page_offset + y * 256) & 0x3ffff];
758758      UINT32 *dest = &bitmap->pix32(y);
759759
760      for (x = cliprect->min_x & ~1; x <= cliprect->max_x; x += 2)
760      for (x = cliprect.min_x & ~1; x <= cliprect.max_x; x += 2)
761761      {
762762         dest[x + 0] = pens[(latch[x/2] & 0xf0) | (base[x/2] >> 4)];
763763         dest[x + 1] = pens[((latch[x/2] << 4) & 0xf0) | (base[x/2] & 0x0f)];
src/mame/video/galaxian.c
r13798r13799
237237static void state_save_register(running_machine &machine);
238238static TILE_GET_INFO( bg_get_tile_info );
239239
240static void sprites_draw(running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect, const UINT8 *spritebase);
240static void sprites_draw(running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect, const UINT8 *spritebase);
241241
242242static void stars_init(running_machine &machine);
243243static void stars_update_origin(running_machine &machine);
244244static void stars_draw_row(galaxian_state *state, bitmap_t *bitmap, int maxx, int y, UINT32 star_offs, UINT8 starmask);
245245
246static void bullets_draw(running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect, const UINT8 *base);
246static void bullets_draw(running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect, const UINT8 *base);
247247
248248
249249
r13798r13799
561561 *
562562 *************************************/
563563
564static void sprites_draw(running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect, const UINT8 *spritebase)
564static void sprites_draw(running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect, const UINT8 *spritebase)
565565{
566566   galaxian_state *state = machine.driver_data<galaxian_state>();
567   rectangle clip = *cliprect;
567   rectangle clip = cliprect;
568568   int sprnum;
569569
570570   /* 16 of the 256 pixels of the sprites are hard-clipped at the line buffer */
r13798r13799
608608      }
609609
610610      /* draw */
611      drawgfx_transpen(bitmap, &clip,
611      drawgfx_transpen(bitmap, clip,
612612            machine.gfx[1],
613613            code, color,
614614            flipx, flipy,
r13798r13799
624624 *
625625 *************************************/
626626
627static void bullets_draw(running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect, const UINT8 *base)
627static void bullets_draw(running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect, const UINT8 *base)
628628{
629629   galaxian_state *state = machine.driver_data<galaxian_state>();
630630   int y;
631631
632632   /* iterate over scanlines */
633   for (y = cliprect->min_y; y <= cliprect->max_y; y++)
633   for (y = cliprect.min_y; y <= cliprect.max_y; y++)
634634   {
635635      UINT8 shell = 0xff, missile = 0xff;
636636      UINT8 effy;
r13798r13799
939939 *
940940 *************************************/
941941
942void galaxian_draw_background(running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect)
942void galaxian_draw_background(running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect)
943943{
944944   galaxian_state *state = machine.driver_data<galaxian_state>();
945945   /* erase the background to black first */
946   bitmap->fill(RGB_BLACK, *cliprect);
946   bitmap->fill(RGB_BLACK, cliprect);
947947
948948   /* update the star origin to the current frame */
949949   stars_update_origin(machine);
r13798r13799
954954      int y;
955955
956956      /* iterate over scanlines */
957      for (y = cliprect->min_y; y <= cliprect->max_y; y++)
957      for (y = cliprect.min_y; y <= cliprect.max_y; y++)
958958      {
959959         UINT32 star_offs = state->m_star_rng_origin + y * 512;
960960         stars_draw_row(state, bitmap, 256, y, star_offs, 0xff);
r13798r13799
963963}
964964
965965
966static void background_draw_colorsplit(running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect, rgb_t color, int split, int split_flipped)
966static void background_draw_colorsplit(running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect, rgb_t color, int split, int split_flipped)
967967{
968968   galaxian_state *state = machine.driver_data<galaxian_state>();
969969   /* horizontal bgcolor split */
970970   if (state->m_flipscreen_x)
971971   {
972      rectangle draw = *cliprect;
972      rectangle draw = cliprect;
973973      draw.max_x = MIN(draw.max_x, split_flipped * GALAXIAN_XSCALE - 1);
974974      if (draw.min_x <= draw.max_x)
975975         bitmap->fill(RGB_BLACK, draw);
976976
977      draw = *cliprect;
977      draw = cliprect;
978978      draw.min_x = MAX(draw.min_x, split_flipped * GALAXIAN_XSCALE);
979979      if (draw.min_x <= draw.max_x)
980980         bitmap->fill(color, draw);
981981   }
982982   else
983983   {
984      rectangle draw = *cliprect;
984      rectangle draw = cliprect;
985985      draw.max_x = MIN(draw.max_x, split * GALAXIAN_XSCALE - 1);
986986      if (draw.min_x <= draw.max_x)
987987         bitmap->fill(color, draw);
988988
989      draw = *cliprect;
989      draw = cliprect;
990990      draw.min_x = MAX(draw.min_x, split * GALAXIAN_XSCALE);
991991      if (draw.min_x <= draw.max_x)
992992         bitmap->fill(RGB_BLACK, draw);
r13798r13799
994994}
995995
996996
997static void scramble_draw_stars(running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect, int maxx)
997static void scramble_draw_stars(running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect, int maxx)
998998{
999999   galaxian_state *state = machine.driver_data<galaxian_state>();
10001000   /* update the star origin to the current frame */
r13798r13799
10071007      int y;
10081008
10091009      /* iterate over scanlines */
1010      for (y = cliprect->min_y; y <= cliprect->max_y; y++)
1010      for (y = cliprect.min_y; y <= cliprect.max_y; y++)
10111011      {
10121012         /* blink state 2 suppressed stars when 2V == 0 */
10131013         if (blink_state != 2 || (y & 2) != 0)
r13798r13799
10211021}
10221022
10231023
1024void scramble_draw_background(running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect)
1024void scramble_draw_background(running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect)
10251025{
10261026   galaxian_state *state = machine.driver_data<galaxian_state>();
10271027   /* blue background - 390 ohm resistor */
1028   bitmap->fill(state->m_background_enable ? MAKE_RGB(0,0,0x56) : RGB_BLACK, *cliprect);
1028   bitmap->fill(state->m_background_enable ? MAKE_RGB(0,0,0x56) : RGB_BLACK, cliprect);
10291029
10301030   scramble_draw_stars(machine, bitmap, cliprect, 256);
10311031}
10321032
10331033
1034void anteater_draw_background(running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect)
1034void anteater_draw_background(running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect)
10351035{
10361036   galaxian_state *state = machine.driver_data<galaxian_state>();
10371037   /* blue background, horizontal split as seen on flyer and real cabinet */
r13798r13799
10411041}
10421042
10431043
1044void jumpbug_draw_background(running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect)
1044void jumpbug_draw_background(running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect)
10451045{
10461046   galaxian_state *state = machine.driver_data<galaxian_state>();
10471047   /* blue background - 390 ohm resistor */
1048   bitmap->fill(state->m_background_enable ? MAKE_RGB(0,0,0x56) : RGB_BLACK, *cliprect);
1048   bitmap->fill(state->m_background_enable ? MAKE_RGB(0,0,0x56) : RGB_BLACK, cliprect);
10491049
10501050   /* render stars same as scramble but nothing in the status area */
10511051   scramble_draw_stars(machine, bitmap, cliprect, 240);
10521052}
10531053
10541054
1055void turtles_draw_background(running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect)
1055void turtles_draw_background(running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect)
10561056{
10571057   galaxian_state *state = machine.driver_data<galaxian_state>();
10581058   /*
r13798r13799
10621062            GREEN - 470 ohm resistor
10631063            BLUE  - 390 ohm resistor
10641064    */
1065   bitmap->fill(MAKE_RGB(state->m_background_red * 0x55, state->m_background_green * 0x47, state->m_background_blue * 0x55), *cliprect);
1065   bitmap->fill(MAKE_RGB(state->m_background_red * 0x55, state->m_background_green * 0x47, state->m_background_blue * 0x55), cliprect);
10661066}
10671067
10681068
1069void frogger_draw_background(running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect)
1069void frogger_draw_background(running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect)
10701070{
10711071   /* color split point verified on real machine */
10721072   /* hmmm, according to schematics it is at 128+8; which is right? */
r13798r13799
10751075
10761076
10771077#ifdef UNUSED_FUNCTION
1078static int flip_and_clip(rectangle *draw, int xstart, int xend, const rectangle *cliprect)
1078static int flip_and_clip(rectangle *draw, int xstart, int xend, const rectangle &cliprect)
10791079{
10801080   galaxian_state *state = machine.driver_data<galaxian_state>();
1081   *draw = *cliprect;
1081   *draw = cliprect;
10821082   if (!state->m_flipscreen_x)
10831083   {
10841084      draw->min_x = xstart * GALAXIAN_XSCALE;
r13798r13799
10931093   return (draw->min_x <= draw->max_x);
10941094}
10951095
1096void amidar_draw_background(running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect)
1096void amidar_draw_background(running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect)
10971097{
10981098   galaxian_state *state = machine.driver_data<galaxian_state>();
10991099   const UINT8 *prom = machine.region("user1")->base();
r13798r13799
11331133 *
11341134 *************************************/
11351135
1136INLINE void galaxian_draw_pixel(bitmap_t *bitmap, const rectangle *cliprect, int y, int x, rgb_t color)
1136INLINE void galaxian_draw_pixel(bitmap_t *bitmap, const rectangle &cliprect, int y, int x, rgb_t color)
11371137{
1138   if (y >= cliprect->min_y && y <= cliprect->max_y)
1138   if (y >= cliprect.min_y && y <= cliprect.max_y)
11391139   {
11401140      x *= GALAXIAN_XSCALE;
11411141      x += GALAXIAN_H0START;
1142      if (x >= cliprect->min_x && x <= cliprect->max_x)
1142      if (x >= cliprect.min_x && x <= cliprect.max_x)
11431143         bitmap->pix32(y, x) = color;
11441144
11451145      x++;
1146      if (x >= cliprect->min_x && x <= cliprect->max_x)
1146      if (x >= cliprect.min_x && x <= cliprect.max_x)
11471147         bitmap->pix32(y, x) = color;
11481148
11491149      x++;
1150      if (x >= cliprect->min_x && x <= cliprect->max_x)
1150      if (x >= cliprect.min_x && x <= cliprect.max_x)
11511151         bitmap->pix32(y, x) = color;
11521152   }
11531153}
11541154
11551155
1156void galaxian_draw_bullet(running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect, int offs, int x, int y)
1156void galaxian_draw_bullet(running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect, int offs, int x, int y)
11571157{
11581158   galaxian_state *state = machine.driver_data<galaxian_state>();
11591159   /*
r13798r13799
11701170}
11711171
11721172
1173void mshuttle_draw_bullet(running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect, int offs, int x, int y)
1173void mshuttle_draw_bullet(running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect, int offs, int x, int y)
11741174{
11751175   /* verified by schematics:
11761176        * both "W" and "Y" bullets are 4 pixels long
r13798r13799
11991199}
12001200
12011201
1202void scramble_draw_bullet(running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect, int offs, int x, int y)
1202void scramble_draw_bullet(running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect, int offs, int x, int y)
12031203{
12041204   /*
12051205        Scramble only has "shells", which begin displaying when the counter
r13798r13799
12111211}
12121212
12131213
1214void theend_draw_bullet(running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect, int offs, int x, int y)
1214void theend_draw_bullet(running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect, int offs, int x, int y)
12151215{
12161216   galaxian_state *state = machine.driver_data<galaxian_state>();
12171217   /* Same as galaxian except blue/green are swapped */
src/mame/video/othldrby.c
r13798r13799
136136
137137***************************************************************************/
138138
139static void draw_sprites( running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect, int priority )
139static void draw_sprites( running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect, int priority )
140140{
141141   othldrby_state *state = machine.driver_data<othldrby_state>();
142142   int offs;
r13798r13799
201201      }
202202   }
203203
204   screen.machine().priority_bitmap->fill(0, *cliprect);
204   screen.machine().priority_bitmap->fill(0, cliprect);
205205
206   bitmap->fill(0, *cliprect);
206   bitmap->fill(0, cliprect);
207207
208208   for (layer = 0; layer < 3; layer++)
209209      tilemap_draw(bitmap, cliprect, state->m_bg_tilemap[layer], 0, 0);
src/mame/video/gstriker.c
r13798r13799
8484   state->m_VS920A[numchip].gfx_region = gfx_region;
8585}
8686
87static void VS920A_draw(gstriker_state *state, int numchip, bitmap_t* screen, const rectangle* cliprect, int priority)
87static void VS920A_draw(gstriker_state *state, int numchip, bitmap_t* screen, const rectangle &cliprect, int priority)
8888{
8989   state->m_VS920A_cur_chip = &state->m_VS920A[numchip];
9090
r13798r13799
238238}
239239
240240/* THIS IS STILL WRONG! */
241static void MB60553_draw(running_machine &machine, int numchip, bitmap_t* screen, const rectangle* cliprect, int priority)
241static void MB60553_draw(running_machine &machine, int numchip, bitmap_t* screen, const rectangle &cliprect, int priority)
242242{
243243   gstriker_state *state = machine.driver_data<gstriker_state>();
244244   int line;
r13798r13799
269269
270270      clip.min_y = clip.max_y = line;
271271
272      tilemap_draw_roz(screen,&clip,state->m_MB60553_cur_chip->tmap,startx<<12,starty<<12,
272      tilemap_draw_roz(screen,clip,state->m_MB60553_cur_chip->tmap,startx<<12,starty<<12,
273273            incxx,0,0,incyy,
274274            1,
275275            0,priority);
r13798r13799
383383*/
384384
385385
386static void CG10103_draw_sprite(running_machine &machine, bitmap_t* screen, const rectangle* cliprect, UINT16* spr, int drawpri)
386static void CG10103_draw_sprite(running_machine &machine, bitmap_t* screen, const rectangle &cliprect, UINT16* spr, int drawpri)
387387{
388388   gstriker_state *state = machine.driver_data<gstriker_state>();
389389   int ypos = spr[0] & 0x1FF;
r13798r13799
460460}
461461
462462
463static void CG10103_draw(running_machine &machine, int numchip, bitmap_t* screen, const rectangle* cliprect, int priority)
463static void CG10103_draw(running_machine &machine, int numchip, bitmap_t* screen, const rectangle &cliprect, int priority)
464464{
465465   gstriker_state *state = machine.driver_data<gstriker_state>();
466466   UINT16* splist;
r13798r13799
536536SCREEN_UPDATE(gstriker)
537537{
538538   gstriker_state *state = screen.machine().driver_data<gstriker_state>();
539   bitmap->fill(get_black_pen(screen.machine()), *cliprect);
539   bitmap->fill(get_black_pen(screen.machine()), cliprect);
540540
541541   // Sandwitched screen/sprite0/score/sprite1. Surely wrong, probably
542542   //  needs sprite orthogonality
src/mame/video/snk.c
r13798r13799
744744
745745/**************************************************************************************/
746746
747static void marvins_draw_sprites(running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect,
747static void marvins_draw_sprites(running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect,
748748      const int scrollx, const int scrolly, const int from, const int to)
749749{
750750   snk_state *state = machine.driver_data<snk_state>();
r13798r13799
789789}
790790
791791
792static void tnk3_draw_sprites(running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect, const int xscroll, const int yscroll)
792static void tnk3_draw_sprites(running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect, const int xscroll, const int yscroll)
793793{
794794   snk_state *state = machine.driver_data<snk_state>();
795795   UINT8 *spriteram = state->m_spriteram;
r13798r13799
854854}
855855
856856
857static void ikari_draw_sprites(running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect,
857static void ikari_draw_sprites(running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect,
858858      const int start, const int xscroll, const int yscroll, const UINT8 *source, const int gfxnum )
859859{
860860   snk_state *state = machine.driver_data<snk_state>();
r13798r13799
926926    -xx-x--- (bank number)
927927    x------- (x offset bit8)
928928*/
929static void tdfever_draw_sprites(running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect,
929static void tdfever_draw_sprites(running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect,
930930      const int xscroll, const int yscroll, const UINT8 *source, const int gfxnum, const int hw_xflip, const int from, const int to )
931931{
932932   snk_state *state = machine.driver_data<snk_state>();
src/mame/video/hyprduel.c
r13798r13799
459459
460460/* Draw sprites */
461461
462static void draw_sprites( running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect )
462static void draw_sprites( running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect )
463463{
464464   hyprduel_state *state = machine.driver_data<hyprduel_state>();
465465   UINT8 *base_gfx   =   machine.region("gfx1")->base();
r13798r13799
634634}
635635
636636
637static void draw_layers( running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect, int pri, int layers_ctrl )
637static void draw_layers( running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect, int pri, int layers_ctrl )
638638{
639639   hyprduel_state *state = machine.driver_data<hyprduel_state>();
640640   UINT16 layers_pri = state->m_videoregs[0x10/2];
r13798r13799
706706   state->m_sprite_yoffs = state->m_videoregs[0x04 / 2] - screen.height() / 2 - state->m_sprite_yoffs_sub;
707707
708708   /* The background color is selected by a register */
709   screen.machine().priority_bitmap->fill(0, *cliprect);
710   bitmap->fill((state->m_videoregs[0x12 / 2] & 0x0fff) + 0x1000, *cliprect);
709   screen.machine().priority_bitmap->fill(0, cliprect);
710   bitmap->fill((state->m_videoregs[0x12 / 2] & 0x0fff) + 0x1000, cliprect);
711711
712712   /*  Screen Control Register:
713713
r13798r13799
733733   if (screen.machine().input().code_pressed(KEYCODE_A))   msk |= 0x08;
734734   if (msk != 0)
735735   {
736      bitmap->fill(0, *cliprect);
736      bitmap->fill(0, cliprect);
737737      layers_ctrl &= msk;
738738   }
739739
src/mame/video/namconb1.c
r13798r13799
102102} /* namconb1_install_palette */
103103
104104static void
105video_update_common(running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect, int bROZ )
105video_update_common(running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect, int bROZ )
106106{
107107   int pri;
108108   namconb1_install_palette(machine);
r13798r13799
143143   clip.min_y = (yclip>>16)    - 0x21;
144144   clip.max_y = (yclip&0xffff) - 0x21 - 1;
145145   /* intersect with master clip rectangle */
146   if( clip.min_x < cliprect->min_x ){ clip.min_x = cliprect->min_x; }
147   if( clip.min_y < cliprect->min_y ){ clip.min_y = cliprect->min_y; }
148   if( clip.max_x > cliprect->max_x ){ clip.max_x = cliprect->max_x; }
149   if( clip.max_y > cliprect->max_y ){ clip.max_y = cliprect->max_y; }
146   if( clip.min_x < cliprect.min_x ){ clip.min_x = cliprect.min_x; }
147   if( clip.min_y < cliprect.min_y ){ clip.min_y = cliprect.min_y; }
148   if( clip.max_x > cliprect.max_x ){ clip.max_x = cliprect.max_x; }
149   if( clip.max_y > cliprect.max_y ){ clip.max_y = cliprect.max_y; }
150150
151   bitmap->fill(get_black_pen(screen.machine()), *cliprect );
151   bitmap->fill(get_black_pen(screen.machine()), cliprect );
152152
153   video_update_common( screen.machine(), bitmap, &clip, 0 );
153   video_update_common( screen.machine(), bitmap, clip, 0 );
154154
155155   return 0;
156156}
r13798r13799
184184   clip.min_y = (yclip>>16)    - 0x21;
185185   clip.max_y = (yclip&0xffff) - 0x21 - 1;
186186   /* intersect with master clip rectangle */
187   if( clip.min_x < cliprect->min_x ){ clip.min_x = cliprect->min_x; }
188   if( clip.min_y < cliprect->min_y ){ clip.min_y = cliprect->min_y; }
189   if( clip.max_x > cliprect->max_x ){ clip.max_x = cliprect->max_x; }
190   if( clip.max_y > cliprect->max_y ){ clip.max_y = cliprect->max_y; }
187   if( clip.min_x < cliprect.min_x ){ clip.min_x = cliprect.min_x; }
188   if( clip.min_y < cliprect.min_y ){ clip.min_y = cliprect.min_y; }
189   if( clip.max_x > cliprect.max_x ){ clip.max_x = cliprect.max_x; }
190   if( clip.max_y > cliprect.max_y ){ clip.max_y = cliprect.max_y; }
191191
192   bitmap->fill(get_black_pen(screen.machine()), *cliprect );
192   bitmap->fill(get_black_pen(screen.machine()), cliprect );
193193
194194   if( memcmp(state->m_tilemap_tile_bank,state->m_tilebank32,sizeof(state->m_tilemap_tile_bank))!=0 )
195195   {
196196      namco_tilemap_invalidate();
197197      memcpy(state->m_tilemap_tile_bank,state->m_tilebank32,sizeof(state->m_tilemap_tile_bank));
198198   }
199   video_update_common( screen.machine(), bitmap, &clip, 1 );
199   video_update_common( screen.machine(), bitmap, clip, 1 );
200200   return 0;
201201}
202202
src/mame/video/arcadecl.c
r13798r13799
1313#include "includes/arcadecl.h"
1414
1515
16static void arcadecl_bitmap_render(running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect);
16static void arcadecl_bitmap_render(running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect);
1717
1818/*************************************
1919 *
r13798r13799
121121 *
122122 *************************************/
123123
124static void arcadecl_bitmap_render(running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect)
124static void arcadecl_bitmap_render(running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect)
125125{
126126   arcadecl_state *state = machine.driver_data<arcadecl_state>();
127127   int x, y;
128128
129129   /* update any dirty scanlines */
130   for (y = cliprect->min_y; y <= cliprect->max_y; y++)
130   for (y = cliprect.min_y; y <= cliprect.max_y; y++)
131131   {
132132      const UINT16 *src = &state->m_bitmap[256 * y];
133133      UINT16 *dst = &bitmap->pix16(y);
134134
135135      /* regenerate the line */
136      for (x = cliprect->min_x & ~1; x <= cliprect->max_x; x += 2)
136      for (x = cliprect.min_x & ~1; x <= cliprect.max_x; x += 2)
137137      {
138138         int bits = src[(x - 8) / 2];
139139         dst[x + 0] = bits >> 8;
src/mame/video/flstory.c
r13798r13799
178178}
179179
180180
181static void flstory_draw_sprites( running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect, int pri )
181static void flstory_draw_sprites( running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect, int pri )
182182{
183183   flstory_state *state = machine.driver_data<flstory_state>();
184184   int i;
r13798r13799
235235   return 0;
236236}
237237
238static void victnine_draw_sprites( running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect )
238static void victnine_draw_sprites( running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect )
239239{
240240   flstory_state *state = machine.driver_data<flstory_state>();
241241   int i;
src/mame/video/suprslam.c
r13798r13799
66
77
88/* todo, fix zooming correctly, it's _not_ like aerofgt */
9static void draw_sprites( running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect )
9static void draw_sprites( running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect )
1010{
1111   /* SPRITE INFO
1212
r13798r13799
157157   suprslam_state *state = screen.machine().driver_data<suprslam_state>();
158158   tilemap_set_scrollx( state->m_screen_tilemap,0, state->m_screen_vregs[0x04/2] );
159159
160   bitmap->fill(get_black_pen(screen.machine()), *cliprect);
160   bitmap->fill(get_black_pen(screen.machine()), cliprect);
161161   k053936_zoom_draw(state->m_k053936, bitmap, cliprect, state->m_bg_tilemap, 0, 0, 1);
162162   if(!(state->m_spr_ctrl[0] & 8))
163163      draw_sprites(screen.machine(), bitmap, cliprect);
src/mame/video/strnskil.c
r13798r13799
8181   tilemap_set_scroll_rows(state->m_bg_tilemap, 32);
8282}
8383
84static void draw_sprites(running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect)
84static void draw_sprites(running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect)
8585{
8686   strnskil_state *state = machine.driver_data<strnskil_state>();
8787   UINT8 *spriteram = state->m_spriteram;
src/mame/video/cosmic.c
r13798r13799
251251}
252252
253253
254static void draw_bitmap( running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect )
254static void draw_bitmap( running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect )
255255{
256256   cosmic_state *state = machine.driver_data<cosmic_state>();
257257   offs_t offs;
r13798r13799
283283}
284284
285285
286static void draw_sprites( running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect, int color_mask, int extra_sprites )
286static void draw_sprites( running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect, int color_mask, int extra_sprites )
287287{
288288   cosmic_state *state = machine.driver_data<cosmic_state>();
289289   int offs;
r13798r13799
317317}
318318
319319
320static void cosmica_draw_starfield( screen_device &screen, bitmap_t *bitmap, const rectangle *cliprect )
320static void cosmica_draw_starfield( screen_device &screen, bitmap_t *bitmap, const rectangle &cliprect )
321321{
322322   UINT8 y = 0;
323323   UINT8 map = 0;
r13798r13799
366366}
367367
368368
369static void devzone_draw_grid( running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect )
369static void devzone_draw_grid( running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect )
370370{
371371   UINT8 y;
372372   UINT8 *horz_PROM = machine.region("user2")->base();
r13798r13799
424424}
425425
426426
427static void nomnlnd_draw_background( screen_device &screen, bitmap_t *bitmap, const rectangle *cliprect )
427static void nomnlnd_draw_background( screen_device &screen, bitmap_t *bitmap, const rectangle &cliprect )
428428{
429429   UINT8 y = 0;
430430   UINT8 water = screen.frame_number();
r13798r13799
548548
549549SCREEN_UPDATE( cosmicg )
550550{
551   bitmap->fill(0, *cliprect);
551   bitmap->fill(0, cliprect);
552552   draw_bitmap(screen.machine(), bitmap, cliprect);
553553   return 0;
554554}
r13798r13799
556556
557557SCREEN_UPDATE( panic )
558558{
559   bitmap->fill(0, *cliprect);
559   bitmap->fill(0, cliprect);
560560   draw_bitmap(screen.machine(), bitmap, cliprect);
561561   draw_sprites(screen.machine(), bitmap, cliprect, 0x07, 1);
562562   return 0;
r13798r13799
565565
566566SCREEN_UPDATE( cosmica )
567567{
568   bitmap->fill(0, *cliprect);
568   bitmap->fill(0, cliprect);
569569   cosmica_draw_starfield(screen, bitmap, cliprect);
570570   draw_bitmap(screen.machine(), bitmap, cliprect);
571571   draw_sprites(screen.machine(), bitmap, cliprect, 0x0f, 0);
r13798r13799
575575
576576SCREEN_UPDATE( magspot )
577577{
578   bitmap->fill(0, *cliprect);
578   bitmap->fill(0, cliprect);
579579   draw_bitmap(screen.machine(), bitmap, cliprect);
580580   draw_sprites(screen.machine(), bitmap, cliprect, 0x07, 0);
581581   return 0;
r13798r13799
586586{
587587   cosmic_state *state = screen.machine().driver_data<cosmic_state>();
588588
589   bitmap->fill(0, *cliprect);
589   bitmap->fill(0, cliprect);
590590
591591   if (state->m_background_enable)
592592      devzone_draw_grid(screen.machine(), bitmap, cliprect);
r13798r13799
604604   /* according to the video summation logic on pg4, the trees and river
605605       have the highest priority */
606606
607   bitmap->fill(0, *cliprect);
607   bitmap->fill(0, cliprect);
608608   draw_bitmap(screen.machine(), bitmap, cliprect);
609609   draw_sprites(screen.machine(), bitmap, cliprect, 0x07, 0);
610610
src/mame/video/shaolins.c
r13798r13799
158158   tilemap_set_scroll_cols(state->m_bg_tilemap, 32);
159159}
160160
161static void draw_sprites(running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect)
161static void draw_sprites(running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect)
162162{
163163   shaolins_state *state = machine.driver_data<shaolins_state>();
164164   UINT8 *spriteram = state->m_spriteram;
src/mame/video/model2.c
r13798r13799
923923   model2_3d_render_7   /* checker = 1, textured = 1, translucent = 1 */
924924};
925925
926static void model2_3d_render( model2_state *state, bitmap_t *bitmap, triangle *tri, const rectangle *cliprect )
926static void model2_3d_render( model2_state *state, bitmap_t *bitmap, triangle *tri, const rectangle &cliprect )
927927{
928928   poly_manager *poly = state->m_poly;
929929   poly_extra_data *extra = (poly_extra_data *)poly_get_extra_data(poly);
r13798r13799
939939   vp.min_y = (384-tri->viewport[3])+90;
940940   vp.max_y = (384-tri->viewport[1])+90;
941941
942   if ( vp.min_x < cliprect->min_x ) vp.min_x = cliprect->min_x;
943   if ( vp.max_x > cliprect->max_x ) vp.max_x = cliprect->max_x;
944   if ( vp.min_y < cliprect->min_y ) vp.min_y = cliprect->min_y;
945   if ( vp.max_y > cliprect->max_y ) vp.max_y = cliprect->max_y;
942   if ( vp.min_x < cliprect.min_x ) vp.min_x = cliprect.min_x;
943   if ( vp.max_x > cliprect.max_x ) vp.max_x = cliprect.max_x;
944   if ( vp.min_y < cliprect.min_y ) vp.min_y = cliprect.min_y;
945   if ( vp.max_y > cliprect.max_y ) vp.max_y = cliprect.max_y;
946946
947947   extra->state = state;
948948   extra->lumabase = ((tri->texheader[1] & 0xFF) << 7) + ((tri->luma >> 5) ^ 0x7);
r13798r13799
968968      tri->v[2].pu = tri->v[2].pu * tri->v[2].pz * (1.0f / 8.0f);
969969      tri->v[2].pv = tri->v[2].pv * tri->v[2].pz * (1.0f / 8.0f);
970970
971      poly_render_triangle(poly, bitmap, &vp, render_funcs[renderer], 3, &tri->v[0], &tri->v[1], &tri->v[2]);
971      poly_render_triangle(poly, bitmap, vp, render_funcs[renderer], 3, &tri->v[0], &tri->v[1], &tri->v[2]);
972972   }
973973   else
974      poly_render_triangle(poly, bitmap, &vp, render_funcs[renderer], 0, &tri->v[0], &tri->v[1], &tri->v[2]);
974      poly_render_triangle(poly, bitmap, vp, render_funcs[renderer], 0, &tri->v[0], &tri->v[1], &tri->v[2]);
975975}
976976
977977/*
r13798r13799
10221022   raster->max_z = 0;
10231023}
10241024
1025static void model2_3d_frame_end( model2_state *state, bitmap_t *bitmap, const rectangle *cliprect )
1025static void model2_3d_frame_end( model2_state *state, bitmap_t *bitmap, const rectangle &cliprect )
10261026{
10271027   raster_state *raster = state->m_raster;
10281028   INT32      z;
r13798r13799
27272727   geo_init( machine, (UINT32*)machine.region("user2")->base() );
27282728}
27292729
2730static void convert_bitmap( running_machine &machine, bitmap_t *dst, bitmap_t *src, const rectangle *rect )
2730static void convert_bitmap( running_machine &machine, bitmap_t *dst, bitmap_t *src, const rectangle &rect )
27312731{
27322732   int   x, y;
27332733
2734   for( y = rect->min_y; y < rect->max_y; y++ )
2734   for( y = rect.min_y; y < rect.max_y; y++ )
27352735   {
27362736      UINT32 *d = &dst->pix32(y);
27372737      UINT16 *s = &src->pix16(y);
27382738
2739      for( x = rect->min_x; x < rect->max_x; x++ )
2739      for( x = rect.min_x; x < rect.max_x; x++ )
27402740      {
27412741         if ( s[x] )
27422742            d[x] = machine.pens[s[x]];
r13798r13799
27492749   model2_state *state = screen.machine().driver_data<model2_state>();
27502750   logerror("--- frame ---\n");
27512751
2752   bitmap->fill(screen.machine().pens[0], *cliprect);
2753   state->m_sys24_bitmap->fill(0, *cliprect);
2752   bitmap->fill(screen.machine().pens[0], cliprect);
2753   state->m_sys24_bitmap->fill(0, cliprect);
27542754
27552755   segas24_tile *tile = screen.machine().device<segas24_tile>("tile");
27562756   tile->draw(state->m_sys24_bitmap, cliprect, 7, 0, 0);
r13798r13799
27692769   /* have the rasterizer output the frame */
27702770   model2_3d_frame_end( state, bitmap, cliprect );
27712771
2772   state->m_sys24_bitmap->fill(0, *cliprect);
2772   state->m_sys24_bitmap->fill(0, cliprect);
27732773   tile->draw(state->m_sys24_bitmap, cliprect, 3, 0, 0);
27742774   tile->draw(state->m_sys24_bitmap, cliprect, 2, 0, 0);
27752775   tile->draw(state->m_sys24_bitmap, cliprect, 1, 0, 0);
src/mame/video/sshangha.c
r13798r13799
4141
4242   tilemap_set_flip_all(screen.machine(),flip_screen_x_get(screen.machine()) ? (TILEMAP_FLIPY | TILEMAP_FLIPX) : 0);
4343
44   bitmap->fill(get_black_pen(screen.machine()), *cliprect);
44   bitmap->fill(get_black_pen(screen.machine()), cliprect);
4545
4646   deco16ic_pf_update(state->m_deco_tilegen1, state->m_pf1_rowscroll, state->m_pf2_rowscroll);
4747
src/mame/video/kyugo.c
r13798r13799
160160 *
161161 *************************************/
162162
163static void draw_sprites( running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect )
163static void draw_sprites( running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect )
164164{
165165   kyugo_state *state = machine.driver_data<kyugo_state>();
166166
src/mame/video/leland.c
r13798r13799
400400   offs_t prom_bank = ((state->m_gfxbank >> 3) & 0x01) * 0x2000;
401401
402402   /* for each scanline in the visible region */
403   for (y = cliprect->min_y; y <= cliprect->max_y; y++)
403   for (y = cliprect.min_y; y <= cliprect.max_y; y++)
404404   {
405405      int x;
406406      UINT8 fg_data = 0;
r13798r13799
467467   offs_t bg_gfx_offs_mask = bg_gfx_bank_page_size - 1;
468468
469469   /* for each scanline in the visible region */
470   for (y = cliprect->min_y; y <= cliprect->max_y; y++)
470   for (y = cliprect.min_y; y <= cliprect.max_y; y++)
471471   {
472472      int x;
473473      UINT8 fg_data = 0;
src/mame/video/decospr.c
r13798r13799
177177
178178
179179
180void decospr_device::draw_sprites( running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect, UINT16* spriteram, int sizewords, bool invert_flip )
180void decospr_device::draw_sprites( running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect, UINT16* spriteram, int sizewords, bool invert_flip )
181181{
182   //printf("cliprect %04x, %04x\n", cliprect->min_y, cliprect->max_y);
182   //printf("cliprect %04x, %04x\n", cliprect.min_y, cliprect.max_y);
183183
184184   if (m_sprite_bitmap && m_pricallback)
185185      fatalerror("m_sprite_bitmap && m_pricallback is invalid");
186186
187187   if (m_sprite_bitmap)
188      m_sprite_bitmap->fill(0, *cliprect);
188      m_sprite_bitmap->fill(0, cliprect);
189189
190190
191191   int offs, end, incr;
r13798r13799
245245            fy = y & 0x4000;
246246            multi = (1 << ((y & 0x0600) >> 9)) - 1;   /* 1x, 2x, 4x, 8x height */
247247
248            if (cliprect->max_x>256)
248            if (cliprect.max_x>256)
249249            {
250250               x = x & 0x01ff;
251251               y = y & 0x01ff;
r13798r13799
281281               {
282282                  y = 240 - y;
283283
284                  if (cliprect->max_x>256)
284                  if (cliprect.max_x>256)
285285                     x = 304 - x;
286286                  else
287287                     x = 240 - x;
r13798r13799
299299               {
300300                  int ypos;
301301                  ypos = y + mult * multi;
302                  if ((ypos<=cliprect->max_y) && (ypos>=(cliprect->min_y)-16))
302                  if ((ypos<=cliprect.max_y) && (ypos>=(cliprect.min_y)-16))
303303                  {
304304                     if(!m_sprite_bitmap)
305305                     {
306                        if ((ypos<=cliprect->max_y) && (ypos>=(cliprect->min_y)-16))
306                        if ((ypos<=cliprect.max_y) && (ypos>=(cliprect.min_y)-16))
307307                        {
308308                           if (m_pricallback)
309309                              pdrawgfx_transpen(bitmap,cliprect,machine.gfx[m_gfxregion],
r13798r13799
429429                     {
430430                        ypos = y + mult2 * (h-yy);
431431
432                        if ((ypos<=cliprect->max_y) && (ypos>=(cliprect->min_y)-16))
432                        if ((ypos<=cliprect.max_y) && (ypos>=(cliprect.min_y)-16))
433433                        {
434434                           pdrawgfx_transpen(bitmap,cliprect,machine.gfx[m_gfxregion],
435435                                 sprite + yy + h * xx,
r13798r13799
441441
442442                        ypos -= 512; // wrap-around y
443443
444                        if ((ypos<=cliprect->max_y) && (ypos>=(cliprect->min_y-16)))
444                        if ((ypos<=cliprect.max_y) && (ypos>=(cliprect.min_y-16)))
445445                        {
446446                           pdrawgfx_transpen(bitmap,cliprect,machine.gfx[m_gfxregion],
447447                                 sprite + yy + h * xx,
r13798r13799
456456                     {
457457                        ypos = y + mult2 * (h-yy);
458458
459                        if ((ypos<=cliprect->max_y) && (ypos>=(cliprect->min_y)-16))
459                        if ((ypos<=cliprect.max_y) && (ypos>=(cliprect.min_y)-16))
460460                        {
461461                           drawgfx_transpen(bitmap,cliprect,machine.gfx[m_gfxregion],
462462                                 sprite + yy + h * xx,
r13798r13799
468468
469469                        ypos -= 512; // wrap-around y
470470
471                        if ((ypos<=cliprect->max_y) && (ypos>=(cliprect->min_y-16)))
471                        if ((ypos<=cliprect.max_y) && (ypos>=(cliprect.min_y-16)))
472472                        {
473473                           drawgfx_transpen(bitmap,cliprect,machine.gfx[m_gfxregion],
474474                                 sprite + yy + h * xx,
r13798r13799
483483                  {
484484                     ypos = y + mult2 * (h-yy);
485485
486                     if ((ypos<=cliprect->max_y) && (ypos>=(cliprect->min_y)-16))
486                     if ((ypos<=cliprect.max_y) && (ypos>=(cliprect.min_y)-16))
487487                     {
488488                        drawgfx_transpen_raw(m_sprite_bitmap,cliprect,machine.gfx[m_gfxregion],
489489                              sprite + yy + h * xx,
r13798r13799
495495
496496                     ypos -= 512; // wrap-around y
497497
498                     if ((ypos<=cliprect->max_y) && (ypos>=(cliprect->min_y-16)))
498                     if ((ypos<=cliprect.max_y) && (ypos>=(cliprect.min_y-16)))
499499                     {
500500                        drawgfx_transpen_raw(m_sprite_bitmap,cliprect,machine.gfx[m_gfxregion],
501501                              sprite + yy + h * xx,
r13798r13799
516516
517517
518518// inefficient, we should be able to mix in a single pass by comparing the existing priority bitmap from the tilemaps
519void decospr_device::inefficient_copy_sprite_bitmap(running_machine& machine, bitmap_t *bitmap, const rectangle *cliprect, UINT16 pri, UINT16 priority_mask, UINT16 colbase, UINT16 palmask, UINT8 alpha)
519void decospr_device::inefficient_copy_sprite_bitmap(running_machine& machine, bitmap_t *bitmap, const rectangle &cliprect, UINT16 pri, UINT16 priority_mask, UINT16 colbase, UINT16 palmask, UINT8 alpha)
520520{
521521   if (!m_sprite_bitmap)
522522      fatalerror("decospr_device::inefficient_copy_sprite_bitmap with no m_sprite_bitmap");
r13798r13799
527527   UINT16* srcline;
528528   UINT32* dstline;
529529
530   for (y=cliprect->min_y;y<=cliprect->max_y;y++)
530   for (y=cliprect.min_y;y<=cliprect.max_y;y++)
531531   {
532532      srcline= &m_sprite_bitmap->pix16(y);
533533      dstline= &bitmap->pix32(y);
534534
535535      if (alpha==0xff)
536536      {
537         for (x=cliprect->min_x;x<=cliprect->max_x;x++)
537         for (x=cliprect.min_x;x<=cliprect.max_x;x++)
538538         {
539539            UINT16 pix = srcline[x];
540540
r13798r13799
549549      }
550550      else
551551      {
552         for (x=cliprect->min_x;x<=cliprect->max_x;x++)
552         for (x=cliprect.min_x;x<=cliprect.max_x;x++)
553553         {
554554            UINT16 pix = srcline[x];
555555
src/mame/video/popeye.c
r13798r13799
279279    state_save_register_global_pointer(machine, state->m_bitmapram, popeye_bitmapram_size);
280280}
281281
282static void draw_background(running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect)
282static void draw_background(running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect)
283283{
284284   popeye_state *state = machine.driver_data<popeye_state>();
285285   int offs;
r13798r13799
296296   set_background_palette(machine, (*state->m_palettebank & 0x08) >> 3);
297297
298298   if (state->m_background_pos[1] == 0)   /* no background */
299      bitmap->fill(0, *cliprect);
299      bitmap->fill(0, cliprect);
300300   else
301301   {
302302      /* copy the background graphics */
r13798r13799
317317   }
318318}
319319
320static void draw_sprites(running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect)
320static void draw_sprites(running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect)
321321{
322322   popeye_state *state = machine.driver_data<popeye_state>();
323323   UINT8 *spriteram = state->m_spriteram;
src/mame/video/segaic24.c
r13798r13799
346346   }
347347}
348348
349void segas24_tile::draw(bitmap_t *bitmap, const rectangle *cliprect, int layer, int lpri, int flags)
349void segas24_tile::draw(bitmap_t *bitmap, const rectangle &cliprect, int layer, int lpri, int flags)
350350{
351351   UINT16 hscr = tile_ram[0x5000+(layer >> 1)];
352352   UINT16 vscr = tile_ram[0x5004+(layer >> 1)];
r13798r13799
378378            UINT16 v = (-vscr) & 0x1ff;
379379            if(!((-vscr) & 0x200))
380380               layer ^= 1;
381            for(y=cliprect->min_y; y<=cliprect->max_y; y++) {
381            for(y=cliprect.min_y; y<=cliprect.max_y; y++) {
382382               UINT16 h;
383               rectangle c = *cliprect;
383               rectangle c = cliprect;
384384               int l1 = layer;
385385               if(y >= v)
386386                  l1 ^= 1;
r13798r13799
391391
392392               h = hscr & 0x1ff;
393393               tilemap_set_scrollx(tile_layer[l1], 0, -h);
394               tilemap_draw(bitmap, &c, tile_layer[l1], tpri, lpri);
394               tilemap_draw(bitmap, c, tile_layer[l1], tpri, lpri);
395395            }
396396            break;
397397         }
398398         case 2: case 3: {
399399            int y;
400            for(y=cliprect->min_y; y<=cliprect->max_y; y++) {
400            for(y=cliprect.min_y; y<=cliprect.max_y; y++) {
401401               UINT16 h;
402               rectangle c1 = *cliprect;
403               rectangle c2 = *cliprect;
402               rectangle c1 = cliprect;
403               rectangle c2 = cliprect;
404404               int l1 = layer;
405405
406406               hscr = hscrtb[y];
r13798r13799
418418
419419               c1.min_y = c1.max_y = c2.min_y = c2.max_y = y;
420420
421               tilemap_draw(bitmap, &c1, tile_layer[l1],   tpri, lpri);
422               tilemap_draw(bitmap, &c2, tile_layer[l1^1], tpri, lpri);
421               tilemap_draw(bitmap, c1, tile_layer[l1],   tpri, lpri);
422               tilemap_draw(bitmap, c2, tile_layer[l1^1], tpri, lpri);
423423            }
424424            break;
425425         }
r13798r13799
431431
432432         switch((ctrl & 0x6000) >> 13) {
433433         case 1: {
434            rectangle c1 = *cliprect;
435            rectangle c2 = *cliprect;
434            rectangle c1 = cliprect;
435            rectangle c2 = cliprect;
436436            UINT16 v;
437437            v = (-vscr) & 0x1ff;
438438            if(c1.max_y >= v)
r13798r13799
442442            if(!((-vscr) & 0x200))
443443               layer ^= 1;
444444
445            tilemap_draw(bitmap, &c1, tile_layer[layer],   tpri, lpri);
446            tilemap_draw(bitmap, &c2, tile_layer[layer^1], tpri, lpri);
445            tilemap_draw(bitmap, c1, tile_layer[layer],   tpri, lpri);
446            tilemap_draw(bitmap, c2, tile_layer[layer^1], tpri, lpri);
447447            break;
448448         }
449449         case 2: case 3: {
450            rectangle c1 = *cliprect;
451            rectangle c2 = *cliprect;
450            rectangle c1 = cliprect;
451            rectangle c2 = cliprect;
452452            UINT16 h;
453453            h = (+hscr) & 0x1ff;
454454            if(c1.max_x >= h)
r13798r13799
458458            if(!((+hscr) & 0x200))
459459               layer ^= 1;
460460
461            tilemap_draw(bitmap, &c1, tile_layer[layer],   tpri, lpri);
462            tilemap_draw(bitmap, &c2, tile_layer[layer^1], tpri, lpri);
461            tilemap_draw(bitmap, c1, tile_layer[layer],   tpri, lpri);
462            tilemap_draw(bitmap, c2, tile_layer[layer^1], tpri, lpri);
463463            break;
464464         }
465465         }
r13798r13799
613613    0   11------    --------
614614*/
615615
616void segas24_sprite::draw(bitmap_t *bitmap, const rectangle *cliprect, const int *spri)
616void segas24_sprite::draw(bitmap_t *bitmap, const rectangle &cliprect, const int *spri)
617617{
618618   UINT16 curspr = 0;
619619   int countspr = 0;
r13798r13799
690690      }
691691
692692
693      if(min_x < cliprect->min_x)
694         min_x = cliprect->min_x;
695      if(min_y < cliprect->min_y)
696         min_y = cliprect->min_y;
697      if(max_x > cliprect->max_x)
698         max_x = cliprect->max_x;
699      if(max_y > cliprect->max_y)
700         max_y = cliprect->max_y;
693      if(min_x < cliprect.min_x)
694         min_x = cliprect.min_x;
695      if(min_y < cliprect.min_y)
696         min_y = cliprect.min_y;
697      if(max_x > cliprect.max_x)
698         max_x = cliprect.max_x;
699      if(max_y > cliprect.max_y)
700         max_y = cliprect.max_y;
701701
702702      if(!(source[0] & 0x2000))
703703         zoomx = zoomy = source[1] & 0xff;
src/mame/video/decospr.h
r13798r13799
88   static void set_gfx_region(device_t &device, int gfxregion);
99   static void set_pri_callback(device_t &device, decospr_priority_callback_func callback);
1010   //void decospr_sprite_kludge(int x, int y);
11   void draw_sprites( running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect, UINT16* spriteram, int sizewords, bool invert_flip = false );
11   void draw_sprites( running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect, UINT16* spriteram, int sizewords, bool invert_flip = false );
1212   void set_pri_callback(decospr_priority_callback_func callback);
1313   void set_gfxregion(int region) { m_gfxregion = region; };
1414   void set_alt_format(bool alt) { m_alt_format = alt; };
1515   void set_pix_mix_mask(UINT16 mask) { m_pixmask = mask; };
1616   void set_pix_raw_shift(UINT16 shift) { m_raw_shift = shift; };
1717   void alloc_sprite_bitmap(running_machine& machine);
18   void inefficient_copy_sprite_bitmap(running_machine& machine, bitmap_t *bitmap, const rectangle *cliprect, UINT16 pri, UINT16 priority_mask, UINT16 colbase, UINT16 palmask, UINT8 alpha = 0xff);
18   void inefficient_copy_sprite_bitmap(running_machine& machine, bitmap_t *bitmap, const rectangle &cliprect, UINT16 pri, UINT16 priority_mask, UINT16 colbase, UINT16 palmask, UINT8 alpha = 0xff);
1919   bitmap_t* get_sprite_temp_bitmap(void) { return m_sprite_bitmap; };
2020
2121protected:
src/mame/video/compgolf.c
r13798r13799
9090-----x-- -------- -------- -------- Flip X
9191-------- -------- -------- -------- Flip Y(used?)
9292*/
93static void draw_sprites( running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect )
93static void draw_sprites( running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect )
9494{
9595   compgolf_state *state = machine.driver_data<compgolf_state>();
9696   int offs, fx, fy, x, y, color, sprite;
src/mame/video/segaic24.h
r13798r13799
3030   DECLARE_READ32_MEMBER(char32_r);
3131   DECLARE_WRITE32_MEMBER(char32_w);
3232
33   void draw(bitmap_t *bitmap, const rectangle *cliprect, int layer, int pri, int flags);
33   void draw(bitmap_t *bitmap, const rectangle &cliprect, int layer, int pri, int flags);
3434
3535protected:
3636   virtual void device_start();
r13798r13799
7070   DECLARE_READ16_MEMBER(read);
7171   DECLARE_WRITE16_MEMBER(write);
7272
73   void draw(bitmap_t *bitmap, const rectangle *cliprect, const int *spri);
73   void draw(bitmap_t *bitmap, const rectangle &cliprect, const int *spri);
7474
7575protected:
7676   virtual void device_start();
src/mame/video/lordgun.c
r13798r13799
243243
244244***************************************************************************/
245245
246static void draw_sprites(running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect)
246static void draw_sprites(running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect)
247247{
248248   lordgun_state *state = machine.driver_data<lordgun_state>();
249249   UINT16 *s      =   state->m_spriteram;
r13798r13799
346346
347347   if (state->m_whitescreen)
348348   {
349      bitmap->fill(get_white_pen(screen.machine()), *cliprect);
349      bitmap->fill(get_white_pen(screen.machine()), cliprect);
350350      return 0;
351351   }
352352
r13798r13799
376376
377377   int l;
378378   for (l = 0; l < 5; l++)
379      state->m_bitmaps[l]->fill(trans_pen, *cliprect);
379      state->m_bitmaps[l]->fill(trans_pen, cliprect);
380380
381381   if (layers_ctrl & 1)   tilemap_draw(state->m_bitmaps[0], cliprect, state->m_tilemap[0], 0, 0);
382382   if (layers_ctrl & 2)   tilemap_draw(state->m_bitmaps[1], cliprect, state->m_tilemap[1], 0, 0);
r13798r13799
391391   // layer index (0-3, 4 for sprites) -> priority address bit
392392   const int layer2bit[5] = {0,1,2,4,3};
393393
394   for (y = cliprect->min_y; y <= cliprect->max_y; y++)
394   for (y = cliprect.min_y; y <= cliprect.max_y; y++)
395395   {
396      for (x = cliprect->min_x; x <= cliprect->max_x; x++)
396      for (x = cliprect.min_x; x <= cliprect.max_x; x++)
397397      {
398398         UINT16 pens[5];
399399
src/mame/video/pushman.c
r13798r13799
8585
8686***************************************************************************/
8787
88static void draw_sprites( running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect )
88static void draw_sprites( running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect )
8989{
9090   pushman_state *state = machine.driver_data<pushman_state>();
9191   UINT16 *spriteram = state->m_spriteram;
src/mame/video/lemmings.c
r13798r13799
1515#include "emu.h"
1616#include "includes/lemmings.h"
1717
18static void draw_sprites( running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect, UINT16 *spritedata, int gfxbank, UINT16 pri )
18static void draw_sprites( running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect, UINT16 *spritedata, int gfxbank, UINT16 pri )
1919{
2020   int offs;
2121
r13798r13799
173173   int x0 = -state->m_control_data[2];
174174   int y = 0;
175175   rectangle rect;
176   rect.max_y = cliprect->max_y;
177   rect.min_y = cliprect->min_y;
176   rect.max_y = cliprect.max_y;
177   rect.min_y = cliprect.min_y;
178178
179   bitmap->fill(get_black_pen(screen.machine()), *cliprect);
179   bitmap->fill(get_black_pen(screen.machine()), cliprect);
180180   draw_sprites(screen.machine(), bitmap, cliprect, state->m_sprite_triple_buffer_1, 1, 0x0000);
181181
182182   /* Pixel layer can be windowed in hardware (two player mode) */
r13798r13799
186186   {
187187      rect.max_x = 159;
188188      rect.min_x = 0;
189      copyscrollbitmap_trans(bitmap, state->m_bitmap0, 1, &x0, 1, &y, &rect, 0x100);
189      copyscrollbitmap_trans(bitmap, state->m_bitmap0, 1, &x0, 1, &y, rect, 0x100);
190190      rect.max_x = 319;
191191      rect.min_x = 160;
192      copyscrollbitmap_trans(bitmap, state->m_bitmap0, 1, &x1, 1, &y, &rect, 0x100);
192      copyscrollbitmap_trans(bitmap, state->m_bitmap0, 1, &x1, 1, &y, rect, 0x100);
193193   }
194194   draw_sprites(screen.machine(), bitmap, cliprect, state->m_sprite_triple_buffer_0, 0, 0x0000);
195195   draw_sprites(screen.machine(), bitmap, cliprect, state->m_sprite_triple_buffer_1, 1, 0x2000);
src/mame/video/zerozone.c
r13798r13799
4242
4343bool zerozone_state::screen_update(screen_device &screen, bitmap_t &bitmap, const rectangle &cliprect)
4444{
45   tilemap_draw(&bitmap, &cliprect, m_zz_tilemap, 0, 0);
45   tilemap_draw(&bitmap, cliprect, m_zz_tilemap, 0, 0);
4646   return 0;
4747}
src/mame/video/espial.c
r13798r13799
166166 *
167167 *************************************/
168168
169static void draw_sprites( running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect )
169static void draw_sprites( running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect )
170170{
171171   espial_state *state = machine.driver_data<espial_state>();
172172   int offs;
src/mame/video/hyperspt.c
r13798r13799
130130   tilemap_set_scroll_rows(state->m_bg_tilemap, 32);
131131}
132132
133static void draw_sprites( running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect )
133static void draw_sprites( running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect )
134134{
135135   hyperspt_state *state = machine.driver_data<hyperspt_state>();
136136   UINT8 *spriteram = state->m_spriteram;
src/mame/video/tiamc1.c
r13798r13799
165165   gfx_element_set_source(machine.gfx[0], state->m_charram);
166166}
167167
168static void draw_sprites(running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect)
168static void draw_sprites(running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect)
169169{
170170   tiamc1_state *state = machine.driver_data<tiamc1_state>();
171171   int offs;
src/mame/video/toaplan1.c
r13798r13799
959959***************************************************************************/
960960
961961// custom function to draw a single sprite. needed to keep correct sprites - sprites and sprites - tilemaps priorities
962static void toaplan1_draw_sprite_custom(bitmap_t *dest_bmp,const rectangle *clip,const gfx_element *gfx,
962static void toaplan1_draw_sprite_custom(bitmap_t *dest_bmp,const rectangle &clip,const gfx_element *gfx,
963963      UINT32 code,UINT32 color,int flipx,int flipy,int sx,int sy,
964964      int priority)
965965{
r13798r13799
10011001         y_index = 0;
10021002      }
10031003
1004      if( clip )
1005      {
1006         if( sx < clip->min_x)
1007         { /* clip left */
1008            int pixels = clip->min_x-sx;
1009            sx += pixels;
1010            x_index_base += pixels*dx;
1011         }
1012         if( sy < clip->min_y )
1013         { /* clip top */
1014            int pixels = clip->min_y-sy;
1015            sy += pixels;
1016            y_index += pixels*dy;
1017         }
1018         /* NS 980211 - fixed incorrect clipping */
1019         if( ex > clip->max_x+1 )
1020         { /* clip right */
1021            int pixels = ex-clip->max_x-1;
1022            ex -= pixels;
1023         }
1024         if( ey > clip->max_y+1 )
1025         { /* clip bottom */
1026            int pixels = ey-clip->max_y-1;
1027            ey -= pixels;
1028         }
1004      if( sx < clip.min_x)
1005      { /* clip left */
1006         int pixels = clip.min_x-sx;
1007         sx += pixels;
1008         x_index_base += pixels*dx;
10291009      }
1010      if( sy < clip.min_y )
1011      { /* clip top */
1012         int pixels = clip.min_y-sy;
1013         sy += pixels;
1014         y_index += pixels*dy;
1015      }
1016      /* NS 980211 - fixed incorrect clipping */
1017      if( ex > clip.max_x+1 )
1018      { /* clip right */
1019         int pixels = ex-clip.max_x-1;
1020         ex -= pixels;
1021      }
1022      if( ey > clip.max_y+1 )
1023      { /* clip bottom */
1024         int pixels = ey-clip.max_y-1;
1025         ey -= pixels;
1026      }
10301027
10311028      if( ex>sx )
10321029      { /* skip if inner loop doesn't draw anything */
r13798r13799
10581055}
10591056
10601057
1061static void draw_sprites(running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect )
1058static void draw_sprites(running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect )
10621059{
10631060   toaplan1_state *state = machine.driver_data<toaplan1_state>();
10641061   UINT16 *source = (UINT16 *)state->m_buffered_spriteram;
r13798r13799
11261123}
11271124
11281125
1129static void rallybik_draw_sprites(running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect, int priority )
1126static void rallybik_draw_sprites(running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect, int priority )
11301127{
11311128   toaplan1_state *state = machine.driver_data<toaplan1_state>();
11321129   UINT16 *buffered_spriteram16 = state->m_buffered_spriteram;
r13798r13799
11711168
11721169   toaplan1_log_vram(screen.machine());
11731170
1174   bitmap->fill(0x120, *cliprect);
1171   bitmap->fill(0x120, cliprect);
11751172
11761173   tilemap_draw(bitmap, cliprect, state->m_pf1_tilemap, TILEMAP_DRAW_OPAQUE | 0, 0);
11771174   tilemap_draw(bitmap, cliprect, state->m_pf1_tilemap, TILEMAP_DRAW_OPAQUE | 1, 0);
r13798r13799
11951192
11961193   toaplan1_log_vram(screen.machine());
11971194
1198   screen.machine().priority_bitmap->fill(0, *cliprect);
1199   bitmap->fill(0x120, *cliprect);
1195   screen.machine().priority_bitmap->fill(0, cliprect);
1196   bitmap->fill(0x120, cliprect);
12001197
12011198// it's really correct?
12021199   tilemap_draw(bitmap, cliprect, state->m_pf1_tilemap, TILEMAP_DRAW_OPAQUE | 0, 0);
src/mame/video/segag80r.c
r13798r13799
640640 *
641641 *************************************/
642642
643static void draw_videoram(running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect, const UINT8 *transparent_pens)
643static void draw_videoram(running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect, const UINT8 *transparent_pens)
644644{
645645   segag80r_state *state = machine.driver_data<segag80r_state>();
646646   UINT8 *videoram = state->m_videoram;
r13798r13799
648648   int x, y;
649649
650650   /* iterate over the screen and draw visible tiles */
651   for (y = cliprect->min_y / 8; y <= cliprect->max_y / 8; y++)
651   for (y = cliprect.min_y / 8; y <= cliprect.max_y / 8; y++)
652652   {
653653      int effy = state->m_video_flip ? 27 - y : y;
654      for (x = cliprect->min_x / 8; x <= cliprect->max_x / 8; x++)
654      for (x = cliprect.min_x / 8; x <= cliprect.max_x / 8; x++)
655655      {
656656         int offs = effy * 32 + (x ^ flipmask);
657657         UINT8 tile = videoram[offs];
r13798r13799
670670 *
671671 *************************************/
672672
673static void draw_background_spaceod(running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect)
673static void draw_background_spaceod(running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect)
674674{
675675   segag80r_state *state = machine.driver_data<segag80r_state>();
676676   bitmap_t *pixmap = tilemap_get_pixmap(!(state->m_spaceod_bg_control & 0x02) ? state->m_spaceod_bg_htilemap : state->m_spaceod_bg_vtilemap);
r13798r13799
687687   /* 240, giving us an offset of (262-240) = 22 scanlines. */
688688
689689   /* now fill in the background wherever there are black pixels */
690   for (y = cliprect->min_y; y <= cliprect->max_y; y++)
690   for (y = cliprect.min_y; y <= cliprect.max_y; y++)
691691   {
692692      int effy = (y + state->m_spaceod_vcounter + 22) ^ flipmask;
693693      UINT16 *src = &pixmap->pix16(effy & ymask);
694694      UINT16 *dst = &bitmap->pix16(y);
695695
696696      /* loop over horizontal pixels */
697      for (x = cliprect->min_x; x <= cliprect->max_x; x++)
697      for (x = cliprect.min_x; x <= cliprect.max_x; x++)
698698      {
699699         int effx = ((x + state->m_spaceod_hcounter) ^ flipmask) + xoffset;
700700         UINT8 fgpix = machine.generic.paletteram.u8[dst[x]];
r13798r13799
728728 *
729729 *************************************/
730730
731static void draw_background_page_scroll(running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect)
731static void draw_background_page_scroll(running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect)
732732{
733733   segag80r_state *state = machine.driver_data<segag80r_state>();
734734   bitmap_t *pixmap = tilemap_get_pixmap(state->m_bg_tilemap);
r13798r13799
740740   /* if disabled, draw nothing */
741741   if (!state->m_bg_enable)
742742   {
743      bitmap->fill(0, *cliprect);
743      bitmap->fill(0, cliprect);
744744      return;
745745   }
746746
747747   /* now fill in the background wherever there are black pixels */
748   for (y = cliprect->min_y; y <= cliprect->max_y; y++)
748   for (y = cliprect.min_y; y <= cliprect.max_y; y++)
749749   {
750750      int effy = state->m_bg_scrolly + (((y ^ flipmask) + (flipmask & 0xe0)) & 0xff);
751751      UINT16 *src = &pixmap->pix16(effy & ymask);
752752      UINT16 *dst = &bitmap->pix16(y);
753753
754754      /* loop over horizontal pixels */
755      for (x = cliprect->min_x; x <= cliprect->max_x; x++)
755      for (x = cliprect.min_x; x <= cliprect.max_x; x++)
756756      {
757757         int effx = state->m_bg_scrollx + (x ^ flipmask);
758758         dst[x] = src[effx & xmask];
r13798r13799
769769 *
770770 *************************************/
771771
772static void draw_background_full_scroll(running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect)
772static void draw_background_full_scroll(running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect)
773773{
774774   segag80r_state *state = machine.driver_data<segag80r_state>();
775775   bitmap_t *pixmap = tilemap_get_pixmap(state->m_bg_tilemap);
r13798r13799
781781   /* if disabled, draw nothing */
782782   if (!state->m_bg_enable)
783783   {
784      bitmap->fill(0, *cliprect);
784      bitmap->fill(0, cliprect);
785785      return;
786786   }
787787
788788   /* now fill in the background wherever there are black pixels */
789   for (y = cliprect->min_y; y <= cliprect->max_y; y++)
789   for (y = cliprect.min_y; y <= cliprect.max_y; y++)
790790   {
791791      int effy = (y + state->m_bg_scrolly) ^ flipmask;
792792      UINT16 *src = &pixmap->pix16(effy & ymask);
793793      UINT16 *dst = &bitmap->pix16(y);
794794
795795      /* loop over horizontal pixels */
796      for (x = cliprect->min_x; x <= cliprect->max_x; x++)
796      for (x = cliprect.min_x; x <= cliprect.max_x; x++)
797797      {
798798         int effx = (x + state->m_bg_scrollx) ^ flipmask;
799799         dst[x] = src[effx & xmask];
src/mame/video/hnayayoi.c
r13798r13799
227227}
228228
229229
230static void draw_layer_interleaved( running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect, int left_pixmap, int right_pixmap, int palbase, int transp )
230static void draw_layer_interleaved( running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect, int left_pixmap, int right_pixmap, int palbase, int transp )
231231{
232232   hnayayoi_state *state = machine.driver_data<hnayayoi_state>();
233233   int county, countx, pen;
src/mame/video/tmnt.c
r13798r13799
627627
628628   konami_sortlayers3(state->m_sorted_layer, state->m_layerpri);
629629
630   screen.machine().priority_bitmap->fill(0, *cliprect);
630   screen.machine().priority_bitmap->fill(0, cliprect);
631631   k052109_tilemap_draw(state->m_k052109, bitmap, cliprect, state->m_sorted_layer[0], TILEMAP_DRAW_OPAQUE, 1);
632632   k052109_tilemap_draw(state->m_k052109, bitmap, cliprect, state->m_sorted_layer[1], 0, 2);
633633   k052109_tilemap_draw(state->m_k052109, bitmap, cliprect, state->m_sorted_layer[2], 0, 4);
r13798r13799
659659
660660   konami_sortlayers3(state->m_sorted_layer, state->m_layerpri);
661661
662   screen.machine().priority_bitmap->fill(0, *cliprect);
663   bitmap->fill(16 * bg_colorbase, *cliprect);
662   screen.machine().priority_bitmap->fill(0, cliprect);
663   bitmap->fill(16 * bg_colorbase, cliprect);
664664   k052109_tilemap_draw(state->m_k052109, bitmap, cliprect, state->m_sorted_layer[0], 0, 1);
665665   k052109_tilemap_draw(state->m_k052109, bitmap, cliprect, state->m_sorted_layer[1], 0, 2);
666666   k052109_tilemap_draw(state->m_k052109, bitmap, cliprect, state->m_sorted_layer[2], 0, 4);
r13798r13799
708708
709709   /* not sure about the 053936 priority, but it seems to work */
710710
711   screen.machine().priority_bitmap->fill(0, *cliprect);
712   bitmap->fill(16 * bg_colorbase, *cliprect);
711   screen.machine().priority_bitmap->fill(0, cliprect);
712   bitmap->fill(16 * bg_colorbase, cliprect);
713713   k052109_tilemap_draw(state->m_k052109, bitmap, cliprect, state->m_sorted_layer[0], 0, 1);
714714
715715   if (state->m_layerpri[0] >= 0x30 && state->m_layerpri[1] < 0x30)
r13798r13799
813813
814814   konami_sortlayers3(state->m_sorted_layer, state->m_layerpri);
815815
816   screen.machine().priority_bitmap->fill(0, *cliprect);
817   bitmap->fill(16 * bg_colorbase, *cliprect);
816   screen.machine().priority_bitmap->fill(0, cliprect);
817   bitmap->fill(16 * bg_colorbase, cliprect);
818818   k052109_tilemap_draw(state->m_k052109, bitmap, cliprect, state->m_sorted_layer[0], 0, 1);
819819   k052109_tilemap_draw(state->m_k052109, bitmap, cliprect, state->m_sorted_layer[1], 0, 2);
820820   k052109_tilemap_draw(state->m_k052109, bitmap, cliprect, state->m_sorted_layer[2], 0, 4);
src/mame/video/zodiack.c
r13798r13799
130130   flip_screen_set_no_update(machine(), 0);
131131}
132132
133void zodiack_state::draw_bullets( bitmap_t *bitmap, const rectangle *cliprect )
133void zodiack_state::draw_bullets( bitmap_t *bitmap, const rectangle &cliprect )
134134{
135135   for (int offs = 0; offs < m_bulletsram_size; offs += 4)
136136   {
r13798r13799
154154   }
155155}
156156
157void zodiack_state::draw_sprites( bitmap_t *bitmap, const rectangle *cliprect )
157void zodiack_state::draw_sprites( bitmap_t *bitmap, const rectangle &cliprect )
158158{
159159   for (int offs = m_spriteram_size - 4; offs >= 0; offs -= 4)
160160   {
r13798r13799
186186   for (int i = 0; i < 32; i++)
187187      tilemap_set_scrolly(m_fg_tilemap, i, m_attributeram[i * 2]);
188188
189   tilemap_draw(&bitmap, &cliprect, m_bg_tilemap, 0, 0);
190   tilemap_draw(&bitmap, &cliprect, m_fg_tilemap, 0, 0);
191   draw_bullets(&bitmap, &cliprect);
192   draw_sprites(&bitmap, &cliprect);
189   tilemap_draw(&bitmap, cliprect, m_bg_tilemap, 0, 0);
190   tilemap_draw(&bitmap, cliprect, m_fg_tilemap, 0, 0);
191   draw_bullets(&bitmap, cliprect);
192   draw_sprites(&bitmap, cliprect);
193193   return 0;
194194}
src/mame/video/dc.c
r13798r13799
132132// the real accumulation buffer is a 32x32x8bpp buffer into which tiles get rendered before they get copied to the framebuffer
133133//  our implementation is not currently tile based, and thus the accumulation buffer is screen sized
134134static bitmap_t *fake_accumulationbuffer_bitmap;
135static void render_to_accumulation_buffer(running_machine &machine,bitmap_t *bitmap,const rectangle *cliprect);
135static void render_to_accumulation_buffer(running_machine &machine,bitmap_t *bitmap,const rectangle &cliprect);
136136
137137typedef struct texinfo {
138138   UINT32 address, vqbase;
r13798r13799
11021102
11031103            // we've got a request to draw, so, draw to the accumulation buffer!
11041104            // this should really be done for each tile!
1105            render_to_accumulation_buffer(space->machine(),fake_accumulationbuffer_bitmap,&clip);
1105            render_to_accumulation_buffer(space->machine(),fake_accumulationbuffer_bitmap,clip);
11061106
11071107            state->endofrender_timer_isp->adjust(attotime::from_usec(4000) ); // hack, make sure render takes some amount of time
11081108
r13798r13799
19751975   render_tri_sorted(machine, bitmap, ti, v+i0, v+i1, v+i2);
19761976}
19771977
1978static void render_to_accumulation_buffer(running_machine &machine,bitmap_t *bitmap,const rectangle *cliprect)
1978static void render_to_accumulation_buffer(running_machine &machine,bitmap_t *bitmap,const rectangle &cliprect)
19791979{
19801980   dc_state *state = machine.driver_data<dc_state>();
19811981   address_space *space = machine.device("maincpu")->memory().space(AS_PROGRAM);
r13798r13799
19961996   rs=state_ta.renderselect;
19971997   c=state->pvrta_regs[ISP_BACKGND_T];
19981998   c=space->read_dword(0x05000000+((c&0xfffff8)>>1)+(3+3)*4);
1999   bitmap->fill(c, *cliprect);
1999   bitmap->fill(c, cliprect);
20002000
20012001
20022002   ns=state_ta.grab[rs].strips_size;
r13798r13799
22042204}
22052205
22062206
2207static void pvr_drawframebuffer(running_machine &machine,bitmap_t *bitmap,const rectangle *cliprect)
2207static void pvr_drawframebuffer(running_machine &machine,bitmap_t *bitmap,const rectangle &cliprect)
22082208{
22092209   dc_state *state = machine.driver_data<dc_state>();
22102210
r13798r13799
22462246                  g = (c & 0x03e0) >> 2;
22472247                  r = (c & 0x7c00) >> 7;
22482248
2249                  if (y<=cliprect->max_y)
2249                  if (y<=cliprect.max_y)
22502250                     *fbaddr = b | (g<<8) | (r<<16);
22512251
22522252                  fbaddr=&bitmap->pix32(y, x*2+1);
2253                  if (y<=cliprect->max_y)
2253                  if (y<=cliprect.max_y)
22542254                     *fbaddr = b | (g<<8) | (r<<16);
22552255                  addrp+=2;
22562256               }
r13798r13799
22662266                  g = (c & 0x03e0) >> 2;
22672267                  r = (c & 0x7c00) >> 7;
22682268
2269                  if (y<=cliprect->max_y)
2269                  if (y<=cliprect.max_y)
22702270                     *fbaddr = b | (g<<8) | (r<<16);
22712271                  addrp+=2;
22722272               }
r13798r13799
22902290                  g = (c & 0x07e0) >> 3;
22912291                  r = (c & 0xf800) >> 8;
22922292
2293                  if (y<=cliprect->max_y)
2293                  if (y<=cliprect.max_y)
22942294                     *fbaddr = b | (g<<8) | (r<<16);
22952295
22962296                  fbaddr=&bitmap->pix32(y, x*2+1);
22972297
2298                  if (y<=cliprect->max_y)
2298                  if (y<=cliprect.max_y)
22992299                     *fbaddr = b | (g<<8) | (r<<16);
23002300
23012301                  addrp+=2;
r13798r13799
23122312                  g = (c & 0x07e0) >> 3;
23132313                  r = (c & 0xf800) >> 8;
23142314
2315                  if (y<=cliprect->max_y)
2315                  if (y<=cliprect.max_y)
23162316                     *fbaddr = b | (g<<8) | (r<<16);
23172317                  addrp+=2;
23182318               }
r13798r13799
23352335                  g = (c & 0x07e0) >> 3;
23362336                  r = (c & 0xf800) >> 8;
23372337
2338                  if (y<=cliprect->max_y)
2338                  if (y<=cliprect.max_y)
23392339                     *fbaddr = b | (g<<8) | (r<<16);
23402340
23412341                  fbaddr=&bitmap->pix32(y, x*2+1);
23422342
2343                  if (y<=cliprect->max_y)
2343                  if (y<=cliprect.max_y)
23442344                     *fbaddr = b | (g<<8) | (r<<16);
23452345                  addrp+=2;
23462346               }
r13798r13799
23562356                  g = (c & 0x07e0) >> 3;
23572357                  r = (c & 0xf800) >> 8;
23582358
2359                  if (y<=cliprect->max_y)
2359                  if (y<=cliprect.max_y)
23602360                     *fbaddr = b | (g<<8) | (r<<16);
23612361                  addrp+=2;
23622362               }
r13798r13799
23792379                  g = (c & 0x07e0) >> 3;
23802380                  r = (c & 0xf800) >> 8;
23812381
2382                  if (y<=cliprect->max_y)
2382                  if (y<=cliprect.max_y)
23832383                     *fbaddr = b | (g<<8) | (r<<16);
23842384
23852385                  fbaddr=&bitmap->pix32(y, x*2+1);
2386                  if (y<=cliprect->max_y)
2386                  if (y<=cliprect.max_y)
23872387                     *fbaddr = b | (g<<8) | (r<<16);
23882388
23892389                  addrp+=2;
r13798r13799
24002400                  g = (c & 0x07e0) >> 3;
24012401                  r = (c & 0xf800) >> 8;
24022402
2403                  if (y<=cliprect->max_y)
2403                  if (y<=cliprect.max_y)
24042404                     *fbaddr = b | (g<<8) | (r<<16);
24052405                  addrp+=2;
24062406               }
r13798r13799
26792679   }
26802680#endif
26812681
2682   bitmap->fill(MAKE_ARGB(0xff,vo_border_R,vo_border_G,vo_border_B), *cliprect); //FIXME: Chroma bit?
2682   bitmap->fill(MAKE_ARGB(0xff,vo_border_R,vo_border_G,vo_border_B), cliprect); //FIXME: Chroma bit?
26832683
26842684   if(!spg_blank_video)
26852685      pvr_drawframebuffer(screen.machine(),bitmap,cliprect);
src/mame/video/taxidriv.c
r13798r13799
1919
2020   if (state->m_bghide)
2121   {
22      bitmap->fill(0, *cliprect);
22      bitmap->fill(0, cliprect);
2323
2424
2525      /* kludge to fix scroll after death */
src/mame/video/taitojc.c
r13798r13799
9797
9898*/
9999
100static void draw_object(running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect, UINT32 w1, UINT32 w2, UINT8 bank_type)
100static void draw_object(running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect, UINT32 w1, UINT32 w2, UINT8 bank_type)
101101{
102102   taitojc_state *state = machine.driver_data<taitojc_state>();
103103   int x, y, width, height, palette;
r13798r13799
151151   y2 = y + height;
152152
153153   // trivial rejection
154   if (x1 > cliprect->max_x || x2 < cliprect->min_x || y1 > cliprect->max_y || y2 < cliprect->min_y)
154   if (x1 > cliprect.max_x || x2 < cliprect.min_x || y1 > cliprect.max_y || y2 < cliprect.min_y)
155155   {
156156      return;
157157   }
r13798r13799
162162   iy = 0;
163163
164164   // clip
165   if (x1 < cliprect->min_x)
165   if (x1 < cliprect.min_x)
166166   {
167      ix = abs(cliprect->min_x - x1);
168      x1 = cliprect->min_x;
167      ix = abs(cliprect.min_x - x1);
168      x1 = cliprect.min_x;
169169   }
170   if (x2 > cliprect->max_x)
170   if (x2 > cliprect.max_x)
171171   {
172      x2 = cliprect->max_x;
172      x2 = cliprect.max_x;
173173   }
174   if (y1 < cliprect->min_y)
174   if (y1 < cliprect.min_y)
175175   {
176      iy = abs(cliprect->min_y - y1);
177      y1 = cliprect->min_y;
176      iy = abs(cliprect.min_y - y1);
177      y1 = cliprect.min_y;
178178   }
179   if (y2 > cliprect->max_y)
179   if (y2 > cliprect.max_y)
180180   {
181      y2 = cliprect->max_y;
181      y2 = cliprect.max_y;
182182   }
183183
184184   /* this bit seems to set up border at left/right of screen (reads at 0xffc00) */
r13798r13799
292292   state->m_zbuffer = auto_bitmap_alloc(machine, width, height, BITMAP_FORMAT_INDEXED16);
293293}
294294
295static void draw_object_bank(running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect, UINT8 bank_type, UINT8 pri)
295static void draw_object_bank(running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect, UINT8 bank_type, UINT8 pri)
296296{
297297   taitojc_state *state = machine.driver_data<taitojc_state>();
298298   UINT16 start_offs;
r13798r13799
338338    }
339339#endif
340340
341   bitmap->fill(0, *cliprect);
341   bitmap->fill(0, cliprect);
342342
343343   /* 0xf000 used on Densha de Go disclaimer screen(s) (disable object RAM?) */
344344   if((state->m_objlist[0xfc4/4] & 0x0000ffff) != 0x0000 && (state->m_objlist[0xfc4/4] & 0x0000ffff) != 0x2000  && (state->m_objlist[0xfc4/4] & 0x0000ffff) != 0xf000 )
r13798r13799
362362    if (debug_tex_pal > 0)
363363    {
364364        int j;
365        for (j=cliprect->min_y; j <= cliprect->max_y; j++)
365        for (j=cliprect.min_y; j <= cliprect.max_y; j++)
366366        {
367367            UINT16 *d = &bitmap->pix16(j);
368368            int index = 2048 * j;
369369
370            for (i=cliprect->min_x; i <= cliprect->max_x; i++)
370            for (i=cliprect.min_x; i <= cliprect.max_x; i++)
371371            {
372372                UINT8 t = state->m_texture[index+i];
373373                UINT32 color;
r13798r13799
593593
594594            if (vert[0].p[0] < 0x8000 && vert[1].p[0] < 0x8000 && vert[2].p[0] < 0x8000)
595595            {
596               poly_render_triangle(state->m_poly, state->m_framebuffer, &machine.primary_screen->visible_area(), render_texture_scan, 4, &vert[0], &vert[1], &vert[2]);
596               poly_render_triangle(state->m_poly, state->m_framebuffer, machine.primary_screen->visible_area(), render_texture_scan, 4, &vert[0], &vert[1], &vert[2]);
597597            }
598598            break;
599599         }
r13798r13799
644644                  vert[2].p[1] == vert[3].p[1])
645645               {
646646                  // optimization: all colours the same -> render solid
647                  poly_render_quad(state->m_poly, state->m_framebuffer, &machine.primary_screen->visible_area(), render_solid_scan, 2, &vert[0], &vert[1], &vert[2], &vert[3]);
647                  poly_render_quad(state->m_poly, state->m_framebuffer, machine.primary_screen->visible_area(), render_solid_scan, 2, &vert[0], &vert[1], &vert[2], &vert[3]);
648648               }
649649               else
650650               {
651                  poly_render_quad(state->m_poly, state->m_framebuffer, &machine.primary_screen->visible_area(), render_shade_scan, 2, &vert[0], &vert[1], &vert[2], &vert[3]);
651                  poly_render_quad(state->m_poly, state->m_framebuffer, machine.primary_screen->visible_area(), render_shade_scan, 2, &vert[0], &vert[1], &vert[2], &vert[3]);
652652               }
653653            }
654654            break;
r13798r13799
716716
717717            if (vert[0].p[0] < 0x8000 && vert[1].p[0] < 0x8000 && vert[2].p[0] < 0x8000 && vert[3].p[0] < 0x8000)
718718            {
719               poly_render_quad(state->m_poly, state->m_framebuffer, &machine.primary_screen->visible_area(), render_texture_scan, 4, &vert[0], &vert[1], &vert[2], &vert[3]);
719               poly_render_quad(state->m_poly, state->m_framebuffer, machine.primary_screen->visible_area(), render_texture_scan, 4, &vert[0], &vert[1], &vert[2], &vert[3]);
720720            }
721721            break;
722722         }
r13798r13799
765765                  vert[1].p[1] == vert[2].p[1])
766766               {
767767                  // optimization: all colours the same -> render solid
768                  poly_render_triangle(state->m_poly, state->m_framebuffer, &machine.primary_screen->visible_area(), render_solid_scan, 2, &vert[0], &vert[1], &vert[2]);
768                  poly_render_triangle(state->m_poly, state->m_framebuffer, machine.primary_screen->visible_area(), render_solid_scan, 2, &vert[0], &vert[1], &vert[2]);
769769               }
770770               else
771771               {
772                  poly_render_triangle(state->m_poly, state->m_framebuffer, &machine.primary_screen->visible_area(), render_shade_scan, 2, &vert[0], &vert[1], &vert[2]);
772                  poly_render_triangle(state->m_poly, state->m_framebuffer, machine.primary_screen->visible_area(), render_shade_scan, 2, &vert[0], &vert[1], &vert[2]);
773773               }
774774            }
775775            break;
src/mame/video/pitnrun.c
r13798r13799
182182   pitnrun_spotlights(machine);
183183}
184184
185static void draw_sprites(running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect )
185static void draw_sprites(running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect )
186186{
187187   pitnrun_state *state = machine.driver_data<pitnrun_state>();
188188   UINT8 *spriteram = state->m_spriteram;
r13798r13799
221221{
222222   pitnrun_state *state = screen.machine().driver_data<pitnrun_state>();
223223   int dx=0,dy=0;
224   rectangle myclip=*cliprect;
224   rectangle myclip=cliprect;
225225
226226#ifdef MAME_DEBUG
227227   if (screen.machine().input().code_pressed_once(KEYCODE_Q))
r13798r13799
244244   }
245245#endif
246246
247   bitmap->fill(0, *cliprect);
247   bitmap->fill(0, cliprect);
248248
249249   if(!(state->m_ha&4))
250250      tilemap_draw(bitmap,cliprect,state->m_bg, 0,0);
r13798r13799
265265      myclip.max_y=dy+127;
266266
267267
268      if(myclip.min_y<cliprect->min_y)myclip.min_y=cliprect->min_y;
269      if(myclip.min_x<cliprect->min_x)myclip.min_x=cliprect->min_x;
268      if(myclip.min_y<cliprect.min_y)myclip.min_y=cliprect.min_y;
269      if(myclip.min_x<cliprect.min_x)myclip.min_x=cliprect.min_x;
270270
271      if(myclip.max_y>cliprect->max_y)myclip.max_y=cliprect->max_y;
272      if(myclip.max_x>cliprect->max_x)myclip.max_x=cliprect->max_x;
271      if(myclip.max_y>cliprect.max_y)myclip.max_y=cliprect.max_y;
272      if(myclip.max_x>cliprect.max_x)myclip.max_x=cliprect.max_x;
273273
274      tilemap_draw(bitmap,&myclip,state->m_bg, 0,0);
274      tilemap_draw(bitmap,myclip,state->m_bg, 0,0);
275275   }
276276
277   draw_sprites(screen.machine(),bitmap,&myclip);
277   draw_sprites(screen.machine(),bitmap,myclip);
278278
279279   if(state->m_ha&4)
280      copybitmap_trans(bitmap,state->m_tmp_bitmap[state->m_ha&3],flip_screen_x_get(screen.machine()),flip_screen_y_get(screen.machine()),dx,dy,&myclip, 1);
280      copybitmap_trans(bitmap,state->m_tmp_bitmap[state->m_ha&3],flip_screen_x_get(screen.machine()),flip_screen_y_get(screen.machine()),dx,dy,myclip, 1);
281281   tilemap_draw(bitmap,cliprect,state->m_fg, 0,0);
282282   return 0;
283283}
src/mame/video/midzeus2.c
r13798r13799
372372   {
373373      const void *base = waveram1_ptr_from_expanded_addr(zeusbase[0x38]);
374374      int xoffs = screen.visible_area().min_x;
375      for (y = cliprect->min_y; y <= cliprect->max_y; y++)
375      for (y = cliprect.min_y; y <= cliprect.max_y; y++)
376376      {
377377         UINT32 *dest = &bitmap->pix32(y);
378         for (x = cliprect->min_x; x <= cliprect->max_x; x++)
378         for (x = cliprect.min_x; x <= cliprect.max_x; x++)
379379            dest[x] = WAVERAM_READPIX(base, y, x - xoffs);
380380      }
381381   }
r13798r13799
393393      if (yoffs < 0) yoffs = 0;
394394      base = (const UINT64 *)waveram0_ptr_from_expanded_addr(yoffs << 16);
395395
396      for (y = cliprect->min_y; y <= cliprect->max_y; y++)
396      for (y = cliprect.min_y; y <= cliprect.max_y; y++)
397397      {
398398         UINT32 *dest = &bitmap->pix32(y);
399         for (x = cliprect->min_x; x <= cliprect->max_x; x++)
399         for (x = cliprect.min_x; x <= cliprect.max_x; x++)
400400         {
401401            UINT8 tex = get_texel_8bit(base, y, x, texel_width);
402402            dest[x] = (tex << 16) | (tex << 8) | tex;
r13798r13799
12601260   extra->texbase = WAVERAM_BLOCK0(zeus_texbase);
12611261   extra->palbase = waveram0_ptr_from_expanded_addr(zeusbase[0x41]);
12621262
1263   poly_render_quad_fan(poly, NULL, &zeus_cliprect, callback, 4, numverts, &clipvert[0]);
1263   poly_render_quad_fan(poly, NULL, zeus_cliprect, callback, 4, numverts, &clipvert[0]);
12641264}
12651265
12661266
src/mame/video/segaic16.c
r13798r13799
518518 *
519519 *************************************/
520520
521static void segaic16_draw_virtual_tilemap(running_machine &machine, struct tilemap_info *info, bitmap_t *bitmap, const rectangle *cliprect, UINT16 pages, UINT16 xscroll, UINT16 yscroll, UINT32 flags, UINT32 priority)
521static void segaic16_draw_virtual_tilemap(running_machine &machine, struct tilemap_info *info, bitmap_t *bitmap, const rectangle &cliprect, UINT16 pages, UINT16 xscroll, UINT16 yscroll, UINT32 flags, UINT32 priority)
522522{
523523   int leftmin = -1, leftmax = -1, rightmin = -1, rightmax = -1;
524524   int topmin = -1, topmax = -1, bottommin = -1, bottommax = -1;
r13798r13799
616616   /* draw the upper-left chunk */
617617   if (leftmin != -1 && topmin != -1)
618618   {
619      pageclip.min_x = (leftmin < cliprect->min_x) ? cliprect->min_x : leftmin;
620      pageclip.max_x = (leftmax > cliprect->max_x) ? cliprect->max_x : leftmax;
621      pageclip.min_y = (topmin < cliprect->min_y) ? cliprect->min_y : topmin;
622      pageclip.max_y = (topmax > cliprect->max_y) ? cliprect->max_y : topmax;
619      pageclip.min_x = (leftmin < cliprect.min_x) ? cliprect.min_x : leftmin;
620      pageclip.max_x = (leftmax > cliprect.max_x) ? cliprect.max_x : leftmax;
621      pageclip.min_y = (topmin < cliprect.min_y) ? cliprect.min_y : topmin;
622      pageclip.max_y = (topmax > cliprect.max_y) ? cliprect.max_y : topmax;
623623      if (pageclip.min_x <= pageclip.max_x && pageclip.min_y <= pageclip.max_y)
624624      {
625625         page = (pages >> 0) & 0xf;
626626         tilemap_set_scrollx(info->tilemaps[page], 0, xscroll);
627627         tilemap_set_scrolly(info->tilemaps[page], 0, yscroll);
628         tilemap_draw(bitmap, &pageclip, info->tilemaps[page], flags, priority);
628         tilemap_draw(bitmap, pageclip, info->tilemaps[page], flags, priority);
629629      }
630630   }
631631
632632   /* draw the upper-right chunk */
633633   if (rightmin != -1 && topmin != -1)
634634   {
635      pageclip.min_x = (rightmin < cliprect->min_x) ? cliprect->min_x : rightmin;
636      pageclip.max_x = (rightmax > cliprect->max_x) ? cliprect->max_x : rightmax;
637      pageclip.min_y = (topmin < cliprect->min_y) ? cliprect->min_y : topmin;
638      pageclip.max_y = (topmax > cliprect->max_y) ? cliprect->max_y : topmax;
635      pageclip.min_x = (rightmin < cliprect.min_x) ? cliprect.min_x : rightmin;
636      pageclip.max_x = (rightmax > cliprect.max_x) ? cliprect.max_x : rightmax;
637      pageclip.min_y = (topmin < cliprect.min_y) ? cliprect.min_y : topmin;
638      pageclip.max_y = (topmax > cliprect.max_y) ? cliprect.max_y : topmax;
639639      if (pageclip.min_x <= pageclip.max_x && pageclip.min_y <= pageclip.max_y)
640640      {
641641         page = (pages >> 4) & 0xf;
642642         tilemap_set_scrollx(info->tilemaps[page], 0, xscroll);
643643         tilemap_set_scrolly(info->tilemaps[page], 0, yscroll);
644         tilemap_draw(bitmap, &pageclip, info->tilemaps[page], flags, priority);
644         tilemap_draw(bitmap, pageclip, info->tilemaps[page], flags, priority);
645645      }
646646   }
647647
648648   /* draw the lower-left chunk */
649649   if (leftmin != -1 && bottommin != -1)
650650   {
651      pageclip.min_x = (leftmin < cliprect->min_x) ? cliprect->min_x : leftmin;
652      pageclip.max_x = (leftmax > cliprect->max_x) ? cliprect->max_x : leftmax;
653      pageclip.min_y = (bottommin < cliprect->min_y) ? cliprect->min_y : bottommin;
654      pageclip.max_y = (bottommax > cliprect->max_y) ? cliprect->max_y : bottommax;
651      pageclip.min_x = (leftmin < cliprect.min_x) ? cliprect.min_x : leftmin;
652      pageclip.max_x = (leftmax > cliprect.max_x) ? cliprect.max_x : leftmax;
653      pageclip.min_y = (bottommin < cliprect.min_y) ? cliprect.min_y : bottommin;
654      pageclip.max_y = (bottommax > cliprect.max_y) ? cliprect.max_y : bottommax;
655655      if (pageclip.min_x <= pageclip.max_x && pageclip.min_y <= pageclip.max_y)
656656      {
657657         page = (pages >> 8) & 0xf;
658658         tilemap_set_scrollx(info->tilemaps[page], 0, xscroll);
659659         tilemap_set_scrolly(info->tilemaps[page], 0, yscroll);
660         tilemap_draw(bitmap, &pageclip, info->tilemaps[page], flags, priority);
660         tilemap_draw(bitmap, pageclip, info->tilemaps[page], flags, priority);
661661      }
662662   }
663663
664664   /* draw the lower-right chunk */
665665   if (rightmin != -1 && bottommin != -1)
666666   {
667      pageclip.min_x = (rightmin < cliprect->min_x) ? cliprect->min_x : rightmin;
668      pageclip.max_x = (rightmax > cliprect->max_x) ? cliprect->max_x : rightmax;
669      pageclip.min_y = (bottommin < cliprect->min_y) ? cliprect->min_y : bottommin;
670      pageclip.max_y = (bottommax > cliprect->max_y) ? cliprect->max_y : bottommax;
667      pageclip.min_x = (rightmin < cliprect.min_x) ? cliprect.min_x : rightmin;
668      pageclip.max_x = (rightmax > cliprect.max_x) ? cliprect.max_x : rightmax;
669      pageclip.min_y = (bottommin < cliprect.min_y) ? cliprect.min_y : bottommin;
670      pageclip.max_y = (bottommax > cliprect.max_y) ? cliprect.max_y : bottommax;
671671      if (pageclip.min_x <= pageclip.max_x && pageclip.min_y <= pageclip.max_y)
672672      {
673673         page = (pages >> 12) & 0xf;
674674         tilemap_set_scrollx(info->tilemaps[page], 0, xscroll);
675675         tilemap_set_scrolly(info->tilemaps[page], 0, yscroll);
676         tilemap_draw(bitmap, &pageclip, info->tilemaps[page], flags, priority);
676         tilemap_draw(bitmap, pageclip, info->tilemaps[page], flags, priority);
677677      }
678678   }
679679}
r13798r13799
744744}
745745
746746
747static void segaic16_tilemap_16a_draw_layer(running_machine &machine, struct tilemap_info *info, bitmap_t *bitmap, const rectangle *cliprect, int which, int flags, int priority)
747static void segaic16_tilemap_16a_draw_layer(running_machine &machine, struct tilemap_info *info, bitmap_t *bitmap, const rectangle &cliprect, int which, int flags, int priority)
748748{
749749   UINT16 *textram = info->textram;
750750
r13798r13799
766766      if (PRINT_UNUSUAL_MODES) mame_printf_debug("Column AND row scroll\n");
767767
768768      /* loop over row chunks */
769      for (y = cliprect->min_y & ~7; y <= cliprect->max_y; y += 8)
769      for (y = cliprect.min_y & ~7; y <= cliprect.max_y; y += 8)
770770      {
771771         int rowscrollindex = (info->flip ? (216 - y) : y) / 8;
772772         rectangle rowcolclip;
773773
774774         /* adjust to clip this row only */
775         rowcolclip.min_y = (y < cliprect->min_y) ? cliprect->min_y : y;
776         rowcolclip.max_y = (y + 7 > cliprect->max_y) ? cliprect->max_y : y + 7;
775         rowcolclip.min_y = (y < cliprect.min_y) ? cliprect.min_y : y;
776         rowcolclip.max_y = (y + 7 > cliprect.max_y) ? cliprect.max_y : y + 7;
777777
778778         /* loop over column chunks */
779         for (x = cliprect->min_x & ~15; x <= cliprect->max_x; x += 16)
779         for (x = cliprect.min_x & ~15; x <= cliprect.max_x; x += 16)
780780         {
781781            UINT16 effxscroll, effyscroll;
782782
783783            /* adjust to clip this column only */
784            rowcolclip.min_x = (x < cliprect->min_x) ? cliprect->min_x : x;
785            rowcolclip.max_x = (x + 15 > cliprect->max_x) ? cliprect->max_x : x + 15;
784            rowcolclip.min_x = (x < cliprect.min_x) ? cliprect.min_x : x;
785            rowcolclip.max_x = (x + 15 > cliprect.max_x) ? cliprect.max_x : x + 15;
786786
787787            /* get the effective scroll values */
788788            effxscroll = textram[0xf80/2 + rowscrollindex * 2 + which] & 0x1ff;
r13798r13799
795795            /* draw the chunk */
796796            effxscroll = (0xc8 - effxscroll + info->xoffs) & 0x3ff;
797797            effyscroll = effyscroll & 0x1ff;
798            segaic16_draw_virtual_tilemap(machine, info, bitmap, &rowcolclip, pages, effxscroll, effyscroll, flags, priority);
798            segaic16_draw_virtual_tilemap(machine, info, bitmap, rowcolclip, pages, effxscroll, effyscroll, flags, priority);
799799         }
800800      }
801801   }
r13798r13799
804804      if (PRINT_UNUSUAL_MODES) mame_printf_debug("Column scroll\n");
805805
806806      /* loop over column chunks */
807      for (x = cliprect->min_x & ~15; x <= cliprect->max_x; x += 16)
807      for (x = cliprect.min_x & ~15; x <= cliprect.max_x; x += 16)
808808      {
809         rectangle colclip = *cliprect;
809         rectangle colclip = cliprect;
810810         UINT16 effxscroll, effyscroll;
811811
812812         /* adjust to clip this row only */
813         colclip.min_x = (x < cliprect->min_x) ? cliprect->min_x : x;
814         colclip.max_x = (x + 15 > cliprect->max_x) ? cliprect->max_x : x + 15;
813         colclip.min_x = (x < cliprect.min_x) ? cliprect.min_x : x;
814         colclip.max_x = (x + 15 > cliprect.max_x) ? cliprect.max_x : x + 15;
815815
816816         /* get the effective scroll values */
817817         effxscroll = xscroll;
r13798r13799
824824         /* draw the chunk */
825825         effxscroll = (0xc8 - effxscroll + info->xoffs) & 0x3ff;
826826         effyscroll = effyscroll & 0x1ff;
827         segaic16_draw_virtual_tilemap(machine, info, bitmap, &colclip, pages, effxscroll, effyscroll, flags, priority);
827         segaic16_draw_virtual_tilemap(machine, info, bitmap, colclip, pages, effxscroll, effyscroll, flags, priority);
828828      }
829829   }
830830   else if (info->rowscroll)
r13798r13799
832832      if (PRINT_UNUSUAL_MODES) mame_printf_debug("Row scroll\n");
833833
834834      /* loop over row chunks */
835      for (y = cliprect->min_y & ~7; y <= cliprect->max_y; y += 8)
835      for (y = cliprect.min_y & ~7; y <= cliprect.max_y; y += 8)
836836      {
837837         int rowscrollindex = (info->flip ? (216 - y) : y) / 8;
838         rectangle rowclip = *cliprect;
838         rectangle rowclip = cliprect;
839839         UINT16 effxscroll, effyscroll;
840840
841841         /* adjust to clip this row only */
842         rowclip.min_y = (y < cliprect->min_y) ? cliprect->min_y : y;
843         rowclip.max_y = (y + 7 > cliprect->max_y) ? cliprect->max_y : y + 7;
842         rowclip.min_y = (y < cliprect.min_y) ? cliprect.min_y : y;
843         rowclip.max_y = (y + 7 > cliprect.max_y) ? cliprect.max_y : y + 7;
844844
845845         /* get the effective scroll values */
846846         effxscroll = textram[0xf80/2 + rowscrollindex * 2 + which] & 0x1ff;
r13798r13799
853853         /* draw the chunk */
854854         effxscroll = (0xc8 - effxscroll + info->xoffs) & 0x3ff;
855855         effyscroll = effyscroll & 0x1ff;
856         segaic16_draw_virtual_tilemap(machine, info, bitmap, &rowclip, pages, effxscroll, effyscroll, flags, priority);
856         segaic16_draw_virtual_tilemap(machine, info, bitmap, rowclip, pages, effxscroll, effyscroll, flags, priority);
857857      }
858858   }
859859   else
r13798r13799
986986}
987987
988988
989static void segaic16_tilemap_16b_draw_layer(running_machine &machine, struct tilemap_info *info, bitmap_t *bitmap, const rectangle *cliprect, int which, int flags, int priority)
989static void segaic16_tilemap_16b_draw_layer(running_machine &machine, struct tilemap_info *info, bitmap_t *bitmap, const rectangle &cliprect, int which, int flags, int priority)
990990{
991991   UINT16 *textram = info->textram;
992992   UINT16 xscroll, yscroll, pages;
r13798r13799
10031003      if (PRINT_UNUSUAL_MODES) mame_printf_debug("Column AND row scroll\n");
10041004
10051005      /* loop over row chunks */
1006      for (y = cliprect->min_y & ~7; y <= cliprect->max_y; y += 8)
1006      for (y = cliprect.min_y & ~7; y <= cliprect.max_y; y += 8)
10071007      {
10081008         int rowscrollindex = (info->flip ? (216 - y) : y) / 8;
10091009         rectangle rowcolclip;
10101010
10111011         /* adjust to clip this row only */
1012         rowcolclip.min_y = (y < cliprect->min_y) ? cliprect->min_y : y;
1013         rowcolclip.max_y = (y + 7 > cliprect->max_y) ? cliprect->max_y : y + 7;
1012         rowcolclip.min_y = (y < cliprect.min_y) ? cliprect.min_y : y;
1013         rowcolclip.max_y = (y + 7 > cliprect.max_y) ? cliprect.max_y : y + 7;
10141014
10151015         /* loop over column chunks */
1016         for (x = ((cliprect->min_x + 8) & ~15) - 8; x <= cliprect->max_x; x += 16)
1016         for (x = ((cliprect.min_x + 8) & ~15) - 8; x <= cliprect.max_x; x += 16)
10171017         {
10181018            UINT16 effxscroll, effyscroll, rowscroll;
10191019            UINT16 effpages = pages;
10201020
10211021            /* adjust to clip this column only */
1022            rowcolclip.min_x = (x < cliprect->min_x) ? cliprect->min_x : x;
1023            rowcolclip.max_x = (x + 15 > cliprect->max_x) ? cliprect->max_x : x + 15;
1022            rowcolclip.min_x = (x < cliprect.min_x) ? cliprect.min_x : x;
1023            rowcolclip.max_x = (x + 15 > cliprect.max_x) ? cliprect.max_x : x + 15;
10241024
10251025            /* get the effective scroll values */
10261026            rowscroll = textram[0xf80/2 + 0x40/2 * which + rowscrollindex];
r13798r13799
10381038            /* draw the chunk */
10391039            effxscroll = (0xc0 - effxscroll + info->xoffs) & 0x3ff;
10401040            effyscroll = effyscroll & 0x1ff;
1041            segaic16_draw_virtual_tilemap(machine, info, bitmap, &rowcolclip, effpages, effxscroll, effyscroll, flags, priority);
1041            segaic16_draw_virtual_tilemap(machine, info, bitmap, rowcolclip, effpages, effxscroll, effyscroll, flags, priority);
10421042         }
10431043      }
10441044   }
r13798r13799
10471047      if (PRINT_UNUSUAL_MODES) mame_printf_debug("Row scroll\n");
10481048
10491049      /* loop over row chunks */
1050      for (y = cliprect->min_y & ~7; y <= cliprect->max_y; y += 8)
1050      for (y = cliprect.min_y & ~7; y <= cliprect.max_y; y += 8)
10511051      {
10521052         int rowscrollindex = (info->flip ? (216 - y) : y) / 8;
1053         rectangle rowclip = *cliprect;
1053         rectangle rowclip = cliprect;
10541054         UINT16 effxscroll, effyscroll, rowscroll;
10551055         UINT16 effpages = pages;
10561056
10571057         /* adjust to clip this row only */
1058         rowclip.min_y = (y < cliprect->min_y) ? cliprect->min_y : y;
1059         rowclip.max_y = (y + 7 > cliprect->max_y) ? cliprect->max_y : y + 7;
1058         rowclip.min_y = (y < cliprect.min_y) ? cliprect.min_y : y;
1059         rowclip.max_y = (y + 7 > cliprect.max_y) ? cliprect.max_y : y + 7;
10601060
10611061         /* get the effective scroll values */
10621062         rowscroll = textram[0xf80/2 + 0x40/2 * which + rowscrollindex];
r13798r13799
10741074         /* draw the chunk */
10751075         effxscroll = (0xc0 - effxscroll + info->xoffs) & 0x3ff;
10761076         effyscroll = effyscroll & 0x1ff;
1077         segaic16_draw_virtual_tilemap(machine, info, bitmap, &rowclip, effpages, effxscroll, effyscroll, flags, priority);
1077         segaic16_draw_virtual_tilemap(machine, info, bitmap, rowclip, effpages, effxscroll, effyscroll, flags, priority);
10781078      }
10791079   }
10801080}
r13798r13799
12241224 *
12251225 *************************************/
12261226
1227void segaic16_tilemap_draw(screen_device &screen, bitmap_t *bitmap, const rectangle *cliprect, int which, int map, int priority, int priority_mark)
1227void segaic16_tilemap_draw(screen_device &screen, bitmap_t *bitmap, const rectangle &cliprect, int which, int map, int priority, int priority_mark)
12281228{
12291229   running_machine &machine = screen.machine();
12301230   struct tilemap_info *info = &bg_tilemap[which];
r13798r13799
14311431}
14321432
14331433
1434static void segaic16_road_hangon_draw(struct road_info *info, bitmap_t *bitmap, const rectangle *cliprect, int priority)
1434static void segaic16_road_hangon_draw(struct road_info *info, bitmap_t *bitmap, const rectangle &cliprect, int priority)
14351435{
14361436   UINT16 *roadram = info->roadram;
14371437   int x, y;
14381438
14391439   /* loop over scanlines */
1440   for (y = cliprect->min_y; y <= cliprect->max_y; y++)
1440   for (y = cliprect.min_y; y <= cliprect.max_y; y++)
14411441   {
14421442      UINT16 *dest = &bitmap->pix16(y);
14431443      int control = roadram[0x000 + y];
r13798r13799
14741474      ss8j = 0;
14751475
14761476      /* draw this scanline from the beginning */
1477      for (x = -24; x <= cliprect->max_x; x++)
1477      for (x = -24; x <= cliprect.max_x; x++)
14781478      {
14791479         int md, color, select;
14801480
r13798r13799
15471547         }
15481548
15491549         /* write the pixel if we're past the minimum clip */
1550         if (x >= cliprect->min_x)
1550         if (x >= cliprect.min_x)
15511551            dest[x] = color;
15521552
15531553         /* ---- the following logic all happens on the 6M clock ---- */
r13798r13799
17011701}
17021702
17031703
1704static void segaic16_road_outrun_draw(struct road_info *info, bitmap_t *bitmap, const rectangle *cliprect, int priority)
1704static void segaic16_road_outrun_draw(struct road_info *info, bitmap_t *bitmap, const rectangle &cliprect, int priority)
17051705{
17061706   UINT16 *roadram = info->buffer;
17071707   int x, y;
17081708
17091709   /* loop over scanlines */
1710   for (y = cliprect->min_y; y <= cliprect->max_y; y++)
1710   for (y = cliprect.min_y; y <= cliprect.max_y; y++)
17111711   {
17121712      static const UINT8 priority_map[2][8] =
17131713      {
r13798r13799
17591759         if (color != -1)
17601760         {
17611761            color |= info->colorbase3;
1762            for (x = cliprect->min_x; x <= cliprect->max_x; x++)
1762            for (x = cliprect.min_x; x <= cliprect.max_x; x++)
17631763               dest[x] = color;
17641764         }
17651765      }
r13798r13799
18101810               if (data0 & 0x800)
18111811                  continue;
18121812               hpos0 = (hpos0 - (0x5f8 + info->xoffs)) & 0xfff;
1813               for (x = cliprect->min_x; x <= cliprect->max_x; x++)
1813               for (x = cliprect.min_x; x <= cliprect.max_x; x++)
18141814               {
18151815                  int pix0 = (hpos0 < 0x200) ? src0[hpos0] : 3;
18161816                  dest[x] = color_table[0x00 + pix0];
r13798r13799
18211821            case 1:
18221822               hpos0 = (hpos0 - (0x5f8 + info->xoffs)) & 0xfff;
18231823               hpos1 = (hpos1 - (0x5f8 + info->xoffs)) & 0xfff;
1824               for (x = cliprect->min_x; x <= cliprect->max_x; x++)
1824               for (x = cliprect.min_x; x <= cliprect.max_x; x++)
18251825               {
18261826                  int pix0 = (hpos0 < 0x200) ? src0[hpos0] : 3;
18271827                  int pix1 = (hpos1 < 0x200) ? src1[hpos1] : 3;
r13798r13799
18371837            case 2:
18381838               hpos0 = (hpos0 - (0x5f8 + info->xoffs)) & 0xfff;
18391839               hpos1 = (hpos1 - (0x5f8 + info->xoffs)) & 0xfff;
1840               for (x = cliprect->min_x; x <= cliprect->max_x; x++)
1840               for (x = cliprect.min_x; x <= cliprect.max_x; x++)
18411841               {
18421842                  int pix0 = (hpos0 < 0x200) ? src0[hpos0] : 3;
18431843                  int pix1 = (hpos1 < 0x200) ? src1[hpos1] : 3;
r13798r13799
18541854               if (data1 & 0x800)
18551855                  continue;
18561856               hpos1 = (hpos1 - (0x5f8 + info->xoffs)) & 0xfff;
1857               for (x = cliprect->min_x; x <= cliprect->max_x; x++)
1857               for (x = cliprect.min_x; x <= cliprect.max_x; x++)
18581858               {
18591859                  int pix1 = (hpos1 < 0x200) ? src1[hpos1] : 3;
18601860                  dest[x] = color_table[0x10 + pix1];
r13798r13799
19271927 *
19281928 *************************************/
19291929
1930void segaic16_road_draw(int which, bitmap_t *bitmap, const rectangle *cliprect, int priority)
1930void segaic16_road_draw(int which, bitmap_t *bitmap, const rectangle &cliprect, int priority)
19311931{
19321932   struct road_info *info = &segaic16_road[which];
19331933   (*info->draw)(info, bitmap, cliprect, priority);
r13798r13799
20292029 *
20302030 *************************************/
20312031
2032void segaic16_rotate_draw(running_machine &machine, int which, bitmap_t *bitmap, const rectangle *cliprect, bitmap_t *srcbitmap)
2032void segaic16_rotate_draw(running_machine &machine, int which, bitmap_t *bitmap, const rectangle &cliprect, bitmap_t *srcbitmap)
20332033{
20342034   struct rotate_info *info = &segaic16_rotate[which];
20352035   INT32 currx = (info->buffer[0x3f0] << 16) | info->buffer[0x3f1];
r13798r13799
20412041   int x, y;
20422042
20432043   /* advance forward based on the clip rect */
2044   currx += dxx * (cliprect->min_x + 27) + dxy * cliprect->min_y;
2045   curry += dyx * (cliprect->min_x + 27) + dyy * cliprect->min_y;
2044   currx += dxx * (cliprect.min_x + 27) + dxy * cliprect.min_y;
2045   curry += dyx * (cliprect.min_x + 27) + dyy * cliprect.min_y;
20462046
20472047   /* loop over screen Y coordinates */
2048   for (y = cliprect->min_y; y <= cliprect->max_y; y++)
2048   for (y = cliprect.min_y; y <= cliprect.max_y; y++)
20492049   {
20502050      UINT16 *dest = &bitmap->pix16(y);
20512051      UINT16 *src = &srcbitmap->pix16(0);
r13798r13799
20542054      INT32 ty = curry;
20552055
20562056      /* loop over screen X coordinates */
2057      for (x = cliprect->min_x; x <= cliprect->max_x; x++)
2057      for (x = cliprect.min_x; x <= cliprect.max_x; x++)
20582058      {
20592059         /* fetch the pixel from the source bitmap */
20602060         int sx = (tx >> 14) & 0x1ff;
src/mame/video/tehkanwc.c
r13798r13799
123123   bit 7 = enable (0 = display off)
124124 */
125125
126static void gridiron_draw_led(running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect, UINT8 led,int player)
126static void gridiron_draw_led(running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect, UINT8 led,int player)
127127{
128128   if (led&0x80)
129129      output_set_digit_value(player, led&0x7f);
r13798r13799
131131      output_set_digit_value(player, 0x00);
132132}
133133
134static void draw_sprites(running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect)
134static void draw_sprites(running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect)
135135{
136136   tehkanwc_state *state = machine.driver_data<tehkanwc_state>();
137137   UINT8 *spriteram = state->m_spriteram;
src/mame/video/bionicc.c
r13798r13799
207207
208208***************************************************************************/
209209
210static void draw_sprites( running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect )
210static void draw_sprites( running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect )
211211{
212212   UINT16 *buffered_spriteram = machine.generic.buffered_spriteram.u16;
213213//  bionicc_state *state = machine.driver_data<bionicc_state>();
r13798r13799
250250{
251251   bionicc_state *state = screen.machine().driver_data<bionicc_state>();
252252
253   bitmap->fill(get_black_pen(screen.machine()), *cliprect);
253   bitmap->fill(get_black_pen(screen.machine()), cliprect);
254254   tilemap_draw(bitmap, cliprect, state->m_fg_tilemap, 1 | TILEMAP_DRAW_LAYER1, 0);   /* nothing in FRONT */
255255   tilemap_draw(bitmap, cliprect, state->m_bg_tilemap, 0, 0);
256256   tilemap_draw(bitmap, cliprect, state->m_fg_tilemap, 0 | TILEMAP_DRAW_LAYER1, 0);
src/mame/video/deckarn.c
r13798r13799
2828
2929}
3030
31void deco_karnovsprites_device::draw_sprites( running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect, UINT16* spriteram, int size, int priority )
31void deco_karnovsprites_device::draw_sprites( running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect, UINT16* spriteram, int size, int priority )
3232{
3333   int offs;
3434
src/mame/video/segaic16.h
r13798r13799
3737
3838void segaic16_tilemap_init(running_machine &machine, int which, int type, int colorbase, int xoffs, int numbanks);
3939void segaic16_tilemap_reset(running_machine &machine, int which);
40void segaic16_tilemap_draw(screen_device &screen, bitmap_t *bitmap, const rectangle *cliprect, int which, int map, int priority, int priority_mark);
40void segaic16_tilemap_draw(screen_device &screen, bitmap_t *bitmap, const rectangle &cliprect, int which, int map, int priority, int priority_mark);
4141void segaic16_tilemap_set_bank(running_machine &machine, int which, int banknum, int offset);
4242void segaic16_tilemap_set_flip(running_machine &machine, int which, int flip);
4343void segaic16_tilemap_set_rowscroll(running_machine &machine, int which, int enable);
r13798r13799
5252#define SEGAIC16_SPRITES_OUTRUN      4
5353#define SEGAIC16_SPRITES_XBOARD      5
5454
55void segaic16_sprites_draw(screen_device &screen, bitmap_t *bitmap, const rectangle *cliprect, int which);
55void segaic16_sprites_draw(screen_device &screen, bitmap_t *bitmap, const rectangle &cliprect, int which);
5656void segaic16_sprites_set_bank(running_machine &machine, int which, int banknum, int offset);
5757void segaic16_sprites_set_flip(running_machine &machine, int which, int flip);
5858void segaic16_sprites_set_shadow(running_machine &machine, int which, int shadow);
r13798r13799
7171#define SEGAIC16_ROAD_FOREGROUND   1
7272
7373void segaic16_road_init(running_machine &machine, int which, int type, int colorbase1, int colorbase2, int colorbase3, int xoffs);
74void segaic16_road_draw(int which, bitmap_t *bitmap, const rectangle *cliprect, int priority);
74void segaic16_road_draw(int which, bitmap_t *bitmap, const rectangle &cliprect, int priority);
7575READ16_HANDLER( segaic16_road_control_0_r );
7676WRITE16_HANDLER( segaic16_road_control_0_w );
7777
r13798r13799
8181#define SEGAIC16_ROTATE_YBOARD      0
8282
8383void segaic16_rotate_init(running_machine &machine, int which, int type, int colorbase);
84void segaic16_rotate_draw(running_machine &machine, int which, bitmap_t *bitmap, const rectangle *cliprect, bitmap_t *srcbitmap);
84void segaic16_rotate_draw(running_machine &machine, int which, bitmap_t *bitmap, const rectangle &cliprect, bitmap_t *srcbitmap);
8585READ16_HANDLER( segaic16_rotate_control_0_r );
8686
8787/*************************************
r13798r13799
118118   struct tilemap_callback_info tmap_info[16];      /* callback info for 16 tilemap pages */
119119   struct tilemap_callback_info textmap_info;      /* callback info for a single textmap page */
120120   void         (*reset)(running_machine &machine, struct tilemap_info *info);/* reset callback */
121   void         (*draw_layer)(running_machine &machine, struct tilemap_info *info, bitmap_t *bitmap, const rectangle *cliprect, int which, int flags, int priority);
121   void         (*draw_layer)(running_machine &machine, struct tilemap_info *info, bitmap_t *bitmap, const rectangle &cliprect, int which, int flags, int priority);
122122   UINT16 *      textram;                  /* pointer to textram pointer */
123123   UINT16 *      tileram;                  /* pointer to tileram pointer */
124124   emu_timer *      latch_timer;               /* timer for latching 16b tilemap scroll values */
r13798r13799
133133   UINT16         colorbase2;                  /* color base for road background data */
134134   UINT16         colorbase3;                  /* color base for sky data */
135135   INT32         xoffs;                     /* X scroll offset */
136   void         (*draw)(struct road_info *info, bitmap_t *bitmap, const rectangle *cliprect, int priority);
136   void         (*draw)(struct road_info *info, bitmap_t *bitmap, const rectangle &cliprect, int priority);
137137   UINT16 *      roadram;                  /* pointer to roadram pointer */
138138   UINT16 *      buffer;                     /* buffered roadram pointer */
139139   UINT8 *         gfx;                     /* expanded road graphics */
r13798r13799
165165   UINT16         colorbase;                  /* base color index */
166166   INT32         ramsize;                  /* size of sprite RAM */
167167   INT32         xoffs;                     /* X scroll offset */
168   void         (*draw)(running_machine &machine, device_t* device, bitmap_t *bitmap, const rectangle *cliprect);
168   void         (*draw)(running_machine &machine, device_t* device, bitmap_t *bitmap, const rectangle &cliprect);
169169   int            buffer;                     /* should ram be buffered? */
170170};
171171
r13798r13799
183183   UINT16         colorbase;                  /* base color index */
184184   INT32         ramsize;                  /* size of sprite RAM */
185185   INT32         xoffs;                     /* X scroll offset */
186   void         (*draw)(running_machine &machine, device_t* device, bitmap_t *bitmap, const rectangle *cliprect);
186   void         (*draw)(running_machine &machine, device_t* device, bitmap_t *bitmap, const rectangle &cliprect);
187187   UINT16 *      spriteram;                  /* pointer to spriteram pointer */
188188   UINT16 *      buffer;                     /* buffered spriteram for those that use it */
189189
r13798r13799
195195
196196DECLARE_LEGACY_DEVICE(SEGA16SP, sega16sp);
197197
198void segaic16_sprites_hangon_draw(running_machine &machine, device_t *device, bitmap_t *bitmap, const rectangle *cliprect);
199void segaic16_sprites_sharrier_draw(running_machine &machine, device_t *device, bitmap_t *bitmap, const rectangle *cliprect);
200void segaic16_sprites_16a_draw(running_machine &machine, device_t *device, bitmap_t *bitmap, const rectangle *cliprect);
201void segaic16_sprites_16b_draw(running_machine &machine, device_t *device, bitmap_t *bitmap, const rectangle *cliprect);
202void segaic16_sprites_yboard_16b_draw(running_machine &machine, device_t *device, bitmap_t *bitmap, const rectangle *cliprect);
203void segaic16_sprites_yboard_draw(running_machine &machine, device_t *device, bitmap_t *bitmap, const rectangle *cliprect);
204void segaic16_sprites_outrun_draw(running_machine &machine, device_t *device, bitmap_t *bitmap, const rectangle *cliprect);
205void segaic16_sprites_xboard_draw(running_machine &machine, device_t *device, bitmap_t *bitmap, const rectangle *cliprect);
206void segaic16_sprites_16a_bootleg_wb3bl_draw(running_machine &machine, device_t *device, bitmap_t *bitmap, const rectangle *cliprect);
207void segaic16_sprites_16a_bootleg_passhtb_draw(running_machine &machine, device_t *device, bitmap_t *bitmap, const rectangle *cliprect);
208void segaic16_sprites_16a_bootleg_shinobld_draw(running_machine &machine, device_t *device, bitmap_t *bitmap, const rectangle *cliprect);
198void segaic16_sprites_hangon_draw(running_machine &machine, device_t *device, bitmap_t *bitmap, const rectangle &cliprect);
199void segaic16_sprites_sharrier_draw(running_machine &machine, device_t *device, bitmap_t *bitmap, const rectangle &cliprect);
200void segaic16_sprites_16a_draw(running_machine &machine, device_t *device, bitmap_t *bitmap, const rectangle &cliprect);
201void segaic16_sprites_16b_draw(running_machine &machine, device_t *device, bitmap_t *bitmap, const rectangle &cliprect);
202void segaic16_sprites_yboard_16b_draw(running_machine &machine, device_t *device, bitmap_t *bitmap, const rectangle &cliprect);
203void segaic16_sprites_yboard_draw(running_machine &machine, device_t *device, bitmap_t *bitmap, const rectangle &cliprect);
204void segaic16_sprites_outrun_draw(running_machine &machine, device_t *device, bitmap_t *bitmap, const rectangle &cliprect);
205void segaic16_sprites_xboard_draw(running_machine &machine, device_t *device, bitmap_t *bitmap, const rectangle &cliprect);
206void segaic16_sprites_16a_bootleg_wb3bl_draw(running_machine &machine, device_t *device, bitmap_t *bitmap, const rectangle &cliprect);
207void segaic16_sprites_16a_bootleg_passhtb_draw(running_machine &machine, device_t *device, bitmap_t *bitmap, const rectangle &cliprect);
208void segaic16_sprites_16a_bootleg_shinobld_draw(running_machine &machine, device_t *device, bitmap_t *bitmap, const rectangle &cliprect);
209209
210210/* the various sprite configs */
211211static const sega16sp_interface hangon_sega16sp_intf =
src/mame/video/citycon.c
r13798r13799
106106
107107
108108
109static void draw_sprites( running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect )
109static void draw_sprites( running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect )
110110{
111111   citycon_state *state = machine.driver_data<citycon_state>();
112112   int offs;
src/mame/video/suprridr.c
r13798r13799
177177   /* render left 4 columns with no scroll */
178178   subclip = visarea;;
179179   subclip.max_x = subclip.min_x + (state->m_flipx ? 1*8 : 4*8) - 1;
180   subclip &= *cliprect;
181   tilemap_draw(bitmap, &subclip, state->m_bg_tilemap_noscroll, 0, 0);
180   subclip &= cliprect;
181   tilemap_draw(bitmap, subclip, state->m_bg_tilemap_noscroll, 0, 0);
182182
183183   /* render right 1 column with no scroll */
184184   subclip = visarea;;
185185   subclip.min_x = subclip.max_x - (state->m_flipx ? 4*8 : 1*8) + 1;
186   subclip &= *cliprect;
187   tilemap_draw(bitmap, &subclip, state->m_bg_tilemap_noscroll, 0, 0);
186   subclip &= cliprect;
187   tilemap_draw(bitmap, subclip, state->m_bg_tilemap_noscroll, 0, 0);
188188
189189   /* render the middle columns normally */
190190   subclip = visarea;;
191191   subclip.min_x += state->m_flipx ? 1*8 : 4*8;
192192   subclip.max_x -= state->m_flipx ? 4*8 : 1*8;
193   subclip &= *cliprect;
194   tilemap_draw(bitmap, &subclip, state->m_bg_tilemap, 0, 0);
193   subclip &= cliprect;
194   tilemap_draw(bitmap, subclip, state->m_bg_tilemap, 0, 0);
195195
196196   /* render the top layer */
197197   tilemap_draw(bitmap, cliprect, state->m_fg_tilemap, 0, 0);
src/mame/video/spy.c
r13798r13799
6868
6969   k052109_tilemap_update(state->m_k052109);
7070
71   screen.machine().priority_bitmap->fill(0, *cliprect);
71   screen.machine().priority_bitmap->fill(0, cliprect);
7272
7373   if (!state->m_video_enable)
74      bitmap->fill(16 * state->m_layer_colorbase[0], *cliprect);
74      bitmap->fill(16 * state->m_layer_colorbase[0], cliprect);
7575   else
7676   {
7777      k052109_tilemap_draw(state->m_k052109, bitmap, cliprect, 1, TILEMAP_DRAW_OPAQUE, 1);
src/mame/video/deckarn.h
r13798r13799
55public:
66   deco_karnovsprites_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
77   void set_gfxregion(int region) { m_gfxregion = region; };
8   void draw_sprites( running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect, UINT16* spriteram, int size, int priority );
8   void draw_sprites( running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect, UINT16* spriteram, int size, int priority );
99   static void set_gfx_region(device_t &device, int region);
1010
1111protected:
src/mame/video/psikyo.c
r13798r13799
263263
264264***************************************************************************/
265265
266static void draw_sprites( running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect, int trans_pen )
266static void draw_sprites( running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect, int trans_pen )
267267{
268268   psikyo_state *state = machine.driver_data<psikyo_state>();
269269
r13798r13799
382382// until I work out why it makes a partial copy of the sprite list, and how best to apply it
383383// sprite placement of the explosion graphic seems incorrect compared to the original sets? (no / different zoom support?)
384384// it might be a problem with the actual bootleg
385static void draw_sprites_bootleg( running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect, int trans_pen )
385static void draw_sprites_bootleg( running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect, int trans_pen )
386386{
387387   psikyo_state *state = machine.driver_data<psikyo_state>();
388388
r13798r13799
674674   tilemap_set_transparent_pen(state->m_tilemap_1_size2, (layer1_ctrl & 8 ? 0 : 15));
675675   tilemap_set_transparent_pen(state->m_tilemap_1_size3, (layer1_ctrl & 8 ? 0 : 15));
676676
677   bitmap->fill(get_black_pen(screen.machine()), *cliprect);
677   bitmap->fill(get_black_pen(screen.machine()), cliprect);
678678
679   screen.machine().priority_bitmap->fill(0, *cliprect);
679   screen.machine().priority_bitmap->fill(0, cliprect);
680680
681681   if (layers_ctrl & 1)
682682      tilemap_draw(bitmap, cliprect, tmptilemap0, layer0_ctrl & 2 ? TILEMAP_DRAW_OPAQUE : 0, 1);
r13798r13799
848848   tilemap_set_transparent_pen(state->m_tilemap_1_size2, (layer1_ctrl & 8 ? 0 : 15));
849849   tilemap_set_transparent_pen(state->m_tilemap_1_size3, (layer1_ctrl & 8 ? 0 : 15));
850850
851   bitmap->fill(get_black_pen(screen.machine()), *cliprect);
851   bitmap->fill(get_black_pen(screen.machine()), cliprect);
852852
853   screen.machine().priority_bitmap->fill(0, *cliprect);
853   screen.machine().priority_bitmap->fill(0, cliprect);
854854
855855   if (layers_ctrl & 1)
856856      tilemap_draw(bitmap, cliprect, tmptilemap0, layer0_ctrl & 2 ? TILEMAP_DRAW_OPAQUE : 0, 1);
src/mame/video/playmark.c
r13798r13799
396396
397397***************************************************************************/
398398
399static void draw_sprites( running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect, int codeshift )
399static void draw_sprites( running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect, int codeshift )
400400{
401401   playmark_state *state = machine.driver_data<playmark_state>();
402402   int offs, start_offset = state->m_spriteram_size / 2 - 4;
r13798r13799
440440}
441441
442442
443static void bigtwinb_draw_sprites( running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect, int codeshift )
443static void bigtwinb_draw_sprites( running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect, int codeshift )
444444{
445445   playmark_state *state = machine.driver_data<playmark_state>();
446446   int offs, start_offset = state->m_spriteram_size / 2 - 4;
r13798r13799
477477   }
478478}
479479
480static void draw_bitmap( running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect )
480static void draw_bitmap( running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect )
481481{
482482   playmark_state *state = machine.driver_data<playmark_state>();
483483   int x, y, count;
r13798r13799
522522{
523523   playmark_state *state = screen.machine().driver_data<playmark_state>();
524524
525   screen.machine().priority_bitmap->fill(0, *cliprect);
525   screen.machine().priority_bitmap->fill(0, cliprect);
526526
527527   tilemap_draw(bitmap, cliprect, state->m_fg_tilemap, 0, 0);
528528   if (state->m_bg_enable)
r13798r13799
546546      tilemap_draw(bitmap, cliprect, state->m_tx_tilemap, 0, 0);
547547   }
548548   else
549      bitmap->fill(get_black_pen(screen.machine()), *cliprect);
549      bitmap->fill(get_black_pen(screen.machine()), cliprect);
550550   return 0;
551551}
552552
r13798r13799
554554{
555555   playmark_state *state = screen.machine().driver_data<playmark_state>();
556556
557   screen.machine().priority_bitmap->fill(0, *cliprect);
557   screen.machine().priority_bitmap->fill(0, cliprect);
558558
559559   tilemap_draw(bitmap, cliprect, state->m_fg_tilemap, 0, 1);
560560   if (state->m_bg_enable)
r13798r13799
582582      tilemap_set_scrollx(state->m_fg_tilemap, 0, state->m_fgscrollx);
583583   }
584584
585   screen.machine().priority_bitmap->fill(0, *cliprect);
585   screen.machine().priority_bitmap->fill(0, cliprect);
586586
587587   tilemap_draw(bitmap, cliprect, state->m_bg_tilemap, 0, 1);
588588   tilemap_draw(bitmap, cliprect, state->m_fg_tilemap, 0, 2);
r13798r13799
595595{
596596   playmark_state *state = screen.machine().driver_data<playmark_state>();
597597
598   screen.machine().priority_bitmap->fill(0, *cliprect);
598   screen.machine().priority_bitmap->fill(0, cliprect);
599599
600600   // video enabled
601601   if (state->m_scroll[6] & 1)
r13798r13799
606606      tilemap_draw(bitmap, cliprect, state->m_tx_tilemap, 0, 0);
607607   }
608608   else
609      bitmap->fill(get_black_pen(screen.machine()), *cliprect);
609      bitmap->fill(get_black_pen(screen.machine()), cliprect);
610610   return 0;
611611}
src/mame/video/esd16.c
r13798r13799
183183
184184***************************************************************************/
185185
186static void esd16_draw_sprites( running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect )
186static void esd16_draw_sprites( running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect )
187187{
188188   esd16_state *state = machine.driver_data<esd16_state>();
189189   int offs;
r13798r13799
247247}
248248
249249/* note, check if i can re-merge this with the other or if its really different */
250static void hedpanic_draw_sprites( running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect )
250static void hedpanic_draw_sprites( running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect )
251251{
252252   esd16_state *state = machine.driver_data<esd16_state>();
253253   int offs;
r13798r13799
328328   esd16_state *state = screen.machine().driver_data<esd16_state>();
329329   int layers_ctrl = -1;
330330
331   screen.machine().priority_bitmap->fill(0, *cliprect);
331   screen.machine().priority_bitmap->fill(0, cliprect);
332332
333333   tilemap_set_scrollx(state->m_tilemap_0, 0, state->m_scroll_0[0]);
334334   tilemap_set_scrolly(state->m_tilemap_0, 0, state->m_scroll_0[1]);
r13798r13799
348348#endif
349349
350350   if (layers_ctrl & 1)   tilemap_draw(bitmap, cliprect, state->m_tilemap_0, 0, 0);
351   else               bitmap->fill(0, *cliprect);
351   else               bitmap->fill(0, cliprect);
352352
353353   if (layers_ctrl & 2)   tilemap_draw(bitmap, cliprect, state->m_tilemap_1, 0, 1);
354354
r13798r13799
362362   esd16_state *state = screen.machine().driver_data<esd16_state>();
363363   int layers_ctrl = -1;
364364
365   screen.machine().priority_bitmap->fill(0, *cliprect);
365   screen.machine().priority_bitmap->fill(0, cliprect);
366366
367367#ifdef MAME_DEBUG
368368if (screen.machine().input().code_pressed(KEYCODE_Z))
r13798r13799
392392   }
393393   else
394394   {
395      bitmap->fill(0, *cliprect);
395      bitmap->fill(0, cliprect);
396396   }
397397
398398
r13798r13799
425425   esd16_state *state = screen.machine().driver_data<esd16_state>();
426426   int layers_ctrl = -1;
427427
428   screen.machine().priority_bitmap->fill(0, *cliprect);
428   screen.machine().priority_bitmap->fill(0, cliprect);
429429
430430#ifdef MAME_DEBUG
431431if ( screen.machine().input().code_pressed(KEYCODE_Z) )
r13798r13799
455455   }
456456   else
457457   {
458      bitmap->fill(0, *cliprect);
458      bitmap->fill(0, cliprect);
459459   }
460460
461461
src/mame/video/model3.c
r13798r13799
226226   }
227227}
228228#ifdef UNUSED_FUNCTION
229static void draw_texture_sheet(running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect)
229static void draw_texture_sheet(running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect)
230230{
231231   model3_state *state = machine.driver_data<model3_state>();
232232   int x,y;
233   for(y = cliprect->min_y; y <= cliprect->max_y; y++)
233   for(y = cliprect.min_y; y <= cliprect.max_y; y++)
234234   {
235235      UINT16 *d = &bitmap->pix16(y);
236236      int index = (y*2)*2048;
237      for(x = cliprect->min_x; x <= cliprect->max_x; x++) {
237      for(x = cliprect.min_x; x <= cliprect.max_x; x++) {
238238         UINT16 pix = state->m_texture_ram[0][index];
239239         index+=4;
240240         if(pix != 0) {
r13798r13799
245245}
246246#endif
247247
248static void draw_layer(running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect, int layer, int bitdepth)
248static void draw_layer(running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect, int layer, int bitdepth)
249249{
250250   model3_state *state = machine.driver_data<model3_state>();
251251   int x, y;
r13798r13799
296296
297297   if(bitdepth)      /* 4-bit */
298298   {
299      for(y = cliprect->min_y; y <= cliprect->max_y; y+=8)
299      for(y = cliprect.min_y; y <= cliprect.max_y; y+=8)
300300      {
301301         tile_index = ((y/8) * 64);
302         for (x = cliprect->min_x; x <= cliprect->max_x; x+=8) {
302         for (x = cliprect.min_x; x <= cliprect.max_x; x+=8) {
303303            UINT16 tile = tiles[tile_index ^ 0x2];
304304            draw_tile_4bit(machine, bitmap, x, y, tile);
305305            ++tile_index;
r13798r13799
308308   }
309309   else            /* 8-bit */
310310   {
311      for(y = cliprect->min_y; y <= cliprect->max_y; y+=8)
311      for(y = cliprect.min_y; y <= cliprect.max_y; y+=8)
312312      {
313313         tile_index = ((y/8) * 64);
314         for (x = cliprect->min_x; x <= cliprect->max_x; x+=8) {
314         for (x = cliprect.min_x; x <= cliprect.max_x; x+=8) {
315315            UINT16 tile = tiles[tile_index ^ 0x2];
316316            draw_tile_8bit(machine, bitmap, x, y, tile);
317317            ++tile_index;
r13798r13799
321321}
322322
323323#ifdef UNUSED_FUNCTION
324static void copy_screen(running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect)
324static void copy_screen(running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect)
325325{
326326   model3_state *state = machine.driver_data<model3_state>();
327327   int x,y;
328   for(y=cliprect->min_y; y <= cliprect->max_y; y++) {
328   for(y=cliprect.min_y; y <= cliprect.max_y; y++) {
329329      UINT16 *d = &bitmap->pix16(y);
330330      UINT16 *s = &state->m_bitmap3d->pix16(y);
331      for(x=cliprect->min_x; x <= cliprect->max_x; x++) {
331      for(x=cliprect.min_x; x <= cliprect.max_x; x++) {
332332         UINT16 pix = s[x];
333333         if(!(pix & 0x8000)) {
334334            d[x] = pix;
r13798r13799
358358   layer_scroll_x[3] = (layer_data[3] & 0x8000) ? (layer_data[3] & 0x1ff) : -(layer_data[3] & 0x1ff);
359359   layer_scroll_y[3] = (layer_data[3] & 0x8000) ? (layer_data[3] & 0x1ff) : -(layer_data[3] & 0x1ff);
360360#endif
361   state->m_screen_clip = (rectangle*)cliprect;
361   state->m_screen_clip = (rectangle*)&cliprect;
362362
363   state->m_clip3d.min_x = cliprect->min_x;
364   state->m_clip3d.max_x = cliprect->max_x;
365   state->m_clip3d.min_y = cliprect->min_y;
366   state->m_clip3d.max_y = cliprect->max_y;
363   state->m_clip3d.min_x = cliprect.min_x;
364   state->m_clip3d.max_x = cliprect.max_x;
365   state->m_clip3d.min_y = cliprect.min_y;
366   state->m_clip3d.max_y = cliprect.max_y;
367367
368368   /* layer disable debug keys */
369369   state->m_tick++;
r13798r13799
382382         state->m_debug_layer_disable ^= 0x10;
383383   }
384384
385   bitmap->fill(0, *cliprect);
385   bitmap->fill(0, cliprect);
386386
387387   if (!(state->m_debug_layer_disable & 0x8))
388388      draw_layer(screen.machine(), bitmap, cliprect, 3, (state->m_layer_enable >> 3) & 0x1);
r13798r13799
394394   {
395395#if 0
396396      if(state->m_real3d_display_list) {
397         state->m_zbuffer->fill(0, *cliprect);
398         state->m_bitmap3d->fill(0x8000, *cliprect);
397         state->m_zbuffer->fill(0, cliprect);
398         state->m_bitmap3d->fill(0x8000, cliprect);
399399         real3d_traverse_display_list(screen.machine());
400400      }
401401#endif
r13798r13799
10911091         callback = (tri->transparency >= 32) ? draw_scanline_normal : draw_scanline_trans;
10921092      else
10931093         callback = draw_scanline_alpha;
1094      poly_render_triangle(state->m_poly, state->m_bitmap3d, &state->m_clip3d, callback, 3, &tri->v[0], &tri->v[1], &tri->v[2]);
1094      poly_render_triangle(state->m_poly, state->m_bitmap3d, state->m_clip3d, callback, 3, &tri->v[0], &tri->v[1], &tri->v[2]);
10951095   }
10961096   else
10971097   {
r13798r13799
10991099      extra->polygon_intensity   = tri->intensity;
11001100      extra->color                = tri->color;
11011101
1102      poly_render_triangle(state->m_poly, state->m_bitmap3d, &state->m_clip3d, draw_scanline_color, 1, &tri->v[0], &tri->v[1], &tri->v[2]);
1102      poly_render_triangle(state->m_poly, state->m_bitmap3d, state->m_clip3d, draw_scanline_color, 1, &tri->v[0], &tri->v[1], &tri->v[2]);
11031103   }
11041104}
11051105
src/mame/video/namcos21.c
r13798r13799
9898} /* namcos21_ClearPolyFrameBuffer */
9999
100100static void
101CopyVisiblePolyFrameBuffer( running_machine &machine, bitmap_t *bitmap, const rectangle *clip, int zlo, int zhi )
101CopyVisiblePolyFrameBuffer( running_machine &machine, bitmap_t *bitmap, const rectangle &clip, int zlo, int zhi )
102102{
103103   namcos21_state *state = machine.driver_data<namcos21_state>(); /* blit the visible framebuffer */
104104   int sy;
105   for( sy=clip->min_y; sy<=clip->max_y; sy++ )
105   for( sy=clip.min_y; sy<=clip.max_y; sy++ )
106106   {
107107      UINT16 *dest = &bitmap->pix16(sy);
108108      const UINT16 *pPen = state->m_mpPolyFrameBufferPens2+NAMCOS21_POLY_FRAME_WIDTH*sy;
109109      const UINT16 *pZ = state->m_mpPolyFrameBufferZ2+NAMCOS21_POLY_FRAME_WIDTH*sy;
110110      int sx;
111      for( sx=clip->min_x; sx<=clip->max_x; sx++ )
111      for( sx=clip.min_x; sx<=clip.max_x; sx++ )
112112      {
113113         int z = pZ[sx];
114114         //if( pZ[sx]!=0x7fff )
r13798r13799
179179   int pivot = 3;
180180   int pri;
181181   update_palette(screen.machine());
182   bitmap->fill(0xff, *cliprect );
182   bitmap->fill(0xff, cliprect );
183183
184184   if( namcos2_gametype != NAMCOS21_WINRUN91 )
185185   { /* draw low priority 2d sprites */
r13798r13799
208208   }
209209   else
210210   { /* winrun bitmap layer */
211      int yscroll = -cliprect->min_y+(INT16)state->m_winrun_gpu_register[0x2/2];
211      int yscroll = -cliprect.min_y+(INT16)state->m_winrun_gpu_register[0x2/2];
212212      int base = 0x1000+0x100*(state->m_winrun_color&0xf);
213213      int sx,sy;
214      for( sy=cliprect->min_y; sy<=cliprect->max_y; sy++ )
214      for( sy=cliprect.min_y; sy<=cliprect.max_y; sy++ )
215215      {
216216         const UINT8 *pSource = &videoram[((yscroll+sy)&0x3ff)*0x200];
217217         UINT16 *pDest = &bitmap->pix16(sy);
218         for( sx=cliprect->min_x; sx<=cliprect->max_x; sx++ )
218         for( sx=cliprect.min_x; sx<=cliprect.max_x; sx++ )
219219         {
220220            int pen = pSource[sx];
221221            switch( pen )
src/mame/video/pgm.c
r13798r13799
367367   pgm_state *state = screen.machine().driver_data<pgm_state>();
368368   int y;
369369
370   bitmap->fill(get_black_pen(screen.machine()), *cliprect);
371   state->m_tmppgmbitmap->fill(0x00000000, *cliprect);
370   bitmap->fill(get_black_pen(screen.machine()), cliprect);
371   state->m_tmppgmbitmap->fill(0x00000000, cliprect);
372372
373373   draw_sprites(screen.machine(), state->m_tmppgmbitmap, state->m_spritebufferram);
374374
src/mame/video/darius.c
r13798r13799
4646
4747/***************************************************************************/
4848
49static void draw_sprites( running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect, int primask, int x_offs, int y_offs )
49static void draw_sprites( running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect, int primask, int x_offs, int y_offs )
5050{
5151   darius_state *state = machine.driver_data<darius_state>();
5252   UINT16 *spriteram = state->m_spriteram;
r13798r13799
9292
9393
9494
95static UINT32 update_screen(screen_device &screen, bitmap_t *bitmap, const rectangle *cliprect, int xoffs)
95static UINT32 update_screen(screen_device &screen, bitmap_t *bitmap, const rectangle &cliprect, int xoffs)
9696{
9797   darius_state *state = screen.machine().driver_data<darius_state>();
9898
src/mame/video/capbowl.c
r13798r13799
176176   /* if we're blanked, just fill with black */
177177   if (state.blanked)
178178   {
179      bitmap->fill(get_black_pen(screen.machine()), *cliprect);
179      bitmap->fill(get_black_pen(screen.machine()), cliprect);
180180      return 0;
181181   }
182182
183183   /* now regenerate the bitmap */
184   for (y = cliprect->min_y; y <= cliprect->max_y; y++)
184   for (y = cliprect.min_y; y <= cliprect.max_y; y++)
185185   {
186186      UINT8 *src = &state.vram[256 * y];
187187      UINT32 *dest = &bitmap->pix32(y);
188188
189      for (x = cliprect->min_x & ~1; x <= cliprect->max_x; x += 2)
189      for (x = cliprect.min_x & ~1; x <= cliprect.max_x; x += 2)
190190      {
191191         UINT8 pix = src[32 + (x / 2)];
192192         *dest++ = pen_for_pixel(src, pix >> 4);
src/mame/video/ikki.c
r13798r13799
6262}
6363
6464
65static void draw_sprites( running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect )
65static void draw_sprites( running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect )
6666{
6767   ikki_state *state = machine.driver_data<ikki_state>();
6868   UINT8 *spriteram = state->m_spriteram;
6969   int y;
7070   offs_t offs;
7171
72   state->m_sprite_bitmap->fill(state->m_punch_through_pen, *cliprect);
72   state->m_sprite_bitmap->fill(state->m_punch_through_pen, cliprect);
7373
7474   for (offs = 0; offs < state->m_spriteram_size; offs += 4)
7575   {
r13798r13799
101101   }
102102
103103   /* copy the sprite bitmap into the main bitmap, skipping the transparent pixels */
104   for (y = cliprect->min_y; y <= cliprect->max_y; y++)
104   for (y = cliprect.min_y; y <= cliprect.max_y; y++)
105105   {
106106      int x;
107107
108      for (x = cliprect->min_x; x <= cliprect->max_x; x++)
108      for (x = cliprect.min_x; x <= cliprect.max_x; x++)
109109      {
110110         UINT16 pen = state->m_sprite_bitmap->pix16(y, x);
111111
src/mame/video/cbasebal.c
r13798r13799
144144
145145***************************************************************************/
146146
147static void draw_sprites( running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect )
147static void draw_sprites( running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect )
148148{
149149   cbasebal_state *state = machine.driver_data<cbasebal_state>();
150150   UINT8 *spriteram = state->m_spriteram;
r13798r13799
185185   if (state->m_bg_on)
186186      tilemap_draw(bitmap, cliprect, state->m_bg_tilemap, 0, 0);
187187   else
188      bitmap->fill(768, *cliprect);
188      bitmap->fill(768, cliprect);
189189
190190   if (state->m_obj_on)
191191      draw_sprites(screen.machine(), bitmap, cliprect);
src/mame/video/st0016.c
r13798r13799
212212   }
213213}
214214
215static void draw_sprites(running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect)
215static void draw_sprites(running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect)
216216{
217217   /*
218218    object ram :
r13798r13799
377377
378378                           if (!flipx) { drawxpos = xpos+xloop; } else { drawxpos = (xpos+8-1)-xloop; }
379379
380                           if (drawxpos > cliprect->max_x)
380                           if (drawxpos > cliprect.max_x)
381381                              drawxpos -= 512; // wrap around
382382
383                           if ((drawxpos >= cliprect->min_x) && (drawxpos <= cliprect->max_x) && (drawypos >= cliprect->min_y) && (drawypos <= cliprect->max_y) )
383                           if ((drawxpos >= cliprect.min_x) && (drawxpos <= cliprect.max_x) && (drawypos >= cliprect.min_y) && (drawypos <= cliprect.max_y) )
384384                           {
385385                              if(st0016_spriteram[offset+5]&0x40)
386386                              {
r13798r13799
488488}
489489
490490
491static void draw_bgmap(running_machine &machine, bitmap_t *bitmap,const rectangle *cliprect, int priority)
491static void draw_bgmap(running_machine &machine, bitmap_t *bitmap,const rectangle &cliprect, int priority)
492492{
493493   gfx_element *gfx = machine.gfx[st0016_ramgfx];
494494   int j;
r13798r13799
543543
544544                           if (!flipx) { drawxpos = xpos+xloop; } else { drawxpos = (xpos+8-1)-xloop; }
545545
546                           if (drawxpos > cliprect->max_x)
546                           if (drawxpos > cliprect.max_x)
547547                              drawxpos -= 512; // wrap around
548548
549                           if ((drawxpos >= cliprect->min_x) && (drawxpos <= cliprect->max_x) && (drawypos >= cliprect->min_y) && (drawypos <= cliprect->max_y) )
549                           if ((drawxpos >= cliprect.min_x) && (drawxpos <= cliprect.max_x) && (drawypos >= cliprect.min_y) && (drawypos <= cliprect.max_y) )
550550                           {
551551
552552                              if(st0016_vregs[j+7]==0x12)
r13798r13799
584584}
585585
586586
587void st0016_draw_screen(screen_device &screen, bitmap_t *bitmap, const rectangle *cliprect)
587void st0016_draw_screen(screen_device &screen, bitmap_t *bitmap, const rectangle &cliprect)
588588{
589589   draw_bgmap(screen.machine(), bitmap,cliprect,0);
590590   draw_sprites(screen.machine(), bitmap,cliprect);
r13798r13799
616616   }
617617#endif
618618
619   bitmap->fill(UNUSED_PEN, *cliprect);
619   bitmap->fill(UNUSED_PEN, cliprect);
620620   st0016_draw_screen(screen, bitmap, cliprect);
621621   return 0;
622622}
src/mame/video/sbasketb.c
r13798r13799
135135   tilemap_set_scroll_cols(state->m_bg_tilemap, 32);
136136}
137137
138static void draw_sprites( running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect )
138static void draw_sprites( running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect )
139139{
140140   sbasketb_state *state = machine.driver_data<sbasketb_state>();
141141   UINT8 *spriteram = state->m_spriteram;
src/mame/video/funkyjet.c
r13798r13799
1919   flip_screen_set(screen.machine(), BIT(flip, 7));
2020   deco16ic_pf_update(state->m_deco_tilegen1, state->m_pf1_rowscroll, state->m_pf2_rowscroll);
2121
22   bitmap->fill(768, *cliprect);
22   bitmap->fill(768, cliprect);
2323   deco16ic_tilemap_2_draw(state->m_deco_tilegen1, bitmap, cliprect, TILEMAP_DRAW_OPAQUE, 0);
2424   deco16ic_tilemap_1_draw(state->m_deco_tilegen1, bitmap, cliprect, 0, 0);
2525   screen.machine().device<decospr_device>("spritegen")->draw_sprites(screen.machine(), bitmap, cliprect, state->m_spriteram, 0x400);
src/mame/video/xexex.c
r13798r13799
8181   k054338_update_all_shadows(state->m_k054338, 0);
8282   k054338_fill_backcolor(state->m_k054338, bitmap, 0);
8383
84   screen.machine().priority_bitmap->fill(0, *cliprect);
84   screen.machine().priority_bitmap->fill(0, cliprect);
8585
8686   for (plane = 0; plane < 4; plane++)
8787   {
src/mame/video/ksayakyu.c
r13798r13799
8181[3]
8282*/
8383
84static void draw_sprites( running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect )
84static void draw_sprites( running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect )
8585{
8686   ksayakyu_state *state = machine.driver_data<ksayakyu_state>();
8787   const UINT8 *source = state->m_spriteram + state->m_spriteram_size - 4;
r13798r13799
128128{
129129   ksayakyu_state *state = screen.machine().driver_data<ksayakyu_state>();
130130
131   bitmap->fill(0, *cliprect);
131   bitmap->fill(0, cliprect);
132132
133133   if (state->m_video_ctrl & 1)
134134      tilemap_draw(bitmap, cliprect,state->m_tilemap, 0, 0);
src/mame/video/himesiki.c
r13798r13799
5050      logerror("p08_w %02x\n",data);
5151}
5252
53static void himesiki_draw_sprites( running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect )
53static void himesiki_draw_sprites( running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect )
5454{
5555   himesiki_state *state = machine.driver_data<himesiki_state>();
5656   UINT8 *spriteram = state->m_spriteram;
src/mame/video/battlex.c
r13798r13799
6464   state->m_bg_tilemap = tilemap_create(machine, get_bg_tile_info, tilemap_scan_rows, 8, 8, 64, 32);
6565}
6666
67static void draw_sprites( running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect )
67static void draw_sprites( running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect )
6868{
6969   battlex_state *state = machine.driver_data<battlex_state>();
7070   const gfx_element *gfx = machine.gfx[1];
src/mame/video/ironhors.c
r13798r13799
155155   tilemap_set_scroll_rows(state->m_bg_tilemap, 32);
156156}
157157
158static void draw_sprites( running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect )
158static void draw_sprites( running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect )
159159{
160160   ironhors_state *state = machine.driver_data<ironhors_state>();
161161   int offs;
r13798r13799
271271   tilemap_set_scroll_rows(state->m_bg_tilemap, 32);
272272}
273273
274static void farwest_draw_sprites( running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect )
274static void farwest_draw_sprites( running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect )
275275{
276276   ironhors_state *state = machine.driver_data<ironhors_state>();
277277   int offs;
src/mame/video/mrflea.c
r13798r13799
4343   state->m_spriteram[offset] = data;
4444}
4545
46static void draw_sprites( running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect )
46static void draw_sprites( running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect )
4747{
4848   mrflea_state *state = machine.driver_data<mrflea_state>();
4949   const gfx_element *gfx = machine.gfx[0];
r13798r13799
6060      int ypos = source[0] - 16 + 3;
6161      int tile_number = source[2] + source[3] * 0x100;
6262
63      drawgfx_transpen( bitmap, &clip,gfx,
63      drawgfx_transpen( bitmap, clip,gfx,
6464         tile_number,
6565         0, /* color */
6666         0,0, /* no flip */
6767         xpos,ypos,0 );
68      drawgfx_transpen( bitmap, &clip,gfx,
68      drawgfx_transpen( bitmap, clip,gfx,
6969         tile_number,
7070         0, /* color */
7171         0,0, /* no flip */
r13798r13799
7474   }
7575}
7676
77static void draw_background( running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect )
77static void draw_background( running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect )
7878{
7979   mrflea_state *state = machine.driver_data<mrflea_state>();
8080   const UINT8 *source = state->m_videoram;
src/mame/video/snes.c
r13798r13799
17941794   int y;
17951795
17961796   /*NTSC SNES draw range is 1-225. */
1797   for (y = cliprect->min_y; y <= cliprect->max_y; y++)
1797   for (y = cliprect.min_y; y <= cliprect.max_y; y++)
17981798   {
17991799      snes_refresh_scanline(screen.machine(), bitmap, y + 1);
18001800   }
src/mame/video/glass.c
r13798r13799
164164      3  | xxxxxxxx xxxxxxxx | sprite code
165165*/
166166
167static void draw_sprites( running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect )
167static void draw_sprites( running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect )
168168{
169169   glass_state *state = machine.driver_data<glass_state>();
170170   int i;
r13798r13799
205205   tilemap_set_scrollx(state->m_pant[1], 0, state->m_vregs[3]);
206206
207207   /* draw layers + sprites */
208   bitmap->fill(get_black_pen(screen.machine()), *cliprect);
208   bitmap->fill(get_black_pen(screen.machine()), cliprect);
209209   copybitmap(bitmap, state->m_screen_bitmap, 0, 0, 0x18, 0x24, cliprect);
210210   tilemap_draw(bitmap, cliprect, state->m_pant[1], 0, 0);
211211   tilemap_draw(bitmap, cliprect, state->m_pant[0], 0, 0);
src/mame/video/mcatadv.c
r13798r13799
5353}
5454
5555
56static void draw_sprites( running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect )
56static void draw_sprites( running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect )
5757{
5858   mcatadv_state *state = machine.driver_data<mcatadv_state>();
5959   UINT16 *source = state->m_spriteram_old;
r13798r13799
121121         {
122122            drawypos = y + ycnt - global_y;
123123
124            if ((drawypos >= cliprect->min_y) && (drawypos <= cliprect->max_y))
124            if ((drawypos >= cliprect.min_y) && (drawypos <= cliprect.max_y))
125125            {
126126               destline = &bitmap->pix16(drawypos);
127127               priline = &machine.priority_bitmap->pix8(drawypos);
r13798r13799
140140                        pix = pix >> 4;
141141                     pix &= 0x0f;
142142
143                     if ((drawxpos >= cliprect->min_x) && (drawxpos <= cliprect->max_x) && pix)
143                     if ((drawxpos >= cliprect.min_x) && (drawxpos <= cliprect.max_x) && pix)
144144                        destline[drawxpos] = (pix + (pen << 4));
145145                  }
146146                  offset++;
r13798r13799
156156   }
157157}
158158
159static void mcatadv_draw_tilemap_part( UINT16* current_scroll, UINT16* current_videoram1, int i, tilemap_t* current_tilemap, bitmap_t *bitmap, const rectangle *cliprect )
159static void mcatadv_draw_tilemap_part( UINT16* current_scroll, UINT16* current_videoram1, int i, tilemap_t* current_tilemap, bitmap_t *bitmap, const rectangle &cliprect )
160160{
161161   int flip;
162162   UINT32 drawline;
163163   rectangle clip;
164164
165   clip.min_x = cliprect->min_x;
166   clip.max_x = cliprect->max_x;
165   clip.min_x = cliprect.min_x;
166   clip.max_x = cliprect.max_x;
167167
168   for (drawline = cliprect->min_y; drawline <= cliprect->max_y; drawline++)
168   for (drawline = cliprect.min_y; drawline <= cliprect.max_y; drawline++)
169169   {
170170      int scrollx, scrolly;
171171
r13798r13799
196196      tilemap_set_scrolly(current_tilemap, 0, scrolly);
197197      tilemap_set_flip(current_tilemap, flip);
198198
199      tilemap_draw(bitmap, &clip, current_tilemap, i, i);
199      tilemap_draw(bitmap, clip, current_tilemap, i, i);
200200   }
201201}
202202
r13798r13799
205205   mcatadv_state *state = screen.machine().driver_data<mcatadv_state>();
206206   int i;
207207
208   bitmap->fill(get_black_pen(screen.machine()), *cliprect);
209   screen.machine().priority_bitmap->fill(0, *cliprect);
208   bitmap->fill(get_black_pen(screen.machine()), cliprect);
209   screen.machine().priority_bitmap->fill(0, cliprect);
210210
211211   if (state->m_scroll1[2] != state->m_palette_bank1)
212212   {
src/mame/video/toaplan2.c
r13798r13799
297297
298298   if (state->m_vdp1)
299299   {
300      bitmap->fill(0, *cliprect);
301      state->m_custom_priority_bitmap->fill(0, *cliprect);
300      bitmap->fill(0, cliprect);
301      state->m_custom_priority_bitmap->fill(0, cliprect);
302302      state->m_vdp1->gp9001_render_vdp(screen.machine(), bitmap, cliprect);
303303   }
304304   if (state->m_vdp0)
305305   {
306   //  bitmap->fill(0, *cliprect);
307      state->m_custom_priority_bitmap->fill(0, *cliprect);
306   //  bitmap->fill(0, cliprect);
307      state->m_custom_priority_bitmap->fill(0, cliprect);
308308      state->m_vdp0->gp9001_render_vdp(screen.machine(), bitmap, cliprect);
309309   }
310310
r13798r13799
318318{
319319   toaplan2_state *state = screen.machine().driver_data<toaplan2_state>();
320320
321//  bitmap->fill(0, *cliprect);
322//  gp9001_custom_priority_bitmap->fill(0, *cliprect);
321//  bitmap->fill(0, cliprect);
322//  gp9001_custom_priority_bitmap->fill(0, cliprect);
323323
324324   if (state->m_vdp0)
325325   {
326      bitmap->fill(0, *cliprect);
327      state->m_custom_priority_bitmap->fill(0, *cliprect);
326      bitmap->fill(0, cliprect);
327      state->m_custom_priority_bitmap->fill(0, cliprect);
328328      state->m_vdp0->gp9001_render_vdp(screen.machine(), bitmap, cliprect);
329329   }
330330   if (state->m_vdp1)
331331   {
332      state->m_secondary_render_bitmap->fill(0, *cliprect);
333      state->m_custom_priority_bitmap->fill(0, *cliprect);
332      state->m_secondary_render_bitmap->fill(0, cliprect);
333      state->m_custom_priority_bitmap->fill(0, cliprect);
334334      state->m_vdp1->gp9001_render_vdp(screen.machine(), state->m_secondary_render_bitmap, cliprect);
335335   }
336336
r13798r13799
420420
421421   if (state->m_vdp0)
422422   {
423      bitmap->fill(0, *cliprect);
424      state->m_custom_priority_bitmap->fill(0, *cliprect);
423      bitmap->fill(0, cliprect);
424      state->m_custom_priority_bitmap->fill(0, cliprect);
425425      state->m_vdp0->gp9001_render_vdp(screen.machine(), bitmap, cliprect);
426426   }
427427
r13798r13799
466466         clip.min_y = clip.max_y = line;
467467         tilemap_set_scrolly(state->m_tx_tilemap, 0,     - line + state->m_txvideoram16_offs[      line]);
468468      }
469      tilemap_draw(bitmap, &clip, state->m_tx_tilemap, 0, 0);
469      tilemap_draw(bitmap, clip, state->m_tx_tilemap, 0, 0);
470470   }
471471   return 0;
472472}
src/mame/video/mjkjidai.c
r13798r13799
8787
8888***************************************************************************/
8989
90static void draw_sprites(running_machine &machine, bitmap_t *bitmap,const rectangle *cliprect)
90static void draw_sprites(running_machine &machine, bitmap_t *bitmap,const rectangle &cliprect)
9191{
9292   mjkjidai_state *state = machine.driver_data<mjkjidai_state>();
9393   UINT8 *spriteram = state->m_spriteram1;
r13798r13799
133133{
134134   mjkjidai_state *state = screen.machine().driver_data<mjkjidai_state>();
135135   if (!state->m_display_enable)
136      bitmap->fill(get_black_pen(screen.machine()), *cliprect);
136      bitmap->fill(get_black_pen(screen.machine()), cliprect);
137137   else
138138   {
139139      tilemap_draw(bitmap,cliprect,state->m_bg_tilemap,0,0);
src/mame/video/jailbrek.c
r13798r13799
6565   tilemap_set_scrolldx(state->m_bg_tilemap, 0, 396 - 256);
6666}
6767
68static void draw_sprites( running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect )
68static void draw_sprites( running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect )
6969{
7070   jailbrek_state *state = machine.driver_data<jailbrek_state>();
7171   UINT8 *spriteram = state->m_spriteram;
src/mame/video/gaelco.c
r13798r13799
121121      3  | xxxxxxxx xxxxxx-- | sprite code
122122*/
123123
124static void draw_sprites( running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect )
124static void draw_sprites( running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect )
125125{
126126   gaelco_state *state = machine.driver_data<gaelco_state>();
127127   int i, x, y, ex, ey;
r13798r13799
197197   tilemap_set_scrolly(state->m_tilemap[1], 0, state->m_vregs[2]);
198198   tilemap_set_scrollx(state->m_tilemap[1], 0, state->m_vregs[3]);
199199
200   screen.machine().priority_bitmap->fill(0, *cliprect);
201   bitmap->fill(0, *cliprect);
200   screen.machine().priority_bitmap->fill(0, cliprect);
201   bitmap->fill(0, cliprect);
202202
203203   tilemap_draw(bitmap, cliprect, state->m_tilemap[1], 3, 0);
204204   tilemap_draw(bitmap, cliprect, state->m_tilemap[0], 3, 0);
r13798r13799
226226   tilemap_set_scrolly(state->m_tilemap[1], 0, state->m_vregs[2]);
227227   tilemap_set_scrollx(state->m_tilemap[1], 0, state->m_vregs[3]);
228228
229   screen.machine().priority_bitmap->fill(0, *cliprect);
230   bitmap->fill(0, *cliprect);
229   screen.machine().priority_bitmap->fill(0, cliprect);
230   bitmap->fill(0, cliprect);
231231
232232   tilemap_draw(bitmap, cliprect, state->m_tilemap[1], TILEMAP_DRAW_LAYER1 | 3, 0);
233233   tilemap_draw(bitmap, cliprect, state->m_tilemap[0], TILEMAP_DRAW_LAYER1 | 3, 0);
src/mame/video/wecleman.c
r13798r13799
169169}
170170
171171// draws a 8bpp palette sprites on a 16bpp direct RGB target (sub-par implementation)
172static void do_blit_zoom32(wecleman_state *state, bitmap_t *bitmap, const rectangle *cliprect, struct sprite *sprite)
172static void do_blit_zoom32(wecleman_state *state, bitmap_t *bitmap, const rectangle &cliprect, struct sprite *sprite)
173173{
174174#define PRECISION_X 20
175175#define PRECISION_Y 20
r13798r13799
185185      x2 = sprite->x;
186186      x1 = x2 + sprite->total_width;
187187      dx = -1;
188      if (x2 < cliprect->min_x) x2 = cliprect->min_x;
189      if (x1 > cliprect->max_x )
188      if (x2 < cliprect.min_x) x2 = cliprect.min_x;
189      if (x1 > cliprect.max_x )
190190      {
191         xcount0 = x1 - cliprect->max_x;
192         x1 = cliprect->max_x;
191         xcount0 = x1 - cliprect.max_x;
192         x1 = cliprect.max_x;
193193      }
194194      if (x2 >= x1) return;
195195      x1--; x2--;
r13798r13799
199199      x1 = sprite->x;
200200      x2 = x1 + sprite->total_width;
201201      dx = 1;
202      if (x1 < cliprect->min_x )
202      if (x1 < cliprect.min_x )
203203      {
204         xcount0 = cliprect->min_x - x1;
205         x1 = cliprect->min_x;
204         xcount0 = cliprect.min_x - x1;
205         x1 = cliprect.min_x;
206206      }
207      if (x2 > cliprect->max_x ) x2 = cliprect->max_x;
207      if (x2 > cliprect.max_x ) x2 = cliprect.max_x;
208208      if (x1 >= x2) return;
209209   }
210210
r13798r13799
213213      y2 = sprite->y;
214214      y1 = y2 + sprite->total_height;
215215      dy = -1;
216      if (y2 < cliprect->min_y ) y2 = cliprect->min_y;
217      if (y1 > cliprect->max_y )
216      if (y2 < cliprect.min_y ) y2 = cliprect.min_y;
217      if (y1 > cliprect.max_y )
218218      {
219         ycount0 = cliprect->max_y;
220         y1 = cliprect->max_y;
219         ycount0 = cliprect.max_y;
220         y1 = cliprect.max_y;
221221      }
222222      if (y2 >= y1) return;
223223      y1--; y2--;
r13798r13799
227227      y1 = sprite->y;
228228      y2 = y1 + sprite->total_height;
229229      dy = 1;
230      if (y1 < cliprect->min_y )
230      if (y1 < cliprect.min_y )
231231      {
232         ycount0 = cliprect->min_y - y1;
233         y1 = cliprect->min_y;
232         ycount0 = cliprect.min_y - y1;
233         y1 = cliprect.min_y;
234234      }
235      if (y2 > cliprect->max_y) y2 = cliprect->max_y;
235      if (y2 > cliprect.max_y) y2 = cliprect.max_y;
236236      if (y1 >= y2) return;
237237   }
238238
r13798r13799
246246   // pre-loop assignments and adjustments
247247   pal_base = sprite->pal_data;
248248
249   if (x1 > cliprect->min_x)
249   if (x1 > cliprect.min_x)
250250   {
251251      x1 -= dx;
252252      x2 -= dx;
r13798r13799
330330   }
331331}
332332
333static void sprite_draw(running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect)
333static void sprite_draw(running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect)
334334{
335335   wecleman_state *state = machine.driver_data<wecleman_state>();
336336   int i;
r13798r13799
539539
540540------------------------------------------------------------------------*/
541541
542static void wecleman_draw_road(running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect, int priority)
542static void wecleman_draw_road(running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect, int priority)
543543{
544544   wecleman_state *state = machine.driver_data<wecleman_state>();
545545// must be powers of 2
r13798r13799
576576   if (priority == 0x02)
577577   {
578578      // draw sky; each scanline is assumed to be dword aligned
579      for (sy=cliprect->min_y-BMP_PAD; sy<DST_HEIGHT; sy++)
579      for (sy=cliprect.min_y-BMP_PAD; sy<DST_HEIGHT; sy++)
580580      {
581581         UINT32 *dst = &bitmap->pix32(sy+BMP_PAD, BMP_PAD);
582582         UINT32 pix;
r13798r13799
602602         road_rgb[i] = color ? rgb_ptr[color] : 0xffffffff;
603603      }
604604
605      for (sy=cliprect->min_y-BMP_PAD; sy<DST_HEIGHT; sy++)
605      for (sy=cliprect.min_y-BMP_PAD; sy<DST_HEIGHT; sy++)
606606      {
607607         UINT32 *dst = &bitmap->pix32(sy+BMP_PAD, BMP_PAD);
608608         UINT32 pix;
r13798r13799
792792
793793------------------------------------------------------------------------*/
794794
795static void hotchase_draw_road(running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect)
795static void hotchase_draw_road(running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect)
796796{
797797   wecleman_state *state = machine.driver_data<wecleman_state>();
798798/* Referred to what's in the ROMs */
r13798r13799
10651065
10661066   get_sprite_info(screen.machine());
10671067
1068   bitmap->fill(state->m_black_pen, *cliprect);
1068   bitmap->fill(state->m_black_pen, cliprect);
10691069
10701070   /* Draw the road (lines which have priority 0x02) */
10711071   if (video_on) wecleman_draw_road(screen.machine(), bitmap, cliprect, 0x02);
r13798r13799
11291129
11301130   get_sprite_info(screen.machine());
11311131
1132   bitmap->fill(state->m_black_pen, *cliprect);
1132   bitmap->fill(state->m_black_pen, cliprect);
11331133
11341134   /* Draw the background */
11351135   if (video_on)
src/mame/video/tankbust.c
r13798r13799
187187    offset  3   xxxxxxxx    x position (8 LSB bits)
188188*/
189189
190static void draw_sprites(running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect)
190static void draw_sprites(running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect)
191191{
192192   tankbust_state *state = machine.driver_data<tankbust_state>();
193193   UINT8 *spriteram = state->m_spriteram;
src/mame/video/pastelg.c
r13798r13799
316316            bitmap->pix16(y, x) = state->m_videoram[(y * width) + x];
317317   }
318318   else
319      bitmap->fill(0, *cliprect);
319      bitmap->fill(0, cliprect);
320320
321321   return 0;
322322}
src/mame/video/portrait.c
r13798r13799
129129}
130130
131131
132static void draw_sprites(running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect)
132static void draw_sprites(running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect)
133133{
134134   portrait_state *state = machine.driver_data<portrait_state>();
135135   UINT8 *source = state->m_spriteram;
r13798r13799
193193   portrait_state *state = screen.machine().driver_data<portrait_state>();
194194   rectangle cliprect_scroll, cliprect_no_scroll;
195195
196   cliprect_scroll = cliprect_no_scroll = *cliprect;
196   cliprect_scroll = cliprect_no_scroll = cliprect;
197197
198198   cliprect_no_scroll.min_x = cliprect_no_scroll.max_x - 111;
199199   cliprect_scroll.max_x    = cliprect_scroll.min_x    + 319;
200200
201201   tilemap_set_scrolly(state->m_background, 0, 0);
202202   tilemap_set_scrolly(state->m_foreground, 0, 0);
203   tilemap_draw(bitmap, &cliprect_no_scroll, state->m_background, 0, 0);
204   tilemap_draw(bitmap, &cliprect_no_scroll, state->m_foreground, 0, 0);
203   tilemap_draw(bitmap, cliprect_no_scroll, state->m_background, 0, 0);
204   tilemap_draw(bitmap, cliprect_no_scroll, state->m_foreground, 0, 0);
205205
206206   tilemap_set_scrolly(state->m_background, 0, state->m_scroll);
207207   tilemap_set_scrolly(state->m_foreground, 0, state->m_scroll);
208   tilemap_draw(bitmap, &cliprect_scroll, state->m_background, 0, 0);
209   tilemap_draw(bitmap, &cliprect_scroll, state->m_foreground, 0, 0);
208   tilemap_draw(bitmap, cliprect_scroll, state->m_background, 0, 0);
209   tilemap_draw(bitmap, cliprect_scroll, state->m_foreground, 0, 0);
210210
211211   draw_sprites(screen.machine(), bitmap,cliprect);
212212   return 0;
src/mame/video/bosco.c
r13798r13799
189189
190190***************************************************************************/
191191
192static void draw_sprites(running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect )
192static void draw_sprites(running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect )
193193{
194194   UINT8 *spriteram = machine.generic.spriteram.u8;
195195   UINT8 *spriteram_2 = machine.generic.spriteram2.u8;
r13798r13799
219219}
220220
221221
222static void draw_bullets(running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect )
222static void draw_bullets(running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect )
223223{
224224   bosco_state *state =  machine.driver_data<bosco_state>();
225225   int offs;
r13798r13799
244244}
245245
246246
247static void draw_stars(running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect, int flip)
247static void draw_stars(running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect, int flip)
248248{
249249   bosco_state *state = machine.driver_data<bosco_state>();
250250
r13798r13799
271271            {
272272               if (flip) x += 20*8;
273273
274               if (x >= cliprect->min_x && x <= cliprect->max_x && y >= cliprect->min_y && y <= cliprect->max_y)
274               if (x >= cliprect.min_x && x <= cliprect.max_x && y >= cliprect.min_y && y <= cliprect.max_y)
275275                  bitmap->pix16(y, x) = STARS_COLOR_BASE + star_seed_tab[star_cntr].col;
276276            }
277277         }
r13798r13799
286286
287287   /* the radar tilemap is just 8x32. We rely on the tilemap code to repeat it across
288288       the screen, and clip it to only the position where it is supposed to be shown */
289   rectangle fg_clip = *cliprect;
290   rectangle bg_clip = *cliprect;
289   rectangle fg_clip = cliprect;
290   rectangle bg_clip = cliprect;
291291   if (flip_screen_get(screen.machine()))
292292   {
293293      bg_clip.min_x = 20*8;
r13798r13799
299299      fg_clip.min_x = 28*8;
300300   }
301301
302   bitmap->fill(get_black_pen(screen.machine()), *cliprect);
302   bitmap->fill(get_black_pen(screen.machine()), cliprect);
303303   draw_stars(screen.machine(),bitmap,cliprect,flip_screen_get(screen.machine()));
304304
305   tilemap_draw(bitmap,&bg_clip,state->m_bg_tilemap,0,0);
306   tilemap_draw(bitmap,&fg_clip,state->m_fg_tilemap,0,0);
305   tilemap_draw(bitmap,bg_clip,state->m_bg_tilemap,0,0);
306   tilemap_draw(bitmap,fg_clip,state->m_fg_tilemap,0,0);
307307
308308   draw_sprites(screen.machine(), bitmap,cliprect);
309309
310310   /* draw the high priority characters */
311   tilemap_draw(bitmap,&bg_clip,state->m_bg_tilemap,1,0);
312   tilemap_draw(bitmap,&fg_clip,state->m_fg_tilemap,1,0);
311   tilemap_draw(bitmap,bg_clip,state->m_bg_tilemap,1,0);
312   tilemap_draw(bitmap,fg_clip,state->m_fg_tilemap,1,0);
313313
314314   draw_bullets(screen.machine(), bitmap,cliprect);
315315
src/mame/video/munchmo.c
r13798r13799
4848   state->m_tmpbitmap = auto_bitmap_alloc(machine, 512, 512, machine.primary_screen->format());
4949}
5050
51static void draw_status( running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect )
51static void draw_status( running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect )
5252{
5353   munchmo_state *state = machine.driver_data<munchmo_state>();
5454   const gfx_element *gfx = machine.gfx[0];
r13798r13799
7676   }
7777}
7878
79static void draw_background( running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect )
79static void draw_background( running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect )
8080{
8181/*
8282    ROM B1.2C contains 256 tilemaps defining 4x4 configurations of
r13798r13799
9898      {
9999         for (col = 0; col < 4; col++)
100100         {
101            drawgfx_opaque(state->m_tmpbitmap, 0, gfx,
101            drawgfx_opaque(state->m_tmpbitmap, state->m_tmpbitmap->cliprect(), gfx,
102102               rom[col + tile_number * 4 + row * 0x400],
103103               state->m_palette_bank,
104104               0,0, /* flip */
r13798r13799
115115   }
116116}
117117
118static void draw_sprites( running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect )
118static void draw_sprites( running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect )
119119{
120120   munchmo_state *state = machine.driver_data<munchmo_state>();
121121   int scroll = state->m_vreg[6];
src/mame/video/funkybee.c
r13798r13799
9595   state->m_bg_tilemap = tilemap_create(machine, get_bg_tile_info, funkybee_tilemap_scan, 8, 8, 32, 32);
9696}
9797
98static void draw_sprites( running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect )
98static void draw_sprites( running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect )
9999{
100100   funkybee_state *state = machine.driver_data<funkybee_state>();
101101   int offs;
r13798r13799
124124   }
125125}
126126
127static void draw_columns( running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect )
127static void draw_columns( running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect )
128128{
129129   funkybee_state *state = machine.driver_data<funkybee_state>();
130130   int offs;
src/mame/video/galastrm.c
r13798r13799
193193   }
194194}
195195
196static void draw_sprites(running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect, const int *primasks, int priority)
196static void draw_sprites(running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect, const int *primasks, int priority)
197197{
198198   galastrm_state *state = machine.driver_data<galastrm_state>();
199199   struct tempsprite *sprite_ptr = state->m_sprite_ptr_pre;
r13798r13799
242242   }
243243}
244244
245static void tc0610_rotate_draw(running_machine &machine, bitmap_t *bitmap, bitmap_t *srcbitmap, const rectangle *clip)
245static void tc0610_rotate_draw(running_machine &machine, bitmap_t *bitmap, bitmap_t *srcbitmap, const rectangle &clip)
246246{
247247   galastrm_state *state = machine.driver_data<galastrm_state>();
248248   poly_extra_data *extra = (poly_extra_data *)poly_get_extra_data(state->m_poly);
r13798r13799
466466   pivlayer[1] = pivlayer[0] ^ 1;
467467   pivlayer[2] = 2;
468468
469   bitmap->fill(0, *cliprect);
469   bitmap->fill(0, cliprect);
470470   priority_bitmap->fill(0, clip);
471471   state->m_tmpbitmaps->fill(0, clip);
472472
r13798r13799
476476#if 0
477477   if (layer[0]==0 && layer[1]==3 && layer[2]==2 && layer[3]==1)
478478   {
479      if (!screen.machine().input().code_pressed(KEYCODE_Z)) tc0480scp_tilemap_draw(tc0480scp, state->m_tmpbitmaps, &clip, layer[0], 0, 1);
480      if (!screen.machine().input().code_pressed(KEYCODE_X)) tc0480scp_tilemap_draw(tc0480scp, state->m_tmpbitmaps, &clip, layer[1], 0, 4);
481      if (!screen.machine().input().code_pressed(KEYCODE_C)) tc0480scp_tilemap_draw(tc0480scp, state->m_tmpbitmaps, &clip, layer[2], 0, 4);
482      if (!screen.machine().input().code_pressed(KEYCODE_V)) tc0480scp_tilemap_draw(tc0480scp, state->m_tmpbitmaps, &clip, layer[3], 0, 4);
479      if (!screen.machine().input().code_pressed(KEYCODE_Z)) tc0480scp_tilemap_draw(tc0480scp, state->m_tmpbitmaps, clip, layer[0], 0, 1);
480      if (!screen.machine().input().code_pressed(KEYCODE_X)) tc0480scp_tilemap_draw(tc0480scp, state->m_tmpbitmaps, clip, layer[1], 0, 4);
481      if (!screen.machine().input().code_pressed(KEYCODE_C)) tc0480scp_tilemap_draw(tc0480scp, state->m_tmpbitmaps, clip, layer[2], 0, 4);
482      if (!screen.machine().input().code_pressed(KEYCODE_V)) tc0480scp_tilemap_draw(tc0480scp, state->m_tmpbitmaps, clip, layer[3], 0, 4);
483483   }
484484   else
485485   {
486      if (!screen.machine().input().code_pressed(KEYCODE_Z)) tc0480scp_tilemap_draw(tc0480scp, state->m_tmpbitmaps, &clip, layer[0], 0, 1);
487      if (!screen.machine().input().code_pressed(KEYCODE_X)) tc0480scp_tilemap_draw(tc0480scp, state->m_tmpbitmaps, &clip, layer[1], 0, 2);
488      if (!screen.machine().input().code_pressed(KEYCODE_C)) tc0480scp_tilemap_draw(tc0480scp, state->m_tmpbitmaps, &clip, layer[2], 0, 4);
489      if (!screen.machine().input().code_pressed(KEYCODE_V)) tc0480scp_tilemap_draw(tc0480scp, state->m_tmpbitmaps, &clip, layer[3], 0, 8);
486      if (!screen.machine().input().code_pressed(KEYCODE_Z)) tc0480scp_tilemap_draw(tc0480scp, state->m_tmpbitmaps, clip, layer[0], 0, 1);
487      if (!screen.machine().input().code_pressed(KEYCODE_X)) tc0480scp_tilemap_draw(tc0480scp, state->m_tmpbitmaps, clip, layer[1], 0, 2);
488      if (!screen.machine().input().code_pressed(KEYCODE_C)) tc0480scp_tilemap_draw(tc0480scp, state->m_tmpbitmaps, clip, layer[2], 0, 4);
489      if (!screen.machine().input().code_pressed(KEYCODE_V)) tc0480scp_tilemap_draw(tc0480scp, state->m_tmpbitmaps, clip, layer[3], 0, 8);
490490   }
491491
492492   if (layer[0]==3 && layer[1]==0 && layer[2]==1 && layer[3]==2)
r13798r13799
506506   }
507507
508508   draw_sprites_pre(screen.machine(), 42-X_OFFSET, -571+Y_OFFSET);
509   draw_sprites(screen.machine(),state->m_tmpbitmaps,&clip,primasks,1);
509   draw_sprites(screen.machine(),state->m_tmpbitmaps,clip,primasks,1);
510510
511511   copybitmap_trans(bitmap,state->m_polybitmap,0,0, 0,0,cliprect,0);
512512   state->m_polybitmap->fill(0, clip);
513513   tc0610_rotate_draw(screen.machine(),state->m_polybitmap,state->m_tmpbitmaps,cliprect);
514514
515   priority_bitmap->fill(0, *cliprect);
515   priority_bitmap->fill(0, cliprect);
516516   draw_sprites(screen.machine(),bitmap,cliprect,primasks,0);
517517
518518   if (!screen.machine().input().code_pressed(KEYCODE_B)) tc0480scp_tilemap_draw(tc0480scp, bitmap, cliprect, layer[4], 0, 0);
r13798r13799
523523#else
524524   if (layer[0]==0 && layer[1]==3 && layer[2]==2 && layer[3]==1)
525525   {
526      tc0480scp_tilemap_draw(tc0480scp, state->m_tmpbitmaps, &clip, layer[0], 0, 1);
527      tc0480scp_tilemap_draw(tc0480scp, state->m_tmpbitmaps, &clip, layer[1], 0, 4);
528      tc0480scp_tilemap_draw(tc0480scp, state->m_tmpbitmaps, &clip, layer[2], 0, 4);
529      tc0480scp_tilemap_draw(tc0480scp, state->m_tmpbitmaps, &clip, layer[3], 0, 4);
526      tc0480scp_tilemap_draw(tc0480scp, state->m_tmpbitmaps, clip, layer[0], 0, 1);
527      tc0480scp_tilemap_draw(tc0480scp, state->m_tmpbitmaps, clip, layer[1], 0, 4);
528      tc0480scp_tilemap_draw(tc0480scp, state->m_tmpbitmaps, clip, layer[2], 0, 4);
529      tc0480scp_tilemap_draw(tc0480scp, state->m_tmpbitmaps, clip, layer[3], 0, 4);
530530   }
531531   else
532532   {
533      tc0480scp_tilemap_draw(tc0480scp, state->m_tmpbitmaps, &clip, layer[0], 0, 1);
534      tc0480scp_tilemap_draw(tc0480scp, state->m_tmpbitmaps, &clip, layer[1], 0, 2);
535      tc0480scp_tilemap_draw(tc0480scp, state->m_tmpbitmaps, &clip, layer[2], 0, 4);
536      tc0480scp_tilemap_draw(tc0480scp, state->m_tmpbitmaps, &clip, layer[3], 0, 8);
533      tc0480scp_tilemap_draw(tc0480scp, state->m_tmpbitmaps, clip, layer[0], 0, 1);
534      tc0480scp_tilemap_draw(tc0480scp, state->m_tmpbitmaps, clip, layer[1], 0, 2);
535      tc0480scp_tilemap_draw(tc0480scp, state->m_tmpbitmaps, clip, layer[2], 0, 4);
536      tc0480scp_tilemap_draw(tc0480scp, state->m_tmpbitmaps, clip, layer[3], 0, 8);
537537   }
538538
539539   if (layer[0]==3 && layer[1]==0 && layer[2]==1 && layer[3]==2)
r13798r13799
553553   }
554554
555555   draw_sprites_pre(screen.machine(), 42-X_OFFSET, -571+Y_OFFSET);
556   draw_sprites(screen.machine(),state->m_tmpbitmaps,&clip,primasks,1);
556   draw_sprites(screen.machine(),state->m_tmpbitmaps,clip,primasks,1);
557557
558558   copybitmap_trans(bitmap,state->m_polybitmap,0,0, 0,0,cliprect,0);
559559   state->m_polybitmap->fill(0, clip);
560560   tc0610_rotate_draw(screen.machine(),state->m_polybitmap,state->m_tmpbitmaps,cliprect);
561561
562   priority_bitmap->fill(0, *cliprect);
562   priority_bitmap->fill(0, cliprect);
563563   draw_sprites(screen.machine(),bitmap,cliprect,primasks,0);
564564
565565   tc0480scp_tilemap_draw(tc0480scp, bitmap, cliprect, layer[4], 0, 0);
src/mame/video/tetrisp2.c
r13798r13799
380380/* sprites should be able to create shadows too, how?
381381  -- it appears that sprites which should be shadows are often rendered *UNDER* the tilemaps, maybe related?
382382*/
383static void tetrisp2_draw_sprites(running_machine &machine, bitmap_t *bitmap, bitmap_t *bitmap_pri, const rectangle *cliprect, UINT8* priority_ram, UINT16 *sprram_top, size_t sprram_size, int gfxnum, int flip)
383static void tetrisp2_draw_sprites(running_machine &machine, bitmap_t *bitmap, bitmap_t *bitmap_pri, const rectangle &cliprect, UINT8* priority_ram, UINT16 *sprram_top, size_t sprram_size, int gfxnum, int flip)
384384{
385385   int tx, ty, sx, sy, flipx, flipy;
386386   int xsize, ysize;
r13798r13799
471471   flipscreen = (state->m_systemregs[0x00] & 0x02);
472472
473473   /* Black background color */
474   bitmap->fill(0, *cliprect);
474   bitmap->fill(0, cliprect);
475475   screen.machine().priority_bitmap->fill(0);
476476
477477   /* Flip Screen */
r13798r13799
556556   flipscreen = (state->m_systemregs[0x00] & 0x02);
557557
558558   /* Black background color */
559   bitmap->fill(0, *cliprect);
559   bitmap->fill(0, cliprect);
560560   screen.machine().priority_bitmap->fill(0);
561561
562562   /* Flip Screen */
r13798r13799
646646   tilemap_set_scrollx(state->m_tilemap_sub_rot, 0, state->m_rocknms_sub_rotregs[ 0 ] + 0x400);
647647   tilemap_set_scrolly(state->m_tilemap_sub_rot, 0, state->m_rocknms_sub_rotregs[ 2 ] + 0x400);
648648
649   bitmap->fill(screen.machine().pens[0x0000], *cliprect);
650   screen.machine().priority_bitmap->fill(0, *cliprect);
649   bitmap->fill(screen.machine().pens[0x0000], cliprect);
650   screen.machine().priority_bitmap->fill(0, cliprect);
651651
652652   asc_pri = scr_pri = rot_pri = 0;
653653
r13798r13799
707707   tilemap_set_scrolly(state->m_tilemap_rot, 0, state->m_rotregs[ 2 ] + 0x400);
708708
709709   /* Black background color */
710   bitmap->fill(screen.machine().pens[0x0000], *cliprect);
711   screen.machine().priority_bitmap->fill(0, *cliprect);
710   bitmap->fill(screen.machine().pens[0x0000], cliprect);
711   screen.machine().priority_bitmap->fill(0, cliprect);
712712
713713   asc_pri = scr_pri = rot_pri = 0;
714714
src/mame/video/lastduel.c
r13798r13799
218218
219219***************************************************************************/
220220
221static void draw_sprites( running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect, int pri )
221static void draw_sprites( running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect, int pri )
222222{
223223   lastduel_state *state = machine.driver_data<lastduel_state>();
224224
src/mame/video/drgnmst.c
r13798r13799
6060   tilemap_mark_tile_dirty(state->m_md_tilemap, offset / 2);
6161}
6262
63static void draw_sprites( running_machine &machine, bitmap_t *bitmap,const rectangle *cliprect )
63static void draw_sprites( running_machine &machine, bitmap_t *bitmap,const rectangle &cliprect )
6464{
6565   drgnmst_state *state = machine.driver_data<drgnmst_state>();
6666   const gfx_element *gfx = machine.gfx[0];
src/mame/video/alpha68k.c
r13798r13799
7575/******************************************************************************/
7676
7777//AT
78static void draw_sprites( running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect, int j, int s, int e )
78static void draw_sprites( running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect, int j, int s, int e )
7979{
8080   alpha68k_state *state = machine.driver_data<alpha68k_state>();
8181   UINT16 *spriteram = state->m_spriteram;
r13798r13799
138138   state->m_last_bank = state->m_bank_base;
139139   tilemap_set_flip_all(screen.machine(), state->m_flipscreen ? (TILEMAP_FLIPY | TILEMAP_FLIPX) : 0);
140140
141   bitmap->fill(2047, *cliprect);
141   bitmap->fill(2047, cliprect);
142142//AT
143143   draw_sprites(screen.machine(), bitmap, cliprect, 0, 0x07c0, 0x0800);
144144   draw_sprites(screen.machine(), bitmap, cliprect, 1, 0x0000, 0x0800);
r13798r13799
221221   }
222222}
223223
224static void draw_sprites_V( running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect, int j, int s, int e, int fx_mask, int fy_mask, int sprite_mask )
224static void draw_sprites_V( running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect, int j, int s, int e, int fx_mask, int fy_mask, int sprite_mask )
225225{
226226   alpha68k_state *state = machine.driver_data<alpha68k_state>();
227227   UINT16 *spriteram = state->m_spriteram;
r13798r13799
286286   state->m_last_bank = state->m_bank_base;
287287   tilemap_set_flip_all(screen.machine(), state->m_flipscreen ? (TILEMAP_FLIPY | TILEMAP_FLIPX) : 0);
288288
289   bitmap->fill(4095, *cliprect);
289   bitmap->fill(4095, cliprect);
290290
291291   /* This appears to be correct priority */
292292   if (state->m_microcontroller_id == 0x8814) /* Sky Adventure */
r13798r13799
326326   state->m_last_bank = state->m_bank_base;
327327   tilemap_set_flip_all(screen.machine(), state->m_flipscreen ? (TILEMAP_FLIPY | TILEMAP_FLIPX) : 0);
328328
329   bitmap->fill(4095, *cliprect);
329   bitmap->fill(4095, cliprect);
330330
331331   /* This appears to be correct priority */
332332   draw_sprites_V(screen.machine(), bitmap, cliprect, 0, 0x07c0, 0x0800, 0x4000, 0x8000, 0x3fff);
r13798r13799
340340
341341/******************************************************************************/
342342//AT
343static void draw_sprites_I( running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect, int c, int d, int yshift )
343static void draw_sprites_I( running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect, int c, int d, int yshift )
344344{
345345   alpha68k_state *state = machine.driver_data<alpha68k_state>();
346346   UINT16 *spriteram = state->m_spriteram;
r13798r13799
373373   alpha68k_state *state = screen.machine().driver_data<alpha68k_state>();
374374   int yshift = (state->m_microcontroller_id == 0x890a) ? 1 : 0; // The Next Space is 1 pixel off
375375
376   bitmap->fill(get_black_pen(screen.machine()), *cliprect);
376   bitmap->fill(get_black_pen(screen.machine()), cliprect);
377377
378378   /* This appears to be correct priority */
379379   draw_sprites_I(screen.machine(), bitmap, cliprect, 2, 0x0800, yshift);
r13798r13799
448448   *bank = (data >> 11 & 4) | (data >> 10 & 3);
449449}
450450
451static void kyros_draw_sprites( running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect, int c, int d )
451static void kyros_draw_sprites( running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect, int c, int d )
452452{
453453   alpha68k_state *state = machine.driver_data<alpha68k_state>();
454454   UINT16 *spriteram = state->m_spriteram;
r13798r13799
505505{
506506   alpha68k_state *state = screen.machine().driver_data<alpha68k_state>();
507507   colortable_entry_set_value(screen.machine().colortable, 0x100, *state->m_videoram & 0xff);
508   bitmap->fill(0x100, *cliprect); //AT
508   bitmap->fill(0x100, cliprect); //AT
509509
510510   kyros_draw_sprites(screen.machine(), bitmap, cliprect, 2, 0x0800);
511511   kyros_draw_sprites(screen.machine(), bitmap, cliprect, 3, 0x0c00);
r13798r13799
515515
516516/******************************************************************************/
517517
518static void sstingry_draw_sprites( running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect, int c, int d )
518static void sstingry_draw_sprites( running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect, int c, int d )
519519{
520520//AT
521521   alpha68k_state *state = machine.driver_data<alpha68k_state>();
r13798r13799
565565{
566566   alpha68k_state *state = screen.machine().driver_data<alpha68k_state>();
567567   colortable_entry_set_value(screen.machine().colortable, 0x100, *state->m_videoram & 0xff);
568   bitmap->fill(0x100, *cliprect); //AT
568   bitmap->fill(0x100, cliprect); //AT
569569
570570   sstingry_draw_sprites(screen.machine(), bitmap, cliprect, 2, 0x0800);
571571   sstingry_draw_sprites(screen.machine(), bitmap, cliprect, 3, 0x0c00);
src/mame/video/freekick.c
r13798r13799
2929   tilemap_mark_tile_dirty(state->m_freek_tilemap, offset & 0x3ff);
3030}
3131
32static void gigas_draw_sprites( running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect )
32static void gigas_draw_sprites( running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect )
3333{
3434   freekick_state *state = machine.driver_data<freekick_state>();
3535   int offs;
r13798r13799
6464}
6565
6666
67static void pbillrd_draw_sprites( running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect )
67static void pbillrd_draw_sprites( running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect )
6868{
6969   freekick_state *state = machine.driver_data<freekick_state>();
7070   int offs;
r13798r13799
100100
101101
102102
103static void freekick_draw_sprites( running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect )
103static void freekick_draw_sprites( running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect )
104104{
105105   freekick_state *state = machine.driver_data<freekick_state>();
106106   int offs;
src/mame/video/cischeat.c
r13798r13799
715715/*  Draw the road in the given bitmap. The priority1 and priority2 parameters
716716    specify the range of lines to draw  */
717717
718static void cischeat_draw_road(running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect, int road_num, int priority1, int priority2, int transparency)
718static void cischeat_draw_road(running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect, int road_num, int priority1, int priority2, int transparency)
719719{
720720   cischeat_state *state = machine.driver_data<cischeat_state>();
721721   int curr_code,sx,sy;
722722   int min_priority, max_priority;
723723
724   rectangle rect      =   *cliprect;
724   rectangle rect      =   cliprect;
725725   gfx_element *gfx      =   machine.gfx[(road_num & 1)?5:4];
726726
727727   UINT16 *roadram         =   state->m_roadram[road_num & 1];
r13798r13799
757757
758758      for (sx = -(xscroll%TILE_SIZE) ; sx <= max_x ; sx +=TILE_SIZE)
759759      {
760         drawgfx_transpen(bitmap,&rect,gfx,
760         drawgfx_transpen(bitmap,rect,gfx,
761761               curr_code++,
762762               attr,
763763               0,0,
r13798r13799
805805/*  Draw the road in the given bitmap. The priority1 and priority2 parameters
806806    specify the range of lines to draw  */
807807
808static void f1gpstar_draw_road(running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect, int road_num, int priority1, int priority2, int transparency)
808static void f1gpstar_draw_road(running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect, int road_num, int priority1, int priority2, int transparency)
809809{
810810   cischeat_state *state = machine.driver_data<cischeat_state>();
811811   int sx,sy;
812812   int xstart;
813813   int min_priority, max_priority;
814814
815   rectangle rect      =   *cliprect;
815   rectangle rect      =   cliprect;
816816   gfx_element *gfx      =   machine.gfx[(road_num & 1)?5:4];
817817
818818   UINT16 *roadram         =   state->m_roadram[road_num & 1];
r13798r13799
864864      /* Draw the line */
865865      for (sx = xstart ; sx <= max_x ; sx += xdim)
866866      {
867         drawgfxzoom_transpen(bitmap,&rect,gfx,
867         drawgfxzoom_transpen(bitmap,rect,gfx,
868868                  code++,
869869                  attr >> 8,
870870                  0,0,
r13798r13799
921921    sprites whose priority nibble is between 0 and 15 and whose
922922    colour code's high bit is set.  */
923923
924static void cischeat_draw_sprites(running_machine &machine, bitmap_t *bitmap , const rectangle *cliprect, int priority1, int priority2)
924static void cischeat_draw_sprites(running_machine &machine, bitmap_t *bitmap , const rectangle &cliprect, int priority1, int priority2)
925925{
926926   cischeat_state *state = machine.driver_data<cischeat_state>();
927927   int x, sx, flipx, xzoom, xscale, xdim, xnum, xstart, xend, xinc;
r13798r13799
10771077
10781078***************************************************************************/
10791079
1080static void bigrun_draw_sprites(running_machine &machine, bitmap_t *bitmap , const rectangle *cliprect, int priority1, int priority2)
1080static void bigrun_draw_sprites(running_machine &machine, bitmap_t *bitmap , const rectangle &cliprect, int priority1, int priority2)
10811081{
10821082   cischeat_state *state = machine.driver_data<cischeat_state>();
10831083   int x, sx, flipx, xzoom, xscale, xdim, xnum, xstart, xend, xinc;
r13798r13799
12651265   cischeat_tmap_SET_SCROLL(1)
12661266   cischeat_tmap_SET_SCROLL(2)
12671267
1268   bitmap->fill(0, *cliprect);
1268   bitmap->fill(0, cliprect);
12691269
12701270   for (i = 7; i >= 4; i--)
12711271   {                                 /* bitmap, road, min_priority, max_priority, transparency */
r13798r13799
13191319   cischeat_tmap_SET_SCROLL(1)
13201320   cischeat_tmap_SET_SCROLL(2)
13211321
1322   bitmap->fill(0, *cliprect);
1322   bitmap->fill(0, cliprect);
13231323
13241324                              /* bitmap, road, priority, transparency */
13251325   if (state->m_active_layers & 0x10)   cischeat_draw_road(screen.machine(),bitmap,cliprect,0,7,5,FALSE);
r13798r13799
13271327
13281328   flag = 0;
13291329   cischeat_tmap_DRAW(0)
1330//  else bitmap->fill(0, *cliprect);
1330//  else bitmap->fill(0, cliprect);
13311331   cischeat_tmap_DRAW(1)
13321332
13331333   if (state->m_active_layers & 0x08)   cischeat_draw_sprites(screen.machine(),bitmap,cliprect,15,3);
r13798r13799
13761376   cischeat_tmap_SET_SCROLL(1);
13771377   cischeat_tmap_SET_SCROLL(2);
13781378
1379   bitmap->fill(0, *cliprect);
1379   bitmap->fill(0, cliprect);
13801380
13811381/*  1: clouds 5, grad 7, road 0     2: clouds 5, grad 7, road 0, tunnel roof 0 */
13821382
r13798r13799
13861386
13871387   flag = 0;
13881388   cischeat_tmap_DRAW(0)
1389//  else bitmap->fill(0, *cliprect);
1389//  else bitmap->fill(0, cliprect);
13901390   cischeat_tmap_DRAW(1)
13911391
13921392   /* road 1!! 0!! */               /* bitmap, road, min_priority, max_priority, transparency */
r13798r13799
14531453   cischeat_tmap_SET_SCROLL(0)
14541454   cischeat_tmap_SET_SCROLL(2)
14551455
1456   bitmap->fill(0, *cliprect);
1456   bitmap->fill(0, cliprect);
14571457
14581458   flag = 0;
14591459   cischeat_tmap_DRAW(0)
src/mame/video/namcos22.c
r13798r13799
726726      }
727727   }
728728
729   poly_render_triangle_fan(state->m_poly, bitmap, &mClip.scissor, renderscanline_uvi_full, 4, clipverts, clipv);
729   poly_render_triangle_fan(state->m_poly, bitmap, mClip.scissor, renderscanline_uvi_full, 4, clipverts, clipv);
730730}
731731
732732static void renderscanline_sprite(void *destbase, INT32 scanline, const poly_extent *extent, const void *extradata, int threadid)
r13798r13799
843843         rgb_comp_to_rgbint(&extra->fogColor, mixer.rFogColor, mixer.gFogColor, mixer.bFogColor);
844844      }
845845
846      poly_render_triangle_fan(state->m_poly, dest_bmp, &mClip.scissor, renderscanline_sprite, 2, 4, vert);
846      poly_render_triangle_fan(state->m_poly, dest_bmp, mClip.scissor, renderscanline_sprite, 2, 4, vert);
847847   }
848848} /* poly3d_DrawSprite */
849849
r13798r13799
15071507DrawSpritesHelper(
15081508   running_machine &machine,
15091509   bitmap_t *bitmap,
1510   const rectangle *cliprect,
1510   const rectangle &cliprect,
15111511   UINT32 *pBase,
15121512   const UINT32 *pSource,
15131513   const UINT32 *pPal,
r13798r13799
16411641} /* DrawSpritesHelper */
16421642
16431643static void
1644DrawSprites( running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect )
1644DrawSprites( running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect )
16451645{
16461646   namcos22_state *state = machine.driver_data<namcos22_state>();
16471647   UINT32 *spriteram32 = state->m_spriteram;
r13798r13799
19571957   }
19581958}
19591959
1960static void namcos22s_mix_textlayer( running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect, int prival )
1960static void namcos22s_mix_textlayer( running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect, int prival )
19611961{
19621962   namcos22_state *state = machine.driver_data<namcos22_state>();
19631963   const pen_t *pens = machine.pens;
r13798r13799
20412041   }
20422042}
20432043
2044static void namcos22_mix_textlayer( running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect )
2044static void namcos22_mix_textlayer( running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect )
20452045{
20462046   namcos22_state *state = machine.driver_data<namcos22_state>();
20472047   const pen_t *pens = machine.pens;
r13798r13799
20992099   }
21002100}
21012101
2102static void DrawCharacterLayer(running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect )
2102static void DrawCharacterLayer(running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect )
21032103{
21042104   namcos22_state *state = machine.driver_data<namcos22_state>();
21052105   int scroll_x = (state->m_tilemapattr[0]>>16) - 0x35c;
r13798r13799
28172817   UpdateVideoMixer(screen.machine());
28182818   UpdatePalette(screen.machine());
28192819   namcos22s_recalc_czram(screen.machine());
2820   screen.machine().priority_bitmap->fill(0, *cliprect);
2820   screen.machine().priority_bitmap->fill(0, cliprect);
28212821
28222822   // background color
28232823   rgbint bg_color;
r13798r13799
28282828      rgb_comp_to_rgbint(&fade_color, mixer.rFadeColor, mixer.gFadeColor, mixer.bFadeColor);
28292829      rgbint_blend(&bg_color, &fade_color, 0xff - mixer.fadeFactor);
28302830   }
2831   bitmap->fill(rgbint_to_rgb(&bg_color), *cliprect);
2831   bitmap->fill(rgbint_to_rgb(&bg_color), cliprect);
28322832
28332833   // layers
28342834   UINT8 layer = nthbyte(state->m_gamma,0x1f);
r13798r13799
28982898{
28992899   UpdateVideoMixer(screen.machine());
29002900   UpdatePalette(screen.machine());
2901   screen.machine().priority_bitmap->fill(0, *cliprect);
2902   bitmap->fill(get_black_pen(screen.machine()), *cliprect);
2901   screen.machine().priority_bitmap->fill(0, cliprect);
2902   bitmap->fill(get_black_pen(screen.machine()), cliprect);
29032903   DrawPolygons(screen.machine(), bitmap);
29042904   RenderScene(screen.machine(), bitmap);
29052905   DrawCharacterLayer(screen.machine(), bitmap, cliprect);
src/mame/video/redclash.c
r13798r13799
183183   tilemap_set_transparent_pen(state->m_fg_tilemap, 0);
184184}
185185
186static void draw_sprites( running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect )
186static void draw_sprites( running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect )
187187{
188188   ladybug_state *state = machine.driver_data<ladybug_state>();
189189   UINT8 *spriteram = state->m_spriteram;
r13798r13799
267267   }
268268}
269269
270static void draw_bullets( running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect )
270static void draw_bullets( running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect )
271271{
272272   ladybug_state *state = machine.driver_data<ladybug_state>();
273273   int offs;
r13798r13799
283283         sx = 240 - sx;
284284      }
285285
286      if (sx >= cliprect->min_x && sx <= cliprect->max_x &&
287         sy >= cliprect->min_y && sy <= cliprect->max_y)
286      if (sx >= cliprect.min_x && sx <= cliprect.max_x &&
287         sy >= cliprect.min_y && sy <= cliprect.max_y)
288288         bitmap->pix16(sy, sx) = 0x19;
289289   }
290290}
r13798r13799
360360/* Space Raider doesn't use the Va bit, and it is also set up to */
361361/* window the stars to a certain x range */
362362
363void redclash_draw_stars( running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect, UINT8 palette_offset, UINT8 sraider, UINT8 firstx, UINT8 lastx )
363void redclash_draw_stars( running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect, UINT8 palette_offset, UINT8 sraider, UINT8 firstx, UINT8 lastx )
364364{
365365   ladybug_state *redclash = machine.driver_data<ladybug_state>();
366366   int i;
r13798r13799
396396      else
397397         vcond = yloc & 0x01;
398398
399      if (xloc >= cliprect->min_x && xloc <= cliprect->max_x && yloc >= cliprect->min_y && yloc <= cliprect->max_y)
399      if (xloc >= cliprect.min_x && xloc <= cliprect.max_x && yloc >= cliprect.min_y && yloc <= cliprect.max_y)
400400      {
401401         if ((hcond ^ vcond) == 0)
402402         {
r13798r13799
427427{
428428   ladybug_state *state = screen.machine().driver_data<ladybug_state>();
429429
430   bitmap->fill(get_black_pen(screen.machine()), *cliprect);
430   bitmap->fill(get_black_pen(screen.machine()), cliprect);
431431   redclash_draw_stars(screen.machine(), bitmap, cliprect, 0x60, 0, 0x00, 0xff);
432432   draw_sprites(screen.machine(), bitmap, cliprect);
433433   draw_bullets(screen.machine(), bitmap, cliprect);
src/mame/video/vicdual.c
r13798r13799
3333{
3434   vicdual_state *state = screen.machine().driver_data<vicdual_state>();
3535   UINT8 x = 0;
36   UINT8 y = cliprect->min_y;
36   UINT8 y = cliprect.min_y;
3737   UINT8 video_data = 0;
3838
3939   while (1)
r13798r13799
6666      if (x == 0)
6767      {
6868         /* end of region to update? */
69         if (y == cliprect->max_y)
69         if (y == cliprect.max_y)
7070         {
7171            break;
7272         }
r13798r13799
8585   vicdual_state *state = screen.machine().driver_data<vicdual_state>();
8686   UINT8 *color_prom = (UINT8 *)screen.machine().region("proms")->base();
8787   UINT8 x = 0;
88   UINT8 y = cliprect->min_y;
88   UINT8 y = cliprect.min_y;
8989   UINT8 video_data = 0;
9090   pen_t back_pen = 0;
9191   pen_t fore_pen = 0;
r13798r13799
125125      if (x == 0)
126126      {
127127         /* end of region to update? */
128         if (y == cliprect->max_y)
128         if (y == cliprect.max_y)
129129         {
130130            break;
131131         }
src/mame/video/galaxold.c
r13798r13799
3333static TIMER_CALLBACK( stars_scroll_callback );
3434
3535       void galaxold_init_stars(running_machine &machine, int colors_offset);
36static void     noop_draw_stars(running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect);
37       void galaxold_draw_stars(running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect);
38static void scrambold_draw_stars(running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect);
39static void   rescue_draw_stars(running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect);
40static void  mariner_draw_stars(running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect);
36static void     noop_draw_stars(running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect);
37       void galaxold_draw_stars(running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect);
38static void scrambold_draw_stars(running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect);
39static void   rescue_draw_stars(running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect);
40static void  mariner_draw_stars(running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect);
4141static void start_stars_blink_timer(running_machine &machine, double ra, double rb, double c);
4242static void start_stars_scroll_timer(running_machine &machine);
4343
4444/* bullets circuit */
45static void galaxold_draw_bullets(running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect, int offs, int x, int y);
46static void scrambold_draw_bullets(running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect, int offs, int x, int y);
47static void darkplnt_draw_bullets(running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect, int offs, int x, int y);
48static void dambustr_draw_bullets(running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect, int offs, int x, int y);
45static void galaxold_draw_bullets(running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect, int offs, int x, int y);
46static void scrambold_draw_bullets(running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect, int offs, int x, int y);
47static void darkplnt_draw_bullets(running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect, int offs, int x, int y);
48static void dambustr_draw_bullets(running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect, int offs, int x, int y);
4949
5050/* background circuit */
51static void galaxold_draw_background(running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect);
52static void scrambold_draw_background(running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect);
53static void  ad2083_draw_background(running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect);
54static void  mariner_draw_background(running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect);
55static void stratgyx_draw_background(running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect);
56static void  minefld_draw_background(running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect);
57static void   rescue_draw_background(running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect);
58static void dambustr_draw_background(running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect);
51static void galaxold_draw_background(running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect);
52static void scrambold_draw_background(running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect);
53static void  ad2083_draw_background(running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect);
54static void  mariner_draw_background(running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect);
55static void stratgyx_draw_background(running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect);
56static void  minefld_draw_background(running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect);
57static void   rescue_draw_background(running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect);
58static void dambustr_draw_background(running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect);
5959
6060
6161
r13798r13799
613613}
614614
615615#ifdef UNUSED_FUNCTION
616static void theend_draw_bullets(running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect, int offs, int x, int y)
616static void theend_draw_bullets(running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect, int offs, int x, int y)
617617{
618618   int i;
619619
r13798r13799
623623   {
624624      x--;
625625
626      if ((x >= cliprect->min_x) && (x <= cliprect->max_x) && (y >= cliprect->min_y) && (y <= cliprect->max_y))
626      if ((x >= cliprect.min_x) && (x <= cliprect.max_x) && (y >= cliprect.min_y) && (y <= cliprect.max_y))
627627         bitmap->pix16(y, x) = BULLETS_COLOR_BASE;
628628   }
629629}
r13798r13799
675675
676676
677677
678static void rockclim_draw_background(running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect)
678static void rockclim_draw_background(running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect)
679679{
680680   galaxold_state *state = machine.driver_data<galaxold_state>();
681681   tilemap_draw(bitmap,cliprect,state->m_rockclim_tilemap, 0,0);
r13798r13799
11341134
11351135/* bullet drawing functions */
11361136
1137static void galaxold_draw_bullets(running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect, int offs, int x, int y)
1137static void galaxold_draw_bullets(running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect, int offs, int x, int y)
11381138{
11391139   int i;
11401140
r13798r13799
11431143   {
11441144      x--;
11451145
1146      if ((x >= cliprect->min_x) && (x <= cliprect->max_x) && (y >= cliprect->min_y) && (y <= cliprect->max_y))
1146      if ((x >= cliprect.min_x) && (x <= cliprect.max_x) && (y >= cliprect.min_y) && (y <= cliprect.max_y))
11471147      {
11481148         int color;
11491149
r13798r13799
11561156   }
11571157}
11581158
1159static void scrambold_draw_bullets(running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect, int offs, int x, int y)
1159static void scrambold_draw_bullets(running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect, int offs, int x, int y)
11601160{
11611161   galaxold_state *state = machine.driver_data<galaxold_state>();
11621162   if (state->m_flipscreen_x)  x++;
11631163
11641164   x = x - 6;
11651165
1166   if ((x >= cliprect->min_x) && (x <= cliprect->max_x) && (y >= cliprect->min_y) && (y <= cliprect->max_y))
1166   if ((x >= cliprect.min_x) && (x <= cliprect.max_x) && (y >= cliprect.min_y) && (y <= cliprect.max_y))
11671167      /* yellow bullets */
11681168      bitmap->pix16(y, x) = BULLETS_COLOR_BASE;
11691169}
11701170
1171static void darkplnt_draw_bullets(running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect, int offs, int x, int y)
1171static void darkplnt_draw_bullets(running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect, int offs, int x, int y)
11721172{
11731173   galaxold_state *state = machine.driver_data<galaxold_state>();
11741174   if (state->m_flipscreen_x)  x++;
11751175
11761176   x = x - 6;
11771177
1178   if ((x >= cliprect->min_x) && (x <= cliprect->max_x) && (y >= cliprect->min_y) && (y <= cliprect->max_y))
1178   if ((x >= cliprect.min_x) && (x <= cliprect.max_x) && (y >= cliprect.min_y) && (y <= cliprect.max_y))
11791179      bitmap->pix16(y, x) = 32 + state->m_darkplnt_bullet_color;
11801180}
11811181
1182static void dambustr_draw_bullets(running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect, int offs, int x, int y)
1182static void dambustr_draw_bullets(running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect, int offs, int x, int y)
11831183{
11841184   int i, color;
11851185
r13798r13799
12001200         x--;
12011201      }
12021202
1203      if ((x >= cliprect->min_x) && (x <= cliprect->max_x) && (y >= cliprect->min_y) && (y <= cliprect->max_y))
1203      if ((x >= cliprect.min_x) && (x <= cliprect.max_x) && (y >= cliprect.min_y) && (y <= cliprect.max_y))
12041204         bitmap->pix16(y, x) = color;
12051205   }
12061206}
r13798r13799
12091209
12101210/* background drawing functions */
12111211
1212static void galaxold_draw_background(running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect)
1212static void galaxold_draw_background(running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect)
12131213{
12141214   /* plain black background */
1215   bitmap->fill(0, *cliprect);
1215   bitmap->fill(0, cliprect);
12161216}
12171217
1218static void scrambold_draw_background(running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect)
1218static void scrambold_draw_background(running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect)
12191219{
12201220   galaxold_state *state = machine.driver_data<galaxold_state>();
12211221   if (state->m_background_enable)
1222      bitmap->fill(BACKGROUND_COLOR_BASE, *cliprect);
1222      bitmap->fill(BACKGROUND_COLOR_BASE, cliprect);
12231223   else
1224      bitmap->fill(0, *cliprect);
1224      bitmap->fill(0, cliprect);
12251225}
12261226
1227static void ad2083_draw_background(running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect)
1227static void ad2083_draw_background(running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect)
12281228{
12291229   galaxold_state *state = machine.driver_data<galaxold_state>();
12301230   int color = (state->m_background_blue << 2) | (state->m_background_green << 1) | state->m_background_red;
12311231
1232   bitmap->fill(BACKGROUND_COLOR_BASE + color, *cliprect);
1232   bitmap->fill(BACKGROUND_COLOR_BASE + color, cliprect);
12331233}
12341234
1235static void stratgyx_draw_background(running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect)
1235static void stratgyx_draw_background(running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect)
12361236{
12371237   galaxold_state *state = machine.driver_data<galaxold_state>();
12381238   UINT8 x;
r13798r13799
12691269   }
12701270}
12711271
1272static void minefld_draw_background(running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect)
1272static void minefld_draw_background(running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect)
12731273{
12741274   galaxold_state *state = machine.driver_data<galaxold_state>();
12751275   if (state->m_background_enable)
r13798r13799
12871287      bitmap->plot_box(248, 0, 16, 256, base);
12881288   }
12891289   else
1290      bitmap->fill(0, *cliprect);
1290      bitmap->fill(0, cliprect);
12911291}
12921292
1293static void rescue_draw_background(running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect)
1293static void rescue_draw_background(running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect)
12941294{
12951295   galaxold_state *state = machine.driver_data<galaxold_state>();
12961296   if (state->m_background_enable)
r13798r13799
13071307      bitmap->plot_box(248, 0, 16, 256, base);
13081308   }
13091309   else
1310      bitmap->fill(0, *cliprect);
1310      bitmap->fill(0, cliprect);
13111311}
13121312
1313static void mariner_draw_background(running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect)
1313static void mariner_draw_background(running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect)
13141314{
13151315   galaxold_state *state = machine.driver_data<galaxold_state>();
13161316   int base = BACKGROUND_COLOR_BASE;
r13798r13799
13541354   }
13551355}
13561356
1357static void dambustr_draw_background(running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect)
1357static void dambustr_draw_background(running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect)
13581358{
13591359   galaxold_state *state = machine.driver_data<galaxold_state>();
13601360   int base = BACKGROUND_COLOR_BASE;
r13798r13799
13741374
13751375}
13761376
1377static void dambustr_draw_upper_background(running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect)
1377static void dambustr_draw_upper_background(running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect)
13781378{
13791379   galaxold_state *state = machine.driver_data<galaxold_state>();
13801380   rectangle clip;
r13798r13799
13851385      clip.max_x = state->m_dambustr_bg_split_line;
13861386      clip.min_y = 0;
13871387      clip.max_y = 255;
1388      copybitmap(bitmap, state->m_dambustr_tmpbitmap, 0, 0, 0, 0, &clip);
1388      copybitmap(bitmap, state->m_dambustr_tmpbitmap, 0, 0, 0, 0, clip);
13891389   }
13901390   else
13911391   {
r13798r13799
13931393      clip.max_x = 254 - state->m_dambustr_bg_split_line;
13941394      clip.min_y = 0;
13951395      clip.max_y = 255;
1396      copybitmap(bitmap, state->m_dambustr_tmpbitmap, 0, 0, 0, 0, &clip);
1396      copybitmap(bitmap, state->m_dambustr_tmpbitmap, 0, 0, 0, 0, clip);
13971397   }
13981398}
13991399
r13798r13799
14741474   }
14751475}
14761476
1477static void plot_star(galaxold_state *state, bitmap_t *bitmap, int x, int y, int color, const rectangle *cliprect)
1477static void plot_star(galaxold_state *state, bitmap_t *bitmap, int x, int y, int color, const rectangle &cliprect)
14781478{
14791479   if (state->m_flipscreen_x)
14801480      x = 255 - x;
r13798r13799
14821482   if (state->m_flipscreen_y)
14831483      y = 255 - y;
14841484
1485   if ((x >= cliprect->min_x) && (x <= cliprect->max_x) && (y >= cliprect->min_y) && (y <= cliprect->max_y))
1485   if ((x >= cliprect.min_x) && (x <= cliprect.max_x) && (y >= cliprect.min_y) && (y <= cliprect.max_y))
14861486      bitmap->pix16(y, x) = state->m_stars_colors_start + color;
14871487}
14881488
1489static void noop_draw_stars(running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect)
1489static void noop_draw_stars(running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect)
14901490{
14911491}
14921492
1493void galaxold_draw_stars(running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect)
1493void galaxold_draw_stars(running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect)
14941494{
14951495   galaxold_state *state = machine.driver_data<galaxold_state>();
14961496   struct star *stars = state->m_stars;
r13798r13799
15191519   }
15201520}
15211521
1522static void scrambold_draw_stars(running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect)
1522static void scrambold_draw_stars(running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect)
15231523{
15241524   galaxold_state *state = machine.driver_data<galaxold_state>();
15251525   struct star *stars = state->m_stars;
r13798r13799
15651565   }
15661566}
15671567
1568static void rescue_draw_stars(running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect)
1568static void rescue_draw_stars(running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect)
15691569{
15701570   galaxold_state *state = machine.driver_data<galaxold_state>();
15711571   struct star *stars = state->m_stars;
r13798r13799
16131613   }
16141614}
16151615
1616static void mariner_draw_stars(running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect)
1616static void mariner_draw_stars(running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect)
16171617{
16181618   galaxold_state *state = machine.driver_data<galaxold_state>();
16191619   struct star *stars = state->m_stars;
r13798r13799
17121712   SET_TILE_INFO(2, code, 0, 0);
17131713}
17141714
1715static void draw_bullets_common(running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect)
1715static void draw_bullets_common(running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect)
17161716{
17171717   galaxold_state *state = machine.driver_data<galaxold_state>();
17181718   int offs;
r13798r13799
17931793      if (offs < 3*4)  sy++;
17941794
17951795
1796      drawgfx_transpen(bitmap, state->m_flipscreen_x ? &spritevisibleareaflipx : &spritevisiblearea, machine.gfx[1],
1796      drawgfx_transpen(bitmap, state->m_flipscreen_x ? spritevisibleareaflipx : spritevisiblearea, machine.gfx[1],
17971797            code,color,
17981798            flipx,flipy,
17991799            sx,sy,0);
r13798r13799
18131813   }
18141814
18151815
1816   tilemap_draw(bitmap, 0, state->m_bg_tilemap, 0, 0);
1816   tilemap_draw(bitmap, cliprect, state->m_bg_tilemap, 0, 0);
18171817
18181818   if (state->m_draw_bullets)
18191819   {
r13798r13799
18451845   }
18461846
18471847   /* save the background for drawing it again later, if background has priority over characters */
1848   copybitmap(state->m_dambustr_tmpbitmap, bitmap, 0, 0, 0, 0, NULL);
1848   copybitmap(state->m_dambustr_tmpbitmap, bitmap, 0, 0, 0, 0, state->m_dambustr_tmpbitmap->cliprect());
18491849
1850   tilemap_draw(bitmap, 0, state->m_bg_tilemap, 0, 0);
1850   tilemap_draw(bitmap, cliprect, state->m_bg_tilemap, 0, 0);
18511851
18521852   if (state->m_draw_bullets)
18531853   {
r13798r13799
18711871         };
18721872      };
18731873      tilemap_mark_all_tiles_dirty(state->m_dambustr_tilemap2);
1874      tilemap_draw(bitmap, 0, state->m_dambustr_tilemap2, 0, 0);
1874      tilemap_draw(bitmap, cliprect, state->m_dambustr_tilemap2, 0, 0);
18751875   };
18761876
18771877   return 0;
src/mame/video/centiped.c
r13798r13799
433433{
434434   centiped_state *state = screen.machine().driver_data<centiped_state>();
435435   UINT8 *spriteram = state->m_spriteram;
436   rectangle spriteclip = *cliprect;
436   rectangle spriteclip = cliprect;
437437   int offs;
438438
439439   /* draw the background */
r13798r13799
455455      int x = spriteram[offs + 0x20];
456456      int y = 240 - spriteram[offs + 0x10];
457457
458      drawgfx_transmask(bitmap, &spriteclip, screen.machine().gfx[1], code, color, flipx, flipy, x, y, state->m_penmask[color & 0x3f]);
458      drawgfx_transmask(bitmap, spriteclip, screen.machine().gfx[1], code, color, flipx, flipy, x, y, state->m_penmask[color & 0x3f]);
459459   }
460460   return 0;
461461}
r13798r13799
511511{
512512   centiped_state *state = screen.machine().driver_data<centiped_state>();
513513   UINT8 *spriteram = state->m_spriteram;
514   rectangle spriteclip = *cliprect;
514   rectangle spriteclip = cliprect;
515515
516516   int offs;
517517
r13798r13799
533533      int x = spriteram[offs + 0x20];
534534      int y = 240 - spriteram[offs + 0x10];
535535
536      drawgfx_transpen(bitmap, &spriteclip, screen.machine().gfx[1], code, color & 0x3f, 1, flipy, x, y, 0);
536      drawgfx_transpen(bitmap, spriteclip, screen.machine().gfx[1], code, color & 0x3f, 1, flipy, x, y, 0);
537537   }
538538   return 0;
539539}
r13798r13799
546546{
547547   centiped_state *state = screen.machine().driver_data<centiped_state>();
548548   UINT8 *spriteram = state->m_spriteram;
549   rectangle spriteclip = *cliprect;
549   rectangle spriteclip = cliprect;
550550   int offs;
551551
552552   /* draw the background */
r13798r13799
571571         flipy = !flipy;
572572      }
573573
574      drawgfx_transmask(bitmap, &spriteclip, screen.machine().gfx[1], code, color, flipx, flipy, x, y, state->m_penmask[color & 0x3f]);
574      drawgfx_transmask(bitmap, spriteclip, screen.machine().gfx[1], code, color, flipx, flipy, x, y, state->m_penmask[color & 0x3f]);
575575   }
576576   return 0;
577577}
src/mame/video/wgp.c
r13798r13799
346346     2, 2, 3, 3,
347347     2, 2, 3, 3 };
348348
349static void draw_sprites( running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect, int y_offs )
349static void draw_sprites( running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect, int y_offs )
350350{
351351   wgp_state *state = machine.driver_data<wgp_state>();
352352   UINT16 *spriteram = state->m_spriteram;
r13798r13799
518518
519519
520520
521static void wgp_piv_layer_draw( running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect, int layer, int flags, UINT32 priority )
521static void wgp_piv_layer_draw( running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect, int layer, int flags, UINT32 priority )
522522{
523523   wgp_state *state = machine.driver_data<wgp_state>();
524524   bitmap_t *srcbitmap = tilemap_get_pixmap(state->m_piv_tilemap[layer]);
r13798r13799
538538   int flipscreen = 0;   /* n/a */
539539   int machine_flip = 0;   /* for  ROT 180 ? */
540540
541   UINT16 screen_width = cliprect->max_x - cliprect->min_x + 1;
542   UINT16 min_y = cliprect->min_y;
543   UINT16 max_y = cliprect->max_y;
541   UINT16 screen_width = cliprect.max_x - cliprect.min_x + 1;
542   UINT16 min_y = cliprect.min_y;
543   UINT16 max_y = cliprect.max_y;
544544
545545   int width_mask = 0x3ff;
546546
r13798r13799
683683
684684   tc0100scn_tilemap_update(state->m_tc0100scn);
685685
686   bitmap->fill(0, *cliprect);
686   bitmap->fill(0, cliprect);
687687
688688   layer[0] = 0;
689689   layer[1] = 1;
src/mame/video/welltris.c
r13798r13799
2929
3030
3131/* Sprite Drawing is pretty much the same as fromance.c */
32static void draw_sprites(running_machine &machine, bitmap_t *bitmap,const rectangle *cliprect)
32static void draw_sprites(running_machine &machine, bitmap_t *bitmap,const rectangle &cliprect)
3333{
3434   static const UINT8 zoomtable[16] = { 0,7,14,20,25,30,34,38,42,46,49,52,54,57,59,61 };
3535   welltris_state *state = machine.driver_data<welltris_state>();
r13798r13799
224224   tilemap_set_transparent_pen(state->m_char_tilemap, 15);
225225}
226226
227static void draw_background(running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect)
227static void draw_background(running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect)
228228{
229229   welltris_state *state = machine.driver_data<welltris_state>();
230230   int x, y;
src/mame/video/sprint8.c
r13798r13799
128128}
129129
130130
131static void draw_sprites(running_machine &machine, bitmap_t* bitmap, const rectangle *cliprect)
131static void draw_sprites(running_machine &machine, bitmap_t* bitmap, const rectangle &cliprect)
132132{
133133   sprint8_state *state = machine.driver_data<sprint8_state>();
134134   int i;
r13798r13799
175175   int y;
176176   const rectangle &visarea = screen.machine().primary_screen->visible_area();
177177
178   tilemap_draw(state->m_helper2, &visarea, state->m_tilemap2, 0, 0);
178   tilemap_draw(state->m_helper2, visarea, state->m_tilemap2, 0, 0);
179179
180180   state->m_helper1->fill(0x20, visarea);
181181
182   draw_sprites(screen.machine(), state->m_helper1, &visarea);
182   draw_sprites(screen.machine(), state->m_helper1, visarea);
183183
184184   for (y = visarea.min_y; y <= visarea.max_y; y++)
185185   {
src/mame/video/ssv.c
r13798r13799
141141#endif
142142
143143
144static void ssv_drawgfx(   bitmap_t *bitmap, const rectangle *cliprect, const gfx_element *gfx,
144static void ssv_drawgfx(   bitmap_t *bitmap, const rectangle &cliprect, const gfx_element *gfx,
145145               UINT32 code,UINT32 color,int flipx,int flipy,int x0,int y0,
146146               int shadow )
147147{
r13798r13799
164164#define SSV_DRAWGFX(SETPIXELCOLOR)                                    \
165165   for ( sy = y0; sy != y1; sy += dy )                                 \
166166   {                                                         \
167      if ( sy >= cliprect->min_y && sy <= cliprect->max_y )               \
167      if ( sy >= cliprect.min_y && sy <= cliprect.max_y )               \
168168      {                                                      \
169169         source   =   addr;                                       \
170170         dest   =   &bitmap->pix16(sy);                     \
r13798r13799
173173         {                                                   \
174174            pen = *source++;                                    \
175175                                                            \
176            if ( pen && sx >= cliprect->min_x && sx <= cliprect->max_x )   \
176            if ( pen && sx >= cliprect.min_x && sx <= cliprect.max_x )   \
177177               SETPIXELCOLOR                                    \
178178         }                                                   \
179179      }                                                      \
r13798r13799
606606
607607/* Draw a tilemap sprite */
608608
609static void draw_row(running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect, int sx, int sy, int scroll)
609static void draw_row(running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect, int sx, int sy, int scroll)
610610{
611611   ssv_state *state = machine.driver_data<ssv_state>();
612612   UINT16 *spriteram16 = state->m_spriteram;
r13798r13799
635635
636636   /* .. and clip it against the visible screen */
637637
638   if (clip.min_x > cliprect->max_x)   return;
639   if (clip.min_y > cliprect->max_y)   return;
638   if (clip.min_x > cliprect.max_x)   return;
639   if (clip.min_y > cliprect.max_y)   return;
640640
641   if (clip.max_x < cliprect->min_x)   return;
642   if (clip.max_y < cliprect->min_y)   return;
641   if (clip.max_x < cliprect.min_x)   return;
642   if (clip.max_y < cliprect.min_y)   return;
643643
644   if (clip.min_x < cliprect->min_x)   clip.min_x = cliprect->min_x;
645   if (clip.max_x > cliprect->max_x)   clip.max_x = cliprect->max_x;
644   if (clip.min_x < cliprect.min_x)   clip.min_x = cliprect.min_x;
645   if (clip.max_x > cliprect.max_x)   clip.max_x = cliprect.max_x;
646646
647   if (clip.min_y < cliprect->min_y)   clip.min_y = cliprect->min_y;
648   if (clip.max_y > cliprect->max_y)   clip.max_y = cliprect->max_y;
647   if (clip.min_y < cliprect.min_y)   clip.min_y = cliprect.min_y;
648   if (clip.max_y > cliprect.max_y)   clip.max_y = cliprect.max_y;
649649
650650   /* Get the scroll data */
651651   x    = ssv_scroll[ scroll * 4 + 0 ];   // x scroll
r13798r13799
725725         {
726726            for (ty = ystart; ty != yend; ty += yinc)
727727            {
728               ssv_drawgfx( bitmap, &clip, machine.gfx[gfx],
728               ssv_drawgfx( bitmap, clip, machine.gfx[gfx],
729729                                 code++,
730730                                 color,
731731                                 flipx, flipy,
r13798r13799
741741
742742/* Draw the "background layer" using multiple tilemap sprites */
743743
744static void draw_layer(running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect, int  nr)
744static void draw_layer(running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect, int  nr)
745745{
746746   int sy;
747747   for ( sy = 0; sy <= machine.primary_screen->visible_area().max_y; sy += 0x40 )
r13798r13799
750750
751751/* Draw sprites in the sprites list */
752752
753static void draw_sprites(running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect)
753static void draw_sprites(running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect)
754754{
755755   /* Sprites list */
756756   ssv_state *state = machine.driver_data<ssv_state>();
r13798r13799
10421042        E.h                             Unused
10431043
10441044*/
1045static void gdfs_draw_zooming_sprites(running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect, int priority)
1045static void gdfs_draw_zooming_sprites(running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect, int priority)
10461046{
10471047   /* Sprites list */
10481048
r13798r13799
12091209   state->m_shadow_pen_mask = (1 << state->m_shadow_pen_shift) - 1;
12101210
12111211   /* The background color is the first one in the palette */
1212   bitmap->fill(0, *cliprect);
1212   bitmap->fill(0, cliprect);
12131213
12141214   // used by twineag2 and ultrax
1215   clip.min_x = (cliprect->max_x / 2 + state->m_scroll[0x62/2]) * 2 - state->m_scroll[0x64/2] * 2 + 2;
1216   clip.max_x = (cliprect->max_x / 2 + state->m_scroll[0x62/2]) * 2 - state->m_scroll[0x62/2] * 2 + 1;
1217   clip.min_y = (cliprect->max_y     + state->m_scroll[0x6a/2])     - state->m_scroll[0x6c/2]     + 1;
1218   clip.max_y = (cliprect->max_y     + state->m_scroll[0x6a/2])     - state->m_scroll[0x6a/2]        ;
1215   clip.min_x = (cliprect.max_x / 2 + state->m_scroll[0x62/2]) * 2 - state->m_scroll[0x64/2] * 2 + 2;
1216   clip.max_x = (cliprect.max_x / 2 + state->m_scroll[0x62/2]) * 2 - state->m_scroll[0x62/2] * 2 + 1;
1217   clip.min_y = (cliprect.max_y     + state->m_scroll[0x6a/2])     - state->m_scroll[0x6c/2]     + 1;
1218   clip.max_y = (cliprect.max_y     + state->m_scroll[0x6a/2])     - state->m_scroll[0x6a/2]        ;
12191219
12201220//  printf("%04x %04x %04x %04x\n",clip.min_x, clip.max_x, clip.min_y, clip.max_y);
12211221
12221222   if (clip.min_x < 0) clip.min_x = 0;
12231223   if (clip.min_y < 0) clip.min_y = 0;
1224   if (clip.max_x > cliprect->max_x) clip.max_x = cliprect->max_x;
1225   if (clip.max_y > cliprect->max_y) clip.max_y = cliprect->max_y;
1224   if (clip.max_x > cliprect.max_x) clip.max_x = cliprect.max_x;
1225   if (clip.max_y > cliprect.max_y) clip.max_y = cliprect.max_y;
12261226
12271227   if (clip.min_x > clip.max_x)
12281228      clip.min_x = clip.max_x;
r13798r13799
12321232   if (!state->m_enable_video)
12331233      return 0;
12341234
1235   draw_layer(screen.machine(), bitmap, &clip, 0);   // "background layer"
1235   draw_layer(screen.machine(), bitmap, clip, 0);   // "background layer"
12361236
1237   draw_sprites(screen.machine(), bitmap, &clip);   // sprites list
1237   draw_sprites(screen.machine(), bitmap, clip);   // sprites list
12381238
12391239
12401240   return 0;
src/mame/video/dec0.c
r13798r13799
157157
158158   /* This game doesn't have the extra playfield chip on the game board, but
159159    the palette does show through. */
160   bitmap->fill(screen.machine().pens[768], *cliprect);
160   bitmap->fill(screen.machine().pens[768], cliprect);
161161   screen.machine().device<deco_bac06_device>("tilegen2")->deco_bac06_pf_draw(screen.machine(),bitmap,cliprect,0, 0x00, 0x00, 0x00, 0x00);
162162   screen.machine().device<deco_mxc06_device>("spritegen")->draw_sprites(screen.machine(), bitmap, cliprect, state->m_buffered_spriteram, 0x00, 0x00, 0x0f);
163163   screen.machine().device<deco_bac06_device>("tilegen1")->deco_bac06_pf_draw(screen.machine(),bitmap,cliprect,0, 0x00, 0x00, 0x00, 0x00);
src/mame/video/taitoair.c
r13798r13799
6969  Screen refresh
7070***************************************************************************/
7171
72static void draw_sprites( running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect, int priority )
72static void draw_sprites( running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect, int priority )
7373{
7474   /* Y chain size is 16/32?/64/64? pixels. X chain size
7575       is always 64 pixels. */
r13798r13799
182182   }
183183}
184184
185static void fill_slope( bitmap_t *bitmap, const rectangle *cliprect, int color, INT32 x1, INT32 x2, INT32 sl1, INT32 sl2, INT32 y1, INT32 y2, INT32 *nx1, INT32 *nx2 )
185static void fill_slope( bitmap_t *bitmap, const rectangle &cliprect, int color, INT32 x1, INT32 x2, INT32 sl1, INT32 sl2, INT32 y1, INT32 y2, INT32 *nx1, INT32 *nx2 )
186186{
187   if (y1 > cliprect->max_y)
187   if (y1 > cliprect.max_y)
188188      return;
189189
190   if (y2 <= cliprect->min_y)
190   if (y2 <= cliprect.min_y)
191191   {
192192      int delta = y2 - y1;
193193      *nx1 = x1 + delta * sl1;
r13798r13799
198198   if (y1 < -1000000 || y1 > 1000000)
199199      return;
200200
201   if (y2 > cliprect->max_y)
202      y2 = cliprect->max_y + 1;
201   if (y2 > cliprect.max_y)
202      y2 = cliprect.max_y + 1;
203203
204   if (y1 < cliprect->min_y)
204   if (y1 < cliprect.min_y)
205205   {
206      int delta = cliprect->min_y - y1;
206      int delta = cliprect.min_y - y1;
207207      x1 += delta * sl1;
208208      x2 += delta * sl2;
209      y1 = cliprect->min_y;
209      y1 = cliprect.min_y;
210210   }
211211
212212   if (x1 > x2 || (x1==x2 && sl1 > sl2))
r13798r13799
225225
226226   while (y1 < y2)
227227   {
228      if (y1 >= cliprect->min_y)
228      if (y1 >= cliprect.min_y)
229229      {
230230         int xx1 = x1 >> TAITOAIR_FRAC_SHIFT;
231231         int xx2 = x2 >> TAITOAIR_FRAC_SHIFT;
232232         int grad_col;
233233
234         if (xx1 <= cliprect->max_x || xx2 >= cliprect->min_x)
234         if (xx1 <= cliprect.max_x || xx2 >= cliprect.min_x)
235235         {
236            if (xx1 < cliprect->min_x)
237               xx1 = cliprect->min_x;
238            if (xx2 > cliprect->max_x)
239               xx2 = cliprect->max_x;
236            if (xx1 < cliprect.min_x)
237               xx1 = cliprect.min_x;
238            if (xx2 > cliprect.max_x)
239               xx2 = cliprect.max_x;
240240
241241            /* TODO: it's unknown if gradient color applies by global screen Y coordinate or there's a calculation to somewhere ... */
242242            grad_col = (y1 >> 3) & 0x3f;
r13798r13799
257257   *nx2 = x2;
258258}
259259
260static void fill_poly( bitmap_t *bitmap, const rectangle *cliprect, const struct taitoair_poly *q )
260static void fill_poly( bitmap_t *bitmap, const rectangle &cliprect, const struct taitoair_poly *q )
261261{
262262   INT32 sl1, sl2, cury, limy, x1, x2;
263263   int pmin, pmax, i, ps1, ps2;
r13798r13799
286286   if (cury == limy)
287287      return;
288288
289   if (cury > cliprect->max_y)
289   if (cury > cliprect.max_y)
290290      return;
291   if (limy <= cliprect->min_y)
291   if (limy <= cliprect.min_y)
292292      return;
293293
294   if (limy > cliprect->max_y)
295      limy = cliprect->max_y;
294   if (limy > cliprect.max_y)
295      limy = cliprect.max_y;
296296
297297   ps1 = pmin + pcount;
298298   ps2 = pmin;
r13798r13799
374374         /* clear screen fb */
375375         state->m_framebuffer[1]->fill(0, cliprect);
376376         /* copy buffer fb into screen fb (at this stage we are ready to draw) */
377         copybitmap_trans(state->m_framebuffer[1], state->m_framebuffer[0], 0, 0, 0, 0, &cliprect, 0);
377         copybitmap_trans(state->m_framebuffer[1], state->m_framebuffer[0], 0, 0, 0, 0, cliprect, 0);
378378         /* now clear buffer fb */
379379         state->m_framebuffer[0]->fill(0, cliprect);
380380      }
r13798r13799
407407               }
408408               adr--;
409409               state->m_q.pcount = pcount;
410               fill_poly(state->m_framebuffer[0], &cliprect, &state->m_q);
410               fill_poly(state->m_framebuffer[0], cliprect, &state->m_q);
411411            }
412412         }
413413      }
r13798r13799
577577
578578   tc0080vco_tilemap_update(state->m_tc0080vco);
579579
580   bitmap->fill(0, *cliprect);
580   bitmap->fill(0, cliprect);
581581
582582   {
583583      int x,y;
r13798r13799
589589        [0x98000c-f] dword for rotation param 1
590590        */
591591
592      for(y=cliprect->min_y;y<cliprect->max_y/2;y++)
592      for(y=cliprect.min_y;y<cliprect.max_y/2;y++)
593593      {
594         for(x=cliprect->min_x;x<cliprect->max_x;x++)
594         for(x=cliprect.min_x;x<cliprect.max_x;x++)
595595         {
596596            bitmap->pix16(y, x) = 0x2000 + (0x3f - ((y >> 2) & 0x3f));
597597         }
598598      }
599599
600600      #if 0
601      for(y=cliprect->max_y/2;y<cliprect->max_y;y++)
601      for(y=cliprect.max_y/2;y<cliprect.max_y;y++)
602602      {
603         for(x=cliprect->min_x;x<cliprect->max_x;x++)
603         for(x=cliprect.min_x;x<cliprect.max_x;x++)
604604         {
605605            bitmap->pix16(y, x) = 0x2040 + (0x3f - ((y >> 2) & 0x3f));
606606         }
r13798r13799
622622
623623   /* Hacky 3d bitmap */
624624   //copybitmap_trans(bitmap, state->m_buffer3d, 0, 0, 0, 0, cliprect, 0);
625   //state->m_buffer3d->fill(0, *cliprect);
625   //state->m_buffer3d->fill(0, cliprect);
626626
627627   return 0;
628628}
src/mame/video/seta001.c
r13798r13799
198198
199199
200200
201void seta001_device::seta001_draw_background( running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect, int bank_size, int setac_type)
201void seta001_device::seta001_draw_background( running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect, int bank_size, int setac_type)
202202{
203203   int transpen;
204204
r13798r13799
319319}
320320
321321
322void seta001_device::seta001_draw_foreground( running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect, int bank_size)
322void seta001_device::seta001_draw_foreground( running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect, int bank_size)
323323{
324324   int screenflip = (m_spritectrl[0] & 0x40) >> 6;
325325   int i;
r13798r13799
457457
458458}
459459
460void seta001_device::seta001_draw_sprites(running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect, int bank_size, int setac)
460void seta001_device::seta001_draw_sprites(running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect, int bank_size, int setac)
461461{
462462   seta001_draw_background(machine, bitmap, cliprect, bank_size, setac);
463463   seta001_draw_foreground(machine, bitmap, cliprect, bank_size);
src/mame/video/atarig42.c
r13798r13799
186186   bitmap_t *priority_bitmap = screen.machine().priority_bitmap;
187187
188188   /* draw the playfield */
189   priority_bitmap->fill(0, *cliprect);
189   priority_bitmap->fill(0, cliprect);
190190   tilemap_draw(bitmap, cliprect, state->m_playfield_tilemap, 0, 0);
191191   tilemap_draw(bitmap, cliprect, state->m_playfield_tilemap, 1, 1);
192192   tilemap_draw(bitmap, cliprect, state->m_playfield_tilemap, 2, 2);
r13798r13799
199199   /* copy the motion objects on top */
200200   {
201201      bitmap_t *mo_bitmap = atarirle_get_vram(state->m_rle, 0);
202      int left   = cliprect->min_x;
203      int top      = cliprect->min_y;
204      int right   = cliprect->max_x + 1;
205      int bottom   = cliprect->max_y + 1;
202      int left   = cliprect.min_x;
203      int top      = cliprect.min_y;
204      int right   = cliprect.max_x + 1;
205      int bottom   = cliprect.max_y + 1;
206206      int x, y;
207207
208208      /* now blend with the playfield */
src/mame/video/tceptor.c
r13798r13799
440440    z: zoom y
441441*/
442442
443static void draw_sprites(running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect, int sprite_priority)
443static void draw_sprites(running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect, int sprite_priority)
444444{
445445   tceptor_state *state = machine.driver_data<tceptor_state>();
446446   UINT16 *mem1 = &state->m_sprite_ram_buffered[0x000/2];
r13798r13799
511511   {
512512      int x, y;
513513
514      for (x = cliprect->min_x; x <= cliprect->max_x; x++)
515         for (y = cliprect->min_y; y <= cliprect->max_y; y++)
514      for (x = cliprect.min_x; x <= cliprect.max_x; x++)
515         for (y = cliprect.min_y; y <= cliprect.max_y; y++)
516516            if (colortable_entry_get_value(machine.colortable, bitmap->pix16(y, x)) == SPR_MASK_COLOR)
517517               // restore pixel
518518               bitmap->pix16(y, x) = state->m_temp_bitmap->pix16(y, x);
r13798r13799
528528   int bg_center = 144 - ((((state->m_bg1_scroll_x + state->m_bg2_scroll_x ) & 0x1ff) - 288) / 2);
529529
530530   // left background
531   rect = *cliprect;
531   rect = cliprect;
532532   rect.max_x = bg_center;
533533   tilemap_set_scrollx(state->m_bg1_tilemap, 0, state->m_bg1_scroll_x + 12);
534534   tilemap_set_scrolly(state->m_bg1_tilemap, 0, state->m_bg1_scroll_y + 20); //32?
535   tilemap_draw(bitmap, &rect, state->m_bg1_tilemap, 0, 0);
535   tilemap_draw(bitmap, rect, state->m_bg1_tilemap, 0, 0);
536536
537537   // right background
538538   rect.min_x = bg_center;
539   rect.max_x = cliprect->max_x;
539   rect.max_x = cliprect.max_x;
540540   tilemap_set_scrollx(state->m_bg2_tilemap, 0, state->m_bg2_scroll_x + 20);
541541   tilemap_set_scrolly(state->m_bg2_tilemap, 0, state->m_bg2_scroll_y + 20); // 32?
542   tilemap_draw(bitmap, &rect, state->m_bg2_tilemap, 0, 0);
542   tilemap_draw(bitmap, rect, state->m_bg2_tilemap, 0, 0);
543543
544544   for (pri = 0; pri < 8; pri++)
545545   {
src/mame/video/seta001.h
r13798r13799
77   seta001_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
88
99
10   void seta001_draw_sprites(running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect, int bank_size, int setac);
10   void seta001_draw_sprites(running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect, int bank_size, int setac);
1111
1212   void setac_eof( void );
1313   void tnzs_eof( void );
r13798r13799
5252
5353private:
5454
55   void seta001_draw_background( running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect, int bank_size, int setac_type);
56   void seta001_draw_foreground( running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect, int bank_size);
55   void seta001_draw_background( running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect, int bank_size, int setac_type);
56   void seta001_draw_foreground( running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect, int bank_size);
5757
5858};
5959
src/mame/video/cop01.c
r13798r13799
166166
167167***************************************************************************/
168168
169static void draw_sprites( running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect )
169static void draw_sprites( running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect )
170170{
171171   cop01_state *state = machine.driver_data<cop01_state>();
172172   int offs, code, attr, sx, sy, flipx, flipy, color;
src/mame/video/aquarium.c
r13798r13799
44#include "includes/aquarium.h"
55
66/* gcpinbal.c modified */
7static void draw_sprites( running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect, int y_offs )
7static void draw_sprites( running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect, int y_offs )
88{
99   aquarium_state *state = machine.driver_data<aquarium_state>();
1010   int offs, chain_pos;
src/mame/video/metro.c
r13798r13799
439439
440440/* Draw sprites */
441441
442void metro_draw_sprites( running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect )
442void metro_draw_sprites( running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect )
443443{
444444   metro_state *state = machine.driver_data<metro_state>();
445445   UINT8 *base_gfx = machine.region("gfx1")->base();
r13798r13799
590590/* copy a 'window' from the large 2048x2048 (or 4096x4096 for 16x16 tiles) tilemap */
591591
592592
593static void draw_tilemap( running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect, UINT32 flags, UINT32 pcode,
593static void draw_tilemap( running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect, UINT32 flags, UINT32 pcode,
594594                   int sx, int sy, int wx, int wy, int big, UINT16* tilemapram, int layer )
595595{
596596   metro_state *state = machine.driver_data<metro_state>();
r13798r13799
687687}
688688
689689/* Draw all the layers that match the given priority */
690static void draw_layers( running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect, int pri, int layers_ctrl )
690static void draw_layers( running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect, int pri, int layers_ctrl )
691691{
692692   metro_state *state = machine.driver_data<metro_state>();
693693   UINT16 layers_pri = state->m_videoregs[0x10 / 2];
r13798r13799
732732   state->m_sprite_yoffs = state->m_videoregs[0x04 / 2] - (visarea.max_y + 1) / 2;
733733
734734   /* The background color is selected by a register */
735   screen.machine().priority_bitmap->fill(0, *cliprect);
736   bitmap->fill((state->m_videoregs[0x12/2] & 0x0fff) + 0x1000, *cliprect);
735   screen.machine().priority_bitmap->fill(0, cliprect);
736   bitmap->fill((state->m_videoregs[0x12/2] & 0x0fff) + 0x1000, cliprect);
737737
738738   /*  Screen Control Register:
739739
r13798r13799
779779   if (screen.machine().input().code_pressed(KEYCODE_A))   msk |= 8;
780780   if (msk != 0)
781781   {
782      bitmap->fill(0, *cliprect);
782      bitmap->fill(0, cliprect);
783783      layers_ctrl &= msk;
784784   }
785785
src/mame/video/angelkds.c
r13798r13799
140140
141141*/
142142
143static void draw_sprites(running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect, int enable_n)
143static void draw_sprites(running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect, int enable_n)
144144{
145145   angelkds_state *state = machine.driver_data<angelkds_state>();
146146   const UINT8 *source = state->m_spriteram + 0x100 - 4;
r13798r13799
278278   const rectangle &visarea = screen.visible_area();
279279   rectangle clip;
280280
281   bitmap->fill(0x3f, *cliprect); /* is there a register controling the colour?, we currently use the last colour of the tx palette */
281   bitmap->fill(0x3f, cliprect); /* is there a register controling the colour?, we currently use the last colour of the tx palette */
282282
283283   /* draw top of screen */
284284   clip.min_x = 8*0;
r13798r13799
287287   clip.max_y = visarea.max_y;
288288
289289   if ((state->m_layer_ctrl & 0x80) == 0x00)
290      tilemap_draw(bitmap, &clip, state->m_bgtop_tilemap, 0, 0);
290      tilemap_draw(bitmap, clip, state->m_bgtop_tilemap, 0, 0);
291291
292   draw_sprites(screen.machine(), bitmap, &clip, 0x80);
292   draw_sprites(screen.machine(), bitmap, clip, 0x80);
293293
294294   if ((state->m_layer_ctrl & 0x20) == 0x00)
295      tilemap_draw(bitmap, &clip, state->m_tx_tilemap, 0, 0);
295      tilemap_draw(bitmap, clip, state->m_tx_tilemap, 0, 0);
296296
297297   /* draw bottom of screen */
298298   clip.min_x = 8*16;
r13798r13799
301301   clip.max_y = visarea.max_y;
302302
303303   if ((state->m_layer_ctrl & 0x40) == 0x00)
304      tilemap_draw(bitmap, &clip, state->m_bgbot_tilemap, 0, 0);
304      tilemap_draw(bitmap, clip, state->m_bgbot_tilemap, 0, 0);
305305
306   draw_sprites(screen.machine(), bitmap, &clip, 0x40);
306   draw_sprites(screen.machine(), bitmap, clip, 0x40);
307307
308308   if ((state->m_layer_ctrl & 0x20) == 0x00)
309      tilemap_draw(bitmap, &clip, state->m_tx_tilemap, 0, 0);
309      tilemap_draw(bitmap, clip, state->m_tx_tilemap, 0, 0);
310310
311311   return 0;
312312}
src/mame/video/circusc.c
r13798r13799
161161
162162***************************************************************************/
163163
164static void draw_sprites( running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect )
164static void draw_sprites( running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect )
165165{
166166   circusc_state *state = machine.driver_data<circusc_state>();
167167   int offs;
r13798r13799
208208   for (i = 10; i < 32; i++)
209209      tilemap_set_scrolly(state->m_bg_tilemap, i, *state->m_scroll);
210210
211   bitmap->fill(0, *cliprect);
211   bitmap->fill(0, cliprect);
212212   tilemap_draw(bitmap, cliprect, state->m_bg_tilemap, 1, 0);
213213   draw_sprites(screen.machine(), bitmap, cliprect);
214214   tilemap_draw(bitmap, cliprect, state->m_bg_tilemap, 0, 0);
src/mame/video/mikie.c
r13798r13799
145145   state->m_bg_tilemap = tilemap_create(machine, get_bg_tile_info, tilemap_scan_rows, 8, 8, 32, 32);
146146}
147147
148static void draw_sprites(running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect)
148static void draw_sprites(running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect)
149149{
150150   mikie_state *state = machine.driver_data<mikie_state>();
151151   UINT8 *spriteram = state->m_spriteram;
src/mame/video/midvunit.c
r13798r13799
546546#endif
547547
548548   /* determine how many pixels to copy */
549   xoffs = cliprect->min_x;
550   width = cliprect->max_x - xoffs + 1;
549   xoffs = cliprect.min_x;
550   width = cliprect.max_x - xoffs + 1;
551551
552552   /* adjust the offset */
553553   offset += xoffs;
554   offset += 512 * (cliprect->min_y - screen.visible_area().min_y);
554   offset += 512 * (cliprect.min_y - screen.visible_area().min_y);
555555
556556   /* loop over rows */
557   for (y = cliprect->min_y; y <= cliprect->max_y; y++)
557   for (y = cliprect.min_y; y <= cliprect.max_y; y++)
558558   {
559      UINT16 *dest = &bitmap->pix16(y, cliprect->min_x);
559      UINT16 *dest = &bitmap->pix16(y, cliprect.min_x);
560560      for (x = 0; x < width; x++)
561561         *dest++ = state->m_videoram[offset + x] & 0x7fff;
562562      offset += 512;
src/mame/video/opwolf.c
r13798r13799
4646   layer[0] = 0;
4747   layer[1] = 1;
4848
49   screen.machine().priority_bitmap->fill(0, *cliprect);
49   screen.machine().priority_bitmap->fill(0, cliprect);
5050
5151   pc080sn_tilemap_draw(state->m_pc080sn, bitmap, cliprect, layer[0], TILEMAP_DRAW_OPAQUE, 1);
5252   pc080sn_tilemap_draw(state->m_pc080sn, bitmap, cliprect, layer[1], 0, 2);
src/mame/video/surpratk.c
r13798r13799
6868
6969   konami_sortlayers3(layer, state->m_layerpri);
7070
71   screen.machine().priority_bitmap->fill(0, *cliprect);
72   bitmap->fill(16 * bg_colorbase, *cliprect);
71   screen.machine().priority_bitmap->fill(0, cliprect);
72   bitmap->fill(16 * bg_colorbase, cliprect);
7373   k052109_tilemap_draw(state->m_k052109, bitmap, cliprect, layer[0], 0, 1);
7474   k052109_tilemap_draw(state->m_k052109, bitmap, cliprect, layer[1], 0, 2);
7575   k052109_tilemap_draw(state->m_k052109, bitmap, cliprect, layer[2], 0, 4);
src/mame/video/zaccaria.c
r13798r13799
206206offsets 1 and 2 are swapped if accessed from spriteram2
207207
208208*/
209static void draw_sprites(running_machine &machine, bitmap_t *bitmap,const rectangle *cliprect,UINT8 *spriteram,int color,int section)
209static void draw_sprites(running_machine &machine, bitmap_t *bitmap,const rectangle &cliprect,UINT8 *spriteram,int color,int section)
210210{
211211   int offs,o1 = 1,o2 = 2;
212212
src/mame/video/suna16.c
r13798r13799
122122
123123***************************************************************************/
124124
125static void draw_sprites(running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect, UINT16 *sprites, int gfx)
125static void draw_sprites(running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect, UINT16 *sprites, int gfx)
126126{
127127   suna16_state *state = machine.driver_data<suna16_state>();
128128   int offs;
r13798r13799
226226   suna16_state *state = screen.machine().driver_data<suna16_state>();
227227
228228   /* Suna Quiz indicates the background is the last pen */
229   bitmap->fill(0xff, *cliprect);
229   bitmap->fill(0xff, cliprect);
230230   draw_sprites(screen.machine(), bitmap, cliprect, state->m_spriteram, 0);
231231   return 0;
232232}
r13798r13799
246246#endif
247247
248248   /* Suna Quiz indicates the background is the last pen */
249   bitmap->fill(0xff, *cliprect);
249   bitmap->fill(0xff, cliprect);
250250   if (layers_ctrl & 1)   draw_sprites(screen.machine(), bitmap, cliprect, state->m_spriteram,  0);
251251   if (layers_ctrl & 2)   draw_sprites(screen.machine(), bitmap, cliprect, state->m_spriteram2, 1);
252252   return 0;
src/mame/video/speedbal.c
r13798r13799
8484 *                                   *
8585 *************************************/
8686
87static void draw_sprites(running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect)
87static void draw_sprites(running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect)
8888{
8989   speedbal_state *state = machine.driver_data<speedbal_state>();
9090   UINT8 *spriteram = state->m_spriteram;
src/mame/video/shadfrce.c
r13798r13799
113113
114114
115115
116static void draw_sprites(running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect )
116static void draw_sprites(running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect )
117117{
118118
119119   /* | ---- ---- hhhf Fe-Y | ---- ---- yyyy yyyy | ---- ---- TTTT TTTT | ---- ---- tttt tttt |
r13798r13799
165165SCREEN_UPDATE( shadfrce )
166166{
167167   shadfrce_state *state = screen.machine().driver_data<shadfrce_state>();
168   screen.machine().priority_bitmap->fill(0, *cliprect);
168   screen.machine().priority_bitmap->fill(0, cliprect);
169169
170170   if (state->m_video_enable)
171171   {
r13798r13799
176176   }
177177   else
178178   {
179      bitmap->fill(get_black_pen(screen.machine()), *cliprect);
179      bitmap->fill(get_black_pen(screen.machine()), cliprect);
180180   }
181181
182182   return 0;
src/mame/video/tagteam.c
r13798r13799
147147       8, 8, 32, 32);
148148}
149149
150static void draw_sprites(running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect)
150static void draw_sprites(running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect)
151151{
152152   tagteam_state *state = machine.driver_data<tagteam_state>();
153153   int offs;
src/mame/video/bagman.c
r13798r13799
111111}
112112
113113
114static void draw_sprites(running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect)
114static void draw_sprites(running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect)
115115{
116116   bagman_state *state = machine.driver_data<bagman_state>();
117117   UINT8 *spriteram = state->m_spriteram;
r13798r13799
149149SCREEN_UPDATE( bagman )
150150{
151151   bagman_state *state = screen.machine().driver_data<bagman_state>();
152   bitmap->fill(0, *cliprect);
152   bitmap->fill(0, cliprect);
153153   if (*state->m_video_enable == 0)
154154      return 0;
155155
src/mame/video/bigevglf.c
r13798r13799
7272   state->save_pointer(NAME(state->m_vidram), 0x100 * 0x100 * 4);
7373}
7474
75static void draw_sprites( running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect )
75static void draw_sprites( running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect )
7676{
7777   bigevglf_state *state = machine.driver_data<bigevglf_state>();
7878   int i, j;
src/mame/video/inufuku.c
r13798r13799
5555
5656******************************************************************************/
5757
58static void draw_sprites( running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect )
58static void draw_sprites( running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect )
5959{
6060   inufuku_state *state = machine.driver_data<inufuku_state>();
6161   int offs;
r13798r13799
239239   inufuku_state *state = screen.machine().driver_data<inufuku_state>();
240240   int i;
241241
242   bitmap->fill(get_black_pen(screen.machine()), *cliprect);
242   bitmap->fill(get_black_pen(screen.machine()), cliprect);
243243   screen.machine().priority_bitmap->fill(0);
244244
245245   if (state->m_bg_raster)
src/mame/video/commando.c
r13798r13799
105105   tilemap_set_transparent_pen(state->m_fg_tilemap, 3);
106106}
107107
108static void draw_sprites( running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect )
108static void draw_sprites( running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect )
109109{
110110   UINT8 *buffered_spriteram = machine.generic.buffered_spriteram.u8;
111111   int offs;
src/mame/video/atarisy2.c
r13798r13799
327327   int x, y, r;
328328
329329   /* draw the playfield */
330   priority_bitmap->fill(0, *cliprect);
330   priority_bitmap->fill(0, cliprect);
331331   tilemap_draw(bitmap, cliprect, state->m_playfield_tilemap, 0, 0);
332332   tilemap_draw(bitmap, cliprect, state->m_playfield_tilemap, 1, 1);
333333   tilemap_draw(bitmap, cliprect, state->m_playfield_tilemap, 2, 2);
src/mame/video/yunsung8.c
r13798r13799
212212   if (layers_ctrl & 1)
213213      tilemap_draw(bitmap, cliprect, state->m_tilemap_0, 0, 0);
214214   else
215      bitmap->fill(0, *cliprect);
215      bitmap->fill(0, cliprect);
216216
217217   if (layers_ctrl & 2)
218218      tilemap_draw(bitmap, cliprect, state->m_tilemap_1, 0, 0);
src/mame/video/skydiver.c
r13798r13799
168168 *
169169 *************************************/
170170
171static void draw_sprites(running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect)
171static void draw_sprites(running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect)
172172{
173173   skydiver_state *state = machine.driver_data<skydiver_state>();
174174   int pic;
src/mame/video/ninjakd2.c
r13798r13799
413413            {
414414               int const tile = code ^ (x << big_xshift) ^ (y << big_yshift);
415415
416               drawgfx_transpen(bitmap, 0, gfx,
416               drawgfx_transpen(bitmap, bitmap->cliprect(), gfx,
417417                     tile,
418418                     color,
419419                     flipx,flipy,
r13798r13799
452452// This is very hackish.
453453// (Is there a possibility that software can't select it but hardware can?)
454454
455static void erase_sprites(running_machine& machine, bitmap_t* bitmap, const rectangle* cliprect)
455static void erase_sprites(running_machine& machine, bitmap_t* bitmap)
456456{
457457   ninjakd2_state *state = machine.driver_data<ninjakd2_state>();
458458   // if sprite overdraw is disabled, clear the sprite framebuffer
459459   if (!state->m_next_sprite_overdraw_enabled)
460      state->m_sp_bitmap->fill(TRANSPARENTCODE, *cliprect);
460      state->m_sp_bitmap->fill(TRANSPARENTCODE);
461461   else
462462      for (int y = 0; y < state->m_sp_bitmap->height(); ++y)
463463      {
r13798r13799
474474static void update_sprites(running_machine& machine)
475475{
476476   ninjakd2_state *state = machine.driver_data<ninjakd2_state>();
477   erase_sprites(machine, state->m_sp_bitmap, 0);
477   erase_sprites(machine, state->m_sp_bitmap);
478478   draw_sprites(machine, state->m_sp_bitmap);
479479}
480480   ////// Before modified, this was written.
r13798r13799
492492   update_sprites(screen.machine());
493493   state->m_sprites_updated = 1;
494494
495   bitmap->fill(0, *cliprect);
495   bitmap->fill(0, cliprect);
496496
497497   tilemap_draw(bitmap, cliprect, state->m_bg_tilemap, 0, 0);
498498
r13798r13799
509509   update_sprites(screen.machine());
510510   state->m_sprites_updated = 1;
511511
512   bitmap->fill(0, *cliprect);
512   bitmap->fill(0, cliprect);
513513
514514   tilemap_draw(bitmap, cliprect, state->m_bg0_tilemap, 0, 0);
515515
r13798r13799
530530   update_sprites(screen.machine());
531531   state->m_sprites_updated = 1;
532532
533   bitmap->fill(0, *cliprect);
533   bitmap->fill(0, cliprect);
534534
535535   tilemap_draw(bitmap, cliprect, state->m_bg0_tilemap, 0, 0);
536536
src/mame/video/warpwarp.c
r13798r13799
215215
216216***************************************************************************/
217217
218INLINE void geebee_plot(bitmap_t *bitmap, const rectangle *cliprect, int x, int y, pen_t pen)
218INLINE void geebee_plot(bitmap_t *bitmap, const rectangle &cliprect, int x, int y, pen_t pen)
219219{
220   if (x >= cliprect->min_x && x <= cliprect->max_x && y >= cliprect->min_y && y <= cliprect->max_y)
220   if (x >= cliprect.min_x && x <= cliprect.max_x && y >= cliprect.min_y && y <= cliprect.max_y)
221221      bitmap->pix16(y, x) = pen;
222222}
223223
224static void draw_ball(running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect,pen_t pen)
224static void draw_ball(running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect,pen_t pen)
225225{
226226   warpwarp_state *state = machine.driver_data<warpwarp_state>();
227227   if (state->m_ball_on)
src/mame/video/spacefb.c
r13798r13799
138138}
139139
140140
141static void draw_starfield(screen_device &screen, bitmap_t *bitmap, const rectangle *cliprect)
141static void draw_starfield(screen_device &screen, bitmap_t *bitmap, const rectangle &cliprect)
142142{
143143   spacefb_state *state = screen.machine().driver_data<spacefb_state>();
144144   int y;
r13798r13799
147147   get_starfield_pens(state, pens);
148148
149149   /* the shift register is always shifting -- do the portion in the top VBLANK */
150   if (cliprect->min_y == screen.visible_area().min_y)
150   if (cliprect.min_y == screen.visible_area().min_y)
151151   {
152152      int i;
153153
r13798r13799
159159   }
160160
161161   /* visible region of the screen */
162   for (y = cliprect->min_y; y <= cliprect->max_y; y++)
162   for (y = cliprect.min_y; y <= cliprect.max_y; y++)
163163   {
164164      int x;
165165
r13798r13799
182182   }
183183
184184   /* do the shifting in the bottom VBLANK */
185   if (cliprect->max_y == screen.visible_area().max_y)
185   if (cliprect.max_y == screen.visible_area().max_y)
186186   {
187187      int i;
188188      int clock_count = (SPACEFB_HBSTART - SPACEFB_HBEND) * (SPACEFB_VTOTAL - SPACEFB_VBSTART);
r13798r13799
248248}
249249
250250
251static void draw_bullet(running_machine &machine, offs_t offs, pen_t pen, bitmap_t *bitmap, const rectangle *cliprect, int flip)
251static void draw_bullet(running_machine &machine, offs_t offs, pen_t pen, bitmap_t *bitmap, const rectangle &cliprect, int flip)
252252{
253253   spacefb_state *state = machine.driver_data<spacefb_state>();
254254   UINT8 sy;
r13798r13799
270270      else
271271         dy = y;
272272
273      if ((dy > cliprect->min_y) && (dy < cliprect->max_y))
273      if ((dy > cliprect.min_y) && (dy < cliprect.max_y))
274274      {
275275         for (sx = 0; sx < 4; sx++)
276276         {
r13798r13799
300300}
301301
302302
303static void draw_sprite(running_machine &machine, offs_t offs, pen_t *pens, bitmap_t *bitmap, const rectangle *cliprect, int flip)
303static void draw_sprite(running_machine &machine, offs_t offs, pen_t *pens, bitmap_t *bitmap, const rectangle &cliprect, int flip)
304304{
305305   spacefb_state *state = machine.driver_data<spacefb_state>();
306306   UINT8 sy;
r13798r13799
325325      else
326326         dy = y;
327327
328      if ((dy > cliprect->min_y) && (dy < cliprect->max_y))
328      if ((dy > cliprect.min_y) && (dy < cliprect.max_y))
329329      {
330330         for (sx = 0; sx < 8; sx++)
331331         {
r13798r13799
358358}
359359
360360
361static void draw_objects(running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect)
361static void draw_objects(running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect)
362362{
363363   spacefb_state *state = machine.driver_data<spacefb_state>();
364364   pen_t sprite_pens[NUM_SPRITE_PENS];
src/mame/video/m52.c
r13798r13799
303303 *
304304 *************************************/
305305
306static void draw_background(running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect, int xpos, int ypos, int image)
306static void draw_background(running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect, int xpos, int ypos, int image)
307307{
308308   rectangle rect;
309309   const rectangle &visarea = machine.primary_screen->visible_area();
r13798r13799
365365   m52_state *state = screen.machine().driver_data<m52_state>();
366366   int offs;
367367
368   bitmap->fill(0, *cliprect);
368   bitmap->fill(0, cliprect);
369369
370370   if (!(state->m_bgcontrol & 0x20))
371371   {
r13798r13799
396396
397397      /* sprites from offsets $00-$7F are processed in the upper half of the frame */
398398      /* sprites from offsets $80-$FF are processed in the lower half of the frame */
399      clip = *cliprect;
399      clip = cliprect;
400400      if (!(offs & 0x80))
401401         clip.min_y = 0, clip.max_y = 127;
402402      else
r13798r13799
420420#ifdef SPLIT_SPRITES
421421      sect_rect(&clip, cliprect);
422422#else
423      clip = *cliprect;
423      clip = cliprect;
424424#endif
425425
426      drawgfx_transmask(bitmap, &clip, screen.machine().gfx[1],
426      drawgfx_transmask(bitmap, clip, screen.machine().gfx[1],
427427         code, color, flipx, flipy, sx, sy,
428428         colortable_get_transpen_mask(screen.machine().colortable, screen.machine().gfx[1], color, 512 + 32));
429429   }
src/mame/video/jaguar.c
r13798r13799
927927   /* if not enabled, just blank */
928928   if (!(gpu_regs[VMODE] & 1))
929929   {
930      bitmap->fill(0, *cliprect);
930      bitmap->fill(0, cliprect);
931931      return 0;
932932   }
933933
src/mame/video/gng.c
r13798r13799
108108
109109***************************************************************************/
110110
111static void draw_sprites( running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect )
111static void draw_sprites( running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect )
112112{
113113   UINT8 *buffered_spriteram = machine.generic.buffered_spriteram.u8;
114114   const gfx_element *gfx = machine.gfx[2];
src/mame/video/jalblend.c
r13798r13799
8484   return MAKE_RGB(r,g,b);
8585}
8686
87void jal_blend_drawgfx(bitmap_t *dest_bmp,const rectangle *clip,const gfx_element *gfx,
87void jal_blend_drawgfx(bitmap_t *dest_bmp,const rectangle &clip,const gfx_element *gfx,
8888                     UINT32 code,UINT32 color,int flipx,int flipy,int offsx,int offsy,
8989                     int transparent_color)
9090{
r13798r13799
117117      ex = sx + gfx->width;
118118      ey = sy + gfx->height;
119119
120      if (clip)
121      {
122         if (sx < clip->min_x)
123         { /* clip left */
124            int pixels = clip->min_x-sx;
125            sx += pixels;
126            x_index_base += xinc*pixels;
127         }
128         if (sy < clip->min_y)
129         { /* clip top */
130            int pixels = clip->min_y-sy;
131            sy += pixels;
132            y_index += yinc*pixels;
133         }
134         /* NS 980211 - fixed incorrect clipping */
135         if (ex > clip->max_x+1)
136         { /* clip right */
137            ex = clip->max_x+1;
138         }
139         if (ey > clip->max_y+1)
140         { /* clip bottom */
141            ey = clip->max_y+1;
142         }
120      if (sx < clip.min_x)
121      { /* clip left */
122         int pixels = clip.min_x-sx;
123         sx += pixels;
124         x_index_base += xinc*pixels;
143125      }
126      if (sy < clip.min_y)
127      { /* clip top */
128         int pixels = clip.min_y-sy;
129         sy += pixels;
130         y_index += yinc*pixels;
131      }
132      /* NS 980211 - fixed incorrect clipping */
133      if (ex > clip.max_x+1)
134      { /* clip right */
135         ex = clip.max_x+1;
136      }
137      if (ey > clip.max_y+1)
138      { /* clip bottom */
139         ey = clip.max_y+1;
140      }
144141
145142      if (ex > sx)
146143      { /* skip if inner loop doesn't draw anything */
src/mame/video/bfm_adr2.c
r13798r13799
218218{
219219   const rectangle visible1(0, 400-1,  0,  280-1);  //minx,maxx, miny,maxy
220220
221   if (adder2_screen_page_reg & SL_DISPLAY) tilemap_draw(bitmap, &visible1, tilemap1, 0, 0);
222   else                                     tilemap_draw(bitmap, &visible1, tilemap0, 0, 0);
221   if (adder2_screen_page_reg & SL_DISPLAY) tilemap_draw(bitmap, visible1, tilemap1, 0, 0);
222   else                                     tilemap_draw(bitmap, visible1, tilemap0, 0, 0);
223223
224224   return 0;
225225}
src/mame/video/jalblend.h
r13798r13799
22void jal_blend_set(int color, UINT8 val);
33
44rgb_t jal_blend_func(rgb_t dest, rgb_t addMe, UINT8 alpha);
5void jal_blend_drawgfx(bitmap_t *dest_bmp,const rectangle *clip,const gfx_element *gfx,
5void jal_blend_drawgfx(bitmap_t *dest_bmp,const rectangle &clip,const gfx_element *gfx,
66                     UINT32 code,UINT32 color,int flipx,int flipy,int offsx,int offsy,
77                     int transparent_color);
src/mame/video/wc90b.c
r13798r13799
9898
9999***************************************************************************/
100100
101static void draw_sprites(running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect, int priority )
101static void draw_sprites(running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect, int priority )
102102{
103103   wc90b_state *state = machine.driver_data<wc90b_state>();
104104   UINT8 *spriteram = state->m_spriteram;
src/mame/video/kncljoe.c
r13798r13799
180180
181181***************************************************************************/
182182
183static void draw_sprites( running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect )
183static void draw_sprites( running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect )
184184{
185185   kncljoe_state *state = machine.driver_data<kncljoe_state>();
186186   UINT8 *spriteram = state->m_spriteram;
187   rectangle clip = *cliprect;
187   rectangle clip = cliprect;
188188   const gfx_element *gfx = machine.gfx[1 + state->m_sprite_bank];
189189   int i, j;
190190   static const int pribase[4]={0x0180, 0x0080, 0x0100, 0x0000};
r13798r13799
230230         if (sx >= 256-8)
231231            sx -= 256;
232232
233         drawgfx_transpen(bitmap,&clip,gfx,
233         drawgfx_transpen(bitmap,clip,gfx,
234234            code,
235235            color,
236236            flipx,flipy,
src/mame/video/holeland.c
r13798r13799
109109}
110110
111111
112static void holeland_draw_sprites( running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect )
112static void holeland_draw_sprites( running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect )
113113{
114114   holeland_state *state = machine.driver_data<holeland_state>();
115115   UINT8 *spriteram = state->m_spriteram;
r13798r13799
149149   }
150150}
151151
152static void crzrally_draw_sprites( running_machine &machine, bitmap_t *bitmap,const rectangle *cliprect )
152static void crzrally_draw_sprites( running_machine &machine, bitmap_t *bitmap,const rectangle &cliprect )
153153{
154154   holeland_state *state = machine.driver_data<holeland_state>();
155155   UINT8 *spriteram = state->m_spriteram;
src/mame/video/spdodgeb.c
r13798r13799
150150               cliprect,gfx, \
151151               (which+order),color+ 8 * state->m_sprite_palbank,flipx,flipy,sx,sy,0);
152152
153static void draw_sprites(running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect )
153static void draw_sprites(running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect )
154154{
155155   spdodgeb_state *state = machine.driver_data<spdodgeb_state>();
156156   UINT8 *spriteram = state->m_spriteram;
src/mame/video/liberate.c
r13798r13799
290290
291291/***************************************************************************/
292292
293static void liberate_draw_sprites( running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect )
293static void liberate_draw_sprites( running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect )
294294{
295295   liberate_state *state = machine.driver_data<liberate_state>();
296296   UINT8 *spriteram = state->m_spriteram;
r13798r13799
359359   }
360360}
361361
362static void prosport_draw_sprites( running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect )
362static void prosport_draw_sprites( running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect )
363363{
364364   liberate_state *state = machine.driver_data<liberate_state>();
365365   int offs, multi, fx, fy, sx, sy, sy2, code, code2, color, gfx_region;
r13798r13799
424424   }
425425}
426426
427static void boomrang_draw_sprites( running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect, int pri )
427static void boomrang_draw_sprites( running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect, int pri )
428428{
429429   liberate_state *state = machine.driver_data<liberate_state>();
430430   UINT8 *spriteram = state->m_spriteram;
r13798r13799
485485   }
486486}
487487
488static void prosoccr_draw_sprites( running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect )
488static void prosoccr_draw_sprites( running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect )
489489{
490490   liberate_state *state = machine.driver_data<liberate_state>();
491491   UINT8 *spriteram = state->m_spriteram;
r13798r13799
519519   tilemap_set_scrollx(state->m_back_tilemap, 0, -state->m_io_ram[0]);
520520
521521   if (state->m_background_disable)
522      bitmap->fill(32, *cliprect);
522      bitmap->fill(32, cliprect);
523523   else
524524      tilemap_draw(bitmap, cliprect, state->m_back_tilemap, 0, 0);
525525
r13798r13799
537537   int mx, my, tile, offs, gfx_region;
538538   int scrollx, scrolly;
539539
540   bitmap->fill(0, *cliprect);
540   bitmap->fill(0, cliprect);
541541
542542   offs = 0;
543543   /* TODO: what's bits 0 and 2 for? Internal scrolling state? */
r13798r13799
580580   tilemap_set_scrollx(state->m_back_tilemap, 0, -state->m_io_ram[0]);
581581
582582   if (state->m_background_disable)
583      bitmap->fill(32, *cliprect);
583      bitmap->fill(32, cliprect);
584584   else
585585      tilemap_draw(bitmap, cliprect, state->m_back_tilemap, TILEMAP_DRAW_LAYER1, 0);
586586
r13798r13799
600600   tilemap_set_scrollx(state->m_back_tilemap, 0, -state->m_io_ram[0]);
601601
602602   if (state->m_background_disable)
603      bitmap->fill(32, *cliprect);
603      bitmap->fill(32, cliprect);
604604   else
605605      tilemap_draw(bitmap, cliprect, state->m_back_tilemap, 0, 0);
606606
src/mame/video/gunsmoke.c
r13798r13799
140140   colortable_configure_tilemap_groups(machine.colortable, state->m_fg_tilemap, machine.gfx[0], 0x4f);
141141}
142142
143static void draw_sprites( running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect )
143static void draw_sprites( running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect )
144144{
145145   gunsmoke_state *state = machine.driver_data<gunsmoke_state>();
146146   UINT8 *spriteram = state->m_spriteram;
r13798r13799
183183   if (state->m_bgon)
184184      tilemap_draw(bitmap, cliprect, state->m_bg_tilemap, 0, 0);
185185   else
186      bitmap->fill(get_black_pen(screen.machine()), *cliprect);
186      bitmap->fill(get_black_pen(screen.machine()), cliprect);
187187
188188   if (state->m_objon)
189189      draw_sprites(screen.machine(), bitmap, cliprect);
src/mame/video/turbo.c
r13798r13799
421421   int x, y;
422422
423423   /* loop over rows */
424   for (y = cliprect->min_y; y <= cliprect->max_y; y++)
424   for (y = cliprect.min_y; y <= cliprect.max_y; y++)
425425   {
426426      const UINT16 *fore = &fgpixmap->pix16(y);
427427      UINT16 *dest = &bitmap->pix16(y);
r13798r13799
440440      turbo_prepare_sprites(screen.machine(), state, y, &sprinfo);
441441
442442      /* loop over columns */
443      for (x = 0; x <= cliprect->max_x; x += TURBO_X_SCALE)
443      for (x = 0; x <= cliprect.max_x; x += TURBO_X_SCALE)
444444      {
445445         int bacol, red, grn, blu, priority, foreraw, forebits, mx, ix;
446446         int xx = x / TURBO_X_SCALE;
r13798r13799
771771   int x, y;
772772
773773   /* loop over rows */
774   for (y = cliprect->min_y; y <= cliprect->max_y; y++)
774   for (y = cliprect.min_y; y <= cliprect.max_y; y++)
775775   {
776776      const UINT16 *fore = &fgpixmap->pix16(y);
777777      UINT16 *dest = &bitmap->pix16(y);
r13798r13799
782782      subroc3d_prepare_sprites(screen.machine(), state, y, &sprinfo);
783783
784784      /* loop over columns */
785      for (x = 0; x <= cliprect->max_x; x += TURBO_X_SCALE)
785      for (x = 0; x <= cliprect.max_x; x += TURBO_X_SCALE)
786786      {
787787         int offs, finalbits, ix;
788788         UINT8 xx = x / TURBO_X_SCALE;
r13798r13799
991991   int x, y;
992992
993993   /* loop over rows */
994   for (y = cliprect->min_y; y <= cliprect->max_y; y++)
994   for (y = cliprect.min_y; y <= cliprect.max_y; y++)
995995   {
996996      const UINT16 *fore = &fgpixmap->pix16(y);
997997      UINT16 *dest = &bitmap->pix16(y);
r13798r13799
10021002      buckrog_prepare_sprites(screen.machine(), state, y, &sprinfo);
10031003
10041004      /* loop over columns */
1005      for (x = 0; x <= cliprect->max_x; x += TURBO_X_SCALE)
1005      for (x = 0; x <= cliprect.max_x; x += TURBO_X_SCALE)
10061006      {
10071007         UINT8 foreraw, forebits, cd, plb, star, mux;
10081008         UINT8 xx = x / TURBO_X_SCALE;
src/mame/video/cvs.c
r13798r13799
209209
210210      int gfxnum = (code < ram_based_char_start_indices[state->m_character_banking_mode]) ? 0 : 1;
211211
212      drawgfx_opaque(state->m_background_bitmap, 0, screen.machine().gfx[gfxnum],
212      drawgfx_opaque(state->m_background_bitmap, state->m_background_bitmap->cliprect(), screen.machine().gfx[gfxnum],
213213            code, color,
214214            0, 0,
215215            x, y);
r13798r13799
225225            collision_color = 0x102;
226226      }
227227
228      drawgfx_opaque(state->m_collision_background, 0, screen.machine().gfx[gfxnum],
228      drawgfx_opaque(state->m_collision_background, state->m_collision_background->cliprect(), screen.machine().gfx[gfxnum],
229229            code, collision_color,
230230            0, 0,
231231            x, y);
r13798r13799
280280   {
281281      int y;
282282
283      for (y = cliprect->min_y; y <= cliprect->max_y; y++)
283      for (y = cliprect.min_y; y <= cliprect.max_y; y++)
284284      {
285285         int x;
286286
287         for (x = cliprect->min_x; x <= cliprect->max_x; x++)
287         for (x = cliprect.min_x; x <= cliprect.max_x; x++)
288288         {
289289            int pixel0 = s2636_0_bitmap->pix16(y, x);
290290            int pixel1 = s2636_1_bitmap->pix16(y, x);
r13798r13799
329329            if (flip_screen_y_get(screen.machine()))
330330               y = ~y;
331331
332            if ((y >= cliprect->min_y) && (y <= cliprect->max_y) &&
332            if ((y >= cliprect.min_y) && (y <= cliprect.max_y) &&
333333               (colortable_entry_get_value(screen.machine().colortable, bitmap->pix16(y, x)) == 0))
334334               bitmap->pix16(y, x) = BULLET_STAR_PEN;
335335         }
src/mame/video/seta.c
r13798r13799
770770
771771
772772
773static void draw_tilemap_palette_effect(running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect, tilemap_t *tilemap, int scrollx, int scrolly, int gfxnum, int flipscreen)
773static void draw_tilemap_palette_effect(running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect, tilemap_t *tilemap, int scrollx, int scrolly, int gfxnum, int flipscreen)
774774{
775775   int y;
776776   const gfx_element *gfx_tilemap = machine.gfx[gfxnum];
r13798r13799
783783   width_mask = src_bitmap->width() - 1;
784784   height_mask = src_bitmap->height() - 1;
785785
786   for (y = cliprect->min_y; y <= cliprect->max_y; y++)
786   for (y = cliprect.min_y; y <= cliprect.max_y; y++)
787787   {
788788      UINT16 *dest = &bitmap->pix16(y);
789789
790790      int x;
791      for (x = cliprect->min_x; x <= cliprect->max_x; x++)
791      for (x = cliprect.min_x; x <= cliprect.max_x; x++)
792792      {
793793         if(!flipscreen)
794794         {
r13798r13799
831831SCREEN_UPDATE( seta_no_layers )
832832{
833833   set_pens(screen.machine());
834   bitmap->fill(0x1f0, *cliprect);
834   bitmap->fill(0x1f0, cliprect);
835835
836836   screen.machine().device<seta001_device>("spritegen")->seta001_draw_sprites(screen.machine(),bitmap,cliprect,0x1000, 1);
837837   return 0;
r13798r13799
839839
840840
841841/* For games with 1 or 2 tilemaps */
842void seta_layers_update(screen_device &screen, bitmap_t *bitmap, const rectangle *cliprect, int sprite_bank_size, int sprite_setac )
842void seta_layers_update(screen_device &screen, bitmap_t *bitmap, const rectangle &cliprect, int sprite_bank_size, int sprite_setac )
843843{
844844   seta_state *state = screen.machine().driver_data<seta_state>();
845845   int layers_ctrl = -1;
r13798r13799
944944}
945945#endif
946946
947   bitmap->fill(0, *cliprect);
947   bitmap->fill(0, cliprect);
948948
949949   if (order & 1)   // swap the layers?
950950   {
r13798r13799
10551055
10561056SCREEN_UPDATE( setaroul )
10571057{
1058   bitmap->fill(0x0, *cliprect);
1058   bitmap->fill(0x0, cliprect);
10591059
10601060   screen.machine().device<seta001_device>("spritegen")->set_fg_yoffsets( -0x12, 0x0e );
10611061   screen.machine().device<seta001_device>("spritegen")->set_bg_yoffsets( 0x1, -0x1 );
src/mame/video/tnzs.c
r13798r13799
4444
4545SCREEN_UPDATE( tnzs )
4646{
47   bitmap->fill(0x1f0, *cliprect);
47   bitmap->fill(0x1f0, cliprect);
4848
4949   screen.machine().device<seta001_device>("spritegen")->set_fg_yoffsets( -0x12, 0x0e );
5050   screen.machine().device<seta001_device>("spritegen")->set_bg_yoffsets( 0x1, -0x1 );
src/mame/video/tp84.c
r13798r13799
152152}
153153
154154
155static void draw_sprites(running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect)
155static void draw_sprites(running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect)
156156{
157157   tp84_state *state = machine.driver_data<tp84_state>();
158158   int offs;
r13798r13799
178178SCREEN_UPDATE( tp84 )
179179{
180180   tp84_state *state = screen.machine().driver_data<tp84_state>();
181   rectangle clip = *cliprect;
181   rectangle clip = cliprect;
182182   const rectangle &visarea = screen.visible_area();
183183
184   if (cliprect->min_y == screen.visible_area().min_y)
184   if (cliprect.min_y == screen.visible_area().min_y)
185185   {
186186      tilemap_mark_all_tiles_dirty_all(screen.machine());
187187
r13798r13799
198198   /* draw top status region */
199199   clip.min_x = visarea.min_x;
200200   clip.max_x = visarea.min_x + 15;
201   tilemap_draw(bitmap, &clip, state->m_fg_tilemap, 0, 0);
201   tilemap_draw(bitmap, clip, state->m_fg_tilemap, 0, 0);
202202
203203   /* draw bottom status region */
204204   clip.min_x = visarea.max_x - 15;
205205   clip.max_x = visarea.max_x;
206   tilemap_draw(bitmap, &clip, state->m_fg_tilemap, 0, 0);
206   tilemap_draw(bitmap, clip, state->m_fg_tilemap, 0, 0);
207207
208208   return 0;
209209}
src/mame/video/vball.c
r13798r13799
114114               cliprect,gfx, \
115115               (which+order),color,flipx,flipy,sx,sy,0);
116116
117static void draw_sprites(running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect)
117static void draw_sprites(running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect)
118118{
119119   vball_state *state = machine.driver_data<vball_state>();
120120   const gfx_element *gfx = machine.gfx[1];
src/mame/video/rohga.c
r13798r13799
2727
2828/******************************************************************************/
2929
30static void rohga_draw_sprites( running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect, const UINT16 *spriteptr, int is_schmeisr )
30static void rohga_draw_sprites( running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect, const UINT16 *spriteptr, int is_schmeisr )
3131{
3232   int offs;
3333
r13798r13799
109109   }
110110}
111111
112static void wizdfire_draw_sprites( running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect, UINT16 *spriteptr, int mode, int bank )
112static void wizdfire_draw_sprites( running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect, UINT16 *spriteptr, int mode, int bank )
113113{
114114   int offs;
115115
r13798r13799
211211   }
212212}
213213
214static void nitrobal_draw_sprites( running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect, const UINT16 *spriteptr, int gfxbank )
214static void nitrobal_draw_sprites( running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect, const UINT16 *spriteptr, int gfxbank )
215215{
216216   rohga_state *state = machine.driver_data<rohga_state>();
217217   int offs, end, inc;
r13798r13799
419419
420420/******************************************************************************/
421421
422static void update_rohga( screen_device &screen, bitmap_t *bitmap, const rectangle *cliprect, int is_schmeisr )
422static void update_rohga( screen_device &screen, bitmap_t *bitmap, const rectangle &cliprect, int is_schmeisr )
423423{
424424   rohga_state *state = screen.machine().driver_data<rohga_state>();
425425   UINT16 flip = deco16ic_pf_control_r(state->m_deco_tilegen1, 0, 0xffff);
r13798r13799
431431   deco16ic_pf_update(state->m_deco_tilegen2, state->m_pf3_rowscroll, state->m_pf4_rowscroll);
432432
433433   /* Draw playfields */
434   screen.machine().priority_bitmap->fill(0, *cliprect);
435   bitmap->fill(screen.machine().pens[768], *cliprect);
434   screen.machine().priority_bitmap->fill(0, cliprect);
435   bitmap->fill(screen.machine().pens[768], cliprect);
436436
437437   switch (priority & 3)
438438   {
r13798r13799
492492   deco16ic_pf_update(state->m_deco_tilegen2, state->m_pf3_rowscroll, state->m_pf4_rowscroll);
493493
494494   /* Draw playfields - Palette of 2nd playfield chip visible if playfields turned off */
495   bitmap->fill(screen.machine().pens[512], *cliprect);
495   bitmap->fill(screen.machine().pens[512], cliprect);
496496
497497   deco16ic_tilemap_2_draw(state->m_deco_tilegen2, bitmap, cliprect, TILEMAP_DRAW_OPAQUE, 0);
498498   wizdfire_draw_sprites(screen.machine(), bitmap, cliprect, screen.machine().generic.buffered_spriteram.u16, 4, 3);
r13798r13799
524524   deco16ic_pf_update(state->m_deco_tilegen2, state->m_pf3_rowscroll, state->m_pf4_rowscroll);
525525
526526   /* Draw playfields - Palette of 2nd playfield chip visible if playfields turned off */
527   bitmap->fill(screen.machine().pens[512], *cliprect);
527   bitmap->fill(screen.machine().pens[512], cliprect);
528528   screen.machine().priority_bitmap->fill(0);
529529   decocomn_clear_sprite_priority_bitmap(state->m_decocomn);
530530
src/mame/video/higemaru.c
r13798r13799
106106   state->m_bg_tilemap = tilemap_create(machine, get_bg_tile_info, tilemap_scan_rows, 8, 8, 32, 32);
107107}
108108
109static void draw_sprites( running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect )
109static void draw_sprites( running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect )
110110{
111111   higemaru_state *state = machine.driver_data<higemaru_state>();
112112   UINT8 *spriteram = state->m_spriteram;
src/mame/video/plygonet.c
r13798r13799
128128   polygonet_state *state = screen.machine().driver_data<polygonet_state>();
129129   device_t *k053936 = screen.machine().device("k053936");
130130   screen.machine().priority_bitmap->fill(0);
131   bitmap->fill(get_black_pen(screen.machine()), *cliprect);
131   bitmap->fill(get_black_pen(screen.machine()), cliprect);
132132
133133   k053936_zoom_draw(k053936, bitmap, cliprect, state->m_roz_tilemap, 0, 0, 0);
134134
src/mame/video/batman.c
r13798r13799
203203   int x, y, r;
204204
205205   /* draw the playfield */
206   priority_bitmap->fill(0, *cliprect);
206   priority_bitmap->fill(0, cliprect);
207207   tilemap_draw(bitmap, cliprect, state->m_playfield_tilemap, 0, 0x00);
208208   tilemap_draw(bitmap, cliprect, state->m_playfield_tilemap, 1, 0x01);
209209   tilemap_draw(bitmap, cliprect, state->m_playfield_tilemap, 2, 0x02);
src/mame/video/nemesis.c
r13798r13799
334334}
335335
336336
337static void draw_sprites( running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect )
337static void draw_sprites( running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect )
338338{
339339   /*
340340     *  16 bytes per sprite, in memory from 56000-56fff
r13798r13799
431431   int offs;
432432   rectangle clip;
433433
434   screen.machine().priority_bitmap->fill(0, *cliprect);
435   bitmap->fill(0, *cliprect);
434   screen.machine().priority_bitmap->fill(0, cliprect);
435   bitmap->fill(0, cliprect);
436436
437437   clip.min_x = 0;
438438   clip.max_x = 255;
r13798r13799
453453      tilemap_set_scrolly(state->m_foreground, offs, state->m_yscroll1[offset_x]);
454454   }
455455
456   for (offs = cliprect->min_y; offs <= cliprect->max_y; offs++)
456   for (offs = cliprect.min_y; offs <= cliprect.max_y; offs++)
457457   {
458458      int i;
459459      int offset_y = offs;
r13798r13799
469469
470470      for (i = 0; i < 4; i += 2)
471471      {
472         tilemap_draw(bitmap, &clip, state->m_background, TILEMAP_DRAW_CATEGORY(i + 0), 1);
473         tilemap_draw(bitmap, &clip, state->m_background, TILEMAP_DRAW_CATEGORY(i + 1), 2);
474         tilemap_draw(bitmap, &clip, state->m_foreground, TILEMAP_DRAW_CATEGORY(i + 0), 1);
475         tilemap_draw(bitmap, &clip, state->m_foreground, TILEMAP_DRAW_CATEGORY(i + 1), 2);
472         tilemap_draw(bitmap, clip, state->m_background, TILEMAP_DRAW_CATEGORY(i + 0), 1);
473         tilemap_draw(bitmap, clip, state->m_background, TILEMAP_DRAW_CATEGORY(i + 1), 2);
474         tilemap_draw(bitmap, clip, state->m_foreground, TILEMAP_DRAW_CATEGORY(i + 0), 1);
475         tilemap_draw(bitmap, clip, state->m_foreground, TILEMAP_DRAW_CATEGORY(i + 1), 2);
476476      }
477477   }
478478
src/mame/video/cheekyms.c
r13798r13799
108108}
109109
110110
111static void draw_sprites( running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect, const gfx_element *gfx, int flip )
111static void draw_sprites( running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect, const gfx_element *gfx, int flip )
112112{
113113   cheekyms_state *state = machine.driver_data<cheekyms_state>();
114114   offs_t offs;
r13798r13799
158158   tilemap_mark_all_tiles_dirty_all(screen.machine());
159159   tilemap_set_flip_all(screen.machine(), flip ? TILEMAP_FLIPX | TILEMAP_FLIPY : 0);
160160
161   bitmap->fill(0, *cliprect);
162   state->m_bitmap_buffer->fill(0, *cliprect);
161   bitmap->fill(0, cliprect);
162   state->m_bitmap_buffer->fill(0, cliprect);
163163
164164   /* sprites go under the playfield */
165165   draw_sprites(screen.machine(), bitmap, cliprect, screen.machine().gfx[1], flip);
r13798r13799
168168   tilemap_draw(state->m_bitmap_buffer, cliprect, state->m_cm_tilemap, 0, 0);
169169
170170   /* draw the tilemap to the final bitmap applying the scroll to the man character */
171   for (y = cliprect->min_y; y <= cliprect->max_y; y++)
171   for (y = cliprect.min_y; y <= cliprect.max_y; y++)
172172   {
173      for (x = cliprect->min_x; x <= cliprect->max_x; x++)
173      for (x = cliprect.min_x; x <= cliprect.max_x; x++)
174174      {
175175         int in_man_area;
176176
src/mame/video/magmax.c
r13798r13799
9696
9797   /* copy the background graphics */
9898   if (*state->m_vreg & 0x40)      /* background disable */
99      bitmap->fill(0, *cliprect);
99      bitmap->fill(0, cliprect);
100100   else
101101   {
102102      int v;
src/mame/video/timelimt.c
r13798r13799
116116}
117117
118118
119static void draw_sprites(running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect)
119static void draw_sprites(running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect)
120120{
121121   timelimt_state *state = machine.driver_data<timelimt_state>();
122122   UINT8 *spriteram = state->m_spriteram;
src/mame/video/warriorb.c
r13798r13799
1717            SPRITE DRAW ROUTINE
1818************************************************************/
1919
20static void draw_sprites( running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect, int x_offs, int y_offs )
20static void draw_sprites( running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect, int x_offs, int y_offs )
2121{
2222   warriorb_state *state = machine.driver_data<warriorb_state>();
2323   UINT16 *spriteram = state->m_spriteram;
r13798r13799
8484                SCREEN REFRESH
8585**************************************************************/
8686
87static UINT32 update_screen(screen_device &screen, bitmap_t *bitmap, const rectangle *cliprect, int xoffs, device_t *tc0100scn)
87static UINT32 update_screen(screen_device &screen, bitmap_t *bitmap, const rectangle &cliprect, int xoffs, device_t *tc0100scn)
8888{
8989   UINT8 layer[3], nodraw;
9090
r13798r13799
9595   layer[2] = 2;
9696
9797   /* Clear priority bitmap */
98   screen.machine().priority_bitmap->fill(0, *cliprect);
98   screen.machine().priority_bitmap->fill(0, cliprect);
9999
100100   /* chip 0 does tilemaps on the left, chip 1 does the ones on the right */
101101   // draw bottom layer
r13798r13799
103103
104104   /* Ensure screen blanked even when bottom layers not drawn due to disable bit */
105105   if (nodraw)
106      bitmap->fill(get_black_pen(screen.machine()), *cliprect);
106      bitmap->fill(get_black_pen(screen.machine()), cliprect);
107107
108108   // draw middle layer
109109   tc0100scn_tilemap_draw(tc0100scn, bitmap, cliprect, layer[1], 0, 1);
src/mame/video/sei_crtc.c
r13798r13799
206206   SET_TILE_INFO(4, tile, color, 0);
207207}
208208
209static void draw_sprites(running_machine &machine, bitmap_t *bitmap,const rectangle *cliprect,int pri)
209static void draw_sprites(running_machine &machine, bitmap_t *bitmap,const rectangle &cliprect,int pri)
210210{
211211   UINT16 *spriteram16 = reinterpret_cast<UINT16 *>(memory_get_shared(machine, "spriteram"));
212212   int offs,fx,fy,x,y,color,sprite;
r13798r13799
271271
272272SCREEN_UPDATE( seibu_crtc )
273273{
274   bitmap->fill(screen.machine().pens[0x7ff], *cliprect); //black pen
274   bitmap->fill(screen.machine().pens[0x7ff], cliprect); //black pen
275275
276276   tilemap_set_scrollx( sc0_tilemap,0, (SEIBU_CRTC_SC0_SX + SEIBU_CRTC_FIX_SX+64) & 0x1ff );
277277   tilemap_set_scrolly( sc0_tilemap,0, (SEIBU_CRTC_SC0_SY + SEIBU_CRTC_FIX_SY+1) & 0x1ff );
src/mame/video/goal92.c
r13798r13799
9292   SET_TILE_INFO(region, tile, color, 0);
9393}
9494
95static void draw_sprites( running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect, int pri )
95static void draw_sprites( running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect, int pri )
9696{
9797   goal92_state *state = machine.driver_data<goal92_state>();
9898   UINT16 *buffered_spriteram16 = state->m_buffered_spriteram;
r13798r13799
169169      tilemap_set_scrolly(state->m_fg_layer, 0, state->m_scrollram[3] + 8);
170170   }
171171
172   bitmap->fill(get_black_pen(screen.machine()), *cliprect);
172   bitmap->fill(get_black_pen(screen.machine()), cliprect);
173173
174174   tilemap_draw(bitmap, cliprect, state->m_bg_layer, 0, 0);
175175   draw_sprites(screen.machine(), bitmap, cliprect, 2);
src/mame/video/deco16ic.c
r13798r13799
358358static void custom_tilemap_draw(
359359   device_t *device,
360360   bitmap_t *bitmap,
361   const rectangle *cliprect,
361   const rectangle &cliprect,
362362   tilemap_t *tilemap0_8x8,
363363   tilemap_t *tilemap0_16x16,
364364   tilemap_t *tilemap1_8x8,
r13798r13799
393393   if (!BIT(control0, 7))
394394      return;
395395
396   int starty = cliprect->min_y;
397   int endy = cliprect->max_y+1;
396   int starty = cliprect.min_y;
397   int endy = cliprect.max_y+1;
398398
399399   width_mask = src_bitmap0->width() - 1;
400400   height_mask = src_bitmap0->height() - 1;
r13798r13799
862862
863863/*****************************************************************************************/
864864
865void deco16ic_tilemap_1_draw( device_t *device, bitmap_t *bitmap, const rectangle *cliprect, int flags, UINT32 priority )
865void deco16ic_tilemap_1_draw( device_t *device, bitmap_t *bitmap, const rectangle &cliprect, int flags, UINT32 priority )
866866{
867867   deco16ic_state *deco16ic = get_safe_token(device);
868868
r13798r13799
879879   }
880880}
881881
882void deco16ic_tilemap_2_draw(device_t *device, bitmap_t *bitmap, const rectangle *cliprect, int flags, UINT32 priority)
882void deco16ic_tilemap_2_draw(device_t *device, bitmap_t *bitmap, const rectangle &cliprect, int flags, UINT32 priority)
883883{
884884   deco16ic_state *deco16ic = get_safe_token(device);
885885
r13798r13799
900900/*****************************************************************************************/
901901
902902// Combines the output of two 4BPP tilemaps into an 8BPP tilemap
903void deco16ic_tilemap_12_combine_draw(device_t *device, bitmap_t *bitmap, const rectangle *cliprect, int flags, UINT32 priority, int is_tattoo)
903void deco16ic_tilemap_12_combine_draw(device_t *device, bitmap_t *bitmap, const rectangle &cliprect, int flags, UINT32 priority, int is_tattoo)
904904{
905905   deco16ic_state *deco16ic = get_safe_token(device);
906906   custom_tilemap_draw(device, bitmap, cliprect, 0, deco16ic->pf1_tilemap_16x16, 0, deco16ic->pf2_tilemap_16x16, deco16ic->pf1_rowscroll_ptr, deco16ic->pf12_control[1], deco16ic->pf12_control[2], deco16ic->pf12_control[5] & 0xff, deco16ic->pf12_control[6] & 0xff, 0xf, 4, 0xff, flags, priority, is_tattoo);
src/mame/video/bishi.c
r13798r13799
6363
6464   konami_sortlayers4(layers, layerpri);
6565
66   screen.machine().priority_bitmap->fill(0, *cliprect);
66   screen.machine().priority_bitmap->fill(0, cliprect);
6767
6868   for (i = 0; i < 4; i++)
6969   {
src/mame/video/1942.c
r13798r13799
198198
199199***************************************************************************/
200200
201static void draw_sprites( running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect )
201static void draw_sprites( running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect )
202202{
203203   _1942_state *state = machine.driver_data<_1942_state>();
204204   int offs;
src/mame/video/poolshrk.c
r13798r13799
3434
3535   tilemap_mark_all_tiles_dirty(state->m_bg_tilemap);
3636
37   bitmap->fill(0, *cliprect);
37   bitmap->fill(0, cliprect);
3838
3939   /* draw sprites */
4040
src/mame/video/deco16ic.h
r13798r13799
7474
7575void deco16ic_pf_update(device_t *device, const UINT16 *rowscroll_1_ptr, const UINT16 *rowscroll_2_ptr);
7676
77void deco16ic_tilemap_1_draw(device_t *device, bitmap_t *bitmap, const rectangle *cliprect, int flags, UINT32 priority);
78void deco16ic_tilemap_2_draw(device_t *device, bitmap_t *bitmap, const rectangle *cliprect, int flags, UINT32 priority);
77void deco16ic_tilemap_1_draw(device_t *device, bitmap_t *bitmap, const rectangle &cliprect, int flags, UINT32 priority);
78void deco16ic_tilemap_2_draw(device_t *device, bitmap_t *bitmap, const rectangle &cliprect, int flags, UINT32 priority);
7979
8080/* used by boogwing, nitrobal */
81void deco16ic_tilemap_12_combine_draw(device_t *device, bitmap_t *bitmap, const rectangle *cliprect, int flags, UINT32 priority, int is_tattoo = false);
81void deco16ic_tilemap_12_combine_draw(device_t *device, bitmap_t *bitmap, const rectangle &cliprect, int flags, UINT32 priority, int is_tattoo = false);
8282
8383/* used by robocop2 */
8484void deco16ic_set_tilemap_colour_mask(device_t *device, int tmap, int mask);
src/mame/video/bloodbro.c
r13798r13799
145145   -------X XXXXXXXX
146146   -------- YYYYYYYY */
147147
148static void bloodbro_draw_sprites(running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect)
148static void bloodbro_draw_sprites(running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect)
149149{
150150   bloodbro_state *state = machine.driver_data<bloodbro_state>();
151151   UINT16 *spriteram16 = state->m_spriteram;
r13798r13799
194194   -------X XXXXXXXX
195195*/
196196
197static void weststry_draw_sprites(running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect)
197static void weststry_draw_sprites(running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect)
198198{
199199   bloodbro_state *state = machine.driver_data<bloodbro_state>();
200200   UINT16 *spriteram16 = state->m_spriteram;
r13798r13799
240240   tilemap_set_scrollx(state->m_fg_tilemap,0,state->m_scroll[0x12]);
241241   tilemap_set_scrolly(state->m_fg_tilemap,0,state->m_scroll[0x13]);
242242
243   screen.machine().priority_bitmap->fill(0, *cliprect);
243   screen.machine().priority_bitmap->fill(0, cliprect);
244244
245245   tilemap_draw(bitmap,cliprect,state->m_bg_tilemap,0,0);
246246   tilemap_draw(bitmap,cliprect,state->m_fg_tilemap,0,1);
r13798r13799
257257//  tilemap_set_scrollx(state->m_fg_tilemap,0,state->m_scroll[0x12]);
258258//  tilemap_set_scrolly(state->m_fg_tilemap,0,state->m_scroll[0x13]);
259259
260   screen.machine().priority_bitmap->fill(0, *cliprect);
260   screen.machine().priority_bitmap->fill(0, cliprect);
261261
262262   tilemap_draw(bitmap,cliprect,state->m_bg_tilemap,0,0);
263263   tilemap_draw(bitmap,cliprect,state->m_fg_tilemap,0,1);
r13798r13799
275275   tilemap_set_scrollx(state->m_fg_tilemap,0,state->m_scroll[0x0a]);
276276   tilemap_set_scrolly(state->m_fg_tilemap,0,state->m_scroll[0x0b]);   /* ? */
277277
278   screen.machine().priority_bitmap->fill(0, *cliprect);
278   screen.machine().priority_bitmap->fill(0, cliprect);
279279
280280   tilemap_draw(bitmap,cliprect,state->m_bg_tilemap,0,0);
281281   tilemap_draw(bitmap,cliprect,state->m_fg_tilemap,0,1);
src/mame/video/raiden.c
r13798r13799
119119   }
120120}
121121
122static void draw_sprites(running_machine &machine, bitmap_t *bitmap,const rectangle *cliprect,int pri_mask)
122static void draw_sprites(running_machine &machine, bitmap_t *bitmap,const rectangle &cliprect,int pri_mask)
123123{
124124   raiden_state *state = machine.driver_data<raiden_state>();
125125   UINT16 *buffered_spriteram16 = machine.generic.buffered_spriteram.u16;
src/mame/video/bombjack.c
r13798r13799
7575   tilemap_set_transparent_pen(state->m_fg_tilemap, 0);
7676}
7777
78static void draw_sprites( running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect )
78static void draw_sprites( running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect )
7979{
8080   bombjack_state *state = machine.driver_data<bombjack_state>();
8181   int offs;
src/mame/video/gridlee.c
r13798r13799
140140   int x, y, i;
141141
142142   /* draw scanlines from the VRAM directly */
143   for (y = cliprect->min_y; y <= cliprect->max_y; y++)
143   for (y = cliprect.min_y; y <= cliprect.max_y; y++)
144144   {
145145      /* non-flipped: draw directly from the bitmap */
146146      if (!state->m_cocktail_flip)
r13798r13799
184184            currxor = 0xff;
185185         }
186186
187         if (ypos >= (16 + GRIDLEE_VBEND) && ypos >= cliprect->min_y && ypos <= cliprect->max_y)
187         if (ypos >= (16 + GRIDLEE_VBEND) && ypos >= cliprect.min_y && ypos <= cliprect.max_y)
188188         {
189189            int currx = xpos;
190190
src/mame/video/rallyx.c
r13798r13799
446446}
447447
448448
449static void plot_star( running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect, int x, int y, int color )
449static void plot_star( running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect, int x, int y, int color )
450450{
451   if (y < cliprect->min_y || y > cliprect->max_y ||
452      x < cliprect->min_x || x > cliprect->max_x)
451   if (y < cliprect.min_y || y > cliprect.max_y ||
452      x < cliprect.min_x || x > cliprect.max_x)
453453      return;
454454
455455   if (flip_screen_x_get(machine))
r13798r13799
462462      bitmap->pix16(y, x) = STARS_COLOR_BASE + color;
463463}
464464
465static void draw_stars( running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect )
465static void draw_stars( running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect )
466466{
467467   rallyx_state *state = machine.driver_data<rallyx_state>();
468468   int offs;
r13798r13799
478478}
479479
480480
481static void rallyx_draw_sprites( running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect, int displacement )
481static void rallyx_draw_sprites( running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect, int displacement )
482482{
483483   rallyx_state *state = machine.driver_data<rallyx_state>();
484484   UINT8 *spriteram = state->m_spriteram;
r13798r13799
505505   }
506506}
507507
508static void locomotn_draw_sprites( running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect, int displacement )
508static void locomotn_draw_sprites( running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect, int displacement )
509509{
510510   rallyx_state *state = machine.driver_data<rallyx_state>();
511511   UINT8 *spriteram = state->m_spriteram;
r13798r13799
529529   }
530530}
531531
532static void rallyx_draw_bullets( running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect, int transpen )
532static void rallyx_draw_bullets( running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect, int transpen )
533533{
534534   rallyx_state *state = machine.driver_data<rallyx_state>();
535535   int offs;
r13798r13799
560560   }
561561}
562562
563static void jungler_draw_bullets( running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect, int transpen )
563static void jungler_draw_bullets( running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect, int transpen )
564564{
565565   rallyx_state *state = machine.driver_data<rallyx_state>();
566566   int offs;
r13798r13799
589589   }
590590}
591591
592static void locomotn_draw_bullets( running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect, int transpen )
592static void locomotn_draw_bullets( running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect, int transpen )
593593{
594594   rallyx_state *state = machine.driver_data<rallyx_state>();
595595   int offs;
r13798r13799
632632   rallyx_state *state = screen.machine().driver_data<rallyx_state>();
633633   /* the radar tilemap is just 8x32. We rely on the tilemap code to repeat it across
634634       the screen, and clip it to only the position where it is supposed to be shown */
635   rectangle fg_clip = *cliprect;
636   rectangle bg_clip = *cliprect;
635   rectangle fg_clip = cliprect;
636   rectangle bg_clip = cliprect;
637637
638638   if (flip_screen_get(screen.machine()))
639639   {
r13798r13799
646646      fg_clip.min_x = 28 * 8;
647647   }
648648
649   screen.machine().priority_bitmap->fill(0, *cliprect);
649   screen.machine().priority_bitmap->fill(0, cliprect);
650650
651   tilemap_draw(bitmap, &bg_clip, state->m_bg_tilemap, 0, 0);
652   tilemap_draw(bitmap, &fg_clip, state->m_fg_tilemap, 0, 0);
653   tilemap_draw(bitmap, &bg_clip, state->m_bg_tilemap, 1, 1);
654   tilemap_draw(bitmap, &fg_clip, state->m_fg_tilemap, 1, 1);
651   tilemap_draw(bitmap, bg_clip, state->m_bg_tilemap, 0, 0);
652   tilemap_draw(bitmap, fg_clip, state->m_fg_tilemap, 0, 0);
653   tilemap_draw(bitmap, bg_clip, state->m_bg_tilemap, 1, 1);
654   tilemap_draw(bitmap, fg_clip, state->m_fg_tilemap, 1, 1);
655655
656656   rallyx_draw_bullets(screen.machine(), bitmap, cliprect, TRUE);
657657   rallyx_draw_sprites(screen.machine(), bitmap, cliprect, 1);
r13798r13799
666666   rallyx_state *state = screen.machine().driver_data<rallyx_state>();
667667   /* the radar tilemap is just 8x32. We rely on the tilemap code to repeat it across
668668       the screen, and clip it to only the position where it is supposed to be shown */
669   rectangle fg_clip = *cliprect;
670   rectangle bg_clip = *cliprect;
669   rectangle fg_clip = cliprect;
670   rectangle bg_clip = cliprect;
671671
672672   if (flip_screen_get(screen.machine()))
673673   {
r13798r13799
680680      fg_clip.min_x = 28 * 8;
681681   }
682682
683   screen.machine().priority_bitmap->fill(0, *cliprect);
683   screen.machine().priority_bitmap->fill(0, cliprect);
684684
685685   /* tile priority doesn't seem to be supported in Jungler */
686   tilemap_draw(bitmap,&bg_clip, state->m_bg_tilemap, 0, 0);
687   tilemap_draw(bitmap,&fg_clip, state->m_fg_tilemap, 0, 0);
688   tilemap_draw(bitmap,&bg_clip, state->m_bg_tilemap, 1, 0);
689   tilemap_draw(bitmap,&fg_clip, state->m_fg_tilemap, 1, 0);
686   tilemap_draw(bitmap,bg_clip, state->m_bg_tilemap, 0, 0);
687   tilemap_draw(bitmap,fg_clip, state->m_fg_tilemap, 0, 0);
688   tilemap_draw(bitmap,bg_clip, state->m_bg_tilemap, 1, 0);
689   tilemap_draw(bitmap,fg_clip, state->m_fg_tilemap, 1, 0);
690690
691691   jungler_draw_bullets(screen.machine(), bitmap, cliprect, TRUE);
692692   rallyx_draw_sprites(screen.machine(), bitmap, cliprect, 0);
r13798r13799
704704   rallyx_state *state = screen.machine().driver_data<rallyx_state>();
705705   /* the radar tilemap is just 8x32. We rely on the tilemap code to repeat it across
706706       the screen, and clip it to only the position where it is supposed to be shown */
707   rectangle fg_clip = *cliprect;
708   rectangle bg_clip = *cliprect;
707   rectangle fg_clip = cliprect;
708   rectangle bg_clip = cliprect;
709709
710710   if (flip_screen_get(screen.machine()))
711711   {
r13798r13799
727727      fg_clip.min_x = 28 * 8;
728728   }
729729
730   screen.machine().priority_bitmap->fill(0, *cliprect);
730   screen.machine().priority_bitmap->fill(0, cliprect);
731731
732   tilemap_draw(bitmap, &bg_clip, state->m_bg_tilemap, 0, 0);
733   tilemap_draw(bitmap, &fg_clip, state->m_fg_tilemap, 0, 0);
734   tilemap_draw(bitmap, &bg_clip, state->m_bg_tilemap, 1, 1);
735   tilemap_draw(bitmap, &fg_clip, state->m_fg_tilemap, 1, 1);
732   tilemap_draw(bitmap, bg_clip, state->m_bg_tilemap, 0, 0);
733   tilemap_draw(bitmap, fg_clip, state->m_fg_tilemap, 0, 0);
734   tilemap_draw(bitmap, bg_clip, state->m_bg_tilemap, 1, 1);
735   tilemap_draw(bitmap, fg_clip, state->m_fg_tilemap, 1, 1);
736736
737737   locomotn_draw_bullets(screen.machine(), bitmap, cliprect, TRUE);
738738   locomotn_draw_sprites(screen.machine(), bitmap, cliprect, 0);
src/mame/video/unico.c
r13798r13799
221221
222222***************************************************************************/
223223
224static void unico_draw_sprites(running_machine &machine, bitmap_t *bitmap,const rectangle *cliprect)
224static void unico_draw_sprites(running_machine &machine, bitmap_t *bitmap,const rectangle &cliprect)
225225{
226226   unico_state *state = machine.driver_data<unico_state>();
227227   UINT16 *spriteram16 = state->m_spriteram;
r13798r13799
276276   }
277277}
278278
279static void zeropnt2_draw_sprites(running_machine &machine, bitmap_t *bitmap,const rectangle *cliprect)
279static void zeropnt2_draw_sprites(running_machine &machine, bitmap_t *bitmap,const rectangle &cliprect)
280280{
281281   unico_state *state = machine.driver_data<unico_state>();
282282   UINT32 *spriteram32 = (UINT32 *)state->m_spriteram;
r13798r13799
368368#endif
369369
370370   /* The background color is the first of the last palette */
371   bitmap->fill(0x1f00, *cliprect);
372   screen.machine().priority_bitmap->fill(0, *cliprect);
371   bitmap->fill(0x1f00, cliprect);
372   screen.machine().priority_bitmap->fill(0, cliprect);
373373
374374   if (layers_ctrl & 1)   tilemap_draw(bitmap,cliprect,state->m_tilemap[0],0,1);
375375   if (layers_ctrl & 2)   tilemap_draw(bitmap,cliprect,state->m_tilemap[1],0,2);
r13798r13799
408408#endif
409409
410410   /* The background color is the first of the last palette */
411   bitmap->fill(0x1f00, *cliprect);
412   screen.machine().priority_bitmap->fill(0, *cliprect);
411   bitmap->fill(0x1f00, cliprect);
412   screen.machine().priority_bitmap->fill(0, cliprect);
413413
414414   if (layers_ctrl & 1)   tilemap_draw(bitmap,cliprect,state->m_tilemap[0],0,1);
415415   if (layers_ctrl & 2)   tilemap_draw(bitmap,cliprect,state->m_tilemap[1],0,2);
src/mame/video/blockhl.c
r13798r13799
5959{
6060   blockhl_state *state = screen.machine().driver_data<blockhl_state>();
6161
62   screen.machine().priority_bitmap->fill(0, *cliprect);
62   screen.machine().priority_bitmap->fill(0, cliprect);
6363
6464   k052109_tilemap_update(state->m_k052109);
6565
src/mame/video/gcpinbal.c
r13798r13799
169169
170170****************************************************************/
171171
172static void draw_sprites( running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect, int y_offs )
172static void draw_sprites( running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect, int y_offs )
173173{
174174   gcpinbal_state *state = machine.driver_data<gcpinbal_state>();
175175   UINT16 *spriteram = state->m_spriteram;
r13798r13799
292292      tilemap_set_scrolly(state->m_tilemap[i], 0, state->m_scrolly[i]);
293293   }
294294
295   screen.machine().priority_bitmap->fill(0, *cliprect);
296   bitmap->fill(0, *cliprect);
295   screen.machine().priority_bitmap->fill(0, cliprect);
296   bitmap->fill(0, cliprect);
297297
298298   layer[0] = 0;
299299   layer[1] = 1;
src/mame/video/realbrk.c
r13798r13799
213213
214214***************************************************************************/
215215
216static void draw_sprites(running_machine &machine, bitmap_t *bitmap,const rectangle *cliprect)
216static void draw_sprites(running_machine &machine, bitmap_t *bitmap,const rectangle &cliprect)
217217{
218218   realbrk_state *state = machine.driver_data<realbrk_state>();
219219   UINT16 *spriteram16 = state->m_spriteram;
r13798r13799
302302            {
303303               state->m_tmpbitmap0->fill(0, spritetile_clip );
304304               state->m_tmpbitmap1->fill(0, spritetile_clip );
305               drawgfxzoom_transpen(   state->m_tmpbitmap0,&spritetile_clip,machine.gfx[gfx],
305               drawgfxzoom_transpen(   state->m_tmpbitmap0,spritetile_clip,machine.gfx[gfx],
306306                           code++,
307307                           color,
308308                           flipx, flipy,
r13798r13799
316316            switch( rot )
317317            {
318318               case 0x10: // rot 90
319                  copyrozbitmap_trans( state->m_tmpbitmap1, NULL, state->m_tmpbitmap0,
319                  copyrozbitmap_trans( state->m_tmpbitmap1, state->m_tmpbitmap1->cliprect(), state->m_tmpbitmap0,
320320                     (UINT32)0<<16,
321321                     (UINT32)16<<16,
322322                     0 << 16,
r13798r13799
332332                  break;
333333
334334               case 0x20: // rot 180
335                  copyrozbitmap_trans( state->m_tmpbitmap1, NULL, state->m_tmpbitmap0,
335                  copyrozbitmap_trans( state->m_tmpbitmap1, state->m_tmpbitmap1->cliprect(), state->m_tmpbitmap0,
336336                     (UINT32)16<<16,
337337                     (UINT32)16<<16,
338338                     -1 << 16,
r13798r13799
348348                  break;
349349
350350               case 0x30: // rot 270
351                  copyrozbitmap_trans( state->m_tmpbitmap1, NULL, state->m_tmpbitmap0,
351                  copyrozbitmap_trans( state->m_tmpbitmap1, state->m_tmpbitmap1->cliprect(), state->m_tmpbitmap0,
352352                     (UINT32)16<<16,
353353                     (UINT32)0<<16,
354354                     0 << 16,
r13798r13799
380380
381381/* DaiDaiKakumei */
382382/* layer : 0== bghigh<spr    1== bglow<spr<bghigh     2==spr<bglow    3==boarder */
383static void dai2kaku_draw_sprites(running_machine &machine, bitmap_t *bitmap,const rectangle *cliprect, int layer)
383static void dai2kaku_draw_sprites(running_machine &machine, bitmap_t *bitmap,const rectangle &cliprect, int layer)
384384{
385385   realbrk_state *state = machine.driver_data<realbrk_state>();
386386   UINT16 *spriteram16 = state->m_spriteram;
r13798r13799
522522
523523   if (state->m_disable_video)
524524   {
525      bitmap->fill(get_black_pen(screen.machine()), *cliprect);
525      bitmap->fill(get_black_pen(screen.machine()), cliprect);
526526      return 0;
527527   }
528528   else
529      bitmap->fill(state->m_vregs[0xc/2] & 0x7fff, *cliprect);
529      bitmap->fill(state->m_vregs[0xc/2] & 0x7fff, cliprect);
530530
531531   if (layers_ctrl & 2)   tilemap_draw(bitmap,cliprect,state->m_tilemap_1,0,0);
532532   if (layers_ctrl & 1)   tilemap_draw(bitmap,cliprect,state->m_tilemap_0,0,0);
r13798r13799
593593
594594   if (state->m_disable_video)
595595   {
596      bitmap->fill(get_black_pen(screen.machine()), *cliprect);
596      bitmap->fill(get_black_pen(screen.machine()), cliprect);
597597      return 0;
598598   }
599599   else
600      bitmap->fill(state->m_vregs[0xc/2] & 0x7fff, *cliprect);
600      bitmap->fill(state->m_vregs[0xc/2] & 0x7fff, cliprect);
601601
602602
603603
src/mame/video/superchs.c
r13798r13799
5454
5555********************************************************/
5656
57static void draw_sprites(running_machine &machine, bitmap_t *bitmap,const rectangle *cliprect,const int *primasks,int x_offs,int y_offs)
57static void draw_sprites(running_machine &machine, bitmap_t *bitmap,const rectangle &cliprect,const int *primasks,int x_offs,int y_offs)
5858{
5959   superchs_state *state = machine.driver_data<superchs_state>();
6060   UINT32 *spriteram32 = state->m_spriteram;
r13798r13799
215215   layer[3] = (priority & 0x000f) >>  0;   /* tells us which is top */
216216   layer[4] = 4;   /* text layer always over bg layers */
217217
218   screen.machine().priority_bitmap->fill(0, *cliprect);
218   screen.machine().priority_bitmap->fill(0, cliprect);
219219
220220   /* We have to assume 2nd to bottom layer is always underneath
221221       sprites as pdrawgfx cannot yet cope with more than 4 layers */
src/mame/video/bottom9.c
r13798r13799
8080   k052109_tilemap_update(state->m_k052109);
8181
8282   /* note: FIX layer is not used */
83   bitmap->fill(state->m_layer_colorbase[1], *cliprect);
83   bitmap->fill(state->m_layer_colorbase[1], cliprect);
8484//  if (state->m_video_enable)
8585   {
8686      k051960_sprites_draw(state->m_k051960, bitmap, cliprect, 1, 1);
src/mame/video/flower.c
r13798r13799
2525      colortable_entry_set_value(machine.colortable, i, i);
2626}
2727
28static void draw_sprites(running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect )
28static void draw_sprites(running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect )
2929{
3030   flower_state *state = machine.driver_data<flower_state>();
3131   const gfx_element *gfx = machine.gfx[1];
r13798r13799
166166SCREEN_UPDATE( flower )
167167{
168168   flower_state *state = screen.machine().driver_data<flower_state>();
169   rectangle myclip = *cliprect;
169   rectangle myclip = cliprect;
170170
171171   tilemap_set_scrolly(state->m_bg0_tilemap,0, state->m_bg0_scroll[0]+16);
172172   tilemap_set_scrolly(state->m_bg1_tilemap,0, state->m_bg1_scroll[0]+16);
r13798r13799
178178
179179   if(flip_screen_get(screen.machine()))
180180   {
181      myclip.min_x = cliprect->min_x;
182      myclip.max_x = cliprect->min_x + 15;
181      myclip.min_x = cliprect.min_x;
182      myclip.max_x = cliprect.min_x + 15;
183183   }
184184   else
185185   {
186      myclip.min_x = cliprect->max_x - 15;
187      myclip.max_x = cliprect->max_x;
186      myclip.min_x = cliprect.max_x - 15;
187      myclip.max_x = cliprect.max_x;
188188   }
189189
190190   tilemap_draw(bitmap,cliprect,state->m_text_tilemap,0,0);
191   tilemap_draw(bitmap,&myclip,state->m_text_right_tilemap,0,0);
191   tilemap_draw(bitmap,myclip,state->m_text_right_tilemap,0,0);
192192   return 0;
193193}
194194
src/mame/video/battlera.c
r13798r13799
241241
242242/******************************************************************************/
243243
244static void draw_sprites(running_machine &machine, bitmap_t *bitmap,const rectangle *clip,int pri)
244static void draw_sprites(running_machine &machine, bitmap_t *bitmap,const rectangle &clip,int pri)
245245{
246246   battlera_state *state = machine.driver_data<battlera_state>();
247247   int offs,my,mx,code,code2,fx,fy,cgy=0,cgx,colour,i,yinc;
r13798r13799
329329      /* If this tile was changed OR tilemap was changed, redraw */
330330      if (state->m_vram_dirty[offs/2]) {
331331         state->m_vram_dirty[offs/2]=0;
332         drawgfx_opaque(state->m_tile_bitmap,0,screen.machine().gfx[0],
332         drawgfx_opaque(state->m_tile_bitmap,state->m_tile_bitmap->cliprect(),screen.machine().gfx[0],
333333               code,
334334               state->m_HuC6270_vram[offs] >> 4,
335335               0,0,
336336               8*mx,8*my);
337         drawgfx_opaque(state->m_front_bitmap,0,screen.machine().gfx[2],
337         drawgfx_opaque(state->m_front_bitmap,state->m_tile_bitmap->cliprect(),screen.machine().gfx[2],
338338               0,
339339               0,   /* fill the spot with pen 256 */
340340               0,0,
341341               8*mx,8*my);
342         drawgfx_transmask(state->m_front_bitmap,0,screen.machine().gfx[0],
342         drawgfx_transmask(state->m_front_bitmap,state->m_tile_bitmap->cliprect(),screen.machine().gfx[0],
343343               code,
344344               state->m_HuC6270_vram[offs] >> 4,
345345               0,0,
r13798r13799
349349
350350   /* Render bitmap */
351351   scrollx=-state->m_HuC6270_registers[7];
352   scrolly=-state->m_HuC6270_registers[8]+cliprect->min_y-1;
352   scrolly=-state->m_HuC6270_registers[8]+cliprect.min_y-1;
353353
354354   copyscrollbitmap(bitmap,state->m_tile_bitmap,1,&scrollx,1,&scrolly,cliprect);
355355
src/mame/video/xain.c
r13798r13799
172172
173173***************************************************************************/
174174
175static void draw_sprites(running_machine &machine, bitmap_t *bitmap,const rectangle *cliprect)
175static void draw_sprites(running_machine &machine, bitmap_t *bitmap,const rectangle &cliprect)
176176{
177177   xain_state *state = machine.driver_data<xain_state>();
178178   UINT8 *spriteram = state->m_spriteram;
src/mame/video/mrdo.c
r13798r13799
243243
244244***************************************************************************/
245245
246static void draw_sprites( running_machine &machine, bitmap_t *bitmap,const rectangle *cliprect )
246static void draw_sprites( running_machine &machine, bitmap_t *bitmap,const rectangle &cliprect )
247247{
248248   mrdo_state *state = machine.driver_data<mrdo_state>();
249249   UINT8 *spriteram = state->m_spriteram;
r13798r13799
265265{
266266   mrdo_state *state = screen.machine().driver_data<mrdo_state>();
267267
268   bitmap->fill(0, *cliprect);
268   bitmap->fill(0, cliprect);
269269   tilemap_draw(bitmap, cliprect, state->m_bg_tilemap, 0, 0);
270270   tilemap_draw(bitmap, cliprect, state->m_fg_tilemap, 0, 0);
271271   draw_sprites(screen.machine(), bitmap, cliprect);
src/mame/video/namcos1.c
r13798r13799
29829815   xxxxxxxx  Y position
299299*/
300300
301static void draw_sprites(running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect)
301static void draw_sprites(running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect)
302302{
303303   namcos1_state *state = machine.driver_data<namcos1_state>();
304304   UINT8 *spriteram = state->m_spriteram + 0x800;
r13798r13799
374374{
375375   namcos1_state *state = screen.machine().driver_data<namcos1_state>();
376376   int i, j, scrollx, scrolly, priority;
377   rectangle new_clip = *cliprect;
377   rectangle new_clip = cliprect;
378378
379379   /* flip screen is embedded in the sprite control registers */
380380   /* can't use flip_screen_set(screen.machine(), ) because the visible area is asymmetrical */
r13798r13799
383383
384384
385385   /* background color */
386   bitmap->fill(get_black_pen(screen.machine()), *cliprect);
386   bitmap->fill(get_black_pen(screen.machine()), cliprect);
387387
388388   /* berabohm uses asymmetrical visibility windows to iris on the character */
389389   i = ((state->m_cus116[0] << 8) | state->m_cus116[1]) - 1;         // min x
r13798r13799
431431      for (i = 0;i < 6;i++)
432432      {
433433         if (state->m_playfield_control[16 + i] == priority)
434            tilemap_draw_primask(bitmap,&new_clip,state->m_bg_tilemap[i],0,priority,0);
434            tilemap_draw_primask(bitmap,new_clip,state->m_bg_tilemap[i],0,priority,0);
435435      }
436436   }
437437
438   draw_sprites(screen.machine(), bitmap, &new_clip);
438   draw_sprites(screen.machine(), bitmap, new_clip);
439439   return 0;
440440}
441441
src/mame/video/mainevt.c
r13798r13799
9999
100100   k052109_tilemap_update(state->m_k052109);
101101
102   screen.machine().priority_bitmap->fill(0, *cliprect);
102   screen.machine().priority_bitmap->fill(0, cliprect);
103103   k052109_tilemap_draw(state->m_k052109, bitmap, cliprect, 1, TILEMAP_DRAW_OPAQUE, 1);
104104   k052109_tilemap_draw(state->m_k052109, bitmap, cliprect, 2, 1, 2);   /* low priority part of layer */
105105   k052109_tilemap_draw(state->m_k052109, bitmap, cliprect, 2, 0, 4);   /* high priority part of layer */
src/mame/video/astrocde.c
r13798r13799
261261      sparklebase = (screen.frame_number() * (UINT64)(width * height)) % RNG_PERIOD;
262262
263263   /* iterate over scanlines */
264   for (y = cliprect->min_y; y <= cliprect->max_y; y++)
264   for (y = cliprect.min_y; y <= cliprect.max_y; y++)
265265   {
266266      UINT16 *dest = &bitmap->pix16(y);
267267      int effy = mame_vpos_to_astrocade_vpos(y);
r13798r13799
336336   int y;
337337
338338   /* iterate over scanlines */
339   for (y = cliprect->min_y; y <= cliprect->max_y; y++)
339   for (y = cliprect.min_y; y <= cliprect.max_y; y++)
340340   {
341341      int effy = mame_vpos_to_astrocade_vpos(y);
342342      UINT16 *dest = &bitmap->pix16(y);
src/mame/video/m62.c
r13798r13799
353353}
354354
355355
356static void draw_sprites( running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect, int colormask, int prioritymask, int priority )
356static void draw_sprites( running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect, int colormask, int prioritymask, int priority )
357357{
358358   m62_state *state = machine.driver_data<m62_state>();
359359   int offs;
r13798r13799
576576
577577   if (state->m_ldrun3_topbottom_mask)
578578   {
579      rectangle my_cliprect = *cliprect;
579      rectangle my_cliprect = cliprect;
580580
581581      my_cliprect.min_y = 0 * 8;
582582      my_cliprect.max_y = 1 * 8 - 1;
src/mame/video/megazone.c
r13798r13799
135135         flipy = !flipy;
136136      }
137137
138      drawgfx_opaque(state->m_tmpbitmap, 0, screen.machine().gfx[1],
138      drawgfx_opaque(state->m_tmpbitmap, state->m_tmpbitmap->cliprect(), screen.machine().gfx[1],
139139            ((int)state->m_videoram[offs]) + ((state->m_colorram[offs] & (1 << 7) ? 256 : 0) ),
140140            (state->m_colorram[offs] & 0x0f) + 0x10,
141141            flipx,flipy,
src/mame/video/toki.c
r13798r13799
181181***************************************************************************/
182182
183183
184static void toki_draw_sprites(running_machine &machine, bitmap_t *bitmap,const rectangle *cliprect)
184static void toki_draw_sprites(running_machine &machine, bitmap_t *bitmap,const rectangle &cliprect)
185185{
186186   int x,y,xoffs,yoffs,tile,flipx,flipy,color,offs;
187187   UINT16 *sprite_word;
r13798r13799
224224}
225225
226226
227static void tokib_draw_sprites(running_machine &machine, bitmap_t *bitmap,const rectangle *cliprect)
227static void tokib_draw_sprites(running_machine &machine, bitmap_t *bitmap,const rectangle &cliprect)
228228{
229229   int x,y,tile,flipx,color,offs;
230230   UINT16 *sprite_word;
src/mame/video/40love.c
r13798r13799
274274    offset  3   xxxxxxxx    x position
275275*/
276276
277static void draw_sprites( running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect )
277static void draw_sprites( running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect )
278278{
279279   fortyl_state *state = machine.driver_data<fortyl_state>();
280280   UINT8 *spriteram = state->m_spriteram;
r13798r13799
338338   }
339339}
340340
341static void draw_pixram( running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect )
341static void draw_pixram( running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect )
342342{
343343   fortyl_state *state = machine.driver_data<fortyl_state>();
344344   int offs;
src/mame/video/renegade.c
r13798r13799
7979   state_save_register_global(machine, state->m_scrollx);
8080}
8181
82static void draw_sprites(running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect)
82static void draw_sprites(running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect)
8383{
8484   renegade_state *state = machine.driver_data<renegade_state>();
8585   UINT8 *source = state->m_spriteram;
src/mame/video/galaga.c
r13798r13799
476476
477477***************************************************************************/
478478
479static void draw_sprites(running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect )
479static void draw_sprites(running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect )
480480{
481481   galaga_state *state =  machine.driver_data<galaga_state>();
482482
r13798r13799
530530}
531531
532532
533static void draw_stars(running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect )
533static void draw_stars(running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect )
534534{
535535   galaga_state *state =  machine.driver_data<galaga_state>();
536536   /* draw the stars */
r13798r13799
557557            x = (star_seed_tab[star_cntr].x + state->m_stars_scrollx) % 256 + x_align;
558558            y = (y_align + star_seed_tab[star_cntr].y + state->m_stars_scrolly) % 256;
559559
560            if (x >= cliprect->min_x && x <= cliprect->max_x && y >= cliprect->min_y && y <= cliprect->max_y)
560            if (x >= cliprect.min_x && x <= cliprect.max_x && y >= cliprect.min_y && y <= cliprect.max_y)
561561               bitmap->pix16(y, x) = STARS_COLOR_BASE + star_seed_tab[ star_cntr ].col;
562562         }
563563
r13798r13799
569569{
570570   galaga_state *state =  screen.machine().driver_data<galaga_state>();
571571
572   bitmap->fill(get_black_pen(screen.machine()), *cliprect);
572   bitmap->fill(get_black_pen(screen.machine()), cliprect);
573573   draw_stars(screen.machine(),bitmap,cliprect);
574574   draw_sprites(screen.machine(),bitmap,cliprect);
575575   tilemap_draw(bitmap,cliprect,state->m_fg_tilemap,0,0);
src/mame/video/lasso.c
r13798r13799
272272 *
273273 *************************************/
274274
275static void draw_sprites( running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect, int reverse )
275static void draw_sprites( running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect, int reverse )
276276{
277277   lasso_state *state = machine.driver_data<lasso_state>();
278278   const UINT8 *finish, *source;
r13798r13799
326326}
327327
328328
329static void draw_lasso( running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect )
329static void draw_lasso( running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect )
330330{
331331   lasso_state *state = machine.driver_data<lasso_state>();
332332   offs_t offs;
r13798r13799
342342      if (flip_screen_y_get(machine))
343343         y = ~y;
344344
345      if ((y < cliprect->min_y) || (y > cliprect->max_y))
345      if ((y < cliprect.min_y) || (y > cliprect.max_y))
346346         continue;
347347
348348      x = (offs & 0x1f) << 3;
r13798r13799
353353
354354      for (bit = 0; bit < 8; bit++)
355355      {
356         if ((data & 0x80) && (x >= cliprect->min_x) && (x <= cliprect->max_x))
356         if ((data & 0x80) && (x >= cliprect.min_x) && (x <= cliprect.max_x))
357357            bitmap->pix16(y, x) = pen;
358358
359359         if (flip_screen_x_get(machine))
r13798r13799
371371{
372372   lasso_state *state = screen.machine().driver_data<lasso_state>();
373373   palette_set_color(screen.machine(), 0, get_color(*state->m_back_color));
374   bitmap->fill(0, *cliprect);
374   bitmap->fill(0, cliprect);
375375
376376   tilemap_draw(bitmap, cliprect, state->m_bg_tilemap, 0, 0);
377377   draw_lasso(screen.machine(), bitmap, cliprect);
r13798r13799
384384{
385385   lasso_state *state = screen.machine().driver_data<lasso_state>();
386386   palette_set_color(screen.machine(), 0, get_color(*state->m_back_color));
387   bitmap->fill(0, *cliprect);
387   bitmap->fill(0, cliprect);
388388
389389   tilemap_draw(bitmap, cliprect, state->m_bg_tilemap, 0, 0);
390390   draw_sprites(screen.machine(), bitmap, cliprect, 0);
r13798r13799
405405   if (state->m_track_enable)
406406      tilemap_draw(bitmap, cliprect, state->m_track_tilemap, 0, 0);
407407   else
408      bitmap->fill(get_black_pen(screen.machine()), *cliprect);
408      bitmap->fill(get_black_pen(screen.machine()), cliprect);
409409
410410   draw_sprites(screen.machine(), bitmap, cliprect, 1);   // reverse order
411411   tilemap_draw(bitmap, cliprect, state->m_bg_tilemap, 0, 0);
src/mame/video/taito_h.c
r13798r13799
7070  Screen refresh
7171***************************************************************************/
7272
73static void syvalion_draw_sprites( running_machine &machine,bitmap_t *bitmap, const rectangle *cliprect )
73static void syvalion_draw_sprites( running_machine &machine,bitmap_t *bitmap, const rectangle &cliprect )
7474{
7575   /* Y chain size is 16/32?/64/64? pixels. X chain size
7676       is always 64 pixels. */
r13798r13799
163163   }
164164}
165165
166static void recordbr_draw_sprites( running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect, int priority )
166static void recordbr_draw_sprites( running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect, int priority )
167167{
168168   /* Y chain size is 16/32?/64/64? pixels. X chain size
169169       is always 64 pixels. */
r13798r13799
275275   }
276276}
277277
278static void dleague_draw_sprites( running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect, int priority )
278static void dleague_draw_sprites( running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect, int priority )
279279{
280280   /* Y chain size is 16/32?/64/64? pixels. X chain size
281281       is always 64 pixels. */
r13798r13799
399399
400400   taitoh_log_vram(screen.machine());
401401
402   bitmap->fill(0, *cliprect);
402   bitmap->fill(0, cliprect);
403403
404404   tc0080vco_tilemap_draw(state->m_tc0080vco, bitmap, cliprect, 0, TILEMAP_DRAW_OPAQUE, 0);
405405   tc0080vco_tilemap_draw(state->m_tc0080vco, bitmap, cliprect, 1, 0, 0);
r13798r13799
418418
419419   taitoh_log_vram(screen.machine());
420420
421   bitmap->fill(0, *cliprect);
421   bitmap->fill(0, cliprect);
422422
423423#ifdef MAME_DEBUG
424424   if (!screen.machine().input().code_pressed(KEYCODE_A))
r13798r13799
449449
450450   taitoh_log_vram(screen.machine());
451451
452   bitmap->fill(0, *cliprect);
452   bitmap->fill(0, cliprect);
453453
454454#ifdef MAME_DEBUG
455455   if (!screen.machine().input().code_pressed(KEYCODE_A))
src/mame/video/psychic5.c
r13798r13799
311311
312312#define DRAW_SPRITE(code, sx, sy) jal_blend_drawgfx(bitmap, cliprect, machine.gfx[0], code, color, flipx, flipy, sx, sy, 15);
313313
314static void draw_sprites(running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect)
314static void draw_sprites(running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect)
315315{
316316   psychic5_state *state = machine.driver_data<psychic5_state>();
317317   UINT8 *spriteram = state->m_spriteram;
r13798r13799
365365   }
366366}
367367
368static void draw_background(running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect)
368static void draw_background(running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect)
369369{
370370   psychic5_state *state = machine.driver_data<psychic5_state>();
371371   UINT8 *spriteram = state->m_spriteram;
372372
373   rectangle clip = *cliprect;
373   rectangle clip = cliprect;
374374
375375   set_background_palette_intensity(machine);
376376
r13798r13799
429429      }
430430   }
431431
432   tilemap_draw(bitmap, &clip, state->m_bg_tilemap, 0, 0);
432   tilemap_draw(bitmap, clip, state->m_bg_tilemap, 0, 0);
433433}
434434
435435SCREEN_UPDATE( psychic5 )
436436{
437437   psychic5_state *state = screen.machine().driver_data<psychic5_state>();
438   bitmap->fill(get_black_pen(screen.machine()), *cliprect);
438   bitmap->fill(get_black_pen(screen.machine()), cliprect);
439439   if (state->m_bg_status & 1)   /* Backgound enable */
440440      draw_background(screen.machine(), bitmap, cliprect);
441441   if (!(state->m_title_screen & 1))
r13798r13799
450450   if (state->m_bg_status & 1)   /* Backgound enable */
451451      tilemap_draw(bitmap, cliprect, state->m_bg_tilemap, 0, 0);
452452   else
453      bitmap->fill(screen.machine().pens[0x0ff], *cliprect);
453      bitmap->fill(screen.machine().pens[0x0ff], cliprect);
454454   draw_sprites(screen.machine(), bitmap, cliprect);
455455   tilemap_draw(bitmap, cliprect, state->m_fg_tilemap, 0, 0);
456456   return 0;
src/mame/video/othunder.c
r13798r13799
6363********************************************************/
6464
6565
66static void draw_sprites( running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect, const int *primasks, int y_offs )
66static void draw_sprites( running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect, const int *primasks, int y_offs )
6767{
6868   othunder_state *state = machine.driver_data<othunder_state>();
6969   UINT16 *spritemap = (UINT16 *)machine.region("user1")->base();
r13798r13799
211211   layer[1] = layer[0] ^ 1;
212212   layer[2] = 2;
213213
214   screen.machine().priority_bitmap->fill(0, *cliprect);
214   screen.machine().priority_bitmap->fill(0, cliprect);
215215
216216   /* Ensure screen blanked even when bottom layer not drawn due to disable bit */
217   bitmap->fill(0, *cliprect);
217   bitmap->fill(0, cliprect);
218218
219219   tc0100scn_tilemap_draw(state->m_tc0100scn, bitmap, cliprect, layer[0], TILEMAP_DRAW_OPAQUE, 1);
220220   tc0100scn_tilemap_draw(state->m_tc0100scn, bitmap, cliprect, layer[1], 0, 2);
src/mame/video/ginganin.c
r13798r13799
209209
210210------------------------------------------------------------------------ */
211211
212static void draw_sprites( running_machine &machine, bitmap_t *bitmap,const rectangle *cliprect )
212static void draw_sprites( running_machine &machine, bitmap_t *bitmap,const rectangle &cliprect )
213213{
214214   ginganin_state *state = machine.driver_data<ginganin_state>();
215215   UINT16 *spriteram = state->m_spriteram;
r13798r13799
281281   if (layers_ctrl1 & 1)
282282      tilemap_draw(bitmap, cliprect, state->m_bg_tilemap, 0, 0);
283283   else
284      bitmap->fill(0, *cliprect);
284      bitmap->fill(0, cliprect);
285285
286286   if (layers_ctrl1 & 2)
287287      tilemap_draw(bitmap, cliprect, state->m_fg_tilemap, 0, 0);
src/mame/video/tail2nos.c
r13798r13799
146146
147147***************************************************************************/
148148
149static void draw_sprites( running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect )
149static void draw_sprites( running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect )
150150{
151151   tail2nos_state *state = machine.driver_data<tail2nos_state>();
152152   UINT16 *spriteram = state->m_spriteram;
r13798r13799
188188      tilemap_draw(bitmap, cliprect, state->m_bg_tilemap, 0, 0);
189189   }
190190   else
191      bitmap->fill(0, *cliprect);
191      bitmap->fill(0, cliprect);
192192
193193   return 0;
194194}
src/mame/video/mrjong.c
r13798r13799
110110/*
111111Note: First 0x40 entries in the videoram are actually spriteram
112112*/
113static void draw_sprites( running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect )
113static void draw_sprites( running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect )
114114{
115115   mrjong_state *state = machine.driver_data<mrjong_state>();
116116   int offs;
src/mame/video/quasar.c
r13798r13799
174174   {
175175      int y;
176176
177      for (y = cliprect->min_y; y <= cliprect->max_y; y++)
177      for (y = cliprect.min_y; y <= cliprect.max_y; y++)
178178      {
179179         int x;
180180
181         for (x = cliprect->min_x; x <= cliprect->max_x; x++)
181         for (x = cliprect.min_x; x <= cliprect.max_x; x++)
182182         {
183183            int pixel0 = s2636_0_bitmap->pix16(y, x);
184184            int pixel1 = s2636_1_bitmap->pix16(y, x);
src/mame/video/slapshot.c
r13798r13799
3434            SPRITE DRAW ROUTINES
3535************************************************************/
3636
37static void draw_sprites( running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect, int *primasks, int y_offset )
37static void draw_sprites( running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect, int *primasks, int y_offset )
3838{
3939   /*
4040        Sprite format:
r13798r13799
519519   spritepri[2] = tc0360pri_r(state->m_tc0360pri, 7) & 0x0f;
520520   spritepri[3] = tc0360pri_r(state->m_tc0360pri, 7) >> 4;
521521
522   screen.machine().priority_bitmap->fill(0, *cliprect);
523   bitmap->fill(0, *cliprect);
522   screen.machine().priority_bitmap->fill(0, cliprect);
523   bitmap->fill(0, cliprect);
524524
525525#ifdef MAME_DEBUG
526526   if (state->m_dislayer[layer[0]] == 0)
src/mame/video/1943.c
r13798r13799
221221   state->save_item(NAME(state->m_bg2_on));
222222}
223223
224static void draw_sprites( running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect, int priority )
224static void draw_sprites( running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect, int priority )
225225{
226226   _1943_state *state = machine.driver_data<_1943_state>();
227227   int offs;
r13798r13799
264264   if (state->m_bg2_on)
265265      tilemap_draw(bitmap, cliprect, state->m_bg2_tilemap, 0, 0);
266266   else
267      bitmap->fill(get_black_pen(screen.machine()), *cliprect);
267      bitmap->fill(get_black_pen(screen.machine()), cliprect);
268268
269269   if (state->m_obj_on)
270270      draw_sprites(screen.machine(), bitmap, cliprect, 0);
src/mame/video/cninja.c
r13798r13799
2626
2727
2828/* The bootleg sprites are in a different format! */
29static void cninjabl_draw_sprites( running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect )
29static void cninjabl_draw_sprites( running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect )
3030{
3131   UINT16 *buffered_spriteram = machine.generic.buffered_spriteram.u16;
3232   int offs;
r13798r13799
134134   deco16ic_pf_update(state->m_deco_tilegen2, state->m_pf3_rowscroll, state->m_pf4_rowscroll);
135135
136136   /* Draw playfields */
137   screen.machine().priority_bitmap->fill(0, *cliprect);
138   bitmap->fill(512, *cliprect);
137   screen.machine().priority_bitmap->fill(0, cliprect);
138   bitmap->fill(512, cliprect);
139139   deco16ic_tilemap_2_draw(state->m_deco_tilegen2, bitmap, cliprect, TILEMAP_DRAW_OPAQUE, 1);
140140   deco16ic_tilemap_1_draw(state->m_deco_tilegen2, bitmap, cliprect, 0, 2);
141141   deco16ic_tilemap_2_draw(state->m_deco_tilegen1, bitmap, cliprect, TILEMAP_DRAW_LAYER1, 2);
r13798r13799
159159   deco16ic_pf_update(state->m_deco_tilegen2, state->m_pf3_rowscroll, state->m_pf4_rowscroll);
160160
161161   /* Draw playfields */
162   screen.machine().priority_bitmap->fill(0, *cliprect);
163   bitmap->fill(512, *cliprect);
162   screen.machine().priority_bitmap->fill(0, cliprect);
163   bitmap->fill(512, cliprect);
164164   deco16ic_tilemap_2_draw(state->m_deco_tilegen2, bitmap, cliprect, TILEMAP_DRAW_OPAQUE, 1);
165165   deco16ic_tilemap_1_draw(state->m_deco_tilegen2, bitmap, cliprect, 0, 2);
166166   deco16ic_tilemap_2_draw(state->m_deco_tilegen1, bitmap, cliprect, TILEMAP_DRAW_LAYER1, 2);
r13798r13799
179179   deco16ic_pf_update(state->m_deco_tilegen1, state->m_pf1_rowscroll, state->m_pf2_rowscroll);
180180   deco16ic_pf_update(state->m_deco_tilegen2, state->m_pf3_rowscroll, state->m_pf4_rowscroll);
181181
182   screen.machine().priority_bitmap->fill(0, *cliprect);
183   bitmap->fill(0, *cliprect);
182   screen.machine().priority_bitmap->fill(0, cliprect);
183   bitmap->fill(0, cliprect);
184184   deco16ic_tilemap_2_draw(state->m_deco_tilegen2, bitmap, cliprect, TILEMAP_DRAW_OPAQUE, 1);
185185   deco16ic_tilemap_1_draw(state->m_deco_tilegen2, bitmap, cliprect, 0, 2);
186186   deco16ic_tilemap_2_draw(state->m_deco_tilegen1, bitmap, cliprect, 0, 4);
r13798r13799
215215   deco16ic_pf_update(state->m_deco_tilegen2, state->m_pf3_rowscroll, state->m_pf4_rowscroll);
216216
217217   /* Draw playfields */
218   screen.machine().priority_bitmap->fill(0, *cliprect);
219   bitmap->fill(0x200, *cliprect);
218   screen.machine().priority_bitmap->fill(0, cliprect);
219   bitmap->fill(0x200, cliprect);
220220
221221   if ((priority & 4) == 0)
222222      deco16ic_tilemap_2_draw(state->m_deco_tilegen2, bitmap, cliprect, TILEMAP_DRAW_OPAQUE, 1);
r13798r13799
258258   deco16ic_pf_update(state->m_deco_tilegen2, state->m_pf3_rowscroll, state->m_pf4_rowscroll);
259259
260260   /* Draw playfields */
261   bitmap->fill(0x400, *cliprect); /* Confirmed */
261   bitmap->fill(0x400, cliprect); /* Confirmed */
262262
263263   screen.machine().device<decospr_device>("spritegen1")->set_alt_format(true);
264264   screen.machine().device<decospr_device>("spritegen2")->set_alt_format(true);
src/mame/video/pacland.c
r13798r13799
280280***************************************************************************/
281281
282282/* the sprite generator IC is the same as Mappy */
283static void draw_sprites(running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect, int whichmask)
283static void draw_sprites(running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect, int whichmask)
284284{
285285   pacland_state *state = machine.driver_data<pacland_state>();
286286   UINT8 *spriteram = state->m_spriteram + 0x780;
r13798r13799
340340}
341341
342342
343static void draw_fg(running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect, int priority )
343static void draw_fg(running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect, int priority )
344344{
345345   pacland_state *state = machine.driver_data<pacland_state>();
346346   int y, x;
r13798r13799
351351   tilemap_draw(state->m_fg_bitmap, cliprect, state->m_fg_tilemap, priority, 0);
352352
353353   /* now copy the fg_bitmap to the destination wherever the sprite pixel allows */
354   for (y = cliprect->min_y; y <= cliprect->max_y; y++)
354   for (y = cliprect.min_y; y <= cliprect.max_y; y++)
355355   {
356356      const UINT8 *pri = &machine.priority_bitmap->pix8(y);
357357      UINT16 *src = &state->m_fg_bitmap->pix16(y);
r13798r13799
359359
360360      /* only copy if the priority bitmap is 0 (no high priority sprite) and the
361361           source pixel is not the invalid pen; also clear to 0xffff when finished */
362      for (x = cliprect->min_x; x <= cliprect->max_x; x++)
362      for (x = cliprect.min_x; x <= cliprect.max_x; x++)
363363      {
364364         UINT16 pix = src[x];
365365         if (pix != 0xffff)
r13798r13799
385385   /* draw high priority sprite pixels, setting priority bitmap to non-zero
386386       wherever there is a high-priority pixel; note that we draw to the bitmap
387387       which is safe because the bg_tilemap draw will overwrite everything */
388   screen.machine().priority_bitmap->fill(0x00, *cliprect);
388   screen.machine().priority_bitmap->fill(0x00, cliprect);
389389   draw_sprites(screen.machine(), bitmap, cliprect, 0);
390390
391391   /* draw background */
src/mame/video/psikyo4.c
r13798r13799
3131
3232
3333/* --- SPRITES --- */
34static void draw_sprites( running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect, UINT32 scr )
34static void draw_sprites( running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect, UINT32 scr )
3535{
3636   /*- Sprite Format 0x0000 - 0x2bff -**
3737
r13798r13799
129129
130130SCREEN_UPDATE( psikyo4_left )
131131{
132   bitmap->fill(0x1000, *cliprect);
132   bitmap->fill(0x1000, cliprect);
133133   draw_sprites(screen.machine(), bitmap, cliprect, 0x0000);
134134   return 0;
135135}
136136
137137SCREEN_UPDATE( psikyo4_right )
138138{
139   bitmap->fill(0x1001, *cliprect);
139   bitmap->fill(0x1001, cliprect);
140140   draw_sprites(screen.machine(), bitmap, cliprect, 0x2000);
141141   return 0;
142142}
src/mame/video/rollrace.c
r13798r13799
112112   const UINT8 *mem = screen.machine().region("user1")->base();
113113
114114   /* fill in background colour*/
115   bitmap->fill(state->m_ra_bkgpen, *cliprect);
115   bitmap->fill(state->m_ra_bkgpen, cliprect);
116116
117117   /* draw road */
118118   for (offs = 0x3ff; offs >= 0; offs--)
src/mame/video/popper.c
r13798r13799
204204   state->m_tilemap_clip = machine.primary_screen->visible_area();
205205}
206206
207static void draw_sprites( running_machine &machine, bitmap_t *bitmap,const rectangle *cliprect )
207static void draw_sprites( running_machine &machine, bitmap_t *bitmap,const rectangle &cliprect )
208208{
209209   popper_state *state = machine.driver_data<popper_state>();
210210   int offs, sx, sy, flipx, flipy;
r13798r13799
250250{
251251   popper_state *state = screen.machine().driver_data<popper_state>();
252252   rectangle finalclip = state->m_tilemap_clip;
253   finalclip &= *cliprect;
253   finalclip &= cliprect;
254254
255255   //attribram
256256   //76543210
r13798r13799
260260
261261   tilemap_draw(bitmap, cliprect, state->m_p123_tilemap,      TILEMAP_DRAW_LAYER1, 0);
262262   tilemap_draw(bitmap, cliprect, state->m_p0_tilemap,        TILEMAP_DRAW_LAYER1, 0);
263   tilemap_draw(bitmap, &finalclip, state->m_ol_p123_tilemap, TILEMAP_DRAW_LAYER1, 0);
264   tilemap_draw(bitmap, &finalclip, state->m_ol_p0_tilemap,   TILEMAP_DRAW_LAYER1, 0);
263   tilemap_draw(bitmap, finalclip, state->m_ol_p123_tilemap, TILEMAP_DRAW_LAYER1, 0);
264   tilemap_draw(bitmap, finalclip, state->m_ol_p0_tilemap,   TILEMAP_DRAW_LAYER1, 0);
265265
266266   draw_sprites(screen.machine(), bitmap, cliprect);
267267
268268   tilemap_draw(bitmap, cliprect, state->m_p123_tilemap,      TILEMAP_DRAW_LAYER0, 0);
269269   tilemap_draw(bitmap, cliprect, state->m_p0_tilemap,        TILEMAP_DRAW_LAYER0, 0);
270   tilemap_draw(bitmap, &finalclip, state->m_ol_p123_tilemap, TILEMAP_DRAW_LAYER0, 0);
271   tilemap_draw(bitmap, &finalclip, state->m_ol_p0_tilemap,   TILEMAP_DRAW_LAYER0, 0);
270   tilemap_draw(bitmap, finalclip, state->m_ol_p123_tilemap, TILEMAP_DRAW_LAYER0, 0);
271   tilemap_draw(bitmap, finalclip, state->m_ol_p0_tilemap,   TILEMAP_DRAW_LAYER0, 0);
272272   return 0;
273273}
src/mame/video/sidearms.c
r13798r13799
174174   state->m_flipon = state->m_charon = state->m_staron = state->m_objon = state->m_bgon = 0;
175175}
176176
177static void draw_sprites_region(running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect, int start_offset, int end_offset )
177static void draw_sprites_region(running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect, int start_offset, int end_offset )
178178{
179179   UINT8 *buffered_spriteram = machine.generic.buffered_spriteram.u8;
180180   const gfx_element *gfx = machine.gfx[2];
r13798r13799
331331#endif
332332}
333333
334static void draw_sprites(running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect)
334static void draw_sprites(running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect)
335335{
336336   sidearms_state *state = machine.driver_data<sidearms_state>();
337337
src/mame/video/ladyfrog.c
r13798r13799
103103   tilemap_set_scrolly(state->m_bg_tilemap, offset, data);
104104}
105105
106static void draw_sprites( running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect )
106static void draw_sprites( running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect )
107107{
108108   ladyfrog_state *state = machine.driver_data<ladyfrog_state>();
109109   int i;
src/mame/video/tumblep.c
r13798r13799
2727   flip_screen_set(screen.machine(), BIT(flip, 7));
2828   deco16ic_pf_update(state->m_deco_tilegen1, state->m_pf1_rowscroll, state->m_pf2_rowscroll);
2929
30   bitmap->fill(256, *cliprect); /* not verified */
30   bitmap->fill(256, cliprect); /* not verified */
3131
3232   deco16ic_tilemap_2_draw(state->m_deco_tilegen1, bitmap, cliprect, TILEMAP_DRAW_OPAQUE, 0);
3333   deco16ic_tilemap_1_draw(state->m_deco_tilegen1, bitmap, cliprect, 0, 0);
src/mame/video/jack.c
r13798r13799
6464   state->m_bg_tilemap = tilemap_create(machine, get_bg_tile_info, tilemap_scan_cols_flipy, 8, 8, 32, 32);
6565}
6666
67static void jack_draw_sprites( running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect )
67static void jack_draw_sprites( running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect )
6868{
6969   jack_state *state = machine.driver_data<jack_state>();
7070   UINT8 *spriteram = state->m_spriteram;
r13798r13799
149149   state->m_bg_tilemap = tilemap_create(machine, joinem_get_bg_tile_info, tilemap_scan_cols_flipy, 8, 8, 32, 32);
150150}
151151
152static void joinem_draw_sprites( running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect )
152static void joinem_draw_sprites( running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect )
153153{
154154   jack_state *state = machine.driver_data<jack_state>();
155155   UINT8 *spriteram = state->m_spriteram;
src/mame/video/dogfgt.c
r13798r13799
184184
185185***************************************************************************/
186186
187static void draw_sprites( running_machine &machine, bitmap_t *bitmap,const rectangle *cliprect )
187static void draw_sprites( running_machine &machine, bitmap_t *bitmap,const rectangle &cliprect )
188188{
189189   dogfgt_state *state = machine.driver_data<dogfgt_state>();
190190   int offs;
src/mame/video/dietgo.c
r13798r13799
1111   flip_screen_set(screen.machine(), BIT(flip, 7));
1212   deco16ic_pf_update(state->m_deco_tilegen1, state->m_pf1_rowscroll, state->m_pf2_rowscroll);
1313
14   bitmap->fill(256, *cliprect); /* not verified */
14   bitmap->fill(256, cliprect); /* not verified */
1515
1616   deco16ic_tilemap_2_draw(state->m_deco_tilegen1, bitmap, cliprect, TILEMAP_DRAW_OPAQUE, 0);
1717   deco16ic_tilemap_1_draw(state->m_deco_tilegen1, bitmap, cliprect, 0, 0);
src/mame/video/vigilant.c
r13798r13799
6464         for( col=0; col<512; col+=32 )
6565         {
6666            drawgfx_opaque(state->m_bg_bitmap,
67                  0,machine.gfx[2],
67                  state->m_bg_bitmap->cliprect(),machine.gfx[2],
6868                  charcode,
6969                  row < 128 ? 0 : 1,
7070                  0,0,
r13798r13799
168168 ???
169169 **************************************************************************/
170170
171static void draw_foreground(running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect, int priority, int opaque )
171static void draw_foreground(running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect, int priority, int opaque )
172172{
173173   vigilant_state *state = machine.driver_data<vigilant_state>();
174174   UINT8 *videoram = state->m_videoram;
r13798r13799
192192            {
193193               sx = (sx + scroll) & 0x1ff;
194194
195               drawgfx_transmask(bitmap,&bottomvisiblearea,machine.gfx[0],
195               drawgfx_transmask(bitmap,bottomvisiblearea,machine.gfx[0],
196196                     tile_number,
197197                     color,
198198                     0,0,
r13798r13799
217217
218218
219219
220static void draw_background(running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect)
220static void draw_background(running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect)
221221{
222222   vigilant_state *state = machine.driver_data<vigilant_state>();
223223   int scrollx = 0x17a + 16*8 - (state->m_rear_horiz_scroll_low + state->m_rear_horiz_scroll_high);
r13798r13799
229229      state->m_rear_refresh=0;
230230   }
231231
232   copyscrollbitmap(bitmap,state->m_bg_bitmap,1,&scrollx,0,0,&bottomvisiblearea);
232   copyscrollbitmap(bitmap,state->m_bg_bitmap,1,&scrollx,0,0,bottomvisiblearea);
233233}
234234
235235
236static void draw_sprites(running_machine &machine, bitmap_t *bitmap,const rectangle *cliprect)
236static void draw_sprites(running_machine &machine, bitmap_t *bitmap,const rectangle &cliprect)
237237{
238238   vigilant_state *state = machine.driver_data<vigilant_state>();
239239   UINT8 *spriteram = state->m_spriteram;
r13798r13799
322322   if (state->m_rear_disable)    /* opaque foreground */
323323   {
324324      draw_foreground(screen.machine(),bitmap,cliprect,0,1);
325      draw_sprites(screen.machine(),bitmap,&bottomvisiblearea);
325      draw_sprites(screen.machine(),bitmap,bottomvisiblearea);
326326      draw_foreground(screen.machine(),bitmap,cliprect,1,0);
327327   }
328328   else
329329   {
330330      draw_background(screen.machine(),bitmap,cliprect);
331331      draw_foreground(screen.machine(),bitmap,cliprect,0,0);
332      draw_sprites(screen.machine(),bitmap,&bottomvisiblearea);
332      draw_sprites(screen.machine(),bitmap,bottomvisiblearea);
333333      draw_foreground(screen.machine(),bitmap,cliprect,1,0); // priority tiles
334334   }
335335   return 0;
src/mame/video/taitosj.c
r13798r13799
2222static const int layer_enable_mask[3] = { 0x10, 0x20, 0x40 };
2323
2424typedef void (*copy_layer_func_t)(running_machine &, bitmap_t *,
25                          const rectangle *, int, int *, rectangle *);
25                          const rectangle &, int, int *, rectangle *);
2626
2727
2828/***************************************************************************
r13798r13799
314314
315315   /* draw the sprites into separate bitmaps and check overlapping region */
316316   state->m_sprite_layer_collbitmap1->fill(TRANSPARENT_PEN);
317   drawgfx_transpen(state->m_sprite_sprite_collbitmap1, 0, get_sprite_gfx_element(machine, which1),
317   drawgfx_transpen(state->m_sprite_sprite_collbitmap1, state->m_sprite_sprite_collbitmap1->cliprect(), get_sprite_gfx_element(machine, which1),
318318         state->m_spriteram[SPRITE_RAM_PAGE_OFFSET + offs1 + 3] & 0x3f,
319319         0,
320320         state->m_spriteram[SPRITE_RAM_PAGE_OFFSET + offs1 + 2] & 0x01,
r13798r13799
322322         sx1, sy1, 0);
323323
324324   state->m_sprite_sprite_collbitmap2->fill(TRANSPARENT_PEN);
325   drawgfx_transpen(state->m_sprite_sprite_collbitmap2, 0, get_sprite_gfx_element(machine, which2),
325   drawgfx_transpen(state->m_sprite_sprite_collbitmap2, state->m_sprite_sprite_collbitmap2->cliprect(), get_sprite_gfx_element(machine, which2),
326326         state->m_spriteram[SPRITE_RAM_PAGE_OFFSET + offs2 + 3] & 0x3f,
327327         0,
328328         state->m_spriteram[SPRITE_RAM_PAGE_OFFSET + offs2 + 2] & 0x01,
r13798r13799
471471
472472   /* draw sprite into a bitmap and check if layers collide */
473473   state->m_sprite_layer_collbitmap1->fill(TRANSPARENT_PEN);
474   drawgfx_transpen(state->m_sprite_layer_collbitmap1, 0,get_sprite_gfx_element(machine, which),
474   drawgfx_transpen(state->m_sprite_layer_collbitmap1, state->m_sprite_layer_collbitmap1->cliprect(),get_sprite_gfx_element(machine, which),
475475         state->m_spriteram[SPRITE_RAM_PAGE_OFFSET + offs + 3] & 0x3f,
476476         0,
477477         flip_x, flip_y,
r13798r13799
531531      if (GLOBAL_FLIP_X) sx = 31 - sx;
532532      if (GLOBAL_FLIP_Y) sy = 31 - sy;
533533
534      drawgfx_transpen(state->m_layer_bitmap[0],0,machine.gfx[state->m_colorbank[0] & 0x08 ? 2 : 0],
534      drawgfx_transpen(state->m_layer_bitmap[0],state->m_layer_bitmap[0]->cliprect(),machine.gfx[state->m_colorbank[0] & 0x08 ? 2 : 0],
535535            state->m_videoram_1[offs],
536536            state->m_colorbank[0] & 0x07,
537537            GLOBAL_FLIP_X,GLOBAL_FLIP_Y,
538538            8*sx,8*sy,0);
539539
540      drawgfx_transpen(state->m_layer_bitmap[1],0,machine.gfx[state->m_colorbank[0] & 0x80 ? 2 : 0],
540      drawgfx_transpen(state->m_layer_bitmap[1],state->m_layer_bitmap[1]->cliprect(),machine.gfx[state->m_colorbank[0] & 0x80 ? 2 : 0],
541541            state->m_videoram_2[offs],
542542            (state->m_colorbank[0] >> 4) & 0x07,
543543            GLOBAL_FLIP_X,GLOBAL_FLIP_Y,
544544            8*sx,8*sy,0);
545545
546      drawgfx_transpen(state->m_layer_bitmap[2],0,machine.gfx[state->m_colorbank[1] & 0x08 ? 2 : 0],
546      drawgfx_transpen(state->m_layer_bitmap[2],state->m_layer_bitmap[2]->cliprect(),machine.gfx[state->m_colorbank[1] & 0x08 ? 2 : 0],
547547            state->m_videoram_3[offs],
548548            state->m_colorbank[1] & 0x07,
549549            GLOBAL_FLIP_X,GLOBAL_FLIP_Y,
r13798r13799
597597               flip_y = !flip_y;
598598            }
599599
600            drawgfx_transpen(bitmap, GLOBAL_FLIP_X ? &spritevisibleareaflip : &spritevisiblearea,get_sprite_gfx_element(machine, which), code, color,
600            drawgfx_transpen(bitmap, GLOBAL_FLIP_X ? spritevisibleareaflip : spritevisiblearea,get_sprite_gfx_element(machine, which), code, color,
601601                  flip_x, flip_y, sx, sy,0);
602602
603603            /* draw with wrap around. The horizontal games (eg. sfposeid) need this */
604            drawgfx_transpen(bitmap, GLOBAL_FLIP_X ? &spritevisibleareaflip : &spritevisiblearea,get_sprite_gfx_element(machine, which), code, color,
604            drawgfx_transpen(bitmap, GLOBAL_FLIP_X ? spritevisibleareaflip : spritevisiblearea,get_sprite_gfx_element(machine, which), code, color,
605605                  flip_x, flip_y, sx - 0x100, sy,0);
606606         }
607607      }
r13798r13799
609609}
610610
611611
612static void taitosj_copy_layer(running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect,
612static void taitosj_copy_layer(running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect,
613613                        int which, int *sprites_on, rectangle *sprite_areas)
614614{
615615   taitosj_state *state = machine.driver_data<taitosj_state>();
r13798r13799
642642         if ((i >= 0x10) && (i <= 0x17)) continue; /* no sprites here */
643643
644644         if (sprites_on[i])
645            copyscrollbitmap(state->m_sprite_layer_collbitmap2[which], state->m_layer_bitmap[which], 1, &scrollx, 32, scrolly, &sprite_areas[i]);
645            copyscrollbitmap(state->m_sprite_layer_collbitmap2[which], state->m_layer_bitmap[which], 1, &scrollx, 32, scrolly, sprite_areas[i]);
646646      }
647647   }
648648}
649649
650650
651static void kikstart_copy_layer(running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect,
651static void kikstart_copy_layer(running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect,
652652                        int which, int *sprites_on, rectangle *sprite_areas)
653653{
654654   taitosj_state *state = machine.driver_data<taitosj_state>();
r13798r13799
681681         if ((i >= 0x10) && (i <= 0x17)) continue; /* no sprites here */
682682
683683         if (sprites_on[i])
684            copyscrollbitmap(state->m_sprite_layer_collbitmap2[which], state->m_layer_bitmap[which], 32 * 8, scrollx, 1, &scrolly, &sprite_areas[i]);
684            copyscrollbitmap(state->m_sprite_layer_collbitmap2[which], state->m_layer_bitmap[which], 32 * 8, scrollx, 1, &scrolly, sprite_areas[i]);
685685      }
686686   }
687687}
688688
689689
690static void copy_layer(running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect,
690static void copy_layer(running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect,
691691                  copy_layer_func_t copy_layer_func, int which, int *sprites_on, rectangle *sprite_areas)
692692{
693693   if (which == 0)
r13798r13799
697697}
698698
699699
700static void copy_layers(running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect,
700static void copy_layers(running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect,
701701                  copy_layer_func_t copy_layer_func, int *sprites_on, rectangle *sprite_areas)
702702{
703703   taitosj_state *state = machine.driver_data<taitosj_state>();
704704   int i = 0;
705705
706706   /* fill the screen with the background color */
707   bitmap->fill(8 * (state->m_colorbank[1] & 0x07), *cliprect);
707   bitmap->fill(8 * (state->m_colorbank[1] & 0x07), cliprect);
708708
709709   for (i = 0; i < 4; i++)
710710   {
r13798r13799
726726
727727
728728static int video_update_common(running_machine &machine, bitmap_t *bitmap,
729                        const rectangle *cliprect, copy_layer_func_t copy_layer_func)
729                        const rectangle &cliprect, copy_layer_func_t copy_layer_func)
730730{
731731   int sprites_on[0x20];         /* 1 if sprite is active */
732732   rectangle sprite_areas[0x20];   /* areas on bitmap (sprite locations) */
src/mame/video/kingobox.c
r13798r13799
208208   tilemap_set_transparent_pen(state->m_fg_tilemap, 0);
209209}
210210
211static void kingofb_draw_sprites(running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect)
211static void kingofb_draw_sprites(running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect)
212212{
213213   kingofb_state *state = machine.driver_data<kingofb_state>();
214214   UINT8 *spriteram = state->m_spriteram;
r13798r13799
277277   tilemap_set_transparent_pen(state->m_fg_tilemap, 0);
278278}
279279
280static void ringking_draw_sprites( running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect )
280static void ringking_draw_sprites( running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect )
281281{
282282   kingofb_state *state = machine.driver_data<kingofb_state>();
283283   UINT8 *spriteram = state->m_spriteram;
src/mame/video/galivan.c
r13798r13799
306306
307307***************************************************************************/
308308
309static void draw_sprites( running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect )
309static void draw_sprites( running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect )
310310{
311311   galivan_state *state = machine.driver_data<galivan_state>();
312312   const UINT8 *spritepalettebank = machine.region("user1")->base();
r13798r13799
352352   tilemap_set_scrolly(state->m_bg_tilemap, 0, state->m_galivan_scrolly[0] + 256 * (state->m_galivan_scrolly[1] & 0x07));
353353
354354   if (state->m_layers & 0x40)
355      bitmap->fill(0, *cliprect);
355      bitmap->fill(0, cliprect);
356356   else
357357      tilemap_draw(bitmap, cliprect, state->m_bg_tilemap, 0, 0);
358358
r13798r13799
381381   tilemap_set_scrolly(state->m_bg_tilemap, 0, state->m_scrolly);
382382
383383   if (state->m_ninjemak_dispdisable)
384      bitmap->fill(0, *cliprect);
384      bitmap->fill(0, cliprect);
385385   else
386386      tilemap_draw(bitmap, cliprect, state->m_bg_tilemap, 0, 0);
387387
src/mame/video/esripsys.c
r13798r13799
161161   UINT8 *intensity_buf = line_buffer[state->m_12sel ? 0 : 1].intensity_buf;
162162   UINT8 *priority_buf = line_buffer[state->m_12sel ? 0 : 1].priority_buf;
163163
164   for (y = cliprect->min_y; y <= cliprect->max_y; ++y)
164   for (y = cliprect.min_y; y <= cliprect.max_y; ++y)
165165   {
166      UINT32 *dest = &bitmap->pix32(y, cliprect->min_x);
166      UINT32 *dest = &bitmap->pix32(y, cliprect.min_x);
167167
168168      for (x = 0; x < 512; ++x)
169169      {
src/mame/video/tsamurai.c
r13798r13799
137137
138138***************************************************************************/
139139
140static void draw_sprites(running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect )
140static void draw_sprites(running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect )
141141{
142142   tsamurai_state *state = machine.driver_data<tsamurai_state>();
143143   UINT8 *spriteram = state->m_spriteram;
r13798r13799
218218        Note that the background color register isn't well understood
219219        (screenshots would be helpful)
220220    */
221   bitmap->fill(state->m_bgcolor, *cliprect);
221   bitmap->fill(state->m_bgcolor, cliprect);
222222   tilemap_draw(bitmap,cliprect,state->m_background,0,0);
223223   draw_sprites(screen.machine(), bitmap,cliprect);
224224   tilemap_draw(bitmap,cliprect,state->m_foreground,0,0);
src/mame/video/canyon.c
r13798r13799
3333}
3434
3535
36static void draw_sprites( running_machine &machine, bitmap_t *bitmap, const rectangle* cliprect )
36static void draw_sprites( running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect )
3737{
3838   canyon_state *state = machine.driver_data<canyon_state>();
3939   int i;
r13798r13799
5555}
5656
5757
58static void draw_bombs( running_machine &machine, bitmap_t *bitmap, const rectangle* cliprect )
58static void draw_bombs( running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect )
5959{
6060   canyon_state *state = machine.driver_data<canyon_state>();
6161   int i;
r13798r13799
7272      rect.max_x = sx + 1;
7373      rect.max_y = sy + 1;
7474
75      if (rect.min_x < cliprect->min_x) rect.min_x = cliprect->min_x;
76      if (rect.min_y < cliprect->min_y) rect.min_y = cliprect->min_y;
77      if (rect.max_x > cliprect->max_x) rect.max_x = cliprect->max_x;
78      if (rect.max_y > cliprect->max_y) rect.max_y = cliprect->max_y;
75      if (rect.min_x < cliprect.min_x) rect.min_x = cliprect.min_x;
76      if (rect.min_y < cliprect.min_y) rect.min_y = cliprect.min_y;
77      if (rect.max_x > cliprect.max_x) rect.max_x = cliprect.max_x;
78      if (rect.max_y > cliprect.max_y) rect.max_y = cliprect.max_y;
7979
8080      bitmap->fill(1 + 2 * i, rect);
8181   }
src/mame/video/splash.c
r13798r13799
8080   tilemap_mark_tile_dirty(state->m_bg_tilemap[offset >> 11],((offset << 1) & 0x0fff) >> 1);
8181}
8282
83static void draw_bitmap(running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect)
83static void draw_bitmap(running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect)
8484{
8585   splash_state *state = machine.driver_data<splash_state>();
8686   int sx,sy,color,count,colxor,bitswap;
r13798r13799
156156            break;
157157         }
158158
159         if (sy >= cliprect->min_y && sy <= cliprect->max_y && sx-9 >= cliprect->min_x && sx-9 <= cliprect->max_x)
159         if (sy >= cliprect.min_y && sy <= cliprect.max_y && sx-9 >= cliprect.min_x && sx-9 <= cliprect.max_x)
160160            bitmap->pix16(sy, sx-9) = 0x300+(color^colxor);
161161      }
162162   }
r13798r13799
210210      400| xxxxxxxx -------- | unused
211211*/
212212
213static void splash_draw_sprites(running_machine &machine, bitmap_t *bitmap,const rectangle *cliprect)
213static void splash_draw_sprites(running_machine &machine, bitmap_t *bitmap,const rectangle &cliprect)
214214{
215215   splash_state *state = machine.driver_data<splash_state>();
216216   int i;
r13798r13799
231231   }
232232}
233233
234static void funystrp_draw_sprites(running_machine &machine, bitmap_t *bitmap,const rectangle *cliprect)
234static void funystrp_draw_sprites(running_machine &machine, bitmap_t *bitmap,const rectangle &cliprect)
235235{
236236   splash_state *state = machine.driver_data<splash_state>();
237237   int i;
src/mame/video/f1gp.c
r13798r13799
177177
178178***************************************************************************/
179179
180static void f1gp_draw_sprites( running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect, int chip, int primask )
180static void f1gp_draw_sprites( running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect, int chip, int primask )
181181{
182182   f1gp_state *state = machine.driver_data<f1gp_state>();
183183   int attr_start, first;
r13798r13799
254254{
255255   f1gp_state *state = screen.machine().driver_data<f1gp_state>();
256256
257   screen.machine().priority_bitmap->fill(0, *cliprect);
257   screen.machine().priority_bitmap->fill(0, cliprect);
258258
259259   k053936_zoom_draw(state->m_k053936, bitmap, cliprect, state->m_roz_tilemap, 0, 0, 1);
260260
r13798r13799
275275}
276276
277277
278static void f1gpb_draw_sprites( running_machine &machine, bitmap_t *bitmap,const rectangle *cliprect )
278static void f1gpb_draw_sprites( running_machine &machine, bitmap_t *bitmap,const rectangle &cliprect )
279279{
280280   f1gp_state *state = machine.driver_data<f1gp_state>();
281281   UINT16 *spriteram = state->m_spriteram;
r13798r13799
357357
358358   tilemap_set_scrolly(state->m_fg_tilemap, 0, state->m_fgregs[0] + 8);
359359
360   screen.machine().priority_bitmap->fill(0, *cliprect);
360   screen.machine().priority_bitmap->fill(0, cliprect);
361361
362362   tilemap_draw_roz(bitmap, cliprect, state->m_roz_tilemap,
363363      startx << 13, starty << 13,
r13798r13799
372372}
373373
374374
375static void f1gp2_draw_sprites( running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect )
375static void f1gp2_draw_sprites( running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect )
376376{
377377   f1gp_state *state = machine.driver_data<f1gp_state>();
378378   int offs;
r13798r13799
449449   f1gp_state *state = screen.machine().driver_data<f1gp_state>();
450450
451451   if (state->m_gfxctrl & 4)   /* blank screen */
452      bitmap->fill(get_black_pen(screen.machine()), *cliprect);
452      bitmap->fill(get_black_pen(screen.machine()), cliprect);
453453   else
454454   {
455455      switch (state->m_gfxctrl & 3)
src/mame/video/namcos2.c
r13798r13799
125125DrawRozHelper(
126126   bitmap_t *bitmap,
127127   tilemap_t *tmap,
128   const rectangle *clip,
128   const rectangle &clip,
129129   const struct RozParam *rozInfo )
130130{
131131   tilemap_set_palette_offset( tmap, rozInfo->color );
r13798r13799
164164      UINT32 size_mask = rozInfo->size - 1;
165165      bitmap_t *srcbitmap = tilemap_get_pixmap(tmap);
166166      bitmap_t *flagsbitmap = tilemap_get_flagsmap(tmap);
167      UINT32 srcx = (rozInfo->startx + (clip->min_x * rozInfo->incxx) +
168         (clip->min_y * rozInfo->incyx));
169      UINT32 srcy = (rozInfo->starty + (clip->min_x * rozInfo->incxy) +
170         (clip->min_y * rozInfo->incyy));
171      int destx = clip->min_x;
172      int desty = clip->min_y;
167      UINT32 srcx = (rozInfo->startx + (clip.min_x * rozInfo->incxx) +
168         (clip.min_y * rozInfo->incyx));
169      UINT32 srcy = (rozInfo->starty + (clip.min_x * rozInfo->incxy) +
170         (clip.min_y * rozInfo->incyy));
171      int destx = clip.min_x;
172      int desty = clip.min_y;
173173
174      int row_count = (clip->max_y - desty) + 1;
174      int row_count = (clip.max_y - desty) + 1;
175175      int row_block_count = row_count / ROZ_BLOCK_SIZE;
176176      int row_extra_count = row_count % ROZ_BLOCK_SIZE;
177177
178      int column_count = (clip->max_x - destx) + 1;
178      int column_count = (clip.max_x - destx) + 1;
179179      int column_block_count = column_count / ROZ_BLOCK_SIZE;
180180      int column_extra_count = column_count % ROZ_BLOCK_SIZE;
181181
r13798r13799
245245} /* DrawRozHelper */
246246
247247static void
248DrawROZ(bitmap_t *bitmap,const rectangle *cliprect)
248DrawROZ(bitmap_t *bitmap,const rectangle &cliprect)
249249{
250250   const int xoffset = 38,yoffset = 0;
251251   struct RozParam rozParam;
r13798r13799
450450}
451451
452452static void
453ApplyClip( rectangle *clip, const rectangle *cliprect )
453ApplyClip( rectangle &clip, const rectangle &cliprect )
454454{
455   clip->min_x = GetPaletteRegister(0) - 0x4a;
456   clip->max_x = GetPaletteRegister(1) - 0x4a - 1;
457   clip->min_y = GetPaletteRegister(2) - 0x21;
458   clip->max_y = GetPaletteRegister(3) - 0x21 - 1;
455   clip.min_x = GetPaletteRegister(0) - 0x4a;
456   clip.max_x = GetPaletteRegister(1) - 0x4a - 1;
457   clip.min_y = GetPaletteRegister(2) - 0x21;
458   clip.max_y = GetPaletteRegister(3) - 0x21 - 1;
459459   /* intersect with master clip rectangle */
460   *clip &= *cliprect;
460   clip &= cliprect;
461461} /* ApplyClip */
462462
463463SCREEN_UPDATE( namcos2_default )
r13798r13799
466466   int pri;
467467
468468   UpdatePalette(screen.machine());
469   bitmap->fill(get_black_pen(screen.machine()), *cliprect );
470   ApplyClip( &clip, cliprect );
469   bitmap->fill(get_black_pen(screen.machine()), cliprect );
470   ApplyClip( clip, cliprect );
471471
472472   /* HACK: enable ROZ layer only if it has priority > 0 */
473473   tilemap_set_enable(tilemap_roz,(namcos2_gfx_ctrl & 0x7000) ? 1 : 0);
r13798r13799
476476   {
477477      if( (pri&1)==0 )
478478      {
479         namco_tilemap_draw( bitmap, &clip, pri/2 );
479         namco_tilemap_draw( bitmap, clip, pri/2 );
480480
481481         if( ((namcos2_gfx_ctrl & 0x7000) >> 12)==pri/2 )
482482         {
483            DrawROZ(bitmap,&clip);
483            DrawROZ(bitmap,clip);
484484         }
485         namcos2_draw_sprites(screen.machine(), bitmap, &clip, pri/2, namcos2_gfx_ctrl );
485         namcos2_draw_sprites(screen.machine(), bitmap, clip, pri/2, namcos2_gfx_ctrl );
486486      }
487487   }
488488   return 0;
r13798r13799
503503   int pri;
504504
505505   UpdatePalette(screen.machine());
506   bitmap->fill(get_black_pen(screen.machine()), *cliprect );
507   ApplyClip( &clip, cliprect );
506   bitmap->fill(get_black_pen(screen.machine()), cliprect );
507   ApplyClip( clip, cliprect );
508508
509509   for( pri=0; pri<16; pri++ )
510510   {
511511      if( (pri&1)==0 )
512512      {
513         namco_tilemap_draw( bitmap, &clip, pri/2 );
513         namco_tilemap_draw( bitmap, clip, pri/2 );
514514      }
515      namco_road_draw(screen.machine(), bitmap,&clip,pri );
516      namcos2_draw_sprites(screen.machine(), bitmap,&clip,pri,namcos2_gfx_ctrl );
515      namco_road_draw(screen.machine(), bitmap,clip,pri );
516      namcos2_draw_sprites(screen.machine(), bitmap,clip,pri,namcos2_gfx_ctrl );
517517   }
518518   return 0;
519519}
r13798r13799
540540   int pri;
541541
542542   UpdatePalette(screen.machine());
543   bitmap->fill(get_black_pen(screen.machine()), *cliprect );
544   ApplyClip( &clip, cliprect );
543   bitmap->fill(get_black_pen(screen.machine()), cliprect );
544   ApplyClip( clip, cliprect );
545545
546546   for( pri=0; pri<16; pri++ )
547547   {
548548      if( (pri&1)==0 )
549549      {
550         namco_tilemap_draw( bitmap, &clip, pri/2 );
550         namco_tilemap_draw( bitmap, clip, pri/2 );
551551      }
552      namco_road_draw(screen.machine(), bitmap,&clip,pri );
552      namco_road_draw(screen.machine(), bitmap,clip,pri );
553553      if( namcos2_gametype==NAMCOS2_LUCKY_AND_WILD )
554554      {
555         namco_roz_draw( bitmap, &clip, pri );
555         namco_roz_draw( bitmap, clip, pri );
556556      }
557      namco_obj_draw(screen.machine(), bitmap, &clip, pri );
557      namco_obj_draw(screen.machine(), bitmap, clip, pri );
558558   }
559559   return 0;
560560}
r13798r13799
573573   int pri;
574574
575575   UpdatePalette(screen.machine());
576   bitmap->fill(get_black_pen(screen.machine()), *cliprect );
577   ApplyClip( &clip, cliprect );
576   bitmap->fill(get_black_pen(screen.machine()), cliprect );
577   ApplyClip( clip, cliprect );
578578
579579   for( pri=0; pri<8; pri++ )
580580   {
581      namco_tilemap_draw( bitmap, &clip, pri );
582      namco_obj_draw(screen.machine(), bitmap, &clip, pri );
581      namco_tilemap_draw( bitmap, clip, pri );
582      namco_obj_draw(screen.machine(), bitmap, clip, pri );
583583   }
584584   return 0;
585585}
r13798r13799
599599   int pri;
600600
601601   UpdatePalette(screen.machine());
602   bitmap->fill(get_black_pen(screen.machine()), *cliprect );
603   ApplyClip( &clip, cliprect );
602   bitmap->fill(get_black_pen(screen.machine()), cliprect );
603   ApplyClip( clip, cliprect );
604604
605605   for( pri=0; pri<16; pri++ )
606606   {
607607      if( (pri&1)==0 )
608608      {
609         namco_tilemap_draw( bitmap, &clip, pri/2 );
609         namco_tilemap_draw( bitmap, clip, pri/2 );
610610      }
611      namco_roz_draw( bitmap, &clip, pri );
612      namcos2_draw_sprites_metalhawk(screen.machine(), bitmap,&clip,pri );
611      namco_roz_draw( bitmap, clip, pri );
612      namcos2_draw_sprites_metalhawk(screen.machine(), bitmap,clip,pri );
613613   }
614614   return 0;
615615}
src/mame/video/route16.c
r13798r13799
126126 */
127127
128128static int video_update_stratvox_ttmahjng(running_machine &machine, bitmap_t *bitmap,
129                                const rectangle *cliprect,
129                                const rectangle &cliprect,
130130                                pen_t (*make_pen)(UINT8))
131131{
132132   route16_state *state = machine.driver_data<route16_state>();
src/mame/video/tecmosys.c
r13798r13799
301301{
302302   tecmosys_state *state = screen.machine().driver_data<tecmosys_state>();
303303
304   bitmap->fill(screen.machine().pens[0x4000], *cliprect);
304   bitmap->fill(screen.machine().pens[0x4000], cliprect);
305305
306306
307307   tilemap_set_scrolly( state->m_bg0tilemap, 0, state->m_c80000regs[1]+16);
r13798r13799
313313   tilemap_set_scrolly( state->m_bg2tilemap, 0, state->m_b00000regs[1]+17);
314314   tilemap_set_scrollx( state->m_bg2tilemap, 0, state->m_b00000regs[0]+106);
315315
316   state->m_tmp_tilemap_composebitmap->fill(0, *cliprect);
316   state->m_tmp_tilemap_composebitmap->fill(0, cliprect);
317317
318   state->m_tmp_tilemap_renderbitmap->fill(0, *cliprect);
318   state->m_tmp_tilemap_renderbitmap->fill(0, cliprect);
319319   tilemap_draw(state->m_tmp_tilemap_renderbitmap,cliprect,state->m_bg0tilemap,0,0);
320320   tecmosys_tilemap_copy_to_compose(state, 0x0000);
321321
322   state->m_tmp_tilemap_renderbitmap->fill(0, *cliprect);
322   state->m_tmp_tilemap_renderbitmap->fill(0, cliprect);
323323   tilemap_draw(state->m_tmp_tilemap_renderbitmap,cliprect,state->m_bg1tilemap,0,0);
324324   tecmosys_tilemap_copy_to_compose(state, 0x4000);
325325
326   state->m_tmp_tilemap_renderbitmap->fill(0, *cliprect);
326   state->m_tmp_tilemap_renderbitmap->fill(0, cliprect);
327327   tilemap_draw(state->m_tmp_tilemap_renderbitmap,cliprect,state->m_bg2tilemap,0,0);
328328   tecmosys_tilemap_copy_to_compose(state, 0x8000);
329329
330   state->m_tmp_tilemap_renderbitmap->fill(0, *cliprect);
330   state->m_tmp_tilemap_renderbitmap->fill(0, cliprect);
331331   tilemap_draw(state->m_tmp_tilemap_renderbitmap,cliprect,state->m_txt_tilemap,0,0);
332332   tecmosys_tilemap_copy_to_compose(state, 0xc000);
333333
src/mame/video/kan_panb.c
r13798r13799
1515
1616   /* not standard snowbros video */
1717
18   bitmap->fill(0xf0, *cliprect);
18   bitmap->fill(0xf0, cliprect);
1919
2020   for (offs = 0x0000/2;offs < 0x2000/2;offs += 8)
2121   {
r13798r13799
101101
102102   /* not standard snowbros video */
103103
104   bitmap->fill(0xf0, *cliprect);
104   bitmap->fill(0xf0, cliprect);
105105
106106   for (offs = 0x0000/2;offs < 0x2000/2;offs += 8)
107107   {
r13798r13799
152152   UINT16 *spriteram16 = state->m_bootleg_spriteram16;
153153   int offs;
154154
155   bitmap->fill(get_black_pen(screen.machine()), *cliprect);
155   bitmap->fill(get_black_pen(screen.machine()), cliprect);
156156
157157   for (offs = 0;offs < state->m_spriteram_size/2;offs += 8)
158158   {
r13798r13799
220220
221221   /* This clears & redraws the entire screen each pass */
222222
223   bitmap->fill(get_black_pen(screen.machine()), *cliprect);
223   bitmap->fill(get_black_pen(screen.machine()), cliprect);
224224
225225   for (offs = 0;offs < state->m_spriteram_size/2;offs += 8)
226226   {
src/mame/video/exzisus.c
r13798r13799
8484   int gfx_num, gfx_attr, gfx_offs;
8585
8686   /* Is this correct ? */
87   bitmap->fill(1023, *cliprect);
87   bitmap->fill(1023, cliprect);
8888
8989   /* ---------- 1st TC0010VCU ---------- */
9090   sx = 0;
src/mame/video/exidy440.c
r13798r13799
302302 *
303303 *************************************/
304304
305static void draw_sprites(screen_device &screen, bitmap_t *bitmap, const rectangle *cliprect,
305static void draw_sprites(screen_device &screen, bitmap_t *bitmap, const rectangle &cliprect,
306306                   int scroll_offset, int check_collision)
307307{
308308   exidy440_state *state = screen.machine().driver_data<exidy440_state>();
r13798r13799
324324      UINT8 *src;
325325
326326      /* skip if out of range */
327      if (yoffs < cliprect->min_y || yoffs >= cliprect->max_y + 16)
327      if (yoffs < cliprect.min_y || yoffs >= cliprect.max_y + 16)
328328         continue;
329329
330330      /* get a pointer to the source image */
r13798r13799
345345            sy += (VBSTART - VBEND);
346346
347347         /* stop if we get before the current scanline */
348         if (yoffs < cliprect->min_y)
348         if (yoffs < cliprect.min_y)
349349            break;
350350
351351         /* only draw scanlines that are in this cliprect */
352         if (yoffs <= cliprect->max_y)
352         if (yoffs <= cliprect.max_y)
353353         {
354354            UINT8 *old = &state->m_local_videoram[sy * 512 + xoffs];
355355            int currx = xoffs;
r13798r13799
403403 *
404404 *************************************/
405405
406static void update_screen(screen_device &screen, bitmap_t *bitmap, const rectangle *cliprect,
406static void update_screen(screen_device &screen, bitmap_t *bitmap, const rectangle &cliprect,
407407                    int scroll_offset, int check_collision)
408408{
409409   exidy440_state *state = screen.machine().driver_data<exidy440_state>();
410410   int y, sy;
411411
412412   /* draw any dirty scanlines from the VRAM directly */
413   sy = scroll_offset + cliprect->min_y;
414   for (y = cliprect->min_y; y <= cliprect->max_y; y++, sy++)
413   sy = scroll_offset + cliprect.min_y;
414   for (y = cliprect.min_y; y <= cliprect.max_y; y++, sy++)
415415   {
416416      /* wrap at the bottom of the screen */
417417      if (sy >= VBSTART)
r13798r13799
439439   update_screen(screen, bitmap, cliprect, 0, TRUE);
440440
441441   /* generate an interrupt once/frame for the beam */
442   if (cliprect->max_y == screen.visible_area().max_y)
442   if (cliprect.max_y == screen.visible_area().max_y)
443443   {
444444      int i;
445445
src/mame/video/dassault.c
r13798r13799
1111
1212/******************************************************************************/
1313
14static void draw_sprites( running_machine& machine, bitmap_t *bitmap, const rectangle *cliprect, int pf_priority )
14static void draw_sprites( running_machine& machine, bitmap_t *bitmap, const rectangle &cliprect, int pf_priority )
1515{
1616   dassault_state *state = machine.driver_data<dassault_state>();
1717   UINT16 *buffered_spriteram = machine.generic.buffered_spriteram.u16;
r13798r13799
186186
187187   /* Draw playfields/update priority bitmap */
188188   decocomn_clear_sprite_priority_bitmap(state->m_decocomn);
189   screen.machine().priority_bitmap->fill(0, *cliprect);
190   bitmap->fill(screen.machine().pens[3072], *cliprect);
189   screen.machine().priority_bitmap->fill(0, cliprect);
190   bitmap->fill(screen.machine().pens[3072], cliprect);
191191   deco16ic_tilemap_2_draw(state->m_deco_tilegen2, bitmap, cliprect, TILEMAP_DRAW_OPAQUE, 0);
192192
193193   /* The middle playfields can be swapped priority-wise */
src/mame/video/ssrj.c
r13798r13799
236236}
237237
238238
239static void draw_objects(running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect )
239static void draw_objects(running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect )
240240{
241241   ssrj_state *state = machine.driver_data<ssrj_state>();
242242   int i,j,k,x,y;
src/mame/video/pingpong.c
r13798r13799
113113   state->m_bg_tilemap = tilemap_create(machine, get_bg_tile_info, tilemap_scan_rows, 8, 8, 32, 32);
114114}
115115
116static void draw_sprites(running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect )
116static void draw_sprites(running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect )
117117{
118118   /* This is strange; it's unlikely that the sprites actually have a hardware */
119119   /* clipping region, but I haven't found another way to have them masked by */
r13798r13799
137137      color = spriteram[offs] & 0x1f;
138138      schar = spriteram[offs + 2] & 0x7f;
139139
140      drawgfx_transmask(bitmap,&spritevisiblearea,machine.gfx[1],
140      drawgfx_transmask(bitmap,spritevisiblearea,machine.gfx[1],
141141            schar,
142142            color,
143143            flipx,flipy,
src/mame/video/gotya.c
r13798r13799
115115   state->m_bg_tilemap = tilemap_create(machine, get_bg_tile_info, tilemap_scan_rows_thehand, 8, 8, 64, 32);
116116}
117117
118static void draw_status_row( running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect, int sx, int col )
118static void draw_status_row( running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect, int sx, int col )
119119{
120120   gotya_state *state = machine.driver_data<gotya_state>();
121121   int row;
r13798r13799
143143   }
144144}
145145
146static void draw_sprites( running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect )
146static void draw_sprites( running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect )
147147{
148148   gotya_state *state = machine.driver_data<gotya_state>();
149149   UINT8 *spriteram = state->m_spriteram;
r13798r13799
167167   }
168168}
169169
170static void draw_status( running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect )
170static void draw_status( running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect )
171171{
172172   draw_status_row(machine, bitmap, cliprect, 0,  1);
173173   draw_status_row(machine, bitmap, cliprect, 1,  0);
src/mame/video/tatsumi.c
r13798r13799
249249/********************************************************************/
250250
251251INLINE void roundupt_drawgfxzoomrotate(
252      bitmap_t *dest_bmp, const rectangle *clip, const gfx_element *gfx,
252      bitmap_t *dest_bmp, const rectangle &clip, const gfx_element *gfx,
253253      UINT32 code,UINT32 color,int flipx,int flipy,UINT32 ssx,UINT32 ssy,
254254      int scalex, int scaley, int rotate, int write_priority_only )
255255{
r13798r13799
266266    */
267267
268268   /* KW 991012 -- Added code to force clip to bitmap boundary */
269   if(clip)
270   {
271      myclip = *clip;
272      myclip &= dest_bmp->cliprect();
273      clip=&myclip;
274   }
269   myclip = clip;
270   myclip &= dest_bmp->cliprect();
275271
276272   {
277273      if( gfx )
r13798r13799
338334               y_index = 0;
339335            }
340336
341            if( clip )
342            {
343               if( sx < clip->min_x)
344               { /* clip left */
345                  int pixels = clip->min_x-sx;
346                  sx += pixels;
347                  x_index_base += pixels*dx;
348               }
349               if( sy < clip->min_y )
350               { /* clip top */
351                  int pixels = clip->min_y-sy;
352                  sy += pixels;
353                  y_index += pixels*dy;
354               }
355               /* NS 980211 - fixed incorrect clipping */
356               if( ex > clip->max_x+1 )
357               { /* clip right */
358                  int pixels = ex-clip->max_x-1;
359                  ex -= pixels;
360               }
361               if( ey > clip->max_y+1 )
362               { /* clip bottom */
363                  int pixels = ey-clip->max_y-1;
364                  ey -= pixels;
365               }
337            if( sx < myclip.min_x)
338            { /* clip left */
339               int pixels = myclip.min_x-sx;
340               sx += pixels;
341               x_index_base += pixels*dx;
366342            }
343            if( sy < myclip.min_y )
344            { /* clip top */
345               int pixels = myclip.min_y-sy;
346               sy += pixels;
347               y_index += pixels*dy;
348            }
349            /* NS 980211 - fixed incorrect clipping */
350            if( ex > myclip.max_x+1 )
351            { /* clip right */
352               int pixels = ex-myclip.max_x-1;
353               ex -= pixels;
354            }
355            if( ey > myclip.max_y+1 )
356            { /* clip bottom */
357               int pixels = ey-myclip.max_y-1;
358               ey -= pixels;
359            }
367360
368361            if( ex>sx )
369362            { /* skip if inner loop doesn't draw anything */
r13798r13799
457450
458451static void mycopyrozbitmap_core(bitmap_t *bitmap,bitmap_t *srcbitmap,
459452      int dstx,int dsty, int srcwidth, int srcheight,int incxx,int incxy,int incyx,int incyy,
460      const rectangle *clip,int transparent_color)
453      const rectangle &clip,int transparent_color)
461454{
462455   UINT32 cx;
463456   UINT32 cy;
r13798r13799
480473   ex = dstx + srcwidth;
481474   ey = dsty + srcheight;
482475
483   if (sx<clip->min_x) sx=clip->min_x;
484   if (ex>clip->max_x) ex=clip->max_x;
485   if (sy<clip->min_y) sy=clip->min_y;
486   if (ey>clip->max_y) ey=clip->max_y;
476   if (sx<clip.min_x) sx=clip.min_x;
477   if (ex>clip.max_x) ex=clip.max_x;
478   if (sy<clip.min_y) sy=clip.min_y;
479   if (ey>clip.max_y) ey=clip.max_y;
487480
488481   if (sx <= ex)
489482   {
r13798r13799
517510   }
518511}
519512
520static void draw_sprites(running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect, int write_priority_only, int rambank)
513static void draw_sprites(running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect, int write_priority_only, int rambank)
521514{
522515   tatsumi_state *state = machine.driver_data<tatsumi_state>();
523516   UINT16 *spriteram16 = state->m_spriteram;
r13798r13799
704697   }
705698}
706699
707static void draw_sky(running_machine &machine, bitmap_t *bitmap,const rectangle *cliprect, int palette_base, int start_offset)
700static void draw_sky(running_machine &machine, bitmap_t *bitmap,const rectangle &cliprect, int palette_base, int start_offset)
708701{
709702   // all todo
710703   int x,y;
r13798r13799
726719   }
727720}
728721
729static void draw_road(running_machine &machine, bitmap_t *bitmap,const rectangle *cliprect,bitmap_t *shadow_bitmap)
722static void draw_road(running_machine &machine, bitmap_t *bitmap,const rectangle &cliprect,bitmap_t *shadow_bitmap)
730723{
731724   tatsumi_state *state = machine.driver_data<tatsumi_state>();
732725/*
r13798r13799
10171010
10181011/* Draw the sky and ground, applying rotation (eventually). Experimental! */
10191012#if 0
1020static void draw_ground(running_machine &machine, bitmap_t *dst, const rectangle *cliprect)
1013static void draw_ground(running_machine &machine, bitmap_t *dst, const rectangle &cliprect)
10211014{
10221015   tatsumi_state *state = machine.driver_data<tatsumi_state>();
10231016   int x, y;
r13798r13799
10261019   UINT16 gva = 0x180; // TODO
10271020   UINT8 sky_val = state->m_apache3_rotate_ctrl[1] & 0xff;
10281021
1029   for (y = cliprect->min_y; y <= cliprect->max_y; ++y)
1022   for (y = cliprect.min_y; y <= cliprect.max_y; ++y)
10301023   {
10311024      UINT16 rgdb = 0;//state->m_apache3_road_x_ram[gva & 0xff];
10321025      UINT16 gha = 0xf60; // test
r13798r13799
10351028      if (gva & 0x100)
10361029      {
10371030         /* Sky */
1038         for (x = cliprect->min_x; x <= cliprect->max_x; ++x)
1031         for (x = cliprect.min_x; x <= cliprect.max_x; ++x)
10391032         {
10401033            dst->pix32(y, x) = machine.pens[0x100 + (sky_val & 0x7f)];
10411034
r13798r13799
10461039      else
10471040      {
10481041         /* Ground */
1049         for (x = cliprect->min_x; x <= cliprect->max_x; ++x)
1042         for (x = cliprect.min_x; x <= cliprect.max_x; ++x)
10501043         {
10511044            UINT8 colour;
10521045            UINT16 hval;
r13798r13799
10891082
10901083   tilemap_set_scrollx(state->m_tx_layer,0,24);
10911084
1092   bitmap->fill(screen.machine().pens[0], *cliprect);
1085   bitmap->fill(screen.machine().pens[0], cliprect);
10931086   draw_sky(screen.machine(), bitmap, cliprect, 256, state->m_apache3_rotate_ctrl[1]);
10941087//  draw_ground(screen.machine(), bitmap, cliprect);
10951088   draw_sprites(screen.machine(), bitmap,cliprect,0, (state->m_sprite_control_ram[0x20]&0x1000) ? 0x1000 : 0);
r13798r13799
11081101   tilemap_set_scrollx(state->m_tx_layer,0,24);
11091102   tilemap_set_scrolly(state->m_tx_layer,0,0); //(((state->m_roundupt_crt_reg[0xe]<<8)|state->m_roundupt_crt_reg[0xf])>>5) + 96);
11101103
1111   bitmap->fill(screen.machine().pens[384], *cliprect); // todo
1112   screen.machine().priority_bitmap->fill(0, *cliprect);
1104   bitmap->fill(screen.machine().pens[384], cliprect); // todo
1105   screen.machine().priority_bitmap->fill(0, cliprect);
11131106
11141107   draw_sprites(screen.machine(), screen.machine().priority_bitmap,cliprect,1,(state->m_sprite_control_ram[0xe0]&0x1000) ? 0x1000 : 0); // Alpha pass only
11151108   draw_road(screen.machine(), bitmap,cliprect,screen.machine().priority_bitmap);
r13798r13799
11311124      state->m_bigfight_last_bank=state->m_bigfight_bank;
11321125   }
11331126
1134   bitmap->fill(screen.machine().pens[0], *cliprect);
1127   bitmap->fill(screen.machine().pens[0], cliprect);
11351128
11361129   draw_bg(screen.machine(), bitmap, state->m_layer3, &state->m_cyclwarr_videoram1[0x000], &state->m_cyclwarr_videoram1[0x100], state->m_cyclwarr_videoram1, state->m_bigfight_a40000[0], 8, -0x80, 512, 4096);
11371130   draw_bg(screen.machine(), bitmap, state->m_layer2, &state->m_cyclwarr_videoram1[0x200], &state->m_cyclwarr_videoram1[0x300], state->m_cyclwarr_videoram1, state->m_bigfight_a40000[0], 8, -0x80, 512, 4096);
r13798r13799
11561149      state->m_bigfight_last_bank=state->m_bigfight_bank;
11571150   }
11581151
1159   bitmap->fill(screen.machine().pens[0], *cliprect);
1152   bitmap->fill(screen.machine().pens[0], cliprect);
11601153   draw_bg(screen.machine(), bitmap, state->m_layer3, &state->m_cyclwarr_videoram1[0x000], &state->m_cyclwarr_videoram1[0x100], state->m_cyclwarr_videoram1, state->m_bigfight_a40000[0], 8, -0x40, 1024, 2048);
11611154   draw_bg(screen.machine(), bitmap, state->m_layer2, &state->m_cyclwarr_videoram1[0x200], &state->m_cyclwarr_videoram1[0x300], state->m_cyclwarr_videoram1, state->m_bigfight_a40000[0], 8, -0x40, 1024, 2048);
11621155   draw_bg(screen.machine(), bitmap, state->m_layer1, &state->m_cyclwarr_videoram0[0x000], &state->m_cyclwarr_videoram0[0x100], state->m_cyclwarr_videoram0, state->m_bigfight_a40000[0], 8, -0x40, 1024, 2048);
src/mame/video/decocomn.c
r13798r13799
126126/* A special pdrawgfx z-buffered sprite renderer that is needed to properly draw multiple sprite sources with alpha */
127127void decocomn_pdrawgfx(
128128      device_t *device,
129      bitmap_t *dest, const rectangle *clip, const gfx_element *gfx,
129      bitmap_t *dest, const rectangle &clip, const gfx_element *gfx,
130130      UINT32 code, UINT32 color, int flipx, int flipy, int sx, int sy,
131131      int transparent_color, UINT32 pri_mask, UINT32 sprite_mask, UINT8 write_pri, UINT8 alpha)
132132{
src/mame/video/supbtime.c
r13798r13799
2929   flip_screen_set(screen.machine(), BIT(flip, 7));
3030   deco16ic_pf_update(state->m_deco_tilegen1, state->m_pf1_rowscroll, state->m_pf2_rowscroll);
3131
32   bitmap->fill(768, *cliprect);
32   bitmap->fill(768, cliprect);
3333
3434   deco16ic_tilemap_2_draw(state->m_deco_tilegen1, bitmap, cliprect, 0, 0);
3535   screen.machine().device<decospr_device>("spritegen")->draw_sprites(screen.machine(), bitmap, cliprect, state->m_spriteram, 0x400);
src/mame/video/konamiic.c
r13798r13799
15181518// there is another implementation of this in  machine/konamigx.c (!)
15191519//  why?
15201520
1521static void K053936_zoom_draw(int chip,UINT16 *ctrl,UINT16 *linectrl, bitmap_t *bitmap,const rectangle *cliprect,tilemap_t *tmap,int flags,UINT32 priority, int glfgreat_hack)
1521static void K053936_zoom_draw(int chip,UINT16 *ctrl,UINT16 *linectrl, bitmap_t *bitmap,const rectangle &cliprect,tilemap_t *tmap,int flags,UINT32 priority, int glfgreat_hack)
15221522{
15231523   if (!tmap)
15241524      return;
r13798r13799
15421542      {
15431543         my_clip.min_x = ctrl[0x08] + K053936_offset[chip][0]+2;
15441544         my_clip.max_x = ctrl[0x09] + K053936_offset[chip][0]+2 - 1;
1545         if (my_clip.min_x < cliprect->min_x)
1546            my_clip.min_x = cliprect->min_x;
1547         if (my_clip.max_x > cliprect->max_x)
1548            my_clip.max_x = cliprect->max_x;
1545         if (my_clip.min_x < cliprect.min_x)
1546            my_clip.min_x = cliprect.min_x;
1547         if (my_clip.max_x > cliprect.max_x)
1548            my_clip.max_x = cliprect.max_x;
15491549
15501550         y = ctrl[0x0a] + K053936_offset[chip][1]-2;
1551         if (y < cliprect->min_y)
1552            y = cliprect->min_y;
1551         if (y < cliprect.min_y)
1552            y = cliprect.min_y;
15531553         maxy = ctrl[0x0b] + K053936_offset[chip][1]-2 - 1;
1554         if (maxy > cliprect->max_y)
1555            maxy = cliprect->max_y;
1554         if (maxy > cliprect.max_y)
1555            maxy = cliprect.max_y;
15561556      }
15571557      else
15581558      {
1559         my_clip.min_x = cliprect->min_x;
1560         my_clip.max_x = cliprect->max_x;
1559         my_clip.min_x = cliprect.min_x;
1560         my_clip.max_x = cliprect.max_x;
15611561
1562         y = cliprect->min_y;
1563         maxy = cliprect->max_y;
1562         y = cliprect.min_y;
1563         maxy = cliprect.max_y;
15641564      }
15651565
15661566      while (y <= maxy)
r13798r13799
15811581         startx -= K053936_offset[chip][0] * incxx;
15821582         starty -= K053936_offset[chip][0] * incxy;
15831583
1584         tilemap_draw_roz(bitmap,&my_clip,tmap,startx << 5,starty << 5,
1584         tilemap_draw_roz(bitmap,my_clip,tmap,startx << 5,starty << 5,
15851585               incxx << 5,incxy << 5,0,0,
15861586               K053936_wraparound[chip],
15871587               flags,priority);
r13798r13799
16391639}
16401640
16411641
1642void K053936_0_zoom_draw(bitmap_t *bitmap,const rectangle *cliprect,tilemap_t *tmap,int flags,UINT32 priority, int glfgreat_hack)
1642void K053936_0_zoom_draw(bitmap_t *bitmap,const rectangle &cliprect,tilemap_t *tmap,int flags,UINT32 priority, int glfgreat_hack)
16431643{
16441644   K053936_zoom_draw(0,K053936_0_ctrl,K053936_0_linectrl,bitmap,cliprect,tmap,flags,priority, glfgreat_hack);
16451645}
r13798r13799
25942594         // force tilemap into a clean, static state
25952595         // *really ugly but it minimizes alteration to tilemap.c
25962596         memset (&zerorect, 0, sizeof(rectangle));   // zero dimension
2597         tilemap_draw(bitmap, &zerorect, tmap, 0, 0);   // dummy call to reset tile_dirty_map
2597         tilemap_draw(bitmap, zerorect, tmap, 0, 0);   // dummy call to reset tile_dirty_map
25982598         xprmap->fill(0);                  // reset pixel transparency_bitmap;
25992599         memset(xprdata, TILEMAP_PIXEL_LAYER0, 0x800);   // reset tile transparency_data;
26002600      }
r13798r13799
26872687   return(0);
26882688}
26892689
2690void K056832_tilemap_draw(running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect, int layer, UINT32 flags, UINT32 priority)
2690void K056832_tilemap_draw(running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect, int layer, UINT32 flags, UINT32 priority)
26912691{
26922692   static int last_colorbase[K056832_PAGE_COUNT];
26932693
r13798r13799
27212721   height = rowspan * K056832_PAGE_HEIGHT;
27222722   width  = colspan * K056832_PAGE_WIDTH;
27232723
2724   cminx = cliprect->min_x;
2725   cmaxx = cliprect->max_x;
2726   cminy = cliprect->min_y;
2727   cmaxy = cliprect->max_y;
2724   cminx = cliprect.min_x;
2725   cmaxx = cliprect.max_x;
2726   cminy = cliprect.min_y;
2727   cmaxy = cliprect.max_y;
27282728
27292729   // flip correction registers
27302730   flipy = K056832_regs[0] & 0x20;
r13798r13799
29612961         // the tilemaps are 512 pixels across.  Assume that if the limits were set as below that we
29622962         // want the tilemap to be drawn on the right hand side..  this is probably not the correct
29632963         // logic, but it works.
2964         if ((drawrect.min_x>0) && (drawrect.max_x==511)) drawrect.max_x=cliprect->max_x;
2964         if ((drawrect.min_x>0) && (drawrect.max_x==511)) drawrect.max_x=cliprect.max_x;
29652965
29662966         tilemap_set_scrollx(tmap, 0, dx);
29672967
29682968         LINE_SHORTCIRCUIT:
2969         tilemap_draw(bitmap, &drawrect, tmap, flags, priority);
2969         tilemap_draw(bitmap, drawrect, tmap, flags, priority);
29702970
29712971      } // end of line loop
29722972   } // end of column loop
src/mame/video/blmbycar.c
r13798r13799
165165
166166***************************************************************************/
167167
168static void draw_sprites( running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect )
168static void draw_sprites( running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect )
169169{
170170   blmbycar_state *state = machine.driver_data<blmbycar_state>();
171171   UINT16 *source, *finish;
r13798r13799
243243}
244244#endif
245245
246   screen.machine().priority_bitmap->fill(0, *cliprect);
246   screen.machine().priority_bitmap->fill(0, cliprect);
247247
248248   if (layers_ctrl & 1)
249249      for (i = 0; i <= 1; i++)
250250         tilemap_draw(bitmap, cliprect, state->m_tilemap_0, i, i);
251251   else
252      bitmap->fill(0, *cliprect);
252      bitmap->fill(0, cliprect);
253253
254254   if (layers_ctrl & 2)
255255      for (i = 0; i <= 1; i++)
src/mame/video/decocomn.h
r13798r13799
5050void decocomn_clear_sprite_priority_bitmap(device_t *device);
5151void decocomn_pdrawgfx(
5252      device_t *device,
53      bitmap_t *dest,const rectangle *clip,const gfx_element *gfx,
53      bitmap_t *dest,const rectangle &clip,const gfx_element *gfx,
5454      UINT32 code,UINT32 color,int flipx,int flipy,int sx,int sy,
5555      int transparent_color,UINT32 pri_mask,UINT32 sprite_mask,UINT8 write_pri,UINT8 alpha);
5656
src/mame/video/retofinv.c
r13798r13799
212212      {
213213         for (x = 0;x <= sizex;x++)
214214         {
215            drawgfx_transmask(bitmap,&spritevisiblearea,machine.gfx[1],
215            drawgfx_transmask(bitmap,spritevisiblearea,machine.gfx[1],
216216               sprite + gfx_offs[y ^ (sizey * flipy)][x ^ (sizex * flipx)],
217217               color,
218218               flipx,flipy,
src/mame/video/konamiic.h
r13798r13799
3737
3838extern UINT16 *K053936_0_ctrl,*K053936_0_linectrl;
3939extern UINT16 *K053936_1_ctrl,*K053936_1_linectrl;
40void K053936_0_zoom_draw(bitmap_t *bitmap,const rectangle *cliprect,tilemap_t *tmap,int flags,UINT32 priority, int glfgreat_hack);
40void K053936_0_zoom_draw(bitmap_t *bitmap,const rectangle &cliprect,tilemap_t *tmap,int flags,UINT32 priority, int glfgreat_hack);
4141void K053936_wraparound_enable(int chip, int status);
4242void K053936_set_offset(int chip, int xoffs, int yoffs);
4343
r13798r13799
7676WRITE16_HANDLER( K056832_b_word_w );
7777void K056832_mark_plane_dirty(int num);
7878void K056832_MarkAllTilemapsDirty(void);
79void K056832_tilemap_draw(running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect, int num, UINT32 flags, UINT32 priority);
79void K056832_tilemap_draw(running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect, int num, UINT32 flags, UINT32 priority);
8080int  K056832_get_LayerAssociation(void);
8181void K056832_set_LayerOffset(int layer, int offsx, int offsy);
8282void K056832_set_UpdateMode(int mode);
src/mame/video/meadows.c
r13798r13799
7878 *
7979 *************************************/
8080
81static void draw_sprites(running_machine &machine, bitmap_t *bitmap, const rectangle *clip)
81static void draw_sprites(running_machine &machine, bitmap_t *bitmap, const rectangle &clip)
8282{
8383   meadows_state *state = machine.driver_data<meadows_state>();
8484   UINT8 *spriteram = state->m_spriteram;
src/mame/video/bogeyman.c
r13798r13799
104104   tilemap_set_transparent_pen(state->m_fg_tilemap, 0);
105105}
106106
107static void draw_sprites( running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect )
107static void draw_sprites( running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect )
108108{
109109   bogeyman_state *state = machine.driver_data<bogeyman_state>();
110110   int offs;
src/mame/video/srmp2.c
r13798r13799
5353SCREEN_UPDATE( srmp2 )
5454{
5555   srmp2_state *state = screen.machine().driver_data<srmp2_state>();
56   bitmap->fill(0x1ff, *cliprect);
56   bitmap->fill(0x1ff, cliprect);
5757
5858   screen.machine().device<seta001_device>("spritegen")->set_transpen(15);
5959
r13798r13799
7171SCREEN_UPDATE( srmp3 )
7272{
7373   //srmp2_state *state = screen.machine().driver_data<srmp2_state>();
74   bitmap->fill(0x1f0, *cliprect);
74   bitmap->fill(0x1f0, cliprect);
7575
7676   screen.machine().device<seta001_device>("spritegen")->set_fg_xoffsets( 0x10, 0x10 );
7777   screen.machine().device<seta001_device>("spritegen")->set_fg_yoffsets( 0x06, 0x06 );
r13798r13799
8787SCREEN_UPDATE( mjyuugi )
8888{
8989   //srmp2_state *state = screen.machine().driver_data<srmp2_state>();
90   bitmap->fill(0x1f0, *cliprect);
90   bitmap->fill(0x1f0, cliprect);
9191
9292   screen.machine().device<seta001_device>("spritegen")->set_fg_xoffsets( 0x10, 0x10 );
9393   screen.machine().device<seta001_device>("spritegen")->set_fg_yoffsets( 0x06, 0x06 );
src/mame/video/m72.c
r13798r13799
430430
431431***************************************************************************/
432432
433static void m72_draw_sprites(running_machine &machine, bitmap_t *bitmap,const rectangle *cliprect)
433static void m72_draw_sprites(running_machine &machine, bitmap_t *bitmap,const rectangle &cliprect)
434434{
435435   m72_state *state = machine.driver_data<m72_state>();
436436   UINT16 *spriteram = state->m_buffered_spriteram;
r13798r13799
484484   }
485485}
486486
487static void majtitle_draw_sprites(running_machine &machine, bitmap_t *bitmap,const rectangle *cliprect)
487static void majtitle_draw_sprites(running_machine &machine, bitmap_t *bitmap,const rectangle &cliprect)
488488{
489489   m72_state *state = machine.driver_data<m72_state>();
490490   UINT16 *spriteram16_2 = state->m_spriteram2;
r13798r13799
540540   m72_state *state = screen.machine().driver_data<m72_state>();
541541   if (state->m_video_off)
542542   {
543      bitmap->fill(get_black_pen(screen.machine()), *cliprect);
543      bitmap->fill(get_black_pen(screen.machine()), cliprect);
544544      return 0;
545545   }
546546
r13798r13799
566566
567567   if (state->m_video_off)
568568   {
569      bitmap->fill(get_black_pen(screen.machine()), *cliprect);
569      bitmap->fill(get_black_pen(screen.machine()), cliprect);
570570      return 0;
571571   }
572572
src/mame/video/ohmygod.c
r13798r13799
7676
7777***************************************************************************/
7878
79static void draw_sprites( running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect )
79static void draw_sprites( running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect )
8080{
8181   ohmygod_state *state = machine.driver_data<ohmygod_state>();
8282   UINT16 *spriteram = state->m_spriteram;
src/mame/video/pokechmp.c
r13798r13799
3838       8, 8, 32, 32);
3939}
4040
41static void draw_sprites(running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect)
41static void draw_sprites(running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect)
4242{
4343   pokechmp_state *state = machine.driver_data<pokechmp_state>();
4444   UINT8 *spriteram = state->m_spriteram;
src/mame/video/snk68.c
r13798r13799
199199
200200***************************************************************************/
201201
202static void draw_sprites(running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect, int group)
202static void draw_sprites(running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect, int group)
203203{
204204   snk68_state *state = machine.driver_data<snk68_state>();
205205   UINT16 *spriteram16 = state->m_spriteram;
r13798r13799
235235      {
236236         my &= 0x1ff;
237237
238         if (my <= cliprect->max_y && my + 15 >= cliprect->min_y)
238         if (my <= cliprect.max_y && my + 15 >= cliprect.min_y)
239239         {
240240            int color = *(tiledata++) & 0x7f;
241241            int tile = *(tiledata++);
r13798r13799
292292{
293293   snk68_state *state = screen.machine().driver_data<snk68_state>();
294294
295   bitmap->fill(0x7ff, *cliprect);
295   bitmap->fill(0x7ff, cliprect);
296296
297297   /* This appears to be the correct priority order */
298298   draw_sprites(screen.machine(), bitmap, cliprect, 2);
src/mame/video/madalien.c
r13798r13799
155155
156156   gfx_element_set_source(machine.gfx[0], state->m_charram);
157157
158   drawgfx_opaque(state->m_headlight_bitmap, NULL, machine.gfx[2], 0, 0, 0, 0, 0x00, 0x00);
159   drawgfx_opaque(state->m_headlight_bitmap, NULL, machine.gfx[2], 0, 0, 0, 1, 0x00, 0x40);
158   drawgfx_opaque(state->m_headlight_bitmap, state->m_headlight_bitmap->cliprect(), machine.gfx[2], 0, 0, 0, 0, 0x00, 0x00);
159   drawgfx_opaque(state->m_headlight_bitmap, state->m_headlight_bitmap->cliprect(), machine.gfx[2], 0, 0, 0, 1, 0x00, 0x40);
160160}
161161
162162
163static void draw_edges(running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect, int flip, int scroll_mode)
163static void draw_edges(running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect, int flip, int scroll_mode)
164164{
165165   madalien_state *state = machine.driver_data<madalien_state>();
166166   rectangle clip_edge1;
167167   rectangle clip_edge2;
168168
169   clip_edge1 = *cliprect;
170   clip_edge2 = *cliprect;
169   clip_edge1 = cliprect;
170   clip_edge2 = cliprect;
171171
172172   if (flip)
173173   {
r13798r13799
180180      clip_edge2.min_y = *state->m_edge2_pos | 0x80;
181181   }
182182
183   clip_edge1 &= *cliprect;
184   clip_edge2 &= *cliprect;
183   clip_edge1 &= cliprect;
184   clip_edge2 &= cliprect;
185185
186186   tilemap_mark_all_tiles_dirty(state->m_tilemap_edge1[scroll_mode]);
187187   tilemap_mark_all_tiles_dirty(state->m_tilemap_edge2[scroll_mode]);
r13798r13799
194194   tilemap_set_scrollx(state->m_tilemap_edge2[scroll_mode], 0, -(*state->m_scroll & 0xfc));
195195   tilemap_set_scrolly(state->m_tilemap_edge2[scroll_mode], 0, *state->m_edge2_pos & 0x7f);
196196
197   tilemap_draw(bitmap, &clip_edge1, state->m_tilemap_edge1[scroll_mode], 0, 0);
198   tilemap_draw(bitmap, &clip_edge2, state->m_tilemap_edge2[scroll_mode], 0, 0);
197   tilemap_draw(bitmap, clip_edge1, state->m_tilemap_edge1[scroll_mode], 0, 0);
198   tilemap_draw(bitmap, clip_edge2, state->m_tilemap_edge2[scroll_mode], 0, 0);
199199}
200200
201201
202static void draw_headlight(running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect, int flip)
202static void draw_headlight(running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect, int flip)
203203{
204204   madalien_state *state = machine.driver_data<madalien_state>();
205205   if (BIT(*state->m_video_flags, 0))
r13798r13799
214214         if (flip)
215215            hy = ~hy;
216216
217         if ((hy < cliprect->min_y) || (hy > cliprect->max_y))
217         if ((hy < cliprect.min_y) || (hy > cliprect.max_y))
218218            continue;
219219
220220         for (x = 0; x < 0x80; x++)
r13798r13799
224224            if (flip)
225225               hx = ~hx;
226226
227            if ((hx < cliprect->min_x) || (hx > cliprect->max_x))
227            if ((hx < cliprect.min_x) || (hx > cliprect.max_x))
228228               continue;
229229
230230            if (state->m_headlight_bitmap->pix16(y, x) != 0)
r13798r13799
235235}
236236
237237
238static void draw_foreground(running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect, int flip)
238static void draw_foreground(running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect, int flip)
239239{
240240   madalien_state *state = machine.driver_data<madalien_state>();
241241   tilemap_set_flip(state->m_tilemap_fg, flip ? TILEMAP_FLIPX | TILEMAP_FLIPY : 0);
r13798r13799
265265   // mode 3 - transition from A to B
266266   int scroll_mode = *state->m_scroll & 3;
267267
268   bitmap->fill(0, *cliprect);
268   bitmap->fill(0, cliprect);
269269   draw_edges(screen.machine(), bitmap, cliprect, flip, scroll_mode);
270270   draw_foreground(screen.machine(), bitmap, cliprect, flip);
271271
r13798r13799
295295         min_x = 0xff - max_x_save;
296296      }
297297
298      for (y = cliprect->min_y; y <= cliprect->max_y ; y++)
298      for (y = cliprect.min_y; y <= cliprect.max_y ; y++)
299299         for (x = min_x; x <= max_x; x++)
300            if ((x >= cliprect->min_x) && (x <= cliprect->max_x))
300            if ((x >= cliprect.min_x) && (x <= cliprect.max_x))
301301               bitmap->pix16(y, x) |= 8;
302302   }
303303
src/mame/video/aeroboto.c
r13798r13799
129129
130130***************************************************************************/
131131
132static void draw_sprites( running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect )
132static void draw_sprites( running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect )
133133{
134134   aeroboto_state *state = machine.driver_data<aeroboto_state>();
135135   int offs;
r13798r13799
176176
177177      star_color += 2;
178178
179      bitmap->fill(sky_color, *cliprect);
179      bitmap->fill(sky_color, cliprect);
180180
181181      // actual scroll speed is unknown but it can be adjusted by changing the SCROLL_SPEED constant
182182      state->m_sx += (char)(*state->m_starx - state->m_ox);
r13798r13799
210210   {
211211      state->m_sx = state->m_ox = *state->m_starx;
212212      state->m_sy = state->m_oy = *state->m_stary;
213      bitmap->fill(sky_color, *cliprect);
213      bitmap->fill(sky_color, cliprect);
214214   }
215215
216216   for (y = 0; y < 64; y++)
r13798r13799
218218
219219   // the playfield is part of a splitscreen and should not overlap with status display
220220   tilemap_set_scrolly(state->m_bg_tilemap, 0, *state->m_vscroll);
221   tilemap_draw(bitmap, &splitrect2, state->m_bg_tilemap, 0, 0);
221   tilemap_draw(bitmap, splitrect2, state->m_bg_tilemap, 0, 0);
222222
223223   draw_sprites(screen.machine(), bitmap, cliprect);
224224
225225   // the status display behaves more closely to a 40-line splitscreen than an overlay
226226   tilemap_set_scrolly(state->m_bg_tilemap, 0, 0);
227   tilemap_draw(bitmap, &splitrect1, state->m_bg_tilemap, 0, 0);
227   tilemap_draw(bitmap, splitrect1, state->m_bg_tilemap, 0, 0);
228228   return 0;
229229}
src/mame/video/firetrap.c
r13798r13799
200200
201201***************************************************************************/
202202
203static void draw_sprites( running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect )
203static void draw_sprites( running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect )
204204{
205205   firetrap_state *state = machine.driver_data<firetrap_state>();
206206   int offs;
src/mame/video/thedeep.c
r13798r13799
147147
148148***************************************************************************/
149149
150static void draw_sprites(running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect)
150static void draw_sprites(running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect)
151151{
152152   thedeep_state *state = machine.driver_data<thedeep_state>();
153153   UINT8 *s = state->m_spriteram, *end = s + state->m_spriteram_size;
r13798r13799
224224      tilemap_set_scrolly(state->m_tilemap_0, x, y + scrolly);
225225   }
226226
227   bitmap->fill(get_black_pen(screen.machine()), *cliprect);
227   bitmap->fill(get_black_pen(screen.machine()), cliprect);
228228
229229   tilemap_draw(bitmap,cliprect,state->m_tilemap_0,0,0);
230230   draw_sprites(screen.machine(), bitmap,cliprect);
src/mame/video/oneshot.c
r13798r13799
6666   tilemap_set_transparent_pen(state->m_fg_tilemap,  0);
6767}
6868
69static void draw_crosshairs( running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect )
69static void draw_crosshairs( running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect )
7070{
7171   oneshot_state *state = machine.driver_data<oneshot_state>();
7272   //int xpos,ypos;
r13798r13799
9999      state->m_gun_x_p2 = 0;
100100}
101101
102static void draw_sprites( running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect )
102static void draw_sprites( running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect )
103103{
104104   oneshot_state *state = machine.driver_data<oneshot_state>();
105105   const UINT16 *source = state->m_sprites;
r13798r13799
160160{
161161   oneshot_state *state = screen.machine().driver_data<oneshot_state>();
162162
163   bitmap->fill(get_black_pen(screen.machine()), *cliprect);
163   bitmap->fill(get_black_pen(screen.machine()), cliprect);
164164
165165   tilemap_set_scrollx(state->m_mid_tilemap, 0, state->m_scroll[0] - 0x1f5);
166166   tilemap_set_scrolly(state->m_mid_tilemap, 0, state->m_scroll[1]);
r13798r13799
177177{
178178   oneshot_state *state = screen.machine().driver_data<oneshot_state>();
179179
180   bitmap->fill(get_black_pen(screen.machine()), *cliprect);
180   bitmap->fill(get_black_pen(screen.machine()), cliprect);
181181
182182   tilemap_set_scrolly(state->m_mid_tilemap, 0, state->m_scroll[1]); // other registers aren't used so we don't know which layers they relate to
183183
src/mame/video/stlforce.c
r13798r13799
9999
100100/* sprites - quite a bit still needs doing .. */
101101
102static void draw_sprites(running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect )
102static void draw_sprites(running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect )
103103{
104104   stlforce_state *state = machine.driver_data<stlforce_state>();
105105   const UINT16 *source = state->m_spriteram+0x0;
src/mame/video/topspeed.c
r13798r13799
2626
2727********************************************************************************/
2828
29static void draw_sprites( running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect )
29static void draw_sprites( running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect )
3030{
3131   topspeed_state *state = machine.driver_data<topspeed_state>();
3232   UINT16 *spriteram = state->m_spriteram;
r13798r13799
155155   layer[2] = 1;
156156   layer[3] = 0;
157157
158   screen.machine().priority_bitmap->fill(0, *cliprect);
159   bitmap->fill(0, *cliprect);
158   screen.machine().priority_bitmap->fill(0, cliprect);
159   bitmap->fill(0, cliprect);
160160
161161#ifdef MAME_DEBUG
162162   if (state->m_dislayer[3] == 0)
src/mame/video/amspdwy.c
r13798r13799
103103
104104***************************************************************************/
105105
106static void draw_sprites( running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect )
106static void draw_sprites( running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect )
107107{
108108   amspdwy_state *state = machine.driver_data<amspdwy_state>();
109109   UINT8 *spriteram = state->m_spriteram;
src/mame/video/fantland.c
r13798r13799
6161#include "emu.h"
6262#include "includes/fantland.h"
6363
64static void draw_sprites(running_machine &machine, bitmap_t *bitmap,const rectangle *cliprect)
64static void draw_sprites(running_machine &machine, bitmap_t *bitmap,const rectangle &cliprect)
6565{
6666   fantland_state *state = machine.driver_data<fantland_state>();
6767   UINT8 *spriteram_2 = state->m_spriteram2;
r13798r13799
141141
142142SCREEN_UPDATE( fantland )
143143{
144   bitmap->fill(0, *cliprect);
144   bitmap->fill(0, cliprect);
145145   draw_sprites(screen.machine(),bitmap,cliprect);
146146
147147   return 0;
src/mame/video/toobin.c
r13798r13799
238238   int x, y;
239239
240240   /* draw the playfield */
241   priority_bitmap->fill(0, *cliprect);
241   priority_bitmap->fill(0, cliprect);
242242   tilemap_draw(state->m_pfbitmap, cliprect, state->m_playfield_tilemap, 0, 0);
243243   tilemap_draw(state->m_pfbitmap, cliprect, state->m_playfield_tilemap, 1, 1);
244244   tilemap_draw(state->m_pfbitmap, cliprect, state->m_playfield_tilemap, 2, 2);
r13798r13799
246246
247247   /* draw and merge the MO */
248248   mobitmap = atarimo_render(0, cliprect, &rectlist);
249   for (y = cliprect->min_y; y <= cliprect->max_y; y++)
249   for (y = cliprect.min_y; y <= cliprect.max_y; y++)
250250   {
251251      UINT32 *dest = &bitmap->pix32(y);
252252      UINT16 *mo = &mobitmap->pix16(y);
253253      UINT16 *pf = &state->m_pfbitmap->pix16(y);
254254      UINT8 *pri = &priority_bitmap->pix8(y);
255      for (x = cliprect->min_x; x <= cliprect->max_x; x++)
255      for (x = cliprect.min_x; x <= cliprect.max_x; x++)
256256      {
257257         UINT16 pix = pf[x];
258258         if (mo[x])
src/mame/video/srumbler.c
r13798r13799
113113
114114***************************************************************************/
115115
116static void draw_sprites(running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect)
116static void draw_sprites(running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect)
117117{
118118   UINT8 *buffered_spriteram = machine.generic.buffered_spriteram.u8;
119119   int offs;
src/mame/video/legionna.c
r13798r13799
251251
252252*************************************************************************/
253253
254static void draw_sprites(running_machine &machine, bitmap_t *bitmap,const rectangle *cliprect)
254static void draw_sprites(running_machine &machine, bitmap_t *bitmap,const rectangle &cliprect)
255255{
256256   legionna_state *state = machine.driver_data<legionna_state>();
257257   UINT16 *spriteram16 = machine.generic.spriteram.u16;
r13798r13799
335335
336336      /* heated barrel hardware seems to need 0x1ff with 0x100 sign bit for sprite warp,
337337           this doesn't work on denjin makai as the visible area is larger */
338      if (cliprect->max_x<(320-1))
338      if (cliprect.max_x<(320-1))
339339      {
340340         x&=0x1ff;
341341         y&=0x1ff;
r13798r13799
428428   tilemap_set_scrollx( state->m_text_layer, 0,  0/*state->m_scrollram16[6]*/ );
429429   tilemap_set_scrolly( state->m_text_layer, 0,  0/*state->m_scrollram16[7]*/ );
430430
431   screen.machine().priority_bitmap->fill(0, *cliprect);
432   bitmap->fill(get_black_pen(screen.machine()), *cliprect);   /* wrong color? */
431   screen.machine().priority_bitmap->fill(0, cliprect);
432   bitmap->fill(get_black_pen(screen.machine()), cliprect);   /* wrong color? */
433433
434434   /* state->m_layer_disable is a guess based on 'stage 1' screen in heatbrl  */
435435
r13798r13799
461461   tilemap_set_scrolly( state->m_text_layer, 0,  0/*state->m_scrollram16[7]*/ );
462462
463463
464   bitmap->fill(0x0200, *cliprect);
465   screen.machine().priority_bitmap->fill(0, *cliprect);
464   bitmap->fill(0x0200, cliprect);
465   screen.machine().priority_bitmap->fill(0, cliprect);
466466
467467   if (!(state->m_layer_disable&0x0001)) tilemap_draw(bitmap,cliprect,state->m_background_layer,0,0);
468468   if (!(state->m_layer_disable&0x0002)) tilemap_draw(bitmap,cliprect,state->m_midground_layer,0,0);
r13798r13799
487487   tilemap_set_scrollx( state->m_text_layer, 0,  0/*state->m_scrollram16[6]*/ );
488488   tilemap_set_scrolly( state->m_text_layer, 0,  0/*state->m_scrollram16[7]*/ );
489489
490   bitmap->fill(get_black_pen(screen.machine()), *cliprect);
491   screen.machine().priority_bitmap->fill(0, *cliprect);
490   bitmap->fill(get_black_pen(screen.machine()), cliprect);
491   screen.machine().priority_bitmap->fill(0, cliprect);
492492
493493   if(!(state->m_layer_disable & 1))
494494      tilemap_draw(bitmap,cliprect,state->m_background_layer,0,1);
src/mame/video/pbaction.c
r13798r13799
8484   tilemap_set_transparent_pen(state->m_fg_tilemap, 0);
8585}
8686
87static void draw_sprites( running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect )
87static void draw_sprites( running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect )
8888{
8989   pbaction_state *state = machine.driver_data<pbaction_state>();
9090   UINT8 *spriteram = state->m_spriteram;
src/mame/video/mcr68.c
r13798r13799
212212 *
213213 *************************************/
214214
215static void mcr68_update_sprites(running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect, int priority)
215static void mcr68_update_sprites(running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect, int priority)
216216{
217217   mcr68_state *state = machine.driver_data<mcr68_state>();
218218   rectangle sprite_clip = machine.primary_screen->visible_area();
r13798r13799
222222   /* adjust for clipping */
223223   sprite_clip.min_x += state->m_sprite_clip;
224224   sprite_clip.max_x -= state->m_sprite_clip;
225   sprite_clip &= *cliprect;
225   sprite_clip &= cliprect;
226226
227227   machine.priority_bitmap->fill(1, sprite_clip);
228228
r13798r13799
256256            The color 8 is used to cover over other sprites. */
257257
258258      /* first draw the sprite, visible */
259      pdrawgfx_transmask(bitmap, &sprite_clip, machine.gfx[1], code, color, flipx, flipy, x, y,
259      pdrawgfx_transmask(bitmap, sprite_clip, machine.gfx[1], code, color, flipx, flipy, x, y,
260260            machine.priority_bitmap, 0x00, 0x0101);
261261
262262      /* then draw the mask, behind the background but obscuring following sprites */
263      pdrawgfx_transmask(bitmap, &sprite_clip, machine.gfx[1], code, color, flipx, flipy, x, y,
263      pdrawgfx_transmask(bitmap, sprite_clip, machine.gfx[1], code, color, flipx, flipy, x, y,
264264            machine.priority_bitmap, 0x02, 0xfeff);
265265   }
266266}
267267
268268
269static void zwackery_update_sprites(running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect, int priority)
269static void zwackery_update_sprites(running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect, int priority)
270270{
271271   mcr68_state *state = machine.driver_data<mcr68_state>();
272272   UINT16 *spriteram16 = state->m_spriteram;
273273   int offs;
274274
275   machine.priority_bitmap->fill(1, *cliprect);
275   machine.priority_bitmap->fill(1, cliprect);
276276
277277   /* loop over sprite RAM */
278278   for (offs = state->m_spriteram_size / 2 - 4;offs >= 0;offs -= 4)
src/mame/video/overdriv.c
r13798r13799
6060   state->m_zoom_colorbase[1] = k053251_get_palette_index(state->m_k053251, K053251_CI3);
6161   state->m_zoom_colorbase[0] = k053251_get_palette_index(state->m_k053251, K053251_CI4);
6262
63   screen.machine().priority_bitmap->fill(0, *cliprect);
63   screen.machine().priority_bitmap->fill(0, cliprect);
6464
6565   k051316_zoom_draw(state->m_k051316_1, bitmap, cliprect, 0, 0);
6666   k051316_zoom_draw(state->m_k051316_2, bitmap, cliprect, 0, 1);
src/mame/video/thunderx.c
r13798r13799
7272
7373   k052109_tilemap_update(state->m_k052109);
7474
75   screen.machine().priority_bitmap->fill(0, *cliprect);
75   screen.machine().priority_bitmap->fill(0, cliprect);
7676
7777   /* The background color is always from layer 1 - but it's always black anyway */
78//  bitmap->fill(16 * state->m_layer_colorbase[1], *cliprect);
78//  bitmap->fill(16 * state->m_layer_colorbase[1], cliprect);
7979   if (state->m_priority)
8080   {
8181      k052109_tilemap_draw(state->m_k052109, bitmap, cliprect, 2, TILEMAP_DRAW_OPAQUE, 1);
src/mame/video/spcforce.c
r13798r13799
2323   int flip = flip_screen_get(screen.machine());
2424
2525   /* draw the characters as sprites because they could be overlapping */
26   bitmap->fill(0, *cliprect);
26   bitmap->fill(0, cliprect);
2727   for (offs = 0; offs < 0x400; offs++)
2828   {
2929      int code,sx,sy,col;
src/mame/video/gsword.c
r13798r13799
161161       8, 8, 32, 64);
162162}
163163
164static void draw_sprites(running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect)
164static void draw_sprites(running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect)
165165{
166166   gsword_state *state = machine.driver_data<gsword_state>();
167167   int offs;
src/mame/video/mario.c
r13798r13799
161161 * confirmed on mametests.org as being present on real PCB as well.
162162 */
163163
164static void draw_sprites(running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect)
164static void draw_sprites(running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect)
165165{
166166   /* TODO: draw_sprites should adopt the scanline logic from dkong.c
167167     * The schematics have the same logic for sprite buffering.
src/mame/video/xmen.c
r13798r13799
9393
9494   konami_sortlayers3(layer, state->m_layerpri);
9595
96   screen.machine().priority_bitmap->fill(0, *cliprect);
96   screen.machine().priority_bitmap->fill(0, cliprect);
9797   /* note the '+1' in the background color!!! */
98   bitmap->fill(16 * bg_colorbase + 1, *cliprect);
98   bitmap->fill(16 * bg_colorbase + 1, cliprect);
9999   k052109_tilemap_draw(state->m_k052109, bitmap, cliprect, layer[0], 0, 1);
100100   k052109_tilemap_draw(state->m_k052109, bitmap, cliprect, layer[1], 0, 2);
101101   k052109_tilemap_draw(state->m_k052109, bitmap, cliprect, layer[2], 0, 4);
r13798r13799
222222   screen.machine().priority_bitmap->fill(0, cliprect);
223223   /* note the '+1' in the background color!!! */
224224   renderbitmap->fill(16 * bg_colorbase + 1, cliprect);
225   k052109_tilemap_draw(state->m_k052109, renderbitmap, &cliprect, layer[0], 0, 1);
226   k052109_tilemap_draw(state->m_k052109, renderbitmap, &cliprect, layer[1], 0, 2);
227   k052109_tilemap_draw(state->m_k052109, renderbitmap, &cliprect, layer[2], 0, 4);
225   k052109_tilemap_draw(state->m_k052109, renderbitmap, cliprect, layer[0], 0, 1);
226   k052109_tilemap_draw(state->m_k052109, renderbitmap, cliprect, layer[1], 0, 2);
227   k052109_tilemap_draw(state->m_k052109, renderbitmap, cliprect, layer[2], 0, 4);
228228
229229/* this isn't supported anymore and it is unsure if still needed; keeping here for reference
230230    pdrawgfx_shadow_lowpri = 1; fix shadows of boulders in front of feet */
231   k053247_sprites_draw(state->m_k053246, renderbitmap, &cliprect);
231   k053247_sprites_draw(state->m_k053246, renderbitmap, cliprect);
232232}
src/mame/video/atarifb.c
r13798r13799
104104
105105
106106
107static void draw_playfield_and_alpha( running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect, int playfield_x_offset, int playfield_y_offset )
107static void draw_playfield_and_alpha( running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect, int playfield_x_offset, int playfield_y_offset )
108108{
109109   atarifb_state *state = machine.driver_data<atarifb_state>();
110110   const rectangle bigfield_area(4 * 8, 34 * 8 - 1, 0 * 8, 32 * 8 - 1);
r13798r13799
115115   scroll_x[0] = - *state->m_scroll_register + 32 + playfield_x_offset;
116116   scroll_y[0] = 8 + playfield_y_offset;
117117
118   copybitmap(bitmap, tilemap_get_pixmap(state->m_alpha1_tilemap), 0, 0, 35*8, 1*8, NULL);
119   copybitmap(bitmap, tilemap_get_pixmap(state->m_alpha2_tilemap), 0, 0,  0*8, 1*8, NULL);
120   copyscrollbitmap(bitmap, tilemap_get_pixmap(state->m_field_tilemap),  1, scroll_x, 1, scroll_y, &bigfield_area);
118   copybitmap(bitmap, tilemap_get_pixmap(state->m_alpha1_tilemap), 0, 0, 35*8, 1*8, cliprect);
119   copybitmap(bitmap, tilemap_get_pixmap(state->m_alpha2_tilemap), 0, 0,  0*8, 1*8, cliprect);
120   copyscrollbitmap(bitmap, tilemap_get_pixmap(state->m_field_tilemap),  1, scroll_x, 1, scroll_y, bigfield_area);
121121}
122122
123123
124static void draw_sprites( running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect, int gfx, int is_soccer )
124static void draw_sprites( running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect, int gfx, int is_soccer )
125125{
126126   atarifb_state *state = machine.driver_data<atarifb_state>();
127127   const rectangle bigfield_area(4 * 8, 34 * 8 - 1, 0 * 8, 32 * 8 - 1);
r13798r13799
152152      {
153153         shade = ((state->m_spriteram[obj * 2 + 1 + 0x20]) & 0x07);
154154
155         drawgfx_transpen(bitmap, &bigfield_area, machine.gfx[gfx + 1],
155         drawgfx_transpen(bitmap, bigfield_area, machine.gfx[gfx + 1],
156156            charcode, shade,
157157            flipx, flipy, sx, sy, 0);
158158
159159         shade = ((state->m_spriteram[obj * 2 + 1 + 0x20]) & 0x08) >> 3;
160160      }
161161
162      drawgfx_transpen(bitmap, &bigfield_area, machine.gfx[gfx],
162      drawgfx_transpen(bitmap, bigfield_area, machine.gfx[gfx],
163163            charcode, shade,
164164            flipx, flipy, sx, sy, 0);
165165
r13798r13799
171171         if ((charcode == 0x11) && (sy == 0x07))
172172         {
173173            sy = 0xf1; /* When multiplexed, it's 0x10...why? */
174            drawgfx_transpen(bitmap, &bigfield_area, machine.gfx[gfx],
174            drawgfx_transpen(bitmap, bigfield_area, machine.gfx[gfx],
175175               charcode, 0,
176176               flipx, flipy, sx, sy, 0);
177177         }
src/mame/video/silkroad.c
r13798r13799
77/* Clean Up */
88/* is theres a bg colour register? */
99
10static void draw_sprites(running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect)
10static void draw_sprites(running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect)
1111{
1212   silkroad_state *state = machine.driver_data<silkroad_state>();
1313   const gfx_element *gfx = machine.gfx[0];
r13798r13799
144144SCREEN_UPDATE(silkroad)
145145{
146146   silkroad_state *state = screen.machine().driver_data<silkroad_state>();
147   screen.machine().priority_bitmap->fill(0, *cliprect);
148   bitmap->fill(0x7c0, *cliprect);
147   screen.machine().priority_bitmap->fill(0, cliprect);
148   bitmap->fill(0x7c0, cliprect);
149149
150150   tilemap_set_scrollx( state->m_fg_tilemap, 0, ((state->m_regs[0] & 0xffff0000) >> 16) );
151151   tilemap_set_scrolly( state->m_fg_tilemap, 0, (state->m_regs[0] & 0x0000ffff) >> 0 );
src/mame/video/lethal.c
r13798r13799
106106{
107107   lethal_state *state = screen.machine().driver_data<lethal_state>();
108108
109   bitmap->fill(7168, *cliprect);
110   screen.machine().priority_bitmap->fill(0, *cliprect);
109   bitmap->fill(7168, cliprect);
110   screen.machine().priority_bitmap->fill(0, cliprect);
111111
112112   k056832_tilemap_draw(state->m_k056832, bitmap, cliprect, 3, K056832_DRAW_FLAG_MIRROR, 1);
113113   k056832_tilemap_draw(state->m_k056832, bitmap, cliprect, 2, K056832_DRAW_FLAG_MIRROR, 2);
src/mame/video/videopin.c
r13798r13799
6666            rect.max_x = x + 15;
6767            rect.max_y = y + 15;
6868
69            if (rect.min_x < cliprect->min_x)
70               rect.min_x = cliprect->min_x;
71            if (rect.min_y < cliprect->min_y)
72               rect.min_y = cliprect->min_y;
73            if (rect.max_x > cliprect->max_x)
74               rect.max_x = cliprect->max_x;
75            if (rect.max_y > cliprect->max_y)
76               rect.max_y = cliprect->max_y;
69            if (rect.min_x < cliprect.min_x)
70               rect.min_x = cliprect.min_x;
71            if (rect.min_y < cliprect.min_y)
72               rect.min_y = cliprect.min_y;
73            if (rect.max_x > cliprect.max_x)
74               rect.max_x = cliprect.max_x;
75            if (rect.max_y > cliprect.max_y)
76               rect.max_y = cliprect.max_y;
7777
7878            x -= state->m_ball_x;
7979            y -= state->m_ball_y;
r13798r13799
8484            {
8585               for (j = 0; j < 2; j++)
8686               {
87                  drawgfx_transpen(bitmap, &rect, screen.machine().gfx[1],
87                  drawgfx_transpen(bitmap, rect, screen.machine().gfx[1],
8888                     0, 0,
8989                     0, 0,
9090                     x + 16 * i,
src/mame/video/exprraid.c
r13798r13799
9696   tilemap_set_transparent_pen(state->m_fg_tilemap, 0);
9797}
9898
99static void draw_sprites( running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect )
99static void draw_sprites( running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect )
100100{
101101   exprraid_state *state = machine.driver_data<exprraid_state>();
102102   int offs;
r13798r13799
119119         flipy = !flipy;
120120      }
121121
122      drawgfx_transpen(bitmap, 0, machine.gfx[1],
122      drawgfx_transpen(bitmap, cliprect, machine.gfx[1],
123123         code, color,
124124         flipx, flipy,
125125         sx, sy, 0);
src/mame/video/tecmo16.c
r13798r13799
225225/* mix & blend the paletted 16-bit tile and sprite bitmaps into an RGB 32-bit bitmap */
226226static void blendbitmaps(running_machine &machine,
227227      bitmap_t *dest,bitmap_t *src1,bitmap_t *src2,bitmap_t *src3,
228      int sx,int sy,const rectangle *clip)
228      int sx,int sy,const rectangle &clip)
229229{
230230   int ox;
231231   int oy;
r13798r13799
238238
239239   ex = sx + src1->width() - 1;
240240   if (sx < 0) sx = 0;
241   if (sx < clip->min_x) sx = clip->min_x;
241   if (sx < clip.min_x) sx = clip.min_x;
242242   if (ex >= dest->width()) ex = dest->width() - 1;
243   if (ex > clip->max_x) ex = clip->max_x;
243   if (ex > clip.max_x) ex = clip.max_x;
244244   if (sx > ex) return;
245245
246246   ey = sy + src1->height() - 1;
247247   if (sy < 0) sy = 0;
248   if (sy < clip->min_y) sy = clip->min_y;
248   if (sy < clip.min_y) sy = clip.min_y;
249249   if (ey >= dest->height()) ey = dest->height() - 1;
250   if (ey > clip->max_y) ey = clip->max_y;
250   if (ey > clip.max_y) ey = clip.max_y;
251251   if (sy > ey) return;
252252
253253   {
r13798r13799
332332   }
333333}
334334
335static void draw_sprites(running_machine &machine, bitmap_t *bitmap_bg, bitmap_t *bitmap_fg, bitmap_t *bitmap_sp, const rectangle *cliprect)
335static void draw_sprites(running_machine &machine, bitmap_t *bitmap_bg, bitmap_t *bitmap_fg, bitmap_t *bitmap_sp, const rectangle &cliprect)
336336{
337337   tecmo16_state *state = machine.driver_data<tecmo16_state>();
338338   UINT16 *spriteram16 = state->m_spriteram;
r13798r13799
493493SCREEN_UPDATE( tecmo16 )
494494{
495495   tecmo16_state *state = screen.machine().driver_data<tecmo16_state>();
496   screen.machine().priority_bitmap->fill(0, *cliprect);
496   screen.machine().priority_bitmap->fill(0, cliprect);
497497
498   state->m_tile_bitmap_bg->fill(0x300, *cliprect);
499   state->m_tile_bitmap_fg->fill(0, *cliprect);
500   state->m_sprite_bitmap->fill(0, *cliprect);
498   state->m_tile_bitmap_bg->fill(0x300, cliprect);
499   state->m_tile_bitmap_fg->fill(0, cliprect);
500   state->m_sprite_bitmap->fill(0, cliprect);
501501
502502   /* draw tilemaps into a 16-bit bitmap */
503503   tilemap_draw(state->m_tile_bitmap_bg, cliprect,state->m_bg_tilemap, 0, 1);
src/mame/video/naughtyb.c
r13798r13799
190190
191191   naughtyb_state *state = screen.machine().driver_data<naughtyb_state>();
192192   UINT8 *videoram = state->m_videoram;
193   bitmap_t *tmpbitmap = screen.machine().generic.tmpbitmap;
193194   int offs;
194195
195196   // for every character in the Video RAM
r13798r13799
225226         }
226227      }
227228
228      drawgfx_opaque(screen.machine().generic.tmpbitmap,0,screen.machine().gfx[0],
229      drawgfx_opaque(tmpbitmap,tmpbitmap->cliprect(),screen.machine().gfx[0],
229230            state->m_videoram2[offs] + 256 * state->m_bankreg,
230231            (state->m_videoram2[offs] >> 5) + 8 * state->m_palreg,
231232            state->m_cocktail,state->m_cocktail,
232233            8*sx,8*sy);
233234
234      drawgfx_transpen(screen.machine().generic.tmpbitmap,0,screen.machine().gfx[1],
235      drawgfx_transpen(tmpbitmap,tmpbitmap->cliprect(),screen.machine().gfx[1],
235236            videoram[offs] + 256*state->m_bankreg,
236237            (videoram[offs] >> 5) + 8 * state->m_palreg,
237238            state->m_cocktail,state->m_cocktail,
r13798r13799
242243   {
243244      int scrollx;
244245
245      copybitmap(bitmap,screen.machine().generic.tmpbitmap,0,0,-66*8,0,&leftvisiblearea);
246      copybitmap(bitmap,screen.machine().generic.tmpbitmap,0,0,-30*8,0,&rightvisiblearea);
246      copybitmap(bitmap,tmpbitmap,0,0,-66*8,0,leftvisiblearea);
247      copybitmap(bitmap,tmpbitmap,0,0,-30*8,0,rightvisiblearea);
247248
248249      scrollx = ( state->m_cocktail ) ? *state->m_scrollreg - 239 : -*state->m_scrollreg + 16;
249      copyscrollbitmap(bitmap,screen.machine().generic.tmpbitmap,1,&scrollx,0,0,&scrollvisiblearea);
250      copyscrollbitmap(bitmap,tmpbitmap,1,&scrollx,0,0,scrollvisiblearea);
250251   }
251252   return 0;
252253}
src/mame/video/toypop.c
r13798r13799
219219***************************************************************************/
220220
221221
222void draw_sprites(running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect, UINT8 *spriteram_base)
222void draw_sprites(running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect, UINT8 *spriteram_base)
223223{
224224   UINT8 *spriteram = spriteram_base + 0x780;
225225   UINT8 *spriteram_2 = spriteram + 0x800;
src/mame/video/tumbleb.c
r13798r13799
1919
2020/******************************************************************************/
2121
22static void tumblepb_draw_sprites( running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect )
22static void tumblepb_draw_sprites( running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect )
2323{
2424   tumbleb_state *state = machine.driver_data<tumbleb_state>();
2525   UINT16 *spriteram = state->m_spriteram;
r13798r13799
8585   }
8686}
8787
88static void jumpkids_draw_sprites( running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect )
88static void jumpkids_draw_sprites( running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect )
8989{
9090   tumbleb_state *state = machine.driver_data<tumbleb_state>();
9191   UINT16 *spriteram = state->m_spriteram;
r13798r13799
152152   }
153153}
154154
155static void fncywld_draw_sprites( running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect )
155static void fncywld_draw_sprites( running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect )
156156{
157157   tumbleb_state *state = machine.driver_data<tumbleb_state>();
158158   UINT16 *spriteram = state->m_spriteram;
r13798r13799
878878{
879879   tumbleb_state *state = screen.machine().driver_data<tumbleb_state>();
880880
881   //  bitmap->fill(get_black_pen(screen.machine()), *cliprect);
881   //  bitmap->fill(get_black_pen(screen.machine()), cliprect);
882882
883883   tilemap_set_scrollx(state->m_pf1_tilemap, 0, state->m_control[2] - 0x3a0);
884884   tilemap_set_scrolly(state->m_pf1_tilemap, 0, state->m_control[3]);
src/mame/video/momoko.c
r13798r13799
162162      }
163163   }
164164   else
165   bitmap->fill(256, *cliprect);
165   bitmap->fill(256, cliprect);
166166
167167
168168   /* draw sprites (momoko) */
src/mame/video/kchamp.c
r13798r13799
6868             3        XXXXXXXX
6969*/
7070
71static void kchamp_draw_sprites( running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect )
71static void kchamp_draw_sprites( running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect )
7272{
7373   kchamp_state *state = machine.driver_data<kchamp_state>();
7474   UINT8 *spriteram = state->m_spriteram;
r13798r13799
9797   }
9898}
9999
100static void kchampvs_draw_sprites( running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect )
100static void kchampvs_draw_sprites( running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect )
101101{
102102   kchamp_state *state = machine.driver_data<kchamp_state>();
103103   UINT8 *spriteram = state->m_spriteram;
src/mame/video/digdug.c
r13798r13799
240240
241241***************************************************************************/
242242
243static void draw_sprites(running_machine& machine, bitmap_t *bitmap, const rectangle *cliprect )
243static void draw_sprites(running_machine& machine, bitmap_t *bitmap, const rectangle &cliprect )
244244{
245245   digdug_state *state =  machine.driver_data<digdug_state>();
246246   UINT8 *spriteram = state->m_digdug_objram + 0x380;
r13798r13799
249249   int offs;
250250
251251   // mask upper and lower columns
252   rectangle visarea = *cliprect;
252   rectangle visarea = cliprect;
253253   visarea.min_x = 2*8;
254254   visarea.max_x = 34*8-1;
255255   if (flip_screen_get(machine))
r13798r13799
293293         for (x = 0;x <= size;x++)
294294         {
295295            UINT32 transmask = colortable_get_transpen_mask(machine.colortable, machine.gfx[1], color, 0x1f);
296            drawgfx_transmask(bitmap,&visarea,machine.gfx[1],
296            drawgfx_transmask(bitmap,visarea,machine.gfx[1],
297297               sprite + gfx_offs[y ^ (size * flipy)][x ^ (size * flipx)],
298298               color,
299299               flipx,flipy,
300300               ((sx + 16*x) & 0xff), sy + 16*y,transmask);
301301            /* wraparound */
302            drawgfx_transmask(bitmap,&visarea,machine.gfx[1],
302            drawgfx_transmask(bitmap,visarea,machine.gfx[1],
303303               sprite + gfx_offs[y ^ (size * flipy)][x ^ (size * flipx)],
304304               color,
305305               flipx,flipy,
src/mame/video/ultratnk.c
r13798r13799
120120
121121      rect &= screen.machine().primary_screen->visible_area();
122122
123      tilemap_draw(state->m_helper, &rect, state->m_playfield, 0, 0);
123      tilemap_draw(state->m_helper, rect, state->m_playfield, 0, 0);
124124
125125      if (code & 4)
126126         bank = 32;
127127
128      drawgfx_transpen(state->m_helper, &rect, screen.machine().gfx[1],
128      drawgfx_transpen(state->m_helper, rect, screen.machine().gfx[1],
129129         (code >> 3) | bank,
130130         4,
131131         0, 0,
src/mame/video/m90.c
r13798r13799
139139   state_save_register_global_array(machine, state->m_video_control_data);
140140}
141141
142static void draw_sprites(running_machine &machine, bitmap_t *bitmap,const rectangle *cliprect)
142static void draw_sprites(running_machine &machine, bitmap_t *bitmap,const rectangle &cliprect)
143143{
144144   m90_state *state = machine.driver_data<m90_state>();
145145   UINT16 *spriteram = state->m_video_data + 0xee00/2;;
r13798r13799
193193   }
194194}
195195
196static void bomblord_draw_sprites(running_machine &machine, bitmap_t *bitmap,const rectangle *cliprect)
196static void bomblord_draw_sprites(running_machine &machine, bitmap_t *bitmap,const rectangle &cliprect)
197197{
198198   m90_state *state = machine.driver_data<m90_state>();
199199   UINT16 *spriteram16 = state->m_spriteram;
r13798r13799
233233   }
234234}
235235
236static void dynablsb_draw_sprites(running_machine &machine, bitmap_t *bitmap,const rectangle *cliprect)
236static void dynablsb_draw_sprites(running_machine &machine, bitmap_t *bitmap,const rectangle &cliprect)
237237{
238238   m90_state *state = machine.driver_data<m90_state>();
239239   UINT16 *spriteram16 = state->m_spriteram;
r13798r13799
363363      tilemap_set_scrollx( state->m_pf2_wide_layer,0, state->m_video_control_data[3]+256-2 );
364364   }
365365
366   screen.machine().priority_bitmap->fill(0, *cliprect);
366   screen.machine().priority_bitmap->fill(0, cliprect);
367367
368368   if (video_enable)
369369   {
r13798r13799
375375         {
376376            int line;
377377            rectangle clip;
378            clip.min_x = cliprect->min_x;
379            clip.max_x = cliprect->max_x;
378            clip.min_x = cliprect.min_x;
379            clip.max_x = cliprect.max_x;
380380
381381            for(line = 0; line < 512; line++)
382382            {
r13798r13799
385385               if (state->m_video_control_data[6] & 0x4)
386386               {
387387                  tilemap_set_scrolly(state->m_pf2_wide_layer, 0, 0x200 + state->m_video_data[0xfc00/2 + line]);
388                  tilemap_draw(bitmap,&clip,state->m_pf2_wide_layer,0,0);
389                  tilemap_draw(bitmap,&clip,state->m_pf2_wide_layer,1,1);
388                  tilemap_draw(bitmap,clip,state->m_pf2_wide_layer,0,0);
389                  tilemap_draw(bitmap,clip,state->m_pf2_wide_layer,1,1);
390390               } else {
391391                  tilemap_set_scrolly(state->m_pf2_layer, 0, 0x200 + state->m_video_data[0xfc00/2 + line]);
392                  tilemap_draw(bitmap,&clip,state->m_pf2_layer,0,0);
393                  tilemap_draw(bitmap,&clip,state->m_pf2_layer,1,1);
392                  tilemap_draw(bitmap,clip,state->m_pf2_layer,0,0);
393                  tilemap_draw(bitmap,clip,state->m_pf2_layer,1,1);
394394               }
395395            }
396396         }
r13798r13799
410410      }
411411      else
412412      {
413         bitmap->fill(0, *cliprect);
413         bitmap->fill(0, cliprect);
414414      }
415415
416416      if (pf1_enable)
r13798r13799
420420         {
421421            int line;
422422            rectangle clip;
423            clip.min_x = cliprect->min_x;
424            clip.max_x = cliprect->max_x;
423            clip.min_x = cliprect.min_x;
424            clip.max_x = cliprect.max_x;
425425
426426            for(line = 0; line < 512; line++)
427427            {
r13798r13799
430430               if (state->m_video_control_data[5] & 0x4)
431431               {
432432                  tilemap_set_scrolly(state->m_pf1_wide_layer, 0, 0x200 + state->m_video_data[0xf800/2 + line]);
433                  tilemap_draw(bitmap,&clip,state->m_pf1_wide_layer,0,0);
434                  tilemap_draw(bitmap,&clip,state->m_pf1_wide_layer,1,1);
433                  tilemap_draw(bitmap,clip,state->m_pf1_wide_layer,0,0);
434                  tilemap_draw(bitmap,clip,state->m_pf1_wide_layer,1,1);
435435               } else {
436436                  tilemap_set_scrolly(state->m_pf1_layer, 0, 0x200 + state->m_video_data[0xf800/2 + line]);
437                  tilemap_draw(bitmap,&clip,state->m_pf1_layer,0,0);
438                  tilemap_draw(bitmap,&clip,state->m_pf1_layer,1,1);
437                  tilemap_draw(bitmap,clip,state->m_pf1_layer,0,0);
438                  tilemap_draw(bitmap,clip,state->m_pf1_layer,1,1);
439439               }
440440            }
441441         }
r13798r13799
457457      draw_sprites(screen.machine(),bitmap,cliprect);
458458
459459   } else {
460      bitmap->fill(get_black_pen(screen.machine()), *cliprect);
460      bitmap->fill(get_black_pen(screen.machine()), cliprect);
461461   }
462462
463463   return 0;
r13798r13799
467467{
468468   m90_state *state = screen.machine().driver_data<m90_state>();
469469   int i;
470   screen.machine().priority_bitmap->fill(0, *cliprect);
471   bitmap->fill(get_black_pen(screen.machine()), *cliprect);
470   screen.machine().priority_bitmap->fill(0, cliprect);
471   bitmap->fill(get_black_pen(screen.machine()), cliprect);
472472
473473   /* Setup scrolling */
474474   if (state->m_video_control_data[6]&0x20) {
r13798r13799
519519SCREEN_UPDATE( dynablsb )
520520{
521521   m90_state *state = screen.machine().driver_data<m90_state>();
522   screen.machine().priority_bitmap->fill(0, *cliprect);
523   bitmap->fill(get_black_pen(screen.machine()), *cliprect);
522   screen.machine().priority_bitmap->fill(0, cliprect);
523   bitmap->fill(get_black_pen(screen.machine()), cliprect);
524524
525525   if (!(state->m_video_data[0xf008/2] & 0x4000)) {
526526      tilemap_mark_all_tiles_dirty(state->m_pf1_wide_layer);
src/mame/video/gunbustr.c
r13798r13799
5656
5757********************************************************/
5858
59static void draw_sprites(running_machine &machine, bitmap_t *bitmap,const rectangle *cliprect,const int *primasks,int x_offs,int y_offs)
59static void draw_sprites(running_machine &machine, bitmap_t *bitmap,const rectangle &cliprect,const int *primasks,int x_offs,int y_offs)
6060{
6161   gunbustr_state *state = machine.driver_data<gunbustr_state>();
6262   UINT32 *spriteram32 = state->m_spriteram;
r13798r13799
218218   layer[3] = (priority & 0x000f) >>  0;   /* tells us which is top */
219219   layer[4] = 4;   /* text layer always over bg layers */
220220
221   screen.machine().priority_bitmap->fill(0, *cliprect);
221   screen.machine().priority_bitmap->fill(0, cliprect);
222222
223223   /* We have to assume 2nd to bottom layer is always underneath
224224       sprites as pdrawgfx cannot yet cope with more than 4 layers */
src/mame/video/decmxc06.c
r13798r13799
5555
5656
5757/* this implementation was originally from Mad Motor */
58void deco_mxc06_device::draw_sprites( running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect, UINT16* spriteram, int pri_mask, int pri_val, int col_mask )
58void deco_mxc06_device::draw_sprites( running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect, UINT16* spriteram, int pri_mask, int pri_val, int col_mask )
5959{
6060   int offs;
6161
src/mame/video/scotrsht.c
r13798r13799
9999}
100100
101101/* Same as Jailbreak + palette bank */
102static void draw_sprites(running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect )
102static void draw_sprites(running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect )
103103{
104104   scotrsht_state *state = machine.driver_data<scotrsht_state>();
105105   UINT8 *spriteram = state->m_spriteram;
src/mame/video/taito_z.c
r13798r13799
146146********************************************************/
147147
148148
149static void contcirc_draw_sprites_16x8( running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect, int y_offs )
149static void contcirc_draw_sprites_16x8( running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect, int y_offs )
150150{
151151   taitoz_state *state = machine.driver_data<taitoz_state>();
152152   UINT16 *spritemap = (UINT16 *)machine.region("user1")->base();
r13798r13799
241241
242242
243243
244static void chasehq_draw_sprites_16x16( running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect, int y_offs )
244static void chasehq_draw_sprites_16x16( running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect, int y_offs )
245245{
246246   taitoz_state *state = machine.driver_data<taitoz_state>();
247247   UINT16 *spritemap = (UINT16 *)machine.region("user1")->base();
r13798r13799
427427
428428
429429
430static void bshark_draw_sprites_16x8( running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect, int y_offs )
430static void bshark_draw_sprites_16x8( running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect, int y_offs )
431431{
432432   taitoz_state *state = machine.driver_data<taitoz_state>();
433433   UINT16 *spritemap = (UINT16 *)machine.region("user1")->base();
r13798r13799
523523
524524
525525
526static void sci_draw_sprites_16x8( running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect, int y_offs )
526static void sci_draw_sprites_16x8( running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect, int y_offs )
527527{
528528   taitoz_state *state = machine.driver_data<taitoz_state>();
529529   UINT16 *spritemap = (UINT16 *)machine.region("user1")->base();
r13798r13799
628628
629629
630630
631static void aquajack_draw_sprites_16x8(running_machine &machine, bitmap_t *bitmap,const rectangle *cliprect,int y_offs)
631static void aquajack_draw_sprites_16x8(running_machine &machine, bitmap_t *bitmap,const rectangle &cliprect,int y_offs)
632632{
633633   taitoz_state *state = machine.driver_data<taitoz_state>();
634634   UINT16 *spritemap = (UINT16 *)machine.region("user1")->base();
r13798r13799
723723
724724
725725
726static void spacegun_draw_sprites_16x8(running_machine &machine, bitmap_t *bitmap,const rectangle *cliprect,int y_offs)
726static void spacegun_draw_sprites_16x8(running_machine &machine, bitmap_t *bitmap,const rectangle &cliprect,int y_offs)
727727{
728728   taitoz_state *state = machine.driver_data<taitoz_state>();
729729   UINT16 *spritemap = (UINT16 *)machine.region("user1")->base();
r13798r13799
853853   layer[1] = layer[0] ^ 1;
854854   layer[2] = 2;
855855
856   screen.machine().priority_bitmap->fill(0, *cliprect);
856   screen.machine().priority_bitmap->fill(0, cliprect);
857857
858   bitmap->fill(0, *cliprect);
858   bitmap->fill(0, cliprect);
859859
860860   tc0100scn_tilemap_draw(state->m_tc0100scn, bitmap, cliprect, layer[0], 0, 0);
861861   tc0100scn_tilemap_draw(state->m_tc0100scn, bitmap, cliprect, layer[1], 0, 1);
r13798r13799
880880   layer[1] = layer[0] ^ 1;
881881   layer[2] = 2;
882882
883   screen.machine().priority_bitmap->fill(0, *cliprect);
883   screen.machine().priority_bitmap->fill(0, cliprect);
884884
885885   /* Ensure screen blanked even when bottom layer not drawn due to disable bit */
886   bitmap->fill(0, *cliprect);
886   bitmap->fill(0, cliprect);
887887
888888   tc0100scn_tilemap_draw(state->m_tc0100scn, bitmap, cliprect, layer[0], TILEMAP_DRAW_OPAQUE, 0);
889889   tc0100scn_tilemap_draw(state->m_tc0100scn, bitmap, cliprect, layer[1], 0, 1);
r13798r13799
906906   layer[1] = layer[0] ^ 1;
907907   layer[2] = 2;
908908
909   screen.machine().priority_bitmap->fill(0, *cliprect);
909   screen.machine().priority_bitmap->fill(0, cliprect);
910910
911911   /* Ensure screen blanked even when bottom layer not drawn due to disable bit */
912   bitmap->fill(0, *cliprect);
912   bitmap->fill(0, cliprect);
913913
914914   tc0100scn_tilemap_draw(state->m_tc0100scn, bitmap, cliprect, layer[0], TILEMAP_DRAW_OPAQUE, 0);
915915   tc0100scn_tilemap_draw(state->m_tc0100scn, bitmap, cliprect, layer[1], 0, 1);
r13798r13799
932932   layer[1] = layer[0] ^ 1;
933933   layer[2] = 2;
934934
935   screen.machine().priority_bitmap->fill(0, *cliprect);
935   screen.machine().priority_bitmap->fill(0, cliprect);
936936
937937   /* Ensure screen blanked even when bottom layer not drawn due to disable bit */
938   bitmap->fill(0, *cliprect);
938   bitmap->fill(0, cliprect);
939939
940940   tc0100scn_tilemap_draw(state->m_tc0100scn, bitmap, cliprect, layer[0], TILEMAP_DRAW_OPAQUE, 0);
941941   tc0100scn_tilemap_draw(state->m_tc0100scn, bitmap, cliprect, layer[1], 0, 1);
r13798r13799
958958   layer[1] = layer[0] ^ 1;
959959   layer[2] = 2;
960960
961   screen.machine().priority_bitmap->fill(0, *cliprect);
961   screen.machine().priority_bitmap->fill(0, cliprect);
962962
963963   /* Ensure screen blanked even when bottom layer not drawn due to disable bit */
964   bitmap->fill(0, *cliprect);
964   bitmap->fill(0, cliprect);
965965
966966   tc0100scn_tilemap_draw(state->m_tc0100scn, bitmap, cliprect, layer[0], TILEMAP_DRAW_OPAQUE, 0);
967967   tc0100scn_tilemap_draw(state->m_tc0100scn, bitmap, cliprect, layer[1], 0, 1);
r13798r13799
984984   layer[1] = layer[0] ^ 1;
985985   layer[2] = 2;
986986
987   screen.machine().priority_bitmap->fill(0, *cliprect);
987   screen.machine().priority_bitmap->fill(0, cliprect);
988988
989989   /* Ensure screen blanked even when bottom layer not drawn due to disable bit */
990   bitmap->fill(0, *cliprect);
990   bitmap->fill(0, cliprect);
991991
992992   tc0100scn_tilemap_draw(state->m_tc0100scn, bitmap, cliprect, layer[0], TILEMAP_DRAW_OPAQUE, 1);
993993   tc0100scn_tilemap_draw(state->m_tc0100scn, bitmap, cliprect, layer[1], 0, 2);
r13798r13799
10151015   layer[3] = (priority & 0x000f) >>  0;   /* tells us which is top */
10161016   layer[4] = 4;   /* text layer always over bg layers */
10171017
1018   screen.machine().priority_bitmap->fill(0, *cliprect);
1018   screen.machine().priority_bitmap->fill(0, cliprect);
10191019
10201020   /* Ensure screen blanked - this shouldn't be necessary! */
1021   bitmap->fill(0, *cliprect);
1021   bitmap->fill(0, cliprect);
10221022
10231023   tc0480scp_tilemap_draw(state->m_tc0480scp, bitmap, cliprect, layer[0], TILEMAP_DRAW_OPAQUE, 0);
10241024   tc0480scp_tilemap_draw(state->m_tc0480scp, bitmap, cliprect, layer[1], 0, 0);
src/mame/video/decmxc06.h
r13798r13799
77   deco_mxc06_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
88   static void set_gfx_region(device_t &device, int region);
99   void set_gfxregion(int region) { m_gfxregion = region; };
10   void draw_sprites( running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect, UINT16* spriteram16, int pri_mask, int pri_val, int col_mask );
10   void draw_sprites( running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect, UINT16* spriteram16, int pri_mask, int pri_val, int col_mask );
1111   void set_pri_type( int type ) { m_priority_type = type; }
1212protected:
1313   virtual void device_start();
src/mame/video/msisaac.c
r13798r13799
161161  Display refresh
162162
163163***************************************************************************/
164static void draw_sprites( running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect )
164static void draw_sprites( running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect )
165165{
166166   msisaac_state *state = machine.driver_data<msisaac_state>();
167167   const UINT8 *source = state->m_spriteram + 32 * 4 - 4;
src/mame/video/markham.c
r13798r13799
7373   tilemap_set_scroll_rows(state->m_bg_tilemap, 32);
7474}
7575
76static void draw_sprites( running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect )
76static void draw_sprites( running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect )
7777{
7878   markham_state *state = machine.driver_data<markham_state>();
7979   UINT8 *spriteram = state->m_spriteram;
src/mame/video/superqix.c
r13798r13799
165165
166166***************************************************************************/
167167
168static void pbillian_draw_sprites(running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect )
168static void pbillian_draw_sprites(running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect )
169169{
170170   superqix_state *state = machine.driver_data<superqix_state>();
171171   UINT8 *spriteram = state->m_spriteram;
r13798r13799
193193   }
194194}
195195
196static void superqix_draw_sprites(running_machine &machine, bitmap_t *bitmap,const rectangle *cliprect)
196static void superqix_draw_sprites(running_machine &machine, bitmap_t *bitmap,const rectangle &cliprect)
197197{
198198   superqix_state *state = machine.driver_data<superqix_state>();
199199   UINT8 *spriteram = state->m_spriteram;
src/mame/video/playch10.c
r13798r13799
145145   {
146146      /* When the bios is accessing vram, the video circuitry can't access it */
147147      if ( !state->m_pc10_sdcs )
148         tilemap_draw(bitmap, &top_monitor, state->m_bg_tilemap, 0, 0);
148         tilemap_draw(bitmap, top_monitor, state->m_bg_tilemap, 0, 0);
149149   }
150150   return 0;
151151}
r13798r13799
163163      /* render the ppu */
164164      ppu2c0x_render( ppu, bitmap, 0, 0, 0, 0 );
165165   else
166      bitmap->fill(0, *cliprect);
166      bitmap->fill(0, cliprect);
167167
168168   return 0;
169169}
r13798r13799
181181   if ( !state->m_pc10_sdcs )
182182      tilemap_draw(bitmap, cliprect, state->m_bg_tilemap, 0, 0);
183183   else
184      bitmap->fill(0, *cliprect);
184      bitmap->fill(0, cliprect);
185185
186186   return 0;
187187}
src/mame/video/dday.c
r13798r13799
331331
332332      bitmap_t *sl_bitmap = tilemap_get_pixmap(state->m_sl_tilemap);
333333
334      for (x = cliprect->min_x; x <= cliprect->max_x; x++)
335         for (y = cliprect->min_y; y <= cliprect->max_y; y++)
334      for (x = cliprect.min_x; x <= cliprect.max_x; x++)
335         for (y = cliprect.min_y; y <= cliprect.max_y; y++)
336336         {
337337            UINT16 src_pixel = state->m_main_bitmap->pix16(y, x);
338338
src/mame/video/cyberbal.c
r13798r13799
332332 *
333333 *************************************/
334334
335static UINT32 update_one_screen(screen_device &screen, bitmap_t *bitmap, const rectangle *cliprect, int index)
335static UINT32 update_one_screen(screen_device &screen, bitmap_t *bitmap, const rectangle &cliprect, int index)
336336{
337337   cyberbal_state *state = screen.machine().driver_data<cyberbal_state>();
338338   atarimo_rect_list rectlist;
339   rectangle tempclip = *cliprect;
339   rectangle tempclip = cliprect;
340340   bitmap_t *mobitmap;
341341   int x, y, r, mooffset, temp;
342342   rectangle visarea = screen.visible_area();
src/mame/video/lockon.c
r13798r13799
698698   if (carry) --CNT;                    \
699699} while(0)
700700
701static void rotate_draw( running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect )
701static void rotate_draw( running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect )
702702{
703703   lockon_state *state = machine.driver_data<lockon_state>();
704704   UINT32 y;
r13798r13799
722722   UINT32 axy_en  = !BIT(state->m_dx0ll, 8);
723723   UINT32 ayy_en  = !BIT(state->m_dy0ll, 8);
724724
725   for (y = 0; y <= cliprect->max_y; ++y)
725   for (y = 0; y <= cliprect.max_y; ++y)
726726   {
727727      UINT32 carry;
728728      UINT16 *dst = &bitmap->pix16(y);
r13798r13799
734734      UINT8 axx = axy;
735735      UINT8 ayx = ayy;
736736
737      for (x = 0; x <= cliprect->max_x; ++x)
737      for (x = 0; x <= cliprect.max_x; ++x)
738738      {
739739         cx &= 0x1ff;
740740         cy &= 0x1ff;
r13798r13799
803803
804804*******************************************************************************************/
805805
806static void hud_draw( running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect )
806static void hud_draw( running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect )
807807{
808808   lockon_state *state = machine.driver_data<lockon_state>();
809809   UINT8   *tile_rom = machine.region("gfx3")->base();
r13798r13799
844844      else
845845         y_size = 8;
846846
847      for (y = cliprect->min_y; y <= cliprect->max_y; ++y)
847      for (y = cliprect.min_y; y <= cliprect.max_y; ++y)
848848      {
849849         UINT32 xt;
850850         UINT32 cy;
r13798r13799
883883            {
884884               UINT32 x = x_pos + (xt << 3) + px;
885885
886               if (x <= cliprect->max_x)
886               if (x <= cliprect.max_x)
887887               {
888888                  UINT16 *dst = &bitmap->pix16(y, x);
889889
r13798r13799
936936   /* If screen output is disabled, fill with black */
937937   if (!BIT(state->m_ctrl_reg, 7))
938938   {
939      bitmap->fill(get_black_pen(screen.machine()), *cliprect);
939      bitmap->fill(get_black_pen(screen.machine()), cliprect);
940940      return 0;
941941   }
942942
src/mame/video/mappy.c
r13798r13799
399399
400400***************************************************************************/
401401
402static void mappy_draw_sprites(running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect, UINT8 *spriteram_base)
402static void mappy_draw_sprites(running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect, UINT8 *spriteram_base)
403403{
404404   UINT8 *spriteram = spriteram_base + 0x780;
405405   UINT8 *spriteram_2 = spriteram + 0x800;
r13798r13799
4794791   -------x  X position MSB
480480*/
481481
482static void phozon_draw_sprites(running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect, UINT8 *spriteram_base)
482static void phozon_draw_sprites(running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect, UINT8 *spriteram_base)
483483{
484484   UINT8 *spriteram = spriteram_base + 0x780;
485485   UINT8 *spriteram_2 = spriteram + 0x800;
r13798r13799
545545
546546   tilemap_draw(bitmap,cliprect,state->m_bg_tilemap,TILEMAP_DRAW_OPAQUE | TILEMAP_DRAW_ALL_CATEGORIES,0);
547547
548   sprite_bitmap->fill(15, *cliprect);
548   sprite_bitmap->fill(15, cliprect);
549549   mappy_draw_sprites(screen.machine(),sprite_bitmap,cliprect,state->m_spriteram);
550550   copybitmap_trans(bitmap,sprite_bitmap,0,0,0,0,cliprect,15);
551551
src/mame/video/rastan.c
r13798r13799
4141   layer[0] = 0;
4242   layer[1] = 1;
4343
44   screen.machine().priority_bitmap->fill(0, *cliprect);
44   screen.machine().priority_bitmap->fill(0, cliprect);
4545
4646   pc080sn_tilemap_draw(state->m_pc080sn, bitmap, cliprect, layer[0], TILEMAP_DRAW_OPAQUE, 1);
4747   pc080sn_tilemap_draw(state->m_pc080sn, bitmap, cliprect, layer[1], 0, 2);
src/mame/video/gijoe.c
r13798r13799
158158
159159   konami_sortlayers4(layer, state->m_layer_pri);
160160
161   bitmap->fill(get_black_pen(screen.machine()), *cliprect);
162   screen.machine().priority_bitmap->fill(0, *cliprect);
161   bitmap->fill(get_black_pen(screen.machine()), cliprect);
162   screen.machine().priority_bitmap->fill(0, cliprect);
163163
164164   k056832_tilemap_draw(state->m_k056832, bitmap, cliprect, layer[0], 0, 1);
165165   k056832_tilemap_draw(state->m_k056832, bitmap, cliprect, layer[1], 0, 2);
src/mame/video/rltennis.c
r13798r13799
122122   {
123123      if(new_data & BLTFLAG_DISPLAY_UD)
124124      {
125         copybitmap(state->m_tmp_bitmap[BITMAP_FG_DISPLAY], state->m_tmp_bitmap[BITMAP_FG_1], 0, 0, 0, 0, NULL);
125         copybitmap(state->m_tmp_bitmap[BITMAP_FG_DISPLAY], state->m_tmp_bitmap[BITMAP_FG_1], 0, 0, 0, 0, state->m_tmp_bitmap[BITMAP_FG_DISPLAY]->cliprect());
126126         state->m_tmp_bitmap[BITMAP_FG_1]->fill(0);
127127      }
128128      else
129129      {
130         copybitmap(state->m_tmp_bitmap[BITMAP_FG_DISPLAY], state->m_tmp_bitmap[BITMAP_FG_2], 0, 0, 0, 0, NULL);
130         copybitmap(state->m_tmp_bitmap[BITMAP_FG_DISPLAY], state->m_tmp_bitmap[BITMAP_FG_2], 0, 0, 0, 0, state->m_tmp_bitmap[BITMAP_FG_DISPLAY]->cliprect());
131131         state->m_tmp_bitmap[BITMAP_FG_2]->fill(0);
132132      }
133133   }
src/mame/video/tigeroad.c
r13798r13799
6767   }
6868}
6969
70static void draw_sprites(running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect, int priority )
70static void draw_sprites(running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect, int priority )
7171{
7272   UINT16 *source = &machine.generic.buffered_spriteram.u16[machine.generic.spriteram_size/2] - 4;
7373   UINT16 *finish = machine.generic.buffered_spriteram.u16;
src/mame/video/segas32.c
r13798r13799
777777 *
778778 *************************************/
779779
780static int compute_clipping_extents(screen_device &screen, int enable, int clipout, int clipmask, const rectangle *cliprect, struct extents_list *list)
780static int compute_clipping_extents(screen_device &screen, int enable, int clipout, int clipmask, const rectangle &cliprect, struct extents_list *list)
781781{
782782   segas32_state *state = screen.machine().driver_data<segas32_state>();
783783   int flip = (state->m_system32_videoram[0x1ff00/2] >> 9) & 1;
r13798r13799
787787   int i, j, y;
788788
789789   /* expand our cliprect to exclude the bottom-right */
790   tempclip = *cliprect;
790   tempclip = cliprect;
791791   tempclip.max_x++;
792792   tempclip.max_y++;
793793
r13798r13799
909909}
910910
911911
912static void update_tilemap_zoom(screen_device &screen, struct layer_info *layer, const rectangle *cliprect, int bgnum)
912static void update_tilemap_zoom(screen_device &screen, struct layer_info *layer, const rectangle &cliprect, int bgnum)
913913{
914914   segas32_state *state = screen.machine().driver_data<segas32_state>();
915915   int clipenable, clipout, clips, clipdraw_start;
r13798r13799
968968   srcy -= ((INT16)(state->m_system32_videoram[0x1ff32/2 + 2 * bgnum] << 7) >> 7) * srcystep;
969969
970970   /* finally, account for destination top,left coordinates */
971   srcx_start += cliprect->min_x * srcxstep;
972   srcy += cliprect->min_y * srcystep;
971   srcx_start += cliprect.min_x * srcxstep;
972   srcy += cliprect.min_y * srcystep;
973973
974974   /* if we're flipped, simply adjust the start/step parameters */
975975   if (flip)
976976   {
977977      const rectangle &visarea = screen.visible_area();
978978
979      srcx_start += (visarea.max_x - 2 * cliprect->min_x) * srcxstep;
980      srcy += (visarea.max_y - 2 * cliprect->min_y) * srcystep;
979      srcx_start += (visarea.max_x - 2 * cliprect.min_x) * srcxstep;
980      srcy += (visarea.max_y - 2 * cliprect.min_y) * srcystep;
981981      srcxstep = -srcxstep;
982982      srcystep = -srcystep;
983983   }
984984
985985   /* loop over the target rows */
986   for (y = cliprect->min_y; y <= cliprect->max_y; y++)
986   for (y = cliprect.min_y; y <= cliprect.max_y; y++)
987987   {
988988      UINT16 *extents = &clip_extents.extent[clip_extents.scan_extent[y]][0];
989989      UINT16 *dst = &bitmap->pix16(y);
990990      int clipdraw = clipdraw_start;
991991
992992      /* optimize for the case where we are clipped out */
993      if (clipdraw || extents[1] <= cliprect->max_x)
993      if (clipdraw || extents[1] <= cliprect.max_x)
994994      {
995995         bitmap_t *tm0, *tm1;
996996         int transparent = 0;
r13798r13799
10291029            }
10301030
10311031            /* stop at the end */
1032            if (extents[1] > cliprect->max_x)
1032            if (extents[1] > cliprect.max_x)
10331033               break;
10341034
10351035            /* swap states and advance to the next extent */
r13798r13799
10371037            extents++;
10381038         }
10391039
1040         layer->transparent[y] = (transparent == cliprect->max_x - cliprect->min_x + 1);
1040         layer->transparent[y] = (transparent == cliprect.max_x - cliprect.min_x + 1);
10411041      }
10421042      else
10431043         layer->transparent[y] = 1;
r13798r13799
10631063 *
10641064 *************************************/
10651065
1066static void update_tilemap_rowscroll(screen_device &screen, struct layer_info *layer, const rectangle *cliprect, int bgnum)
1066static void update_tilemap_rowscroll(screen_device &screen, struct layer_info *layer, const rectangle &cliprect, int bgnum)
10671067{
10681068   segas32_state *state = screen.machine().driver_data<segas32_state>();
10691069   int clipenable, clipout, clips, clipdraw_start;
r13798r13799
11091109   yscroll = (state->m_system32_videoram[0x1ff16/2 + 4 * bgnum] & 0x1ff);
11101110
11111111   /* render the tilemap into its bitmap */
1112   for (y = cliprect->min_y; y <= cliprect->max_y; y++)
1112   for (y = cliprect.min_y; y <= cliprect.max_y; y++)
11131113   {
11141114      UINT16 *extents = &clip_extents.extent[clip_extents.scan_extent[y]][0];
11151115      UINT16 *dst = &bitmap->pix16(y);
11161116      int clipdraw = clipdraw_start;
11171117
11181118      /* optimize for the case where we are clipped out */
1119      if (clipdraw || extents[1] <= cliprect->max_x)
1119      if (clipdraw || extents[1] <= cliprect.max_x)
11201120      {
11211121         bitmap_t *tm0, *tm1;
11221122         int transparent = 0;
r13798r13799
11271127         if (!flip)
11281128         {
11291129            /* get starting scroll values */
1130            srcx = cliprect->min_x + xscroll;
1130            srcx = cliprect.min_x + xscroll;
11311131            srcxstep = 1;
11321132            srcy = yscroll + y;
11331133
r13798r13799
11441144            const rectangle &visarea = screen.visible_area();
11451145
11461146            /* get starting scroll values */
1147            srcx = cliprect->max_x + xscroll;
1147            srcx = cliprect.max_x + xscroll;
11481148            srcxstep = -1;
11491149            srcy = yscroll + visarea.max_y - y;
11501150
r13798r13799
11861186            }
11871187
11881188            /* stop at the end */
1189            if (extents[1] > cliprect->max_x)
1189            if (extents[1] > cliprect.max_x)
11901190               break;
11911191
11921192            /* swap states and advance to the next extent */
r13798r13799
11941194            extents++;
11951195         }
11961196
1197         layer->transparent[y] = (transparent == cliprect->max_x - cliprect->min_x + 1);
1197         layer->transparent[y] = (transparent == cliprect.max_x - cliprect.min_x + 1);
11981198      }
11991199      else
12001200         layer->transparent[y] = 1;
r13798r13799
12161216 *
12171217 *************************************/
12181218
1219static void update_tilemap_text(screen_device &screen, struct layer_info *layer, const rectangle *cliprect)
1219static void update_tilemap_text(screen_device &screen, struct layer_info *layer, const rectangle &cliprect)
12201220{
12211221   segas32_state *state = screen.machine().driver_data<segas32_state>();
12221222   bitmap_t *bitmap = layer->bitmap;
r13798r13799
12351235   gfxbase = &state->m_system32_videoram[(state->m_system32_videoram[0x1ff5c/2] & 7) * 0x2000];
12361236
12371237   /* compute start/end tile numbers */
1238   startx = cliprect->min_x / 8;
1239   starty = cliprect->min_y / 8;
1240   endx = cliprect->max_x / 8;
1241   endy = cliprect->max_y / 8;
1238   startx = cliprect.min_x / 8;
1239   starty = cliprect.min_y / 8;
1240   endx = cliprect.max_x / 8;
1241   endy = cliprect.max_y / 8;
12421242
12431243   /* loop over tiles */
12441244   for (y = starty; y <= endy; y++)
r13798r13799
13761376 *
13771377 *************************************/
13781378
1379static void update_bitmap(screen_device &screen, struct layer_info *layer, const rectangle *cliprect)
1379static void update_bitmap(screen_device &screen, struct layer_info *layer, const rectangle &cliprect)
13801380{
13811381   segas32_state *state = screen.machine().driver_data<segas32_state>();
13821382   int clipenable, clipout, clips, clipdraw_start;
r13798r13799
14021402   color = (state->m_system32_videoram[0x1ff8c/2] << 4) & 0x1fff0 & ~((1 << bpp) - 1);
14031403
14041404   /* loop over target rows */
1405   for (y = cliprect->min_y; y <= cliprect->max_y; y++)
1405   for (y = cliprect.min_y; y <= cliprect.max_y; y++)
14061406   {
14071407      UINT16 *extents = &clip_extents.extent[clip_extents.scan_extent[y]][0];
14081408      UINT16 *dst = &bitmap->pix16(y);
14091409      int clipdraw = clipdraw_start;
14101410
14111411      /* optimize for the case where we are clipped out */
1412      if (clipdraw || extents[1] <= cliprect->max_x)
1412      if (clipdraw || extents[1] <= cliprect.max_x)
14131413      {
14141414         int transparent = 0;
14151415
r13798r13799
14571457            }
14581458
14591459            /* stop at the end */
1460            if (extents[1] > cliprect->max_x)
1460            if (extents[1] > cliprect.max_x)
14611461               break;
14621462
14631463            /* swap states and advance to the next extent */
r13798r13799
14651465            extents++;
14661466         }
14671467
1468         layer->transparent[y] = (transparent == cliprect->max_x - cliprect->min_x + 1);
1468         layer->transparent[y] = (transparent == cliprect.max_x - cliprect.min_x + 1);
14691469      }
14701470      else
14711471         layer->transparent[y] = 1;
r13798r13799
14801480 *
14811481 *************************************/
14821482
1483static void update_background(segas32_state *state, struct layer_info *layer, const rectangle *cliprect)
1483static void update_background(segas32_state *state, struct layer_info *layer, const rectangle &cliprect)
14841484{
14851485   bitmap_t *bitmap = layer->bitmap;
14861486   int x, y;
14871487
1488   for (y = cliprect->min_y; y <= cliprect->max_y; y++)
1488   for (y = cliprect.min_y; y <= cliprect.max_y; y++)
14891489   {
14901490      UINT16 *dst = &bitmap->pix16(y);
14911491      int color;
r13798r13799
14971497         color = state->m_system32_videoram[0x1ff5e/2] & 0x1e00;
14981498
14991499      /* if the color doesn't match, fill */
1500      if (dst[cliprect->min_x] != color)
1501         for (x = cliprect->min_x; x <= cliprect->max_x; x++)
1500      if (dst[cliprect.min_x] != color)
1501         for (x = cliprect.min_x; x <= cliprect.max_x; x++)
15021502            dst[x] = color;
15031503   }
15041504}
15051505
15061506
1507static UINT8 update_tilemaps(screen_device &screen, const rectangle *cliprect)
1507static UINT8 update_tilemaps(screen_device &screen, const rectangle &cliprect)
15081508{
15091509   segas32_state *state = screen.machine().driver_data<segas32_state>();
15101510   int enable0 = !(state->m_system32_videoram[0x1ff02/2] & 0x0001) && !(state->m_system32_videoram[0x1ff8e/2] & 0x0002);
r13798r13799
20102010   return &state->m_layer_data[layer].bitmap->pix16(scanline);
20112011}
20122012
2013static void mix_all_layers(segas32_state *state, int which, int xoffs, bitmap_t *bitmap, const rectangle *cliprect, UINT8 enablemask)
2013static void mix_all_layers(segas32_state *state, int which, int xoffs, bitmap_t *bitmap, const rectangle &cliprect, UINT8 enablemask)
20142014{
20152015   int blendenable = state->m_mixer_control[which][0x4e/2] & 0x0800;
20162016   int blendfactor = (state->m_mixer_control[which][0x4e/2] >> 8) & 7;
r13798r13799
21632163   /* directions; account for this */
21642164   if (state->m_sprite_control_latched[0x04/2] & 1)
21652165   {
2166      sprx_start = cliprect->max_x;
2166      sprx_start = cliprect.max_x;
21672167      sprdx = -1;
21682168   }
21692169   else
21702170   {
2171      sprx_start = cliprect->min_x;
2171      sprx_start = cliprect.min_x;
21722172      sprdx = 1;
21732173   }
21742174
21752175   if (state->m_sprite_control_latched[0x04/2] & 2)
21762176   {
2177      spry = cliprect->max_y;
2177      spry = cliprect.max_y;
21782178      sprdy = -1;
21792179   }
21802180   else
21812181   {
2182      spry = cliprect->min_y;
2182      spry = cliprect.min_y;
21832183      sprdy = 1;
21842184   }
21852185
21862186   /* loop over rows */
2187   for (y = cliprect->min_y; y <= cliprect->max_y; y++, spry += sprdy)
2187   for (y = cliprect.min_y; y <= cliprect.max_y; y++, spry += sprdy)
21882188   {
21892189      UINT32 *dest = &bitmap->pix32(y, xoffs);
21902190      UINT16 *layerbase[8];
r13798r13799
22002200      layerbase[MIXER_LAYER_BACKGROUND] = get_layer_scanline(state, MIXER_LAYER_BACKGROUND, y);
22012201
22022202      /* loop over columns */
2203      for (x = cliprect->min_x, sprx = sprx_start; x <= cliprect->max_x; x++, sprx += sprdx)
2203      for (x = cliprect.min_x, sprx = sprx_start; x <= cliprect.max_x; x++, sprx += sprdx)
22042204      {
22052205         struct mixer_layer_info *first;
22062206         int *rgbdelta;
r13798r13799
24352435   /* if the display is off, punt */
24362436   if (!state->m_system32_displayenable[0])
24372437   {
2438      bitmap->fill(get_black_pen(screen.machine()), *cliprect);
2438      bitmap->fill(get_black_pen(screen.machine()), cliprect);
24392439      return 0;
24402440   }
24412441
r13798r13799
26002600}
26012601
26022602
2603static UINT32 multi32_update(screen_device &screen, bitmap_t *bitmap, const rectangle *cliprect, int index)
2603static UINT32 multi32_update(screen_device &screen, bitmap_t *bitmap, const rectangle &cliprect, int index)
26042604{
26052605   segas32_state *state = screen.machine().driver_data<segas32_state>();
26062606   UINT8 enablemask;
r13798r13799
26142614   /* if the display is off, punt */
26152615   if (!state->m_system32_displayenable[index])
26162616   {
2617      bitmap->fill(get_black_pen(screen.machine()), *cliprect);
2617      bitmap->fill(get_black_pen(screen.machine()), cliprect);
26182618      return 0;
26192619   }
26202620
src/mame/video/slapfght.c
r13798r13799
153153  Render the Sprites
154154
155155***************************************************************************/
156static void draw_sprites(running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect, int priority_to_display )
156static void draw_sprites(running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect, int priority_to_display )
157157{
158158   slapfght_state *state = machine.driver_data<slapfght_state>();
159159   UINT8 *buffered_spriteram = machine.generic.buffered_spriteram.u8;
src/mame/video/psikyosh.c
r13798r13799
195195    a single transparent pen, storing the alpha value
196196    in alpha field of ARGB32, negative alpha implies alphatable
197197-------------------------------------------------*/
198static void drawgfx_alphastore(bitmap_t *dest, const rectangle *cliprect, const gfx_element *gfx,
198static void drawgfx_alphastore(bitmap_t *dest, const rectangle &cliprect, const gfx_element *gfx,
199199      UINT32 code, UINT32 color, int flipx, int flipy, INT32 destx, INT32 desty,
200200      int fixedalpha)
201201{
r13798r13799
242242    a fixed alpha value, or if alpha==-1 then uses
243243    the per-pen alphatable[] array
244244 -------------------------------------------------*/
245static void drawgfx_alphatable(bitmap_t *dest, const rectangle *cliprect, const gfx_element *gfx,
245static void drawgfx_alphatable(bitmap_t *dest, const rectangle &cliprect, const gfx_element *gfx,
246246      UINT32 code, UINT32 color, int flipx, int flipy, INT32 destx, INT32 desty,
247247      int fixedalpha)
248248{
r13798r13799
281281
282282/* 'Normal' layers, no line/columnscroll. No per-line effects.
283283Zooming isn't supported just because it's not used and it would be slow */
284static void draw_bglayer( running_machine &machine, int layer, bitmap_t *bitmap, const rectangle *cliprect, UINT8 req_pri )
284static void draw_bglayer( running_machine &machine, int layer, bitmap_t *bitmap, const rectangle &cliprect, UINT8 req_pri )
285285{
286286   psikyosh_state *state = machine.driver_data<psikyosh_state>();
287287   gfx_element *gfx;
r13798r13799
375375         int need_alpha = alpha < 0 ? -1 : 0xff; // store per-pen alpha in bitmap, otherwise don't since we'll need it per-line
376376
377377         if(tileno) { // valid tile, but blank in all games?
378            drawgfx_alphastore(state->m_bg_bitmap, NULL, gfx, tileno, colour, 0, 0, (16 * sx) & 0x1ff, ((16 * sy) & (width - 1)), need_alpha);
378            drawgfx_alphastore(state->m_bg_bitmap, state->m_bg_bitmap->cliprect(), gfx, tileno, colour, 0, 0, (16 * sx) & 0x1ff, ((16 * sy) & (width - 1)), need_alpha);
379379         }
380380
381381         offs++;
r13798r13799
389389Bitmap is first rendered to an ARGB image, taking into account the per-pen alpha (if used).
390390From there we extract data as we compose the image, one scanline at a time, blending the ARGB pixels
391391into the RGB32 bitmap (with either the alpha information from the ARGB, or per-line alpha */
392static void draw_bglayerscroll( running_machine &machine, int layer, bitmap_t *bitmap, const rectangle *cliprect, UINT8 req_pri )
392static void draw_bglayerscroll( running_machine &machine, int layer, bitmap_t *bitmap, const rectangle &cliprect, UINT8 req_pri )
393393{
394394   psikyosh_state *state = machine.driver_data<psikyosh_state>();
395395   assert(BG_LINE(layer));
r13798r13799
404404   int last_bank[32]; // corresponds to bank of bitmap in state->m_bg_bitmap. bg_bitmap is split into 16/32-rows of one-tile high each
405405   for(int ii = 0; ii < 32; ii++) last_bank[ii] = -1;
406406
407   int scr_width = (cliprect->max_x-cliprect->min_x + 1);
408   int scr_height = (cliprect->max_y-cliprect->min_y + 1);
407   int scr_width = (cliprect.max_x-cliprect.min_x + 1);
408   int scr_height = (cliprect.max_y-cliprect.min_y + 1);
409409   UINT32 *scroll_reg = &state->m_bgram[(linebank * 0x800) / 4 - 0x4000 / 4];
410410   UINT32 *pzab_reg   = &state->m_bgram[(linebank * 0x800) / 4 - 0x4000 / 4 + 0x400 / 4]; // pri, zoom, alpha, bank
411411
r13798r13799
484484}
485485
486486/* 3 BG layers, with priority */
487static void draw_background( running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect, UINT8 req_pri )
487static void draw_background( running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect, UINT8 req_pri )
488488{
489489   psikyosh_state *state = machine.driver_data<psikyosh_state>();
490490   int i;
r13798r13799
532532/* Note that Level 5-4 of sbomberb boss is perfect! (Alpha blended zoomed) as well as S1945II logo */
533533/* pixel is only plotted if z is >= priority_buffer[y][x] */
534534static void psikyosh_drawgfxzoom( running_machine &machine,
535      bitmap_t *dest_bmp,const rectangle *clip,const gfx_element *gfx,
535      bitmap_t *dest_bmp,const rectangle &clip,const gfx_element *gfx,
536536      UINT32 code,UINT32 color,int flipx,int flipy,int offsx,int offsy,
537537      int alpha, int zoomx, int zoomy, int wide, int high, UINT32 z)
538538{
r13798r13799
550550   assert(dest_bmp->bpp() == 32);
551551
552552   /* KW 991012 -- Added code to force clip to bitmap boundary */
553   if (clip)
554   {
555      myclip.min_x = clip->min_x;
556      myclip.max_x = clip->max_x;
557      myclip.min_y = clip->min_y;
558      myclip.max_y = clip->max_y;
559     
560      myclip &= dest_bmp->cliprect();
561      clip = &myclip;
562   }
553   myclip = clip;
554   myclip &= dest_bmp->cliprect();
563555
564556   /* Temporary fallback for non-zoomed, needs z-buffer. Note that this is probably a lot slower than drawgfx.c, especially if there was separate code for flipped cases */
565557   if (zoomx == 0x400 && zoomy == 0x400)
r13798r13799
598590               ex = sx + gfx->width;
599591               ey = sy + gfx->height;
600592
601               if (clip)
602               {
603                  if (sx < clip->min_x)
604                  { /* clip left */
605                     int pixels = clip->min_x - sx;
606                     sx += pixels;
607                     x_index_base += xinc * pixels;
608                  }
609                  if (sy < clip->min_y)
610                  { /* clip top */
611                     int pixels = clip->min_y - sy;
612                     sy += pixels;
613                     y_index += yinc * pixels;
614                  }
615                  /* NS 980211 - fixed incorrect clipping */
616                  if (ex > clip->max_x + 1)
617                  { /* clip right */
618                     int pixels = ex - clip->max_x - 1;
619                     ex -= pixels;
620                  }
621                  if (ey > clip->max_y + 1)
622                  { /* clip bottom */
623                     int pixels = ey - clip->max_y - 1;
624                     ey -= pixels;
625                  }
593               if (sx < myclip.min_x)
594               { /* clip left */
595                  int pixels = myclip.min_x - sx;
596                  sx += pixels;
597                  x_index_base += xinc * pixels;
626598               }
599               if (sy < myclip.min_y)
600               { /* clip top */
601                  int pixels = myclip.min_y - sy;
602                  sy += pixels;
603                  y_index += yinc * pixels;
604               }
605               /* NS 980211 - fixed incorrect clipping */
606               if (ex > myclip.max_x + 1)
607               { /* clip right */
608                  int pixels = ex - myclip.max_x - 1;
609                  ex -= pixels;
610               }
611               if (ey > myclip.max_y + 1)
612               { /* clip bottom */
613                  int pixels = ey - myclip.max_y - 1;
614                  ey -= pixels;
615               }
627616
628617               if (ex > sx)
629618               { /* skip if inner loop doesn't draw anything */
r13798r13799
871860            if (flipy)   { y_index = (sprite_screen_height - 1) * zoomy; dy = -zoomy; }
872861            else      { y_index = 0; dy = zoomy; }
873862
874            if (clip)
875            {
876               if (sx < clip->min_x)
877               { /* clip left */
878                  int pixels = clip->min_x - sx;
879                  sx += pixels;
880                  x_index_base += pixels * dx;
881               }
882               if (sy < clip->min_y)
883               { /* clip top */
884                  int pixels = clip->min_y - sy;
885                  sy += pixels;
886                  y_index += pixels * dy;
887               }
888               /* NS 980211 - fixed incorrect clipping */
889               if (ex > clip->max_x + 1)
890               { /* clip right */
891                  int pixels = ex-clip->max_x - 1;
892                  ex -= pixels;
893               }
894               if (ey > clip->max_y + 1)
895               { /* clip bottom */
896                  int pixels = ey-clip->max_y - 1;
897                  ey -= pixels;
898               }
863            if (sx < myclip.min_x)
864            { /* clip left */
865               int pixels = myclip.min_x - sx;
866               sx += pixels;
867               x_index_base += pixels * dx;
899868            }
869            if (sy < myclip.min_y)
870            { /* clip top */
871               int pixels = myclip.min_y - sy;
872               sy += pixels;
873               y_index += pixels * dy;
874            }
875            /* NS 980211 - fixed incorrect clipping */
876            if (ex > myclip.max_x + 1)
877            { /* clip right */
878               int pixels = ex-myclip.max_x - 1;
879               ex -= pixels;
880            }
881            if (ey > myclip.max_y + 1)
882            { /* clip bottom */
883               int pixels = ey-myclip.max_y - 1;
884               ey -= pixels;
885            }
900886
901887            if (ex > sx)
902888            { /* skip if inner loop doesn't draw anything */
r13798r13799
10681054}
10691055
10701056
1071static void draw_sprites(running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect, UINT8 req_pri)
1057static void draw_sprites(running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect, UINT8 req_pri)
10721058{
10731059   /*- Sprite Format 0x0000 - 0x37ff -**
10741060
r13798r13799
11881174}
11891175
11901176
1191static void psikyosh_prelineblend( running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect )
1177static void psikyosh_prelineblend( running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect )
11921178{
11931179   /* There are 224 values for pre-lineblending. Using one for every row currently */
11941180   /* I suspect that it should be blended against black by the amount specified as
r13798r13799
12031189   assert(bitmap->bpp() == 32);
12041190
12051191   g_profiler.start(PROFILER_USER8);
1206   for (y = cliprect->min_y; y <= cliprect->max_y; y += 1) {
1192   for (y = cliprect.min_y; y <= cliprect.max_y; y += 1) {
12071193
12081194      dstline = &bitmap->pix32(y);
12091195
12101196      /* linefill[y] & 0xff does what? */
1211      for (x = cliprect->min_x; x <= cliprect->max_x; x += 1)
1197      for (x = cliprect.min_x; x <= cliprect.max_x; x += 1)
12121198         dstline[x] = linefill[y] >> 8;
12131199   }
12141200   g_profiler.stop();
12151201}
12161202
12171203
1218static void psikyosh_postlineblend( running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect, UINT8 req_pri )
1204static void psikyosh_postlineblend( running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect, UINT8 req_pri )
12191205{
12201206   /* There are 224 values for post-lineblending. Using one for every row currently */
12211207   psikyosh_state *state = machine.driver_data<psikyosh_state>();
r13798r13799
12311217   }
12321218
12331219   g_profiler.start(PROFILER_USER8);
1234   for (y = cliprect->min_y; y <= cliprect->max_y; y += 1) {
1220   for (y = cliprect.min_y; y <= cliprect.max_y; y += 1) {
12351221
12361222      dstline = &bitmap->pix32(y);
12371223
12381224      if (lineblend[y] & 0x80) /* solid */
12391225      {
1240         for (x = cliprect->min_x; x <= cliprect->max_x; x += 1)
1226         for (x = cliprect.min_x; x <= cliprect.max_x; x += 1)
12411227            dstline[x] = lineblend[y] >> 8;
12421228      }
12431229      else if (lineblend[y] & 0x7f) /* blended */
12441230      {
1245         for (x = cliprect->min_x; x <= cliprect->max_x; x += 1)
1231         for (x = cliprect.min_x; x <= cliprect.max_x; x += 1)
12461232            dstline[x] = alpha_blend_r32(dstline[x], lineblend[y] >> 8, 2 * (lineblend[y] & 0x7f));
12471233      }
12481234   }
r13798r13799
13211307    state->m_vidregs[6], state->m_vidregs[7]);
13221308#endif
13231309
1324   state->m_z_bitmap->fill(0, *cliprect); /* z-buffer */
1310   state->m_z_bitmap->fill(0, cliprect); /* z-buffer */
13251311
13261312   psikyosh_prelineblend(screen.machine(), bitmap, cliprect); // fills screen
13271313   for (i = 0; i <= 7; i++)
src/mame/video/quizdna.c
r13798r13799
138138   palette_set_color_rgb(space->machine(),offs/2,pal5bit(r),pal5bit(g),pal5bit(b));
139139}
140140
141static void draw_sprites(running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect)
141static void draw_sprites(running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect)
142142{
143143   quizdna_state *state = machine.driver_data<quizdna_state>();
144144   UINT8 *spriteram = state->m_spriteram;
r13798r13799
202202      tilemap_draw(bitmap, cliprect, state->m_fg_tilemap, 0, 0);
203203   }
204204   else
205      bitmap->fill(get_black_pen(screen.machine()), *cliprect);
205      bitmap->fill(get_black_pen(screen.machine()), cliprect);
206206   return 0;
207207}
src/mame/video/kan_pand.c
r13798r13799
9797   pandora->clear_bitmap = clear;
9898}
9999
100void pandora_update( device_t *device, bitmap_t *bitmap, const rectangle *cliprect )
100void pandora_update( device_t *device, bitmap_t *bitmap, const rectangle &cliprect )
101101{
102102   kaneko_pandora_state *pandora = get_safe_token(device);
103103
r13798r13799
111111}
112112
113113
114static void pandora_draw( device_t *device, bitmap_t *bitmap, const rectangle *cliprect )
114static void pandora_draw( device_t *device, bitmap_t *bitmap, const rectangle &cliprect )
115115{
116116   kaneko_pandora_state *pandora = get_safe_token(device);
117117   int sx = 0, sy = 0, x = 0, y = 0, offs;
r13798r13799
204204   if (pandora->clear_bitmap)
205205      pandora->sprites_bitmap->fill(pandora->bg_pen, pandora->screen->visible_area());
206206
207   pandora_draw(device, pandora->sprites_bitmap, &pandora->screen->visible_area());
207   pandora_draw(device, pandora->sprites_bitmap, pandora->screen->visible_area());
208208}
209209
210210/*****************************************************************************
src/mame/video/boogwing.c
r13798r13799
33#include "video/deco16ic.h"
44#include "video/decocomn.h"
55
6static void draw_sprites( running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect, UINT16* spriteram_base, int gfx_region )
6static void draw_sprites( running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect, UINT16* spriteram_base, int gfx_region )
77{
88   boogwing_state *state = machine.driver_data<boogwing_state>();
99   int offs;
r13798r13799
150150
151151   /* Draw playfields */
152152   decocomn_clear_sprite_priority_bitmap(state->m_decocomn);
153   bitmap->fill(screen.machine().pens[0x400], *cliprect); /* pen not confirmed */
153   bitmap->fill(screen.machine().pens[0x400], cliprect); /* pen not confirmed */
154154   screen.machine().priority_bitmap->fill(0);
155155
156156   // bit&0x8 is definitely some kind of palette effect
src/mame/video/equites.c
r13798r13799
258258 *
259259 *************************************/
260260
261static void equites_draw_sprites_block( running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect, int start, int end )
261static void equites_draw_sprites_block( running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect, int start, int end )
262262{
263263   equites_state *state = machine.driver_data<equites_state>();
264264   int offs;
r13798r13799
299299   }
300300}
301301
302static void equites_draw_sprites(running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect)
302static void equites_draw_sprites(running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect)
303303{
304304   // note that we draw the sprites in three blocks; in each blocks, sprites at
305305   // a lower address have priority. This gives good priorities in gekisou.
r13798r13799
33233203020303 03030303 03030303 03030303
333333*/
334334
335static void splndrbt_draw_sprites( running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect )
335static void splndrbt_draw_sprites( running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect )
336336{
337337   equites_state *state = machine.driver_data<equites_state>();
338338   const UINT8 * const xrom = machine.region("user2")->base();
r13798r13799
384384         {
385385            int const y = yhalf ? sy + 1 + yy : sy - yy;
386386
387            if (y >= cliprect->min_y && y <= cliprect->max_y)
387            if (y >= cliprect.min_y && y <= cliprect.max_y)
388388            {
389389               for (x = 0; x <= (scalex << 1); ++x)
390390               {
391391                  int bx = (sx + x) & 0xff;
392392
393                  if (bx >= cliprect->min_x && bx <= cliprect->max_x)
393                  if (bx >= cliprect.min_x && bx <= cliprect.max_x)
394394                  {
395395                     int xx = scalex ? (x * 29 + scalex) / (scalex << 1) + 1 : 16;   // FIXME This is wrong. Should use the PROM.
396396                     int const offset = (fx ? (31 - xx) : xx) + ((fy ^ yhalf) ? (16 + line) : (15 - line) ) * gfx->line_modulo;
r13798r13799
408408}
409409
410410
411static void splndrbt_copy_bg( running_machine &machine, bitmap_t *dst_bitmap, const rectangle *cliprect )
411static void splndrbt_copy_bg( running_machine &machine, bitmap_t *dst_bitmap, const rectangle &cliprect )
412412{
413413   equites_state *state = machine.driver_data<equites_state>();
414414   bitmap_t * const src_bitmap = tilemap_get_pixmap(state->m_bg_tilemap);
r13798r13799
429429
430430   for (dst_y = 32; dst_y < 256-32; ++dst_y)
431431   {
432      if (dst_y >= cliprect->min_y && dst_y <= cliprect->max_y)
432      if (dst_y >= cliprect.min_y && dst_y <= cliprect.max_y)
433433      {
434434         const UINT8 * const romline = &xrom[(dst_y ^ dinvert) << 5];
435435         const UINT16 * const src_line = &src_bitmap->pix16((src_y + scroll_y) & 0x1ff);
r13798r13799
466466SCREEN_UPDATE( equites )
467467{
468468   equites_state *state = screen.machine().driver_data<equites_state>();
469   bitmap->fill(state->m_bgcolor, *cliprect);
469   bitmap->fill(state->m_bgcolor, cliprect);
470470
471471   tilemap_draw(bitmap, cliprect, state->m_bg_tilemap, 0, 0);
472472
r13798r13799
480480SCREEN_UPDATE( splndrbt )
481481{
482482   equites_state *state = screen.machine().driver_data<equites_state>();
483   bitmap->fill(state->m_bgcolor, *cliprect);
483   bitmap->fill(state->m_bgcolor, cliprect);
484484
485485   splndrbt_copy_bg(screen.machine(), bitmap, cliprect);
486486
src/mame/video/kan_pand.h
r13798r13799
3939    DEVICE I/O FUNCTIONS
4040***************************************************************************/
4141
42void pandora_update(device_t *device, bitmap_t *bitmap, const rectangle *cliprect);
42void pandora_update(device_t *device, bitmap_t *bitmap, const rectangle &cliprect);
4343void pandora_eof(device_t *device);
4444void pandora_set_clear_bitmap(device_t *device, int clear);
4545void pandora_set_bg_pen( device_t *device, int pen );
src/mame/video/gradius3.c
r13798r13799
133133
134134   k052109_tilemap_update(state->m_k052109);
135135
136   screen.machine().priority_bitmap->fill(0, *cliprect);
136   screen.machine().priority_bitmap->fill(0, cliprect);
137137   if (state->m_priority == 0)
138138   {
139139      k052109_tilemap_draw(state->m_k052109, bitmap, cliprect, 1, TILEMAP_DRAW_OPAQUE, 2);
src/mame/video/pk8000.c
r13798r13799
9595   palette_set_colors(machine, 0, pk8000_palette, ARRAY_LENGTH(pk8000_palette));
9696}
9797
98UINT32 pk8000_video_update(screen_device &screen, bitmap_t *bitmap, const rectangle *cliprect, UINT8 *videomem)
98UINT32 pk8000_video_update(screen_device &screen, bitmap_t *bitmap, const rectangle &cliprect, UINT8 *videomem)
9999{
100100   int x,y,j,b;
101101   UINT16 offset = (pk8000_video_mode & 0xc0) << 8;
src/mame/video/decocass.c
r13798r13799
118118    big object
119119 ********************************************/
120120
121static void draw_object( running_machine& machine, bitmap_t *bitmap, const rectangle *cliprect )
121static void draw_object( running_machine& machine, bitmap_t *bitmap, const rectangle &cliprect )
122122{
123123   decocass_state *state = machine.driver_data<decocass_state>();
124124   int sx, sy, color;
r13798r13799
141141   drawgfx_transpen(bitmap, cliprect, machine.gfx[3], 1, color, 0, 1, sx, sy - 64, 0);
142142}
143143
144static void draw_center( running_machine& machine, bitmap_t *bitmap, const rectangle *cliprect )
144static void draw_center( running_machine& machine, bitmap_t *bitmap, const rectangle &cliprect )
145145{
146146   decocass_state *state = machine.driver_data<decocass_state>();
147147   int sx, sy, x, y, color;
r13798r13799
160160   sx = (state->m_center_h_shift_space >> 2) & 0x3c;
161161
162162   for (y = 0; y < 4; y++)
163      if ((sy + y) >= cliprect->min_y && (sy + y) <= cliprect->max_y)
163      if ((sy + y) >= cliprect.min_y && (sy + y) <= cliprect.max_y)
164164      {
165165         if (((sy + y) & state->m_color_center_bot & 3) == (sy & state->m_color_center_bot & 3))
166166            for (x = 0; x < 256; x++)
r13798r13799
391391    memory handlers
392392 ********************************************/
393393
394static void draw_sprites(running_machine& machine, bitmap_t *bitmap, const rectangle *cliprect, int color,
394static void draw_sprites(running_machine& machine, bitmap_t *bitmap, const rectangle &cliprect, int color,
395395                  int sprite_y_adjust, int sprite_y_adjust_flip_screen,
396396                  UINT8 *sprite_ram, int interleave)
397397{
r13798r13799
440440}
441441
442442
443static void draw_missiles(running_machine &machine,bitmap_t *bitmap, const rectangle *cliprect,
443static void draw_missiles(running_machine &machine,bitmap_t *bitmap, const rectangle &cliprect,
444444                  int missile_y_adjust, int missile_y_adjust_flip_screen,
445445                  UINT8 *missile_ram, int interleave)
446446{
r13798r13799
461461         sy = 240 - sy + missile_y_adjust_flip_screen;
462462      }
463463      sy -= missile_y_adjust;
464      if (sy >= cliprect->min_y && sy <= cliprect->max_y)
464      if (sy >= cliprect.min_y && sy <= cliprect.max_y)
465465         for (x = 0; x < 4; x++)
466466         {
467            if (sx >= cliprect->min_x && sx <= cliprect->max_x)
467            if (sx >= cliprect.min_x && sx <= cliprect.max_x)
468468               bitmap->pix16(sy, sx) = (state->m_color_missiles >> 4) & 7;
469469            sx++;
470470         }
r13798r13799
477477         sy = 240 - sy + missile_y_adjust_flip_screen;
478478      }
479479      sy -= missile_y_adjust;
480      if (sy >= cliprect->min_y && sy <= cliprect->max_y)
480      if (sy >= cliprect.min_y && sy <= cliprect.max_y)
481481         for (x = 0; x < 4; x++)
482482         {
483            if (sx >= cliprect->min_x && sx <= cliprect->max_x)
483            if (sx >= cliprect.min_x && sx <= cliprect.max_x)
484484               bitmap->pix16(sy, sx) = state->m_color_missiles & 7;
485485            sx++;
486486         }
r13798r13799
552552   }
553553#endif
554554
555   bitmap->fill(0, *cliprect);
555   bitmap->fill(0, cliprect);
556556
557557   scrolly_l = state->m_back_vl_shift;
558558   scrolly_r = 256 - state->m_back_vr_shift;
r13798r13799
581581   if (state->m_mode_set & 0x08)   /* bkg_ena on ? */
582582   {
583583      clip = state->m_bg_tilemap_l_clip;
584      clip &= *cliprect;
585      tilemap_draw(bitmap, &clip, state->m_bg_tilemap_l, TILEMAP_DRAW_OPAQUE, 0);
584      clip &= cliprect;
585      tilemap_draw(bitmap, clip, state->m_bg_tilemap_l, TILEMAP_DRAW_OPAQUE, 0);
586586
587587      clip = state->m_bg_tilemap_r_clip;
588      clip &= *cliprect;
589      tilemap_draw(bitmap, &clip, state->m_bg_tilemap_r, TILEMAP_DRAW_OPAQUE, 0);
588      clip &= cliprect;
589      tilemap_draw(bitmap, clip, state->m_bg_tilemap_r, TILEMAP_DRAW_OPAQUE, 0);
590590   }
591591
592592   if (state->m_mode_set & 0x20)
r13798r13799
601601      if (state->m_mode_set & 0x08)   /* bkg_ena on ? */
602602      {
603603         clip = state->m_bg_tilemap_l_clip;
604         clip &= *cliprect;
605         tilemap_draw(bitmap, &clip, state->m_bg_tilemap_l, 0, 0);
604         clip &= cliprect;
605         tilemap_draw(bitmap, clip, state->m_bg_tilemap_l, 0, 0);
606606
607607         clip = state->m_bg_tilemap_r_clip;
608         clip &= *cliprect;
609         tilemap_draw(bitmap, &clip, state->m_bg_tilemap_r, 0, 0);
608         clip &= cliprect;
609         tilemap_draw(bitmap, clip, state->m_bg_tilemap_r, 0, 0);
610610      }
611611   }
612612   tilemap_draw(bitmap, cliprect, state->m_fg_tilemap, 0, 0);
src/mame/video/sega16sp.c
r13798r13799
7676      pri[x] = 0xff;                                          \
7777   }                                                      \
7878
79void segaic16_sprites_hangon_draw(running_machine &machine, device_t *device, bitmap_t *bitmap, const rectangle *cliprect)
79void segaic16_sprites_hangon_draw(running_machine &machine, device_t *device, bitmap_t *bitmap, const rectangle &cliprect)
8080{
8181   UINT8 numbanks = machine.region("gfx2")->bytes() / 0x10000;
8282   const UINT16 *spritebase = (const UINT16 *)machine.region("gfx2")->base();
r13798r13799
132132            addr += pitch;
133133
134134         /* skip drawing if not within the cliprect */
135         if (y >= cliprect->min_y && y <= cliprect->max_y)
135         if (y >= cliprect.min_y && y <= cliprect.max_y)
136136         {
137137            UINT16 *dest = &bitmap->pix16(y);
138138            UINT8 *pri = &machine.priority_bitmap->pix8(y);
r13798r13799
147147            {
148148               /* start at the word before because we preincrement below */
149149               data[7] = addr - 1;
150               for (x = xpos; x <= cliprect->max_x; )
150               for (x = xpos; x <= cliprect.max_x; )
151151               {
152152                  UINT16 pixels = spritedata[++data[7] & 0x7fff];
153153
154154                  /* draw four pixels */
155                  pix = (pixels >> 12) & 0xf; xacc = (xacc & 0xff) + hzoom; if (xacc < 0x100) { if (x >= cliprect->min_x) hangon_draw_pixel(); x++; }
156                  pix = (pixels >>  8) & 0xf; xacc = (xacc & 0xff) + hzoom; if (xacc < 0x100) { if (x >= cliprect->min_x) hangon_draw_pixel(); x++; }
157                  pix = (pixels >>  4) & 0xf; xacc = (xacc & 0xff) + hzoom; if (xacc < 0x100) { if (x >= cliprect->min_x) hangon_draw_pixel(); x++; }
158                  pix = (pixels >>  0) & 0xf; xacc = (xacc & 0xff) + hzoom; if (xacc < 0x100) { if (x >= cliprect->min_x) hangon_draw_pixel(); x++; }
155                  pix = (pixels >> 12) & 0xf; xacc = (xacc & 0xff) + hzoom; if (xacc < 0x100) { if (x >= cliprect.min_x) hangon_draw_pixel(); x++; }
156                  pix = (pixels >>  8) & 0xf; xacc = (xacc & 0xff) + hzoom; if (xacc < 0x100) { if (x >= cliprect.min_x) hangon_draw_pixel(); x++; }
157                  pix = (pixels >>  4) & 0xf; xacc = (xacc & 0xff) + hzoom; if (xacc < 0x100) { if (x >= cliprect.min_x) hangon_draw_pixel(); x++; }
158                  pix = (pixels >>  0) & 0xf; xacc = (xacc & 0xff) + hzoom; if (xacc < 0x100) { if (x >= cliprect.min_x) hangon_draw_pixel(); x++; }
159159
160160                  /* stop if the last pixel in the group was 0xf */
161161                  if (pix == 15)
r13798r13799
168168            {
169169               /* start at the word after because we predecrement below */
170170               data[7] = addr + 1;
171               for (x = xpos; x <= cliprect->max_x; )
171               for (x = xpos; x <= cliprect.max_x; )
172172               {
173173                  UINT16 pixels = spritedata[--data[7] & 0x7fff];
174174
175175                  /* draw four pixels */
176                  pix = (pixels >>  0) & 0xf; xacc = (xacc & 0xff) + hzoom; if (xacc < 0x100) { if (x >= cliprect->min_x) hangon_draw_pixel(); x++; }
177                  pix = (pixels >>  4) & 0xf; xacc = (xacc & 0xff) + hzoom; if (xacc < 0x100) { if (x >= cliprect->min_x) hangon_draw_pixel(); x++; }
178                  pix = (pixels >>  8) & 0xf; xacc = (xacc & 0xff) + hzoom; if (xacc < 0x100) { if (x >= cliprect->min_x) hangon_draw_pixel(); x++; }
179                  pix = (pixels >> 12) & 0xf; xacc = (xacc & 0xff) + hzoom; if (xacc < 0x100) { if (x >= cliprect->min_x) hangon_draw_pixel(); x++; }
176                  pix = (pixels >>  0) & 0xf; xacc = (xacc & 0xff) + hzoom; if (xacc < 0x100) { if (x >= cliprect.min_x) hangon_draw_pixel(); x++; }
177                  pix = (pixels >>  4) & 0xf; xacc = (xacc & 0xff) + hzoom; if (xacc < 0x100) { if (x >= cliprect.min_x) hangon_draw_pixel(); x++; }
178                  pix = (pixels >>  8) & 0xf; xacc = (xacc & 0xff) + hzoom; if (xacc < 0x100) { if (x >= cliprect.min_x) hangon_draw_pixel(); x++; }
179                  pix = (pixels >> 12) & 0xf; xacc = (xacc & 0xff) + hzoom; if (xacc < 0x100) { if (x >= cliprect.min_x) hangon_draw_pixel(); x++; }
180180
181181                  /* stop if the last pixel in the group was 0xf */
182182                  if (pix == 15)
r13798r13799
241241      pri[x] = 0xff;                                          \
242242   }                                                      \
243243
244void segaic16_sprites_sharrier_draw(running_machine &machine, device_t *device, bitmap_t *bitmap, const rectangle *cliprect)
244void segaic16_sprites_sharrier_draw(running_machine &machine, device_t *device, bitmap_t *bitmap, const rectangle &cliprect)
245245{
246246   UINT8 numbanks = machine.region("gfx2")->bytes() / 0x20000;
247247   const UINT32 *spritebase = (const UINT32 *)machine.region("gfx2")->base();
r13798r13799
298298            addr += pitch;
299299
300300         /* skip drawing if not within the cliprect */
301         if (y >= cliprect->min_y && y <= cliprect->max_y)
301         if (y >= cliprect.min_y && y <= cliprect.max_y)
302302         {
303303            UINT16 *dest = &bitmap->pix16(y);
304304            UINT8 *pri = &machine.priority_bitmap->pix8(y);
r13798r13799
313313            {
314314               /* start at the word before because we preincrement below */
315315               data[7] = addr - 1;
316               for (x = xpos; x <= cliprect->max_x; )
316               for (x = xpos; x <= cliprect.max_x; )
317317               {
318318                  UINT32 pixels = spritedata[++data[7] & 0x7fff];
319319
320320                  /* draw 8 pixels */
321                  pix = (pixels >> 28) & 0xf; xacc = (xacc & 0xff) + hzoom; if (xacc < 0x100) { if (x >= cliprect->min_x) sharrier_draw_pixel(); x++; }
322                  pix = (pixels >> 24) & 0xf; xacc = (xacc & 0xff) + hzoom; if (xacc < 0x100) { if (x >= cliprect->min_x) sharrier_draw_pixel(); x++; }
323                  pix = (pixels >> 20) & 0xf; xacc = (xacc & 0xff) + hzoom; if (xacc < 0x100) { if (x >= cliprect->min_x) sharrier_draw_pixel(); x++; }
324                  pix = (pixels >> 16) & 0xf; xacc = (xacc & 0xff) + hzoom; if (xacc < 0x100) { if (x >= cliprect->min_x) sharrier_draw_pixel(); x++; }
325                  pix = (pixels >> 12) & 0xf; xacc = (xacc & 0xff) + hzoom; if (xacc < 0x100) { if (x >= cliprect->min_x) sharrier_draw_pixel(); x++; }
326                  pix = (pixels >>  8) & 0xf; xacc = (xacc & 0xff) + hzoom; if (xacc < 0x100) { if (x >= cliprect->min_x) sharrier_draw_pixel(); x++; }
327                  pix = (pixels >>  4) & 0xf; xacc = (xacc & 0xff) + hzoom; if (xacc < 0x100) { if (x >= cliprect->min_x) sharrier_draw_pixel(); x++; }
328                  pix = (pixels >>  0) & 0xf; xacc = (xacc & 0xff) + hzoom; if (xacc < 0x100) { if (x >= cliprect->min_x) sharrier_draw_pixel(); x++; }
321                  pix = (pixels >> 28) & 0xf; xacc = (xacc & 0xff) + hzoom; if (xacc < 0x100) { if (x >= cliprect.min_x) sharrier_draw_pixel(); x++; }
322                  pix = (pixels >> 24) & 0xf; xacc = (xacc & 0xff) + hzoom; if (xacc < 0x100) { if (x >= cliprect.min_x) sharrier_draw_pixel(); x++; }
323                  pix = (pixels >> 20) & 0xf; xacc = (xacc & 0xff) + hzoom; if (xacc < 0x100) { if (x >= cliprect.min_x) sharrier_draw_pixel(); x++; }
324                  pix = (pixels >> 16) & 0xf; xacc = (xacc & 0xff) + hzoom; if (xacc < 0x100) { if (x >= cliprect.min_x) sharrier_draw_pixel(); x++; }
325                  pix = (pixels >> 12) & 0xf; xacc = (xacc & 0xff) + hzoom; if (xacc < 0x100) { if (x >= cliprect.min_x) sharrier_draw_pixel(); x++; }
326                  pix = (pixels >>  8) & 0xf; xacc = (xacc & 0xff) + hzoom; if (xacc < 0x100) { if (x >= cliprect.min_x) sharrier_draw_pixel(); x++; }
327                  pix = (pixels >>  4) & 0xf; xacc = (xacc & 0xff) + hzoom; if (xacc < 0x100) { if (x >= cliprect.min_x) sharrier_draw_pixel(); x++; }
328                  pix = (pixels >>  0) & 0xf; xacc = (xacc & 0xff) + hzoom; if (xacc < 0x100) { if (x >= cliprect.min_x) sharrier_draw_pixel(); x++; }
329329
330330                  /* stop if the last pixel in the group was 0xf */
331331                  if (pix == 15)
r13798r13799
338338            {
339339               /* start at the word after because we predecrement below */
340340               data[7] = addr + 1;
341               for (x = xpos; x <= cliprect->max_x; )
341               for (x = xpos; x <= cliprect.max_x; )
342342               {
343343                  UINT32 pixels = spritedata[--data[7] & 0x7fff];
344344
345345                  /* draw 8 pixels */
346                  pix = (pixels >>  0) & 0xf; xacc = (xacc & 0xff) + hzoom; if (xacc < 0x100) { if (x >= cliprect->min_x) sharrier_draw_pixel(); x++; }
347                  pix = (pixels >>  4) & 0xf; xacc = (xacc & 0xff) + hzoom; if (xacc < 0x100) { if (x >= cliprect->min_x) sharrier_draw_pixel(); x++; }
348                  pix = (pixels >>  8) & 0xf; xacc = (xacc & 0xff) + hzoom; if (xacc < 0x100) { if (x >= cliprect->min_x) sharrier_draw_pixel(); x++; }
349                  pix = (pixels >> 12) & 0xf; xacc = (xacc & 0xff) + hzoom; if (xacc < 0x100) { if (x >= cliprect->min_x) sharrier_draw_pixel(); x++; }
350                  pix = (pixels >> 16) & 0xf; xacc = (xacc & 0xff) + hzoom; if (xacc < 0x100) { if (x >= cliprect->min_x) sharrier_draw_pixel(); x++; }
351                  pix = (pixels >> 20) & 0xf; xacc = (xacc & 0xff) + hzoom; if (xacc < 0x100) { if (x >= cliprect->min_x) sharrier_draw_pixel(); x++; }
352                  pix = (pixels >> 24) & 0xf; xacc = (xacc & 0xff) + hzoom; if (xacc < 0x100) { if (x >= cliprect->min_x) sharrier_draw_pixel(); x++; }
353                  pix = (pixels >> 28) & 0xf; xacc = (xacc & 0xff) + hzoom; if (xacc < 0x100) { if (x >= cliprect->min_x) sharrier_draw_pixel(); x++; }
346                  pix = (pixels >>  0) & 0xf; xacc = (xacc & 0xff) + hzoom; if (xacc < 0x100) { if (x >= cliprect.min_x) sharrier_draw_pixel(); x++; }
347                  pix = (pixels >>  4) & 0xf; xacc = (xacc & 0xff) + hzoom; if (xacc < 0x100) { if (x >= cliprect.min_x) sharrier_draw_pixel(); x++; }
348                  pix = (pixels >>  8) & 0xf; xacc = (xacc & 0xff) + hzoom; if (xacc < 0x100) { if (x >= cliprect.min_x) sharrier_draw_pixel(); x++; }
349                  pix = (pixels >> 12) & 0xf; xacc = (xacc & 0xff) + hzoom; if (xacc < 0x100) { if (x >= cliprect.min_x) sharrier_draw_pixel(); x++; }
350                  pix = (pixels >> 16) & 0xf; xacc = (xacc & 0xff) + hzoom; if (xacc < 0x100) { if (x >= cliprect.min_x) sharrier_draw_pixel(); x++; }
351                  pix = (pixels >> 20) & 0xf; xacc = (xacc & 0xff) + hzoom; if (xacc < 0x100) { if (x >= cliprect.min_x) sharrier_draw_pixel(); x++; }
352                  pix = (pixels >> 24) & 0xf; xacc = (xacc & 0xff) + hzoom; if (xacc < 0x100) { if (x >= cliprect.min_x) sharrier_draw_pixel(); x++; }
353                  pix = (pixels >> 28) & 0xf; xacc = (xacc & 0xff) + hzoom; if (xacc < 0x100) { if (x >= cliprect.min_x) sharrier_draw_pixel(); x++; }
354354
355355                  /* stop if the last pixel in the group was 0xf */
356356                  if (pix == 15)
r13798r13799
394394
395395#define system16a_draw_pixel()                                    \
396396   /* only draw if onscreen, not 0 or 15 */                        \
397   if (x >= cliprect->min_x && x <= cliprect->max_x && pix != 0 && pix != 15) \
397   if (x >= cliprect.min_x && x <= cliprect.max_x && pix != 0 && pix != 15) \
398398   {                                                      \
399399      /* are we high enough priority to be visible? */               \
400400      if (sprpri > pri[x])                                    \
r13798r13799
412412      pri[x] = 0xff;                                          \
413413   }                                                      \
414414
415void segaic16_sprites_16a_draw(running_machine &machine, device_t *device, bitmap_t *bitmap, const rectangle *cliprect)
415void segaic16_sprites_16a_draw(running_machine &machine, device_t *device, bitmap_t *bitmap, const rectangle &cliprect)
416416{
417417   UINT8 numbanks = machine.region("gfx2")->bytes() / 0x10000;
418418   const UINT16 *spritebase = (const UINT16 *)machine.region("gfx2")->base();
r13798r13799
467467         addr += pitch;
468468
469469         /* skip drawing if not within the cliprect */
470         if (y >= cliprect->min_y && y <= cliprect->max_y)
470         if (y >= cliprect.min_y && y <= cliprect.max_y)
471471         {
472472            UINT16 *dest = &bitmap->pix16(y);
473473            UINT8 *pri = &machine.priority_bitmap->pix8(y);
r13798r13799
550550
551551#define system16b_draw_pixel()                                    \
552552   /* only draw if onscreen, not 0 or 15 */                        \
553   if (x >= cliprect->min_x && x <= cliprect->max_x && pix != 0 && pix != 15) \
553   if (x >= cliprect.min_x && x <= cliprect.max_x && pix != 0 && pix != 15) \
554554   {                                                      \
555555      /* are we high enough priority to be visible? */               \
556556      if (sprpri > pri[x])                                    \
r13798r13799
573573      pri[x] = 0xff;                                          \
574574   }                                                      \
575575
576void segaic16_sprites_16b_draw(running_machine &machine, device_t *device, bitmap_t *bitmap, const rectangle *cliprect)
576void segaic16_sprites_16b_draw(running_machine &machine, device_t *device, bitmap_t *bitmap, const rectangle &cliprect)
577577{
578578   UINT8 numbanks;
579579   const UINT16 *spritebase;
r13798r13799
656656         }
657657
658658         /* skip drawing if not within the cliprect */
659         if (y >= cliprect->min_y && y <= cliprect->max_y)
659         if (y >= cliprect.min_y && y <= cliprect.max_y)
660660         {
661661            UINT16 *dest = &bitmap->pix16(y);
662662            UINT8 *pri = &machine.priority_bitmap->pix8(y);
r13798r13799
721721
722722#define yboard_16b_draw_pixel()                                  \
723723   /* only draw if onscreen, not 0 or 15 */                        \
724   if (x >= cliprect->min_x && x <= cliprect->max_x && pix != 0 && pix != 15) \
724   if (x >= cliprect.min_x && x <= cliprect.max_x && pix != 0 && pix != 15) \
725725   {                                                      \
726726      /* are we high enough priority to be visible? */               \
727727      if ((sprpri & 0x1f) < (pri[x] & 0x1f))                        \
r13798r13799
739739      pri[x] = 0;                                             \
740740   }                                                      \
741741
742void segaic16_sprites_yboard_16b_draw(running_machine &machine, device_t *device, bitmap_t *bitmap, const rectangle *cliprect)
742void segaic16_sprites_yboard_16b_draw(running_machine &machine, device_t *device, bitmap_t *bitmap, const rectangle &cliprect)
743743{
744744   UINT8 numbanks = machine.region("gfx2")->bytes() / 0x20000;
745745   const UINT16 *spritebase = (const UINT16 *)machine.region("gfx2")->base();
r13798r13799
809809         }
810810
811811         /* skip drawing if not within the cliprect */
812         if (y >= cliprect->min_y && y <= cliprect->max_y)
812         if (y >= cliprect.min_y && y <= cliprect.max_y)
813813         {
814814            UINT16 *dest = &bitmap->pix16(y);
815815            UINT8 *pri = &machine.priority_bitmap->pix8(y);
r13798r13799
899899
900900#define outrun_draw_pixel()                                     \
901901   /* only draw if onscreen, not 0 or 15 */                        \
902   if (x >= cliprect->min_x && x <= cliprect->max_x && pix != 0 && pix != 15) \
902   if (x >= cliprect.min_x && x <= cliprect.max_x && pix != 0 && pix != 15) \
903903   {                                                      \
904904      /* are we high enough priority to be visible? */               \
905905      if (sprpri > pri[x])                                    \
r13798r13799
917917      pri[x] = 0xff;                                          \
918918   }                                                      \
919919
920static void segaic16_sprites_xboard_outrun_draw(running_machine &machine, device_t *device, bitmap_t *bitmap, const rectangle *cliprect, int type)
920static void segaic16_sprites_xboard_outrun_draw(running_machine &machine, device_t *device, bitmap_t *bitmap, const rectangle &cliprect, int type)
921921{
922922   UINT8 numbanks = machine.region("gfx2")->bytes() / 0x40000;
923923   const UINT32 *spritebase = (const UINT32 *)machine.region("gfx2")->base();
r13798r13799
978978      for (y = top; y != ytarget; y += ydelta)
979979      {
980980         /* skip drawing if not within the cliprect */
981         if (y >= cliprect->min_y && y <= cliprect->max_y)
981         if (y >= cliprect.min_y && y <= cliprect.max_y)
982982         {
983983            UINT16 *dest = &bitmap->pix16(y);
984984            UINT8 *pri = &machine.priority_bitmap->pix8(y);
r13798r13799
989989            {
990990               /* start at the word before because we preincrement below */
991991               data[7] = addr - 1;
992               for (x = xpos; (xdelta > 0 && x <= cliprect->max_x) || (xdelta < 0 && x >= cliprect->min_x); )
992               for (x = xpos; (xdelta > 0 && x <= cliprect.max_x) || (xdelta < 0 && x >= cliprect.min_x); )
993993               {
994994                  UINT32 pixels = spritedata[++data[7]];
995995
r13798r13799
10141014            {
10151015               /* start at the word after because we predecrement below */
10161016               data[7] = addr + 1;
1017               for (x = xpos; (xdelta > 0 && x <= cliprect->max_x) || (xdelta < 0 && x >= cliprect->min_x); )
1017               for (x = xpos; (xdelta > 0 && x <= cliprect.max_x) || (xdelta < 0 && x >= cliprect.min_x); )
10181018               {
10191019                  UINT32 pixels = spritedata[--data[7]];
10201020
r13798r13799
10431043   }
10441044}
10451045
1046void segaic16_sprites_outrun_draw(running_machine &machine, device_t *device, bitmap_t *bitmap, const rectangle *cliprect)
1046void segaic16_sprites_outrun_draw(running_machine &machine, device_t *device, bitmap_t *bitmap, const rectangle &cliprect)
10471047{
10481048   segaic16_sprites_xboard_outrun_draw(machine, device, bitmap, cliprect, SEGAIC16_SPRITES_OUTRUN);
10491049}
10501050
1051void segaic16_sprites_xboard_draw(running_machine &machine, device_t *device, bitmap_t *bitmap, const rectangle *cliprect)
1051void segaic16_sprites_xboard_draw(running_machine &machine, device_t *device, bitmap_t *bitmap, const rectangle &cliprect)
10521052{
10531053   segaic16_sprites_xboard_outrun_draw(machine, device, bitmap, cliprect, SEGAIC16_SPRITES_XBOARD);
10541054}
r13798r13799
10881088   if (x >= minx && x <= maxx && ind < 0x1fe)                        \
10891089      dest[x] = ind | colorpri;                                 \
10901090
1091void segaic16_sprites_yboard_draw(running_machine &machine, device_t *device, bitmap_t *bitmap, const rectangle *cliprect)
1091void segaic16_sprites_yboard_draw(running_machine &machine, device_t *device, bitmap_t *bitmap, const rectangle &cliprect)
10921092{
10931093   UINT8 numbanks = machine.region("gfx1")->bytes() / 0x80000;
10941094   const UINT64 *spritebase = (const UINT64 *)machine.region("gfx1")->base();
r13798r13799
11031103   memset(visited, 0, sizeof(visited));
11041104
11051105   /* clear out any scanlines we might be using */
1106   for (y = cliprect->min_y; y <= cliprect->max_y; y++)
1106   for (y = cliprect.min_y; y <= cliprect.max_y; y++)
11071107      if (!(rotatebase[y & ~1] & 0xc000))
1108         memset(&bitmap->pix16(y, cliprect->min_x), 0xff, (cliprect->max_x - cliprect->min_x + 1) * sizeof(UINT16));
1108         memset(&bitmap->pix16(y, cliprect.min_x), 0xff, (cliprect.max_x - cliprect.min_x + 1) * sizeof(UINT16));
11091109
11101110   /* now scan backwards and render the sprites in order */
11111111   for (data = sega16sp->spriteram; !(data[0] & 0x8000) && !visited[next]; data = sega16sp->spriteram + next * 8)
r13798r13799
11481148      for (y = top; y != ytarget; y += ydelta)
11491149      {
11501150         /* skip drawing if not within the cliprect */
1151         if (y >= cliprect->min_y && y <= cliprect->max_y)
1151         if (y >= cliprect.min_y && y <= cliprect.max_y)
11521152         {
11531153            UINT16 *dest = &bitmap->pix16(y);
11541154            int minx = rotatebase[y & ~1];
r13798r13799
11691169               /* clamp min/max to the cliprect */
11701170               minx -= 0x600;
11711171               maxx -= 0x600;
1172               if (minx < cliprect->min_x)
1173                  minx = cliprect->min_x;
1174               if (maxx > cliprect->max_x)
1175                  maxx = cliprect->max_x;
1172               if (minx < cliprect.min_x)
1173                  minx = cliprect.min_x;
1174               if (maxx > cliprect.max_x)
1175                  maxx = cliprect.max_x;
11761176
11771177               /* non-flipped case */
11781178               if (!flip)
r13798r13799
12661266/* ignores the sprite priority until we understand priority better on the bootlegs */
12671267#define system16a_bootleg_draw_pixel()                                    \
12681268   /* only draw if onscreen, not 0 or 15 */                        \
1269   if (x >= cliprect->min_x && x <= cliprect->max_x && pix != 0 && pix != 15) \
1269   if (x >= cliprect.min_x && x <= cliprect.max_x && pix != 0 && pix != 15) \
12701270   {                                                      \
12711271      /* are we high enough priority to be visible? */               \
12721272      if (sprpri || 1)                                    \
r13798r13799
13231323      {                                                            \
13241324                                                                  \
13251325         /* skip drawing if not within the cliprect */                        \
1326         if (y >= cliprect->min_y && y <= cliprect->max_y)                     \
1326         if (y >= cliprect.min_y && y <= cliprect.max_y)                     \
13271327         {                                                         \
13281328            UINT16 *dest = &bitmap->pix16(y);                        \
13291329            UINT8 *pri = &machine.priority_bitmap->pix8(y);                  \
r13798r13799
13821382
13831383
13841384
1385void segaic16_sprites_16a_bootleg_wb3bl_draw(running_machine &machine, device_t *device, bitmap_t *bitmap, const rectangle *cliprect)
1385void segaic16_sprites_16a_bootleg_wb3bl_draw(running_machine &machine, device_t *device, bitmap_t *bitmap, const rectangle &cliprect)
13861386{
13871387   UINT8 numbanks = machine.region("gfx2")->bytes() / 0x10000;
13881388   const UINT16 *spritebase = (const UINT16 *)machine.region("gfx2")->base();
r13798r13799
14051405}
14061406
14071407/* 4 player passing shot is different to this.. */
1408void segaic16_sprites_16a_bootleg_passhtb_draw(running_machine &machine, device_t *device, bitmap_t *bitmap, const rectangle *cliprect)
1408void segaic16_sprites_16a_bootleg_passhtb_draw(running_machine &machine, device_t *device, bitmap_t *bitmap, const rectangle &cliprect)
14091409{
14101410   UINT8 numbanks = machine.region("gfx2")->bytes() / 0x10000;
14111411   const UINT16 *spritebase = (const UINT16 *)machine.region("gfx2")->base();
r13798r13799
14271427   }
14281428}
14291429
1430void segaic16_sprites_16a_bootleg_shinobld_draw(running_machine &machine, device_t *device, bitmap_t *bitmap, const rectangle *cliprect)
1430void segaic16_sprites_16a_bootleg_shinobld_draw(running_machine &machine, device_t *device, bitmap_t *bitmap, const rectangle &cliprect)
14311431{
14321432   UINT8 numbanks = machine.region("gfx2")->bytes() / 0x10000;
14331433   const UINT16 *spritebase = (const UINT16 *)machine.region("gfx2")->base();
r13798r13799
14551455 *
14561456 *************************************/
14571457
1458void segaic16_sprites_draw(screen_device &screen, bitmap_t *bitmap, const rectangle *cliprect, int which)
1458void segaic16_sprites_draw(screen_device &screen, bitmap_t *bitmap, const rectangle &cliprect, int which)
14591459{
14601460   device_t* device = 0;
14611461   sega16sp_state *sega16sp;
src/mame/video/fromance.c
r13798r13799
303303 *
304304 *************************************/
305305
306static void draw_sprites( screen_device &screen, bitmap_t *bitmap, const rectangle *cliprect, int draw_priority )
306static void draw_sprites( screen_device &screen, bitmap_t *bitmap, const rectangle &cliprect, int draw_priority )
307307{
308308   fromance_state *state = screen.machine().driver_data<fromance_state>();
309309   static const UINT8 zoomtable[16] = { 0,7,14,20,25,30,34,38,42,46,49,52,54,57,59,61 };
src/mame/video/irobot.c
r13798r13799
354354   int x, y, offs;
355355
356356   /* copy the polygon bitmap */
357   for (y = cliprect->min_y; y <= cliprect->max_y; y++)
357   for (y = cliprect.min_y; y <= cliprect.max_y; y++)
358358      draw_scanline8(bitmap, 0, y, BITMAP_WIDTH, &bitmap_base[y * BITMAP_WIDTH], NULL);
359359
360360   /* redraw the non-zero characters in the alpha layer */
src/mame/video/skykid.c
r13798r13799
185185***************************************************************************/
186186
187187/* the sprite generator IC is the same as Mappy */
188static void draw_sprites(running_machine &machine, bitmap_t *bitmap,const rectangle *cliprect)
188static void draw_sprites(running_machine &machine, bitmap_t *bitmap,const rectangle &cliprect)
189189{
190190   skykid_state *state = machine.driver_data<skykid_state>();
191191   UINT8 *spriteram = state->m_spriteram + 0x780;
src/mame/video/konicdev.c
r13798r13799
14221422 *
14231423 */
14241424
1425void k007121_sprites_draw( device_t *device, bitmap_t *bitmap, const rectangle *cliprect, gfx_element *gfx, colortable_t *ctable,
1425void k007121_sprites_draw( device_t *device, bitmap_t *bitmap, const rectangle &cliprect, gfx_element *gfx, colortable_t *ctable,
14261426                    const UINT8 *source, int base_color, int global_x_offset, int bank_base, UINT32 pri_mask )
14271427{
14281428   k007121_state *k007121 = k007121_get_safe_token(device);
r13798r13799
17491749#endif
17501750}
17511751
1752void k007342_tilemap_draw( device_t *device, bitmap_t *bitmap, const rectangle *cliprect, int num, int flags, UINT32 priority )
1752void k007342_tilemap_draw( device_t *device, bitmap_t *bitmap, const rectangle &cliprect, int num, int flags, UINT32 priority )
17531753{
17541754   k007342_state *k007342 = k007342_get_safe_token(device);
17551755   tilemap_draw(bitmap, cliprect, k007342->tilemap[num], flags, priority);
r13798r13799
19421942 *   7  | xxxxxxxx | unused
19431943 */
19441944
1945void k007420_sprites_draw( device_t *device, bitmap_t *bitmap, const rectangle *cliprect, gfx_element *gfx )
1945void k007420_sprites_draw( device_t *device, bitmap_t *bitmap, const rectangle &cliprect, gfx_element *gfx )
19461946{
19471947   k007420_state *k007420 = k007420_get_safe_token(device);
19481948   int offs;
r13798r13799
25612561#endif
25622562}
25632563
2564void k052109_tilemap_draw( device_t *device, bitmap_t *bitmap, const rectangle *cliprect, int tmap_num, UINT32 flags, UINT8 priority )
2564void k052109_tilemap_draw( device_t *device, bitmap_t *bitmap, const rectangle &cliprect, int tmap_num, UINT32 flags, UINT8 priority )
25652565{
25662566   k052109_state *k052109 = k052109_get_safe_token(device);
25672567   tilemap_draw(bitmap, cliprect, k052109->tilemap[tmap_num], flags, priority);
r13798r13799
30033003 * Note that Aliens also uses the shadow bit to select the second sprite bank.
30043004 */
30053005
3006void k051960_sprites_draw( device_t *device, bitmap_t *bitmap, const rectangle *cliprect, int min_priority, int max_priority )
3006void k051960_sprites_draw( device_t *device, bitmap_t *bitmap, const rectangle &cliprect, int min_priority, int max_priority )
30073007{
30083008#define NUM_SPRITES 128
30093009   k051960_state *k051960 = k051960_get_safe_token(device);
r13798r13799
35293529 * The rest of the sprite remains normal.
35303530 */
35313531
3532void k053245_sprites_draw( device_t *device, bitmap_t *bitmap, const rectangle *cliprect )
3532void k053245_sprites_draw( device_t *device, bitmap_t *bitmap, const rectangle &cliprect )
35333533{
35343534#define NUM_SPRITES 128
35353535   k05324x_state *k053245 = k05324x_get_safe_token(device);
r13798r13799
37833783
37843784/* Lethal Enforcers has 2 of these chips hooked up in parallel to give 6bpp gfx.. lets cheat a
37853785  bit and make emulating it a little less messy by using a custom function instead */
3786void k053245_sprites_draw_lethal( device_t *device, bitmap_t *bitmap, const rectangle *cliprect )
3786void k053245_sprites_draw_lethal( device_t *device, bitmap_t *bitmap, const rectangle &cliprect )
37873787{
37883788#define NUM_SPRITES 128
37893789   k05324x_state *k053245 = k05324x_get_safe_token(device);
r13798r13799
44504450 * The rest of the sprite remains normal.
44514451 */
44524452
4453void k053247_sprites_draw( device_t *device, bitmap_t *bitmap, const rectangle *cliprect )
4453void k053247_sprites_draw( device_t *device, bitmap_t *bitmap, const rectangle &cliprect )
44544454{
44554455#define NUM_SPRITES 256
44564456   k053247_state *k053246 = k053247_get_safe_token(device);
r13798r13799
52215221static TILE_GET_INFO_DEVICE( k051316_get_tile_info0 ) { k051316_get_tile_info(device, tileinfo, tile_index); }
52225222
52235223
5224void k051316_zoom_draw( device_t *device, bitmap_t *bitmap, const rectangle *cliprect, int flags, UINT32 priority )
5224void k051316_zoom_draw( device_t *device, bitmap_t *bitmap, const rectangle &cliprect, int flags, UINT32 priority )
52255225{
52265226   k051316_state *k051316= k051316_get_safe_token(device);
52275227   UINT32 startx, starty;
r13798r13799
54595459
54605460// there is another implementation of this in  video/konamigx.c (!)
54615461//  why? shall they be merged?
5462void k053936_zoom_draw( device_t *device, bitmap_t *bitmap, const rectangle *cliprect, tilemap_t *tmap, int flags, UINT32 priority, int glfgreat_hack )
5462void k053936_zoom_draw( device_t *device, bitmap_t *bitmap, const rectangle &cliprect, tilemap_t *tmap, int flags, UINT32 priority, int glfgreat_hack )
54635463{
54645464   k053936_state *k053936= k053936_get_safe_token(device);
54655465   if (!tmap)
r13798r13799
54845484      {
54855485         my_clip.min_x = k053936->ctrl[0x08] + k053936->offset[0] + 2;
54865486         my_clip.max_x = k053936->ctrl[0x09] + k053936->offset[0] + 2 - 1;
5487         if (my_clip.min_x < cliprect->min_x)
5488            my_clip.min_x = cliprect->min_x;
5489         if (my_clip.max_x > cliprect->max_x)
5490            my_clip.max_x = cliprect->max_x;
5487         if (my_clip.min_x < cliprect.min_x)
5488            my_clip.min_x = cliprect.min_x;
5489         if (my_clip.max_x > cliprect.max_x)
5490            my_clip.max_x = cliprect.max_x;
54915491
54925492         y = k053936->ctrl[0x0a] + k053936->offset[1] - 2;
5493         if (y < cliprect->min_y)
5494            y = cliprect->min_y;
5493         if (y < cliprect.min_y)
5494            y = cliprect.min_y;
54955495         maxy = k053936->ctrl[0x0b] + k053936->offset[1] - 2 - 1;
5496         if (maxy > cliprect->max_y)
5497            maxy = cliprect->max_y;
5496         if (maxy > cliprect.max_y)
5497            maxy = cliprect.max_y;
54985498      }
54995499      else
55005500      {
5501         my_clip.min_x = cliprect->min_x;
5502         my_clip.max_x = cliprect->max_x;
5501         my_clip.min_x = cliprect.min_x;
5502         my_clip.max_x = cliprect.max_x;
55035503
5504         y = cliprect->min_y;
5505         maxy = cliprect->max_y;
5504         y = cliprect.min_y;
5505         maxy = cliprect.max_y;
55065506      }
55075507
55085508      while (y <= maxy)
r13798r13799
55255525         startx -= k053936->offset[0] * incxx;
55265526         starty -= k053936->offset[0] * incxy;
55275527
5528         tilemap_draw_roz(bitmap,&my_clip,tmap,startx << 5,starty << 5,
5528         tilemap_draw_roz(bitmap,my_clip,tmap,startx << 5,starty << 5,
55295529               incxx << 5,incxy << 5,0,0,
55305530               k053936->wraparound,
55315531               flags,priority);
r13798r13799
69986998         // force tilemap into a clean, static state
69996999         // *really ugly but it minimizes alteration to tilemap.c
70007000         memset(&zerorect, 0, sizeof(rectangle));   // zero dimension
7001         tilemap_draw(bitmap, &zerorect, tmap, 0, 0);   // dummy call to reset tile_dirty_map
7001         tilemap_draw(bitmap, zerorect, tmap, 0, 0);   // dummy call to reset tile_dirty_map
70027002         xprmap->fill(0);                  // reset pixel transparency_bitmap;
70037003         memset(xprdata, TILEMAP_PIXEL_LAYER0, 0x800);   // reset tile transparency_data;
70047004      }
r13798r13799
70907090   return(0);
70917091}
70927092
7093void k056832_tilemap_draw( device_t *device, bitmap_t *bitmap, const rectangle *cliprect, int layer, UINT32 flags, UINT32 priority )
7093void k056832_tilemap_draw( device_t *device, bitmap_t *bitmap, const rectangle &cliprect, int layer, UINT32 flags, UINT32 priority )
70947094{
70957095   k056832_state *k056832 = k056832_get_safe_token(device);
70967096   UINT32 last_dx, last_visible, new_colorbase, last_active;
r13798r13799
71237123   height = rowspan * K056832_PAGE_HEIGHT;
71247124   width  = colspan * K056832_PAGE_WIDTH;
71257125
7126   cminx = cliprect->min_x;
7127   cmaxx = cliprect->max_x;
7128   cminy = cliprect->min_y;
7129   cmaxy = cliprect->max_y;
7126   cminx = cliprect.min_x;
7127   cmaxx = cliprect.max_x;
7128   cminy = cliprect.min_y;
7129   cmaxy = cliprect.max_y;
71307130
71317131   // flip correction registers
71327132   flipy = k056832->regs[0] & 0x20;
r13798r13799
73987398            // want the tilemap to be drawn on the right hand side..  this is probably not the correct
73997399            // logic, but it works.
74007400            if ((drawrect.min_x>0) && (drawrect.max_x==511))
7401               drawrect.max_x=cliprect->max_x;
7401               drawrect.max_x=cliprect.max_x;
74027402
74037403            tilemap_set_scrollx(tmap, 0, dx);
74047404
74057405            LINE_SHORTCIRCUIT:
7406               tilemap_draw(bitmap, &drawrect, tmap, flags, priority);
7406               tilemap_draw(bitmap, drawrect, tmap, flags, priority);
74077407
74087408         } // end of line loop
74097409      } // end of column loop
r13798r13799
74137413} // end of function
74147414
74157415
7416void k056832_tilemap_draw_dj( device_t *device, bitmap_t *bitmap, const rectangle *cliprect, int layer, UINT32 flags, UINT32 priority )
7416void k056832_tilemap_draw_dj( device_t *device, bitmap_t *bitmap, const rectangle &cliprect, int layer, UINT32 flags, UINT32 priority )
74177417{
74187418   k056832_state *k056832 = k056832_get_safe_token(device);
74197419   UINT32 last_dx, last_visible, new_colorbase, last_active;
r13798r13799
74427442   height = rowspan * K056832_PAGE_HEIGHT;
74437443   width  = colspan * K056832_PAGE_WIDTH;
74447444
7445   cminx = cliprect->min_x;
7446   cmaxx = cliprect->max_x;
7447   cminy = cliprect->min_y;
7448   cmaxy = cliprect->max_y;
7445   cminx = cliprect.min_x;
7446   cmaxx = cliprect.max_x;
7447   cminy = cliprect.min_y;
7448   cmaxy = cliprect.max_y;
74497449
74507450   // flip correction registers
74517451   flipy = k056832->regs[0] & 0x20;
r13798r13799
76717671            tilemap_set_scrollx(tmap, 0, dx);
76727672
76737673            LINE_SHORTCIRCUIT:
7674               tilemap_draw(bitmap, &drawrect, tmap, flags, priority);
7674               tilemap_draw(bitmap, drawrect, tmap, flags, priority);
76757675
76767676         } // end of line loop
76777677      } // end of column loop
r13798r13799
94169416   }
94179417}
94189418
9419void k001005_draw( device_t *device, bitmap_t *bitmap, const rectangle *cliprect )
9419void k001005_draw( device_t *device, bitmap_t *bitmap, const rectangle &cliprect )
94209420{
94219421   k001005_state *k001005 = k001005_get_safe_token(device);
94229422   int i, j;
94239423
9424   memcpy(&k001005->cliprect, cliprect, sizeof(rectangle));
9424   memcpy(&k001005->cliprect, &cliprect, sizeof(rectangle));
94259425
9426   for (j = cliprect->min_y; j <= cliprect->max_y; j++)
9426   for (j = cliprect.min_y; j <= cliprect.max_y; j++)
94279427   {
94289428      UINT32 *bmp = &bitmap->pix32(j);
94299429      UINT32 *src = &k001005->bitmap[k001005->bitmap_page ^ 1]->pix32(j);
94309430
9431      for (i = cliprect->min_x; i <= cliprect->max_x; i++)
9431      for (i = cliprect.min_x; i <= cliprect.max_x; i++)
94329432      {
94339433         if (src[i] & 0xff000000)
94349434         {
r13798r13799
96959695}
96969696
96979697
9698void k001604_draw_back_layer( device_t *device, bitmap_t *bitmap, const rectangle *cliprect )
9698void k001604_draw_back_layer( device_t *device, bitmap_t *bitmap, const rectangle &cliprect )
96999699{
97009700   k001604_state *k001604 = k001604_get_safe_token(device);
97019701   int layer;
97029702   int num_layers;
9703   bitmap->fill(0, *cliprect);
9703   bitmap->fill(0, cliprect);
97049704
97059705   num_layers = k001604->layer_size ? 2 : 1;
97069706
r13798r13799
97309730   }
97319731}
97329732
9733void k001604_draw_front_layer( device_t *device, bitmap_t *bitmap, const rectangle *cliprect )
9733void k001604_draw_front_layer( device_t *device, bitmap_t *bitmap, const rectangle &cliprect )
97349734{
97359735   k001604_state *k001604 = k001604_get_safe_token(device);
97369736
r13798r13799
1003110031}
1003210032
1003310033
10034void k037122_tile_draw( device_t *device, bitmap_t *bitmap, const rectangle *cliprect )
10034void k037122_tile_draw( device_t *device, bitmap_t *bitmap, const rectangle &cliprect )
1003510035{
1003610036   k037122_state *k037122 = k037122_get_safe_token(device);
1003710037   const rectangle &visarea = k037122->screen->visible_area();
src/mame/video/djmain.c
r13798r13799
1212
1313
1414
15static void draw_sprites(running_machine& machine, bitmap_t *bitmap, const rectangle *cliprect)
15static void draw_sprites(running_machine& machine, bitmap_t *bitmap, const rectangle &cliprect)
1616{
1717   djmain_state *state = machine.driver_data<djmain_state>();
1818   device_t *k055555 = machine.device("k055555");
r13798r13799
169169            order[j] = temp;
170170         }
171171
172   bitmap->fill(screen.machine().pens[0], *cliprect);
172   bitmap->fill(screen.machine().pens[0], cliprect);
173173
174174   for (i = 0; i < NUM_LAYERS + 1; i++)
175175   {
src/mame/video/firetrk.c
r13798r13799
255255}
256256
257257
258static void firetrk_draw_car(running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect, gfx_element **gfx, int which, int flash)
258static void firetrk_draw_car(running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect, gfx_element **gfx, int which, int flash)
259259{
260260   firetrk_state *state = machine.driver_data<firetrk_state>();
261261   int gfx_bank, code, color, flip_x, flip_y, x, y;
r13798r13799
285285}
286286
287287
288static void superbug_draw_car(running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect, gfx_element **gfx, int flash)
288static void superbug_draw_car(running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect, gfx_element **gfx, int flash)
289289{
290290   firetrk_state *state = machine.driver_data<firetrk_state>();
291291   int gfx_bank = (*state->m_car_rot & 0x10) ? 4 : 3;
r13798r13799
298298}
299299
300300
301static void montecar_draw_car(running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect, gfx_element **gfx, int which, int is_collision_detection)
301static void montecar_draw_car(running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect, gfx_element **gfx, int which, int is_collision_detection)
302302{
303303   firetrk_state *state = machine.driver_data<firetrk_state>();
304304   int gfx_bank, code, color, flip_x, flip_y, x, y;
r13798r13799
328328}
329329
330330
331static void draw_text(bitmap_t *bitmap, const rectangle *cliprect, gfx_element **gfx, UINT8 *alpha_ram,
331static void draw_text(bitmap_t *bitmap, const rectangle &cliprect, gfx_element **gfx, UINT8 *alpha_ram,
332332                 int x, int count, int height)
333333{
334334   int i;
r13798r13799
366366   tilemap_set_scrolly(state->m_tilemap1, 0, *state->m_scroll_y);
367367   tilemap_set_scrolly(state->m_tilemap2, 0, *state->m_scroll_y);
368368
369   bitmap->fill(0, *cliprect);
370   tilemap_draw(bitmap, &playfield_window, state->m_tilemap1, 0, 0);
371   firetrk_draw_car(screen.machine(), bitmap, &playfield_window, screen.machine().gfx, 0, state->m_flash);
372   firetrk_draw_car(screen.machine(), bitmap, &playfield_window, screen.machine().gfx, 1, state->m_flash);
369   bitmap->fill(0, cliprect);
370   tilemap_draw(bitmap, playfield_window, state->m_tilemap1, 0, 0);
371   firetrk_draw_car(screen.machine(), bitmap, playfield_window, screen.machine().gfx, 0, state->m_flash);
372   firetrk_draw_car(screen.machine(), bitmap, playfield_window, screen.machine().gfx, 1, state->m_flash);
373373   draw_text(bitmap, cliprect, screen.machine().gfx, state->m_alpha_num_ram + 0x00, 296, 0x10, 0x10);
374374   draw_text(bitmap, cliprect, screen.machine().gfx, state->m_alpha_num_ram + 0x10,   8, 0x10, 0x10);
375375
376   if (cliprect->max_y == screen.visible_area().max_y)
376   if (cliprect.max_y == screen.visible_area().max_y)
377377   {
378      tilemap_draw(state->m_helper1, &playfield_window, state->m_tilemap2, 0, 0);
378      tilemap_draw(state->m_helper1, playfield_window, state->m_tilemap2, 0, 0);
379379
380380      state->m_helper2->fill(0xff, playfield_window);
381      firetrk_draw_car(screen.machine(), state->m_helper2, &playfield_window, screen.machine().gfx, 0, FALSE);
381      firetrk_draw_car(screen.machine(), state->m_helper2, playfield_window, screen.machine().gfx, 0, FALSE);
382382      check_collision(state, 0);
383383
384384      state->m_helper2->fill(0xff, playfield_window);
385      firetrk_draw_car(screen.machine(), state->m_helper2, &playfield_window, screen.machine().gfx, 1, FALSE);
385      firetrk_draw_car(screen.machine(), state->m_helper2, playfield_window, screen.machine().gfx, 1, FALSE);
386386      check_collision(state, 1);
387387
388388      *state->m_blink = FALSE;
r13798r13799
401401   tilemap_set_scrolly(state->m_tilemap1, 0, *state->m_scroll_y);
402402   tilemap_set_scrolly(state->m_tilemap2, 0, *state->m_scroll_y);
403403
404   bitmap->fill(0, *cliprect);
405   tilemap_draw(bitmap, &playfield_window, state->m_tilemap1, 0, 0);
406   superbug_draw_car(screen.machine(), bitmap, &playfield_window, screen.machine().gfx, state->m_flash);
404   bitmap->fill(0, cliprect);
405   tilemap_draw(bitmap, playfield_window, state->m_tilemap1, 0, 0);
406   superbug_draw_car(screen.machine(), bitmap, playfield_window, screen.machine().gfx, state->m_flash);
407407   draw_text(bitmap, cliprect, screen.machine().gfx, state->m_alpha_num_ram + 0x00, 296, 0x10, 0x10);
408408   draw_text(bitmap, cliprect, screen.machine().gfx, state->m_alpha_num_ram + 0x10,   8, 0x10, 0x10);
409409
410   if (cliprect->max_y == screen.visible_area().max_y)
410   if (cliprect.max_y == screen.visible_area().max_y)
411411   {
412      tilemap_draw(state->m_helper1, &playfield_window, state->m_tilemap2, 0, 0);
412      tilemap_draw(state->m_helper1, playfield_window, state->m_tilemap2, 0, 0);
413413
414414      state->m_helper2->fill(0xff, playfield_window);
415      superbug_draw_car(screen.machine(), state->m_helper2, &playfield_window, screen.machine().gfx, FALSE);
415      superbug_draw_car(screen.machine(), state->m_helper2, playfield_window, screen.machine().gfx, FALSE);
416416      check_collision(state, 0);
417417
418418      *state->m_blink = FALSE;
r13798r13799
431431   tilemap_set_scrolly(state->m_tilemap1, 0, *state->m_scroll_y);
432432   tilemap_set_scrolly(state->m_tilemap2, 0, *state->m_scroll_y);
433433
434   bitmap->fill(0x2c, *cliprect);
435   tilemap_draw(bitmap, &playfield_window, state->m_tilemap1, 0, 0);
436   montecar_draw_car(screen.machine(), bitmap, &playfield_window, screen.machine().gfx, 0, FALSE);
437   montecar_draw_car(screen.machine(), bitmap, &playfield_window, screen.machine().gfx, 1, FALSE);
434   bitmap->fill(0x2c, cliprect);
435   tilemap_draw(bitmap, playfield_window, state->m_tilemap1, 0, 0);
436   montecar_draw_car(screen.machine(), bitmap, playfield_window, screen.machine().gfx, 0, FALSE);
437   montecar_draw_car(screen.machine(), bitmap, playfield_window, screen.machine().gfx, 1, FALSE);
438438   draw_text(bitmap, cliprect, screen.machine().gfx, state->m_alpha_num_ram + 0x00, 24, 0x20, 0x08);
439439   draw_text(bitmap, cliprect, screen.machine().gfx, state->m_alpha_num_ram + 0x20, 16, 0x20, 0x08);
440440
441   if (cliprect->max_y == screen.visible_area().max_y)
441   if (cliprect.max_y == screen.visible_area().max_y)
442442   {
443      tilemap_draw(state->m_helper1, &playfield_window, state->m_tilemap2, 0, 0);
443      tilemap_draw(state->m_helper1, playfield_window, state->m_tilemap2, 0, 0);
444444
445445      state->m_helper2->fill(0xff, playfield_window);
446      montecar_draw_car(screen.machine(), state->m_helper2, &playfield_window, screen.machine().gfx, 0, TRUE);
446      montecar_draw_car(screen.machine(), state->m_helper2, playfield_window, screen.machine().gfx, 0, TRUE);
447447      check_collision(state, 0);
448448
449449      state->m_helper2->fill(0xff, playfield_window);
450      montecar_draw_car(screen.machine(), state->m_helper2, &playfield_window, screen.machine().gfx, 1, TRUE);
450      montecar_draw_car(screen.machine(), state->m_helper2, playfield_window, screen.machine().gfx, 1, TRUE);
451451      check_collision(state, 1);
452452   }
453453
src/mame/video/konicdev.h
r13798r13799
309309
310310/* shall we move source in the interface? */
311311/* also notice that now we directly pass *gfx[chip] instead of **gfx !! */
312void k007121_sprites_draw( device_t *device, bitmap_t *bitmap, const rectangle *cliprect, gfx_element *gfx, colortable_t *ctable,
312void k007121_sprites_draw( device_t *device, bitmap_t *bitmap, const rectangle &cliprect, gfx_element *gfx, colortable_t *ctable,
313313                    const UINT8 *source, int base_color, int global_x_offset, int bank_base, UINT32 pri_mask );
314314
315315
r13798r13799
321321WRITE8_DEVICE_HANDLER( k007342_vreg_w );
322322
323323void k007342_tilemap_update(device_t *device);
324void k007342_tilemap_draw(device_t *device, bitmap_t *bitmap, const rectangle *cliprect, int num, int flags, UINT32 priority);
324void k007342_tilemap_draw(device_t *device, bitmap_t *bitmap, const rectangle &cliprect, int num, int flags, UINT32 priority);
325325int k007342_is_int_enabled(device_t *device);
326326
327327
r13798r13799
330330
331331READ8_DEVICE_HANDLER( k007420_r );
332332WRITE8_DEVICE_HANDLER( k007420_w );
333void k007420_sprites_draw(device_t *device, bitmap_t *bitmap, const rectangle *cliprect, gfx_element *gfx);
333void k007420_sprites_draw(device_t *device, bitmap_t *bitmap, const rectangle &cliprect, gfx_element *gfx);
334334
335335
336336/**  Konami 052109  **/
r13798r13799
376376int k052109_is_irq_enabled(device_t *device);
377377void k052109_set_layer_offsets(device_t *device, int layer, int dx, int dy);
378378void k052109_tilemap_mark_dirty(device_t *device, int tmap_num);
379void k052109_tilemap_draw(device_t *device, bitmap_t *bitmap, const rectangle *cliprect, int tmap_num, UINT32 flags, UINT8 priority);
379void k052109_tilemap_draw(device_t *device, bitmap_t *bitmap, const rectangle &cliprect, int tmap_num, UINT32 flags, UINT8 priority);
380380
381381
382382/**  Konami 051960 / 051937  **/
r13798r13799
404404READ16_DEVICE_HANDLER( k051937_word_r );
405405WRITE16_DEVICE_HANDLER( k051937_word_w );
406406
407void k051960_sprites_draw(device_t *device, bitmap_t *bitmap, const rectangle *cliprect, int min_priority, int max_priority);
407void k051960_sprites_draw(device_t *device, bitmap_t *bitmap, const rectangle &cliprect, int min_priority, int max_priority);
408408int k051960_is_irq_enabled(device_t *device);
409409int k051960_is_nmi_enabled(device_t *device);
410410void k051960_set_sprite_offsets(device_t *device, int dx, int dy);
r13798r13799
428428READ16_DEVICE_HANDLER( k053244_word_r );
429429WRITE16_DEVICE_HANDLER( k053244_word_w );
430430void k053244_bankselect(device_t *device, int bank);   /* used by TMNT2, Asterix and Premier Soccer for ROM testing */
431void k053245_sprites_draw(device_t *device, bitmap_t *bitmap, const rectangle *cliprect);
432void k053245_sprites_draw_lethal(device_t *device, bitmap_t *bitmap, const rectangle *cliprect); /* for lethal enforcers */
431void k053245_sprites_draw(device_t *device, bitmap_t *bitmap, const rectangle &cliprect);
432void k053245_sprites_draw_lethal(device_t *device, bitmap_t *bitmap, const rectangle &cliprect); /* for lethal enforcers */
433433void k053245_clear_buffer(device_t *device);
434434void k053245_set_sprite_offs(device_t *device, int offsx, int offsy);
435435
r13798r13799
463463WRITE16_DEVICE_HANDLER( k053247_reg_word_w ); // "OBJSET2" registers
464464WRITE32_DEVICE_HANDLER( k053247_reg_long_w );
465465
466void k053247_sprites_draw(device_t *device, bitmap_t *bitmap,const rectangle *cliprect);
466void k053247_sprites_draw(device_t *device, bitmap_t *bitmap,const rectangle &cliprect);
467467int k053247_read_register(device_t *device, int regnum);
468468void k053247_set_sprite_offs(device_t *device, int offsx, int offsy);
469469void k053247_wraparound_enable(device_t *device, int status);
r13798r13799
501501WRITE8_DEVICE_HANDLER( k051316_w );
502502READ8_DEVICE_HANDLER( k051316_rom_r );
503503WRITE8_DEVICE_HANDLER( k051316_ctrl_w );
504void k051316_zoom_draw(device_t *device, bitmap_t *bitmap,const rectangle *cliprect,int flags,UINT32 priority);
504void k051316_zoom_draw(device_t *device, bitmap_t *bitmap,const rectangle &cliprect,int flags,UINT32 priority);
505505void k051316_wraparound_enable(device_t *device, int status);
506506
507507
r13798r13799
510510READ16_DEVICE_HANDLER( k053936_ctrl_r );   // FIXME: this is probably unused... to be checked!
511511WRITE16_DEVICE_HANDLER( k053936_linectrl_w );
512512READ16_DEVICE_HANDLER( k053936_linectrl_r );
513void k053936_zoom_draw(device_t *device, bitmap_t *bitmap, const rectangle *cliprect, tilemap_t *tmap, int flags, UINT32 priority, int glfgreat_hack);
513void k053936_zoom_draw(device_t *device, bitmap_t *bitmap, const rectangle &cliprect, tilemap_t *tmap, int flags, UINT32 priority, int glfgreat_hack);
514514void k053936_wraparound_enable(device_t *device, int status);   // shall we merge this into the configuration intf?
515515void k053936_set_offset(device_t *device, int xoffs, int yoffs);   // shall we merge this into the configuration intf?
516516
r13798r13799
579579WRITE8_DEVICE_HANDLER( k056832_b_w );
580580void k056832_mark_plane_dirty(device_t *device, int num);
581581void k056832_mark_all_tmaps_dirty(device_t *device);
582void k056832_tilemap_draw(device_t *device, bitmap_t *bitmap, const rectangle *cliprect, int num, UINT32 flags, UINT32 priority);
583void k056832_tilemap_draw_dj(device_t *device, bitmap_t *bitmap, const rectangle *cliprect, int layer, UINT32 flags, UINT32 priority);
582void k056832_tilemap_draw(device_t *device, bitmap_t *bitmap, const rectangle &cliprect, int num, UINT32 flags, UINT32 priority);
583void k056832_tilemap_draw_dj(device_t *device, bitmap_t *bitmap, const rectangle &cliprect, int layer, UINT32 flags, UINT32 priority);
584584void k056832_set_layer_association(device_t *device, int status);
585585int  k056832_get_layer_association(device_t *device);
586586void k056832_set_layer_offs(device_t *device, int layer, int offsx, int offsy);
r13798r13799
720720
721721
722722/**  Konami 001005  **/
723void k001005_draw(device_t *device, bitmap_t *bitmap, const rectangle *cliprect);
723void k001005_draw(device_t *device, bitmap_t *bitmap, const rectangle &cliprect);
724724void k001005_swap_buffers(device_t *device);
725725void k001005_preprocess_texture_data(UINT8 *rom, int length, int gticlub);
726726
r13798r13799
729729
730730
731731/**  Konami 001604  **/
732void k001604_draw_back_layer( device_t *device, bitmap_t *bitmap, const rectangle *cliprect );
733void k001604_draw_front_layer( device_t *device, bitmap_t *bitmap, const rectangle *cliprect );
732void k001604_draw_back_layer( device_t *device, bitmap_t *bitmap, const rectangle &cliprect );
733void k001604_draw_front_layer( device_t *device, bitmap_t *bitmap, const rectangle &cliprect );
734734WRITE32_DEVICE_HANDLER( k001604_tile_w );
735735READ32_DEVICE_HANDLER( k001604_tile_r );
736736WRITE32_DEVICE_HANDLER( k001604_char_w );
r13798r13799
740740
741741
742742/**  Konami 037122  **/
743void k037122_tile_draw( device_t *device, bitmap_t *bitmap, const rectangle *cliprect );
743void k037122_tile_draw( device_t *device, bitmap_t *bitmap, const rectangle &cliprect );
744744READ32_DEVICE_HANDLER( k037122_sram_r );
745745WRITE32_DEVICE_HANDLER( k037122_sram_w );
746746READ32_DEVICE_HANDLER( k037122_char_r );
src/mame/video/m57.c
r13798r13799
177177 *
178178 *************************************/
179179
180static void draw_background(running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect)
180static void draw_background(running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect)
181181{
182182   m57_state *state = machine.driver_data<m57_state>();
183183   int y,x;
r13798r13799
190190   tilemap_draw(bitmap, cliprect, state->m_bg_tilemap, 0, 0);
191191
192192   // from 128 to 255: wrapped
193   for (y = 128; y <= cliprect->max_y; y++)
193   for (y = 128; y <= cliprect.max_y; y++)
194194   {
195195      scrolly = state->m_scrollram[y] + (state->m_scrollram[y + 0x100] << 8);
196196
197197      if (scrolly >= 0)
198198      {
199         for (x = cliprect->min_x; x <= cliprect->max_x; x++)
199         for (x = cliprect.min_x; x <= cliprect.max_x; x++)
200200         {
201            if ((x + scrolly) <= cliprect->max_x)
201            if ((x + scrolly) <= cliprect.max_x)
202202               bitmap->pix16(y, x) = bitmap->pix16(y, x + scrolly);
203203            else
204               bitmap->pix16(y, x) = bitmap->pix16(y, cliprect->max_x);
204               bitmap->pix16(y, x) = bitmap->pix16(y, cliprect.max_x);
205205         }
206206      } else {
207         for (x = cliprect->max_x; x >= cliprect->min_x; x--)
207         for (x = cliprect.max_x; x >= cliprect.min_x; x--)
208208         {
209            if ((x + scrolly) >= cliprect->min_x)
209            if ((x + scrolly) >= cliprect.min_x)
210210               bitmap->pix16(y, x) = bitmap->pix16(y, x + scrolly);
211211            else
212               bitmap->pix16(y, x) = bitmap->pix16(y, cliprect->min_x);
212               bitmap->pix16(y, x) = bitmap->pix16(y, cliprect.min_x);
213213         }
214214      }
215215   }
r13798r13799
221221 *
222222 *************************************/
223223
224static void draw_sprites(running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect)
224static void draw_sprites(running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect)
225225{
226226   m57_state *state = machine.driver_data<m57_state>();
227227   int offs;
src/mame/video/segas24.c
r13798r13799
3333   }
3434
3535   screen.machine().priority_bitmap->fill(0);
36   bitmap->fill(0, *cliprect);
36   bitmap->fill(0, cliprect);
3737
3838   std::vector<int> order;
3939   order.resize(12);
src/mame/video/mustache.c
r13798r13799
100100   tilemap_set_scroll_rows(state->m_bg_tilemap, 4);
101101}
102102
103static void draw_sprites(running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect )
103static void draw_sprites(running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect )
104104{
105105   mustache_state *state = machine.driver_data<mustache_state>();
106   rectangle clip = *cliprect;
106   rectangle clip = cliprect;
107107   const gfx_element *gfx = machine.gfx[1];
108108   const rectangle &visarea = machine.primary_screen->visible_area();
109109   UINT8 *spriteram = state->m_spriteram;
r13798r13799
135135         sy = 240 - sy;
136136      }
137137
138      drawgfx_transpen(bitmap,&clip,gfx,
138      drawgfx_transpen(bitmap,clip,gfx,
139139            code,
140140            color,
141141            flip_screen_get(machine),flip_screen_get(machine),
src/mame/video/segas16a.c
r13798r13799
3838   /* if no drawing is happening, fill with black and get out */
3939   if (!segaic16_display_enable)
4040   {
41      bitmap->fill(get_black_pen(screen.machine()), *cliprect);
41      bitmap->fill(get_black_pen(screen.machine()), cliprect);
4242      return 0;
4343   }
4444
4545   /* reset priorities */
46   screen.machine().priority_bitmap->fill(0, *cliprect);
46   screen.machine().priority_bitmap->fill(0, cliprect);
4747
4848   /* draw background opaquely first, not setting any priorities */
4949   segaic16_tilemap_draw(screen, bitmap, cliprect, 0, SEGAIC16_TILEMAP_BACKGROUND, 0 | TILEMAP_DRAW_OPAQUE, 0x00);
src/mame/video/neogeo.c
r13798r13799
925925   neogeo_state *state = screen.machine().driver_data<neogeo_state>();
926926
927927   /* fill with background color first */
928   bitmap->fill(state->m_pens[0x0fff], *cliprect);
928   bitmap->fill(state->m_pens[0x0fff], cliprect);
929929
930   draw_sprites(screen.machine(), bitmap, cliprect->min_y);
930   draw_sprites(screen.machine(), bitmap, cliprect.min_y);
931931
932   draw_fixed_layer(screen.machine(), bitmap, cliprect->min_y);
932   draw_fixed_layer(screen.machine(), bitmap, cliprect.min_y);
933933
934934   return 0;
935935}
src/mame/video/konamigx.c
r13798r13799
8989
9090void K053936GP_set_cliprect(int chip, int minx, int maxx, int miny, int maxy)
9191{
92   rectangle *cliprect = &K053936_cliprect[chip];
93   cliprect->min_x = minx;
94   cliprect->max_x = maxx;
95   cliprect->min_y = miny;
96   cliprect->max_y = maxy;
92   rectangle &cliprect = K053936_cliprect[chip];
93   cliprect.min_x = minx;
94   cliprect.max_x = maxx;
95   cliprect.min_y = miny;
96   cliprect.max_y = maxy;
9797}
9898
9999INLINE void K053936GP_copyroz32clip( running_machine &machine,
100100      bitmap_t *dst_bitmap, bitmap_t *src_bitmap,
101      const rectangle *dst_cliprect, const rectangle *src_cliprect,
101      const rectangle &dst_cliprect, const rectangle &src_cliprect,
102102      UINT32 _startx,UINT32 _starty,int _incxx,int _incxy,int _incyx,int _incyy,
103103      int tilebpp, int blend, int alpha, int clip, int pixeldouble_output )
104104{
r13798r13799
123123   incxy = _incxy; incxx = _incxx; incyy = _incyy; incyx = _incyx;
124124   starty = _starty; startx = _startx;
125125
126   if (src_cliprect && clip) // set source clip range to some extreme values when disabled
126   if (clip) // set source clip range to some extreme values when disabled
127127   {
128      src_minx = src_cliprect->min_x;
129      src_maxx = src_cliprect->max_x;
130      src_miny = src_cliprect->min_y;
131      src_maxy = src_cliprect->max_y;
128      src_minx = src_cliprect.min_x;
129      src_maxx = src_cliprect.max_x;
130      src_miny = src_cliprect.min_y;
131      src_maxy = src_cliprect.max_y;
132132   }
133133   // this simply isn't safe to do!
134134   else { src_minx = src_miny = -0x10000; src_maxx = src_maxy = 0x10000; }
135135
136   if (dst_cliprect) // set target clip range
137   {
138      sx = dst_cliprect->min_x;
139      tx = dst_cliprect->max_x - sx + 1;
140      sy = dst_cliprect->min_y;
141      ty = dst_cliprect->max_y - sy + 1;
136   // set target clip range
137   sx = dst_cliprect.min_x;
138   tx = dst_cliprect.max_x - sx + 1;
139   sy = dst_cliprect.min_y;
140   ty = dst_cliprect.max_y - sy + 1;
142141
143      startx += sx * incxx + sy * incyx;
144      starty += sx * incxy + sy * incyy;
145   }
146   else { sx = sy = 0; tx = dst_bitmap->width(); ty = dst_bitmap->height(); }
142   startx += sx * incxx + sy * incyx;
143   starty += sx * incxy + sy * incyy;
147144
148145   // adjust entry points and other loop constants
149146   dst_pitch = dst_bitmap->rowpixels();
r13798r13799
283280// adapted from generic K053936_zoom_draw()
284281static void K053936GP_zoom_draw(running_machine &machine,
285282      int chip, UINT16 *ctrl, UINT16 *linectrl,
286      bitmap_t *bitmap, const rectangle *cliprect, tilemap_t *tmap,
283      bitmap_t *bitmap, const rectangle &cliprect, tilemap_t *tmap,
287284      int tilebpp, int blend, int alpha, int pixeldouble_output)
288285{
289286   bitmap_t *src_bitmap;
290   rectangle *src_cliprect;
291287   UINT16 *lineaddr;
292288
293289   rectangle my_clip;
r13798r13799
295291   int incxx, incxy, incyx, incyy, y, maxy, clip;
296292
297293   src_bitmap = tilemap_get_pixmap(tmap);
298   src_cliprect = &K053936_cliprect[chip];
294   rectangle &src_cliprect = K053936_cliprect[chip];
299295   clip = K053936_clip_enabled[chip];
300296
301297   if (ctrl[0x07] & 0x0040)    /* "super" mode */
302298   {
303      my_clip.min_x = cliprect->min_x;
304      my_clip.max_x = cliprect->max_x;
305      y = cliprect->min_y;
306      maxy = cliprect->max_y;
299      my_clip.min_x = cliprect.min_x;
300      my_clip.max_x = cliprect.max_x;
301      y = cliprect.min_y;
302      maxy = cliprect.max_y;
307303
308304      while (y <= maxy)
309305      {
r13798r13799
322318         starty -= K053936_offset[chip][0] * incxy;
323319
324320         K053936GP_copyroz32clip(machine,
325               bitmap, src_bitmap, &my_clip, src_cliprect,
321               bitmap, src_bitmap, my_clip, src_cliprect,
326322               startx<<5, starty<<5, incxx<<5, incxy<<5, 0, 0,
327323               tilebpp, blend, alpha, clip, pixeldouble_output);
328324         y++;
r13798r13799
353349   }
354350}
355351
356static void K053936GP_0_zoom_draw(running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect,
352static void K053936GP_0_zoom_draw(running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect,
357353      tilemap_t *tmap, int tilebpp, int blend, int alpha, int pixeldouble_output)
358354{
359355   K053936GP_zoom_draw(machine, 0,K053936_0_ctrl,K053936_0_linectrl,bitmap,cliprect,tmap,tilebpp,blend,alpha, pixeldouble_output);
360356}
361357
362static void K053936GP_1_zoom_draw(running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect,
358static void K053936GP_1_zoom_draw(running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect,
363359      tilemap_t *tmap, int tilebpp, int blend, int alpha, int pixeldouble_output)
364360{
365361   K053936GP_zoom_draw(machine, 1,K053936_1_ctrl,K053936_1_linectrl,bitmap,cliprect,tmap,tilebpp,blend,alpha, pixeldouble_output);
r13798r13799
385381
386382
387383INLINE void zdrawgfxzoom32GP(
388      bitmap_t *bitmap, const rectangle *cliprect, const gfx_element *gfx,
384      bitmap_t *bitmap, const rectangle &cliprect, const gfx_element *gfx,
389385      UINT32 code, UINT32 color, int flipx, int flipy, int sx, int sy,
390386      int scalex, int scaley, int alpha, int drawmode, int zcode, int pri)
391387{
r13798r13799
455451
456452   dst_ptr   = &bitmap->pix32(0);
457453   dst_pitch = bitmap->rowpixels();
458   dst_minx  = cliprect->min_x;
459   dst_maxx  = cliprect->max_x;
460   dst_miny  = cliprect->min_y;
461   dst_maxy  = cliprect->max_y;
454   dst_minx  = cliprect.min_x;
455   dst_maxx  = cliprect.max_x;
456   dst_miny  = cliprect.min_y;
457   dst_maxy  = cliprect.max_y;
462458   dst_x     = sx;
463459   dst_y     = sy;
464460
r13798r13799
11631159   if (gx_objdma && gx_spriteram && K053247_ram) memcpy(gx_spriteram, K053247_ram, 0x1000);
11641160}
11651161
1166void konamigx_mixer(running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect,
1162void konamigx_mixer(running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect,
11671163               tilemap_t *sub1, int sub1flags,
11681164               tilemap_t *sub2, int sub2flags,
11691165               int mixerflags, bitmap_t *extra_bitmap, int rushingheroes_hack)
r13798r13799
24362432   // Type-1
24372433   if (gx_specialrozenable == 1)
24382434   {
2439      K053936_0_zoom_draw(gxtype1_roz_dstbitmap, &gxtype1_roz_dstbitmapclip,gx_psac_tilemap, 0,0,0); // height data
2440      K053936_0_zoom_draw(gxtype1_roz_dstbitmap2,&gxtype1_roz_dstbitmapclip,gx_psac_tilemap2,0,0,0); // colour data (+ some voxel height data?)
2435      K053936_0_zoom_draw(gxtype1_roz_dstbitmap, gxtype1_roz_dstbitmapclip,gx_psac_tilemap, 0,0,0); // height data
2436      K053936_0_zoom_draw(gxtype1_roz_dstbitmap2,gxtype1_roz_dstbitmapclip,gx_psac_tilemap2,0,0,0); // colour data (+ some voxel height data?)
24412437   }
24422438
24432439
r13798r13799
24522448   {
24532449      // we're going to throw half of this away anyway in post-process, so only render what's needed
24542450      rectangle temprect;
2455      temprect.min_x = cliprect->min_x;
2456      temprect.max_x = cliprect->min_x+320;
2457      temprect.min_y = cliprect->min_y;
2458      temprect.max_y = cliprect->max_y;
2451      temprect.min_x = cliprect.min_x;
2452      temprect.max_x = cliprect.min_x+320;
2453      temprect.min_y = cliprect.min_y;
2454      temprect.max_y = cliprect.max_y;
24592455
2460      if (konamigx_type3_psac2_actual_bank == 1) K053936_0_zoom_draw(type3_roz_temp_bitmap, &temprect,gx_psac_tilemap_alt, 0,0,0); // soccerss playfield
2461      else K053936_0_zoom_draw(type3_roz_temp_bitmap, &temprect,gx_psac_tilemap, 0,0,0); // soccerss playfield
2456      if (konamigx_type3_psac2_actual_bank == 1) K053936_0_zoom_draw(type3_roz_temp_bitmap, temprect,gx_psac_tilemap_alt, 0,0,0); // soccerss playfield
2457      else K053936_0_zoom_draw(type3_roz_temp_bitmap, temprect,gx_psac_tilemap, 0,0,0); // soccerss playfield
24622458
24632459
24642460      konamigx_mixer(screen.machine(), bitmap, cliprect, 0, 0, 0, 0, 0, type3_roz_temp_bitmap, gx_rushingheroes_hack);
src/mame/video/segahang.c
r13798r13799
5454   /* if no drawing is happening, fill with black and get out */
5555   if (!segaic16_display_enable)
5656   {
57      bitmap->fill(get_black_pen(screen.machine()), *cliprect);
57      bitmap->fill(get_black_pen(screen.machine()), cliprect);
5858      return 0;
5959   }
6060
6161   /* reset priorities */
62   screen.machine().priority_bitmap->fill(0, *cliprect);
62   screen.machine().priority_bitmap->fill(0, cliprect);
6363
6464   /* draw the low priority road layer */
6565   segaic16_road_draw(0, bitmap, cliprect, SEGAIC16_ROAD_BACKGROUND);
src/mame/video/sprcros2.c
r13798r13799
146146   colortable_configure_tilemap_groups(machine.colortable, state->m_fgtilemap, machine.gfx[2], 0);
147147}
148148
149static void draw_sprites(running_machine &machine, bitmap_t *bitmap,const rectangle *cliprect)
149static void draw_sprites(running_machine &machine, bitmap_t *bitmap,const rectangle &cliprect)
150150{
151151   sprcros2_state *state = machine.driver_data<sprcros2_state>();
152152   int offs,sx,sy,color,flipx,flipy;
src/mame/video/thunderj.c
r13798r13799
131131   int x, y, r;
132132
133133   /* draw the playfield */
134   priority_bitmap->fill(0, *cliprect);
134   priority_bitmap->fill(0, cliprect);
135135   tilemap_draw(bitmap, cliprect, state->m_playfield_tilemap, 0, 0x00);
136136   tilemap_draw(bitmap, cliprect, state->m_playfield_tilemap, 1, 0x01);
137137   tilemap_draw(bitmap, cliprect, state->m_playfield_tilemap, 2, 0x02);
src/mame/video/parodius.c
r13798r13799
6767
6868   konami_sortlayers3(layer, state->m_layerpri);
6969
70   screen.machine().priority_bitmap->fill(0, *cliprect);
71   bitmap->fill(16 * bg_colorbase, *cliprect);
70   screen.machine().priority_bitmap->fill(0, cliprect);
71   bitmap->fill(16 * bg_colorbase, cliprect);
7272   k052109_tilemap_draw(state->m_k052109, bitmap, cliprect, layer[0], 0,1);
7373   k052109_tilemap_draw(state->m_k052109, bitmap, cliprect, layer[1], 0,2);
7474   k052109_tilemap_draw(state->m_k052109, bitmap, cliprect, layer[2], 0,4);
src/mame/video/ladybug.c
r13798r13799
231231   tilemap_set_transparent_pen(state->m_bg_tilemap, 0);
232232}
233233
234static void draw_sprites( running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect )
234static void draw_sprites( running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect )
235235{
236236   ladybug_state *state = machine.driver_data<ladybug_state>();
237237   UINT8 *spriteram = state->m_spriteram;
r13798r13799
288288   int offs;
289289
290290   // clear the bg bitmap
291   bitmap->fill(0, *cliprect);
291   bitmap->fill(0, cliprect);
292292
293293   for (offs = 0; offs < 32; offs++)
294294   {
r13798r13799
333333   }
334334
335335   // clear the bg bitmap
336   bitmap->fill(0, *cliprect);
336   bitmap->fill(0, cliprect);
337337
338338   // draw the stars
339339   if (flip_screen_get(screen.machine()))
r13798r13799
352352      if (state->m_grid_data[i] != 0)
353353      {
354354         UINT8 x = i;
355         int height = cliprect->max_y - cliprect->min_y + 1;
355         int height = cliprect.max_y - cliprect.min_y + 1;
356356
357357         if (flip_screen_get(screen.machine()))
358358            x = ~x;
359359
360         bitmap->plot_box(x, cliprect->min_y, 1, height, 0x81);
360         bitmap->plot_box(x, cliprect.min_y, 1, height, 0x81);
361361      }
362362   }
363363
src/mame/video/combatsc.c
r13798r13799
393393
394394***************************************************************************/
395395
396static void draw_sprites( running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect, const UINT8 *source, int circuit, UINT32 pri_mask )
396static void draw_sprites( running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect, const UINT8 *source, int circuit, UINT32 pri_mask )
397397{
398398   combatsc_state *state = machine.driver_data<combatsc_state>();
399399   device_t *k007121 = circuit ? state->m_k007121_2 : state->m_k007121_1;
r13798r13799
437437   tilemap_set_scrolly(state->m_bg_tilemap[0], 0, k007121_ctrlram_r(state->m_k007121_1, 2));
438438   tilemap_set_scrolly(state->m_bg_tilemap[1], 0, k007121_ctrlram_r(state->m_k007121_2, 2));
439439
440   screen.machine().priority_bitmap->fill(0, *cliprect);
440   screen.machine().priority_bitmap->fill(0, cliprect);
441441
442442   if (state->m_priority == 0)
443443   {
r13798r13799
476476   {
477477      rectangle clip;
478478
479      clip = *cliprect;
479      clip = cliprect;
480480      clip.max_x = clip.min_x + 7;
481481      bitmap->fill(0, clip);
482482
483      clip = *cliprect;
483      clip = cliprect;
484484      clip.min_x = clip.max_x - 7;
485485      bitmap->fill(0, clip);
486486   }
r13798r13799
515515
516516***************************************************************************/
517517
518static void bootleg_draw_sprites( running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect, const UINT8 *source, int circuit )
518static void bootleg_draw_sprites( running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect, const UINT8 *source, int circuit )
519519{
520520   address_space *space = machine.device("maincpu")->memory().space(AS_PROGRAM);
521521   const gfx_element *gfx = machine.gfx[circuit + 2];
src/mame/video/blueprnt.c
r13798r13799
9898   state->save_item(NAME(state->m_gfx_bank));
9999}
100100
101static void draw_sprites( running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect )
101static void draw_sprites( running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect )
102102{
103103   blueprnt_state *state = machine.driver_data<blueprnt_state>();
104104   int offs;
r13798r13799
136136      for (i = 0; i < 32; i++)
137137         tilemap_set_scrolly(state->m_bg_tilemap, i, state->m_scrollram[30 - i]);
138138
139   bitmap->fill(get_black_pen(screen.machine()), *cliprect);
139   bitmap->fill(get_black_pen(screen.machine()), cliprect);
140140   tilemap_draw(bitmap, cliprect, state->m_bg_tilemap, 0, 0);
141141   draw_sprites(screen.machine(), bitmap, cliprect);
142142   tilemap_draw(bitmap, cliprect, state->m_bg_tilemap, 1, 0);
src/mame/video/ppu2c0x.c
r13798r13799
12091209void ppu2c0x_render( device_t *device, bitmap_t *bitmap, int flipx, int flipy, int sx, int sy )
12101210{
12111211   ppu2c0x_state *ppu2c0x = get_token(device);
1212   copybitmap(bitmap, ppu2c0x->bitmap, flipx, flipy, sx, sy, 0);
1212   copybitmap(bitmap, ppu2c0x->bitmap, flipx, flipy, sx, sy, bitmap->cliprect());
12131213}
12141214
12151215/*************************************
src/mame/video/buggychl.c
r13798r13799
8080}
8181
8282
83static void draw_sky( bitmap_t *bitmap, const rectangle *cliprect )
83static void draw_sky( bitmap_t *bitmap, const rectangle &cliprect )
8484{
8585   int x, y;
8686
r13798r13799
9090}
9191
9292
93static void draw_bg( running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect )
93static void draw_bg( running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect )
9494{
9595   buggychl_state *state = machine.driver_data<buggychl_state>();
9696   int offs;
9797   int scroll[256];
9898
9999   /* prevent wraparound */
100   rectangle clip = *cliprect;
100   rectangle clip = cliprect;
101101   if (flip_screen_x_get(machine)) clip.min_x += 8*8;
102102   else clip.max_x -= 8*8;
103103
r13798r13799
113113      if (flip_screen_y_get(machine))
114114         sy = 31 - sy;
115115
116      drawgfx_opaque(state->m_tmp_bitmap1, NULL, machine.gfx[0],
116      drawgfx_opaque(state->m_tmp_bitmap1, state->m_tmp_bitmap1->cliprect(), machine.gfx[0],
117117            code,
118118            2,
119119            flip_screen_x_get(machine),flip_screen_y_get(machine),
r13798r13799
124124   for (offs = 0; offs < 256; offs++)
125125      scroll[offs] = -state->m_scrollv[offs / 8];
126126
127   copyscrollbitmap(state->m_tmp_bitmap2, state->m_tmp_bitmap1, 1, &state->m_bg_scrollx, 256, scroll, NULL);
127   copyscrollbitmap(state->m_tmp_bitmap2, state->m_tmp_bitmap1, 1, &state->m_bg_scrollx, 256, scroll, state->m_tmp_bitmap2->cliprect());
128128
129129   /* then copy to the screen doing row scroll */
130130   for (offs = 0; offs < 256; offs++)
131131      scroll[offs] = -state->m_scrollh[offs];
132132
133   copyscrollbitmap_trans(bitmap, state->m_tmp_bitmap2, 256, scroll, 0, 0, &clip, 32);
133   copyscrollbitmap_trans(bitmap, state->m_tmp_bitmap2, 256, scroll, 0, 0, clip, 32);
134134}
135135
136136
137static void draw_fg( running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect )
137static void draw_fg( running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect )
138138{
139139   buggychl_state *state = machine.driver_data<buggychl_state>();
140140   int offs;
r13798r13799
163163}
164164
165165
166static void draw_sprites( running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect )
166static void draw_sprites( running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect )
167167{
168168   buggychl_state *state = machine.driver_data<buggychl_state>();
169169   UINT8 *spriteram = state->m_spriteram;
r13798r13799
243243   if (state->m_sky_on)
244244      draw_sky(bitmap, cliprect);
245245   else
246      bitmap->fill(0, *cliprect);
246      bitmap->fill(0, cliprect);
247247
248248   if (state->m_bg_on)
249249      draw_bg(screen.machine(), bitmap, cliprect);
src/mame/video/gotcha.c
r13798r13799
105105
106106
107107
108static void draw_sprites( running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect )
108static void draw_sprites( running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect )
109109{
110110   gotcha_state *state = machine.driver_data<gotcha_state>();
111111   UINT16 *spriteram = state->m_spriteram;
src/mame/video/starshp1.c
r13798r13799
181181}
182182
183183
184static void draw_sprites(running_machine &machine, bitmap_t* bitmap, const rectangle* cliprect)
184static void draw_sprites(running_machine &machine, bitmap_t* bitmap, const rectangle &cliprect)
185185{
186186   starshp1_state *state = machine.driver_data<starshp1_state>();
187187   int i;
r13798r13799
200200}
201201
202202
203static void draw_spaceship(running_machine &machine, bitmap_t* bitmap, const rectangle* cliprect)
203static void draw_spaceship(running_machine &machine, bitmap_t* bitmap, const rectangle &cliprect)
204204{
205205   starshp1_state *state = machine.driver_data<starshp1_state>();
206206   double scaler = -5 * log(1 - state->m_ship_size / 256.0); /* ? */
r13798r13799
314314}
315315
316316
317static int spaceship_collision(running_machine &machine, bitmap_t *bitmap, const rectangle *rect)
317static int spaceship_collision(running_machine &machine, bitmap_t *bitmap, const rectangle &rect)
318318{
319319   starshp1_state *state = machine.driver_data<starshp1_state>();
320320   int x;
321321   int y;
322322
323   for (y = rect->min_y; y <= rect->max_y; y++)
323   for (y = rect.min_y; y <= rect.max_y; y++)
324324   {
325325      const UINT16* pLine = &state->m_helper->pix16(y);
326326
327      for (x = rect->min_x; x <= rect->max_x; x++)
327      for (x = rect.min_x; x <= rect.max_x; x++)
328328         if (pLine[x] != 0)
329329            return 1;
330330   }
r13798r13799
342342}
343343
344344
345static int circle_collision(starshp1_state *state, const rectangle *rect)
345static int circle_collision(starshp1_state *state, const rectangle &rect)
346346{
347347   int center_x = get_circle_hpos(state);
348348   int center_y = get_circle_vpos(state);
349349
350350   int r = get_radius(state);
351351
352   return point_in_circle(rect->min_x, rect->min_y, center_x, center_y, r) ||
353         point_in_circle(rect->min_x, rect->max_y, center_x, center_y, r) ||
354         point_in_circle(rect->max_x, rect->min_y, center_x, center_y, r) ||
355         point_in_circle(rect->max_x, rect->max_y, center_x, center_y, r);
352   return point_in_circle(rect.min_x, rect.min_y, center_x, center_y, r) ||
353         point_in_circle(rect.min_x, rect.max_y, center_x, center_y, r) ||
354         point_in_circle(rect.max_x, rect.min_y, center_x, center_y, r) ||
355         point_in_circle(rect.max_x, rect.max_y, center_x, center_y, r);
356356}
357357
358358
r13798r13799
361361   starshp1_state *state = screen.machine().driver_data<starshp1_state>();
362362   set_pens(state, screen.machine().colortable);
363363
364   bitmap->fill(0, *cliprect);
364   bitmap->fill(0, cliprect);
365365
366366   if (state->m_starfield_kill == 0)
367367      draw_starfield(state, bitmap);
r13798r13799
409409   state->m_helper->fill(0, visarea);
410410
411411   if (state->m_attract == 0)
412      draw_spaceship(screen.machine(), state->m_helper, &visarea);
412      draw_spaceship(screen.machine(), state->m_helper, visarea);
413413
414   if (circle_collision(state, &visarea))
414   if (circle_collision(state, visarea))
415415      state->m_collision_latch |= 1;
416416
417   if (circle_collision(state, &rect))
417   if (circle_collision(state, rect))
418418      state->m_collision_latch |= 2;
419419
420   if (spaceship_collision(screen.machine(), state->m_helper, &rect))
420   if (spaceship_collision(screen.machine(), state->m_helper, rect))
421421      state->m_collision_latch |= 4;
422422
423   if (spaceship_collision(screen.machine(), state->m_helper, &visarea))
423   if (spaceship_collision(screen.machine(), state->m_helper, visarea))
424424      state->m_collision_latch |= 8;
425425}
src/mame/video/pandoras.c
r13798r13799
156156
157157***************************************************************************/
158158
159static void draw_sprites( running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect, UINT8* sr )
159static void draw_sprites( running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect, UINT8* sr )
160160{
161161   int offs;
162162
src/mame/video/bigstrkb.c
r13798r13799
66
77/* Sprites */
88
9static void draw_sprites(running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect )
9static void draw_sprites(running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect )
1010{
1111   /*- SPR RAM Format -**
1212
r13798r13799
132132{
133133   bigstrkb_state *state = screen.machine().driver_data<bigstrkb_state>();
134134
135//  bitmap->fill(get_black_pen(screen.machine()), *cliprect);
135//  bitmap->fill(get_black_pen(screen.machine()), cliprect);
136136
137137   tilemap_set_scrollx(state->m_tilemap2,0, state->m_vidreg1[0]+(256-14));
138138   tilemap_set_scrolly(state->m_tilemap2,0, state->m_vidreg2[0]);
src/mame/video/taito_f2.c
r13798r13799
286286   state->m_spritebank_buffered[7] = state->m_spritebank_buffered[6] + 0x400;
287287}
288288
289static void taito_f2_tc360_spritemixdraw( running_machine &machine, bitmap_t *dest_bmp, const rectangle *clip, const gfx_element *gfx,
289static void taito_f2_tc360_spritemixdraw( running_machine &machine, bitmap_t *dest_bmp, const rectangle &clip, const gfx_element *gfx,
290290      UINT32 code, UINT32 color, int flipx, int flipy, int sx, int sy, int scalex, int scaley )
291291{
292292   taitof2_state *state = machine.driver_data<taitof2_state>();
r13798r13799
331331         y_index = 0;
332332      }
333333
334      if (clip)
335      {
336         if (sx < clip->min_x)
337         { /* clip left */
338            int pixels = clip->min_x - sx;
339            sx += pixels;
340            x_index_base += pixels * dx;
341         }
342         if (sy < clip->min_y)
343         { /* clip top */
344            int pixels = clip->min_y - sy;
345            sy += pixels;
346            y_index += pixels * dy;
347         }
348         /* NS 980211 - fixed incorrect clipping */
349         if (ex > clip->max_x + 1)
350         { /* clip right */
351            int pixels = ex-clip->max_x - 1;
352            ex -= pixels;
353         }
354         if (ey > clip->max_y + 1)
355         { /* clip bottom */
356            int pixels = ey-clip->max_y - 1;
357            ey -= pixels;
358         }
334      if (sx < clip.min_x)
335      { /* clip left */
336         int pixels = clip.min_x - sx;
337         sx += pixels;
338         x_index_base += pixels * dx;
359339      }
340      if (sy < clip.min_y)
341      { /* clip top */
342         int pixels = clip.min_y - sy;
343         sy += pixels;
344         y_index += pixels * dy;
345      }
346      /* NS 980211 - fixed incorrect clipping */
347      if (ex > clip.max_x + 1)
348      { /* clip right */
349         int pixels = ex-clip.max_x - 1;
350         ex -= pixels;
351      }
352      if (ey > clip.max_y + 1)
353      { /* clip bottom */
354         int pixels = ey-clip.max_y - 1;
355         ey -= pixels;
356      }
360357
361358      if (ex > sx)
362359      {
r13798r13799
435432   }
436433}
437434
438static void draw_sprites( running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect, int *primasks, int uses_tc360_mixer )
435static void draw_sprites( running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect, int *primasks, int uses_tc360_mixer )
439436{
440437   /*
441438        Sprite format:
r13798r13799
985982
986983   /* SSI only uses sprites, the tilemap registers are not even initialized.
987984       (they are in Majestic 12, but the tilemaps are not used anyway) */
988   screen.machine().priority_bitmap->fill(0, *cliprect);
989   bitmap->fill(0, *cliprect);
985   screen.machine().priority_bitmap->fill(0, cliprect);
986   bitmap->fill(0, cliprect);
990987   draw_sprites(screen.machine(), bitmap, cliprect, NULL, 0);
991988   return 0;
992989}
r13798r13799
1000997
1001998   tc0100scn_tilemap_update(state->m_tc0100scn);
1002999
1003   screen.machine().priority_bitmap->fill(0, *cliprect);
1004   bitmap->fill(0, *cliprect);   /* wrong color? */
1000   screen.machine().priority_bitmap->fill(0, cliprect);
1001   bitmap->fill(0, cliprect);   /* wrong color? */
10051002   draw_sprites(screen.machine(), bitmap, cliprect, NULL, 0);
10061003   tc0100scn_tilemap_draw(state->m_tc0100scn, bitmap, cliprect, tc0100scn_bottomlayer(state->m_tc0100scn), 0, 0);
10071004   tc0100scn_tilemap_draw(state->m_tc0100scn, bitmap, cliprect, tc0100scn_bottomlayer(state->m_tc0100scn) ^ 1, 0, 0);
r13798r13799
10181015
10191016   tc0100scn_tilemap_update(state->m_tc0100scn);
10201017
1021   screen.machine().priority_bitmap->fill(0, *cliprect);
1022   bitmap->fill(0, *cliprect);   /* wrong color? */
1018   screen.machine().priority_bitmap->fill(0, cliprect);
1019   bitmap->fill(0, cliprect);   /* wrong color? */
10231020   tc0100scn_tilemap_draw(state->m_tc0100scn, bitmap, cliprect, tc0100scn_bottomlayer(state->m_tc0100scn), 0, 0);
10241021   tc0100scn_tilemap_draw(state->m_tc0100scn, bitmap, cliprect, tc0100scn_bottomlayer(state->m_tc0100scn) ^ 1, 0, 0);
10251022   draw_sprites(screen.machine(), bitmap, cliprect, NULL, 0);
r13798r13799
10511048
10521049   state->m_spriteblendmode = tc0360pri_r(state->m_tc0360pri, 0) & 0xc0;
10531050
1054   screen.machine().priority_bitmap->fill(0, *cliprect);
1055   bitmap->fill(0, *cliprect);   /* wrong color? */
1051   screen.machine().priority_bitmap->fill(0, cliprect);
1052   bitmap->fill(0, cliprect);   /* wrong color? */
10561053
10571054   tc0100scn_tilemap_draw(state->m_tc0100scn, bitmap, cliprect, layer[0], 0, 1);
10581055   tc0100scn_tilemap_draw(state->m_tc0100scn, bitmap, cliprect, layer[1], 0, 2);
r13798r13799
10641061
10651062
10661063
1067static void draw_roz_layer( running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect, UINT32 priority)
1064static void draw_roz_layer( running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect, UINT32 priority)
10681065{
10691066   taitof2_state *state = machine.driver_data<taitof2_state>();
10701067
r13798r13799
11131110
11141111   state->m_spriteblendmode = tc0360pri_r(state->m_tc0360pri, 0) & 0xc0;
11151112
1116   screen.machine().priority_bitmap->fill(0, *cliprect);
1117   bitmap->fill(0, *cliprect);   /* wrong color? */
1113   screen.machine().priority_bitmap->fill(0, cliprect);
1114   bitmap->fill(0, cliprect);   /* wrong color? */
11181115
11191116   drawn = 0;
11201117   for (i = 0; i < 16; i++)
r13798r13799
11761173   spritepri[2] = tc0360pri_r(state->m_tc0360pri, 7) & 0x0f;
11771174   spritepri[3] = tc0360pri_r(state->m_tc0360pri, 7) >> 4;
11781175
1179   screen.machine().priority_bitmap->fill(0, *cliprect);
1180   bitmap->fill(0, *cliprect);   /* wrong color? */
1176   screen.machine().priority_bitmap->fill(0, cliprect);
1177   bitmap->fill(0, cliprect);   /* wrong color? */
11811178
11821179   /*
11831180    TODO: This isn't the correct way to handle the priority. At the moment of
r13798r13799
13171314
13181315   state->m_spriteblendmode = tc0360pri_r(state->m_tc0360pri, 0) & 0xc0;
13191316
1320   screen.machine().priority_bitmap->fill(0, *cliprect);
1321   bitmap->fill(0, *cliprect);
1317   screen.machine().priority_bitmap->fill(0, cliprect);
1318   bitmap->fill(0, cliprect);
13221319
13231320   tc0480scp_tilemap_draw(state->m_tc0480scp, bitmap, cliprect, layer[0], 0 ,1);
13241321   tc0480scp_tilemap_draw(state->m_tc0480scp, bitmap, cliprect, layer[1], 0, 2);
r13798r13799
13651362   spritepri[2] = tc0360pri_r(state->m_tc0360pri, 7) & 0x0f;
13661363   spritepri[3] = tc0360pri_r(state->m_tc0360pri, 7) >> 4;
13671364
1368   screen.machine().priority_bitmap->fill(0, *cliprect);
1369   bitmap->fill(0, *cliprect);
1365   screen.machine().priority_bitmap->fill(0, cliprect);
1366   bitmap->fill(0, cliprect);
13701367
13711368   tc0480scp_tilemap_draw(state->m_tc0480scp, bitmap, cliprect, layer[0], 0 ,1);
13721369   tc0480scp_tilemap_draw(state->m_tc0480scp, bitmap, cliprect, layer[1], 0, 2);
src/mame/video/gberet.c
r13798r13799
131131   tilemap_set_scroll_rows(state->m_bg_tilemap, 32);
132132}
133133
134static void gberet_draw_sprites( running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect )
134static void gberet_draw_sprites( running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect )
135135{
136136   gberet_state *state = machine.driver_data<gberet_state>();
137137   int offs;
r13798r13799
192192      tilemap_set_scrollx(state->m_bg_tilemap, offset, scroll + 64 - 8);
193193}
194194
195static void gberetb_draw_sprites( running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect )
195static void gberetb_draw_sprites( running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect )
196196{
197197   gberet_state *state = machine.driver_data<gberet_state>();
198198   UINT8 *spriteram = state->m_spriteram;
src/mame/video/stfight.c
r13798r13799
244244
245245***************************************************************************/
246246
247static void draw_sprites(running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect)
247static void draw_sprites(running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect)
248248{
249249   stfight_state *state = machine.driver_data<stfight_state>();
250250   int offs,sx,sy;
r13798r13799
297297   stfight_state *state = screen.machine().driver_data<stfight_state>();
298298   set_pens(screen.machine());
299299
300   screen.machine().priority_bitmap->fill(0, *cliprect);
300   screen.machine().priority_bitmap->fill(0, cliprect);
301301
302   bitmap->fill(0, *cliprect);   /* in case state->m_bg_tilemap is disabled */
302   bitmap->fill(0, cliprect);   /* in case state->m_bg_tilemap is disabled */
303303   tilemap_draw(bitmap,cliprect,state->m_bg_tilemap,0,0);
304304   tilemap_draw(bitmap,cliprect,state->m_fg_tilemap,0,1);
305305
src/mame/video/gottlieb.c
r13798r13799
213213 *
214214 *************************************/
215215
216static void draw_sprites(running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect)
216static void draw_sprites(running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect)
217217{
218218   gottlieb_state *state = machine.driver_data<gottlieb_state>();
219219   UINT8 *spriteram = state->m_spriteram;
220   rectangle clip = *cliprect;
220   rectangle clip = cliprect;
221221    int offs;
222222
223223    /* this is a temporary guess until the sprite hardware is better understood */
r13798r13799
235235      if (flip_screen_x_get(machine)) sx = 233 - sx;
236236      if (flip_screen_y_get(machine)) sy = 244 - sy;
237237
238      drawgfx_transpen(bitmap, &clip,
238      drawgfx_transpen(bitmap, clip,
239239         machine.gfx[2],
240240         code, 0,
241241         flip_screen_x_get(machine), flip_screen_y_get(machine),
r13798r13799
258258   if (!state->m_background_priority)
259259      tilemap_draw(bitmap, cliprect, state->m_bg_tilemap, TILEMAP_DRAW_OPAQUE, 0);
260260   else
261      bitmap->fill(0, *cliprect);
261      bitmap->fill(0, cliprect);
262262
263263   /* draw the sprites */
264264   draw_sprites(screen.machine(), bitmap, cliprect);
src/mame/video/ddragon.c
r13798r13799
154154               cliprect,gfx, \
155155               (which + order),color,flipx,flipy,sx,sy,0);
156156
157static void draw_sprites( running_machine& machine, bitmap_t *bitmap,const rectangle *cliprect )
157static void draw_sprites( running_machine& machine, bitmap_t *bitmap,const rectangle &cliprect )
158158{
159159   ddragon_state *state = machine.driver_data<ddragon_state>();
160160   const gfx_element *gfx = machine.gfx[1];
src/mame/video/asterix.c
r13798r13799
9696
9797   konami_sortlayers3(layer, state->m_layerpri);
9898
99   screen.machine().priority_bitmap->fill(0, *cliprect);
100   bitmap->fill(0, *cliprect);
99   screen.machine().priority_bitmap->fill(0, cliprect);
100   bitmap->fill(0, cliprect);
101101
102102   k056832_tilemap_draw(state->m_k056832, bitmap, cliprect, layer[0], K056832_DRAW_FLAG_MIRROR, 1);
103103   k056832_tilemap_draw(state->m_k056832, bitmap, cliprect, layer[1], K056832_DRAW_FLAG_MIRROR, 2);
src/mame/video/tubep.c
r13798r13799
596596   UINT8 *text_gfx_base = screen.machine().region("gfx1")->base();
597597   UINT8 *romBxx = screen.machine().region("user1")->base() + 0x2000*state->m_background_romsel;
598598
599   /* logerror(" update: from DISP=%i y_min=%3i y_max=%3i\n", DISP_, cliprect->min_y, cliprect->max_y+1); */
599   /* logerror(" update: from DISP=%i y_min=%3i y_max=%3i\n", DISP_, cliprect.min_y, cliprect.max_y+1); */
600600
601   for (v = cliprect->min_y; v <= cliprect->max_y; v++)   /* only for current scanline */
601   for (v = cliprect.min_y; v <= cliprect.max_y; v++)   /* only for current scanline */
602602   {
603603      UINT32 h;
604604      UINT32 sp_data0=0,sp_data1=0,sp_data2=0;
r13798r13799
758758   /* especially read from ROM19C can be done once per 8 pixels*/
759759   /* and the data could be bitswapped beforehand */
760760
761   for (v = cliprect->min_y; v <= cliprect->max_y; v++)   /* only for current scanline */
761   for (v = cliprect.min_y; v <= cliprect.max_y; v++)   /* only for current scanline */
762762   {
763763      UINT32 h;
764764      UINT32 sp_data0=0,sp_data1=0,sp_data2=0;
src/mame/video/homedata.c
r13798r13799
845845   /* blank screen */
846846   if (state->m_vreg[0x3] == 0xc1 && state->m_vreg[0x4] == 0xc0 && state->m_vreg[0x5] == 0xff)
847847   {
848      bitmap->fill(get_black_pen(screen.machine()), *cliprect);
848      bitmap->fill(get_black_pen(screen.machine()), cliprect);
849849      return 0;
850850   }
851851
r13798r13799
908908   }
909909
910910
911   bitmap->fill(get_black_pen(screen.machine()), *cliprect);
911   bitmap->fill(get_black_pen(screen.machine()), cliprect);
912912
913913   pri = (state->m_bank & 0x70) >> 4;
914914   for (i = 0; i < 4; i++)
r13798r13799
955955   }
956956
957957
958   bitmap->fill(get_black_pen(screen.machine()), *cliprect);
958   bitmap->fill(get_black_pen(screen.machine()), cliprect);
959959
960960   pri = (state->m_blitter_bank & 0x70) >> 4;
961961   for (i = 0; i < 4; i++)
r13798r13799
973973   /* blank screen */
974974   if (state->m_vreg[0x3] == 0xc1 && state->m_vreg[0x4] == 0xc0 && state->m_vreg[0x5] == 0xff)
975975   {
976      bitmap->fill(get_black_pen(screen.machine()), *cliprect);
976      bitmap->fill(get_black_pen(screen.machine()), cliprect);
977977      return 0;
978978   }
979979
src/mame/video/exidy.c
r13798r13799
215215}
216216
217217
218static void draw_sprites(running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect)
218static void draw_sprites(running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect)
219219{
220220   exidy_state *state = machine.driver_data<exidy_state>();
221221   /* draw sprite 2 first */
r13798r13799
296296   {
297297      org_1_x = 236 - *state->m_sprite1_xpos - 4;
298298      org_1_y = 244 - *state->m_sprite1_ypos - 4;
299      drawgfx_transpen(state->m_motion_object_1_vid, &clip, machine.gfx[0],
299      drawgfx_transpen(state->m_motion_object_1_vid, clip, machine.gfx[0],
300300            (*state->m_spriteno & 0x0f) + 16 * sprite_set_1, 0,
301301            0, 0, 0, 0, 0);
302302   }
r13798r13799
305305   state->m_motion_object_2_vid->fill(0xff, clip);
306306   org_2_x = 236 - *state->m_sprite2_xpos - 4;
307307   org_2_y = 244 - *state->m_sprite2_ypos - 4;
308   drawgfx_transpen(state->m_motion_object_2_vid, &clip, machine.gfx[0],
308   drawgfx_transpen(state->m_motion_object_2_vid, clip, machine.gfx[0],
309309         ((*state->m_spriteno >> 4) & 0x0f) + 32 + 16 * sprite_set_2, 0,
310310         0, 0, 0, 0, 0);
311311
r13798r13799
315315   {
316316      sx = org_2_x - org_1_x;
317317      sy = org_2_y - org_1_y;
318      drawgfx_transpen(state->m_motion_object_2_clip, &clip, machine.gfx[0],
318      drawgfx_transpen(state->m_motion_object_2_clip, clip, machine.gfx[0],
319319            ((*state->m_spriteno >> 4) & 0x0f) + 32 + 16 * sprite_set_2, 0,
320320            0, 0, sx, sy, 0);
321321   }
r13798r13799
370370   copybitmap(bitmap, state->m_background_bitmap, 0, 0, 0, 0, cliprect);
371371
372372   /* draw the sprites */
373   draw_sprites(screen.machine(), bitmap, NULL);
373   draw_sprites(screen.machine(), bitmap, cliprect);
374374
375375   /* check for collision, this will set the appropriate bits in collision_mask */
376376   check_collision(screen.machine());
src/mame/video/xxmissio.c
r13798r13799
8585}
8686
8787
88static void draw_sprites(bitmap_t *bitmap, const rectangle *cliprect, const gfx_element *gfx)
88static void draw_sprites(bitmap_t *bitmap, const rectangle &cliprect, const gfx_element *gfx)
8989{
9090   xxmissio_state *state = gfx->machine().driver_data<xxmissio_state>();
9191   int offs;
src/mame/video/mugsmash.c
r13798r13799
33#include "emu.h"
44#include "includes/mugsmash.h"
55
6static void draw_sprites(running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect )
6static void draw_sprites(running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect )
77{
88
99   /* Each Sprite takes 16 bytes, 5 used? */
src/mame/video/pcktgal.c
r13798r13799
3030   }
3131}
3232
33static void draw_sprites(running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect)
33static void draw_sprites(running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect)
3434{
3535   pcktgal_state *state = machine.driver_data<pcktgal_state>();
3636   UINT8 *spriteram = state->m_spriteram;
src/mame/video/hyhoo.c
r13798r13799
237237   if (state->m_dispflag)
238238      copybitmap(bitmap, state->m_tmpbitmap, state->m_flipscreen, state->m_flipscreen, 0, 0, cliprect);
239239   else
240      bitmap->fill(RGB_BLACK, *cliprect);
240      bitmap->fill(RGB_BLACK, cliprect);
241241
242242   return 0;
243243}
src/mame/video/hng64.c
r13798r13799
9292while (0)                                                         \
9393
9494
95static void pdrawgfx_transpen_additive(bitmap_t *dest, const rectangle *cliprect, const gfx_element *gfx,
95static void pdrawgfx_transpen_additive(bitmap_t *dest, const rectangle &cliprect, const gfx_element *gfx,
9696      UINT32 code, UINT32 color, int flipx, int flipy, INT32 destx, INT32 desty,
9797      bitmap_t *priority, UINT32 pmask, UINT32 transpen)
9898{
r13798r13799
125125}
126126
127127
128static void pdrawgfxzoom_transpen_additive(bitmap_t *dest, const rectangle *cliprect, const gfx_element *gfx,
128static void pdrawgfxzoom_transpen_additive(bitmap_t *dest, const rectangle &cliprect, const gfx_element *gfx,
129129      UINT32 code, UINT32 color, int flipx, int flipy, INT32 destx, INT32 desty,
130130      UINT32 scalex, UINT32 scaley, bitmap_t *priority, UINT32 pmask,
131131      UINT32 transpen)
r13798r13799
207207 * 0x0e0 in Samurai Shodown/Xrally games, 0x1c0 in all the others, zooming factor?
208208 */
209209
210static void draw_sprites(running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect)
210static void draw_sprites(running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect)
211211{
212212   hng64_state *state = machine.driver_data<hng64_state>();
213213   const gfx_element *gfx;
r13798r13799
431431 */
432432
433433/* this is broken for the 'How to Play' screen in Buriki after attract, disabled for now */
434static void transition_control(running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect)
434static void transition_control(running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect)
435435{
436436   hng64_state *state = machine.driver_data<hng64_state>();
437437   UINT32 *hng64_tcram = state->m_tcram;
r13798r13799
455455      brigG = (INT32)((hng64_tcram[0x0000000a] >> 8)  & 0xff);
456456      brigB = (INT32)((hng64_tcram[0x0000000a] >> 16) & 0xff);
457457
458      for (i = cliprect->min_x; i < cliprect->max_x; i++)
458      for (i = cliprect.min_x; i < cliprect.max_x; i++)
459459      {
460         for (j = cliprect->min_y; j < cliprect->max_y; j++)
460         for (j = cliprect.min_y; j < cliprect.max_y; j++)
461461         {
462462            UINT32* thePixel = &bitmap->pix32(j, i);
463463
r13798r13799
705705
706706
707707
708static void hng64_configure_blit_parameters(blit_parameters *blit, tilemap_t *tmap, bitmap_t *dest, const rectangle *cliprect, UINT32 flags, UINT8 priority, UINT8 priority_mask, hng64trans_t drawformat)
708static void hng64_configure_blit_parameters(blit_parameters *blit, tilemap_t *tmap, bitmap_t *dest, const rectangle &cliprect, UINT32 flags, UINT8 priority, UINT8 priority_mask, hng64trans_t drawformat)
709709{
710710   /* start with nothing */
711711   memset(blit, 0, sizeof(*blit));
r13798r13799
714714   blit->bitmap = dest;
715715
716716   /* if we have a cliprect, copy */
717   if (cliprect != NULL)
718      blit->cliprect = *cliprect;
717   blit->cliprect = cliprect;
719718
720   /* otherwise, make one up */
721   else
722      blit->cliprect = dest->cliprect();
723
724719   /* set the priority code and alpha */
725720   //blit->tilemap_priority_code = priority | (priority_mask << 8) | (tmap->palette_offset << 16); // fixit
726721   blit->alpha = (flags & TILEMAP_DRAW_ALPHA_FLAG) ? (flags >> 24) : 0xff;
r13798r13799
964959
965960
966961
967static void hng64_tilemap_draw_roz_primask(running_machine& machine, bitmap_t *dest, const rectangle *cliprect, tilemap_t *tmap,
962static void hng64_tilemap_draw_roz_primask(running_machine& machine, bitmap_t *dest, const rectangle &cliprect, tilemap_t *tmap,
968963      UINT32 startx, UINT32 starty, int incxx, int incxy, int incyx, int incyy,
969964      int wraparound, UINT32 flags, UINT8 priority, UINT8 priority_mask, hng64trans_t drawformat)
970965{
r13798r13799
992987}
993988
994989
995INLINE void hng64_tilemap_draw_roz(running_machine& machine, bitmap_t *dest, const rectangle *cliprect, tilemap_t *tmap,
990INLINE void hng64_tilemap_draw_roz(running_machine& machine, bitmap_t *dest, const rectangle &cliprect, tilemap_t *tmap,
996991      UINT32 startx, UINT32 starty, int incxx, int incxy, int incyx, int incyy,
997992      int wraparound, UINT32 flags, UINT8 priority, hng64trans_t drawformat)
998993{
r13798r13799
1001996
1002997
1003998
1004static void hng64_drawtilemap(running_machine& machine, bitmap_t *bitmap, const rectangle *cliprect, int tm )
999static void hng64_drawtilemap(running_machine& machine, bitmap_t *bitmap, const rectangle &cliprect, int tm )
10051000{
10061001   hng64_state *state = machine.driver_data<hng64_state>();
10071002   UINT32 *hng64_videoregs = state->m_videoregs;
r13798r13799
11691164            xinc = (xmiddle - xtopleft) / 512;
11701165            yinc = (ymiddle - ytopleft) / 512;
11711166
1172            hng64_tilemap_draw_roz(machine, bitmap,&clip,tilemap,xtopleft,ytopleft,
1167            hng64_tilemap_draw_roz(machine, bitmap,clip,tilemap,xtopleft,ytopleft,
11731168                  xinc<<1,0,0,yinc<<1,
11741169                  1,
11751170                  0,0, debug_blend_enabled?HNG64_TILEMAP_ADDITIVE:HNG64_TILEMAP_NORMAL);
r13798r13799
14641459   }
14651460#endif
14661461
1467   bitmap->fill(hng64_tcram[0x50/4] & 0x10000 ? get_black_pen(screen.machine()) : screen.machine().pens[0], *cliprect); //FIXME: Is the register correct? check with HW tests
1468   screen.machine().priority_bitmap->fill(0x00, *cliprect);
1462   bitmap->fill(hng64_tcram[0x50/4] & 0x10000 ? get_black_pen(screen.machine()) : screen.machine().pens[0], cliprect); //FIXME: Is the register correct? check with HW tests
1463   screen.machine().priority_bitmap->fill(0x00, cliprect);
14691464
14701465   if (state->m_screen_dis)
14711466      return 0;
r13798r13799
15451540      int x, y;
15461541
15471542      // Blit the color buffer into the primary bitmap
1548      for (y = cliprect->min_y; y <= cliprect->max_y; y++)
1543      for (y = cliprect.min_y; y <= cliprect.max_y; y++)
15491544      {
1550         UINT32 *src = &state->m_colorBuffer3d[y * (cliprect->max_x-cliprect->min_x)];
1551         UINT32 *dst = &bitmap->pix32(y, cliprect->min_x);
1545         UINT32 *src = &state->m_colorBuffer3d[y * (cliprect.max_x-cliprect.min_x)];
1546         UINT32 *dst = &bitmap->pix32(y, cliprect.min_x);
15521547
1553         for (x = cliprect->min_x; x <= cliprect->max_x; x++)
1548         for (x = cliprect.min_x; x <= cliprect.max_x; x++)
15541549         {
15551550            if(*src & 0xff000000)
15561551               *dst = *src;
src/mame/video/solomon.c
r13798r13799
7676   tilemap_set_transparent_pen(state->m_fg_tilemap, 0);
7777}
7878
79static void draw_sprites(running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect )
79static void draw_sprites(running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect )
8080{
8181   solomon_state *state = machine.driver_data<solomon_state>();
8282   UINT8 *spriteram = state->m_spriteram;
src/mame/video/macrossp.c
r13798r13799
173173
174174
175175
176static void draw_sprites(running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect, int priority )
176static void draw_sprites(running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect, int priority )
177177{
178178   macrossp_state *state = machine.driver_data<macrossp_state>();
179179   const gfx_element *gfx = machine.gfx[0];
r13798r13799
320320}
321321
322322
323static void draw_layer( running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect, int layer )
323static void draw_layer( running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect, int layer )
324324{
325325   macrossp_state *state = machine.driver_data<macrossp_state>();
326326   tilemap_t *tm;
r13798r13799
392392   macrossp_state *state = screen.machine().driver_data<macrossp_state>();
393393   int layers[3],layerpri[3];
394394
395   bitmap->fill(get_black_pen(screen.machine()), *cliprect);
395   bitmap->fill(get_black_pen(screen.machine()), cliprect);
396396
397397   layers[0] = 0;
398398   layerpri[0] = (state->m_scra_videoregs[0] & 0x0000c000) >> 14;
src/mame/video/gladiatr.c
r13798r13799
200200
201201***************************************************************************/
202202
203static void draw_sprites(running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect)
203static void draw_sprites(running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect)
204204{
205205   gladiatr_state *state = machine.driver_data<gladiatr_state>();
206206   int offs;
r13798r13799
260260   /* the fg layer just selects the upper palette bank on underlying pixels */
261261   {
262262      bitmap_t *flagsbitmap;
263      int sx = cliprect->min_x;
264      int sy = cliprect->min_y;
263      int sx = cliprect.min_x;
264      int sy = cliprect.min_y;
265265
266266      tilemap_get_pixmap( state->m_fg_tilemap );
267267      flagsbitmap = tilemap_get_flagsmap( state->m_fg_tilemap );
268268
269      while( sy <= cliprect->max_y )
269      while( sy <= cliprect.max_y )
270270      {
271271         int x = sx;
272272         int y = (sy + state->m_fg_scrolly) & 0x1ff;
273273
274274         UINT16 *dest = &bitmap->pix16(sy, sx);
275         while( x <= cliprect->max_x )
275         while( x <= cliprect.max_x )
276276         {
277277            if( flagsbitmap->pix8(y, x)&TILEMAP_PIXEL_LAYER0 )
278278            {
r13798r13799
308308      tilemap_draw(bitmap,cliprect,state->m_fg_tilemap,0,0);
309309   }
310310   else
311      bitmap->fill(get_black_pen(screen.machine()), *cliprect );
311      bitmap->fill(get_black_pen(screen.machine()), cliprect );
312312   return 0;
313313}
src/mame/video/moo.c
r13798r13799
112112   k054338_update_all_shadows(state->m_k054338, 0);
113113   k054338_fill_backcolor(state->m_k054338, bitmap, 0);
114114
115   screen.machine().priority_bitmap->fill(0, *cliprect);
115   screen.machine().priority_bitmap->fill(0, cliprect);
116116
117117   if (state->m_layerpri[0] < k053251_get_priority(state->m_k053251, K053251_CI1))   /* bucky hides back layer behind background */
118118      k056832_tilemap_draw(state->m_k056832, bitmap, cliprect, layers[0], 0, 1);
src/mame/video/goindol.c
r13798r13799
8585
8686***************************************************************************/
8787
88static void draw_sprites( running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect, int gfxbank, UINT8 *sprite_ram )
88static void draw_sprites( running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect, int gfxbank, UINT8 *sprite_ram )
8989{
9090   goindol_state *state = machine.driver_data<goindol_state>();
9191   int offs, sx, sy, tile, palette;
src/mame/video/taito_l.c
r13798r13799
243243                 plgirs2 bullets and raimais big bosses.
244244*/
245245
246static void draw_sprites( running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect )
246static void draw_sprites( running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect )
247247{
248248   taitol_state *state = machine.driver_data<taitol_state>();
249249   int offs;
r13798r13799
307307
308308   if (state->m_cur_ctrl & 0x20)   /* display enable */
309309   {
310      screen.machine().priority_bitmap->fill(0, *cliprect);
310      screen.machine().priority_bitmap->fill(0, cliprect);
311311
312312      tilemap_draw(bitmap, cliprect, state->m_bg19_tilemap, 0, 0);
313313
r13798r13799
321321      tilemap_draw(bitmap, cliprect, state->m_ch1a_tilemap, 0, 0);
322322   }
323323   else
324      bitmap->fill(screen.machine().pens[0], *cliprect);
324      bitmap->fill(screen.machine().pens[0], cliprect);
325325   return 0;
326326}
327327
src/mame/video/gyruss.c
r13798r13799
129129}
130130
131131
132static void draw_sprites( running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect, gfx_element **gfx )
132static void draw_sprites( running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect, gfx_element **gfx )
133133{
134134   gyruss_state *state = machine.driver_data<gyruss_state>();
135135   int offs;
r13798r13799
154154{
155155   gyruss_state *state = screen.machine().driver_data<gyruss_state>();
156156
157   if (cliprect->min_y == screen.visible_area().min_y)
157   if (cliprect.min_y == screen.visible_area().min_y)
158158   {
159159      tilemap_mark_all_tiles_dirty_all(screen.machine());
160160      tilemap_set_flip_all(screen.machine(), (*state->m_flipscreen & 0x01) ? (TILEMAP_FLIPX | TILEMAP_FLIPY) : 0);
src/mame/video/groundfx.c
r13798r13799
6363
6464***************************************************************/
6565
66static void draw_sprites(running_machine &machine, bitmap_t *bitmap,const rectangle *cliprect,int do_hack,int x_offs,int y_offs)
66static void draw_sprites(running_machine &machine, bitmap_t *bitmap,const rectangle &cliprect,int do_hack,int x_offs,int y_offs)
6767{
6868   groundfx_state *state = machine.driver_data<groundfx_state>();
6969   UINT32 *spriteram32 = state->m_spriteram;
r13798r13799
183183      if (do_hack && sprite_ptr->pri==1 && sprite_ptr->y<100)
184184         clipper=&state->m_hack_cliprect;
185185      else
186         clipper=cliprect;
186         clipper=&cliprect;
187187
188      pdrawgfxzoom_transpen(bitmap,clipper,machine.gfx[sprite_ptr->gfx],
188      pdrawgfxzoom_transpen(bitmap,*clipper,machine.gfx[sprite_ptr->gfx],
189189            sprite_ptr->code,
190190            sprite_ptr->color,
191191            sprite_ptr->flipx,sprite_ptr->flipy,
r13798r13799
223223   pivlayer[1] = pivlayer[0]^1;
224224   pivlayer[2] = 2;
225225
226   screen.machine().priority_bitmap->fill(0, *cliprect);
227   bitmap->fill(0, *cliprect);   /* wrong color? */
226   screen.machine().priority_bitmap->fill(0, cliprect);
227   bitmap->fill(0, cliprect);   /* wrong color? */
228228
229229   tc0100scn_tilemap_draw(tc0100scn, bitmap, cliprect, pivlayer[0], TILEMAP_DRAW_OPAQUE, 0);
230230   tc0100scn_tilemap_draw(tc0100scn, bitmap, cliprect, pivlayer[1], 0, 0);
r13798r13799
255255      //tc0100scn_tilemap_draw(tc0100scn, bitmap, cliprect, 0, pivlayer[2], 0, 0);
256256
257257      if (tc0480scp_long_r(tc0480scp, 0x20 / 4, 0xffffffff) != 0x240866) /* Stupid hack for start of race */
258         tc0480scp_tilemap_draw(tc0480scp, bitmap, &state->m_hack_cliprect, layer[0], 0, 0);
258         tc0480scp_tilemap_draw(tc0480scp, bitmap, state->m_hack_cliprect, layer[0], 0, 0);
259259      draw_sprites(screen.machine(), bitmap, cliprect, 1, 44, -574);
260260   }
261261   else
src/mame/video/fastlane.c
r13798r13799
161161   rectangle finalclip0 = state->m_clip0, finalclip1 = state->m_clip1;
162162   int i, xoffs;
163163
164   finalclip0 &= *cliprect;
165   finalclip1 &= *cliprect;
164   finalclip0 &= cliprect;
165   finalclip1 &= cliprect;
166166
167167   set_pens(screen.machine());
168168
r13798r13799
173173
174174   tilemap_set_scrolly(state->m_layer0, 0, k007121_ctrlram_r(state->m_k007121, 2));
175175
176   tilemap_draw(bitmap, &finalclip0, state->m_layer0, 0, 0);
176   tilemap_draw(bitmap, finalclip0, state->m_layer0, 0, 0);
177177   k007121_sprites_draw(state->m_k007121, bitmap, cliprect, screen.machine().gfx[0], screen.machine().colortable, state->m_spriteram, 0, 40, 0, (UINT32)-1);
178   tilemap_draw(bitmap, &finalclip1, state->m_layer1, 0, 0);
178   tilemap_draw(bitmap, finalclip1, state->m_layer1, 0, 0);
179179   return 0;
180180}
src/mame/video/kangaroo.c
r13798r13799
157157      pens[x] = MAKE_RGB(pal1bit(x >> 2), pal1bit(x >> 1), pal1bit(x >> 0));
158158
159159   /* iterate over pixels */
160   for (y = cliprect->min_y; y <= cliprect->max_y; y++)
160   for (y = cliprect.min_y; y <= cliprect.max_y; y++)
161161   {
162162      UINT32 *dest = &bitmap->pix32(y);
163163
164      for (x = cliprect->min_x; x <= cliprect->max_x; x += 2)
164      for (x = cliprect.min_x; x <= cliprect.max_x; x += 2)
165165      {
166166         UINT8 effxa = scrollx + ((x / 2) ^ xora);
167167         UINT8 effya = scrolly + (y ^ xora);
src/mame/video/cabal.c
r13798r13799
105105
106106********************************************************************/
107107
108static void draw_sprites(running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect)
108static void draw_sprites(running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect)
109109{
110110   cabal_state *state = machine.driver_data<cabal_state>();
111111   int offs,data0,data1,data2;
src/mame/video/suprloco.c
r13798r13799
161161
162162
163163
164INLINE void draw_pixel(bitmap_t *bitmap,const rectangle *cliprect,int x,int y,int color,int flip)
164INLINE void draw_pixel(bitmap_t *bitmap,const rectangle &cliprect,int x,int y,int color,int flip)
165165{
166166   if (flip)
167167   {
r13798r13799
169169      y = bitmap->height() - y - 1;
170170   }
171171
172   if (x < cliprect->min_x ||
173      x > cliprect->max_x ||
174      y < cliprect->min_y ||
175      y > cliprect->max_y)
172   if (x < cliprect.min_x ||
173      x > cliprect.max_x ||
174      y < cliprect.min_y ||
175      y > cliprect.max_y)
176176      return;
177177
178178   bitmap->pix16(y, x) = color;
179179}
180180
181181
182static void draw_sprite(running_machine &machine, bitmap_t *bitmap,const rectangle *cliprect,int spr_number)
182static void draw_sprite(running_machine &machine, bitmap_t *bitmap,const rectangle &cliprect,int spr_number)
183183{
184184   suprloco_state *state = machine.driver_data<suprloco_state>();
185185   int flip = flip_screen_get(machine);
r13798r13799
254254   }
255255}
256256
257static void draw_sprites(running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect)
257static void draw_sprites(running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect)
258258{
259259   suprloco_state *state = machine.driver_data<suprloco_state>();
260260   int spr_number;
src/mame/video/m92.c
r13798r13799
323323
324324/*****************************************************************************/
325325
326static void draw_sprites(running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect)
326static void draw_sprites(running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect)
327327{
328328   m92_state *state = machine.driver_data<m92_state>();
329329   UINT16 *source = machine.generic.buffered_spriteram.u16;
r13798r13799
397397}
398398
399399// This needs a lot of work...
400static void ppan_draw_sprites(running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect)
400static void ppan_draw_sprites(running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect)
401401{
402402   m92_state *state = machine.driver_data<m92_state>();
403403   UINT16 *source = machine.generic.spriteram.u16; // sprite buffer control is never triggered
r13798r13799
521521
522522/*****************************************************************************/
523523
524static void m92_draw_tiles(running_machine &machine, bitmap_t *bitmap,const rectangle *cliprect)
524static void m92_draw_tiles(running_machine &machine, bitmap_t *bitmap,const rectangle &cliprect)
525525{
526526   m92_state *state = machine.driver_data<m92_state>();
527527
r13798r13799
547547
548548SCREEN_UPDATE( m92 )
549549{
550   screen.machine().priority_bitmap->fill(0, *cliprect);
551   bitmap->fill(0, *cliprect);
550   screen.machine().priority_bitmap->fill(0, cliprect);
551   bitmap->fill(0, cliprect);
552552   m92_update_scroll_positions(screen.machine());
553553   m92_draw_tiles(screen.machine(), bitmap, cliprect);
554554
r13798r13799
564564
565565SCREEN_UPDATE( ppan )
566566{
567   screen.machine().priority_bitmap->fill(0, *cliprect);
568   bitmap->fill(0, *cliprect);
567   screen.machine().priority_bitmap->fill(0, cliprect);
568   bitmap->fill(0, cliprect);
569569   m92_update_scroll_positions(screen.machine());
570570   m92_draw_tiles(screen.machine(), bitmap, cliprect);
571571
src/mame/video/m58.c
r13798r13799
219219
220220#define DRAW_SPRITE(code, sy) drawgfx_transmask(bitmap, cliprect, machine.gfx[1], code, color, flipx, flipy, sx, sy, colortable_get_transpen_mask(machine.colortable, machine.gfx[1], color, 512));
221221
222static void draw_sprites(running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect )
222static void draw_sprites(running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect )
223223{
224224   m58_state *state = machine.driver_data<m58_state>();
225225   int offs;
r13798r13799
274274 *
275275 *************************************/
276276
277static void draw_panel( running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect )
277static void draw_panel( running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect )
278278{
279279   m58_state *state = machine.driver_data<m58_state>();
280280
r13798r13799
284284      const rectangle clippanelflip(0*8, 6*8-1, 1*8, 31*8-1);
285285      rectangle clip = flip_screen_get(machine) ? clippanelflip : clippanel;
286286      const rectangle &visarea = machine.primary_screen->visible_area();
287      int sx = flip_screen_get(machine) ? cliprect->min_x - 8 : cliprect->max_x + 1 - SCROLL_PANEL_WIDTH;
287      int sx = flip_screen_get(machine) ? cliprect.min_x - 8 : cliprect.max_x + 1 - SCROLL_PANEL_WIDTH;
288288      int yoffs = flip_screen_get(machine) ? -40 : -16;
289289
290290      clip.min_y += visarea.min_y + yoffs;
291291      clip.max_y += visarea.max_y + yoffs;
292      clip &= *cliprect;
292      clip &= cliprect;
293293
294294      copybitmap(bitmap, state->m_scroll_panel_bitmap, flip_screen_get(machine), flip_screen_get(machine),
295               sx, visarea.min_y + yoffs, &clip);
295               sx, visarea.min_y + yoffs, clip);
296296   }
297297}
298298
src/mame/video/vendetta.c
r13798r13799
7373
7474   konami_sortlayers3(layer, state->m_layerpri);
7575
76   screen.machine().priority_bitmap->fill(0, *cliprect);
76   screen.machine().priority_bitmap->fill(0, cliprect);
7777   k052109_tilemap_draw(state->m_k052109, bitmap, cliprect, layer[0], TILEMAP_DRAW_OPAQUE, 1);
7878   k052109_tilemap_draw(state->m_k052109, bitmap, cliprect, layer[1], 0, 2);
7979   k052109_tilemap_draw(state->m_k052109, bitmap, cliprect, layer[2], 0, 4);
src/mame/video/segas16b.c
r13798r13799
5050   /* if no drawing is happening, fill with black and get out */
5151   if (!segaic16_display_enable)
5252   {
53      bitmap->fill(get_black_pen(screen.machine()), *cliprect);
53      bitmap->fill(get_black_pen(screen.machine()), cliprect);
5454      return 0;
5555   }
5656
5757   /* reset priorities */
58   screen.machine().priority_bitmap->fill(0, *cliprect);
58   screen.machine().priority_bitmap->fill(0, cliprect);
5959
6060   /* draw background opaquely first, not setting any priorities */
6161   segaic16_tilemap_draw(screen, bitmap, cliprect, 0, SEGAIC16_TILEMAP_BACKGROUND, 0 | TILEMAP_DRAW_OPAQUE, 0x00);
src/mame/video/thoop2.c
r13798r13799
148148      3  | xxxxxxxx xxxxxx-- | sprite code (low bits)
149149*/
150150
151static void draw_sprites(running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect, int pri)
151static void draw_sprites(running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect, int pri)
152152{
153153   thoop2_state *state = machine.driver_data<thoop2_state>();
154154   int j, x, y, ex, ey;
r13798r13799
210210
211211   thoop2_sort_sprites(screen.machine());
212212
213   bitmap->fill(0, *cliprect );
213   bitmap->fill(0, cliprect );
214214
215215   tilemap_draw(bitmap,cliprect,state->m_pant[1],TILEMAP_DRAW_LAYER1 | 3,0);
216216   tilemap_draw(bitmap,cliprect,state->m_pant[0],TILEMAP_DRAW_LAYER1 | 3,0);
src/mame/video/wwfwfest.c
r13798r13799
144144 sprite drawing could probably be improved a bit
145145*******************************************************************************/
146146
147static void draw_sprites(running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect )
147static void draw_sprites(running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect )
148148{
149149   wwfwfest_state *state = machine.driver_data<wwfwfest_state>();
150150   /*- SPR RAM Format -**
src/mame/video/pktgaldx.c
r13798r13799
1313   flip_screen_set(screen.machine(), BIT(flip, 7));
1414   deco16ic_pf_update(state->m_deco_tilegen1, state->m_pf1_rowscroll, state->m_pf2_rowscroll);
1515
16   bitmap->fill(0, *cliprect); /* not Confirmed */
16   bitmap->fill(0, cliprect); /* not Confirmed */
1717   screen.machine().priority_bitmap->fill(0);
1818
1919   deco16ic_tilemap_2_draw(state->m_deco_tilegen1, bitmap, cliprect, 0, 0);
r13798r13799
3232   int tileno;
3333   int colour;
3434
35   bitmap->fill(get_black_pen(screen.machine()), *cliprect);
35   bitmap->fill(get_black_pen(screen.machine()), cliprect);
3636
3737   /* the bootleg seems to treat the tilemaps as sprites */
3838   for (offset = 0; offset < 0x1600 / 2; offset += 8)
src/mame/video/timeplt.c
r13798r13799
176176 *
177177 *************************************/
178178
179static void draw_sprites( running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect )
179static void draw_sprites( running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect )
180180{
181181   timeplt_state *state = machine.driver_data<timeplt_state>();
182182   UINT8 *spriteram = state->m_spriteram;
src/mame/video/atarigx2.c
r13798r13799
184184   bitmap_t *priority_bitmap = screen.machine().priority_bitmap;
185185
186186   /* draw the playfield */
187   priority_bitmap->fill(0, *cliprect);
187   priority_bitmap->fill(0, cliprect);
188188   tilemap_draw(bitmap, cliprect, state->m_playfield_tilemap, 0, 0);
189189   tilemap_draw(bitmap, cliprect, state->m_playfield_tilemap, 1, 1);
190190   tilemap_draw(bitmap, cliprect, state->m_playfield_tilemap, 2, 2);
r13798r13799
197197   /* copy the motion objects on top */
198198   {
199199      bitmap_t *mo_bitmap = atarirle_get_vram(state->m_rle, 0);
200      int left   = cliprect->min_x;
201      int top      = cliprect->min_y;
202      int right   = cliprect->max_x + 1;
203      int bottom   = cliprect->max_y + 1;
200      int left   = cliprect.min_x;
201      int top      = cliprect.min_y;
202      int right   = cliprect.max_x + 1;
203      int bottom   = cliprect.max_y + 1;
204204      int x, y;
205205
206206      /* now blend with the playfield */
src/mame/video/fuukifg2.c
r13798r13799
135135
136136***************************************************************************/
137137
138static void draw_sprites( screen_device &screen, bitmap_t *bitmap, const rectangle *cliprect )
138static void draw_sprites( screen_device &screen, bitmap_t *bitmap, const rectangle &cliprect )
139139{
140140   fuuki16_state *state = screen.machine().driver_data<fuuki16_state>();
141141   int offs;
r13798r13799
265265***************************************************************************/
266266
267267/* Wrapper to handle bg and bg2 ttogether */
268static void fuuki16_draw_layer( running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect, int i, int flag, int pri )
268static void fuuki16_draw_layer( running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect, int i, int flag, int pri )
269269{
270270   fuuki16_state *state = machine.driver_data<fuuki16_state>();
271271   int buffer = (state->m_vregs[0x1e / 2] & 0x40);
r13798r13799
337337//  fuuki16_draw_layer(screen.machine(), bitmap, cliprect, tm_back, TILEMAP_DRAW_OPAQUE, 0);
338338
339339   /* Actually, bg colour is simply the last pen i.e. 0x1fff -pjp */
340   bitmap->fill((0x800 * 4) - 1, *cliprect);
341   screen.machine().priority_bitmap->fill(0, *cliprect);
340   bitmap->fill((0x800 * 4) - 1, cliprect);
341   screen.machine().priority_bitmap->fill(0, cliprect);
342342
343343   fuuki16_draw_layer(screen.machine(), bitmap, cliprect, tm_back,   0, 1);
344344   fuuki16_draw_layer(screen.machine(), bitmap, cliprect, tm_middle, 0, 2);
src/mame/video/vulgus.c
r13798r13799
171171
172172***************************************************************************/
173173
174static void draw_sprites(running_machine &machine, bitmap_t *bitmap,const rectangle *cliprect)
174static void draw_sprites(running_machine &machine, bitmap_t *bitmap,const rectangle &cliprect)
175175{
176176   vulgus_state *state = machine.driver_data<vulgus_state>();
177177   UINT8 *spriteram = state->m_spriteram;
src/mame/video/circus.c
r13798r13799
4444   state->m_bg_tilemap = tilemap_create(machine, get_bg_tile_info, tilemap_scan_rows, 8, 8, 32, 32);
4545}
4646
47static void draw_line( bitmap_t *bitmap, const rectangle *cliprect, int x1, int y1, int x2, int y2, int dotted )
47static void draw_line( bitmap_t *bitmap, const rectangle &cliprect, int x1, int y1, int x2, int y2, int dotted )
4848{
4949   /* Draws horizontal and Vertical lines only! */
5050   int count, skip;
r13798r13799
6363         bitmap->pix16(y1, count) = 1;
6464}
6565
66static void draw_sprite_collision( running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect )
66static void draw_sprite_collision( running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect )
6767{
6868   circus_state *state = machine.driver_data<circus_state>();
6969   const gfx_element *sprite_gfx = machine.gfx[1];
r13798r13799
9797      device_set_input_line(state->m_maincpu, 0, ASSERT_LINE);
9898}
9999
100static void circus_draw_fg( running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect )
100static void circus_draw_fg( running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect )
101101{
102102   /* The sync generator hardware is used to   */
103103   /* draw the border and diving boards        */
r13798r13799
122122   return 0;
123123}
124124
125static void robotbwl_draw_box( bitmap_t *bitmap, const rectangle *cliprect, int x, int y )
125static void robotbwl_draw_box( bitmap_t *bitmap, const rectangle &cliprect, int x, int y )
126126{
127127   /* Box */
128128   int ex = x + 24;
r13798r13799
140140   draw_line(bitmap, cliprect, x + 16, y, x + 16, ey, 0);
141141}
142142
143static void robotbwl_draw_scoreboard( bitmap_t *bitmap, const rectangle *cliprect )
143static void robotbwl_draw_scoreboard( bitmap_t *bitmap, const rectangle &cliprect )
144144{
145145   int offs;
146146
r13798r13799
165165   draw_line(bitmap, cliprect, 39 + 152, 137, 47 + 152, 137, 0);
166166}
167167
168static void robotbwl_draw_bowling_alley( bitmap_t *bitmap, const rectangle *cliprect )
168static void robotbwl_draw_bowling_alley( bitmap_t *bitmap, const rectangle &cliprect )
169169{
170170   draw_line(bitmap, cliprect, 103, 17, 103, 205, 0);
171171   draw_line(bitmap, cliprect, 111, 17, 111, 203, 1);
r13798r13799
173173   draw_line(bitmap, cliprect, 144, 17, 144, 203, 1);
174174}
175175
176static void robotbwl_draw_ball( running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect )
176static void robotbwl_draw_ball( running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect )
177177{
178178   circus_state *state = machine.driver_data<circus_state>();
179179   drawgfx_transpen(bitmap,/* Y is horizontal position */
r13798r13799
194194   return 0;
195195}
196196
197static void crash_draw_car( running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect )
197static void crash_draw_car( running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect )
198198{
199199   circus_state *state = machine.driver_data<circus_state>();
200200   drawgfx_transpen(bitmap,/* Y is horizontal position */
src/mame/video/sderby.c
r13798r13799
6565}
6666
6767
68static void draw_sprites(running_machine &machine, bitmap_t *bitmap,const rectangle *cliprect,int codeshift)
68static void draw_sprites(running_machine &machine, bitmap_t *bitmap,const rectangle &cliprect,int codeshift)
6969{
7070   sderby_state *state = machine.driver_data<sderby_state>();
7171   UINT16 *spriteram16 = state->m_spriteram;
src/mame/video/zac2650.c
r13798r13799
6767
6868        /* Draw first sprite */
6969
70       drawgfx_opaque(state->m_spritebitmap,0, machine.gfx[expand],
70       drawgfx_opaque(state->m_spritebitmap,state->m_spritebitmap->cliprect(), machine.gfx[expand],
7171             first * 2,
7272             0,
7373             0,0,
r13798r13799
9393
9494        /* Blackout second sprite */
9595
96       drawgfx_transpen(state->m_spritebitmap,0, machine.gfx[1],
96       drawgfx_transpen(state->m_spritebitmap,state->m_spritebitmap->cliprect(), machine.gfx[1],
9797             second * 2,
9898             1,
9999             0,0,
r13798r13799
119119
120120        /* Zero bitmap */
121121
122       drawgfx_opaque(state->m_spritebitmap,0, machine.gfx[expand],
122       drawgfx_opaque(state->m_spritebitmap,state->m_spritebitmap->cliprect(), machine.gfx[expand],
123123             first * 2,
124124             1,
125125             0,0,
r13798r13799
151151   gfx_element_set_source(machine.gfx[2], state->m_s2636_0_ram);
152152}
153153
154static void draw_sprites(running_machine &machine, bitmap_t *bitmap)
154static void draw_sprites(running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect)
155155{
156156   zac2650_state *state = machine.driver_data<zac2650_state>();
157157   int offs;
r13798r13799
171171    state->m_CollisionBackground = 0;   /* Read from 0x1e80 bit 7 */
172172
173173   // for collision detection checking
174   copybitmap(machine.generic.tmpbitmap,bitmap,0,0,0,0,&visarea);
174   copybitmap(machine.generic.tmpbitmap,bitmap,0,0,0,0,visarea);
175175
176176    for(offs=0;offs<0x50;offs+=0x10)
177177    {
r13798r13799
184184            int x,y;
185185
186186            /* Sprite->Background collision detection */
187         drawgfx_transpen(bitmap,0, machine.gfx[expand],
187         drawgfx_transpen(bitmap,cliprect, machine.gfx[expand],
188188                spriteno,
189189               1,
190190                0,0,
r13798r13799
210210                }
211211           }
212212
213         drawgfx_transpen(bitmap,0, machine.gfx[expand],
213         drawgfx_transpen(bitmap,cliprect, machine.gfx[expand],
214214                spriteno,
215215               0,
216216                0,0,
r13798r13799
232232{
233233   zac2650_state *state = screen.machine().driver_data<zac2650_state>();
234234   tilemap_draw(bitmap, cliprect, state->m_bg_tilemap, 0, 0);
235   draw_sprites(screen.machine(), bitmap);
235   draw_sprites(screen.machine(), bitmap, cliprect);
236236   return 0;
237237}
src/mame/video/shangha3.c
r13798r13799
213213                  if (flipy) dy = sy + sizey-15 - dy;
214214                  else dy = sy + dy;
215215
216                  drawgfx_transpen(rawbitmap,&myclip,space->machine().gfx[0],
216                  drawgfx_transpen(rawbitmap,myclip,space->machine().gfx[0],
217217                        (tile & 0x0fff) | (code & 0xf000),
218218                        (tile >> 12) | (color & 0x70),
219219                        flipx,flipy,
r13798r13799
226226            int w;
227227
228228if (zoomx <= 1 && zoomy <= 1)
229   drawgfxzoom_transtable(rawbitmap,&myclip,space->machine().gfx[0],
229   drawgfxzoom_transtable(rawbitmap,myclip,space->machine().gfx[0],
230230         code,
231231         color,
232232         flipx,flipy,
r13798r13799
239239
240240            for (x = 0;x < w;x++)
241241            {
242               drawgfxzoom_transtable(rawbitmap,&myclip,space->machine().gfx[0],
242               drawgfxzoom_transtable(rawbitmap,myclip,space->machine().gfx[0],
243243                     code,
244244                     color,
245245                     flipx,flipy,
src/mame/video/vastar.c
r13798r13799
137137
138138***************************************************************************/
139139
140static void draw_sprites(running_machine &machine, bitmap_t *bitmap,const rectangle *cliprect)
140static void draw_sprites(running_machine &machine, bitmap_t *bitmap,const rectangle &cliprect)
141141{
142142   vastar_state *state = machine.driver_data<vastar_state>();
143143   UINT8 *spriteram = state->m_spriteram1;
src/mame/video/taotaido.c
r13798r13799
2525/* sprites are like the other video system / psikyo games, we can merge this with aerofgt and plenty of other
2626   things eventually */
2727
28static void draw_sprite(running_machine &machine, UINT16 spriteno, bitmap_t *bitmap, const rectangle *cliprect )
28static void draw_sprite(running_machine &machine, UINT16 spriteno, bitmap_t *bitmap, const rectangle &cliprect )
2929{
3030   taotaido_state *state = machine.driver_data<taotaido_state>();
3131   /*- SPR RAM Format -**
r13798r13799
109109   }
110110}
111111
112static void draw_sprites(running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect )
112static void draw_sprites(running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect )
113113{
114114   taotaido_state *state = machine.driver_data<taotaido_state>();
115115   /* first part of sprite ram is the list of sprites to draw, terminated with 0x4000 */
r13798r13799
220220      tilemap_set_scrollx(state->m_bg_tilemap,0,((state->m_scrollram[(0x00+4*line)/2])>>4)+30);
221221      tilemap_set_scrolly(state->m_bg_tilemap,0,((state->m_scrollram[(0x02+4*line)/2])>>4)-line);
222222
223      tilemap_draw(bitmap,&clip,state->m_bg_tilemap,0,0);
223      tilemap_draw(bitmap,clip,state->m_bg_tilemap,0,0);
224224   }
225225
226226   draw_sprites(screen.machine(), bitmap,cliprect);
src/mame/video/relief.c
r13798r13799
117117   int x, y, r;
118118
119119   /* draw the playfield */
120   priority_bitmap->fill(0, *cliprect);
120   priority_bitmap->fill(0, cliprect);
121121   tilemap_draw(bitmap, cliprect, state->m_playfield_tilemap, 0, 0);
122122   tilemap_draw(bitmap, cliprect, state->m_playfield2_tilemap, 0, 1);
123123
src/mame/video/taito_f3.c
r13798r13799
21682168
21692169/******************************************************************************/
21702170
2171static void scanline_draw(running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect)
2171static void scanline_draw(running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect)
21722172{
21732173   taito_f3_state *state = machine.driver_data<taito_f3_state>();
21742174   int i,j,y,ys,ye;
r13798r13799
25972597   pri++;
25982598
25992599INLINE void f3_drawgfx(
2600      bitmap_t *dest_bmp,const rectangle *clip,const gfx_element *gfx,
2600      bitmap_t *dest_bmp,const rectangle &clip,const gfx_element *gfx,
26012601      int code,
26022602      int color,
26032603      int flipx,int flipy,
r13798r13799
26102610   pri_dst=1<<pri_dst;
26112611
26122612   /* KW 991012 -- Added code to force clip to bitmap boundary */
2613   if(clip)
2614   {
2615      myclip = *clip;
2616      myclip &= dest_bmp->cliprect();
2617      clip=&myclip;
2618   }
2613   myclip = clip;
2614   myclip &= dest_bmp->cliprect();
26192615
26202616
26212617   if( gfx )
r13798r13799
26542650            y_index = 0;
26552651         }
26562652
2657         if( clip )
2658         {
2659            if( sx < clip->min_x)
2660            { /* clip left */
2661               int pixels = clip->min_x-sx;
2662               sx += pixels;
2663               x_index_base += pixels*dx;
2664            }
2665            if( sy < clip->min_y )
2666            { /* clip top */
2667               int pixels = clip->min_y-sy;
2668               sy += pixels;
2669               y_index += pixels*dy;
2670            }
2671            /* NS 980211 - fixed incorrect clipping */
2672            if( ex > clip->max_x+1 )
2673            { /* clip right */
2674               int pixels = ex-clip->max_x-1;
2675               ex -= pixels;
2676            }
2677            if( ey > clip->max_y+1 )
2678            { /* clip bottom */
2679               int pixels = ey-clip->max_y-1;
2680               ey -= pixels;
2681            }
2653         if( sx < myclip.min_x)
2654         { /* clip left */
2655            int pixels = myclip.min_x-sx;
2656            sx += pixels;
2657            x_index_base += pixels*dx;
26822658         }
2659         if( sy < myclip.min_y )
2660         { /* clip top */
2661            int pixels = myclip.min_y-sy;
2662            sy += pixels;
2663            y_index += pixels*dy;
2664         }
2665         /* NS 980211 - fixed incorrect clipping */
2666         if( ex > myclip.max_x+1 )
2667         { /* clip right */
2668            int pixels = ex-myclip.max_x-1;
2669            ex -= pixels;
2670         }
2671         if( ey > myclip.max_y+1 )
2672         { /* clip bottom */
2673            int pixels = ey-myclip.max_y-1;
2674            ey -= pixels;
2675         }
26832676
26842677         if( ex>sx && ey>sy)
26852678         { /* skip if inner loop doesn't draw anything */
r13798r13799
27532746
27542747
27552748INLINE void f3_drawgfxzoom(
2756      bitmap_t *dest_bmp,const rectangle *clip,const gfx_element *gfx,
2749      bitmap_t *dest_bmp,const rectangle &clip,const gfx_element *gfx,
27572750      int code,
27582751      int color,
27592752      int flipx,int flipy,
r13798r13799
27672760   pri_dst=1<<pri_dst;
27682761
27692762   /* KW 991012 -- Added code to force clip to bitmap boundary */
2770   if(clip)
2771   {
2772      myclip = *clip;
2773      myclip &= dest_bmp->cliprect();
2774      clip=&myclip;
2775   }
2763   myclip = clip;
2764   myclip &= dest_bmp->cliprect();
27762765
27772766
27782767   if( gfx )
r13798r13799
28112800            y_index = 0;
28122801         }
28132802
2814         if( clip )
2815         {
2816            if( sx < clip->min_x)
2817            { /* clip left */
2818               int pixels = clip->min_x-sx;
2819               sx += pixels;
2820               x_index_base += pixels*dx;
2821            }
2822            if( sy < clip->min_y )
2823            { /* clip top */
2824               int pixels = clip->min_y-sy;
2825               sy += pixels;
2826               y_index += pixels*dy;
2827            }
2828            /* NS 980211 - fixed incorrect clipping */
2829            if( ex > clip->max_x+1 )
2830            { /* clip right */
2831               int pixels = ex-clip->max_x-1;
2832               ex -= pixels;
2833            }
2834            if( ey > clip->max_y+1 )
2835            { /* clip bottom */
2836               int pixels = ey-clip->max_y-1;
2837               ey -= pixels;
2838            }
2803         if( sx < myclip.min_x)
2804         { /* clip left */
2805            int pixels = myclip.min_x-sx;
2806            sx += pixels;
2807            x_index_base += pixels*dx;
28392808         }
2809         if( sy < myclip.min_y )
2810         { /* clip top */
2811            int pixels = myclip.min_y-sy;
2812            sy += pixels;
2813            y_index += pixels*dy;
2814         }
2815         /* NS 980211 - fixed incorrect clipping */
2816         if( ex > myclip.max_x+1 )
2817         { /* clip right */
2818            int pixels = ex-myclip.max_x-1;
2819            ex -= pixels;
2820         }
2821         if( ey > myclip.max_y+1 )
2822         { /* clip bottom */
2823            int pixels = ey-myclip.max_y-1;
2824            ey -= pixels;
2825         }
28402826
28412827         if( ex>sx )
28422828         { /* skip if inner loop doesn't draw anything */
r13798r13799
31483134#undef CALC_ZOOM
31493135
31503136
3151static void draw_sprites(running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect)
3137static void draw_sprites(running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect)
31523138{
31533139   taito_f3_state *state = machine.driver_data<taito_f3_state>();
31543140   const struct tempsprite *sprite_ptr;
r13798r13799
32293215      sy_fix[4]=-sy_fix[4];
32303216   }
32313217
3232   state->m_pri_alp_bitmap->fill(0, *cliprect);
3218   state->m_pri_alp_bitmap->fill(0, cliprect);
32333219
32343220   /* sprites */
32353221   if (state->m_sprite_lag==0)
src/mame/video/gaelco2.c
r13798r13799
339339
340340***************************************************************************/
341341
342static void draw_sprites(screen_device &screen, bitmap_t *bitmap, const rectangle *cliprect, int mask, int xoffs)
342static void draw_sprites(screen_device &screen, bitmap_t *bitmap, const rectangle &cliprect, int mask, int xoffs)
343343{
344344   gaelco2_state *state = screen.machine().driver_data<gaelco2_state>();
345345   UINT16 *buffered_spriteram16 = screen.machine().generic.buffered_spriteram.u16;
r13798r13799
402402
403403                     int gfx_py = yflip ? (gfx->height - 1 - py) : py;
404404
405                     if ((ypos < cliprect->min_y) || (ypos > cliprect->max_y)) continue;
405                     if ((ypos < cliprect.min_y) || (ypos > cliprect.max_y)) continue;
406406
407407                     for (px = 0; px < gfx->width; px++){
408408                        /* get current pixel */
r13798r13799
417417
418418                        if ((gfx_pen == 0) || (gfx_pen >= 16)) continue;
419419
420                        if ((xpos < cliprect->min_x) || (xpos > cliprect->max_x)) continue;
420                        if ((xpos < cliprect.min_x) || (xpos > cliprect.max_x)) continue;
421421
422422                        /* make background color darker or brighter */
423423                        *pixel = src_color + 4096*gfx_pen;
r13798r13799
458458   }
459459
460460   /* draw screen */
461   bitmap->fill(0, *cliprect);
461   bitmap->fill(0, cliprect);
462462
463463   tilemap_draw(bitmap, cliprect, state->m_pant[1], 0, 0);
464464   tilemap_draw(bitmap, cliprect, state->m_pant[0], 0, 0);
r13798r13799
466466   return 0;
467467}
468468
469static UINT32 dual_update(screen_device &screen, bitmap_t *bitmap, const rectangle *cliprect, int index)
469static UINT32 dual_update(screen_device &screen, bitmap_t *bitmap, const rectangle &cliprect, int index)
470470{
471471   gaelco2_state *state = screen.machine().driver_data<gaelco2_state>();
472472   int i;
r13798r13799
488488   }
489489
490490   /* draw screen */
491   bitmap->fill(0, *cliprect);
491   bitmap->fill(0, cliprect);
492492
493493   tilemap_draw(bitmap,cliprect,state->m_pant[index], 0, 0);
494494   draw_sprites(screen,bitmap,cliprect, 0x8000 * index, 0);
src/mame/video/homerun.c
r13798r13799
5959   state->m_tilemap = tilemap_create(machine, get_homerun_tile_info, tilemap_scan_rows, 8, 8, 64, 64);
6060}
6161
62static void draw_sprites( running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect )
62static void draw_sprites( running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect )
6363{
6464   homerun_state *state = machine.driver_data<homerun_state>();
6565   UINT8 *spriteram = state->m_spriteram;
r13798r13799
8585SCREEN_UPDATE(homerun)
8686{
8787   homerun_state *state = screen.machine().driver_data<homerun_state>();
88   rectangle myclip = *cliprect;
88   rectangle myclip = cliprect;
8989
9090   /* upper part */
9191   tilemap_set_scrollx(state->m_tilemap, 0, state->m_xpc + ((state->m_xpa & 2) << 7) );
r13798r13799
9393
9494   myclip.max_y /= 2;
9595   state->m_gfx_ctrl = state->m_gc_up;
96   tilemap_draw(bitmap, &myclip, state->m_tilemap, 0, 0);
97   draw_sprites(screen.machine(), bitmap, &myclip);
96   tilemap_draw(bitmap, myclip, state->m_tilemap, 0, 0);
97   draw_sprites(screen.machine(), bitmap, myclip);
9898
9999   /* lower part */
100100   myclip.min_y += myclip.max_y;
101101   myclip.max_y *= 2;
102102   state->m_gfx_ctrl = state->m_gc_down;
103   tilemap_draw(bitmap, &myclip, state->m_tilemap, 0, 0);
104   draw_sprites(screen.machine(), bitmap, &myclip);
103   tilemap_draw(bitmap, myclip, state->m_tilemap, 0, 0);
104   draw_sprites(screen.machine(), bitmap, myclip);
105105
106106   state->m_gc_down = state->m_gc_up;
107107   return 0;
src/mame/video/champbas.c
r13798r13799
193193
194194
195195
196static void champbas_draw_sprites( running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect )
196static void champbas_draw_sprites( running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect )
197197{
198198   champbas_state *state = machine.driver_data<champbas_state>();
199199   int offs;
r13798r13799
225225   }
226226}
227227
228static void exctsccr_draw_sprites( running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect )
228static void exctsccr_draw_sprites( running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect )
229229{
230230   champbas_state *state = machine.driver_data<champbas_state>();
231231   int offs;
src/mame/video/baraduke.c
r13798r13799
217217
218218***************************************************************************/
219219
220static void draw_sprites(running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect, int sprite_priority)
220static void draw_sprites(running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect, int sprite_priority)
221221{
222222   baraduke_state *state = machine.driver_data<baraduke_state>();
223223   UINT8 *spriteram = state->m_spriteram + 0x1800;
src/mame/video/ssozumo.c
r13798r13799
150150   tilemap_set_transparent_pen(state->m_fg_tilemap, 0);
151151}
152152
153static void draw_sprites(running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect)
153static void draw_sprites(running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect)
154154{
155155   ssozumo_state *state = machine.driver_data<ssozumo_state>();
156156   UINT8 *spriteram = state->m_spriteram;
src/mame/video/mcr.c
r13798r13799
255255 *
256256 *************************************/
257257
258static void render_sprites_91399(running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect)
258static void render_sprites_91399(running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect)
259259{
260260   UINT8 *spriteram = machine.generic.spriteram.u8;
261261   const gfx_element *gfx = machine.gfx[1];
r13798r13799
290290
291291      /* loop over lines in the sprite */
292292      for (y = 0; y < 32; y++, sy = (sy + 1) & 0x1ff)
293         if (sy >= cliprect->min_y && sy <= cliprect->max_y)
293         if (sy >= cliprect.min_y && sy <= cliprect.max_y)
294294         {
295295            const UINT8 *src = gfx_element_get_data(gfx, code) + gfx->line_modulo * (y ^ vflip);
296296            UINT16 *dst = &bitmap->pix16(sy);
r13798r13799
327327 *
328328 *************************************/
329329
330static void render_sprites_91464(running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect, int primask, int sprmask, int colormask)
330static void render_sprites_91464(running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect, int primask, int sprmask, int colormask)
331331{
332332   UINT8 *spriteram = machine.generic.spriteram.u8;
333333   const gfx_element *gfx = machine.gfx[1];
r13798r13799
361361
362362      /* loop over lines in the sprite */
363363      for (y = 0; y < 32; y++, sy = (sy + 1) & 0x1ff)
364         if (sy >= 2 && sy >= cliprect->min_y && sy <= cliprect->max_y)
364         if (sy >= 2 && sy >= cliprect.min_y && sy <= cliprect.max_y)
365365         {
366366            const UINT8 *src = gfx_element_get_data(gfx, code) + gfx->line_modulo * (y ^ vflip);
367367            UINT16 *dst = &bitmap->pix16(sy);
r13798r13799
407407   tilemap_set_flip(bg_tilemap, mcr_cocktail_flip ? (TILEMAP_FLIPX | TILEMAP_FLIPY) : 0);
408408
409409   /* draw the background */
410   screen.machine().priority_bitmap->fill(0, *cliprect);
410   screen.machine().priority_bitmap->fill(0, cliprect);
411411   tilemap_draw(bitmap, cliprect, bg_tilemap, 0, 0x00);
412412   tilemap_draw(bitmap, cliprect, bg_tilemap, 1, 0x10);
413413   tilemap_draw(bitmap, cliprect, bg_tilemap, 2, 0x20);
src/mame/video/m107.c
r13798r13799
150150
151151/*****************************************************************************/
152152
153static void draw_sprites(running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect)
153static void draw_sprites(running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect)
154154{
155155   m107_state *state = machine.driver_data<m107_state>();
156156   UINT16 *spriteram = state->m_buffered_spriteram;
r13798r13799
313313
314314/*****************************************************************************/
315315
316static void m107_tilemap_draw(running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect, int laynum, int category,int opaque)
316static void m107_tilemap_draw(running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect, int laynum, int category,int opaque)
317317{
318318   m107_state *state = machine.driver_data<m107_state>();
319319   int line;
r13798r13799
326326
327327   if (state->m_control[0x08 + laynum] & 0x02)
328328   {
329      for (line = cliprect->min_y; line <= cliprect->max_y;line++)
329      for (line = cliprect.min_y; line <= cliprect.max_y;line++)
330330      {
331331         const UINT16 *scrolldata = state->m_vram_data + (0xe800 + 0x200 * laynum) / 2;
332332         clip.min_y = clip.max_y = line;
r13798r13799
334334         tilemap_set_scrollx(state->m_pf_layer[laynum].tmap,0,  state->m_control[1 + 2 * laynum]);
335335         tilemap_set_scrolly(state->m_pf_layer[laynum].tmap,0,  (state->m_control[0 + 2 * laynum] + scrolldata[line]));
336336
337         tilemap_draw(bitmap, &clip, state->m_pf_layer[laynum].tmap, category | opaque, category);
337         tilemap_draw(bitmap, clip, state->m_pf_layer[laynum].tmap, category | opaque, category);
338338      }
339339   }
340340   else
r13798r13799
342342}
343343
344344
345static void m107_screenrefresh(running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect)
345static void m107_screenrefresh(running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect)
346346{
347347   m107_state *state = machine.driver_data<m107_state>();
348   machine.priority_bitmap->fill(0, *cliprect);
348   machine.priority_bitmap->fill(0, cliprect);
349349
350350   if ((~state->m_control[0x0b] >> 7) & 1)
351351   {
r13798r13799
353353      m107_tilemap_draw(machine, bitmap, cliprect, 3, 1,0);
354354   }
355355   else
356      bitmap->fill(0, *cliprect);
356      bitmap->fill(0, cliprect);
357357
358358   /* note: the opaque flag is used if layer 3 is disabled, noticeable in World PK Soccer title and gameplay screens */
359359   m107_tilemap_draw(machine, bitmap, cliprect, 2, 0,(((state->m_control[0x0b] >> 7) & 1) ? TILEMAP_DRAW_OPAQUE : 0));
src/mame/video/ninjaw.c
r13798r13799
1616            SPRITE DRAW ROUTINE
1717************************************************************/
1818
19static void draw_sprites( running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect, int primask, int x_offs, int y_offs )
19static void draw_sprites( running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect, int primask, int x_offs, int y_offs )
2020{
2121   ninjaw_state *state = machine.driver_data<ninjaw_state>();
2222   UINT16 *spriteram = state->m_spriteram;
r13798r13799
9797                SCREEN REFRESH
9898**************************************************************/
9999
100static UINT32 update_screen(screen_device &screen, bitmap_t *bitmap, const rectangle *cliprect, int xoffs, device_t *tc0100scn)
100static UINT32 update_screen(screen_device &screen, bitmap_t *bitmap, const rectangle &cliprect, int xoffs, device_t *tc0100scn)
101101{
102102   UINT8 layer[3], nodraw;
103103
r13798r13799
113113
114114   /* Ensure screen blanked even when bottom layers not drawn due to disable bit */
115115   if (nodraw)
116      bitmap->fill(get_black_pen(screen.machine()), *cliprect);
116      bitmap->fill(get_black_pen(screen.machine()), cliprect);
117117
118118   /* Sprites can be under/over the layer below text layer */
119119   draw_sprites(screen.machine(), bitmap, cliprect, 1, xoffs, 8); // draw sprites with priority 1 which are under the mid layer
src/mame/video/matmania.c
r13798r13799
140140      int sx = 15 - offs / 32;
141141      int sy = offs % 32;
142142
143      drawgfx_opaque(state->m_tmpbitmap, 0, screen.machine().gfx[1],
143      drawgfx_opaque(state->m_tmpbitmap, state->m_tmpbitmap->cliprect(), screen.machine().gfx[1],
144144            state->m_videoram[offs] + ((state->m_colorram[offs] & 0x08) << 5),
145145            (state->m_colorram[offs] & 0x30) >> 4,
146146            0,sy >= 16,   /* flip horizontally tiles on the right half of the bitmap */
r13798r13799
153153      int sx = 15 - offs / 32;
154154      int sy = offs % 32;
155155
156      drawgfx_opaque(state->m_tmpbitmap2, 0, screen.machine().gfx[1],
156      drawgfx_opaque(state->m_tmpbitmap2, state->m_tmpbitmap2->cliprect(), screen.machine().gfx[1],
157157            state->m_videoram3[offs] + ((state->m_colorram3[offs] & 0x08) << 5),
158158            (state->m_colorram3[offs] & 0x30) >> 4,
159159            0,sy >= 16,   /* flip horizontally tiles on the right half of the bitmap */
r13798r13799
212212      int sx = 15 - offs / 32;
213213      int sy = offs % 32;
214214
215      drawgfx_opaque(state->m_tmpbitmap, 0, screen.machine().gfx[1],
215      drawgfx_opaque(state->m_tmpbitmap, state->m_tmpbitmap->cliprect(), screen.machine().gfx[1],
216216            state->m_videoram[offs] + ((state->m_colorram[offs] & 0x03) << 8),
217217            (state->m_colorram[offs] & 0x30) >> 4,
218218            0,sy >= 16,   /* flip horizontally tiles on the right half of the bitmap */
r13798r13799
225225      int sx = 15 - offs / 32;
226226      int sy = offs % 32;
227227
228      drawgfx_opaque(state->m_tmpbitmap2, 0, screen.machine().gfx[1],
228      drawgfx_opaque(state->m_tmpbitmap2, state->m_tmpbitmap2->cliprect(), screen.machine().gfx[1],
229229            state->m_videoram3[offs] + ((state->m_colorram3[offs] & 0x03) << 8),
230230            (state->m_colorram3[offs] & 0x30) >> 4,
231231            0,sy >= 16,   /* flip horizontally tiles on the right half of the bitmap */
src/mame/video/arkanoid.c
r13798r13799
170170   state->m_bg_tilemap = tilemap_create(machine, get_bg_tile_info, tilemap_scan_rows, 8, 8, 32, 32);
171171}
172172
173static void draw_sprites( running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect )
173static void draw_sprites( running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect )
174174{
175175   arkanoid_state *state = machine.driver_data<arkanoid_state>();
176176   int offs;
src/mame/video/twin16.c
r13798r13799
527527   if (state->m_video_register&TWIN16_SCREEN_FLIPX) text_flip|=TILEMAP_FLIPX;
528528   if (state->m_video_register&TWIN16_SCREEN_FLIPY) text_flip|=TILEMAP_FLIPY;
529529
530   screen.machine().priority_bitmap->fill(0, *cliprect);
530   screen.machine().priority_bitmap->fill(0, cliprect);
531531   draw_layer( screen.machine(), bitmap, 1 );
532532   draw_layer( screen.machine(), bitmap, 0 );
533533   draw_sprites( screen.machine(), bitmap );
src/mame/video/megasys1.c
r13798r13799
567567    0C      Y position
568568    0E      Code                                            */
569569
570static void draw_sprites(running_machine &machine, bitmap_t *bitmap,const rectangle *cliprect)
570static void draw_sprites(running_machine &machine, bitmap_t *bitmap,const rectangle &cliprect)
571571{
572572   megasys1_state *state = machine.driver_data<megasys1_state>();
573573   int color,code,sx,sy,flipx,flipy,attr,sprite,offs,color_mask;
r13798r13799
973973      }
974974   }
975975
976   screen.machine().priority_bitmap->fill(0, *cliprect);
976   screen.machine().priority_bitmap->fill(0, cliprect);
977977
978978   flag = TILEMAP_DRAW_OPAQUE;
979979   primask = 0;
r13798r13799
999999            if (flag != 0)
10001000            {
10011001               flag = 0;
1002               bitmap->fill(0, *cliprect);
1002               bitmap->fill(0, cliprect);
10031003            }
10041004
10051005            if (state->m_sprite_flag & 0x100)   /* sprites are split */
src/mame/video/archimds.c
r13798r13799
2020   const UINT8 x_step[4] = { 5, 7, 11, 19 };
2121
2222   /* border color */
23   bitmap->fill(screen.machine().pens[0x10], *cliprect);
23   bitmap->fill(screen.machine().pens[0x10], cliprect);
2424
2525   /* define X display area through BPP mode register */
2626   calc_dxs = (vidc_regs[VIDC_HDSR]*2)+x_step[vidc_bpp_mode & 3];
src/mame/video/crshrace.c
r13798r13799
9999
100100***************************************************************************/
101101
102static void draw_sprites(running_machine &machine, bitmap_t *bitmap,const rectangle *cliprect)
102static void draw_sprites(running_machine &machine, bitmap_t *bitmap,const rectangle &cliprect)
103103{
104104   crshrace_state *state = machine.driver_data<crshrace_state>();
105105   UINT16 *buffered_spriteram = machine.generic.buffered_spriteram.u16;
r13798r13799
171171}
172172
173173
174static void draw_bg( running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect )
174static void draw_bg( running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect )
175175{
176176   crshrace_state *state = machine.driver_data<crshrace_state>();
177177   tilemap_draw(bitmap, cliprect, state->m_tilemap2, 0, 0);
178178}
179179
180180
181static void draw_fg(running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect)
181static void draw_fg(running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect)
182182{
183183   crshrace_state *state = machine.driver_data<crshrace_state>();
184184   k053936_zoom_draw(state->m_k053936, bitmap, cliprect, state->m_tilemap1, 0, 0, 1);
r13798r13799
191191
192192   if (state->m_gfxctrl & 0x04)   /* display disable? */
193193   {
194      bitmap->fill(get_black_pen(screen.machine()), *cliprect);
194      bitmap->fill(get_black_pen(screen.machine()), cliprect);
195195      return 0;
196196   }
197197
198   bitmap->fill(0x1ff, *cliprect);
198   bitmap->fill(0x1ff, cliprect);
199199
200200   switch (state->m_gfxctrl & 0xfb)
201201   {
src/mame/video/pacman.c
r13798r13799
217217{
218218   pacman_state *state = screen.machine().driver_data<pacman_state>();
219219   if (state->m_bgpriority != 0)
220      bitmap->fill(0, *cliprect);
220      bitmap->fill(0, cliprect);
221221   else
222222      tilemap_draw(bitmap,cliprect,state->m_bg_tilemap,TILEMAP_DRAW_OPAQUE,0);
223223
r13798r13799
228228      int offs;
229229
230230      rectangle spriteclip(2*8, 34*8-1, 0*8, 28*8-1);
231      spriteclip &= *cliprect;
231      spriteclip &= cliprect;
232232
233233      /* Draw the sprites. Note that it is important to draw them exactly in this */
234234      /* order, to have the correct priorities. */
r13798r13799
254254
255255         color = ( spriteram[offs + 1] & 0x1f ) | (state->m_colortablebank << 5) | (state->m_palettebank << 6 );
256256
257         drawgfx_transmask(bitmap,&spriteclip,screen.machine().gfx[1],
257         drawgfx_transmask(bitmap,spriteclip,screen.machine().gfx[1],
258258               ( spriteram[offs] >> 2 ) | (state->m_spritebank << 6),
259259               color,
260260               fx,fy,
r13798r13799
262262               colortable_get_transpen_mask(screen.machine().colortable, screen.machine().gfx[1], color & 0x3f, 0));
263263
264264         /* also plot the sprite with wraparound (tunnel in Crush Roller) */
265         drawgfx_transmask(bitmap,&spriteclip,screen.machine().gfx[1],
265         drawgfx_transmask(bitmap,spriteclip,screen.machine().gfx[1],
266266               ( spriteram[offs] >> 2 ) | (state->m_spritebank << 6),
267267               color,
268268               fx,fy,
r13798r13799
292292         fx = (spriteram[offs] & 1) ^ state->m_inv_spr;
293293         fy = (spriteram[offs] & 2) ^ ((state->m_inv_spr) << 1);
294294
295         drawgfx_transmask(bitmap,&spriteclip,screen.machine().gfx[1],
295         drawgfx_transmask(bitmap,spriteclip,screen.machine().gfx[1],
296296               ( spriteram[offs] >> 2 ) | (state->m_spritebank << 6),
297297               color,
298298               fx,fy,
r13798r13799
300300               colortable_get_transpen_mask(screen.machine().colortable, screen.machine().gfx[1], color & 0x3f, 0));
301301
302302         /* also plot the sprite with wraparound (tunnel in Crush Roller) */
303         drawgfx_transmask(bitmap,&spriteclip,screen.machine().gfx[1],
303         drawgfx_transmask(bitmap,spriteclip,screen.machine().gfx[1],
304304               ( spriteram[offs] >> 2 ) | (state->m_spritebank << 6),
305305               color,
306306               fy,fx,         //FIXME: flipping bits are really supposed to be inverted here?
src/mame/video/clshroad.c
r13798r13799
286286
287287***************************************************************************/
288288
289static void draw_sprites(running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect)
289static void draw_sprites(running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect)
290290{
291291   clshroad_state *state = machine.driver_data<clshroad_state>();
292292   UINT8 *spriteram = state->m_spriteram;
src/mame/video/dcheese.c
r13798r13799
122122   int x, y;
123123
124124   /* update the pixels */
125   for (y = cliprect->min_y; y <= cliprect->max_y; y++)
125   for (y = cliprect.min_y; y <= cliprect.max_y; y++)
126126   {
127127      UINT16 *dest = &bitmap->pix16(y);
128128      UINT16 *src = &state->m_dstbitmap->pix16((y + state->m_blitter_vidparam[0x28/2]) % DSTBITMAP_HEIGHT);
129129
130      for (x = cliprect->min_x; x <= cliprect->max_x; x++)
130      for (x = cliprect.min_x; x <= cliprect.max_x; x++)
131131         dest[x] = src[x];
132132   }
133133   return 0;
src/mame/video/chqflag.c
r13798r13799
7575{
7676   chqflag_state *state = screen.machine().driver_data<chqflag_state>();
7777
78   bitmap->fill(0, *cliprect);
78   bitmap->fill(0, cliprect);
7979
8080   k051316_zoom_draw(state->m_k051316_2, bitmap, cliprect, TILEMAP_DRAW_LAYER1, 0);
8181   k051960_sprites_draw(state->m_k051960, bitmap, cliprect, 0, 0);
src/mame/video/bwing.c
r13798r13799
247247//****************************************************************************
248248// Realtime
249249
250static void draw_sprites( running_machine &machine, bitmap_t *bmp, const rectangle *clip, UINT8 *ram, int pri )
250static void draw_sprites( running_machine &machine, bitmap_t *bmp, const rectangle &clip, UINT8 *ram, int pri )
251251{
252252   bwing_state *state = machine.driver_data<bwing_state>();
253253   int attrib, fx, fy, code, x, y, color, i;
r13798r13799
316316      tilemap_draw(bitmap, cliprect, state->m_bgmap, 0, 0);
317317   }
318318   else
319      bitmap->fill(get_black_pen(screen.machine()), *cliprect);
319      bitmap->fill(get_black_pen(screen.machine()), cliprect);
320320
321321   // draw low priority sprites
322322   draw_sprites(screen.machine(), bitmap, cliprect, state->m_spriteram, 0);
src/mame/video/sf.c
r13798r13799
129129   return nb ^ delta[(nb >> 3) & 3];
130130}
131131
132static void draw_sprites( running_machine &machine, bitmap_t *bitmap,const rectangle *cliprect )
132static void draw_sprites( running_machine &machine, bitmap_t *bitmap,const rectangle &cliprect )
133133{
134134   sf_state *state = machine.driver_data<sf_state>();
135135   int offs;
r13798r13799
225225   if (state->m_sf_active & 0x20)
226226      tilemap_draw(bitmap, cliprect, state->m_bg_tilemap, 0, 0);
227227   else
228      bitmap->fill(0, *cliprect);
228      bitmap->fill(0, cliprect);
229229
230230   tilemap_draw(bitmap, cliprect, state->m_fg_tilemap, 0, 0);
231231
src/mame/video/lsasquad.c
r13798r13799
11#include "emu.h"
22#include "includes/lsasquad.h"
33
4static void draw_layer( running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect, UINT8 *scrollram )
4static void draw_layer( running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect, UINT8 *scrollram )
55{
66   lsasquad_state *state = machine.driver_data<lsasquad_state>();
77   int offs, scrollx, scrolly;
r13798r13799
4848   }
4949}
5050
51static int draw_layer_daikaiju( running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect, int offs, int  * previd, int type )
51static int draw_layer_daikaiju( running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect, int offs, int  * previd, int type )
5252{
5353   lsasquad_state *state = machine.driver_data<lsasquad_state>();
5454   int id, scrollx, scrolly, initoffs, globalscrollx;
r13798r13799
138138   return offs;
139139}
140140
141static void drawbg( running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect, int type )
141static void drawbg( running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect, int type )
142142{
143143   lsasquad_state *state = machine.driver_data<lsasquad_state>();
144144   int i = 0;
r13798r13799
158158   }
159159}
160160
161static void draw_sprites( running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect )
161static void draw_sprites( running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect )
162162{
163163   lsasquad_state *state = machine.driver_data<lsasquad_state>();
164164   UINT8 *spriteram = state->m_spriteram;
r13798r13799
201201SCREEN_UPDATE( lsasquad )
202202{
203203   lsasquad_state *state = screen.machine().driver_data<lsasquad_state>();
204   bitmap->fill(511, *cliprect);
204   bitmap->fill(511, cliprect);
205205
206206   draw_layer(screen.machine(), bitmap, cliprect, state->m_scrollram + 0x000);
207207   draw_layer(screen.machine(), bitmap, cliprect, state->m_scrollram + 0x080);
r13798r13799
213213
214214SCREEN_UPDATE( daikaiju )
215215{
216   bitmap->fill(511, *cliprect);
216   bitmap->fill(511, cliprect);
217217   drawbg(screen.machine(), bitmap, cliprect, 0); // bottom
218218   draw_sprites(screen.machine(), bitmap, cliprect);
219219   drawbg(screen.machine(), bitmap, cliprect, 1);   // top = pallete $d ?
src/mame/video/cave.c
r13798r13799
769769   machine.save().register_postload(save_prepost_delegate(FUNC(cave_get_sprite_info), &machine));
770770}
771771
772static void cave_sprite_check( screen_device &screen, const rectangle *clip )
772static void cave_sprite_check( screen_device &screen, const rectangle &clip )
773773{
774774   cave_state *state = screen.machine().driver_data<cave_state>();
775775
776776   {   /* set clip */
777      int left = clip->min_x;
778      int top = clip->min_y;
779      int right = clip->max_x + 1;
780      int bottom = clip->max_y + 1;
777      int left = clip.min_x;
778      int top = clip.min_y;
779      int right = clip.max_x + 1;
780      int bottom = clip.max_y + 1;
781781
782782      state->m_blit.clip_left = left;
783783      state->m_blit.clip_top = top;
r13798r13799
824824
825825         case CAVE_SPRITETYPE_ZOOM | CAVE_SPRITETYPE_ZBUF:
826826            state->m_sprite_draw = sprite_draw_cave_zbuf;
827            if (clip->min_y == visarea.min_y)
827            if (clip.min_y == visarea.min_y)
828828            {
829829               if(!(state->m_sprite_zbuf_baseval += MAX_SPRITE_NUM))
830830                  state->m_sprite_zbuf->fill(0, visarea);
r13798r13799
833833
834834         case CAVE_SPRITETYPE_ZBUF:
835835            state->m_sprite_draw = sprite_draw_donpachi_zbuf;
836            if (clip->min_y == visarea.min_y)
836            if (clip.min_y == visarea.min_y)
837837            {
838838               if(!(state->m_sprite_zbuf_baseval += MAX_SPRITE_NUM))
839839                  state->m_sprite_zbuf->fill(0, visarea);
r13798r13799
14181418***************************************************************************/
14191419
14201420INLINE void cave_tilemap_draw(
1421   running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect,
1421   running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect,
14221422   UINT32 flags, UINT32 priority, UINT32 priority2, int GFX )
14231423{
14241424   cave_state *state = machine.driver_data<cave_state>();
r13798r13799
14671467            tilemap_draw multiple times.
14681468        */
14691469
1470      clip.min_x = cliprect->min_x;
1471      clip.max_x = cliprect->max_x;
1470      clip.min_x = cliprect.min_x;
1471      clip.max_x = cliprect.max_x;
14721472
1473      for (startline = cliprect->min_y; startline <= cliprect->max_y;)
1473      for (startline = cliprect.min_y; startline <= cliprect.max_y;)
14741474      {
14751475         /* Find the largest slice */
14761476         vramdata0 = (vramdata1 = VRAM[(0x1002 + (((sy + offs_row + startline) * 4) & 0x7ff)) / 2]);
1477         for(endline = startline + 1; endline <= cliprect->max_y; endline++)
1477         for(endline = startline + 1; endline <= cliprect.max_y; endline++)
14781478            if((++vramdata1) != VRAM[(0x1002 + (((sy + offs_row + endline) * 4) & 0x7ff)) / 2]) break;
14791479
14801480         tilemap_set_scrolly(TILEMAP, 0, vramdata0 - startline);
r13798r13799
15041504
15051505         if (flipy)
15061506         {
1507            clip.min_y = cliprect->max_y - (endline - 1 - cliprect->min_y);
1508            clip.max_y = cliprect->max_y - (startline - cliprect->min_y);
1507            clip.min_y = cliprect.max_y - (endline - 1 - cliprect.min_y);
1508            clip.max_y = cliprect.max_y - (startline - cliprect.min_y);
15091509         }
15101510         else
15111511         {
r13798r13799
15131513            clip.max_y = endline - 1;
15141514         }
15151515
1516         tilemap_draw(bitmap, &clip, TILEMAP, flags, priority);
1516         tilemap_draw(bitmap, clip, TILEMAP, flags, priority);
15171517
15181518         startline = endline;
15191519      }
r13798r13799
15221522   {
15231523      int line;
15241524      tilemap_set_scroll_rows(TILEMAP, 512);
1525      for(line = cliprect->min_y; line <= cliprect->max_y; line++)
1525      for(line = cliprect.min_y; line <= cliprect.max_y; line++)
15261526         tilemap_set_scrollx(TILEMAP, (line + sy) & 511,
15271527                     sx + VRAM[(0x1000+(((sy + offs_row + line) * 4) & 0x7ff)) / 2] );
15281528      tilemap_set_scrolly(TILEMAP, 0, sy);
r13798r13799
16211621
16221622   cave_sprite_check(screen, cliprect);
16231623
1624   bitmap->fill(state->m_background_color, *cliprect);
1624   bitmap->fill(state->m_background_color, cliprect);
16251625
16261626   /*
16271627        Tiles and sprites are ordered by priority (0 back, 3 front) with
src/mame/video/dooyong.c
r13798r13799
350350}
351351
352352
353static void draw_sprites(running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect, int pollux_extensions)
353static void draw_sprites(running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect, int pollux_extensions)
354354{
355355   /* Sprites take 32 bytes each in memory:
356356                     MSB   LSB
r13798r13799
440440   }
441441}
442442
443static void rshark_draw_sprites(running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect)
443static void rshark_draw_sprites(running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect)
444444{
445445   UINT16 *buffered_spriteram16 = machine.generic.buffered_spriteram.u16;
446446
r13798r13799
515515SCREEN_UPDATE( lastday )
516516{
517517   dooyong_state *state = screen.machine().driver_data<dooyong_state>();
518   bitmap->fill(get_black_pen(screen.machine()), *cliprect);
519   screen.machine().priority_bitmap->fill(0, *cliprect);
518   bitmap->fill(get_black_pen(screen.machine()), cliprect);
519   screen.machine().priority_bitmap->fill(0, cliprect);
520520
521521   tilemap_draw(bitmap, cliprect, state->m_bg_tilemap, 0, 1);
522522   tilemap_draw(bitmap, cliprect, state->m_fg_tilemap, 0, 2);
r13798r13799
530530SCREEN_UPDATE( gulfstrm )
531531{
532532   dooyong_state *state = screen.machine().driver_data<dooyong_state>();
533   bitmap->fill(get_black_pen(screen.machine()), *cliprect);
534   screen.machine().priority_bitmap->fill(0, *cliprect);
533   bitmap->fill(get_black_pen(screen.machine()), cliprect);
534   screen.machine().priority_bitmap->fill(0, cliprect);
535535
536536   tilemap_draw(bitmap, cliprect, state->m_bg_tilemap, 0, 1);
537537   tilemap_draw(bitmap, cliprect, state->m_fg_tilemap, 0, 2);
r13798r13799
544544SCREEN_UPDATE( pollux )
545545{
546546   dooyong_state *state = screen.machine().driver_data<dooyong_state>();
547   bitmap->fill(get_black_pen(screen.machine()), *cliprect);
548   screen.machine().priority_bitmap->fill(0, *cliprect);
547   bitmap->fill(get_black_pen(screen.machine()), cliprect);
548   screen.machine().priority_bitmap->fill(0, cliprect);
549549
550550   tilemap_draw(bitmap, cliprect, state->m_bg_tilemap, 0, 1);
551551   tilemap_draw(bitmap, cliprect, state->m_fg_tilemap, 0, 2);
r13798r13799
558558SCREEN_UPDATE( flytiger )
559559{
560560   dooyong_state *state = screen.machine().driver_data<dooyong_state>();
561   bitmap->fill(get_black_pen(screen.machine()), *cliprect);
562   screen.machine().priority_bitmap->fill(0, *cliprect);
561   bitmap->fill(get_black_pen(screen.machine()), cliprect);
562   screen.machine().priority_bitmap->fill(0, cliprect);
563563
564564   if (state->m_flytiger_pri)
565565   {
r13798r13799
581581SCREEN_UPDATE( bluehawk )
582582{
583583   dooyong_state *state = screen.machine().driver_data<dooyong_state>();
584   bitmap->fill(get_black_pen(screen.machine()), *cliprect);
585   screen.machine().priority_bitmap->fill(0, *cliprect);
584   bitmap->fill(get_black_pen(screen.machine()), cliprect);
585   screen.machine().priority_bitmap->fill(0, cliprect);
586586
587587   tilemap_draw(bitmap, cliprect, state->m_bg_tilemap, 0, 1);
588588   tilemap_draw(bitmap, cliprect, state->m_fg_tilemap, 0, 2);
r13798r13799
596596SCREEN_UPDATE( primella )
597597{
598598   dooyong_state *state = screen.machine().driver_data<dooyong_state>();
599   bitmap->fill(get_black_pen(screen.machine()), *cliprect);
599   bitmap->fill(get_black_pen(screen.machine()), cliprect);
600600
601601   tilemap_draw(bitmap, cliprect, state->m_bg_tilemap, 0, 0);
602602   if (state->m_tx_pri) tilemap_draw(bitmap, cliprect, state->m_tx_tilemap, 0, 0);
r13798r13799
608608SCREEN_UPDATE( rshark )
609609{
610610   dooyong_state *state = screen.machine().driver_data<dooyong_state>();
611   bitmap->fill(get_black_pen(screen.machine()), *cliprect);
612   screen.machine().priority_bitmap->fill(0, *cliprect);
611   bitmap->fill(get_black_pen(screen.machine()), cliprect);
612   screen.machine().priority_bitmap->fill(0, cliprect);
613613
614614   tilemap_draw(bitmap, cliprect, state->m_bg_tilemap, 0, 1);
615615   tilemap_draw(bitmap, cliprect, state->m_bg2_tilemap, 0, (state->m_rshark_pri ? 2 : 1));
r13798r13799
623623SCREEN_UPDATE( popbingo )
624624{
625625   dooyong_state *state = screen.machine().driver_data<dooyong_state>();
626   bitmap->fill(get_black_pen(screen.machine()), *cliprect);
627   screen.machine().priority_bitmap->fill(0, *cliprect);
626   bitmap->fill(get_black_pen(screen.machine()), cliprect);
627   screen.machine().priority_bitmap->fill(0, cliprect);
628628
629629   tilemap_draw(bitmap, cliprect, state->m_bg_tilemap, 0, 1);
630630
src/mame/video/brkthru.c
r13798r13799
166166#endif
167167
168168
169static void draw_sprites( running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect, int prio )
169static void draw_sprites( running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect, int prio )
170170{
171171   brkthru_state *state = machine.driver_data<brkthru_state>();
172172   int offs;
src/mame/video/williams.c
r13798r13799
183183      pens[x] = state->m_palette_lookup[screen.machine().generic.paletteram.u8[x]];
184184
185185   /* loop over rows */
186   for (y = cliprect->min_y; y <= cliprect->max_y; y++)
186   for (y = cliprect.min_y; y <= cliprect.max_y; y++)
187187   {
188188      UINT8 *source = &state->m_videoram[y];
189189      UINT32 *dest = &bitmap->pix32(y);
190190
191191      /* loop over columns */
192      for (x = cliprect->min_x & ~1; x <= cliprect->max_x; x += 2)
192      for (x = cliprect.min_x & ~1; x <= cliprect.max_x; x += 2)
193193      {
194194         int pix = source[(x/2) * 256];
195195         dest[x+0] = pens[pix >> 4];
r13798r13799
211211      pens[x] = state->m_palette_lookup[screen.machine().generic.paletteram.u8[x]];
212212
213213   /* if we're blitting from the top, start with a 0 for color 0 */
214   if (cliprect->min_y == screen.visible_area().min_y || !(state->m_blaster_video_control & 1))
214   if (cliprect.min_y == screen.visible_area().min_y || !(state->m_blaster_video_control & 1))
215215      state->m_blaster_color0 = state->m_palette_lookup[state->m_blaster_palette_0[0] ^ 0xff];
216216
217217   /* loop over rows */
218   for (y = cliprect->min_y; y <= cliprect->max_y; y++)
218   for (y = cliprect.min_y; y <= cliprect.max_y; y++)
219219   {
220220      int erase_behind = state->m_blaster_video_control & state->m_blaster_scanline_control[y] & 2;
221221      UINT8 *source = &state->m_videoram[y];
r13798r13799
226226         state->m_blaster_color0 = state->m_palette_lookup[state->m_blaster_palette_0[y] ^ 0xff];
227227
228228      /* loop over columns */
229      for (x = cliprect->min_x & ~1; x <= cliprect->max_x; x += 2)
229      for (x = cliprect.min_x & ~1; x <= cliprect.max_x; x += 2)
230230      {
231231         int pix = source[(x/2) * 256];
232232
r13798r13799
257257      pens[x] = palette_get_color(screen.machine(), state->m_williams2_fg_color * 16 + x);
258258
259259   /* loop over rows */
260   for (y = cliprect->min_y; y <= cliprect->max_y; y++)
260   for (y = cliprect.min_y; y <= cliprect.max_y; y++)
261261   {
262262      UINT8 *source = &state->m_videoram[y];
263263      UINT32 *dest = &bitmap->pix32(y);
264264
265265      /* loop over columns */
266      for (x = cliprect->min_x & ~1; x <= cliprect->max_x; x += 2)
266      for (x = cliprect.min_x & ~1; x <= cliprect.max_x; x += 2)
267267      {
268268         int pix = source[(x/2) * 256];
269269
src/mame/video/dec8.c
r13798r13799
222222/******************************************************************************/
223223
224224
225static void srdarwin_draw_sprites( running_machine& machine, bitmap_t *bitmap, const rectangle *cliprect, int pri )
225static void srdarwin_draw_sprites( running_machine& machine, bitmap_t *bitmap, const rectangle &cliprect, int pri )
226226{
227227   UINT8 *buffered_spriteram = machine.generic.buffered_spriteram.u8;
228228   int offs;
src/mame/video/fuukifg3.c
r13798r13799
143143
144144***************************************************************************/
145145
146static void draw_sprites( screen_device &screen, bitmap_t *bitmap, const rectangle *cliprect )
146static void draw_sprites( screen_device &screen, bitmap_t *bitmap, const rectangle &cliprect )
147147{
148148   fuuki32_state *state = screen.machine().driver_data<fuuki32_state>();
149149   int offs;
r13798r13799
289289***************************************************************************/
290290
291291/* Wrapper to handle bg and bg2 ttogether */
292static void fuuki32_draw_layer( running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect, int i, int flag, int pri )
292static void fuuki32_draw_layer( running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect, int i, int flag, int pri )
293293{
294294   fuuki32_state *state = machine.driver_data<fuuki32_state>();
295295   int buffer = ((state->m_vregs[0x1e / 4] & 0x0000ffff) & 0x40);
r13798r13799
356356   tilemap_set_scrolly(state->m_tilemap[3], 0, layer2_scrolly);
357357
358358   /* The bg colour is the last pen i.e. 0x1fff */
359   bitmap->fill((0x800 * 4) - 1, *cliprect);
360   screen.machine().priority_bitmap->fill(0, *cliprect);
359   bitmap->fill((0x800 * 4) - 1, cliprect);
360   screen.machine().priority_bitmap->fill(0, cliprect);
361361
362362   fuuki32_draw_layer(screen.machine(), bitmap, cliprect, tm_back,   0, 1);
363363   fuuki32_draw_layer(screen.machine(), bitmap, cliprect, tm_middle, 0, 2);
src/mame/video/tbowl.c
r13798r13799
118118   state->m_bg2yscroll = (state->m_bg2yscroll & 0x00ff) | (data << 8);
119119}
120120
121static void draw_sprites(running_machine &machine, bitmap_t *bitmap,const rectangle *cliprect, int xscroll)
121static void draw_sprites(running_machine &machine, bitmap_t *bitmap,const rectangle &cliprect, int xscroll)
122122{
123123   tbowl_state *state = machine.driver_data<tbowl_state>();
124124   int offs;
r13798r13799
225225   tilemap_set_scrollx(state->m_tx_tilemap,  0, 0 );
226226   tilemap_set_scrolly(state->m_tx_tilemap,  0, 0 );
227227
228   bitmap->fill(0x100, *cliprect); /* is there a register controling the colour? looks odd when screen is blank */
228   bitmap->fill(0x100, cliprect); /* is there a register controling the colour? looks odd when screen is blank */
229229   tilemap_draw(bitmap,cliprect,state->m_bg_tilemap,0,0);
230230   draw_sprites(screen.machine(), bitmap,cliprect, 0);
231231   tilemap_draw(bitmap,cliprect,state->m_bg2_tilemap,0,0);
r13798r13799
245245   tilemap_set_scrollx(state->m_tx_tilemap,  0, 32*8 );
246246   tilemap_set_scrolly(state->m_tx_tilemap,  0, 0 );
247247
248   bitmap->fill(0x100, *cliprect); /* is there a register controling the colour? looks odd when screen is blank */
248   bitmap->fill(0x100, cliprect); /* is there a register controling the colour? looks odd when screen is blank */
249249   tilemap_draw(bitmap,cliprect,state->m_bg_tilemap,0,0);
250250   draw_sprites(screen.machine(), bitmap,cliprect, 32*8);
251251   tilemap_draw(bitmap,cliprect,state->m_bg2_tilemap,0,0);
src/mame/video/battlane.c
r13798r13799
148148   state->m_screen_bitmap = auto_bitmap_alloc(machine, 32 * 8, 32 * 8, BITMAP_FORMAT_INDEXED8);
149149}
150150
151static void draw_sprites( running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect )
151static void draw_sprites( running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect )
152152{
153153   battlane_state *state = machine.driver_data<battlane_state>();
154154   int offs, attr, code, color, sx, sy, flipx, flipy, dy;
src/mame/video/atarigt.c
r13798r13799
529529   mram = state->m_expanded_mram + 0x2000 * ((color_latch >> 6) & 3);
530530
531531   /* now do the nasty blend */
532   for (y = cliprect->min_y; y <= cliprect->max_y; y++)
532   for (y = cliprect.min_y; y <= cliprect.max_y; y++)
533533   {
534534      UINT16 *an = &state->m_an_bitmap->pix16(y);
535535      UINT16 *pf = &state->m_pf_bitmap->pix16(y);
r13798r13799
540540      /* Primal Rage: no TRAM, slightly different priorities */
541541      if (state->m_is_primrage)
542542      {
543         for (x = cliprect->min_x; x <= cliprect->max_x; x++)
543         for (x = cliprect.min_x; x <= cliprect.max_x; x++)
544544         {
545545            UINT8 pfpri = (pf[x] >> 10) & 7;
546546            UINT8 mopri = mo[x] >> ATARIRLE_PRIORITY_SHIFT;
r13798r13799
574574      /* T-Mek: full TRAM and all effects */
575575      else
576576      {
577         for (x = cliprect->min_x; x <= cliprect->max_x; x++)
577         for (x = cliprect.min_x; x <= cliprect.max_x; x++)
578578         {
579579            UINT8 pfpri = (pf[x] >> 10) & 7;
580580            UINT8 mopri = mo[x] >> ATARIRLE_PRIORITY_SHIFT;
src/mame/video/genesis.c
r13798r13799
221221
222222******************************************************************************/
223223
224void system18_vdp_update( bitmap_t *bitmap, const rectangle *cliprect )
224void system18_vdp_update( bitmap_t *bitmap, const rectangle &cliprect )
225225{
226226   int y;
227227
228228   /* generate the final screen */
229   for (y = cliprect->min_y; y <= cliprect->max_y; y++)
229   for (y = cliprect.min_y; y <= cliprect.max_y; y++)
230230      drawline(&bitmap->pix16(y), y, 0xffff);
231231}
232232
src/mame/video/thepit.c
r13798r13799
232232
233233static void draw_sprites(running_machine &machine,
234234                   bitmap_t *bitmap,
235                   const rectangle *cliprect,
235                   const rectangle &cliprect,
236236                   int priority_to_draw)
237237{
238238   const rectangle spritevisiblearea(2*8+1, 32*8-1, 2*8, 30*8-1);
r13798r13799
273273         /* sprites 0-3 are drawn one pixel down */
274274         if (offs < 16) y++;
275275
276         drawgfx_transpen(bitmap, state->m_flip_screen_x ? &spritevisibleareaflipx : &spritevisiblearea,
276         drawgfx_transpen(bitmap, state->m_flip_screen_x ? spritevisibleareaflipx : spritevisiblearea,
277277               machine.gfx[2 * state->m_graphics_bank + 1],
278278               state->m_spriteram[offs + 1] & 0x3f,
279279               state->m_spriteram[offs + 2],
src/mame/video/rpunch.c
r13798r13799
201201 *
202202 *************************************/
203203
204static void draw_sprites(running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect, int start, int stop)
204static void draw_sprites(running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect, int start, int stop)
205205{
206206   rpunch_state *state = machine.driver_data<rpunch_state>();
207207   UINT16 *spriteram16 = state->m_spriteram;
r13798r13799
239239 *
240240 *************************************/
241241
242static void draw_bitmap(running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect)
242static void draw_bitmap(running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect)
243243{
244244   rpunch_state *state = machine.driver_data<rpunch_state>();
245245   int colourbase;
src/mame/video/cloud9.c
r13798r13799
256256   int x, y, offs;
257257
258258   /* draw the sprites */
259   state->m_spritebitmap->fill(0x00, *cliprect);
259   state->m_spritebitmap->fill(0x00, cliprect);
260260   for (offs = 0; offs < 0x20; offs++)
261261      if (spriteaddr[offs + 0x00] != 0)
262262      {
r13798r13799
273273      }
274274
275275   /* draw the bitmap to the screen, looping over Y */
276   for (y = cliprect->min_y; y <= cliprect->max_y; y++)
276   for (y = cliprect.min_y; y <= cliprect.max_y; y++)
277277   {
278278      UINT16 *dst = &bitmap->pix16(y);
279279
280280      /* if we're in the VBLANK region, just fill with black */
281281      if (~state->m_syncprom[y] & 2)
282282      {
283         for (x = cliprect->min_x; x <= cliprect->max_x; x++)
283         for (x = cliprect.min_x; x <= cliprect.max_x; x++)
284284            dst[x] = black;
285285      }
286286
r13798r13799
296296         src[1] = &state->m_videoram[0x0000 | (effy * 64)];
297297
298298         /* loop over X */
299         for (x = cliprect->min_x; x <= cliprect->max_x; x++)
299         for (x = cliprect.min_x; x <= cliprect.max_x; x++)
300300         {
301301            /* if we're in the HBLANK region, just store black */
302302            if (x >= 256)
src/mame/video/asuka.c
r13798r13799
3030   layer[1] = layer[0] ^ 1;
3131   layer[2] = 2;
3232
33   screen.machine().priority_bitmap->fill(0, *cliprect);
33   screen.machine().priority_bitmap->fill(0, cliprect);
3434
3535   /* Ensure screen blanked even when bottom layer not drawn due to disable bit */
36   bitmap->fill(0, *cliprect);
36   bitmap->fill(0, cliprect);
3737
3838   tc0100scn_tilemap_draw(state->m_tc0100scn, bitmap, cliprect, layer[0], TILEMAP_DRAW_OPAQUE, 1);
3939   tc0100scn_tilemap_draw(state->m_tc0100scn, bitmap, cliprect, layer[1], 0, 2);
r13798r13799
5656   layer[1] = layer[0] ^ 1;
5757   layer[2] = 2;
5858
59   screen.machine().priority_bitmap->fill(0, *cliprect);
59   screen.machine().priority_bitmap->fill(0, cliprect);
6060
6161   /* Ensure screen blanked even when bottom layer not drawn due to disable bit */
62   bitmap->fill(0, *cliprect);
62   bitmap->fill(0, cliprect);
6363
6464   tc0100scn_tilemap_draw(state->m_tc0100scn, bitmap, cliprect, layer[0], TILEMAP_DRAW_OPAQUE, 1);
6565   tc0100scn_tilemap_draw(state->m_tc0100scn, bitmap, cliprect, layer[1], 0, 2);
src/mame/video/triplhnt.c
r13798r13799
3232}
3333
3434
35static void draw_sprites(running_machine &machine, bitmap_t* bitmap, const rectangle* cliprect)
35static void draw_sprites(running_machine &machine, bitmap_t* bitmap, const rectangle &cliprect)
3636{
3737   triplhnt_state *state = machine.driver_data<triplhnt_state>();
3838   int i;
r13798r13799
7878         2 * code + state->m_sprite_bank, 0, code & 8, 0,
7979         rect.min_x, rect.min_y);
8080
81      if (rect.min_x < cliprect->min_x)
82         rect.min_x = cliprect->min_x;
83      if (rect.min_y < cliprect->min_y)
84         rect.min_y = cliprect->min_y;
85      if (rect.max_x > cliprect->max_x)
86         rect.max_x = cliprect->max_x;
87      if (rect.max_y > cliprect->max_y)
88         rect.max_y = cliprect->max_y;
81      if (rect.min_x < cliprect.min_x)
82         rect.min_x = cliprect.min_x;
83      if (rect.min_y < cliprect.min_y)
84         rect.min_y = cliprect.min_y;
85      if (rect.max_x > cliprect.max_x)
86         rect.max_x = cliprect.max_x;
87      if (rect.max_y > cliprect.max_y)
88         rect.max_y = cliprect.max_y;
8989
9090      /* check for collisions and copy sprite */
9191
src/mame/video/pooyan.c
r13798r13799
157157 *
158158 *************************************/
159159
160static void draw_sprites( running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect )
160static void draw_sprites( running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect )
161161{
162162   pooyan_state *state = machine.driver_data<pooyan_state>();
163163   UINT8 *spriteram = state->m_spriteram;
src/mame/video/rollerg.c
r13798r13799
6464   rollerg_state *state = screen.machine().driver_data<rollerg_state>();
6565   int bg_colorbase = 16;
6666
67   screen.machine().priority_bitmap->fill(0, *cliprect);
68   bitmap->fill(16 * bg_colorbase, *cliprect);
67   screen.machine().priority_bitmap->fill(0, cliprect);
68   bitmap->fill(16 * bg_colorbase, cliprect);
6969   k051316_zoom_draw(state->m_k051316, bitmap, cliprect, 0, 1);
7070   k053245_sprites_draw(state->m_k053244, bitmap, cliprect);
7171   return 0;
src/mame/video/sidepckt.c
r13798r13799
107107
108108***************************************************************************/
109109
110static void draw_sprites(running_machine &machine, bitmap_t *bitmap,const rectangle *cliprect)
110static void draw_sprites(running_machine &machine, bitmap_t *bitmap,const rectangle &cliprect)
111111{
112112   sidepckt_state *state = machine.driver_data<sidepckt_state>();
113113   UINT8 *spriteram = state->m_spriteram;
src/mame/video/wolfpack.c
r13798r13799
131131}
132132
133133
134static void draw_ship(running_machine &machine, bitmap_t* bitmap, const rectangle* cliprect)
134static void draw_ship(running_machine &machine, bitmap_t* bitmap, const rectangle &cliprect)
135135{
136136   wolfpack_state *state = machine.driver_data<wolfpack_state>();
137137   static const UINT32 scaler[] =
r13798r13799
167167}
168168
169169
170static void draw_torpedo(running_machine &machine, bitmap_t* bitmap, const rectangle* cliprect)
170static void draw_torpedo(running_machine &machine, bitmap_t* bitmap, const rectangle &cliprect)
171171{
172172   wolfpack_state *state = machine.driver_data<wolfpack_state>();
173173   int count = 0;
r13798r13799
201201}
202202
203203
204static void draw_pt(running_machine &machine, bitmap_t* bitmap, const rectangle* cliprect)
204static void draw_pt(running_machine &machine, bitmap_t* bitmap, const rectangle &cliprect)
205205{
206206   wolfpack_state *state = machine.driver_data<wolfpack_state>();
207   rectangle rect = *cliprect;
207   rectangle rect = cliprect;
208208
209209   if (!(state->m_pt_pic & 0x20))
210210      rect.min_x = 256;
r13798r13799
212212   if (!(state->m_pt_pic & 0x10))
213213      rect.max_x = 255;
214214
215   drawgfx_transpen(bitmap, &rect,
215   drawgfx_transpen(bitmap, rect,
216216      machine.gfx[2],
217217      state->m_pt_pic,
218218      0,
r13798r13799
220220      2 * state->m_pt_horz,
221221      state->m_pt_pos_select ? 0x70 : 0xA0, 0);
222222
223   drawgfx_transpen(bitmap, &rect,
223   drawgfx_transpen(bitmap, rect,
224224      machine.gfx[2],
225225      state->m_pt_pic,
226226      0,
r13798r13799
230230}
231231
232232
233static void draw_water(colortable_t *colortable, bitmap_t* bitmap, const rectangle* cliprect)
233static void draw_water(colortable_t *colortable, bitmap_t* bitmap, const rectangle &cliprect)
234234{
235   rectangle rect = *cliprect;
235   rectangle rect = cliprect;
236236
237237   int x;
238238   int y;
r13798r13799
267267                                                        color < 0xb8 ? color + 0x48 : 0xff,
268268                                                        color < 0xb8 ? color + 0x48 : 0xff));
269269
270   bitmap->fill(state->m_video_invert, *cliprect);
270   bitmap->fill(state->m_video_invert, cliprect);
271271
272272   for (i = 0; i < 8; i++)
273273      for (j = 0; j < 32; j++)
r13798r13799
300300
301301   state->m_helper->fill(0);
302302
303   draw_ship(screen.machine(), state->m_helper, &state->m_helper->cliprect());
303   draw_ship(screen.machine(), state->m_helper, state->m_helper->cliprect());
304304
305305   for (y = 128; y < 224 - state->m_torpedo_v; y++)
306306   {
src/mame/video/pirates.c
r13798r13799
7474
7575
7676
77static void draw_sprites(running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect)
77static void draw_sprites(running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect)
7878{
7979   pirates_state *state = machine.driver_data<pirates_state>();
8080   const gfx_element *gfx = machine.gfx[1];
src/mame/video/tankbatt.c
r13798r13799
8282   state->m_bg_tilemap = tilemap_create(machine, get_bg_tile_info, tilemap_scan_rows, 8, 8, 32, 32);
8383}
8484
85static void draw_bullets(running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect)
85static void draw_bullets(running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect)
8686{
8787   tankbatt_state *state = machine.driver_data<tankbatt_state>();
8888   int offs;
src/mame/video/exerion.c
r13798r13799
234234 *
235235 *************************************/
236236
237static void draw_background( running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect)
237static void draw_background( running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect)
238238{
239239   exerion_state *state = machine.driver_data<exerion_state>();
240240   int x, y;
241241
242242   /* loop over all visible scanlines */
243   for (y = cliprect->min_y; y <= cliprect->max_y; y++)
243   for (y = cliprect.min_y; y <= cliprect.max_y; y++)
244244   {
245245      UINT16 *src0 = &state->m_background_gfx[0][state->m_background_latches[1] * 256];
246246      UINT16 *src1 = &state->m_background_gfx[1][state->m_background_latches[3] * 256];
r13798r13799
266266      if (!state->m_cocktail_flip)
267267      {
268268         /* skip processing anything that's not visible */
269         for (x = BACKGROUND_X_START; x < cliprect->min_x; x++)
269         for (x = BACKGROUND_X_START; x < cliprect.min_x; x++)
270270         {
271271            if (!(++xoffs0 & 0x1f)) start0++, stop0++;
272272            if (!(++xoffs1 & 0x1f)) start1++, stop1++;
r13798r13799
275275         }
276276
277277         /* draw the rest of the scanline fully */
278         for (x = cliprect->min_x; x <= cliprect->max_x; x++)
278         for (x = cliprect.min_x; x <= cliprect.max_x; x++)
279279         {
280280            UINT16 combined = 0;
281281            UINT8 lookupval;
r13798r13799
303303      else
304304      {
305305         /* skip processing anything that's not visible */
306         for (x = BACKGROUND_X_START; x < cliprect->min_x; x++)
306         for (x = BACKGROUND_X_START; x < cliprect.min_x; x++)
307307         {
308308            if (!(xoffs0-- & 0x1f)) start0++, stop0++;
309309            if (!(xoffs1-- & 0x1f)) start1++, stop1++;
r13798r13799
312312         }
313313
314314         /* draw the rest of the scanline fully */
315         for (x = cliprect->min_x; x <= cliprect->max_x; x++)
315         for (x = cliprect.min_x; x <= cliprect.max_x; x++)
316316         {
317317            UINT16 combined = 0;
318318            UINT8 lookupval;
r13798r13799
339339      }
340340
341341      /* draw the scanline */
342      draw_scanline16(bitmap, cliprect->min_x, y, cliprect->max_x - cliprect->min_x + 1, &scanline[cliprect->min_x], NULL);
342      draw_scanline16(bitmap, cliprect.min_x, y, cliprect.max_x - cliprect.min_x + 1, &scanline[cliprect.min_x], NULL);
343343   }
344344}
345345
r13798r13799
402402   }
403403
404404   /* draw the visible text layer */
405   for (sy = cliprect->min_y/8; sy <= cliprect->max_y/8; sy++)
405   for (sy = cliprect.min_y/8; sy <= cliprect.max_y/8; sy++)
406406      for (sx = VISIBLE_X_MIN/8; sx < VISIBLE_X_MAX/8; sx++)
407407      {
408408         int x = state->m_cocktail_flip ? (63*8 - 8*sx) : 8*sx;
src/mame/video/wrally.c
r13798r13799
104104    in the range 0x8-0xf are used.
105105*/
106106
107static void draw_sprites(running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect, int priority)
107static void draw_sprites(running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect, int priority)
108108{
109109   wrally_state *state = machine.driver_data<wrally_state>();
110110   int i, px, py;
r13798r13799
144144
145145            int gfx_py = yflip ? (gfx->height - 1 - py) : py;
146146
147            if ((ypos < cliprect->min_y) || (ypos > cliprect->max_y)) continue;
147            if ((ypos < cliprect.min_y) || (ypos > cliprect.max_y)) continue;
148148
149149            for (px = 0; px < gfx->width; px++){
150150               /* get current pixel */
r13798r13799
160160               /* pens 8..15 are used to select a palette */
161161               if ((gfx_pen < 8) || (gfx_pen >= 16)) continue;
162162
163               if ((xpos < cliprect->min_x) || (xpos > cliprect->max_x)) continue;
163               if ((xpos < cliprect.min_x) || (xpos > cliprect.max_x)) continue;
164164
165165               /* modify the color of the tile */
166166               *pixel = src_color + (gfx_pen-8)*1024;
src/mame/video/segas18.c
r13798r13799
116116 *
117117 *************************************/
118118
119static void draw_vdp(screen_device &screen, bitmap_t *bitmap, const rectangle *cliprect, int priority)
119static void draw_vdp(screen_device &screen, bitmap_t *bitmap, const rectangle &cliprect, int priority)
120120{
121121   segas1x_state *state = screen.machine().driver_data<segas1x_state>();
122122   int x, y;
123123   bitmap_t *priority_bitmap = screen.machine().priority_bitmap;
124124
125   for (y = cliprect->min_y; y <= cliprect->max_y; y++)
125   for (y = cliprect.min_y; y <= cliprect.max_y; y++)
126126   {
127127      UINT16 *src = &state->m_tmp_bitmap->pix16(y);
128128      UINT16 *dst = &bitmap->pix16(y);
129129      UINT8 *pri = &priority_bitmap->pix8(y);
130130
131      for (x = cliprect->min_x; x <= cliprect->max_x; x++)
131      for (x = cliprect.min_x; x <= cliprect.max_x; x++)
132132      {
133133         UINT16 pix = src[x];
134134         if (pix != 0xffff)
r13798r13799
202202   /* if no drawing is happening, fill with black and get out */
203203   if (!segaic16_display_enable)
204204   {
205      bitmap->fill(get_black_pen(screen.machine()), *cliprect);
205      bitmap->fill(get_black_pen(screen.machine()), cliprect);
206206      return 0;
207207   }
208208
r13798r13799
211211      system18_vdp_update(state->m_tmp_bitmap, cliprect);
212212
213213   /* reset priorities */
214   screen.machine().priority_bitmap->fill(0, *cliprect);
214   screen.machine().priority_bitmap->fill(0, cliprect);
215215
216216   /* draw background opaquely first, not setting any priorities */
217217   segaic16_tilemap_draw(screen, bitmap, cliprect, 0, SEGAIC16_TILEMAP_BACKGROUND, 0 | TILEMAP_DRAW_OPAQUE, 0x00);
r13798r13799
239239#if DEBUG_VDP
240240   if (state->m_vdp_enable && screen.machine().input().code_pressed(KEYCODE_V))
241241   {
242      bitmap->fill(get_black_pen(screen.machine()), *cliprect);
242      bitmap->fill(get_black_pen(screen.machine()), cliprect);
243243      update_system18_vdp(bitmap, cliprect);
244244   }
245245   if (vdp_enable && screen.machine().input().code_pressed(KEYCODE_B))
src/mame/video/crospang.c
r13798r13799
140140*/
141141
142142/* jumpkids / tumbleb.c! */
143static void draw_sprites( running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect )
143static void draw_sprites( running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect )
144144{
145145   crospang_state *state = machine.driver_data<crospang_state>();
146146   int offs;
src/mame/video/darkmist.c
r13798r13799
141141   tilemap_set_scrollx(state->m_fgtilemap, 0, DM_GETSCROLL(0xa));
142142   tilemap_set_scrolly(state->m_fgtilemap, 0, DM_GETSCROLL(0xe));
143143
144   bitmap->fill(get_black_pen(screen.machine()), *cliprect);
144   bitmap->fill(get_black_pen(screen.machine()), cliprect);
145145
146146   if(state->m_hw & DISPLAY_BG)
147147      tilemap_draw(bitmap,cliprect,state->m_bgtilemap, 0,0);
src/mame/video/gp9001.c
r13798r13799
758758    Sprite Handlers
759759***************************************************************************/
760760
761void gp9001vdp_device::draw_sprites( running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect, const UINT8* primap )
761void gp9001vdp_device::draw_sprites( running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect, const UINT8* primap )
762762{
763763   const gfx_element *gfx = machine.gfx[tile_region+1];
764764
r13798r13799
914914                     {
915915                        int drawxx = xx+sx;
916916
917                        if (drawxx>=cliprect->min_x && drawxx<=cliprect->max_x && drawyy>=cliprect->min_y && drawyy<=cliprect->max_y)
917                        if (drawxx>=cliprect.min_x && drawxx<=cliprect.max_x && drawyy>=cliprect.min_y && drawyy<=cliprect.max_y)
918918                        {
919919                           UINT8 pix = srcdata[count];
920920                           UINT16* dstptr = &bitmap->pix16(drawyy, drawxx);
r13798r13799
10041004
10051005static const UINT8 batsugun_prienable0[16]={ 1,    1,    1,    1,    1,    1,    1,    1,    1,    1,    1,    1,    1,    1,    1,    1 };
10061006
1007void gp9001vdp_device::gp9001_render_vdp(running_machine& machine, bitmap_t* bitmap, const rectangle* cliprect)
1007void gp9001vdp_device::gp9001_render_vdp(running_machine& machine, bitmap_t* bitmap, const rectangle &cliprect)
10081008{
10091009   if (gp9001_gfxrom_is_banked && gp9001_gfxrom_bank_dirty)
10101010   {
src/mame/video/ajax.c
r13798r13799
9393
9494   k052109_tilemap_update(state->m_k052109);
9595
96   screen.machine().priority_bitmap->fill(0, *cliprect);
96   screen.machine().priority_bitmap->fill(0, cliprect);
9797
98   bitmap->fill(get_black_pen(screen.machine()), *cliprect);
98   bitmap->fill(get_black_pen(screen.machine()), cliprect);
9999   k052109_tilemap_draw(state->m_k052109, bitmap, cliprect, 2, 0, 1);
100100   if (state->m_priority)
101101   {
src/mame/video/gp9001.h
r13798r13799
5454   UINT16 gp9001_gfxrom_bank[8];      /* Batrider object bank */
5555
5656
57   void draw_sprites( running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect, const UINT8* primap );
57   void draw_sprites( running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect, const UINT8* primap );
5858   void gp9001_draw_custom_tilemap(running_machine& machine, bitmap_t* bitmap, tilemap_t* tilemap, const UINT8* priremap, const UINT8* pri_enable );
59   void gp9001_render_vdp(running_machine& machine, bitmap_t* bitmap, const rectangle* cliprect);
59   void gp9001_render_vdp(running_machine& machine, bitmap_t* bitmap, const rectangle &cliprect);
6060   void gp9001_screen_eof(void);
6161   void create_tilemaps(int region);
6262   void init_scroll_regs(void);
src/mame/video/funybubl.c
r13798r13799
2828{
2929}
3030
31static void draw_sprites( running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect )
31static void draw_sprites( running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect )
3232{
3333   funybubl_state *state = machine.driver_data<funybubl_state>();
3434   UINT8 *source = &state->m_banked_vram[0x2000 - 0x20];
r13798r13799
7979   int x, y, offs;
8080   offs = 0;
8181
82   bitmap->fill(get_black_pen(screen.machine()), *cliprect);
82   bitmap->fill(get_black_pen(screen.machine()), cliprect);
8383
8484   /* tilemap .. convert it .. banking makes it slightly more annoying but still easy */
8585   for (y = 0; y < 32; y++)
src/mame/video/tutankhm.c
r13798r13799
6969
7070   get_pens(screen.machine(), pens);
7171
72   for (y = cliprect->min_y; y <= cliprect->max_y; y++)
72   for (y = cliprect.min_y; y <= cliprect.max_y; y++)
7373   {
7474      UINT32 *dst = &bitmap->pix32(y);
7575
76      for (x = cliprect->min_x; x <= cliprect->max_x; x++)
76      for (x = cliprect.min_x; x <= cliprect.max_x; x++)
7777      {
7878         UINT8 effx = x ^ xorx;
7979         UINT8 yscroll = (effx < 192) ? *state->m_scroll : 0;
src/mame/video/nmk16.c
r13798r13799
425425
426426// manybloc uses extra flip bits on the sprites, but these break other games
427427
428static void nmk16_draw_sprites(running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect, int priority)
428static void nmk16_draw_sprites(running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect, int priority)
429429{
430430   nmk16_state *state = machine.driver_data<nmk16_state>();
431431   int offs;
r13798r13799
476476   }
477477}
478478
479static void nmk16_draw_sprites_flipsupported(running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect, int priority)
479static void nmk16_draw_sprites_flipsupported(running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect, int priority)
480480{
481481   nmk16_state *state = machine.driver_data<nmk16_state>();
482482   int offs;
r13798r13799
632632   nmk16_state *state = screen.machine().driver_data<nmk16_state>();
633633   int y1;
634634   int i=16;
635   rectangle bgclip = *cliprect;
635   rectangle bgclip = cliprect;
636636
637637   // the hardware supports per-scanline X *and* Y scroll which isn't
638638   // supported by tilemaps so we have to draw the tilemap one line at a time
639   y1 = cliprect->min_y;
639   y1 = cliprect.min_y;
640640
641641   if (!state->m_simple_scroll)
642642   {
643      while (y1 <= cliprect->max_y)
643      while (y1 <= cliprect.max_y)
644644      {
645645         int const yscroll = state->m_gunnail_scrollramy[0] + state->m_gunnail_scrollramy[y1];
646646         int tilemap_bank_select;
r13798r13799
664664         tilemap_set_scrolly(bg_tilemap, 0, yscroll);
665665         tilemap_set_scrollx(bg_tilemap,(i + yscroll) & 0x1ff, state->m_gunnail_scrollram[0] + state->m_gunnail_scrollram[i] - state->m_videoshift);
666666
667         tilemap_draw(bitmap,&bgclip,bg_tilemap,0,0);
667         tilemap_draw(bitmap,bgclip,bg_tilemap,0,0);
668668
669669         y1++;
670670         i++;
r13798r13799
727727            int numtile = data&0xfff;
728728            int color = (data&0xf000)>>12;
729729
730            drawgfx_opaque(state->m_background_bitmap,0,screen.machine().gfx[3],
730            drawgfx_opaque(state->m_background_bitmap,state->m_background_bitmap->cliprect(),screen.machine().gfx[3],
731731                  numtile,
732732                  color,
733733                  0,0,   /* no flip */
r13798r13799
736736            data = tilerom[offs+0x1000+bank];
737737            numtile = data&0xfff;
738738            color = (data&0xf000)>>12;
739            drawgfx_opaque(state->m_background_bitmap,0,screen.machine().gfx[3],
739            drawgfx_opaque(state->m_background_bitmap,state->m_background_bitmap->cliprect(),screen.machine().gfx[3],
740740                  numtile,
741741                  color,
742742                  0,0,   /* no flip */
r13798r13799
898898
899899***************************************************************************/
900900
901static void video_update(running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect,
901static void video_update(running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect,
902902   int dsw_flipscreen,         // 1 = Horizontal and vertical screen flip are hardwired to 2 dip switches
903903   int xoffset, int yoffset,   // bg_tilemap0 offsets
904904   int attr_mask            // "sprite active" mask
r13798r13799
933933   tilemap_draw(bitmap,cliprect,state->m_tx_tilemap,0,0);
934934}
935935
936static void redhawki_video_update(running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect   )
936static void redhawki_video_update(running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect   )
937937{
938938   nmk16_state *state = machine.driver_data<nmk16_state>();
939939
src/mame/video/m10.c
r13798r13799
145145   static const int xpos[4] = { 4*8, 26*8, 7*8, 6*8};
146146   int i;
147147
148   bitmap->fill(0, *cliprect);
148   bitmap->fill(0, cliprect);
149149
150150   for (i = 0; i < 4; i++)
151151      if (state->m_flip)
src/mame/drivers/bfcobra.c
r13798r13799
372372      lorescol = state->m_col8bit;
373373   }
374374
375   for (y = cliprect->min_y; y <= cliprect->max_y; ++y)
375   for (y = cliprect.min_y; y <= cliprect.max_y; ++y)
376376   {
377377      UINT16 y_offset = (y + state->m_v_scroll) * 256;
378378      src = &state->m_video_ram[offset + y_offset];
379379      dest = &bitmap->pix32(y);
380380
381      for (x = cliprect->min_x; x <= cliprect->max_x / 2; ++x)
381      for (x = cliprect.min_x; x <= cliprect.max_x / 2; ++x)
382382      {
383383         UINT8 x_offset = x + state->m_h_scroll;
384384         UINT8 pen = *(src + x_offset);
src/mame/drivers/pasha2.c
r13798r13799
341341   /* 2 512x256 bitmaps */
342342
343343   count = 0;
344   for (y = 0; y <= cliprect->max_y; y++)
344   for (y = 0; y <= cliprect.max_y; y++)
345345   {
346346      for (x = 0; x < 512 / 2; x++)
347347      {
348         if (x * 2 < cliprect->max_x)
348         if (x * 2 < cliprect.max_x)
349349         {
350350            color = (state->m_bitmap0[count + (state->m_vbuffer ^ 1) * 0x20000 / 2] & 0xff00) >> 8;
351351            bitmap->pix16(y, x * 2 + 0) = color + 0x100;
r13798r13799
359359   }
360360
361361   count = 0;
362   for (y = 0; y <= cliprect->max_y; y++)
362   for (y = 0; y <= cliprect.max_y; y++)
363363   {
364364      for (x = 0; x < 512 / 2; x++)
365365      {
366         if (x * 2 < cliprect->max_x)
366         if (x * 2 < cliprect.max_x)
367367         {
368368            color = state->m_bitmap1[count + (state->m_vbuffer ^ 1) * 0x20000 / 2] & 0xff;
369369            if (color != 0)
src/mame/drivers/magicard.c
r13798r13799
385385   int x,y;
386386   UINT32 count;
387387
388   bitmap->fill(get_black_pen(screen.machine()), *cliprect); //TODO
388   bitmap->fill(get_black_pen(screen.machine()), cliprect); //TODO
389389
390390   if(!(SCC_DE_VREG)) //display enable
391391      return 0;
src/mame/drivers/murogem.c
r13798r13799
205205   int xx,yy,count;
206206   count = 0x000;
207207
208   bitmap->fill(0, *cliprect);
208   bitmap->fill(0, cliprect);
209209
210210   for (yy=0;yy<32;yy++)
211211   {
src/mame/drivers/snowbros.c
r13798r13799
8686   device_t *pandora = screen.machine().device("pandora");
8787
8888   /* This clears & redraws the entire screen each pass */
89   bitmap->fill(0xf0, *cliprect);
89   bitmap->fill(0xf0, cliprect);
9090   pandora_update(pandora, bitmap, cliprect);
9191   return 0;
9292}
src/mame/drivers/cntsteer.c
r13798r13799
146146[2] xxxx xxxx X attribute
147147[3] xxxx xxxx sprite number
148148*/
149static void zerotrgt_draw_sprites( running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect )
149static void zerotrgt_draw_sprites( running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect )
150150{
151151   cntsteer_state *state = machine.driver_data<cntsteer_state>();
152152   int offs;
r13798r13799
204204     ---- --xx tile bank
205205*/
206206
207static void cntsteer_draw_sprites( running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect )
207static void cntsteer_draw_sprites( running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect )
208208{
209209   cntsteer_state *state = machine.driver_data<cntsteer_state>();
210210   int offs;
r13798r13799
258258   cntsteer_state *state = screen.machine().driver_data<cntsteer_state>();
259259
260260   if (state->m_disable_roz)
261      bitmap->fill(screen.machine().pens[8 * state->m_bg_color_bank], *cliprect);
261      bitmap->fill(screen.machine().pens[8 * state->m_bg_color_bank], cliprect);
262262   else
263263   {
264264      int p1, p2, p3, p4;
r13798r13799
309309   cntsteer_state *state = screen.machine().driver_data<cntsteer_state>();
310310
311311   if (state->m_disable_roz)
312      bitmap->fill(screen.machine().pens[8 * state->m_bg_color_bank], *cliprect);
312      bitmap->fill(screen.machine().pens[8 * state->m_bg_color_bank], cliprect);
313313   else
314314   {
315315      int p1, p2, p3, p4;
src/mame/drivers/csplayh5.c
r13798r13799
7070static SCREEN_UPDATE( csplayh5 )
7171{
7272   csplayh5_state *state = screen.machine().driver_data<csplayh5_state>();
73   bitmap->fill(get_black_pen(screen.machine()), *cliprect);
73   bitmap->fill(get_black_pen(screen.machine()), cliprect);
7474
7575   copybitmap(bitmap, state->m_vdp0_bitmap, 0, 0, 0, 0, cliprect);
7676
src/mame/drivers/dblewing.c
r13798r13799
101101   flip_screen_set(screen.machine(), BIT(flip, 7));
102102   deco16ic_pf_update(state->m_deco_tilegen1, state->m_pf1_rowscroll, state->m_pf2_rowscroll);
103103
104   bitmap->fill(0, *cliprect); /* not Confirmed */
104   bitmap->fill(0, cliprect); /* not Confirmed */
105105   screen.machine().priority_bitmap->fill(0);
106106
107107   deco16ic_tilemap_2_draw(state->m_deco_tilegen1, bitmap, cliprect, 0, 2);
src/mame/drivers/discoboy.c
r13798r13799
7676{
7777}
7878
79static void draw_sprites( running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect )
79static void draw_sprites( running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect )
8080{
8181   discoboy_state *state = machine.driver_data<discoboy_state>();
8282   int flipscreen = 0;
r13798r13799
157157      palette_set_color(screen.machine(), (i / 2) + 0x400, MAKE_RGB(r, g, b));
158158   }
159159
160   bitmap->fill(0x3ff, *cliprect);
160   bitmap->fill(0x3ff, cliprect);
161161
162162   for (y = 0; y < 32; y++)
163163   {
src/mame/drivers/mediagx.c
r13798r13799
201201   }
202202}
203203
204static void draw_char(bitmap_t *bitmap, const rectangle *cliprect, const gfx_element *gfx, int ch, int att, int x, int y)
204static void draw_char(bitmap_t *bitmap, const rectangle &cliprect, const gfx_element *gfx, int ch, int att, int x, int y)
205205{
206206   int i,j;
207207   const UINT8 *dp;
r13798r13799
227227   }
228228}
229229
230static void draw_framebuffer(running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect)
230static void draw_framebuffer(running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect)
231231{
232232   mediagx_state *state = machine.driver_data<mediagx_state>();
233233   int i, j;
r13798r13799
320320   }
321321}
322322
323static void draw_cga(running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect)
323static void draw_cga(running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect)
324324{
325325   mediagx_state *state = machine.driver_data<mediagx_state>();
326326   int i, j;
r13798r13799
347347static SCREEN_UPDATE(mediagx)
348348{
349349   mediagx_state *state = screen.machine().driver_data<mediagx_state>();
350   bitmap->fill(0, *cliprect);
350   bitmap->fill(0, cliprect);
351351
352352   draw_framebuffer(screen.machine(), bitmap, cliprect);
353353
src/mame/drivers/mwarr.c
r13798r13799
395395   state->save_item(NAME(state->m_sprites_buffer));
396396}
397397
398static void draw_sprites( running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect )
398static void draw_sprites( running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect )
399399{
400400   mwarr_state *state = machine.driver_data<mwarr_state>();
401401   const UINT16 *source = state->m_sprites_buffer + 0x800 - 4;
r13798r13799
471471   mwarr_state *state = screen.machine().driver_data<mwarr_state>();
472472   int i;
473473
474   screen.machine().priority_bitmap->fill(0, *cliprect);
474   screen.machine().priority_bitmap->fill(0, cliprect);
475475
476476   if (BIT(state->m_vidattrram[6], 0))
477477   {
src/mame/drivers/galpani3.c
r13798r13799
210210   UINT16 pixdata1;
211211   const pen_t *paldata = screen.machine().pens;
212212
213   bitmap->fill(0x0000, *cliprect);
213   bitmap->fill(0x0000, cliprect);
214214
215215   {
216216      int drawy, drawx;
r13798r13799
352352      }
353353   }
354354
355   state->m_sprite_bitmap_1->fill(0x0000, *cliprect);
355   state->m_sprite_bitmap_1->fill(0x0000, cliprect);
356356
357357   state->m_spritegen->skns_draw_sprites(screen.machine(), state->m_sprite_bitmap_1, cliprect, state->m_spriteram32, screen.machine().generic.spriteram_size, screen.machine().region("gfx1")->base(), screen.machine().region ("gfx1")->bytes(), state->m_spc_regs );
358358
src/mame/drivers/itgambl2.c
r13798r13799
114114
115115   popmessage("%d %d %04x",state->m_test_x,state->m_test_y,state->m_start_offs);
116116
117   bitmap->fill(get_black_pen(screen.machine()), *cliprect);
117   bitmap->fill(get_black_pen(screen.machine()), cliprect);
118118
119119   count = (state->m_start_offs);
120120
src/mame/drivers/bestleag.c
r13798r13799
107107      include several similiarities with other Playmark games (including
108108      the sprite end code and the data being offset (i.e. spriteram starting from 0x16/2))
109109*/
110static void draw_sprites(running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect)
110static void draw_sprites(running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect)
111111{
112112   bestleag_state *state = machine.driver_data<bestleag_state>();
113113   UINT16 *spriteram16 = state->m_spriteram;
src/mame/drivers/norautp.c
r13798r13799
571571
572572   count = 0;
573573
574   bitmap->fill(screen.machine().pens[0], *cliprect); //black pen
574   bitmap->fill(screen.machine().pens[0], cliprect); //black pen
575575
576576   for(y = 0; y < 8; y++)
577577   {
src/mame/drivers/ddenlovr.c
r13798r13799
12671267}
12681268
12691269
1270static void copylayer(running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect, int layer )
1270static void copylayer(running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect, int layer )
12711271{
12721272   dynax_state *state = machine.driver_data<dynax_state>();
12731273   int x,y;
r13798r13799
12851285
12861286   if (((state->m_ddenlovr_layer_enable2 << 4) | state->m_ddenlovr_layer_enable) & (1 << layer))
12871287   {
1288      for (y = cliprect->min_y; y <= cliprect->max_y; y++)
1288      for (y = cliprect.min_y; y <= cliprect.max_y; y++)
12891289      {
1290         for (x = cliprect->min_x; x <= cliprect->max_x; x++)
1290         for (x = cliprect.min_x; x <= cliprect.max_x; x++)
12911291         {
12921292            int pen = state->m_ddenlovr_pixmap[layer][512 * ((y + scrolly) & 0x1ff) + ((x + scrollx) & 0x1ff)];
12931293            if ((pen & transmask) != transpen)
r13798r13799
13411341   if (screen.machine().input().code_pressed_once(KEYCODE_F)) { base++; while ((gfx[base] & 0xf0) != 0x30) base++; }
13421342#endif
13431343
1344   bitmap->fill(state->m_ddenlovr_bgcolor, *cliprect);
1344   bitmap->fill(state->m_ddenlovr_bgcolor, cliprect);
13451345
13461346#ifdef MAME_DEBUG
13471347   if (screen.machine().input().code_pressed(KEYCODE_Z))
src/mame/drivers/cybertnk.c
r13798r13799
206206   tilemap_set_transparent_pen(state->m_tx_tilemap,0);
207207}
208208
209static void draw_pixel( bitmap_t* bitmap, const rectangle *cliprect, int y, int x, int pen)
209static void draw_pixel( bitmap_t* bitmap, const rectangle &cliprect, int y, int x, int pen)
210210{
211   if (x>cliprect->max_x) return;
212   if (x<cliprect->min_x) return;
213   if (y>cliprect->max_y) return;
214   if (y<cliprect->min_y) return;
211   if (x>cliprect.max_x) return;
212   if (x<cliprect.min_x) return;
213   if (y>cliprect.max_y) return;
214   if (y<cliprect.min_y) return;
215215
216216   bitmap->pix16(y, x) = pen;
217217}
218218
219static UINT32 update_screen(screen_device &screen, bitmap_t *bitmap, const rectangle *cliprect, int screen_shift)
219static UINT32 update_screen(screen_device &screen, bitmap_t *bitmap, const rectangle &cliprect, int screen_shift)
220220{
221221   cybertnk_state *state = screen.machine().driver_data<cybertnk_state>();
222222
223223   tilemap_set_scrolldx(state->m_tx_tilemap, screen_shift, screen_shift);
224224
225225
226   bitmap->fill(get_black_pen(screen.machine()), *cliprect);
226   bitmap->fill(get_black_pen(screen.machine()), cliprect);
227227
228228   {
229229      int i;
r13798r13799
460460
461461         popmessage("%02x %02x %04x %02x",state->m_test_x,state->m_test_y,state->m_start_offs,state->m_color_pen);
462462
463         bitmap->fill(get_black_pen(screen.machine()), *cliprect);
463         bitmap->fill(get_black_pen(screen.machine()), cliprect);
464464
465465         count = (state->m_start_offs);
466466
src/mame/drivers/pinkiri8.c
r13798r13799
213213   //popmessage("%02x",state->m_janshi_crtc_regs[0x0a]);
214214   col_bank = (state->m_janshi_crtc_regs[0x0a] & 0x40) >> 6;
215215
216   bitmap->fill(get_black_pen(screen.machine()), *cliprect);
216   bitmap->fill(get_black_pen(screen.machine()), cliprect);
217217
218218   /* FIXME: color is a bit of a mystery */
219219   {
src/mame/drivers/chanbara.c
r13798r13799
148148   tilemap_set_transparent_pen(state->m_bg_tilemap, 0);
149149}
150150
151static void draw_sprites( running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect )
151static void draw_sprites( running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect )
152152{
153153   chanbara_state *state = machine.driver_data<chanbara_state>();
154154   int offs;
src/mame/drivers/chsuper.c
r13798r13799
6565      {
6666         int tile = ((m_vram[count+1]<<8) | m_vram[count]) & 0xffff;
6767
68         drawgfx_opaque(&bitmap,&cliprect,gfx,tile,0,0,0,x*4,y*8);
68         drawgfx_opaque(&bitmap,cliprect,gfx,tile,0,0,0,x*4,y*8);
6969         count+=2;
7070      }
7171   }
src/mame/drivers/photon2.c
r13798r13799
127127
128128    scr=state->m_spectrum_video_ram;
129129
130   bitmap->fill(state->m_spectrum_port_fe & 0x07, *cliprect);
130   bitmap->fill(state->m_spectrum_port_fe & 0x07, cliprect);
131131
132132    for (y=0; y<192; y++)
133133    {
src/mame/drivers/fcrash.c
r13798r13799
126126   }
127127}
128128
129static void fcrash_render_sprites( running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect )
129static void fcrash_render_sprites( running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect )
130130{
131131   cps_state *state = machine.driver_data<cps_state>();
132132   int pos;
r13798r13799
159159
160160}
161161
162static void fcrash_render_layer( running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect, int layer, int primask )
162static void fcrash_render_layer( running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect, int layer, int primask )
163163{
164164   cps_state *state = machine.driver_data<cps_state>();
165165
r13798r13799
176176   }
177177}
178178
179static void fcrash_render_high_layer( running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect, int layer )
179static void fcrash_render_high_layer( running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect, int layer )
180180{
181181   cps_state *state = machine.driver_data<cps_state>();
182182
r13798r13799
268268   tilemap_set_enable(state->m_bg_tilemap[2], 1);
269269
270270   /* Blank screen */
271   bitmap->fill(0xbff, *cliprect);
271   bitmap->fill(0xbff, cliprect);
272272
273   screen.machine().priority_bitmap->fill(0, *cliprect);
273   screen.machine().priority_bitmap->fill(0, cliprect);
274274   l0 = (layercontrol >> 0x06) & 03;
275275   l1 = (layercontrol >> 0x08) & 03;
276276   l2 = (layercontrol >> 0x0a) & 03;
r13798r13799
349349   tilemap_set_enable(state->m_bg_tilemap[2], 1);
350350
351351   /* Blank screen */
352   bitmap->fill(0xbff, *cliprect);
352   bitmap->fill(0xbff, cliprect);
353353
354   screen.machine().priority_bitmap->fill(0, *cliprect);
354   screen.machine().priority_bitmap->fill(0, cliprect);
355355   l0 = (layercontrol >> 0x06) & 03;
356356   l1 = (layercontrol >> 0x08) & 03;
357357   l2 = (layercontrol >> 0x0a) & 03;
src/mame/drivers/majorpkr.c
r13798r13799
525525{
526526   majorpkr_state *state = screen.machine().driver_data<majorpkr_state>();
527527
528   bitmap->fill(get_black_pen(screen.machine()), *cliprect);
528   bitmap->fill(get_black_pen(screen.machine()), cliprect);
529529
530530   rectangle custom_clip;
531531
532532   /* The following custom_clip is to exclude the last char column (unused)
533533       form the render. We need more proof about how the video is working.
534534    */
535   custom_clip.min_x=cliprect->min_x;
536   custom_clip.max_x=cliprect->max_x-16;
537   custom_clip.min_y=cliprect->min_y;
538   custom_clip.max_y=cliprect->max_y;
535   custom_clip.min_x=cliprect.min_x;
536   custom_clip.max_x=cliprect.max_x-16;
537   custom_clip.min_y=cliprect.min_y;
538   custom_clip.max_y=cliprect.max_y;
539539
540   tilemap_draw(bitmap, &custom_clip, state->m_bg_tilemap, 0, 0);
541   tilemap_draw(bitmap, &custom_clip, state->m_fg_tilemap, 0, 0);
540   tilemap_draw(bitmap, custom_clip, state->m_bg_tilemap, 0, 0);
541   tilemap_draw(bitmap, custom_clip, state->m_fg_tilemap, 0, 0);
542542
543543   if (state->m_flip_state == 1)
544544   {
src/mame/drivers/igs017.c
r13798r13799
247247
248248***************************************************************************/
249249
250static void draw_sprite(running_machine &machine, bitmap_t *bitmap,const rectangle *cliprect, int sx, int sy, int dimx, int dimy, int flipx, int flipy, int color, int addr)
250static void draw_sprite(running_machine &machine, bitmap_t *bitmap,const rectangle &cliprect, int sx, int sy, int dimx, int dimy, int flipx, int flipy, int color, int addr)
251251{
252252   igs017_state *state = machine.driver_data<igs017_state>();
253253   // prepare GfxElement on the fly
r13798r13799
265265            sx, sy, 0x1f   );
266266}
267267
268static void draw_sprites(running_machine &machine, bitmap_t *bitmap,const rectangle *cliprect)
268static void draw_sprites(running_machine &machine, bitmap_t *bitmap,const rectangle &cliprect)
269269{
270270   igs017_state *state = machine.driver_data<igs017_state>();
271271   UINT8 *s   =   state->m_spriteram;
r13798r13799
301301}
302302
303303// A simple gfx viewer (toggle with T)
304static int debug_viewer(running_machine &machine, bitmap_t *bitmap,const rectangle *cliprect)
304static int debug_viewer(running_machine &machine, bitmap_t *bitmap,const rectangle &cliprect)
305305{
306306#ifdef MAME_DEBUG
307307   igs017_state *state = machine.driver_data<igs017_state>();
r13798r13799
330330      if (w <= 0)      w = 0;
331331      if (w > 1024)   w = 1024;
332332
333      bitmap->fill(0, *cliprect);
333      bitmap->fill(0, cliprect);
334334
335335      draw_sprite(machine, bitmap, cliprect, 0,0, w,h, 0,0, 0, a);
336336
r13798r13799
363363   if (debug_viewer(screen.machine(), bitmap,cliprect))
364364      return 0;
365365
366   bitmap->fill(get_black_pen(screen.machine()), *cliprect);
366   bitmap->fill(get_black_pen(screen.machine()), cliprect);
367367
368368   if (state->m_video_disable)
369369      return 0;
src/mame/drivers/monzagp.c
r13798r13799
9292      fclose(p);
9393   }
9494
95   bitmap->fill(0, *cliprect);
95   bitmap->fill(0, cliprect);
9696   for(y=0;y<256;y++)
9797   {
9898      for(x=0;x<256;x++)
src/mame/drivers/missb2.c
r13798r13799
4949   /* and sprites) are stored in the same memory region, and information on */
5050   /* the background character columns is stored in the area dd00-dd3f */
5151
52   bitmap->fill(255, *cliprect);
52   bitmap->fill(255, cliprect);
5353
5454   if (!state->m_video_enable)
5555      return 0;
src/mame/drivers/dynadice.c
r13798r13799
209209static SCREEN_UPDATE( dynadice )
210210{
211211   dynadice_state *state = screen.machine().driver_data<dynadice_state>();
212   rectangle myclip = *cliprect;
212   rectangle myclip = cliprect;
213213   myclip.max_x = 15;
214214   tilemap_draw(bitmap, cliprect, state->m_bg_tilemap, 0, 0);
215   tilemap_draw(bitmap, &myclip, state->m_top_tilemap, 0, 0);
215   tilemap_draw(bitmap, myclip, state->m_top_tilemap, 0, 0);
216216   return 0;
217217}
218218
src/mame/drivers/jangou.c
r13798r13799
125125   jangou_state *state = screen.machine().driver_data<jangou_state>();
126126   int x, y;
127127
128   for (y = cliprect->min_y; y <= cliprect->max_y; ++y)
128   for (y = cliprect.min_y; y <= cliprect.max_y; ++y)
129129   {
130      UINT8 *src = &state->m_blit_buffer[y * 512 / 2 + cliprect->min_x];
131      UINT16 *dst = &bitmap->pix16(y, cliprect->min_x);
130      UINT8 *src = &state->m_blit_buffer[y * 512 / 2 + cliprect.min_x];
131      UINT16 *dst = &bitmap->pix16(y, cliprect.min_x);
132132
133      for (x = cliprect->min_x; x <= cliprect->max_x; x += 2)
133      for (x = cliprect.min_x; x <= cliprect.max_x; x += 2)
134134      {
135135         UINT32 srcpix = *src++;
136136         *dst++ = screen.machine().pens[srcpix & 0xf];
src/mame/drivers/kinst.c
r13798r13799
236236   int y;
237237
238238   /* loop over rows and copy to the destination */
239   for (y = cliprect->min_y; y <= cliprect->max_y; y++)
239   for (y = cliprect.min_y; y <= cliprect.max_y; y++)
240240   {
241241      UINT32 *src = &state->m_video_base[640/4 * y];
242      UINT16 *dest = &bitmap->pix16(y, cliprect->min_x);
242      UINT16 *dest = &bitmap->pix16(y, cliprect.min_x);
243243      int x;
244244
245245      /* loop over columns */
246      for (x = cliprect->min_x; x < cliprect->max_x; x += 2)
246      for (x = cliprect.min_x; x < cliprect.max_x; x += 2)
247247      {
248248         UINT32 data = *src++;
249249
src/mame/drivers/suprgolf.c
r13798r13799
7979{
8080   suprgolf_state *state = screen.machine().driver_data<suprgolf_state>();
8181   int x,y,count,color;
82   bitmap->fill(get_black_pen(screen.machine()), *cliprect);
82   bitmap->fill(get_black_pen(screen.machine()), cliprect);
8383
8484   {
8585      count = 0;
r13798r13799
9090         {
9191            color = state->m_bg_fb[count];
9292
93            if(x <= cliprect->max_x && y <= cliprect->max_y)
93            if(x <= cliprect.max_x && y <= cliprect.max_y)
9494               bitmap->pix16(y, x) = screen.machine().pens[(color & 0x7ff)];
9595
9696            count++;
r13798r13799
107107         {
108108            color = state->m_fg_fb[count];
109109
110            if(((state->m_fg_fb[count] & 0x0f) != 0x0f) && (x <= cliprect->max_x && y <= cliprect->max_y))
110            if(((state->m_fg_fb[count] & 0x0f) != 0x0f) && (x <= cliprect.max_x && y <= cliprect.max_y))
111111               bitmap->pix16(y, x) = screen.machine().pens[(color & 0x7ff)];
112112
113113            count++;
src/mame/drivers/adp.c
r13798r13799
191191   bitmap.fill(0, cliprect);
192192
193193   /* graphics */
194   m_h63484->update_screen(&bitmap, &cliprect);
194   m_h63484->update_screen(&bitmap, cliprect);
195195
196196   return 0;
197197}
src/mame/drivers/pcxt.c
r13798r13799
102102
103103   //popmessage("%04x",m_start_offs);
104104
105   bitmap->fill(get_black_pen(screen.machine()), *cliprect);
105   bitmap->fill(get_black_pen(screen.machine()), cliprect);
106106
107107   for(y=0;y<200/8;y++)
108108   {
src/mame/drivers/dmndrby.c
r13798r13799
347347   const gfx_element *sprites = screen.machine().gfx[1];
348348   const gfx_element *track = screen.machine().gfx[2];
349349
350   bitmap->fill(get_black_pen(screen.machine()), *cliprect);
350   bitmap->fill(get_black_pen(screen.machine()), cliprect);
351351
352352
353353/* Draw racetrack
src/mame/drivers/boxer.c
r13798r13799
109109   palette_set_color(machine,3, MAKE_RGB(0x00,0x00,0x00));
110110}
111111
112static void draw_boxer( running_machine &machine, bitmap_t* bitmap, const rectangle* cliprect )
112static void draw_boxer( running_machine &machine, bitmap_t* bitmap, const rectangle &cliprect )
113113{
114114   boxer_state *state = machine.driver_data<boxer_state>();
115115   int n;
r13798r13799
162162   boxer_state *state = screen.machine().driver_data<boxer_state>();
163163   int i, j;
164164
165   bitmap->fill(1, *cliprect);
165   bitmap->fill(1, cliprect);
166166
167167   for (i = 0; i < 16; i++)
168168   {
src/mame/drivers/speglsht.c
r13798r13799
364364   st0016_draw_screen(screen, state->m_bitmap, cliprect);
365365
366366   //copy temporary bitmap to rgb 32 bit bitmap
367   for(y=cliprect->min_y; y<cliprect->max_y;y++)
367   for(y=cliprect.min_y; y<cliprect.max_y;y++)
368368   {
369369      UINT16 *srcline = &state->m_bitmap->pix16(y);
370      for(x=cliprect->min_x; x<cliprect->max_x;x++)
370      for(x=cliprect.min_x; x<cliprect.max_x;x++)
371371      {
372372         if(srcline[x])
373373         {
src/mame/drivers/nightgal.c
r13798r13799
7373   nightgal_state *state = screen.machine().driver_data<nightgal_state>();
7474   int x, y;
7575
76   for (y = cliprect->min_y; y <= cliprect->max_y; ++y)
76   for (y = cliprect.min_y; y <= cliprect.max_y; ++y)
7777   {
78      UINT8 *src = &state->m_blit_buffer[y * 512 / 2 + cliprect->min_x];
79      UINT16 *dst = &bitmap->pix16(y, cliprect->min_x);
78      UINT8 *src = &state->m_blit_buffer[y * 512 / 2 + cliprect.min_x];
79      UINT16 *dst = &bitmap->pix16(y, cliprect.min_x);
8080
81      for (x = cliprect->min_x; x <= cliprect->max_x; x += 2)
81      for (x = cliprect.min_x; x <= cliprect.max_x; x += 2)
8282      {
8383         UINT32 srcpix = *src++;
8484         *dst++ = screen.machine().pens[srcpix & 0xf];
src/mame/drivers/maygayv1.c
r13798r13799
297297   /* If screen output is disabled, fill with black */
298298   if (!(VREG(VCR0) & VCR0_DEN))
299299   {
300      bitmap->fill(get_black_pen(screen.machine()), *cliprect);
300      bitmap->fill(get_black_pen(screen.machine()), cliprect);
301301      return 0;
302302   }
303303
304304   /* For every scanline... */
305   for (sl = cliprect->min_x; sl <= cliprect->max_y; ++sl)
305   for (sl = cliprect.min_x; sl <= cliprect.max_y; ++sl)
306306   {
307307      int obj;
308308      UINT16 aflags = atable[sl];
r13798r13799
399399      }
400400
401401      // Write it out
402      for (sx = cliprect->min_x; sx < cliprect->max_x; sx += 2)
402      for (sx = cliprect.min_x; sx < cliprect.max_x; sx += 2)
403403      {
404404         UINT8 pix = i82716.line_buf[sx / 2];
405405
src/mame/drivers/littlerb.c
r13798r13799
449449   int xsize,ysize;
450450   int pal;
451451   UINT16* spriteregion = &state->m_region4[0x400];
452   bitmap->fill(get_black_pen(screen.machine()), *cliprect);
452   bitmap->fill(get_black_pen(screen.machine()), cliprect);
453453   //printf("frame\n");
454454   /* the spriteram format is something like this .. */
455455   for (offs=0x26/2;offs<0xc00;offs+=6) // start at 00x26?
src/mame/drivers/namcos23.c
r13798r13799
20832083      const namcos23_poly_entry *p = render.poly_order[i];
20842084      namcos23_render_data *rd = (namcos23_render_data *)poly_get_extra_data(render.polymgr);
20852085      *rd = p->rd;
2086      poly_render_triangle_fan(render.polymgr, bitmap, &scissor, render_scanline, 4, p->vertex_count, p->pv);
2086      poly_render_triangle_fan(render.polymgr, bitmap, scissor, render_scanline, 4, p->vertex_count, p->pv);
20872087   }
20882088   render.poly_count = 0;
20892089}
r13798r13799
21362136static SCREEN_UPDATE( ss23 )
21372137{
21382138   namcos23_state *state = screen.machine().driver_data<namcos23_state>();
2139   bitmap->fill(get_black_pen(screen.machine()), *cliprect);
2139   bitmap->fill(get_black_pen(screen.machine()), cliprect);
21402140
21412141   render_run( screen.machine(), bitmap );
21422142
src/mame/drivers/mjsister.c
r13798r13799
146146      copybitmap_trans(bitmap, state->m_tmpbitmap1, flip, flip, 2, 0, cliprect, 0);
147147   }
148148   else
149      bitmap->fill(get_black_pen(screen.machine()), *cliprect);
149      bitmap->fill(get_black_pen(screen.machine()), cliprect);
150150   return 0;
151151}
152152
src/mame/drivers/wheelfir.c
r13798r13799
568568{
569569   wheelfir_state *state = screen.machine().driver_data<wheelfir_state>();
570570
571   bitmap->fill(0, *cliprect);
571   bitmap->fill(0, cliprect);
572572
573573   for(int y=0;y<NUM_SCANLINES;++y)
574574   {
src/mame/drivers/laserbat.c
r13798r13799
519519   s2636_3_bitmap = s2636_update(state->m_s2636_3, cliprect);
520520
521521   /* copy the S2636 images into the main bitmap */
522   for (y = cliprect->min_y; y <= cliprect->max_y; y++)
522   for (y = cliprect.min_y; y <= cliprect.max_y; y++)
523523   {
524524      int x;
525525
526      for (x = cliprect->min_x; x <= cliprect->max_x; x++)
526      for (x = cliprect.min_x; x <= cliprect.max_x; x++)
527527      {
528528         int pixel1 = s2636_1_bitmap->pix16(y, x);
529529         int pixel2 = s2636_2_bitmap->pix16(y, x);
src/mame/drivers/champbwl.c
r13798r13799
451451
452452SCREEN_UPDATE( champbwl )
453453{
454   bitmap->fill(0x1f0, *cliprect);
454   bitmap->fill(0x1f0, cliprect);
455455
456456   screen.machine().device<seta001_device>("spritegen")->set_fg_yoffsets( -0x12, 0x0e );
457457   screen.machine().device<seta001_device>("spritegen")->set_bg_yoffsets( 0x1, -0x1 );
r13798r13799
509509
510510static SCREEN_UPDATE( doraemon )
511511{
512   bitmap->fill(0x1f0, *cliprect);
512   bitmap->fill(0x1f0, cliprect);
513513
514514   screen.machine().device<seta001_device>("spritegen")->set_bg_yoffsets( 0x00, 0x01 );
515515   screen.machine().device<seta001_device>("spritegen")->set_fg_yoffsets( 0x00, 0x10 );
src/mame/drivers/vamphalf.c
r13798r13799
469469            y = 256 - y;
470470         }
471471
472         drawgfx_transpen(bitmap,&clip,gfx,code,color,fx,fy,x,y,0);
472         drawgfx_transpen(bitmap,clip,gfx,code,color,fx,fy,x,y,0);
473473      }
474474   }
475475}
r13798r13799
523523            y = 256 - y;
524524         }
525525
526         drawgfx_transpen(bitmap,&clip,gfx,code,color,fx,fy,x,y,0);
526         drawgfx_transpen(bitmap,clip,gfx,code,color,fx,fy,x,y,0);
527527      }
528528   }
529529}
r13798r13799
531531
532532static SCREEN_UPDATE( common )
533533{
534   bitmap->fill(0, *cliprect);
534   bitmap->fill(0, cliprect);
535535   draw_sprites(screen, bitmap);
536536   return 0;
537537}
538538
539539static SCREEN_UPDATE( aoh )
540540{
541   bitmap->fill(0, *cliprect);
541   bitmap->fill(0, cliprect);
542542   draw_sprites_aoh(screen, bitmap);
543543   return 0;
544544}
src/mame/drivers/galaxia.c
r13798r13799
7474   {
7575      int y;
7676
77      for (y = cliprect->min_y; y <= cliprect->max_y; y++)
77      for (y = cliprect.min_y; y <= cliprect.max_y; y++)
7878      {
7979         int x;
8080
81         for (x = cliprect->min_x; x <= cliprect->max_x; x++)
81         for (x = cliprect.min_x; x <= cliprect.max_x; x++)
8282         {
8383            int pixel0 = s2636_0_bitmap->pix16(y, x);
8484            int pixel1 = s2636_1_bitmap->pix16(y, x);
src/mame/drivers/bnstars.c
r13798r13799
200200
201201/* ROZ Layers */
202202
203static void draw_roz(running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect, int priority, int chip)
203static void draw_roz(running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect, int priority, int chip)
204204{
205205   bnstars_state *state = machine.driver_data<bnstars_state>();
206206   /* TODO: registers 0x40/4 / 0x44/4 and 0x50/4 / 0x54/4 are used, meaning unknown */
r13798r13799
213213        rectangle my_clip;
214214        int y,maxy;
215215
216        my_clip.min_x = cliprect->min_x;
217        my_clip.max_x = cliprect->max_x;
216        my_clip.min_x = cliprect.min_x;
217        my_clip.max_x = cliprect.max_x;
218218
219        y = cliprect->min_y;
220        maxy = cliprect->max_y;
219        y = cliprect.min_y;
220        maxy = cliprect.max_y;
221221
222222        while (y <= maxy)
223223        {
r13798r13799
351351
352352
353353/* SPRITES based on tetrisp2 for now, readd priority bits later */
354static void draw_sprites(running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect, UINT32 *sprram_top, size_t sprram_size, int region)
354static void draw_sprites(running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect, UINT32 *sprram_top, size_t sprram_size, int region)
355355{
356356   bnstars_state *state = machine.driver_data<bnstars_state>();
357357/***************************************************************************
r13798r13799
515515{
516516   bnstars_state *state = screen.machine().driver_data<bnstars_state>();
517517
518   screen.machine().priority_bitmap->fill(0, *cliprect);
518   screen.machine().priority_bitmap->fill(0, cliprect);
519519
520   bitmap->fill(0, *cliprect);   /* bg color */
520   bitmap->fill(0, cliprect);   /* bg color */
521521
522522
523523   tilemap_set_scrollx(state->m_ms32_bg_tilemap[0], 0, state->m_ms32_bg0_scroll[0x00/4] + state->m_ms32_bg0_scroll[0x08/4] + 0x10 );
r13798r13799
540540{
541541   bnstars_state *state = screen.machine().driver_data<bnstars_state>();
542542
543   screen.machine().priority_bitmap->fill(0, *cliprect);
543   screen.machine().priority_bitmap->fill(0, cliprect);
544544
545   bitmap->fill(0x8000+0, *cliprect);   /* bg color */
545   bitmap->fill(0x8000+0, cliprect);   /* bg color */
546546
547547
548548   tilemap_set_scrollx(state->m_ms32_bg_tilemap[1], 0, state->m_ms32_bg1_scroll[0x00/4] + state->m_ms32_bg1_scroll[0x08/4] + 0x10 );
src/mame/drivers/diverboy.c
r13798r13799
7373{
7474}
7575
76static void draw_sprites( running_machine& machine, bitmap_t *bitmap, const rectangle *cliprect )
76static void draw_sprites( running_machine& machine, bitmap_t *bitmap, const rectangle &cliprect )
7777{
7878   diverboy_state *state = machine.driver_data<diverboy_state>();
7979   UINT16 *source = state->m_spriteram;
r13798r13799
111111
112112static SCREEN_UPDATE(diverboy)
113113{
114//  bitmap->fill(get_black_pen(screen.machine()), *cliprect);
114//  bitmap->fill(get_black_pen(screen.machine()), cliprect);
115115   draw_sprites(screen.machine(), bitmap, cliprect);
116116   return 0;
117117}
src/mame/drivers/vmetal.c
r13798r13799
420420{
421421   vmetal_state *state = screen.machine().driver_data<vmetal_state>();
422422
423   bitmap->fill(get_black_pen(screen.machine()), *cliprect);
424   screen.machine().priority_bitmap->fill(0, *cliprect);
423   bitmap->fill(get_black_pen(screen.machine()), cliprect);
424   screen.machine().priority_bitmap->fill(0, cliprect);
425425
426426   tilemap_set_scrollx(state->m_mid2tilemap, 0, state->m_vmetal_videoregs[0x06a/2]-64 /*+ state->m_vmetal_videoregs[0x066/2]*/);
427427   tilemap_set_scrollx(state->m_mid1tilemap, 0, state->m_vmetal_videoregs[0x07a/2]-64 /*+ state->m_vmetal_videoregs[0x076/2]*/);
src/mame/drivers/firefox.c
r13798r13799
188188   int sprite;
189189   int gfxtop = screen.visible_area().min_y;
190190
191   bitmap->fill(palette_get_color(screen.machine(), 256), *cliprect);
191   bitmap->fill(palette_get_color(screen.machine(), 256), cliprect);
192192
193193   for( sprite = 0; sprite < 32; sprite++ )
194194   {
src/mame/drivers/dwarfd.c
r13798r13799
774774{
775775}
776776
777static void drawCrt( running_machine &machine, bitmap_t *bitmap,const rectangle *cliprect )
777static void drawCrt( running_machine &machine, bitmap_t *bitmap,const rectangle &cliprect )
778778{
779779   dwarfd_state *state = machine.driver_data<dwarfd_state>();
780780   int x, y;
r13798r13799
837837
838838static SCREEN_UPDATE( dwarfd )
839839{
840   bitmap->fill(get_black_pen(screen.machine()), *cliprect);
840   bitmap->fill(get_black_pen(screen.machine()), cliprect);
841841   drawCrt(screen.machine(), bitmap, cliprect);
842842   return 0;
843843}
src/mame/drivers/hitpoker.c
r13798r13799
8181   int count = 0;
8282   int y,x;
8383
84   bitmap->fill(0, *cliprect);
84   bitmap->fill(0, cliprect);
8585
8686   for (y=0;y<31;y++)
8787   {
src/mame/drivers/meritm.c
r13798r13799
382382      popmessage("Layer 1 %sabled",state->m_layer1_enabled ? "en" : "dis");
383383   }
384384
385   bitmap->fill(get_black_pen(screen.machine()), *cliprect);
385   bitmap->fill(get_black_pen(screen.machine()), cliprect);
386386
387387   if ( state->m_layer0_enabled )
388388   {
src/mame/drivers/atarisy4.c
r13798r13799
151151
152152   //UINT32 offset = gpu.dpr << 5;
153153
154   for (y = cliprect->min_y; y <= cliprect->max_y; ++y)
154   for (y = cliprect.min_y; y <= cliprect.max_y; ++y)
155155   {
156156      UINT16 *src = &state->m_screen_ram[(offset + (4096 * y)) / 2];
157      UINT32 *dest = &bitmap->pix32(y, cliprect->min_x);
157      UINT32 *dest = &bitmap->pix32(y, cliprect.min_x);
158158      int x;
159159
160      for (x = cliprect->min_x; x < cliprect->max_x; x += 2)
160      for (x = cliprect.min_x; x < cliprect.max_x; x += 2)
161161      {
162162         UINT16 data = *src++;
163163
r13798r13799
271271      v3.x = gpu.points[i].x;
272272      v3.y = gpu.points[i].y;
273273
274      poly_render_triangle(state->m_poly, 0, &clip, draw_scanline, 1, &v1, &v2, &v3);
274      poly_render_triangle(state->m_poly, 0, clip, draw_scanline, 1, &v1, &v2, &v3);
275275      v2 = v3;
276276   }
277277}
src/mame/drivers/missile.c
r13798r13799
671671   int x, y;
672672
673673   /* draw the bitmap to the screen, looping over Y */
674   for (y = cliprect->min_y; y <= cliprect->max_y; y++)
674   for (y = cliprect.min_y; y <= cliprect.max_y; y++)
675675   {
676676      UINT16 *dst = &bitmap->pix16(y);
677677
r13798r13799
684684         src3 = &videoram[get_bit3_addr(effy << 8)];
685685
686686      /* loop over X */
687      for (x = cliprect->min_x; x <= cliprect->max_x; x++)
687      for (x = cliprect.min_x; x <= cliprect.max_x; x++)
688688      {
689689         UINT8 pix = src[x / 4] >> (x & 3);
690690         pix = ((pix >> 2) & 4) | ((pix << 1) & 2);
src/mame/drivers/igs_m027.c
r13798r13799
167167{
168168   igs_m027_state *state = screen.machine().driver_data<igs_m027_state>();
169169   //??????????
170   bitmap->fill(get_black_pen(screen.machine()), *cliprect);
170   bitmap->fill(get_black_pen(screen.machine()), cliprect);
171171
172172   //??????
173173   tilemap_draw(bitmap,cliprect,state->m_igs_bg_tilemap,0,0);
src/mame/drivers/subsino2.c
r13798r13799
653653      }
654654   }
655655
656   bitmap->fill(get_black_pen(screen.machine()), *cliprect);
656   bitmap->fill(get_black_pen(screen.machine()), cliprect);
657657
658658   if (layers_ctrl & 1)
659659   {
r13798r13799
690690                  if ( reelwrap_y-1 <= visible.max_y )
691691                     tmp.max_y = reelwrap_y-1;
692692                  tilemap_set_scrolly(l->tmap, 0, reelscroll_y);
693                  tilemap_draw(bitmap, &tmp, l->tmap, 0, 0);
693                  tilemap_draw(bitmap, tmp, l->tmap, 0, 0);
694694                  tmp.max_y = visible.max_y;
695695               }
696696
r13798r13799
700700                  if ( reelwrap_y >= visible.min_y )
701701                     tmp.min_y = reelwrap_y;
702702                  tilemap_set_scrolly(l->tmap, 0, -((reelwrap_y &0xff) | (reelscroll_y & 0x100)));
703                  tilemap_draw(bitmap, &tmp, l->tmap, 0, 0);
703                  tilemap_draw(bitmap, tmp, l->tmap, 0, 0);
704704                  tmp.min_y = visible.min_y;
705705               }
706706            }
src/mame/drivers/m63.c
r13798r13799
297297   tilemap_set_transparent_pen(state->m_fg_tilemap, 0);
298298}
299299
300static void draw_sprites( running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect )
300static void draw_sprites( running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect )
301301{
302302   m63_state *state = machine.driver_data<m63_state>();
303303   int offs;
src/mame/drivers/albazc.c
r13798r13799
5151{
5252}
5353
54static void draw_sprites( running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect )
54static void draw_sprites( running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect )
5555{
5656   albazc_state *state = machine.driver_data<albazc_state>();
5757   int i;
r13798r13799
7979
8080static SCREEN_UPDATE(hanaroku)
8181{
82   bitmap->fill(0x1f0, *cliprect);   // ???
82   bitmap->fill(0x1f0, cliprect);   // ???
8383   draw_sprites(screen.machine(), bitmap, cliprect);
8484   return 0;
8585}
src/mame/drivers/midas.c
r13798r13799
9191   tilemap_set_transparent_pen(state->m_tmap, 0);
9292}
9393
94static void draw_sprites(running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect)
94static void draw_sprites(running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect)
9595{
9696   midas_state *state = machine.driver_data<midas_state>();
9797   UINT16 *s      =   state->m_gfxram + 0x8000;
r13798r13799
190190   }
191191#endif
192192
193   bitmap->fill(4095, *cliprect);
193   bitmap->fill(4095, cliprect);
194194
195195   if (layers_ctrl & 2)   draw_sprites(screen.machine(), bitmap,cliprect);
196196   if (layers_ctrl & 1)   tilemap_draw(bitmap,cliprect, state->m_tmap, 0, 0);
src/mame/drivers/galaxi.c
r13798r13799
188188#endif
189189
190190   if (layers_ctrl & 1)   tilemap_draw(bitmap, cliprect, state->m_bg1_tmap, TILEMAP_DRAW_OPAQUE, 0);
191   else            bitmap->fill(get_black_pen(screen.machine()), *cliprect);
191   else            bitmap->fill(get_black_pen(screen.machine()), cliprect);
192192   if (layers_ctrl & 2)   tilemap_draw(bitmap, cliprect, state->m_bg2_tmap, 0, 0);
193193   if (layers_ctrl & 4)   tilemap_draw(bitmap, cliprect, state->m_bg3_tmap, 0, 0);
194194   if (layers_ctrl & 8)   tilemap_draw(bitmap, cliprect, state->m_bg4_tmap, 0, 0);
src/mame/drivers/taitotz.c
r13798r13799
158158
159159   taitotz_state *state = screen.machine().driver_data<taitotz_state>();
160160
161   bitmap->fill(0, *cliprect);
161   bitmap->fill(0, cliprect);
162162   copybitmap_trans(bitmap, state->framebuffer, 0, 0, 0, 0, cliprect, 0);
163163
164164   return 0;
src/mame/drivers/cabaret.c
r13798r13799
107107static SCREEN_UPDATE(cabaret)
108108{
109109   cabaret_state *state = screen.machine().driver_data<cabaret_state>();
110   bitmap->fill(get_black_pen(screen.machine()), *cliprect);
110   bitmap->fill(get_black_pen(screen.machine()), cliprect);
111111
112112   tilemap_draw(bitmap, cliprect, state->m_bg_tilemap, 0, 0);
113113
src/mame/drivers/olibochu.c
r13798r13799
158158   state->m_bg_tilemap = tilemap_create(machine, get_bg_tile_info, tilemap_scan_rows, 8, 8, 32, 32);
159159}
160160
161static void draw_sprites( running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect )
161static void draw_sprites( running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect )
162162{
163163   olibochu_state *state = machine.driver_data<olibochu_state>();
164164   UINT8 *spriteram = state->m_spriteram;
src/mame/drivers/tugboat.c
r13798r13799
9090      if (offset<0x8 ) state->m_ram[0x291d + 32*offset + 32*9] = data ^ 0x0f;
9191}
9292
93static void draw_tilemap(running_machine &machine, bitmap_t *bitmap,const rectangle *cliprect,
93static void draw_tilemap(running_machine &machine, bitmap_t *bitmap,const rectangle &cliprect,
9494      int addr,int gfx0,int gfx1,int transparency)
9595{
9696   tugboat_state *state = machine.driver_data<tugboat_state>();
src/mame/drivers/kingdrby.c
r13798r13799
165165   0x22, 0x22, 0x22, 0x22, 0x22, 0x11, 0x22, 0x22
166166};
167167
168static void draw_sprites(running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect)
168static void draw_sprites(running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect)
169169{
170170   kingdrby_state *state = machine.driver_data<kingdrby_state>();
171171   UINT8 *spriteram = state->m_spriteram;
r13798r13799
231231   tilemap_draw(bitmap,cliprect,state->m_sc0_tilemap,0,0);
232232   draw_sprites(screen.machine(),bitmap,cliprect);
233233   tilemap_draw(bitmap,cliprect,state->m_sc1_tilemap,TILEMAP_DRAW_CATEGORY(1),0);
234   tilemap_draw(bitmap,&clip,state->m_sc0w_tilemap,0,0);
234   tilemap_draw(bitmap,clip,state->m_sc0w_tilemap,0,0);
235235
236236   return 0;
237237}
src/mame/drivers/r2dx_v33.c
r13798r13799
8080}
8181
8282/* copied from Legionnaire */
83static void draw_sprites(running_machine &machine, bitmap_t *bitmap,const rectangle *cliprect,int pri)
83static void draw_sprites(running_machine &machine, bitmap_t *bitmap,const rectangle &cliprect,int pri)
8484{
8585   r2dx_v33_state *state = machine.driver_data<r2dx_v33_state>();
8686   UINT16 *spriteram16 = state->m_spriteram;
r13798r13799
181181
182182static SCREEN_UPDATE( rdx_v33 )
183183{
184   bitmap->fill(get_black_pen(screen.machine()), *cliprect);
184   bitmap->fill(get_black_pen(screen.machine()), cliprect);
185185
186186   tilemap_draw(bitmap, cliprect, bg_tilemap, 0, 0);
187187   tilemap_draw(bitmap, cliprect, md_tilemap, 0, 0);
src/mame/drivers/lastfght.c
r13798r13799
142142
143143      count = state->m_base;
144144
145      bitmap->fill(get_black_pen(screen.machine()), *cliprect );
145      bitmap->fill(get_black_pen(screen.machine()), cliprect );
146146      for (y = 0 ; y < 256; y++)
147147      {
148148         for (x = 0; x < 512; x++)
src/mame/drivers/looping.c
r13798r13799
248248 *
249249 *************************************/
250250
251static void draw_sprites(running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect)
251static void draw_sprites(running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect)
252252{
253253   const UINT8 *source;
254254   looping_state *state = machine.driver_data<looping_state>();
src/mame/drivers/1945kiii.c
r13798r13799
9090   state->m_bg_tilemap = tilemap_create(machine, get_k3_bg_tile_info, tilemap_scan_rows, 16, 16, 32, 64);
9191}
9292
93static void draw_sprites( running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect )
93static void draw_sprites( running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect )
9494{
9595   k3_state *state = machine.driver_data<k3_state>();
9696   const gfx_element *gfx = machine.gfx[0];
src/mame/drivers/astinvad.c
r13798r13799
159159   int x, y;
160160
161161   /* render the visible pixels */
162   for (y = cliprect->min_y; y <= cliprect->max_y; y++)
163      for (x = cliprect->min_x & ~7; x <= cliprect->max_x; x += 8)
162   for (y = cliprect.min_y; y <= cliprect.max_y; y++)
163      for (x = cliprect.min_x & ~7; x <= cliprect.max_x; x += 8)
164164      {
165165         UINT8 color = color_prom[((y & 0xf8) << 2) | (x >> 3)] >> (state->m_screen_flip ? 0 : 4);
166166         UINT8 data = state->m_videoram[(((y ^ state->m_screen_flip) + yoffs) << 5) | ((x ^ state->m_screen_flip) >> 3)];
src/mame/drivers/esh.c
r13798r13799
5252   int charx, chary;
5353
5454   /* clear */
55   bitmap->fill(0, *cliprect);
55   bitmap->fill(0, cliprect);
5656
5757   /* Draw tiles */
5858   for (charx = 0; charx < 32; charx++)
src/mame/drivers/halleys.c
r13798r13799
14761476      copy_scroll_xp(bitmap, state->m_render_layer[4], *state->m_scrollx1, *state->m_scrolly1);
14771477   }
14781478   else
1479      bitmap->fill(state->m_bgcolor, *cliprect);
1479      bitmap->fill(state->m_bgcolor, cliprect);
14801480
14811481#ifdef MAME_DEBUG
14821482   if (input_port_read(screen.machine(), "DEBUG")) copy_scroll_xp(bitmap, state->m_render_layer[3], *state->m_scrollx0, *state->m_scrolly0); // not used???
r13798r13799
15001500   if (state->m_io_ram[0xa0] & 0x80)
15011501      copy_scroll_op(bitmap, state->m_render_layer[2], *state->m_scrollx1, *state->m_scrolly1);
15021502   else
1503      bitmap->fill(state->m_bgcolor, *cliprect);
1503      bitmap->fill(state->m_bgcolor, cliprect);
15041504
15051505   copy_fixed_xp (bitmap, state->m_render_layer[1]);
15061506   copy_fixed_xp (bitmap, state->m_render_layer[0]);
src/mame/drivers/namcoic.c
r13798r13799
8989} /* namco_tilemap_init */
9090
9191void
92namco_tilemap_draw( bitmap_t *bitmap, const rectangle *cliprect, int pri )
92namco_tilemap_draw( bitmap_t *bitmap, const rectangle &cliprect, int pri )
9393{
9494   int i;
9595   for( i=0; i<6; i++ )
r13798r13799
266266/**************************************************************************************/
267267
268268static void zdrawgfxzoom(
269      bitmap_t *dest_bmp,const rectangle *clip,const gfx_element *gfx,
269      bitmap_t *dest_bmp,const rectangle &clip,const gfx_element *gfx,
270270      UINT32 code,UINT32 color,int flipx,int flipy,int sx,int sy,
271271      int scalex, int scaley, int zpos )
272272{
r13798r13799
312312               y_index = 0;
313313            }
314314
315            if( clip )
316            {
317               if( sx < clip->min_x)
318               { /* clip left */
319                  int pixels = clip->min_x-sx;
320                  sx += pixels;
321                  x_index_base += pixels*dx;
322               }
323               if( sy < clip->min_y )
324               { /* clip top */
325                  int pixels = clip->min_y-sy;
326                  sy += pixels;
327                  y_index += pixels*dy;
328               }
329               if( ex > clip->max_x+1 )
330               { /* clip right */
331                  int pixels = ex-clip->max_x-1;
332                  ex -= pixels;
333               }
334               if( ey > clip->max_y+1 )
335               { /* clip bottom */
336                  int pixels = ey-clip->max_y-1;
337                  ey -= pixels;
338               }
315            if( sx < clip.min_x)
316            { /* clip left */
317               int pixels = clip.min_x-sx;
318               sx += pixels;
319               x_index_base += pixels*dx;
339320            }
321            if( sy < clip.min_y )
322            { /* clip top */
323               int pixels = clip.min_y-sy;
324               sy += pixels;
325               y_index += pixels*dy;
326            }
327            if( ex > clip.max_x+1 )
328            { /* clip right */
329               int pixels = ex-clip.max_x-1;
330               ex -= pixels;
331            }
332            if( ey > clip.max_y+1 )
333            { /* clip bottom */
334               int pixels = ey-clip.max_y-1;
335               ey -= pixels;
336            }
340337
341338            if( ex>sx )
342339            { /* skip if inner loop doesn't draw anything */
r13798r13799
411408} /* zdrawgfxzoom */
412409
413410void
414namcos2_draw_sprites(running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect, int pri, int control )
411namcos2_draw_sprites(running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect, int pri, int control )
415412{
416413   int offset = (control & 0x000f) * (128*4);
417414   int loop;
418415   if( pri==0 )
419416   {
420      machine.priority_bitmap->fill(0, *cliprect );
417      machine.priority_bitmap->fill(0, cliprect );
421418   }
422419   for( loop=0; loop < 128; loop++ )
423420   {
r13798r13799
491488} /* namcos2_draw_sprites */
492489
493490void
494namcos2_draw_sprites_metalhawk(running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect, int pri )
491namcos2_draw_sprites_metalhawk(running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect, int pri )
495492{
496493   /**
497494     * word#0
r13798r13799
528525   int loop;
529526   if( pri==0 )
530527   {
531      machine.priority_bitmap->fill(0, *cliprect );
528      machine.priority_bitmap->fill(0, cliprect );
532529   }
533530   for( loop=0; loop < 128; loop++ )
534531   {
r13798r13799
584581         rect.min_y=sy;
585582         rect.max_y=sy+(sizey-1);
586583
587         if (cliprect->min_x > rect.min_x) rect.min_x = cliprect->min_x;
588         if (cliprect->max_x < rect.max_x) rect.max_x = cliprect->max_x;
589         if (cliprect->min_y > rect.min_y) rect.min_y = cliprect->min_y;
590         if (cliprect->max_y < rect.max_y) rect.max_y = cliprect->max_y;
584         if (cliprect.min_x > rect.min_x) rect.min_x = cliprect.min_x;
585         if (cliprect.max_x < rect.max_x) rect.max_x = cliprect.max_x;
586         if (cliprect.min_y > rect.min_y) rect.min_y = cliprect.min_y;
587         if (cliprect.max_y < rect.max_y) rect.max_y = cliprect.max_y;
591588
592589         if( !bBigSprite )
593590         {
r13798r13799
610607         }
611608         zdrawgfxzoom(
612609            bitmap,
613            &rect,
610            rect,
614611            machine.gfx[0],
615612            sprn, color,
616613            flipx,flipy,
r13798r13799
717714 * 0x14000 sprite list (page1)
718715 */
719716static void
720draw_spriteC355(running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect, const UINT16 *pSource, int pri, int zpos )
717draw_spriteC355(running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect, const UINT16 *pSource, int pri, int zpos )
721718{
722719   UINT16 *spriteram16 = machine.generic.spriteram.u16;
723720   unsigned screen_height_remaining, screen_width_remaining;
r13798r13799
802799   clip.max_x = pWinAttr[1] - xscroll;
803800   clip.min_y = pWinAttr[2] - yscroll;
804801   clip.max_y = pWinAttr[3] - yscroll;
805   if( clip.min_x < cliprect->min_x ){ clip.min_x = cliprect->min_x; }
806   if( clip.min_y < cliprect->min_y ){ clip.min_y = cliprect->min_y; }
807   if( clip.max_x > cliprect->max_x ){ clip.max_x = cliprect->max_x; }
808   if( clip.max_y > cliprect->max_y ){ clip.max_y = cliprect->max_y; }
802   if( clip.min_x < cliprect.min_x ){ clip.min_x = cliprect.min_x; }
803   if( clip.min_y < cliprect.min_y ){ clip.min_y = cliprect.min_y; }
804   if( clip.max_x > cliprect.max_x ){ clip.max_x = cliprect.max_x; }
805   if( clip.max_y > cliprect.max_y ){ clip.max_y = cliprect.max_y; }
809806   hpos&=0x7ff; if( hpos&0x400 ) hpos |= ~0x7ff; /* sign extend */
810807   vpos&=0x7ff; if( vpos&0x400 ) vpos |= ~0x7ff; /* sign extend */
811808
r13798r13799
875872         {
876873            zdrawgfxzoom(
877874               bitmap,
878               &clip,
875               clip,
879876               machine.gfx[mGfxC355],
880877               mpCodeToTile(machine, tile) + offset,
881878               color,
r13798r13799
926923static void
927924DrawObjectList(running_machine &machine,
928925      bitmap_t *bitmap,
929      const rectangle *cliprect,
926      const rectangle &cliprect,
930927      int pri,
931928      const UINT16 *pSpriteList16,
932929      const UINT16 *pSpriteTable )
r13798r13799
942939} /* DrawObjectList */
943940
944941void
945namco_obj_draw(running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect, int pri )
942namco_obj_draw(running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect, int pri )
946943{
947944//  int offs = spriteram16[0x18000/2]; /* end-of-sprite-list */
948945   if( pri==0 )
949946   {
950      machine.priority_bitmap->fill(0, *cliprect );
947      machine.priority_bitmap->fill(0, cliprect );
951948   }
952949//  if( offs==0 )
953950   { /* boot */
r13798r13799
12151212DrawRozHelper(
12161213   bitmap_t *bitmap,
12171214   tilemap_t *tmap,
1218   const rectangle *clip,
1215   const rectangle &clip,
12191216   const struct RozParam *rozInfo )
12201217{
12211218
r13798r13799
12261223      UINT32 size_mask = rozInfo->size-1;
12271224      bitmap_t *srcbitmap = tilemap_get_pixmap( tmap );
12281225      bitmap_t *flagsbitmap = tilemap_get_flagsmap( tmap );
1229      UINT32 startx = rozInfo->startx + clip->min_x * rozInfo->incxx + clip->min_y * rozInfo->incyx;
1230      UINT32 starty = rozInfo->starty + clip->min_x * rozInfo->incxy + clip->min_y * rozInfo->incyy;
1231      int sx = clip->min_x;
1232      int sy = clip->min_y;
1233      while( sy <= clip->max_y )
1226      UINT32 startx = rozInfo->startx + clip.min_x * rozInfo->incxx + clip.min_y * rozInfo->incyx;
1227      UINT32 starty = rozInfo->starty + clip.min_x * rozInfo->incxy + clip.min_y * rozInfo->incyy;
1228      int sx = clip.min_x;
1229      int sy = clip.min_y;
1230      while( sy <= clip.max_y )
12341231      {
12351232         int x = sx;
12361233         UINT32 cx = startx;
12371234         UINT32 cy = starty;
12381235         UINT16 *dest = &bitmap->pix16(sy, sx);
1239         while( x <= clip->max_x )
1236         while( x <= clip.max_x )
12401237         {
12411238            UINT32 xpos = (((cx>>16)&size_mask) + rozInfo->left)&0xfff;
12421239            UINT32 ypos = (((cy>>16)&size_mask) + rozInfo->top)&0xfff;
r13798r13799
12711268} /* DrawRozHelper */
12721269
12731270static void
1274DrawRozScanline( bitmap_t *bitmap, int line, int which, int pri, const rectangle *cliprect )
1271DrawRozScanline( bitmap_t *bitmap, int line, int which, int pri, const rectangle &cliprect )
12751272{
1276   if( line>=cliprect->min_y && line<=cliprect->max_y )
1273   if( line>=cliprect.min_y && line<=cliprect.max_y )
12771274   {
12781275      struct RozParam rozInfo;
12791276      rectangle clip;
r13798r13799
12891286            clip.max_x = bitmap->width()-1;
12901287            clip.min_y = clip.max_y = line;
12911288
1292            if( clip.min_x < cliprect->min_x ){ clip.min_x = cliprect->min_x; }
1293            if( clip.min_y < cliprect->min_y ){ clip.min_y = cliprect->min_y; }
1294            if( clip.max_x > cliprect->max_x ){ clip.max_x = cliprect->max_x; }
1295            if( clip.max_y > cliprect->max_y ){ clip.max_y = cliprect->max_y; }
1289            if( clip.min_x < cliprect.min_x ){ clip.min_x = cliprect.min_x; }
1290            if( clip.min_y < cliprect.min_y ){ clip.min_y = cliprect.min_y; }
1291            if( clip.max_x > cliprect.max_x ){ clip.max_x = cliprect.max_x; }
1292            if( clip.max_y > cliprect.max_y ){ clip.max_y = cliprect.max_y; }
12961293
1297            DrawRozHelper( bitmap, mRozTilemap[which], &clip, &rozInfo );
1294            DrawRozHelper( bitmap, mRozTilemap[which], clip, &rozInfo );
12981295         } /* priority */
12991296      } /* enabled */
13001297   }
13011298} /* DrawRozScanline */
13021299
13031300void
1304namco_roz_draw( bitmap_t *bitmap, const rectangle *cliprect, int pri )
1301namco_roz_draw( bitmap_t *bitmap, const rectangle &cliprect, int pri )
13051302{
13061303   int mode = rozcontrol16[0]; /* 0x8000 or 0x1000 */
13071304   int which, special = 1;
r13798r13799
15991596}
16001597
16011598void
1602namco_road_draw(running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect, int pri )
1599namco_road_draw(running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect, int pri )
16031600{
16041601   const UINT8 *clut = (const UINT8 *)machine.region("user3")->base();
16051602   bitmap_t *pSourceBitmap;
r13798r13799
16091606   pSourceBitmap = tilemap_get_pixmap(mpRoadTilemap);
16101607   yscroll = mpRoadRAM[0x1fdfe/2];
16111608
1612   for( i=cliprect->min_y; i<=cliprect->max_y; i++ )
1609   for( i=cliprect.min_y; i<=cliprect.max_y; i++ )
16131610   {
16141611      int screenx   = mpRoadRAM[0x1fa00/2+i+15];
16151612      if( pri == ((screenx&0xf000)>>12) )
r13798r13799
16371634               /* adjust the horizontal placement */
16381635               screenx -= 64; /*needs adjustment to left*/
16391636
1640               clipPixels = cliprect->min_x - screenx;
1637               clipPixels = cliprect.min_x - screenx;
16411638               if( clipPixels>0 )
16421639               { /* crop left */
16431640                  numpixels -= clipPixels;
16441641                  sourcex += dsourcex*clipPixels;
1645                  screenx = cliprect->min_x;
1642                  screenx = cliprect.min_x;
16461643               }
16471644
1648               clipPixels = (screenx+numpixels) - (cliprect->max_x+1);
1645               clipPixels = (screenx+numpixels) - (cliprect.max_x+1);
16491646               if( clipPixels>0 )
16501647               { /* crop right */
16511648                  numpixels -= clipPixels;
src/mame/drivers/statriv2.c
r13798r13799
181181{
182182   statriv2_state *state = screen.machine().driver_data<statriv2_state>();
183183   if (tms9927_screen_reset(screen.machine().device("tms")))
184      bitmap->fill(get_black_pen(screen.machine()), *cliprect);
184      bitmap->fill(get_black_pen(screen.machine()), cliprect);
185185   else
186186      tilemap_draw(bitmap, cliprect, state->m_tilemap, 0, 0);
187187   return 0;
src/mame/drivers/aristmk6.c
r13798r13799
6363
6464   popmessage("%d %d %04x %d",state->m_test_x,state->m_test_y,state->m_start_offs,state->m_type);
6565
66   bitmap->fill(get_black_pen(screen.machine()), *cliprect);
66   bitmap->fill(get_black_pen(screen.machine()), cliprect);
6767
6868   count = (state->m_start_offs);
6969
src/mame/drivers/acommand.c
r13798r13799
110110         0);
111111}
112112
113static void draw_sprites(running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect, int priority, int pri_mask)
113static void draw_sprites(running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect, int priority, int pri_mask)
114114{
115115   acommand_state *state = machine.driver_data<acommand_state>();
116116   UINT16 *spriteram16 = state->m_spriteram;
src/mame/drivers/segald.c
r13798r13799
4444};
4545
4646/* VIDEO GOODS */
47static void astron_draw_characters(running_machine &machine, bitmap_t *bitmap,const rectangle *cliprect)
47static void astron_draw_characters(running_machine &machine, bitmap_t *bitmap,const rectangle &cliprect)
4848{
4949   segald_state *state = machine.driver_data<segald_state>();
5050   UINT8 characterX, characterY;
r13798r13799
6060   }
6161}
6262
63static void astron_draw_sprites(running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect)
63static void astron_draw_sprites(running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect)
6464{
6565   /* Heisted from Daphne */
6666   const UINT8 SPR_Y_TOP     = 0;
r13798r13799
9191
9292static SCREEN_UPDATE( astron )
9393{
94   bitmap->fill(0, *cliprect);
94   bitmap->fill(0, cliprect);
9595
9696   astron_draw_characters(screen.machine(), bitmap, cliprect);
9797   astron_draw_sprites(screen.machine(), bitmap, cliprect);
src/mame/drivers/srmp5.c
r13798r13799
129129   }
130130   else
131131#endif
132      bitmap->fill(0, *cliprect);
132      bitmap->fill(0, cliprect);
133133
134134   while((sprite_list[SUBLIST_OFFSET]&SPRITE_LIST_END_MARKER)==0 && sprite_list<sprite_list_end)
135135   {
src/mame/drivers/destroyr.c
r13798r13799
4747   destroyr_state *state = screen.machine().driver_data<destroyr_state>();
4848   int i, j;
4949
50   bitmap->fill(0, *cliprect);
50   bitmap->fill(0, cliprect);
5151
5252   /* draw major objects */
5353   for (i = 0; i < 16; i++)
src/mame/drivers/feversoc.c
r13798r13799
8888   UINT32 *spriteram32 = state->m_spriteram;
8989   int offs,spr_offs,colour,sx,sy,h,w,dx,dy;
9090
91   bitmap->fill(screen.machine().pens[0], *cliprect); //black pen
91   bitmap->fill(screen.machine().pens[0], cliprect); //black pen
9292
9393   for(offs=(0x2000/4)-2;offs>-1;offs-=2)
9494   {
src/mame/drivers/vcombat.c
r13798r13799
104104   int m_crtc_select;
105105};
106106
107static UINT32 update_screen(screen_device &screen, bitmap_t *bitmap, const rectangle *cliprect, int index)
107static UINT32 update_screen(screen_device &screen, bitmap_t *bitmap, const rectangle &cliprect, int index)
108108{
109109   vcombat_state *state = screen.machine().driver_data<vcombat_state>();
110110   int y;
r13798r13799
118118   /*       There's also some garbage in the upper-left corner. Might be related to this 'wraparound'. */
119119   /*       Or maybe it's related to the 68k's alpha?  It might come from the 68k side of the house.  */
120120
121   for (y = cliprect->min_y; y <= cliprect->max_y; ++y)
121   for (y = cliprect.min_y; y <= cliprect.max_y; ++y)
122122   {
123123      int x;
124124      int src_addr = 256/2 * y;
125125      const UINT16 *m68k_src = &m68k_buf[src_addr];
126126      const UINT16 *i860_src = &i860_buf[src_addr];
127      UINT32 *dst = &bitmap->pix32(y, cliprect->min_x);
127      UINT32 *dst = &bitmap->pix32(y, cliprect.min_x);
128128
129      for (x = cliprect->min_x; x <= cliprect->max_x; x += 2)
129      for (x = cliprect.min_x; x <= cliprect.max_x; x += 2)
130130      {
131131         int i;
132132         UINT16 m68k_pix = *m68k_src++;
src/mame/drivers/superwng.c
r13798r13799
108108   int flip=flip_screen_get(screen.machine());
109109
110110   tilemap_draw(bitmap, cliprect, state->m_bg_tilemap, 0, 0);
111   rectangle tmp=*cliprect;
111   rectangle tmp=cliprect;
112112
113113   if(flip)
114114   {
115115      tmp.min_x+=32;
116      tilemap_draw(bitmap, &tmp, state->m_fg_tilemap, 0, 0);
116      tilemap_draw(bitmap, tmp, state->m_fg_tilemap, 0, 0);
117117   }
118118   else
119119   {
120120      tmp.max_x-=32;
121      tilemap_draw(bitmap, &tmp, state->m_fg_tilemap, 0, 0);
121      tilemap_draw(bitmap, tmp, state->m_fg_tilemap, 0, 0);
122122   }
123123
124124   {
src/mame/drivers/guab.c
r13798r13799
253253   /* If blanked, fill with black */
254254   if (state.blanked)
255255   {
256      bitmap->fill(get_black_pen(screen.machine()), *cliprect);
256      bitmap->fill(get_black_pen(screen.machine()), cliprect);
257257      return 0;
258258   }
259259
260   for (y = cliprect->min_y; y <= cliprect->max_y; ++y)
260   for (y = cliprect.min_y; y <= cliprect.max_y; ++y)
261261   {
262262      UINT8 *src = &state.vram[256 * y];
263263      UINT16 *dest = &bitmap->pix16(y);
264264
265      for (x = cliprect->min_x; x <= cliprect->max_x; x += 2)
265      for (x = cliprect.min_x; x <= cliprect.max_x; x += 2)
266266      {
267267         UINT8 pen = src[x >> 1];
268268
src/mame/drivers/bingor.c
r13798r13799
462462   bingor_state *state = screen.machine().driver_data<bingor_state>();
463463   int x,y,count;
464464
465   bitmap->fill(get_black_pen(screen.machine()), *cliprect);
465   bitmap->fill(get_black_pen(screen.machine()), cliprect);
466466
467467   count = (0x2000/2);
468468
src/mame/drivers/mpu4vid.c
r13798r13799
452452   mpu4_state *state = screen.machine().driver_data<mpu4_state>();
453453   int x, y/*, count = 0*/;
454454
455   bitmap->fill(0, *cliprect);
455   bitmap->fill(0, cliprect);
456456
457457   /* this is in main ram.. i think it must transfer it out of here??? */
458458   /* count = 0x0018b6/2; - crmaze count = 0x004950/2; - turnover */
src/mame/drivers/trvmadns.c
r13798r13799
291291   int x,y,count;
292292   const gfx_element *gfx = screen.machine().gfx[0];
293293
294   bitmap->fill(0xd, *cliprect);
294   bitmap->fill(0xd, cliprect);
295295
296296   count = 0;
297297
src/mame/drivers/backfire.c
r13798r13799
9595   deco16ic_pf_update(state->m_deco_tilegen2, state->m_pf3_rowscroll, state->m_pf4_rowscroll);
9696
9797   screen.machine().priority_bitmap->fill(0);
98   bitmap->fill(0x100, *cliprect);
98   bitmap->fill(0x100, cliprect);
9999
100100   if (state->m_left_priority[0] == 0)
101101   {
r13798r13799
128128   deco16ic_pf_update(state->m_deco_tilegen2, state->m_pf3_rowscroll, state->m_pf4_rowscroll);
129129
130130   screen.machine().priority_bitmap->fill(0);
131   bitmap->fill(0x500, *cliprect);
131   bitmap->fill(0x500, cliprect);
132132
133133   if (state->m_right_priority[0] == 0)
134134   {
src/mame/drivers/cubeqst.c
r13798r13799
104104    */
105105
106106   /* Bit 3 selects LD/#GRAPHICS */
107   bitmap->fill(state->m_colormap[255], *cliprect);
107   bitmap->fill(state->m_colormap[255], cliprect);
108108
109109   /* TODO: Add 1 for linebuffering? */
110   for (y = cliprect->min_y; y <= cliprect->max_y; ++y)
110   for (y = cliprect.min_y; y <= cliprect.max_y; ++y)
111111   {
112112      int i;
113113      int num_entries = cubeqcpu_get_ptr_ram_val(screen.machine().device("line_cpu"), y);
src/mame/drivers/astrocorp.c
r13798r13799
9090
9191***************************************************************************/
9292
93static void draw_sprites( running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect )
93static void draw_sprites( running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect )
9494{
9595   astrocorp_state *state = machine.driver_data<astrocorp_state>();
9696   UINT16 *source = state->m_spriteram;
r13798r13799
145145   if (state->m_screen_enable & 1)
146146      copybitmap(bitmap, state->m_bitmap, 0,0,0,0, cliprect);
147147   else
148      bitmap->fill(get_black_pen(screen.machine()), *cliprect);
148      bitmap->fill(get_black_pen(screen.machine()), cliprect);
149149
150150   return 0;
151151}
r13798r13799
163163   UINT16 now = COMBINE_DATA(&state->m_draw_sprites);
164164
165165   if (!old && now)
166      draw_sprites(space->machine(), state->m_bitmap, &space->machine().primary_screen->visible_area());
166      draw_sprites(space->machine(), state->m_bitmap, space->machine().primary_screen->visible_area());
167167}
168168
169169static WRITE16_HANDLER( astrocorp_eeprom_w )
src/mame/drivers/coolridr.c
r13798r13799
357357   }
358358
359359   copybitmap_trans(bitmap, state->m_temp_bitmap_sprites, 0, 0, 0, 0, cliprect, 0);
360   state->m_temp_bitmap_sprites->fill(0, *cliprect);
360   state->m_temp_bitmap_sprites->fill(0, cliprect);
361361
362362
363363   return 0;
r13798r13799
479479                  x2 = (state->m_attr_buff[9] & 0x000001ff);
480480                  clip = state->m_temp_bitmap_sprites->cliprect();
481481
482                  drawgfx_opaque(state->m_temp_bitmap_sprites,&clip,gfx,1,1,0,0,x2,y2);
482                  drawgfx_opaque(state->m_temp_bitmap_sprites,clip,gfx,1,1,0,0,x2,y2);
483483               }
484484            }
485485            if(state->m_attr_index == 0xc)
src/mame/drivers/cobra.c
r13798r13799
149149
150150      for (i=0; i < cobra->polybuffer_ptr; i++)
151151      {
152         poly_render_triangle(cobra->poly, cobra->framebuffer, &screen.machine().primary_screen->visible_area(), render_texture_scan, 2,
152         poly_render_triangle(cobra->poly, cobra->framebuffer, screen.machine().primary_screen->visible_area(), render_texture_scan, 2,
153153                         &cobra->polybuffer[i].v[0], &cobra->polybuffer[i].v[1], &cobra->polybuffer[i].v[2]);
154154         poly_wait(cobra->poly, "Finished render");
155155      }
src/mame/drivers/intrscti.c
r13798r13799
7272   int y,x;
7373   int count;
7474
75   bitmap->fill(get_black_pen(screen.machine()), *cliprect);
75   bitmap->fill(get_black_pen(screen.machine()), cliprect);
7676
7777   count = 0;
7878   for (y=0;y<64;y++)
src/mame/drivers/sfbonus.c
r13798r13799
781781
782782}
783783
784static void sfbonus_draw_reel_layer(screen_device &screen, bitmap_t *bitmap, const rectangle *cliprect, int catagory)
784static void sfbonus_draw_reel_layer(screen_device &screen, bitmap_t *bitmap, const rectangle &cliprect, int catagory)
785785{
786786   sfbonus_state *state = screen.machine().driver_data<sfbonus_state>();
787787   int zz;
r13798r13799
877877
878878      if (rowenable2==0)
879879      {
880         tilemap_draw(state->m_temp_reel_bitmap,&clip,state->m_reel_tilemap,TILEMAP_DRAW_CATEGORY(catagory),3);
880         tilemap_draw(state->m_temp_reel_bitmap,clip,state->m_reel_tilemap,TILEMAP_DRAW_CATEGORY(catagory),3);
881881      }
882882      if (rowenable==0)
883883      {
884         tilemap_draw(state->m_temp_reel_bitmap,&clip,state->m_reel_tilemap,TILEMAP_DRAW_CATEGORY(catagory),3);
884         tilemap_draw(state->m_temp_reel_bitmap,clip,state->m_reel_tilemap,TILEMAP_DRAW_CATEGORY(catagory),3);
885885      }
886886
887887      if (rowenable2==0x1)
888888      {
889         tilemap_draw(state->m_temp_reel_bitmap,&clip,state->m_reel2_tilemap,TILEMAP_DRAW_CATEGORY(catagory),2);
889         tilemap_draw(state->m_temp_reel_bitmap,clip,state->m_reel2_tilemap,TILEMAP_DRAW_CATEGORY(catagory),2);
890890      }
891891      if (rowenable==0x1)
892892      {
893         tilemap_draw(state->m_temp_reel_bitmap,&clip,state->m_reel2_tilemap,TILEMAP_DRAW_CATEGORY(catagory),2);
893         tilemap_draw(state->m_temp_reel_bitmap,clip,state->m_reel2_tilemap,TILEMAP_DRAW_CATEGORY(catagory),2);
894894      }
895895
896896      if (rowenable2==0x2)
897897      {
898         tilemap_draw(state->m_temp_reel_bitmap,&clip,state->m_reel3_tilemap,TILEMAP_DRAW_CATEGORY(catagory),1);
898         tilemap_draw(state->m_temp_reel_bitmap,clip,state->m_reel3_tilemap,TILEMAP_DRAW_CATEGORY(catagory),1);
899899      }
900900      if (rowenable==0x2)
901901      {
902         tilemap_draw(state->m_temp_reel_bitmap,&clip,state->m_reel3_tilemap,TILEMAP_DRAW_CATEGORY(catagory),1);
902         tilemap_draw(state->m_temp_reel_bitmap,clip,state->m_reel3_tilemap,TILEMAP_DRAW_CATEGORY(catagory),1);
903903      }
904904
905905      if (rowenable2==0x3)
906906      {
907         tilemap_draw(state->m_temp_reel_bitmap,&clip,state->m_reel4_tilemap,TILEMAP_DRAW_CATEGORY(catagory),4);
907         tilemap_draw(state->m_temp_reel_bitmap,clip,state->m_reel4_tilemap,TILEMAP_DRAW_CATEGORY(catagory),4);
908908      }
909909      if (rowenable==0x3)
910910      {
911         tilemap_draw(state->m_temp_reel_bitmap,&clip,state->m_reel4_tilemap,TILEMAP_DRAW_CATEGORY(catagory),4);
911         tilemap_draw(state->m_temp_reel_bitmap,clip,state->m_reel4_tilemap,TILEMAP_DRAW_CATEGORY(catagory),4);
912912      }
913913
914914
r13798r13799
934934   globalyscroll += 8;
935935   globalxscroll += 8;
936936
937   bitmap->fill(screen.machine().pens[0], *cliprect);
938   state->m_temp_reel_bitmap->fill(screen.machine().pens[0], *cliprect);
937   bitmap->fill(screen.machine().pens[0], cliprect);
938   state->m_temp_reel_bitmap->fill(screen.machine().pens[0], cliprect);
939939
940940   /* render reels to bitmap */
941941   sfbonus_draw_reel_layer(screen,state->m_temp_reel_bitmap,cliprect,0);
src/mame/drivers/cshooter.c
r13798r13799
138138static SCREEN_UPDATE(cshooter)
139139{
140140   cshooter_state *state = screen.machine().driver_data<cshooter_state>();
141   bitmap->fill(0/*get_black_pen(screen.screen.machine(, *cliprect))*/);
141   bitmap->fill(0/*get_black_pen(screen.screen.machine(, cliprect))*/);
142142   tilemap_mark_all_tiles_dirty(state->m_txtilemap);
143143
144144   //sprites
src/mame/drivers/lgp.c
r13798r13799
9797   palette_set_color(screen.machine(), 0, MAKE_ARGB(0,0,0,0));
9898
9999   /* clear */
100   bitmap->fill(0, *cliprect);
100   bitmap->fill(0, cliprect);
101101
102102   /* Draw tiles */
103103   for (charx = 0; charx < 32; charx++)
src/mame/drivers/multfish.c
r13798r13799
246246   multfish_state *state = screen.machine().driver_data<multfish_state>();
247247   int i;
248248
249   bitmap->fill(get_black_pen(screen.machine()), *cliprect);
249   bitmap->fill(get_black_pen(screen.machine()), cliprect);
250250
251251   if (!state->m_disp_enable) return 0;
252252
src/mame/drivers/tmmjprd.c
r13798r13799
7878   COMBINE_DATA(&state->m_tilemap_ram[3][offset]);
7979}
8080
81static void draw_sprites(running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect, int screen)
81static void draw_sprites(running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect, int screen)
8282{
8383   tmmjprd_state *state = machine.driver_data<tmmjprd_state>();
8484   int xpos,ypos,tileno,xflip,yflip, colr;
r13798r13799
155155   }
156156}
157157
158static void ttmjprd_draw_tile(running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect, int x,int y,int sizex,int sizey, UINT32 tiledata, UINT8* rom)
158static void ttmjprd_draw_tile(running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect, int x,int y,int sizex,int sizey, UINT32 tiledata, UINT8* rom)
159159{
160160   /* note, it's tile address _NOT_ tile number, 'sub-tile' access is possible, hence using the custom rendering */
161161   int tileaddr = (tiledata&0x000fffff)>>0;
r13798r13799
167167   int count;
168168
169169   // entirely off right
170   if (x > cliprect->max_x)
170   if (x > cliprect.max_x)
171171      return;
172172
173173   // entirely off left
174   if ((x+sizex) < cliprect->min_x)
174   if ((x+sizex) < cliprect.min_x)
175175      return;
176176
177177   // entirely off bottom
178   if (y > cliprect->max_y)
178   if (y > cliprect.max_y)
179179      return;
180180
181181   // entirely off bottom
182   if ((y+sizey) < cliprect->min_y)
182   if ((y+sizey) < cliprect.min_y)
183183      return;
184184
185185   count = 0;
r13798r13799
192192
193193         if (!depth)
194194         {
195            if ((drawx < cliprect->max_x) && (drawx > cliprect->min_x) && (drawy < cliprect->max_y) && (drawy > cliprect->min_y))
195            if ((drawx < cliprect.max_x) && (drawx > cliprect.min_x) && (drawy < cliprect.max_y) && (drawy > cliprect.min_y))
196196            {
197197               dat = (rom[(tileaddr*32)+count] & 0xf0)>>4;
198198               if (dat!=15)
r13798r13799
203203               }
204204            }
205205            drawx++;
206            if ((drawx < cliprect->max_x) && (drawx > cliprect->min_x) && (drawy < cliprect->max_y) && (drawy > cliprect->min_y))
206            if ((drawx < cliprect.max_x) && (drawx > cliprect.min_x) && (drawy < cliprect.max_y) && (drawy > cliprect.min_y))
207207            {
208208               dat = (rom[(tileaddr*32)+count] & 0x0f);
209209               if (dat!=15)
r13798r13799
218218         }
219219         else
220220         {
221            if ((drawx < cliprect->max_x) && (drawx > cliprect->min_x) && (drawy < cliprect->max_y) && (drawy > cliprect->min_y))
221            if ((drawx < cliprect.max_x) && (drawx > cliprect.min_x) && (drawy < cliprect.max_y) && (drawy > cliprect.min_y))
222222            {
223223               dat = (rom[(tileaddr*32)+count] & 0xff);
224224               if (dat!=255)
r13798r13799
234234   }
235235}
236236
237static void ttmjprd_draw_tilemap(running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect, UINT32*tileram, UINT32*tileregs, UINT8*rom )
237static void ttmjprd_draw_tilemap(running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect, UINT32*tileram, UINT32*tileregs, UINT8*rom )
238238{
239239   int y,x;
240240   int count;
r13798r13799
280280   tmmjprd_state *state = screen.machine().driver_data<tmmjprd_state>();
281281   UINT8* gfxroms = screen.machine().region("gfx2")->base();
282282
283   bitmap->fill(get_black_pen(screen.machine()), *cliprect);
283   bitmap->fill(get_black_pen(screen.machine()), cliprect);
284284
285285   ttmjprd_draw_tilemap( screen.machine(), bitmap, cliprect, state->m_tilemap_ram[3], state->m_tilemap_regs[3], gfxroms );
286286   draw_sprites(screen.machine(),bitmap,cliprect, 1);
r13798r13799
315315   tmmjprd_state *state = screen.machine().driver_data<tmmjprd_state>();
316316   UINT8* gfxroms = screen.machine().region("gfx2")->base();
317317
318   bitmap->fill(get_black_pen(screen.machine()), *cliprect);
318   bitmap->fill(get_black_pen(screen.machine()), cliprect);
319319
320320   ttmjprd_draw_tilemap( screen.machine(), bitmap, cliprect, state->m_tilemap_ram[1], state->m_tilemap_regs[1], gfxroms );
321321   draw_sprites(screen.machine(),bitmap,cliprect, 0);
src/mame/drivers/witch.c
r13798r13799
708708   tilemap_set_palette_offset(state->m_gfx1_tilemap,0x200);
709709}
710710
711static void draw_sprites(running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect)
711static void draw_sprites(running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect)
712712{
713713   witch_state *state = machine.driver_data<witch_state>();
714714   int i,sx,sy,tileno,flags,color;
src/mame/drivers/luckgrln.c
r13798r13799
276276   clip.min_y = visarea.min_y;
277277   clip.max_y = visarea.max_y;
278278
279   bitmap->fill(0, *cliprect);
279   bitmap->fill(0, cliprect);
280280
281281   for (i= 0;i < 64;i++)
282282   {
r13798r13799
335335#if 0 // treat bit as fg enable
336336         if (tileattr&0x04)
337337         {
338            if (bgenable==0) tilemap_draw(bitmap, &clip, state->m_reel1_tilemap, 0, 0);
339            if (bgenable==1) tilemap_draw(bitmap, &clip, state->m_reel2_tilemap, 0, 0);
340            if (bgenable==2) tilemap_draw(bitmap, &clip, state->m_reel3_tilemap, 0, 0);
341            if (bgenable==3) tilemap_draw(bitmap, &clip, state->m_reel4_tilemap, 0, 0);
338            if (bgenable==0) tilemap_draw(bitmap, clip, state->m_reel1_tilemap, 0, 0);
339            if (bgenable==1) tilemap_draw(bitmap, clip, state->m_reel2_tilemap, 0, 0);
340            if (bgenable==2) tilemap_draw(bitmap, clip, state->m_reel3_tilemap, 0, 0);
341            if (bgenable==3) tilemap_draw(bitmap, clip, state->m_reel4_tilemap, 0, 0);
342342         }
343343
344344         if (tileattr&0x08) drawgfx_transpen(bitmap,clip,screen.machine().gfx[region],tile,col,0,0,x*8,y*8, 0);
345345
346346#else // treat it as priority flag instead (looks better in non-adult title screen - needs verifying)
347         if (!(tileattr&0x08)) drawgfx_transpen(bitmap,&clip,screen.machine().gfx[region],tile,col,0,0,x*8,y*8, 0);
347         if (!(tileattr&0x08)) drawgfx_transpen(bitmap,clip,screen.machine().gfx[region],tile,col,0,0,x*8,y*8, 0);
348348
349349         if (tileattr&0x04)
350350         {
351            if (bgenable==0) tilemap_draw(bitmap, &clip, state->m_reel1_tilemap, 0, 0);
352            if (bgenable==1) tilemap_draw(bitmap, &clip, state->m_reel2_tilemap, 0, 0);
353            if (bgenable==2) tilemap_draw(bitmap, &clip, state->m_reel3_tilemap, 0, 0);
354            if (bgenable==3) tilemap_draw(bitmap, &clip, state->m_reel4_tilemap, 0, 0);
351            if (bgenable==0) tilemap_draw(bitmap, clip, state->m_reel1_tilemap, 0, 0);
352            if (bgenable==1) tilemap_draw(bitmap, clip, state->m_reel2_tilemap, 0, 0);
353            if (bgenable==2) tilemap_draw(bitmap, clip, state->m_reel3_tilemap, 0, 0);
354            if (bgenable==3) tilemap_draw(bitmap, clip, state->m_reel4_tilemap, 0, 0);
355355         }
356356
357         if ((tileattr&0x08)) drawgfx_transpen(bitmap,&clip,screen.machine().gfx[region],tile,col,0,0,x*8,y*8, 0);
357         if ((tileattr&0x08)) drawgfx_transpen(bitmap,clip,screen.machine().gfx[region],tile,col,0,0,x*8,y*8, 0);
358358#endif
359359
360360         count++;
src/mame/drivers/sigmab98.c
r13798r13799
167167
168168***************************************************************************/
169169
170static void draw_sprites(running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect, int pri_mask)
170static void draw_sprites(running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect, int pri_mask)
171171{
172172   sigmab98_state *state = machine.driver_data<sigmab98_state>();
173173   UINT8 *end      =   state->m_spriteram - 0x10;
r13798r13799
265265   }
266266#endif
267267
268   bitmap->fill(get_black_pen(screen.machine()), *cliprect);
268   bitmap->fill(get_black_pen(screen.machine()), cliprect);
269269
270270   // Draw from priority 3 (bottom, converted to a bitmask) to priority 0 (top)
271271   draw_sprites(screen.machine(), bitmap, cliprect, layers_ctrl & 8);
src/mame/drivers/astrof.c
r13798r13799
376376}
377377
378378
379static void video_update_common( running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect, pen_t *pens )
379static void video_update_common( running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect, pen_t *pens )
380380{
381381   astrof_state *state = machine.driver_data<astrof_state>();
382382   offs_t offs;
r13798r13799
397397      if (!state->m_flipscreen)
398398         y = ~y;
399399
400      if ((y <= cliprect->min_y) || (y >= cliprect->max_y))
400      if ((y <= cliprect.min_y) || (y >= cliprect.max_y))
401401         continue;
402402
403403      if (state->m_screen_off)
src/mame/drivers/igspoker.c
r13798r13799
180180static SCREEN_UPDATE(igs_video)
181181{
182182   igspoker_state *state = screen.machine().driver_data<igspoker_state>();
183   bitmap->fill(get_black_pen(screen.machine()), *cliprect);
183   bitmap->fill(get_black_pen(screen.machine()), cliprect);
184184
185185   // FIX: CSK227IT must have some way to disable background, or wrong gfx?
186186   if (state->m_bg_enable) tilemap_draw(bitmap, cliprect, state->m_bg_tilemap, 0, 0);
src/mame/drivers/itgambl3.c
r13798r13799
102102
103103   popmessage("%d %d %04x",state->m_test_x,state->m_test_y,state->m_start_offs);
104104
105   bitmap->fill(get_black_pen(screen.machine()), *cliprect);
105   bitmap->fill(get_black_pen(screen.machine()), cliprect);
106106
107107   count = (state->m_start_offs);
108108
src/mame/drivers/acefruit.c
r13798r13799
7979static SCREEN_UPDATE( acefruit )
8080{
8181   acefruit_state *state = screen.machine().driver_data<acefruit_state>();
82   int startrow = cliprect->min_y / 8;
83   int endrow = cliprect->max_y / 8;
82   int startrow = cliprect.min_y / 8;
83   int endrow = cliprect.max_y / 8;
8484   int row;
8585   int col;
8686
src/mame/drivers/skylncr.c
r13798r13799
154154   skylncr_state *state = screen.machine().driver_data<skylncr_state>();
155155   int i;
156156
157   bitmap->fill(0, *cliprect);
157   bitmap->fill(0, cliprect);
158158   tilemap_draw(bitmap,cliprect, state->m_reel_1_tilemap, 0, 0);
159159
160160   // are these hardcoded, or registers?
r13798r13799
169169      tilemap_set_scrolly(state->m_reel_4_tilemap, i, state->m_reelscroll4[i]);
170170   }
171171
172   tilemap_draw(bitmap,&visible1,state->m_reel_2_tilemap, 0, 0);
173   tilemap_draw(bitmap,&visible2,state->m_reel_3_tilemap, 0, 0);
174   tilemap_draw(bitmap,&visible3,state->m_reel_4_tilemap, 0, 0);
172   tilemap_draw(bitmap,visible1,state->m_reel_2_tilemap, 0, 0);
173   tilemap_draw(bitmap,visible2,state->m_reel_3_tilemap, 0, 0);
174   tilemap_draw(bitmap,visible3,state->m_reel_4_tilemap, 0, 0);
175175
176176
177177   tilemap_draw(bitmap,cliprect, state->m_tmap, 0, 0);
src/mame/drivers/nyny.c
r13798r13799
377377   pen_t *pens = (pen_t *)param;
378378   UINT16 delay_counter = state->m_star_delay_counter;
379379
380   for (y = cliprect->min_y; y <= cliprect->max_y; y++)
380   for (y = cliprect.min_y; y <= cliprect.max_y; y++)
381381   {
382382      int x;
383383
384      for (x = cliprect->min_x; x <= cliprect->max_x; x++)
384      for (x = cliprect.min_x; x <= cliprect.max_x; x++)
385385      {
386386         /* check if the star status */
387387         if (state->m_star_enable &&
src/mame/drivers/limenko.c
r13798r13799
5555};
5656
5757
58static void draw_sprites(running_machine &machine, UINT32 *sprites, const rectangle *cliprect, int count);
58static void draw_sprites(running_machine &machine, UINT32 *sprites, const rectangle &cliprect, int count);
5959
6060/*****************************************************************************************************
6161  MISC FUNCTIONS
r13798r13799
134134   if(state->m_spriteram_bit)
135135   {
136136      // draw the sprites to the frame buffer
137      draw_sprites(space->machine(),state->m_spriteram2,&clip,state->m_prev_sprites_count);
137      draw_sprites(space->machine(),state->m_spriteram2,clip,state->m_prev_sprites_count);
138138   }
139139   else
140140   {
141141      // draw the sprites to the frame buffer
142      draw_sprites(space->machine(),state->m_spriteram,&clip,state->m_prev_sprites_count);
142      draw_sprites(space->machine(),state->m_spriteram,clip,state->m_prev_sprites_count);
143143   }
144144
145145   // buffer the next number of sprites to draw
r13798r13799
256256   SET_TILE_INFO(0,tile,color,0);
257257}
258258
259static void draw_single_sprite(bitmap_t *dest_bmp,const rectangle *clip,const gfx_element *gfx,
259static void draw_single_sprite(bitmap_t *dest_bmp,const rectangle &clip,const gfx_element *gfx,
260260      UINT32 code,UINT32 color,int flipx,int flipy,int sx,int sy,
261261      int priority)
262262{
r13798r13799
299299         y_index = 0;
300300      }
301301
302      if( clip )
303      {
304         if( sx < clip->min_x)
305         { /* clip left */
306            int pixels = clip->min_x-sx;
307            sx += pixels;
308            x_index_base += pixels*dx;
309         }
310         if( sy < clip->min_y )
311         { /* clip top */
312            int pixels = clip->min_y-sy;
313            sy += pixels;
314            y_index += pixels*dy;
315         }
316         /* NS 980211 - fixed incorrect clipping */
317         if( ex > clip->max_x+1 )
318         { /* clip right */
319            int pixels = ex-clip->max_x-1;
320            ex -= pixels;
321         }
322         if( ey > clip->max_y+1 )
323         { /* clip bottom */
324            int pixels = ey-clip->max_y-1;
325            ey -= pixels;
326         }
302      if( sx < clip.min_x)
303      { /* clip left */
304         int pixels = clip.min_x-sx;
305         sx += pixels;
306         x_index_base += pixels*dx;
327307      }
308      if( sy < clip.min_y )
309      { /* clip top */
310         int pixels = clip.min_y-sy;
311         sy += pixels;
312         y_index += pixels*dy;
313      }
314      /* NS 980211 - fixed incorrect clipping */
315      if( ex > clip.max_x+1 )
316      { /* clip right */
317         int pixels = ex-clip.max_x-1;
318         ex -= pixels;
319      }
320      if( ey > clip.max_y+1 )
321      { /* clip bottom */
322         int pixels = ey-clip.max_y-1;
323         ey -= pixels;
324      }
328325
329326      if( ex>sx )
330327      { /* skip if inner loop doesn't draw anything */
r13798r13799
359356}
360357
361358// sprites aren't tile based (except for 8x8 ones)
362static void draw_sprites(running_machine &machine, UINT32 *sprites, const rectangle *cliprect, int count)
359static void draw_sprites(running_machine &machine, UINT32 *sprites, const rectangle &cliprect, int count)
363360{
364361   limenko_state *state = machine.driver_data<limenko_state>();
365362   int i;
r13798r13799
418415   }
419416}
420417
421static void copy_sprites(running_machine &machine, bitmap_t *bitmap, bitmap_t *sprites_bitmap, bitmap_t *priority_bitmap, const rectangle *cliprect)
418static void copy_sprites(running_machine &machine, bitmap_t *bitmap, bitmap_t *sprites_bitmap, bitmap_t *priority_bitmap, const rectangle &cliprect)
422419{
423420   limenko_state *state = machine.driver_data<limenko_state>();
424421   int y;
425   for( y=cliprect->min_y; y<=cliprect->max_y; y++ )
422   for( y=cliprect.min_y; y<=cliprect.max_y; y++ )
426423   {
427424      UINT16 *source = &sprites_bitmap->pix16(y);
428425      UINT16 *dest = &bitmap->pix16(y);
r13798r13799
430427      UINT8 *source_pri = &state->m_sprites_bitmap_pri->pix8(y);
431428
432429      int x;
433      for( x=cliprect->min_x; x<=cliprect->max_x; x++ )
430      for( x=cliprect.min_x; x<=cliprect.max_x; x++ )
434431      {
435432         if( source[x]!= 0 )
436433         {
r13798r13799
460457   limenko_state *state = screen.machine().driver_data<limenko_state>();
461458   // state->m_videoreg[4] ???? It always has this value: 0xffeffff8 (2 signed bytes? values: -17 and -8 ?)
462459
463   screen.machine().priority_bitmap->fill(0, *cliprect);
460   screen.machine().priority_bitmap->fill(0, cliprect);
464461
465462   tilemap_set_enable(state->m_bg_tilemap, state->m_videoreg[0] & 4);
466463   tilemap_set_enable(state->m_md_tilemap, state->m_videoreg[0] & 2);
src/mame/drivers/whitestar.c
r13798r13799
267267
268268bool whitestar_state::screen_update(screen_device &screen, bitmap_t &bitmap, const rectangle &cliprect)
269269{
270   m_mc6845->update(&bitmap, &cliprect);
270   m_mc6845->update(&bitmap, cliprect);
271271   return 0;
272272}
273273
src/mame/drivers/galgame.c
r13798r13799
163163static SCREEN_UPDATE( galaxygame )
164164{
165165   galaxygame_state *state = screen.machine().driver_data<galaxygame_state>();
166   bitmap->fill(get_black_pen(screen.machine()), *cliprect);
166   bitmap->fill(get_black_pen(screen.machine()), cliprect);
167167   for (int i = 0; i < state->m_point_display_list_index; i++ )
168168   {
169169      bitmap->pix16(state->m_point_display_list[i].x >> 7, state->m_point_display_list[i].y >> 7) = 1;
src/mame/drivers/drtomy.c
r13798r13799
6868      3  | xxxxxxxx xxxxxx-- | sprite code
6969*/
7070
71static void draw_sprites( running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect )
71static void draw_sprites( running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect )
7272{
7373   drtomy_state *state = machine.driver_data<drtomy_state>();
7474   int i, x, y, ex, ey;
src/mame/drivers/bmcbowl.c
r13798r13799
140140*/
141141
142142   int x,y,z,pixdat;
143   bitmap->fill(get_black_pen(screen.machine()), *cliprect);
143   bitmap->fill(get_black_pen(screen.machine()), cliprect);
144144
145145   z=0;
146146   for (y=0;y<230;y++)
src/mame/drivers/raiden2.c
r13798r13799
629629
630630/* SPRITE DRAWING (move to video file) */
631631
632void raiden2_state::draw_sprites(running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect ,int pri_mask )
632void raiden2_state::draw_sprites(running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect ,int pri_mask )
633633{
634634   UINT16 *source = sprites + sprites_cur_start/2 - 4;
635635
r13798r13799
889889static SCREEN_UPDATE( raiden2 )
890890{
891891   raiden2_state *state = screen.machine().driver_data<raiden2_state>();
892   bitmap->fill(get_black_pen(screen.machine()), *cliprect);
892   bitmap->fill(get_black_pen(screen.machine()), cliprect);
893893
894894   //if (!screen.machine().input().code_pressed(KEYCODE_Q))
895895   {
src/mame/drivers/kongambl.c
r13798r13799
4343{
4444   device_t *k056832 = screen.machine().device("k056832");
4545
46   bitmap->fill(0, *cliprect);
47   screen.machine().priority_bitmap->fill(0, *cliprect);
46   bitmap->fill(0, cliprect);
47   screen.machine().priority_bitmap->fill(0, cliprect);
4848
4949//  k056832_tilemap_draw(k056832, bitmap, cliprect, 3, 0, 0);
5050//  k056832_tilemap_draw(k056832, bitmap, cliprect, 2, 0, 0);
src/mame/drivers/mogura.c
r13798r13799
9090   clip.min_y = visarea.min_y;
9191   clip.max_y = visarea.max_y;
9292   tilemap_set_scrollx(state->m_tilemap, 0, 256);
93   tilemap_draw(bitmap, &clip, state->m_tilemap, 0, 0);
93   tilemap_draw(bitmap, clip, state->m_tilemap, 0, 0);
9494
9595   clip.min_x = 256;
9696   clip.max_x = 512 - 1;
9797   clip.min_y = visarea.min_y;
9898   clip.max_y = visarea.max_y;
9999   tilemap_set_scrollx(state->m_tilemap, 0, -128);
100   tilemap_draw(bitmap, &clip, state->m_tilemap, 0, 0);
100   tilemap_draw(bitmap, clip, state->m_tilemap, 0, 0);
101101
102102   return 0;
103103}
src/mame/drivers/ddealer.c
r13798r13799
166166   state->m_back_tilemap = tilemap_create(machine, get_back_tile_info, tilemap_scan_cols, 8, 8, 64, 32);
167167}
168168
169static void ddealer_draw_video_layer( running_machine &machine, UINT16* vreg_base, UINT16* top, UINT16* bottom, bitmap_t* bitmap, const rectangle *cliprect, int flipy)
169static void ddealer_draw_video_layer( running_machine &machine, UINT16* vreg_base, UINT16* top, UINT16* bottom, bitmap_t* bitmap, const rectangle &cliprect, int flipy)
170170{
171171   const gfx_element *gfx = machine.gfx[1];
172172
src/mame/drivers/igs009.c
r13798r13799
307307
308308         if (rowenable==0)
309309         { // 0 and 1 are the same? or is there a global switchoff?
310            tilemap_draw(bitmap,&clip,state->m_gp98_reel1_tilemap,0,0);
310            tilemap_draw(bitmap,clip,state->m_gp98_reel1_tilemap,0,0);
311311         }
312312         else if (rowenable==1)
313313         {
314            tilemap_draw(bitmap,&clip,state->m_gp98_reel2_tilemap,0,0);
314            tilemap_draw(bitmap,clip,state->m_gp98_reel2_tilemap,0,0);
315315         }
316316         else if (rowenable==2)
317317         {
318            tilemap_draw(bitmap,&clip,state->m_gp98_reel3_tilemap,0,0);
318            tilemap_draw(bitmap,clip,state->m_gp98_reel3_tilemap,0,0);
319319         }
320320         else if (rowenable==3)
321321         {
322            tilemap_draw(bitmap,&clip,state->m_gp98_reel4_tilemap,0,0);
322            tilemap_draw(bitmap,clip,state->m_gp98_reel4_tilemap,0,0);
323323         }
324324
325325
r13798r13799
327327      }
328328
329329   }
330   else               bitmap->fill(get_black_pen(screen.machine()), *cliprect);
330   else               bitmap->fill(get_black_pen(screen.machine()), cliprect);
331331
332332
333333   if (layers_ctrl & 2)   tilemap_draw(bitmap, cliprect, state->m_fg_tilemap, 0, 0);
src/mame/drivers/dacholer.c
r13798r13799
104104   state->m_scroll_y = data;
105105}
106106
107static void draw_sprites( running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect )
107static void draw_sprites( running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect )
108108{
109109   dacholer_state *state = machine.driver_data<dacholer_state>();
110110   int offs, code, attr, sx, sy, flipx, flipy;
src/mame/drivers/cb2001.c
r13798r13799
325325{
326326   cb2001_state *state = screen.machine().driver_data<cb2001_state>();
327327   int count,x,y;
328   bitmap->fill(get_black_pen(screen.machine()), *cliprect);
328   bitmap->fill(get_black_pen(screen.machine()), cliprect);
329329
330330   count = 0x0000;
331331
r13798r13799
388388         const rectangle visible2(0*8, (14+48)*8-1, 10*8, (10+7)*8-1);
389389         const rectangle visible3(0*8, (14+48)*8-1, 17*8, (17+7)*8-1);
390390
391         tilemap_draw(bitmap, &visible1, state->m_reel1_tilemap, 0, 0);
392         tilemap_draw(bitmap, &visible2, state->m_reel2_tilemap, 0, 0);
393         tilemap_draw(bitmap, &visible3, state->m_reel3_tilemap, 0, 0);
391         tilemap_draw(bitmap, visible1, state->m_reel1_tilemap, 0, 0);
392         tilemap_draw(bitmap, visible2, state->m_reel2_tilemap, 0, 0);
393         tilemap_draw(bitmap, visible3, state->m_reel3_tilemap, 0, 0);
394394      }
395395   }
396396
src/mame/drivers/marinedt.c
r13798r13799
515515   tilemap_draw(state->m_tile, cliprect, state->m_tx_tilemap, 0, 0);
516516
517517   state->m_obj1->fill(0);
518   drawgfx_transpen(state->m_obj1, NULL, screen.machine().gfx[1],
518   drawgfx_transpen(state->m_obj1, state->m_obj1->cliprect(), screen.machine().gfx[1],
519519         OBJ_CODE(state->m_obj1_a),
520520         OBJ_COLOR(state->m_obj1_a),
521521         OBJ_FLIPX(state->m_obj1_a), OBJ_FLIPY(state->m_obj1_a),
522522         0, 0, 0);
523523
524524   state->m_obj2->fill(0);
525   drawgfx_transpen(state->m_obj2, NULL, screen.machine().gfx[2],
525   drawgfx_transpen(state->m_obj2, state->m_obj2->cliprect(), screen.machine().gfx[2],
526526         OBJ_CODE(state->m_obj2_a),
527527         OBJ_COLOR(state->m_obj2_a),
528528         OBJ_FLIPX(state->m_obj2_a), OBJ_FLIPY(state->m_obj2_a),
r13798r13799
547547            int x = OBJ_X(state->m_obj1_x) + sx;
548548            int y = OBJ_Y(state->m_obj1_y) + sy;
549549
550            if (x < cliprect->min_x || x > cliprect->max_x || y < cliprect->min_y || y > cliprect->max_y)
550            if (x < cliprect.min_x || x > cliprect.max_x || y < cliprect.min_y || y > cliprect.max_y)
551551               continue;
552552
553553            if (state->m_obj1->pix16(sy, sx) == 0)
src/mame/drivers/cps3.c
r13798r13799
410410
411411static void copy_from_nvram(running_machine &machine);
412412
413INLINE void cps3_drawgfxzoom(bitmap_t *dest_bmp,const rectangle *clip,const gfx_element *gfx,
413INLINE void cps3_drawgfxzoom(bitmap_t *dest_bmp,const rectangle &clip,const gfx_element *gfx,
414414      unsigned int code,unsigned int color,int flipx,int flipy,int sx,int sy,
415415      int transparency,int transparent_color,
416416      int scalex, int scaley,bitmap_t *pri_buffer,UINT32 pri_mask)
r13798r13799
440440
441441
442442   /* force clip to bitmap boundary */
443   if(clip)
444   {
445      myclip = *clip;
446      myclip &= dest_bmp->cliprect();
447      clip=&myclip;
448   }
443   myclip = clip;
444   myclip &= dest_bmp->cliprect();
449445
450
451446   /* 32-bit ONLY */
452447   {
453448      if( gfx )
r13798r13799
492487               y_index = 0;
493488            }
494489
495            if( clip )
496            {
497               if( sx < clip->min_x)
498               { /* clip left */
499                  int pixels = clip->min_x-sx;
500                  sx += pixels;
501                  x_index_base += pixels*dx;
502               }
503               if( sy < clip->min_y )
504               { /* clip top */
505                  int pixels = clip->min_y-sy;
506                  sy += pixels;
507                  y_index += pixels*dy;
508               }
509               if( ex > clip->max_x+1 )
510               { /* clip right */
511                  int pixels = ex-clip->max_x-1;
512                  ex -= pixels;
513               }
514               if( ey > clip->max_y+1 )
515               { /* clip bottom */
516                  int pixels = ey-clip->max_y-1;
517                  ey -= pixels;
518               }
490            if( sx < myclip.min_x)
491            { /* clip left */
492               int pixels = myclip.min_x-sx;
493               sx += pixels;
494               x_index_base += pixels*dx;
519495            }
496            if( sy < myclip.min_y )
497            { /* clip top */
498               int pixels = myclip.min_y-sy;
499               sy += pixels;
500               y_index += pixels*dy;
501            }
502            if( ex > myclip.max_x+1 )
503            { /* clip right */
504               int pixels = ex-myclip.max_x-1;
505               ex -= pixels;
506            }
507            if( ey > myclip.max_y+1 )
508            { /* clip bottom */
509               int pixels = ey-myclip.max_y-1;
510               ey -= pixels;
511            }
520512
521513            if( ex>sx )
522514            { /* skip if inner loop doesn't draw anything */
r13798r13799
866858
867859// the 0x400 bit in the tilemap regs is "draw it upside-down"  (bios tilemap during flashing, otherwise capcom logo is flipped)
868860
869static void cps3_draw_tilemapsprite_line(running_machine &machine, int tmnum, int drawline, bitmap_t *bitmap, const rectangle *cliprect )
861static void cps3_draw_tilemapsprite_line(running_machine &machine, int tmnum, int drawline, bitmap_t *bitmap, const rectangle &cliprect )
870862{
871863   cps3_state *state = machine.driver_data<cps3_state>();
872864   UINT32* tmapregs[4] = { state->m_tilemap20_regs_base, state->m_tilemap30_regs_base, state->m_tilemap40_regs_base, state->m_tilemap50_regs_base };
r13798r13799
918910
919911      drawline&=0x3ff;
920912
921      if (drawline>cliprect->max_y+4) return;
913      if (drawline>cliprect.max_y+4) return;
922914
923      clip.min_x = cliprect->min_x;
924      clip.max_x = cliprect->max_x;
915      clip.min_x = cliprect.min_x;
916      clip.max_x = cliprect.max_x;
925917      clip.min_y = drawline;
926918      clip.max_y = drawline;
927919
928      for (x=0;x<(cliprect->max_x/16)+2;x++)
920      for (x=0;x<(cliprect.max_x/16)+2;x++)
929921      {
930922
931923         UINT32 dat;
r13798r13799
944936         if (!bpp) machine.gfx[1]->color_granularity=256;
945937         else machine.gfx[1]->color_granularity=64;
946938
947         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);
939         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);
948940      }
949941   }
950942}
r13798r13799
11011093               {
11021094                  for (uu=0;uu<1023;uu++)
11031095                  {
1104                     cps3_draw_tilemapsprite_line(screen.machine(), tilemapnum, uu, state->m_renderbuffer_bitmap, &state->m_renderbuffer_clip );
1096                     cps3_draw_tilemapsprite_line(screen.machine(), tilemapnum, uu, state->m_renderbuffer_bitmap, state->m_renderbuffer_clip );
11051097                  }
11061098               }
11071099               bg_drawn[tilemapnum] = 1;
r13798r13799
11881180
11891181                           if (global_alpha || alpha)
11901182                           {
1191                              cps3_drawgfxzoom(state->m_renderbuffer_bitmap,&state->m_renderbuffer_clip,screen.machine().gfx[1],realtileno,actualpal,0^flipx,0^flipy,current_xpos,current_ypos,CPS3_TRANSPARENCY_PEN_INDEX_BLEND,0,xinc,yinc, NULL, 0);
1183                              cps3_drawgfxzoom(state->m_renderbuffer_bitmap,state->m_renderbuffer_clip,screen.machine().gfx[1],realtileno,actualpal,0^flipx,0^flipy,current_xpos,current_ypos,CPS3_TRANSPARENCY_PEN_INDEX_BLEND,0,xinc,yinc, NULL, 0);
11921184                           }
11931185                           else
11941186                           {
1195                              cps3_drawgfxzoom(state->m_renderbuffer_bitmap,&state->m_renderbuffer_clip,screen.machine().gfx[1],realtileno,actualpal,0^flipx,0^flipy,current_xpos,current_ypos,CPS3_TRANSPARENCY_PEN_INDEX,0,xinc,yinc, NULL, 0);
1187                              cps3_drawgfxzoom(state->m_renderbuffer_bitmap,state->m_renderbuffer_clip,screen.machine().gfx[1],realtileno,actualpal,0^flipx,0^flipy,current_xpos,current_ypos,CPS3_TRANSPARENCY_PEN_INDEX,0,xinc,yinc, NULL, 0);
11961188                           }
11971189                           count++;
11981190                        }
src/mame/drivers/tonton.c
r13798r13799
7171static SCREEN_UPDATE( tonton )
7272{
7373   tonton_state *state = screen.machine().driver_data<tonton_state>();
74   bitmap->fill(get_black_pen(screen.machine()), *cliprect);
74   bitmap->fill(get_black_pen(screen.machine()), cliprect);
7575
7676   copybitmap(bitmap, state->m_vdp0_bitmap, 0, 0, 0, 0, cliprect);
7777
src/mame/drivers/subsino.c
r13798r13799
454454static SCREEN_UPDATE( subsino )
455455{
456456   subsino_state *state = screen.machine().driver_data<subsino_state>();
457   bitmap->fill(0, *cliprect);
457   bitmap->fill(0, cliprect);
458458   tilemap_draw(bitmap,cliprect, state->m_tmap, 0, 0);
459459   return 0;
460460}
r13798r13799
463463{
464464   subsino_state *state = screen.machine().driver_data<subsino_state>();
465465   int i;
466   bitmap->fill(0, *cliprect);
466   bitmap->fill(0, cliprect);
467467
468468   for (i= 0;i < 64;i++)
469469   {
r13798r13799
479479      const rectangle visible2(0*8, (14+48)*8-1, 10*8, (10+7)*8-1);
480480      const rectangle visible3(0*8, (14+48)*8-1, 18*8, (18+7)*8-1);
481481
482      tilemap_draw(bitmap, &visible1, state->m_reel1_tilemap, 0, 0);
483      tilemap_draw(bitmap, &visible2, state->m_reel2_tilemap, 0, 0);
484      tilemap_draw(bitmap, &visible3, state->m_reel3_tilemap, 0, 0);
482      tilemap_draw(bitmap, visible1, state->m_reel1_tilemap, 0, 0);
483      tilemap_draw(bitmap, visible2, state->m_reel2_tilemap, 0, 0);
484      tilemap_draw(bitmap, visible3, state->m_reel3_tilemap, 0, 0);
485485   }
486486
487487   tilemap_draw(bitmap,cliprect, state->m_tmap, 0, 0);
r13798r13799
493493{
494494   subsino_state *state = screen.machine().driver_data<subsino_state>();
495495   int i;
496   bitmap->fill(0, *cliprect);
496   bitmap->fill(0, cliprect);
497497
498498   if (state->m_reel1_attr)
499499   {
r13798r13799
516516      const rectangle visible2(0, 511,  88, 143);
517517      const rectangle visible3(0, 511,  144, 223);
518518
519      tilemap_draw(bitmap, &visible1, state->m_reel1_tilemap, 0, 0);
520      tilemap_draw(bitmap, &visible2, state->m_reel2_tilemap, 0, 0);
521      tilemap_draw(bitmap, &visible3, state->m_reel3_tilemap, 0, 0);
519      tilemap_draw(bitmap, visible1, state->m_reel1_tilemap, 0, 0);
520      tilemap_draw(bitmap, visible2, state->m_reel2_tilemap, 0, 0);
521      tilemap_draw(bitmap, visible3, state->m_reel3_tilemap, 0, 0);
522522   }
523523
524524   tilemap_draw(bitmap,cliprect, state->m_tmap, 0, 0);
src/mame/drivers/jchan.c
r13798r13799
368368   UINT16 pixdata1;
369369   UINT16 pixdata2;
370370
371   bitmap->fill(get_black_pen(screen.machine()), *cliprect);
371   bitmap->fill(get_black_pen(screen.machine()), cliprect);
372372
373373   SCREEN_UPDATE_CALL(jchan_view2);
374374
375   state->m_sprite_bitmap_1->fill(0x0000, *cliprect);
376   state->m_sprite_bitmap_2->fill(0x0000, *cliprect);
375   state->m_sprite_bitmap_1->fill(0x0000, cliprect);
376   state->m_sprite_bitmap_2->fill(0x0000, cliprect);
377377
378378   state->m_spritegen1->skns_draw_sprites(screen.machine(), state->m_sprite_bitmap_1, cliprect, state->m_sprite_ram32_1, 0x4000, screen.machine().region("gfx1")->base(), screen.machine().region ("gfx1")->bytes(), state->m_sprite_regs32_1 );
379379   state->m_spritegen2->skns_draw_sprites(screen.machine(), state->m_sprite_bitmap_2, cliprect, state->m_sprite_ram32_2, 0x4000, screen.machine().region("gfx2")->base(), screen.machine().region ("gfx2")->bytes(), state->m_sprite_regs32_2 );
src/mame/drivers/mlanding.c
r13798r13799
6363   mlanding_state *state = screen.machine().driver_data<mlanding_state>();
6464   int x, y;
6565
66   for (y = cliprect->min_y; y <= cliprect->max_y; ++y)
66   for (y = cliprect.min_y; y <= cliprect.max_y; ++y)
6767   {
68      UINT16 *src = &state->m_g_ram[y * 512/2 + cliprect->min_x];
69      UINT16 *dst = &bitmap->pix16(y, cliprect->min_x);
68      UINT16 *src = &state->m_g_ram[y * 512/2 + cliprect.min_x];
69      UINT16 *dst = &bitmap->pix16(y, cliprect.min_x);
7070
71      for (x = cliprect->min_x; x <= cliprect->max_x; x += 2)
71      for (x = cliprect.min_x; x <= cliprect.max_x; x += 2)
7272      {
7373         UINT16 srcpix = *src++;
7474
src/mame/drivers/neoprint.c
r13798r13799
5353---- ---- --?? ??xx [6] map register
5454*/
5555
56static void draw_layer(running_machine &machine, bitmap_t *bitmap,const rectangle *cliprect,int layer,int data_shift)
56static void draw_layer(running_machine &machine, bitmap_t *bitmap,const rectangle &cliprect,int layer,int data_shift)
5757{
5858   neoprint_state *state = machine.driver_data<neoprint_state>();
5959   int i, y, x;
r13798r13799
9393
9494SCREEN_UPDATE(neoprint)
9595{
96   bitmap->fill(0, *cliprect);
96   bitmap->fill(0, cliprect);
9797
9898   draw_layer(screen.machine(),bitmap,cliprect,1,2);
9999   draw_layer(screen.machine(),bitmap,cliprect,0,2);
r13798r13799
103103
104104SCREEN_UPDATE(nprsp)
105105{
106   bitmap->fill(0, *cliprect);
106   bitmap->fill(0, cliprect);
107107
108108   draw_layer(screen.machine(),bitmap,cliprect,1,0);
109109   draw_layer(screen.machine(),bitmap,cliprect,2,0);
src/mame/drivers/tmaster.c
r13798r13799
330330#endif
331331
332332
333   bitmap->fill(get_black_pen(screen.machine()), *cliprect);
333   bitmap->fill(get_black_pen(screen.machine()), cliprect);
334334
335335   if (layers_ctrl & 1)   copybitmap_trans(bitmap, state->m_bitmap[0][(state->m_regs[0x02/2]>>8)&1], 0,0,0,0, cliprect, 0xff);
336336   if (layers_ctrl & 2)   copybitmap_trans(bitmap, state->m_bitmap[1][(state->m_regs[0x02/2]>>9)&1], 0,0,0,0, cliprect, 0xff);
src/mame/drivers/flyball.c
r13798r13799
107107
108108   for (y = bally; y < bally + 2; y++)
109109      for (x = ballx; x < ballx + 2; x++)
110         if (x >= cliprect->min_x &&
111             x <= cliprect->max_x &&
112             y >= cliprect->min_y &&
113             y <= cliprect->max_y)
110         if (x >= cliprect.min_x &&
111             x <= cliprect.max_x &&
112             y >= cliprect.min_y &&
113             y <= cliprect.max_y)
114114            bitmap->pix16(y, x) = 1;
115115   return 0;
116116}
src/mame/drivers/pturn.c
r13798r13799
154154   int sx, sy;
155155   int flipx, flipy;
156156
157   bitmap->fill(state->m_bgcolor, *cliprect);
157   bitmap->fill(state->m_bgcolor, cliprect);
158158   tilemap_draw(bitmap,cliprect,state->m_bgmap,0,0);
159159   for ( offs = 0x80-4 ; offs >=0 ; offs -= 4)
160160   {
src/mame/drivers/firebeat.c
r13798r13799
192192}
193193
194194
195static void gcu_draw_object(running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect, int chip, UINT32 *cmd)
195static void gcu_draw_object(running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect, int chip, UINT32 *cmd)
196196{
197197   firebeat_state *state = machine.driver_data<firebeat_state>();
198198   // 0x00: xxx----- -------- -------- --------   command type
r13798r13799
239239   width   = (((width * 65536) / xscale) * 64) / 65536;
240240   height   = (((height * 65536) / yscale) * 64) / 65536;
241241
242   if (y > cliprect->max_y || x > cliprect->max_x) {
242   if (y > cliprect.max_y || x > cliprect.max_x) {
243243      return;
244244   }
245   if ((y+height) > cliprect->max_y) {
246      height = cliprect->max_y - y;
245   if ((y+height) > cliprect.max_y) {
246      height = cliprect.max_y - y;
247247   }
248   if ((x+width) > cliprect->max_x) {
249      width = cliprect->max_x - x;
248   if ((x+width) > cliprect.max_x) {
249      width = cliprect.max_x - x;
250250   }
251251
252252   v = 0;
r13798r13799
346346   }
347347}
348348
349static void gcu_fill_rect(bitmap_t *bitmap, const rectangle *cliprect, UINT32 *cmd)
349static void gcu_fill_rect(bitmap_t *bitmap, const rectangle &cliprect, UINT32 *cmd)
350350{
351351   int i, j;
352352   int x1, y1, x2, y2;
r13798r13799
375375   }
376376
377377   // clip
378   if (x1 < cliprect->min_x)   x1 = cliprect->min_x;
379   if (y1 < cliprect->min_y)   y1 = cliprect->min_y;
380   if (x2 > cliprect->max_x)   x2 = cliprect->max_x;
381   if (y2 > cliprect->max_y)   y2 = cliprect->max_y;
378   if (x1 < cliprect.min_x)   x1 = cliprect.min_x;
379   if (y1 < cliprect.min_y)   y1 = cliprect.min_y;
380   if (x2 > cliprect.max_x)   x2 = cliprect.max_x;
381   if (y2 > cliprect.max_y)   y2 = cliprect.max_y;
382382
383383   for (j=y1; j < y2; j++)
384384   {
r13798r13799
393393   }
394394}
395395
396static void gcu_draw_character(running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect, int chip, UINT32 *cmd)
396static void gcu_draw_character(running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect, int chip, UINT32 *cmd)
397397{
398398   firebeat_state *state = machine.driver_data<firebeat_state>();
399399   // 0x00: xxx----- -------- -------- --------   command type
r13798r13799
422422   color[3] = (cmd[3] >>  0) & 0xffff;
423423
424424
425   if (y > cliprect->max_y || x > cliprect->max_x) {
425   if (y > cliprect.max_y || x > cliprect.max_x) {
426426      return;
427427   }
428428
r13798r13799
442442   }
443443}
444444
445static void gcu_exec_display_list(running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect, int chip, UINT32 address)
445static void gcu_exec_display_list(running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect, int chip, UINT32 address)
446446{
447447   firebeat_state *state = machine.driver_data<firebeat_state>();
448448   int counter = 0;
r13798r13799
513513   };
514514}
515515
516static UINT32 update_screen(screen_device &screen, bitmap_t *bitmap, const rectangle *cliprect, int chip)
516static UINT32 update_screen(screen_device &screen, bitmap_t *bitmap, const rectangle &cliprect, int chip)
517517{
518518   firebeat_state *state = screen.machine().driver_data<firebeat_state>();
519519
520   bitmap->fill(0, *cliprect);
520   bitmap->fill(0, cliprect);
521521
522522   if (mame_stricmp(screen.machine().system().name, "popn7") == 0)
523523   {
src/mame/drivers/dunhuang.c
r13798r13799
147147}
148148#endif
149149
150   bitmap->fill(get_black_pen(screen.machine()), *cliprect);
150   bitmap->fill(get_black_pen(screen.machine()), cliprect);
151151
152152   switch (state->m_layers)
153153   {
src/mame/drivers/progolf.c
r13798r13799
127127               {
128128                  color = state->m_fg_fb[(xi+yi*8)+count*0x40];
129129
130                  if((x+yi) <= cliprect->max_x && (256-y+xi) <= cliprect->max_y && color != 0)
130                  if((x+yi) <= cliprect.max_x && (256-y+xi) <= cliprect.max_y && color != 0)
131131                     bitmap->pix16(x+yi, 256-y+xi) = screen.machine().pens[(color & 0x7)];
132132               }
133133            }
src/mame/drivers/powerbal.c
r13798r13799
388388   SET_TILE_INFO(1, code, colr >> 12, 0);
389389}
390390
391static void draw_sprites( running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect )
391static void draw_sprites( running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect )
392392{
393393   playmark_state *state = machine.driver_data<playmark_state>();
394394   UINT16 *spriteram = state->m_spriteram;
src/mame/drivers/jackie.c
r13798r13799
181181   int startclipmin = 0;
182182   const rectangle &visarea = screen.visible_area();
183183
184   bitmap->fill(get_black_pen(screen.machine()), *cliprect);
184   bitmap->fill(get_black_pen(screen.machine()), cliprect);
185185
186186   for (i=0;i < 0x40;i++)
187187   {
r13798r13799
203203
204204      if (rowenable==0)
205205      {
206         tilemap_draw(bitmap,&clip,state->m_reel1_tilemap,0,0);
206         tilemap_draw(bitmap,clip,state->m_reel1_tilemap,0,0);
207207      }
208208      else if (rowenable==1)
209209      {
210         tilemap_draw(bitmap,&clip,state->m_reel2_tilemap,0,0);
210         tilemap_draw(bitmap,clip,state->m_reel2_tilemap,0,0);
211211      }
212212      else if (rowenable==2)
213213      {
214         tilemap_draw(bitmap,&clip,state->m_reel3_tilemap,0,0);
214         tilemap_draw(bitmap,clip,state->m_reel3_tilemap,0,0);
215215      }
216216      else if (rowenable==3)
217217      {
src/mame/drivers/blackt96.c
r13798r13799
6868{
6969}
7070
71static void draw_strip(running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect, int stripnum, int xbase, int ybase, int bg)
71static void draw_strip(running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect, int stripnum, int xbase, int ybase, int bg)
7272{
7373   blackt96_state *state = machine.driver_data<blackt96_state>();
7474   const gfx_element *gfxspr = machine.gfx[1];
r13798r13799
9898
9999}
100100
101static void draw_main(running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect, int bg)
101static void draw_main(running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect, int bg)
102102{
103103   blackt96_state *state = machine.driver_data<blackt96_state>();
104104
r13798r13799
135135   int x,y;
136136   const gfx_element *gfx = screen.machine().gfx[2];
137137
138   bitmap->fill(get_black_pen(screen.machine()), *cliprect);
138   bitmap->fill(get_black_pen(screen.machine()), cliprect);
139139
140140   draw_main(screen.machine(),bitmap,cliprect,1);
141141   draw_main(screen.machine(),bitmap,cliprect,0);
src/mame/drivers/ace.c
r13798r13799
8888   int offs;
8989
9090   /* first of all, fill the screen with the background color */
91   bitmap->fill(0, *cliprect);
91   bitmap->fill(0, cliprect);
9292
9393   drawgfx_opaque(bitmap, cliprect, screen.machine().gfx[1],
9494         0,
src/mame/drivers/dreamwld.c
r13798r13799
150150
151151
152152
153static void draw_sprites( running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect )
153static void draw_sprites( running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect )
154154{
155155   dreamwld_state *state = machine.driver_data<dreamwld_state>();
156156   const gfx_element *gfx = machine.gfx[0];
src/mame/drivers/panicr.c
r13798r13799
215215   colortable_configure_tilemap_groups(machine.colortable, state->m_txttilemap, machine.gfx[0], 0);
216216}
217217
218static void draw_sprites(running_machine &machine, bitmap_t *bitmap,const rectangle *cliprect )
218static void draw_sprites(running_machine &machine, bitmap_t *bitmap,const rectangle &cliprect )
219219{
220220   panicr_state *state = machine.driver_data<panicr_state>();
221221   UINT8 *spriteram = state->m_spriteram;
r13798r13799
242242static SCREEN_UPDATE( panicr)
243243{
244244   panicr_state *state = screen.machine().driver_data<panicr_state>();
245   bitmap->fill(get_black_pen(screen.machine()), *cliprect);
245   bitmap->fill(get_black_pen(screen.machine()), cliprect);
246246   tilemap_mark_all_tiles_dirty( state->m_txttilemap );
247247   tilemap_set_scrollx( state->m_bgtilemap,0, ((state->m_scrollram[0x02]&0x0f)<<12)+((state->m_scrollram[0x02]&0xf0)<<4)+((state->m_scrollram[0x04]&0x7f)<<1)+((state->m_scrollram[0x04]&0x80)>>7) );
248248   tilemap_draw(bitmap,cliprect,state->m_bgtilemap,0,0);
src/mame/drivers/istellar.c
r13798r13799
5252   int charx, chary;
5353
5454   /* clear */
55   bitmap->fill(0, *cliprect);
55   bitmap->fill(0, cliprect);
5656
5757   /* DEBUG */
5858   /*
src/mame/drivers/sbowling.c
r13798r13799
112112{
113113   sbowling_state *state = screen.machine().driver_data<sbowling_state>();
114114
115   bitmap->fill(0x18, *cliprect);
115   bitmap->fill(0x18, cliprect);
116116   tilemap_draw(bitmap, cliprect,state->m_sb_tilemap, 0, 0);
117117   copybitmap_trans(bitmap, state->m_tmpbitmap, 0, 0, 0, 0, cliprect, state->m_color_prom_address);
118118   return 0;
src/mame/drivers/mirage.c
r13798r13799
8383
8484   deco16ic_pf_update(state->m_deco_tilegen1, state->m_pf1_rowscroll, state->m_pf2_rowscroll);
8585
86   bitmap->fill(256, *cliprect); /* not verified */
86   bitmap->fill(256, cliprect); /* not verified */
8787
8888   deco16ic_tilemap_2_draw(state->m_deco_tilegen1, bitmap, cliprect, TILEMAP_DRAW_OPAQUE, 0);
8989   screen.machine().device<decospr_device>("spritegen")->inefficient_copy_sprite_bitmap(screen.machine(), bitmap, cliprect, 0x0800, 0x0800, 0x200, 0x1ff);
src/mame/drivers/jalmah.c
r13798r13799
347347   //popmessage("%02x %02x %02x %02x",state->m_sc0_prin,state->m_sc1_prin,state->m_sc2_prin,state->m_sc3_prin);
348348}
349349
350static void draw_sc0_layer(running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect)
350static void draw_sc0_layer(running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect)
351351{
352352   jalmah_state *state = machine.driver_data<jalmah_state>();
353353   switch(state->m_jm_vregs[0] & 3)
r13798r13799
359359   }
360360}
361361
362static void draw_sc1_layer(running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect)
362static void draw_sc1_layer(running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect)
363363{
364364   jalmah_state *state = machine.driver_data<jalmah_state>();
365365   switch(state->m_jm_vregs[1] & 3)
r13798r13799
371371   }
372372}
373373
374static void draw_sc2_layer(running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect)
374static void draw_sc2_layer(running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect)
375375{
376376   jalmah_state *state = machine.driver_data<jalmah_state>();
377377   switch(state->m_jm_vregs[2] & 3)
r13798r13799
383383   }
384384}
385385
386static void draw_sc3_layer(running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect)
386static void draw_sc3_layer(running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect)
387387{
388388   jalmah_state *state = machine.driver_data<jalmah_state>();
389389   switch(state->m_jm_vregs[3] & 3)
r13798r13799
443443   tilemap_set_scrolly(state->m_sc3_tilemap_2, 0, jm_scrollram[7] & 0x1ff);
444444   tilemap_set_scrolly(state->m_sc3_tilemap_3, 0, jm_scrollram[7] & 0x3ff);
445445
446   bitmap->fill(screen.machine().pens[0xff], *cliprect); //selectable by a ram address?
446   bitmap->fill(screen.machine().pens[0xff], cliprect); //selectable by a ram address?
447447
448448   for(cur_prin=1;cur_prin<=0x8;cur_prin<<=1)
449449   {
r13798r13799
466466   tilemap_set_scrolly(state->m_sc0_tilemap_0, 0, jm_scrollram[4]);
467467   tilemap_set_scrolly(state->m_sc3_tilemap_0, 0, jm_scrollram[7]);
468468
469   bitmap->fill(screen.machine().pens[0x1ff], *cliprect);//selectable by a ram address?
469   bitmap->fill(screen.machine().pens[0x1ff], cliprect);//selectable by a ram address?
470470   if(state->m_jm_vregs[0] & 1) { tilemap_draw(bitmap,cliprect,state->m_sc0_tilemap_0,0,0); }
471471   if(state->m_jm_vregs[3] & 1) { tilemap_draw(bitmap,cliprect,state->m_sc3_tilemap_0,0,0); }
472472   return 0;
src/mame/drivers/dotrikun.c
r13798r13799
6767   pen_t back_pen = MAKE_RGB(pal1bit(state->m_color >> 3), pal1bit(state->m_color >> 4), pal1bit(state->m_color >> 5));
6868   pen_t fore_pen = MAKE_RGB(pal1bit(state->m_color >> 0), pal1bit(state->m_color >> 1), pal1bit(state->m_color >> 2));
6969
70   for(y = (cliprect->min_y & ~1); y < cliprect->max_y; y+=2)
70   for(y = (cliprect.min_y & ~1); y < cliprect.max_y; y+=2)
7171   {
7272      for (x = 0; x < 256; x+=16)
7373      {
src/mame/drivers/spoker.c
r13798r13799
9393{
9494   spoker_state *state = screen.machine().driver_data<spoker_state>();
9595
96   bitmap->fill(get_black_pen(screen.machine()), *cliprect);
96   bitmap->fill(get_black_pen(screen.machine()), cliprect);
9797   tilemap_draw(bitmap, cliprect, state->m_bg_tilemap, 0, 0);
9898   tilemap_draw(bitmap, cliprect, state->m_fg_tilemap, 0, 0);
9999   return 0;
src/mame/drivers/zr107.c
r13798r13799
207207   zr107_state *state = screen.machine().driver_data<zr107_state>();
208208   device_t *k001604 = screen.machine().device("k001604");
209209
210   bitmap->fill(screen.machine().pens[0], *cliprect);
210   bitmap->fill(screen.machine().pens[0], cliprect);
211211
212212   K001005_draw(bitmap, cliprect);
213213
r13798r13799
259259{
260260   zr107_state *state = screen.machine().driver_data<zr107_state>();
261261   device_t *k056832 = screen.machine().device("k056832");
262   bitmap->fill(screen.machine().pens[0], *cliprect);
262   bitmap->fill(screen.machine().pens[0], cliprect);
263263
264264   k056832_tilemap_draw(k056832, bitmap, cliprect, 1, 0, 0);
265265   K001005_draw(bitmap, cliprect);
src/mame/drivers/dominob.c
r13798r13799
8787   machine.gfx[0]->color_granularity = 8;
8888}
8989
90static void draw_sprites( running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect )
90static void draw_sprites( running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect )
9191{
9292   dominob_state *state = machine.driver_data<dominob_state>();
9393   int offs;
src/mame/drivers/nmg5.c
r13798r13799
845845   tilemap_set_transparent_pen(state->m_fg_tilemap, 0);
846846}
847847
848static void draw_sprites( running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect )
848static void draw_sprites( running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect )
849849{
850850   nmg5_state *state = machine.driver_data<nmg5_state>();
851851   UINT16 *spriteram = state->m_spriteram;
src/mame/drivers/taitowlf.c
r13798r13799
6868   int x,y,count;
6969   const UINT8 *blit_ram = screen.machine().region("user5")->base();
7070
71   bitmap->fill(get_black_pen(screen.machine()), *cliprect);
71   bitmap->fill(get_black_pen(screen.machine()), cliprect);
7272
7373   count = (0);
7474
src/mame/drivers/pzletime.c
r13798r13799
8181   int count;
8282   int y, x;
8383
84   bitmap->fill(screen.machine().pens[0], *cliprect); //bg pen
84   bitmap->fill(screen.machine().pens[0], cliprect); //bg pen
8585
8686   tilemap_set_scrolly(state->m_txt_tilemap, 0, state->m_tilemap_regs[0] - 3);
8787   tilemap_set_scrollx(state->m_txt_tilemap, 0, state->m_tilemap_regs[1]);
src/mame/drivers/darkhors.c
r13798r13799
129129   tilemap_mark_tile_dirty(state->m_tmap2, offset);
130130}
131131
132static void draw_sprites(running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect)
132static void draw_sprites(running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect)
133133{
134134   darkhors_state *state = machine.driver_data<darkhors_state>();
135135   UINT32 *s      =   state->m_spriteram;
r13798r13799
195195   }
196196#endif
197197
198   bitmap->fill(get_black_pen(screen.machine()), *cliprect);
198   bitmap->fill(get_black_pen(screen.machine()), cliprect);
199199
200200   tilemap_set_scrollx(state->m_tmap,0, (state->m_tmapscroll[0] >> 16) - 5);
201201   tilemap_set_scrolly(state->m_tmap,0, (state->m_tmapscroll[0] & 0xffff) - 0xff );
src/mame/drivers/mirax.c
r13798r13799
9090{
9191}
9292
93static void draw_sprites(running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect)
93static void draw_sprites(running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect)
9494{
9595   mirax_state *state = machine.driver_data<mirax_state>();
9696   UINT8 *spriteram = state->m_spriteram;
src/mame/drivers/cardline.c
r13798r13799
4848{
4949   cardline_state *state = screen.machine().driver_data<cardline_state>();
5050   int x,y;
51   bitmap->fill(0, *cliprect);
51   bitmap->fill(0, cliprect);
5252   for(y=0;y<32;y++)
5353   {
5454      for(x=0;x<64;x++)
src/mame/drivers/jollyjgr.c
r13798r13799
488488   UINT8 *spriteram = state->m_spriteram;
489489   int offs;
490490
491   bitmap->fill(32, *cliprect);
491   bitmap->fill(32, cliprect);
492492
493493   if(state->m_pri) //used in Frog & Spiders level 3
494494   {
r13798r13799
559559      if (state->m_flip_y) sy^=0xff;
560560      if (state->m_flip_x) sx+=8;
561561
562      if (sy>=cliprect->min_y && sy<=cliprect->max_y)
562      if (sy>=cliprect.min_y && sy<=cliprect.max_y)
563563         for (int x=sx-4;x<sx;x++)
564            if (x>=cliprect->min_x && x<=cliprect->max_x)
564            if (x>=cliprect.min_x && x<=cliprect.max_x)
565565               bitmap->pix16(sy, x)=bc;
566566   }
567567
src/mame/drivers/quizpun2.c
r13798r13799
163163#endif
164164
165165   if (layers_ctrl & 1)   tilemap_draw(bitmap,cliprect, state->m_bg_tmap,  TILEMAP_DRAW_OPAQUE, 0);
166   else               bitmap->fill(get_black_pen(screen.machine()), *cliprect);
166   else               bitmap->fill(get_black_pen(screen.machine()), cliprect);
167167
168bitmap->fill(get_black_pen(screen.machine()), *cliprect);
168bitmap->fill(get_black_pen(screen.machine()), cliprect);
169169   if (layers_ctrl & 2)   tilemap_draw(bitmap,cliprect, state->m_fg_tmap, 0, 0);
170170
171171   return 0;
src/mame/drivers/egghunt.c
r13798r13799
6969};
7070
7171
72static void draw_sprites( running_machine &machine, bitmap_t *bitmap,const rectangle *cliprect )
72static void draw_sprites( running_machine &machine, bitmap_t *bitmap,const rectangle &cliprect )
7373{
7474   egghunt_state *state = machine.driver_data<egghunt_state>();
7575   int flipscreen = 0;
src/mame/drivers/gpworld.c
r13798r13799
7070
7171
7272/* VIDEO GOODS */
73static void gpworld_draw_tiles(running_machine &machine, bitmap_t *bitmap,const rectangle *cliprect)
73static void gpworld_draw_tiles(running_machine &machine, bitmap_t *bitmap,const rectangle &cliprect)
7474{
7575   gpworld_state *state = machine.driver_data<gpworld_state>();
7676   UINT8 characterX, characterY;
r13798r13799
8888   }
8989}
9090
91INLINE void draw_pixel(bitmap_t *bitmap,const rectangle *cliprect,int x,int y,int color,int flip)
91INLINE void draw_pixel(bitmap_t *bitmap,const rectangle &cliprect,int x,int y,int color,int flip)
9292{
9393   if (flip)
9494   {
r13798r13799
9696      y = bitmap->height() - y - 1;
9797   }
9898
99   if (x < cliprect->min_x ||
100      x > cliprect->max_x ||
101      y < cliprect->min_y ||
102      y > cliprect->max_y)
99   if (x < cliprect.min_x ||
100      x > cliprect.max_x ||
101      y < cliprect.min_y ||
102      y > cliprect.max_y)
103103      return;
104104
105105   bitmap->pix32(y, x) = color;
106106}
107107
108static void gpworld_draw_sprites(running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect)
108static void gpworld_draw_sprites(running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect)
109109{
110110   gpworld_state *state = machine.driver_data<gpworld_state>();
111111   const int SPR_Y_TOP     = 0;
r13798r13799
218218
219219static SCREEN_UPDATE( gpworld )
220220{
221   bitmap->fill(0, *cliprect);
221   bitmap->fill(0, cliprect);
222222
223223   gpworld_draw_tiles(screen.machine(), bitmap, cliprect);
224224   gpworld_draw_sprites(screen.machine(), bitmap, cliprect);
src/mame/drivers/umipoker.c
r13798r13799
117117   tilemap_set_scrolly(state->m_tilemap_2, 0, state->m_umipoker_scrolly[2]);
118118   tilemap_set_scrolly(state->m_tilemap_3, 0, state->m_umipoker_scrolly[3]);
119119
120   bitmap->fill(get_black_pen(screen.machine()), *cliprect);
120   bitmap->fill(get_black_pen(screen.machine()), cliprect);
121121
122122   tilemap_draw(bitmap,cliprect,state->m_tilemap_0,0,0);
123123   tilemap_draw(bitmap,cliprect,state->m_tilemap_1,0,0);
src/mame/drivers/gamecstl.c
r13798r13799
114114      palette_set_color(machine, i, cga_palette[i]);
115115}
116116
117static void draw_char(bitmap_t *bitmap, const rectangle *cliprect, const gfx_element *gfx, int ch, int att, int x, int y)
117static void draw_char(bitmap_t *bitmap, const rectangle &cliprect, const gfx_element *gfx, int ch, int att, int x, int y)
118118{
119119   int i,j;
120120   const UINT8 *dp;
r13798r13799
144144   UINT32 *cga = state->m_cga_ram;
145145   int index = 0;
146146
147   bitmap->fill(0, *cliprect);
147   bitmap->fill(0, cliprect);
148148
149149   for (j=0; j < 25; j++)
150150   {
src/mame/drivers/nwk-tr.c
r13798r13799
265265   device_t *voodoo = screen.machine().device("voodoo");
266266   device_t *k001604 = screen.machine().device("k001604");
267267
268   bitmap->fill(screen.machine().pens[0], *cliprect);
268   bitmap->fill(screen.machine().pens[0], cliprect);
269269
270270   voodoo_update(voodoo, bitmap, cliprect);
271271
src/mame/drivers/jpmsys5.c
r13798r13799
199199
200200   if (state.blanked)
201201   {
202      bitmap->fill(get_black_pen(screen.machine()), *cliprect);
202      bitmap->fill(get_black_pen(screen.machine()), cliprect);
203203      return 0;
204204   }
205205
206   for (y = cliprect->min_y; y <= cliprect->max_y; ++y)
206   for (y = cliprect.min_y; y <= cliprect.max_y; ++y)
207207   {
208208      UINT8 *src = &state.vram[(state.dispstart & 0xffff)*2 + 256 * y];
209      UINT32 *dest = &bitmap->pix32(y, cliprect->min_x);
209      UINT32 *dest = &bitmap->pix32(y, cliprect.min_x);
210210
211      for (x = cliprect->min_x; x <= cliprect->max_x; x +=2)
211      for (x = cliprect.min_x; x <= cliprect.max_x; x +=2)
212212      {
213         UINT8 pen = src[(x-cliprect->min_x)>>1];
213         UINT8 pen = src[(x-cliprect.min_x)>>1];
214214
215215         /* Draw two 4-bit pixels */
216216         *dest++ = screen.machine().pens[(pen >> 4) & 0xf];
src/mame/drivers/igs011.c
r13798r13799
185185
186186   pri_ram = &state->m_priority_ram[(state->m_priority & 7) * 512/2];
187187
188   for (y = cliprect->min_y; y <= cliprect->max_y; y++)
188   for (y = cliprect.min_y; y <= cliprect.max_y; y++)
189189   {
190      for (x = cliprect->min_x; x <= cliprect->max_x; x++)
190      for (x = cliprect.min_x; x <= cliprect.max_x; x++)
191191      {
192192         scr_addr = x + y * 512;
193193         pri_addr = 0xff;
src/mame/drivers/srmp6.c
r13798r13799
172172      UINT16 b;
173173   } temp;
174174
175   bitmap->fill(0, *cliprect);
175   bitmap->fill(0, cliprect);
176176
177177#if 0
178178   /* debug */
src/mame/drivers/konamim2.c
r13798r13799
259259   }
260260   else
261261   {
262      bitmap->fill(0, *cliprect);
262      bitmap->fill(0, cliprect);
263263   }
264264   return 0;
265265}
src/mame/drivers/rabbit.c
r13798r13799
230230
231231*/
232232
233static void draw_sprites(running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect )
233static void draw_sprites(running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect )
234234{
235235   rabbit_state *state = machine.driver_data<rabbit_state>();
236236   int xpos,ypos,tileno,xflip,yflip, colr;
r13798r13799
258258
259259      if(xpos&0x800)xpos-=0x1000;
260260
261      drawgfx_transpen(state->m_sprite_bitmap,&state->m_sprite_clip,gfx,tileno,colr,!xflip/*wrongdecode?*/,yflip,xpos+0x20-8/*-(state->m_spriteregs[0]&0x00000fff)*/,ypos-24/*-((state->m_spriteregs[1]&0x0fff0000)>>16)*/,15);
261      drawgfx_transpen(state->m_sprite_bitmap,state->m_sprite_clip,gfx,tileno,colr,!xflip/*wrongdecode?*/,yflip,xpos+0x20-8/*-(state->m_spriteregs[0]&0x00000fff)*/,ypos-24/*-((state->m_spriteregs[1]&0x0fff0000)>>16)*/,15);
262262//      drawgfx_transpen(bitmap,cliprect,gfx,tileno,colr,!xflip/*wrongdecode?*/,yflip,xpos+0xa0-8/*-(state->m_spriteregs[0]&0x00000fff)*/,ypos-24+0x80/*-((state->m_spriteregs[1]&0x0fff0000)>>16)*/,0);
263263
264264
r13798r13799
269269}
270270
271271/* the sprite bitmap can probably be handled better than this ... */
272static void rabbit_clearspritebitmap( running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect )
272static void rabbit_clearspritebitmap( running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect )
273273{
274274   rabbit_state *state = machine.driver_data<rabbit_state>();
275275   int startx, starty;
r13798r13799
297297}
298298
299299/* todo: fix zoom, its inaccurate and this code is ugly */
300static void draw_sprite_bitmap( running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect )
300static void draw_sprite_bitmap( running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect )
301301{
302302   rabbit_state *state = machine.driver_data<rabbit_state>();
303303
r13798r13799
330330      ydrawpos = ((y>>7)*ystep);
331331      ydrawpos >>=16;
332332
333      if ((ydrawpos >= cliprect->min_y) && (ydrawpos <= cliprect->max_y))
333      if ((ydrawpos >= cliprect.min_y) && (ydrawpos <= cliprect.max_y))
334334      {
335335         srcline = &state->m_sprite_bitmap->pix16((starty+(y>>7))&0xfff);
336336         dstline = &bitmap->pix16(ydrawpos);
r13798r13799
342342            pixdata = srcline[(startx+(x>>7))&0xfff];
343343
344344            if (pixdata)
345               if ((xdrawpos >= cliprect->min_x) && (xdrawpos <= cliprect->max_x))
345               if ((xdrawpos >= cliprect.min_x) && (xdrawpos <= cliprect.max_x))
346346                  dstline[xdrawpos] = pixdata;
347347         }
348348      }
r13798r13799
405405
406406*/
407407
408static void rabbit_drawtilemap( running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect, int whichtilemap )
408static void rabbit_drawtilemap( running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect, int whichtilemap )
409409{
410410   rabbit_state *state = machine.driver_data<rabbit_state>();
411411   INT32 startx, starty, incxx, incxy, incyx, incyy, tran;
r13798r13799
434434   rabbit_state *state = screen.machine().driver_data<rabbit_state>();
435435   int prilevel;
436436
437   bitmap->fill(get_black_pen(screen.machine()), *cliprect);
437   bitmap->fill(get_black_pen(screen.machine()), cliprect);
438438
439439//  popmessage("%08x %08x", state->m_viewregs0[0], state->m_viewregs0[1]);
440440//  popmessage("%08x %08x %08x %08x %08x %08x", state->m_tilemap_regs[0][0],state->m_tilemap_regs[0][1],state->m_tilemap_regs[0][2],state->m_tilemap_regs[0][3],state->m_tilemap_regs[0][4],state->m_tilemap_regs[0][5]);
src/mame/drivers/hvyunit.c
r13798r13799
162162
163163   tilemap_set_scrollx(state->m_bg_tilemap, 0, ((state->m_port0_data & 0x40) << 2) + state->m_scrollx + SX_POS); // TODO
164164   tilemap_set_scrolly(state->m_bg_tilemap, 0, ((state->m_port0_data & 0x80) << 1) + state->m_scrolly + SY_POS); // TODO
165   bitmap->fill(get_black_pen(screen.machine()), *cliprect);
165   bitmap->fill(get_black_pen(screen.machine()), cliprect);
166166   tilemap_draw(bitmap, cliprect, state->m_bg_tilemap, 0, 0);
167167   pandora_update(state->m_pandora, bitmap, cliprect);
168168
src/emu/cpu/tms34010/tms34010.c
r13798r13799
11081108   if (params.enabled)
11091109   {
11101110      /* call through to the callback */
1111      LOG(("  Update: scan=%3d ROW=%04X COL=%04X\n", cliprect->min_y, params.rowaddr, params.coladdr));
1112      (*tms->config->scanline_callback)(screen, bitmap, cliprect->min_y, &params);
1111      LOG(("  Update: scan=%3d ROW=%04X COL=%04X\n", cliprect.min_y, params.rowaddr, params.coladdr));
1112      (*tms->config->scanline_callback)(screen, bitmap, cliprect.min_y, &params);
11131113   }
11141114
11151115   /* otherwise, just blank the current scanline */
11161116   else
1117      params.heblnk = params.hsblnk = cliprect->max_x + 1;
1117      params.heblnk = params.hsblnk = cliprect.max_x + 1;
11181118
11191119   /* blank out the blank regions */
11201120   if (bitmap->bpp() == 16)
11211121   {
1122      UINT16 *dest = &bitmap->pix16(cliprect->min_y);
1123      for (x = cliprect->min_x; x < params.heblnk; x++)
1122      UINT16 *dest = &bitmap->pix16(cliprect.min_y);
1123      for (x = cliprect.min_x; x < params.heblnk; x++)
11241124         dest[x] = blackpen;
1125      for (x = params.hsblnk; x <= cliprect->max_y; x++)
1125      for (x = params.hsblnk; x <= cliprect.max_y; x++)
11261126         dest[x] = blackpen;
11271127   }
11281128   else if (bitmap->bpp() == 32)
11291129   {
1130      UINT32 *dest = &bitmap->pix32(cliprect->min_y);
1131      for (x = cliprect->min_x; x < params.heblnk; x++)
1130      UINT32 *dest = &bitmap->pix32(cliprect.min_y);
1131      for (x = cliprect.min_x; x < params.heblnk; x++)
11321132         dest[x] = blackpen;
1133      for (x = params.hsblnk; x <= cliprect->max_y; x++)
1133      for (x = params.hsblnk; x <= cliprect.max_y; x++)
11341134         dest[x] = blackpen;
11351135   }
11361136   return 0;
src/emu/video/upd3301.c
r13798r13799
618618//  update_screen -
619619//-------------------------------------------------
620620
621void upd3301_device::update_screen(bitmap_t *bitmap, const rectangle *cliprect)
621void upd3301_device::update_screen(bitmap_t *bitmap, const rectangle &cliprect)
622622{
623623   if (m_status & STATUS_VE)
624624   {
r13798r13799
648648   }
649649   else
650650   {
651      bitmap->fill(get_black_pen(machine()), *cliprect);
651      bitmap->fill(get_black_pen(machine()), cliprect);
652652   }
653653}
src/emu/video/upd3301.h
r13798r13799
103103   DECLARE_READ_LINE_MEMBER( hrtc_r );
104104   DECLARE_READ_LINE_MEMBER( vrtc_r );
105105
106   void update_screen(bitmap_t *bitmap, const rectangle *cliprect);
106   void update_screen(bitmap_t *bitmap, const rectangle &cliprect);
107107
108108protected:
109109    // device-level overrides
src/emu/video/mc6845.c
r13798r13799
688688}
689689
690690
691void mc6845_device::update(bitmap_t *bitmap, const rectangle *cliprect)
691void mc6845_device::update(bitmap_t *bitmap, const rectangle &cliprect)
692692{
693693   assert(bitmap != NULL);
694   assert(cliprect != NULL);
695694
696695   if (m_has_valid_parameters)
697696   {
r13798r13799
705704      if (m_begin_update != NULL)
706705         param = m_begin_update(this, bitmap, cliprect);
707706
708      if (cliprect->min_y == 0)
707      if (cliprect.min_y == 0)
709708      {
710709         /* read the start address at the beginning of the frame */
711710         m_current_disp_addr = m_disp_start_addr;
712711      }
713712
714713      /* for each row in the visible region */
715      for (y = cliprect->min_y; y <= cliprect->max_y; y++)
714      for (y = cliprect.min_y; y <= cliprect.max_y; y++)
716715      {
717716         /* compute the current raster line */
718717         UINT8 ra = y % (m_max_ras_addr + 1);
src/emu/video/hd44102.c
r13798r13799
271271//  update_screen - update screen
272272//-------------------------------------------------
273273
274void hd44102_device::update_screen(bitmap_t *bitmap, const rectangle *cliprect)
274void hd44102_device::update_screen(bitmap_t *bitmap, const rectangle &cliprect)
275275{
276276   for (int y = 0; y < 50; y++)
277277   {
r13798r13799
284284         int sy = m_sy + z;
285285         int sx = m_sx + y;
286286
287         if ((sy >= cliprect->min_y) && (sy <= cliprect->max_y) && (sx >= cliprect->min_x) && (sx <= cliprect->max_x))
287         if ((sy >= cliprect.min_y) && (sy <= cliprect.max_y) && (sx >= cliprect.min_x) && (sx <= cliprect.max_x))
288288         {
289289            int color = (m_status & STATUS_DISPLAY_OFF) ? 0 : BIT(data, z % 8);
290290
src/emu/video/hd44102.h
r13798r13799
4646
4747   DECLARE_WRITE_LINE_MEMBER( cs2_w );
4848
49   void update_screen(bitmap_t *bitmap, const rectangle *cliprect);
49   void update_screen(bitmap_t *bitmap, const rectangle &cliprect);
5050
5151protected:
5252    // device-level overrides
src/emu/video/mc6845.h
r13798r13799
2525class mc6845_device;
2626
2727/* callback definitions */
28typedef void * (*mc6845_begin_update_func)(mc6845_device *device, bitmap_t *bitmap, const rectangle *cliprect);
29#define MC6845_BEGIN_UPDATE(name)   void *name(mc6845_device *device, bitmap_t *bitmap, const rectangle *cliprect)
28typedef void * (*mc6845_begin_update_func)(mc6845_device *device, bitmap_t *bitmap, const rectangle &cliprect);
29#define MC6845_BEGIN_UPDATE(name)   void *name(mc6845_device *device, bitmap_t *bitmap, const rectangle &cliprect)
3030
3131
3232typedef void (*mc6845_update_row_func)(mc6845_device *device, bitmap_t *bitmap,
33                              const rectangle *cliprect, UINT16 ma, UINT8 ra,
33                              const rectangle &cliprect, UINT16 ma, UINT8 ra,
3434                              UINT16 y, UINT8 x_count, INT8 cursor_x, void *param);
3535
3636
3737#define MC6845_UPDATE_ROW(name)      void name(mc6845_device *device, bitmap_t *bitmap,   \
38                                   const rectangle *cliprect, UINT16 ma, UINT8 ra,   \
38                                   const rectangle &cliprect, UINT16 ma, UINT8 ra,   \
3939                                   UINT16 y, UINT8 x_count, INT8 cursor_x, void *param)
4040
4141
42typedef void (*mc6845_end_update_func)(mc6845_device *device, bitmap_t *bitmap, const rectangle *cliprect, void *param);
43#define MC6845_END_UPDATE(name)      void name(mc6845_device *device, bitmap_t *bitmap, const rectangle *cliprect, void *param)
42typedef void (*mc6845_end_update_func)(mc6845_device *device, bitmap_t *bitmap, const rectangle &cliprect, void *param);
43#define MC6845_END_UPDATE(name)      void name(mc6845_device *device, bitmap_t *bitmap, const rectangle &cliprect, void *param)
4444
4545
4646typedef void (*mc6845_on_update_addr_changed_func)(mc6845_device *device, int address, int strobe);
r13798r13799
148148   /* updates the screen -- this will call begin_update(),
149149       followed by update_row() reapeatedly and after all row
150150       updating is complete, end_update() */
151   void update(bitmap_t *bitmap, const rectangle *cliprect);
151   void update(bitmap_t *bitmap, const rectangle &cliprect);
152152
153153protected:
154154    // device-level overrides
src/emu/video/h63484.c
r13798r13799
11591159//  draw_graphics_line -
11601160//-------------------------------------------------
11611161
1162void h63484_device::draw_graphics_line(bitmap_t *bitmap, const rectangle *cliprect, int y, int layer_n)
1162void h63484_device::draw_graphics_line(bitmap_t *bitmap, const rectangle &cliprect, int y, int layer_n)
11631163{
11641164   int x;
11651165   int pitch;
r13798r13799
11881188//  update_screen -
11891189//-------------------------------------------------
11901190
1191void h63484_device::update_screen(bitmap_t *bitmap, const rectangle *cliprect)
1191void h63484_device::update_screen(bitmap_t *bitmap, const rectangle &cliprect)
11921192{
11931193   if(m_dcr & 0x8000) // correct?
11941194   {
11951195      int y;
11961196
1197      for(y=cliprect->min_y;y<cliprect->max_y;y++)
1197      for(y=cliprect.min_y;y<cliprect.max_y;y++)
11981198      {
11991199         if (m_display_cb)
12001200            draw_graphics_line(bitmap,cliprect, y, 1);
src/emu/video/tms9928a.c
r13798r13799
571571}
572572
573573
574void tms9928a_device::update( bitmap_t *bitmap, const rectangle *cliprect )
574void tms9928a_device::update( bitmap_t *bitmap, const rectangle &cliprect )
575575{
576576   copybitmap( bitmap, m_tmpbmp, 0, 0, 0, 0, cliprect );
577577}
src/emu/video/h63484.h
r13798r13799
5656    DECLARE_READ8_MEMBER( vram_r );
5757    DECLARE_WRITE8_MEMBER( vram_w );
5858
59   void update_screen(bitmap_t *bitmap, const rectangle *cliprect);
59   void update_screen(bitmap_t *bitmap, const rectangle &cliprect);
6060   virtual const rom_entry *device_rom_region() const;
6161   virtual const address_space_config *memory_space_config(address_spacenum spacenum = AS_0) const;
6262
r13798r13799
8989   UINT16 video_registers_r(int offset);
9090   void video_registers_w(int offset);
9191   int translate_command(UINT16 data);
92   void draw_graphics_line(bitmap_t *bitmap, const rectangle *cliprect, int y, int layer_n);
92   void draw_graphics_line(bitmap_t *bitmap, const rectangle &cliprect, int y, int layer_n);
9393
9494
9595   screen_device *m_screen;
src/emu/video/tms9928a.h
r13798r13799
104104   DECLARE_WRITE8_MEMBER( register_write );
105105
106106   /* update the screen */
107   void update( bitmap_t *bitmap, const rectangle *cliprect );
107   void update( bitmap_t *bitmap, const rectangle &cliprect );
108108
109109protected:
110110   // device-level overrides
src/emu/video/voodoo.c
r13798r13799
214214 *
215215 *************************************/
216216
217static const rectangle global_cliprect(-4096, 4095, -4096, 4095);
218
217219/* fast dither lookup */
218220static UINT8 dither4_lookup[256*16*2];
219221static UINT8 dither2_lookup[256*16*2];
r13798r13799
327329 *
328330 *************************************/
329331
330int voodoo_update(device_t *device, bitmap_t *bitmap, const rectangle *cliprect)
332int voodoo_update(device_t *device, bitmap_t *bitmap, const rectangle &cliprect)
331333{
332334   voodoo_state *v = get_safe_token(device);
333335   int changed = v->fbi.video_changed;
r13798r13799
341343   /* if we are blank, just fill with black */
342344   if (v->type <= VOODOO_2 && FBIINIT1_SOFTWARE_BLANK(v->reg[fbiInit1].u))
343345   {
344      bitmap->fill(0, *cliprect);
346      bitmap->fill(0, cliprect);
345347      return changed;
346348   }
347349
r13798r13799
422424      drawbuf = v->fbi.backbuf;
423425
424426   /* copy from the current front buffer */
425   for (y = cliprect->min_y; y <= cliprect->max_y; y++)
427   for (y = cliprect.min_y; y <= cliprect.max_y; y++)
426428      if (y >= v->fbi.yoffs)
427429      {
428430         UINT16 *src = (UINT16 *)(v->fbi.ram + v->fbi.rgboffs[drawbuf]) + (y - v->fbi.yoffs) * v->fbi.rowpixels - v->fbi.xoffs;
429431         UINT32 *dst = &bitmap->pix32(y);
430         for (x = cliprect->min_x; x <= cliprect->max_x; x++)
432         for (x = cliprect.min_x; x <= cliprect.max_x; x++)
431433            dst[x] = v->fbi.pen[src[x]];
432434      }
433435
r13798r13799
445447   v->stats.render_override = device->machine().input().code_pressed(KEYCODE_ENTER);
446448   if (DEBUG_DEPTH && v->stats.render_override)
447449   {
448      for (y = cliprect->min_y; y <= cliprect->max_y; y++)
450      for (y = cliprect.min_y; y <= cliprect.max_y; y++)
449451      {
450452         UINT16 *src = (UINT16 *)(v->fbi.ram + v->fbi.auxoffs) + (y - v->fbi.yoffs) * v->fbi.rowpixels - v->fbi.xoffs;
451453         UINT32 *dst = &bitmap->pix32(y);
452         for (x = cliprect->min_x; x <= cliprect->max_x; x++)
454         for (x = cliprect.min_x; x <= cliprect.max_x; x++)
453455            dst[x] = ((src[x] << 8) & 0xff0000) | ((src[x] >> 0) & 0xff00) | ((src[x] >> 8) & 0xff);
454456      }
455457   }
r13798r13799
51185120      extra->state = v;
51195121      memcpy(extra->dither, dithermatrix, sizeof(extra->dither));
51205122
5121      pixels += poly_render_triangle_custom(v->poly, drawbuf, NULL, raster_fastfill, y, count, extents);
5123      pixels += poly_render_triangle_custom(v->poly, drawbuf, global_cliprect, raster_fastfill, y, count, extents);
51225124   }
51235125
51245126   /* 2 pixels per clock */
r13798r13799
55255527
55265528   /* farm the rasterization out to other threads */
55275529   info->polys++;
5528   return poly_render_triangle(v->poly, drawbuf, NULL, info->callback, 0, &vert[0], &vert[1], &vert[2]);
5530   return poly_render_triangle(v->poly, drawbuf, global_cliprect, info->callback, 0, &vert[0], &vert[1], &vert[2]);
55295531}
55305532
55315533
src/emu/video/voodoo.h
r13798r13799
132132    FUNCTION PROTOTYPES
133133***************************************************************************/
134134
135int voodoo_update(device_t *device, bitmap_t *bitmap, const rectangle *cliprect);
135int voodoo_update(device_t *device, bitmap_t *bitmap, const rectangle &cliprect);
136136int voodoo_get_type(device_t *device);
137137int voodoo_is_stalled(device_t *device);
138138void voodoo_set_init_enable(device_t *device, UINT32 newval);
src/emu/video/i8275.c
r13798r13799
460460}
461461
462462/* Screen Update */
463void i8275_update(device_t *device, bitmap_t *bitmap, const rectangle *cliprect)
463void i8275_update(device_t *device, bitmap_t *bitmap, const rectangle &cliprect)
464464{
465465   i8275_t *i8275 = get_safe_token(device);
466466   i8275->ypos = 0;
r13798r13799
474474   i8275->fifo_write = 0;
475475
476476   if ((i8275->status_reg & I8275_STATUS_VIDEO_ENABLE)==0) {
477      bitmap->fill(get_black_pen(device->machine()), *cliprect);
477      bitmap->fill(get_black_pen(device->machine()), cliprect);
478478   } else {
479479      // if value < 16 it is visible otherwise not
480480      i8275->cursor_blink_cnt++;
src/emu/video/msm6255.c
r13798r13799
317317//  draw_scanline -
318318//-------------------------------------------------
319319
320void msm6255_device::draw_scanline(bitmap_t *bitmap, const rectangle *cliprect, int y, UINT16 ma, UINT8 ra)
320void msm6255_device::draw_scanline(bitmap_t *bitmap, const rectangle &cliprect, int y, UINT16 ma, UINT8 ra)
321321{
322322   UINT8 hp = (m_pr & PR_HP_MASK) + 1;
323323   UINT8 hn = (m_hnr & HNR_HN_MASK) + 1;
r13798r13799
358358//  update_graphics -
359359//-------------------------------------------------
360360
361void msm6255_device::update_graphics(bitmap_t *bitmap, const rectangle *cliprect)
361void msm6255_device::update_graphics(bitmap_t *bitmap, const rectangle &cliprect)
362362{
363363   UINT8 hn = (m_hnr & HNR_HN_MASK) + 1;
364364   UINT8 nx = (m_dvr & DVR_DN_MASK) + 1;
r13798r13799
386386//  update_text -
387387//-------------------------------------------------
388388
389void msm6255_device::update_text(bitmap_t *bitmap, const rectangle *cliprect)
389void msm6255_device::update_text(bitmap_t *bitmap, const rectangle &cliprect)
390390{
391391   UINT8 hn = (m_hnr & HNR_HN_MASK) + 1;
392392   UINT8 vp = (m_pr & PR_VP_MASK) + 1;
r13798r13799
417417//  update_screen - update screen
418418//-------------------------------------------------
419419
420void msm6255_device::update_screen(bitmap_t *bitmap, const rectangle *cliprect)
420void msm6255_device::update_screen(bitmap_t *bitmap, const rectangle &cliprect)
421421{
422422   if (m_mor & MOR_DISPLAY_ON)
423423   {
r13798r13799
432432   }
433433   else
434434   {
435      bitmap->fill(get_black_pen(machine()), *cliprect);
435      bitmap->fill(get_black_pen(machine()), cliprect);
436436   }
437437}
src/emu/video/i8275.h
r13798r13799
5151WRITE8_DEVICE_HANDLER ( i8275_w );
5252
5353/* updates the screen */
54void i8275_update(device_t *device, bitmap_t *bitmap, const rectangle *cliprect);
54void i8275_update(device_t *device, bitmap_t *bitmap, const rectangle &cliprect);
5555
5656WRITE8_DEVICE_HANDLER( i8275_dack_w );
5757
src/emu/video/msm6255.h
r13798r13799
6868    DECLARE_READ8_MEMBER( read );
6969    DECLARE_WRITE8_MEMBER( write );
7070
71   void update_screen(bitmap_t *bitmap, const rectangle *cliprect);
71   void update_screen(bitmap_t *bitmap, const rectangle &cliprect);
7272
7373protected:
7474    // device-level overrides
r13798r13799
7979private:
8080   inline UINT8 read_video_data(UINT16 ma, UINT8 ra);
8181   void update_cursor();
82   void draw_scanline(bitmap_t *bitmap, const rectangle *cliprect, int y, UINT16 ma, UINT8 ra);
83   void update_graphics(bitmap_t *bitmap, const rectangle *cliprect);
84   void update_text(bitmap_t *bitmap, const rectangle *cliprect);
82   void draw_scanline(bitmap_t *bitmap, const rectangle &cliprect, int y, UINT16 ma, UINT8 ra);
83   void update_graphics(bitmap_t *bitmap, const rectangle &cliprect);
84   void update_text(bitmap_t *bitmap, const rectangle &cliprect);
8585
8686   screen_device *m_screen;
8787
src/emu/video/s2636.c
r13798r13799
136136 *
137137 *************************************/
138138
139static void draw_sprite( UINT8 *gfx, int color, int y, int x, int expand, int or_mode, bitmap_t *bitmap, const rectangle *cliprect )
139static void draw_sprite( UINT8 *gfx, int color, int y, int x, int expand, int or_mode, bitmap_t *bitmap, const rectangle &cliprect )
140140{
141141   int sy;
142142
r13798r13799
162162               int tx = x + sx * (expand + 1) + ex;
163163
164164               /* get out if outside the drawing region */
165               if ((tx < cliprect->min_x) ||
166                  (tx > cliprect->max_x) ||
167                  (ty < cliprect->min_y) ||
168                  (ty > cliprect->max_y))
165               if ((tx < cliprect.min_x) ||
166                  (tx > cliprect.max_x) ||
167                  (ty < cliprect.min_y) ||
168                  (ty > cliprect.max_y))
169169                  continue;
170170
171171               /* get out if current image bit is transparent */
r13798r13799
190190 *
191191 *************************************/
192192
193static int check_collision( device_t *device, int spriteno1, int spriteno2, const rectangle *cliprect )
193static int check_collision( device_t *device, int spriteno1, int spriteno2, const rectangle &cliprect )
194194{
195195   s2636_state *s2636 = get_safe_token(device);
196196   int checksum = 0;
r13798r13799
200200
201201   /* TODO: does not check shadow sprites yet */
202202
203   s2636->collision_bitmap->fill(0, *cliprect);
203   s2636->collision_bitmap->fill(0, cliprect);
204204
205205   if ((attr1[0x0a] != 0xff) && (attr2[0x0a] != 0xff))
206206   {
r13798r13799
221221      for (x = x1; x < x1 + SPRITE_WIDTH; x++)
222222         for (y = y1; y < y1 + SPRITE_HEIGHT; y++)
223223         {
224            if ((x < cliprect->min_x) || (x > cliprect->max_x) ||
225               (y < cliprect->min_y) || (y > cliprect->max_y))
224            if ((x < cliprect.min_x) || (x > cliprect.max_x) ||
225               (y < cliprect.min_y) || (y > cliprect.max_y))
226226               continue;
227227
228228            checksum = checksum + s2636->collision_bitmap->pix16(y, x);
r13798r13799
235235      for (x = x1; x < x1 + SPRITE_WIDTH; x++)
236236         for (y = y1; y < y1 + SPRITE_HEIGHT; y++)
237237         {
238            if ((x < cliprect->min_x) || (x > cliprect->max_x) ||
239               (y < cliprect->min_y) || (y > cliprect->max_y))
238            if ((x < cliprect.min_x) || (x > cliprect.max_x) ||
239               (y < cliprect.min_y) || (y > cliprect.max_y))
240240               continue;
241241
242242            checksum = checksum - s2636->collision_bitmap->pix16(y, x);
r13798r13799
254254 *
255255 *************************************/
256256
257bitmap_t *s2636_update( device_t *device, const rectangle *cliprect )
257bitmap_t *s2636_update( device_t *device, const rectangle &cliprect )
258258{
259259   s2636_state *s2636 = get_safe_token(device);
260260   UINT8 collision = 0;
261261   int spriteno;
262262
263   s2636->bitmap->fill(0, *cliprect);
263   s2636->bitmap->fill(0, cliprect);
264264
265265   for (spriteno = 0; spriteno < 4; spriteno++)
266266   {
src/emu/video/cdp1862.c
r13798r13799
213213//  update_screen -
214214//-------------------------------------------------
215215
216void cdp1862_device::update_screen(bitmap_t *bitmap, const rectangle *cliprect)
216void cdp1862_device::update_screen(bitmap_t *bitmap, const rectangle &cliprect)
217217{
218218   copybitmap(bitmap, m_bitmap, 0, 0, 0, 0, cliprect);
219   m_bitmap->fill(CDP1862_BACKGROUND_COLOR_SEQUENCE[m_bgcolor] + 8, *cliprect);
219   m_bitmap->fill(CDP1862_BACKGROUND_COLOR_SEQUENCE[m_bgcolor] + 8, cliprect);
220220}
src/emu/video/s2636.h
r13798r13799
5353   D0-D2 of each pixel is the pixel color
5454   D3 indicates whether the S2636 drew this pixel - 0 = not drawn, 1 = drawn */
5555
56bitmap_t *s2636_update( device_t *device, const rectangle *cliprect );
56bitmap_t *s2636_update( device_t *device, const rectangle &cliprect );
5757WRITE8_DEVICE_HANDLER( s2636_work_ram_w );
5858READ8_DEVICE_HANDLER( s2636_work_ram_r );
5959
src/emu/video/cdp1862.h
r13798r13799
9494   DECLARE_WRITE_LINE_MEMBER( bkg_w );
9595   DECLARE_WRITE_LINE_MEMBER( con_w );
9696
97   void update_screen(bitmap_t *bitmap, const rectangle *cliprect);
97   void update_screen(bitmap_t *bitmap, const rectangle &cliprect);
9898
9999protected:
100100    // device-level overrides
src/emu/video/pc_vga.c
r13798r13799
103103         if ((pc_current_width > 100) && (pc_current_height > 100))
104104            screen.set_visible_area(0, pc_current_width-1, 0, pc_current_height-1);
105105
106         bitmap->fill(0, *cliprect);
106         bitmap->fill(0, cliprect);
107107      }
108108
109109      video_update(bitmap);
src/emu/video/crt9021.c
r13798r13799
222222//  update_screen - update screen
223223//-------------------------------------------------
224224
225void crt9021_device::update_screen(bitmap_t *bitmap, const rectangle *cliprect)
225void crt9021_device::update_screen(bitmap_t *bitmap, const rectangle &cliprect)
226226{
227227}
src/emu/video/crt9021.h
r13798r13799
8888   DECLARE_WRITE_LINE_MEMBER( retbl_w );
8989   DECLARE_WRITE_LINE_MEMBER( vsync_w );
9090
91   void update_screen(bitmap_t *bitmap, const rectangle *cliprect);
91   void update_screen(bitmap_t *bitmap, const rectangle &cliprect);
9292
9393protected:
9494    // device-level overrides
src/emu/video/psx.c
r13798r13799
317317#endif
318318}
319319
320int psxgpu_device::DebugMeshDisplay( bitmap_t *bitmap, const rectangle *cliprect )
320int psxgpu_device::DebugMeshDisplay( bitmap_t *bitmap, const rectangle &cliprect )
321321{
322322   if( m_debug.mesh )
323323   {
r13798r13799
600600   machine().save().register_postload( save_prepost_delegate( FUNC( psxgpu_device::updatevisiblearea ), this ) );
601601}
602602
603void psxgpu_device::update_screen(bitmap_t *bitmap, const rectangle *cliprect)
603void psxgpu_device::update_screen(bitmap_t *bitmap, const rectangle &cliprect)
604604{
605605   UINT32 n_x;
606606   UINT32 n_y;
r13798r13799
628628   if( ( n_gpustatus & ( 1 << 0x17 ) ) != 0 )
629629   {
630630      /* todo: only draw to necessary area */
631      bitmap->fill(0, *cliprect);
631      bitmap->fill(0, cliprect);
632632   }
633633   else
634634   {
src/emu/video/psx.h
r13798r13799
181181   psxgpu_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock);
182182   virtual machine_config_constructor device_mconfig_additions() const;
183183
184   void update_screen(bitmap_t *bitmap, const rectangle *cliprect);
184   void update_screen(bitmap_t *bitmap, const rectangle &cliprect);
185185   WRITE32_MEMBER( write );
186186   READ32_MEMBER( read );
187187   void dma_read( UINT32 n_address, INT32 n_size );
r13798r13799
221221   void DebugMesh( int n_coordx, int n_coordy );
222222   void DebugMeshEnd( void );
223223   void DebugCheckKeys( void );
224   int DebugMeshDisplay( bitmap_t *bitmap, const rectangle *cliprect );
224   int DebugMeshDisplay( bitmap_t *bitmap, const rectangle &cliprect );
225225   int DebugTextureDisplay( bitmap_t *bitmap );
226226#endif
227227
src/emu/video/poly.c
r13798r13799
468468    triangle given 3 vertexes
469469-------------------------------------------------*/
470470
471UINT32 poly_render_triangle(poly_manager *poly, void *dest, const rectangle *cliprect, poly_draw_scanline_func callback, int paramcount, const poly_vertex *v1, const poly_vertex *v2, const poly_vertex *v3)
471UINT32 poly_render_triangle(poly_manager *poly, void *dest, const rectangle &cliprect, poly_draw_scanline_func callback, int paramcount, const poly_vertex *v1, const poly_vertex *v2, const poly_vertex *v3)
472472{
473473   float dxdy_v1v2, dxdy_v1v3, dxdy_v2v3;
474474   const poly_vertex *tv;
r13798r13799
507507   /* clip coordinates */
508508   v1yclip = v1y;
509509   v3yclip = v3y + ((poly->flags & POLYFLAG_INCLUDE_BOTTOM_EDGE) ? 1 : 0);
510   if (cliprect != NULL)
511   {
512      v1yclip = MAX(v1yclip, cliprect->min_y);
513      v3yclip = MIN(v3yclip, cliprect->max_y + 1);
514   }
510   v1yclip = MAX(v1yclip, cliprect.min_y);
511   v3yclip = MIN(v3yclip, cliprect.max_y + 1);
515512   if (v3yclip - v1yclip <= 0)
516513      return 0;
517514
r13798r13799
585582            istopx++;
586583
587584         /* apply left/right clipping */
588         if (cliprect != NULL)
589         {
590            if (istartx < cliprect->min_x)
591               istartx = cliprect->min_x;
592            if (istopx > cliprect->max_x)
593               istopx = cliprect->max_x + 1;
594         }
585         if (istartx < cliprect.min_x)
586            istartx = cliprect.min_x;
587         if (istopx > cliprect.max_x)
588            istopx = cliprect.max_x + 1;
595589
596590         /* set the extent and update the total pixel count */
597591         if (istartx >= istopx)
r13798r13799
657651    triangles in a fan
658652-------------------------------------------------*/
659653
660UINT32 poly_render_triangle_fan(poly_manager *poly, void *dest, const rectangle *cliprect, poly_draw_scanline_func callback, int paramcount, int numverts, const poly_vertex *v)
654UINT32 poly_render_triangle_fan(poly_manager *poly, void *dest, const rectangle &cliprect, poly_draw_scanline_func callback, int paramcount, int numverts, const poly_vertex *v)
661655{
662656   UINT32 pixels = 0;
663657   int vertnum;
r13798r13799
674668    render of an object, given specific extents
675669-------------------------------------------------*/
676670
677UINT32 poly_render_triangle_custom(poly_manager *poly, void *dest, const rectangle *cliprect, poly_draw_scanline_func callback, int startscanline, int numscanlines, const poly_extent *extents)
671UINT32 poly_render_triangle_custom(poly_manager *poly, void *dest, const rectangle &cliprect, poly_draw_scanline_func callback, int startscanline, int numscanlines, const poly_extent *extents)
678672{
679673   INT32 curscan, scaninc;
680674   polygon_info *polygon;
r13798r13799
683677   UINT32 startunit;
684678
685679   /* clip coordinates */
686   if (cliprect != NULL)
687   {
688      v1yclip = MAX(startscanline, cliprect->min_y);
689      v3yclip = MIN(startscanline + numscanlines, cliprect->max_y + 1);
690   }
691   else
692   {
693      v1yclip = startscanline;
694      v3yclip = startscanline + numscanlines;
695   }
680   v1yclip = MAX(startscanline, cliprect.min_y);
681   v3yclip = MIN(startscanline + numscanlines, cliprect.max_y + 1);
696682   if (v3yclip - v1yclip <= 0)
697683      return 0;
698684
r13798r13799
741727         }
742728
743729         /* apply left/right clipping */
744         if (cliprect != NULL)
745         {
746            if (istartx < cliprect->min_x)
747               istartx = cliprect->min_x;
748            if (istopx > cliprect->max_x)
749               istopx = cliprect->max_x + 1;
750         }
730         if (istartx < cliprect.min_x)
731            istartx = cliprect.min_x;
732         if (istopx > cliprect.max_x)
733            istopx = cliprect.max_x + 1;
751734
752735         /* set the extent and update the total pixel count */
753736         unit->extent[extnum].startx = istartx;
r13798r13799
781764    given 4 vertexes
782765-------------------------------------------------*/
783766
784UINT32 poly_render_quad(poly_manager *poly, void *dest, const rectangle *cliprect, poly_draw_scanline_func callback, int paramcount, const poly_vertex *v1, const poly_vertex *v2, const poly_vertex *v3, const poly_vertex *v4)
767UINT32 poly_render_quad(poly_manager *poly, void *dest, const rectangle &cliprect, poly_draw_scanline_func callback, int paramcount, const poly_vertex *v1, const poly_vertex *v2, const poly_vertex *v3, const poly_vertex *v4)
785768{
786769   poly_edge fedgelist[3], bedgelist[3];
787770   const poly_edge *ledge, *redge;
r13798r13799
824807   /* clip coordinates */
825808   minyclip = miny;
826809   maxyclip = maxy + ((poly->flags & POLYFLAG_INCLUDE_BOTTOM_EDGE) ? 1 : 0);
827   if (cliprect != NULL)
828   {
829      minyclip = MAX(minyclip, cliprect->min_y);
830      maxyclip = MIN(maxyclip, cliprect->max_y + 1);
831   }
810   minyclip = MAX(minyclip, cliprect.min_y);
811   maxyclip = MIN(maxyclip, cliprect.max_y + 1);
832812   if (maxyclip - minyclip <= 0)
833813      return 0;
834814
r13798r13799
967947            istopx++;
968948
969949         /* apply left/right clipping */
970         if (cliprect != NULL)
950         if (istartx < cliprect.min_x)
971951         {
972            if (istartx < cliprect->min_x)
973            {
974               for (paramnum = 0; paramnum < paramcount; paramnum++)
975                  unit->extent[extnum].param[paramnum].start += (cliprect->min_x - istartx) * unit->extent[extnum].param[paramnum].dpdx;
976               istartx = cliprect->min_x;
977            }
978            if (istopx > cliprect->max_x)
979               istopx = cliprect->max_x + 1;
952            for (paramnum = 0; paramnum < paramcount; paramnum++)
953               unit->extent[extnum].param[paramnum].start += (cliprect.min_x - istartx) * unit->extent[extnum].param[paramnum].dpdx;
954            istartx = cliprect.min_x;
980955         }
956         if (istopx > cliprect.max_x)
957            istopx = cliprect.max_x + 1;
981958
982959         /* set the extent and update the total pixel count */
983960         if (istartx >= istopx)
r13798r13799
1007984    quads in a fan
1008985-------------------------------------------------*/
1009986
1010UINT32 poly_render_quad_fan(poly_manager *poly, void *dest, const rectangle *cliprect, poly_draw_scanline_func callback, int paramcount, int numverts, const poly_vertex *v)
987UINT32 poly_render_quad_fan(poly_manager *poly, void *dest, const rectangle &cliprect, poly_draw_scanline_func callback, int paramcount, int numverts, const poly_vertex *v)
1011988{
1012989   UINT32 pixels = 0;
1013990   int vertnum;
r13798r13799
10291006    to 32 vertices
10301007-------------------------------------------------*/
10311008
1032UINT32 poly_render_polygon(poly_manager *poly, void *dest, const rectangle *cliprect, poly_draw_scanline_func callback, int paramcount, int numverts, const poly_vertex *v)
1009UINT32 poly_render_polygon(poly_manager *poly, void *dest, const rectangle &cliprect, poly_draw_scanline_func callback, int paramcount, int numverts, const poly_vertex *v)
10331010{
10341011   poly_edge fedgelist[MAX_POLYGON_VERTS - 1], bedgelist[MAX_POLYGON_VERTS - 1];
10351012   const poly_edge *ledge, *redge;
r13798r13799
10621039   /* clip coordinates */
10631040   minyclip = miny;
10641041   maxyclip = maxy + ((poly->flags & POLYFLAG_INCLUDE_BOTTOM_EDGE) ? 1 : 0);
1065   if (cliprect != NULL)
1066   {
1067      minyclip = MAX(minyclip, cliprect->min_y);
1068      maxyclip = MIN(maxyclip, cliprect->max_y + 1);
1069   }
1042   minyclip = MAX(minyclip, cliprect.min_y);
1043   maxyclip = MIN(maxyclip, cliprect.max_y + 1);
10701044   if (maxyclip - minyclip <= 0)
10711045      return 0;
10721046
r13798r13799
12051179            istopx++;
12061180
12071181         /* apply left/right clipping */
1208         if (cliprect != NULL)
1182         if (istartx < cliprect.min_x)
12091183         {
1210            if (istartx < cliprect->min_x)
1211            {
1212               for (paramnum = 0; paramnum < paramcount; paramnum++)
1213                  unit->extent[extnum].param[paramnum].start += (cliprect->min_x - istartx) * unit->extent[extnum].param[paramnum].dpdx;
1214               istartx = cliprect->min_x;
1215            }
1216            if (istopx > cliprect->max_x)
1217               istopx = cliprect->max_x + 1;
1184            for (paramnum = 0; paramnum < paramcount; paramnum++)
1185               unit->extent[extnum].param[paramnum].start += (cliprect.min_x - istartx) * unit->extent[extnum].param[paramnum].dpdx;
1186            istartx = cliprect.min_x;
12181187         }
1188         if (istopx > cliprect.max_x)
1189            istopx = cliprect.max_x + 1;
12191190
12201191         /* set the extent and update the total pixel count */
12211192         if (istartx >= istopx)
src/emu/video/poly.h
r13798r13799
120120/* ----- core triangle rendering ----- */
121121
122122/* render a single triangle given 3 vertexes */
123UINT32 poly_render_triangle(poly_manager *poly, void *dest, const rectangle *cliprect, poly_draw_scanline_func callback, int paramcount, const poly_vertex *v1, const poly_vertex *v2, const poly_vertex *v3);
123UINT32 poly_render_triangle(poly_manager *poly, void *dest, const rectangle &cliprect, poly_draw_scanline_func callback, int paramcount, const poly_vertex *v1, const poly_vertex *v2, const poly_vertex *v3);
124124
125125/* render a set of triangles in a fan */
126UINT32 poly_render_triangle_fan(poly_manager *poly, void *dest, const rectangle *cliprect, poly_draw_scanline_func callback, int paramcount, int numverts, const poly_vertex *v);
126UINT32 poly_render_triangle_fan(poly_manager *poly, void *dest, const rectangle &cliprect, poly_draw_scanline_func callback, int paramcount, int numverts, const poly_vertex *v);
127127
128128/* perform a custom render of an object, given specific extents */
129UINT32 poly_render_triangle_custom(poly_manager *poly, void *dest, const rectangle *cliprect, poly_draw_scanline_func callback, int startscanline, int numscanlines, const poly_extent *extents);
129UINT32 poly_render_triangle_custom(poly_manager *poly, void *dest, const rectangle &cliprect, poly_draw_scanline_func callback, int startscanline, int numscanlines, const poly_extent *extents);
130130
131131
132132
133133/* ----- core quad rendering ----- */
134134
135135/* render a single quad given 4 vertexes */
136UINT32 poly_render_quad(poly_manager *poly, void *dest, const rectangle *cliprect, poly_draw_scanline_func callback, int paramcount, const poly_vertex *v1, const poly_vertex *v2, const poly_vertex *v3, const poly_vertex *v4);
136UINT32 poly_render_quad(poly_manager *poly, void *dest, const rectangle &cliprect, poly_draw_scanline_func callback, int paramcount, const poly_vertex *v1, const poly_vertex *v2, const poly_vertex *v3, const poly_vertex *v4);
137137
138138/* render a set of quads in a fan */
139UINT32 poly_render_quad_fan(poly_manager *poly, void *dest, const rectangle *cliprect, poly_draw_scanline_func callback, int paramcount, int numverts, const poly_vertex *v);
139UINT32 poly_render_quad_fan(poly_manager *poly, void *dest, const rectangle &cliprect, poly_draw_scanline_func callback, int paramcount, int numverts, const poly_vertex *v);
140140
141141
142142
143143/* ----- core polygon rendering ----- */
144144
145145/* render a single polygon up to 32 vertices */
146UINT32 poly_render_polygon(poly_manager *poly, void *dest, const rectangle *cliprect, poly_draw_scanline_func callback, int paramcount, int numverts, const poly_vertex *v);
146UINT32 poly_render_polygon(poly_manager *poly, void *dest, const rectangle &cliprect, poly_draw_scanline_func callback, int paramcount, int numverts, const poly_vertex *v);
147147
148148
149149
src/emu/video/hd61830.c
r13798r13799
406406//  draw_scanline - draw one graphics scanline
407407//-------------------------------------------------
408408
409void hd61830_device::draw_scanline(bitmap_t *bitmap, const rectangle *cliprect, int y, UINT16 ra)
409void hd61830_device::draw_scanline(bitmap_t *bitmap, const rectangle &cliprect, int y, UINT16 ra)
410410{
411411   for (int sx = 0; sx < m_hn; sx++)
412412   {
r13798r13799
424424//  update_graphics - draw graphics mode screen
425425//-------------------------------------------------
426426
427void hd61830_device::update_graphics(bitmap_t *bitmap, const rectangle *cliprect)
427void hd61830_device::update_graphics(bitmap_t *bitmap, const rectangle &cliprect)
428428{
429429   for (int y = 0; y < m_nx; y++)
430430   {
r13798r13799
444444//  draw_char - draw a char
445445//-------------------------------------------------
446446
447void hd61830_device::draw_char(bitmap_t *bitmap, const rectangle *cliprect, UINT16 ma, int x, int y, UINT8 md)
447void hd61830_device::draw_char(bitmap_t *bitmap, const rectangle &cliprect, UINT16 ma, int x, int y, UINT8 md)
448448{
449449   for (int cl = 0; cl < m_vp; cl++)
450450   {
r13798r13799
515515//  update_text - draw text mode screen
516516//-------------------------------------------------
517517
518void hd61830_device::update_text(bitmap_t *bitmap, const rectangle *cliprect)
518void hd61830_device::update_text(bitmap_t *bitmap, const rectangle &cliprect)
519519{
520520   for (int y = 0; y < (m_nx / m_vp); y++)
521521   {
r13798r13799
534534//  update_screen - update screen
535535//-------------------------------------------------
536536
537void hd61830_device::update_screen(bitmap_t *bitmap, const rectangle *cliprect)
537void hd61830_device::update_screen(bitmap_t *bitmap, const rectangle &cliprect)
538538{
539539   if (m_mcr & MODE_DISPLAY_ON)
540540   {
r13798r13799
549549   }
550550   else
551551   {
552      bitmap->fill(0, *cliprect);
552      bitmap->fill(0, cliprect);
553553   }
554554
555555   m_blink++;
src/emu/video/hd61830.h
r13798r13799
6868    DECLARE_READ8_MEMBER( data_r );
6969    DECLARE_WRITE8_MEMBER( data_w );
7070
71   void update_screen(bitmap_t *bitmap, const rectangle *cliprect);
71   void update_screen(bitmap_t *bitmap, const rectangle &cliprect);
7272
7373protected:
7474    // device-level overrides
r13798r13799
8787private:
8888   void set_busy_flag();
8989
90   void draw_scanline(bitmap_t *bitmap, const rectangle *cliprect, int y, UINT16 ra);
91   void update_graphics(bitmap_t *bitmap, const rectangle *cliprect);
92   void draw_char(bitmap_t *bitmap, const rectangle *cliprect, UINT16 ma, int x, int y, UINT8 md);
93   void update_text(bitmap_t *bitmap, const rectangle *cliprect);
90   void draw_scanline(bitmap_t *bitmap, const rectangle &cliprect, int y, UINT16 ra);
91   void update_graphics(bitmap_t *bitmap, const rectangle &cliprect);
92   void draw_char(bitmap_t *bitmap, const rectangle &cliprect, UINT16 ma, int x, int y, UINT8 md);
93   void update_text(bitmap_t *bitmap, const rectangle &cliprect);
9494
9595    devcb_resolved_read8 m_in_rd_func;
9696
src/emu/video/k053250.c
r13798r13799
5959
6060// utility function to render a clipped scanline vertically or horizontally
6161inline void k053250_t::pdraw_scanline32(bitmap_t *bitmap, const pen_t *palette, UINT8 *source,
62                             const rectangle *cliprect, int linepos, int scroll, int zoom,
62                             const rectangle &cliprect, int linepos, int scroll, int zoom,
6363                             UINT32 clipmask, UINT32 wrapmask, UINT32 orientation, bitmap_t *priority, UINT8 pri)
6464{
6565// a sixteen-bit fixed point resolution should be adequate to our application
r13798r13799
8181   if (!(orientation & ORIENTATION_SWAP_XY))
8282   {
8383      flip = orientation & ORIENTATION_FLIP_X;
84      dst_min = cliprect->min_x;
85      dst_max = cliprect->max_x;
84      dst_min = cliprect.min_x;
85      dst_max = cliprect.max_x;
8686   }
8787   else
8888   {
8989      flip = orientation & ORIENTATION_FLIP_Y;
90      dst_min = cliprect->min_y;
91      dst_max = cliprect->max_y;
90      dst_min = cliprect.min_y;
91      dst_max = cliprect.max_y;
9292   }
9393
9494   if (clipmask)
r13798r13799
221221#undef FIXPOINT_PRECISION_HALF
222222}
223223
224void k053250_t::draw( bitmap_t *bitmap, const rectangle *cliprect, int colorbase, int flags, int priority )
224void k053250_t::draw( bitmap_t *bitmap, const rectangle &cliprect, int colorbase, int flags, int priority )
225225{
226226   UINT8 *pix_ptr;
227227   const pen_t *pal_base, *pal_ptr;
r13798r13799
236236   UINT8 ctrl = regs[4];                           // register four is the main control register
237237
238238   // copy visible boundary values to more accessible locations
239   int dst_minx  = cliprect->min_x;
240   int dst_maxx  = cliprect->max_x;
241   int dst_miny  = cliprect->min_y;
242   int dst_maxy  = cliprect->max_y;
239   int dst_minx  = cliprect.min_x;
240   int dst_maxx  = cliprect.max_x;
241   int dst_miny  = cliprect.min_y;
242   int dst_maxy  = cliprect.max_y;
243243
244244   int orientation  = 0;   // orientation defaults to no swapping and no flipping
245245   int dst_height   = 512;   // virtual bitmap height defaults to five hundred and twelve pixels
src/emu/video/saa5050.c
r13798r13799
206206      saa5050->frame_count = 0;
207207}
208208
209void saa5050_update( device_t *device, bitmap_t *bitmap, const rectangle *cliprect  )
209void saa5050_update( device_t *device, bitmap_t *bitmap, const rectangle &cliprect  )
210210{
211211   saa5050_state *saa5050 = get_safe_token(device);
212212   int code, colour;
src/emu/video/k053250.h
r13798r13799
2626   DECLARE_WRITE16_MEMBER(ram_w);
2727   DECLARE_READ16_MEMBER(rom_r);
2828
29   void draw( bitmap_t *bitmap, const rectangle *cliprect, int colorbase, int flags, int priority );
29   void draw( bitmap_t *bitmap, const rectangle &cliprect, int colorbase, int flags, int priority );
3030
3131protected:
3232   void device_start();
r13798r13799
4747   void unpack_nibbles();
4848   void dma(int limiter);
4949   static void pdraw_scanline32(bitmap_t *bitmap, const pen_t *palette, UINT8 *source,
50                         const rectangle *cliprect, int linepos, int scroll, int zoom,
50                         const rectangle &cliprect, int linepos, int scroll, int zoom,
5151                         UINT32 clipmask, UINT32 wrapmask, UINT32 orientation, bitmap_t *priority, UINT8 pri);
5252};
5353
src/emu/video/sed1330.c
r13798r13799
582582//  draw_text_scanline -
583583//-------------------------------------------------
584584
585void sed1330_device::draw_text_scanline(bitmap_t *bitmap, const rectangle *cliprect, int y, UINT16 va)
585void sed1330_device::draw_text_scanline(bitmap_t *bitmap, const rectangle &cliprect, int y, UINT16 va)
586586{
587587   int sx, x;
588588
r13798r13799
623623//  draw_graphics_scanline -
624624//-------------------------------------------------
625625
626void sed1330_device::draw_graphics_scanline(bitmap_t *bitmap, const rectangle *cliprect, int y, UINT16 va)
626void sed1330_device::draw_graphics_scanline(bitmap_t *bitmap, const rectangle &cliprect, int y, UINT16 va)
627627{
628628   int sx, x;
629629
r13798r13799
644644//  update_graphics -
645645//-------------------------------------------------
646646
647void sed1330_device::update_graphics(bitmap_t *bitmap, const rectangle *cliprect)
647void sed1330_device::update_graphics(bitmap_t *bitmap, const rectangle &cliprect)
648648{
649649}
650650
r13798r13799
653653//  update_text -
654654//-------------------------------------------------
655655
656void sed1330_device::update_text(bitmap_t *bitmap, const rectangle *cliprect)
656void sed1330_device::update_text(bitmap_t *bitmap, const rectangle &cliprect)
657657{
658658   int y;
659659
r13798r13799
686686//  update_screen -
687687//-------------------------------------------------
688688
689void sed1330_device::update_screen(bitmap_t *bitmap, const rectangle *cliprect)
689void sed1330_device::update_screen(bitmap_t *bitmap, const rectangle &cliprect)
690690{
691691   if (m_d)
692692   {
src/emu/video/saa5050.h
r13798r13799
4141    DEVICE I/O FUNCTIONS
4242***************************************************************************/
4343
44void saa5050_update(device_t *device, bitmap_t *bitmap, const rectangle *cliprect);
44void saa5050_update(device_t *device, bitmap_t *bitmap, const rectangle &cliprect);
4545void saa5050_frame_advance(device_t *device);
4646
4747GFXDECODE_EXTERN( saa5050 );
src/emu/video/315_5124.c
r13798r13799
15801580}
15811581
15821582
1583void sega315_5124_device::update_video( bitmap_t *bitmap, const rectangle *cliprect )
1583void sega315_5124_device::update_video( bitmap_t *bitmap, const rectangle &cliprect )
15841584{
15851585   copybitmap(bitmap, m_tmpbitmap, 0, 0, 0, 0, cliprect);
15861586}
src/emu/video/cdp1861.c
r13798r13799
251251//  update_screen -
252252//-------------------------------------------------
253253
254void cdp1861_device::update_screen(bitmap_t *bitmap, const rectangle *cliprect)
254void cdp1861_device::update_screen(bitmap_t *bitmap, const rectangle &cliprect)
255255{
256256   if (m_disp)
257257   {
r13798r13799
259259   }
260260   else
261261   {
262      bitmap->fill(get_black_pen(machine()), *cliprect);
262      bitmap->fill(get_black_pen(machine()), cliprect);
263263   }
264264}
src/emu/video/sed1330.h
r13798r13799
4949    DECLARE_READ8_MEMBER( data_r );
5050    DECLARE_WRITE8_MEMBER( data_w );
5151
52   void update_screen(bitmap_t *bitmap, const rectangle *cliprect);
52   void update_screen(bitmap_t *bitmap, const rectangle &cliprect);
5353
5454protected:
5555    // device-level overrides
r13798r13799
6464   inline void writebyte(offs_t address, UINT8 m_data);
6565   inline void increment_csr();
6666
67   void draw_text_scanline(bitmap_t *bitmap, const rectangle *cliprect, int y, UINT16 va);
68   void draw_graphics_scanline(bitmap_t *bitmap, const rectangle *cliprect, int y, UINT16 va);
69   void update_graphics(bitmap_t *bitmap, const rectangle *cliprect);
70   void update_text(bitmap_t *bitmap, const rectangle *cliprect);
67   void draw_text_scanline(bitmap_t *bitmap, const rectangle &cliprect, int y, UINT16 va);
68   void draw_graphics_scanline(bitmap_t *bitmap, const rectangle &cliprect, int y, UINT16 va);
69   void update_graphics(bitmap_t *bitmap, const rectangle &cliprect);
70   void update_text(bitmap_t *bitmap, const rectangle &cliprect);
7171
7272private:
7373   int m_bf;               // busy flag
src/emu/video/315_5124.h
r13798r13799
8282   bitmap_t *get_y1_bitmap() { return m_y1_bitmap; };
8383
8484   /* update the screen */
85   void update_video( bitmap_t *bitmap, const rectangle *cliprect );
85   void update_video( bitmap_t *bitmap, const rectangle &cliprect );
8686
8787   virtual void set_sega315_5124_compatibility_mode( bool sega315_5124_compatibility_mode ) { };
8888
src/emu/video/cdp1861.h
r13798r13799
113113   DECLARE_WRITE_LINE_MEMBER( disp_on_w );
114114   DECLARE_WRITE_LINE_MEMBER( disp_off_w );
115115
116   void update_screen(bitmap_t *bitmap, const rectangle *cliprect);
116   void update_screen(bitmap_t *bitmap, const rectangle &cliprect);
117117
118118protected:
119119    // device-level overrides
src/emu/tilemap.c
r13798r13799
153153static void mappings_update(tilemap_t *tmap);
154154
155155/* tile rendering */
156static void pixmap_update(tilemap_t *tmap, const rectangle *cliprect);
156static void pixmap_update(tilemap_t *tmap);
157157static void tile_update(tilemap_t *tmap, tilemap_logical_index logindex, UINT32 cached_col, UINT32 cached_row);
158158static UINT8 tile_draw(tilemap_t *tmap, const UINT8 *pendata, UINT32 x0, UINT32 y0, UINT32 palette_base, UINT8 category, UINT8 group, UINT8 flags, UINT8 pen_mask);
159159static UINT8 tile_apply_bitmask(tilemap_t *tmap, const UINT8 *maskdata, UINT32 x0, UINT32 y0, UINT8 category, UINT8 flags);
160160
161161/* drawing helpers */
162static void configure_blit_parameters(blit_parameters *blit, tilemap_t *tmap, bitmap_t *dest, const rectangle *cliprect, UINT32 flags, UINT8 priority, UINT8 priority_mask);
162static void configure_blit_parameters(blit_parameters *blit, tilemap_t *tmap, bitmap_t *dest, const rectangle &cliprect, UINT32 flags, UINT8 priority, UINT8 priority_mask);
163163static void tilemap_draw_instance(tilemap_t *tmap, const blit_parameters *blit, int xpos, int ypos);
164164static void tilemap_draw_roz_core(tilemap_t *tmap, const blit_parameters *blit,
165165      UINT32 startx, UINT32 starty, int incxx, int incxy, int incyx, int incyy, int wraparound);
r13798r13799
779779bitmap_t *tilemap_get_pixmap(tilemap_t *tmap)
780780{
781781   /* ensure all the tiles are up-to-date and then return the pixmap */
782   pixmap_update(tmap, NULL);
782   pixmap_update(tmap);
783783   return tmap->pixmap;
784784}
785785
r13798r13799
792792bitmap_t *tilemap_get_flagsmap(tilemap_t *tmap)
793793{
794794   /* ensure all the tiles are up-to-date and then return the flagsmap */
795   pixmap_update(tmap, NULL);
795   pixmap_update(tmap);
796796   return tmap->flagsmap;
797797}
798798
r13798r13799
805805UINT8 *tilemap_get_tile_flags(tilemap_t *tmap)
806806{
807807   /* ensure all the tiles are up-to-date and then return the per-tile flags */
808   pixmap_update(tmap, NULL);
808   pixmap_update(tmap);
809809   return tmap->tileflags;
810810}
811811
r13798r13799
821821    priority/priority_mask to the priority bitmap
822822-------------------------------------------------*/
823823
824void tilemap_draw_primask(bitmap_t *dest, const rectangle *cliprect, tilemap_t *tmap, UINT32 flags, UINT8 priority, UINT8 priority_mask)
824void tilemap_draw_primask(bitmap_t *dest, const rectangle &cliprect, tilemap_t *tmap, UINT32 flags, UINT8 priority, UINT8 priority_mask)
825825{
826826   UINT32 width, height;
827827   blit_parameters blit;
r13798r13799
945945    priority_mask to the priority bitmap
946946-------------------------------------------------*/
947947
948void tilemap_draw_roz_primask(bitmap_t *dest, const rectangle *cliprect, tilemap_t *tmap,
948void tilemap_draw_roz_primask(bitmap_t *dest, const rectangle &cliprect, tilemap_t *tmap,
949949      UINT32 startx, UINT32 starty, int incxx, int incxy, int incyx, int incyy,
950950      int wraparound, UINT32 flags, UINT8 priority, UINT8 priority_mask)
951951{
r13798r13799
10321032   int xpos,ypos;
10331033
10341034   /* set up for the blit, using hard-coded parameters (no priority, etc) */
1035   configure_blit_parameters(&blit, tmap, dest, NULL, TILEMAP_DRAW_OPAQUE | TILEMAP_DRAW_ALL_CATEGORIES, 0, 0xff);
1035   configure_blit_parameters(&blit, tmap, dest, dest->cliprect(), TILEMAP_DRAW_OPAQUE | TILEMAP_DRAW_ALL_CATEGORIES, 0, 0xff);
10361036
10371037   /* compute the effective scroll positions */
10381038   scrollx = tmap->width  - scrollx % tmap->width;
r13798r13799
12621262***************************************************************************/
12631263
12641264/*-------------------------------------------------
1265    pixmap_update - update the portion of the
1266    pixmap described by the cliprect
1265    pixmap_update - update the entire pixmap
12671266-------------------------------------------------*/
12681267
1269static void pixmap_update(tilemap_t *tmap, const rectangle *cliprect)
1268static void pixmap_update(tilemap_t *tmap)
12701269{
12711270   int mincol, maxcol, minrow, maxrow;
12721271   int row, col;
r13798r13799
12821281g_profiler.start(PROFILER_TILEMAP_DRAW);
12831282
12841283   /* compute which columns and rows to update */
1285   if (cliprect != NULL)
1286   {
1287      mincol = cliprect->min_x / tmap->tilewidth;
1288      maxcol = cliprect->max_x / tmap->tilewidth;
1289      minrow = cliprect->min_y / tmap->tileheight;
1290      maxrow = cliprect->max_y / tmap->tileheight;
1291   }
1292   else
1293   {
1294      mincol = minrow = 0;
1295      maxcol = tmap->cols - 1;
1296      maxrow = tmap->rows - 1;
1297   }
1284   mincol = minrow = 0;
1285   maxcol = tmap->cols - 1;
1286   maxrow = tmap->rows - 1;
12981287
12991288   /* if the whole map is dirty, mark it as such */
13001289   if (tmap->all_tiles_dirty)
r13798r13799
15271516    and indexed drawing code
15281517-------------------------------------------------*/
15291518
1530static void configure_blit_parameters(blit_parameters *blit, tilemap_t *tmap, bitmap_t *dest, const rectangle *cliprect, UINT32 flags, UINT8 priority, UINT8 priority_mask)
1519static void configure_blit_parameters(blit_parameters *blit, tilemap_t *tmap, bitmap_t *dest, const rectangle &cliprect, UINT32 flags, UINT8 priority, UINT8 priority_mask)
15311520{
15321521   /* start with nothing */
15331522   memset(blit, 0, sizeof(*blit));
15341523
15351524   /* set the target bitmap */
15361525   blit->bitmap = dest;
1526   blit->cliprect = cliprect;
15371527
1538   /* if we have a cliprect, copy */
1539   if (cliprect != NULL)
1540      blit->cliprect = *cliprect;
1541
1542   /* otherwise, make one up */
1543   else
1544      blit->cliprect = dest->cliprect();
1545
15461528   /* set the priority code and alpha */
15471529   blit->tilemap_priority_code = priority | (priority_mask << 8) | (tmap->palette_offset << 16);
15481530   blit->alpha = (flags & TILEMAP_DRAW_ALPHA_FLAG) ? (flags >> 24) : 0xff;
src/emu/tilemap.h
r13798r13799
518518/* ----- tilemap rendering ----- */
519519
520520/* draw a tilemap to the destination with clipping; pixels apply priority/priority_mask to the priority bitmap */
521void tilemap_draw_primask(bitmap_t *dest, const rectangle *cliprect, tilemap_t *tmap, UINT32 flags, UINT8 priority, UINT8 priority_mask);
521void tilemap_draw_primask(bitmap_t *dest, const rectangle &cliprect, tilemap_t *tmap, UINT32 flags, UINT8 priority, UINT8 priority_mask);
522522
523523/* draw a tilemap to the destination with clipping and arbitrary rotate/zoom; */
524524/* pixels apply priority/priority_mask to the priority bitmap */
525void tilemap_draw_roz_primask(bitmap_t *dest, const rectangle *cliprect, tilemap_t *tmap,
525void tilemap_draw_roz_primask(bitmap_t *dest, const rectangle &cliprect, tilemap_t *tmap,
526526      UINT32 startx, UINT32 starty, int incxx, int incxy, int incyx, int incyy,
527527      int wraparound, UINT32 flags, UINT8 priority, UINT8 priority_mask);
528528
r13798r13799
595595    tilemap_draw_primask
596596-------------------------------------------------*/
597597
598INLINE void tilemap_draw(bitmap_t *dest, const rectangle *cliprect, tilemap_t *tmap, UINT32 flags, UINT8 priority)
598INLINE void tilemap_draw(bitmap_t *dest, const rectangle &cliprect, tilemap_t *tmap, UINT32 flags, UINT8 priority)
599599{
600600   tilemap_draw_primask(dest, cliprect, tmap, flags, priority, 0xff);
601601}
r13798r13799
606606    tilemap_draw_roz_primask
607607-------------------------------------------------*/
608608
609INLINE void tilemap_draw_roz(bitmap_t *dest, const rectangle *cliprect, tilemap_t *tmap,
609INLINE void tilemap_draw_roz(bitmap_t *dest, const rectangle &cliprect, tilemap_t *tmap,
610610      UINT32 startx, UINT32 starty, int incxx, int incxy, int incyx, int incyy,
611611      int wraparound, UINT32 flags, UINT8 priority)
612612{
src/emu/sound/cdp1869.c
r13798r13799
907907//  update_screen - update screen
908908//-------------------------------------------------
909909
910void cdp1869_device::update_screen(bitmap_t *bitmap, const rectangle *cliprect)
910void cdp1869_device::update_screen(bitmap_t *bitmap, const rectangle &cliprect)
911911{
912912   rectangle screen_rect, outer;
913913
r13798r13799
934934      screen_rect.max_y = CDP1869_SCANLINE_DISPLAY_END_PAL - 1;
935935   }
936936
937   outer &= *cliprect;
937   outer &= cliprect;
938938   bitmap->fill(m_bkg, outer);
939939
940940   if (!m_dispoff)
src/emu/sound/cdp1869.h
r13798r13799
231231   DECLARE_READ_LINE_MEMBER( predisplay_r );
232232   DECLARE_READ_LINE_MEMBER( pal_ntsc_r );
233233
234   void update_screen(bitmap_t *bitmap, const rectangle *cliprect);
234   void update_screen(bitmap_t *bitmap, const rectangle &cliprect);
235235
236236protected:
237237    // device-level overrides
src/emu/sound/mos6560.c
r13798r13799
509509     main screen bitmap
510510-------------------------------------------------*/
511511
512UINT32 mos6560_video_update( device_t *device, bitmap_t *bitmap, const rectangle *cliprect )
512UINT32 mos6560_video_update( device_t *device, bitmap_t *bitmap, const rectangle &cliprect )
513513{
514514   mos6560_state *mos6560 = get_safe_token(device);
515515
src/emu/sound/mos6560.h
r13798r13799
107107READ8_DEVICE_HANDLER( mos6560_port_r );
108108
109109void mos6560_raster_interrupt_gen( device_t *device );
110UINT32 mos6560_video_update( device_t *device, bitmap_t *bitmap, const rectangle *cliprect );
110UINT32 mos6560_video_update( device_t *device, bitmap_t *bitmap, const rectangle &cliprect );
111111
112112
113113#endif /* __MOS6560_H__ */
src/emu/sound/cdp1864.c
r13798r13799
470470//  update_screen -
471471//-------------------------------------------------
472472
473void cdp1864_device::update_screen(bitmap_t *bitmap, const rectangle *cliprect)
473void cdp1864_device::update_screen(bitmap_t *bitmap, const rectangle &cliprect)
474474{
475475   if (m_disp)
476476   {
477477      copybitmap(bitmap, m_bitmap, 0, 0, 0, 0, cliprect);
478      m_bitmap->fill(CDP1864_BACKGROUND_COLOR_SEQUENCE[m_bgcolor] + 8, *cliprect);
478      m_bitmap->fill(CDP1864_BACKGROUND_COLOR_SEQUENCE[m_bgcolor] + 8, cliprect);
479479   }
480480   else
481481   {
482      bitmap->fill(get_black_pen(machine()), *cliprect);
482      bitmap->fill(get_black_pen(machine()), cliprect);
483483   }
484484}
src/emu/sound/cdp1864.h
r13798r13799
156156   DECLARE_WRITE_LINE_MEMBER( aoe_w );
157157   DECLARE_WRITE_LINE_MEMBER( evs_w );
158158
159   void update_screen(bitmap_t *bitmap, const rectangle *cliprect);
159   void update_screen(bitmap_t *bitmap, const rectangle &cliprect);
160160
161161protected:
162162    // device-level overrides
src/emu/machine/ldcore.c
r13798r13799
11961196      /* handle the overlay if present */
11971197      if (overbitmap != NULL && ldcore->config.overupdate != NULL)
11981198      {
1199         rectangle clip = *cliprect;
1199         rectangle clip = cliprect;
12001200
12011201         /* scale the cliprect to the overlay size and then call the update callback */
12021202         clip.min_x = ldcore->config.overclip_min_x;
12031203         clip.max_x = ldcore->config.overclip_max_x;
1204         clip.min_y = cliprect->min_y * overbitmap->height() / bitmap->height();
1205         if (cliprect->min_y == visarea.min_y)
1204         clip.min_y = cliprect.min_y * overbitmap->height() / bitmap->height();
1205         if (cliprect.min_y == visarea.min_y)
12061206            clip.min_y = MIN(clip.min_y, ldcore->config.overclip_min_y);
1207         clip.max_y = (cliprect->max_y + 1) * overbitmap->height() / bitmap->height() - 1;
1208         (*ldcore->config.overupdate)(screen, overbitmap, &clip);
1207         clip.max_y = (cliprect.max_y + 1) * overbitmap->height() / bitmap->height() - 1;
1208         (*ldcore->config.overupdate)(screen, overbitmap, clip);
12091209      }
12101210
12111211      /* if this is the last update, do the rendering */
1212      if (cliprect->max_y == visarea.max_y)
1212      if (cliprect.max_y == visarea.max_y)
12131213      {
12141214         /* update the texture with the overlay contents */
12151215         if (overbitmap != NULL)
src/emu/machine/s3c24xx.c
r13798r13799
806806      }
807807}
808808
809static UINT32 s3c24xx_video_update( device_t *device, screen_device &screen, bitmap_t *bitmap, const rectangle *cliprect)
809static UINT32 s3c24xx_video_update( device_t *device, screen_device &screen, bitmap_t *bitmap, const rectangle &cliprect)
810810{
811811   s3c24xx_t *s3c24xx = get_token( device);
812812   if (s3c24xx->lcd.regs.lcdcon1 & (1 << 0))
src/emu/screen.c
r13798r13799
10741074bool screen_device::screen_update(bitmap_t &bitmap, const rectangle &cliprect)
10751075{
10761076   if (m_screen_update != NULL) {
1077      return (*m_screen_update)(*this, &bitmap, &cliprect);
1077      return (*m_screen_update)(*this, &bitmap, cliprect);
10781078   } else {
10791079      return machine().driver_data<driver_device>()->screen_update(*this, bitmap, cliprect);
10801080   }
src/emu/screen.h
r13798r13799
7474// callback that is called to notify of a change in the VBLANK state
7575typedef delegate<void (screen_device &, bool)> vblank_state_delegate;
7676
77typedef UINT32 (*screen_update_func)(screen_device &screen, bitmap_t *bitmap, const rectangle *cliprect);
77typedef UINT32 (*screen_update_func)(screen_device &screen, bitmap_t *bitmap, const rectangle &cliprect);
7878typedef void (*screen_eof_func)(screen_device &screen);
7979
8080
r13798r13799
255255//**************************************************************************
256256
257257#define SCREEN_UPDATE_NAME(name)      screen_update_##name
258#define SCREEN_UPDATE(name)            UINT32 SCREEN_UPDATE_NAME(name)(screen_device &screen, bitmap_t *bitmap, const rectangle *cliprect)
258#define SCREEN_UPDATE(name)            UINT32 SCREEN_UPDATE_NAME(name)(screen_device &screen, bitmap_t *bitmap, const rectangle &cliprect)
259259#define SCREEN_UPDATE_CALL(name)      SCREEN_UPDATE_NAME(name)(screen, bitmap, cliprect)
260260
261261#define SCREEN_EOF_NAME(name)         screen_eof_##name
src/emu/drawgfx.c
r13798r13799
501501    no transparency
502502-------------------------------------------------*/
503503
504void drawgfx_opaque(bitmap_t *dest, const rectangle *cliprect, const gfx_element *gfx,
504void drawgfx_opaque(bitmap_t *dest, const rectangle &cliprect, const gfx_element *gfx,
505505      UINT32 code, UINT32 color, int flipx, int flipy, INT32 destx, INT32 desty)
506506{
507507   bitmap_t *priority = NULL;   /* dummy, no priority in this case */
r13798r13799
529529    a single transparent pen
530530-------------------------------------------------*/
531531
532void drawgfx_transpen(bitmap_t *dest, const rectangle *cliprect, const gfx_element *gfx,
532void drawgfx_transpen(bitmap_t *dest, const rectangle &cliprect, const gfx_element *gfx,
533533      UINT32 code, UINT32 color, int flipx, int flipy, INT32 destx, INT32 desty,
534534      UINT32 transpen)
535535{
r13798r13799
583583    lookups
584584-------------------------------------------------*/
585585
586void drawgfx_transpen_raw(bitmap_t *dest, const rectangle *cliprect, const gfx_element *gfx,
586void drawgfx_transpen_raw(bitmap_t *dest, const rectangle &cliprect, const gfx_element *gfx,
587587      UINT32 code, UINT32 color, int flipx, int flipy, INT32 destx, INT32 desty,
588588      UINT32 transpen)
589589{
r13798r13799
614614    a mask
615615-------------------------------------------------*/
616616
617void drawgfx_transmask(bitmap_t *dest, const rectangle *cliprect, const gfx_element *gfx,
617void drawgfx_transmask(bitmap_t *dest, const rectangle &cliprect, const gfx_element *gfx,
618618      UINT32 code, UINT32 color, int flipx, int flipy, INT32 destx, INT32 desty,
619619      UINT32 transmask)
620620{
r13798r13799
668668    transparent, opaque, or shadowing
669669-------------------------------------------------*/
670670
671void drawgfx_transtable(bitmap_t *dest, const rectangle *cliprect, const gfx_element *gfx,
671void drawgfx_transtable(bitmap_t *dest, const rectangle &cliprect, const gfx_element *gfx,
672672      UINT32 code, UINT32 color, int flipx, int flipy, INT32 destx, INT32 desty,
673673      const UINT8 *pentable, const pen_t *shadowtable)
674674{
r13798r13799
699699    remaining pixels with a fixed alpha value
700700-------------------------------------------------*/
701701
702void drawgfx_alpha(bitmap_t *dest, const rectangle *cliprect, const gfx_element *gfx,
702void drawgfx_alpha(bitmap_t *dest, const rectangle &cliprect, const gfx_element *gfx,
703703      UINT32 code, UINT32 color, int flipx, int flipy, INT32 destx, INT32 desty,
704704      UINT32 transpen, UINT8 alpha)
705705{
r13798r13799
744744    element with no transparency
745745-------------------------------------------------*/
746746
747void drawgfxzoom_opaque(bitmap_t *dest, const rectangle *cliprect, const gfx_element *gfx,
747void drawgfxzoom_opaque(bitmap_t *dest, const rectangle &cliprect, const gfx_element *gfx,
748748      UINT32 code, UINT32 color, int flipx, int flipy, INT32 destx, INT32 desty,
749749      UINT32 scalex, UINT32 scaley)
750750{
r13798r13799
780780    element with a single transparent pen
781781-------------------------------------------------*/
782782
783void drawgfxzoom_transpen(bitmap_t *dest, const rectangle *cliprect, const gfx_element *gfx,
783void drawgfxzoom_transpen(bitmap_t *dest, const rectangle &cliprect, const gfx_element *gfx,
784784      UINT32 code, UINT32 color, int flipx, int flipy, INT32 destx, INT32 desty,
785785      UINT32 scalex, UINT32 scaley, UINT32 transpen)
786786{
r13798r13799
841841    color lookups
842842-------------------------------------------------*/
843843
844void drawgfxzoom_transpen_raw(bitmap_t *dest, const rectangle *cliprect, const gfx_element *gfx,
844void drawgfxzoom_transpen_raw(bitmap_t *dest, const rectangle &cliprect, const gfx_element *gfx,
845845      UINT32 code, UINT32 color, int flipx, int flipy, INT32 destx, INT32 desty,
846846      UINT32 scalex, UINT32 scaley, UINT32 transpen)
847847{
r13798r13799
879879    provided as a mask
880880-------------------------------------------------*/
881881
882void drawgfxzoom_transmask(bitmap_t *dest, const rectangle *cliprect, const gfx_element *gfx,
882void drawgfxzoom_transmask(bitmap_t *dest, const rectangle &cliprect, const gfx_element *gfx,
883883      UINT32 code, UINT32 color, int flipx, int flipy, INT32 destx, INT32 desty,
884884      UINT32 scalex, UINT32 scaley, UINT32 transmask)
885885{
r13798r13799
940940    are transparent, opaque, or shadowing
941941-------------------------------------------------*/
942942
943void drawgfxzoom_transtable(bitmap_t *dest, const rectangle *cliprect, const gfx_element *gfx,
943void drawgfxzoom_transtable(bitmap_t *dest, const rectangle &cliprect, const gfx_element *gfx,
944944      UINT32 code, UINT32 color, int flipx, int flipy, INT32 destx, INT32 desty,
945945      UINT32 scalex, UINT32 scaley, const UINT8 *pentable, const pen_t *shadowtable)
946946{
r13798r13799
978978    the remaining pixels with a fixed alpha value
979979-------------------------------------------------*/
980980
981void drawgfxzoom_alpha(bitmap_t *dest, const rectangle *cliprect, const gfx_element *gfx,
981void drawgfxzoom_alpha(bitmap_t *dest, const rectangle &cliprect, const gfx_element *gfx,
982982      UINT32 code, UINT32 color, int flipx, int flipy, INT32 destx, INT32 desty,
983983      UINT32 scalex, UINT32 scaley, UINT32 transpen, UINT8 alpha)
984984{
r13798r13799
10311031    bitmap
10321032-------------------------------------------------*/
10331033
1034void pdrawgfx_opaque(bitmap_t *dest, const rectangle *cliprect, const gfx_element *gfx,
1034void pdrawgfx_opaque(bitmap_t *dest, const rectangle &cliprect, const gfx_element *gfx,
10351035      UINT32 code, UINT32 color, int flipx, int flipy, INT32 destx, INT32 desty,
10361036      bitmap_t *priority, UINT32 pmask)
10371037{
r13798r13799
10631063    priority bitmap
10641064-------------------------------------------------*/
10651065
1066void pdrawgfx_transpen(bitmap_t *dest, const rectangle *cliprect, const gfx_element *gfx,
1066void pdrawgfx_transpen(bitmap_t *dest, const rectangle &cliprect, const gfx_element *gfx,
10671067      UINT32 code, UINT32 color, int flipx, int flipy, INT32 destx, INT32 desty,
10681068      bitmap_t *priority, UINT32 pmask, UINT32 transpen)
10691069{
r13798r13799
11191119    lookups, checking against the priority bitmap
11201120-------------------------------------------------*/
11211121
1122void pdrawgfx_transpen_raw(bitmap_t *dest, const rectangle *cliprect, const gfx_element *gfx,
1122void pdrawgfx_transpen_raw(bitmap_t *dest, const rectangle &cliprect, const gfx_element *gfx,
11231123      UINT32 code, UINT32 color, int flipx, int flipy, INT32 destx, INT32 desty,
11241124      bitmap_t *priority, UINT32 pmask, UINT32 transpen)
11251125{
r13798r13799
11511151    a mask, checking against the priority bitmap
11521152-------------------------------------------------*/
11531153
1154void pdrawgfx_transmask(bitmap_t *dest, const rectangle *cliprect, const gfx_element *gfx,
1154void pdrawgfx_transmask(bitmap_t *dest, const rectangle &cliprect, const gfx_element *gfx,
11551155      UINT32 code, UINT32 color, int flipx, int flipy, INT32 destx, INT32 desty,
11561156      bitmap_t *priority, UINT32 pmask, UINT32 transmask)
11571157{
r13798r13799
12081208    against the priority bitmap
12091209-------------------------------------------------*/
12101210
1211void pdrawgfx_transtable(bitmap_t *dest, const rectangle *cliprect, const gfx_element *gfx,
1211void pdrawgfx_transtable(bitmap_t *dest, const rectangle &cliprect, const gfx_element *gfx,
12121212      UINT32 code, UINT32 color, int flipx, int flipy, INT32 destx, INT32 desty,
12131213      bitmap_t *priority, UINT32 pmask, const UINT8 *pentable, const pen_t *shadowtable)
12141214{
r13798r13799
12421242    checking against the priority bitmap
12431243-------------------------------------------------*/
12441244
1245void pdrawgfx_alpha(bitmap_t *dest, const rectangle *cliprect, const gfx_element *gfx,
1245void pdrawgfx_alpha(bitmap_t *dest, const rectangle &cliprect, const gfx_element *gfx,
12461246      UINT32 code, UINT32 color, int flipx, int flipy, INT32 destx, INT32 desty,
12471247      bitmap_t *priority, UINT32 pmask, UINT32 transpen, UINT8 alpha)
12481248{
r13798r13799
12901290    the priority bitmap
12911291-------------------------------------------------*/
12921292
1293void pdrawgfxzoom_opaque(bitmap_t *dest, const rectangle *cliprect, const gfx_element *gfx,
1293void pdrawgfxzoom_opaque(bitmap_t *dest, const rectangle &cliprect, const gfx_element *gfx,
12941294      UINT32 code, UINT32 color, int flipx, int flipy, INT32 destx, INT32 desty,
12951295      UINT32 scalex, UINT32 scaley, bitmap_t *priority, UINT32 pmask)
12961296{
r13798r13799
13291329    checking against the priority bitmap
13301330-------------------------------------------------*/
13311331
1332void pdrawgfxzoom_transpen(bitmap_t *dest, const rectangle *cliprect, const gfx_element *gfx,
1332void pdrawgfxzoom_transpen(bitmap_t *dest, const rectangle &cliprect, const gfx_element *gfx,
13331333      UINT32 code, UINT32 color, int flipx, int flipy, INT32 destx, INT32 desty,
13341334      UINT32 scalex, UINT32 scaley, bitmap_t *priority, UINT32 pmask,
13351335      UINT32 transpen)
r13798r13799
13941394    bitmap
13951395-------------------------------------------------*/
13961396
1397void pdrawgfxzoom_transpen_raw(bitmap_t *dest, const rectangle *cliprect, const gfx_element *gfx,
1397void pdrawgfxzoom_transpen_raw(bitmap_t *dest, const rectangle &cliprect, const gfx_element *gfx,
13981398      UINT32 code, UINT32 color, int flipx, int flipy, INT32 destx, INT32 desty,
13991399      UINT32 scalex, UINT32 scaley, bitmap_t *priority, UINT32 pmask,
14001400      UINT32 transpen)
r13798r13799
14351435    priority bitmap
14361436-------------------------------------------------*/
14371437
1438void pdrawgfxzoom_transmask(bitmap_t *dest, const rectangle *cliprect, const gfx_element *gfx,
1438void pdrawgfxzoom_transmask(bitmap_t *dest, const rectangle &cliprect, const gfx_element *gfx,
14391439      UINT32 code, UINT32 color, int flipx, int flipy, INT32 destx, INT32 desty,
14401440      UINT32 scalex, UINT32 scaley, bitmap_t *priority, UINT32 pmask,
14411441      UINT32 transmask)
r13798r13799
15001500    checking against the priority bitmap
15011501-------------------------------------------------*/
15021502
1503void pdrawgfxzoom_transtable(bitmap_t *dest, const rectangle *cliprect, const gfx_element *gfx,
1503void pdrawgfxzoom_transtable(bitmap_t *dest, const rectangle &cliprect, const gfx_element *gfx,
15041504      UINT32 code, UINT32 color, int flipx, int flipy, INT32 destx, INT32 desty,
15051505      UINT32 scalex, UINT32 scaley, bitmap_t *priority, UINT32 pmask,
15061506      const UINT8 *pentable, const pen_t *shadowtable)
r13798r13799
15431543    bitmap
15441544-------------------------------------------------*/
15451545
1546void pdrawgfxzoom_alpha(bitmap_t *dest, const rectangle *cliprect, const gfx_element *gfx,
1546void pdrawgfxzoom_alpha(bitmap_t *dest, const rectangle &cliprect, const gfx_element *gfx,
15471547      UINT32 code, UINT32 color, int flipx, int flipy, INT32 destx, INT32 desty,
15481548      UINT32 scalex, UINT32 scaley, bitmap_t *priority, UINT32 pmask,
15491549      UINT32 transpen, UINT8 alpha)
r13798r13799
17641764    copying all unclipped pixels
17651765-------------------------------------------------*/
17661766
1767void copybitmap(bitmap_t *dest, bitmap_t *src, int flipx, int flipy, INT32 destx, INT32 desty, const rectangle *cliprect)
1767void copybitmap(bitmap_t *dest, bitmap_t *src, int flipx, int flipy, INT32 destx, INT32 desty, const rectangle &cliprect)
17681768{
17691769   bitmap_t *priority = NULL;   /* dummy, no priority in this case */
17701770
r13798r13799
17881788    those that match transpen
17891789-------------------------------------------------*/
17901790
1791void copybitmap_trans(bitmap_t *dest, bitmap_t *src, int flipx, int flipy, INT32 destx, INT32 desty, const rectangle *cliprect, UINT32 transpen)
1791void copybitmap_trans(bitmap_t *dest, bitmap_t *src, int flipx, int flipy, INT32 destx, INT32 desty, const rectangle &cliprect, UINT32 transpen)
17921792{
17931793   bitmap_t *priority = NULL;   /* dummy, no priority in this case */
17941794
r13798r13799
18321832    applying scrolling to one or more rows/colums
18331833-------------------------------------------------*/
18341834
1835void copyscrollbitmap(bitmap_t *dest, bitmap_t *src, UINT32 numrows, const INT32 *rowscroll, UINT32 numcols, const INT32 *colscroll, const rectangle *cliprect)
1835void copyscrollbitmap(bitmap_t *dest, bitmap_t *src, UINT32 numrows, const INT32 *rowscroll, UINT32 numcols, const INT32 *colscroll, const rectangle &cliprect)
18361836{
18371837   /* just call through to the transparent case as the underlying copybitmap will
18381838       optimize for pen == 0xffffffff */
r13798r13799
18471847    scrolling to one or more rows/colums
18481848-------------------------------------------------*/
18491849
1850void copyscrollbitmap_trans(bitmap_t *dest, bitmap_t *src, UINT32 numrows, const INT32 *rowscroll, UINT32 numcols, const INT32 *colscroll, const rectangle *cliprect, UINT32 transpen)
1850void copyscrollbitmap_trans(bitmap_t *dest, bitmap_t *src, UINT32 numrows, const INT32 *rowscroll, UINT32 numcols, const INT32 *colscroll, const rectangle &cliprect, UINT32 transpen)
18511851{
18521852   /* no rowscroll and no colscroll means no scroll */
18531853   if (numrows == 0 && numcols == 0)
r13798r13799
18651865   assert(numcols != 0 || colscroll == NULL);
18661866   assert(numcols == 0 || colscroll != NULL);
18671867
1868   /* NULL clip means use the full bitmap */
1869   if (cliprect == NULL)
1870      cliprect = &dest->cliprect();
1871
18721868   /* fully scrolling X,Y playfield */
18731869   if (numrows <= 1 && numcols <= 1)
18741870   {
r13798r13799
18861882   else if (numrows <= 1)
18871883   {
18881884      INT32 xscroll = normalize_xscroll(src, (numrows == 0) ? 0 : rowscroll[0]);
1889      rectangle subclip = *cliprect;
1885      rectangle subclip = cliprect;
18901886      int col, colwidth, groupcols;
18911887
18921888      /* determine width of each column */
r13798r13799
19111907            /* compute the cliprect for this group */
19121908            subclip.min_x = col * colwidth + sx;
19131909            subclip.max_x = (col + groupcols) * colwidth - 1 + sx;
1914            subclip &= *cliprect;
1910            subclip &= cliprect;
19151911
19161912            /* iterate over all portions of the scroll that overlap the destination */
19171913            for (sy = yscroll - src->height(); sy < dest->height(); sy += src->height())
1918               copybitmap_trans(dest, src, 0, 0, sx, sy, &subclip, transpen);
1914               copybitmap_trans(dest, src, 0, 0, sx, sy, subclip, transpen);
19191915         }
19201916      }
19211917   }
r13798r13799
19241920   else if (numcols <= 1)
19251921   {
19261922      INT32 yscroll = normalize_yscroll(src, (numcols == 0) ? 0 : colscroll[0]);
1927      rectangle subclip = *cliprect;
1923      rectangle subclip = cliprect;
19281924      int row, rowheight, grouprows;
19291925
19301926      /* determine width of each rows */
r13798r13799
19491945            /* compute the cliprect for this group */
19501946            subclip.min_y = row * rowheight + sy;
19511947            subclip.max_y = (row + grouprows) * rowheight - 1 + sy;
1952            subclip &= *cliprect;
1948            subclip &= cliprect;
19531949
19541950            /* iterate over all portions of the scroll that overlap the destination */
19551951            for (sx = xscroll - src->width(); sx < dest->width(); sx += src->width())
1956               copybitmap_trans(dest, src, 0, 0, sx, sy, &subclip, transpen);
1952               copybitmap_trans(dest, src, 0, 0, sx, sy, subclip, transpen);
19571953         }
19581954      }
19591955   }
r13798r13799
19711967    pixels
19721968-------------------------------------------------*/
19731969
1974void copyrozbitmap(bitmap_t *dest, const rectangle *cliprect, bitmap_t *src, INT32 startx, INT32 starty, INT32 incxx, INT32 incxy, INT32 incyx, INT32 incyy, int wraparound)
1970void copyrozbitmap(bitmap_t *dest, const rectangle &cliprect, bitmap_t *src, INT32 startx, INT32 starty, INT32 incxx, INT32 incxy, INT32 incyx, INT32 incyy, int wraparound)
19751971{
19761972   bitmap_t *priority = NULL;   /* dummy, no priority in this case */
19771973
r13798r13799
19961992    transpen
19971993-------------------------------------------------*/
19981994
1999void copyrozbitmap_trans(bitmap_t *dest, const rectangle *cliprect, bitmap_t *src, INT32 startx, INT32 starty, INT32 incxx, INT32 incxy, INT32 incyx, INT32 incyy, int wraparound, UINT32 transpen)
1995void copyrozbitmap_trans(bitmap_t *dest, const rectangle &cliprect, bitmap_t *src, INT32 startx, INT32 starty, INT32 incxx, INT32 incxy, INT32 incyx, INT32 incyy, int wraparound, UINT32 transpen)
20001996{
20011997   bitmap_t *priority = NULL;   /* dummy, no priority in this case */
20021998
src/emu/drawgfx.h
r13798r13799
196196/* ----- core graphics drawing ----- */
197197
198198/* specific drawgfx implementations for each transparency type */
199void drawgfx_opaque(bitmap_t *dest, const rectangle *cliprect, const gfx_element *gfx, UINT32 code, UINT32 color, int flipx, int flipy, INT32 destx, INT32 desty);
200void drawgfx_transpen(bitmap_t *dest, const rectangle *cliprect, const gfx_element *gfx, UINT32 code, UINT32 color, int flipx, int flipy, INT32 destx, INT32 desty, UINT32 transpen);
201void drawgfx_transpen_raw(bitmap_t *dest, const rectangle *cliprect, const gfx_element *gfx, UINT32 code, UINT32 color, int flipx, int flipy, INT32 destx, INT32 desty, UINT32 transpen);
202void drawgfx_transmask(bitmap_t *dest, const rectangle *cliprect, const gfx_element *gfx, UINT32 code, UINT32 color, int flipx, int flipy, INT32 destx, INT32 desty, UINT32 transmask);
203void drawgfx_transtable(bitmap_t *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);
204void drawgfx_alpha(bitmap_t *dest, const rectangle *cliprect, const gfx_element *gfx, UINT32 code, UINT32 color, int flipx, int flipy, INT32 destx, INT32 desty, UINT32 transpen, UINT8 alpha);
199void drawgfx_opaque(bitmap_t *dest, const rectangle &cliprect, const gfx_element *gfx, UINT32 code, UINT32 color, int flipx, int flipy, INT32 destx, INT32 desty);
200void drawgfx_transpen(bitmap_t *dest, const rectangle &cliprect, const gfx_element *gfx, UINT32 code, UINT32 color, int flipx, int flipy, INT32 destx, INT32 desty, UINT32 transpen);
201void drawgfx_transpen_raw(bitmap_t *dest, const rectangle &cliprect, const gfx_element *gfx, UINT32 code, UINT32 color, int flipx, int flipy, INT32 destx, INT32 desty, UINT32 transpen);
202void drawgfx_transmask(bitmap_t *dest, const rectangle &cliprect, const gfx_element *gfx, UINT32 code, UINT32 color, int flipx, int flipy, INT32 destx, INT32 desty, UINT32 transmask);
203void drawgfx_transtable(bitmap_t *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);
204void drawgfx_alpha(bitmap_t *dest, const rectangle &cliprect, const gfx_element *gfx, UINT32 code, UINT32 color, int flipx, int flipy, INT32 destx, INT32 desty, UINT32 transpen, UINT8 alpha);
205205
206206
207207
208208/* ----- zoomed graphics drawing ----- */
209209
210210/* specific drawgfxzoom implementations for each transparency type */
211void drawgfxzoom_opaque(bitmap_t *dest, const rectangle *cliprect, const gfx_element *gfx, UINT32 code, UINT32 color, int flipx, int flipy, INT32 destx, INT32 desty, UINT32 scalex, UINT32 scaley);
212void drawgfxzoom_transpen(bitmap_t *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);
213void drawgfxzoom_transpen_raw(bitmap_t *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);
214void drawgfxzoom_transmask(bitmap_t *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);
215void drawgfxzoom_transtable(bitmap_t *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);
216void drawgfxzoom_alpha(bitmap_t *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);
211void drawgfxzoom_opaque(bitmap_t *dest, const rectangle &cliprect, const gfx_element *gfx, UINT32 code, UINT32 color, int flipx, int flipy, INT32 destx, INT32 desty, UINT32 scalex, UINT32 scaley);
212void drawgfxzoom_transpen(bitmap_t *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);
213void drawgfxzoom_transpen_raw(bitmap_t *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);
214void drawgfxzoom_transmask(bitmap_t *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);
215void drawgfxzoom_transtable(bitmap_t *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);
216void drawgfxzoom_alpha(bitmap_t *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);
217217
218218
219219
220220/* ----- priority masked graphics drawing ----- */
221221
222222/* specific pdrawgfx implementations for each transparency type */
223void pdrawgfx_opaque(bitmap_t *dest, const rectangle *cliprect, const gfx_element *gfx, UINT32 code, UINT32 color, int flipx, int flipy, INT32 destx, INT32 desty, bitmap_t *priority, UINT32 pmask);
224void pdrawgfx_transpen(bitmap_t *dest, const rectangle *cliprect, const gfx_element *gfx, UINT32 code, UINT32 color, int flipx, int flipy, INT32 destx, INT32 desty, bitmap_t *priority, UINT32 pmask, UINT32 transpen);
225void pdrawgfx_transpen_raw(bitmap_t *dest, const rectangle *cliprect, const gfx_element *gfx, UINT32 code, UINT32 color, int flipx, int flipy, INT32 destx, INT32 desty, bitmap_t *priority, UINT32 pmask, UINT32 transpen);
226void pdrawgfx_transmask(bitmap_t *dest, const rectangle *cliprect, const gfx_element *gfx, UINT32 code, UINT32 color, int flipx, int flipy, INT32 destx, INT32 desty, bitmap_t *priority, UINT32 pmask, UINT32 transmask);
227void pdrawgfx_transtable(bitmap_t *dest, const rectangle *cliprect, const gfx_element *gfx, UINT32 code, UINT32 color, int flipx, int flipy, INT32 destx, INT32 desty, bitmap_t *priority, UINT32 pmask, const UINT8 *pentable, const pen_t *shadowtable);
228void pdrawgfx_alpha(bitmap_t *dest, const rectangle *cliprect, const gfx_element *gfx, UINT32 code, UINT32 color, int flipx, int flipy, INT32 destx, INT32 desty, bitmap_t *priority, UINT32 pmask, UINT32 transpen, UINT8 alpha);
223void pdrawgfx_opaque(bitmap_t *dest, const rectangle &cliprect, const gfx_element *gfx, UINT32 code, UINT32 color, int flipx, int flipy, INT32 destx, INT32 desty, bitmap_t *priority, UINT32 pmask);
224void pdrawgfx_transpen(bitmap_t *dest, const rectangle &cliprect, const gfx_element *gfx, UINT32 code, UINT32 color, int flipx, int flipy, INT32 destx, INT32 desty, bitmap_t *priority, UINT32 pmask, UINT32 transpen);
225void pdrawgfx_transpen_raw(bitmap_t *dest, const rectangle &cliprect, const gfx_element *gfx, UINT32 code, UINT32 color, int flipx, int flipy, INT32 destx, INT32 desty, bitmap_t *priority, UINT32 pmask, UINT32 transpen);
226void pdrawgfx_transmask(bitmap_t *dest, const rectangle &cliprect, const gfx_element *gfx, UINT32 code, UINT32 color, int flipx, int flipy, INT32 destx, INT32 desty, bitmap_t *priority, UINT32 pmask, UINT32 transmask);
227void pdrawgfx_transtable(bitmap_t *dest, const rectangle &cliprect, const gfx_element *gfx, UINT32 code, UINT32 color, int flipx, int flipy, INT32 destx, INT32 desty, bitmap_t *priority, UINT32 pmask, const UINT8 *pentable, const pen_t *shadowtable);
228void pdrawgfx_alpha(bitmap_t *dest, const rectangle &cliprect, const gfx_element *gfx, UINT32 code, UINT32 color, int flipx, int flipy, INT32 destx, INT32 desty, bitmap_t *priority, UINT32 pmask, UINT32 transpen, UINT8 alpha);
229229
230230
231231
232232/* ----- priority masked zoomed graphics drawing ----- */
233233
234234/* specific pdrawgfxzoom implementations for each transparency type */
235void pdrawgfxzoom_opaque(bitmap_t *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_t *priority, UINT32 pmask);
236void pdrawgfxzoom_transpen(bitmap_t *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_t *priority, UINT32 pmask, UINT32 transpen);
237void pdrawgfxzoom_transpen_raw(bitmap_t *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_t *priority, UINT32 pmask, UINT32 transpen);
238void pdrawgfxzoom_transmask(bitmap_t *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_t *priority, UINT32 pmask, UINT32 transmask);
239void pdrawgfxzoom_transtable(bitmap_t *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_t *priority, UINT32 pmask, const UINT8 *pentable, const pen_t *shadowtable);
240void pdrawgfxzoom_alpha(bitmap_t *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_t *priority, UINT32 pmask, UINT32 transpen, UINT8 alpha);
235void pdrawgfxzoom_opaque(bitmap_t *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_t *priority, UINT32 pmask);
236void pdrawgfxzoom_transpen(bitmap_t *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_t *priority, UINT32 pmask, UINT32 transpen);
237void pdrawgfxzoom_transpen_raw(bitmap_t *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_t *priority, UINT32 pmask, UINT32 transpen);
238void pdrawgfxzoom_transmask(bitmap_t *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_t *priority, UINT32 pmask, UINT32 transmask);
239void pdrawgfxzoom_transtable(bitmap_t *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_t *priority, UINT32 pmask, const UINT8 *pentable, const pen_t *shadowtable);
240void pdrawgfxzoom_alpha(bitmap_t *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_t *priority, UINT32 pmask, UINT32 transpen, UINT8 alpha);
241241
242242
243243
r13798r13799
270270/* ----- bitmap copying ----- */
271271
272272/* copy from one bitmap to another, copying all unclipped pixels */
273void copybitmap(bitmap_t *dest, bitmap_t *src, int flipx, int flipy, INT32 destx, INT32 desty, const rectangle *cliprect);
273void copybitmap(bitmap_t *dest, bitmap_t *src, int flipx, int flipy, INT32 destx, INT32 desty, const rectangle &cliprect);
274274
275275/* copy from one bitmap to another, copying all unclipped pixels except those that match transpen */
276void copybitmap_trans(bitmap_t *dest, bitmap_t *src, int flipx, int flipy, INT32 destx, INT32 desty, const rectangle *cliprect, UINT32 transpen);
276void copybitmap_trans(bitmap_t *dest, bitmap_t *src, int flipx, int flipy, INT32 destx, INT32 desty, const rectangle &cliprect, UINT32 transpen);
277277
278278/*
279279  Copy a bitmap onto another with scroll and wraparound.
r13798r13799
288288*/
289289
290290/* copy from one bitmap to another, copying all unclipped pixels, and applying scrolling to one or more rows/colums */
291void copyscrollbitmap(bitmap_t *dest, bitmap_t *src, UINT32 numrows, const INT32 *rowscroll, UINT32 numcols, const INT32 *colscroll, const rectangle *cliprect);
291void copyscrollbitmap(bitmap_t *dest, bitmap_t *src, UINT32 numrows, const INT32 *rowscroll, UINT32 numcols, const INT32 *colscroll, const rectangle &cliprect);
292292
293293/* copy from one bitmap to another, copying all unclipped pixels except those that match transpen, and applying scrolling to one or more rows/colums */
294void copyscrollbitmap_trans(bitmap_t *dest, bitmap_t *src, UINT32 numrows, const INT32 *rowscroll, UINT32 numcols, const INT32 *colscroll, const rectangle *cliprect, UINT32 transpen);
294void copyscrollbitmap_trans(bitmap_t *dest, bitmap_t *src, UINT32 numrows, const INT32 *rowscroll, UINT32 numcols, const INT32 *colscroll, const rectangle &cliprect, UINT32 transpen);
295295
296296/*
297297    Copy a bitmap applying rotation, zooming, and arbitrary distortion.
r13798r13799
323323*/
324324
325325/* copy from one bitmap to another, with zoom and rotation, copying all unclipped pixels */
326void copyrozbitmap(bitmap_t *dest, const rectangle *cliprect, bitmap_t *src, INT32 startx, INT32 starty, INT32 incxx, INT32 incxy, INT32 incyx, INT32 incyy, int wraparound);
326void copyrozbitmap(bitmap_t *dest, const rectangle &cliprect, bitmap_t *src, INT32 startx, INT32 starty, INT32 incxx, INT32 incxy, INT32 incyx, INT32 incyy, int wraparound);
327327
328328/* copy from one bitmap to another, with zoom and rotation, copying all unclipped pixels whose values do not match transpen */
329void copyrozbitmap_trans(bitmap_t *dest, const rectangle *cliprect, bitmap_t *src, INT32 startx, INT32 starty, INT32 incxx, INT32 incxy, INT32 incyx, INT32 incyy, int wraparound, UINT32 transparent_color);
329void copyrozbitmap_trans(bitmap_t *dest, const rectangle &cliprect, bitmap_t *src, INT32 startx, INT32 starty, INT32 incxx, INT32 incxy, INT32 incyx, INT32 incyy, int wraparound, UINT32 transparent_color);
330330
331331
332332
src/emu/drawgfxm.h
r13798r13799
356356    Assumed input parameters or local variables:
357357
358358        bitmap_t *dest - the bitmap to render to
359        const rectangle *cliprect - a clipping rectangle (assumed to be clipped to the size of 'dest')
359        const rectangle &cliprect - a clipping rectangle (assumed to be clipped to the size of 'dest')
360360        const gfx_element *gfx - pointer to the gfx_element to render
361361        UINT32 code - index of the entry within gfx_element
362362        UINT32 color - index of the color within gfx_element
r13798r13799
381381      assert(dest != NULL);                                             \
382382      assert(gfx != NULL);                                             \
383383      assert(!PRIORITY_VALID(PRIORITY_TYPE) || priority != NULL);                  \
384      assert(cliprect == NULL || cliprect->min_x >= 0);                        \
385      assert(cliprect == NULL || cliprect->max_x < dest->width());               \
386      assert(cliprect == NULL || cliprect->min_y >= 0);                        \
387      assert(cliprect == NULL || cliprect->max_y < dest->height());               \
384      assert(cliprect.min_x >= 0);                                       \
385      assert(cliprect.max_x < dest->width());                                 \
386      assert(cliprect.min_y >= 0);                                       \
387      assert(cliprect.max_y < dest->height());                              \
388388                                                                  \
389      /* NULL clip means use the full bitmap */                              \
390      if (cliprect == NULL)                                             \
391         cliprect = &dest->cliprect();                                    \
392                                                                  \
393389      /* ignore empty/invalid cliprects */                                 \
394      if (cliprect->empty())                                             \
390      if (cliprect.empty())                                             \
395391         break;                                                      \
396392                                                                  \
397393      /* compute final pixel in X and exit if we are entirely clipped */            \
398394      destendx = destx + gfx->width - 1;                                    \
399      if (destx > cliprect->max_x || destendx < cliprect->min_x)                  \
395      if (destx > cliprect.max_x || destendx < cliprect.min_x)                  \
400396         break;                                                      \
401397                                                                  \
402398      /* apply left clip */                                             \
403399      srcx = 0;                                                      \
404      if (destx < cliprect->min_x)                                       \
400      if (destx < cliprect.min_x)                                       \
405401      {                                                            \
406         srcx = cliprect->min_x - destx;                                    \
407         destx = cliprect->min_x;                                       \
402         srcx = cliprect.min_x - destx;                                    \
403         destx = cliprect.min_x;                                       \
408404      }                                                            \
409405                                                                  \
410406      /* apply right clip */                                             \
411      if (destendx > cliprect->max_x)                                       \
412         destendx = cliprect->max_x;                                       \
407      if (destendx > cliprect.max_x)                                       \
408         destendx = cliprect.max_x;                                       \
413409                                                                  \
414410      /* compute final pixel in Y and exit if we are entirely clipped */            \
415411      destendy = desty + gfx->height - 1;                                    \
416      if (desty > cliprect->max_y || destendy < cliprect->min_y)                  \
412      if (desty > cliprect.max_y || destendy < cliprect.min_y)                  \
417413         break;                                                      \
418414                                                                  \
419415      /* apply top clip */                                             \
420416      srcy = 0;                                                      \
421      if (desty < cliprect->min_y)                                       \
417      if (desty < cliprect.min_y)                                       \
422418      {                                                            \
423         srcy = cliprect->min_y - desty;                                    \
424         desty = cliprect->min_y;                                       \
419         srcy = cliprect.min_y - desty;                                    \
420         desty = cliprect.min_y;                                       \
425421      }                                                            \
426422                                                                  \
427423      /* apply bottom clip */                                             \
428      if (destendy > cliprect->max_y)                                       \
429         destendy = cliprect->max_y;                                       \
424      if (destendy > cliprect.max_y)                                       \
425         destendy = cliprect.max_y;                                       \
430426                                                                  \
431427      /* apply X flipping */                                             \
432428      if (flipx)                                                      \
r13798r13799
626622    Assumed input parameters or local variables:
627623
628624        bitmap_t *dest - the bitmap to render to
629        const rectangle *cliprect - a clipping rectangle (assumed to be clipped to the size of 'dest')
625        const rectangle &cliprect - a clipping rectangle (assumed to be clipped to the size of 'dest')
630626        const gfx_element *gfx - pointer to the gfx_element to render
631627        UINT32 code - index of the entry within gfx_element
632628        UINT32 color - index of the color within gfx_element
r13798r13799
654650      assert(dest != NULL);                                             \
655651      assert(gfx != NULL);                                             \
656652      assert(!PRIORITY_VALID(PRIORITY_TYPE) || priority != NULL);                  \
657      assert(cliprect == NULL || cliprect->min_x >= 0);                        \
658      assert(cliprect == NULL || cliprect->max_x < dest->width());               \
659      assert(cliprect == NULL || cliprect->min_y >= 0);                        \
660      assert(cliprect == NULL || cliprect->max_y < dest->height());               \
653      assert(cliprect.min_x >= 0);                                       \
654      assert(cliprect.max_x < dest->width());                                 \
655      assert(cliprect.min_y >= 0);                                       \
656      assert(cliprect.max_y < dest->height());                              \
661657                                                                  \
662      /* NULL clip means use the full bitmap */                              \
663      if (cliprect == NULL)                                             \
664         cliprect = &dest->cliprect();                                    \
665                                                                  \
666658      /* ignore empty/invalid cliprects */                                 \
667      if (cliprect->empty())                                             \
659      if (cliprect.empty())                                             \
668660         break;                                                      \
669661                                                                  \
670662      /* compute scaled size */                                          \
r13798r13799
679671                                                                  \
680672      /* compute final pixel in X and exit if we are entirely clipped */            \
681673      destendx = destx + dstwidth - 1;                                    \
682      if (destx > cliprect->max_x || destendx < cliprect->min_x)                  \
674      if (destx > cliprect.max_x || destendx < cliprect.min_x)                  \
683675         break;                                                      \
684676                                                                  \
685677      /* apply left clip */                                             \
686678      srcx = 0;                                                      \
687      if (destx < cliprect->min_x)                                       \
679      if (destx < cliprect.min_x)                                       \
688680      {                                                            \
689         srcx = (cliprect->min_x - destx) * dx;                              \
690         destx = cliprect->min_x;                                       \
681         srcx = (cliprect.min_x - destx) * dx;                              \
682         destx = cliprect.min_x;                                       \
691683      }                                                            \
692684                                                                  \
693685      /* apply right clip */                                             \
694      if (destendx > cliprect->max_x)                                       \
695         destendx = cliprect->max_x;                                       \
686      if (destendx > cliprect.max_x)                                       \
687         destendx = cliprect.max_x;                                       \
696688                                                                  \
697689      /* compute final pixel in Y and exit if we are entirely clipped */            \
698690      destendy = desty + dstheight - 1;                                    \
699      if (desty > cliprect->max_y || destendy < cliprect->min_y)                  \
691      if (desty > cliprect.max_y || destendy < cliprect.min_y)                  \
700692      {                                                            \
701693         g_profiler.stop();                                       \
702694         return;                                                      \
r13798r13799
704696                                                                  \
705697      /* apply top clip */                                             \
706698      srcy = 0;                                                      \
707      if (desty < cliprect->min_y)                                       \
699      if (desty < cliprect.min_y)                                       \
708700      {                                                            \
709         srcy = (cliprect->min_y - desty) * dy;                              \
710         desty = cliprect->min_y;                                       \
701         srcy = (cliprect.min_y - desty) * dy;                              \
702         desty = cliprect.min_y;                                       \
711703      }                                                            \
712704                                                                  \
713705      /* apply bottom clip */                                             \
714      if (destendy > cliprect->max_y)                                       \
715         destendy = cliprect->max_y;                                       \
706      if (destendy > cliprect.max_y)                                       \
707         destendy = cliprect.max_y;                                       \
716708                                                                  \
717709      /* apply X flipping */                                             \
718710      if (flipx)                                                      \
r13798r13799
811803
812804        bitmap_t *dest - the bitmap to copy to
813805        bitmap_t *src - the bitmap to copy from (must be same bpp as dest)
814        const rectangle *cliprect - a clipping rectangle (assumed to be clipped to the size of 'dest')
806        const rectangle &cliprect - a clipping rectangle (assumed to be clipped to the size of 'dest')
815807        int flipx - non-zero means render right-to-left instead of left-to-right
816808        int flipy - non-zero means render bottom-to-top instead of top-to-bottom
817809        INT32 destx - the top-left X coordinate to copy to
r13798r13799
833825      assert(dest != NULL);                                             \
834826      assert(src != NULL);                                             \
835827      assert(!PRIORITY_VALID(PRIORITY_TYPE) || priority != NULL);                  \
836      assert(cliprect == NULL || cliprect->min_x >= 0);                        \
837      assert(cliprect == NULL || cliprect->max_x < dest->width());               \
838      assert(cliprect == NULL || cliprect->min_y >= 0);                        \
839      assert(cliprect == NULL || cliprect->max_y < dest->height());               \
828      assert(cliprect.min_x >= 0);                                       \
829      assert(cliprect.max_x < dest->width());                                 \
830      assert(cliprect.min_y >= 0);                                       \
831      assert(cliprect.max_y < dest->height());                              \
840832                                                                  \
841      /* NULL clip means use the full bitmap */                              \
842      if (cliprect == NULL)                                             \
843         cliprect = &dest->cliprect();                                    \
844                                                                  \
845833      /* ignore empty/invalid cliprects */                                 \
846      if (cliprect->empty())                                             \
834      if (cliprect.empty())                                             \
847835         break;                                                      \
848836                                                                  \
849837      /* standard setup; dx counts bytes in X, dy counts pixels in Y */            \
r13798r13799
852840                                                                  \
853841      /* compute final pixel in X and exit if we are entirely clipped */            \
854842      destendx = destx + src->width() - 1;                                 \
855      if (destx > cliprect->max_x || destendx < cliprect->min_x)                  \
843      if (destx > cliprect.max_x || destendx < cliprect.min_x)                  \
856844         break;                                                      \
857845                                                                  \
858846      /* apply left clip */                                             \
859847      srcx = 0;                                                      \
860      if (destx < cliprect->min_x)                                       \
848      if (destx < cliprect.min_x)                                       \
861849      {                                                            \
862         srcx = cliprect->min_x - destx;                                    \
863         destx = cliprect->min_x;                                       \
850         srcx = cliprect.min_x - destx;                                    \
851         destx = cliprect.min_x;                                       \
864852      }                                                            \
865853                                                                  \
866854      /* apply right clip */                                             \
867      if (destendx > cliprect->max_x)                                       \
868         destendx = cliprect->max_x;                                       \
855      if (destendx > cliprect.max_x)                                       \
856         destendx = cliprect.max_x;                                       \
869857                                                                  \
870858      /* compute final pixel in Y and exit if we are entirely clipped */            \
871859      destendy = desty + src->height() - 1;                                 \
872      if (desty > cliprect->max_y || destendy < cliprect->min_y)                  \
860      if (desty > cliprect.max_y || destendy < cliprect.min_y)                  \
873861         break;                                                      \
874862                                                                  \
875863      /* apply top clip */                                             \
876864      srcy = 0;                                                      \
877      if (desty < cliprect->min_y)                                       \
865      if (desty < cliprect.min_y)                                       \
878866      {                                                            \
879         srcy = cliprect->min_y - desty;                                    \
880         desty = cliprect->min_y;                                       \
867         srcy = cliprect.min_y - desty;                                    \
868         desty = cliprect.min_y;                                       \
881869      }                                                            \
882870                                                                  \
883871      /* apply bottom clip */                                             \
884      if (destendy > cliprect->max_y)                                       \
885         destendy = cliprect->max_y;                                       \
872      if (destendy > cliprect.max_y)                                       \
873         destendy = cliprect.max_y;                                       \
886874                                                                  \
887875      /* apply X flipping */                                             \
888876      if (flipx)                                                      \
r13798r13799
989977
990978        bitmap_t *dest - the bitmap to copy to
991979        bitmap_t *src - the bitmap to copy from (must be same bpp as dest)
992        const rectangle *cliprect - a clipping rectangle (assumed to be clipped to the size of 'dest')
980        const rectangle &cliprect - a clipping rectangle (assumed to be clipped to the size of 'dest')
993981        INT32 destx - the 16.16 source X position at destination pixel (0,0)
994982        INT32 desty - the 16.16 source Y position at destination pixel (0,0)
995983        INT32 incxx - the 16.16 amount to increment in source X for each destination X pixel
r13798r13799
1011999   assert(dest != NULL);                                             \
10121000   assert(src != NULL);                                             \
10131001   assert(!PRIORITY_VALID(PRIORITY_TYPE) || priority != NULL);                  \
1014   assert(cliprect == NULL || cliprect->min_x >= 0);                        \
1015   assert(cliprect == NULL || cliprect->max_x < dest->width());               \
1016   assert(cliprect == NULL || cliprect->min_y >= 0);                        \
1017   assert(cliprect == NULL || cliprect->max_y < dest->height());               \
1002   assert(cliprect.min_x >= 0);                                       \
1003   assert(cliprect.max_x < dest->width());                                 \
1004   assert(cliprect.min_y >= 0);                                       \
1005   assert(cliprect.max_y < dest->height());                              \
10181006   assert(!wraparound || (src->width() & (src->width() - 1)) == 0);            \
10191007   assert(!wraparound || (src->height() & (src->height() - 1)) == 0);            \
10201008                                                               \
1021   /* NULL clip means use the full bitmap */                              \
1022   if (cliprect == NULL)                                             \
1023      cliprect = &dest->cliprect();                                    \
1024                                                               \
10251009   /* ignore empty/invalid cliprects */                                 \
1026   if (cliprect->empty())                                             \
1010   if (cliprect.empty())                                             \
10271011      break;                                                      \
10281012                                                               \
10291013   /* compute fixed-point 16.16 size of the source bitmap */                  \
r13798r13799
10311015   srcfixheight = src->height() << 16;                                    \
10321016                                                               \
10331017   /* advance the starting coordinates to the top-left of the cliprect */         \
1034   startx += cliprect->min_x * incxx + cliprect->min_y * incyx;               \
1035   starty += cliprect->min_x * incxy + cliprect->min_y * incyy;               \
1018   startx += cliprect.min_x * incxx + cliprect.min_y * incyx;               \
1019   starty += cliprect.min_x * incxy + cliprect.min_y * incyy;               \
10361020                                                               \
10371021   /* compute how many blocks of 4 pixels we have */                        \
1038   numblocks = (cliprect->max_x + 1 - cliprect->min_x) / 4;                  \
1039   leftovers = (cliprect->max_x + 1 - cliprect->min_x) - 4 * numblocks;         \
1022   numblocks = (cliprect.max_x + 1 - cliprect.min_x) / 4;                  \
1023   leftovers = (cliprect.max_x + 1 - cliprect.min_x) - 4 * numblocks;         \
10401024                                                               \
10411025   /* if incxy and incyx are 0, then we aren't rotating, just zooming */         \
10421026   if (incxy == 0 && incyx == 0)                                       \
r13798r13799
10451029      if (!wraparound)                                             \
10461030      {                                                         \
10471031         /* iterate over pixels in Y */                                 \
1048         for (cury = cliprect->min_y; cury <= cliprect->max_y; cury++)         \
1032         for (cury = cliprect.min_y; cury <= cliprect.max_y; cury++)         \
10491033         {                                                      \
1050            PRIORITY_TYPE *priptr = PRIORITY_ADDR(priority, PRIORITY_TYPE, cury, cliprect->min_x); \
1051            PIXEL_TYPE *destptr = &dest->pix<PIXEL_TYPE>(cury, cliprect->min_x); \
1034            PRIORITY_TYPE *priptr = PRIORITY_ADDR(priority, PRIORITY_TYPE, cury, cliprect.min_x); \
1035            PIXEL_TYPE *destptr = &dest->pix<PIXEL_TYPE>(cury, cliprect.min_x); \
10521036            const PIXEL_TYPE *srcptr;                                 \
10531037            INT32 srcx = startx;                                    \
10541038            INT32 srcy = starty;                                    \
r13798r13799
11061090         starty &= srcfixheight;                                       \
11071091                                                               \
11081092         /* iterate over pixels in Y */                                 \
1109         for (cury = cliprect->min_y; cury <= cliprect->max_y; cury++)         \
1093         for (cury = cliprect.min_y; cury <= cliprect.max_y; cury++)         \
11101094         {                                                      \
1111            PRIORITY_TYPE *priptr = PRIORITY_ADDR(priority, PRIORITY_TYPE, cury, cliprect->min_x); \
1112            PIXEL_TYPE *destptr = &dest->pix<PIXEL_TYPE>(cury, cliprect->min_x); \
1095            PRIORITY_TYPE *priptr = PRIORITY_ADDR(priority, PRIORITY_TYPE, cury, cliprect.min_x); \
1096            PIXEL_TYPE *destptr = &dest->pix<PIXEL_TYPE>(cury, cliprect.min_x); \
11131097            const PIXEL_TYPE *srcptr = &src->pix<PIXEL_TYPE>(starty >> 16);    \
11141098            INT32 srcx = startx;                                    \
11151099                                                               \
r13798r13799
11531137      if (!wraparound)                                             \
11541138      {                                                         \
11551139         /* iterate over pixels in Y */                                 \
1156         for (cury = cliprect->min_y; cury <= cliprect->max_y; cury++)         \
1140         for (cury = cliprect.min_y; cury <= cliprect.max_y; cury++)         \
11571141         {                                                      \
1158            PRIORITY_TYPE *priptr = PRIORITY_ADDR(priority, PRIORITY_TYPE, cury, cliprect->min_x); \
1159            PIXEL_TYPE *destptr = &dest->pix<PIXEL_TYPE>(cury, cliprect->min_x); \
1142            PRIORITY_TYPE *priptr = PRIORITY_ADDR(priority, PRIORITY_TYPE, cury, cliprect.min_x); \
1143            PIXEL_TYPE *destptr = &dest->pix<PIXEL_TYPE>(cury, cliprect.min_x); \
11601144            const PIXEL_TYPE *srcptr;                                 \
11611145            INT32 srcx = startx;                                    \
11621146            INT32 srcy = starty;                                    \
r13798r13799
12291213         starty &= srcfixheight;                                       \
12301214                                                               \
12311215         /* iterate over pixels in Y */                                 \
1232         for (cury = cliprect->min_y; cury <= cliprect->max_y; cury++)         \
1216         for (cury = cliprect.min_y; cury <= cliprect.max_y; cury++)         \
12331217         {                                                      \
1234            PRIORITY_TYPE *priptr = PRIORITY_ADDR(priority, PRIORITY_TYPE, cury, cliprect->min_x); \
1235            PIXEL_TYPE *destptr = &dest->pix<PIXEL_TYPE>(cury, cliprect->min_x); \
1218            PRIORITY_TYPE *priptr = PRIORITY_ADDR(priority, PRIORITY_TYPE, cury, cliprect.min_x); \
1219            PIXEL_TYPE *destptr = &dest->pix<PIXEL_TYPE>(cury, cliprect.min_x); \
12361220            const PIXEL_TYPE *srcptr;                                 \
12371221            INT32 srcx = startx;                                    \
12381222            INT32 srcy = starty;                                    \
src/mess/audio/ted7360.c
r13798r13799
11981198   }
11991199}
12001200
1201UINT32 ted7360_video_update( device_t *device, bitmap_t *bitmap, const rectangle *cliprect )
1201UINT32 ted7360_video_update( device_t *device, bitmap_t *bitmap, const rectangle &cliprect )
12021202{
12031203   ted7360_state *ted7360 = get_safe_token(device);
12041204
src/mess/audio/ted7360.h
r13798r13799
8686
8787void ted7360_frame_interrupt_gen(device_t *device);
8888void ted7360_raster_interrupt_gen(device_t *device);
89UINT32 ted7360_video_update(device_t *device, bitmap_t *bitmap, const rectangle *cliprect);
89UINT32 ted7360_video_update(device_t *device, bitmap_t *bitmap, const rectangle &cliprect);
9090
9191
9292#endif /* __TED7360_H__ */
src/mess/machine/comx_clm.c
r13798r13799
8787//  mc6845_interface crtc_intf
8888//-------------------------------------------------
8989
90void comx_clm_device::crtc_update_row(mc6845_device *device, bitmap_t *bitmap, const rectangle *cliprect, UINT16 ma, UINT8 ra, UINT16 y, UINT8 x_count, INT8 cursor_x, void *param)
90void comx_clm_device::crtc_update_row(mc6845_device *device, bitmap_t *bitmap, const rectangle &cliprect, UINT16 ma, UINT8 ra, UINT16 y, UINT8 x_count, INT8 cursor_x, void *param)
9191{
9292   for (int column = 0; column < x_count; column++)
9393   {
r13798r13799
294294
295295bool comx_clm_device::comx_screen_update(screen_device &screen, bitmap_t &bitmap, const rectangle &cliprect)
296296{
297   m_crtc->update(&bitmap, &cliprect);
297   m_crtc->update(&bitmap, cliprect);
298298
299299   return false;
300300}
src/mess/machine/comx_clm.h
r13798r13799
3838   virtual machine_config_constructor device_mconfig_additions() const;
3939
4040   // not really public
41   void crtc_update_row(mc6845_device *device, bitmap_t *bitmap, const rectangle *cliprect, UINT16 ma, UINT8 ra, UINT16 y, UINT8 x_count, INT8 cursor_x, void *param);
41   void crtc_update_row(mc6845_device *device, bitmap_t *bitmap, const rectangle &cliprect, UINT16 ma, UINT8 ra, UINT16 y, UINT8 x_count, INT8 cursor_x, void *param);
4242   DECLARE_WRITE_LINE_MEMBER( hsync_w );
4343
4444protected:
src/mess/machine/teleprinter.c
r13798r13799
219219/***************************************************************************
220220    VIDEO HARDWARE
221221***************************************************************************/
222static void generic_teleprinter_update(device_t *device, bitmap_t *bitmap, const rectangle *cliprect)
222static void generic_teleprinter_update(device_t *device, bitmap_t *bitmap, const rectangle &cliprect)
223223{
224224   UINT8 code;
225225   int y, c, x, b;
src/mess/machine/coco12.c
r13798r13799
127127 
128128bool coco12_state::screen_update(screen_device &screen, bitmap_t &bitmap, const rectangle &cliprect)
129129{
130   return m_vdg->update(&bitmap, &cliprect);
130   return m_vdg->update(&bitmap, cliprect);
131131}
132132 
133133 
src/mess/machine/terminal.c
r13798r13799
313313/***************************************************************************
314314    VIDEO HARDWARE
315315***************************************************************************/
316static void generic_terminal_update(device_t *device, bitmap_t *bitmap, const rectangle *cliprect)
316static void generic_terminal_update(device_t *device, bitmap_t *bitmap, const rectangle &cliprect)
317317{
318318   terminal_state *term = get_safe_token(device);
319319   UINT8 options = input_port_read(device, "TERM_CONF");
src/mess/machine/c64_xl80.c
r13798r13799
8282//  mc6845_interface crtc_intf
8383//-------------------------------------------------
8484
85void c64_xl80_device::crtc_update_row(mc6845_device *device, bitmap_t *bitmap, const rectangle *cliprect, UINT16 ma, UINT8 ra, UINT16 y, UINT8 x_count, INT8 cursor_x, void *param)
85void c64_xl80_device::crtc_update_row(mc6845_device *device, bitmap_t *bitmap, const rectangle &cliprect, UINT16 ma, UINT8 ra, UINT16 y, UINT8 x_count, INT8 cursor_x, void *param)
8686{
8787   for (int column = 0; column < x_count; column++)
8888   {
r13798r13799
291291
292292bool c64_xl80_device::c64_screen_update(screen_device &screen, bitmap_t &bitmap, const rectangle &cliprect)
293293{
294   m_crtc->update(&bitmap, &cliprect);
294   m_crtc->update(&bitmap, cliprect);
295295
296296   return false;
297297}
src/mess/machine/c64_xl80.h
r13798r13799
3838   virtual machine_config_constructor device_mconfig_additions() const;
3939
4040   // not really public
41   void crtc_update_row(mc6845_device *device, bitmap_t *bitmap, const rectangle *cliprect, UINT16 ma, UINT8 ra, UINT16 y, UINT8 x_count, INT8 cursor_x, void *param);
41   void crtc_update_row(mc6845_device *device, bitmap_t *bitmap, const rectangle &cliprect, UINT16 ma, UINT8 ra, UINT16 y, UINT8 x_count, INT8 cursor_x, void *param);
4242
4343protected:
4444   // device-level overrides
src/mess/machine/z80ne.c
r13798r13799
639639bool z80ne_state::screen_update(screen_device &screen, bitmap_t &bitmap, const rectangle &cliprect)
640640{
641641   if (m_vdg != NULL)
642      return m_vdg->update(&bitmap, &cliprect);
642      return m_vdg->update(&bitmap, cliprect);
643643   else
644644      return 0;
645645}
src/mess/machine/s3c44b0.c
r13798r13799
294294   // do nothing
295295}
296296
297static UINT32 s3c44b0_video_update( device_t *device, screen_device &screen, bitmap_t *bitmap, const rectangle *cliprect)
297static UINT32 s3c44b0_video_update( device_t *device, screen_device &screen, bitmap_t *bitmap, const rectangle &cliprect)
298298{
299299   s3c44b0_lcd_t *lcd = &(get_token( device)->lcd);
300300   if (lcd->regs.lcdcon1 & (1 << 0))
src/mess/machine/coco3.c
r13798r13799
153153   if (!strcmp(screen.tag(), COMPOSITE_SCREEN_TAG))
154154   {
155155      /* composite screen */
156      result = m_gime->update_composite(&bitmap, &cliprect);
156      result = m_gime->update_composite(&bitmap, cliprect);
157157   }
158158   else if (!strcmp(screen.tag(), RGB_SCREEN_TAG))
159159   {
160160      /* rgb screen */
161      result = m_gime->update_rgb(&bitmap, &cliprect);
161      result = m_gime->update_rgb(&bitmap, cliprect);
162162   }
163163   else
164164   {
src/mess/machine/ecb_grip.c
r13798r13799
219219//  mc6845_interface crtc_intf
220220//-------------------------------------------------
221221
222void grip_device::crtc_update_row(mc6845_device *device, bitmap_t *bitmap, const rectangle *cliprect, UINT16 ma, UINT8 ra, UINT16 y, UINT8 x_count, INT8 cursor_x, void *param)
222void grip_device::crtc_update_row(mc6845_device *device, bitmap_t *bitmap, const rectangle &cliprect, UINT16 ma, UINT8 ra, UINT16 y, UINT8 x_count, INT8 cursor_x, void *param)
223223{
224224   int column, bit;
225225
r13798r13799
10231023
10241024bool grip_device::ecbbus_screen_update(screen_device &screen, bitmap_t &bitmap, const rectangle &cliprect)
10251025{
1026   m_crtc->update(&bitmap, &cliprect);
1026   m_crtc->update(&bitmap, cliprect);
10271027
10281028   return false;
10291029}
src/mess/machine/ecb_grip.h
r13798r13799
5252   DECLARE_READ8_MEMBER( sti_gpio_r );
5353   DECLARE_WRITE_LINE_MEMBER( speaker_w );
5454
55   void crtc_update_row(mc6845_device *device, bitmap_t *bitmap, const rectangle *cliprect, UINT16 ma, UINT8 ra, UINT16 y, UINT8 x_count, INT8 cursor_x, void *param);
55   void crtc_update_row(mc6845_device *device, bitmap_t *bitmap, const rectangle &cliprect, UINT16 ma, UINT8 ra, UINT16 y, UINT8 x_count, INT8 cursor_x, void *param);
5656
5757protected:
5858   // device-level overrides
src/mess/video/t6a04.c
r13798r13799
118118//  device interface
119119//**************************************************************************
120120
121int t6a04_device::video_update(bitmap_t *bitmap, const rectangle *cliprect)
121int t6a04_device::video_update(bitmap_t *bitmap, const rectangle &cliprect)
122122{
123123   UINT8 ypages = width>>3;
124124   UINT8 last_line = m_zpos + height;
r13798r13799
139139   }
140140   else
141141   {
142      bitmap->fill(0, *cliprect);
142      bitmap->fill(0, cliprect);
143143   }
144144
145145   return 0;
src/mess/video/t6a04.h
r13798r13799
4040   DECLARE_WRITE8_MEMBER(data_write);
4141   DECLARE_READ8_MEMBER(data_read);
4242
43   int video_update(bitmap_t *bitmap, const rectangle *cliprect);
43   int video_update(bitmap_t *bitmap, const rectangle &cliprect);
4444
4545protected:
4646   // device-level overrides
src/mess/video/pdp1.c
r13798r13799
229229/* write a single char on screen */
230230static void pdp1_draw_char(running_machine &machine, bitmap_t *bitmap, char character, int x, int y, int color)
231231{
232   drawgfx_transpen(bitmap, NULL, machine.gfx[0], character-32, color, 0, 0,
232   drawgfx_transpen(bitmap, bitmap->cliprect(), machine.gfx[0], character-32, color, 0, 0,
233233            x+1, y, 0);
234234}
235235
src/mess/video/pc1401.c
r13798r13799
138138   int x, y, i, j;
139139   int color[2];
140140
141   bitmap->fill(11, *cliprect);
141   bitmap->fill(11, cliprect);
142142
143143#if 0
144144   /* HJB: we cannot initialize array with values from other arrays, thus... */
r13798r13799
154154      for (x=RIGHT,y=DOWN,i=0; i<0x28;x+=2)
155155      {
156156         for (j=0; j<5;j++,i++,x+=2)
157         drawgfx_opaque(bitmap, 0, screen.machine().gfx[0], state->m_reg[i],CONTRAST,0,0,x,y);
157         drawgfx_opaque(bitmap, cliprect, screen.machine().gfx[0], state->m_reg[i],CONTRAST,0,0,x,y);
158158      }
159159      for (i=0x67; i>=0x40;x+=2)
160160      {
161161         for (j=0; j<5;j++,i--,x+=2)
162         drawgfx_opaque(bitmap, 0, screen.machine().gfx[0], state->m_reg[i],CONTRAST,0,0,x,y);
162         drawgfx_opaque(bitmap, cliprect, screen.machine().gfx[0], state->m_reg[i],CONTRAST,0,0,x,y);
163163      }
164164   }
165165
src/mess/video/apple2gs.c
r13798r13799
3535   UINT16 last_pixel = 0, pixel;
3636   int beamy;
3737
38   beamy = cliprect->min_y;
38   beamy = cliprect.min_y;
3939
4040   if (state->m_newvideo & 0x80)
4141   {
r13798r13799
133133         new_cliprect.min_y = 0;
134134         new_cliprect.max_x = 559;
135135         new_cliprect.max_y = 191;
136         SCREEN_UPDATE_NAME(apple2)(screen, state->m_legacy_gfx, &new_cliprect);
136         SCREEN_UPDATE_NAME(apple2)(screen, state->m_legacy_gfx, new_cliprect);
137137      }
138138
139139      if ((beamy < (BORDER_TOP+4)) || (beamy >= (192+4+BORDER_TOP)))
src/mess/video/pc8401a.c
r13798r13799
1515
1616bool pc8401a_state::screen_update(screen_device &screen, bitmap_t &bitmap, const rectangle &cliprect)
1717{
18   m_lcdc->update_screen(&bitmap, &cliprect);
18   m_lcdc->update_screen(&bitmap, cliprect);
1919
2020   return 0;
2121}
r13798r13799
2828
2929bool pc8500_state::screen_update(screen_device &screen, bitmap_t &bitmap, const rectangle &cliprect)
3030{
31   m_lcdc->update_screen(&bitmap, &cliprect);
31   m_lcdc->update_screen(&bitmap, cliprect);
3232
3333   /*
3434    if (strcmp(screen.tag(), SCREEN_TAG) == 0)
3535    {
36        sed1330_update(m_lcdc, &bitmap, &cliprect);
36        sed1330_update(m_lcdc, &bitmap, cliprect);
3737    }
3838    else
3939    {
40        m_crtc->update(&bitmap, &cliprect);
40        m_crtc->update(&bitmap, cliprect);
4141    }
4242    */
4343
src/mess/video/911_vdt.c
r13798r13799
494494/*
495495    Video refresh
496496*/
497void vdt911_refresh(device_t *device, bitmap_t *bitmap, int x, int y)
497void vdt911_refresh(device_t *device, bitmap_t *bitmap, const rectangle &cliprect, int x, int y)
498498{
499499   vdt_t *vdt = get_safe_token(device);
500500   const gfx_element *gfx = device->machine().gfx[vdt->model];
r13798r13799
538538
539539            address++;
540540
541            drawgfx_opaque(bitmap, NULL, gfx, cur_char, color, 0, 0,
541            drawgfx_opaque(bitmap, cliprect, gfx, cur_char, color, 0, 0,
542542                  x+j*7, y+i*10);
543543         }
544544      }
src/mess/video/911_vdt.h
r13798r13799
5353 READ8_DEVICE_HANDLER(vdt911_cru_r);
5454WRITE8_DEVICE_HANDLER(vdt911_cru_w);
5555
56void vdt911_refresh(device_t *device, bitmap_t *bitmap, int x, int y);
56void vdt911_refresh(device_t *device, bitmap_t *bitmap, const rectangle &cliprect, int x, int y);
5757
5858void vdt911_keyboard(device_t *device);
5959
src/mess/video/ac1.c
r13798r13799
3636      for(x = 0; x < 64; x++ )
3737      {
3838         int code = space->read_byte(AC1_VIDEO_MEMORY + x + y*64);
39         drawgfx_opaque(bitmap, NULL, screen.machine().gfx[0],  code , 0, 0,0, 63*6-x*6,15*8-y*8);
39         drawgfx_opaque(bitmap, cliprect, screen.machine().gfx[0],  code , 0, 0,0, 63*6-x*6,15*8-y*8);
4040      }
4141   }
4242   return 0;
r13798r13799
5252      for(x = 0; x < 64; x++ )
5353      {
5454         int code = space->read_byte(AC1_VIDEO_MEMORY + x + y*64);
55         drawgfx_opaque(bitmap, NULL, screen.machine().gfx[0],  code , 0, 0,0, 63*6-x*6,31*8-y*8);
55         drawgfx_opaque(bitmap, cliprect, screen.machine().gfx[0],  code , 0, 0,0, 63*6-x*6,31*8-y*8);
5656      }
5757   }
5858   return 0;
src/mess/video/pc1350.c
r13798r13799
136136   int color[4];
137137   running_machine &machine = screen.machine();
138138
139   bitmap->fill(11, *cliprect);
139   bitmap->fill(11, cliprect);
140140
141141   /* HJB: we cannot initialize array with values from other arrays, thus... */
142142   color[0] = pocketc_colortable[PC1350_CONTRAST][0];
src/mess/video/pc1512.c
r13798r13799
403403   return ((input_port_read(machine(), "LK") >> 5) & 0x03) << 11;
404404}
405405
406void pc1512_state::draw_alpha(mc6845_device *device, bitmap_t *bitmap, const rectangle *cliprect, UINT16 ma, UINT8 ra, UINT16 y, UINT8 x_count, INT8 cursor_x, void *param)
406void pc1512_state::draw_alpha(mc6845_device *device, bitmap_t *bitmap, const rectangle &cliprect, UINT16 ma, UINT8 ra, UINT16 y, UINT8 x_count, INT8 cursor_x, void *param)
407407{
408408   offs_t char_rom_offset = get_char_rom_offset();
409409   UINT16 *p = &bitmap->pix16(y + VFP_HIRES, HFP_HIRES);
r13798r13799
472472   return color;
473473};
474474
475void pc1512_state::draw_graphics_1(mc6845_device *device, bitmap_t *bitmap, const rectangle *cliprect, UINT16 ma, UINT8 ra, UINT16 y, UINT8 x_count, INT8 cursor_x, void *param)
475void pc1512_state::draw_graphics_1(mc6845_device *device, bitmap_t *bitmap, const rectangle &cliprect, UINT16 ma, UINT8 ra, UINT16 y, UINT8 x_count, INT8 cursor_x, void *param)
476476{
477477   if (y > 199) return;
478478
r13798r13799
492492   }
493493}
494494
495void pc1512_state::draw_graphics_2(mc6845_device *device, bitmap_t *bitmap, const rectangle *cliprect, UINT16 ma, UINT8 ra, UINT16 y, UINT8 x_count, INT8 cursor_x, void *param)
495void pc1512_state::draw_graphics_2(mc6845_device *device, bitmap_t *bitmap, const rectangle &cliprect, UINT16 ma, UINT8 ra, UINT16 y, UINT8 x_count, INT8 cursor_x, void *param)
496496{
497497   if (y > 199) return;
498498
r13798r13799
612612         break;
613613      }
614614
615      m_vdu->update(&bitmap, &cliprect);
615      m_vdu->update(&bitmap, cliprect);
616616   }
617617   else
618618   {
src/mess/video/newport.c
r13798r13799
214214{
215215   int y;
216216
217   bitmap->fill(get_black_pen(screen.machine()), *cliprect );
217   bitmap->fill(get_black_pen(screen.machine()), cliprect );
218218
219219   /* loop over rows and copy to the destination */
220   for( y = cliprect->min_y; y <= cliprect->max_y; y++ )
220   for( y = cliprect.min_y; y <= cliprect.max_y; y++ )
221221   {
222222      UINT32 *src = &pNVID->base[1344 * y];
223      UINT16 *dest = &bitmap->pix16(y, cliprect->min_x);
223      UINT16 *dest = &bitmap->pix16(y, cliprect.min_x);
224224      int x;
225225
226226      /* loop over columns */
227      for( x = cliprect->min_x; x < cliprect->max_x; x++ )
227      for( x = cliprect.min_x; x < cliprect.max_x; x++ )
228228      {
229229         UINT32 nPix = *src++;
230230         *dest++ = ( ( nPix & 0x00f80000 ) >> 9 ) | ( ( nPix & 0x0000f800 ) >> 6 ) | ( ( nPix & 0x000000f8 ) >> 3 );
src/mess/video/mz700.c
r13798r13799
5353   int offs;
5454   mz_state *mz = screen.machine().driver_data<mz_state>();
5555
56   bitmap->fill(get_black_pen(screen.machine()), *cliprect);
56   bitmap->fill(get_black_pen(screen.machine()), cliprect);
5757
5858   for(offs = 0; offs < 40*25; offs++)
5959   {
r13798r13799
8888   UINT8 *videoram = state->m_videoram;
8989   mz_state *mz = screen.machine().driver_data<mz_state>();
9090
91   bitmap->fill(get_black_pen(screen.machine()), *cliprect);
91   bitmap->fill(get_black_pen(screen.machine()), cliprect);
9292
9393   if (mz->m_mz700_mode)
9494      return SCREEN_UPDATE_CALL(mz700);
src/mess/video/abc800.c
r13798r13799
5858//  screen update
5959//-------------------------------------------------
6060
61void abc800c_state::hr_update(bitmap_t *bitmap, const rectangle *cliprect)
61void abc800c_state::hr_update(bitmap_t *bitmap, const rectangle &cliprect)
6262{
6363   UINT16 addr = 0;
6464   int sx, y, dot;
6565
66   for (y = m_hrs; y < MIN(cliprect->max_y + 1, m_hrs + 240); y++)
66   for (y = m_hrs; y < MIN(cliprect.max_y + 1, m_hrs + 240); y++)
6767   {
6868      int x = 0;
6969
r13798r13799
111111   bitmap.fill(get_black_pen(machine()), cliprect);
112112
113113   // draw HR graphics
114   hr_update(&bitmap, &cliprect);
114   hr_update(&bitmap, cliprect);
115115
116116   if (!BIT(m_fgctl, 7))
117117   {
118118      // draw text
119      //saa5050_update(m_trom, &bitmap, &cliprect);
119      //saa5050_update(m_trom, &bitmap, cliprect);
120120   }
121121
122122   return 0;
r13798r13799
179179//  screen update
180180//-------------------------------------------------
181181
182void abc800m_state::hr_update(bitmap_t *bitmap, const rectangle *cliprect)
182void abc800m_state::hr_update(bitmap_t *bitmap, const rectangle &cliprect)
183183{
184184   UINT16 addr = 0;
185185   int sx, y, dot;
186186
187   for (y = m_hrs + VERTICAL_PORCH_HACK; y < MIN(cliprect->max_y + 1, m_hrs + VERTICAL_PORCH_HACK + 240); y++)
187   for (y = m_hrs + VERTICAL_PORCH_HACK; y < MIN(cliprect.max_y + 1, m_hrs + VERTICAL_PORCH_HACK + 240); y++)
188188   {
189189      int x = HORIZONTAL_PORCH_HACK;
190190
r13798r13799
283283   bitmap.fill(get_black_pen(machine()), cliprect);
284284
285285   // draw HR graphics
286   hr_update(&bitmap, &cliprect);
286   hr_update(&bitmap, cliprect);
287287
288288   if (!BIT(m_fgctl, 7))
289289   {
290290      // draw text
291      m_crtc->update(&bitmap, &cliprect);
291      m_crtc->update(&bitmap, cliprect);
292292   }
293293
294294   return 0;
src/mess/video/arcadia.c
r13798r13799
446446            if (y+1<bitmap->height()) {
447447                state->m_bg[y+1][x>>3]|=b>>(x&7);
448448                state->m_bg[y+1][(x>>3)+1]|=b<<(8-(x&7));
449                drawgfx_opaque(bitmap, 0, machine.gfx[0], b,colour,
449                drawgfx_opaque(bitmap, bitmap->cliprect(), machine.gfx[0], b,colour,
450450                        0,0,x,y);
451                drawgfx_opaque(bitmap, 0, machine.gfx[0], b,colour,
451                drawgfx_opaque(bitmap, bitmap->cliprect(), machine.gfx[0], b,colour,
452452                        0,0,x,y+1);
453453            }
454454      }
r13798r13799
461461            state->m_bg[y][x>>3]|=b>>(x&7);
462462       state->m_bg[y][(x>>3)+1]|=b<<(8-(x&7));
463463
464       drawgfx_opaque(bitmap, 0, machine.gfx[0], b,colour,
464       drawgfx_opaque(bitmap, bitmap->cliprect(), machine.gfx[0], b,colour,
465465          0,0,x,y);
466466      }
467467    }
src/mess/video/aquarius.c
r13798r13799
100100SCREEN_UPDATE( aquarius )
101101{
102102   aquarius_state *state = screen.machine().driver_data<aquarius_state>();
103   tilemap_draw(bitmap, NULL, state->m_tilemap, 0, 0);
103   tilemap_draw(bitmap, cliprect, state->m_tilemap, 0, 0);
104104
105105   return 0;
106106}
src/mess/video/cgenie.c
r13798r13799
240240}
241241
242242
243static void cgenie_refresh_monitor(running_machine &machine, bitmap_t * bitmap, const rectangle *cliprect)
243static void cgenie_refresh_monitor(running_machine &machine, bitmap_t * bitmap, const rectangle &cliprect)
244244{
245245   cgenie_state *state = machine.driver_data<cgenie_state>();
246246   UINT8 *videoram = state->m_videoram;
247247   int i, address, offset, cursor, size, code, x, y;
248248    rectangle r;
249249
250   bitmap->fill(get_black_pen(machine), *cliprect);
250   bitmap->fill(get_black_pen(machine), cliprect);
251251
252252   if(state->m_crt.vertical_displayed || state->m_crt.horizontal_displayed)
253253   {
r13798r13799
274274         {
275275            /* get graphics code */
276276            code = videoram[i];
277            drawgfx_opaque(bitmap, &r, machine.gfx[1], code, 0,
277            drawgfx_opaque(bitmap, r, machine.gfx[1], code, 0,
278278               0, 0, r.min_x, r.min_y);
279279         }
280280         else
r13798r13799
284284
285285            /* translate defined character sets */
286286            code += state->m_font_offset[(code >> 6) & 3];
287            drawgfx_opaque(bitmap, &r, machine.gfx[0], code, state->m_colorram[i&0x3ff],
287            drawgfx_opaque(bitmap, r, machine.gfx[0], code, state->m_colorram[i&0x3ff],
288288               0, 0, r.min_x, r.min_y);
289289         }
290290
r13798r13799
313313            rc.max_x = r.max_x;
314314            rc.min_y = r.min_y + (state->m_crt.cursor_top & 15);
315315            rc.max_y = r.min_y + (state->m_crt.cursor_bottom & 15);
316            drawgfx_opaque(bitmap, &rc, machine.gfx[0], 0x7f, state->m_colorram[i&0x3ff],
316            drawgfx_opaque(bitmap, rc, machine.gfx[0], 0x7f, state->m_colorram[i&0x3ff],
317317               0, 0, rc.min_x, rc.min_y);
318318         }
319319      }
320320   }
321321}
322322
323static void cgenie_refresh_tv_set(running_machine &machine, bitmap_t * bitmap, const rectangle *cliprect)
323static void cgenie_refresh_tv_set(running_machine &machine, bitmap_t * bitmap, const rectangle &cliprect)
324324{
325325   cgenie_state *state = machine.driver_data<cgenie_state>();
326326   UINT8 *videoram = state->m_videoram;
327327   int i, address, offset, cursor, size, code, x, y;
328328   rectangle r;
329329
330   machine.generic.tmpbitmap->fill(get_black_pen(machine), *cliprect);
331   state->m_dlybitmap->fill(get_black_pen(machine), *cliprect);
330   machine.generic.tmpbitmap->fill(get_black_pen(machine), cliprect);
331   state->m_dlybitmap->fill(get_black_pen(machine), cliprect);
332332
333333   if(state->m_crt.vertical_displayed || state->m_crt.horizontal_displayed)
334334   {
r13798r13799
355355         {
356356            /* get graphics code */
357357            code = videoram[i];
358            drawgfx_opaque(machine.generic.tmpbitmap, &r, machine.gfx[1], code, 1,
358            drawgfx_opaque(machine.generic.tmpbitmap, r, machine.gfx[1], code, 1,
359359               0, 0, r.min_x, r.min_y);
360            drawgfx_opaque(state->m_dlybitmap, &r, machine.gfx[1], code, 2,
360            drawgfx_opaque(state->m_dlybitmap, r, machine.gfx[1], code, 2,
361361               0, 0, r.min_x, r.min_y);
362362         }
363363         else
r13798r13799
367367
368368            /* translate defined character sets */
369369            code += state->m_font_offset[(code >> 6) & 3];
370            drawgfx_opaque(machine.generic.tmpbitmap, &r, machine.gfx[0], code, state->m_colorram[i&0x3ff] + 16,
370            drawgfx_opaque(machine.generic.tmpbitmap, r, machine.gfx[0], code, state->m_colorram[i&0x3ff] + 16,
371371               0, 0, r.min_x, r.min_y);
372            drawgfx_opaque(state->m_dlybitmap, &r, machine.gfx[0], code, state->m_colorram[i&0x3ff] + 32,
372            drawgfx_opaque(state->m_dlybitmap, r, machine.gfx[0], code, state->m_colorram[i&0x3ff] + 32,
373373               0, 0, r.min_x, r.min_y);
374374         }
375375
r13798r13799
399399            rc.min_y = r.min_y + (state->m_crt.cursor_top & 15);
400400            rc.max_y = r.min_y + (state->m_crt.cursor_bottom & 15);
401401
402            drawgfx_opaque(machine.generic.tmpbitmap, &rc, machine.gfx[0], 0x7f, state->m_colorram[i&0x3ff] + 16,
402            drawgfx_opaque(machine.generic.tmpbitmap, rc, machine.gfx[0], 0x7f, state->m_colorram[i&0x3ff] + 16,
403403               0, 0, rc.min_x, rc.min_y);
404            drawgfx_opaque(state->m_dlybitmap, &rc, machine.gfx[0], 0x7f, state->m_colorram[i&0x3ff] + 32,
404            drawgfx_opaque(state->m_dlybitmap, rc, machine.gfx[0], 0x7f, state->m_colorram[i&0x3ff] + 32,
405405               0, 0, rc.min_x, rc.min_y);
406406         }
407407      }
src/mess/video/abc80.c
r13798r13799
7575//  update_screen -
7676//-------------------------------------------------
7777
78void abc80_state::update_screen(bitmap_t *bitmap, const rectangle *cliprect)
78void abc80_state::update_screen(bitmap_t *bitmap, const rectangle &cliprect)
7979{
8080   int c = 0;
8181   int r = 0;
r13798r13799
222222
223223bool abc80_state::screen_update(screen_device &screen, bitmap_t &bitmap, const rectangle &cliprect)
224224{
225   update_screen(&bitmap, &cliprect);
225   update_screen(&bitmap, cliprect);
226226
227227   return 0;
228228}
src/mess/video/x68k.c
r13798r13799
996996         sx += state->m_sprite_shift;
997997
998998         if(state->m_crtc.interlace != 0)
999            drawgfxzoom_transpen(bitmap,&cliprect,machine.gfx[1],code,colour+0x10,xflip,yflip,state->m_crtc.hbegin+sx,state->m_crtc.vbegin+(sy*2),0x10000,0x20000,0x00);
999            drawgfxzoom_transpen(bitmap,cliprect,machine.gfx[1],code,colour+0x10,xflip,yflip,state->m_crtc.hbegin+sx,state->m_crtc.vbegin+(sy*2),0x10000,0x20000,0x00);
10001000         else
1001            drawgfx_transpen(bitmap,&cliprect,machine.gfx[1],code,colour+0x10,xflip,yflip,state->m_crtc.hbegin+sx,state->m_crtc.vbegin+sy,0x00);
1001            drawgfx_transpen(bitmap,cliprect,machine.gfx[1],code,colour+0x10,xflip,yflip,state->m_crtc.hbegin+sx,state->m_crtc.vbegin+sy,0x00);
10021002      }
10031003   }
10041004}
r13798r13799
11371137   }
11381138//  rect.max_x=state->m_crtc.width;
11391139//  rect.max_y=state->m_crtc.height;
1140   bitmap->fill(0, *cliprect);
1140   bitmap->fill(0, cliprect);
11411141
11421142   if(state->m_sysport.contrast == 0)  // if monitor contrast is 0, then don't bother displaying anything
11431143      return 0;
r13798r13799
11491149   rect.max_x=state->m_crtc.hend;
11501150   rect.max_y=state->m_crtc.vend;
11511151
1152   if(rect.min_y < cliprect->min_y)
1153      rect.min_y = cliprect->min_y;
1154   if(rect.max_y > cliprect->max_y)
1155      rect.max_y = cliprect->max_y;
1152   if(rect.min_y < cliprect.min_y)
1153      rect.min_y = cliprect.min_y;
1154   if(rect.max_y > cliprect.max_y)
1155      rect.max_y = cliprect.max_y;
11561156
11571157   // update tiles
11581158   //rom = screen.machine().region("user1")->base();
r13798r13799
11861186            {
11871187               tilemap_set_scrollx(x68k_bg0,0,(state->m_spritereg[0x402] - state->m_crtc.hbegin) & 0x3ff);
11881188               tilemap_set_scrolly(x68k_bg0,0,(state->m_spritereg[0x403] - state->m_crtc.vbegin) & 0x3ff);
1189               tilemap_draw(bitmap,&rect,x68k_bg0,0,0);
1189               tilemap_draw(bitmap,rect,x68k_bg0,0,0);
11901190            }
11911191            else
11921192            {
11931193               tilemap_set_scrollx(x68k_bg1,0,(state->m_spritereg[0x402] - state->m_crtc.hbegin) & 0x3ff);
11941194               tilemap_set_scrolly(x68k_bg1,0,(state->m_spritereg[0x403] - state->m_crtc.vbegin) & 0x3ff);
1195               tilemap_draw(bitmap,&rect,x68k_bg1,0,0);
1195               tilemap_draw(bitmap,rect,x68k_bg1,0,0);
11961196            }
11971197         }
11981198         x68k_draw_sprites(screen.machine(),bitmap,2,rect);
r13798r13799
12021202            {
12031203               tilemap_set_scrollx(x68k_bg0,0,(state->m_spritereg[0x400] - state->m_crtc.hbegin) & 0x3ff);
12041204               tilemap_set_scrolly(x68k_bg0,0,(state->m_spritereg[0x401] - state->m_crtc.vbegin) & 0x3ff);
1205               tilemap_draw(bitmap,&rect,x68k_bg0,0,0);
1205               tilemap_draw(bitmap,rect,x68k_bg0,0,0);
12061206            }
12071207            else
12081208            {
12091209               tilemap_set_scrollx(x68k_bg1,0,(state->m_spritereg[0x400] - state->m_crtc.hbegin) & 0x3ff);
12101210               tilemap_set_scrolly(x68k_bg1,0,(state->m_spritereg[0x401] - state->m_crtc.vbegin) & 0x3ff);
1211               tilemap_draw(bitmap,&rect,x68k_bg1,0,0);
1211               tilemap_draw(bitmap,rect,x68k_bg1,0,0);
12121212            }
12131213         }
12141214         x68k_draw_sprites(screen.machine(),bitmap,3,rect);
src/mess/video/kramermc.c
r13798r13799
3737      for(x = 0; x < 64; x++ )
3838      {
3939         int code = space->read_byte(KRAMERMC_VIDEO_MEMORY + x + y*64);
40         drawgfx_opaque(bitmap, NULL, screen.machine().gfx[0],  code , 0, 0,0, x*8,y*8);
40         drawgfx_opaque(bitmap, cliprect, screen.machine().gfx[0],  code , 0, 0,0, x*8,y*8);
4141      }
4242   }
4343   return 0;
src/mess/video/crtc_ega.c
r13798r13799
650650}
651651
652652
653void crtc_ega_update(device_t *device, bitmap_t *bitmap, const rectangle *cliprect)
653void crtc_ega_update(device_t *device, bitmap_t *bitmap, const rectangle &cliprect)
654654{
655655   crtc_ega_t *crtc_ega = get_safe_token(device);
656656   assert(bitmap != NULL);
657   assert(cliprect != NULL);
658657
659658   if (crtc_ega->has_valid_parameters)
660659   {
r13798r13799
669668      if (crtc_ega->intf->begin_update != NULL)
670669         param = crtc_ega->intf->begin_update(device, bitmap, cliprect);
671670
672      if (cliprect->min_y == 0)
671      if (cliprect.min_y == 0)
673672      {
674673         /* read the start address at the beginning of the frame */
675674         crtc_ega->current_disp_addr = crtc_ega->disp_start_addr;
r13798r13799
679678      }
680679
681680      /* for each row in the visible region */
682      for (y = cliprect->min_y; y <= cliprect->max_y; y++)
681      for (y = cliprect.min_y; y <= cliprect.max_y; y++)
683682      {
684683         /* compute the current raster line */
685684         UINT8 ra = y % (crtc_ega->max_ras_addr + 1);
src/mess/video/tx0.c
r13798r13799
205205/* write a single char on screen */
206206static void tx0_draw_char(running_machine &machine, bitmap_t *bitmap, char character, int x, int y, int color)
207207{
208   drawgfx_transpen(bitmap, NULL, machine.gfx[0], character-32, color, 0, 0,
208   drawgfx_transpen(bitmap, bitmap->cliprect(), machine.gfx[0], character-32, color, 0, 0,
209209            x+1, y, 0);
210210}
211211
src/mess/video/crtc_ega.h
r13798r13799
1515   MCFG_DEVICE_CONFIG(_intrf)
1616
1717/* callback definitions */
18typedef void * (*crtc_ega_begin_update_func)(device_t *device, bitmap_t *bitmap, const rectangle *cliprect);
19#define CRTC_EGA_BEGIN_UPDATE(name)   void *name(device_t *device, bitmap_t *bitmap, const rectangle *cliprect)
18typedef void * (*crtc_ega_begin_update_func)(device_t *device, bitmap_t *bitmap, const rectangle &cliprect);
19#define CRTC_EGA_BEGIN_UPDATE(name)   void *name(device_t *device, bitmap_t *bitmap, const rectangle &cliprect)
2020
2121typedef void (*crtc_ega_update_row_func)(device_t *device, bitmap_t *bitmap,
22                              const rectangle *cliprect, UINT16 ma, UINT8 ra,
22                              const rectangle &cliprect, UINT16 ma, UINT8 ra,
2323                              UINT16 y, UINT8 x_count, INT8 cursor_x, void *param);
2424#define CRTC_EGA_UPDATE_ROW(name)      void name(device_t *device, bitmap_t *bitmap,   \
25                                   const rectangle *cliprect, UINT16 ma, UINT8 ra,               \
25                                   const rectangle &cliprect, UINT16 ma, UINT8 ra,               \
2626                                   UINT16 y, UINT8 x_count, INT8 cursor_x, void *param)
2727
28typedef void (*crtc_ega_end_update_func)(device_t *device, bitmap_t *bitmap, const rectangle *cliprect, void *param);
29#define CRTC_EGA_END_UPDATE(name)      void name(device_t *device, bitmap_t *bitmap, const rectangle *cliprect, void *param)
28typedef void (*crtc_ega_end_update_func)(device_t *device, bitmap_t *bitmap, const rectangle &cliprect, void *param);
29#define CRTC_EGA_END_UPDATE(name)      void name(device_t *device, bitmap_t *bitmap, const rectangle &cliprect, void *param)
3030
3131typedef void (*crtc_ega_on_de_changed_func)(device_t *device, int display_enabled);
3232#define CRTC_EGA_ON_DE_CHANGED(name)   void name(device_t *device, int display_enabled)
r13798r13799
102102/* updates the screen -- this will call begin_update(),
103103   followed by update_row() reapeatedly and after all row
104104   updating is complete, end_update() */
105void crtc_ega_update(device_t *device, bitmap_t *bitmap, const rectangle *cliprect);
105void crtc_ega_update(device_t *device, bitmap_t *bitmap, const rectangle &cliprect);
106106
107107
108108#endif
src/mess/video/mikromik.c
r13798r13799
112112bool mm1_state::screen_update(screen_device &screen, bitmap_t &bitmap, const rectangle &cliprect)
113113{
114114   /* text */
115   i8275_update(m_crtc, &bitmap, &cliprect);
116   copybitmap(&bitmap, screen.machine().generic.tmpbitmap, 0, 0, 0, 0, &cliprect);
115   i8275_update(m_crtc, &bitmap, cliprect);
116   copybitmap(&bitmap, screen.machine().generic.tmpbitmap, 0, 0, 0, 0, cliprect);
117117
118118   /* graphics */
119   m_hgdc->update_screen(&bitmap, &cliprect);
119   m_hgdc->update_screen(&bitmap, cliprect);
120120
121121   return 0;
122122}
src/mess/video/pet.c
r13798r13799
7676   {
7777      for (x=0;x<40;x++, i++)
7878      {
79         drawgfx_opaque(bitmap, NULL,screen.machine().gfx[state->m_font],
79         drawgfx_opaque(bitmap, cliprect,screen.machine().gfx[state->m_font],
8080               videoram[i], 0, 0, 0, 8*x,8*y);
8181      }
8282   }
src/mess/video/pcw.c
r13798r13799
196196   rect.max_x = PCW_PRINTER_WIDTH - 1;
197197   rect.max_y = PCW_PRINTER_HEIGHT - 1;
198198   feed = -(state->m_paper_feed / 2);
199   copyscrollbitmap(bitmap,state->m_prn_output,0,NULL,1,&feed,&rect);
199   copyscrollbitmap(bitmap,state->m_prn_output,0,NULL,1,&feed,rect);
200200   bitmap->pix16(PCW_PRINTER_HEIGHT-1, state->m_printer_headpos) = 0;
201201   bitmap->pix16(PCW_PRINTER_HEIGHT-2, state->m_printer_headpos) = 0;
202202   bitmap->pix16(PCW_PRINTER_HEIGHT-3, state->m_printer_headpos) = 0;
src/mess/video/upd7220.c
r13798r13799
15421542//  update_text -
15431543//-------------------------------------------------
15441544
1545void upd7220_device::update_text(bitmap_t *bitmap, const rectangle *cliprect)
1545void upd7220_device::update_text(bitmap_t *bitmap, const rectangle &cliprect)
15461546{
15471547   UINT32 addr, sad;
15481548   UINT16 len;
r13798r13799
15881588//  update_graphics -
15891589//-------------------------------------------------
15901590
1591void upd7220_device::update_graphics(bitmap_t *bitmap, const rectangle *cliprect, int force_bitmap)
1591void upd7220_device::update_graphics(bitmap_t *bitmap, const rectangle &cliprect, int force_bitmap)
15921592{
15931593   UINT32 addr, sad;
15941594   UINT16 len;
r13798r13799
16291629//  update_screen -
16301630//-------------------------------------------------
16311631
1632void upd7220_device::update_screen(bitmap_t *bitmap, const rectangle *cliprect)
1632void upd7220_device::update_screen(bitmap_t *bitmap, const rectangle &cliprect)
16331633{
16341634   if (m_de)
16351635   {
src/mess/video/vic4567.c
r13798r13799
19491949      }
19501950}
19511951
1952UINT32 vic3_video_update( device_t *device, bitmap_t *bitmap, const rectangle *cliprect )
1952UINT32 vic3_video_update( device_t *device, bitmap_t *bitmap, const rectangle &cliprect )
19531953{
19541954   vic3_state *vic3 = get_safe_token(device);
19551955
src/mess/video/upd7220.h
r13798r13799
109109    DECLARE_READ8_MEMBER( vram_r );
110110    DECLARE_WRITE8_MEMBER( vram_w );
111111
112   void update_screen(bitmap_t *bitmap, const rectangle *cliprect);
112   void update_screen(bitmap_t *bitmap, const rectangle &cliprect);
113113   virtual const rom_entry *device_rom_region() const;
114114   virtual const address_space_config *memory_space_config(address_spacenum spacenum = AS_0) const;
115115
r13798r13799
150150   void draw_char(int x, int y);
151151   int translate_command(UINT8 data);
152152   void process_fifo();
153   void update_text(bitmap_t *bitmap, const rectangle *cliprect);
153   void update_text(bitmap_t *bitmap, const rectangle &cliprect);
154154   void draw_graphics_line(bitmap_t *bitmap, UINT32 addr, int y, int wd);
155   void update_graphics(bitmap_t *bitmap, const rectangle *cliprect, int force_bitmap);
155   void update_graphics(bitmap_t *bitmap, const rectangle &cliprect, int force_bitmap);
156156
157157   devcb_resolved_write_line   m_out_drq_func;
158158   devcb_resolved_write_line   m_out_hsync_func;
src/mess/video/pc1403.c
r13798r13799
154154   int x, y, i, j;
155155   int color[3];
156156
157   bitmap->fill(11, *cliprect);
157   bitmap->fill(11, cliprect);
158158
159159   /* HJB: we cannot initialize array with values from other arrays, thus... */
160160   color[0] = 7; // pocketc_colortable[CONTRAST][0];
r13798r13799
165165   {
166166      for (x=state->m_RIGHT, y=state->m_DOWN, i=0; i<6*5; x+=2) {
167167         for (j=0; j<5; j++, i++, x+=2)
168         drawgfx_opaque(bitmap, 0, screen.machine().gfx[0], state->m_reg[i],CONTRAST,0,0,
168         drawgfx_opaque(bitmap, cliprect, screen.machine().gfx[0], state->m_reg[i],CONTRAST,0,0,
169169            x,y);
170170      }
171171      for (i=9*5; i<12*5; x+=2)
172172      {
173173         for (j=0; j<5; j++, i++, x+=2)
174         drawgfx_opaque(bitmap, 0, screen.machine().gfx[0], state->m_reg[i],CONTRAST,0,0,
174         drawgfx_opaque(bitmap, cliprect, screen.machine().gfx[0], state->m_reg[i],CONTRAST,0,0,
175175            x,y);
176176      }
177177      for (i=6*5; i<9*5; x+=2)
178178      {
179179         for (j=0; j<5; j++, i++, x+=2)
180         drawgfx_opaque(bitmap, 0, screen.machine().gfx[0], state->m_reg[i],CONTRAST,0,0,
180         drawgfx_opaque(bitmap, cliprect, screen.machine().gfx[0], state->m_reg[i],CONTRAST,0,0,
181181            x,y);
182182      }
183183      for (i=0x7b-3*5; i>0x7b-6*5; x+=2)
184184      {
185185         for (j=0; j<5; j++, i--, x+=2)
186            drawgfx_opaque(bitmap, 0, screen.machine().gfx[0], state->m_reg[i],CONTRAST,0,0,
186            drawgfx_opaque(bitmap, cliprect, screen.machine().gfx[0], state->m_reg[i],CONTRAST,0,0,
187187            x,y);
188188      }
189189      for (i=0x7b; i>0x7b-3*5; x+=2)
190190      {
191191         for (j=0; j<5; j++, i--, x+=2)
192         drawgfx_opaque(bitmap, 0, screen.machine().gfx[0], state->m_reg[i],CONTRAST,0,0,
192         drawgfx_opaque(bitmap, cliprect, screen.machine().gfx[0], state->m_reg[i],CONTRAST,0,0,
193193            x,y);
194194      }
195195      for (i=0x7b-6*5; i>0x7b-12*5; x+=2)
196196      {
197197         for (j=0; j<5; j++, i--, x+=2)
198         drawgfx_opaque(bitmap, 0, screen.machine().gfx[0], state->m_reg[i],CONTRAST,0,0,
198         drawgfx_opaque(bitmap, cliprect, screen.machine().gfx[0], state->m_reg[i],CONTRAST,0,0,
199199            x,y);
200200      }
201201   }
src/mess/video/galeb.c
r13798r13799
3737      for(x = 0; x < 48; x++ )
3838      {
3939         int code = state->m_video_ram[15 + x + y*64];
40         drawgfx_opaque(bitmap, NULL, screen.machine().gfx[0],  code , 0, 0,0, x*8,y*8);
40         drawgfx_opaque(bitmap, cliprect, screen.machine().gfx[0],  code , 0, 0,0, x*8,y*8);
4141      }
4242   }
4343   return 0;
src/mess/video/v1050.c
r13798r13799
134134
135135bool v1050_state::screen_update(screen_device &screen, bitmap_t &bitmap, const rectangle &cliprect)
136136{
137   m_crtc->update(&bitmap, &cliprect);
137   m_crtc->update(&bitmap, cliprect);
138138
139139   return 0;
140140}
src/mess/video/electron.c
r13798r13799
6767   int x = 0;
6868   int pal[16];
6969   int scanline = screen.vpos();
70   rectangle r = *cliprect;
70   rectangle r = cliprect;
7171   r.min_y = r.max_y = scanline;
7272
7373   /* set up palette */
src/mess/video/vic4567.h
r13798r13799
151151READ8_DEVICE_HANDLER( vic3_port_r );
152152
153153void vic3_raster_interrupt_gen( device_t *device );
154UINT32 vic3_video_update( device_t *device, bitmap_t *bitmap, const rectangle *cliprect );
154UINT32 vic3_video_update( device_t *device, bitmap_t *bitmap, const rectangle &cliprect );
155155
156156
157157#endif /* __VIC4567_H__ */
src/mess/video/zx8301.c
r13798r13799
319319//  update_screen -
320320//-------------------------------------------------
321321
322void zx8301_device::update_screen(bitmap_t *bitmap, const rectangle *cliprect)
322void zx8301_device::update_screen(bitmap_t *bitmap, const rectangle &cliprect)
323323{
324324   if (!m_dispoff)
325325   {
r13798r13799
341341   }
342342   else
343343   {
344      bitmap->fill(get_black_pen(machine()), *cliprect);
344      bitmap->fill(get_black_pen(machine()), cliprect);
345345   }
346346}
src/mess/video/vtvideo.c
r13798r13799
233233   }
234234}
235235
236void vt_video_update(device_t *device, bitmap_t *bitmap, const rectangle *cliprect)
236void vt_video_update(device_t *device, bitmap_t *bitmap, const rectangle &cliprect)
237237{
238238   vt_video_t *vt = get_safe_token(device);
239239
src/mess/video/zx8301.h
r13798r13799
8888    DECLARE_READ8_MEMBER( data_r );
8989    DECLARE_WRITE8_MEMBER( data_w );
9090
91   void update_screen(bitmap_t *bitmap, const rectangle *cliprect);
91   void update_screen(bitmap_t *bitmap, const rectangle &cliprect);
9292
9393protected:
9494    // device-level overrides
src/mess/video/apple1.c
r13798r13799
9090      0);         /* flags */
9191}
9292
93static void terminal_draw(running_machine &machine, bitmap_t *dest, const rectangle *cliprect, terminal_t *terminal)
93static void terminal_draw(running_machine &machine, bitmap_t *dest, const rectangle &cliprect, terminal_t *terminal)
9494{
9595   apple1_state *state = machine.driver_data<apple1_state>();
9696   state->m_current_terminal = terminal;
r13798r13799
396396{
397397   apple1_state *state = screen.machine().driver_data<apple1_state>();
398398   apple1_vh_cursor_blink(screen.machine());
399   terminal_draw(screen.machine(), bitmap, NULL, state->m_terminal);
399   terminal_draw(screen.machine(), bitmap, cliprect, state->m_terminal);
400400   return 0;
401401}
src/mess/video/vtvideo.h
r13798r13799
5151
5252
5353/* screen update */
54void vt_video_update(device_t *device, bitmap_t *bitmap, const rectangle *cliprect);
54void vt_video_update(device_t *device, bitmap_t *bitmap, const rectangle &cliprect);
5555
5656#endif
src/mess/video/mc6847.c
r13798r13799
712712//  update
713713//-------------------------------------------------
714714 
715bool mc6847_base_device::update(bitmap_t *bitmap, const rectangle *cliprect)
715bool mc6847_base_device::update(bitmap_t *bitmap, const rectangle &cliprect)
716716{
717717   int base_x = 32;
718718   int base_y = 25;
719719   int x, x2, y;
720720   bool is_mc6847t1 = (type() == MC6847T1_NTSC) || (type() == MC6847T1_PAL);
721   int min_x = USE_HORIZONTAL_CLIP ? cliprect->min_x : 0;
722   int max_x = USE_HORIZONTAL_CLIP ? cliprect->max_x : (base_x * 2 + 256 - 1);
723   int min_y = cliprect->min_y;
724   int max_y = cliprect->max_y;
721   int min_x = USE_HORIZONTAL_CLIP ? cliprect.min_x : 0;
722   int max_x = USE_HORIZONTAL_CLIP ? cliprect.max_x : (base_x * 2 + 256 - 1);
723   int min_y = cliprect.min_y;
724   int max_y = cliprect.max_y;
725725   const pixel_t *palette = m_palette;
726726 
727727   /* if the video didn't change, indicate as much */
src/mess/video/tmc1800.c
r13798r13799
1818
1919bool tmc1800_state::screen_update(screen_device &screen, bitmap_t &bitmap, const rectangle &cliprect)
2020{
21   m_vdc->update_screen(&bitmap, &cliprect);
21   m_vdc->update_screen(&bitmap, cliprect);
2222
2323   return 0;
2424}
r13798r13799
6060
6161bool tmc2000_state::screen_update(screen_device &screen, bitmap_t &bitmap, const rectangle &cliprect)
6262{
63   m_cti->update_screen(&bitmap, &cliprect);
63   m_cti->update_screen(&bitmap, cliprect);
6464
6565   return 0;
6666}
r13798r13799
8787
8888bool nano_state::screen_update(screen_device &screen, bitmap_t &bitmap, const rectangle &cliprect)
8989{
90   m_cti->update_screen(&bitmap, &cliprect);
90   m_cti->update_screen(&bitmap, cliprect);
9191
9292   return 0;
9393}
src/mess/video/mc6847.h
r13798r13799
496496   /* updates the screen -- this will call begin_update(),
497497       followed by update_row() reapeatedly and after all row
498498       updating is complete, end_update() */
499   bool update(bitmap_t *bitmap, const rectangle *cliprect);
499   bool update(bitmap_t *bitmap, const rectangle &cliprect);
500500 
501501   // mode changing operations
502502   DECLARE_WRITE_LINE_MEMBER( ag_w )      { change_mode(MODE_AG, state); }
src/mess/video/nascom1.c
r13798r13799
1717
1818   for (sx = 0; sx < 48; sx++)
1919   {
20      drawgfx_opaque (bitmap, NULL,
20      drawgfx_opaque (bitmap, cliprect,
2121         screen.machine().gfx[0], videoram[0x03ca + sx],
2222         1, 0, 0, sx * 8, 0);
2323   }
r13798r13799
2626   {
2727      for (sx = 0; sx < 48; sx++)
2828      {
29         drawgfx_opaque (bitmap, NULL,
29         drawgfx_opaque (bitmap, cliprect,
3030            screen.machine().gfx[0], videoram[0x000a + (sy * 64) + sx],
3131            1, 0, 0, sx * 8, (sy + 1) * 16);
3232      }
r13798r13799
4242
4343   for (sx = 0; sx < 48; sx++)
4444   {
45      drawgfx_opaque (bitmap, NULL,
45      drawgfx_opaque (bitmap, cliprect,
4646         screen.machine().gfx[0], videoram[0x03ca + sx],
4747         1, 0, 0, sx * 8, 0);
4848   }
r13798r13799
5151   {
5252      for (sx = 0; sx < 48; sx++)
5353      {
54         drawgfx_opaque (bitmap, NULL,
54         drawgfx_opaque (bitmap, cliprect,
5555            screen.machine().gfx[0], videoram[0x000a + (sy * 64) + sx],
5656            1, 0, 0, sx * 8, (sy + 1) * 14);
5757      }
src/mess/video/hd44780.c
r13798r13799
163163//  device interface
164164//**************************************************************************
165165
166int hd44780_device::video_update(bitmap_t *bitmap, const rectangle *cliprect)
166int hd44780_device::video_update(bitmap_t *bitmap, const rectangle &cliprect)
167167{
168168   assert(height*9 <= bitmap->height() && width*6 <= bitmap->width());
169169
170   bitmap->fill(0, *cliprect);
170   bitmap->fill(0, cliprect);
171171
172172   if (m_display_on)
173173      for (int l=0; l<height; l++)
src/mess/video/vdc8563.c
r13798r13799
416416      {
417417         if (vdc8563->dirty[i])
418418         {
419            drawgfx_opaque(bitmap,&rect,machine.gfx[0], vdc8563->ram[i], FRAMECOLOR | (MONOCOLOR << 4), 0, 0,
419            drawgfx_opaque(bitmap,rect,machine.gfx[0], vdc8563->ram[i], FRAMECOLOR | (MONOCOLOR << 4), 0, 0,
420420                  machine.gfx[0]->width * x + 8, height * y + height);
421421
422422            if ((vdc8563->cursor_on) && (i == (CRTC6845_CURSOR_POS & vdc8563->mask)))
r13798r13799
526526            k = ((i << 4) + j) & vdc8563->mask;
527527            if (vdc8563->dirty[k])
528528            {
529               drawgfx_opaque(bitmap, &rect, machine.gfx[1], vdc8563->ram[k], FRAMECOLOR | (MONOCOLOR << 4), 0, 0,
529               drawgfx_opaque(bitmap, rect, machine.gfx[1], vdc8563->ram[k], FRAMECOLOR | (MONOCOLOR << 4), 0, 0,
530530                     machine.gfx[0]->width * x + 8, height * y + height + j);
531531               vdc8563->dirty[k] = 0;
532532            }
r13798r13799
536536   }
537537}
538538
539UINT32 vdc8563_video_update( device_t *device, bitmap_t *bitmap, const rectangle *cliprect )
539UINT32 vdc8563_video_update( device_t *device, bitmap_t *bitmap, const rectangle &cliprect )
540540{
541541   vdc8563_state *vdc8563 = get_safe_token(device);
542542   int i;
src/mess/video/newbrain.c
r13798r13799
1313   save_item(NAME(m_segment_data));
1414}
1515
16void newbrain_state::screen_update(bitmap_t *bitmap, const rectangle *cliprect)
16void newbrain_state::screen_update(bitmap_t *bitmap, const rectangle &cliprect)
1717{
1818   address_space *program = m_maincpu->memory().space(AS_PROGRAM);
1919
r13798r13799
105105{
106106   if (m_enrg1 & NEWBRAIN_ENRG1_TVP)
107107   {
108      screen_update(&bitmap, &cliprect);
108      screen_update(&bitmap, cliprect);
109109   }
110110   else
111111   {
src/mess/video/hd44780.h
r13798r13799
4343   DECLARE_WRITE8_MEMBER(data_write);
4444   DECLARE_READ8_MEMBER(data_read);
4545
46   int video_update(bitmap_t *bitmap, const rectangle *cliprect);
46   int video_update(bitmap_t *bitmap, const rectangle &cliprect);
4747
4848protected:
4949   // device-level overrides
src/mess/video/vdc8563.h
r13798r13799
3939/*----------- defined in video/vdc8563.c -----------*/
4040
4141void vdc8563_set_rastering(device_t *device, int on);
42UINT32 vdc8563_video_update(device_t *device, bitmap_t *bitmap, const rectangle *cliprect);
42UINT32 vdc8563_video_update(device_t *device, bitmap_t *bitmap, const rectangle &cliprect);
4343
4444WRITE8_DEVICE_HANDLER( vdc8563_port_w );
4545READ8_DEVICE_HANDLER( vdc8563_port_r );
src/mess/video/p2000m.c
r13798r13799
4343         if (code < 32) code = 32;
4444      }
4545
46      drawgfxzoom_opaque (bitmap, NULL, screen.machine().gfx[0], code,
46      drawgfxzoom_opaque (bitmap, cliprect, screen.machine().gfx[0], code,
4747         videoram[offs + 2048] & 0x08 ? 0 : 1, 0, 0, sx, sy, 0x20000, 0x20000);
4848
4949      if (videoram[offs] & 0x80)
src/mess/video/ef9345.c
r13798r13799
955955            EF9345 interface
956956**************************************************************/
957957
958void ef9345_device::video_update(bitmap_t *bitmap, const rectangle *cliprect)
958void ef9345_device::video_update(bitmap_t *bitmap, const rectangle &cliprect)
959959{
960960   copybitmap(bitmap, m_screen_out, 0, 0, 0, 0, cliprect);
961961}
src/mess/video/intv.c
r13798r13799
794794         for(x=0;x<40;x++)
795795         {
796796            offs = current_row*64+x;
797            drawgfx_transpen(bitmap, NULL,
797            drawgfx_transpen(bitmap, cliprect,
798798               screen.machine().gfx[1],
799799               videoram[offs],
800800               7, /* white */
r13798r13799
805805         {
806806            /* draw the cursor as a solid white block */
807807            /* (should use a filled rect here!) */
808            drawgfx_transpen(bitmap, NULL,
808            drawgfx_transpen(bitmap, cliprect,
809809               screen.machine().gfx[1],
810810               191, /* a block */
811811               7,   /* white   */
src/mess/video/ef9345.h
r13798r13799
4242   READ8_MEMBER( data_r );
4343   WRITE8_MEMBER( data_w );
4444   void update_scanline(UINT16 scanline);
45   void video_update(bitmap_t *bitmap, const rectangle *cliprect);
45   void video_update(bitmap_t *bitmap, const rectangle &cliprect);
4646
4747protected:
4848    // device-level overrides
src/mess/video/kyocera.c
r13798r13799
88
99bool kc85_state::screen_update(screen_device &screen, bitmap_t &bitmap, const rectangle &cliprect)
1010{
11   m_lcdc0->update_screen(&bitmap, &cliprect);
12   m_lcdc1->update_screen(&bitmap, &cliprect);
13   m_lcdc2->update_screen(&bitmap, &cliprect);
14   m_lcdc3->update_screen(&bitmap, &cliprect);
15   m_lcdc4->update_screen(&bitmap, &cliprect);
16   m_lcdc5->update_screen(&bitmap, &cliprect);
17   m_lcdc6->update_screen(&bitmap, &cliprect);
18   m_lcdc7->update_screen(&bitmap, &cliprect);
19   m_lcdc8->update_screen(&bitmap, &cliprect);
20   m_lcdc9->update_screen(&bitmap, &cliprect);
11   m_lcdc0->update_screen(&bitmap, cliprect);
12   m_lcdc1->update_screen(&bitmap, cliprect);
13   m_lcdc2->update_screen(&bitmap, cliprect);
14   m_lcdc3->update_screen(&bitmap, cliprect);
15   m_lcdc4->update_screen(&bitmap, cliprect);
16   m_lcdc5->update_screen(&bitmap, cliprect);
17   m_lcdc6->update_screen(&bitmap, cliprect);
18   m_lcdc7->update_screen(&bitmap, cliprect);
19   m_lcdc8->update_screen(&bitmap, cliprect);
20   m_lcdc9->update_screen(&bitmap, cliprect);
2121
2222   return 0;
2323}
2424
2525bool tandy200_state::screen_update(screen_device &screen, bitmap_t &bitmap, const rectangle &cliprect)
2626{
27   m_lcdc->update_screen(&bitmap, &cliprect);
27   m_lcdc->update_screen(&bitmap, cliprect);
2828
2929   return 0;
3030}
src/mess/video/ut88.c
r13798r13799
3636      {
3737         int code = state->m_p_videoram[ x + y*64 ] & 0x7f;
3838         int attr = state->m_p_videoram[ x+1 + y*64 ] & 0x80;
39         drawgfx_opaque(bitmap, NULL, screen.machine().gfx[0], code | attr, 0, 0,0, x*8,y*8);
39         drawgfx_opaque(bitmap, cliprect, screen.machine().gfx[0], code | attr, 0, 0,0, x*8,y*8);
4040      }
4141   }
4242   return 0;
src/mess/video/vic6567.c
r13798r13799
25812581   return val;
25822582}
25832583
2584UINT32 vic2_video_update( device_t *device, bitmap_t *bitmap, const rectangle *cliprect )
2584UINT32 vic2_video_update( device_t *device, bitmap_t *bitmap, const rectangle &cliprect )
25852585{
25862586   vic2_state *vic2 = get_safe_token(device);
25872587
src/mess/video/comx35.c
r13798r13799
113113{
114114   if (screen.width() == CDP1869_SCREEN_WIDTH)
115115   {
116      m_vis->update_screen(&bitmap, &cliprect);
116      m_vis->update_screen(&bitmap, cliprect);
117117   }
118118   else
119119   {
src/mess/video/vic6567.h
r13798r13799
153153int vic2e_k2_r(device_t *device);
154154
155155void vic2_raster_interrupt_gen( device_t *device );
156UINT32 vic2_video_update( device_t *device, bitmap_t *bitmap, const rectangle *cliprect );
156UINT32 vic2_video_update( device_t *device, bitmap_t *bitmap, const rectangle &cliprect );
157157
158158
159159extern void vic2_set_rastering(device_t *device, int onoff);
src/mess/video/abc802.c
r13798r13799
228228   screen.set_visible_area(0, 767, 0, 311);
229229
230230   // draw text
231   m_crtc->update(&bitmap, &cliprect);
231   m_crtc->update(&bitmap, cliprect);
232232
233233   return 0;
234234}
src/mess/video/apple2.c
r13798r13799
6464    adjust_begin_and_end_row - processes the cliprect
6565-------------------------------------------------*/
6666
67static void adjust_begin_and_end_row(const rectangle *cliprect, int *beginrow, int *endrow)
67static void adjust_begin_and_end_row(const rectangle &cliprect, int *beginrow, int *endrow)
6868{
6969   /* assumptions of the code */
7070   assert((*beginrow % 8) == 0);
7171   assert((*endrow % 8) == 7);
7272
73   *beginrow = MAX(*beginrow, cliprect->min_y - (cliprect->min_y % 8));
74   *endrow = MIN(*endrow, cliprect->max_y - (cliprect->max_y % 8) + 7);
73   *beginrow = MAX(*beginrow, cliprect.min_y - (cliprect.min_y % 8));
74   *endrow = MIN(*endrow, cliprect.max_y - (cliprect.max_y % 8) + 7);
7575
7676   /* sanity check again */
7777   assert((*beginrow % 8) == 0);
r13798r13799
137137    column or 80 column)
138138-------------------------------------------------*/
139139
140static void apple2_text_draw(running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect, int page, int beginrow, int endrow)
140static void apple2_text_draw(running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect, int page, int beginrow, int endrow)
141141{
142142   apple2_state *state = machine.driver_data<apple2_state>();
143143   int row, col;
r13798r13799
178178    apple2_lores_draw - renders lo-res text
179179-------------------------------------------------*/
180180
181static void apple2_lores_draw(running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect, int page, int beginrow, int endrow)
181static void apple2_lores_draw(running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect, int page, int beginrow, int endrow)
182182{
183183   apple2_state *state = machine.driver_data<apple2_state>();
184184   int row, col, y, x;
r13798r13799
219219    HIGH RESOLUTION GRAPHICS
220220***************************************************************************/
221221
222static void apple2_hires_draw(running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect, int page, int beginrow, int endrow)
222static void apple2_hires_draw(running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect, int page, int beginrow, int endrow)
223223{
224224   apple2_state *state = machine.driver_data<apple2_state>();
225225   const UINT8 *vram;
r13798r13799
233233   UINT16 *artifact_map_ptr;
234234
235235   /* sanity checks */
236   if (beginrow < cliprect->min_y)
237      beginrow = cliprect->min_y;
238   if (endrow > cliprect->max_y)
239      endrow = cliprect->max_y;
236   if (beginrow < cliprect.min_y)
237      beginrow = cliprect.min_y;
238   if (endrow > cliprect.max_y)
239      endrow = cliprect.max_y;
240240   if (endrow < beginrow)
241241      return;
242242
src/mess/video/abc806.c
r13798r13799
428428//  hr_update - high resolution screen update
429429//-------------------------------------------------
430430
431void abc806_state::hr_update(bitmap_t *bitmap, const rectangle *cliprect)
431void abc806_state::hr_update(bitmap_t *bitmap, const rectangle &cliprect)
432432{
433433   UINT32 addr = (m_hrs & 0x0f) << 15;
434434
435   for (int y = m_sync + VERTICAL_PORCH_HACK; y < MIN(cliprect->max_y + 1, m_sync + VERTICAL_PORCH_HACK + 240); y++)
435   for (int y = m_sync + VERTICAL_PORCH_HACK; y < MIN(cliprect.max_y + 1, m_sync + VERTICAL_PORCH_HACK + 240); y++)
436436   {
437437      for (int sx = 0; sx < 128; sx++)
438438      {
r13798r13799
516516   if (!m_txoff)
517517   {
518518      // draw text
519      m_crtc->update(&bitmap, &cliprect);
519      m_crtc->update(&bitmap, cliprect);
520520   }
521521
522522   // draw HR graphics
523   hr_update(&bitmap, &cliprect);
523   hr_update(&bitmap, cliprect);
524524
525525   return 0;
526526}
src/mess/video/abc1600.c
r13798r13799
987987   return (cr << 10) | ((ra & 0x0f) << 6) | ((cc << 1) & 0x3c);
988988}
989989
990void abc1600_state::crtc_update_row(device_t *device, bitmap_t *bitmap, const rectangle *cliprect, UINT16 ma, UINT8 ra, UINT16 y, UINT8 x_count, INT8 cursor_x, void *param)
990void abc1600_state::crtc_update_row(device_t *device, bitmap_t *bitmap, const rectangle &cliprect, UINT16 ma, UINT8 ra, UINT16 y, UINT8 x_count, INT8 cursor_x, void *param)
991991{
992992   if (y > 0x3ff) return;
993993
r13798r13799
10991099   if (m_endisp)
11001100   {
11011101      bitmap.fill(FRAME_POL, cliprect);
1102      m_crtc->update(&bitmap, &cliprect);
1102      m_crtc->update(&bitmap, cliprect);
11031103   }
11041104   else
11051105   {
src/mess/video/hd66421.c
r13798r13799
203203   bitmap->pix16(y, x) = (UINT16)color;
204204}
205205
206void hd66421_device::update_screen(bitmap_t *bitmap, const rectangle *cliprect)
206void hd66421_device::update_screen(bitmap_t *bitmap, const rectangle &cliprect)
207207{
208208   pen_t pen[4];
209209
src/mess/video/hd66421.h
r13798r13799
5050   DECLARE_READ8_MEMBER( reg_dat_r );
5151   DECLARE_WRITE8_MEMBER( reg_dat_w );
5252
53   void update_screen(bitmap_t *bitmap, const rectangle *cliprect);
53   void update_screen(bitmap_t *bitmap, const rectangle &cliprect);
5454
5555protected:
5656    // device-level overrides
src/mess/video/pc1251.c
r13798r13799
121121   int color[2];
122122   running_machine &machine = screen.machine();
123123
124   bitmap->fill(11, *cliprect);
124   bitmap->fill(11, cliprect);
125125
126126   /* HJB: we cannot initialize array with values from other arrays, thus... */
127127   color[0] = 7; //pocketc_colortable[PC1251_CONTRAST][0];
r13798r13799
130130   for (x=RIGHT,y=DOWN, i=0; i<60; x+=3)
131131   {
132132      for (j=0; j<5; j++, i++, x+=3)
133         drawgfx_opaque(bitmap, 0, screen.machine().gfx[0], state->m_reg[i],
133         drawgfx_opaque(bitmap, cliprect, screen.machine().gfx[0], state->m_reg[i],
134134               PC1251_CONTRAST,0,0,
135135               x,y);
136136   }
137137   for (i=0x7b; i>=0x40; x+=3)
138138   {
139139      for (j=0; j<5; j++, i--, x+=3)
140         drawgfx_opaque(bitmap, 0, screen.machine().gfx[0], state->m_reg[i],
140         drawgfx_opaque(bitmap, cliprect, screen.machine().gfx[0], state->m_reg[i],
141141               PC1251_CONTRAST,0,0,
142142               x,y);
143143   }
src/mess/video/733_asr.c
r13798r13799
243243{
244244   asr_t *asr = get_safe_token(device);
245245
246   drawgfx_opaque(asr->bitmap, NULL, device->machine().gfx[0], character-32, color, 0, 0,
246   drawgfx_opaque(asr->bitmap, asr->bitmap->cliprect(), device->machine().gfx[0], character-32, color, 0, 0,
247247            x+1, y);
248248}
249249
r13798r13799
455455void asr733_refresh(device_t *device, bitmap_t *bitmap, int x, int y)
456456{
457457   asr_t *asr = get_safe_token(device);
458   copybitmap(bitmap, asr->bitmap, 0, 0, x, y, NULL);
458   copybitmap(bitmap, asr->bitmap, 0, 0, x, y, asr->bitmap->cliprect());
459459}
460460
461461
src/mess/video/gime.c
r13798r13799
17571757//  update_screen
17581758//-------------------------------------------------
17591759 
1760bool gime_base_device::update_screen(bitmap_t *bitmap, const rectangle *cliprect, const pixel_t *RESTRICT palette)
1760bool gime_base_device::update_screen(bitmap_t *bitmap, const rectangle &cliprect, const pixel_t *RESTRICT palette)
17611761{
17621762   int base_x = 64;
1763   int min_x = USE_HORIZONTAL_CLIP ? cliprect->min_x : 0;
1764   int max_x = USE_HORIZONTAL_CLIP ? cliprect->max_x : (base_x * 2 + 512 - 1);
1765   int min_y = cliprect->min_y;
1766   int max_y = cliprect->max_y;
1763   int min_x = USE_HORIZONTAL_CLIP ? cliprect.min_x : 0;
1764   int max_x = USE_HORIZONTAL_CLIP ? cliprect.max_x : (base_x * 2 + 512 - 1);
1765   int min_y = cliprect.min_y;
1766   int max_y = cliprect.max_y;
17671767   palette_resolver resolver(this, palette);
17681768 
17691769   /* if the video didn't change, indicate as much */
r13798r13799
18581858//  update_composite
18591859//-------------------------------------------------
18601860 
1861bool gime_base_device::update_composite(bitmap_t *bitmap, const rectangle *cliprect)
1861bool gime_base_device::update_composite(bitmap_t *bitmap, const rectangle &cliprect)
18621862{
18631863   update_value(&m_displayed_rgb, false);
18641864   const pixel_t *palette = (m_gime_registers[0x08] & 0x10)
r13798r13799
18731873//  update_rgb
18741874//-------------------------------------------------
18751875 
1876bool gime_base_device::update_rgb(bitmap_t *bitmap, const rectangle *cliprect)
1876bool gime_base_device::update_rgb(bitmap_t *bitmap, const rectangle &cliprect)
18771877{
18781878   update_value(&m_displayed_rgb, true);
18791879   return update_screen(bitmap, cliprect, m_rgb_palette);
src/mess/video/bbc.c
r13798r13799
663663    bbc_state *state = screen.machine().driver_data<bbc_state>();
664664    long c;
665665
666    //logerror ("Box %d by %d \n",cliprect->min_y,cliprect->max_y);
666    //logerror ("Box %d by %d \n",cliprect.min_y,cliprect.max_y);
667667
668668    c = 0; // this is used to time out the screen redraw, in the case that the 6845 is in some way out state.
669669
r13798r13799
688688    // or until a timeout (this catches the 6845 with silly register values that would not give a VSYNC signal)
689689    while((!state->m_BBC_VSync)&&(c<60000))
690690    {
691        if ((state->m_y_screen_pos>=cliprect->min_y) && (state->m_y_screen_pos<=cliprect->max_y)) (state->m_draw_function)(screen.machine());
691        if ((state->m_y_screen_pos>=cliprect.min_y) && (state->m_y_screen_pos<=cliprect.max_y)) (state->m_draw_function)(screen.machine());
692692
693693        // and check the cursor
694694        if (state->m_VideoULA_CR) BBC_Clock_CR(state);
src/mess/video/gime.h
r13798r13799
6767   /* updates the screen -- this will call begin_update(),
6868       followed by update_row() reapeatedly and after all row
6969       updating is complete, end_update() */
70   bool update_composite(bitmap_t *bitmap, const rectangle *cliprect);
71   bool update_rgb(bitmap_t *bitmap, const rectangle *cliprect);
70   bool update_composite(bitmap_t *bitmap, const rectangle &cliprect);
71   bool update_rgb(bitmap_t *bitmap, const rectangle &cliprect);
7272 
7373   /* interrupt outputs */
7474   bool firq_r(void) { return m_firq != 0x00; }
r13798r13799
240240   void timer_elapsed(void);
241241 
242242   // video
243   bool update_screen(bitmap_t *bitmap, const rectangle *cliprect, const pixel_t *palette);
243   bool update_screen(bitmap_t *bitmap, const rectangle &cliprect, const pixel_t *palette);
244244   void update_geometry(void);
245245   void update_border(UINT16 physical_scanline);
246246   pixel_t get_composite_color(int color);
src/mess/video/k1ge.c
r13798r13799
811811}
812812
813813
814void k1ge_update( device_t *device, bitmap_t *bitmap, const rectangle *cliprect )
814void k1ge_update( device_t *device, bitmap_t *bitmap, const rectangle &cliprect )
815815{
816816   k1ge_t *k1ge = get_safe_token( device );
817817
src/mess/video/vtech2.c
r13798r13799
121121   int full_refresh = 1;
122122
123123   if( full_refresh )
124      bitmap->fill(((state->m_laser_bg_mode >> 4) & 15)<<1, *cliprect);
124      bitmap->fill(((state->m_laser_bg_mode >> 4) & 15)<<1, cliprect);
125125
126126   if (state->m_laser_latch & 0x08)
127127   {
src/mess/video/k1ge.h
r13798r13799
3838WRITE8_DEVICE_HANDLER( k1ge_w );
3939READ8_DEVICE_HANDLER( k1ge_r );
4040
41void k1ge_update( device_t *device, bitmap_t *bitmap, const rectangle *cliprect );
41void k1ge_update( device_t *device, bitmap_t *bitmap, const rectangle &cliprect );
4242
4343#endif
4444
src/mess/includes/pc1512.h
r13798r13799
108108   int get_display_mode(UINT8 mode);
109109   offs_t get_char_rom_offset();
110110   int get_color(UINT8 data);
111   void draw_alpha(mc6845_device *device, bitmap_t *bitmap, const rectangle *cliprect, UINT16 ma, UINT8 ra, UINT16 y, UINT8 x_count, INT8 cursor_x, void *param);
112   void draw_graphics_1(mc6845_device *device, bitmap_t *bitmap, const rectangle *cliprect, UINT16 ma, UINT8 ra, UINT16 y, UINT8 x_count, INT8 cursor_x, void *param);
113   void draw_graphics_2(mc6845_device *device, bitmap_t *bitmap, const rectangle *cliprect, UINT16 ma, UINT8 ra, UINT16 y, UINT8 x_count, INT8 cursor_x, void *param);
111   void draw_alpha(mc6845_device *device, bitmap_t *bitmap, const rectangle &cliprect, UINT16 ma, UINT8 ra, UINT16 y, UINT8 x_count, INT8 cursor_x, void *param);
112   void draw_graphics_1(mc6845_device *device, bitmap_t *bitmap, const rectangle &cliprect, UINT16 ma, UINT8 ra, UINT16 y, UINT8 x_count, INT8 cursor_x, void *param);
113   void draw_graphics_2(mc6845_device *device, bitmap_t *bitmap, const rectangle &cliprect, UINT16 ma, UINT8 ra, UINT16 y, UINT8 x_count, INT8 cursor_x, void *param);
114114
115115   DECLARE_READ8_MEMBER( video_ram_r );
116116   DECLARE_WRITE8_MEMBER( video_ram_w );
src/mess/includes/tmc600.h
r13798r13799
4242   virtual void machine_start();
4343
4444   virtual void video_start();
45   virtual bool screen_update(screen_device &screen, bitmap_t &bitmap, const rectangle &cliprect) { m_vis->update_screen(&bitmap, &cliprect); return false; }
45   virtual bool screen_update(screen_device &screen, bitmap_t &bitmap, const rectangle &cliprect) { m_vis->update_screen(&bitmap, cliprect); return false; }
4646
4747   DECLARE_WRITE8_MEMBER( keyboard_latch_w );
4848   DECLARE_WRITE8_MEMBER( vismac_register_w );
src/mess/includes/abc80.h
r13798r13799
8484   virtual void video_start();
8585   virtual bool screen_update(screen_device &screen, bitmap_t &bitmap, const rectangle &cliprect);
8686
87   void update_screen(bitmap_t *bitmap, const rectangle *cliprect);
87   void update_screen(bitmap_t *bitmap, const rectangle &cliprect);
8888
8989   DECLARE_READ8_MEMBER( mmu_r );
9090   DECLARE_WRITE8_MEMBER( mmu_w );
src/mess/includes/portfoli.h
r13798r13799
4848   virtual void machine_start();
4949   virtual void machine_reset();
5050
51   virtual bool screen_update(screen_device &screen, bitmap_t &bitmap, const rectangle &cliprect) { m_lcdc->update_screen(&bitmap, &cliprect); return 0; }
51   virtual bool screen_update(screen_device &screen, bitmap_t &bitmap, const rectangle &cliprect) { m_lcdc->update_screen(&bitmap, cliprect); return 0; }
5252
5353   void check_interrupt();
5454   void trigger_interrupt(int level);
src/mess/includes/abc80x.h
r13798r13799
147147
148148   virtual bool screen_update(screen_device &screen, bitmap_t &bitmap, const rectangle &cliprect);
149149
150   void hr_update(bitmap_t *bitmap, const rectangle *cliprect);
150   void hr_update(bitmap_t *bitmap, const rectangle &cliprect);
151151};
152152
153153class abc800c_state : public abc800_state
r13798r13799
162162
163163   virtual bool screen_update(screen_device &screen, bitmap_t &bitmap, const rectangle &cliprect);
164164
165   void hr_update(bitmap_t *bitmap, const rectangle *cliprect);
165   void hr_update(bitmap_t *bitmap, const rectangle &cliprect);
166166};
167167
168168// ======================> abc802_state
r13798r13799
230230   virtual bool screen_update(screen_device &screen, bitmap_t &bitmap, const rectangle &cliprect);
231231
232232   void bankswitch();
233   void hr_update(bitmap_t *bitmap, const rectangle *cliprect);
233   void hr_update(bitmap_t *bitmap, const rectangle &cliprect);
234234
235235   DECLARE_READ8_MEMBER( mai_r );
236236   DECLARE_WRITE8_MEMBER( mao_w );
src/mess/includes/newbrain.h
r13798r13799
107107   void tvram_w(UINT8 data, int a6);
108108   inline int get_reset_t();
109109   inline int get_pwrup_t();
110   void screen_update(bitmap_t *bitmap, const rectangle *cliprect);
110   void screen_update(bitmap_t *bitmap, const rectangle &cliprect);
111111
112112   // processor state
113113   int m_pwrup;         // power up
src/mess/includes/abc1600.h
r13798r13799
192192   inline UINT16 read_videoram(UINT32 offset);
193193   inline void write_videoram(UINT32 offset, UINT16 data, UINT16 mask);
194194   inline UINT16 get_crtca(UINT16 ma, UINT8 ra, UINT8 column);
195   void crtc_update_row(device_t *device, bitmap_t *bitmap, const rectangle *cliprect, UINT16 ma, UINT8 ra, UINT16 y, UINT8 x_count, INT8 cursor_x, void *param);
195   void crtc_update_row(device_t *device, bitmap_t *bitmap, const rectangle &cliprect, UINT16 ma, UINT8 ra, UINT16 y, UINT8 x_count, INT8 cursor_x, void *param);
196196
197197   void scc_irq(int status);
198198
src/mess/drivers/vip.c
r13798r13799
443443   switch (input_port_read(machine(), "VIDEO"))
444444   {
445445   case VIDEO_CDP1861:
446      m_vdc->update_screen(&bitmap, &cliprect);
446      m_vdc->update_screen(&bitmap, cliprect);
447447      break;
448448
449449   case VIDEO_CDP1862:
450      m_cgc->update_screen(&bitmap, &cliprect);
450      m_cgc->update_screen(&bitmap, cliprect);
451451      break;
452452   }
453453
src/mess/drivers/elf.c
r13798r13799
227227
228228bool elf2_state::screen_update(screen_device &screen, bitmap_t &bitmap, const rectangle &cliprect)
229229{
230   m_vdc->update_screen(&bitmap, &cliprect);
230   m_vdc->update_screen(&bitmap, cliprect);
231231
232232   return 0;
233233}
src/mess/drivers/pc9801.c
r13798r13799
339339   bitmap.fill(0, cliprect);
340340
341341   /* graphics */
342   m_hgdc2->update_screen(&bitmap, &cliprect);
343   m_hgdc1->update_screen(&bitmap, &cliprect);
342   m_hgdc2->update_screen(&bitmap, cliprect);
343   m_hgdc1->update_screen(&bitmap, cliprect);
344344
345345   return 0;
346346}
src/mess/drivers/z100.c
r13798r13799
234234   int dot;
235235   int i;
236236
237   bitmap->fill(0, *cliprect);
237   bitmap->fill(0, cliprect);
238238
239239   for(y=0;y<mc6845_v_display;y++)
240240   {
src/mess/drivers/mc1000.c
r13798r13799
272272
273273bool mc1000_state::screen_update(screen_device &screen, bitmap_t &bitmap, const rectangle &cliprect)
274274{
275   return m_vdg->update(&bitmap, &cliprect);
275   return m_vdg->update(&bitmap, cliprect);
276276}
277277
278278/* AY-3-8910 Interface */
src/mess/drivers/pc88va.c
r13798r13799
8080
8181}
8282
83static void draw_sprites(running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect)
83static void draw_sprites(running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect)
8484{
8585   pc88va_state *state = machine.driver_data<pc88va_state>();
8686   UINT16 *tvram = (UINT16 *)machine.region("tvram")->base();
r13798r13799
190190   return 0;
191191}
192192
193static void draw_text(running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect)
193static void draw_text(running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect)
194194{
195195   pc88va_state *state = machine.driver_data<pc88va_state>();
196196   UINT8 *tvram = machine.region("tvram")->base();
r13798r13799
376376   pc88va_state *state = screen.machine().driver_data<pc88va_state>();
377377   UINT8 pri,cur_pri_lv;
378378   UINT32 screen_pri;
379   bitmap->fill(0, *cliprect);
379   bitmap->fill(0, cliprect);
380380
381381   if(state->m_tsp.disp_on == 0) // don't bother if we are under DSPOFF command
382382      return 0;
src/mess/drivers/pc6001.c
r13798r13799
201201}
202202
203203/* this is known as gfx mode 4 */
204static void draw_gfx_mode4(running_machine &machine, bitmap_t *bitmap,const rectangle *cliprect,int attr)
204static void draw_gfx_mode4(running_machine &machine, bitmap_t *bitmap,const rectangle &cliprect,int attr)
205205{
206206   pc6001_state *state = machine.driver_data<pc6001_state>();
207207   int x,y,xi;
r13798r13799
254254   }
255255}
256256
257static void draw_bitmap_2bpp(running_machine &machine, bitmap_t *bitmap,const rectangle *cliprect, int attr)
257static void draw_bitmap_2bpp(running_machine &machine, bitmap_t *bitmap,const rectangle &cliprect, int attr)
258258{
259259   pc6001_state *state = machine.driver_data<pc6001_state>();
260260   int color,x,y,xi,yi;
r13798r13799
286286   }
287287}
288288
289static void draw_tile_3bpp(running_machine &machine, bitmap_t *bitmap,const rectangle *cliprect,int x,int y,int tile,int attr)
289static void draw_tile_3bpp(running_machine &machine, bitmap_t *bitmap,const rectangle &cliprect,int x,int y,int tile,int attr)
290290{
291291   int color,pen,xi,yi;
292292
r13798r13799
318318   }
319319}
320320
321static void draw_tile_text(running_machine &machine, bitmap_t *bitmap,const rectangle *cliprect,int x,int y,int tile,int attr,int has_mc6847)
321static void draw_tile_text(running_machine &machine, bitmap_t *bitmap,const rectangle &cliprect,int x,int y,int tile,int attr,int has_mc6847)
322322{
323323   int xi,yi,pen,fgcol,color;
324324   UINT8 *gfx_data = machine.region("gfx1")->base();
r13798r13799
354354   }
355355}
356356
357static void draw_border(running_machine &machine, bitmap_t *bitmap,const rectangle *cliprect,int attr,int has_mc6847)
357static void draw_border(running_machine &machine, bitmap_t *bitmap,const rectangle &cliprect,int attr,int has_mc6847)
358358{
359359   int x,y,color;
360360
r13798r13799
376376   }
377377}
378378
379static void pc6001_screen_draw(running_machine &machine, bitmap_t *bitmap,const rectangle *cliprect, int has_mc6847)
379static void pc6001_screen_draw(running_machine &machine, bitmap_t *bitmap,const rectangle &cliprect, int has_mc6847)
380380{
381381   pc6001_state *state = machine.driver_data<pc6001_state>();
382382   int x,y;
src/mess/drivers/apricotp.c
r13798r13799
103103   }
104104   else
105105   {
106      m_crtc->update(&bitmap, &cliprect);
106      m_crtc->update(&bitmap, cliprect);
107107   }
108108
109109   return false;
src/mess/drivers/mycom.c
r13798r13799
126126
127127SCREEN_UPDATE_MEMBER( mycom_state )
128128{
129   m_crtc->update( &bitmap, &cliprect);
129   m_crtc->update( &bitmap, cliprect);
130130   return 0;
131131}
132132
src/mess/drivers/spc1000.c
r13798r13799
263263
264264bool spc1000_state::screen_update(screen_device &screen, bitmap_t &bitmap, const rectangle &cliprect)
265265{
266   return m_vdg->update(&bitmap, &cliprect);
266   return m_vdg->update(&bitmap, cliprect);
267267}
268268
269269static const ay8910_interface spc1000_ay_interface =
src/mess/drivers/if800.c
r13798r13799
3939bool if800_state::screen_update(screen_device &screen, bitmap_t &bitmap, const rectangle &cliprect)
4040{
4141   /* graphics */
42   m_hgdc->update_screen(&bitmap, &cliprect);
42   m_hgdc->update_screen(&bitmap, cliprect);
4343
4444   return 0;
4545}
src/mess/drivers/vii.c
r13798r13799
202202   state->m_screen[offset].b = expand_rgb5_to_rgb8(rgb);
203203}
204204
205static void vii_blit(running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect, UINT32 xoff, UINT32 yoff, UINT32 attr, UINT32 ctrl, UINT32 bitmap_addr, UINT16 tile)
205static void vii_blit(running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect, UINT32 xoff, UINT32 yoff, UINT32 attr, UINT32 ctrl, UINT32 bitmap_addr, UINT16 tile)
206206{
207207   vii_state *state = machine.driver_data<vii_state>();
208208   address_space *space = machine.device("maincpu")->memory().space(AS_PROGRAM);
r13798r13799
271271   }
272272}
273273
274static void vii_blit_page(running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect, int depth, UINT32 bitmap_addr, UINT16 *regs)
274static void vii_blit_page(running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect, int depth, UINT32 bitmap_addr, UINT16 *regs)
275275{
276276   UINT32 x0, y0;
277277   UINT32 xscroll = regs[0];
r13798r13799
340340   }
341341}
342342
343static void vii_blit_sprite(running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect, int depth, UINT32 base_addr)
343static void vii_blit_sprite(running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect, int depth, UINT32 base_addr)
344344{
345345   vii_state *state = machine.driver_data<vii_state>();
346346   address_space *space = machine.device("maincpu")->memory().space(AS_PROGRAM);
r13798r13799
382382   vii_blit(machine, bitmap, cliprect, x, y, attr, 0, bitmap_addr, tile);
383383}
384384
385static void vii_blit_sprites(running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect, int depth)
385static void vii_blit_sprites(running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect, int depth)
386386{
387387   vii_state *state = machine.driver_data<vii_state>();
388388   UINT32 n;
r13798r13799
406406   vii_state *state = screen.machine().driver_data<vii_state>();
407407   int i, x, y;
408408
409   bitmap->fill(0, *cliprect);
409   bitmap->fill(0, cliprect);
410410
411411   memset(state->m_screen, 0, sizeof(state->m_screen));
412412
src/mess/drivers/x1.c
r13798r13799
322322   return height;
323323}
324324
325static void draw_fgtilemap(running_machine &machine, bitmap_t *bitmap,const rectangle *cliprect)
325static void draw_fgtilemap(running_machine &machine, bitmap_t *bitmap,const rectangle &cliprect)
326326{
327327   /*
328328        attribute table:
r13798r13799
469469                  res_x = x*8+xi*(width+1);
470470                  res_y = y*(mc6845_tile_height)+yi;
471471
472                  if(res_y < cliprect->min_y || res_y > cliprect->max_y) // partial update, TODO: optimize
472                  if(res_y < cliprect.min_y || res_y > cliprect.max_y) // partial update, TODO: optimize
473473                     continue;
474474
475475                  x1_draw_pixel(machine,bitmap,res_y,res_x,pcg_pen,width,0);
r13798r13799
511511   return pri_mask_calc;
512512}
513513
514static void draw_gfxbitmap(running_machine &machine, bitmap_t *bitmap,const rectangle *cliprect, int plane,int pri)
514static void draw_gfxbitmap(running_machine &machine, bitmap_t *bitmap,const rectangle &cliprect, int plane,int pri)
515515{
516516   x1_state *state = machine.driver_data<x1_state>();
517517   int xi,yi,x,y;
r13798r13799
553553               if((color == 8 && state->m_scrn_reg.blackclip & 0x10) || (color == 9 && state->m_scrn_reg.blackclip & 0x20)) // bitmap color clip to black conditions
554554                  color = 0;
555555
556               if(y*(mc6845_tile_height)+yi < cliprect->min_y || y*(mc6845_tile_height)+yi > cliprect->max_y) // partial update TODO: optimize
556               if(y*(mc6845_tile_height)+yi < cliprect.min_y || y*(mc6845_tile_height)+yi > cliprect.max_y) // partial update TODO: optimize
557557                  continue;
558558
559559               x1_draw_pixel(machine,bitmap,y*(mc6845_tile_height)+yi,x*8+xi,color,0,0);
r13798r13799
567567{
568568   x1_state *state = screen.machine().driver_data<x1_state>();
569569
570   bitmap->fill(MAKE_ARGB(0xff,0x00,0x00,0x00), *cliprect);
570   bitmap->fill(MAKE_ARGB(0xff,0x00,0x00,0x00), cliprect);
571571
572572   draw_gfxbitmap(screen.machine(),bitmap,cliprect,state->m_scrn_reg.disp_bank,state->m_scrn_reg.pri);
573573   draw_fgtilemap(screen.machine(),bitmap,cliprect);
src/mess/drivers/a6809.c
r13798r13799
5454{
5555   device_t *saa5050 = screen.machine().device("saa5050");
5656
57   saa5050_update(saa5050, bitmap, NULL);
57   saa5050_update(saa5050, bitmap, cliprect);
5858   return 0;
5959}
6060
src/mess/drivers/poly.c
r13798r13799
146146{
147147   device_t *saa5050 = screen.machine().device("saa5050");
148148
149   saa5050_update(saa5050, bitmap, NULL);
149   saa5050_update(saa5050, bitmap, cliprect);
150150   return 0;
151151}
152152
src/mess/drivers/lcmate2.c
r13798r13799
206206
207207bool lcmate2_state::screen_update(screen_device &screen, bitmap_t &bitmap, const rectangle &cliprect)
208208{
209   return m_lcdc->video_update(&bitmap, &cliprect);
209   return m_lcdc->video_update(&bitmap, cliprect);
210210}
211211
212212static const hd44780_interface lcmate2_display =
src/mess/drivers/smc777.c
r13798r13799
7373   UINT8 *gram = screen.machine().region("fbuf")->base();
7474   int x_width;
7575
76   bitmap->fill(screen.machine().pens[state->m_backdrop_pen], *cliprect);
76   bitmap->fill(screen.machine().pens[state->m_backdrop_pen], cliprect);
7777
7878   x_width = (state->m_display_reg & 0x80) ? 2 : 4;
7979
src/mess/drivers/m20.c
r13798r13799
6666   UINT8 pen;
6767   UINT32 count;
6868
69   bitmap->fill(get_black_pen(screen.machine()), *cliprect);
69   bitmap->fill(get_black_pen(screen.machine()), cliprect);
7070
7171   count = (0);
7272
src/mess/drivers/eti660.c
r13798r13799
120120
121121bool eti660_state::screen_update(screen_device &screen, bitmap_t &bitmap, const rectangle &cliprect)
122122{
123   m_cti->update_screen(&bitmap, &cliprect);
123   m_cti->update_screen(&bitmap, cliprect);
124124
125125   return 0;
126126}
src/mess/drivers/phc25.c
r13798r13799
327327
328328bool phc25_state::screen_update(screen_device &screen, bitmap_t &bitmap, const rectangle &cliprect)
329329{
330   return m_vdg->update(&bitmap, &cliprect);
330   return m_vdg->update(&bitmap, cliprect);
331331}
332332
333333/* AY-3-8910 Interface */
src/mess/drivers/p2000t.c
r13798r13799
213213{
214214   device_t *saa5050 = screen.machine().device("saa5050");
215215
216   saa5050_update(saa5050, bitmap, NULL);
216   saa5050_update(saa5050, bitmap, cliprect);
217217   return 0;
218218}
219219
src/mess/drivers/studio2.c
r13798r13799
309309
310310bool studio2_state::screen_update(screen_device &screen, bitmap_t &bitmap, const rectangle &cliprect)
311311{
312   m_vdc->update_screen(&bitmap, &cliprect);
312   m_vdc->update_screen(&bitmap, cliprect);
313313
314314   return 0;
315315}
r13798r13799
357357
358358bool mpt02_state::screen_update(screen_device &screen, bitmap_t &bitmap, const rectangle &cliprect)
359359{
360   m_cti->update_screen(&bitmap, &cliprect);
360   m_cti->update_screen(&bitmap, cliprect);
361361
362362   return 0;
363363}
src/mess/drivers/ql.c
r13798r13799
729729
730730bool ql_state::screen_update(screen_device &screen, bitmap_t &bitmap, const rectangle &cliprect)
731731{
732   m_zx8301->update_screen(&bitmap, &cliprect);
732   m_zx8301->update_screen(&bitmap, cliprect);
733733
734734   return 0;
735735}
src/mess/drivers/ti990_10.c
r13798r13799
153153static SCREEN_UPDATE( ti990_10 )
154154{
155155   ti990_10_state *state = screen.machine().driver_data<ti990_10_state>();
156   vdt911_refresh(state->m_terminal, bitmap, 0, 0);
156   vdt911_refresh(state->m_terminal, bitmap, cliprect, 0, 0);
157157   return 0;
158158}
159159
src/mess/drivers/qx10.c
r13798r13799
970970   bitmap.fill(0, cliprect);
971971
972972   /* graphics */
973   m_hgdc->update_screen(&bitmap, &cliprect);
973   m_hgdc->update_screen(&bitmap, cliprect);
974974
975975   return 0;
976976}
src/mess/drivers/mz2500.c
r13798r13799
166166      bitmap->pix16(y, x) = machine.pens[pen];
167167}
168168
169static void draw_80x25(running_machine &machine, bitmap_t *bitmap,const rectangle *cliprect,UINT16 map_addr)
169static void draw_80x25(running_machine &machine, bitmap_t *bitmap,const rectangle &cliprect,UINT16 map_addr)
170170{
171171   mz2500_state *state = machine.driver_data<mz2500_state>();
172172   UINT8 *vram = machine.region("maincpu")->base();
r13798r13799
257257   }
258258}
259259
260static void draw_40x25(running_machine &machine, bitmap_t *bitmap,const rectangle *cliprect,int plane,UINT16 map_addr)
260static void draw_40x25(running_machine &machine, bitmap_t *bitmap,const rectangle &cliprect,int plane,UINT16 map_addr)
261261{
262262   mz2500_state *state = machine.driver_data<mz2500_state>();
263263   UINT8 *vram = machine.region("maincpu")->base();
r13798r13799
348348   }
349349}
350350
351static void draw_cg4_screen(running_machine &machine, bitmap_t *bitmap,const rectangle *cliprect,int pri)
351static void draw_cg4_screen(running_machine &machine, bitmap_t *bitmap,const rectangle &cliprect,int pri)
352352{
353353   //mz2500_state *state = machine.driver_data<mz2500_state>();
354354   UINT32 count;
r13798r13799
390390   }
391391}
392392
393static void draw_cg16_screen(running_machine &machine, bitmap_t *bitmap,const rectangle *cliprect,int plane,int x_size,int pri)
393static void draw_cg16_screen(running_machine &machine, bitmap_t *bitmap,const rectangle &cliprect,int plane,int x_size,int pri)
394394{
395395   mz2500_state *state = machine.driver_data<mz2500_state>();
396396   UINT32 count;
r13798r13799
448448   }
449449}
450450
451static void draw_cg256_screen(running_machine &machine, bitmap_t *bitmap,const rectangle *cliprect,int plane,int pri)
451static void draw_cg256_screen(running_machine &machine, bitmap_t *bitmap,const rectangle &cliprect,int plane,int pri)
452452{
453453   mz2500_state *state = machine.driver_data<mz2500_state>();
454454   UINT32 count;
r13798r13799
506506   }
507507}
508508
509static void draw_tv_screen(running_machine &machine, bitmap_t *bitmap,const rectangle *cliprect)
509static void draw_tv_screen(running_machine &machine, bitmap_t *bitmap,const rectangle &cliprect)
510510{
511511   mz2500_state *state = machine.driver_data<mz2500_state>();
512512   UINT16 base_addr;
r13798r13799
544544   }
545545}
546546
547static void draw_cg_screen(running_machine &machine, bitmap_t *bitmap,const rectangle *cliprect,int pri)
547static void draw_cg_screen(running_machine &machine, bitmap_t *bitmap,const rectangle &cliprect,int pri)
548548{
549549   mz2500_state *state = machine.driver_data<mz2500_state>();
550550   //popmessage("%02x %02x",state->m_cg_reg[0x0e],state->m_cg_reg[0x18]);
r13798r13799
582582static SCREEN_UPDATE( mz2500 )
583583{
584584   //mz2500_state *state = screen.machine().driver_data<mz2500_state>();
585   bitmap->fill(screen.machine().pens[0], *cliprect); //TODO: correct?
585   bitmap->fill(screen.machine().pens[0], cliprect); //TODO: correct?
586586
587587   draw_cg_screen(screen.machine(),bitmap,cliprect,0);
588588   draw_tv_screen(screen.machine(),bitmap,cliprect);
src/mess/drivers/vboy.c
r13798r13799
629629static SCREEN_UPDATE( vboy_left )
630630{
631631   vboy_state *state = screen.machine().driver_data<vboy_state>();
632   state->m_screen_output->fill(state->m_vip_regs.BKCOL, *cliprect);
632   state->m_screen_output->fill(state->m_vip_regs.BKCOL, cliprect);
633633
634634   for(int i=31; i>=0; i--)
635635      if (display_world(state, i, state->m_screen_output, 0)) break;
r13798r13799
642642static SCREEN_UPDATE( vboy_right )
643643{
644644   vboy_state *state = screen.machine().driver_data<vboy_state>();
645   state->m_screen_output->fill(state->m_vip_regs.BKCOL, *cliprect);
645   state->m_screen_output->fill(state->m_vip_regs.BKCOL, cliprect);
646646
647647   for(int i=31; i>=0; i--)
648648      if (display_world(state, i, state->m_screen_output, 1)) break;
src/mess/drivers/vtech1.c
r13798r13799
616616
617617bool vtech1_state::screen_update(screen_device &screen, bitmap_t &bitmap, const rectangle &cliprect)
618618{
619   return m_mc6847->update(&bitmap, &cliprect);
619   return m_mc6847->update(&bitmap, cliprect);
620620}
621621
622622
src/mess/drivers/ax20.c
r13798r13799
4545      {
4646         UINT16 tile = m_p_vram[24 +  y * 128 + x ] & 0x7f;
4747
48         drawgfx_opaque(&bitmap, &cliprect, machine().gfx[0], tile, 0, 0, 0, x*8, y*12);
48         drawgfx_opaque(&bitmap, cliprect, machine().gfx[0], tile, 0, 0, 0, x*8, y*12);
4949      }
5050   }
5151
src/mess/drivers/tandy2k.c
r13798r13799
509509{
510510   if (m_vidouts)
511511   {
512      m_vac->update_screen(&bitmap, &cliprect);
512      m_vac->update_screen(&bitmap, cliprect);
513513   }
514514
515515   return 0;
src/mess/drivers/pasopia7.c
r13798r13799
198198   keyb_press(KEYCODE_ASTERISK, '*');
199199}
200200
201static void draw_cg4_screen(running_machine &machine, bitmap_t *bitmap,const rectangle *cliprect,int width)
201static void draw_cg4_screen(running_machine &machine, bitmap_t *bitmap,const rectangle &cliprect,int width)
202202{
203203   UINT8 *vram = machine.region("vram")->base();
204204   int x,y,xi,yi;
r13798r13799
229229   }
230230}
231231
232static void draw_tv_screen(running_machine &machine, bitmap_t *bitmap,const rectangle *cliprect,int width)
232static void draw_tv_screen(running_machine &machine, bitmap_t *bitmap,const rectangle &cliprect,int width)
233233{
234234   pasopia7_state *state = machine.driver_data<pasopia7_state>();
235235   UINT8 *vram = machine.region("vram")->base();
r13798r13799
288288   }
289289}
290290
291static void draw_mixed_screen(running_machine &machine, bitmap_t *bitmap,const rectangle *cliprect,int width)
291static void draw_mixed_screen(running_machine &machine, bitmap_t *bitmap,const rectangle &cliprect,int width)
292292{
293293   pasopia7_state *state = machine.driver_data<pasopia7_state>();
294294   UINT8 *vram = machine.region("vram")->base();
r13798r13799
373373   pasopia7_state *state = screen.machine().driver_data<pasopia7_state>();
374374   int width;
375375
376   bitmap->fill(screen.machine().pens[0], *cliprect);
376   bitmap->fill(screen.machine().pens[0], cliprect);
377377
378378   fake_keyboard_data(screen.machine());
379379
src/mess/drivers/trs80m2.c
r13798r13799
716716   }
717717   else
718718   {
719      m_crtc->update(&bitmap, &cliprect);
719      m_crtc->update(&bitmap, cliprect);
720720   }
721721
722722   return 0;
src/mess/drivers/a5105.c
r13798r13799
412412SCREEN_UPDATE_MEMBER( a5105_state )
413413{
414414   /* graphics */
415   m_hgdc->update_screen(&bitmap, &cliprect);
415   m_hgdc->update_screen(&bitmap, cliprect);
416416
417417   return 0;
418418}
src/mess/drivers/mz6500.c
r13798r13799
4040   bitmap.fill(0, cliprect);
4141
4242   /* graphics */
43   m_hgdc->update_screen(&bitmap, &cliprect);
43   m_hgdc->update_screen(&bitmap, cliprect);
4444
4545   return 0;
4646}
src/mess/drivers/bw12.c
r13798r13799
410410
411411bool bw12_state::screen_update(screen_device &screen, bitmap_t &bitmap, const rectangle &cliprect)
412412{
413   m_crtc->update( &bitmap, &cliprect);
413   m_crtc->update( &bitmap, cliprect);
414414
415415   return 0;
416416}
src/mess/drivers/ti990_4.c
r13798r13799
133133static SCREEN_UPDATE( ti990_4 )
134134{
135135   ti990_4_state *state = screen.machine().driver_data<ti990_4_state>();
136   vdt911_refresh(state->m_terminal, bitmap, 0, 0);
136   vdt911_refresh(state->m_terminal, bitmap, cliprect, 0, 0);
137137   return 0;
138138}
139139
src/mess/drivers/vt240.c
r13798r13799
106106SCREEN_UPDATE_MEMBER( vt240_state )
107107{
108108   /* graphics */
109   m_hgdc->update_screen(&bitmap, &cliprect);
109   m_hgdc->update_screen(&bitmap, cliprect);
110110
111111   return 0;
112112}
src/mess/drivers/apexc.c
r13798r13799
570570/* write a single char on screen */
571571static void apexc_draw_char(running_machine &machine, bitmap_t *bitmap, char character, int x, int y, int color)
572572{
573   drawgfx_transpen(bitmap, NULL, machine.gfx[0], character-32, color, 0, 0,
573   drawgfx_transpen(bitmap, bitmap->cliprect(), machine.gfx[0], character-32, color, 0, 0,
574574            x+1, y, 0);
575575}
576576
r13798r13799
598598   apexc_draw_string(screen.machine(), bitmap, "running", 8, 8, 0);
599599   apexc_draw_string(screen.machine(), bitmap, "data :", 0, 24, 0);
600600
601   copybitmap(bitmap, state->m_bitmap, 0, 0, 0, 0, &teletyper_window);
601   copybitmap(bitmap, state->m_bitmap, 0, 0, 0, 0, teletyper_window);
602602
603603
604604   apexc_draw_led(bitmap, 0, 0, 1);
src/mess/drivers/pc2000.c
r13798r13799
5252
5353bool pc2000_state::screen_update(screen_device &screen, bitmap_t &bitmap, const rectangle &cliprect)
5454{
55   return m_lcdc->video_update( &bitmap, &cliprect );
55   return m_lcdc->video_update( &bitmap, cliprect );
5656}
5757
5858/* TODO: put a breakpoint at 1625 and test the inputs, writes at dce4 are the scancode values */
src/mess/drivers/victor9k.c
r13798r13799
128128
129129bool victor9k_state::screen_update(screen_device &screen, bitmap_t &bitmap, const rectangle &cliprect)
130130{
131   m_crtc->update(&bitmap, &cliprect);
131   m_crtc->update(&bitmap, cliprect);
132132
133133   return 0;
134134}
src/mess/drivers/pc8001.c
r13798r13799
320320
321321bool pc8001_state::screen_update(screen_device &screen, bitmap_t &bitmap, const rectangle &cliprect)
322322{
323   m_crtc->update_screen(&bitmap, &cliprect);
323   m_crtc->update_screen(&bitmap, cliprect);
324324
325325   return 0;
326326}
src/mess/drivers/px4.c
r13798r13799
10641064   else
10651065   {
10661066      /* display is disabled, draw an empty screen */
1067      bitmap->fill(0, *cliprect);
1067      bitmap->fill(0, cliprect);
10681068   }
10691069
10701070   return 0;
src/mess/drivers/pc8801.c
r13798r13799
591591static SCREEN_UPDATE( pc8801 )
592592{
593593   pc8801_state *state = screen.machine().driver_data<pc8801_state>();
594   bitmap->fill(screen.machine().pens[0], *cliprect);
594   bitmap->fill(screen.machine().pens[0], cliprect);
595595
596596   if(state->m_gfx_ctrl & 8)
597597   {
src/mess/drivers/bw2.c
r13798r13799
566566
567567bool bw2_state::screen_update(screen_device &screen, bitmap_t &bitmap, const rectangle &cliprect)
568568{
569   m_lcdc->update_screen(&bitmap, &cliprect);
569   m_lcdc->update_screen(&bitmap, cliprect);
570570
571571   return 0;
572572}
src/mess/drivers/jr200.c
r13798r13799
103103   jr200_state *state = screen.machine().driver_data<jr200_state>();
104104   int x,y,xi,yi,pen;
105105
106   bitmap->fill(state->m_border_col, *cliprect);
106   bitmap->fill(state->m_border_col, cliprect);
107107
108108   for (y = 0; y < 24; y++)
109109   {
src/mess/drivers/mc10.c
r13798r13799
227227bool mc10_state::screen_update(screen_device &screen, bitmap_t &bitmap, const rectangle &cliprect)
228228{
229229   if (m_mc6847)      //mc10, alice
230      return m_mc6847->update(&bitmap, &cliprect);
230      return m_mc6847->update(&bitmap, cliprect);
231231   else if (m_ef9345)   //alice32
232      m_ef9345->video_update(&bitmap, &cliprect);
232      m_ef9345->video_update(&bitmap, cliprect);
233233
234234   return 0;
235235}
src/mess/drivers/atom.c
r13798r13799
348348
349349bool atom_state::screen_update(screen_device &screen, bitmap_t &bitmap, const rectangle &cliprect)
350350{
351   return m_vdg->update(&bitmap, &cliprect);
351   return m_vdg->update(&bitmap, cliprect);
352352}
353353
354354/***************************************************************************
src/mess/drivers/apricot.c
r13798r13799
188188   if (!state->m_display_on)
189189      state->m_crtc->update( bitmap, cliprect);
190190   else
191      bitmap->fill(0, *cliprect);
191      bitmap->fill(0, cliprect);
192192
193193   return 0;
194194}
src/mess/drivers/dim68k.c
r13798r13799
218218
219219SCREEN_UPDATE_MEMBER( dim68k_state )
220220{
221   m_crtc->update( &bitmap, &cliprect);
221   m_crtc->update( &bitmap, cliprect);
222222   return 0;
223223}
224224
src/mess/drivers/apf.c
r13798r13799
149149
150150bool apf_state::screen_update(screen_device &screen, bitmap_t &bitmap, const rectangle &cliprect)
151151{
152   return m_crtc->update(&bitmap, &cliprect);
152   return m_crtc->update(&bitmap, cliprect);
153153}
154154
155155READ8_MEMBER( apf_state::apf_m1000_pia_in_a_func)
src/mess/drivers/supracan.c
r13798r13799
462462
463463
464464
465static void draw_sprites(running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect)
465static void draw_sprites(running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect)
466466{
467467   supracan_state *state = machine.driver_data<supracan_state>();
468468   UINT16 *supracan_vram = state->m_vram;
r13798r13799
634634
635635
636636/* draws ROZ with linescroll OR columnscroll to 16-bit indexed bitmap */
637static void supracan_suprnova_draw_roz(running_machine &machine, bitmap_t* bitmap, const rectangle *cliprect, tilemap_t *tmap, UINT32 startx, UINT32 starty, int incxx, int incxy, int incyx, int incyy, int wraparound/*, int columnscroll, UINT32* scrollram*/, int transmask)
637static void supracan_suprnova_draw_roz(running_machine &machine, bitmap_t* bitmap, const rectangle &cliprect, tilemap_t *tmap, UINT32 startx, UINT32 starty, int incxx, int incxy, int incyx, int incyy, int wraparound/*, int columnscroll, UINT32* scrollram*/, int transmask)
638638{
639639   //bitmap_t *destbitmap = bitmap;
640640   bitmap_t *srcbitmap = tilemap_get_pixmap(tmap);
r13798r13799
658658   //int destadvance = destbitmap->bpp / 8;
659659
660660   /* pre-advance based on the cliprect */
661   startx += cliprect->min_x * incxx + cliprect->min_y * incyx;
662   starty += cliprect->min_x * incxy + cliprect->min_y * incyy;
661   startx += cliprect.min_x * incxx + cliprect.min_y * incyx;
662   starty += cliprect.min_x * incxy + cliprect.min_y * incyy;
663663
664664   /* extract start/end points */
665   sx = cliprect->min_x;
666   sy = cliprect->min_y;
667   ex = cliprect->max_x;
668   ey = cliprect->max_y;
665   sx = cliprect.min_x;
666   sy = cliprect.min_y;
667   ex = cliprect.max_x;
668   ey = cliprect.max_y;
669669
670670   {
671671      /* loop over rows */
r13798r13799
768768
769769   if (0)
770770   {
771      if (cliprect->min_y == 0x00)
771      if (cliprect.min_y == 0x00)
772772      {
773773         const rectangle &visarea = screen.visible_area();
774774
775775         state->m_sprite_final_bitmap->fill(0x00, visarea);
776776         bitmap->fill(0x80, visarea);
777777
778         draw_sprites(screen.machine(), state->m_sprite_final_bitmap, &visarea);
778         draw_sprites(screen.machine(), state->m_sprite_final_bitmap, visarea);
779779      }
780780   }
781781   else
782782   {
783783
784      state->m_sprite_final_bitmap->fill(0x00, *cliprect);
785      bitmap->fill(0x80, *cliprect);
784      state->m_sprite_final_bitmap->fill(0x00, cliprect);
785      bitmap->fill(0x80, cliprect);
786786
787787      draw_sprites(screen.machine(), state->m_sprite_final_bitmap, cliprect);
788788   }
r13798r13799
858858                  int y,x;
859859                  // yes, it will draw a single line if you specify a cliprect as such (partial updates...)
860860
861                  for (y=cliprect->min_y;y<=cliprect->max_y;y++)
861                  for (y=cliprect.min_y;y<=cliprect.max_y;y++)
862862                  {
863863                     // these will have to change to ADDR32 etc. once alpha blending is supported
864864                     UINT16* screen = &bitmap->pix16(y);
r13798r13799
874874
875875                     UINT16* src = &src_bitmap->pix16((realy)&((ysize*8)-1));
876876
877                     for (x=cliprect->min_x;x<=cliprect->max_x;x++)
877                     for (x=cliprect.min_x;x<=cliprect.max_x;x++)
878878                     {
879879                        int actualx = x & mosaic_mask;
880880                        int realx = actualx+scrollx;
r13798r13799
929929                  if (!(state->m_roz_mode & 0x0200) && (state->m_roz_mode&0xf000) ) // HACK - Not Trusted, Acan Logo, Speedy Dragon Intro ,Speed Dragon Bonus stage need it.  Monopoly and JTT *don't* causes graphical issues
930930                  {
931931                     // NOT accurate, causes issues when the attract mode loops and the logo is shown the 2nd time in some games - investigate
932                     for (int y=cliprect->min_y;y<=cliprect->max_y;y++)
932                     for (int y=cliprect.min_y;y<=cliprect.max_y;y++)
933933                     {
934934                        rectangle clip;
935                        clip.min_x = cliprect->min_x;
936                        clip.max_x = cliprect->max_x;
935                        clip.min_x = cliprect.min_x;
936                        clip.max_x = cliprect.max_x;
937937
938938                        clip.min_y = clip.max_y = y;
939939
r13798r13799
953953
954954
955955                        if (state->m_vram[state->m_roz_unk_base0/2 + y]) // incxx = 0, no draw?
956                           supracan_suprnova_draw_roz(screen.machine(), bitmap, &clip, state->m_tilemap_sizes[layer][which_tilemap_size], scrollx<<8, scrolly<<8, incxx<<8, incxy<<8, incyx<<8, incyy<<8, wrap, transmask);
956                           supracan_suprnova_draw_roz(screen.machine(), bitmap, clip, state->m_tilemap_sizes[layer][which_tilemap_size], scrollx<<8, scrolly<<8, incxx<<8, incxy<<8, incyx<<8, incyy<<8, wrap, transmask);
957957                     }
958958                  }
959959                  else
r13798r13799
970970   // just draw the sprites on top for now
971971   if(state->m_video_flags & 0x08)
972972   {
973      for (int y=cliprect->min_y;y<=cliprect->max_y;y++)
973      for (int y=cliprect.min_y;y<=cliprect.max_y;y++)
974974      {
975975         UINT16* src = &state->m_sprite_final_bitmap->pix16(y);
976976         UINT16* dst = &bitmap->pix16(y);
977977
978         for (int x=cliprect->min_x;x<=cliprect->max_x;x++)
978         for (int x=cliprect.min_x;x<=cliprect.max_x;x++)
979979         {
980980            UINT16 dat = src[x];
981981            if (dat) dst[x] = dat;
src/mess/drivers/tmc2000e.c
r13798r13799
150150
151151bool tmc2000e_state::screen_update(screen_device &screen, bitmap_t &bitmap, const rectangle &cliprect)
152152{
153   m_cti->update_screen(&bitmap, &cliprect);
153   m_cti->update_screen(&bitmap, cliprect);
154154
155155   return 0;
156156}
src/mess/drivers/vg5k.c
r13798r13799
308308
309309bool vg5k_state::screen_update(screen_device &screen, bitmap_t &bitmap, const rectangle &cliprect)
310310{
311   m_ef9345->video_update(&bitmap, &cliprect);
311   m_ef9345->video_update(&bitmap, cliprect);
312312
313313   return 0;
314314}
src/mess/drivers/scv.c
r13798r13799
558558   int clip_y = state->m_p_videoram[0x1402] >> 4;
559559
560560   /* Clear the screen */
561   bitmap->fill(gr_bg , *cliprect);
561   bitmap->fill(gr_bg , cliprect);
562562
563563   /* Draw background */
564564   for ( y = 0; y < 16; y++ )
src/mess/drivers/h19.c
r13798r13799
307307
308308SCREEN_UPDATE_MEMBER( h19_state )
309309{
310   m_crtc->update( &bitmap, &cliprect);
310   m_crtc->update( &bitmap, cliprect);
311311   return 0;
312312}
313313
src/mess/drivers/zrt80.c
r13798r13799
199199
200200SCREEN_UPDATE_MEMBER( zrt80_state )
201201{
202   m_crtc->update(&bitmap, &cliprect);
202   m_crtc->update(&bitmap, cliprect);
203203   return 0;
204204}
205205
src/mess/drivers/micronic.c
r13798r13799
323323
324324bool micronic_state::screen_update(screen_device &screen, bitmap_t &bitmap, const rectangle &cliprect)
325325{
326   m_lcdc->update_screen(&bitmap, &cliprect);
326   m_lcdc->update_screen(&bitmap, cliprect);
327327
328328   return 0;
329329}
src/mess/drivers/alphatro.c
r13798r13799
144144
145145SCREEN_UPDATE_MEMBER( alphatro_state )
146146{
147   m_crtc->update( &bitmap, &cliprect);
147   m_crtc->update( &bitmap, cliprect);
148148   return 0;
149149}
150150
src/mess/drivers/cosmicos.c
r13798r13799
396396
397397bool cosmicos_state::screen_update(screen_device &screen, bitmap_t &bitmap, const rectangle &cliprect)
398398{
399   m_cti->update_screen(&bitmap, &cliprect);
399   m_cti->update_screen(&bitmap, cliprect);
400400
401401   return 0;
402402}
src/mess/drivers/psion.c
r13798r13799
445445
446446bool psion_state::screen_update(screen_device &screen, bitmap_t &bitmap, const rectangle &cliprect)
447447{
448   return m_lcdc->video_update( &bitmap, &cliprect );
448   return m_lcdc->video_update( &bitmap, cliprect );
449449}
450450
451451static PALETTE_INIT( psion )

Previous 15994 Revisions Next


© 1998-2018 The MESS Team