| 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 |
| r13798 | r13799 | |
|---|---|---|
| 74 | 74 | |
| 75 | 75 | void skns_sprite_kludge(int x, int y); |
| 76 | 76 | void skns_draw_sprites( |
| 77 | running_machine &machine, bitmap_t *bitmap, const rectangle | |
| 77 | running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect, | |
| 78 | 78 | UINT32* spriteram_source, size_t spriteram_size, |
| 79 | 79 | UINT8* gfx_source, size_t gfx_length, |
| 80 | 80 | UINT32* sprite_regs ); |
| r13798 | r13799 | |
|---|---|---|
| 165 | 165 | READ16_HANDLER ( kaneko16_sprites_regs_r ); |
| 166 | 166 | WRITE16_HANDLER( kaneko16_sprites_regs_w ); |
| 167 | 167 | |
| 168 | void kaneko16_draw_sprites(running_machine &machine, bitmap_t *bitmap, const rectangle | |
| 168 | void kaneko16_draw_sprites(running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect); | |
| 169 | 169 | |
| 170 | 170 | READ16_HANDLER ( kaneko16_bg15_select_r ); |
| 171 | 171 | WRITE16_HANDLER( kaneko16_bg15_select_w ); |
| r13798 | r13799 | |
|---|---|---|
| 28 | 28 | /* video extension callbacks */ |
| 29 | 29 | typedef void (*galaxian_extend_tile_info_func)(running_machine &machine, UINT16 *code, UINT8 *color, UINT8 attrib, UINT8 x); |
| 30 | 30 | typedef void (*galaxian_extend_sprite_info_func)(running_machine &machine, const UINT8 *base, UINT8 *sx, UINT8 *sy, UINT8 *flipx, UINT8 *flipy, UINT16 *code, UINT8 *color); |
| 31 | typedef void (*galaxian_draw_bullet_func)(running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect, int offs, int x, int y); | |
| 32 | typedef void (*galaxian_draw_background_func)(running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect); | |
| 31 | typedef void (*galaxian_draw_bullet_func)(running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect, int offs, int x, int y); | |
| 32 | typedef void (*galaxian_draw_background_func)(running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect); | |
| 33 | 33 | |
| 34 | 34 | |
| 35 | 35 | class galaxian_state : public driver_device |
| r13798 | r13799 | |
| 105 | 105 | TIMER_DEVICE_CALLBACK( galaxian_stars_blink_timer ); |
| 106 | 106 | |
| 107 | 107 | /* special purpose background rendering */ |
| 108 | void galaxian_draw_background(running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect); | |
| 109 | void 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); | |
| 111 | void turtles_draw_background(running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect); | |
| 112 | void scramble_draw_background(running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect); | |
| 113 | void anteater_draw_background(running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect); | |
| 114 | void jumpbug_draw_background(running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect); | |
| 108 | void galaxian_draw_background(running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect); | |
| 109 | void 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); | |
| 111 | void turtles_draw_background(running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect); | |
| 112 | void scramble_draw_background(running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect); | |
| 113 | void anteater_draw_background(running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect); | |
| 114 | void jumpbug_draw_background(running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect); | |
| 115 | 115 | |
| 116 | 116 | /* special purpose bullet rendering */ |
| 117 | void galaxian_draw_bullet(running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect, int offs, int x, int y); | |
| 118 | void mshuttle_draw_bullet(running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect, int offs, int x, int y); | |
| 119 | void scramble_draw_bullet(running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect, int offs, int x, int y); | |
| 120 | void theend_draw_bullet(running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect, int offs, int x, int y); | |
| 117 | void galaxian_draw_bullet(running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect, int offs, int x, int y); | |
| 118 | void mshuttle_draw_bullet(running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect, int offs, int x, int y); | |
| 119 | void scramble_draw_bullet(running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect, int offs, int x, int y); | |
| 120 | void theend_draw_bullet(running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect, int offs, int x, int y); | |
| 121 | 121 | |
| 122 | 122 | /* generic extensions */ |
| 123 | 123 | void upper_extend_tile_info(running_machine &machine, UINT16 *code, UINT8 *color, UINT8 attrib, UINT8 x); |
| r13798 | r13799 | |
|---|---|---|
| 109 | 109 | |
| 110 | 110 | UINT16 cop_hit_status; |
| 111 | 111 | |
| 112 | void draw_sprites(running_machine &machine, bitmap_t *bitmap, const rectangle | |
| 112 | void draw_sprites(running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect ,int pri_mask ); | |
| 113 | 113 | UINT8 cop_calculate_collsion_detection(running_machine &machine); |
| 114 | 114 | |
| 115 | 115 | }; |
| r13798 | r13799 | |
|---|---|---|
| 31 | 31 | DECLARE_WRITE8_MEMBER(attributes_w); |
| 32 | 32 | DECLARE_WRITE8_MEMBER(flipscreen_w); |
| 33 | 33 | |
| 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); | |
| 36 | 36 | |
| 37 | 37 | // devices |
| 38 | 38 | required_device<z80_device> m_maincpu; |
| r13798 | r13799 | |
|---|---|---|
| 57 | 57 | READ8_HANDLER (st0016_vregs_r); |
| 58 | 58 | WRITE8_HANDLER (st0016_vregs_w); |
| 59 | 59 | |
| 60 | void st0016_draw_screen(screen_device &screen, bitmap_t *bitmap, const rectangle | |
| 60 | void st0016_draw_screen(screen_device &screen, bitmap_t *bitmap, const rectangle &cliprect); | |
| 61 | 61 | VIDEO_START(st0016); |
| 62 | 62 | SCREEN_UPDATE(st0016); |
| r13798 | r13799 | |
|---|---|---|
| 56 | 56 | |
| 57 | 57 | UINT8 m_timer_adjusted; |
| 58 | 58 | UINT8 m_darkplnt_bullet_color; |
| 59 | void (*m_draw_bullets)(running_machine &,bitmap_t *,const rectangle | |
| 59 | void (*m_draw_bullets)(running_machine &,bitmap_t *,const rectangle &, int, int, int); /* function to call to draw a bullet */ | |
| 60 | 60 | |
| 61 | 61 | UINT8 m_background_enable; |
| 62 | 62 | UINT8 m_background_red; |
| 63 | 63 | UINT8 m_background_green; |
| 64 | 64 | UINT8 m_background_blue; |
| 65 | void (*m_draw_background)(running_machine &machine, bitmap_t *bitmap, const rectangle | |
| 65 | void (*m_draw_background)(running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect); /* function to call to draw the background */ | |
| 66 | 66 | UINT16 m_rockclim_v; |
| 67 | 67 | UINT16 m_rockclim_h; |
| 68 | 68 | int m_dambustr_bg_split_line; |
| r13798 | r13799 | |
| 72 | 72 | int m_dambustr_char_bank; |
| 73 | 73 | bitmap_t *m_dambustr_tmpbitmap; |
| 74 | 74 | |
| 75 | void (*m_draw_stars)(running_machine &machine, bitmap_t *, const rectangle | |
| 75 | void (*m_draw_stars)(running_machine &machine, bitmap_t *, const rectangle &); /* function to call to draw the star layer */ | |
| 76 | 76 | int m_stars_colors_start; |
| 77 | 77 | INT32 m_stars_scrollpos; |
| 78 | 78 | UINT8 m_stars_on; |
| r13798 | r13799 | |
| 142 | 142 | VIDEO_START( ad2083 ); |
| 143 | 143 | |
| 144 | 144 | void galaxold_init_stars(running_machine &machine, int colors_offset); |
| 145 | void galaxold_draw_stars(running_machine &machine, bitmap_t *bitmap, const rectangle | |
| 145 | void galaxold_draw_stars(running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect); | |
| 146 | 146 | |
| 147 | 147 | SCREEN_UPDATE( galaxold ); |
| 148 | 148 | SCREEN_UPDATE( dambustr ); |
| r13798 | r13799 | |
|---|---|---|
| 98 | 98 | |
| 99 | 99 | SCREEN_UPDATE( metro ); |
| 100 | 100 | |
| 101 | void metro_draw_sprites(running_machine &machine, bitmap_t *bitmap, const rectangle | |
| 101 | void metro_draw_sprites(running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect); |
| r13798 | r13799 | |
|---|---|---|
| 18 | 18 | |
| 19 | 19 | PALETTE_INIT( pk8000 ); |
| 20 | 20 | |
| 21 | UINT32 pk8000_video_update(screen_device &screen, bitmap_t *bitmap, const rectangle | |
| 21 | UINT32 pk8000_video_update(screen_device &screen, bitmap_t *bitmap, const rectangle &cliprect, UINT8 *videomem); |
| r13798 | r13799 | |
|---|---|---|
| 93 | 93 | void namco_tilemap_init( |
| 94 | 94 | running_machine &machine, int gfxbank, void *pMaskROM, |
| 95 | 95 | void (*cb)( running_machine &machine, UINT16 code, int *gfx, int *mask) ); |
| 96 | void namco_tilemap_draw( bitmap_t *bitmap, const rectangle | |
| 96 | void namco_tilemap_draw( bitmap_t *bitmap, const rectangle &cliprect, int pri ); | |
| 97 | 97 | void namco_tilemap_invalidate( void ); |
| 98 | 98 | WRITE16_HANDLER( namco_tilemapvideoram16_w ); |
| 99 | 99 | READ16_HANDLER( namco_tilemapvideoram16_r ); |
| r13798 | r13799 | |
| 113 | 113 | /***********************************************************************************/ |
| 114 | 114 | |
| 115 | 115 | /* Namco System II Sprite Rendering */ |
| 116 | void namcos2_draw_sprites( running_machine &machine, bitmap_t *bitmap, const rectangle | |
| 116 | void namcos2_draw_sprites( running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect, int pri, int control ); | |
| 117 | 117 | |
| 118 | void namcos2_draw_sprites_metalhawk( running_machine &machine, bitmap_t *bitmap, const rectangle | |
| 118 | void namcos2_draw_sprites_metalhawk( running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect, int pri ); | |
| 119 | 119 | |
| 120 | 120 | /***********************************************************************************/ |
| 121 | 121 | /* C355 Motion Object Emulation */ |
| 122 | 122 | |
| 123 | 123 | /* for palXOR, supply either 0x0 (normal) or 0xf (palette mapping reversed) */ |
| 124 | 124 | void namco_obj_init( running_machine &machine, int gfxbank, int palXOR, int (*code2tile)( running_machine &machine, int code ) ); |
| 125 | void namco_obj_draw( running_machine &machine, bitmap_t *bitmap, const rectangle | |
| 125 | void namco_obj_draw( running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect, int pri ); | |
| 126 | 126 | |
| 127 | 127 | WRITE16_HANDLER( namco_obj16_w ); |
| 128 | 128 | READ16_HANDLER( namco_obj16_r ); |
| r13798 | r13799 | |
| 142 | 142 | /* C169 ROZ Layer Emulation */ |
| 143 | 143 | |
| 144 | 144 | void namco_roz_init( running_machine &machine, int gfxbank, const char *maskregion ); |
| 145 | void namco_roz_draw( bitmap_t *bitmap, const rectangle | |
| 145 | void namco_roz_draw( bitmap_t *bitmap, const rectangle &cliprect, int pri ); | |
| 146 | 146 | |
| 147 | 147 | READ16_HANDLER( namco_rozcontrol16_r ); |
| 148 | 148 | WRITE16_HANDLER( namco_rozcontrol16_w ); |
| r13798 | r13799 | |
| 165 | 165 | |
| 166 | 166 | void namco_road_init( running_machine &machine, int gfxbank ); |
| 167 | 167 | void namco_road_set_transparent_color(pen_t pen); |
| 168 | void namco_road_draw( running_machine &machine, bitmap_t *bitmap, const rectangle | |
| 168 | void namco_road_draw( running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect, int pri ); | |
| 169 | 169 | |
| 170 | 170 | READ16_HANDLER( namco_road16_r ); |
| 171 | 171 | WRITE16_HANDLER( namco_road16_w ); |
| r13798 | r13799 | |
|---|---|---|
| 73 | 73 | #define GXSUB_5BPP 0x05 // 32 colors |
| 74 | 74 | #define GXSUB_8BPP 0x08 // 256 colors |
| 75 | 75 | |
| 76 | void konamigx_mixer(running_machine &machine, bitmap_t *bitmap, const rectangle | |
| 76 | void konamigx_mixer(running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect, | |
| 77 | 77 | tilemap_t *sub1, int sub1flags, |
| 78 | 78 | tilemap_t *sub2, int sub2flags, |
| 79 | 79 | int mixerflags, bitmap_t* extra_bitmap, int rushingheroes_hack); |
| r13798 | r13799 | |
|---|---|---|
| 80 | 80 | void redclash_set_stars_enable(running_machine &machine, UINT8 on); |
| 81 | 81 | void redclash_update_stars_state(running_machine &machine); |
| 82 | 82 | void redclash_set_stars_speed(running_machine &machine, UINT8 speed); |
| 83 | void redclash_draw_stars(running_machine &machine, bitmap_t *bitmap, const rectangle | |
| 83 | void redclash_draw_stars(running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect, UINT8 palette_offset, UINT8 sraider, UINT8 firstx, UINT8 lastx); |
| r13798 | r13799 | |
|---|---|---|
| 51 | 51 | virtual void machine_reset(); |
| 52 | 52 | |
| 53 | 53 | virtual void video_start(); |
| 54 | virtual bool screen_update(screen_device &screen, bitmap_t &bitmap, const rectangle &cliprect) { m_vis->update_screen(&bitmap, | |
| 54 | virtual bool screen_update(screen_device &screen, bitmap_t &bitmap, const rectangle &cliprect) { m_vis->update_screen(&bitmap, | |
| 55 | 55 | |
| 56 | 56 | DECLARE_WRITE8_MEMBER( cdp1869_w ); |
| 57 | 57 | DECLARE_WRITE8_MEMBER( destryer_out1_w ); |
| r13798 | r13799 | |
|---|---|---|
| 7 | 7 | extern UINT8 genesis_vdp_regs[32]; |
| 8 | 8 | |
| 9 | 9 | void system18_vdp_start(running_machine &machine); |
| 10 | void system18_vdp_update(bitmap_t *bitmap, const rectangle | |
| 10 | void system18_vdp_update(bitmap_t *bitmap, const rectangle &cliprect); | |
| 11 | 11 | |
| 12 | 12 | READ16_HANDLER ( genesis_vdp_r ); |
| 13 | 13 | WRITE16_HANDLER( genesis_vdp_w ); |
| r13798 | r13799 | |
|---|---|---|
| 105 | 105 | 3 | xx------ -------- | not used? |
| 106 | 106 | */ |
| 107 | 107 | |
| 108 | static void draw_sprites(running_machine &machine, bitmap_t *bitmap, const rectangle | |
| 108 | static void draw_sprites(running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect) | |
| 109 | 109 | { |
| 110 | 110 | targeth_state *state = machine.driver_data<targeth_state>(); |
| 111 | 111 | int i; |
| r13798 | r13799 | |
|---|---|---|
| 167 | 167 | tilemap_set_scrolly(state->m_bg_tilemap, offset, data); |
| 168 | 168 | } |
| 169 | 169 | |
| 170 | static void draw_sprites( running_machine &machine, bitmap_t *bitmap, const rectangle | |
| 170 | static void draw_sprites( running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect, int pri ) | |
| 171 | 171 | { |
| 172 | 172 | nycaptor_state *state = machine.driver_data<nycaptor_state>(); |
| 173 | 173 | int i; |
| r13798 | r13799 | |
|---|---|---|
| 52 | 52 | layer[0] = 0; |
| 53 | 53 | layer[1] = 1; |
| 54 | 54 | |
| 55 | screen.machine().priority_bitmap->fill(0, | |
| 55 | screen.machine().priority_bitmap->fill(0, | |
| 56 | 56 | |
| 57 | 57 | pc080sn_tilemap_draw(state->m_pc080sn, bitmap, cliprect, layer[0], TILEMAP_DRAW_OPAQUE, 1); |
| 58 | 58 | pc080sn_tilemap_draw(state->m_pc080sn, bitmap, cliprect, layer[1], 0, 2); |
| r13798 | r13799 | |
| 102 | 102 | layer[0] = 0; |
| 103 | 103 | layer[1] = 1; |
| 104 | 104 | |
| 105 | screen.machine().priority_bitmap->fill(0, | |
| 105 | screen.machine().priority_bitmap->fill(0, | |
| 106 | 106 | |
| 107 | 107 | pc080sn_tilemap_draw(state->m_pc080sn, bitmap, cliprect, layer[0], TILEMAP_DRAW_OPAQUE, 0); |
| 108 | 108 |
| r13798 | r13799 | |
|---|---|---|
| 300 | 300 | |
| 301 | 301 | ***************************************************************************/ |
| 302 | 302 | |
| 303 | static void draw_sprites( running_machine &machine, bitmap_t *bitmap, const rectangle | |
| 303 | static void draw_sprites( running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect ) | |
| 304 | 304 | { |
| 305 | 305 | mitchell_state *state = machine.driver_data<mitchell_state>(); |
| 306 | 306 | int offs, sx, sy; |
| r13798 | r13799 | |
| 332 | 332 | { |
| 333 | 333 | mitchell_state *state = screen.machine().driver_data<mitchell_state>(); |
| 334 | 334 | |
| 335 | bitmap->fill(0, | |
| 335 | bitmap->fill(0, | |
| 336 | 336 | tilemap_draw(bitmap, cliprect, state->m_bg_tilemap, 0, 0); |
| 337 | 337 | draw_sprites(screen.machine(), bitmap, cliprect); |
| 338 | 338 | return 0; |
| r13798 | r13799 | |
|---|---|---|
| 29 | 29 | * 4 | xxxxxxxxxxxxxxxx | x position |
| 30 | 30 | * 5,6,7| | unused |
| 31 | 31 | */ |
| 32 | static void draw_sprites( running_machine &machine, bitmap_t *bitmap, const rectangle | |
| 32 | static void draw_sprites( running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect, int priority ) | |
| 33 | 33 | { |
| 34 | 34 | galspnbl_state *state = machine.driver_data<galspnbl_state>(); |
| 35 | 35 | UINT16 *spriteram = state->m_spriteram; |
| r13798 | r13799 | |
| 84 | 84 | } |
| 85 | 85 | |
| 86 | 86 | |
| 87 | static void draw_background( running_machine &machine, bitmap_t *bitmap, const rectangle | |
| 87 | static void draw_background( running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect ) | |
| 88 | 88 | { |
| 89 | 89 | galspnbl_state *state = machine.driver_data<galspnbl_state>(); |
| 90 | 90 | offs_t offs; |
| r13798 | r13799 | |
|---|---|---|
| 414 | 414 | |
| 415 | 415 | ***************************************************************************/ |
| 416 | 416 | |
| 417 | static void draw_sprites(running_machine &machine, bitmap_t *bitmap,const rectangle | |
| 417 | static void draw_sprites(running_machine &machine, bitmap_t *bitmap,const rectangle &cliprect) | |
| 418 | 418 | { |
| 419 | 419 | xevious_state *state = machine.driver_data<xevious_state>(); |
| 420 | 420 |
| r13798 | r13799 | |
|---|---|---|
| 199 | 199 | |
| 200 | 200 | ***************************************************************************/ |
| 201 | 201 | |
| 202 | static void draw_sprites( running_machine &machine, bitmap_t *bitmap, const rectangle | |
| 202 | static void draw_sprites( running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect ) | |
| 203 | 203 | { |
| 204 | 204 | // blktiger_state *state = machine.driver_data<blktiger_state>(); |
| 205 | 205 | UINT8 *buffered_spriteram = machine.generic.buffered_spriteram.u8; |
| r13798 | r13799 | |
| 234 | 234 | { |
| 235 | 235 | blktiger_state *state = screen.machine().driver_data<blktiger_state>(); |
| 236 | 236 | |
| 237 | bitmap->fill(1023, | |
| 237 | bitmap->fill(1023, | |
| 238 | 238 | |
| 239 | 239 | if (state->m_bgon) |
| 240 | 240 | tilemap_draw(bitmap, cliprect, state->m_screen_layout ? state->m_bg_tilemap8x4 : state->m_bg_tilemap4x8, TILEMAP_DRAW_LAYER1, 0); |
| r13798 | r13799 | |
|---|---|---|
| 137 | 137 | } |
| 138 | 138 | } |
| 139 | 139 | |
| 140 | static void draw_sprites(running_machine &machine, bitmap_t *bitmap,const rectangle | |
| 140 | static void draw_sprites(running_machine &machine, bitmap_t *bitmap,const rectangle &cliprect,int pri) | |
| 141 | 141 | { |
| 142 | 142 | dynduke_state *state = machine.driver_data<dynduke_state>(); |
| 143 | 143 | UINT16 *buffered_spriteram16 = machine.generic.buffered_spriteram.u16; |
| r13798 | r13799 | |
| 175 | 175 | } |
| 176 | 176 | } |
| 177 | 177 | |
| 178 | static void draw_background(running_machine &machine, bitmap_t *bitmap, const rectangle | |
| 178 | static void draw_background(running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect, int pri ) | |
| 179 | 179 | { |
| 180 | 180 | dynduke_state *state = machine.driver_data<dynduke_state>(); |
| 181 | 181 | /* The transparency / palette handling on the background layer is very strange */ |
| r13798 | r13799 | |
| 186 | 186 | /* if we're disabled, don't draw */ |
| 187 | 187 | if (!state->m_back_enable) |
| 188 | 188 | { |
| 189 | bitmap->fill(get_black_pen(machine), | |
| 189 | bitmap->fill(get_black_pen(machine), | |
| 190 | 190 | return; |
| 191 | 191 | } |
| 192 | 192 |
| r13798 | r13799 | |
|---|---|---|
| 217 | 217 | } |
| 218 | 218 | } |
| 219 | 219 | |
| 220 | static void draw_sprites(running_machine& machine, bitmap_t *bitmap,const rectangle | |
| 220 | static void draw_sprites(running_machine& machine, bitmap_t *bitmap,const rectangle &cliprect) | |
| 221 | 221 | { |
| 222 | 222 | deco_mlc_state *state = machine.driver_data<deco_mlc_state>(); |
| 223 | 223 | UINT32 *index_ptr=0; |
| r13798 | r13799 | |
| 310 | 310 | user_clip.min_x=state->m_mlc_clip_ram[(clipper*4)+2]; |
| 311 | 311 | user_clip.max_x=state->m_mlc_clip_ram[(clipper*4)+3]; |
| 312 | 312 | |
| 313 | user_clip &= | |
| 313 | user_clip &= | |
| 314 | 314 | |
| 315 | 315 | /* Any colours out of range (for the bpp value) trigger 'shadow' mode */ |
| 316 | 316 | if (color & (state->m_colour_mask+1)) |
| r13798 | r13799 | |
| 491 | 491 | // if (lastRasterMode!=0 && rasterDirty) |
| 492 | 492 | // { |
| 493 | 493 | // blitRaster(machine, bitmap, rasterMode); |
| 494 | // temp_bitmap->fill(0, | |
| 494 | // temp_bitmap->fill(0, | |
| 495 | 495 | // rasterDirty=0; |
| 496 | 496 | // } |
| 497 | 497 | // lastRasterMode=rasterMode; |
| r13798 | r13799 | |
| 514 | 514 | |
| 515 | 515 | SCREEN_UPDATE( mlc ) |
| 516 | 516 | { |
| 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 */ | |
| 519 | 519 | draw_sprites(screen.machine(),bitmap,cliprect); |
| 520 | 520 | return 0; |
| 521 | 521 | } |
| r13798 | r13799 | |
|---|---|---|
| 200 | 200 | } |
| 201 | 201 | } |
| 202 | 202 | |
| 203 | static void draw_motion_object(running_machine &machine, bitmap_t *bitmap, const rectangle | |
| 203 | static void draw_motion_object(running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect) | |
| 204 | 204 | { |
| 205 | 205 | /* |
| 206 | 206 | * VSTRLO 0x1202 |
| r13798 | r13799 | |
| 272 | 272 | ); |
| 273 | 273 | } |
| 274 | 274 | |
| 275 | static void draw_box(running_machine &machine, bitmap_t *bitmap, const rectangle | |
| 275 | static void draw_box(running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect) | |
| 276 | 276 | { |
| 277 | 277 | /* |
| 278 | 278 | This is unnecessarily slow, but the box priorities aren't completely understood, |
| r13798 | r13799 | |
| 302 | 302 | |
| 303 | 303 | for( y=0; y<256; y++ ) |
| 304 | 304 | { |
| 305 | if (0xff-y >= cliprect | |
| 305 | if (0xff-y >= cliprect. | |
| 306 | 306 | for( x=0; x<256; x++ ) |
| 307 | 307 | { |
| 308 | 308 | color = 0; |
| r13798 | r13799 | |
| 319 | 319 | z = x0; /* give priority to rightmost spans */ |
| 320 | 320 | } |
| 321 | 321 | } |
| 322 | if (x >= cliprect | |
| 322 | if (x >= cliprect. | |
| 323 | 323 | bitmap->pix16(0xff-y, x) = color; |
| 324 | 324 | } |
| 325 | 325 | } |
| r13798 | r13799 | |
| 328 | 328 | /* "shell" graphics are 16x16 pixel tiles used for player shots and targeting cursor */ |
| 329 | 329 | static void draw_shell(running_machine &machine, |
| 330 | 330 | bitmap_t *bitmap, |
| 331 | const rectangle | |
| 331 | const rectangle &cliprect, | |
| 332 | 332 | int picture_code, |
| 333 | 333 | int hposition, |
| 334 | 334 | int vstart, |
| r13798 | r13799 | |
|---|---|---|
| 182 | 182 | tilemap_set_transparent_pen(state->m_fg_tilemap,0); |
| 183 | 183 | } |
| 184 | 184 | |
| 185 | static void draw_sprites(running_machine &machine, bitmap_t *bitmap,const rectangle | |
| 185 | static void draw_sprites(running_machine &machine, bitmap_t *bitmap,const rectangle &cliprect) | |
| 186 | 186 | { |
| 187 | 187 | tryout_state *state = machine.driver_data<tryout_state>(); |
| 188 | 188 | UINT8 *spriteram = state->m_spriteram; |
| r13798 | r13799 | |
| 254 | 254 | if(!(state->m_gfx_control[0] & 0x8)) // screen disable |
| 255 | 255 | { |
| 256 | 256 | /* TODO: Color might be different, needs a video from an original pcb. */ |
| 257 | bitmap->fill(screen.machine().pens[0x10], | |
| 257 | bitmap->fill(screen.machine().pens[0x10], | |
| 258 | 258 | } |
| 259 | 259 | else |
| 260 | 260 | { |
| r13798 | r13799 | |
|---|---|---|
| 107 | 107 | { |
| 108 | 108 | rungun_state *state = screen.machine().driver_data<rungun_state>(); |
| 109 | 109 | |
| 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); | |
| 112 | 112 | |
| 113 | 113 | k053936_zoom_draw(state->m_k053936, bitmap, cliprect, state->m_936_tilemap, 0, 0, 1); |
| 114 | 114 |
| r13798 | r13799 | |
|---|---|---|
| 243 | 243 | |
| 244 | 244 | if (state->m_video_disable) |
| 245 | 245 | { |
| 246 | bitmap->fill(get_black_pen(screen.machine()), | |
| 246 | bitmap->fill(get_black_pen(screen.machine()), | |
| 247 | 247 | return 0; |
| 248 | 248 | } |
| 249 | 249 | |
| r13798 | r13799 | |
| 398 | 398 | |
| 399 | 399 | if (state->m_video_disable) |
| 400 | 400 | { |
| 401 | bitmap->fill(get_black_pen(screen.machine()), | |
| 401 | bitmap->fill(get_black_pen(screen.machine()), | |
| 402 | 402 | return 0; |
| 403 | 403 | } |
| 404 | 404 |
| r13798 | r13799 | |
|---|---|---|
| 159 | 159 | |
| 160 | 160 | ***************************************************************************/ |
| 161 | 161 | |
| 162 | static void draw_sprites( running_machine &machine, bitmap_t *bitmap, const rectangle | |
| 162 | static void draw_sprites( running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect ) | |
| 163 | 163 | { |
| 164 | 164 | skyfox_state *state = machine.driver_data<skyfox_state>(); |
| 165 | 165 | int offs; |
| r13798 | r13799 | |
| 238 | 238 | |
| 239 | 239 | ***************************************************************************/ |
| 240 | 240 | |
| 241 | static void draw_background(running_machine &machine, bitmap_t *bitmap, const rectangle | |
| 241 | static void draw_background(running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect) | |
| 242 | 242 | { |
| 243 | 243 | skyfox_state *state = machine.driver_data<skyfox_state>(); |
| 244 | 244 | UINT8 *RAM = machine.region("gfx2")->base(); |
| r13798 | r13799 | |
| 283 | 283 | |
| 284 | 284 | SCREEN_UPDATE( skyfox ) |
| 285 | 285 | { |
| 286 | bitmap->fill(255, | |
| 286 | bitmap->fill(255, | |
| 287 | 287 | draw_background(screen.machine(), bitmap, cliprect); |
| 288 | 288 | draw_sprites(screen.machine(), bitmap, cliprect); |
| 289 | 289 | return 0; |
| r13798 | r13799 | |
|---|---|---|
| 25 | 25 | /* the background character columns is stored in the area dd00-dd3f */ |
| 26 | 26 | |
| 27 | 27 | /* This clears & redraws the entire screen each pass */ |
| 28 | bitmap->fill(255, | |
| 28 | bitmap->fill(255, | |
| 29 | 29 | |
| 30 | 30 | if (!state->m_video_enable) |
| 31 | 31 | return 0; |
| r13798 | r13799 | |
|---|---|---|
| 333 | 333 | |
| 334 | 334 | ***************************************************************************/ |
| 335 | 335 | |
| 336 | static void aerofgt_draw_sprites( running_machine &machine, bitmap_t *bitmap, const rectangle | |
| 336 | static void aerofgt_draw_sprites( running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect, int priority ) | |
| 337 | 337 | { |
| 338 | 338 | aerofgt_state *state = machine.driver_data<aerofgt_state>(); |
| 339 | 339 | int offs; |
| r13798 | r13799 | |
| 404 | 404 | } |
| 405 | 405 | } |
| 406 | 406 | |
| 407 | static void turbofrc_draw_sprites( running_machine &machine, bitmap_t *bitmap, const rectangle | |
| 407 | static void turbofrc_draw_sprites( running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect, int chip, int chip_disabled_pri ) | |
| 408 | 408 | { |
| 409 | 409 | aerofgt_state *state = machine.driver_data<aerofgt_state>(); |
| 410 | 410 | int attr_start, base, first; |
| r13798 | r13799 | |
| 489 | 489 | } |
| 490 | 490 | } |
| 491 | 491 | |
| 492 | static void spinlbrk_draw_sprites( running_machine &machine, bitmap_t *bitmap, const rectangle | |
| 492 | static void spinlbrk_draw_sprites( running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect, int chip, int chip_disabled_pri ) | |
| 493 | 493 | { |
| 494 | 494 | aerofgt_state *state = machine.driver_data<aerofgt_state>(); |
| 495 | 495 | int attr_start, base, first; |
| r13798 | r13799 | |
| 573 | 573 | } |
| 574 | 574 | } |
| 575 | 575 | |
| 576 | static void aerfboo2_draw_sprites( running_machine &machine, bitmap_t *bitmap, const rectangle | |
| 576 | static void aerfboo2_draw_sprites( running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect, int chip, int chip_disabled_pri ) | |
| 577 | 577 | { |
| 578 | 578 | aerofgt_state *state = machine.driver_data<aerofgt_state>(); |
| 579 | 579 | int attr_start, base, first; |
| r13798 | r13799 | |
| 658 | 658 | } |
| 659 | 659 | } |
| 660 | 660 | |
| 661 | static void pspikesb_draw_sprites( running_machine &machine, bitmap_t *bitmap, const rectangle | |
| 661 | static void pspikesb_draw_sprites( running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect ) | |
| 662 | 662 | { |
| 663 | 663 | aerofgt_state *state = machine.driver_data<aerofgt_state>(); |
| 664 | 664 | int i; |
| r13798 | r13799 | |
| 693 | 693 | } |
| 694 | 694 | } |
| 695 | 695 | |
| 696 | static void spikes91_draw_sprites( running_machine &machine, bitmap_t *bitmap, const rectangle | |
| 696 | static void spikes91_draw_sprites( running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect ) | |
| 697 | 697 | { |
| 698 | 698 | aerofgt_state *state = machine.driver_data<aerofgt_state>(); |
| 699 | 699 | int i; |
| r13798 | r13799 | |
| 735 | 735 | } |
| 736 | 736 | } |
| 737 | 737 | |
| 738 | static void aerfboot_draw_sprites( running_machine &machine, bitmap_t *bitmap, const rectangle | |
| 738 | static void aerfboot_draw_sprites( running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect ) | |
| 739 | 739 | { |
| 740 | 740 | aerofgt_state *state = machine.driver_data<aerofgt_state>(); |
| 741 | 741 | int attr_start, last; |
| r13798 | r13799 | |
| 849 | 849 | tilemap_set_scrollx(state->m_bg1_tilemap, (i + scrolly) & 0xff, state->m_rasterram[i]); |
| 850 | 850 | tilemap_set_scrolly(state->m_bg1_tilemap, 0, scrolly); |
| 851 | 851 | |
| 852 | screen.machine().priority_bitmap->fill(0, | |
| 852 | screen.machine().priority_bitmap->fill(0, | |
| 853 | 853 | |
| 854 | 854 | tilemap_draw(bitmap, cliprect, state->m_bg1_tilemap, 0, 0); |
| 855 | 855 | turbofrc_draw_sprites(screen.machine(), bitmap, cliprect, 0, -1); |
| r13798 | r13799 | |
| 922 | 922 | tilemap_set_scrollx(state->m_bg2_tilemap, 0, state->m_bg2scrollx - 4); |
| 923 | 923 | tilemap_set_scrolly(state->m_bg2_tilemap, 0, state->m_bg2scrolly); |
| 924 | 924 | |
| 925 | screen.machine().priority_bitmap->fill(0, | |
| 925 | screen.machine().priority_bitmap->fill(0, | |
| 926 | 926 | |
| 927 | 927 | tilemap_draw(bitmap, cliprect, state->m_bg1_tilemap, 0, 0); |
| 928 | 928 | tilemap_draw(bitmap, cliprect, state->m_bg2_tilemap, 0, 0); |
| r13798 | r13799 | |
| 948 | 948 | tilemap_set_scrollx(state->m_bg2_tilemap, 0, state->m_bg2scrollx - 4); |
| 949 | 949 | // tilemap_set_scrolly(state->m_bg2_tilemap, 0, state->m_bg2scrolly); |
| 950 | 950 | |
| 951 | screen.machine().priority_bitmap->fill(0, | |
| 951 | screen.machine().priority_bitmap->fill(0, | |
| 952 | 952 | |
| 953 | 953 | tilemap_draw(bitmap, cliprect, state->m_bg1_tilemap, 0, 0); |
| 954 | 954 | tilemap_draw(bitmap, cliprect, state->m_bg2_tilemap, 0, 1); |
| r13798 | r13799 | |
| 975 | 975 | tilemap_set_scrollx(state->m_bg2_tilemap, 0, state->m_bg2scrollx - 7); |
| 976 | 976 | tilemap_set_scrolly(state->m_bg2_tilemap, 0, state->m_bg2scrolly + 2); |
| 977 | 977 | |
| 978 | screen.machine().priority_bitmap->fill(0, | |
| 978 | screen.machine().priority_bitmap->fill(0, | |
| 979 | 979 | |
| 980 | 980 | tilemap_draw(bitmap, cliprect, state->m_bg1_tilemap, 0, 0); |
| 981 | 981 | tilemap_draw(bitmap, cliprect, state->m_bg2_tilemap, 0, 1); |
| r13798 | r13799 | |
| 996 | 996 | tilemap_set_scrollx(state->m_bg2_tilemap, 0, state->m_rasterram[0x0200] - 20); |
| 997 | 997 | tilemap_set_scrolly(state->m_bg2_tilemap, 0, state->m_bg2scrolly); |
| 998 | 998 | |
| 999 | screen.machine().priority_bitmap->fill(0, | |
| 999 | screen.machine().priority_bitmap->fill(0, | |
| 1000 | 1000 | |
| 1001 | 1001 | tilemap_draw(bitmap, cliprect, state->m_bg1_tilemap, 0, 0); |
| 1002 | 1002 | |
| r13798 | r13799 | |
| 1024 | 1024 | tilemap_set_scrollx(state->m_bg2_tilemap, 0, state->m_bg2scrollx + 172); |
| 1025 | 1025 | tilemap_set_scrolly(state->m_bg2_tilemap, 0, state->m_bg2scrolly + 2); |
| 1026 | 1026 | |
| 1027 | screen.machine().priority_bitmap->fill(0, | |
| 1027 | screen.machine().priority_bitmap->fill(0, | |
| 1028 | 1028 | |
| 1029 | 1029 | tilemap_draw(bitmap, cliprect, state->m_bg1_tilemap, 0, 0); |
| 1030 | 1030 | tilemap_draw(bitmap, cliprect, state->m_bg2_tilemap, 0, 1); |
| r13798 | r13799 | |
| 1048 | 1048 | tilemap_set_scrollx(state->m_bg2_tilemap, 0, state->m_bg2scrollx - 7); |
| 1049 | 1049 | tilemap_set_scrolly(state->m_bg2_tilemap, 0, state->m_bg2scrolly + 2); |
| 1050 | 1050 | |
| 1051 | screen.machine().priority_bitmap->fill(0, | |
| 1051 | screen.machine().priority_bitmap->fill(0, | |
| 1052 | 1052 | |
| 1053 | 1053 | tilemap_draw(bitmap, cliprect, state->m_bg1_tilemap, 0, 0); |
| 1054 | 1054 | tilemap_draw(bitmap, cliprect, state->m_bg2_tilemap, 0, 1); |
| r13798 | r13799 | |
| 1072 | 1072 | tilemap_set_scrollx(state->m_bg1_tilemap, (i + scrolly) & 0xff, state->m_rasterram[i]); |
| 1073 | 1073 | tilemap_set_scrolly(state->m_bg1_tilemap, 0, scrolly); |
| 1074 | 1074 | |
| 1075 | screen.machine().priority_bitmap->fill(0, | |
| 1075 | screen.machine().priority_bitmap->fill(0, | |
| 1076 | 1076 | |
| 1077 | 1077 | if (state->m_wbbc97_bitmap_enable) |
| 1078 | 1078 | { |
| r13798 | r13799 | |
|---|---|---|
| 122 | 122 | state->m_bg_tilemap = tilemap_create(machine, get_bg_tile_info, tilemap_scan_rows, 8, 8, 32, 32); |
| 123 | 123 | } |
| 124 | 124 | |
| 125 | static void draw_sprites(running_machine &machine, bitmap_t *bitmap, const rectangle | |
| 125 | static void draw_sprites(running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect ) | |
| 126 | 126 | { |
| 127 | 127 | rocnrope_state *state = machine.driver_data<rocnrope_state>(); |
| 128 | 128 | UINT8 *spriteram = state->m_spriteram; |
| r13798 | r13799 | |
|---|---|---|
| 132 | 132 | video_start_common(machine, 0xff00); |
| 133 | 133 | } |
| 134 | 134 | |
| 135 | static void draw_sprites( running_machine &machine, bitmap_t *bitmap, const rectangle | |
| 135 | static void draw_sprites( running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect ) | |
| 136 | 136 | { |
| 137 | 137 | docastle_state *state = machine.driver_data<docastle_state>(); |
| 138 | 138 | int offs; |
| r13798 | r13799 | |
|---|---|---|
| 125 | 125 | |
| 126 | 126 | |
| 127 | 127 | |
| 128 | static void draw_sprites(running_machine &machine, bitmap_t *bitmap, const rectangle | |
| 128 | static void draw_sprites(running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect, int scrollx, int scrolly ) | |
| 129 | 129 | { |
| 130 | 130 | mainsnk_state *state = machine.driver_data<mainsnk_state>(); |
| 131 | 131 | const gfx_element *gfx = machine.gfx[1]; |
| r13798 | r13799 | |
|---|---|---|
| 179 | 179 | * |
| 180 | 180 | *************************************/ |
| 181 | 181 | |
| 182 | static void draw_sprites(bitmap_t *bitmap, const rectangle | |
| 182 | static void draw_sprites(bitmap_t *bitmap, const rectangle &cliprect, const gfx_element *gfx, int flip) | |
| 183 | 183 | { |
| 184 | 184 | mystston_state *state = gfx->machine().driver_data<mystston_state>(); |
| 185 | 185 | int offs; |
| r13798 | r13799 | |
|---|---|---|
| 547 | 547 | machine.add_notifier(MACHINE_NOTIFY_EXIT, machine_notify_delegate(FUNC(ygv608_exit), &machine)); |
| 548 | 548 | } |
| 549 | 549 | |
| 550 | static void draw_sprites(running_machine &machine, bitmap_t *bitmap, const rectangle | |
| 550 | static void draw_sprites(running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect) | |
| 551 | 551 | { |
| 552 | 552 | #ifdef _ENABLE_SPRITES |
| 553 | 553 | |
| r13798 | r13799 | |
| 564 | 564 | return; |
| 565 | 565 | |
| 566 | 566 | /* draw sprites */ |
| 567 | spriteClip &= | |
| 567 | spriteClip &= | |
| 568 | 568 | sa = &ygv608.sprite_attribute_table.s[YGV608_MAX_SPRITES-1]; |
| 569 | 569 | for( i=0; i<YGV608_MAX_SPRITES; i++, sa-- ) |
| 570 | 570 | { |
| r13798 | r13799 | |
| 600 | 600 | logerror( "SZ_8X8: sprite=%d\n", code ); |
| 601 | 601 | code = 0; |
| 602 | 602 | } |
| 603 | drawgfx_transpen( bitmap, | |
| 603 | drawgfx_transpen( bitmap, | |
| 604 | 604 | code+namcond1_gfxbank*0x10000, |
| 605 | 605 | color, |
| 606 | 606 | flipx,flipy, |
| 607 | 607 | sx,sy,0x00); |
| 608 | 608 | // redraw with wrap-around |
| 609 | 609 | if( sx > 512-8 ) |
| 610 | drawgfx_transpen( bitmap, | |
| 610 | drawgfx_transpen( bitmap, | |
| 611 | 611 | code+namcond1_gfxbank*0x10000, |
| 612 | 612 | color, |
| 613 | 613 | flipx,flipy, |
| 614 | 614 | sx-512,sy,0x00); |
| 615 | 615 | if( sy > 512-8 ) |
| 616 | drawgfx_transpen( bitmap, | |
| 616 | drawgfx_transpen( bitmap, | |
| 617 | 617 | code+namcond1_gfxbank*0x10000, |
| 618 | 618 | color, |
| 619 | 619 | flipx,flipy, |
| r13798 | r13799 | |
| 630 | 630 | logerror( "SZ_8X8: sprite=%d\n", code ); |
| 631 | 631 | code = 0; |
| 632 | 632 | } |
| 633 | drawgfx_transpen( bitmap, | |
| 633 | drawgfx_transpen( bitmap, | |
| 634 | 634 | code+namcond1_gfxbank*0x4000, |
| 635 | 635 | color, |
| 636 | 636 | flipx,flipy, |
| 637 | 637 | sx,sy,0x00); |
| 638 | 638 | // redraw with wrap-around |
| 639 | 639 | if( sx > 512-16 ) |
| 640 | drawgfx_transpen( bitmap, | |
| 640 | drawgfx_transpen( bitmap, | |
| 641 | 641 | code+namcond1_gfxbank*0x4000, |
| 642 | 642 | color, |
| 643 | 643 | flipx,flipy, |
| 644 | 644 | sx-512,sy,0x00); |
| 645 | 645 | if( sy > 512-16 ) |
| 646 | drawgfx_transpen( bitmap, | |
| 646 | drawgfx_transpen( bitmap, | |
| 647 | 647 | code+namcond1_gfxbank*0x4000, |
| 648 | 648 | color, |
| 649 | 649 | flipx,flipy, |
| r13798 | r13799 | |
| 660 | 660 | logerror( "SZ_32X32: sprite=%d\n", code ); |
| 661 | 661 | code = 0; |
| 662 | 662 | } |
| 663 | drawgfx_transpen( bitmap, | |
| 663 | drawgfx_transpen( bitmap, | |
| 664 | 664 | code+namcond1_gfxbank*0x1000, |
| 665 | 665 | color, |
| 666 | 666 | flipx,flipy, |
| 667 | 667 | sx,sy,0x00); |
| 668 | 668 | // redraw with wrap-around |
| 669 | 669 | if( sx > 512-32 ) |
| 670 | drawgfx_transpen( bitmap, | |
| 670 | drawgfx_transpen( bitmap, | |
| 671 | 671 | code+namcond1_gfxbank*0x1000, |
| 672 | 672 | color, |
| 673 | 673 | flipx,flipy, |
| 674 | 674 | sx-512,sy,0x00); |
| 675 | 675 | if( sy > 512-32 ) |
| 676 | drawgfx_transpen( bitmap, | |
| 676 | drawgfx_transpen( bitmap, | |
| 677 | 677 | code+namcond1_gfxbank*0x1000, |
| 678 | 678 | color, |
| 679 | 679 | flipx,flipy, |
| r13798 | r13799 | |
| 690 | 690 | logerror( "SZ_64X64: sprite=%d\n", code ); |
| 691 | 691 | code = 0; |
| 692 | 692 | } |
| 693 | drawgfx_transpen( bitmap, | |
| 693 | drawgfx_transpen( bitmap, | |
| 694 | 694 | code+namcond1_gfxbank*0x400, |
| 695 | 695 | color, |
| 696 | 696 | flipx,flipy, |
| 697 | 697 | sx,sy,0x00); |
| 698 | 698 | // redraw with wrap-around |
| 699 | 699 | if( sx > 512-64 ) |
| 700 | drawgfx_transpen( bitmap, | |
| 700 | drawgfx_transpen( bitmap, | |
| 701 | 701 | code+namcond1_gfxbank*0x400, |
| 702 | 702 | color, |
| 703 | 703 | flipx,flipy, |
| 704 | 704 | sx-512,sy,0x00); |
| 705 | 705 | if( sy > 512-64 ) |
| 706 | drawgfx_transpen( bitmap, | |
| 706 | drawgfx_transpen( bitmap, | |
| 707 | 707 | code+namcond1_gfxbank*0x400, |
| 708 | 708 | color, |
| 709 | 709 | flipx,flipy, |
| r13798 | r13799 | |
| 750 | 750 | finalclip.min_x = finalclip.min_y = 0; |
| 751 | 751 | finalclip.max_x = screen.width() - 1; |
| 752 | 752 | finalclip.max_y = screen.height() - 1; |
| 753 | finalclip &= *cliprect; | |
| 754 | cliprect = &finalclip; | |
| 753 | finalclip &= cliprect; | |
| 755 | 754 | |
| 756 | 755 | // punt if not initialized |
| 757 | 756 | if (ygv608.page_x == 0 || ygv608.page_y == 0) |
| 758 | 757 | { |
| 759 | bitmap->fill(0, | |
| 758 | bitmap->fill(0, finalclip | |
| 760 | 759 | return 0; |
| 761 | 760 | } |
| 762 | 761 | |
| r13798 | r13799 | |
| 808 | 807 | tilemap_set_scroll_cols( tilemap_B, ygv608.page_x ); |
| 809 | 808 | |
| 810 | 809 | // now clear the screen in case we change to 1-plane mode |
| 811 | work_bitmap->fill(0, | |
| 810 | work_bitmap->fill(0, finalclip | |
| 812 | 811 | |
| 813 | 812 | // reset resize flag |
| 814 | 813 | ygv608.tilemap_resize = 0; |
| r13798 | r13799 | |
| 861 | 860 | if ((ygv608.regs.s.r7 & r7_md) & MD_1PLANE) |
| 862 | 861 | { |
| 863 | 862 | // If the background tilemap is disabled, we need to clear the bitmap to black |
| 864 | work_bitmap->fill(0, | |
| 863 | work_bitmap->fill(0, finalclip | |
| 865 | 864 | // work_bitmap->fill(1, *visarea); |
| 866 | 865 | } |
| 867 | 866 | else |
| 868 | 867 | #endif |
| 869 | tilemap_draw( work_bitmap,clip | |
| 868 | tilemap_draw( work_bitmap,finalclip | |
| 870 | 869 | |
| 871 | 870 | #ifdef _ENABLE_ROTATE_ZOOM |
| 872 | 871 | |
| r13798 | r13799 | |
| 882 | 881 | cos_theta = (double)ygv608.dx / (double)0x10000; |
| 883 | 882 | |
| 884 | 883 | if( ygv608.regs.s.zron ) |
| 885 | copyrozbitmap( bitmap, clip | |
| 884 | copyrozbitmap( bitmap, finalclip | |
| 886 | 885 | ( visarea.min_x << 16 ) + |
| 887 | 886 | ygv608.ax + 0x10000 * r * |
| 888 | 887 | ( -sin( alpha ) * cos_theta + cos( alpha ) * sin_theta ), |
| r13798 | r13799 | |
| 892 | 891 | ygv608.dx, ygv608.dxy, ygv608.dyx, ygv608.dy, 0); |
| 893 | 892 | else |
| 894 | 893 | #endif |
| 895 | copybitmap( bitmap, work_bitmap, 0, 0, 0, 0, clip | |
| 894 | copybitmap( bitmap, work_bitmap, 0, 0, 0, 0, finalclip | |
| 896 | 895 | |
| 897 | 896 | // for some reason we can't use an opaque tilemap_A |
| 898 | 897 | // so use a transparent but clear the work bitmap first |
| r13798 | r13799 | |
| 901 | 900 | |
| 902 | 901 | if ((ygv608.regs.s.r11 & r11_prm) == PRM_ASBDEX || |
| 903 | 902 | (ygv608.regs.s.r11 & r11_prm) == PRM_ASEBDX ) |
| 904 | draw_sprites(screen.machine(), bitmap,clip | |
| 903 | draw_sprites(screen.machine(), bitmap,finalclip | |
| 905 | 904 | |
| 906 | tilemap_draw( work_bitmap,clip | |
| 905 | tilemap_draw( work_bitmap,finalclip | |
| 907 | 906 | |
| 908 | 907 | #ifdef _ENABLE_ROTATE_ZOOM |
| 909 | 908 | if( ygv608.regs.s.zron ) |
| 910 | copyrozbitmap_trans( bitmap, clip | |
| 909 | copyrozbitmap_trans( bitmap, finalclip | |
| 911 | 910 | ygv608.ax, // + ( visarea.min_x << 16 ), |
| 912 | 911 | ygv608.ay, // + ( visarea.min_y << 16 ), |
| 913 | 912 | ygv608.dx, ygv608.dxy, ygv608.dyx, ygv608.dy, 0, |
| 914 | 913 | 0 ); |
| 915 | 914 | else |
| 916 | 915 | #endif |
| 917 | copybitmap_trans( bitmap, work_bitmap, 0, 0, 0, 0, clip | |
| 916 | copybitmap_trans( bitmap, work_bitmap, 0, 0, 0, 0, finalclip | |
| 918 | 917 | |
| 919 | 918 | if ((ygv608.regs.s.r11 & r11_prm) == PRM_SABDEX || |
| 920 | 919 | (ygv608.regs.s.r11 & r11_prm) == PRM_SEABDX) |
| 921 | draw_sprites(screen.machine(), bitmap,clip | |
| 920 | draw_sprites(screen.machine(), bitmap,finalclip | |
| 922 | 921 | |
| 923 | 922 | |
| 924 | 923 | #ifdef _SHOW_VIDEO_DEBUG |
| r13798 | r13799 | |
|---|---|---|
| 10 | 10 | #include "includes/rampart.h" |
| 11 | 11 | |
| 12 | 12 | |
| 13 | static void rampart_bitmap_render(running_machine &machine, bitmap_t *bitmap, const rectangle | |
| 13 | static void rampart_bitmap_render(running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect); | |
| 14 | 14 | |
| 15 | 15 | /************************************* |
| 16 | 16 | * |
| r13798 | r13799 | |
| 109 | 109 | * |
| 110 | 110 | *************************************/ |
| 111 | 111 | |
| 112 | static void rampart_bitmap_render(running_machine &machine, bitmap_t *bitmap, const rectangle | |
| 112 | static void rampart_bitmap_render(running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect) | |
| 113 | 113 | { |
| 114 | 114 | rampart_state *state = machine.driver_data<rampart_state>(); |
| 115 | 115 | int x, y; |
| 116 | 116 | |
| 117 | 117 | /* update any dirty scanlines */ |
| 118 | for (y = cliprect | |
| 118 | for (y = cliprect. | |
| 119 | 119 | { |
| 120 | 120 | const UINT16 *src = &state->m_bitmap[256 * y]; |
| 121 | 121 | UINT16 *dst = &bitmap->pix16(y); |
| 122 | 122 | |
| 123 | 123 | /* regenerate the line */ |
| 124 | for (x = cliprect | |
| 124 | for (x = cliprect. | |
| 125 | 125 | { |
| 126 | 126 | int bits = src[(x - 8) / 2]; |
| 127 | 127 | dst[x + 0] = bits >> 8; |
| r13798 | r13799 | |
|---|---|---|
| 705 | 705 | *ng2 = g2; |
| 706 | 706 | } |
| 707 | 707 | |
| 708 | static void stv_vdp1_setup_shading(running_machine &machine,const struct spoint* q, const rectangle | |
| 708 | static void stv_vdp1_setup_shading(running_machine &machine,const struct spoint* q, const rectangle &cliprect) | |
| 709 | 709 | { |
| 710 | 710 | INT32 x1, x2, delta, cury, limy; |
| 711 | 711 | INT32 r1, g1, b1, r2, g2, b2; |
| r13798 | r13799 | |
| 865 | 865 | |
| 866 | 866 | for ( cury = stv_vdp1_shading_data->sy; cury <= stv_vdp1_shading_data->ey; cury++ ) |
| 867 | 867 | { |
| 868 | while( (stv_vdp1_shading_data->scanline[cury].x[0] >> 16) < cliprect | |
| 868 | while( (stv_vdp1_shading_data->scanline[cury].x[0] >> 16) < cliprect. | |
| 869 | 869 | { |
| 870 | 870 | stv_vdp1_shading_data->scanline[cury].x[0] += (1 << FRAC_SHIFT); |
| 871 | 871 | stv_vdp1_shading_data->scanline[cury].b[0] += stv_vdp1_shading_data->scanline[cury].db; |
| r13798 | r13799 | |
| 1123 | 1123 | } |
| 1124 | 1124 | |
| 1125 | 1125 | |
| 1126 | static void vdp1_fill_slope(running_machine &machine, const rectangle | |
| 1126 | static void vdp1_fill_slope(running_machine &machine, const rectangle &cliprect, int patterndata, int xsize, | |
| 1127 | 1127 | INT32 x1, INT32 x2, INT32 sl1, INT32 sl2, INT32 *nx1, INT32 *nx2, |
| 1128 | 1128 | INT32 u1, INT32 u2, INT32 slu1, INT32 slu2, INT32 *nu1, INT32 *nu2, |
| 1129 | 1129 | INT32 v1, INT32 v2, INT32 slv1, INT32 slv2, INT32 *nv1, INT32 *nv2, |
| 1130 | 1130 | INT32 _y1, INT32 y2) |
| 1131 | 1131 | { |
| 1132 | if(_y1 > cliprect | |
| 1132 | if(_y1 > cliprect. | |
| 1133 | 1133 | return; |
| 1134 | 1134 | |
| 1135 | if(y2 <= cliprect | |
| 1135 | if(y2 <= cliprect. | |
| 1136 | 1136 | int delta = y2-_y1; |
| 1137 | 1137 | *nx1 = x1+delta*sl1; |
| 1138 | 1138 | *nu1 = u1+delta*slu1; |
| r13798 | r13799 | |
| 1143 | 1143 | return; |
| 1144 | 1144 | } |
| 1145 | 1145 | |
| 1146 | if(y2 > cliprect->max_y) | |
| 1147 | y2 = cliprect->max_y+1; | |
| 1146 | if(y2 > cliprect.max_y) | |
| 1147 | y2 = cliprect.max_y+1; | |
| 1148 | 1148 | |
| 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; | |
| 1151 | 1151 | x1 += delta*sl1; |
| 1152 | 1152 | u1 += delta*slu1; |
| 1153 | 1153 | v1 += delta*slv1; |
| 1154 | 1154 | x2 += delta*sl2; |
| 1155 | 1155 | u2 += delta*slu2; |
| 1156 | 1156 | v2 += delta*slv2; |
| 1157 | _y1 = cliprect | |
| 1157 | _y1 = cliprect. | |
| 1158 | 1158 | } |
| 1159 | 1159 | |
| 1160 | 1160 | if(x1 > x2 || (x1==x2 && sl1 > sl2)) { |
| r13798 | r13799 | |
| 1191 | 1191 | } |
| 1192 | 1192 | |
| 1193 | 1193 | while(_y1 < y2) { |
| 1194 | if(_y1 >= cliprect | |
| 1194 | if(_y1 >= cliprect. | |
| 1195 | 1195 | INT32 slux = 0, slvx = 0; |
| 1196 | 1196 | int xx1 = x1>>FRAC_SHIFT; |
| 1197 | 1197 | int xx2 = x2>>FRAC_SHIFT; |
| r13798 | r13799 | |
| 1202 | 1202 | slux = (u2-u1)/delta; |
| 1203 | 1203 | slvx = (v2-v1)/delta; |
| 1204 | 1204 | } |
| 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; | |
| 1208 | 1208 | u += slux*delta; |
| 1209 | 1209 | v += slvx*delta; |
| 1210 | xx1 = cliprect | |
| 1210 | xx1 = cliprect. | |
| 1211 | 1211 | } |
| 1212 | if(xx2 > cliprect->max_x) | |
| 1213 | xx2 = cliprect->max_x; | |
| 1212 | if(xx2 > cliprect.max_x) | |
| 1213 | xx2 = cliprect.max_x; | |
| 1214 | 1214 | |
| 1215 | 1215 | while(xx1 <= xx2) { |
| 1216 | 1216 | drawpixel(machine,xx1,_y1, |
| r13798 | r13799 | |
| 1239 | 1239 | *nv2 = v2; |
| 1240 | 1240 | } |
| 1241 | 1241 | |
| 1242 | static void vdp1_fill_line(running_machine &machine, const rectangle | |
| 1242 | static void vdp1_fill_line(running_machine &machine, const rectangle &cliprect, int patterndata, int xsize, INT32 y, | |
| 1243 | 1243 | INT32 x1, INT32 x2, INT32 u1, INT32 u2, INT32 v1, INT32 v2) |
| 1244 | 1244 | { |
| 1245 | 1245 | int xx1 = x1>>FRAC_SHIFT; |
| 1246 | 1246 | int xx2 = x2>>FRAC_SHIFT; |
| 1247 | 1247 | |
| 1248 | if(y > cliprect | |
| 1248 | if(y > cliprect. | |
| 1249 | 1249 | return; |
| 1250 | 1250 | |
| 1251 | if(xx1 <= cliprect | |
| 1251 | if(xx1 <= cliprect. | |
| 1252 | 1252 | INT32 slux = 0, slvx = 0; |
| 1253 | 1253 | INT32 u = u1; |
| 1254 | 1254 | INT32 v = v1; |
| r13798 | r13799 | |
| 1257 | 1257 | slux = (u2-u1)/delta; |
| 1258 | 1258 | slvx = (v2-v1)/delta; |
| 1259 | 1259 | } |
| 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; | |
| 1262 | 1262 | u += slux*delta; |
| 1263 | 1263 | v += slvx*delta; |
| 1264 | xx1 = cliprect | |
| 1264 | xx1 = cliprect. | |
| 1265 | 1265 | } |
| 1266 | if(xx2 > cliprect->max_x) | |
| 1267 | xx2 = cliprect->max_x; | |
| 1266 | if(xx2 > cliprect.max_x) | |
| 1267 | xx2 = cliprect.max_x; | |
| 1268 | 1268 | |
| 1269 | 1269 | while(xx1 <= xx2) { |
| 1270 | 1270 | drawpixel(machine,xx1,y, |
| r13798 | r13799 | |
| 1277 | 1277 | } |
| 1278 | 1278 | } |
| 1279 | 1279 | |
| 1280 | static void vdp1_fill_quad(running_machine &machine, const rectangle | |
| 1280 | static void vdp1_fill_quad(running_machine &machine, const rectangle &cliprect, int patterndata, int xsize, const struct spoint *q) | |
| 1281 | 1281 | { |
| 1282 | 1282 | INT32 sl1, sl2, slu1, slu2, slv1, slv2, cury, limy, x1, x2, u1, u2, v1, v2, delta; |
| 1283 | 1283 | int pmin, pmax, i, ps1, ps2; |
| r13798 | r13799 | |
| 1321 | 1321 | return; |
| 1322 | 1322 | } |
| 1323 | 1323 | |
| 1324 | if(cury > cliprect | |
| 1324 | if(cury > cliprect. | |
| 1325 | 1325 | return; |
| 1326 | if(limy <= cliprect | |
| 1326 | if(limy <= cliprect. | |
| 1327 | 1327 | return; |
| 1328 | 1328 | |
| 1329 | if(limy > cliprect->max_y) | |
| 1330 | limy = cliprect->max_y; | |
| 1329 | if(limy > cliprect.max_y) | |
| 1330 | limy = cliprect.max_y; | |
| 1331 | 1331 | |
| 1332 | 1332 | ps1 = pmin+4; |
| 1333 | 1333 | ps2 = pmin; |
| r13798 | r13799 | |
| 1428 | 1428 | return (INT32)(INT16)v + state->m_vdp1.local_y; |
| 1429 | 1429 | } |
| 1430 | 1430 | |
| 1431 | static void stv_vdp1_draw_line(running_machine &machine, const rectangle | |
| 1431 | static void stv_vdp1_draw_line(running_machine &machine, const rectangle &cliprect) | |
| 1432 | 1432 | { |
| 1433 | 1433 | struct spoint q[4]; |
| 1434 | 1434 | |
| r13798 | r13799 | |
| 1447 | 1447 | vdp1_fill_quad(machine, cliprect, 0, 1, q); |
| 1448 | 1448 | } |
| 1449 | 1449 | |
| 1450 | static void stv_vdp1_draw_poly_line(running_machine &machine, const rectangle | |
| 1450 | static void stv_vdp1_draw_poly_line(running_machine &machine, const rectangle &cliprect) | |
| 1451 | 1451 | { |
| 1452 | 1452 | struct spoint q[4]; |
| 1453 | 1453 | |
| r13798 | r13799 | |
| 1510 | 1510 | |
| 1511 | 1511 | } |
| 1512 | 1512 | |
| 1513 | static void stv_vpd1_draw_distorted_sprite(running_machine &machine, const rectangle | |
| 1513 | static void stv_vpd1_draw_distorted_sprite(running_machine &machine, const rectangle &cliprect) | |
| 1514 | 1514 | { |
| 1515 | 1515 | struct spoint q[4]; |
| 1516 | 1516 | |
| r13798 | r13799 | |
| 1568 | 1568 | vdp1_fill_quad(machine, cliprect, patterndata, xsize, q); |
| 1569 | 1569 | } |
| 1570 | 1570 | |
| 1571 | static void stv_vpd1_draw_scaled_sprite(running_machine &machine, const rectangle | |
| 1571 | static void stv_vpd1_draw_scaled_sprite(running_machine &machine, const rectangle &cliprect) | |
| 1572 | 1572 | { |
| 1573 | 1573 | struct spoint q[4]; |
| 1574 | 1574 | |
| r13798 | r13799 | |
| 1716 | 1716 | } |
| 1717 | 1717 | |
| 1718 | 1718 | |
| 1719 | static void stv_vpd1_draw_normal_sprite(running_machine &machine, const rectangle | |
| 1719 | static void stv_vpd1_draw_normal_sprite(running_machine &machine, const rectangle &cliprect, int sprite_type) | |
| 1720 | 1720 | { |
| 1721 | 1721 | //UINT16 *destline; |
| 1722 | 1722 | //saturn_state *state = machine.driver_data<saturn_state>(); |
| r13798 | r13799 | |
| 1747 | 1747 | |
| 1748 | 1748 | if (VDP1_LOG) logerror ("Drawing Normal Sprite x %04x y %04x xsize %04x ysize %04x patterndata %06x\n",x,y,xsize,ysize,patterndata); |
| 1749 | 1749 | |
| 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; | |
| 1752 | 1752 | |
| 1753 | 1753 | shading = stv_read_gouraud_table(machine); |
| 1754 | 1754 | if ( shading ) |
| r13798 | r13799 | |
| 1775 | 1775 | duy = -xsize; |
| 1776 | 1776 | u += xsize*(ysize-1); |
| 1777 | 1777 | } |
| 1778 | if ( y < cliprect | |
| 1778 | if ( y < cliprect. | |
| 1779 | 1779 | { |
| 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; | |
| 1783 | 1783 | } |
| 1784 | if ( x < cliprect | |
| 1784 | if ( x < cliprect. | |
| 1785 | 1785 | { |
| 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; | |
| 1789 | 1789 | } |
| 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); | |
| 1792 | 1792 | for (drawypos = y; drawypos <= maxdrawypos; drawypos++ ) |
| 1793 | 1793 | { |
| 1794 | 1794 | //destline = state->m_vdp1.framebuffer_draw_lines[drawypos]; |
| r13798 | r13799 | |
| 1961 | 1961 | case 0x0000: |
| 1962 | 1962 | if (VDP1_LOG) logerror ("Sprite List Normal Sprite (%d %d)\n",stv2_current_sprite.CMDXA,stv2_current_sprite.CMDYA); |
| 1963 | 1963 | stv2_current_sprite.ispoly = 0; |
| 1964 | stv_vpd1_draw_normal_sprite(machine, cliprect, 0); | |
| 1964 | stv_vpd1_draw_normal_sprite(machine, *cliprect, 0); | |
| 1965 | 1965 | break; |
| 1966 | 1966 | |
| 1967 | 1967 | case 0x0001: |
| 1968 | 1968 | if (VDP1_LOG) logerror ("Sprite List Scaled Sprite (%d %d)\n",stv2_current_sprite.CMDXA,stv2_current_sprite.CMDYA); |
| 1969 | 1969 | stv2_current_sprite.ispoly = 0; |
| 1970 | stv_vpd1_draw_scaled_sprite(machine, cliprect); | |
| 1970 | stv_vpd1_draw_scaled_sprite(machine, *cliprect); | |
| 1971 | 1971 | break; |
| 1972 | 1972 | |
| 1973 | 1973 | case 0x0002: |
| r13798 | r13799 | |
| 1979 | 1979 | if (VDP1_LOG) logerror ("CMDPMOD = %04x\n",stv2_current_sprite.CMDPMOD); |
| 1980 | 1980 | |
| 1981 | 1981 | stv2_current_sprite.ispoly = 0; |
| 1982 | stv_vpd1_draw_distorted_sprite(machine, cliprect); | |
| 1982 | stv_vpd1_draw_distorted_sprite(machine, *cliprect); | |
| 1983 | 1983 | break; |
| 1984 | 1984 | |
| 1985 | 1985 | case 0x0004: |
| 1986 | 1986 | if (VDP1_LOG) logerror ("Sprite List Polygon\n"); |
| 1987 | 1987 | stv2_current_sprite.ispoly = 1; |
| 1988 | stv_vpd1_draw_distorted_sprite(machine, cliprect); | |
| 1988 | stv_vpd1_draw_distorted_sprite(machine, *cliprect); | |
| 1989 | 1989 | break; |
| 1990 | 1990 | |
| 1991 | 1991 | case 0x0005: |
| 1992 | 1992 | if (VDP1_LOG) logerror ("Sprite List Polyline\n"); |
| 1993 | 1993 | stv2_current_sprite.ispoly = 1; |
| 1994 | stv_vdp1_draw_poly_line(machine, cliprect); | |
| 1994 | stv_vdp1_draw_poly_line(machine, *cliprect); | |
| 1995 | 1995 | break; |
| 1996 | 1996 | |
| 1997 | 1997 | case 0x0006: |
| 1998 | 1998 | if (VDP1_LOG) logerror ("Sprite List Line\n"); |
| 1999 | 1999 | stv2_current_sprite.ispoly = 1; |
| 2000 | stv_vdp1_draw_line(machine, cliprect); | |
| 2000 | stv_vdp1_draw_line(machine, *cliprect); | |
| 2001 | 2001 | break; |
| 2002 | 2002 | |
| 2003 | 2003 | case 0x0008: |
| r13798 | r13799 | |
|---|---|---|
| 175 | 175 | |
| 176 | 176 | ***************************************************************************/ |
| 177 | 177 | |
| 178 | static void draw_bgbitmap(running_machine &machine, bitmap_t *bitmap,const rectangle | |
| 178 | static void draw_bgbitmap(running_machine &machine, bitmap_t *bitmap,const rectangle &cliprect) | |
| 179 | 179 | { |
| 180 | 180 | senjyo_state *state = machine.driver_data<senjyo_state>(); |
| 181 | 181 | int x,y,pen,strwid,count; |
| 182 | 182 | |
| 183 | 183 | |
| 184 | 184 | if (state->m_bgstripes == 0xff) /* off */ |
| 185 | bitmap->fill(0, | |
| 185 | bitmap->fill(0, | |
| 186 | 186 | else |
| 187 | 187 | { |
| 188 | 188 | int flip = flip_screen_get(machine); |
| r13798 | r13799 | |
| 212 | 212 | } |
| 213 | 213 | } |
| 214 | 214 | |
| 215 | static void draw_radar(running_machine &machine,bitmap_t *bitmap,const rectangle | |
| 215 | static void draw_radar(running_machine &machine,bitmap_t *bitmap,const rectangle &cliprect) | |
| 216 | 216 | { |
| 217 | 217 | senjyo_state *state = machine.driver_data<senjyo_state>(); |
| 218 | 218 | int offs,x; |
| r13798 | r13799 | |
| 232 | 232 | sy = 255 - sy; |
| 233 | 233 | } |
| 234 | 234 | |
| 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) | |
| 237 | 237 | bitmap->pix16(sy, sx) = offs < 0x200 ? 512 : 513; |
| 238 | 238 | } |
| 239 | 239 | } |
| 240 | 240 | |
| 241 | static void draw_sprites(running_machine &machine, bitmap_t *bitmap,const rectangle | |
| 241 | static void draw_sprites(running_machine &machine, bitmap_t *bitmap,const rectangle &cliprect,int priority) | |
| 242 | 242 | { |
| 243 | 243 | senjyo_state *state = machine.driver_data<senjyo_state>(); |
| 244 | 244 | UINT8 *spriteram = state->m_spriteram; |
| r13798 | r13799 | |
|---|---|---|
| 105 | 105 | state->m_bg_tilemap = tilemap_create(machine, get_bg_tile_info, tilemap_scan_rows, 8, 8, 32, 32); |
| 106 | 106 | } |
| 107 | 107 | |
| 108 | static void draw_sprites( running_machine &machine, bitmap_t *bitmap, const rectangle | |
| 108 | static void draw_sprites( running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect ) | |
| 109 | 109 | { |
| 110 | 110 | yiear_state *state = machine.driver_data<yiear_state>(); |
| 111 | 111 | UINT8 *spriteram = state->m_spriteram; |
| r13798 | r13799 | |
|---|---|---|
| 41 | 41 | /* if no drawing is happening, fill with black and get out */ |
| 42 | 42 | if (!segaic16_display_enable) |
| 43 | 43 | { |
| 44 | bitmap->fill(get_black_pen(screen.machine()), | |
| 44 | bitmap->fill(get_black_pen(screen.machine()), | |
| 45 | 45 | return 0; |
| 46 | 46 | } |
| 47 | 47 | |
| 48 | 48 | /* reset priorities */ |
| 49 | screen.machine().priority_bitmap->fill(0, | |
| 49 | screen.machine().priority_bitmap->fill(0, | |
| 50 | 50 | |
| 51 | 51 | /* draw the low priority road layer */ |
| 52 | 52 | segaic16_road_draw(0, bitmap, cliprect, SEGAIC16_ROAD_BACKGROUND); |
| r13798 | r13799 | |
|---|---|---|
| 140 | 140 | tilemap_set_scroll_rows(state->m_bg_tilemap, 32); |
| 141 | 141 | } |
| 142 | 142 | |
| 143 | static void draw_sprites( running_machine &machine, bitmap_t *bitmap, const rectangle | |
| 143 | static void draw_sprites( running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect ) | |
| 144 | 144 | { |
| 145 | 145 | sonson_state *state = machine.driver_data<sonson_state>(); |
| 146 | 146 | UINT8 *spriteram = state->m_spriteram; |
| r13798 | r13799 | |
|---|---|---|
| 22 | 22 | palette_set_color_rgb(space->machine(), offset, pal5bit(r), pal5bit(g), pal5bit(b)); |
| 23 | 23 | } |
| 24 | 24 | |
| 25 | static void draw_sprites(running_machine &machine, bitmap_t *bitmap, const rectangle | |
| 25 | static void draw_sprites(running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect) | |
| 26 | 26 | { |
| 27 | 27 | sslam_state *state = machine.driver_data<sslam_state>(); |
| 28 | 28 | const gfx_element *gfx = machine.gfx[0]; |
| r13798 | r13799 | |
| 197 | 197 | |
| 198 | 198 | if (!(state->m_regs[6] & 1)) |
| 199 | 199 | { |
| 200 | bitmap->fill(get_black_pen(screen.machine()), | |
| 200 | bitmap->fill(get_black_pen(screen.machine()), | |
| 201 | 201 | return 0; |
| 202 | 202 | } |
| 203 | 203 | |
| r13798 | r13799 | |
| 214 | 214 | if (state->m_regs[2]+2 > 0x8c8) |
| 215 | 215 | { |
| 216 | 216 | 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; | |
| 221 | 221 | |
| 222 | tilemap_draw(bitmap, | |
| 222 | tilemap_draw(bitmap, | |
| 223 | 223 | } |
| 224 | 224 | else |
| 225 | 225 | { |
| r13798 | r13799 | |
| 237 | 237 | |
| 238 | 238 | if (!(state->m_regs[6] & 1)) |
| 239 | 239 | { |
| 240 | bitmap->fill(get_black_pen(screen.machine()), | |
| 240 | bitmap->fill(get_black_pen(screen.machine()), | |
| 241 | 241 | return 0; |
| 242 | 242 | } |
| 243 | 243 |
| r13798 | r13799 | |
|---|---|---|
| 33 | 33 | |
| 34 | 34 | deco16ic_pf_update(state->m_deco_tilegen1, state->m_pf1_rowscroll, state->m_pf2_rowscroll); |
| 35 | 35 | |
| 36 | bitmap->fill(256, | |
| 36 | bitmap->fill(256, | |
| 37 | 37 | |
| 38 | 38 | deco16ic_tilemap_2_draw(state->m_deco_tilegen1, bitmap, cliprect, 0, 2); |
| 39 | 39 | deco16ic_tilemap_1_draw(state->m_deco_tilegen1, bitmap, cliprect, 0, 4); |
| r13798 | r13799 | |
|---|---|---|
| 210 | 210 | |
| 211 | 211 | /*****************************************************************************/ |
| 212 | 212 | |
| 213 | static void draw_sprites(running_machine &machine, bitmap_t *bitmap, const rectangle | |
| 213 | static void draw_sprites(running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect, UINT8 *sbank, int bank ) | |
| 214 | 214 | { |
| 215 | 215 | hcastle_state *state = machine.driver_data<hcastle_state>(); |
| 216 | 216 | device_t *k007121 = bank ? state->m_k007121_2 : state->m_k007121_1; |
| r13798 | r13799 | |
|---|---|---|
| 87 | 87 | tilemap_set_transparent_pen(state->m_text_layer, 15); |
| 88 | 88 | } |
| 89 | 89 | |
| 90 | static void draw_sprites(running_machine &machine, bitmap_t *bitmap, const rectangle | |
| 90 | static void draw_sprites(running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect) | |
| 91 | 91 | { |
| 92 | 92 | deadang_state *state = machine.driver_data<deadang_state>(); |
| 93 | 93 | UINT16 *spriteram16 = state->m_spriteram; |
| r13798 | r13799 | |
| 156 | 156 | tilemap_set_enable(state->m_pf2_layer,!(state->m_scroll_ram[0x34]&4)); |
| 157 | 157 | flip_screen_set(screen.machine(), state->m_scroll_ram[0x34]&0x40 ); |
| 158 | 158 | |
| 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); | |
| 161 | 161 | tilemap_draw(bitmap,cliprect,state->m_pf3_layer,0,1); |
| 162 | 162 | tilemap_draw(bitmap,cliprect,state->m_pf1_layer,0,2); |
| 163 | 163 | tilemap_draw(bitmap,cliprect,state->m_pf2_layer,0,4); |
| r13798 | r13799 | |
|---|---|---|
| 121 | 121 | { |
| 122 | 122 | if (val & mask1) |
| 123 | 123 | { |
| 124 | for (y = cliprect | |
| 124 | for (y = cliprect. | |
| 125 | 125 | if (state->m_bulletsram[y] & mask2) |
| 126 | 126 | bitmap->pix16(y, 256 - x) = 1; |
| 127 | 127 | } |
| r13798 | r13799 | |
|---|---|---|
| 458 | 458 | Sprite Handlers |
| 459 | 459 | ***************************************************************************/ |
| 460 | 460 | |
| 461 | static void draw_sprites(running_machine &machine, bitmap_t *bitmap, const rectangle | |
| 461 | static void draw_sprites(running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect, int priority ) | |
| 462 | 462 | { |
| 463 | 463 | twincobr_state *state = machine.driver_data<twincobr_state>(); |
| 464 | 464 | int offs; |
| r13798 | r13799 | |
| 504 | 504 | |
| 505 | 505 | if (state->m_wardner_sprite_hack) wardner_sprite_priority_hack(screen.machine()); |
| 506 | 506 | |
| 507 | bitmap->fill(0, | |
| 507 | bitmap->fill(0, | |
| 508 | 508 | |
| 509 | 509 | tilemap_draw(bitmap,cliprect,state->m_bg_tilemap,TILEMAP_DRAW_OPAQUE,0); |
| 510 | 510 | draw_sprites(screen.machine(), bitmap,cliprect,0x0400); |
| r13798 | r13799 | |
|---|---|---|
| 293 | 293 | xld = state->m_xld1; |
| 294 | 294 | yld = state->m_yld1; |
| 295 | 295 | |
| 296 | drawgfx_opaque(state->m_tmp_bitmap2, | |
| 296 | drawgfx_opaque(state->m_tmp_bitmap2, | |
| 297 | 297 | state->m_ball1_pic, |
| 298 | 298 | 0, |
| 299 | 299 | 0, 0, |
| r13798 | r13799 | |
| 307 | 307 | xld = state->m_xld2; |
| 308 | 308 | yld = state->m_yld2; |
| 309 | 309 | |
| 310 | drawgfx_opaque(state->m_tmp_bitmap2, | |
| 310 | drawgfx_opaque(state->m_tmp_bitmap2, | |
| 311 | 311 | state->m_ball2_pic, |
| 312 | 312 | 0, |
| 313 | 313 | 0, 0, |
| r13798 | r13799 | |
| 319 | 319 | tilemap_set_scrollx(state->m_bg_tilemap, 0, flip_screen_get(screen.machine()) ? -xld : xld); |
| 320 | 320 | tilemap_set_scrolly(state->m_bg_tilemap, 0, flip_screen_get(screen.machine()) ? -yld : yld); |
| 321 | 321 | |
| 322 | tilemap_draw(state->m_tmp_bitmap1, | |
| 322 | tilemap_draw(state->m_tmp_bitmap1, | |
| 323 | 323 | |
| 324 | 324 | tilemap_set_scrollx(state->m_bg_tilemap, 0, 0); |
| 325 | 325 | tilemap_set_scrolly(state->m_bg_tilemap, 0, 0); |
| r13798 | r13799 | |
|---|---|---|
| 158 | 158 | } |
| 159 | 159 | #endif |
| 160 | 160 | |
| 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); | |
| 163 | 163 | |
| 164 | 164 | if (layers_ctrl & 0x1) |
| 165 | 165 | { |
| r13798 | r13799 | |
|---|---|---|
| 188 | 188 | |
| 189 | 189 | set_pens(screen.machine()); |
| 190 | 190 | |
| 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); | |
| 193 | 193 | |
| 194 | 194 | if (~k007121_ctrlram_r(state->m_k007121, 3) & 0x20) |
| 195 | 195 | { |
| r13798 | r13799 | |
| 198 | 198 | finalclip0 = state->m_clip0; |
| 199 | 199 | finalclip1 = state->m_clip1; |
| 200 | 200 | |
| 201 | finalclip0 &= *cliprect; | |
| 202 | finalclip1 &= *cliprect; | |
| 201 | finalclip0 &= cliprect; | |
| 202 | finalclip1 &= cliprect; | |
| 203 | 203 | |
| 204 | 204 | tilemap_set_scrollx(state->m_layer0, 0, ctrl_0 - 40); |
| 205 | 205 | tilemap_set_scrollx(state->m_layer1, 0, 0); |
| r13798 | r13799 | |
| 213 | 213 | tilemap_set_scrolly(state->m_layer0, (i + 2) & 0x1f, k007121_ctrlram_r(state->m_k007121, 2)); |
| 214 | 214 | } |
| 215 | 215 | |
| 216 | tilemap_draw(bitmap, | |
| 216 | tilemap_draw(bitmap, | |
| 217 | 217 | 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); |
| 218 | 218 | /* we ignore the transparency because layer1 is drawn only at the top of the screen also covering sprites */ |
| 219 | tilemap_draw(bitmap, | |
| 219 | tilemap_draw(bitmap, | |
| 220 | 220 | } |
| 221 | 221 | else |
| 222 | 222 | { |
| r13798 | r13799 | |
| 224 | 224 | rectangle finalclip3; |
| 225 | 225 | |
| 226 | 226 | /* 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; | |
| 229 | 229 | |
| 230 | 230 | if(k007121_ctrlram_r(state->m_k007121, 1) & 1) |
| 231 | 231 | { |
| 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; | |
| 234 | 234 | |
| 235 | 235 | if(ctrl_0 >= 40) |
| 236 | 236 | { |
| 237 | finalclip1.min_x = cliprect | |
| 237 | finalclip1.min_x = cliprect. | |
| 238 | 238 | } |
| 239 | 239 | else |
| 240 | 240 | { |
| r13798 | r13799 | |
| 243 | 243 | finalclip1.min_x = 40 - ctrl_0; |
| 244 | 244 | } |
| 245 | 245 | |
| 246 | finalclip1.max_x = cliprect | |
| 246 | finalclip1.max_x = cliprect. | |
| 247 | 247 | |
| 248 | 248 | } |
| 249 | 249 | else |
| 250 | 250 | { |
| 251 | 251 | if(ctrl_0 >= 40) |
| 252 | 252 | { |
| 253 | finalclip0.min_x = cliprect | |
| 253 | finalclip0.min_x = cliprect. | |
| 254 | 254 | } |
| 255 | 255 | else |
| 256 | 256 | { |
| r13798 | r13799 | |
| 259 | 259 | finalclip0.min_x = 40 - ctrl_0; |
| 260 | 260 | } |
| 261 | 261 | |
| 262 | finalclip0.max_x = cliprect | |
| 262 | finalclip0.max_x = cliprect. | |
| 263 | 263 | |
| 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; | |
| 266 | 266 | } |
| 267 | 267 | |
| 268 | 268 | if(use_clip3[0] || use_clip3[1]) |
| 269 | 269 | { |
| 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; | |
| 273 | 273 | finalclip3.max_x = 40 - ctrl_0 - 8; |
| 274 | 274 | } |
| 275 | 275 | |
| 276 | 276 | tilemap_set_scrollx(state->m_layer0, 0, ctrl_0 - 40); |
| 277 | 277 | tilemap_set_scrollx(state->m_layer1, 0, ctrl_0 - 40); |
| 278 | 278 | |
| 279 | tilemap_draw(bitmap, | |
| 279 | tilemap_draw(bitmap, | |
| 280 | 280 | if(use_clip3[0]) |
| 281 | tilemap_draw(bitmap, | |
| 281 | tilemap_draw(bitmap, | |
| 282 | 282 | |
| 283 | tilemap_draw(bitmap, | |
| 283 | tilemap_draw(bitmap, | |
| 284 | 284 | if(use_clip3[1]) |
| 285 | tilemap_draw(bitmap, | |
| 285 | tilemap_draw(bitmap, | |
| 286 | 286 | |
| 287 | 287 | 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); |
| 288 | 288 | } |
| r13798 | r13799 | |
|---|---|---|
| 25 | 25 | }; |
| 26 | 26 | |
| 27 | 27 | |
| 28 | static void parentj_draw_sprites( running_machine &machine, bitmap_t *bitmap, const rectangle | |
| 28 | static void parentj_draw_sprites( running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect, int priority ) | |
| 29 | 29 | { |
| 30 | 30 | /* Y chain size is 16/32?/64/64? pixels. X chain size |
| 31 | 31 | is always 64 pixels. */ |
| r13798 | r13799 | |
| 144 | 144 | |
| 145 | 145 | tc0080vco_tilemap_update(state->m_tc0080vco); |
| 146 | 146 | |
| 147 | bitmap->fill(0, | |
| 147 | bitmap->fill(0, | |
| 148 | 148 | |
| 149 | 149 | tc0080vco_tilemap_draw(state->m_tc0080vco, bitmap, cliprect, 0, TILEMAP_DRAW_OPAQUE, 0); |
| 150 | 150 |
| r13798 | r13799 | |
|---|---|---|
| 116 | 116 | |
| 117 | 117 | if (tms9927_screen_reset(screen.machine().device("tms"))) |
| 118 | 118 | { |
| 119 | bitmap->fill(get_black_pen(screen.machine()), | |
| 119 | bitmap->fill(get_black_pen(screen.machine()), | |
| 120 | 120 | return 0; |
| 121 | 121 | } |
| 122 | 122 |
| r13798 | r13799 | |
|---|---|---|
| 274 | 274 | int x, y, offs; |
| 275 | 275 | |
| 276 | 276 | /* draw the sprites */ |
| 277 | state->m_spritebitmap->fill(0x0f, | |
| 277 | state->m_spritebitmap->fill(0x0f, | |
| 278 | 278 | for (offs = 0; offs < 320/2; offs += 4) |
| 279 | 279 | { |
| 280 | 280 | int x = spriteaddr[offs + 3]; |
| r13798 | r13799 | |
| 286 | 286 | } |
| 287 | 287 | |
| 288 | 288 | /* draw the bitmap to the screen, looping over Y */ |
| 289 | for (y = cliprect | |
| 289 | for (y = cliprect. | |
| 290 | 290 | { |
| 291 | 291 | UINT16 *dst = &bitmap->pix16(y); |
| 292 | 292 | |
| 293 | 293 | /* if we're in the VBLANK region, just fill with black */ |
| 294 | 294 | if (state->m_syncprom[y] & 1) |
| 295 | 295 | { |
| 296 | for (x = cliprect | |
| 296 | for (x = cliprect. | |
| 297 | 297 | dst[x] = black; |
| 298 | 298 | } |
| 299 | 299 | |
| r13798 | r13799 | |
| 310 | 310 | src = &state->m_videoram[effy * 128]; |
| 311 | 311 | |
| 312 | 312 | /* loop over X */ |
| 313 | for (x = cliprect | |
| 313 | for (x = cliprect. | |
| 314 | 314 | { |
| 315 | 315 | /* if we're in the HBLANK region, just store black */ |
| 316 | 316 | if (x >= 256) |
| r13798 | r13799 | |
|---|---|---|
| 116 | 116 | * 6,7| unused |
| 117 | 117 | */ |
| 118 | 118 | |
| 119 | static void draw_sprites( running_machine& machine, bitmap_t *bitmap, const rectangle | |
| 119 | static void draw_sprites( running_machine& machine, bitmap_t *bitmap, const rectangle &cliprect ) | |
| 120 | 120 | { |
| 121 | 121 | ddragon3_state *state = machine.driver_data<ddragon3_state>(); |
| 122 | 122 | UINT16 *source = state->m_spriteram; |
| r13798 | r13799 | |
|---|---|---|
| 84 | 84 | } |
| 85 | 85 | |
| 86 | 86 | |
| 87 | static UINT8 collision_check(sprint2_state *state, colortable_t *colortable, rectangle | |
| 87 | static UINT8 collision_check(sprint2_state *state, colortable_t *colortable, rectangle& rect) | |
| 88 | 88 | { |
| 89 | 89 | UINT8 data = 0; |
| 90 | 90 | |
| 91 | 91 | int x; |
| 92 | 92 | int y; |
| 93 | 93 | |
| 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++) | |
| 96 | 96 | { |
| 97 | 97 | UINT16 a = colortable_entry_get_value(colortable, state->m_helper->pix16(y, x)); |
| 98 | 98 | |
| r13798 | r13799 | |
| 180 | 180 | |
| 181 | 181 | /* check for sprite-tilemap collisions */ |
| 182 | 182 | |
| 183 | tilemap_draw(state->m_helper, | |
| 183 | tilemap_draw(state->m_helper, | |
| 184 | 184 | |
| 185 | drawgfx_transpen(state->m_helper, | |
| 185 | drawgfx_transpen(state->m_helper, | |
| 186 | 186 | get_sprite_code(video_ram, i), |
| 187 | 187 | 0, |
| 188 | 188 | 0, 0, |
| 189 | 189 | get_sprite_x(video_ram, i), |
| 190 | 190 | get_sprite_y(video_ram, i), 1); |
| 191 | 191 | |
| 192 | state->m_collision[i] |= collision_check(state, screen.machine().colortable, | |
| 192 | state->m_collision[i] |= collision_check(state, screen.machine().colortable, | |
| 193 | 193 | |
| 194 | 194 | /* check for sprite-sprite collisions */ |
| 195 | 195 | |
| 196 | 196 | for (j = 0; j < 4; j++) |
| 197 | 197 | if (j != i) |
| 198 | 198 | { |
| 199 | drawgfx_transpen(state->m_helper, | |
| 199 | drawgfx_transpen(state->m_helper, | |
| 200 | 200 | get_sprite_code(video_ram, j), |
| 201 | 201 | 1, |
| 202 | 202 | 0, 0, |
| r13798 | r13799 | |
| 204 | 204 | get_sprite_y(video_ram, j), 0); |
| 205 | 205 | } |
| 206 | 206 | |
| 207 | drawgfx_transpen(state->m_helper, | |
| 207 | drawgfx_transpen(state->m_helper, | |
| 208 | 208 | get_sprite_code(video_ram, i), |
| 209 | 209 | 0, |
| 210 | 210 | 0, 0, |
| 211 | 211 | get_sprite_x(video_ram, i), |
| 212 | 212 | get_sprite_y(video_ram, i), 1); |
| 213 | 213 | |
| 214 | state->m_collision[i] |= collision_check(state, screen.machine().colortable, | |
| 214 | state->m_collision[i] |= collision_check(state, screen.machine().colortable, | |
| 215 | 215 | } |
| 216 | 216 | } |
| r13798 | r13799 | |
|---|---|---|
| 192 | 192 | |
| 193 | 193 | void deco_bac06_device::custom_tilemap_draw(running_machine &machine, |
| 194 | 194 | bitmap_t *bitmap, |
| 195 | const rectangle | |
| 195 | const rectangle &cliprect, | |
| 196 | 196 | tilemap_t *tilemap_ptr, |
| 197 | 197 | const UINT16 *rowscroll_ptr, |
| 198 | 198 | const UINT16 *colscroll_ptr, |
| r13798 | r13799 | |
| 258 | 258 | else |
| 259 | 259 | src_y = scrolly; |
| 260 | 260 | |
| 261 | for (y=0; y<=cliprect | |
| 261 | for (y=0; y<=cliprect. | |
| 262 | 262 | if (row_scroll_enabled) |
| 263 | 263 | src_x=scrollx + rowscroll_ptr[(src_y >> (control1[3]&0xf))&(0x1ff>>(control1[3]&0xf))]; |
| 264 | 264 | else |
| r13798 | r13799 | |
| 267 | 267 | if (flip_screen_get(machine)) |
| 268 | 268 | src_x=(src_bitmap->width() - 256) - src_x; |
| 269 | 269 | |
| 270 | for (x=0; x<=cliprect | |
| 270 | for (x=0; x<=cliprect. | |
| 271 | 271 | if (col_scroll_enabled) |
| 272 | 272 | column_offset=colscroll_ptr[((src_x >> 3) >> (control1[2]&0xf))&(0x3f>>(control1[2]&0xf))]; |
| 273 | 273 | |
| r13798 | r13799 | |
| 288 | 288 | } |
| 289 | 289 | } |
| 290 | 290 | |
| 291 | void deco_bac06_device::deco_bac06_pf_draw(running_machine &machine,bitmap_t *bitmap,const rectangle | |
| 291 | void 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) | |
| 292 | 292 | { |
| 293 | 293 | tilemap_t* tm = 0; |
| 294 | 294 | |
| r13798 | r13799 | |
| 322 | 322 | } |
| 323 | 323 | |
| 324 | 324 | // used for pocket gal bootleg, which doesn't set registers properly and simply expects a fixed size tilemap. |
| 325 | void deco_bac06_device::deco_bac06_pf_draw_bootleg(running_machine &machine,bitmap_t *bitmap,const rectangle | |
| 325 | void deco_bac06_device::deco_bac06_pf_draw_bootleg(running_machine &machine,bitmap_t *bitmap,const rectangle &cliprect,int flags, int mode, int type) | |
| 326 | 326 | { |
| 327 | 327 | tilemap_t* tm = 0; |
| 328 | 328 | if (!mode) tm = pf8x8_tilemap[type]; |
| r13798 | r13799 | |
|---|---|---|
| 56 | 56 | |
| 57 | 57 | for (y = 0; y < 256; y += 4) |
| 58 | 58 | { |
| 59 | rectangle rect = | |
| 59 | rectangle rect = | |
| 60 | 60 | |
| 61 | 61 | int xl = state->m_position_ram[y + 0] & 15; |
| 62 | 62 | int xh = state->m_position_ram[y + 1] & 15; |
| r13798 | r13799 | |
| 69 | 69 | if (rect.min_y < y + 0) rect.min_y = y + 0; |
| 70 | 70 | if (rect.max_y > y + 3) rect.max_y = y + 3; |
| 71 | 71 | |
| 72 | tilemap_draw(bitmap, | |
| 72 | tilemap_draw(bitmap, | |
| 73 | 73 | } |
| 74 | 74 | return 0; |
| 75 | 75 | } |
| r13798 | r13799 | |
|---|---|---|
| 21 | 21 | UINT16 pf_control_0[8]; |
| 22 | 22 | UINT16 pf_control_1[8]; |
| 23 | 23 | |
| 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); | |
| 26 | 26 | |
| 27 | 27 | UINT8 get_flip_state(void) { return pf_control_0[0]&0x80; }; |
| 28 | 28 | void set_colmask(int data) { m_gfxcolmask = data; } |
| r13798 | r13799 | |
| 43 | 43 | |
| 44 | 44 | void custom_tilemap_draw(running_machine &machine, |
| 45 | 45 | bitmap_t *bitmap, |
| 46 | const rectangle | |
| 46 | const rectangle &cliprect, | |
| 47 | 47 | tilemap_t *tilemap_ptr, |
| 48 | 48 | const UINT16 *rowscroll_ptr, |
| 49 | 49 | const UINT16 *colscroll_ptr, |
| r13798 | r13799 | |
|---|---|---|
| 37 | 37 | } |
| 38 | 38 | |
| 39 | 39 | |
| 40 | static void draw_sprites( running_machine &machine, bitmap_t* bitmap, const rectangle | |
| 40 | static void draw_sprites( running_machine &machine, bitmap_t* bitmap, const rectangle | |
| 41 | 41 | { |
| 42 | 42 | orbit_state *state = machine.driver_data<orbit_state>(); |
| 43 | 43 | const UINT8* p = state->m_sprite_ram; |
| r13798 | r13799 | |
|---|---|---|
| 47 | 47 | } |
| 48 | 48 | |
| 49 | 49 | |
| 50 | static void draw_chars( running_machine &machine, bitmap_t *bitmap, const rectangle | |
| 50 | static void draw_chars( running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect, int priority ) | |
| 51 | 51 | { |
| 52 | 52 | ambush_state *state = machine.driver_data<ambush_state>(); |
| 53 | 53 | int offs, transpen; |
| r13798 | r13799 | |
| 92 | 92 | ambush_state *state = screen.machine().driver_data<ambush_state>(); |
| 93 | 93 | int offs; |
| 94 | 94 | |
| 95 | bitmap->fill(0, | |
| 95 | bitmap->fill(0, | |
| 96 | 96 | |
| 97 | 97 | /* Draw the characters */ |
| 98 | 98 | draw_chars(screen.machine(), bitmap, cliprect, 0x00); |
| r13798 | r13799 | |
|---|---|---|
| 351 | 351 | SCREEN_UPDATE( policetr ) |
| 352 | 352 | { |
| 353 | 353 | policetr_state *state = screen.machine().driver_data<policetr_state>(); |
| 354 | int width = cliprect | |
| 354 | int width = cliprect. | |
| 355 | 355 | int y; |
| 356 | 356 | |
| 357 | 357 | /* 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); | |
| 360 | 360 | |
| 361 | 361 | return 0; |
| 362 | 362 | } |
| r13798 | r13799 | |
|---|---|---|
| 218 | 218 | COMBINE_DATA( &state->m_video_dma_address ); |
| 219 | 219 | } |
| 220 | 220 | |
| 221 | static void drawgfx_blend(bitmap_t *bitmap, const rectangle | |
| 221 | static 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) | |
| 222 | 222 | { |
| 223 | 223 | seibuspi_state *state = gfx->machine().driver_data<seibuspi_state>(); |
| 224 | 224 | const pen_t *pens = &gfx->machine().pens[gfx->color_base]; |
| r13798 | r13799 | |
| 237 | 237 | y1 = sy; |
| 238 | 238 | y2 = sy + height - 1; |
| 239 | 239 | |
| 240 | if (x1 > cliprect | |
| 240 | if (x1 > cliprect. | |
| 241 | 241 | { |
| 242 | 242 | return; |
| 243 | 243 | } |
| 244 | if (y1 > cliprect | |
| 244 | if (y1 > cliprect. | |
| 245 | 245 | { |
| 246 | 246 | return; |
| 247 | 247 | } |
| r13798 | r13799 | |
| 261 | 261 | } |
| 262 | 262 | |
| 263 | 263 | // clip x |
| 264 | if (x1 < cliprect | |
| 264 | if (x1 < cliprect. | |
| 265 | 265 | { |
| 266 | 266 | if (flipx) |
| 267 | 267 | { |
| 268 | px = width - (cliprect | |
| 268 | px = width - (cliprect. | |
| 269 | 269 | } |
| 270 | 270 | else |
| 271 | 271 | { |
| 272 | px = (cliprect | |
| 272 | px = (cliprect. | |
| 273 | 273 | } |
| 274 | x1 = cliprect | |
| 274 | x1 = cliprect. | |
| 275 | 275 | } |
| 276 | if (x2 > cliprect | |
| 276 | if (x2 > cliprect. | |
| 277 | 277 | { |
| 278 | x2 = cliprect | |
| 278 | x2 = cliprect. | |
| 279 | 279 | } |
| 280 | 280 | |
| 281 | 281 | // clip y |
| 282 | if (y1 < cliprect | |
| 282 | if (y1 < cliprect. | |
| 283 | 283 | { |
| 284 | 284 | if (flipy) |
| 285 | 285 | { |
| 286 | py = height - (cliprect | |
| 286 | py = height - (cliprect. | |
| 287 | 287 | } |
| 288 | 288 | else |
| 289 | 289 | { |
| 290 | py = (cliprect | |
| 290 | py = (cliprect. | |
| 291 | 291 | } |
| 292 | y1 = cliprect | |
| 292 | y1 = cliprect. | |
| 293 | 293 | } |
| 294 | if (y2 > cliprect | |
| 294 | if (y2 > cliprect. | |
| 295 | 295 | { |
| 296 | y2 = cliprect | |
| 296 | y2 = cliprect. | |
| 297 | 297 | } |
| 298 | 298 | |
| 299 | 299 | if (gfx->total_elements <= 0x10000) |
| r13798 | r13799 | |
| 343 | 343 | { 7*16, 6*16, 5*16, 4*16, 3*16, 2*16, 1*16, 0*16 } |
| 344 | 344 | }; |
| 345 | 345 | |
| 346 | static void draw_sprites(running_machine &machine, bitmap_t *bitmap, const rectangle | |
| 346 | static void draw_sprites(running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect, int pri_mask) | |
| 347 | 347 | { |
| 348 | 348 | seibuspi_state *state = machine.driver_data<seibuspi_state>(); |
| 349 | 349 | INT16 xpos, ypos; |
| r13798 | r13799 | |
| 558 | 558 | #endif |
| 559 | 559 | |
| 560 | 560 | |
| 561 | static void combine_tilemap(running_machine &machine, bitmap_t *bitmap, const rectangle | |
| 561 | static void combine_tilemap(running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect, tilemap_t *tile, int x, int y, int opaque, INT16 *rowscroll) | |
| 562 | 562 | { |
| 563 | 563 | seibuspi_state *state = machine.driver_data<seibuspi_state>(); |
| 564 | 564 | int i,j; |
| r13798 | r13799 | |
| 574 | 574 | xscroll_mask = pen_bitmap->width() - 1; |
| 575 | 575 | yscroll_mask = pen_bitmap->height() - 1; |
| 576 | 576 | |
| 577 | for (j=cliprect | |
| 577 | for (j=cliprect. | |
| 578 | 578 | { |
| 579 | 579 | int rx = x; |
| 580 | 580 | if (rowscroll) |
| r13798 | r13799 | |
| 585 | 585 | d = &bitmap->pix32(j); |
| 586 | 586 | s = &pen_bitmap->pix16((j+y) & yscroll_mask); |
| 587 | 587 | t = &flags_bitmap->pix8((j+y) & yscroll_mask); |
| 588 | for (i=cliprect | |
| 588 | for (i=cliprect. | |
| 589 | 589 | { |
| 590 | 590 | if (opaque || (t[i & xscroll_mask] & (TILEMAP_PIXEL_LAYER0 | TILEMAP_PIXEL_LAYER1))) |
| 591 | 591 | { |
| r13798 | r13799 | |
| 622 | 622 | } |
| 623 | 623 | |
| 624 | 624 | if( state->m_layer_enable & 0x1 ) |
| 625 | bitmap->fill(0, | |
| 625 | bitmap->fill(0, | |
| 626 | 626 | |
| 627 | 627 | if (!(state->m_layer_enable & 0x1)) |
| 628 | 628 | 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); |
| r13798 | r13799 | |
| 672 | 672 | |
| 673 | 673 | SCREEN_UPDATE( sys386f2 ) |
| 674 | 674 | { |
| 675 | bitmap->fill(0, | |
| 675 | bitmap->fill(0, | |
| 676 | 676 | draw_sprites(screen.machine(), bitmap, cliprect, 0); |
| 677 | 677 | draw_sprites(screen.machine(), bitmap, cliprect, 1); |
| 678 | 678 | draw_sprites(screen.machine(), bitmap, cliprect, 2); |
| r13798 | r13799 | |
|---|---|---|
| 106 | 106 | state->m_palette_bank = 0; |
| 107 | 107 | } |
| 108 | 108 | |
| 109 | static void sauro_draw_sprites(running_machine &machine, bitmap_t *bitmap, const rectangle | |
| 109 | static void sauro_draw_sprites(running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect) | |
| 110 | 110 | { |
| 111 | 111 | sauro_state *state = machine.driver_data<sauro_state>(); |
| 112 | 112 | UINT8 *spriteram = state->m_spriteram; |
| r13798 | r13799 | |
| 174 | 174 | 8, 8, 32, 32); |
| 175 | 175 | } |
| 176 | 176 | |
| 177 | static void trckydoc_draw_sprites(running_machine &machine, bitmap_t *bitmap, const rectangle | |
| 177 | static void trckydoc_draw_sprites(running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect) | |
| 178 | 178 | { |
| 179 | 179 | sauro_state *state = machine.driver_data<sauro_state>(); |
| 180 | 180 | UINT8 *spriteram = state->m_spriteram; |
| r13798 | r13799 | |
|---|---|---|
| 253 | 253 | } |
| 254 | 254 | } |
| 255 | 255 | |
| 256 | static void draw_sprites(running_machine &machine, bitmap_t *bitmap, const rectangle | |
| 256 | static void draw_sprites(running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect ) | |
| 257 | 257 | { |
| 258 | 258 | gaplus_state *state = machine.driver_data<gaplus_state>(); |
| 259 | 259 | UINT8 *spriteram = state->m_spriteram + 0x780; |
| r13798 | r13799 | |
| 313 | 313 | /* flip screen control is embedded in RAM */ |
| 314 | 314 | flip_screen_set(screen.machine(), state->m_spriteram[0x1f7f-0x800] & 1); |
| 315 | 315 | |
| 316 | bitmap->fill(0, | |
| 316 | bitmap->fill(0, | |
| 317 | 317 | |
| 318 | 318 | starfield_render(screen.machine(), bitmap); |
| 319 | 319 |
| r13798 | r13799 | |
|---|---|---|
| 167 | 167 | * |
| 168 | 168 | *************************************/ |
| 169 | 169 | |
| 170 | static void draw_alpha_line(running_machine &machine, bitmap_t *bitmap, const rectangle | |
| 170 | static void draw_alpha_line(running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect, | |
| 171 | 171 | int alpha_line, int video_line) |
| 172 | 172 | { |
| 173 | 173 | carpolo_state *state = machine.driver_data<carpolo_state>(); |
| r13798 | r13799 | |
| 198 | 198 | } |
| 199 | 199 | |
| 200 | 200 | |
| 201 | static void draw_sprite(running_machine &machine, bitmap_t *bitmap, const rectangle | |
| 201 | static void draw_sprite(running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect, | |
| 202 | 202 | UINT8 x, UINT8 y, int bank, int code, int col) |
| 203 | 203 | { |
| 204 | 204 | int remapped_code, flipy; |
| r13798 | r13799 | |
| 363 | 363 | state->m_sprite_sprite_collision_bitmap1->fill(0); |
| 364 | 364 | state->m_sprite_sprite_collision_bitmap2->fill(0); |
| 365 | 365 | |
| 366 | drawgfx_opaque(state->m_sprite_sprite_collision_bitmap1, | |
| 366 | drawgfx_opaque(state->m_sprite_sprite_collision_bitmap1,state->m_sprite_sprite_collision_bitmap1->cliprect(),machine.gfx[0], | |
| 367 | 367 | code1,0, |
| 368 | 368 | 0,flipy1, |
| 369 | 369 | x1,y1); |
| 370 | 370 | |
| 371 | drawgfx_opaque(state->m_sprite_sprite_collision_bitmap2, | |
| 371 | drawgfx_opaque(state->m_sprite_sprite_collision_bitmap2,state->m_sprite_sprite_collision_bitmap2->cliprect(),machine.gfx[0], | |
| 372 | 372 | code2,0, |
| 373 | 373 | 0,flipy2, |
| 374 | 374 | x2,y2); |
| r13798 | r13799 | |
| 417 | 417 | state->m_sprite_goal_collision_bitmap1->fill(0); |
| 418 | 418 | state->m_sprite_goal_collision_bitmap2->fill(0); |
| 419 | 419 | |
| 420 | drawgfx_opaque(state->m_sprite_goal_collision_bitmap1, | |
| 420 | drawgfx_opaque(state->m_sprite_goal_collision_bitmap1,state->m_sprite_goal_collision_bitmap1->cliprect(),machine.gfx[0], | |
| 421 | 421 | code1,0, |
| 422 | 422 | 0,flipy1, |
| 423 | 423 | x1,y1); |
| 424 | 424 | |
| 425 | drawgfxzoom_transpen(state->m_sprite_goal_collision_bitmap2, | |
| 425 | drawgfxzoom_transpen(state->m_sprite_goal_collision_bitmap2,state->m_sprite_goal_collision_bitmap2->cliprect(),machine.gfx[1], | |
| 426 | 426 | 0,0, |
| 427 | 427 | 0,0, |
| 428 | 428 | x2,y2, |
| r13798 | r13799 | |
| 475 | 475 | state->m_sprite_goal_collision_bitmap1->fill(0); |
| 476 | 476 | state->m_sprite_goal_collision_bitmap2->fill(0); |
| 477 | 477 | |
| 478 | drawgfx_opaque(state->m_sprite_goal_collision_bitmap1, | |
| 478 | drawgfx_opaque(state->m_sprite_goal_collision_bitmap1,state->m_sprite_goal_collision_bitmap1->cliprect(),machine.gfx[0], | |
| 479 | 479 | code1,0, |
| 480 | 480 | 0,flipy1, |
| 481 | 481 | x1,y1); |
| 482 | 482 | |
| 483 | drawgfxzoom_transpen(state->m_sprite_goal_collision_bitmap2, | |
| 483 | drawgfxzoom_transpen(state->m_sprite_goal_collision_bitmap2,state->m_sprite_goal_collision_bitmap2->cliprect(),machine.gfx[1], | |
| 484 | 484 | 0,1, |
| 485 | 485 | 1,0, |
| 486 | 486 | x2,y2, |
| r13798 | r13799 | |
| 521 | 521 | x1 = 240 - x1; |
| 522 | 522 | y1 = 240 - y1; |
| 523 | 523 | |
| 524 | drawgfx_opaque(state->m_sprite_border_collision_bitmap, | |
| 524 | drawgfx_opaque(state->m_sprite_border_collision_bitmap,state->m_sprite_border_collision_bitmap->cliprect(),machine.gfx[0], | |
| 525 | 525 | code1,0, |
| 526 | 526 | 0,flipy1, |
| 527 | 527 | 0,0); |
| r13798 | r13799 | |
|---|---|---|
| 95 | 95 | UINT16 tile; |
| 96 | 96 | UINT8 color, region; |
| 97 | 97 | |
| 98 | bitmap->fill(0, | |
| 98 | bitmap->fill(0, | |
| 99 | 99 | |
| 100 | 100 | count = (state->m_crtc_vreg[0x0c]<<8)|(state->m_crtc_vreg[0x0d] & 0xff); |
| 101 | 101 |
| r13798 | r13799 | |
|---|---|---|
| 78 | 78 | int step_spr = step; \ |
| 79 | 79 | int bxs = 0, bys = 0; \ |
| 80 | 80 | 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; \ | |
| 85 | 85 | sx <<= 6; \ |
| 86 | 86 | sy <<= 6; \ |
| 87 | 87 | x <<= 6; \ |
| r13798 | r13799 | |
| 165 | 165 | old2 += 0x40; \ |
| 166 | 166 | } |
| 167 | 167 | |
| 168 | static void blit_nf_z(bitmap_t *bitmap, const rectangle | |
| 168 | static 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) | |
| 169 | 169 | { |
| 170 | 170 | z_decls(sx); |
| 171 | 171 | z_clamp_x_min(); |
| r13798 | r13799 | |
| 179 | 179 | } |
| 180 | 180 | } |
| 181 | 181 | |
| 182 | static void blit_fy_z(bitmap_t *bitmap, const rectangle | |
| 182 | static 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) | |
| 183 | 183 | { |
| 184 | 184 | z_decls(sx); |
| 185 | 185 | z_clamp_x_min(); |
| r13798 | r13799 | |
| 193 | 193 | } |
| 194 | 194 | } |
| 195 | 195 | |
| 196 | static void blit_fx_z(bitmap_t *bitmap, const rectangle | |
| 196 | static 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) | |
| 197 | 197 | { |
| 198 | 198 | z_decls(sx); |
| 199 | 199 | z_clamp_x_max(); |
| r13798 | r13799 | |
| 207 | 207 | } |
| 208 | 208 | } |
| 209 | 209 | |
| 210 | static void blit_fxy_z(bitmap_t *bitmap, const rectangle | |
| 210 | static 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) | |
| 211 | 211 | { |
| 212 | 212 | z_decls(sx); |
| 213 | 213 | z_clamp_x_max(); |
| r13798 | r13799 | |
| 221 | 221 | } |
| 222 | 222 | } |
| 223 | 223 | |
| 224 | static void (*const blit_z[4])(bitmap_t *bitmap, const rectangle | |
| 224 | static 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) = { | |
| 225 | 225 | blit_nf_z, |
| 226 | 226 | blit_fy_z, |
| 227 | 227 | blit_fx_z, |
| 228 | 228 | blit_fxy_z, |
| 229 | 229 | }; |
| 230 | 230 | |
| 231 | void sknsspr_device::skns_draw_sprites(running_machine &machine, bitmap_t *bitmap, const rectangle | |
| 231 | void 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) | |
| 232 | 232 | { |
| 233 | 233 | /*- SPR RAM Format -** |
| 234 | 234 | |
| r13798 | r13799 | |
| 475 | 475 | |
| 476 | 476 | for (xx = 0; xx<xsize; xx++) |
| 477 | 477 | { |
| 478 | if ((sx+xx < (cliprect | |
| 478 | if ((sx+xx < (cliprect. | |
| 479 | 479 | { |
| 480 | 480 | for (yy = 0; yy<ysize; yy++) |
| 481 | 481 | { |
| 482 | if ((sy+yy < (cliprect | |
| 482 | if ((sy+yy < (cliprect. | |
| 483 | 483 | { |
| 484 | 484 | int pix; |
| 485 | 485 | pix = decodebuffer[xsize*yy+xx]; |
| r13798 | r13799 | |
| 495 | 495 | |
| 496 | 496 | for (xx = 0; xx<xsize; xx++) |
| 497 | 497 | { |
| 498 | if ((sx+xx < (cliprect | |
| 498 | if ((sx+xx < (cliprect. | |
| 499 | 499 | { |
| 500 | 500 | for (yy = 0; yy<ysize; yy++) |
| 501 | 501 | { |
| 502 | if ((sy+(ysize-1-yy) < (cliprect | |
| 502 | if ((sy+(ysize-1-yy) < (cliprect. | |
| 503 | 503 | { |
| 504 | 504 | int pix; |
| 505 | 505 | pix = decodebuffer[xsize*yy+xx]; |
| r13798 | r13799 | |
| 515 | 515 | |
| 516 | 516 | for (xx = 0; xx<xsize; xx++) |
| 517 | 517 | { |
| 518 | if ( (sx+(xsize-1-xx) < (cliprect | |
| 518 | if ( (sx+(xsize-1-xx) < (cliprect. | |
| 519 | 519 | { |
| 520 | 520 | for (yy = 0; yy<ysize; yy++) |
| 521 | 521 | { |
| 522 | if ((sy+yy < (cliprect | |
| 522 | if ((sy+yy < (cliprect. | |
| 523 | 523 | { |
| 524 | 524 | int pix; |
| 525 | 525 | pix = decodebuffer[xsize*yy+xx]; |
| r13798 | r13799 | |
| 536 | 536 | |
| 537 | 537 | for (xx = 0; xx<xsize; xx++) |
| 538 | 538 | { |
| 539 | if ((sx+(xsize-1-xx) < (cliprect | |
| 539 | if ((sx+(xsize-1-xx) < (cliprect. | |
| 540 | 540 | { |
| 541 | 541 | for (yy = 0; yy<ysize; yy++) |
| 542 | 542 | { |
| 543 | if ((sy+(ysize-1-yy) < (cliprect | |
| 543 | if ((sy+(ysize-1-yy) < (cliprect. | |
| 544 | 544 | { |
| 545 | 545 | int pix; |
| 546 | 546 | pix = decodebuffer[xsize*yy+xx]; |
| r13798 | r13799 | |
|---|---|---|
| 369 | 369 | * |
| 370 | 370 | *************************************/ |
| 371 | 371 | |
| 372 | static void draw_sprites(running_machine &machine, bitmap_t *bitmap, const rectangle | |
| 372 | static void draw_sprites(running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect, int xoffset) | |
| 373 | 373 | { |
| 374 | 374 | system1_state *state = machine.driver_data<system1_state>(); |
| 375 | 375 | UINT32 gfxbanks = machine.region("sprites")->bytes() / 0x8000; |
| r13798 | r13799 | |
| 421 | 421 | srcaddr += stride; |
| 422 | 422 | |
| 423 | 423 | /* skip if outside of our clipping area */ |
| 424 | if (y < cliprect | |
| 424 | if (y < cliprect. | |
| 425 | 425 | continue; |
| 426 | 426 | |
| 427 | 427 | /* iterate over X */ |
| r13798 | r13799 | |
| 455 | 455 | for (i = 0; i < 2; i++) |
| 456 | 456 | { |
| 457 | 457 | int effx = flipscreen ? 0x1fe - (x + i) : (x + i); |
| 458 | if (effx >= cliprect | |
| 458 | if (effx >= cliprect. | |
| 459 | 459 | { |
| 460 | 460 | int prevpix = destbase[effx]; |
| 461 | 461 | |
| r13798 | r13799 | |
| 476 | 476 | for (i = 0; i < 2; i++) |
| 477 | 477 | { |
| 478 | 478 | int effx = flipscreen ? 0x1fe - (x + 2 + i) : (x + 2 + i); |
| 479 | if (effx >= cliprect | |
| 479 | if (effx >= cliprect. | |
| 480 | 480 | { |
| 481 | 481 | int prevpix = destbase[effx]; |
| 482 | 482 | |
| r13798 | r13799 | |
| 499 | 499 | * |
| 500 | 500 | *************************************/ |
| 501 | 501 | |
| 502 | static void video_update_common(screen_device &screen, bitmap_t *bitmap, const rectangle | |
| 502 | static 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) | |
| 503 | 503 | { |
| 504 | 504 | system1_state *state = screen.machine().driver_data<system1_state>(); |
| 505 | 505 | const UINT8 *lookup = screen.machine().region("proms")->base(); |
| 506 | 506 | int x, y; |
| 507 | 507 | |
| 508 | 508 | /* first clear the sprite bitmap and draw sprites within this area */ |
| 509 | state->m_sprite_bitmap->fill(0, | |
| 509 | state->m_sprite_bitmap->fill(0, | |
| 510 | 510 | draw_sprites(screen.machine(), state->m_sprite_bitmap, cliprect, spritexoffs); |
| 511 | 511 | |
| 512 | 512 | /* iterate over rows */ |
| 513 | for (y = cliprect | |
| 513 | for (y = cliprect. | |
| 514 | 514 | { |
| 515 | 515 | UINT16 *fgbase = &fgpixmap->pix16(y & 0xff); |
| 516 | 516 | UINT16 *sprbase = &state->m_sprite_bitmap->pix16(y & 0xff); |
| r13798 | r13799 | |
| 524 | 524 | bgbase[1] = &bgpixmaps[(bgy >> 8) * 2 + 1]->pix16(bgy & 0xff); |
| 525 | 525 | |
| 526 | 526 | /* iterate over pixels */ |
| 527 | for (x = cliprect | |
| 527 | for (x = cliprect. | |
| 528 | 528 | { |
| 529 | 529 | int bgx = ((x - bgxscroll) / 2) & 0x1ff; |
| 530 | 530 | UINT16 fgpix = fgbase[x / 2]; |
| r13798 | r13799 | |
|---|---|---|
| 263 | 263 | #define SIGN_EXTEND_POS(_var_) {_var_ &= 0x3ff; if (_var_ > 0x1ff) _var_ -= 0x400;} |
| 264 | 264 | |
| 265 | 265 | |
| 266 | static void draw_sprites(running_machine &machine, bitmap_t *bitmap,const rectangle | |
| 266 | static void draw_sprites(running_machine &machine, bitmap_t *bitmap,const rectangle &cliprect) | |
| 267 | 267 | { |
| 268 | 268 | powerins_state *state = machine.driver_data<powerins_state>(); |
| 269 | 269 | UINT16 *source = state->m_spriteram + 0x8000/2; |
| r13798 | r13799 | |
| 368 | 368 | #endif |
| 369 | 369 | |
| 370 | 370 | if (layers_ctrl&1) tilemap_draw(bitmap,cliprect, state->m_tilemap_0, 0, 0); |
| 371 | else bitmap->fill(0, | |
| 371 | else bitmap->fill(0, | |
| 372 | 372 | if (layers_ctrl&8) draw_sprites(screen.machine(),bitmap,cliprect); |
| 373 | 373 | if (layers_ctrl&2) tilemap_draw(bitmap,cliprect, state->m_tilemap_1, 0, 0); |
| 374 | 374 | return 0; |
| r13798 | r13799 | |
|---|---|---|
| 114 | 114 | |
| 115 | 115 | static void refresh_palette_data(running_machine &machine); |
| 116 | 116 | static int stv_vdp2_window_process(running_machine &machine,int x,int y); |
| 117 | static int stv_vdp2_apply_window_on_layer(running_machine &machine,rectangle | |
| 117 | static int stv_vdp2_apply_window_on_layer(running_machine &machine,rectangle &cliprect); | |
| 118 | 118 | static void stv_vdp2_get_window0_coordinates(running_machine &machine,UINT16 *s_x, UINT16 *e_x, UINT16 *s_y, UINT16 *e_y); |
| 119 | static void stv_vdp2_check_tilemap(running_machine &machine, bitmap_t *bitmap, const rectangle | |
| 119 | static void stv_vdp2_check_tilemap(running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect); | |
| 120 | 120 | |
| 121 | 121 | enum |
| 122 | 122 | { |
| r13798 | r13799 | |
| 2447 | 2447 | } |
| 2448 | 2448 | |
| 2449 | 2449 | static void stv_vdp2_drawgfxzoom( |
| 2450 | bitmap_t *dest_bmp,const rectangle | |
| 2450 | bitmap_t *dest_bmp,const rectangle &clip,const gfx_element *gfx, | |
| 2451 | 2451 | UINT32 code,UINT32 color,int flipx,int flipy,int sx,int sy, |
| 2452 | 2452 | int transparency,int transparent_color,int scalex, int scaley, |
| 2453 | 2453 | int sprite_screen_width, int sprite_screen_height, int alpha) |
| r13798 | r13799 | |
| 2479 | 2479 | |
| 2480 | 2480 | |
| 2481 | 2481 | /* 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(); | |
| 2488 | 2484 | |
| 2489 | 2485 | if( gfx ) |
| 2490 | 2486 | { |
| r13798 | r13799 | |
| 2528 | 2524 | y_index = 0; |
| 2529 | 2525 | } |
| 2530 | 2526 | |
| 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; | |
| 2556 | 2532 | } |
| 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 | } | |
| 2557 | 2550 | |
| 2558 | 2551 | if( ex>sx ) |
| 2559 | 2552 | { /* skip if inner loop doesn't draw anything */ |
| r13798 | r13799 | |
| 2767 | 2760 | *rgb = (_r << 10) | (_g << 5) | _b; |
| 2768 | 2761 | } |
| 2769 | 2762 | |
| 2770 | static void stv_vdp2_drawgfx_rgb555( bitmap_t *dest_bmp, const rectangle | |
| 2763 | static void stv_vdp2_drawgfx_rgb555( bitmap_t *dest_bmp, const rectangle &clip, running_machine &machine, UINT32 code, int flipx, int flipy, | |
| 2771 | 2764 | int sx, int sy, int transparency, int alpha) |
| 2772 | 2765 | { |
| 2773 | 2766 | saturn_state *state = machine.driver_data<saturn_state>(); |
| r13798 | r13799 | |
| 2780 | 2773 | sprite_screen_width = sprite_screen_height = 8; |
| 2781 | 2774 | |
| 2782 | 2775 | /* KW 991012 -- Added code to force clip to bitmap boundary */ |
| 2783 | if(clip) | |
| 2776 | myclip = clip; | |
| 2777 | myclip &= dest_bmp->cliprect(); | |
| 2778 | ||
| 2784 | 2779 | { |
| 2785 | myclip = *clip; | |
| 2786 | myclip &= dest_bmp->cliprect(); | |
| 2787 | clip=&myclip; | |
| 2788 | } | |
| 2789 | { | |
| 2790 | 2780 | int dx = stv2_current_tilemap.incx; |
| 2791 | 2781 | int dy = stv2_current_tilemap.incy; |
| 2792 | 2782 | |
| r13798 | r13799 | |
| 2816 | 2806 | y_index = 0; |
| 2817 | 2807 | } |
| 2818 | 2808 | |
| 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; | |
| 2844 | 2814 | } |
| 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 | } | |
| 2845 | 2832 | |
| 2846 | 2833 | if( ex>sx ) |
| 2847 | 2834 | { /* skip if inner loop doesn't draw anything */ |
| r13798 | r13799 | |
| 2886 | 2873 | } |
| 2887 | 2874 | |
| 2888 | 2875 | |
| 2889 | static void stv_vdp2_drawgfx_rgb888( bitmap_t *dest_bmp, const rectangle | |
| 2876 | static void stv_vdp2_drawgfx_rgb888( bitmap_t *dest_bmp, const rectangle &clip, running_machine &machine, UINT32 code, int flipx, int flipy, | |
| 2890 | 2877 | int sx, int sy, int transparency, int alpha) |
| 2891 | 2878 | { |
| 2892 | 2879 | saturn_state *state = machine.driver_data<saturn_state>(); |
| r13798 | r13799 | |
| 2899 | 2886 | sprite_screen_width = sprite_screen_height = 8; |
| 2900 | 2887 | |
| 2901 | 2888 | /* KW 991012 -- Added code to force clip to bitmap boundary */ |
| 2902 | if(clip) | |
| 2889 | myclip = clip; | |
| 2890 | myclip &= dest_bmp->cliprect(); | |
| 2903 | 2891 | { |
| 2904 | myclip = *clip; | |
| 2905 | myclip &= dest_bmp->cliprect(); | |
| 2906 | clip=&myclip; | |
| 2907 | } | |
| 2908 | { | |
| 2909 | 2892 | int dx = stv2_current_tilemap.incx; |
| 2910 | 2893 | int dy = stv2_current_tilemap.incy; |
| 2911 | 2894 | |
| r13798 | r13799 | |
| 2935 | 2918 | y_index = 0; |
| 2936 | 2919 | } |
| 2937 | 2920 | |
| 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; | |
| 2963 | 2926 | } |
| 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 | } | |
| 2964 | 2944 | |
| 2965 | 2945 | if( ex>sx ) |
| 2966 | 2946 | { /* skip if inner loop doesn't draw anything */ |
| r13798 | r13799 | |
| 3010 | 2990 | |
| 3011 | 2991 | } |
| 3012 | 2992 | |
| 3013 | static void stv_vdp2_draw_basic_bitmap(running_machine &machine, bitmap_t *bitmap, const rectangle | |
| 2993 | static void stv_vdp2_draw_basic_bitmap(running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect) | |
| 3014 | 2994 | { |
| 3015 | 2995 | saturn_state *state = machine.driver_data<saturn_state>(); |
| 3016 | 2996 | |
| r13798 | r13799 | |
| 3133 | 3113 | { |
| 3134 | 3114 | //int gfx_wraparound = -1; |
| 3135 | 3115 | |
| 3136 | gfxdata += xlinesize*cliprect | |
| 3116 | gfxdata += xlinesize*cliprect. | |
| 3137 | 3117 | |
| 3138 | for (ycnt = cliprect | |
| 3118 | for (ycnt = cliprect. | |
| 3139 | 3119 | { |
| 3140 | for (xcnt = cliprect | |
| 3120 | for (xcnt = cliprect. | |
| 3141 | 3121 | { |
| 3142 | 3122 | int xs = xcnt & xsizemask; |
| 3143 | 3123 | |
| r13798 | r13799 | |
| 3178 | 3158 | else |
| 3179 | 3159 | { |
| 3180 | 3160 | int xx, xs, yy=0; |
| 3181 | for (ycnt = cliprect | |
| 3161 | for (ycnt = cliprect. | |
| 3182 | 3162 | { |
| 3183 | 3163 | gfxdata += xlinesize*(yy>>16); |
| 3184 | 3164 | yy &= 0xffff; |
| 3185 | 3165 | |
| 3186 | 3166 | destline = &bitmap->pix16(ycnt); |
| 3187 | 3167 | xx = 0; |
| 3188 | for (xcnt = cliprect | |
| 3168 | for (xcnt = cliprect. | |
| 3189 | 3169 | { |
| 3190 | 3170 | xs = xx >> 16; |
| 3191 | 3171 | tw = stv_vdp2_window_process(machine,xcnt,ycnt); |
| r13798 | r13799 | |
| 3249 | 3229 | if ( stv2_current_tilemap.incx == 0x10000 && stv2_current_tilemap.incy == 0x10000 ) |
| 3250 | 3230 | { |
| 3251 | 3231 | /* adjust for cliprect */ |
| 3252 | gfxdata += xlinesize*cliprect | |
| 3232 | gfxdata += xlinesize*cliprect. | |
| 3253 | 3233 | |
| 3254 | for (ycnt = cliprect | |
| 3234 | for (ycnt = cliprect. | |
| 3255 | 3235 | { |
| 3256 | 3236 | destline = &bitmap->pix16(ycnt); |
| 3257 | 3237 | |
| 3258 | for (xcnt = cliprect | |
| 3238 | for (xcnt = cliprect. | |
| 3259 | 3239 | { |
| 3260 | 3240 | int r,g,b; |
| 3261 | 3241 | int xs = xcnt & xsizemask; |
| r13798 | r13799 | |
| 3294 | 3274 | { |
| 3295 | 3275 | int xx, xs, yy=0; |
| 3296 | 3276 | |
| 3297 | for (ycnt = cliprect | |
| 3277 | for (ycnt = cliprect. | |
| 3298 | 3278 | { |
| 3299 | 3279 | gfxdata += xlinesize*(yy>>16); |
| 3300 | 3280 | yy &= 0xffff; |
| 3301 | 3281 | |
| 3302 | 3282 | destline = &bitmap->pix16(ycnt); |
| 3303 | 3283 | xx = 0; |
| 3304 | for (xcnt = cliprect | |
| 3284 | for (xcnt = cliprect. | |
| 3305 | 3285 | { |
| 3306 | 3286 | int r,g,b; |
| 3307 | 3287 | |
| r13798 | r13799 | |
| 3345 | 3325 | */ |
| 3346 | 3326 | case 4: |
| 3347 | 3327 | /* adjust for cliprect */ |
| 3348 | gfxdata += xlinesize*(cliprect | |
| 3328 | gfxdata += xlinesize*(cliprect. | |
| 3349 | 3329 | |
| 3350 | for (ycnt = cliprect | |
| 3330 | for (ycnt = cliprect. | |
| 3351 | 3331 | { |
| 3352 | 3332 | destline = &bitmap->pix16(ycnt); |
| 3353 | 3333 | |
| 3354 | for (xcnt = cliprect | |
| 3334 | for (xcnt = cliprect. | |
| 3355 | 3335 | { |
| 3356 | 3336 | int r,g,b; |
| 3357 | 3337 | int xs = xcnt & xsizemask; |
| r13798 | r13799 | |
| 3565 | 3545 | *_map = map; |
| 3566 | 3546 | } |
| 3567 | 3547 | |
| 3568 | static void stv_vdp2_draw_basic_tilemap(running_machine &machine, bitmap_t *bitmap, const rectangle | |
| 3548 | static void stv_vdp2_draw_basic_tilemap(running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect) | |
| 3569 | 3549 | { |
| 3570 | 3550 | saturn_state *state = machine.driver_data<saturn_state>(); |
| 3571 | 3551 | /* hopefully this is easier to follow than it is efficient .. */ |
| r13798 | r13799 | |
| 3799 | 3779 | { |
| 3800 | 3780 | int drawyposinc = tilesizey*(stv2_current_tilemap.tile_size ? 2 : 1); |
| 3801 | 3781 | drawypos = -(stv2_current_tilemap.scrolly*scaley); |
| 3802 | while( ((drawypos + drawyposinc) >> 16) < cliprect | |
| 3782 | while( ((drawypos + drawyposinc) >> 16) < cliprect. | |
| 3803 | 3783 | { |
| 3804 | 3784 | drawypos += drawyposinc; |
| 3805 | 3785 | y++; |
| r13798 | r13799 | |
| 3810 | 3790 | { |
| 3811 | 3791 | drawypos += tilesizey*(stv2_current_tilemap.tile_size ? 2 : 1); |
| 3812 | 3792 | } |
| 3813 | if ((drawypos >> 16) > cliprect | |
| 3793 | if ((drawypos >> 16) > cliprect. | |
| 3814 | 3794 | |
| 3815 | 3795 | ypageoffs = y & (pgtiles_y-1); |
| 3816 | 3796 | |
| r13798 | r13799 | |
| 3822 | 3802 | { |
| 3823 | 3803 | int drawxposinc = tilesizex*(stv2_current_tilemap.tile_size ? 2 : 1); |
| 3824 | 3804 | drawxpos = -(stv2_current_tilemap.scrollx*scalex); |
| 3825 | while( ((drawxpos + drawxposinc) >> 16) < cliprect | |
| 3805 | while( ((drawxpos + drawxposinc) >> 16) < cliprect. | |
| 3826 | 3806 | { |
| 3827 | 3807 | drawxpos += drawxposinc; |
| 3828 | 3808 | x++; |
| r13798 | r13799 | |
| 3833 | 3813 | { |
| 3834 | 3814 | drawxpos+=tilesizex*(stv2_current_tilemap.tile_size ? 2 : 1); |
| 3835 | 3815 | } |
| 3836 | if ( (drawxpos >> 16) > cliprect | |
| 3816 | if ( (drawxpos >> 16) > cliprect. | |
| 3837 | 3817 | |
| 3838 | 3818 | xpageoffs = x & (pgtiles_x-1); |
| 3839 | 3819 | |
| r13798 | r13799 | |
| 4016 | 3996 | |
| 4017 | 3997 | if ( LOG_VDP2 ) |
| 4018 | 3998 | { |
| 4019 | logerror( "Layer RBG%d, size %d x %d\n", stv2_current_tilemap.layer_name & 0x7f, cliprect | |
| 3999 | logerror( "Layer RBG%d, size %d x %d\n", stv2_current_tilemap.layer_name & 0x7f, cliprect. | |
| 4020 | 4000 | logerror( "Tiles: min %08X, max %08X\n", tilecodemin, tilecodemax ); |
| 4021 | 4001 | logerror( "MAP size in dwords %08X\n", mpsize_dwords ); |
| 4022 | 4002 | for (i = 0; i < stv2_current_tilemap.map_count; i++) |
| r13798 | r13799 | |
| 4057 | 4037 | } |
| 4058 | 4038 | |
| 4059 | 4039 | |
| 4060 | static void stv_vdp2_check_tilemap_with_linescroll(running_machine &machine, bitmap_t *bitmap, const rectangle | |
| 4040 | static void stv_vdp2_check_tilemap_with_linescroll(running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect) | |
| 4061 | 4041 | { |
| 4062 | 4042 | saturn_state *state = machine.driver_data<saturn_state>(); |
| 4063 | 4043 | rectangle mycliprect; |
| 4064 | int cur_line = cliprect | |
| 4044 | int cur_line = cliprect. | |
| 4065 | 4045 | int address; |
| 4066 | 4046 | int active_functions = 0; |
| 4067 | 4047 | INT32 scroll_values[3], prev_scroll_values[3]; |
| r13798 | r13799 | |
| 4087 | 4067 | stv2_current_tilemap.linezoom_enable = 0; |
| 4088 | 4068 | |
| 4089 | 4069 | // prepare working clipping rectangle |
| 4090 | memcpy( &mycliprect, cliprect, sizeof(rectangle) ); | |
| 4070 | memcpy( &mycliprect, &cliprect, sizeof(rectangle) ); | |
| 4091 | 4071 | |
| 4092 | 4072 | // calculate the number of active functions |
| 4093 | 4073 | if ( linescroll_enable ) active_functions++; |
| r13798 | r13799 | |
| 4099 | 4079 | if ( linezoom_enable ) active_functions++; |
| 4100 | 4080 | |
| 4101 | 4081 | // address of data table |
| 4102 | address = stv2_current_tilemap.linescroll_table_address + active_functions*4*cliprect | |
| 4082 | address = stv2_current_tilemap.linescroll_table_address + active_functions*4*cliprect. | |
| 4103 | 4083 | |
| 4104 | 4084 | // get the first scroll values |
| 4105 | 4085 | for ( i = 0; i < active_functions; i++ ) |
| r13798 | r13799 | |
| 4115 | 4095 | } |
| 4116 | 4096 | } |
| 4117 | 4097 | |
| 4118 | while( cur_line <= cliprect | |
| 4098 | while( cur_line <= cliprect. | |
| 4119 | 4099 | { |
| 4120 | 4100 | lines = 0; |
| 4121 | 4101 | do |
| r13798 | r13799 | |
| 4146 | 4126 | { |
| 4147 | 4127 | scroll_values_equal &= (scroll_values[i] == prev_scroll_values[i]); |
| 4148 | 4128 | } |
| 4149 | } while( scroll_values_equal && ((cur_line + lines) <= cliprect | |
| 4129 | } while( scroll_values_equal && ((cur_line + lines) <= cliprect. | |
| 4150 | 4130 | |
| 4151 | 4131 | // determined how many lines can be drawn |
| 4152 | 4132 | // prepare clipping rectangle |
| r13798 | r13799 | |
| 4181 | 4161 | |
| 4182 | 4162 | // 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 ); |
| 4183 | 4163 | // render current tilemap portion |
| 4184 | stv_vdp2_check_tilemap(machine, bitmap, | |
| 4164 | stv_vdp2_check_tilemap(machine, bitmap, | |
| 4185 | 4165 | |
| 4186 | 4166 | // update parameters for next iteration |
| 4187 | 4167 | memcpy( prev_scroll_values, scroll_values, sizeof(scroll_values)); |
| r13798 | r13799 | |
| 4189 | 4169 | } |
| 4190 | 4170 | } |
| 4191 | 4171 | |
| 4192 | static void stv_vdp2_draw_line(running_machine &machine, bitmap_t *bitmap, const rectangle | |
| 4172 | static void stv_vdp2_draw_line(running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect) | |
| 4193 | 4173 | { |
| 4194 | 4174 | saturn_state *state = machine.driver_data<saturn_state>(); |
| 4195 | 4175 | int x,y; |
| r13798 | r13799 | |
| 4203 | 4183 | { |
| 4204 | 4184 | base_mask = STV_VDP2_VRAMSZ ? 0x7ffff : 0x3ffff; |
| 4205 | 4185 | |
| 4206 | for(y=cliprect | |
| 4186 | for(y=cliprect. | |
| 4207 | 4187 | { |
| 4208 | 4188 | base_offs = (STV_VDP2_LCTA & base_mask) << 1; |
| 4209 | 4189 | |
| 4210 | 4190 | if(STV_VDP2_LCCLMD) |
| 4211 | 4191 | base_offs += (y / interlace) << 1; |
| 4212 | 4192 | |
| 4213 | for(x=cliprect | |
| 4193 | for(x=cliprect. | |
| 4214 | 4194 | { |
| 4215 | 4195 | UINT16 pen; |
| 4216 | 4196 | |
| r13798 | r13799 | |
| 4223 | 4203 | } |
| 4224 | 4204 | } |
| 4225 | 4205 | |
| 4226 | static void stv_vdp2_draw_mosaic(running_machine &machine, bitmap_t *bitmap, const rectangle | |
| 4206 | static void stv_vdp2_draw_mosaic(running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect, UINT8 is_roz) | |
| 4227 | 4207 | { |
| 4228 | 4208 | saturn_state *state = machine.driver_data<saturn_state>(); |
| 4229 | 4209 | int x,y,xi,yi; |
| r13798 | r13799 | |
| 4242 | 4222 | if(STV_VDP2_LSMD == 3) |
| 4243 | 4223 | v_size <<= 1; |
| 4244 | 4224 | |
| 4245 | for(y=cliprect | |
| 4225 | for(y=cliprect. | |
| 4246 | 4226 | { |
| 4247 | for(x=cliprect | |
| 4227 | for(x=cliprect. | |
| 4248 | 4228 | { |
| 4249 | 4229 | pix = bitmap->pix16(y, x); |
| 4250 | 4230 | |
| r13798 | r13799 | |
| 4255 | 4235 | } |
| 4256 | 4236 | } |
| 4257 | 4237 | |
| 4258 | static void stv_vdp2_check_tilemap(running_machine &machine, bitmap_t *bitmap, const rectangle | |
| 4238 | static void stv_vdp2_check_tilemap(running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect) | |
| 4259 | 4239 | { |
| 4260 | 4240 | /* the idea is here we check the tilemap capabilities / whats enabled and call an appropriate tilemap drawing routine, or |
| 4261 | 4241 | at the very list throw up a few errors if the tilemaps want to do something we don't support yet */ |
| r13798 | r13799 | |
| 4263 | 4243 | |
| 4264 | 4244 | // int window_applied = 0; |
| 4265 | 4245 | 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; | |
| 4270 | 4250 | |
| 4271 | 4251 | if ( stv2_current_tilemap.linescroll_enable || |
| 4272 | 4252 | stv2_current_tilemap.vertical_linescroll_enable || |
| r13798 | r13799 | |
| 4277 | 4257 | } |
| 4278 | 4258 | |
| 4279 | 4259 | // window_applied = |
| 4280 | stv_vdp2_apply_window_on_layer(machine, | |
| 4260 | stv_vdp2_apply_window_on_layer(machine, | |
| 4281 | 4261 | |
| 4282 | 4262 | if (stv2_current_tilemap.bitmap_enable) // this layer is a bitmap |
| 4283 | 4263 | { |
| r13798 | r13799 | |
| 4285 | 4265 | //if ( window_applied && stv2_current_tilemap.colour_depth != 4) |
| 4286 | 4266 | // stv2_current_tilemap.window_control = 0; |
| 4287 | 4267 | |
| 4288 | stv_vdp2_draw_basic_bitmap(machine, bitmap, | |
| 4268 | stv_vdp2_draw_basic_bitmap(machine, bitmap, | |
| 4289 | 4269 | } |
| 4290 | 4270 | else |
| 4291 | 4271 | { |
| 4292 | stv_vdp2_draw_basic_tilemap(machine, bitmap, | |
| 4272 | stv_vdp2_draw_basic_tilemap(machine, bitmap, | |
| 4293 | 4273 | } |
| 4294 | 4274 | |
| 4295 | 4275 | /* post-processing functions (TODO: needs layer bitmaps to be individual planes to work correctly) */ |
| r13798 | r13799 | |
| 4369 | 4349 | } |
| 4370 | 4350 | } |
| 4371 | 4351 | |
| 4372 | static void stv_vdp2_draw_rotation_screen(running_machine &machine, bitmap_t *bitmap, const rectangle | |
| 4352 | static void stv_vdp2_draw_rotation_screen(running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect, int iRP); | |
| 4373 | 4353 | |
| 4374 | 4354 | |
| 4375 | 4355 | static void stv_vdp2_copy_roz_bitmap(bitmap_t *bitmap, |
| 4376 | 4356 | running_machine &machine, |
| 4377 | 4357 | bitmap_t *roz_bitmap, |
| 4378 | const rectangle | |
| 4358 | const rectangle &cliprect, | |
| 4379 | 4359 | int iRP, |
| 4380 | 4360 | int planesizex, |
| 4381 | 4361 | int planesizey, |
| r13798 | r13799 | |
| 4510 | 4490 | 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; |
| 4511 | 4491 | 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; |
| 4512 | 4492 | |
| 4513 | for (vcnt = cliprect | |
| 4493 | for (vcnt = cliprect. | |
| 4514 | 4494 | { |
| 4515 | 4495 | /*xsp = RP.A * ( ( RP.xst + RP.dxst * (vcnt << 16) ) - RP.px ) + |
| 4516 | 4496 | RP.B * ( ( RP.yst + RP.dyst * (vcnt << 16) ) - RP.py ) + |
| r13798 | r13799 | |
| 4601 | 4581 | dxs = mul_fixed32( kx, mul_fixed32( dx, 1 << (16-hcnt_shift))); |
| 4602 | 4582 | dys = mul_fixed32( ky, mul_fixed32( dy, 1 << (16-hcnt_shift))); |
| 4603 | 4583 | |
| 4604 | for (hcnt = cliprect | |
| 4584 | for (hcnt = cliprect. | |
| 4605 | 4585 | { |
| 4606 | 4586 | x = xs >> 16; |
| 4607 | 4587 | y = ys >> 16; |
| r13798 | r13799 | |
| 4649 | 4629 | } |
| 4650 | 4630 | else |
| 4651 | 4631 | { |
| 4652 | for (hcnt = cliprect | |
| 4632 | for (hcnt = cliprect. | |
| 4653 | 4633 | { |
| 4654 | 4634 | switch( coeff_table_size ) |
| 4655 | 4635 | { |
| r13798 | r13799 | |
| 4760 | 4740 | } |
| 4761 | 4741 | } |
| 4762 | 4742 | |
| 4763 | static void stv_vdp2_draw_NBG0(running_machine &machine, bitmap_t *bitmap, const rectangle | |
| 4743 | static void stv_vdp2_draw_NBG0(running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect) | |
| 4764 | 4744 | { |
| 4765 | 4745 | saturn_state *state = machine.driver_data<saturn_state>(); |
| 4766 | 4746 | UINT32 base_mask; |
| r13798 | r13799 | |
| 4862 | 4842 | stv_vdp2_check_tilemap(machine, bitmap, cliprect); |
| 4863 | 4843 | } |
| 4864 | 4844 | |
| 4865 | static void stv_vdp2_draw_NBG1(running_machine &machine, bitmap_t *bitmap, const rectangle | |
| 4845 | static void stv_vdp2_draw_NBG1(running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect) | |
| 4866 | 4846 | { |
| 4867 | 4847 | saturn_state *state = machine.driver_data<saturn_state>(); |
| 4868 | 4848 | UINT32 base_mask; |
| r13798 | r13799 | |
| 4960 | 4940 | stv_vdp2_check_tilemap(machine, bitmap, cliprect); |
| 4961 | 4941 | } |
| 4962 | 4942 | |
| 4963 | static void stv_vdp2_draw_NBG2(running_machine &machine, bitmap_t *bitmap, const rectangle | |
| 4943 | static void stv_vdp2_draw_NBG2(running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect) | |
| 4964 | 4944 | { |
| 4965 | 4945 | saturn_state *state = machine.driver_data<saturn_state>(); |
| 4966 | 4946 | |
| r13798 | r13799 | |
| 5065 | 5045 | stv_vdp2_check_tilemap(machine, bitmap, cliprect); |
| 5066 | 5046 | } |
| 5067 | 5047 | |
| 5068 | static void stv_vdp2_draw_NBG3(running_machine &machine, bitmap_t *bitmap, const rectangle | |
| 5048 | static void stv_vdp2_draw_NBG3(running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect) | |
| 5069 | 5049 | { |
| 5070 | 5050 | saturn_state *state = machine.driver_data<saturn_state>(); |
| 5071 | 5051 | /* |
| r13798 | r13799 | |
| 5170 | 5150 | } |
| 5171 | 5151 | |
| 5172 | 5152 | |
| 5173 | static void stv_vdp2_draw_rotation_screen(running_machine &machine, bitmap_t *bitmap, const rectangle | |
| 5153 | static void stv_vdp2_draw_rotation_screen(running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect, int iRP) | |
| 5174 | 5154 | { |
| 5175 | 5155 | saturn_state *state = machine.driver_data<saturn_state>(); |
| 5176 | 5156 | rectangle roz_clip_rect, mycliprect; |
| r13798 | r13799 | |
| 5313 | 5293 | memcmp(&stv_rbg_cache_data.layer_data[iRP-1],&stv2_current_tilemap,sizeof(stv2_current_tilemap)) != 0 ) |
| 5314 | 5294 | { |
| 5315 | 5295 | 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], | |
| 5296 | stv_vdp2_check_tilemap(machine, state->m_vdp2.roz_bitmap[iRP-1], | |
| 5317 | 5297 | // prepare cache data |
| 5318 | 5298 | stv_rbg_cache_data.watch_vdp2_vram_writes |= iRP; |
| 5319 | 5299 | stv_rbg_cache_data.is_cache_dirty &= ~iRP; |
| r13798 | r13799 | |
| 5334 | 5314 | stv2_current_tilemap.transparency = STV_TRANSPARENCY_ALPHA; |
| 5335 | 5315 | } |
| 5336 | 5316 | |
| 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; | |
| 5341 | 5321 | |
| 5342 | 5322 | if ( window_control ) |
| 5343 | 5323 | { |
| 5344 | 5324 | stv2_current_tilemap.window_control = window_control; |
| 5345 | stv_vdp2_apply_window_on_layer(machine, | |
| 5325 | stv_vdp2_apply_window_on_layer(machine, | |
| 5346 | 5326 | } |
| 5347 | 5327 | |
| 5348 | 5328 | stv2_current_tilemap.fade_control = fade_control; |
| 5349 | 5329 | |
| 5350 | 5330 | g_profiler.start(PROFILER_USER2); |
| 5351 | stv_vdp2_copy_roz_bitmap(bitmap, machine, state->m_vdp2.roz_bitmap[iRP-1], | |
| 5331 | stv_vdp2_copy_roz_bitmap(bitmap, machine, state->m_vdp2.roz_bitmap[iRP-1], | |
| 5352 | 5332 | g_profiler.stop(); |
| 5353 | 5333 | } |
| 5354 | 5334 | |
| 5355 | 5335 | } |
| 5356 | 5336 | |
| 5357 | static void stv_vdp2_draw_RBG0(running_machine &machine, bitmap_t *bitmap, const rectangle | |
| 5337 | static void stv_vdp2_draw_RBG0(running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect) | |
| 5358 | 5338 | { |
| 5359 | 5339 | saturn_state *state = machine.driver_data<saturn_state>(); |
| 5360 | 5340 | /* |
| r13798 | r13799 | |
| 5457 | 5437 | |
| 5458 | 5438 | } |
| 5459 | 5439 | |
| 5460 | static void stv_vdp2_draw_back(running_machine &machine, bitmap_t *bitmap, const rectangle | |
| 5440 | static void stv_vdp2_draw_back(running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect) | |
| 5461 | 5441 | { |
| 5462 | 5442 | saturn_state *state = machine.driver_data<saturn_state>(); |
| 5463 | 5443 | int x,y; |
| r13798 | r13799 | |
| 5471 | 5451 | |
| 5472 | 5452 | /* draw black if BDCLMD and DISP are cleared */ |
| 5473 | 5453 | if(!(STV_VDP2_BDCLMD) && !(STV_VDP2_DISP)) |
| 5474 | bitmap->fill(get_black_pen(machine), | |
| 5454 | bitmap->fill(get_black_pen(machine), | |
| 5475 | 5455 | else |
| 5476 | 5456 | { |
| 5477 | 5457 | base_mask = STV_VDP2_VRAMSZ ? 0x7ffff : 0x3ffff; |
| 5478 | 5458 | |
| 5479 | for(y=cliprect | |
| 5459 | for(y=cliprect. | |
| 5480 | 5460 | { |
| 5481 | 5461 | base_offs = ((STV_VDP2_BKTA ) & base_mask) << 1; |
| 5482 | 5462 | if(STV_VDP2_BKCLMD) |
| 5483 | 5463 | base_offs += ((y / interlace) << 1); |
| 5484 | 5464 | |
| 5485 | for(x=cliprect | |
| 5465 | for(x=cliprect. | |
| 5486 | 5466 | { |
| 5487 | 5467 | int r,g,b; |
| 5488 | 5468 | UINT16 dot; |
| r13798 | r13799 | |
| 6247 | 6227 | return stv2_current_tilemap.window_control & 1 ? (w0_pix & w1_pix) : (w0_pix | w1_pix); |
| 6248 | 6228 | } |
| 6249 | 6229 | |
| 6250 | static int stv_vdp2_apply_window_on_layer(running_machine &machine,rectangle | |
| 6230 | static int stv_vdp2_apply_window_on_layer(running_machine &machine,rectangle &cliprect) | |
| 6251 | 6231 | { |
| 6252 | 6232 | //saturn_state *state = machine.driver_data<saturn_state>(); |
| 6253 | 6233 | UINT16 s_x=0,e_x=0,s_y=0,e_y=0; |
| r13798 | r13799 | |
| 6257 | 6237 | /* w0, transparent outside supported */ |
| 6258 | 6238 | stv_vdp2_get_window0_coordinates(machine,&s_x, &e_x, &s_y, &e_y); |
| 6259 | 6239 | |
| 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; | |
| 6264 | 6244 | |
| 6265 | 6245 | return 1; |
| 6266 | 6246 | } |
| r13798 | r13799 | |
| 6269 | 6249 | /* w1, transparent outside supported */ |
| 6270 | 6250 | stv_vdp2_get_window1_coordinates(machine,&s_x, &e_x, &s_y, &e_y); |
| 6271 | 6251 | |
| 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; | |
| 6276 | 6256 | |
| 6277 | 6257 | return 1; |
| 6278 | 6258 | } |
| r13798 | r13799 | |
| 6287 | 6267 | static int stv_sprite_priorities_usage_valid; |
| 6288 | 6268 | static UINT8 stv_sprite_priorities_in_fb_line[512][8]; |
| 6289 | 6269 | |
| 6290 | static void draw_sprites(running_machine &machine, bitmap_t *bitmap, const rectangle | |
| 6270 | static void draw_sprites(running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect, UINT8 pri) | |
| 6291 | 6271 | { |
| 6292 | 6272 | saturn_state *state = machine.driver_data<saturn_state>(); |
| 6293 | 6273 | int x,y,r,g,b; |
| r13798 | r13799 | |
| 6400 | 6380 | (STV_VDP2_SPW0A * 0x10) | |
| 6401 | 6381 | (STV_VDP2_SPW1A * 0x20) | |
| 6402 | 6382 | (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; | |
| 6407 | 6387 | |
| 6408 | stv_vdp2_apply_window_on_layer(machine, | |
| 6388 | stv_vdp2_apply_window_on_layer(machine, | |
| 6409 | 6389 | |
| 6410 | 6390 | if (interlace_framebuffer == 0 && double_x == 0 ) |
| 6411 | 6391 | { |
| r13798 | r13799 | |
| 7060 | 7040 | } |
| 7061 | 7041 | } |
| 7062 | 7042 | |
| 7063 | static void vdp2_draw_back(running_machine &machine, bitmap_t *bitmap, const rectangle | |
| 7043 | static void vdp2_draw_back(running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect) | |
| 7064 | 7044 | { |
| 7065 | 7045 | saturn_state *state = machine.driver_data<saturn_state>(); |
| 7066 | 7046 | int x,y; |
| r13798 | r13799 | |
| 7072 | 7052 | |
| 7073 | 7053 | /* draw black if BDCLMD and DISP are cleared */ |
| 7074 | 7054 | if(!(STV_VDP2_BDCLMD) && !(STV_VDP2_DISP)) |
| 7075 | bitmap->fill(get_black_pen(machine), | |
| 7055 | bitmap->fill(get_black_pen(machine), | |
| 7076 | 7056 | else |
| 7077 | 7057 | { |
| 7078 | 7058 | base_mask = STV_VDP2_VRAMSZ ? 0x7ffff : 0x3ffff; |
| 7079 | 7059 | |
| 7080 | for(y=cliprect | |
| 7060 | for(y=cliprect. | |
| 7081 | 7061 | { |
| 7082 | 7062 | base_offs = ((STV_VDP2_BKTA ) & base_mask) << 1; |
| 7083 | 7063 | if(STV_VDP2_BKCLMD) |
| 7084 | 7064 | base_offs += ((y / interlace) << 1); |
| 7085 | 7065 | |
| 7086 | for(x=cliprect | |
| 7066 | for(x=cliprect. | |
| 7087 | 7067 | { |
| 7088 | 7068 | int r,g,b; |
| 7089 | 7069 | UINT16 dot; |
| r13798 | r13799 | |
| 7270 | 7250 | } |
| 7271 | 7251 | |
| 7272 | 7252 | /* now copy the vram buffer to the screen buffer, apply post-processing at this stage */ |
| 7273 | static void draw_normal_screen(running_machine &machine, bitmap_t *bitmap,const rectangle | |
| 7253 | static void draw_normal_screen(running_machine &machine, bitmap_t *bitmap,const rectangle &cliprect, UINT8 layer_name) | |
| 7274 | 7254 | { |
| 7275 | 7255 | int x,y; |
| 7276 | 7256 | int r,g,b; |
| 7277 | 7257 | |
| 7278 | 7258 | |
| 7279 | for(y=0;y<=cliprect | |
| 7259 | for(y=0;y<=cliprect. | |
| 7280 | 7260 | { |
| 7281 | for(x=0;x<=cliprect | |
| 7261 | for(x=0;x<=cliprect. | |
| 7282 | 7262 | { |
| 7283 | 7263 | if(layer_tpen[layer_name][(x)+(y)*XB_SIZE]) |
| 7284 | 7264 | { |
| r13798 | r13799 | |
|---|---|---|
| 3 | 3 | { |
| 4 | 4 | public: |
| 5 | 5 | 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 | |
| 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); | |
| 7 | 7 | void skns_sprite_kludge(int x, int y); |
| 8 | 8 | |
| 9 | 9 | protected: |
| r13798 | r13799 | |
|---|---|---|
| 184 | 184 | colortable_configure_tilemap_groups(machine.colortable, state->m_tx_tilemap, machine.gfx[0], 0xcf); |
| 185 | 185 | } |
| 186 | 186 | |
| 187 | static void draw_sprites( running_machine &machine, bitmap_t *bitmap, const rectangle | |
| 187 | static void draw_sprites( running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect, int priority ) | |
| 188 | 188 | { |
| 189 | 189 | exedexes_state *state = machine.driver_data<exedexes_state>(); |
| 190 | 190 | UINT8 *buffered_spriteram = machine.generic.buffered_spriteram.u8; |
| r13798 | r13799 | |
| 226 | 226 | tilemap_draw(bitmap, cliprect, state->m_bg_tilemap, 0, 0); |
| 227 | 227 | } |
| 228 | 228 | else |
| 229 | bitmap->fill(0, | |
| 229 | bitmap->fill(0, | |
| 230 | 230 | |
| 231 | 231 | draw_sprites(screen.machine(), bitmap, cliprect, 1); |
| 232 | 232 |
| r13798 | r13799 | |
|---|---|---|
| 88 | 88 | } |
| 89 | 89 | |
| 90 | 90 | |
| 91 | static void do_pen_lookup(jedi_state *state, bitmap_t *bitmap, const rectangle | |
| 91 | static void do_pen_lookup(jedi_state *state, bitmap_t *bitmap, const rectangle &cliprect) | |
| 92 | 92 | { |
| 93 | 93 | int y, x; |
| 94 | 94 | pen_t pens[NUM_PENS]; |
| 95 | 95 | |
| 96 | 96 | get_pens(state, pens); |
| 97 | 97 | |
| 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++) | |
| 100 | 100 | bitmap->pix32(y, x) = pens[bitmap->pix32(y, x)]; |
| 101 | 101 | } |
| 102 | 102 | |
| r13798 | r13799 | |
| 132 | 132 | * |
| 133 | 133 | *************************************/ |
| 134 | 134 | |
| 135 | static void draw_background_and_text(running_machine &machine, jedi_state *state, bitmap_t *bitmap, const rectangle | |
| 135 | static void draw_background_and_text(running_machine &machine, jedi_state *state, bitmap_t *bitmap, const rectangle &cliprect) | |
| 136 | 136 | { |
| 137 | 137 | int y; |
| 138 | 138 | int background_line_buffer[0x200]; /* RAM chip at 2A */ |
| r13798 | r13799 | |
| 149 | 149 | |
| 150 | 150 | memset(background_line_buffer, 0, 0x200 * sizeof(int)); |
| 151 | 151 | |
| 152 | for (y = cliprect | |
| 152 | for (y = cliprect. | |
| 153 | 153 | { |
| 154 | 154 | int x; |
| 155 | 155 | int bg_last_col = 0; |
| 156 | 156 | |
| 157 | for (x = cliprect | |
| 157 | for (x = cliprect. | |
| 158 | 158 | { |
| 159 | 159 | int tx_col1, tx_col2, bg_col; |
| 160 | 160 | int bg_tempcol; |
| r13798 | r13799 | |
| 232 | 232 | * |
| 233 | 233 | *************************************/ |
| 234 | 234 | |
| 235 | static void draw_sprites(running_machine &machine, jedi_state *state, bitmap_t *bitmap, const rectangle | |
| 235 | static void draw_sprites(running_machine &machine, jedi_state *state, bitmap_t *bitmap, const rectangle &cliprect) | |
| 236 | 236 | { |
| 237 | 237 | offs_t offs; |
| 238 | 238 | UINT8 *spriteram = state->m_spriteram; |
| r13798 | r13799 | |
| 276 | 276 | int i; |
| 277 | 277 | UINT16 x = spriteram[offs + 0x100] + ((spriteram[offs + 0x40] & 0x01) << 8) - 2; |
| 278 | 278 | |
| 279 | if ((y < cliprect | |
| 279 | if ((y < cliprect. | |
| 280 | 280 | continue; |
| 281 | 281 | |
| 282 | 282 | if (flip_x) |
| r13798 | r13799 | |
| 333 | 333 | |
| 334 | 334 | /* if no video, clear it all to black */ |
| 335 | 335 | if (*state->m_video_off & 0x01) |
| 336 | bitmap->fill(RGB_BLACK, | |
| 336 | bitmap->fill(RGB_BLACK, | |
| 337 | 337 | else |
| 338 | 338 | { |
| 339 | 339 | /* draw the background/text layers, followed by the sprites |
| r13798 | r13799 | |
|---|---|---|
| 6 | 6 | |
| 7 | 7 | |
| 8 | 8 | /* draws ROZ with linescroll OR columnscroll to 16-bit indexed bitmap */ |
| 9 | static void suprnova_draw_roz(bitmap_t* bitmap, bitmap_t* bitmapflags, const rectangle | |
| 9 | static 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) | |
| 10 | 10 | { |
| 11 | 11 | //bitmap_t *destbitmap = bitmap; |
| 12 | 12 | bitmap_t *srcbitmap = tilemap_get_pixmap(tmap); |
| r13798 | r13799 | |
| 30 | 30 | //int destadvance = destbitmap->bpp / 8; |
| 31 | 31 | |
| 32 | 32 | /* 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; | |
| 35 | 35 | |
| 36 | 36 | /* 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; | |
| 41 | 41 | |
| 42 | 42 | { |
| 43 | 43 | /* loop over rows */ |
| r13798 | r13799 | |
| 391 | 391 | state->m_alt_enable_background = state->m_alt_enable_sprites = 1; |
| 392 | 392 | } |
| 393 | 393 | |
| 394 | static void supernova_draw_a( running_machine &machine, bitmap_t *bitmap, bitmap_t* bitmap_flags, const rectangle | |
| 394 | static void supernova_draw_a( running_machine &machine, bitmap_t *bitmap, bitmap_t* bitmap_flags, const rectangle &cliprect, int tran ) | |
| 395 | 395 | { |
| 396 | 396 | skns_state *state = machine.driver_data<skns_state>(); |
| 397 | 397 | int enable_a = (state->m_v3_regs[0x10/4] >> 0) & 0x0001; |
| r13798 | r13799 | |
| 422 | 422 | } |
| 423 | 423 | } |
| 424 | 424 | |
| 425 | static void supernova_draw_b( running_machine &machine, bitmap_t *bitmap, bitmap_t* bitmap_flags, const rectangle | |
| 425 | static void supernova_draw_b( running_machine &machine, bitmap_t *bitmap, bitmap_t* bitmap_flags, const rectangle &cliprect, int tran ) | |
| 426 | 426 | { |
| 427 | 427 | skns_state *state = machine.driver_data<skns_state>(); |
| 428 | 428 | int enable_b = (state->m_v3_regs[0x34/4] >> 0) & 0x0001; |
| r13798 | r13799 | |
| 459 | 459 | |
| 460 | 460 | palette_update(screen.machine()); |
| 461 | 461 | |
| 462 | bitmap->fill(get_black_pen(screen.machine()), | |
| 462 | bitmap->fill(get_black_pen(screen.machine()), | |
| 463 | 463 | state->m_tilemap_bitmap_lower->fill(0); |
| 464 | 464 | state->m_tilemap_bitmapflags_lower->fill(0); |
| 465 | 465 | state->m_tilemap_bitmap_higher->fill(0); |
| r13798 | r13799 | |
| 628 | 628 | } |
| 629 | 629 | } |
| 630 | 630 | |
| 631 | state->m_sprite_bitmap->fill(0x0000, | |
| 631 | state->m_sprite_bitmap->fill(0x0000, | |
| 632 | 632 | |
| 633 | 633 | if (state->m_alt_enable_sprites) |
| 634 | 634 | 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 ); |
| r13798 | r13799 | |
|---|---|---|
| 161 | 161 | |
| 162 | 162 | ***************************************************************************/ |
| 163 | 163 | |
| 164 | static void seta_drawgfx( bitmap_t *bitmap, const rectangle | |
| 164 | static void seta_drawgfx( bitmap_t *bitmap, const rectangle &cliprect, const gfx_element *gfx, | |
| 165 | 165 | UINT32 code,UINT32 color,int flipx,int flipy,int x0,int y0, |
| 166 | 166 | int shadow_depth ) |
| 167 | 167 | { |
| r13798 | r13799 | |
| 183 | 183 | #define SETA_DRAWGFX(SETPIXELCOLOR) \ |
| 184 | 184 | for ( sy = y0; sy != y1; sy += dy ) \ |
| 185 | 185 | { \ |
| 186 | if ( sy >= cliprect | |
| 186 | if ( sy >= cliprect. | |
| 187 | 187 | { \ |
| 188 | 188 | source = addr; \ |
| 189 | 189 | dest = &bitmap->pix16(sy); \ |
| r13798 | r13799 | |
| 192 | 192 | { \ |
| 193 | 193 | pen = *source++; \ |
| 194 | 194 | \ |
| 195 | if ( pen && sx >= cliprect | |
| 195 | if ( pen && sx >= cliprect. | |
| 196 | 196 | SETPIXELCOLOR \ |
| 197 | 197 | } \ |
| 198 | 198 | } \ |
| r13798 | r13799 | |
| 212 | 212 | } |
| 213 | 213 | } |
| 214 | 214 | |
| 215 | static void draw_sprites(running_machine &machine, bitmap_t *bitmap,const rectangle | |
| 215 | static void draw_sprites(running_machine &machine, bitmap_t *bitmap,const rectangle &cliprect) | |
| 216 | 216 | { |
| 217 | 217 | // Sprites list |
| 218 | 218 | |
| r13798 | r13799 | |
| 328 | 328 | clip.min_x = (clip.min_x & 0x1ff) - (clip.min_x & 0x200); |
| 329 | 329 | clip.max_x = clip.min_x + width * 0x10 - 1; |
| 330 | 330 | |
| 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; | |
| 335 | 335 | |
| 336 | 336 | // sprite clipping region (y) |
| 337 | 337 | clip.min_y = ((sy + yoffs) & 0x1ff) - state->m_yoffset; |
| 338 | 338 | clip.max_y = clip.min_y + height * 0x10 - 1; |
| 339 | 339 | |
| 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; | |
| 344 | 344 | |
| 345 | 345 | dx = sx + (scrollx & 0x3ff) + xoffs + 0x10; |
| 346 | 346 | |
| r13798 | r13799 | |
| 375 | 375 | |
| 376 | 376 | dst_x = (dst_x & 0x1ff) - (dst_x & 0x200); |
| 377 | 377 | |
| 378 | seta_drawgfx(bitmap, | |
| 378 | seta_drawgfx(bitmap, | |
| 379 | 379 | code ^ tx ^ (ty<<1), |
| 380 | 380 | color, |
| 381 | 381 | flipx, flipy, |
| r13798 | r13799 | |
| 483 | 483 | seta2_state *state = screen.machine().driver_data<seta2_state>(); |
| 484 | 484 | |
| 485 | 485 | // Black or pen 0? |
| 486 | bitmap->fill(screen.machine().pens[0], | |
| 486 | bitmap->fill(screen.machine().pens[0], | |
| 487 | 487 | |
| 488 | 488 | if ( (state->m_vregs[0x30/2] & 1) == 0 ) // 1 = BLANK SCREEN |
| 489 | 489 | draw_sprites(screen.machine(), bitmap, cliprect); |
| r13798 | r13799 | |
|---|---|---|
| 165 | 165 | } |
| 166 | 166 | |
| 167 | 167 | /* compute clipping */ |
| 168 | clip[0] &= *cliprect; | |
| 169 | clip[1] &= *cliprect; | |
| 168 | clip[0] &= cliprect; | |
| 169 | clip[1] &= cliprect; | |
| 170 | 170 | |
| 171 | 171 | /* draw the graphics */ |
| 172 | tilemap_draw(bitmap, | |
| 172 | tilemap_draw(bitmap, | |
| 173 | 173 | 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, | |
| 174 | tilemap_draw(bitmap, | |
| 175 | 175 | return 0; |
| 176 | 176 | } |
| r13798 | r13799 | |
|---|---|---|
| 86 | 86 | |
| 87 | 87 | namcofl_install_palette(screen.machine()); |
| 88 | 88 | |
| 89 | bitmap->fill(get_black_pen(screen.machine()), | |
| 89 | bitmap->fill(get_black_pen(screen.machine()), | |
| 90 | 90 | |
| 91 | 91 | for( pri=0; pri<16; pri++ ) |
| 92 | 92 | { |
| r13798 | r13799 | |
|---|---|---|
| 1000 | 1000 | |
| 1001 | 1001 | ***************************************************************************/ |
| 1002 | 1002 | |
| 1003 | static void hanamai_copylayer( running_machine &machine, bitmap_t *bitmap, const rectangle | |
| 1003 | static void hanamai_copylayer( running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect, int i ) | |
| 1004 | 1004 | { |
| 1005 | 1005 | dynax_state *state = machine.driver_data<dynax_state>(); |
| 1006 | 1006 | int color; |
| r13798 | r13799 | |
| 1064 | 1064 | } |
| 1065 | 1065 | |
| 1066 | 1066 | |
| 1067 | static void jantouki_copylayer( running_machine &machine, bitmap_t *bitmap, const rectangle | |
| 1067 | static void jantouki_copylayer( running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect, int i, int y ) | |
| 1068 | 1068 | { |
| 1069 | 1069 | dynax_state *state = machine.driver_data<dynax_state>(); |
| 1070 | 1070 | int color, scrollx, scrolly, palettes, palbank; |
| r13798 | r13799 | |
| 1106 | 1106 | UINT16 *dst; |
| 1107 | 1107 | UINT16 *dstbase = &bitmap->pix16(sy); |
| 1108 | 1108 | |
| 1109 | if ((sy < cliprect | |
| 1109 | if ((sy < cliprect. | |
| 1110 | 1110 | { |
| 1111 | 1111 | src1 += 256; |
| 1112 | 1112 | src2 += 256; |
| r13798 | r13799 | |
| 1139 | 1139 | } |
| 1140 | 1140 | |
| 1141 | 1141 | |
| 1142 | static void mjdialq2_copylayer( running_machine &machine, bitmap_t *bitmap, const rectangle | |
| 1142 | static void mjdialq2_copylayer( running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect, int i ) | |
| 1143 | 1143 | { |
| 1144 | 1144 | dynax_state *state = machine.driver_data<dynax_state>(); |
| 1145 | 1145 | int color; |
| r13798 | r13799 | |
| 1227 | 1227 | I,O - Change palette (-,+) |
| 1228 | 1228 | J,K & N,M - Change "tile" (-,+, slow & fast) |
| 1229 | 1229 | R - move "tile" to the next 1/8th of the gfx */ |
| 1230 | static int debug_viewer( running_machine &machine, bitmap_t *bitmap, const rectangle | |
| 1230 | static int debug_viewer( running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect ) | |
| 1231 | 1231 | { |
| 1232 | 1232 | |
| 1233 | 1233 | #ifdef MAME_DEBUG |
| r13798 | r13799 | |
| 1255 | 1255 | state->m_blit_palettes = (c & 0xf) * 0x111; |
| 1256 | 1256 | state->m_blit_palbank = (c >> 4) & 1; |
| 1257 | 1257 | |
| 1258 | bitmap->fill(0, | |
| 1258 | bitmap->fill(0, | |
| 1259 | 1259 | memset(state->m_pixmap[0][0], 0, sizeof(UINT8) * 0x100 * 0x100); |
| 1260 | 1260 | |
| 1261 | 1261 | if (state->m_layer_layout != LAYOUT_MJDIALQ2) |
| 1262 | 1262 | memset(state->m_pixmap[0][1], 0, sizeof(UINT8) * 0x100 * 0x100); |
| 1263 | 1263 | 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 | |
| 1264 | blitter_drawgfx(machine, 0, 1, "gfx1", i, 0, cliprect. | |
| 1265 | 1265 | |
| 1266 | 1266 | if (state->m_layer_layout != LAYOUT_MJDIALQ2) |
| 1267 | 1267 | hanamai_copylayer(machine, bitmap, cliprect, 0); |
| r13798 | r13799 | |
| 1289 | 1289 | |
| 1290 | 1290 | layers_ctrl &= debug_mask(screen.machine()); |
| 1291 | 1291 | |
| 1292 | bitmap->fill((state->m_blit_backpen & 0xff) + (state->m_blit_palbank & 1) * 256, | |
| 1292 | bitmap->fill((state->m_blit_backpen & 0xff) + (state->m_blit_palbank & 1) * 256, | |
| 1293 | 1293 | |
| 1294 | 1294 | /* bit 4 = display enable? */ |
| 1295 | 1295 | if (!(state->m_hanamai_priority & 0x10)) |
| r13798 | r13799 | |
| 1326 | 1326 | |
| 1327 | 1327 | layers_ctrl &= debug_mask(screen.machine()); |
| 1328 | 1328 | |
| 1329 | bitmap->fill((state->m_blit_backpen & 0xff) + (state->m_blit_palbank & 0x0f) * 256, | |
| 1329 | bitmap->fill((state->m_blit_backpen & 0xff) + (state->m_blit_palbank & 0x0f) * 256, | |
| 1330 | 1330 | |
| 1331 | 1331 | pri = state->m_hanamai_priority >> 4; |
| 1332 | 1332 | |
| r13798 | r13799 | |
| 1361 | 1361 | |
| 1362 | 1362 | layers_ctrl &= debug_mask(screen.machine()); |
| 1363 | 1363 | |
| 1364 | bitmap->fill((state->m_blit_backpen & 0xff) + (state->m_blit_palbank & 1) * 256, | |
| 1364 | bitmap->fill((state->m_blit_backpen & 0xff) + (state->m_blit_palbank & 1) * 256, | |
| 1365 | 1365 | |
| 1366 | 1366 | if (BIT(layers_ctrl, 0)) hanamai_copylayer(screen.machine(), bitmap, cliprect, 0); |
| 1367 | 1367 | if (BIT(layers_ctrl, 1)) hanamai_copylayer(screen.machine(), bitmap, cliprect, 1); |
| r13798 | r13799 | |
| 1379 | 1379 | |
| 1380 | 1380 | layers_ctrl &= debug_mask(screen.machine()); |
| 1381 | 1381 | |
| 1382 | bitmap->fill((state->m_blit_backpen & 0xff) + (state->m_blit_palbank & 1) * 256, | |
| 1382 | bitmap->fill((state->m_blit_backpen & 0xff) + (state->m_blit_palbank & 1) * 256, | |
| 1383 | 1383 | |
| 1384 | 1384 | // if (BIT(layers_ctrl, 0)) jantouki_copylayer(screen.machine(), bitmap, cliprect, 3, 0); |
| 1385 | 1385 | if (BIT(layers_ctrl, 1)) jantouki_copylayer(screen.machine(), bitmap, cliprect, 2, 0); |
| r13798 | r13799 | |
| 1398 | 1398 | |
| 1399 | 1399 | layers_ctrl &= debug_mask(screen.machine()); |
| 1400 | 1400 | |
| 1401 | bitmap->fill((state->m_blit_backpen & 0xff) + (state->m_blit_palbank & 1) * 256, | |
| 1401 | bitmap->fill((state->m_blit_backpen & 0xff) + (state->m_blit_palbank & 1) * 256, | |
| 1402 | 1402 | |
| 1403 | 1403 | if (BIT(layers_ctrl, 0)) jantouki_copylayer(screen.machine(), bitmap, cliprect, 3, 0); |
| 1404 | 1404 | if (BIT(layers_ctrl, 4)) jantouki_copylayer(screen.machine(), bitmap, cliprect, 7, 0); |
| r13798 | r13799 | |
| 1419 | 1419 | |
| 1420 | 1420 | layers_ctrl &= debug_mask(screen.machine()); |
| 1421 | 1421 | |
| 1422 | bitmap->fill((state->m_blit_backpen & 0xff) + (state->m_blit_palbank & 1) * 256, | |
| 1422 | bitmap->fill((state->m_blit_backpen & 0xff) + (state->m_blit_palbank & 1) * 256, | |
| 1423 | 1423 | |
| 1424 | 1424 | if (BIT(layers_ctrl, 0)) mjdialq2_copylayer(screen.machine(), bitmap, cliprect, 0); |
| 1425 | 1425 | if (BIT(layers_ctrl, 1)) mjdialq2_copylayer(screen.machine(), bitmap, cliprect, 1); |
| r13798 | r13799 | |
| 1443 | 1443 | // format and let SCREEN_UPDATE(ddenlovr) do the final compositing (priorities + palettes) |
| 1444 | 1444 | for (layer = 0; layer < 4; layer++) |
| 1445 | 1445 | { |
| 1446 | bitmap->fill(0, | |
| 1446 | bitmap->fill(0, | |
| 1447 | 1447 | hanamai_copylayer(screen.machine(), bitmap, cliprect, layer); |
| 1448 | 1448 | |
| 1449 | 1449 | for (y = 0; y < 256; y++) |
| r13798 | r13799 | |
|---|---|---|
| 91 | 91 | tilemap_set_transparent_pen( state->m_foreground, 0 ); |
| 92 | 92 | } |
| 93 | 93 | |
| 94 | static void draw_sprites(running_machine &machine, bitmap_t *bitmap, const rectangle | |
| 94 | static void draw_sprites(running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect, int bank_bits ) | |
| 95 | 95 | { |
| 96 | 96 | shootout_state *state = machine.driver_data<shootout_state>(); |
| 97 | 97 | UINT8 *spriteram = state->m_spriteram; |
| r13798 | r13799 | |
| 175 | 175 | { |
| 176 | 176 | shootout_state *state = screen.machine().driver_data<shootout_state>(); |
| 177 | 177 | |
| 178 | screen.machine().priority_bitmap->fill(0, | |
| 178 | screen.machine().priority_bitmap->fill(0, | |
| 179 | 179 | |
| 180 | 180 | tilemap_draw(bitmap,cliprect,state->m_background,0,0); |
| 181 | 181 | tilemap_draw(bitmap,cliprect,state->m_foreground,0,1); |
| r13798 | r13799 | |
| 187 | 187 | { |
| 188 | 188 | shootout_state *state = screen.machine().driver_data<shootout_state>(); |
| 189 | 189 | |
| 190 | screen.machine().priority_bitmap->fill(0, | |
| 190 | screen.machine().priority_bitmap->fill(0, | |
| 191 | 191 | |
| 192 | 192 | tilemap_draw(bitmap,cliprect,state->m_background,0,0); |
| 193 | 193 | tilemap_draw(bitmap,cliprect,state->m_foreground,0,1); |
| r13798 | r13799 | |
|---|---|---|
| 301 | 301 | |
| 302 | 302 | ***************************************************************************/ |
| 303 | 303 | |
| 304 | static void draw_sprites(running_machine &machine, bitmap_t *bitmap, const rectangle | |
| 304 | static void draw_sprites(running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect, int bank ) | |
| 305 | 305 | { |
| 306 | 306 | contra_state *state = machine.driver_data<contra_state>(); |
| 307 | 307 | device_t *k007121 = bank ? state->m_k007121_2 : state->m_k007121_1; |
| r13798 | r13799 | |
| 327 | 327 | rectangle fg_finalclip = state->m_fg_clip; |
| 328 | 328 | rectangle tx_finalclip = state->m_tx_clip; |
| 329 | 329 | |
| 330 | bg_finalclip &= *cliprect; | |
| 331 | fg_finalclip &= *cliprect; | |
| 332 | tx_finalclip &= *cliprect; | |
| 330 | bg_finalclip &= cliprect; | |
| 331 | fg_finalclip &= cliprect; | |
| 332 | tx_finalclip &= cliprect; | |
| 333 | 333 | |
| 334 | 334 | set_pens(screen.machine()); |
| 335 | 335 | |
| r13798 | r13799 | |
| 338 | 338 | tilemap_set_scrollx(state->m_bg_tilemap, 0, ctrl_2_0 - 40); |
| 339 | 339 | tilemap_set_scrolly(state->m_bg_tilemap, 0, ctrl_2_2); |
| 340 | 340 | |
| 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); | |
| 343 | 343 | draw_sprites(screen.machine(),bitmap,cliprect, 0); |
| 344 | 344 | draw_sprites(screen.machine(),bitmap,cliprect, 1); |
| 345 | tilemap_draw(bitmap, | |
| 345 | tilemap_draw(bitmap, | |
| 346 | 346 | return 0; |
| 347 | 347 | } |
| r13798 | r13799 | |
|---|---|---|
| 132 | 132 | { |
| 133 | 133 | volfied_state *state = screen.machine().driver_data<volfied_state>(); |
| 134 | 134 | |
| 135 | screen.machine().priority_bitmap->fill(0, | |
| 135 | screen.machine().priority_bitmap->fill(0, | |
| 136 | 136 | refresh_pixel_layer(screen.machine(), bitmap); |
| 137 | 137 | pc090oj_draw_sprites(state->m_pc090oj, bitmap, cliprect, 0); |
| 138 | 138 | return 0; |
| r13798 | r13799 | |
|---|---|---|
| 192 | 192 | state->m_priority = data; |
| 193 | 193 | } |
| 194 | 194 | |
| 195 | static void draw_sprites( running_machine &machine, bitmap_t *bitmap, const rectangle | |
| 195 | static void draw_sprites( running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect ) | |
| 196 | 196 | { |
| 197 | 197 | paradise_state *state = machine.driver_data<paradise_state>(); |
| 198 | 198 | UINT8 *spriteram = state->m_spriteram; |
| r13798 | r13799 | |
| 259 | 259 | } |
| 260 | 260 | #endif |
| 261 | 261 | |
| 262 | bitmap->fill(get_black_pen(screen.machine()), | |
| 262 | bitmap->fill(get_black_pen(screen.machine()), | |
| 263 | 263 | |
| 264 | 264 | if (!(state->m_priority & 4)) /* Screen blanking */ |
| 265 | 265 | return 0; |
| r13798 | r13799 | |
| 296 | 296 | { |
| 297 | 297 | paradise_state *state = screen.machine().driver_data<paradise_state>(); |
| 298 | 298 | |
| 299 | bitmap->fill(get_black_pen(screen.machine()), | |
| 299 | bitmap->fill(get_black_pen(screen.machine()), | |
| 300 | 300 | |
| 301 | 301 | if (!(state->m_priority & 2)) /* Screen blanking */ |
| 302 | 302 | return 0; |
| r13798 | r13799 | |
| 328 | 328 | { |
| 329 | 329 | paradise_state *state = screen.machine().driver_data<paradise_state>(); |
| 330 | 330 | |
| 331 | bitmap->fill(get_black_pen(screen.machine()), | |
| 331 | bitmap->fill(get_black_pen(screen.machine()), | |
| 332 | 332 | tilemap_draw(bitmap, cliprect, state->m_tilemap_0, 0, 0); |
| 333 | 333 | tilemap_draw(bitmap, cliprect, state->m_tilemap_1, 0, 0); |
| 334 | 334 | tilemap_draw(bitmap, cliprect, state->m_tilemap_2, 0, 0); |
| r13798 | r13799 | |
|---|---|---|
| 66 | 66 | int x, y; |
| 67 | 67 | |
| 68 | 68 | /* loop over rows */ |
| 69 | for (y = cliprect | |
| 69 | for (y = cliprect. | |
| 70 | 70 | { |
| 71 | 71 | UINT16 *dst = &bitmap->pix16(y); |
| 72 | 72 | |
| 73 | 73 | /* loop over columns */ |
| 74 | for (x = cliprect | |
| 74 | for (x = cliprect. | |
| 75 | 75 | { |
| 76 | 76 | int b7 = prombase[(x >> 3) | ((y >> 3) << 5)] & 1; |
| 77 | 77 | int b6 = state->m_abca; |
| r13798 | r13799 | |
|---|---|---|
| 126 | 126 | * |
| 127 | 127 | *************************************/ |
| 128 | 128 | |
| 129 | static void draw_one_sprite(running_machine &machine, bitmap_t *bitmap, const rectangle | |
| 129 | static void draw_one_sprite(running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect, UINT8 *sprite) | |
| 130 | 130 | { |
| 131 | 131 | balsente_state *state = machine.driver_data<balsente_state>(); |
| 132 | 132 | int flags = sprite[0]; |
| r13798 | r13799 | |
| 143 | 143 | /* loop over y */ |
| 144 | 144 | for (y = 0; y < 16; y++, ypos = (ypos + 1) & 255) |
| 145 | 145 | { |
| 146 | if (ypos >= (16 + BALSENTE_VBEND) && ypos >= cliprect | |
| 146 | if (ypos >= (16 + BALSENTE_VBEND) && ypos >= cliprect. | |
| 147 | 147 | { |
| 148 | 148 | const pen_t *pens = &machine.pens[state->m_palettebank_vis * 256]; |
| 149 | 149 | UINT8 *old = &state->m_expanded_videoram[(ypos - BALSENTE_VBEND) * 256 + xpos]; |
| r13798 | r13799 | |
| 217 | 217 | int y, i; |
| 218 | 218 | |
| 219 | 219 | /* draw scanlines from the VRAM directly */ |
| 220 | for (y = cliprect | |
| 220 | for (y = cliprect. | |
| 221 | 221 | draw_scanline8(bitmap, 0, y, 256, &state->m_expanded_videoram[(y - BALSENTE_VBEND) * 256], pens); |
| 222 | 222 | |
| 223 | 223 | /* draw the sprite images */ |
| r13798 | r13799 | |
|---|---|---|
| 1436 | 1436 | int y; |
| 1437 | 1437 | |
| 1438 | 1438 | /* loop over height */ |
| 1439 | for (y = cliprect | |
| 1439 | for (y = cliprect. | |
| 1440 | 1440 | { |
| 1441 | 1441 | UINT16 *src1 = &state->m_videoplane[0][compute_safe_address(state, VIDEO_DISPLAY_XORIGIN1, VIDEO_DISPLAY_YORIGIN1 + y)]; |
| 1442 | 1442 | |
| r13798 | r13799 | |
| 1448 | 1448 | int x; |
| 1449 | 1449 | |
| 1450 | 1450 | /* blend the pixels in the scanline; color xxFF is transparent */ |
| 1451 | for (x = cliprect | |
| 1451 | for (x = cliprect. | |
| 1452 | 1452 | { |
| 1453 | 1453 | UINT16 pixel = src1[x]; |
| 1454 | 1454 | if ((pixel & 0xff) == 0xff) |
| r13798 | r13799 | |
| 1457 | 1457 | } |
| 1458 | 1458 | |
| 1459 | 1459 | /* draw from the buffer */ |
| 1460 | draw_scanline16(bitmap, cliprect | |
| 1460 | draw_scanline16(bitmap, cliprect. | |
| 1461 | 1461 | } |
| 1462 | 1462 | |
| 1463 | 1463 | /* otherwise, draw directly from VRAM */ |
| 1464 | 1464 | else |
| 1465 | draw_scanline16(bitmap, cliprect | |
| 1465 | draw_scanline16(bitmap, cliprect. | |
| 1466 | 1466 | } |
| 1467 | 1467 | return 0; |
| 1468 | 1468 | } |
| r13798 | r13799 | |
|---|---|---|
| 27 | 27 | /* Bubble Bobble doesn't have a real video RAM. All graphics (characters */ |
| 28 | 28 | /* and sprites) are stored in the same memory region, and information on */ |
| 29 | 29 | /* the background character columns is stored inthe area dd00-dd3f */ |
| 30 | bitmap->fill(255, | |
| 30 | bitmap->fill(255, | |
| 31 | 31 | |
| 32 | 32 | sx = 0; |
| 33 | 33 | |
| r13798 | r13799 | |
| 109 | 109 | int goffs, code, color, y; |
| 110 | 110 | int tx, ty; |
| 111 | 111 | |
| 112 | bitmap->fill(get_black_pen(screen.machine()), | |
| 112 | bitmap->fill(get_black_pen(screen.machine()), | |
| 113 | 113 | sx = 0; |
| 114 | 114 | for (offs = 0; offs < state->m_objectram_size; offs += 4) |
| 115 | 115 | { |
| r13798 | r13799 | |
|---|---|---|
| 183 | 183 | Screen refresh |
| 184 | 184 | ***************************************************************************/ |
| 185 | 185 | |
| 186 | static void draw_sprites( running_machine &machine, bitmap_t *bitmap, const rectangle | |
| 186 | static void draw_sprites( running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect ) | |
| 187 | 187 | { |
| 188 | 188 | chaknpop_state *state = machine.driver_data<chaknpop_state>(); |
| 189 | 189 | int offs; |
| r13798 | r13799 | |
| 218 | 218 | } |
| 219 | 219 | } |
| 220 | 220 | |
| 221 | static void draw_bitmap( running_machine &machine, bitmap_t *bitmap, const rectangle | |
| 221 | static void draw_bitmap( running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect ) | |
| 222 | 222 | { |
| 223 | 223 | chaknpop_state *state = machine.driver_data<chaknpop_state>(); |
| 224 | 224 | int dx = state->m_flip_x ? -1 : 1; |
| r13798 | r13799 | |
|---|---|---|
| 4 | 4 | #include "includes/fitfight.h" |
| 5 | 5 | |
| 6 | 6 | |
| 7 | static void draw_sprites( running_machine &machine, bitmap_t *bitmap, const rectangle | |
| 7 | static void draw_sprites( running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect, int layer ) | |
| 8 | 8 | { |
| 9 | 9 | fitfight_state *state = machine.driver_data<fitfight_state>(); |
| 10 | 10 | const gfx_element *gfx = machine.gfx[3]; |
| r13798 | r13799 | |
| 126 | 126 | vblank = (state->m_fof_700000[0] & 0x8000); |
| 127 | 127 | |
| 128 | 128 | if (vblank > 0) |
| 129 | bitmap->fill(get_black_pen(screen.machine()), | |
| 129 | bitmap->fill(get_black_pen(screen.machine()), | |
| 130 | 130 | else { |
| 131 | 131 | // if (screen.machine().input().code_pressed(KEYCODE_Q)) |
| 132 | 132 | // scrollbak = ((state->m_fof_a00000[0] & 0xff00) >> 5) - ((state->m_fof_700000[0] & 0x0038) >> 3); |
| r13798 | r13799 | |
|---|---|---|
| 181 | 181 | } |
| 182 | 182 | |
| 183 | 183 | |
| 184 | static void draw_drones(running_machine &machine, bitmap_t* bitmap, const rectangle | |
| 184 | static void draw_drones(running_machine &machine, bitmap_t* bitmap, const rectangle | |
| 185 | 185 | { |
| 186 | 186 | sspeedr_state *state = machine.driver_data<sspeedr_state>(); |
| 187 | 187 | static const UINT8 code[6] = |
| r13798 | r13799 | |
| 221 | 221 | } |
| 222 | 222 | |
| 223 | 223 | |
| 224 | static void draw_driver(running_machine &machine, bitmap_t* bitmap, const rectangle | |
| 224 | static void draw_driver(running_machine &machine, bitmap_t* bitmap, const rectangle | |
| 225 | 225 | { |
| 226 | 226 | sspeedr_state *state = machine.driver_data<sspeedr_state>(); |
| 227 | 227 | int x; |
| r13798 | r13799 | |
|---|---|---|
| 31 | 31 | SET_TILE_INFO( 0,data&0xff,0,0 ); |
| 32 | 32 | } |
| 33 | 33 | |
| 34 | static void draw_sprites(running_machine &machine, bitmap_t *bitmap, const rectangle | |
| 34 | static void draw_sprites(running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect ) | |
| 35 | 35 | { |
| 36 | 36 | terracre_state *state = machine.driver_data<terracre_state>(); |
| 37 | 37 | const UINT8 *spritepalettebank = machine.region("user1")->base(); |
| r13798 | r13799 | |
| 206 | 206 | { |
| 207 | 207 | terracre_state *state = screen.machine().driver_data<terracre_state>(); |
| 208 | 208 | if( state->m_xscroll&0x2000 ) |
| 209 | bitmap->fill(get_black_pen(screen.machine()), | |
| 209 | bitmap->fill(get_black_pen(screen.machine()), | |
| 210 | 210 | else |
| 211 | 211 | tilemap_draw( bitmap,cliprect, state->m_background, 0, 0 ); |
| 212 | 212 |
| r13798 | r13799 | |
|---|---|---|
| 176 | 176 | |
| 177 | 177 | ***************************************************************************/ |
| 178 | 178 | |
| 179 | static void draw_sprites( running_machine& machine, bitmap_t *bitmap, const rectangle | |
| 179 | static void draw_sprites( running_machine& machine, bitmap_t *bitmap, const rectangle &cliprect, UINT8* source, int lenght, int gfxset, int flipscreen ) | |
| 180 | 180 | { |
| 181 | 181 | gfx_element *gfx = machine.gfx[gfxset]; |
| 182 | 182 | const UINT8 *finish = source + lenght; |
| r13798 | r13799 | |
|---|---|---|
| 64 | 64 | |
| 65 | 65 | ***************************************************************/ |
| 66 | 66 | |
| 67 | static void draw_sprites(running_machine &machine, bitmap_t *bitmap,const rectangle | |
| 67 | static void draw_sprites(running_machine &machine, bitmap_t *bitmap,const rectangle &cliprect,const int *primasks,int x_offs,int y_offs) | |
| 68 | 68 | { |
| 69 | 69 | undrfire_state *state = machine.driver_data<undrfire_state>(); |
| 70 | 70 | UINT32 *spriteram32 = state->m_spriteram; |
| r13798 | r13799 | |
| 208 | 208 | } |
| 209 | 209 | |
| 210 | 210 | |
| 211 | static void draw_sprites_cbombers(running_machine &machine, bitmap_t *bitmap,const rectangle | |
| 211 | static void draw_sprites_cbombers(running_machine &machine, bitmap_t *bitmap,const rectangle &cliprect,const int *primasks,int x_offs,int y_offs) | |
| 212 | 212 | { |
| 213 | 213 | undrfire_state *state = machine.driver_data<undrfire_state>(); |
| 214 | 214 | UINT32 *spriteram32 = state->m_spriteram; |
| r13798 | r13799 | |
| 408 | 408 | pivlayer[1] = pivlayer[0] ^ 1; |
| 409 | 409 | pivlayer[2] = 2; |
| 410 | 410 | |
| 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? */ | |
| 413 | 413 | |
| 414 | 414 | |
| 415 | 415 | /* The "PIV" chip seems to be a renamed TC0100SCN. It has a |
| r13798 | r13799 | |
| 551 | 551 | pivlayer[1] = pivlayer[0] ^ 1; |
| 552 | 552 | pivlayer[2] = 2; |
| 553 | 553 | |
| 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? */ | |
| 556 | 556 | |
| 557 | 557 | |
| 558 | 558 | /* The "PIV" chip seems to be a renamed TC0100SCN. It has a |
| r13798 | r13799 | |
|---|---|---|
| 1004 | 1004 | int y; |
| 1005 | 1005 | |
| 1006 | 1006 | /* render each scanline in the visible region */ |
| 1007 | for (y = cliprect | |
| 1007 | for (y = cliprect. | |
| 1008 | 1008 | amiga_render_scanline(screen.machine(), bitmap, y); |
| 1009 | 1009 | |
| 1010 | 1010 | return 0; |
| r13798 | r13799 | |
|---|---|---|
| 152 | 152 | |
| 153 | 153 | |
| 154 | 154 | INLINE void dragngun_drawgfxzoom( |
| 155 | bitmap_t *dest_bmp,const rectangle | |
| 155 | bitmap_t *dest_bmp,const rectangle &clip,const gfx_element *gfx, | |
| 156 | 156 | UINT32 code,UINT32 color,int flipx,int flipy,int sx,int sy, |
| 157 | 157 | int transparent_color, |
| 158 | 158 | int scalex, int scaley,bitmap_t *pri_buffer,UINT32 pri_mask, int sprite_screen_width, int sprite_screen_height, UINT8 alpha ) |
| r13798 | r13799 | |
| 169 | 169 | */ |
| 170 | 170 | |
| 171 | 171 | /* 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(); | |
| 178 | 174 | |
| 179 | 175 | { |
| 180 | 176 | if( gfx ) |
| r13798 | r13799 | |
| 214 | 210 | y_index = 0; |
| 215 | 211 | } |
| 216 | 212 | |
| 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; | |
| 242 | 218 | } |
| 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 | } | |
| 243 | 236 | |
| 244 | 237 | if( ex>sx ) |
| 245 | 238 | { /* skip if inner loop doesn't draw anything */ |
| r13798 | r13799 | |
| 344 | 337 | } |
| 345 | 338 | } |
| 346 | 339 | |
| 347 | static void dragngun_draw_sprites(running_machine& machine, bitmap_t *bitmap, const rectangle | |
| 340 | static void dragngun_draw_sprites(running_machine& machine, bitmap_t *bitmap, const rectangle &cliprect, const UINT32 *spritedata) | |
| 348 | 341 | { |
| 349 | 342 | dragngun_state *state = machine.driver_data<dragngun_state>(); |
| 350 | 343 | const UINT32 *layout_ram; |
| r13798 | r13799 | |
| 596 | 589 | |
| 597 | 590 | tilemap_set_flip_all(screen.machine(),flip_screen_get(screen.machine()) ? (TILEMAP_FLIPY | TILEMAP_FLIPX) : 0); |
| 598 | 591 | |
| 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 | |
| 601 | 594 | |
| 602 | 595 | deco16ic_set_pf1_8bpp_mode(state->m_deco_tilegen2, 1); |
| 603 | 596 | |
| r13798 | r13799 | |
| 631 | 624 | state->m_deco_tilegen1 = screen.machine().device("tilegen1"); |
| 632 | 625 | state->m_deco_tilegen2 = screen.machine().device("tilegen2"); |
| 633 | 626 | |
| 634 | bitmap->fill(get_black_pen(screen.machine()), | |
| 627 | bitmap->fill(get_black_pen(screen.machine()), | |
| 635 | 628 | |
| 636 | 629 | deco16ic_pf_update(state->m_deco_tilegen1, state->m_pf1_rowscroll, state->m_pf2_rowscroll); |
| 637 | 630 | deco16ic_pf_update(state->m_deco_tilegen2, state->m_pf3_rowscroll, state->m_pf4_rowscroll); |
| r13798 | r13799 | |
| 652 | 645 | // with the concept of generic tilemap code. |
| 653 | 646 | // |
| 654 | 647 | // for now we only draw these 2 layers on the last update call |
| 655 | if (cliprect | |
| 648 | if (cliprect. | |
| 656 | 649 | { |
| 657 | 650 | 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; | |
| 660 | 653 | clip.min_y = 8; |
| 661 | 654 | clip.max_y = 247; |
| 662 | 655 | |
| 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); | |
| 665 | 658 | |
| 666 | 659 | } |
| 667 | 660 | |
| r13798 | r13799 | |
| 675 | 668 | state->m_deco_tilegen1 = screen.machine().device("tilegen1"); |
| 676 | 669 | state->m_deco_tilegen2 = screen.machine().device("tilegen2"); |
| 677 | 670 | |
| 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 | |
| 680 | 673 | |
| 681 | 674 | deco16ic_pf_update(state->m_deco_tilegen1, state->m_pf1_rowscroll, state->m_pf2_rowscroll); |
| 682 | 675 | deco16ic_pf_update(state->m_deco_tilegen2, state->m_pf3_rowscroll, state->m_pf4_rowscroll); |
| r13798 | r13799 | |
| 713 | 706 | blending support - it can't be done in-place on the final framebuffer |
| 714 | 707 | without a lot of support bitmaps. |
| 715 | 708 | */ |
| 716 | static void mixDualAlphaSprites(bitmap_t *bitmap, const rectangle | |
| 709 | static void mixDualAlphaSprites(bitmap_t *bitmap, const rectangle &cliprect, const gfx_element *gfx0, const gfx_element *gfx1, int mixAlphaTilemap) | |
| 717 | 710 | { |
| 718 | 711 | deco32_state *state = gfx0->machine().driver_data<deco32_state>(); |
| 719 | 712 | running_machine &machine = gfx0->machine(); |
| r13798 | r13799 | |
| 863 | 856 | if (state->m_ace_ram_dirty) |
| 864 | 857 | updateAceRam(screen.machine()); |
| 865 | 858 | |
| 866 | screen.machine().priority_bitmap->fill(0, | |
| 859 | screen.machine().priority_bitmap->fill(0, | |
| 867 | 860 | |
| 868 | bitmap->fill(screen.machine().pens[0x200], | |
| 861 | bitmap->fill(screen.machine().pens[0x200], | |
| 869 | 862 | |
| 870 | 863 | /* Draw sprites to temporary bitmaps, saving alpha & priority info for later mixing */ |
| 871 | 864 | screen.machine().device<decospr_device>("spritegen1")->set_pix_raw_shift(8); |
| r13798 | r13799 | |
| 876 | 869 | |
| 877 | 870 | |
| 878 | 871 | /* Render alpha-blended tilemap to separate buffer for proper mixing */ |
| 879 | state->m_tilemap_alpha_bitmap->fill(0, | |
| 872 | state->m_tilemap_alpha_bitmap->fill(0, | |
| 880 | 873 | |
| 881 | 874 | /* Draw playfields & sprites */ |
| 882 | 875 | if (state->m_pri&2) |
| r13798 | r13799 | |
|---|---|---|
| 54 | 54 | { |
| 55 | 55 | int y; |
| 56 | 56 | |
| 57 | for (y = cliprect | |
| 57 | for (y = cliprect. | |
| 58 | 58 | { |
| 59 | 59 | int x; |
| 60 | 60 | |
| 61 | for (x = cliprect | |
| 61 | for (x = cliprect. | |
| 62 | 62 | { |
| 63 | 63 | int pixel0 = s2636_0_bitmap->pix16(y, x); |
| 64 | 64 | int pixel1 = s2636_1_bitmap->pix16(y, x); |
| r13798 | r13799 | |
|---|---|---|
| 343 | 343 | { |
| 344 | 344 | const void *base = waveram1_ptr_from_expanded_addr(zeusbase[0xcc]); |
| 345 | 345 | int xoffs = screen.visible_area().min_x; |
| 346 | for (y = cliprect | |
| 346 | for (y = cliprect. | |
| 347 | 347 | { |
| 348 | 348 | UINT16 *dest = &bitmap->pix16(y); |
| 349 | for (x = cliprect | |
| 349 | for (x = cliprect. | |
| 350 | 350 | dest[x] = WAVERAM_READPIX(base, y, x - xoffs) & 0x7fff; |
| 351 | 351 | } |
| 352 | 352 | } |
| r13798 | r13799 | |
| 364 | 364 | if (yoffs < 0) yoffs = 0; |
| 365 | 365 | base = waveram0_ptr_from_block_addr(yoffs << 12); |
| 366 | 366 | |
| 367 | for (y = cliprect | |
| 367 | for (y = cliprect. | |
| 368 | 368 | { |
| 369 | 369 | UINT16 *dest = &bitmap->pix16(y); |
| 370 | for (x = cliprect | |
| 370 | for (x = cliprect. | |
| 371 | 371 | { |
| 372 | 372 | UINT8 tex = get_texel_8bit(base, y, x, texel_width); |
| 373 | 373 | dest[x] = (tex << 8) | tex; |
| r13798 | r13799 | |
| 653 | 653 | extra->solidcolor = zeusbase[0x00]; |
| 654 | 654 | extra->zoffset = 0x7fff; |
| 655 | 655 | |
| 656 | poly_render_quad(poly, NULL, | |
| 656 | poly_render_quad(poly, NULL, | |
| 657 | 657 | poly_wait(poly, "Normal"); |
| 658 | 658 | } |
| 659 | 659 | else |
| r13798 | r13799 | |
| 1275 | 1275 | extra->transcolor = ((ctrl_word >> 16) & 1) ? 0 : 0x100; |
| 1276 | 1276 | extra->palbase = waveram0_ptr_from_block_addr(zeus_palbase); |
| 1277 | 1277 | |
| 1278 | poly_render_quad_fan(poly, NULL, | |
| 1278 | poly_render_quad_fan(poly, NULL, | |
| 1279 | 1279 | } |
| 1280 | 1280 | |
| 1281 | 1281 |
| r13798 | r13799 | |
|---|---|---|
| 168 | 168 | return result?(1<<which):0; |
| 169 | 169 | } |
| 170 | 170 | |
| 171 | static void draw_fog(grchamp_state *state, bitmap_t *bitmap, const rectangle | |
| 171 | static void draw_fog(grchamp_state *state, bitmap_t *bitmap, const rectangle &cliprect, int fog) | |
| 172 | 172 | { |
| 173 | 173 | int x,y,offs; |
| 174 | 174 | |
| r13798 | r13799 | |
| 185 | 185 | } |
| 186 | 186 | } |
| 187 | 187 | |
| 188 | static void draw_sprites(running_machine &machine, grchamp_state *state, bitmap_t *bitmap, const rectangle | |
| 188 | static void draw_sprites(running_machine &machine, grchamp_state *state, bitmap_t *bitmap, const rectangle &cliprect) | |
| 189 | 189 | { |
| 190 | 190 | const gfx_element *gfx = machine.gfx[5]; |
| 191 | 191 | int bank = (state->m_cpu0_out[0] & 0x20) ? 0x40 : 0x00; |
| r13798 | r13799 | |
| 395 | 395 | cxmask = (state->m_cpu1_out[3] & 0x20) ? 0xff : 0x1ff; |
| 396 | 396 | |
| 397 | 397 | /* iterate over scanlines */ |
| 398 | for (y = cliprect | |
| 398 | for (y = cliprect. | |
| 399 | 399 | { |
| 400 | 400 | /* select either left or right tilemaps based on Y */ |
| 401 | 401 | bitmap_t *lrpixmap = (y < 128) ? lpixmap : rpixmap; |
| r13798 | r13799 | |
| 412 | 412 | draw_objects(screen.machine(), state, y, objdata); |
| 413 | 413 | |
| 414 | 414 | /* iterate over columns */ |
| 415 | for (x = cliprect | |
| 415 | for (x = cliprect. | |
| 416 | 416 | { |
| 417 | 417 | rgb_t finalpix; |
| 418 | 418 | int headbit = 0; |
| r13798 | r13799 | |
|---|---|---|
| 851 | 851 | } |
| 852 | 852 | } |
| 853 | 853 | |
| 854 | static void argus_draw_sprites(running_machine &machine, bitmap_t *bitmap, const rectangle | |
| 854 | static void argus_draw_sprites(running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect, int priority) | |
| 855 | 855 | { |
| 856 | 856 | argus_state *state = machine.driver_data<argus_state>(); |
| 857 | 857 | UINT8 *spriteram = state->m_spriteram; |
| r13798 | r13799 | |
| 894 | 894 | } |
| 895 | 895 | |
| 896 | 896 | #if 1 |
| 897 | static void valtric_draw_mosaic(screen_device &screen, bitmap_t *bitmap, const rectangle | |
| 897 | static void valtric_draw_mosaic(screen_device &screen, bitmap_t *bitmap, const rectangle &cliprect) | |
| 898 | 898 | { |
| 899 | 899 | argus_state *state = screen.machine().driver_data<argus_state>(); |
| 900 | 900 | |
| r13798 | r13799 | |
| 943 | 943 | } |
| 944 | 944 | } |
| 945 | 945 | #else |
| 946 | static void valtric_draw_mosaic(screen_device &screen, bitmap_t *bitmap, const rectangle | |
| 946 | static void valtric_draw_mosaic(screen_device &screen, bitmap_t *bitmap, const rectangle &cliprect) | |
| 947 | 947 | { |
| 948 | 948 | argus_state *state = screen.machine().driver_data<argus_state>(); |
| 949 | 949 | int step = 0x10 - (state->m_valtric_mosaic & 0x0f); |
| r13798 | r13799 | |
| 984 | 984 | } |
| 985 | 985 | #endif |
| 986 | 986 | |
| 987 | static void valtric_draw_sprites(running_machine &machine, bitmap_t *bitmap, const rectangle | |
| 987 | static void valtric_draw_sprites(running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect) | |
| 988 | 988 | { |
| 989 | 989 | argus_state *state = machine.driver_data<argus_state>(); |
| 990 | 990 | UINT8 *spriteram = state->m_spriteram; |
| r13798 | r13799 | |
| 1024 | 1024 | } |
| 1025 | 1025 | } |
| 1026 | 1026 | |
| 1027 | static void butasan_draw_sprites(running_machine &machine, bitmap_t *bitmap, const rectangle | |
| 1027 | static void butasan_draw_sprites(running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect) | |
| 1028 | 1028 | { |
| 1029 | 1029 | argus_state *state = machine.driver_data<argus_state>(); |
| 1030 | 1030 | UINT8 *spriteram = state->m_spriteram; |
| r13798 | r13799 | |
| 1214 | 1214 | if (state->m_bg_status & 1) /* Backgound enable */ |
| 1215 | 1215 | valtric_draw_mosaic(screen, bitmap, cliprect); |
| 1216 | 1216 | else |
| 1217 | bitmap->fill(get_black_pen(screen.machine()), | |
| 1217 | bitmap->fill(get_black_pen(screen.machine()), | |
| 1218 | 1218 | valtric_draw_sprites(screen.machine(), bitmap, cliprect); |
| 1219 | 1219 | tilemap_draw(bitmap, cliprect, state->m_tx_tilemap, 0, 0); |
| 1220 | 1220 | return 0; |
| r13798 | r13799 | |
| 1228 | 1228 | if (state->m_bg_status & 1) /* Backgound enable */ |
| 1229 | 1229 | tilemap_draw(bitmap, cliprect, state->m_bg0_tilemap, 0, 0); |
| 1230 | 1230 | else |
| 1231 | bitmap->fill(get_black_pen(screen.machine()), | |
| 1231 | bitmap->fill(get_black_pen(screen.machine()), | |
| 1232 | 1232 | if (state->m_butasan_bg1_status & 1) tilemap_draw(bitmap, cliprect, state->m_bg1_tilemap, 0, 0); |
| 1233 | 1233 | butasan_draw_sprites(screen.machine(), bitmap, cliprect); |
| 1234 | 1234 | tilemap_draw(bitmap, cliprect, state->m_tx_tilemap, 0, 0); |
| r13798 | r13799 | |
|---|---|---|
| 104 | 104 | } |
| 105 | 105 | |
| 106 | 106 | |
| 107 | static void draw_sprites( running_machine &machine, bitmap_t *bitmap, const rectangle | |
| 107 | static void draw_sprites( running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect ) | |
| 108 | 108 | { |
| 109 | 109 | lkage_state *state = machine.driver_data<lkage_state>(); |
| 110 | 110 | const UINT8 *source = state->m_spriteram; |
| r13798 | r13799 | |
| 215 | 215 | tilemap_set_scrollx(state->m_bg_tilemap, 0, state->m_scroll[4]); |
| 216 | 216 | tilemap_set_scrolly(state->m_bg_tilemap, 0, state->m_scroll[5]); |
| 217 | 217 | |
| 218 | screen.machine().priority_bitmap->fill(0, | |
| 218 | screen.machine().priority_bitmap->fill(0, | |
| 219 | 219 | if ((state->m_vreg[2] & 0xf0) == 0xf0) |
| 220 | 220 | { |
| 221 | 221 | tilemap_draw(bitmap, cliprect, state->m_bg_tilemap, 0, 1); |
| r13798 | r13799 | |
|---|---|---|
| 322 | 322 | * |
| 323 | 323 | *************************************/ |
| 324 | 324 | |
| 325 | static void draw_background(running_machine &machine, bitmap_t *bitmap, const rectangle | |
| 325 | static void draw_background(running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect, int skew) | |
| 326 | 326 | { |
| 327 | 327 | zaxxon_state *state = machine.driver_data<zaxxon_state>(); |
| 328 | 328 | |
| r13798 | r13799 | |
| 345 | 345 | flipoffs += 7; |
| 346 | 346 | |
| 347 | 347 | /* loop over visible rows */ |
| 348 | for (y = cliprect | |
| 348 | for (y = cliprect. | |
| 349 | 349 | { |
| 350 | 350 | UINT16 *dst = &bitmap->pix16(y); |
| 351 | 351 | int srcx, srcy, vf; |
| r13798 | r13799 | |
| 360 | 360 | src = &pixmap->pix16(srcy & ymask); |
| 361 | 361 | |
| 362 | 362 | /* loop over visible colums */ |
| 363 | for (x = cliprect | |
| 363 | for (x = cliprect. | |
| 364 | 364 | { |
| 365 | 365 | /* start with HF = flipped H signals */ |
| 366 | 366 | srcx = x ^ flipmask; |
| r13798 | r13799 | |
| 384 | 384 | |
| 385 | 385 | /* if not enabled, fill the background with black */ |
| 386 | 386 | else |
| 387 | bitmap->fill(get_black_pen(machine), | |
| 387 | bitmap->fill(get_black_pen(machine), | |
| 388 | 388 | } |
| 389 | 389 | |
| 390 | 390 | |
| r13798 | r13799 | |
| 440 | 440 | } |
| 441 | 441 | |
| 442 | 442 | |
| 443 | static void draw_sprites(running_machine &machine, bitmap_t *bitmap, const rectangle | |
| 443 | static void draw_sprites(running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect, UINT16 flipxmask, UINT16 flipymask) | |
| 444 | 444 | { |
| 445 | 445 | zaxxon_state *state = machine.driver_data<zaxxon_state>(); |
| 446 | 446 | UINT8 *spriteram = state->m_spriteram; |
| r13798 | r13799 | |
|---|---|---|
| 311 | 311 | in the bitmaps? */ |
| 312 | 312 | static void blendbitmaps(running_machine &machine, |
| 313 | 313 | bitmap_t *dest,bitmap_t *src1,bitmap_t *src2,bitmap_t *src3, |
| 314 | int sx,int sy,const rectangle | |
| 314 | int sx,int sy,const rectangle &cliprect) | |
| 315 | 315 | { |
| 316 | 316 | int y,x; |
| 317 | 317 | const pen_t *paldata = machine.pens; |
| 318 | 318 | |
| 319 | for (y = cliprect | |
| 319 | for (y = cliprect. | |
| 320 | 320 | { |
| 321 | 321 | UINT32 *dd = &dest->pix32(y); |
| 322 | 322 | UINT16 *sd1 = &src1->pix16(y); |
| 323 | 323 | UINT16 *sd2 = &src2->pix16(y); |
| 324 | 324 | UINT16 *sd3 = &src3->pix16(y); |
| 325 | 325 | |
| 326 | for (x = cliprect | |
| 326 | for (x = cliprect. | |
| 327 | 327 | { |
| 328 | 328 | if (sd3[x]) |
| 329 | 329 | { |
| r13798 | r13799 | |
| 367 | 367 | |
| 368 | 368 | #define NUM_SPRITES 256 |
| 369 | 369 | |
| 370 | static void gaiden_draw_sprites( running_machine &machine, bitmap_t *bitmap_bg, bitmap_t *bitmap_fg, bitmap_t *bitmap_sp, const rectangle | |
| 370 | static void gaiden_draw_sprites( running_machine &machine, bitmap_t *bitmap_bg, bitmap_t *bitmap_fg, bitmap_t *bitmap_sp, const rectangle &cliprect ) | |
| 371 | 371 | { |
| 372 | 372 | static const UINT8 layout[8][8] = |
| 373 | 373 | { |
| r13798 | r13799 | |
| 489 | 489 | } |
| 490 | 490 | |
| 491 | 491 | |
| 492 | static void raiga_draw_sprites( running_machine &machine, bitmap_t *bitmap_bg, bitmap_t *bitmap_fg, bitmap_t *bitmap_sp, const rectangle | |
| 492 | static void raiga_draw_sprites( running_machine &machine, bitmap_t *bitmap_bg, bitmap_t *bitmap_fg, bitmap_t *bitmap_sp, const rectangle &cliprect ) | |
| 493 | 493 | { |
| 494 | 494 | static const UINT8 layout[8][8] = |
| 495 | 495 | { |
| r13798 | r13799 | |
| 629 | 629 | * |---------x------- | x position (high bit) |
| 630 | 630 | */ |
| 631 | 631 | |
| 632 | static void drgnbowl_draw_sprites(running_machine &machine, bitmap_t *bitmap, const rectangle | |
| 632 | static void drgnbowl_draw_sprites(running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect) | |
| 633 | 633 | { |
| 634 | 634 | gaiden_state *state = machine.driver_data<gaiden_state>(); |
| 635 | 635 | UINT16 *spriteram = state->m_spriteram; |
| r13798 | r13799 | |
| 673 | 673 | SCREEN_UPDATE( gaiden ) |
| 674 | 674 | { |
| 675 | 675 | gaiden_state *state = screen.machine().driver_data<gaiden_state>(); |
| 676 | screen.machine().priority_bitmap->fill(0, | |
| 676 | screen.machine().priority_bitmap->fill(0, | |
| 677 | 677 | |
| 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); | |
| 681 | 681 | |
| 682 | 682 | /* draw tilemaps into a 16-bit bitmap */ |
| 683 | 683 | tilemap_draw(state->m_tile_bitmap_bg, cliprect, state->m_background, 0, 1); |
| r13798 | r13799 | |
| 699 | 699 | SCREEN_UPDATE( raiga ) |
| 700 | 700 | { |
| 701 | 701 | gaiden_state *state = screen.machine().driver_data<gaiden_state>(); |
| 702 | screen.machine().priority_bitmap->fill(0, | |
| 702 | screen.machine().priority_bitmap->fill(0, | |
| 703 | 703 | |
| 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); | |
| 707 | 707 | |
| 708 | 708 | /* draw tilemaps into a 16-bit bitmap */ |
| 709 | 709 | tilemap_draw(state->m_tile_bitmap_bg, cliprect, state->m_background, 0, 1); |
| r13798 | r13799 | |
| 724 | 724 | SCREEN_UPDATE( drgnbowl ) |
| 725 | 725 | { |
| 726 | 726 | gaiden_state *state = screen.machine().driver_data<gaiden_state>(); |
| 727 | screen.machine().priority_bitmap->fill(0, | |
| 727 | screen.machine().priority_bitmap->fill(0, | |
| 728 | 728 | |
| 729 | 729 | tilemap_draw(bitmap, cliprect, state->m_background, 0, 1); |
| 730 | 730 | tilemap_draw(bitmap, cliprect, state->m_foreground, 0, 2); |
| r13798 | r13799 | |
|---|---|---|
| 60 | 60 | tilemap_mark_tile_dirty( state->m_background, offset&0x7ff ); |
| 61 | 61 | } |
| 62 | 62 | |
| 63 | static void draw_sprite(running_machine &machine, const UINT8 *source, bitmap_t *bitmap, const rectangle | |
| 63 | static void draw_sprite(running_machine &machine, const UINT8 *source, bitmap_t *bitmap, const rectangle &cliprect) | |
| 64 | 64 | { |
| 65 | 65 | shangkid_state *state = machine.driver_data<shangkid_state>(); |
| 66 | 66 | const gfx_element *gfx; |
| r13798 | r13799 | |
| 172 | 172 | } |
| 173 | 173 | } |
| 174 | 174 | |
| 175 | static void shangkid_draw_sprites(running_machine &machine, bitmap_t *bitmap, const rectangle | |
| 175 | static void shangkid_draw_sprites(running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect) | |
| 176 | 176 | { |
| 177 | 177 | shangkid_state *state = machine.driver_data<shangkid_state>(); |
| 178 | 178 | const UINT8 *source, *finish; |
| r13798 | r13799 | |
| 235 | 235 | } |
| 236 | 236 | |
| 237 | 237 | |
| 238 | static void dynamski_draw_background(running_machine &machine, bitmap_t *bitmap, const rectangle | |
| 238 | static void dynamski_draw_background(running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect, int pri ) | |
| 239 | 239 | { |
| 240 | 240 | shangkid_state *state = machine.driver_data<shangkid_state>(); |
| 241 | 241 | UINT8 *videoram = state->m_videoram; |
| r13798 | r13799 | |
| 289 | 289 | } |
| 290 | 290 | } |
| 291 | 291 | |
| 292 | static void dynamski_draw_sprites(running_machine &machine, bitmap_t *bitmap, const rectangle | |
| 292 | static void dynamski_draw_sprites(running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect ) | |
| 293 | 293 | { |
| 294 | 294 | shangkid_state *state = machine.driver_data<shangkid_state>(); |
| 295 | 295 | UINT8 *videoram = state->m_videoram; |
| r13798 | r13799 | |
|---|---|---|
| 192 | 192 | |
| 193 | 193 | |
| 194 | 194 | |
| 195 | static void draw_sprites( running_machine &machine, bitmap_t *bitmap, const rectangle | |
| 195 | static void draw_sprites( running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect ) | |
| 196 | 196 | { |
| 197 | 197 | trackfld_state *state = machine.driver_data<trackfld_state>(); |
| 198 | 198 | UINT8 *spriteram = state->m_spriteram; |
| r13798 | r13799 | |
|---|---|---|
| 231 | 231 | * |
| 232 | 232 | *************************************/ |
| 233 | 233 | |
| 234 | static void draw_sprites(running_machine &machine, bitmap_t *bitmap, const rectangle | |
| 234 | static void draw_sprites(running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect) | |
| 235 | 235 | { |
| 236 | 236 | const rectangle spritevisiblearea(2*8, 32*8-1, 2*8, 30*8-1); |
| 237 | 237 | const rectangle spritevisibleareaflipx(0*8, 30*8-1, 2*8, 30*8-1); |
| r13798 | r13799 | |
| 287 | 287 | flipy = !flipy; |
| 288 | 288 | } |
| 289 | 289 | |
| 290 | drawgfx_transpen(bitmap,flip_screen_x_get(machine) ? | |
| 290 | drawgfx_transpen(bitmap,flip_screen_x_get(machine) ? | |
| 291 | 291 | code, |
| 292 | 292 | state->m_colorbank | (state->m_spriteram[offs + 2] & 0x07), |
| 293 | 293 | flipx,flipy, |
| r13798 | r13799 | |
| 299 | 299 | SCREEN_UPDATE( fastfred ) |
| 300 | 300 | { |
| 301 | 301 | fastfred_state *state = screen.machine().driver_data<fastfred_state>(); |
| 302 | bitmap->fill(*state->m_background_color, | |
| 302 | bitmap->fill(*state->m_background_color, | |
| 303 | 303 | tilemap_draw(bitmap,cliprect,state->m_bg_tilemap,0,0); |
| 304 | 304 | draw_sprites(screen.machine(), bitmap, cliprect); |
| 305 | 305 |
| r13798 | r13799 | |
|---|---|---|
| 72 | 72 | tilemap_set_flip_all(machine, state->m_flipscreen ? (TILEMAP_FLIPY | TILEMAP_FLIPX) : 0); |
| 73 | 73 | } |
| 74 | 74 | |
| 75 | static void draw_background( running_machine &machine, bitmap_t *bitmap, const rectangle | |
| 75 | static void draw_background( running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect ) | |
| 76 | 76 | { |
| 77 | 77 | karnov_state *state = machine.driver_data<karnov_state>(); |
| 78 | 78 | int my, mx, offs, color, tile, fx, fy; |
| r13798 | r13799 | |
| 100 | 100 | color = tile >> 12; |
| 101 | 101 | tile = tile & 0x7ff; |
| 102 | 102 | if (state->m_flipscreen) |
| 103 | drawgfx_opaque(state->m_bitmap_f, | |
| 103 | drawgfx_opaque(state->m_bitmap_f, state->m_bitmap_f->cliprect(), machine.gfx[1],tile, | |
| 104 | 104 | color, fx, fy, 496-16*mx,496-16*my); |
| 105 | 105 | else |
| 106 | drawgfx_opaque(state->m_bitmap_f, | |
| 106 | drawgfx_opaque(state->m_bitmap_f, state->m_bitmap_f->cliprect(), machine.gfx[1],tile, | |
| 107 | 107 | color, fx, fy, 16*mx,16*my); |
| 108 | 108 | } |
| 109 | 109 |
| r13798 | r13799 | |
|---|---|---|
| 184 | 184 | return sx || sy; |
| 185 | 185 | } |
| 186 | 186 | |
| 187 | static void lwings_draw_sprites( running_machine &machine, bitmap_t *bitmap, const rectangle | |
| 187 | static void lwings_draw_sprites( running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect ) | |
| 188 | 188 | { |
| 189 | 189 | UINT8 *buffered_spriteram = machine.generic.buffered_spriteram.u8; |
| 190 | 190 | int offs; |
| r13798 | r13799 | |
| 220 | 220 | } |
| 221 | 221 | } |
| 222 | 222 | |
| 223 | static void trojan_draw_sprites( running_machine &machine, bitmap_t *bitmap, const rectangle | |
| 223 | static void trojan_draw_sprites( running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect ) | |
| 224 | 224 | { |
| 225 | 225 | lwings_state *state = machine.driver_data<lwings_state>(); |
| 226 | 226 | UINT8 *buffered_spriteram = machine.generic.buffered_spriteram.u8; |
| r13798 | r13799 | |
|---|---|---|
| 205 | 205 | |
| 206 | 206 | |
| 207 | 207 | |
| 208 | static void draw_big_sprite(running_machine &machine, bitmap_t *bitmap, const rectangle | |
| 208 | static void draw_big_sprite(running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect, int palette) | |
| 209 | 209 | { |
| 210 | 210 | punchout_state *state = machine.driver_data<punchout_state>(); |
| 211 | 211 | int zoom; |
| r13798 | r13799 | |
| 249 | 249 | } |
| 250 | 250 | |
| 251 | 251 | |
| 252 | static void armwrest_draw_big_sprite(running_machine &machine, bitmap_t *bitmap, const rectangle | |
| 252 | static void armwrest_draw_big_sprite(running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect, int palette) | |
| 253 | 253 | { |
| 254 | 254 | punchout_state *state = machine.driver_data<punchout_state>(); |
| 255 | 255 | int zoom; |
| r13798 | r13799 | |
| 296 | 296 | } |
| 297 | 297 | } |
| 298 | 298 | |
| 299 | static void drawbs2(running_machine &machine, bitmap_t *bitmap, const rectangle | |
| 299 | static void drawbs2(running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect) | |
| 300 | 300 | { |
| 301 | 301 | punchout_state *state = machine.driver_data<punchout_state>(); |
| 302 | 302 | int sx,sy; |
| r13798 | r13799 | |
|---|---|---|
| 169 | 169 | |
| 170 | 170 | ***************************************************************************/ |
| 171 | 171 | |
| 172 | static void draw_sprites(running_machine &machine, bitmap_t *bitmap,const rectangle | |
| 172 | static void draw_sprites(running_machine &machine, bitmap_t *bitmap,const rectangle &cliprect) | |
| 173 | 173 | { |
| 174 | 174 | tecmo_state *state = machine.driver_data<tecmo_state>(); |
| 175 | 175 | UINT8 *spriteram = state->m_spriteram; |
| r13798 | r13799 | |
| 251 | 251 | SCREEN_UPDATE( tecmo ) |
| 252 | 252 | { |
| 253 | 253 | 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); | |
| 256 | 256 | tilemap_draw(bitmap,cliprect,state->m_bg_tilemap,0,1); |
| 257 | 257 | tilemap_draw(bitmap,cliprect,state->m_fg_tilemap,0,2); |
| 258 | 258 | tilemap_draw(bitmap,cliprect,state->m_tx_tilemap,0,4); |
| r13798 | r13799 | |
|---|---|---|
| 47 | 47 | /* if no drawing is happening, fill with black and get out */ |
| 48 | 48 | if (!segaic16_display_enable) |
| 49 | 49 | { |
| 50 | bitmap->fill(get_black_pen(screen.machine()), | |
| 50 | bitmap->fill(get_black_pen(screen.machine()), | |
| 51 | 51 | return 0; |
| 52 | 52 | } |
| 53 | 53 | |
| 54 | 54 | /* draw the yboard sprites */ |
| 55 | 55 | yboard_clip.min_x = yboard_clip.min_y = 0; |
| 56 | 56 | yboard_clip.max_x = yboard_clip.max_y = 511; |
| 57 | segaic16_sprites_draw(screen, state->m_tmp_bitmap, | |
| 57 | segaic16_sprites_draw(screen, state->m_tmp_bitmap, | |
| 58 | 58 | |
| 59 | 59 | /* apply rotation */ |
| 60 | 60 | segaic16_rotate_draw(screen.machine(), 0, bitmap, cliprect, state->m_tmp_bitmap); |
| r13798 | r13799 | |
|---|---|---|
| 45 | 45 | } |
| 46 | 46 | |
| 47 | 47 | |
| 48 | static void comad_draw_sprites(running_machine &machine, bitmap_t *bitmap, const rectangle | |
| 48 | static void comad_draw_sprites(running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect) | |
| 49 | 49 | { |
| 50 | 50 | galpanic_state *state = machine.driver_data<galpanic_state>(); |
| 51 | 51 | UINT16 *spriteram16 = state->m_spriteram; |
| r13798 | r13799 | |
| 83 | 83 | } |
| 84 | 84 | } |
| 85 | 85 | |
| 86 | static void draw_fgbitmap(running_machine &machine, bitmap_t *bitmap, const rectangle | |
| 86 | static void draw_fgbitmap(running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect) | |
| 87 | 87 | { |
| 88 | 88 | galpanic_state *state = machine.driver_data<galpanic_state>(); |
| 89 | 89 | int offs; |
| r13798 | r13799 | |
| 125 | 125 | |
| 126 | 126 | // if(galpanic_clear_sprites) |
| 127 | 127 | { |
| 128 | state->m_sprites_bitmap->fill(0, | |
| 128 | state->m_sprites_bitmap->fill(0, | |
| 129 | 129 | comad_draw_sprites(screen.machine(),bitmap,cliprect); |
| 130 | 130 | } |
| 131 | 131 | // else |
| r13798 | r13799 | |
|---|---|---|
| 214 | 214 | |
| 215 | 215 | { |
| 216 | 216 | const rectangle &visarea = screen.visible_area(); |
| 217 | rectangle clip = | |
| 217 | rectangle clip = | |
| 218 | 218 | |
| 219 | 219 | /* draw top status region */ |
| 220 | 220 | clip.min_x = visarea.min_x; |
| 221 | 221 | clip.max_x = visarea.min_x + 31; |
| 222 | 222 | tilemap_set_scrolldx(state->m_fg_tilemap, 0,-32); |
| 223 | tilemap_draw(bitmap, | |
| 223 | tilemap_draw(bitmap, | |
| 224 | 224 | } |
| 225 | 225 | return 0; |
| 226 | 226 | } |
| r13798 | r13799 | |
|---|---|---|
| 96 | 96 | 1 | xxxx---- -------- | sprite color |
| 97 | 97 | */ |
| 98 | 98 | |
| 99 | static void draw_sprites(running_machine &machine, bitmap_t *bitmap, const rectangle | |
| 99 | static void draw_sprites(running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect ) | |
| 100 | 100 | { |
| 101 | 101 | xorworld_state *state = machine.driver_data<xorworld_state>(); |
| 102 | 102 | UINT16 *spriteram16 = state->m_spriteram; |
| r13798 | r13799 | |
|---|---|---|
| 487 | 487 | } |
| 488 | 488 | |
| 489 | 489 | |
| 490 | static void draw_playfield(running_machine &machine, bitmap_t *bitmap, const rectangle | |
| 490 | static void draw_playfield(running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect) | |
| 491 | 491 | { |
| 492 | 492 | cclimber_state *state = machine.driver_data<cclimber_state>(); |
| 493 | 493 | int i; |
| r13798 | r13799 | |
| 502 | 502 | } |
| 503 | 503 | |
| 504 | 504 | |
| 505 | static void cclimber_draw_bigsprite(running_machine &machine, bitmap_t *bitmap, const rectangle | |
| 505 | static void cclimber_draw_bigsprite(running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect) | |
| 506 | 506 | { |
| 507 | 507 | cclimber_state *state = machine.driver_data<cclimber_state>(); |
| 508 | 508 | UINT8 x = state->m_bigsprite_control[3] - 8; |
| r13798 | r13799 | |
| 528 | 528 | } |
| 529 | 529 | |
| 530 | 530 | |
| 531 | static void toprollr_draw_bigsprite(running_machine &machine, bitmap_t *bitmap, const rectangle | |
| 531 | static void toprollr_draw_bigsprite(running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect) | |
| 532 | 532 | { |
| 533 | 533 | cclimber_state *state = machine.driver_data<cclimber_state>(); |
| 534 | 534 | UINT8 x = state->m_bigsprite_control[3] - 8; |
| r13798 | r13799 | |
| 545 | 545 | } |
| 546 | 546 | |
| 547 | 547 | |
| 548 | static void cclimber_draw_sprites(bitmap_t *bitmap, const rectangle | |
| 548 | static void cclimber_draw_sprites(bitmap_t *bitmap, const rectangle &cliprect, const gfx_element *gfx) | |
| 549 | 549 | { |
| 550 | 550 | cclimber_state *state = gfx->machine().driver_data<cclimber_state>(); |
| 551 | 551 | int offs; |
| r13798 | r13799 | |
| 586 | 586 | } |
| 587 | 587 | |
| 588 | 588 | |
| 589 | static void toprollr_draw_sprites(bitmap_t *bitmap, const rectangle | |
| 589 | static void toprollr_draw_sprites(bitmap_t *bitmap, const rectangle &cliprect, const gfx_element *gfx) | |
| 590 | 590 | { |
| 591 | 591 | cclimber_state *state = gfx->machine().driver_data<cclimber_state>(); |
| 592 | 592 | int offs; |
| r13798 | r13799 | |
| 624 | 624 | } |
| 625 | 625 | |
| 626 | 626 | |
| 627 | static void swimmer_draw_sprites(bitmap_t *bitmap, const rectangle | |
| 627 | static void swimmer_draw_sprites(bitmap_t *bitmap, const rectangle &cliprect, const gfx_element *gfx) | |
| 628 | 628 | { |
| 629 | 629 | cclimber_state *state = gfx->machine().driver_data<cclimber_state>(); |
| 630 | 630 | int offs; |
| r13798 | r13799 | |
| 665 | 665 | SCREEN_UPDATE( cclimber ) |
| 666 | 666 | { |
| 667 | 667 | cclimber_state *state = screen.machine().driver_data<cclimber_state>(); |
| 668 | bitmap->fill(CCLIMBER_BG_PEN, | |
| 668 | bitmap->fill(CCLIMBER_BG_PEN, | |
| 669 | 669 | draw_playfield(screen.machine(), bitmap, cliprect); |
| 670 | 670 | |
| 671 | 671 | /* draw the "big sprite" under the regular sprites */ |
| r13798 | r13799 | |
| 733 | 733 | rectangle split_rect_left(0, 0xff - SWIMMER_BG_SPLIT, 0, 0xff); |
| 734 | 734 | rectangle split_rect_right(0x100 - SWIMMER_BG_SPLIT, 0xff, 0, 0xff); |
| 735 | 735 | |
| 736 | split_rect_left &= | |
| 736 | split_rect_left &= | |
| 737 | 737 | bitmap->fill(SWIMMER_SIDE_BG_PEN, split_rect_left); |
| 738 | 738 | |
| 739 | split_rect_right &= | |
| 739 | split_rect_right &= | |
| 740 | 740 | bitmap->fill(CCLIMBER_BG_PEN, split_rect_right); |
| 741 | 741 | } |
| 742 | 742 | else |
| r13798 | r13799 | |
| 744 | 744 | rectangle split_rect_left(0, SWIMMER_BG_SPLIT - 1, 0, 0xff); |
| 745 | 745 | rectangle split_rect_right(SWIMMER_BG_SPLIT, 0xff, 0, 0xff); |
| 746 | 746 | |
| 747 | split_rect_left &= | |
| 747 | split_rect_left &= | |
| 748 | 748 | bitmap->fill(CCLIMBER_BG_PEN, split_rect_left); |
| 749 | 749 | |
| 750 | split_rect_right &= | |
| 750 | split_rect_right &= | |
| 751 | 751 | bitmap->fill(SWIMMER_SIDE_BG_PEN, split_rect_right); |
| 752 | 752 | } |
| 753 | 753 | } |
| 754 | 754 | else |
| 755 | bitmap->fill(CCLIMBER_BG_PEN, | |
| 755 | bitmap->fill(CCLIMBER_BG_PEN, | |
| 756 | 756 | |
| 757 | 757 | draw_playfield(screen.machine(), bitmap, cliprect); |
| 758 | 758 | |
| r13798 | r13799 | |
| 777 | 777 | SCREEN_UPDATE( toprollr ) |
| 778 | 778 | { |
| 779 | 779 | cclimber_state *state = screen.machine().driver_data<cclimber_state>(); |
| 780 | rectangle scroll_area_clip = | |
| 780 | rectangle scroll_area_clip = | |
| 781 | 781 | scroll_area_clip.min_x = 4*8; |
| 782 | 782 | scroll_area_clip.max_x = 29*8-1; |
| 783 | 783 | |
| 784 | bitmap->fill(CCLIMBER_BG_PEN, | |
| 784 | bitmap->fill(CCLIMBER_BG_PEN, | |
| 785 | 785 | |
| 786 | 786 | tilemap_set_scrollx(state->m_toproller_bg_tilemap, 0, state->m_toprollr_bg_videoram[0]); |
| 787 | 787 | tilemap_set_flip(state->m_toproller_bg_tilemap, (CCLIMBER_FLIP_X ? TILEMAP_FLIPX : 0) | |
| 788 | 788 | (CCLIMBER_FLIP_Y ? TILEMAP_FLIPY : 0)); |
| 789 | 789 | tilemap_mark_all_tiles_dirty(state->m_toproller_bg_tilemap); |
| 790 | tilemap_draw(bitmap, | |
| 790 | tilemap_draw(bitmap, | |
| 791 | 791 | |
| 792 | 792 | /* draw the "big sprite" over the regular sprites */ |
| 793 | 793 | if ((state->m_bigsprite_control[1] & 0x20)) |
| 794 | 794 | { |
| 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); | |
| 797 | 797 | } |
| 798 | 798 | |
| 799 | 799 | /* draw the "big sprite" under the regular sprites */ |
| 800 | 800 | else |
| 801 | 801 | { |
| 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]); | |
| 804 | 804 | } |
| 805 | 805 | |
| 806 | 806 | tilemap_mark_all_tiles_dirty(state->m_pf_tilemap); |
| r13798 | r13799 | |
|---|---|---|
| 59 | 59 | } |
| 60 | 60 | |
| 61 | 61 | |
| 62 | static void draw_sprites(running_machine &machine, bitmap_t *bitmap, const rectangle | |
| 62 | static void draw_sprites(running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect ) | |
| 63 | 63 | { |
| 64 | 64 | speedspn_state *state = machine.driver_data<speedspn_state>(); |
| 65 | 65 | const gfx_element *gfx = machine.gfx[1]; |
| r13798 | r13799 | |
| 98 | 98 | speedspn_state *state = screen.machine().driver_data<speedspn_state>(); |
| 99 | 99 | if (state->m_display_disable) |
| 100 | 100 | { |
| 101 | bitmap->fill(get_black_pen(screen.machine()), | |
| 101 | bitmap->fill(get_black_pen(screen.machine()), | |
| 102 | 102 | return 0; |
| 103 | 103 | } |
| 104 | 104 |
| r13798 | r13799 | |
|---|---|---|
| 52 | 52 | SCREEN_UPDATE( shangon ) |
| 53 | 53 | { |
| 54 | 54 | /* reset priorities */ |
| 55 | screen.machine().priority_bitmap->fill(0, | |
| 55 | screen.machine().priority_bitmap->fill(0, | |
| 56 | 56 | |
| 57 | 57 | /* draw the low priority road layer */ |
| 58 | 58 | segaic16_road_draw(0, bitmap, cliprect, SEGAIC16_ROAD_BACKGROUND); |
| r13798 | r13799 | |
| 85 | 85 | /* if no drawing is happening, fill with black and get out */ |
| 86 | 86 | if (!segaic16_display_enable) |
| 87 | 87 | { |
| 88 | bitmap->fill(get_black_pen(screen.machine()), | |
| 88 | bitmap->fill(get_black_pen(screen.machine()), | |
| 89 | 89 | return 0; |
| 90 | 90 | } |
| 91 | 91 | |
| 92 | 92 | /* reset priorities */ |
| 93 | screen.machine().priority_bitmap->fill(0, | |
| 93 | screen.machine().priority_bitmap->fill(0, | |
| 94 | 94 | |
| 95 | 95 | /* draw the low priority road layer */ |
| 96 | 96 | segaic16_road_draw(0, bitmap, cliprect, SEGAIC16_ROAD_BACKGROUND); |
| r13798 | r13799 | |
|---|---|---|
| 865 | 865 | int y; |
| 866 | 866 | |
| 867 | 867 | /* render each scanline in the visible region */ |
| 868 | for (y = cliprect | |
| 868 | for (y = cliprect. | |
| 869 | 869 | amiga_aga_render_scanline(screen.machine(), bitmap, y); |
| 870 | 870 | |
| 871 | 871 | return 0; |
| r13798 | r13799 | |
|---|---|---|
| 541 | 541 | static void render_polygons(running_machine &machine) |
| 542 | 542 | { |
| 543 | 543 | int i, j; |
| 544 | const rectangle | |
| 544 | const rectangle | |
| 545 | 545 | |
| 546 | 546 | // mame_printf_debug("K001005_fifo_ptr = %08X\n", K001005_3d_fifo_ptr); |
| 547 | 547 | |
| r13798 | r13799 | |
| 582 | 582 | ++index; |
| 583 | 583 | |
| 584 | 584 | 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); | |
| 588 | 588 | |
| 589 | 589 | i = index - 1; |
| 590 | 590 | } |
| r13798 | r13799 | |
| 689 | 689 | |
| 690 | 690 | if (num_verts < 3) |
| 691 | 691 | { |
| 692 | poly_render_triangle(poly, K001005_bitmap[K001005_bitmap_page], | |
| 692 | poly_render_triangle(poly, K001005_bitmap[K001005_bitmap_page], | |
| 693 | 693 | if (prev_poly_type) |
| 694 | poly_render_triangle(poly, K001005_bitmap[K001005_bitmap_page], | |
| 694 | poly_render_triangle(poly, K001005_bitmap[K001005_bitmap_page], | |
| 695 | 695 | // if (prev_poly_type) |
| 696 | // poly_render_quad(poly, K001005_bitmap[K001005_bitmap_page], | |
| 696 | // poly_render_quad(poly, K001005_bitmap[K001005_bitmap_page], | |
| 697 | 697 | // else |
| 698 | // poly_render_triangle(poly, K001005_bitmap[K001005_bitmap_page], | |
| 698 | // poly_render_triangle(poly, K001005_bitmap[K001005_bitmap_page], | |
| 699 | 699 | |
| 700 | 700 | memcpy(&prev_v[0], &prev_v[2], sizeof(poly_vertex)); |
| 701 | 701 | memcpy(&prev_v[1], &prev_v[3], sizeof(poly_vertex)); |
| r13798 | r13799 | |
| 704 | 704 | } |
| 705 | 705 | else |
| 706 | 706 | { |
| 707 | poly_render_triangle(poly, K001005_bitmap[K001005_bitmap_page], | |
| 707 | poly_render_triangle(poly, K001005_bitmap[K001005_bitmap_page], | |
| 708 | 708 | 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); | |
| 711 | 711 | |
| 712 | 712 | memcpy(prev_v, v, sizeof(poly_vertex) * 4); |
| 713 | 713 | } |
| r13798 | r13799 | |
| 788 | 788 | |
| 789 | 789 | extra->color = color; |
| 790 | 790 | |
| 791 | poly_render_triangle(poly, K001005_bitmap[K001005_bitmap_page], | |
| 791 | poly_render_triangle(poly, K001005_bitmap[K001005_bitmap_page], | |
| 792 | 792 | 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); | |
| 795 | 795 | |
| 796 | 796 | memcpy(prev_v, v, sizeof(poly_vertex) * 4); |
| 797 | 797 | }; |
| r13798 | r13799 | |
| 847 | 847 | |
| 848 | 848 | extra->color = color; |
| 849 | 849 | |
| 850 | poly_render_triangle(poly, K001005_bitmap[K001005_bitmap_page], | |
| 850 | poly_render_triangle(poly, K001005_bitmap[K001005_bitmap_page], | |
| 851 | 851 | 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); | |
| 854 | 854 | |
| 855 | 855 | memcpy(prev_v, v, sizeof(poly_vertex) * 4); |
| 856 | 856 | |
| r13798 | r13799 | |
| 906 | 906 | |
| 907 | 907 | extra->color = color; |
| 908 | 908 | |
| 909 | poly_render_triangle(poly, K001005_bitmap[K001005_bitmap_page], | |
| 909 | poly_render_triangle(poly, K001005_bitmap[K001005_bitmap_page], | |
| 910 | 910 | 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); | |
| 913 | 913 | |
| 914 | 914 | memcpy(prev_v, v, sizeof(poly_vertex) * 4); |
| 915 | 915 | }; |
| r13798 | r13799 | |
| 934 | 934 | } |
| 935 | 935 | } |
| 936 | 936 | |
| 937 | void K001005_draw(bitmap_t *bitmap, const rectangle | |
| 937 | void K001005_draw(bitmap_t *bitmap, const rectangle &cliprect) | |
| 938 | 938 | { |
| 939 | 939 | int i, j; |
| 940 | 940 | |
| 941 | memcpy(&K001005_cliprect, cliprect, sizeof(rectangle)); | |
| 941 | memcpy(&K001005_cliprect, &cliprect, sizeof(rectangle)); | |
| 942 | 942 | |
| 943 | for (j=cliprect | |
| 943 | for (j=cliprect. | |
| 944 | 944 | { |
| 945 | 945 | UINT32 *bmp = &bitmap->pix32(j); |
| 946 | 946 | UINT32 *src = &K001005_bitmap[K001005_bitmap_page^1]->pix32(j); |
| 947 | 947 | |
| 948 | for (i=cliprect | |
| 948 | for (i=cliprect. | |
| 949 | 949 | { |
| 950 | 950 | if (src[i] & 0xff000000) |
| 951 | 951 | { |
| r13798 | r13799 | |
| 1051 | 1051 | |
| 1052 | 1052 | SCREEN_UPDATE( hangplt ) |
| 1053 | 1053 | { |
| 1054 | bitmap->fill(screen.machine().pens[0], | |
| 1054 | bitmap->fill(screen.machine().pens[0], | |
| 1055 | 1055 | |
| 1056 | 1056 | if (strcmp(screen.tag(), "lscreen") == 0) |
| 1057 | 1057 | { |
| r13798 | r13799 | |
|---|---|---|
| 188 | 188 | machine.save().register_postload(save_prepost_delegate(FUNC(set_current_bitmap_videoram_pointer), state)); |
| 189 | 189 | } |
| 190 | 190 | |
| 191 | static void draw_bitmap(running_machine &machine, bitmap_t *bitmap, const rectangle | |
| 191 | static void draw_bitmap(running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect) | |
| 192 | 192 | { |
| 193 | 193 | cloak_state *state = machine.driver_data<cloak_state>(); |
| 194 | 194 | int x, y; |
| 195 | 195 | |
| 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++) | |
| 198 | 198 | { |
| 199 | 199 | pen_t pen = state->m_current_bitmap_videoram_displayed[(y << 8) | x] & 0x07; |
| 200 | 200 | |
| r13798 | r13799 | |
| 203 | 203 | } |
| 204 | 204 | } |
| 205 | 205 | |
| 206 | static void draw_sprites(running_machine &machine, bitmap_t *bitmap, const rectangle | |
| 206 | static void draw_sprites(running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect) | |
| 207 | 207 | { |
| 208 | 208 | cloak_state *state = machine.driver_data<cloak_state>(); |
| 209 | 209 | UINT8 *spriteram = state->m_spriteram; |
| r13798 | r13799 | |
|---|---|---|
| 312 | 312 | |
| 313 | 313 | static void pdraw_tile(running_machine &machine, |
| 314 | 314 | bitmap_t *dest_bmp, |
| 315 | const rectangle | |
| 315 | const rectangle &clip, | |
| 316 | 316 | UINT32 code, |
| 317 | 317 | int color, |
| 318 | 318 | int sx, int sy, |
| r13798 | r13799 | |
| 364 | 364 | y_index = 0; |
| 365 | 365 | } |
| 366 | 366 | |
| 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; | |
| 392 | 372 | } |
| 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 | } | |
| 393 | 390 | |
| 394 | 391 | if( ex>sx ) |
| 395 | 392 | { /* skip if inner loop doesn't draw anything */ |
| r13798 | r13799 | |
| 456 | 453 | } |
| 457 | 454 | } /* pdraw_tile */ |
| 458 | 455 | |
| 459 | static void draw_sprites(running_machine &machine, bitmap_t *bitmap, const rectangle | |
| 456 | static void draw_sprites(running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect) | |
| 460 | 457 | { |
| 461 | 458 | namcona1_state *state = machine.driver_data<namcona1_state>(); |
| 462 | 459 | int which; |
| r13798 | r13799 | |
| 553 | 550 | } /* next x */ |
| 554 | 551 | } /* draw_pixel_line */ |
| 555 | 552 | |
| 556 | static void draw_background(running_machine &machine, bitmap_t *bitmap, const rectangle | |
| 553 | static void draw_background(running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect, int which, int primask ) | |
| 557 | 554 | { |
| 558 | 555 | namcona1_state *state = machine.driver_data<namcona1_state>(); |
| 559 | 556 | UINT16 *videoram = state->m_videoram; |
| r13798 | r13799 | |
| 576 | 573 | paldata = &machine.pens[pGfx->color_base + pGfx->color_granularity * state->m_tilemap_palette_bank[which]]; |
| 577 | 574 | |
| 578 | 575 | /* 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; | |
| 581 | 578 | scrollx = 0; |
| 582 | 579 | scrolly = 0; |
| 583 | 580 | for( line=0; line<256; line++ ) |
| r13798 | r13799 | |
| 597 | 594 | scrolly = (ydata - line)&0x1ff; |
| 598 | 595 | } |
| 599 | 596 | |
| 600 | if (line >= cliprect | |
| 597 | if (line >= cliprect. | |
| 601 | 598 | { |
| 602 | 599 | if( xdata == 0xc001 ) |
| 603 | 600 | { |
| r13798 | r13799 | |
| 624 | 621 | int dy = -8; /* vertical adjust */ |
| 625 | 622 | UINT32 startx = (xoffset<<12)+incxx*dx+incyx*dy; |
| 626 | 623 | UINT32 starty = (yoffset<<12)+incxy*dx+incyy*dy; |
| 627 | tilemap_draw_roz_primask(bitmap, | |
| 624 | tilemap_draw_roz_primask(bitmap, | |
| 628 | 625 | startx, starty, incxx, incxy, incyx, incyy, 0, 0, primask, 0); |
| 629 | 626 | } |
| 630 | 627 | else |
| 631 | 628 | { |
| 632 | 629 | tilemap_set_scrollx( state->m_bg_tilemap[which], 0, scrollx ); |
| 633 | 630 | tilemap_set_scrolly( state->m_bg_tilemap[which], 0, scrolly ); |
| 634 | tilemap_draw_primask( bitmap, | |
| 631 | tilemap_draw_primask( bitmap, | |
| 635 | 632 | } |
| 636 | 633 | } |
| 637 | 634 | } |
| r13798 | r13799 | |
| 677 | 674 | } |
| 678 | 675 | } |
| 679 | 676 | |
| 680 | screen.machine().priority_bitmap->fill(0, | |
| 677 | screen.machine().priority_bitmap->fill(0, | |
| 681 | 678 | |
| 682 | bitmap->fill(0xff, | |
| 679 | bitmap->fill(0xff, | |
| 683 | 680 | |
| 684 | 681 | for( priority = 0; priority<8; priority++ ) |
| 685 | 682 | { |
| r13798 | r13799 | |
|---|---|---|
| 1 | 1 | void gticlub_led_setreg(int offset, UINT8 data); |
| 2 | 2 | |
| 3 | void K001005_draw(bitmap_t *bitmap, const rectangle | |
| 3 | void K001005_draw(bitmap_t *bitmap, const rectangle &cliprect); | |
| 4 | 4 | void K001005_swap_buffers(running_machine &machine); |
| 5 | 5 | void K001005_init(running_machine &machine); |
| 6 | 6 | void K001005_preprocess_texture_data(UINT8 *rom, int length, int gticlub); |
| r13798 | r13799 | |
|---|---|---|
| 33 | 33 | state->m_bg_tilemap = tilemap_create(machine, get_bg_tile_info, tilemap_scan_rows, 8, 8, 32, 32); |
| 34 | 34 | } |
| 35 | 35 | |
| 36 | static void draw_sprites( running_machine &machine, bitmap_t *bitmap, const rectangle | |
| 36 | static void draw_sprites( running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect ) | |
| 37 | 37 | { |
| 38 | 38 | bsktball_state *state = machine.driver_data<bsktball_state>(); |
| 39 | 39 | int mot; |
| r13798 | r13799 | |
|---|---|---|
| 277 | 277 | ***************************************************************************/ |
| 278 | 278 | |
| 279 | 279 | /* custom code to handle color cycling effect, handled by m_spr_pal_clut */ |
| 280 | void armedf_drawgfx(running_machine &machine, bitmap_t *dest_bmp,const rectangle | |
| 280 | void armedf_drawgfx(running_machine &machine, bitmap_t *dest_bmp,const rectangle &clip,const gfx_element *gfx, | |
| 281 | 281 | UINT32 code,UINT32 color, UINT32 clut,int flipx,int flipy,int offsx,int offsy, |
| 282 | 282 | int transparent_color) |
| 283 | 283 | { |
| r13798 | r13799 | |
| 301 | 301 | ex = sx + gfx->width; |
| 302 | 302 | ey = sy + gfx->height; |
| 303 | 303 | |
| 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; | |
| 327 | 309 | } |
| 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 | } | |
| 328 | 325 | |
| 329 | 326 | if (ex > sx) |
| 330 | 327 | { /* skip if inner loop doesn't draw anything */ |
| r13798 | r13799 | |
| 351 | 348 | } |
| 352 | 349 | |
| 353 | 350 | |
| 354 | static void draw_sprites( running_machine &machine, bitmap_t *bitmap, const rectangle | |
| 351 | static void draw_sprites( running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect, int priority ) | |
| 355 | 352 | { |
| 356 | 353 | UINT16 *buffered_spriteram = machine.generic.buffered_spriteram.u16; |
| 357 | 354 | armedf_state *state = machine.driver_data<armedf_state>(); |
| r13798 | r13799 | |
| 411 | 408 | |
| 412 | 409 | } |
| 413 | 410 | |
| 414 | bitmap->fill(0xff, | |
| 411 | bitmap->fill(0xff, | |
| 415 | 412 | |
| 416 | 413 | tilemap_draw(bitmap, cliprect, state->m_tx_tilemap, TILEMAP_DRAW_CATEGORY(1), 0); |
| 417 | 414 |
| r13798 | r13799 | |
|---|---|---|
| 559 | 559 | |
| 560 | 560 | ***************************************************************************/ |
| 561 | 561 | |
| 562 | static void draw_sprites(running_machine &machine, bitmap_t *bitmap, const rectangle | |
| 562 | static void draw_sprites(running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect, UINT32 mask_bank, UINT32 shift_bits) | |
| 563 | 563 | { |
| 564 | 564 | dkong_state *state = machine.driver_data<dkong_state>(); |
| 565 | 565 | int offs; |
| r13798 | r13799 | |
| 607 | 607 | * |
| 608 | 608 | */ |
| 609 | 609 | |
| 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; | |
| 613 | 613 | |
| 614 | 614 | if (state->m_flip) |
| 615 | 615 | { |
| r13798 | r13799 | |
| 805 | 805 | |
| 806 | 806 | } |
| 807 | 807 | |
| 808 | static void radarscp_draw_background(running_machine &machine, dkong_state *state, bitmap_t *bitmap, const rectangle | |
| 808 | static void radarscp_draw_background(running_machine &machine, dkong_state *state, bitmap_t *bitmap, const rectangle &cliprect) | |
| 809 | 809 | { |
| 810 | 810 | const UINT8 *htable = NULL; |
| 811 | 811 | int x,y; |
| r13798 | r13799 | |
| 815 | 815 | if (state->m_hardware_type == HARDWARE_TRS01) |
| 816 | 816 | htable = state->m_gfx4; |
| 817 | 817 | |
| 818 | y = cliprect->min_y; | |
| 819 | while (y <= cliprect->max_y) | |
| 818 | y = cliprect.min_y; | |
| 819 | while (y <= cliprect.max_y) | |
| 820 | 820 | { |
| 821 | x = cliprect->min_x; | |
| 822 | while (x <= cliprect->max_x) | |
| 821 | x = cliprect.min_x; | |
| 822 | while (x <= cliprect.max_x) | |
| 823 | 823 | { |
| 824 | 824 | pixel = &bitmap->pix16(y, x); |
| 825 | 825 | draw_ok = !(*pixel & 0x01) && !(*pixel & 0x02); |
| r13798 | r13799 | |
|---|---|---|
| 118 | 118 | |
| 119 | 119 | rect &= screen.machine().primary_screen->visible_area(); |
| 120 | 120 | |
| 121 | tilemap_draw(state->m_helper, | |
| 121 | tilemap_draw(state->m_helper, | |
| 122 | 122 | |
| 123 | 123 | if (i & 1) |
| 124 | 124 | bank = 32; |
| 125 | 125 | |
| 126 | drawgfx_transpen(state->m_helper, | |
| 126 | drawgfx_transpen(state->m_helper, | |
| 127 | 127 | (code >> 3) | bank, |
| 128 | 128 | 4, |
| 129 | 129 | 0, 0, |
| r13798 | r13799 | |
|---|---|---|
| 207 | 207 | /* bit 7 unknown (used) */ |
| 208 | 208 | } |
| 209 | 209 | |
| 210 | static void appoooh_draw_sprites( bitmap_t *dest_bmp, const rectangle | |
| 210 | static void appoooh_draw_sprites( bitmap_t *dest_bmp, const rectangle &cliprect, const gfx_element *gfx, UINT8 *sprite ) | |
| 211 | 211 | { |
| 212 | 212 | int offs; |
| 213 | 213 | int flipy = flip_screen_get(gfx->machine()); |
| r13798 | r13799 | |
| 238 | 238 | } |
| 239 | 239 | } |
| 240 | 240 | |
| 241 | static void robowres_draw_sprites( bitmap_t *dest_bmp, const rectangle | |
| 241 | static void robowres_draw_sprites( bitmap_t *dest_bmp, const rectangle &cliprect, const gfx_element *gfx, UINT8 *sprite ) | |
| 242 | 242 | { |
| 243 | 243 | int offs; |
| 244 | 244 | int flipy = flip_screen_get(gfx->machine()); |
| r13798 | r13799 | |
|---|---|---|
| 16 | 16 | } |
| 17 | 17 | |
| 18 | 18 | |
| 19 | static void draw_text(running_machine &machine, bitmap_t* bitmap, const rectangle | |
| 19 | static void draw_text(running_machine &machine, bitmap_t* bitmap, const rectangle | |
| 20 | 20 | { |
| 21 | 21 | skyraid_state *state = machine.driver_data<skyraid_state>(); |
| 22 | 22 | const UINT8* p = state->m_alpha_num_ram; |
| r13798 | r13799 | |
| 36 | 36 | } |
| 37 | 37 | |
| 38 | 38 | |
| 39 | static void draw_terrain(running_machine &machine, bitmap_t* bitmap, const rectangle | |
| 39 | static void draw_terrain(running_machine &machine, bitmap_t* bitmap, const rectangle &cliprect) | |
| 40 | 40 | { |
| 41 | 41 | skyraid_state *state = machine.driver_data<skyraid_state>(); |
| 42 | 42 | const UINT8* p = machine.region("user1")->base(); |
| r13798 | r13799 | |
| 72 | 72 | } |
| 73 | 73 | |
| 74 | 74 | |
| 75 | static void draw_sprites(running_machine &machine, bitmap_t* bitmap, const rectangle | |
| 75 | static void draw_sprites(running_machine &machine, bitmap_t* bitmap, const rectangle | |
| 76 | 76 | { |
| 77 | 77 | skyraid_state *state = machine.driver_data<skyraid_state>(); |
| 78 | 78 | int i; |
| r13798 | r13799 | |
| 94 | 94 | } |
| 95 | 95 | |
| 96 | 96 | |
| 97 | static void draw_missiles(running_machine &machine, bitmap_t* bitmap, const rectangle | |
| 97 | static void draw_missiles(running_machine &machine, bitmap_t* bitmap, const rectangle | |
| 98 | 98 | { |
| 99 | 99 | skyraid_state *state = machine.driver_data<skyraid_state>(); |
| 100 | 100 | int i; |
| r13798 | r13799 | |
| 142 | 142 | { |
| 143 | 143 | skyraid_state *state = screen.machine().driver_data<skyraid_state>(); |
| 144 | 144 | |
| 145 | bitmap->fill(0, | |
| 145 | bitmap->fill(0, | |
| 146 | 146 | |
| 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); | |
| 150 | 150 | draw_trapezoid(screen.machine(), bitmap, state->m_helper); |
| 151 | 151 | draw_text(screen.machine(), bitmap, cliprect); |
| 152 | 152 | return 0; |
| r13798 | r13799 | |
|---|---|---|
| 293 | 293 | |
| 294 | 294 | ***************************************************************************/ |
| 295 | 295 | |
| 296 | static void draw_sprites(running_machine &machine, bitmap_t *bitmap,const rectangle | |
| 296 | static void draw_sprites(running_machine &machine, bitmap_t *bitmap,const rectangle &cliprect) | |
| 297 | 297 | { |
| 298 | 298 | travrusa_state *state = machine.driver_data<travrusa_state>(); |
| 299 | 299 | int offs; |
| 300 | 300 | const rectangle spritevisiblearea(1*8, 31*8-1, 0*8, 24*8-1); |
| 301 | 301 | const rectangle spritevisibleareaflip(1*8, 31*8-1, 8*8, 32*8-1); |
| 302 | rectangle clip = | |
| 302 | rectangle clip = | |
| 303 | 303 | if (flip_screen_get(machine)) |
| 304 | 304 | clip &= spritevisibleareaflip; |
| 305 | 305 | else |
| r13798 | r13799 | |
| 323 | 323 | flipy = !flipy; |
| 324 | 324 | } |
| 325 | 325 | |
| 326 | drawgfx_transpen(bitmap, | |
| 326 | drawgfx_transpen(bitmap, | |
| 327 | 327 | code, |
| 328 | 328 | attr & 0x0f, |
| 329 | 329 | flipx, flipy, |
| r13798 | r13799 | |
|---|---|---|
| 174 | 174 | |
| 175 | 175 | ***************************************************************************/ |
| 176 | 176 | |
| 177 | static void draw_sprites( running_machine &machine, bitmap_t *bitmap, const rectangle | |
| 177 | static void draw_sprites( running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect ) | |
| 178 | 178 | { |
| 179 | 179 | metlclsh_state *state = machine.driver_data<metlclsh_state>(); |
| 180 | 180 | UINT8 *spriteram = state->m_spriteram; |
| r13798 | r13799 | |
| 246 | 246 | { |
| 247 | 247 | metlclsh_state *state = screen.machine().driver_data<metlclsh_state>(); |
| 248 | 248 | |
| 249 | bitmap->fill(0x10, | |
| 249 | bitmap->fill(0x10, | |
| 250 | 250 | |
| 251 | 251 | tilemap_draw(bitmap, cliprect, state->m_fg_tilemap, 1, 0); // low priority tiles of foreground |
| 252 | 252 |
| r13798 | r13799 | |
|---|---|---|
| 81 | 81 | |
| 82 | 82 | k052109_tilemap_update(state->m_k052109); |
| 83 | 83 | |
| 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); | |
| 86 | 86 | |
| 87 | 87 | k052109_tilemap_draw(state->m_k052109, bitmap, cliprect, 1, 0, 1); |
| 88 | 88 | k052109_tilemap_draw(state->m_k052109, bitmap, cliprect, 2, 0, 2); |
| r13798 | r13799 | |
|---|---|---|
| 25 | 25 | UINT8 *videoram = state->m_videoram; |
| 26 | 26 | int x,y; |
| 27 | 27 | |
| 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) | |
| 30 | 30 | { |
| 31 | 31 | bitmap->pix16(y, x+1) = videoram[0x80*x+y] & 0x0f; |
| 32 | 32 | bitmap->pix16(y, x+0) = videoram[0x80*x+y] >> 4; |
| r13798 | r13799 | |
|---|---|---|
| 420 | 420 | } |
| 421 | 421 | |
| 422 | 422 | // custom function to draw a single sprite. needed to keep correct sprites - sprites and sprites - tilemaps priorities |
| 423 | static void kaneko16_draw_sprites_custom(bitmap_t *dest_bmp,const rectangle | |
| 423 | static void kaneko16_draw_sprites_custom(bitmap_t *dest_bmp,const rectangle &clip,const gfx_element *gfx, | |
| 424 | 424 | UINT32 code,UINT32 color,int flipx,int flipy,int sx,int sy, |
| 425 | 425 | int priority) |
| 426 | 426 | { |
| r13798 | r13799 | |
| 462 | 462 | y_index = 0; |
| 463 | 463 | } |
| 464 | 464 | |
| 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; | |
| 490 | 470 | } |
| 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 | } | |
| 491 | 488 | |
| 492 | 489 | if( ex>sx ) |
| 493 | 490 | { /* skip if inner loop doesn't draw anything */ |
| r13798 | r13799 | |
| 520 | 517 | |
| 521 | 518 | /* Build a list of sprites to display & draw them */ |
| 522 | 519 | |
| 523 | void kaneko16_draw_sprites(running_machine &machine, bitmap_t *bitmap, const rectangle | |
| 520 | void kaneko16_draw_sprites(running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect) | |
| 524 | 521 | { |
| 525 | 522 | kaneko16_state *state = machine.driver_data<kaneko16_state>(); |
| 526 | 523 | /* Sprites *must* be parsed from the first in RAM to the last, |
| r13798 | r13799 | |
| 855 | 852 | |
| 856 | 853 | ***************************************************************************/ |
| 857 | 854 | |
| 858 | static void kaneko16_prepare_first_tilemap_chip(running_machine &machine, bitmap_t *bitmap, const rectangle | |
| 855 | static void kaneko16_prepare_first_tilemap_chip(running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect) | |
| 859 | 856 | { |
| 860 | 857 | kaneko16_state *state = machine.driver_data<kaneko16_state>(); |
| 861 | 858 | /* Set Up FIRST Tilemap chip */ |
| r13798 | r13799 | |
| 896 | 893 | |
| 897 | 894 | } |
| 898 | 895 | |
| 899 | static void kaneko16_prepare_second_tilemap_chip(running_machine &machine, bitmap_t *bitmap, const rectangle | |
| 896 | static void kaneko16_prepare_second_tilemap_chip(running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect) | |
| 900 | 897 | { |
| 901 | 898 | kaneko16_state *state = machine.driver_data<kaneko16_state>(); |
| 902 | 899 | /* Set Up SECOND Tilemap chip */ |
| r13798 | r13799 | |
| 936 | 933 | } |
| 937 | 934 | } |
| 938 | 935 | |
| 939 | static void kaneko16_render_first_tilemap_chip(running_machine &machine, bitmap_t *bitmap, const rectangle | |
| 936 | static void kaneko16_render_first_tilemap_chip(running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect, int pri) | |
| 940 | 937 | { |
| 941 | 938 | kaneko16_state *state = machine.driver_data<kaneko16_state>(); |
| 942 | 939 | tilemap_draw_primask(bitmap,cliprect, state->m_tmap[0], pri, pri, 0); |
| 943 | 940 | tilemap_draw_primask(bitmap,cliprect, state->m_tmap[1], pri, pri, 0); |
| 944 | 941 | } |
| 945 | 942 | |
| 946 | static void kaneko16_render_second_tilemap_chip(running_machine &machine, bitmap_t *bitmap, const rectangle | |
| 943 | static void kaneko16_render_second_tilemap_chip(running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect, int pri) | |
| 947 | 944 | { |
| 948 | 945 | kaneko16_state *state = machine.driver_data<kaneko16_state>(); |
| 949 | 946 | if (state->m_tmap[2]) |
| r13798 | r13799 | |
| 953 | 950 | } |
| 954 | 951 | } |
| 955 | 952 | |
| 956 | static void kaneko16_render_sprites(running_machine &machine, bitmap_t *bitmap, const rectangle | |
| 953 | static void kaneko16_render_sprites(running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect) | |
| 957 | 954 | { |
| 958 | 955 | kaneko16_state *state = machine.driver_data<kaneko16_state>(); |
| 959 | 956 | /* Sprites last (rendered with pdrawgfx, so they can slip |
| r13798 | r13799 | |
| 967 | 964 | } |
| 968 | 965 | else |
| 969 | 966 | { |
| 970 | state->m_sprites_bitmap->fill(0, | |
| 967 | state->m_sprites_bitmap->fill(0, | |
| 971 | 968 | kaneko16_draw_sprites(machine,bitmap,cliprect); |
| 972 | 969 | } |
| 973 | 970 | } |
| 974 | 971 | |
| 975 | static void kaneko16_render_15bpp_bitmap(running_machine &machine, bitmap_t *bitmap, const rectangle | |
| 972 | static void kaneko16_render_15bpp_bitmap(running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect) | |
| 976 | 973 | { |
| 977 | 974 | kaneko16_state *state = machine.driver_data<kaneko16_state>(); |
| 978 | 975 | if (state->m_bg15_bitmap) |
| r13798 | r13799 | |
| 993 | 990 | } |
| 994 | 991 | } |
| 995 | 992 | |
| 996 | static void kaneko16_fill_bitmap(running_machine &machine, bitmap_t *bitmap, const rectangle | |
| 993 | static void kaneko16_fill_bitmap(running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect) | |
| 997 | 994 | { |
| 998 | 995 | kaneko16_state *state = machine.driver_data<kaneko16_state>(); |
| 999 | 996 | if(state->m_sprite_type == 1) |
| 1000 | bitmap->fill(0x7f00, | |
| 997 | bitmap->fill(0x7f00, | |
| 1001 | 998 | else |
| 1002 | 999 | /* Fill the bitmap with pen 0. This is wrong, but will work most of |
| 1003 | 1000 | the times. To do it right, each pixel should be drawn with pen 0 |
| 1004 | 1001 | of the bottomost tile that covers it (which is pretty tricky to do) */ |
| 1005 | bitmap->fill(0, | |
| 1002 | bitmap->fill(0, | |
| 1006 | 1003 | } |
| 1007 | 1004 | |
| 1008 | 1005 | static SCREEN_UPDATE( common ) |
| 1009 | 1006 | { |
| 1010 | 1007 | int i; |
| 1011 | 1008 | |
| 1012 | screen.machine().priority_bitmap->fill(0, | |
| 1009 | screen.machine().priority_bitmap->fill(0, | |
| 1013 | 1010 | |
| 1014 | 1011 | kaneko16_prepare_first_tilemap_chip(screen.machine(), bitmap, cliprect); |
| 1015 | 1012 | kaneko16_prepare_second_tilemap_chip(screen.machine(), bitmap, cliprect); |
| r13798 | r13799 | |
|---|---|---|
| 135 | 135 | |
| 136 | 136 | konami_sortlayers5(layer, state->m_layerpri); |
| 137 | 137 | |
| 138 | screen.machine().priority_bitmap->fill(0, | |
| 138 | screen.machine().priority_bitmap->fill(0, | |
| 139 | 139 | |
| 140 | 140 | for (plane = 0; plane < 5; plane++) |
| 141 | 141 | { |
| r13798 | r13799 | |
|---|---|---|
| 393 | 393 | goldstar_state *state = screen.machine().driver_data<goldstar_state>(); |
| 394 | 394 | int i; |
| 395 | 395 | |
| 396 | bitmap->fill(get_black_pen(screen.machine()), | |
| 396 | bitmap->fill(get_black_pen(screen.machine()), | |
| 397 | 397 | |
| 398 | 398 | if (!state->m_cm_enable_reg &0x01) |
| 399 | 399 | return 0; |
| r13798 | r13799 | |
| 413 | 413 | const rectangle visible2(0*8, (14+48)*8-1, 12*8, (12+7)*8-1); |
| 414 | 414 | const rectangle visible3(0*8, (14+48)*8-1, 20*8, (20+7)*8-1); |
| 415 | 415 | |
| 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); | |
| 419 | 419 | } |
| 420 | 420 | |
| 421 | 421 | if (state->m_cm_enable_reg &0x04) |
| r13798 | r13799 | |
| 444 | 444 | goldstar_state *state = screen.machine().driver_data<goldstar_state>(); |
| 445 | 445 | int i; |
| 446 | 446 | |
| 447 | bitmap->fill(get_black_pen(screen.machine()), | |
| 447 | bitmap->fill(get_black_pen(screen.machine()), | |
| 448 | 448 | |
| 449 | 449 | if (!state->m_cm_enable_reg &0x01) |
| 450 | 450 | return 0; |
| r13798 | r13799 | |
| 458 | 458 | |
| 459 | 459 | |
| 460 | 460 | const rectangle visible1(0*8, (14+48)*8-1, 3*8, (4+7)*8-1); |
| 461 | tilemap_draw(bitmap, | |
| 461 | tilemap_draw(bitmap, | |
| 462 | 462 | } |
| 463 | 463 | |
| 464 | 464 | if (state->m_cm_enable_reg &0x04) |
| r13798 | r13799 | |
| 487 | 487 | goldstar_state *state = screen.machine().driver_data<goldstar_state>(); |
| 488 | 488 | int i; |
| 489 | 489 | |
| 490 | bitmap->fill(get_black_pen(screen.machine()), | |
| 490 | bitmap->fill(get_black_pen(screen.machine()), | |
| 491 | 491 | |
| 492 | 492 | if (!state->m_cm_enable_reg &0x01) |
| 493 | 493 | return 0; |
| r13798 | r13799 | |
| 508 | 508 | const rectangle visible1alt(0*8, (16+48)*8-1, 4*8, 16*8-1); |
| 509 | 509 | const rectangle visible2alt(0*8, (16+48)*8-1, 16*8, 28*8-1); |
| 510 | 510 | |
| 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); | |
| 513 | 513 | //tilemap_draw(bitmap, &magical_visible3, state->m_reel3_tilemap, 0, 0); |
| 514 | 514 | } |
| 515 | 515 | else |
| r13798 | r13799 | |
| 526 | 526 | const rectangle visible2(0*8, (14+48)*8-1, 12*8, (12+8)*8-1); |
| 527 | 527 | const rectangle visible3(0*8, (14+48)*8-1, 20*8, (20+8)*8-1); |
| 528 | 528 | |
| 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); | |
| 532 | 532 | } |
| 533 | 533 | } |
| 534 | 534 | |
| r13798 | r13799 | |
| 546 | 546 | goldstar_state *state = screen.machine().driver_data<goldstar_state>(); |
| 547 | 547 | int i; |
| 548 | 548 | |
| 549 | bitmap->fill(get_black_pen(screen.machine()), | |
| 549 | bitmap->fill(get_black_pen(screen.machine()), | |
| 550 | 550 | |
| 551 | 551 | if (!state->m_cm_enable_reg &0x01) |
| 552 | 552 | return 0; |
| r13798 | r13799 | |
| 581 | 581 | const rectangle visible2(0*8, (14+48)*8-1, 10*8, (10+7)*8-1); |
| 582 | 582 | const rectangle visible3(0*8, (14+48)*8-1, 17*8, (17+7)*8-1); |
| 583 | 583 | |
| 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); | |
| 587 | 587 | } |
| 588 | 588 | } |
| 589 | 589 | |
| r13798 | r13799 | |
| 600 | 600 | goldstar_state *state = screen.machine().driver_data<goldstar_state>(); |
| 601 | 601 | int i; |
| 602 | 602 | |
| 603 | bitmap->fill(get_black_pen(screen.machine()), | |
| 603 | bitmap->fill(get_black_pen(screen.machine()), | |
| 604 | 604 | |
| 605 | 605 | if (!state->m_cm_enable_reg &0x01) |
| 606 | 606 | return 0; |
| r13798 | r13799 | |
| 618 | 618 | const rectangle visible2(0*8, (14+48)*8-1, 11*8, (12+7)*8-1); /* 4 pixels less for reel2 */ |
| 619 | 619 | const rectangle visible3(0*8, (14+48)*8-1, 19*8, (19+7)*8-1); /* 8 pixels less for reel3 */ |
| 620 | 620 | |
| 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); | |
| 624 | 624 | } |
| 625 | 625 | |
| 626 | 626 | if (state->m_cm_enable_reg &0x02) |
| r13798 | r13799 | |
| 636 | 636 | goldstar_state *state = screen.machine().driver_data<goldstar_state>(); |
| 637 | 637 | int i; |
| 638 | 638 | |
| 639 | bitmap->fill(get_black_pen(screen.machine()), | |
| 639 | bitmap->fill(get_black_pen(screen.machine()), | |
| 640 | 640 | |
| 641 | 641 | if (!state->m_cm_enable_reg &0x01) |
| 642 | 642 | return 0; |
| r13798 | r13799 | |
| 654 | 654 | const rectangle visible2(0*8, (14+48)*8-1, 10*8, (10+6)*8-1); |
| 655 | 655 | const rectangle visible3(0*8, (14+48)*8-1, 16*8, (16+6)*8-1); |
| 656 | 656 | |
| 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); | |
| 660 | 660 | } |
| 661 | 661 | |
| 662 | 662 | if (state->m_cm_enable_reg &0x04) |
| r13798 | r13799 | |
|---|---|---|
| 167 | 167 | { 15, 14, 13, 12, 11, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1, 0 } |
| 168 | 168 | }; |
| 169 | 169 | |
| 170 | static void draw_sprite_16x16(running_machine &machine, bitmap_t *bitmap, const rectangle | |
| 170 | static void draw_sprite_16x16(running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect, int code, | |
| 171 | 171 | int sx, int sy, int bank, int flags ) { |
| 172 | 172 | WC90_DRAW_SPRITE( code, sx, sy ); |
| 173 | 173 | } |
| 174 | 174 | |
| 175 | static void draw_sprite_16x32(running_machine &machine, bitmap_t *bitmap, const rectangle | |
| 175 | static void draw_sprite_16x32(running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect, int code, | |
| 176 | 176 | int sx, int sy, int bank, int flags ) { |
| 177 | 177 | if ( bank & 2 ) { |
| 178 | 178 | WC90_DRAW_SPRITE( code+1, sx, sy+16 ); |
| r13798 | r13799 | |
| 183 | 183 | } |
| 184 | 184 | } |
| 185 | 185 | |
| 186 | static void draw_sprite_16x64(running_machine &machine, bitmap_t *bitmap, const rectangle | |
| 186 | static void draw_sprite_16x64(running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect, int code, | |
| 187 | 187 | int sx, int sy, int bank, int flags ) { |
| 188 | 188 | if ( bank & 2 ) { |
| 189 | 189 | WC90_DRAW_SPRITE( code+3, sx, sy+48 ); |
| r13798 | r13799 | |
| 198 | 198 | } |
| 199 | 199 | } |
| 200 | 200 | |
| 201 | static void draw_sprite_32x16(running_machine &machine, bitmap_t *bitmap, const rectangle | |
| 201 | static void draw_sprite_32x16(running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect, int code, | |
| 202 | 202 | int sx, int sy, int bank, int flags ) { |
| 203 | 203 | if ( bank & 1 ) { |
| 204 | 204 | WC90_DRAW_SPRITE( code+1, sx+16, sy ); |
| r13798 | r13799 | |
| 209 | 209 | } |
| 210 | 210 | } |
| 211 | 211 | |
| 212 | static void draw_sprite_32x32(running_machine &machine, bitmap_t *bitmap, const rectangle | |
| 212 | static void draw_sprite_32x32(running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect, int code, | |
| 213 | 213 | int sx, int sy, int bank, int flags ) { |
| 214 | 214 | |
| 215 | 215 | const char *p = p32x32[ bank&3 ]; |
| r13798 | r13799 | |
| 220 | 220 | WC90_DRAW_SPRITE( code+p[3], sx+16, sy+16 ); |
| 221 | 221 | } |
| 222 | 222 | |
| 223 | static void draw_sprite_32x64(running_machine &machine, bitmap_t *bitmap, const rectangle | |
| 223 | static void draw_sprite_32x64(running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect, int code, | |
| 224 | 224 | int sx, int sy, int bank, int flags ) { |
| 225 | 225 | |
| 226 | 226 | const char *p = p32x64[ bank&3 ]; |
| r13798 | r13799 | |
| 235 | 235 | WC90_DRAW_SPRITE( code+p[7], sx+16, sy+48 ); |
| 236 | 236 | } |
| 237 | 237 | |
| 238 | static void draw_sprite_64x16(running_machine &machine, bitmap_t *bitmap, const rectangle | |
| 238 | static void draw_sprite_64x16(running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect, int code, | |
| 239 | 239 | int sx, int sy, int bank, int flags ) { |
| 240 | 240 | if ( bank & 1 ) { |
| 241 | 241 | WC90_DRAW_SPRITE( code+3, sx+48, sy ); |
| r13798 | r13799 | |
| 250 | 250 | } |
| 251 | 251 | } |
| 252 | 252 | |
| 253 | static void draw_sprite_64x32(running_machine &machine, bitmap_t *bitmap, const rectangle | |
| 253 | static void draw_sprite_64x32(running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect, int code, | |
| 254 | 254 | int sx, int sy, int bank, int flags ) { |
| 255 | 255 | |
| 256 | 256 | const char *p = p64x32[ bank&3 ]; |
| r13798 | r13799 | |
| 265 | 265 | WC90_DRAW_SPRITE( code+p[7], sx+48, sy+16 ); |
| 266 | 266 | } |
| 267 | 267 | |
| 268 | static void draw_sprite_64x64(running_machine &machine, bitmap_t *bitmap, const rectangle | |
| 268 | static void draw_sprite_64x64(running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect, int code, | |
| 269 | 269 | int sx, int sy, int bank, int flags ) { |
| 270 | 270 | |
| 271 | 271 | const char *p = p64x64[ bank&3 ]; |
| r13798 | r13799 | |
| 289 | 289 | WC90_DRAW_SPRITE( code+p[15], sx+48, sy+48 ); |
| 290 | 290 | } |
| 291 | 291 | |
| 292 | static void draw_sprite_invalid(running_machine &machine, bitmap_t *bitmap, const rectangle | |
| 292 | static void draw_sprite_invalid(running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect, int code, | |
| 293 | 293 | int sx, int sy, int bank, int flags ) { |
| 294 | 294 | logerror("8 pixel sprite size not supported\n" ); |
| 295 | 295 | } |
| 296 | 296 | |
| 297 | typedef void (*draw_sprites_func)(running_machine &, bitmap_t *, const rectangle | |
| 297 | typedef void (*draw_sprites_func)(running_machine &, bitmap_t *, const rectangle &, int, int, int, int, int ); | |
| 298 | 298 | |
| 299 | 299 | static const draw_sprites_func draw_sprites_proc[16] = { |
| 300 | 300 | draw_sprite_invalid, /* 0000 = 08x08 */ |
| r13798 | r13799 | |
| 315 | 315 | draw_sprite_64x64 /* 1111 = 64x64 */ |
| 316 | 316 | }; |
| 317 | 317 | |
| 318 | static void draw_sprites(running_machine &machine, bitmap_t *bitmap, const rectangle | |
| 318 | static void draw_sprites(running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect, int priority ) | |
| 319 | 319 | { |
| 320 | 320 | wc90_state *state = machine.driver_data<wc90_state>(); |
| 321 | 321 | UINT8 *spriteram = state->m_spriteram; |
| r13798 | r13799 | |
|---|---|---|
| 205 | 205 | |
| 206 | 206 | |
| 207 | 207 | /* SPRITES based on tetrisp2 for now, readd priority bits later */ |
| 208 | static void draw_sprites(running_machine &machine, bitmap_t *bitmap, bitmap_t *bitmap_pri, const rectangle | |
| 208 | static 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) | |
| 209 | 209 | { |
| 210 | 210 | int tx, ty, sx, sy, flipx, flipy; |
| 211 | 211 | int xsize, ysize; |
| r13798 | r13799 | |
| 275 | 275 | } |
| 276 | 276 | |
| 277 | 277 | |
| 278 | static void draw_roz(running_machine &machine, bitmap_t *bitmap, const rectangle | |
| 278 | static void draw_roz(running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect,int priority) | |
| 279 | 279 | { |
| 280 | 280 | ms32_state *state = machine.driver_data<ms32_state>(); |
| 281 | 281 | /* TODO: registers 0x40/4 / 0x44/4 and 0x50/4 / 0x54/4 are used, meaning unknown */ |
| r13798 | r13799 | |
| 285 | 285 | rectangle my_clip; |
| 286 | 286 | int y,maxy; |
| 287 | 287 | |
| 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; | |
| 290 | 290 | |
| 291 | y = cliprect->min_y; | |
| 292 | maxy = cliprect->max_y; | |
| 291 | y = cliprect.min_y; | |
| 292 | maxy = cliprect.max_y; | |
| 293 | 293 | |
| 294 | 294 | while (y <= maxy) |
| 295 | 295 | { |
| r13798 | r13799 | |
| 317 | 317 | if (incxx & 0x10000) incxx |= ~0x1ffff; |
| 318 | 318 | if (incxy & 0x10000) incxy |= ~0x1ffff; |
| 319 | 319 | |
| 320 | tilemap_draw_roz(bitmap, | |
| 320 | tilemap_draw_roz(bitmap, | |
| 321 | 321 | (start2x+startx+offsx)<<16, (start2y+starty+offsy)<<16, |
| 322 | 322 | incxx<<8, incxy<<8, 0, 0, |
| 323 | 323 | 1, // Wrap |
| r13798 | r13799 | |
| 392 | 392 | tilemap_set_scrolly(state->m_bg_tilemap_alt, 0, scrolly); |
| 393 | 393 | |
| 394 | 394 | |
| 395 | screen.machine().priority_bitmap->fill(0, | |
| 395 | screen.machine().priority_bitmap->fill(0, | |
| 396 | 396 | |
| 397 | 397 | |
| 398 | 398 | |
| 399 | 399 | /* TODO: 0 is correct for gametngk, but break f1superb scrolling grid (text at |
| 400 | 400 | top and bottom of the screen becomes black on black) */ |
| 401 | state->m_temp_bitmap_tilemaps->fill(0, | |
| 401 | state->m_temp_bitmap_tilemaps->fill(0, | |
| 402 | 402 | |
| 403 | 403 | /* 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); | |
| 406 | 406 | |
| 407 | 407 | 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); |
| 408 | 408 | |
| r13798 | r13799 | |
| 485 | 485 | |
| 486 | 486 | UINT32* dstptr_bitmap; |
| 487 | 487 | |
| 488 | bitmap->fill(0, | |
| 488 | bitmap->fill(0, | |
| 489 | 489 | |
| 490 | 490 | for (yy=0;yy<height;yy++) |
| 491 | 491 | { |
| r13798 | r13799 | |
|---|---|---|
| 64 | 64 | darkseal_state *state = screen.machine().driver_data<darkseal_state>(); |
| 65 | 65 | tilemap_set_flip_all(screen.machine(),state->m_flipscreen ? (TILEMAP_FLIPY | TILEMAP_FLIPX) : 0); |
| 66 | 66 | |
| 67 | bitmap->fill(get_black_pen(screen.machine()), | |
| 67 | bitmap->fill(get_black_pen(screen.machine()), | |
| 68 | 68 | |
| 69 | 69 | deco16ic_pf_update(state->m_deco_tilegen1, state->m_pf1_rowscroll, state->m_pf1_rowscroll); |
| 70 | 70 | deco16ic_pf_update(state->m_deco_tilegen2, state->m_pf3_rowscroll, state->m_pf3_rowscroll); |
| r13798 | r13799 | |
|---|---|---|
| 73 | 73 | } |
| 74 | 74 | |
| 75 | 75 | |
| 76 | static void do_pen_lookup(running_machine &machine, const _20pacgal_state *state, bitmap_t *bitmap, const rectangle | |
| 76 | static void do_pen_lookup(running_machine &machine, const _20pacgal_state *state, bitmap_t *bitmap, const rectangle &cliprect) | |
| 77 | 77 | { |
| 78 | 78 | int y, x; |
| 79 | 79 | pen_t pens[NUM_PENS + NUM_STAR_PENS]; |
| 80 | 80 | |
| 81 | 81 | get_pens(machine, state, pens); |
| 82 | 82 | |
| 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++) | |
| 85 | 85 | bitmap->pix32(y, x) = pens[bitmap->pix32(y, x)]; |
| 86 | 86 | } |
| 87 | 87 | |
| r13798 | r13799 | |
| 349 | 349 | * |
| 350 | 350 | */ |
| 351 | 351 | |
| 352 | static void draw_stars(_20pacgal_state *state, bitmap_t *bitmap, const rectangle | |
| 352 | static void draw_stars(_20pacgal_state *state, bitmap_t *bitmap, const rectangle &cliprect ) | |
| 353 | 353 | { |
| 354 | 354 | if ( (state->m_stars_ctrl[0] >> 5) & 1 ) |
| 355 | 355 | { |
| r13798 | r13799 | |
| 391 | 391 | |
| 392 | 392 | if (((lfsr & 0xffc0) == star_seta) || ((lfsr & 0xffc0) == star_setb)) |
| 393 | 393 | { |
| 394 | if (y >= cliprect | |
| 394 | if (y >= cliprect. | |
| 395 | 395 | bitmap->pix32(y, x) = NUM_PENS + (lfsr & 0x3f); |
| 396 | 396 | cnt++; |
| 397 | 397 | } |
| r13798 | r13799 | |
| 410 | 410 | { |
| 411 | 411 | _20pacgal_state *state = screen.machine().driver_data<_20pacgal_state>(); |
| 412 | 412 | |
| 413 | bitmap->fill(0, | |
| 413 | bitmap->fill(0, | |
| 414 | 414 | draw_stars(state, bitmap,cliprect); |
| 415 | 415 | draw_chars(state, bitmap); |
| 416 | 416 | draw_sprites(screen.machine(),state, bitmap); |
| r13798 | r13799 | |
|---|---|---|
| 97 | 97 | tilemap_set_scroll_cols(state->m_bg_tilemap, 32); |
| 98 | 98 | } |
| 99 | 99 | |
| 100 | static void draw_sprites(running_machine &machine, bitmap_t *bitmap, const rectangle | |
| 100 | static void draw_sprites(running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect ) | |
| 101 | 101 | { |
| 102 | 102 | seicross_state *state = machine.driver_data<seicross_state>(); |
| 103 | 103 | UINT8 *spriteram = state->m_spriteram; |
| r13798 | r13799 | |
|---|---|---|
| 7 | 7 | |
| 8 | 8 | static void blendbitmaps(running_machine &machine, |
| 9 | 9 | bitmap_t *dest,bitmap_t *src1,bitmap_t *src2, |
| 10 | const rectangle | |
| 10 | const rectangle &cliprect) | |
| 11 | 11 | { |
| 12 | 12 | int y,x; |
| 13 | 13 | const pen_t *paldata = machine.pens; |
| 14 | 14 | |
| 15 | for (y = cliprect | |
| 15 | for (y = cliprect. | |
| 16 | 16 | { |
| 17 | 17 | UINT32 *dd = &dest->pix32(y); |
| 18 | 18 | UINT16 *sd1 = &src1->pix16(y); |
| 19 | 19 | UINT16 *sd2 = &src2->pix16(y); |
| 20 | 20 | |
| 21 | for (x = cliprect | |
| 21 | for (x = cliprect. | |
| 22 | 22 | { |
| 23 | 23 | if (sd2[x]) |
| 24 | 24 | { |
| r13798 | r13799 | |
| 35 | 35 | |
| 36 | 36 | |
| 37 | 37 | /* from gals pinball (which was in turn from ninja gaiden) */ |
| 38 | static int draw_sprites(running_machine &machine, bitmap_t *bitmap, const rectangle | |
| 38 | static int draw_sprites(running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect, int priority) | |
| 39 | 39 | { |
| 40 | 40 | static const UINT8 layout[8][8] = |
| 41 | 41 | { |
| r13798 | r13799 | |
| 123 | 123 | spbactn_state *state = screen.machine().driver_data<spbactn_state>(); |
| 124 | 124 | int offs, sx, sy; |
| 125 | 125 | |
| 126 | state->m_tile_bitmap_fg->fill(0, | |
| 126 | state->m_tile_bitmap_fg->fill(0, | |
| 127 | 127 | |
| 128 | 128 | /* draw table bg gfx */ |
| 129 | 129 | for (sx = sy = offs = 0; offs < 0x4000 / 2; offs++) |
| r13798 | r13799 | |
|---|---|---|
| 641 | 641 | int offset_bg0x = 187; |
| 642 | 642 | int offset_bg0y = 0; |
| 643 | 643 | |
| 644 | bitmap->fill(get_black_pen(screen.machine()), | |
| 644 | bitmap->fill(get_black_pen(screen.machine()), | |
| 645 | 645 | |
| 646 | 646 | // I can't bring myself to care about dirty tile marking on something which runs at a bazillion % speed anyway, clean code is better |
| 647 | 647 | tilemap_mark_all_tiles_dirty(state->m_bg_tilemaps[0]); |
| r13798 | r13799 | |
| 699 | 699 | int offset_bg0x = 5; |
| 700 | 700 | int offset_bg0y = 32; |
| 701 | 701 | |
| 702 | bitmap->fill(get_black_pen(screen.machine()), | |
| 702 | bitmap->fill(get_black_pen(screen.machine()), | |
| 703 | 703 | |
| 704 | 704 | // I can't bring myself to care about dirty tile marking on something which runs at a bazillion % speed anyway, clean code is better |
| 705 | 705 | tilemap_mark_all_tiles_dirty(state->m_bg_tilemaps[0]); |
| r13798 | r13799 | |
| 736 | 736 | |
| 737 | 737 | if (!state->m_refreshenable) |
| 738 | 738 | { |
| 739 | bitmap->fill(0, | |
| 739 | bitmap->fill(0, | |
| 740 | 740 | return 0; |
| 741 | 741 | } |
| 742 | 742 | |
| 743 | 743 | update_page(screen.machine()); |
| 744 | 744 | |
| 745 | screen.machine().priority_bitmap->fill(0, | |
| 745 | screen.machine().priority_bitmap->fill(0, | |
| 746 | 746 | |
| 747 | 747 | tilemap_set_scrollx(state->m_background, 0, -320 - state->m_bg_scrollx); |
| 748 | 748 | tilemap_set_scrolly(state->m_background, 0, -256 + state->m_bg_scrolly + state->m_back_yscroll); |
| r13798 | r13799 | |
| 782 | 782 | |
| 783 | 783 | if (!state->m_refreshenable) |
| 784 | 784 | { |
| 785 | bitmap->fill(get_black_pen(screen.machine()), | |
| 785 | bitmap->fill(get_black_pen(screen.machine()), | |
| 786 | 786 | return 0; |
| 787 | 787 | } |
| 788 | 788 | |
| r13798 | r13799 | |
| 790 | 790 | |
| 791 | 791 | screen.machine().priority_bitmap->fill(0); |
| 792 | 792 | |
| 793 | bitmap->fill(0, | |
| 793 | bitmap->fill(0, | |
| 794 | 794 | |
| 795 | 795 | tilemap_draw(bitmap, cliprect, state->m_background, TILEMAP_DRAW_OPAQUE, 0); |
| 796 | 796 | tilemap_draw(bitmap, cliprect, state->m_background, TILEMAP_DRAW_OPAQUE | 1, 0); //?? |
| r13798 | r13799 | |
|---|---|---|
| 142 | 142 | STATIC FUNCTION DECLARATIONS |
| 143 | 143 | ***************************************************************************/ |
| 144 | 144 | |
| 145 | static int mo_render_object(atarimo_data *mo, const atarimo_entry *entry, const rectangle | |
| 145 | static int mo_render_object(atarimo_data *mo, const atarimo_entry *entry, const rectangle &cliprect); | |
| 146 | 146 | |
| 147 | 147 | |
| 148 | 148 | |
| r13798 | r13799 | |
| 550 | 550 | cliprect. |
| 551 | 551 | ---------------------------------------------------------------*/ |
| 552 | 552 | |
| 553 | static void erase_dirty_grid(atarimo_data *mo, const rectangle | |
| 553 | static void erase_dirty_grid(atarimo_data *mo, const rectangle &cliprect) | |
| 554 | 554 | { |
| 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; | |
| 559 | 559 | int y; |
| 560 | 560 | |
| 561 | 561 | /* loop over all grid rows that intersect our cliprect */ |
| 562 | 562 | for (y = sy; y <= ey; y++) |
| 563 | 563 | { |
| 564 | 564 | /* get the base pointer and memset the row */ |
| 565 | UINT8 *dirtybase = get_dirty_base(mo, cliprect | |
| 565 | UINT8 *dirtybase = get_dirty_base(mo, cliprect. | |
| 566 | 566 | memset(dirtybase, 0, ex - sx + 1); |
| 567 | 567 | } |
| 568 | 568 | } |
| r13798 | r13799 | |
| 573 | 573 | series of cliprects. |
| 574 | 574 | ---------------------------------------------------------------*/ |
| 575 | 575 | |
| 576 | static void convert_dirty_grid_to_rects(atarimo_data *mo, const rectangle | |
| 576 | static void convert_dirty_grid_to_rects(atarimo_data *mo, const rectangle &cliprect, atarimo_rect_list *rectlist) | |
| 577 | 577 | { |
| 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; | |
| 582 | 582 | int tilewidth = 1 << mo->tilexshift; |
| 583 | 583 | int tileheight = 1 << mo->tileyshift; |
| 584 | 584 | rectangle *rect; |
| r13798 | r13799 | |
| 592 | 592 | /* loop over all grid rows that intersect our cliprect */ |
| 593 | 593 | for (y = sy; y <= ey; y++) |
| 594 | 594 | { |
| 595 | UINT8 *dirtybase = get_dirty_base(mo, cliprect | |
| 595 | UINT8 *dirtybase = get_dirty_base(mo, cliprect. | |
| 596 | 596 | int can_add_to_existing = 0; |
| 597 | 597 | |
| 598 | 598 | /* loop over all grid columns that intersect our cliprect */ |
| r13798 | r13799 | |
| 636 | 636 | destination bitmap. |
| 637 | 637 | ---------------------------------------------------------------*/ |
| 638 | 638 | |
| 639 | bitmap_t *atarimo_render(int map, const rectangle | |
| 639 | bitmap_t *atarimo_render(int map, const rectangle &cliprect, atarimo_rect_list *rectlist) | |
| 640 | 640 | { |
| 641 | 641 | atarimo_data *mo = atarimo[map]; |
| 642 | 642 | int startband, stopband, band, i; |
| r13798 | r13799 | |
| 651 | 651 | } |
| 652 | 652 | |
| 653 | 653 | /* 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; | |
| 656 | 656 | if (startband > stopband) |
| 657 | 657 | startband -= mo->bitmapheight >> mo->slipshift; |
| 658 | 658 | if (!mo->slipshift) |
| r13798 | r13799 | |
| 672 | 672 | if (!mo->slipshift) |
| 673 | 673 | { |
| 674 | 674 | link = 0; |
| 675 | bandclip = | |
| 675 | bandclip = | |
| 676 | 676 | } |
| 677 | 677 | |
| 678 | 678 | /* otherwise, grab the SLIP and compute the bandrect */ |
| r13798 | r13799 | |
| 682 | 682 | link = (mo->slip_ram[slipentry] >> mo->linkmask.shift) & mo->linkmask.mask; |
| 683 | 683 | |
| 684 | 684 | /* start with the cliprect */ |
| 685 | bandclip = | |
| 685 | bandclip = | |
| 686 | 686 | |
| 687 | 687 | /* compute minimum Y and wrap around if necessary */ |
| 688 | 688 | bandclip.min_y = ((band << mo->slipshift) - mo->yscroll + mo->slipoffset) & mo->bitmapymask; |
| r13798 | r13799 | |
| 693 | 693 | bandclip.max_y = bandclip.min_y + (1 << mo->slipshift) - 1; |
| 694 | 694 | |
| 695 | 695 | /* keep within the cliprect */ |
| 696 | bandclip &= | |
| 696 | bandclip &= | |
| 697 | 697 | } |
| 698 | 698 | |
| 699 | 699 | /* if this matches the last link, we don't need to re-process the list */ |
| r13798 | r13799 | |
| 718 | 718 | |
| 719 | 719 | /* render the mos */ |
| 720 | 720 | for (current = first; current != last; current += step) |
| 721 | mo_render_object(mo, *current, | |
| 721 | mo_render_object(mo, *current, | |
| 722 | 722 | } |
| 723 | 723 | |
| 724 | 724 | /* convert the dirty grid to a rectlist */ |
| r13798 | r13799 | |
| 726 | 726 | |
| 727 | 727 | /* clip the rectlist */ |
| 728 | 728 | for (i = 0, rect = rectlist->rect; i < rectlist->numrects; i++, rect++) |
| 729 | *rect &= | |
| 729 | *rect &= | |
| 730 | 730 | |
| 731 | 731 | /* return the bitmap */ |
| 732 | 732 | return mo->bitmap; |
| r13798 | r13799 | |
| 739 | 739 | to the destination. |
| 740 | 740 | ---------------------------------------------------------------*/ |
| 741 | 741 | |
| 742 | static int mo_render_object(atarimo_data *mo, const atarimo_entry *entry, const rectangle | |
| 742 | static int mo_render_object(atarimo_data *mo, const atarimo_entry *entry, const rectangle &cliprect) | |
| 743 | 743 | { |
| 744 | 744 | int gfxindex = mo->gfxlookup[EXTRACT_DATA(entry, mo->gfxmask)]; |
| 745 | 745 | const gfx_element *gfx = mo->gfxelement[gfxindex]; |
| r13798 | r13799 | |
| 838 | 838 | for (y = 0, sy = ypos; y < height; y++, sy += yadv) |
| 839 | 839 | { |
| 840 | 840 | /* clip the Y coordinate */ |
| 841 | if (sy <= cliprect | |
| 841 | if (sy <= cliprect. | |
| 842 | 842 | { |
| 843 | 843 | code += width; |
| 844 | 844 | continue; |
| 845 | 845 | } |
| 846 | else if (sy > cliprect | |
| 846 | else if (sy > cliprect. | |
| 847 | 847 | break; |
| 848 | 848 | |
| 849 | 849 | /* loop over the width */ |
| 850 | 850 | for (x = 0, sx = xpos; x < width; x++, sx += xadv, code++) |
| 851 | 851 | { |
| 852 | 852 | /* clip the X coordinate */ |
| 853 | if (sx <= -cliprect | |
| 853 | if (sx <= -cliprect. | |
| 854 | 854 | continue; |
| 855 | 855 | |
| 856 | 856 | /* draw the sprite */ |
| r13798 | r13799 | |
| 874 | 874 | for (x = 0, sx = xpos; x < width; x++, sx += xadv) |
| 875 | 875 | { |
| 876 | 876 | /* clip the X coordinate */ |
| 877 | if (sx <= cliprect | |
| 877 | if (sx <= cliprect. | |
| 878 | 878 | { |
| 879 | 879 | code += height; |
| 880 | 880 | continue; |
| 881 | 881 | } |
| 882 | else if (sx > cliprect | |
| 882 | else if (sx > cliprect. | |
| 883 | 883 | break; |
| 884 | 884 | |
| 885 | 885 | /* loop over the height */ |
| r13798 | r13799 | |
| 887 | 887 | for (y = 0, sy = ypos; y < height; y++, sy += yadv, code++) |
| 888 | 888 | { |
| 889 | 889 | /* clip the X coordinate */ |
| 890 | if (sy <= -cliprect | |
| 890 | if (sy <= -cliprect. | |
| 891 | 891 | continue; |
| 892 | 892 | |
| 893 | 893 | /* draw the sprite */ |
| r13798 | r13799 | |
|---|---|---|
| 214 | 214 | * c | ---------------- | zoomy like in System 16? |
| 215 | 215 | * e | ---------------- | |
| 216 | 216 | */ |
| 217 | static void draw_sprites( running_machine &machine, bitmap_t *bitmap, const rectangle | |
| 217 | static void draw_sprites( running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect ) | |
| 218 | 218 | { |
| 219 | 219 | deniam_state *state = machine.driver_data<deniam_state>(); |
| 220 | 220 | int offs; |
| r13798 | r13799 | |
| 269 | 269 | { |
| 270 | 270 | if (rom[i] & 0x0f) |
| 271 | 271 | { |
| 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) | |
| 274 | 274 | { |
| 275 | 275 | if ((machine.priority_bitmap->pix8(y, sx + x) & primask) == 0) |
| 276 | 276 | bitmap->pix16(y, sx + x) = color * 16 + (rom[i] & 0x0f); |
| r13798 | r13799 | |
| 289 | 289 | { |
| 290 | 290 | if (rom[i] & 0xf0) |
| 291 | 291 | { |
| 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) | |
| 294 | 294 | { |
| 295 | 295 | if ((machine.priority_bitmap->pix8(y, sx + x) & primask) == 0) |
| 296 | 296 | bitmap->pix16(y, sx + x) = color * 16+(rom[i] >> 4); |
| r13798 | r13799 | |
| 313 | 313 | { |
| 314 | 314 | if (rom[i] & 0xf0) |
| 315 | 315 | { |
| 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) | |
| 318 | 318 | { |
| 319 | 319 | if ((machine.priority_bitmap->pix8(y, sx + x) & primask) == 0) |
| 320 | 320 | bitmap->pix16(y, sx + x) = color * 16 + (rom[i] >> 4); |
| r13798 | r13799 | |
| 333 | 333 | { |
| 334 | 334 | if (rom[i] & 0x0f) |
| 335 | 335 | { |
| 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) | |
| 338 | 338 | { |
| 339 | 339 | if ((machine.priority_bitmap->pix8(y, sx + x) & primask) == 0) |
| 340 | 340 | bitmap->pix16(y, sx + x) = color * 16 + (rom[i] & 0x0f); |
| r13798 | r13799 | |
| 407 | 407 | tilemap_set_scrollx(state->m_fg_tilemap, 0, fg_scrollx & 0x1ff); |
| 408 | 408 | tilemap_set_scrolly(state->m_fg_tilemap, 0, fg_scrolly & 0x0ff); |
| 409 | 409 | |
| 410 | screen.machine().priority_bitmap->fill(0, | |
| 410 | screen.machine().priority_bitmap->fill(0, | |
| 411 | 411 | |
| 412 | 412 | tilemap_draw(bitmap, cliprect, state->m_bg_tilemap, 0, 1); |
| 413 | 413 | tilemap_draw(bitmap, cliprect, state->m_fg_tilemap, 0, 2); |
| r13798 | r13799 | |
|---|---|---|
| 32 | 32 | ***************************************************************************/ |
| 33 | 33 | |
| 34 | 34 | /* callback for special processing */ |
| 35 | typedef int (*atarimo_special_func)(bitmap_t *bitmap, const rectangle | |
| 35 | typedef int (*atarimo_special_func)(bitmap_t *bitmap, const rectangle &clip, int code, int color, int xpos, int ypos, rectangle *mobounds); | |
| 36 | 36 | |
| 37 | 37 | /* description for a four-word mask */ |
| 38 | 38 | typedef struct _atarimo_entry atarimo_entry; |
| r13798 | r13799 | |
| 100 | 100 | UINT8 *atarimo_get_gfx_lookup(int map, int *size); |
| 101 | 101 | |
| 102 | 102 | /* core processing */ |
| 103 | bitmap_t *atarimo_render(int map, const rectangle | |
| 103 | bitmap_t *atarimo_render(int map, const rectangle &cliprect, atarimo_rect_list *rectlist); | |
| 104 | 104 | |
| 105 | 105 | /* atrribute setters */ |
| 106 | 106 | void atarimo_set_bank(int map, int bank); |
| r13798 | r13799 | |
|---|---|---|
| 205 | 205 | * |
| 206 | 206 | *************************************/ |
| 207 | 207 | |
| 208 | static void mcr3_update_sprites(running_machine &machine, bitmap_t *bitmap, const rectangle | |
| 208 | static void mcr3_update_sprites(running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect, int color_mask, int code_xor, int dx, int dy) | |
| 209 | 209 | { |
| 210 | 210 | mcr3_state *state = machine.driver_data<mcr3_state>(); |
| 211 | 211 | UINT8 *spriteram = state->m_spriteram; |
| 212 | 212 | int offs; |
| 213 | 213 | |
| 214 | machine.priority_bitmap->fill(1, | |
| 214 | machine.priority_bitmap->fill(1, | |
| 215 | 215 | |
| 216 | 216 | /* loop over sprite RAM */ |
| 217 | 217 | for (offs = state->m_spriteram_size - 4; offs >= 0; offs -= 4) |
| r13798 | r13799 | |
|---|---|---|
| 128 | 128 | |
| 129 | 129 | 3 xxxx............ color+priority, other bits unknown |
| 130 | 130 | */ |
| 131 | static void draw_sprites(running_machine &machine, bitmap_t *bitmap, const rectangle | |
| 131 | static void draw_sprites(running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect, int foreground ) | |
| 132 | 132 | { |
| 133 | 133 | prehisle_state *state = machine.driver_data<prehisle_state>(); |
| 134 | 134 | UINT16 *spriteram16 = state->m_spriteram; |
| r13798 | r13799 | |
|---|---|---|
| 144 | 144 | |
| 145 | 145 | konami_sortlayers3(layer, state->m_layerpri); |
| 146 | 146 | |
| 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); | |
| 149 | 149 | k052109_tilemap_draw(state->m_k052109, bitmap, cliprect, layer[0], 0, 1); |
| 150 | 150 | k052109_tilemap_draw(state->m_k052109, bitmap, cliprect, layer[1], 0, 2); |
| 151 | 151 | k052109_tilemap_draw(state->m_k052109, bitmap, cliprect, layer[2], 0, 4); |
| r13798 | r13799 | |
|---|---|---|
| 111 | 111 | sprite colour marking could probably be improved.. |
| 112 | 112 | *******************************************************************************/ |
| 113 | 113 | |
| 114 | static void draw_sprites(running_machine &machine, bitmap_t *bitmap, const rectangle | |
| 114 | static void draw_sprites(running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect ) | |
| 115 | 115 | { |
| 116 | 116 | /*- SPR RAM Format -** |
| 117 | 117 |
| r13798 | r13799 | |
|---|---|---|
| 490 | 490 | } |
| 491 | 491 | } |
| 492 | 492 | |
| 493 | static void draw_sprites(running_machine &machine, bitmap_t *bitmap, const rectangle | |
| 493 | static void draw_sprites(running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect ) | |
| 494 | 494 | { |
| 495 | 495 | polepos_state *state = machine.driver_data<polepos_state>(); |
| 496 | 496 | UINT16 *posmem = &state->m_sprite16_memory[0x380]; |
| r13798 | r13799 | |
| 523 | 523 | SCREEN_UPDATE( polepos ) |
| 524 | 524 | { |
| 525 | 525 | polepos_state *state = screen.machine().driver_data<polepos_state>(); |
| 526 | rectangle clip = | |
| 526 | rectangle clip = | |
| 527 | 527 | clip.max_y = 127; |
| 528 | tilemap_draw(bitmap, | |
| 528 | tilemap_draw(bitmap, | |
| 529 | 529 | draw_road(screen.machine(), bitmap); |
| 530 | 530 | draw_sprites(screen.machine(), bitmap,cliprect); |
| 531 | 531 | tilemap_draw(bitmap,cliprect,state->m_tx_tilemap,0,0); |
| r13798 | r13799 | |
|---|---|---|
| 433 | 433 | } |
| 434 | 434 | |
| 435 | 435 | |
| 436 | static void draw_quads(model1_state *state, bitmap_t *bitmap, const rectangle | |
| 436 | static void draw_quads(model1_state *state, bitmap_t *bitmap, const rectangle &cliprect) | |
| 437 | 437 | { |
| 438 | 438 | struct view *view = state->m_view; |
| 439 | 439 | int count = state->m_quadpt - state->m_quaddb; |
| r13798 | r13799 | |
| 444 | 444 | int save_x2 = view->x2; |
| 445 | 445 | int save_y1 = view->y1; |
| 446 | 446 | 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); | |
| 451 | 451 | |
| 452 | 452 | for(i=0; i<count; i++) { |
| 453 | 453 | struct quad_m1 *q = state->m_quadind[i]; |
| r13798 | r13799 | |
| 1119 | 1119 | return list+2; |
| 1120 | 1120 | } |
| 1121 | 1121 | |
| 1122 | static void draw_objects(model1_state *state, bitmap_t *bitmap, const rectangle | |
| 1122 | static void draw_objects(model1_state *state, bitmap_t *bitmap, const rectangle &cliprect) | |
| 1123 | 1123 | { |
| 1124 | 1124 | if(state->m_quadpt != state->m_quaddb) { |
| 1125 | 1125 | LOG_TGP(("VIDEO: sort&draw\n")); |
| r13798 | r13799 | |
| 1131 | 1131 | state->m_pointpt = state->m_pointdb; |
| 1132 | 1132 | } |
| 1133 | 1133 | |
| 1134 | static UINT16 *draw_direct(model1_state *state, bitmap_t *bitmap, const rectangle | |
| 1134 | static UINT16 *draw_direct(model1_state *state, bitmap_t *bitmap, const rectangle &cliprect, UINT16 *list) | |
| 1135 | 1135 | { |
| 1136 | 1136 | UINT16 *res; |
| 1137 | 1137 | |
| r13798 | r13799 | |
| 1184 | 1184 | LOG_TGP(("VIDEO: control=%08x\n", (state->m_listctl[1]<<16)|state->m_listctl[0])); |
| 1185 | 1185 | } |
| 1186 | 1186 | |
| 1187 | static void tgp_render(running_machine &machine, bitmap_t *bitmap, const rectangle | |
| 1187 | static void tgp_render(running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect) | |
| 1188 | 1188 | { |
| 1189 | 1189 | model1_state *state = machine.driver_data<model1_state>(); |
| 1190 | 1190 | struct view *view = state->m_view; |
| r13798 | r13799 | |
| 1519 | 1519 | view->ayys = sin(view->ayy); |
| 1520 | 1520 | |
| 1521 | 1521 | screen.machine().priority_bitmap->fill(0); |
| 1522 | bitmap->fill(screen.machine().pens[0], | |
| 1522 | bitmap->fill(screen.machine().pens[0], | |
| 1523 | 1523 | |
| 1524 | 1524 | segas24_tile *tile = screen.machine().device<segas24_tile>("tile"); |
| 1525 | 1525 | tile->draw(bitmap, cliprect, 6, 0, 0); |
| r13798 | r13799 | |
|---|---|---|
| 141 | 141 | } |
| 142 | 142 | |
| 143 | 143 | |
| 144 | static void draw_sprites( running_machine &machine, bitmap_t *bitmap, const rectangle | |
| 144 | static void draw_sprites( running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect ) | |
| 145 | 145 | { |
| 146 | 146 | /* Sprite format: (16 bytes per sprite) |
| 147 | 147 | offs: bits: |
| r13798 | r13799 | |
| 270 | 270 | } |
| 271 | 271 | |
| 272 | 272 | |
| 273 | static void draw_framebuffer( running_machine &machine, bitmap_t *bitmap, const rectangle | |
| 273 | static void draw_framebuffer( running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect, int priority ) | |
| 274 | 274 | { |
| 275 | 275 | taitob_state *state = machine.driver_data<taitob_state>(); |
| 276 | rectangle myclip = | |
| 276 | rectangle myclip = | |
| 277 | 277 | int x, y; |
| 278 | 278 | UINT8 video_control = tc0180vcu_get_videoctrl(state->m_tc0180vcu, 0); |
| 279 | 279 | UINT8 framebuffer_page = tc0180vcu_get_fb_page(state->m_tc0180vcu, 0); |
| r13798 | r13799 | |
| 382 | 382 | |
| 383 | 383 | if ((video_control & 0x20) == 0) |
| 384 | 384 | { |
| 385 | bitmap->fill(0, | |
| 385 | bitmap->fill(0, | |
| 386 | 386 | return 0; |
| 387 | 387 | } |
| 388 | 388 | |
| r13798 | r13799 | |
| 421 | 421 | /* Video blanked? */ |
| 422 | 422 | if (!(video_control & 0x20)) |
| 423 | 423 | { |
| 424 | bitmap->fill(0, | |
| 424 | bitmap->fill(0, | |
| 425 | 425 | return 0; |
| 426 | 426 | } |
| 427 | 427 | |
| r13798 | r13799 | |
| 436 | 436 | draw_framebuffer(screen.machine(), state->m_realpunc_bitmap, cliprect, 0); |
| 437 | 437 | |
| 438 | 438 | /* 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++) | |
| 441 | 441 | bitmap->pix32(y, x) = palette[state->m_realpunc_bitmap->pix16(y, x)]; |
| 442 | 442 | |
| 443 | 443 | /* Draw the 15bpp raw CRTC frame buffer directly to the output bitmap */ |
| r13798 | r13799 | |
| 451 | 451 | // scrollx = taitob_scroll[0]; |
| 452 | 452 | // scrolly = taitob_scroll[1]; |
| 453 | 453 | |
| 454 | for (y = 0; y <= cliprect | |
| 454 | for (y = 0; y <= cliprect. | |
| 455 | 455 | { |
| 456 | 456 | int addr = base + (y*stride); |
| 457 | for (x = 0; x <= cliprect | |
| 457 | for (x = 0; x <= cliprect. | |
| 458 | 458 | { |
| 459 | 459 | int r, g, b; |
| 460 | 460 | UINT16 srcpix = hd63484_ram_r(hd63484, addr++, 0xffff); |
| r13798 | r13799 | |
| 473 | 473 | /* Draw the 15bpp raw output of the camera ADCs (TODO) */ |
| 474 | 474 | else if (state->m_realpunc_video_ctrl & 0x0004) |
| 475 | 475 | { |
| 476 | for (y = 0; y <= cliprect | |
| 476 | for (y = 0; y <= cliprect. | |
| 477 | 477 | { |
| 478 | for (x = 0; x <= cliprect | |
| 478 | for (x = 0; x <= cliprect. | |
| 479 | 479 | bitmap->pix32(y, x) = MAKE_RGB(0x00, 0x00, 0x00); |
| 480 | 480 | } |
| 481 | 481 | } |
| 482 | 482 | |
| 483 | 483 | /* Clear the indexed bitmap and draw the final indexed layers */ |
| 484 | state->m_realpunc_bitmap->fill(0, | |
| 484 | state->m_realpunc_bitmap->fill(0, | |
| 485 | 485 | |
| 486 | 486 | if (!(state->m_realpunc_video_ctrl & 0x0001)) |
| 487 | 487 | draw_framebuffer(screen.machine(), state->m_realpunc_bitmap, cliprect, 0); |
| r13798 | r13799 | |
| 489 | 489 | tc0180vcu_tilemap_draw(state->m_tc0180vcu, state->m_realpunc_bitmap, cliprect, 2, 0); |
| 490 | 490 | |
| 491 | 491 | /* Merge the indexed layers with the output bitmap */ |
| 492 | for (y = 0; y <= cliprect | |
| 492 | for (y = 0; y <= cliprect. | |
| 493 | 493 | { |
| 494 | for (x = 0; x <= cliprect | |
| 494 | for (x = 0; x <= cliprect. | |
| 495 | 495 | { |
| 496 | 496 | if (state->m_realpunc_bitmap->pix16(y, x)) |
| 497 | 497 | bitmap->pix32(y, x) = palette[state->m_realpunc_bitmap->pix16(y, x)]; |
| r13798 | r13799 | |
| 518 | 518 | tc0180vcu_set_fb_page(state->m_tc0180vcu, 0, framebuffer_page); |
| 519 | 519 | } |
| 520 | 520 | |
| 521 | draw_sprites(screen.machine(), state->m_framebuffer[framebuffer_page], | |
| 521 | draw_sprites(screen.machine(), state->m_framebuffer[framebuffer_page], | |
| 522 | 522 | } |
| r13798 | r13799 | |
|---|---|---|
| 79 | 79 | state->m_bg_tilemap = tilemap_create(machine, get_bg_tile_info, tilemap_scan_rows, 8, 8, 32, 32); |
| 80 | 80 | } |
| 81 | 81 | |
| 82 | static void draw_background( running_machine &machine, bitmap_t *bitmap, const rectangle | |
| 82 | static void draw_background( running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect ) | |
| 83 | 83 | { |
| 84 | 84 | jackal_state *state = machine.driver_data<jackal_state>(); |
| 85 | 85 | UINT8 *RAM = machine.region("master")->base(); |
| r13798 | r13799 | |
| 117 | 117 | |
| 118 | 118 | #define DRAW_SPRITE(bank, code, sx, sy) drawgfx_transpen(bitmap, cliprect, machine.gfx[bank], code, color, flipx, flipy, sx, sy, 0); |
| 119 | 119 | |
| 120 | static void draw_sprites_region( running_machine &machine, bitmap_t *bitmap, const rectangle | |
| 120 | static void draw_sprites_region( running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect, const UINT8 *sram, int length, int bank ) | |
| 121 | 121 | { |
| 122 | 122 | int offs; |
| 123 | 123 | |
| r13798 | r13799 | |
| 201 | 201 | } |
| 202 | 202 | } |
| 203 | 203 | |
| 204 | static void draw_sprites( running_machine &machine, bitmap_t *bitmap, const rectangle | |
| 204 | static void draw_sprites( running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect ) | |
| 205 | 205 | { |
| 206 | 206 | jackal_state *state = machine.driver_data<jackal_state>(); |
| 207 | 207 | UINT8 *RAM = machine.region("master")->base(); |
| r13798 | r13799 | |
|---|---|---|
| 128 | 128 | } |
| 129 | 129 | |
| 130 | 130 | |
| 131 | static void draw_sprites(running_machine &machine, bitmap_t *bitmap, const rectangle | |
| 131 | static void draw_sprites(running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect) | |
| 132 | 132 | { |
| 133 | 133 | tank8_state *state = machine.driver_data<tank8_state>(); |
| 134 | 134 | int i; |
| r13798 | r13799 | |
| 151 | 151 | } |
| 152 | 152 | |
| 153 | 153 | |
| 154 | static void draw_bullets(running_machine &machine, bitmap_t *bitmap, const rectangle | |
| 154 | static void draw_bullets(running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect) | |
| 155 | 155 | { |
| 156 | 156 | tank8_state *state = machine.driver_data<tank8_state>(); |
| 157 | 157 | int i; |
| r13798 | r13799 | |
| 170 | 170 | rect.max_x = rect.min_x + 3; |
| 171 | 171 | rect.max_y = rect.min_y + 4; |
| 172 | 172 | |
| 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; | |
| 181 | 181 | |
| 182 | 182 | bitmap->fill((i << 1) | 0x01, rect); |
| 183 | 183 | } |
| r13798 | r13799 | |
| 209 | 209 | int y; |
| 210 | 210 | const rectangle &visarea = screen.machine().primary_screen->visible_area(); |
| 211 | 211 | |
| 212 | tilemap_draw(state->m_helper1, | |
| 212 | tilemap_draw(state->m_helper1, | |
| 213 | 213 | |
| 214 | 214 | state->m_helper2->fill(8, visarea); |
| 215 | 215 | state->m_helper3->fill(8, visarea); |
| 216 | 216 | |
| 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); | |
| 219 | 219 | |
| 220 | 220 | for (y = visarea.min_y; y <= visarea.max_y; y++) |
| 221 | 221 | { |
| r13798 | r13799 | |
|---|---|---|
| 501 | 501 | |
| 502 | 502 | /* These scanline drawing routines lifted from Taito F3: optimise / merge ? */ |
| 503 | 503 | |
| 504 | INLINE void taitoic_drawscanline( bitmap_t *bitmap, const rectangle | |
| 504 | INLINE void taitoic_drawscanline( bitmap_t *bitmap, const rectangle &cliprect, int x, int y, | |
| 505 | 505 | const UINT16 *src, int transparent, UINT32 orient, bitmap_t *priority, int pri) |
| 506 | 506 | { |
| 507 | 507 | UINT16 *dsti = &bitmap->pix16(y, x); |
| 508 | 508 | UINT8 *dstp = &priority->pix8(y, x); |
| 509 | int length = cliprect | |
| 509 | int length = cliprect. | |
| 510 | 510 | |
| 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; | |
| 514 | 514 | if (transparent) |
| 515 | 515 | { |
| 516 | 516 | while (length--) |
| r13798 | r13799 | |
| 834 | 834 | } |
| 835 | 835 | |
| 836 | 836 | |
| 837 | static void topspeed_custom_draw( device_t *device, bitmap_t *bitmap, const rectangle | |
| 837 | static void topspeed_custom_draw( device_t *device, bitmap_t *bitmap, const rectangle &cliprect, int layer, int flags, | |
| 838 | 838 | UINT32 priority, UINT16 *color_ctrl_ram ) |
| 839 | 839 | { |
| 840 | 840 | pc080sn_state *pc080sn = pc080sn_get_safe_token(device); |
| r13798 | r13799 | |
| 852 | 852 | int flip = 0; |
| 853 | 853 | int machine_flip = 0; /* for ROT 180 ? */ |
| 854 | 854 | |
| 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; | |
| 859 | 859 | int screen_width = max_x - min_x + 1; |
| 860 | 860 | int width_mask = 0x1ff; /* underlying tilemap */ |
| 861 | 861 | |
| r13798 | r13799 | |
| 928 | 928 | while ((!machine_flip && y <= max_y) || (machine_flip && y >= min_y)); |
| 929 | 929 | } |
| 930 | 930 | |
| 931 | void pc080sn_tilemap_draw( device_t *device, bitmap_t *bitmap, const rectangle | |
| 931 | void pc080sn_tilemap_draw( device_t *device, bitmap_t *bitmap, const rectangle &cliprect, int layer, int flags, UINT32 priority ) | |
| 932 | 932 | { |
| 933 | 933 | pc080sn_state *pc080sn = pc080sn_get_safe_token(device); |
| 934 | 934 | tilemap_draw(bitmap, cliprect, pc080sn->tilemap[layer], flags, priority); |
| 935 | 935 | } |
| 936 | 936 | |
| 937 | void pc080sn_tilemap_draw_offset( device_t *device, bitmap_t *bitmap, const rectangle | |
| 937 | void pc080sn_tilemap_draw_offset( device_t *device, bitmap_t *bitmap, const rectangle &cliprect, int layer, int flags, UINT32 priority, int xoffs, int yoffs ) | |
| 938 | 938 | { |
| 939 | 939 | pc080sn_state *pc080sn = pc080sn_get_safe_token(device); |
| 940 | 940 | int basedx = -16 - pc080sn->xoffs; |
| r13798 | r13799 | |
| 949 | 949 | tilemap_set_scrolldy(pc080sn->tilemap[layer], basedy, basedyflip); |
| 950 | 950 | } |
| 951 | 951 | |
| 952 | void pc080sn_tilemap_draw_special( device_t *device, bitmap_t *bitmap, const rectangle | |
| 952 | void pc080sn_tilemap_draw_special( device_t *device, bitmap_t *bitmap, const rectangle &cliprect, int layer, int flags, UINT32 priority, UINT16 *ram ) | |
| 953 | 953 | { |
| 954 | 954 | topspeed_custom_draw(device, bitmap, cliprect, layer, flags, priority, ram); |
| 955 | 955 | } |
| r13798 | r13799 | |
| 1122 | 1122 | } |
| 1123 | 1123 | |
| 1124 | 1124 | |
| 1125 | void pc090oj_draw_sprites( device_t *device, bitmap_t *bitmap, const rectangle | |
| 1125 | void pc090oj_draw_sprites( device_t *device, bitmap_t *bitmap, const rectangle &cliprect, int pri_type ) | |
| 1126 | 1126 | { |
| 1127 | 1127 | pc090oj_state *pc090oj = pc090oj_get_safe_token(device); |
| 1128 | 1128 | int offs, priority = 0; |
| r13798 | r13799 | |
| 1528 | 1528 | |
| 1529 | 1529 | /* NB: orientation_flipx code in following routine has not been tested */ |
| 1530 | 1530 | |
| 1531 | static void tc0080vco_bg0_tilemap_draw( device_t *device, bitmap_t *bitmap, const rectangle | |
| 1531 | static void tc0080vco_bg0_tilemap_draw( device_t *device, bitmap_t *bitmap, const rectangle &cliprect, int flags, UINT32 priority ) | |
| 1532 | 1532 | { |
| 1533 | 1533 | tc0080vco_state *tc0080vco = tc0080vco_get_safe_token(device); |
| 1534 | 1534 | UINT16 zoom = tc0080vco->scroll_ram[6]; |
| r13798 | r13799 | |
| 1557 | 1557 | int flip = tc0080vco->flipscreen; |
| 1558 | 1558 | int machine_flip = 0; /* for ROT 180 ? */ |
| 1559 | 1559 | |
| 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; | |
| 1564 | 1564 | int screen_width = max_x + 1; |
| 1565 | 1565 | int width_mask = 0x3ff; /* underlying tilemap */ |
| 1566 | 1566 | |
| r13798 | r13799 | |
| 1681 | 1681 | } \ |
| 1682 | 1682 | while (0) \ |
| 1683 | 1683 | |
| 1684 | static void tc0080vco_bg1_tilemap_draw( device_t *device, bitmap_t *bitmap, const rectangle | |
| 1684 | static void tc0080vco_bg1_tilemap_draw( device_t *device, bitmap_t *bitmap, const rectangle &cliprect, int flags, UINT32 priority ) | |
| 1685 | 1685 | { |
| 1686 | 1686 | tc0080vco_state *tc0080vco = tc0080vco_get_safe_token(device); |
| 1687 | 1687 | UINT8 layer = 1; |
| 1688 | 1688 | 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; | |
| 1693 | 1693 | int zoomx, zoomy; |
| 1694 | 1694 | |
| 1695 | 1695 | zoomx = (zoom & 0xff00) >> 8; |
| r13798 | r13799 | |
| 1767 | 1767 | } |
| 1768 | 1768 | |
| 1769 | 1769 | |
| 1770 | void tc0080vco_tilemap_draw( device_t *device, bitmap_t *bitmap, const rectangle | |
| 1770 | void tc0080vco_tilemap_draw( device_t *device, bitmap_t *bitmap, const rectangle &cliprect, int layer, int flags, UINT32 priority ) | |
| 1771 | 1771 | { |
| 1772 | 1772 | tc0080vco_state *tc0080vco = tc0080vco_get_safe_token(device); |
| 1773 | 1773 | int disable = 0x00; /* possibly layer disable bits do exist ?? */ |
| r13798 | r13799 | |
| 2326 | 2326 | tilemap_set_scrollx(tc0100scn->tilemap[1][tc0100scn->dblwidth], (j + tc0100scn->fgscrolly) & 0x1ff, tc0100scn->fgscrollx - tc0100scn->fgscroll_ram[j]); |
| 2327 | 2327 | } |
| 2328 | 2328 | |
| 2329 | static void tc0100scn_tilemap_draw_fg( device_t *device, bitmap_t *bitmap, const rectangle | |
| 2329 | static void tc0100scn_tilemap_draw_fg( device_t *device, bitmap_t *bitmap, const rectangle &cliprect, tilemap_t* tmap, int flags, UINT32 priority ) | |
| 2330 | 2330 | { |
| 2331 | 2331 | tc0100scn_state *tc0100scn = tc0100scn_get_safe_token(device); |
| 2332 | 2332 | const bitmap_t *src_bitmap = tilemap_get_pixmap(tmap); |
| r13798 | r13799 | |
| 2342 | 2342 | if (tc0100scn->ctrl[0x7] & 1) // Flipscreen |
| 2343 | 2343 | src_y = (256 - src_y) & height_mask; |
| 2344 | 2344 | |
| 2345 | //We use cliprect | |
| 2345 | //We use cliprect. | |
| 2346 | 2346 | |
| 2347 | 2347 | // Row offsets are 'screen space' 0-255 regardless of Y scroll |
| 2348 | for (y = 0; y <= cliprect | |
| 2348 | for (y = 0; y <= cliprect. | |
| 2349 | 2349 | { |
| 2350 | src_x = (tc0100scn->fgscrollx - tc0100scn->fgscroll_ram[(y + scrolly_delta) & 0x1ff] + scrollx_delta + cliprect | |
| 2350 | src_x = (tc0100scn->fgscrollx - tc0100scn->fgscroll_ram[(y + scrolly_delta) & 0x1ff] + scrollx_delta + cliprect. | |
| 2351 | 2351 | if (tc0100scn->ctrl[0x7] & 1) // Flipscreen |
| 2352 | 2352 | src_x = (256 - 64 - src_x) & width_mask; |
| 2353 | 2353 | |
| 2354 | 2354 | // Col offsets are 'tilemap' space 0-511, and apply to blocks of 8 pixels at once |
| 2355 | for (x = 0; x <= (cliprect | |
| 2355 | for (x = 0; x <= (cliprect. | |
| 2356 | 2356 | { |
| 2357 | 2357 | column_offset = tc0100scn->colscroll_ram[(src_x & 0x3ff) / 8]; |
| 2358 | 2358 | p = src_bitmap->pix16((src_y - column_offset) & height_mask, src_x); |
| 2359 | 2359 | |
| 2360 | 2360 | if ((p & 0xf)!= 0 || (flags & TILEMAP_DRAW_OPAQUE)) |
| 2361 | 2361 | { |
| 2362 | bitmap->pix16(y, x + cliprect | |
| 2362 | bitmap->pix16(y, x + cliprect. | |
| 2363 | 2363 | if (device->machine().priority_bitmap) |
| 2364 | 2364 | { |
| 2365 | 2365 | UINT8 *pri = &device->machine().priority_bitmap->pix8(y); |
| 2366 | pri[x + cliprect | |
| 2366 | pri[x + cliprect. | |
| 2367 | 2367 | } |
| 2368 | 2368 | } |
| 2369 | 2369 | src_x = (src_x + 1) & width_mask; |
| r13798 | r13799 | |
| 2372 | 2372 | } |
| 2373 | 2373 | } |
| 2374 | 2374 | |
| 2375 | int tc0100scn_tilemap_draw( device_t *device, bitmap_t *bitmap, const rectangle | |
| 2375 | int tc0100scn_tilemap_draw( device_t *device, bitmap_t *bitmap, const rectangle &cliprect, int layer, int flags, UINT32 priority ) | |
| 2376 | 2376 | { |
| 2377 | 2377 | tc0100scn_state *tc0100scn = tc0100scn_get_safe_token(device); |
| 2378 | 2378 | int disable = tc0100scn->ctrl[6] & 0xf7; |
| 2379 | rectangle clip = | |
| 2379 | rectangle clip = | |
| 2380 | 2380 | clip &= tc0100scn->cliprect; |
| 2381 | 2381 | |
| 2382 | 2382 | #if 0 |
| r13798 | r13799 | |
| 2389 | 2389 | case 0: |
| 2390 | 2390 | if (disable & 0x01) |
| 2391 | 2391 | return 1; |
| 2392 | tilemap_draw(bitmap, | |
| 2392 | tilemap_draw(bitmap, | |
| 2393 | 2393 | break; |
| 2394 | 2394 | case 1: |
| 2395 | 2395 | if (disable & 0x02) |
| 2396 | 2396 | return 1; |
| 2397 | tc0100scn_tilemap_draw_fg(device, bitmap, | |
| 2397 | tc0100scn_tilemap_draw_fg(device, bitmap, | |
| 2398 | 2398 | break; |
| 2399 | 2399 | case 2: |
| 2400 | 2400 | if (disable & 0x04) |
| 2401 | 2401 | return 1; |
| 2402 | tilemap_draw(bitmap, | |
| 2402 | tilemap_draw(bitmap, | |
| 2403 | 2403 | break; |
| 2404 | 2404 | } |
| 2405 | 2405 | return 0; |
| r13798 | r13799 | |
| 2633 | 2633 | tc0280grd_tilemap_update(device, base_color); |
| 2634 | 2634 | } |
| 2635 | 2635 | |
| 2636 | static void zoom_draw( device_t *device, bitmap_t *bitmap, const rectangle | |
| 2636 | static void zoom_draw( device_t *device, bitmap_t *bitmap, const rectangle &cliprect, int xoffset, int yoffset, UINT32 priority, int xmultiply ) | |
| 2637 | 2637 | { |
| 2638 | 2638 | tc0280grd_state *tc0280grd = tc0280grd_get_safe_token(device); |
| 2639 | 2639 | UINT32 startx, starty; |
| r13798 | r13799 | |
| 2668 | 2668 | 0, priority); |
| 2669 | 2669 | } |
| 2670 | 2670 | |
| 2671 | void tc0280grd_zoom_draw( device_t *device, bitmap_t *bitmap, const rectangle | |
| 2671 | void tc0280grd_zoom_draw( device_t *device, bitmap_t *bitmap, const rectangle &cliprect, int xoffset, int yoffset, UINT32 priority ) | |
| 2672 | 2672 | { |
| 2673 | 2673 | zoom_draw(device, bitmap, cliprect, xoffset, yoffset, priority, 2); |
| 2674 | 2674 | } |
| 2675 | 2675 | |
| 2676 | void tc0430grw_zoom_draw( device_t *device, bitmap_t *bitmap, const rectangle | |
| 2676 | void tc0430grw_zoom_draw( device_t *device, bitmap_t *bitmap, const rectangle &cliprect, int xoffset, int yoffset, UINT32 priority ) | |
| 2677 | 2677 | { |
| 2678 | 2678 | zoom_draw(device, bitmap, cliprect, xoffset, yoffset, priority, 1); |
| 2679 | 2679 | } |
| r13798 | r13799 | |
| 3236 | 3236 | |
| 3237 | 3237 | **********************************************************************/ |
| 3238 | 3238 | |
| 3239 | static void tc0480scp_bg01_draw( device_t *device, bitmap_t *bitmap, const rectangle | |
| 3239 | static void tc0480scp_bg01_draw( device_t *device, bitmap_t *bitmap, const rectangle &cliprect, int layer, int flags, UINT32 priority ) | |
| 3240 | 3240 | { |
| 3241 | 3241 | /* X-axis zoom offers expansion only: 0 = no zoom, 0xff = max |
| 3242 | 3242 | Y-axis zoom offers expansion/compression: 0x7f = no zoom, 0xff = max |
| r13798 | r13799 | |
| 3264 | 3264 | int x_index, x_step; |
| 3265 | 3265 | int machine_flip = 0; /* for ROT 180 ? */ |
| 3266 | 3266 | |
| 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; | |
| 3270 | 3270 | |
| 3271 | 3271 | int width_mask = 0x1ff; |
| 3272 | 3272 | if (tc0480scp->dblwidth) |
| r13798 | r13799 | |
| 3385 | 3385 | |
| 3386 | 3386 | ****************************************************************/ |
| 3387 | 3387 | |
| 3388 | static void tc0480scp_bg23_draw( device_t *device, bitmap_t *bitmap, const rectangle | |
| 3388 | static void tc0480scp_bg23_draw( device_t *device, bitmap_t *bitmap, const rectangle &cliprect, int layer, int flags, UINT32 priority ) | |
| 3389 | 3389 | { |
| 3390 | 3390 | tc0480scp_state *tc0480scp = tc0480scp_get_safe_token(device); |
| 3391 | 3391 | bitmap_t *srcbitmap = tilemap_get_pixmap(tc0480scp->tilemap[layer][tc0480scp->dblwidth]); |
| r13798 | r13799 | |
| 3400 | 3400 | int flipscreen = tc0480scp->pri_reg & 0x40; |
| 3401 | 3401 | int machine_flip = 0; /* for ROT 180 ? */ |
| 3402 | 3402 | |
| 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; | |
| 3406 | 3406 | |
| 3407 | 3407 | int width_mask = 0x1ff; |
| 3408 | 3408 | if (tc0480scp->dblwidth) |
| r13798 | r13799 | |
| 3507 | 3507 | } |
| 3508 | 3508 | |
| 3509 | 3509 | |
| 3510 | void tc0480scp_tilemap_draw( device_t *device, bitmap_t *bitmap, const rectangle | |
| 3510 | void tc0480scp_tilemap_draw( device_t *device, bitmap_t *bitmap, const rectangle &cliprect, int layer, int flags, UINT32 priority ) | |
| 3511 | 3511 | { |
| 3512 | 3512 | tc0480scp_state *tc0480scp = tc0480scp_get_safe_token(device); |
| 3513 | 3513 | |
| r13798 | r13799 | |
| 3951 | 3951 | |
| 3952 | 3952 | ******************************************************************************/ |
| 3953 | 3953 | |
| 3954 | void tc0150rod_draw( device_t *device, bitmap_t *bitmap, const rectangle | |
| 3954 | void 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 ) | |
| 3955 | 3955 | { |
| 3956 | 3956 | tc0150rod_state *tc0150rod = tc0150rod_get_safe_token(device); |
| 3957 | 3957 | |
| r13798 | r13799 | |
| 3978 | 3978 | int left_edge, right_edge, begin, end, right_over, left_over; |
| 3979 | 3979 | int line_needs_drawing, draw_top_road_line, background_only; |
| 3980 | 3980 | |
| 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; | |
| 3985 | 3985 | int screen_width = max_x - min_x + 1; |
| 3986 | 3986 | |
| 3987 | 3987 | int y = min_y; |
| r13798 | r13799 | |
| 5014 | 5014 | tilemap_mark_tile_dirty(tc0180vcu->tilemap[2], offset & 0x7ff); |
| 5015 | 5015 | } |
| 5016 | 5016 | |
| 5017 | void tc0180vcu_tilemap_draw( device_t *device, bitmap_t *bitmap, const rectangle | |
| 5017 | void tc0180vcu_tilemap_draw( device_t *device, bitmap_t *bitmap, const rectangle &cliprect, int tmap_num, int plane ) | |
| 5018 | 5018 | { |
| 5019 | 5019 | tc0180vcu_state *tc0180vcu = tc0180vcu_get_safe_token(device); |
| 5020 | 5020 | |
| r13798 | r13799 | |
| 5035 | 5035 | lines_per_block = 256 - (tc0180vcu->ctrl[2 + plane] >> 8); |
| 5036 | 5036 | number_of_blocks = 256 / lines_per_block; |
| 5037 | 5037 | |
| 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; | |
| 5040 | 5040 | |
| 5041 | 5041 | for (i = 0; i < number_of_blocks; i++) |
| 5042 | 5042 | { |
| r13798 | r13799 | |
| 5052 | 5052 | my_clip.max_y = bitmap->height() - 1 - i * lines_per_block; |
| 5053 | 5053 | } |
| 5054 | 5054 | |
| 5055 | my_clip &= | |
| 5055 | my_clip &= | |
| 5056 | 5056 | |
| 5057 | 5057 | if (my_clip.min_y <= my_clip.max_y) |
| 5058 | 5058 | { |
| 5059 | 5059 | tilemap_set_scrollx(tc0180vcu->tilemap[tmap_num], 0, -scrollx); |
| 5060 | 5060 | tilemap_set_scrolly(tc0180vcu->tilemap[tmap_num], 0, -scrolly); |
| 5061 | tilemap_draw(bitmap, | |
| 5061 | tilemap_draw(bitmap, | |
| 5062 | 5062 | } |
| 5063 | 5063 | } |
| 5064 | 5064 | } |
| r13798 | r13799 | |
|---|---|---|
| 282 | 282 | 15 xxxxxxxx Y position |
| 283 | 283 | */ |
| 284 | 284 | |
| 285 | static void draw_sprites(running_machine &machine, bitmap_t *bitmap, const rectangle | |
| 285 | static void draw_sprites(running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect) | |
| 286 | 286 | { |
| 287 | 287 | namcos86_state *state = machine.driver_data<namcos86_state>(); |
| 288 | 288 | const UINT8 *source = &state->m_spriteram[0x0800-0x20]; /* the last is NOT a sprite */ |
| r13798 | r13799 | |
| 376 | 376 | set_scroll(screen.machine(), 2); |
| 377 | 377 | set_scroll(screen.machine(), 3); |
| 378 | 378 | |
| 379 | screen.machine().priority_bitmap->fill(0, | |
| 379 | screen.machine().priority_bitmap->fill(0, | |
| 380 | 380 | |
| 381 | bitmap->fill(screen.machine().gfx[0]->color_base + 8*state->m_backcolor+7, | |
| 381 | bitmap->fill(screen.machine().gfx[0]->color_base + 8*state->m_backcolor+7, | |
| 382 | 382 | |
| 383 | 383 | for (layer = 0;layer < 8;layer++) |
| 384 | 384 | { |
| r13798 | r13799 | |
|---|---|---|
| 202 | 202 | |
| 203 | 203 | ***************************************************************************/ |
| 204 | 204 | |
| 205 | static void draw_normal_sprites(running_machine &machine, bitmap_t *bitmap,const rectangle | |
| 205 | static void draw_normal_sprites(running_machine &machine, bitmap_t *bitmap,const rectangle &cliprect) | |
| 206 | 206 | { |
| 207 | 207 | suna8_state *state = machine.driver_data<suna8_state>(); |
| 208 | 208 | UINT8 *spriteram = state->m_spriteram; |
| r13798 | r13799 | |
| 336 | 336 | } |
| 337 | 337 | } |
| 338 | 338 | |
| 339 | static void draw_text_sprites(running_machine &machine, bitmap_t *bitmap,const rectangle | |
| 339 | static void draw_text_sprites(running_machine &machine, bitmap_t *bitmap,const rectangle &cliprect) | |
| 340 | 340 | { |
| 341 | 341 | suna8_state *state = machine.driver_data<suna8_state>(); |
| 342 | 342 | UINT8 *spriteram = state->m_spriteram; |
| r13798 | r13799 | |
| 415 | 415 | SCREEN_UPDATE( suna8 ) |
| 416 | 416 | { |
| 417 | 417 | /* see hardhead, hardhea2 test mode (press button 2 for both players) */ |
| 418 | bitmap->fill(0xff, | |
| 418 | bitmap->fill(0xff, | |
| 419 | 419 | |
| 420 | 420 | #ifdef MAME_DEBUG |
| 421 | 421 | #if TILEMAPS |
| r13798 | r13799 | |
|---|---|---|
| 60 | 60 | SCREEN_UPDATE( qdrmfgp ) |
| 61 | 61 | { |
| 62 | 62 | device_t *k056832 = screen.machine().device("k056832"); |
| 63 | bitmap->fill(get_black_pen(screen.machine()), | |
| 63 | bitmap->fill(get_black_pen(screen.machine()), | |
| 64 | 64 | |
| 65 | 65 | k056832_tilemap_draw(k056832, bitmap, cliprect, 3, 0, 1); |
| 66 | 66 | k056832_tilemap_draw(k056832, bitmap, cliprect, 2, 0, 2); |
| r13798 | r13799 | |
|---|---|---|
| 301 | 301 | } |
| 302 | 302 | |
| 303 | 303 | |
| 304 | static void draw_chars( running_machine &machine, bitmap_t *bitmap, const rectangle | |
| 304 | static void draw_chars( running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect, UINT8 transparency, UINT8 color, int priority ) | |
| 305 | 305 | { |
| 306 | 306 | btime_state *state = machine.driver_data<btime_state>(); |
| 307 | 307 | offs_t offs; |
| r13798 | r13799 | |
| 332 | 332 | } |
| 333 | 333 | } |
| 334 | 334 | |
| 335 | static void draw_sprites( running_machine &machine, bitmap_t *bitmap, const rectangle | |
| 335 | static void draw_sprites( running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect, UINT8 color, | |
| 336 | 336 | UINT8 sprite_y_adjust, UINT8 sprite_y_adjust_flip_screen, |
| 337 | 337 | UINT8 *sprite_ram, offs_t interleave ) |
| 338 | 338 | { |
| r13798 | r13799 | |
| 382 | 382 | } |
| 383 | 383 | |
| 384 | 384 | |
| 385 | static void draw_background( running_machine &machine, bitmap_t *bitmap, const rectangle | |
| 385 | static void draw_background( running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect, UINT8* tmap, UINT8 color ) | |
| 386 | 386 | { |
| 387 | 387 | btime_state *state = machine.driver_data<btime_state>(); |
| 388 | 388 | int i; |
| r13798 | r13799 | |
| 513 | 513 | sy = 256 - sy; |
| 514 | 514 | } |
| 515 | 515 | |
| 516 | drawgfx_opaque(state->m_background_bitmap, | |
| 516 | drawgfx_opaque(state->m_background_bitmap, state->m_background_bitmap->cliprect(), screen.machine().gfx[2], | |
| 517 | 517 | (state->m_bnj_backgroundram[offs] >> 4) + ((offs & 0x80) >> 3) + 32, |
| 518 | 518 | 0, |
| 519 | 519 | flip_screen_get(screen.machine()), flip_screen_get(screen.machine()), |
| r13798 | r13799 | |
|---|---|---|
| 180 | 180 | void pc080sn_set_scroll(device_t *device, int tilemap_num, int scrollx, int scrolly); |
| 181 | 181 | void pc080sn_set_trans_pen(device_t *device, int tilemap_num, int pen); |
| 182 | 182 | void pc080sn_tilemap_update(device_t *device); |
| 183 | void pc080sn_tilemap_draw(device_t *device, bitmap_t *bitmap, const rectangle *cliprect, int layer, int flags, UINT32 priority); | |
| 184 | void pc080sn_tilemap_draw_offset(device_t *device, bitmap_t *bitmap, const rectangle *cliprect, int layer, int flags, UINT32 priority, int xoffs, int yoffs); | |
| 183 | void pc080sn_tilemap_draw(device_t *device, bitmap_t *bitmap, const rectangle &cliprect, int layer, int flags, UINT32 priority); | |
| 184 | void pc080sn_tilemap_draw_offset(device_t *device, bitmap_t *bitmap, const rectangle &cliprect, int layer, int flags, UINT32 priority, int xoffs, int yoffs); | |
| 185 | 185 | |
| 186 | 186 | /* For Topspeed */ |
| 187 | void pc080sn_tilemap_draw_special(device_t *device, bitmap_t *bitmap, const rectangle | |
| 187 | void pc080sn_tilemap_draw_special(device_t *device, bitmap_t *bitmap, const rectangle &cliprect, int layer, int flags, UINT32 priority, UINT16 *ram); | |
| 188 | 188 | |
| 189 | 189 | |
| 190 | 190 | /** PC090OJ **/ |
| r13798 | r13799 | |
| 193 | 193 | |
| 194 | 194 | void pc090oj_set_sprite_ctrl(device_t *device, UINT16 sprctrl); |
| 195 | 195 | void pc090oj_eof_callback(device_t *device); |
| 196 | void pc090oj_draw_sprites(device_t *device, bitmap_t *bitmap, const rectangle | |
| 196 | void pc090oj_draw_sprites(device_t *device, bitmap_t *bitmap, const rectangle &cliprect, int pri_type); | |
| 197 | 197 | |
| 198 | 198 | |
| 199 | 199 | /** TC0080VCO **/ |
| r13798 | r13799 | |
| 201 | 201 | WRITE16_DEVICE_HANDLER( tc0080vco_word_w ); |
| 202 | 202 | |
| 203 | 203 | void tc0080vco_tilemap_update(device_t *device); |
| 204 | void tc0080vco_tilemap_draw(device_t *device, bitmap_t *bitmap, const rectangle | |
| 204 | void tc0080vco_tilemap_draw(device_t *device, bitmap_t *bitmap, const rectangle &cliprect, int layer, int flags, UINT32 priority); | |
| 205 | 205 | |
| 206 | 206 | READ16_DEVICE_HANDLER( tc0080vco_cram_0_r ); |
| 207 | 207 | READ16_DEVICE_HANDLER( tc0080vco_cram_1_r ); |
| r13798 | r13799 | |
| 239 | 239 | WRITE32_DEVICE_HANDLER( tc0100scn_ctrl_long_w ); |
| 240 | 240 | |
| 241 | 241 | void tc0100scn_tilemap_update(device_t *device); |
| 242 | int tc0100scn_tilemap_draw(device_t *device, bitmap_t *bitmap, const rectangle | |
| 242 | int tc0100scn_tilemap_draw(device_t *device, bitmap_t *bitmap, const rectangle &cliprect, int layer, int flags, UINT32 priority); | |
| 243 | 243 | |
| 244 | 244 | /* returns 0 or 1 depending on the lowest priority tilemap set in the internal |
| 245 | 245 | register. Use this function to draw tilemaps in the correct order. */ |
| r13798 | r13799 | |
| 251 | 251 | WRITE16_DEVICE_HANDLER( tc0280grd_word_w ); |
| 252 | 252 | WRITE16_DEVICE_HANDLER( tc0280grd_ctrl_word_w ); |
| 253 | 253 | void tc0280grd_tilemap_update(device_t *device, int base_color); |
| 254 | void tc0280grd_zoom_draw(device_t *device, bitmap_t *bitmap, const rectangle | |
| 254 | void tc0280grd_zoom_draw(device_t *device, bitmap_t *bitmap, const rectangle &cliprect, int xoffset, int yoffset, UINT32 priority); | |
| 255 | 255 | |
| 256 | 256 | READ16_DEVICE_HANDLER( tc0430grw_word_r ); |
| 257 | 257 | WRITE16_DEVICE_HANDLER( tc0430grw_word_w ); |
| 258 | 258 | WRITE16_DEVICE_HANDLER( tc0430grw_ctrl_word_w ); |
| 259 | 259 | void tc0430grw_tilemap_update(device_t *device, int base_color); |
| 260 | void tc0430grw_zoom_draw(device_t *device, bitmap_t *bitmap, const rectangle | |
| 260 | void tc0430grw_zoom_draw(device_t *device, bitmap_t *bitmap, const rectangle &cliprect, int xoffset, int yoffset, UINT32 priority); | |
| 261 | 261 | |
| 262 | 262 | |
| 263 | 263 | /** TC0360PRI **/ |
| r13798 | r13799 | |
| 282 | 282 | WRITE32_DEVICE_HANDLER( tc0480scp_ctrl_long_w ); |
| 283 | 283 | |
| 284 | 284 | void tc0480scp_tilemap_update(device_t *device); |
| 285 | void tc0480scp_tilemap_draw(device_t *device, bitmap_t *bitmap, const rectangle | |
| 285 | void tc0480scp_tilemap_draw(device_t *device, bitmap_t *bitmap, const rectangle &cliprect, int layer, int flags, UINT32 priority); | |
| 286 | 286 | |
| 287 | 287 | /* Returns the priority order of the bg tilemaps set in the internal |
| 288 | 288 | register. The order in which the four layers should be drawn is |
| r13798 | r13799 | |
| 296 | 296 | /** TC0150ROD **/ |
| 297 | 297 | READ16_DEVICE_HANDLER( tc0150rod_word_r ); |
| 298 | 298 | WRITE16_DEVICE_HANDLER( tc0150rod_word_w ); |
| 299 | void tc0150rod_draw(device_t *device, bitmap_t *bitmap, const rectangle | |
| 299 | void 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); | |
| 300 | 300 | |
| 301 | 301 | |
| 302 | 302 | /** TC0110PCR **/ |
| r13798 | r13799 | |
| 317 | 317 | WRITE16_DEVICE_HANDLER( tc0180vcu_scroll_w ); |
| 318 | 318 | READ16_DEVICE_HANDLER( tc0180vcu_word_r ); |
| 319 | 319 | WRITE16_DEVICE_HANDLER( tc0180vcu_word_w ); |
| 320 | void tc0180vcu_tilemap_draw(device_t *device, bitmap_t *bitmap, const rectangle | |
| 320 | void tc0180vcu_tilemap_draw(device_t *device, bitmap_t *bitmap, const rectangle &cliprect, int tmap_num, int plane); |
| r13798 | r13799 | |
|---|---|---|
| 270 | 270 | * |
| 271 | 271 | *************************************/ |
| 272 | 272 | |
| 273 | static void nova2001_draw_sprites(running_machine &machine, bitmap_t *bitmap, const rectangle | |
| 273 | static void nova2001_draw_sprites(running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect ) | |
| 274 | 274 | { |
| 275 | 275 | nova2001_state *state = machine.driver_data<nova2001_state>(); |
| 276 | 276 | UINT8 *spriteram = state->m_spriteram; |
| r13798 | r13799 | |
| 308 | 308 | } |
| 309 | 309 | } |
| 310 | 310 | |
| 311 | static void pkunwar_draw_sprites(running_machine &machine, bitmap_t *bitmap, const rectangle | |
| 311 | static void pkunwar_draw_sprites(running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect ) | |
| 312 | 312 | { |
| 313 | 313 | nova2001_state *state = machine.driver_data<nova2001_state>(); |
| 314 | 314 | UINT8 *spriteram = state->m_spriteram; |
| r13798 | r13799 | |
|---|---|---|
| 2298 | 2298 | } |
| 2299 | 2299 | |
| 2300 | 2300 | |
| 2301 | static void cps1_render_sprites( running_machine &machine, bitmap_t *bitmap, const rectangle | |
| 2301 | static void cps1_render_sprites( running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect ) | |
| 2302 | 2302 | { |
| 2303 | 2303 | cps_state *state = machine.driver_data<cps_state>(); |
| 2304 | 2304 | |
| r13798 | r13799 | |
| 2541 | 2541 | state->m_cps2_last_sprite_offset = state->m_cps2_obj_size / 2 - 4; |
| 2542 | 2542 | } |
| 2543 | 2543 | |
| 2544 | static void cps2_render_sprites( running_machine &machine, bitmap_t *bitmap, const rectangle | |
| 2544 | static void cps2_render_sprites( running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect, int *primasks ) | |
| 2545 | 2545 | { |
| 2546 | 2546 | cps_state *state = machine.driver_data<cps_state>(); |
| 2547 | 2547 | |
| r13798 | r13799 | |
| 2690 | 2690 | |
| 2691 | 2691 | |
| 2692 | 2692 | |
| 2693 | static void cps1_render_stars( screen_device &screen, bitmap_t *bitmap, const rectangle | |
| 2693 | static void cps1_render_stars( screen_device &screen, bitmap_t *bitmap, const rectangle &cliprect ) | |
| 2694 | 2694 | { |
| 2695 | 2695 | cps_state *state = screen.machine().driver_data<cps_state>(); |
| 2696 | 2696 | int offs; |
| r13798 | r13799 | |
| 2723 | 2723 | |
| 2724 | 2724 | col = ((col & 0xe0) >> 1) + (screen.frame_number() / 16 & 0x0f); |
| 2725 | 2725 | |
| 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) | |
| 2728 | 2728 | bitmap->pix16(sy, sx) = 0xa00 + col; |
| 2729 | 2729 | } |
| 2730 | 2730 | } |
| r13798 | r13799 | |
| 2749 | 2749 | |
| 2750 | 2750 | col = ((col & 0xe0) >> 1) + (screen.frame_number() / 16 & 0x0f); |
| 2751 | 2751 | |
| 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) | |
| 2754 | 2754 | bitmap->pix16(sy, sx) = 0x800 + col; |
| 2755 | 2755 | } |
| 2756 | 2756 | } |
| r13798 | r13799 | |
| 2758 | 2758 | } |
| 2759 | 2759 | |
| 2760 | 2760 | |
| 2761 | static void cps1_render_layer( running_machine &machine, bitmap_t *bitmap, const rectangle | |
| 2761 | static void cps1_render_layer( running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect, int layer, int primask ) | |
| 2762 | 2762 | { |
| 2763 | 2763 | cps_state *state = machine.driver_data<cps_state>(); |
| 2764 | 2764 | switch (layer) |
| r13798 | r13799 | |
| 2774 | 2774 | } |
| 2775 | 2775 | } |
| 2776 | 2776 | |
| 2777 | static void cps1_render_high_layer( running_machine &machine, bitmap_t *bitmap, const rectangle | |
| 2777 | static void cps1_render_high_layer( running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect, int layer ) | |
| 2778 | 2778 | { |
| 2779 | 2779 | cps_state *state = machine.driver_data<cps_state>(); |
| 2780 | 2780 | switch (layer) |
| r13798 | r13799 | |
| 2851 | 2851 | { |
| 2852 | 2852 | // CPS1 games use pen 0xbff as background color; this is used in 3wonders, |
| 2853 | 2853 | // mtwins (explosion during attract), mercs (intermission). |
| 2854 | bitmap->fill(0xbff, | |
| 2854 | bitmap->fill(0xbff, | |
| 2855 | 2855 | } |
| 2856 | 2856 | else |
| 2857 | 2857 | { |
| r13798 | r13799 | |
| 2860 | 2860 | // Maybe Capcom changed the background handling due to the problems that |
| 2861 | 2861 | // it caused on several monitors (because the background extended into the |
| 2862 | 2862 | // blanking area instead of going black, causing the monitor to clip). |
| 2863 | bitmap->fill(get_black_pen(screen.machine()), | |
| 2863 | bitmap->fill(get_black_pen(screen.machine()), | |
| 2864 | 2864 | } |
| 2865 | 2865 | |
| 2866 | 2866 | cps1_render_stars(screen, bitmap, cliprect); |
| r13798 | r13799 | |
| 2870 | 2870 | l1 = (layercontrol >> 0x08) & 03; |
| 2871 | 2871 | l2 = (layercontrol >> 0x0a) & 03; |
| 2872 | 2872 | l3 = (layercontrol >> 0x0c) & 03; |
| 2873 | screen.machine().priority_bitmap->fill(0, | |
| 2873 | screen.machine().priority_bitmap->fill(0, | |
| 2874 | 2874 | |
| 2875 | 2875 | if (state->m_cps_version == 1) |
| 2876 | 2876 | { |
| r13798 | r13799 | |
|---|---|---|
| 184 | 184 | |
| 185 | 185 | /* Draw ship 1 */ |
| 186 | 186 | drawgfx_opaque(state->m_ship1_vid, |
| 187 | | |
| 187 | | |
| 188 | 188 | machine.gfx[8+((state->m_s1_sprite&0x04)>>2)], |
| 189 | 189 | (state->m_s1_sprite&0x03)^0x03, |
| 190 | 190 | 0, |
| r13798 | r13799 | |
| 193 | 193 | |
| 194 | 194 | /* Draw ship 2 */ |
| 195 | 195 | drawgfx_opaque(state->m_ship2_vid, |
| 196 | | |
| 196 | | |
| 197 | 197 | machine.gfx[10+((state->m_s2_sprite&0x04)>>2)], |
| 198 | 198 | (state->m_s2_sprite&0x03)^0x03, |
| 199 | 199 | 0, |
| r13798 | r13799 | |
| 241 | 241 | { |
| 242 | 242 | /* Draw score/projectile 1 */ |
| 243 | 243 | drawgfx_opaque(state->m_proj1_vid, |
| 244 | | |
| 244 | | |
| 245 | 245 | machine.gfx[(state->m_p1_sprite&0x0c)>>2], |
| 246 | 246 | (state->m_p1_sprite&0x03)^0x03, |
| 247 | 247 | 0, |
| r13798 | r13799 | |
| 253 | 253 | { |
| 254 | 254 | /* Draw score/projectile 2 */ |
| 255 | 255 | drawgfx_opaque(state->m_proj2_vid, |
| 256 | | |
| 256 | | |
| 257 | 257 | machine.gfx[4+((state->m_p2_sprite&0x0c)>>2)], |
| 258 | 258 | (state->m_p2_sprite&0x03)^0x03, |
| 259 | 259 | 0, |
| r13798 | r13799 | |
| 301 | 301 | |
| 302 | 302 | /* Draw ship 1 */ |
| 303 | 303 | drawgfx_opaque(state->m_ship1_vid, |
| 304 | | |
| 304 | | |
| 305 | 305 | machine.gfx[8+((state->m_s1_sprite&0x04)>>2)], |
| 306 | 306 | (state->m_s1_sprite&0x03)^0x03, |
| 307 | 307 | 0, |
| r13798 | r13799 | |
| 312 | 312 | { |
| 313 | 313 | /* Draw projectile 1 */ |
| 314 | 314 | drawgfx_opaque(state->m_proj1_vid, |
| 315 | | |
| 315 | | |
| 316 | 316 | machine.gfx[(state->m_p1_sprite&0x0c)>>2], |
| 317 | 317 | (state->m_p1_sprite&0x03)^0x03, |
| 318 | 318 | 0, |
| r13798 | r13799 | |
| 324 | 324 | { |
| 325 | 325 | /* Draw projectile 2 */ |
| 326 | 326 | drawgfx_opaque(state->m_proj2_vid, |
| 327 | | |
| 327 | | |
| 328 | 328 | machine.gfx[4+((state->m_p2_sprite&0x0c)>>2)], |
| 329 | 329 | (state->m_p2_sprite&0x03)^0x03, |
| 330 | 330 | 0, |
| r13798 | r13799 | |
| 378 | 378 | |
| 379 | 379 | /* Draw ship 2 */ |
| 380 | 380 | drawgfx_opaque(state->m_ship2_vid, |
| 381 | | |
| 381 | | |
| 382 | 382 | machine.gfx[10+((state->m_s2_sprite&0x04)>>2)], |
| 383 | 383 | (state->m_s2_sprite&0x03)^0x03, |
| 384 | 384 | 0, |
| r13798 | r13799 | |
| 389 | 389 | { |
| 390 | 390 | /* Draw projectile 1 */ |
| 391 | 391 | drawgfx_opaque(state->m_proj1_vid, |
| 392 | | |
| 392 | | |
| 393 | 393 | machine.gfx[(state->m_p1_sprite&0x0c)>>2], |
| 394 | 394 | (state->m_p1_sprite&0x03)^0x03, |
| 395 | 395 | 0, |
| r13798 | r13799 | |
| 401 | 401 | { |
| 402 | 402 | /* Draw projectile 2 */ |
| 403 | 403 | drawgfx_opaque(state->m_proj2_vid, |
| 404 | | |
| 404 | | |
| 405 | 405 | machine.gfx[4+((state->m_p2_sprite&0x0c)>>2)], |
| 406 | 406 | (state->m_p2_sprite&0x03)^0x03, |
| 407 | 407 | 0, |
| r13798 | r13799 | |
| 429 | 429 | { |
| 430 | 430 | starcrus_state *state = screen.machine().driver_data<starcrus_state>(); |
| 431 | 431 | |
| 432 | bitmap->fill(0, | |
| 432 | bitmap->fill(0, | |
| 433 | 433 | |
| 434 | 434 | /* Draw ship 1 */ |
| 435 | 435 | drawgfx_transpen(bitmap, |
| r13798 | r13799 | |
| 472 | 472 | 0); |
| 473 | 473 | |
| 474 | 474 | /* Collision detection */ |
| 475 | if (cliprect | |
| 475 | if (cliprect. | |
| 476 | 476 | { |
| 477 | 477 | state->m_collision_reg = 0x00; |
| 478 | 478 |
| r13798 | r13799 | |
|---|---|---|
| 136 | 136 | |
| 137 | 137 | ***************************************************************************/ |
| 138 | 138 | |
| 139 | static void draw_sprites( running_machine &machine, bitmap_t *bitmap, const rectangle | |
| 139 | static void draw_sprites( running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect ) | |
| 140 | 140 | { |
| 141 | 141 | yunsun16_state *state = machine.driver_data<yunsun16_state>(); |
| 142 | 142 | int offs; |
| r13798 | r13799 | |
| 212 | 212 | |
| 213 | 213 | //popmessage("%04X", *state->m_priorityram); |
| 214 | 214 | |
| 215 | screen.machine().priority_bitmap->fill(0, | |
| 215 | screen.machine().priority_bitmap->fill(0, | |
| 216 | 216 | |
| 217 | 217 | if ((*state->m_priorityram & 0x0c) == 4) |
| 218 | 218 | { |
| r13798 | r13799 | |
|---|---|---|
| 97 | 97 | state->m_flipy = data; |
| 98 | 98 | } |
| 99 | 99 | |
| 100 | static void draw_background(running_machine &machine, bitmap_t *bitmap, const rectangle | |
| 100 | static void draw_background(running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect, int bank, int colortype) | |
| 101 | 101 | { |
| 102 | 102 | wiz_state *state = machine.driver_data<wiz_state>(); |
| 103 | 103 | UINT8 *videoram = state->m_videoram; |
| r13798 | r13799 | |
| 138 | 138 | } |
| 139 | 139 | } |
| 140 | 140 | |
| 141 | static void draw_foreground(running_machine &machine, bitmap_t *bitmap, const rectangle | |
| 141 | static void draw_foreground(running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect, int colortype) | |
| 142 | 142 | { |
| 143 | 143 | wiz_state *state = machine.driver_data<wiz_state>(); |
| 144 | 144 | int offs; |
| r13798 | r13799 | |
| 178 | 178 | } |
| 179 | 179 | |
| 180 | 180 | static void draw_sprites(running_machine &machine, bitmap_t *bitmap, |
| 181 | const rectangle | |
| 181 | const rectangle &cliprect, UINT8* sprite_ram, | |
| 182 | 182 | int bank) |
| 183 | 183 | { |
| 184 | 184 | wiz_state *state = machine.driver_data<wiz_state>(); |
| r13798 | r13799 | |
| 209 | 209 | SCREEN_UPDATE( kungfut ) |
| 210 | 210 | { |
| 211 | 211 | wiz_state *state = screen.machine().driver_data<wiz_state>(); |
| 212 | bitmap->fill(state->m_bgpen, | |
| 212 | bitmap->fill(state->m_bgpen, | |
| 213 | 213 | draw_background(screen.machine(), bitmap, cliprect, 2 + state->m_char_bank[0] , 0); |
| 214 | 214 | draw_foreground(screen.machine(), bitmap, cliprect, 0); |
| 215 | 215 | draw_sprites(screen.machine(), bitmap, cliprect, state->m_spriteram2, 4); |
| r13798 | r13799 | |
| 221 | 221 | { |
| 222 | 222 | wiz_state *state = screen.machine().driver_data<wiz_state>(); |
| 223 | 223 | int bank; |
| 224 | const rectangle* visible_area; | |
| 225 | 224 | |
| 226 | bitmap->fill(state->m_bgpen, | |
| 225 | bitmap->fill(state->m_bgpen, | |
| 227 | 226 | draw_background(screen.machine(), bitmap, cliprect, 2 + ((state->m_char_bank[0] << 1) | state->m_char_bank[1]), 0); |
| 228 | 227 | draw_foreground(screen.machine(), bitmap, cliprect, 0); |
| 229 | 228 | |
| 230 | 229 | const rectangle spritevisiblearea(2*8, 32*8-1, 2*8, 30*8-1); |
| 231 | 230 | const rectangle spritevisibleareaflipx(0*8, 30*8-1, 2*8, 30*8-1); |
| 232 | visible_area = state->m_flipx ? | |
| 231 | const rectangle &visible_area = state->m_flipx ? | |
| 233 | 232 | |
| 234 | 233 | bank = 7 + *state->m_sprite_bank; |
| 235 | 234 | |
| r13798 | r13799 | |
| 242 | 241 | SCREEN_UPDATE( stinger ) |
| 243 | 242 | { |
| 244 | 243 | wiz_state *state = screen.machine().driver_data<wiz_state>(); |
| 245 | bitmap->fill(state->m_bgpen, | |
| 244 | bitmap->fill(state->m_bgpen, | |
| 246 | 245 | draw_background(screen.machine(), bitmap, cliprect, 2 + state->m_char_bank[0], 1); |
| 247 | 246 | draw_foreground(screen.machine(), bitmap, cliprect, 1); |
| 248 | 247 | draw_sprites(screen.machine(), bitmap, cliprect, state->m_spriteram2, 4); |
| r13798 | r13799 | |
|---|---|---|
| 236 | 236 | } |
| 237 | 237 | |
| 238 | 238 | |
| 239 | static void draw_background(stactics_state *state, bitmap_t *bitmap, const rectangle | |
| 239 | static void draw_background(stactics_state *state, bitmap_t *bitmap, const rectangle &cliprect) | |
| 240 | 240 | { |
| 241 | 241 | int y; |
| 242 | 242 | |
| 243 | bitmap->fill(0, | |
| 243 | bitmap->fill(0, | |
| 244 | 244 | |
| 245 | 245 | /* for every row */ |
| 246 | 246 | for (y = 0; y < 0x100; y++) |
| r13798 | r13799 | |
|---|---|---|
| 188 | 188 | state->m_helper2 = machine.primary_screen->alloc_compatible_bitmap(); |
| 189 | 189 | } |
| 190 | 190 | |
| 191 | static void draw_sprites( running_machine &machine, bitmap_t *bitmap, const rectangle | |
| 191 | static void draw_sprites( running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect ) | |
| 192 | 192 | { |
| 193 | 193 | const rectangle spritevisiblearea(0 * 8, 26 * 8 - 1, 2 * 8, 30 * 8 - 1); |
| 194 | 194 | const rectangle flip_spritevisiblearea(6 * 8, 31 * 8 - 1, 2 * 8, 30 * 8 - 1); |
| r13798 | r13799 | |
| 225 | 225 | sy = 240 - sy; |
| 226 | 226 | } |
| 227 | 227 | |
| 228 | drawgfx_transpen(bitmap, (flip_screen_x_get(machine) ? | |
| 228 | drawgfx_transpen(bitmap, (flip_screen_x_get(machine) ? | |
| 229 | 229 | machine.gfx[1], code, color, flipx, flipy, sx, sy, 0); |
| 230 | 230 | } |
| 231 | 231 | } |
| r13798 | r13799 | |
| 240 | 240 | return 0; |
| 241 | 241 | } |
| 242 | 242 | |
| 243 | static UINT8 collision_check( running_machine &machine, rectangle | |
| 243 | static UINT8 collision_check( running_machine &machine, rectangle& rect ) | |
| 244 | 244 | { |
| 245 | 245 | mermaid_state *state = machine.driver_data<mermaid_state>(); |
| 246 | 246 | UINT8 data = 0; |
| r13798 | r13799 | |
| 248 | 248 | int x; |
| 249 | 249 | int y; |
| 250 | 250 | |
| 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++) | |
| 253 | 253 | { |
| 254 | 254 | UINT16 a = colortable_entry_get_value(machine.colortable, state->m_helper->pix16(y, x)) & 0x3f; |
| 255 | 255 | UINT16 b = colortable_entry_get_value(machine.colortable, state->m_helper2->pix16(y, x)) & 0x3f; |
| r13798 | r13799 | |
| 327 | 327 | state->m_helper->fill(0, rect); |
| 328 | 328 | state->m_helper2->fill(0, rect); |
| 329 | 329 | |
| 330 | tilemap_draw(state->m_helper, | |
| 330 | tilemap_draw(state->m_helper, | |
| 331 | 331 | |
| 332 | drawgfx_transpen(state->m_helper2, | |
| 332 | drawgfx_transpen(state->m_helper2, | |
| 333 | 333 | |
| 334 | state->m_coll_bit2 |= collision_check(screen.machine(), | |
| 334 | state->m_coll_bit2 |= collision_check(screen.machine(), | |
| 335 | 335 | |
| 336 | 336 | // check collision sprite - foreground |
| 337 | 337 | |
| 338 | 338 | state->m_helper->fill(0, rect); |
| 339 | 339 | state->m_helper2->fill(0, rect); |
| 340 | 340 | |
| 341 | tilemap_draw(state->m_helper, | |
| 341 | tilemap_draw(state->m_helper, | |
| 342 | 342 | |
| 343 | drawgfx_transpen(state->m_helper2, | |
| 343 | drawgfx_transpen(state->m_helper2, | |
| 344 | 344 | |
| 345 | state->m_coll_bit1 |= collision_check(screen.machine(), | |
| 345 | state->m_coll_bit1 |= collision_check(screen.machine(), | |
| 346 | 346 | |
| 347 | 347 | // check collision sprite - sprite |
| 348 | 348 | |
| r13798 | r13799 | |
| 378 | 378 | sy2 = 240 - sy2; |
| 379 | 379 | } |
| 380 | 380 | |
| 381 | drawgfx_transpen(state->m_helper, | |
| 381 | drawgfx_transpen(state->m_helper, | |
| 382 | 382 | } |
| 383 | 383 | |
| 384 | drawgfx_transpen(state->m_helper2, | |
| 384 | drawgfx_transpen(state->m_helper2, | |
| 385 | 385 | |
| 386 | state->m_coll_bit0 |= collision_check(screen.machine(), | |
| 386 | state->m_coll_bit0 |= collision_check(screen.machine(), | |
| 387 | 387 | } |
| 388 | 388 | |
| 389 | 389 | // check for bit 3 (sprite-sprite) |
| r13798 | r13799 | |
| 466 | 466 | sy2 = 240 - sy2; |
| 467 | 467 | } |
| 468 | 468 | |
| 469 | drawgfx_transpen(state->m_helper, | |
| 469 | drawgfx_transpen(state->m_helper, | |
| 470 | 470 | } |
| 471 | 471 | |
| 472 | drawgfx_transpen(state->m_helper2, | |
| 472 | drawgfx_transpen(state->m_helper2, | |
| 473 | 473 | |
| 474 | state->m_coll_bit3 |= collision_check(screen.machine(), | |
| 474 | state->m_coll_bit3 |= collision_check(screen.machine(), | |
| 475 | 475 | } |
| 476 | 476 | |
| 477 | 477 | // check for bit 6 |
| r13798 | r13799 | |
| 554 | 554 | sy2 = 240 - sy2; |
| 555 | 555 | } |
| 556 | 556 | |
| 557 | drawgfx_transpen(state->m_helper, | |
| 557 | drawgfx_transpen(state->m_helper, | |
| 558 | 558 | } |
| 559 | 559 | |
| 560 | drawgfx_transpen(state->m_helper2, | |
| 560 | drawgfx_transpen(state->m_helper2, | |
| 561 | 561 | |
| 562 | state->m_coll_bit6 |= collision_check(screen.machine(), | |
| 562 | state->m_coll_bit6 |= collision_check(screen.machine(), | |
| 563 | 563 | } |
| 564 | 564 | |
| 565 | 565 | } |
| r13798 | r13799 | |
|---|---|---|
| 459 | 459 | if (screen.machine().input().code_pressed(KEYCODE_DOWN) && yv < 0x40000) |
| 460 | 460 | yv += 4; |
| 461 | 461 | |
| 462 | for (y = cliprect | |
| 462 | for (y = cliprect. | |
| 463 | 463 | { |
| 464 | 464 | UINT16 *dest = &bitmap->pix16(y); |
| 465 | for (x = cliprect | |
| 465 | for (x = cliprect. | |
| 466 | 466 | { |
| 467 | int offs = (yv + y - cliprect | |
| 467 | int offs = (yv + y - cliprect. | |
| 468 | 468 | if (offs < length) |
| 469 | 469 | dest[x] = base[offs]; |
| 470 | 470 | else |
| r13798 | r13799 | |
|---|---|---|
| 151 | 151 | state->m_gfx_bank_select = 0; |
| 152 | 152 | } |
| 153 | 153 | |
| 154 | static void draw_sprites(running_machine& machine, bitmap_t *bitmap,const rectangle | |
| 154 | static void draw_sprites(running_machine& machine, bitmap_t *bitmap,const rectangle &cliprect) | |
| 155 | 155 | { |
| 156 | 156 | dcon_state *state = machine.driver_data<dcon_state>(); |
| 157 | 157 | UINT16 *spriteram16 = state->m_spriteram; |
| r13798 | r13799 | |
| 280 | 280 | SCREEN_UPDATE( dcon ) |
| 281 | 281 | { |
| 282 | 282 | dcon_state *state = screen.machine().driver_data<dcon_state>(); |
| 283 | screen.machine().priority_bitmap->fill(0, | |
| 283 | screen.machine().priority_bitmap->fill(0, | |
| 284 | 284 | |
| 285 | 285 | /* Setup the tilemaps */ |
| 286 | 286 | tilemap_set_scrollx( state->m_background_layer,0, state->m_scroll_ram[0] ); |
| r13798 | r13799 | |
| 293 | 293 | if ((state->m_enable&1)!=1) |
| 294 | 294 | tilemap_draw(bitmap,cliprect,state->m_background_layer,0,0); |
| 295 | 295 | else |
| 296 | bitmap->fill(15, | |
| 296 | bitmap->fill(15, | |
| 297 | 297 | |
| 298 | 298 | tilemap_draw(bitmap,cliprect,state->m_midground_layer,0,1); |
| 299 | 299 | tilemap_draw(bitmap,cliprect,state->m_foreground_layer,0,2); |
| r13798 | r13799 | |
| 307 | 307 | { |
| 308 | 308 | dcon_state *state = screen.machine().driver_data<dcon_state>(); |
| 309 | 309 | |
| 310 | screen.machine().priority_bitmap->fill(0, | |
| 310 | screen.machine().priority_bitmap->fill(0, | |
| 311 | 311 | |
| 312 | 312 | /* Gfx banking */ |
| 313 | 313 | if (state->m_last_gfx_bank!=state->m_gfx_bank_select) |
| r13798 | r13799 | |
| 329 | 329 | if ((state->m_enable&1)!=1) |
| 330 | 330 | tilemap_draw(bitmap,cliprect,state->m_background_layer,0,0); |
| 331 | 331 | else |
| 332 | bitmap->fill(15, | |
| 332 | bitmap->fill(15, | |
| 333 | 333 | |
| 334 | 334 | tilemap_draw(bitmap,cliprect,state->m_midground_layer,0,1); |
| 335 | 335 | tilemap_draw(bitmap,cliprect,state->m_foreground_layer,0,2); |
| r13798 | r13799 | |
|---|---|---|
| 92 | 92 | |
| 93 | 93 | |
| 94 | 94 | |
| 95 | static void kickgoal_draw_sprites( running_machine &machine, bitmap_t *bitmap,const rectangle | |
| 95 | static void kickgoal_draw_sprites( running_machine &machine, bitmap_t *bitmap,const rectangle &cliprect ) | |
| 96 | 96 | { |
| 97 | 97 | kickgoal_state *state = machine.driver_data<kickgoal_state>(); |
| 98 | 98 | UINT16 *spriteram = state->m_spriteram; |
| r13798 | r13799 | |
| 225 | 225 | } |
| 226 | 226 | |
| 227 | 227 | |
| 228 | static void actionhw_draw_sprites(running_machine &machine, bitmap_t *bitmap,const rectangle | |
| 228 | static void actionhw_draw_sprites(running_machine &machine, bitmap_t *bitmap,const rectangle &cliprect) | |
| 229 | 229 | { |
| 230 | 230 | kickgoal_state *state = machine.driver_data<kickgoal_state>(); |
| 231 | 231 | UINT16 *spriteram = state->m_spriteram; |
| r13798 | r13799 | |
|---|---|---|
| 622 | 622 | /* if we're blanked, just fill with black */ |
| 623 | 623 | if (tms_state.blanked) |
| 624 | 624 | { |
| 625 | bitmap->fill(get_black_pen(screen.machine()), | |
| 625 | bitmap->fill(get_black_pen(screen.machine()), | |
| 626 | 626 | return 0; |
| 627 | 627 | } |
| 628 | 628 | |
| r13798 | r13799 | |
| 630 | 630 | /* top layer @ 0x00000 is only 4bpp, colors come from the first 16 palettes */ |
| 631 | 631 | /* bottom layer @ 0x20000 is full 8bpp */ |
| 632 | 632 | page_offset = tms_state.dispstart & 0x0ffff; |
| 633 | for (y = cliprect | |
| 633 | for (y = cliprect. | |
| 634 | 634 | { |
| 635 | 635 | UINT8 *base0 = &tms_state.vram[(0x00000 + page_offset + y * 256) & 0x3ffff]; |
| 636 | 636 | UINT8 *base2 = &tms_state.vram[(0x20000 + page_offset + y * 256) & 0x3ffff]; |
| 637 | 637 | UINT32 *dest = &bitmap->pix32(y); |
| 638 | 638 | |
| 639 | for (x = cliprect | |
| 639 | for (x = cliprect. | |
| 640 | 640 | { |
| 641 | 641 | int pix0 = base0[x] & 0x0f; |
| 642 | 642 | dest[x] = pens[pix0 ? pix0 : base2[x]]; |
| r13798 | r13799 | |
| 659 | 659 | /* if we're blanked, just fill with black */ |
| 660 | 660 | if (tms_state.blanked) |
| 661 | 661 | { |
| 662 | bitmap->fill(get_black_pen(screen.machine()), | |
| 662 | bitmap->fill(get_black_pen(screen.machine()), | |
| 663 | 663 | return 0; |
| 664 | 664 | } |
| 665 | 665 | |
| r13798 | r13799 | |
| 669 | 669 | /* 4bpp pixels are packed 2 to a byte */ |
| 670 | 670 | /* xscroll is set via a separate register */ |
| 671 | 671 | page_offset = (tms_state.dispstart & 0x0ffff) | state->m_grmatch_xscroll; |
| 672 | for (y = cliprect | |
| 672 | for (y = cliprect. | |
| 673 | 673 | { |
| 674 | 674 | UINT8 *base0 = &tms_state.vram[0x00000 + ((page_offset + y * 256) & 0xffff)]; |
| 675 | 675 | UINT8 *base2 = &tms_state.vram[0x20000 + ((page_offset + y * 256) & 0xffff)]; |
| 676 | 676 | UINT32 *dest = &bitmap->pix32(y); |
| 677 | 677 | |
| 678 | for (x = cliprect | |
| 678 | for (x = cliprect. | |
| 679 | 679 | { |
| 680 | 680 | UINT8 pix0 = base0[x / 2]; |
| 681 | 681 | UINT8 pix2 = base2[x / 2]; |
| r13798 | r13799 | |
| 709 | 709 | /* if we're blanked, just fill with black */ |
| 710 | 710 | if (tms_state.blanked) |
| 711 | 711 | { |
| 712 | bitmap->fill(get_black_pen(screen.machine()), | |
| 712 | bitmap->fill(get_black_pen(screen.machine()), | |
| 713 | 713 | return 0; |
| 714 | 714 | } |
| 715 | 715 | |
| 716 | 716 | /* there are two pages, each of which is a full 8bpp */ |
| 717 | 717 | /* page index is selected by the top bit of the page_select register */ |
| 718 | 718 | page_offset = ((state->m_page_select & 0x80) << 10) | (tms_state.dispstart & 0x0ffff); |
| 719 | for (y = cliprect | |
| 719 | for (y = cliprect. | |
| 720 | 720 | { |
| 721 | 721 | UINT8 *base = &tms_state.vram[(page_offset + y * 256) & 0x3ffff]; |
| 722 | 722 | UINT32 *dest = &bitmap->pix32(y); |
| 723 | 723 | |
| 724 | for (x = cliprect | |
| 724 | for (x = cliprect. | |
| 725 | 725 | dest[x] = pens[base[x]]; |
| 726 | 726 | } |
| 727 | 727 | return 0; |
| r13798 | r13799 | |
| 742 | 742 | /* if we're blanked, just fill with black */ |
| 743 | 743 | if (tms_state.blanked) |
| 744 | 744 | { |
| 745 | bitmap->fill(get_black_pen(screen.machine()), | |
| 745 | bitmap->fill(get_black_pen(screen.machine()), | |
| 746 | 746 | return 0; |
| 747 | 747 | } |
| 748 | 748 | |
| r13798 | r13799 | |
| 751 | 751 | /* the upper 4 bits were latched on each write into a separate bitmap */ |
| 752 | 752 | /* page index is selected by the top bit of the page_select register */ |
| 753 | 753 | page_offset = ((~state->m_page_select & 0x80) << 10) | (tms_state.dispstart & 0x0ffff); |
| 754 | for (y = cliprect | |
| 754 | for (y = cliprect. | |
| 755 | 755 | { |
| 756 | 756 | UINT8 *base = &tms_state.vram[(page_offset + y * 256) & 0x3ffff]; |
| 757 | 757 | UINT8 *latch = &tms_state.latchram[(page_offset + y * 256) & 0x3ffff]; |
| 758 | 758 | UINT32 *dest = &bitmap->pix32(y); |
| 759 | 759 | |
| 760 | for (x = cliprect | |
| 760 | for (x = cliprect. | |
| 761 | 761 | { |
| 762 | 762 | dest[x + 0] = pens[(latch[x/2] & 0xf0) | (base[x/2] >> 4)]; |
| 763 | 763 | dest[x + 1] = pens[((latch[x/2] << 4) & 0xf0) | (base[x/2] & 0x0f)]; |
| r13798 | r13799 | |
|---|---|---|
| 237 | 237 | static void state_save_register(running_machine &machine); |
| 238 | 238 | static TILE_GET_INFO( bg_get_tile_info ); |
| 239 | 239 | |
| 240 | static void sprites_draw(running_machine &machine, bitmap_t *bitmap, const rectangle | |
| 240 | static void sprites_draw(running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect, const UINT8 *spritebase); | |
| 241 | 241 | |
| 242 | 242 | static void stars_init(running_machine &machine); |
| 243 | 243 | static void stars_update_origin(running_machine &machine); |
| 244 | 244 | static void stars_draw_row(galaxian_state *state, bitmap_t *bitmap, int maxx, int y, UINT32 star_offs, UINT8 starmask); |
| 245 | 245 | |
| 246 | static void bullets_draw(running_machine &machine, bitmap_t *bitmap, const rectangle | |
| 246 | static void bullets_draw(running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect, const UINT8 *base); | |
| 247 | 247 | |
| 248 | 248 | |
| 249 | 249 | |
| r13798 | r13799 | |
| 561 | 561 | * |
| 562 | 562 | *************************************/ |
| 563 | 563 | |
| 564 | static void sprites_draw(running_machine &machine, bitmap_t *bitmap, const rectangle | |
| 564 | static void sprites_draw(running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect, const UINT8 *spritebase) | |
| 565 | 565 | { |
| 566 | 566 | galaxian_state *state = machine.driver_data<galaxian_state>(); |
| 567 | rectangle clip = | |
| 567 | rectangle clip = | |
| 568 | 568 | int sprnum; |
| 569 | 569 | |
| 570 | 570 | /* 16 of the 256 pixels of the sprites are hard-clipped at the line buffer */ |
| r13798 | r13799 | |
| 608 | 608 | } |
| 609 | 609 | |
| 610 | 610 | /* draw */ |
| 611 | drawgfx_transpen(bitmap, | |
| 611 | drawgfx_transpen(bitmap, | |
| 612 | 612 | machine.gfx[1], |
| 613 | 613 | code, color, |
| 614 | 614 | flipx, flipy, |
| r13798 | r13799 | |
| 624 | 624 | * |
| 625 | 625 | *************************************/ |
| 626 | 626 | |
| 627 | static void bullets_draw(running_machine &machine, bitmap_t *bitmap, const rectangle | |
| 627 | static void bullets_draw(running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect, const UINT8 *base) | |
| 628 | 628 | { |
| 629 | 629 | galaxian_state *state = machine.driver_data<galaxian_state>(); |
| 630 | 630 | int y; |
| 631 | 631 | |
| 632 | 632 | /* iterate over scanlines */ |
| 633 | for (y = cliprect | |
| 633 | for (y = cliprect. | |
| 634 | 634 | { |
| 635 | 635 | UINT8 shell = 0xff, missile = 0xff; |
| 636 | 636 | UINT8 effy; |
| r13798 | r13799 | |
| 939 | 939 | * |
| 940 | 940 | *************************************/ |
| 941 | 941 | |
| 942 | void galaxian_draw_background(running_machine &machine, bitmap_t *bitmap, const rectangle | |
| 942 | void galaxian_draw_background(running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect) | |
| 943 | 943 | { |
| 944 | 944 | galaxian_state *state = machine.driver_data<galaxian_state>(); |
| 945 | 945 | /* erase the background to black first */ |
| 946 | bitmap->fill(RGB_BLACK, | |
| 946 | bitmap->fill(RGB_BLACK, | |
| 947 | 947 | |
| 948 | 948 | /* update the star origin to the current frame */ |
| 949 | 949 | stars_update_origin(machine); |
| r13798 | r13799 | |
| 954 | 954 | int y; |
| 955 | 955 | |
| 956 | 956 | /* iterate over scanlines */ |
| 957 | for (y = cliprect | |
| 957 | for (y = cliprect. | |
| 958 | 958 | { |
| 959 | 959 | UINT32 star_offs = state->m_star_rng_origin + y * 512; |
| 960 | 960 | stars_draw_row(state, bitmap, 256, y, star_offs, 0xff); |
| r13798 | r13799 | |
| 963 | 963 | } |
| 964 | 964 | |
| 965 | 965 | |
| 966 | static void background_draw_colorsplit(running_machine &machine, bitmap_t *bitmap, const rectangle | |
| 966 | static void background_draw_colorsplit(running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect, rgb_t color, int split, int split_flipped) | |
| 967 | 967 | { |
| 968 | 968 | galaxian_state *state = machine.driver_data<galaxian_state>(); |
| 969 | 969 | /* horizontal bgcolor split */ |
| 970 | 970 | if (state->m_flipscreen_x) |
| 971 | 971 | { |
| 972 | rectangle draw = | |
| 972 | rectangle draw = | |
| 973 | 973 | draw.max_x = MIN(draw.max_x, split_flipped * GALAXIAN_XSCALE - 1); |
| 974 | 974 | if (draw.min_x <= draw.max_x) |
| 975 | 975 | bitmap->fill(RGB_BLACK, draw); |
| 976 | 976 | |
| 977 | draw = | |
| 977 | draw = | |
| 978 | 978 | draw.min_x = MAX(draw.min_x, split_flipped * GALAXIAN_XSCALE); |
| 979 | 979 | if (draw.min_x <= draw.max_x) |
| 980 | 980 | bitmap->fill(color, draw); |
| 981 | 981 | } |
| 982 | 982 | else |
| 983 | 983 | { |
| 984 | rectangle draw = | |
| 984 | rectangle draw = | |
| 985 | 985 | draw.max_x = MIN(draw.max_x, split * GALAXIAN_XSCALE - 1); |
| 986 | 986 | if (draw.min_x <= draw.max_x) |
| 987 | 987 | bitmap->fill(color, draw); |
| 988 | 988 | |
| 989 | draw = | |
| 989 | draw = | |
| 990 | 990 | draw.min_x = MAX(draw.min_x, split * GALAXIAN_XSCALE); |
| 991 | 991 | if (draw.min_x <= draw.max_x) |
| 992 | 992 | bitmap->fill(RGB_BLACK, draw); |
| r13798 | r13799 | |
| 994 | 994 | } |
| 995 | 995 | |
| 996 | 996 | |
| 997 | static void scramble_draw_stars(running_machine &machine, bitmap_t *bitmap, const rectangle | |
| 997 | static void scramble_draw_stars(running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect, int maxx) | |
| 998 | 998 | { |
| 999 | 999 | galaxian_state *state = machine.driver_data<galaxian_state>(); |
| 1000 | 1000 | /* update the star origin to the current frame */ |
| r13798 | r13799 | |
| 1007 | 1007 | int y; |
| 1008 | 1008 | |
| 1009 | 1009 | /* iterate over scanlines */ |
| 1010 | for (y = cliprect | |
| 1010 | for (y = cliprect. | |
| 1011 | 1011 | { |
| 1012 | 1012 | /* blink state 2 suppressed stars when 2V == 0 */ |
| 1013 | 1013 | if (blink_state != 2 || (y & 2) != 0) |
| r13798 | r13799 | |
| 1021 | 1021 | } |
| 1022 | 1022 | |
| 1023 | 1023 | |
| 1024 | void scramble_draw_background(running_machine &machine, bitmap_t *bitmap, const rectangle | |
| 1024 | void scramble_draw_background(running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect) | |
| 1025 | 1025 | { |
| 1026 | 1026 | galaxian_state *state = machine.driver_data<galaxian_state>(); |
| 1027 | 1027 | /* blue background - 390 ohm resistor */ |
| 1028 | bitmap->fill(state->m_background_enable ? MAKE_RGB(0,0,0x56) : RGB_BLACK, | |
| 1028 | bitmap->fill(state->m_background_enable ? MAKE_RGB(0,0,0x56) : RGB_BLACK, | |
| 1029 | 1029 | |
| 1030 | 1030 | scramble_draw_stars(machine, bitmap, cliprect, 256); |
| 1031 | 1031 | } |
| 1032 | 1032 | |
| 1033 | 1033 | |
| 1034 | void anteater_draw_background(running_machine &machine, bitmap_t *bitmap, const rectangle | |
| 1034 | void anteater_draw_background(running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect) | |
| 1035 | 1035 | { |
| 1036 | 1036 | galaxian_state *state = machine.driver_data<galaxian_state>(); |
| 1037 | 1037 | /* blue background, horizontal split as seen on flyer and real cabinet */ |
| r13798 | r13799 | |
| 1041 | 1041 | } |
| 1042 | 1042 | |
| 1043 | 1043 | |
| 1044 | void jumpbug_draw_background(running_machine &machine, bitmap_t *bitmap, const rectangle | |
| 1044 | void jumpbug_draw_background(running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect) | |
| 1045 | 1045 | { |
| 1046 | 1046 | galaxian_state *state = machine.driver_data<galaxian_state>(); |
| 1047 | 1047 | /* blue background - 390 ohm resistor */ |
| 1048 | bitmap->fill(state->m_background_enable ? MAKE_RGB(0,0,0x56) : RGB_BLACK, | |
| 1048 | bitmap->fill(state->m_background_enable ? MAKE_RGB(0,0,0x56) : RGB_BLACK, | |
| 1049 | 1049 | |
| 1050 | 1050 | /* render stars same as scramble but nothing in the status area */ |
| 1051 | 1051 | scramble_draw_stars(machine, bitmap, cliprect, 240); |
| 1052 | 1052 | } |
| 1053 | 1053 | |
| 1054 | 1054 | |
| 1055 | void turtles_draw_background(running_machine &machine, bitmap_t *bitmap, const rectangle | |
| 1055 | void turtles_draw_background(running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect) | |
| 1056 | 1056 | { |
| 1057 | 1057 | galaxian_state *state = machine.driver_data<galaxian_state>(); |
| 1058 | 1058 | /* |
| r13798 | r13799 | |
| 1062 | 1062 | GREEN - 470 ohm resistor |
| 1063 | 1063 | BLUE - 390 ohm resistor |
| 1064 | 1064 | */ |
| 1065 | bitmap->fill(MAKE_RGB(state->m_background_red * 0x55, state->m_background_green * 0x47, state->m_background_blue * 0x55), | |
| 1065 | bitmap->fill(MAKE_RGB(state->m_background_red * 0x55, state->m_background_green * 0x47, state->m_background_blue * 0x55), | |
| 1066 | 1066 | } |
| 1067 | 1067 | |
| 1068 | 1068 | |
| 1069 | void frogger_draw_background(running_machine &machine, bitmap_t *bitmap, const rectangle | |
| 1069 | void frogger_draw_background(running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect) | |
| 1070 | 1070 | { |
| 1071 | 1071 | /* color split point verified on real machine */ |
| 1072 | 1072 | /* hmmm, according to schematics it is at 128+8; which is right? */ |
| r13798 | r13799 | |
| 1075 | 1075 | |
| 1076 | 1076 | |
| 1077 | 1077 | #ifdef UNUSED_FUNCTION |
| 1078 | static int flip_and_clip(rectangle *draw, int xstart, int xend, const rectangle | |
| 1078 | static int flip_and_clip(rectangle *draw, int xstart, int xend, const rectangle &cliprect) | |
| 1079 | 1079 | { |
| 1080 | 1080 | galaxian_state *state = machine.driver_data<galaxian_state>(); |
| 1081 | *draw = | |
| 1081 | *draw = | |
| 1082 | 1082 | if (!state->m_flipscreen_x) |
| 1083 | 1083 | { |
| 1084 | 1084 | draw->min_x = xstart * GALAXIAN_XSCALE; |
| r13798 | r13799 | |
| 1093 | 1093 | return (draw->min_x <= draw->max_x); |
| 1094 | 1094 | } |
| 1095 | 1095 | |
| 1096 | void amidar_draw_background(running_machine &machine, bitmap_t *bitmap, const rectangle | |
| 1096 | void amidar_draw_background(running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect) | |
| 1097 | 1097 | { |
| 1098 | 1098 | galaxian_state *state = machine.driver_data<galaxian_state>(); |
| 1099 | 1099 | const UINT8 *prom = machine.region("user1")->base(); |
| r13798 | r13799 | |
| 1133 | 1133 | * |
| 1134 | 1134 | *************************************/ |
| 1135 | 1135 | |
| 1136 | INLINE void galaxian_draw_pixel(bitmap_t *bitmap, const rectangle | |
| 1136 | INLINE void galaxian_draw_pixel(bitmap_t *bitmap, const rectangle &cliprect, int y, int x, rgb_t color) | |
| 1137 | 1137 | { |
| 1138 | if (y >= cliprect | |
| 1138 | if (y >= cliprect. | |
| 1139 | 1139 | { |
| 1140 | 1140 | x *= GALAXIAN_XSCALE; |
| 1141 | 1141 | x += GALAXIAN_H0START; |
| 1142 | if (x >= cliprect | |
| 1142 | if (x >= cliprect. | |
| 1143 | 1143 | bitmap->pix32(y, x) = color; |
| 1144 | 1144 | |
| 1145 | 1145 | x++; |
| 1146 | if (x >= cliprect | |
| 1146 | if (x >= cliprect. | |
| 1147 | 1147 | bitmap->pix32(y, x) = color; |
| 1148 | 1148 | |
| 1149 | 1149 | x++; |
| 1150 | if (x >= cliprect | |
| 1150 | if (x >= cliprect. | |
| 1151 | 1151 | bitmap->pix32(y, x) = color; |
| 1152 | 1152 | } |
| 1153 | 1153 | } |
| 1154 | 1154 | |
| 1155 | 1155 | |
| 1156 | void galaxian_draw_bullet(running_machine &machine, bitmap_t *bitmap, const rectangle | |
| 1156 | void galaxian_draw_bullet(running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect, int offs, int x, int y) | |
| 1157 | 1157 | { |
| 1158 | 1158 | galaxian_state *state = machine.driver_data<galaxian_state>(); |
| 1159 | 1159 | /* |
| r13798 | r13799 | |
| 1170 | 1170 | } |
| 1171 | 1171 | |
| 1172 | 1172 | |
| 1173 | void mshuttle_draw_bullet(running_machine &machine, bitmap_t *bitmap, const rectangle | |
| 1173 | void mshuttle_draw_bullet(running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect, int offs, int x, int y) | |
| 1174 | 1174 | { |
| 1175 | 1175 | /* verified by schematics: |
| 1176 | 1176 | * both "W" and "Y" bullets are 4 pixels long |
| r13798 | r13799 | |
| 1199 | 1199 | } |
| 1200 | 1200 | |
| 1201 | 1201 | |
| 1202 | void scramble_draw_bullet(running_machine &machine, bitmap_t *bitmap, const rectangle | |
| 1202 | void scramble_draw_bullet(running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect, int offs, int x, int y) | |
| 1203 | 1203 | { |
| 1204 | 1204 | /* |
| 1205 | 1205 | Scramble only has "shells", which begin displaying when the counter |
| r13798 | r13799 | |
| 1211 | 1211 | } |
| 1212 | 1212 | |
| 1213 | 1213 | |
| 1214 | void theend_draw_bullet(running_machine &machine, bitmap_t *bitmap, const rectangle | |
| 1214 | void theend_draw_bullet(running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect, int offs, int x, int y) | |
| 1215 | 1215 | { |
| 1216 | 1216 | galaxian_state *state = machine.driver_data<galaxian_state>(); |
| 1217 | 1217 | /* Same as galaxian except blue/green are swapped */ |
| r13798 | r13799 | |
|---|---|---|
| 136 | 136 | |
| 137 | 137 | ***************************************************************************/ |
| 138 | 138 | |
| 139 | static void draw_sprites( running_machine &machine, bitmap_t *bitmap, const rectangle | |
| 139 | static void draw_sprites( running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect, int priority ) | |
| 140 | 140 | { |
| 141 | 141 | othldrby_state *state = machine.driver_data<othldrby_state>(); |
| 142 | 142 | int offs; |
| r13798 | r13799 | |
| 201 | 201 | } |
| 202 | 202 | } |
| 203 | 203 | |
| 204 | screen.machine().priority_bitmap->fill(0, | |
| 204 | screen.machine().priority_bitmap->fill(0, | |
| 205 | 205 | |
| 206 | bitmap->fill(0, | |
| 206 | bitmap->fill(0, | |
| 207 | 207 | |
| 208 | 208 | for (layer = 0; layer < 3; layer++) |
| 209 | 209 | tilemap_draw(bitmap, cliprect, state->m_bg_tilemap[layer], 0, 0); |
| r13798 | r13799 | |
|---|---|---|
| 84 | 84 | state->m_VS920A[numchip].gfx_region = gfx_region; |
| 85 | 85 | } |
| 86 | 86 | |
| 87 | static void VS920A_draw(gstriker_state *state, int numchip, bitmap_t* screen, const rectangle | |
| 87 | static void VS920A_draw(gstriker_state *state, int numchip, bitmap_t* screen, const rectangle | |
| 88 | 88 | { |
| 89 | 89 | state->m_VS920A_cur_chip = &state->m_VS920A[numchip]; |
| 90 | 90 | |
| r13798 | r13799 | |
| 238 | 238 | } |
| 239 | 239 | |
| 240 | 240 | /* THIS IS STILL WRONG! */ |
| 241 | static void MB60553_draw(running_machine &machine, int numchip, bitmap_t* screen, const rectangle | |
| 241 | static void MB60553_draw(running_machine &machine, int numchip, bitmap_t* screen, const rectangle | |
| 242 | 242 | { |
| 243 | 243 | gstriker_state *state = machine.driver_data<gstriker_state>(); |
| 244 | 244 | int line; |
| r13798 | r13799 | |
| 269 | 269 | |
| 270 | 270 | clip.min_y = clip.max_y = line; |
| 271 | 271 | |
| 272 | tilemap_draw_roz(screen, | |
| 272 | tilemap_draw_roz(screen, | |
| 273 | 273 | incxx,0,0,incyy, |
| 274 | 274 | 1, |
| 275 | 275 | 0,priority); |
| r13798 | r13799 | |
| 383 | 383 | */ |
| 384 | 384 | |
| 385 | 385 | |
| 386 | static void CG10103_draw_sprite(running_machine &machine, bitmap_t* screen, const rectangle | |
| 386 | static void CG10103_draw_sprite(running_machine &machine, bitmap_t* screen, const rectangle | |
| 387 | 387 | { |
| 388 | 388 | gstriker_state *state = machine.driver_data<gstriker_state>(); |
| 389 | 389 | int ypos = spr[0] & 0x1FF; |
| r13798 | r13799 | |
| 460 | 460 | } |
| 461 | 461 | |
| 462 | 462 | |
| 463 | static void CG10103_draw(running_machine &machine, int numchip, bitmap_t* screen, const rectangle | |
| 463 | static void CG10103_draw(running_machine &machine, int numchip, bitmap_t* screen, const rectangle | |
| 464 | 464 | { |
| 465 | 465 | gstriker_state *state = machine.driver_data<gstriker_state>(); |
| 466 | 466 | UINT16* splist; |
| r13798 | r13799 | |
| 536 | 536 | SCREEN_UPDATE(gstriker) |
| 537 | 537 | { |
| 538 | 538 | gstriker_state *state = screen.machine().driver_data<gstriker_state>(); |
| 539 | bitmap->fill(get_black_pen(screen.machine()), | |
| 539 | bitmap->fill(get_black_pen(screen.machine()), | |
| 540 | 540 | |
| 541 | 541 | // Sandwitched screen/sprite0/score/sprite1. Surely wrong, probably |
| 542 | 542 | // needs sprite orthogonality |
| r13798 | r13799 | |
|---|---|---|
| 744 | 744 | |
| 745 | 745 | /**************************************************************************************/ |
| 746 | 746 | |
| 747 | static void marvins_draw_sprites(running_machine &machine, bitmap_t *bitmap, const rectangle | |
| 747 | static void marvins_draw_sprites(running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect, | |
| 748 | 748 | const int scrollx, const int scrolly, const int from, const int to) |
| 749 | 749 | { |
| 750 | 750 | snk_state *state = machine.driver_data<snk_state>(); |
| r13798 | r13799 | |
| 789 | 789 | } |
| 790 | 790 | |
| 791 | 791 | |
| 792 | static void tnk3_draw_sprites(running_machine &machine, bitmap_t *bitmap, const rectangle | |
| 792 | static void tnk3_draw_sprites(running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect, const int xscroll, const int yscroll) | |
| 793 | 793 | { |
| 794 | 794 | snk_state *state = machine.driver_data<snk_state>(); |
| 795 | 795 | UINT8 *spriteram = state->m_spriteram; |
| r13798 | r13799 | |
| 854 | 854 | } |
| 855 | 855 | |
| 856 | 856 | |
| 857 | static void ikari_draw_sprites(running_machine &machine, bitmap_t *bitmap, const rectangle | |
| 857 | static void ikari_draw_sprites(running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect, | |
| 858 | 858 | const int start, const int xscroll, const int yscroll, const UINT8 *source, const int gfxnum ) |
| 859 | 859 | { |
| 860 | 860 | snk_state *state = machine.driver_data<snk_state>(); |
| r13798 | r13799 | |
| 926 | 926 | -xx-x--- (bank number) |
| 927 | 927 | x------- (x offset bit8) |
| 928 | 928 | */ |
| 929 | static void tdfever_draw_sprites(running_machine &machine, bitmap_t *bitmap, const rectangle | |
| 929 | static void tdfever_draw_sprites(running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect, | |
| 930 | 930 | const int xscroll, const int yscroll, const UINT8 *source, const int gfxnum, const int hw_xflip, const int from, const int to ) |
| 931 | 931 | { |
| 932 | 932 | snk_state *state = machine.driver_data<snk_state>(); |
| r13798 | r13799 | |
|---|---|---|
| 459 | 459 | |
| 460 | 460 | /* Draw sprites */ |
| 461 | 461 | |
| 462 | static void draw_sprites( running_machine &machine, bitmap_t *bitmap, const rectangle | |
| 462 | static void draw_sprites( running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect ) | |
| 463 | 463 | { |
| 464 | 464 | hyprduel_state *state = machine.driver_data<hyprduel_state>(); |
| 465 | 465 | UINT8 *base_gfx = machine.region("gfx1")->base(); |
| r13798 | r13799 | |
| 634 | 634 | } |
| 635 | 635 | |
| 636 | 636 | |
| 637 | static void draw_layers( running_machine &machine, bitmap_t *bitmap, const rectangle | |
| 637 | static void draw_layers( running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect, int pri, int layers_ctrl ) | |
| 638 | 638 | { |
| 639 | 639 | hyprduel_state *state = machine.driver_data<hyprduel_state>(); |
| 640 | 640 | UINT16 layers_pri = state->m_videoregs[0x10/2]; |
| r13798 | r13799 | |
| 706 | 706 | state->m_sprite_yoffs = state->m_videoregs[0x04 / 2] - screen.height() / 2 - state->m_sprite_yoffs_sub; |
| 707 | 707 | |
| 708 | 708 | /* 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); | |
| 711 | 711 | |
| 712 | 712 | /* Screen Control Register: |
| 713 | 713 | |
| r13798 | r13799 | |
| 733 | 733 | if (screen.machine().input().code_pressed(KEYCODE_A)) msk |= 0x08; |
| 734 | 734 | if (msk != 0) |
| 735 | 735 | { |
| 736 | bitmap->fill(0, | |
| 736 | bitmap->fill(0, | |
| 737 | 737 | layers_ctrl &= msk; |
| 738 | 738 | } |
| 739 | 739 |
| r13798 | r13799 | |
|---|---|---|
| 102 | 102 | } /* namconb1_install_palette */ |
| 103 | 103 | |
| 104 | 104 | static void |
| 105 | video_update_common(running_machine &machine, bitmap_t *bitmap, const rectangle | |
| 105 | video_update_common(running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect, int bROZ ) | |
| 106 | 106 | { |
| 107 | 107 | int pri; |
| 108 | 108 | namconb1_install_palette(machine); |
| r13798 | r13799 | |
| 143 | 143 | clip.min_y = (yclip>>16) - 0x21; |
| 144 | 144 | clip.max_y = (yclip&0xffff) - 0x21 - 1; |
| 145 | 145 | /* 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; } | |
| 150 | 150 | |
| 151 | bitmap->fill(get_black_pen(screen.machine()), | |
| 151 | bitmap->fill(get_black_pen(screen.machine()), | |
| 152 | 152 | |
| 153 | video_update_common( screen.machine(), bitmap, | |
| 153 | video_update_common( screen.machine(), bitmap, | |
| 154 | 154 | |
| 155 | 155 | return 0; |
| 156 | 156 | } |
| r13798 | r13799 | |
| 184 | 184 | clip.min_y = (yclip>>16) - 0x21; |
| 185 | 185 | clip.max_y = (yclip&0xffff) - 0x21 - 1; |
| 186 | 186 | /* 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; } | |
| 191 | 191 | |
| 192 | bitmap->fill(get_black_pen(screen.machine()), | |
| 192 | bitmap->fill(get_black_pen(screen.machine()), | |
| 193 | 193 | |
| 194 | 194 | if( memcmp(state->m_tilemap_tile_bank,state->m_tilebank32,sizeof(state->m_tilemap_tile_bank))!=0 ) |
| 195 | 195 | { |
| 196 | 196 | namco_tilemap_invalidate(); |
| 197 | 197 | memcpy(state->m_tilemap_tile_bank,state->m_tilebank32,sizeof(state->m_tilemap_tile_bank)); |
| 198 | 198 | } |
| 199 | video_update_common( screen.machine(), bitmap, | |
| 199 | video_update_common( screen.machine(), bitmap, | |
| 200 | 200 | return 0; |
| 201 | 201 | } |
| 202 | 202 |
| r13798 | r13799 | |
|---|---|---|
| 13 | 13 | #include "includes/arcadecl.h" |
| 14 | 14 | |
| 15 | 15 | |
| 16 | static void arcadecl_bitmap_render(running_machine &machine, bitmap_t *bitmap, const rectangle | |
| 16 | static void arcadecl_bitmap_render(running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect); | |
| 17 | 17 | |
| 18 | 18 | /************************************* |
| 19 | 19 | * |
| r13798 | r13799 | |
| 121 | 121 | * |
| 122 | 122 | *************************************/ |
| 123 | 123 | |
| 124 | static void arcadecl_bitmap_render(running_machine &machine, bitmap_t *bitmap, const rectangle | |
| 124 | static void arcadecl_bitmap_render(running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect) | |
| 125 | 125 | { |
| 126 | 126 | arcadecl_state *state = machine.driver_data<arcadecl_state>(); |
| 127 | 127 | int x, y; |
| 128 | 128 | |
| 129 | 129 | /* update any dirty scanlines */ |
| 130 | for (y = cliprect | |
| 130 | for (y = cliprect. | |
| 131 | 131 | { |
| 132 | 132 | const UINT16 *src = &state->m_bitmap[256 * y]; |
| 133 | 133 | UINT16 *dst = &bitmap->pix16(y); |
| 134 | 134 | |
| 135 | 135 | /* regenerate the line */ |
| 136 | for (x = cliprect | |
| 136 | for (x = cliprect. | |
| 137 | 137 | { |
| 138 | 138 | int bits = src[(x - 8) / 2]; |
| 139 | 139 | dst[x + 0] = bits >> 8; |
| r13798 | r13799 | |
|---|---|---|
| 178 | 178 | } |
| 179 | 179 | |
| 180 | 180 | |
| 181 | static void flstory_draw_sprites( running_machine &machine, bitmap_t *bitmap, const rectangle | |
| 181 | static void flstory_draw_sprites( running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect, int pri ) | |
| 182 | 182 | { |
| 183 | 183 | flstory_state *state = machine.driver_data<flstory_state>(); |
| 184 | 184 | int i; |
| r13798 | r13799 | |
| 235 | 235 | return 0; |
| 236 | 236 | } |
| 237 | 237 | |
| 238 | static void victnine_draw_sprites( running_machine &machine, bitmap_t *bitmap, const rectangle | |
| 238 | static void victnine_draw_sprites( running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect ) | |
| 239 | 239 | { |
| 240 | 240 | flstory_state *state = machine.driver_data<flstory_state>(); |
| 241 | 241 | int i; |
| r13798 | r13799 | |
|---|---|---|
| 6 | 6 | |
| 7 | 7 | |
| 8 | 8 | /* todo, fix zooming correctly, it's _not_ like aerofgt */ |
| 9 | static void draw_sprites( running_machine &machine, bitmap_t *bitmap, const rectangle | |
| 9 | static void draw_sprites( running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect ) | |
| 10 | 10 | { |
| 11 | 11 | /* SPRITE INFO |
| 12 | 12 | |
| r13798 | r13799 | |
| 157 | 157 | suprslam_state *state = screen.machine().driver_data<suprslam_state>(); |
| 158 | 158 | tilemap_set_scrollx( state->m_screen_tilemap,0, state->m_screen_vregs[0x04/2] ); |
| 159 | 159 | |
| 160 | bitmap->fill(get_black_pen(screen.machine()), | |
| 160 | bitmap->fill(get_black_pen(screen.machine()), | |
| 161 | 161 | k053936_zoom_draw(state->m_k053936, bitmap, cliprect, state->m_bg_tilemap, 0, 0, 1); |
| 162 | 162 | if(!(state->m_spr_ctrl[0] & 8)) |
| 163 | 163 | draw_sprites(screen.machine(), bitmap, cliprect); |
| r13798 | r13799 | |
|---|---|---|
| 81 | 81 | tilemap_set_scroll_rows(state->m_bg_tilemap, 32); |
| 82 | 82 | } |
| 83 | 83 | |
| 84 | static void draw_sprites(running_machine &machine, bitmap_t *bitmap, const rectangle | |
| 84 | static void draw_sprites(running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect) | |
| 85 | 85 | { |
| 86 | 86 | strnskil_state *state = machine.driver_data<strnskil_state>(); |
| 87 | 87 | UINT8 *spriteram = state->m_spriteram; |
| r13798 | r13799 | |
|---|---|---|
| 251 | 251 | } |
| 252 | 252 | |
| 253 | 253 | |
| 254 | static void draw_bitmap( running_machine &machine, bitmap_t *bitmap, const rectangle | |
| 254 | static void draw_bitmap( running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect ) | |
| 255 | 255 | { |
| 256 | 256 | cosmic_state *state = machine.driver_data<cosmic_state>(); |
| 257 | 257 | offs_t offs; |
| r13798 | r13799 | |
| 283 | 283 | } |
| 284 | 284 | |
| 285 | 285 | |
| 286 | static void draw_sprites( running_machine &machine, bitmap_t *bitmap, const rectangle | |
| 286 | static void draw_sprites( running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect, int color_mask, int extra_sprites ) | |
| 287 | 287 | { |
| 288 | 288 | cosmic_state *state = machine.driver_data<cosmic_state>(); |
| 289 | 289 | int offs; |
| r13798 | r13799 | |
| 317 | 317 | } |
| 318 | 318 | |
| 319 | 319 | |
| 320 | static void cosmica_draw_starfield( screen_device &screen, bitmap_t *bitmap, const rectangle | |
| 320 | static void cosmica_draw_starfield( screen_device &screen, bitmap_t *bitmap, const rectangle &cliprect ) | |
| 321 | 321 | { |
| 322 | 322 | UINT8 y = 0; |
| 323 | 323 | UINT8 map = 0; |
| r13798 | r13799 | |
| 366 | 366 | } |
| 367 | 367 | |
| 368 | 368 | |
| 369 | static void devzone_draw_grid( running_machine &machine, bitmap_t *bitmap, const rectangle | |
| 369 | static void devzone_draw_grid( running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect ) | |
| 370 | 370 | { |
| 371 | 371 | UINT8 y; |
| 372 | 372 | UINT8 *horz_PROM = machine.region("user2")->base(); |
| r13798 | r13799 | |
| 424 | 424 | } |
| 425 | 425 | |
| 426 | 426 | |
| 427 | static void nomnlnd_draw_background( screen_device &screen, bitmap_t *bitmap, const rectangle | |
| 427 | static void nomnlnd_draw_background( screen_device &screen, bitmap_t *bitmap, const rectangle &cliprect ) | |
| 428 | 428 | { |
| 429 | 429 | UINT8 y = 0; |
| 430 | 430 | UINT8 water = screen.frame_number(); |
| r13798 | r13799 | |
| 548 | 548 | |
| 549 | 549 | SCREEN_UPDATE( cosmicg ) |
| 550 | 550 | { |
| 551 | bitmap->fill(0, | |
| 551 | bitmap->fill(0, | |
| 552 | 552 | draw_bitmap(screen.machine(), bitmap, cliprect); |
| 553 | 553 | return 0; |
| 554 | 554 | } |
| r13798 | r13799 | |
| 556 | 556 | |
| 557 | 557 | SCREEN_UPDATE( panic ) |
| 558 | 558 | { |
| 559 | bitmap->fill(0, | |
| 559 | bitmap->fill(0, | |
| 560 | 560 | draw_bitmap(screen.machine(), bitmap, cliprect); |
| 561 | 561 | draw_sprites(screen.machine(), bitmap, cliprect, 0x07, 1); |
| 562 | 562 | return 0; |
| r13798 | r13799 | |
| 565 | 565 | |
| 566 | 566 | SCREEN_UPDATE( cosmica ) |
| 567 | 567 | { |
| 568 | bitmap->fill(0, | |
| 568 | bitmap->fill(0, | |
| 569 | 569 | cosmica_draw_starfield(screen, bitmap, cliprect); |
| 570 | 570 | draw_bitmap(screen.machine(), bitmap, cliprect); |
| 571 | 571 | draw_sprites(screen.machine(), bitmap, cliprect, 0x0f, 0); |
| r13798 | r13799 | |
| 575 | 575 | |
| 576 | 576 | SCREEN_UPDATE( magspot ) |
| 577 | 577 | { |
| 578 | bitmap->fill(0, | |
| 578 | bitmap->fill(0, | |
| 579 | 579 | draw_bitmap(screen.machine(), bitmap, cliprect); |
| 580 | 580 | draw_sprites(screen.machine(), bitmap, cliprect, 0x07, 0); |
| 581 | 581 | return 0; |
| r13798 | r13799 | |
| 586 | 586 | { |
| 587 | 587 | cosmic_state *state = screen.machine().driver_data<cosmic_state>(); |
| 588 | 588 | |
| 589 | bitmap->fill(0, | |
| 589 | bitmap->fill(0, | |
| 590 | 590 | |
| 591 | 591 | if (state->m_background_enable) |
| 592 | 592 | devzone_draw_grid(screen.machine(), bitmap, cliprect); |
| r13798 | r13799 | |
| 604 | 604 | /* according to the video summation logic on pg4, the trees and river |
| 605 | 605 | have the highest priority */ |
| 606 | 606 | |
| 607 | bitmap->fill(0, | |
| 607 | bitmap->fill(0, | |
| 608 | 608 | draw_bitmap(screen.machine(), bitmap, cliprect); |
| 609 | 609 | draw_sprites(screen.machine(), bitmap, cliprect, 0x07, 0); |
| 610 | 610 |
| r13798 | r13799 | |
|---|---|---|
| 158 | 158 | tilemap_set_scroll_cols(state->m_bg_tilemap, 32); |
| 159 | 159 | } |
| 160 | 160 | |
| 161 | static void draw_sprites(running_machine &machine, bitmap_t *bitmap, const rectangle | |
| 161 | static void draw_sprites(running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect) | |
| 162 | 162 | { |
| 163 | 163 | shaolins_state *state = machine.driver_data<shaolins_state>(); |
| 164 | 164 | UINT8 *spriteram = state->m_spriteram; |
| r13798 | r13799 | |
|---|---|---|
| 923 | 923 | model2_3d_render_7 /* checker = 1, textured = 1, translucent = 1 */ |
| 924 | 924 | }; |
| 925 | 925 | |
| 926 | static void model2_3d_render( model2_state *state, bitmap_t *bitmap, triangle *tri, const rectangle | |
| 926 | static void model2_3d_render( model2_state *state, bitmap_t *bitmap, triangle *tri, const rectangle &cliprect ) | |
| 927 | 927 | { |
| 928 | 928 | poly_manager *poly = state->m_poly; |
| 929 | 929 | poly_extra_data *extra = (poly_extra_data *)poly_get_extra_data(poly); |
| r13798 | r13799 | |
| 939 | 939 | vp.min_y = (384-tri->viewport[3])+90; |
| 940 | 940 | vp.max_y = (384-tri->viewport[1])+90; |
| 941 | 941 | |
| 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; | |
| 946 | 946 | |
| 947 | 947 | extra->state = state; |
| 948 | 948 | extra->lumabase = ((tri->texheader[1] & 0xFF) << 7) + ((tri->luma >> 5) ^ 0x7); |
| r13798 | r13799 | |
| 968 | 968 | tri->v[2].pu = tri->v[2].pu * tri->v[2].pz * (1.0f / 8.0f); |
| 969 | 969 | tri->v[2].pv = tri->v[2].pv * tri->v[2].pz * (1.0f / 8.0f); |
| 970 | 970 | |
| 971 | poly_render_triangle(poly, bitmap, | |
| 971 | poly_render_triangle(poly, bitmap, | |
| 972 | 972 | } |
| 973 | 973 | else |
| 974 | poly_render_triangle(poly, bitmap, | |
| 974 | poly_render_triangle(poly, bitmap, | |
| 975 | 975 | } |
| 976 | 976 | |
| 977 | 977 | /* |
| r13798 | r13799 | |
| 1022 | 1022 | raster->max_z = 0; |
| 1023 | 1023 | } |
| 1024 | 1024 | |
| 1025 | static void model2_3d_frame_end( model2_state *state, bitmap_t *bitmap, const rectangle | |
| 1025 | static void model2_3d_frame_end( model2_state *state, bitmap_t *bitmap, const rectangle &cliprect ) | |
| 1026 | 1026 | { |
| 1027 | 1027 | raster_state *raster = state->m_raster; |
| 1028 | 1028 | INT32 z; |
| r13798 | r13799 | |
| 2727 | 2727 | geo_init( machine, (UINT32*)machine.region("user2")->base() ); |
| 2728 | 2728 | } |
| 2729 | 2729 | |
| 2730 | static void convert_bitmap( running_machine &machine, bitmap_t *dst, bitmap_t *src, const rectangle | |
| 2730 | static void convert_bitmap( running_machine &machine, bitmap_t *dst, bitmap_t *src, const rectangle &rect ) | |
| 2731 | 2731 | { |
| 2732 | 2732 | int x, y; |
| 2733 | 2733 | |
| 2734 | for( y = rect | |
| 2734 | for( y = rect. | |
| 2735 | 2735 | { |
| 2736 | 2736 | UINT32 *d = &dst->pix32(y); |
| 2737 | 2737 | UINT16 *s = &src->pix16(y); |
| 2738 | 2738 | |
| 2739 | for( x = rect | |
| 2739 | for( x = rect. | |
| 2740 | 2740 | { |
| 2741 | 2741 | if ( s[x] ) |
| 2742 | 2742 | d[x] = machine.pens[s[x]]; |
| r13798 | r13799 | |
| 2749 | 2749 | model2_state *state = screen.machine().driver_data<model2_state>(); |
| 2750 | 2750 | logerror("--- frame ---\n"); |
| 2751 | 2751 | |
| 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); | |
| 2754 | 2754 | |
| 2755 | 2755 | segas24_tile *tile = screen.machine().device<segas24_tile>("tile"); |
| 2756 | 2756 | tile->draw(state->m_sys24_bitmap, cliprect, 7, 0, 0); |
| r13798 | r13799 | |
| 2769 | 2769 | /* have the rasterizer output the frame */ |
| 2770 | 2770 | model2_3d_frame_end( state, bitmap, cliprect ); |
| 2771 | 2771 | |
| 2772 | state->m_sys24_bitmap->fill(0, | |
| 2772 | state->m_sys24_bitmap->fill(0, | |
| 2773 | 2773 | tile->draw(state->m_sys24_bitmap, cliprect, 3, 0, 0); |
| 2774 | 2774 | tile->draw(state->m_sys24_bitmap, cliprect, 2, 0, 0); |
| 2775 | 2775 | tile->draw(state->m_sys24_bitmap, cliprect, 1, 0, 0); |
| r13798 | r13799 | |
|---|---|---|
| 41 | 41 | |
| 42 | 42 | tilemap_set_flip_all(screen.machine(),flip_screen_x_get(screen.machine()) ? (TILEMAP_FLIPY | TILEMAP_FLIPX) : 0); |
| 43 | 43 | |
| 44 | bitmap->fill(get_black_pen(screen.machine()), | |
| 44 | bitmap->fill(get_black_pen(screen.machine()), | |
| 45 | 45 | |
| 46 | 46 | deco16ic_pf_update(state->m_deco_tilegen1, state->m_pf1_rowscroll, state->m_pf2_rowscroll); |
| 47 | 47 |
| r13798 | r13799 | |
|---|---|---|
| 160 | 160 | * |
| 161 | 161 | *************************************/ |
| 162 | 162 | |
| 163 | static void draw_sprites( running_machine &machine, bitmap_t *bitmap, const rectangle | |
| 163 | static void draw_sprites( running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect ) | |
| 164 | 164 | { |
| 165 | 165 | kyugo_state *state = machine.driver_data<kyugo_state>(); |
| 166 | 166 |
| r13798 | r13799 | |
|---|---|---|
| 400 | 400 | offs_t prom_bank = ((state->m_gfxbank >> 3) & 0x01) * 0x2000; |
| 401 | 401 | |
| 402 | 402 | /* for each scanline in the visible region */ |
| 403 | for (y = cliprect | |
| 403 | for (y = cliprect. | |
| 404 | 404 | { |
| 405 | 405 | int x; |
| 406 | 406 | UINT8 fg_data = 0; |
| r13798 | r13799 | |
| 467 | 467 | offs_t bg_gfx_offs_mask = bg_gfx_bank_page_size - 1; |
| 468 | 468 | |
| 469 | 469 | /* for each scanline in the visible region */ |
| 470 | for (y = cliprect | |
| 470 | for (y = cliprect. | |
| 471 | 471 | { |
| 472 | 472 | int x; |
| 473 | 473 | UINT8 fg_data = 0; |
| r13798 | r13799 | |
|---|---|---|
| 177 | 177 | |
| 178 | 178 | |
| 179 | 179 | |
| 180 | void decospr_device::draw_sprites( running_machine &machine, bitmap_t *bitmap, const rectangle | |
| 180 | void decospr_device::draw_sprites( running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect, UINT16* spriteram, int sizewords, bool invert_flip ) | |
| 181 | 181 | { |
| 182 | //printf("cliprect %04x, %04x\n", cliprect | |
| 182 | //printf("cliprect %04x, %04x\n", cliprect. | |
| 183 | 183 | |
| 184 | 184 | if (m_sprite_bitmap && m_pricallback) |
| 185 | 185 | fatalerror("m_sprite_bitmap && m_pricallback is invalid"); |
| 186 | 186 | |
| 187 | 187 | if (m_sprite_bitmap) |
| 188 | m_sprite_bitmap->fill(0, | |
| 188 | m_sprite_bitmap->fill(0, | |
| 189 | 189 | |
| 190 | 190 | |
| 191 | 191 | int offs, end, incr; |
| r13798 | r13799 | |
| 245 | 245 | fy = y & 0x4000; |
| 246 | 246 | multi = (1 << ((y & 0x0600) >> 9)) - 1; /* 1x, 2x, 4x, 8x height */ |
| 247 | 247 | |
| 248 | if (cliprect | |
| 248 | if (cliprect. | |
| 249 | 249 | { |
| 250 | 250 | x = x & 0x01ff; |
| 251 | 251 | y = y & 0x01ff; |
| r13798 | r13799 | |
| 281 | 281 | { |
| 282 | 282 | y = 240 - y; |
| 283 | 283 | |
| 284 | if (cliprect | |
| 284 | if (cliprect. | |
| 285 | 285 | x = 304 - x; |
| 286 | 286 | else |
| 287 | 287 | x = 240 - x; |
| r13798 | r13799 | |
| 299 | 299 | { |
| 300 | 300 | int ypos; |
| 301 | 301 | ypos = y + mult * multi; |
| 302 | if ((ypos<=cliprect | |
| 302 | if ((ypos<=cliprect. | |
| 303 | 303 | { |
| 304 | 304 | if(!m_sprite_bitmap) |
| 305 | 305 | { |
| 306 | if ((ypos<=cliprect | |
| 306 | if ((ypos<=cliprect. | |
| 307 | 307 | { |
| 308 | 308 | if (m_pricallback) |
| 309 | 309 | pdrawgfx_transpen(bitmap,cliprect,machine.gfx[m_gfxregion], |
| r13798 | r13799 | |
| 429 | 429 | { |
| 430 | 430 | ypos = y + mult2 * (h-yy); |
| 431 | 431 | |
| 432 | if ((ypos<=cliprect | |
| 432 | if ((ypos<=cliprect. | |
| 433 | 433 | { |
| 434 | 434 | pdrawgfx_transpen(bitmap,cliprect,machine.gfx[m_gfxregion], |
| 435 | 435 | sprite + yy + h * xx, |
| r13798 | r13799 | |
| 441 | 441 | |
| 442 | 442 | ypos -= 512; // wrap-around y |
| 443 | 443 | |
| 444 | if ((ypos<=cliprect | |
| 444 | if ((ypos<=cliprect. | |
| 445 | 445 | { |
| 446 | 446 | pdrawgfx_transpen(bitmap,cliprect,machine.gfx[m_gfxregion], |
| 447 | 447 | sprite + yy + h * xx, |
| r13798 | r13799 | |
| 456 | 456 | { |
| 457 | 457 | ypos = y + mult2 * (h-yy); |
| 458 | 458 | |
| 459 | if ((ypos<=cliprect | |
| 459 | if ((ypos<=cliprect. | |
| 460 | 460 | { |
| 461 | 461 | drawgfx_transpen(bitmap,cliprect,machine.gfx[m_gfxregion], |
| 462 | 462 | sprite + yy + h * xx, |
| r13798 | r13799 | |
| 468 | 468 | |
| 469 | 469 | ypos -= 512; // wrap-around y |
| 470 | 470 | |
| 471 | if ((ypos<=cliprect | |
| 471 | if ((ypos<=cliprect. | |
| 472 | 472 | { |
| 473 | 473 | drawgfx_transpen(bitmap,cliprect,machine.gfx[m_gfxregion], |
| 474 | 474 | sprite + yy + h * xx, |
| r13798 | r13799 | |
| 483 | 483 | { |
| 484 | 484 | ypos = y + mult2 * (h-yy); |
| 485 | 485 | |
| 486 | if ((ypos<=cliprect | |
| 486 | if ((ypos<=cliprect. | |
| 487 | 487 | { |
| 488 | 488 | drawgfx_transpen_raw(m_sprite_bitmap,cliprect,machine.gfx[m_gfxregion], |
| 489 | 489 | sprite + yy + h * xx, |
| r13798 | r13799 | |
| 495 | 495 | |
| 496 | 496 | ypos -= 512; // wrap-around y |
| 497 | 497 | |
| 498 | if ((ypos<=cliprect | |
| 498 | if ((ypos<=cliprect. | |
| 499 | 499 | { |
| 500 | 500 | drawgfx_transpen_raw(m_sprite_bitmap,cliprect,machine.gfx[m_gfxregion], |
| 501 | 501 | sprite + yy + h * xx, |
| r13798 | r13799 | |
| 516 | 516 | |
| 517 | 517 | |
| 518 | 518 | // inefficient, we should be able to mix in a single pass by comparing the existing priority bitmap from the tilemaps |
| 519 | void decospr_device::inefficient_copy_sprite_bitmap(running_machine& machine, bitmap_t *bitmap, const rectangle | |
| 519 | void 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) | |
| 520 | 520 | { |
| 521 | 521 | if (!m_sprite_bitmap) |
| 522 | 522 | fatalerror("decospr_device::inefficient_copy_sprite_bitmap with no m_sprite_bitmap"); |
| r13798 | r13799 | |
| 527 | 527 | UINT16* srcline; |
| 528 | 528 | UINT32* dstline; |
| 529 | 529 | |
| 530 | for (y=cliprect | |
| 530 | for (y=cliprect. | |
| 531 | 531 | { |
| 532 | 532 | srcline= &m_sprite_bitmap->pix16(y); |
| 533 | 533 | dstline= &bitmap->pix32(y); |
| 534 | 534 | |
| 535 | 535 | if (alpha==0xff) |
| 536 | 536 | { |
| 537 | for (x=cliprect | |
| 537 | for (x=cliprect. | |
| 538 | 538 | { |
| 539 | 539 | UINT16 pix = srcline[x]; |
| 540 | 540 | |
| r13798 | r13799 | |
| 549 | 549 | } |
| 550 | 550 | else |
| 551 | 551 | { |
| 552 | for (x=cliprect | |
| 552 | for (x=cliprect. | |
| 553 | 553 | { |
| 554 | 554 | UINT16 pix = srcline[x]; |
| 555 | 555 |
| r13798 | r13799 | |
|---|---|---|
| 279 | 279 | state_save_register_global_pointer(machine, state->m_bitmapram, popeye_bitmapram_size); |
| 280 | 280 | } |
| 281 | 281 | |
| 282 | static void draw_background(running_machine &machine, bitmap_t *bitmap, const rectangle | |
| 282 | static void draw_background(running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect) | |
| 283 | 283 | { |
| 284 | 284 | popeye_state *state = machine.driver_data<popeye_state>(); |
| 285 | 285 | int offs; |
| r13798 | r13799 | |
| 296 | 296 | set_background_palette(machine, (*state->m_palettebank & 0x08) >> 3); |
| 297 | 297 | |
| 298 | 298 | if (state->m_background_pos[1] == 0) /* no background */ |
| 299 | bitmap->fill(0, | |
| 299 | bitmap->fill(0, | |
| 300 | 300 | else |
| 301 | 301 | { |
| 302 | 302 | /* copy the background graphics */ |
| r13798 | r13799 | |
| 317 | 317 | } |
| 318 | 318 | } |
| 319 | 319 | |
| 320 | static void draw_sprites(running_machine &machine, bitmap_t *bitmap, const rectangle | |
| 320 | static void draw_sprites(running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect) | |
| 321 | 321 | { |
| 322 | 322 | popeye_state *state = machine.driver_data<popeye_state>(); |
| 323 | 323 | UINT8 *spriteram = state->m_spriteram; |
| r13798 | r13799 | |
|---|---|---|
| 346 | 346 | } |
| 347 | 347 | } |
| 348 | 348 | |
| 349 | void segas24_tile::draw(bitmap_t *bitmap, const rectangle | |
| 349 | void segas24_tile::draw(bitmap_t *bitmap, const rectangle &cliprect, int layer, int lpri, int flags) | |
| 350 | 350 | { |
| 351 | 351 | UINT16 hscr = tile_ram[0x5000+(layer >> 1)]; |
| 352 | 352 | UINT16 vscr = tile_ram[0x5004+(layer >> 1)]; |
| r13798 | r13799 | |
| 378 | 378 | UINT16 v = (-vscr) & 0x1ff; |
| 379 | 379 | if(!((-vscr) & 0x200)) |
| 380 | 380 | layer ^= 1; |
| 381 | for(y=cliprect | |
| 381 | for(y=cliprect. | |
| 382 | 382 | UINT16 h; |
| 383 | rectangle c = | |
| 383 | rectangle c = | |
| 384 | 384 | int l1 = layer; |
| 385 | 385 | if(y >= v) |
| 386 | 386 | l1 ^= 1; |
| r13798 | r13799 | |
| 391 | 391 | |
| 392 | 392 | h = hscr & 0x1ff; |
| 393 | 393 | tilemap_set_scrollx(tile_layer[l1], 0, -h); |
| 394 | tilemap_draw(bitmap, | |
| 394 | tilemap_draw(bitmap, | |
| 395 | 395 | } |
| 396 | 396 | break; |
| 397 | 397 | } |
| 398 | 398 | case 2: case 3: { |
| 399 | 399 | int y; |
| 400 | for(y=cliprect | |
| 400 | for(y=cliprect. | |
| 401 | 401 | UINT16 h; |
| 402 | rectangle c1 = *cliprect; | |
| 403 | rectangle c2 = *cliprect; | |
| 402 | rectangle c1 = cliprect; | |
| 403 | rectangle c2 = cliprect; | |
| 404 | 404 | int l1 = layer; |
| 405 | 405 | |
| 406 | 406 | hscr = hscrtb[y]; |
| r13798 | r13799 | |
| 418 | 418 | |
| 419 | 419 | c1.min_y = c1.max_y = c2.min_y = c2.max_y = y; |
| 420 | 420 | |
| 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); | |
| 423 | 423 | } |
| 424 | 424 | break; |
| 425 | 425 | } |
| r13798 | r13799 | |
| 431 | 431 | |
| 432 | 432 | switch((ctrl & 0x6000) >> 13) { |
| 433 | 433 | case 1: { |
| 434 | rectangle c1 = *cliprect; | |
| 435 | rectangle c2 = *cliprect; | |
| 434 | rectangle c1 = cliprect; | |
| 435 | rectangle c2 = cliprect; | |
| 436 | 436 | UINT16 v; |
| 437 | 437 | v = (-vscr) & 0x1ff; |
| 438 | 438 | if(c1.max_y >= v) |
| r13798 | r13799 | |
| 442 | 442 | if(!((-vscr) & 0x200)) |
| 443 | 443 | layer ^= 1; |
| 444 | 444 | |
| 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); | |
| 447 | 447 | break; |
| 448 | 448 | } |
| 449 | 449 | case 2: case 3: { |
| 450 | rectangle c1 = *cliprect; | |
| 451 | rectangle c2 = *cliprect; | |
| 450 | rectangle c1 = cliprect; | |
| 451 | rectangle c2 = cliprect; | |
| 452 | 452 | UINT16 h; |
| 453 | 453 | h = (+hscr) & 0x1ff; |
| 454 | 454 | if(c1.max_x >= h) |
| r13798 | r13799 | |
| 458 | 458 | if(!((+hscr) & 0x200)) |
| 459 | 459 | layer ^= 1; |
| 460 | 460 | |
| 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); | |
| 463 | 463 | break; |
| 464 | 464 | } |
| 465 | 465 | } |
| r13798 | r13799 | |
| 613 | 613 | 0 11------ -------- |
| 614 | 614 | */ |
| 615 | 615 | |
| 616 | void segas24_sprite::draw(bitmap_t *bitmap, const rectangle | |
| 616 | void segas24_sprite::draw(bitmap_t *bitmap, const rectangle &cliprect, const int *spri) | |
| 617 | 617 | { |
| 618 | 618 | UINT16 curspr = 0; |
| 619 | 619 | int countspr = 0; |
| r13798 | r13799 | |
| 690 | 690 | } |
| 691 | 691 | |
| 692 | 692 | |
| 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; | |
| 701 | 701 | |
| 702 | 702 | if(!(source[0] & 0x2000)) |
| 703 | 703 | zoomx = zoomy = source[1] & 0xff; |
| r13798 | r13799 | |
|---|---|---|
| 8 | 8 | static void set_gfx_region(device_t &device, int gfxregion); |
| 9 | 9 | static void set_pri_callback(device_t &device, decospr_priority_callback_func callback); |
| 10 | 10 | //void decospr_sprite_kludge(int x, int y); |
| 11 | void draw_sprites( running_machine &machine, bitmap_t *bitmap, const rectangle | |
| 11 | void draw_sprites( running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect, UINT16* spriteram, int sizewords, bool invert_flip = false ); | |
| 12 | 12 | void set_pri_callback(decospr_priority_callback_func callback); |
| 13 | 13 | void set_gfxregion(int region) { m_gfxregion = region; }; |
| 14 | 14 | void set_alt_format(bool alt) { m_alt_format = alt; }; |
| 15 | 15 | void set_pix_mix_mask(UINT16 mask) { m_pixmask = mask; }; |
| 16 | 16 | void set_pix_raw_shift(UINT16 shift) { m_raw_shift = shift; }; |
| 17 | 17 | void alloc_sprite_bitmap(running_machine& machine); |
| 18 | void inefficient_copy_sprite_bitmap(running_machine& machine, bitmap_t *bitmap, const rectangle | |
| 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); | |
| 19 | 19 | bitmap_t* get_sprite_temp_bitmap(void) { return m_sprite_bitmap; }; |
| 20 | 20 | |
| 21 | 21 | protected: |
| r13798 | r13799 | |
|---|---|---|
| 90 | 90 | -----x-- -------- -------- -------- Flip X |
| 91 | 91 | -------- -------- -------- -------- Flip Y(used?) |
| 92 | 92 | */ |
| 93 | static void draw_sprites( running_machine &machine, bitmap_t *bitmap, const rectangle | |
| 93 | static void draw_sprites( running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect ) | |
| 94 | 94 | { |
| 95 | 95 | compgolf_state *state = machine.driver_data<compgolf_state>(); |
| 96 | 96 | int offs, fx, fy, x, y, color, sprite; |
| r13798 | r13799 | |
|---|---|---|
| 30 | 30 | DECLARE_READ32_MEMBER(char32_r); |
| 31 | 31 | DECLARE_WRITE32_MEMBER(char32_w); |
| 32 | 32 | |
| 33 | void draw(bitmap_t *bitmap, const rectangle | |
| 33 | void draw(bitmap_t *bitmap, const rectangle &cliprect, int layer, int pri, int flags); | |
| 34 | 34 | |
| 35 | 35 | protected: |
| 36 | 36 | virtual void device_start(); |
| r13798 | r13799 | |
| 70 | 70 | DECLARE_READ16_MEMBER(read); |
| 71 | 71 | DECLARE_WRITE16_MEMBER(write); |
| 72 | 72 | |
| 73 | void draw(bitmap_t *bitmap, const rectangle | |
| 73 | void draw(bitmap_t *bitmap, const rectangle &cliprect, const int *spri); | |
| 74 | 74 | |
| 75 | 75 | protected: |
| 76 | 76 | virtual void device_start(); |
| r13798 | r13799 | |
|---|---|---|
| 243 | 243 | |
| 244 | 244 | ***************************************************************************/ |
| 245 | 245 | |
| 246 | static void draw_sprites(running_machine &machine, bitmap_t *bitmap, const rectangle | |
| 246 | static void draw_sprites(running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect) | |
| 247 | 247 | { |
| 248 | 248 | lordgun_state *state = machine.driver_data<lordgun_state>(); |
| 249 | 249 | UINT16 *s = state->m_spriteram; |
| r13798 | r13799 | |
| 346 | 346 | |
| 347 | 347 | if (state->m_whitescreen) |
| 348 | 348 | { |
| 349 | bitmap->fill(get_white_pen(screen.machine()), | |
| 349 | bitmap->fill(get_white_pen(screen.machine()), | |
| 350 | 350 | return 0; |
| 351 | 351 | } |
| 352 | 352 | |
| r13798 | r13799 | |
| 376 | 376 | |
| 377 | 377 | int l; |
| 378 | 378 | for (l = 0; l < 5; l++) |
| 379 | state->m_bitmaps[l]->fill(trans_pen, | |
| 379 | state->m_bitmaps[l]->fill(trans_pen, | |
| 380 | 380 | |
| 381 | 381 | if (layers_ctrl & 1) tilemap_draw(state->m_bitmaps[0], cliprect, state->m_tilemap[0], 0, 0); |
| 382 | 382 | if (layers_ctrl & 2) tilemap_draw(state->m_bitmaps[1], cliprect, state->m_tilemap[1], 0, 0); |
| r13798 | r13799 | |
| 391 | 391 | // layer index (0-3, 4 for sprites) -> priority address bit |
| 392 | 392 | const int layer2bit[5] = {0,1,2,4,3}; |
| 393 | 393 | |
| 394 | for (y = cliprect | |
| 394 | for (y = cliprect. | |
| 395 | 395 | { |
| 396 | for (x = cliprect | |
| 396 | for (x = cliprect. | |
| 397 | 397 | { |
| 398 | 398 | UINT16 pens[5]; |
| 399 | 399 |
| r13798 | r13799 | |
|---|---|---|
| 85 | 85 | |
| 86 | 86 | ***************************************************************************/ |
| 87 | 87 | |
| 88 | static void draw_sprites( running_machine &machine, bitmap_t *bitmap, const rectangle | |
| 88 | static void draw_sprites( running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect ) | |
| 89 | 89 | { |
| 90 | 90 | pushman_state *state = machine.driver_data<pushman_state>(); |
| 91 | 91 | UINT16 *spriteram = state->m_spriteram; |
| r13798 | r13799 | |
|---|---|---|
| 15 | 15 | #include "emu.h" |
| 16 | 16 | #include "includes/lemmings.h" |
| 17 | 17 | |
| 18 | static void draw_sprites( running_machine &machine, bitmap_t *bitmap, const rectangle | |
| 18 | static void draw_sprites( running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect, UINT16 *spritedata, int gfxbank, UINT16 pri ) | |
| 19 | 19 | { |
| 20 | 20 | int offs; |
| 21 | 21 | |
| r13798 | r13799 | |
| 173 | 173 | int x0 = -state->m_control_data[2]; |
| 174 | 174 | int y = 0; |
| 175 | 175 | 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; | |
| 178 | 178 | |
| 179 | bitmap->fill(get_black_pen(screen.machine()), | |
| 179 | bitmap->fill(get_black_pen(screen.machine()), | |
| 180 | 180 | draw_sprites(screen.machine(), bitmap, cliprect, state->m_sprite_triple_buffer_1, 1, 0x0000); |
| 181 | 181 | |
| 182 | 182 | /* Pixel layer can be windowed in hardware (two player mode) */ |
| r13798 | r13799 | |
| 186 | 186 | { |
| 187 | 187 | rect.max_x = 159; |
| 188 | 188 | rect.min_x = 0; |
| 189 | copyscrollbitmap_trans(bitmap, state->m_bitmap0, 1, &x0, 1, &y, | |
| 189 | copyscrollbitmap_trans(bitmap, state->m_bitmap0, 1, &x0, 1, &y, | |
| 190 | 190 | rect.max_x = 319; |
| 191 | 191 | rect.min_x = 160; |
| 192 | copyscrollbitmap_trans(bitmap, state->m_bitmap0, 1, &x1, 1, &y, | |
| 192 | copyscrollbitmap_trans(bitmap, state->m_bitmap0, 1, &x1, 1, &y, | |
| 193 | 193 | } |
| 194 | 194 | draw_sprites(screen.machine(), bitmap, cliprect, state->m_sprite_triple_buffer_0, 0, 0x0000); |
| 195 | 195 | draw_sprites(screen.machine(), bitmap, cliprect, state->m_sprite_triple_buffer_1, 1, 0x2000); |
| r13798 | r13799 | |
|---|---|---|
| 42 | 42 | |
| 43 | 43 | bool zerozone_state::screen_update(screen_device &screen, bitmap_t &bitmap, const rectangle &cliprect) |
| 44 | 44 | { |
| 45 | tilemap_draw(&bitmap, | |
| 45 | tilemap_draw(&bitmap, | |
| 46 | 46 | return 0; |
| 47 | 47 | } |
| r13798 | r13799 | |
|---|---|---|
| 166 | 166 | * |
| 167 | 167 | *************************************/ |
| 168 | 168 | |
| 169 | static void draw_sprites( running_machine &machine, bitmap_t *bitmap, const rectangle | |
| 169 | static void draw_sprites( running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect ) | |
| 170 | 170 | { |
| 171 | 171 | espial_state *state = machine.driver_data<espial_state>(); |
| 172 | 172 | int offs; |
| r13798 | r13799 | |
|---|---|---|
| 130 | 130 | tilemap_set_scroll_rows(state->m_bg_tilemap, 32); |
| 131 | 131 | } |
| 132 | 132 | |
| 133 | static void draw_sprites( running_machine &machine, bitmap_t *bitmap, const rectangle | |
| 133 | static void draw_sprites( running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect ) | |
| 134 | 134 | { |
| 135 | 135 | hyperspt_state *state = machine.driver_data<hyperspt_state>(); |
| 136 | 136 | UINT8 *spriteram = state->m_spriteram; |
| r13798 | r13799 | |
|---|---|---|
| 165 | 165 | gfx_element_set_source(machine.gfx[0], state->m_charram); |
| 166 | 166 | } |
| 167 | 167 | |
| 168 | static void draw_sprites(running_machine &machine, bitmap_t *bitmap, const rectangle | |
| 168 | static void draw_sprites(running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect) | |
| 169 | 169 | { |
| 170 | 170 | tiamc1_state *state = machine.driver_data<tiamc1_state>(); |
| 171 | 171 | int offs; |
| r13798 | r13799 | |
|---|---|---|
| 959 | 959 | ***************************************************************************/ |
| 960 | 960 | |
| 961 | 961 | // custom function to draw a single sprite. needed to keep correct sprites - sprites and sprites - tilemaps priorities |
| 962 | static void toaplan1_draw_sprite_custom(bitmap_t *dest_bmp,const rectangle | |
| 962 | static void toaplan1_draw_sprite_custom(bitmap_t *dest_bmp,const rectangle &clip,const gfx_element *gfx, | |
| 963 | 963 | UINT32 code,UINT32 color,int flipx,int flipy,int sx,int sy, |
| 964 | 964 | int priority) |
| 965 | 965 | { |
| r13798 | r13799 | |
| 1001 | 1001 | y_index = 0; |
| 1002 | 1002 | } |
| 1003 | 1003 | |
| 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; | |
| 1029 | 1009 | } |
| 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 | } | |
| 1030 | 1027 | |
| 1031 | 1028 | if( ex>sx ) |
| 1032 | 1029 | { /* skip if inner loop doesn't draw anything */ |
| r13798 | r13799 | |
| 1058 | 1055 | } |
| 1059 | 1056 | |
| 1060 | 1057 | |
| 1061 | static void draw_sprites(running_machine &machine, bitmap_t *bitmap, const rectangle | |
| 1058 | static void draw_sprites(running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect ) | |
| 1062 | 1059 | { |
| 1063 | 1060 | toaplan1_state *state = machine.driver_data<toaplan1_state>(); |
| 1064 | 1061 | UINT16 *source = (UINT16 *)state->m_buffered_spriteram; |
| r13798 | r13799 | |
| 1126 | 1123 | } |
| 1127 | 1124 | |
| 1128 | 1125 | |
| 1129 | static void rallybik_draw_sprites(running_machine &machine, bitmap_t *bitmap, const rectangle | |
| 1126 | static void rallybik_draw_sprites(running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect, int priority ) | |
| 1130 | 1127 | { |
| 1131 | 1128 | toaplan1_state *state = machine.driver_data<toaplan1_state>(); |
| 1132 | 1129 | UINT16 *buffered_spriteram16 = state->m_buffered_spriteram; |
| r13798 | r13799 | |
| 1171 | 1168 | |
| 1172 | 1169 | toaplan1_log_vram(screen.machine()); |
| 1173 | 1170 | |
| 1174 | bitmap->fill(0x120, | |
| 1171 | bitmap->fill(0x120, | |
| 1175 | 1172 | |
| 1176 | 1173 | tilemap_draw(bitmap, cliprect, state->m_pf1_tilemap, TILEMAP_DRAW_OPAQUE | 0, 0); |
| 1177 | 1174 | tilemap_draw(bitmap, cliprect, state->m_pf1_tilemap, TILEMAP_DRAW_OPAQUE | 1, 0); |
| r13798 | r13799 | |
| 1195 | 1192 | |
| 1196 | 1193 | toaplan1_log_vram(screen.machine()); |
| 1197 | 1194 | |
| 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); | |
| 1200 | 1197 | |
| 1201 | 1198 | // it's really correct? |
| 1202 | 1199 | tilemap_draw(bitmap, cliprect, state->m_pf1_tilemap, TILEMAP_DRAW_OPAQUE | 0, 0); |
| r13798 | r13799 | |
|---|---|---|
| 640 | 640 | * |
| 641 | 641 | *************************************/ |
| 642 | 642 | |
| 643 | static void draw_videoram(running_machine &machine, bitmap_t *bitmap, const rectangle | |
| 643 | static void draw_videoram(running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect, const UINT8 *transparent_pens) | |
| 644 | 644 | { |
| 645 | 645 | segag80r_state *state = machine.driver_data<segag80r_state>(); |
| 646 | 646 | UINT8 *videoram = state->m_videoram; |
| r13798 | r13799 | |
| 648 | 648 | int x, y; |
| 649 | 649 | |
| 650 | 650 | /* iterate over the screen and draw visible tiles */ |
| 651 | for (y = cliprect | |
| 651 | for (y = cliprect. | |
| 652 | 652 | { |
| 653 | 653 | int effy = state->m_video_flip ? 27 - y : y; |
| 654 | for (x = cliprect | |
| 654 | for (x = cliprect. | |
| 655 | 655 | { |
| 656 | 656 | int offs = effy * 32 + (x ^ flipmask); |
| 657 | 657 | UINT8 tile = videoram[offs]; |
| r13798 | r13799 | |
| 670 | 670 | * |
| 671 | 671 | *************************************/ |
| 672 | 672 | |
| 673 | static void draw_background_spaceod(running_machine &machine, bitmap_t *bitmap, const rectangle | |
| 673 | static void draw_background_spaceod(running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect) | |
| 674 | 674 | { |
| 675 | 675 | segag80r_state *state = machine.driver_data<segag80r_state>(); |
| 676 | 676 | bitmap_t *pixmap = tilemap_get_pixmap(!(state->m_spaceod_bg_control & 0x02) ? state->m_spaceod_bg_htilemap : state->m_spaceod_bg_vtilemap); |
| r13798 | r13799 | |
| 687 | 687 | /* 240, giving us an offset of (262-240) = 22 scanlines. */ |
| 688 | 688 | |
| 689 | 689 | /* now fill in the background wherever there are black pixels */ |
| 690 | for (y = cliprect | |
| 690 | for (y = cliprect. | |
| 691 | 691 | { |
| 692 | 692 | int effy = (y + state->m_spaceod_vcounter + 22) ^ flipmask; |
| 693 | 693 | UINT16 *src = &pixmap->pix16(effy & ymask); |
| 694 | 694 | UINT16 *dst = &bitmap->pix16(y); |
| 695 | 695 | |
| 696 | 696 | /* loop over horizontal pixels */ |
| 697 | for (x = cliprect | |
| 697 | for (x = cliprect. | |
| 698 | 698 | { |
| 699 | 699 | int effx = ((x + state->m_spaceod_hcounter) ^ flipmask) + xoffset; |
| 700 | 700 | UINT8 fgpix = machine.generic.paletteram.u8[dst[x]]; |
| r13798 | r13799 | |
| 728 | 728 | * |
| 729 | 729 | *************************************/ |
| 730 | 730 | |
| 731 | static void draw_background_page_scroll(running_machine &machine, bitmap_t *bitmap, const rectangle | |
| 731 | static void draw_background_page_scroll(running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect) | |
| 732 | 732 | { |
| 733 | 733 | segag80r_state *state = machine.driver_data<segag80r_state>(); |
| 734 | 734 | bitmap_t *pixmap = tilemap_get_pixmap(state->m_bg_tilemap); |
| r13798 | r13799 | |
| 740 | 740 | /* if disabled, draw nothing */ |
| 741 | 741 | if (!state->m_bg_enable) |
| 742 | 742 | { |
| 743 | bitmap->fill(0, | |
| 743 | bitmap->fill(0, | |
| 744 | 744 | return; |
| 745 | 745 | } |
| 746 | 746 | |
| 747 | 747 | /* now fill in the background wherever there are black pixels */ |
| 748 | for (y = cliprect | |
| 748 | for (y = cliprect. | |
| 749 | 749 | { |
| 750 | 750 | int effy = state->m_bg_scrolly + (((y ^ flipmask) + (flipmask & 0xe0)) & 0xff); |
| 751 | 751 | UINT16 *src = &pixmap->pix16(effy & ymask); |
| 752 | 752 | UINT16 *dst = &bitmap->pix16(y); |
| 753 | 753 | |
| 754 | 754 | /* loop over horizontal pixels */ |
| 755 | for (x = cliprect | |
| 755 | for (x = cliprect. | |
| 756 | 756 | { |
| 757 | 757 | int effx = state->m_bg_scrollx + (x ^ flipmask); |
| 758 | 758 | dst[x] = src[effx & xmask]; |
| r13798 | r13799 | |
| 769 | 769 | * |
| 770 | 770 | *************************************/ |
| 771 | 771 | |
| 772 | static void draw_background_full_scroll(running_machine &machine, bitmap_t *bitmap, const rectangle | |
| 772 | static void draw_background_full_scroll(running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect) | |
| 773 | 773 | { |
| 774 | 774 | segag80r_state *state = machine.driver_data<segag80r_state>(); |
| 775 | 775 | bitmap_t *pixmap = tilemap_get_pixmap(state->m_bg_tilemap); |
| r13798 | r13799 | |
| 781 | 781 | /* if disabled, draw nothing */ |
| 782 | 782 | if (!state->m_bg_enable) |
| 783 | 783 | { |
| 784 | bitmap->fill(0, | |
| 784 | bitmap->fill(0, | |
| 785 | 785 | return; |
| 786 | 786 | } |
| 787 | 787 | |
| 788 | 788 | /* now fill in the background wherever there are black pixels */ |
| 789 | for (y = cliprect | |
| 789 | for (y = cliprect. | |
| 790 | 790 | { |
| 791 | 791 | int effy = (y + state->m_bg_scrolly) ^ flipmask; |
| 792 | 792 | UINT16 *src = &pixmap->pix16(effy & ymask); |
| 793 | 793 | UINT16 *dst = &bitmap->pix16(y); |
| 794 | 794 | |
| 795 | 795 | /* loop over horizontal pixels */ |
| 796 | for (x = cliprect | |
| 796 | for (x = cliprect. | |
| 797 | 797 | { |
| 798 | 798 | int effx = (x + state->m_bg_scrollx) ^ flipmask; |
| 799 | 799 | dst[x] = src[effx & xmask]; |
| r13798 | r13799 | |
|---|---|---|
| 227 | 227 | } |
| 228 | 228 | |
| 229 | 229 | |
| 230 | static void draw_layer_interleaved( running_machine &machine, bitmap_t *bitmap, const rectangle | |
| 230 | static void draw_layer_interleaved( running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect, int left_pixmap, int right_pixmap, int palbase, int transp ) | |
| 231 | 231 | { |
| 232 | 232 | hnayayoi_state *state = machine.driver_data<hnayayoi_state>(); |
| 233 | 233 | int county, countx, pen; |
| r13798 | r13799 | |
|---|---|---|
| 627 | 627 | |
| 628 | 628 | konami_sortlayers3(state->m_sorted_layer, state->m_layerpri); |
| 629 | 629 | |
| 630 | screen.machine().priority_bitmap->fill(0, | |
| 630 | screen.machine().priority_bitmap->fill(0, | |
| 631 | 631 | k052109_tilemap_draw(state->m_k052109, bitmap, cliprect, state->m_sorted_layer[0], TILEMAP_DRAW_OPAQUE, 1); |
| 632 | 632 | k052109_tilemap_draw(state->m_k052109, bitmap, cliprect, state->m_sorted_layer[1], 0, 2); |
| 633 | 633 | k052109_tilemap_draw(state->m_k052109, bitmap, cliprect, state->m_sorted_layer[2], 0, 4); |
| r13798 | r13799 | |
| 659 | 659 | |
| 660 | 660 | konami_sortlayers3(state->m_sorted_layer, state->m_layerpri); |
| 661 | 661 | |
| 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); | |
| 664 | 664 | k052109_tilemap_draw(state->m_k052109, bitmap, cliprect, state->m_sorted_layer[0], 0, 1); |
| 665 | 665 | k052109_tilemap_draw(state->m_k052109, bitmap, cliprect, state->m_sorted_layer[1], 0, 2); |
| 666 | 666 | k052109_tilemap_draw(state->m_k052109, bitmap, cliprect, state->m_sorted_layer[2], 0, 4); |
| r13798 | r13799 | |
| 708 | 708 | |
| 709 | 709 | /* not sure about the 053936 priority, but it seems to work */ |
| 710 | 710 | |
| 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); | |
| 713 | 713 | k052109_tilemap_draw(state->m_k052109, bitmap, cliprect, state->m_sorted_layer[0], 0, 1); |
| 714 | 714 | |
| 715 | 715 | if (state->m_layerpri[0] >= 0x30 && state->m_layerpri[1] < 0x30) |
| r13798 | r13799 | |
| 813 | 813 | |
| 814 | 814 | konami_sortlayers3(state->m_sorted_layer, state->m_layerpri); |
| 815 | 815 | |
| 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); | |
| 818 | 818 | k052109_tilemap_draw(state->m_k052109, bitmap, cliprect, state->m_sorted_layer[0], 0, 1); |
| 819 | 819 | k052109_tilemap_draw(state->m_k052109, bitmap, cliprect, state->m_sorted_layer[1], 0, 2); |
| 820 | 820 | k052109_tilemap_draw(state->m_k052109, bitmap, cliprect, state->m_sorted_layer[2], 0, 4); |
| r13798 | r13799 | |
|---|---|---|
| 130 | 130 | flip_screen_set_no_update(machine(), 0); |
| 131 | 131 | } |
| 132 | 132 | |
| 133 | void zodiack_state::draw_bullets( bitmap_t *bitmap, const rectangle | |
| 133 | void zodiack_state::draw_bullets( bitmap_t *bitmap, const rectangle &cliprect ) | |
| 134 | 134 | { |
| 135 | 135 | for (int offs = 0; offs < m_bulletsram_size; offs += 4) |
| 136 | 136 | { |
| r13798 | r13799 | |
| 154 | 154 | } |
| 155 | 155 | } |
| 156 | 156 | |
| 157 | void zodiack_state::draw_sprites( bitmap_t *bitmap, const rectangle | |
| 157 | void zodiack_state::draw_sprites( bitmap_t *bitmap, const rectangle &cliprect ) | |
| 158 | 158 | { |
| 159 | 159 | for (int offs = m_spriteram_size - 4; offs >= 0; offs -= 4) |
| 160 | 160 | { |
| r13798 | r13799 | |
| 186 | 186 | for (int i = 0; i < 32; i++) |
| 187 | 187 | tilemap_set_scrolly(m_fg_tilemap, i, m_attributeram[i * 2]); |
| 188 | 188 | |
| 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); | |
| 193 | 193 | return 0; |
| 194 | 194 | } |
| r13798 | r13799 | |
|---|---|---|
| 132 | 132 | // the real accumulation buffer is a 32x32x8bpp buffer into which tiles get rendered before they get copied to the framebuffer |
| 133 | 133 | // our implementation is not currently tile based, and thus the accumulation buffer is screen sized |
| 134 | 134 | static bitmap_t *fake_accumulationbuffer_bitmap; |
| 135 | static void render_to_accumulation_buffer(running_machine &machine,bitmap_t *bitmap,const rectangle | |
| 135 | static void render_to_accumulation_buffer(running_machine &machine,bitmap_t *bitmap,const rectangle &cliprect); | |
| 136 | 136 | |
| 137 | 137 | typedef struct texinfo { |
| 138 | 138 | UINT32 address, vqbase; |
| r13798 | r13799 | |
| 1102 | 1102 | |
| 1103 | 1103 | // we've got a request to draw, so, draw to the accumulation buffer! |
| 1104 | 1104 | // this should really be done for each tile! |
| 1105 | render_to_accumulation_buffer(space->machine(),fake_accumulationbuffer_bitmap, | |
| 1105 | render_to_accumulation_buffer(space->machine(),fake_accumulationbuffer_bitmap, | |
| 1106 | 1106 | |
| 1107 | 1107 | state->endofrender_timer_isp->adjust(attotime::from_usec(4000) ); // hack, make sure render takes some amount of time |
| 1108 | 1108 | |
| r13798 | r13799 | |
| 1975 | 1975 | render_tri_sorted(machine, bitmap, ti, v+i0, v+i1, v+i2); |
| 1976 | 1976 | } |
| 1977 | 1977 | |
| 1978 | static void render_to_accumulation_buffer(running_machine &machine,bitmap_t *bitmap,const rectangle | |
| 1978 | static void render_to_accumulation_buffer(running_machine &machine,bitmap_t *bitmap,const rectangle &cliprect) | |
| 1979 | 1979 | { |
| 1980 | 1980 | dc_state *state = machine.driver_data<dc_state>(); |
| 1981 | 1981 | address_space *space = machine.device("maincpu")->memory().space(AS_PROGRAM); |
| r13798 | r13799 | |
| 1996 | 1996 | rs=state_ta.renderselect; |
| 1997 | 1997 | c=state->pvrta_regs[ISP_BACKGND_T]; |
| 1998 | 1998 | c=space->read_dword(0x05000000+((c&0xfffff8)>>1)+(3+3)*4); |
| 1999 | bitmap->fill(c, | |
| 1999 | bitmap->fill(c, | |
| 2000 | 2000 | |
| 2001 | 2001 | |
| 2002 | 2002 | ns=state_ta.grab[rs].strips_size; |
| r13798 | r13799 | |
| 2204 | 2204 | } |
| 2205 | 2205 | |
| 2206 | 2206 | |
| 2207 | static void pvr_drawframebuffer(running_machine &machine,bitmap_t *bitmap,const rectangle | |
| 2207 | static void pvr_drawframebuffer(running_machine &machine,bitmap_t *bitmap,const rectangle &cliprect) | |
| 2208 | 2208 | { |
| 2209 | 2209 | dc_state *state = machine.driver_data<dc_state>(); |
| 2210 | 2210 | |
| r13798 | r13799 | |
| 2246 | 2246 | g = (c & 0x03e0) >> 2; |
| 2247 | 2247 | r = (c & 0x7c00) >> 7; |
| 2248 | 2248 | |
| 2249 | if (y<=cliprect | |
| 2249 | if (y<=cliprect. | |
| 2250 | 2250 | *fbaddr = b | (g<<8) | (r<<16); |
| 2251 | 2251 | |
| 2252 | 2252 | fbaddr=&bitmap->pix32(y, x*2+1); |
| 2253 | if (y<=cliprect | |
| 2253 | if (y<=cliprect. | |
| 2254 | 2254 | *fbaddr = b | (g<<8) | (r<<16); |
| 2255 | 2255 | addrp+=2; |
| 2256 | 2256 | } |
| r13798 | r13799 | |
| 2266 | 2266 | g = (c & 0x03e0) >> 2; |
| 2267 | 2267 | r = (c & 0x7c00) >> 7; |
| 2268 | 2268 | |
| 2269 | if (y<=cliprect | |
| 2269 | if (y<=cliprect. | |
| 2270 | 2270 | *fbaddr = b | (g<<8) | (r<<16); |
| 2271 | 2271 | addrp+=2; |
| 2272 | 2272 | } |
| r13798 | r13799 | |
| 2290 | 2290 | g = (c & 0x07e0) >> 3; |
| 2291 | 2291 | r = (c & 0xf800) >> 8; |
| 2292 | 2292 | |
| 2293 | if (y<=cliprect | |
| 2293 | if (y<=cliprect. | |
| 2294 | 2294 | *fbaddr = b | (g<<8) | (r<<16); |
| 2295 | 2295 | |
| 2296 | 2296 | fbaddr=&bitmap->pix32(y, x*2+1); |
| 2297 | 2297 | |
| 2298 | if (y<=cliprect | |
| 2298 | if (y<=cliprect. | |
| 2299 | 2299 | *fbaddr = b | (g<<8) | (r<<16); |
| 2300 | 2300 | |
| 2301 | 2301 | addrp+=2; |
| r13798 | r13799 | |
| 2312 | 2312 | g = (c & 0x07e0) >> 3; |
| 2313 | 2313 | r = (c & 0xf800) >> 8; |
| 2314 | 2314 | |
| 2315 | if (y<=cliprect | |
| 2315 | if (y<=cliprect. | |
| 2316 | 2316 | *fbaddr = b | (g<<8) | (r<<16); |
| 2317 | 2317 | addrp+=2; |
| 2318 | 2318 | } |
| r13798 | r13799 | |
| 2335 | 2335 | g = (c & 0x07e0) >> 3; |
| 2336 | 2336 | r = (c & 0xf800) >> 8; |
| 2337 | 2337 | |
| 2338 | if (y<=cliprect | |
| 2338 | if (y<=cliprect. | |
| 2339 | 2339 | *fbaddr = b | (g<<8) | (r<<16); |
| 2340 | 2340 | |
| 2341 | 2341 | fbaddr=&bitmap->pix32(y, x*2+1); |
| 2342 | 2342 | |
| 2343 | if (y<=cliprect | |
| 2343 | if (y<=cliprect. | |
| 2344 | 2344 | *fbaddr = b | (g<<8) | (r<<16); |
| 2345 | 2345 | addrp+=2; |
| 2346 | 2346 | } |
| r13798 | r13799 | |
| 2356 | 2356 | g = (c & 0x07e0) >> 3; |
| 2357 | 2357 | r = (c & 0xf800) >> 8; |
| 2358 | 2358 | |
| 2359 | if (y<=cliprect | |
| 2359 | if (y<=cliprect. | |
| 2360 | 2360 | *fbaddr = b | (g<<8) | (r<<16); |
| 2361 | 2361 | addrp+=2; |
| 2362 | 2362 | } |
| r13798 | r13799 | |
| 2379 | 2379 | g = (c & 0x07e0) >> 3; |
| 2380 | 2380 | r = (c & 0xf800) >> 8; |
| 2381 | 2381 | |
| 2382 | if (y<=cliprect | |
| 2382 | if (y<=cliprect. | |
| 2383 | 2383 | *fbaddr = b | (g<<8) | (r<<16); |
| 2384 | 2384 | |
| 2385 | 2385 | fbaddr=&bitmap->pix32(y, x*2+1); |
| 2386 | if (y<=cliprect | |
| 2386 | if (y<=cliprect. | |
| 2387 | 2387 | *fbaddr = b | (g<<8) | (r<<16); |
| 2388 | 2388 | |
| 2389 | 2389 | addrp+=2; |
| r13798 | r13799 | |
| 2400 | 2400 | g = (c & 0x07e0) >> 3; |
| 2401 | 2401 | r = (c & 0xf800) >> 8; |
| 2402 | 2402 | |
| 2403 | if (y<=cliprect | |
| 2403 | if (y<=cliprect. | |
| 2404 | 2404 | *fbaddr = b | (g<<8) | (r<<16); |
| 2405 | 2405 | addrp+=2; |
| 2406 | 2406 | } |
| r13798 | r13799 | |
| 2679 | 2679 | } |
| 2680 | 2680 | #endif |
| 2681 | 2681 | |
| 2682 | bitmap->fill(MAKE_ARGB(0xff,vo_border_R,vo_border_G,vo_border_B), | |
| 2682 | bitmap->fill(MAKE_ARGB(0xff,vo_border_R,vo_border_G,vo_border_B), | |
| 2683 | 2683 | |
| 2684 | 2684 | if(!spg_blank_video) |
| 2685 | 2685 | pvr_drawframebuffer(screen.machine(),bitmap,cliprect); |
| r13798 | r13799 | |
|---|---|---|
| 19 | 19 | |
| 20 | 20 | if (state->m_bghide) |
| 21 | 21 | { |
| 22 | bitmap->fill(0, | |
| 22 | bitmap->fill(0, | |
| 23 | 23 | |
| 24 | 24 | |
| 25 | 25 | /* kludge to fix scroll after death */ |
| r13798 | r13799 | |
|---|---|---|
| 97 | 97 | |
| 98 | 98 | */ |
| 99 | 99 | |
| 100 | static void draw_object(running_machine &machine, bitmap_t *bitmap, const rectangle | |
| 100 | static void draw_object(running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect, UINT32 w1, UINT32 w2, UINT8 bank_type) | |
| 101 | 101 | { |
| 102 | 102 | taitojc_state *state = machine.driver_data<taitojc_state>(); |
| 103 | 103 | int x, y, width, height, palette; |
| r13798 | r13799 | |
| 151 | 151 | y2 = y + height; |
| 152 | 152 | |
| 153 | 153 | // trivial rejection |
| 154 | if (x1 > cliprect | |
| 154 | if (x1 > cliprect. | |
| 155 | 155 | { |
| 156 | 156 | return; |
| 157 | 157 | } |
| r13798 | r13799 | |
| 162 | 162 | iy = 0; |
| 163 | 163 | |
| 164 | 164 | // clip |
| 165 | if (x1 < cliprect | |
| 165 | if (x1 < cliprect. | |
| 166 | 166 | { |
| 167 | ix = abs(cliprect->min_x - x1); | |
| 168 | x1 = cliprect->min_x; | |
| 167 | ix = abs(cliprect.min_x - x1); | |
| 168 | x1 = cliprect.min_x; | |
| 169 | 169 | } |
| 170 | if (x2 > cliprect | |
| 170 | if (x2 > cliprect. | |
| 171 | 171 | { |
| 172 | x2 = cliprect | |
| 172 | x2 = cliprect. | |
| 173 | 173 | } |
| 174 | if (y1 < cliprect | |
| 174 | if (y1 < cliprect. | |
| 175 | 175 | { |
| 176 | iy = abs(cliprect->min_y - y1); | |
| 177 | y1 = cliprect->min_y; | |
| 176 | iy = abs(cliprect.min_y - y1); | |
| 177 | y1 = cliprect.min_y; | |
| 178 | 178 | } |
| 179 | if (y2 > cliprect | |
| 179 | if (y2 > cliprect. | |
| 180 | 180 | { |
| 181 | y2 = cliprect | |
| 181 | y2 = cliprect. | |
| 182 | 182 | } |
| 183 | 183 | |
| 184 | 184 | /* this bit seems to set up border at left/right of screen (reads at 0xffc00) */ |
| r13798 | r13799 | |
| 292 | 292 | state->m_zbuffer = auto_bitmap_alloc(machine, width, height, BITMAP_FORMAT_INDEXED16); |
| 293 | 293 | } |
| 294 | 294 | |
| 295 | static void draw_object_bank(running_machine &machine, bitmap_t *bitmap, const rectangle | |
| 295 | static void draw_object_bank(running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect, UINT8 bank_type, UINT8 pri) | |
| 296 | 296 | { |
| 297 | 297 | taitojc_state *state = machine.driver_data<taitojc_state>(); |
| 298 | 298 | UINT16 start_offs; |
| r13798 | r13799 | |
| 338 | 338 | } |
| 339 | 339 | #endif |
| 340 | 340 | |
| 341 | bitmap->fill(0, | |
| 341 | bitmap->fill(0, | |
| 342 | 342 | |
| 343 | 343 | /* 0xf000 used on Densha de Go disclaimer screen(s) (disable object RAM?) */ |
| 344 | 344 | if((state->m_objlist[0xfc4/4] & 0x0000ffff) != 0x0000 && (state->m_objlist[0xfc4/4] & 0x0000ffff) != 0x2000 && (state->m_objlist[0xfc4/4] & 0x0000ffff) != 0xf000 ) |
| r13798 | r13799 | |
| 362 | 362 | if (debug_tex_pal > 0) |
| 363 | 363 | { |
| 364 | 364 | int j; |
| 365 | for (j=cliprect | |
| 365 | for (j=cliprect. | |
| 366 | 366 | { |
| 367 | 367 | UINT16 *d = &bitmap->pix16(j); |
| 368 | 368 | int index = 2048 * j; |
| 369 | 369 | |
| 370 | for (i=cliprect | |
| 370 | for (i=cliprect. | |
| 371 | 371 | { |
| 372 | 372 | UINT8 t = state->m_texture[index+i]; |
| 373 | 373 | UINT32 color; |
| r13798 | r13799 | |
| 593 | 593 | |
| 594 | 594 | if (vert[0].p[0] < 0x8000 && vert[1].p[0] < 0x8000 && vert[2].p[0] < 0x8000) |
| 595 | 595 | { |
| 596 | poly_render_triangle(state->m_poly, state->m_framebuffer, | |
| 596 | poly_render_triangle(state->m_poly, state->m_framebuffer, | |
| 597 | 597 | } |
| 598 | 598 | break; |
| 599 | 599 | } |
| r13798 | r13799 | |
| 644 | 644 | vert[2].p[1] == vert[3].p[1]) |
| 645 | 645 | { |
| 646 | 646 | // optimization: all colours the same -> render solid |
| 647 | poly_render_quad(state->m_poly, state->m_framebuffer, | |
| 647 | poly_render_quad(state->m_poly, state->m_framebuffer, | |
| 648 | 648 | } |
| 649 | 649 | else |
| 650 | 650 | { |
| 651 | poly_render_quad(state->m_poly, state->m_framebuffer, | |
| 651 | poly_render_quad(state->m_poly, state->m_framebuffer, | |
| 652 | 652 | } |
| 653 | 653 | } |
| 654 | 654 | break; |
| r13798 | r13799 | |
| 716 | 716 | |
| 717 | 717 | if (vert[0].p[0] < 0x8000 && vert[1].p[0] < 0x8000 && vert[2].p[0] < 0x8000 && vert[3].p[0] < 0x8000) |
| 718 | 718 | { |
| 719 | poly_render_quad(state->m_poly, state->m_framebuffer, | |
| 719 | poly_render_quad(state->m_poly, state->m_framebuffer, | |
| 720 | 720 | } |
| 721 | 721 | break; |
| 722 | 722 | } |
| r13798 | r13799 | |
| 765 | 765 | vert[1].p[1] == vert[2].p[1]) |
| 766 | 766 | { |
| 767 | 767 | // optimization: all colours the same -> render solid |
| 768 | poly_render_triangle(state->m_poly, state->m_framebuffer, | |
| 768 | poly_render_triangle(state->m_poly, state->m_framebuffer, | |
| 769 | 769 | } |
| 770 | 770 | else |
| 771 | 771 | { |
| 772 | poly_render_triangle(state->m_poly, state->m_framebuffer, | |
| 772 | poly_render_triangle(state->m_poly, state->m_framebuffer, | |
| 773 | 773 | } |
| 774 | 774 | } |
| 775 | 775 | break; |
| r13798 | r13799 | |
|---|---|---|
| 182 | 182 | pitnrun_spotlights(machine); |
| 183 | 183 | } |
| 184 | 184 | |
| 185 | static void draw_sprites(running_machine &machine, bitmap_t *bitmap, const rectangle | |
| 185 | static void draw_sprites(running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect ) | |
| 186 | 186 | { |
| 187 | 187 | pitnrun_state *state = machine.driver_data<pitnrun_state>(); |
| 188 | 188 | UINT8 *spriteram = state->m_spriteram; |
| r13798 | r13799 | |
| 221 | 221 | { |
| 222 | 222 | pitnrun_state *state = screen.machine().driver_data<pitnrun_state>(); |
| 223 | 223 | int dx=0,dy=0; |
| 224 | rectangle myclip= | |
| 224 | rectangle myclip= | |
| 225 | 225 | |
| 226 | 226 | #ifdef MAME_DEBUG |
| 227 | 227 | if (screen.machine().input().code_pressed_once(KEYCODE_Q)) |
| r13798 | r13799 | |
| 244 | 244 | } |
| 245 | 245 | #endif |
| 246 | 246 | |
| 247 | bitmap->fill(0, | |
| 247 | bitmap->fill(0, | |
| 248 | 248 | |
| 249 | 249 | if(!(state->m_ha&4)) |
| 250 | 250 | tilemap_draw(bitmap,cliprect,state->m_bg, 0,0); |
| r13798 | r13799 | |
| 265 | 265 | myclip.max_y=dy+127; |
| 266 | 266 | |
| 267 | 267 | |
| 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; | |
| 270 | 270 | |
| 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; | |
| 273 | 273 | |
| 274 | tilemap_draw(bitmap, | |
| 274 | tilemap_draw(bitmap, | |
| 275 | 275 | } |
| 276 | 276 | |
| 277 | draw_sprites(screen.machine(),bitmap, | |
| 277 | draw_sprites(screen.machine(),bitmap, | |
| 278 | 278 | |
| 279 | 279 | 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, | |
| 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, | |
| 281 | 281 | tilemap_draw(bitmap,cliprect,state->m_fg, 0,0); |
| 282 | 282 | return 0; |
| 283 | 283 | } |
| r13798 | r13799 | |
|---|---|---|
| 372 | 372 | { |
| 373 | 373 | const void *base = waveram1_ptr_from_expanded_addr(zeusbase[0x38]); |
| 374 | 374 | int xoffs = screen.visible_area().min_x; |
| 375 | for (y = cliprect | |
| 375 | for (y = cliprect. | |
| 376 | 376 | { |
| 377 | 377 | UINT32 *dest = &bitmap->pix32(y); |
| 378 | for (x = cliprect | |
| 378 | for (x = cliprect. | |
| 379 | 379 | dest[x] = WAVERAM_READPIX(base, y, x - xoffs); |
| 380 | 380 | } |
| 381 | 381 | } |
| r13798 | r13799 | |
| 393 | 393 | if (yoffs < 0) yoffs = 0; |
| 394 | 394 | base = (const UINT64 *)waveram0_ptr_from_expanded_addr(yoffs << 16); |
| 395 | 395 | |
| 396 | for (y = cliprect | |
| 396 | for (y = cliprect. | |
| 397 | 397 | { |
| 398 | 398 | UINT32 *dest = &bitmap->pix32(y); |
| 399 | for (x = cliprect | |
| 399 | for (x = cliprect. | |
| 400 | 400 | { |
| 401 | 401 | UINT8 tex = get_texel_8bit(base, y, x, texel_width); |
| 402 | 402 | dest[x] = (tex << 16) | (tex << 8) | tex; |
| r13798 | r13799 | |
| 1260 | 1260 | extra->texbase = WAVERAM_BLOCK0(zeus_texbase); |
| 1261 | 1261 | extra->palbase = waveram0_ptr_from_expanded_addr(zeusbase[0x41]); |
| 1262 | 1262 | |
| 1263 | poly_render_quad_fan(poly, NULL, | |
| 1263 | poly_render_quad_fan(poly, NULL, | |
| 1264 | 1264 | } |
| 1265 | 1265 | |
| 1266 | 1266 |
| r13798 | r13799 | |
|---|---|---|
| 518 | 518 | * |
| 519 | 519 | *************************************/ |
| 520 | 520 | |
| 521 | static void segaic16_draw_virtual_tilemap(running_machine &machine, struct tilemap_info *info, bitmap_t *bitmap, const rectangle | |
| 521 | static 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) | |
| 522 | 522 | { |
| 523 | 523 | int leftmin = -1, leftmax = -1, rightmin = -1, rightmax = -1; |
| 524 | 524 | int topmin = -1, topmax = -1, bottommin = -1, bottommax = -1; |
| r13798 | r13799 | |
| 616 | 616 | /* draw the upper-left chunk */ |
| 617 | 617 | if (leftmin != -1 && topmin != -1) |
| 618 | 618 | { |
| 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; | |
| 623 | 623 | if (pageclip.min_x <= pageclip.max_x && pageclip.min_y <= pageclip.max_y) |
| 624 | 624 | { |
| 625 | 625 | page = (pages >> 0) & 0xf; |
| 626 | 626 | tilemap_set_scrollx(info->tilemaps[page], 0, xscroll); |
| 627 | 627 | tilemap_set_scrolly(info->tilemaps[page], 0, yscroll); |
| 628 | tilemap_draw(bitmap, | |
| 628 | tilemap_draw(bitmap, | |
| 629 | 629 | } |
| 630 | 630 | } |
| 631 | 631 | |
| 632 | 632 | /* draw the upper-right chunk */ |
| 633 | 633 | if (rightmin != -1 && topmin != -1) |
| 634 | 634 | { |
| 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; | |
| 639 | 639 | if (pageclip.min_x <= pageclip.max_x && pageclip.min_y <= pageclip.max_y) |
| 640 | 640 | { |
| 641 | 641 | page = (pages >> 4) & 0xf; |
| 642 | 642 | tilemap_set_scrollx(info->tilemaps[page], 0, xscroll); |
| 643 | 643 | tilemap_set_scrolly(info->tilemaps[page], 0, yscroll); |
| 644 | tilemap_draw(bitmap, | |
| 644 | tilemap_draw(bitmap, | |
| 645 | 645 | } |
| 646 | 646 | } |
| 647 | 647 | |
| 648 | 648 | /* draw the lower-left chunk */ |
| 649 | 649 | if (leftmin != -1 && bottommin != -1) |
| 650 | 650 | { |
| 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; | |
| 655 | 655 | if (pageclip.min_x <= pageclip.max_x && pageclip.min_y <= pageclip.max_y) |
| 656 | 656 | { |
| 657 | 657 | page = (pages >> 8) & 0xf; |
| 658 | 658 | tilemap_set_scrollx(info->tilemaps[page], 0, xscroll); |
| 659 | 659 | tilemap_set_scrolly(info->tilemaps[page], 0, yscroll); |
| 660 | tilemap_draw(bitmap, | |
| 660 | tilemap_draw(bitmap, | |
| 661 | 661 | } |
| 662 | 662 | } |
| 663 | 663 | |
| 664 | 664 | /* draw the lower-right chunk */ |
| 665 | 665 | if (rightmin != -1 && bottommin != -1) |
| 666 | 666 | { |
| 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; | |
| 671 | 671 | if (pageclip.min_x <= pageclip.max_x && pageclip.min_y <= pageclip.max_y) |
| 672 | 672 | { |
| 673 | 673 | page = (pages >> 12) & 0xf; |
| 674 | 674 | tilemap_set_scrollx(info->tilemaps[page], 0, xscroll); |
| 675 | 675 | tilemap_set_scrolly(info->tilemaps[page], 0, yscroll); |
| 676 | tilemap_draw(bitmap, | |
| 676 | tilemap_draw(bitmap, | |
| 677 | 677 | } |
| 678 | 678 | } |
| 679 | 679 | } |
| r13798 | r13799 | |
| 744 | 744 | } |
| 745 | 745 | |
| 746 | 746 | |
| 747 | static void segaic16_tilemap_16a_draw_layer(running_machine &machine, struct tilemap_info *info, bitmap_t *bitmap, const rectangle | |
| 747 | static 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) | |
| 748 | 748 | { |
| 749 | 749 | UINT16 *textram = info->textram; |
| 750 | 750 | |
| r13798 | r13799 | |
| 766 | 766 | if (PRINT_UNUSUAL_MODES) mame_printf_debug("Column AND row scroll\n"); |
| 767 | 767 | |
| 768 | 768 | /* loop over row chunks */ |
| 769 | for (y = cliprect | |
| 769 | for (y = cliprect. | |
| 770 | 770 | { |
| 771 | 771 | int rowscrollindex = (info->flip ? (216 - y) : y) / 8; |
| 772 | 772 | rectangle rowcolclip; |
| 773 | 773 | |
| 774 | 774 | /* 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; | |
| 777 | 777 | |
| 778 | 778 | /* loop over column chunks */ |
| 779 | for (x = cliprect | |
| 779 | for (x = cliprect. | |
| 780 | 780 | { |
| 781 | 781 | UINT16 effxscroll, effyscroll; |
| 782 | 782 | |
| 783 | 783 | /* 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; | |
| 786 | 786 | |
| 787 | 787 | /* get the effective scroll values */ |
| 788 | 788 | effxscroll = textram[0xf80/2 + rowscrollindex * 2 + which] & 0x1ff; |
| r13798 | r13799 | |
| 795 | 795 | /* draw the chunk */ |
| 796 | 796 | effxscroll = (0xc8 - effxscroll + info->xoffs) & 0x3ff; |
| 797 | 797 | effyscroll = effyscroll & 0x1ff; |
| 798 | segaic16_draw_virtual_tilemap(machine, info, bitmap, | |
| 798 | segaic16_draw_virtual_tilemap(machine, info, bitmap, | |
| 799 | 799 | } |
| 800 | 800 | } |
| 801 | 801 | } |
| r13798 | r13799 | |
| 804 | 804 | if (PRINT_UNUSUAL_MODES) mame_printf_debug("Column scroll\n"); |
| 805 | 805 | |
| 806 | 806 | /* loop over column chunks */ |
| 807 | for (x = cliprect | |
| 807 | for (x = cliprect. | |
| 808 | 808 | { |
| 809 | rectangle colclip = | |
| 809 | rectangle colclip = | |
| 810 | 810 | UINT16 effxscroll, effyscroll; |
| 811 | 811 | |
| 812 | 812 | /* 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; | |
| 815 | 815 | |
| 816 | 816 | /* get the effective scroll values */ |
| 817 | 817 | effxscroll = xscroll; |
| r13798 | r13799 | |
| 824 | 824 | /* draw the chunk */ |
| 825 | 825 | effxscroll = (0xc8 - effxscroll + info->xoffs) & 0x3ff; |
| 826 | 826 | effyscroll = effyscroll & 0x1ff; |
| 827 | segaic16_draw_virtual_tilemap(machine, info, bitmap, | |
| 827 | segaic16_draw_virtual_tilemap(machine, info, bitmap, | |
| 828 | 828 | } |
| 829 | 829 | } |
| 830 | 830 | else if (info->rowscroll) |
| r13798 | r13799 | |
| 832 | 832 | if (PRINT_UNUSUAL_MODES) mame_printf_debug("Row scroll\n"); |
| 833 | 833 | |
| 834 | 834 | /* loop over row chunks */ |
| 835 | for (y = cliprect | |
| 835 | for (y = cliprect. | |
| 836 | 836 | { |
| 837 | 837 | int rowscrollindex = (info->flip ? (216 - y) : y) / 8; |
| 838 | rectangle rowclip = | |
| 838 | rectangle rowclip = | |
| 839 | 839 | UINT16 effxscroll, effyscroll; |
| 840 | 840 | |
| 841 | 841 | /* 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; | |
| 844 | 844 | |
| 845 | 845 | /* get the effective scroll values */ |
| 846 | 846 | effxscroll = textram[0xf80/2 + rowscrollindex * 2 + which] & 0x1ff; |
| r13798 | r13799 | |
| 853 | 853 | /* draw the chunk */ |
| 854 | 854 | effxscroll = (0xc8 - effxscroll + info->xoffs) & 0x3ff; |
| 855 | 855 | effyscroll = effyscroll & 0x1ff; |
| 856 | segaic16_draw_virtual_tilemap(machine, info, bitmap, | |
| 856 | segaic16_draw_virtual_tilemap(machine, info, bitmap, | |
| 857 | 857 | } |
| 858 | 858 | } |
| 859 | 859 | else |
| r13798 | r13799 | |
| 986 | 986 | } |
| 987 | 987 | |
| 988 | 988 | |
| 989 | static void segaic16_tilemap_16b_draw_layer(running_machine &machine, struct tilemap_info *info, bitmap_t *bitmap, const rectangle | |
| 989 | static 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) | |
| 990 | 990 | { |
| 991 | 991 | UINT16 *textram = info->textram; |
| 992 | 992 | UINT16 xscroll, yscroll, pages; |
| r13798 | r13799 | |
| 1003 | 1003 | if (PRINT_UNUSUAL_MODES) mame_printf_debug("Column AND row scroll\n"); |
| 1004 | 1004 | |
| 1005 | 1005 | /* loop over row chunks */ |
| 1006 | for (y = cliprect | |
| 1006 | for (y = cliprect. | |
| 1007 | 1007 | { |
| 1008 | 1008 | int rowscrollindex = (info->flip ? (216 - y) : y) / 8; |
| 1009 | 1009 | rectangle rowcolclip; |
| 1010 | 1010 | |
| 1011 | 1011 | /* 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; | |
| 1014 | 1014 | |
| 1015 | 1015 | /* loop over column chunks */ |
| 1016 | for (x = ((cliprect | |
| 1016 | for (x = ((cliprect. | |
| 1017 | 1017 | { |
| 1018 | 1018 | UINT16 effxscroll, effyscroll, rowscroll; |
| 1019 | 1019 | UINT16 effpages = pages; |
| 1020 | 1020 | |
| 1021 | 1021 | /* 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; | |
| 1024 | 1024 | |
| 1025 | 1025 | /* get the effective scroll values */ |
| 1026 | 1026 | rowscroll = textram[0xf80/2 + 0x40/2 * which + rowscrollindex]; |
| r13798 | r13799 | |
| 1038 | 1038 | /* draw the chunk */ |
| 1039 | 1039 | effxscroll = (0xc0 - effxscroll + info->xoffs) & 0x3ff; |
| 1040 | 1040 | effyscroll = effyscroll & 0x1ff; |
| 1041 | segaic16_draw_virtual_tilemap(machine, info, bitmap, | |
| 1041 | segaic16_draw_virtual_tilemap(machine, info, bitmap, | |
| 1042 | 1042 | } |
| 1043 | 1043 | } |
| 1044 | 1044 | } |
| r13798 | r13799 | |
| 1047 | 1047 | if (PRINT_UNUSUAL_MODES) mame_printf_debug("Row scroll\n"); |
| 1048 | 1048 | |
| 1049 | 1049 | /* loop over row chunks */ |
| 1050 | for (y = cliprect | |
| 1050 | for (y = cliprect. | |
| 1051 | 1051 | { |
| 1052 | 1052 | int rowscrollindex = (info->flip ? (216 - y) : y) / 8; |
| 1053 | rectangle rowclip = | |
| 1053 | rectangle rowclip = | |
| 1054 | 1054 | UINT16 effxscroll, effyscroll, rowscroll; |
| 1055 | 1055 | UINT16 effpages = pages; |
| 1056 | 1056 | |
| 1057 | 1057 | /* 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; | |
| 1060 | 1060 | |
| 1061 | 1061 | /* get the effective scroll values */ |
| 1062 | 1062 | rowscroll = textram[0xf80/2 + 0x40/2 * which + rowscrollindex]; |
| r13798 | r13799 | |
| 1074 | 1074 | /* draw the chunk */ |
| 1075 | 1075 | effxscroll = (0xc0 - effxscroll + info->xoffs) & 0x3ff; |
| 1076 | 1076 | effyscroll = effyscroll & 0x1ff; |
| 1077 | segaic16_draw_virtual_tilemap(machine, info, bitmap, | |
| 1077 | segaic16_draw_virtual_tilemap(machine, info, bitmap, | |
| 1078 | 1078 | } |
| 1079 | 1079 | } |
| 1080 | 1080 | } |
| r13798 | r13799 | |
| 1224 | 1224 | * |
| 1225 | 1225 | *************************************/ |
| 1226 | 1226 | |
| 1227 | void segaic16_tilemap_draw(screen_device &screen, bitmap_t *bitmap, const rectangle | |
| 1227 | void segaic16_tilemap_draw(screen_device &screen, bitmap_t *bitmap, const rectangle &cliprect, int which, int map, int priority, int priority_mark) | |
| 1228 | 1228 | { |
| 1229 | 1229 | running_machine &machine = screen.machine(); |
| 1230 | 1230 | struct tilemap_info *info = &bg_tilemap[which]; |
| r13798 | r13799 | |
| 1431 | 1431 | } |
| 1432 | 1432 | |
| 1433 | 1433 | |
| 1434 | static void segaic16_road_hangon_draw(struct road_info *info, bitmap_t *bitmap, const rectangle | |
| 1434 | static void segaic16_road_hangon_draw(struct road_info *info, bitmap_t *bitmap, const rectangle &cliprect, int priority) | |
| 1435 | 1435 | { |
| 1436 | 1436 | UINT16 *roadram = info->roadram; |
| 1437 | 1437 | int x, y; |
| 1438 | 1438 | |
| 1439 | 1439 | /* loop over scanlines */ |
| 1440 | for (y = cliprect | |
| 1440 | for (y = cliprect. | |
| 1441 | 1441 | { |
| 1442 | 1442 | UINT16 *dest = &bitmap->pix16(y); |
| 1443 | 1443 | int control = roadram[0x000 + y]; |
| r13798 | r13799 | |
| 1474 | 1474 | ss8j = 0; |
| 1475 | 1475 | |
| 1476 | 1476 | /* draw this scanline from the beginning */ |
| 1477 | for (x = -24; x <= cliprect | |
| 1477 | for (x = -24; x <= cliprect. | |
| 1478 | 1478 | { |
| 1479 | 1479 | int md, color, select; |
| 1480 | 1480 | |
| r13798 | r13799 | |
| 1547 | 1547 | } |
| 1548 | 1548 | |
| 1549 | 1549 | /* write the pixel if we're past the minimum clip */ |
| 1550 | if (x >= cliprect | |
| 1550 | if (x >= cliprect. | |
| 1551 | 1551 | dest[x] = color; |
| 1552 | 1552 | |
| 1553 | 1553 | /* ---- the following logic all happens on the 6M clock ---- */ |
| r13798 | r13799 | |
| 1701 | 1701 | } |
| 1702 | 1702 | |
| 1703 | 1703 | |
| 1704 | static void segaic16_road_outrun_draw(struct road_info *info, bitmap_t *bitmap, const rectangle | |
| 1704 | static void segaic16_road_outrun_draw(struct road_info *info, bitmap_t *bitmap, const rectangle &cliprect, int priority) | |
| 1705 | 1705 | { |
| 1706 | 1706 | UINT16 *roadram = info->buffer; |
| 1707 | 1707 | int x, y; |
| 1708 | 1708 | |
| 1709 | 1709 | /* loop over scanlines */ |
| 1710 | for (y = cliprect | |
| 1710 | for (y = cliprect. | |
| 1711 | 1711 | { |
| 1712 | 1712 | static const UINT8 priority_map[2][8] = |
| 1713 | 1713 | { |
| r13798 | r13799 | |
| 1759 | 1759 | if (color != -1) |
| 1760 | 1760 | { |
| 1761 | 1761 | color |= info->colorbase3; |
| 1762 | for (x = cliprect | |
| 1762 | for (x = cliprect. | |
| 1763 | 1763 | dest[x] = color; |
| 1764 | 1764 | } |
| 1765 | 1765 | } |
| r13798 | r13799 | |
| 1810 | 1810 | if (data0 & 0x800) |
| 1811 | 1811 | continue; |
| 1812 | 1812 | hpos0 = (hpos0 - (0x5f8 + info->xoffs)) & 0xfff; |
| 1813 | for (x = cliprect | |
| 1813 | for (x = cliprect. | |
| 1814 | 1814 | { |
| 1815 | 1815 | int pix0 = (hpos0 < 0x200) ? src0[hpos0] : 3; |
| 1816 | 1816 | dest[x] = color_table[0x00 + pix0]; |
| r13798 | r13799 | |
| 1821 | 1821 | case 1: |
| 1822 | 1822 | hpos0 = (hpos0 - (0x5f8 + info->xoffs)) & 0xfff; |
| 1823 | 1823 | hpos1 = (hpos1 - (0x5f8 + info->xoffs)) & 0xfff; |
| 1824 | for (x = cliprect | |
| 1824 | for (x = cliprect. | |
| 1825 | 1825 | { |
| 1826 | 1826 | int pix0 = (hpos0 < 0x200) ? src0[hpos0] : 3; |
| 1827 | 1827 | int pix1 = (hpos1 < 0x200) ? src1[hpos1] : 3; |
| r13798 | r13799 | |
| 1837 | 1837 | case 2: |
| 1838 | 1838 | hpos0 = (hpos0 - (0x5f8 + info->xoffs)) & 0xfff; |
| 1839 | 1839 | hpos1 = (hpos1 - (0x5f8 + info->xoffs)) & 0xfff; |
| 1840 | for (x = cliprect | |
| 1840 | for (x = cliprect. | |
| 1841 | 1841 | { |
| 1842 | 1842 | int pix0 = (hpos0 < 0x200) ? src0[hpos0] : 3; |
| 1843 | 1843 | int pix1 = (hpos1 < 0x200) ? src1[hpos1] : 3; |
| r13798 | r13799 | |
| 1854 | 1854 | if (data1 & 0x800) |
| 1855 | 1855 | continue; |
| 1856 | 1856 | hpos1 = (hpos1 - (0x5f8 + info->xoffs)) & 0xfff; |
| 1857 | for (x = cliprect | |
| 1857 | for (x = cliprect. | |
| 1858 | 1858 | { |
| 1859 | 1859 | int pix1 = (hpos1 < 0x200) ? src1[hpos1] : 3; |
| 1860 | 1860 | dest[x] = color_table[0x10 + pix1]; |
| r13798 | r13799 | |
| 1927 | 1927 | * |
| 1928 | 1928 | *************************************/ |
| 1929 | 1929 | |
| 1930 | void segaic16_road_draw(int which, bitmap_t *bitmap, const rectangle | |
| 1930 | void segaic16_road_draw(int which, bitmap_t *bitmap, const rectangle &cliprect, int priority) | |
| 1931 | 1931 | { |
| 1932 | 1932 | struct road_info *info = &segaic16_road[which]; |
| 1933 | 1933 | (*info->draw)(info, bitmap, cliprect, priority); |
| r13798 | r13799 | |
| 2029 | 2029 | * |
| 2030 | 2030 | *************************************/ |
| 2031 | 2031 | |
| 2032 | void segaic16_rotate_draw(running_machine &machine, int which, bitmap_t *bitmap, const rectangle | |
| 2032 | void segaic16_rotate_draw(running_machine &machine, int which, bitmap_t *bitmap, const rectangle &cliprect, bitmap_t *srcbitmap) | |
| 2033 | 2033 | { |
| 2034 | 2034 | struct rotate_info *info = &segaic16_rotate[which]; |
| 2035 | 2035 | INT32 currx = (info->buffer[0x3f0] << 16) | info->buffer[0x3f1]; |
| r13798 | r13799 | |
| 2041 | 2041 | int x, y; |
| 2042 | 2042 | |
| 2043 | 2043 | /* 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; | |
| 2046 | 2046 | |
| 2047 | 2047 | /* loop over screen Y coordinates */ |
| 2048 | for (y = cliprect | |
| 2048 | for (y = cliprect. | |
| 2049 | 2049 | { |
| 2050 | 2050 | UINT16 *dest = &bitmap->pix16(y); |
| 2051 | 2051 | UINT16 *src = &srcbitmap->pix16(0); |
| r13798 | r13799 | |
| 2054 | 2054 | INT32 ty = curry; |
| 2055 | 2055 | |
| 2056 | 2056 | /* loop over screen X coordinates */ |
| 2057 | for (x = cliprect | |
| 2057 | for (x = cliprect. | |
| 2058 | 2058 | { |
| 2059 | 2059 | /* fetch the pixel from the source bitmap */ |
| 2060 | 2060 | int sx = (tx >> 14) & 0x1ff; |
| r13798 | r13799 | |
|---|---|---|
| 123 | 123 | bit 7 = enable (0 = display off) |
| 124 | 124 | */ |
| 125 | 125 | |
| 126 | static void gridiron_draw_led(running_machine &machine, bitmap_t *bitmap, const rectangle | |
| 126 | static void gridiron_draw_led(running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect, UINT8 led,int player) | |
| 127 | 127 | { |
| 128 | 128 | if (led&0x80) |
| 129 | 129 | output_set_digit_value(player, led&0x7f); |
| r13798 | r13799 | |
| 131 | 131 | output_set_digit_value(player, 0x00); |
| 132 | 132 | } |
| 133 | 133 | |
| 134 | static void draw_sprites(running_machine &machine, bitmap_t *bitmap, const rectangle | |
| 134 | static void draw_sprites(running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect) | |
| 135 | 135 | { |
| 136 | 136 | tehkanwc_state *state = machine.driver_data<tehkanwc_state>(); |
| 137 | 137 | UINT8 *spriteram = state->m_spriteram; |
| r13798 | r13799 | |
|---|---|---|
| 207 | 207 | |
| 208 | 208 | ***************************************************************************/ |
| 209 | 209 | |
| 210 | static void draw_sprites( running_machine &machine, bitmap_t *bitmap, const rectangle | |
| 210 | static void draw_sprites( running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect ) | |
| 211 | 211 | { |
| 212 | 212 | UINT16 *buffered_spriteram = machine.generic.buffered_spriteram.u16; |
| 213 | 213 | // bionicc_state *state = machine.driver_data<bionicc_state>(); |
| r13798 | r13799 | |
| 250 | 250 | { |
| 251 | 251 | bionicc_state *state = screen.machine().driver_data<bionicc_state>(); |
| 252 | 252 | |
| 253 | bitmap->fill(get_black_pen(screen.machine()), | |
| 253 | bitmap->fill(get_black_pen(screen.machine()), | |
| 254 | 254 | tilemap_draw(bitmap, cliprect, state->m_fg_tilemap, 1 | TILEMAP_DRAW_LAYER1, 0); /* nothing in FRONT */ |
| 255 | 255 | tilemap_draw(bitmap, cliprect, state->m_bg_tilemap, 0, 0); |
| 256 | 256 | tilemap_draw(bitmap, cliprect, state->m_fg_tilemap, 0 | TILEMAP_DRAW_LAYER1, 0); |
| r13798 | r13799 | |
|---|---|---|
| 28 | 28 | |
| 29 | 29 | } |
| 30 | 30 | |
| 31 | void deco_karnovsprites_device::draw_sprites( running_machine &machine, bitmap_t *bitmap, const rectangle | |
| 31 | void deco_karnovsprites_device::draw_sprites( running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect, UINT16* spriteram, int size, int priority ) | |
| 32 | 32 | { |
| 33 | 33 | int offs; |
| 34 | 34 |
| r13798 | r13799 | |
|---|---|---|
| 37 | 37 | |
| 38 | 38 | void segaic16_tilemap_init(running_machine &machine, int which, int type, int colorbase, int xoffs, int numbanks); |
| 39 | 39 | void segaic16_tilemap_reset(running_machine &machine, int which); |
| 40 | void segaic16_tilemap_draw(screen_device &screen, bitmap_t *bitmap, const rectangle | |
| 40 | void segaic16_tilemap_draw(screen_device &screen, bitmap_t *bitmap, const rectangle &cliprect, int which, int map, int priority, int priority_mark); | |
| 41 | 41 | void segaic16_tilemap_set_bank(running_machine &machine, int which, int banknum, int offset); |
| 42 | 42 | void segaic16_tilemap_set_flip(running_machine &machine, int which, int flip); |
| 43 | 43 | void segaic16_tilemap_set_rowscroll(running_machine &machine, int which, int enable); |
| r13798 | r13799 | |
| 52 | 52 | #define SEGAIC16_SPRITES_OUTRUN 4 |
| 53 | 53 | #define SEGAIC16_SPRITES_XBOARD 5 |
| 54 | 54 | |
| 55 | void segaic16_sprites_draw(screen_device &screen, bitmap_t *bitmap, const rectangle | |
| 55 | void segaic16_sprites_draw(screen_device &screen, bitmap_t *bitmap, const rectangle &cliprect, int which); | |
| 56 | 56 | void segaic16_sprites_set_bank(running_machine &machine, int which, int banknum, int offset); |
| 57 | 57 | void segaic16_sprites_set_flip(running_machine &machine, int which, int flip); |
| 58 | 58 | void segaic16_sprites_set_shadow(running_machine &machine, int which, int shadow); |
| r13798 | r13799 | |
| 71 | 71 | #define SEGAIC16_ROAD_FOREGROUND 1 |
| 72 | 72 | |
| 73 | 73 | void segaic16_road_init(running_machine &machine, int which, int type, int colorbase1, int colorbase2, int colorbase3, int xoffs); |
| 74 | void segaic16_road_draw(int which, bitmap_t *bitmap, const rectangle | |
| 74 | void segaic16_road_draw(int which, bitmap_t *bitmap, const rectangle &cliprect, int priority); | |
| 75 | 75 | READ16_HANDLER( segaic16_road_control_0_r ); |
| 76 | 76 | WRITE16_HANDLER( segaic16_road_control_0_w ); |
| 77 | 77 | |
| r13798 | r13799 | |
| 81 | 81 | #define SEGAIC16_ROTATE_YBOARD 0 |
| 82 | 82 | |
| 83 | 83 | void segaic16_rotate_init(running_machine &machine, int which, int type, int colorbase); |
| 84 | void segaic16_rotate_draw(running_machine &machine, int which, bitmap_t *bitmap, const rectangle | |
| 84 | void segaic16_rotate_draw(running_machine &machine, int which, bitmap_t *bitmap, const rectangle &cliprect, bitmap_t *srcbitmap); | |
| 85 | 85 | READ16_HANDLER( segaic16_rotate_control_0_r ); |
| 86 | 86 | |
| 87 | 87 | /************************************* |
| r13798 | r13799 | |
| 118 | 118 | struct tilemap_callback_info tmap_info[16]; /* callback info for 16 tilemap pages */ |
| 119 | 119 | struct tilemap_callback_info textmap_info; /* callback info for a single textmap page */ |
| 120 | 120 | 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 | |
| 121 | void (*draw_layer)(running_machine &machine, struct tilemap_info *info, bitmap_t *bitmap, const rectangle &cliprect, int which, int flags, int priority); | |
| 122 | 122 | UINT16 * textram; /* pointer to textram pointer */ |
| 123 | 123 | UINT16 * tileram; /* pointer to tileram pointer */ |
| 124 | 124 | emu_timer * latch_timer; /* timer for latching 16b tilemap scroll values */ |
| r13798 | r13799 | |
| 133 | 133 | UINT16 colorbase2; /* color base for road background data */ |
| 134 | 134 | UINT16 colorbase3; /* color base for sky data */ |
| 135 | 135 | INT32 xoffs; /* X scroll offset */ |
| 136 | void (*draw)(struct road_info *info, bitmap_t *bitmap, const rectangle | |
| 136 | void (*draw)(struct road_info *info, bitmap_t *bitmap, const rectangle &cliprect, int priority); | |
| 137 | 137 | UINT16 * roadram; /* pointer to roadram pointer */ |
| 138 | 138 | UINT16 * buffer; /* buffered roadram pointer */ |
| 139 | 139 | UINT8 * gfx; /* expanded road graphics */ |
| r13798 | r13799 | |
| 165 | 165 | UINT16 colorbase; /* base color index */ |
| 166 | 166 | INT32 ramsize; /* size of sprite RAM */ |
| 167 | 167 | INT32 xoffs; /* X scroll offset */ |
| 168 | void (*draw)(running_machine &machine, device_t* device, bitmap_t *bitmap, const rectangle | |
| 168 | void (*draw)(running_machine &machine, device_t* device, bitmap_t *bitmap, const rectangle &cliprect); | |
| 169 | 169 | int buffer; /* should ram be buffered? */ |
| 170 | 170 | }; |
| 171 | 171 | |
| r13798 | r13799 | |
| 183 | 183 | UINT16 colorbase; /* base color index */ |
| 184 | 184 | INT32 ramsize; /* size of sprite RAM */ |
| 185 | 185 | INT32 xoffs; /* X scroll offset */ |
| 186 | void (*draw)(running_machine &machine, device_t* device, bitmap_t *bitmap, const rectangle | |
| 186 | void (*draw)(running_machine &machine, device_t* device, bitmap_t *bitmap, const rectangle &cliprect); | |
| 187 | 187 | UINT16 * spriteram; /* pointer to spriteram pointer */ |
| 188 | 188 | UINT16 * buffer; /* buffered spriteram for those that use it */ |
| 189 | 189 | |
| r13798 | r13799 | |
| 195 | 195 | |
| 196 | 196 | DECLARE_LEGACY_DEVICE(SEGA16SP, sega16sp); |
| 197 | 197 | |
| 198 | void segaic16_sprites_hangon_draw(running_machine &machine, device_t *device, bitmap_t *bitmap, const rectangle *cliprect); | |
| 199 | void segaic16_sprites_sharrier_draw(running_machine &machine, device_t *device, bitmap_t *bitmap, const rectangle *cliprect); | |
| 200 | void segaic16_sprites_16a_draw(running_machine &machine, device_t *device, bitmap_t *bitmap, const rectangle *cliprect); | |
| 201 | void segaic16_sprites_16b_draw(running_machine &machine, device_t *device, bitmap_t *bitmap, const rectangle *cliprect); | |
| 202 | void segaic16_sprites_yboard_16b_draw(running_machine &machine, device_t *device, bitmap_t *bitmap, const rectangle *cliprect); | |
| 203 | void segaic16_sprites_yboard_draw(running_machine &machine, device_t *device, bitmap_t *bitmap, const rectangle *cliprect); | |
| 204 | void segaic16_sprites_outrun_draw(running_machine &machine, device_t *device, bitmap_t *bitmap, const rectangle *cliprect); | |
| 205 | void segaic16_sprites_xboard_draw(running_machine &machine, device_t *device, bitmap_t *bitmap, const rectangle *cliprect); | |
| 206 | void segaic16_sprites_16a_bootleg_wb3bl_draw(running_machine &machine, device_t *device, bitmap_t *bitmap, const rectangle *cliprect); | |
| 207 | void segaic16_sprites_16a_bootleg_passhtb_draw(running_machine &machine, device_t *device, bitmap_t *bitmap, const rectangle *cliprect); | |
| 208 | void segaic16_sprites_16a_bootleg_shinobld_draw(running_machine &machine, device_t *device, bitmap_t *bitmap, const rectangle *cliprect); | |
| 198 | void segaic16_sprites_hangon_draw(running_machine &machine, device_t *device, bitmap_t *bitmap, const rectangle &cliprect); | |
| 199 | void segaic16_sprites_sharrier_draw(running_machine &machine, device_t *device, bitmap_t *bitmap, const rectangle &cliprect); | |
| 200 | void segaic16_sprites_16a_draw(running_machine &machine, device_t *device, bitmap_t *bitmap, const rectangle &cliprect); | |
| 201 | void segaic16_sprites_16b_draw(running_machine &machine, device_t *device, bitmap_t *bitmap, const rectangle &cliprect); | |
| 202 | void segaic16_sprites_yboard_16b_draw(running_machine &machine, device_t *device, bitmap_t *bitmap, const rectangle &cliprect); | |
| 203 | void segaic16_sprites_yboard_draw(running_machine &machine, device_t *device, bitmap_t *bitmap, const rectangle &cliprect); | |
| 204 | void segaic16_sprites_outrun_draw(running_machine &machine, device_t *device, bitmap_t *bitmap, const rectangle &cliprect); | |
| 205 | void segaic16_sprites_xboard_draw(running_machine &machine, device_t *device, bitmap_t *bitmap, const rectangle &cliprect); | |
| 206 | void segaic16_sprites_16a_bootleg_wb3bl_draw(running_machine &machine, device_t *device, bitmap_t *bitmap, const rectangle &cliprect); | |
| 207 | void segaic16_sprites_16a_bootleg_passhtb_draw(running_machine &machine, device_t *device, bitmap_t *bitmap, const rectangle &cliprect); | |
| 208 | void segaic16_sprites_16a_bootleg_shinobld_draw(running_machine &machine, device_t *device, bitmap_t *bitmap, const rectangle &cliprect); | |
| 209 | 209 | |
| 210 | 210 | /* the various sprite configs */ |
| 211 | 211 | static const sega16sp_interface hangon_sega16sp_intf = |
| r13798 | r13799 | |
|---|---|---|
| 106 | 106 | |
| 107 | 107 | |
| 108 | 108 | |
| 109 | static void draw_sprites( running_machine &machine, bitmap_t *bitmap, const rectangle | |
| 109 | static void draw_sprites( running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect ) | |
| 110 | 110 | { |
| 111 | 111 | citycon_state *state = machine.driver_data<citycon_state>(); |
| 112 | 112 | int offs; |
| r13798 | r13799 | |
|---|---|---|
| 177 | 177 | /* render left 4 columns with no scroll */ |
| 178 | 178 | subclip = visarea;; |
| 179 | 179 | 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); | |
| 182 | 182 | |
| 183 | 183 | /* render right 1 column with no scroll */ |
| 184 | 184 | subclip = visarea;; |
| 185 | 185 | 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); | |
| 188 | 188 | |
| 189 | 189 | /* render the middle columns normally */ |
| 190 | 190 | subclip = visarea;; |
| 191 | 191 | subclip.min_x += state->m_flipx ? 1*8 : 4*8; |
| 192 | 192 | 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); | |
| 195 | 195 | |
| 196 | 196 | /* render the top layer */ |
| 197 | 197 | tilemap_draw(bitmap, cliprect, state->m_fg_tilemap, 0, 0); |
| r13798 | r13799 | |
|---|---|---|
| 68 | 68 | |
| 69 | 69 | k052109_tilemap_update(state->m_k052109); |
| 70 | 70 | |
| 71 | screen.machine().priority_bitmap->fill(0, | |
| 71 | screen.machine().priority_bitmap->fill(0, | |
| 72 | 72 | |
| 73 | 73 | if (!state->m_video_enable) |
| 74 | bitmap->fill(16 * state->m_layer_colorbase[0], | |
| 74 | bitmap->fill(16 * state->m_layer_colorbase[0], | |
| 75 | 75 | else |
| 76 | 76 | { |
| 77 | 77 | k052109_tilemap_draw(state->m_k052109, bitmap, cliprect, 1, TILEMAP_DRAW_OPAQUE, 1); |
| r13798 | r13799 | |
|---|---|---|
| 5 | 5 | public: |
| 6 | 6 | deco_karnovsprites_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); |
| 7 | 7 | void set_gfxregion(int region) { m_gfxregion = region; }; |
| 8 | void draw_sprites( running_machine &machine, bitmap_t *bitmap, const rectangle | |
| 8 | void draw_sprites( running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect, UINT16* spriteram, int size, int priority ); | |
| 9 | 9 | static void set_gfx_region(device_t &device, int region); |
| 10 | 10 | |
| 11 | 11 | protected: |
| r13798 | r13799 | |
|---|---|---|
| 263 | 263 | |
| 264 | 264 | ***************************************************************************/ |
| 265 | 265 | |
| 266 | static void draw_sprites( running_machine &machine, bitmap_t *bitmap, const rectangle | |
| 266 | static void draw_sprites( running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect, int trans_pen ) | |
| 267 | 267 | { |
| 268 | 268 | psikyo_state *state = machine.driver_data<psikyo_state>(); |
| 269 | 269 | |
| r13798 | r13799 | |
| 382 | 382 | // until I work out why it makes a partial copy of the sprite list, and how best to apply it |
| 383 | 383 | // sprite placement of the explosion graphic seems incorrect compared to the original sets? (no / different zoom support?) |
| 384 | 384 | // it might be a problem with the actual bootleg |
| 385 | static void draw_sprites_bootleg( running_machine &machine, bitmap_t *bitmap, const rectangle | |
| 385 | static void draw_sprites_bootleg( running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect, int trans_pen ) | |
| 386 | 386 | { |
| 387 | 387 | psikyo_state *state = machine.driver_data<psikyo_state>(); |
| 388 | 388 | |
| r13798 | r13799 | |
| 674 | 674 | tilemap_set_transparent_pen(state->m_tilemap_1_size2, (layer1_ctrl & 8 ? 0 : 15)); |
| 675 | 675 | tilemap_set_transparent_pen(state->m_tilemap_1_size3, (layer1_ctrl & 8 ? 0 : 15)); |
| 676 | 676 | |
| 677 | bitmap->fill(get_black_pen(screen.machine()), | |
| 677 | bitmap->fill(get_black_pen(screen.machine()), | |
| 678 | 678 | |
| 679 | screen.machine().priority_bitmap->fill(0, | |
| 679 | screen.machine().priority_bitmap->fill(0, | |
| 680 | 680 | |
| 681 | 681 | if (layers_ctrl & 1) |
| 682 | 682 | tilemap_draw(bitmap, cliprect, tmptilemap0, layer0_ctrl & 2 ? TILEMAP_DRAW_OPAQUE : 0, 1); |
| r13798 | r13799 | |
| 848 | 848 | tilemap_set_transparent_pen(state->m_tilemap_1_size2, (layer1_ctrl & 8 ? 0 : 15)); |
| 849 | 849 | tilemap_set_transparent_pen(state->m_tilemap_1_size3, (layer1_ctrl & 8 ? 0 : 15)); |
| 850 | 850 | |
| 851 | bitmap->fill(get_black_pen(screen.machine()), | |
| 851 | bitmap->fill(get_black_pen(screen.machine()), | |
| 852 | 852 | |
| 853 | screen.machine().priority_bitmap->fill(0, | |
| 853 | screen.machine().priority_bitmap->fill(0, | |
| 854 | 854 | |
| 855 | 855 | if (layers_ctrl & 1) |
| 856 | 856 | tilemap_draw(bitmap, cliprect, tmptilemap0, layer0_ctrl & 2 ? TILEMAP_DRAW_OPAQUE : 0, 1); |
| r13798 | r13799 | |
|---|---|---|
| 396 | 396 | |
| 397 | 397 | ***************************************************************************/ |
| 398 | 398 | |
| 399 | static void draw_sprites( running_machine &machine, bitmap_t *bitmap, const rectangle | |
| 399 | static void draw_sprites( running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect, int codeshift ) | |
| 400 | 400 | { |
| 401 | 401 | playmark_state *state = machine.driver_data<playmark_state>(); |
| 402 | 402 | int offs, start_offset = state->m_spriteram_size / 2 - 4; |
| r13798 | r13799 | |
| 440 | 440 | } |
| 441 | 441 | |
| 442 | 442 | |
| 443 | static void bigtwinb_draw_sprites( running_machine &machine, bitmap_t *bitmap, const rectangle | |
| 443 | static void bigtwinb_draw_sprites( running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect, int codeshift ) | |
| 444 | 444 | { |
| 445 | 445 | playmark_state *state = machine.driver_data<playmark_state>(); |
| 446 | 446 | int offs, start_offset = state->m_spriteram_size / 2 - 4; |
| r13798 | r13799 | |
| 477 | 477 | } |
| 478 | 478 | } |
| 479 | 479 | |
| 480 | static void draw_bitmap( running_machine &machine, bitmap_t *bitmap, const rectangle | |
| 480 | static void draw_bitmap( running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect ) | |
| 481 | 481 | { |
| 482 | 482 | playmark_state *state = machine.driver_data<playmark_state>(); |
| 483 | 483 | int x, y, count; |
| r13798 | r13799 | |
| 522 | 522 | { |
| 523 | 523 | playmark_state *state = screen.machine().driver_data<playmark_state>(); |
| 524 | 524 | |
| 525 | screen.machine().priority_bitmap->fill(0, | |
| 525 | screen.machine().priority_bitmap->fill(0, | |
| 526 | 526 | |
| 527 | 527 | tilemap_draw(bitmap, cliprect, state->m_fg_tilemap, 0, 0); |
| 528 | 528 | if (state->m_bg_enable) |
| r13798 | r13799 | |
| 546 | 546 | tilemap_draw(bitmap, cliprect, state->m_tx_tilemap, 0, 0); |
| 547 | 547 | } |
| 548 | 548 | else |
| 549 | bitmap->fill(get_black_pen(screen.machine()), | |
| 549 | bitmap->fill(get_black_pen(screen.machine()), | |
| 550 | 550 | return 0; |
| 551 | 551 | } |
| 552 | 552 | |
| r13798 | r13799 | |
| 554 | 554 | { |
| 555 | 555 | playmark_state *state = screen.machine().driver_data<playmark_state>(); |
| 556 | 556 | |
| 557 | screen.machine().priority_bitmap->fill(0, | |
| 557 | screen.machine().priority_bitmap->fill(0, | |
| 558 | 558 | |
| 559 | 559 | tilemap_draw(bitmap, cliprect, state->m_fg_tilemap, 0, 1); |
| 560 | 560 | if (state->m_bg_enable) |
| r13798 | r13799 | |
| 582 | 582 | tilemap_set_scrollx(state->m_fg_tilemap, 0, state->m_fgscrollx); |
| 583 | 583 | } |
| 584 | 584 | |
| 585 | screen.machine().priority_bitmap->fill(0, | |
| 585 | screen.machine().priority_bitmap->fill(0, | |
| 586 | 586 | |
| 587 | 587 | tilemap_draw(bitmap, cliprect, state->m_bg_tilemap, 0, 1); |
| 588 | 588 | tilemap_draw(bitmap, cliprect, state->m_fg_tilemap, 0, 2); |
| r13798 | r13799 | |
| 595 | 595 | { |
| 596 | 596 | playmark_state *state = screen.machine().driver_data<playmark_state>(); |
| 597 | 597 | |
| 598 | screen.machine().priority_bitmap->fill(0, | |
| 598 | screen.machine().priority_bitmap->fill(0, | |
| 599 | 599 | |
| 600 | 600 | // video enabled |
| 601 | 601 | if (state->m_scroll[6] & 1) |
| r13798 | r13799 | |
| 606 | 606 | tilemap_draw(bitmap, cliprect, state->m_tx_tilemap, 0, 0); |
| 607 | 607 | } |
| 608 | 608 | else |
| 609 | bitmap->fill(get_black_pen(screen.machine()), | |
| 609 | bitmap->fill(get_black_pen(screen.machine()), | |
| 610 | 610 | return 0; |
| 611 | 611 | } |
| r13798 | r13799 | |
|---|---|---|
| 183 | 183 | |
| 184 | 184 | ***************************************************************************/ |
| 185 | 185 | |
| 186 | static void esd16_draw_sprites( running_machine &machine, bitmap_t *bitmap, const rectangle | |
| 186 | static void esd16_draw_sprites( running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect ) | |
| 187 | 187 | { |
| 188 | 188 | esd16_state *state = machine.driver_data<esd16_state>(); |
| 189 | 189 | int offs; |
| r13798 | r13799 | |
| 247 | 247 | } |
| 248 | 248 | |
| 249 | 249 | /* note, check if i can re-merge this with the other or if its really different */ |
| 250 | static void hedpanic_draw_sprites( running_machine &machine, bitmap_t *bitmap, const rectangle | |
| 250 | static void hedpanic_draw_sprites( running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect ) | |
| 251 | 251 | { |
| 252 | 252 | esd16_state *state = machine.driver_data<esd16_state>(); |
| 253 | 253 | int offs; |
| r13798 | r13799 | |
| 328 | 328 | esd16_state *state = screen.machine().driver_data<esd16_state>(); |
| 329 | 329 | int layers_ctrl = -1; |
| 330 | 330 | |
| 331 | screen.machine().priority_bitmap->fill(0, | |
| 331 | screen.machine().priority_bitmap->fill(0, | |
| 332 | 332 | |
| 333 | 333 | tilemap_set_scrollx(state->m_tilemap_0, 0, state->m_scroll_0[0]); |
| 334 | 334 | tilemap_set_scrolly(state->m_tilemap_0, 0, state->m_scroll_0[1]); |
| r13798 | r13799 | |
| 348 | 348 | #endif |
| 349 | 349 | |
| 350 | 350 | if (layers_ctrl & 1) tilemap_draw(bitmap, cliprect, state->m_tilemap_0, 0, 0); |
| 351 | else bitmap->fill(0, | |
| 351 | else bitmap->fill(0, | |
| 352 | 352 | |
| 353 | 353 | if (layers_ctrl & 2) tilemap_draw(bitmap, cliprect, state->m_tilemap_1, 0, 1); |
| 354 | 354 | |
| r13798 | r13799 | |
| 362 | 362 | esd16_state *state = screen.machine().driver_data<esd16_state>(); |
| 363 | 363 | int layers_ctrl = -1; |
| 364 | 364 | |
| 365 | screen.machine().priority_bitmap->fill(0, | |
| 365 | screen.machine().priority_bitmap->fill(0, | |
| 366 | 366 | |
| 367 | 367 | #ifdef MAME_DEBUG |
| 368 | 368 | if (screen.machine().input().code_pressed(KEYCODE_Z)) |
| r13798 | r13799 | |
| 392 | 392 | } |
| 393 | 393 | else |
| 394 | 394 | { |
| 395 | bitmap->fill(0, | |
| 395 | bitmap->fill(0, | |
| 396 | 396 | } |
| 397 | 397 | |
| 398 | 398 | |
| r13798 | r13799 | |
| 425 | 425 | esd16_state *state = screen.machine().driver_data<esd16_state>(); |
| 426 | 426 | int layers_ctrl = -1; |
| 427 | 427 | |
| 428 | screen.machine().priority_bitmap->fill(0, | |
| 428 | screen.machine().priority_bitmap->fill(0, | |
| 429 | 429 | |
| 430 | 430 | #ifdef MAME_DEBUG |
| 431 | 431 | if ( screen.machine().input().code_pressed(KEYCODE_Z) ) |
| r13798 | r13799 | |
| 455 | 455 | } |
| 456 | 456 | else |
| 457 | 457 | { |
| 458 | bitmap->fill(0, | |
| 458 | bitmap->fill(0, | |
| 459 | 459 | } |
| 460 | 460 | |
| 461 | 461 |
| r13798 | r13799 | |
|---|---|---|
| 226 | 226 | } |
| 227 | 227 | } |
| 228 | 228 | #ifdef UNUSED_FUNCTION |
| 229 | static void draw_texture_sheet(running_machine &machine, bitmap_t *bitmap, const rectangle | |
| 229 | static void draw_texture_sheet(running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect) | |
| 230 | 230 | { |
| 231 | 231 | model3_state *state = machine.driver_data<model3_state>(); |
| 232 | 232 | int x,y; |
| 233 | for(y = cliprect | |
| 233 | for(y = cliprect. | |
| 234 | 234 | { |
| 235 | 235 | UINT16 *d = &bitmap->pix16(y); |
| 236 | 236 | int index = (y*2)*2048; |
| 237 | for(x = cliprect | |
| 237 | for(x = cliprect. | |
| 238 | 238 | UINT16 pix = state->m_texture_ram[0][index]; |
| 239 | 239 | index+=4; |
| 240 | 240 | if(pix != 0) { |
| r13798 | r13799 | |
| 245 | 245 | } |
| 246 | 246 | #endif |
| 247 | 247 | |
| 248 | static void draw_layer(running_machine &machine, bitmap_t *bitmap, const rectangle | |
| 248 | static void draw_layer(running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect, int layer, int bitdepth) | |
| 249 | 249 | { |
| 250 | 250 | model3_state *state = machine.driver_data<model3_state>(); |
| 251 | 251 | int x, y; |
| r13798 | r13799 | |
| 296 | 296 | |
| 297 | 297 | if(bitdepth) /* 4-bit */ |
| 298 | 298 | { |
| 299 | for(y = cliprect | |
| 299 | for(y = cliprect. | |
| 300 | 300 | { |
| 301 | 301 | tile_index = ((y/8) * 64); |
| 302 | for (x = cliprect | |
| 302 | for (x = cliprect. | |
| 303 | 303 | UINT16 tile = tiles[tile_index ^ 0x2]; |
| 304 | 304 | draw_tile_4bit(machine, bitmap, x, y, tile); |
| 305 | 305 | ++tile_index; |
| r13798 | r13799 | |
| 308 | 308 | } |
| 309 | 309 | else /* 8-bit */ |
| 310 | 310 | { |
| 311 | for(y = cliprect | |
| 311 | for(y = cliprect. | |
| 312 | 312 | { |
| 313 | 313 | tile_index = ((y/8) * 64); |
| 314 | for (x = cliprect | |
| 314 | for (x = cliprect. | |
| 315 | 315 | UINT16 tile = tiles[tile_index ^ 0x2]; |
| 316 | 316 | draw_tile_8bit(machine, bitmap, x, y, tile); |
| 317 | 317 | ++tile_index; |
| r13798 | r13799 | |
| 321 | 321 | } |
| 322 | 322 | |
| 323 | 323 | #ifdef UNUSED_FUNCTION |
| 324 | static void copy_screen(running_machine &machine, bitmap_t *bitmap, const rectangle | |
| 324 | static void copy_screen(running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect) | |
| 325 | 325 | { |
| 326 | 326 | model3_state *state = machine.driver_data<model3_state>(); |
| 327 | 327 | int x,y; |
| 328 | for(y=cliprect | |
| 328 | for(y=cliprect. | |
| 329 | 329 | UINT16 *d = &bitmap->pix16(y); |
| 330 | 330 | UINT16 *s = &state->m_bitmap3d->pix16(y); |
| 331 | for(x=cliprect | |
| 331 | for(x=cliprect. | |
| 332 | 332 | UINT16 pix = s[x]; |
| 333 | 333 | if(!(pix & 0x8000)) { |
| 334 | 334 | d[x] = pix; |
| r13798 | r13799 | |
| 358 | 358 | layer_scroll_x[3] = (layer_data[3] & 0x8000) ? (layer_data[3] & 0x1ff) : -(layer_data[3] & 0x1ff); |
| 359 | 359 | layer_scroll_y[3] = (layer_data[3] & 0x8000) ? (layer_data[3] & 0x1ff) : -(layer_data[3] & 0x1ff); |
| 360 | 360 | #endif |
| 361 | state->m_screen_clip = (rectangle*)cliprect; | |
| 361 | state->m_screen_clip = (rectangle*)&cliprect; | |
| 362 | 362 | |
| 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; | |
| 367 | 367 | |
| 368 | 368 | /* layer disable debug keys */ |
| 369 | 369 | state->m_tick++; |
| r13798 | r13799 | |
| 382 | 382 | state->m_debug_layer_disable ^= 0x10; |
| 383 | 383 | } |
| 384 | 384 | |
| 385 | bitmap->fill(0, | |
| 385 | bitmap->fill(0, | |
| 386 | 386 | |
| 387 | 387 | if (!(state->m_debug_layer_disable & 0x8)) |
| 388 | 388 | draw_layer(screen.machine(), bitmap, cliprect, 3, (state->m_layer_enable >> 3) & 0x1); |
| r13798 | r13799 | |
| 394 | 394 | { |
| 395 | 395 | #if 0 |
| 396 | 396 | 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); | |
| 399 | 399 | real3d_traverse_display_list(screen.machine()); |
| 400 | 400 | } |
| 401 | 401 | #endif |
| r13798 | r13799 | |
| 1091 | 1091 | callback = (tri->transparency >= 32) ? draw_scanline_normal : draw_scanline_trans; |
| 1092 | 1092 | else |
| 1093 | 1093 | callback = draw_scanline_alpha; |
| 1094 | poly_render_triangle(state->m_poly, state->m_bitmap3d, | |
| 1094 | poly_render_triangle(state->m_poly, state->m_bitmap3d, | |
| 1095 | 1095 | } |
| 1096 | 1096 | else |
| 1097 | 1097 | { |
| r13798 | r13799 | |
| 1099 | 1099 | extra->polygon_intensity = tri->intensity; |
| 1100 | 1100 | extra->color = tri->color; |
| 1101 | 1101 | |
| 1102 | poly_render_triangle(state->m_poly, state->m_bitmap3d, | |
| 1102 | poly_render_triangle(state->m_poly, state->m_bitmap3d, | |
| 1103 | 1103 | } |
| 1104 | 1104 | } |
| 1105 | 1105 |
| r13798 | r13799 | |
|---|---|---|
| 98 | 98 | } /* namcos21_ClearPolyFrameBuffer */ |
| 99 | 99 | |
| 100 | 100 | static void |
| 101 | CopyVisiblePolyFrameBuffer( running_machine &machine, bitmap_t *bitmap, const rectangle | |
| 101 | CopyVisiblePolyFrameBuffer( running_machine &machine, bitmap_t *bitmap, const rectangle &clip, int zlo, int zhi ) | |
| 102 | 102 | { |
| 103 | 103 | namcos21_state *state = machine.driver_data<namcos21_state>(); /* blit the visible framebuffer */ |
| 104 | 104 | int sy; |
| 105 | for( sy=clip | |
| 105 | for( sy=clip. | |
| 106 | 106 | { |
| 107 | 107 | UINT16 *dest = &bitmap->pix16(sy); |
| 108 | 108 | const UINT16 *pPen = state->m_mpPolyFrameBufferPens2+NAMCOS21_POLY_FRAME_WIDTH*sy; |
| 109 | 109 | const UINT16 *pZ = state->m_mpPolyFrameBufferZ2+NAMCOS21_POLY_FRAME_WIDTH*sy; |
| 110 | 110 | int sx; |
| 111 | for( sx=clip | |
| 111 | for( sx=clip. | |
| 112 | 112 | { |
| 113 | 113 | int z = pZ[sx]; |
| 114 | 114 | //if( pZ[sx]!=0x7fff ) |
| r13798 | r13799 | |
| 179 | 179 | int pivot = 3; |
| 180 | 180 | int pri; |
| 181 | 181 | update_palette(screen.machine()); |
| 182 | bitmap->fill(0xff, | |
| 182 | bitmap->fill(0xff, | |
| 183 | 183 | |
| 184 | 184 | if( namcos2_gametype != NAMCOS21_WINRUN91 ) |
| 185 | 185 | { /* draw low priority 2d sprites */ |
| r13798 | r13799 | |
| 208 | 208 | } |
| 209 | 209 | else |
| 210 | 210 | { /* winrun bitmap layer */ |
| 211 | int yscroll = -cliprect | |
| 211 | int yscroll = -cliprect. | |
| 212 | 212 | int base = 0x1000+0x100*(state->m_winrun_color&0xf); |
| 213 | 213 | int sx,sy; |
| 214 | for( sy=cliprect | |
| 214 | for( sy=cliprect. | |
| 215 | 215 | { |
| 216 | 216 | const UINT8 *pSource = &videoram[((yscroll+sy)&0x3ff)*0x200]; |
| 217 | 217 | UINT16 *pDest = &bitmap->pix16(sy); |
| 218 | for( sx=cliprect | |
| 218 | for( sx=cliprect. | |
| 219 | 219 | { |
| 220 | 220 | int pen = pSource[sx]; |
| 221 | 221 | switch( pen ) |
| r13798 | r13799 | |
|---|---|---|
| 367 | 367 | pgm_state *state = screen.machine().driver_data<pgm_state>(); |
| 368 | 368 | int y; |
| 369 | 369 | |
| 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); | |
| 372 | 372 | |
| 373 | 373 | draw_sprites(screen.machine(), state->m_tmppgmbitmap, state->m_spritebufferram); |
| 374 | 374 |
| r13798 | r13799 | |
|---|---|---|
| 46 | 46 | |
| 47 | 47 | /***************************************************************************/ |
| 48 | 48 | |
| 49 | static void draw_sprites( running_machine &machine, bitmap_t *bitmap, const rectangle | |
| 49 | static void draw_sprites( running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect, int primask, int x_offs, int y_offs ) | |
| 50 | 50 | { |
| 51 | 51 | darius_state *state = machine.driver_data<darius_state>(); |
| 52 | 52 | UINT16 *spriteram = state->m_spriteram; |
| r13798 | r13799 | |
| 92 | 92 | |
| 93 | 93 | |
| 94 | 94 | |
| 95 | static UINT32 update_screen(screen_device &screen, bitmap_t *bitmap, const rectangle | |
| 95 | static UINT32 update_screen(screen_device &screen, bitmap_t *bitmap, const rectangle &cliprect, int xoffs) | |
| 96 | 96 | { |
| 97 | 97 | darius_state *state = screen.machine().driver_data<darius_state>(); |
| 98 | 98 |
| r13798 | r13799 | |
|---|---|---|
| 176 | 176 | /* if we're blanked, just fill with black */ |
| 177 | 177 | if (state.blanked) |
| 178 | 178 | { |
| 179 | bitmap->fill(get_black_pen(screen.machine()), | |
| 179 | bitmap->fill(get_black_pen(screen.machine()), | |
| 180 | 180 | return 0; |
| 181 | 181 | } |
| 182 | 182 | |
| 183 | 183 | /* now regenerate the bitmap */ |
| 184 | for (y = cliprect | |
| 184 | for (y = cliprect. | |
| 185 | 185 | { |
| 186 | 186 | UINT8 *src = &state.vram[256 * y]; |
| 187 | 187 | UINT32 *dest = &bitmap->pix32(y); |
| 188 | 188 | |
| 189 | for (x = cliprect | |
| 189 | for (x = cliprect. | |
| 190 | 190 | { |
| 191 | 191 | UINT8 pix = src[32 + (x / 2)]; |
| 192 | 192 | *dest++ = pen_for_pixel(src, pix >> 4); |
| r13798 | r13799 | |
|---|---|---|
| 62 | 62 | } |
| 63 | 63 | |
| 64 | 64 | |
| 65 | static void draw_sprites( running_machine &machine, bitmap_t *bitmap, const rectangle | |
| 65 | static void draw_sprites( running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect ) | |
| 66 | 66 | { |
| 67 | 67 | ikki_state *state = machine.driver_data<ikki_state>(); |
| 68 | 68 | UINT8 *spriteram = state->m_spriteram; |
| 69 | 69 | int y; |
| 70 | 70 | offs_t offs; |
| 71 | 71 | |
| 72 | state->m_sprite_bitmap->fill(state->m_punch_through_pen, | |
| 72 | state->m_sprite_bitmap->fill(state->m_punch_through_pen, | |
| 73 | 73 | |
| 74 | 74 | for (offs = 0; offs < state->m_spriteram_size; offs += 4) |
| 75 | 75 | { |
| r13798 | r13799 | |
| 101 | 101 | } |
| 102 | 102 | |
| 103 | 103 | /* copy the sprite bitmap into the main bitmap, skipping the transparent pixels */ |
| 104 | for (y = cliprect | |
| 104 | for (y = cliprect. | |
| 105 | 105 | { |
| 106 | 106 | int x; |
| 107 | 107 | |
| 108 | for (x = cliprect | |
| 108 | for (x = cliprect. | |
| 109 | 109 | { |
| 110 | 110 | UINT16 pen = state->m_sprite_bitmap->pix16(y, x); |
| 111 | 111 |
| r13798 | r13799 | |
|---|---|---|
| 144 | 144 | |
| 145 | 145 | ***************************************************************************/ |
| 146 | 146 | |
| 147 | static void draw_sprites( running_machine &machine, bitmap_t *bitmap, const rectangle | |
| 147 | static void draw_sprites( running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect ) | |
| 148 | 148 | { |
| 149 | 149 | cbasebal_state *state = machine.driver_data<cbasebal_state>(); |
| 150 | 150 | UINT8 *spriteram = state->m_spriteram; |
| r13798 | r13799 | |
| 185 | 185 | if (state->m_bg_on) |
| 186 | 186 | tilemap_draw(bitmap, cliprect, state->m_bg_tilemap, 0, 0); |
| 187 | 187 | else |
| 188 | bitmap->fill(768, | |
| 188 | bitmap->fill(768, | |
| 189 | 189 | |
| 190 | 190 | if (state->m_obj_on) |
| 191 | 191 | draw_sprites(screen.machine(), bitmap, cliprect); |
| r13798 | r13799 | |
|---|---|---|
| 212 | 212 | } |
| 213 | 213 | } |
| 214 | 214 | |
| 215 | static void draw_sprites(running_machine &machine, bitmap_t *bitmap, const rectangle | |
| 215 | static void draw_sprites(running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect) | |
| 216 | 216 | { |
| 217 | 217 | /* |
| 218 | 218 | object ram : |
| r13798 | r13799 | |
| 377 | 377 | |
| 378 | 378 | if (!flipx) { drawxpos = xpos+xloop; } else { drawxpos = (xpos+8-1)-xloop; } |
| 379 | 379 | |
| 380 | if (drawxpos > cliprect | |
| 380 | if (drawxpos > cliprect. | |
| 381 | 381 | drawxpos -= 512; // wrap around |
| 382 | 382 | |
| 383 | if ((drawxpos >= cliprect | |
| 383 | if ((drawxpos >= cliprect. | |
| 384 | 384 | { |
| 385 | 385 | if(st0016_spriteram[offset+5]&0x40) |
| 386 | 386 | { |
| r13798 | r13799 | |
| 488 | 488 | } |
| 489 | 489 | |
| 490 | 490 | |
| 491 | static void draw_bgmap(running_machine &machine, bitmap_t *bitmap,const rectangle | |
| 491 | static void draw_bgmap(running_machine &machine, bitmap_t *bitmap,const rectangle &cliprect, int priority) | |
| 492 | 492 | { |
| 493 | 493 | gfx_element *gfx = machine.gfx[st0016_ramgfx]; |
| 494 | 494 | int j; |
| r13798 | r13799 | |
| 543 | 543 | |
| 544 | 544 | if (!flipx) { drawxpos = xpos+xloop; } else { drawxpos = (xpos+8-1)-xloop; } |
| 545 | 545 | |
| 546 | if (drawxpos > cliprect | |
| 546 | if (drawxpos > cliprect. | |
| 547 | 547 | drawxpos -= 512; // wrap around |
| 548 | 548 | |
| 549 | if ((drawxpos >= cliprect | |
| 549 | if ((drawxpos >= cliprect. | |
| 550 | 550 | { |
| 551 | 551 | |
| 552 | 552 | if(st0016_vregs[j+7]==0x12) |
| r13798 | r13799 | |
| 584 | 584 | } |
| 585 | 585 | |
| 586 | 586 | |
| 587 | void st0016_draw_screen(screen_device &screen, bitmap_t *bitmap, const rectangle | |
| 587 | void st0016_draw_screen(screen_device &screen, bitmap_t *bitmap, const rectangle &cliprect) | |
| 588 | 588 | { |
| 589 | 589 | draw_bgmap(screen.machine(), bitmap,cliprect,0); |
| 590 | 590 | draw_sprites(screen.machine(), bitmap,cliprect); |
| r13798 | r13799 | |
| 616 | 616 | } |
| 617 | 617 | #endif |
| 618 | 618 | |
| 619 | bitmap->fill(UNUSED_PEN, | |
| 619 | bitmap->fill(UNUSED_PEN, | |
| 620 | 620 | st0016_draw_screen(screen, bitmap, cliprect); |
| 621 | 621 | return 0; |
| 622 | 622 | } |
| r13798 | r13799 | |
|---|---|---|
| 135 | 135 | tilemap_set_scroll_cols(state->m_bg_tilemap, 32); |
| 136 | 136 | } |
| 137 | 137 | |
| 138 | static void draw_sprites( running_machine &machine, bitmap_t *bitmap, const rectangle | |
| 138 | static void draw_sprites( running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect ) | |
| 139 | 139 | { |
| 140 | 140 | sbasketb_state *state = machine.driver_data<sbasketb_state>(); |
| 141 | 141 | UINT8 *spriteram = state->m_spriteram; |
| r13798 | r13799 | |
|---|---|---|
| 19 | 19 | flip_screen_set(screen.machine(), BIT(flip, 7)); |
| 20 | 20 | deco16ic_pf_update(state->m_deco_tilegen1, state->m_pf1_rowscroll, state->m_pf2_rowscroll); |
| 21 | 21 | |
| 22 | bitmap->fill(768, | |
| 22 | bitmap->fill(768, | |
| 23 | 23 | deco16ic_tilemap_2_draw(state->m_deco_tilegen1, bitmap, cliprect, TILEMAP_DRAW_OPAQUE, 0); |
| 24 | 24 | deco16ic_tilemap_1_draw(state->m_deco_tilegen1, bitmap, cliprect, 0, 0); |
| 25 | 25 | screen.machine().device<decospr_device>("spritegen")->draw_sprites(screen.machine(), bitmap, cliprect, state->m_spriteram, 0x400); |
| r13798 | r13799 | |
|---|---|---|
| 81 | 81 | k054338_update_all_shadows(state->m_k054338, 0); |
| 82 | 82 | k054338_fill_backcolor(state->m_k054338, bitmap, 0); |
| 83 | 83 | |
| 84 | screen.machine().priority_bitmap->fill(0, | |
| 84 | screen.machine().priority_bitmap->fill(0, | |
| 85 | 85 | |
| 86 | 86 | for (plane = 0; plane < 4; plane++) |
| 87 | 87 | { |
| r13798 | r13799 | |
|---|---|---|
| 81 | 81 | [3] |
| 82 | 82 | */ |
| 83 | 83 | |
| 84 | static void draw_sprites( running_machine &machine, bitmap_t *bitmap, const rectangle | |
| 84 | static void draw_sprites( running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect ) | |
| 85 | 85 | { |
| 86 | 86 | ksayakyu_state *state = machine.driver_data<ksayakyu_state>(); |
| 87 | 87 | const UINT8 *source = state->m_spriteram + state->m_spriteram_size - 4; |
| r13798 | r13799 | |
| 128 | 128 | { |
| 129 | 129 | ksayakyu_state *state = screen.machine().driver_data<ksayakyu_state>(); |
| 130 | 130 | |
| 131 | bitmap->fill(0, | |
| 131 | bitmap->fill(0, | |
| 132 | 132 | |
| 133 | 133 | if (state->m_video_ctrl & 1) |
| 134 | 134 | tilemap_draw(bitmap, cliprect,state->m_tilemap, 0, 0); |
| r13798 | r13799 | |
|---|---|---|
| 50 | 50 | logerror("p08_w %02x\n",data); |
| 51 | 51 | } |
| 52 | 52 | |
| 53 | static void himesiki_draw_sprites( running_machine &machine, bitmap_t *bitmap, const rectangle | |
| 53 | static void himesiki_draw_sprites( running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect ) | |
| 54 | 54 | { |
| 55 | 55 | himesiki_state *state = machine.driver_data<himesiki_state>(); |
| 56 | 56 | UINT8 *spriteram = state->m_spriteram; |
| r13798 | r13799 | |
|---|---|---|
| 64 | 64 | state->m_bg_tilemap = tilemap_create(machine, get_bg_tile_info, tilemap_scan_rows, 8, 8, 64, 32); |
| 65 | 65 | } |
| 66 | 66 | |
| 67 | static void draw_sprites( running_machine &machine, bitmap_t *bitmap, const rectangle | |
| 67 | static void draw_sprites( running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect ) | |
| 68 | 68 | { |
| 69 | 69 | battlex_state *state = machine.driver_data<battlex_state>(); |
| 70 | 70 | const gfx_element *gfx = machine.gfx[1]; |
| r13798 | r13799 | |
|---|---|---|
| 155 | 155 | tilemap_set_scroll_rows(state->m_bg_tilemap, 32); |
| 156 | 156 | } |
| 157 | 157 | |
| 158 | static void draw_sprites( running_machine &machine, bitmap_t *bitmap, const rectangle | |
| 158 | static void draw_sprites( running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect ) | |
| 159 | 159 | { |
| 160 | 160 | ironhors_state *state = machine.driver_data<ironhors_state>(); |
| 161 | 161 | int offs; |
| r13798 | r13799 | |
| 271 | 271 | tilemap_set_scroll_rows(state->m_bg_tilemap, 32); |
| 272 | 272 | } |
| 273 | 273 | |
| 274 | static void farwest_draw_sprites( running_machine &machine, bitmap_t *bitmap, const rectangle | |
| 274 | static void farwest_draw_sprites( running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect ) | |
| 275 | 275 | { |
| 276 | 276 | ironhors_state *state = machine.driver_data<ironhors_state>(); |
| 277 | 277 | int offs; |
| r13798 | r13799 | |
|---|---|---|
| 43 | 43 | state->m_spriteram[offset] = data; |
| 44 | 44 | } |
| 45 | 45 | |
| 46 | static void draw_sprites( running_machine &machine, bitmap_t *bitmap, const rectangle | |
| 46 | static void draw_sprites( running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect ) | |
| 47 | 47 | { |
| 48 | 48 | mrflea_state *state = machine.driver_data<mrflea_state>(); |
| 49 | 49 | const gfx_element *gfx = machine.gfx[0]; |
| r13798 | r13799 | |
| 60 | 60 | int ypos = source[0] - 16 + 3; |
| 61 | 61 | int tile_number = source[2] + source[3] * 0x100; |
| 62 | 62 | |
| 63 | drawgfx_transpen( bitmap, | |
| 63 | drawgfx_transpen( bitmap, | |
| 64 | 64 | tile_number, |
| 65 | 65 | 0, /* color */ |
| 66 | 66 | 0,0, /* no flip */ |
| 67 | 67 | xpos,ypos,0 ); |
| 68 | drawgfx_transpen( bitmap, | |
| 68 | drawgfx_transpen( bitmap, | |
| 69 | 69 | tile_number, |
| 70 | 70 | 0, /* color */ |
| 71 | 71 | 0,0, /* no flip */ |
| r13798 | r13799 | |
| 74 | 74 | } |
| 75 | 75 | } |
| 76 | 76 | |
| 77 | static void draw_background( running_machine &machine, bitmap_t *bitmap, const rectangle | |
| 77 | static void draw_background( running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect ) | |
| 78 | 78 | { |
| 79 | 79 | mrflea_state *state = machine.driver_data<mrflea_state>(); |
| 80 | 80 | const UINT8 *source = state->m_videoram; |
| r13798 | r13799 | |
|---|---|---|
| 1794 | 1794 | int y; |
| 1795 | 1795 | |
| 1796 | 1796 | /*NTSC SNES draw range is 1-225. */ |
| 1797 | for (y = cliprect | |
| 1797 | for (y = cliprect. | |
| 1798 | 1798 | { |
| 1799 | 1799 | snes_refresh_scanline(screen.machine(), bitmap, y + 1); |
| 1800 | 1800 | } |
| r13798 | r13799 | |
|---|---|---|
| 164 | 164 | 3 | xxxxxxxx xxxxxxxx | sprite code |
| 165 | 165 | */ |
| 166 | 166 | |
| 167 | static void draw_sprites( running_machine &machine, bitmap_t *bitmap, const rectangle | |
| 167 | static void draw_sprites( running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect ) | |
| 168 | 168 | { |
| 169 | 169 | glass_state *state = machine.driver_data<glass_state>(); |
| 170 | 170 | int i; |
| r13798 | r13799 | |
| 205 | 205 | tilemap_set_scrollx(state->m_pant[1], 0, state->m_vregs[3]); |
| 206 | 206 | |
| 207 | 207 | /* draw layers + sprites */ |
| 208 | bitmap->fill(get_black_pen(screen.machine()), | |
| 208 | bitmap->fill(get_black_pen(screen.machine()), | |
| 209 | 209 | copybitmap(bitmap, state->m_screen_bitmap, 0, 0, 0x18, 0x24, cliprect); |
| 210 | 210 | tilemap_draw(bitmap, cliprect, state->m_pant[1], 0, 0); |
| 211 | 211 | tilemap_draw(bitmap, cliprect, state->m_pant[0], 0, 0); |
| r13798 | r13799 | |
|---|---|---|
| 53 | 53 | } |
| 54 | 54 | |
| 55 | 55 | |
| 56 | static void draw_sprites( running_machine &machine, bitmap_t *bitmap, const rectangle | |
| 56 | static void draw_sprites( running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect ) | |
| 57 | 57 | { |
| 58 | 58 | mcatadv_state *state = machine.driver_data<mcatadv_state>(); |
| 59 | 59 | UINT16 *source = state->m_spriteram_old; |
| r13798 | r13799 | |
| 121 | 121 | { |
| 122 | 122 | drawypos = y + ycnt - global_y; |
| 123 | 123 | |
| 124 | if ((drawypos >= cliprect | |
| 124 | if ((drawypos >= cliprect. | |
| 125 | 125 | { |
| 126 | 126 | destline = &bitmap->pix16(drawypos); |
| 127 | 127 | priline = &machine.priority_bitmap->pix8(drawypos); |
| r13798 | r13799 | |
| 140 | 140 | pix = pix >> 4; |
| 141 | 141 | pix &= 0x0f; |
| 142 | 142 | |
| 143 | if ((drawxpos >= cliprect | |
| 143 | if ((drawxpos >= cliprect. | |
| 144 | 144 | destline[drawxpos] = (pix + (pen << 4)); |
| 145 | 145 | } |
| 146 | 146 | offset++; |
| r13798 | r13799 | |
| 156 | 156 | } |
| 157 | 157 | } |
| 158 | 158 | |
| 159 | static void mcatadv_draw_tilemap_part( UINT16* current_scroll, UINT16* current_videoram1, int i, tilemap_t* current_tilemap, bitmap_t *bitmap, const rectangle | |
| 159 | static void mcatadv_draw_tilemap_part( UINT16* current_scroll, UINT16* current_videoram1, int i, tilemap_t* current_tilemap, bitmap_t *bitmap, const rectangle &cliprect ) | |
| 160 | 160 | { |
| 161 | 161 | int flip; |
| 162 | 162 | UINT32 drawline; |
| 163 | 163 | rectangle clip; |
| 164 | 164 | |
| 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; | |
| 167 | 167 | |
| 168 | for (drawline = cliprect | |
| 168 | for (drawline = cliprect. | |
| 169 | 169 | { |
| 170 | 170 | int scrollx, scrolly; |
| 171 | 171 | |
| r13798 | r13799 | |
| 196 | 196 | tilemap_set_scrolly(current_tilemap, 0, scrolly); |
| 197 | 197 | tilemap_set_flip(current_tilemap, flip); |
| 198 | 198 | |
| 199 | tilemap_draw(bitmap, | |
| 199 | tilemap_draw(bitmap, | |
| 200 | 200 | } |
| 201 | 201 | } |
| 202 | 202 | |
| r13798 | r13799 | |
| 205 | 205 | mcatadv_state *state = screen.machine().driver_data<mcatadv_state>(); |
| 206 | 206 | int i; |
| 207 | 207 | |
| 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); | |
| 210 | 210 | |
| 211 | 211 | if (state->m_scroll1[2] != state->m_palette_bank1) |
| 212 | 212 | { |
| r13798 | r13799 | |
|---|---|---|
| 297 | 297 | |
| 298 | 298 | if (state->m_vdp1) |
| 299 | 299 | { |
| 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); | |
| 302 | 302 | state->m_vdp1->gp9001_render_vdp(screen.machine(), bitmap, cliprect); |
| 303 | 303 | } |
| 304 | 304 | if (state->m_vdp0) |
| 305 | 305 | { |
| 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); | |
| 308 | 308 | state->m_vdp0->gp9001_render_vdp(screen.machine(), bitmap, cliprect); |
| 309 | 309 | } |
| 310 | 310 | |
| r13798 | r13799 | |
| 318 | 318 | { |
| 319 | 319 | toaplan2_state *state = screen.machine().driver_data<toaplan2_state>(); |
| 320 | 320 | |
| 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); | |
| 323 | 323 | |
| 324 | 324 | if (state->m_vdp0) |
| 325 | 325 | { |
| 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); | |
| 328 | 328 | state->m_vdp0->gp9001_render_vdp(screen.machine(), bitmap, cliprect); |
| 329 | 329 | } |
| 330 | 330 | if (state->m_vdp1) |
| 331 | 331 | { |
| 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); | |
| 334 | 334 | state->m_vdp1->gp9001_render_vdp(screen.machine(), state->m_secondary_render_bitmap, cliprect); |
| 335 | 335 | } |
| 336 | 336 | |
| r13798 | r13799 | |
| 420 | 420 | |
| 421 | 421 | if (state->m_vdp0) |
| 422 | 422 | { |
| 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); | |
| 425 | 425 | state->m_vdp0->gp9001_render_vdp(screen.machine(), bitmap, cliprect); |
| 426 | 426 | } |
| 427 | 427 | |
| r13798 | r13799 | |
| 466 | 466 | clip.min_y = clip.max_y = line; |
| 467 | 467 | tilemap_set_scrolly(state->m_tx_tilemap, 0, - line + state->m_txvideoram16_offs[ line]); |
| 468 | 468 | } |
| 469 | tilemap_draw(bitmap, | |
| 469 | tilemap_draw(bitmap, | |
| 470 | 470 | } |
| 471 | 471 | return 0; |
| 472 | 472 | } |
| r13798 | r13799 | |
|---|---|---|
| 87 | 87 | |
| 88 | 88 | ***************************************************************************/ |
| 89 | 89 | |
| 90 | static void draw_sprites(running_machine &machine, bitmap_t *bitmap,const rectangle | |
| 90 | static void draw_sprites(running_machine &machine, bitmap_t *bitmap,const rectangle &cliprect) | |
| 91 | 91 | { |
| 92 | 92 | mjkjidai_state *state = machine.driver_data<mjkjidai_state>(); |
| 93 | 93 | UINT8 *spriteram = state->m_spriteram1; |
| r13798 | r13799 | |
| 133 | 133 | { |
| 134 | 134 | mjkjidai_state *state = screen.machine().driver_data<mjkjidai_state>(); |
| 135 | 135 | if (!state->m_display_enable) |
| 136 | bitmap->fill(get_black_pen(screen.machine()), | |
| 136 | bitmap->fill(get_black_pen(screen.machine()), | |
| 137 | 137 | else |
| 138 | 138 | { |
| 139 | 139 | tilemap_draw(bitmap,cliprect,state->m_bg_tilemap,0,0); |
| r13798 | r13799 | |
|---|---|---|
| 65 | 65 | tilemap_set_scrolldx(state->m_bg_tilemap, 0, 396 - 256); |
| 66 | 66 | } |
| 67 | 67 | |
| 68 | static void draw_sprites( running_machine &machine, bitmap_t *bitmap, const rectangle | |
| 68 | static void draw_sprites( running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect ) | |
| 69 | 69 | { |
| 70 | 70 | jailbrek_state *state = machine.driver_data<jailbrek_state>(); |
| 71 | 71 | UINT8 *spriteram = state->m_spriteram; |
| r13798 | r13799 | |
|---|---|---|
| 121 | 121 | 3 | xxxxxxxx xxxxxx-- | sprite code |
| 122 | 122 | */ |
| 123 | 123 | |
| 124 | static void draw_sprites( running_machine &machine, bitmap_t *bitmap, const rectangle | |
| 124 | static void draw_sprites( running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect ) | |
| 125 | 125 | { |
| 126 | 126 | gaelco_state *state = machine.driver_data<gaelco_state>(); |
| 127 | 127 | int i, x, y, ex, ey; |
| r13798 | r13799 | |
| 197 | 197 | tilemap_set_scrolly(state->m_tilemap[1], 0, state->m_vregs[2]); |
| 198 | 198 | tilemap_set_scrollx(state->m_tilemap[1], 0, state->m_vregs[3]); |
| 199 | 199 | |
| 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); | |
| 202 | 202 | |
| 203 | 203 | tilemap_draw(bitmap, cliprect, state->m_tilemap[1], 3, 0); |
| 204 | 204 | tilemap_draw(bitmap, cliprect, state->m_tilemap[0], 3, 0); |
| r13798 | r13799 | |
| 226 | 226 | tilemap_set_scrolly(state->m_tilemap[1], 0, state->m_vregs[2]); |
| 227 | 227 | tilemap_set_scrollx(state->m_tilemap[1], 0, state->m_vregs[3]); |
| 228 | 228 | |
| 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); | |
| 231 | 231 | |
| 232 | 232 | tilemap_draw(bitmap, cliprect, state->m_tilemap[1], TILEMAP_DRAW_LAYER1 | 3, 0); |
| 233 | 233 | tilemap_draw(bitmap, cliprect, state->m_tilemap[0], TILEMAP_DRAW_LAYER1 | 3, 0); |
| r13798 | r13799 | |
|---|---|---|
| 169 | 169 | } |
| 170 | 170 | |
| 171 | 171 | // draws a 8bpp palette sprites on a 16bpp direct RGB target (sub-par implementation) |
| 172 | static void do_blit_zoom32(wecleman_state *state, bitmap_t *bitmap, const rectangle | |
| 172 | static void do_blit_zoom32(wecleman_state *state, bitmap_t *bitmap, const rectangle &cliprect, struct sprite *sprite) | |
| 173 | 173 | { |
| 174 | 174 | #define PRECISION_X 20 |
| 175 | 175 | #define PRECISION_Y 20 |
| r13798 | r13799 | |
| 185 | 185 | x2 = sprite->x; |
| 186 | 186 | x1 = x2 + sprite->total_width; |
| 187 | 187 | 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 ) | |
| 190 | 190 | { |
| 191 | xcount0 = x1 - cliprect->max_x; | |
| 192 | x1 = cliprect->max_x; | |
| 191 | xcount0 = x1 - cliprect.max_x; | |
| 192 | x1 = cliprect.max_x; | |
| 193 | 193 | } |
| 194 | 194 | if (x2 >= x1) return; |
| 195 | 195 | x1--; x2--; |
| r13798 | r13799 | |
| 199 | 199 | x1 = sprite->x; |
| 200 | 200 | x2 = x1 + sprite->total_width; |
| 201 | 201 | dx = 1; |
| 202 | if (x1 < cliprect | |
| 202 | if (x1 < cliprect. | |
| 203 | 203 | { |
| 204 | xcount0 = cliprect->min_x - x1; | |
| 205 | x1 = cliprect->min_x; | |
| 204 | xcount0 = cliprect.min_x - x1; | |
| 205 | x1 = cliprect.min_x; | |
| 206 | 206 | } |
| 207 | if (x2 > cliprect | |
| 207 | if (x2 > cliprect. | |
| 208 | 208 | if (x1 >= x2) return; |
| 209 | 209 | } |
| 210 | 210 | |
| r13798 | r13799 | |
| 213 | 213 | y2 = sprite->y; |
| 214 | 214 | y1 = y2 + sprite->total_height; |
| 215 | 215 | 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 ) | |
| 218 | 218 | { |
| 219 | ycount0 = cliprect->max_y; | |
| 220 | y1 = cliprect->max_y; | |
| 219 | ycount0 = cliprect.max_y; | |
| 220 | y1 = cliprect.max_y; | |
| 221 | 221 | } |
| 222 | 222 | if (y2 >= y1) return; |
| 223 | 223 | y1--; y2--; |
| r13798 | r13799 | |
| 227 | 227 | y1 = sprite->y; |
| 228 | 228 | y2 = y1 + sprite->total_height; |
| 229 | 229 | dy = 1; |
| 230 | if (y1 < cliprect | |
| 230 | if (y1 < cliprect. | |
| 231 | 231 | { |
| 232 | ycount0 = cliprect->min_y - y1; | |
| 233 | y1 = cliprect->min_y; | |
| 232 | ycount0 = cliprect.min_y - y1; | |
| 233 | y1 = cliprect.min_y; | |
| 234 | 234 | } |
| 235 | if (y2 > cliprect | |
| 235 | if (y2 > cliprect. | |
| 236 | 236 | if (y1 >= y2) return; |
| 237 | 237 | } |
| 238 | 238 | |
| r13798 | r13799 | |
| 246 | 246 | // pre-loop assignments and adjustments |
| 247 | 247 | pal_base = sprite->pal_data; |
| 248 | 248 | |
| 249 | if (x1 > cliprect | |
| 249 | if (x1 > cliprect. | |
| 250 | 250 | { |
| 251 | 251 | x1 -= dx; |
| 252 | 252 | x2 -= dx; |
| r13798 | r13799 | |
| 330 | 330 | } |
| 331 | 331 | } |
| 332 | 332 | |
| 333 | static void sprite_draw(running_machine &machine, bitmap_t *bitmap, const rectangle | |
| 333 | static void sprite_draw(running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect) | |
| 334 | 334 | { |
| 335 | 335 | wecleman_state *state = machine.driver_data<wecleman_state>(); |
| 336 | 336 | int i; |
| r13798 | r13799 | |
| 539 | 539 | |
| 540 | 540 | ------------------------------------------------------------------------*/ |
| 541 | 541 | |
| 542 | static void wecleman_draw_road(running_machine &machine, bitmap_t *bitmap, const rectangle | |
| 542 | static void wecleman_draw_road(running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect, int priority) | |
| 543 | 543 | { |
| 544 | 544 | wecleman_state *state = machine.driver_data<wecleman_state>(); |
| 545 | 545 | // must be powers of 2 |
| r13798 | r13799 | |
| 576 | 576 | if (priority == 0x02) |
| 577 | 577 | { |
| 578 | 578 | // draw sky; each scanline is assumed to be dword aligned |
| 579 | for (sy=cliprect | |
| 579 | for (sy=cliprect. | |
| 580 | 580 | { |
| 581 | 581 | UINT32 *dst = &bitmap->pix32(sy+BMP_PAD, BMP_PAD); |
| 582 | 582 | UINT32 pix; |
| r13798 | r13799 | |
| 602 | 602 | road_rgb[i] = color ? rgb_ptr[color] : 0xffffffff; |
| 603 | 603 | } |
| 604 | 604 | |
| 605 | for (sy=cliprect | |
| 605 | for (sy=cliprect. | |
| 606 | 606 | { |
| 607 | 607 | UINT32 *dst = &bitmap->pix32(sy+BMP_PAD, BMP_PAD); |
| 608 | 608 | UINT32 pix; |
| r13798 | r13799 | |
| 792 | 792 | |
| 793 | 793 | ------------------------------------------------------------------------*/ |
| 794 | 794 | |
| 795 | static void hotchase_draw_road(running_machine &machine, bitmap_t *bitmap, const rectangle | |
| 795 | static void hotchase_draw_road(running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect) | |
| 796 | 796 | { |
| 797 | 797 | wecleman_state *state = machine.driver_data<wecleman_state>(); |
| 798 | 798 | /* Referred to what's in the ROMs */ |
| r13798 | r13799 | |
| 1065 | 1065 | |
| 1066 | 1066 | get_sprite_info(screen.machine()); |
| 1067 | 1067 | |
| 1068 | bitmap->fill(state->m_black_pen, | |
| 1068 | bitmap->fill(state->m_black_pen, | |
| 1069 | 1069 | |
| 1070 | 1070 | /* Draw the road (lines which have priority 0x02) */ |
| 1071 | 1071 | if (video_on) wecleman_draw_road(screen.machine(), bitmap, cliprect, 0x02); |
| r13798 | r13799 | |
| 1129 | 1129 | |
| 1130 | 1130 | get_sprite_info(screen.machine()); |
| 1131 | 1131 | |
| 1132 | bitmap->fill(state->m_black_pen, | |
| 1132 | bitmap->fill(state->m_black_pen, | |
| 1133 | 1133 | |
| 1134 | 1134 | /* Draw the background */ |
| 1135 | 1135 | if (video_on) |
| r13798 | r13799 | |
|---|---|---|
| 187 | 187 | offset 3 xxxxxxxx x position (8 LSB bits) |
| 188 | 188 | */ |
| 189 | 189 | |
| 190 | static void draw_sprites(running_machine &machine, bitmap_t *bitmap, const rectangle | |
| 190 | static void draw_sprites(running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect) | |
| 191 | 191 | { |
| 192 | 192 | tankbust_state *state = machine.driver_data<tankbust_state>(); |
| 193 | 193 | UINT8 *spriteram = state->m_spriteram; |
| r13798 | r13799 | |
|---|---|---|
| 316 | 316 | bitmap->pix16(y, x) = state->m_videoram[(y * width) + x]; |
| 317 | 317 | } |
| 318 | 318 | else |
| 319 | bitmap->fill(0, | |
| 319 | bitmap->fill(0, | |
| 320 | 320 | |
| 321 | 321 | return 0; |
| 322 | 322 | } |
| r13798 | r13799 | |
|---|---|---|
| 129 | 129 | } |
| 130 | 130 | |
| 131 | 131 | |
| 132 | static void draw_sprites(running_machine &machine, bitmap_t *bitmap, const rectangle | |
| 132 | static void draw_sprites(running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect) | |
| 133 | 133 | { |
| 134 | 134 | portrait_state *state = machine.driver_data<portrait_state>(); |
| 135 | 135 | UINT8 *source = state->m_spriteram; |
| r13798 | r13799 | |
| 193 | 193 | portrait_state *state = screen.machine().driver_data<portrait_state>(); |
| 194 | 194 | rectangle cliprect_scroll, cliprect_no_scroll; |
| 195 | 195 | |
| 196 | cliprect_scroll = cliprect_no_scroll = | |
| 196 | cliprect_scroll = cliprect_no_scroll = | |
| 197 | 197 | |
| 198 | 198 | cliprect_no_scroll.min_x = cliprect_no_scroll.max_x - 111; |
| 199 | 199 | cliprect_scroll.max_x = cliprect_scroll.min_x + 319; |
| 200 | 200 | |
| 201 | 201 | tilemap_set_scrolly(state->m_background, 0, 0); |
| 202 | 202 | 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); | |
| 205 | 205 | |
| 206 | 206 | tilemap_set_scrolly(state->m_background, 0, state->m_scroll); |
| 207 | 207 | 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); | |
| 210 | 210 | |
| 211 | 211 | draw_sprites(screen.machine(), bitmap,cliprect); |
| 212 | 212 | return 0; |
| r13798 | r13799 | |
|---|---|---|
| 189 | 189 | |
| 190 | 190 | ***************************************************************************/ |
| 191 | 191 | |
| 192 | static void draw_sprites(running_machine &machine, bitmap_t *bitmap, const rectangle | |
| 192 | static void draw_sprites(running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect ) | |
| 193 | 193 | { |
| 194 | 194 | UINT8 *spriteram = machine.generic.spriteram.u8; |
| 195 | 195 | UINT8 *spriteram_2 = machine.generic.spriteram2.u8; |
| r13798 | r13799 | |
| 219 | 219 | } |
| 220 | 220 | |
| 221 | 221 | |
| 222 | static void draw_bullets(running_machine &machine, bitmap_t *bitmap, const rectangle | |
| 222 | static void draw_bullets(running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect ) | |
| 223 | 223 | { |
| 224 | 224 | bosco_state *state = machine.driver_data<bosco_state>(); |
| 225 | 225 | int offs; |
| r13798 | r13799 | |
| 244 | 244 | } |
| 245 | 245 | |
| 246 | 246 | |
| 247 | static void draw_stars(running_machine &machine, bitmap_t *bitmap, const rectangle | |
| 247 | static void draw_stars(running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect, int flip) | |
| 248 | 248 | { |
| 249 | 249 | bosco_state *state = machine.driver_data<bosco_state>(); |
| 250 | 250 | |
| r13798 | r13799 | |
| 271 | 271 | { |
| 272 | 272 | if (flip) x += 20*8; |
| 273 | 273 | |
| 274 | if (x >= cliprect | |
| 274 | if (x >= cliprect. | |
| 275 | 275 | bitmap->pix16(y, x) = STARS_COLOR_BASE + star_seed_tab[star_cntr].col; |
| 276 | 276 | } |
| 277 | 277 | } |
| r13798 | r13799 | |
| 286 | 286 | |
| 287 | 287 | /* the radar tilemap is just 8x32. We rely on the tilemap code to repeat it across |
| 288 | 288 | 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; | |
| 291 | 291 | if (flip_screen_get(screen.machine())) |
| 292 | 292 | { |
| 293 | 293 | bg_clip.min_x = 20*8; |
| r13798 | r13799 | |
| 299 | 299 | fg_clip.min_x = 28*8; |
| 300 | 300 | } |
| 301 | 301 | |
| 302 | bitmap->fill(get_black_pen(screen.machine()), | |
| 302 | bitmap->fill(get_black_pen(screen.machine()), | |
| 303 | 303 | draw_stars(screen.machine(),bitmap,cliprect,flip_screen_get(screen.machine())); |
| 304 | 304 | |
| 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); | |
| 307 | 307 | |
| 308 | 308 | draw_sprites(screen.machine(), bitmap,cliprect); |
| 309 | 309 | |
| 310 | 310 | /* 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); | |
| 313 | 313 | |
| 314 | 314 | draw_bullets(screen.machine(), bitmap,cliprect); |
| 315 | 315 |
| r13798 | r13799 | |
|---|---|---|
| 48 | 48 | state->m_tmpbitmap = auto_bitmap_alloc(machine, 512, 512, machine.primary_screen->format()); |
| 49 | 49 | } |
| 50 | 50 | |
| 51 | static void draw_status( running_machine &machine, bitmap_t *bitmap, const rectangle | |
| 51 | static void draw_status( running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect ) | |
| 52 | 52 | { |
| 53 | 53 | munchmo_state *state = machine.driver_data<munchmo_state>(); |
| 54 | 54 | const gfx_element *gfx = machine.gfx[0]; |
| r13798 | r13799 | |
| 76 | 76 | } |
| 77 | 77 | } |
| 78 | 78 | |
| 79 | static void draw_background( running_machine &machine, bitmap_t *bitmap, const rectangle | |
| 79 | static void draw_background( running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect ) | |
| 80 | 80 | { |
| 81 | 81 | /* |
| 82 | 82 | ROM B1.2C contains 256 tilemaps defining 4x4 configurations of |
| r13798 | r13799 | |
| 98 | 98 | { |
| 99 | 99 | for (col = 0; col < 4; col++) |
| 100 | 100 | { |
| 101 | drawgfx_opaque(state->m_tmpbitmap, | |
| 101 | drawgfx_opaque(state->m_tmpbitmap, state->m_tmpbitmap->cliprect(), gfx, | |
| 102 | 102 | rom[col + tile_number * 4 + row * 0x400], |
| 103 | 103 | state->m_palette_bank, |
| 104 | 104 | 0,0, /* flip */ |
| r13798 | r13799 | |
| 115 | 115 | } |
| 116 | 116 | } |
| 117 | 117 | |
| 118 | static void draw_sprites( running_machine &machine, bitmap_t *bitmap, const rectangle | |
| 118 | static void draw_sprites( running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect ) | |
| 119 | 119 | { |
| 120 | 120 | munchmo_state *state = machine.driver_data<munchmo_state>(); |
| 121 | 121 | int scroll = state->m_vreg[6]; |
| r13798 | r13799 | |
|---|---|---|
| 95 | 95 | state->m_bg_tilemap = tilemap_create(machine, get_bg_tile_info, funkybee_tilemap_scan, 8, 8, 32, 32); |
| 96 | 96 | } |
| 97 | 97 | |
| 98 | static void draw_sprites( running_machine &machine, bitmap_t *bitmap, const rectangle | |
| 98 | static void draw_sprites( running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect ) | |
| 99 | 99 | { |
| 100 | 100 | funkybee_state *state = machine.driver_data<funkybee_state>(); |
| 101 | 101 | int offs; |
| r13798 | r13799 | |
| 124 | 124 | } |
| 125 | 125 | } |
| 126 | 126 | |
| 127 | static void draw_columns( running_machine &machine, bitmap_t *bitmap, const rectangle | |
| 127 | static void draw_columns( running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect ) | |
| 128 | 128 | { |
| 129 | 129 | funkybee_state *state = machine.driver_data<funkybee_state>(); |
| 130 | 130 | int offs; |
| r13798 | r13799 | |
|---|---|---|
| 193 | 193 | } |
| 194 | 194 | } |
| 195 | 195 | |
| 196 | static void draw_sprites(running_machine &machine, bitmap_t *bitmap, const rectangle | |
| 196 | static void draw_sprites(running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect, const int *primasks, int priority) | |
| 197 | 197 | { |
| 198 | 198 | galastrm_state *state = machine.driver_data<galastrm_state>(); |
| 199 | 199 | struct tempsprite *sprite_ptr = state->m_sprite_ptr_pre; |
| r13798 | r13799 | |
| 242 | 242 | } |
| 243 | 243 | } |
| 244 | 244 | |
| 245 | static void tc0610_rotate_draw(running_machine &machine, bitmap_t *bitmap, bitmap_t *srcbitmap, const rectangle | |
| 245 | static void tc0610_rotate_draw(running_machine &machine, bitmap_t *bitmap, bitmap_t *srcbitmap, const rectangle &clip) | |
| 246 | 246 | { |
| 247 | 247 | galastrm_state *state = machine.driver_data<galastrm_state>(); |
| 248 | 248 | poly_extra_data *extra = (poly_extra_data *)poly_get_extra_data(state->m_poly); |
| r13798 | r13799 | |
| 466 | 466 | pivlayer[1] = pivlayer[0] ^ 1; |
| 467 | 467 | pivlayer[2] = 2; |
| 468 | 468 | |
| 469 | bitmap->fill(0, | |
| 469 | bitmap->fill(0, | |
| 470 | 470 | priority_bitmap->fill(0, clip); |
| 471 | 471 | state->m_tmpbitmaps->fill(0, clip); |
| 472 | 472 | |
| r13798 | r13799 | |
| 476 | 476 | #if 0 |
| 477 | 477 | if (layer[0]==0 && layer[1]==3 && layer[2]==2 && layer[3]==1) |
| 478 | 478 | { |
| 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); | |
| 483 | 483 | } |
| 484 | 484 | else |
| 485 | 485 | { |
| 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); | |
| 490 | 490 | } |
| 491 | 491 | |
| 492 | 492 | if (layer[0]==3 && layer[1]==0 && layer[2]==1 && layer[3]==2) |
| r13798 | r13799 | |
| 506 | 506 | } |
| 507 | 507 | |
| 508 | 508 | draw_sprites_pre(screen.machine(), 42-X_OFFSET, -571+Y_OFFSET); |
| 509 | draw_sprites(screen.machine(),state->m_tmpbitmaps, | |
| 509 | draw_sprites(screen.machine(),state->m_tmpbitmaps, | |
| 510 | 510 | |
| 511 | 511 | copybitmap_trans(bitmap,state->m_polybitmap,0,0, 0,0,cliprect,0); |
| 512 | 512 | state->m_polybitmap->fill(0, clip); |
| 513 | 513 | tc0610_rotate_draw(screen.machine(),state->m_polybitmap,state->m_tmpbitmaps,cliprect); |
| 514 | 514 | |
| 515 | priority_bitmap->fill(0, | |
| 515 | priority_bitmap->fill(0, | |
| 516 | 516 | draw_sprites(screen.machine(),bitmap,cliprect,primasks,0); |
| 517 | 517 | |
| 518 | 518 | if (!screen.machine().input().code_pressed(KEYCODE_B)) tc0480scp_tilemap_draw(tc0480scp, bitmap, cliprect, layer[4], 0, 0); |
| r13798 | r13799 | |
| 523 | 523 | #else |
| 524 | 524 | if (layer[0]==0 && layer[1]==3 && layer[2]==2 && layer[3]==1) |
| 525 | 525 | { |
| 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); | |
| 530 | 530 | } |
| 531 | 531 | else |
| 532 | 532 | { |
| 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); | |
| 537 | 537 | } |
| 538 | 538 | |
| 539 | 539 | if (layer[0]==3 && layer[1]==0 && layer[2]==1 && layer[3]==2) |
| r13798 | r13799 | |
| 553 | 553 | } |
| 554 | 554 | |
| 555 | 555 | draw_sprites_pre(screen.machine(), 42-X_OFFSET, -571+Y_OFFSET); |
| 556 | draw_sprites(screen.machine(),state->m_tmpbitmaps, | |
| 556 | draw_sprites(screen.machine(),state->m_tmpbitmaps, | |
| 557 | 557 | |
| 558 | 558 | copybitmap_trans(bitmap,state->m_polybitmap,0,0, 0,0,cliprect,0); |
| 559 | 559 | state->m_polybitmap->fill(0, clip); |
| 560 | 560 | tc0610_rotate_draw(screen.machine(),state->m_polybitmap,state->m_tmpbitmaps,cliprect); |
| 561 | 561 | |
| 562 | priority_bitmap->fill(0, | |
| 562 | priority_bitmap->fill(0, | |
| 563 | 563 | draw_sprites(screen.machine(),bitmap,cliprect,primasks,0); |
| 564 | 564 | |
| 565 | 565 | tc0480scp_tilemap_draw(tc0480scp, bitmap, cliprect, layer[4], 0, 0); |
| r13798 | r13799 | |
|---|---|---|
| 380 | 380 | /* sprites should be able to create shadows too, how? |
| 381 | 381 | -- it appears that sprites which should be shadows are often rendered *UNDER* the tilemaps, maybe related? |
| 382 | 382 | */ |
| 383 | static void tetrisp2_draw_sprites(running_machine &machine, bitmap_t *bitmap, bitmap_t *bitmap_pri, const rectangle | |
| 383 | static 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) | |
| 384 | 384 | { |
| 385 | 385 | int tx, ty, sx, sy, flipx, flipy; |
| 386 | 386 | int xsize, ysize; |
| r13798 | r13799 | |
| 471 | 471 | flipscreen = (state->m_systemregs[0x00] & 0x02); |
| 472 | 472 | |
| 473 | 473 | /* Black background color */ |
| 474 | bitmap->fill(0, | |
| 474 | bitmap->fill(0, | |
| 475 | 475 | screen.machine().priority_bitmap->fill(0); |
| 476 | 476 | |
| 477 | 477 | /* Flip Screen */ |
| r13798 | r13799 | |
| 556 | 556 | flipscreen = (state->m_systemregs[0x00] & 0x02); |
| 557 | 557 | |
| 558 | 558 | /* Black background color */ |
| 559 | bitmap->fill(0, | |
| 559 | bitmap->fill(0, | |
| 560 | 560 | screen.machine().priority_bitmap->fill(0); |
| 561 | 561 | |
| 562 | 562 | /* Flip Screen */ |
| r13798 | r13799 | |
| 646 | 646 | tilemap_set_scrollx(state->m_tilemap_sub_rot, 0, state->m_rocknms_sub_rotregs[ 0 ] + 0x400); |
| 647 | 647 | tilemap_set_scrolly(state->m_tilemap_sub_rot, 0, state->m_rocknms_sub_rotregs[ 2 ] + 0x400); |
| 648 | 648 | |
| 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); | |
| 651 | 651 | |
| 652 | 652 | asc_pri = scr_pri = rot_pri = 0; |
| 653 | 653 | |
| r13798 | r13799 | |
| 707 | 707 | tilemap_set_scrolly(state->m_tilemap_rot, 0, state->m_rotregs[ 2 ] + 0x400); |
| 708 | 708 | |
| 709 | 709 | /* 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); | |
| 712 | 712 | |
| 713 | 713 | asc_pri = scr_pri = rot_pri = 0; |
| 714 | 714 |
| r13798 | r13799 | |
|---|---|---|
| 218 | 218 | |
| 219 | 219 | ***************************************************************************/ |
| 220 | 220 | |
| 221 | static void draw_sprites( running_machine &machine, bitmap_t *bitmap, const rectangle | |
| 221 | static void draw_sprites( running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect, int pri ) | |
| 222 | 222 | { |
| 223 | 223 | lastduel_state *state = machine.driver_data<lastduel_state>(); |
| 224 | 224 |
| r13798 | r13799 | |
|---|---|---|
| 60 | 60 | tilemap_mark_tile_dirty(state->m_md_tilemap, offset / 2); |
| 61 | 61 | } |
| 62 | 62 | |
| 63 | static void draw_sprites( running_machine &machine, bitmap_t *bitmap,const rectangle | |
| 63 | static void draw_sprites( running_machine &machine, bitmap_t *bitmap,const rectangle &cliprect ) | |
| 64 | 64 | { |
| 65 | 65 | drgnmst_state *state = machine.driver_data<drgnmst_state>(); |
| 66 | 66 | const gfx_element *gfx = machine.gfx[0]; |
| r13798 | r13799 | |
|---|---|---|
| 75 | 75 | /******************************************************************************/ |
| 76 | 76 | |
| 77 | 77 | //AT |
| 78 | static void draw_sprites( running_machine &machine, bitmap_t *bitmap, const rectangle | |
| 78 | static void draw_sprites( running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect, int j, int s, int e ) | |
| 79 | 79 | { |
| 80 | 80 | alpha68k_state *state = machine.driver_data<alpha68k_state>(); |
| 81 | 81 | UINT16 *spriteram = state->m_spriteram; |
| r13798 | r13799 | |
| 138 | 138 | state->m_last_bank = state->m_bank_base; |
| 139 | 139 | tilemap_set_flip_all(screen.machine(), state->m_flipscreen ? (TILEMAP_FLIPY | TILEMAP_FLIPX) : 0); |
| 140 | 140 | |
| 141 | bitmap->fill(2047, | |
| 141 | bitmap->fill(2047, | |
| 142 | 142 | //AT |
| 143 | 143 | draw_sprites(screen.machine(), bitmap, cliprect, 0, 0x07c0, 0x0800); |
| 144 | 144 | draw_sprites(screen.machine(), bitmap, cliprect, 1, 0x0000, 0x0800); |
| r13798 | r13799 | |
| 221 | 221 | } |
| 222 | 222 | } |
| 223 | 223 | |
| 224 | static void draw_sprites_V( running_machine &machine, bitmap_t *bitmap, const rectangle | |
| 224 | static 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 ) | |
| 225 | 225 | { |
| 226 | 226 | alpha68k_state *state = machine.driver_data<alpha68k_state>(); |
| 227 | 227 | UINT16 *spriteram = state->m_spriteram; |
| r13798 | r13799 | |
| 286 | 286 | state->m_last_bank = state->m_bank_base; |
| 287 | 287 | tilemap_set_flip_all(screen.machine(), state->m_flipscreen ? (TILEMAP_FLIPY | TILEMAP_FLIPX) : 0); |
| 288 | 288 | |
| 289 | bitmap->fill(4095, | |
| 289 | bitmap->fill(4095, | |
| 290 | 290 | |
| 291 | 291 | /* This appears to be correct priority */ |
| 292 | 292 | if (state->m_microcontroller_id == 0x8814) /* Sky Adventure */ |
| r13798 | r13799 | |
| 326 | 326 | state->m_last_bank = state->m_bank_base; |
| 327 | 327 | tilemap_set_flip_all(screen.machine(), state->m_flipscreen ? (TILEMAP_FLIPY | TILEMAP_FLIPX) : 0); |
| 328 | 328 | |
| 329 | bitmap->fill(4095, | |
| 329 | bitmap->fill(4095, | |
| 330 | 330 | |
| 331 | 331 | /* This appears to be correct priority */ |
| 332 | 332 | draw_sprites_V(screen.machine(), bitmap, cliprect, 0, 0x07c0, 0x0800, 0x4000, 0x8000, 0x3fff); |
| r13798 | r13799 | |
| 340 | 340 | |
| 341 | 341 | /******************************************************************************/ |
| 342 | 342 | //AT |
| 343 | static void draw_sprites_I( running_machine &machine, bitmap_t *bitmap, const rectangle | |
| 343 | static void draw_sprites_I( running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect, int c, int d, int yshift ) | |
| 344 | 344 | { |
| 345 | 345 | alpha68k_state *state = machine.driver_data<alpha68k_state>(); |
| 346 | 346 | UINT16 *spriteram = state->m_spriteram; |
| r13798 | r13799 | |
| 373 | 373 | alpha68k_state *state = screen.machine().driver_data<alpha68k_state>(); |
| 374 | 374 | int yshift = (state->m_microcontroller_id == 0x890a) ? 1 : 0; // The Next Space is 1 pixel off |
| 375 | 375 | |
| 376 | bitmap->fill(get_black_pen(screen.machine()), | |
| 376 | bitmap->fill(get_black_pen(screen.machine()), | |
| 377 | 377 | |
| 378 | 378 | /* This appears to be correct priority */ |
| 379 | 379 | draw_sprites_I(screen.machine(), bitmap, cliprect, 2, 0x0800, yshift); |
| r13798 | r13799 | |
| 448 | 448 | *bank = (data >> 11 & 4) | (data >> 10 & 3); |
| 449 | 449 | } |
| 450 | 450 | |
| 451 | static void kyros_draw_sprites( running_machine &machine, bitmap_t *bitmap, const rectangle | |
| 451 | static void kyros_draw_sprites( running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect, int c, int d ) | |
| 452 | 452 | { |
| 453 | 453 | alpha68k_state *state = machine.driver_data<alpha68k_state>(); |
| 454 | 454 | UINT16 *spriteram = state->m_spriteram; |
| r13798 | r13799 | |
| 505 | 505 | { |
| 506 | 506 | alpha68k_state *state = screen.machine().driver_data<alpha68k_state>(); |
| 507 | 507 | colortable_entry_set_value(screen.machine().colortable, 0x100, *state->m_videoram & 0xff); |
| 508 | bitmap->fill(0x100, | |
| 508 | bitmap->fill(0x100, | |
| 509 | 509 | |
| 510 | 510 | kyros_draw_sprites(screen.machine(), bitmap, cliprect, 2, 0x0800); |
| 511 | 511 | kyros_draw_sprites(screen.machine(), bitmap, cliprect, 3, 0x0c00); |
| r13798 | r13799 | |
| 515 | 515 | |
| 516 | 516 | /******************************************************************************/ |
| 517 | 517 | |
| 518 | static void sstingry_draw_sprites( running_machine &machine, bitmap_t *bitmap, const rectangle | |
| 518 | static void sstingry_draw_sprites( running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect, int c, int d ) | |
| 519 | 519 | { |
| 520 | 520 | //AT |
| 521 | 521 | alpha68k_state *state = machine.driver_data<alpha68k_state>(); |
| r13798 | r13799 | |
| 565 | 565 | { |
| 566 | 566 | alpha68k_state *state = screen.machine().driver_data<alpha68k_state>(); |
| 567 | 567 | colortable_entry_set_value(screen.machine().colortable, 0x100, *state->m_videoram & 0xff); |
| 568 | bitmap->fill(0x100, | |
| 568 | bitmap->fill(0x100, | |
| 569 | 569 | |
| 570 | 570 | sstingry_draw_sprites(screen.machine(), bitmap, cliprect, 2, 0x0800); |
| 571 | 571 | sstingry_draw_sprites(screen.machine(), bitmap, cliprect, 3, 0x0c00); |
| r13798 | r13799 | |
|---|---|---|
| 29 | 29 | tilemap_mark_tile_dirty(state->m_freek_tilemap, offset & 0x3ff); |
| 30 | 30 | } |
| 31 | 31 | |
| 32 | static void gigas_draw_sprites( running_machine &machine, bitmap_t *bitmap, const rectangle | |
| 32 | static void gigas_draw_sprites( running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect ) | |
| 33 | 33 | { |
| 34 | 34 | freekick_state *state = machine.driver_data<freekick_state>(); |
| 35 | 35 | int offs; |
| r13798 | r13799 | |
| 64 | 64 | } |
| 65 | 65 | |
| 66 | 66 | |
| 67 | static void pbillrd_draw_sprites( running_machine &machine, bitmap_t *bitmap, const rectangle | |
| 67 | static void pbillrd_draw_sprites( running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect ) | |
| 68 | 68 | { |
| 69 | 69 | freekick_state *state = machine.driver_data<freekick_state>(); |
| 70 | 70 | int offs; |
| r13798 | r13799 | |
| 100 | 100 | |
| 101 | 101 | |
| 102 | 102 | |
| 103 | static void freekick_draw_sprites( running_machine &machine, bitmap_t *bitmap, const rectangle | |
| 103 | static void freekick_draw_sprites( running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect ) | |
| 104 | 104 | { |
| 105 | 105 | freekick_state *state = machine.driver_data<freekick_state>(); |
| 106 | 106 | int offs; |
| r13798 | r13799 | |
|---|---|---|
| 715 | 715 | /* Draw the road in the given bitmap. The priority1 and priority2 parameters |
| 716 | 716 | specify the range of lines to draw */ |
| 717 | 717 | |
| 718 | static void cischeat_draw_road(running_machine &machine, bitmap_t *bitmap, const rectangle | |
| 718 | static void cischeat_draw_road(running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect, int road_num, int priority1, int priority2, int transparency) | |
| 719 | 719 | { |
| 720 | 720 | cischeat_state *state = machine.driver_data<cischeat_state>(); |
| 721 | 721 | int curr_code,sx,sy; |
| 722 | 722 | int min_priority, max_priority; |
| 723 | 723 | |
| 724 | rectangle rect = | |
| 724 | rectangle rect = | |
| 725 | 725 | gfx_element *gfx = machine.gfx[(road_num & 1)?5:4]; |
| 726 | 726 | |
| 727 | 727 | UINT16 *roadram = state->m_roadram[road_num & 1]; |
| r13798 | r13799 | |
| 757 | 757 | |
| 758 | 758 | for (sx = -(xscroll%TILE_SIZE) ; sx <= max_x ; sx +=TILE_SIZE) |
| 759 | 759 | { |
| 760 | drawgfx_transpen(bitmap, | |
| 760 | drawgfx_transpen(bitmap, | |
| 761 | 761 | curr_code++, |
| 762 | 762 | attr, |
| 763 | 763 | 0,0, |
| r13798 | r13799 | |
| 805 | 805 | /* Draw the road in the given bitmap. The priority1 and priority2 parameters |
| 806 | 806 | specify the range of lines to draw */ |
| 807 | 807 | |
| 808 | static void f1gpstar_draw_road(running_machine &machine, bitmap_t *bitmap, const rectangle | |
| 808 | static void f1gpstar_draw_road(running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect, int road_num, int priority1, int priority2, int transparency) | |
| 809 | 809 | { |
| 810 | 810 | cischeat_state *state = machine.driver_data<cischeat_state>(); |
| 811 | 811 | int sx,sy; |
| 812 | 812 | int xstart; |
| 813 | 813 | int min_priority, max_priority; |
| 814 | 814 | |
| 815 | rectangle rect = | |
| 815 | rectangle rect = | |
| 816 | 816 | gfx_element *gfx = machine.gfx[(road_num & 1)?5:4]; |
| 817 | 817 | |
| 818 | 818 | UINT16 *roadram = state->m_roadram[road_num & 1]; |
| r13798 | r13799 | |
| 864 | 864 | /* Draw the line */ |
| 865 | 865 | for (sx = xstart ; sx <= max_x ; sx += xdim) |
| 866 | 866 | { |
| 867 | drawgfxzoom_transpen(bitmap, | |
| 867 | drawgfxzoom_transpen(bitmap, | |
| 868 | 868 | code++, |
| 869 | 869 | attr >> 8, |
| 870 | 870 | 0,0, |
| r13798 | r13799 | |
| 921 | 921 | sprites whose priority nibble is between 0 and 15 and whose |
| 922 | 922 | colour code's high bit is set. */ |
| 923 | 923 | |
| 924 | static void cischeat_draw_sprites(running_machine &machine, bitmap_t *bitmap , const rectangle | |
| 924 | static void cischeat_draw_sprites(running_machine &machine, bitmap_t *bitmap , const rectangle &cliprect, int priority1, int priority2) | |
| 925 | 925 | { |
| 926 | 926 | cischeat_state *state = machine.driver_data<cischeat_state>(); |
| 927 | 927 | int x, sx, flipx, xzoom, xscale, xdim, xnum, xstart, xend, xinc; |
| r13798 | r13799 | |
| 1077 | 1077 | |
| 1078 | 1078 | ***************************************************************************/ |
| 1079 | 1079 | |
| 1080 | static void bigrun_draw_sprites(running_machine &machine, bitmap_t *bitmap , const rectangle | |
| 1080 | static void bigrun_draw_sprites(running_machine &machine, bitmap_t *bitmap , const rectangle &cliprect, int priority1, int priority2) | |
| 1081 | 1081 | { |
| 1082 | 1082 | cischeat_state *state = machine.driver_data<cischeat_state>(); |
| 1083 | 1083 | int x, sx, flipx, xzoom, xscale, xdim, xnum, xstart, xend, xinc; |
| r13798 | r13799 | |
| 1265 | 1265 | cischeat_tmap_SET_SCROLL(1) |
| 1266 | 1266 | cischeat_tmap_SET_SCROLL(2) |
| 1267 | 1267 | |
| 1268 | bitmap->fill(0, | |
| 1268 | bitmap->fill(0, | |
| 1269 | 1269 | |
| 1270 | 1270 | for (i = 7; i >= 4; i--) |
| 1271 | 1271 | { /* bitmap, road, min_priority, max_priority, transparency */ |
| r13798 | r13799 | |
| 1319 | 1319 | cischeat_tmap_SET_SCROLL(1) |
| 1320 | 1320 | cischeat_tmap_SET_SCROLL(2) |
| 1321 | 1321 | |
| 1322 | bitmap->fill(0, | |
| 1322 | bitmap->fill(0, | |
| 1323 | 1323 | |
| 1324 | 1324 | /* bitmap, road, priority, transparency */ |
| 1325 | 1325 | if (state->m_active_layers & 0x10) cischeat_draw_road(screen.machine(),bitmap,cliprect,0,7,5,FALSE); |
| r13798 | r13799 | |
| 1327 | 1327 | |
| 1328 | 1328 | flag = 0; |
| 1329 | 1329 | cischeat_tmap_DRAW(0) |
| 1330 | // else bitmap->fill(0, | |
| 1330 | // else bitmap->fill(0, | |
| 1331 | 1331 | cischeat_tmap_DRAW(1) |
| 1332 | 1332 | |
| 1333 | 1333 | if (state->m_active_layers & 0x08) cischeat_draw_sprites(screen.machine(),bitmap,cliprect,15,3); |
| r13798 | r13799 | |
| 1376 | 1376 | cischeat_tmap_SET_SCROLL(1); |
| 1377 | 1377 | cischeat_tmap_SET_SCROLL(2); |
| 1378 | 1378 | |
| 1379 | bitmap->fill(0, | |
| 1379 | bitmap->fill(0, | |
| 1380 | 1380 | |
| 1381 | 1381 | /* 1: clouds 5, grad 7, road 0 2: clouds 5, grad 7, road 0, tunnel roof 0 */ |
| 1382 | 1382 | |
| r13798 | r13799 | |
| 1386 | 1386 | |
| 1387 | 1387 | flag = 0; |
| 1388 | 1388 | cischeat_tmap_DRAW(0) |
| 1389 | // else bitmap->fill(0, | |
| 1389 | // else bitmap->fill(0, | |
| 1390 | 1390 | cischeat_tmap_DRAW(1) |
| 1391 | 1391 | |
| 1392 | 1392 | /* road 1!! 0!! */ /* bitmap, road, min_priority, max_priority, transparency */ |
| r13798 | r13799 | |
| 1453 | 1453 | cischeat_tmap_SET_SCROLL(0) |
| 1454 | 1454 | cischeat_tmap_SET_SCROLL(2) |
| 1455 | 1455 | |
| 1456 | bitmap->fill(0, | |
| 1456 | bitmap->fill(0, | |
| 1457 | 1457 | |
| 1458 | 1458 | flag = 0; |
| 1459 | 1459 | cischeat_tmap_DRAW(0) |
| r13798 | r13799 | |
|---|---|---|
| 726 | 726 | } |
| 727 | 727 | } |
| 728 | 728 | |
| 729 | poly_render_triangle_fan(state->m_poly, bitmap, | |
| 729 | poly_render_triangle_fan(state->m_poly, bitmap, | |
| 730 | 730 | } |
| 731 | 731 | |
| 732 | 732 | static void renderscanline_sprite(void *destbase, INT32 scanline, const poly_extent *extent, const void *extradata, int threadid) |
| r13798 | r13799 | |
| 843 | 843 | rgb_comp_to_rgbint(&extra->fogColor, mixer.rFogColor, mixer.gFogColor, mixer.bFogColor); |
| 844 | 844 | } |
| 845 | 845 | |
| 846 | poly_render_triangle_fan(state->m_poly, dest_bmp, | |
| 846 | poly_render_triangle_fan(state->m_poly, dest_bmp, | |
| 847 | 847 | } |
| 848 | 848 | } /* poly3d_DrawSprite */ |
| 849 | 849 | |
| r13798 | r13799 | |
| 1507 | 1507 | DrawSpritesHelper( |
| 1508 | 1508 | running_machine &machine, |
| 1509 | 1509 | bitmap_t *bitmap, |
| 1510 | const rectangle | |
| 1510 | const rectangle &cliprect, | |
| 1511 | 1511 | UINT32 *pBase, |
| 1512 | 1512 | const UINT32 *pSource, |
| 1513 | 1513 | const UINT32 *pPal, |
| r13798 | r13799 | |
| 1641 | 1641 | } /* DrawSpritesHelper */ |
| 1642 | 1642 | |
| 1643 | 1643 | static void |
| 1644 | DrawSprites( running_machine &machine, bitmap_t *bitmap, const rectangle | |
| 1644 | DrawSprites( running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect ) | |
| 1645 | 1645 | { |
| 1646 | 1646 | namcos22_state *state = machine.driver_data<namcos22_state>(); |
| 1647 | 1647 | UINT32 *spriteram32 = state->m_spriteram; |
| r13798 | r13799 | |
| 1957 | 1957 | } |
| 1958 | 1958 | } |
| 1959 | 1959 | |
| 1960 | static void namcos22s_mix_textlayer( running_machine &machine, bitmap_t *bitmap, const rectangle | |
| 1960 | static void namcos22s_mix_textlayer( running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect, int prival ) | |
| 1961 | 1961 | { |
| 1962 | 1962 | namcos22_state *state = machine.driver_data<namcos22_state>(); |
| 1963 | 1963 | const pen_t *pens = machine.pens; |
| r13798 | r13799 | |
| 2041 | 2041 | } |
| 2042 | 2042 | } |
| 2043 | 2043 | |
| 2044 | static void namcos22_mix_textlayer( running_machine &machine, bitmap_t *bitmap, const rectangle | |
| 2044 | static void namcos22_mix_textlayer( running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect ) | |
| 2045 | 2045 | { |
| 2046 | 2046 | namcos22_state *state = machine.driver_data<namcos22_state>(); |
| 2047 | 2047 | const pen_t *pens = machine.pens; |
| r13798 | r13799 | |
| 2099 | 2099 | } |
| 2100 | 2100 | } |
| 2101 | 2101 | |
| 2102 | static void DrawCharacterLayer(running_machine &machine, bitmap_t *bitmap, const rectangle | |
| 2102 | static void DrawCharacterLayer(running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect ) | |
| 2103 | 2103 | { |
| 2104 | 2104 | namcos22_state *state = machine.driver_data<namcos22_state>(); |
| 2105 | 2105 | int scroll_x = (state->m_tilemapattr[0]>>16) - 0x35c; |
| r13798 | r13799 | |
| 2817 | 2817 | UpdateVideoMixer(screen.machine()); |
| 2818 | 2818 | UpdatePalette(screen.machine()); |
| 2819 | 2819 | namcos22s_recalc_czram(screen.machine()); |
| 2820 | screen.machine().priority_bitmap->fill(0, | |
| 2820 | screen.machine().priority_bitmap->fill(0, | |
| 2821 | 2821 | |
| 2822 | 2822 | // background color |
| 2823 | 2823 | rgbint bg_color; |
| r13798 | r13799 | |
| 2828 | 2828 | rgb_comp_to_rgbint(&fade_color, mixer.rFadeColor, mixer.gFadeColor, mixer.bFadeColor); |
| 2829 | 2829 | rgbint_blend(&bg_color, &fade_color, 0xff - mixer.fadeFactor); |
| 2830 | 2830 | } |
| 2831 | bitmap->fill(rgbint_to_rgb(&bg_color), | |
| 2831 | bitmap->fill(rgbint_to_rgb(&bg_color), | |
| 2832 | 2832 | |
| 2833 | 2833 | // layers |
| 2834 | 2834 | UINT8 layer = nthbyte(state->m_gamma,0x1f); |
| r13798 | r13799 | |
| 2898 | 2898 | { |
| 2899 | 2899 | UpdateVideoMixer(screen.machine()); |
| 2900 | 2900 | 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); | |
| 2903 | 2903 | DrawPolygons(screen.machine(), bitmap); |
| 2904 | 2904 | RenderScene(screen.machine(), bitmap); |
| 2905 | 2905 | DrawCharacterLayer(screen.machine(), bitmap, cliprect); |
| r13798 | r13799 | |
|---|---|---|
| 183 | 183 | tilemap_set_transparent_pen(state->m_fg_tilemap, 0); |
| 184 | 184 | } |
| 185 | 185 | |
| 186 | static void draw_sprites( running_machine &machine, bitmap_t *bitmap, const rectangle | |
| 186 | static void draw_sprites( running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect ) | |
| 187 | 187 | { |
| 188 | 188 | ladybug_state *state = machine.driver_data<ladybug_state>(); |
| 189 | 189 | UINT8 *spriteram = state->m_spriteram; |
| r13798 | r13799 | |
| 267 | 267 | } |
| 268 | 268 | } |
| 269 | 269 | |
| 270 | static void draw_bullets( running_machine &machine, bitmap_t *bitmap, const rectangle | |
| 270 | static void draw_bullets( running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect ) | |
| 271 | 271 | { |
| 272 | 272 | ladybug_state *state = machine.driver_data<ladybug_state>(); |
| 273 | 273 | int offs; |
| r13798 | r13799 | |
| 283 | 283 | sx = 240 - sx; |
| 284 | 284 | } |
| 285 | 285 | |
| 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) | |
| 288 | 288 | bitmap->pix16(sy, sx) = 0x19; |
| 289 | 289 | } |
| 290 | 290 | } |
| r13798 | r13799 | |
| 360 | 360 | /* Space Raider doesn't use the Va bit, and it is also set up to */ |
| 361 | 361 | /* window the stars to a certain x range */ |
| 362 | 362 | |
| 363 | void redclash_draw_stars( running_machine &machine, bitmap_t *bitmap, const rectangle | |
| 363 | void redclash_draw_stars( running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect, UINT8 palette_offset, UINT8 sraider, UINT8 firstx, UINT8 lastx ) | |
| 364 | 364 | { |
| 365 | 365 | ladybug_state *redclash = machine.driver_data<ladybug_state>(); |
| 366 | 366 | int i; |
| r13798 | r13799 | |
| 396 | 396 | else |
| 397 | 397 | vcond = yloc & 0x01; |
| 398 | 398 | |
| 399 | if (xloc >= cliprect | |
| 399 | if (xloc >= cliprect. | |
| 400 | 400 | { |
| 401 | 401 | if ((hcond ^ vcond) == 0) |
| 402 | 402 | { |
| r13798 | r13799 | |
| 427 | 427 | { |
| 428 | 428 | ladybug_state *state = screen.machine().driver_data<ladybug_state>(); |
| 429 | 429 | |
| 430 | bitmap->fill(get_black_pen(screen.machine()), | |
| 430 | bitmap->fill(get_black_pen(screen.machine()), | |
| 431 | 431 | redclash_draw_stars(screen.machine(), bitmap, cliprect, 0x60, 0, 0x00, 0xff); |
| 432 | 432 | draw_sprites(screen.machine(), bitmap, cliprect); |
| 433 | 433 | draw_bullets(screen.machine(), bitmap, cliprect); |
| r13798 | r13799 | |
|---|---|---|
| 33 | 33 | { |
| 34 | 34 | vicdual_state *state = screen.machine().driver_data<vicdual_state>(); |
| 35 | 35 | UINT8 x = 0; |
| 36 | UINT8 y = cliprect | |
| 36 | UINT8 y = cliprect. | |
| 37 | 37 | UINT8 video_data = 0; |
| 38 | 38 | |
| 39 | 39 | while (1) |
| r13798 | r13799 | |
| 66 | 66 | if (x == 0) |
| 67 | 67 | { |
| 68 | 68 | /* end of region to update? */ |
| 69 | if (y == cliprect | |
| 69 | if (y == cliprect. | |
| 70 | 70 | { |
| 71 | 71 | break; |
| 72 | 72 | } |
| r13798 | r13799 | |
| 85 | 85 | vicdual_state *state = screen.machine().driver_data<vicdual_state>(); |
| 86 | 86 | UINT8 *color_prom = (UINT8 *)screen.machine().region("proms")->base(); |
| 87 | 87 | UINT8 x = 0; |
| 88 | UINT8 y = cliprect | |
| 88 | UINT8 y = cliprect. | |
| 89 | 89 | UINT8 video_data = 0; |
| 90 | 90 | pen_t back_pen = 0; |
| 91 | 91 | pen_t fore_pen = 0; |
| r13798 | r13799 | |
| 125 | 125 | if (x == 0) |
| 126 | 126 | { |
| 127 | 127 | /* end of region to update? */ |
| 128 | if (y == cliprect | |
| 128 | if (y == cliprect. | |
| 129 | 129 | { |
| 130 | 130 | break; |
| 131 | 131 | } |
| r13798 | r13799 | |
|---|---|---|
| 33 | 33 | static TIMER_CALLBACK( stars_scroll_callback ); |
| 34 | 34 | |
| 35 | 35 | void galaxold_init_stars(running_machine &machine, int colors_offset); |
| 36 | static 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); | |
| 38 | static void scrambold_draw_stars(running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect); | |
| 39 | static void rescue_draw_stars(running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect); | |
| 40 | static void mariner_draw_stars(running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect); | |
| 36 | static 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); | |
| 38 | static void scrambold_draw_stars(running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect); | |
| 39 | static void rescue_draw_stars(running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect); | |
| 40 | static void mariner_draw_stars(running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect); | |
| 41 | 41 | static void start_stars_blink_timer(running_machine &machine, double ra, double rb, double c); |
| 42 | 42 | static void start_stars_scroll_timer(running_machine &machine); |
| 43 | 43 | |
| 44 | 44 | /* bullets circuit */ |
| 45 | static void galaxold_draw_bullets(running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect, int offs, int x, int y); | |
| 46 | static void scrambold_draw_bullets(running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect, int offs, int x, int y); | |
| 47 | static void darkplnt_draw_bullets(running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect, int offs, int x, int y); | |
| 48 | static void dambustr_draw_bullets(running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect, int offs, int x, int y); | |
| 45 | static void galaxold_draw_bullets(running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect, int offs, int x, int y); | |
| 46 | static void scrambold_draw_bullets(running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect, int offs, int x, int y); | |
| 47 | static void darkplnt_draw_bullets(running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect, int offs, int x, int y); | |
| 48 | static void dambustr_draw_bullets(running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect, int offs, int x, int y); | |
| 49 | 49 | |
| 50 | 50 | /* background circuit */ |
| 51 | static void galaxold_draw_background(running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect); | |
| 52 | static void scrambold_draw_background(running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect); | |
| 53 | static void ad2083_draw_background(running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect); | |
| 54 | static void mariner_draw_background(running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect); | |
| 55 | static void stratgyx_draw_background(running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect); | |
| 56 | static void minefld_draw_background(running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect); | |
| 57 | static void rescue_draw_background(running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect); | |
| 58 | static void dambustr_draw_background(running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect); | |
| 51 | static void galaxold_draw_background(running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect); | |
| 52 | static void scrambold_draw_background(running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect); | |
| 53 | static void ad2083_draw_background(running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect); | |
| 54 | static void mariner_draw_background(running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect); | |
| 55 | static void stratgyx_draw_background(running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect); | |
| 56 | static void minefld_draw_background(running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect); | |
| 57 | static void rescue_draw_background(running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect); | |
| 58 | static void dambustr_draw_background(running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect); | |
| 59 | 59 | |
| 60 | 60 | |
| 61 | 61 | |
| r13798 | r13799 | |
| 613 | 613 | } |
| 614 | 614 | |
| 615 | 615 | #ifdef UNUSED_FUNCTION |
| 616 | static void theend_draw_bullets(running_machine &machine, bitmap_t *bitmap, const rectangle | |
| 616 | static void theend_draw_bullets(running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect, int offs, int x, int y) | |
| 617 | 617 | { |
| 618 | 618 | int i; |
| 619 | 619 | |
| r13798 | r13799 | |
| 623 | 623 | { |
| 624 | 624 | x--; |
| 625 | 625 | |
| 626 | if ((x >= cliprect | |
| 626 | if ((x >= cliprect. | |
| 627 | 627 | bitmap->pix16(y, x) = BULLETS_COLOR_BASE; |
| 628 | 628 | } |
| 629 | 629 | } |
| r13798 | r13799 | |
| 675 | 675 | |
| 676 | 676 | |
| 677 | 677 | |
| 678 | static void rockclim_draw_background(running_machine &machine, bitmap_t *bitmap, const rectangle | |
| 678 | static void rockclim_draw_background(running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect) | |
| 679 | 679 | { |
| 680 | 680 | galaxold_state *state = machine.driver_data<galaxold_state>(); |
| 681 | 681 | tilemap_draw(bitmap,cliprect,state->m_rockclim_tilemap, 0,0); |
| r13798 | r13799 | |
| 1134 | 1134 | |
| 1135 | 1135 | /* bullet drawing functions */ |
| 1136 | 1136 | |
| 1137 | static void galaxold_draw_bullets(running_machine &machine, bitmap_t *bitmap, const rectangle | |
| 1137 | static void galaxold_draw_bullets(running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect, int offs, int x, int y) | |
| 1138 | 1138 | { |
| 1139 | 1139 | int i; |
| 1140 | 1140 | |
| r13798 | r13799 | |
| 1143 | 1143 | { |
| 1144 | 1144 | x--; |
| 1145 | 1145 | |
| 1146 | if ((x >= cliprect | |
| 1146 | if ((x >= cliprect. | |
| 1147 | 1147 | { |
| 1148 | 1148 | int color; |
| 1149 | 1149 | |
| r13798 | r13799 | |
| 1156 | 1156 | } |
| 1157 | 1157 | } |
| 1158 | 1158 | |
| 1159 | static void scrambold_draw_bullets(running_machine &machine, bitmap_t *bitmap, const rectangle | |
| 1159 | static void scrambold_draw_bullets(running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect, int offs, int x, int y) | |
| 1160 | 1160 | { |
| 1161 | 1161 | galaxold_state *state = machine.driver_data<galaxold_state>(); |
| 1162 | 1162 | if (state->m_flipscreen_x) x++; |
| 1163 | 1163 | |
| 1164 | 1164 | x = x - 6; |
| 1165 | 1165 | |
| 1166 | if ((x >= cliprect | |
| 1166 | if ((x >= cliprect. | |
| 1167 | 1167 | /* yellow bullets */ |
| 1168 | 1168 | bitmap->pix16(y, x) = BULLETS_COLOR_BASE; |
| 1169 | 1169 | } |
| 1170 | 1170 | |
| 1171 | static void darkplnt_draw_bullets(running_machine &machine, bitmap_t *bitmap, const rectangle | |
| 1171 | static void darkplnt_draw_bullets(running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect, int offs, int x, int y) | |
| 1172 | 1172 | { |
| 1173 | 1173 | galaxold_state *state = machine.driver_data<galaxold_state>(); |
| 1174 | 1174 | if (state->m_flipscreen_x) x++; |
| 1175 | 1175 | |
| 1176 | 1176 | x = x - 6; |
| 1177 | 1177 | |
| 1178 | if ((x >= cliprect | |
| 1178 | if ((x >= cliprect. | |
| 1179 | 1179 | bitmap->pix16(y, x) = 32 + state->m_darkplnt_bullet_color; |
| 1180 | 1180 | } |
| 1181 | 1181 | |
| 1182 | static void dambustr_draw_bullets(running_machine &machine, bitmap_t *bitmap, const rectangle | |
| 1182 | static void dambustr_draw_bullets(running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect, int offs, int x, int y) | |
| 1183 | 1183 | { |
| 1184 | 1184 | int i, color; |
| 1185 | 1185 | |
| r13798 | r13799 | |
| 1200 | 1200 | x--; |
| 1201 | 1201 | } |
| 1202 | 1202 | |
| 1203 | if ((x >= cliprect | |
| 1203 | if ((x >= cliprect. | |
| 1204 | 1204 | bitmap->pix16(y, x) = color; |
| 1205 | 1205 | } |
| 1206 | 1206 | } |
| r13798 | r13799 | |
| 1209 | 1209 | |
| 1210 | 1210 | /* background drawing functions */ |
| 1211 | 1211 | |
| 1212 | static void galaxold_draw_background(running_machine &machine, bitmap_t *bitmap, const rectangle | |
| 1212 | static void galaxold_draw_background(running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect) | |
| 1213 | 1213 | { |
| 1214 | 1214 | /* plain black background */ |
| 1215 | bitmap->fill(0, | |
| 1215 | bitmap->fill(0, | |
| 1216 | 1216 | } |
| 1217 | 1217 | |
| 1218 | static void scrambold_draw_background(running_machine &machine, bitmap_t *bitmap, const rectangle | |
| 1218 | static void scrambold_draw_background(running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect) | |
| 1219 | 1219 | { |
| 1220 | 1220 | galaxold_state *state = machine.driver_data<galaxold_state>(); |
| 1221 | 1221 | if (state->m_background_enable) |
| 1222 | bitmap->fill(BACKGROUND_COLOR_BASE, | |
| 1222 | bitmap->fill(BACKGROUND_COLOR_BASE, | |
| 1223 | 1223 | else |
| 1224 | bitmap->fill(0, | |
| 1224 | bitmap->fill(0, | |
| 1225 | 1225 | } |
| 1226 | 1226 | |
| 1227 | static void ad2083_draw_background(running_machine &machine, bitmap_t *bitmap, const rectangle | |
| 1227 | static void ad2083_draw_background(running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect) | |
| 1228 | 1228 | { |
| 1229 | 1229 | galaxold_state *state = machine.driver_data<galaxold_state>(); |
| 1230 | 1230 | int color = (state->m_background_blue << 2) | (state->m_background_green << 1) | state->m_background_red; |
| 1231 | 1231 | |
| 1232 | bitmap->fill(BACKGROUND_COLOR_BASE + color, | |
| 1232 | bitmap->fill(BACKGROUND_COLOR_BASE + color, | |
| 1233 | 1233 | } |
| 1234 | 1234 | |
| 1235 | static void stratgyx_draw_background(running_machine &machine, bitmap_t *bitmap, const rectangle | |
| 1235 | static void stratgyx_draw_background(running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect) | |
| 1236 | 1236 | { |
| 1237 | 1237 | galaxold_state *state = machine.driver_data<galaxold_state>(); |
| 1238 | 1238 | UINT8 x; |
| r13798 | r13799 | |
| 1269 | 1269 | } |
| 1270 | 1270 | } |
| 1271 | 1271 | |
| 1272 | static void minefld_draw_background(running_machine &machine, bitmap_t *bitmap, const rectangle | |
| 1272 | static void minefld_draw_background(running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect) | |
| 1273 | 1273 | { |
| 1274 | 1274 | galaxold_state *state = machine.driver_data<galaxold_state>(); |
| 1275 | 1275 | if (state->m_background_enable) |
| r13798 | r13799 | |
| 1287 | 1287 | bitmap->plot_box(248, 0, 16, 256, base); |
| 1288 | 1288 | } |
| 1289 | 1289 | else |
| 1290 | bitmap->fill(0, | |
| 1290 | bitmap->fill(0, | |
| 1291 | 1291 | } |
| 1292 | 1292 | |
| 1293 | static void rescue_draw_background(running_machine &machine, bitmap_t *bitmap, const rectangle | |
| 1293 | static void rescue_draw_background(running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect) | |
| 1294 | 1294 | { |
| 1295 | 1295 | galaxold_state *state = machine.driver_data<galaxold_state>(); |
| 1296 | 1296 | if (state->m_background_enable) |
| r13798 | r13799 | |
| 1307 | 1307 | bitmap->plot_box(248, 0, 16, 256, base); |
| 1308 | 1308 | } |
| 1309 | 1309 | else |
| 1310 | bitmap->fill(0, | |
| 1310 | bitmap->fill(0, | |
| 1311 | 1311 | } |
| 1312 | 1312 | |
| 1313 | static void mariner_draw_background(running_machine &machine, bitmap_t *bitmap, const rectangle | |
| 1313 | static void mariner_draw_background(running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect) | |
| 1314 | 1314 | { |
| 1315 | 1315 | galaxold_state *state = machine.driver_data<galaxold_state>(); |
| 1316 | 1316 | int base = BACKGROUND_COLOR_BASE; |
| r13798 | r13799 | |
| 1354 | 1354 | } |
| 1355 | 1355 | } |
| 1356 | 1356 | |
| 1357 | static void dambustr_draw_background(running_machine &machine, bitmap_t *bitmap, const rectangle | |
| 1357 | static void dambustr_draw_background(running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect) | |
| 1358 | 1358 | { |
| 1359 | 1359 | galaxold_state *state = machine.driver_data<galaxold_state>(); |
| 1360 | 1360 | int base = BACKGROUND_COLOR_BASE; |
| r13798 | r13799 | |
| 1374 | 1374 | |
| 1375 | 1375 | } |
| 1376 | 1376 | |
| 1377 | static void dambustr_draw_upper_background(running_machine &machine, bitmap_t *bitmap, const rectangle | |
| 1377 | static void dambustr_draw_upper_background(running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect) | |
| 1378 | 1378 | { |
| 1379 | 1379 | galaxold_state *state = machine.driver_data<galaxold_state>(); |
| 1380 | 1380 | rectangle clip; |
| r13798 | r13799 | |
| 1385 | 1385 | clip.max_x = state->m_dambustr_bg_split_line; |
| 1386 | 1386 | clip.min_y = 0; |
| 1387 | 1387 | clip.max_y = 255; |
| 1388 | copybitmap(bitmap, state->m_dambustr_tmpbitmap, 0, 0, 0, 0, | |
| 1388 | copybitmap(bitmap, state->m_dambustr_tmpbitmap, 0, 0, 0, 0, | |
| 1389 | 1389 | } |
| 1390 | 1390 | else |
| 1391 | 1391 | { |
| r13798 | r13799 | |
| 1393 | 1393 | clip.max_x = 254 - state->m_dambustr_bg_split_line; |
| 1394 | 1394 | clip.min_y = 0; |
| 1395 | 1395 | clip.max_y = 255; |
| 1396 | copybitmap(bitmap, state->m_dambustr_tmpbitmap, 0, 0, 0, 0, | |
| 1396 | copybitmap(bitmap, state->m_dambustr_tmpbitmap, 0, 0, 0, 0, | |
| 1397 | 1397 | } |
| 1398 | 1398 | } |
| 1399 | 1399 | |
| r13798 | r13799 | |
| 1474 | 1474 | } |
| 1475 | 1475 | } |
| 1476 | 1476 | |
| 1477 | static void plot_star(galaxold_state *state, bitmap_t *bitmap, int x, int y, int color, const rectangle | |
| 1477 | static void plot_star(galaxold_state *state, bitmap_t *bitmap, int x, int y, int color, const rectangle &cliprect) | |
| 1478 | 1478 | { |
| 1479 | 1479 | if (state->m_flipscreen_x) |
| 1480 | 1480 | x = 255 - x; |
| r13798 | r13799 | |
| 1482 | 1482 | if (state->m_flipscreen_y) |
| 1483 | 1483 | y = 255 - y; |
| 1484 | 1484 | |
| 1485 | if ((x >= cliprect | |
| 1485 | if ((x >= cliprect. | |
| 1486 | 1486 | bitmap->pix16(y, x) = state->m_stars_colors_start + color; |
| 1487 | 1487 | } |
| 1488 | 1488 | |
| 1489 | static void noop_draw_stars(running_machine &machine, bitmap_t *bitmap, const rectangle | |
| 1489 | static void noop_draw_stars(running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect) | |
| 1490 | 1490 | { |
| 1491 | 1491 | } |
| 1492 | 1492 | |
| 1493 | void galaxold_draw_stars(running_machine &machine, bitmap_t *bitmap, const rectangle | |
| 1493 | void galaxold_draw_stars(running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect) | |
| 1494 | 1494 | { |
| 1495 | 1495 | galaxold_state *state = machine.driver_data<galaxold_state>(); |
| 1496 | 1496 | struct star *stars = state->m_stars; |
| r13798 | r13799 | |
| 1519 | 1519 | } |
| 1520 | 1520 | } |
| 1521 | 1521 | |
| 1522 | static void scrambold_draw_stars(running_machine &machine, bitmap_t *bitmap, const rectangle | |
| 1522 | static void scrambold_draw_stars(running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect) | |
| 1523 | 1523 | { |
| 1524 | 1524 | galaxold_state *state = machine.driver_data<galaxold_state>(); |
| 1525 | 1525 | struct star *stars = state->m_stars; |
| r13798 | r13799 | |
| 1565 | 1565 | } |
| 1566 | 1566 | } |
| 1567 | 1567 | |
| 1568 | static void rescue_draw_stars(running_machine &machine, bitmap_t *bitmap, const rectangle | |
| 1568 | static void rescue_draw_stars(running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect) | |
| 1569 | 1569 | { |
| 1570 | 1570 | galaxold_state *state = machine.driver_data<galaxold_state>(); |
| 1571 | 1571 | struct star *stars = state->m_stars; |
| r13798 | r13799 | |
| 1613 | 1613 | } |
| 1614 | 1614 | } |
| 1615 | 1615 | |
| 1616 | static void mariner_draw_stars(running_machine &machine, bitmap_t *bitmap, const rectangle | |
| 1616 | static void mariner_draw_stars(running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect) | |
| 1617 | 1617 | { |
| 1618 | 1618 | galaxold_state *state = machine.driver_data<galaxold_state>(); |
| 1619 | 1619 | struct star *stars = state->m_stars; |
| r13798 | r13799 | |
| 1712 | 1712 | SET_TILE_INFO(2, code, 0, 0); |
| 1713 | 1713 | } |
| 1714 | 1714 | |
| 1715 | static void draw_bullets_common(running_machine &machine, bitmap_t *bitmap, const rectangle | |
| 1715 | static void draw_bullets_common(running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect) | |
| 1716 | 1716 | { |
| 1717 | 1717 | galaxold_state *state = machine.driver_data<galaxold_state>(); |
| 1718 | 1718 | int offs; |
| r13798 | r13799 | |
| 1793 | 1793 | if (offs < 3*4) sy++; |
| 1794 | 1794 | |
| 1795 | 1795 | |
| 1796 | drawgfx_transpen(bitmap, state->m_flipscreen_x ? | |
| 1796 | drawgfx_transpen(bitmap, state->m_flipscreen_x ? | |
| 1797 | 1797 | code,color, |
| 1798 | 1798 | flipx,flipy, |
| 1799 | 1799 | sx,sy,0); |
| r13798 | r13799 | |
| 1813 | 1813 | } |
| 1814 | 1814 | |
| 1815 | 1815 | |
| 1816 | tilemap_draw(bitmap, | |
| 1816 | tilemap_draw(bitmap, cliprect, state->m_bg_tilemap, 0, 0); | |
| 1817 | 1817 | |
| 1818 | 1818 | if (state->m_draw_bullets) |
| 1819 | 1819 | { |
| r13798 | r13799 | |
| 1845 | 1845 | } |
| 1846 | 1846 | |
| 1847 | 1847 | /* 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, | |
| 1848 | copybitmap(state->m_dambustr_tmpbitmap, bitmap, 0, 0, 0, 0, state->m_dambustr_tmpbitmap->cliprect()); | |
| 1849 | 1849 | |
| 1850 | tilemap_draw(bitmap, | |
| 1850 | tilemap_draw(bitmap, cliprect, state->m_bg_tilemap, 0, 0); | |
| 1851 | 1851 | |
| 1852 | 1852 | if (state->m_draw_bullets) |
| 1853 | 1853 | { |
| r13798 | r13799 | |
| 1871 | 1871 | }; |
| 1872 | 1872 | }; |
| 1873 | 1873 | tilemap_mark_all_tiles_dirty(state->m_dambustr_tilemap2); |
| 1874 | tilemap_draw(bitmap, | |
| 1874 | tilemap_draw(bitmap, cliprect, state->m_dambustr_tilemap2, 0, 0); | |
| 1875 | 1875 | }; |
| 1876 | 1876 | |
| 1877 | 1877 | return 0; |
| r13798 | r13799 | |
|---|---|---|
| 433 | 433 | { |
| 434 | 434 | centiped_state *state = screen.machine().driver_data<centiped_state>(); |
| 435 | 435 | UINT8 *spriteram = state->m_spriteram; |
| 436 | rectangle spriteclip = | |
| 436 | rectangle spriteclip = | |
| 437 | 437 | int offs; |
| 438 | 438 | |
| 439 | 439 | /* draw the background */ |
| r13798 | r13799 | |
| 455 | 455 | int x = spriteram[offs + 0x20]; |
| 456 | 456 | int y = 240 - spriteram[offs + 0x10]; |
| 457 | 457 | |
| 458 | drawgfx_transmask(bitmap, | |
| 458 | drawgfx_transmask(bitmap, | |
| 459 | 459 | } |
| 460 | 460 | return 0; |
| 461 | 461 | } |
| r13798 | r13799 | |
| 511 | 511 | { |
| 512 | 512 | centiped_state *state = screen.machine().driver_data<centiped_state>(); |
| 513 | 513 | UINT8 *spriteram = state->m_spriteram; |
| 514 | rectangle spriteclip = | |
| 514 | rectangle spriteclip = | |
| 515 | 515 | |
| 516 | 516 | int offs; |
| 517 | 517 | |
| r13798 | r13799 | |
| 533 | 533 | int x = spriteram[offs + 0x20]; |
| 534 | 534 | int y = 240 - spriteram[offs + 0x10]; |
| 535 | 535 | |
| 536 | drawgfx_transpen(bitmap, | |
| 536 | drawgfx_transpen(bitmap, | |
| 537 | 537 | } |
| 538 | 538 | return 0; |
| 539 | 539 | } |
| r13798 | r13799 | |
| 546 | 546 | { |
| 547 | 547 | centiped_state *state = screen.machine().driver_data<centiped_state>(); |
| 548 | 548 | UINT8 *spriteram = state->m_spriteram; |
| 549 | rectangle spriteclip = | |
| 549 | rectangle spriteclip = | |
| 550 | 550 | int offs; |
| 551 | 551 | |
| 552 | 552 | /* draw the background */ |
| r13798 | r13799 | |
| 571 | 571 | flipy = !flipy; |
| 572 | 572 | } |
| 573 | 573 | |
| 574 | drawgfx_transmask(bitmap, | |
| 574 | drawgfx_transmask(bitmap, | |
| 575 | 575 | } |
| 576 | 576 | return 0; |
| 577 | 577 | } |
| r13798 | r13799 | |
|---|---|---|
| 346 | 346 | 2, 2, 3, 3, |
| 347 | 347 | 2, 2, 3, 3 }; |
| 348 | 348 | |
| 349 | static void draw_sprites( running_machine &machine, bitmap_t *bitmap, const rectangle | |
| 349 | static void draw_sprites( running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect, int y_offs ) | |
| 350 | 350 | { |
| 351 | 351 | wgp_state *state = machine.driver_data<wgp_state>(); |
| 352 | 352 | UINT16 *spriteram = state->m_spriteram; |
| r13798 | r13799 | |
| 518 | 518 | |
| 519 | 519 | |
| 520 | 520 | |
| 521 | static void wgp_piv_layer_draw( running_machine &machine, bitmap_t *bitmap, const rectangle | |
| 521 | static void wgp_piv_layer_draw( running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect, int layer, int flags, UINT32 priority ) | |
| 522 | 522 | { |
| 523 | 523 | wgp_state *state = machine.driver_data<wgp_state>(); |
| 524 | 524 | bitmap_t *srcbitmap = tilemap_get_pixmap(state->m_piv_tilemap[layer]); |
| r13798 | r13799 | |
| 538 | 538 | int flipscreen = 0; /* n/a */ |
| 539 | 539 | int machine_flip = 0; /* for ROT 180 ? */ |
| 540 | 540 | |
| 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; | |
| 544 | 544 | |
| 545 | 545 | int width_mask = 0x3ff; |
| 546 | 546 | |
| r13798 | r13799 | |
| 683 | 683 | |
| 684 | 684 | tc0100scn_tilemap_update(state->m_tc0100scn); |
| 685 | 685 | |
| 686 | bitmap->fill(0, | |
| 686 | bitmap->fill(0, | |
| 687 | 687 | |
| 688 | 688 | layer[0] = 0; |
| 689 | 689 | layer[1] = 1; |
| r13798 | r13799 | |
|---|---|---|
| 29 | 29 | |
| 30 | 30 | |
| 31 | 31 | /* Sprite Drawing is pretty much the same as fromance.c */ |
| 32 | static void draw_sprites(running_machine &machine, bitmap_t *bitmap,const rectangle | |
| 32 | static void draw_sprites(running_machine &machine, bitmap_t *bitmap,const rectangle &cliprect) | |
| 33 | 33 | { |
| 34 | 34 | static const UINT8 zoomtable[16] = { 0,7,14,20,25,30,34,38,42,46,49,52,54,57,59,61 }; |
| 35 | 35 | welltris_state *state = machine.driver_data<welltris_state>(); |
| r13798 | r13799 | |
| 224 | 224 | tilemap_set_transparent_pen(state->m_char_tilemap, 15); |
| 225 | 225 | } |
| 226 | 226 | |
| 227 | static void draw_background(running_machine &machine, bitmap_t *bitmap, const rectangle | |
| 227 | static void draw_background(running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect) | |
| 228 | 228 | { |
| 229 | 229 | welltris_state *state = machine.driver_data<welltris_state>(); |
| 230 | 230 | int x, y; |
| r13798 | r13799 | |
|---|---|---|
| 128 | 128 | } |
| 129 | 129 | |
| 130 | 130 | |
| 131 | static void draw_sprites(running_machine &machine, bitmap_t* bitmap, const rectangle | |
| 131 | static void draw_sprites(running_machine &machine, bitmap_t* bitmap, const rectangle &cliprect) | |
| 132 | 132 | { |
| 133 | 133 | sprint8_state *state = machine.driver_data<sprint8_state>(); |
| 134 | 134 | int i; |
| r13798 | r13799 | |
| 175 | 175 | int y; |
| 176 | 176 | const rectangle &visarea = screen.machine().primary_screen->visible_area(); |
| 177 | 177 | |
| 178 | tilemap_draw(state->m_helper2, | |
| 178 | tilemap_draw(state->m_helper2, | |
| 179 | 179 | |
| 180 | 180 | state->m_helper1->fill(0x20, visarea); |
| 181 | 181 | |
| 182 | draw_sprites(screen.machine(), state->m_helper1, | |
| 182 | draw_sprites(screen.machine(), state->m_helper1, | |
| 183 | 183 | |
| 184 | 184 | for (y = visarea.min_y; y <= visarea.max_y; y++) |
| 185 | 185 | { |
| r13798 | r13799 | |
|---|---|---|
| 141 | 141 | #endif |
| 142 | 142 | |
| 143 | 143 | |
| 144 | static void ssv_drawgfx( bitmap_t *bitmap, const rectangle | |
| 144 | static void ssv_drawgfx( bitmap_t *bitmap, const rectangle &cliprect, const gfx_element *gfx, | |
| 145 | 145 | UINT32 code,UINT32 color,int flipx,int flipy,int x0,int y0, |
| 146 | 146 | int shadow ) |
| 147 | 147 | { |
| r13798 | r13799 | |
| 164 | 164 | #define SSV_DRAWGFX(SETPIXELCOLOR) \ |
| 165 | 165 | for ( sy = y0; sy != y1; sy += dy ) \ |
| 166 | 166 | { \ |
| 167 | if ( sy >= cliprect | |
| 167 | if ( sy >= cliprect. | |
| 168 | 168 | { \ |
| 169 | 169 | source = addr; \ |
| 170 | 170 | dest = &bitmap->pix16(sy); \ |
| r13798 | r13799 | |
| 173 | 173 | { \ |
| 174 | 174 | pen = *source++; \ |
| 175 | 175 | \ |
| 176 | if ( pen && sx >= cliprect | |
| 176 | if ( pen && sx >= cliprect. | |
| 177 | 177 | SETPIXELCOLOR \ |
| 178 | 178 | } \ |
| 179 | 179 | } \ |
| r13798 | r13799 | |
| 606 | 606 | |
| 607 | 607 | /* Draw a tilemap sprite */ |
| 608 | 608 | |
| 609 | static void draw_row(running_machine &machine, bitmap_t *bitmap, const rectangle | |
| 609 | static void draw_row(running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect, int sx, int sy, int scroll) | |
| 610 | 610 | { |
| 611 | 611 | ssv_state *state = machine.driver_data<ssv_state>(); |
| 612 | 612 | UINT16 *spriteram16 = state->m_spriteram; |
| r13798 | r13799 | |
| 635 | 635 | |
| 636 | 636 | /* .. and clip it against the visible screen */ |
| 637 | 637 | |
| 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; | |
| 640 | 640 | |
| 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; | |
| 643 | 643 | |
| 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; | |
| 646 | 646 | |
| 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; | |
| 649 | 649 | |
| 650 | 650 | /* Get the scroll data */ |
| 651 | 651 | x = ssv_scroll[ scroll * 4 + 0 ]; // x scroll |
| r13798 | r13799 | |
| 725 | 725 | { |
| 726 | 726 | for (ty = ystart; ty != yend; ty += yinc) |
| 727 | 727 | { |
| 728 | ssv_drawgfx( bitmap, | |
| 728 | ssv_drawgfx( bitmap, | |
| 729 | 729 | code++, |
| 730 | 730 | color, |
| 731 | 731 | flipx, flipy, |
| r13798 | r13799 | |
| 741 | 741 | |
| 742 | 742 | /* Draw the "background layer" using multiple tilemap sprites */ |
| 743 | 743 | |
| 744 | static void draw_layer(running_machine &machine, bitmap_t *bitmap, const rectangle | |
| 744 | static void draw_layer(running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect, int nr) | |
| 745 | 745 | { |
| 746 | 746 | int sy; |
| 747 | 747 | for ( sy = 0; sy <= machine.primary_screen->visible_area().max_y; sy += 0x40 ) |
| r13798 | r13799 | |
| 750 | 750 | |
| 751 | 751 | /* Draw sprites in the sprites list */ |
| 752 | 752 | |
| 753 | static void draw_sprites(running_machine &machine, bitmap_t *bitmap, const rectangle | |
| 753 | static void draw_sprites(running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect) | |
| 754 | 754 | { |
| 755 | 755 | /* Sprites list */ |
| 756 | 756 | ssv_state *state = machine.driver_data<ssv_state>(); |
| r13798 | r13799 | |
| 1042 | 1042 | E.h Unused |
| 1043 | 1043 | |
| 1044 | 1044 | */ |
| 1045 | static void gdfs_draw_zooming_sprites(running_machine &machine, bitmap_t *bitmap, const rectangle | |
| 1045 | static void gdfs_draw_zooming_sprites(running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect, int priority) | |
| 1046 | 1046 | { |
| 1047 | 1047 | /* Sprites list */ |
| 1048 | 1048 | |
| r13798 | r13799 | |
| 1209 | 1209 | state->m_shadow_pen_mask = (1 << state->m_shadow_pen_shift) - 1; |
| 1210 | 1210 | |
| 1211 | 1211 | /* The background color is the first one in the palette */ |
| 1212 | bitmap->fill(0, | |
| 1212 | bitmap->fill(0, | |
| 1213 | 1213 | |
| 1214 | 1214 | // 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] ; | |
| 1219 | 1219 | |
| 1220 | 1220 | // printf("%04x %04x %04x %04x\n",clip.min_x, clip.max_x, clip.min_y, clip.max_y); |
| 1221 | 1221 | |
| 1222 | 1222 | if (clip.min_x < 0) clip.min_x = 0; |
| 1223 | 1223 | 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; | |
| 1226 | 1226 | |
| 1227 | 1227 | if (clip.min_x > clip.max_x) |
| 1228 | 1228 | clip.min_x = clip.max_x; |
| r13798 | r13799 | |
| 1232 | 1232 | if (!state->m_enable_video) |
| 1233 | 1233 | return 0; |
| 1234 | 1234 | |
| 1235 | draw_layer(screen.machine(), bitmap, | |
| 1235 | draw_layer(screen.machine(), bitmap, | |
| 1236 | 1236 | |
| 1237 | draw_sprites(screen.machine(), bitmap, | |
| 1237 | draw_sprites(screen.machine(), bitmap, | |
| 1238 | 1238 | |
| 1239 | 1239 | |
| 1240 | 1240 | return 0; |
| r13798 | r13799 | |
|---|---|---|
| 157 | 157 | |
| 158 | 158 | /* This game doesn't have the extra playfield chip on the game board, but |
| 159 | 159 | the palette does show through. */ |
| 160 | bitmap->fill(screen.machine().pens[768], | |
| 160 | bitmap->fill(screen.machine().pens[768], | |
| 161 | 161 | screen.machine().device<deco_bac06_device>("tilegen2")->deco_bac06_pf_draw(screen.machine(),bitmap,cliprect,0, 0x00, 0x00, 0x00, 0x00); |
| 162 | 162 | screen.machine().device<deco_mxc06_device>("spritegen")->draw_sprites(screen.machine(), bitmap, cliprect, state->m_buffered_spriteram, 0x00, 0x00, 0x0f); |
| 163 | 163 | screen.machine().device<deco_bac06_device>("tilegen1")->deco_bac06_pf_draw(screen.machine(),bitmap,cliprect,0, 0x00, 0x00, 0x00, 0x00); |
| r13798 | r13799 | |
|---|---|---|
| 69 | 69 | Screen refresh |
| 70 | 70 | ***************************************************************************/ |
| 71 | 71 | |
| 72 | static void draw_sprites( running_machine &machine, bitmap_t *bitmap, const rectangle | |
| 72 | static void draw_sprites( running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect, int priority ) | |
| 73 | 73 | { |
| 74 | 74 | /* Y chain size is 16/32?/64/64? pixels. X chain size |
| 75 | 75 | is always 64 pixels. */ |
| r13798 | r13799 | |
| 182 | 182 | } |
| 183 | 183 | } |
| 184 | 184 | |
| 185 | static void fill_slope( bitmap_t *bitmap, const rectangle | |
| 185 | static 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 ) | |
| 186 | 186 | { |
| 187 | if (y1 > cliprect | |
| 187 | if (y1 > cliprect. | |
| 188 | 188 | return; |
| 189 | 189 | |
| 190 | if (y2 <= cliprect | |
| 190 | if (y2 <= cliprect. | |
| 191 | 191 | { |
| 192 | 192 | int delta = y2 - y1; |
| 193 | 193 | *nx1 = x1 + delta * sl1; |
| r13798 | r13799 | |
| 198 | 198 | if (y1 < -1000000 || y1 > 1000000) |
| 199 | 199 | return; |
| 200 | 200 | |
| 201 | if (y2 > cliprect->max_y) | |
| 202 | y2 = cliprect->max_y + 1; | |
| 201 | if (y2 > cliprect.max_y) | |
| 202 | y2 = cliprect.max_y + 1; | |
| 203 | 203 | |
| 204 | if (y1 < cliprect | |
| 204 | if (y1 < cliprect. | |
| 205 | 205 | { |
| 206 | int delta = cliprect | |
| 206 | int delta = cliprect. | |
| 207 | 207 | x1 += delta * sl1; |
| 208 | 208 | x2 += delta * sl2; |
| 209 | y1 = cliprect | |
| 209 | y1 = cliprect. | |
| 210 | 210 | } |
| 211 | 211 | |
| 212 | 212 | if (x1 > x2 || (x1==x2 && sl1 > sl2)) |
| r13798 | r13799 | |
| 225 | 225 | |
| 226 | 226 | while (y1 < y2) |
| 227 | 227 | { |
| 228 | if (y1 >= cliprect | |
| 228 | if (y1 >= cliprect. | |
| 229 | 229 | { |
| 230 | 230 | int xx1 = x1 >> TAITOAIR_FRAC_SHIFT; |
| 231 | 231 | int xx2 = x2 >> TAITOAIR_FRAC_SHIFT; |
| 232 | 232 | int grad_col; |
| 233 | 233 | |
| 234 | if (xx1 <= cliprect | |
| 234 | if (xx1 <= cliprect. | |
| 235 | 235 | { |
| 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; | |
| 240 | 240 | |
| 241 | 241 | /* TODO: it's unknown if gradient color applies by global screen Y coordinate or there's a calculation to somewhere ... */ |
| 242 | 242 | grad_col = (y1 >> 3) & 0x3f; |
| r13798 | r13799 | |
| 257 | 257 | *nx2 = x2; |
| 258 | 258 | } |
| 259 | 259 | |
| 260 | static void fill_poly( bitmap_t *bitmap, const rectangle | |
| 260 | static void fill_poly( bitmap_t *bitmap, const rectangle &cliprect, const struct taitoair_poly *q ) | |
| 261 | 261 | { |
| 262 | 262 | INT32 sl1, sl2, cury, limy, x1, x2; |
| 263 | 263 | int pmin, pmax, i, ps1, ps2; |
| r13798 | r13799 | |
| 286 | 286 | if (cury == limy) |
| 287 | 287 | return; |
| 288 | 288 | |
| 289 | if (cury > cliprect | |
| 289 | if (cury > cliprect. | |
| 290 | 290 | return; |
| 291 | if (limy <= cliprect | |
| 291 | if (limy <= cliprect. | |
| 292 | 292 | return; |
| 293 | 293 | |
| 294 | if (limy > cliprect->max_y) | |
| 295 | limy = cliprect->max_y; | |
| 294 | if (limy > cliprect.max_y) | |
| 295 | limy = cliprect.max_y; | |
| 296 | 296 | |
| 297 | 297 | ps1 = pmin + pcount; |
| 298 | 298 | ps2 = pmin; |
| r13798 | r13799 | |
| 374 | 374 | /* clear screen fb */ |
| 375 | 375 | state->m_framebuffer[1]->fill(0, cliprect); |
| 376 | 376 | /* 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, | |
| 377 | copybitmap_trans(state->m_framebuffer[1], state->m_framebuffer[0], 0, 0, 0, 0, | |
| 378 | 378 | /* now clear buffer fb */ |
| 379 | 379 | state->m_framebuffer[0]->fill(0, cliprect); |
| 380 | 380 | } |
| r13798 | r13799 | |
| 407 | 407 | } |
| 408 | 408 | adr--; |
| 409 | 409 | state->m_q.pcount = pcount; |
| 410 | fill_poly(state->m_framebuffer[0], | |
| 410 | fill_poly(state->m_framebuffer[0], | |
| 411 | 411 | } |
| 412 | 412 | } |
| 413 | 413 | } |
| r13798 | r13799 | |
| 577 | 577 | |
| 578 | 578 | tc0080vco_tilemap_update(state->m_tc0080vco); |
| 579 | 579 | |
| 580 | bitmap->fill(0, | |
| 580 | bitmap->fill(0, | |
| 581 | 581 | |
| 582 | 582 | { |
| 583 | 583 | int x,y; |
| r13798 | r13799 | |
| 589 | 589 | [0x98000c-f] dword for rotation param 1 |
| 590 | 590 | */ |
| 591 | 591 | |
| 592 | for(y=cliprect | |
| 592 | for(y=cliprect. | |
| 593 | 593 | { |
| 594 | for(x=cliprect | |
| 594 | for(x=cliprect. | |
| 595 | 595 | { |
| 596 | 596 | bitmap->pix16(y, x) = 0x2000 + (0x3f - ((y >> 2) & 0x3f)); |
| 597 | 597 | } |
| 598 | 598 | } |
| 599 | 599 | |
| 600 | 600 | #if 0 |
| 601 | for(y=cliprect | |
| 601 | for(y=cliprect. | |
| 602 | 602 | { |
| 603 | for(x=cliprect | |
| 603 | for(x=cliprect. | |
| 604 | 604 | { |
| 605 | 605 | bitmap->pix16(y, x) = 0x2040 + (0x3f - ((y >> 2) & 0x3f)); |
| 606 | 606 | } |
| r13798 | r13799 | |
| 622 | 622 | |
| 623 | 623 | /* Hacky 3d bitmap */ |
| 624 | 624 | //copybitmap_trans(bitmap, state->m_buffer3d, 0, 0, 0, 0, cliprect, 0); |
| 625 | //state->m_buffer3d->fill(0, | |
| 625 | //state->m_buffer3d->fill(0, | |
| 626 | 626 | |
| 627 | 627 | return 0; |
| 628 | 628 | } |
| r13798 | r13799 | |
|---|---|---|
| 198 | 198 | |
| 199 | 199 | |
| 200 | 200 | |
| 201 | void seta001_device::seta001_draw_background( running_machine &machine, bitmap_t *bitmap, const rectangle | |
| 201 | void seta001_device::seta001_draw_background( running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect, int bank_size, int setac_type) | |
| 202 | 202 | { |
| 203 | 203 | int transpen; |
| 204 | 204 | |
| r13798 | r13799 | |
| 319 | 319 | } |
| 320 | 320 | |
| 321 | 321 | |
| 322 | void seta001_device::seta001_draw_foreground( running_machine &machine, bitmap_t *bitmap, const rectangle | |
| 322 | void seta001_device::seta001_draw_foreground( running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect, int bank_size) | |
| 323 | 323 | { |
| 324 | 324 | int screenflip = (m_spritectrl[0] & 0x40) >> 6; |
| 325 | 325 | int i; |
| r13798 | r13799 | |
| 457 | 457 | |
| 458 | 458 | } |
| 459 | 459 | |
| 460 | void seta001_device::seta001_draw_sprites(running_machine &machine, bitmap_t *bitmap, const rectangle | |
| 460 | void seta001_device::seta001_draw_sprites(running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect, int bank_size, int setac) | |
| 461 | 461 | { |
| 462 | 462 | seta001_draw_background(machine, bitmap, cliprect, bank_size, setac); |
| 463 | 463 | seta001_draw_foreground(machine, bitmap, cliprect, bank_size); |
| r13798 | r13799 | |
|---|---|---|
| 186 | 186 | bitmap_t *priority_bitmap = screen.machine().priority_bitmap; |
| 187 | 187 | |
| 188 | 188 | /* draw the playfield */ |
| 189 | priority_bitmap->fill(0, | |
| 189 | priority_bitmap->fill(0, | |
| 190 | 190 | tilemap_draw(bitmap, cliprect, state->m_playfield_tilemap, 0, 0); |
| 191 | 191 | tilemap_draw(bitmap, cliprect, state->m_playfield_tilemap, 1, 1); |
| 192 | 192 | tilemap_draw(bitmap, cliprect, state->m_playfield_tilemap, 2, 2); |
| r13798 | r13799 | |
| 199 | 199 | /* copy the motion objects on top */ |
| 200 | 200 | { |
| 201 | 201 | 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; | |
| 206 | 206 | int x, y; |
| 207 | 207 | |
| 208 | 208 | /* now blend with the playfield */ |
| r13798 | r13799 | |
|---|---|---|
| 440 | 440 | z: zoom y |
| 441 | 441 | */ |
| 442 | 442 | |
| 443 | static void draw_sprites(running_machine &machine, bitmap_t *bitmap, const rectangle | |
| 443 | static void draw_sprites(running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect, int sprite_priority) | |
| 444 | 444 | { |
| 445 | 445 | tceptor_state *state = machine.driver_data<tceptor_state>(); |
| 446 | 446 | UINT16 *mem1 = &state->m_sprite_ram_buffered[0x000/2]; |
| r13798 | r13799 | |
| 511 | 511 | { |
| 512 | 512 | int x, y; |
| 513 | 513 | |
| 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++) | |
| 516 | 516 | if (colortable_entry_get_value(machine.colortable, bitmap->pix16(y, x)) == SPR_MASK_COLOR) |
| 517 | 517 | // restore pixel |
| 518 | 518 | bitmap->pix16(y, x) = state->m_temp_bitmap->pix16(y, x); |
| r13798 | r13799 | |
| 528 | 528 | int bg_center = 144 - ((((state->m_bg1_scroll_x + state->m_bg2_scroll_x ) & 0x1ff) - 288) / 2); |
| 529 | 529 | |
| 530 | 530 | // left background |
| 531 | rect = | |
| 531 | rect = | |
| 532 | 532 | rect.max_x = bg_center; |
| 533 | 533 | tilemap_set_scrollx(state->m_bg1_tilemap, 0, state->m_bg1_scroll_x + 12); |
| 534 | 534 | tilemap_set_scrolly(state->m_bg1_tilemap, 0, state->m_bg1_scroll_y + 20); //32? |
| 535 | tilemap_draw(bitmap, | |
| 535 | tilemap_draw(bitmap, | |
| 536 | 536 | |
| 537 | 537 | // right background |
| 538 | 538 | rect.min_x = bg_center; |
| 539 | rect.max_x = cliprect | |
| 539 | rect.max_x = cliprect. | |
| 540 | 540 | tilemap_set_scrollx(state->m_bg2_tilemap, 0, state->m_bg2_scroll_x + 20); |
| 541 | 541 | tilemap_set_scrolly(state->m_bg2_tilemap, 0, state->m_bg2_scroll_y + 20); // 32? |
| 542 | tilemap_draw(bitmap, | |
| 542 | tilemap_draw(bitmap, | |
| 543 | 543 | |
| 544 | 544 | for (pri = 0; pri < 8; pri++) |
| 545 | 545 | { |
| r13798 | r13799 | |
|---|---|---|
| 7 | 7 | seta001_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); |
| 8 | 8 | |
| 9 | 9 | |
| 10 | void seta001_draw_sprites(running_machine &machine, bitmap_t *bitmap, const rectangle | |
| 10 | void seta001_draw_sprites(running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect, int bank_size, int setac); | |
| 11 | 11 | |
| 12 | 12 | void setac_eof( void ); |
| 13 | 13 | void tnzs_eof( void ); |
| r13798 | r13799 | |
| 52 | 52 | |
| 53 | 53 | private: |
| 54 | 54 | |
| 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); | |
| 57 | 57 | |
| 58 | 58 | }; |
| 59 | 59 |
| r13798 | r13799 | |
|---|---|---|
| 166 | 166 | |
| 167 | 167 | ***************************************************************************/ |
| 168 | 168 | |
| 169 | static void draw_sprites( running_machine &machine, bitmap_t *bitmap, const rectangle | |
| 169 | static void draw_sprites( running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect ) | |
| 170 | 170 | { |
| 171 | 171 | cop01_state *state = machine.driver_data<cop01_state>(); |
| 172 | 172 | int offs, code, attr, sx, sy, flipx, flipy, color; |
| r13798 | r13799 | |
|---|---|---|
| 4 | 4 | #include "includes/aquarium.h" |
| 5 | 5 | |
| 6 | 6 | /* gcpinbal.c modified */ |
| 7 | static void draw_sprites( running_machine &machine, bitmap_t *bitmap, const rectangle | |
| 7 | static void draw_sprites( running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect, int y_offs ) | |
| 8 | 8 | { |
| 9 | 9 | aquarium_state *state = machine.driver_data<aquarium_state>(); |
| 10 | 10 | int offs, chain_pos; |
| r13798 | r13799 | |
|---|---|---|
| 439 | 439 | |
| 440 | 440 | /* Draw sprites */ |
| 441 | 441 | |
| 442 | void metro_draw_sprites( running_machine &machine, bitmap_t *bitmap, const rectangle | |
| 442 | void metro_draw_sprites( running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect ) | |
| 443 | 443 | { |
| 444 | 444 | metro_state *state = machine.driver_data<metro_state>(); |
| 445 | 445 | UINT8 *base_gfx = machine.region("gfx1")->base(); |
| r13798 | r13799 | |
| 590 | 590 | /* copy a 'window' from the large 2048x2048 (or 4096x4096 for 16x16 tiles) tilemap */ |
| 591 | 591 | |
| 592 | 592 | |
| 593 | static void draw_tilemap( running_machine &machine, bitmap_t *bitmap, const rectangle | |
| 593 | static void draw_tilemap( running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect, UINT32 flags, UINT32 pcode, | |
| 594 | 594 | int sx, int sy, int wx, int wy, int big, UINT16* tilemapram, int layer ) |
| 595 | 595 | { |
| 596 | 596 | metro_state *state = machine.driver_data<metro_state>(); |
| r13798 | r13799 | |
| 687 | 687 | } |
| 688 | 688 | |
| 689 | 689 | /* Draw all the layers that match the given priority */ |
| 690 | static void draw_layers( running_machine &machine, bitmap_t *bitmap, const rectangle | |
| 690 | static void draw_layers( running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect, int pri, int layers_ctrl ) | |
| 691 | 691 | { |
| 692 | 692 | metro_state *state = machine.driver_data<metro_state>(); |
| 693 | 693 | UINT16 layers_pri = state->m_videoregs[0x10 / 2]; |
| r13798 | r13799 | |
| 732 | 732 | state->m_sprite_yoffs = state->m_videoregs[0x04 / 2] - (visarea.max_y + 1) / 2; |
| 733 | 733 | |
| 734 | 734 | /* 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); | |
| 737 | 737 | |
| 738 | 738 | /* Screen Control Register: |
| 739 | 739 | |
| r13798 | r13799 | |
| 779 | 779 | if (screen.machine().input().code_pressed(KEYCODE_A)) msk |= 8; |
| 780 | 780 | if (msk != 0) |
| 781 | 781 | { |
| 782 | bitmap->fill(0, | |
| 782 | bitmap->fill(0, | |
| 783 | 783 | layers_ctrl &= msk; |
| 784 | 784 | } |
| 785 | 785 |
| r13798 | r13799 | |
|---|---|---|
| 140 | 140 | |
| 141 | 141 | */ |
| 142 | 142 | |
| 143 | static void draw_sprites(running_machine &machine, bitmap_t *bitmap, const rectangle | |
| 143 | static void draw_sprites(running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect, int enable_n) | |
| 144 | 144 | { |
| 145 | 145 | angelkds_state *state = machine.driver_data<angelkds_state>(); |
| 146 | 146 | const UINT8 *source = state->m_spriteram + 0x100 - 4; |
| r13798 | r13799 | |
| 278 | 278 | const rectangle &visarea = screen.visible_area(); |
| 279 | 279 | rectangle clip; |
| 280 | 280 | |
| 281 | bitmap->fill(0x3f, | |
| 281 | bitmap->fill(0x3f, | |
| 282 | 282 | |
| 283 | 283 | /* draw top of screen */ |
| 284 | 284 | clip.min_x = 8*0; |
| r13798 | r13799 | |
| 287 | 287 | clip.max_y = visarea.max_y; |
| 288 | 288 | |
| 289 | 289 | if ((state->m_layer_ctrl & 0x80) == 0x00) |
| 290 | tilemap_draw(bitmap, | |
| 290 | tilemap_draw(bitmap, | |
| 291 | 291 | |
| 292 | draw_sprites(screen.machine(), bitmap, | |
| 292 | draw_sprites(screen.machine(), bitmap, | |
| 293 | 293 | |
| 294 | 294 | if ((state->m_layer_ctrl & 0x20) == 0x00) |
| 295 | tilemap_draw(bitmap, | |
| 295 | tilemap_draw(bitmap, | |
| 296 | 296 | |
| 297 | 297 | /* draw bottom of screen */ |
| 298 | 298 | clip.min_x = 8*16; |
| r13798 | r13799 | |
| 301 | 301 | clip.max_y = visarea.max_y; |
| 302 | 302 | |
| 303 | 303 | if ((state->m_layer_ctrl & 0x40) == 0x00) |
| 304 | tilemap_draw(bitmap, | |
| 304 | tilemap_draw(bitmap, | |
| 305 | 305 | |
| 306 | draw_sprites(screen.machine(), bitmap, | |
| 306 | draw_sprites(screen.machine(), bitmap, | |
| 307 | 307 | |
| 308 | 308 | if ((state->m_layer_ctrl & 0x20) == 0x00) |
| 309 | tilemap_draw(bitmap, | |
| 309 | tilemap_draw(bitmap, | |
| 310 | 310 | |
| 311 | 311 | return 0; |
| 312 | 312 | } |
| r13798 | r13799 | |
|---|---|---|
| 161 | 161 | |
| 162 | 162 | ***************************************************************************/ |
| 163 | 163 | |
| 164 | static void draw_sprites( running_machine &machine, bitmap_t *bitmap, const rectangle | |
| 164 | static void draw_sprites( running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect ) | |
| 165 | 165 | { |
| 166 | 166 | circusc_state *state = machine.driver_data<circusc_state>(); |
| 167 | 167 | int offs; |
| r13798 | r13799 | |
| 208 | 208 | for (i = 10; i < 32; i++) |
| 209 | 209 | tilemap_set_scrolly(state->m_bg_tilemap, i, *state->m_scroll); |
| 210 | 210 | |
| 211 | bitmap->fill(0, | |
| 211 | bitmap->fill(0, | |
| 212 | 212 | tilemap_draw(bitmap, cliprect, state->m_bg_tilemap, 1, 0); |
| 213 | 213 | draw_sprites(screen.machine(), bitmap, cliprect); |
| 214 | 214 | tilemap_draw(bitmap, cliprect, state->m_bg_tilemap, 0, 0); |
| r13798 | r13799 | |
|---|---|---|
| 145 | 145 | state->m_bg_tilemap = tilemap_create(machine, get_bg_tile_info, tilemap_scan_rows, 8, 8, 32, 32); |
| 146 | 146 | } |
| 147 | 147 | |
| 148 | static void draw_sprites(running_machine &machine, bitmap_t *bitmap, const rectangle | |
| 148 | static void draw_sprites(running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect) | |
| 149 | 149 | { |
| 150 | 150 | mikie_state *state = machine.driver_data<mikie_state>(); |
| 151 | 151 | UINT8 *spriteram = state->m_spriteram; |
| r13798 | r13799 | |
|---|---|---|
| 546 | 546 | #endif |
| 547 | 547 | |
| 548 | 548 | /* 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; | |
| 551 | 551 | |
| 552 | 552 | /* adjust the offset */ |
| 553 | 553 | offset += xoffs; |
| 554 | offset += 512 * (cliprect | |
| 554 | offset += 512 * (cliprect. | |
| 555 | 555 | |
| 556 | 556 | /* loop over rows */ |
| 557 | for (y = cliprect | |
| 557 | for (y = cliprect. | |
| 558 | 558 | { |
| 559 | UINT16 *dest = &bitmap->pix16(y, cliprect | |
| 559 | UINT16 *dest = &bitmap->pix16(y, cliprect. | |
| 560 | 560 | for (x = 0; x < width; x++) |
| 561 | 561 | *dest++ = state->m_videoram[offset + x] & 0x7fff; |
| 562 | 562 | offset += 512; |
| r13798 | r13799 | |
|---|---|---|
| 46 | 46 | layer[0] = 0; |
| 47 | 47 | layer[1] = 1; |
| 48 | 48 | |
| 49 | screen.machine().priority_bitmap->fill(0, | |
| 49 | screen.machine().priority_bitmap->fill(0, | |
| 50 | 50 | |
| 51 | 51 | pc080sn_tilemap_draw(state->m_pc080sn, bitmap, cliprect, layer[0], TILEMAP_DRAW_OPAQUE, 1); |
| 52 | 52 | pc080sn_tilemap_draw(state->m_pc080sn, bitmap, cliprect, layer[1], 0, 2); |
| r13798 | r13799 | |
|---|---|---|
| 68 | 68 | |
| 69 | 69 | konami_sortlayers3(layer, state->m_layerpri); |
| 70 | 70 | |
| 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); | |
| 73 | 73 | k052109_tilemap_draw(state->m_k052109, bitmap, cliprect, layer[0], 0, 1); |
| 74 | 74 | k052109_tilemap_draw(state->m_k052109, bitmap, cliprect, layer[1], 0, 2); |
| 75 | 75 | k052109_tilemap_draw(state->m_k052109, bitmap, cliprect, layer[2], 0, 4); |
| r13798 | r13799 | |
|---|---|---|
| 206 | 206 | offsets 1 and 2 are swapped if accessed from spriteram2 |
| 207 | 207 | |
| 208 | 208 | */ |
| 209 | static void draw_sprites(running_machine &machine, bitmap_t *bitmap,const rectangle | |
| 209 | static void draw_sprites(running_machine &machine, bitmap_t *bitmap,const rectangle &cliprect,UINT8 *spriteram,int color,int section) | |
| 210 | 210 | { |
| 211 | 211 | int offs,o1 = 1,o2 = 2; |
| 212 | 212 |
| r13798 | r13799 | |
|---|---|---|
| 122 | 122 | |
| 123 | 123 | ***************************************************************************/ |
| 124 | 124 | |
| 125 | static void draw_sprites(running_machine &machine, bitmap_t *bitmap, const rectangle | |
| 125 | static void draw_sprites(running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect, UINT16 *sprites, int gfx) | |
| 126 | 126 | { |
| 127 | 127 | suna16_state *state = machine.driver_data<suna16_state>(); |
| 128 | 128 | int offs; |
| r13798 | r13799 | |
| 226 | 226 | suna16_state *state = screen.machine().driver_data<suna16_state>(); |
| 227 | 227 | |
| 228 | 228 | /* Suna Quiz indicates the background is the last pen */ |
| 229 | bitmap->fill(0xff, | |
| 229 | bitmap->fill(0xff, | |
| 230 | 230 | draw_sprites(screen.machine(), bitmap, cliprect, state->m_spriteram, 0); |
| 231 | 231 | return 0; |
| 232 | 232 | } |
| r13798 | r13799 | |
| 246 | 246 | #endif |
| 247 | 247 | |
| 248 | 248 | /* Suna Quiz indicates the background is the last pen */ |
| 249 | bitmap->fill(0xff, | |
| 249 | bitmap->fill(0xff, | |
| 250 | 250 | if (layers_ctrl & 1) draw_sprites(screen.machine(), bitmap, cliprect, state->m_spriteram, 0); |
| 251 | 251 | if (layers_ctrl & 2) draw_sprites(screen.machine(), bitmap, cliprect, state->m_spriteram2, 1); |
| 252 | 252 | return 0; |
| r13798 | r13799 | |
|---|---|---|
| 84 | 84 | * * |
| 85 | 85 | *************************************/ |
| 86 | 86 | |
| 87 | static void draw_sprites(running_machine &machine, bitmap_t *bitmap, const rectangle | |
| 87 | static void draw_sprites(running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect) | |
| 88 | 88 | { |
| 89 | 89 | speedbal_state *state = machine.driver_data<speedbal_state>(); |
| 90 | 90 | UINT8 *spriteram = state->m_spriteram; |
| r13798 | r13799 | |
|---|---|---|
| 113 | 113 | |
| 114 | 114 | |
| 115 | 115 | |
| 116 | static void draw_sprites(running_machine &machine, bitmap_t *bitmap, const rectangle | |
| 116 | static void draw_sprites(running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect ) | |
| 117 | 117 | { |
| 118 | 118 | |
| 119 | 119 | /* | ---- ---- hhhf Fe-Y | ---- ---- yyyy yyyy | ---- ---- TTTT TTTT | ---- ---- tttt tttt | |
| r13798 | r13799 | |
| 165 | 165 | SCREEN_UPDATE( shadfrce ) |
| 166 | 166 | { |
| 167 | 167 | shadfrce_state *state = screen.machine().driver_data<shadfrce_state>(); |
| 168 | screen.machine().priority_bitmap->fill(0, | |
| 168 | screen.machine().priority_bitmap->fill(0, | |
| 169 | 169 | |
| 170 | 170 | if (state->m_video_enable) |
| 171 | 171 | { |
| r13798 | r13799 | |
| 176 | 176 | } |
| 177 | 177 | else |
| 178 | 178 | { |
| 179 | bitmap->fill(get_black_pen(screen.machine()), | |
| 179 | bitmap->fill(get_black_pen(screen.machine()), | |
| 180 | 180 | } |
| 181 | 181 | |
| 182 | 182 | return 0; |
| r13798 | r13799 | |
|---|---|---|
| 147 | 147 | 8, 8, 32, 32); |
| 148 | 148 | } |
| 149 | 149 | |
| 150 | static void draw_sprites(running_machine &machine, bitmap_t *bitmap, const rectangle | |
| 150 | static void draw_sprites(running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect) | |
| 151 | 151 | { |
| 152 | 152 | tagteam_state *state = machine.driver_data<tagteam_state>(); |
| 153 | 153 | int offs; |
| r13798 | r13799 | |
|---|---|---|
| 111 | 111 | } |
| 112 | 112 | |
| 113 | 113 | |
| 114 | static void draw_sprites(running_machine &machine, bitmap_t *bitmap, const rectangle | |
| 114 | static void draw_sprites(running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect) | |
| 115 | 115 | { |
| 116 | 116 | bagman_state *state = machine.driver_data<bagman_state>(); |
| 117 | 117 | UINT8 *spriteram = state->m_spriteram; |
| r13798 | r13799 | |
| 149 | 149 | SCREEN_UPDATE( bagman ) |
| 150 | 150 | { |
| 151 | 151 | bagman_state *state = screen.machine().driver_data<bagman_state>(); |
| 152 | bitmap->fill(0, | |
| 152 | bitmap->fill(0, | |
| 153 | 153 | if (*state->m_video_enable == 0) |
| 154 | 154 | return 0; |
| 155 | 155 |
| r13798 | r13799 | |
|---|---|---|
| 72 | 72 | state->save_pointer(NAME(state->m_vidram), 0x100 * 0x100 * 4); |
| 73 | 73 | } |
| 74 | 74 | |
| 75 | static void draw_sprites( running_machine &machine, bitmap_t *bitmap, const rectangle | |
| 75 | static void draw_sprites( running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect ) | |
| 76 | 76 | { |
| 77 | 77 | bigevglf_state *state = machine.driver_data<bigevglf_state>(); |
| 78 | 78 | int i, j; |
| r13798 | r13799 | |
|---|---|---|
| 55 | 55 | |
| 56 | 56 | ******************************************************************************/ |
| 57 | 57 | |
| 58 | static void draw_sprites( running_machine &machine, bitmap_t *bitmap, const rectangle | |
| 58 | static void draw_sprites( running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect ) | |
| 59 | 59 | { |
| 60 | 60 | inufuku_state *state = machine.driver_data<inufuku_state>(); |
| 61 | 61 | int offs; |
| r13798 | r13799 | |
| 239 | 239 | inufuku_state *state = screen.machine().driver_data<inufuku_state>(); |
| 240 | 240 | int i; |
| 241 | 241 | |
| 242 | bitmap->fill(get_black_pen(screen.machine()), | |
| 242 | bitmap->fill(get_black_pen(screen.machine()), | |
| 243 | 243 | screen.machine().priority_bitmap->fill(0); |
| 244 | 244 | |
| 245 | 245 | if (state->m_bg_raster) |
| r13798 | r13799 | |
|---|---|---|
| 105 | 105 | tilemap_set_transparent_pen(state->m_fg_tilemap, 3); |
| 106 | 106 | } |
| 107 | 107 | |
| 108 | static void draw_sprites( running_machine &machine, bitmap_t *bitmap, const rectangle | |
| 108 | static void draw_sprites( running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect ) | |
| 109 | 109 | { |
| 110 | 110 | UINT8 *buffered_spriteram = machine.generic.buffered_spriteram.u8; |
| 111 | 111 | int offs; |
| r13798 | r13799 | |
|---|---|---|
| 327 | 327 | int x, y, r; |
| 328 | 328 | |
| 329 | 329 | /* draw the playfield */ |
| 330 | priority_bitmap->fill(0, | |
| 330 | priority_bitmap->fill(0, | |
| 331 | 331 | tilemap_draw(bitmap, cliprect, state->m_playfield_tilemap, 0, 0); |
| 332 | 332 | tilemap_draw(bitmap, cliprect, state->m_playfield_tilemap, 1, 1); |
| 333 | 333 | tilemap_draw(bitmap, cliprect, state->m_playfield_tilemap, 2, 2); |
| r13798 | r13799 | |
|---|---|---|
| 212 | 212 | if (layers_ctrl & 1) |
| 213 | 213 | tilemap_draw(bitmap, cliprect, state->m_tilemap_0, 0, 0); |
| 214 | 214 | else |
| 215 | bitmap->fill(0, | |
| 215 | bitmap->fill(0, | |
| 216 | 216 | |
| 217 | 217 | if (layers_ctrl & 2) |
| 218 | 218 | tilemap_draw(bitmap, cliprect, state->m_tilemap_1, 0, 0); |
| r13798 | r13799 | |
|---|---|---|
| 168 | 168 | * |
| 169 | 169 | *************************************/ |
| 170 | 170 | |
| 171 | static void draw_sprites(running_machine &machine, bitmap_t *bitmap, const rectangle | |
| 171 | static void draw_sprites(running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect) | |
| 172 | 172 | { |
| 173 | 173 | skydiver_state *state = machine.driver_data<skydiver_state>(); |
| 174 | 174 | int pic; |
| r13798 | r13799 | |
|---|---|---|
| 413 | 413 | { |
| 414 | 414 | int const tile = code ^ (x << big_xshift) ^ (y << big_yshift); |
| 415 | 415 | |
| 416 | drawgfx_transpen(bitmap, | |
| 416 | drawgfx_transpen(bitmap, bitmap->cliprect(), gfx, | |
| 417 | 417 | tile, |
| 418 | 418 | color, |
| 419 | 419 | flipx,flipy, |
| r13798 | r13799 | |
| 452 | 452 | // This is very hackish. |
| 453 | 453 | // (Is there a possibility that software can't select it but hardware can?) |
| 454 | 454 | |
| 455 | static void erase_sprites(running_machine& machine, bitmap_t* bitmap | |
| 455 | static void erase_sprites(running_machine& machine, bitmap_t* bitmap | |
| 456 | 456 | { |
| 457 | 457 | ninjakd2_state *state = machine.driver_data<ninjakd2_state>(); |
| 458 | 458 | // if sprite overdraw is disabled, clear the sprite framebuffer |
| 459 | 459 | if (!state->m_next_sprite_overdraw_enabled) |
| 460 | state->m_sp_bitmap->fill(TRANSPARENTCODE | |
| 460 | state->m_sp_bitmap->fill(TRANSPARENTCODE | |
| 461 | 461 | else |
| 462 | 462 | for (int y = 0; y < state->m_sp_bitmap->height(); ++y) |
| 463 | 463 | { |
| r13798 | r13799 | |
| 474 | 474 | static void update_sprites(running_machine& machine) |
| 475 | 475 | { |
| 476 | 476 | ninjakd2_state *state = machine.driver_data<ninjakd2_state>(); |
| 477 | erase_sprites(machine, state->m_sp_bitmap | |
| 477 | erase_sprites(machine, state->m_sp_bitmap | |
| 478 | 478 | draw_sprites(machine, state->m_sp_bitmap); |
| 479 | 479 | } |
| 480 | 480 | ////// Before modified, this was written. |
| r13798 | r13799 | |
| 492 | 492 | update_sprites(screen.machine()); |
| 493 | 493 | state->m_sprites_updated = 1; |
| 494 | 494 | |
| 495 | bitmap->fill(0, | |
| 495 | bitmap->fill(0, | |
| 496 | 496 | |
| 497 | 497 | tilemap_draw(bitmap, cliprect, state->m_bg_tilemap, 0, 0); |
| 498 | 498 | |
| r13798 | r13799 | |
| 509 | 509 | update_sprites(screen.machine()); |
| 510 | 510 | state->m_sprites_updated = 1; |
| 511 | 511 | |
| 512 | bitmap->fill(0, | |
| 512 | bitmap->fill(0, | |
| 513 | 513 | |
| 514 | 514 | tilemap_draw(bitmap, cliprect, state->m_bg0_tilemap, 0, 0); |
| 515 | 515 | |
| r13798 | r13799 | |
| 530 | 530 | update_sprites(screen.machine()); |
| 531 | 531 | state->m_sprites_updated = 1; |
| 532 | 532 | |
| 533 | bitmap->fill(0, | |
| 533 | bitmap->fill(0, | |
| 534 | 534 | |
| 535 | 535 | tilemap_draw(bitmap, cliprect, state->m_bg0_tilemap, 0, 0); |
| 536 | 536 |
| r13798 | r13799 | |
|---|---|---|
| 215 | 215 | |
| 216 | 216 | ***************************************************************************/ |
| 217 | 217 | |
| 218 | INLINE void geebee_plot(bitmap_t *bitmap, const rectangle | |
| 218 | INLINE void geebee_plot(bitmap_t *bitmap, const rectangle &cliprect, int x, int y, pen_t pen) | |
| 219 | 219 | { |
| 220 | if (x >= cliprect | |
| 220 | if (x >= cliprect. | |
| 221 | 221 | bitmap->pix16(y, x) = pen; |
| 222 | 222 | } |
| 223 | 223 | |
| 224 | static void draw_ball(running_machine &machine, bitmap_t *bitmap, const rectangle | |
| 224 | static void draw_ball(running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect,pen_t pen) | |
| 225 | 225 | { |
| 226 | 226 | warpwarp_state *state = machine.driver_data<warpwarp_state>(); |
| 227 | 227 | if (state->m_ball_on) |
| r13798 | r13799 | |
|---|---|---|
| 138 | 138 | } |
| 139 | 139 | |
| 140 | 140 | |
| 141 | static void draw_starfield(screen_device &screen, bitmap_t *bitmap, const rectangle | |
| 141 | static void draw_starfield(screen_device &screen, bitmap_t *bitmap, const rectangle &cliprect) | |
| 142 | 142 | { |
| 143 | 143 | spacefb_state *state = screen.machine().driver_data<spacefb_state>(); |
| 144 | 144 | int y; |
| r13798 | r13799 | |
| 147 | 147 | get_starfield_pens(state, pens); |
| 148 | 148 | |
| 149 | 149 | /* the shift register is always shifting -- do the portion in the top VBLANK */ |
| 150 | if (cliprect | |
| 150 | if (cliprect. | |
| 151 | 151 | { |
| 152 | 152 | int i; |
| 153 | 153 | |
| r13798 | r13799 | |
| 159 | 159 | } |
| 160 | 160 | |
| 161 | 161 | /* visible region of the screen */ |
| 162 | for (y = cliprect | |
| 162 | for (y = cliprect. | |
| 163 | 163 | { |
| 164 | 164 | int x; |
| 165 | 165 | |
| r13798 | r13799 | |
| 182 | 182 | } |
| 183 | 183 | |
| 184 | 184 | /* do the shifting in the bottom VBLANK */ |
| 185 | if (cliprect | |
| 185 | if (cliprect. | |
| 186 | 186 | { |
| 187 | 187 | int i; |
| 188 | 188 | int clock_count = (SPACEFB_HBSTART - SPACEFB_HBEND) * (SPACEFB_VTOTAL - SPACEFB_VBSTART); |
| r13798 | r13799 | |
| 248 | 248 | } |
| 249 | 249 | |
| 250 | 250 | |
| 251 | static void draw_bullet(running_machine &machine, offs_t offs, pen_t pen, bitmap_t *bitmap, const rectangle | |
| 251 | static void draw_bullet(running_machine &machine, offs_t offs, pen_t pen, bitmap_t *bitmap, const rectangle &cliprect, int flip) | |
| 252 | 252 | { |
| 253 | 253 | spacefb_state *state = machine.driver_data<spacefb_state>(); |
| 254 | 254 | UINT8 sy; |
| r13798 | r13799 | |
| 270 | 270 | else |
| 271 | 271 | dy = y; |
| 272 | 272 | |
| 273 | if ((dy > cliprect | |
| 273 | if ((dy > cliprect. | |
| 274 | 274 | { |
| 275 | 275 | for (sx = 0; sx < 4; sx++) |
| 276 | 276 | { |
| r13798 | r13799 | |
| 300 | 300 | } |
| 301 | 301 | |
| 302 | 302 | |
| 303 | static void draw_sprite(running_machine &machine, offs_t offs, pen_t *pens, bitmap_t *bitmap, const rectangle | |
| 303 | static void draw_sprite(running_machine &machine, offs_t offs, pen_t *pens, bitmap_t *bitmap, const rectangle &cliprect, int flip) | |
| 304 | 304 | { |
| 305 | 305 | spacefb_state *state = machine.driver_data<spacefb_state>(); |
| 306 | 306 | UINT8 sy; |
| r13798 | r13799 | |
| 325 | 325 | else |
| 326 | 326 | dy = y; |
| 327 | 327 | |
| 328 | if ((dy > cliprect | |
| 328 | if ((dy > cliprect. | |
| 329 | 329 | { |
| 330 | 330 | for (sx = 0; sx < 8; sx++) |
| 331 | 331 | { |
| r13798 | r13799 | |
| 358 | 358 | } |
| 359 | 359 | |
| 360 | 360 | |
| 361 | static void draw_objects(running_machine &machine, bitmap_t *bitmap, const rectangle | |
| 361 | static void draw_objects(running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect) | |
| 362 | 362 | { |
| 363 | 363 | spacefb_state *state = machine.driver_data<spacefb_state>(); |
| 364 | 364 | pen_t sprite_pens[NUM_SPRITE_PENS]; |
| r13798 | r13799 | |
|---|---|---|
| 303 | 303 | * |
| 304 | 304 | *************************************/ |
| 305 | 305 | |
| 306 | static void draw_background(running_machine &machine, bitmap_t *bitmap, const rectangle | |
| 306 | static void draw_background(running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect, int xpos, int ypos, int image) | |
| 307 | 307 | { |
| 308 | 308 | rectangle rect; |
| 309 | 309 | const rectangle &visarea = machine.primary_screen->visible_area(); |
| r13798 | r13799 | |
| 365 | 365 | m52_state *state = screen.machine().driver_data<m52_state>(); |
| 366 | 366 | int offs; |
| 367 | 367 | |
| 368 | bitmap->fill(0, | |
| 368 | bitmap->fill(0, | |
| 369 | 369 | |
| 370 | 370 | if (!(state->m_bgcontrol & 0x20)) |
| 371 | 371 | { |
| r13798 | r13799 | |
| 396 | 396 | |
| 397 | 397 | /* sprites from offsets $00-$7F are processed in the upper half of the frame */ |
| 398 | 398 | /* sprites from offsets $80-$FF are processed in the lower half of the frame */ |
| 399 | clip = | |
| 399 | clip = | |
| 400 | 400 | if (!(offs & 0x80)) |
| 401 | 401 | clip.min_y = 0, clip.max_y = 127; |
| 402 | 402 | else |
| r13798 | r13799 | |
| 420 | 420 | #ifdef SPLIT_SPRITES |
| 421 | 421 | sect_rect(&clip, cliprect); |
| 422 | 422 | #else |
| 423 | clip = | |
| 423 | clip = | |
| 424 | 424 | #endif |
| 425 | 425 | |
| 426 | drawgfx_transmask(bitmap, | |
| 426 | drawgfx_transmask(bitmap, | |
| 427 | 427 | code, color, flipx, flipy, sx, sy, |
| 428 | 428 | colortable_get_transpen_mask(screen.machine().colortable, screen.machine().gfx[1], color, 512 + 32)); |
| 429 | 429 | } |
| r13798 | r13799 | |
|---|---|---|
| 927 | 927 | /* if not enabled, just blank */ |
| 928 | 928 | if (!(gpu_regs[VMODE] & 1)) |
| 929 | 929 | { |
| 930 | bitmap->fill(0, | |
| 930 | bitmap->fill(0, | |
| 931 | 931 | return 0; |
| 932 | 932 | } |
| 933 | 933 |
| r13798 | r13799 | |
|---|---|---|
| 108 | 108 | |
| 109 | 109 | ***************************************************************************/ |
| 110 | 110 | |
| 111 | static void draw_sprites( running_machine &machine, bitmap_t *bitmap, const rectangle | |
| 111 | static void draw_sprites( running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect ) | |
| 112 | 112 | { |
| 113 | 113 | UINT8 *buffered_spriteram = machine.generic.buffered_spriteram.u8; |
| 114 | 114 | const gfx_element *gfx = machine.gfx[2]; |
| r13798 | r13799 | |
|---|---|---|
| 84 | 84 | return MAKE_RGB(r,g,b); |
| 85 | 85 | } |
| 86 | 86 | |
| 87 | void jal_blend_drawgfx(bitmap_t *dest_bmp,const rectangle | |
| 87 | void jal_blend_drawgfx(bitmap_t *dest_bmp,const rectangle &clip,const gfx_element *gfx, | |
| 88 | 88 | UINT32 code,UINT32 color,int flipx,int flipy,int offsx,int offsy, |
| 89 | 89 | int transparent_color) |
| 90 | 90 | { |
| r13798 | r13799 | |
| 117 | 117 | ex = sx + gfx->width; |
| 118 | 118 | ey = sy + gfx->height; |
| 119 | 119 | |
| 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; | |
| 143 | 125 | } |
| 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 | } | |
| 144 | 141 | |
| 145 | 142 | if (ex > sx) |
| 146 | 143 | { /* skip if inner loop doesn't draw anything */ |
| r13798 | r13799 | |
|---|---|---|
| 218 | 218 | { |
| 219 | 219 | const rectangle visible1(0, 400-1, 0, 280-1); //minx,maxx, miny,maxy |
| 220 | 220 | |
| 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); | |
| 223 | 223 | |
| 224 | 224 | return 0; |
| 225 | 225 | } |
| r13798 | r13799 | |
|---|---|---|
| 2 | 2 | void jal_blend_set(int color, UINT8 val); |
| 3 | 3 | |
| 4 | 4 | rgb_t jal_blend_func(rgb_t dest, rgb_t addMe, UINT8 alpha); |
| 5 | void jal_blend_drawgfx(bitmap_t *dest_bmp,const rectangle | |
| 5 | void jal_blend_drawgfx(bitmap_t *dest_bmp,const rectangle &clip,const gfx_element *gfx, | |
| 6 | 6 | UINT32 code,UINT32 color,int flipx,int flipy,int offsx,int offsy, |
| 7 | 7 | int transparent_color); |
| r13798 | r13799 | |
|---|---|---|
| 98 | 98 | |
| 99 | 99 | ***************************************************************************/ |
| 100 | 100 | |
| 101 | static void draw_sprites(running_machine &machine, bitmap_t *bitmap, const rectangle | |
| 101 | static void draw_sprites(running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect, int priority ) | |
| 102 | 102 | { |
| 103 | 103 | wc90b_state *state = machine.driver_data<wc90b_state>(); |
| 104 | 104 | UINT8 *spriteram = state->m_spriteram; |
| r13798 | r13799 | |
|---|---|---|
| 180 | 180 | |
| 181 | 181 | ***************************************************************************/ |
| 182 | 182 | |
| 183 | static void draw_sprites( running_machine &machine, bitmap_t *bitmap, const rectangle | |
| 183 | static void draw_sprites( running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect ) | |
| 184 | 184 | { |
| 185 | 185 | kncljoe_state *state = machine.driver_data<kncljoe_state>(); |
| 186 | 186 | UINT8 *spriteram = state->m_spriteram; |
| 187 | rectangle clip = | |
| 187 | rectangle clip = | |
| 188 | 188 | const gfx_element *gfx = machine.gfx[1 + state->m_sprite_bank]; |
| 189 | 189 | int i, j; |
| 190 | 190 | static const int pribase[4]={0x0180, 0x0080, 0x0100, 0x0000}; |
| r13798 | r13799 | |
| 230 | 230 | if (sx >= 256-8) |
| 231 | 231 | sx -= 256; |
| 232 | 232 | |
| 233 | drawgfx_transpen(bitmap, | |
| 233 | drawgfx_transpen(bitmap, | |
| 234 | 234 | code, |
| 235 | 235 | color, |
| 236 | 236 | flipx,flipy, |
| r13798 | r13799 | |
|---|---|---|
| 109 | 109 | } |
| 110 | 110 | |
| 111 | 111 | |
| 112 | static void holeland_draw_sprites( running_machine &machine, bitmap_t *bitmap, const rectangle | |
| 112 | static void holeland_draw_sprites( running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect ) | |
| 113 | 113 | { |
| 114 | 114 | holeland_state *state = machine.driver_data<holeland_state>(); |
| 115 | 115 | UINT8 *spriteram = state->m_spriteram; |
| r13798 | r13799 | |
| 149 | 149 | } |
| 150 | 150 | } |
| 151 | 151 | |
| 152 | static void crzrally_draw_sprites( running_machine &machine, bitmap_t *bitmap,const rectangle | |
| 152 | static void crzrally_draw_sprites( running_machine &machine, bitmap_t *bitmap,const rectangle &cliprect ) | |
| 153 | 153 | { |
| 154 | 154 | holeland_state *state = machine.driver_data<holeland_state>(); |
| 155 | 155 | UINT8 *spriteram = state->m_spriteram; |
| r13798 | r13799 | |
|---|---|---|
| 150 | 150 | cliprect,gfx, \ |
| 151 | 151 | (which+order),color+ 8 * state->m_sprite_palbank,flipx,flipy,sx,sy,0); |
| 152 | 152 | |
| 153 | static void draw_sprites(running_machine &machine, bitmap_t *bitmap, const rectangle | |
| 153 | static void draw_sprites(running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect ) | |
| 154 | 154 | { |
| 155 | 155 | spdodgeb_state *state = machine.driver_data<spdodgeb_state>(); |
| 156 | 156 | UINT8 *spriteram = state->m_spriteram; |
| r13798 | r13799 | |
|---|---|---|
| 290 | 290 | |
| 291 | 291 | /***************************************************************************/ |
| 292 | 292 | |
| 293 | static void liberate_draw_sprites( running_machine &machine, bitmap_t *bitmap, const rectangle | |
| 293 | static void liberate_draw_sprites( running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect ) | |
| 294 | 294 | { |
| 295 | 295 | liberate_state *state = machine.driver_data<liberate_state>(); |
| 296 | 296 | UINT8 *spriteram = state->m_spriteram; |
| r13798 | r13799 | |
| 359 | 359 | } |
| 360 | 360 | } |
| 361 | 361 | |
| 362 | static void prosport_draw_sprites( running_machine &machine, bitmap_t *bitmap, const rectangle | |
| 362 | static void prosport_draw_sprites( running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect ) | |
| 363 | 363 | { |
| 364 | 364 | liberate_state *state = machine.driver_data<liberate_state>(); |
| 365 | 365 | int offs, multi, fx, fy, sx, sy, sy2, code, code2, color, gfx_region; |
| r13798 | r13799 | |
| 424 | 424 | } |
| 425 | 425 | } |
| 426 | 426 | |
| 427 | static void boomrang_draw_sprites( running_machine &machine, bitmap_t *bitmap, const rectangle | |
| 427 | static void boomrang_draw_sprites( running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect, int pri ) | |
| 428 | 428 | { |
| 429 | 429 | liberate_state *state = machine.driver_data<liberate_state>(); |
| 430 | 430 | UINT8 *spriteram = state->m_spriteram; |
| r13798 | r13799 | |
| 485 | 485 | } |
| 486 | 486 | } |
| 487 | 487 | |
| 488 | static void prosoccr_draw_sprites( running_machine &machine, bitmap_t *bitmap, const rectangle | |
| 488 | static void prosoccr_draw_sprites( running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect ) | |
| 489 | 489 | { |
| 490 | 490 | liberate_state *state = machine.driver_data<liberate_state>(); |
| 491 | 491 | UINT8 *spriteram = state->m_spriteram; |
| r13798 | r13799 | |
| 519 | 519 | tilemap_set_scrollx(state->m_back_tilemap, 0, -state->m_io_ram[0]); |
| 520 | 520 | |
| 521 | 521 | if (state->m_background_disable) |
| 522 | bitmap->fill(32, | |
| 522 | bitmap->fill(32, | |
| 523 | 523 | else |
| 524 | 524 | tilemap_draw(bitmap, cliprect, state->m_back_tilemap, 0, 0); |
| 525 | 525 | |
| r13798 | r13799 | |
| 537 | 537 | int mx, my, tile, offs, gfx_region; |
| 538 | 538 | int scrollx, scrolly; |
| 539 | 539 | |
| 540 | bitmap->fill(0, | |
| 540 | bitmap->fill(0, | |
| 541 | 541 | |
| 542 | 542 | offs = 0; |
| 543 | 543 | /* TODO: what's bits 0 and 2 for? Internal scrolling state? */ |
| r13798 | r13799 | |
| 580 | 580 | tilemap_set_scrollx(state->m_back_tilemap, 0, -state->m_io_ram[0]); |
| 581 | 581 | |
| 582 | 582 | if (state->m_background_disable) |
| 583 | bitmap->fill(32, | |
| 583 | bitmap->fill(32, | |
| 584 | 584 | else |
| 585 | 585 | tilemap_draw(bitmap, cliprect, state->m_back_tilemap, TILEMAP_DRAW_LAYER1, 0); |
| 586 | 586 | |
| r13798 | r13799 | |
| 600 | 600 | tilemap_set_scrollx(state->m_back_tilemap, 0, -state->m_io_ram[0]); |
| 601 | 601 | |
| 602 | 602 | if (state->m_background_disable) |
| 603 | bitmap->fill(32, | |
| 603 | bitmap->fill(32, | |
| 604 | 604 | else |
| 605 | 605 | tilemap_draw(bitmap, cliprect, state->m_back_tilemap, 0, 0); |
| 606 | 606 |
| r13798 | r13799 | |
|---|---|---|
| 140 | 140 | colortable_configure_tilemap_groups(machine.colortable, state->m_fg_tilemap, machine.gfx[0], 0x4f); |
| 141 | 141 | } |
| 142 | 142 | |
| 143 | static void draw_sprites( running_machine &machine, bitmap_t *bitmap, const rectangle | |
| 143 | static void draw_sprites( running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect ) | |
| 144 | 144 | { |
| 145 | 145 | gunsmoke_state *state = machine.driver_data<gunsmoke_state>(); |
| 146 | 146 | UINT8 *spriteram = state->m_spriteram; |
| r13798 | r13799 | |
| 183 | 183 | if (state->m_bgon) |
| 184 | 184 | tilemap_draw(bitmap, cliprect, state->m_bg_tilemap, 0, 0); |
| 185 | 185 | else |
| 186 | bitmap->fill(get_black_pen(screen.machine()), | |
| 186 | bitmap->fill(get_black_pen(screen.machine()), | |
| 187 | 187 | |
| 188 | 188 | if (state->m_objon) |
| 189 | 189 | draw_sprites(screen.machine(), bitmap, cliprect); |
| r13798 | r13799 | |
|---|---|---|
| 421 | 421 | int x, y; |
| 422 | 422 | |
| 423 | 423 | /* loop over rows */ |
| 424 | for (y = cliprect | |
| 424 | for (y = cliprect. | |
| 425 | 425 | { |
| 426 | 426 | const UINT16 *fore = &fgpixmap->pix16(y); |
| 427 | 427 | UINT16 *dest = &bitmap->pix16(y); |
| r13798 | r13799 | |
| 440 | 440 | turbo_prepare_sprites(screen.machine(), state, y, &sprinfo); |
| 441 | 441 | |
| 442 | 442 | /* loop over columns */ |
| 443 | for (x = 0; x <= cliprect | |
| 443 | for (x = 0; x <= cliprect. | |
| 444 | 444 | { |
| 445 | 445 | int bacol, red, grn, blu, priority, foreraw, forebits, mx, ix; |
| 446 | 446 | int xx = x / TURBO_X_SCALE; |
| r13798 | r13799 | |
| 771 | 771 | int x, y; |
| 772 | 772 | |
| 773 | 773 | /* loop over rows */ |
| 774 | for (y = cliprect | |
| 774 | for (y = cliprect. | |
| 775 | 775 | { |
| 776 | 776 | const UINT16 *fore = &fgpixmap->pix16(y); |
| 777 | 777 | UINT16 *dest = &bitmap->pix16(y); |
| r13798 | r13799 | |
| 782 | 782 | subroc3d_prepare_sprites(screen.machine(), state, y, &sprinfo); |
| 783 | 783 | |
| 784 | 784 | /* loop over columns */ |
| 785 | for (x = 0; x <= cliprect | |
| 785 | for (x = 0; x <= cliprect. | |
| 786 | 786 | { |
| 787 | 787 | int offs, finalbits, ix; |
| 788 | 788 | UINT8 xx = x / TURBO_X_SCALE; |
| r13798 | r13799 | |
| 991 | 991 | int x, y; |
| 992 | 992 | |
| 993 | 993 | /* loop over rows */ |
| 994 | for (y = cliprect | |
| 994 | for (y = cliprect. | |
| 995 | 995 | { |
| 996 | 996 | const UINT16 *fore = &fgpixmap->pix16(y); |
| 997 | 997 | UINT16 *dest = &bitmap->pix16(y); |
| r13798 | r13799 | |
| 1002 | 1002 | buckrog_prepare_sprites(screen.machine(), state, y, &sprinfo); |
| 1003 | 1003 | |
| 1004 | 1004 | /* loop over columns */ |
| 1005 | for (x = 0; x <= cliprect | |
| 1005 | for (x = 0; x <= cliprect. | |
| 1006 | 1006 | { |
| 1007 | 1007 | UINT8 foreraw, forebits, cd, plb, star, mux; |
| 1008 | 1008 | UINT8 xx = x / TURBO_X_SCALE; |
| r13798 | r13799 | |
|---|---|---|
| 209 | 209 | |
| 210 | 210 | int gfxnum = (code < ram_based_char_start_indices[state->m_character_banking_mode]) ? 0 : 1; |
| 211 | 211 | |
| 212 | drawgfx_opaque(state->m_background_bitmap, | |
| 212 | drawgfx_opaque(state->m_background_bitmap, state->m_background_bitmap->cliprect(), screen.machine().gfx[gfxnum], | |
| 213 | 213 | code, color, |
| 214 | 214 | 0, 0, |
| 215 | 215 | x, y); |
| r13798 | r13799 | |
| 225 | 225 | collision_color = 0x102; |
| 226 | 226 | } |
| 227 | 227 | |
| 228 | drawgfx_opaque(state->m_collision_background, | |
| 228 | drawgfx_opaque(state->m_collision_background, state->m_collision_background->cliprect(), screen.machine().gfx[gfxnum], | |
| 229 | 229 | code, collision_color, |
| 230 | 230 | 0, 0, |
| 231 | 231 | x, y); |
| r13798 | r13799 | |
| 280 | 280 | { |
| 281 | 281 | int y; |
| 282 | 282 | |
| 283 | for (y = cliprect | |
| 283 | for (y = cliprect. | |
| 284 | 284 | { |
| 285 | 285 | int x; |
| 286 | 286 | |
| 287 | for (x = cliprect | |
| 287 | for (x = cliprect. | |
| 288 | 288 | { |
| 289 | 289 | int pixel0 = s2636_0_bitmap->pix16(y, x); |
| 290 | 290 | int pixel1 = s2636_1_bitmap->pix16(y, x); |
| r13798 | r13799 | |
| 329 | 329 | if (flip_screen_y_get(screen.machine())) |
| 330 | 330 | y = ~y; |
| 331 | 331 | |
| 332 | if ((y >= cliprect | |
| 332 | if ((y >= cliprect. | |
| 333 | 333 | (colortable_entry_get_value(screen.machine().colortable, bitmap->pix16(y, x)) == 0)) |
| 334 | 334 | bitmap->pix16(y, x) = BULLET_STAR_PEN; |
| 335 | 335 | } |
| r13798 | r13799 | |
|---|---|---|
| 770 | 770 | |
| 771 | 771 | |
| 772 | 772 | |
| 773 | static void draw_tilemap_palette_effect(running_machine &machine, bitmap_t *bitmap, const rectangle | |
| 773 | static 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) | |
| 774 | 774 | { |
| 775 | 775 | int y; |
| 776 | 776 | const gfx_element *gfx_tilemap = machine.gfx[gfxnum]; |
| r13798 | r13799 | |
| 783 | 783 | width_mask = src_bitmap->width() - 1; |
| 784 | 784 | height_mask = src_bitmap->height() - 1; |
| 785 | 785 | |
| 786 | for (y = cliprect | |
| 786 | for (y = cliprect. | |
| 787 | 787 | { |
| 788 | 788 | UINT16 *dest = &bitmap->pix16(y); |
| 789 | 789 | |
| 790 | 790 | int x; |
| 791 | for (x = cliprect | |
| 791 | for (x = cliprect. | |
| 792 | 792 | { |
| 793 | 793 | if(!flipscreen) |
| 794 | 794 | { |
| r13798 | r13799 | |
| 831 | 831 | SCREEN_UPDATE( seta_no_layers ) |
| 832 | 832 | { |
| 833 | 833 | set_pens(screen.machine()); |
| 834 | bitmap->fill(0x1f0, | |
| 834 | bitmap->fill(0x1f0, | |
| 835 | 835 | |
| 836 | 836 | screen.machine().device<seta001_device>("spritegen")->seta001_draw_sprites(screen.machine(),bitmap,cliprect,0x1000, 1); |
| 837 | 837 | return 0; |
| r13798 | r13799 | |
| 839 | 839 | |
| 840 | 840 | |
| 841 | 841 | /* For games with 1 or 2 tilemaps */ |
| 842 | void seta_layers_update(screen_device &screen, bitmap_t *bitmap, const rectangle | |
| 842 | void seta_layers_update(screen_device &screen, bitmap_t *bitmap, const rectangle &cliprect, int sprite_bank_size, int sprite_setac ) | |
| 843 | 843 | { |
| 844 | 844 | seta_state *state = screen.machine().driver_data<seta_state>(); |
| 845 | 845 | int layers_ctrl = -1; |
| r13798 | r13799 | |
| 944 | 944 | } |
| 945 | 945 | #endif |
| 946 | 946 | |
| 947 | bitmap->fill(0, | |
| 947 | bitmap->fill(0, | |
| 948 | 948 | |
| 949 | 949 | if (order & 1) // swap the layers? |
| 950 | 950 | { |
| r13798 | r13799 | |
| 1055 | 1055 | |
| 1056 | 1056 | SCREEN_UPDATE( setaroul ) |
| 1057 | 1057 | { |
| 1058 | bitmap->fill(0x0, | |
| 1058 | bitmap->fill(0x0, | |
| 1059 | 1059 | |
| 1060 | 1060 | screen.machine().device<seta001_device>("spritegen")->set_fg_yoffsets( -0x12, 0x0e ); |
| 1061 | 1061 | screen.machine().device<seta001_device>("spritegen")->set_bg_yoffsets( 0x1, -0x1 ); |
| r13798 | r13799 | |
|---|---|---|
| 44 | 44 | |
| 45 | 45 | SCREEN_UPDATE( tnzs ) |
| 46 | 46 | { |
| 47 | bitmap->fill(0x1f0, | |
| 47 | bitmap->fill(0x1f0, | |
| 48 | 48 | |
| 49 | 49 | screen.machine().device<seta001_device>("spritegen")->set_fg_yoffsets( -0x12, 0x0e ); |
| 50 | 50 | screen.machine().device<seta001_device>("spritegen")->set_bg_yoffsets( 0x1, -0x1 ); |
| r13798 | r13799 | |
|---|---|---|
| 152 | 152 | } |
| 153 | 153 | |
| 154 | 154 | |
| 155 | static void draw_sprites(running_machine &machine, bitmap_t *bitmap, const rectangle | |
| 155 | static void draw_sprites(running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect) | |
| 156 | 156 | { |
| 157 | 157 | tp84_state *state = machine.driver_data<tp84_state>(); |
| 158 | 158 | int offs; |
| r13798 | r13799 | |
| 178 | 178 | SCREEN_UPDATE( tp84 ) |
| 179 | 179 | { |
| 180 | 180 | tp84_state *state = screen.machine().driver_data<tp84_state>(); |
| 181 | rectangle clip = | |
| 181 | rectangle clip = | |
| 182 | 182 | const rectangle &visarea = screen.visible_area(); |
| 183 | 183 | |
| 184 | if (cliprect | |
| 184 | if (cliprect. | |
| 185 | 185 | { |
| 186 | 186 | tilemap_mark_all_tiles_dirty_all(screen.machine()); |
| 187 | 187 | |
| r13798 | r13799 | |
| 198 | 198 | /* draw top status region */ |
| 199 | 199 | clip.min_x = visarea.min_x; |
| 200 | 200 | clip.max_x = visarea.min_x + 15; |
| 201 | tilemap_draw(bitmap, | |
| 201 | tilemap_draw(bitmap, | |
| 202 | 202 | |
| 203 | 203 | /* draw bottom status region */ |
| 204 | 204 | clip.min_x = visarea.max_x - 15; |
| 205 | 205 | clip.max_x = visarea.max_x; |
| 206 | tilemap_draw(bitmap, | |
| 206 | tilemap_draw(bitmap, | |
| 207 | 207 | |
| 208 | 208 | return 0; |
| 209 | 209 | } |
| r13798 | r13799 | |
|---|---|---|
| 114 | 114 | cliprect,gfx, \ |
| 115 | 115 | (which+order),color,flipx,flipy,sx,sy,0); |
| 116 | 116 | |
| 117 | static void draw_sprites(running_machine &machine, bitmap_t *bitmap, const rectangle | |
| 117 | static void draw_sprites(running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect) | |
| 118 | 118 | { |
| 119 | 119 | vball_state *state = machine.driver_data<vball_state>(); |
| 120 | 120 | const gfx_element *gfx = machine.gfx[1]; |
| r13798 | r13799 | |
|---|---|---|
| 27 | 27 | |
| 28 | 28 | /******************************************************************************/ |
| 29 | 29 | |
| 30 | static void rohga_draw_sprites( running_machine &machine, bitmap_t *bitmap, const rectangle | |
| 30 | static void rohga_draw_sprites( running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect, const UINT16 *spriteptr, int is_schmeisr ) | |
| 31 | 31 | { |
| 32 | 32 | int offs; |
| 33 | 33 | |
| r13798 | r13799 | |
| 109 | 109 | } |
| 110 | 110 | } |
| 111 | 111 | |
| 112 | static void wizdfire_draw_sprites( running_machine &machine, bitmap_t *bitmap, const rectangle | |
| 112 | static void wizdfire_draw_sprites( running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect, UINT16 *spriteptr, int mode, int bank ) | |
| 113 | 113 | { |
| 114 | 114 | int offs; |
| 115 | 115 | |
| r13798 | r13799 | |
| 211 | 211 | } |
| 212 | 212 | } |
| 213 | 213 | |
| 214 | static void nitrobal_draw_sprites( running_machine &machine, bitmap_t *bitmap, const rectangle | |
| 214 | static void nitrobal_draw_sprites( running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect, const UINT16 *spriteptr, int gfxbank ) | |
| 215 | 215 | { |
| 216 | 216 | rohga_state *state = machine.driver_data<rohga_state>(); |
| 217 | 217 | int offs, end, inc; |
| r13798 | r13799 | |
| 419 | 419 | |
| 420 | 420 | /******************************************************************************/ |
| 421 | 421 | |
| 422 | static void update_rohga( screen_device &screen, bitmap_t *bitmap, const rectangle | |
| 422 | static void update_rohga( screen_device &screen, bitmap_t *bitmap, const rectangle &cliprect, int is_schmeisr ) | |
| 423 | 423 | { |
| 424 | 424 | rohga_state *state = screen.machine().driver_data<rohga_state>(); |
| 425 | 425 | UINT16 flip = deco16ic_pf_control_r(state->m_deco_tilegen1, 0, 0xffff); |
| r13798 | r13799 | |
| 431 | 431 | deco16ic_pf_update(state->m_deco_tilegen2, state->m_pf3_rowscroll, state->m_pf4_rowscroll); |
| 432 | 432 | |
| 433 | 433 | /* 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); | |
| 436 | 436 | |
| 437 | 437 | switch (priority & 3) |
| 438 | 438 | { |
| r13798 | r13799 | |
| 492 | 492 | deco16ic_pf_update(state->m_deco_tilegen2, state->m_pf3_rowscroll, state->m_pf4_rowscroll); |
| 493 | 493 | |
| 494 | 494 | /* Draw playfields - Palette of 2nd playfield chip visible if playfields turned off */ |
| 495 | bitmap->fill(screen.machine().pens[512], | |
| 495 | bitmap->fill(screen.machine().pens[512], | |
| 496 | 496 | |
| 497 | 497 | deco16ic_tilemap_2_draw(state->m_deco_tilegen2, bitmap, cliprect, TILEMAP_DRAW_OPAQUE, 0); |
| 498 | 498 | wizdfire_draw_sprites(screen.machine(), bitmap, cliprect, screen.machine().generic.buffered_spriteram.u16, 4, 3); |
| r13798 | r13799 | |
| 524 | 524 | deco16ic_pf_update(state->m_deco_tilegen2, state->m_pf3_rowscroll, state->m_pf4_rowscroll); |
| 525 | 525 | |
| 526 | 526 | /* Draw playfields - Palette of 2nd playfield chip visible if playfields turned off */ |
| 527 | bitmap->fill(screen.machine().pens[512], | |
| 527 | bitmap->fill(screen.machine().pens[512], | |
| 528 | 528 | screen.machine().priority_bitmap->fill(0); |
| 529 | 529 | decocomn_clear_sprite_priority_bitmap(state->m_decocomn); |
| 530 | 530 |
| r13798 | r13799 | |
|---|---|---|
| 106 | 106 | state->m_bg_tilemap = tilemap_create(machine, get_bg_tile_info, tilemap_scan_rows, 8, 8, 32, 32); |
| 107 | 107 | } |
| 108 | 108 | |
| 109 | static void draw_sprites( running_machine &machine, bitmap_t *bitmap, const rectangle | |
| 109 | static void draw_sprites( running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect ) | |
| 110 | 110 | { |
| 111 | 111 | higemaru_state *state = machine.driver_data<higemaru_state>(); |
| 112 | 112 | UINT8 *spriteram = state->m_spriteram; |
| r13798 | r13799 | |
|---|---|---|
| 128 | 128 | polygonet_state *state = screen.machine().driver_data<polygonet_state>(); |
| 129 | 129 | device_t *k053936 = screen.machine().device("k053936"); |
| 130 | 130 | screen.machine().priority_bitmap->fill(0); |
| 131 | bitmap->fill(get_black_pen(screen.machine()), | |
| 131 | bitmap->fill(get_black_pen(screen.machine()), | |
| 132 | 132 | |
| 133 | 133 | k053936_zoom_draw(k053936, bitmap, cliprect, state->m_roz_tilemap, 0, 0, 0); |
| 134 | 134 |
| r13798 | r13799 | |
|---|---|---|
| 203 | 203 | int x, y, r; |
| 204 | 204 | |
| 205 | 205 | /* draw the playfield */ |
| 206 | priority_bitmap->fill(0, | |
| 206 | priority_bitmap->fill(0, | |
| 207 | 207 | tilemap_draw(bitmap, cliprect, state->m_playfield_tilemap, 0, 0x00); |
| 208 | 208 | tilemap_draw(bitmap, cliprect, state->m_playfield_tilemap, 1, 0x01); |
| 209 | 209 | tilemap_draw(bitmap, cliprect, state->m_playfield_tilemap, 2, 0x02); |
| r13798 | r13799 | |
|---|---|---|
| 334 | 334 | } |
| 335 | 335 | |
| 336 | 336 | |
| 337 | static void draw_sprites( running_machine &machine, bitmap_t *bitmap, const rectangle | |
| 337 | static void draw_sprites( running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect ) | |
| 338 | 338 | { |
| 339 | 339 | /* |
| 340 | 340 | * 16 bytes per sprite, in memory from 56000-56fff |
| r13798 | r13799 | |
| 431 | 431 | int offs; |
| 432 | 432 | rectangle clip; |
| 433 | 433 | |
| 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); | |
| 436 | 436 | |
| 437 | 437 | clip.min_x = 0; |
| 438 | 438 | clip.max_x = 255; |
| r13798 | r13799 | |
| 453 | 453 | tilemap_set_scrolly(state->m_foreground, offs, state->m_yscroll1[offset_x]); |
| 454 | 454 | } |
| 455 | 455 | |
| 456 | for (offs = cliprect | |
| 456 | for (offs = cliprect. | |
| 457 | 457 | { |
| 458 | 458 | int i; |
| 459 | 459 | int offset_y = offs; |
| r13798 | r13799 | |
| 469 | 469 | |
| 470 | 470 | for (i = 0; i < 4; i += 2) |
| 471 | 471 | { |
| 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); | |
| 476 | 476 | } |
| 477 | 477 | } |
| 478 | 478 |
| r13798 | r13799 | |
|---|---|---|
| 108 | 108 | } |
| 109 | 109 | |
| 110 | 110 | |
| 111 | static void draw_sprites( running_machine &machine, bitmap_t *bitmap, const rectangle | |
| 111 | static void draw_sprites( running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect, const gfx_element *gfx, int flip ) | |
| 112 | 112 | { |
| 113 | 113 | cheekyms_state *state = machine.driver_data<cheekyms_state>(); |
| 114 | 114 | offs_t offs; |
| r13798 | r13799 | |
| 158 | 158 | tilemap_mark_all_tiles_dirty_all(screen.machine()); |
| 159 | 159 | tilemap_set_flip_all(screen.machine(), flip ? TILEMAP_FLIPX | TILEMAP_FLIPY : 0); |
| 160 | 160 | |
| 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); | |
| 163 | 163 | |
| 164 | 164 | /* sprites go under the playfield */ |
| 165 | 165 | draw_sprites(screen.machine(), bitmap, cliprect, screen.machine().gfx[1], flip); |
| r13798 | r13799 | |
| 168 | 168 | tilemap_draw(state->m_bitmap_buffer, cliprect, state->m_cm_tilemap, 0, 0); |
| 169 | 169 | |
| 170 | 170 | /* draw the tilemap to the final bitmap applying the scroll to the man character */ |
| 171 | for (y = cliprect | |
| 171 | for (y = cliprect. | |
| 172 | 172 | { |
| 173 | for (x = cliprect | |
| 173 | for (x = cliprect. | |
| 174 | 174 | { |
| 175 | 175 | int in_man_area; |
| 176 | 176 |
| r13798 | r13799 | |
|---|---|---|
| 96 | 96 | |
| 97 | 97 | /* copy the background graphics */ |
| 98 | 98 | if (*state->m_vreg & 0x40) /* background disable */ |
| 99 | bitmap->fill(0, | |
| 99 | bitmap->fill(0, | |
| 100 | 100 | else |
| 101 | 101 | { |
| 102 | 102 | int v; |
| r13798 | r13799 | |
|---|---|---|
| 116 | 116 | } |
| 117 | 117 | |
| 118 | 118 | |
| 119 | static void draw_sprites(running_machine &machine, bitmap_t *bitmap, const rectangle | |
| 119 | static void draw_sprites(running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect) | |
| 120 | 120 | { |
| 121 | 121 | timelimt_state *state = machine.driver_data<timelimt_state>(); |
| 122 | 122 | UINT8 *spriteram = state->m_spriteram; |
| r13798 | r13799 | |
|---|---|---|
| 17 | 17 | SPRITE DRAW ROUTINE |
| 18 | 18 | ************************************************************/ |
| 19 | 19 | |
| 20 | static void draw_sprites( running_machine &machine, bitmap_t *bitmap, const rectangle | |
| 20 | static void draw_sprites( running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect, int x_offs, int y_offs ) | |
| 21 | 21 | { |
| 22 | 22 | warriorb_state *state = machine.driver_data<warriorb_state>(); |
| 23 | 23 | UINT16 *spriteram = state->m_spriteram; |
| r13798 | r13799 | |
| 84 | 84 | SCREEN REFRESH |
| 85 | 85 | **************************************************************/ |
| 86 | 86 | |
| 87 | static UINT32 update_screen(screen_device &screen, bitmap_t *bitmap, const rectangle | |
| 87 | static UINT32 update_screen(screen_device &screen, bitmap_t *bitmap, const rectangle &cliprect, int xoffs, device_t *tc0100scn) | |
| 88 | 88 | { |
| 89 | 89 | UINT8 layer[3], nodraw; |
| 90 | 90 | |
| r13798 | r13799 | |
| 95 | 95 | layer[2] = 2; |
| 96 | 96 | |
| 97 | 97 | /* Clear priority bitmap */ |
| 98 | screen.machine().priority_bitmap->fill(0, | |
| 98 | screen.machine().priority_bitmap->fill(0, | |
| 99 | 99 | |
| 100 | 100 | /* chip 0 does tilemaps on the left, chip 1 does the ones on the right */ |
| 101 | 101 | // draw bottom layer |
| r13798 | r13799 | |
| 103 | 103 | |
| 104 | 104 | /* Ensure screen blanked even when bottom layers not drawn due to disable bit */ |
| 105 | 105 | if (nodraw) |
| 106 | bitmap->fill(get_black_pen(screen.machine()), | |
| 106 | bitmap->fill(get_black_pen(screen.machine()), | |
| 107 | 107 | |
| 108 | 108 | // draw middle layer |
| 109 | 109 | tc0100scn_tilemap_draw(tc0100scn, bitmap, cliprect, layer[1], 0, 1); |
| r13798 | r13799 | |
|---|---|---|
| 206 | 206 | SET_TILE_INFO(4, tile, color, 0); |
| 207 | 207 | } |
| 208 | 208 | |
| 209 | static void draw_sprites(running_machine &machine, bitmap_t *bitmap,const rectangle | |
| 209 | static void draw_sprites(running_machine &machine, bitmap_t *bitmap,const rectangle &cliprect,int pri) | |
| 210 | 210 | { |
| 211 | 211 | UINT16 *spriteram16 = reinterpret_cast<UINT16 *>(memory_get_shared(machine, "spriteram")); |
| 212 | 212 | int offs,fx,fy,x,y,color,sprite; |
| r13798 | r13799 | |
| 271 | 271 | |
| 272 | 272 | SCREEN_UPDATE( seibu_crtc ) |
| 273 | 273 | { |
| 274 | bitmap->fill(screen.machine().pens[0x7ff], | |
| 274 | bitmap->fill(screen.machine().pens[0x7ff], | |
| 275 | 275 | |
| 276 | 276 | tilemap_set_scrollx( sc0_tilemap,0, (SEIBU_CRTC_SC0_SX + SEIBU_CRTC_FIX_SX+64) & 0x1ff ); |
| 277 | 277 | tilemap_set_scrolly( sc0_tilemap,0, (SEIBU_CRTC_SC0_SY + SEIBU_CRTC_FIX_SY+1) & 0x1ff ); |
| r13798 | r13799 | |
|---|---|---|
| 92 | 92 | SET_TILE_INFO(region, tile, color, 0); |
| 93 | 93 | } |
| 94 | 94 | |
| 95 | static void draw_sprites( running_machine &machine, bitmap_t *bitmap, const rectangle | |
| 95 | static void draw_sprites( running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect, int pri ) | |
| 96 | 96 | { |
| 97 | 97 | goal92_state *state = machine.driver_data<goal92_state>(); |
| 98 | 98 | UINT16 *buffered_spriteram16 = state->m_buffered_spriteram; |
| r13798 | r13799 | |
| 169 | 169 | tilemap_set_scrolly(state->m_fg_layer, 0, state->m_scrollram[3] + 8); |
| 170 | 170 | } |
| 171 | 171 | |
| 172 | bitmap->fill(get_black_pen(screen.machine()), | |
| 172 | bitmap->fill(get_black_pen(screen.machine()), | |
| 173 | 173 | |
| 174 | 174 | tilemap_draw(bitmap, cliprect, state->m_bg_layer, 0, 0); |
| 175 | 175 | draw_sprites(screen.machine(), bitmap, cliprect, 2); |
| r13798 | r13799 | |
|---|---|---|
| 358 | 358 | static void custom_tilemap_draw( |
| 359 | 359 | device_t *device, |
| 360 | 360 | bitmap_t *bitmap, |
| 361 | const rectangle | |
| 361 | const rectangle &cliprect, | |
| 362 | 362 | tilemap_t *tilemap0_8x8, |
| 363 | 363 | tilemap_t *tilemap0_16x16, |
| 364 | 364 | tilemap_t *tilemap1_8x8, |
| r13798 | r13799 | |
| 393 | 393 | if (!BIT(control0, 7)) |
| 394 | 394 | return; |
| 395 | 395 | |
| 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; | |
| 398 | 398 | |
| 399 | 399 | width_mask = src_bitmap0->width() - 1; |
| 400 | 400 | height_mask = src_bitmap0->height() - 1; |
| r13798 | r13799 | |
| 862 | 862 | |
| 863 | 863 | /*****************************************************************************************/ |
| 864 | 864 | |
| 865 | void deco16ic_tilemap_1_draw( device_t *device, bitmap_t *bitmap, const rectangle | |
| 865 | void deco16ic_tilemap_1_draw( device_t *device, bitmap_t *bitmap, const rectangle &cliprect, int flags, UINT32 priority ) | |
| 866 | 866 | { |
| 867 | 867 | deco16ic_state *deco16ic = get_safe_token(device); |
| 868 | 868 | |
| r13798 | r13799 | |
| 879 | 879 | } |
| 880 | 880 | } |
| 881 | 881 | |
| 882 | void deco16ic_tilemap_2_draw(device_t *device, bitmap_t *bitmap, const rectangle | |
| 882 | void deco16ic_tilemap_2_draw(device_t *device, bitmap_t *bitmap, const rectangle &cliprect, int flags, UINT32 priority) | |
| 883 | 883 | { |
| 884 | 884 | deco16ic_state *deco16ic = get_safe_token(device); |
| 885 | 885 | |
| r13798 | r13799 | |
| 900 | 900 | /*****************************************************************************************/ |
| 901 | 901 | |
| 902 | 902 | // Combines the output of two 4BPP tilemaps into an 8BPP tilemap |
| 903 | void deco16ic_tilemap_12_combine_draw(device_t *device, bitmap_t *bitmap, const rectangle | |
| 903 | void deco16ic_tilemap_12_combine_draw(device_t *device, bitmap_t *bitmap, const rectangle &cliprect, int flags, UINT32 priority, int is_tattoo) | |
| 904 | 904 | { |
| 905 | 905 | deco16ic_state *deco16ic = get_safe_token(device); |
| 906 | 906 | 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); |
| r13798 | r13799 | |
|---|---|---|
| 63 | 63 | |
| 64 | 64 | konami_sortlayers4(layers, layerpri); |
| 65 | 65 | |
| 66 | screen.machine().priority_bitmap->fill(0, | |
| 66 | screen.machine().priority_bitmap->fill(0, | |
| 67 | 67 | |
| 68 | 68 | for (i = 0; i < 4; i++) |
| 69 | 69 | { |
| r13798 | r13799 | |
|---|---|---|
| 198 | 198 | |
| 199 | 199 | ***************************************************************************/ |
| 200 | 200 | |
| 201 | static void draw_sprites( running_machine &machine, bitmap_t *bitmap, const rectangle | |
| 201 | static void draw_sprites( running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect ) | |
| 202 | 202 | { |
| 203 | 203 | _1942_state *state = machine.driver_data<_1942_state>(); |
| 204 | 204 | int offs; |
| r13798 | r13799 | |
|---|---|---|
| 34 | 34 | |
| 35 | 35 | tilemap_mark_all_tiles_dirty(state->m_bg_tilemap); |
| 36 | 36 | |
| 37 | bitmap->fill(0, | |
| 37 | bitmap->fill(0, | |
| 38 | 38 | |
| 39 | 39 | /* draw sprites */ |
| 40 | 40 |
| r13798 | r13799 | |
|---|---|---|
| 74 | 74 | |
| 75 | 75 | void deco16ic_pf_update(device_t *device, const UINT16 *rowscroll_1_ptr, const UINT16 *rowscroll_2_ptr); |
| 76 | 76 | |
| 77 | void deco16ic_tilemap_1_draw(device_t *device, bitmap_t *bitmap, const rectangle *cliprect, int flags, UINT32 priority); | |
| 78 | void deco16ic_tilemap_2_draw(device_t *device, bitmap_t *bitmap, const rectangle *cliprect, int flags, UINT32 priority); | |
| 77 | void deco16ic_tilemap_1_draw(device_t *device, bitmap_t *bitmap, const rectangle &cliprect, int flags, UINT32 priority); | |
| 78 | void deco16ic_tilemap_2_draw(device_t *device, bitmap_t *bitmap, const rectangle &cliprect, int flags, UINT32 priority); | |
| 79 | 79 | |
| 80 | 80 | /* used by boogwing, nitrobal */ |
| 81 | void deco16ic_tilemap_12_combine_draw(device_t *device, bitmap_t *bitmap, const rectangle | |
| 81 | void deco16ic_tilemap_12_combine_draw(device_t *device, bitmap_t *bitmap, const rectangle &cliprect, int flags, UINT32 priority, int is_tattoo = false); | |
| 82 | 82 | |
| 83 | 83 | /* used by robocop2 */ |
| 84 | 84 | void deco16ic_set_tilemap_colour_mask(device_t *device, int tmap, int mask); |
| r13798 | r13799 | |
|---|---|---|
| 145 | 145 | -------X XXXXXXXX |
| 146 | 146 | -------- YYYYYYYY */ |
| 147 | 147 | |
| 148 | static void bloodbro_draw_sprites(running_machine &machine, bitmap_t *bitmap, const rectangle | |
| 148 | static void bloodbro_draw_sprites(running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect) | |
| 149 | 149 | { |
| 150 | 150 | bloodbro_state *state = machine.driver_data<bloodbro_state>(); |
| 151 | 151 | UINT16 *spriteram16 = state->m_spriteram; |
| r13798 | r13799 | |
| 194 | 194 | -------X XXXXXXXX |
| 195 | 195 | */ |
| 196 | 196 | |
| 197 | static void weststry_draw_sprites(running_machine &machine, bitmap_t *bitmap, const rectangle | |
| 197 | static void weststry_draw_sprites(running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect) | |
| 198 | 198 | { |
| 199 | 199 | bloodbro_state *state = machine.driver_data<bloodbro_state>(); |
| 200 | 200 | UINT16 *spriteram16 = state->m_spriteram; |
| r13798 | r13799 | |
| 240 | 240 | tilemap_set_scrollx(state->m_fg_tilemap,0,state->m_scroll[0x12]); |
| 241 | 241 | tilemap_set_scrolly(state->m_fg_tilemap,0,state->m_scroll[0x13]); |
| 242 | 242 | |
| 243 | screen.machine().priority_bitmap->fill(0, | |
| 243 | screen.machine().priority_bitmap->fill(0, | |
| 244 | 244 | |
| 245 | 245 | tilemap_draw(bitmap,cliprect,state->m_bg_tilemap,0,0); |
| 246 | 246 | tilemap_draw(bitmap,cliprect,state->m_fg_tilemap,0,1); |
| r13798 | r13799 | |
| 257 | 257 | // tilemap_set_scrollx(state->m_fg_tilemap,0,state->m_scroll[0x12]); |
| 258 | 258 | // tilemap_set_scrolly(state->m_fg_tilemap,0,state->m_scroll[0x13]); |
| 259 | 259 | |
| 260 | screen.machine().priority_bitmap->fill(0, | |
| 260 | screen.machine().priority_bitmap->fill(0, | |
| 261 | 261 | |
| 262 | 262 | tilemap_draw(bitmap,cliprect,state->m_bg_tilemap,0,0); |
| 263 | 263 | tilemap_draw(bitmap,cliprect,state->m_fg_tilemap,0,1); |
| r13798 | r13799 | |
| 275 | 275 | tilemap_set_scrollx(state->m_fg_tilemap,0,state->m_scroll[0x0a]); |
| 276 | 276 | tilemap_set_scrolly(state->m_fg_tilemap,0,state->m_scroll[0x0b]); /* ? */ |
| 277 | 277 | |
| 278 | screen.machine().priority_bitmap->fill(0, | |
| 278 | screen.machine().priority_bitmap->fill(0, | |
| 279 | 279 | |
| 280 | 280 | tilemap_draw(bitmap,cliprect,state->m_bg_tilemap,0,0); |
| 281 | 281 | tilemap_draw(bitmap,cliprect,state->m_fg_tilemap,0,1); |
| r13798 | r13799 | |
|---|---|---|
| 119 | 119 | } |
| 120 | 120 | } |
| 121 | 121 | |
| 122 | static void draw_sprites(running_machine &machine, bitmap_t *bitmap,const rectangle | |
| 122 | static void draw_sprites(running_machine &machine, bitmap_t *bitmap,const rectangle &cliprect,int pri_mask) | |
| 123 | 123 | { |
| 124 | 124 | raiden_state *state = machine.driver_data<raiden_state>(); |
| 125 | 125 | UINT16 *buffered_spriteram16 = machine.generic.buffered_spriteram.u16; |
| r13798 | r13799 | |
|---|---|---|
| 75 | 75 | tilemap_set_transparent_pen(state->m_fg_tilemap, 0); |
| 76 | 76 | } |
| 77 | 77 | |
| 78 | static void draw_sprites( running_machine &machine, bitmap_t *bitmap, const rectangle | |
| 78 | static void draw_sprites( running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect ) | |
| 79 | 79 | { |
| 80 | 80 | bombjack_state *state = machine.driver_data<bombjack_state>(); |
| 81 | 81 | int offs; |
| r13798 | r13799 | |
|---|---|---|
| 140 | 140 | int x, y, i; |
| 141 | 141 | |
| 142 | 142 | /* draw scanlines from the VRAM directly */ |
| 143 | for (y = cliprect | |
| 143 | for (y = cliprect. | |
| 144 | 144 | { |
| 145 | 145 | /* non-flipped: draw directly from the bitmap */ |
| 146 | 146 | if (!state->m_cocktail_flip) |
| r13798 | r13799 | |
| 184 | 184 | currxor = 0xff; |
| 185 | 185 | } |
| 186 | 186 | |
| 187 | if (ypos >= (16 + GRIDLEE_VBEND) && ypos >= cliprect | |
| 187 | if (ypos >= (16 + GRIDLEE_VBEND) && ypos >= cliprect. | |
| 188 | 188 | { |
| 189 | 189 | int currx = xpos; |
| 190 | 190 |
| r13798 | r13799 | |
|---|---|---|
| 446 | 446 | } |
| 447 | 447 | |
| 448 | 448 | |
| 449 | static void plot_star( running_machine &machine, bitmap_t *bitmap, const rectangle | |
| 449 | static void plot_star( running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect, int x, int y, int color ) | |
| 450 | 450 | { |
| 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) | |
| 453 | 453 | return; |
| 454 | 454 | |
| 455 | 455 | if (flip_screen_x_get(machine)) |
| r13798 | r13799 | |
| 462 | 462 | bitmap->pix16(y, x) = STARS_COLOR_BASE + color; |
| 463 | 463 | } |
| 464 | 464 | |
| 465 | static void draw_stars( running_machine &machine, bitmap_t *bitmap, const rectangle | |
| 465 | static void draw_stars( running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect ) | |
| 466 | 466 | { |
| 467 | 467 | rallyx_state *state = machine.driver_data<rallyx_state>(); |
| 468 | 468 | int offs; |
| r13798 | r13799 | |
| 478 | 478 | } |
| 479 | 479 | |
| 480 | 480 | |
| 481 | static void rallyx_draw_sprites( running_machine &machine, bitmap_t *bitmap, const rectangle | |
| 481 | static void rallyx_draw_sprites( running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect, int displacement ) | |
| 482 | 482 | { |
| 483 | 483 | rallyx_state *state = machine.driver_data<rallyx_state>(); |
| 484 | 484 | UINT8 *spriteram = state->m_spriteram; |
| r13798 | r13799 | |
| 505 | 505 | } |
| 506 | 506 | } |
| 507 | 507 | |
| 508 | static void locomotn_draw_sprites( running_machine &machine, bitmap_t *bitmap, const rectangle | |
| 508 | static void locomotn_draw_sprites( running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect, int displacement ) | |
| 509 | 509 | { |
| 510 | 510 | rallyx_state *state = machine.driver_data<rallyx_state>(); |
| 511 | 511 | UINT8 *spriteram = state->m_spriteram; |
| r13798 | r13799 | |
| 529 | 529 | } |
| 530 | 530 | } |
| 531 | 531 | |
| 532 | static void rallyx_draw_bullets( running_machine &machine, bitmap_t *bitmap, const rectangle | |
| 532 | static void rallyx_draw_bullets( running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect, int transpen ) | |
| 533 | 533 | { |
| 534 | 534 | rallyx_state *state = machine.driver_data<rallyx_state>(); |
| 535 | 535 | int offs; |
| r13798 | r13799 | |
| 560 | 560 | } |
| 561 | 561 | } |
| 562 | 562 | |
| 563 | static void jungler_draw_bullets( running_machine &machine, bitmap_t *bitmap, const rectangle | |
| 563 | static void jungler_draw_bullets( running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect, int transpen ) | |
| 564 | 564 | { |
| 565 | 565 | rallyx_state *state = machine.driver_data<rallyx_state>(); |
| 566 | 566 | int offs; |
| r13798 | r13799 | |
| 589 | 589 | } |
| 590 | 590 | } |
| 591 | 591 | |
| 592 | static void locomotn_draw_bullets( running_machine &machine, bitmap_t *bitmap, const rectangle | |
| 592 | static void locomotn_draw_bullets( running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect, int transpen ) | |
| 593 | 593 | { |
| 594 | 594 | rallyx_state *state = machine.driver_data<rallyx_state>(); |
| 595 | 595 | int offs; |
| r13798 | r13799 | |
| 632 | 632 | rallyx_state *state = screen.machine().driver_data<rallyx_state>(); |
| 633 | 633 | /* the radar tilemap is just 8x32. We rely on the tilemap code to repeat it across |
| 634 | 634 | 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; | |
| 637 | 637 | |
| 638 | 638 | if (flip_screen_get(screen.machine())) |
| 639 | 639 | { |
| r13798 | r13799 | |
| 646 | 646 | fg_clip.min_x = 28 * 8; |
| 647 | 647 | } |
| 648 | 648 | |
| 649 | screen.machine().priority_bitmap->fill(0, | |
| 649 | screen.machine().priority_bitmap->fill(0, | |
| 650 | 650 | |
| 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); | |
| 655 | 655 | |
| 656 | 656 | rallyx_draw_bullets(screen.machine(), bitmap, cliprect, TRUE); |
| 657 | 657 | rallyx_draw_sprites(screen.machine(), bitmap, cliprect, 1); |
| r13798 | r13799 | |
| 666 | 666 | rallyx_state *state = screen.machine().driver_data<rallyx_state>(); |
| 667 | 667 | /* the radar tilemap is just 8x32. We rely on the tilemap code to repeat it across |
| 668 | 668 | 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; | |
| 671 | 671 | |
| 672 | 672 | if (flip_screen_get(screen.machine())) |
| 673 | 673 | { |
| r13798 | r13799 | |
| 680 | 680 | fg_clip.min_x = 28 * 8; |
| 681 | 681 | } |
| 682 | 682 | |
| 683 | screen.machine().priority_bitmap->fill(0, | |
| 683 | screen.machine().priority_bitmap->fill(0, | |
| 684 | 684 | |
| 685 | 685 | /* 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); | |
| 690 | 690 | |
| 691 | 691 | jungler_draw_bullets(screen.machine(), bitmap, cliprect, TRUE); |
| 692 | 692 | rallyx_draw_sprites(screen.machine(), bitmap, cliprect, 0); |
| r13798 | r13799 | |
| 704 | 704 | rallyx_state *state = screen.machine().driver_data<rallyx_state>(); |
| 705 | 705 | /* the radar tilemap is just 8x32. We rely on the tilemap code to repeat it across |
| 706 | 706 | 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; | |
| 709 | 709 | |
| 710 | 710 | if (flip_screen_get(screen.machine())) |
| 711 | 711 | { |
| r13798 | r13799 | |
| 727 | 727 | fg_clip.min_x = 28 * 8; |
| 728 | 728 | } |
| 729 | 729 | |
| 730 | screen.machine().priority_bitmap->fill(0, | |
| 730 | screen.machine().priority_bitmap->fill(0, | |
| 731 | 731 | |
| 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); | |
| 736 | 736 | |
| 737 | 737 | locomotn_draw_bullets(screen.machine(), bitmap, cliprect, TRUE); |
| 738 | 738 | locomotn_draw_sprites(screen.machine(), bitmap, cliprect, 0); |
| r13798 | r13799 | |
|---|---|---|
| 221 | 221 | |
| 222 | 222 | ***************************************************************************/ |
| 223 | 223 | |
| 224 | static void unico_draw_sprites(running_machine &machine, bitmap_t *bitmap,const rectangle | |
| 224 | static void unico_draw_sprites(running_machine &machine, bitmap_t *bitmap,const rectangle &cliprect) | |
| 225 | 225 | { |
| 226 | 226 | unico_state *state = machine.driver_data<unico_state>(); |
| 227 | 227 | UINT16 *spriteram16 = state->m_spriteram; |
| r13798 | r13799 | |
| 276 | 276 | } |
| 277 | 277 | } |
| 278 | 278 | |
| 279 | static void zeropnt2_draw_sprites(running_machine &machine, bitmap_t *bitmap,const rectangle | |
| 279 | static void zeropnt2_draw_sprites(running_machine &machine, bitmap_t *bitmap,const rectangle &cliprect) | |
| 280 | 280 | { |
| 281 | 281 | unico_state *state = machine.driver_data<unico_state>(); |
| 282 | 282 | UINT32 *spriteram32 = (UINT32 *)state->m_spriteram; |
| r13798 | r13799 | |
| 368 | 368 | #endif |
| 369 | 369 | |
| 370 | 370 | /* 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); | |
| 373 | 373 | |
| 374 | 374 | if (layers_ctrl & 1) tilemap_draw(bitmap,cliprect,state->m_tilemap[0],0,1); |
| 375 | 375 | if (layers_ctrl & 2) tilemap_draw(bitmap,cliprect,state->m_tilemap[1],0,2); |
| r13798 | r13799 | |
| 408 | 408 | #endif |
| 409 | 409 | |
| 410 | 410 | /* 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); | |
| 413 | 413 | |
| 414 | 414 | if (layers_ctrl & 1) tilemap_draw(bitmap,cliprect,state->m_tilemap[0],0,1); |
| 415 | 415 | if (layers_ctrl & 2) tilemap_draw(bitmap,cliprect,state->m_tilemap[1],0,2); |
| r13798 | r13799 | |
|---|---|---|
| 59 | 59 | { |
| 60 | 60 | blockhl_state *state = screen.machine().driver_data<blockhl_state>(); |
| 61 | 61 | |
| 62 | screen.machine().priority_bitmap->fill(0, | |
| 62 | screen.machine().priority_bitmap->fill(0, | |
| 63 | 63 | |
| 64 | 64 | k052109_tilemap_update(state->m_k052109); |
| 65 | 65 |
| r13798 | r13799 | |
|---|---|---|
| 169 | 169 | |
| 170 | 170 | ****************************************************************/ |
| 171 | 171 | |
| 172 | static void draw_sprites( running_machine &machine, bitmap_t *bitmap, const rectangle | |
| 172 | static void draw_sprites( running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect, int y_offs ) | |
| 173 | 173 | { |
| 174 | 174 | gcpinbal_state *state = machine.driver_data<gcpinbal_state>(); |
| 175 | 175 | UINT16 *spriteram = state->m_spriteram; |
| r13798 | r13799 | |
| 292 | 292 | tilemap_set_scrolly(state->m_tilemap[i], 0, state->m_scrolly[i]); |
| 293 | 293 | } |
| 294 | 294 | |
| 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); | |
| 297 | 297 | |
| 298 | 298 | layer[0] = 0; |
| 299 | 299 | layer[1] = 1; |
| r13798 | r13799 | |
|---|---|---|
| 213 | 213 | |
| 214 | 214 | ***************************************************************************/ |
| 215 | 215 | |
| 216 | static void draw_sprites(running_machine &machine, bitmap_t *bitmap,const rectangle | |
| 216 | static void draw_sprites(running_machine &machine, bitmap_t *bitmap,const rectangle &cliprect) | |
| 217 | 217 | { |
| 218 | 218 | realbrk_state *state = machine.driver_data<realbrk_state>(); |
| 219 | 219 | UINT16 *spriteram16 = state->m_spriteram; |
| r13798 | r13799 | |
| 302 | 302 | { |
| 303 | 303 | state->m_tmpbitmap0->fill(0, spritetile_clip ); |
| 304 | 304 | state->m_tmpbitmap1->fill(0, spritetile_clip ); |
| 305 | drawgfxzoom_transpen( state->m_tmpbitmap0, | |
| 305 | drawgfxzoom_transpen( state->m_tmpbitmap0, | |
| 306 | 306 | code++, |
| 307 | 307 | color, |
| 308 | 308 | flipx, flipy, |
| r13798 | r13799 | |
| 316 | 316 | switch( rot ) |
| 317 | 317 | { |
| 318 | 318 | case 0x10: // rot 90 |
| 319 | copyrozbitmap_trans( state->m_tmpbitmap1, | |
| 319 | copyrozbitmap_trans( state->m_tmpbitmap1, state->m_tmpbitmap1->cliprect(), state->m_tmpbitmap0, | |
| 320 | 320 | (UINT32)0<<16, |
| 321 | 321 | (UINT32)16<<16, |
| 322 | 322 | 0 << 16, |
| r13798 | r13799 | |
| 332 | 332 | break; |
| 333 | 333 | |
| 334 | 334 | case 0x20: // rot 180 |
| 335 | copyrozbitmap_trans( state->m_tmpbitmap1, | |
| 335 | copyrozbitmap_trans( state->m_tmpbitmap1, state->m_tmpbitmap1->cliprect(), state->m_tmpbitmap0, | |
| 336 | 336 | (UINT32)16<<16, |
| 337 | 337 | (UINT32)16<<16, |
| 338 | 338 | -1 << 16, |
| r13798 | r13799 | |
| 348 | 348 | break; |
| 349 | 349 | |
| 350 | 350 | case 0x30: // rot 270 |
| 351 | copyrozbitmap_trans( state->m_tmpbitmap1, | |
| 351 | copyrozbitmap_trans( state->m_tmpbitmap1, state->m_tmpbitmap1->cliprect(), state->m_tmpbitmap0, | |
| 352 | 352 | (UINT32)16<<16, |
| 353 | 353 | (UINT32)0<<16, |
| 354 | 354 | 0 << 16, |
| r13798 | r13799 | |
| 380 | 380 | |
| 381 | 381 | /* DaiDaiKakumei */ |
| 382 | 382 | /* layer : 0== bghigh<spr 1== bglow<spr<bghigh 2==spr<bglow 3==boarder */ |
| 383 | static void dai2kaku_draw_sprites(running_machine &machine, bitmap_t *bitmap,const rectangle | |
| 383 | static void dai2kaku_draw_sprites(running_machine &machine, bitmap_t *bitmap,const rectangle &cliprect, int layer) | |
| 384 | 384 | { |
| 385 | 385 | realbrk_state *state = machine.driver_data<realbrk_state>(); |
| 386 | 386 | UINT16 *spriteram16 = state->m_spriteram; |
| r13798 | r13799 | |
| 522 | 522 | |
| 523 | 523 | if (state->m_disable_video) |
| 524 | 524 | { |
| 525 | bitmap->fill(get_black_pen(screen.machine()), | |
| 525 | bitmap->fill(get_black_pen(screen.machine()), | |
| 526 | 526 | return 0; |
| 527 | 527 | } |
| 528 | 528 | else |
| 529 | bitmap->fill(state->m_vregs[0xc/2] & 0x7fff, | |
| 529 | bitmap->fill(state->m_vregs[0xc/2] & 0x7fff, | |
| 530 | 530 | |
| 531 | 531 | if (layers_ctrl & 2) tilemap_draw(bitmap,cliprect,state->m_tilemap_1,0,0); |
| 532 | 532 | if (layers_ctrl & 1) tilemap_draw(bitmap,cliprect,state->m_tilemap_0,0,0); |
| r13798 | r13799 | |
| 593 | 593 | |
| 594 | 594 | if (state->m_disable_video) |
| 595 | 595 | { |
| 596 | bitmap->fill(get_black_pen(screen.machine()), | |
| 596 | bitmap->fill(get_black_pen(screen.machine()), | |
| 597 | 597 | return 0; |
| 598 | 598 | } |
| 599 | 599 | else |
| 600 | bitmap->fill(state->m_vregs[0xc/2] & 0x7fff, | |
| 600 | bitmap->fill(state->m_vregs[0xc/2] & 0x7fff, | |
| 601 | 601 | |
| 602 | 602 | |
| 603 | 603 |
| r13798 | r13799 | |
|---|---|---|
| 54 | 54 | |
| 55 | 55 | ********************************************************/ |
| 56 | 56 | |
| 57 | static void draw_sprites(running_machine &machine, bitmap_t *bitmap,const rectangle | |
| 57 | static void draw_sprites(running_machine &machine, bitmap_t *bitmap,const rectangle &cliprect,const int *primasks,int x_offs,int y_offs) | |
| 58 | 58 | { |
| 59 | 59 | superchs_state *state = machine.driver_data<superchs_state>(); |
| 60 | 60 | UINT32 *spriteram32 = state->m_spriteram; |
| r13798 | r13799 | |
| 215 | 215 | layer[3] = (priority & 0x000f) >> 0; /* tells us which is top */ |
| 216 | 216 | layer[4] = 4; /* text layer always over bg layers */ |
| 217 | 217 | |
| 218 | screen.machine().priority_bitmap->fill(0, | |
| 218 | screen.machine().priority_bitmap->fill(0, | |
| 219 | 219 | |
| 220 | 220 | /* We have to assume 2nd to bottom layer is always underneath |
| 221 | 221 | sprites as pdrawgfx cannot yet cope with more than 4 layers */ |
| r13798 | r13799 | |
|---|---|---|
| 80 | 80 | k052109_tilemap_update(state->m_k052109); |
| 81 | 81 | |
| 82 | 82 | /* note: FIX layer is not used */ |
| 83 | bitmap->fill(state->m_layer_colorbase[1], | |
| 83 | bitmap->fill(state->m_layer_colorbase[1], | |
| 84 | 84 | // if (state->m_video_enable) |
| 85 | 85 | { |
| 86 | 86 | k051960_sprites_draw(state->m_k051960, bitmap, cliprect, 1, 1); |
| r13798 | r13799 | |
|---|---|---|
| 25 | 25 | colortable_entry_set_value(machine.colortable, i, i); |
| 26 | 26 | } |
| 27 | 27 | |
| 28 | static void draw_sprites(running_machine &machine, bitmap_t *bitmap, const rectangle | |
| 28 | static void draw_sprites(running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect ) | |
| 29 | 29 | { |
| 30 | 30 | flower_state *state = machine.driver_data<flower_state>(); |
| 31 | 31 | const gfx_element *gfx = machine.gfx[1]; |
| r13798 | r13799 | |
| 166 | 166 | SCREEN_UPDATE( flower ) |
| 167 | 167 | { |
| 168 | 168 | flower_state *state = screen.machine().driver_data<flower_state>(); |
| 169 | rectangle myclip = | |
| 169 | rectangle myclip = | |
| 170 | 170 | |
| 171 | 171 | tilemap_set_scrolly(state->m_bg0_tilemap,0, state->m_bg0_scroll[0]+16); |
| 172 | 172 | tilemap_set_scrolly(state->m_bg1_tilemap,0, state->m_bg1_scroll[0]+16); |
| r13798 | r13799 | |
| 178 | 178 | |
| 179 | 179 | if(flip_screen_get(screen.machine())) |
| 180 | 180 | { |
| 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; | |
| 183 | 183 | } |
| 184 | 184 | else |
| 185 | 185 | { |
| 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; | |
| 188 | 188 | } |
| 189 | 189 | |
| 190 | 190 | tilemap_draw(bitmap,cliprect,state->m_text_tilemap,0,0); |
| 191 | tilemap_draw(bitmap, | |
| 191 | tilemap_draw(bitmap, | |
| 192 | 192 | return 0; |
| 193 | 193 | } |
| 194 | 194 |
| r13798 | r13799 | |
|---|---|---|
| 241 | 241 | |
| 242 | 242 | /******************************************************************************/ |
| 243 | 243 | |
| 244 | static void draw_sprites(running_machine &machine, bitmap_t *bitmap,const rectangle | |
| 244 | static void draw_sprites(running_machine &machine, bitmap_t *bitmap,const rectangle &clip,int pri) | |
| 245 | 245 | { |
| 246 | 246 | battlera_state *state = machine.driver_data<battlera_state>(); |
| 247 | 247 | int offs,my,mx,code,code2,fx,fy,cgy=0,cgx,colour,i,yinc; |
| r13798 | r13799 | |
| 329 | 329 | /* If this tile was changed OR tilemap was changed, redraw */ |
| 330 | 330 | if (state->m_vram_dirty[offs/2]) { |
| 331 | 331 | state->m_vram_dirty[offs/2]=0; |
| 332 | drawgfx_opaque(state->m_tile_bitmap, | |
| 332 | drawgfx_opaque(state->m_tile_bitmap,state->m_tile_bitmap->cliprect(),screen.machine().gfx[0], | |
| 333 | 333 | code, |
| 334 | 334 | state->m_HuC6270_vram[offs] >> 4, |
| 335 | 335 | 0,0, |
| 336 | 336 | 8*mx,8*my); |
| 337 | drawgfx_opaque(state->m_front_bitmap, | |
| 337 | drawgfx_opaque(state->m_front_bitmap,state->m_tile_bitmap->cliprect(),screen.machine().gfx[2], | |
| 338 | 338 | 0, |
| 339 | 339 | 0, /* fill the spot with pen 256 */ |
| 340 | 340 | 0,0, |
| 341 | 341 | 8*mx,8*my); |
| 342 | drawgfx_transmask(state->m_front_bitmap, | |
| 342 | drawgfx_transmask(state->m_front_bitmap,state->m_tile_bitmap->cliprect(),screen.machine().gfx[0], | |
| 343 | 343 | code, |
| 344 | 344 | state->m_HuC6270_vram[offs] >> 4, |
| 345 | 345 | 0,0, |
| r13798 | r13799 | |
| 349 | 349 | |
| 350 | 350 | /* Render bitmap */ |
| 351 | 351 | scrollx=-state->m_HuC6270_registers[7]; |
| 352 | scrolly=-state->m_HuC6270_registers[8]+cliprect | |
| 352 | scrolly=-state->m_HuC6270_registers[8]+cliprect. | |
| 353 | 353 | |
| 354 | 354 | copyscrollbitmap(bitmap,state->m_tile_bitmap,1,&scrollx,1,&scrolly,cliprect); |
| 355 | 355 |
| r13798 | r13799 | |
|---|---|---|
| 172 | 172 | |
| 173 | 173 | ***************************************************************************/ |
| 174 | 174 | |
| 175 | static void draw_sprites(running_machine &machine, bitmap_t *bitmap,const rectangle | |
| 175 | static void draw_sprites(running_machine &machine, bitmap_t *bitmap,const rectangle &cliprect) | |
| 176 | 176 | { |
| 177 | 177 | xain_state *state = machine.driver_data<xain_state>(); |
| 178 | 178 | UINT8 *spriteram = state->m_spriteram; |
| r13798 | r13799 | |
|---|---|---|
| 243 | 243 | |
| 244 | 244 | ***************************************************************************/ |
| 245 | 245 | |
| 246 | static void draw_sprites( running_machine &machine, bitmap_t *bitmap,const rectangle | |
| 246 | static void draw_sprites( running_machine &machine, bitmap_t *bitmap,const rectangle &cliprect ) | |
| 247 | 247 | { |
| 248 | 248 | mrdo_state *state = machine.driver_data<mrdo_state>(); |
| 249 | 249 | UINT8 *spriteram = state->m_spriteram; |
| r13798 | r13799 | |
| 265 | 265 | { |
| 266 | 266 | mrdo_state *state = screen.machine().driver_data<mrdo_state>(); |
| 267 | 267 | |
| 268 | bitmap->fill(0, | |
| 268 | bitmap->fill(0, | |
| 269 | 269 | tilemap_draw(bitmap, cliprect, state->m_bg_tilemap, 0, 0); |
| 270 | 270 | tilemap_draw(bitmap, cliprect, state->m_fg_tilemap, 0, 0); |
| 271 | 271 | draw_sprites(screen.machine(), bitmap, cliprect); |
| r13798 | r13799 | |
|---|---|---|
| 298 | 298 | 15 xxxxxxxx Y position |
| 299 | 299 | */ |
| 300 | 300 | |
| 301 | static void draw_sprites(running_machine &machine, bitmap_t *bitmap, const rectangle | |
| 301 | static void draw_sprites(running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect) | |
| 302 | 302 | { |
| 303 | 303 | namcos1_state *state = machine.driver_data<namcos1_state>(); |
| 304 | 304 | UINT8 *spriteram = state->m_spriteram + 0x800; |
| r13798 | r13799 | |
| 374 | 374 | { |
| 375 | 375 | namcos1_state *state = screen.machine().driver_data<namcos1_state>(); |
| 376 | 376 | int i, j, scrollx, scrolly, priority; |
| 377 | rectangle new_clip = | |
| 377 | rectangle new_clip = | |
| 378 | 378 | |
| 379 | 379 | /* flip screen is embedded in the sprite control registers */ |
| 380 | 380 | /* can't use flip_screen_set(screen.machine(), ) because the visible area is asymmetrical */ |
| r13798 | r13799 | |
| 383 | 383 | |
| 384 | 384 | |
| 385 | 385 | /* background color */ |
| 386 | bitmap->fill(get_black_pen(screen.machine()), | |
| 386 | bitmap->fill(get_black_pen(screen.machine()), | |
| 387 | 387 | |
| 388 | 388 | /* berabohm uses asymmetrical visibility windows to iris on the character */ |
| 389 | 389 | i = ((state->m_cus116[0] << 8) | state->m_cus116[1]) - 1; // min x |
| r13798 | r13799 | |
| 431 | 431 | for (i = 0;i < 6;i++) |
| 432 | 432 | { |
| 433 | 433 | if (state->m_playfield_control[16 + i] == priority) |
| 434 | tilemap_draw_primask(bitmap, | |
| 434 | tilemap_draw_primask(bitmap, | |
| 435 | 435 | } |
| 436 | 436 | } |
| 437 | 437 | |
| 438 | draw_sprites(screen.machine(), bitmap, | |
| 438 | draw_sprites(screen.machine(), bitmap, | |
| 439 | 439 | return 0; |
| 440 | 440 | } |
| 441 | 441 |
| r13798 | r13799 | |
|---|---|---|
| 99 | 99 | |
| 100 | 100 | k052109_tilemap_update(state->m_k052109); |
| 101 | 101 | |
| 102 | screen.machine().priority_bitmap->fill(0, | |
| 102 | screen.machine().priority_bitmap->fill(0, | |
| 103 | 103 | k052109_tilemap_draw(state->m_k052109, bitmap, cliprect, 1, TILEMAP_DRAW_OPAQUE, 1); |
| 104 | 104 | k052109_tilemap_draw(state->m_k052109, bitmap, cliprect, 2, 1, 2); /* low priority part of layer */ |
| 105 | 105 | k052109_tilemap_draw(state->m_k052109, bitmap, cliprect, 2, 0, 4); /* high priority part of layer */ |
| r13798 | r13799 | |
|---|---|---|
| 261 | 261 | sparklebase = (screen.frame_number() * (UINT64)(width * height)) % RNG_PERIOD; |
| 262 | 262 | |
| 263 | 263 | /* iterate over scanlines */ |
| 264 | for (y = cliprect | |
| 264 | for (y = cliprect. | |
| 265 | 265 | { |
| 266 | 266 | UINT16 *dest = &bitmap->pix16(y); |
| 267 | 267 | int effy = mame_vpos_to_astrocade_vpos(y); |
| r13798 | r13799 | |
| 336 | 336 | int y; |
| 337 | 337 | |
| 338 | 338 | /* iterate over scanlines */ |
| 339 | for (y = cliprect | |
| 339 | for (y = cliprect. | |
| 340 | 340 | { |
| 341 | 341 | int effy = mame_vpos_to_astrocade_vpos(y); |
| 342 | 342 | UINT16 *dest = &bitmap->pix16(y); |
| r13798 | r13799 | |
|---|---|---|
| 353 | 353 | } |
| 354 | 354 | |
| 355 | 355 | |
| 356 | static void draw_sprites( running_machine &machine, bitmap_t *bitmap, const rectangle | |
| 356 | static void draw_sprites( running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect, int colormask, int prioritymask, int priority ) | |
| 357 | 357 | { |
| 358 | 358 | m62_state *state = machine.driver_data<m62_state>(); |
| 359 | 359 | int offs; |
| r13798 | r13799 | |
| 576 | 576 | |
| 577 | 577 | if (state->m_ldrun3_topbottom_mask) |
| 578 | 578 | { |
| 579 | rectangle my_cliprect = | |
| 579 | rectangle my_cliprect = | |
| 580 | 580 | |
| 581 | 581 | my_cliprect.min_y = 0 * 8; |
| 582 | 582 | my_cliprect.max_y = 1 * 8 - 1; |
| r13798 | r13799 | |
|---|---|---|
| 135 | 135 | flipy = !flipy; |
| 136 | 136 | } |
| 137 | 137 | |
| 138 | drawgfx_opaque(state->m_tmpbitmap, | |
| 138 | drawgfx_opaque(state->m_tmpbitmap, state->m_tmpbitmap->cliprect(), screen.machine().gfx[1], | |
| 139 | 139 | ((int)state->m_videoram[offs]) + ((state->m_colorram[offs] & (1 << 7) ? 256 : 0) ), |
| 140 | 140 | (state->m_colorram[offs] & 0x0f) + 0x10, |
| 141 | 141 | flipx,flipy, |
| r13798 | r13799 | |
|---|---|---|
| 181 | 181 | ***************************************************************************/ |
| 182 | 182 | |
| 183 | 183 | |
| 184 | static void toki_draw_sprites(running_machine &machine, bitmap_t *bitmap,const rectangle | |
| 184 | static void toki_draw_sprites(running_machine &machine, bitmap_t *bitmap,const rectangle &cliprect) | |
| 185 | 185 | { |
| 186 | 186 | int x,y,xoffs,yoffs,tile,flipx,flipy,color,offs; |
| 187 | 187 | UINT16 *sprite_word; |
| r13798 | r13799 | |
| 224 | 224 | } |
| 225 | 225 | |
| 226 | 226 | |
| 227 | static void tokib_draw_sprites(running_machine &machine, bitmap_t *bitmap,const rectangle | |
| 227 | static void tokib_draw_sprites(running_machine &machine, bitmap_t *bitmap,const rectangle &cliprect) | |
| 228 | 228 | { |
| 229 | 229 | int x,y,tile,flipx,color,offs; |
| 230 | 230 | UINT16 *sprite_word; |
| r13798 | r13799 | |
|---|---|---|
| 274 | 274 | offset 3 xxxxxxxx x position |
| 275 | 275 | */ |
| 276 | 276 | |
| 277 | static void draw_sprites( running_machine &machine, bitmap_t *bitmap, const rectangle | |
| 277 | static void draw_sprites( running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect ) | |
| 278 | 278 | { |
| 279 | 279 | fortyl_state *state = machine.driver_data<fortyl_state>(); |
| 280 | 280 | UINT8 *spriteram = state->m_spriteram; |
| r13798 | r13799 | |
| 338 | 338 | } |
| 339 | 339 | } |
| 340 | 340 | |
| 341 | static void draw_pixram( running_machine &machine, bitmap_t *bitmap, const rectangle | |
| 341 | static void draw_pixram( running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect ) | |
| 342 | 342 | { |
| 343 | 343 | fortyl_state *state = machine.driver_data<fortyl_state>(); |
| 344 | 344 | int offs; |
| r13798 | r13799 | |
|---|---|---|
| 79 | 79 | state_save_register_global(machine, state->m_scrollx); |
| 80 | 80 | } |
| 81 | 81 | |
| 82 | static void draw_sprites(running_machine &machine, bitmap_t *bitmap, const rectangle | |
| 82 | static void draw_sprites(running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect) | |
| 83 | 83 | { |
| 84 | 84 | renegade_state *state = machine.driver_data<renegade_state>(); |
| 85 | 85 | UINT8 *source = state->m_spriteram; |
| r13798 | r13799 | |
|---|---|---|
| 476 | 476 | |
| 477 | 477 | ***************************************************************************/ |
| 478 | 478 | |
| 479 | static void draw_sprites(running_machine &machine, bitmap_t *bitmap, const rectangle | |
| 479 | static void draw_sprites(running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect ) | |
| 480 | 480 | { |
| 481 | 481 | galaga_state *state = machine.driver_data<galaga_state>(); |
| 482 | 482 | |
| r13798 | r13799 | |
| 530 | 530 | } |
| 531 | 531 | |
| 532 | 532 | |
| 533 | static void draw_stars(running_machine &machine, bitmap_t *bitmap, const rectangle | |
| 533 | static void draw_stars(running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect ) | |
| 534 | 534 | { |
| 535 | 535 | galaga_state *state = machine.driver_data<galaga_state>(); |
| 536 | 536 | /* draw the stars */ |
| r13798 | r13799 | |
| 557 | 557 | x = (star_seed_tab[star_cntr].x + state->m_stars_scrollx) % 256 + x_align; |
| 558 | 558 | y = (y_align + star_seed_tab[star_cntr].y + state->m_stars_scrolly) % 256; |
| 559 | 559 | |
| 560 | if (x >= cliprect | |
| 560 | if (x >= cliprect. | |
| 561 | 561 | bitmap->pix16(y, x) = STARS_COLOR_BASE + star_seed_tab[ star_cntr ].col; |
| 562 | 562 | } |
| 563 | 563 | |
| r13798 | r13799 | |
| 569 | 569 | { |
| 570 | 570 | galaga_state *state = screen.machine().driver_data<galaga_state>(); |
| 571 | 571 | |
| 572 | bitmap->fill(get_black_pen(screen.machine()), | |
| 572 | bitmap->fill(get_black_pen(screen.machine()), | |
| 573 | 573 | draw_stars(screen.machine(),bitmap,cliprect); |
| 574 | 574 | draw_sprites(screen.machine(),bitmap,cliprect); |
| 575 | 575 | tilemap_draw(bitmap,cliprect,state->m_fg_tilemap,0,0); |
| r13798 | r13799 | |
|---|---|---|
| 272 | 272 | * |
| 273 | 273 | *************************************/ |
| 274 | 274 | |
| 275 | static void draw_sprites( running_machine &machine, bitmap_t *bitmap, const rectangle | |
| 275 | static void draw_sprites( running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect, int reverse ) | |
| 276 | 276 | { |
| 277 | 277 | lasso_state *state = machine.driver_data<lasso_state>(); |
| 278 | 278 | const UINT8 *finish, *source; |
| r13798 | r13799 | |
| 326 | 326 | } |
| 327 | 327 | |
| 328 | 328 | |
| 329 | static void draw_lasso( running_machine &machine, bitmap_t *bitmap, const rectangle | |
| 329 | static void draw_lasso( running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect ) | |
| 330 | 330 | { |
| 331 | 331 | lasso_state *state = machine.driver_data<lasso_state>(); |
| 332 | 332 | offs_t offs; |
| r13798 | r13799 | |
| 342 | 342 | if (flip_screen_y_get(machine)) |
| 343 | 343 | y = ~y; |
| 344 | 344 | |
| 345 | if ((y < cliprect | |
| 345 | if ((y < cliprect. | |
| 346 | 346 | continue; |
| 347 | 347 | |
| 348 | 348 | x = (offs & 0x1f) << 3; |
| r13798 | r13799 | |
| 353 | 353 | |
| 354 | 354 | for (bit = 0; bit < 8; bit++) |
| 355 | 355 | { |
| 356 | if ((data & 0x80) && (x >= cliprect | |
| 356 | if ((data & 0x80) && (x >= cliprect. | |
| 357 | 357 | bitmap->pix16(y, x) = pen; |
| 358 | 358 | |
| 359 | 359 | if (flip_screen_x_get(machine)) |
| r13798 | r13799 | |
| 371 | 371 | { |
| 372 | 372 | lasso_state *state = screen.machine().driver_data<lasso_state>(); |
| 373 | 373 | palette_set_color(screen.machine(), 0, get_color(*state->m_back_color)); |
| 374 | bitmap->fill(0, | |
| 374 | bitmap->fill(0, | |
| 375 | 375 | |
| 376 | 376 | tilemap_draw(bitmap, cliprect, state->m_bg_tilemap, 0, 0); |
| 377 | 377 | draw_lasso(screen.machine(), bitmap, cliprect); |
| r13798 | r13799 | |
| 384 | 384 | { |
| 385 | 385 | lasso_state *state = screen.machine().driver_data<lasso_state>(); |
| 386 | 386 | palette_set_color(screen.machine(), 0, get_color(*state->m_back_color)); |
| 387 | bitmap->fill(0, | |
| 387 | bitmap->fill(0, | |
| 388 | 388 | |
| 389 | 389 | tilemap_draw(bitmap, cliprect, state->m_bg_tilemap, 0, 0); |
| 390 | 390 | draw_sprites(screen.machine(), bitmap, cliprect, 0); |
| r13798 | r13799 | |
| 405 | 405 | if (state->m_track_enable) |
| 406 | 406 | tilemap_draw(bitmap, cliprect, state->m_track_tilemap, 0, 0); |
| 407 | 407 | else |
| 408 | bitmap->fill(get_black_pen(screen.machine()), | |
| 408 | bitmap->fill(get_black_pen(screen.machine()), | |
| 409 | 409 | |
| 410 | 410 | draw_sprites(screen.machine(), bitmap, cliprect, 1); // reverse order |
| 411 | 411 | tilemap_draw(bitmap, cliprect, state->m_bg_tilemap, 0, 0); |
| r13798 | r13799 | |
|---|---|---|
| 70 | 70 | Screen refresh |
| 71 | 71 | ***************************************************************************/ |
| 72 | 72 | |
| 73 | static void syvalion_draw_sprites( running_machine &machine,bitmap_t *bitmap, const rectangle | |
| 73 | static void syvalion_draw_sprites( running_machine &machine,bitmap_t *bitmap, const rectangle &cliprect ) | |
| 74 | 74 | { |
| 75 | 75 | /* Y chain size is 16/32?/64/64? pixels. X chain size |
| 76 | 76 | is always 64 pixels. */ |
| r13798 | r13799 | |
| 163 | 163 | } |
| 164 | 164 | } |
| 165 | 165 | |
| 166 | static void recordbr_draw_sprites( running_machine &machine, bitmap_t *bitmap, const rectangle | |
| 166 | static void recordbr_draw_sprites( running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect, int priority ) | |
| 167 | 167 | { |
| 168 | 168 | /* Y chain size is 16/32?/64/64? pixels. X chain size |
| 169 | 169 | is always 64 pixels. */ |
| r13798 | r13799 | |
| 275 | 275 | } |
| 276 | 276 | } |
| 277 | 277 | |
| 278 | static void dleague_draw_sprites( running_machine &machine, bitmap_t *bitmap, const rectangle | |
| 278 | static void dleague_draw_sprites( running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect, int priority ) | |
| 279 | 279 | { |
| 280 | 280 | /* Y chain size is 16/32?/64/64? pixels. X chain size |
| 281 | 281 | is always 64 pixels. */ |
| r13798 | r13799 | |
| 399 | 399 | |
| 400 | 400 | taitoh_log_vram(screen.machine()); |
| 401 | 401 | |
| 402 | bitmap->fill(0, | |
| 402 | bitmap->fill(0, | |
| 403 | 403 | |
| 404 | 404 | tc0080vco_tilemap_draw(state->m_tc0080vco, bitmap, cliprect, 0, TILEMAP_DRAW_OPAQUE, 0); |
| 405 | 405 | tc0080vco_tilemap_draw(state->m_tc0080vco, bitmap, cliprect, 1, 0, 0); |
| r13798 | r13799 | |
| 418 | 418 | |
| 419 | 419 | taitoh_log_vram(screen.machine()); |
| 420 | 420 | |
| 421 | bitmap->fill(0, | |
| 421 | bitmap->fill(0, | |
| 422 | 422 | |
| 423 | 423 | #ifdef MAME_DEBUG |
| 424 | 424 | if (!screen.machine().input().code_pressed(KEYCODE_A)) |
| r13798 | r13799 | |
| 449 | 449 | |
| 450 | 450 | taitoh_log_vram(screen.machine()); |
| 451 | 451 | |
| 452 | bitmap->fill(0, | |
| 452 | bitmap->fill(0, | |
| 453 | 453 | |
| 454 | 454 | #ifdef MAME_DEBUG |
| 455 | 455 | if (!screen.machine().input().code_pressed(KEYCODE_A)) |
| r13798 | r13799 | |
|---|---|---|
| 311 | 311 | |
| 312 | 312 | #define DRAW_SPRITE(code, sx, sy) jal_blend_drawgfx(bitmap, cliprect, machine.gfx[0], code, color, flipx, flipy, sx, sy, 15); |
| 313 | 313 | |
| 314 | static void draw_sprites(running_machine &machine, bitmap_t *bitmap, const rectangle | |
| 314 | static void draw_sprites(running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect) | |
| 315 | 315 | { |
| 316 | 316 | psychic5_state *state = machine.driver_data<psychic5_state>(); |
| 317 | 317 | UINT8 *spriteram = state->m_spriteram; |
| r13798 | r13799 | |
| 365 | 365 | } |
| 366 | 366 | } |
| 367 | 367 | |
| 368 | static void draw_background(running_machine &machine, bitmap_t *bitmap, const rectangle | |
| 368 | static void draw_background(running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect) | |
| 369 | 369 | { |
| 370 | 370 | psychic5_state *state = machine.driver_data<psychic5_state>(); |
| 371 | 371 | UINT8 *spriteram = state->m_spriteram; |
| 372 | 372 | |
| 373 | rectangle clip = | |
| 373 | rectangle clip = | |
| 374 | 374 | |
| 375 | 375 | set_background_palette_intensity(machine); |
| 376 | 376 | |
| r13798 | r13799 | |
| 429 | 429 | } |
| 430 | 430 | } |
| 431 | 431 | |
| 432 | tilemap_draw(bitmap, | |
| 432 | tilemap_draw(bitmap, | |
| 433 | 433 | } |
| 434 | 434 | |
| 435 | 435 | SCREEN_UPDATE( psychic5 ) |
| 436 | 436 | { |
| 437 | 437 | psychic5_state *state = screen.machine().driver_data<psychic5_state>(); |
| 438 | bitmap->fill(get_black_pen(screen.machine()), | |
| 438 | bitmap->fill(get_black_pen(screen.machine()), | |
| 439 | 439 | if (state->m_bg_status & 1) /* Backgound enable */ |
| 440 | 440 | draw_background(screen.machine(), bitmap, cliprect); |
| 441 | 441 | if (!(state->m_title_screen & 1)) |
| r13798 | r13799 | |
| 450 | 450 | if (state->m_bg_status & 1) /* Backgound enable */ |
| 451 | 451 | tilemap_draw(bitmap, cliprect, state->m_bg_tilemap, 0, 0); |
| 452 | 452 | else |
| 453 | bitmap->fill(screen.machine().pens[0x0ff], | |
| 453 | bitmap->fill(screen.machine().pens[0x0ff], | |
| 454 | 454 | draw_sprites(screen.machine(), bitmap, cliprect); |
| 455 | 455 | tilemap_draw(bitmap, cliprect, state->m_fg_tilemap, 0, 0); |
| 456 | 456 | return 0; |
| r13798 | r13799 | |
|---|---|---|
| 63 | 63 | ********************************************************/ |
| 64 | 64 | |
| 65 | 65 | |
| 66 | static void draw_sprites( running_machine &machine, bitmap_t *bitmap, const rectangle | |
| 66 | static void draw_sprites( running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect, const int *primasks, int y_offs ) | |
| 67 | 67 | { |
| 68 | 68 | othunder_state *state = machine.driver_data<othunder_state>(); |
| 69 | 69 | UINT16 *spritemap = (UINT16 *)machine.region("user1")->base(); |
| r13798 | r13799 | |
| 211 | 211 | layer[1] = layer[0] ^ 1; |
| 212 | 212 | layer[2] = 2; |
| 213 | 213 | |
| 214 | screen.machine().priority_bitmap->fill(0, | |
| 214 | screen.machine().priority_bitmap->fill(0, | |
| 215 | 215 | |
| 216 | 216 | /* Ensure screen blanked even when bottom layer not drawn due to disable bit */ |
| 217 | bitmap->fill(0, | |
| 217 | bitmap->fill(0, | |
| 218 | 218 | |
| 219 | 219 | tc0100scn_tilemap_draw(state->m_tc0100scn, bitmap, cliprect, layer[0], TILEMAP_DRAW_OPAQUE, 1); |
| 220 | 220 | tc0100scn_tilemap_draw(state->m_tc0100scn, bitmap, cliprect, layer[1], 0, 2); |
| r13798 | r13799 | |
|---|---|---|
| 209 | 209 | |
| 210 | 210 | ------------------------------------------------------------------------ */ |
| 211 | 211 | |
| 212 | static void draw_sprites( running_machine &machine, bitmap_t *bitmap,const rectangle | |
| 212 | static void draw_sprites( running_machine &machine, bitmap_t *bitmap,const rectangle &cliprect ) | |
| 213 | 213 | { |
| 214 | 214 | ginganin_state *state = machine.driver_data<ginganin_state>(); |
| 215 | 215 | UINT16 *spriteram = state->m_spriteram; |
| r13798 | r13799 | |
| 281 | 281 | if (layers_ctrl1 & 1) |
| 282 | 282 | tilemap_draw(bitmap, cliprect, state->m_bg_tilemap, 0, 0); |
| 283 | 283 | else |
| 284 | bitmap->fill(0, | |
| 284 | bitmap->fill(0, | |
| 285 | 285 | |
| 286 | 286 | if (layers_ctrl1 & 2) |
| 287 | 287 | tilemap_draw(bitmap, cliprect, state->m_fg_tilemap, 0, 0); |
| r13798 | r13799 | |
|---|---|---|
| 146 | 146 | |
| 147 | 147 | ***************************************************************************/ |
| 148 | 148 | |
| 149 | static void draw_sprites( running_machine &machine, bitmap_t *bitmap, const rectangle | |
| 149 | static void draw_sprites( running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect ) | |
| 150 | 150 | { |
| 151 | 151 | tail2nos_state *state = machine.driver_data<tail2nos_state>(); |
| 152 | 152 | UINT16 *spriteram = state->m_spriteram; |
| r13798 | r13799 | |
| 188 | 188 | tilemap_draw(bitmap, cliprect, state->m_bg_tilemap, 0, 0); |
| 189 | 189 | } |
| 190 | 190 | else |
| 191 | bitmap->fill(0, | |
| 191 | bitmap->fill(0, | |
| 192 | 192 | |
| 193 | 193 | return 0; |
| 194 | 194 | } |
| r13798 | r13799 | |
|---|---|---|
| 110 | 110 | /* |
| 111 | 111 | Note: First 0x40 entries in the videoram are actually spriteram |
| 112 | 112 | */ |
| 113 | static void draw_sprites( running_machine &machine, bitmap_t *bitmap, const rectangle | |
| 113 | static void draw_sprites( running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect ) | |
| 114 | 114 | { |
| 115 | 115 | mrjong_state *state = machine.driver_data<mrjong_state>(); |
| 116 | 116 | int offs; |
| r13798 | r13799 | |
|---|---|---|
| 174 | 174 | { |
| 175 | 175 | int y; |
| 176 | 176 | |
| 177 | for (y = cliprect | |
| 177 | for (y = cliprect. | |
| 178 | 178 | { |
| 179 | 179 | int x; |
| 180 | 180 | |
| 181 | for (x = cliprect | |
| 181 | for (x = cliprect. | |
| 182 | 182 | { |
| 183 | 183 | int pixel0 = s2636_0_bitmap->pix16(y, x); |
| 184 | 184 | int pixel1 = s2636_1_bitmap->pix16(y, x); |
| r13798 | r13799 | |
|---|---|---|
| 34 | 34 | SPRITE DRAW ROUTINES |
| 35 | 35 | ************************************************************/ |
| 36 | 36 | |
| 37 | static void draw_sprites( running_machine &machine, bitmap_t *bitmap, const rectangle | |
| 37 | static void draw_sprites( running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect, int *primasks, int y_offset ) | |
| 38 | 38 | { |
| 39 | 39 | /* |
| 40 | 40 | Sprite format: |
| r13798 | r13799 | |
| 519 | 519 | spritepri[2] = tc0360pri_r(state->m_tc0360pri, 7) & 0x0f; |
| 520 | 520 | spritepri[3] = tc0360pri_r(state->m_tc0360pri, 7) >> 4; |
| 521 | 521 | |
| 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); | |
| 524 | 524 | |
| 525 | 525 | #ifdef MAME_DEBUG |
| 526 | 526 | if (state->m_dislayer[layer[0]] == 0) |
| r13798 | r13799 | |
|---|---|---|
| 221 | 221 | state->save_item(NAME(state->m_bg2_on)); |
| 222 | 222 | } |
| 223 | 223 | |
| 224 | static void draw_sprites( running_machine &machine, bitmap_t *bitmap, const rectangle | |
| 224 | static void draw_sprites( running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect, int priority ) | |
| 225 | 225 | { |
| 226 | 226 | _1943_state *state = machine.driver_data<_1943_state>(); |
| 227 | 227 | int offs; |
| r13798 | r13799 | |
| 264 | 264 | if (state->m_bg2_on) |
| 265 | 265 | tilemap_draw(bitmap, cliprect, state->m_bg2_tilemap, 0, 0); |
| 266 | 266 | else |
| 267 | bitmap->fill(get_black_pen(screen.machine()), | |
| 267 | bitmap->fill(get_black_pen(screen.machine()), | |
| 268 | 268 | |
| 269 | 269 | if (state->m_obj_on) |
| 270 | 270 | draw_sprites(screen.machine(), bitmap, cliprect, 0); |
| r13798 | r13799 | |
|---|---|---|
| 26 | 26 | |
| 27 | 27 | |
| 28 | 28 | /* The bootleg sprites are in a different format! */ |
| 29 | static void cninjabl_draw_sprites( running_machine &machine, bitmap_t *bitmap, const rectangle | |
| 29 | static void cninjabl_draw_sprites( running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect ) | |
| 30 | 30 | { |
| 31 | 31 | UINT16 *buffered_spriteram = machine.generic.buffered_spriteram.u16; |
| 32 | 32 | int offs; |
| r13798 | r13799 | |
| 134 | 134 | deco16ic_pf_update(state->m_deco_tilegen2, state->m_pf3_rowscroll, state->m_pf4_rowscroll); |
| 135 | 135 | |
| 136 | 136 | /* 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); | |
| 139 | 139 | deco16ic_tilemap_2_draw(state->m_deco_tilegen2, bitmap, cliprect, TILEMAP_DRAW_OPAQUE, 1); |
| 140 | 140 | deco16ic_tilemap_1_draw(state->m_deco_tilegen2, bitmap, cliprect, 0, 2); |
| 141 | 141 | deco16ic_tilemap_2_draw(state->m_deco_tilegen1, bitmap, cliprect, TILEMAP_DRAW_LAYER1, 2); |
| r13798 | r13799 | |
| 159 | 159 | deco16ic_pf_update(state->m_deco_tilegen2, state->m_pf3_rowscroll, state->m_pf4_rowscroll); |
| 160 | 160 | |
| 161 | 161 | /* 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); | |
| 164 | 164 | deco16ic_tilemap_2_draw(state->m_deco_tilegen2, bitmap, cliprect, TILEMAP_DRAW_OPAQUE, 1); |
| 165 | 165 | deco16ic_tilemap_1_draw(state->m_deco_tilegen2, bitmap, cliprect, 0, 2); |
| 166 | 166 | deco16ic_tilemap_2_draw(state->m_deco_tilegen1, bitmap, cliprect, TILEMAP_DRAW_LAYER1, 2); |
| r13798 | r13799 | |
| 179 | 179 | deco16ic_pf_update(state->m_deco_tilegen1, state->m_pf1_rowscroll, state->m_pf2_rowscroll); |
| 180 | 180 | deco16ic_pf_update(state->m_deco_tilegen2, state->m_pf3_rowscroll, state->m_pf4_rowscroll); |
| 181 | 181 | |
| 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); | |
| 184 | 184 | deco16ic_tilemap_2_draw(state->m_deco_tilegen2, bitmap, cliprect, TILEMAP_DRAW_OPAQUE, 1); |
| 185 | 185 | deco16ic_tilemap_1_draw(state->m_deco_tilegen2, bitmap, cliprect, 0, 2); |
| 186 | 186 | deco16ic_tilemap_2_draw(state->m_deco_tilegen1, bitmap, cliprect, 0, 4); |
| r13798 | r13799 | |
| 215 | 215 | deco16ic_pf_update(state->m_deco_tilegen2, state->m_pf3_rowscroll, state->m_pf4_rowscroll); |
| 216 | 216 | |
| 217 | 217 | /* 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); | |
| 220 | 220 | |
| 221 | 221 | if ((priority & 4) == 0) |
| 222 | 222 | deco16ic_tilemap_2_draw(state->m_deco_tilegen2, bitmap, cliprect, TILEMAP_DRAW_OPAQUE, 1); |
| r13798 | r13799 | |
| 258 | 258 | deco16ic_pf_update(state->m_deco_tilegen2, state->m_pf3_rowscroll, state->m_pf4_rowscroll); |
| 259 | 259 | |
| 260 | 260 | /* Draw playfields */ |
| 261 | bitmap->fill(0x400, | |
| 261 | bitmap->fill(0x400, | |
| 262 | 262 | |
| 263 | 263 | screen.machine().device<decospr_device>("spritegen1")->set_alt_format(true); |
| 264 | 264 | screen.machine().device<decospr_device>("spritegen2")->set_alt_format(true); |
| r13798 | r13799 | |
|---|---|---|
| 280 | 280 | ***************************************************************************/ |
| 281 | 281 | |
| 282 | 282 | /* the sprite generator IC is the same as Mappy */ |
| 283 | static void draw_sprites(running_machine &machine, bitmap_t *bitmap, const rectangle | |
| 283 | static void draw_sprites(running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect, int whichmask) | |
| 284 | 284 | { |
| 285 | 285 | pacland_state *state = machine.driver_data<pacland_state>(); |
| 286 | 286 | UINT8 *spriteram = state->m_spriteram + 0x780; |
| r13798 | r13799 | |
| 340 | 340 | } |
| 341 | 341 | |
| 342 | 342 | |
| 343 | static void draw_fg(running_machine &machine, bitmap_t *bitmap, const rectangle | |
| 343 | static void draw_fg(running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect, int priority ) | |
| 344 | 344 | { |
| 345 | 345 | pacland_state *state = machine.driver_data<pacland_state>(); |
| 346 | 346 | int y, x; |
| r13798 | r13799 | |
| 351 | 351 | tilemap_draw(state->m_fg_bitmap, cliprect, state->m_fg_tilemap, priority, 0); |
| 352 | 352 | |
| 353 | 353 | /* now copy the fg_bitmap to the destination wherever the sprite pixel allows */ |
| 354 | for (y = cliprect | |
| 354 | for (y = cliprect. | |
| 355 | 355 | { |
| 356 | 356 | const UINT8 *pri = &machine.priority_bitmap->pix8(y); |
| 357 | 357 | UINT16 *src = &state->m_fg_bitmap->pix16(y); |
| r13798 | r13799 | |
| 359 | 359 | |
| 360 | 360 | /* only copy if the priority bitmap is 0 (no high priority sprite) and the |
| 361 | 361 | source pixel is not the invalid pen; also clear to 0xffff when finished */ |
| 362 | for (x = cliprect | |
| 362 | for (x = cliprect. | |
| 363 | 363 | { |
| 364 | 364 | UINT16 pix = src[x]; |
| 365 | 365 | if (pix != 0xffff) |
| r13798 | r13799 | |
| 385 | 385 | /* draw high priority sprite pixels, setting priority bitmap to non-zero |
| 386 | 386 | wherever there is a high-priority pixel; note that we draw to the bitmap |
| 387 | 387 | which is safe because the bg_tilemap draw will overwrite everything */ |
| 388 | screen.machine().priority_bitmap->fill(0x00, | |
| 388 | screen.machine().priority_bitmap->fill(0x00, | |
| 389 | 389 | draw_sprites(screen.machine(), bitmap, cliprect, 0); |
| 390 | 390 | |
| 391 | 391 | /* draw background */ |
| r13798 | r13799 | |
|---|---|---|
| 31 | 31 | |
| 32 | 32 | |
| 33 | 33 | /* --- SPRITES --- */ |
| 34 | static void draw_sprites( running_machine &machine, bitmap_t *bitmap, const rectangle | |
| 34 | static void draw_sprites( running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect, UINT32 scr ) | |
| 35 | 35 | { |
| 36 | 36 | /*- Sprite Format 0x0000 - 0x2bff -** |
| 37 | 37 | |
| r13798 | r13799 | |
| 129 | 129 | |
| 130 | 130 | SCREEN_UPDATE( psikyo4_left ) |
| 131 | 131 | { |
| 132 | bitmap->fill(0x1000, | |
| 132 | bitmap->fill(0x1000, | |
| 133 | 133 | draw_sprites(screen.machine(), bitmap, cliprect, 0x0000); |
| 134 | 134 | return 0; |
| 135 | 135 | } |
| 136 | 136 | |
| 137 | 137 | SCREEN_UPDATE( psikyo4_right ) |
| 138 | 138 | { |
| 139 | bitmap->fill(0x1001, | |
| 139 | bitmap->fill(0x1001, | |
| 140 | 140 | draw_sprites(screen.machine(), bitmap, cliprect, 0x2000); |
| 141 | 141 | return 0; |
| 142 | 142 | } |
| r13798 | r13799 | |
|---|---|---|
| 112 | 112 | const UINT8 *mem = screen.machine().region("user1")->base(); |
| 113 | 113 | |
| 114 | 114 | /* fill in background colour*/ |
| 115 | bitmap->fill(state->m_ra_bkgpen, | |
| 115 | bitmap->fill(state->m_ra_bkgpen, | |
| 116 | 116 | |
| 117 | 117 | /* draw road */ |
| 118 | 118 | for (offs = 0x3ff; offs >= 0; offs--) |
| r13798 | r13799 | |
|---|---|---|
| 204 | 204 | state->m_tilemap_clip = machine.primary_screen->visible_area(); |
| 205 | 205 | } |
| 206 | 206 | |
| 207 | static void draw_sprites( running_machine &machine, bitmap_t *bitmap,const rectangle | |
| 207 | static void draw_sprites( running_machine &machine, bitmap_t *bitmap,const rectangle &cliprect ) | |
| 208 | 208 | { |
| 209 | 209 | popper_state *state = machine.driver_data<popper_state>(); |
| 210 | 210 | int offs, sx, sy, flipx, flipy; |
| r13798 | r13799 | |
| 250 | 250 | { |
| 251 | 251 | popper_state *state = screen.machine().driver_data<popper_state>(); |
| 252 | 252 | rectangle finalclip = state->m_tilemap_clip; |
| 253 | finalclip &= | |
| 253 | finalclip &= | |
| 254 | 254 | |
| 255 | 255 | //attribram |
| 256 | 256 | //76543210 |
| r13798 | r13799 | |
| 260 | 260 | |
| 261 | 261 | tilemap_draw(bitmap, cliprect, state->m_p123_tilemap, TILEMAP_DRAW_LAYER1, 0); |
| 262 | 262 | 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); | |
| 265 | 265 | |
| 266 | 266 | draw_sprites(screen.machine(), bitmap, cliprect); |
| 267 | 267 | |
| 268 | 268 | tilemap_draw(bitmap, cliprect, state->m_p123_tilemap, TILEMAP_DRAW_LAYER0, 0); |
| 269 | 269 | 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); | |
| 272 | 272 | return 0; |
| 273 | 273 | } |
| r13798 | r13799 | |
|---|---|---|
| 174 | 174 | state->m_flipon = state->m_charon = state->m_staron = state->m_objon = state->m_bgon = 0; |
| 175 | 175 | } |
| 176 | 176 | |
| 177 | static void draw_sprites_region(running_machine &machine, bitmap_t *bitmap, const rectangle | |
| 177 | static void draw_sprites_region(running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect, int start_offset, int end_offset ) | |
| 178 | 178 | { |
| 179 | 179 | UINT8 *buffered_spriteram = machine.generic.buffered_spriteram.u8; |
| 180 | 180 | const gfx_element *gfx = machine.gfx[2]; |
| r13798 | r13799 | |
| 331 | 331 | #endif |
| 332 | 332 | } |
| 333 | 333 | |
| 334 | static void draw_sprites(running_machine &machine, bitmap_t *bitmap, const rectangle | |
| 334 | static void draw_sprites(running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect) | |
| 335 | 335 | { |
| 336 | 336 | sidearms_state *state = machine.driver_data<sidearms_state>(); |
| 337 | 337 |
| r13798 | r13799 | |
|---|---|---|
| 103 | 103 | tilemap_set_scrolly(state->m_bg_tilemap, offset, data); |
| 104 | 104 | } |
| 105 | 105 | |
| 106 | static void draw_sprites( running_machine &machine, bitmap_t *bitmap, const rectangle | |
| 106 | static void draw_sprites( running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect ) | |
| 107 | 107 | { |
| 108 | 108 | ladyfrog_state *state = machine.driver_data<ladyfrog_state>(); |
| 109 | 109 | int i; |
| r13798 | r13799 | |
|---|---|---|
| 27 | 27 | flip_screen_set(screen.machine(), BIT(flip, 7)); |
| 28 | 28 | deco16ic_pf_update(state->m_deco_tilegen1, state->m_pf1_rowscroll, state->m_pf2_rowscroll); |
| 29 | 29 | |
| 30 | bitmap->fill(256, | |
| 30 | bitmap->fill(256, | |
| 31 | 31 | |
| 32 | 32 | deco16ic_tilemap_2_draw(state->m_deco_tilegen1, bitmap, cliprect, TILEMAP_DRAW_OPAQUE, 0); |
| 33 | 33 | deco16ic_tilemap_1_draw(state->m_deco_tilegen1, bitmap, cliprect, 0, 0); |
| r13798 | r13799 | |
|---|---|---|
| 64 | 64 | state->m_bg_tilemap = tilemap_create(machine, get_bg_tile_info, tilemap_scan_cols_flipy, 8, 8, 32, 32); |
| 65 | 65 | } |
| 66 | 66 | |
| 67 | static void jack_draw_sprites( running_machine &machine, bitmap_t *bitmap, const rectangle | |
| 67 | static void jack_draw_sprites( running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect ) | |
| 68 | 68 | { |
| 69 | 69 | jack_state *state = machine.driver_data<jack_state>(); |
| 70 | 70 | UINT8 *spriteram = state->m_spriteram; |
| r13798 | r13799 | |
| 149 | 149 | state->m_bg_tilemap = tilemap_create(machine, joinem_get_bg_tile_info, tilemap_scan_cols_flipy, 8, 8, 32, 32); |
| 150 | 150 | } |
| 151 | 151 | |
| 152 | static void joinem_draw_sprites( running_machine &machine, bitmap_t *bitmap, const rectangle | |
| 152 | static void joinem_draw_sprites( running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect ) | |
| 153 | 153 | { |
| 154 | 154 | jack_state *state = machine.driver_data<jack_state>(); |
| 155 | 155 | UINT8 *spriteram = state->m_spriteram; |
| r13798 | r13799 | |
|---|---|---|
| 184 | 184 | |
| 185 | 185 | ***************************************************************************/ |
| 186 | 186 | |
| 187 | static void draw_sprites( running_machine &machine, bitmap_t *bitmap,const rectangle | |
| 187 | static void draw_sprites( running_machine &machine, bitmap_t *bitmap,const rectangle &cliprect ) | |
| 188 | 188 | { |
| 189 | 189 | dogfgt_state *state = machine.driver_data<dogfgt_state>(); |
| 190 | 190 | int offs; |
| r13798 | r13799 | |
|---|---|---|
| 11 | 11 | flip_screen_set(screen.machine(), BIT(flip, 7)); |
| 12 | 12 | deco16ic_pf_update(state->m_deco_tilegen1, state->m_pf1_rowscroll, state->m_pf2_rowscroll); |
| 13 | 13 | |
| 14 | bitmap->fill(256, | |
| 14 | bitmap->fill(256, | |
| 15 | 15 | |
| 16 | 16 | deco16ic_tilemap_2_draw(state->m_deco_tilegen1, bitmap, cliprect, TILEMAP_DRAW_OPAQUE, 0); |
| 17 | 17 | deco16ic_tilemap_1_draw(state->m_deco_tilegen1, bitmap, cliprect, 0, 0); |
| r13798 | r13799 | |
|---|---|---|
| 64 | 64 | for( col=0; col<512; col+=32 ) |
| 65 | 65 | { |
| 66 | 66 | drawgfx_opaque(state->m_bg_bitmap, |
| 67 | | |
| 67 | state->m_bg_bitmap->cliprect(),machine.gfx[2], | |
| 68 | 68 | charcode, |
| 69 | 69 | row < 128 ? 0 : 1, |
| 70 | 70 | 0,0, |
| r13798 | r13799 | |
| 168 | 168 | ??? |
| 169 | 169 | **************************************************************************/ |
| 170 | 170 | |
| 171 | static void draw_foreground(running_machine &machine, bitmap_t *bitmap, const rectangle | |
| 171 | static void draw_foreground(running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect, int priority, int opaque ) | |
| 172 | 172 | { |
| 173 | 173 | vigilant_state *state = machine.driver_data<vigilant_state>(); |
| 174 | 174 | UINT8 *videoram = state->m_videoram; |
| r13798 | r13799 | |
| 192 | 192 | { |
| 193 | 193 | sx = (sx + scroll) & 0x1ff; |
| 194 | 194 | |
| 195 | drawgfx_transmask(bitmap, | |
| 195 | drawgfx_transmask(bitmap, | |
| 196 | 196 | tile_number, |
| 197 | 197 | color, |
| 198 | 198 | 0,0, |
| r13798 | r13799 | |
| 217 | 217 | |
| 218 | 218 | |
| 219 | 219 | |
| 220 | static void draw_background(running_machine &machine, bitmap_t *bitmap, const rectangle | |
| 220 | static void draw_background(running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect) | |
| 221 | 221 | { |
| 222 | 222 | vigilant_state *state = machine.driver_data<vigilant_state>(); |
| 223 | 223 | int scrollx = 0x17a + 16*8 - (state->m_rear_horiz_scroll_low + state->m_rear_horiz_scroll_high); |
| r13798 | r13799 | |
| 229 | 229 | state->m_rear_refresh=0; |
| 230 | 230 | } |
| 231 | 231 | |
| 232 | copyscrollbitmap(bitmap,state->m_bg_bitmap,1,&scrollx,0,0, | |
| 232 | copyscrollbitmap(bitmap,state->m_bg_bitmap,1,&scrollx,0,0, | |
| 233 | 233 | } |
| 234 | 234 | |
| 235 | 235 | |
| 236 | static void draw_sprites(running_machine &machine, bitmap_t *bitmap,const rectangle | |
| 236 | static void draw_sprites(running_machine &machine, bitmap_t *bitmap,const rectangle &cliprect) | |
| 237 | 237 | { |
| 238 | 238 | vigilant_state *state = machine.driver_data<vigilant_state>(); |
| 239 | 239 | UINT8 *spriteram = state->m_spriteram; |
| r13798 | r13799 | |
| 322 | 322 | if (state->m_rear_disable) /* opaque foreground */ |
| 323 | 323 | { |
| 324 | 324 | draw_foreground(screen.machine(),bitmap,cliprect,0,1); |
| 325 | draw_sprites(screen.machine(),bitmap, | |
| 325 | draw_sprites(screen.machine(),bitmap, | |
| 326 | 326 | draw_foreground(screen.machine(),bitmap,cliprect,1,0); |
| 327 | 327 | } |
| 328 | 328 | else |
| 329 | 329 | { |
| 330 | 330 | draw_background(screen.machine(),bitmap,cliprect); |
| 331 | 331 | draw_foreground(screen.machine(),bitmap,cliprect,0,0); |
| 332 | draw_sprites(screen.machine(),bitmap, | |
| 332 | draw_sprites(screen.machine(),bitmap, | |
| 333 | 333 | draw_foreground(screen.machine(),bitmap,cliprect,1,0); // priority tiles |
| 334 | 334 | } |
| 335 | 335 | return 0; |
| r13798 | r13799 | |
|---|---|---|
| 22 | 22 | static const int layer_enable_mask[3] = { 0x10, 0x20, 0x40 }; |
| 23 | 23 | |
| 24 | 24 | typedef void (*copy_layer_func_t)(running_machine &, bitmap_t *, |
| 25 | const rectangle | |
| 25 | const rectangle &, int, int *, rectangle *); | |
| 26 | 26 | |
| 27 | 27 | |
| 28 | 28 | /*************************************************************************** |
| r13798 | r13799 | |
| 314 | 314 | |
| 315 | 315 | /* draw the sprites into separate bitmaps and check overlapping region */ |
| 316 | 316 | state->m_sprite_layer_collbitmap1->fill(TRANSPARENT_PEN); |
| 317 | drawgfx_transpen(state->m_sprite_sprite_collbitmap1, | |
| 317 | drawgfx_transpen(state->m_sprite_sprite_collbitmap1, state->m_sprite_sprite_collbitmap1->cliprect(), get_sprite_gfx_element(machine, which1), | |
| 318 | 318 | state->m_spriteram[SPRITE_RAM_PAGE_OFFSET + offs1 + 3] & 0x3f, |
| 319 | 319 | 0, |
| 320 | 320 | state->m_spriteram[SPRITE_RAM_PAGE_OFFSET + offs1 + 2] & 0x01, |
| r13798 | r13799 | |
| 322 | 322 | sx1, sy1, 0); |
| 323 | 323 | |
| 324 | 324 | state->m_sprite_sprite_collbitmap2->fill(TRANSPARENT_PEN); |
| 325 | drawgfx_transpen(state->m_sprite_sprite_collbitmap2, | |
| 325 | drawgfx_transpen(state->m_sprite_sprite_collbitmap2, state->m_sprite_sprite_collbitmap2->cliprect(), get_sprite_gfx_element(machine, which2), | |
| 326 | 326 | state->m_spriteram[SPRITE_RAM_PAGE_OFFSET + offs2 + 3] & 0x3f, |
| 327 | 327 | 0, |
| 328 | 328 | state->m_spriteram[SPRITE_RAM_PAGE_OFFSET + offs2 + 2] & 0x01, |
| r13798 | r13799 | |
| 471 | 471 | |
| 472 | 472 | /* draw sprite into a bitmap and check if layers collide */ |
| 473 | 473 | state->m_sprite_layer_collbitmap1->fill(TRANSPARENT_PEN); |
| 474 | drawgfx_transpen(state->m_sprite_layer_collbitmap1, | |
| 474 | drawgfx_transpen(state->m_sprite_layer_collbitmap1, state->m_sprite_layer_collbitmap1->cliprect(),get_sprite_gfx_element(machine, which), | |
| 475 | 475 | state->m_spriteram[SPRITE_RAM_PAGE_OFFSET + offs + 3] & 0x3f, |
| 476 | 476 | 0, |
| 477 | 477 | flip_x, flip_y, |
| r13798 | r13799 | |
| 531 | 531 | if (GLOBAL_FLIP_X) sx = 31 - sx; |
| 532 | 532 | if (GLOBAL_FLIP_Y) sy = 31 - sy; |
| 533 | 533 | |
| 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], | |
| 535 | 535 | state->m_videoram_1[offs], |
| 536 | 536 | state->m_colorbank[0] & 0x07, |
| 537 | 537 | GLOBAL_FLIP_X,GLOBAL_FLIP_Y, |
| 538 | 538 | 8*sx,8*sy,0); |
| 539 | 539 | |
| 540 | drawgfx_transpen(state->m_layer_bitmap[1], | |
| 540 | drawgfx_transpen(state->m_layer_bitmap[1],state->m_layer_bitmap[1]->cliprect(),machine.gfx[state->m_colorbank[0] & 0x80 ? 2 : 0], | |
| 541 | 541 | state->m_videoram_2[offs], |
| 542 | 542 | (state->m_colorbank[0] >> 4) & 0x07, |
| 543 | 543 | GLOBAL_FLIP_X,GLOBAL_FLIP_Y, |
| 544 | 544 | 8*sx,8*sy,0); |
| 545 | 545 | |
| 546 | drawgfx_transpen(state->m_layer_bitmap[2], | |
| 546 | drawgfx_transpen(state->m_layer_bitmap[2],state->m_layer_bitmap[2]->cliprect(),machine.gfx[state->m_colorbank[1] & 0x08 ? 2 : 0], | |
| 547 | 547 | state->m_videoram_3[offs], |
| 548 | 548 | state->m_colorbank[1] & 0x07, |
| 549 | 549 | GLOBAL_FLIP_X,GLOBAL_FLIP_Y, |
| r13798 | r13799 | |
| 597 | 597 | flip_y = !flip_y; |
| 598 | 598 | } |
| 599 | 599 | |
| 600 | drawgfx_transpen(bitmap, GLOBAL_FLIP_X ? | |
| 600 | drawgfx_transpen(bitmap, GLOBAL_FLIP_X ? | |
| 601 | 601 | flip_x, flip_y, sx, sy,0); |
| 602 | 602 | |
| 603 | 603 | /* draw with wrap around. The horizontal games (eg. sfposeid) need this */ |
| 604 | drawgfx_transpen(bitmap, GLOBAL_FLIP_X ? | |
| 604 | drawgfx_transpen(bitmap, GLOBAL_FLIP_X ? | |
| 605 | 605 | flip_x, flip_y, sx - 0x100, sy,0); |
| 606 | 606 | } |
| 607 | 607 | } |
| r13798 | r13799 | |
| 609 | 609 | } |
| 610 | 610 | |
| 611 | 611 | |
| 612 | static void taitosj_copy_layer(running_machine &machine, bitmap_t *bitmap, const rectangle | |
| 612 | static void taitosj_copy_layer(running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect, | |
| 613 | 613 | int which, int *sprites_on, rectangle *sprite_areas) |
| 614 | 614 | { |
| 615 | 615 | taitosj_state *state = machine.driver_data<taitosj_state>(); |
| r13798 | r13799 | |
| 642 | 642 | if ((i >= 0x10) && (i <= 0x17)) continue; /* no sprites here */ |
| 643 | 643 | |
| 644 | 644 | if (sprites_on[i]) |
| 645 | copyscrollbitmap(state->m_sprite_layer_collbitmap2[which], state->m_layer_bitmap[which], 1, &scrollx, 32, scrolly, | |
| 645 | copyscrollbitmap(state->m_sprite_layer_collbitmap2[which], state->m_layer_bitmap[which], 1, &scrollx, 32, scrolly, | |
| 646 | 646 | } |
| 647 | 647 | } |
| 648 | 648 | } |
| 649 | 649 | |
| 650 | 650 | |
| 651 | static void kikstart_copy_layer(running_machine &machine, bitmap_t *bitmap, const rectangle | |
| 651 | static void kikstart_copy_layer(running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect, | |
| 652 | 652 | int which, int *sprites_on, rectangle *sprite_areas) |
| 653 | 653 | { |
| 654 | 654 | taitosj_state *state = machine.driver_data<taitosj_state>(); |
| r13798 | r13799 | |
| 681 | 681 | if ((i >= 0x10) && (i <= 0x17)) continue; /* no sprites here */ |
| 682 | 682 | |
| 683 | 683 | if (sprites_on[i]) |
| 684 | copyscrollbitmap(state->m_sprite_layer_collbitmap2[which], state->m_layer_bitmap[which], 32 * 8, scrollx, 1, &scrolly, | |
| 684 | copyscrollbitmap(state->m_sprite_layer_collbitmap2[which], state->m_layer_bitmap[which], 32 * 8, scrollx, 1, &scrolly, | |
| 685 | 685 | } |
| 686 | 686 | } |
| 687 | 687 | } |
| 688 | 688 | |
| 689 | 689 | |
| 690 | static void copy_layer(running_machine &machine, bitmap_t *bitmap, const rectangle | |
| 690 | static void copy_layer(running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect, | |
| 691 | 691 | copy_layer_func_t copy_layer_func, int which, int *sprites_on, rectangle *sprite_areas) |
| 692 | 692 | { |
| 693 | 693 | if (which == 0) |
| r13798 | r13799 | |
| 697 | 697 | } |
| 698 | 698 | |
| 699 | 699 | |
| 700 | static void copy_layers(running_machine &machine, bitmap_t *bitmap, const rectangle | |
| 700 | static void copy_layers(running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect, | |
| 701 | 701 | copy_layer_func_t copy_layer_func, int *sprites_on, rectangle *sprite_areas) |
| 702 | 702 | { |
| 703 | 703 | taitosj_state *state = machine.driver_data<taitosj_state>(); |
| 704 | 704 | int i = 0; |
| 705 | 705 | |
| 706 | 706 | /* fill the screen with the background color */ |
| 707 | bitmap->fill(8 * (state->m_colorbank[1] & 0x07), | |
| 707 | bitmap->fill(8 * (state->m_colorbank[1] & 0x07), | |
| 708 | 708 | |
| 709 | 709 | for (i = 0; i < 4; i++) |
| 710 | 710 | { |
| r13798 | r13799 | |
| 726 | 726 | |
| 727 | 727 | |
| 728 | 728 | static int video_update_common(running_machine &machine, bitmap_t *bitmap, |
| 729 | const rectangle | |
| 729 | const rectangle &cliprect, copy_layer_func_t copy_layer_func) | |
| 730 | 730 | { |
| 731 | 731 | int sprites_on[0x20]; /* 1 if sprite is active */ |
| 732 | 732 | rectangle sprite_areas[0x20]; /* areas on bitmap (sprite locations) */ |
| r13798 | r13799 | |
|---|---|---|
| 208 | 208 | tilemap_set_transparent_pen(state->m_fg_tilemap, 0); |
| 209 | 209 | } |
| 210 | 210 | |
| 211 | static void kingofb_draw_sprites(running_machine &machine, bitmap_t *bitmap, const rectangle | |
| 211 | static void kingofb_draw_sprites(running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect) | |
| 212 | 212 | { |
| 213 | 213 | kingofb_state *state = machine.driver_data<kingofb_state>(); |
| 214 | 214 | UINT8 *spriteram = state->m_spriteram; |
| r13798 | r13799 | |
| 277 | 277 | tilemap_set_transparent_pen(state->m_fg_tilemap, 0); |
| 278 | 278 | } |
| 279 | 279 | |
| 280 | static void ringking_draw_sprites( running_machine &machine, bitmap_t *bitmap, const rectangle | |
| 280 | static void ringking_draw_sprites( running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect ) | |
| 281 | 281 | { |
| 282 | 282 | kingofb_state *state = machine.driver_data<kingofb_state>(); |
| 283 | 283 | UINT8 *spriteram = state->m_spriteram; |
| r13798 | r13799 | |
|---|---|---|
| 306 | 306 | |
| 307 | 307 | ***************************************************************************/ |
| 308 | 308 | |
| 309 | static void draw_sprites( running_machine &machine, bitmap_t *bitmap, const rectangle | |
| 309 | static void draw_sprites( running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect ) | |
| 310 | 310 | { |
| 311 | 311 | galivan_state *state = machine.driver_data<galivan_state>(); |
| 312 | 312 | const UINT8 *spritepalettebank = machine.region("user1")->base(); |
| r13798 | r13799 | |
| 352 | 352 | tilemap_set_scrolly(state->m_bg_tilemap, 0, state->m_galivan_scrolly[0] + 256 * (state->m_galivan_scrolly[1] & 0x07)); |
| 353 | 353 | |
| 354 | 354 | if (state->m_layers & 0x40) |
| 355 | bitmap->fill(0, | |
| 355 | bitmap->fill(0, | |
| 356 | 356 | else |
| 357 | 357 | tilemap_draw(bitmap, cliprect, state->m_bg_tilemap, 0, 0); |
| 358 | 358 | |
| r13798 | r13799 | |
| 381 | 381 | tilemap_set_scrolly(state->m_bg_tilemap, 0, state->m_scrolly); |
| 382 | 382 | |
| 383 | 383 | if (state->m_ninjemak_dispdisable) |
| 384 | bitmap->fill(0, | |
| 384 | bitmap->fill(0, | |
| 385 | 385 | else |
| 386 | 386 | tilemap_draw(bitmap, cliprect, state->m_bg_tilemap, 0, 0); |
| 387 | 387 |
| r13798 | r13799 | |
|---|---|---|
| 161 | 161 | UINT8 *intensity_buf = line_buffer[state->m_12sel ? 0 : 1].intensity_buf; |
| 162 | 162 | UINT8 *priority_buf = line_buffer[state->m_12sel ? 0 : 1].priority_buf; |
| 163 | 163 | |
| 164 | for (y = cliprect | |
| 164 | for (y = cliprect. | |
| 165 | 165 | { |
| 166 | UINT32 *dest = &bitmap->pix32(y, cliprect | |
| 166 | UINT32 *dest = &bitmap->pix32(y, cliprect. | |
| 167 | 167 | |
| 168 | 168 | for (x = 0; x < 512; ++x) |
| 169 | 169 | { |
| r13798 | r13799 | |
|---|---|---|
| 137 | 137 | |
| 138 | 138 | ***************************************************************************/ |
| 139 | 139 | |
| 140 | static void draw_sprites(running_machine &machine, bitmap_t *bitmap, const rectangle | |
| 140 | static void draw_sprites(running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect ) | |
| 141 | 141 | { |
| 142 | 142 | tsamurai_state *state = machine.driver_data<tsamurai_state>(); |
| 143 | 143 | UINT8 *spriteram = state->m_spriteram; |
| r13798 | r13799 | |
| 218 | 218 | Note that the background color register isn't well understood |
| 219 | 219 | (screenshots would be helpful) |
| 220 | 220 | */ |
| 221 | bitmap->fill(state->m_bgcolor, | |
| 221 | bitmap->fill(state->m_bgcolor, | |
| 222 | 222 | tilemap_draw(bitmap,cliprect,state->m_background,0,0); |
| 223 | 223 | draw_sprites(screen.machine(), bitmap,cliprect); |
| 224 | 224 | tilemap_draw(bitmap,cliprect,state->m_foreground,0,0); |
| r13798 | r13799 | |
|---|---|---|
| 33 | 33 | } |
| 34 | 34 | |
| 35 | 35 | |
| 36 | static void draw_sprites( running_machine &machine, bitmap_t *bitmap, const rectangle | |
| 36 | static void draw_sprites( running_machine &machine, bitmap_t *bitmap, const rectangle | |
| 37 | 37 | { |
| 38 | 38 | canyon_state *state = machine.driver_data<canyon_state>(); |
| 39 | 39 | int i; |
| r13798 | r13799 | |
| 55 | 55 | } |
| 56 | 56 | |
| 57 | 57 | |
| 58 | static void draw_bombs( running_machine &machine, bitmap_t *bitmap, const rectangle | |
| 58 | static void draw_bombs( running_machine &machine, bitmap_t *bitmap, const rectangle | |
| 59 | 59 | { |
| 60 | 60 | canyon_state *state = machine.driver_data<canyon_state>(); |
| 61 | 61 | int i; |
| r13798 | r13799 | |
| 72 | 72 | rect.max_x = sx + 1; |
| 73 | 73 | rect.max_y = sy + 1; |
| 74 | 74 | |
| 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; | |
| 79 | 79 | |
| 80 | 80 | bitmap->fill(1 + 2 * i, rect); |
| 81 | 81 | } |
| r13798 | r13799 | |
|---|---|---|
| 80 | 80 | tilemap_mark_tile_dirty(state->m_bg_tilemap[offset >> 11],((offset << 1) & 0x0fff) >> 1); |
| 81 | 81 | } |
| 82 | 82 | |
| 83 | static void draw_bitmap(running_machine &machine, bitmap_t *bitmap, const rectangle | |
| 83 | static void draw_bitmap(running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect) | |
| 84 | 84 | { |
| 85 | 85 | splash_state *state = machine.driver_data<splash_state>(); |
| 86 | 86 | int sx,sy,color,count,colxor,bitswap; |
| r13798 | r13799 | |
| 156 | 156 | break; |
| 157 | 157 | } |
| 158 | 158 | |
| 159 | if (sy >= cliprect | |
| 159 | if (sy >= cliprect. | |
| 160 | 160 | bitmap->pix16(sy, sx-9) = 0x300+(color^colxor); |
| 161 | 161 | } |
| 162 | 162 | } |
| r13798 | r13799 | |
| 210 | 210 | 400| xxxxxxxx -------- | unused |
| 211 | 211 | */ |
| 212 | 212 | |
| 213 | static void splash_draw_sprites(running_machine &machine, bitmap_t *bitmap,const rectangle | |
| 213 | static void splash_draw_sprites(running_machine &machine, bitmap_t *bitmap,const rectangle &cliprect) | |
| 214 | 214 | { |
| 215 | 215 | splash_state *state = machine.driver_data<splash_state>(); |
| 216 | 216 | int i; |
| r13798 | r13799 | |
| 231 | 231 | } |
| 232 | 232 | } |
| 233 | 233 | |
| 234 | static void funystrp_draw_sprites(running_machine &machine, bitmap_t *bitmap,const rectangle | |
| 234 | static void funystrp_draw_sprites(running_machine &machine, bitmap_t *bitmap,const rectangle &cliprect) | |
| 235 | 235 | { |
| 236 | 236 | splash_state *state = machine.driver_data<splash_state>(); |
| 237 | 237 | int i; |
| r13798 | r13799 | |
|---|---|---|
| 177 | 177 | |
| 178 | 178 | ***************************************************************************/ |
| 179 | 179 | |
| 180 | static void f1gp_draw_sprites( running_machine &machine, bitmap_t *bitmap, const rectangle | |
| 180 | static void f1gp_draw_sprites( running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect, int chip, int primask ) | |
| 181 | 181 | { |
| 182 | 182 | f1gp_state *state = machine.driver_data<f1gp_state>(); |
| 183 | 183 | int attr_start, first; |
| r13798 | r13799 | |
| 254 | 254 | { |
| 255 | 255 | f1gp_state *state = screen.machine().driver_data<f1gp_state>(); |
| 256 | 256 | |
| 257 | screen.machine().priority_bitmap->fill(0, | |
| 257 | screen.machine().priority_bitmap->fill(0, | |
| 258 | 258 | |
| 259 | 259 | k053936_zoom_draw(state->m_k053936, bitmap, cliprect, state->m_roz_tilemap, 0, 0, 1); |
| 260 | 260 | |
| r13798 | r13799 | |
| 275 | 275 | } |
| 276 | 276 | |
| 277 | 277 | |
| 278 | static void f1gpb_draw_sprites( running_machine &machine, bitmap_t *bitmap,const rectangle | |
| 278 | static void f1gpb_draw_sprites( running_machine &machine, bitmap_t *bitmap,const rectangle &cliprect ) | |
| 279 | 279 | { |
| 280 | 280 | f1gp_state *state = machine.driver_data<f1gp_state>(); |
| 281 | 281 | UINT16 *spriteram = state->m_spriteram; |
| r13798 | r13799 | |
| 357 | 357 | |
| 358 | 358 | tilemap_set_scrolly(state->m_fg_tilemap, 0, state->m_fgregs[0] + 8); |
| 359 | 359 | |
| 360 | screen.machine().priority_bitmap->fill(0, | |
| 360 | screen.machine().priority_bitmap->fill(0, | |
| 361 | 361 | |
| 362 | 362 | tilemap_draw_roz(bitmap, cliprect, state->m_roz_tilemap, |
| 363 | 363 | startx << 13, starty << 13, |
| r13798 | r13799 | |
| 372 | 372 | } |
| 373 | 373 | |
| 374 | 374 | |
| 375 | static void f1gp2_draw_sprites( running_machine &machine, bitmap_t *bitmap, const rectangle | |
| 375 | static void f1gp2_draw_sprites( running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect ) | |
| 376 | 376 | { |
| 377 | 377 | f1gp_state *state = machine.driver_data<f1gp_state>(); |
| 378 | 378 | int offs; |
| r13798 | r13799 | |
| 449 | 449 | f1gp_state *state = screen.machine().driver_data<f1gp_state>(); |
| 450 | 450 | |
| 451 | 451 | if (state->m_gfxctrl & 4) /* blank screen */ |
| 452 | bitmap->fill(get_black_pen(screen.machine()), | |
| 452 | bitmap->fill(get_black_pen(screen.machine()), | |
| 453 | 453 | else |
| 454 | 454 | { |
| 455 | 455 | switch (state->m_gfxctrl & 3) |
| r13798 | r13799 | |
|---|---|---|
| 125 | 125 | DrawRozHelper( |
| 126 | 126 | bitmap_t *bitmap, |
| 127 | 127 | tilemap_t *tmap, |
| 128 | const rectangle | |
| 128 | const rectangle &clip, | |
| 129 | 129 | const struct RozParam *rozInfo ) |
| 130 | 130 | { |
| 131 | 131 | tilemap_set_palette_offset( tmap, rozInfo->color ); |
| r13798 | r13799 | |
| 164 | 164 | UINT32 size_mask = rozInfo->size - 1; |
| 165 | 165 | bitmap_t *srcbitmap = tilemap_get_pixmap(tmap); |
| 166 | 166 | 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; | |
| 173 | 173 | |
| 174 | int row_count = (clip | |
| 174 | int row_count = (clip. | |
| 175 | 175 | int row_block_count = row_count / ROZ_BLOCK_SIZE; |
| 176 | 176 | int row_extra_count = row_count % ROZ_BLOCK_SIZE; |
| 177 | 177 | |
| 178 | int column_count = (clip | |
| 178 | int column_count = (clip. | |
| 179 | 179 | int column_block_count = column_count / ROZ_BLOCK_SIZE; |
| 180 | 180 | int column_extra_count = column_count % ROZ_BLOCK_SIZE; |
| 181 | 181 | |
| r13798 | r13799 | |
| 245 | 245 | } /* DrawRozHelper */ |
| 246 | 246 | |
| 247 | 247 | static void |
| 248 | DrawROZ(bitmap_t *bitmap,const rectangle | |
| 248 | DrawROZ(bitmap_t *bitmap,const rectangle &cliprect) | |
| 249 | 249 | { |
| 250 | 250 | const int xoffset = 38,yoffset = 0; |
| 251 | 251 | struct RozParam rozParam; |
| r13798 | r13799 | |
| 450 | 450 | } |
| 451 | 451 | |
| 452 | 452 | static void |
| 453 | ApplyClip( rectangle | |
| 453 | ApplyClip( rectangle &clip, const rectangle &cliprect ) | |
| 454 | 454 | { |
| 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; | |
| 459 | 459 | /* intersect with master clip rectangle */ |
| 460 | | |
| 460 | | |
| 461 | 461 | } /* ApplyClip */ |
| 462 | 462 | |
| 463 | 463 | SCREEN_UPDATE( namcos2_default ) |
| r13798 | r13799 | |
| 466 | 466 | int pri; |
| 467 | 467 | |
| 468 | 468 | 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 ); | |
| 471 | 471 | |
| 472 | 472 | /* HACK: enable ROZ layer only if it has priority > 0 */ |
| 473 | 473 | tilemap_set_enable(tilemap_roz,(namcos2_gfx_ctrl & 0x7000) ? 1 : 0); |
| r13798 | r13799 | |
| 476 | 476 | { |
| 477 | 477 | if( (pri&1)==0 ) |
| 478 | 478 | { |
| 479 | namco_tilemap_draw( bitmap, | |
| 479 | namco_tilemap_draw( bitmap, | |
| 480 | 480 | |
| 481 | 481 | if( ((namcos2_gfx_ctrl & 0x7000) >> 12)==pri/2 ) |
| 482 | 482 | { |
| 483 | DrawROZ(bitmap, | |
| 483 | DrawROZ(bitmap, | |
| 484 | 484 | } |
| 485 | namcos2_draw_sprites(screen.machine(), bitmap, | |
| 485 | namcos2_draw_sprites(screen.machine(), bitmap, | |
| 486 | 486 | } |
| 487 | 487 | } |
| 488 | 488 | return 0; |
| r13798 | r13799 | |
| 503 | 503 | int pri; |
| 504 | 504 | |
| 505 | 505 | 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 ); | |
| 508 | 508 | |
| 509 | 509 | for( pri=0; pri<16; pri++ ) |
| 510 | 510 | { |
| 511 | 511 | if( (pri&1)==0 ) |
| 512 | 512 | { |
| 513 | namco_tilemap_draw( bitmap, | |
| 513 | namco_tilemap_draw( bitmap, | |
| 514 | 514 | } |
| 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 ); | |
| 517 | 517 | } |
| 518 | 518 | return 0; |
| 519 | 519 | } |
| r13798 | r13799 | |
| 540 | 540 | int pri; |
| 541 | 541 | |
| 542 | 542 | 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 ); | |
| 545 | 545 | |
| 546 | 546 | for( pri=0; pri<16; pri++ ) |
| 547 | 547 | { |
| 548 | 548 | if( (pri&1)==0 ) |
| 549 | 549 | { |
| 550 | namco_tilemap_draw( bitmap, | |
| 550 | namco_tilemap_draw( bitmap, | |
| 551 | 551 | } |
| 552 | namco_road_draw(screen.machine(), bitmap, | |
| 552 | namco_road_draw(screen.machine(), bitmap, | |
| 553 | 553 | if( namcos2_gametype==NAMCOS2_LUCKY_AND_WILD ) |
| 554 | 554 | { |
| 555 | namco_roz_draw( bitmap, | |
| 555 | namco_roz_draw( bitmap, | |
| 556 | 556 | } |
| 557 | namco_obj_draw(screen.machine(), bitmap, | |
| 557 | namco_obj_draw(screen.machine(), bitmap, | |
| 558 | 558 | } |
| 559 | 559 | return 0; |
| 560 | 560 | } |
| r13798 | r13799 | |
| 573 | 573 | int pri; |
| 574 | 574 | |
| 575 | 575 | 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 ); | |
| 578 | 578 | |
| 579 | 579 | for( pri=0; pri<8; pri++ ) |
| 580 | 580 | { |
| 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 ); | |
| 583 | 583 | } |
| 584 | 584 | return 0; |
| 585 | 585 | } |
| r13798 | r13799 | |
| 599 | 599 | int pri; |
| 600 | 600 | |
| 601 | 601 | 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 ); | |
| 604 | 604 | |
| 605 | 605 | for( pri=0; pri<16; pri++ ) |
| 606 | 606 | { |
| 607 | 607 | if( (pri&1)==0 ) |
| 608 | 608 | { |
| 609 | namco_tilemap_draw( bitmap, | |
| 609 | namco_tilemap_draw( bitmap, | |
| 610 | 610 | } |
| 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 ); | |
| 613 | 613 | } |
| 614 | 614 | return 0; |
| 615 | 615 | } |
| r13798 | r13799 | |
|---|---|---|
| 126 | 126 | */ |
| 127 | 127 | |
| 128 | 128 | static int video_update_stratvox_ttmahjng(running_machine &machine, bitmap_t *bitmap, |
| 129 | const rectangle | |
| 129 | const rectangle &cliprect, | |
| 130 | 130 | pen_t (*make_pen)(UINT8)) |
| 131 | 131 | { |
| 132 | 132 | route16_state *state = machine.driver_data<route16_state>(); |
| r13798 | r13799 | |
|---|---|---|
| 301 | 301 | { |
| 302 | 302 | tecmosys_state *state = screen.machine().driver_data<tecmosys_state>(); |
| 303 | 303 | |
| 304 | bitmap->fill(screen.machine().pens[0x4000], | |
| 304 | bitmap->fill(screen.machine().pens[0x4000], | |
| 305 | 305 | |
| 306 | 306 | |
| 307 | 307 | tilemap_set_scrolly( state->m_bg0tilemap, 0, state->m_c80000regs[1]+16); |
| r13798 | r13799 | |
| 313 | 313 | tilemap_set_scrolly( state->m_bg2tilemap, 0, state->m_b00000regs[1]+17); |
| 314 | 314 | tilemap_set_scrollx( state->m_bg2tilemap, 0, state->m_b00000regs[0]+106); |
| 315 | 315 | |
| 316 | state->m_tmp_tilemap_composebitmap->fill(0, | |
| 316 | state->m_tmp_tilemap_composebitmap->fill(0, | |
| 317 | 317 | |
| 318 | state->m_tmp_tilemap_renderbitmap->fill(0, | |
| 318 | state->m_tmp_tilemap_renderbitmap->fill(0, | |
| 319 | 319 | tilemap_draw(state->m_tmp_tilemap_renderbitmap,cliprect,state->m_bg0tilemap,0,0); |
| 320 | 320 | tecmosys_tilemap_copy_to_compose(state, 0x0000); |
| 321 | 321 | |
| 322 | state->m_tmp_tilemap_renderbitmap->fill(0, | |
| 322 | state->m_tmp_tilemap_renderbitmap->fill(0, | |
| 323 | 323 | tilemap_draw(state->m_tmp_tilemap_renderbitmap,cliprect,state->m_bg1tilemap,0,0); |
| 324 | 324 | tecmosys_tilemap_copy_to_compose(state, 0x4000); |
| 325 | 325 | |
| 326 | state->m_tmp_tilemap_renderbitmap->fill(0, | |
| 326 | state->m_tmp_tilemap_renderbitmap->fill(0, | |
| 327 | 327 | tilemap_draw(state->m_tmp_tilemap_renderbitmap,cliprect,state->m_bg2tilemap,0,0); |
| 328 | 328 | tecmosys_tilemap_copy_to_compose(state, 0x8000); |
| 329 | 329 | |
| 330 | state->m_tmp_tilemap_renderbitmap->fill(0, | |
| 330 | state->m_tmp_tilemap_renderbitmap->fill(0, | |
| 331 | 331 | tilemap_draw(state->m_tmp_tilemap_renderbitmap,cliprect,state->m_txt_tilemap,0,0); |
| 332 | 332 | tecmosys_tilemap_copy_to_compose(state, 0xc000); |
| 333 | 333 |
| r13798 | r13799 | |
|---|---|---|
| 15 | 15 | |
| 16 | 16 | /* not standard snowbros video */ |
| 17 | 17 | |
| 18 | bitmap->fill(0xf0, | |
| 18 | bitmap->fill(0xf0, | |
| 19 | 19 | |
| 20 | 20 | for (offs = 0x0000/2;offs < 0x2000/2;offs += 8) |
| 21 | 21 | { |
| r13798 | r13799 | |
| 101 | 101 | |
| 102 | 102 | /* not standard snowbros video */ |
| 103 | 103 | |
| 104 | bitmap->fill(0xf0, | |
| 104 | bitmap->fill(0xf0, | |
| 105 | 105 | |
| 106 | 106 | for (offs = 0x0000/2;offs < 0x2000/2;offs += 8) |
| 107 | 107 | { |
| r13798 | r13799 | |
| 152 | 152 | UINT16 *spriteram16 = state->m_bootleg_spriteram16; |
| 153 | 153 | int offs; |
| 154 | 154 | |
| 155 | bitmap->fill(get_black_pen(screen.machine()), | |
| 155 | bitmap->fill(get_black_pen(screen.machine()), | |
| 156 | 156 | |
| 157 | 157 | for (offs = 0;offs < state->m_spriteram_size/2;offs += 8) |
| 158 | 158 | { |
| r13798 | r13799 | |
| 220 | 220 | |
| 221 | 221 | /* This clears & redraws the entire screen each pass */ |
| 222 | 222 | |
| 223 | bitmap->fill(get_black_pen(screen.machine()), | |
| 223 | bitmap->fill(get_black_pen(screen.machine()), | |
| 224 | 224 | |
| 225 | 225 | for (offs = 0;offs < state->m_spriteram_size/2;offs += 8) |
| 226 | 226 | { |
| r13798 | r13799 | |
|---|---|---|
| 84 | 84 | int gfx_num, gfx_attr, gfx_offs; |
| 85 | 85 | |
| 86 | 86 | /* Is this correct ? */ |
| 87 | bitmap->fill(1023, | |
| 87 | bitmap->fill(1023, | |
| 88 | 88 | |
| 89 | 89 | /* ---------- 1st TC0010VCU ---------- */ |
| 90 | 90 | sx = 0; |
| r13798 | r13799 | |
|---|---|---|
| 302 | 302 | * |
| 303 | 303 | *************************************/ |
| 304 | 304 | |
| 305 | static void draw_sprites(screen_device &screen, bitmap_t *bitmap, const rectangle | |
| 305 | static void draw_sprites(screen_device &screen, bitmap_t *bitmap, const rectangle &cliprect, | |
| 306 | 306 | int scroll_offset, int check_collision) |
| 307 | 307 | { |
| 308 | 308 | exidy440_state *state = screen.machine().driver_data<exidy440_state>(); |
| r13798 | r13799 | |
| 324 | 324 | UINT8 *src; |
| 325 | 325 | |
| 326 | 326 | /* skip if out of range */ |
| 327 | if (yoffs < cliprect | |
| 327 | if (yoffs < cliprect. | |
| 328 | 328 | continue; |
| 329 | 329 | |
| 330 | 330 | /* get a pointer to the source image */ |
| r13798 | r13799 | |
| 345 | 345 | sy += (VBSTART - VBEND); |
| 346 | 346 | |
| 347 | 347 | /* stop if we get before the current scanline */ |
| 348 | if (yoffs < cliprect | |
| 348 | if (yoffs < cliprect. | |
| 349 | 349 | break; |
| 350 | 350 | |
| 351 | 351 | /* only draw scanlines that are in this cliprect */ |
| 352 | if (yoffs <= cliprect | |
| 352 | if (yoffs <= cliprect. | |
| 353 | 353 | { |
| 354 | 354 | UINT8 *old = &state->m_local_videoram[sy * 512 + xoffs]; |
| 355 | 355 | int currx = xoffs; |
| r13798 | r13799 | |
| 403 | 403 | * |
| 404 | 404 | *************************************/ |
| 405 | 405 | |
| 406 | static void update_screen(screen_device &screen, bitmap_t *bitmap, const rectangle | |
| 406 | static void update_screen(screen_device &screen, bitmap_t *bitmap, const rectangle &cliprect, | |
| 407 | 407 | int scroll_offset, int check_collision) |
| 408 | 408 | { |
| 409 | 409 | exidy440_state *state = screen.machine().driver_data<exidy440_state>(); |
| 410 | 410 | int y, sy; |
| 411 | 411 | |
| 412 | 412 | /* 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++) | |
| 415 | 415 | { |
| 416 | 416 | /* wrap at the bottom of the screen */ |
| 417 | 417 | if (sy >= VBSTART) |
| r13798 | r13799 | |
| 439 | 439 | update_screen(screen, bitmap, cliprect, 0, TRUE); |
| 440 | 440 | |
| 441 | 441 | /* generate an interrupt once/frame for the beam */ |
| 442 | if (cliprect | |
| 442 | if (cliprect. | |
| 443 | 443 | { |
| 444 | 444 | int i; |
| 445 | 445 |
| r13798 | r13799 | |
|---|---|---|
| 11 | 11 | |
| 12 | 12 | /******************************************************************************/ |
| 13 | 13 | |
| 14 | static void draw_sprites( running_machine& machine, bitmap_t *bitmap, const rectangle | |
| 14 | static void draw_sprites( running_machine& machine, bitmap_t *bitmap, const rectangle &cliprect, int pf_priority ) | |
| 15 | 15 | { |
| 16 | 16 | dassault_state *state = machine.driver_data<dassault_state>(); |
| 17 | 17 | UINT16 *buffered_spriteram = machine.generic.buffered_spriteram.u16; |
| r13798 | r13799 | |
| 186 | 186 | |
| 187 | 187 | /* Draw playfields/update priority bitmap */ |
| 188 | 188 | 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); | |
| 191 | 191 | deco16ic_tilemap_2_draw(state->m_deco_tilegen2, bitmap, cliprect, TILEMAP_DRAW_OPAQUE, 0); |
| 192 | 192 | |
| 193 | 193 | /* The middle playfields can be swapped priority-wise */ |
| r13798 | r13799 | |
|---|---|---|
| 236 | 236 | } |
| 237 | 237 | |
| 238 | 238 | |
| 239 | static void draw_objects(running_machine &machine, bitmap_t *bitmap, const rectangle | |
| 239 | static void draw_objects(running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect ) | |
| 240 | 240 | { |
| 241 | 241 | ssrj_state *state = machine.driver_data<ssrj_state>(); |
| 242 | 242 | int i,j,k,x,y; |
| r13798 | r13799 | |
|---|---|---|
| 113 | 113 | state->m_bg_tilemap = tilemap_create(machine, get_bg_tile_info, tilemap_scan_rows, 8, 8, 32, 32); |
| 114 | 114 | } |
| 115 | 115 | |
| 116 | static void draw_sprites(running_machine &machine, bitmap_t *bitmap, const rectangle | |
| 116 | static void draw_sprites(running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect ) | |
| 117 | 117 | { |
| 118 | 118 | /* This is strange; it's unlikely that the sprites actually have a hardware */ |
| 119 | 119 | /* clipping region, but I haven't found another way to have them masked by */ |
| r13798 | r13799 | |
| 137 | 137 | color = spriteram[offs] & 0x1f; |
| 138 | 138 | schar = spriteram[offs + 2] & 0x7f; |
| 139 | 139 | |
| 140 | drawgfx_transmask(bitmap, | |
| 140 | drawgfx_transmask(bitmap, | |
| 141 | 141 | schar, |
| 142 | 142 | color, |
| 143 | 143 | flipx,flipy, |
| r13798 | r13799 | |
|---|---|---|
| 115 | 115 | state->m_bg_tilemap = tilemap_create(machine, get_bg_tile_info, tilemap_scan_rows_thehand, 8, 8, 64, 32); |
| 116 | 116 | } |
| 117 | 117 | |
| 118 | static void draw_status_row( running_machine &machine, bitmap_t *bitmap, const rectangle | |
| 118 | static void draw_status_row( running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect, int sx, int col ) | |
| 119 | 119 | { |
| 120 | 120 | gotya_state *state = machine.driver_data<gotya_state>(); |
| 121 | 121 | int row; |
| r13798 | r13799 | |
| 143 | 143 | } |
| 144 | 144 | } |
| 145 | 145 | |
| 146 | static void draw_sprites( running_machine &machine, bitmap_t *bitmap, const rectangle | |
| 146 | static void draw_sprites( running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect ) | |
| 147 | 147 | { |
| 148 | 148 | gotya_state *state = machine.driver_data<gotya_state>(); |
| 149 | 149 | UINT8 *spriteram = state->m_spriteram; |
| r13798 | r13799 | |
| 167 | 167 | } |
| 168 | 168 | } |
| 169 | 169 | |
| 170 | static void draw_status( running_machine &machine, bitmap_t *bitmap, const rectangle | |
| 170 | static void draw_status( running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect ) | |
| 171 | 171 | { |
| 172 | 172 | draw_status_row(machine, bitmap, cliprect, 0, 1); |
| 173 | 173 | draw_status_row(machine, bitmap, cliprect, 1, 0); |
| r13798 | r13799 | |
|---|---|---|
| 249 | 249 | /********************************************************************/ |
| 250 | 250 | |
| 251 | 251 | INLINE void roundupt_drawgfxzoomrotate( |
| 252 | bitmap_t *dest_bmp, const rectangle | |
| 252 | bitmap_t *dest_bmp, const rectangle &clip, const gfx_element *gfx, | |
| 253 | 253 | UINT32 code,UINT32 color,int flipx,int flipy,UINT32 ssx,UINT32 ssy, |
| 254 | 254 | int scalex, int scaley, int rotate, int write_priority_only ) |
| 255 | 255 | { |
| r13798 | r13799 | |
| 266 | 266 | */ |
| 267 | 267 | |
| 268 | 268 | /* 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(); | |
| 275 | 271 | |
| 276 | 272 | { |
| 277 | 273 | if( gfx ) |
| r13798 | r13799 | |
| 338 | 334 | y_index = 0; |
| 339 | 335 | } |
| 340 | 336 | |
| 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; | |
| 366 | 342 | } |
| 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 | } | |
| 367 | 360 | |
| 368 | 361 | if( ex>sx ) |
| 369 | 362 | { /* skip if inner loop doesn't draw anything */ |
| r13798 | r13799 | |
| 457 | 450 | |
| 458 | 451 | static void mycopyrozbitmap_core(bitmap_t *bitmap,bitmap_t *srcbitmap, |
| 459 | 452 | int dstx,int dsty, int srcwidth, int srcheight,int incxx,int incxy,int incyx,int incyy, |
| 460 | const rectangle | |
| 453 | const rectangle &clip,int transparent_color) | |
| 461 | 454 | { |
| 462 | 455 | UINT32 cx; |
| 463 | 456 | UINT32 cy; |
| r13798 | r13799 | |
| 480 | 473 | ex = dstx + srcwidth; |
| 481 | 474 | ey = dsty + srcheight; |
| 482 | 475 | |
| 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; | |
| 487 | 480 | |
| 488 | 481 | if (sx <= ex) |
| 489 | 482 | { |
| r13798 | r13799 | |
| 517 | 510 | } |
| 518 | 511 | } |
| 519 | 512 | |
| 520 | static void draw_sprites(running_machine &machine, bitmap_t *bitmap, const rectangle | |
| 513 | static void draw_sprites(running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect, int write_priority_only, int rambank) | |
| 521 | 514 | { |
| 522 | 515 | tatsumi_state *state = machine.driver_data<tatsumi_state>(); |
| 523 | 516 | UINT16 *spriteram16 = state->m_spriteram; |
| r13798 | r13799 | |
| 704 | 697 | } |
| 705 | 698 | } |
| 706 | 699 | |
| 707 | static void draw_sky(running_machine &machine, bitmap_t *bitmap,const rectangle | |
| 700 | static void draw_sky(running_machine &machine, bitmap_t *bitmap,const rectangle &cliprect, int palette_base, int start_offset) | |
| 708 | 701 | { |
| 709 | 702 | // all todo |
| 710 | 703 | int x,y; |
| r13798 | r13799 | |
| 726 | 719 | } |
| 727 | 720 | } |
| 728 | 721 | |
| 729 | static void draw_road(running_machine &machine, bitmap_t *bitmap,const rectangle | |
| 722 | static void draw_road(running_machine &machine, bitmap_t *bitmap,const rectangle &cliprect,bitmap_t *shadow_bitmap) | |
| 730 | 723 | { |
| 731 | 724 | tatsumi_state *state = machine.driver_data<tatsumi_state>(); |
| 732 | 725 | /* |
| r13798 | r13799 | |
| 1017 | 1010 | |
| 1018 | 1011 | /* Draw the sky and ground, applying rotation (eventually). Experimental! */ |
| 1019 | 1012 | #if 0 |
| 1020 | static void draw_ground(running_machine &machine, bitmap_t *dst, const rectangle | |
| 1013 | static void draw_ground(running_machine &machine, bitmap_t *dst, const rectangle &cliprect) | |
| 1021 | 1014 | { |
| 1022 | 1015 | tatsumi_state *state = machine.driver_data<tatsumi_state>(); |
| 1023 | 1016 | int x, y; |
| r13798 | r13799 | |
| 1026 | 1019 | UINT16 gva = 0x180; // TODO |
| 1027 | 1020 | UINT8 sky_val = state->m_apache3_rotate_ctrl[1] & 0xff; |
| 1028 | 1021 | |
| 1029 | for (y = cliprect | |
| 1022 | for (y = cliprect. | |
| 1030 | 1023 | { |
| 1031 | 1024 | UINT16 rgdb = 0;//state->m_apache3_road_x_ram[gva & 0xff]; |
| 1032 | 1025 | UINT16 gha = 0xf60; // test |
| r13798 | r13799 | |
| 1035 | 1028 | if (gva & 0x100) |
| 1036 | 1029 | { |
| 1037 | 1030 | /* Sky */ |
| 1038 | for (x = cliprect | |
| 1031 | for (x = cliprect. | |
| 1039 | 1032 | { |
| 1040 | 1033 | dst->pix32(y, x) = machine.pens[0x100 + (sky_val & 0x7f)]; |
| 1041 | 1034 | |
| r13798 | r13799 | |
| 1046 | 1039 | else |
| 1047 | 1040 | { |
| 1048 | 1041 | /* Ground */ |
| 1049 | for (x = cliprect | |
| 1042 | for (x = cliprect. | |
| 1050 | 1043 | { |
| 1051 | 1044 | UINT8 colour; |
| 1052 | 1045 | UINT16 hval; |
| r13798 | r13799 | |
| 1089 | 1082 | |
| 1090 | 1083 | tilemap_set_scrollx(state->m_tx_layer,0,24); |
| 1091 | 1084 | |
| 1092 | bitmap->fill(screen.machine().pens[0], | |
| 1085 | bitmap->fill(screen.machine().pens[0], | |
| 1093 | 1086 | draw_sky(screen.machine(), bitmap, cliprect, 256, state->m_apache3_rotate_ctrl[1]); |
| 1094 | 1087 | // draw_ground(screen.machine(), bitmap, cliprect); |
| 1095 | 1088 | draw_sprites(screen.machine(), bitmap,cliprect,0, (state->m_sprite_control_ram[0x20]&0x1000) ? 0x1000 : 0); |
| r13798 | r13799 | |
| 1108 | 1101 | tilemap_set_scrollx(state->m_tx_layer,0,24); |
| 1109 | 1102 | tilemap_set_scrolly(state->m_tx_layer,0,0); //(((state->m_roundupt_crt_reg[0xe]<<8)|state->m_roundupt_crt_reg[0xf])>>5) + 96); |
| 1110 | 1103 | |
| 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); | |
| 1113 | 1106 | |
| 1114 | 1107 | draw_sprites(screen.machine(), screen.machine().priority_bitmap,cliprect,1,(state->m_sprite_control_ram[0xe0]&0x1000) ? 0x1000 : 0); // Alpha pass only |
| 1115 | 1108 | draw_road(screen.machine(), bitmap,cliprect,screen.machine().priority_bitmap); |
| r13798 | r13799 | |
| 1131 | 1124 | state->m_bigfight_last_bank=state->m_bigfight_bank; |
| 1132 | 1125 | } |
| 1133 | 1126 | |
| 1134 | bitmap->fill(screen.machine().pens[0], | |
| 1127 | bitmap->fill(screen.machine().pens[0], | |
| 1135 | 1128 | |
| 1136 | 1129 | 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); |
| 1137 | 1130 | 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); |
| r13798 | r13799 | |
| 1156 | 1149 | state->m_bigfight_last_bank=state->m_bigfight_bank; |
| 1157 | 1150 | } |
| 1158 | 1151 | |
| 1159 | bitmap->fill(screen.machine().pens[0], | |
| 1152 | bitmap->fill(screen.machine().pens[0], | |
| 1160 | 1153 | 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); |
| 1161 | 1154 | 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); |
| 1162 | 1155 | 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); |
| r13798 | r13799 | |
|---|---|---|
| 126 | 126 | /* A special pdrawgfx z-buffered sprite renderer that is needed to properly draw multiple sprite sources with alpha */ |
| 127 | 127 | void decocomn_pdrawgfx( |
| 128 | 128 | device_t *device, |
| 129 | bitmap_t *dest, const rectangle | |
| 129 | bitmap_t *dest, const rectangle &clip, const gfx_element *gfx, | |
| 130 | 130 | UINT32 code, UINT32 color, int flipx, int flipy, int sx, int sy, |
| 131 | 131 | int transparent_color, UINT32 pri_mask, UINT32 sprite_mask, UINT8 write_pri, UINT8 alpha) |
| 132 | 132 | { |
| r13798 | r13799 | |
|---|---|---|
| 29 | 29 | flip_screen_set(screen.machine(), BIT(flip, 7)); |
| 30 | 30 | deco16ic_pf_update(state->m_deco_tilegen1, state->m_pf1_rowscroll, state->m_pf2_rowscroll); |
| 31 | 31 | |
| 32 | bitmap->fill(768, | |
| 32 | bitmap->fill(768, | |
| 33 | 33 | |
| 34 | 34 | deco16ic_tilemap_2_draw(state->m_deco_tilegen1, bitmap, cliprect, 0, 0); |
| 35 | 35 | screen.machine().device<decospr_device>("spritegen")->draw_sprites(screen.machine(), bitmap, cliprect, state->m_spriteram, 0x400); |
| r13798 | r13799 | |
|---|---|---|
| 1518 | 1518 | // there is another implementation of this in machine/konamigx.c (!) |
| 1519 | 1519 | // why? |
| 1520 | 1520 | |
| 1521 | static void K053936_zoom_draw(int chip,UINT16 *ctrl,UINT16 *linectrl, bitmap_t *bitmap,const rectangle | |
| 1521 | static 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) | |
| 1522 | 1522 | { |
| 1523 | 1523 | if (!tmap) |
| 1524 | 1524 | return; |
| r13798 | r13799 | |
| 1542 | 1542 | { |
| 1543 | 1543 | my_clip.min_x = ctrl[0x08] + K053936_offset[chip][0]+2; |
| 1544 | 1544 | 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; | |
| 1549 | 1549 | |
| 1550 | 1550 | 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; | |
| 1553 | 1553 | 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; | |
| 1556 | 1556 | } |
| 1557 | 1557 | else |
| 1558 | 1558 | { |
| 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; | |
| 1561 | 1561 | |
| 1562 | y = cliprect->min_y; | |
| 1563 | maxy = cliprect->max_y; | |
| 1562 | y = cliprect.min_y; | |
| 1563 | maxy = cliprect.max_y; | |
| 1564 | 1564 | } |
| 1565 | 1565 | |
| 1566 | 1566 | while (y <= maxy) |
| r13798 | r13799 | |
| 1581 | 1581 | startx -= K053936_offset[chip][0] * incxx; |
| 1582 | 1582 | starty -= K053936_offset[chip][0] * incxy; |
| 1583 | 1583 | |
| 1584 | tilemap_draw_roz(bitmap, | |
| 1584 | tilemap_draw_roz(bitmap, | |
| 1585 | 1585 | incxx << 5,incxy << 5,0,0, |
| 1586 | 1586 | K053936_wraparound[chip], |
| 1587 | 1587 | flags,priority); |
| r13798 | r13799 | |
| 1639 | 1639 | } |
| 1640 | 1640 | |
| 1641 | 1641 | |
| 1642 | void K053936_0_zoom_draw(bitmap_t *bitmap,const rectangle | |
| 1642 | void K053936_0_zoom_draw(bitmap_t *bitmap,const rectangle &cliprect,tilemap_t *tmap,int flags,UINT32 priority, int glfgreat_hack) | |
| 1643 | 1643 | { |
| 1644 | 1644 | K053936_zoom_draw(0,K053936_0_ctrl,K053936_0_linectrl,bitmap,cliprect,tmap,flags,priority, glfgreat_hack); |
| 1645 | 1645 | } |
| r13798 | r13799 | |
| 2594 | 2594 | // force tilemap into a clean, static state |
| 2595 | 2595 | // *really ugly but it minimizes alteration to tilemap.c |
| 2596 | 2596 | memset (&zerorect, 0, sizeof(rectangle)); // zero dimension |
| 2597 | tilemap_draw(bitmap, | |
| 2597 | tilemap_draw(bitmap, | |
| 2598 | 2598 | xprmap->fill(0); // reset pixel transparency_bitmap; |
| 2599 | 2599 | memset(xprdata, TILEMAP_PIXEL_LAYER0, 0x800); // reset tile transparency_data; |
| 2600 | 2600 | } |
| r13798 | r13799 | |
| 2687 | 2687 | return(0); |
| 2688 | 2688 | } |
| 2689 | 2689 | |
| 2690 | void K056832_tilemap_draw(running_machine &machine, bitmap_t *bitmap, const rectangle | |
| 2690 | void K056832_tilemap_draw(running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect, int layer, UINT32 flags, UINT32 priority) | |
| 2691 | 2691 | { |
| 2692 | 2692 | static int last_colorbase[K056832_PAGE_COUNT]; |
| 2693 | 2693 | |
| r13798 | r13799 | |
| 2721 | 2721 | height = rowspan * K056832_PAGE_HEIGHT; |
| 2722 | 2722 | width = colspan * K056832_PAGE_WIDTH; |
| 2723 | 2723 | |
| 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; | |
| 2728 | 2728 | |
| 2729 | 2729 | // flip correction registers |
| 2730 | 2730 | flipy = K056832_regs[0] & 0x20; |
| r13798 | r13799 | |
| 2961 | 2961 | // the tilemaps are 512 pixels across. Assume that if the limits were set as below that we |
| 2962 | 2962 | // want the tilemap to be drawn on the right hand side.. this is probably not the correct |
| 2963 | 2963 | // logic, but it works. |
| 2964 | if ((drawrect.min_x>0) && (drawrect.max_x==511)) drawrect.max_x=cliprect | |
| 2964 | if ((drawrect.min_x>0) && (drawrect.max_x==511)) drawrect.max_x=cliprect. | |
| 2965 | 2965 | |
| 2966 | 2966 | tilemap_set_scrollx(tmap, 0, dx); |
| 2967 | 2967 | |
| 2968 | 2968 | LINE_SHORTCIRCUIT: |
| 2969 | tilemap_draw(bitmap, | |
| 2969 | tilemap_draw(bitmap, | |
| 2970 | 2970 | |
| 2971 | 2971 | } // end of line loop |
| 2972 | 2972 | } // end of column loop |
| r13798 | r13799 | |
|---|---|---|
| 165 | 165 | |
| 166 | 166 | ***************************************************************************/ |
| 167 | 167 | |
| 168 | static void draw_sprites( running_machine &machine, bitmap_t *bitmap, const rectangle | |
| 168 | static void draw_sprites( running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect ) | |
| 169 | 169 | { |
| 170 | 170 | blmbycar_state *state = machine.driver_data<blmbycar_state>(); |
| 171 | 171 | UINT16 *source, *finish; |
| r13798 | r13799 | |
| 243 | 243 | } |
| 244 | 244 | #endif |
| 245 | 245 | |
| 246 | screen.machine().priority_bitmap->fill(0, | |
| 246 | screen.machine().priority_bitmap->fill(0, | |
| 247 | 247 | |
| 248 | 248 | if (layers_ctrl & 1) |
| 249 | 249 | for (i = 0; i <= 1; i++) |
| 250 | 250 | tilemap_draw(bitmap, cliprect, state->m_tilemap_0, i, i); |
| 251 | 251 | else |
| 252 | bitmap->fill(0, | |
| 252 | bitmap->fill(0, | |
| 253 | 253 | |
| 254 | 254 | if (layers_ctrl & 2) |
| 255 | 255 | for (i = 0; i <= 1; i++) |
| r13798 | r13799 | |
|---|---|---|
| 50 | 50 | void decocomn_clear_sprite_priority_bitmap(device_t *device); |
| 51 | 51 | void decocomn_pdrawgfx( |
| 52 | 52 | device_t *device, |
| 53 | bitmap_t *dest,const rectangle | |
| 53 | bitmap_t *dest,const rectangle &clip,const gfx_element *gfx, | |
| 54 | 54 | UINT32 code,UINT32 color,int flipx,int flipy,int sx,int sy, |
| 55 | 55 | int transparent_color,UINT32 pri_mask,UINT32 sprite_mask,UINT8 write_pri,UINT8 alpha); |
| 56 | 56 |
| r13798 | r13799 | |
|---|---|---|
| 212 | 212 | { |
| 213 | 213 | for (x = 0;x <= sizex;x++) |
| 214 | 214 | { |
| 215 | drawgfx_transmask(bitmap, | |
| 215 | drawgfx_transmask(bitmap, | |
| 216 | 216 | sprite + gfx_offs[y ^ (sizey * flipy)][x ^ (sizex * flipx)], |
| 217 | 217 | color, |
| 218 | 218 | flipx,flipy, |
| r13798 | r13799 | |
|---|---|---|
| 37 | 37 | |
| 38 | 38 | extern UINT16 *K053936_0_ctrl,*K053936_0_linectrl; |
| 39 | 39 | extern UINT16 *K053936_1_ctrl,*K053936_1_linectrl; |
| 40 | void K053936_0_zoom_draw(bitmap_t *bitmap,const rectangle | |
| 40 | void K053936_0_zoom_draw(bitmap_t *bitmap,const rectangle &cliprect,tilemap_t *tmap,int flags,UINT32 priority, int glfgreat_hack); | |
| 41 | 41 | void K053936_wraparound_enable(int chip, int status); |
| 42 | 42 | void K053936_set_offset(int chip, int xoffs, int yoffs); |
| 43 | 43 | |
| r13798 | r13799 | |
| 76 | 76 | WRITE16_HANDLER( K056832_b_word_w ); |
| 77 | 77 | void K056832_mark_plane_dirty(int num); |
| 78 | 78 | void K056832_MarkAllTilemapsDirty(void); |
| 79 | void K056832_tilemap_draw(running_machine &machine, bitmap_t *bitmap, const rectangle | |
| 79 | void K056832_tilemap_draw(running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect, int num, UINT32 flags, UINT32 priority); | |
| 80 | 80 | int K056832_get_LayerAssociation(void); |
| 81 | 81 | void K056832_set_LayerOffset(int layer, int offsx, int offsy); |
| 82 | 82 | void K056832_set_UpdateMode(int mode); |
| r13798 | r13799 | |
|---|---|---|
| 78 | 78 | * |
| 79 | 79 | *************************************/ |
| 80 | 80 | |
| 81 | static void draw_sprites(running_machine &machine, bitmap_t *bitmap, const rectangle | |
| 81 | static void draw_sprites(running_machine &machine, bitmap_t *bitmap, const rectangle &clip) | |
| 82 | 82 | { |
| 83 | 83 | meadows_state *state = machine.driver_data<meadows_state>(); |
| 84 | 84 | UINT8 *spriteram = state->m_spriteram; |
| r13798 | r13799 | |
|---|---|---|
| 104 | 104 | tilemap_set_transparent_pen(state->m_fg_tilemap, 0); |
| 105 | 105 | } |
| 106 | 106 | |
| 107 | static void draw_sprites( running_machine &machine, bitmap_t *bitmap, const rectangle | |
| 107 | static void draw_sprites( running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect ) | |
| 108 | 108 | { |
| 109 | 109 | bogeyman_state *state = machine.driver_data<bogeyman_state>(); |
| 110 | 110 | int offs; |
| r13798 | r13799 | |
|---|---|---|
| 53 | 53 | SCREEN_UPDATE( srmp2 ) |
| 54 | 54 | { |
| 55 | 55 | srmp2_state *state = screen.machine().driver_data<srmp2_state>(); |
| 56 | bitmap->fill(0x1ff, | |
| 56 | bitmap->fill(0x1ff, | |
| 57 | 57 | |
| 58 | 58 | screen.machine().device<seta001_device>("spritegen")->set_transpen(15); |
| 59 | 59 | |
| r13798 | r13799 | |
| 71 | 71 | SCREEN_UPDATE( srmp3 ) |
| 72 | 72 | { |
| 73 | 73 | //srmp2_state *state = screen.machine().driver_data<srmp2_state>(); |
| 74 | bitmap->fill(0x1f0, | |
| 74 | bitmap->fill(0x1f0, | |
| 75 | 75 | |
| 76 | 76 | screen.machine().device<seta001_device>("spritegen")->set_fg_xoffsets( 0x10, 0x10 ); |
| 77 | 77 | screen.machine().device<seta001_device>("spritegen")->set_fg_yoffsets( 0x06, 0x06 ); |
| r13798 | r13799 | |
| 87 | 87 | SCREEN_UPDATE( mjyuugi ) |
| 88 | 88 | { |
| 89 | 89 | //srmp2_state *state = screen.machine().driver_data<srmp2_state>(); |
| 90 | bitmap->fill(0x1f0, | |
| 90 | bitmap->fill(0x1f0, | |
| 91 | 91 | |
| 92 | 92 | screen.machine().device<seta001_device>("spritegen")->set_fg_xoffsets( 0x10, 0x10 ); |
| 93 | 93 | screen.machine().device<seta001_device>("spritegen")->set_fg_yoffsets( 0x06, 0x06 ); |
| r13798 | r13799 | |
|---|---|---|
| 430 | 430 | |
| 431 | 431 | ***************************************************************************/ |
| 432 | 432 | |
| 433 | static void m72_draw_sprites(running_machine &machine, bitmap_t *bitmap,const rectangle | |
| 433 | static void m72_draw_sprites(running_machine &machine, bitmap_t *bitmap,const rectangle &cliprect) | |
| 434 | 434 | { |
| 435 | 435 | m72_state *state = machine.driver_data<m72_state>(); |
| 436 | 436 | UINT16 *spriteram = state->m_buffered_spriteram; |
| r13798 | r13799 | |
| 484 | 484 | } |
| 485 | 485 | } |
| 486 | 486 | |
| 487 | static void majtitle_draw_sprites(running_machine &machine, bitmap_t *bitmap,const rectangle | |
| 487 | static void majtitle_draw_sprites(running_machine &machine, bitmap_t *bitmap,const rectangle &cliprect) | |
| 488 | 488 | { |
| 489 | 489 | m72_state *state = machine.driver_data<m72_state>(); |
| 490 | 490 | UINT16 *spriteram16_2 = state->m_spriteram2; |
| r13798 | r13799 | |
| 540 | 540 | m72_state *state = screen.machine().driver_data<m72_state>(); |
| 541 | 541 | if (state->m_video_off) |
| 542 | 542 | { |
| 543 | bitmap->fill(get_black_pen(screen.machine()), | |
| 543 | bitmap->fill(get_black_pen(screen.machine()), | |
| 544 | 544 | return 0; |
| 545 | 545 | } |
| 546 | 546 | |
| r13798 | r13799 | |
| 566 | 566 | |
| 567 | 567 | if (state->m_video_off) |
| 568 | 568 | { |
| 569 | bitmap->fill(get_black_pen(screen.machine()), | |
| 569 | bitmap->fill(get_black_pen(screen.machine()), | |
| 570 | 570 | return 0; |
| 571 | 571 | } |
| 572 | 572 |
| r13798 | r13799 | |
|---|---|---|
| 76 | 76 | |
| 77 | 77 | ***************************************************************************/ |
| 78 | 78 | |
| 79 | static void draw_sprites( running_machine &machine, bitmap_t *bitmap, const rectangle | |
| 79 | static void draw_sprites( running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect ) | |
| 80 | 80 | { |
| 81 | 81 | ohmygod_state *state = machine.driver_data<ohmygod_state>(); |
| 82 | 82 | UINT16 *spriteram = state->m_spriteram; |
| r13798 | r13799 | |
|---|---|---|
| 38 | 38 | 8, 8, 32, 32); |
| 39 | 39 | } |
| 40 | 40 | |
| 41 | static void draw_sprites(running_machine &machine, bitmap_t *bitmap, const rectangle | |
| 41 | static void draw_sprites(running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect) | |
| 42 | 42 | { |
| 43 | 43 | pokechmp_state *state = machine.driver_data<pokechmp_state>(); |
| 44 | 44 | UINT8 *spriteram = state->m_spriteram; |
| r13798 | r13799 | |
|---|---|---|
| 199 | 199 | |
| 200 | 200 | ***************************************************************************/ |
| 201 | 201 | |
| 202 | static void draw_sprites(running_machine &machine, bitmap_t *bitmap, const rectangle | |
| 202 | static void draw_sprites(running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect, int group) | |
| 203 | 203 | { |
| 204 | 204 | snk68_state *state = machine.driver_data<snk68_state>(); |
| 205 | 205 | UINT16 *spriteram16 = state->m_spriteram; |
| r13798 | r13799 | |
| 235 | 235 | { |
| 236 | 236 | my &= 0x1ff; |
| 237 | 237 | |
| 238 | if (my <= cliprect | |
| 238 | if (my <= cliprect. | |
| 239 | 239 | { |
| 240 | 240 | int color = *(tiledata++) & 0x7f; |
| 241 | 241 | int tile = *(tiledata++); |
| r13798 | r13799 | |
| 292 | 292 | { |
| 293 | 293 | snk68_state *state = screen.machine().driver_data<snk68_state>(); |
| 294 | 294 | |
| 295 | bitmap->fill(0x7ff, | |
| 295 | bitmap->fill(0x7ff, | |
| 296 | 296 | |
| 297 | 297 | /* This appears to be the correct priority order */ |
| 298 | 298 | draw_sprites(screen.machine(), bitmap, cliprect, 2); |
| r13798 | r13799 | |
|---|---|---|
| 155 | 155 | |
| 156 | 156 | gfx_element_set_source(machine.gfx[0], state->m_charram); |
| 157 | 157 | |
| 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); | |
| 160 | 160 | } |
| 161 | 161 | |
| 162 | 162 | |
| 163 | static void draw_edges(running_machine &machine, bitmap_t *bitmap, const rectangle | |
| 163 | static void draw_edges(running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect, int flip, int scroll_mode) | |
| 164 | 164 | { |
| 165 | 165 | madalien_state *state = machine.driver_data<madalien_state>(); |
| 166 | 166 | rectangle clip_edge1; |
| 167 | 167 | rectangle clip_edge2; |
| 168 | 168 | |
| 169 | clip_edge1 = *cliprect; | |
| 170 | clip_edge2 = *cliprect; | |
| 169 | clip_edge1 = cliprect; | |
| 170 | clip_edge2 = cliprect; | |
| 171 | 171 | |
| 172 | 172 | if (flip) |
| 173 | 173 | { |
| r13798 | r13799 | |
| 180 | 180 | clip_edge2.min_y = *state->m_edge2_pos | 0x80; |
| 181 | 181 | } |
| 182 | 182 | |
| 183 | clip_edge1 &= *cliprect; | |
| 184 | clip_edge2 &= *cliprect; | |
| 183 | clip_edge1 &= cliprect; | |
| 184 | clip_edge2 &= cliprect; | |
| 185 | 185 | |
| 186 | 186 | tilemap_mark_all_tiles_dirty(state->m_tilemap_edge1[scroll_mode]); |
| 187 | 187 | tilemap_mark_all_tiles_dirty(state->m_tilemap_edge2[scroll_mode]); |
| r13798 | r13799 | |
| 194 | 194 | tilemap_set_scrollx(state->m_tilemap_edge2[scroll_mode], 0, -(*state->m_scroll & 0xfc)); |
| 195 | 195 | tilemap_set_scrolly(state->m_tilemap_edge2[scroll_mode], 0, *state->m_edge2_pos & 0x7f); |
| 196 | 196 | |
| 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); | |
| 199 | 199 | } |
| 200 | 200 | |
| 201 | 201 | |
| 202 | static void draw_headlight(running_machine &machine, bitmap_t *bitmap, const rectangle | |
| 202 | static void draw_headlight(running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect, int flip) | |
| 203 | 203 | { |
| 204 | 204 | madalien_state *state = machine.driver_data<madalien_state>(); |
| 205 | 205 | if (BIT(*state->m_video_flags, 0)) |
| r13798 | r13799 | |
| 214 | 214 | if (flip) |
| 215 | 215 | hy = ~hy; |
| 216 | 216 | |
| 217 | if ((hy < cliprect | |
| 217 | if ((hy < cliprect. | |
| 218 | 218 | continue; |
| 219 | 219 | |
| 220 | 220 | for (x = 0; x < 0x80; x++) |
| r13798 | r13799 | |
| 224 | 224 | if (flip) |
| 225 | 225 | hx = ~hx; |
| 226 | 226 | |
| 227 | if ((hx < cliprect | |
| 227 | if ((hx < cliprect. | |
| 228 | 228 | continue; |
| 229 | 229 | |
| 230 | 230 | if (state->m_headlight_bitmap->pix16(y, x) != 0) |
| r13798 | r13799 | |
| 235 | 235 | } |
| 236 | 236 | |
| 237 | 237 | |
| 238 | static void draw_foreground(running_machine &machine, bitmap_t *bitmap, const rectangle | |
| 238 | static void draw_foreground(running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect, int flip) | |
| 239 | 239 | { |
| 240 | 240 | madalien_state *state = machine.driver_data<madalien_state>(); |
| 241 | 241 | tilemap_set_flip(state->m_tilemap_fg, flip ? TILEMAP_FLIPX | TILEMAP_FLIPY : 0); |
| r13798 | r13799 | |
| 265 | 265 | // mode 3 - transition from A to B |
| 266 | 266 | int scroll_mode = *state->m_scroll & 3; |
| 267 | 267 | |
| 268 | bitmap->fill(0, | |
| 268 | bitmap->fill(0, | |
| 269 | 269 | draw_edges(screen.machine(), bitmap, cliprect, flip, scroll_mode); |
| 270 | 270 | draw_foreground(screen.machine(), bitmap, cliprect, flip); |
| 271 | 271 | |
| r13798 | r13799 | |
| 295 | 295 | min_x = 0xff - max_x_save; |
| 296 | 296 | } |
| 297 | 297 | |
| 298 | for (y = cliprect | |
| 298 | for (y = cliprect. | |
| 299 | 299 | for (x = min_x; x <= max_x; x++) |
| 300 | if ((x >= cliprect | |
| 300 | if ((x >= cliprect. | |
| 301 | 301 | bitmap->pix16(y, x) |= 8; |
| 302 | 302 | } |
| 303 | 303 |
| r13798 | r13799 | |
|---|---|---|
| 129 | 129 | |
| 130 | 130 | ***************************************************************************/ |
| 131 | 131 | |
| 132 | static void draw_sprites( running_machine &machine, bitmap_t *bitmap, const rectangle | |
| 132 | static void draw_sprites( running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect ) | |
| 133 | 133 | { |
| 134 | 134 | aeroboto_state *state = machine.driver_data<aeroboto_state>(); |
| 135 | 135 | int offs; |
| r13798 | r13799 | |
| 176 | 176 | |
| 177 | 177 | star_color += 2; |
| 178 | 178 | |
| 179 | bitmap->fill(sky_color, | |
| 179 | bitmap->fill(sky_color, | |
| 180 | 180 | |
| 181 | 181 | // actual scroll speed is unknown but it can be adjusted by changing the SCROLL_SPEED constant |
| 182 | 182 | state->m_sx += (char)(*state->m_starx - state->m_ox); |
| r13798 | r13799 | |
| 210 | 210 | { |
| 211 | 211 | state->m_sx = state->m_ox = *state->m_starx; |
| 212 | 212 | state->m_sy = state->m_oy = *state->m_stary; |
| 213 | bitmap->fill(sky_color, | |
| 213 | bitmap->fill(sky_color, | |
| 214 | 214 | } |
| 215 | 215 | |
| 216 | 216 | for (y = 0; y < 64; y++) |
| r13798 | r13799 | |
| 218 | 218 | |
| 219 | 219 | // the playfield is part of a splitscreen and should not overlap with status display |
| 220 | 220 | tilemap_set_scrolly(state->m_bg_tilemap, 0, *state->m_vscroll); |
| 221 | tilemap_draw(bitmap, | |
| 221 | tilemap_draw(bitmap, | |
| 222 | 222 | |
| 223 | 223 | draw_sprites(screen.machine(), bitmap, cliprect); |
| 224 | 224 | |
| 225 | 225 | // the status display behaves more closely to a 40-line splitscreen than an overlay |
| 226 | 226 | tilemap_set_scrolly(state->m_bg_tilemap, 0, 0); |
| 227 | tilemap_draw(bitmap, | |
| 227 | tilemap_draw(bitmap, | |
| 228 | 228 | return 0; |
| 229 | 229 | } |
| r13798 | r13799 | |
|---|---|---|
| 200 | 200 | |
| 201 | 201 | ***************************************************************************/ |
| 202 | 202 | |
| 203 | static void draw_sprites( running_machine &machine, bitmap_t *bitmap, const rectangle | |
| 203 | static void draw_sprites( running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect ) | |
| 204 | 204 | { |
| 205 | 205 | firetrap_state *state = machine.driver_data<firetrap_state>(); |
| 206 | 206 | int offs; |
| r13798 | r13799 | |
|---|---|---|
| 147 | 147 | |
| 148 | 148 | ***************************************************************************/ |
| 149 | 149 | |
| 150 | static void draw_sprites(running_machine &machine, bitmap_t *bitmap, const rectangle | |
| 150 | static void draw_sprites(running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect) | |
| 151 | 151 | { |
| 152 | 152 | thedeep_state *state = machine.driver_data<thedeep_state>(); |
| 153 | 153 | UINT8 *s = state->m_spriteram, *end = s + state->m_spriteram_size; |
| r13798 | r13799 | |
| 224 | 224 | tilemap_set_scrolly(state->m_tilemap_0, x, y + scrolly); |
| 225 | 225 | } |
| 226 | 226 | |
| 227 | bitmap->fill(get_black_pen(screen.machine()), | |
| 227 | bitmap->fill(get_black_pen(screen.machine()), | |
| 228 | 228 | |
| 229 | 229 | tilemap_draw(bitmap,cliprect,state->m_tilemap_0,0,0); |
| 230 | 230 | draw_sprites(screen.machine(), bitmap,cliprect); |
| r13798 | r13799 | |
|---|---|---|
| 66 | 66 | tilemap_set_transparent_pen(state->m_fg_tilemap, 0); |
| 67 | 67 | } |
| 68 | 68 | |
| 69 | static void draw_crosshairs( running_machine &machine, bitmap_t *bitmap, const rectangle | |
| 69 | static void draw_crosshairs( running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect ) | |
| 70 | 70 | { |
| 71 | 71 | oneshot_state *state = machine.driver_data<oneshot_state>(); |
| 72 | 72 | //int xpos,ypos; |
| r13798 | r13799 | |
| 99 | 99 | state->m_gun_x_p2 = 0; |
| 100 | 100 | } |
| 101 | 101 | |
| 102 | static void draw_sprites( running_machine &machine, bitmap_t *bitmap, const rectangle | |
| 102 | static void draw_sprites( running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect ) | |
| 103 | 103 | { |
| 104 | 104 | oneshot_state *state = machine.driver_data<oneshot_state>(); |
| 105 | 105 | const UINT16 *source = state->m_sprites; |
| r13798 | r13799 | |
| 160 | 160 | { |
| 161 | 161 | oneshot_state *state = screen.machine().driver_data<oneshot_state>(); |
| 162 | 162 | |
| 163 | bitmap->fill(get_black_pen(screen.machine()), | |
| 163 | bitmap->fill(get_black_pen(screen.machine()), | |
| 164 | 164 | |
| 165 | 165 | tilemap_set_scrollx(state->m_mid_tilemap, 0, state->m_scroll[0] - 0x1f5); |
| 166 | 166 | tilemap_set_scrolly(state->m_mid_tilemap, 0, state->m_scroll[1]); |
| r13798 | r13799 | |
| 177 | 177 | { |
| 178 | 178 | oneshot_state *state = screen.machine().driver_data<oneshot_state>(); |
| 179 | 179 | |
| 180 | bitmap->fill(get_black_pen(screen.machine()), | |
| 180 | bitmap->fill(get_black_pen(screen.machine()), | |
| 181 | 181 | |
| 182 | 182 | 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 |
| 183 | 183 |
| r13798 | r13799 | |
|---|---|---|
| 99 | 99 | |
| 100 | 100 | /* sprites - quite a bit still needs doing .. */ |
| 101 | 101 | |
| 102 | static void draw_sprites(running_machine &machine, bitmap_t *bitmap, const rectangle | |
| 102 | static void draw_sprites(running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect ) | |
| 103 | 103 | { |
| 104 | 104 | stlforce_state *state = machine.driver_data<stlforce_state>(); |
| 105 | 105 | const UINT16 *source = state->m_spriteram+0x0; |
| r13798 | r13799 | |
|---|---|---|
| 26 | 26 | |
| 27 | 27 | ********************************************************************************/ |
| 28 | 28 | |
| 29 | static void draw_sprites( running_machine &machine, bitmap_t *bitmap, const rectangle | |
| 29 | static void draw_sprites( running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect ) | |
| 30 | 30 | { |
| 31 | 31 | topspeed_state *state = machine.driver_data<topspeed_state>(); |
| 32 | 32 | UINT16 *spriteram = state->m_spriteram; |
| r13798 | r13799 | |
| 155 | 155 | layer[2] = 1; |
| 156 | 156 | layer[3] = 0; |
| 157 | 157 | |
| 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); | |
| 160 | 160 | |
| 161 | 161 | #ifdef MAME_DEBUG |
| 162 | 162 | if (state->m_dislayer[3] == 0) |
| r13798 | r13799 | |
|---|---|---|
| 103 | 103 | |
| 104 | 104 | ***************************************************************************/ |
| 105 | 105 | |
| 106 | static void draw_sprites( running_machine &machine, bitmap_t *bitmap, const rectangle | |
| 106 | static void draw_sprites( running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect ) | |
| 107 | 107 | { |
| 108 | 108 | amspdwy_state *state = machine.driver_data<amspdwy_state>(); |
| 109 | 109 | UINT8 *spriteram = state->m_spriteram; |
| r13798 | r13799 | |
|---|---|---|
| 61 | 61 | #include "emu.h" |
| 62 | 62 | #include "includes/fantland.h" |
| 63 | 63 | |
| 64 | static void draw_sprites(running_machine &machine, bitmap_t *bitmap,const rectangle | |
| 64 | static void draw_sprites(running_machine &machine, bitmap_t *bitmap,const rectangle &cliprect) | |
| 65 | 65 | { |
| 66 | 66 | fantland_state *state = machine.driver_data<fantland_state>(); |
| 67 | 67 | UINT8 *spriteram_2 = state->m_spriteram2; |
| r13798 | r13799 | |
| 141 | 141 | |
| 142 | 142 | SCREEN_UPDATE( fantland ) |
| 143 | 143 | { |
| 144 | bitmap->fill(0, | |
| 144 | bitmap->fill(0, | |
| 145 | 145 | draw_sprites(screen.machine(),bitmap,cliprect); |
| 146 | 146 | |
| 147 | 147 | return 0; |
| r13798 | r13799 | |
|---|---|---|
| 238 | 238 | int x, y; |
| 239 | 239 | |
| 240 | 240 | /* draw the playfield */ |
| 241 | priority_bitmap->fill(0, | |
| 241 | priority_bitmap->fill(0, | |
| 242 | 242 | tilemap_draw(state->m_pfbitmap, cliprect, state->m_playfield_tilemap, 0, 0); |
| 243 | 243 | tilemap_draw(state->m_pfbitmap, cliprect, state->m_playfield_tilemap, 1, 1); |
| 244 | 244 | tilemap_draw(state->m_pfbitmap, cliprect, state->m_playfield_tilemap, 2, 2); |
| r13798 | r13799 | |
| 246 | 246 | |
| 247 | 247 | /* draw and merge the MO */ |
| 248 | 248 | mobitmap = atarimo_render(0, cliprect, &rectlist); |
| 249 | for (y = cliprect | |
| 249 | for (y = cliprect. | |
| 250 | 250 | { |
| 251 | 251 | UINT32 *dest = &bitmap->pix32(y); |
| 252 | 252 | UINT16 *mo = &mobitmap->pix16(y); |
| 253 | 253 | UINT16 *pf = &state->m_pfbitmap->pix16(y); |
| 254 | 254 | UINT8 *pri = &priority_bitmap->pix8(y); |
| 255 | for (x = cliprect | |
| 255 | for (x = cliprect. | |
| 256 | 256 | { |
| 257 | 257 | UINT16 pix = pf[x]; |
| 258 | 258 | if (mo[x]) |
| r13798 | r13799 | |
|---|---|---|
| 113 | 113 | |
| 114 | 114 | ***************************************************************************/ |
| 115 | 115 | |
| 116 | static void draw_sprites(running_machine &machine, bitmap_t *bitmap, const rectangle | |
| 116 | static void draw_sprites(running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect) | |
| 117 | 117 | { |
| 118 | 118 | UINT8 *buffered_spriteram = machine.generic.buffered_spriteram.u8; |
| 119 | 119 | int offs; |
| r13798 | r13799 | |
|---|---|---|
| 251 | 251 | |
| 252 | 252 | *************************************************************************/ |
| 253 | 253 | |
| 254 | static void draw_sprites(running_machine &machine, bitmap_t *bitmap,const rectangle | |
| 254 | static void draw_sprites(running_machine &machine, bitmap_t *bitmap,const rectangle &cliprect) | |
| 255 | 255 | { |
| 256 | 256 | legionna_state *state = machine.driver_data<legionna_state>(); |
| 257 | 257 | UINT16 *spriteram16 = machine.generic.spriteram.u16; |
| r13798 | r13799 | |
| 335 | 335 | |
| 336 | 336 | /* heated barrel hardware seems to need 0x1ff with 0x100 sign bit for sprite warp, |
| 337 | 337 | this doesn't work on denjin makai as the visible area is larger */ |
| 338 | if (cliprect | |
| 338 | if (cliprect. | |
| 339 | 339 | { |
| 340 | 340 | x&=0x1ff; |
| 341 | 341 | y&=0x1ff; |
| r13798 | r13799 | |
| 428 | 428 | tilemap_set_scrollx( state->m_text_layer, 0, 0/*state->m_scrollram16[6]*/ ); |
| 429 | 429 | tilemap_set_scrolly( state->m_text_layer, 0, 0/*state->m_scrollram16[7]*/ ); |
| 430 | 430 | |
| 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? */ | |
| 433 | 433 | |
| 434 | 434 | /* state->m_layer_disable is a guess based on 'stage 1' screen in heatbrl */ |
| 435 | 435 | |
| r13798 | r13799 | |
| 461 | 461 | tilemap_set_scrolly( state->m_text_layer, 0, 0/*state->m_scrollram16[7]*/ ); |
| 462 | 462 | |
| 463 | 463 | |
| 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); | |
| 466 | 466 | |
| 467 | 467 | if (!(state->m_layer_disable&0x0001)) tilemap_draw(bitmap,cliprect,state->m_background_layer,0,0); |
| 468 | 468 | if (!(state->m_layer_disable&0x0002)) tilemap_draw(bitmap,cliprect,state->m_midground_layer,0,0); |
| r13798 | r13799 | |
| 487 | 487 | tilemap_set_scrollx( state->m_text_layer, 0, 0/*state->m_scrollram16[6]*/ ); |
| 488 | 488 | tilemap_set_scrolly( state->m_text_layer, 0, 0/*state->m_scrollram16[7]*/ ); |
| 489 | 489 | |
| 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); | |
| 492 | 492 | |
| 493 | 493 | if(!(state->m_layer_disable & 1)) |
| 494 | 494 | tilemap_draw(bitmap,cliprect,state->m_background_layer,0,1); |
| r13798 | r13799 | |
|---|---|---|
| 84 | 84 | tilemap_set_transparent_pen(state->m_fg_tilemap, 0); |
| 85 | 85 | } |
| 86 | 86 | |
| 87 | static void draw_sprites( running_machine &machine, bitmap_t *bitmap, const rectangle | |
| 87 | static void draw_sprites( running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect ) | |
| 88 | 88 | { |
| 89 | 89 | pbaction_state *state = machine.driver_data<pbaction_state>(); |
| 90 | 90 | UINT8 *spriteram = state->m_spriteram; |
| r13798 | r13799 | |
|---|---|---|
| 212 | 212 | * |
| 213 | 213 | *************************************/ |
| 214 | 214 | |
| 215 | static void mcr68_update_sprites(running_machine &machine, bitmap_t *bitmap, const rectangle | |
| 215 | static void mcr68_update_sprites(running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect, int priority) | |
| 216 | 216 | { |
| 217 | 217 | mcr68_state *state = machine.driver_data<mcr68_state>(); |
| 218 | 218 | rectangle sprite_clip = machine.primary_screen->visible_area(); |
| r13798 | r13799 | |
| 222 | 222 | /* adjust for clipping */ |
| 223 | 223 | sprite_clip.min_x += state->m_sprite_clip; |
| 224 | 224 | sprite_clip.max_x -= state->m_sprite_clip; |
| 225 | sprite_clip &= | |
| 225 | sprite_clip &= | |
| 226 | 226 | |
| 227 | 227 | machine.priority_bitmap->fill(1, sprite_clip); |
| 228 | 228 | |
| r13798 | r13799 | |
| 256 | 256 | The color 8 is used to cover over other sprites. */ |
| 257 | 257 | |
| 258 | 258 | /* first draw the sprite, visible */ |
| 259 | pdrawgfx_transmask(bitmap, | |
| 259 | pdrawgfx_transmask(bitmap, | |
| 260 | 260 | machine.priority_bitmap, 0x00, 0x0101); |
| 261 | 261 | |
| 262 | 262 | /* then draw the mask, behind the background but obscuring following sprites */ |
| 263 | pdrawgfx_transmask(bitmap, | |
| 263 | pdrawgfx_transmask(bitmap, | |
| 264 | 264 | machine.priority_bitmap, 0x02, 0xfeff); |
| 265 | 265 | } |
| 266 | 266 | } |
| 267 | 267 | |
| 268 | 268 | |
| 269 | static void zwackery_update_sprites(running_machine &machine, bitmap_t *bitmap, const rectangle | |
| 269 | static void zwackery_update_sprites(running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect, int priority) | |
| 270 | 270 | { |
| 271 | 271 | mcr68_state *state = machine.driver_data<mcr68_state>(); |
| 272 | 272 | UINT16 *spriteram16 = state->m_spriteram; |
| 273 | 273 | int offs; |
| 274 | 274 | |
| 275 | machine.priority_bitmap->fill(1, | |
| 275 | machine.priority_bitmap->fill(1, | |
| 276 | 276 | |
| 277 | 277 | /* loop over sprite RAM */ |
| 278 | 278 | for (offs = state->m_spriteram_size / 2 - 4;offs >= 0;offs -= 4) |
| r13798 | r13799 | |
|---|---|---|
| 60 | 60 | state->m_zoom_colorbase[1] = k053251_get_palette_index(state->m_k053251, K053251_CI3); |
| 61 | 61 | state->m_zoom_colorbase[0] = k053251_get_palette_index(state->m_k053251, K053251_CI4); |
| 62 | 62 | |
| 63 | screen.machine().priority_bitmap->fill(0, | |
| 63 | screen.machine().priority_bitmap->fill(0, | |
| 64 | 64 | |
| 65 | 65 | k051316_zoom_draw(state->m_k051316_1, bitmap, cliprect, 0, 0); |
| 66 | 66 | k051316_zoom_draw(state->m_k051316_2, bitmap, cliprect, 0, 1); |
| r13798 | r13799 | |
|---|---|---|
| 72 | 72 | |
| 73 | 73 | k052109_tilemap_update(state->m_k052109); |
| 74 | 74 | |
| 75 | screen.machine().priority_bitmap->fill(0, | |
| 75 | screen.machine().priority_bitmap->fill(0, | |
| 76 | 76 | |
| 77 | 77 | /* The background color is always from layer 1 - but it's always black anyway */ |
| 78 | // bitmap->fill(16 * state->m_layer_colorbase[1], | |
| 78 | // bitmap->fill(16 * state->m_layer_colorbase[1], | |
| 79 | 79 | if (state->m_priority) |
| 80 | 80 | { |
| 81 | 81 | k052109_tilemap_draw(state->m_k052109, bitmap, cliprect, 2, TILEMAP_DRAW_OPAQUE, 1); |
| r13798 | r13799 | |
|---|---|---|
| 23 | 23 | int flip = flip_screen_get(screen.machine()); |
| 24 | 24 | |
| 25 | 25 | /* draw the characters as sprites because they could be overlapping */ |
| 26 | bitmap->fill(0, | |
| 26 | bitmap->fill(0, | |
| 27 | 27 | for (offs = 0; offs < 0x400; offs++) |
| 28 | 28 | { |
| 29 | 29 | int code,sx,sy,col; |
| r13798 | r13799 | |
|---|---|---|
| 161 | 161 | 8, 8, 32, 64); |
| 162 | 162 | } |
| 163 | 163 | |
| 164 | static void draw_sprites(running_machine &machine, bitmap_t *bitmap, const rectangle | |
| 164 | static void draw_sprites(running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect) | |
| 165 | 165 | { |
| 166 | 166 | gsword_state *state = machine.driver_data<gsword_state>(); |
| 167 | 167 | int offs; |
| r13798 | r13799 | |
|---|---|---|
| 161 | 161 | * confirmed on mametests.org as being present on real PCB as well. |
| 162 | 162 | */ |
| 163 | 163 | |
| 164 | static void draw_sprites(running_machine &machine, bitmap_t *bitmap, const rectangle | |
| 164 | static void draw_sprites(running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect) | |
| 165 | 165 | { |
| 166 | 166 | /* TODO: draw_sprites should adopt the scanline logic from dkong.c |
| 167 | 167 | * The schematics have the same logic for sprite buffering. |
| r13798 | r13799 | |
|---|---|---|
| 93 | 93 | |
| 94 | 94 | konami_sortlayers3(layer, state->m_layerpri); |
| 95 | 95 | |
| 96 | screen.machine().priority_bitmap->fill(0, | |
| 96 | screen.machine().priority_bitmap->fill(0, | |
| 97 | 97 | /* note the '+1' in the background color!!! */ |
| 98 | bitmap->fill(16 * bg_colorbase + 1, | |
| 98 | bitmap->fill(16 * bg_colorbase + 1, | |
| 99 | 99 | k052109_tilemap_draw(state->m_k052109, bitmap, cliprect, layer[0], 0, 1); |
| 100 | 100 | k052109_tilemap_draw(state->m_k052109, bitmap, cliprect, layer[1], 0, 2); |
| 101 | 101 | k052109_tilemap_draw(state->m_k052109, bitmap, cliprect, layer[2], 0, 4); |
| r13798 | r13799 | |
| 222 | 222 | screen.machine().priority_bitmap->fill(0, cliprect); |
| 223 | 223 | /* note the '+1' in the background color!!! */ |
| 224 | 224 | 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); | |
| 228 | 228 | |
| 229 | 229 | /* this isn't supported anymore and it is unsure if still needed; keeping here for reference |
| 230 | 230 | pdrawgfx_shadow_lowpri = 1; fix shadows of boulders in front of feet */ |
| 231 | k053247_sprites_draw(state->m_k053246, renderbitmap, | |
| 231 | k053247_sprites_draw(state->m_k053246, renderbitmap, | |
| 232 | 232 | } |
| r13798 | r13799 | |
|---|---|---|
| 104 | 104 | |
| 105 | 105 | |
| 106 | 106 | |
| 107 | static void draw_playfield_and_alpha( running_machine &machine, bitmap_t *bitmap, const rectangle | |
| 107 | static void draw_playfield_and_alpha( running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect, int playfield_x_offset, int playfield_y_offset ) | |
| 108 | 108 | { |
| 109 | 109 | atarifb_state *state = machine.driver_data<atarifb_state>(); |
| 110 | 110 | const rectangle bigfield_area(4 * 8, 34 * 8 - 1, 0 * 8, 32 * 8 - 1); |
| r13798 | r13799 | |
| 115 | 115 | scroll_x[0] = - *state->m_scroll_register + 32 + playfield_x_offset; |
| 116 | 116 | scroll_y[0] = 8 + playfield_y_offset; |
| 117 | 117 | |
| 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); | |
| 121 | 121 | } |
| 122 | 122 | |
| 123 | 123 | |
| 124 | static void draw_sprites( running_machine &machine, bitmap_t *bitmap, const rectangle | |
| 124 | static void draw_sprites( running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect, int gfx, int is_soccer ) | |
| 125 | 125 | { |
| 126 | 126 | atarifb_state *state = machine.driver_data<atarifb_state>(); |
| 127 | 127 | const rectangle bigfield_area(4 * 8, 34 * 8 - 1, 0 * 8, 32 * 8 - 1); |
| r13798 | r13799 | |
| 152 | 152 | { |
| 153 | 153 | shade = ((state->m_spriteram[obj * 2 + 1 + 0x20]) & 0x07); |
| 154 | 154 | |
| 155 | drawgfx_transpen(bitmap, | |
| 155 | drawgfx_transpen(bitmap, | |
| 156 | 156 | charcode, shade, |
| 157 | 157 | flipx, flipy, sx, sy, 0); |
| 158 | 158 | |
| 159 | 159 | shade = ((state->m_spriteram[obj * 2 + 1 + 0x20]) & 0x08) >> 3; |
| 160 | 160 | } |
| 161 | 161 | |
| 162 | drawgfx_transpen(bitmap, | |
| 162 | drawgfx_transpen(bitmap, | |
| 163 | 163 | charcode, shade, |
| 164 | 164 | flipx, flipy, sx, sy, 0); |
| 165 | 165 | |
| r13798 | r13799 | |
| 171 | 171 | if ((charcode == 0x11) && (sy == 0x07)) |
| 172 | 172 | { |
| 173 | 173 | sy = 0xf1; /* When multiplexed, it's 0x10...why? */ |
| 174 | drawgfx_transpen(bitmap, | |
| 174 | drawgfx_transpen(bitmap, | |
| 175 | 175 | charcode, 0, |
| 176 | 176 | flipx, flipy, sx, sy, 0); |
| 177 | 177 | } |
| r13798 | r13799 | |
|---|---|---|
| 7 | 7 | /* Clean Up */ |
| 8 | 8 | /* is theres a bg colour register? */ |
| 9 | 9 | |
| 10 | static void draw_sprites(running_machine &machine, bitmap_t *bitmap, const rectangle | |
| 10 | static void draw_sprites(running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect) | |
| 11 | 11 | { |
| 12 | 12 | silkroad_state *state = machine.driver_data<silkroad_state>(); |
| 13 | 13 | const gfx_element *gfx = machine.gfx[0]; |
| r13798 | r13799 | |
| 144 | 144 | SCREEN_UPDATE(silkroad) |
| 145 | 145 | { |
| 146 | 146 | 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); | |
| 149 | 149 | |
| 150 | 150 | tilemap_set_scrollx( state->m_fg_tilemap, 0, ((state->m_regs[0] & 0xffff0000) >> 16) ); |
| 151 | 151 | tilemap_set_scrolly( state->m_fg_tilemap, 0, (state->m_regs[0] & 0x0000ffff) >> 0 ); |
| r13798 | r13799 | |
|---|---|---|
| 106 | 106 | { |
| 107 | 107 | lethal_state *state = screen.machine().driver_data<lethal_state>(); |
| 108 | 108 | |
| 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); | |
| 111 | 111 | |
| 112 | 112 | k056832_tilemap_draw(state->m_k056832, bitmap, cliprect, 3, K056832_DRAW_FLAG_MIRROR, 1); |
| 113 | 113 | k056832_tilemap_draw(state->m_k056832, bitmap, cliprect, 2, K056832_DRAW_FLAG_MIRROR, 2); |
| r13798 | r13799 | |
|---|---|---|
| 66 | 66 | rect.max_x = x + 15; |
| 67 | 67 | rect.max_y = y + 15; |
| 68 | 68 | |
| 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; | |
| 77 | 77 | |
| 78 | 78 | x -= state->m_ball_x; |
| 79 | 79 | y -= state->m_ball_y; |
| r13798 | r13799 | |
| 84 | 84 | { |
| 85 | 85 | for (j = 0; j < 2; j++) |
| 86 | 86 | { |
| 87 | drawgfx_transpen(bitmap, | |
| 87 | drawgfx_transpen(bitmap, | |
| 88 | 88 | 0, 0, |
| 89 | 89 | 0, 0, |
| 90 | 90 | x + 16 * i, |
| r13798 | r13799 | |
|---|---|---|
| 96 | 96 | tilemap_set_transparent_pen(state->m_fg_tilemap, 0); |
| 97 | 97 | } |
| 98 | 98 | |
| 99 | static void draw_sprites( running_machine &machine, bitmap_t *bitmap, const rectangle | |
| 99 | static void draw_sprites( running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect ) | |
| 100 | 100 | { |
| 101 | 101 | exprraid_state *state = machine.driver_data<exprraid_state>(); |
| 102 | 102 | int offs; |
| r13798 | r13799 | |
| 119 | 119 | flipy = !flipy; |
| 120 | 120 | } |
| 121 | 121 | |
| 122 | drawgfx_transpen(bitmap, | |
| 122 | drawgfx_transpen(bitmap, cliprect, machine.gfx[1], | |
| 123 | 123 | code, color, |
| 124 | 124 | flipx, flipy, |
| 125 | 125 | sx, sy, 0); |
| r13798 | r13799 | |
|---|---|---|
| 225 | 225 | /* mix & blend the paletted 16-bit tile and sprite bitmaps into an RGB 32-bit bitmap */ |
| 226 | 226 | static void blendbitmaps(running_machine &machine, |
| 227 | 227 | bitmap_t *dest,bitmap_t *src1,bitmap_t *src2,bitmap_t *src3, |
| 228 | int sx,int sy,const rectangle | |
| 228 | int sx,int sy,const rectangle &clip) | |
| 229 | 229 | { |
| 230 | 230 | int ox; |
| 231 | 231 | int oy; |
| r13798 | r13799 | |
| 238 | 238 | |
| 239 | 239 | ex = sx + src1->width() - 1; |
| 240 | 240 | if (sx < 0) sx = 0; |
| 241 | if (sx < clip | |
| 241 | if (sx < clip. | |
| 242 | 242 | if (ex >= dest->width()) ex = dest->width() - 1; |
| 243 | if (ex > clip | |
| 243 | if (ex > clip. | |
| 244 | 244 | if (sx > ex) return; |
| 245 | 245 | |
| 246 | 246 | ey = sy + src1->height() - 1; |
| 247 | 247 | if (sy < 0) sy = 0; |
| 248 | if (sy < clip | |
| 248 | if (sy < clip. | |
| 249 | 249 | if (ey >= dest->height()) ey = dest->height() - 1; |
| 250 | if (ey > clip | |
| 250 | if (ey > clip. | |
| 251 | 251 | if (sy > ey) return; |
| 252 | 252 | |
| 253 | 253 | { |
| r13798 | r13799 | |
| 332 | 332 | } |
| 333 | 333 | } |
| 334 | 334 | |
| 335 | static void draw_sprites(running_machine &machine, bitmap_t *bitmap_bg, bitmap_t *bitmap_fg, bitmap_t *bitmap_sp, const rectangle | |
| 335 | static void draw_sprites(running_machine &machine, bitmap_t *bitmap_bg, bitmap_t *bitmap_fg, bitmap_t *bitmap_sp, const rectangle &cliprect) | |
| 336 | 336 | { |
| 337 | 337 | tecmo16_state *state = machine.driver_data<tecmo16_state>(); |
| 338 | 338 | UINT16 *spriteram16 = state->m_spriteram; |
| r13798 | r13799 | |
| 493 | 493 | SCREEN_UPDATE( tecmo16 ) |
| 494 | 494 | { |
| 495 | 495 | tecmo16_state *state = screen.machine().driver_data<tecmo16_state>(); |
| 496 | screen.machine().priority_bitmap->fill(0, | |
| 496 | screen.machine().priority_bitmap->fill(0, | |
| 497 | 497 | |
| 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); | |
| 501 | 501 | |
| 502 | 502 | /* draw tilemaps into a 16-bit bitmap */ |
| 503 | 503 | tilemap_draw(state->m_tile_bitmap_bg, cliprect,state->m_bg_tilemap, 0, 1); |
| r13798 | r13799 | |
|---|---|---|
| 190 | 190 | |
| 191 | 191 | naughtyb_state *state = screen.machine().driver_data<naughtyb_state>(); |
| 192 | 192 | UINT8 *videoram = state->m_videoram; |
| 193 | bitmap_t *tmpbitmap = screen.machine().generic.tmpbitmap; | |
| 193 | 194 | int offs; |
| 194 | 195 | |
| 195 | 196 | // for every character in the Video RAM |
| r13798 | r13799 | |
| 225 | 226 | } |
| 226 | 227 | } |
| 227 | 228 | |
| 228 | drawgfx_opaque( | |
| 229 | drawgfx_opaque(t | |
| 229 | 230 | state->m_videoram2[offs] + 256 * state->m_bankreg, |
| 230 | 231 | (state->m_videoram2[offs] >> 5) + 8 * state->m_palreg, |
| 231 | 232 | state->m_cocktail,state->m_cocktail, |
| 232 | 233 | 8*sx,8*sy); |
| 233 | 234 | |
| 234 | drawgfx_transpen( | |
| 235 | drawgfx_transpen(t | |
| 235 | 236 | videoram[offs] + 256*state->m_bankreg, |
| 236 | 237 | (videoram[offs] >> 5) + 8 * state->m_palreg, |
| 237 | 238 | state->m_cocktail,state->m_cocktail, |
| r13798 | r13799 | |
| 242 | 243 | { |
| 243 | 244 | int scrollx; |
| 244 | 245 | |
| 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); | |
| 247 | 248 | |
| 248 | 249 | scrollx = ( state->m_cocktail ) ? *state->m_scrollreg - 239 : -*state->m_scrollreg + 16; |
| 249 | copyscrollbitmap(bitmap, | |
| 250 | copyscrollbitmap(bitmap, | |
| 250 | 251 | } |
| 251 | 252 | return 0; |
| 252 | 253 | } |
| r13798 | r13799 | |
|---|---|---|
| 219 | 219 | ***************************************************************************/ |
| 220 | 220 | |
| 221 | 221 | |
| 222 | void draw_sprites(running_machine &machine, bitmap_t *bitmap, const rectangle | |
| 222 | void draw_sprites(running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect, UINT8 *spriteram_base) | |
| 223 | 223 | { |
| 224 | 224 | UINT8 *spriteram = spriteram_base + 0x780; |
| 225 | 225 | UINT8 *spriteram_2 = spriteram + 0x800; |
| r13798 | r13799 | |
|---|---|---|
| 19 | 19 | |
| 20 | 20 | /******************************************************************************/ |
| 21 | 21 | |
| 22 | static void tumblepb_draw_sprites( running_machine &machine, bitmap_t *bitmap, const rectangle | |
| 22 | static void tumblepb_draw_sprites( running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect ) | |
| 23 | 23 | { |
| 24 | 24 | tumbleb_state *state = machine.driver_data<tumbleb_state>(); |
| 25 | 25 | UINT16 *spriteram = state->m_spriteram; |
| r13798 | r13799 | |
| 85 | 85 | } |
| 86 | 86 | } |
| 87 | 87 | |
| 88 | static void jumpkids_draw_sprites( running_machine &machine, bitmap_t *bitmap, const rectangle | |
| 88 | static void jumpkids_draw_sprites( running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect ) | |
| 89 | 89 | { |
| 90 | 90 | tumbleb_state *state = machine.driver_data<tumbleb_state>(); |
| 91 | 91 | UINT16 *spriteram = state->m_spriteram; |
| r13798 | r13799 | |
| 152 | 152 | } |
| 153 | 153 | } |
| 154 | 154 | |
| 155 | static void fncywld_draw_sprites( running_machine &machine, bitmap_t *bitmap, const rectangle | |
| 155 | static void fncywld_draw_sprites( running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect ) | |
| 156 | 156 | { |
| 157 | 157 | tumbleb_state *state = machine.driver_data<tumbleb_state>(); |
| 158 | 158 | UINT16 *spriteram = state->m_spriteram; |
| r13798 | r13799 | |
| 878 | 878 | { |
| 879 | 879 | tumbleb_state *state = screen.machine().driver_data<tumbleb_state>(); |
| 880 | 880 | |
| 881 | // bitmap->fill(get_black_pen(screen.machine()), | |
| 881 | // bitmap->fill(get_black_pen(screen.machine()), | |
| 882 | 882 | |
| 883 | 883 | tilemap_set_scrollx(state->m_pf1_tilemap, 0, state->m_control[2] - 0x3a0); |
| 884 | 884 | tilemap_set_scrolly(state->m_pf1_tilemap, 0, state->m_control[3]); |
| r13798 | r13799 | |
|---|---|---|
| 162 | 162 | } |
| 163 | 163 | } |
| 164 | 164 | else |
| 165 | bitmap->fill(256, | |
| 165 | bitmap->fill(256, | |
| 166 | 166 | |
| 167 | 167 | |
| 168 | 168 | /* draw sprites (momoko) */ |
| r13798 | r13799 | |
|---|---|---|
| 68 | 68 | 3 XXXXXXXX |
| 69 | 69 | */ |
| 70 | 70 | |
| 71 | static void kchamp_draw_sprites( running_machine &machine, bitmap_t *bitmap, const rectangle | |
| 71 | static void kchamp_draw_sprites( running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect ) | |
| 72 | 72 | { |
| 73 | 73 | kchamp_state *state = machine.driver_data<kchamp_state>(); |
| 74 | 74 | UINT8 *spriteram = state->m_spriteram; |
| r13798 | r13799 | |
| 97 | 97 | } |
| 98 | 98 | } |
| 99 | 99 | |
| 100 | static void kchampvs_draw_sprites( running_machine &machine, bitmap_t *bitmap, const rectangle | |
| 100 | static void kchampvs_draw_sprites( running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect ) | |
| 101 | 101 | { |
| 102 | 102 | kchamp_state *state = machine.driver_data<kchamp_state>(); |
| 103 | 103 | UINT8 *spriteram = state->m_spriteram; |
| r13798 | r13799 | |
|---|---|---|
| 240 | 240 | |
| 241 | 241 | ***************************************************************************/ |
| 242 | 242 | |
| 243 | static void draw_sprites(running_machine& machine, bitmap_t *bitmap, const rectangle | |
| 243 | static void draw_sprites(running_machine& machine, bitmap_t *bitmap, const rectangle &cliprect ) | |
| 244 | 244 | { |
| 245 | 245 | digdug_state *state = machine.driver_data<digdug_state>(); |
| 246 | 246 | UINT8 *spriteram = state->m_digdug_objram + 0x380; |
| r13798 | r13799 | |
| 249 | 249 | int offs; |
| 250 | 250 | |
| 251 | 251 | // mask upper and lower columns |
| 252 | rectangle visarea = | |
| 252 | rectangle visarea = | |
| 253 | 253 | visarea.min_x = 2*8; |
| 254 | 254 | visarea.max_x = 34*8-1; |
| 255 | 255 | if (flip_screen_get(machine)) |
| r13798 | r13799 | |
| 293 | 293 | for (x = 0;x <= size;x++) |
| 294 | 294 | { |
| 295 | 295 | UINT32 transmask = colortable_get_transpen_mask(machine.colortable, machine.gfx[1], color, 0x1f); |
| 296 | drawgfx_transmask(bitmap, | |
| 296 | drawgfx_transmask(bitmap, | |
| 297 | 297 | sprite + gfx_offs[y ^ (size * flipy)][x ^ (size * flipx)], |
| 298 | 298 | color, |
| 299 | 299 | flipx,flipy, |
| 300 | 300 | ((sx + 16*x) & 0xff), sy + 16*y,transmask); |
| 301 | 301 | /* wraparound */ |
| 302 | drawgfx_transmask(bitmap, | |
| 302 | drawgfx_transmask(bitmap, | |
| 303 | 303 | sprite + gfx_offs[y ^ (size * flipy)][x ^ (size * flipx)], |
| 304 | 304 | color, |
| 305 | 305 | flipx,flipy, |
| r13798 | r13799 | |
|---|---|---|
| 120 | 120 | |
| 121 | 121 | rect &= screen.machine().primary_screen->visible_area(); |
| 122 | 122 | |
| 123 | tilemap_draw(state->m_helper, | |
| 123 | tilemap_draw(state->m_helper, | |
| 124 | 124 | |
| 125 | 125 | if (code & 4) |
| 126 | 126 | bank = 32; |
| 127 | 127 | |
| 128 | drawgfx_transpen(state->m_helper, | |
| 128 | drawgfx_transpen(state->m_helper, | |
| 129 | 129 | (code >> 3) | bank, |
| 130 | 130 | 4, |
| 131 | 131 | 0, 0, |
| r13798 | r13799 | |
|---|---|---|
| 139 | 139 | state_save_register_global_array(machine, state->m_video_control_data); |
| 140 | 140 | } |
| 141 | 141 | |
| 142 | static void draw_sprites(running_machine &machine, bitmap_t *bitmap,const rectangle | |
| 142 | static void draw_sprites(running_machine &machine, bitmap_t *bitmap,const rectangle &cliprect) | |
| 143 | 143 | { |
| 144 | 144 | m90_state *state = machine.driver_data<m90_state>(); |
| 145 | 145 | UINT16 *spriteram = state->m_video_data + 0xee00/2;; |
| r13798 | r13799 | |
| 193 | 193 | } |
| 194 | 194 | } |
| 195 | 195 | |
| 196 | static void bomblord_draw_sprites(running_machine &machine, bitmap_t *bitmap,const rectangle | |
| 196 | static void bomblord_draw_sprites(running_machine &machine, bitmap_t *bitmap,const rectangle &cliprect) | |
| 197 | 197 | { |
| 198 | 198 | m90_state *state = machine.driver_data<m90_state>(); |
| 199 | 199 | UINT16 *spriteram16 = state->m_spriteram; |
| r13798 | r13799 | |
| 233 | 233 | } |
| 234 | 234 | } |
| 235 | 235 | |
| 236 | static void dynablsb_draw_sprites(running_machine &machine, bitmap_t *bitmap,const rectangle | |
| 236 | static void dynablsb_draw_sprites(running_machine &machine, bitmap_t *bitmap,const rectangle &cliprect) | |
| 237 | 237 | { |
| 238 | 238 | m90_state *state = machine.driver_data<m90_state>(); |
| 239 | 239 | UINT16 *spriteram16 = state->m_spriteram; |
| r13798 | r13799 | |
| 363 | 363 | tilemap_set_scrollx( state->m_pf2_wide_layer,0, state->m_video_control_data[3]+256-2 ); |
| 364 | 364 | } |
| 365 | 365 | |
| 366 | screen.machine().priority_bitmap->fill(0, | |
| 366 | screen.machine().priority_bitmap->fill(0, | |
| 367 | 367 | |
| 368 | 368 | if (video_enable) |
| 369 | 369 | { |
| r13798 | r13799 | |
| 375 | 375 | { |
| 376 | 376 | int line; |
| 377 | 377 | 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; | |
| 380 | 380 | |
| 381 | 381 | for(line = 0; line < 512; line++) |
| 382 | 382 | { |
| r13798 | r13799 | |
| 385 | 385 | if (state->m_video_control_data[6] & 0x4) |
| 386 | 386 | { |
| 387 | 387 | 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); | |
| 390 | 390 | } else { |
| 391 | 391 | 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); | |
| 394 | 394 | } |
| 395 | 395 | } |
| 396 | 396 | } |
| r13798 | r13799 | |
| 410 | 410 | } |
| 411 | 411 | else |
| 412 | 412 | { |
| 413 | bitmap->fill(0, | |
| 413 | bitmap->fill(0, | |
| 414 | 414 | } |
| 415 | 415 | |
| 416 | 416 | if (pf1_enable) |
| r13798 | r13799 | |
| 420 | 420 | { |
| 421 | 421 | int line; |
| 422 | 422 | 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; | |
| 425 | 425 | |
| 426 | 426 | for(line = 0; line < 512; line++) |
| 427 | 427 | { |
| r13798 | r13799 | |
| 430 | 430 | if (state->m_video_control_data[5] & 0x4) |
| 431 | 431 | { |
| 432 | 432 | 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); | |
| 435 | 435 | } else { |
| 436 | 436 | 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); | |
| 439 | 439 | } |
| 440 | 440 | } |
| 441 | 441 | } |
| r13798 | r13799 | |
| 457 | 457 | draw_sprites(screen.machine(),bitmap,cliprect); |
| 458 | 458 | |
| 459 | 459 | } else { |
| 460 | bitmap->fill(get_black_pen(screen.machine()), | |
| 460 | bitmap->fill(get_black_pen(screen.machine()), | |
| 461 | 461 | } |
| 462 | 462 | |
| 463 | 463 | return 0; |
| r13798 | r13799 | |
| 467 | 467 | { |
| 468 | 468 | m90_state *state = screen.machine().driver_data<m90_state>(); |
| 469 | 469 | 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); | |
| 472 | 472 | |
| 473 | 473 | /* Setup scrolling */ |
| 474 | 474 | if (state->m_video_control_data[6]&0x20) { |
| r13798 | r13799 | |
| 519 | 519 | SCREEN_UPDATE( dynablsb ) |
| 520 | 520 | { |
| 521 | 521 | 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); | |
| 524 | 524 | |
| 525 | 525 | if (!(state->m_video_data[0xf008/2] & 0x4000)) { |
| 526 | 526 | tilemap_mark_all_tiles_dirty(state->m_pf1_wide_layer); |
| r13798 | r13799 | |
|---|---|---|
| 56 | 56 | |
| 57 | 57 | ********************************************************/ |
| 58 | 58 | |
| 59 | static void draw_sprites(running_machine &machine, bitmap_t *bitmap,const rectangle | |
| 59 | static void draw_sprites(running_machine &machine, bitmap_t *bitmap,const rectangle &cliprect,const int *primasks,int x_offs,int y_offs) | |
| 60 | 60 | { |
| 61 | 61 | gunbustr_state *state = machine.driver_data<gunbustr_state>(); |
| 62 | 62 | UINT32 *spriteram32 = state->m_spriteram; |
| r13798 | r13799 | |
| 218 | 218 | layer[3] = (priority & 0x000f) >> 0; /* tells us which is top */ |
| 219 | 219 | layer[4] = 4; /* text layer always over bg layers */ |
| 220 | 220 | |
| 221 | screen.machine().priority_bitmap->fill(0, | |
| 221 | screen.machine().priority_bitmap->fill(0, | |
| 222 | 222 | |
| 223 | 223 | /* We have to assume 2nd to bottom layer is always underneath |
| 224 | 224 | sprites as pdrawgfx cannot yet cope with more than 4 layers */ |
| r13798 | r13799 | |
|---|---|---|
| 55 | 55 | |
| 56 | 56 | |
| 57 | 57 | /* this implementation was originally from Mad Motor */ |
| 58 | void deco_mxc06_device::draw_sprites( running_machine &machine, bitmap_t *bitmap, const rectangle | |
| 58 | void 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 ) | |
| 59 | 59 | { |
| 60 | 60 | int offs; |
| 61 | 61 |
| r13798 | r13799 | |
|---|---|---|
| 99 | 99 | } |
| 100 | 100 | |
| 101 | 101 | /* Same as Jailbreak + palette bank */ |
| 102 | static void draw_sprites(running_machine &machine, bitmap_t *bitmap, const rectangle | |
| 102 | static void draw_sprites(running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect ) | |
| 103 | 103 | { |
| 104 | 104 | scotrsht_state *state = machine.driver_data<scotrsht_state>(); |
| 105 | 105 | UINT8 *spriteram = state->m_spriteram; |
| r13798 | r13799 | |
|---|---|---|
| 146 | 146 | ********************************************************/ |
| 147 | 147 | |
| 148 | 148 | |
| 149 | static void contcirc_draw_sprites_16x8( running_machine &machine, bitmap_t *bitmap, const rectangle | |
| 149 | static void contcirc_draw_sprites_16x8( running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect, int y_offs ) | |
| 150 | 150 | { |
| 151 | 151 | taitoz_state *state = machine.driver_data<taitoz_state>(); |
| 152 | 152 | UINT16 *spritemap = (UINT16 *)machine.region("user1")->base(); |
| r13798 | r13799 | |
| 241 | 241 | |
| 242 | 242 | |
| 243 | 243 | |
| 244 | static void chasehq_draw_sprites_16x16( running_machine &machine, bitmap_t *bitmap, const rectangle | |
| 244 | static void chasehq_draw_sprites_16x16( running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect, int y_offs ) | |
| 245 | 245 | { |
| 246 | 246 | taitoz_state *state = machine.driver_data<taitoz_state>(); |
| 247 | 247 | UINT16 *spritemap = (UINT16 *)machine.region("user1")->base(); |
| r13798 | r13799 | |
| 427 | 427 | |
| 428 | 428 | |
| 429 | 429 | |
| 430 | static void bshark_draw_sprites_16x8( running_machine &machine, bitmap_t *bitmap, const rectangle | |
| 430 | static void bshark_draw_sprites_16x8( running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect, int y_offs ) | |
| 431 | 431 | { |
| 432 | 432 | taitoz_state *state = machine.driver_data<taitoz_state>(); |
| 433 | 433 | UINT16 *spritemap = (UINT16 *)machine.region("user1")->base(); |
| r13798 | r13799 | |
| 523 | 523 | |
| 524 | 524 | |
| 525 | 525 | |
| 526 | static void sci_draw_sprites_16x8( running_machine &machine, bitmap_t *bitmap, const rectangle | |
| 526 | static void sci_draw_sprites_16x8( running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect, int y_offs ) | |
| 527 | 527 | { |
| 528 | 528 | taitoz_state *state = machine.driver_data<taitoz_state>(); |
| 529 | 529 | UINT16 *spritemap = (UINT16 *)machine.region("user1")->base(); |
| r13798 | r13799 | |
| 628 | 628 | |
| 629 | 629 | |
| 630 | 630 | |
| 631 | static void aquajack_draw_sprites_16x8(running_machine &machine, bitmap_t *bitmap,const rectangle | |
| 631 | static void aquajack_draw_sprites_16x8(running_machine &machine, bitmap_t *bitmap,const rectangle &cliprect,int y_offs) | |
| 632 | 632 | { |
| 633 | 633 | taitoz_state *state = machine.driver_data<taitoz_state>(); |
| 634 | 634 | UINT16 *spritemap = (UINT16 *)machine.region("user1")->base(); |
| r13798 | r13799 | |
| 723 | 723 | |
| 724 | 724 | |
| 725 | 725 | |
| 726 | static void spacegun_draw_sprites_16x8(running_machine &machine, bitmap_t *bitmap,const rectangle | |
| 726 | static void spacegun_draw_sprites_16x8(running_machine &machine, bitmap_t *bitmap,const rectangle &cliprect,int y_offs) | |
| 727 | 727 | { |
| 728 | 728 | taitoz_state *state = machine.driver_data<taitoz_state>(); |
| 729 | 729 | UINT16 *spritemap = (UINT16 *)machine.region("user1")->base(); |
| r13798 | r13799 | |
| 853 | 853 | layer[1] = layer[0] ^ 1; |
| 854 | 854 | layer[2] = 2; |
| 855 | 855 | |
| 856 | screen.machine().priority_bitmap->fill(0, | |
| 856 | screen.machine().priority_bitmap->fill(0, | |
| 857 | 857 | |
| 858 | bitmap->fill(0, | |
| 858 | bitmap->fill(0, | |
| 859 | 859 | |
| 860 | 860 | tc0100scn_tilemap_draw(state->m_tc0100scn, bitmap, cliprect, layer[0], 0, 0); |
| 861 | 861 | tc0100scn_tilemap_draw(state->m_tc0100scn, bitmap, cliprect, layer[1], 0, 1); |
| r13798 | r13799 | |
| 880 | 880 | layer[1] = layer[0] ^ 1; |
| 881 | 881 | layer[2] = 2; |
| 882 | 882 | |
| 883 | screen.machine().priority_bitmap->fill(0, | |
| 883 | screen.machine().priority_bitmap->fill(0, | |
| 884 | 884 | |
| 885 | 885 | /* Ensure screen blanked even when bottom layer not drawn due to disable bit */ |
| 886 | bitmap->fill(0, | |
| 886 | bitmap->fill(0, | |
| 887 | 887 | |
| 888 | 888 | tc0100scn_tilemap_draw(state->m_tc0100scn, bitmap, cliprect, layer[0], TILEMAP_DRAW_OPAQUE, 0); |
| 889 | 889 | tc0100scn_tilemap_draw(state->m_tc0100scn, bitmap, cliprect, layer[1], 0, 1); |
| r13798 | r13799 | |
| 906 | 906 | layer[1] = layer[0] ^ 1; |
| 907 | 907 | layer[2] = 2; |
| 908 | 908 | |
| 909 | screen.machine().priority_bitmap->fill(0, | |
| 909 | screen.machine().priority_bitmap->fill(0, | |
| 910 | 910 | |
| 911 | 911 | /* Ensure screen blanked even when bottom layer not drawn due to disable bit */ |
| 912 | bitmap->fill(0, | |
| 912 | bitmap->fill(0, | |
| 913 | 913 | |
| 914 | 914 | tc0100scn_tilemap_draw(state->m_tc0100scn, bitmap, cliprect, layer[0], TILEMAP_DRAW_OPAQUE, 0); |
| 915 | 915 | tc0100scn_tilemap_draw(state->m_tc0100scn, bitmap, cliprect, layer[1], 0, 1); |
| r13798 | r13799 | |
| 932 | 932 | layer[1] = layer[0] ^ 1; |
| 933 | 933 | layer[2] = 2; |
| 934 | 934 | |
| 935 | screen.machine().priority_bitmap->fill(0, | |
| 935 | screen.machine().priority_bitmap->fill(0, | |
| 936 | 936 | |
| 937 | 937 | /* Ensure screen blanked even when bottom layer not drawn due to disable bit */ |
| 938 | bitmap->fill(0, | |
| 938 | bitmap->fill(0, | |
| 939 | 939 | |
| 940 | 940 | tc0100scn_tilemap_draw(state->m_tc0100scn, bitmap, cliprect, layer[0], TILEMAP_DRAW_OPAQUE, 0); |
| 941 | 941 | tc0100scn_tilemap_draw(state->m_tc0100scn, bitmap, cliprect, layer[1], 0, 1); |
| r13798 | r13799 | |
| 958 | 958 | layer[1] = layer[0] ^ 1; |
| 959 | 959 | layer[2] = 2; |
| 960 | 960 | |
| 961 | screen.machine().priority_bitmap->fill(0, | |
| 961 | screen.machine().priority_bitmap->fill(0, | |
| 962 | 962 | |
| 963 | 963 | /* Ensure screen blanked even when bottom layer not drawn due to disable bit */ |
| 964 | bitmap->fill(0, | |
| 964 | bitmap->fill(0, | |
| 965 | 965 | |
| 966 | 966 | tc0100scn_tilemap_draw(state->m_tc0100scn, bitmap, cliprect, layer[0], TILEMAP_DRAW_OPAQUE, 0); |
| 967 | 967 | tc0100scn_tilemap_draw(state->m_tc0100scn, bitmap, cliprect, layer[1], 0, 1); |
| r13798 | r13799 | |
| 984 | 984 | layer[1] = layer[0] ^ 1; |
| 985 | 985 | layer[2] = 2; |
| 986 | 986 | |
| 987 | screen.machine().priority_bitmap->fill(0, | |
| 987 | screen.machine().priority_bitmap->fill(0, | |
| 988 | 988 | |
| 989 | 989 | /* Ensure screen blanked even when bottom layer not drawn due to disable bit */ |
| 990 | bitmap->fill(0, | |
| 990 | bitmap->fill(0, | |
| 991 | 991 | |
| 992 | 992 | tc0100scn_tilemap_draw(state->m_tc0100scn, bitmap, cliprect, layer[0], TILEMAP_DRAW_OPAQUE, 1); |
| 993 | 993 | tc0100scn_tilemap_draw(state->m_tc0100scn, bitmap, cliprect, layer[1], 0, 2); |
| r13798 | r13799 | |
| 1015 | 1015 | layer[3] = (priority & 0x000f) >> 0; /* tells us which is top */ |
| 1016 | 1016 | layer[4] = 4; /* text layer always over bg layers */ |
| 1017 | 1017 | |
| 1018 | screen.machine().priority_bitmap->fill(0, | |
| 1018 | screen.machine().priority_bitmap->fill(0, | |
| 1019 | 1019 | |
| 1020 | 1020 | /* Ensure screen blanked - this shouldn't be necessary! */ |
| 1021 | bitmap->fill(0, | |
| 1021 | bitmap->fill(0, | |
| 1022 | 1022 | |
| 1023 | 1023 | tc0480scp_tilemap_draw(state->m_tc0480scp, bitmap, cliprect, layer[0], TILEMAP_DRAW_OPAQUE, 0); |
| 1024 | 1024 | tc0480scp_tilemap_draw(state->m_tc0480scp, bitmap, cliprect, layer[1], 0, 0); |
| r13798 | r13799 | |
|---|---|---|
| 7 | 7 | deco_mxc06_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); |
| 8 | 8 | static void set_gfx_region(device_t &device, int region); |
| 9 | 9 | void set_gfxregion(int region) { m_gfxregion = region; }; |
| 10 | void draw_sprites( running_machine &machine, bitmap_t *bitmap, const rectangle | |
| 10 | void draw_sprites( running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect, UINT16* spriteram16, int pri_mask, int pri_val, int col_mask ); | |
| 11 | 11 | void set_pri_type( int type ) { m_priority_type = type; } |
| 12 | 12 | protected: |
| 13 | 13 | virtual void device_start(); |
| r13798 | r13799 | |
|---|---|---|
| 161 | 161 | Display refresh |
| 162 | 162 | |
| 163 | 163 | ***************************************************************************/ |
| 164 | static void draw_sprites( running_machine &machine, bitmap_t *bitmap, const rectangle | |
| 164 | static void draw_sprites( running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect ) | |
| 165 | 165 | { |
| 166 | 166 | msisaac_state *state = machine.driver_data<msisaac_state>(); |
| 167 | 167 | const UINT8 *source = state->m_spriteram + 32 * 4 - 4; |
| r13798 | r13799 | |
|---|---|---|
| 73 | 73 | tilemap_set_scroll_rows(state->m_bg_tilemap, 32); |
| 74 | 74 | } |
| 75 | 75 | |
| 76 | static void draw_sprites( running_machine &machine, bitmap_t *bitmap, const rectangle | |
| 76 | static void draw_sprites( running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect ) | |
| 77 | 77 | { |
| 78 | 78 | markham_state *state = machine.driver_data<markham_state>(); |
| 79 | 79 | UINT8 *spriteram = state->m_spriteram; |
| r13798 | r13799 | |
|---|---|---|
| 165 | 165 | |
| 166 | 166 | ***************************************************************************/ |
| 167 | 167 | |
| 168 | static void pbillian_draw_sprites(running_machine &machine, bitmap_t *bitmap, const rectangle | |
| 168 | static void pbillian_draw_sprites(running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect ) | |
| 169 | 169 | { |
| 170 | 170 | superqix_state *state = machine.driver_data<superqix_state>(); |
| 171 | 171 | UINT8 *spriteram = state->m_spriteram; |
| r13798 | r13799 | |
| 193 | 193 | } |
| 194 | 194 | } |
| 195 | 195 | |
| 196 | static void superqix_draw_sprites(running_machine &machine, bitmap_t *bitmap,const rectangle | |
| 196 | static void superqix_draw_sprites(running_machine &machine, bitmap_t *bitmap,const rectangle &cliprect) | |
| 197 | 197 | { |
| 198 | 198 | superqix_state *state = machine.driver_data<superqix_state>(); |
| 199 | 199 | UINT8 *spriteram = state->m_spriteram; |
| r13798 | r13799 | |
|---|---|---|
| 145 | 145 | { |
| 146 | 146 | /* When the bios is accessing vram, the video circuitry can't access it */ |
| 147 | 147 | if ( !state->m_pc10_sdcs ) |
| 148 | tilemap_draw(bitmap, | |
| 148 | tilemap_draw(bitmap, | |
| 149 | 149 | } |
| 150 | 150 | return 0; |
| 151 | 151 | } |
| r13798 | r13799 | |
| 163 | 163 | /* render the ppu */ |
| 164 | 164 | ppu2c0x_render( ppu, bitmap, 0, 0, 0, 0 ); |
| 165 | 165 | else |
| 166 | bitmap->fill(0, | |
| 166 | bitmap->fill(0, | |
| 167 | 167 | |
| 168 | 168 | return 0; |
| 169 | 169 | } |
| r13798 | r13799 | |
| 181 | 181 | if ( !state->m_pc10_sdcs ) |
| 182 | 182 | tilemap_draw(bitmap, cliprect, state->m_bg_tilemap, 0, 0); |
| 183 | 183 | else |
| 184 | bitmap->fill(0, | |
| 184 | bitmap->fill(0, | |
| 185 | 185 | |
| 186 | 186 | return 0; |
| 187 | 187 | } |
| r13798 | r13799 | |
|---|---|---|
| 331 | 331 | |
| 332 | 332 | bitmap_t *sl_bitmap = tilemap_get_pixmap(state->m_sl_tilemap); |
| 333 | 333 | |
| 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++) | |
| 336 | 336 | { |
| 337 | 337 | UINT16 src_pixel = state->m_main_bitmap->pix16(y, x); |
| 338 | 338 |
| r13798 | r13799 | |
|---|---|---|
| 332 | 332 | * |
| 333 | 333 | *************************************/ |
| 334 | 334 | |
| 335 | static UINT32 update_one_screen(screen_device &screen, bitmap_t *bitmap, const rectangle | |
| 335 | static UINT32 update_one_screen(screen_device &screen, bitmap_t *bitmap, const rectangle &cliprect, int index) | |
| 336 | 336 | { |
| 337 | 337 | cyberbal_state *state = screen.machine().driver_data<cyberbal_state>(); |
| 338 | 338 | atarimo_rect_list rectlist; |
| 339 | rectangle tempclip = | |
| 339 | rectangle tempclip = | |
| 340 | 340 | bitmap_t *mobitmap; |
| 341 | 341 | int x, y, r, mooffset, temp; |
| 342 | 342 | rectangle visarea = screen.visible_area(); |
| r13798 | r13799 | |
|---|---|---|
| 698 | 698 | if (carry) --CNT; \ |
| 699 | 699 | } while(0) |
| 700 | 700 | |
| 701 | static void rotate_draw( running_machine &machine, bitmap_t *bitmap, const rectangle | |
| 701 | static void rotate_draw( running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect ) | |
| 702 | 702 | { |
| 703 | 703 | lockon_state *state = machine.driver_data<lockon_state>(); |
| 704 | 704 | UINT32 y; |
| r13798 | r13799 | |
| 722 | 722 | UINT32 axy_en = !BIT(state->m_dx0ll, 8); |
| 723 | 723 | UINT32 ayy_en = !BIT(state->m_dy0ll, 8); |
| 724 | 724 | |
| 725 | for (y = 0; y <= cliprect | |
| 725 | for (y = 0; y <= cliprect. | |
| 726 | 726 | { |
| 727 | 727 | UINT32 carry; |
| 728 | 728 | UINT16 *dst = &bitmap->pix16(y); |
| r13798 | r13799 | |
| 734 | 734 | UINT8 axx = axy; |
| 735 | 735 | UINT8 ayx = ayy; |
| 736 | 736 | |
| 737 | for (x = 0; x <= cliprect | |
| 737 | for (x = 0; x <= cliprect. | |
| 738 | 738 | { |
| 739 | 739 | cx &= 0x1ff; |
| 740 | 740 | cy &= 0x1ff; |
| r13798 | r13799 | |
| 803 | 803 | |
| 804 | 804 | *******************************************************************************************/ |
| 805 | 805 | |
| 806 | static void hud_draw( running_machine &machine, bitmap_t *bitmap, const rectangle | |
| 806 | static void hud_draw( running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect ) | |
| 807 | 807 | { |
| 808 | 808 | lockon_state *state = machine.driver_data<lockon_state>(); |
| 809 | 809 | UINT8 *tile_rom = machine.region("gfx3")->base(); |
| r13798 | r13799 | |
| 844 | 844 | else |
| 845 | 845 | y_size = 8; |
| 846 | 846 | |
| 847 | for (y = cliprect | |
| 847 | for (y = cliprect. | |
| 848 | 848 | { |
| 849 | 849 | UINT32 xt; |
| 850 | 850 | UINT32 cy; |
| r13798 | r13799 | |
| 883 | 883 | { |
| 884 | 884 | UINT32 x = x_pos + (xt << 3) + px; |
| 885 | 885 | |
| 886 | if (x <= cliprect | |
| 886 | if (x <= cliprect. | |
| 887 | 887 | { |
| 888 | 888 | UINT16 *dst = &bitmap->pix16(y, x); |
| 889 | 889 | |
| r13798 | r13799 | |
| 936 | 936 | /* If screen output is disabled, fill with black */ |
| 937 | 937 | if (!BIT(state->m_ctrl_reg, 7)) |
| 938 | 938 | { |
| 939 | bitmap->fill(get_black_pen(screen.machine()), | |
| 939 | bitmap->fill(get_black_pen(screen.machine()), | |
| 940 | 940 | return 0; |
| 941 | 941 | } |
| 942 | 942 |
| r13798 | r13799 | |
|---|---|---|
| 399 | 399 | |
| 400 | 400 | ***************************************************************************/ |
| 401 | 401 | |
| 402 | static void mappy_draw_sprites(running_machine &machine, bitmap_t *bitmap, const rectangle | |
| 402 | static void mappy_draw_sprites(running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect, UINT8 *spriteram_base) | |
| 403 | 403 | { |
| 404 | 404 | UINT8 *spriteram = spriteram_base + 0x780; |
| 405 | 405 | UINT8 *spriteram_2 = spriteram + 0x800; |
| r13798 | r13799 | |
| 479 | 479 | 1 -------x X position MSB |
| 480 | 480 | */ |
| 481 | 481 | |
| 482 | static void phozon_draw_sprites(running_machine &machine, bitmap_t *bitmap, const rectangle | |
| 482 | static void phozon_draw_sprites(running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect, UINT8 *spriteram_base) | |
| 483 | 483 | { |
| 484 | 484 | UINT8 *spriteram = spriteram_base + 0x780; |
| 485 | 485 | UINT8 *spriteram_2 = spriteram + 0x800; |
| r13798 | r13799 | |
| 545 | 545 | |
| 546 | 546 | tilemap_draw(bitmap,cliprect,state->m_bg_tilemap,TILEMAP_DRAW_OPAQUE | TILEMAP_DRAW_ALL_CATEGORIES,0); |
| 547 | 547 | |
| 548 | sprite_bitmap->fill(15, | |
| 548 | sprite_bitmap->fill(15, | |
| 549 | 549 | mappy_draw_sprites(screen.machine(),sprite_bitmap,cliprect,state->m_spriteram); |
| 550 | 550 | copybitmap_trans(bitmap,sprite_bitmap,0,0,0,0,cliprect,15); |
| 551 | 551 |
| r13798 | r13799 | |
|---|---|---|
| 41 | 41 | layer[0] = 0; |
| 42 | 42 | layer[1] = 1; |
| 43 | 43 | |
| 44 | screen.machine().priority_bitmap->fill(0, | |
| 44 | screen.machine().priority_bitmap->fill(0, | |
| 45 | 45 | |
| 46 | 46 | pc080sn_tilemap_draw(state->m_pc080sn, bitmap, cliprect, layer[0], TILEMAP_DRAW_OPAQUE, 1); |
| 47 | 47 | pc080sn_tilemap_draw(state->m_pc080sn, bitmap, cliprect, layer[1], 0, 2); |
| r13798 | r13799 | |
|---|---|---|
| 158 | 158 | |
| 159 | 159 | konami_sortlayers4(layer, state->m_layer_pri); |
| 160 | 160 | |
| 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); | |
| 163 | 163 | |
| 164 | 164 | k056832_tilemap_draw(state->m_k056832, bitmap, cliprect, layer[0], 0, 1); |
| 165 | 165 | k056832_tilemap_draw(state->m_k056832, bitmap, cliprect, layer[1], 0, 2); |
| r13798 | r13799 | |
|---|---|---|
| 122 | 122 | { |
| 123 | 123 | if(new_data & BLTFLAG_DISPLAY_UD) |
| 124 | 124 | { |
| 125 | copybitmap(state->m_tmp_bitmap[BITMAP_FG_DISPLAY], state->m_tmp_bitmap[BITMAP_FG_1], 0, 0, 0, 0, | |
| 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()); | |
| 126 | 126 | state->m_tmp_bitmap[BITMAP_FG_1]->fill(0); |
| 127 | 127 | } |
| 128 | 128 | else |
| 129 | 129 | { |
| 130 | copybitmap(state->m_tmp_bitmap[BITMAP_FG_DISPLAY], state->m_tmp_bitmap[BITMAP_FG_2], 0, 0, 0, 0, | |
| 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()); | |
| 131 | 131 | state->m_tmp_bitmap[BITMAP_FG_2]->fill(0); |
| 132 | 132 | } |
| 133 | 133 | } |
| r13798 | r13799 | |
|---|---|---|
| 67 | 67 | } |
| 68 | 68 | } |
| 69 | 69 | |
| 70 | static void draw_sprites(running_machine &machine, bitmap_t *bitmap, const rectangle | |
| 70 | static void draw_sprites(running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect, int priority ) | |
| 71 | 71 | { |
| 72 | 72 | UINT16 *source = &machine.generic.buffered_spriteram.u16[machine.generic.spriteram_size/2] - 4; |
| 73 | 73 | UINT16 *finish = machine.generic.buffered_spriteram.u16; |
| r13798 | r13799 | |
|---|---|---|
| 777 | 777 | * |
| 778 | 778 | *************************************/ |
| 779 | 779 | |
| 780 | static int compute_clipping_extents(screen_device &screen, int enable, int clipout, int clipmask, const rectangle | |
| 780 | static int compute_clipping_extents(screen_device &screen, int enable, int clipout, int clipmask, const rectangle &cliprect, struct extents_list *list) | |
| 781 | 781 | { |
| 782 | 782 | segas32_state *state = screen.machine().driver_data<segas32_state>(); |
| 783 | 783 | int flip = (state->m_system32_videoram[0x1ff00/2] >> 9) & 1; |
| r13798 | r13799 | |
| 787 | 787 | int i, j, y; |
| 788 | 788 | |
| 789 | 789 | /* expand our cliprect to exclude the bottom-right */ |
| 790 | tempclip = | |
| 790 | tempclip = | |
| 791 | 791 | tempclip.max_x++; |
| 792 | 792 | tempclip.max_y++; |
| 793 | 793 | |
| r13798 | r13799 | |
| 909 | 909 | } |
| 910 | 910 | |
| 911 | 911 | |
| 912 | static void update_tilemap_zoom(screen_device &screen, struct layer_info *layer, const rectangle | |
| 912 | static void update_tilemap_zoom(screen_device &screen, struct layer_info *layer, const rectangle &cliprect, int bgnum) | |
| 913 | 913 | { |
| 914 | 914 | segas32_state *state = screen.machine().driver_data<segas32_state>(); |
| 915 | 915 | int clipenable, clipout, clips, clipdraw_start; |
| r13798 | r13799 | |
| 968 | 968 | srcy -= ((INT16)(state->m_system32_videoram[0x1ff32/2 + 2 * bgnum] << 7) >> 7) * srcystep; |
| 969 | 969 | |
| 970 | 970 | /* 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; | |
| 973 | 973 | |
| 974 | 974 | /* if we're flipped, simply adjust the start/step parameters */ |
| 975 | 975 | if (flip) |
| 976 | 976 | { |
| 977 | 977 | const rectangle &visarea = screen.visible_area(); |
| 978 | 978 | |
| 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; | |
| 981 | 981 | srcxstep = -srcxstep; |
| 982 | 982 | srcystep = -srcystep; |
| 983 | 983 | } |
| 984 | 984 | |
| 985 | 985 | /* loop over the target rows */ |
| 986 | for (y = cliprect | |
| 986 | for (y = cliprect. | |
| 987 | 987 | { |
| 988 | 988 | UINT16 *extents = &clip_extents.extent[clip_extents.scan_extent[y]][0]; |
| 989 | 989 | UINT16 *dst = &bitmap->pix16(y); |
| 990 | 990 | int clipdraw = clipdraw_start; |
| 991 | 991 | |
| 992 | 992 | /* optimize for the case where we are clipped out */ |
| 993 | if (clipdraw || extents[1] <= cliprect | |
| 993 | if (clipdraw || extents[1] <= cliprect. | |
| 994 | 994 | { |
| 995 | 995 | bitmap_t *tm0, *tm1; |
| 996 | 996 | int transparent = 0; |
| r13798 | r13799 | |
| 1029 | 1029 | } |
| 1030 | 1030 | |
| 1031 | 1031 | /* stop at the end */ |
| 1032 | if (extents[1] > cliprect | |
| 1032 | if (extents[1] > cliprect. | |
| 1033 | 1033 | break; |
| 1034 | 1034 | |
| 1035 | 1035 | /* swap states and advance to the next extent */ |
| r13798 | r13799 | |
| 1037 | 1037 | extents++; |
| 1038 | 1038 | } |
| 1039 | 1039 | |
| 1040 | layer->transparent[y] = (transparent == cliprect | |
| 1040 | layer->transparent[y] = (transparent == cliprect. | |
| 1041 | 1041 | } |
| 1042 | 1042 | else |
| 1043 | 1043 | layer->transparent[y] = 1; |
| r13798 | r13799 | |
| 1063 | 1063 | * |
| 1064 | 1064 | *************************************/ |
| 1065 | 1065 | |
| 1066 | static void update_tilemap_rowscroll(screen_device &screen, struct layer_info *layer, const rectangle | |
| 1066 | static void update_tilemap_rowscroll(screen_device &screen, struct layer_info *layer, const rectangle &cliprect, int bgnum) | |
| 1067 | 1067 | { |
| 1068 | 1068 | segas32_state *state = screen.machine().driver_data<segas32_state>(); |
| 1069 | 1069 | int clipenable, clipout, clips, clipdraw_start; |
| r13798 | r13799 | |
| 1109 | 1109 | yscroll = (state->m_system32_videoram[0x1ff16/2 + 4 * bgnum] & 0x1ff); |
| 1110 | 1110 | |
| 1111 | 1111 | /* render the tilemap into its bitmap */ |
| 1112 | for (y = cliprect | |
| 1112 | for (y = cliprect. | |
| 1113 | 1113 | { |
| 1114 | 1114 | UINT16 *extents = &clip_extents.extent[clip_extents.scan_extent[y]][0]; |
| 1115 | 1115 | UINT16 *dst = &bitmap->pix16(y); |
| 1116 | 1116 | int clipdraw = clipdraw_start; |
| 1117 | 1117 | |
| 1118 | 1118 | /* optimize for the case where we are clipped out */ |
| 1119 | if (clipdraw || extents[1] <= cliprect | |
| 1119 | if (clipdraw || extents[1] <= cliprect. | |
| 1120 | 1120 | { |
| 1121 | 1121 | bitmap_t *tm0, *tm1; |
| 1122 | 1122 | int transparent = 0; |
| r13798 | r13799 | |
| 1127 | 1127 | if (!flip) |
| 1128 | 1128 | { |
| 1129 | 1129 | /* get starting scroll values */ |
| 1130 | srcx = cliprect | |
| 1130 | srcx = cliprect. | |
| 1131 | 1131 | srcxstep = 1; |
| 1132 | 1132 | srcy = yscroll + y; |
| 1133 | 1133 | |
| r13798 | r13799 | |
| 1144 | 1144 | const rectangle &visarea = screen.visible_area(); |
| 1145 | 1145 | |
| 1146 | 1146 | /* get starting scroll values */ |
| 1147 | srcx = cliprect | |
| 1147 | srcx = cliprect. | |
| 1148 | 1148 | srcxstep = -1; |
| 1149 | 1149 | srcy = yscroll + visarea.max_y - y; |
| 1150 | 1150 | |
| r13798 | r13799 | |
| 1186 | 1186 | } |
| 1187 | 1187 | |
| 1188 | 1188 | /* stop at the end */ |
| 1189 | if (extents[1] > cliprect | |
| 1189 | if (extents[1] > cliprect. | |
| 1190 | 1190 | break; |
| 1191 | 1191 | |
| 1192 | 1192 | /* swap states and advance to the next extent */ |
| r13798 | r13799 | |
| 1194 | 1194 | extents++; |
| 1195 | 1195 | } |
| 1196 | 1196 | |
| 1197 | layer->transparent[y] = (transparent == cliprect | |
| 1197 | layer->transparent[y] = (transparent == cliprect. | |
| 1198 | 1198 | } |
| 1199 | 1199 | else |
| 1200 | 1200 | layer->transparent[y] = 1; |
| r13798 | r13799 | |
| 1216 | 1216 | * |
| 1217 | 1217 | *************************************/ |
| 1218 | 1218 | |
| 1219 | static void update_tilemap_text(screen_device &screen, struct layer_info *layer, const rectangle | |
| 1219 | static void update_tilemap_text(screen_device &screen, struct layer_info *layer, const rectangle &cliprect) | |
| 1220 | 1220 | { |
| 1221 | 1221 | segas32_state *state = screen.machine().driver_data<segas32_state>(); |
| 1222 | 1222 | bitmap_t *bitmap = layer->bitmap; |
| r13798 | r13799 | |
| 1235 | 1235 | gfxbase = &state->m_system32_videoram[(state->m_system32_videoram[0x1ff5c/2] & 7) * 0x2000]; |
| 1236 | 1236 | |
| 1237 | 1237 | /* 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; | |
| 1242 | 1242 | |
| 1243 | 1243 | /* loop over tiles */ |
| 1244 | 1244 | for (y = starty; y <= endy; y++) |
| r13798 | r13799 | |
| 1376 | 1376 | * |
| 1377 | 1377 | *************************************/ |
| 1378 | 1378 | |
| 1379 | static void update_bitmap(screen_device &screen, struct layer_info *layer, const rectangle | |
| 1379 | static void update_bitmap(screen_device &screen, struct layer_info *layer, const rectangle &cliprect) | |
| 1380 | 1380 | { |
| 1381 | 1381 | segas32_state *state = screen.machine().driver_data<segas32_state>(); |
| 1382 | 1382 | int clipenable, clipout, clips, clipdraw_start; |
| r13798 | r13799 | |
| 1402 | 1402 | color = (state->m_system32_videoram[0x1ff8c/2] << 4) & 0x1fff0 & ~((1 << bpp) - 1); |
| 1403 | 1403 | |
| 1404 | 1404 | /* loop over target rows */ |
| 1405 | for (y = cliprect | |
| 1405 | for (y = cliprect. | |
| 1406 | 1406 | { |
| 1407 | 1407 | UINT16 *extents = &clip_extents.extent[clip_extents.scan_extent[y]][0]; |
| 1408 | 1408 | UINT16 *dst = &bitmap->pix16(y); |
| 1409 | 1409 | int clipdraw = clipdraw_start; |
| 1410 | 1410 | |
| 1411 | 1411 | /* optimize for the case where we are clipped out */ |
| 1412 | if (clipdraw || extents[1] <= cliprect | |
| 1412 | if (clipdraw || extents[1] <= cliprect. | |
| 1413 | 1413 | { |
| 1414 | 1414 | int transparent = 0; |
| 1415 | 1415 | |
| r13798 | r13799 | |
| 1457 | 1457 | } |
| 1458 | 1458 | |
| 1459 | 1459 | /* stop at the end */ |
| 1460 | if (extents[1] > cliprect | |
| 1460 | if (extents[1] > cliprect. | |
| 1461 | 1461 | break; |
| 1462 | 1462 | |
| 1463 | 1463 | /* swap states and advance to the next extent */ |
| r13798 | r13799 | |
| 1465 | 1465 | extents++; |
| 1466 | 1466 | } |
| 1467 | 1467 | |
| 1468 | layer->transparent[y] = (transparent == cliprect | |
| 1468 | layer->transparent[y] = (transparent == cliprect. | |
| 1469 | 1469 | } |
| 1470 | 1470 | else |
| 1471 | 1471 | layer->transparent[y] = 1; |
| r13798 | r13799 | |
| 1480 | 1480 | * |
| 1481 | 1481 | *************************************/ |
| 1482 | 1482 | |
| 1483 | static void update_background(segas32_state *state, struct layer_info *layer, const rectangle | |
| 1483 | static void update_background(segas32_state *state, struct layer_info *layer, const rectangle &cliprect) | |
| 1484 | 1484 | { |
| 1485 | 1485 | bitmap_t *bitmap = layer->bitmap; |
| 1486 | 1486 | int x, y; |
| 1487 | 1487 | |
| 1488 | for (y = cliprect | |
| 1488 | for (y = cliprect. | |
| 1489 | 1489 | { |
| 1490 | 1490 | UINT16 *dst = &bitmap->pix16(y); |
| 1491 | 1491 | int color; |
| r13798 | r13799 | |
| 1497 | 1497 | color = state->m_system32_videoram[0x1ff5e/2] & 0x1e00; |
| 1498 | 1498 | |
| 1499 | 1499 | /* 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++) | |
| 1502 | 1502 | dst[x] = color; |
| 1503 | 1503 | } |
| 1504 | 1504 | } |
| 1505 | 1505 | |
| 1506 | 1506 | |
| 1507 | static UINT8 update_tilemaps(screen_device &screen, const rectangle | |
| 1507 | static UINT8 update_tilemaps(screen_device &screen, const rectangle &cliprect) | |
| 1508 | 1508 | { |
| 1509 | 1509 | segas32_state *state = screen.machine().driver_data<segas32_state>(); |
| 1510 | 1510 | int enable0 = !(state->m_system32_videoram[0x1ff02/2] & 0x0001) && !(state->m_system32_videoram[0x1ff8e/2] & 0x0002); |
| r13798 | r13799 | |
| 2010 | 2010 | return &state->m_layer_data[layer].bitmap->pix16(scanline); |
| 2011 | 2011 | } |
| 2012 | 2012 | |
| 2013 | static void mix_all_layers(segas32_state *state, int which, int xoffs, bitmap_t *bitmap, const rectangle | |
| 2013 | static void mix_all_layers(segas32_state *state, int which, int xoffs, bitmap_t *bitmap, const rectangle &cliprect, UINT8 enablemask) | |
| 2014 | 2014 | { |
| 2015 | 2015 | int blendenable = state->m_mixer_control[which][0x4e/2] & 0x0800; |
| 2016 | 2016 | int blendfactor = (state->m_mixer_control[which][0x4e/2] >> 8) & 7; |
| r13798 | r13799 | |
| 2163 | 2163 | /* directions; account for this */ |
| 2164 | 2164 | if (state->m_sprite_control_latched[0x04/2] & 1) |
| 2165 | 2165 | { |
| 2166 | sprx_start = cliprect | |
| 2166 | sprx_start = cliprect. | |
| 2167 | 2167 | sprdx = -1; |
| 2168 | 2168 | } |
| 2169 | 2169 | else |
| 2170 | 2170 | { |
| 2171 | sprx_start = cliprect | |
| 2171 | sprx_start = cliprect. | |
| 2172 | 2172 | sprdx = 1; |
| 2173 | 2173 | } |
| 2174 | 2174 | |
| 2175 | 2175 | if (state->m_sprite_control_latched[0x04/2] & 2) |
| 2176 | 2176 | { |
| 2177 | spry = cliprect | |
| 2177 | spry = cliprect. | |
| 2178 | 2178 | sprdy = -1; |
| 2179 | 2179 | } |
| 2180 | 2180 | else |
| 2181 | 2181 | { |
| 2182 | spry = cliprect | |
| 2182 | spry = cliprect. | |
| 2183 | 2183 | sprdy = 1; |
| 2184 | 2184 | } |
| 2185 | 2185 | |
| 2186 | 2186 | /* loop over rows */ |
| 2187 | for (y = cliprect | |
| 2187 | for (y = cliprect. | |
| 2188 | 2188 | { |
| 2189 | 2189 | UINT32 *dest = &bitmap->pix32(y, xoffs); |
| 2190 | 2190 | UINT16 *layerbase[8]; |
| r13798 | r13799 | |
| 2200 | 2200 | layerbase[MIXER_LAYER_BACKGROUND] = get_layer_scanline(state, MIXER_LAYER_BACKGROUND, y); |
| 2201 | 2201 | |
| 2202 | 2202 | /* loop over columns */ |
| 2203 | for (x = cliprect | |
| 2203 | for (x = cliprect. | |
| 2204 | 2204 | { |
| 2205 | 2205 | struct mixer_layer_info *first; |
| 2206 | 2206 | int *rgbdelta; |
| r13798 | r13799 | |
| 2435 | 2435 | /* if the display is off, punt */ |
| 2436 | 2436 | if (!state->m_system32_displayenable[0]) |
| 2437 | 2437 | { |
| 2438 | bitmap->fill(get_black_pen(screen.machine()), | |
| 2438 | bitmap->fill(get_black_pen(screen.machine()), | |
| 2439 | 2439 | return 0; |
| 2440 | 2440 | } |
| 2441 | 2441 | |
| r13798 | r13799 | |
| 2600 | 2600 | } |
| 2601 | 2601 | |
| 2602 | 2602 | |
| 2603 | static UINT32 multi32_update(screen_device &screen, bitmap_t *bitmap, const rectangle | |
| 2603 | static UINT32 multi32_update(screen_device &screen, bitmap_t *bitmap, const rectangle &cliprect, int index) | |
| 2604 | 2604 | { |
| 2605 | 2605 | segas32_state *state = screen.machine().driver_data<segas32_state>(); |
| 2606 | 2606 | UINT8 enablemask; |
| r13798 | r13799 | |
| 2614 | 2614 | /* if the display is off, punt */ |
| 2615 | 2615 | if (!state->m_system32_displayenable[index]) |
| 2616 | 2616 | { |
| 2617 | bitmap->fill(get_black_pen(screen.machine()), | |
| 2617 | bitmap->fill(get_black_pen(screen.machine()), | |
| 2618 | 2618 | return 0; |
| 2619 | 2619 | } |
| 2620 | 2620 |
| r13798 | r13799 | |
|---|---|---|
| 153 | 153 | Render the Sprites |
| 154 | 154 | |
| 155 | 155 | ***************************************************************************/ |
| 156 | static void draw_sprites(running_machine &machine, bitmap_t *bitmap, const rectangle | |
| 156 | static void draw_sprites(running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect, int priority_to_display ) | |
| 157 | 157 | { |
| 158 | 158 | slapfght_state *state = machine.driver_data<slapfght_state>(); |
| 159 | 159 | UINT8 *buffered_spriteram = machine.generic.buffered_spriteram.u8; |
| r13798 | r13799 | |
|---|---|---|
| 195 | 195 | a single transparent pen, storing the alpha value |
| 196 | 196 | in alpha field of ARGB32, negative alpha implies alphatable |
| 197 | 197 | -------------------------------------------------*/ |
| 198 | static void drawgfx_alphastore(bitmap_t *dest, const rectangle | |
| 198 | static void drawgfx_alphastore(bitmap_t *dest, const rectangle &cliprect, const gfx_element *gfx, | |
| 199 | 199 | UINT32 code, UINT32 color, int flipx, int flipy, INT32 destx, INT32 desty, |
| 200 | 200 | int fixedalpha) |
| 201 | 201 | { |
| r13798 | r13799 | |
| 242 | 242 | a fixed alpha value, or if alpha==-1 then uses |
| 243 | 243 | the per-pen alphatable[] array |
| 244 | 244 | -------------------------------------------------*/ |
| 245 | static void drawgfx_alphatable(bitmap_t *dest, const rectangle | |
| 245 | static void drawgfx_alphatable(bitmap_t *dest, const rectangle &cliprect, const gfx_element *gfx, | |
| 246 | 246 | UINT32 code, UINT32 color, int flipx, int flipy, INT32 destx, INT32 desty, |
| 247 | 247 | int fixedalpha) |
| 248 | 248 | { |
| r13798 | r13799 | |
| 281 | 281 | |
| 282 | 282 | /* 'Normal' layers, no line/columnscroll. No per-line effects. |
| 283 | 283 | Zooming isn't supported just because it's not used and it would be slow */ |
| 284 | static void draw_bglayer( running_machine &machine, int layer, bitmap_t *bitmap, const rectangle | |
| 284 | static void draw_bglayer( running_machine &machine, int layer, bitmap_t *bitmap, const rectangle &cliprect, UINT8 req_pri ) | |
| 285 | 285 | { |
| 286 | 286 | psikyosh_state *state = machine.driver_data<psikyosh_state>(); |
| 287 | 287 | gfx_element *gfx; |
| r13798 | r13799 | |
| 375 | 375 | int need_alpha = alpha < 0 ? -1 : 0xff; // store per-pen alpha in bitmap, otherwise don't since we'll need it per-line |
| 376 | 376 | |
| 377 | 377 | if(tileno) { // valid tile, but blank in all games? |
| 378 | drawgfx_alphastore(state->m_bg_bitmap, | |
| 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); | |
| 379 | 379 | } |
| 380 | 380 | |
| 381 | 381 | offs++; |
| r13798 | r13799 | |
| 389 | 389 | Bitmap is first rendered to an ARGB image, taking into account the per-pen alpha (if used). |
| 390 | 390 | From there we extract data as we compose the image, one scanline at a time, blending the ARGB pixels |
| 391 | 391 | into the RGB32 bitmap (with either the alpha information from the ARGB, or per-line alpha */ |
| 392 | static void draw_bglayerscroll( running_machine &machine, int layer, bitmap_t *bitmap, const rectangle | |
| 392 | static void draw_bglayerscroll( running_machine &machine, int layer, bitmap_t *bitmap, const rectangle &cliprect, UINT8 req_pri ) | |
| 393 | 393 | { |
| 394 | 394 | psikyosh_state *state = machine.driver_data<psikyosh_state>(); |
| 395 | 395 | assert(BG_LINE(layer)); |
| r13798 | r13799 | |
| 404 | 404 | 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 |
| 405 | 405 | for(int ii = 0; ii < 32; ii++) last_bank[ii] = -1; |
| 406 | 406 | |
| 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); | |
| 409 | 409 | UINT32 *scroll_reg = &state->m_bgram[(linebank * 0x800) / 4 - 0x4000 / 4]; |
| 410 | 410 | UINT32 *pzab_reg = &state->m_bgram[(linebank * 0x800) / 4 - 0x4000 / 4 + 0x400 / 4]; // pri, zoom, alpha, bank |
| 411 | 411 | |
| r13798 | r13799 | |
| 484 | 484 | } |
| 485 | 485 | |
| 486 | 486 | /* 3 BG layers, with priority */ |
| 487 | static void draw_background( running_machine &machine, bitmap_t *bitmap, const rectangle | |
| 487 | static void draw_background( running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect, UINT8 req_pri ) | |
| 488 | 488 | { |
| 489 | 489 | psikyosh_state *state = machine.driver_data<psikyosh_state>(); |
| 490 | 490 | int i; |
| r13798 | r13799 | |
| 532 | 532 | /* Note that Level 5-4 of sbomberb boss is perfect! (Alpha blended zoomed) as well as S1945II logo */ |
| 533 | 533 | /* pixel is only plotted if z is >= priority_buffer[y][x] */ |
| 534 | 534 | static void psikyosh_drawgfxzoom( running_machine &machine, |
| 535 | bitmap_t *dest_bmp,const rectangle | |
| 535 | bitmap_t *dest_bmp,const rectangle &clip,const gfx_element *gfx, | |
| 536 | 536 | UINT32 code,UINT32 color,int flipx,int flipy,int offsx,int offsy, |
| 537 | 537 | int alpha, int zoomx, int zoomy, int wide, int high, UINT32 z) |
| 538 | 538 | { |
| r13798 | r13799 | |
| 550 | 550 | assert(dest_bmp->bpp() == 32); |
| 551 | 551 | |
| 552 | 552 | /* 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(); | |
| 563 | 555 | |
| 564 | 556 | /* 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 */ |
| 565 | 557 | if (zoomx == 0x400 && zoomy == 0x400) |
| r13798 | r13799 | |
| 598 | 590 | ex = sx + gfx->width; |
| 599 | 591 | ey = sy + gfx->height; |
| 600 | 592 | |
| 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; | |
| 626 | 598 | } |
| 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 | } | |
| 627 | 616 | |
| 628 | 617 | if (ex > sx) |
| 629 | 618 | { /* skip if inner loop doesn't draw anything */ |
| r13798 | r13799 | |
| 871 | 860 | if (flipy) { y_index = (sprite_screen_height - 1) * zoomy; dy = -zoomy; } |
| 872 | 861 | else { y_index = 0; dy = zoomy; } |
| 873 | 862 | |
| 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; | |
| 899 | 868 | } |
| 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 | } | |
| 900 | 886 | |
| 901 | 887 | if (ex > sx) |
| 902 | 888 | { /* skip if inner loop doesn't draw anything */ |
| r13798 | r13799 | |
| 1068 | 1054 | } |
| 1069 | 1055 | |
| 1070 | 1056 | |
| 1071 | static void draw_sprites(running_machine &machine, bitmap_t *bitmap, const rectangle | |
| 1057 | static void draw_sprites(running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect, UINT8 req_pri) | |
| 1072 | 1058 | { |
| 1073 | 1059 | /*- Sprite Format 0x0000 - 0x37ff -** |
| 1074 | 1060 | |
| r13798 | r13799 | |
| 1188 | 1174 | } |
| 1189 | 1175 | |
| 1190 | 1176 | |
| 1191 | static void psikyosh_prelineblend( running_machine &machine, bitmap_t *bitmap, const rectangle | |
| 1177 | static void psikyosh_prelineblend( running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect ) | |
| 1192 | 1178 | { |
| 1193 | 1179 | /* There are 224 values for pre-lineblending. Using one for every row currently */ |
| 1194 | 1180 | /* I suspect that it should be blended against black by the amount specified as |
| r13798 | r13799 | |
| 1203 | 1189 | assert(bitmap->bpp() == 32); |
| 1204 | 1190 | |
| 1205 | 1191 | g_profiler.start(PROFILER_USER8); |
| 1206 | for (y = cliprect | |
| 1192 | for (y = cliprect. | |
| 1207 | 1193 | |
| 1208 | 1194 | dstline = &bitmap->pix32(y); |
| 1209 | 1195 | |
| 1210 | 1196 | /* linefill[y] & 0xff does what? */ |
| 1211 | for (x = cliprect | |
| 1197 | for (x = cliprect. | |
| 1212 | 1198 | dstline[x] = linefill[y] >> 8; |
| 1213 | 1199 | } |
| 1214 | 1200 | g_profiler.stop(); |
| 1215 | 1201 | } |
| 1216 | 1202 | |
| 1217 | 1203 | |
| 1218 | static void psikyosh_postlineblend( running_machine &machine, bitmap_t *bitmap, const rectangle | |
| 1204 | static void psikyosh_postlineblend( running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect, UINT8 req_pri ) | |
| 1219 | 1205 | { |
| 1220 | 1206 | /* There are 224 values for post-lineblending. Using one for every row currently */ |
| 1221 | 1207 | psikyosh_state *state = machine.driver_data<psikyosh_state>(); |
| r13798 | r13799 | |
| 1231 | 1217 | } |
| 1232 | 1218 | |
| 1233 | 1219 | g_profiler.start(PROFILER_USER8); |
| 1234 | for (y = cliprect | |
| 1220 | for (y = cliprect. | |
| 1235 | 1221 | |
| 1236 | 1222 | dstline = &bitmap->pix32(y); |
| 1237 | 1223 | |
| 1238 | 1224 | if (lineblend[y] & 0x80) /* solid */ |
| 1239 | 1225 | { |
| 1240 | for (x = cliprect | |
| 1226 | for (x = cliprect. | |
| 1241 | 1227 | dstline[x] = lineblend[y] >> 8; |
| 1242 | 1228 | } |
| 1243 | 1229 | else if (lineblend[y] & 0x7f) /* blended */ |
| 1244 | 1230 | { |
| 1245 | for (x = cliprect | |
| 1231 | for (x = cliprect. | |
| 1246 | 1232 | dstline[x] = alpha_blend_r32(dstline[x], lineblend[y] >> 8, 2 * (lineblend[y] & 0x7f)); |
| 1247 | 1233 | } |
| 1248 | 1234 | } |
| r13798 | r13799 | |
| 1321 | 1307 | state->m_vidregs[6], state->m_vidregs[7]); |
| 1322 | 1308 | #endif |
| 1323 | 1309 | |
| 1324 | state->m_z_bitmap->fill(0, | |
| 1310 | state->m_z_bitmap->fill(0, | |
| 1325 | 1311 | |
| 1326 | 1312 | psikyosh_prelineblend(screen.machine(), bitmap, cliprect); // fills screen |
| 1327 | 1313 | for (i = 0; i <= 7; i++) |
| r13798 | r13799 | |
|---|---|---|
| 138 | 138 | palette_set_color_rgb(space->machine(),offs/2,pal5bit(r),pal5bit(g),pal5bit(b)); |
| 139 | 139 | } |
| 140 | 140 | |
| 141 | static void draw_sprites(running_machine &machine, bitmap_t *bitmap, const rectangle | |
| 141 | static void draw_sprites(running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect) | |
| 142 | 142 | { |
| 143 | 143 | quizdna_state *state = machine.driver_data<quizdna_state>(); |
| 144 | 144 | UINT8 *spriteram = state->m_spriteram; |
| r13798 | r13799 | |
| 202 | 202 | tilemap_draw(bitmap, cliprect, state->m_fg_tilemap, 0, 0); |
| 203 | 203 | } |
| 204 | 204 | else |
| 205 | bitmap->fill(get_black_pen(screen.machine()), | |
| 205 | bitmap->fill(get_black_pen(screen.machine()), | |
| 206 | 206 | return 0; |
| 207 | 207 | } |
| r13798 | r13799 | |
|---|---|---|
| 97 | 97 | pandora->clear_bitmap = clear; |
| 98 | 98 | } |
| 99 | 99 | |
| 100 | void pandora_update( device_t *device, bitmap_t *bitmap, const rectangle | |
| 100 | void pandora_update( device_t *device, bitmap_t *bitmap, const rectangle &cliprect ) | |
| 101 | 101 | { |
| 102 | 102 | kaneko_pandora_state *pandora = get_safe_token(device); |
| 103 | 103 | |
| r13798 | r13799 | |
| 111 | 111 | } |
| 112 | 112 | |
| 113 | 113 | |
| 114 | static void pandora_draw( device_t *device, bitmap_t *bitmap, const rectangle | |
| 114 | static void pandora_draw( device_t *device, bitmap_t *bitmap, const rectangle &cliprect ) | |
| 115 | 115 | { |
| 116 | 116 | kaneko_pandora_state *pandora = get_safe_token(device); |
| 117 | 117 | int sx = 0, sy = 0, x = 0, y = 0, offs; |
| r13798 | r13799 | |
| 204 | 204 | if (pandora->clear_bitmap) |
| 205 | 205 | pandora->sprites_bitmap->fill(pandora->bg_pen, pandora->screen->visible_area()); |
| 206 | 206 | |
| 207 | pandora_draw(device, pandora->sprites_bitmap, | |
| 207 | pandora_draw(device, pandora->sprites_bitmap, | |
| 208 | 208 | } |
| 209 | 209 | |
| 210 | 210 | /***************************************************************************** |
| r13798 | r13799 | |
|---|---|---|
| 3 | 3 | #include "video/deco16ic.h" |
| 4 | 4 | #include "video/decocomn.h" |
| 5 | 5 | |
| 6 | static void draw_sprites( running_machine &machine, bitmap_t *bitmap, const rectangle | |
| 6 | static void draw_sprites( running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect, UINT16* spriteram_base, int gfx_region ) | |
| 7 | 7 | { |
| 8 | 8 | boogwing_state *state = machine.driver_data<boogwing_state>(); |
| 9 | 9 | int offs; |
| r13798 | r13799 | |
| 150 | 150 | |
| 151 | 151 | /* Draw playfields */ |
| 152 | 152 | decocomn_clear_sprite_priority_bitmap(state->m_decocomn); |
| 153 | bitmap->fill(screen.machine().pens[0x400], | |
| 153 | bitmap->fill(screen.machine().pens[0x400], | |
| 154 | 154 | screen.machine().priority_bitmap->fill(0); |
| 155 | 155 | |
| 156 | 156 | // bit&0x8 is definitely some kind of palette effect |
| r13798 | r13799 | |
|---|---|---|
| 258 | 258 | * |
| 259 | 259 | *************************************/ |
| 260 | 260 | |
| 261 | static void equites_draw_sprites_block( running_machine &machine, bitmap_t *bitmap, const rectangle | |
| 261 | static void equites_draw_sprites_block( running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect, int start, int end ) | |
| 262 | 262 | { |
| 263 | 263 | equites_state *state = machine.driver_data<equites_state>(); |
| 264 | 264 | int offs; |
| r13798 | r13799 | |
| 299 | 299 | } |
| 300 | 300 | } |
| 301 | 301 | |
| 302 | static void equites_draw_sprites(running_machine &machine, bitmap_t *bitmap, const rectangle | |
| 302 | static void equites_draw_sprites(running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect) | |
| 303 | 303 | { |
| 304 | 304 | // note that we draw the sprites in three blocks; in each blocks, sprites at |
| 305 | 305 | // a lower address have priority. This gives good priorities in gekisou. |
| r13798 | r13799 | |
| 332 | 332 | 03020303 03030303 03030303 03030303 |
| 333 | 333 | */ |
| 334 | 334 | |
| 335 | static void splndrbt_draw_sprites( running_machine &machine, bitmap_t *bitmap, const rectangle | |
| 335 | static void splndrbt_draw_sprites( running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect ) | |
| 336 | 336 | { |
| 337 | 337 | equites_state *state = machine.driver_data<equites_state>(); |
| 338 | 338 | const UINT8 * const xrom = machine.region("user2")->base(); |
| r13798 | r13799 | |
| 384 | 384 | { |
| 385 | 385 | int const y = yhalf ? sy + 1 + yy : sy - yy; |
| 386 | 386 | |
| 387 | if (y >= cliprect | |
| 387 | if (y >= cliprect. | |
| 388 | 388 | { |
| 389 | 389 | for (x = 0; x <= (scalex << 1); ++x) |
| 390 | 390 | { |
| 391 | 391 | int bx = (sx + x) & 0xff; |
| 392 | 392 | |
| 393 | if (bx >= cliprect | |
| 393 | if (bx >= cliprect. | |
| 394 | 394 | { |
| 395 | 395 | int xx = scalex ? (x * 29 + scalex) / (scalex << 1) + 1 : 16; // FIXME This is wrong. Should use the PROM. |
| 396 | 396 | int const offset = (fx ? (31 - xx) : xx) + ((fy ^ yhalf) ? (16 + line) : (15 - line) ) * gfx->line_modulo; |
| r13798 | r13799 | |
| 408 | 408 | } |
| 409 | 409 | |
| 410 | 410 | |
| 411 | static void splndrbt_copy_bg( running_machine &machine, bitmap_t *dst_bitmap, const rectangle | |
| 411 | static void splndrbt_copy_bg( running_machine &machine, bitmap_t *dst_bitmap, const rectangle &cliprect ) | |
| 412 | 412 | { |
| 413 | 413 | equites_state *state = machine.driver_data<equites_state>(); |
| 414 | 414 | bitmap_t * const src_bitmap = tilemap_get_pixmap(state->m_bg_tilemap); |
| r13798 | r13799 | |
| 429 | 429 | |
| 430 | 430 | for (dst_y = 32; dst_y < 256-32; ++dst_y) |
| 431 | 431 | { |
| 432 | if (dst_y >= cliprect | |
| 432 | if (dst_y >= cliprect. | |
| 433 | 433 | { |
| 434 | 434 | const UINT8 * const romline = &xrom[(dst_y ^ dinvert) << 5]; |
| 435 | 435 | const UINT16 * const src_line = &src_bitmap->pix16((src_y + scroll_y) & 0x1ff); |
| r13798 | r13799 | |
| 466 | 466 | SCREEN_UPDATE( equites ) |
| 467 | 467 | { |
| 468 | 468 | equites_state *state = screen.machine().driver_data<equites_state>(); |
| 469 | bitmap->fill(state->m_bgcolor, | |
| 469 | bitmap->fill(state->m_bgcolor, | |
| 470 | 470 | |
| 471 | 471 | tilemap_draw(bitmap, cliprect, state->m_bg_tilemap, 0, 0); |
| 472 | 472 | |
| r13798 | r13799 | |
| 480 | 480 | SCREEN_UPDATE( splndrbt ) |
| 481 | 481 | { |
| 482 | 482 | equites_state *state = screen.machine().driver_data<equites_state>(); |
| 483 | bitmap->fill(state->m_bgcolor, | |
| 483 | bitmap->fill(state->m_bgcolor, | |
| 484 | 484 | |
| 485 | 485 | splndrbt_copy_bg(screen.machine(), bitmap, cliprect); |
| 486 | 486 |
| r13798 | r13799 | |
|---|---|---|
| 39 | 39 | DEVICE I/O FUNCTIONS |
| 40 | 40 | ***************************************************************************/ |
| 41 | 41 | |
| 42 | void pandora_update(device_t *device, bitmap_t *bitmap, const rectangle | |
| 42 | void pandora_update(device_t *device, bitmap_t *bitmap, const rectangle &cliprect); | |
| 43 | 43 | void pandora_eof(device_t *device); |
| 44 | 44 | void pandora_set_clear_bitmap(device_t *device, int clear); |
| 45 | 45 | void pandora_set_bg_pen( device_t *device, int pen ); |
| r13798 | r13799 | |
|---|---|---|
| 133 | 133 | |
| 134 | 134 | k052109_tilemap_update(state->m_k052109); |
| 135 | 135 | |
| 136 | screen.machine().priority_bitmap->fill(0, | |
| 136 | screen.machine().priority_bitmap->fill(0, | |
| 137 | 137 | if (state->m_priority == 0) |
| 138 | 138 | { |
| 139 | 139 | k052109_tilemap_draw(state->m_k052109, bitmap, cliprect, 1, TILEMAP_DRAW_OPAQUE, 2); |
| r13798 | r13799 | |
|---|---|---|
| 95 | 95 | palette_set_colors(machine, 0, pk8000_palette, ARRAY_LENGTH(pk8000_palette)); |
| 96 | 96 | } |
| 97 | 97 | |
| 98 | UINT32 pk8000_video_update(screen_device &screen, bitmap_t *bitmap, const rectangle | |
| 98 | UINT32 pk8000_video_update(screen_device &screen, bitmap_t *bitmap, const rectangle &cliprect, UINT8 *videomem) | |
| 99 | 99 | { |
| 100 | 100 | int x,y,j,b; |
| 101 | 101 | UINT16 offset = (pk8000_video_mode & 0xc0) << 8; |
| r13798 | r13799 | |
|---|---|---|
| 118 | 118 | big object |
| 119 | 119 | ********************************************/ |
| 120 | 120 | |
| 121 | static void draw_object( running_machine& machine, bitmap_t *bitmap, const rectangle | |
| 121 | static void draw_object( running_machine& machine, bitmap_t *bitmap, const rectangle &cliprect ) | |
| 122 | 122 | { |
| 123 | 123 | decocass_state *state = machine.driver_data<decocass_state>(); |
| 124 | 124 | int sx, sy, color; |
| r13798 | r13799 | |
| 141 | 141 | drawgfx_transpen(bitmap, cliprect, machine.gfx[3], 1, color, 0, 1, sx, sy - 64, 0); |
| 142 | 142 | } |
| 143 | 143 | |
| 144 | static void draw_center( running_machine& machine, bitmap_t *bitmap, const rectangle | |
| 144 | static void draw_center( running_machine& machine, bitmap_t *bitmap, const rectangle &cliprect ) | |
| 145 | 145 | { |
| 146 | 146 | decocass_state *state = machine.driver_data<decocass_state>(); |
| 147 | 147 | int sx, sy, x, y, color; |
| r13798 | r13799 | |
| 160 | 160 | sx = (state->m_center_h_shift_space >> 2) & 0x3c; |
| 161 | 161 | |
| 162 | 162 | for (y = 0; y < 4; y++) |
| 163 | if ((sy + y) >= cliprect | |
| 163 | if ((sy + y) >= cliprect. | |
| 164 | 164 | { |
| 165 | 165 | if (((sy + y) & state->m_color_center_bot & 3) == (sy & state->m_color_center_bot & 3)) |
| 166 | 166 | for (x = 0; x < 256; x++) |
| r13798 | r13799 | |
| 391 | 391 | memory handlers |
| 392 | 392 | ********************************************/ |
| 393 | 393 | |
| 394 | static void draw_sprites(running_machine& machine, bitmap_t *bitmap, const rectangle | |
| 394 | static void draw_sprites(running_machine& machine, bitmap_t *bitmap, const rectangle &cliprect, int color, | |
| 395 | 395 | int sprite_y_adjust, int sprite_y_adjust_flip_screen, |
| 396 | 396 | UINT8 *sprite_ram, int interleave) |
| 397 | 397 | { |
| r13798 | r13799 | |
| 440 | 440 | } |
| 441 | 441 | |
| 442 | 442 | |
| 443 | static void draw_missiles(running_machine &machine,bitmap_t *bitmap, const rectangle | |
| 443 | static void draw_missiles(running_machine &machine,bitmap_t *bitmap, const rectangle &cliprect, | |
| 444 | 444 | int missile_y_adjust, int missile_y_adjust_flip_screen, |
| 445 | 445 | UINT8 *missile_ram, int interleave) |
| 446 | 446 | { |
| r13798 | r13799 | |
| 461 | 461 | sy = 240 - sy + missile_y_adjust_flip_screen; |
| 462 | 462 | } |
| 463 | 463 | sy -= missile_y_adjust; |
| 464 | if (sy >= cliprect | |
| 464 | if (sy >= cliprect. | |
| 465 | 465 | for (x = 0; x < 4; x++) |
| 466 | 466 | { |
| 467 | if (sx >= cliprect | |
| 467 | if (sx >= cliprect. | |
| 468 | 468 | bitmap->pix16(sy, sx) = (state->m_color_missiles >> 4) & 7; |
| 469 | 469 | sx++; |
| 470 | 470 | } |
| r13798 | r13799 | |
| 477 | 477 | sy = 240 - sy + missile_y_adjust_flip_screen; |
| 478 | 478 | } |
| 479 | 479 | sy -= missile_y_adjust; |
| 480 | if (sy >= cliprect | |
| 480 | if (sy >= cliprect. | |
| 481 | 481 | for (x = 0; x < 4; x++) |
| 482 | 482 | { |
| 483 | if (sx >= cliprect | |
| 483 | if (sx >= cliprect. | |
| 484 | 484 | bitmap->pix16(sy, sx) = state->m_color_missiles & 7; |
| 485 | 485 | sx++; |
| 486 | 486 | } |
| r13798 | r13799 | |
| 552 | 552 | } |
| 553 | 553 | #endif |
| 554 | 554 | |
| 555 | bitmap->fill(0, | |
| 555 | bitmap->fill(0, | |
| 556 | 556 | |
| 557 | 557 | scrolly_l = state->m_back_vl_shift; |
| 558 | 558 | scrolly_r = 256 - state->m_back_vr_shift; |
| r13798 | r13799 | |
| 581 | 581 | if (state->m_mode_set & 0x08) /* bkg_ena on ? */ |
| 582 | 582 | { |
| 583 | 583 | 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); | |
| 586 | 586 | |
| 587 | 587 | 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); | |
| 590 | 590 | } |
| 591 | 591 | |
| 592 | 592 | if (state->m_mode_set & 0x20) |
| r13798 | r13799 | |
| 601 | 601 | if (state->m_mode_set & 0x08) /* bkg_ena on ? */ |
| 602 | 602 | { |
| 603 | 603 | 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); | |
| 606 | 606 | |
| 607 | 607 | 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); | |
| 610 | 610 | } |
| 611 | 611 | } |
| 612 | 612 | tilemap_draw(bitmap, cliprect, state->m_fg_tilemap, 0, 0); |
| r13798 | r13799 | |
|---|---|---|
| 76 | 76 | pri[x] = 0xff; \ |
| 77 | 77 | } \ |
| 78 | 78 | |
| 79 | void segaic16_sprites_hangon_draw(running_machine &machine, device_t *device, bitmap_t *bitmap, const rectangle | |
| 79 | void segaic16_sprites_hangon_draw(running_machine &machine, device_t *device, bitmap_t *bitmap, const rectangle &cliprect) | |
| 80 | 80 | { |
| 81 | 81 | UINT8 numbanks = machine.region("gfx2")->bytes() / 0x10000; |
| 82 | 82 | const UINT16 *spritebase = (const UINT16 *)machine.region("gfx2")->base(); |
| r13798 | r13799 | |
| 132 | 132 | addr += pitch; |
| 133 | 133 | |
| 134 | 134 | /* skip drawing if not within the cliprect */ |
| 135 | if (y >= cliprect | |
| 135 | if (y >= cliprect. | |
| 136 | 136 | { |
| 137 | 137 | UINT16 *dest = &bitmap->pix16(y); |
| 138 | 138 | UINT8 *pri = &machine.priority_bitmap->pix8(y); |
| r13798 | r13799 | |
| 147 | 147 | { |
| 148 | 148 | /* start at the word before because we preincrement below */ |
| 149 | 149 | data[7] = addr - 1; |
| 150 | for (x = xpos; x <= cliprect | |
| 150 | for (x = xpos; x <= cliprect. | |
| 151 | 151 | { |
| 152 | 152 | UINT16 pixels = spritedata[++data[7] & 0x7fff]; |
| 153 | 153 | |
| 154 | 154 | /* 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++; } | |
| 159 | 159 | |
| 160 | 160 | /* stop if the last pixel in the group was 0xf */ |
| 161 | 161 | if (pix == 15) |
| r13798 | r13799 | |
| 168 | 168 | { |
| 169 | 169 | /* start at the word after because we predecrement below */ |
| 170 | 170 | data[7] = addr + 1; |
| 171 | for (x = xpos; x <= cliprect | |
| 171 | for (x = xpos; x <= cliprect. | |
| 172 | 172 | { |
| 173 | 173 | UINT16 pixels = spritedata[--data[7] & 0x7fff]; |
| 174 | 174 | |
| 175 | 175 | /* 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++; } | |
| 180 | 180 | |
| 181 | 181 | /* stop if the last pixel in the group was 0xf */ |
| 182 | 182 | if (pix == 15) |
| r13798 | r13799 | |
| 241 | 241 | pri[x] = 0xff; \ |
| 242 | 242 | } \ |
| 243 | 243 | |
| 244 | void segaic16_sprites_sharrier_draw(running_machine &machine, device_t *device, bitmap_t *bitmap, const rectangle | |
| 244 | void segaic16_sprites_sharrier_draw(running_machine &machine, device_t *device, bitmap_t *bitmap, const rectangle &cliprect) | |
| 245 | 245 | { |
| 246 | 246 | UINT8 numbanks = machine.region("gfx2")->bytes() / 0x20000; |
| 247 | 247 | const UINT32 *spritebase = (const UINT32 *)machine.region("gfx2")->base(); |
| r13798 | r13799 | |
| 298 | 298 | addr += pitch; |
| 299 | 299 | |
| 300 | 300 | /* skip drawing if not within the cliprect */ |
| 301 | if (y >= cliprect | |
| 301 | if (y >= cliprect. | |
| 302 | 302 | { |
| 303 | 303 | UINT16 *dest = &bitmap->pix16(y); |
| 304 | 304 | UINT8 *pri = &machine.priority_bitmap->pix8(y); |
| r13798 | r13799 | |
| 313 | 313 | { |
| 314 | 314 | /* start at the word before because we preincrement below */ |
| 315 | 315 | data[7] = addr - 1; |
| 316 | for (x = xpos; x <= cliprect | |
| 316 | for (x = xpos; x <= cliprect. | |
| 317 | 317 | { |
| 318 | 318 | UINT32 pixels = spritedata[++data[7] & 0x7fff]; |
| 319 | 319 | |
| 320 | 320 | /* 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++; } | |
| 329 | 329 | |
| 330 | 330 | /* stop if the last pixel in the group was 0xf */ |
| 331 | 331 | if (pix == 15) |
| r13798 | r13799 | |
| 338 | 338 | { |
| 339 | 339 | /* start at the word after because we predecrement below */ |
| 340 | 340 | data[7] = addr + 1; |
| 341 | for (x = xpos; x <= cliprect | |
| 341 | for (x = xpos; x <= cliprect. | |
| 342 | 342 | { |
| 343 | 343 | UINT32 pixels = spritedata[--data[7] & 0x7fff]; |
| 344 | 344 | |
| 345 | 345 | /* 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++; } | |
| 354 | 354 | |
| 355 | 355 | /* stop if the last pixel in the group was 0xf */ |
| 356 | 356 | if (pix == 15) |
| r13798 | r13799 | |
| 394 | 394 | |
| 395 | 395 | #define system16a_draw_pixel() \ |
| 396 | 396 | /* only draw if onscreen, not 0 or 15 */ \ |
| 397 | if (x >= cliprect | |
| 397 | if (x >= cliprect. | |
| 398 | 398 | { \ |
| 399 | 399 | /* are we high enough priority to be visible? */ \ |
| 400 | 400 | if (sprpri > pri[x]) \ |
| r13798 | r13799 | |
| 412 | 412 | pri[x] = 0xff; \ |
| 413 | 413 | } \ |
| 414 | 414 | |
| 415 | void segaic16_sprites_16a_draw(running_machine &machine, device_t *device, bitmap_t *bitmap, const rectangle | |
| 415 | void segaic16_sprites_16a_draw(running_machine &machine, device_t *device, bitmap_t *bitmap, const rectangle &cliprect) | |
| 416 | 416 | { |
| 417 | 417 | UINT8 numbanks = machine.region("gfx2")->bytes() / 0x10000; |
| 418 | 418 | const UINT16 *spritebase = (const UINT16 *)machine.region("gfx2")->base(); |
| r13798 | r13799 | |
| 467 | 467 | addr += pitch; |
| 468 | 468 | |
| 469 | 469 | /* skip drawing if not within the cliprect */ |
| 470 | if (y >= cliprect | |
| 470 | if (y >= cliprect. | |
| 471 | 471 | { |
| 472 | 472 | UINT16 *dest = &bitmap->pix16(y); |
| 473 | 473 | UINT8 *pri = &machine.priority_bitmap->pix8(y); |
| r13798 | r13799 | |
| 550 | 550 | |
| 551 | 551 | #define system16b_draw_pixel() \ |
| 552 | 552 | /* only draw if onscreen, not 0 or 15 */ \ |
| 553 | if (x >= cliprect | |
| 553 | if (x >= cliprect. | |
| 554 | 554 | { \ |
| 555 | 555 | /* are we high enough priority to be visible? */ \ |
| 556 | 556 | if (sprpri > pri[x]) \ |
| r13798 | r13799 | |
| 573 | 573 | pri[x] = 0xff; \ |
| 574 | 574 | } \ |
| 575 | 575 | |
| 576 | void segaic16_sprites_16b_draw(running_machine &machine, device_t *device, bitmap_t *bitmap, const rectangle | |
| 576 | void segaic16_sprites_16b_draw(running_machine &machine, device_t *device, bitmap_t *bitmap, const rectangle &cliprect) | |
| 577 | 577 | { |
| 578 | 578 | UINT8 numbanks; |
| 579 | 579 | const UINT16 *spritebase; |
| r13798 | r13799 | |
| 656 | 656 | } |
| 657 | 657 | |
| 658 | 658 | /* skip drawing if not within the cliprect */ |
| 659 | if (y >= cliprect | |
| 659 | if (y >= cliprect. | |
| 660 | 660 | { |
| 661 | 661 | UINT16 *dest = &bitmap->pix16(y); |
| 662 | 662 | UINT8 *pri = &machine.priority_bitmap->pix8(y); |
| r13798 | r13799 | |
| 721 | 721 | |
| 722 | 722 | #define yboard_16b_draw_pixel() \ |
| 723 | 723 | /* only draw if onscreen, not 0 or 15 */ \ |
| 724 | if (x >= cliprect | |
| 724 | if (x >= cliprect. | |
| 725 | 725 | { \ |
| 726 | 726 | /* are we high enough priority to be visible? */ \ |
| 727 | 727 | if ((sprpri & 0x1f) < (pri[x] & 0x1f)) \ |
| r13798 | r13799 | |
| 739 | 739 | pri[x] = 0; \ |
| 740 | 740 | } \ |
| 741 | 741 | |
| 742 | void segaic16_sprites_yboard_16b_draw(running_machine &machine, device_t *device, bitmap_t *bitmap, const rectangle | |
| 742 | void segaic16_sprites_yboard_16b_draw(running_machine &machine, device_t *device, bitmap_t *bitmap, const rectangle &cliprect) | |
| 743 | 743 | { |
| 744 | 744 | UINT8 numbanks = machine.region("gfx2")->bytes() / 0x20000; |
| 745 | 745 | const UINT16 *spritebase = (const UINT16 *)machine.region("gfx2")->base(); |
| r13798 | r13799 | |
| 809 | 809 | } |
| 810 | 810 | |
| 811 | 811 | /* skip drawing if not within the cliprect */ |
| 812 | if (y >= cliprect | |
| 812 | if (y >= cliprect. | |
| 813 | 813 | { |
| 814 | 814 | UINT16 *dest = &bitmap->pix16(y); |
| 815 | 815 | UINT8 *pri = &machine.priority_bitmap->pix8(y); |
| r13798 | r13799 | |
| 899 | 899 | |
| 900 | 900 | #define outrun_draw_pixel() \ |
| 901 | 901 | /* only draw if onscreen, not 0 or 15 */ \ |
| 902 | if (x >= cliprect | |
| 902 | if (x >= cliprect. | |
| 903 | 903 | { \ |
| 904 | 904 | /* are we high enough priority to be visible? */ \ |
| 905 | 905 | if (sprpri > pri[x]) \ |
| r13798 | r13799 | |
| 917 | 917 | pri[x] = 0xff; \ |
| 918 | 918 | } \ |
| 919 | 919 | |
| 920 | static void segaic16_sprites_xboard_outrun_draw(running_machine &machine, device_t *device, bitmap_t *bitmap, const rectangle | |
| 920 | static void segaic16_sprites_xboard_outrun_draw(running_machine &machine, device_t *device, bitmap_t *bitmap, const rectangle &cliprect, int type) | |
| 921 | 921 | { |
| 922 | 922 | UINT8 numbanks = machine.region("gfx2")->bytes() / 0x40000; |
| 923 | 923 | const UINT32 *spritebase = (const UINT32 *)machine.region("gfx2")->base(); |
| r13798 | r13799 | |
| 978 | 978 | for (y = top; y != ytarget; y += ydelta) |
| 979 | 979 | { |
| 980 | 980 | /* skip drawing if not within the cliprect */ |
| 981 | if (y >= cliprect | |
| 981 | if (y >= cliprect. | |
| 982 | 982 | { |
| 983 | 983 | UINT16 *dest = &bitmap->pix16(y); |
| 984 | 984 | UINT8 *pri = &machine.priority_bitmap->pix8(y); |
| r13798 | r13799 | |
| 989 | 989 | { |
| 990 | 990 | /* start at the word before because we preincrement below */ |
| 991 | 991 | data[7] = addr - 1; |
| 992 | for (x = xpos; (xdelta > 0 && x <= cliprect | |
| 992 | for (x = xpos; (xdelta > 0 && x <= cliprect. | |
| 993 | 993 | { |
| 994 | 994 | UINT32 pixels = spritedata[++data[7]]; |
| 995 | 995 | |
| r13798 | r13799 | |
| 1014 | 1014 | { |
| 1015 | 1015 | /* start at the word after because we predecrement below */ |
| 1016 | 1016 | data[7] = addr + 1; |
| 1017 | for (x = xpos; (xdelta > 0 && x <= cliprect | |
| 1017 | for (x = xpos; (xdelta > 0 && x <= cliprect. | |
| 1018 | 1018 | { |
| 1019 | 1019 | UINT32 pixels = spritedata[--data[7]]; |
| 1020 | 1020 | |
| r13798 | r13799 | |
| 1043 | 1043 | } |
| 1044 | 1044 | } |
| 1045 | 1045 | |
| 1046 | void segaic16_sprites_outrun_draw(running_machine &machine, device_t *device, bitmap_t *bitmap, const rectangle | |
| 1046 | void segaic16_sprites_outrun_draw(running_machine &machine, device_t *device, bitmap_t *bitmap, const rectangle &cliprect) | |
| 1047 | 1047 | { |
| 1048 | 1048 | segaic16_sprites_xboard_outrun_draw(machine, device, bitmap, cliprect, SEGAIC16_SPRITES_OUTRUN); |
| 1049 | 1049 | } |
| 1050 | 1050 | |
| 1051 | void segaic16_sprites_xboard_draw(running_machine &machine, device_t *device, bitmap_t *bitmap, const rectangle | |
| 1051 | void segaic16_sprites_xboard_draw(running_machine &machine, device_t *device, bitmap_t *bitmap, const rectangle &cliprect) | |
| 1052 | 1052 | { |
| 1053 | 1053 | segaic16_sprites_xboard_outrun_draw(machine, device, bitmap, cliprect, SEGAIC16_SPRITES_XBOARD); |
| 1054 | 1054 | } |
| r13798 | r13799 | |
| 1088 | 1088 | if (x >= minx && x <= maxx && ind < 0x1fe) \ |
| 1089 | 1089 | dest[x] = ind | colorpri; \ |
| 1090 | 1090 | |
| 1091 | void segaic16_sprites_yboard_draw(running_machine &machine, device_t *device, bitmap_t *bitmap, const rectangle | |
| 1091 | void segaic16_sprites_yboard_draw(running_machine &machine, device_t *device, bitmap_t *bitmap, const rectangle &cliprect) | |
| 1092 | 1092 | { |
| 1093 | 1093 | UINT8 numbanks = machine.region("gfx1")->bytes() / 0x80000; |
| 1094 | 1094 | const UINT64 *spritebase = (const UINT64 *)machine.region("gfx1")->base(); |
| r13798 | r13799 | |
| 1103 | 1103 | memset(visited, 0, sizeof(visited)); |
| 1104 | 1104 | |
| 1105 | 1105 | /* clear out any scanlines we might be using */ |
| 1106 | for (y = cliprect | |
| 1106 | for (y = cliprect. | |
| 1107 | 1107 | if (!(rotatebase[y & ~1] & 0xc000)) |
| 1108 | memset(&bitmap->pix16(y, cliprect | |
| 1108 | memset(&bitmap->pix16(y, cliprect. | |
| 1109 | 1109 | |
| 1110 | 1110 | /* now scan backwards and render the sprites in order */ |
| 1111 | 1111 | for (data = sega16sp->spriteram; !(data[0] & 0x8000) && !visited[next]; data = sega16sp->spriteram + next * 8) |
| r13798 | r13799 | |
| 1148 | 1148 | for (y = top; y != ytarget; y += ydelta) |
| 1149 | 1149 | { |
| 1150 | 1150 | /* skip drawing if not within the cliprect */ |
| 1151 | if (y >= cliprect | |
| 1151 | if (y >= cliprect. | |
| 1152 | 1152 | { |
| 1153 | 1153 | UINT16 *dest = &bitmap->pix16(y); |
| 1154 | 1154 | int minx = rotatebase[y & ~1]; |
| r13798 | r13799 | |
| 1169 | 1169 | /* clamp min/max to the cliprect */ |
| 1170 | 1170 | minx -= 0x600; |
| 1171 | 1171 | 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; | |
| 1176 | 1176 | |
| 1177 | 1177 | /* non-flipped case */ |
| 1178 | 1178 | if (!flip) |
| r13798 | r13799 | |
| 1266 | 1266 | /* ignores the sprite priority until we understand priority better on the bootlegs */ |
| 1267 | 1267 | #define system16a_bootleg_draw_pixel() \ |
| 1268 | 1268 | /* only draw if onscreen, not 0 or 15 */ \ |
| 1269 | if (x >= cliprect | |
| 1269 | if (x >= cliprect. | |
| 1270 | 1270 | { \ |
| 1271 | 1271 | /* are we high enough priority to be visible? */ \ |
| 1272 | 1272 | if (sprpri || 1) \ |
| r13798 | r13799 | |
| 1323 | 1323 | { \ |
| 1324 | 1324 | \ |
| 1325 | 1325 | /* skip drawing if not within the cliprect */ \ |
| 1326 | if (y >= cliprect | |
| 1326 | if (y >= cliprect. | |
| 1327 | 1327 | { \ |
| 1328 | 1328 | UINT16 *dest = &bitmap->pix16(y); \ |
| 1329 | 1329 | UINT8 *pri = &machine.priority_bitmap->pix8(y); \ |
| r13798 | r13799 | |
| 1382 | 1382 | |
| 1383 | 1383 | |
| 1384 | 1384 | |
| 1385 | void segaic16_sprites_16a_bootleg_wb3bl_draw(running_machine &machine, device_t *device, bitmap_t *bitmap, const rectangle | |
| 1385 | void segaic16_sprites_16a_bootleg_wb3bl_draw(running_machine &machine, device_t *device, bitmap_t *bitmap, const rectangle &cliprect) | |
| 1386 | 1386 | { |
| 1387 | 1387 | UINT8 numbanks = machine.region("gfx2")->bytes() / 0x10000; |
| 1388 | 1388 | const UINT16 *spritebase = (const UINT16 *)machine.region("gfx2")->base(); |
| r13798 | r13799 | |
| 1405 | 1405 | } |
| 1406 | 1406 | |
| 1407 | 1407 | /* 4 player passing shot is different to this.. */ |
| 1408 | void segaic16_sprites_16a_bootleg_passhtb_draw(running_machine &machine, device_t *device, bitmap_t *bitmap, const rectangle | |
| 1408 | void segaic16_sprites_16a_bootleg_passhtb_draw(running_machine &machine, device_t *device, bitmap_t *bitmap, const rectangle &cliprect) | |
| 1409 | 1409 | { |
| 1410 | 1410 | UINT8 numbanks = machine.region("gfx2")->bytes() / 0x10000; |
| 1411 | 1411 | const UINT16 *spritebase = (const UINT16 *)machine.region("gfx2")->base(); |
| r13798 | r13799 | |
| 1427 | 1427 | } |
| 1428 | 1428 | } |
| 1429 | 1429 | |
| 1430 | void segaic16_sprites_16a_bootleg_shinobld_draw(running_machine &machine, device_t *device, bitmap_t *bitmap, const rectangle | |
| 1430 | void segaic16_sprites_16a_bootleg_shinobld_draw(running_machine &machine, device_t *device, bitmap_t *bitmap, const rectangle &cliprect) | |
| 1431 | 1431 | { |
| 1432 | 1432 | UINT8 numbanks = machine.region("gfx2")->bytes() / 0x10000; |
| 1433 | 1433 | const UINT16 *spritebase = (const UINT16 *)machine.region("gfx2")->base(); |
| r13798 | r13799 | |
| 1455 | 1455 | * |
| 1456 | 1456 | *************************************/ |
| 1457 | 1457 | |
| 1458 | void segaic16_sprites_draw(screen_device &screen, bitmap_t *bitmap, const rectangle | |
| 1458 | void segaic16_sprites_draw(screen_device &screen, bitmap_t *bitmap, const rectangle &cliprect, int which) | |
| 1459 | 1459 | { |
| 1460 | 1460 | device_t* device = 0; |
| 1461 | 1461 | sega16sp_state *sega16sp; |
| r13798 | r13799 | |
|---|---|---|
| 303 | 303 | * |
| 304 | 304 | *************************************/ |
| 305 | 305 | |
| 306 | static void draw_sprites( screen_device &screen, bitmap_t *bitmap, const rectangle | |
| 306 | static void draw_sprites( screen_device &screen, bitmap_t *bitmap, const rectangle &cliprect, int draw_priority ) | |
| 307 | 307 | { |
| 308 | 308 | fromance_state *state = screen.machine().driver_data<fromance_state>(); |
| 309 | 309 | static const UINT8 zoomtable[16] = { 0,7,14,20,25,30,34,38,42,46,49,52,54,57,59,61 }; |
| r13798 | r13799 | |
|---|---|---|
| 354 | 354 | int x, y, offs; |
| 355 | 355 | |
| 356 | 356 | /* copy the polygon bitmap */ |
| 357 | for (y = cliprect | |
| 357 | for (y = cliprect. | |
| 358 | 358 | draw_scanline8(bitmap, 0, y, BITMAP_WIDTH, &bitmap_base[y * BITMAP_WIDTH], NULL); |
| 359 | 359 | |
| 360 | 360 | /* redraw the non-zero characters in the alpha layer */ |
| r13798 | r13799 | |
|---|---|---|
| 185 | 185 | ***************************************************************************/ |
| 186 | 186 | |
| 187 | 187 | /* the sprite generator IC is the same as Mappy */ |
| 188 | static void draw_sprites(running_machine &machine, bitmap_t *bitmap,const rectangle | |
| 188 | static void draw_sprites(running_machine &machine, bitmap_t *bitmap,const rectangle &cliprect) | |
| 189 | 189 | { |
| 190 | 190 | skykid_state *state = machine.driver_data<skykid_state>(); |
| 191 | 191 | UINT8 *spriteram = state->m_spriteram + 0x780; |
| r13798 | r13799 | |
|---|---|---|
| 1422 | 1422 | * |
| 1423 | 1423 | */ |
| 1424 | 1424 | |
| 1425 | void k007121_sprites_draw( device_t *device, bitmap_t *bitmap, const rectangle | |
| 1425 | void k007121_sprites_draw( device_t *device, bitmap_t *bitmap, const rectangle &cliprect, gfx_element *gfx, colortable_t *ctable, | |
| 1426 | 1426 | const UINT8 *source, int base_color, int global_x_offset, int bank_base, UINT32 pri_mask ) |
| 1427 | 1427 | { |
| 1428 | 1428 | k007121_state *k007121 = k007121_get_safe_token(device); |
| r13798 | r13799 | |
| 1749 | 1749 | #endif |
| 1750 | 1750 | } |
| 1751 | 1751 | |
| 1752 | void k007342_tilemap_draw( device_t *device, bitmap_t *bitmap, const rectangle | |
| 1752 | void k007342_tilemap_draw( device_t *device, bitmap_t *bitmap, const rectangle &cliprect, int num, int flags, UINT32 priority ) | |
| 1753 | 1753 | { |
| 1754 | 1754 | k007342_state *k007342 = k007342_get_safe_token(device); |
| 1755 | 1755 | tilemap_draw(bitmap, cliprect, k007342->tilemap[num], flags, priority); |
| r13798 | r13799 | |
| 1942 | 1942 | * 7 | xxxxxxxx | unused |
| 1943 | 1943 | */ |
| 1944 | 1944 | |
| 1945 | void k007420_sprites_draw( device_t *device, bitmap_t *bitmap, const rectangle | |
| 1945 | void k007420_sprites_draw( device_t *device, bitmap_t *bitmap, const rectangle &cliprect, gfx_element *gfx ) | |
| 1946 | 1946 | { |
| 1947 | 1947 | k007420_state *k007420 = k007420_get_safe_token(device); |
| 1948 | 1948 | int offs; |
| r13798 | r13799 | |
| 2561 | 2561 | #endif |
| 2562 | 2562 | } |
| 2563 | 2563 | |
| 2564 | void k052109_tilemap_draw( device_t *device, bitmap_t *bitmap, const rectangle | |
| 2564 | void k052109_tilemap_draw( device_t *device, bitmap_t *bitmap, const rectangle &cliprect, int tmap_num, UINT32 flags, UINT8 priority ) | |
| 2565 | 2565 | { |
| 2566 | 2566 | k052109_state *k052109 = k052109_get_safe_token(device); |
| 2567 | 2567 | tilemap_draw(bitmap, cliprect, k052109->tilemap[tmap_num], flags, priority); |
| r13798 | r13799 | |
| 3003 | 3003 | * Note that Aliens also uses the shadow bit to select the second sprite bank. |
| 3004 | 3004 | */ |
| 3005 | 3005 | |
| 3006 | void k051960_sprites_draw( device_t *device, bitmap_t *bitmap, const rectangle | |
| 3006 | void k051960_sprites_draw( device_t *device, bitmap_t *bitmap, const rectangle &cliprect, int min_priority, int max_priority ) | |
| 3007 | 3007 | { |
| 3008 | 3008 | #define NUM_SPRITES 128 |
| 3009 | 3009 | k051960_state *k051960 = k051960_get_safe_token(device); |
| r13798 | r13799 | |
| 3529 | 3529 | * The rest of the sprite remains normal. |
| 3530 | 3530 | */ |
| 3531 | 3531 | |
| 3532 | void k053245_sprites_draw( device_t *device, bitmap_t *bitmap, const rectangle | |
| 3532 | void k053245_sprites_draw( device_t *device, bitmap_t *bitmap, const rectangle &cliprect ) | |
| 3533 | 3533 | { |
| 3534 | 3534 | #define NUM_SPRITES 128 |
| 3535 | 3535 | k05324x_state *k053245 = k05324x_get_safe_token(device); |
| r13798 | r13799 | |
| 3783 | 3783 | |
| 3784 | 3784 | /* Lethal Enforcers has 2 of these chips hooked up in parallel to give 6bpp gfx.. lets cheat a |
| 3785 | 3785 | bit and make emulating it a little less messy by using a custom function instead */ |
| 3786 | void k053245_sprites_draw_lethal( device_t *device, bitmap_t *bitmap, const rectangle | |
| 3786 | void k053245_sprites_draw_lethal( device_t *device, bitmap_t *bitmap, const rectangle &cliprect ) | |
| 3787 | 3787 | { |
| 3788 | 3788 | #define NUM_SPRITES 128 |
| 3789 | 3789 | k05324x_state *k053245 = k05324x_get_safe_token(device); |
| r13798 | r13799 | |
| 4450 | 4450 | * The rest of the sprite remains normal. |
| 4451 | 4451 | */ |
| 4452 | 4452 | |
| 4453 | void k053247_sprites_draw( device_t *device, bitmap_t *bitmap, const rectangle | |
| 4453 | void k053247_sprites_draw( device_t *device, bitmap_t *bitmap, const rectangle &cliprect ) | |
| 4454 | 4454 | { |
| 4455 | 4455 | #define NUM_SPRITES 256 |
| 4456 | 4456 | k053247_state *k053246 = k053247_get_safe_token(device); |
| r13798 | r13799 | |
| 5221 | 5221 | static TILE_GET_INFO_DEVICE( k051316_get_tile_info0 ) { k051316_get_tile_info(device, tileinfo, tile_index); } |
| 5222 | 5222 | |
| 5223 | 5223 | |
| 5224 | void k051316_zoom_draw( device_t *device, bitmap_t *bitmap, const rectangle | |
| 5224 | void k051316_zoom_draw( device_t *device, bitmap_t *bitmap, const rectangle &cliprect, int flags, UINT32 priority ) | |
| 5225 | 5225 | { |
| 5226 | 5226 | k051316_state *k051316= k051316_get_safe_token(device); |
| 5227 | 5227 | UINT32 startx, starty; |
| r13798 | r13799 | |
| 5459 | 5459 | |
| 5460 | 5460 | // there is another implementation of this in video/konamigx.c (!) |
| 5461 | 5461 | // why? shall they be merged? |
| 5462 | void k053936_zoom_draw( device_t *device, bitmap_t *bitmap, const rectangle | |
| 5462 | void k053936_zoom_draw( device_t *device, bitmap_t *bitmap, const rectangle &cliprect, tilemap_t *tmap, int flags, UINT32 priority, int glfgreat_hack ) | |
| 5463 | 5463 | { |
| 5464 | 5464 | k053936_state *k053936= k053936_get_safe_token(device); |
| 5465 | 5465 | if (!tmap) |
| r13798 | r13799 | |
| 5484 | 5484 | { |
| 5485 | 5485 | my_clip.min_x = k053936->ctrl[0x08] + k053936->offset[0] + 2; |
| 5486 | 5486 | 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; | |
| 5491 | 5491 | |
| 5492 | 5492 | 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; | |
| 5495 | 5495 | 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; | |
| 5498 | 5498 | } |
| 5499 | 5499 | else |
| 5500 | 5500 | { |
| 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; | |
| 5503 | 5503 | |
| 5504 | y = cliprect->min_y; | |
| 5505 | maxy = cliprect->max_y; | |
| 5504 | y = cliprect.min_y; | |
| 5505 | maxy = cliprect.max_y; | |
| 5506 | 5506 | } |
| 5507 | 5507 | |
| 5508 | 5508 | while (y <= maxy) |
| r13798 | r13799 | |
| 5525 | 5525 | startx -= k053936->offset[0] * incxx; |
| 5526 | 5526 | starty -= k053936->offset[0] * incxy; |
| 5527 | 5527 | |
| 5528 | tilemap_draw_roz(bitmap, | |
| 5528 | tilemap_draw_roz(bitmap, | |
| 5529 | 5529 | incxx << 5,incxy << 5,0,0, |
| 5530 | 5530 | k053936->wraparound, |
| 5531 | 5531 | flags,priority); |
| r13798 | r13799 | |
| 6998 | 6998 | // force tilemap into a clean, static state |
| 6999 | 6999 | // *really ugly but it minimizes alteration to tilemap.c |
| 7000 | 7000 | memset(&zerorect, 0, sizeof(rectangle)); // zero dimension |
| 7001 | tilemap_draw(bitmap, | |
| 7001 | tilemap_draw(bitmap, | |
| 7002 | 7002 | xprmap->fill(0); // reset pixel transparency_bitmap; |
| 7003 | 7003 | memset(xprdata, TILEMAP_PIXEL_LAYER0, 0x800); // reset tile transparency_data; |
| 7004 | 7004 | } |
| r13798 | r13799 | |
| 7090 | 7090 | return(0); |
| 7091 | 7091 | } |
| 7092 | 7092 | |
| 7093 | void k056832_tilemap_draw( device_t *device, bitmap_t *bitmap, const rectangle | |
| 7093 | void k056832_tilemap_draw( device_t *device, bitmap_t *bitmap, const rectangle &cliprect, int layer, UINT32 flags, UINT32 priority ) | |
| 7094 | 7094 | { |
| 7095 | 7095 | k056832_state *k056832 = k056832_get_safe_token(device); |
| 7096 | 7096 | UINT32 last_dx, last_visible, new_colorbase, last_active; |
| r13798 | r13799 | |
| 7123 | 7123 | height = rowspan * K056832_PAGE_HEIGHT; |
| 7124 | 7124 | width = colspan * K056832_PAGE_WIDTH; |
| 7125 | 7125 | |
| 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; | |
| 7130 | 7130 | |
| 7131 | 7131 | // flip correction registers |
| 7132 | 7132 | flipy = k056832->regs[0] & 0x20; |
| r13798 | r13799 | |
| 7398 | 7398 | // want the tilemap to be drawn on the right hand side.. this is probably not the correct |
| 7399 | 7399 | // logic, but it works. |
| 7400 | 7400 | if ((drawrect.min_x>0) && (drawrect.max_x==511)) |
| 7401 | drawrect.max_x=cliprect | |
| 7401 | drawrect.max_x=cliprect. | |
| 7402 | 7402 | |
| 7403 | 7403 | tilemap_set_scrollx(tmap, 0, dx); |
| 7404 | 7404 | |
| 7405 | 7405 | LINE_SHORTCIRCUIT: |
| 7406 | tilemap_draw(bitmap, | |
| 7406 | tilemap_draw(bitmap, | |
| 7407 | 7407 | |
| 7408 | 7408 | } // end of line loop |
| 7409 | 7409 | } // end of column loop |
| r13798 | r13799 | |
| 7413 | 7413 | } // end of function |
| 7414 | 7414 | |
| 7415 | 7415 | |
| 7416 | void k056832_tilemap_draw_dj( device_t *device, bitmap_t *bitmap, const rectangle | |
| 7416 | void k056832_tilemap_draw_dj( device_t *device, bitmap_t *bitmap, const rectangle &cliprect, int layer, UINT32 flags, UINT32 priority ) | |
| 7417 | 7417 | { |
| 7418 | 7418 | k056832_state *k056832 = k056832_get_safe_token(device); |
| 7419 | 7419 | UINT32 last_dx, last_visible, new_colorbase, last_active; |
| r13798 | r13799 | |
| 7442 | 7442 | height = rowspan * K056832_PAGE_HEIGHT; |
| 7443 | 7443 | width = colspan * K056832_PAGE_WIDTH; |
| 7444 | 7444 | |
| 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; | |
| 7449 | 7449 | |
| 7450 | 7450 | // flip correction registers |
| 7451 | 7451 | flipy = k056832->regs[0] & 0x20; |
| r13798 | r13799 | |
| 7671 | 7671 | tilemap_set_scrollx(tmap, 0, dx); |
| 7672 | 7672 | |
| 7673 | 7673 | LINE_SHORTCIRCUIT: |
| 7674 | tilemap_draw(bitmap, | |
| 7674 | tilemap_draw(bitmap, | |
| 7675 | 7675 | |
| 7676 | 7676 | } // end of line loop |
| 7677 | 7677 | } // end of column loop |
| r13798 | r13799 | |
| 9416 | 9416 | } |
| 9417 | 9417 | } |
| 9418 | 9418 | |
| 9419 | void k001005_draw( device_t *device, bitmap_t *bitmap, const rectangle | |
| 9419 | void k001005_draw( device_t *device, bitmap_t *bitmap, const rectangle &cliprect ) | |
| 9420 | 9420 | { |
| 9421 | 9421 | k001005_state *k001005 = k001005_get_safe_token(device); |
| 9422 | 9422 | int i, j; |
| 9423 | 9423 | |
| 9424 | memcpy(&k001005->cliprect, cliprect, sizeof(rectangle)); | |
| 9424 | memcpy(&k001005->cliprect, &cliprect, sizeof(rectangle)); | |
| 9425 | 9425 | |
| 9426 | for (j = cliprect | |
| 9426 | for (j = cliprect. | |
| 9427 | 9427 | { |
| 9428 | 9428 | UINT32 *bmp = &bitmap->pix32(j); |
| 9429 | 9429 | UINT32 *src = &k001005->bitmap[k001005->bitmap_page ^ 1]->pix32(j); |
| 9430 | 9430 | |
| 9431 | for (i = cliprect | |
| 9431 | for (i = cliprect. | |
| 9432 | 9432 | { |
| 9433 | 9433 | if (src[i] & 0xff000000) |
| 9434 | 9434 | { |
| r13798 | r13799 | |
| 9695 | 9695 | } |
| 9696 | 9696 | |
| 9697 | 9697 | |
| 9698 | void k001604_draw_back_layer( device_t *device, bitmap_t *bitmap, const rectangle | |
| 9698 | void k001604_draw_back_layer( device_t *device, bitmap_t *bitmap, const rectangle &cliprect ) | |
| 9699 | 9699 | { |
| 9700 | 9700 | k001604_state *k001604 = k001604_get_safe_token(device); |
| 9701 | 9701 | int layer; |
| 9702 | 9702 | int num_layers; |
| 9703 | bitmap->fill(0, | |
| 9703 | bitmap->fill(0, | |
| 9704 | 9704 | |
| 9705 | 9705 | num_layers = k001604->layer_size ? 2 : 1; |
| 9706 | 9706 | |
| r13798 | r13799 | |
| 9730 | 9730 | } |
| 9731 | 9731 | } |
| 9732 | 9732 | |
| 9733 | void k001604_draw_front_layer( device_t *device, bitmap_t *bitmap, const rectangle | |
| 9733 | void k001604_draw_front_layer( device_t *device, bitmap_t *bitmap, const rectangle &cliprect ) | |
| 9734 | 9734 | { |
| 9735 | 9735 | k001604_state *k001604 = k001604_get_safe_token(device); |
| 9736 | 9736 | |
| r13798 | r13799 | |
| 10031 | 10031 | } |
| 10032 | 10032 | |
| 10033 | 10033 | |
| 10034 | void k037122_tile_draw( device_t *device, bitmap_t *bitmap, const rectangle | |
| 10034 | void k037122_tile_draw( device_t *device, bitmap_t *bitmap, const rectangle &cliprect ) | |
| 10035 | 10035 | { |
| 10036 | 10036 | k037122_state *k037122 = k037122_get_safe_token(device); |
| 10037 | 10037 | const rectangle &visarea = k037122->screen->visible_area(); |
| r13798 | r13799 | |
|---|---|---|
| 12 | 12 | |
| 13 | 13 | |
| 14 | 14 | |
| 15 | static void draw_sprites(running_machine& machine, bitmap_t *bitmap, const rectangle | |
| 15 | static void draw_sprites(running_machine& machine, bitmap_t *bitmap, const rectangle &cliprect) | |
| 16 | 16 | { |
| 17 | 17 | djmain_state *state = machine.driver_data<djmain_state>(); |
| 18 | 18 | device_t *k055555 = machine.device("k055555"); |
| r13798 | r13799 | |
| 169 | 169 | order[j] = temp; |
| 170 | 170 | } |
| 171 | 171 | |
| 172 | bitmap->fill(screen.machine().pens[0], | |
| 172 | bitmap->fill(screen.machine().pens[0], | |
| 173 | 173 | |
| 174 | 174 | for (i = 0; i < NUM_LAYERS + 1; i++) |
| 175 | 175 | { |
| r13798 | r13799 | |
|---|---|---|
| 255 | 255 | } |
| 256 | 256 | |
| 257 | 257 | |
| 258 | static void firetrk_draw_car(running_machine &machine, bitmap_t *bitmap, const rectangle | |
| 258 | static void firetrk_draw_car(running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect, gfx_element **gfx, int which, int flash) | |
| 259 | 259 | { |
| 260 | 260 | firetrk_state *state = machine.driver_data<firetrk_state>(); |
| 261 | 261 | int gfx_bank, code, color, flip_x, flip_y, x, y; |
| r13798 | r13799 | |
| 285 | 285 | } |
| 286 | 286 | |
| 287 | 287 | |
| 288 | static void superbug_draw_car(running_machine &machine, bitmap_t *bitmap, const rectangle | |
| 288 | static void superbug_draw_car(running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect, gfx_element **gfx, int flash) | |
| 289 | 289 | { |
| 290 | 290 | firetrk_state *state = machine.driver_data<firetrk_state>(); |
| 291 | 291 | int gfx_bank = (*state->m_car_rot & 0x10) ? 4 : 3; |
| r13798 | r13799 | |
| 298 | 298 | } |
| 299 | 299 | |
| 300 | 300 | |
| 301 | static void montecar_draw_car(running_machine &machine, bitmap_t *bitmap, const rectangle | |
| 301 | static void montecar_draw_car(running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect, gfx_element **gfx, int which, int is_collision_detection) | |
| 302 | 302 | { |
| 303 | 303 | firetrk_state *state = machine.driver_data<firetrk_state>(); |
| 304 | 304 | int gfx_bank, code, color, flip_x, flip_y, x, y; |
| r13798 | r13799 | |
| 328 | 328 | } |
| 329 | 329 | |
| 330 | 330 | |
| 331 | static void draw_text(bitmap_t *bitmap, const rectangle | |
| 331 | static void draw_text(bitmap_t *bitmap, const rectangle &cliprect, gfx_element **gfx, UINT8 *alpha_ram, | |
| 332 | 332 | int x, int count, int height) |
| 333 | 333 | { |
| 334 | 334 | int i; |
| r13798 | r13799 | |
| 366 | 366 | tilemap_set_scrolly(state->m_tilemap1, 0, *state->m_scroll_y); |
| 367 | 367 | tilemap_set_scrolly(state->m_tilemap2, 0, *state->m_scroll_y); |
| 368 | 368 | |
| 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); | |
| 373 | 373 | draw_text(bitmap, cliprect, screen.machine().gfx, state->m_alpha_num_ram + 0x00, 296, 0x10, 0x10); |
| 374 | 374 | draw_text(bitmap, cliprect, screen.machine().gfx, state->m_alpha_num_ram + 0x10, 8, 0x10, 0x10); |
| 375 | 375 | |
| 376 | if (cliprect | |
| 376 | if (cliprect. | |
| 377 | 377 | { |
| 378 | tilemap_draw(state->m_helper1, | |
| 378 | tilemap_draw(state->m_helper1, | |
| 379 | 379 | |
| 380 | 380 | state->m_helper2->fill(0xff, playfield_window); |
| 381 | firetrk_draw_car(screen.machine(), state->m_helper2, | |
| 381 | firetrk_draw_car(screen.machine(), state->m_helper2, | |
| 382 | 382 | check_collision(state, 0); |
| 383 | 383 | |
| 384 | 384 | state->m_helper2->fill(0xff, playfield_window); |
| 385 | firetrk_draw_car(screen.machine(), state->m_helper2, | |
| 385 | firetrk_draw_car(screen.machine(), state->m_helper2, | |
| 386 | 386 | check_collision(state, 1); |
| 387 | 387 | |
| 388 | 388 | *state->m_blink = FALSE; |
| r13798 | r13799 | |
| 401 | 401 | tilemap_set_scrolly(state->m_tilemap1, 0, *state->m_scroll_y); |
| 402 | 402 | tilemap_set_scrolly(state->m_tilemap2, 0, *state->m_scroll_y); |
| 403 | 403 | |
| 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); | |
| 407 | 407 | draw_text(bitmap, cliprect, screen.machine().gfx, state->m_alpha_num_ram + 0x00, 296, 0x10, 0x10); |
| 408 | 408 | draw_text(bitmap, cliprect, screen.machine().gfx, state->m_alpha_num_ram + 0x10, 8, 0x10, 0x10); |
| 409 | 409 | |
| 410 | if (cliprect | |
| 410 | if (cliprect. | |
| 411 | 411 | { |
| 412 | tilemap_draw(state->m_helper1, | |
| 412 | tilemap_draw(state->m_helper1, | |
| 413 | 413 | |
| 414 | 414 | state->m_helper2->fill(0xff, playfield_window); |
| 415 | superbug_draw_car(screen.machine(), state->m_helper2, | |
| 415 | superbug_draw_car(screen.machine(), state->m_helper2, | |
| 416 | 416 | check_collision(state, 0); |
| 417 | 417 | |
| 418 | 418 | *state->m_blink = FALSE; |
| r13798 | r13799 | |
| 431 | 431 | tilemap_set_scrolly(state->m_tilemap1, 0, *state->m_scroll_y); |
| 432 | 432 | tilemap_set_scrolly(state->m_tilemap2, 0, *state->m_scroll_y); |
| 433 | 433 | |
| 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); | |
| 438 | 438 | draw_text(bitmap, cliprect, screen.machine().gfx, state->m_alpha_num_ram + 0x00, 24, 0x20, 0x08); |
| 439 | 439 | draw_text(bitmap, cliprect, screen.machine().gfx, state->m_alpha_num_ram + 0x20, 16, 0x20, 0x08); |
| 440 | 440 | |
| 441 | if (cliprect | |
| 441 | if (cliprect. | |
| 442 | 442 | { |
| 443 | tilemap_draw(state->m_helper1, | |
| 443 | tilemap_draw(state->m_helper1, | |
| 444 | 444 | |
| 445 | 445 | state->m_helper2->fill(0xff, playfield_window); |
| 446 | montecar_draw_car(screen.machine(), state->m_helper2, | |
| 446 | montecar_draw_car(screen.machine(), state->m_helper2, | |
| 447 | 447 | check_collision(state, 0); |
| 448 | 448 | |
| 449 | 449 | state->m_helper2->fill(0xff, playfield_window); |
| 450 | montecar_draw_car(screen.machine(), state->m_helper2, | |
| 450 | montecar_draw_car(screen.machine(), state->m_helper2, | |
| 451 | 451 | check_collision(state, 1); |
| 452 | 452 | } |
| 453 | 453 |
| r13798 | r13799 | |
|---|---|---|
| 309 | 309 | |
| 310 | 310 | /* shall we move source in the interface? */ |
| 311 | 311 | /* also notice that now we directly pass *gfx[chip] instead of **gfx !! */ |
| 312 | void k007121_sprites_draw( device_t *device, bitmap_t *bitmap, const rectangle | |
| 312 | void k007121_sprites_draw( device_t *device, bitmap_t *bitmap, const rectangle &cliprect, gfx_element *gfx, colortable_t *ctable, | |
| 313 | 313 | const UINT8 *source, int base_color, int global_x_offset, int bank_base, UINT32 pri_mask ); |
| 314 | 314 | |
| 315 | 315 | |
| r13798 | r13799 | |
| 321 | 321 | WRITE8_DEVICE_HANDLER( k007342_vreg_w ); |
| 322 | 322 | |
| 323 | 323 | void k007342_tilemap_update(device_t *device); |
| 324 | void k007342_tilemap_draw(device_t *device, bitmap_t *bitmap, const rectangle | |
| 324 | void k007342_tilemap_draw(device_t *device, bitmap_t *bitmap, const rectangle &cliprect, int num, int flags, UINT32 priority); | |
| 325 | 325 | int k007342_is_int_enabled(device_t *device); |
| 326 | 326 | |
| 327 | 327 | |
| r13798 | r13799 | |
| 330 | 330 | |
| 331 | 331 | READ8_DEVICE_HANDLER( k007420_r ); |
| 332 | 332 | WRITE8_DEVICE_HANDLER( k007420_w ); |
| 333 | void k007420_sprites_draw(device_t *device, bitmap_t *bitmap, const rectangle | |
| 333 | void k007420_sprites_draw(device_t *device, bitmap_t *bitmap, const rectangle &cliprect, gfx_element *gfx); | |
| 334 | 334 | |
| 335 | 335 | |
| 336 | 336 | /** Konami 052109 **/ |
| r13798 | r13799 | |
| 376 | 376 | int k052109_is_irq_enabled(device_t *device); |
| 377 | 377 | void k052109_set_layer_offsets(device_t *device, int layer, int dx, int dy); |
| 378 | 378 | void k052109_tilemap_mark_dirty(device_t *device, int tmap_num); |
| 379 | void k052109_tilemap_draw(device_t *device, bitmap_t *bitmap, const rectangle | |
| 379 | void k052109_tilemap_draw(device_t *device, bitmap_t *bitmap, const rectangle &cliprect, int tmap_num, UINT32 flags, UINT8 priority); | |
| 380 | 380 | |
| 381 | 381 | |
| 382 | 382 | /** Konami 051960 / 051937 **/ |
| r13798 | r13799 | |
| 404 | 404 | READ16_DEVICE_HANDLER( k051937_word_r ); |
| 405 | 405 | WRITE16_DEVICE_HANDLER( k051937_word_w ); |
| 406 | 406 | |
| 407 | void k051960_sprites_draw(device_t *device, bitmap_t *bitmap, const rectangle | |
| 407 | void k051960_sprites_draw(device_t *device, bitmap_t *bitmap, const rectangle &cliprect, int min_priority, int max_priority); | |
| 408 | 408 | int k051960_is_irq_enabled(device_t *device); |
| 409 | 409 | int k051960_is_nmi_enabled(device_t *device); |
| 410 | 410 | void k051960_set_sprite_offsets(device_t *device, int dx, int dy); |
| r13798 | r13799 | |
| 428 | 428 | READ16_DEVICE_HANDLER( k053244_word_r ); |
| 429 | 429 | WRITE16_DEVICE_HANDLER( k053244_word_w ); |
| 430 | 430 | void k053244_bankselect(device_t *device, int bank); /* used by TMNT2, Asterix and Premier Soccer for ROM testing */ |
| 431 | void k053245_sprites_draw(device_t *device, bitmap_t *bitmap, const rectangle *cliprect); | |
| 432 | void k053245_sprites_draw_lethal(device_t *device, bitmap_t *bitmap, const rectangle *cliprect); /* for lethal enforcers */ | |
| 431 | void k053245_sprites_draw(device_t *device, bitmap_t *bitmap, const rectangle &cliprect); | |
| 432 | void k053245_sprites_draw_lethal(device_t *device, bitmap_t *bitmap, const rectangle &cliprect); /* for lethal enforcers */ | |
| 433 | 433 | void k053245_clear_buffer(device_t *device); |
| 434 | 434 | void k053245_set_sprite_offs(device_t *device, int offsx, int offsy); |
| 435 | 435 | |
| r13798 | r13799 | |
| 463 | 463 | WRITE16_DEVICE_HANDLER( k053247_reg_word_w ); // "OBJSET2" registers |
| 464 | 464 | WRITE32_DEVICE_HANDLER( k053247_reg_long_w ); |
| 465 | 465 | |
| 466 | void k053247_sprites_draw(device_t *device, bitmap_t *bitmap,const rectangle | |
| 466 | void k053247_sprites_draw(device_t *device, bitmap_t *bitmap,const rectangle &cliprect); | |
| 467 | 467 | int k053247_read_register(device_t *device, int regnum); |
| 468 | 468 | void k053247_set_sprite_offs(device_t *device, int offsx, int offsy); |
| 469 | 469 | void k053247_wraparound_enable(device_t *device, int status); |
| r13798 | r13799 | |
| 501 | 501 | WRITE8_DEVICE_HANDLER( k051316_w ); |
| 502 | 502 | READ8_DEVICE_HANDLER( k051316_rom_r ); |
| 503 | 503 | WRITE8_DEVICE_HANDLER( k051316_ctrl_w ); |
| 504 | void k051316_zoom_draw(device_t *device, bitmap_t *bitmap,const rectangle | |
| 504 | void k051316_zoom_draw(device_t *device, bitmap_t *bitmap,const rectangle &cliprect,int flags,UINT32 priority); | |
| 505 | 505 | void k051316_wraparound_enable(device_t *device, int status); |
| 506 | 506 | |
| 507 | 507 | |
| r13798 | r13799 | |
| 510 | 510 | READ16_DEVICE_HANDLER( k053936_ctrl_r ); // FIXME: this is probably unused... to be checked! |
| 511 | 511 | WRITE16_DEVICE_HANDLER( k053936_linectrl_w ); |
| 512 | 512 | READ16_DEVICE_HANDLER( k053936_linectrl_r ); |
| 513 | void k053936_zoom_draw(device_t *device, bitmap_t *bitmap, const rectangle | |
| 513 | void k053936_zoom_draw(device_t *device, bitmap_t *bitmap, const rectangle &cliprect, tilemap_t *tmap, int flags, UINT32 priority, int glfgreat_hack); | |
| 514 | 514 | void k053936_wraparound_enable(device_t *device, int status); // shall we merge this into the configuration intf? |
| 515 | 515 | void k053936_set_offset(device_t *device, int xoffs, int yoffs); // shall we merge this into the configuration intf? |
| 516 | 516 | |
| r13798 | r13799 | |
| 579 | 579 | WRITE8_DEVICE_HANDLER( k056832_b_w ); |
| 580 | 580 | void k056832_mark_plane_dirty(device_t *device, int num); |
| 581 | 581 | void k056832_mark_all_tmaps_dirty(device_t *device); |
| 582 | void k056832_tilemap_draw(device_t *device, bitmap_t *bitmap, const rectangle *cliprect, int num, UINT32 flags, UINT32 priority); | |
| 583 | void k056832_tilemap_draw_dj(device_t *device, bitmap_t *bitmap, const rectangle *cliprect, int layer, UINT32 flags, UINT32 priority); | |
| 582 | void k056832_tilemap_draw(device_t *device, bitmap_t *bitmap, const rectangle &cliprect, int num, UINT32 flags, UINT32 priority); | |
| 583 | void k056832_tilemap_draw_dj(device_t *device, bitmap_t *bitmap, const rectangle &cliprect, int layer, UINT32 flags, UINT32 priority); | |
| 584 | 584 | void k056832_set_layer_association(device_t *device, int status); |
| 585 | 585 | int k056832_get_layer_association(device_t *device); |
| 586 | 586 | void k056832_set_layer_offs(device_t *device, int layer, int offsx, int offsy); |
| r13798 | r13799 | |
| 720 | 720 | |
| 721 | 721 | |
| 722 | 722 | /** Konami 001005 **/ |
| 723 | void k001005_draw(device_t *device, bitmap_t *bitmap, const rectangle | |
| 723 | void k001005_draw(device_t *device, bitmap_t *bitmap, const rectangle &cliprect); | |
| 724 | 724 | void k001005_swap_buffers(device_t *device); |
| 725 | 725 | void k001005_preprocess_texture_data(UINT8 *rom, int length, int gticlub); |
| 726 | 726 | |
| r13798 | r13799 | |
| 729 | 729 | |
| 730 | 730 | |
| 731 | 731 | /** Konami 001604 **/ |
| 732 | void k001604_draw_back_layer( device_t *device, bitmap_t *bitmap, const rectangle *cliprect ); | |
| 733 | void k001604_draw_front_layer( device_t *device, bitmap_t *bitmap, const rectangle *cliprect ); | |
| 732 | void k001604_draw_back_layer( device_t *device, bitmap_t *bitmap, const rectangle &cliprect ); | |
| 733 | void k001604_draw_front_layer( device_t *device, bitmap_t *bitmap, const rectangle &cliprect ); | |
| 734 | 734 | WRITE32_DEVICE_HANDLER( k001604_tile_w ); |
| 735 | 735 | READ32_DEVICE_HANDLER( k001604_tile_r ); |
| 736 | 736 | WRITE32_DEVICE_HANDLER( k001604_char_w ); |
| r13798 | r13799 | |
| 740 | 740 | |
| 741 | 741 | |
| 742 | 742 | /** Konami 037122 **/ |
| 743 | void k037122_tile_draw( device_t *device, bitmap_t *bitmap, const rectangle | |
| 743 | void k037122_tile_draw( device_t *device, bitmap_t *bitmap, const rectangle &cliprect ); | |
| 744 | 744 | READ32_DEVICE_HANDLER( k037122_sram_r ); |
| 745 | 745 | WRITE32_DEVICE_HANDLER( k037122_sram_w ); |
| 746 | 746 | READ32_DEVICE_HANDLER( k037122_char_r ); |
| r13798 | r13799 | |
|---|---|---|
| 177 | 177 | * |
| 178 | 178 | *************************************/ |
| 179 | 179 | |
| 180 | static void draw_background(running_machine &machine, bitmap_t *bitmap, const rectangle | |
| 180 | static void draw_background(running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect) | |
| 181 | 181 | { |
| 182 | 182 | m57_state *state = machine.driver_data<m57_state>(); |
| 183 | 183 | int y,x; |
| r13798 | r13799 | |
| 190 | 190 | tilemap_draw(bitmap, cliprect, state->m_bg_tilemap, 0, 0); |
| 191 | 191 | |
| 192 | 192 | // from 128 to 255: wrapped |
| 193 | for (y = 128; y <= cliprect | |
| 193 | for (y = 128; y <= cliprect. | |
| 194 | 194 | { |
| 195 | 195 | scrolly = state->m_scrollram[y] + (state->m_scrollram[y + 0x100] << 8); |
| 196 | 196 | |
| 197 | 197 | if (scrolly >= 0) |
| 198 | 198 | { |
| 199 | for (x = cliprect | |
| 199 | for (x = cliprect. | |
| 200 | 200 | { |
| 201 | if ((x + scrolly) <= cliprect | |
| 201 | if ((x + scrolly) <= cliprect. | |
| 202 | 202 | bitmap->pix16(y, x) = bitmap->pix16(y, x + scrolly); |
| 203 | 203 | else |
| 204 | bitmap->pix16(y, x) = bitmap->pix16(y, cliprect | |
| 204 | bitmap->pix16(y, x) = bitmap->pix16(y, cliprect. | |
| 205 | 205 | } |
| 206 | 206 | } else { |
| 207 | for (x = cliprect | |
| 207 | for (x = cliprect. | |
| 208 | 208 | { |
| 209 | if ((x + scrolly) >= cliprect | |
| 209 | if ((x + scrolly) >= cliprect. | |
| 210 | 210 | bitmap->pix16(y, x) = bitmap->pix16(y, x + scrolly); |
| 211 | 211 | else |
| 212 | bitmap->pix16(y, x) = bitmap->pix16(y, cliprect | |
| 212 | bitmap->pix16(y, x) = bitmap->pix16(y, cliprect. | |
| 213 | 213 | } |
| 214 | 214 | } |
| 215 | 215 | } |
| r13798 | r13799 | |
| 221 | 221 | * |
| 222 | 222 | *************************************/ |
| 223 | 223 | |
| 224 | static void draw_sprites(running_machine &machine, bitmap_t *bitmap, const rectangle | |
| 224 | static void draw_sprites(running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect) | |
| 225 | 225 | { |
| 226 | 226 | m57_state *state = machine.driver_data<m57_state>(); |
| 227 | 227 | int offs; |
| r13798 | r13799 | |
|---|---|---|
| 33 | 33 | } |
| 34 | 34 | |
| 35 | 35 | screen.machine().priority_bitmap->fill(0); |
| 36 | bitmap->fill(0, | |
| 36 | bitmap->fill(0, | |
| 37 | 37 | |
| 38 | 38 | std::vector<int> order; |
| 39 | 39 | order.resize(12); |
| r13798 | r13799 | |
|---|---|---|
| 100 | 100 | tilemap_set_scroll_rows(state->m_bg_tilemap, 4); |
| 101 | 101 | } |
| 102 | 102 | |
| 103 | static void draw_sprites(running_machine &machine, bitmap_t *bitmap, const rectangle | |
| 103 | static void draw_sprites(running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect ) | |
| 104 | 104 | { |
| 105 | 105 | mustache_state *state = machine.driver_data<mustache_state>(); |
| 106 | rectangle clip = | |
| 106 | rectangle clip = | |
| 107 | 107 | const gfx_element *gfx = machine.gfx[1]; |
| 108 | 108 | const rectangle &visarea = machine.primary_screen->visible_area(); |
| 109 | 109 | UINT8 *spriteram = state->m_spriteram; |
| r13798 | r13799 | |
| 135 | 135 | sy = 240 - sy; |
| 136 | 136 | } |
| 137 | 137 | |
| 138 | drawgfx_transpen(bitmap, | |
| 138 | drawgfx_transpen(bitmap, | |
| 139 | 139 | code, |
| 140 | 140 | color, |
| 141 | 141 | flip_screen_get(machine),flip_screen_get(machine), |
| r13798 | r13799 | |
|---|---|---|
| 38 | 38 | /* if no drawing is happening, fill with black and get out */ |
| 39 | 39 | if (!segaic16_display_enable) |
| 40 | 40 | { |
| 41 | bitmap->fill(get_black_pen(screen.machine()), | |
| 41 | bitmap->fill(get_black_pen(screen.machine()), | |
| 42 | 42 | return 0; |
| 43 | 43 | } |
| 44 | 44 | |
| 45 | 45 | /* reset priorities */ |
| 46 | screen.machine().priority_bitmap->fill(0, | |
| 46 | screen.machine().priority_bitmap->fill(0, | |
| 47 | 47 | |
| 48 | 48 | /* draw background opaquely first, not setting any priorities */ |
| 49 | 49 | segaic16_tilemap_draw(screen, bitmap, cliprect, 0, SEGAIC16_TILEMAP_BACKGROUND, 0 | TILEMAP_DRAW_OPAQUE, 0x00); |
| r13798 | r13799 | |
|---|---|---|
| 925 | 925 | neogeo_state *state = screen.machine().driver_data<neogeo_state>(); |
| 926 | 926 | |
| 927 | 927 | /* fill with background color first */ |
| 928 | bitmap->fill(state->m_pens[0x0fff], | |
| 928 | bitmap->fill(state->m_pens[0x0fff], | |
| 929 | 929 | |
| 930 | draw_sprites(screen.machine(), bitmap, cliprect | |
| 930 | draw_sprites(screen.machine(), bitmap, cliprect. | |
| 931 | 931 | |
| 932 | draw_fixed_layer(screen.machine(), bitmap, cliprect | |
| 932 | draw_fixed_layer(screen.machine(), bitmap, cliprect. | |
| 933 | 933 | |
| 934 | 934 | return 0; |
| 935 | 935 | } |
| r13798 | r13799 | |
|---|---|---|
| 89 | 89 | |
| 90 | 90 | void K053936GP_set_cliprect(int chip, int minx, int maxx, int miny, int maxy) |
| 91 | 91 | { |
| 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; | |
| 97 | 97 | } |
| 98 | 98 | |
| 99 | 99 | INLINE void K053936GP_copyroz32clip( running_machine &machine, |
| 100 | 100 | bitmap_t *dst_bitmap, bitmap_t *src_bitmap, |
| 101 | const rectangle | |
| 101 | const rectangle &dst_cliprect, const rectangle &src_cliprect, | |
| 102 | 102 | UINT32 _startx,UINT32 _starty,int _incxx,int _incxy,int _incyx,int _incyy, |
| 103 | 103 | int tilebpp, int blend, int alpha, int clip, int pixeldouble_output ) |
| 104 | 104 | { |
| r13798 | r13799 | |
| 123 | 123 | incxy = _incxy; incxx = _incxx; incyy = _incyy; incyx = _incyx; |
| 124 | 124 | starty = _starty; startx = _startx; |
| 125 | 125 | |
| 126 | if ( | |
| 126 | if ( | |
| 127 | 127 | { |
| 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; | |
| 132 | 132 | } |
| 133 | 133 | // this simply isn't safe to do! |
| 134 | 134 | else { src_minx = src_miny = -0x10000; src_maxx = src_maxy = 0x10000; } |
| 135 | 135 | |
| 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; | |
| 142 | 141 | |
| 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; | |
| 147 | 144 | |
| 148 | 145 | // adjust entry points and other loop constants |
| 149 | 146 | dst_pitch = dst_bitmap->rowpixels(); |
| r13798 | r13799 | |
| 283 | 280 | // adapted from generic K053936_zoom_draw() |
| 284 | 281 | static void K053936GP_zoom_draw(running_machine &machine, |
| 285 | 282 | int chip, UINT16 *ctrl, UINT16 *linectrl, |
| 286 | bitmap_t *bitmap, const rectangle | |
| 283 | bitmap_t *bitmap, const rectangle &cliprect, tilemap_t *tmap, | |
| 287 | 284 | int tilebpp, int blend, int alpha, int pixeldouble_output) |
| 288 | 285 | { |
| 289 | 286 | bitmap_t *src_bitmap; |
| 290 | rectangle *src_cliprect; | |
| 291 | 287 | UINT16 *lineaddr; |
| 292 | 288 | |
| 293 | 289 | rectangle my_clip; |
| r13798 | r13799 | |
| 295 | 291 | int incxx, incxy, incyx, incyy, y, maxy, clip; |
| 296 | 292 | |
| 297 | 293 | src_bitmap = tilemap_get_pixmap(tmap); |
| 298 | src_cliprect = | |
| 294 | rectangle &src_cliprect = | |
| 299 | 295 | clip = K053936_clip_enabled[chip]; |
| 300 | 296 | |
| 301 | 297 | if (ctrl[0x07] & 0x0040) /* "super" mode */ |
| 302 | 298 | { |
| 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; | |
| 307 | 303 | |
| 308 | 304 | while (y <= maxy) |
| 309 | 305 | { |
| r13798 | r13799 | |
| 322 | 318 | starty -= K053936_offset[chip][0] * incxy; |
| 323 | 319 | |
| 324 | 320 | K053936GP_copyroz32clip(machine, |
| 325 | bitmap, src_bitmap, | |
| 321 | bitmap, src_bitmap, | |
| 326 | 322 | startx<<5, starty<<5, incxx<<5, incxy<<5, 0, 0, |
| 327 | 323 | tilebpp, blend, alpha, clip, pixeldouble_output); |
| 328 | 324 | y++; |
| r13798 | r13799 | |
| 353 | 349 | } |
| 354 | 350 | } |
| 355 | 351 | |
| 356 | static void K053936GP_0_zoom_draw(running_machine &machine, bitmap_t *bitmap, const rectangle | |
| 352 | static void K053936GP_0_zoom_draw(running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect, | |
| 357 | 353 | tilemap_t *tmap, int tilebpp, int blend, int alpha, int pixeldouble_output) |
| 358 | 354 | { |
| 359 | 355 | K053936GP_zoom_draw(machine, 0,K053936_0_ctrl,K053936_0_linectrl,bitmap,cliprect,tmap,tilebpp,blend,alpha, pixeldouble_output); |
| 360 | 356 | } |
| 361 | 357 | |
| 362 | static void K053936GP_1_zoom_draw(running_machine &machine, bitmap_t *bitmap, const rectangle | |
| 358 | static void K053936GP_1_zoom_draw(running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect, | |
| 363 | 359 | tilemap_t *tmap, int tilebpp, int blend, int alpha, int pixeldouble_output) |
| 364 | 360 | { |
| 365 | 361 | K053936GP_zoom_draw(machine, 1,K053936_1_ctrl,K053936_1_linectrl,bitmap,cliprect,tmap,tilebpp,blend,alpha, pixeldouble_output); |
| r13798 | r13799 | |
| 385 | 381 | |
| 386 | 382 | |
| 387 | 383 | INLINE void zdrawgfxzoom32GP( |
| 388 | bitmap_t *bitmap, const rectangle | |
| 384 | bitmap_t *bitmap, const rectangle &cliprect, const gfx_element *gfx, | |
| 389 | 385 | UINT32 code, UINT32 color, int flipx, int flipy, int sx, int sy, |
| 390 | 386 | int scalex, int scaley, int alpha, int drawmode, int zcode, int pri) |
| 391 | 387 | { |
| r13798 | r13799 | |
| 455 | 451 | |
| 456 | 452 | dst_ptr = &bitmap->pix32(0); |
| 457 | 453 | 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; | |
| 462 | 458 | dst_x = sx; |
| 463 | 459 | dst_y = sy; |
| 464 | 460 | |
| r13798 | r13799 | |
| 1163 | 1159 | if (gx_objdma && gx_spriteram && K053247_ram) memcpy(gx_spriteram, K053247_ram, 0x1000); |
| 1164 | 1160 | } |
| 1165 | 1161 | |
| 1166 | void konamigx_mixer(running_machine &machine, bitmap_t *bitmap, const rectangle | |
| 1162 | void konamigx_mixer(running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect, | |
| 1167 | 1163 | tilemap_t *sub1, int sub1flags, |
| 1168 | 1164 | tilemap_t *sub2, int sub2flags, |
| 1169 | 1165 | int mixerflags, bitmap_t *extra_bitmap, int rushingheroes_hack) |
| r13798 | r13799 | |
| 2436 | 2432 | // Type-1 |
| 2437 | 2433 | if (gx_specialrozenable == 1) |
| 2438 | 2434 | { |
| 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?) | |
| 2441 | 2437 | } |
| 2442 | 2438 | |
| 2443 | 2439 | |
| r13798 | r13799 | |
| 2452 | 2448 | { |
| 2453 | 2449 | // we're going to throw half of this away anyway in post-process, so only render what's needed |
| 2454 | 2450 | 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; | |
| 2459 | 2455 | |
| 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 | |
| 2462 | 2458 | |
| 2463 | 2459 | |
| 2464 | 2460 | konamigx_mixer(screen.machine(), bitmap, cliprect, 0, 0, 0, 0, 0, type3_roz_temp_bitmap, gx_rushingheroes_hack); |
| r13798 | r13799 | |
|---|---|---|
| 54 | 54 | /* if no drawing is happening, fill with black and get out */ |
| 55 | 55 | if (!segaic16_display_enable) |
| 56 | 56 | { |
| 57 | bitmap->fill(get_black_pen(screen.machine()), | |
| 57 | bitmap->fill(get_black_pen(screen.machine()), | |
| 58 | 58 | return 0; |
| 59 | 59 | } |
| 60 | 60 | |
| 61 | 61 | /* reset priorities */ |
| 62 | screen.machine().priority_bitmap->fill(0, | |
| 62 | screen.machine().priority_bitmap->fill(0, | |
| 63 | 63 | |
| 64 | 64 | /* draw the low priority road layer */ |
| 65 | 65 | segaic16_road_draw(0, bitmap, cliprect, SEGAIC16_ROAD_BACKGROUND); |
| r13798 | r13799 | |
|---|---|---|
| 146 | 146 | colortable_configure_tilemap_groups(machine.colortable, state->m_fgtilemap, machine.gfx[2], 0); |
| 147 | 147 | } |
| 148 | 148 | |
| 149 | static void draw_sprites(running_machine &machine, bitmap_t *bitmap,const rectangle | |
| 149 | static void draw_sprites(running_machine &machine, bitmap_t *bitmap,const rectangle &cliprect) | |
| 150 | 150 | { |
| 151 | 151 | sprcros2_state *state = machine.driver_data<sprcros2_state>(); |
| 152 | 152 | int offs,sx,sy,color,flipx,flipy; |
| r13798 | r13799 | |
|---|---|---|
| 131 | 131 | int x, y, r; |
| 132 | 132 | |
| 133 | 133 | /* draw the playfield */ |
| 134 | priority_bitmap->fill(0, | |
| 134 | priority_bitmap->fill(0, | |
| 135 | 135 | tilemap_draw(bitmap, cliprect, state->m_playfield_tilemap, 0, 0x00); |
| 136 | 136 | tilemap_draw(bitmap, cliprect, state->m_playfield_tilemap, 1, 0x01); |
| 137 | 137 | tilemap_draw(bitmap, cliprect, state->m_playfield_tilemap, 2, 0x02); |
| r13798 | r13799 | |
|---|---|---|
| 67 | 67 | |
| 68 | 68 | konami_sortlayers3(layer, state->m_layerpri); |
| 69 | 69 | |
| 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); | |
| 72 | 72 | k052109_tilemap_draw(state->m_k052109, bitmap, cliprect, layer[0], 0,1); |
| 73 | 73 | k052109_tilemap_draw(state->m_k052109, bitmap, cliprect, layer[1], 0,2); |
| 74 | 74 | k052109_tilemap_draw(state->m_k052109, bitmap, cliprect, layer[2], 0,4); |
| r13798 | r13799 | |
|---|---|---|
| 231 | 231 | tilemap_set_transparent_pen(state->m_bg_tilemap, 0); |
| 232 | 232 | } |
| 233 | 233 | |
| 234 | static void draw_sprites( running_machine &machine, bitmap_t *bitmap, const rectangle | |
| 234 | static void draw_sprites( running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect ) | |
| 235 | 235 | { |
| 236 | 236 | ladybug_state *state = machine.driver_data<ladybug_state>(); |
| 237 | 237 | UINT8 *spriteram = state->m_spriteram; |
| r13798 | r13799 | |
| 288 | 288 | int offs; |
| 289 | 289 | |
| 290 | 290 | // clear the bg bitmap |
| 291 | bitmap->fill(0, | |
| 291 | bitmap->fill(0, | |
| 292 | 292 | |
| 293 | 293 | for (offs = 0; offs < 32; offs++) |
| 294 | 294 | { |
| r13798 | r13799 | |
| 333 | 333 | } |
| 334 | 334 | |
| 335 | 335 | // clear the bg bitmap |
| 336 | bitmap->fill(0, | |
| 336 | bitmap->fill(0, | |
| 337 | 337 | |
| 338 | 338 | // draw the stars |
| 339 | 339 | if (flip_screen_get(screen.machine())) |
| r13798 | r13799 | |
| 352 | 352 | if (state->m_grid_data[i] != 0) |
| 353 | 353 | { |
| 354 | 354 | UINT8 x = i; |
| 355 | int height = cliprect | |
| 355 | int height = cliprect. | |
| 356 | 356 | |
| 357 | 357 | if (flip_screen_get(screen.machine())) |
| 358 | 358 | x = ~x; |
| 359 | 359 | |
| 360 | bitmap->plot_box(x, cliprect | |
| 360 | bitmap->plot_box(x, cliprect. | |
| 361 | 361 | } |
| 362 | 362 | } |
| 363 | 363 |
| r13798 | r13799 | |
|---|---|---|
| 393 | 393 | |
| 394 | 394 | ***************************************************************************/ |
| 395 | 395 | |
| 396 | static void draw_sprites( running_machine &machine, bitmap_t *bitmap, const rectangle | |
| 396 | static void draw_sprites( running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect, const UINT8 *source, int circuit, UINT32 pri_mask ) | |
| 397 | 397 | { |
| 398 | 398 | combatsc_state *state = machine.driver_data<combatsc_state>(); |
| 399 | 399 | device_t *k007121 = circuit ? state->m_k007121_2 : state->m_k007121_1; |
| r13798 | r13799 | |
| 437 | 437 | tilemap_set_scrolly(state->m_bg_tilemap[0], 0, k007121_ctrlram_r(state->m_k007121_1, 2)); |
| 438 | 438 | tilemap_set_scrolly(state->m_bg_tilemap[1], 0, k007121_ctrlram_r(state->m_k007121_2, 2)); |
| 439 | 439 | |
| 440 | screen.machine().priority_bitmap->fill(0, | |
| 440 | screen.machine().priority_bitmap->fill(0, | |
| 441 | 441 | |
| 442 | 442 | if (state->m_priority == 0) |
| 443 | 443 | { |
| r13798 | r13799 | |
| 476 | 476 | { |
| 477 | 477 | rectangle clip; |
| 478 | 478 | |
| 479 | clip = | |
| 479 | clip = | |
| 480 | 480 | clip.max_x = clip.min_x + 7; |
| 481 | 481 | bitmap->fill(0, clip); |
| 482 | 482 | |
| 483 | clip = | |
| 483 | clip = | |
| 484 | 484 | clip.min_x = clip.max_x - 7; |
| 485 | 485 | bitmap->fill(0, clip); |
| 486 | 486 | } |
| r13798 | r13799 | |
| 515 | 515 | |
| 516 | 516 | ***************************************************************************/ |
| 517 | 517 | |
| 518 | static void bootleg_draw_sprites( running_machine &machine, bitmap_t *bitmap, const rectangle | |
| 518 | static void bootleg_draw_sprites( running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect, const UINT8 *source, int circuit ) | |
| 519 | 519 | { |
| 520 | 520 | address_space *space = machine.device("maincpu")->memory().space(AS_PROGRAM); |
| 521 | 521 | const gfx_element *gfx = machine.gfx[circuit + 2]; |
| r13798 | r13799 | |
|---|---|---|
| 98 | 98 | state->save_item(NAME(state->m_gfx_bank)); |
| 99 | 99 | } |
| 100 | 100 | |
| 101 | static void draw_sprites( running_machine &machine, bitmap_t *bitmap, const rectangle | |
| 101 | static void draw_sprites( running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect ) | |
| 102 | 102 | { |
| 103 | 103 | blueprnt_state *state = machine.driver_data<blueprnt_state>(); |
| 104 | 104 | int offs; |
| r13798 | r13799 | |
| 136 | 136 | for (i = 0; i < 32; i++) |
| 137 | 137 | tilemap_set_scrolly(state->m_bg_tilemap, i, state->m_scrollram[30 - i]); |
| 138 | 138 | |
| 139 | bitmap->fill(get_black_pen(screen.machine()), | |
| 139 | bitmap->fill(get_black_pen(screen.machine()), | |
| 140 | 140 | tilemap_draw(bitmap, cliprect, state->m_bg_tilemap, 0, 0); |
| 141 | 141 | draw_sprites(screen.machine(), bitmap, cliprect); |
| 142 | 142 | tilemap_draw(bitmap, cliprect, state->m_bg_tilemap, 1, 0); |
| r13798 | r13799 | |
|---|---|---|
| 1209 | 1209 | void ppu2c0x_render( device_t *device, bitmap_t *bitmap, int flipx, int flipy, int sx, int sy ) |
| 1210 | 1210 | { |
| 1211 | 1211 | ppu2c0x_state *ppu2c0x = get_token(device); |
| 1212 | copybitmap(bitmap, ppu2c0x->bitmap, flipx, flipy, sx, sy, | |
| 1212 | copybitmap(bitmap, ppu2c0x->bitmap, flipx, flipy, sx, sy, bitmap->cliprect()); | |
| 1213 | 1213 | } |
| 1214 | 1214 | |
| 1215 | 1215 | /************************************* |
| r13798 | r13799 | |
|---|---|---|
| 80 | 80 | } |
| 81 | 81 | |
| 82 | 82 | |
| 83 | static void draw_sky( bitmap_t *bitmap, const rectangle | |
| 83 | static void draw_sky( bitmap_t *bitmap, const rectangle &cliprect ) | |
| 84 | 84 | { |
| 85 | 85 | int x, y; |
| 86 | 86 | |
| r13798 | r13799 | |
| 90 | 90 | } |
| 91 | 91 | |
| 92 | 92 | |
| 93 | static void draw_bg( running_machine &machine, bitmap_t *bitmap, const rectangle | |
| 93 | static void draw_bg( running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect ) | |
| 94 | 94 | { |
| 95 | 95 | buggychl_state *state = machine.driver_data<buggychl_state>(); |
| 96 | 96 | int offs; |
| 97 | 97 | int scroll[256]; |
| 98 | 98 | |
| 99 | 99 | /* prevent wraparound */ |
| 100 | rectangle clip = | |
| 100 | rectangle clip = | |
| 101 | 101 | if (flip_screen_x_get(machine)) clip.min_x += 8*8; |
| 102 | 102 | else clip.max_x -= 8*8; |
| 103 | 103 | |
| r13798 | r13799 | |
| 113 | 113 | if (flip_screen_y_get(machine)) |
| 114 | 114 | sy = 31 - sy; |
| 115 | 115 | |
| 116 | drawgfx_opaque(state->m_tmp_bitmap1, | |
| 116 | drawgfx_opaque(state->m_tmp_bitmap1, state->m_tmp_bitmap1->cliprect(), machine.gfx[0], | |
| 117 | 117 | code, |
| 118 | 118 | 2, |
| 119 | 119 | flip_screen_x_get(machine),flip_screen_y_get(machine), |
| r13798 | r13799 | |
| 124 | 124 | for (offs = 0; offs < 256; offs++) |
| 125 | 125 | scroll[offs] = -state->m_scrollv[offs / 8]; |
| 126 | 126 | |
| 127 | copyscrollbitmap(state->m_tmp_bitmap2, state->m_tmp_bitmap1, 1, &state->m_bg_scrollx, 256, scroll, | |
| 127 | copyscrollbitmap(state->m_tmp_bitmap2, state->m_tmp_bitmap1, 1, &state->m_bg_scrollx, 256, scroll, state->m_tmp_bitmap2->cliprect()); | |
| 128 | 128 | |
| 129 | 129 | /* then copy to the screen doing row scroll */ |
| 130 | 130 | for (offs = 0; offs < 256; offs++) |
| 131 | 131 | scroll[offs] = -state->m_scrollh[offs]; |
| 132 | 132 | |
| 133 | copyscrollbitmap_trans(bitmap, state->m_tmp_bitmap2, 256, scroll, 0, 0, | |
| 133 | copyscrollbitmap_trans(bitmap, state->m_tmp_bitmap2, 256, scroll, 0, 0, | |
| 134 | 134 | } |
| 135 | 135 | |
| 136 | 136 | |
| 137 | static void draw_fg( running_machine &machine, bitmap_t *bitmap, const rectangle | |
| 137 | static void draw_fg( running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect ) | |
| 138 | 138 | { |
| 139 | 139 | buggychl_state *state = machine.driver_data<buggychl_state>(); |
| 140 | 140 | int offs; |
| r13798 | r13799 | |
| 163 | 163 | } |
| 164 | 164 | |
| 165 | 165 | |
| 166 | static void draw_sprites( running_machine &machine, bitmap_t *bitmap, const rectangle | |
| 166 | static void draw_sprites( running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect ) | |
| 167 | 167 | { |
| 168 | 168 | buggychl_state *state = machine.driver_data<buggychl_state>(); |
| 169 | 169 | UINT8 *spriteram = state->m_spriteram; |
| r13798 | r13799 | |
| 243 | 243 | if (state->m_sky_on) |
| 244 | 244 | draw_sky(bitmap, cliprect); |
| 245 | 245 | else |
| 246 | bitmap->fill(0, | |
| 246 | bitmap->fill(0, | |
| 247 | 247 | |
| 248 | 248 | if (state->m_bg_on) |
| 249 | 249 | draw_bg(screen.machine(), bitmap, cliprect); |
| r13798 | r13799 | |
|---|---|---|
| 105 | 105 | |
| 106 | 106 | |
| 107 | 107 | |
| 108 | static void draw_sprites( running_machine &machine, bitmap_t *bitmap, const rectangle | |
| 108 | static void draw_sprites( running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect ) | |
| 109 | 109 | { |
| 110 | 110 | gotcha_state *state = machine.driver_data<gotcha_state>(); |
| 111 | 111 | UINT16 *spriteram = state->m_spriteram; |
| r13798 | r13799 | |
|---|---|---|
| 181 | 181 | } |
| 182 | 182 | |
| 183 | 183 | |
| 184 | static void draw_sprites(running_machine &machine, bitmap_t* bitmap, const rectangle | |
| 184 | static void draw_sprites(running_machine &machine, bitmap_t* bitmap, const rectangle | |
| 185 | 185 | { |
| 186 | 186 | starshp1_state *state = machine.driver_data<starshp1_state>(); |
| 187 | 187 | int i; |
| r13798 | r13799 | |
| 200 | 200 | } |
| 201 | 201 | |
| 202 | 202 | |
| 203 | static void draw_spaceship(running_machine &machine, bitmap_t* bitmap, const rectangle | |
| 203 | static void draw_spaceship(running_machine &machine, bitmap_t* bitmap, const rectangle | |
| 204 | 204 | { |
| 205 | 205 | starshp1_state *state = machine.driver_data<starshp1_state>(); |
| 206 | 206 | double scaler = -5 * log(1 - state->m_ship_size / 256.0); /* ? */ |
| r13798 | r13799 | |
| 314 | 314 | } |
| 315 | 315 | |
| 316 | 316 | |
| 317 | static int spaceship_collision(running_machine &machine, bitmap_t *bitmap, const rectangle | |
| 317 | static int spaceship_collision(running_machine &machine, bitmap_t *bitmap, const rectangle &rect) | |
| 318 | 318 | { |
| 319 | 319 | starshp1_state *state = machine.driver_data<starshp1_state>(); |
| 320 | 320 | int x; |
| 321 | 321 | int y; |
| 322 | 322 | |
| 323 | for (y = rect | |
| 323 | for (y = rect. | |
| 324 | 324 | { |
| 325 | 325 | const UINT16* pLine = &state->m_helper->pix16(y); |
| 326 | 326 | |
| 327 | for (x = rect | |
| 327 | for (x = rect. | |
| 328 | 328 | if (pLine[x] != 0) |
| 329 | 329 | return 1; |
| 330 | 330 | } |
| r13798 | r13799 | |
| 342 | 342 | } |
| 343 | 343 | |
| 344 | 344 | |
| 345 | static int circle_collision(starshp1_state *state, const rectangle | |
| 345 | static int circle_collision(starshp1_state *state, const rectangle &rect) | |
| 346 | 346 | { |
| 347 | 347 | int center_x = get_circle_hpos(state); |
| 348 | 348 | int center_y = get_circle_vpos(state); |
| 349 | 349 | |
| 350 | 350 | int r = get_radius(state); |
| 351 | 351 | |
| 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); | |
| 356 | 356 | } |
| 357 | 357 | |
| 358 | 358 | |
| r13798 | r13799 | |
| 361 | 361 | starshp1_state *state = screen.machine().driver_data<starshp1_state>(); |
| 362 | 362 | set_pens(state, screen.machine().colortable); |
| 363 | 363 | |
| 364 | bitmap->fill(0, | |
| 364 | bitmap->fill(0, | |
| 365 | 365 | |
| 366 | 366 | if (state->m_starfield_kill == 0) |
| 367 | 367 | draw_starfield(state, bitmap); |
| r13798 | r13799 | |
| 409 | 409 | state->m_helper->fill(0, visarea); |
| 410 | 410 | |
| 411 | 411 | if (state->m_attract == 0) |
| 412 | draw_spaceship(screen.machine(), state->m_helper, | |
| 412 | draw_spaceship(screen.machine(), state->m_helper, | |
| 413 | 413 | |
| 414 | if (circle_collision(state, | |
| 414 | if (circle_collision(state, | |
| 415 | 415 | state->m_collision_latch |= 1; |
| 416 | 416 | |
| 417 | if (circle_collision(state, | |
| 417 | if (circle_collision(state, | |
| 418 | 418 | state->m_collision_latch |= 2; |
| 419 | 419 | |
| 420 | if (spaceship_collision(screen.machine(), state->m_helper, | |
| 420 | if (spaceship_collision(screen.machine(), state->m_helper, | |
| 421 | 421 | state->m_collision_latch |= 4; |
| 422 | 422 | |
| 423 | if (spaceship_collision(screen.machine(), state->m_helper, | |
| 423 | if (spaceship_collision(screen.machine(), state->m_helper, | |
| 424 | 424 | state->m_collision_latch |= 8; |
| 425 | 425 | } |
| r13798 | r13799 | |
|---|---|---|
| 156 | 156 | |
| 157 | 157 | ***************************************************************************/ |
| 158 | 158 | |
| 159 | static void draw_sprites( running_machine &machine, bitmap_t *bitmap, const rectangle | |
| 159 | static void draw_sprites( running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect, UINT8* sr ) | |
| 160 | 160 | { |
| 161 | 161 | int offs; |
| 162 | 162 |
| r13798 | r13799 | |
|---|---|---|
| 6 | 6 | |
| 7 | 7 | /* Sprites */ |
| 8 | 8 | |
| 9 | static void draw_sprites(running_machine &machine, bitmap_t *bitmap, const rectangle | |
| 9 | static void draw_sprites(running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect ) | |
| 10 | 10 | { |
| 11 | 11 | /*- SPR RAM Format -** |
| 12 | 12 | |
| r13798 | r13799 | |
| 132 | 132 | { |
| 133 | 133 | bigstrkb_state *state = screen.machine().driver_data<bigstrkb_state>(); |
| 134 | 134 | |
| 135 | // bitmap->fill(get_black_pen(screen.machine()), | |
| 135 | // bitmap->fill(get_black_pen(screen.machine()), | |
| 136 | 136 | |
| 137 | 137 | tilemap_set_scrollx(state->m_tilemap2,0, state->m_vidreg1[0]+(256-14)); |
| 138 | 138 | tilemap_set_scrolly(state->m_tilemap2,0, state->m_vidreg2[0]); |
| r13798 | r13799 | |
|---|---|---|
| 286 | 286 | state->m_spritebank_buffered[7] = state->m_spritebank_buffered[6] + 0x400; |
| 287 | 287 | } |
| 288 | 288 | |
| 289 | static void taito_f2_tc360_spritemixdraw( running_machine &machine, bitmap_t *dest_bmp, const rectangle | |
| 289 | static void taito_f2_tc360_spritemixdraw( running_machine &machine, bitmap_t *dest_bmp, const rectangle &clip, const gfx_element *gfx, | |
| 290 | 290 | UINT32 code, UINT32 color, int flipx, int flipy, int sx, int sy, int scalex, int scaley ) |
| 291 | 291 | { |
| 292 | 292 | taitof2_state *state = machine.driver_data<taitof2_state>(); |
| r13798 | r13799 | |
| 331 | 331 | y_index = 0; |
| 332 | 332 | } |
| 333 | 333 | |
| 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; | |
| 359 | 339 | } |
| 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 | } | |
| 360 | 357 | |
| 361 | 358 | if (ex > sx) |
| 362 | 359 | { |
| r13798 | r13799 | |
| 435 | 432 | } |
| 436 | 433 | } |
| 437 | 434 | |
| 438 | static void draw_sprites( running_machine &machine, bitmap_t *bitmap, const rectangle | |
| 435 | static void draw_sprites( running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect, int *primasks, int uses_tc360_mixer ) | |
| 439 | 436 | { |
| 440 | 437 | /* |
| 441 | 438 | Sprite format: |
| r13798 | r13799 | |
| 985 | 982 | |
| 986 | 983 | /* SSI only uses sprites, the tilemap registers are not even initialized. |
| 987 | 984 | (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); | |
| 990 | 987 | draw_sprites(screen.machine(), bitmap, cliprect, NULL, 0); |
| 991 | 988 | return 0; |
| 992 | 989 | } |
| r13798 | r13799 | |
| 1000 | 997 | |
| 1001 | 998 | tc0100scn_tilemap_update(state->m_tc0100scn); |
| 1002 | 999 | |
| 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? */ | |
| 1005 | 1002 | draw_sprites(screen.machine(), bitmap, cliprect, NULL, 0); |
| 1006 | 1003 | tc0100scn_tilemap_draw(state->m_tc0100scn, bitmap, cliprect, tc0100scn_bottomlayer(state->m_tc0100scn), 0, 0); |
| 1007 | 1004 | tc0100scn_tilemap_draw(state->m_tc0100scn, bitmap, cliprect, tc0100scn_bottomlayer(state->m_tc0100scn) ^ 1, 0, 0); |
| r13798 | r13799 | |
| 1018 | 1015 | |
| 1019 | 1016 | tc0100scn_tilemap_update(state->m_tc0100scn); |
| 1020 | 1017 | |
| 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? */ | |
| 1023 | 1020 | tc0100scn_tilemap_draw(state->m_tc0100scn, bitmap, cliprect, tc0100scn_bottomlayer(state->m_tc0100scn), 0, 0); |
| 1024 | 1021 | tc0100scn_tilemap_draw(state->m_tc0100scn, bitmap, cliprect, tc0100scn_bottomlayer(state->m_tc0100scn) ^ 1, 0, 0); |
| 1025 | 1022 | draw_sprites(screen.machine(), bitmap, cliprect, NULL, 0); |
| r13798 | r13799 | |
| 1051 | 1048 | |
| 1052 | 1049 | state->m_spriteblendmode = tc0360pri_r(state->m_tc0360pri, 0) & 0xc0; |
| 1053 | 1050 | |
| 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? */ | |
| 1056 | 1053 | |
| 1057 | 1054 | tc0100scn_tilemap_draw(state->m_tc0100scn, bitmap, cliprect, layer[0], 0, 1); |
| 1058 | 1055 | tc0100scn_tilemap_draw(state->m_tc0100scn, bitmap, cliprect, layer[1], 0, 2); |
| r13798 | r13799 | |
| 1064 | 1061 | |
| 1065 | 1062 | |
| 1066 | 1063 | |
| 1067 | static void draw_roz_layer( running_machine &machine, bitmap_t *bitmap, const rectangle | |
| 1064 | static void draw_roz_layer( running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect, UINT32 priority) | |
| 1068 | 1065 | { |
| 1069 | 1066 | taitof2_state *state = machine.driver_data<taitof2_state>(); |
| 1070 | 1067 | |
| r13798 | r13799 | |
| 1113 | 1110 | |
| 1114 | 1111 | state->m_spriteblendmode = tc0360pri_r(state->m_tc0360pri, 0) & 0xc0; |
| 1115 | 1112 | |
| 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? */ | |
| 1118 | 1115 | |
| 1119 | 1116 | drawn = 0; |
| 1120 | 1117 | for (i = 0; i < 16; i++) |
| r13798 | r13799 | |
| 1176 | 1173 | spritepri[2] = tc0360pri_r(state->m_tc0360pri, 7) & 0x0f; |
| 1177 | 1174 | spritepri[3] = tc0360pri_r(state->m_tc0360pri, 7) >> 4; |
| 1178 | 1175 | |
| 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? */ | |
| 1181 | 1178 | |
| 1182 | 1179 | /* |
| 1183 | 1180 | TODO: This isn't the correct way to handle the priority. At the moment of |
| r13798 | r13799 | |
| 1317 | 1314 | |
| 1318 | 1315 | state->m_spriteblendmode = tc0360pri_r(state->m_tc0360pri, 0) & 0xc0; |
| 1319 | 1316 | |
| 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); | |
| 1322 | 1319 | |
| 1323 | 1320 | tc0480scp_tilemap_draw(state->m_tc0480scp, bitmap, cliprect, layer[0], 0 ,1); |
| 1324 | 1321 | tc0480scp_tilemap_draw(state->m_tc0480scp, bitmap, cliprect, layer[1], 0, 2); |
| r13798 | r13799 | |
| 1365 | 1362 | spritepri[2] = tc0360pri_r(state->m_tc0360pri, 7) & 0x0f; |
| 1366 | 1363 | spritepri[3] = tc0360pri_r(state->m_tc0360pri, 7) >> 4; |
| 1367 | 1364 | |
| 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); | |
| 1370 | 1367 | |
| 1371 | 1368 | tc0480scp_tilemap_draw(state->m_tc0480scp, bitmap, cliprect, layer[0], 0 ,1); |
| 1372 | 1369 | tc0480scp_tilemap_draw(state->m_tc0480scp, bitmap, cliprect, layer[1], 0, 2); |
| r13798 | r13799 | |
|---|---|---|
| 131 | 131 | tilemap_set_scroll_rows(state->m_bg_tilemap, 32); |
| 132 | 132 | } |
| 133 | 133 | |
| 134 | static void gberet_draw_sprites( running_machine &machine, bitmap_t *bitmap, const rectangle | |
| 134 | static void gberet_draw_sprites( running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect ) | |
| 135 | 135 | { |
| 136 | 136 | gberet_state *state = machine.driver_data<gberet_state>(); |
| 137 | 137 | int offs; |
| r13798 | r13799 | |
| 192 | 192 | tilemap_set_scrollx(state->m_bg_tilemap, offset, scroll + 64 - 8); |
| 193 | 193 | } |
| 194 | 194 | |
| 195 | static void gberetb_draw_sprites( running_machine &machine, bitmap_t *bitmap, const rectangle | |
| 195 | static void gberetb_draw_sprites( running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect ) | |
| 196 | 196 | { |
| 197 | 197 | gberet_state *state = machine.driver_data<gberet_state>(); |
| 198 | 198 | UINT8 *spriteram = state->m_spriteram; |
| r13798 | r13799 | |
|---|---|---|
| 244 | 244 | |
| 245 | 245 | ***************************************************************************/ |
| 246 | 246 | |
| 247 | static void draw_sprites(running_machine &machine, bitmap_t *bitmap, const rectangle | |
| 247 | static void draw_sprites(running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect) | |
| 248 | 248 | { |
| 249 | 249 | stfight_state *state = machine.driver_data<stfight_state>(); |
| 250 | 250 | int offs,sx,sy; |
| r13798 | r13799 | |
| 297 | 297 | stfight_state *state = screen.machine().driver_data<stfight_state>(); |
| 298 | 298 | set_pens(screen.machine()); |
| 299 | 299 | |
| 300 | screen.machine().priority_bitmap->fill(0, | |
| 300 | screen.machine().priority_bitmap->fill(0, | |
| 301 | 301 | |
| 302 | bitmap->fill(0, | |
| 302 | bitmap->fill(0, | |
| 303 | 303 | tilemap_draw(bitmap,cliprect,state->m_bg_tilemap,0,0); |
| 304 | 304 | tilemap_draw(bitmap,cliprect,state->m_fg_tilemap,0,1); |
| 305 | 305 |
| r13798 | r13799 | |
|---|---|---|
| 213 | 213 | * |
| 214 | 214 | *************************************/ |
| 215 | 215 | |
| 216 | static void draw_sprites(running_machine &machine, bitmap_t *bitmap, const rectangle | |
| 216 | static void draw_sprites(running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect) | |
| 217 | 217 | { |
| 218 | 218 | gottlieb_state *state = machine.driver_data<gottlieb_state>(); |
| 219 | 219 | UINT8 *spriteram = state->m_spriteram; |
| 220 | rectangle clip = | |
| 220 | rectangle clip = | |
| 221 | 221 | int offs; |
| 222 | 222 | |
| 223 | 223 | /* this is a temporary guess until the sprite hardware is better understood */ |
| r13798 | r13799 | |
| 235 | 235 | if (flip_screen_x_get(machine)) sx = 233 - sx; |
| 236 | 236 | if (flip_screen_y_get(machine)) sy = 244 - sy; |
| 237 | 237 | |
| 238 | drawgfx_transpen(bitmap, | |
| 238 | drawgfx_transpen(bitmap, | |
| 239 | 239 | machine.gfx[2], |
| 240 | 240 | code, 0, |
| 241 | 241 | flip_screen_x_get(machine), flip_screen_y_get(machine), |
| r13798 | r13799 | |
| 258 | 258 | if (!state->m_background_priority) |
| 259 | 259 | tilemap_draw(bitmap, cliprect, state->m_bg_tilemap, TILEMAP_DRAW_OPAQUE, 0); |
| 260 | 260 | else |
| 261 | bitmap->fill(0, | |
| 261 | bitmap->fill(0, | |
| 262 | 262 | |
| 263 | 263 | /* draw the sprites */ |
| 264 | 264 | draw_sprites(screen.machine(), bitmap, cliprect); |
| r13798 | r13799 | |
|---|---|---|
| 154 | 154 | cliprect,gfx, \ |
| 155 | 155 | (which + order),color,flipx,flipy,sx,sy,0); |
| 156 | 156 | |
| 157 | static void draw_sprites( running_machine& machine, bitmap_t *bitmap,const rectangle | |
| 157 | static void draw_sprites( running_machine& machine, bitmap_t *bitmap,const rectangle &cliprect ) | |
| 158 | 158 | { |
| 159 | 159 | ddragon_state *state = machine.driver_data<ddragon_state>(); |
| 160 | 160 | const gfx_element *gfx = machine.gfx[1]; |
| r13798 | r13799 | |
|---|---|---|
| 96 | 96 | |
| 97 | 97 | konami_sortlayers3(layer, state->m_layerpri); |
| 98 | 98 | |
| 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); | |
| 101 | 101 | |
| 102 | 102 | k056832_tilemap_draw(state->m_k056832, bitmap, cliprect, layer[0], K056832_DRAW_FLAG_MIRROR, 1); |
| 103 | 103 | k056832_tilemap_draw(state->m_k056832, bitmap, cliprect, layer[1], K056832_DRAW_FLAG_MIRROR, 2); |
| r13798 | r13799 | |
|---|---|---|
| 596 | 596 | UINT8 *text_gfx_base = screen.machine().region("gfx1")->base(); |
| 597 | 597 | UINT8 *romBxx = screen.machine().region("user1")->base() + 0x2000*state->m_background_romsel; |
| 598 | 598 | |
| 599 | /* logerror(" update: from DISP=%i y_min=%3i y_max=%3i\n", DISP_, cliprect | |
| 599 | /* logerror(" update: from DISP=%i y_min=%3i y_max=%3i\n", DISP_, cliprect. | |
| 600 | 600 | |
| 601 | for (v = cliprect | |
| 601 | for (v = cliprect. | |
| 602 | 602 | { |
| 603 | 603 | UINT32 h; |
| 604 | 604 | UINT32 sp_data0=0,sp_data1=0,sp_data2=0; |
| r13798 | r13799 | |
| 758 | 758 | /* especially read from ROM19C can be done once per 8 pixels*/ |
| 759 | 759 | /* and the data could be bitswapped beforehand */ |
| 760 | 760 | |
| 761 | for (v = cliprect | |
| 761 | for (v = cliprect. | |
| 762 | 762 | { |
| 763 | 763 | UINT32 h; |
| 764 | 764 | UINT32 sp_data0=0,sp_data1=0,sp_data2=0; |
| r13798 | r13799 | |
|---|---|---|
| 845 | 845 | /* blank screen */ |
| 846 | 846 | if (state->m_vreg[0x3] == 0xc1 && state->m_vreg[0x4] == 0xc0 && state->m_vreg[0x5] == 0xff) |
| 847 | 847 | { |
| 848 | bitmap->fill(get_black_pen(screen.machine()), | |
| 848 | bitmap->fill(get_black_pen(screen.machine()), | |
| 849 | 849 | return 0; |
| 850 | 850 | } |
| 851 | 851 | |
| r13798 | r13799 | |
| 908 | 908 | } |
| 909 | 909 | |
| 910 | 910 | |
| 911 | bitmap->fill(get_black_pen(screen.machine()), | |
| 911 | bitmap->fill(get_black_pen(screen.machine()), | |
| 912 | 912 | |
| 913 | 913 | pri = (state->m_bank & 0x70) >> 4; |
| 914 | 914 | for (i = 0; i < 4; i++) |
| r13798 | r13799 | |
| 955 | 955 | } |
| 956 | 956 | |
| 957 | 957 | |
| 958 | bitmap->fill(get_black_pen(screen.machine()), | |
| 958 | bitmap->fill(get_black_pen(screen.machine()), | |
| 959 | 959 | |
| 960 | 960 | pri = (state->m_blitter_bank & 0x70) >> 4; |
| 961 | 961 | for (i = 0; i < 4; i++) |
| r13798 | r13799 | |
| 973 | 973 | /* blank screen */ |
| 974 | 974 | if (state->m_vreg[0x3] == 0xc1 && state->m_vreg[0x4] == 0xc0 && state->m_vreg[0x5] == 0xff) |
| 975 | 975 | { |
| 976 | bitmap->fill(get_black_pen(screen.machine()), | |
| 976 | bitmap->fill(get_black_pen(screen.machine()), | |
| 977 | 977 | return 0; |
| 978 | 978 | } |
| 979 | 979 |
| r13798 | r13799 | |
|---|---|---|
| 215 | 215 | } |
| 216 | 216 | |
| 217 | 217 | |
| 218 | static void draw_sprites(running_machine &machine, bitmap_t *bitmap, const rectangle | |
| 218 | static void draw_sprites(running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect) | |
| 219 | 219 | { |
| 220 | 220 | exidy_state *state = machine.driver_data<exidy_state>(); |
| 221 | 221 | /* draw sprite 2 first */ |
| r13798 | r13799 | |
| 296 | 296 | { |
| 297 | 297 | org_1_x = 236 - *state->m_sprite1_xpos - 4; |
| 298 | 298 | org_1_y = 244 - *state->m_sprite1_ypos - 4; |
| 299 | drawgfx_transpen(state->m_motion_object_1_vid, | |
| 299 | drawgfx_transpen(state->m_motion_object_1_vid, | |
| 300 | 300 | (*state->m_spriteno & 0x0f) + 16 * sprite_set_1, 0, |
| 301 | 301 | 0, 0, 0, 0, 0); |
| 302 | 302 | } |
| r13798 | r13799 | |
| 305 | 305 | state->m_motion_object_2_vid->fill(0xff, clip); |
| 306 | 306 | org_2_x = 236 - *state->m_sprite2_xpos - 4; |
| 307 | 307 | org_2_y = 244 - *state->m_sprite2_ypos - 4; |
| 308 | drawgfx_transpen(state->m_motion_object_2_vid, | |
| 308 | drawgfx_transpen(state->m_motion_object_2_vid, | |
| 309 | 309 | ((*state->m_spriteno >> 4) & 0x0f) + 32 + 16 * sprite_set_2, 0, |
| 310 | 310 | 0, 0, 0, 0, 0); |
| 311 | 311 | |
| r13798 | r13799 | |
| 315 | 315 | { |
| 316 | 316 | sx = org_2_x - org_1_x; |
| 317 | 317 | sy = org_2_y - org_1_y; |
| 318 | drawgfx_transpen(state->m_motion_object_2_clip, | |
| 318 | drawgfx_transpen(state->m_motion_object_2_clip, | |
| 319 | 319 | ((*state->m_spriteno >> 4) & 0x0f) + 32 + 16 * sprite_set_2, 0, |
| 320 | 320 | 0, 0, sx, sy, 0); |
| 321 | 321 | } |
| r13798 | r13799 | |
| 370 | 370 | copybitmap(bitmap, state->m_background_bitmap, 0, 0, 0, 0, cliprect); |
| 371 | 371 | |
| 372 | 372 | /* draw the sprites */ |
| 373 | draw_sprites(screen.machine(), bitmap, | |
| 373 | draw_sprites(screen.machine(), bitmap, cliprect); | |
| 374 | 374 | |
| 375 | 375 | /* check for collision, this will set the appropriate bits in collision_mask */ |
| 376 | 376 | check_collision(screen.machine()); |
| r13798 | r13799 | |
|---|---|---|
| 85 | 85 | } |
| 86 | 86 | |
| 87 | 87 | |
| 88 | static void draw_sprites(bitmap_t *bitmap, const rectangle | |
| 88 | static void draw_sprites(bitmap_t *bitmap, const rectangle &cliprect, const gfx_element *gfx) | |
| 89 | 89 | { |
| 90 | 90 | xxmissio_state *state = gfx->machine().driver_data<xxmissio_state>(); |
| 91 | 91 | int offs; |
| r13798 | r13799 | |
|---|---|---|
| 3 | 3 | #include "emu.h" |
| 4 | 4 | #include "includes/mugsmash.h" |
| 5 | 5 | |
| 6 | static void draw_sprites(running_machine &machine, bitmap_t *bitmap, const rectangle | |
| 6 | static void draw_sprites(running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect ) | |
| 7 | 7 | { |
| 8 | 8 | |
| 9 | 9 | /* Each Sprite takes 16 bytes, 5 used? */ |
| r13798 | r13799 | |
|---|---|---|
| 30 | 30 | } |
| 31 | 31 | } |
| 32 | 32 | |
| 33 | static void draw_sprites(running_machine &machine, bitmap_t *bitmap, const rectangle | |
| 33 | static void draw_sprites(running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect) | |
| 34 | 34 | { |
| 35 | 35 | pcktgal_state *state = machine.driver_data<pcktgal_state>(); |
| 36 | 36 | UINT8 *spriteram = state->m_spriteram; |
| r13798 | r13799 | |
|---|---|---|
| 237 | 237 | if (state->m_dispflag) |
| 238 | 238 | copybitmap(bitmap, state->m_tmpbitmap, state->m_flipscreen, state->m_flipscreen, 0, 0, cliprect); |
| 239 | 239 | else |
| 240 | bitmap->fill(RGB_BLACK, | |
| 240 | bitmap->fill(RGB_BLACK, | |
| 241 | 241 | |
| 242 | 242 | return 0; |
| 243 | 243 | } |
| r13798 | r13799 | |
|---|---|---|
| 92 | 92 | while (0) \ |
| 93 | 93 | |
| 94 | 94 | |
| 95 | static void pdrawgfx_transpen_additive(bitmap_t *dest, const rectangle | |
| 95 | static void pdrawgfx_transpen_additive(bitmap_t *dest, const rectangle &cliprect, const gfx_element *gfx, | |
| 96 | 96 | UINT32 code, UINT32 color, int flipx, int flipy, INT32 destx, INT32 desty, |
| 97 | 97 | bitmap_t *priority, UINT32 pmask, UINT32 transpen) |
| 98 | 98 | { |
| r13798 | r13799 | |
| 125 | 125 | } |
| 126 | 126 | |
| 127 | 127 | |
| 128 | static void pdrawgfxzoom_transpen_additive(bitmap_t *dest, const rectangle | |
| 128 | static void pdrawgfxzoom_transpen_additive(bitmap_t *dest, const rectangle &cliprect, const gfx_element *gfx, | |
| 129 | 129 | UINT32 code, UINT32 color, int flipx, int flipy, INT32 destx, INT32 desty, |
| 130 | 130 | UINT32 scalex, UINT32 scaley, bitmap_t *priority, UINT32 pmask, |
| 131 | 131 | UINT32 transpen) |
| r13798 | r13799 | |
| 207 | 207 | * 0x0e0 in Samurai Shodown/Xrally games, 0x1c0 in all the others, zooming factor? |
| 208 | 208 | */ |
| 209 | 209 | |
| 210 | static void draw_sprites(running_machine &machine, bitmap_t *bitmap, const rectangle | |
| 210 | static void draw_sprites(running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect) | |
| 211 | 211 | { |
| 212 | 212 | hng64_state *state = machine.driver_data<hng64_state>(); |
| 213 | 213 | const gfx_element *gfx; |
| r13798 | r13799 | |
| 431 | 431 | */ |
| 432 | 432 | |
| 433 | 433 | /* this is broken for the 'How to Play' screen in Buriki after attract, disabled for now */ |
| 434 | static void transition_control(running_machine &machine, bitmap_t *bitmap, const rectangle | |
| 434 | static void transition_control(running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect) | |
| 435 | 435 | { |
| 436 | 436 | hng64_state *state = machine.driver_data<hng64_state>(); |
| 437 | 437 | UINT32 *hng64_tcram = state->m_tcram; |
| r13798 | r13799 | |
| 455 | 455 | brigG = (INT32)((hng64_tcram[0x0000000a] >> 8) & 0xff); |
| 456 | 456 | brigB = (INT32)((hng64_tcram[0x0000000a] >> 16) & 0xff); |
| 457 | 457 | |
| 458 | for (i = cliprect | |
| 458 | for (i = cliprect. | |
| 459 | 459 | { |
| 460 | for (j = cliprect | |
| 460 | for (j = cliprect. | |
| 461 | 461 | { |
| 462 | 462 | UINT32* thePixel = &bitmap->pix32(j, i); |
| 463 | 463 | |
| r13798 | r13799 | |
| 705 | 705 | |
| 706 | 706 | |
| 707 | 707 | |
| 708 | static void hng64_configure_blit_parameters(blit_parameters *blit, tilemap_t *tmap, bitmap_t *dest, const rectangle | |
| 708 | static 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) | |
| 709 | 709 | { |
| 710 | 710 | /* start with nothing */ |
| 711 | 711 | memset(blit, 0, sizeof(*blit)); |
| r13798 | r13799 | |
| 714 | 714 | blit->bitmap = dest; |
| 715 | 715 | |
| 716 | 716 | /* if we have a cliprect, copy */ |
| 717 | if (cliprect != NULL) | |
| 718 | blit->cliprect = *cliprect; | |
| 717 | blit->cliprect = cliprect; | |
| 719 | 718 | |
| 720 | /* otherwise, make one up */ | |
| 721 | else | |
| 722 | blit->cliprect = dest->cliprect(); | |
| 723 | ||
| 724 | 719 | /* set the priority code and alpha */ |
| 725 | 720 | //blit->tilemap_priority_code = priority | (priority_mask << 8) | (tmap->palette_offset << 16); // fixit |
| 726 | 721 | blit->alpha = (flags & TILEMAP_DRAW_ALPHA_FLAG) ? (flags >> 24) : 0xff; |
| r13798 | r13799 | |
| 964 | 959 | |
| 965 | 960 | |
| 966 | 961 | |
| 967 | static void hng64_tilemap_draw_roz_primask(running_machine& machine, bitmap_t *dest, const rectangle | |
| 962 | static void hng64_tilemap_draw_roz_primask(running_machine& machine, bitmap_t *dest, const rectangle &cliprect, tilemap_t *tmap, | |
| 968 | 963 | UINT32 startx, UINT32 starty, int incxx, int incxy, int incyx, int incyy, |
| 969 | 964 | int wraparound, UINT32 flags, UINT8 priority, UINT8 priority_mask, hng64trans_t drawformat) |
| 970 | 965 | { |
| r13798 | r13799 | |
| 992 | 987 | } |
| 993 | 988 | |
| 994 | 989 | |
| 995 | INLINE void hng64_tilemap_draw_roz(running_machine& machine, bitmap_t *dest, const rectangle | |
| 990 | INLINE void hng64_tilemap_draw_roz(running_machine& machine, bitmap_t *dest, const rectangle &cliprect, tilemap_t *tmap, | |
| 996 | 991 | UINT32 startx, UINT32 starty, int incxx, int incxy, int incyx, int incyy, |
| 997 | 992 | int wraparound, UINT32 flags, UINT8 priority, hng64trans_t drawformat) |
| 998 | 993 | { |
| r13798 | r13799 | |
| 1001 | 996 | |
| 1002 | 997 | |
| 1003 | 998 | |
| 1004 | static void hng64_drawtilemap(running_machine& machine, bitmap_t *bitmap, const rectangle | |
| 999 | static void hng64_drawtilemap(running_machine& machine, bitmap_t *bitmap, const rectangle &cliprect, int tm ) | |
| 1005 | 1000 | { |
| 1006 | 1001 | hng64_state *state = machine.driver_data<hng64_state>(); |
| 1007 | 1002 | UINT32 *hng64_videoregs = state->m_videoregs; |
| r13798 | r13799 | |
| 1169 | 1164 | xinc = (xmiddle - xtopleft) / 512; |
| 1170 | 1165 | yinc = (ymiddle - ytopleft) / 512; |
| 1171 | 1166 | |
| 1172 | hng64_tilemap_draw_roz(machine, bitmap, | |
| 1167 | hng64_tilemap_draw_roz(machine, bitmap, | |
| 1173 | 1168 | xinc<<1,0,0,yinc<<1, |
| 1174 | 1169 | 1, |
| 1175 | 1170 | 0,0, debug_blend_enabled?HNG64_TILEMAP_ADDITIVE:HNG64_TILEMAP_NORMAL); |
| r13798 | r13799 | |
| 1464 | 1459 | } |
| 1465 | 1460 | #endif |
| 1466 | 1461 | |
| 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); | |
| 1469 | 1464 | |
| 1470 | 1465 | if (state->m_screen_dis) |
| 1471 | 1466 | return 0; |
| r13798 | r13799 | |
| 1545 | 1540 | int x, y; |
| 1546 | 1541 | |
| 1547 | 1542 | // Blit the color buffer into the primary bitmap |
| 1548 | for (y = cliprect | |
| 1543 | for (y = cliprect. | |
| 1549 | 1544 | { |
| 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); | |
| 1552 | 1547 | |
| 1553 | for (x = cliprect | |
| 1548 | for (x = cliprect. | |
| 1554 | 1549 | { |
| 1555 | 1550 | if(*src & 0xff000000) |
| 1556 | 1551 | *dst = *src; |
| r13798 | r13799 | |
|---|---|---|
| 76 | 76 | tilemap_set_transparent_pen(state->m_fg_tilemap, 0); |
| 77 | 77 | } |
| 78 | 78 | |
| 79 | static void draw_sprites(running_machine &machine, bitmap_t *bitmap, const rectangle | |
| 79 | static void draw_sprites(running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect ) | |
| 80 | 80 | { |
| 81 | 81 | solomon_state *state = machine.driver_data<solomon_state>(); |
| 82 | 82 | UINT8 *spriteram = state->m_spriteram; |
| r13798 | r13799 | |
|---|---|---|
| 173 | 173 | |
| 174 | 174 | |
| 175 | 175 | |
| 176 | static void draw_sprites(running_machine &machine, bitmap_t *bitmap, const rectangle | |
| 176 | static void draw_sprites(running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect, int priority ) | |
| 177 | 177 | { |
| 178 | 178 | macrossp_state *state = machine.driver_data<macrossp_state>(); |
| 179 | 179 | const gfx_element *gfx = machine.gfx[0]; |
| r13798 | r13799 | |
| 320 | 320 | } |
| 321 | 321 | |
| 322 | 322 | |
| 323 | static void draw_layer( running_machine &machine, bitmap_t *bitmap, const rectangle | |
| 323 | static void draw_layer( running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect, int layer ) | |
| 324 | 324 | { |
| 325 | 325 | macrossp_state *state = machine.driver_data<macrossp_state>(); |
| 326 | 326 | tilemap_t *tm; |
| r13798 | r13799 | |
| 392 | 392 | macrossp_state *state = screen.machine().driver_data<macrossp_state>(); |
| 393 | 393 | int layers[3],layerpri[3]; |
| 394 | 394 | |
| 395 | bitmap->fill(get_black_pen(screen.machine()), | |
| 395 | bitmap->fill(get_black_pen(screen.machine()), | |
| 396 | 396 | |
| 397 | 397 | layers[0] = 0; |
| 398 | 398 | layerpri[0] = (state->m_scra_videoregs[0] & 0x0000c000) >> 14; |
| r13798 | r13799 | |
|---|---|---|
| 200 | 200 | |
| 201 | 201 | ***************************************************************************/ |
| 202 | 202 | |
| 203 | static void draw_sprites(running_machine &machine, bitmap_t *bitmap, const rectangle | |
| 203 | static void draw_sprites(running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect) | |
| 204 | 204 | { |
| 205 | 205 | gladiatr_state *state = machine.driver_data<gladiatr_state>(); |
| 206 | 206 | int offs; |
| r13798 | r13799 | |
| 260 | 260 | /* the fg layer just selects the upper palette bank on underlying pixels */ |
| 261 | 261 | { |
| 262 | 262 | 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; | |
| 265 | 265 | |
| 266 | 266 | tilemap_get_pixmap( state->m_fg_tilemap ); |
| 267 | 267 | flagsbitmap = tilemap_get_flagsmap( state->m_fg_tilemap ); |
| 268 | 268 | |
| 269 | while( sy <= cliprect | |
| 269 | while( sy <= cliprect. | |
| 270 | 270 | { |
| 271 | 271 | int x = sx; |
| 272 | 272 | int y = (sy + state->m_fg_scrolly) & 0x1ff; |
| 273 | 273 | |
| 274 | 274 | UINT16 *dest = &bitmap->pix16(sy, sx); |
| 275 | while( x <= cliprect | |
| 275 | while( x <= cliprect. | |
| 276 | 276 | { |
| 277 | 277 | if( flagsbitmap->pix8(y, x)&TILEMAP_PIXEL_LAYER0 ) |
| 278 | 278 | { |
| r13798 | r13799 | |
| 308 | 308 | tilemap_draw(bitmap,cliprect,state->m_fg_tilemap,0,0); |
| 309 | 309 | } |
| 310 | 310 | else |
| 311 | bitmap->fill(get_black_pen(screen.machine()), | |
| 311 | bitmap->fill(get_black_pen(screen.machine()), | |
| 312 | 312 | return 0; |
| 313 | 313 | } |
| r13798 | r13799 | |
|---|---|---|
| 112 | 112 | k054338_update_all_shadows(state->m_k054338, 0); |
| 113 | 113 | k054338_fill_backcolor(state->m_k054338, bitmap, 0); |
| 114 | 114 | |
| 115 | screen.machine().priority_bitmap->fill(0, | |
| 115 | screen.machine().priority_bitmap->fill(0, | |
| 116 | 116 | |
| 117 | 117 | if (state->m_layerpri[0] < k053251_get_priority(state->m_k053251, K053251_CI1)) /* bucky hides back layer behind background */ |
| 118 | 118 | k056832_tilemap_draw(state->m_k056832, bitmap, cliprect, layers[0], 0, 1); |
| r13798 | r13799 | |
|---|---|---|
| 85 | 85 | |
| 86 | 86 | ***************************************************************************/ |
| 87 | 87 | |
| 88 | static void draw_sprites( running_machine &machine, bitmap_t *bitmap, const rectangle | |
| 88 | static void draw_sprites( running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect, int gfxbank, UINT8 *sprite_ram ) | |
| 89 | 89 | { |
| 90 | 90 | goindol_state *state = machine.driver_data<goindol_state>(); |
| 91 | 91 | int offs, sx, sy, tile, palette; |
| r13798 | r13799 | |
|---|---|---|
| 243 | 243 | plgirs2 bullets and raimais big bosses. |
| 244 | 244 | */ |
| 245 | 245 | |
| 246 | static void draw_sprites( running_machine &machine, bitmap_t *bitmap, const rectangle | |
| 246 | static void draw_sprites( running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect ) | |
| 247 | 247 | { |
| 248 | 248 | taitol_state *state = machine.driver_data<taitol_state>(); |
| 249 | 249 | int offs; |
| r13798 | r13799 | |
| 307 | 307 | |
| 308 | 308 | if (state->m_cur_ctrl & 0x20) /* display enable */ |
| 309 | 309 | { |
| 310 | screen.machine().priority_bitmap->fill(0, | |
| 310 | screen.machine().priority_bitmap->fill(0, | |
| 311 | 311 | |
| 312 | 312 | tilemap_draw(bitmap, cliprect, state->m_bg19_tilemap, 0, 0); |
| 313 | 313 | |
| r13798 | r13799 | |
| 321 | 321 | tilemap_draw(bitmap, cliprect, state->m_ch1a_tilemap, 0, 0); |
| 322 | 322 | } |
| 323 | 323 | else |
| 324 | bitmap->fill(screen.machine().pens[0], | |
| 324 | bitmap->fill(screen.machine().pens[0], | |
| 325 | 325 | return 0; |
| 326 | 326 | } |
| 327 | 327 |
| r13798 | r13799 | |
|---|---|---|
| 129 | 129 | } |
| 130 | 130 | |
| 131 | 131 | |
| 132 | static void draw_sprites( running_machine &machine, bitmap_t *bitmap, const rectangle | |
| 132 | static void draw_sprites( running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect, gfx_element **gfx ) | |
| 133 | 133 | { |
| 134 | 134 | gyruss_state *state = machine.driver_data<gyruss_state>(); |
| 135 | 135 | int offs; |
| r13798 | r13799 | |
| 154 | 154 | { |
| 155 | 155 | gyruss_state *state = screen.machine().driver_data<gyruss_state>(); |
| 156 | 156 | |
| 157 | if (cliprect | |
| 157 | if (cliprect. | |
| 158 | 158 | { |
| 159 | 159 | tilemap_mark_all_tiles_dirty_all(screen.machine()); |
| 160 | 160 | tilemap_set_flip_all(screen.machine(), (*state->m_flipscreen & 0x01) ? (TILEMAP_FLIPX | TILEMAP_FLIPY) : 0); |
| r13798 | r13799 | |
|---|---|---|
| 63 | 63 | |
| 64 | 64 | ***************************************************************/ |
| 65 | 65 | |
| 66 | static void draw_sprites(running_machine &machine, bitmap_t *bitmap,const rectangle | |
| 66 | static void draw_sprites(running_machine &machine, bitmap_t *bitmap,const rectangle &cliprect,int do_hack,int x_offs,int y_offs) | |
| 67 | 67 | { |
| 68 | 68 | groundfx_state *state = machine.driver_data<groundfx_state>(); |
| 69 | 69 | UINT32 *spriteram32 = state->m_spriteram; |
| r13798 | r13799 | |
| 183 | 183 | if (do_hack && sprite_ptr->pri==1 && sprite_ptr->y<100) |
| 184 | 184 | clipper=&state->m_hack_cliprect; |
| 185 | 185 | else |
| 186 | clipper=cliprect; | |
| 186 | clipper=&cliprect; | |
| 187 | 187 | |
| 188 | pdrawgfxzoom_transpen(bitmap,clipper,machine.gfx[sprite_ptr->gfx], | |
| 188 | pdrawgfxzoom_transpen(bitmap,*clipper,machine.gfx[sprite_ptr->gfx], | |
| 189 | 189 | sprite_ptr->code, |
| 190 | 190 | sprite_ptr->color, |
| 191 | 191 | sprite_ptr->flipx,sprite_ptr->flipy, |
| r13798 | r13799 | |
| 223 | 223 | pivlayer[1] = pivlayer[0]^1; |
| 224 | 224 | pivlayer[2] = 2; |
| 225 | 225 | |
| 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? */ | |
| 228 | 228 | |
| 229 | 229 | tc0100scn_tilemap_draw(tc0100scn, bitmap, cliprect, pivlayer[0], TILEMAP_DRAW_OPAQUE, 0); |
| 230 | 230 | tc0100scn_tilemap_draw(tc0100scn, bitmap, cliprect, pivlayer[1], 0, 0); |
| r13798 | r13799 | |
| 255 | 255 | //tc0100scn_tilemap_draw(tc0100scn, bitmap, cliprect, 0, pivlayer[2], 0, 0); |
| 256 | 256 | |
| 257 | 257 | if (tc0480scp_long_r(tc0480scp, 0x20 / 4, 0xffffffff) != 0x240866) /* Stupid hack for start of race */ |
| 258 | tc0480scp_tilemap_draw(tc0480scp, bitmap, | |
| 258 | tc0480scp_tilemap_draw(tc0480scp, bitmap, | |
| 259 | 259 | draw_sprites(screen.machine(), bitmap, cliprect, 1, 44, -574); |
| 260 | 260 | } |
| 261 | 261 | else |
| r13798 | r13799 | |
|---|---|---|
| 161 | 161 | rectangle finalclip0 = state->m_clip0, finalclip1 = state->m_clip1; |
| 162 | 162 | int i, xoffs; |
| 163 | 163 | |
| 164 | finalclip0 &= *cliprect; | |
| 165 | finalclip1 &= *cliprect; | |
| 164 | finalclip0 &= cliprect; | |
| 165 | finalclip1 &= cliprect; | |
| 166 | 166 | |
| 167 | 167 | set_pens(screen.machine()); |
| 168 | 168 | |
| r13798 | r13799 | |
| 173 | 173 | |
| 174 | 174 | tilemap_set_scrolly(state->m_layer0, 0, k007121_ctrlram_r(state->m_k007121, 2)); |
| 175 | 175 | |
| 176 | tilemap_draw(bitmap, | |
| 176 | tilemap_draw(bitmap, | |
| 177 | 177 | 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, | |
| 178 | tilemap_draw(bitmap, | |
| 179 | 179 | return 0; |
| 180 | 180 | } |
| r13798 | r13799 | |
|---|---|---|
| 157 | 157 | pens[x] = MAKE_RGB(pal1bit(x >> 2), pal1bit(x >> 1), pal1bit(x >> 0)); |
| 158 | 158 | |
| 159 | 159 | /* iterate over pixels */ |
| 160 | for (y = cliprect | |
| 160 | for (y = cliprect. | |
| 161 | 161 | { |
| 162 | 162 | UINT32 *dest = &bitmap->pix32(y); |
| 163 | 163 | |
| 164 | for (x = cliprect | |
| 164 | for (x = cliprect. | |
| 165 | 165 | { |
| 166 | 166 | UINT8 effxa = scrollx + ((x / 2) ^ xora); |
| 167 | 167 | UINT8 effya = scrolly + (y ^ xora); |
| r13798 | r13799 | |
|---|---|---|
| 105 | 105 | |
| 106 | 106 | ********************************************************************/ |
| 107 | 107 | |
| 108 | static void draw_sprites(running_machine &machine, bitmap_t *bitmap, const rectangle | |
| 108 | static void draw_sprites(running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect) | |
| 109 | 109 | { |
| 110 | 110 | cabal_state *state = machine.driver_data<cabal_state>(); |
| 111 | 111 | int offs,data0,data1,data2; |
| r13798 | r13799 | |
|---|---|---|
| 161 | 161 | |
| 162 | 162 | |
| 163 | 163 | |
| 164 | INLINE void draw_pixel(bitmap_t *bitmap,const rectangle | |
| 164 | INLINE void draw_pixel(bitmap_t *bitmap,const rectangle &cliprect,int x,int y,int color,int flip) | |
| 165 | 165 | { |
| 166 | 166 | if (flip) |
| 167 | 167 | { |
| r13798 | r13799 | |
| 169 | 169 | y = bitmap->height() - y - 1; |
| 170 | 170 | } |
| 171 | 171 | |
| 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) | |
| 176 | 176 | return; |
| 177 | 177 | |
| 178 | 178 | bitmap->pix16(y, x) = color; |
| 179 | 179 | } |
| 180 | 180 | |
| 181 | 181 | |
| 182 | static void draw_sprite(running_machine &machine, bitmap_t *bitmap,const rectangle | |
| 182 | static void draw_sprite(running_machine &machine, bitmap_t *bitmap,const rectangle &cliprect,int spr_number) | |
| 183 | 183 | { |
| 184 | 184 | suprloco_state *state = machine.driver_data<suprloco_state>(); |
| 185 | 185 | int flip = flip_screen_get(machine); |
| r13798 | r13799 | |
| 254 | 254 | } |
| 255 | 255 | } |
| 256 | 256 | |
| 257 | static void draw_sprites(running_machine &machine, bitmap_t *bitmap, const rectangle | |
| 257 | static void draw_sprites(running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect) | |
| 258 | 258 | { |
| 259 | 259 | suprloco_state *state = machine.driver_data<suprloco_state>(); |
| 260 | 260 | int spr_number; |
| r13798 | r13799 | |
|---|---|---|
| 323 | 323 | |
| 324 | 324 | /*****************************************************************************/ |
| 325 | 325 | |
| 326 | static void draw_sprites(running_machine &machine, bitmap_t *bitmap, const rectangle | |
| 326 | static void draw_sprites(running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect) | |
| 327 | 327 | { |
| 328 | 328 | m92_state *state = machine.driver_data<m92_state>(); |
| 329 | 329 | UINT16 *source = machine.generic.buffered_spriteram.u16; |
| r13798 | r13799 | |
| 397 | 397 | } |
| 398 | 398 | |
| 399 | 399 | // This needs a lot of work... |
| 400 | static void ppan_draw_sprites(running_machine &machine, bitmap_t *bitmap, const rectangle | |
| 400 | static void ppan_draw_sprites(running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect) | |
| 401 | 401 | { |
| 402 | 402 | m92_state *state = machine.driver_data<m92_state>(); |
| 403 | 403 | UINT16 *source = machine.generic.spriteram.u16; // sprite buffer control is never triggered |
| r13798 | r13799 | |
| 521 | 521 | |
| 522 | 522 | /*****************************************************************************/ |
| 523 | 523 | |
| 524 | static void m92_draw_tiles(running_machine &machine, bitmap_t *bitmap,const rectangle | |
| 524 | static void m92_draw_tiles(running_machine &machine, bitmap_t *bitmap,const rectangle &cliprect) | |
| 525 | 525 | { |
| 526 | 526 | m92_state *state = machine.driver_data<m92_state>(); |
| 527 | 527 | |
| r13798 | r13799 | |
| 547 | 547 | |
| 548 | 548 | SCREEN_UPDATE( m92 ) |
| 549 | 549 | { |
| 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); | |
| 552 | 552 | m92_update_scroll_positions(screen.machine()); |
| 553 | 553 | m92_draw_tiles(screen.machine(), bitmap, cliprect); |
| 554 | 554 | |
| r13798 | r13799 | |
| 564 | 564 | |
| 565 | 565 | SCREEN_UPDATE( ppan ) |
| 566 | 566 | { |
| 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); | |
| 569 | 569 | m92_update_scroll_positions(screen.machine()); |
| 570 | 570 | m92_draw_tiles(screen.machine(), bitmap, cliprect); |
| 571 | 571 |
| r13798 | r13799 | |
|---|---|---|
| 219 | 219 | |
| 220 | 220 | #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)); |
| 221 | 221 | |
| 222 | static void draw_sprites(running_machine &machine, bitmap_t *bitmap, const rectangle | |
| 222 | static void draw_sprites(running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect ) | |
| 223 | 223 | { |
| 224 | 224 | m58_state *state = machine.driver_data<m58_state>(); |
| 225 | 225 | int offs; |
| r13798 | r13799 | |
| 274 | 274 | * |
| 275 | 275 | *************************************/ |
| 276 | 276 | |
| 277 | static void draw_panel( running_machine &machine, bitmap_t *bitmap, const rectangle | |
| 277 | static void draw_panel( running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect ) | |
| 278 | 278 | { |
| 279 | 279 | m58_state *state = machine.driver_data<m58_state>(); |
| 280 | 280 | |
| r13798 | r13799 | |
| 284 | 284 | const rectangle clippanelflip(0*8, 6*8-1, 1*8, 31*8-1); |
| 285 | 285 | rectangle clip = flip_screen_get(machine) ? clippanelflip : clippanel; |
| 286 | 286 | const rectangle &visarea = machine.primary_screen->visible_area(); |
| 287 | int sx = flip_screen_get(machine) ? cliprect | |
| 287 | int sx = flip_screen_get(machine) ? cliprect. | |
| 288 | 288 | int yoffs = flip_screen_get(machine) ? -40 : -16; |
| 289 | 289 | |
| 290 | 290 | clip.min_y += visarea.min_y + yoffs; |
| 291 | 291 | clip.max_y += visarea.max_y + yoffs; |
| 292 | clip &= | |
| 292 | clip &= | |
| 293 | 293 | |
| 294 | 294 | copybitmap(bitmap, state->m_scroll_panel_bitmap, flip_screen_get(machine), flip_screen_get(machine), |
| 295 | sx, visarea.min_y + yoffs, | |
| 295 | sx, visarea.min_y + yoffs, | |
| 296 | 296 | } |
| 297 | 297 | } |
| 298 | 298 |
| r13798 | r13799 | |
|---|---|---|
| 73 | 73 | |
| 74 | 74 | konami_sortlayers3(layer, state->m_layerpri); |
| 75 | 75 | |
| 76 | screen.machine().priority_bitmap->fill(0, | |
| 76 | screen.machine().priority_bitmap->fill(0, | |
| 77 | 77 | k052109_tilemap_draw(state->m_k052109, bitmap, cliprect, layer[0], TILEMAP_DRAW_OPAQUE, 1); |
| 78 | 78 | k052109_tilemap_draw(state->m_k052109, bitmap, cliprect, layer[1], 0, 2); |
| 79 | 79 | k052109_tilemap_draw(state->m_k052109, bitmap, cliprect, layer[2], 0, 4); |
| r13798 | r13799 | |
|---|---|---|
| 50 | 50 | /* if no drawing is happening, fill with black and get out */ |
| 51 | 51 | if (!segaic16_display_enable) |
| 52 | 52 | { |
| 53 | bitmap->fill(get_black_pen(screen.machine()), | |
| 53 | bitmap->fill(get_black_pen(screen.machine()), | |
| 54 | 54 | return 0; |
| 55 | 55 | } |
| 56 | 56 | |
| 57 | 57 | /* reset priorities */ |
| 58 | screen.machine().priority_bitmap->fill(0, | |
| 58 | screen.machine().priority_bitmap->fill(0, | |
| 59 | 59 | |
| 60 | 60 | /* draw background opaquely first, not setting any priorities */ |
| 61 | 61 | segaic16_tilemap_draw(screen, bitmap, cliprect, 0, SEGAIC16_TILEMAP_BACKGROUND, 0 | TILEMAP_DRAW_OPAQUE, 0x00); |
| r13798 | r13799 | |
|---|---|---|
| 148 | 148 | 3 | xxxxxxxx xxxxxx-- | sprite code (low bits) |
| 149 | 149 | */ |
| 150 | 150 | |
| 151 | static void draw_sprites(running_machine &machine, bitmap_t *bitmap, const rectangle | |
| 151 | static void draw_sprites(running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect, int pri) | |
| 152 | 152 | { |
| 153 | 153 | thoop2_state *state = machine.driver_data<thoop2_state>(); |
| 154 | 154 | int j, x, y, ex, ey; |
| r13798 | r13799 | |
| 210 | 210 | |
| 211 | 211 | thoop2_sort_sprites(screen.machine()); |
| 212 | 212 | |
| 213 | bitmap->fill(0, | |
| 213 | bitmap->fill(0, | |
| 214 | 214 | |
| 215 | 215 | tilemap_draw(bitmap,cliprect,state->m_pant[1],TILEMAP_DRAW_LAYER1 | 3,0); |
| 216 | 216 | tilemap_draw(bitmap,cliprect,state->m_pant[0],TILEMAP_DRAW_LAYER1 | 3,0); |
| r13798 | r13799 | |
|---|---|---|
| 144 | 144 | sprite drawing could probably be improved a bit |
| 145 | 145 | *******************************************************************************/ |
| 146 | 146 | |
| 147 | static void draw_sprites(running_machine &machine, bitmap_t *bitmap, const rectangle | |
| 147 | static void draw_sprites(running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect ) | |
| 148 | 148 | { |
| 149 | 149 | wwfwfest_state *state = machine.driver_data<wwfwfest_state>(); |
| 150 | 150 | /*- SPR RAM Format -** |
| r13798 | r13799 | |
|---|---|---|
| 13 | 13 | flip_screen_set(screen.machine(), BIT(flip, 7)); |
| 14 | 14 | deco16ic_pf_update(state->m_deco_tilegen1, state->m_pf1_rowscroll, state->m_pf2_rowscroll); |
| 15 | 15 | |
| 16 | bitmap->fill(0, | |
| 16 | bitmap->fill(0, | |
| 17 | 17 | screen.machine().priority_bitmap->fill(0); |
| 18 | 18 | |
| 19 | 19 | deco16ic_tilemap_2_draw(state->m_deco_tilegen1, bitmap, cliprect, 0, 0); |
| r13798 | r13799 | |
| 32 | 32 | int tileno; |
| 33 | 33 | int colour; |
| 34 | 34 | |
| 35 | bitmap->fill(get_black_pen(screen.machine()), | |
| 35 | bitmap->fill(get_black_pen(screen.machine()), | |
| 36 | 36 | |
| 37 | 37 | /* the bootleg seems to treat the tilemaps as sprites */ |
| 38 | 38 | for (offset = 0; offset < 0x1600 / 2; offset += 8) |
| r13798 | r13799 | |
|---|---|---|
| 176 | 176 | * |
| 177 | 177 | *************************************/ |
| 178 | 178 | |
| 179 | static void draw_sprites( running_machine &machine, bitmap_t *bitmap, const rectangle | |
| 179 | static void draw_sprites( running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect ) | |
| 180 | 180 | { |
| 181 | 181 | timeplt_state *state = machine.driver_data<timeplt_state>(); |
| 182 | 182 | UINT8 *spriteram = state->m_spriteram; |
| r13798 | r13799 | |
|---|---|---|
| 184 | 184 | bitmap_t *priority_bitmap = screen.machine().priority_bitmap; |
| 185 | 185 | |
| 186 | 186 | /* draw the playfield */ |
| 187 | priority_bitmap->fill(0, | |
| 187 | priority_bitmap->fill(0, | |
| 188 | 188 | tilemap_draw(bitmap, cliprect, state->m_playfield_tilemap, 0, 0); |
| 189 | 189 | tilemap_draw(bitmap, cliprect, state->m_playfield_tilemap, 1, 1); |
| 190 | 190 | tilemap_draw(bitmap, cliprect, state->m_playfield_tilemap, 2, 2); |
| r13798 | r13799 | |
| 197 | 197 | /* copy the motion objects on top */ |
| 198 | 198 | { |
| 199 | 199 | 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; | |
| 204 | 204 | int x, y; |
| 205 | 205 | |
| 206 | 206 | /* now blend with the playfield */ |
| r13798 | r13799 | |
|---|---|---|
| 135 | 135 | |
| 136 | 136 | ***************************************************************************/ |
| 137 | 137 | |
| 138 | static void draw_sprites( screen_device &screen, bitmap_t *bitmap, const rectangle | |
| 138 | static void draw_sprites( screen_device &screen, bitmap_t *bitmap, const rectangle &cliprect ) | |
| 139 | 139 | { |
| 140 | 140 | fuuki16_state *state = screen.machine().driver_data<fuuki16_state>(); |
| 141 | 141 | int offs; |
| r13798 | r13799 | |
| 265 | 265 | ***************************************************************************/ |
| 266 | 266 | |
| 267 | 267 | /* Wrapper to handle bg and bg2 ttogether */ |
| 268 | static void fuuki16_draw_layer( running_machine &machine, bitmap_t *bitmap, const rectangle | |
| 268 | static void fuuki16_draw_layer( running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect, int i, int flag, int pri ) | |
| 269 | 269 | { |
| 270 | 270 | fuuki16_state *state = machine.driver_data<fuuki16_state>(); |
| 271 | 271 | int buffer = (state->m_vregs[0x1e / 2] & 0x40); |
| r13798 | r13799 | |
| 337 | 337 | // fuuki16_draw_layer(screen.machine(), bitmap, cliprect, tm_back, TILEMAP_DRAW_OPAQUE, 0); |
| 338 | 338 | |
| 339 | 339 | /* 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); | |
| 342 | 342 | |
| 343 | 343 | fuuki16_draw_layer(screen.machine(), bitmap, cliprect, tm_back, 0, 1); |
| 344 | 344 | fuuki16_draw_layer(screen.machine(), bitmap, cliprect, tm_middle, 0, 2); |
| r13798 | r13799 | |
|---|---|---|
| 171 | 171 | |
| 172 | 172 | ***************************************************************************/ |
| 173 | 173 | |
| 174 | static void draw_sprites(running_machine &machine, bitmap_t *bitmap,const rectangle | |
| 174 | static void draw_sprites(running_machine &machine, bitmap_t *bitmap,const rectangle &cliprect) | |
| 175 | 175 | { |
| 176 | 176 | vulgus_state *state = machine.driver_data<vulgus_state>(); |
| 177 | 177 | UINT8 *spriteram = state->m_spriteram; |
| r13798 | r13799 | |
|---|---|---|
| 44 | 44 | state->m_bg_tilemap = tilemap_create(machine, get_bg_tile_info, tilemap_scan_rows, 8, 8, 32, 32); |
| 45 | 45 | } |
| 46 | 46 | |
| 47 | static void draw_line( bitmap_t *bitmap, const rectangle | |
| 47 | static void draw_line( bitmap_t *bitmap, const rectangle &cliprect, int x1, int y1, int x2, int y2, int dotted ) | |
| 48 | 48 | { |
| 49 | 49 | /* Draws horizontal and Vertical lines only! */ |
| 50 | 50 | int count, skip; |
| r13798 | r13799 | |
| 63 | 63 | bitmap->pix16(y1, count) = 1; |
| 64 | 64 | } |
| 65 | 65 | |
| 66 | static void draw_sprite_collision( running_machine &machine, bitmap_t *bitmap, const rectangle | |
| 66 | static void draw_sprite_collision( running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect ) | |
| 67 | 67 | { |
| 68 | 68 | circus_state *state = machine.driver_data<circus_state>(); |
| 69 | 69 | const gfx_element *sprite_gfx = machine.gfx[1]; |
| r13798 | r13799 | |
| 97 | 97 | device_set_input_line(state->m_maincpu, 0, ASSERT_LINE); |
| 98 | 98 | } |
| 99 | 99 | |
| 100 | static void circus_draw_fg( running_machine &machine, bitmap_t *bitmap, const rectangle | |
| 100 | static void circus_draw_fg( running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect ) | |
| 101 | 101 | { |
| 102 | 102 | /* The sync generator hardware is used to */ |
| 103 | 103 | /* draw the border and diving boards */ |
| r13798 | r13799 | |
| 122 | 122 | return 0; |
| 123 | 123 | } |
| 124 | 124 | |
| 125 | static void robotbwl_draw_box( bitmap_t *bitmap, const rectangle | |
| 125 | static void robotbwl_draw_box( bitmap_t *bitmap, const rectangle &cliprect, int x, int y ) | |
| 126 | 126 | { |
| 127 | 127 | /* Box */ |
| 128 | 128 | int ex = x + 24; |
| r13798 | r13799 | |
| 140 | 140 | draw_line(bitmap, cliprect, x + 16, y, x + 16, ey, 0); |
| 141 | 141 | } |
| 142 | 142 | |
| 143 | static void robotbwl_draw_scoreboard( bitmap_t *bitmap, const rectangle | |
| 143 | static void robotbwl_draw_scoreboard( bitmap_t *bitmap, const rectangle &cliprect ) | |
| 144 | 144 | { |
| 145 | 145 | int offs; |
| 146 | 146 | |
| r13798 | r13799 | |
| 165 | 165 | draw_line(bitmap, cliprect, 39 + 152, 137, 47 + 152, 137, 0); |
| 166 | 166 | } |
| 167 | 167 | |
| 168 | static void robotbwl_draw_bowling_alley( bitmap_t *bitmap, const rectangle | |
| 168 | static void robotbwl_draw_bowling_alley( bitmap_t *bitmap, const rectangle &cliprect ) | |
| 169 | 169 | { |
| 170 | 170 | draw_line(bitmap, cliprect, 103, 17, 103, 205, 0); |
| 171 | 171 | draw_line(bitmap, cliprect, 111, 17, 111, 203, 1); |
| r13798 | r13799 | |
| 173 | 173 | draw_line(bitmap, cliprect, 144, 17, 144, 203, 1); |
| 174 | 174 | } |
| 175 | 175 | |
| 176 | static void robotbwl_draw_ball( running_machine &machine, bitmap_t *bitmap, const rectangle | |
| 176 | static void robotbwl_draw_ball( running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect ) | |
| 177 | 177 | { |
| 178 | 178 | circus_state *state = machine.driver_data<circus_state>(); |
| 179 | 179 | drawgfx_transpen(bitmap,/* Y is horizontal position */ |
| r13798 | r13799 | |
| 194 | 194 | return 0; |
| 195 | 195 | } |
| 196 | 196 | |
| 197 | static void crash_draw_car( running_machine &machine, bitmap_t *bitmap, const rectangle | |
| 197 | static void crash_draw_car( running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect ) | |
| 198 | 198 | { |
| 199 | 199 | circus_state *state = machine.driver_data<circus_state>(); |
| 200 | 200 | drawgfx_transpen(bitmap,/* Y is horizontal position */ |
| r13798 | r13799 | |
|---|---|---|
| 65 | 65 | } |
| 66 | 66 | |
| 67 | 67 | |
| 68 | static void draw_sprites(running_machine &machine, bitmap_t *bitmap,const rectangle | |
| 68 | static void draw_sprites(running_machine &machine, bitmap_t *bitmap,const rectangle &cliprect,int codeshift) | |
| 69 | 69 | { |
| 70 | 70 | sderby_state *state = machine.driver_data<sderby_state>(); |
| 71 | 71 | UINT16 *spriteram16 = state->m_spriteram; |
| r13798 | r13799 | |
|---|---|---|
| 67 | 67 | |
| 68 | 68 | /* Draw first sprite */ |
| 69 | 69 | |
| 70 | drawgfx_opaque(state->m_spritebitmap, | |
| 70 | drawgfx_opaque(state->m_spritebitmap,state->m_spritebitmap->cliprect(), machine.gfx[expand], | |
| 71 | 71 | first * 2, |
| 72 | 72 | 0, |
| 73 | 73 | 0,0, |
| r13798 | r13799 | |
| 93 | 93 | |
| 94 | 94 | /* Blackout second sprite */ |
| 95 | 95 | |
| 96 | drawgfx_transpen(state->m_spritebitmap, | |
| 96 | drawgfx_transpen(state->m_spritebitmap,state->m_spritebitmap->cliprect(), machine.gfx[1], | |
| 97 | 97 | second * 2, |
| 98 | 98 | 1, |
| 99 | 99 | 0,0, |
| r13798 | r13799 | |
| 119 | 119 | |
| 120 | 120 | /* Zero bitmap */ |
| 121 | 121 | |
| 122 | drawgfx_opaque(state->m_spritebitmap, | |
| 122 | drawgfx_opaque(state->m_spritebitmap,state->m_spritebitmap->cliprect(), machine.gfx[expand], | |
| 123 | 123 | first * 2, |
| 124 | 124 | 1, |
| 125 | 125 | 0,0, |
| r13798 | r13799 | |
| 151 | 151 | gfx_element_set_source(machine.gfx[2], state->m_s2636_0_ram); |
| 152 | 152 | } |
| 153 | 153 | |
| 154 | static void draw_sprites(running_machine &machine, bitmap_t *bitmap) | |
| 154 | static void draw_sprites(running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect) | |
| 155 | 155 | { |
| 156 | 156 | zac2650_state *state = machine.driver_data<zac2650_state>(); |
| 157 | 157 | int offs; |
| r13798 | r13799 | |
| 171 | 171 | state->m_CollisionBackground = 0; /* Read from 0x1e80 bit 7 */ |
| 172 | 172 | |
| 173 | 173 | // for collision detection checking |
| 174 | copybitmap(machine.generic.tmpbitmap,bitmap,0,0,0,0, | |
| 174 | copybitmap(machine.generic.tmpbitmap,bitmap,0,0,0,0, | |
| 175 | 175 | |
| 176 | 176 | for(offs=0;offs<0x50;offs+=0x10) |
| 177 | 177 | { |
| r13798 | r13799 | |
| 184 | 184 | int x,y; |
| 185 | 185 | |
| 186 | 186 | /* Sprite->Background collision detection */ |
| 187 | drawgfx_transpen(bitmap, | |
| 187 | drawgfx_transpen(bitmap,cliprect, machine.gfx[expand], | |
| 188 | 188 | spriteno, |
| 189 | 189 | 1, |
| 190 | 190 | 0,0, |
| r13798 | r13799 | |
| 210 | 210 | } |
| 211 | 211 | } |
| 212 | 212 | |
| 213 | drawgfx_transpen(bitmap, | |
| 213 | drawgfx_transpen(bitmap,cliprect, machine.gfx[expand], | |
| 214 | 214 | spriteno, |
| 215 | 215 | 0, |
| 216 | 216 | 0,0, |
| r13798 | r13799 | |
| 232 | 232 | { |
| 233 | 233 | zac2650_state *state = screen.machine().driver_data<zac2650_state>(); |
| 234 | 234 | tilemap_draw(bitmap, cliprect, state->m_bg_tilemap, 0, 0); |
| 235 | draw_sprites(screen.machine(), bitmap); | |
| 235 | draw_sprites(screen.machine(), bitmap, cliprect); | |
| 236 | 236 | return 0; |
| 237 | 237 | } |
| r13798 | r13799 | |
|---|---|---|
| 213 | 213 | if (flipy) dy = sy + sizey-15 - dy; |
| 214 | 214 | else dy = sy + dy; |
| 215 | 215 | |
| 216 | drawgfx_transpen(rawbitmap, | |
| 216 | drawgfx_transpen(rawbitmap, | |
| 217 | 217 | (tile & 0x0fff) | (code & 0xf000), |
| 218 | 218 | (tile >> 12) | (color & 0x70), |
| 219 | 219 | flipx,flipy, |
| r13798 | r13799 | |
| 226 | 226 | int w; |
| 227 | 227 | |
| 228 | 228 | if (zoomx <= 1 && zoomy <= 1) |
| 229 | drawgfxzoom_transtable(rawbitmap, | |
| 229 | drawgfxzoom_transtable(rawbitmap, | |
| 230 | 230 | code, |
| 231 | 231 | color, |
| 232 | 232 | flipx,flipy, |
| r13798 | r13799 | |
| 239 | 239 | |
| 240 | 240 | for (x = 0;x < w;x++) |
| 241 | 241 | { |
| 242 | drawgfxzoom_transtable(rawbitmap, | |
| 242 | drawgfxzoom_transtable(rawbitmap, | |
| 243 | 243 | code, |
| 244 | 244 | color, |
| 245 | 245 | flipx,flipy, |
| r13798 | r13799 | |
|---|---|---|
| 137 | 137 | |
| 138 | 138 | ***************************************************************************/ |
| 139 | 139 | |
| 140 | static void draw_sprites(running_machine &machine, bitmap_t *bitmap,const rectangle | |
| 140 | static void draw_sprites(running_machine &machine, bitmap_t *bitmap,const rectangle &cliprect) | |
| 141 | 141 | { |
| 142 | 142 | vastar_state *state = machine.driver_data<vastar_state>(); |
| 143 | 143 | UINT8 *spriteram = state->m_spriteram1; |
| r13798 | r13799 | |
|---|---|---|
| 25 | 25 | /* sprites are like the other video system / psikyo games, we can merge this with aerofgt and plenty of other |
| 26 | 26 | things eventually */ |
| 27 | 27 | |
| 28 | static void draw_sprite(running_machine &machine, UINT16 spriteno, bitmap_t *bitmap, const rectangle | |
| 28 | static void draw_sprite(running_machine &machine, UINT16 spriteno, bitmap_t *bitmap, const rectangle &cliprect ) | |
| 29 | 29 | { |
| 30 | 30 | taotaido_state *state = machine.driver_data<taotaido_state>(); |
| 31 | 31 | /*- SPR RAM Format -** |
| r13798 | r13799 | |
| 109 | 109 | } |
| 110 | 110 | } |
| 111 | 111 | |
| 112 | static void draw_sprites(running_machine &machine, bitmap_t *bitmap, const rectangle | |
| 112 | static void draw_sprites(running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect ) | |
| 113 | 113 | { |
| 114 | 114 | taotaido_state *state = machine.driver_data<taotaido_state>(); |
| 115 | 115 | /* first part of sprite ram is the list of sprites to draw, terminated with 0x4000 */ |
| r13798 | r13799 | |
| 220 | 220 | tilemap_set_scrollx(state->m_bg_tilemap,0,((state->m_scrollram[(0x00+4*line)/2])>>4)+30); |
| 221 | 221 | tilemap_set_scrolly(state->m_bg_tilemap,0,((state->m_scrollram[(0x02+4*line)/2])>>4)-line); |
| 222 | 222 | |
| 223 | tilemap_draw(bitmap, | |
| 223 | tilemap_draw(bitmap, | |
| 224 | 224 | } |
| 225 | 225 | |
| 226 | 226 | draw_sprites(screen.machine(), bitmap,cliprect); |
| r13798 | r13799 | |
|---|---|---|
| 117 | 117 | int x, y, r; |
| 118 | 118 | |
| 119 | 119 | /* draw the playfield */ |
| 120 | priority_bitmap->fill(0, | |
| 120 | priority_bitmap->fill(0, | |
| 121 | 121 | tilemap_draw(bitmap, cliprect, state->m_playfield_tilemap, 0, 0); |
| 122 | 122 | tilemap_draw(bitmap, cliprect, state->m_playfield2_tilemap, 0, 1); |
| 123 | 123 |
| r13798 | r13799 | |
|---|---|---|
| 2168 | 2168 | |
| 2169 | 2169 | /******************************************************************************/ |
| 2170 | 2170 | |
| 2171 | static void scanline_draw(running_machine &machine, bitmap_t *bitmap, const rectangle | |
| 2171 | static void scanline_draw(running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect) | |
| 2172 | 2172 | { |
| 2173 | 2173 | taito_f3_state *state = machine.driver_data<taito_f3_state>(); |
| 2174 | 2174 | int i,j,y,ys,ye; |
| r13798 | r13799 | |
| 2597 | 2597 | pri++; |
| 2598 | 2598 | |
| 2599 | 2599 | INLINE void f3_drawgfx( |
| 2600 | bitmap_t *dest_bmp,const rectangle | |
| 2600 | bitmap_t *dest_bmp,const rectangle &clip,const gfx_element *gfx, | |
| 2601 | 2601 | int code, |
| 2602 | 2602 | int color, |
| 2603 | 2603 | int flipx,int flipy, |
| r13798 | r13799 | |
| 2610 | 2610 | pri_dst=1<<pri_dst; |
| 2611 | 2611 | |
| 2612 | 2612 | /* 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(); | |
| 2619 | 2615 | |
| 2620 | 2616 | |
| 2621 | 2617 | if( gfx ) |
| r13798 | r13799 | |
| 2654 | 2650 | y_index = 0; |
| 2655 | 2651 | } |
| 2656 | 2652 | |
| 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; | |
| 2682 | 2658 | } |
| 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 | } | |
| 2683 | 2676 | |
| 2684 | 2677 | if( ex>sx && ey>sy) |
| 2685 | 2678 | { /* skip if inner loop doesn't draw anything */ |
| r13798 | r13799 | |
| 2753 | 2746 | |
| 2754 | 2747 | |
| 2755 | 2748 | INLINE void f3_drawgfxzoom( |
| 2756 | bitmap_t *dest_bmp,const rectangle | |
| 2749 | bitmap_t *dest_bmp,const rectangle &clip,const gfx_element *gfx, | |
| 2757 | 2750 | int code, |
| 2758 | 2751 | int color, |
| 2759 | 2752 | int flipx,int flipy, |
| r13798 | r13799 | |
| 2767 | 2760 | pri_dst=1<<pri_dst; |
| 2768 | 2761 | |
| 2769 | 2762 | /* 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(); | |
| 2776 | 2765 | |
| 2777 | 2766 | |
| 2778 | 2767 | if( gfx ) |
| r13798 | r13799 | |
| 2811 | 2800 | y_index = 0; |
| 2812 | 2801 | } |
| 2813 | 2802 | |
| 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; | |
| 2839 | 2808 | } |
| 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 | } | |
| 2840 | 2826 | |
| 2841 | 2827 | if( ex>sx ) |
| 2842 | 2828 | { /* skip if inner loop doesn't draw anything */ |
| r13798 | r13799 | |
| 3148 | 3134 | #undef CALC_ZOOM |
| 3149 | 3135 | |
| 3150 | 3136 | |
| 3151 | static void draw_sprites(running_machine &machine, bitmap_t *bitmap, const rectangle | |
| 3137 | static void draw_sprites(running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect) | |
| 3152 | 3138 | { |
| 3153 | 3139 | taito_f3_state *state = machine.driver_data<taito_f3_state>(); |
| 3154 | 3140 | const struct tempsprite *sprite_ptr; |
| r13798 | r13799 | |
| 3229 | 3215 | sy_fix[4]=-sy_fix[4]; |
| 3230 | 3216 | } |
| 3231 | 3217 | |
| 3232 | state->m_pri_alp_bitmap->fill(0, | |
| 3218 | state->m_pri_alp_bitmap->fill(0, | |
| 3233 | 3219 | |
| 3234 | 3220 | /* sprites */ |
| 3235 | 3221 | if (state->m_sprite_lag==0) |
| r13798 | r13799 | |
|---|---|---|
| 339 | 339 | |
| 340 | 340 | ***************************************************************************/ |
| 341 | 341 | |
| 342 | static void draw_sprites(screen_device &screen, bitmap_t *bitmap, const rectangle | |
| 342 | static void draw_sprites(screen_device &screen, bitmap_t *bitmap, const rectangle &cliprect, int mask, int xoffs) | |
| 343 | 343 | { |
| 344 | 344 | gaelco2_state *state = screen.machine().driver_data<gaelco2_state>(); |
| 345 | 345 | UINT16 *buffered_spriteram16 = screen.machine().generic.buffered_spriteram.u16; |
| r13798 | r13799 | |
| 402 | 402 | |
| 403 | 403 | int gfx_py = yflip ? (gfx->height - 1 - py) : py; |
| 404 | 404 | |
| 405 | if ((ypos < cliprect | |
| 405 | if ((ypos < cliprect. | |
| 406 | 406 | |
| 407 | 407 | for (px = 0; px < gfx->width; px++){ |
| 408 | 408 | /* get current pixel */ |
| r13798 | r13799 | |
| 417 | 417 | |
| 418 | 418 | if ((gfx_pen == 0) || (gfx_pen >= 16)) continue; |
| 419 | 419 | |
| 420 | if ((xpos < cliprect | |
| 420 | if ((xpos < cliprect. | |
| 421 | 421 | |
| 422 | 422 | /* make background color darker or brighter */ |
| 423 | 423 | *pixel = src_color + 4096*gfx_pen; |
| r13798 | r13799 | |
| 458 | 458 | } |
| 459 | 459 | |
| 460 | 460 | /* draw screen */ |
| 461 | bitmap->fill(0, | |
| 461 | bitmap->fill(0, | |
| 462 | 462 | |
| 463 | 463 | tilemap_draw(bitmap, cliprect, state->m_pant[1], 0, 0); |
| 464 | 464 | tilemap_draw(bitmap, cliprect, state->m_pant[0], 0, 0); |
| r13798 | r13799 | |
| 466 | 466 | return 0; |
| 467 | 467 | } |
| 468 | 468 | |
| 469 | static UINT32 dual_update(screen_device &screen, bitmap_t *bitmap, const rectangle | |
| 469 | static UINT32 dual_update(screen_device &screen, bitmap_t *bitmap, const rectangle &cliprect, int index) | |
| 470 | 470 | { |
| 471 | 471 | gaelco2_state *state = screen.machine().driver_data<gaelco2_state>(); |
| 472 | 472 | int i; |
| r13798 | r13799 | |
| 488 | 488 | } |
| 489 | 489 | |
| 490 | 490 | /* draw screen */ |
| 491 | bitmap->fill(0, | |
| 491 | bitmap->fill(0, | |
| 492 | 492 | |
| 493 | 493 | tilemap_draw(bitmap,cliprect,state->m_pant[index], 0, 0); |
| 494 | 494 | draw_sprites(screen,bitmap,cliprect, 0x8000 * index, 0); |
| r13798 | r13799 | |
|---|---|---|
| 59 | 59 | state->m_tilemap = tilemap_create(machine, get_homerun_tile_info, tilemap_scan_rows, 8, 8, 64, 64); |
| 60 | 60 | } |
| 61 | 61 | |
| 62 | static void draw_sprites( running_machine &machine, bitmap_t *bitmap, const rectangle | |
| 62 | static void draw_sprites( running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect ) | |
| 63 | 63 | { |
| 64 | 64 | homerun_state *state = machine.driver_data<homerun_state>(); |
| 65 | 65 | UINT8 *spriteram = state->m_spriteram; |
| r13798 | r13799 | |
| 85 | 85 | SCREEN_UPDATE(homerun) |
| 86 | 86 | { |
| 87 | 87 | homerun_state *state = screen.machine().driver_data<homerun_state>(); |
| 88 | rectangle myclip = | |
| 88 | rectangle myclip = | |
| 89 | 89 | |
| 90 | 90 | /* upper part */ |
| 91 | 91 | tilemap_set_scrollx(state->m_tilemap, 0, state->m_xpc + ((state->m_xpa & 2) << 7) ); |
| r13798 | r13799 | |
| 93 | 93 | |
| 94 | 94 | myclip.max_y /= 2; |
| 95 | 95 | 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); | |
| 98 | 98 | |
| 99 | 99 | /* lower part */ |
| 100 | 100 | myclip.min_y += myclip.max_y; |
| 101 | 101 | myclip.max_y *= 2; |
| 102 | 102 | 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); | |
| 105 | 105 | |
| 106 | 106 | state->m_gc_down = state->m_gc_up; |
| 107 | 107 | return 0; |
| r13798 | r13799 | |
|---|---|---|
| 193 | 193 | |
| 194 | 194 | |
| 195 | 195 | |
| 196 | static void champbas_draw_sprites( running_machine &machine, bitmap_t *bitmap, const rectangle | |
| 196 | static void champbas_draw_sprites( running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect ) | |
| 197 | 197 | { |
| 198 | 198 | champbas_state *state = machine.driver_data<champbas_state>(); |
| 199 | 199 | int offs; |
| r13798 | r13799 | |
| 225 | 225 | } |
| 226 | 226 | } |
| 227 | 227 | |
| 228 | static void exctsccr_draw_sprites( running_machine &machine, bitmap_t *bitmap, const rectangle | |
| 228 | static void exctsccr_draw_sprites( running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect ) | |
| 229 | 229 | { |
| 230 | 230 | champbas_state *state = machine.driver_data<champbas_state>(); |
| 231 | 231 | int offs; |
| r13798 | r13799 | |
|---|---|---|
| 217 | 217 | |
| 218 | 218 | ***************************************************************************/ |
| 219 | 219 | |
| 220 | static void draw_sprites(running_machine &machine, bitmap_t *bitmap, const rectangle | |
| 220 | static void draw_sprites(running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect, int sprite_priority) | |
| 221 | 221 | { |
| 222 | 222 | baraduke_state *state = machine.driver_data<baraduke_state>(); |
| 223 | 223 | UINT8 *spriteram = state->m_spriteram + 0x1800; |
| r13798 | r13799 | |
|---|---|---|
| 150 | 150 | tilemap_set_transparent_pen(state->m_fg_tilemap, 0); |
| 151 | 151 | } |
| 152 | 152 | |
| 153 | static void draw_sprites(running_machine &machine, bitmap_t *bitmap, const rectangle | |
| 153 | static void draw_sprites(running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect) | |
| 154 | 154 | { |
| 155 | 155 | ssozumo_state *state = machine.driver_data<ssozumo_state>(); |
| 156 | 156 | UINT8 *spriteram = state->m_spriteram; |
| r13798 | r13799 | |
|---|---|---|
| 255 | 255 | * |
| 256 | 256 | *************************************/ |
| 257 | 257 | |
| 258 | static void render_sprites_91399(running_machine &machine, bitmap_t *bitmap, const rectangle | |
| 258 | static void render_sprites_91399(running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect) | |
| 259 | 259 | { |
| 260 | 260 | UINT8 *spriteram = machine.generic.spriteram.u8; |
| 261 | 261 | const gfx_element *gfx = machine.gfx[1]; |
| r13798 | r13799 | |
| 290 | 290 | |
| 291 | 291 | /* loop over lines in the sprite */ |
| 292 | 292 | for (y = 0; y < 32; y++, sy = (sy + 1) & 0x1ff) |
| 293 | if (sy >= cliprect | |
| 293 | if (sy >= cliprect. | |
| 294 | 294 | { |
| 295 | 295 | const UINT8 *src = gfx_element_get_data(gfx, code) + gfx->line_modulo * (y ^ vflip); |
| 296 | 296 | UINT16 *dst = &bitmap->pix16(sy); |
| r13798 | r13799 | |
| 327 | 327 | * |
| 328 | 328 | *************************************/ |
| 329 | 329 | |
| 330 | static void render_sprites_91464(running_machine &machine, bitmap_t *bitmap, const rectangle | |
| 330 | static void render_sprites_91464(running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect, int primask, int sprmask, int colormask) | |
| 331 | 331 | { |
| 332 | 332 | UINT8 *spriteram = machine.generic.spriteram.u8; |
| 333 | 333 | const gfx_element *gfx = machine.gfx[1]; |
| r13798 | r13799 | |
| 361 | 361 | |
| 362 | 362 | /* loop over lines in the sprite */ |
| 363 | 363 | for (y = 0; y < 32; y++, sy = (sy + 1) & 0x1ff) |
| 364 | if (sy >= 2 && sy >= cliprect | |
| 364 | if (sy >= 2 && sy >= cliprect. | |
| 365 | 365 | { |
| 366 | 366 | const UINT8 *src = gfx_element_get_data(gfx, code) + gfx->line_modulo * (y ^ vflip); |
| 367 | 367 | UINT16 *dst = &bitmap->pix16(sy); |
| r13798 | r13799 | |
| 407 | 407 | tilemap_set_flip(bg_tilemap, mcr_cocktail_flip ? (TILEMAP_FLIPX | TILEMAP_FLIPY) : 0); |
| 408 | 408 | |
| 409 | 409 | /* draw the background */ |
| 410 | screen.machine().priority_bitmap->fill(0, | |
| 410 | screen.machine().priority_bitmap->fill(0, | |
| 411 | 411 | tilemap_draw(bitmap, cliprect, bg_tilemap, 0, 0x00); |
| 412 | 412 | tilemap_draw(bitmap, cliprect, bg_tilemap, 1, 0x10); |
| 413 | 413 | tilemap_draw(bitmap, cliprect, bg_tilemap, 2, 0x20); |
| r13798 | r13799 | |
|---|---|---|
| 150 | 150 | |
| 151 | 151 | /*****************************************************************************/ |
| 152 | 152 | |
| 153 | static void draw_sprites(running_machine &machine, bitmap_t *bitmap, const rectangle | |
| 153 | static void draw_sprites(running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect) | |
| 154 | 154 | { |
| 155 | 155 | m107_state *state = machine.driver_data<m107_state>(); |
| 156 | 156 | UINT16 *spriteram = state->m_buffered_spriteram; |
| r13798 | r13799 | |
| 313 | 313 | |
| 314 | 314 | /*****************************************************************************/ |
| 315 | 315 | |
| 316 | static void m107_tilemap_draw(running_machine &machine, bitmap_t *bitmap, const rectangle | |
| 316 | static void m107_tilemap_draw(running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect, int laynum, int category,int opaque) | |
| 317 | 317 | { |
| 318 | 318 | m107_state *state = machine.driver_data<m107_state>(); |
| 319 | 319 | int line; |
| r13798 | r13799 | |
| 326 | 326 | |
| 327 | 327 | if (state->m_control[0x08 + laynum] & 0x02) |
| 328 | 328 | { |
| 329 | for (line = cliprect | |
| 329 | for (line = cliprect. | |
| 330 | 330 | { |
| 331 | 331 | const UINT16 *scrolldata = state->m_vram_data + (0xe800 + 0x200 * laynum) / 2; |
| 332 | 332 | clip.min_y = clip.max_y = line; |
| r13798 | r13799 | |
| 334 | 334 | tilemap_set_scrollx(state->m_pf_layer[laynum].tmap,0, state->m_control[1 + 2 * laynum]); |
| 335 | 335 | tilemap_set_scrolly(state->m_pf_layer[laynum].tmap,0, (state->m_control[0 + 2 * laynum] + scrolldata[line])); |
| 336 | 336 | |
| 337 | tilemap_draw(bitmap, | |
| 337 | tilemap_draw(bitmap, | |
| 338 | 338 | } |
| 339 | 339 | } |
| 340 | 340 | else |
| r13798 | r13799 | |
| 342 | 342 | } |
| 343 | 343 | |
| 344 | 344 | |
| 345 | static void m107_screenrefresh(running_machine &machine, bitmap_t *bitmap, const rectangle | |
| 345 | static void m107_screenrefresh(running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect) | |
| 346 | 346 | { |
| 347 | 347 | m107_state *state = machine.driver_data<m107_state>(); |
| 348 | machine.priority_bitmap->fill(0, | |
| 348 | machine.priority_bitmap->fill(0, | |
| 349 | 349 | |
| 350 | 350 | if ((~state->m_control[0x0b] >> 7) & 1) |
| 351 | 351 | { |
| r13798 | r13799 | |
| 353 | 353 | m107_tilemap_draw(machine, bitmap, cliprect, 3, 1,0); |
| 354 | 354 | } |
| 355 | 355 | else |
| 356 | bitmap->fill(0, | |
| 356 | bitmap->fill(0, | |
| 357 | 357 | |
| 358 | 358 | /* note: the opaque flag is used if layer 3 is disabled, noticeable in World PK Soccer title and gameplay screens */ |
| 359 | 359 | m107_tilemap_draw(machine, bitmap, cliprect, 2, 0,(((state->m_control[0x0b] >> 7) & 1) ? TILEMAP_DRAW_OPAQUE : 0)); |
| r13798 | r13799 | |
|---|---|---|
| 16 | 16 | SPRITE DRAW ROUTINE |
| 17 | 17 | ************************************************************/ |
| 18 | 18 | |
| 19 | static void draw_sprites( running_machine &machine, bitmap_t *bitmap, const rectangle | |
| 19 | static void draw_sprites( running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect, int primask, int x_offs, int y_offs ) | |
| 20 | 20 | { |
| 21 | 21 | ninjaw_state *state = machine.driver_data<ninjaw_state>(); |
| 22 | 22 | UINT16 *spriteram = state->m_spriteram; |
| r13798 | r13799 | |
| 97 | 97 | SCREEN REFRESH |
| 98 | 98 | **************************************************************/ |
| 99 | 99 | |
| 100 | static UINT32 update_screen(screen_device &screen, bitmap_t *bitmap, const rectangle | |
| 100 | static UINT32 update_screen(screen_device &screen, bitmap_t *bitmap, const rectangle &cliprect, int xoffs, device_t *tc0100scn) | |
| 101 | 101 | { |
| 102 | 102 | UINT8 layer[3], nodraw; |
| 103 | 103 | |
| r13798 | r13799 | |
| 113 | 113 | |
| 114 | 114 | /* Ensure screen blanked even when bottom layers not drawn due to disable bit */ |
| 115 | 115 | if (nodraw) |
| 116 | bitmap->fill(get_black_pen(screen.machine()), | |
| 116 | bitmap->fill(get_black_pen(screen.machine()), | |
| 117 | 117 | |
| 118 | 118 | /* Sprites can be under/over the layer below text layer */ |
| 119 | 119 | draw_sprites(screen.machine(), bitmap, cliprect, 1, xoffs, 8); // draw sprites with priority 1 which are under the mid layer |
| r13798 | r13799 | |
|---|---|---|
| 140 | 140 | int sx = 15 - offs / 32; |
| 141 | 141 | int sy = offs % 32; |
| 142 | 142 | |
| 143 | drawgfx_opaque(state->m_tmpbitmap, | |
| 143 | drawgfx_opaque(state->m_tmpbitmap, state->m_tmpbitmap->cliprect(), screen.machine().gfx[1], | |
| 144 | 144 | state->m_videoram[offs] + ((state->m_colorram[offs] & 0x08) << 5), |
| 145 | 145 | (state->m_colorram[offs] & 0x30) >> 4, |
| 146 | 146 | 0,sy >= 16, /* flip horizontally tiles on the right half of the bitmap */ |
| r13798 | r13799 | |
| 153 | 153 | int sx = 15 - offs / 32; |
| 154 | 154 | int sy = offs % 32; |
| 155 | 155 | |
| 156 | drawgfx_opaque(state->m_tmpbitmap2, | |
| 156 | drawgfx_opaque(state->m_tmpbitmap2, state->m_tmpbitmap2->cliprect(), screen.machine().gfx[1], | |
| 157 | 157 | state->m_videoram3[offs] + ((state->m_colorram3[offs] & 0x08) << 5), |
| 158 | 158 | (state->m_colorram3[offs] & 0x30) >> 4, |
| 159 | 159 | 0,sy >= 16, /* flip horizontally tiles on the right half of the bitmap */ |
| r13798 | r13799 | |
| 212 | 212 | int sx = 15 - offs / 32; |
| 213 | 213 | int sy = offs % 32; |
| 214 | 214 | |
| 215 | drawgfx_opaque(state->m_tmpbitmap, | |
| 215 | drawgfx_opaque(state->m_tmpbitmap, state->m_tmpbitmap->cliprect(), screen.machine().gfx[1], | |
| 216 | 216 | state->m_videoram[offs] + ((state->m_colorram[offs] & 0x03) << 8), |
| 217 | 217 | (state->m_colorram[offs] & 0x30) >> 4, |
| 218 | 218 | 0,sy >= 16, /* flip horizontally tiles on the right half of the bitmap */ |
| r13798 | r13799 | |
| 225 | 225 | int sx = 15 - offs / 32; |
| 226 | 226 | int sy = offs % 32; |
| 227 | 227 | |
| 228 | drawgfx_opaque(state->m_tmpbitmap2, | |
| 228 | drawgfx_opaque(state->m_tmpbitmap2, state->m_tmpbitmap2->cliprect(), screen.machine().gfx[1], | |
| 229 | 229 | state->m_videoram3[offs] + ((state->m_colorram3[offs] & 0x03) << 8), |
| 230 | 230 | (state->m_colorram3[offs] & 0x30) >> 4, |
| 231 | 231 | 0,sy >= 16, /* flip horizontally tiles on the right half of the bitmap */ |
| r13798 | r13799 | |
|---|---|---|
| 170 | 170 | state->m_bg_tilemap = tilemap_create(machine, get_bg_tile_info, tilemap_scan_rows, 8, 8, 32, 32); |
| 171 | 171 | } |
| 172 | 172 | |
| 173 | static void draw_sprites( running_machine &machine, bitmap_t *bitmap, const rectangle | |
| 173 | static void draw_sprites( running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect ) | |
| 174 | 174 | { |
| 175 | 175 | arkanoid_state *state = machine.driver_data<arkanoid_state>(); |
| 176 | 176 | int offs; |
| r13798 | r13799 | |
|---|---|---|
| 527 | 527 | if (state->m_video_register&TWIN16_SCREEN_FLIPX) text_flip|=TILEMAP_FLIPX; |
| 528 | 528 | if (state->m_video_register&TWIN16_SCREEN_FLIPY) text_flip|=TILEMAP_FLIPY; |
| 529 | 529 | |
| 530 | screen.machine().priority_bitmap->fill(0, | |
| 530 | screen.machine().priority_bitmap->fill(0, | |
| 531 | 531 | draw_layer( screen.machine(), bitmap, 1 ); |
| 532 | 532 | draw_layer( screen.machine(), bitmap, 0 ); |
| 533 | 533 | draw_sprites( screen.machine(), bitmap ); |
| r13798 | r13799 | |
|---|---|---|
| 567 | 567 | 0C Y position |
| 568 | 568 | 0E Code */ |
| 569 | 569 | |
| 570 | static void draw_sprites(running_machine &machine, bitmap_t *bitmap,const rectangle | |
| 570 | static void draw_sprites(running_machine &machine, bitmap_t *bitmap,const rectangle &cliprect) | |
| 571 | 571 | { |
| 572 | 572 | megasys1_state *state = machine.driver_data<megasys1_state>(); |
| 573 | 573 | int color,code,sx,sy,flipx,flipy,attr,sprite,offs,color_mask; |
| r13798 | r13799 | |
| 973 | 973 | } |
| 974 | 974 | } |
| 975 | 975 | |
| 976 | screen.machine().priority_bitmap->fill(0, | |
| 976 | screen.machine().priority_bitmap->fill(0, | |
| 977 | 977 | |
| 978 | 978 | flag = TILEMAP_DRAW_OPAQUE; |
| 979 | 979 | primask = 0; |
| r13798 | r13799 | |
| 999 | 999 | if (flag != 0) |
| 1000 | 1000 | { |
| 1001 | 1001 | flag = 0; |
| 1002 | bitmap->fill(0, | |
| 1002 | bitmap->fill(0, | |
| 1003 | 1003 | } |
| 1004 | 1004 | |
| 1005 | 1005 | if (state->m_sprite_flag & 0x100) /* sprites are split */ |
| r13798 | r13799 | |
|---|---|---|
| 20 | 20 | const UINT8 x_step[4] = { 5, 7, 11, 19 }; |
| 21 | 21 | |
| 22 | 22 | /* border color */ |
| 23 | bitmap->fill(screen.machine().pens[0x10], | |
| 23 | bitmap->fill(screen.machine().pens[0x10], | |
| 24 | 24 | |
| 25 | 25 | /* define X display area through BPP mode register */ |
| 26 | 26 | calc_dxs = (vidc_regs[VIDC_HDSR]*2)+x_step[vidc_bpp_mode & 3]; |
| r13798 | r13799 | |
|---|---|---|
| 99 | 99 | |
| 100 | 100 | ***************************************************************************/ |
| 101 | 101 | |
| 102 | static void draw_sprites(running_machine &machine, bitmap_t *bitmap,const rectangle | |
| 102 | static void draw_sprites(running_machine &machine, bitmap_t *bitmap,const rectangle &cliprect) | |
| 103 | 103 | { |
| 104 | 104 | crshrace_state *state = machine.driver_data<crshrace_state>(); |
| 105 | 105 | UINT16 *buffered_spriteram = machine.generic.buffered_spriteram.u16; |
| r13798 | r13799 | |
| 171 | 171 | } |
| 172 | 172 | |
| 173 | 173 | |
| 174 | static void draw_bg( running_machine &machine, bitmap_t *bitmap, const rectangle | |
| 174 | static void draw_bg( running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect ) | |
| 175 | 175 | { |
| 176 | 176 | crshrace_state *state = machine.driver_data<crshrace_state>(); |
| 177 | 177 | tilemap_draw(bitmap, cliprect, state->m_tilemap2, 0, 0); |
| 178 | 178 | } |
| 179 | 179 | |
| 180 | 180 | |
| 181 | static void draw_fg(running_machine &machine, bitmap_t *bitmap, const rectangle | |
| 181 | static void draw_fg(running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect) | |
| 182 | 182 | { |
| 183 | 183 | crshrace_state *state = machine.driver_data<crshrace_state>(); |
| 184 | 184 | k053936_zoom_draw(state->m_k053936, bitmap, cliprect, state->m_tilemap1, 0, 0, 1); |
| r13798 | r13799 | |
| 191 | 191 | |
| 192 | 192 | if (state->m_gfxctrl & 0x04) /* display disable? */ |
| 193 | 193 | { |
| 194 | bitmap->fill(get_black_pen(screen.machine()), | |
| 194 | bitmap->fill(get_black_pen(screen.machine()), | |
| 195 | 195 | return 0; |
| 196 | 196 | } |
| 197 | 197 | |
| 198 | bitmap->fill(0x1ff, | |
| 198 | bitmap->fill(0x1ff, | |
| 199 | 199 | |
| 200 | 200 | switch (state->m_gfxctrl & 0xfb) |
| 201 | 201 | { |
| r13798 | r13799 | |
|---|---|---|
| 217 | 217 | { |
| 218 | 218 | pacman_state *state = screen.machine().driver_data<pacman_state>(); |
| 219 | 219 | if (state->m_bgpriority != 0) |
| 220 | bitmap->fill(0, | |
| 220 | bitmap->fill(0, | |
| 221 | 221 | else |
| 222 | 222 | tilemap_draw(bitmap,cliprect,state->m_bg_tilemap,TILEMAP_DRAW_OPAQUE,0); |
| 223 | 223 | |
| r13798 | r13799 | |
| 228 | 228 | int offs; |
| 229 | 229 | |
| 230 | 230 | rectangle spriteclip(2*8, 34*8-1, 0*8, 28*8-1); |
| 231 | spriteclip &= | |
| 231 | spriteclip &= | |
| 232 | 232 | |
| 233 | 233 | /* Draw the sprites. Note that it is important to draw them exactly in this */ |
| 234 | 234 | /* order, to have the correct priorities. */ |
| r13798 | r13799 | |
| 254 | 254 | |
| 255 | 255 | color = ( spriteram[offs + 1] & 0x1f ) | (state->m_colortablebank << 5) | (state->m_palettebank << 6 ); |
| 256 | 256 | |
| 257 | drawgfx_transmask(bitmap, | |
| 257 | drawgfx_transmask(bitmap, | |
| 258 | 258 | ( spriteram[offs] >> 2 ) | (state->m_spritebank << 6), |
| 259 | 259 | color, |
| 260 | 260 | fx,fy, |
| r13798 | r13799 | |
| 262 | 262 | colortable_get_transpen_mask(screen.machine().colortable, screen.machine().gfx[1], color & 0x3f, 0)); |
| 263 | 263 | |
| 264 | 264 | /* also plot the sprite with wraparound (tunnel in Crush Roller) */ |
| 265 | drawgfx_transmask(bitmap, | |
| 265 | drawgfx_transmask(bitmap, | |
| 266 | 266 | ( spriteram[offs] >> 2 ) | (state->m_spritebank << 6), |
| 267 | 267 | color, |
| 268 | 268 | fx,fy, |
| r13798 | r13799 | |
| 292 | 292 | fx = (spriteram[offs] & 1) ^ state->m_inv_spr; |
| 293 | 293 | fy = (spriteram[offs] & 2) ^ ((state->m_inv_spr) << 1); |
| 294 | 294 | |
| 295 | drawgfx_transmask(bitmap, | |
| 295 | drawgfx_transmask(bitmap, | |
| 296 | 296 | ( spriteram[offs] >> 2 ) | (state->m_spritebank << 6), |
| 297 | 297 | color, |
| 298 | 298 | fx,fy, |
| r13798 | r13799 | |
| 300 | 300 | colortable_get_transpen_mask(screen.machine().colortable, screen.machine().gfx[1], color & 0x3f, 0)); |
| 301 | 301 | |
| 302 | 302 | /* also plot the sprite with wraparound (tunnel in Crush Roller) */ |
| 303 | drawgfx_transmask(bitmap, | |
| 303 | drawgfx_transmask(bitmap, | |
| 304 | 304 | ( spriteram[offs] >> 2 ) | (state->m_spritebank << 6), |
| 305 | 305 | color, |
| 306 | 306 | fy,fx, //FIXME: flipping bits are really supposed to be inverted here? |
| r13798 | r13799 | |
|---|---|---|
| 286 | 286 | |
| 287 | 287 | ***************************************************************************/ |
| 288 | 288 | |
| 289 | static void draw_sprites(running_machine &machine, bitmap_t *bitmap, const rectangle | |
| 289 | static void draw_sprites(running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect) | |
| 290 | 290 | { |
| 291 | 291 | clshroad_state *state = machine.driver_data<clshroad_state>(); |
| 292 | 292 | UINT8 *spriteram = state->m_spriteram; |
| r13798 | r13799 | |
|---|---|---|
| 122 | 122 | int x, y; |
| 123 | 123 | |
| 124 | 124 | /* update the pixels */ |
| 125 | for (y = cliprect | |
| 125 | for (y = cliprect. | |
| 126 | 126 | { |
| 127 | 127 | UINT16 *dest = &bitmap->pix16(y); |
| 128 | 128 | UINT16 *src = &state->m_dstbitmap->pix16((y + state->m_blitter_vidparam[0x28/2]) % DSTBITMAP_HEIGHT); |
| 129 | 129 | |
| 130 | for (x = cliprect | |
| 130 | for (x = cliprect. | |
| 131 | 131 | dest[x] = src[x]; |
| 132 | 132 | } |
| 133 | 133 | return 0; |
| r13798 | r13799 | |
|---|---|---|
| 75 | 75 | { |
| 76 | 76 | chqflag_state *state = screen.machine().driver_data<chqflag_state>(); |
| 77 | 77 | |
| 78 | bitmap->fill(0, | |
| 78 | bitmap->fill(0, | |
| 79 | 79 | |
| 80 | 80 | k051316_zoom_draw(state->m_k051316_2, bitmap, cliprect, TILEMAP_DRAW_LAYER1, 0); |
| 81 | 81 | k051960_sprites_draw(state->m_k051960, bitmap, cliprect, 0, 0); |
| r13798 | r13799 | |
|---|---|---|
| 247 | 247 | //**************************************************************************** |
| 248 | 248 | // Realtime |
| 249 | 249 | |
| 250 | static void draw_sprites( running_machine &machine, bitmap_t *bmp, const rectangle | |
| 250 | static void draw_sprites( running_machine &machine, bitmap_t *bmp, const rectangle &clip, UINT8 *ram, int pri ) | |
| 251 | 251 | { |
| 252 | 252 | bwing_state *state = machine.driver_data<bwing_state>(); |
| 253 | 253 | int attrib, fx, fy, code, x, y, color, i; |
| r13798 | r13799 | |
| 316 | 316 | tilemap_draw(bitmap, cliprect, state->m_bgmap, 0, 0); |
| 317 | 317 | } |
| 318 | 318 | else |
| 319 | bitmap->fill(get_black_pen(screen.machine()), | |
| 319 | bitmap->fill(get_black_pen(screen.machine()), | |
| 320 | 320 | |
| 321 | 321 | // draw low priority sprites |
| 322 | 322 | draw_sprites(screen.machine(), bitmap, cliprect, state->m_spriteram, 0); |
| r13798 | r13799 | |
|---|---|---|
| 129 | 129 | return nb ^ delta[(nb >> 3) & 3]; |
| 130 | 130 | } |
| 131 | 131 | |
| 132 | static void draw_sprites( running_machine &machine, bitmap_t *bitmap,const rectangle | |
| 132 | static void draw_sprites( running_machine &machine, bitmap_t *bitmap,const rectangle &cliprect ) | |
| 133 | 133 | { |
| 134 | 134 | sf_state *state = machine.driver_data<sf_state>(); |
| 135 | 135 | int offs; |
| r13798 | r13799 | |
| 225 | 225 | if (state->m_sf_active & 0x20) |
| 226 | 226 | tilemap_draw(bitmap, cliprect, state->m_bg_tilemap, 0, 0); |
| 227 | 227 | else |
| 228 | bitmap->fill(0, | |
| 228 | bitmap->fill(0, | |
| 229 | 229 | |
| 230 | 230 | tilemap_draw(bitmap, cliprect, state->m_fg_tilemap, 0, 0); |
| 231 | 231 |
| r13798 | r13799 | |
|---|---|---|
| 1 | 1 | #include "emu.h" |
| 2 | 2 | #include "includes/lsasquad.h" |
| 3 | 3 | |
| 4 | static void draw_layer( running_machine &machine, bitmap_t *bitmap, const rectangle | |
| 4 | static void draw_layer( running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect, UINT8 *scrollram ) | |
| 5 | 5 | { |
| 6 | 6 | lsasquad_state *state = machine.driver_data<lsasquad_state>(); |
| 7 | 7 | int offs, scrollx, scrolly; |
| r13798 | r13799 | |
| 48 | 48 | } |
| 49 | 49 | } |
| 50 | 50 | |
| 51 | static int draw_layer_daikaiju( running_machine &machine, bitmap_t *bitmap, const rectangle | |
| 51 | static int draw_layer_daikaiju( running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect, int offs, int * previd, int type ) | |
| 52 | 52 | { |
| 53 | 53 | lsasquad_state *state = machine.driver_data<lsasquad_state>(); |
| 54 | 54 | int id, scrollx, scrolly, initoffs, globalscrollx; |
| r13798 | r13799 | |
| 138 | 138 | return offs; |
| 139 | 139 | } |
| 140 | 140 | |
| 141 | static void drawbg( running_machine &machine, bitmap_t *bitmap, const rectangle | |
| 141 | static void drawbg( running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect, int type ) | |
| 142 | 142 | { |
| 143 | 143 | lsasquad_state *state = machine.driver_data<lsasquad_state>(); |
| 144 | 144 | int i = 0; |
| r13798 | r13799 | |
| 158 | 158 | } |
| 159 | 159 | } |
| 160 | 160 | |
| 161 | static void draw_sprites( running_machine &machine, bitmap_t *bitmap, const rectangle | |
| 161 | static void draw_sprites( running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect ) | |
| 162 | 162 | { |
| 163 | 163 | lsasquad_state *state = machine.driver_data<lsasquad_state>(); |
| 164 | 164 | UINT8 *spriteram = state->m_spriteram; |
| r13798 | r13799 | |
| 201 | 201 | SCREEN_UPDATE( lsasquad ) |
| 202 | 202 | { |
| 203 | 203 | lsasquad_state *state = screen.machine().driver_data<lsasquad_state>(); |
| 204 | bitmap->fill(511, | |
| 204 | bitmap->fill(511, | |
| 205 | 205 | |
| 206 | 206 | draw_layer(screen.machine(), bitmap, cliprect, state->m_scrollram + 0x000); |
| 207 | 207 | draw_layer(screen.machine(), bitmap, cliprect, state->m_scrollram + 0x080); |
| r13798 | r13799 | |
| 213 | 213 | |
| 214 | 214 | SCREEN_UPDATE( daikaiju ) |
| 215 | 215 | { |
| 216 | bitmap->fill(511, | |
| 216 | bitmap->fill(511, | |
| 217 | 217 | drawbg(screen.machine(), bitmap, cliprect, 0); // bottom |
| 218 | 218 | draw_sprites(screen.machine(), bitmap, cliprect); |
| 219 | 219 | drawbg(screen.machine(), bitmap, cliprect, 1); // top = pallete $d ? |
| r13798 | r13799 | |
|---|---|---|
| 769 | 769 | machine.save().register_postload(save_prepost_delegate(FUNC(cave_get_sprite_info), &machine)); |
| 770 | 770 | } |
| 771 | 771 | |
| 772 | static void cave_sprite_check( screen_device &screen, const rectangle | |
| 772 | static void cave_sprite_check( screen_device &screen, const rectangle &clip ) | |
| 773 | 773 | { |
| 774 | 774 | cave_state *state = screen.machine().driver_data<cave_state>(); |
| 775 | 775 | |
| 776 | 776 | { /* 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; | |
| 781 | 781 | |
| 782 | 782 | state->m_blit.clip_left = left; |
| 783 | 783 | state->m_blit.clip_top = top; |
| r13798 | r13799 | |
| 824 | 824 | |
| 825 | 825 | case CAVE_SPRITETYPE_ZOOM | CAVE_SPRITETYPE_ZBUF: |
| 826 | 826 | state->m_sprite_draw = sprite_draw_cave_zbuf; |
| 827 | if (clip | |
| 827 | if (clip. | |
| 828 | 828 | { |
| 829 | 829 | if(!(state->m_sprite_zbuf_baseval += MAX_SPRITE_NUM)) |
| 830 | 830 | state->m_sprite_zbuf->fill(0, visarea); |
| r13798 | r13799 | |
| 833 | 833 | |
| 834 | 834 | case CAVE_SPRITETYPE_ZBUF: |
| 835 | 835 | state->m_sprite_draw = sprite_draw_donpachi_zbuf; |
| 836 | if (clip | |
| 836 | if (clip. | |
| 837 | 837 | { |
| 838 | 838 | if(!(state->m_sprite_zbuf_baseval += MAX_SPRITE_NUM)) |
| 839 | 839 | state->m_sprite_zbuf->fill(0, visarea); |
| r13798 | r13799 | |
| 1418 | 1418 | ***************************************************************************/ |
| 1419 | 1419 | |
| 1420 | 1420 | INLINE void cave_tilemap_draw( |
| 1421 | running_machine &machine, bitmap_t *bitmap, const rectangle | |
| 1421 | running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect, | |
| 1422 | 1422 | UINT32 flags, UINT32 priority, UINT32 priority2, int GFX ) |
| 1423 | 1423 | { |
| 1424 | 1424 | cave_state *state = machine.driver_data<cave_state>(); |
| r13798 | r13799 | |
| 1467 | 1467 | tilemap_draw multiple times. |
| 1468 | 1468 | */ |
| 1469 | 1469 | |
| 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; | |
| 1472 | 1472 | |
| 1473 | for (startline = cliprect | |
| 1473 | for (startline = cliprect. | |
| 1474 | 1474 | { |
| 1475 | 1475 | /* Find the largest slice */ |
| 1476 | 1476 | vramdata0 = (vramdata1 = VRAM[(0x1002 + (((sy + offs_row + startline) * 4) & 0x7ff)) / 2]); |
| 1477 | for(endline = startline + 1; endline <= cliprect | |
| 1477 | for(endline = startline + 1; endline <= cliprect. | |
| 1478 | 1478 | if((++vramdata1) != VRAM[(0x1002 + (((sy + offs_row + endline) * 4) & 0x7ff)) / 2]) break; |
| 1479 | 1479 | |
| 1480 | 1480 | tilemap_set_scrolly(TILEMAP, 0, vramdata0 - startline); |
| r13798 | r13799 | |
| 1504 | 1504 | |
| 1505 | 1505 | if (flipy) |
| 1506 | 1506 | { |
| 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); | |
| 1509 | 1509 | } |
| 1510 | 1510 | else |
| 1511 | 1511 | { |
| r13798 | r13799 | |
| 1513 | 1513 | clip.max_y = endline - 1; |
| 1514 | 1514 | } |
| 1515 | 1515 | |
| 1516 | tilemap_draw(bitmap, | |
| 1516 | tilemap_draw(bitmap, | |
| 1517 | 1517 | |
| 1518 | 1518 | startline = endline; |
| 1519 | 1519 | } |
| r13798 | r13799 | |
| 1522 | 1522 | { |
| 1523 | 1523 | int line; |
| 1524 | 1524 | tilemap_set_scroll_rows(TILEMAP, 512); |
| 1525 | for(line = cliprect | |
| 1525 | for(line = cliprect. | |
| 1526 | 1526 | tilemap_set_scrollx(TILEMAP, (line + sy) & 511, |
| 1527 | 1527 | sx + VRAM[(0x1000+(((sy + offs_row + line) * 4) & 0x7ff)) / 2] ); |
| 1528 | 1528 | tilemap_set_scrolly(TILEMAP, 0, sy); |
| r13798 | r13799 | |
| 1621 | 1621 | |
| 1622 | 1622 | cave_sprite_check(screen, cliprect); |
| 1623 | 1623 | |
| 1624 | bitmap->fill(state->m_background_color, | |
| 1624 | bitmap->fill(state->m_background_color, | |
| 1625 | 1625 | |
| 1626 | 1626 | /* |
| 1627 | 1627 | Tiles and sprites are ordered by priority (0 back, 3 front) with |
| r13798 | r13799 | |
|---|---|---|
| 350 | 350 | } |
| 351 | 351 | |
| 352 | 352 | |
| 353 | static void draw_sprites(running_machine &machine, bitmap_t *bitmap, const rectangle | |
| 353 | static void draw_sprites(running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect, int pollux_extensions) | |
| 354 | 354 | { |
| 355 | 355 | /* Sprites take 32 bytes each in memory: |
| 356 | 356 | MSB LSB |
| r13798 | r13799 | |
| 440 | 440 | } |
| 441 | 441 | } |
| 442 | 442 | |
| 443 | static void rshark_draw_sprites(running_machine &machine, bitmap_t *bitmap, const rectangle | |
| 443 | static void rshark_draw_sprites(running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect) | |
| 444 | 444 | { |
| 445 | 445 | UINT16 *buffered_spriteram16 = machine.generic.buffered_spriteram.u16; |
| 446 | 446 | |
| r13798 | r13799 | |
| 515 | 515 | SCREEN_UPDATE( lastday ) |
| 516 | 516 | { |
| 517 | 517 | 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); | |
| 520 | 520 | |
| 521 | 521 | tilemap_draw(bitmap, cliprect, state->m_bg_tilemap, 0, 1); |
| 522 | 522 | tilemap_draw(bitmap, cliprect, state->m_fg_tilemap, 0, 2); |
| r13798 | r13799 | |
| 530 | 530 | SCREEN_UPDATE( gulfstrm ) |
| 531 | 531 | { |
| 532 | 532 | 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); | |
| 535 | 535 | |
| 536 | 536 | tilemap_draw(bitmap, cliprect, state->m_bg_tilemap, 0, 1); |
| 537 | 537 | tilemap_draw(bitmap, cliprect, state->m_fg_tilemap, 0, 2); |
| r13798 | r13799 | |
| 544 | 544 | SCREEN_UPDATE( pollux ) |
| 545 | 545 | { |
| 546 | 546 | 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); | |
| 549 | 549 | |
| 550 | 550 | tilemap_draw(bitmap, cliprect, state->m_bg_tilemap, 0, 1); |
| 551 | 551 | tilemap_draw(bitmap, cliprect, state->m_fg_tilemap, 0, 2); |
| r13798 | r13799 | |
| 558 | 558 | SCREEN_UPDATE( flytiger ) |
| 559 | 559 | { |
| 560 | 560 | 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); | |
| 563 | 563 | |
| 564 | 564 | if (state->m_flytiger_pri) |
| 565 | 565 | { |
| r13798 | r13799 | |
| 581 | 581 | SCREEN_UPDATE( bluehawk ) |
| 582 | 582 | { |
| 583 | 583 | 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); | |
| 586 | 586 | |
| 587 | 587 | tilemap_draw(bitmap, cliprect, state->m_bg_tilemap, 0, 1); |
| 588 | 588 | tilemap_draw(bitmap, cliprect, state->m_fg_tilemap, 0, 2); |
| r13798 | r13799 | |
| 596 | 596 | SCREEN_UPDATE( primella ) |
| 597 | 597 | { |
| 598 | 598 | dooyong_state *state = screen.machine().driver_data<dooyong_state>(); |
| 599 | bitmap->fill(get_black_pen(screen.machine()), | |
| 599 | bitmap->fill(get_black_pen(screen.machine()), | |
| 600 | 600 | |
| 601 | 601 | tilemap_draw(bitmap, cliprect, state->m_bg_tilemap, 0, 0); |
| 602 | 602 | if (state->m_tx_pri) tilemap_draw(bitmap, cliprect, state->m_tx_tilemap, 0, 0); |
| r13798 | r13799 | |
| 608 | 608 | SCREEN_UPDATE( rshark ) |
| 609 | 609 | { |
| 610 | 610 | 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); | |
| 613 | 613 | |
| 614 | 614 | tilemap_draw(bitmap, cliprect, state->m_bg_tilemap, 0, 1); |
| 615 | 615 | tilemap_draw(bitmap, cliprect, state->m_bg2_tilemap, 0, (state->m_rshark_pri ? 2 : 1)); |
| r13798 | r13799 | |
| 623 | 623 | SCREEN_UPDATE( popbingo ) |
| 624 | 624 | { |
| 625 | 625 | 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); | |
| 628 | 628 | |
| 629 | 629 | tilemap_draw(bitmap, cliprect, state->m_bg_tilemap, 0, 1); |
| 630 | 630 |
| r13798 | r13799 | |
|---|---|---|
| 166 | 166 | #endif |
| 167 | 167 | |
| 168 | 168 | |
| 169 | static void draw_sprites( running_machine &machine, bitmap_t *bitmap, const rectangle | |
| 169 | static void draw_sprites( running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect, int prio ) | |
| 170 | 170 | { |
| 171 | 171 | brkthru_state *state = machine.driver_data<brkthru_state>(); |
| 172 | 172 | int offs; |
| r13798 | r13799 | |
|---|---|---|
| 183 | 183 | pens[x] = state->m_palette_lookup[screen.machine().generic.paletteram.u8[x]]; |
| 184 | 184 | |
| 185 | 185 | /* loop over rows */ |
| 186 | for (y = cliprect | |
| 186 | for (y = cliprect. | |
| 187 | 187 | { |
| 188 | 188 | UINT8 *source = &state->m_videoram[y]; |
| 189 | 189 | UINT32 *dest = &bitmap->pix32(y); |
| 190 | 190 | |
| 191 | 191 | /* loop over columns */ |
| 192 | for (x = cliprect | |
| 192 | for (x = cliprect. | |
| 193 | 193 | { |
| 194 | 194 | int pix = source[(x/2) * 256]; |
| 195 | 195 | dest[x+0] = pens[pix >> 4]; |
| r13798 | r13799 | |
| 211 | 211 | pens[x] = state->m_palette_lookup[screen.machine().generic.paletteram.u8[x]]; |
| 212 | 212 | |
| 213 | 213 | /* if we're blitting from the top, start with a 0 for color 0 */ |
| 214 | if (cliprect | |
| 214 | if (cliprect. | |
| 215 | 215 | state->m_blaster_color0 = state->m_palette_lookup[state->m_blaster_palette_0[0] ^ 0xff]; |
| 216 | 216 | |
| 217 | 217 | /* loop over rows */ |
| 218 | for (y = cliprect | |
| 218 | for (y = cliprect. | |
| 219 | 219 | { |
| 220 | 220 | int erase_behind = state->m_blaster_video_control & state->m_blaster_scanline_control[y] & 2; |
| 221 | 221 | UINT8 *source = &state->m_videoram[y]; |
| r13798 | r13799 | |
| 226 | 226 | state->m_blaster_color0 = state->m_palette_lookup[state->m_blaster_palette_0[y] ^ 0xff]; |
| 227 | 227 | |
| 228 | 228 | /* loop over columns */ |
| 229 | for (x = cliprect | |
| 229 | for (x = cliprect. | |
| 230 | 230 | { |
| 231 | 231 | int pix = source[(x/2) * 256]; |
| 232 | 232 | |
| r13798 | r13799 | |
| 257 | 257 | pens[x] = palette_get_color(screen.machine(), state->m_williams2_fg_color * 16 + x); |
| 258 | 258 | |
| 259 | 259 | /* loop over rows */ |
| 260 | for (y = cliprect | |
| 260 | for (y = cliprect. | |
| 261 | 261 | { |
| 262 | 262 | UINT8 *source = &state->m_videoram[y]; |
| 263 | 263 | UINT32 *dest = &bitmap->pix32(y); |
| 264 | 264 | |
| 265 | 265 | /* loop over columns */ |
| 266 | for (x = cliprect | |
| 266 | for (x = cliprect. | |
| 267 | 267 | { |
| 268 | 268 | int pix = source[(x/2) * 256]; |
| 269 | 269 |
| r13798 | r13799 | |
|---|---|---|
| 222 | 222 | /******************************************************************************/ |
| 223 | 223 | |
| 224 | 224 | |
| 225 | static void srdarwin_draw_sprites( running_machine& machine, bitmap_t *bitmap, const rectangle | |
| 225 | static void srdarwin_draw_sprites( running_machine& machine, bitmap_t *bitmap, const rectangle &cliprect, int pri ) | |
| 226 | 226 | { |
| 227 | 227 | UINT8 *buffered_spriteram = machine.generic.buffered_spriteram.u8; |
| 228 | 228 | int offs; |
| r13798 | r13799 | |
|---|---|---|
| 143 | 143 | |
| 144 | 144 | ***************************************************************************/ |
| 145 | 145 | |
| 146 | static void draw_sprites( screen_device &screen, bitmap_t *bitmap, const rectangle | |
| 146 | static void draw_sprites( screen_device &screen, bitmap_t *bitmap, const rectangle &cliprect ) | |
| 147 | 147 | { |
| 148 | 148 | fuuki32_state *state = screen.machine().driver_data<fuuki32_state>(); |
| 149 | 149 | int offs; |
| r13798 | r13799 | |
| 289 | 289 | ***************************************************************************/ |
| 290 | 290 | |
| 291 | 291 | /* Wrapper to handle bg and bg2 ttogether */ |
| 292 | static void fuuki32_draw_layer( running_machine &machine, bitmap_t *bitmap, const rectangle | |
| 292 | static void fuuki32_draw_layer( running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect, int i, int flag, int pri ) | |
| 293 | 293 | { |
| 294 | 294 | fuuki32_state *state = machine.driver_data<fuuki32_state>(); |
| 295 | 295 | int buffer = ((state->m_vregs[0x1e / 4] & 0x0000ffff) & 0x40); |
| r13798 | r13799 | |
| 356 | 356 | tilemap_set_scrolly(state->m_tilemap[3], 0, layer2_scrolly); |
| 357 | 357 | |
| 358 | 358 | /* 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); | |
| 361 | 361 | |
| 362 | 362 | fuuki32_draw_layer(screen.machine(), bitmap, cliprect, tm_back, 0, 1); |
| 363 | 363 | fuuki32_draw_layer(screen.machine(), bitmap, cliprect, tm_middle, 0, 2); |
| r13798 | r13799 | |
|---|---|---|
| 118 | 118 | state->m_bg2yscroll = (state->m_bg2yscroll & 0x00ff) | (data << 8); |
| 119 | 119 | } |
| 120 | 120 | |
| 121 | static void draw_sprites(running_machine &machine, bitmap_t *bitmap,const rectangle | |
| 121 | static void draw_sprites(running_machine &machine, bitmap_t *bitmap,const rectangle &cliprect, int xscroll) | |
| 122 | 122 | { |
| 123 | 123 | tbowl_state *state = machine.driver_data<tbowl_state>(); |
| 124 | 124 | int offs; |
| r13798 | r13799 | |
| 225 | 225 | tilemap_set_scrollx(state->m_tx_tilemap, 0, 0 ); |
| 226 | 226 | tilemap_set_scrolly(state->m_tx_tilemap, 0, 0 ); |
| 227 | 227 | |
| 228 | bitmap->fill(0x100, | |
| 228 | bitmap->fill(0x100, | |
| 229 | 229 | tilemap_draw(bitmap,cliprect,state->m_bg_tilemap,0,0); |
| 230 | 230 | draw_sprites(screen.machine(), bitmap,cliprect, 0); |
| 231 | 231 | tilemap_draw(bitmap,cliprect,state->m_bg2_tilemap,0,0); |
| r13798 | r13799 | |
| 245 | 245 | tilemap_set_scrollx(state->m_tx_tilemap, 0, 32*8 ); |
| 246 | 246 | tilemap_set_scrolly(state->m_tx_tilemap, 0, 0 ); |
| 247 | 247 | |
| 248 | bitmap->fill(0x100, | |
| 248 | bitmap->fill(0x100, | |
| 249 | 249 | tilemap_draw(bitmap,cliprect,state->m_bg_tilemap,0,0); |
| 250 | 250 | draw_sprites(screen.machine(), bitmap,cliprect, 32*8); |
| 251 | 251 | tilemap_draw(bitmap,cliprect,state->m_bg2_tilemap,0,0); |
| r13798 | r13799 | |
|---|---|---|
| 148 | 148 | state->m_screen_bitmap = auto_bitmap_alloc(machine, 32 * 8, 32 * 8, BITMAP_FORMAT_INDEXED8); |
| 149 | 149 | } |
| 150 | 150 | |
| 151 | static void draw_sprites( running_machine &machine, bitmap_t *bitmap, const rectangle | |
| 151 | static void draw_sprites( running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect ) | |
| 152 | 152 | { |
| 153 | 153 | battlane_state *state = machine.driver_data<battlane_state>(); |
| 154 | 154 | int offs, attr, code, color, sx, sy, flipx, flipy, dy; |
| r13798 | r13799 | |
|---|---|---|
| 529 | 529 | mram = state->m_expanded_mram + 0x2000 * ((color_latch >> 6) & 3); |
| 530 | 530 | |
| 531 | 531 | /* now do the nasty blend */ |
| 532 | for (y = cliprect | |
| 532 | for (y = cliprect. | |
| 533 | 533 | { |
| 534 | 534 | UINT16 *an = &state->m_an_bitmap->pix16(y); |
| 535 | 535 | UINT16 *pf = &state->m_pf_bitmap->pix16(y); |
| r13798 | r13799 | |
| 540 | 540 | /* Primal Rage: no TRAM, slightly different priorities */ |
| 541 | 541 | if (state->m_is_primrage) |
| 542 | 542 | { |
| 543 | for (x = cliprect | |
| 543 | for (x = cliprect. | |
| 544 | 544 | { |
| 545 | 545 | UINT8 pfpri = (pf[x] >> 10) & 7; |
| 546 | 546 | UINT8 mopri = mo[x] >> ATARIRLE_PRIORITY_SHIFT; |
| r13798 | r13799 | |
| 574 | 574 | /* T-Mek: full TRAM and all effects */ |
| 575 | 575 | else |
| 576 | 576 | { |
| 577 | for (x = cliprect | |
| 577 | for (x = cliprect. | |
| 578 | 578 | { |
| 579 | 579 | UINT8 pfpri = (pf[x] >> 10) & 7; |
| 580 | 580 | UINT8 mopri = mo[x] >> ATARIRLE_PRIORITY_SHIFT; |
| r13798 | r13799 | |
|---|---|---|
| 221 | 221 | |
| 222 | 222 | ******************************************************************************/ |
| 223 | 223 | |
| 224 | void system18_vdp_update( bitmap_t *bitmap, const rectangle | |
| 224 | void system18_vdp_update( bitmap_t *bitmap, const rectangle &cliprect ) | |
| 225 | 225 | { |
| 226 | 226 | int y; |
| 227 | 227 | |
| 228 | 228 | /* generate the final screen */ |
| 229 | for (y = cliprect | |
| 229 | for (y = cliprect. | |
| 230 | 230 | drawline(&bitmap->pix16(y), y, 0xffff); |
| 231 | 231 | } |
| 232 | 232 |
| r13798 | r13799 | |
|---|---|---|
| 232 | 232 | |
| 233 | 233 | static void draw_sprites(running_machine &machine, |
| 234 | 234 | bitmap_t *bitmap, |
| 235 | const rectangle | |
| 235 | const rectangle &cliprect, | |
| 236 | 236 | int priority_to_draw) |
| 237 | 237 | { |
| 238 | 238 | const rectangle spritevisiblearea(2*8+1, 32*8-1, 2*8, 30*8-1); |
| r13798 | r13799 | |
| 273 | 273 | /* sprites 0-3 are drawn one pixel down */ |
| 274 | 274 | if (offs < 16) y++; |
| 275 | 275 | |
| 276 | drawgfx_transpen(bitmap, state->m_flip_screen_x ? | |
| 276 | drawgfx_transpen(bitmap, state->m_flip_screen_x ? | |
| 277 | 277 | machine.gfx[2 * state->m_graphics_bank + 1], |
| 278 | 278 | state->m_spriteram[offs + 1] & 0x3f, |
| 279 | 279 | state->m_spriteram[offs + 2], |
| r13798 | r13799 | |
|---|---|---|
| 201 | 201 | * |
| 202 | 202 | *************************************/ |
| 203 | 203 | |
| 204 | static void draw_sprites(running_machine &machine, bitmap_t *bitmap, const rectangle | |
| 204 | static void draw_sprites(running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect, int start, int stop) | |
| 205 | 205 | { |
| 206 | 206 | rpunch_state *state = machine.driver_data<rpunch_state>(); |
| 207 | 207 | UINT16 *spriteram16 = state->m_spriteram; |
| r13798 | r13799 | |
| 239 | 239 | * |
| 240 | 240 | *************************************/ |
| 241 | 241 | |
| 242 | static void draw_bitmap(running_machine &machine, bitmap_t *bitmap, const rectangle | |
| 242 | static void draw_bitmap(running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect) | |
| 243 | 243 | { |
| 244 | 244 | rpunch_state *state = machine.driver_data<rpunch_state>(); |
| 245 | 245 | int colourbase; |
| r13798 | r13799 | |
|---|---|---|
| 256 | 256 | int x, y, offs; |
| 257 | 257 | |
| 258 | 258 | /* draw the sprites */ |
| 259 | state->m_spritebitmap->fill(0x00, | |
| 259 | state->m_spritebitmap->fill(0x00, | |
| 260 | 260 | for (offs = 0; offs < 0x20; offs++) |
| 261 | 261 | if (spriteaddr[offs + 0x00] != 0) |
| 262 | 262 | { |
| r13798 | r13799 | |
| 273 | 273 | } |
| 274 | 274 | |
| 275 | 275 | /* draw the bitmap to the screen, looping over Y */ |
| 276 | for (y = cliprect | |
| 276 | for (y = cliprect. | |
| 277 | 277 | { |
| 278 | 278 | UINT16 *dst = &bitmap->pix16(y); |
| 279 | 279 | |
| 280 | 280 | /* if we're in the VBLANK region, just fill with black */ |
| 281 | 281 | if (~state->m_syncprom[y] & 2) |
| 282 | 282 | { |
| 283 | for (x = cliprect | |
| 283 | for (x = cliprect. | |
| 284 | 284 | dst[x] = black; |
| 285 | 285 | } |
| 286 | 286 | |
| r13798 | r13799 | |
| 296 | 296 | src[1] = &state->m_videoram[0x0000 | (effy * 64)]; |
| 297 | 297 | |
| 298 | 298 | /* loop over X */ |
| 299 | for (x = cliprect | |
| 299 | for (x = cliprect. | |
| 300 | 300 | { |
| 301 | 301 | /* if we're in the HBLANK region, just store black */ |
| 302 | 302 | if (x >= 256) |
| r13798 | r13799 | |
|---|---|---|
| 30 | 30 | layer[1] = layer[0] ^ 1; |
| 31 | 31 | layer[2] = 2; |
| 32 | 32 | |
| 33 | screen.machine().priority_bitmap->fill(0, | |
| 33 | screen.machine().priority_bitmap->fill(0, | |
| 34 | 34 | |
| 35 | 35 | /* Ensure screen blanked even when bottom layer not drawn due to disable bit */ |
| 36 | bitmap->fill(0, | |
| 36 | bitmap->fill(0, | |
| 37 | 37 | |
| 38 | 38 | tc0100scn_tilemap_draw(state->m_tc0100scn, bitmap, cliprect, layer[0], TILEMAP_DRAW_OPAQUE, 1); |
| 39 | 39 | tc0100scn_tilemap_draw(state->m_tc0100scn, bitmap, cliprect, layer[1], 0, 2); |
| r13798 | r13799 | |
| 56 | 56 | layer[1] = layer[0] ^ 1; |
| 57 | 57 | layer[2] = 2; |
| 58 | 58 | |
| 59 | screen.machine().priority_bitmap->fill(0, | |
| 59 | screen.machine().priority_bitmap->fill(0, | |
| 60 | 60 | |
| 61 | 61 | /* Ensure screen blanked even when bottom layer not drawn due to disable bit */ |
| 62 | bitmap->fill(0, | |
| 62 | bitmap->fill(0, | |
| 63 | 63 | |
| 64 | 64 | tc0100scn_tilemap_draw(state->m_tc0100scn, bitmap, cliprect, layer[0], TILEMAP_DRAW_OPAQUE, 1); |
| 65 | 65 | tc0100scn_tilemap_draw(state->m_tc0100scn, bitmap, cliprect, layer[1], 0, 2); |
| r13798 | r13799 | |
|---|---|---|
| 32 | 32 | } |
| 33 | 33 | |
| 34 | 34 | |
| 35 | static void draw_sprites(running_machine &machine, bitmap_t* bitmap, const rectangle | |
| 35 | static void draw_sprites(running_machine &machine, bitmap_t* bitmap, const rectangle | |
| 36 | 36 | { |
| 37 | 37 | triplhnt_state *state = machine.driver_data<triplhnt_state>(); |
| 38 | 38 | int i; |
| r13798 | r13799 | |
| 78 | 78 | 2 * code + state->m_sprite_bank, 0, code & 8, 0, |
| 79 | 79 | rect.min_x, rect.min_y); |
| 80 | 80 | |
| 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; | |
| 89 | 89 | |
| 90 | 90 | /* check for collisions and copy sprite */ |
| 91 | 91 |
| r13798 | r13799 | |
|---|---|---|
| 157 | 157 | * |
| 158 | 158 | *************************************/ |
| 159 | 159 | |
| 160 | static void draw_sprites( running_machine &machine, bitmap_t *bitmap, const rectangle | |
| 160 | static void draw_sprites( running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect ) | |
| 161 | 161 | { |
| 162 | 162 | pooyan_state *state = machine.driver_data<pooyan_state>(); |
| 163 | 163 | UINT8 *spriteram = state->m_spriteram; |
| r13798 | r13799 | |
|---|---|---|
| 64 | 64 | rollerg_state *state = screen.machine().driver_data<rollerg_state>(); |
| 65 | 65 | int bg_colorbase = 16; |
| 66 | 66 | |
| 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); | |
| 69 | 69 | k051316_zoom_draw(state->m_k051316, bitmap, cliprect, 0, 1); |
| 70 | 70 | k053245_sprites_draw(state->m_k053244, bitmap, cliprect); |
| 71 | 71 | return 0; |
| r13798 | r13799 | |
|---|---|---|
| 107 | 107 | |
| 108 | 108 | ***************************************************************************/ |
| 109 | 109 | |
| 110 | static void draw_sprites(running_machine &machine, bitmap_t *bitmap,const rectangle | |
| 110 | static void draw_sprites(running_machine &machine, bitmap_t *bitmap,const rectangle &cliprect) | |
| 111 | 111 | { |
| 112 | 112 | sidepckt_state *state = machine.driver_data<sidepckt_state>(); |
| 113 | 113 | UINT8 *spriteram = state->m_spriteram; |
| r13798 | r13799 | |
|---|---|---|
| 131 | 131 | } |
| 132 | 132 | |
| 133 | 133 | |
| 134 | static void draw_ship(running_machine &machine, bitmap_t* bitmap, const rectangle | |
| 134 | static void draw_ship(running_machine &machine, bitmap_t* bitmap, const rectangle | |
| 135 | 135 | { |
| 136 | 136 | wolfpack_state *state = machine.driver_data<wolfpack_state>(); |
| 137 | 137 | static const UINT32 scaler[] = |
| r13798 | r13799 | |
| 167 | 167 | } |
| 168 | 168 | |
| 169 | 169 | |
| 170 | static void draw_torpedo(running_machine &machine, bitmap_t* bitmap, const rectangle | |
| 170 | static void draw_torpedo(running_machine &machine, bitmap_t* bitmap, const rectangle | |
| 171 | 171 | { |
| 172 | 172 | wolfpack_state *state = machine.driver_data<wolfpack_state>(); |
| 173 | 173 | int count = 0; |
| r13798 | r13799 | |
| 201 | 201 | } |
| 202 | 202 | |
| 203 | 203 | |
| 204 | static void draw_pt(running_machine &machine, bitmap_t* bitmap, const rectangle | |
| 204 | static void draw_pt(running_machine &machine, bitmap_t* bitmap, const rectangle | |
| 205 | 205 | { |
| 206 | 206 | wolfpack_state *state = machine.driver_data<wolfpack_state>(); |
| 207 | rectangle rect = | |
| 207 | rectangle rect = | |
| 208 | 208 | |
| 209 | 209 | if (!(state->m_pt_pic & 0x20)) |
| 210 | 210 | rect.min_x = 256; |
| r13798 | r13799 | |
| 212 | 212 | if (!(state->m_pt_pic & 0x10)) |
| 213 | 213 | rect.max_x = 255; |
| 214 | 214 | |
| 215 | drawgfx_transpen(bitmap, | |
| 215 | drawgfx_transpen(bitmap, | |
| 216 | 216 | machine.gfx[2], |
| 217 | 217 | state->m_pt_pic, |
| 218 | 218 | 0, |
| r13798 | r13799 | |
| 220 | 220 | 2 * state->m_pt_horz, |
| 221 | 221 | state->m_pt_pos_select ? 0x70 : 0xA0, 0); |
| 222 | 222 | |
| 223 | drawgfx_transpen(bitmap, | |
| 223 | drawgfx_transpen(bitmap, | |
| 224 | 224 | machine.gfx[2], |
| 225 | 225 | state->m_pt_pic, |
| 226 | 226 | 0, |
| r13798 | r13799 | |
| 230 | 230 | } |
| 231 | 231 | |
| 232 | 232 | |
| 233 | static void draw_water(colortable_t *colortable, bitmap_t* bitmap, const rectangle | |
| 233 | static void draw_water(colortable_t *colortable, bitmap_t* bitmap, const rectangle | |
| 234 | 234 | { |
| 235 | rectangle rect = | |
| 235 | rectangle rect = | |
| 236 | 236 | |
| 237 | 237 | int x; |
| 238 | 238 | int y; |
| r13798 | r13799 | |
| 267 | 267 | color < 0xb8 ? color + 0x48 : 0xff, |
| 268 | 268 | color < 0xb8 ? color + 0x48 : 0xff)); |
| 269 | 269 | |
| 270 | bitmap->fill(state->m_video_invert, | |
| 270 | bitmap->fill(state->m_video_invert, | |
| 271 | 271 | |
| 272 | 272 | for (i = 0; i < 8; i++) |
| 273 | 273 | for (j = 0; j < 32; j++) |
| r13798 | r13799 | |
| 300 | 300 | |
| 301 | 301 | state->m_helper->fill(0); |
| 302 | 302 | |
| 303 | draw_ship(screen.machine(), state->m_helper, | |
| 303 | draw_ship(screen.machine(), state->m_helper, | |
| 304 | 304 | |
| 305 | 305 | for (y = 128; y < 224 - state->m_torpedo_v; y++) |
| 306 | 306 | { |
| r13798 | r13799 | |
|---|---|---|
| 74 | 74 | |
| 75 | 75 | |
| 76 | 76 | |
| 77 | static void draw_sprites(running_machine &machine, bitmap_t *bitmap, const rectangle | |
| 77 | static void draw_sprites(running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect) | |
| 78 | 78 | { |
| 79 | 79 | pirates_state *state = machine.driver_data<pirates_state>(); |
| 80 | 80 | const gfx_element *gfx = machine.gfx[1]; |
| r13798 | r13799 | |
|---|---|---|
| 82 | 82 | state->m_bg_tilemap = tilemap_create(machine, get_bg_tile_info, tilemap_scan_rows, 8, 8, 32, 32); |
| 83 | 83 | } |
| 84 | 84 | |
| 85 | static void draw_bullets(running_machine &machine, bitmap_t *bitmap, const rectangle | |
| 85 | static void draw_bullets(running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect) | |
| 86 | 86 | { |
| 87 | 87 | tankbatt_state *state = machine.driver_data<tankbatt_state>(); |
| 88 | 88 | int offs; |
| r13798 | r13799 | |
|---|---|---|
| 234 | 234 | * |
| 235 | 235 | *************************************/ |
| 236 | 236 | |
| 237 | static void draw_background( running_machine &machine, bitmap_t *bitmap, const rectangle | |
| 237 | static void draw_background( running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect) | |
| 238 | 238 | { |
| 239 | 239 | exerion_state *state = machine.driver_data<exerion_state>(); |
| 240 | 240 | int x, y; |
| 241 | 241 | |
| 242 | 242 | /* loop over all visible scanlines */ |
| 243 | for (y = cliprect | |
| 243 | for (y = cliprect. | |
| 244 | 244 | { |
| 245 | 245 | UINT16 *src0 = &state->m_background_gfx[0][state->m_background_latches[1] * 256]; |
| 246 | 246 | UINT16 *src1 = &state->m_background_gfx[1][state->m_background_latches[3] * 256]; |
| r13798 | r13799 | |
| 266 | 266 | if (!state->m_cocktail_flip) |
| 267 | 267 | { |
| 268 | 268 | /* skip processing anything that's not visible */ |
| 269 | for (x = BACKGROUND_X_START; x < cliprect | |
| 269 | for (x = BACKGROUND_X_START; x < cliprect. | |
| 270 | 270 | { |
| 271 | 271 | if (!(++xoffs0 & 0x1f)) start0++, stop0++; |
| 272 | 272 | if (!(++xoffs1 & 0x1f)) start1++, stop1++; |
| r13798 | r13799 | |
| 275 | 275 | } |
| 276 | 276 | |
| 277 | 277 | /* draw the rest of the scanline fully */ |
| 278 | for (x = cliprect | |
| 278 | for (x = cliprect. | |
| 279 | 279 | { |
| 280 | 280 | UINT16 combined = 0; |
| 281 | 281 | UINT8 lookupval; |
| r13798 | r13799 | |
| 303 | 303 | else |
| 304 | 304 | { |
| 305 | 305 | /* skip processing anything that's not visible */ |
| 306 | for (x = BACKGROUND_X_START; x < cliprect | |
| 306 | for (x = BACKGROUND_X_START; x < cliprect. | |
| 307 | 307 | { |
| 308 | 308 | if (!(xoffs0-- & 0x1f)) start0++, stop0++; |
| 309 | 309 | if (!(xoffs1-- & 0x1f)) start1++, stop1++; |
| r13798 | r13799 | |
| 312 | 312 | } |
| 313 | 313 | |
| 314 | 314 | /* draw the rest of the scanline fully */ |
| 315 | for (x = cliprect | |
| 315 | for (x = cliprect. | |
| 316 | 316 | { |
| 317 | 317 | UINT16 combined = 0; |
| 318 | 318 | UINT8 lookupval; |
| r13798 | r13799 | |
| 339 | 339 | } |
| 340 | 340 | |
| 341 | 341 | /* draw the scanline */ |
| 342 | draw_scanline16(bitmap, cliprect | |
| 342 | draw_scanline16(bitmap, cliprect. | |
| 343 | 343 | } |
| 344 | 344 | } |
| 345 | 345 | |
| r13798 | r13799 | |
| 402 | 402 | } |
| 403 | 403 | |
| 404 | 404 | /* draw the visible text layer */ |
| 405 | for (sy = cliprect | |
| 405 | for (sy = cliprect. | |
| 406 | 406 | for (sx = VISIBLE_X_MIN/8; sx < VISIBLE_X_MAX/8; sx++) |
| 407 | 407 | { |
| 408 | 408 | int x = state->m_cocktail_flip ? (63*8 - 8*sx) : 8*sx; |
| r13798 | r13799 | |
|---|---|---|
| 104 | 104 | in the range 0x8-0xf are used. |
| 105 | 105 | */ |
| 106 | 106 | |
| 107 | static void draw_sprites(running_machine &machine, bitmap_t *bitmap, const rectangle | |
| 107 | static void draw_sprites(running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect, int priority) | |
| 108 | 108 | { |
| 109 | 109 | wrally_state *state = machine.driver_data<wrally_state>(); |
| 110 | 110 | int i, px, py; |
| r13798 | r13799 | |
| 144 | 144 | |
| 145 | 145 | int gfx_py = yflip ? (gfx->height - 1 - py) : py; |
| 146 | 146 | |
| 147 | if ((ypos < cliprect | |
| 147 | if ((ypos < cliprect. | |
| 148 | 148 | |
| 149 | 149 | for (px = 0; px < gfx->width; px++){ |
| 150 | 150 | /* get current pixel */ |
| r13798 | r13799 | |
| 160 | 160 | /* pens 8..15 are used to select a palette */ |
| 161 | 161 | if ((gfx_pen < 8) || (gfx_pen >= 16)) continue; |
| 162 | 162 | |
| 163 | if ((xpos < cliprect | |
| 163 | if ((xpos < cliprect. | |
| 164 | 164 | |
| 165 | 165 | /* modify the color of the tile */ |
| 166 | 166 | *pixel = src_color + (gfx_pen-8)*1024; |
| r13798 | r13799 | |
|---|---|---|
| 116 | 116 | * |
| 117 | 117 | *************************************/ |
| 118 | 118 | |
| 119 | static void draw_vdp(screen_device &screen, bitmap_t *bitmap, const rectangle | |
| 119 | static void draw_vdp(screen_device &screen, bitmap_t *bitmap, const rectangle &cliprect, int priority) | |
| 120 | 120 | { |
| 121 | 121 | segas1x_state *state = screen.machine().driver_data<segas1x_state>(); |
| 122 | 122 | int x, y; |
| 123 | 123 | bitmap_t *priority_bitmap = screen.machine().priority_bitmap; |
| 124 | 124 | |
| 125 | for (y = cliprect | |
| 125 | for (y = cliprect. | |
| 126 | 126 | { |
| 127 | 127 | UINT16 *src = &state->m_tmp_bitmap->pix16(y); |
| 128 | 128 | UINT16 *dst = &bitmap->pix16(y); |
| 129 | 129 | UINT8 *pri = &priority_bitmap->pix8(y); |
| 130 | 130 | |
| 131 | for (x = cliprect | |
| 131 | for (x = cliprect. | |
| 132 | 132 | { |
| 133 | 133 | UINT16 pix = src[x]; |
| 134 | 134 | if (pix != 0xffff) |
| r13798 | r13799 | |
| 202 | 202 | /* if no drawing is happening, fill with black and get out */ |
| 203 | 203 | if (!segaic16_display_enable) |
| 204 | 204 | { |
| 205 | bitmap->fill(get_black_pen(screen.machine()), | |
| 205 | bitmap->fill(get_black_pen(screen.machine()), | |
| 206 | 206 | return 0; |
| 207 | 207 | } |
| 208 | 208 | |
| r13798 | r13799 | |
| 211 | 211 | system18_vdp_update(state->m_tmp_bitmap, cliprect); |
| 212 | 212 | |
| 213 | 213 | /* reset priorities */ |
| 214 | screen.machine().priority_bitmap->fill(0, | |
| 214 | screen.machine().priority_bitmap->fill(0, | |
| 215 | 215 | |
| 216 | 216 | /* draw background opaquely first, not setting any priorities */ |
| 217 | 217 | segaic16_tilemap_draw(screen, bitmap, cliprect, 0, SEGAIC16_TILEMAP_BACKGROUND, 0 | TILEMAP_DRAW_OPAQUE, 0x00); |
| r13798 | r13799 | |
| 239 | 239 | #if DEBUG_VDP |
| 240 | 240 | if (state->m_vdp_enable && screen.machine().input().code_pressed(KEYCODE_V)) |
| 241 | 241 | { |
| 242 | bitmap->fill(get_black_pen(screen.machine()), | |
| 242 | bitmap->fill(get_black_pen(screen.machine()), | |
| 243 | 243 | update_system18_vdp(bitmap, cliprect); |
| 244 | 244 | } |
| 245 | 245 | if (vdp_enable && screen.machine().input().code_pressed(KEYCODE_B)) |
| r13798 | r13799 | |
|---|---|---|
| 140 | 140 | */ |
| 141 | 141 | |
| 142 | 142 | /* jumpkids / tumbleb.c! */ |
| 143 | static void draw_sprites( running_machine &machine, bitmap_t *bitmap, const rectangle | |
| 143 | static void draw_sprites( running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect ) | |
| 144 | 144 | { |
| 145 | 145 | crospang_state *state = machine.driver_data<crospang_state>(); |
| 146 | 146 | int offs; |
| r13798 | r13799 | |
|---|---|---|
| 141 | 141 | tilemap_set_scrollx(state->m_fgtilemap, 0, DM_GETSCROLL(0xa)); |
| 142 | 142 | tilemap_set_scrolly(state->m_fgtilemap, 0, DM_GETSCROLL(0xe)); |
| 143 | 143 | |
| 144 | bitmap->fill(get_black_pen(screen.machine()), | |
| 144 | bitmap->fill(get_black_pen(screen.machine()), | |
| 145 | 145 | |
| 146 | 146 | if(state->m_hw & DISPLAY_BG) |
| 147 | 147 | tilemap_draw(bitmap,cliprect,state->m_bgtilemap, 0,0); |
| r13798 | r13799 | |
|---|---|---|
| 758 | 758 | Sprite Handlers |
| 759 | 759 | ***************************************************************************/ |
| 760 | 760 | |
| 761 | void gp9001vdp_device::draw_sprites( running_machine &machine, bitmap_t *bitmap, const rectangle | |
| 761 | void gp9001vdp_device::draw_sprites( running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect, const UINT8* primap ) | |
| 762 | 762 | { |
| 763 | 763 | const gfx_element *gfx = machine.gfx[tile_region+1]; |
| 764 | 764 | |
| r13798 | r13799 | |
| 914 | 914 | { |
| 915 | 915 | int drawxx = xx+sx; |
| 916 | 916 | |
| 917 | if (drawxx>=cliprect | |
| 917 | if (drawxx>=cliprect. | |
| 918 | 918 | { |
| 919 | 919 | UINT8 pix = srcdata[count]; |
| 920 | 920 | UINT16* dstptr = &bitmap->pix16(drawyy, drawxx); |
| r13798 | r13799 | |
| 1004 | 1004 | |
| 1005 | 1005 | static const UINT8 batsugun_prienable0[16]={ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 }; |
| 1006 | 1006 | |
| 1007 | void gp9001vdp_device::gp9001_render_vdp(running_machine& machine, bitmap_t* bitmap, const rectangle | |
| 1007 | void gp9001vdp_device::gp9001_render_vdp(running_machine& machine, bitmap_t* bitmap, const rectangle | |
| 1008 | 1008 | { |
| 1009 | 1009 | if (gp9001_gfxrom_is_banked && gp9001_gfxrom_bank_dirty) |
| 1010 | 1010 | { |
| r13798 | r13799 | |
|---|---|---|
| 93 | 93 | |
| 94 | 94 | k052109_tilemap_update(state->m_k052109); |
| 95 | 95 | |
| 96 | screen.machine().priority_bitmap->fill(0, | |
| 96 | screen.machine().priority_bitmap->fill(0, | |
| 97 | 97 | |
| 98 | bitmap->fill(get_black_pen(screen.machine()), | |
| 98 | bitmap->fill(get_black_pen(screen.machine()), | |
| 99 | 99 | k052109_tilemap_draw(state->m_k052109, bitmap, cliprect, 2, 0, 1); |
| 100 | 100 | if (state->m_priority) |
| 101 | 101 | { |
| r13798 | r13799 | |
|---|---|---|
| 54 | 54 | UINT16 gp9001_gfxrom_bank[8]; /* Batrider object bank */ |
| 55 | 55 | |
| 56 | 56 | |
| 57 | void draw_sprites( running_machine &machine, bitmap_t *bitmap, const rectangle | |
| 57 | void draw_sprites( running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect, const UINT8* primap ); | |
| 58 | 58 | 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 | |
| 59 | void gp9001_render_vdp(running_machine& machine, bitmap_t* bitmap, const rectangle | |
| 60 | 60 | void gp9001_screen_eof(void); |
| 61 | 61 | void create_tilemaps(int region); |
| 62 | 62 | void init_scroll_regs(void); |
| r13798 | r13799 | |
|---|---|---|
| 28 | 28 | { |
| 29 | 29 | } |
| 30 | 30 | |
| 31 | static void draw_sprites( running_machine &machine, bitmap_t *bitmap, const rectangle | |
| 31 | static void draw_sprites( running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect ) | |
| 32 | 32 | { |
| 33 | 33 | funybubl_state *state = machine.driver_data<funybubl_state>(); |
| 34 | 34 | UINT8 *source = &state->m_banked_vram[0x2000 - 0x20]; |
| r13798 | r13799 | |
| 79 | 79 | int x, y, offs; |
| 80 | 80 | offs = 0; |
| 81 | 81 | |
| 82 | bitmap->fill(get_black_pen(screen.machine()), | |
| 82 | bitmap->fill(get_black_pen(screen.machine()), | |
| 83 | 83 | |
| 84 | 84 | /* tilemap .. convert it .. banking makes it slightly more annoying but still easy */ |
| 85 | 85 | for (y = 0; y < 32; y++) |
| r13798 | r13799 | |
|---|---|---|
| 69 | 69 | |
| 70 | 70 | get_pens(screen.machine(), pens); |
| 71 | 71 | |
| 72 | for (y = cliprect | |
| 72 | for (y = cliprect. | |
| 73 | 73 | { |
| 74 | 74 | UINT32 *dst = &bitmap->pix32(y); |
| 75 | 75 | |
| 76 | for (x = cliprect | |
| 76 | for (x = cliprect. | |
| 77 | 77 | { |
| 78 | 78 | UINT8 effx = x ^ xorx; |
| 79 | 79 | UINT8 yscroll = (effx < 192) ? *state->m_scroll : 0; |
| r13798 | r13799 | |
|---|---|---|
| 425 | 425 | |
| 426 | 426 | // manybloc uses extra flip bits on the sprites, but these break other games |
| 427 | 427 | |
| 428 | static void nmk16_draw_sprites(running_machine &machine, bitmap_t *bitmap, const rectangle | |
| 428 | static void nmk16_draw_sprites(running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect, int priority) | |
| 429 | 429 | { |
| 430 | 430 | nmk16_state *state = machine.driver_data<nmk16_state>(); |
| 431 | 431 | int offs; |
| r13798 | r13799 | |
| 476 | 476 | } |
| 477 | 477 | } |
| 478 | 478 | |
| 479 | static void nmk16_draw_sprites_flipsupported(running_machine &machine, bitmap_t *bitmap, const rectangle | |
| 479 | static void nmk16_draw_sprites_flipsupported(running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect, int priority) | |
| 480 | 480 | { |
| 481 | 481 | nmk16_state *state = machine.driver_data<nmk16_state>(); |
| 482 | 482 | int offs; |
| r13798 | r13799 | |
| 632 | 632 | nmk16_state *state = screen.machine().driver_data<nmk16_state>(); |
| 633 | 633 | int y1; |
| 634 | 634 | int i=16; |
| 635 | rectangle bgclip = | |
| 635 | rectangle bgclip = | |
| 636 | 636 | |
| 637 | 637 | // the hardware supports per-scanline X *and* Y scroll which isn't |
| 638 | 638 | // supported by tilemaps so we have to draw the tilemap one line at a time |
| 639 | y1 = cliprect | |
| 639 | y1 = cliprect. | |
| 640 | 640 | |
| 641 | 641 | if (!state->m_simple_scroll) |
| 642 | 642 | { |
| 643 | while (y1 <= cliprect | |
| 643 | while (y1 <= cliprect. | |
| 644 | 644 | { |
| 645 | 645 | int const yscroll = state->m_gunnail_scrollramy[0] + state->m_gunnail_scrollramy[y1]; |
| 646 | 646 | int tilemap_bank_select; |
| r13798 | r13799 | |
| 664 | 664 | tilemap_set_scrolly(bg_tilemap, 0, yscroll); |
| 665 | 665 | tilemap_set_scrollx(bg_tilemap,(i + yscroll) & 0x1ff, state->m_gunnail_scrollram[0] + state->m_gunnail_scrollram[i] - state->m_videoshift); |
| 666 | 666 | |
| 667 | tilemap_draw(bitmap, | |
| 667 | tilemap_draw(bitmap, | |
| 668 | 668 | |
| 669 | 669 | y1++; |
| 670 | 670 | i++; |
| r13798 | r13799 | |
| 727 | 727 | int numtile = data&0xfff; |
| 728 | 728 | int color = (data&0xf000)>>12; |
| 729 | 729 | |
| 730 | drawgfx_opaque(state->m_background_bitmap, | |
| 730 | drawgfx_opaque(state->m_background_bitmap,state->m_background_bitmap->cliprect(),screen.machine().gfx[3], | |
| 731 | 731 | numtile, |
| 732 | 732 | color, |
| 733 | 733 | 0,0, /* no flip */ |
| r13798 | r13799 | |
| 736 | 736 | data = tilerom[offs+0x1000+bank]; |
| 737 | 737 | numtile = data&0xfff; |
| 738 | 738 | color = (data&0xf000)>>12; |
| 739 | drawgfx_opaque(state->m_background_bitmap, | |
| 739 | drawgfx_opaque(state->m_background_bitmap,state->m_background_bitmap->cliprect(),screen.machine().gfx[3], | |
| 740 | 740 | numtile, |
| 741 | 741 | color, |
| 742 | 742 | 0,0, /* no flip */ |
| r13798 | r13799 | |
| 898 | 898 | |
| 899 | 899 | ***************************************************************************/ |
| 900 | 900 | |
| 901 | static void video_update(running_machine &machine, bitmap_t *bitmap, const rectangle | |
| 901 | static void video_update(running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect, | |
| 902 | 902 | int dsw_flipscreen, // 1 = Horizontal and vertical screen flip are hardwired to 2 dip switches |
| 903 | 903 | int xoffset, int yoffset, // bg_tilemap0 offsets |
| 904 | 904 | int attr_mask // "sprite active" mask |
| r13798 | r13799 | |
| 933 | 933 | tilemap_draw(bitmap,cliprect,state->m_tx_tilemap,0,0); |
| 934 | 934 | } |
| 935 | 935 | |
| 936 | static void redhawki_video_update(running_machine &machine, bitmap_t *bitmap, const rectangle | |
| 936 | static void redhawki_video_update(running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect ) | |
| 937 | 937 | { |
| 938 | 938 | nmk16_state *state = machine.driver_data<nmk16_state>(); |
| 939 | 939 |
| r13798 | r13799 | |
|---|---|---|
| 145 | 145 | static const int xpos[4] = { 4*8, 26*8, 7*8, 6*8}; |
| 146 | 146 | int i; |
| 147 | 147 | |
| 148 | bitmap->fill(0, | |
| 148 | bitmap->fill(0, | |
| 149 | 149 | |
| 150 | 150 | for (i = 0; i < 4; i++) |
| 151 | 151 | if (state->m_flip) |
| r13798 | r13799 | |
|---|---|---|
| 372 | 372 | lorescol = state->m_col8bit; |
| 373 | 373 | } |
| 374 | 374 | |
| 375 | for (y = cliprect | |
| 375 | for (y = cliprect. | |
| 376 | 376 | { |
| 377 | 377 | UINT16 y_offset = (y + state->m_v_scroll) * 256; |
| 378 | 378 | src = &state->m_video_ram[offset + y_offset]; |
| 379 | 379 | dest = &bitmap->pix32(y); |
| 380 | 380 | |
| 381 | for (x = cliprect | |
| 381 | for (x = cliprect. | |
| 382 | 382 | { |
| 383 | 383 | UINT8 x_offset = x + state->m_h_scroll; |
| 384 | 384 | UINT8 pen = *(src + x_offset); |
| r13798 | r13799 | |
|---|---|---|
| 341 | 341 | /* 2 512x256 bitmaps */ |
| 342 | 342 | |
| 343 | 343 | count = 0; |
| 344 | for (y = 0; y <= cliprect | |
| 344 | for (y = 0; y <= cliprect. | |
| 345 | 345 | { |
| 346 | 346 | for (x = 0; x < 512 / 2; x++) |
| 347 | 347 | { |
| 348 | if (x * 2 < cliprect | |
| 348 | if (x * 2 < cliprect. | |
| 349 | 349 | { |
| 350 | 350 | color = (state->m_bitmap0[count + (state->m_vbuffer ^ 1) * 0x20000 / 2] & 0xff00) >> 8; |
| 351 | 351 | bitmap->pix16(y, x * 2 + 0) = color + 0x100; |
| r13798 | r13799 | |
| 359 | 359 | } |
| 360 | 360 | |
| 361 | 361 | count = 0; |
| 362 | for (y = 0; y <= cliprect | |
| 362 | for (y = 0; y <= cliprect. | |
| 363 | 363 | { |
| 364 | 364 | for (x = 0; x < 512 / 2; x++) |
| 365 | 365 | { |
| 366 | if (x * 2 < cliprect | |
| 366 | if (x * 2 < cliprect. | |
| 367 | 367 | { |
| 368 | 368 | color = state->m_bitmap1[count + (state->m_vbuffer ^ 1) * 0x20000 / 2] & 0xff; |
| 369 | 369 | if (color != 0) |
| r13798 | r13799 | |
|---|---|---|
| 385 | 385 | int x,y; |
| 386 | 386 | UINT32 count; |
| 387 | 387 | |
| 388 | bitmap->fill(get_black_pen(screen.machine()), | |
| 388 | bitmap->fill(get_black_pen(screen.machine()), | |
| 389 | 389 | |
| 390 | 390 | if(!(SCC_DE_VREG)) //display enable |
| 391 | 391 | return 0; |
| r13798 | r13799 | |
|---|---|---|
| 205 | 205 | int xx,yy,count; |
| 206 | 206 | count = 0x000; |
| 207 | 207 | |
| 208 | bitmap->fill(0, | |
| 208 | bitmap->fill(0, | |
| 209 | 209 | |
| 210 | 210 | for (yy=0;yy<32;yy++) |
| 211 | 211 | { |
| r13798 | r13799 | |
|---|---|---|
| 86 | 86 | device_t *pandora = screen.machine().device("pandora"); |
| 87 | 87 | |
| 88 | 88 | /* This clears & redraws the entire screen each pass */ |
| 89 | bitmap->fill(0xf0, | |
| 89 | bitmap->fill(0xf0, | |
| 90 | 90 | pandora_update(pandora, bitmap, cliprect); |
| 91 | 91 | return 0; |
| 92 | 92 | } |
| r13798 | r13799 | |
|---|---|---|
| 146 | 146 | [2] xxxx xxxx X attribute |
| 147 | 147 | [3] xxxx xxxx sprite number |
| 148 | 148 | */ |
| 149 | static void zerotrgt_draw_sprites( running_machine &machine, bitmap_t *bitmap, const rectangle | |
| 149 | static void zerotrgt_draw_sprites( running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect ) | |
| 150 | 150 | { |
| 151 | 151 | cntsteer_state *state = machine.driver_data<cntsteer_state>(); |
| 152 | 152 | int offs; |
| r13798 | r13799 | |
| 204 | 204 | ---- --xx tile bank |
| 205 | 205 | */ |
| 206 | 206 | |
| 207 | static void cntsteer_draw_sprites( running_machine &machine, bitmap_t *bitmap, const rectangle | |
| 207 | static void cntsteer_draw_sprites( running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect ) | |
| 208 | 208 | { |
| 209 | 209 | cntsteer_state *state = machine.driver_data<cntsteer_state>(); |
| 210 | 210 | int offs; |
| r13798 | r13799 | |
| 258 | 258 | cntsteer_state *state = screen.machine().driver_data<cntsteer_state>(); |
| 259 | 259 | |
| 260 | 260 | if (state->m_disable_roz) |
| 261 | bitmap->fill(screen.machine().pens[8 * state->m_bg_color_bank], | |
| 261 | bitmap->fill(screen.machine().pens[8 * state->m_bg_color_bank], | |
| 262 | 262 | else |
| 263 | 263 | { |
| 264 | 264 | int p1, p2, p3, p4; |
| r13798 | r13799 | |
| 309 | 309 | cntsteer_state *state = screen.machine().driver_data<cntsteer_state>(); |
| 310 | 310 | |
| 311 | 311 | if (state->m_disable_roz) |
| 312 | bitmap->fill(screen.machine().pens[8 * state->m_bg_color_bank], | |
| 312 | bitmap->fill(screen.machine().pens[8 * state->m_bg_color_bank], | |
| 313 | 313 | else |
| 314 | 314 | { |
| 315 | 315 | int p1, p2, p3, p4; |
| r13798 | r13799 | |
|---|---|---|
| 70 | 70 | static SCREEN_UPDATE( csplayh5 ) |
| 71 | 71 | { |
| 72 | 72 | csplayh5_state *state = screen.machine().driver_data<csplayh5_state>(); |
| 73 | bitmap->fill(get_black_pen(screen.machine()), | |
| 73 | bitmap->fill(get_black_pen(screen.machine()), | |
| 74 | 74 | |
| 75 | 75 | copybitmap(bitmap, state->m_vdp0_bitmap, 0, 0, 0, 0, cliprect); |
| 76 | 76 |
| r13798 | r13799 | |
|---|---|---|
| 101 | 101 | flip_screen_set(screen.machine(), BIT(flip, 7)); |
| 102 | 102 | deco16ic_pf_update(state->m_deco_tilegen1, state->m_pf1_rowscroll, state->m_pf2_rowscroll); |
| 103 | 103 | |
| 104 | bitmap->fill(0, | |
| 104 | bitmap->fill(0, | |
| 105 | 105 | screen.machine().priority_bitmap->fill(0); |
| 106 | 106 | |
| 107 | 107 | deco16ic_tilemap_2_draw(state->m_deco_tilegen1, bitmap, cliprect, 0, 2); |
| r13798 | r13799 | |
|---|---|---|
| 76 | 76 | { |
| 77 | 77 | } |
| 78 | 78 | |
| 79 | static void draw_sprites( running_machine &machine, bitmap_t *bitmap, const rectangle | |
| 79 | static void draw_sprites( running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect ) | |
| 80 | 80 | { |
| 81 | 81 | discoboy_state *state = machine.driver_data<discoboy_state>(); |
| 82 | 82 | int flipscreen = 0; |
| r13798 | r13799 | |
| 157 | 157 | palette_set_color(screen.machine(), (i / 2) + 0x400, MAKE_RGB(r, g, b)); |
| 158 | 158 | } |
| 159 | 159 | |
| 160 | bitmap->fill(0x3ff, | |
| 160 | bitmap->fill(0x3ff, | |
| 161 | 161 | |
| 162 | 162 | for (y = 0; y < 32; y++) |
| 163 | 163 | { |
| r13798 | r13799 | |
|---|---|---|
| 201 | 201 | } |
| 202 | 202 | } |
| 203 | 203 | |
| 204 | static void draw_char(bitmap_t *bitmap, const rectangle | |
| 204 | static void draw_char(bitmap_t *bitmap, const rectangle &cliprect, const gfx_element *gfx, int ch, int att, int x, int y) | |
| 205 | 205 | { |
| 206 | 206 | int i,j; |
| 207 | 207 | const UINT8 *dp; |
| r13798 | r13799 | |
| 227 | 227 | } |
| 228 | 228 | } |
| 229 | 229 | |
| 230 | static void draw_framebuffer(running_machine &machine, bitmap_t *bitmap, const rectangle | |
| 230 | static void draw_framebuffer(running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect) | |
| 231 | 231 | { |
| 232 | 232 | mediagx_state *state = machine.driver_data<mediagx_state>(); |
| 233 | 233 | int i, j; |
| r13798 | r13799 | |
| 320 | 320 | } |
| 321 | 321 | } |
| 322 | 322 | |
| 323 | static void draw_cga(running_machine &machine, bitmap_t *bitmap, const rectangle | |
| 323 | static void draw_cga(running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect) | |
| 324 | 324 | { |
| 325 | 325 | mediagx_state *state = machine.driver_data<mediagx_state>(); |
| 326 | 326 | int i, j; |
| r13798 | r13799 | |
| 347 | 347 | static SCREEN_UPDATE(mediagx) |
| 348 | 348 | { |
| 349 | 349 | mediagx_state *state = screen.machine().driver_data<mediagx_state>(); |
| 350 | bitmap->fill(0, | |
| 350 | bitmap->fill(0, | |
| 351 | 351 | |
| 352 | 352 | draw_framebuffer(screen.machine(), bitmap, cliprect); |
| 353 | 353 |
| r13798 | r13799 | |
|---|---|---|
| 395 | 395 | state->save_item(NAME(state->m_sprites_buffer)); |
| 396 | 396 | } |
| 397 | 397 | |
| 398 | static void draw_sprites( running_machine &machine, bitmap_t *bitmap, const rectangle | |
| 398 | static void draw_sprites( running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect ) | |
| 399 | 399 | { |
| 400 | 400 | mwarr_state *state = machine.driver_data<mwarr_state>(); |
| 401 | 401 | const UINT16 *source = state->m_sprites_buffer + 0x800 - 4; |
| r13798 | r13799 | |
| 471 | 471 | mwarr_state *state = screen.machine().driver_data<mwarr_state>(); |
| 472 | 472 | int i; |
| 473 | 473 | |
| 474 | screen.machine().priority_bitmap->fill(0, | |
| 474 | screen.machine().priority_bitmap->fill(0, | |
| 475 | 475 | |
| 476 | 476 | if (BIT(state->m_vidattrram[6], 0)) |
| 477 | 477 | { |
| r13798 | r13799 | |
|---|---|---|
| 210 | 210 | UINT16 pixdata1; |
| 211 | 211 | const pen_t *paldata = screen.machine().pens; |
| 212 | 212 | |
| 213 | bitmap->fill(0x0000, | |
| 213 | bitmap->fill(0x0000, | |
| 214 | 214 | |
| 215 | 215 | { |
| 216 | 216 | int drawy, drawx; |
| r13798 | r13799 | |
| 352 | 352 | } |
| 353 | 353 | } |
| 354 | 354 | |
| 355 | state->m_sprite_bitmap_1->fill(0x0000, | |
| 355 | state->m_sprite_bitmap_1->fill(0x0000, | |
| 356 | 356 | |
| 357 | 357 | 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 ); |
| 358 | 358 |
| r13798 | r13799 | |
|---|---|---|
| 114 | 114 | |
| 115 | 115 | popmessage("%d %d %04x",state->m_test_x,state->m_test_y,state->m_start_offs); |
| 116 | 116 | |
| 117 | bitmap->fill(get_black_pen(screen.machine()), | |
| 117 | bitmap->fill(get_black_pen(screen.machine()), | |
| 118 | 118 | |
| 119 | 119 | count = (state->m_start_offs); |
| 120 | 120 |
| r13798 | r13799 | |
|---|---|---|
| 107 | 107 | include several similiarities with other Playmark games (including |
| 108 | 108 | the sprite end code and the data being offset (i.e. spriteram starting from 0x16/2)) |
| 109 | 109 | */ |
| 110 | static void draw_sprites(running_machine &machine, bitmap_t *bitmap, const rectangle | |
| 110 | static void draw_sprites(running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect) | |
| 111 | 111 | { |
| 112 | 112 | bestleag_state *state = machine.driver_data<bestleag_state>(); |
| 113 | 113 | UINT16 *spriteram16 = state->m_spriteram; |
| r13798 | r13799 | |
|---|---|---|
| 571 | 571 | |
| 572 | 572 | count = 0; |
| 573 | 573 | |
| 574 | bitmap->fill(screen.machine().pens[0], | |
| 574 | bitmap->fill(screen.machine().pens[0], | |
| 575 | 575 | |
| 576 | 576 | for(y = 0; y < 8; y++) |
| 577 | 577 | { |
| r13798 | r13799 | |
|---|---|---|
| 1267 | 1267 | } |
| 1268 | 1268 | |
| 1269 | 1269 | |
| 1270 | static void copylayer(running_machine &machine, bitmap_t *bitmap, const rectangle | |
| 1270 | static void copylayer(running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect, int layer ) | |
| 1271 | 1271 | { |
| 1272 | 1272 | dynax_state *state = machine.driver_data<dynax_state>(); |
| 1273 | 1273 | int x,y; |
| r13798 | r13799 | |
| 1285 | 1285 | |
| 1286 | 1286 | if (((state->m_ddenlovr_layer_enable2 << 4) | state->m_ddenlovr_layer_enable) & (1 << layer)) |
| 1287 | 1287 | { |
| 1288 | for (y = cliprect | |
| 1288 | for (y = cliprect. | |
| 1289 | 1289 | { |
| 1290 | for (x = cliprect | |
| 1290 | for (x = cliprect. | |
| 1291 | 1291 | { |
| 1292 | 1292 | int pen = state->m_ddenlovr_pixmap[layer][512 * ((y + scrolly) & 0x1ff) + ((x + scrollx) & 0x1ff)]; |
| 1293 | 1293 | if ((pen & transmask) != transpen) |
| r13798 | r13799 | |
| 1341 | 1341 | if (screen.machine().input().code_pressed_once(KEYCODE_F)) { base++; while ((gfx[base] & 0xf0) != 0x30) base++; } |
| 1342 | 1342 | #endif |
| 1343 | 1343 | |
| 1344 | bitmap->fill(state->m_ddenlovr_bgcolor, | |
| 1344 | bitmap->fill(state->m_ddenlovr_bgcolor, | |
| 1345 | 1345 | |
| 1346 | 1346 | #ifdef MAME_DEBUG |
| 1347 | 1347 | if (screen.machine().input().code_pressed(KEYCODE_Z)) |
| r13798 | r13799 | |
|---|---|---|
| 206 | 206 | tilemap_set_transparent_pen(state->m_tx_tilemap,0); |
| 207 | 207 | } |
| 208 | 208 | |
| 209 | static void draw_pixel( bitmap_t* bitmap, const rectangle | |
| 209 | static void draw_pixel( bitmap_t* bitmap, const rectangle &cliprect, int y, int x, int pen) | |
| 210 | 210 | { |
| 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; | |
| 215 | 215 | |
| 216 | 216 | bitmap->pix16(y, x) = pen; |
| 217 | 217 | } |
| 218 | 218 | |
| 219 | static UINT32 update_screen(screen_device &screen, bitmap_t *bitmap, const rectangle | |
| 219 | static UINT32 update_screen(screen_device &screen, bitmap_t *bitmap, const rectangle &cliprect, int screen_shift) | |
| 220 | 220 | { |
| 221 | 221 | cybertnk_state *state = screen.machine().driver_data<cybertnk_state>(); |
| 222 | 222 | |
| 223 | 223 | tilemap_set_scrolldx(state->m_tx_tilemap, screen_shift, screen_shift); |
| 224 | 224 | |
| 225 | 225 | |
| 226 | bitmap->fill(get_black_pen(screen.machine()), | |
| 226 | bitmap->fill(get_black_pen(screen.machine()), | |
| 227 | 227 | |
| 228 | 228 | { |
| 229 | 229 | int i; |
| r13798 | r13799 | |
| 460 | 460 | |
| 461 | 461 | popmessage("%02x %02x %04x %02x",state->m_test_x,state->m_test_y,state->m_start_offs,state->m_color_pen); |
| 462 | 462 | |
| 463 | bitmap->fill(get_black_pen(screen.machine()), | |
| 463 | bitmap->fill(get_black_pen(screen.machine()), | |
| 464 | 464 | |
| 465 | 465 | count = (state->m_start_offs); |
| 466 | 466 |
| r13798 | r13799 | |
|---|---|---|
| 213 | 213 | //popmessage("%02x",state->m_janshi_crtc_regs[0x0a]); |
| 214 | 214 | col_bank = (state->m_janshi_crtc_regs[0x0a] & 0x40) >> 6; |
| 215 | 215 | |
| 216 | bitmap->fill(get_black_pen(screen.machine()), | |
| 216 | bitmap->fill(get_black_pen(screen.machine()), | |
| 217 | 217 | |
| 218 | 218 | /* FIXME: color is a bit of a mystery */ |
| 219 | 219 | { |
| r13798 | r13799 | |
|---|---|---|
| 148 | 148 | tilemap_set_transparent_pen(state->m_bg_tilemap, 0); |
| 149 | 149 | } |
| 150 | 150 | |
| 151 | static void draw_sprites( running_machine &machine, bitmap_t *bitmap, const rectangle | |
| 151 | static void draw_sprites( running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect ) | |
| 152 | 152 | { |
| 153 | 153 | chanbara_state *state = machine.driver_data<chanbara_state>(); |
| 154 | 154 | int offs; |
| r13798 | r13799 | |
|---|---|---|
| 65 | 65 | { |
| 66 | 66 | int tile = ((m_vram[count+1]<<8) | m_vram[count]) & 0xffff; |
| 67 | 67 | |
| 68 | drawgfx_opaque(&bitmap, | |
| 68 | drawgfx_opaque(&bitmap, | |
| 69 | 69 | count+=2; |
| 70 | 70 | } |
| 71 | 71 | } |
| r13798 | r13799 | |
|---|---|---|
| 127 | 127 | |
| 128 | 128 | scr=state->m_spectrum_video_ram; |
| 129 | 129 | |
| 130 | bitmap->fill(state->m_spectrum_port_fe & 0x07, | |
| 130 | bitmap->fill(state->m_spectrum_port_fe & 0x07, | |
| 131 | 131 | |
| 132 | 132 | for (y=0; y<192; y++) |
| 133 | 133 | { |
| r13798 | r13799 | |
|---|---|---|
| 126 | 126 | } |
| 127 | 127 | } |
| 128 | 128 | |
| 129 | static void fcrash_render_sprites( running_machine &machine, bitmap_t *bitmap, const rectangle | |
| 129 | static void fcrash_render_sprites( running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect ) | |
| 130 | 130 | { |
| 131 | 131 | cps_state *state = machine.driver_data<cps_state>(); |
| 132 | 132 | int pos; |
| r13798 | r13799 | |
| 159 | 159 | |
| 160 | 160 | } |
| 161 | 161 | |
| 162 | static void fcrash_render_layer( running_machine &machine, bitmap_t *bitmap, const rectangle | |
| 162 | static void fcrash_render_layer( running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect, int layer, int primask ) | |
| 163 | 163 | { |
| 164 | 164 | cps_state *state = machine.driver_data<cps_state>(); |
| 165 | 165 | |
| r13798 | r13799 | |
| 176 | 176 | } |
| 177 | 177 | } |
| 178 | 178 | |
| 179 | static void fcrash_render_high_layer( running_machine &machine, bitmap_t *bitmap, const rectangle | |
| 179 | static void fcrash_render_high_layer( running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect, int layer ) | |
| 180 | 180 | { |
| 181 | 181 | cps_state *state = machine.driver_data<cps_state>(); |
| 182 | 182 | |
| r13798 | r13799 | |
| 268 | 268 | tilemap_set_enable(state->m_bg_tilemap[2], 1); |
| 269 | 269 | |
| 270 | 270 | /* Blank screen */ |
| 271 | bitmap->fill(0xbff, | |
| 271 | bitmap->fill(0xbff, | |
| 272 | 272 | |
| 273 | screen.machine().priority_bitmap->fill(0, | |
| 273 | screen.machine().priority_bitmap->fill(0, | |
| 274 | 274 | l0 = (layercontrol >> 0x06) & 03; |
| 275 | 275 | l1 = (layercontrol >> 0x08) & 03; |
| 276 | 276 | l2 = (layercontrol >> 0x0a) & 03; |
| r13798 | r13799 | |
| 349 | 349 | tilemap_set_enable(state->m_bg_tilemap[2], 1); |
| 350 | 350 | |
| 351 | 351 | /* Blank screen */ |
| 352 | bitmap->fill(0xbff, | |
| 352 | bitmap->fill(0xbff, | |
| 353 | 353 | |
| 354 | screen.machine().priority_bitmap->fill(0, | |
| 354 | screen.machine().priority_bitmap->fill(0, | |
| 355 | 355 | l0 = (layercontrol >> 0x06) & 03; |
| 356 | 356 | l1 = (layercontrol >> 0x08) & 03; |
| 357 | 357 | l2 = (layercontrol >> 0x0a) & 03; |
| r13798 | r13799 | |
|---|---|---|
| 525 | 525 | { |
| 526 | 526 | majorpkr_state *state = screen.machine().driver_data<majorpkr_state>(); |
| 527 | 527 | |
| 528 | bitmap->fill(get_black_pen(screen.machine()), | |
| 528 | bitmap->fill(get_black_pen(screen.machine()), | |
| 529 | 529 | |
| 530 | 530 | rectangle custom_clip; |
| 531 | 531 | |
| 532 | 532 | /* The following custom_clip is to exclude the last char column (unused) |
| 533 | 533 | form the render. We need more proof about how the video is working. |
| 534 | 534 | */ |
| 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; | |
| 539 | 539 | |
| 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); | |
| 542 | 542 | |
| 543 | 543 | if (state->m_flip_state == 1) |
| 544 | 544 | { |
| r13798 | r13799 | |
|---|---|---|
| 247 | 247 | |
| 248 | 248 | ***************************************************************************/ |
| 249 | 249 | |
| 250 | static void draw_sprite(running_machine &machine, bitmap_t *bitmap,const rectangle | |
| 250 | static 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) | |
| 251 | 251 | { |
| 252 | 252 | igs017_state *state = machine.driver_data<igs017_state>(); |
| 253 | 253 | // prepare GfxElement on the fly |
| r13798 | r13799 | |
| 265 | 265 | sx, sy, 0x1f ); |
| 266 | 266 | } |
| 267 | 267 | |
| 268 | static void draw_sprites(running_machine &machine, bitmap_t *bitmap,const rectangle | |
| 268 | static void draw_sprites(running_machine &machine, bitmap_t *bitmap,const rectangle &cliprect) | |
| 269 | 269 | { |
| 270 | 270 | igs017_state *state = machine.driver_data<igs017_state>(); |
| 271 | 271 | UINT8 *s = state->m_spriteram; |
| r13798 | r13799 | |
| 301 | 301 | } |
| 302 | 302 | |
| 303 | 303 | // A simple gfx viewer (toggle with T) |
| 304 | static int debug_viewer(running_machine &machine, bitmap_t *bitmap,const rectangle | |
| 304 | static int debug_viewer(running_machine &machine, bitmap_t *bitmap,const rectangle &cliprect) | |
| 305 | 305 | { |
| 306 | 306 | #ifdef MAME_DEBUG |
| 307 | 307 | igs017_state *state = machine.driver_data<igs017_state>(); |
| r13798 | r13799 | |
| 330 | 330 | if (w <= 0) w = 0; |
| 331 | 331 | if (w > 1024) w = 1024; |
| 332 | 332 | |
| 333 | bitmap->fill(0, | |
| 333 | bitmap->fill(0, | |
| 334 | 334 | |
| 335 | 335 | draw_sprite(machine, bitmap, cliprect, 0,0, w,h, 0,0, 0, a); |
| 336 | 336 | |
| r13798 | r13799 | |
| 363 | 363 | if (debug_viewer(screen.machine(), bitmap,cliprect)) |
| 364 | 364 | return 0; |
| 365 | 365 | |
| 366 | bitmap->fill(get_black_pen(screen.machine()), | |
| 366 | bitmap->fill(get_black_pen(screen.machine()), | |
| 367 | 367 | |
| 368 | 368 | if (state->m_video_disable) |
| 369 | 369 | return 0; |
| r13798 | r13799 | |
|---|---|---|
| 92 | 92 | fclose(p); |
| 93 | 93 | } |
| 94 | 94 | |
| 95 | bitmap->fill(0, | |
| 95 | bitmap->fill(0, | |
| 96 | 96 | for(y=0;y<256;y++) |
| 97 | 97 | { |
| 98 | 98 | for(x=0;x<256;x++) |
| r13798 | r13799 | |
|---|---|---|
| 49 | 49 | /* and sprites) are stored in the same memory region, and information on */ |
| 50 | 50 | /* the background character columns is stored in the area dd00-dd3f */ |
| 51 | 51 | |
| 52 | bitmap->fill(255, | |
| 52 | bitmap->fill(255, | |
| 53 | 53 | |
| 54 | 54 | if (!state->m_video_enable) |
| 55 | 55 | return 0; |
| r13798 | r13799 | |
|---|---|---|
| 209 | 209 | static SCREEN_UPDATE( dynadice ) |
| 210 | 210 | { |
| 211 | 211 | dynadice_state *state = screen.machine().driver_data<dynadice_state>(); |
| 212 | rectangle myclip = | |
| 212 | rectangle myclip = | |
| 213 | 213 | myclip.max_x = 15; |
| 214 | 214 | tilemap_draw(bitmap, cliprect, state->m_bg_tilemap, 0, 0); |
| 215 | tilemap_draw(bitmap, | |
| 215 | tilemap_draw(bitmap, | |
| 216 | 216 | return 0; |
| 217 | 217 | } |
| 218 | 218 |
| r13798 | r13799 | |
|---|---|---|
| 125 | 125 | jangou_state *state = screen.machine().driver_data<jangou_state>(); |
| 126 | 126 | int x, y; |
| 127 | 127 | |
| 128 | for (y = cliprect | |
| 128 | for (y = cliprect. | |
| 129 | 129 | { |
| 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); | |
| 132 | 132 | |
| 133 | for (x = cliprect | |
| 133 | for (x = cliprect. | |
| 134 | 134 | { |
| 135 | 135 | UINT32 srcpix = *src++; |
| 136 | 136 | *dst++ = screen.machine().pens[srcpix & 0xf]; |
| r13798 | r13799 | |
|---|---|---|
| 236 | 236 | int y; |
| 237 | 237 | |
| 238 | 238 | /* loop over rows and copy to the destination */ |
| 239 | for (y = cliprect | |
| 239 | for (y = cliprect. | |
| 240 | 240 | { |
| 241 | 241 | UINT32 *src = &state->m_video_base[640/4 * y]; |
| 242 | UINT16 *dest = &bitmap->pix16(y, cliprect | |
| 242 | UINT16 *dest = &bitmap->pix16(y, cliprect. | |
| 243 | 243 | int x; |
| 244 | 244 | |
| 245 | 245 | /* loop over columns */ |
| 246 | for (x = cliprect | |
| 246 | for (x = cliprect. | |
| 247 | 247 | { |
| 248 | 248 | UINT32 data = *src++; |
| 249 | 249 |
| r13798 | r13799 | |
|---|---|---|
| 79 | 79 | { |
| 80 | 80 | suprgolf_state *state = screen.machine().driver_data<suprgolf_state>(); |
| 81 | 81 | int x,y,count,color; |
| 82 | bitmap->fill(get_black_pen(screen.machine()), | |
| 82 | bitmap->fill(get_black_pen(screen.machine()), | |
| 83 | 83 | |
| 84 | 84 | { |
| 85 | 85 | count = 0; |
| r13798 | r13799 | |
| 90 | 90 | { |
| 91 | 91 | color = state->m_bg_fb[count]; |
| 92 | 92 | |
| 93 | if(x <= cliprect | |
| 93 | if(x <= cliprect. | |
| 94 | 94 | bitmap->pix16(y, x) = screen.machine().pens[(color & 0x7ff)]; |
| 95 | 95 | |
| 96 | 96 | count++; |
| r13798 | r13799 | |
| 107 | 107 | { |
| 108 | 108 | color = state->m_fg_fb[count]; |
| 109 | 109 | |
| 110 | if(((state->m_fg_fb[count] & 0x0f) != 0x0f) && (x <= cliprect | |
| 110 | if(((state->m_fg_fb[count] & 0x0f) != 0x0f) && (x <= cliprect. | |
| 111 | 111 | bitmap->pix16(y, x) = screen.machine().pens[(color & 0x7ff)]; |
| 112 | 112 | |
| 113 | 113 | count++; |
| r13798 | r13799 | |
|---|---|---|
| 191 | 191 | bitmap.fill(0, cliprect); |
| 192 | 192 | |
| 193 | 193 | /* graphics */ |
| 194 | m_h63484->update_screen(&bitmap, | |
| 194 | m_h63484->update_screen(&bitmap, | |
| 195 | 195 | |
| 196 | 196 | return 0; |
| 197 | 197 | } |
| r13798 | r13799 | |
|---|---|---|
| 102 | 102 | |
| 103 | 103 | //popmessage("%04x",m_start_offs); |
| 104 | 104 | |
| 105 | bitmap->fill(get_black_pen(screen.machine()), | |
| 105 | bitmap->fill(get_black_pen(screen.machine()), | |
| 106 | 106 | |
| 107 | 107 | for(y=0;y<200/8;y++) |
| 108 | 108 | { |
| r13798 | r13799 | |
|---|---|---|
| 347 | 347 | const gfx_element *sprites = screen.machine().gfx[1]; |
| 348 | 348 | const gfx_element *track = screen.machine().gfx[2]; |
| 349 | 349 | |
| 350 | bitmap->fill(get_black_pen(screen.machine()), | |
| 350 | bitmap->fill(get_black_pen(screen.machine()), | |
| 351 | 351 | |
| 352 | 352 | |
| 353 | 353 | /* Draw racetrack |
| r13798 | r13799 | |
|---|---|---|
| 109 | 109 | palette_set_color(machine,3, MAKE_RGB(0x00,0x00,0x00)); |
| 110 | 110 | } |
| 111 | 111 | |
| 112 | static void draw_boxer( running_machine &machine, bitmap_t* bitmap, const rectangle | |
| 112 | static void draw_boxer( running_machine &machine, bitmap_t* bitmap, const rectangle | |
| 113 | 113 | { |
| 114 | 114 | boxer_state *state = machine.driver_data<boxer_state>(); |
| 115 | 115 | int n; |
| r13798 | r13799 | |
| 162 | 162 | boxer_state *state = screen.machine().driver_data<boxer_state>(); |
| 163 | 163 | int i, j; |
| 164 | 164 | |
| 165 | bitmap->fill(1, | |
| 165 | bitmap->fill(1, | |
| 166 | 166 | |
| 167 | 167 | for (i = 0; i < 16; i++) |
| 168 | 168 | { |
| r13798 | r13799 | |
|---|---|---|
| 364 | 364 | st0016_draw_screen(screen, state->m_bitmap, cliprect); |
| 365 | 365 | |
| 366 | 366 | //copy temporary bitmap to rgb 32 bit bitmap |
| 367 | for(y=cliprect | |
| 367 | for(y=cliprect. | |
| 368 | 368 | { |
| 369 | 369 | UINT16 *srcline = &state->m_bitmap->pix16(y); |
| 370 | for(x=cliprect | |
| 370 | for(x=cliprect. | |
| 371 | 371 | { |
| 372 | 372 | if(srcline[x]) |
| 373 | 373 | { |
| r13798 | r13799 | |
|---|---|---|
| 73 | 73 | nightgal_state *state = screen.machine().driver_data<nightgal_state>(); |
| 74 | 74 | int x, y; |
| 75 | 75 | |
| 76 | for (y = cliprect | |
| 76 | for (y = cliprect. | |
| 77 | 77 | { |
| 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); | |
| 80 | 80 | |
| 81 | for (x = cliprect | |
| 81 | for (x = cliprect. | |
| 82 | 82 | { |
| 83 | 83 | UINT32 srcpix = *src++; |
| 84 | 84 | *dst++ = screen.machine().pens[srcpix & 0xf]; |
| r13798 | r13799 | |
|---|---|---|
| 297 | 297 | /* If screen output is disabled, fill with black */ |
| 298 | 298 | if (!(VREG(VCR0) & VCR0_DEN)) |
| 299 | 299 | { |
| 300 | bitmap->fill(get_black_pen(screen.machine()), | |
| 300 | bitmap->fill(get_black_pen(screen.machine()), | |
| 301 | 301 | return 0; |
| 302 | 302 | } |
| 303 | 303 | |
| 304 | 304 | /* For every scanline... */ |
| 305 | for (sl = cliprect | |
| 305 | for (sl = cliprect. | |
| 306 | 306 | { |
| 307 | 307 | int obj; |
| 308 | 308 | UINT16 aflags = atable[sl]; |
| r13798 | r13799 | |
| 399 | 399 | } |
| 400 | 400 | |
| 401 | 401 | // Write it out |
| 402 | for (sx = cliprect | |
| 402 | for (sx = cliprect. | |
| 403 | 403 | { |
| 404 | 404 | UINT8 pix = i82716.line_buf[sx / 2]; |
| 405 | 405 |
| r13798 | r13799 | |
|---|---|---|
| 449 | 449 | int xsize,ysize; |
| 450 | 450 | int pal; |
| 451 | 451 | UINT16* spriteregion = &state->m_region4[0x400]; |
| 452 | bitmap->fill(get_black_pen(screen.machine()), | |
| 452 | bitmap->fill(get_black_pen(screen.machine()), | |
| 453 | 453 | //printf("frame\n"); |
| 454 | 454 | /* the spriteram format is something like this .. */ |
| 455 | 455 | for (offs=0x26/2;offs<0xc00;offs+=6) // start at 00x26? |
| r13798 | r13799 | |
|---|---|---|
| 2083 | 2083 | const namcos23_poly_entry *p = render.poly_order[i]; |
| 2084 | 2084 | namcos23_render_data *rd = (namcos23_render_data *)poly_get_extra_data(render.polymgr); |
| 2085 | 2085 | *rd = p->rd; |
| 2086 | poly_render_triangle_fan(render.polymgr, bitmap, | |
| 2086 | poly_render_triangle_fan(render.polymgr, bitmap, | |
| 2087 | 2087 | } |
| 2088 | 2088 | render.poly_count = 0; |
| 2089 | 2089 | } |
| r13798 | r13799 | |
| 2136 | 2136 | static SCREEN_UPDATE( ss23 ) |
| 2137 | 2137 | { |
| 2138 | 2138 | namcos23_state *state = screen.machine().driver_data<namcos23_state>(); |
| 2139 | bitmap->fill(get_black_pen(screen.machine()), | |
| 2139 | bitmap->fill(get_black_pen(screen.machine()), | |
| 2140 | 2140 | |
| 2141 | 2141 | render_run( screen.machine(), bitmap ); |
| 2142 | 2142 |
| r13798 | r13799 | |
|---|---|---|
| 146 | 146 | copybitmap_trans(bitmap, state->m_tmpbitmap1, flip, flip, 2, 0, cliprect, 0); |
| 147 | 147 | } |
| 148 | 148 | else |
| 149 | bitmap->fill(get_black_pen(screen.machine()), | |
| 149 | bitmap->fill(get_black_pen(screen.machine()), | |
| 150 | 150 | return 0; |
| 151 | 151 | } |
| 152 | 152 |
| r13798 | r13799 | |
|---|---|---|
| 568 | 568 | { |
| 569 | 569 | wheelfir_state *state = screen.machine().driver_data<wheelfir_state>(); |
| 570 | 570 | |
| 571 | bitmap->fill(0, | |
| 571 | bitmap->fill(0, | |
| 572 | 572 | |
| 573 | 573 | for(int y=0;y<NUM_SCANLINES;++y) |
| 574 | 574 | { |
| r13798 | r13799 | |
|---|---|---|
| 519 | 519 | s2636_3_bitmap = s2636_update(state->m_s2636_3, cliprect); |
| 520 | 520 | |
| 521 | 521 | /* copy the S2636 images into the main bitmap */ |
| 522 | for (y = cliprect | |
| 522 | for (y = cliprect. | |
| 523 | 523 | { |
| 524 | 524 | int x; |
| 525 | 525 | |
| 526 | for (x = cliprect | |
| 526 | for (x = cliprect. | |
| 527 | 527 | { |
| 528 | 528 | int pixel1 = s2636_1_bitmap->pix16(y, x); |
| 529 | 529 | int pixel2 = s2636_2_bitmap->pix16(y, x); |
| r13798 | r13799 | |
|---|---|---|
| 451 | 451 | |
| 452 | 452 | SCREEN_UPDATE( champbwl ) |
| 453 | 453 | { |
| 454 | bitmap->fill(0x1f0, | |
| 454 | bitmap->fill(0x1f0, | |
| 455 | 455 | |
| 456 | 456 | screen.machine().device<seta001_device>("spritegen")->set_fg_yoffsets( -0x12, 0x0e ); |
| 457 | 457 | screen.machine().device<seta001_device>("spritegen")->set_bg_yoffsets( 0x1, -0x1 ); |
| r13798 | r13799 | |
| 509 | 509 | |
| 510 | 510 | static SCREEN_UPDATE( doraemon ) |
| 511 | 511 | { |
| 512 | bitmap->fill(0x1f0, | |
| 512 | bitmap->fill(0x1f0, | |
| 513 | 513 | |
| 514 | 514 | screen.machine().device<seta001_device>("spritegen")->set_bg_yoffsets( 0x00, 0x01 ); |
| 515 | 515 | screen.machine().device<seta001_device>("spritegen")->set_fg_yoffsets( 0x00, 0x10 ); |
| r13798 | r13799 | |
|---|---|---|
| 469 | 469 | y = 256 - y; |
| 470 | 470 | } |
| 471 | 471 | |
| 472 | drawgfx_transpen(bitmap, | |
| 472 | drawgfx_transpen(bitmap, | |
| 473 | 473 | } |
| 474 | 474 | } |
| 475 | 475 | } |
| r13798 | r13799 | |
| 523 | 523 | y = 256 - y; |
| 524 | 524 | } |
| 525 | 525 | |
| 526 | drawgfx_transpen(bitmap, | |
| 526 | drawgfx_transpen(bitmap, | |
| 527 | 527 | } |
| 528 | 528 | } |
| 529 | 529 | } |
| r13798 | r13799 | |
| 531 | 531 | |
| 532 | 532 | static SCREEN_UPDATE( common ) |
| 533 | 533 | { |
| 534 | bitmap->fill(0, | |
| 534 | bitmap->fill(0, | |
| 535 | 535 | draw_sprites(screen, bitmap); |
| 536 | 536 | return 0; |
| 537 | 537 | } |
| 538 | 538 | |
| 539 | 539 | static SCREEN_UPDATE( aoh ) |
| 540 | 540 | { |
| 541 | bitmap->fill(0, | |
| 541 | bitmap->fill(0, | |
| 542 | 542 | draw_sprites_aoh(screen, bitmap); |
| 543 | 543 | return 0; |
| 544 | 544 | } |
| r13798 | r13799 | |
|---|---|---|
| 74 | 74 | { |
| 75 | 75 | int y; |
| 76 | 76 | |
| 77 | for (y = cliprect | |
| 77 | for (y = cliprect. | |
| 78 | 78 | { |
| 79 | 79 | int x; |
| 80 | 80 | |
| 81 | for (x = cliprect | |
| 81 | for (x = cliprect. | |
| 82 | 82 | { |
| 83 | 83 | int pixel0 = s2636_0_bitmap->pix16(y, x); |
| 84 | 84 | int pixel1 = s2636_1_bitmap->pix16(y, x); |
| r13798 | r13799 | |
|---|---|---|
| 200 | 200 | |
| 201 | 201 | /* ROZ Layers */ |
| 202 | 202 | |
| 203 | static void draw_roz(running_machine &machine, bitmap_t *bitmap, const rectangle | |
| 203 | static void draw_roz(running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect, int priority, int chip) | |
| 204 | 204 | { |
| 205 | 205 | bnstars_state *state = machine.driver_data<bnstars_state>(); |
| 206 | 206 | /* TODO: registers 0x40/4 / 0x44/4 and 0x50/4 / 0x54/4 are used, meaning unknown */ |
| r13798 | r13799 | |
| 213 | 213 | rectangle my_clip; |
| 214 | 214 | int y,maxy; |
| 215 | 215 | |
| 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; | |
| 218 | 218 | |
| 219 | y = cliprect->min_y; | |
| 220 | maxy = cliprect->max_y; | |
| 219 | y = cliprect.min_y; | |
| 220 | maxy = cliprect.max_y; | |
| 221 | 221 | |
| 222 | 222 | while (y <= maxy) |
| 223 | 223 | { |
| r13798 | r13799 | |
| 351 | 351 | |
| 352 | 352 | |
| 353 | 353 | /* SPRITES based on tetrisp2 for now, readd priority bits later */ |
| 354 | static void draw_sprites(running_machine &machine, bitmap_t *bitmap, const rectangle | |
| 354 | static void draw_sprites(running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect, UINT32 *sprram_top, size_t sprram_size, int region) | |
| 355 | 355 | { |
| 356 | 356 | bnstars_state *state = machine.driver_data<bnstars_state>(); |
| 357 | 357 | /*************************************************************************** |
| r13798 | r13799 | |
| 515 | 515 | { |
| 516 | 516 | bnstars_state *state = screen.machine().driver_data<bnstars_state>(); |
| 517 | 517 | |
| 518 | screen.machine().priority_bitmap->fill(0, | |
| 518 | screen.machine().priority_bitmap->fill(0, | |
| 519 | 519 | |
| 520 | bitmap->fill(0, | |
| 520 | bitmap->fill(0, | |
| 521 | 521 | |
| 522 | 522 | |
| 523 | 523 | 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 ); |
| r13798 | r13799 | |
| 540 | 540 | { |
| 541 | 541 | bnstars_state *state = screen.machine().driver_data<bnstars_state>(); |
| 542 | 542 | |
| 543 | screen.machine().priority_bitmap->fill(0, | |
| 543 | screen.machine().priority_bitmap->fill(0, | |
| 544 | 544 | |
| 545 | bitmap->fill(0x8000+0, | |
| 545 | bitmap->fill(0x8000+0, | |
| 546 | 546 | |
| 547 | 547 | |
| 548 | 548 | 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 ); |
| r13798 | r13799 | |
|---|---|---|
| 73 | 73 | { |
| 74 | 74 | } |
| 75 | 75 | |
| 76 | static void draw_sprites( running_machine& machine, bitmap_t *bitmap, const rectangle | |
| 76 | static void draw_sprites( running_machine& machine, bitmap_t *bitmap, const rectangle &cliprect ) | |
| 77 | 77 | { |
| 78 | 78 | diverboy_state *state = machine.driver_data<diverboy_state>(); |
| 79 | 79 | UINT16 *source = state->m_spriteram; |
| r13798 | r13799 | |
| 111 | 111 | |
| 112 | 112 | static SCREEN_UPDATE(diverboy) |
| 113 | 113 | { |
| 114 | // bitmap->fill(get_black_pen(screen.machine()), | |
| 114 | // bitmap->fill(get_black_pen(screen.machine()), | |
| 115 | 115 | draw_sprites(screen.machine(), bitmap, cliprect); |
| 116 | 116 | return 0; |
| 117 | 117 | } |
| r13798 | r13799 | |
|---|---|---|
| 420 | 420 | { |
| 421 | 421 | vmetal_state *state = screen.machine().driver_data<vmetal_state>(); |
| 422 | 422 | |
| 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); | |
| 425 | 425 | |
| 426 | 426 | tilemap_set_scrollx(state->m_mid2tilemap, 0, state->m_vmetal_videoregs[0x06a/2]-64 /*+ state->m_vmetal_videoregs[0x066/2]*/); |
| 427 | 427 | tilemap_set_scrollx(state->m_mid1tilemap, 0, state->m_vmetal_videoregs[0x07a/2]-64 /*+ state->m_vmetal_videoregs[0x076/2]*/); |
| r13798 | r13799 | |
|---|---|---|
| 188 | 188 | int sprite; |
| 189 | 189 | int gfxtop = screen.visible_area().min_y; |
| 190 | 190 | |
| 191 | bitmap->fill(palette_get_color(screen.machine(), 256), | |
| 191 | bitmap->fill(palette_get_color(screen.machine(), 256), | |
| 192 | 192 | |
| 193 | 193 | for( sprite = 0; sprite < 32; sprite++ ) |
| 194 | 194 | { |
| r13798 | r13799 | |
|---|---|---|
| 774 | 774 | { |
| 775 | 775 | } |
| 776 | 776 | |
| 777 | static void drawCrt( running_machine &machine, bitmap_t *bitmap,const rectangle | |
| 777 | static void drawCrt( running_machine &machine, bitmap_t *bitmap,const rectangle &cliprect ) | |
| 778 | 778 | { |
| 779 | 779 | dwarfd_state *state = machine.driver_data<dwarfd_state>(); |
| 780 | 780 | int x, y; |
| r13798 | r13799 | |
| 837 | 837 | |
| 838 | 838 | static SCREEN_UPDATE( dwarfd ) |
| 839 | 839 | { |
| 840 | bitmap->fill(get_black_pen(screen.machine()), | |
| 840 | bitmap->fill(get_black_pen(screen.machine()), | |
| 841 | 841 | drawCrt(screen.machine(), bitmap, cliprect); |
| 842 | 842 | return 0; |
| 843 | 843 | } |
| r13798 | r13799 | |
|---|---|---|
| 81 | 81 | int count = 0; |
| 82 | 82 | int y,x; |
| 83 | 83 | |
| 84 | bitmap->fill(0, | |
| 84 | bitmap->fill(0, | |
| 85 | 85 | |
| 86 | 86 | for (y=0;y<31;y++) |
| 87 | 87 | { |
| r13798 | r13799 | |
|---|---|---|
| 382 | 382 | popmessage("Layer 1 %sabled",state->m_layer1_enabled ? "en" : "dis"); |
| 383 | 383 | } |
| 384 | 384 | |
| 385 | bitmap->fill(get_black_pen(screen.machine()), | |
| 385 | bitmap->fill(get_black_pen(screen.machine()), | |
| 386 | 386 | |
| 387 | 387 | if ( state->m_layer0_enabled ) |
| 388 | 388 | { |
| r13798 | r13799 | |
|---|---|---|
| 151 | 151 | |
| 152 | 152 | //UINT32 offset = gpu.dpr << 5; |
| 153 | 153 | |
| 154 | for (y = cliprect | |
| 154 | for (y = cliprect. | |
| 155 | 155 | { |
| 156 | 156 | UINT16 *src = &state->m_screen_ram[(offset + (4096 * y)) / 2]; |
| 157 | UINT32 *dest = &bitmap->pix32(y, cliprect | |
| 157 | UINT32 *dest = &bitmap->pix32(y, cliprect. | |
| 158 | 158 | int x; |
| 159 | 159 | |
| 160 | for (x = cliprect | |
| 160 | for (x = cliprect. | |
| 161 | 161 | { |
| 162 | 162 | UINT16 data = *src++; |
| 163 | 163 | |
| r13798 | r13799 | |
| 271 | 271 | v3.x = gpu.points[i].x; |
| 272 | 272 | v3.y = gpu.points[i].y; |
| 273 | 273 | |
| 274 | poly_render_triangle(state->m_poly, 0, | |
| 274 | poly_render_triangle(state->m_poly, 0, | |
| 275 | 275 | v2 = v3; |
| 276 | 276 | } |
| 277 | 277 | } |
| r13798 | r13799 | |
|---|---|---|
| 671 | 671 | int x, y; |
| 672 | 672 | |
| 673 | 673 | /* draw the bitmap to the screen, looping over Y */ |
| 674 | for (y = cliprect | |
| 674 | for (y = cliprect. | |
| 675 | 675 | { |
| 676 | 676 | UINT16 *dst = &bitmap->pix16(y); |
| 677 | 677 | |
| r13798 | r13799 | |
| 684 | 684 | src3 = &videoram[get_bit3_addr(effy << 8)]; |
| 685 | 685 | |
| 686 | 686 | /* loop over X */ |
| 687 | for (x = cliprect | |
| 687 | for (x = cliprect. | |
| 688 | 688 | { |
| 689 | 689 | UINT8 pix = src[x / 4] >> (x & 3); |
| 690 | 690 | pix = ((pix >> 2) & 4) | ((pix << 1) & 2); |
| r13798 | r13799 | |
|---|---|---|
| 167 | 167 | { |
| 168 | 168 | igs_m027_state *state = screen.machine().driver_data<igs_m027_state>(); |
| 169 | 169 | //?????????? |
| 170 | bitmap->fill(get_black_pen(screen.machine()), | |
| 170 | bitmap->fill(get_black_pen(screen.machine()), | |
| 171 | 171 | |
| 172 | 172 | //?????? |
| 173 | 173 | tilemap_draw(bitmap,cliprect,state->m_igs_bg_tilemap,0,0); |
| r13798 | r13799 | |
|---|---|---|
| 653 | 653 | } |
| 654 | 654 | } |
| 655 | 655 | |
| 656 | bitmap->fill(get_black_pen(screen.machine()), | |
| 656 | bitmap->fill(get_black_pen(screen.machine()), | |
| 657 | 657 | |
| 658 | 658 | if (layers_ctrl & 1) |
| 659 | 659 | { |
| r13798 | r13799 | |
| 690 | 690 | if ( reelwrap_y-1 <= visible.max_y ) |
| 691 | 691 | tmp.max_y = reelwrap_y-1; |
| 692 | 692 | tilemap_set_scrolly(l->tmap, 0, reelscroll_y); |
| 693 | tilemap_draw(bitmap, | |
| 693 | tilemap_draw(bitmap, | |
| 694 | 694 | tmp.max_y = visible.max_y; |
| 695 | 695 | } |
| 696 | 696 | |
| r13798 | r13799 | |
| 700 | 700 | if ( reelwrap_y >= visible.min_y ) |
| 701 | 701 | tmp.min_y = reelwrap_y; |
| 702 | 702 | tilemap_set_scrolly(l->tmap, 0, -((reelwrap_y &0xff) | (reelscroll_y & 0x100))); |
| 703 | tilemap_draw(bitmap, | |
| 703 | tilemap_draw(bitmap, | |
| 704 | 704 | tmp.min_y = visible.min_y; |
| 705 | 705 | } |
| 706 | 706 | } |
| r13798 | r13799 | |
|---|---|---|
| 297 | 297 | tilemap_set_transparent_pen(state->m_fg_tilemap, 0); |
| 298 | 298 | } |
| 299 | 299 | |
| 300 | static void draw_sprites( running_machine &machine, bitmap_t *bitmap, const rectangle | |
| 300 | static void draw_sprites( running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect ) | |
| 301 | 301 | { |
| 302 | 302 | m63_state *state = machine.driver_data<m63_state>(); |
| 303 | 303 | int offs; |
| r13798 | r13799 | |
|---|---|---|
| 51 | 51 | { |
| 52 | 52 | } |
| 53 | 53 | |
| 54 | static void draw_sprites( running_machine &machine, bitmap_t *bitmap, const rectangle | |
| 54 | static void draw_sprites( running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect ) | |
| 55 | 55 | { |
| 56 | 56 | albazc_state *state = machine.driver_data<albazc_state>(); |
| 57 | 57 | int i; |
| r13798 | r13799 | |
| 79 | 79 | |
| 80 | 80 | static SCREEN_UPDATE(hanaroku) |
| 81 | 81 | { |
| 82 | bitmap->fill(0x1f0, | |
| 82 | bitmap->fill(0x1f0, | |
| 83 | 83 | draw_sprites(screen.machine(), bitmap, cliprect); |
| 84 | 84 | return 0; |
| 85 | 85 | } |
| r13798 | r13799 | |
|---|---|---|
| 91 | 91 | tilemap_set_transparent_pen(state->m_tmap, 0); |
| 92 | 92 | } |
| 93 | 93 | |
| 94 | static void draw_sprites(running_machine &machine, bitmap_t *bitmap, const rectangle | |
| 94 | static void draw_sprites(running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect) | |
| 95 | 95 | { |
| 96 | 96 | midas_state *state = machine.driver_data<midas_state>(); |
| 97 | 97 | UINT16 *s = state->m_gfxram + 0x8000; |
| r13798 | r13799 | |
| 190 | 190 | } |
| 191 | 191 | #endif |
| 192 | 192 | |
| 193 | bitmap->fill(4095, | |
| 193 | bitmap->fill(4095, | |
| 194 | 194 | |
| 195 | 195 | if (layers_ctrl & 2) draw_sprites(screen.machine(), bitmap,cliprect); |
| 196 | 196 | if (layers_ctrl & 1) tilemap_draw(bitmap,cliprect, state->m_tmap, 0, 0); |
| r13798 | r13799 | |
|---|---|---|
| 188 | 188 | #endif |
| 189 | 189 | |
| 190 | 190 | 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()), | |
| 191 | else bitmap->fill(get_black_pen(screen.machine()), | |
| 192 | 192 | if (layers_ctrl & 2) tilemap_draw(bitmap, cliprect, state->m_bg2_tmap, 0, 0); |
| 193 | 193 | if (layers_ctrl & 4) tilemap_draw(bitmap, cliprect, state->m_bg3_tmap, 0, 0); |
| 194 | 194 | if (layers_ctrl & 8) tilemap_draw(bitmap, cliprect, state->m_bg4_tmap, 0, 0); |
| r13798 | r13799 | |
|---|---|---|
| 158 | 158 | |
| 159 | 159 | taitotz_state *state = screen.machine().driver_data<taitotz_state>(); |
| 160 | 160 | |
| 161 | bitmap->fill(0, | |
| 161 | bitmap->fill(0, | |
| 162 | 162 | copybitmap_trans(bitmap, state->framebuffer, 0, 0, 0, 0, cliprect, 0); |
| 163 | 163 | |
| 164 | 164 | return 0; |
| r13798 | r13799 | |
|---|---|---|
| 107 | 107 | static SCREEN_UPDATE(cabaret) |
| 108 | 108 | { |
| 109 | 109 | cabaret_state *state = screen.machine().driver_data<cabaret_state>(); |
| 110 | bitmap->fill(get_black_pen(screen.machine()), | |
| 110 | bitmap->fill(get_black_pen(screen.machine()), | |
| 111 | 111 | |
| 112 | 112 | tilemap_draw(bitmap, cliprect, state->m_bg_tilemap, 0, 0); |
| 113 | 113 |
| r13798 | r13799 | |
|---|---|---|
| 158 | 158 | state->m_bg_tilemap = tilemap_create(machine, get_bg_tile_info, tilemap_scan_rows, 8, 8, 32, 32); |
| 159 | 159 | } |
| 160 | 160 | |
| 161 | static void draw_sprites( running_machine &machine, bitmap_t *bitmap, const rectangle | |
| 161 | static void draw_sprites( running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect ) | |
| 162 | 162 | { |
| 163 | 163 | olibochu_state *state = machine.driver_data<olibochu_state>(); |
| 164 | 164 | UINT8 *spriteram = state->m_spriteram; |
| r13798 | r13799 | |
|---|---|---|
| 90 | 90 | if (offset<0x8 ) state->m_ram[0x291d + 32*offset + 32*9] = data ^ 0x0f; |
| 91 | 91 | } |
| 92 | 92 | |
| 93 | static void draw_tilemap(running_machine &machine, bitmap_t *bitmap,const rectangle | |
| 93 | static void draw_tilemap(running_machine &machine, bitmap_t *bitmap,const rectangle &cliprect, | |
| 94 | 94 | int addr,int gfx0,int gfx1,int transparency) |
| 95 | 95 | { |
| 96 | 96 | tugboat_state *state = machine.driver_data<tugboat_state>(); |
| r13798 | r13799 | |
|---|---|---|
| 165 | 165 | 0x22, 0x22, 0x22, 0x22, 0x22, 0x11, 0x22, 0x22 |
| 166 | 166 | }; |
| 167 | 167 | |
| 168 | static void draw_sprites(running_machine &machine, bitmap_t *bitmap, const rectangle | |
| 168 | static void draw_sprites(running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect) | |
| 169 | 169 | { |
| 170 | 170 | kingdrby_state *state = machine.driver_data<kingdrby_state>(); |
| 171 | 171 | UINT8 *spriteram = state->m_spriteram; |
| r13798 | r13799 | |
| 231 | 231 | tilemap_draw(bitmap,cliprect,state->m_sc0_tilemap,0,0); |
| 232 | 232 | draw_sprites(screen.machine(),bitmap,cliprect); |
| 233 | 233 | tilemap_draw(bitmap,cliprect,state->m_sc1_tilemap,TILEMAP_DRAW_CATEGORY(1),0); |
| 234 | tilemap_draw(bitmap, | |
| 234 | tilemap_draw(bitmap, | |
| 235 | 235 | |
| 236 | 236 | return 0; |
| 237 | 237 | } |
| r13798 | r13799 | |
|---|---|---|
| 80 | 80 | } |
| 81 | 81 | |
| 82 | 82 | /* copied from Legionnaire */ |
| 83 | static void draw_sprites(running_machine &machine, bitmap_t *bitmap,const rectangle | |
| 83 | static void draw_sprites(running_machine &machine, bitmap_t *bitmap,const rectangle &cliprect,int pri) | |
| 84 | 84 | { |
| 85 | 85 | r2dx_v33_state *state = machine.driver_data<r2dx_v33_state>(); |
| 86 | 86 | UINT16 *spriteram16 = state->m_spriteram; |
| r13798 | r13799 | |
| 181 | 181 | |
| 182 | 182 | static SCREEN_UPDATE( rdx_v33 ) |
| 183 | 183 | { |
| 184 | bitmap->fill(get_black_pen(screen.machine()), | |
| 184 | bitmap->fill(get_black_pen(screen.machine()), | |
| 185 | 185 | |
| 186 | 186 | tilemap_draw(bitmap, cliprect, bg_tilemap, 0, 0); |
| 187 | 187 | tilemap_draw(bitmap, cliprect, md_tilemap, 0, 0); |
| r13798 | r13799 | |
|---|---|---|
| 142 | 142 | |
| 143 | 143 | count = state->m_base; |
| 144 | 144 | |
| 145 | bitmap->fill(get_black_pen(screen.machine()), | |
| 145 | bitmap->fill(get_black_pen(screen.machine()), | |
| 146 | 146 | for (y = 0 ; y < 256; y++) |
| 147 | 147 | { |
| 148 | 148 | for (x = 0; x < 512; x++) |
| r13798 | r13799 | |
|---|---|---|
| 248 | 248 | * |
| 249 | 249 | *************************************/ |
| 250 | 250 | |
| 251 | static void draw_sprites(running_machine &machine, bitmap_t *bitmap, const rectangle | |
| 251 | static void draw_sprites(running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect) | |
| 252 | 252 | { |
| 253 | 253 | const UINT8 *source; |
| 254 | 254 | looping_state *state = machine.driver_data<looping_state>(); |
| r13798 | r13799 | |
|---|---|---|
| 90 | 90 | state->m_bg_tilemap = tilemap_create(machine, get_k3_bg_tile_info, tilemap_scan_rows, 16, 16, 32, 64); |
| 91 | 91 | } |
| 92 | 92 | |
| 93 | static void draw_sprites( running_machine &machine, bitmap_t *bitmap, const rectangle | |
| 93 | static void draw_sprites( running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect ) | |
| 94 | 94 | { |
| 95 | 95 | k3_state *state = machine.driver_data<k3_state>(); |
| 96 | 96 | const gfx_element *gfx = machine.gfx[0]; |
| r13798 | r13799 | |
|---|---|---|
| 159 | 159 | int x, y; |
| 160 | 160 | |
| 161 | 161 | /* 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) | |
| 164 | 164 | { |
| 165 | 165 | UINT8 color = color_prom[((y & 0xf8) << 2) | (x >> 3)] >> (state->m_screen_flip ? 0 : 4); |
| 166 | 166 | UINT8 data = state->m_videoram[(((y ^ state->m_screen_flip) + yoffs) << 5) | ((x ^ state->m_screen_flip) >> 3)]; |
| r13798 | r13799 | |
|---|---|---|
| 52 | 52 | int charx, chary; |
| 53 | 53 | |
| 54 | 54 | /* clear */ |
| 55 | bitmap->fill(0, | |
| 55 | bitmap->fill(0, | |
| 56 | 56 | |
| 57 | 57 | /* Draw tiles */ |
| 58 | 58 | for (charx = 0; charx < 32; charx++) |
| r13798 | r13799 | |
|---|---|---|
| 1476 | 1476 | copy_scroll_xp(bitmap, state->m_render_layer[4], *state->m_scrollx1, *state->m_scrolly1); |
| 1477 | 1477 | } |
| 1478 | 1478 | else |
| 1479 | bitmap->fill(state->m_bgcolor, | |
| 1479 | bitmap->fill(state->m_bgcolor, | |
| 1480 | 1480 | |
| 1481 | 1481 | #ifdef MAME_DEBUG |
| 1482 | 1482 | if (input_port_read(screen.machine(), "DEBUG")) copy_scroll_xp(bitmap, state->m_render_layer[3], *state->m_scrollx0, *state->m_scrolly0); // not used??? |
| r13798 | r13799 | |
| 1500 | 1500 | if (state->m_io_ram[0xa0] & 0x80) |
| 1501 | 1501 | copy_scroll_op(bitmap, state->m_render_layer[2], *state->m_scrollx1, *state->m_scrolly1); |
| 1502 | 1502 | else |
| 1503 | bitmap->fill(state->m_bgcolor, | |
| 1503 | bitmap->fill(state->m_bgcolor, | |
| 1504 | 1504 | |
| 1505 | 1505 | copy_fixed_xp (bitmap, state->m_render_layer[1]); |
| 1506 | 1506 | copy_fixed_xp (bitmap, state->m_render_layer[0]); |
| r13798 | r13799 | |
|---|---|---|
| 89 | 89 | } /* namco_tilemap_init */ |
| 90 | 90 | |
| 91 | 91 | void |
| 92 | namco_tilemap_draw( bitmap_t *bitmap, const rectangle | |
| 92 | namco_tilemap_draw( bitmap_t *bitmap, const rectangle &cliprect, int pri ) | |
| 93 | 93 | { |
| 94 | 94 | int i; |
| 95 | 95 | for( i=0; i<6; i++ ) |
| r13798 | r13799 | |
| 266 | 266 | /**************************************************************************************/ |
| 267 | 267 | |
| 268 | 268 | static void zdrawgfxzoom( |
| 269 | bitmap_t *dest_bmp,const rectangle | |
| 269 | bitmap_t *dest_bmp,const rectangle &clip,const gfx_element *gfx, | |
| 270 | 270 | UINT32 code,UINT32 color,int flipx,int flipy,int sx,int sy, |
| 271 | 271 | int scalex, int scaley, int zpos ) |
| 272 | 272 | { |
| r13798 | r13799 | |
| 312 | 312 | y_index = 0; |
| 313 | 313 | } |
| 314 | 314 | |
| 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; | |
| 339 | 320 | } |
| 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 | } | |
| 340 | 337 | |
| 341 | 338 | if( ex>sx ) |
| 342 | 339 | { /* skip if inner loop doesn't draw anything */ |
| r13798 | r13799 | |
| 411 | 408 | } /* zdrawgfxzoom */ |
| 412 | 409 | |
| 413 | 410 | void |
| 414 | namcos2_draw_sprites(running_machine &machine, bitmap_t *bitmap, const rectangle | |
| 411 | namcos2_draw_sprites(running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect, int pri, int control ) | |
| 415 | 412 | { |
| 416 | 413 | int offset = (control & 0x000f) * (128*4); |
| 417 | 414 | int loop; |
| 418 | 415 | if( pri==0 ) |
| 419 | 416 | { |
| 420 | machine.priority_bitmap->fill(0, | |
| 417 | machine.priority_bitmap->fill(0, | |
| 421 | 418 | } |
| 422 | 419 | for( loop=0; loop < 128; loop++ ) |
| 423 | 420 | { |
| r13798 | r13799 | |
| 491 | 488 | } /* namcos2_draw_sprites */ |
| 492 | 489 | |
| 493 | 490 | void |
| 494 | namcos2_draw_sprites_metalhawk(running_machine &machine, bitmap_t *bitmap, const rectangle | |
| 491 | namcos2_draw_sprites_metalhawk(running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect, int pri ) | |
| 495 | 492 | { |
| 496 | 493 | /** |
| 497 | 494 | * word#0 |
| r13798 | r13799 | |
| 528 | 525 | int loop; |
| 529 | 526 | if( pri==0 ) |
| 530 | 527 | { |
| 531 | machine.priority_bitmap->fill(0, | |
| 528 | machine.priority_bitmap->fill(0, | |
| 532 | 529 | } |
| 533 | 530 | for( loop=0; loop < 128; loop++ ) |
| 534 | 531 | { |
| r13798 | r13799 | |
| 584 | 581 | rect.min_y=sy; |
| 585 | 582 | rect.max_y=sy+(sizey-1); |
| 586 | 583 | |
| 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; | |
| 591 | 588 | |
| 592 | 589 | if( !bBigSprite ) |
| 593 | 590 | { |
| r13798 | r13799 | |
| 610 | 607 | } |
| 611 | 608 | zdrawgfxzoom( |
| 612 | 609 | bitmap, |
| 613 | | |
| 610 | | |
| 614 | 611 | machine.gfx[0], |
| 615 | 612 | sprn, color, |
| 616 | 613 | flipx,flipy, |
| r13798 | r13799 | |
| 717 | 714 | * 0x14000 sprite list (page1) |
| 718 | 715 | */ |
| 719 | 716 | static void |
| 720 | draw_spriteC355(running_machine &machine, bitmap_t *bitmap, const rectangle | |
| 717 | draw_spriteC355(running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect, const UINT16 *pSource, int pri, int zpos ) | |
| 721 | 718 | { |
| 722 | 719 | UINT16 *spriteram16 = machine.generic.spriteram.u16; |
| 723 | 720 | unsigned screen_height_remaining, screen_width_remaining; |
| r13798 | r13799 | |
| 802 | 799 | clip.max_x = pWinAttr[1] - xscroll; |
| 803 | 800 | clip.min_y = pWinAttr[2] - yscroll; |
| 804 | 801 | 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; } | |
| 809 | 806 | hpos&=0x7ff; if( hpos&0x400 ) hpos |= ~0x7ff; /* sign extend */ |
| 810 | 807 | vpos&=0x7ff; if( vpos&0x400 ) vpos |= ~0x7ff; /* sign extend */ |
| 811 | 808 | |
| r13798 | r13799 | |
| 875 | 872 | { |
| 876 | 873 | zdrawgfxzoom( |
| 877 | 874 | bitmap, |
| 878 | | |
| 875 | | |
| 879 | 876 | machine.gfx[mGfxC355], |
| 880 | 877 | mpCodeToTile(machine, tile) + offset, |
| 881 | 878 | color, |
| r13798 | r13799 | |
| 926 | 923 | static void |
| 927 | 924 | DrawObjectList(running_machine &machine, |
| 928 | 925 | bitmap_t *bitmap, |
| 929 | const rectangle | |
| 926 | const rectangle &cliprect, | |
| 930 | 927 | int pri, |
| 931 | 928 | const UINT16 *pSpriteList16, |
| 932 | 929 | const UINT16 *pSpriteTable ) |
| r13798 | r13799 | |
| 942 | 939 | } /* DrawObjectList */ |
| 943 | 940 | |
| 944 | 941 | void |
| 945 | namco_obj_draw(running_machine &machine, bitmap_t *bitmap, const rectangle | |
| 942 | namco_obj_draw(running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect, int pri ) | |
| 946 | 943 | { |
| 947 | 944 | // int offs = spriteram16[0x18000/2]; /* end-of-sprite-list */ |
| 948 | 945 | if( pri==0 ) |
| 949 | 946 | { |
| 950 | machine.priority_bitmap->fill(0, | |
| 947 | machine.priority_bitmap->fill(0, | |
| 951 | 948 | } |
| 952 | 949 | // if( offs==0 ) |
| 953 | 950 | { /* boot */ |
| r13798 | r13799 | |
| 1215 | 1212 | DrawRozHelper( |
| 1216 | 1213 | bitmap_t *bitmap, |
| 1217 | 1214 | tilemap_t *tmap, |
| 1218 | const rectangle | |
| 1215 | const rectangle &clip, | |
| 1219 | 1216 | const struct RozParam *rozInfo ) |
| 1220 | 1217 | { |
| 1221 | 1218 | |
| r13798 | r13799 | |
| 1226 | 1223 | UINT32 size_mask = rozInfo->size-1; |
| 1227 | 1224 | bitmap_t *srcbitmap = tilemap_get_pixmap( tmap ); |
| 1228 | 1225 | 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 ) | |
| 1234 | 1231 | { |
| 1235 | 1232 | int x = sx; |
| 1236 | 1233 | UINT32 cx = startx; |
| 1237 | 1234 | UINT32 cy = starty; |
| 1238 | 1235 | UINT16 *dest = &bitmap->pix16(sy, sx); |
| 1239 | while( x <= clip | |
| 1236 | while( x <= clip. | |
| 1240 | 1237 | { |
| 1241 | 1238 | UINT32 xpos = (((cx>>16)&size_mask) + rozInfo->left)&0xfff; |
| 1242 | 1239 | UINT32 ypos = (((cy>>16)&size_mask) + rozInfo->top)&0xfff; |
| r13798 | r13799 | |
| 1271 | 1268 | } /* DrawRozHelper */ |
| 1272 | 1269 | |
| 1273 | 1270 | static void |
| 1274 | DrawRozScanline( bitmap_t *bitmap, int line, int which, int pri, const rectangle | |
| 1271 | DrawRozScanline( bitmap_t *bitmap, int line, int which, int pri, const rectangle &cliprect ) | |
| 1275 | 1272 | { |
| 1276 | if( line>=cliprect | |
| 1273 | if( line>=cliprect. | |
| 1277 | 1274 | { |
| 1278 | 1275 | struct RozParam rozInfo; |
| 1279 | 1276 | rectangle clip; |
| r13798 | r13799 | |
| 1289 | 1286 | clip.max_x = bitmap->width()-1; |
| 1290 | 1287 | clip.min_y = clip.max_y = line; |
| 1291 | 1288 | |
| 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; } | |
| 1296 | 1293 | |
| 1297 | DrawRozHelper( bitmap, mRozTilemap[which], | |
| 1294 | DrawRozHelper( bitmap, mRozTilemap[which], | |
| 1298 | 1295 | } /* priority */ |
| 1299 | 1296 | } /* enabled */ |
| 1300 | 1297 | } |
| 1301 | 1298 | } /* DrawRozScanline */ |
| 1302 | 1299 | |
| 1303 | 1300 | void |
| 1304 | namco_roz_draw( bitmap_t *bitmap, const rectangle | |
| 1301 | namco_roz_draw( bitmap_t *bitmap, const rectangle &cliprect, int pri ) | |
| 1305 | 1302 | { |
| 1306 | 1303 | int mode = rozcontrol16[0]; /* 0x8000 or 0x1000 */ |
| 1307 | 1304 | int which, special = 1; |
| r13798 | r13799 | |
| 1599 | 1596 | } |
| 1600 | 1597 | |
| 1601 | 1598 | void |
| 1602 | namco_road_draw(running_machine &machine, bitmap_t *bitmap, const rectangle | |
| 1599 | namco_road_draw(running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect, int pri ) | |
| 1603 | 1600 | { |
| 1604 | 1601 | const UINT8 *clut = (const UINT8 *)machine.region("user3")->base(); |
| 1605 | 1602 | bitmap_t *pSourceBitmap; |
| r13798 | r13799 | |
| 1609 | 1606 | pSourceBitmap = tilemap_get_pixmap(mpRoadTilemap); |
| 1610 | 1607 | yscroll = mpRoadRAM[0x1fdfe/2]; |
| 1611 | 1608 | |
| 1612 | for( i=cliprect | |
| 1609 | for( i=cliprect. | |
| 1613 | 1610 | { |
| 1614 | 1611 | int screenx = mpRoadRAM[0x1fa00/2+i+15]; |
| 1615 | 1612 | if( pri == ((screenx&0xf000)>>12) ) |
| r13798 | r13799 | |
| 1637 | 1634 | /* adjust the horizontal placement */ |
| 1638 | 1635 | screenx -= 64; /*needs adjustment to left*/ |
| 1639 | 1636 | |
| 1640 | clipPixels = cliprect | |
| 1637 | clipPixels = cliprect. | |
| 1641 | 1638 | if( clipPixels>0 ) |
| 1642 | 1639 | { /* crop left */ |
| 1643 | 1640 | numpixels -= clipPixels; |
| 1644 | 1641 | sourcex += dsourcex*clipPixels; |
| 1645 | screenx = cliprect | |
| 1642 | screenx = cliprect. | |
| 1646 | 1643 | } |
| 1647 | 1644 | |
| 1648 | clipPixels = (screenx+numpixels) - (cliprect | |
| 1645 | clipPixels = (screenx+numpixels) - (cliprect. | |
| 1649 | 1646 | if( clipPixels>0 ) |
| 1650 | 1647 | { /* crop right */ |
| 1651 | 1648 | numpixels -= clipPixels; |
| r13798 | r13799 | |
|---|---|---|
| 181 | 181 | { |
| 182 | 182 | statriv2_state *state = screen.machine().driver_data<statriv2_state>(); |
| 183 | 183 | if (tms9927_screen_reset(screen.machine().device("tms"))) |
| 184 | bitmap->fill(get_black_pen(screen.machine()), | |
| 184 | bitmap->fill(get_black_pen(screen.machine()), | |
| 185 | 185 | else |
| 186 | 186 | tilemap_draw(bitmap, cliprect, state->m_tilemap, 0, 0); |
| 187 | 187 | return 0; |
| r13798 | r13799 | |
|---|---|---|
| 63 | 63 | |
| 64 | 64 | popmessage("%d %d %04x %d",state->m_test_x,state->m_test_y,state->m_start_offs,state->m_type); |
| 65 | 65 | |
| 66 | bitmap->fill(get_black_pen(screen.machine()), | |
| 66 | bitmap->fill(get_black_pen(screen.machine()), | |
| 67 | 67 | |
| 68 | 68 | count = (state->m_start_offs); |
| 69 | 69 |
| r13798 | r13799 | |
|---|---|---|
| 110 | 110 | 0); |
| 111 | 111 | } |
| 112 | 112 | |
| 113 | static void draw_sprites(running_machine &machine, bitmap_t *bitmap, const rectangle | |
| 113 | static void draw_sprites(running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect, int priority, int pri_mask) | |
| 114 | 114 | { |
| 115 | 115 | acommand_state *state = machine.driver_data<acommand_state>(); |
| 116 | 116 | UINT16 *spriteram16 = state->m_spriteram; |
| r13798 | r13799 | |
|---|---|---|
| 44 | 44 | }; |
| 45 | 45 | |
| 46 | 46 | /* VIDEO GOODS */ |
| 47 | static void astron_draw_characters(running_machine &machine, bitmap_t *bitmap,const rectangle | |
| 47 | static void astron_draw_characters(running_machine &machine, bitmap_t *bitmap,const rectangle &cliprect) | |
| 48 | 48 | { |
| 49 | 49 | segald_state *state = machine.driver_data<segald_state>(); |
| 50 | 50 | UINT8 characterX, characterY; |
| r13798 | r13799 | |
| 60 | 60 | } |
| 61 | 61 | } |
| 62 | 62 | |
| 63 | static void astron_draw_sprites(running_machine &machine, bitmap_t *bitmap, const rectangle | |
| 63 | static void astron_draw_sprites(running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect) | |
| 64 | 64 | { |
| 65 | 65 | /* Heisted from Daphne */ |
| 66 | 66 | const UINT8 SPR_Y_TOP = 0; |
| r13798 | r13799 | |
| 91 | 91 | |
| 92 | 92 | static SCREEN_UPDATE( astron ) |
| 93 | 93 | { |
| 94 | bitmap->fill(0, | |
| 94 | bitmap->fill(0, | |
| 95 | 95 | |
| 96 | 96 | astron_draw_characters(screen.machine(), bitmap, cliprect); |
| 97 | 97 | astron_draw_sprites(screen.machine(), bitmap, cliprect); |
| r13798 | r13799 | |
|---|---|---|
| 129 | 129 | } |
| 130 | 130 | else |
| 131 | 131 | #endif |
| 132 | bitmap->fill(0, | |
| 132 | bitmap->fill(0, | |
| 133 | 133 | |
| 134 | 134 | while((sprite_list[SUBLIST_OFFSET]&SPRITE_LIST_END_MARKER)==0 && sprite_list<sprite_list_end) |
| 135 | 135 | { |
| r13798 | r13799 | |
|---|---|---|
| 47 | 47 | destroyr_state *state = screen.machine().driver_data<destroyr_state>(); |
| 48 | 48 | int i, j; |
| 49 | 49 | |
| 50 | bitmap->fill(0, | |
| 50 | bitmap->fill(0, | |
| 51 | 51 | |
| 52 | 52 | /* draw major objects */ |
| 53 | 53 | for (i = 0; i < 16; i++) |
| r13798 | r13799 | |
|---|---|---|
| 88 | 88 | UINT32 *spriteram32 = state->m_spriteram; |
| 89 | 89 | int offs,spr_offs,colour,sx,sy,h,w,dx,dy; |
| 90 | 90 | |
| 91 | bitmap->fill(screen.machine().pens[0], | |
| 91 | bitmap->fill(screen.machine().pens[0], | |
| 92 | 92 | |
| 93 | 93 | for(offs=(0x2000/4)-2;offs>-1;offs-=2) |
| 94 | 94 | { |
| r13798 | r13799 | |
|---|---|---|
| 104 | 104 | int m_crtc_select; |
| 105 | 105 | }; |
| 106 | 106 | |
| 107 | static UINT32 update_screen(screen_device &screen, bitmap_t *bitmap, const rectangle | |
| 107 | static UINT32 update_screen(screen_device &screen, bitmap_t *bitmap, const rectangle &cliprect, int index) | |
| 108 | 108 | { |
| 109 | 109 | vcombat_state *state = screen.machine().driver_data<vcombat_state>(); |
| 110 | 110 | int y; |
| r13798 | r13799 | |
| 118 | 118 | /* There's also some garbage in the upper-left corner. Might be related to this 'wraparound'. */ |
| 119 | 119 | /* Or maybe it's related to the 68k's alpha? It might come from the 68k side of the house. */ |
| 120 | 120 | |
| 121 | for (y = cliprect | |
| 121 | for (y = cliprect. | |
| 122 | 122 | { |
| 123 | 123 | int x; |
| 124 | 124 | int src_addr = 256/2 * y; |
| 125 | 125 | const UINT16 *m68k_src = &m68k_buf[src_addr]; |
| 126 | 126 | const UINT16 *i860_src = &i860_buf[src_addr]; |
| 127 | UINT32 *dst = &bitmap->pix32(y, cliprect | |
| 127 | UINT32 *dst = &bitmap->pix32(y, cliprect. | |
| 128 | 128 | |
| 129 | for (x = cliprect | |
| 129 | for (x = cliprect. | |
| 130 | 130 | { |
| 131 | 131 | int i; |
| 132 | 132 | UINT16 m68k_pix = *m68k_src++; |
| r13798 | r13799 | |
|---|---|---|
| 108 | 108 | int flip=flip_screen_get(screen.machine()); |
| 109 | 109 | |
| 110 | 110 | tilemap_draw(bitmap, cliprect, state->m_bg_tilemap, 0, 0); |
| 111 | rectangle tmp= | |
| 111 | rectangle tmp= | |
| 112 | 112 | |
| 113 | 113 | if(flip) |
| 114 | 114 | { |
| 115 | 115 | tmp.min_x+=32; |
| 116 | tilemap_draw(bitmap, | |
| 116 | tilemap_draw(bitmap, | |
| 117 | 117 | } |
| 118 | 118 | else |
| 119 | 119 | { |
| 120 | 120 | tmp.max_x-=32; |
| 121 | tilemap_draw(bitmap, | |
| 121 | tilemap_draw(bitmap, | |
| 122 | 122 | } |
| 123 | 123 | |
| 124 | 124 | { |
| r13798 | r13799 | |
|---|---|---|
| 253 | 253 | /* If blanked, fill with black */ |
| 254 | 254 | if (state.blanked) |
| 255 | 255 | { |
| 256 | bitmap->fill(get_black_pen(screen.machine()), | |
| 256 | bitmap->fill(get_black_pen(screen.machine()), | |
| 257 | 257 | return 0; |
| 258 | 258 | } |
| 259 | 259 | |
| 260 | for (y = cliprect | |
| 260 | for (y = cliprect. | |
| 261 | 261 | { |
| 262 | 262 | UINT8 *src = &state.vram[256 * y]; |
| 263 | 263 | UINT16 *dest = &bitmap->pix16(y); |
| 264 | 264 | |
| 265 | for (x = cliprect | |
| 265 | for (x = cliprect. | |
| 266 | 266 | { |
| 267 | 267 | UINT8 pen = src[x >> 1]; |
| 268 | 268 |
| r13798 | r13799 | |
|---|---|---|
| 462 | 462 | bingor_state *state = screen.machine().driver_data<bingor_state>(); |
| 463 | 463 | int x,y,count; |
| 464 | 464 | |
| 465 | bitmap->fill(get_black_pen(screen.machine()), | |
| 465 | bitmap->fill(get_black_pen(screen.machine()), | |
| 466 | 466 | |
| 467 | 467 | count = (0x2000/2); |
| 468 | 468 |
| r13798 | r13799 | |
|---|---|---|
| 452 | 452 | mpu4_state *state = screen.machine().driver_data<mpu4_state>(); |
| 453 | 453 | int x, y/*, count = 0*/; |
| 454 | 454 | |
| 455 | bitmap->fill(0, | |
| 455 | bitmap->fill(0, | |
| 456 | 456 | |
| 457 | 457 | /* this is in main ram.. i think it must transfer it out of here??? */ |
| 458 | 458 | /* count = 0x0018b6/2; - crmaze count = 0x004950/2; - turnover */ |
| r13798 | r13799 | |
|---|---|---|
| 291 | 291 | int x,y,count; |
| 292 | 292 | const gfx_element *gfx = screen.machine().gfx[0]; |
| 293 | 293 | |
| 294 | bitmap->fill(0xd, | |
| 294 | bitmap->fill(0xd, | |
| 295 | 295 | |
| 296 | 296 | count = 0; |
| 297 | 297 |
| r13798 | r13799 | |
|---|---|---|
| 95 | 95 | deco16ic_pf_update(state->m_deco_tilegen2, state->m_pf3_rowscroll, state->m_pf4_rowscroll); |
| 96 | 96 | |
| 97 | 97 | screen.machine().priority_bitmap->fill(0); |
| 98 | bitmap->fill(0x100, | |
| 98 | bitmap->fill(0x100, | |
| 99 | 99 | |
| 100 | 100 | if (state->m_left_priority[0] == 0) |
| 101 | 101 | { |
| r13798 | r13799 | |
| 128 | 128 | deco16ic_pf_update(state->m_deco_tilegen2, state->m_pf3_rowscroll, state->m_pf4_rowscroll); |
| 129 | 129 | |
| 130 | 130 | screen.machine().priority_bitmap->fill(0); |
| 131 | bitmap->fill(0x500, | |
| 131 | bitmap->fill(0x500, | |
| 132 | 132 | |
| 133 | 133 | if (state->m_right_priority[0] == 0) |
| 134 | 134 | { |
| r13798 | r13799 | |
|---|---|---|
| 104 | 104 | */ |
| 105 | 105 | |
| 106 | 106 | /* Bit 3 selects LD/#GRAPHICS */ |
| 107 | bitmap->fill(state->m_colormap[255], | |
| 107 | bitmap->fill(state->m_colormap[255], | |
| 108 | 108 | |
| 109 | 109 | /* TODO: Add 1 for linebuffering? */ |
| 110 | for (y = cliprect | |
| 110 | for (y = cliprect. | |
| 111 | 111 | { |
| 112 | 112 | int i; |
| 113 | 113 | int num_entries = cubeqcpu_get_ptr_ram_val(screen.machine().device("line_cpu"), y); |
| r13798 | r13799 | |
|---|---|---|
| 90 | 90 | |
| 91 | 91 | ***************************************************************************/ |
| 92 | 92 | |
| 93 | static void draw_sprites( running_machine &machine, bitmap_t *bitmap, const rectangle | |
| 93 | static void draw_sprites( running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect ) | |
| 94 | 94 | { |
| 95 | 95 | astrocorp_state *state = machine.driver_data<astrocorp_state>(); |
| 96 | 96 | UINT16 *source = state->m_spriteram; |
| r13798 | r13799 | |
| 145 | 145 | if (state->m_screen_enable & 1) |
| 146 | 146 | copybitmap(bitmap, state->m_bitmap, 0,0,0,0, cliprect); |
| 147 | 147 | else |
| 148 | bitmap->fill(get_black_pen(screen.machine()), | |
| 148 | bitmap->fill(get_black_pen(screen.machine()), | |
| 149 | 149 | |
| 150 | 150 | return 0; |
| 151 | 151 | } |
| r13798 | r13799 | |
| 163 | 163 | UINT16 now = COMBINE_DATA(&state->m_draw_sprites); |
| 164 | 164 | |
| 165 | 165 | if (!old && now) |
| 166 | draw_sprites(space->machine(), state->m_bitmap, | |
| 166 | draw_sprites(space->machine(), state->m_bitmap, | |
| 167 | 167 | } |
| 168 | 168 | |
| 169 | 169 | static WRITE16_HANDLER( astrocorp_eeprom_w ) |
| r13798 | r13799 | |
|---|---|---|
| 357 | 357 | } |
| 358 | 358 | |
| 359 | 359 | copybitmap_trans(bitmap, state->m_temp_bitmap_sprites, 0, 0, 0, 0, cliprect, 0); |
| 360 | state->m_temp_bitmap_sprites->fill(0, | |
| 360 | state->m_temp_bitmap_sprites->fill(0, | |
| 361 | 361 | |
| 362 | 362 | |
| 363 | 363 | return 0; |
| r13798 | r13799 | |
| 479 | 479 | x2 = (state->m_attr_buff[9] & 0x000001ff); |
| 480 | 480 | clip = state->m_temp_bitmap_sprites->cliprect(); |
| 481 | 481 | |
| 482 | drawgfx_opaque(state->m_temp_bitmap_sprites, | |
| 482 | drawgfx_opaque(state->m_temp_bitmap_sprites, | |
| 483 | 483 | } |
| 484 | 484 | } |
| 485 | 485 | if(state->m_attr_index == 0xc) |
| r13798 | r13799 | |
|---|---|---|
| 149 | 149 | |
| 150 | 150 | for (i=0; i < cobra->polybuffer_ptr; i++) |
| 151 | 151 | { |
| 152 | poly_render_triangle(cobra->poly, cobra->framebuffer, | |
| 152 | poly_render_triangle(cobra->poly, cobra->framebuffer, | |
| 153 | 153 | &cobra->polybuffer[i].v[0], &cobra->polybuffer[i].v[1], &cobra->polybuffer[i].v[2]); |
| 154 | 154 | poly_wait(cobra->poly, "Finished render"); |
| 155 | 155 | } |
| r13798 | r13799 | |
|---|---|---|
| 72 | 72 | int y,x; |
| 73 | 73 | int count; |
| 74 | 74 | |
| 75 | bitmap->fill(get_black_pen(screen.machine()), | |
| 75 | bitmap->fill(get_black_pen(screen.machine()), | |
| 76 | 76 | |
| 77 | 77 | count = 0; |
| 78 | 78 | for (y=0;y<64;y++) |
| r13798 | r13799 | |
|---|---|---|
| 781 | 781 | |
| 782 | 782 | } |
| 783 | 783 | |
| 784 | static void sfbonus_draw_reel_layer(screen_device &screen, bitmap_t *bitmap, const rectangle | |
| 784 | static void sfbonus_draw_reel_layer(screen_device &screen, bitmap_t *bitmap, const rectangle &cliprect, int catagory) | |
| 785 | 785 | { |
| 786 | 786 | sfbonus_state *state = screen.machine().driver_data<sfbonus_state>(); |
| 787 | 787 | int zz; |
| r13798 | r13799 | |
| 877 | 877 | |
| 878 | 878 | if (rowenable2==0) |
| 879 | 879 | { |
| 880 | tilemap_draw(state->m_temp_reel_bitmap, | |
| 880 | tilemap_draw(state->m_temp_reel_bitmap, | |
| 881 | 881 | } |
| 882 | 882 | if (rowenable==0) |
| 883 | 883 | { |
| 884 | tilemap_draw(state->m_temp_reel_bitmap, | |
| 884 | tilemap_draw(state->m_temp_reel_bitmap, | |
| 885 | 885 | } |
| 886 | 886 | |
| 887 | 887 | if (rowenable2==0x1) |
| 888 | 888 | { |
| 889 | tilemap_draw(state->m_temp_reel_bitmap, | |
| 889 | tilemap_draw(state->m_temp_reel_bitmap, | |
| 890 | 890 | } |
| 891 | 891 | if (rowenable==0x1) |
| 892 | 892 | { |
| 893 | tilemap_draw(state->m_temp_reel_bitmap, | |
| 893 | tilemap_draw(state->m_temp_reel_bitmap, | |
| 894 | 894 | } |
| 895 | 895 | |
| 896 | 896 | if (rowenable2==0x2) |
| 897 | 897 | { |
| 898 | tilemap_draw(state->m_temp_reel_bitmap, | |
| 898 | tilemap_draw(state->m_temp_reel_bitmap, | |
| 899 | 899 | } |
| 900 | 900 | if (rowenable==0x2) |
| 901 | 901 | { |
| 902 | tilemap_draw(state->m_temp_reel_bitmap, | |
| 902 | tilemap_draw(state->m_temp_reel_bitmap, | |
| 903 | 903 | } |
| 904 | 904 | |
| 905 | 905 | if (rowenable2==0x3) |
| 906 | 906 | { |
| 907 | tilemap_draw(state->m_temp_reel_bitmap, | |
| 907 | tilemap_draw(state->m_temp_reel_bitmap, | |
| 908 | 908 | } |
| 909 | 909 | if (rowenable==0x3) |
| 910 | 910 | { |
| 911 | tilemap_draw(state->m_temp_reel_bitmap, | |
| 911 | tilemap_draw(state->m_temp_reel_bitmap, | |
| 912 | 912 | } |
| 913 | 913 | |
| 914 | 914 | |
| r13798 | r13799 | |
| 934 | 934 | globalyscroll += 8; |
| 935 | 935 | globalxscroll += 8; |
| 936 | 936 | |
| 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); | |
| 939 | 939 | |
| 940 | 940 | /* render reels to bitmap */ |
| 941 | 941 | sfbonus_draw_reel_layer(screen,state->m_temp_reel_bitmap,cliprect,0); |
| r13798 | r13799 | |
|---|---|---|
| 138 | 138 | static SCREEN_UPDATE(cshooter) |
| 139 | 139 | { |
| 140 | 140 | cshooter_state *state = screen.machine().driver_data<cshooter_state>(); |
| 141 | bitmap->fill(0/*get_black_pen(screen.screen.machine(, | |
| 141 | bitmap->fill(0/*get_black_pen(screen.screen.machine(, | |
| 142 | 142 | tilemap_mark_all_tiles_dirty(state->m_txtilemap); |
| 143 | 143 | |
| 144 | 144 | //sprites |
| r13798 | r13799 | |
|---|---|---|
| 97 | 97 | palette_set_color(screen.machine(), 0, MAKE_ARGB(0,0,0,0)); |
| 98 | 98 | |
| 99 | 99 | /* clear */ |
| 100 | bitmap->fill(0, | |
| 100 | bitmap->fill(0, | |
| 101 | 101 | |
| 102 | 102 | /* Draw tiles */ |
| 103 | 103 | for (charx = 0; charx < 32; charx++) |
| r13798 | r13799 | |
|---|---|---|
| 246 | 246 | multfish_state *state = screen.machine().driver_data<multfish_state>(); |
| 247 | 247 | int i; |
| 248 | 248 | |
| 249 | bitmap->fill(get_black_pen(screen.machine()), | |
| 249 | bitmap->fill(get_black_pen(screen.machine()), | |
| 250 | 250 | |
| 251 | 251 | if (!state->m_disp_enable) return 0; |
| 252 | 252 |
| r13798 | r13799 | |
|---|---|---|
| 78 | 78 | COMBINE_DATA(&state->m_tilemap_ram[3][offset]); |
| 79 | 79 | } |
| 80 | 80 | |
| 81 | static void draw_sprites(running_machine &machine, bitmap_t *bitmap, const rectangle | |
| 81 | static void draw_sprites(running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect, int screen) | |
| 82 | 82 | { |
| 83 | 83 | tmmjprd_state *state = machine.driver_data<tmmjprd_state>(); |
| 84 | 84 | int xpos,ypos,tileno,xflip,yflip, colr; |
| r13798 | r13799 | |
| 155 | 155 | } |
| 156 | 156 | } |
| 157 | 157 | |
| 158 | static void ttmjprd_draw_tile(running_machine &machine, bitmap_t *bitmap, const rectangle | |
| 158 | static 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) | |
| 159 | 159 | { |
| 160 | 160 | /* note, it's tile address _NOT_ tile number, 'sub-tile' access is possible, hence using the custom rendering */ |
| 161 | 161 | int tileaddr = (tiledata&0x000fffff)>>0; |
| r13798 | r13799 | |
| 167 | 167 | int count; |
| 168 | 168 | |
| 169 | 169 | // entirely off right |
| 170 | if (x > cliprect | |
| 170 | if (x > cliprect. | |
| 171 | 171 | return; |
| 172 | 172 | |
| 173 | 173 | // entirely off left |
| 174 | if ((x+sizex) < cliprect | |
| 174 | if ((x+sizex) < cliprect. | |
| 175 | 175 | return; |
| 176 | 176 | |
| 177 | 177 | // entirely off bottom |
| 178 | if (y > cliprect | |
| 178 | if (y > cliprect. | |
| 179 | 179 | return; |
| 180 | 180 | |
| 181 | 181 | // entirely off bottom |
| 182 | if ((y+sizey) < cliprect | |
| 182 | if ((y+sizey) < cliprect. | |
| 183 | 183 | return; |
| 184 | 184 | |
| 185 | 185 | count = 0; |
| r13798 | r13799 | |
| 192 | 192 | |
| 193 | 193 | if (!depth) |
| 194 | 194 | { |
| 195 | if ((drawx < cliprect | |
| 195 | if ((drawx < cliprect. | |
| 196 | 196 | { |
| 197 | 197 | dat = (rom[(tileaddr*32)+count] & 0xf0)>>4; |
| 198 | 198 | if (dat!=15) |
| r13798 | r13799 | |
| 203 | 203 | } |
| 204 | 204 | } |
| 205 | 205 | drawx++; |
| 206 | if ((drawx < cliprect | |
| 206 | if ((drawx < cliprect. | |
| 207 | 207 | { |
| 208 | 208 | dat = (rom[(tileaddr*32)+count] & 0x0f); |
| 209 | 209 | if (dat!=15) |
| r13798 | r13799 | |
| 218 | 218 | } |
| 219 | 219 | else |
| 220 | 220 | { |
| 221 | if ((drawx < cliprect | |
| 221 | if ((drawx < cliprect. | |
| 222 | 222 | { |
| 223 | 223 | dat = (rom[(tileaddr*32)+count] & 0xff); |
| 224 | 224 | if (dat!=255) |
| r13798 | r13799 | |
| 234 | 234 | } |
| 235 | 235 | } |
| 236 | 236 | |
| 237 | static void ttmjprd_draw_tilemap(running_machine &machine, bitmap_t *bitmap, const rectangle | |
| 237 | static void ttmjprd_draw_tilemap(running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect, UINT32*tileram, UINT32*tileregs, UINT8*rom ) | |
| 238 | 238 | { |
| 239 | 239 | int y,x; |
| 240 | 240 | int count; |
| r13798 | r13799 | |
| 280 | 280 | tmmjprd_state *state = screen.machine().driver_data<tmmjprd_state>(); |
| 281 | 281 | UINT8* gfxroms = screen.machine().region("gfx2")->base(); |
| 282 | 282 | |
| 283 | bitmap->fill(get_black_pen(screen.machine()), | |
| 283 | bitmap->fill(get_black_pen(screen.machine()), | |
| 284 | 284 | |
| 285 | 285 | ttmjprd_draw_tilemap( screen.machine(), bitmap, cliprect, state->m_tilemap_ram[3], state->m_tilemap_regs[3], gfxroms ); |
| 286 | 286 | draw_sprites(screen.machine(),bitmap,cliprect, 1); |
| r13798 | r13799 | |
| 315 | 315 | tmmjprd_state *state = screen.machine().driver_data<tmmjprd_state>(); |
| 316 | 316 | UINT8* gfxroms = screen.machine().region("gfx2")->base(); |
| 317 | 317 | |
| 318 | bitmap->fill(get_black_pen(screen.machine()), | |
| 318 | bitmap->fill(get_black_pen(screen.machine()), | |
| 319 | 319 | |
| 320 | 320 | ttmjprd_draw_tilemap( screen.machine(), bitmap, cliprect, state->m_tilemap_ram[1], state->m_tilemap_regs[1], gfxroms ); |
| 321 | 321 | draw_sprites(screen.machine(),bitmap,cliprect, 0); |
| r13798 | r13799 | |
|---|---|---|
| 708 | 708 | tilemap_set_palette_offset(state->m_gfx1_tilemap,0x200); |
| 709 | 709 | } |
| 710 | 710 | |
| 711 | static void draw_sprites(running_machine &machine, bitmap_t *bitmap, const rectangle | |
| 711 | static void draw_sprites(running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect) | |
| 712 | 712 | { |
| 713 | 713 | witch_state *state = machine.driver_data<witch_state>(); |
| 714 | 714 | int i,sx,sy,tileno,flags,color; |
| r13798 | r13799 | |
|---|---|---|
| 276 | 276 | clip.min_y = visarea.min_y; |
| 277 | 277 | clip.max_y = visarea.max_y; |
| 278 | 278 | |
| 279 | bitmap->fill(0, | |
| 279 | bitmap->fill(0, | |
| 280 | 280 | |
| 281 | 281 | for (i= 0;i < 64;i++) |
| 282 | 282 | { |
| r13798 | r13799 | |
| 335 | 335 | #if 0 // treat bit as fg enable |
| 336 | 336 | if (tileattr&0x04) |
| 337 | 337 | { |
| 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); | |
| 342 | 342 | } |
| 343 | 343 | |
| 344 | 344 | if (tileattr&0x08) drawgfx_transpen(bitmap,clip,screen.machine().gfx[region],tile,col,0,0,x*8,y*8, 0); |
| 345 | 345 | |
| 346 | 346 | #else // treat it as priority flag instead (looks better in non-adult title screen - needs verifying) |
| 347 | if (!(tileattr&0x08)) drawgfx_transpen(bitmap, | |
| 347 | if (!(tileattr&0x08)) drawgfx_transpen(bitmap, | |
| 348 | 348 | |
| 349 | 349 | if (tileattr&0x04) |
| 350 | 350 | { |
| 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); | |
| 355 | 355 | } |
| 356 | 356 | |
| 357 | if ((tileattr&0x08)) drawgfx_transpen(bitmap, | |
| 357 | if ((tileattr&0x08)) drawgfx_transpen(bitmap, | |
| 358 | 358 | #endif |
| 359 | 359 | |
| 360 | 360 | count++; |
| r13798 | r13799 | |
|---|---|---|
| 167 | 167 | |
| 168 | 168 | ***************************************************************************/ |
| 169 | 169 | |
| 170 | static void draw_sprites(running_machine &machine, bitmap_t *bitmap, const rectangle | |
| 170 | static void draw_sprites(running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect, int pri_mask) | |
| 171 | 171 | { |
| 172 | 172 | sigmab98_state *state = machine.driver_data<sigmab98_state>(); |
| 173 | 173 | UINT8 *end = state->m_spriteram - 0x10; |
| r13798 | r13799 | |
| 265 | 265 | } |
| 266 | 266 | #endif |
| 267 | 267 | |
| 268 | bitmap->fill(get_black_pen(screen.machine()), | |
| 268 | bitmap->fill(get_black_pen(screen.machine()), | |
| 269 | 269 | |
| 270 | 270 | // Draw from priority 3 (bottom, converted to a bitmask) to priority 0 (top) |
| 271 | 271 | draw_sprites(screen.machine(), bitmap, cliprect, layers_ctrl & 8); |
| r13798 | r13799 | |
|---|---|---|
| 376 | 376 | } |
| 377 | 377 | |
| 378 | 378 | |
| 379 | static void video_update_common( running_machine &machine, bitmap_t *bitmap, const rectangle | |
| 379 | static void video_update_common( running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect, pen_t *pens ) | |
| 380 | 380 | { |
| 381 | 381 | astrof_state *state = machine.driver_data<astrof_state>(); |
| 382 | 382 | offs_t offs; |
| r13798 | r13799 | |
| 397 | 397 | if (!state->m_flipscreen) |
| 398 | 398 | y = ~y; |
| 399 | 399 | |
| 400 | if ((y <= cliprect | |
| 400 | if ((y <= cliprect. | |
| 401 | 401 | continue; |
| 402 | 402 | |
| 403 | 403 | if (state->m_screen_off) |
| r13798 | r13799 | |
|---|---|---|
| 180 | 180 | static SCREEN_UPDATE(igs_video) |
| 181 | 181 | { |
| 182 | 182 | igspoker_state *state = screen.machine().driver_data<igspoker_state>(); |
| 183 | bitmap->fill(get_black_pen(screen.machine()), | |
| 183 | bitmap->fill(get_black_pen(screen.machine()), | |
| 184 | 184 | |
| 185 | 185 | // FIX: CSK227IT must have some way to disable background, or wrong gfx? |
| 186 | 186 | if (state->m_bg_enable) tilemap_draw(bitmap, cliprect, state->m_bg_tilemap, 0, 0); |
| r13798 | r13799 | |
|---|---|---|
| 102 | 102 | |
| 103 | 103 | popmessage("%d %d %04x",state->m_test_x,state->m_test_y,state->m_start_offs); |
| 104 | 104 | |
| 105 | bitmap->fill(get_black_pen(screen.machine()), | |
| 105 | bitmap->fill(get_black_pen(screen.machine()), | |
| 106 | 106 | |
| 107 | 107 | count = (state->m_start_offs); |
| 108 | 108 |
| r13798 | r13799 | |
|---|---|---|
| 79 | 79 | static SCREEN_UPDATE( acefruit ) |
| 80 | 80 | { |
| 81 | 81 | 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; | |
| 84 | 84 | int row; |
| 85 | 85 | int col; |
| 86 | 86 |
| r13798 | r13799 | |
|---|---|---|
| 154 | 154 | skylncr_state *state = screen.machine().driver_data<skylncr_state>(); |
| 155 | 155 | int i; |
| 156 | 156 | |
| 157 | bitmap->fill(0, | |
| 157 | bitmap->fill(0, | |
| 158 | 158 | tilemap_draw(bitmap,cliprect, state->m_reel_1_tilemap, 0, 0); |
| 159 | 159 | |
| 160 | 160 | // are these hardcoded, or registers? |
| r13798 | r13799 | |
| 169 | 169 | tilemap_set_scrolly(state->m_reel_4_tilemap, i, state->m_reelscroll4[i]); |
| 170 | 170 | } |
| 171 | 171 | |
| 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); | |
| 175 | 175 | |
| 176 | 176 | |
| 177 | 177 | tilemap_draw(bitmap,cliprect, state->m_tmap, 0, 0); |
| r13798 | r13799 | |
|---|---|---|
| 377 | 377 | pen_t *pens = (pen_t *)param; |
| 378 | 378 | UINT16 delay_counter = state->m_star_delay_counter; |
| 379 | 379 | |
| 380 | for (y = cliprect | |
| 380 | for (y = cliprect. | |
| 381 | 381 | { |
| 382 | 382 | int x; |
| 383 | 383 | |
| 384 | for (x = cliprect | |
| 384 | for (x = cliprect. | |
| 385 | 385 | { |
| 386 | 386 | /* check if the star status */ |
| 387 | 387 | if (state->m_star_enable && |
| r13798 | r13799 | |
|---|---|---|
| 55 | 55 | }; |
| 56 | 56 | |
| 57 | 57 | |
| 58 | static void draw_sprites(running_machine &machine, UINT32 *sprites, const rectangle | |
| 58 | static void draw_sprites(running_machine &machine, UINT32 *sprites, const rectangle &cliprect, int count); | |
| 59 | 59 | |
| 60 | 60 | /***************************************************************************************************** |
| 61 | 61 | MISC FUNCTIONS |
| r13798 | r13799 | |
| 134 | 134 | if(state->m_spriteram_bit) |
| 135 | 135 | { |
| 136 | 136 | // draw the sprites to the frame buffer |
| 137 | draw_sprites(space->machine(),state->m_spriteram2, | |
| 137 | draw_sprites(space->machine(),state->m_spriteram2, | |
| 138 | 138 | } |
| 139 | 139 | else |
| 140 | 140 | { |
| 141 | 141 | // draw the sprites to the frame buffer |
| 142 | draw_sprites(space->machine(),state->m_spriteram, | |
| 142 | draw_sprites(space->machine(),state->m_spriteram, | |
| 143 | 143 | } |
| 144 | 144 | |
| 145 | 145 | // buffer the next number of sprites to draw |
| r13798 | r13799 | |
| 256 | 256 | SET_TILE_INFO(0,tile,color,0); |
| 257 | 257 | } |
| 258 | 258 | |
| 259 | static void draw_single_sprite(bitmap_t *dest_bmp,const rectangle | |
| 259 | static void draw_single_sprite(bitmap_t *dest_bmp,const rectangle &clip,const gfx_element *gfx, | |
| 260 | 260 | UINT32 code,UINT32 color,int flipx,int flipy,int sx,int sy, |
| 261 | 261 | int priority) |
| 262 | 262 | { |
| r13798 | r13799 | |
| 299 | 299 | y_index = 0; |
| 300 | 300 | } |
| 301 | 301 | |
| 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; | |
| 327 | 307 | } |
| 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 | } | |
| 328 | 325 | |
| 329 | 326 | if( ex>sx ) |
| 330 | 327 | { /* skip if inner loop doesn't draw anything */ |
| r13798 | r13799 | |
| 359 | 356 | } |
| 360 | 357 | |
| 361 | 358 | // sprites aren't tile based (except for 8x8 ones) |
| 362 | static void draw_sprites(running_machine &machine, UINT32 *sprites, const rectangle | |
| 359 | static void draw_sprites(running_machine &machine, UINT32 *sprites, const rectangle &cliprect, int count) | |
| 363 | 360 | { |
| 364 | 361 | limenko_state *state = machine.driver_data<limenko_state>(); |
| 365 | 362 | int i; |
| r13798 | r13799 | |
| 418 | 415 | } |
| 419 | 416 | } |
| 420 | 417 | |
| 421 | static void copy_sprites(running_machine &machine, bitmap_t *bitmap, bitmap_t *sprites_bitmap, bitmap_t *priority_bitmap, const rectangle | |
| 418 | static void copy_sprites(running_machine &machine, bitmap_t *bitmap, bitmap_t *sprites_bitmap, bitmap_t *priority_bitmap, const rectangle &cliprect) | |
| 422 | 419 | { |
| 423 | 420 | limenko_state *state = machine.driver_data<limenko_state>(); |
| 424 | 421 | int y; |
| 425 | for( y=cliprect | |
| 422 | for( y=cliprect. | |
| 426 | 423 | { |
| 427 | 424 | UINT16 *source = &sprites_bitmap->pix16(y); |
| 428 | 425 | UINT16 *dest = &bitmap->pix16(y); |
| r13798 | r13799 | |
| 430 | 427 | UINT8 *source_pri = &state->m_sprites_bitmap_pri->pix8(y); |
| 431 | 428 | |
| 432 | 429 | int x; |
| 433 | for( x=cliprect | |
| 430 | for( x=cliprect. | |
| 434 | 431 | { |
| 435 | 432 | if( source[x]!= 0 ) |
| 436 | 433 | { |
| r13798 | r13799 | |
| 460 | 457 | limenko_state *state = screen.machine().driver_data<limenko_state>(); |
| 461 | 458 | // state->m_videoreg[4] ???? It always has this value: 0xffeffff8 (2 signed bytes? values: -17 and -8 ?) |
| 462 | 459 | |
| 463 | screen.machine().priority_bitmap->fill(0, | |
| 460 | screen.machine().priority_bitmap->fill(0, | |
| 464 | 461 | |
| 465 | 462 | tilemap_set_enable(state->m_bg_tilemap, state->m_videoreg[0] & 4); |
| 466 | 463 | tilemap_set_enable(state->m_md_tilemap, state->m_videoreg[0] & 2); |
| r13798 | r13799 | |
|---|---|---|
| 267 | 267 | |
| 268 | 268 | bool whitestar_state::screen_update(screen_device &screen, bitmap_t &bitmap, const rectangle &cliprect) |
| 269 | 269 | { |
| 270 | m_mc6845->update(&bitmap, | |
| 270 | m_mc6845->update(&bitmap, | |
| 271 | 271 | return 0; |
| 272 | 272 | } |
| 273 | 273 |
| r13798 | r13799 | |
|---|---|---|
| 163 | 163 | static SCREEN_UPDATE( galaxygame ) |
| 164 | 164 | { |
| 165 | 165 | galaxygame_state *state = screen.machine().driver_data<galaxygame_state>(); |
| 166 | bitmap->fill(get_black_pen(screen.machine()), | |
| 166 | bitmap->fill(get_black_pen(screen.machine()), | |
| 167 | 167 | for (int i = 0; i < state->m_point_display_list_index; i++ ) |
| 168 | 168 | { |
| 169 | 169 | bitmap->pix16(state->m_point_display_list[i].x >> 7, state->m_point_display_list[i].y >> 7) = 1; |
| r13798 | r13799 | |
|---|---|---|
| 68 | 68 | 3 | xxxxxxxx xxxxxx-- | sprite code |
| 69 | 69 | */ |
| 70 | 70 | |
| 71 | static void draw_sprites( running_machine &machine, bitmap_t *bitmap, const rectangle | |
| 71 | static void draw_sprites( running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect ) | |
| 72 | 72 | { |
| 73 | 73 | drtomy_state *state = machine.driver_data<drtomy_state>(); |
| 74 | 74 | int i, x, y, ex, ey; |
| r13798 | r13799 | |
|---|---|---|
| 140 | 140 | */ |
| 141 | 141 | |
| 142 | 142 | int x,y,z,pixdat; |
| 143 | bitmap->fill(get_black_pen(screen.machine()), | |
| 143 | bitmap->fill(get_black_pen(screen.machine()), | |
| 144 | 144 | |
| 145 | 145 | z=0; |
| 146 | 146 | for (y=0;y<230;y++) |
| r13798 | r13799 | |
|---|---|---|
| 629 | 629 | |
| 630 | 630 | /* SPRITE DRAWING (move to video file) */ |
| 631 | 631 | |
| 632 | void raiden2_state::draw_sprites(running_machine &machine, bitmap_t *bitmap, const rectangle | |
| 632 | void raiden2_state::draw_sprites(running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect ,int pri_mask ) | |
| 633 | 633 | { |
| 634 | 634 | UINT16 *source = sprites + sprites_cur_start/2 - 4; |
| 635 | 635 | |
| r13798 | r13799 | |
| 889 | 889 | static SCREEN_UPDATE( raiden2 ) |
| 890 | 890 | { |
| 891 | 891 | raiden2_state *state = screen.machine().driver_data<raiden2_state>(); |
| 892 | bitmap->fill(get_black_pen(screen.machine()), | |
| 892 | bitmap->fill(get_black_pen(screen.machine()), | |
| 893 | 893 | |
| 894 | 894 | //if (!screen.machine().input().code_pressed(KEYCODE_Q)) |
| 895 | 895 | { |
| r13798 | r13799 | |
|---|---|---|
| 43 | 43 | { |
| 44 | 44 | device_t *k056832 = screen.machine().device("k056832"); |
| 45 | 45 | |
| 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); | |
| 48 | 48 | |
| 49 | 49 | // k056832_tilemap_draw(k056832, bitmap, cliprect, 3, 0, 0); |
| 50 | 50 | // k056832_tilemap_draw(k056832, bitmap, cliprect, 2, 0, 0); |
| r13798 | r13799 | |
|---|---|---|
| 90 | 90 | clip.min_y = visarea.min_y; |
| 91 | 91 | clip.max_y = visarea.max_y; |
| 92 | 92 | tilemap_set_scrollx(state->m_tilemap, 0, 256); |
| 93 | tilemap_draw(bitmap, | |
| 93 | tilemap_draw(bitmap, | |
| 94 | 94 | |
| 95 | 95 | clip.min_x = 256; |
| 96 | 96 | clip.max_x = 512 - 1; |
| 97 | 97 | clip.min_y = visarea.min_y; |
| 98 | 98 | clip.max_y = visarea.max_y; |
| 99 | 99 | tilemap_set_scrollx(state->m_tilemap, 0, -128); |
| 100 | tilemap_draw(bitmap, | |
| 100 | tilemap_draw(bitmap, | |
| 101 | 101 | |
| 102 | 102 | return 0; |
| 103 | 103 | } |
| r13798 | r13799 | |
|---|---|---|
| 166 | 166 | state->m_back_tilemap = tilemap_create(machine, get_back_tile_info, tilemap_scan_cols, 8, 8, 64, 32); |
| 167 | 167 | } |
| 168 | 168 | |
| 169 | static void ddealer_draw_video_layer( running_machine &machine, UINT16* vreg_base, UINT16* top, UINT16* bottom, bitmap_t* bitmap, const rectangle | |
| 169 | static void ddealer_draw_video_layer( running_machine &machine, UINT16* vreg_base, UINT16* top, UINT16* bottom, bitmap_t* bitmap, const rectangle &cliprect, int flipy) | |
| 170 | 170 | { |
| 171 | 171 | const gfx_element *gfx = machine.gfx[1]; |
| 172 | 172 |
| r13798 | r13799 | |
|---|---|---|
| 307 | 307 | |
| 308 | 308 | if (rowenable==0) |
| 309 | 309 | { // 0 and 1 are the same? or is there a global switchoff? |
| 310 | tilemap_draw(bitmap, | |
| 310 | tilemap_draw(bitmap, | |
| 311 | 311 | } |
| 312 | 312 | else if (rowenable==1) |
| 313 | 313 | { |
| 314 | tilemap_draw(bitmap, | |
| 314 | tilemap_draw(bitmap, | |
| 315 | 315 | } |
| 316 | 316 | else if (rowenable==2) |
| 317 | 317 | { |
| 318 | tilemap_draw(bitmap, | |
| 318 | tilemap_draw(bitmap, | |
| 319 | 319 | } |
| 320 | 320 | else if (rowenable==3) |
| 321 | 321 | { |
| 322 | tilemap_draw(bitmap, | |
| 322 | tilemap_draw(bitmap, | |
| 323 | 323 | } |
| 324 | 324 | |
| 325 | 325 | |
| r13798 | r13799 | |
| 327 | 327 | } |
| 328 | 328 | |
| 329 | 329 | } |
| 330 | else bitmap->fill(get_black_pen(screen.machine()), | |
| 330 | else bitmap->fill(get_black_pen(screen.machine()), | |
| 331 | 331 | |
| 332 | 332 | |
| 333 | 333 | if (layers_ctrl & 2) tilemap_draw(bitmap, cliprect, state->m_fg_tilemap, 0, 0); |
| r13798 | r13799 | |
|---|---|---|
| 104 | 104 | state->m_scroll_y = data; |
| 105 | 105 | } |
| 106 | 106 | |
| 107 | static void draw_sprites( running_machine &machine, bitmap_t *bitmap, const rectangle | |
| 107 | static void draw_sprites( running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect ) | |
| 108 | 108 | { |
| 109 | 109 | dacholer_state *state = machine.driver_data<dacholer_state>(); |
| 110 | 110 | int offs, code, attr, sx, sy, flipx, flipy; |
| r13798 | r13799 | |
|---|---|---|
| 325 | 325 | { |
| 326 | 326 | cb2001_state *state = screen.machine().driver_data<cb2001_state>(); |
| 327 | 327 | int count,x,y; |
| 328 | bitmap->fill(get_black_pen(screen.machine()), | |
| 328 | bitmap->fill(get_black_pen(screen.machine()), | |
| 329 | 329 | |
| 330 | 330 | count = 0x0000; |
| 331 | 331 | |
| r13798 | r13799 | |
| 388 | 388 | const rectangle visible2(0*8, (14+48)*8-1, 10*8, (10+7)*8-1); |
| 389 | 389 | const rectangle visible3(0*8, (14+48)*8-1, 17*8, (17+7)*8-1); |
| 390 | 390 | |
| 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); | |
| 394 | 394 | } |
| 395 | 395 | } |
| 396 | 396 |
| r13798 | r13799 | |
|---|---|---|
| 515 | 515 | tilemap_draw(state->m_tile, cliprect, state->m_tx_tilemap, 0, 0); |
| 516 | 516 | |
| 517 | 517 | state->m_obj1->fill(0); |
| 518 | drawgfx_transpen(state->m_obj1, | |
| 518 | drawgfx_transpen(state->m_obj1, state->m_obj1->cliprect(), screen.machine().gfx[1], | |
| 519 | 519 | OBJ_CODE(state->m_obj1_a), |
| 520 | 520 | OBJ_COLOR(state->m_obj1_a), |
| 521 | 521 | OBJ_FLIPX(state->m_obj1_a), OBJ_FLIPY(state->m_obj1_a), |
| 522 | 522 | 0, 0, 0); |
| 523 | 523 | |
| 524 | 524 | state->m_obj2->fill(0); |
| 525 | drawgfx_transpen(state->m_obj2, | |
| 525 | drawgfx_transpen(state->m_obj2, state->m_obj2->cliprect(), screen.machine().gfx[2], | |
| 526 | 526 | OBJ_CODE(state->m_obj2_a), |
| 527 | 527 | OBJ_COLOR(state->m_obj2_a), |
| 528 | 528 | OBJ_FLIPX(state->m_obj2_a), OBJ_FLIPY(state->m_obj2_a), |
| r13798 | r13799 | |
| 547 | 547 | int x = OBJ_X(state->m_obj1_x) + sx; |
| 548 | 548 | int y = OBJ_Y(state->m_obj1_y) + sy; |
| 549 | 549 | |
| 550 | if (x < cliprect | |
| 550 | if (x < cliprect. | |
| 551 | 551 | continue; |
| 552 | 552 | |
| 553 | 553 | if (state->m_obj1->pix16(sy, sx) == 0) |
| r13798 | r13799 | |
|---|---|---|
| 410 | 410 | |
| 411 | 411 | static void copy_from_nvram(running_machine &machine); |
| 412 | 412 | |
| 413 | INLINE void cps3_drawgfxzoom(bitmap_t *dest_bmp,const rectangle | |
| 413 | INLINE void cps3_drawgfxzoom(bitmap_t *dest_bmp,const rectangle &clip,const gfx_element *gfx, | |
| 414 | 414 | unsigned int code,unsigned int color,int flipx,int flipy,int sx,int sy, |
| 415 | 415 | int transparency,int transparent_color, |
| 416 | 416 | int scalex, int scaley,bitmap_t *pri_buffer,UINT32 pri_mask) |
| r13798 | r13799 | |
| 440 | 440 | |
| 441 | 441 | |
| 442 | 442 | /* 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(); | |
| 449 | 445 | |
| 450 | ||
| 451 | 446 | /* 32-bit ONLY */ |
| 452 | 447 | { |
| 453 | 448 | if( gfx ) |
| r13798 | r13799 | |
| 492 | 487 | y_index = 0; |
| 493 | 488 | } |
| 494 | 489 | |
| 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; | |
| 519 | 495 | } |
| 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 | } | |
| 520 | 512 | |
| 521 | 513 | if( ex>sx ) |
| 522 | 514 | { /* skip if inner loop doesn't draw anything */ |
| r13798 | r13799 | |
| 866 | 858 | |
| 867 | 859 | // the 0x400 bit in the tilemap regs is "draw it upside-down" (bios tilemap during flashing, otherwise capcom logo is flipped) |
| 868 | 860 | |
| 869 | static void cps3_draw_tilemapsprite_line(running_machine &machine, int tmnum, int drawline, bitmap_t *bitmap, const rectangle | |
| 861 | static void cps3_draw_tilemapsprite_line(running_machine &machine, int tmnum, int drawline, bitmap_t *bitmap, const rectangle &cliprect ) | |
| 870 | 862 | { |
| 871 | 863 | cps3_state *state = machine.driver_data<cps3_state>(); |
| 872 | 864 | UINT32* tmapregs[4] = { state->m_tilemap20_regs_base, state->m_tilemap30_regs_base, state->m_tilemap40_regs_base, state->m_tilemap50_regs_base }; |
| r13798 | r13799 | |
| 918 | 910 | |
| 919 | 911 | drawline&=0x3ff; |
| 920 | 912 | |
| 921 | if (drawline>cliprect | |
| 913 | if (drawline>cliprect. | |
| 922 | 914 | |
| 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; | |
| 925 | 917 | clip.min_y = drawline; |
| 926 | 918 | clip.max_y = drawline; |
| 927 | 919 | |
| 928 | for (x=0;x<(cliprect | |
| 920 | for (x=0;x<(cliprect. | |
| 929 | 921 | { |
| 930 | 922 | |
| 931 | 923 | UINT32 dat; |
| r13798 | r13799 | |
| 944 | 936 | if (!bpp) machine.gfx[1]->color_granularity=256; |
| 945 | 937 | else machine.gfx[1]->color_granularity=64; |
| 946 | 938 | |
| 947 | cps3_drawgfxzoom(bitmap, | |
| 939 | cps3_drawgfxzoom(bitmap, | |
| 948 | 940 | } |
| 949 | 941 | } |
| 950 | 942 | } |
| r13798 | r13799 | |
| 1101 | 1093 | { |
| 1102 | 1094 | for (uu=0;uu<1023;uu++) |
| 1103 | 1095 | { |
| 1104 | cps3_draw_tilemapsprite_line(screen.machine(), tilemapnum, uu, state->m_renderbuffer_bitmap, | |
| 1096 | cps3_draw_tilemapsprite_line(screen.machine(), tilemapnum, uu, state->m_renderbuffer_bitmap, | |
| 1105 | 1097 | } |
| 1106 | 1098 | } |
| 1107 | 1099 | bg_drawn[tilemapnum] = 1; |
| r13798 | r13799 | |
| 1188 | 1180 | |
| 1189 | 1181 | if (global_alpha || alpha) |
| 1190 | 1182 | { |
| 1191 | cps3_drawgfxzoom(state->m_renderbuffer_bitmap, | |
| 1183 | cps3_drawgfxzoom(state->m_renderbuffer_bitmap, | |
| 1192 | 1184 | } |
| 1193 | 1185 | else |
| 1194 | 1186 | { |
| 1195 | cps3_drawgfxzoom(state->m_renderbuffer_bitmap, | |
| 1187 | cps3_drawgfxzoom(state->m_renderbuffer_bitmap, | |
| 1196 | 1188 | } |
| 1197 | 1189 | count++; |
| 1198 | 1190 | } |
| r13798 | r13799 | |
|---|---|---|
| 71 | 71 | static SCREEN_UPDATE( tonton ) |
| 72 | 72 | { |
| 73 | 73 | tonton_state *state = screen.machine().driver_data<tonton_state>(); |
| 74 | bitmap->fill(get_black_pen(screen.machine()), | |
| 74 | bitmap->fill(get_black_pen(screen.machine()), | |
| 75 | 75 | |
| 76 | 76 | copybitmap(bitmap, state->m_vdp0_bitmap, 0, 0, 0, 0, cliprect); |
| 77 | 77 |
| r13798 | r13799 | |
|---|---|---|
| 454 | 454 | static SCREEN_UPDATE( subsino ) |
| 455 | 455 | { |
| 456 | 456 | subsino_state *state = screen.machine().driver_data<subsino_state>(); |
| 457 | bitmap->fill(0, | |
| 457 | bitmap->fill(0, | |
| 458 | 458 | tilemap_draw(bitmap,cliprect, state->m_tmap, 0, 0); |
| 459 | 459 | return 0; |
| 460 | 460 | } |
| r13798 | r13799 | |
| 463 | 463 | { |
| 464 | 464 | subsino_state *state = screen.machine().driver_data<subsino_state>(); |
| 465 | 465 | int i; |
| 466 | bitmap->fill(0, | |
| 466 | bitmap->fill(0, | |
| 467 | 467 | |
| 468 | 468 | for (i= 0;i < 64;i++) |
| 469 | 469 | { |
| r13798 | r13799 | |
| 479 | 479 | const rectangle visible2(0*8, (14+48)*8-1, 10*8, (10+7)*8-1); |
| 480 | 480 | const rectangle visible3(0*8, (14+48)*8-1, 18*8, (18+7)*8-1); |
| 481 | 481 | |
| 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); | |
| 485 | 485 | } |
| 486 | 486 | |
| 487 | 487 | tilemap_draw(bitmap,cliprect, state->m_tmap, 0, 0); |
| r13798 | r13799 | |
| 493 | 493 | { |
| 494 | 494 | subsino_state *state = screen.machine().driver_data<subsino_state>(); |
| 495 | 495 | int i; |
| 496 | bitmap->fill(0, | |
| 496 | bitmap->fill(0, | |
| 497 | 497 | |
| 498 | 498 | if (state->m_reel1_attr) |
| 499 | 499 | { |
| r13798 | r13799 | |
| 516 | 516 | const rectangle visible2(0, 511, 88, 143); |
| 517 | 517 | const rectangle visible3(0, 511, 144, 223); |
| 518 | 518 | |
| 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); | |
| 522 | 522 | } |
| 523 | 523 | |
| 524 | 524 | tilemap_draw(bitmap,cliprect, state->m_tmap, 0, 0); |
| r13798 | r13799 | |
|---|---|---|
| 368 | 368 | UINT16 pixdata1; |
| 369 | 369 | UINT16 pixdata2; |
| 370 | 370 | |
| 371 | bitmap->fill(get_black_pen(screen.machine()), | |
| 371 | bitmap->fill(get_black_pen(screen.machine()), | |
| 372 | 372 | |
| 373 | 373 | SCREEN_UPDATE_CALL(jchan_view2); |
| 374 | 374 | |
| 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); | |
| 377 | 377 | |
| 378 | 378 | 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 ); |
| 379 | 379 | 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 ); |
| r13798 | r13799 | |
|---|---|---|
| 63 | 63 | mlanding_state *state = screen.machine().driver_data<mlanding_state>(); |
| 64 | 64 | int x, y; |
| 65 | 65 | |
| 66 | for (y = cliprect | |
| 66 | for (y = cliprect. | |
| 67 | 67 | { |
| 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); | |
| 70 | 70 | |
| 71 | for (x = cliprect | |
| 71 | for (x = cliprect. | |
| 72 | 72 | { |
| 73 | 73 | UINT16 srcpix = *src++; |
| 74 | 74 |
| r13798 | r13799 | |
|---|---|---|
| 53 | 53 | ---- ---- --?? ??xx [6] map register |
| 54 | 54 | */ |
| 55 | 55 | |
| 56 | static void draw_layer(running_machine &machine, bitmap_t *bitmap,const rectangle | |
| 56 | static void draw_layer(running_machine &machine, bitmap_t *bitmap,const rectangle &cliprect,int layer,int data_shift) | |
| 57 | 57 | { |
| 58 | 58 | neoprint_state *state = machine.driver_data<neoprint_state>(); |
| 59 | 59 | int i, y, x; |
| r13798 | r13799 | |
| 93 | 93 | |
| 94 | 94 | SCREEN_UPDATE(neoprint) |
| 95 | 95 | { |
| 96 | bitmap->fill(0, | |
| 96 | bitmap->fill(0, | |
| 97 | 97 | |
| 98 | 98 | draw_layer(screen.machine(),bitmap,cliprect,1,2); |
| 99 | 99 | draw_layer(screen.machine(),bitmap,cliprect,0,2); |
| r13798 | r13799 | |
| 103 | 103 | |
| 104 | 104 | SCREEN_UPDATE(nprsp) |
| 105 | 105 | { |
| 106 | bitmap->fill(0, | |
| 106 | bitmap->fill(0, | |
| 107 | 107 | |
| 108 | 108 | draw_layer(screen.machine(),bitmap,cliprect,1,0); |
| 109 | 109 | draw_layer(screen.machine(),bitmap,cliprect,2,0); |
| r13798 | r13799 | |
|---|---|---|
| 330 | 330 | #endif |
| 331 | 331 | |
| 332 | 332 | |
| 333 | bitmap->fill(get_black_pen(screen.machine()), | |
| 333 | bitmap->fill(get_black_pen(screen.machine()), | |
| 334 | 334 | |
| 335 | 335 | if (layers_ctrl & 1) copybitmap_trans(bitmap, state->m_bitmap[0][(state->m_regs[0x02/2]>>8)&1], 0,0,0,0, cliprect, 0xff); |
| 336 | 336 | if (layers_ctrl & 2) copybitmap_trans(bitmap, state->m_bitmap[1][(state->m_regs[0x02/2]>>9)&1], 0,0,0,0, cliprect, 0xff); |
| r13798 | r13799 | |
|---|---|---|
| 107 | 107 | |
| 108 | 108 | for (y = bally; y < bally + 2; y++) |
| 109 | 109 | 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) | |
| 114 | 114 | bitmap->pix16(y, x) = 1; |
| 115 | 115 | return 0; |
| 116 | 116 | } |
| r13798 | r13799 | |
|---|---|---|
| 154 | 154 | int sx, sy; |
| 155 | 155 | int flipx, flipy; |
| 156 | 156 | |
| 157 | bitmap->fill(state->m_bgcolor, | |
| 157 | bitmap->fill(state->m_bgcolor, | |
| 158 | 158 | tilemap_draw(bitmap,cliprect,state->m_bgmap,0,0); |
| 159 | 159 | for ( offs = 0x80-4 ; offs >=0 ; offs -= 4) |
| 160 | 160 | { |
| r13798 | r13799 | |
|---|---|---|
| 192 | 192 | } |
| 193 | 193 | |
| 194 | 194 | |
| 195 | static void gcu_draw_object(running_machine &machine, bitmap_t *bitmap, const rectangle | |
| 195 | static void gcu_draw_object(running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect, int chip, UINT32 *cmd) | |
| 196 | 196 | { |
| 197 | 197 | firebeat_state *state = machine.driver_data<firebeat_state>(); |
| 198 | 198 | // 0x00: xxx----- -------- -------- -------- command type |
| r13798 | r13799 | |
| 239 | 239 | width = (((width * 65536) / xscale) * 64) / 65536; |
| 240 | 240 | height = (((height * 65536) / yscale) * 64) / 65536; |
| 241 | 241 | |
| 242 | if (y > cliprect | |
| 242 | if (y > cliprect. | |
| 243 | 243 | return; |
| 244 | 244 | } |
| 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; | |
| 247 | 247 | } |
| 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; | |
| 250 | 250 | } |
| 251 | 251 | |
| 252 | 252 | v = 0; |
| r13798 | r13799 | |
| 346 | 346 | } |
| 347 | 347 | } |
| 348 | 348 | |
| 349 | static void gcu_fill_rect(bitmap_t *bitmap, const rectangle | |
| 349 | static void gcu_fill_rect(bitmap_t *bitmap, const rectangle &cliprect, UINT32 *cmd) | |
| 350 | 350 | { |
| 351 | 351 | int i, j; |
| 352 | 352 | int x1, y1, x2, y2; |
| r13798 | r13799 | |
| 375 | 375 | } |
| 376 | 376 | |
| 377 | 377 | // 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; | |
| 382 | 382 | |
| 383 | 383 | for (j=y1; j < y2; j++) |
| 384 | 384 | { |
| r13798 | r13799 | |
| 393 | 393 | } |
| 394 | 394 | } |
| 395 | 395 | |
| 396 | static void gcu_draw_character(running_machine &machine, bitmap_t *bitmap, const rectangle | |
| 396 | static void gcu_draw_character(running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect, int chip, UINT32 *cmd) | |
| 397 | 397 | { |
| 398 | 398 | firebeat_state *state = machine.driver_data<firebeat_state>(); |
| 399 | 399 | // 0x00: xxx----- -------- -------- -------- command type |
| r13798 | r13799 | |
| 422 | 422 | color[3] = (cmd[3] >> 0) & 0xffff; |
| 423 | 423 | |
| 424 | 424 | |
| 425 | if (y > cliprect | |
| 425 | if (y > cliprect. | |
| 426 | 426 | return; |
| 427 | 427 | } |
| 428 | 428 | |
| r13798 | r13799 | |
| 442 | 442 | } |
| 443 | 443 | } |
| 444 | 444 | |
| 445 | static void gcu_exec_display_list(running_machine &machine, bitmap_t *bitmap, const rectangle | |
| 445 | static void gcu_exec_display_list(running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect, int chip, UINT32 address) | |
| 446 | 446 | { |
| 447 | 447 | firebeat_state *state = machine.driver_data<firebeat_state>(); |
| 448 | 448 | int counter = 0; |
| r13798 | r13799 | |
| 513 | 513 | }; |
| 514 | 514 | } |
| 515 | 515 | |
| 516 | static UINT32 update_screen(screen_device &screen, bitmap_t *bitmap, const rectangle | |
| 516 | static UINT32 update_screen(screen_device &screen, bitmap_t *bitmap, const rectangle &cliprect, int chip) | |
| 517 | 517 | { |
| 518 | 518 | firebeat_state *state = screen.machine().driver_data<firebeat_state>(); |
| 519 | 519 | |
| 520 | bitmap->fill(0, | |
| 520 | bitmap->fill(0, | |
| 521 | 521 | |
| 522 | 522 | if (mame_stricmp(screen.machine().system().name, "popn7") == 0) |
| 523 | 523 | { |
| r13798 | r13799 | |
|---|---|---|
| 147 | 147 | } |
| 148 | 148 | #endif |
| 149 | 149 | |
| 150 | bitmap->fill(get_black_pen(screen.machine()), | |
| 150 | bitmap->fill(get_black_pen(screen.machine()), | |
| 151 | 151 | |
| 152 | 152 | switch (state->m_layers) |
| 153 | 153 | { |
| r13798 | r13799 | |
|---|---|---|
| 127 | 127 | { |
| 128 | 128 | color = state->m_fg_fb[(xi+yi*8)+count*0x40]; |
| 129 | 129 | |
| 130 | if((x+yi) <= cliprect | |
| 130 | if((x+yi) <= cliprect. | |
| 131 | 131 | bitmap->pix16(x+yi, 256-y+xi) = screen.machine().pens[(color & 0x7)]; |
| 132 | 132 | } |
| 133 | 133 | } |
| r13798 | r13799 | |
|---|---|---|
| 388 | 388 | SET_TILE_INFO(1, code, colr >> 12, 0); |
| 389 | 389 | } |
| 390 | 390 | |
| 391 | static void draw_sprites( running_machine &machine, bitmap_t *bitmap, const rectangle | |
| 391 | static void draw_sprites( running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect ) | |
| 392 | 392 | { |
| 393 | 393 | playmark_state *state = machine.driver_data<playmark_state>(); |
| 394 | 394 | UINT16 *spriteram = state->m_spriteram; |
| r13798 | r13799 | |
|---|---|---|
| 181 | 181 | int startclipmin = 0; |
| 182 | 182 | const rectangle &visarea = screen.visible_area(); |
| 183 | 183 | |
| 184 | bitmap->fill(get_black_pen(screen.machine()), | |
| 184 | bitmap->fill(get_black_pen(screen.machine()), | |
| 185 | 185 | |
| 186 | 186 | for (i=0;i < 0x40;i++) |
| 187 | 187 | { |
| r13798 | r13799 | |
| 203 | 203 | |
| 204 | 204 | if (rowenable==0) |
| 205 | 205 | { |
| 206 | tilemap_draw(bitmap, | |
| 206 | tilemap_draw(bitmap, | |
| 207 | 207 | } |
| 208 | 208 | else if (rowenable==1) |
| 209 | 209 | { |
| 210 | tilemap_draw(bitmap, | |
| 210 | tilemap_draw(bitmap, | |
| 211 | 211 | } |
| 212 | 212 | else if (rowenable==2) |
| 213 | 213 | { |
| 214 | tilemap_draw(bitmap, | |
| 214 | tilemap_draw(bitmap, | |
| 215 | 215 | } |
| 216 | 216 | else if (rowenable==3) |
| 217 | 217 | { |
| r13798 | r13799 | |
|---|---|---|
| 68 | 68 | { |
| 69 | 69 | } |
| 70 | 70 | |
| 71 | static void draw_strip(running_machine &machine, bitmap_t *bitmap, const rectangle | |
| 71 | static void draw_strip(running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect, int stripnum, int xbase, int ybase, int bg) | |
| 72 | 72 | { |
| 73 | 73 | blackt96_state *state = machine.driver_data<blackt96_state>(); |
| 74 | 74 | const gfx_element *gfxspr = machine.gfx[1]; |
| r13798 | r13799 | |
| 98 | 98 | |
| 99 | 99 | } |
| 100 | 100 | |
| 101 | static void draw_main(running_machine &machine, bitmap_t *bitmap, const rectangle | |
| 101 | static void draw_main(running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect, int bg) | |
| 102 | 102 | { |
| 103 | 103 | blackt96_state *state = machine.driver_data<blackt96_state>(); |
| 104 | 104 | |
| r13798 | r13799 | |
| 135 | 135 | int x,y; |
| 136 | 136 | const gfx_element *gfx = screen.machine().gfx[2]; |
| 137 | 137 | |
| 138 | bitmap->fill(get_black_pen(screen.machine()), | |
| 138 | bitmap->fill(get_black_pen(screen.machine()), | |
| 139 | 139 | |
| 140 | 140 | draw_main(screen.machine(),bitmap,cliprect,1); |
| 141 | 141 | draw_main(screen.machine(),bitmap,cliprect,0); |
| r13798 | r13799 | |
|---|---|---|
| 88 | 88 | int offs; |
| 89 | 89 | |
| 90 | 90 | /* first of all, fill the screen with the background color */ |
| 91 | bitmap->fill(0, | |
| 91 | bitmap->fill(0, | |
| 92 | 92 | |
| 93 | 93 | drawgfx_opaque(bitmap, cliprect, screen.machine().gfx[1], |
| 94 | 94 | 0, |
| r13798 | r13799 | |
|---|---|---|
| 150 | 150 | |
| 151 | 151 | |
| 152 | 152 | |
| 153 | static void draw_sprites( running_machine &machine, bitmap_t *bitmap, const rectangle | |
| 153 | static void draw_sprites( running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect ) | |
| 154 | 154 | { |
| 155 | 155 | dreamwld_state *state = machine.driver_data<dreamwld_state>(); |
| 156 | 156 | const gfx_element *gfx = machine.gfx[0]; |
| r13798 | r13799 | |
|---|---|---|
| 215 | 215 | colortable_configure_tilemap_groups(machine.colortable, state->m_txttilemap, machine.gfx[0], 0); |
| 216 | 216 | } |
| 217 | 217 | |
| 218 | static void draw_sprites(running_machine &machine, bitmap_t *bitmap,const rectangle | |
| 218 | static void draw_sprites(running_machine &machine, bitmap_t *bitmap,const rectangle &cliprect ) | |
| 219 | 219 | { |
| 220 | 220 | panicr_state *state = machine.driver_data<panicr_state>(); |
| 221 | 221 | UINT8 *spriteram = state->m_spriteram; |
| r13798 | r13799 | |
| 242 | 242 | static SCREEN_UPDATE( panicr) |
| 243 | 243 | { |
| 244 | 244 | panicr_state *state = screen.machine().driver_data<panicr_state>(); |
| 245 | bitmap->fill(get_black_pen(screen.machine()), | |
| 245 | bitmap->fill(get_black_pen(screen.machine()), | |
| 246 | 246 | tilemap_mark_all_tiles_dirty( state->m_txttilemap ); |
| 247 | 247 | 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) ); |
| 248 | 248 | tilemap_draw(bitmap,cliprect,state->m_bgtilemap,0,0); |
| r13798 | r13799 | |
|---|---|---|
| 52 | 52 | int charx, chary; |
| 53 | 53 | |
| 54 | 54 | /* clear */ |
| 55 | bitmap->fill(0, | |
| 55 | bitmap->fill(0, | |
| 56 | 56 | |
| 57 | 57 | /* DEBUG */ |
| 58 | 58 | /* |
| r13798 | r13799 | |
|---|---|---|
| 112 | 112 | { |
| 113 | 113 | sbowling_state *state = screen.machine().driver_data<sbowling_state>(); |
| 114 | 114 | |
| 115 | bitmap->fill(0x18, | |
| 115 | bitmap->fill(0x18, | |
| 116 | 116 | tilemap_draw(bitmap, cliprect,state->m_sb_tilemap, 0, 0); |
| 117 | 117 | copybitmap_trans(bitmap, state->m_tmpbitmap, 0, 0, 0, 0, cliprect, state->m_color_prom_address); |
| 118 | 118 | return 0; |
| r13798 | r13799 | |
|---|---|---|
| 83 | 83 | |
| 84 | 84 | deco16ic_pf_update(state->m_deco_tilegen1, state->m_pf1_rowscroll, state->m_pf2_rowscroll); |
| 85 | 85 | |
| 86 | bitmap->fill(256, | |
| 86 | bitmap->fill(256, | |
| 87 | 87 | |
| 88 | 88 | deco16ic_tilemap_2_draw(state->m_deco_tilegen1, bitmap, cliprect, TILEMAP_DRAW_OPAQUE, 0); |
| 89 | 89 | screen.machine().device<decospr_device>("spritegen")->inefficient_copy_sprite_bitmap(screen.machine(), bitmap, cliprect, 0x0800, 0x0800, 0x200, 0x1ff); |
| r13798 | r13799 | |
|---|---|---|
| 347 | 347 | //popmessage("%02x %02x %02x %02x",state->m_sc0_prin,state->m_sc1_prin,state->m_sc2_prin,state->m_sc3_prin); |
| 348 | 348 | } |
| 349 | 349 | |
| 350 | static void draw_sc0_layer(running_machine &machine, bitmap_t *bitmap, const rectangle | |
| 350 | static void draw_sc0_layer(running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect) | |
| 351 | 351 | { |
| 352 | 352 | jalmah_state *state = machine.driver_data<jalmah_state>(); |
| 353 | 353 | switch(state->m_jm_vregs[0] & 3) |
| r13798 | r13799 | |
| 359 | 359 | } |
| 360 | 360 | } |
| 361 | 361 | |
| 362 | static void draw_sc1_layer(running_machine &machine, bitmap_t *bitmap, const rectangle | |
| 362 | static void draw_sc1_layer(running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect) | |
| 363 | 363 | { |
| 364 | 364 | jalmah_state *state = machine.driver_data<jalmah_state>(); |
| 365 | 365 | switch(state->m_jm_vregs[1] & 3) |
| r13798 | r13799 | |
| 371 | 371 | } |
| 372 | 372 | } |
| 373 | 373 | |
| 374 | static void draw_sc2_layer(running_machine &machine, bitmap_t *bitmap, const rectangle | |
| 374 | static void draw_sc2_layer(running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect) | |
| 375 | 375 | { |
| 376 | 376 | jalmah_state *state = machine.driver_data<jalmah_state>(); |
| 377 | 377 | switch(state->m_jm_vregs[2] & 3) |
| r13798 | r13799 | |
| 383 | 383 | } |
| 384 | 384 | } |
| 385 | 385 | |
| 386 | static void draw_sc3_layer(running_machine &machine, bitmap_t *bitmap, const rectangle | |
| 386 | static void draw_sc3_layer(running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect) | |
| 387 | 387 | { |
| 388 | 388 | jalmah_state *state = machine.driver_data<jalmah_state>(); |
| 389 | 389 | switch(state->m_jm_vregs[3] & 3) |
| r13798 | r13799 | |
| 443 | 443 | tilemap_set_scrolly(state->m_sc3_tilemap_2, 0, jm_scrollram[7] & 0x1ff); |
| 444 | 444 | tilemap_set_scrolly(state->m_sc3_tilemap_3, 0, jm_scrollram[7] & 0x3ff); |
| 445 | 445 | |
| 446 | bitmap->fill(screen.machine().pens[0xff], | |
| 446 | bitmap->fill(screen.machine().pens[0xff], | |
| 447 | 447 | |
| 448 | 448 | for(cur_prin=1;cur_prin<=0x8;cur_prin<<=1) |
| 449 | 449 | { |
| r13798 | r13799 | |
| 466 | 466 | tilemap_set_scrolly(state->m_sc0_tilemap_0, 0, jm_scrollram[4]); |
| 467 | 467 | tilemap_set_scrolly(state->m_sc3_tilemap_0, 0, jm_scrollram[7]); |
| 468 | 468 | |
| 469 | bitmap->fill(screen.machine().pens[0x1ff], | |
| 469 | bitmap->fill(screen.machine().pens[0x1ff], | |
| 470 | 470 | if(state->m_jm_vregs[0] & 1) { tilemap_draw(bitmap,cliprect,state->m_sc0_tilemap_0,0,0); } |
| 471 | 471 | if(state->m_jm_vregs[3] & 1) { tilemap_draw(bitmap,cliprect,state->m_sc3_tilemap_0,0,0); } |
| 472 | 472 | return 0; |
| r13798 | r13799 | |
|---|---|---|
| 67 | 67 | pen_t back_pen = MAKE_RGB(pal1bit(state->m_color >> 3), pal1bit(state->m_color >> 4), pal1bit(state->m_color >> 5)); |
| 68 | 68 | pen_t fore_pen = MAKE_RGB(pal1bit(state->m_color >> 0), pal1bit(state->m_color >> 1), pal1bit(state->m_color >> 2)); |
| 69 | 69 | |
| 70 | for(y = (cliprect | |
| 70 | for(y = (cliprect. | |
| 71 | 71 | { |
| 72 | 72 | for (x = 0; x < 256; x+=16) |
| 73 | 73 | { |
| r13798 | r13799 | |
|---|---|---|
| 93 | 93 | { |
| 94 | 94 | spoker_state *state = screen.machine().driver_data<spoker_state>(); |
| 95 | 95 | |
| 96 | bitmap->fill(get_black_pen(screen.machine()), | |
| 96 | bitmap->fill(get_black_pen(screen.machine()), | |
| 97 | 97 | tilemap_draw(bitmap, cliprect, state->m_bg_tilemap, 0, 0); |
| 98 | 98 | tilemap_draw(bitmap, cliprect, state->m_fg_tilemap, 0, 0); |
| 99 | 99 | return 0; |
| r13798 | r13799 | |
|---|---|---|
| 207 | 207 | zr107_state *state = screen.machine().driver_data<zr107_state>(); |
| 208 | 208 | device_t *k001604 = screen.machine().device("k001604"); |
| 209 | 209 | |
| 210 | bitmap->fill(screen.machine().pens[0], | |
| 210 | bitmap->fill(screen.machine().pens[0], | |
| 211 | 211 | |
| 212 | 212 | K001005_draw(bitmap, cliprect); |
| 213 | 213 | |
| r13798 | r13799 | |
| 259 | 259 | { |
| 260 | 260 | zr107_state *state = screen.machine().driver_data<zr107_state>(); |
| 261 | 261 | device_t *k056832 = screen.machine().device("k056832"); |
| 262 | bitmap->fill(screen.machine().pens[0], | |
| 262 | bitmap->fill(screen.machine().pens[0], | |
| 263 | 263 | |
| 264 | 264 | k056832_tilemap_draw(k056832, bitmap, cliprect, 1, 0, 0); |
| 265 | 265 | K001005_draw(bitmap, cliprect); |
| r13798 | r13799 | |
|---|---|---|
| 87 | 87 | machine.gfx[0]->color_granularity = 8; |
| 88 | 88 | } |
| 89 | 89 | |
| 90 | static void draw_sprites( running_machine &machine, bitmap_t *bitmap, const rectangle | |
| 90 | static void draw_sprites( running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect ) | |
| 91 | 91 | { |
| 92 | 92 | dominob_state *state = machine.driver_data<dominob_state>(); |
| 93 | 93 | int offs; |
| r13798 | r13799 | |
|---|---|---|
| 845 | 845 | tilemap_set_transparent_pen(state->m_fg_tilemap, 0); |
| 846 | 846 | } |
| 847 | 847 | |
| 848 | static void draw_sprites( running_machine &machine, bitmap_t *bitmap, const rectangle | |
| 848 | static void draw_sprites( running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect ) | |
| 849 | 849 | { |
| 850 | 850 | nmg5_state *state = machine.driver_data<nmg5_state>(); |
| 851 | 851 | UINT16 *spriteram = state->m_spriteram; |
| r13798 | r13799 | |
|---|---|---|
| 68 | 68 | int x,y,count; |
| 69 | 69 | const UINT8 *blit_ram = screen.machine().region("user5")->base(); |
| 70 | 70 | |
| 71 | bitmap->fill(get_black_pen(screen.machine()), | |
| 71 | bitmap->fill(get_black_pen(screen.machine()), | |
| 72 | 72 | |
| 73 | 73 | count = (0); |
| 74 | 74 |
| r13798 | r13799 | |
|---|---|---|
| 81 | 81 | int count; |
| 82 | 82 | int y, x; |
| 83 | 83 | |
| 84 | bitmap->fill(screen.machine().pens[0], | |
| 84 | bitmap->fill(screen.machine().pens[0], | |
| 85 | 85 | |
| 86 | 86 | tilemap_set_scrolly(state->m_txt_tilemap, 0, state->m_tilemap_regs[0] - 3); |
| 87 | 87 | tilemap_set_scrollx(state->m_txt_tilemap, 0, state->m_tilemap_regs[1]); |
| r13798 | r13799 | |
|---|---|---|
| 129 | 129 | tilemap_mark_tile_dirty(state->m_tmap2, offset); |
| 130 | 130 | } |
| 131 | 131 | |
| 132 | static void draw_sprites(running_machine &machine, bitmap_t *bitmap, const rectangle | |
| 132 | static void draw_sprites(running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect) | |
| 133 | 133 | { |
| 134 | 134 | darkhors_state *state = machine.driver_data<darkhors_state>(); |
| 135 | 135 | UINT32 *s = state->m_spriteram; |
| r13798 | r13799 | |
| 195 | 195 | } |
| 196 | 196 | #endif |
| 197 | 197 | |
| 198 | bitmap->fill(get_black_pen(screen.machine()), | |
| 198 | bitmap->fill(get_black_pen(screen.machine()), | |
| 199 | 199 | |
| 200 | 200 | tilemap_set_scrollx(state->m_tmap,0, (state->m_tmapscroll[0] >> 16) - 5); |
| 201 | 201 | tilemap_set_scrolly(state->m_tmap,0, (state->m_tmapscroll[0] & 0xffff) - 0xff ); |
| r13798 | r13799 | |
|---|---|---|
| 90 | 90 | { |
| 91 | 91 | } |
| 92 | 92 | |
| 93 | static void draw_sprites(running_machine &machine, bitmap_t *bitmap, const rectangle | |
| 93 | static void draw_sprites(running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect) | |
| 94 | 94 | { |
| 95 | 95 | mirax_state *state = machine.driver_data<mirax_state>(); |
| 96 | 96 | UINT8 *spriteram = state->m_spriteram; |
| r13798 | r13799 | |
|---|---|---|
| 48 | 48 | { |
| 49 | 49 | cardline_state *state = screen.machine().driver_data<cardline_state>(); |
| 50 | 50 | int x,y; |
| 51 | bitmap->fill(0, | |
| 51 | bitmap->fill(0, | |
| 52 | 52 | for(y=0;y<32;y++) |
| 53 | 53 | { |
| 54 | 54 | for(x=0;x<64;x++) |
| r13798 | r13799 | |
|---|---|---|
| 488 | 488 | UINT8 *spriteram = state->m_spriteram; |
| 489 | 489 | int offs; |
| 490 | 490 | |
| 491 | bitmap->fill(32, | |
| 491 | bitmap->fill(32, | |
| 492 | 492 | |
| 493 | 493 | if(state->m_pri) //used in Frog & Spiders level 3 |
| 494 | 494 | { |
| r13798 | r13799 | |
| 559 | 559 | if (state->m_flip_y) sy^=0xff; |
| 560 | 560 | if (state->m_flip_x) sx+=8; |
| 561 | 561 | |
| 562 | if (sy>=cliprect | |
| 562 | if (sy>=cliprect. | |
| 563 | 563 | for (int x=sx-4;x<sx;x++) |
| 564 | if (x>=cliprect | |
| 564 | if (x>=cliprect. | |
| 565 | 565 | bitmap->pix16(sy, x)=bc; |
| 566 | 566 | } |
| 567 | 567 |
| r13798 | r13799 | |
|---|---|---|
| 163 | 163 | #endif |
| 164 | 164 | |
| 165 | 165 | 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()), | |
| 166 | else bitmap->fill(get_black_pen(screen.machine()), | |
| 167 | 167 | |
| 168 | bitmap->fill(get_black_pen(screen.machine()), | |
| 168 | bitmap->fill(get_black_pen(screen.machine()), | |
| 169 | 169 | if (layers_ctrl & 2) tilemap_draw(bitmap,cliprect, state->m_fg_tmap, 0, 0); |
| 170 | 170 | |
| 171 | 171 | return 0; |
| r13798 | r13799 | |
|---|---|---|
| 69 | 69 | }; |
| 70 | 70 | |
| 71 | 71 | |
| 72 | static void draw_sprites( running_machine &machine, bitmap_t *bitmap,const rectangle | |
| 72 | static void draw_sprites( running_machine &machine, bitmap_t *bitmap,const rectangle &cliprect ) | |
| 73 | 73 | { |
| 74 | 74 | egghunt_state *state = machine.driver_data<egghunt_state>(); |
| 75 | 75 | int flipscreen = 0; |
| r13798 | r13799 | |
|---|---|---|
| 70 | 70 | |
| 71 | 71 | |
| 72 | 72 | /* VIDEO GOODS */ |
| 73 | static void gpworld_draw_tiles(running_machine &machine, bitmap_t *bitmap,const rectangle | |
| 73 | static void gpworld_draw_tiles(running_machine &machine, bitmap_t *bitmap,const rectangle &cliprect) | |
| 74 | 74 | { |
| 75 | 75 | gpworld_state *state = machine.driver_data<gpworld_state>(); |
| 76 | 76 | UINT8 characterX, characterY; |
| r13798 | r13799 | |
| 88 | 88 | } |
| 89 | 89 | } |
| 90 | 90 | |
| 91 | INLINE void draw_pixel(bitmap_t *bitmap,const rectangle | |
| 91 | INLINE void draw_pixel(bitmap_t *bitmap,const rectangle &cliprect,int x,int y,int color,int flip) | |
| 92 | 92 | { |
| 93 | 93 | if (flip) |
| 94 | 94 | { |
| r13798 | r13799 | |
| 96 | 96 | y = bitmap->height() - y - 1; |
| 97 | 97 | } |
| 98 | 98 | |
| 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) | |
| 103 | 103 | return; |
| 104 | 104 | |
| 105 | 105 | bitmap->pix32(y, x) = color; |
| 106 | 106 | } |
| 107 | 107 | |
| 108 | static void gpworld_draw_sprites(running_machine &machine, bitmap_t *bitmap, const rectangle | |
| 108 | static void gpworld_draw_sprites(running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect) | |
| 109 | 109 | { |
| 110 | 110 | gpworld_state *state = machine.driver_data<gpworld_state>(); |
| 111 | 111 | const int SPR_Y_TOP = 0; |
| r13798 | r13799 | |
| 218 | 218 | |
| 219 | 219 | static SCREEN_UPDATE( gpworld ) |
| 220 | 220 | { |
| 221 | bitmap->fill(0, | |
| 221 | bitmap->fill(0, | |
| 222 | 222 | |
| 223 | 223 | gpworld_draw_tiles(screen.machine(), bitmap, cliprect); |
| 224 | 224 | gpworld_draw_sprites(screen.machine(), bitmap, cliprect); |
| r13798 | r13799 | |
|---|---|---|
| 117 | 117 | tilemap_set_scrolly(state->m_tilemap_2, 0, state->m_umipoker_scrolly[2]); |
| 118 | 118 | tilemap_set_scrolly(state->m_tilemap_3, 0, state->m_umipoker_scrolly[3]); |
| 119 | 119 | |
| 120 | bitmap->fill(get_black_pen(screen.machine()), | |
| 120 | bitmap->fill(get_black_pen(screen.machine()), | |
| 121 | 121 | |
| 122 | 122 | tilemap_draw(bitmap,cliprect,state->m_tilemap_0,0,0); |
| 123 | 123 | tilemap_draw(bitmap,cliprect,state->m_tilemap_1,0,0); |
| r13798 | r13799 | |
|---|---|---|
| 114 | 114 | palette_set_color(machine, i, cga_palette[i]); |
| 115 | 115 | } |
| 116 | 116 | |
| 117 | static void draw_char(bitmap_t *bitmap, const rectangle | |
| 117 | static void draw_char(bitmap_t *bitmap, const rectangle &cliprect, const gfx_element *gfx, int ch, int att, int x, int y) | |
| 118 | 118 | { |
| 119 | 119 | int i,j; |
| 120 | 120 | const UINT8 *dp; |
| r13798 | r13799 | |
| 144 | 144 | UINT32 *cga = state->m_cga_ram; |
| 145 | 145 | int index = 0; |
| 146 | 146 | |
| 147 | bitmap->fill(0, | |
| 147 | bitmap->fill(0, | |
| 148 | 148 | |
| 149 | 149 | for (j=0; j < 25; j++) |
| 150 | 150 | { |
| r13798 | r13799 | |
|---|---|---|
| 265 | 265 | device_t *voodoo = screen.machine().device("voodoo"); |
| 266 | 266 | device_t *k001604 = screen.machine().device("k001604"); |
| 267 | 267 | |
| 268 | bitmap->fill(screen.machine().pens[0], | |
| 268 | bitmap->fill(screen.machine().pens[0], | |
| 269 | 269 | |
| 270 | 270 | voodoo_update(voodoo, bitmap, cliprect); |
| 271 | 271 |
| r13798 | r13799 | |
|---|---|---|
| 199 | 199 | |
| 200 | 200 | if (state.blanked) |
| 201 | 201 | { |
| 202 | bitmap->fill(get_black_pen(screen.machine()), | |
| 202 | bitmap->fill(get_black_pen(screen.machine()), | |
| 203 | 203 | return 0; |
| 204 | 204 | } |
| 205 | 205 | |
| 206 | for (y = cliprect | |
| 206 | for (y = cliprect. | |
| 207 | 207 | { |
| 208 | 208 | UINT8 *src = &state.vram[(state.dispstart & 0xffff)*2 + 256 * y]; |
| 209 | UINT32 *dest = &bitmap->pix32(y, cliprect | |
| 209 | UINT32 *dest = &bitmap->pix32(y, cliprect. | |
| 210 | 210 | |
| 211 | for (x = cliprect | |
| 211 | for (x = cliprect. | |
| 212 | 212 | { |
| 213 | UINT8 pen = src[(x-cliprect | |
| 213 | UINT8 pen = src[(x-cliprect. | |
| 214 | 214 | |
| 215 | 215 | /* Draw two 4-bit pixels */ |
| 216 | 216 | *dest++ = screen.machine().pens[(pen >> 4) & 0xf]; |
| r13798 | r13799 | |
|---|---|---|
| 185 | 185 | |
| 186 | 186 | pri_ram = &state->m_priority_ram[(state->m_priority & 7) * 512/2]; |
| 187 | 187 | |
| 188 | for (y = cliprect | |
| 188 | for (y = cliprect. | |
| 189 | 189 | { |
| 190 | for (x = cliprect | |
| 190 | for (x = cliprect. | |
| 191 | 191 | { |
| 192 | 192 | scr_addr = x + y * 512; |
| 193 | 193 | pri_addr = 0xff; |
| r13798 | r13799 | |
|---|---|---|
| 172 | 172 | UINT16 b; |
| 173 | 173 | } temp; |
| 174 | 174 | |
| 175 | bitmap->fill(0, | |
| 175 | bitmap->fill(0, | |
| 176 | 176 | |
| 177 | 177 | #if 0 |
| 178 | 178 | /* debug */ |
| r13798 | r13799 | |
|---|---|---|
| 259 | 259 | } |
| 260 | 260 | else |
| 261 | 261 | { |
| 262 | bitmap->fill(0, | |
| 262 | bitmap->fill(0, | |
| 263 | 263 | } |
| 264 | 264 | return 0; |
| 265 | 265 | } |
| r13798 | r13799 | |
|---|---|---|
| 230 | 230 | |
| 231 | 231 | */ |
| 232 | 232 | |
| 233 | static void draw_sprites(running_machine &machine, bitmap_t *bitmap, const rectangle | |
| 233 | static void draw_sprites(running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect ) | |
| 234 | 234 | { |
| 235 | 235 | rabbit_state *state = machine.driver_data<rabbit_state>(); |
| 236 | 236 | int xpos,ypos,tileno,xflip,yflip, colr; |
| r13798 | r13799 | |
| 258 | 258 | |
| 259 | 259 | if(xpos&0x800)xpos-=0x1000; |
| 260 | 260 | |
| 261 | drawgfx_transpen(state->m_sprite_bitmap, | |
| 261 | drawgfx_transpen(state->m_sprite_bitmap, | |
| 262 | 262 | // 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); |
| 263 | 263 | |
| 264 | 264 | |
| r13798 | r13799 | |
| 269 | 269 | } |
| 270 | 270 | |
| 271 | 271 | /* the sprite bitmap can probably be handled better than this ... */ |
| 272 | static void rabbit_clearspritebitmap( running_machine &machine, bitmap_t *bitmap, const rectangle | |
| 272 | static void rabbit_clearspritebitmap( running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect ) | |
| 273 | 273 | { |
| 274 | 274 | rabbit_state *state = machine.driver_data<rabbit_state>(); |
| 275 | 275 | int startx, starty; |
| r13798 | r13799 | |
| 297 | 297 | } |
| 298 | 298 | |
| 299 | 299 | /* todo: fix zoom, its inaccurate and this code is ugly */ |
| 300 | static void draw_sprite_bitmap( running_machine &machine, bitmap_t *bitmap, const rectangle | |
| 300 | static void draw_sprite_bitmap( running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect ) | |
| 301 | 301 | { |
| 302 | 302 | rabbit_state *state = machine.driver_data<rabbit_state>(); |
| 303 | 303 | |
| r13798 | r13799 | |
| 330 | 330 | ydrawpos = ((y>>7)*ystep); |
| 331 | 331 | ydrawpos >>=16; |
| 332 | 332 | |
| 333 | if ((ydrawpos >= cliprect | |
| 333 | if ((ydrawpos >= cliprect. | |
| 334 | 334 | { |
| 335 | 335 | srcline = &state->m_sprite_bitmap->pix16((starty+(y>>7))&0xfff); |
| 336 | 336 | dstline = &bitmap->pix16(ydrawpos); |
| r13798 | r13799 | |
| 342 | 342 | pixdata = srcline[(startx+(x>>7))&0xfff]; |
| 343 | 343 | |
| 344 | 344 | if (pixdata) |
| 345 | if ((xdrawpos >= cliprect | |
| 345 | if ((xdrawpos >= cliprect. | |
| 346 | 346 | dstline[xdrawpos] = pixdata; |
| 347 | 347 | } |
| 348 | 348 | } |
| r13798 | r13799 | |
| 405 | 405 | |
| 406 | 406 | */ |
| 407 | 407 | |
| 408 | static void rabbit_drawtilemap( running_machine &machine, bitmap_t *bitmap, const rectangle | |
| 408 | static void rabbit_drawtilemap( running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect, int whichtilemap ) | |
| 409 | 409 | { |
| 410 | 410 | rabbit_state *state = machine.driver_data<rabbit_state>(); |
| 411 | 411 | INT32 startx, starty, incxx, incxy, incyx, incyy, tran; |
| r13798 | r13799 | |
| 434 | 434 | rabbit_state *state = screen.machine().driver_data<rabbit_state>(); |
| 435 | 435 | int prilevel; |
| 436 | 436 | |
| 437 | bitmap->fill(get_black_pen(screen.machine()), | |
| 437 | bitmap->fill(get_black_pen(screen.machine()), | |
| 438 | 438 | |
| 439 | 439 | // popmessage("%08x %08x", state->m_viewregs0[0], state->m_viewregs0[1]); |
| 440 | 440 | // 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]); |
| r13798 | r13799 | |
|---|---|---|
| 162 | 162 | |
| 163 | 163 | tilemap_set_scrollx(state->m_bg_tilemap, 0, ((state->m_port0_data & 0x40) << 2) + state->m_scrollx + SX_POS); // TODO |
| 164 | 164 | 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()), | |
| 165 | bitmap->fill(get_black_pen(screen.machine()), | |
| 166 | 166 | tilemap_draw(bitmap, cliprect, state->m_bg_tilemap, 0, 0); |
| 167 | 167 | pandora_update(state->m_pandora, bitmap, cliprect); |
| 168 | 168 |
| r13798 | r13799 | |
|---|---|---|
| 1108 | 1108 | if (params.enabled) |
| 1109 | 1109 | { |
| 1110 | 1110 | /* 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, ¶ms); | |
| 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, ¶ms); | |
| 1113 | 1113 | } |
| 1114 | 1114 | |
| 1115 | 1115 | /* otherwise, just blank the current scanline */ |
| 1116 | 1116 | else |
| 1117 | params.heblnk = params.hsblnk = cliprect | |
| 1117 | params.heblnk = params.hsblnk = cliprect. | |
| 1118 | 1118 | |
| 1119 | 1119 | /* blank out the blank regions */ |
| 1120 | 1120 | if (bitmap->bpp() == 16) |
| 1121 | 1121 | { |
| 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++) | |
| 1124 | 1124 | dest[x] = blackpen; |
| 1125 | for (x = params.hsblnk; x <= cliprect | |
| 1125 | for (x = params.hsblnk; x <= cliprect. | |
| 1126 | 1126 | dest[x] = blackpen; |
| 1127 | 1127 | } |
| 1128 | 1128 | else if (bitmap->bpp() == 32) |
| 1129 | 1129 | { |
| 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++) | |
| 1132 | 1132 | dest[x] = blackpen; |
| 1133 | for (x = params.hsblnk; x <= cliprect | |
| 1133 | for (x = params.hsblnk; x <= cliprect. | |
| 1134 | 1134 | dest[x] = blackpen; |
| 1135 | 1135 | } |
| 1136 | 1136 | return 0; |
| r13798 | r13799 | |
|---|---|---|
| 618 | 618 | // update_screen - |
| 619 | 619 | //------------------------------------------------- |
| 620 | 620 | |
| 621 | void upd3301_device::update_screen(bitmap_t *bitmap, const rectangle | |
| 621 | void upd3301_device::update_screen(bitmap_t *bitmap, const rectangle &cliprect) | |
| 622 | 622 | { |
| 623 | 623 | if (m_status & STATUS_VE) |
| 624 | 624 | { |
| r13798 | r13799 | |
| 648 | 648 | } |
| 649 | 649 | else |
| 650 | 650 | { |
| 651 | bitmap->fill(get_black_pen(machine()), | |
| 651 | bitmap->fill(get_black_pen(machine()), | |
| 652 | 652 | } |
| 653 | 653 | } |
| r13798 | r13799 | |
|---|---|---|
| 103 | 103 | DECLARE_READ_LINE_MEMBER( hrtc_r ); |
| 104 | 104 | DECLARE_READ_LINE_MEMBER( vrtc_r ); |
| 105 | 105 | |
| 106 | void update_screen(bitmap_t *bitmap, const rectangle | |
| 106 | void update_screen(bitmap_t *bitmap, const rectangle &cliprect); | |
| 107 | 107 | |
| 108 | 108 | protected: |
| 109 | 109 | // device-level overrides |
| r13798 | r13799 | |
|---|---|---|
| 688 | 688 | } |
| 689 | 689 | |
| 690 | 690 | |
| 691 | void mc6845_device::update(bitmap_t *bitmap, const rectangle | |
| 691 | void mc6845_device::update(bitmap_t *bitmap, const rectangle &cliprect) | |
| 692 | 692 | { |
| 693 | 693 | assert(bitmap != NULL); |
| 694 | assert(cliprect != NULL); | |
| 695 | 694 | |
| 696 | 695 | if (m_has_valid_parameters) |
| 697 | 696 | { |
| r13798 | r13799 | |
| 705 | 704 | if (m_begin_update != NULL) |
| 706 | 705 | param = m_begin_update(this, bitmap, cliprect); |
| 707 | 706 | |
| 708 | if (cliprect | |
| 707 | if (cliprect. | |
| 709 | 708 | { |
| 710 | 709 | /* read the start address at the beginning of the frame */ |
| 711 | 710 | m_current_disp_addr = m_disp_start_addr; |
| 712 | 711 | } |
| 713 | 712 | |
| 714 | 713 | /* for each row in the visible region */ |
| 715 | for (y = cliprect | |
| 714 | for (y = cliprect. | |
| 716 | 715 | { |
| 717 | 716 | /* compute the current raster line */ |
| 718 | 717 | UINT8 ra = y % (m_max_ras_addr + 1); |
| r13798 | r13799 | |
|---|---|---|
| 271 | 271 | // update_screen - update screen |
| 272 | 272 | //------------------------------------------------- |
| 273 | 273 | |
| 274 | void hd44102_device::update_screen(bitmap_t *bitmap, const rectangle | |
| 274 | void hd44102_device::update_screen(bitmap_t *bitmap, const rectangle &cliprect) | |
| 275 | 275 | { |
| 276 | 276 | for (int y = 0; y < 50; y++) |
| 277 | 277 | { |
| r13798 | r13799 | |
| 284 | 284 | int sy = m_sy + z; |
| 285 | 285 | int sx = m_sx + y; |
| 286 | 286 | |
| 287 | if ((sy >= cliprect | |
| 287 | if ((sy >= cliprect. | |
| 288 | 288 | { |
| 289 | 289 | int color = (m_status & STATUS_DISPLAY_OFF) ? 0 : BIT(data, z % 8); |
| 290 | 290 |
| r13798 | r13799 | |
|---|---|---|
| 46 | 46 | |
| 47 | 47 | DECLARE_WRITE_LINE_MEMBER( cs2_w ); |
| 48 | 48 | |
| 49 | void update_screen(bitmap_t *bitmap, const rectangle | |
| 49 | void update_screen(bitmap_t *bitmap, const rectangle &cliprect); | |
| 50 | 50 | |
| 51 | 51 | protected: |
| 52 | 52 | // device-level overrides |
| r13798 | r13799 | |
|---|---|---|
| 25 | 25 | class mc6845_device; |
| 26 | 26 | |
| 27 | 27 | /* callback definitions */ |
| 28 | typedef 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) | |
| 28 | typedef 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) | |
| 30 | 30 | |
| 31 | 31 | |
| 32 | 32 | typedef void (*mc6845_update_row_func)(mc6845_device *device, bitmap_t *bitmap, |
| 33 | const rectangle | |
| 33 | const rectangle &cliprect, UINT16 ma, UINT8 ra, | |
| 34 | 34 | UINT16 y, UINT8 x_count, INT8 cursor_x, void *param); |
| 35 | 35 | |
| 36 | 36 | |
| 37 | 37 | #define MC6845_UPDATE_ROW(name) void name(mc6845_device *device, bitmap_t *bitmap, \ |
| 38 | const rectangle | |
| 38 | const rectangle &cliprect, UINT16 ma, UINT8 ra, \ | |
| 39 | 39 | UINT16 y, UINT8 x_count, INT8 cursor_x, void *param) |
| 40 | 40 | |
| 41 | 41 | |
| 42 | typedef 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) | |
| 42 | typedef 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) | |
| 44 | 44 | |
| 45 | 45 | |
| 46 | 46 | typedef void (*mc6845_on_update_addr_changed_func)(mc6845_device *device, int address, int strobe); |
| r13798 | r13799 | |
| 148 | 148 | /* updates the screen -- this will call begin_update(), |
| 149 | 149 | followed by update_row() reapeatedly and after all row |
| 150 | 150 | updating is complete, end_update() */ |
| 151 | void update(bitmap_t *bitmap, const rectangle | |
| 151 | void update(bitmap_t *bitmap, const rectangle &cliprect); | |
| 152 | 152 | |
| 153 | 153 | protected: |
| 154 | 154 | // device-level overrides |
| r13798 | r13799 | |
|---|---|---|
| 1159 | 1159 | // draw_graphics_line - |
| 1160 | 1160 | //------------------------------------------------- |
| 1161 | 1161 | |
| 1162 | void h63484_device::draw_graphics_line(bitmap_t *bitmap, const rectangle | |
| 1162 | void h63484_device::draw_graphics_line(bitmap_t *bitmap, const rectangle &cliprect, int y, int layer_n) | |
| 1163 | 1163 | { |
| 1164 | 1164 | int x; |
| 1165 | 1165 | int pitch; |
| r13798 | r13799 | |
| 1188 | 1188 | // update_screen - |
| 1189 | 1189 | //------------------------------------------------- |
| 1190 | 1190 | |
| 1191 | void h63484_device::update_screen(bitmap_t *bitmap, const rectangle | |
| 1191 | void h63484_device::update_screen(bitmap_t *bitmap, const rectangle &cliprect) | |
| 1192 | 1192 | { |
| 1193 | 1193 | if(m_dcr & 0x8000) // correct? |
| 1194 | 1194 | { |
| 1195 | 1195 | int y; |
| 1196 | 1196 | |
| 1197 | for(y=cliprect | |
| 1197 | for(y=cliprect. | |
| 1198 | 1198 | { |
| 1199 | 1199 | if (m_display_cb) |
| 1200 | 1200 | draw_graphics_line(bitmap,cliprect, y, 1); |
| r13798 | r13799 | |
|---|---|---|
| 571 | 571 | } |
| 572 | 572 | |
| 573 | 573 | |
| 574 | void tms9928a_device::update( bitmap_t *bitmap, const rectangle | |
| 574 | void tms9928a_device::update( bitmap_t *bitmap, const rectangle &cliprect ) | |
| 575 | 575 | { |
| 576 | 576 | copybitmap( bitmap, m_tmpbmp, 0, 0, 0, 0, cliprect ); |
| 577 | 577 | } |
| r13798 | r13799 | |
|---|---|---|
| 56 | 56 | DECLARE_READ8_MEMBER( vram_r ); |
| 57 | 57 | DECLARE_WRITE8_MEMBER( vram_w ); |
| 58 | 58 | |
| 59 | void update_screen(bitmap_t *bitmap, const rectangle | |
| 59 | void update_screen(bitmap_t *bitmap, const rectangle &cliprect); | |
| 60 | 60 | virtual const rom_entry *device_rom_region() const; |
| 61 | 61 | virtual const address_space_config *memory_space_config(address_spacenum spacenum = AS_0) const; |
| 62 | 62 | |
| r13798 | r13799 | |
| 89 | 89 | UINT16 video_registers_r(int offset); |
| 90 | 90 | void video_registers_w(int offset); |
| 91 | 91 | int translate_command(UINT16 data); |
| 92 | void draw_graphics_line(bitmap_t *bitmap, const rectangle | |
| 92 | void draw_graphics_line(bitmap_t *bitmap, const rectangle &cliprect, int y, int layer_n); | |
| 93 | 93 | |
| 94 | 94 | |
| 95 | 95 | screen_device *m_screen; |
| r13798 | r13799 | |
|---|---|---|
| 104 | 104 | DECLARE_WRITE8_MEMBER( register_write ); |
| 105 | 105 | |
| 106 | 106 | /* update the screen */ |
| 107 | void update( bitmap_t *bitmap, const rectangle | |
| 107 | void update( bitmap_t *bitmap, const rectangle &cliprect ); | |
| 108 | 108 | |
| 109 | 109 | protected: |
| 110 | 110 | // device-level overrides |
| r13798 | r13799 | |
|---|---|---|
| 214 | 214 | * |
| 215 | 215 | *************************************/ |
| 216 | 216 | |
| 217 | static const rectangle global_cliprect(-4096, 4095, -4096, 4095); | |
| 218 | ||
| 217 | 219 | /* fast dither lookup */ |
| 218 | 220 | static UINT8 dither4_lookup[256*16*2]; |
| 219 | 221 | static UINT8 dither2_lookup[256*16*2]; |
| r13798 | r13799 | |
| 327 | 329 | * |
| 328 | 330 | *************************************/ |
| 329 | 331 | |
| 330 | int voodoo_update(device_t *device, bitmap_t *bitmap, const rectangle | |
| 332 | int voodoo_update(device_t *device, bitmap_t *bitmap, const rectangle &cliprect) | |
| 331 | 333 | { |
| 332 | 334 | voodoo_state *v = get_safe_token(device); |
| 333 | 335 | int changed = v->fbi.video_changed; |
| r13798 | r13799 | |
| 341 | 343 | /* if we are blank, just fill with black */ |
| 342 | 344 | if (v->type <= VOODOO_2 && FBIINIT1_SOFTWARE_BLANK(v->reg[fbiInit1].u)) |
| 343 | 345 | { |
| 344 | bitmap->fill(0, | |
| 346 | bitmap->fill(0, | |
| 345 | 347 | return changed; |
| 346 | 348 | } |
| 347 | 349 | |
| r13798 | r13799 | |
| 422 | 424 | drawbuf = v->fbi.backbuf; |
| 423 | 425 | |
| 424 | 426 | /* copy from the current front buffer */ |
| 425 | for (y = cliprect | |
| 427 | for (y = cliprect. | |
| 426 | 428 | if (y >= v->fbi.yoffs) |
| 427 | 429 | { |
| 428 | 430 | UINT16 *src = (UINT16 *)(v->fbi.ram + v->fbi.rgboffs[drawbuf]) + (y - v->fbi.yoffs) * v->fbi.rowpixels - v->fbi.xoffs; |
| 429 | 431 | UINT32 *dst = &bitmap->pix32(y); |
| 430 | for (x = cliprect | |
| 432 | for (x = cliprect. | |
| 431 | 433 | dst[x] = v->fbi.pen[src[x]]; |
| 432 | 434 | } |
| 433 | 435 | |
| r13798 | r13799 | |
| 445 | 447 | v->stats.render_override = device->machine().input().code_pressed(KEYCODE_ENTER); |
| 446 | 448 | if (DEBUG_DEPTH && v->stats.render_override) |
| 447 | 449 | { |
| 448 | for (y = cliprect | |
| 450 | for (y = cliprect. | |
| 449 | 451 | { |
| 450 | 452 | UINT16 *src = (UINT16 *)(v->fbi.ram + v->fbi.auxoffs) + (y - v->fbi.yoffs) * v->fbi.rowpixels - v->fbi.xoffs; |
| 451 | 453 | UINT32 *dst = &bitmap->pix32(y); |
| 452 | for (x = cliprect | |
| 454 | for (x = cliprect. | |
| 453 | 455 | dst[x] = ((src[x] << 8) & 0xff0000) | ((src[x] >> 0) & 0xff00) | ((src[x] >> 8) & 0xff); |
| 454 | 456 | } |
| 455 | 457 | } |
| r13798 | r13799 | |
| 5118 | 5120 | extra->state = v; |
| 5119 | 5121 | memcpy(extra->dither, dithermatrix, sizeof(extra->dither)); |
| 5120 | 5122 | |
| 5121 | pixels += poly_render_triangle_custom(v->poly, drawbuf, | |
| 5123 | pixels += poly_render_triangle_custom(v->poly, drawbuf, global_cliprect, raster_fastfill, y, count, extents); | |
| 5122 | 5124 | } |
| 5123 | 5125 | |
| 5124 | 5126 | /* 2 pixels per clock */ |
| r13798 | r13799 | |
| 5525 | 5527 | |
| 5526 | 5528 | /* farm the rasterization out to other threads */ |
| 5527 | 5529 | info->polys++; |
| 5528 | return poly_render_triangle(v->poly, drawbuf, | |
| 5530 | return poly_render_triangle(v->poly, drawbuf, global_cliprect, info->callback, 0, &vert[0], &vert[1], &vert[2]); | |
| 5529 | 5531 | } |
| 5530 | 5532 | |
| 5531 | 5533 |
| r13798 | r13799 | |
|---|---|---|
| 132 | 132 | FUNCTION PROTOTYPES |
| 133 | 133 | ***************************************************************************/ |
| 134 | 134 | |
| 135 | int voodoo_update(device_t *device, bitmap_t *bitmap, const rectangle | |
| 135 | int voodoo_update(device_t *device, bitmap_t *bitmap, const rectangle &cliprect); | |
| 136 | 136 | int voodoo_get_type(device_t *device); |
| 137 | 137 | int voodoo_is_stalled(device_t *device); |
| 138 | 138 | void voodoo_set_init_enable(device_t *device, UINT32 newval); |
| r13798 | r13799 | |
|---|---|---|
| 460 | 460 | } |
| 461 | 461 | |
| 462 | 462 | /* Screen Update */ |
| 463 | void i8275_update(device_t *device, bitmap_t *bitmap, const rectangle | |
| 463 | void i8275_update(device_t *device, bitmap_t *bitmap, const rectangle &cliprect) | |
| 464 | 464 | { |
| 465 | 465 | i8275_t *i8275 = get_safe_token(device); |
| 466 | 466 | i8275->ypos = 0; |
| r13798 | r13799 | |
| 474 | 474 | i8275->fifo_write = 0; |
| 475 | 475 | |
| 476 | 476 | if ((i8275->status_reg & I8275_STATUS_VIDEO_ENABLE)==0) { |
| 477 | bitmap->fill(get_black_pen(device->machine()), | |
| 477 | bitmap->fill(get_black_pen(device->machine()), | |
| 478 | 478 | } else { |
| 479 | 479 | // if value < 16 it is visible otherwise not |
| 480 | 480 | i8275->cursor_blink_cnt++; |
| r13798 | r13799 | |
|---|---|---|
| 317 | 317 | // draw_scanline - |
| 318 | 318 | //------------------------------------------------- |
| 319 | 319 | |
| 320 | void msm6255_device::draw_scanline(bitmap_t *bitmap, const rectangle | |
| 320 | void msm6255_device::draw_scanline(bitmap_t *bitmap, const rectangle &cliprect, int y, UINT16 ma, UINT8 ra) | |
| 321 | 321 | { |
| 322 | 322 | UINT8 hp = (m_pr & PR_HP_MASK) + 1; |
| 323 | 323 | UINT8 hn = (m_hnr & HNR_HN_MASK) + 1; |
| r13798 | r13799 | |
| 358 | 358 | // update_graphics - |
| 359 | 359 | //------------------------------------------------- |
| 360 | 360 | |
| 361 | void msm6255_device::update_graphics(bitmap_t *bitmap, const rectangle | |
| 361 | void msm6255_device::update_graphics(bitmap_t *bitmap, const rectangle &cliprect) | |
| 362 | 362 | { |
| 363 | 363 | UINT8 hn = (m_hnr & HNR_HN_MASK) + 1; |
| 364 | 364 | UINT8 nx = (m_dvr & DVR_DN_MASK) + 1; |
| r13798 | r13799 | |
| 386 | 386 | // update_text - |
| 387 | 387 | //------------------------------------------------- |
| 388 | 388 | |
| 389 | void msm6255_device::update_text(bitmap_t *bitmap, const rectangle | |
| 389 | void msm6255_device::update_text(bitmap_t *bitmap, const rectangle &cliprect) | |
| 390 | 390 | { |
| 391 | 391 | UINT8 hn = (m_hnr & HNR_HN_MASK) + 1; |
| 392 | 392 | UINT8 vp = (m_pr & PR_VP_MASK) + 1; |
| r13798 | r13799 | |
| 417 | 417 | // update_screen - update screen |
| 418 | 418 | //------------------------------------------------- |
| 419 | 419 | |
| 420 | void msm6255_device::update_screen(bitmap_t *bitmap, const rectangle | |
| 420 | void msm6255_device::update_screen(bitmap_t *bitmap, const rectangle &cliprect) | |
| 421 | 421 | { |
| 422 | 422 | if (m_mor & MOR_DISPLAY_ON) |
| 423 | 423 | { |
| r13798 | r13799 | |
| 432 | 432 | } |
| 433 | 433 | else |
| 434 | 434 | { |
| 435 | bitmap->fill(get_black_pen(machine()), | |
| 435 | bitmap->fill(get_black_pen(machine()), | |
| 436 | 436 | } |
| 437 | 437 | } |
| r13798 | r13799 | |
|---|---|---|
| 51 | 51 | WRITE8_DEVICE_HANDLER ( i8275_w ); |
| 52 | 52 | |
| 53 | 53 | /* updates the screen */ |
| 54 | void i8275_update(device_t *device, bitmap_t *bitmap, const rectangle | |
| 54 | void i8275_update(device_t *device, bitmap_t *bitmap, const rectangle &cliprect); | |
| 55 | 55 | |
| 56 | 56 | WRITE8_DEVICE_HANDLER( i8275_dack_w ); |
| 57 | 57 |
| r13798 | r13799 | |
|---|---|---|
| 68 | 68 | DECLARE_READ8_MEMBER( read ); |
| 69 | 69 | DECLARE_WRITE8_MEMBER( write ); |
| 70 | 70 | |
| 71 | void update_screen(bitmap_t *bitmap, const rectangle | |
| 71 | void update_screen(bitmap_t *bitmap, const rectangle &cliprect); | |
| 72 | 72 | |
| 73 | 73 | protected: |
| 74 | 74 | // device-level overrides |
| r13798 | r13799 | |
| 79 | 79 | private: |
| 80 | 80 | inline UINT8 read_video_data(UINT16 ma, UINT8 ra); |
| 81 | 81 | 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); | |
| 85 | 85 | |
| 86 | 86 | screen_device *m_screen; |
| 87 | 87 |
| r13798 | r13799 | |
|---|---|---|
| 136 | 136 | * |
| 137 | 137 | *************************************/ |
| 138 | 138 | |
| 139 | static void draw_sprite( UINT8 *gfx, int color, int y, int x, int expand, int or_mode, bitmap_t *bitmap, const rectangle | |
| 139 | static void draw_sprite( UINT8 *gfx, int color, int y, int x, int expand, int or_mode, bitmap_t *bitmap, const rectangle &cliprect ) | |
| 140 | 140 | { |
| 141 | 141 | int sy; |
| 142 | 142 | |
| r13798 | r13799 | |
| 162 | 162 | int tx = x + sx * (expand + 1) + ex; |
| 163 | 163 | |
| 164 | 164 | /* 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)) | |
| 169 | 169 | continue; |
| 170 | 170 | |
| 171 | 171 | /* get out if current image bit is transparent */ |
| r13798 | r13799 | |
| 190 | 190 | * |
| 191 | 191 | *************************************/ |
| 192 | 192 | |
| 193 | static int check_collision( device_t *device, int spriteno1, int spriteno2, const rectangle | |
| 193 | static int check_collision( device_t *device, int spriteno1, int spriteno2, const rectangle &cliprect ) | |
| 194 | 194 | { |
| 195 | 195 | s2636_state *s2636 = get_safe_token(device); |
| 196 | 196 | int checksum = 0; |
| r13798 | r13799 | |
| 200 | 200 | |
| 201 | 201 | /* TODO: does not check shadow sprites yet */ |
| 202 | 202 | |
| 203 | s2636->collision_bitmap->fill(0, | |
| 203 | s2636->collision_bitmap->fill(0, | |
| 204 | 204 | |
| 205 | 205 | if ((attr1[0x0a] != 0xff) && (attr2[0x0a] != 0xff)) |
| 206 | 206 | { |
| r13798 | r13799 | |
| 221 | 221 | for (x = x1; x < x1 + SPRITE_WIDTH; x++) |
| 222 | 222 | for (y = y1; y < y1 + SPRITE_HEIGHT; y++) |
| 223 | 223 | { |
| 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)) | |
| 226 | 226 | continue; |
| 227 | 227 | |
| 228 | 228 | checksum = checksum + s2636->collision_bitmap->pix16(y, x); |
| r13798 | r13799 | |
| 235 | 235 | for (x = x1; x < x1 + SPRITE_WIDTH; x++) |
| 236 | 236 | for (y = y1; y < y1 + SPRITE_HEIGHT; y++) |
| 237 | 237 | { |
| 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)) | |
| 240 | 240 | continue; |
| 241 | 241 | |
| 242 | 242 | checksum = checksum - s2636->collision_bitmap->pix16(y, x); |
| r13798 | r13799 | |
| 254 | 254 | * |
| 255 | 255 | *************************************/ |
| 256 | 256 | |
| 257 | bitmap_t *s2636_update( device_t *device, const rectangle | |
| 257 | bitmap_t *s2636_update( device_t *device, const rectangle &cliprect ) | |
| 258 | 258 | { |
| 259 | 259 | s2636_state *s2636 = get_safe_token(device); |
| 260 | 260 | UINT8 collision = 0; |
| 261 | 261 | int spriteno; |
| 262 | 262 | |
| 263 | s2636->bitmap->fill(0, | |
| 263 | s2636->bitmap->fill(0, | |
| 264 | 264 | |
| 265 | 265 | for (spriteno = 0; spriteno < 4; spriteno++) |
| 266 | 266 | { |
| r13798 | r13799 | |
|---|---|---|
| 213 | 213 | // update_screen - |
| 214 | 214 | //------------------------------------------------- |
| 215 | 215 | |
| 216 | void cdp1862_device::update_screen(bitmap_t *bitmap, const rectangle | |
| 216 | void cdp1862_device::update_screen(bitmap_t *bitmap, const rectangle &cliprect) | |
| 217 | 217 | { |
| 218 | 218 | copybitmap(bitmap, m_bitmap, 0, 0, 0, 0, cliprect); |
| 219 | m_bitmap->fill(CDP1862_BACKGROUND_COLOR_SEQUENCE[m_bgcolor] + 8, | |
| 219 | m_bitmap->fill(CDP1862_BACKGROUND_COLOR_SEQUENCE[m_bgcolor] + 8, | |
| 220 | 220 | } |
| r13798 | r13799 | |
|---|---|---|
| 53 | 53 | D0-D2 of each pixel is the pixel color |
| 54 | 54 | D3 indicates whether the S2636 drew this pixel - 0 = not drawn, 1 = drawn */ |
| 55 | 55 | |
| 56 | bitmap_t *s2636_update( device_t *device, const rectangle | |
| 56 | bitmap_t *s2636_update( device_t *device, const rectangle &cliprect ); | |
| 57 | 57 | WRITE8_DEVICE_HANDLER( s2636_work_ram_w ); |
| 58 | 58 | READ8_DEVICE_HANDLER( s2636_work_ram_r ); |
| 59 | 59 |
| r13798 | r13799 | |
|---|---|---|
| 94 | 94 | DECLARE_WRITE_LINE_MEMBER( bkg_w ); |
| 95 | 95 | DECLARE_WRITE_LINE_MEMBER( con_w ); |
| 96 | 96 | |
| 97 | void update_screen(bitmap_t *bitmap, const rectangle | |
| 97 | void update_screen(bitmap_t *bitmap, const rectangle &cliprect); | |
| 98 | 98 | |
| 99 | 99 | protected: |
| 100 | 100 | // device-level overrides |
| r13798 | r13799 | |
|---|---|---|
| 103 | 103 | if ((pc_current_width > 100) && (pc_current_height > 100)) |
| 104 | 104 | screen.set_visible_area(0, pc_current_width-1, 0, pc_current_height-1); |
| 105 | 105 | |
| 106 | bitmap->fill(0, | |
| 106 | bitmap->fill(0, | |
| 107 | 107 | } |
| 108 | 108 | |
| 109 | 109 | video_update(bitmap); |
| r13798 | r13799 | |
|---|---|---|
| 222 | 222 | // update_screen - update screen |
| 223 | 223 | //------------------------------------------------- |
| 224 | 224 | |
| 225 | void crt9021_device::update_screen(bitmap_t *bitmap, const rectangle | |
| 225 | void crt9021_device::update_screen(bitmap_t *bitmap, const rectangle &cliprect) | |
| 226 | 226 | { |
| 227 | 227 | } |
| r13798 | r13799 | |
|---|---|---|
| 88 | 88 | DECLARE_WRITE_LINE_MEMBER( retbl_w ); |
| 89 | 89 | DECLARE_WRITE_LINE_MEMBER( vsync_w ); |
| 90 | 90 | |
| 91 | void update_screen(bitmap_t *bitmap, const rectangle | |
| 91 | void update_screen(bitmap_t *bitmap, const rectangle &cliprect); | |
| 92 | 92 | |
| 93 | 93 | protected: |
| 94 | 94 | // device-level overrides |
| r13798 | r13799 | |
|---|---|---|
| 317 | 317 | #endif |
| 318 | 318 | } |
| 319 | 319 | |
| 320 | int psxgpu_device::DebugMeshDisplay( bitmap_t *bitmap, const rectangle | |
| 320 | int psxgpu_device::DebugMeshDisplay( bitmap_t *bitmap, const rectangle &cliprect ) | |
| 321 | 321 | { |
| 322 | 322 | if( m_debug.mesh ) |
| 323 | 323 | { |
| r13798 | r13799 | |
| 600 | 600 | machine().save().register_postload( save_prepost_delegate( FUNC( psxgpu_device::updatevisiblearea ), this ) ); |
| 601 | 601 | } |
| 602 | 602 | |
| 603 | void psxgpu_device::update_screen(bitmap_t *bitmap, const rectangle | |
| 603 | void psxgpu_device::update_screen(bitmap_t *bitmap, const rectangle &cliprect) | |
| 604 | 604 | { |
| 605 | 605 | UINT32 n_x; |
| 606 | 606 | UINT32 n_y; |
| r13798 | r13799 | |
| 628 | 628 | if( ( n_gpustatus & ( 1 << 0x17 ) ) != 0 ) |
| 629 | 629 | { |
| 630 | 630 | /* todo: only draw to necessary area */ |
| 631 | bitmap->fill(0, | |
| 631 | bitmap->fill(0, | |
| 632 | 632 | } |
| 633 | 633 | else |
| 634 | 634 | { |
| r13798 | r13799 | |
|---|---|---|
| 181 | 181 | psxgpu_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock); |
| 182 | 182 | virtual machine_config_constructor device_mconfig_additions() const; |
| 183 | 183 | |
| 184 | void update_screen(bitmap_t *bitmap, const rectangle | |
| 184 | void update_screen(bitmap_t *bitmap, const rectangle &cliprect); | |
| 185 | 185 | WRITE32_MEMBER( write ); |
| 186 | 186 | READ32_MEMBER( read ); |
| 187 | 187 | void dma_read( UINT32 n_address, INT32 n_size ); |
| r13798 | r13799 | |
| 221 | 221 | void DebugMesh( int n_coordx, int n_coordy ); |
| 222 | 222 | void DebugMeshEnd( void ); |
| 223 | 223 | void DebugCheckKeys( void ); |
| 224 | int DebugMeshDisplay( bitmap_t *bitmap, const rectangle | |
| 224 | int DebugMeshDisplay( bitmap_t *bitmap, const rectangle &cliprect ); | |
| 225 | 225 | int DebugTextureDisplay( bitmap_t *bitmap ); |
| 226 | 226 | #endif |
| 227 | 227 |
| r13798 | r13799 | |
|---|---|---|
| 468 | 468 | triangle given 3 vertexes |
| 469 | 469 | -------------------------------------------------*/ |
| 470 | 470 | |
| 471 | UINT32 poly_render_triangle(poly_manager *poly, void *dest, const rectangle | |
| 471 | UINT32 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) | |
| 472 | 472 | { |
| 473 | 473 | float dxdy_v1v2, dxdy_v1v3, dxdy_v2v3; |
| 474 | 474 | const poly_vertex *tv; |
| r13798 | r13799 | |
| 507 | 507 | /* clip coordinates */ |
| 508 | 508 | v1yclip = v1y; |
| 509 | 509 | 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); | |
| 515 | 512 | if (v3yclip - v1yclip <= 0) |
| 516 | 513 | return 0; |
| 517 | 514 | |
| r13798 | r13799 | |
| 585 | 582 | istopx++; |
| 586 | 583 | |
| 587 | 584 | /* 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; | |
| 595 | 589 | |
| 596 | 590 | /* set the extent and update the total pixel count */ |
| 597 | 591 | if (istartx >= istopx) |
| r13798 | r13799 | |
| 657 | 651 | triangles in a fan |
| 658 | 652 | -------------------------------------------------*/ |
| 659 | 653 | |
| 660 | UINT32 poly_render_triangle_fan(poly_manager *poly, void *dest, const rectangle | |
| 654 | UINT32 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) | |
| 661 | 655 | { |
| 662 | 656 | UINT32 pixels = 0; |
| 663 | 657 | int vertnum; |
| r13798 | r13799 | |
| 674 | 668 | render of an object, given specific extents |
| 675 | 669 | -------------------------------------------------*/ |
| 676 | 670 | |
| 677 | UINT32 poly_render_triangle_custom(poly_manager *poly, void *dest, const rectangle | |
| 671 | UINT32 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) | |
| 678 | 672 | { |
| 679 | 673 | INT32 curscan, scaninc; |
| 680 | 674 | polygon_info *polygon; |
| r13798 | r13799 | |
| 683 | 677 | UINT32 startunit; |
| 684 | 678 | |
| 685 | 679 | /* 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); | |
| 696 | 682 | if (v3yclip - v1yclip <= 0) |
| 697 | 683 | return 0; |
| 698 | 684 | |
| r13798 | r13799 | |
| 741 | 727 | } |
| 742 | 728 | |
| 743 | 729 | /* 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; | |
| 751 | 734 | |
| 752 | 735 | /* set the extent and update the total pixel count */ |
| 753 | 736 | unit->extent[extnum].startx = istartx; |
| r13798 | r13799 | |
| 781 | 764 | given 4 vertexes |
| 782 | 765 | -------------------------------------------------*/ |
| 783 | 766 | |
| 784 | UINT32 poly_render_quad(poly_manager *poly, void *dest, const rectangle | |
| 767 | UINT32 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) | |
| 785 | 768 | { |
| 786 | 769 | poly_edge fedgelist[3], bedgelist[3]; |
| 787 | 770 | const poly_edge *ledge, *redge; |
| r13798 | r13799 | |
| 824 | 807 | /* clip coordinates */ |
| 825 | 808 | minyclip = miny; |
| 826 | 809 | 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); | |
| 832 | 812 | if (maxyclip - minyclip <= 0) |
| 833 | 813 | return 0; |
| 834 | 814 | |
| r13798 | r13799 | |
| 967 | 947 | istopx++; |
| 968 | 948 | |
| 969 | 949 | /* apply left/right clipping */ |
| 970 | if (cliprect | |
| 950 | if (istartx < cliprect.min_x | |
| 971 | 951 | { |
| 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; | |
| 980 | 955 | } |
| 956 | if (istopx > cliprect.max_x) | |
| 957 | istopx = cliprect.max_x + 1; | |
| 981 | 958 | |
| 982 | 959 | /* set the extent and update the total pixel count */ |
| 983 | 960 | if (istartx >= istopx) |
| r13798 | r13799 | |
| 1007 | 984 | quads in a fan |
| 1008 | 985 | -------------------------------------------------*/ |
| 1009 | 986 | |
| 1010 | UINT32 poly_render_quad_fan(poly_manager *poly, void *dest, const rectangle | |
| 987 | UINT32 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) | |
| 1011 | 988 | { |
| 1012 | 989 | UINT32 pixels = 0; |
| 1013 | 990 | int vertnum; |
| r13798 | r13799 | |
| 1029 | 1006 | to 32 vertices |
| 1030 | 1007 | -------------------------------------------------*/ |
| 1031 | 1008 | |
| 1032 | UINT32 poly_render_polygon(poly_manager *poly, void *dest, const rectangle | |
| 1009 | UINT32 poly_render_polygon(poly_manager *poly, void *dest, const rectangle &cliprect, poly_draw_scanline_func callback, int paramcount, int numverts, const poly_vertex *v) | |
| 1033 | 1010 | { |
| 1034 | 1011 | poly_edge fedgelist[MAX_POLYGON_VERTS - 1], bedgelist[MAX_POLYGON_VERTS - 1]; |
| 1035 | 1012 | const poly_edge *ledge, *redge; |
| r13798 | r13799 | |
| 1062 | 1039 | /* clip coordinates */ |
| 1063 | 1040 | minyclip = miny; |
| 1064 | 1041 | 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); | |
| 1070 | 1044 | if (maxyclip - minyclip <= 0) |
| 1071 | 1045 | return 0; |
| 1072 | 1046 | |
| r13798 | r13799 | |
| 1205 | 1179 | istopx++; |
| 1206 | 1180 | |
| 1207 | 1181 | /* apply left/right clipping */ |
| 1208 | if (cliprect | |
| 1182 | if (istartx < cliprect.min_x | |
| 1209 | 1183 | { |
| 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; | |
| 1218 | 1187 | } |
| 1188 | if (istopx > cliprect.max_x) | |
| 1189 | istopx = cliprect.max_x + 1; | |
| 1219 | 1190 | |
| 1220 | 1191 | /* set the extent and update the total pixel count */ |
| 1221 | 1192 | if (istartx >= istopx) |
| r13798 | r13799 | |
|---|---|---|
| 120 | 120 | /* ----- core triangle rendering ----- */ |
| 121 | 121 | |
| 122 | 122 | /* render a single triangle given 3 vertexes */ |
| 123 | UINT32 poly_render_triangle(poly_manager *poly, void *dest, const rectangle | |
| 123 | UINT32 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); | |
| 124 | 124 | |
| 125 | 125 | /* render a set of triangles in a fan */ |
| 126 | UINT32 poly_render_triangle_fan(poly_manager *poly, void *dest, const rectangle | |
| 126 | UINT32 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); | |
| 127 | 127 | |
| 128 | 128 | /* perform a custom render of an object, given specific extents */ |
| 129 | UINT32 poly_render_triangle_custom(poly_manager *poly, void *dest, const rectangle | |
| 129 | UINT32 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); | |
| 130 | 130 | |
| 131 | 131 | |
| 132 | 132 | |
| 133 | 133 | /* ----- core quad rendering ----- */ |
| 134 | 134 | |
| 135 | 135 | /* render a single quad given 4 vertexes */ |
| 136 | UINT32 poly_render_quad(poly_manager *poly, void *dest, const rectangle | |
| 136 | UINT32 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); | |
| 137 | 137 | |
| 138 | 138 | /* render a set of quads in a fan */ |
| 139 | UINT32 poly_render_quad_fan(poly_manager *poly, void *dest, const rectangle | |
| 139 | UINT32 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); | |
| 140 | 140 | |
| 141 | 141 | |
| 142 | 142 | |
| 143 | 143 | /* ----- core polygon rendering ----- */ |
| 144 | 144 | |
| 145 | 145 | /* render a single polygon up to 32 vertices */ |
| 146 | UINT32 poly_render_polygon(poly_manager *poly, void *dest, const rectangle | |
| 146 | UINT32 poly_render_polygon(poly_manager *poly, void *dest, const rectangle &cliprect, poly_draw_scanline_func callback, int paramcount, int numverts, const poly_vertex *v); | |
| 147 | 147 | |
| 148 | 148 | |
| 149 | 149 |
| r13798 | r13799 | |
|---|---|---|
| 406 | 406 | // draw_scanline - draw one graphics scanline |
| 407 | 407 | //------------------------------------------------- |
| 408 | 408 | |
| 409 | void hd61830_device::draw_scanline(bitmap_t *bitmap, const rectangle | |
| 409 | void hd61830_device::draw_scanline(bitmap_t *bitmap, const rectangle &cliprect, int y, UINT16 ra) | |
| 410 | 410 | { |
| 411 | 411 | for (int sx = 0; sx < m_hn; sx++) |
| 412 | 412 | { |
| r13798 | r13799 | |
| 424 | 424 | // update_graphics - draw graphics mode screen |
| 425 | 425 | //------------------------------------------------- |
| 426 | 426 | |
| 427 | void hd61830_device::update_graphics(bitmap_t *bitmap, const rectangle | |
| 427 | void hd61830_device::update_graphics(bitmap_t *bitmap, const rectangle &cliprect) | |
| 428 | 428 | { |
| 429 | 429 | for (int y = 0; y < m_nx; y++) |
| 430 | 430 | { |
| r13798 | r13799 | |
| 444 | 444 | // draw_char - draw a char |
| 445 | 445 | //------------------------------------------------- |
| 446 | 446 | |
| 447 | void hd61830_device::draw_char(bitmap_t *bitmap, const rectangle | |
| 447 | void hd61830_device::draw_char(bitmap_t *bitmap, const rectangle &cliprect, UINT16 ma, int x, int y, UINT8 md) | |
| 448 | 448 | { |
| 449 | 449 | for (int cl = 0; cl < m_vp; cl++) |
| 450 | 450 | { |
| r13798 | r13799 | |
| 515 | 515 | // update_text - draw text mode screen |
| 516 | 516 | //------------------------------------------------- |
| 517 | 517 | |
| 518 | void hd61830_device::update_text(bitmap_t *bitmap, const rectangle | |
| 518 | void hd61830_device::update_text(bitmap_t *bitmap, const rectangle &cliprect) | |
| 519 | 519 | { |
| 520 | 520 | for (int y = 0; y < (m_nx / m_vp); y++) |
| 521 | 521 | { |
| r13798 | r13799 | |
| 534 | 534 | // update_screen - update screen |
| 535 | 535 | //------------------------------------------------- |
| 536 | 536 | |
| 537 | void hd61830_device::update_screen(bitmap_t *bitmap, const rectangle | |
| 537 | void hd61830_device::update_screen(bitmap_t *bitmap, const rectangle &cliprect) | |
| 538 | 538 | { |
| 539 | 539 | if (m_mcr & MODE_DISPLAY_ON) |
| 540 | 540 | { |
| r13798 | r13799 | |
| 549 | 549 | } |
| 550 | 550 | else |
| 551 | 551 | { |
| 552 | bitmap->fill(0, | |
| 552 | bitmap->fill(0, | |
| 553 | 553 | } |
| 554 | 554 | |
| 555 | 555 | m_blink++; |
| r13798 | r13799 | |
|---|---|---|
| 68 | 68 | DECLARE_READ8_MEMBER( data_r ); |
| 69 | 69 | DECLARE_WRITE8_MEMBER( data_w ); |
| 70 | 70 | |
| 71 | void update_screen(bitmap_t *bitmap, const rectangle | |
| 71 | void update_screen(bitmap_t *bitmap, const rectangle &cliprect); | |
| 72 | 72 | |
| 73 | 73 | protected: |
| 74 | 74 | // device-level overrides |
| r13798 | r13799 | |
| 87 | 87 | private: |
| 88 | 88 | void set_busy_flag(); |
| 89 | 89 | |
| 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); | |
| 94 | 94 | |
| 95 | 95 | devcb_resolved_read8 m_in_rd_func; |
| 96 | 96 |
| r13798 | r13799 | |
|---|---|---|
| 59 | 59 | |
| 60 | 60 | // utility function to render a clipped scanline vertically or horizontally |
| 61 | 61 | inline void k053250_t::pdraw_scanline32(bitmap_t *bitmap, const pen_t *palette, UINT8 *source, |
| 62 | const rectangle | |
| 62 | const rectangle &cliprect, int linepos, int scroll, int zoom, | |
| 63 | 63 | UINT32 clipmask, UINT32 wrapmask, UINT32 orientation, bitmap_t *priority, UINT8 pri) |
| 64 | 64 | { |
| 65 | 65 | // a sixteen-bit fixed point resolution should be adequate to our application |
| r13798 | r13799 | |
| 81 | 81 | if (!(orientation & ORIENTATION_SWAP_XY)) |
| 82 | 82 | { |
| 83 | 83 | 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; | |
| 86 | 86 | } |
| 87 | 87 | else |
| 88 | 88 | { |
| 89 | 89 | 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; | |
| 92 | 92 | } |
| 93 | 93 | |
| 94 | 94 | if (clipmask) |
| r13798 | r13799 | |
| 221 | 221 | #undef FIXPOINT_PRECISION_HALF |
| 222 | 222 | } |
| 223 | 223 | |
| 224 | void k053250_t::draw( bitmap_t *bitmap, const rectangle | |
| 224 | void k053250_t::draw( bitmap_t *bitmap, const rectangle &cliprect, int colorbase, int flags, int priority ) | |
| 225 | 225 | { |
| 226 | 226 | UINT8 *pix_ptr; |
| 227 | 227 | const pen_t *pal_base, *pal_ptr; |
| r13798 | r13799 | |
| 236 | 236 | UINT8 ctrl = regs[4]; // register four is the main control register |
| 237 | 237 | |
| 238 | 238 | // 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; | |
| 243 | 243 | |
| 244 | 244 | int orientation = 0; // orientation defaults to no swapping and no flipping |
| 245 | 245 | int dst_height = 512; // virtual bitmap height defaults to five hundred and twelve pixels |
| r13798 | r13799 | |
|---|---|---|
| 206 | 206 | saa5050->frame_count = 0; |
| 207 | 207 | } |
| 208 | 208 | |
| 209 | void saa5050_update( device_t *device, bitmap_t *bitmap, const rectangle | |
| 209 | void saa5050_update( device_t *device, bitmap_t *bitmap, const rectangle &cliprect ) | |
| 210 | 210 | { |
| 211 | 211 | saa5050_state *saa5050 = get_safe_token(device); |
| 212 | 212 | int code, colour; |
| r13798 | r13799 | |
|---|---|---|
| 26 | 26 | DECLARE_WRITE16_MEMBER(ram_w); |
| 27 | 27 | DECLARE_READ16_MEMBER(rom_r); |
| 28 | 28 | |
| 29 | void draw( bitmap_t *bitmap, const rectangle | |
| 29 | void draw( bitmap_t *bitmap, const rectangle &cliprect, int colorbase, int flags, int priority ); | |
| 30 | 30 | |
| 31 | 31 | protected: |
| 32 | 32 | void device_start(); |
| r13798 | r13799 | |
| 47 | 47 | void unpack_nibbles(); |
| 48 | 48 | void dma(int limiter); |
| 49 | 49 | static void pdraw_scanline32(bitmap_t *bitmap, const pen_t *palette, UINT8 *source, |
| 50 | const rectangle | |
| 50 | const rectangle &cliprect, int linepos, int scroll, int zoom, | |
| 51 | 51 | UINT32 clipmask, UINT32 wrapmask, UINT32 orientation, bitmap_t *priority, UINT8 pri); |
| 52 | 52 | }; |
| 53 | 53 |
| r13798 | r13799 | |
|---|---|---|
| 582 | 582 | // draw_text_scanline - |
| 583 | 583 | //------------------------------------------------- |
| 584 | 584 | |
| 585 | void sed1330_device::draw_text_scanline(bitmap_t *bitmap, const rectangle | |
| 585 | void sed1330_device::draw_text_scanline(bitmap_t *bitmap, const rectangle &cliprect, int y, UINT16 va) | |
| 586 | 586 | { |
| 587 | 587 | int sx, x; |
| 588 | 588 | |
| r13798 | r13799 | |
| 623 | 623 | // draw_graphics_scanline - |
| 624 | 624 | //------------------------------------------------- |
| 625 | 625 | |
| 626 | void sed1330_device::draw_graphics_scanline(bitmap_t *bitmap, const rectangle | |
| 626 | void sed1330_device::draw_graphics_scanline(bitmap_t *bitmap, const rectangle &cliprect, int y, UINT16 va) | |
| 627 | 627 | { |
| 628 | 628 | int sx, x; |
| 629 | 629 | |
| r13798 | r13799 | |
| 644 | 644 | // update_graphics - |
| 645 | 645 | //------------------------------------------------- |
| 646 | 646 | |
| 647 | void sed1330_device::update_graphics(bitmap_t *bitmap, const rectangle | |
| 647 | void sed1330_device::update_graphics(bitmap_t *bitmap, const rectangle &cliprect) | |
| 648 | 648 | { |
| 649 | 649 | } |
| 650 | 650 | |
| r13798 | r13799 | |
| 653 | 653 | // update_text - |
| 654 | 654 | //------------------------------------------------- |
| 655 | 655 | |
| 656 | void sed1330_device::update_text(bitmap_t *bitmap, const rectangle | |
| 656 | void sed1330_device::update_text(bitmap_t *bitmap, const rectangle &cliprect) | |
| 657 | 657 | { |
| 658 | 658 | int y; |
| 659 | 659 | |
| r13798 | r13799 | |
| 686 | 686 | // update_screen - |
| 687 | 687 | //------------------------------------------------- |
| 688 | 688 | |
| 689 | void sed1330_device::update_screen(bitmap_t *bitmap, const rectangle | |
| 689 | void sed1330_device::update_screen(bitmap_t *bitmap, const rectangle &cliprect) | |
| 690 | 690 | { |
| 691 | 691 | if (m_d) |
| 692 | 692 | { |
| r13798 | r13799 | |
|---|---|---|
| 41 | 41 | DEVICE I/O FUNCTIONS |
| 42 | 42 | ***************************************************************************/ |
| 43 | 43 | |
| 44 | void saa5050_update(device_t *device, bitmap_t *bitmap, const rectangle | |
| 44 | void saa5050_update(device_t *device, bitmap_t *bitmap, const rectangle &cliprect); | |
| 45 | 45 | void saa5050_frame_advance(device_t *device); |
| 46 | 46 | |
| 47 | 47 | GFXDECODE_EXTERN( saa5050 ); |
| r13798 | r13799 | |
|---|---|---|
| 1580 | 1580 | } |
| 1581 | 1581 | |
| 1582 | 1582 | |
| 1583 | void sega315_5124_device::update_video( bitmap_t *bitmap, const rectangle | |
| 1583 | void sega315_5124_device::update_video( bitmap_t *bitmap, const rectangle &cliprect ) | |
| 1584 | 1584 | { |
| 1585 | 1585 | copybitmap(bitmap, m_tmpbitmap, 0, 0, 0, 0, cliprect); |
| 1586 | 1586 | } |
| r13798 | r13799 | |
|---|---|---|
| 251 | 251 | // update_screen - |
| 252 | 252 | //------------------------------------------------- |
| 253 | 253 | |
| 254 | void cdp1861_device::update_screen(bitmap_t *bitmap, const rectangle | |
| 254 | void cdp1861_device::update_screen(bitmap_t *bitmap, const rectangle &cliprect) | |
| 255 | 255 | { |
| 256 | 256 | if (m_disp) |
| 257 | 257 | { |
| r13798 | r13799 | |
| 259 | 259 | } |
| 260 | 260 | else |
| 261 | 261 | { |
| 262 | bitmap->fill(get_black_pen(machine()), | |
| 262 | bitmap->fill(get_black_pen(machine()), | |
| 263 | 263 | } |
| 264 | 264 | } |
| r13798 | r13799 | |
|---|---|---|
| 49 | 49 | DECLARE_READ8_MEMBER( data_r ); |
| 50 | 50 | DECLARE_WRITE8_MEMBER( data_w ); |
| 51 | 51 | |
| 52 | void update_screen(bitmap_t *bitmap, const rectangle | |
| 52 | void update_screen(bitmap_t *bitmap, const rectangle &cliprect); | |
| 53 | 53 | |
| 54 | 54 | protected: |
| 55 | 55 | // device-level overrides |
| r13798 | r13799 | |
| 64 | 64 | inline void writebyte(offs_t address, UINT8 m_data); |
| 65 | 65 | inline void increment_csr(); |
| 66 | 66 | |
| 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); | |
| 71 | 71 | |
| 72 | 72 | private: |
| 73 | 73 | int m_bf; // busy flag |
| r13798 | r13799 | |
|---|---|---|
| 82 | 82 | bitmap_t *get_y1_bitmap() { return m_y1_bitmap; }; |
| 83 | 83 | |
| 84 | 84 | /* update the screen */ |
| 85 | void update_video( bitmap_t *bitmap, const rectangle | |
| 85 | void update_video( bitmap_t *bitmap, const rectangle &cliprect ); | |
| 86 | 86 | |
| 87 | 87 | virtual void set_sega315_5124_compatibility_mode( bool sega315_5124_compatibility_mode ) { }; |
| 88 | 88 |
| r13798 | r13799 | |
|---|---|---|
| 113 | 113 | DECLARE_WRITE_LINE_MEMBER( disp_on_w ); |
| 114 | 114 | DECLARE_WRITE_LINE_MEMBER( disp_off_w ); |
| 115 | 115 | |
| 116 | void update_screen(bitmap_t *bitmap, const rectangle | |
| 116 | void update_screen(bitmap_t *bitmap, const rectangle &cliprect); | |
| 117 | 117 | |
| 118 | 118 | protected: |
| 119 | 119 | // device-level overrides |
| r13798 | r13799 | |
|---|---|---|
| 153 | 153 | static void mappings_update(tilemap_t *tmap); |
| 154 | 154 | |
| 155 | 155 | /* tile rendering */ |
| 156 | static void pixmap_update(tilemap_t *tmap | |
| 156 | static void pixmap_update(tilemap_t *tmap | |
| 157 | 157 | static void tile_update(tilemap_t *tmap, tilemap_logical_index logindex, UINT32 cached_col, UINT32 cached_row); |
| 158 | 158 | static 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); |
| 159 | 159 | static UINT8 tile_apply_bitmask(tilemap_t *tmap, const UINT8 *maskdata, UINT32 x0, UINT32 y0, UINT8 category, UINT8 flags); |
| 160 | 160 | |
| 161 | 161 | /* drawing helpers */ |
| 162 | static void configure_blit_parameters(blit_parameters *blit, tilemap_t *tmap, bitmap_t *dest, const rectangle | |
| 162 | static void configure_blit_parameters(blit_parameters *blit, tilemap_t *tmap, bitmap_t *dest, const rectangle &cliprect, UINT32 flags, UINT8 priority, UINT8 priority_mask); | |
| 163 | 163 | static void tilemap_draw_instance(tilemap_t *tmap, const blit_parameters *blit, int xpos, int ypos); |
| 164 | 164 | static void tilemap_draw_roz_core(tilemap_t *tmap, const blit_parameters *blit, |
| 165 | 165 | UINT32 startx, UINT32 starty, int incxx, int incxy, int incyx, int incyy, int wraparound); |
| r13798 | r13799 | |
| 779 | 779 | bitmap_t *tilemap_get_pixmap(tilemap_t *tmap) |
| 780 | 780 | { |
| 781 | 781 | /* ensure all the tiles are up-to-date and then return the pixmap */ |
| 782 | pixmap_update(tmap | |
| 782 | pixmap_update(tmap | |
| 783 | 783 | return tmap->pixmap; |
| 784 | 784 | } |
| 785 | 785 | |
| r13798 | r13799 | |
| 792 | 792 | bitmap_t *tilemap_get_flagsmap(tilemap_t *tmap) |
| 793 | 793 | { |
| 794 | 794 | /* ensure all the tiles are up-to-date and then return the flagsmap */ |
| 795 | pixmap_update(tmap | |
| 795 | pixmap_update(tmap | |
| 796 | 796 | return tmap->flagsmap; |
| 797 | 797 | } |
| 798 | 798 | |
| r13798 | r13799 | |
| 805 | 805 | UINT8 *tilemap_get_tile_flags(tilemap_t *tmap) |
| 806 | 806 | { |
| 807 | 807 | /* ensure all the tiles are up-to-date and then return the per-tile flags */ |
| 808 | pixmap_update(tmap | |
| 808 | pixmap_update(tmap | |
| 809 | 809 | return tmap->tileflags; |
| 810 | 810 | } |
| 811 | 811 | |
| r13798 | r13799 | |
| 821 | 821 | priority/priority_mask to the priority bitmap |
| 822 | 822 | -------------------------------------------------*/ |
| 823 | 823 | |
| 824 | void tilemap_draw_primask(bitmap_t *dest, const rectangle | |
| 824 | void tilemap_draw_primask(bitmap_t *dest, const rectangle &cliprect, tilemap_t *tmap, UINT32 flags, UINT8 priority, UINT8 priority_mask) | |
| 825 | 825 | { |
| 826 | 826 | UINT32 width, height; |
| 827 | 827 | blit_parameters blit; |
| r13798 | r13799 | |
| 945 | 945 | priority_mask to the priority bitmap |
| 946 | 946 | -------------------------------------------------*/ |
| 947 | 947 | |
| 948 | void tilemap_draw_roz_primask(bitmap_t *dest, const rectangle | |
| 948 | void tilemap_draw_roz_primask(bitmap_t *dest, const rectangle &cliprect, tilemap_t *tmap, | |
| 949 | 949 | UINT32 startx, UINT32 starty, int incxx, int incxy, int incyx, int incyy, |
| 950 | 950 | int wraparound, UINT32 flags, UINT8 priority, UINT8 priority_mask) |
| 951 | 951 | { |
| r13798 | r13799 | |
| 1032 | 1032 | int xpos,ypos; |
| 1033 | 1033 | |
| 1034 | 1034 | /* set up for the blit, using hard-coded parameters (no priority, etc) */ |
| 1035 | configure_blit_parameters(&blit, tmap, dest, | |
| 1035 | configure_blit_parameters(&blit, tmap, dest, dest->cliprect(), TILEMAP_DRAW_OPAQUE | TILEMAP_DRAW_ALL_CATEGORIES, 0, 0xff); | |
| 1036 | 1036 | |
| 1037 | 1037 | /* compute the effective scroll positions */ |
| 1038 | 1038 | scrollx = tmap->width - scrollx % tmap->width; |
| r13798 | r13799 | |
| 1262 | 1262 | ***************************************************************************/ |
| 1263 | 1263 | |
| 1264 | 1264 | /*------------------------------------------------- |
| 1265 | pixmap_update - update the portion of the | |
| 1266 | pixmap described by the cliprect | |
| 1265 | pixmap_update - update the entire pixmap | |
| 1267 | 1266 | -------------------------------------------------*/ |
| 1268 | 1267 | |
| 1269 | static void pixmap_update(tilemap_t *tmap | |
| 1268 | static void pixmap_update(tilemap_t *tmap | |
| 1270 | 1269 | { |
| 1271 | 1270 | int mincol, maxcol, minrow, maxrow; |
| 1272 | 1271 | int row, col; |
| r13798 | r13799 | |
| 1282 | 1281 | g_profiler.start(PROFILER_TILEMAP_DRAW); |
| 1283 | 1282 | |
| 1284 | 1283 | /* 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; | |
| 1298 | 1287 | |
| 1299 | 1288 | /* if the whole map is dirty, mark it as such */ |
| 1300 | 1289 | if (tmap->all_tiles_dirty) |
| r13798 | r13799 | |
| 1527 | 1516 | and indexed drawing code |
| 1528 | 1517 | -------------------------------------------------*/ |
| 1529 | 1518 | |
| 1530 | static void configure_blit_parameters(blit_parameters *blit, tilemap_t *tmap, bitmap_t *dest, const rectangle | |
| 1519 | static void configure_blit_parameters(blit_parameters *blit, tilemap_t *tmap, bitmap_t *dest, const rectangle &cliprect, UINT32 flags, UINT8 priority, UINT8 priority_mask) | |
| 1531 | 1520 | { |
| 1532 | 1521 | /* start with nothing */ |
| 1533 | 1522 | memset(blit, 0, sizeof(*blit)); |
| 1534 | 1523 | |
| 1535 | 1524 | /* set the target bitmap */ |
| 1536 | 1525 | blit->bitmap = dest; |
| 1526 | blit->cliprect = cliprect; | |
| 1537 | 1527 | |
| 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 | ||
| 1546 | 1528 | /* set the priority code and alpha */ |
| 1547 | 1529 | blit->tilemap_priority_code = priority | (priority_mask << 8) | (tmap->palette_offset << 16); |
| 1548 | 1530 | blit->alpha = (flags & TILEMAP_DRAW_ALPHA_FLAG) ? (flags >> 24) : 0xff; |
| r13798 | r13799 | |
|---|---|---|
| 518 | 518 | /* ----- tilemap rendering ----- */ |
| 519 | 519 | |
| 520 | 520 | /* draw a tilemap to the destination with clipping; pixels apply priority/priority_mask to the priority bitmap */ |
| 521 | void tilemap_draw_primask(bitmap_t *dest, const rectangle | |
| 521 | void tilemap_draw_primask(bitmap_t *dest, const rectangle &cliprect, tilemap_t *tmap, UINT32 flags, UINT8 priority, UINT8 priority_mask); | |
| 522 | 522 | |
| 523 | 523 | /* draw a tilemap to the destination with clipping and arbitrary rotate/zoom; */ |
| 524 | 524 | /* pixels apply priority/priority_mask to the priority bitmap */ |
| 525 | void tilemap_draw_roz_primask(bitmap_t *dest, const rectangle | |
| 525 | void tilemap_draw_roz_primask(bitmap_t *dest, const rectangle &cliprect, tilemap_t *tmap, | |
| 526 | 526 | UINT32 startx, UINT32 starty, int incxx, int incxy, int incyx, int incyy, |
| 527 | 527 | int wraparound, UINT32 flags, UINT8 priority, UINT8 priority_mask); |
| 528 | 528 | |
| r13798 | r13799 | |
| 595 | 595 | tilemap_draw_primask |
| 596 | 596 | -------------------------------------------------*/ |
| 597 | 597 | |
| 598 | INLINE void tilemap_draw(bitmap_t *dest, const rectangle | |
| 598 | INLINE void tilemap_draw(bitmap_t *dest, const rectangle &cliprect, tilemap_t *tmap, UINT32 flags, UINT8 priority) | |
| 599 | 599 | { |
| 600 | 600 | tilemap_draw_primask(dest, cliprect, tmap, flags, priority, 0xff); |
| 601 | 601 | } |
| r13798 | r13799 | |
| 606 | 606 | tilemap_draw_roz_primask |
| 607 | 607 | -------------------------------------------------*/ |
| 608 | 608 | |
| 609 | INLINE void tilemap_draw_roz(bitmap_t *dest, const rectangle | |
| 609 | INLINE void tilemap_draw_roz(bitmap_t *dest, const rectangle &cliprect, tilemap_t *tmap, | |
| 610 | 610 | UINT32 startx, UINT32 starty, int incxx, int incxy, int incyx, int incyy, |
| 611 | 611 | int wraparound, UINT32 flags, UINT8 priority) |
| 612 | 612 | { |
| r13798 | r13799 | |
|---|---|---|
| 907 | 907 | // update_screen - update screen |
| 908 | 908 | //------------------------------------------------- |
| 909 | 909 | |
| 910 | void cdp1869_device::update_screen(bitmap_t *bitmap, const rectangle | |
| 910 | void cdp1869_device::update_screen(bitmap_t *bitmap, const rectangle &cliprect) | |
| 911 | 911 | { |
| 912 | 912 | rectangle screen_rect, outer; |
| 913 | 913 | |
| r13798 | r13799 | |
| 934 | 934 | screen_rect.max_y = CDP1869_SCANLINE_DISPLAY_END_PAL - 1; |
| 935 | 935 | } |
| 936 | 936 | |
| 937 | outer &= | |
| 937 | outer &= | |
| 938 | 938 | bitmap->fill(m_bkg, outer); |
| 939 | 939 | |
| 940 | 940 | if (!m_dispoff) |
| r13798 | r13799 | |
|---|---|---|
| 231 | 231 | DECLARE_READ_LINE_MEMBER( predisplay_r ); |
| 232 | 232 | DECLARE_READ_LINE_MEMBER( pal_ntsc_r ); |
| 233 | 233 | |
| 234 | void update_screen(bitmap_t *bitmap, const rectangle | |
| 234 | void update_screen(bitmap_t *bitmap, const rectangle &cliprect); | |
| 235 | 235 | |
| 236 | 236 | protected: |
| 237 | 237 | // device-level overrides |
| r13798 | r13799 | |
|---|---|---|
| 509 | 509 | main screen bitmap |
| 510 | 510 | -------------------------------------------------*/ |
| 511 | 511 | |
| 512 | UINT32 mos6560_video_update( device_t *device, bitmap_t *bitmap, const rectangle | |
| 512 | UINT32 mos6560_video_update( device_t *device, bitmap_t *bitmap, const rectangle &cliprect ) | |
| 513 | 513 | { |
| 514 | 514 | mos6560_state *mos6560 = get_safe_token(device); |
| 515 | 515 |
| r13798 | r13799 | |
|---|---|---|
| 107 | 107 | READ8_DEVICE_HANDLER( mos6560_port_r ); |
| 108 | 108 | |
| 109 | 109 | void mos6560_raster_interrupt_gen( device_t *device ); |
| 110 | UINT32 mos6560_video_update( device_t *device, bitmap_t *bitmap, const rectangle | |
| 110 | UINT32 mos6560_video_update( device_t *device, bitmap_t *bitmap, const rectangle &cliprect ); | |
| 111 | 111 | |
| 112 | 112 | |
| 113 | 113 | #endif /* __MOS6560_H__ */ |
| r13798 | r13799 | |
|---|---|---|
| 470 | 470 | // update_screen - |
| 471 | 471 | //------------------------------------------------- |
| 472 | 472 | |
| 473 | void cdp1864_device::update_screen(bitmap_t *bitmap, const rectangle | |
| 473 | void cdp1864_device::update_screen(bitmap_t *bitmap, const rectangle &cliprect) | |
| 474 | 474 | { |
| 475 | 475 | if (m_disp) |
| 476 | 476 | { |
| 477 | 477 | copybitmap(bitmap, m_bitmap, 0, 0, 0, 0, cliprect); |
| 478 | m_bitmap->fill(CDP1864_BACKGROUND_COLOR_SEQUENCE[m_bgcolor] + 8, | |
| 478 | m_bitmap->fill(CDP1864_BACKGROUND_COLOR_SEQUENCE[m_bgcolor] + 8, | |
| 479 | 479 | } |
| 480 | 480 | else |
| 481 | 481 | { |
| 482 | bitmap->fill(get_black_pen(machine()), | |
| 482 | bitmap->fill(get_black_pen(machine()), | |
| 483 | 483 | } |
| 484 | 484 | } |
| r13798 | r13799 | |
|---|---|---|
| 156 | 156 | DECLARE_WRITE_LINE_MEMBER( aoe_w ); |
| 157 | 157 | DECLARE_WRITE_LINE_MEMBER( evs_w ); |
| 158 | 158 | |
| 159 | void update_screen(bitmap_t *bitmap, const rectangle | |
| 159 | void update_screen(bitmap_t *bitmap, const rectangle &cliprect); | |
| 160 | 160 | |
| 161 | 161 | protected: |
| 162 | 162 | // device-level overrides |
| r13798 | r13799 | |
|---|---|---|
| 1196 | 1196 | /* handle the overlay if present */ |
| 1197 | 1197 | if (overbitmap != NULL && ldcore->config.overupdate != NULL) |
| 1198 | 1198 | { |
| 1199 | rectangle clip = | |
| 1199 | rectangle clip = | |
| 1200 | 1200 | |
| 1201 | 1201 | /* scale the cliprect to the overlay size and then call the update callback */ |
| 1202 | 1202 | clip.min_x = ldcore->config.overclip_min_x; |
| 1203 | 1203 | 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) | |
| 1206 | 1206 | 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); | |
| 1209 | 1209 | } |
| 1210 | 1210 | |
| 1211 | 1211 | /* if this is the last update, do the rendering */ |
| 1212 | if (cliprect | |
| 1212 | if (cliprect. | |
| 1213 | 1213 | { |
| 1214 | 1214 | /* update the texture with the overlay contents */ |
| 1215 | 1215 | if (overbitmap != NULL) |
| r13798 | r13799 | |
|---|---|---|
| 806 | 806 | } |
| 807 | 807 | } |
| 808 | 808 | |
| 809 | static UINT32 s3c24xx_video_update( device_t *device, screen_device &screen, bitmap_t *bitmap, const rectangle | |
| 809 | static UINT32 s3c24xx_video_update( device_t *device, screen_device &screen, bitmap_t *bitmap, const rectangle &cliprect) | |
| 810 | 810 | { |
| 811 | 811 | s3c24xx_t *s3c24xx = get_token( device); |
| 812 | 812 | if (s3c24xx->lcd.regs.lcdcon1 & (1 << 0)) |
| r13798 | r13799 | |
|---|---|---|
| 1074 | 1074 | bool screen_device::screen_update(bitmap_t &bitmap, const rectangle &cliprect) |
| 1075 | 1075 | { |
| 1076 | 1076 | if (m_screen_update != NULL) { |
| 1077 | return (*m_screen_update)(*this, &bitmap, | |
| 1077 | return (*m_screen_update)(*this, &bitmap, | |
| 1078 | 1078 | } else { |
| 1079 | 1079 | return machine().driver_data<driver_device>()->screen_update(*this, bitmap, cliprect); |
| 1080 | 1080 | } |
| r13798 | r13799 | |
|---|---|---|
| 74 | 74 | // callback that is called to notify of a change in the VBLANK state |
| 75 | 75 | typedef delegate<void (screen_device &, bool)> vblank_state_delegate; |
| 76 | 76 | |
| 77 | typedef UINT32 (*screen_update_func)(screen_device &screen, bitmap_t *bitmap, const rectangle | |
| 77 | typedef UINT32 (*screen_update_func)(screen_device &screen, bitmap_t *bitmap, const rectangle &cliprect); | |
| 78 | 78 | typedef void (*screen_eof_func)(screen_device &screen); |
| 79 | 79 | |
| 80 | 80 | |
| r13798 | r13799 | |
| 255 | 255 | //************************************************************************** |
| 256 | 256 | |
| 257 | 257 | #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 | |
| 258 | #define SCREEN_UPDATE(name) UINT32 SCREEN_UPDATE_NAME(name)(screen_device &screen, bitmap_t *bitmap, const rectangle &cliprect) | |
| 259 | 259 | #define SCREEN_UPDATE_CALL(name) SCREEN_UPDATE_NAME(name)(screen, bitmap, cliprect) |
| 260 | 260 | |
| 261 | 261 | #define SCREEN_EOF_NAME(name) screen_eof_##name |
| r13798 | r13799 | |
|---|---|---|
| 501 | 501 | no transparency |
| 502 | 502 | -------------------------------------------------*/ |
| 503 | 503 | |
| 504 | void drawgfx_opaque(bitmap_t *dest, const rectangle | |
| 504 | void drawgfx_opaque(bitmap_t *dest, const rectangle &cliprect, const gfx_element *gfx, | |
| 505 | 505 | UINT32 code, UINT32 color, int flipx, int flipy, INT32 destx, INT32 desty) |
| 506 | 506 | { |
| 507 | 507 | bitmap_t *priority = NULL; /* dummy, no priority in this case */ |
| r13798 | r13799 | |
| 529 | 529 | a single transparent pen |
| 530 | 530 | -------------------------------------------------*/ |
| 531 | 531 | |
| 532 | void drawgfx_transpen(bitmap_t *dest, const rectangle | |
| 532 | void drawgfx_transpen(bitmap_t *dest, const rectangle &cliprect, const gfx_element *gfx, | |
| 533 | 533 | UINT32 code, UINT32 color, int flipx, int flipy, INT32 destx, INT32 desty, |
| 534 | 534 | UINT32 transpen) |
| 535 | 535 | { |
| r13798 | r13799 | |
| 583 | 583 | lookups |
| 584 | 584 | -------------------------------------------------*/ |
| 585 | 585 | |
| 586 | void drawgfx_transpen_raw(bitmap_t *dest, const rectangle | |
| 586 | void drawgfx_transpen_raw(bitmap_t *dest, const rectangle &cliprect, const gfx_element *gfx, | |
| 587 | 587 | UINT32 code, UINT32 color, int flipx, int flipy, INT32 destx, INT32 desty, |
| 588 | 588 | UINT32 transpen) |
| 589 | 589 | { |
| r13798 | r13799 | |
| 614 | 614 | a mask |
| 615 | 615 | -------------------------------------------------*/ |
| 616 | 616 | |
| 617 | void drawgfx_transmask(bitmap_t *dest, const rectangle | |
| 617 | void drawgfx_transmask(bitmap_t *dest, const rectangle &cliprect, const gfx_element *gfx, | |
| 618 | 618 | UINT32 code, UINT32 color, int flipx, int flipy, INT32 destx, INT32 desty, |
| 619 | 619 | UINT32 transmask) |
| 620 | 620 | { |
| r13798 | r13799 | |
| 668 | 668 | transparent, opaque, or shadowing |
| 669 | 669 | -------------------------------------------------*/ |
| 670 | 670 | |
| 671 | void drawgfx_transtable(bitmap_t *dest, const rectangle | |
| 671 | void drawgfx_transtable(bitmap_t *dest, const rectangle &cliprect, const gfx_element *gfx, | |
| 672 | 672 | UINT32 code, UINT32 color, int flipx, int flipy, INT32 destx, INT32 desty, |
| 673 | 673 | const UINT8 *pentable, const pen_t *shadowtable) |
| 674 | 674 | { |
| r13798 | r13799 | |
| 699 | 699 | remaining pixels with a fixed alpha value |
| 700 | 700 | -------------------------------------------------*/ |
| 701 | 701 | |
| 702 | void drawgfx_alpha(bitmap_t *dest, const rectangle | |
| 702 | void drawgfx_alpha(bitmap_t *dest, const rectangle &cliprect, const gfx_element *gfx, | |
| 703 | 703 | UINT32 code, UINT32 color, int flipx, int flipy, INT32 destx, INT32 desty, |
| 704 | 704 | UINT32 transpen, UINT8 alpha) |
| 705 | 705 | { |
| r13798 | r13799 | |
| 744 | 744 | element with no transparency |
| 745 | 745 | -------------------------------------------------*/ |
| 746 | 746 | |
| 747 | void drawgfxzoom_opaque(bitmap_t *dest, const rectangle | |
| 747 | void drawgfxzoom_opaque(bitmap_t *dest, const rectangle &cliprect, const gfx_element *gfx, | |
| 748 | 748 | UINT32 code, UINT32 color, int flipx, int flipy, INT32 destx, INT32 desty, |
| 749 | 749 | UINT32 scalex, UINT32 scaley) |
| 750 | 750 | { |
| r13798 | r13799 | |
| 780 | 780 | element with a single transparent pen |
| 781 | 781 | -------------------------------------------------*/ |
| 782 | 782 | |
| 783 | void drawgfxzoom_transpen(bitmap_t *dest, const rectangle | |
| 783 | void drawgfxzoom_transpen(bitmap_t *dest, const rectangle &cliprect, const gfx_element *gfx, | |
| 784 | 784 | UINT32 code, UINT32 color, int flipx, int flipy, INT32 destx, INT32 desty, |
| 785 | 785 | UINT32 scalex, UINT32 scaley, UINT32 transpen) |
| 786 | 786 | { |
| r13798 | r13799 | |
| 841 | 841 | color lookups |
| 842 | 842 | -------------------------------------------------*/ |
| 843 | 843 | |
| 844 | void drawgfxzoom_transpen_raw(bitmap_t *dest, const rectangle | |
| 844 | void drawgfxzoom_transpen_raw(bitmap_t *dest, const rectangle &cliprect, const gfx_element *gfx, | |
| 845 | 845 | UINT32 code, UINT32 color, int flipx, int flipy, INT32 destx, INT32 desty, |
| 846 | 846 | UINT32 scalex, UINT32 scaley, UINT32 transpen) |
| 847 | 847 | { |
| r13798 | r13799 | |
| 879 | 879 | provided as a mask |
| 880 | 880 | -------------------------------------------------*/ |
| 881 | 881 | |
| 882 | void drawgfxzoom_transmask(bitmap_t *dest, const rectangle | |
| 882 | void drawgfxzoom_transmask(bitmap_t *dest, const rectangle &cliprect, const gfx_element *gfx, | |
| 883 | 883 | UINT32 code, UINT32 color, int flipx, int flipy, INT32 destx, INT32 desty, |
| 884 | 884 | UINT32 scalex, UINT32 scaley, UINT32 transmask) |
| 885 | 885 | { |
| r13798 | r13799 | |
| 940 | 940 | are transparent, opaque, or shadowing |
| 941 | 941 | -------------------------------------------------*/ |
| 942 | 942 | |
| 943 | void drawgfxzoom_transtable(bitmap_t *dest, const rectangle | |
| 943 | void drawgfxzoom_transtable(bitmap_t *dest, const rectangle &cliprect, const gfx_element *gfx, | |
| 944 | 944 | UINT32 code, UINT32 color, int flipx, int flipy, INT32 destx, INT32 desty, |
| 945 | 945 | UINT32 scalex, UINT32 scaley, const UINT8 *pentable, const pen_t *shadowtable) |
| 946 | 946 | { |
| r13798 | r13799 | |
| 978 | 978 | the remaining pixels with a fixed alpha value |
| 979 | 979 | -------------------------------------------------*/ |
| 980 | 980 | |
| 981 | void drawgfxzoom_alpha(bitmap_t *dest, const rectangle | |
| 981 | void drawgfxzoom_alpha(bitmap_t *dest, const rectangle &cliprect, const gfx_element *gfx, | |
| 982 | 982 | UINT32 code, UINT32 color, int flipx, int flipy, INT32 destx, INT32 desty, |
| 983 | 983 | UINT32 scalex, UINT32 scaley, UINT32 transpen, UINT8 alpha) |
| 984 | 984 | { |
| r13798 | r13799 | |
| 1031 | 1031 | bitmap |
| 1032 | 1032 | -------------------------------------------------*/ |
| 1033 | 1033 | |
| 1034 | void pdrawgfx_opaque(bitmap_t *dest, const rectangle | |
| 1034 | void pdrawgfx_opaque(bitmap_t *dest, const rectangle &cliprect, const gfx_element *gfx, | |
| 1035 | 1035 | UINT32 code, UINT32 color, int flipx, int flipy, INT32 destx, INT32 desty, |
| 1036 | 1036 | bitmap_t *priority, UINT32 pmask) |
| 1037 | 1037 | { |
| r13798 | r13799 | |
| 1063 | 1063 | priority bitmap |
| 1064 | 1064 | -------------------------------------------------*/ |
| 1065 | 1065 | |
| 1066 | void pdrawgfx_transpen(bitmap_t *dest, const rectangle | |
| 1066 | void pdrawgfx_transpen(bitmap_t *dest, const rectangle &cliprect, const gfx_element *gfx, | |
| 1067 | 1067 | UINT32 code, UINT32 color, int flipx, int flipy, INT32 destx, INT32 desty, |
| 1068 | 1068 | bitmap_t *priority, UINT32 pmask, UINT32 transpen) |
| 1069 | 1069 | { |
| r13798 | r13799 | |
| 1119 | 1119 | lookups, checking against the priority bitmap |
| 1120 | 1120 | -------------------------------------------------*/ |
| 1121 | 1121 | |
| 1122 | void pdrawgfx_transpen_raw(bitmap_t *dest, const rectangle | |
| 1122 | void pdrawgfx_transpen_raw(bitmap_t *dest, const rectangle &cliprect, const gfx_element *gfx, | |
| 1123 | 1123 | UINT32 code, UINT32 color, int flipx, int flipy, INT32 destx, INT32 desty, |
| 1124 | 1124 | bitmap_t *priority, UINT32 pmask, UINT32 transpen) |
| 1125 | 1125 | { |
| r13798 | r13799 | |
| 1151 | 1151 | a mask, checking against the priority bitmap |
| 1152 | 1152 | -------------------------------------------------*/ |
| 1153 | 1153 | |
| 1154 | void pdrawgfx_transmask(bitmap_t *dest, const rectangle | |
| 1154 | void pdrawgfx_transmask(bitmap_t *dest, const rectangle &cliprect, const gfx_element *gfx, | |
| 1155 | 1155 | UINT32 code, UINT32 color, int flipx, int flipy, INT32 destx, INT32 desty, |
| 1156 | 1156 | bitmap_t *priority, UINT32 pmask, UINT32 transmask) |
| 1157 | 1157 | { |
| r13798 | r13799 | |
| 1208 | 1208 | against the priority bitmap |
| 1209 | 1209 | -------------------------------------------------*/ |
| 1210 | 1210 | |
| 1211 | void pdrawgfx_transtable(bitmap_t *dest, const rectangle | |
| 1211 | void pdrawgfx_transtable(bitmap_t *dest, const rectangle &cliprect, const gfx_element *gfx, | |
| 1212 | 1212 | UINT32 code, UINT32 color, int flipx, int flipy, INT32 destx, INT32 desty, |
| 1213 | 1213 | bitmap_t *priority, UINT32 pmask, const UINT8 *pentable, const pen_t *shadowtable) |
| 1214 | 1214 | { |
| r13798 | r13799 | |
| 1242 | 1242 | checking against the priority bitmap |
| 1243 | 1243 | -------------------------------------------------*/ |
| 1244 | 1244 | |
| 1245 | void pdrawgfx_alpha(bitmap_t *dest, const rectangle | |
| 1245 | void pdrawgfx_alpha(bitmap_t *dest, const rectangle &cliprect, const gfx_element *gfx, | |
| 1246 | 1246 | UINT32 code, UINT32 color, int flipx, int flipy, INT32 destx, INT32 desty, |
| 1247 | 1247 | bitmap_t *priority, UINT32 pmask, UINT32 transpen, UINT8 alpha) |
| 1248 | 1248 | { |
| r13798 | r13799 | |
| 1290 | 1290 | the priority bitmap |
| 1291 | 1291 | -------------------------------------------------*/ |
| 1292 | 1292 | |
| 1293 | void pdrawgfxzoom_opaque(bitmap_t *dest, const rectangle | |
| 1293 | void pdrawgfxzoom_opaque(bitmap_t *dest, const rectangle &cliprect, const gfx_element *gfx, | |
| 1294 | 1294 | UINT32 code, UINT32 color, int flipx, int flipy, INT32 destx, INT32 desty, |
| 1295 | 1295 | UINT32 scalex, UINT32 scaley, bitmap_t *priority, UINT32 pmask) |
| 1296 | 1296 | { |
| r13798 | r13799 | |
| 1329 | 1329 | checking against the priority bitmap |
| 1330 | 1330 | -------------------------------------------------*/ |
| 1331 | 1331 | |
| 1332 | void pdrawgfxzoom_transpen(bitmap_t *dest, const rectangle | |
| 1332 | void pdrawgfxzoom_transpen(bitmap_t *dest, const rectangle &cliprect, const gfx_element *gfx, | |
| 1333 | 1333 | UINT32 code, UINT32 color, int flipx, int flipy, INT32 destx, INT32 desty, |
| 1334 | 1334 | UINT32 scalex, UINT32 scaley, bitmap_t *priority, UINT32 pmask, |
| 1335 | 1335 | UINT32 transpen) |
| r13798 | r13799 | |
| 1394 | 1394 | bitmap |
| 1395 | 1395 | -------------------------------------------------*/ |
| 1396 | 1396 | |
| 1397 | void pdrawgfxzoom_transpen_raw(bitmap_t *dest, const rectangle | |
| 1397 | void pdrawgfxzoom_transpen_raw(bitmap_t *dest, const rectangle &cliprect, const gfx_element *gfx, | |
| 1398 | 1398 | UINT32 code, UINT32 color, int flipx, int flipy, INT32 destx, INT32 desty, |
| 1399 | 1399 | UINT32 scalex, UINT32 scaley, bitmap_t *priority, UINT32 pmask, |
| 1400 | 1400 | UINT32 transpen) |
| r13798 | r13799 | |
| 1435 | 1435 | priority bitmap |
| 1436 | 1436 | -------------------------------------------------*/ |
| 1437 | 1437 | |
| 1438 | void pdrawgfxzoom_transmask(bitmap_t *dest, const rectangle | |
| 1438 | void pdrawgfxzoom_transmask(bitmap_t *dest, const rectangle &cliprect, const gfx_element *gfx, | |
| 1439 | 1439 | UINT32 code, UINT32 color, int flipx, int flipy, INT32 destx, INT32 desty, |
| 1440 | 1440 | UINT32 scalex, UINT32 scaley, bitmap_t *priority, UINT32 pmask, |
| 1441 | 1441 | UINT32 transmask) |
| r13798 | r13799 | |
| 1500 | 1500 | checking against the priority bitmap |
| 1501 | 1501 | -------------------------------------------------*/ |
| 1502 | 1502 | |
| 1503 | void pdrawgfxzoom_transtable(bitmap_t *dest, const rectangle | |
| 1503 | void pdrawgfxzoom_transtable(bitmap_t *dest, const rectangle &cliprect, const gfx_element *gfx, | |
| 1504 | 1504 | UINT32 code, UINT32 color, int flipx, int flipy, INT32 destx, INT32 desty, |
| 1505 | 1505 | UINT32 scalex, UINT32 scaley, bitmap_t *priority, UINT32 pmask, |
| 1506 | 1506 | const UINT8 *pentable, const pen_t *shadowtable) |
| r13798 | r13799 | |
| 1543 | 1543 | bitmap |
| 1544 | 1544 | -------------------------------------------------*/ |
| 1545 | 1545 | |
| 1546 | void pdrawgfxzoom_alpha(bitmap_t *dest, const rectangle | |
| 1546 | void pdrawgfxzoom_alpha(bitmap_t *dest, const rectangle &cliprect, const gfx_element *gfx, | |
| 1547 | 1547 | UINT32 code, UINT32 color, int flipx, int flipy, INT32 destx, INT32 desty, |
| 1548 | 1548 | UINT32 scalex, UINT32 scaley, bitmap_t *priority, UINT32 pmask, |
| 1549 | 1549 | UINT32 transpen, UINT8 alpha) |
| r13798 | r13799 | |
| 1764 | 1764 | copying all unclipped pixels |
| 1765 | 1765 | -------------------------------------------------*/ |
| 1766 | 1766 | |
| 1767 | void copybitmap(bitmap_t *dest, bitmap_t *src, int flipx, int flipy, INT32 destx, INT32 desty, const rectangle | |
| 1767 | void copybitmap(bitmap_t *dest, bitmap_t *src, int flipx, int flipy, INT32 destx, INT32 desty, const rectangle &cliprect) | |
| 1768 | 1768 | { |
| 1769 | 1769 | bitmap_t *priority = NULL; /* dummy, no priority in this case */ |
| 1770 | 1770 | |
| r13798 | r13799 | |
| 1788 | 1788 | those that match transpen |
| 1789 | 1789 | -------------------------------------------------*/ |
| 1790 | 1790 | |
| 1791 | void copybitmap_trans(bitmap_t *dest, bitmap_t *src, int flipx, int flipy, INT32 destx, INT32 desty, const rectangle | |
| 1791 | void copybitmap_trans(bitmap_t *dest, bitmap_t *src, int flipx, int flipy, INT32 destx, INT32 desty, const rectangle &cliprect, UINT32 transpen) | |
| 1792 | 1792 | { |
| 1793 | 1793 | bitmap_t *priority = NULL; /* dummy, no priority in this case */ |
| 1794 | 1794 | |
| r13798 | r13799 | |
| 1832 | 1832 | applying scrolling to one or more rows/colums |
| 1833 | 1833 | -------------------------------------------------*/ |
| 1834 | 1834 | |
| 1835 | void copyscrollbitmap(bitmap_t *dest, bitmap_t *src, UINT32 numrows, const INT32 *rowscroll, UINT32 numcols, const INT32 *colscroll, const rectangle | |
| 1835 | void copyscrollbitmap(bitmap_t *dest, bitmap_t *src, UINT32 numrows, const INT32 *rowscroll, UINT32 numcols, const INT32 *colscroll, const rectangle &cliprect) | |
| 1836 | 1836 | { |
| 1837 | 1837 | /* just call through to the transparent case as the underlying copybitmap will |
| 1838 | 1838 | optimize for pen == 0xffffffff */ |
| r13798 | r13799 | |
| 1847 | 1847 | scrolling to one or more rows/colums |
| 1848 | 1848 | -------------------------------------------------*/ |
| 1849 | 1849 | |
| 1850 | void copyscrollbitmap_trans(bitmap_t *dest, bitmap_t *src, UINT32 numrows, const INT32 *rowscroll, UINT32 numcols, const INT32 *colscroll, const rectangle | |
| 1850 | void copyscrollbitmap_trans(bitmap_t *dest, bitmap_t *src, UINT32 numrows, const INT32 *rowscroll, UINT32 numcols, const INT32 *colscroll, const rectangle &cliprect, UINT32 transpen) | |
| 1851 | 1851 | { |
| 1852 | 1852 | /* no rowscroll and no colscroll means no scroll */ |
| 1853 | 1853 | if (numrows == 0 && numcols == 0) |
| r13798 | r13799 | |
| 1865 | 1865 | assert(numcols != 0 || colscroll == NULL); |
| 1866 | 1866 | assert(numcols == 0 || colscroll != NULL); |
| 1867 | 1867 | |
| 1868 | /* NULL clip means use the full bitmap */ | |
| 1869 | if (cliprect == NULL) | |
| 1870 | cliprect = &dest->cliprect(); | |
| 1871 | ||
| 1872 | 1868 | /* fully scrolling X,Y playfield */ |
| 1873 | 1869 | if (numrows <= 1 && numcols <= 1) |
| 1874 | 1870 | { |
| r13798 | r13799 | |
| 1886 | 1882 | else if (numrows <= 1) |
| 1887 | 1883 | { |
| 1888 | 1884 | INT32 xscroll = normalize_xscroll(src, (numrows == 0) ? 0 : rowscroll[0]); |
| 1889 | rectangle subclip = | |
| 1885 | rectangle subclip = | |
| 1890 | 1886 | int col, colwidth, groupcols; |
| 1891 | 1887 | |
| 1892 | 1888 | /* determine width of each column */ |
| r13798 | r13799 | |
| 1911 | 1907 | /* compute the cliprect for this group */ |
| 1912 | 1908 | subclip.min_x = col * colwidth + sx; |
| 1913 | 1909 | subclip.max_x = (col + groupcols) * colwidth - 1 + sx; |
| 1914 | subclip &= | |
| 1910 | subclip &= | |
| 1915 | 1911 | |
| 1916 | 1912 | /* iterate over all portions of the scroll that overlap the destination */ |
| 1917 | 1913 | for (sy = yscroll - src->height(); sy < dest->height(); sy += src->height()) |
| 1918 | copybitmap_trans(dest, src, 0, 0, sx, sy, | |
| 1914 | copybitmap_trans(dest, src, 0, 0, sx, sy, | |
| 1919 | 1915 | } |
| 1920 | 1916 | } |
| 1921 | 1917 | } |
| r13798 | r13799 | |
| 1924 | 1920 | else if (numcols <= 1) |
| 1925 | 1921 | { |
| 1926 | 1922 | INT32 yscroll = normalize_yscroll(src, (numcols == 0) ? 0 : colscroll[0]); |
| 1927 | rectangle subclip = | |
| 1923 | rectangle subclip = | |
| 1928 | 1924 | int row, rowheight, grouprows; |
| 1929 | 1925 | |
| 1930 | 1926 | /* determine width of each rows */ |
| r13798 | r13799 | |
| 1949 | 1945 | /* compute the cliprect for this group */ |
| 1950 | 1946 | subclip.min_y = row * rowheight + sy; |
| 1951 | 1947 | subclip.max_y = (row + grouprows) * rowheight - 1 + sy; |
| 1952 | subclip &= | |
| 1948 | subclip &= | |
| 1953 | 1949 | |
| 1954 | 1950 | /* iterate over all portions of the scroll that overlap the destination */ |
| 1955 | 1951 | for (sx = xscroll - src->width(); sx < dest->width(); sx += src->width()) |
| 1956 | copybitmap_trans(dest, src, 0, 0, sx, sy, | |
| 1952 | copybitmap_trans(dest, src, 0, 0, sx, sy, | |
| 1957 | 1953 | } |
| 1958 | 1954 | } |
| 1959 | 1955 | } |
| r13798 | r13799 | |
| 1971 | 1967 | pixels |
| 1972 | 1968 | -------------------------------------------------*/ |
| 1973 | 1969 | |
| 1974 | void copyrozbitmap(bitmap_t *dest, const rectangle | |
| 1970 | void copyrozbitmap(bitmap_t *dest, const rectangle &cliprect, bitmap_t *src, INT32 startx, INT32 starty, INT32 incxx, INT32 incxy, INT32 incyx, INT32 incyy, int wraparound) | |
| 1975 | 1971 | { |
| 1976 | 1972 | bitmap_t *priority = NULL; /* dummy, no priority in this case */ |
| 1977 | 1973 | |
| r13798 | r13799 | |
| 1996 | 1992 | transpen |
| 1997 | 1993 | -------------------------------------------------*/ |
| 1998 | 1994 | |
| 1999 | void copyrozbitmap_trans(bitmap_t *dest, const rectangle | |
| 1995 | void 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) | |
| 2000 | 1996 | { |
| 2001 | 1997 | bitmap_t *priority = NULL; /* dummy, no priority in this case */ |
| 2002 | 1998 |
| r13798 | r13799 | |
|---|---|---|
| 196 | 196 | /* ----- core graphics drawing ----- */ |
| 197 | 197 | |
| 198 | 198 | /* specific drawgfx implementations for each transparency type */ |
| 199 | void drawgfx_opaque(bitmap_t *dest, const rectangle *cliprect, const gfx_element *gfx, UINT32 code, UINT32 color, int flipx, int flipy, INT32 destx, INT32 desty); | |
| 200 | void 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); | |
| 201 | void 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); | |
| 202 | void 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); | |
| 203 | void 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); | |
| 204 | void 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); | |
| 199 | void drawgfx_opaque(bitmap_t *dest, const rectangle &cliprect, const gfx_element *gfx, UINT32 code, UINT32 color, int flipx, int flipy, INT32 destx, INT32 desty); | |
| 200 | void 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); | |
| 201 | void 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); | |
| 202 | void 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); | |
| 203 | void 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); | |
| 204 | void 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); | |
| 205 | 205 | |
| 206 | 206 | |
| 207 | 207 | |
| 208 | 208 | /* ----- zoomed graphics drawing ----- */ |
| 209 | 209 | |
| 210 | 210 | /* specific drawgfxzoom implementations for each transparency type */ |
| 211 | void 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); | |
| 212 | void 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); | |
| 213 | void 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); | |
| 214 | void 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); | |
| 215 | void 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); | |
| 216 | void 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); | |
| 211 | void 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); | |
| 212 | void 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); | |
| 213 | void 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); | |
| 214 | void 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); | |
| 215 | void 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); | |
| 216 | void 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); | |
| 217 | 217 | |
| 218 | 218 | |
| 219 | 219 | |
| 220 | 220 | /* ----- priority masked graphics drawing ----- */ |
| 221 | 221 | |
| 222 | 222 | /* specific pdrawgfx implementations for each transparency type */ |
| 223 | void 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); | |
| 224 | void 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); | |
| 225 | void 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); | |
| 226 | void 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); | |
| 227 | void 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); | |
| 228 | void 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); | |
| 223 | void 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); | |
| 224 | void 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); | |
| 225 | void 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); | |
| 226 | void 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); | |
| 227 | void 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); | |
| 228 | void 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); | |
| 229 | 229 | |
| 230 | 230 | |
| 231 | 231 | |
| 232 | 232 | /* ----- priority masked zoomed graphics drawing ----- */ |
| 233 | 233 | |
| 234 | 234 | /* specific pdrawgfxzoom implementations for each transparency type */ |
| 235 | void 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); | |
| 236 | void 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); | |
| 237 | void 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); | |
| 238 | void 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); | |
| 239 | void 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); | |
| 240 | void 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); | |
| 235 | void 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); | |
| 236 | void 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); | |
| 237 | void 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); | |
| 238 | void 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); | |
| 239 | void 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); | |
| 240 | void 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); | |
| 241 | 241 | |
| 242 | 242 | |
| 243 | 243 | |
| r13798 | r13799 | |
| 270 | 270 | /* ----- bitmap copying ----- */ |
| 271 | 271 | |
| 272 | 272 | /* copy from one bitmap to another, copying all unclipped pixels */ |
| 273 | void copybitmap(bitmap_t *dest, bitmap_t *src, int flipx, int flipy, INT32 destx, INT32 desty, const rectangle | |
| 273 | void copybitmap(bitmap_t *dest, bitmap_t *src, int flipx, int flipy, INT32 destx, INT32 desty, const rectangle &cliprect); | |
| 274 | 274 | |
| 275 | 275 | /* copy from one bitmap to another, copying all unclipped pixels except those that match transpen */ |
| 276 | void copybitmap_trans(bitmap_t *dest, bitmap_t *src, int flipx, int flipy, INT32 destx, INT32 desty, const rectangle | |
| 276 | void copybitmap_trans(bitmap_t *dest, bitmap_t *src, int flipx, int flipy, INT32 destx, INT32 desty, const rectangle &cliprect, UINT32 transpen); | |
| 277 | 277 | |
| 278 | 278 | /* |
| 279 | 279 | Copy a bitmap onto another with scroll and wraparound. |
| r13798 | r13799 | |
| 288 | 288 | */ |
| 289 | 289 | |
| 290 | 290 | /* copy from one bitmap to another, copying all unclipped pixels, and applying scrolling to one or more rows/colums */ |
| 291 | void copyscrollbitmap(bitmap_t *dest, bitmap_t *src, UINT32 numrows, const INT32 *rowscroll, UINT32 numcols, const INT32 *colscroll, const rectangle | |
| 291 | void copyscrollbitmap(bitmap_t *dest, bitmap_t *src, UINT32 numrows, const INT32 *rowscroll, UINT32 numcols, const INT32 *colscroll, const rectangle &cliprect); | |
| 292 | 292 | |
| 293 | 293 | /* copy from one bitmap to another, copying all unclipped pixels except those that match transpen, and applying scrolling to one or more rows/colums */ |
| 294 | void copyscrollbitmap_trans(bitmap_t *dest, bitmap_t *src, UINT32 numrows, const INT32 *rowscroll, UINT32 numcols, const INT32 *colscroll, const rectangle | |
| 294 | void copyscrollbitmap_trans(bitmap_t *dest, bitmap_t *src, UINT32 numrows, const INT32 *rowscroll, UINT32 numcols, const INT32 *colscroll, const rectangle &cliprect, UINT32 transpen); | |
| 295 | 295 | |
| 296 | 296 | /* |
| 297 | 297 | Copy a bitmap applying rotation, zooming, and arbitrary distortion. |
| r13798 | r13799 | |
| 323 | 323 | */ |
| 324 | 324 | |
| 325 | 325 | /* copy from one bitmap to another, with zoom and rotation, copying all unclipped pixels */ |
| 326 | void copyrozbitmap(bitmap_t *dest, const rectangle | |
| 326 | void copyrozbitmap(bitmap_t *dest, const rectangle &cliprect, bitmap_t *src, INT32 startx, INT32 starty, INT32 incxx, INT32 incxy, INT32 incyx, INT32 incyy, int wraparound); | |
| 327 | 327 | |
| 328 | 328 | /* copy from one bitmap to another, with zoom and rotation, copying all unclipped pixels whose values do not match transpen */ |
| 329 | void copyrozbitmap_trans(bitmap_t *dest, const rectangle | |
| 329 | void 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); | |
| 330 | 330 | |
| 331 | 331 | |
| 332 | 332 |
| r13798 | r13799 | |
|---|---|---|
| 356 | 356 | Assumed input parameters or local variables: |
| 357 | 357 | |
| 358 | 358 | bitmap_t *dest - the bitmap to render to |
| 359 | const rectangle | |
| 359 | const rectangle &cliprect - a clipping rectangle (assumed to be clipped to the size of 'dest') | |
| 360 | 360 | const gfx_element *gfx - pointer to the gfx_element to render |
| 361 | 361 | UINT32 code - index of the entry within gfx_element |
| 362 | 362 | UINT32 color - index of the color within gfx_element |
| r13798 | r13799 | |
| 381 | 381 | assert(dest != NULL); \ |
| 382 | 382 | assert(gfx != NULL); \ |
| 383 | 383 | 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()); \ | |
| 388 | 388 | \ |
| 389 | /* NULL clip means use the full bitmap */ \ | |
| 390 | if (cliprect == NULL) \ | |
| 391 | cliprect = &dest->cliprect(); \ | |
| 392 | \ | |
| 393 | 389 | /* ignore empty/invalid cliprects */ \ |
| 394 | if (cliprect | |
| 390 | if (cliprect. | |
| 395 | 391 | break; \ |
| 396 | 392 | \ |
| 397 | 393 | /* compute final pixel in X and exit if we are entirely clipped */ \ |
| 398 | 394 | destendx = destx + gfx->width - 1; \ |
| 399 | if (destx > cliprect | |
| 395 | if (destx > cliprect. | |
| 400 | 396 | break; \ |
| 401 | 397 | \ |
| 402 | 398 | /* apply left clip */ \ |
| 403 | 399 | srcx = 0; \ |
| 404 | if (destx < cliprect | |
| 400 | if (destx < cliprect. | |
| 405 | 401 | { \ |
| 406 | srcx = cliprect->min_x - destx; \ | |
| 407 | destx = cliprect->min_x; \ | |
| 402 | srcx = cliprect.min_x - destx; \ | |
| 403 | destx = cliprect.min_x; \ | |
| 408 | 404 | } \ |
| 409 | 405 | \ |
| 410 | 406 | /* 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; \ | |
| 413 | 409 | \ |
| 414 | 410 | /* compute final pixel in Y and exit if we are entirely clipped */ \ |
| 415 | 411 | destendy = desty + gfx->height - 1; \ |
| 416 | if (desty > cliprect | |
| 412 | if (desty > cliprect. | |
| 417 | 413 | break; \ |
| 418 | 414 | \ |
| 419 | 415 | /* apply top clip */ \ |
| 420 | 416 | srcy = 0; \ |
| 421 | if (desty < cliprect | |
| 417 | if (desty < cliprect. | |
| 422 | 418 | { \ |
| 423 | srcy = cliprect->min_y - desty; \ | |
| 424 | desty = cliprect->min_y; \ | |
| 419 | srcy = cliprect.min_y - desty; \ | |
| 420 | desty = cliprect.min_y; \ | |
| 425 | 421 | } \ |
| 426 | 422 | \ |
| 427 | 423 | /* 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; \ | |
| 430 | 426 | \ |
| 431 | 427 | /* apply X flipping */ \ |
| 432 | 428 | if (flipx) \ |
| r13798 | r13799 | |
| 626 | 622 | Assumed input parameters or local variables: |
| 627 | 623 | |
| 628 | 624 | bitmap_t *dest - the bitmap to render to |
| 629 | const rectangle | |
| 625 | const rectangle &cliprect - a clipping rectangle (assumed to be clipped to the size of 'dest') | |
| 630 | 626 | const gfx_element *gfx - pointer to the gfx_element to render |
| 631 | 627 | UINT32 code - index of the entry within gfx_element |
| 632 | 628 | UINT32 color - index of the color within gfx_element |
| r13798 | r13799 | |
| 654 | 650 | assert(dest != NULL); \ |
| 655 | 651 | assert(gfx != NULL); \ |
| 656 | 652 | 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()); \ | |
| 661 | 657 | \ |
| 662 | /* NULL clip means use the full bitmap */ \ | |
| 663 | if (cliprect == NULL) \ | |
| 664 | cliprect = &dest->cliprect(); \ | |
| 665 | \ | |
| 666 | 658 | /* ignore empty/invalid cliprects */ \ |
| 667 | if (cliprect | |
| 659 | if (cliprect. | |
| 668 | 660 | break; \ |
| 669 | 661 | \ |
| 670 | 662 | /* compute scaled size */ \ |
| r13798 | r13799 | |
| 679 | 671 | \ |
| 680 | 672 | /* compute final pixel in X and exit if we are entirely clipped */ \ |
| 681 | 673 | destendx = destx + dstwidth - 1; \ |
| 682 | if (destx > cliprect | |
| 674 | if (destx > cliprect. | |
| 683 | 675 | break; \ |
| 684 | 676 | \ |
| 685 | 677 | /* apply left clip */ \ |
| 686 | 678 | srcx = 0; \ |
| 687 | if (destx < cliprect | |
| 679 | if (destx < cliprect. | |
| 688 | 680 | { \ |
| 689 | srcx = (cliprect->min_x - destx) * dx; \ | |
| 690 | destx = cliprect->min_x; \ | |
| 681 | srcx = (cliprect.min_x - destx) * dx; \ | |
| 682 | destx = cliprect.min_x; \ | |
| 691 | 683 | } \ |
| 692 | 684 | \ |
| 693 | 685 | /* 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; \ | |
| 696 | 688 | \ |
| 697 | 689 | /* compute final pixel in Y and exit if we are entirely clipped */ \ |
| 698 | 690 | destendy = desty + dstheight - 1; \ |
| 699 | if (desty > cliprect | |
| 691 | if (desty > cliprect. | |
| 700 | 692 | { \ |
| 701 | 693 | g_profiler.stop(); \ |
| 702 | 694 | return; \ |
| r13798 | r13799 | |
| 704 | 696 | \ |
| 705 | 697 | /* apply top clip */ \ |
| 706 | 698 | srcy = 0; \ |
| 707 | if (desty < cliprect | |
| 699 | if (desty < cliprect. | |
| 708 | 700 | { \ |
| 709 | srcy = (cliprect->min_y - desty) * dy; \ | |
| 710 | desty = cliprect->min_y; \ | |
| 701 | srcy = (cliprect.min_y - desty) * dy; \ | |
| 702 | desty = cliprect.min_y; \ | |
| 711 | 703 | } \ |
| 712 | 704 | \ |
| 713 | 705 | /* 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; \ | |
| 716 | 708 | \ |
| 717 | 709 | /* apply X flipping */ \ |
| 718 | 710 | if (flipx) \ |
| r13798 | r13799 | |
| 811 | 803 | |
| 812 | 804 | bitmap_t *dest - the bitmap to copy to |
| 813 | 805 | bitmap_t *src - the bitmap to copy from (must be same bpp as dest) |
| 814 | const rectangle | |
| 806 | const rectangle &cliprect - a clipping rectangle (assumed to be clipped to the size of 'dest') | |
| 815 | 807 | int flipx - non-zero means render right-to-left instead of left-to-right |
| 816 | 808 | int flipy - non-zero means render bottom-to-top instead of top-to-bottom |
| 817 | 809 | INT32 destx - the top-left X coordinate to copy to |
| r13798 | r13799 | |
| 833 | 825 | assert(dest != NULL); \ |
| 834 | 826 | assert(src != NULL); \ |
| 835 | 827 | 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()); \ | |
| 840 | 832 | \ |
| 841 | /* NULL clip means use the full bitmap */ \ | |
| 842 | if (cliprect == NULL) \ | |
| 843 | cliprect = &dest->cliprect(); \ | |
| 844 | \ | |
| 845 | 833 | /* ignore empty/invalid cliprects */ \ |
| 846 | if (cliprect | |
| 834 | if (cliprect. | |
| 847 | 835 | break; \ |
| 848 | 836 | \ |
| 849 | 837 | /* standard setup; dx counts bytes in X, dy counts pixels in Y */ \ |
| r13798 | r13799 | |
| 852 | 840 | \ |
| 853 | 841 | /* compute final pixel in X and exit if we are entirely clipped */ \ |
| 854 | 842 | destendx = destx + src->width() - 1; \ |
| 855 | if (destx > cliprect | |
| 843 | if (destx > cliprect. | |
| 856 | 844 | break; \ |
| 857 | 845 | \ |
| 858 | 846 | /* apply left clip */ \ |
| 859 | 847 | srcx = 0; \ |
| 860 | if (destx < cliprect | |
| 848 | if (destx < cliprect. | |
| 861 | 849 | { \ |
| 862 | srcx = cliprect->min_x - destx; \ | |
| 863 | destx = cliprect->min_x; \ | |
| 850 | srcx = cliprect.min_x - destx; \ | |
| 851 | destx = cliprect.min_x; \ | |
| 864 | 852 | } \ |
| 865 | 853 | \ |
| 866 | 854 | /* 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; \ | |
| 869 | 857 | \ |
| 870 | 858 | /* compute final pixel in Y and exit if we are entirely clipped */ \ |
| 871 | 859 | destendy = desty + src->height() - 1; \ |
| 872 | if (desty > cliprect | |
| 860 | if (desty > cliprect. | |
| 873 | 861 | break; \ |
| 874 | 862 | \ |
| 875 | 863 | /* apply top clip */ \ |
| 876 | 864 | srcy = 0; \ |
| 877 | if (desty < cliprect | |
| 865 | if (desty < cliprect. | |
| 878 | 866 | { \ |
| 879 | srcy = cliprect->min_y - desty; \ | |
| 880 | desty = cliprect->min_y; \ | |
| 867 | srcy = cliprect.min_y - desty; \ | |
| 868 | desty = cliprect.min_y; \ | |
| 881 | 869 | } \ |
| 882 | 870 | \ |
| 883 | 871 | /* 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; \ | |
| 886 | 874 | \ |
| 887 | 875 | /* apply X flipping */ \ |
| 888 | 876 | if (flipx) \ |
| r13798 | r13799 | |
| 989 | 977 | |
| 990 | 978 | bitmap_t *dest - the bitmap to copy to |
| 991 | 979 | bitmap_t *src - the bitmap to copy from (must be same bpp as dest) |
| 992 | const rectangle | |
| 980 | const rectangle &cliprect - a clipping rectangle (assumed to be clipped to the size of 'dest') | |
| 993 | 981 | INT32 destx - the 16.16 source X position at destination pixel (0,0) |
| 994 | 982 | INT32 desty - the 16.16 source Y position at destination pixel (0,0) |
| 995 | 983 | INT32 incxx - the 16.16 amount to increment in source X for each destination X pixel |
| r13798 | r13799 | |
| 1011 | 999 | assert(dest != NULL); \ |
| 1012 | 1000 | assert(src != NULL); \ |
| 1013 | 1001 | 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()); \ | |
| 1018 | 1006 | assert(!wraparound || (src->width() & (src->width() - 1)) == 0); \ |
| 1019 | 1007 | assert(!wraparound || (src->height() & (src->height() - 1)) == 0); \ |
| 1020 | 1008 | \ |
| 1021 | /* NULL clip means use the full bitmap */ \ | |
| 1022 | if (cliprect == NULL) \ | |
| 1023 | cliprect = &dest->cliprect(); \ | |
| 1024 | \ | |
| 1025 | 1009 | /* ignore empty/invalid cliprects */ \ |
| 1026 | if (cliprect | |
| 1010 | if (cliprect. | |
| 1027 | 1011 | break; \ |
| 1028 | 1012 | \ |
| 1029 | 1013 | /* compute fixed-point 16.16 size of the source bitmap */ \ |
| r13798 | r13799 | |
| 1031 | 1015 | srcfixheight = src->height() << 16; \ |
| 1032 | 1016 | \ |
| 1033 | 1017 | /* 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; \ | |
| 1036 | 1020 | \ |
| 1037 | 1021 | /* 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; \ | |
| 1040 | 1024 | \ |
| 1041 | 1025 | /* if incxy and incyx are 0, then we aren't rotating, just zooming */ \ |
| 1042 | 1026 | if (incxy == 0 && incyx == 0) \ |
| r13798 | r13799 | |
| 1045 | 1029 | if (!wraparound) \ |
| 1046 | 1030 | { \ |
| 1047 | 1031 | /* iterate over pixels in Y */ \ |
| 1048 | for (cury = cliprect | |
| 1032 | for (cury = cliprect. | |
| 1049 | 1033 | { \ |
| 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); \ | |
| 1052 | 1036 | const PIXEL_TYPE *srcptr; \ |
| 1053 | 1037 | INT32 srcx = startx; \ |
| 1054 | 1038 | INT32 srcy = starty; \ |
| r13798 | r13799 | |
| 1106 | 1090 | starty &= srcfixheight; \ |
| 1107 | 1091 | \ |
| 1108 | 1092 | /* iterate over pixels in Y */ \ |
| 1109 | for (cury = cliprect | |
| 1093 | for (cury = cliprect. | |
| 1110 | 1094 | { \ |
| 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); \ | |
| 1113 | 1097 | const PIXEL_TYPE *srcptr = &src->pix<PIXEL_TYPE>(starty >> 16); \ |
| 1114 | 1098 | INT32 srcx = startx; \ |
| 1115 | 1099 | \ |
| r13798 | r13799 | |
| 1153 | 1137 | if (!wraparound) \ |
| 1154 | 1138 | { \ |
| 1155 | 1139 | /* iterate over pixels in Y */ \ |
| 1156 | for (cury = cliprect | |
| 1140 | for (cury = cliprect. | |
| 1157 | 1141 | { \ |
| 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); \ | |
| 1160 | 1144 | const PIXEL_TYPE *srcptr; \ |
| 1161 | 1145 | INT32 srcx = startx; \ |
| 1162 | 1146 | INT32 srcy = starty; \ |
| r13798 | r13799 | |
| 1229 | 1213 | starty &= srcfixheight; \ |
| 1230 | 1214 | \ |
| 1231 | 1215 | /* iterate over pixels in Y */ \ |
| 1232 | for (cury = cliprect | |
| 1216 | for (cury = cliprect. | |
| 1233 | 1217 | { \ |
| 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); \ | |
| 1236 | 1220 | const PIXEL_TYPE *srcptr; \ |
| 1237 | 1221 | INT32 srcx = startx; \ |
| 1238 | 1222 | INT32 srcy = starty; \ |
| r13798 | r13799 | |
|---|---|---|
| 1198 | 1198 | } |
| 1199 | 1199 | } |
| 1200 | 1200 | |
| 1201 | UINT32 ted7360_video_update( device_t *device, bitmap_t *bitmap, const rectangle | |
| 1201 | UINT32 ted7360_video_update( device_t *device, bitmap_t *bitmap, const rectangle &cliprect ) | |
| 1202 | 1202 | { |
| 1203 | 1203 | ted7360_state *ted7360 = get_safe_token(device); |
| 1204 | 1204 |
| r13798 | r13799 | |
|---|---|---|
| 86 | 86 | |
| 87 | 87 | void ted7360_frame_interrupt_gen(device_t *device); |
| 88 | 88 | void ted7360_raster_interrupt_gen(device_t *device); |
| 89 | UINT32 ted7360_video_update(device_t *device, bitmap_t *bitmap, const rectangle | |
| 89 | UINT32 ted7360_video_update(device_t *device, bitmap_t *bitmap, const rectangle &cliprect); | |
| 90 | 90 | |
| 91 | 91 | |
| 92 | 92 | #endif /* __TED7360_H__ */ |
| r13798 | r13799 | |
|---|---|---|
| 87 | 87 | // mc6845_interface crtc_intf |
| 88 | 88 | //------------------------------------------------- |
| 89 | 89 | |
| 90 | void comx_clm_device::crtc_update_row(mc6845_device *device, bitmap_t *bitmap, const rectangle | |
| 90 | void 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) | |
| 91 | 91 | { |
| 92 | 92 | for (int column = 0; column < x_count; column++) |
| 93 | 93 | { |
| r13798 | r13799 | |
| 294 | 294 | |
| 295 | 295 | bool comx_clm_device::comx_screen_update(screen_device &screen, bitmap_t &bitmap, const rectangle &cliprect) |
| 296 | 296 | { |
| 297 | m_crtc->update(&bitmap, | |
| 297 | m_crtc->update(&bitmap, | |
| 298 | 298 | |
| 299 | 299 | return false; |
| 300 | 300 | } |
| r13798 | r13799 | |
|---|---|---|
| 38 | 38 | virtual machine_config_constructor device_mconfig_additions() const; |
| 39 | 39 | |
| 40 | 40 | // not really public |
| 41 | void crtc_update_row(mc6845_device *device, bitmap_t *bitmap, const rectangle | |
| 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); | |
| 42 | 42 | DECLARE_WRITE_LINE_MEMBER( hsync_w ); |
| 43 | 43 | |
| 44 | 44 | protected: |
| r13798 | r13799 | |
|---|---|---|
| 219 | 219 | /*************************************************************************** |
| 220 | 220 | VIDEO HARDWARE |
| 221 | 221 | ***************************************************************************/ |
| 222 | static void generic_teleprinter_update(device_t *device, bitmap_t *bitmap, const rectangle | |
| 222 | static void generic_teleprinter_update(device_t *device, bitmap_t *bitmap, const rectangle &cliprect) | |
| 223 | 223 | { |
| 224 | 224 | UINT8 code; |
| 225 | 225 | int y, c, x, b; |
| r13798 | r13799 | |
|---|---|---|
| 127 | 127 | |
| 128 | 128 | bool coco12_state::screen_update(screen_device &screen, bitmap_t &bitmap, const rectangle &cliprect) |
| 129 | 129 | { |
| 130 | return m_vdg->update(&bitmap, | |
| 130 | return m_vdg->update(&bitmap, | |
| 131 | 131 | } |
| 132 | 132 | |
| 133 | 133 |
| r13798 | r13799 | |
|---|---|---|
| 313 | 313 | /*************************************************************************** |
| 314 | 314 | VIDEO HARDWARE |
| 315 | 315 | ***************************************************************************/ |
| 316 | static void generic_terminal_update(device_t *device, bitmap_t *bitmap, const rectangle | |
| 316 | static void generic_terminal_update(device_t *device, bitmap_t *bitmap, const rectangle &cliprect) | |
| 317 | 317 | { |
| 318 | 318 | terminal_state *term = get_safe_token(device); |
| 319 | 319 | UINT8 options = input_port_read(device, "TERM_CONF"); |
| r13798 | r13799 | |
|---|---|---|
| 82 | 82 | // mc6845_interface crtc_intf |
| 83 | 83 | //------------------------------------------------- |
| 84 | 84 | |
| 85 | void c64_xl80_device::crtc_update_row(mc6845_device *device, bitmap_t *bitmap, const rectangle | |
| 85 | void 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) | |
| 86 | 86 | { |
| 87 | 87 | for (int column = 0; column < x_count; column++) |
| 88 | 88 | { |
| r13798 | r13799 | |
| 291 | 291 | |
| 292 | 292 | bool c64_xl80_device::c64_screen_update(screen_device &screen, bitmap_t &bitmap, const rectangle &cliprect) |
| 293 | 293 | { |
| 294 | m_crtc->update(&bitmap, | |
| 294 | m_crtc->update(&bitmap, | |
| 295 | 295 | |
| 296 | 296 | return false; |
| 297 | 297 | } |
| r13798 | r13799 | |
|---|---|---|
| 38 | 38 | virtual machine_config_constructor device_mconfig_additions() const; |
| 39 | 39 | |
| 40 | 40 | // not really public |
| 41 | void crtc_update_row(mc6845_device *device, bitmap_t *bitmap, const rectangle | |
| 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); | |
| 42 | 42 | |
| 43 | 43 | protected: |
| 44 | 44 | // device-level overrides |
| r13798 | r13799 | |
|---|---|---|
| 639 | 639 | bool z80ne_state::screen_update(screen_device &screen, bitmap_t &bitmap, const rectangle &cliprect) |
| 640 | 640 | { |
| 641 | 641 | if (m_vdg != NULL) |
| 642 | return m_vdg->update(&bitmap, | |
| 642 | return m_vdg->update(&bitmap, | |
| 643 | 643 | else |
| 644 | 644 | return 0; |
| 645 | 645 | } |
| r13798 | r13799 | |
|---|---|---|
| 294 | 294 | // do nothing |
| 295 | 295 | } |
| 296 | 296 | |
| 297 | static UINT32 s3c44b0_video_update( device_t *device, screen_device &screen, bitmap_t *bitmap, const rectangle | |
| 297 | static UINT32 s3c44b0_video_update( device_t *device, screen_device &screen, bitmap_t *bitmap, const rectangle &cliprect) | |
| 298 | 298 | { |
| 299 | 299 | s3c44b0_lcd_t *lcd = &(get_token( device)->lcd); |
| 300 | 300 | if (lcd->regs.lcdcon1 & (1 << 0)) |
| r13798 | r13799 | |
|---|---|---|
| 153 | 153 | if (!strcmp(screen.tag(), COMPOSITE_SCREEN_TAG)) |
| 154 | 154 | { |
| 155 | 155 | /* composite screen */ |
| 156 | result = m_gime->update_composite(&bitmap, | |
| 156 | result = m_gime->update_composite(&bitmap, | |
| 157 | 157 | } |
| 158 | 158 | else if (!strcmp(screen.tag(), RGB_SCREEN_TAG)) |
| 159 | 159 | { |
| 160 | 160 | /* rgb screen */ |
| 161 | result = m_gime->update_rgb(&bitmap, | |
| 161 | result = m_gime->update_rgb(&bitmap, | |
| 162 | 162 | } |
| 163 | 163 | else |
| 164 | 164 | { |
| r13798 | r13799 | |
|---|---|---|
| 219 | 219 | // mc6845_interface crtc_intf |
| 220 | 220 | //------------------------------------------------- |
| 221 | 221 | |
| 222 | void grip_device::crtc_update_row(mc6845_device *device, bitmap_t *bitmap, const rectangle | |
| 222 | void 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) | |
| 223 | 223 | { |
| 224 | 224 | int column, bit; |
| 225 | 225 | |
| r13798 | r13799 | |
| 1023 | 1023 | |
| 1024 | 1024 | bool grip_device::ecbbus_screen_update(screen_device &screen, bitmap_t &bitmap, const rectangle &cliprect) |
| 1025 | 1025 | { |
| 1026 | m_crtc->update(&bitmap, | |
| 1026 | m_crtc->update(&bitmap, | |
| 1027 | 1027 | |
| 1028 | 1028 | return false; |
| 1029 | 1029 | } |
| r13798 | r13799 | |
|---|---|---|
| 52 | 52 | DECLARE_READ8_MEMBER( sti_gpio_r ); |
| 53 | 53 | DECLARE_WRITE_LINE_MEMBER( speaker_w ); |
| 54 | 54 | |
| 55 | void crtc_update_row(mc6845_device *device, bitmap_t *bitmap, const rectangle | |
| 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); | |
| 56 | 56 | |
| 57 | 57 | protected: |
| 58 | 58 | // device-level overrides |
| r13798 | r13799 | |
|---|---|---|
| 118 | 118 | // device interface |
| 119 | 119 | //************************************************************************** |
| 120 | 120 | |
| 121 | int t6a04_device::video_update(bitmap_t *bitmap, const rectangle | |
| 121 | int t6a04_device::video_update(bitmap_t *bitmap, const rectangle &cliprect) | |
| 122 | 122 | { |
| 123 | 123 | UINT8 ypages = width>>3; |
| 124 | 124 | UINT8 last_line = m_zpos + height; |
| r13798 | r13799 | |
| 139 | 139 | } |
| 140 | 140 | else |
| 141 | 141 | { |
| 142 | bitmap->fill(0, | |
| 142 | bitmap->fill(0, | |
| 143 | 143 | } |
| 144 | 144 | |
| 145 | 145 | return 0; |
| r13798 | r13799 | |
|---|---|---|
| 40 | 40 | DECLARE_WRITE8_MEMBER(data_write); |
| 41 | 41 | DECLARE_READ8_MEMBER(data_read); |
| 42 | 42 | |
| 43 | int video_update(bitmap_t *bitmap, const rectangle | |
| 43 | int video_update(bitmap_t *bitmap, const rectangle &cliprect); | |
| 44 | 44 | |
| 45 | 45 | protected: |
| 46 | 46 | // device-level overrides |
| r13798 | r13799 | |
|---|---|---|
| 229 | 229 | /* write a single char on screen */ |
| 230 | 230 | static void pdp1_draw_char(running_machine &machine, bitmap_t *bitmap, char character, int x, int y, int color) |
| 231 | 231 | { |
| 232 | drawgfx_transpen(bitmap, | |
| 232 | drawgfx_transpen(bitmap, bitmap->cliprect(), machine.gfx[0], character-32, color, 0, 0, | |
| 233 | 233 | x+1, y, 0); |
| 234 | 234 | } |
| 235 | 235 |
| r13798 | r13799 | |
|---|---|---|
| 138 | 138 | int x, y, i, j; |
| 139 | 139 | int color[2]; |
| 140 | 140 | |
| 141 | bitmap->fill(11, | |
| 141 | bitmap->fill(11, | |
| 142 | 142 | |
| 143 | 143 | #if 0 |
| 144 | 144 | /* HJB: we cannot initialize array with values from other arrays, thus... */ |
| r13798 | r13799 | |
| 154 | 154 | for (x=RIGHT,y=DOWN,i=0; i<0x28;x+=2) |
| 155 | 155 | { |
| 156 | 156 | for (j=0; j<5;j++,i++,x+=2) |
| 157 | drawgfx_opaque(bitmap, | |
| 157 | drawgfx_opaque(bitmap, cliprect, screen.machine().gfx[0], state->m_reg[i],CONTRAST,0,0,x,y); | |
| 158 | 158 | } |
| 159 | 159 | for (i=0x67; i>=0x40;x+=2) |
| 160 | 160 | { |
| 161 | 161 | for (j=0; j<5;j++,i--,x+=2) |
| 162 | drawgfx_opaque(bitmap, | |
| 162 | drawgfx_opaque(bitmap, cliprect, screen.machine().gfx[0], state->m_reg[i],CONTRAST,0,0,x,y); | |
| 163 | 163 | } |
| 164 | 164 | } |
| 165 | 165 |
| r13798 | r13799 | |
|---|---|---|
| 35 | 35 | UINT16 last_pixel = 0, pixel; |
| 36 | 36 | int beamy; |
| 37 | 37 | |
| 38 | beamy = cliprect | |
| 38 | beamy = cliprect. | |
| 39 | 39 | |
| 40 | 40 | if (state->m_newvideo & 0x80) |
| 41 | 41 | { |
| r13798 | r13799 | |
| 133 | 133 | new_cliprect.min_y = 0; |
| 134 | 134 | new_cliprect.max_x = 559; |
| 135 | 135 | new_cliprect.max_y = 191; |
| 136 | SCREEN_UPDATE_NAME(apple2)(screen, state->m_legacy_gfx, | |
| 136 | SCREEN_UPDATE_NAME(apple2)(screen, state->m_legacy_gfx, | |
| 137 | 137 | } |
| 138 | 138 | |
| 139 | 139 | if ((beamy < (BORDER_TOP+4)) || (beamy >= (192+4+BORDER_TOP))) |
| r13798 | r13799 | |
|---|---|---|
| 15 | 15 | |
| 16 | 16 | bool pc8401a_state::screen_update(screen_device &screen, bitmap_t &bitmap, const rectangle &cliprect) |
| 17 | 17 | { |
| 18 | m_lcdc->update_screen(&bitmap, | |
| 18 | m_lcdc->update_screen(&bitmap, | |
| 19 | 19 | |
| 20 | 20 | return 0; |
| 21 | 21 | } |
| r13798 | r13799 | |
| 28 | 28 | |
| 29 | 29 | bool pc8500_state::screen_update(screen_device &screen, bitmap_t &bitmap, const rectangle &cliprect) |
| 30 | 30 | { |
| 31 | m_lcdc->update_screen(&bitmap, | |
| 31 | m_lcdc->update_screen(&bitmap, | |
| 32 | 32 | |
| 33 | 33 | /* |
| 34 | 34 | if (strcmp(screen.tag(), SCREEN_TAG) == 0) |
| 35 | 35 | { |
| 36 | sed1330_update(m_lcdc, &bitmap, | |
| 36 | sed1330_update(m_lcdc, &bitmap, | |
| 37 | 37 | } |
| 38 | 38 | else |
| 39 | 39 | { |
| 40 | m_crtc->update(&bitmap, | |
| 40 | m_crtc->update(&bitmap, | |
| 41 | 41 | } |
| 42 | 42 | */ |
| 43 | 43 |
| r13798 | r13799 | |
|---|---|---|
| 494 | 494 | /* |
| 495 | 495 | Video refresh |
| 496 | 496 | */ |
| 497 | void vdt911_refresh(device_t *device, bitmap_t *bitmap, int x, int y) | |
| 497 | void vdt911_refresh(device_t *device, bitmap_t *bitmap, const rectangle &cliprect, int x, int y) | |
| 498 | 498 | { |
| 499 | 499 | vdt_t *vdt = get_safe_token(device); |
| 500 | 500 | const gfx_element *gfx = device->machine().gfx[vdt->model]; |
| r13798 | r13799 | |
| 538 | 538 | |
| 539 | 539 | address++; |
| 540 | 540 | |
| 541 | drawgfx_opaque(bitmap, | |
| 541 | drawgfx_opaque(bitmap, cliprect, gfx, cur_char, color, 0, 0, | |
| 542 | 542 | x+j*7, y+i*10); |
| 543 | 543 | } |
| 544 | 544 | } |
| r13798 | r13799 | |
|---|---|---|
| 53 | 53 | READ8_DEVICE_HANDLER(vdt911_cru_r); |
| 54 | 54 | WRITE8_DEVICE_HANDLER(vdt911_cru_w); |
| 55 | 55 | |
| 56 | void vdt911_refresh(device_t *device, bitmap_t *bitmap, int x, int y); | |
| 56 | void vdt911_refresh(device_t *device, bitmap_t *bitmap, const rectangle &cliprect, int x, int y); | |
| 57 | 57 | |
| 58 | 58 | void vdt911_keyboard(device_t *device); |
| 59 | 59 |
| r13798 | r13799 | |
|---|---|---|
| 36 | 36 | for(x = 0; x < 64; x++ ) |
| 37 | 37 | { |
| 38 | 38 | int code = space->read_byte(AC1_VIDEO_MEMORY + x + y*64); |
| 39 | drawgfx_opaque(bitmap, | |
| 39 | drawgfx_opaque(bitmap, cliprect, screen.machine().gfx[0], code , 0, 0,0, 63*6-x*6,15*8-y*8); | |
| 40 | 40 | } |
| 41 | 41 | } |
| 42 | 42 | return 0; |
| r13798 | r13799 | |
| 52 | 52 | for(x = 0; x < 64; x++ ) |
| 53 | 53 | { |
| 54 | 54 | int code = space->read_byte(AC1_VIDEO_MEMORY + x + y*64); |
| 55 | drawgfx_opaque(bitmap, | |
| 55 | drawgfx_opaque(bitmap, cliprect, screen.machine().gfx[0], code , 0, 0,0, 63*6-x*6,31*8-y*8); | |
| 56 | 56 | } |
| 57 | 57 | } |
| 58 | 58 | return 0; |
| r13798 | r13799 | |
|---|---|---|
| 136 | 136 | int color[4]; |
| 137 | 137 | running_machine &machine = screen.machine(); |
| 138 | 138 | |
| 139 | bitmap->fill(11, | |
| 139 | bitmap->fill(11, | |
| 140 | 140 | |
| 141 | 141 | /* HJB: we cannot initialize array with values from other arrays, thus... */ |
| 142 | 142 | color[0] = pocketc_colortable[PC1350_CONTRAST][0]; |
| r13798 | r13799 | |
|---|---|---|
| 403 | 403 | return ((input_port_read(machine(), "LK") >> 5) & 0x03) << 11; |
| 404 | 404 | } |
| 405 | 405 | |
| 406 | void pc1512_state::draw_alpha(mc6845_device *device, bitmap_t *bitmap, const rectangle | |
| 406 | void 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) | |
| 407 | 407 | { |
| 408 | 408 | offs_t char_rom_offset = get_char_rom_offset(); |
| 409 | 409 | UINT16 *p = &bitmap->pix16(y + VFP_HIRES, HFP_HIRES); |
| r13798 | r13799 | |
| 472 | 472 | return color; |
| 473 | 473 | }; |
| 474 | 474 | |
| 475 | void pc1512_state::draw_graphics_1(mc6845_device *device, bitmap_t *bitmap, const rectangle | |
| 475 | void 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) | |
| 476 | 476 | { |
| 477 | 477 | if (y > 199) return; |
| 478 | 478 | |
| r13798 | r13799 | |
| 492 | 492 | } |
| 493 | 493 | } |
| 494 | 494 | |
| 495 | void pc1512_state::draw_graphics_2(mc6845_device *device, bitmap_t *bitmap, const rectangle | |
| 495 | void 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) | |
| 496 | 496 | { |
| 497 | 497 | if (y > 199) return; |
| 498 | 498 | |
| r13798 | r13799 | |
| 612 | 612 | break; |
| 613 | 613 | } |
| 614 | 614 | |
| 615 | m_vdu->update(&bitmap, | |
| 615 | m_vdu->update(&bitmap, | |
| 616 | 616 | } |
| 617 | 617 | else |
| 618 | 618 | { |
| r13798 | r13799 | |
|---|---|---|
| 214 | 214 | { |
| 215 | 215 | int y; |
| 216 | 216 | |
| 217 | bitmap->fill(get_black_pen(screen.machine()), | |
| 217 | bitmap->fill(get_black_pen(screen.machine()), | |
| 218 | 218 | |
| 219 | 219 | /* loop over rows and copy to the destination */ |
| 220 | for( y = cliprect | |
| 220 | for( y = cliprect. | |
| 221 | 221 | { |
| 222 | 222 | UINT32 *src = &pNVID->base[1344 * y]; |
| 223 | UINT16 *dest = &bitmap->pix16(y, cliprect | |
| 223 | UINT16 *dest = &bitmap->pix16(y, cliprect. | |
| 224 | 224 | int x; |
| 225 | 225 | |
| 226 | 226 | /* loop over columns */ |
| 227 | for( x = cliprect | |
| 227 | for( x = cliprect. | |
| 228 | 228 | { |
| 229 | 229 | UINT32 nPix = *src++; |
| 230 | 230 | *dest++ = ( ( nPix & 0x00f80000 ) >> 9 ) | ( ( nPix & 0x0000f800 ) >> 6 ) | ( ( nPix & 0x000000f8 ) >> 3 ); |
| r13798 | r13799 | |
|---|---|---|
| 53 | 53 | int offs; |
| 54 | 54 | mz_state *mz = screen.machine().driver_data<mz_state>(); |
| 55 | 55 | |
| 56 | bitmap->fill(get_black_pen(screen.machine()), | |
| 56 | bitmap->fill(get_black_pen(screen.machine()), | |
| 57 | 57 | |
| 58 | 58 | for(offs = 0; offs < 40*25; offs++) |
| 59 | 59 | { |
| r13798 | r13799 | |
| 88 | 88 | UINT8 *videoram = state->m_videoram; |
| 89 | 89 | mz_state *mz = screen.machine().driver_data<mz_state>(); |
| 90 | 90 | |
| 91 | bitmap->fill(get_black_pen(screen.machine()), | |
| 91 | bitmap->fill(get_black_pen(screen.machine()), | |
| 92 | 92 | |
| 93 | 93 | if (mz->m_mz700_mode) |
| 94 | 94 | return SCREEN_UPDATE_CALL(mz700); |
| r13798 | r13799 | |
|---|---|---|
| 58 | 58 | // screen update |
| 59 | 59 | //------------------------------------------------- |
| 60 | 60 | |
| 61 | void abc800c_state::hr_update(bitmap_t *bitmap, const rectangle | |
| 61 | void abc800c_state::hr_update(bitmap_t *bitmap, const rectangle &cliprect) | |
| 62 | 62 | { |
| 63 | 63 | UINT16 addr = 0; |
| 64 | 64 | int sx, y, dot; |
| 65 | 65 | |
| 66 | for (y = m_hrs; y < MIN(cliprect | |
| 66 | for (y = m_hrs; y < MIN(cliprect. | |
| 67 | 67 | { |
| 68 | 68 | int x = 0; |
| 69 | 69 | |
| r13798 | r13799 | |
| 111 | 111 | bitmap.fill(get_black_pen(machine()), cliprect); |
| 112 | 112 | |
| 113 | 113 | // draw HR graphics |
| 114 | hr_update(&bitmap, | |
| 114 | hr_update(&bitmap, | |
| 115 | 115 | |
| 116 | 116 | if (!BIT(m_fgctl, 7)) |
| 117 | 117 | { |
| 118 | 118 | // draw text |
| 119 | //saa5050_update(m_trom, &bitmap, | |
| 119 | //saa5050_update(m_trom, &bitmap, | |
| 120 | 120 | } |
| 121 | 121 | |
| 122 | 122 | return 0; |
| r13798 | r13799 | |
| 179 | 179 | // screen update |
| 180 | 180 | //------------------------------------------------- |
| 181 | 181 | |
| 182 | void abc800m_state::hr_update(bitmap_t *bitmap, const rectangle | |
| 182 | void abc800m_state::hr_update(bitmap_t *bitmap, const rectangle &cliprect) | |
| 183 | 183 | { |
| 184 | 184 | UINT16 addr = 0; |
| 185 | 185 | int sx, y, dot; |
| 186 | 186 | |
| 187 | for (y = m_hrs + VERTICAL_PORCH_HACK; y < MIN(cliprect | |
| 187 | for (y = m_hrs + VERTICAL_PORCH_HACK; y < MIN(cliprect. | |
| 188 | 188 | { |
| 189 | 189 | int x = HORIZONTAL_PORCH_HACK; |
| 190 | 190 | |
| r13798 | r13799 | |
| 283 | 283 | bitmap.fill(get_black_pen(machine()), cliprect); |
| 284 | 284 | |
| 285 | 285 | // draw HR graphics |
| 286 | hr_update(&bitmap, | |
| 286 | hr_update(&bitmap, | |
| 287 | 287 | |
| 288 | 288 | if (!BIT(m_fgctl, 7)) |
| 289 | 289 | { |
| 290 | 290 | // draw text |
| 291 | m_crtc->update(&bitmap, | |
| 291 | m_crtc->update(&bitmap, | |
| 292 | 292 | } |
| 293 | 293 | |
| 294 | 294 | return 0; |
| r13798 | r13799 | |
|---|---|---|
| 446 | 446 | if (y+1<bitmap->height()) { |
| 447 | 447 | state->m_bg[y+1][x>>3]|=b>>(x&7); |
| 448 | 448 | state->m_bg[y+1][(x>>3)+1]|=b<<(8-(x&7)); |
| 449 | drawgfx_opaque(bitmap, | |
| 449 | drawgfx_opaque(bitmap, bitmap->cliprect(), machine.gfx[0], b,colour, | |
| 450 | 450 | 0,0,x,y); |
| 451 | drawgfx_opaque(bitmap, | |
| 451 | drawgfx_opaque(bitmap, bitmap->cliprect(), machine.gfx[0], b,colour, | |
| 452 | 452 | 0,0,x,y+1); |
| 453 | 453 | } |
| 454 | 454 | } |
| r13798 | r13799 | |
| 461 | 461 | state->m_bg[y][x>>3]|=b>>(x&7); |
| 462 | 462 | state->m_bg[y][(x>>3)+1]|=b<<(8-(x&7)); |
| 463 | 463 | |
| 464 | drawgfx_opaque(bitmap, | |
| 464 | drawgfx_opaque(bitmap, bitmap->cliprect(), machine.gfx[0], b,colour, | |
| 465 | 465 | 0,0,x,y); |
| 466 | 466 | } |
| 467 | 467 | } |
| r13798 | r13799 | |
|---|---|---|
| 100 | 100 | SCREEN_UPDATE( aquarius ) |
| 101 | 101 | { |
| 102 | 102 | aquarius_state *state = screen.machine().driver_data<aquarius_state>(); |
| 103 | tilemap_draw(bitmap, | |
| 103 | tilemap_draw(bitmap, cliprect, state->m_tilemap, 0, 0); | |
| 104 | 104 | |
| 105 | 105 | return 0; |
| 106 | 106 | } |
| r13798 | r13799 | |
|---|---|---|
| 240 | 240 | } |
| 241 | 241 | |
| 242 | 242 | |
| 243 | static void cgenie_refresh_monitor(running_machine &machine, bitmap_t * bitmap, const rectangle | |
| 243 | static void cgenie_refresh_monitor(running_machine &machine, bitmap_t * bitmap, const rectangle &cliprect) | |
| 244 | 244 | { |
| 245 | 245 | cgenie_state *state = machine.driver_data<cgenie_state>(); |
| 246 | 246 | UINT8 *videoram = state->m_videoram; |
| 247 | 247 | int i, address, offset, cursor, size, code, x, y; |
| 248 | 248 | rectangle r; |
| 249 | 249 | |
| 250 | bitmap->fill(get_black_pen(machine), | |
| 250 | bitmap->fill(get_black_pen(machine), | |
| 251 | 251 | |
| 252 | 252 | if(state->m_crt.vertical_displayed || state->m_crt.horizontal_displayed) |
| 253 | 253 | { |
| r13798 | r13799 | |
| 274 | 274 | { |
| 275 | 275 | /* get graphics code */ |
| 276 | 276 | code = videoram[i]; |
| 277 | drawgfx_opaque(bitmap, | |
| 277 | drawgfx_opaque(bitmap, | |
| 278 | 278 | 0, 0, r.min_x, r.min_y); |
| 279 | 279 | } |
| 280 | 280 | else |
| r13798 | r13799 | |
| 284 | 284 | |
| 285 | 285 | /* translate defined character sets */ |
| 286 | 286 | code += state->m_font_offset[(code >> 6) & 3]; |
| 287 | drawgfx_opaque(bitmap, | |
| 287 | drawgfx_opaque(bitmap, | |
| 288 | 288 | 0, 0, r.min_x, r.min_y); |
| 289 | 289 | } |
| 290 | 290 | |
| r13798 | r13799 | |
| 313 | 313 | rc.max_x = r.max_x; |
| 314 | 314 | rc.min_y = r.min_y + (state->m_crt.cursor_top & 15); |
| 315 | 315 | rc.max_y = r.min_y + (state->m_crt.cursor_bottom & 15); |
| 316 | drawgfx_opaque(bitmap, | |
| 316 | drawgfx_opaque(bitmap, | |
| 317 | 317 | 0, 0, rc.min_x, rc.min_y); |
| 318 | 318 | } |
| 319 | 319 | } |
| 320 | 320 | } |
| 321 | 321 | } |
| 322 | 322 | |
| 323 | static void cgenie_refresh_tv_set(running_machine &machine, bitmap_t * bitmap, const rectangle | |
| 323 | static void cgenie_refresh_tv_set(running_machine &machine, bitmap_t * bitmap, const rectangle &cliprect) | |
| 324 | 324 | { |
| 325 | 325 | cgenie_state *state = machine.driver_data<cgenie_state>(); |
| 326 | 326 | UINT8 *videoram = state->m_videoram; |
| 327 | 327 | int i, address, offset, cursor, size, code, x, y; |
| 328 | 328 | rectangle r; |
| 329 | 329 | |
| 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); | |
| 332 | 332 | |
| 333 | 333 | if(state->m_crt.vertical_displayed || state->m_crt.horizontal_displayed) |
| 334 | 334 | { |
| r13798 | r13799 | |
| 355 | 355 | { |
| 356 | 356 | /* get graphics code */ |
| 357 | 357 | code = videoram[i]; |
| 358 | drawgfx_opaque(machine.generic.tmpbitmap, | |
| 358 | drawgfx_opaque(machine.generic.tmpbitmap, | |
| 359 | 359 | 0, 0, r.min_x, r.min_y); |
| 360 | drawgfx_opaque(state->m_dlybitmap, | |
| 360 | drawgfx_opaque(state->m_dlybitmap, | |
| 361 | 361 | 0, 0, r.min_x, r.min_y); |
| 362 | 362 | } |
| 363 | 363 | else |
| r13798 | r13799 | |
| 367 | 367 | |
| 368 | 368 | /* translate defined character sets */ |
| 369 | 369 | code += state->m_font_offset[(code >> 6) & 3]; |
| 370 | drawgfx_opaque(machine.generic.tmpbitmap, | |
| 370 | drawgfx_opaque(machine.generic.tmpbitmap, | |
| 371 | 371 | 0, 0, r.min_x, r.min_y); |
| 372 | drawgfx_opaque(state->m_dlybitmap, | |
| 372 | drawgfx_opaque(state->m_dlybitmap, | |
| 373 | 373 | 0, 0, r.min_x, r.min_y); |
| 374 | 374 | } |
| 375 | 375 | |
| r13798 | r13799 | |
| 399 | 399 | rc.min_y = r.min_y + (state->m_crt.cursor_top & 15); |
| 400 | 400 | rc.max_y = r.min_y + (state->m_crt.cursor_bottom & 15); |
| 401 | 401 | |
| 402 | drawgfx_opaque(machine.generic.tmpbitmap, | |
| 402 | drawgfx_opaque(machine.generic.tmpbitmap, | |
| 403 | 403 | 0, 0, rc.min_x, rc.min_y); |
| 404 | drawgfx_opaque(state->m_dlybitmap, | |
| 404 | drawgfx_opaque(state->m_dlybitmap, | |
| 405 | 405 | 0, 0, rc.min_x, rc.min_y); |
| 406 | 406 | } |
| 407 | 407 | } |
| r13798 | r13799 | |
|---|---|---|
| 75 | 75 | // update_screen - |
| 76 | 76 | //------------------------------------------------- |
| 77 | 77 | |
| 78 | void abc80_state::update_screen(bitmap_t *bitmap, const rectangle | |
| 78 | void abc80_state::update_screen(bitmap_t *bitmap, const rectangle &cliprect) | |
| 79 | 79 | { |
| 80 | 80 | int c = 0; |
| 81 | 81 | int r = 0; |
| r13798 | r13799 | |
| 222 | 222 | |
| 223 | 223 | bool abc80_state::screen_update(screen_device &screen, bitmap_t &bitmap, const rectangle &cliprect) |
| 224 | 224 | { |
| 225 | update_screen(&bitmap, | |
| 225 | update_screen(&bitmap, | |
| 226 | 226 | |
| 227 | 227 | return 0; |
| 228 | 228 | } |
| r13798 | r13799 | |
|---|---|---|
| 996 | 996 | sx += state->m_sprite_shift; |
| 997 | 997 | |
| 998 | 998 | if(state->m_crtc.interlace != 0) |
| 999 | drawgfxzoom_transpen(bitmap, | |
| 999 | drawgfxzoom_transpen(bitmap, | |
| 1000 | 1000 | else |
| 1001 | drawgfx_transpen(bitmap, | |
| 1001 | drawgfx_transpen(bitmap, | |
| 1002 | 1002 | } |
| 1003 | 1003 | } |
| 1004 | 1004 | } |
| r13798 | r13799 | |
| 1137 | 1137 | } |
| 1138 | 1138 | // rect.max_x=state->m_crtc.width; |
| 1139 | 1139 | // rect.max_y=state->m_crtc.height; |
| 1140 | bitmap->fill(0, | |
| 1140 | bitmap->fill(0, | |
| 1141 | 1141 | |
| 1142 | 1142 | if(state->m_sysport.contrast == 0) // if monitor contrast is 0, then don't bother displaying anything |
| 1143 | 1143 | return 0; |
| r13798 | r13799 | |
| 1149 | 1149 | rect.max_x=state->m_crtc.hend; |
| 1150 | 1150 | rect.max_y=state->m_crtc.vend; |
| 1151 | 1151 | |
| 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; | |
| 1156 | 1156 | |
| 1157 | 1157 | // update tiles |
| 1158 | 1158 | //rom = screen.machine().region("user1")->base(); |
| r13798 | r13799 | |
| 1186 | 1186 | { |
| 1187 | 1187 | tilemap_set_scrollx(x68k_bg0,0,(state->m_spritereg[0x402] - state->m_crtc.hbegin) & 0x3ff); |
| 1188 | 1188 | tilemap_set_scrolly(x68k_bg0,0,(state->m_spritereg[0x403] - state->m_crtc.vbegin) & 0x3ff); |
| 1189 | tilemap_draw(bitmap, | |
| 1189 | tilemap_draw(bitmap, | |
| 1190 | 1190 | } |
| 1191 | 1191 | else |
| 1192 | 1192 | { |
| 1193 | 1193 | tilemap_set_scrollx(x68k_bg1,0,(state->m_spritereg[0x402] - state->m_crtc.hbegin) & 0x3ff); |
| 1194 | 1194 | tilemap_set_scrolly(x68k_bg1,0,(state->m_spritereg[0x403] - state->m_crtc.vbegin) & 0x3ff); |
| 1195 | tilemap_draw(bitmap, | |
| 1195 | tilemap_draw(bitmap, | |
| 1196 | 1196 | } |
| 1197 | 1197 | } |
| 1198 | 1198 | x68k_draw_sprites(screen.machine(),bitmap,2,rect); |
| r13798 | r13799 | |
| 1202 | 1202 | { |
| 1203 | 1203 | tilemap_set_scrollx(x68k_bg0,0,(state->m_spritereg[0x400] - state->m_crtc.hbegin) & 0x3ff); |
| 1204 | 1204 | tilemap_set_scrolly(x68k_bg0,0,(state->m_spritereg[0x401] - state->m_crtc.vbegin) & 0x3ff); |
| 1205 | tilemap_draw(bitmap, | |
| 1205 | tilemap_draw(bitmap, | |
| 1206 | 1206 | } |
| 1207 | 1207 | else |
| 1208 | 1208 | { |
| 1209 | 1209 | tilemap_set_scrollx(x68k_bg1,0,(state->m_spritereg[0x400] - state->m_crtc.hbegin) & 0x3ff); |
| 1210 | 1210 | tilemap_set_scrolly(x68k_bg1,0,(state->m_spritereg[0x401] - state->m_crtc.vbegin) & 0x3ff); |
| 1211 | tilemap_draw(bitmap, | |
| 1211 | tilemap_draw(bitmap, | |
| 1212 | 1212 | } |
| 1213 | 1213 | } |
| 1214 | 1214 | x68k_draw_sprites(screen.machine(),bitmap,3,rect); |
| r13798 | r13799 | |
|---|---|---|
| 37 | 37 | for(x = 0; x < 64; x++ ) |
| 38 | 38 | { |
| 39 | 39 | int code = space->read_byte(KRAMERMC_VIDEO_MEMORY + x + y*64); |
| 40 | drawgfx_opaque(bitmap, | |
| 40 | drawgfx_opaque(bitmap, cliprect, screen.machine().gfx[0], code , 0, 0,0, x*8,y*8); | |
| 41 | 41 | } |
| 42 | 42 | } |
| 43 | 43 | return 0; |
| r13798 | r13799 | |
|---|---|---|
| 650 | 650 | } |
| 651 | 651 | |
| 652 | 652 | |
| 653 | void crtc_ega_update(device_t *device, bitmap_t *bitmap, const rectangle | |
| 653 | void crtc_ega_update(device_t *device, bitmap_t *bitmap, const rectangle &cliprect) | |
| 654 | 654 | { |
| 655 | 655 | crtc_ega_t *crtc_ega = get_safe_token(device); |
| 656 | 656 | assert(bitmap != NULL); |
| 657 | assert(cliprect != NULL); | |
| 658 | 657 | |
| 659 | 658 | if (crtc_ega->has_valid_parameters) |
| 660 | 659 | { |
| r13798 | r13799 | |
| 669 | 668 | if (crtc_ega->intf->begin_update != NULL) |
| 670 | 669 | param = crtc_ega->intf->begin_update(device, bitmap, cliprect); |
| 671 | 670 | |
| 672 | if (cliprect | |
| 671 | if (cliprect. | |
| 673 | 672 | { |
| 674 | 673 | /* read the start address at the beginning of the frame */ |
| 675 | 674 | crtc_ega->current_disp_addr = crtc_ega->disp_start_addr; |
| r13798 | r13799 | |
| 679 | 678 | } |
| 680 | 679 | |
| 681 | 680 | /* for each row in the visible region */ |
| 682 | for (y = cliprect | |
| 681 | for (y = cliprect. | |
| 683 | 682 | { |
| 684 | 683 | /* compute the current raster line */ |
| 685 | 684 | UINT8 ra = y % (crtc_ega->max_ras_addr + 1); |
| r13798 | r13799 | |
|---|---|---|
| 205 | 205 | /* write a single char on screen */ |
| 206 | 206 | static void tx0_draw_char(running_machine &machine, bitmap_t *bitmap, char character, int x, int y, int color) |
| 207 | 207 | { |
| 208 | drawgfx_transpen(bitmap, | |
| 208 | drawgfx_transpen(bitmap, bitmap->cliprect(), machine.gfx[0], character-32, color, 0, 0, | |
| 209 | 209 | x+1, y, 0); |
| 210 | 210 | } |
| 211 | 211 |
| r13798 | r13799 | |
|---|---|---|
| 15 | 15 | MCFG_DEVICE_CONFIG(_intrf) |
| 16 | 16 | |
| 17 | 17 | /* callback definitions */ |
| 18 | typedef 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) | |
| 18 | typedef 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) | |
| 20 | 20 | |
| 21 | 21 | typedef void (*crtc_ega_update_row_func)(device_t *device, bitmap_t *bitmap, |
| 22 | const rectangle | |
| 22 | const rectangle &cliprect, UINT16 ma, UINT8 ra, | |
| 23 | 23 | UINT16 y, UINT8 x_count, INT8 cursor_x, void *param); |
| 24 | 24 | #define CRTC_EGA_UPDATE_ROW(name) void name(device_t *device, bitmap_t *bitmap, \ |
| 25 | const rectangle | |
| 25 | const rectangle &cliprect, UINT16 ma, UINT8 ra, \ | |
| 26 | 26 | UINT16 y, UINT8 x_count, INT8 cursor_x, void *param) |
| 27 | 27 | |
| 28 | typedef 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) | |
| 28 | typedef 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) | |
| 30 | 30 | |
| 31 | 31 | typedef void (*crtc_ega_on_de_changed_func)(device_t *device, int display_enabled); |
| 32 | 32 | #define CRTC_EGA_ON_DE_CHANGED(name) void name(device_t *device, int display_enabled) |
| r13798 | r13799 | |
| 102 | 102 | /* updates the screen -- this will call begin_update(), |
| 103 | 103 | followed by update_row() reapeatedly and after all row |
| 104 | 104 | updating is complete, end_update() */ |
| 105 | void crtc_ega_update(device_t *device, bitmap_t *bitmap, const rectangle | |
| 105 | void crtc_ega_update(device_t *device, bitmap_t *bitmap, const rectangle &cliprect); | |
| 106 | 106 | |
| 107 | 107 | |
| 108 | 108 | #endif |
| r13798 | r13799 | |
|---|---|---|
| 112 | 112 | bool mm1_state::screen_update(screen_device &screen, bitmap_t &bitmap, const rectangle &cliprect) |
| 113 | 113 | { |
| 114 | 114 | /* 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); | |
| 117 | 117 | |
| 118 | 118 | /* graphics */ |
| 119 | m_hgdc->update_screen(&bitmap, | |
| 119 | m_hgdc->update_screen(&bitmap, | |
| 120 | 120 | |
| 121 | 121 | return 0; |
| 122 | 122 | } |
| r13798 | r13799 | |
|---|---|---|
| 76 | 76 | { |
| 77 | 77 | for (x=0;x<40;x++, i++) |
| 78 | 78 | { |
| 79 | drawgfx_opaque(bitmap, | |
| 79 | drawgfx_opaque(bitmap, cliprect,screen.machine().gfx[state->m_font], | |
| 80 | 80 | videoram[i], 0, 0, 0, 8*x,8*y); |
| 81 | 81 | } |
| 82 | 82 | } |
| r13798 | r13799 | |
|---|---|---|
| 196 | 196 | rect.max_x = PCW_PRINTER_WIDTH - 1; |
| 197 | 197 | rect.max_y = PCW_PRINTER_HEIGHT - 1; |
| 198 | 198 | feed = -(state->m_paper_feed / 2); |
| 199 | copyscrollbitmap(bitmap,state->m_prn_output,0,NULL,1,&feed, | |
| 199 | copyscrollbitmap(bitmap,state->m_prn_output,0,NULL,1,&feed, | |
| 200 | 200 | bitmap->pix16(PCW_PRINTER_HEIGHT-1, state->m_printer_headpos) = 0; |
| 201 | 201 | bitmap->pix16(PCW_PRINTER_HEIGHT-2, state->m_printer_headpos) = 0; |
| 202 | 202 | bitmap->pix16(PCW_PRINTER_HEIGHT-3, state->m_printer_headpos) = 0; |
| r13798 | r13799 | |
|---|---|---|
| 1542 | 1542 | // update_text - |
| 1543 | 1543 | //------------------------------------------------- |
| 1544 | 1544 | |
| 1545 | void upd7220_device::update_text(bitmap_t *bitmap, const rectangle | |
| 1545 | void upd7220_device::update_text(bitmap_t *bitmap, const rectangle &cliprect) | |
| 1546 | 1546 | { |
| 1547 | 1547 | UINT32 addr, sad; |
| 1548 | 1548 | UINT16 len; |
| r13798 | r13799 | |
| 1588 | 1588 | // update_graphics - |
| 1589 | 1589 | //------------------------------------------------- |
| 1590 | 1590 | |
| 1591 | void upd7220_device::update_graphics(bitmap_t *bitmap, const rectangle | |
| 1591 | void upd7220_device::update_graphics(bitmap_t *bitmap, const rectangle &cliprect, int force_bitmap) | |
| 1592 | 1592 | { |
| 1593 | 1593 | UINT32 addr, sad; |
| 1594 | 1594 | UINT16 len; |
| r13798 | r13799 | |
| 1629 | 1629 | // update_screen - |
| 1630 | 1630 | //------------------------------------------------- |
| 1631 | 1631 | |
| 1632 | void upd7220_device::update_screen(bitmap_t *bitmap, const rectangle | |
| 1632 | void upd7220_device::update_screen(bitmap_t *bitmap, const rectangle &cliprect) | |
| 1633 | 1633 | { |
| 1634 | 1634 | if (m_de) |
| 1635 | 1635 | { |
| r13798 | r13799 | |
|---|---|---|
| 1949 | 1949 | } |
| 1950 | 1950 | } |
| 1951 | 1951 | |
| 1952 | UINT32 vic3_video_update( device_t *device, bitmap_t *bitmap, const rectangle | |
| 1952 | UINT32 vic3_video_update( device_t *device, bitmap_t *bitmap, const rectangle &cliprect ) | |
| 1953 | 1953 | { |
| 1954 | 1954 | vic3_state *vic3 = get_safe_token(device); |
| 1955 | 1955 |
| r13798 | r13799 | |
|---|---|---|
| 109 | 109 | DECLARE_READ8_MEMBER( vram_r ); |
| 110 | 110 | DECLARE_WRITE8_MEMBER( vram_w ); |
| 111 | 111 | |
| 112 | void update_screen(bitmap_t *bitmap, const rectangle | |
| 112 | void update_screen(bitmap_t *bitmap, const rectangle &cliprect); | |
| 113 | 113 | virtual const rom_entry *device_rom_region() const; |
| 114 | 114 | virtual const address_space_config *memory_space_config(address_spacenum spacenum = AS_0) const; |
| 115 | 115 | |
| r13798 | r13799 | |
| 150 | 150 | void draw_char(int x, int y); |
| 151 | 151 | int translate_command(UINT8 data); |
| 152 | 152 | void process_fifo(); |
| 153 | void update_text(bitmap_t *bitmap, const rectangle | |
| 153 | void update_text(bitmap_t *bitmap, const rectangle &cliprect); | |
| 154 | 154 | void draw_graphics_line(bitmap_t *bitmap, UINT32 addr, int y, int wd); |
| 155 | void update_graphics(bitmap_t *bitmap, const rectangle | |
| 155 | void update_graphics(bitmap_t *bitmap, const rectangle &cliprect, int force_bitmap); | |
| 156 | 156 | |
| 157 | 157 | devcb_resolved_write_line m_out_drq_func; |
| 158 | 158 | devcb_resolved_write_line m_out_hsync_func; |
| r13798 | r13799 | |
|---|---|---|
| 154 | 154 | int x, y, i, j; |
| 155 | 155 | int color[3]; |
| 156 | 156 | |
| 157 | bitmap->fill(11, | |
| 157 | bitmap->fill(11, | |
| 158 | 158 | |
| 159 | 159 | /* HJB: we cannot initialize array with values from other arrays, thus... */ |
| 160 | 160 | color[0] = 7; // pocketc_colortable[CONTRAST][0]; |
| r13798 | r13799 | |
| 165 | 165 | { |
| 166 | 166 | for (x=state->m_RIGHT, y=state->m_DOWN, i=0; i<6*5; x+=2) { |
| 167 | 167 | for (j=0; j<5; j++, i++, x+=2) |
| 168 | drawgfx_opaque(bitmap, | |
| 168 | drawgfx_opaque(bitmap, cliprect, screen.machine().gfx[0], state->m_reg[i],CONTRAST,0,0, | |
| 169 | 169 | x,y); |
| 170 | 170 | } |
| 171 | 171 | for (i=9*5; i<12*5; x+=2) |
| 172 | 172 | { |
| 173 | 173 | for (j=0; j<5; j++, i++, x+=2) |
| 174 | drawgfx_opaque(bitmap, | |
| 174 | drawgfx_opaque(bitmap, cliprect, screen.machine().gfx[0], state->m_reg[i],CONTRAST,0,0, | |
| 175 | 175 | x,y); |
| 176 | 176 | } |
| 177 | 177 | for (i=6*5; i<9*5; x+=2) |
| 178 | 178 | { |
| 179 | 179 | for (j=0; j<5; j++, i++, x+=2) |
| 180 | drawgfx_opaque(bitmap, | |
| 180 | drawgfx_opaque(bitmap, cliprect, screen.machine().gfx[0], state->m_reg[i],CONTRAST,0,0, | |
| 181 | 181 | x,y); |
| 182 | 182 | } |
| 183 | 183 | for (i=0x7b-3*5; i>0x7b-6*5; x+=2) |
| 184 | 184 | { |
| 185 | 185 | for (j=0; j<5; j++, i--, x+=2) |
| 186 | drawgfx_opaque(bitmap, | |
| 186 | drawgfx_opaque(bitmap, cliprect, screen.machine().gfx[0], state->m_reg[i],CONTRAST,0,0, | |
| 187 | 187 | x,y); |
| 188 | 188 | } |
| 189 | 189 | for (i=0x7b; i>0x7b-3*5; x+=2) |
| 190 | 190 | { |
| 191 | 191 | for (j=0; j<5; j++, i--, x+=2) |
| 192 | drawgfx_opaque(bitmap, | |
| 192 | drawgfx_opaque(bitmap, cliprect, screen.machine().gfx[0], state->m_reg[i],CONTRAST,0,0, | |
| 193 | 193 | x,y); |
| 194 | 194 | } |
| 195 | 195 | for (i=0x7b-6*5; i>0x7b-12*5; x+=2) |
| 196 | 196 | { |
| 197 | 197 | for (j=0; j<5; j++, i--, x+=2) |
| 198 | drawgfx_opaque(bitmap, | |
| 198 | drawgfx_opaque(bitmap, cliprect, screen.machine().gfx[0], state->m_reg[i],CONTRAST,0,0, | |
| 199 | 199 | x,y); |
| 200 | 200 | } |
| 201 | 201 | } |
| r13798 | r13799 | |
|---|---|---|
| 37 | 37 | for(x = 0; x < 48; x++ ) |
| 38 | 38 | { |
| 39 | 39 | int code = state->m_video_ram[15 + x + y*64]; |
| 40 | drawgfx_opaque(bitmap, | |
| 40 | drawgfx_opaque(bitmap, cliprect, screen.machine().gfx[0], code , 0, 0,0, x*8,y*8); | |
| 41 | 41 | } |
| 42 | 42 | } |
| 43 | 43 | return 0; |
| r13798 | r13799 | |
|---|---|---|
| 134 | 134 | |
| 135 | 135 | bool v1050_state::screen_update(screen_device &screen, bitmap_t &bitmap, const rectangle &cliprect) |
| 136 | 136 | { |
| 137 | m_crtc->update(&bitmap, | |
| 137 | m_crtc->update(&bitmap, | |
| 138 | 138 | |
| 139 | 139 | return 0; |
| 140 | 140 | } |
| r13798 | r13799 | |
|---|---|---|
| 67 | 67 | int x = 0; |
| 68 | 68 | int pal[16]; |
| 69 | 69 | int scanline = screen.vpos(); |
| 70 | rectangle r = | |
| 70 | rectangle r = | |
| 71 | 71 | r.min_y = r.max_y = scanline; |
| 72 | 72 | |
| 73 | 73 | /* set up palette */ |
| r13798 | r13799 | |
|---|---|---|
| 151 | 151 | READ8_DEVICE_HANDLER( vic3_port_r ); |
| 152 | 152 | |
| 153 | 153 | void vic3_raster_interrupt_gen( device_t *device ); |
| 154 | UINT32 vic3_video_update( device_t *device, bitmap_t *bitmap, const rectangle | |
| 154 | UINT32 vic3_video_update( device_t *device, bitmap_t *bitmap, const rectangle &cliprect ); | |
| 155 | 155 | |
| 156 | 156 | |
| 157 | 157 | #endif /* __VIC4567_H__ */ |
| r13798 | r13799 | |
|---|---|---|
| 319 | 319 | // update_screen - |
| 320 | 320 | //------------------------------------------------- |
| 321 | 321 | |
| 322 | void zx8301_device::update_screen(bitmap_t *bitmap, const rectangle | |
| 322 | void zx8301_device::update_screen(bitmap_t *bitmap, const rectangle &cliprect) | |
| 323 | 323 | { |
| 324 | 324 | if (!m_dispoff) |
| 325 | 325 | { |
| r13798 | r13799 | |
| 341 | 341 | } |
| 342 | 342 | else |
| 343 | 343 | { |
| 344 | bitmap->fill(get_black_pen(machine()), | |
| 344 | bitmap->fill(get_black_pen(machine()), | |
| 345 | 345 | } |
| 346 | 346 | } |
| r13798 | r13799 | |
|---|---|---|
| 233 | 233 | } |
| 234 | 234 | } |
| 235 | 235 | |
| 236 | void vt_video_update(device_t *device, bitmap_t *bitmap, const rectangle | |
| 236 | void vt_video_update(device_t *device, bitmap_t *bitmap, const rectangle &cliprect) | |
| 237 | 237 | { |
| 238 | 238 | vt_video_t *vt = get_safe_token(device); |
| 239 | 239 |
| r13798 | r13799 | |
|---|---|---|
| 88 | 88 | DECLARE_READ8_MEMBER( data_r ); |
| 89 | 89 | DECLARE_WRITE8_MEMBER( data_w ); |
| 90 | 90 | |
| 91 | void update_screen(bitmap_t *bitmap, const rectangle | |
| 91 | void update_screen(bitmap_t *bitmap, const rectangle &cliprect); | |
| 92 | 92 | |
| 93 | 93 | protected: |
| 94 | 94 | // device-level overrides |
| r13798 | r13799 | |
|---|---|---|
| 90 | 90 | 0); /* flags */ |
| 91 | 91 | } |
| 92 | 92 | |
| 93 | static void terminal_draw(running_machine &machine, bitmap_t *dest, const rectangle | |
| 93 | static void terminal_draw(running_machine &machine, bitmap_t *dest, const rectangle &cliprect, terminal_t *terminal) | |
| 94 | 94 | { |
| 95 | 95 | apple1_state *state = machine.driver_data<apple1_state>(); |
| 96 | 96 | state->m_current_terminal = terminal; |
| r13798 | r13799 | |
| 396 | 396 | { |
| 397 | 397 | apple1_state *state = screen.machine().driver_data<apple1_state>(); |
| 398 | 398 | apple1_vh_cursor_blink(screen.machine()); |
| 399 | terminal_draw(screen.machine(), bitmap, | |
| 399 | terminal_draw(screen.machine(), bitmap, cliprect, state->m_terminal); | |
| 400 | 400 | return 0; |
| 401 | 401 | } |
| r13798 | r13799 | |
|---|---|---|
| 51 | 51 | |
| 52 | 52 | |
| 53 | 53 | /* screen update */ |
| 54 | void vt_video_update(device_t *device, bitmap_t *bitmap, const rectangle | |
| 54 | void vt_video_update(device_t *device, bitmap_t *bitmap, const rectangle &cliprect); | |
| 55 | 55 | |
| 56 | 56 | #endif |
| r13798 | r13799 | |
|---|---|---|
| 712 | 712 | // update |
| 713 | 713 | //------------------------------------------------- |
| 714 | 714 | |
| 715 | bool mc6847_base_device::update(bitmap_t *bitmap, const rectangle | |
| 715 | bool mc6847_base_device::update(bitmap_t *bitmap, const rectangle &cliprect) | |
| 716 | 716 | { |
| 717 | 717 | int base_x = 32; |
| 718 | 718 | int base_y = 25; |
| 719 | 719 | int x, x2, y; |
| 720 | 720 | 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; | |
| 725 | 725 | const pixel_t *palette = m_palette; |
| 726 | 726 | |
| 727 | 727 | /* if the video didn't change, indicate as much */ |
| r13798 | r13799 | |
|---|---|---|
| 18 | 18 | |
| 19 | 19 | bool tmc1800_state::screen_update(screen_device &screen, bitmap_t &bitmap, const rectangle &cliprect) |
| 20 | 20 | { |
| 21 | m_vdc->update_screen(&bitmap, | |
| 21 | m_vdc->update_screen(&bitmap, | |
| 22 | 22 | |
| 23 | 23 | return 0; |
| 24 | 24 | } |
| r13798 | r13799 | |
| 60 | 60 | |
| 61 | 61 | bool tmc2000_state::screen_update(screen_device &screen, bitmap_t &bitmap, const rectangle &cliprect) |
| 62 | 62 | { |
| 63 | m_cti->update_screen(&bitmap, | |
| 63 | m_cti->update_screen(&bitmap, | |
| 64 | 64 | |
| 65 | 65 | return 0; |
| 66 | 66 | } |
| r13798 | r13799 | |
| 87 | 87 | |
| 88 | 88 | bool nano_state::screen_update(screen_device &screen, bitmap_t &bitmap, const rectangle &cliprect) |
| 89 | 89 | { |
| 90 | m_cti->update_screen(&bitmap, | |
| 90 | m_cti->update_screen(&bitmap, | |
| 91 | 91 | |
| 92 | 92 | return 0; |
| 93 | 93 | } |
| r13798 | r13799 | |
|---|---|---|
| 496 | 496 | /* updates the screen -- this will call begin_update(), |
| 497 | 497 | followed by update_row() reapeatedly and after all row |
| 498 | 498 | updating is complete, end_update() */ |
| 499 | bool update(bitmap_t *bitmap, const rectangle | |
| 499 | bool update(bitmap_t *bitmap, const rectangle &cliprect); | |
| 500 | 500 | |
| 501 | 501 | // mode changing operations |
| 502 | 502 | DECLARE_WRITE_LINE_MEMBER( ag_w ) { change_mode(MODE_AG, state); } |
| r13798 | r13799 | |
|---|---|---|
| 17 | 17 | |
| 18 | 18 | for (sx = 0; sx < 48; sx++) |
| 19 | 19 | { |
| 20 | drawgfx_opaque (bitmap, | |
| 20 | drawgfx_opaque (bitmap, cliprect, | |
| 21 | 21 | screen.machine().gfx[0], videoram[0x03ca + sx], |
| 22 | 22 | 1, 0, 0, sx * 8, 0); |
| 23 | 23 | } |
| r13798 | r13799 | |
| 26 | 26 | { |
| 27 | 27 | for (sx = 0; sx < 48; sx++) |
| 28 | 28 | { |
| 29 | drawgfx_opaque (bitmap, | |
| 29 | drawgfx_opaque (bitmap, cliprect, | |
| 30 | 30 | screen.machine().gfx[0], videoram[0x000a + (sy * 64) + sx], |
| 31 | 31 | 1, 0, 0, sx * 8, (sy + 1) * 16); |
| 32 | 32 | } |
| r13798 | r13799 | |
| 42 | 42 | |
| 43 | 43 | for (sx = 0; sx < 48; sx++) |
| 44 | 44 | { |
| 45 | drawgfx_opaque (bitmap, | |
| 45 | drawgfx_opaque (bitmap, cliprect, | |
| 46 | 46 | screen.machine().gfx[0], videoram[0x03ca + sx], |
| 47 | 47 | 1, 0, 0, sx * 8, 0); |
| 48 | 48 | } |
| r13798 | r13799 | |
| 51 | 51 | { |
| 52 | 52 | for (sx = 0; sx < 48; sx++) |
| 53 | 53 | { |
| 54 | drawgfx_opaque (bitmap, | |
| 54 | drawgfx_opaque (bitmap, cliprect, | |
| 55 | 55 | screen.machine().gfx[0], videoram[0x000a + (sy * 64) + sx], |
| 56 | 56 | 1, 0, 0, sx * 8, (sy + 1) * 14); |
| 57 | 57 | } |
| r13798 | r13799 | |
|---|---|---|
| 163 | 163 | // device interface |
| 164 | 164 | //************************************************************************** |
| 165 | 165 | |
| 166 | int hd44780_device::video_update(bitmap_t *bitmap, const rectangle | |
| 166 | int hd44780_device::video_update(bitmap_t *bitmap, const rectangle &cliprect) | |
| 167 | 167 | { |
| 168 | 168 | assert(height*9 <= bitmap->height() && width*6 <= bitmap->width()); |
| 169 | 169 | |
| 170 | bitmap->fill(0, | |
| 170 | bitmap->fill(0, | |
| 171 | 171 | |
| 172 | 172 | if (m_display_on) |
| 173 | 173 | for (int l=0; l<height; l++) |
| r13798 | r13799 | |
|---|---|---|
| 416 | 416 | { |
| 417 | 417 | if (vdc8563->dirty[i]) |
| 418 | 418 | { |
| 419 | drawgfx_opaque(bitmap, | |
| 419 | drawgfx_opaque(bitmap, | |
| 420 | 420 | machine.gfx[0]->width * x + 8, height * y + height); |
| 421 | 421 | |
| 422 | 422 | if ((vdc8563->cursor_on) && (i == (CRTC6845_CURSOR_POS & vdc8563->mask))) |
| r13798 | r13799 | |
| 526 | 526 | k = ((i << 4) + j) & vdc8563->mask; |
| 527 | 527 | if (vdc8563->dirty[k]) |
| 528 | 528 | { |
| 529 | drawgfx_opaque(bitmap, | |
| 529 | drawgfx_opaque(bitmap, | |
| 530 | 530 | machine.gfx[0]->width * x + 8, height * y + height + j); |
| 531 | 531 | vdc8563->dirty[k] = 0; |
| 532 | 532 | } |
| r13798 | r13799 | |
| 536 | 536 | } |
| 537 | 537 | } |
| 538 | 538 | |
| 539 | UINT32 vdc8563_video_update( device_t *device, bitmap_t *bitmap, const rectangle | |
| 539 | UINT32 vdc8563_video_update( device_t *device, bitmap_t *bitmap, const rectangle &cliprect ) | |
| 540 | 540 | { |
| 541 | 541 | vdc8563_state *vdc8563 = get_safe_token(device); |
| 542 | 542 | int i; |
| r13798 | r13799 | |
|---|---|---|
| 13 | 13 | save_item(NAME(m_segment_data)); |
| 14 | 14 | } |
| 15 | 15 | |
| 16 | void newbrain_state::screen_update(bitmap_t *bitmap, const rectangle | |
| 16 | void newbrain_state::screen_update(bitmap_t *bitmap, const rectangle &cliprect) | |
| 17 | 17 | { |
| 18 | 18 | address_space *program = m_maincpu->memory().space(AS_PROGRAM); |
| 19 | 19 | |
| r13798 | r13799 | |
| 105 | 105 | { |
| 106 | 106 | if (m_enrg1 & NEWBRAIN_ENRG1_TVP) |
| 107 | 107 | { |
| 108 | screen_update(&bitmap, | |
| 108 | screen_update(&bitmap, | |
| 109 | 109 | } |
| 110 | 110 | else |
| 111 | 111 | { |
| r13798 | r13799 | |
|---|---|---|
| 43 | 43 | DECLARE_WRITE8_MEMBER(data_write); |
| 44 | 44 | DECLARE_READ8_MEMBER(data_read); |
| 45 | 45 | |
| 46 | int video_update(bitmap_t *bitmap, const rectangle | |
| 46 | int video_update(bitmap_t *bitmap, const rectangle &cliprect); | |
| 47 | 47 | |
| 48 | 48 | protected: |
| 49 | 49 | // device-level overrides |
| r13798 | r13799 | |
|---|---|---|
| 39 | 39 | /*----------- defined in video/vdc8563.c -----------*/ |
| 40 | 40 | |
| 41 | 41 | void vdc8563_set_rastering(device_t *device, int on); |
| 42 | UINT32 vdc8563_video_update(device_t *device, bitmap_t *bitmap, const rectangle | |
| 42 | UINT32 vdc8563_video_update(device_t *device, bitmap_t *bitmap, const rectangle &cliprect); | |
| 43 | 43 | |
| 44 | 44 | WRITE8_DEVICE_HANDLER( vdc8563_port_w ); |
| 45 | 45 | READ8_DEVICE_HANDLER( vdc8563_port_r ); |
| r13798 | r13799 | |
|---|---|---|
| 43 | 43 | if (code < 32) code = 32; |
| 44 | 44 | } |
| 45 | 45 | |
| 46 | drawgfxzoom_opaque (bitmap, | |
| 46 | drawgfxzoom_opaque (bitmap, cliprect, screen.machine().gfx[0], code, | |
| 47 | 47 | videoram[offs + 2048] & 0x08 ? 0 : 1, 0, 0, sx, sy, 0x20000, 0x20000); |
| 48 | 48 | |
| 49 | 49 | if (videoram[offs] & 0x80) |
| r13798 | r13799 | |
|---|---|---|
| 955 | 955 | EF9345 interface |
| 956 | 956 | **************************************************************/ |
| 957 | 957 | |
| 958 | void ef9345_device::video_update(bitmap_t *bitmap, const rectangle | |
| 958 | void ef9345_device::video_update(bitmap_t *bitmap, const rectangle &cliprect) | |
| 959 | 959 | { |
| 960 | 960 | copybitmap(bitmap, m_screen_out, 0, 0, 0, 0, cliprect); |
| 961 | 961 | } |
| r13798 | r13799 | |
|---|---|---|
| 794 | 794 | for(x=0;x<40;x++) |
| 795 | 795 | { |
| 796 | 796 | offs = current_row*64+x; |
| 797 | drawgfx_transpen(bitmap, | |
| 797 | drawgfx_transpen(bitmap, cliprect, | |
| 798 | 798 | screen.machine().gfx[1], |
| 799 | 799 | videoram[offs], |
| 800 | 800 | 7, /* white */ |
| r13798 | r13799 | |
| 805 | 805 | { |
| 806 | 806 | /* draw the cursor as a solid white block */ |
| 807 | 807 | /* (should use a filled rect here!) */ |
| 808 | drawgfx_transpen(bitmap, | |
| 808 | drawgfx_transpen(bitmap, cliprect, | |
| 809 | 809 | screen.machine().gfx[1], |
| 810 | 810 | 191, /* a block */ |
| 811 | 811 | 7, /* white */ |
| r13798 | r13799 | |
|---|---|---|
| 42 | 42 | READ8_MEMBER( data_r ); |
| 43 | 43 | WRITE8_MEMBER( data_w ); |
| 44 | 44 | void update_scanline(UINT16 scanline); |
| 45 | void video_update(bitmap_t *bitmap, const rectangle | |
| 45 | void video_update(bitmap_t *bitmap, const rectangle &cliprect); | |
| 46 | 46 | |
| 47 | 47 | protected: |
| 48 | 48 | // device-level overrides |
| r13798 | r13799 | |
|---|---|---|
| 8 | 8 | |
| 9 | 9 | bool kc85_state::screen_update(screen_device &screen, bitmap_t &bitmap, const rectangle &cliprect) |
| 10 | 10 | { |
| 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); | |
| 21 | 21 | |
| 22 | 22 | return 0; |
| 23 | 23 | } |
| 24 | 24 | |
| 25 | 25 | bool tandy200_state::screen_update(screen_device &screen, bitmap_t &bitmap, const rectangle &cliprect) |
| 26 | 26 | { |
| 27 | m_lcdc->update_screen(&bitmap, | |
| 27 | m_lcdc->update_screen(&bitmap, | |
| 28 | 28 | |
| 29 | 29 | return 0; |
| 30 | 30 | } |
| r13798 | r13799 | |
|---|---|---|
| 36 | 36 | { |
| 37 | 37 | int code = state->m_p_videoram[ x + y*64 ] & 0x7f; |
| 38 | 38 | int attr = state->m_p_videoram[ x+1 + y*64 ] & 0x80; |
| 39 | drawgfx_opaque(bitmap, | |
| 39 | drawgfx_opaque(bitmap, cliprect, screen.machine().gfx[0], code | attr, 0, 0,0, x*8,y*8); | |
| 40 | 40 | } |
| 41 | 41 | } |
| 42 | 42 | return 0; |
| r13798 | r13799 | |
|---|---|---|
| 2581 | 2581 | return val; |
| 2582 | 2582 | } |
| 2583 | 2583 | |
| 2584 | UINT32 vic2_video_update( device_t *device, bitmap_t *bitmap, const rectangle | |
| 2584 | UINT32 vic2_video_update( device_t *device, bitmap_t *bitmap, const rectangle &cliprect ) | |
| 2585 | 2585 | { |
| 2586 | 2586 | vic2_state *vic2 = get_safe_token(device); |
| 2587 | 2587 |
| r13798 | r13799 | |
|---|---|---|
| 113 | 113 | { |
| 114 | 114 | if (screen.width() == CDP1869_SCREEN_WIDTH) |
| 115 | 115 | { |
| 116 | m_vis->update_screen(&bitmap, | |
| 116 | m_vis->update_screen(&bitmap, | |
| 117 | 117 | } |
| 118 | 118 | else |
| 119 | 119 | { |
| r13798 | r13799 | |
|---|---|---|
| 153 | 153 | int vic2e_k2_r(device_t *device); |
| 154 | 154 | |
| 155 | 155 | void vic2_raster_interrupt_gen( device_t *device ); |
| 156 | UINT32 vic2_video_update( device_t *device, bitmap_t *bitmap, const rectangle | |
| 156 | UINT32 vic2_video_update( device_t *device, bitmap_t *bitmap, const rectangle &cliprect ); | |
| 157 | 157 | |
| 158 | 158 | |
| 159 | 159 | extern void vic2_set_rastering(device_t *device, int onoff); |
| r13798 | r13799 | |
|---|---|---|
| 228 | 228 | screen.set_visible_area(0, 767, 0, 311); |
| 229 | 229 | |
| 230 | 230 | // draw text |
| 231 | m_crtc->update(&bitmap, | |
| 231 | m_crtc->update(&bitmap, | |
| 232 | 232 | |
| 233 | 233 | return 0; |
| 234 | 234 | } |
| r13798 | r13799 | |
|---|---|---|
| 64 | 64 | adjust_begin_and_end_row - processes the cliprect |
| 65 | 65 | -------------------------------------------------*/ |
| 66 | 66 | |
| 67 | static void adjust_begin_and_end_row(const rectangle | |
| 67 | static void adjust_begin_and_end_row(const rectangle &cliprect, int *beginrow, int *endrow) | |
| 68 | 68 | { |
| 69 | 69 | /* assumptions of the code */ |
| 70 | 70 | assert((*beginrow % 8) == 0); |
| 71 | 71 | assert((*endrow % 8) == 7); |
| 72 | 72 | |
| 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); | |
| 75 | 75 | |
| 76 | 76 | /* sanity check again */ |
| 77 | 77 | assert((*beginrow % 8) == 0); |
| r13798 | r13799 | |
| 137 | 137 | column or 80 column) |
| 138 | 138 | -------------------------------------------------*/ |
| 139 | 139 | |
| 140 | static void apple2_text_draw(running_machine &machine, bitmap_t *bitmap, const rectangle | |
| 140 | static void apple2_text_draw(running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect, int page, int beginrow, int endrow) | |
| 141 | 141 | { |
| 142 | 142 | apple2_state *state = machine.driver_data<apple2_state>(); |
| 143 | 143 | int row, col; |
| r13798 | r13799 | |
| 178 | 178 | apple2_lores_draw - renders lo-res text |
| 179 | 179 | -------------------------------------------------*/ |
| 180 | 180 | |
| 181 | static void apple2_lores_draw(running_machine &machine, bitmap_t *bitmap, const rectangle | |
| 181 | static void apple2_lores_draw(running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect, int page, int beginrow, int endrow) | |
| 182 | 182 | { |
| 183 | 183 | apple2_state *state = machine.driver_data<apple2_state>(); |
| 184 | 184 | int row, col, y, x; |
| r13798 | r13799 | |
| 219 | 219 | HIGH RESOLUTION GRAPHICS |
| 220 | 220 | ***************************************************************************/ |
| 221 | 221 | |
| 222 | static void apple2_hires_draw(running_machine &machine, bitmap_t *bitmap, const rectangle | |
| 222 | static void apple2_hires_draw(running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect, int page, int beginrow, int endrow) | |
| 223 | 223 | { |
| 224 | 224 | apple2_state *state = machine.driver_data<apple2_state>(); |
| 225 | 225 | const UINT8 *vram; |
| r13798 | r13799 | |
| 233 | 233 | UINT16 *artifact_map_ptr; |
| 234 | 234 | |
| 235 | 235 | /* 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; | |
| 240 | 240 | if (endrow < beginrow) |
| 241 | 241 | return; |
| 242 | 242 |
| r13798 | r13799 | |
|---|---|---|
| 428 | 428 | // hr_update - high resolution screen update |
| 429 | 429 | //------------------------------------------------- |
| 430 | 430 | |
| 431 | void abc806_state::hr_update(bitmap_t *bitmap, const rectangle | |
| 431 | void abc806_state::hr_update(bitmap_t *bitmap, const rectangle &cliprect) | |
| 432 | 432 | { |
| 433 | 433 | UINT32 addr = (m_hrs & 0x0f) << 15; |
| 434 | 434 | |
| 435 | for (int y = m_sync + VERTICAL_PORCH_HACK; y < MIN(cliprect | |
| 435 | for (int y = m_sync + VERTICAL_PORCH_HACK; y < MIN(cliprect. | |
| 436 | 436 | { |
| 437 | 437 | for (int sx = 0; sx < 128; sx++) |
| 438 | 438 | { |
| r13798 | r13799 | |
| 516 | 516 | if (!m_txoff) |
| 517 | 517 | { |
| 518 | 518 | // draw text |
| 519 | m_crtc->update(&bitmap, | |
| 519 | m_crtc->update(&bitmap, | |
| 520 | 520 | } |
| 521 | 521 | |
| 522 | 522 | // draw HR graphics |
| 523 | hr_update(&bitmap, | |
| 523 | hr_update(&bitmap, | |
| 524 | 524 | |
| 525 | 525 | return 0; |
| 526 | 526 | } |
| r13798 | r13799 | |
|---|---|---|
| 987 | 987 | return (cr << 10) | ((ra & 0x0f) << 6) | ((cc << 1) & 0x3c); |
| 988 | 988 | } |
| 989 | 989 | |
| 990 | void abc1600_state::crtc_update_row(device_t *device, bitmap_t *bitmap, const rectangle | |
| 990 | void 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) | |
| 991 | 991 | { |
| 992 | 992 | if (y > 0x3ff) return; |
| 993 | 993 | |
| r13798 | r13799 | |
| 1099 | 1099 | if (m_endisp) |
| 1100 | 1100 | { |
| 1101 | 1101 | bitmap.fill(FRAME_POL, cliprect); |
| 1102 | m_crtc->update(&bitmap, | |
| 1102 | m_crtc->update(&bitmap, | |
| 1103 | 1103 | } |
| 1104 | 1104 | else |
| 1105 | 1105 | { |
| r13798 | r13799 | |
|---|---|---|
| 203 | 203 | bitmap->pix16(y, x) = (UINT16)color; |
| 204 | 204 | } |
| 205 | 205 | |
| 206 | void hd66421_device::update_screen(bitmap_t *bitmap, const rectangle | |
| 206 | void hd66421_device::update_screen(bitmap_t *bitmap, const rectangle &cliprect) | |
| 207 | 207 | { |
| 208 | 208 | pen_t pen[4]; |
| 209 | 209 |
| r13798 | r13799 | |
|---|---|---|
| 50 | 50 | DECLARE_READ8_MEMBER( reg_dat_r ); |
| 51 | 51 | DECLARE_WRITE8_MEMBER( reg_dat_w ); |
| 52 | 52 | |
| 53 | void update_screen(bitmap_t *bitmap, const rectangle | |
| 53 | void update_screen(bitmap_t *bitmap, const rectangle &cliprect); | |
| 54 | 54 | |
| 55 | 55 | protected: |
| 56 | 56 | // device-level overrides |
| r13798 | r13799 | |
|---|---|---|
| 121 | 121 | int color[2]; |
| 122 | 122 | running_machine &machine = screen.machine(); |
| 123 | 123 | |
| 124 | bitmap->fill(11, | |
| 124 | bitmap->fill(11, | |
| 125 | 125 | |
| 126 | 126 | /* HJB: we cannot initialize array with values from other arrays, thus... */ |
| 127 | 127 | color[0] = 7; //pocketc_colortable[PC1251_CONTRAST][0]; |
| r13798 | r13799 | |
| 130 | 130 | for (x=RIGHT,y=DOWN, i=0; i<60; x+=3) |
| 131 | 131 | { |
| 132 | 132 | for (j=0; j<5; j++, i++, x+=3) |
| 133 | drawgfx_opaque(bitmap, | |
| 133 | drawgfx_opaque(bitmap, cliprect, screen.machine().gfx[0], state->m_reg[i], | |
| 134 | 134 | PC1251_CONTRAST,0,0, |
| 135 | 135 | x,y); |
| 136 | 136 | } |
| 137 | 137 | for (i=0x7b; i>=0x40; x+=3) |
| 138 | 138 | { |
| 139 | 139 | for (j=0; j<5; j++, i--, x+=3) |
| 140 | drawgfx_opaque(bitmap, | |
| 140 | drawgfx_opaque(bitmap, cliprect, screen.machine().gfx[0], state->m_reg[i], | |
| 141 | 141 | PC1251_CONTRAST,0,0, |
| 142 | 142 | x,y); |
| 143 | 143 | } |
| r13798 | r13799 | |
|---|---|---|
| 243 | 243 | { |
| 244 | 244 | asr_t *asr = get_safe_token(device); |
| 245 | 245 | |
| 246 | drawgfx_opaque(asr->bitmap, | |
| 246 | drawgfx_opaque(asr->bitmap, asr->bitmap->cliprect(), device->machine().gfx[0], character-32, color, 0, 0, | |
| 247 | 247 | x+1, y); |
| 248 | 248 | } |
| 249 | 249 | |
| r13798 | r13799 | |
| 455 | 455 | void asr733_refresh(device_t *device, bitmap_t *bitmap, int x, int y) |
| 456 | 456 | { |
| 457 | 457 | asr_t *asr = get_safe_token(device); |
| 458 | copybitmap(bitmap, asr->bitmap, 0, 0, x, y, | |
| 458 | copybitmap(bitmap, asr->bitmap, 0, 0, x, y, asr->bitmap->cliprect()); | |
| 459 | 459 | } |
| 460 | 460 | |
| 461 | 461 |
| r13798 | r13799 | |
|---|---|---|
| 1757 | 1757 | // update_screen |
| 1758 | 1758 | //------------------------------------------------- |
| 1759 | 1759 | |
| 1760 | bool gime_base_device::update_screen(bitmap_t *bitmap, const rectangle | |
| 1760 | bool gime_base_device::update_screen(bitmap_t *bitmap, const rectangle &cliprect, const pixel_t *RESTRICT palette) | |
| 1761 | 1761 | { |
| 1762 | 1762 | 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; | |
| 1767 | 1767 | palette_resolver resolver(this, palette); |
| 1768 | 1768 | |
| 1769 | 1769 | /* if the video didn't change, indicate as much */ |
| r13798 | r13799 | |
| 1858 | 1858 | // update_composite |
| 1859 | 1859 | //------------------------------------------------- |
| 1860 | 1860 | |
| 1861 | bool gime_base_device::update_composite(bitmap_t *bitmap, const rectangle | |
| 1861 | bool gime_base_device::update_composite(bitmap_t *bitmap, const rectangle &cliprect) | |
| 1862 | 1862 | { |
| 1863 | 1863 | update_value(&m_displayed_rgb, false); |
| 1864 | 1864 | const pixel_t *palette = (m_gime_registers[0x08] & 0x10) |
| r13798 | r13799 | |
| 1873 | 1873 | // update_rgb |
| 1874 | 1874 | //------------------------------------------------- |
| 1875 | 1875 | |
| 1876 | bool gime_base_device::update_rgb(bitmap_t *bitmap, const rectangle | |
| 1876 | bool gime_base_device::update_rgb(bitmap_t *bitmap, const rectangle &cliprect) | |
| 1877 | 1877 | { |
| 1878 | 1878 | update_value(&m_displayed_rgb, true); |
| 1879 | 1879 | return update_screen(bitmap, cliprect, m_rgb_palette); |
| r13798 | r13799 | |
|---|---|---|
| 663 | 663 | bbc_state *state = screen.machine().driver_data<bbc_state>(); |
| 664 | 664 | long c; |
| 665 | 665 | |
| 666 | //logerror ("Box %d by %d \n",cliprect | |
| 666 | //logerror ("Box %d by %d \n",cliprect. | |
| 667 | 667 | |
| 668 | 668 | c = 0; // this is used to time out the screen redraw, in the case that the 6845 is in some way out state. |
| 669 | 669 | |
| r13798 | r13799 | |
| 688 | 688 | // or until a timeout (this catches the 6845 with silly register values that would not give a VSYNC signal) |
| 689 | 689 | while((!state->m_BBC_VSync)&&(c<60000)) |
| 690 | 690 | { |
| 691 | if ((state->m_y_screen_pos>=cliprect | |
| 691 | if ((state->m_y_screen_pos>=cliprect. | |
| 692 | 692 | |
| 693 | 693 | // and check the cursor |
| 694 | 694 | if (state->m_VideoULA_CR) BBC_Clock_CR(state); |
| r13798 | r13799 | |
|---|---|---|
| 67 | 67 | /* updates the screen -- this will call begin_update(), |
| 68 | 68 | followed by update_row() reapeatedly and after all row |
| 69 | 69 | 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); | |
| 72 | 72 | |
| 73 | 73 | /* interrupt outputs */ |
| 74 | 74 | bool firq_r(void) { return m_firq != 0x00; } |
| r13798 | r13799 | |
| 240 | 240 | void timer_elapsed(void); |
| 241 | 241 | |
| 242 | 242 | // video |
| 243 | bool update_screen(bitmap_t *bitmap, const rectangle | |
| 243 | bool update_screen(bitmap_t *bitmap, const rectangle &cliprect, const pixel_t *palette); | |
| 244 | 244 | void update_geometry(void); |
| 245 | 245 | void update_border(UINT16 physical_scanline); |
| 246 | 246 | pixel_t get_composite_color(int color); |
| r13798 | r13799 | |
|---|---|---|
| 811 | 811 | } |
| 812 | 812 | |
| 813 | 813 | |
| 814 | void k1ge_update( device_t *device, bitmap_t *bitmap, const rectangle | |
| 814 | void k1ge_update( device_t *device, bitmap_t *bitmap, const rectangle &cliprect ) | |
| 815 | 815 | { |
| 816 | 816 | k1ge_t *k1ge = get_safe_token( device ); |
| 817 | 817 |
| r13798 | r13799 | |
|---|---|---|
| 121 | 121 | int full_refresh = 1; |
| 122 | 122 | |
| 123 | 123 | if( full_refresh ) |
| 124 | bitmap->fill(((state->m_laser_bg_mode >> 4) & 15)<<1, | |
| 124 | bitmap->fill(((state->m_laser_bg_mode >> 4) & 15)<<1, | |
| 125 | 125 | |
| 126 | 126 | if (state->m_laser_latch & 0x08) |
| 127 | 127 | { |
| r13798 | r13799 | |
|---|---|---|
| 38 | 38 | WRITE8_DEVICE_HANDLER( k1ge_w ); |
| 39 | 39 | READ8_DEVICE_HANDLER( k1ge_r ); |
| 40 | 40 | |
| 41 | void k1ge_update( device_t *device, bitmap_t *bitmap, const rectangle | |
| 41 | void k1ge_update( device_t *device, bitmap_t *bitmap, const rectangle &cliprect ); | |
| 42 | 42 | |
| 43 | 43 | #endif |
| 44 | 44 |
| r13798 | r13799 | |
|---|---|---|
| 108 | 108 | int get_display_mode(UINT8 mode); |
| 109 | 109 | offs_t get_char_rom_offset(); |
| 110 | 110 | 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); | |
| 114 | 114 | |
| 115 | 115 | DECLARE_READ8_MEMBER( video_ram_r ); |
| 116 | 116 | DECLARE_WRITE8_MEMBER( video_ram_w ); |
| r13798 | r13799 | |
|---|---|---|
| 42 | 42 | virtual void machine_start(); |
| 43 | 43 | |
| 44 | 44 | virtual void video_start(); |
| 45 | virtual bool screen_update(screen_device &screen, bitmap_t &bitmap, const rectangle &cliprect) { m_vis->update_screen(&bitmap, | |
| 45 | virtual bool screen_update(screen_device &screen, bitmap_t &bitmap, const rectangle &cliprect) { m_vis->update_screen(&bitmap, | |
| 46 | 46 | |
| 47 | 47 | DECLARE_WRITE8_MEMBER( keyboard_latch_w ); |
| 48 | 48 | DECLARE_WRITE8_MEMBER( vismac_register_w ); |
| r13798 | r13799 | |
|---|---|---|
| 84 | 84 | virtual void video_start(); |
| 85 | 85 | virtual bool screen_update(screen_device &screen, bitmap_t &bitmap, const rectangle &cliprect); |
| 86 | 86 | |
| 87 | void update_screen(bitmap_t *bitmap, const rectangle | |
| 87 | void update_screen(bitmap_t *bitmap, const rectangle &cliprect); | |
| 88 | 88 | |
| 89 | 89 | DECLARE_READ8_MEMBER( mmu_r ); |
| 90 | 90 | DECLARE_WRITE8_MEMBER( mmu_w ); |
| r13798 | r13799 | |
|---|---|---|
| 48 | 48 | virtual void machine_start(); |
| 49 | 49 | virtual void machine_reset(); |
| 50 | 50 | |
| 51 | virtual bool screen_update(screen_device &screen, bitmap_t &bitmap, const rectangle &cliprect) { m_lcdc->update_screen(&bitmap, | |
| 51 | virtual bool screen_update(screen_device &screen, bitmap_t &bitmap, const rectangle &cliprect) { m_lcdc->update_screen(&bitmap, | |
| 52 | 52 | |
| 53 | 53 | void check_interrupt(); |
| 54 | 54 | void trigger_interrupt(int level); |
| r13798 | r13799 | |
|---|---|---|
| 147 | 147 | |
| 148 | 148 | virtual bool screen_update(screen_device &screen, bitmap_t &bitmap, const rectangle &cliprect); |
| 149 | 149 | |
| 150 | void hr_update(bitmap_t *bitmap, const rectangle | |
| 150 | void hr_update(bitmap_t *bitmap, const rectangle &cliprect); | |
| 151 | 151 | }; |
| 152 | 152 | |
| 153 | 153 | class abc800c_state : public abc800_state |
| r13798 | r13799 | |
| 162 | 162 | |
| 163 | 163 | virtual bool screen_update(screen_device &screen, bitmap_t &bitmap, const rectangle &cliprect); |
| 164 | 164 | |
| 165 | void hr_update(bitmap_t *bitmap, const rectangle | |
| 165 | void hr_update(bitmap_t *bitmap, const rectangle &cliprect); | |
| 166 | 166 | }; |
| 167 | 167 | |
| 168 | 168 | // ======================> abc802_state |
| r13798 | r13799 | |
| 230 | 230 | virtual bool screen_update(screen_device &screen, bitmap_t &bitmap, const rectangle &cliprect); |
| 231 | 231 | |
| 232 | 232 | void bankswitch(); |
| 233 | void hr_update(bitmap_t *bitmap, const rectangle | |
| 233 | void hr_update(bitmap_t *bitmap, const rectangle &cliprect); | |
| 234 | 234 | |
| 235 | 235 | DECLARE_READ8_MEMBER( mai_r ); |
| 236 | 236 | DECLARE_WRITE8_MEMBER( mao_w ); |
| r13798 | r13799 | |
|---|---|---|
| 107 | 107 | void tvram_w(UINT8 data, int a6); |
| 108 | 108 | inline int get_reset_t(); |
| 109 | 109 | inline int get_pwrup_t(); |
| 110 | void screen_update(bitmap_t *bitmap, const rectangle | |
| 110 | void screen_update(bitmap_t *bitmap, const rectangle &cliprect); | |
| 111 | 111 | |
| 112 | 112 | // processor state |
| 113 | 113 | int m_pwrup; // power up |
| r13798 | r13799 | |
|---|---|---|
| 192 | 192 | inline UINT16 read_videoram(UINT32 offset); |
| 193 | 193 | inline void write_videoram(UINT32 offset, UINT16 data, UINT16 mask); |
| 194 | 194 | inline UINT16 get_crtca(UINT16 ma, UINT8 ra, UINT8 column); |
| 195 | void crtc_update_row(device_t *device, bitmap_t *bitmap, const rectangle | |
| 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); | |
| 196 | 196 | |
| 197 | 197 | void scc_irq(int status); |
| 198 | 198 |
| r13798 | r13799 | |
|---|---|---|
| 443 | 443 | switch (input_port_read(machine(), "VIDEO")) |
| 444 | 444 | { |
| 445 | 445 | case VIDEO_CDP1861: |
| 446 | m_vdc->update_screen(&bitmap, | |
| 446 | m_vdc->update_screen(&bitmap, | |
| 447 | 447 | break; |
| 448 | 448 | |
| 449 | 449 | case VIDEO_CDP1862: |
| 450 | m_cgc->update_screen(&bitmap, | |
| 450 | m_cgc->update_screen(&bitmap, | |
| 451 | 451 | break; |
| 452 | 452 | } |
| 453 | 453 |
| r13798 | r13799 | |
|---|---|---|
| 227 | 227 | |
| 228 | 228 | bool elf2_state::screen_update(screen_device &screen, bitmap_t &bitmap, const rectangle &cliprect) |
| 229 | 229 | { |
| 230 | m_vdc->update_screen(&bitmap, | |
| 230 | m_vdc->update_screen(&bitmap, | |
| 231 | 231 | |
| 232 | 232 | return 0; |
| 233 | 233 | } |
| r13798 | r13799 | |
|---|---|---|
| 339 | 339 | bitmap.fill(0, cliprect); |
| 340 | 340 | |
| 341 | 341 | /* 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); | |
| 344 | 344 | |
| 345 | 345 | return 0; |
| 346 | 346 | } |
| r13798 | r13799 | |
|---|---|---|
| 234 | 234 | int dot; |
| 235 | 235 | int i; |
| 236 | 236 | |
| 237 | bitmap->fill(0, | |
| 237 | bitmap->fill(0, | |
| 238 | 238 | |
| 239 | 239 | for(y=0;y<mc6845_v_display;y++) |
| 240 | 240 | { |
| r13798 | r13799 | |
|---|---|---|
| 272 | 272 | |
| 273 | 273 | bool mc1000_state::screen_update(screen_device &screen, bitmap_t &bitmap, const rectangle &cliprect) |
| 274 | 274 | { |
| 275 | return m_vdg->update(&bitmap, | |
| 275 | return m_vdg->update(&bitmap, | |
| 276 | 276 | } |
| 277 | 277 | |
| 278 | 278 | /* AY-3-8910 Interface */ |
| r13798 | r13799 | |
|---|---|---|
| 80 | 80 | |
| 81 | 81 | } |
| 82 | 82 | |
| 83 | static void draw_sprites(running_machine &machine, bitmap_t *bitmap, const rectangle | |
| 83 | static void draw_sprites(running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect) | |
| 84 | 84 | { |
| 85 | 85 | pc88va_state *state = machine.driver_data<pc88va_state>(); |
| 86 | 86 | UINT16 *tvram = (UINT16 *)machine.region("tvram")->base(); |
| r13798 | r13799 | |
| 190 | 190 | return 0; |
| 191 | 191 | } |
| 192 | 192 | |
| 193 | static void draw_text(running_machine &machine, bitmap_t *bitmap, const rectangle | |
| 193 | static void draw_text(running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect) | |
| 194 | 194 | { |
| 195 | 195 | pc88va_state *state = machine.driver_data<pc88va_state>(); |
| 196 | 196 | UINT8 *tvram = machine.region("tvram")->base(); |
| r13798 | r13799 | |
| 376 | 376 | pc88va_state *state = screen.machine().driver_data<pc88va_state>(); |
| 377 | 377 | UINT8 pri,cur_pri_lv; |
| 378 | 378 | UINT32 screen_pri; |
| 379 | bitmap->fill(0, | |
| 379 | bitmap->fill(0, | |
| 380 | 380 | |
| 381 | 381 | if(state->m_tsp.disp_on == 0) // don't bother if we are under DSPOFF command |
| 382 | 382 | return 0; |
| r13798 | r13799 | |
|---|---|---|
| 201 | 201 | } |
| 202 | 202 | |
| 203 | 203 | /* this is known as gfx mode 4 */ |
| 204 | static void draw_gfx_mode4(running_machine &machine, bitmap_t *bitmap,const rectangle | |
| 204 | static void draw_gfx_mode4(running_machine &machine, bitmap_t *bitmap,const rectangle &cliprect,int attr) | |
| 205 | 205 | { |
| 206 | 206 | pc6001_state *state = machine.driver_data<pc6001_state>(); |
| 207 | 207 | int x,y,xi; |
| r13798 | r13799 | |
| 254 | 254 | } |
| 255 | 255 | } |
| 256 | 256 | |
| 257 | static void draw_bitmap_2bpp(running_machine &machine, bitmap_t *bitmap,const rectangle | |
| 257 | static void draw_bitmap_2bpp(running_machine &machine, bitmap_t *bitmap,const rectangle &cliprect, int attr) | |
| 258 | 258 | { |
| 259 | 259 | pc6001_state *state = machine.driver_data<pc6001_state>(); |
| 260 | 260 | int color,x,y,xi,yi; |
| r13798 | r13799 | |
| 286 | 286 | } |
| 287 | 287 | } |
| 288 | 288 | |
| 289 | static void draw_tile_3bpp(running_machine &machine, bitmap_t *bitmap,const rectangle | |
| 289 | static void draw_tile_3bpp(running_machine &machine, bitmap_t *bitmap,const rectangle &cliprect,int x,int y,int tile,int attr) | |
| 290 | 290 | { |
| 291 | 291 | int color,pen,xi,yi; |
| 292 | 292 | |
| r13798 | r13799 | |
| 318 | 318 | } |
| 319 | 319 | } |
| 320 | 320 | |
| 321 | static void draw_tile_text(running_machine &machine, bitmap_t *bitmap,const rectangle | |
| 321 | static void draw_tile_text(running_machine &machine, bitmap_t *bitmap,const rectangle &cliprect,int x,int y,int tile,int attr,int has_mc6847) | |
| 322 | 322 | { |
| 323 | 323 | int xi,yi,pen,fgcol,color; |
| 324 | 324 | UINT8 *gfx_data = machine.region("gfx1")->base(); |
| r13798 | r13799 | |
| 354 | 354 | } |
| 355 | 355 | } |
| 356 | 356 | |
| 357 | static void draw_border(running_machine &machine, bitmap_t *bitmap,const rectangle | |
| 357 | static void draw_border(running_machine &machine, bitmap_t *bitmap,const rectangle &cliprect,int attr,int has_mc6847) | |
| 358 | 358 | { |
| 359 | 359 | int x,y,color; |
| 360 | 360 | |
| r13798 | r13799 | |
| 376 | 376 | } |
| 377 | 377 | } |
| 378 | 378 | |
| 379 | static void pc6001_screen_draw(running_machine &machine, bitmap_t *bitmap,const rectangle | |
| 379 | static void pc6001_screen_draw(running_machine &machine, bitmap_t *bitmap,const rectangle &cliprect, int has_mc6847) | |
| 380 | 380 | { |
| 381 | 381 | pc6001_state *state = machine.driver_data<pc6001_state>(); |
| 382 | 382 | int x,y; |
| r13798 | r13799 | |
|---|---|---|
| 103 | 103 | } |
| 104 | 104 | else |
| 105 | 105 | { |
| 106 | m_crtc->update(&bitmap, | |
| 106 | m_crtc->update(&bitmap, | |
| 107 | 107 | } |
| 108 | 108 | |
| 109 | 109 | return false; |
| r13798 | r13799 | |
|---|---|---|
| 126 | 126 | |
| 127 | 127 | SCREEN_UPDATE_MEMBER( mycom_state ) |
| 128 | 128 | { |
| 129 | m_crtc->update( &bitmap, | |
| 129 | m_crtc->update( &bitmap, | |
| 130 | 130 | return 0; |
| 131 | 131 | } |
| 132 | 132 |
| r13798 | r13799 | |
|---|---|---|
| 263 | 263 | |
| 264 | 264 | bool spc1000_state::screen_update(screen_device &screen, bitmap_t &bitmap, const rectangle &cliprect) |
| 265 | 265 | { |
| 266 | return m_vdg->update(&bitmap, | |
| 266 | return m_vdg->update(&bitmap, | |
| 267 | 267 | } |
| 268 | 268 | |
| 269 | 269 | static const ay8910_interface spc1000_ay_interface = |
| r13798 | r13799 | |
|---|---|---|
| 39 | 39 | bool if800_state::screen_update(screen_device &screen, bitmap_t &bitmap, const rectangle &cliprect) |
| 40 | 40 | { |
| 41 | 41 | /* graphics */ |
| 42 | m_hgdc->update_screen(&bitmap, | |
| 42 | m_hgdc->update_screen(&bitmap, | |
| 43 | 43 | |
| 44 | 44 | return 0; |
| 45 | 45 | } |
| r13798 | r13799 | |
|---|---|---|
| 202 | 202 | state->m_screen[offset].b = expand_rgb5_to_rgb8(rgb); |
| 203 | 203 | } |
| 204 | 204 | |
| 205 | static void vii_blit(running_machine &machine, bitmap_t *bitmap, const rectangle | |
| 205 | static 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) | |
| 206 | 206 | { |
| 207 | 207 | vii_state *state = machine.driver_data<vii_state>(); |
| 208 | 208 | address_space *space = machine.device("maincpu")->memory().space(AS_PROGRAM); |
| r13798 | r13799 | |
| 271 | 271 | } |
| 272 | 272 | } |
| 273 | 273 | |
| 274 | static void vii_blit_page(running_machine &machine, bitmap_t *bitmap, const rectangle | |
| 274 | static void vii_blit_page(running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect, int depth, UINT32 bitmap_addr, UINT16 *regs) | |
| 275 | 275 | { |
| 276 | 276 | UINT32 x0, y0; |
| 277 | 277 | UINT32 xscroll = regs[0]; |
| r13798 | r13799 | |
| 340 | 340 | } |
| 341 | 341 | } |
| 342 | 342 | |
| 343 | static void vii_blit_sprite(running_machine &machine, bitmap_t *bitmap, const rectangle | |
| 343 | static void vii_blit_sprite(running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect, int depth, UINT32 base_addr) | |
| 344 | 344 | { |
| 345 | 345 | vii_state *state = machine.driver_data<vii_state>(); |
| 346 | 346 | address_space *space = machine.device("maincpu")->memory().space(AS_PROGRAM); |
| r13798 | r13799 | |
| 382 | 382 | vii_blit(machine, bitmap, cliprect, x, y, attr, 0, bitmap_addr, tile); |
| 383 | 383 | } |
| 384 | 384 | |
| 385 | static void vii_blit_sprites(running_machine &machine, bitmap_t *bitmap, const rectangle | |
| 385 | static void vii_blit_sprites(running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect, int depth) | |
| 386 | 386 | { |
| 387 | 387 | vii_state *state = machine.driver_data<vii_state>(); |
| 388 | 388 | UINT32 n; |
| r13798 | r13799 | |
| 406 | 406 | vii_state *state = screen.machine().driver_data<vii_state>(); |
| 407 | 407 | int i, x, y; |
| 408 | 408 | |
| 409 | bitmap->fill(0, | |
| 409 | bitmap->fill(0, | |
| 410 | 410 | |
| 411 | 411 | memset(state->m_screen, 0, sizeof(state->m_screen)); |
| 412 | 412 |
| r13798 | r13799 | |
|---|---|---|
| 322 | 322 | return height; |
| 323 | 323 | } |
| 324 | 324 | |
| 325 | static void draw_fgtilemap(running_machine &machine, bitmap_t *bitmap,const rectangle | |
| 325 | static void draw_fgtilemap(running_machine &machine, bitmap_t *bitmap,const rectangle &cliprect) | |
| 326 | 326 | { |
| 327 | 327 | /* |
| 328 | 328 | attribute table: |
| r13798 | r13799 | |
| 469 | 469 | res_x = x*8+xi*(width+1); |
| 470 | 470 | res_y = y*(mc6845_tile_height)+yi; |
| 471 | 471 | |
| 472 | if(res_y < cliprect | |
| 472 | if(res_y < cliprect. | |
| 473 | 473 | continue; |
| 474 | 474 | |
| 475 | 475 | x1_draw_pixel(machine,bitmap,res_y,res_x,pcg_pen,width,0); |
| r13798 | r13799 | |
| 511 | 511 | return pri_mask_calc; |
| 512 | 512 | } |
| 513 | 513 | |
| 514 | static void draw_gfxbitmap(running_machine &machine, bitmap_t *bitmap,const rectangle | |
| 514 | static void draw_gfxbitmap(running_machine &machine, bitmap_t *bitmap,const rectangle &cliprect, int plane,int pri) | |
| 515 | 515 | { |
| 516 | 516 | x1_state *state = machine.driver_data<x1_state>(); |
| 517 | 517 | int xi,yi,x,y; |
| r13798 | r13799 | |
| 553 | 553 | if((color == 8 && state->m_scrn_reg.blackclip & 0x10) || (color == 9 && state->m_scrn_reg.blackclip & 0x20)) // bitmap color clip to black conditions |
| 554 | 554 | color = 0; |
| 555 | 555 | |
| 556 | if(y*(mc6845_tile_height)+yi < cliprect | |
| 556 | if(y*(mc6845_tile_height)+yi < cliprect. | |
| 557 | 557 | continue; |
| 558 | 558 | |
| 559 | 559 | x1_draw_pixel(machine,bitmap,y*(mc6845_tile_height)+yi,x*8+xi,color,0,0); |
| r13798 | r13799 | |
| 567 | 567 | { |
| 568 | 568 | x1_state *state = screen.machine().driver_data<x1_state>(); |
| 569 | 569 | |
| 570 | bitmap->fill(MAKE_ARGB(0xff,0x00,0x00,0x00), | |
| 570 | bitmap->fill(MAKE_ARGB(0xff,0x00,0x00,0x00), | |
| 571 | 571 | |
| 572 | 572 | draw_gfxbitmap(screen.machine(),bitmap,cliprect,state->m_scrn_reg.disp_bank,state->m_scrn_reg.pri); |
| 573 | 573 | draw_fgtilemap(screen.machine(),bitmap,cliprect); |
| r13798 | r13799 | |
|---|---|---|
| 54 | 54 | { |
| 55 | 55 | device_t *saa5050 = screen.machine().device("saa5050"); |
| 56 | 56 | |
| 57 | saa5050_update(saa5050, bitmap, | |
| 57 | saa5050_update(saa5050, bitmap, cliprect); | |
| 58 | 58 | return 0; |
| 59 | 59 | } |
| 60 | 60 |
| r13798 | r13799 | |
|---|---|---|
| 146 | 146 | { |
| 147 | 147 | device_t *saa5050 = screen.machine().device("saa5050"); |
| 148 | 148 | |
| 149 | saa5050_update(saa5050, bitmap, | |
| 149 | saa5050_update(saa5050, bitmap, cliprect); | |
| 150 | 150 | return 0; |
| 151 | 151 | } |
| 152 | 152 |
| r13798 | r13799 | |
|---|---|---|
| 206 | 206 | |
| 207 | 207 | bool lcmate2_state::screen_update(screen_device &screen, bitmap_t &bitmap, const rectangle &cliprect) |
| 208 | 208 | { |
| 209 | return m_lcdc->video_update(&bitmap, | |
| 209 | return m_lcdc->video_update(&bitmap, | |
| 210 | 210 | } |
| 211 | 211 | |
| 212 | 212 | static const hd44780_interface lcmate2_display = |
| r13798 | r13799 | |
|---|---|---|
| 73 | 73 | UINT8 *gram = screen.machine().region("fbuf")->base(); |
| 74 | 74 | int x_width; |
| 75 | 75 | |
| 76 | bitmap->fill(screen.machine().pens[state->m_backdrop_pen], | |
| 76 | bitmap->fill(screen.machine().pens[state->m_backdrop_pen], | |
| 77 | 77 | |
| 78 | 78 | x_width = (state->m_display_reg & 0x80) ? 2 : 4; |
| 79 | 79 |
| r13798 | r13799 | |
|---|---|---|
| 66 | 66 | UINT8 pen; |
| 67 | 67 | UINT32 count; |
| 68 | 68 | |
| 69 | bitmap->fill(get_black_pen(screen.machine()), | |
| 69 | bitmap->fill(get_black_pen(screen.machine()), | |
| 70 | 70 | |
| 71 | 71 | count = (0); |
| 72 | 72 |
| r13798 | r13799 | |
|---|---|---|
| 120 | 120 | |
| 121 | 121 | bool eti660_state::screen_update(screen_device &screen, bitmap_t &bitmap, const rectangle &cliprect) |
| 122 | 122 | { |
| 123 | m_cti->update_screen(&bitmap, | |
| 123 | m_cti->update_screen(&bitmap, | |
| 124 | 124 | |
| 125 | 125 | return 0; |
| 126 | 126 | } |
| r13798 | r13799 | |
|---|---|---|
| 327 | 327 | |
| 328 | 328 | bool phc25_state::screen_update(screen_device &screen, bitmap_t &bitmap, const rectangle &cliprect) |
| 329 | 329 | { |
| 330 | return m_vdg->update(&bitmap, | |
| 330 | return m_vdg->update(&bitmap, | |
| 331 | 331 | } |
| 332 | 332 | |
| 333 | 333 | /* AY-3-8910 Interface */ |
| r13798 | r13799 | |
|---|---|---|
| 213 | 213 | { |
| 214 | 214 | device_t *saa5050 = screen.machine().device("saa5050"); |
| 215 | 215 | |
| 216 | saa5050_update(saa5050, bitmap, | |
| 216 | saa5050_update(saa5050, bitmap, cliprect); | |
| 217 | 217 | return 0; |
| 218 | 218 | } |
| 219 | 219 |
| r13798 | r13799 | |
|---|---|---|
| 309 | 309 | |
| 310 | 310 | bool studio2_state::screen_update(screen_device &screen, bitmap_t &bitmap, const rectangle &cliprect) |
| 311 | 311 | { |
| 312 | m_vdc->update_screen(&bitmap, | |
| 312 | m_vdc->update_screen(&bitmap, | |
| 313 | 313 | |
| 314 | 314 | return 0; |
| 315 | 315 | } |
| r13798 | r13799 | |
| 357 | 357 | |
| 358 | 358 | bool mpt02_state::screen_update(screen_device &screen, bitmap_t &bitmap, const rectangle &cliprect) |
| 359 | 359 | { |
| 360 | m_cti->update_screen(&bitmap, | |
| 360 | m_cti->update_screen(&bitmap, | |
| 361 | 361 | |
| 362 | 362 | return 0; |
| 363 | 363 | } |
| r13798 | r13799 | |
|---|---|---|
| 729 | 729 | |
| 730 | 730 | bool ql_state::screen_update(screen_device &screen, bitmap_t &bitmap, const rectangle &cliprect) |
| 731 | 731 | { |
| 732 | m_zx8301->update_screen(&bitmap, | |
| 732 | m_zx8301->update_screen(&bitmap, | |
| 733 | 733 | |
| 734 | 734 | return 0; |
| 735 | 735 | } |
| r13798 | r13799 | |
|---|---|---|
| 153 | 153 | static SCREEN_UPDATE( ti990_10 ) |
| 154 | 154 | { |
| 155 | 155 | 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); | |
| 157 | 157 | return 0; |
| 158 | 158 | } |
| 159 | 159 |
| r13798 | r13799 | |
|---|---|---|
| 970 | 970 | bitmap.fill(0, cliprect); |
| 971 | 971 | |
| 972 | 972 | /* graphics */ |
| 973 | m_hgdc->update_screen(&bitmap, | |
| 973 | m_hgdc->update_screen(&bitmap, | |
| 974 | 974 | |
| 975 | 975 | return 0; |
| 976 | 976 | } |
| r13798 | r13799 | |
|---|---|---|
| 166 | 166 | bitmap->pix16(y, x) = machine.pens[pen]; |
| 167 | 167 | } |
| 168 | 168 | |
| 169 | static void draw_80x25(running_machine &machine, bitmap_t *bitmap,const rectangle | |
| 169 | static void draw_80x25(running_machine &machine, bitmap_t *bitmap,const rectangle &cliprect,UINT16 map_addr) | |
| 170 | 170 | { |
| 171 | 171 | mz2500_state *state = machine.driver_data<mz2500_state>(); |
| 172 | 172 | UINT8 *vram = machine.region("maincpu")->base(); |
| r13798 | r13799 | |
| 257 | 257 | } |
| 258 | 258 | } |
| 259 | 259 | |
| 260 | static void draw_40x25(running_machine &machine, bitmap_t *bitmap,const rectangle | |
| 260 | static void draw_40x25(running_machine &machine, bitmap_t *bitmap,const rectangle &cliprect,int plane,UINT16 map_addr) | |
| 261 | 261 | { |
| 262 | 262 | mz2500_state *state = machine.driver_data<mz2500_state>(); |
| 263 | 263 | UINT8 *vram = machine.region("maincpu")->base(); |
| r13798 | r13799 | |
| 348 | 348 | } |
| 349 | 349 | } |
| 350 | 350 | |
| 351 | static void draw_cg4_screen(running_machine &machine, bitmap_t *bitmap,const rectangle | |
| 351 | static void draw_cg4_screen(running_machine &machine, bitmap_t *bitmap,const rectangle &cliprect,int pri) | |
| 352 | 352 | { |
| 353 | 353 | //mz2500_state *state = machine.driver_data<mz2500_state>(); |
| 354 | 354 | UINT32 count; |
| r13798 | r13799 | |
| 390 | 390 | } |
| 391 | 391 | } |
| 392 | 392 | |
| 393 | static void draw_cg16_screen(running_machine &machine, bitmap_t *bitmap,const rectangle | |
| 393 | static void draw_cg16_screen(running_machine &machine, bitmap_t *bitmap,const rectangle &cliprect,int plane,int x_size,int pri) | |
| 394 | 394 | { |
| 395 | 395 | mz2500_state *state = machine.driver_data<mz2500_state>(); |
| 396 | 396 | UINT32 count; |
| r13798 | r13799 | |
| 448 | 448 | } |
| 449 | 449 | } |
| 450 | 450 | |
| 451 | static void draw_cg256_screen(running_machine &machine, bitmap_t *bitmap,const rectangle | |
| 451 | static void draw_cg256_screen(running_machine &machine, bitmap_t *bitmap,const rectangle &cliprect,int plane,int pri) | |
| 452 | 452 | { |
| 453 | 453 | mz2500_state *state = machine.driver_data<mz2500_state>(); |
| 454 | 454 | UINT32 count; |
| r13798 | r13799 | |
| 506 | 506 | } |
| 507 | 507 | } |
| 508 | 508 | |
| 509 | static void draw_tv_screen(running_machine &machine, bitmap_t *bitmap,const rectangle | |
| 509 | static void draw_tv_screen(running_machine &machine, bitmap_t *bitmap,const rectangle &cliprect) | |
| 510 | 510 | { |
| 511 | 511 | mz2500_state *state = machine.driver_data<mz2500_state>(); |
| 512 | 512 | UINT16 base_addr; |
| r13798 | r13799 | |
| 544 | 544 | } |
| 545 | 545 | } |
| 546 | 546 | |
| 547 | static void draw_cg_screen(running_machine &machine, bitmap_t *bitmap,const rectangle | |
| 547 | static void draw_cg_screen(running_machine &machine, bitmap_t *bitmap,const rectangle &cliprect,int pri) | |
| 548 | 548 | { |
| 549 | 549 | mz2500_state *state = machine.driver_data<mz2500_state>(); |
| 550 | 550 | //popmessage("%02x %02x",state->m_cg_reg[0x0e],state->m_cg_reg[0x18]); |
| r13798 | r13799 | |
| 582 | 582 | static SCREEN_UPDATE( mz2500 ) |
| 583 | 583 | { |
| 584 | 584 | //mz2500_state *state = screen.machine().driver_data<mz2500_state>(); |
| 585 | bitmap->fill(screen.machine().pens[0], | |
| 585 | bitmap->fill(screen.machine().pens[0], | |
| 586 | 586 | |
| 587 | 587 | draw_cg_screen(screen.machine(),bitmap,cliprect,0); |
| 588 | 588 | draw_tv_screen(screen.machine(),bitmap,cliprect); |
| r13798 | r13799 | |
|---|---|---|
| 629 | 629 | static SCREEN_UPDATE( vboy_left ) |
| 630 | 630 | { |
| 631 | 631 | vboy_state *state = screen.machine().driver_data<vboy_state>(); |
| 632 | state->m_screen_output->fill(state->m_vip_regs.BKCOL, | |
| 632 | state->m_screen_output->fill(state->m_vip_regs.BKCOL, | |
| 633 | 633 | |
| 634 | 634 | for(int i=31; i>=0; i--) |
| 635 | 635 | if (display_world(state, i, state->m_screen_output, 0)) break; |
| r13798 | r13799 | |
| 642 | 642 | static SCREEN_UPDATE( vboy_right ) |
| 643 | 643 | { |
| 644 | 644 | vboy_state *state = screen.machine().driver_data<vboy_state>(); |
| 645 | state->m_screen_output->fill(state->m_vip_regs.BKCOL, | |
| 645 | state->m_screen_output->fill(state->m_vip_regs.BKCOL, | |
| 646 | 646 | |
| 647 | 647 | for(int i=31; i>=0; i--) |
| 648 | 648 | if (display_world(state, i, state->m_screen_output, 1)) break; |
| r13798 | r13799 | |
|---|---|---|
| 616 | 616 | |
| 617 | 617 | bool vtech1_state::screen_update(screen_device &screen, bitmap_t &bitmap, const rectangle &cliprect) |
| 618 | 618 | { |
| 619 | return m_mc6847->update(&bitmap, | |
| 619 | return m_mc6847->update(&bitmap, | |
| 620 | 620 | } |
| 621 | 621 | |
| 622 | 622 |
| r13798 | r13799 | |
|---|---|---|
| 45 | 45 | { |
| 46 | 46 | UINT16 tile = m_p_vram[24 + y * 128 + x ] & 0x7f; |
| 47 | 47 | |
| 48 | drawgfx_opaque(&bitmap, | |
| 48 | drawgfx_opaque(&bitmap, | |
| 49 | 49 | } |
| 50 | 50 | } |
| 51 | 51 |
| r13798 | r13799 | |
|---|---|---|
| 509 | 509 | { |
| 510 | 510 | if (m_vidouts) |
| 511 | 511 | { |
| 512 | m_vac->update_screen(&bitmap, | |
| 512 | m_vac->update_screen(&bitmap, | |
| 513 | 513 | } |
| 514 | 514 | |
| 515 | 515 | return 0; |
| r13798 | r13799 | |
|---|---|---|
| 198 | 198 | keyb_press(KEYCODE_ASTERISK, '*'); |
| 199 | 199 | } |
| 200 | 200 | |
| 201 | static void draw_cg4_screen(running_machine &machine, bitmap_t *bitmap,const rectangle | |
| 201 | static void draw_cg4_screen(running_machine &machine, bitmap_t *bitmap,const rectangle &cliprect,int width) | |
| 202 | 202 | { |
| 203 | 203 | UINT8 *vram = machine.region("vram")->base(); |
| 204 | 204 | int x,y,xi,yi; |
| r13798 | r13799 | |
| 229 | 229 | } |
| 230 | 230 | } |
| 231 | 231 | |
| 232 | static void draw_tv_screen(running_machine &machine, bitmap_t *bitmap,const rectangle | |
| 232 | static void draw_tv_screen(running_machine &machine, bitmap_t *bitmap,const rectangle &cliprect,int width) | |
| 233 | 233 | { |
| 234 | 234 | pasopia7_state *state = machine.driver_data<pasopia7_state>(); |
| 235 | 235 | UINT8 *vram = machine.region("vram")->base(); |
| r13798 | r13799 | |
| 288 | 288 | } |
| 289 | 289 | } |
| 290 | 290 | |
| 291 | static void draw_mixed_screen(running_machine &machine, bitmap_t *bitmap,const rectangle | |
| 291 | static void draw_mixed_screen(running_machine &machine, bitmap_t *bitmap,const rectangle &cliprect,int width) | |
| 292 | 292 | { |
| 293 | 293 | pasopia7_state *state = machine.driver_data<pasopia7_state>(); |
| 294 | 294 | UINT8 *vram = machine.region("vram")->base(); |
| r13798 | r13799 | |
| 373 | 373 | pasopia7_state *state = screen.machine().driver_data<pasopia7_state>(); |
| 374 | 374 | int width; |
| 375 | 375 | |
| 376 | bitmap->fill(screen.machine().pens[0], | |
| 376 | bitmap->fill(screen.machine().pens[0], | |
| 377 | 377 | |
| 378 | 378 | fake_keyboard_data(screen.machine()); |
| 379 | 379 |
| r13798 | r13799 | |
|---|---|---|
| 716 | 716 | } |
| 717 | 717 | else |
| 718 | 718 | { |
| 719 | m_crtc->update(&bitmap, | |
| 719 | m_crtc->update(&bitmap, | |
| 720 | 720 | } |
| 721 | 721 | |
| 722 | 722 | return 0; |
| r13798 | r13799 | |
|---|---|---|
| 412 | 412 | SCREEN_UPDATE_MEMBER( a5105_state ) |
| 413 | 413 | { |
| 414 | 414 | /* graphics */ |
| 415 | m_hgdc->update_screen(&bitmap, | |
| 415 | m_hgdc->update_screen(&bitmap, | |
| 416 | 416 | |
| 417 | 417 | return 0; |
| 418 | 418 | } |
| r13798 | r13799 | |
|---|---|---|
| 40 | 40 | bitmap.fill(0, cliprect); |
| 41 | 41 | |
| 42 | 42 | /* graphics */ |
| 43 | m_hgdc->update_screen(&bitmap, | |
| 43 | m_hgdc->update_screen(&bitmap, | |
| 44 | 44 | |
| 45 | 45 | return 0; |
| 46 | 46 | } |
| r13798 | r13799 | |
|---|---|---|
| 410 | 410 | |
| 411 | 411 | bool bw12_state::screen_update(screen_device &screen, bitmap_t &bitmap, const rectangle &cliprect) |
| 412 | 412 | { |
| 413 | m_crtc->update( &bitmap, | |
| 413 | m_crtc->update( &bitmap, | |
| 414 | 414 | |
| 415 | 415 | return 0; |
| 416 | 416 | } |
| r13798 | r13799 | |
|---|---|---|
| 133 | 133 | static SCREEN_UPDATE( ti990_4 ) |
| 134 | 134 | { |
| 135 | 135 | 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); | |
| 137 | 137 | return 0; |
| 138 | 138 | } |
| 139 | 139 |
| r13798 | r13799 | |
|---|---|---|
| 106 | 106 | SCREEN_UPDATE_MEMBER( vt240_state ) |
| 107 | 107 | { |
| 108 | 108 | /* graphics */ |
| 109 | m_hgdc->update_screen(&bitmap, | |
| 109 | m_hgdc->update_screen(&bitmap, | |
| 110 | 110 | |
| 111 | 111 | return 0; |
| 112 | 112 | } |
| r13798 | r13799 | |
|---|---|---|
| 570 | 570 | /* write a single char on screen */ |
| 571 | 571 | static void apexc_draw_char(running_machine &machine, bitmap_t *bitmap, char character, int x, int y, int color) |
| 572 | 572 | { |
| 573 | drawgfx_transpen(bitmap, | |
| 573 | drawgfx_transpen(bitmap, bitmap->cliprect(), machine.gfx[0], character-32, color, 0, 0, | |
| 574 | 574 | x+1, y, 0); |
| 575 | 575 | } |
| 576 | 576 | |
| r13798 | r13799 | |
| 598 | 598 | apexc_draw_string(screen.machine(), bitmap, "running", 8, 8, 0); |
| 599 | 599 | apexc_draw_string(screen.machine(), bitmap, "data :", 0, 24, 0); |
| 600 | 600 | |
| 601 | copybitmap(bitmap, state->m_bitmap, 0, 0, 0, 0, | |
| 601 | copybitmap(bitmap, state->m_bitmap, 0, 0, 0, 0, | |
| 602 | 602 | |
| 603 | 603 | |
| 604 | 604 | apexc_draw_led(bitmap, 0, 0, 1); |
| r13798 | r13799 | |
|---|---|---|
| 52 | 52 | |
| 53 | 53 | bool pc2000_state::screen_update(screen_device &screen, bitmap_t &bitmap, const rectangle &cliprect) |
| 54 | 54 | { |
| 55 | return m_lcdc->video_update( &bitmap, | |
| 55 | return m_lcdc->video_update( &bitmap, | |
| 56 | 56 | } |
| 57 | 57 | |
| 58 | 58 | /* TODO: put a breakpoint at 1625 and test the inputs, writes at dce4 are the scancode values */ |
| r13798 | r13799 | |
|---|---|---|
| 128 | 128 | |
| 129 | 129 | bool victor9k_state::screen_update(screen_device &screen, bitmap_t &bitmap, const rectangle &cliprect) |
| 130 | 130 | { |
| 131 | m_crtc->update(&bitmap, | |
| 131 | m_crtc->update(&bitmap, | |
| 132 | 132 | |
| 133 | 133 | return 0; |
| 134 | 134 | } |
| r13798 | r13799 | |
|---|---|---|
| 320 | 320 | |
| 321 | 321 | bool pc8001_state::screen_update(screen_device &screen, bitmap_t &bitmap, const rectangle &cliprect) |
| 322 | 322 | { |
| 323 | m_crtc->update_screen(&bitmap, | |
| 323 | m_crtc->update_screen(&bitmap, | |
| 324 | 324 | |
| 325 | 325 | return 0; |
| 326 | 326 | } |
| r13798 | r13799 | |
|---|---|---|
| 1064 | 1064 | else |
| 1065 | 1065 | { |
| 1066 | 1066 | /* display is disabled, draw an empty screen */ |
| 1067 | bitmap->fill(0, | |
| 1067 | bitmap->fill(0, | |
| 1068 | 1068 | } |
| 1069 | 1069 | |
| 1070 | 1070 | return 0; |
| r13798 | r13799 | |
|---|---|---|
| 591 | 591 | static SCREEN_UPDATE( pc8801 ) |
| 592 | 592 | { |
| 593 | 593 | pc8801_state *state = screen.machine().driver_data<pc8801_state>(); |
| 594 | bitmap->fill(screen.machine().pens[0], | |
| 594 | bitmap->fill(screen.machine().pens[0], | |
| 595 | 595 | |
| 596 | 596 | if(state->m_gfx_ctrl & 8) |
| 597 | 597 | { |
| r13798 | r13799 | |
|---|---|---|
| 566 | 566 | |
| 567 | 567 | bool bw2_state::screen_update(screen_device &screen, bitmap_t &bitmap, const rectangle &cliprect) |
| 568 | 568 | { |
| 569 | m_lcdc->update_screen(&bitmap, | |
| 569 | m_lcdc->update_screen(&bitmap, | |
| 570 | 570 | |
| 571 | 571 | return 0; |
| 572 | 572 | } |
| r13798 | r13799 | |
|---|---|---|
| 103 | 103 | jr200_state *state = screen.machine().driver_data<jr200_state>(); |
| 104 | 104 | int x,y,xi,yi,pen; |
| 105 | 105 | |
| 106 | bitmap->fill(state->m_border_col, | |
| 106 | bitmap->fill(state->m_border_col, | |
| 107 | 107 | |
| 108 | 108 | for (y = 0; y < 24; y++) |
| 109 | 109 | { |
| r13798 | r13799 | |
|---|---|---|
| 227 | 227 | bool mc10_state::screen_update(screen_device &screen, bitmap_t &bitmap, const rectangle &cliprect) |
| 228 | 228 | { |
| 229 | 229 | if (m_mc6847) //mc10, alice |
| 230 | return m_mc6847->update(&bitmap, | |
| 230 | return m_mc6847->update(&bitmap, | |
| 231 | 231 | else if (m_ef9345) //alice32 |
| 232 | m_ef9345->video_update(&bitmap, | |
| 232 | m_ef9345->video_update(&bitmap, | |
| 233 | 233 | |
| 234 | 234 | return 0; |
| 235 | 235 | } |
| r13798 | r13799 | |
|---|---|---|
| 348 | 348 | |
| 349 | 349 | bool atom_state::screen_update(screen_device &screen, bitmap_t &bitmap, const rectangle &cliprect) |
| 350 | 350 | { |
| 351 | return m_vdg->update(&bitmap, | |
| 351 | return m_vdg->update(&bitmap, | |
| 352 | 352 | } |
| 353 | 353 | |
| 354 | 354 | /*************************************************************************** |
| r13798 | r13799 | |
|---|---|---|
| 188 | 188 | if (!state->m_display_on) |
| 189 | 189 | state->m_crtc->update( bitmap, cliprect); |
| 190 | 190 | else |
| 191 | bitmap->fill(0, | |
| 191 | bitmap->fill(0, | |
| 192 | 192 | |
| 193 | 193 | return 0; |
| 194 | 194 | } |
| r13798 | r13799 | |
|---|---|---|
| 218 | 218 | |
| 219 | 219 | SCREEN_UPDATE_MEMBER( dim68k_state ) |
| 220 | 220 | { |
| 221 | m_crtc->update( &bitmap, | |
| 221 | m_crtc->update( &bitmap, | |
| 222 | 222 | return 0; |
| 223 | 223 | } |
| 224 | 224 |
| r13798 | r13799 | |
|---|---|---|
| 149 | 149 | |
| 150 | 150 | bool apf_state::screen_update(screen_device &screen, bitmap_t &bitmap, const rectangle &cliprect) |
| 151 | 151 | { |
| 152 | return m_crtc->update(&bitmap, | |
| 152 | return m_crtc->update(&bitmap, | |
| 153 | 153 | } |
| 154 | 154 | |
| 155 | 155 | READ8_MEMBER( apf_state::apf_m1000_pia_in_a_func) |
| r13798 | r13799 | |
|---|---|---|
| 462 | 462 | |
| 463 | 463 | |
| 464 | 464 | |
| 465 | static void draw_sprites(running_machine &machine, bitmap_t *bitmap, const rectangle | |
| 465 | static void draw_sprites(running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect) | |
| 466 | 466 | { |
| 467 | 467 | supracan_state *state = machine.driver_data<supracan_state>(); |
| 468 | 468 | UINT16 *supracan_vram = state->m_vram; |
| r13798 | r13799 | |
| 634 | 634 | |
| 635 | 635 | |
| 636 | 636 | /* draws ROZ with linescroll OR columnscroll to 16-bit indexed bitmap */ |
| 637 | static void supracan_suprnova_draw_roz(running_machine &machine, bitmap_t* bitmap, const rectangle | |
| 637 | static 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) | |
| 638 | 638 | { |
| 639 | 639 | //bitmap_t *destbitmap = bitmap; |
| 640 | 640 | bitmap_t *srcbitmap = tilemap_get_pixmap(tmap); |
| r13798 | r13799 | |
| 658 | 658 | //int destadvance = destbitmap->bpp / 8; |
| 659 | 659 | |
| 660 | 660 | /* 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; | |
| 663 | 663 | |
| 664 | 664 | /* 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; | |
| 669 | 669 | |
| 670 | 670 | { |
| 671 | 671 | /* loop over rows */ |
| r13798 | r13799 | |
| 768 | 768 | |
| 769 | 769 | if (0) |
| 770 | 770 | { |
| 771 | if (cliprect | |
| 771 | if (cliprect. | |
| 772 | 772 | { |
| 773 | 773 | const rectangle &visarea = screen.visible_area(); |
| 774 | 774 | |
| 775 | 775 | state->m_sprite_final_bitmap->fill(0x00, visarea); |
| 776 | 776 | bitmap->fill(0x80, visarea); |
| 777 | 777 | |
| 778 | draw_sprites(screen.machine(), state->m_sprite_final_bitmap, | |
| 778 | draw_sprites(screen.machine(), state->m_sprite_final_bitmap, | |
| 779 | 779 | } |
| 780 | 780 | } |
| 781 | 781 | else |
| 782 | 782 | { |
| 783 | 783 | |
| 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); | |
| 786 | 786 | |
| 787 | 787 | draw_sprites(screen.machine(), state->m_sprite_final_bitmap, cliprect); |
| 788 | 788 | } |
| r13798 | r13799 | |
| 858 | 858 | int y,x; |
| 859 | 859 | // yes, it will draw a single line if you specify a cliprect as such (partial updates...) |
| 860 | 860 | |
| 861 | for (y=cliprect | |
| 861 | for (y=cliprect. | |
| 862 | 862 | { |
| 863 | 863 | // these will have to change to ADDR32 etc. once alpha blending is supported |
| 864 | 864 | UINT16* screen = &bitmap->pix16(y); |
| r13798 | r13799 | |
| 874 | 874 | |
| 875 | 875 | UINT16* src = &src_bitmap->pix16((realy)&((ysize*8)-1)); |
| 876 | 876 | |
| 877 | for (x=cliprect | |
| 877 | for (x=cliprect. | |
| 878 | 878 | { |
| 879 | 879 | int actualx = x & mosaic_mask; |
| 880 | 880 | int realx = actualx+scrollx; |
| r13798 | r13799 | |
| 929 | 929 | 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 |
| 930 | 930 | { |
| 931 | 931 | // 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 | |
| 932 | for (int y=cliprect. | |
| 933 | 933 | { |
| 934 | 934 | 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; | |
| 937 | 937 | |
| 938 | 938 | clip.min_y = clip.max_y = y; |
| 939 | 939 | |
| r13798 | r13799 | |
| 953 | 953 | |
| 954 | 954 | |
| 955 | 955 | if (state->m_vram[state->m_roz_unk_base0/2 + y]) // incxx = 0, no draw? |
| 956 | supracan_suprnova_draw_roz(screen.machine(), bitmap, | |
| 956 | supracan_suprnova_draw_roz(screen.machine(), bitmap, | |
| 957 | 957 | } |
| 958 | 958 | } |
| 959 | 959 | else |
| r13798 | r13799 | |
| 970 | 970 | // just draw the sprites on top for now |
| 971 | 971 | if(state->m_video_flags & 0x08) |
| 972 | 972 | { |
| 973 | for (int y=cliprect | |
| 973 | for (int y=cliprect. | |
| 974 | 974 | { |
| 975 | 975 | UINT16* src = &state->m_sprite_final_bitmap->pix16(y); |
| 976 | 976 | UINT16* dst = &bitmap->pix16(y); |
| 977 | 977 | |
| 978 | for (int x=cliprect | |
| 978 | for (int x=cliprect. | |
| 979 | 979 | { |
| 980 | 980 | UINT16 dat = src[x]; |
| 981 | 981 | if (dat) dst[x] = dat; |
| r13798 | r13799 | |
|---|---|---|
| 150 | 150 | |
| 151 | 151 | bool tmc2000e_state::screen_update(screen_device &screen, bitmap_t &bitmap, const rectangle &cliprect) |
| 152 | 152 | { |
| 153 | m_cti->update_screen(&bitmap, | |
| 153 | m_cti->update_screen(&bitmap, | |
| 154 | 154 | |
| 155 | 155 | return 0; |
| 156 | 156 | } |
| r13798 | r13799 | |
|---|---|---|
| 308 | 308 | |
| 309 | 309 | bool vg5k_state::screen_update(screen_device &screen, bitmap_t &bitmap, const rectangle &cliprect) |
| 310 | 310 | { |
| 311 | m_ef9345->video_update(&bitmap, | |
| 311 | m_ef9345->video_update(&bitmap, | |
| 312 | 312 | |
| 313 | 313 | return 0; |
| 314 | 314 | } |
| r13798 | r13799 | |
|---|---|---|
| 558 | 558 | int clip_y = state->m_p_videoram[0x1402] >> 4; |
| 559 | 559 | |
| 560 | 560 | /* Clear the screen */ |
| 561 | bitmap->fill(gr_bg , | |
| 561 | bitmap->fill(gr_bg , | |
| 562 | 562 | |
| 563 | 563 | /* Draw background */ |
| 564 | 564 | for ( y = 0; y < 16; y++ ) |
| r13798 | r13799 | |
|---|---|---|
| 307 | 307 | |
| 308 | 308 | SCREEN_UPDATE_MEMBER( h19_state ) |
| 309 | 309 | { |
| 310 | m_crtc->update( &bitmap, | |
| 310 | m_crtc->update( &bitmap, | |
| 311 | 311 | return 0; |
| 312 | 312 | } |
| 313 | 313 |
| r13798 | r13799 | |
|---|---|---|
| 199 | 199 | |
| 200 | 200 | SCREEN_UPDATE_MEMBER( zrt80_state ) |
| 201 | 201 | { |
| 202 | m_crtc->update(&bitmap, | |
| 202 | m_crtc->update(&bitmap, | |
| 203 | 203 | return 0; |
| 204 | 204 | } |
| 205 | 205 |
| r13798 | r13799 | |
|---|---|---|
| 323 | 323 | |
| 324 | 324 | bool micronic_state::screen_update(screen_device &screen, bitmap_t &bitmap, const rectangle &cliprect) |
| 325 | 325 | { |
| 326 | m_lcdc->update_screen(&bitmap, | |
| 326 | m_lcdc->update_screen(&bitmap, | |
| 327 | 327 | |
| 328 | 328 | return 0; |
| 329 | 329 | } |
| r13798 | r13799 | |
|---|---|---|
| 144 | 144 | |
| 145 | 145 | SCREEN_UPDATE_MEMBER( alphatro_state ) |
| 146 | 146 | { |
| 147 | m_crtc->update( &bitmap, | |
| 147 | m_crtc->update( &bitmap, | |
| 148 | 148 | return 0; |
| 149 | 149 | } |
| 150 | 150 |
| r13798 | r13799 | |
|---|---|---|
| 396 | 396 | |
| 397 | 397 | bool cosmicos_state::screen_update(screen_device &screen, bitmap_t &bitmap, const rectangle &cliprect) |
| 398 | 398 | { |
| 399 | m_cti->update_screen(&bitmap, | |
| 399 | m_cti->update_screen(&bitmap, | |
| 400 | 400 | |
| 401 | 401 | return 0; |
| 402 | 402 | } |
| r13798 | r13799 | |
|---|---|---|
| 445 | 445 | |
| 446 | 446 | bool psion_state::screen_update(screen_device &screen, bitmap_t &bitmap, const rectangle &cliprect) |
| 447 | 447 | { |
| 448 | return m_lcdc->video_update( &bitmap, | |
| 448 | return m_lcdc->video_update( &bitmap, | |
| 449 | 449 | } |
| 450 | 450 | |
| 451 | 451 | static PALETTE_INIT( psion ) |
| Previous | 15994 Revisions | Next |