summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGravatarGravatar Vas Crabb <vas@vastheman.com>2020-09-27 14:00:42 +1000
committerGravatarGravatar Vas Crabb <vas@vastheman.com>2020-09-27 14:00:42 +1000
commita1d35e5abf431e03e06d55b96379a3b14753ed4d (patch)
tree506ffe906e707f50eca2306da80b1657644e0507
parentd294948a3bb8c6e8fdbc96841ceae30ec6687870 (diff)
Cleaned up bitmap API.
Made const-qualified pixel accessors (pix, pixt, raw_pixptr) return const-qualified references/pointers to pixesl, and added non-const versions. This makes bitmap more like standard library containers where const protects the content as well as the dimensions. Made the templated pixt accessor protected - having it public makes it too easy to inadvertently get a pointer to the wrong location. Removed the pix(8|16|32|64) accessors from the specific bitmaps. You could only use the "correct" one anyway, and having the "incorrect" ones available prevented explicit instantiations of the class template because the static assertions would fail. You can still see the pixel type in the bitmap class names, and you can't assign the result of &pix(y, x) to the wrong kind of pointer without a cast. Added fill member functions to the specific bitmap template, and added a explicit instantiations. This allows the bitmap size check to be skipped on most bitmap fills, although the clipping check is still there. Also fixed a couple of places that were trying to fill an indexed 16-bit bitmap with rgb_t::black() exposed by this (replaced with zero to get the same net effect). The explicit template instantiations in the .cpp file mean the compiler can inline the function if necessary, but don't need to generate a local out-of-line body if it chooses not to. Extended the size of the fill value parameter in the base bitmap class to 64 bits so it works correctly for 64-bit bitmaps. Fixed places where IE15 and VGM visualiser weren't accounting for row bytes potentially being larger than width. Fixed an off-by-one in an HP-DIO card where it was treating the Topcat cursor right edge as exclusive. Updated everything to work with the API changes, reduced the scope of many variables, added more const, and replaced a few fill/copy loops with stuff from <algorithm>.
-rw-r--r--src/devices/bus/a2bus/a2ultraterm.cpp5
-rw-r--r--src/devices/bus/a2bus/a2videoterm.cpp2
-rw-r--r--src/devices/bus/acorn/system/vdu40.cpp2
-rw-r--r--src/devices/bus/acorn/system/vdu80.cpp2
-rw-r--r--src/devices/bus/bbc/userport/lcd.cpp2
-rw-r--r--src/devices/bus/c64/xl80.cpp12
-rw-r--r--src/devices/bus/centronics/epson_lx810l.cpp4
-rw-r--r--src/devices/bus/compis/hrg.cpp16
-rw-r--r--src/devices/bus/comx35/clm.cpp8
-rw-r--r--src/devices/bus/ecbbus/grip.cpp28
-rw-r--r--src/devices/bus/einstein/pipe/tk02.cpp16
-rw-r--r--src/devices/bus/electron/mode7.cpp2
-rw-r--r--src/devices/bus/gio64/newport.cpp2
-rw-r--r--src/devices/bus/hp_dio/hp98543.cpp2
-rw-r--r--src/devices/bus/hp_dio/hp98544.cpp9
-rw-r--r--src/devices/bus/hp_dio/hp98550.cpp2
-rw-r--r--src/devices/bus/iq151/grafik.cpp2
-rw-r--r--src/devices/bus/iq151/minigraf.cpp2
-rw-r--r--src/devices/bus/iq151/ms151a.cpp2
-rw-r--r--src/devices/bus/iq151/video32.cpp2
-rw-r--r--src/devices/bus/iq151/video64.cpp2
-rw-r--r--src/devices/bus/isa/aga.cpp20
-rw-r--r--src/devices/bus/isa/cga.cpp690
-rw-r--r--src/devices/bus/isa/ega.cpp13
-rw-r--r--src/devices/bus/isa/eis_hgb107x.cpp21
-rw-r--r--src/devices/bus/isa/ex1280.cpp8
-rw-r--r--src/devices/bus/isa/mach32.cpp17
-rw-r--r--src/devices/bus/isa/mda.cpp280
-rw-r--r--src/devices/bus/isa/num9rev.cpp4
-rw-r--r--src/devices/bus/isa/pgc.cpp7
-rw-r--r--src/devices/bus/isa/trident.cpp27
-rw-r--r--src/devices/bus/macpds/pds_tpdfpd.cpp32
-rw-r--r--src/devices/bus/mtx/sdx.cpp2
-rw-r--r--src/devices/bus/nasbus/avc.cpp2
-rw-r--r--src/devices/bus/nubus/laserview.cpp30
-rw-r--r--src/devices/bus/nubus/nubus_48gc.cpp72
-rw-r--r--src/devices/bus/nubus/nubus_cb264.cpp52
-rw-r--r--src/devices/bus/nubus/nubus_m2hires.cpp56
-rw-r--r--src/devices/bus/nubus/nubus_m2video.cpp40
-rw-r--r--src/devices/bus/nubus/nubus_radiustpd.cpp32
-rw-r--r--src/devices/bus/nubus/nubus_spec8.cpp40
-rw-r--r--src/devices/bus/nubus/nubus_specpdq.cpp40
-rw-r--r--src/devices/bus/nubus/nubus_vikbw.cpp30
-rw-r--r--src/devices/bus/nubus/nubus_wsportrait.cpp49
-rw-r--r--src/devices/bus/nubus/pds30_30hr.cpp58
-rw-r--r--src/devices/bus/nubus/pds30_cb264.cpp55
-rw-r--r--src/devices/bus/nubus/pds30_mc30.cpp71
-rw-r--r--src/devices/bus/nubus/pds30_procolor816.cpp53
-rw-r--r--src/devices/bus/nubus/pds30_sigmalview.cpp14
-rw-r--r--src/devices/bus/s100/dg640.cpp24
-rw-r--r--src/devices/bus/s100/polyvti.cpp20
-rw-r--r--src/devices/bus/sbus/bwtwo.cpp9
-rw-r--r--src/devices/bus/sbus/cgsix.cpp6
-rw-r--r--src/devices/bus/sbus/cgthree.cpp6
-rw-r--r--src/devices/bus/svi3x8/slot/sv806.cpp18
-rw-r--r--src/devices/bus/tanbus/mpvdu.cpp10
-rw-r--r--src/devices/bus/tanbus/ravdu.cpp10
-rw-r--r--src/devices/bus/tanbus/tanhrg.cpp21
-rw-r--r--src/devices/bus/tanbus/tug8082.cpp14
-rw-r--r--src/devices/bus/ti99/internal/992board.cpp2
-rw-r--r--src/devices/bus/vic20/videopak.cpp2
-rw-r--r--src/devices/bus/wangpc/lvc.cpp10
-rw-r--r--src/devices/bus/wangpc/mvc.cpp22
-rw-r--r--src/devices/cpu/e0c6200/e0c6s46.cpp2
-rw-r--r--src/devices/cpu/tms34010/tms34010.cpp4
-rw-r--r--src/devices/cpu/vt50/vt50.cpp2
-rw-r--r--src/devices/machine/acorn_vidc.cpp4
-rw-r--r--src/devices/machine/exorterm.cpp4
-rw-r--r--src/devices/machine/ie15.cpp3
-rw-r--r--src/devices/machine/laserdsc.cpp19
-rw-r--r--src/devices/machine/laserdsc.h21
-rw-r--r--src/devices/machine/ldpr8210.cpp12
-rw-r--r--src/devices/machine/mc68328.cpp19
-rw-r--r--src/devices/machine/pxa255.cpp2
-rw-r--r--src/devices/machine/s2636.cpp2
-rw-r--r--src/devices/machine/s3c24xx.hxx58
-rw-r--r--src/devices/machine/s3c44b0.cpp9
-rw-r--r--src/devices/machine/spg110_video.cpp9
-rw-r--r--src/devices/machine/spg290_ppu.cpp8
-rw-r--r--src/devices/machine/spg_renderer.cpp2
-rw-r--r--src/devices/machine/swtpc8212.cpp2
-rw-r--r--src/devices/machine/tc009xlvc.cpp4
-rw-r--r--src/devices/machine/terminal.cpp2
-rw-r--r--src/devices/sound/cdp1864.cpp2
-rw-r--r--src/devices/sound/cdp1869.cpp13
-rw-r--r--src/devices/sound/mos6560.cpp79
-rw-r--r--src/devices/sound/mos7360.cpp159
-rw-r--r--src/devices/sound/vgm_visualizer.cpp65
-rw-r--r--src/devices/video/315_5124.cpp8
-rw-r--r--src/devices/video/315_5313.cpp2
-rw-r--r--src/devices/video/cdp1861.cpp5
-rw-r--r--src/devices/video/cdp1862.cpp5
-rw-r--r--src/devices/video/cesblit.cpp34
-rw-r--r--src/devices/video/clgd542x.cpp25
-rw-r--r--src/devices/video/ef9340_1.cpp8
-rw-r--r--src/devices/video/ef9345.cpp4
-rw-r--r--src/devices/video/ef9364.cpp19
-rw-r--r--src/devices/video/ef9365.cpp15
-rw-r--r--src/devices/video/gb_lcd.cpp2
-rw-r--r--src/devices/video/gba_lcd.cpp2
-rw-r--r--src/devices/video/gf4500.cpp9
-rw-r--r--src/devices/video/hd44102.cpp2
-rw-r--r--src/devices/video/hd44352.cpp4
-rw-r--r--src/devices/video/hd44780.cpp4
-rw-r--r--src/devices/video/hd61830.cpp6
-rw-r--r--src/devices/video/hd63484.cpp2
-rw-r--r--src/devices/video/hd66421.cpp2
-rw-r--r--src/devices/video/hp1ll3.cpp4
-rw-r--r--src/devices/video/huc6260.cpp4
-rw-r--r--src/devices/video/huc6261.cpp4
-rw-r--r--src/devices/video/i8244.cpp12
-rw-r--r--src/devices/video/imagetek_i4100.cpp8
-rw-r--r--src/devices/video/m50458.cpp66
-rw-r--r--src/devices/video/mb88303.cpp2
-rw-r--r--src/devices/video/mb90082.cpp39
-rw-r--r--src/devices/video/mb_vcu.cpp19
-rw-r--r--src/devices/video/mc6845.cpp4
-rw-r--r--src/devices/video/mc6847.h6
-rw-r--r--src/devices/video/mos6566.cpp124
-rw-r--r--src/devices/video/msm6255.cpp8
-rw-r--r--src/devices/video/nt7534.cpp2
-rw-r--r--src/devices/video/pc_vga.cpp348
-rw-r--r--src/devices/video/ppu2c0x.cpp10
-rw-r--r--src/devices/video/ppu2c0x_sh6578.cpp6
-rw-r--r--src/devices/video/ppu2c0x_vt.cpp6
-rw-r--r--src/devices/video/psx.cpp8
-rw-r--r--src/devices/video/saa5050.cpp4
-rw-r--r--src/devices/video/scn2674.cpp2
-rw-r--r--src/devices/video/sed1330.cpp4
-rw-r--r--src/devices/video/snes_ppu.cpp14
-rw-r--r--src/devices/video/stvvdp2.cpp261
-rw-r--r--src/devices/video/t6963c.cpp8
-rw-r--r--src/devices/video/t6a04.cpp2
-rw-r--r--src/devices/video/tms3556.cpp6
-rw-r--r--src/devices/video/tms9928a.cpp2
-rw-r--r--src/devices/video/v9938.cpp6
-rw-r--r--src/devices/video/vic4567.cpp339
-rw-r--r--src/devices/video/voodoo.cpp8
-rw-r--r--src/devices/video/vrender0.cpp2
-rw-r--r--src/devices/video/zeus2.cpp10
-rw-r--r--src/emu/crsshair.cpp9
-rw-r--r--src/emu/render.cpp6
-rw-r--r--src/emu/rendfont.cpp6
-rw-r--r--src/emu/rendlay.cpp42
-rw-r--r--src/emu/rendutil.cpp16
-rw-r--r--src/emu/screen.cpp32
-rw-r--r--src/emu/tilemap.cpp30
-rw-r--r--src/emu/video.cpp4
-rw-r--r--src/frontend/mame/ui/selmenu.cpp14
-rw-r--r--src/frontend/mame/ui/ui.cpp2
-rw-r--r--src/frontend/mame/ui/viewgfx.cpp10
-rw-r--r--src/frontend/mame/ui/widgets.cpp23
-rw-r--r--src/lib/util/avhuff.cpp23
-rw-r--r--src/lib/util/avhuff.h64
-rw-r--r--src/lib/util/aviio.cpp16
-rw-r--r--src/lib/util/bitmap.cpp19
-rw-r--r--src/lib/util/bitmap.h79
-rw-r--r--src/lib/util/chdcodec.cpp2
-rw-r--r--src/lib/util/png.cpp18
-rw-r--r--src/mame/drivers/1945kiii.cpp4
-rw-r--r--src/mame/drivers/5clown.cpp2
-rw-r--r--src/mame/drivers/a5105.cpp4
-rw-r--r--src/mame/drivers/a7150.cpp9
-rw-r--r--src/mame/drivers/accomm.cpp2
-rw-r--r--src/mame/drivers/acefruit.cpp23
-rw-r--r--src/mame/drivers/adacp150.cpp2
-rw-r--r--src/mame/drivers/adm11.cpp2
-rw-r--r--src/mame/drivers/aleck64.cpp28
-rw-r--r--src/mame/drivers/alesis.cpp2
-rw-r--r--src/mame/drivers/alfaskop41xx.cpp8
-rw-r--r--src/mame/drivers/alinvade.cpp14
-rw-r--r--src/mame/drivers/alphajuno.cpp2
-rw-r--r--src/mame/drivers/alphatpx.cpp52
-rw-r--r--src/mame/drivers/alphatro.cpp23
-rw-r--r--src/mame/drivers/amust.cpp15
-rw-r--r--src/mame/drivers/apc.cpp61
-rw-r--r--src/mame/drivers/apogee.cpp2
-rw-r--r--src/mame/drivers/apple1.cpp17
-rw-r--r--src/mame/drivers/applix.cpp2
-rw-r--r--src/mame/drivers/apricot.cpp4
-rw-r--r--src/mame/drivers/apricotf.cpp6
-rw-r--r--src/mame/drivers/apricotp.cpp2
-rw-r--r--src/mame/drivers/argo.cpp2
-rw-r--r--src/mame/drivers/aristmk6.cpp8
-rw-r--r--src/mame/drivers/astinvad.cpp16
-rw-r--r--src/mame/drivers/astrof.cpp22
-rw-r--r--src/mame/drivers/atarisy4.cpp12
-rw-r--r--src/mame/drivers/atronic.cpp4
-rw-r--r--src/mame/drivers/att4425.cpp27
-rw-r--r--src/mame/drivers/att630.cpp2
-rw-r--r--src/mame/drivers/attache.cpp68
-rw-r--r--src/mame/drivers/avalnche.cpp16
-rw-r--r--src/mame/drivers/b16.cpp9
-rw-r--r--src/mame/drivers/banctec.cpp14
-rw-r--r--src/mame/drivers/bcs3.cpp42
-rw-r--r--src/mame/drivers/beaminv.cpp14
-rw-r--r--src/mame/drivers/beezer.cpp4
-rw-r--r--src/mame/drivers/berzerk.cpp16
-rw-r--r--src/mame/drivers/bfcobra.cpp47
-rw-r--r--src/mame/drivers/bigbord2.cpp16
-rw-r--r--src/mame/drivers/bingor.cpp21
-rw-r--r--src/mame/drivers/bitgraph.cpp11
-rw-r--r--src/mame/drivers/blitz68k.cpp16
-rw-r--r--src/mame/drivers/blw700i.cpp33
-rw-r--r--src/mame/drivers/bmcbowl.cpp25
-rw-r--r--src/mame/drivers/bmcpokr.cpp24
-rw-r--r--src/mame/drivers/bmjr.cpp18
-rw-r--r--src/mame/drivers/bml3.cpp37
-rw-r--r--src/mame/drivers/bw12.cpp17
-rw-r--r--src/mame/drivers/c10.cpp17
-rw-r--r--src/mame/drivers/c65.cpp2
-rw-r--r--src/mame/drivers/calcune.cpp2
-rw-r--r--src/mame/drivers/camplynx.cpp31
-rw-r--r--src/mame/drivers/candela.cpp2
-rw-r--r--src/mame/drivers/canon_s80.cpp2
-rw-r--r--src/mame/drivers/cardline.cpp4
-rw-r--r--src/mame/drivers/casloopy.cpp15
-rw-r--r--src/mame/drivers/cat.cpp4
-rw-r--r--src/mame/drivers/cbm2.cpp14
-rw-r--r--src/mame/drivers/cc40.cpp2
-rw-r--r--src/mame/drivers/cd2650.cpp17
-rw-r--r--src/mame/drivers/cdc721.cpp19
-rw-r--r--src/mame/drivers/cdi.cpp2
-rw-r--r--src/mame/drivers/cesclass.cpp20
-rw-r--r--src/mame/drivers/cfx9850.cpp2
-rw-r--r--src/mame/drivers/cgenie.cpp10
-rw-r--r--src/mame/drivers/cit101.cpp2
-rw-r--r--src/mame/drivers/cit220.cpp2
-rw-r--r--src/mame/drivers/clayshoo.cpp2
-rw-r--r--src/mame/drivers/clcd.cpp30
-rw-r--r--src/mame/drivers/cmi.cpp4
-rw-r--r--src/mame/drivers/cobra.cpp34
-rw-r--r--src/mame/drivers/cocoloco.cpp2
-rw-r--r--src/mame/drivers/compucolor.cpp6
-rw-r--r--src/mame/drivers/consola_emt.cpp2
-rw-r--r--src/mame/drivers/coolpool.cpp18
-rw-r--r--src/mame/drivers/coolridr.cpp37
-rw-r--r--src/mame/drivers/corona.cpp16
-rw-r--r--src/mame/drivers/cps3.cpp24
-rw-r--r--src/mame/drivers/cubeqst.cpp17
-rw-r--r--src/mame/drivers/cupidon.cpp20
-rw-r--r--src/mame/drivers/cxhumax.cpp19
-rw-r--r--src/mame/drivers/cybertnk.cpp2
-rw-r--r--src/mame/drivers/cz101.cpp2
-rw-r--r--src/mame/drivers/d6800.cpp10
-rw-r--r--src/mame/drivers/dai3wksi.cpp4
-rw-r--r--src/mame/drivers/ddenlovr.cpp17
-rw-r--r--src/mame/drivers/decstation.cpp13
-rw-r--r--src/mame/drivers/destroyr.cpp2
-rw-r--r--src/mame/drivers/dgpix.cpp4
-rw-r--r--src/mame/drivers/dim68k.cpp10
-rw-r--r--src/mame/drivers/dkmb.cpp4
-rw-r--r--src/mame/drivers/dmv.cpp19
-rw-r--r--src/mame/drivers/dooyong.cpp6
-rw-r--r--src/mame/drivers/dorachan.cpp5
-rw-r--r--src/mame/drivers/dotrikun.cpp2
-rw-r--r--src/mame/drivers/dpb7000.cpp18
-rw-r--r--src/mame/drivers/duet16.cpp4
-rw-r--r--src/mame/drivers/dvk_kcgd.cpp6
-rw-r--r--src/mame/drivers/dvk_ksm.cpp4
-rw-r--r--src/mame/drivers/dwarfd.cpp18
-rw-r--r--src/mame/drivers/e100.cpp2
-rw-r--r--src/mame/drivers/ec65.cpp16
-rw-r--r--src/mame/drivers/embargo.cpp16
-rw-r--r--src/mame/drivers/emu68k.cpp2
-rw-r--r--src/mame/drivers/enigma2.cpp4
-rw-r--r--src/mame/drivers/eolith16.cpp2
-rw-r--r--src/mame/drivers/epic14e.cpp2
-rw-r--r--src/mame/drivers/esh.cpp2
-rw-r--r--src/mame/drivers/esprit.cpp4
-rw-r--r--src/mame/drivers/eurit.cpp2
-rw-r--r--src/mame/drivers/eurocom2.cpp15
-rw-r--r--src/mame/drivers/excali64.cpp21
-rw-r--r--src/mame/drivers/expro02.cpp4
-rw-r--r--src/mame/drivers/f-32.cpp8
-rw-r--r--src/mame/drivers/facit4440.cpp2
-rw-r--r--src/mame/drivers/falco5220.cpp2
-rw-r--r--src/mame/drivers/fanucspmg.cpp46
-rw-r--r--src/mame/drivers/fb01.cpp2
-rw-r--r--src/mame/drivers/fk1.cpp14
-rw-r--r--src/mame/drivers/flipjack.cpp4
-rw-r--r--src/mame/drivers/flyball.cpp2
-rw-r--r--src/mame/drivers/fp1100.cpp2
-rw-r--r--src/mame/drivers/fp200.cpp32
-rw-r--r--src/mame/drivers/fp6000.cpp30
-rw-r--r--src/mame/drivers/fs3216.cpp2
-rw-r--r--src/mame/drivers/galgame.cpp2
-rw-r--r--src/mame/drivers/galpani3.cpp207
-rw-r--r--src/mame/drivers/galpanic_ms.cpp4
-rw-r--r--src/mame/drivers/gamecstl.cpp17
-rw-r--r--src/mame/drivers/gameking.cpp42
-rw-r--r--src/mame/drivers/gei.cpp2
-rw-r--r--src/mame/drivers/generalplus_gpl_unknown.cpp2
-rw-r--r--src/mame/drivers/geniusiq.cpp4
-rw-r--r--src/mame/drivers/gigatron.cpp4
-rw-r--r--src/mame/drivers/gkigt.cpp12
-rw-r--r--src/mame/drivers/gmaster.cpp34
-rw-r--r--src/mame/drivers/goldart.cpp6
-rw-r--r--src/mame/drivers/goldngam.cpp4
-rw-r--r--src/mame/drivers/goupil.cpp2
-rw-r--r--src/mame/drivers/gp2x.cpp11
-rw-r--r--src/mame/drivers/gp32.cpp55
-rw-r--r--src/mame/drivers/gpworld.cpp2
-rw-r--r--src/mame/drivers/grfd2301.cpp15
-rw-r--r--src/mame/drivers/gridcomp.cpp13
-rw-r--r--src/mame/drivers/gstream.cpp18
-rw-r--r--src/mame/drivers/gsword.cpp16
-rw-r--r--src/mame/drivers/gticlub.cpp2
-rw-r--r--src/mame/drivers/gts3a.cpp9
-rw-r--r--src/mame/drivers/gts80a.cpp8
-rw-r--r--src/mame/drivers/guab.cpp6
-rw-r--r--src/mame/drivers/gunpey.cpp54
-rw-r--r--src/mame/drivers/h19.cpp7
-rw-r--r--src/mame/drivers/halleys.cpp14
-rw-r--r--src/mame/drivers/hazeltin.cpp5
-rw-r--r--src/mame/drivers/hektor.cpp16
-rw-r--r--src/mame/drivers/hhtiger.cpp16
-rw-r--r--src/mame/drivers/highvdeo.cpp24
-rw-r--r--src/mame/drivers/hitme.cpp10
-rw-r--r--src/mame/drivers/homelab.cpp15
-rw-r--r--src/mame/drivers/homez80.cpp15
-rw-r--r--src/mame/drivers/hotblock.cpp2
-rw-r--r--src/mame/drivers/hotstuff.cpp11
-rw-r--r--src/mame/drivers/hp16500.cpp16
-rw-r--r--src/mame/drivers/hp2640.cpp4
-rw-r--r--src/mame/drivers/hp64k.cpp16
-rw-r--r--src/mame/drivers/hp80.cpp36
-rw-r--r--src/mame/drivers/hp95lx.cpp28
-rw-r--r--src/mame/drivers/hp9845.cpp36
-rw-r--r--src/mame/drivers/hp9k.cpp5
-rw-r--r--src/mame/drivers/hprot1.cpp4
-rw-r--r--src/mame/drivers/huebler.cpp21
-rw-r--r--src/mame/drivers/hunter16.cpp6
-rw-r--r--src/mame/drivers/husky.cpp14
-rw-r--r--src/mame/drivers/ibm6580.cpp38
-rw-r--r--src/mame/drivers/icatel.cpp4
-rw-r--r--src/mame/drivers/if800.cpp13
-rw-r--r--src/mame/drivers/igs011.cpp4
-rw-r--r--src/mame/drivers/imolagp.cpp2
-rw-r--r--src/mame/drivers/informer_207_100.cpp18
-rw-r--r--src/mame/drivers/informer_207_376.cpp20
-rw-r--r--src/mame/drivers/informer_213.cpp12
-rw-r--r--src/mame/drivers/invqix.cpp36
-rw-r--r--src/mame/drivers/ipds.cpp7
-rw-r--r--src/mame/drivers/irisha.cpp12
-rw-r--r--src/mame/drivers/itgambl2.cpp2
-rw-r--r--src/mame/drivers/itgambl3.cpp15
-rw-r--r--src/mame/drivers/itt1700.cpp2
-rw-r--r--src/mame/drivers/jangou.cpp2
-rw-r--r--src/mame/drivers/jantotsu.cpp19
-rw-r--r--src/mame/drivers/jchan.cpp8
-rw-r--r--src/mame/drivers/jollyjgr.cpp10
-rw-r--r--src/mame/drivers/jongkyo.cpp25
-rw-r--r--src/mame/drivers/jonos.cpp16
-rw-r--r--src/mame/drivers/joystand.cpp4
-rw-r--r--src/mame/drivers/jpmsys5.cpp12
-rw-r--r--src/mame/drivers/jr100.cpp17
-rw-r--r--src/mame/drivers/jr200.cpp15
-rw-r--r--src/mame/drivers/jtc.cpp26
-rw-r--r--src/mame/drivers/juku.cpp2
-rw-r--r--src/mame/drivers/jupace.cpp16
-rw-r--r--src/mame/drivers/jupiter.cpp15
-rw-r--r--src/mame/drivers/k8915.cpp15
-rw-r--r--src/mame/drivers/kdt6.cpp6
-rw-r--r--src/mame/drivers/kinst.cpp8
-rw-r--r--src/mame/drivers/konamigs.cpp2
-rw-r--r--src/mame/drivers/konmedal68k.cpp6
-rw-r--r--src/mame/drivers/kontest.cpp29
-rw-r--r--src/mame/drivers/korgds8.cpp4
-rw-r--r--src/mame/drivers/korgdss1.cpp2
-rw-r--r--src/mame/drivers/korgm1.cpp2
-rw-r--r--src/mame/drivers/krokha.cpp17
-rw-r--r--src/mame/drivers/kron.cpp16
-rw-r--r--src/mame/drivers/laser3k.cpp85
-rw-r--r--src/mame/drivers/laserbas.cpp4
-rw-r--r--src/mame/drivers/lastfght.cpp23
-rw-r--r--src/mame/drivers/lbeach.cpp4
-rw-r--r--src/mame/drivers/lft_craft.cpp2
-rw-r--r--src/mame/drivers/lft_phasor.cpp2
-rw-r--r--src/mame/drivers/limenko.cpp14
-rw-r--r--src/mame/drivers/llc1.cpp17
-rw-r--r--src/mame/drivers/llc2.cpp21
-rw-r--r--src/mame/drivers/lola8a.cpp12
-rw-r--r--src/mame/drivers/m14.cpp22
-rw-r--r--src/mame/drivers/m20.cpp9
-rw-r--r--src/mame/drivers/m3.cpp16
-rw-r--r--src/mame/drivers/m79152pc.cpp6
-rw-r--r--src/mame/drivers/m79amb.cpp10
-rw-r--r--src/mame/drivers/mac128.cpp20
-rw-r--r--src/mame/drivers/magicard.cpp25
-rw-r--r--src/mame/drivers/marinedt.cpp12
-rw-r--r--src/mame/drivers/maygayv1.cpp14
-rw-r--r--src/mame/drivers/mbc200.cpp12
-rw-r--r--src/mame/drivers/mc8020.cpp14
-rw-r--r--src/mame/drivers/mc8030.cpp33
-rw-r--r--src/mame/drivers/mdt60.cpp2
-rw-r--r--src/mame/drivers/mediagx.cpp76
-rw-r--r--src/mame/drivers/megaplay.cpp6
-rw-r--r--src/mame/drivers/megatech.cpp4
-rw-r--r--src/mame/drivers/meijinsn.cpp2
-rw-r--r--src/mame/drivers/mekd3.cpp55
-rw-r--r--src/mame/drivers/mekd4.cpp48
-rw-r--r--src/mame/drivers/merit.cpp15
-rw-r--r--src/mame/drivers/meritum.cpp50
-rw-r--r--src/mame/drivers/mes.cpp15
-rw-r--r--src/mame/drivers/metalmx.cpp2
-rw-r--r--src/mame/drivers/meyc8080.cpp18
-rw-r--r--src/mame/drivers/meyc8088.cpp2
-rw-r--r--src/mame/drivers/micral.cpp15
-rw-r--r--src/mame/drivers/microb.cpp4
-rw-r--r--src/mame/drivers/microterm_f8.cpp2
-rw-r--r--src/mame/drivers/microvsn.cpp2
-rw-r--r--src/mame/drivers/mikro80.cpp2
-rw-r--r--src/mame/drivers/mikrosha.cpp2
-rw-r--r--src/mame/drivers/mindset.cpp44
-rw-r--r--src/mame/drivers/miniboy7.cpp6
-rw-r--r--src/mame/drivers/minivadr.cpp16
-rw-r--r--src/mame/drivers/missile.cpp17
-rw-r--r--src/mame/drivers/mjsenpu.cpp26
-rw-r--r--src/mame/drivers/mjsister.cpp8
-rw-r--r--src/mame/drivers/ml20.cpp2
-rw-r--r--src/mame/drivers/mlanding.cpp6
-rw-r--r--src/mame/drivers/mmagic.cpp18
-rw-r--r--src/mame/drivers/modellot.cpp16
-rw-r--r--src/mame/drivers/monty.cpp2
-rw-r--r--src/mame/drivers/monzagp.cpp4
-rw-r--r--src/mame/drivers/mpu4plasma.cpp26
-rw-r--r--src/mame/drivers/mpu4vid.cpp43
-rw-r--r--src/mame/drivers/ms0515.cpp21
-rw-r--r--src/mame/drivers/ms6102.cpp4
-rw-r--r--src/mame/drivers/mstation.cpp4
-rw-r--r--src/mame/drivers/mtd1256.cpp4
-rw-r--r--src/mame/drivers/multi16.cpp4
-rw-r--r--src/mame/drivers/multi8.cpp31
-rw-r--r--src/mame/drivers/mx2178.cpp14
-rw-r--r--src/mame/drivers/myb3k.cpp10
-rw-r--r--src/mame/drivers/mycom.cpp27
-rw-r--r--src/mame/drivers/mz2000.cpp22
-rw-r--r--src/mame/drivers/mz2500.cpp18
-rw-r--r--src/mame/drivers/mz3500.cpp42
-rw-r--r--src/mame/drivers/mz6500.cpp15
-rw-r--r--src/mame/drivers/nakajies.cpp2
-rw-r--r--src/mame/drivers/namcos21.cpp19
-rw-r--r--src/mame/drivers/namcos23.cpp14
-rw-r--r--src/mame/drivers/nanos.cpp10
-rw-r--r--src/mame/drivers/ncd68k.cpp6
-rw-r--r--src/mame/drivers/nexus3d.cpp8
-rw-r--r--src/mame/drivers/ngen.cpp4
-rw-r--r--src/mame/drivers/nightgal.cpp8
-rw-r--r--src/mame/drivers/nightmare.cpp10
-rw-r--r--src/mame/drivers/nmg5.cpp6
-rw-r--r--src/mame/drivers/nokia_3310.cpp2
-rw-r--r--src/mame/drivers/notetaker.cpp41
-rw-r--r--src/mame/drivers/novag_diablo.cpp2
-rw-r--r--src/mame/drivers/novag_sexpert.cpp2
-rw-r--r--src/mame/drivers/nyny.cpp6
-rw-r--r--src/mame/drivers/octopus.cpp2
-rw-r--r--src/mame/drivers/odyssey2.cpp10
-rw-r--r--src/mame/drivers/okean240.cpp13
-rw-r--r--src/mame/drivers/olyboss.cpp7
-rw-r--r--src/mame/drivers/ondra.cpp13
-rw-r--r--src/mame/drivers/orao.cpp2
-rw-r--r--src/mame/drivers/oric.cpp2
-rw-r--r--src/mame/drivers/osbexec.cpp2
-rw-r--r--src/mame/drivers/othello.cpp6
-rw-r--r--src/mame/drivers/panicr.cpp14
-rw-r--r--src/mame/drivers/pasha2.cpp21
-rw-r--r--src/mame/drivers/paso1600.cpp40
-rw-r--r--src/mame/drivers/pasogo.cpp29
-rw-r--r--src/mame/drivers/pasopia.cpp4
-rw-r--r--src/mame/drivers/pasopia7.cpp32
-rw-r--r--src/mame/drivers/pc100.cpp27
-rw-r--r--src/mame/drivers/pc1500.cpp4
-rw-r--r--src/mame/drivers/pc2000.cpp8
-rw-r--r--src/mame/drivers/pc8001.cpp11
-rw-r--r--src/mame/drivers/pc8801.cpp169
-rw-r--r--src/mame/drivers/pc88va.cpp108
-rw-r--r--src/mame/drivers/pce220.cpp6
-rw-r--r--src/mame/drivers/pcm.cpp15
-rw-r--r--src/mame/drivers/pcw.cpp2
-rw-r--r--src/mame/drivers/pcxt.cpp21
-rw-r--r--src/mame/drivers/pda600.cpp2
-rw-r--r--src/mame/drivers/pegasus.cpp19
-rw-r--r--src/mame/drivers/peoplepc.cpp13
-rw-r--r--src/mame/drivers/pet.cpp36
-rw-r--r--src/mame/drivers/pg685.cpp50
-rw-r--r--src/mame/drivers/photon2.cpp54
-rw-r--r--src/mame/drivers/phunsy.cpp14
-rw-r--r--src/mame/drivers/piggypas.cpp2
-rw-r--r--src/mame/drivers/pinball2k.cpp52
-rw-r--r--src/mame/drivers/plan80.cpp15
-rw-r--r--src/mame/drivers/pmd85.cpp12
-rw-r--r--src/mame/drivers/pockstat.cpp2
-rw-r--r--src/mame/drivers/poisk1.cpp40
-rw-r--r--src/mame/drivers/pokemini.cpp44
-rw-r--r--src/mame/drivers/popobear.cpp2
-rw-r--r--src/mame/drivers/pp.cpp4
-rw-r--r--src/mame/drivers/prestige.cpp2
-rw-r--r--src/mame/drivers/progolf.cpp26
-rw-r--r--src/mame/drivers/proteus3.cpp18
-rw-r--r--src/mame/drivers/psion.cpp4
-rw-r--r--src/mame/drivers/ptcsol.cpp21
-rw-r--r--src/mame/drivers/px4.cpp24
-rw-r--r--src/mame/drivers/pyl601.cpp47
-rw-r--r--src/mame/drivers/pzletime.cpp35
-rw-r--r--src/mame/drivers/quizo.cpp8
-rw-r--r--src/mame/drivers/qvt102.cpp2
-rw-r--r--src/mame/drivers/qvt103.cpp2
-rw-r--r--src/mame/drivers/qvt190.cpp2
-rw-r--r--src/mame/drivers/qvt70.cpp2
-rw-r--r--src/mame/drivers/qx10.cpp12
-rw-r--r--src/mame/drivers/r2dtank.cpp20
-rw-r--r--src/mame/drivers/rabbit.cpp42
-rw-r--r--src/mame/drivers/rainbow.cpp4
-rw-r--r--src/mame/drivers/rastersp.cpp2
-rw-r--r--src/mame/drivers/rc702.cpp14
-rw-r--r--src/mame/drivers/rc759.cpp2
-rw-r--r--src/mame/drivers/rd100.cpp2
-rw-r--r--src/mame/drivers/rex6000.cpp8
-rw-r--r--src/mame/drivers/roland_cm32p.cpp15
-rw-r--r--src/mame/drivers/roland_d10.cpp15
-rw-r--r--src/mame/drivers/roland_mt32.cpp2
-rw-r--r--src/mame/drivers/roland_s10.cpp4
-rw-r--r--src/mame/drivers/rollext.cpp4
-rw-r--r--src/mame/drivers/rotaryf.cpp20
-rw-r--r--src/mame/drivers/roul.cpp7
-rw-r--r--src/mame/drivers/royalmah.cpp2
-rw-r--r--src/mame/drivers/rt1715.cpp4
-rw-r--r--src/mame/drivers/rx78.cpp4
-rw-r--r--src/mame/drivers/rz1.cpp2
-rw-r--r--src/mame/drivers/saitek_intchess.cpp2
-rw-r--r--src/mame/drivers/saitek_risc2500.cpp2
-rw-r--r--src/mame/drivers/samcoupe.cpp24
-rw-r--r--src/mame/drivers/sapi1.cpp70
-rw-r--r--src/mame/drivers/sbowling.cpp2
-rw-r--r--src/mame/drivers/sbrain.cpp15
-rw-r--r--src/mame/drivers/scopus.cpp11
-rw-r--r--src/mame/drivers/scv.cpp82
-rw-r--r--src/mame/drivers/scyclone.cpp8
-rw-r--r--src/mame/drivers/seabattl.cpp22
-rw-r--r--src/mame/drivers/segac2.cpp6
-rw-r--r--src/mame/drivers/segae.cpp14
-rw-r--r--src/mame/drivers/sfbonus.cpp32
-rw-r--r--src/mame/drivers/shougi.cpp2
-rw-r--r--src/mame/drivers/sigmab98.cpp4
-rw-r--r--src/mame/drivers/sk101bl.cpp2
-rw-r--r--src/mame/drivers/skeetsht.cpp7
-rw-r--r--src/mame/drivers/skimaxx.cpp6
-rw-r--r--src/mame/drivers/sliver.cpp12
-rw-r--r--src/mame/drivers/slotcarn.cpp15
-rw-r--r--src/mame/drivers/sm1800.cpp9
-rw-r--r--src/mame/drivers/sm7238.cpp30
-rw-r--r--src/mame/drivers/smc777.cpp61
-rw-r--r--src/mame/drivers/smotor.cpp2
-rw-r--r--src/mame/drivers/smsmcorp.cpp7
-rw-r--r--src/mame/drivers/socrates.cpp25
-rw-r--r--src/mame/drivers/sorcerer.cpp16
-rw-r--r--src/mame/drivers/spaceg.cpp9
-rw-r--r--src/mame/drivers/spc1500.cpp49
-rw-r--r--src/mame/drivers/special_gambl.cpp4
-rw-r--r--src/mame/drivers/speglsht.cpp16
-rw-r--r--src/mame/drivers/spg29x.cpp4
-rw-r--r--src/mame/drivers/spiders.cpp26
-rw-r--r--src/mame/drivers/spinb.cpp4
-rw-r--r--src/mame/drivers/splash_ms.cpp4
-rw-r--r--src/mame/drivers/srmp5.cpp37
-rw-r--r--src/mame/drivers/ssem.cpp5
-rw-r--r--src/mame/drivers/ssingles.cpp26
-rw-r--r--src/mame/drivers/sstrangr.cpp16
-rw-r--r--src/mame/drivers/studio2.cpp2
-rw-r--r--src/mame/drivers/sun2.cpp31
-rw-r--r--src/mame/drivers/sun3.cpp99
-rw-r--r--src/mame/drivers/sun3x.cpp31
-rw-r--r--src/mame/drivers/supertnk.cpp18
-rw-r--r--src/mame/drivers/supracan.cpp36
-rw-r--r--src/mame/drivers/suprgolf.cpp38
-rw-r--r--src/mame/drivers/svision.cpp4
-rw-r--r--src/mame/drivers/swyft.cpp13
-rw-r--r--src/mame/drivers/sys9002.cpp14
-rw-r--r--src/mame/drivers/systel1.cpp2
-rw-r--r--src/mame/drivers/taitotz.cpp26
-rw-r--r--src/mame/drivers/taitowlf.cpp14
-rw-r--r--src/mame/drivers/tamag1.cpp2
-rw-r--r--src/mame/drivers/tandy2k.cpp6
-rw-r--r--src/mame/drivers/tapatune.cpp4
-rw-r--r--src/mame/drivers/tattack.cpp22
-rw-r--r--src/mame/drivers/tavernie.cpp18
-rw-r--r--src/mame/drivers/tek440x.cpp19
-rw-r--r--src/mame/drivers/teleray10.cpp2
-rw-r--r--src/mame/drivers/tgtpanic.cpp24
-rw-r--r--src/mame/drivers/ti74.cpp6
-rw-r--r--src/mame/drivers/ti89.cpp13
-rw-r--r--src/mame/drivers/ti931.cpp4
-rw-r--r--src/mame/drivers/tickee.cpp20
-rw-r--r--src/mame/drivers/tiki100.cpp6
-rw-r--r--src/mame/drivers/tim100.cpp17
-rw-r--r--src/mame/drivers/tk635.cpp4
-rw-r--r--src/mame/drivers/tmmjprd.cpp18
-rw-r--r--src/mame/drivers/toratora.cpp10
-rw-r--r--src/mame/drivers/toypop.cpp10
-rw-r--r--src/mame/drivers/trs80dt1.cpp4
-rw-r--r--src/mame/drivers/trs80m2.cpp4
-rw-r--r--src/mame/drivers/ts803.cpp17
-rw-r--r--src/mame/drivers/ttchamp.cpp42
-rw-r--r--src/mame/drivers/tulip1.cpp4
-rw-r--r--src/mame/drivers/tv910.cpp18
-rw-r--r--src/mame/drivers/tv950.cpp2
-rw-r--r--src/mame/drivers/tv955.cpp2
-rw-r--r--src/mame/drivers/tv990.cpp73
-rw-r--r--src/mame/drivers/tvc.cpp25
-rw-r--r--src/mame/drivers/tvgame.cpp11
-rw-r--r--src/mame/drivers/twins.cpp4
-rw-r--r--src/mame/drivers/ultrsprt.cpp6
-rw-r--r--src/mame/drivers/unior.cpp4
-rw-r--r--src/mame/drivers/unistar.cpp4
-rw-r--r--src/mame/drivers/univac.cpp2
-rw-r--r--src/mame/drivers/unixpc.cpp2
-rw-r--r--src/mame/drivers/unkhorse.cpp2
-rw-r--r--src/mame/drivers/unkpoker.cpp2
-rw-r--r--src/mame/drivers/uzebox.cpp4
-rw-r--r--src/mame/drivers/v6809.cpp14
-rw-r--r--src/mame/drivers/vboy.cpp47
-rw-r--r--src/mame/drivers/vcombat.cpp8
-rw-r--r--src/mame/drivers/vegaeo.cpp2
-rw-r--r--src/mame/drivers/victor9k.cpp2
-rw-r--r--src/mame/drivers/video21.cpp15
-rw-r--r--src/mame/drivers/vis.cpp17
-rw-r--r--src/mame/drivers/vixen.cpp2
-rw-r--r--src/mame/drivers/vk100.cpp2
-rw-r--r--src/mame/drivers/vp101.cpp4
-rw-r--r--src/mame/drivers/vt1682.cpp20
-rw-r--r--src/mame/drivers/vt240.cpp17
-rw-r--r--src/mame/drivers/vta2000.cpp23
-rw-r--r--src/mame/drivers/warpsped.cpp2
-rw-r--r--src/mame/drivers/wheelfir.cpp244
-rw-r--r--src/mame/drivers/wicat.cpp4
-rw-r--r--src/mame/drivers/wpc_dot.cpp11
-rw-r--r--src/mame/drivers/wy100.cpp2
-rw-r--r--src/mame/drivers/wy50.cpp4
-rw-r--r--src/mame/drivers/x07.cpp4
-rw-r--r--src/mame/drivers/xerox820.cpp32
-rw-r--r--src/mame/drivers/xtheball.cpp15
-rw-r--r--src/mame/drivers/xyonix.cpp8
-rw-r--r--src/mame/drivers/ymdx11.cpp2
-rw-r--r--src/mame/drivers/ymtx81z.cpp2
-rw-r--r--src/mame/drivers/z100.cpp2
-rw-r--r--src/mame/drivers/z1013.cpp15
-rw-r--r--src/mame/drivers/z22.cpp2
-rw-r--r--src/mame/drivers/z9001.cpp21
-rw-r--r--src/mame/drivers/zorba.cpp7
-rw-r--r--src/mame/drivers/zrt80.cpp18
-rw-r--r--src/mame/includes/segas32.h2
-rw-r--r--src/mame/machine/3do.cpp4
-rw-r--r--src/mame/machine/3dom2.cpp6
-rw-r--r--src/mame/machine/aim65.cpp5
-rw-r--r--src/mame/machine/amstrad.cpp6
-rw-r--r--src/mame/machine/b2m.cpp19
-rw-r--r--src/mame/machine/bk.cpp6
-rw-r--r--src/mame/machine/cedar_magnet_plane.cpp2
-rw-r--r--src/mame/machine/cedar_magnet_sprite.cpp2
-rw-r--r--src/mame/machine/concept.cpp2
-rw-r--r--src/mame/machine/dragon.cpp2
-rw-r--r--src/mame/machine/gamepock.cpp64
-rw-r--r--src/mame/machine/imds2ioc.cpp9
-rw-r--r--src/mame/machine/inder_vid.cpp9
-rw-r--r--src/mame/machine/lynx.cpp4
-rw-r--r--src/mame/machine/megacd.cpp2
-rw-r--r--src/mame/machine/megadriv.cpp6
-rw-r--r--src/mame/machine/model1io2.cpp2
-rw-r--r--src/mame/machine/osborne1.cpp4
-rw-r--r--src/mame/machine/partner.cpp9
-rw-r--r--src/mame/machine/primo.cpp2
-rw-r--r--src/mame/machine/radio86.cpp2
-rw-r--r--src/mame/machine/sms.cpp16
-rw-r--r--src/mame/machine/st0016.cpp4
-rw-r--r--src/mame/machine/teleprinter.cpp15
-rw-r--r--src/mame/machine/zx.cpp8
-rw-r--r--src/mame/video/1943.cpp8
-rw-r--r--src/mame/video/20pacgal.cpp8
-rw-r--r--src/mame/video/40love.cpp27
-rw-r--r--src/mame/video/733_asr.cpp2
-rw-r--r--src/mame/video/8080bw.cpp18
-rw-r--r--src/mame/video/abc1600.cpp2
-rw-r--r--src/mame/video/abc80.cpp2
-rw-r--r--src/mame/video/abc800.cpp16
-rw-r--r--src/mame/video/abc802.cpp6
-rw-r--r--src/mame/video/abc806.cpp8
-rw-r--r--src/mame/video/advision.cpp4
-rw-r--r--src/mame/video/aeroboto.cpp39
-rw-r--r--src/mame/video/aerofgt.cpp16
-rw-r--r--src/mame/video/agat7.cpp72
-rw-r--r--src/mame/video/agat9.cpp164
-rw-r--r--src/mame/video/airraid_dev.cpp4
-rw-r--r--src/mame/video/amiga.cpp6
-rw-r--r--src/mame/video/amigaaga.cpp6
-rw-r--r--src/mame/video/ams40041.cpp8
-rw-r--r--src/mame/video/apexc.cpp4
-rw-r--r--src/mame/video/apollo.cpp42
-rw-r--r--src/mame/video/apple2.cpp473
-rw-r--r--src/mame/video/apple3.cpp187
-rw-r--r--src/mame/video/arcadecl.cpp8
-rw-r--r--src/mame/video/arcadia.cpp6
-rw-r--r--src/mame/video/argus.cpp96
-rw-r--r--src/mame/video/armedf.cpp30
-rw-r--r--src/mame/video/artmagic.cpp9
-rw-r--r--src/mame/video/astrocde.cpp28
-rw-r--r--src/mame/video/atarig42.cpp23
-rw-r--r--src/mame/video/atarigt.cpp45
-rw-r--r--src/mame/video/atarigx2.cpp19
-rw-r--r--src/mame/video/atarimo.cpp2
-rw-r--r--src/mame/video/atarimo.h2
-rw-r--r--src/mame/video/atarirle.cpp24
-rw-r--r--src/mame/video/atarist.cpp4
-rw-r--r--src/mame/video/atarisy1.cpp4
-rw-r--r--src/mame/video/atarisy2.cpp8
-rw-r--r--src/mame/video/aussiebyte.cpp15
-rw-r--r--src/mame/video/avigo.cpp22
-rw-r--r--src/mame/video/badlands.cpp7
-rw-r--r--src/mame/video/balsente.cpp22
-rw-r--r--src/mame/video/batman.cpp18
-rw-r--r--src/mame/video/battlane.cpp23
-rw-r--r--src/mame/video/bbc.cpp4
-rw-r--r--src/mame/video/bbusters.cpp13
-rw-r--r--src/mame/video/bigevglf.cpp9
-rw-r--r--src/mame/video/bking.cpp6
-rw-r--r--src/mame/video/blockout.cpp4
-rw-r--r--src/mame/video/blstroid.cpp6
-rw-r--r--src/mame/video/boogwing.cpp23
-rw-r--r--src/mame/video/bosco.cpp8
-rw-r--r--src/mame/video/btoads.cpp14
-rw-r--r--src/mame/video/buggychl.cpp48
-rw-r--r--src/mame/video/busicom.cpp4
-rw-r--r--src/mame/video/capbowl.cpp4
-rw-r--r--src/mame/video/carpolo.cpp48
-rw-r--r--src/mame/video/ccastles.cpp40
-rw-r--r--src/mame/video/cclimber.cpp10
-rw-r--r--src/mame/video/cgc7900.cpp6
-rw-r--r--src/mame/video/chaknpop.cpp11
-rw-r--r--src/mame/video/changela.cpp194
-rw-r--r--src/mame/video/channelf.cpp14
-rw-r--r--src/mame/video/cheekyms.cpp13
-rw-r--r--src/mame/video/circus.cpp21
-rw-r--r--src/mame/video/cloak.cpp10
-rw-r--r--src/mame/video/cloud9.cpp41
-rw-r--r--src/mame/video/copsnrob.cpp28
-rw-r--r--src/mame/video/cosmic.cpp25
-rw-r--r--src/mame/video/cps1.cpp11
-rw-r--r--src/mame/video/crbaloon.cpp4
-rw-r--r--src/mame/video/crgolf.cpp10
-rw-r--r--src/mame/video/crt.cpp11
-rw-r--r--src/mame/video/cvs.cpp75
-rw-r--r--src/mame/video/cyberbal.cpp7
-rw-r--r--src/mame/video/cybstorm.cpp16
-rw-r--r--src/mame/video/dai.cpp397
-rw-r--r--src/mame/video/darkmist.cpp8
-rw-r--r--src/mame/video/dassault.cpp16
-rw-r--r--src/mame/video/dcheese.cpp11
-rw-r--r--src/mame/video/dday.cpp12
-rw-r--r--src/mame/video/decbac06.cpp8
-rw-r--r--src/mame/video/deco16ic.cpp12
-rw-r--r--src/mame/video/deco32.cpp20
-rw-r--r--src/mame/video/deco_mlc.cpp4
-rw-r--r--src/mame/video/deco_zoomspr.cpp33
-rw-r--r--src/mame/video/decocass.cpp42
-rw-r--r--src/mame/video/decodmd1.cpp22
-rw-r--r--src/mame/video/decodmd2.cpp7
-rw-r--r--src/mame/video/decodmd3.cpp4
-rw-r--r--src/mame/video/decospr.cpp28
-rw-r--r--src/mame/video/deniam.cpp24
-rw-r--r--src/mame/video/dgn_beta.cpp6
-rw-r--r--src/mame/video/dkong.cpp27
-rw-r--r--src/mame/video/dogfgt.cpp4
-rw-r--r--src/mame/video/dpb_combiner.cpp2
-rw-r--r--src/mame/video/dribling.cpp2
-rw-r--r--src/mame/video/dynax.cpp46
-rw-r--r--src/mame/video/dynduke.cpp15
-rw-r--r--src/mame/video/elan_eu3a05vid.cpp6
-rw-r--r--src/mame/video/elan_eu3a14vid.cpp8
-rw-r--r--src/mame/video/electron.cpp2
-rw-r--r--src/mame/video/eolith.cpp2
-rw-r--r--src/mame/video/epos.cpp8
-rw-r--r--src/mame/video/eprom.cpp33
-rw-r--r--src/mame/video/equites.cpp8
-rw-r--r--src/mame/video/esripsys.cpp15
-rw-r--r--src/mame/video/exidy.cpp50
-rw-r--r--src/mame/video/exidy440.cpp11
-rw-r--r--src/mame/video/exterm.cpp6
-rw-r--r--src/mame/video/fgoal.cpp24
-rw-r--r--src/mame/video/firetrk.cpp10
-rw-r--r--src/mame/video/fm7.cpp21
-rw-r--r--src/mame/video/fmtowns.cpp94
-rw-r--r--src/mame/video/gaelco2.cpp4
-rw-r--r--src/mame/video/gaelco3d.cpp14
-rw-r--r--src/mame/video/gaelco_wrally_sprites.cpp8
-rw-r--r--src/mame/video/galastrm.cpp12
-rw-r--r--src/mame/video/galaxia.cpp50
-rw-r--r--src/mame/video/galaxian.cpp12
-rw-r--r--src/mame/video/galaxold.cpp35
-rw-r--r--src/mame/video/galaxy.cpp43
-rw-r--r--src/mame/video/galpani2.cpp8
-rw-r--r--src/mame/video/galpanic.cpp10
-rw-r--r--src/mame/video/galspnbl.cpp6
-rw-r--r--src/mame/video/gamate.cpp2
-rw-r--r--src/mame/video/gamecom.cpp13
-rw-r--r--src/mame/video/gameplan.cpp10
-rw-r--r--src/mame/video/gaplus.cpp2
-rw-r--r--src/mame/video/gauntlet.cpp4
-rw-r--r--src/mame/video/gic.cpp10
-rw-r--r--src/mame/video/gladiatr.cpp4
-rw-r--r--src/mame/video/glass.cpp12
-rw-r--r--src/mame/video/gomoku.cpp6
-rw-r--r--src/mame/video/gp9001.cpp10
-rw-r--r--src/mame/video/grchamp.cpp106
-rw-r--r--src/mame/video/gridlee.cpp26
-rw-r--r--src/mame/video/h01x.cpp21
-rw-r--r--src/mame/video/harddriv.cpp20
-rw-r--r--src/mame/video/hec2hrp.cpp4
-rw-r--r--src/mame/video/hnayayoi.cpp2
-rw-r--r--src/mame/video/hng64.cpp197
-rw-r--r--src/mame/video/hng64_3d.hxx4
-rw-r--r--src/mame/video/hp48.cpp2
-rw-r--r--src/mame/video/hyhoo.cpp70
-rw-r--r--src/mame/video/igs017_igs031.cpp4
-rw-r--r--src/mame/video/ikki.cpp4
-rw-r--r--src/mame/video/itech8.cpp88
-rw-r--r--src/mame/video/jaguar.cpp2
-rw-r--r--src/mame/video/jedi.cpp8
-rw-r--r--src/mame/video/jpmimpct.cpp9
-rw-r--r--src/mame/video/k001005.cpp33
-rw-r--r--src/mame/video/k001604.cpp4
-rw-r--r--src/mame/video/k053246_k053247_k055673.cpp2
-rw-r--r--src/mame/video/k053250.cpp8
-rw-r--r--src/mame/video/k053250_ps.cpp8
-rw-r--r--src/mame/video/k053936.cpp4
-rw-r--r--src/mame/video/k054156_k054157_k056832.cpp8
-rw-r--r--src/mame/video/k054338.cpp2
-rw-r--r--src/mame/video/k057714.cpp2
-rw-r--r--src/mame/video/k1ge.cpp22
-rw-r--r--src/mame/video/kaneko16.cpp13
-rw-r--r--src/mame/video/kaneko_spr.cpp19
-rw-r--r--src/mame/video/kangaroo.cpp7
-rw-r--r--src/mame/video/kaypro.cpp52
-rw-r--r--src/mame/video/kc.cpp25
-rw-r--r--src/mame/video/klax.cpp4
-rw-r--r--src/mame/video/konamigx.cpp33
-rw-r--r--src/mame/video/ladybug.cpp2
-rw-r--r--src/mame/video/laserbat.cpp12
-rw-r--r--src/mame/video/lasso.cpp20
-rw-r--r--src/mame/video/lazercmd.cpp10
-rw-r--r--src/mame/video/leland.cpp2
-rw-r--r--src/mame/video/lemmings.cpp25
-rw-r--r--src/mame/video/lethalj.cpp18
-rw-r--r--src/mame/video/liberatr.cpp34
-rw-r--r--src/mame/video/light.cpp6
-rw-r--r--src/mame/video/lockon.cpp76
-rw-r--r--src/mame/video/lordgun.cpp19
-rw-r--r--src/mame/video/lviv.cpp11
-rw-r--r--src/mame/video/m10.cpp6
-rw-r--r--src/mame/video/m57.cpp25
-rw-r--r--src/mame/video/m58.cpp4
-rw-r--r--src/mame/video/mac.cpp363
-rw-r--r--src/mame/video/madalien.cpp6
-rw-r--r--src/mame/video/magmax.cpp2
-rw-r--r--src/mame/video/malzak.cpp16
-rw-r--r--src/mame/video/mappy.cpp9
-rw-r--r--src/mame/video/maria.cpp3
-rw-r--r--src/mame/video/mbc55x.cpp47
-rw-r--r--src/mame/video/mbee.cpp2
-rw-r--r--src/mame/video/mcatadv.cpp4
-rw-r--r--src/mame/video/mcd212.cpp5
-rw-r--r--src/mame/video/mcr.cpp12
-rw-r--r--src/mame/video/megasys1.cpp20
-rw-r--r--src/mame/video/mermaid.cpp16
-rw-r--r--src/mame/video/micro3d.cpp11
-rw-r--r--src/mame/video/midtunit.cpp8
-rw-r--r--src/mame/video/midtview.ipp2
-rw-r--r--src/mame/video/midvunit.cpp8
-rw-r--r--src/mame/video/midyunit.cpp7
-rw-r--r--src/mame/video/midzeus.cpp6
-rw-r--r--src/mame/video/mikromik.cpp19
-rw-r--r--src/mame/video/mmdisplay2.cpp2
-rw-r--r--src/mame/video/model1.cpp8
-rw-r--r--src/mame/video/model2.cpp9
-rw-r--r--src/mame/video/model2rd.hxx6
-rw-r--r--src/mame/video/model3.cpp49
-rw-r--r--src/mame/video/momoko.cpp14
-rw-r--r--src/mame/video/ms32.cpp24
-rw-r--r--src/mame/video/mw8080bw.cpp20
-rw-r--r--src/mame/video/mz700.cpp40
-rw-r--r--src/mame/video/mz80.cpp45
-rw-r--r--src/mame/video/n64.cpp4
-rw-r--r--src/mame/video/n8080.cpp54
-rw-r--r--src/mame/video/namco_c355spr.cpp24
-rw-r--r--src/mame/video/namcona1.cpp12
-rw-r--r--src/mame/video/namcos21_3d.cpp12
-rw-r--r--src/mame/video/namcos22.cpp32
-rw-r--r--src/mame/video/namcos2_roz.cpp6
-rw-r--r--src/mame/video/namcos2_sprite.cpp6
-rw-r--r--src/mame/video/nbmj8688.cpp2
-rw-r--r--src/mame/video/nbmj8891.cpp4
-rw-r--r--src/mame/video/nbmj8900.cpp4
-rw-r--r--src/mame/video/nbmj8991.cpp12
-rw-r--r--src/mame/video/nbmj9195.cpp2
-rw-r--r--src/mame/video/nc.cpp2
-rw-r--r--src/mame/video/neogeo_spr.cpp6
-rw-r--r--src/mame/video/newbrain.cpp4
-rw-r--r--src/mame/video/nick.cpp2
-rw-r--r--src/mame/video/ninjakd2.cpp2
-rw-r--r--src/mame/video/nitedrvr.cpp2
-rw-r--r--src/mame/video/niyanpai.cpp2
-rw-r--r--src/mame/video/offtwall.cpp7
-rw-r--r--src/mame/video/ojankohs.cpp24
-rw-r--r--src/mame/video/orion.cpp2
-rw-r--r--src/mame/video/osi.cpp8
-rw-r--r--src/mame/video/p2000t.cpp16
-rw-r--r--src/mame/video/pacland.cpp10
-rw-r--r--src/mame/video/paradise.cpp10
-rw-r--r--src/mame/video/pastelg.cpp2
-rw-r--r--src/mame/video/pc080sn.cpp29
-rw-r--r--src/mame/video/pc4.cpp8
-rw-r--r--src/mame/video/pc6001.cpp207
-rw-r--r--src/mame/video/pc9801.cpp98
-rw-r--r--src/mame/video/pc_t1t.cpp246
-rw-r--r--src/mame/video/pcd.cpp8
-rw-r--r--src/mame/video/pcw.cpp16
-rw-r--r--src/mame/video/pcw16.cpp2
-rw-r--r--src/mame/video/pdp1.cpp7
-rw-r--r--src/mame/video/pgm.cpp16
-rw-r--r--src/mame/video/pgm2.cpp10
-rw-r--r--src/mame/video/pitnrun.cpp2
-rw-r--r--src/mame/video/pk8000.cpp31
-rw-r--r--src/mame/video/pk8020.cpp10
-rw-r--r--src/mame/video/playmark.cpp20
-rw-r--r--src/mame/video/pocketc.cpp2
-rw-r--r--src/mame/video/polepos.cpp2
-rw-r--r--src/mame/video/policetr.cpp16
-rw-r--r--src/mame/video/popeye.cpp12
-rw-r--r--src/mame/video/powervr2.cpp346
-rw-r--r--src/mame/video/pp01.cpp2
-rw-r--r--src/mame/video/psikyosh.cpp56
-rw-r--r--src/mame/video/qix.cpp4
-rw-r--r--src/mame/video/quasar.cpp18
-rw-r--r--src/mame/video/raiden2.cpp6
-rw-r--r--src/mame/video/rallyx.cpp4
-rw-r--r--src/mame/video/rampart.cpp10
-rw-r--r--src/mame/video/redalert.cpp77
-rw-r--r--src/mame/video/redclash.cpp2
-rw-r--r--src/mame/video/relief.cpp10
-rw-r--r--src/mame/video/rltennis.cpp10
-rw-r--r--src/mame/video/rm380z.cpp53
-rw-r--r--src/mame/video/rmnimbus.cpp10
-rw-r--r--src/mame/video/rockrage.cpp2
-rw-r--r--src/mame/video/rohga.cpp12
-rw-r--r--src/mame/video/route16.cpp20
-rw-r--r--src/mame/video/rpunch.cpp10
-rw-r--r--src/mame/video/segag80r.cpp27
-rw-r--r--src/mame/video/segaic16.cpp11
-rw-r--r--src/mame/video/segaic16_road.cpp4
-rw-r--r--src/mame/video/segaic24.cpp72
-rw-r--r--src/mame/video/segas32.cpp270
-rw-r--r--src/mame/video/seibuspi.cpp10
-rw-r--r--src/mame/video/senjyo.cpp6
-rw-r--r--src/mame/video/seta.cpp8
-rw-r--r--src/mame/video/seta2.cpp4
-rw-r--r--src/mame/video/shuuz.cpp8
-rw-r--r--src/mame/video/sidearms.cpp23
-rw-r--r--src/mame/video/sknsspr.cpp43
-rw-r--r--src/mame/video/skullxbo.cpp14
-rw-r--r--src/mame/video/skyfox.cpp2
-rw-r--r--src/mame/video/skyraid.cpp17
-rw-r--r--src/mame/video/spacefb.cpp67
-rw-r--r--src/mame/video/special.cpp30
-rw-r--r--src/mame/video/spectrum.cpp6
-rw-r--r--src/mame/video/splash.cpp2
-rw-r--r--src/mame/video/sprint2.cpp9
-rw-r--r--src/mame/video/sprint4.cpp2
-rw-r--r--src/mame/video/sprint8.cpp4
-rw-r--r--src/mame/video/sspeedr.cpp10
-rw-r--r--src/mame/video/ssv.cpp2
-rw-r--r--src/mame/video/stactics.cpp17
-rw-r--r--src/mame/video/starcrus.cpp16
-rw-r--r--src/mame/video/starfield_05xx.cpp2
-rw-r--r--src/mame/video/starfire.cpp16
-rw-r--r--src/mame/video/starshp1.cpp29
-rw-r--r--src/mame/video/stfight_dev.cpp4
-rw-r--r--src/mame/video/stic.cpp10
-rw-r--r--src/mame/video/super80.cpp10
-rw-r--r--src/mame/video/superqix.cpp8
-rw-r--r--src/mame/video/suprloco.cpp2
-rw-r--r--src/mame/video/suprnova.cpp127
-rw-r--r--src/mame/video/system1.cpp12
-rw-r--r--src/mame/video/taito_b.cpp42
-rw-r--r--src/mame/video/taito_f2.cpp12
-rw-r--r--src/mame/video/taito_f3.cpp24
-rw-r--r--src/mame/video/taito_helper.cpp4
-rw-r--r--src/mame/video/taitoair.cpp2
-rw-r--r--src/mame/video/taitojc.cpp19
-rw-r--r--src/mame/video/taitosj.cpp27
-rw-r--r--src/mame/video/tank8.cpp15
-rw-r--r--src/mame/video/tatsumi.cpp419
-rw-r--r--src/mame/video/taxidriv.cpp76
-rw-r--r--src/mame/video/tc0080vco.cpp4
-rw-r--r--src/mame/video/tc0100scn.cpp12
-rw-r--r--src/mame/video/tc0180vcu.cpp43
-rw-r--r--src/mame/video/tc0480scp.cpp41
-rw-r--r--src/mame/video/tc0780fpa.cpp12
-rw-r--r--src/mame/video/tceptor.cpp10
-rw-r--r--src/mame/video/tecmo_mix.cpp21
-rw-r--r--src/mame/video/tecmosys.cpp23
-rw-r--r--src/mame/video/thief.cpp15
-rw-r--r--src/mame/video/thunderj.cpp18
-rw-r--r--src/mame/video/ti85.cpp27
-rw-r--r--src/mame/video/tia.cpp24
-rw-r--r--src/mame/video/timex.cpp2
-rw-r--r--src/mame/video/tmnt.cpp6
-rw-r--r--src/mame/video/toaplan1.cpp6
-rw-r--r--src/mame/video/toaplan2.cpp4
-rw-r--r--src/mame/video/toaplan_scu.cpp6
-rw-r--r--src/mame/video/toobin.cpp10
-rw-r--r--src/mame/video/triplhnt.cpp28
-rw-r--r--src/mame/video/trs80.cpp111
-rw-r--r--src/mame/video/trs80m3.cpp20
-rw-r--r--src/mame/video/truco.cpp2
-rw-r--r--src/mame/video/tubep.cpp24
-rw-r--r--src/mame/video/tunhunt.cpp6
-rw-r--r--src/mame/video/turbo.cpp161
-rw-r--r--src/mame/video/turrett.cpp2
-rw-r--r--src/mame/video/tutankhm.cpp16
-rw-r--r--src/mame/video/twin16.cpp9
-rw-r--r--src/mame/video/tx0.cpp7
-rw-r--r--src/mame/video/tx1.cpp20
-rw-r--r--src/mame/video/ultratnk.cpp2
-rw-r--r--src/mame/video/usgames.cpp2
-rw-r--r--src/mame/video/uv201.cpp2
-rw-r--r--src/mame/video/v1050.cpp8
-rw-r--r--src/mame/video/vc4000.cpp27
-rw-r--r--src/mame/video/vector06.cpp31
-rw-r--r--src/mame/video/vicdual.cpp27
-rw-r--r--src/mame/video/victory.cpp7
-rw-r--r--src/mame/video/vindictr.cpp10
-rw-r--r--src/mame/video/volfied.cpp2
-rw-r--r--src/mame/video/vtvideo.cpp30
-rw-r--r--src/mame/video/warpwarp.cpp2
-rw-r--r--src/mame/video/wecleman.cpp109
-rw-r--r--src/mame/video/welltris.cpp13
-rw-r--r--src/mame/video/wgp.cpp8
-rw-r--r--src/mame/video/williams.cpp31
-rw-r--r--src/mame/video/wolfpack.cpp23
-rw-r--r--src/mame/video/wswan.cpp40
-rw-r--r--src/mame/video/x1.cpp18
-rw-r--r--src/mame/video/x68k.cpp78
-rw-r--r--src/mame/video/xavix.cpp8
-rw-r--r--src/mame/video/xmen.cpp8
-rw-r--r--src/mame/video/xybots.cpp10
-rw-r--r--src/mame/video/ygv608.cpp10
-rw-r--r--src/mame/video/z88.cpp2
-rw-r--r--src/mame/video/zac2650.cpp23
-rw-r--r--src/mame/video/zaxxon.cpp17
-rw-r--r--src/mame/video/zx.cpp2
-rw-r--r--src/mame/video/zx8301.cpp6
-rw-r--r--src/osd/modules/font/font_dwrite.cpp4
-rw-r--r--src/osd/modules/font/font_sdl.cpp2
-rw-r--r--src/osd/modules/font/font_windows.cpp3
-rw-r--r--src/osd/modules/render/d3d/d3dhlsl.cpp4
-rw-r--r--src/osd/modules/render/drawbgfx.cpp2
-rw-r--r--src/tools/chdman.cpp8
-rw-r--r--src/tools/ldresample.cpp4
-rw-r--r--src/tools/ldverify.cpp14
-rw-r--r--src/tools/pngcmp.cpp24
-rw-r--r--src/tools/regrep.cpp40
1070 files changed, 10093 insertions, 12268 deletions
diff --git a/src/devices/bus/a2bus/a2ultraterm.cpp b/src/devices/bus/a2bus/a2ultraterm.cpp
index 7b6caa40624..e8d5972e4ec 100644
--- a/src/devices/bus/a2bus/a2ultraterm.cpp
+++ b/src/devices/bus/a2bus/a2ultraterm.cpp
@@ -304,11 +304,10 @@ void a2bus_videx160_device::write_c800(uint16_t offset, uint8_t data)
MC6845_UPDATE_ROW( a2bus_videx160_device::crtc_update_row )
{
- uint32_t *p = &bitmap.pix32(y);
+ uint32_t *p = &bitmap.pix(y);
uint16_t chr_base = ra;
- int i;
- for ( i = 0; i < x_count; i++ )
+ for ( int i = 0; i < x_count; i++ )
{
uint16_t offset = ( ma + i );
uint8_t chr = m_ram[ offset ];
diff --git a/src/devices/bus/a2bus/a2videoterm.cpp b/src/devices/bus/a2bus/a2videoterm.cpp
index b0fda659783..839fa19e74a 100644
--- a/src/devices/bus/a2bus/a2videoterm.cpp
+++ b/src/devices/bus/a2bus/a2videoterm.cpp
@@ -347,7 +347,7 @@ void a2bus_videx80_device::write_c800(uint16_t offset, uint8_t data)
MC6845_UPDATE_ROW( a2bus_videx80_device::crtc_update_row )
{
- uint32_t *p = &bitmap.pix32(y);
+ uint32_t *p = &bitmap.pix(y);
uint16_t chr_base = ra; //( ra & 0x08 ) ? 0x800 | ( ra & 0x07 ) : ra;
for (int i = 0; i < x_count; i++)
diff --git a/src/devices/bus/acorn/system/vdu40.cpp b/src/devices/bus/acorn/system/vdu40.cpp
index dcee8cd9b53..7bc8629ac35 100644
--- a/src/devices/bus/acorn/system/vdu40.cpp
+++ b/src/devices/bus/acorn/system/vdu40.cpp
@@ -93,7 +93,7 @@ void acorn_vdu40_device::device_reset()
MC6845_UPDATE_ROW(acorn_vdu40_device::crtc_update_row)
{
- uint32_t *p = &bitmap.pix32(y);
+ uint32_t *p = &bitmap.pix(y);
m_trom->lose_w(1);
m_trom->lose_w(0);
diff --git a/src/devices/bus/acorn/system/vdu80.cpp b/src/devices/bus/acorn/system/vdu80.cpp
index 5cf995d8d3c..77bad0bf32c 100644
--- a/src/devices/bus/acorn/system/vdu80.cpp
+++ b/src/devices/bus/acorn/system/vdu80.cpp
@@ -172,7 +172,7 @@ void acorn_vdu80_device::device_reset()
MC6845_UPDATE_ROW(acorn_vdu80_device::crtc_update_row)
{
uint8_t invert = BIT(m_links->read(), 1);
- uint32_t *p = &bitmap.pix32(y);
+ uint32_t *p = &bitmap.pix(y);
for (int column = 0; column < x_count; column++)
{
diff --git a/src/devices/bus/bbc/userport/lcd.cpp b/src/devices/bus/bbc/userport/lcd.cpp
index cdc70bc35fe..f5f92270ca9 100644
--- a/src/devices/bus/bbc/userport/lcd.cpp
+++ b/src/devices/bus/bbc/userport/lcd.cpp
@@ -87,7 +87,7 @@ HD44780_PIXEL_UPDATE(bbc_lcd_device::lcd_pixel_update)
}
if (line < 4)
- bitmap.pix16(line * (8 + 1) + y, pos * 6 + x) = state ? 1 : 2;
+ bitmap.pix(line * (8 + 1) + y, pos * 6 + x) = state ? 1 : 2;
}
}
diff --git a/src/devices/bus/c64/xl80.cpp b/src/devices/bus/c64/xl80.cpp
index 8f0f35b523f..6bfa6e9d8cd 100644
--- a/src/devices/bus/c64/xl80.cpp
+++ b/src/devices/bus/c64/xl80.cpp
@@ -85,12 +85,12 @@ const tiny_rom_entry *c64_xl80_device::device_rom_region() const
MC6845_UPDATE_ROW( c64_xl80_device::crtc_update_row )
{
- const pen_t *pen = m_palette->pens();
+ pen_t const *const pen = m_palette->pens();
for (int column = 0; column < x_count; column++)
{
- uint8_t code = m_ram[((ma + column) & 0x7ff)];
- uint16_t addr = (code << 3) | (ra & 0x07);
+ uint8_t const code = m_ram[((ma + column) & 0x7ff)];
+ uint16_t const addr = (code << 3) | (ra & 0x07);
uint8_t data = m_char_rom->base()[addr & 0x7ff];
if (column == cursor_x)
@@ -100,10 +100,10 @@ MC6845_UPDATE_ROW( c64_xl80_device::crtc_update_row )
for (int bit = 0; bit < 8; bit++)
{
- int x = (column * 8) + bit;
- int color = BIT(data, 7) && de;
+ int const x = (column * 8) + bit;
+ int const color = BIT(data, 7) && de;
- bitmap.pix32(vbp + y, hbp + x) = pen[color];
+ bitmap.pix(vbp + y, hbp + x) = pen[color];
data <<= 1;
}
diff --git a/src/devices/bus/centronics/epson_lx810l.cpp b/src/devices/bus/centronics/epson_lx810l.cpp
index 1d9c0ac8577..2744ea3e3ac 100644
--- a/src/devices/bus/centronics/epson_lx810l.cpp
+++ b/src/devices/bus/centronics/epson_lx810l.cpp
@@ -575,9 +575,9 @@ WRITE_LINE_MEMBER( epson_lx810l_device::co0_w )
*/
if (m_real_cr_pos < m_bitmap.width()) {
for (int i = 0; i < 9; i++) {
- unsigned int y = bitmap_line(i);
+ unsigned int const y = bitmap_line(i);
if ((m_printhead & (1<<(8-i))) != 0)
- m_bitmap.pix32(y, m_real_cr_pos + CR_OFFSET) = 0x000000;
+ m_bitmap.pix(y, m_real_cr_pos + CR_OFFSET) = 0x000000;
}
}
}
diff --git a/src/devices/bus/compis/hrg.cpp b/src/devices/bus/compis/hrg.cpp
index 7aa8aa72f7e..1612729e706 100644
--- a/src/devices/bus/compis/hrg.cpp
+++ b/src/devices/bus/compis/hrg.cpp
@@ -51,11 +51,11 @@ void compis_uhrg_device::uhrg_map(address_map &map)
UPD7220_DISPLAY_PIXELS_MEMBER( compis_hrg_device::display_pixels )
{
- uint16_t i,gfx = m_video_ram[(address & 0x7fff) >> 1];
- const pen_t *pen = m_palette->pens();
+ uint16_t const gfx = m_video_ram[(address & 0x7fff) >> 1];
+ pen_t const *const pen = m_palette->pens();
- for(i=0; i<16; i++)
- bitmap.pix32(y, x + i) = pen[BIT(gfx, i)];
+ for(uint16_t i=0; i<16; i++)
+ bitmap.pix(y, x + i) = pen[BIT(gfx, i)];
}
@@ -65,11 +65,11 @@ UPD7220_DISPLAY_PIXELS_MEMBER( compis_hrg_device::display_pixels )
UPD7220_DISPLAY_PIXELS_MEMBER( compis_uhrg_device::display_pixels )
{
- uint16_t i,gfx = m_video_ram[(address & 0x1ffff) >> 1];
- const pen_t *pen = m_palette->pens();
+ uint16_t const gfx = m_video_ram[(address & 0x1ffff) >> 1];
+ pen_t const *const pen = m_palette->pens();
- for(i=0; i<16; i++)
- bitmap.pix32(y, x + i) = pen[BIT(gfx, i)];
+ for(uint16_t i=0; i<16; i++)
+ bitmap.pix(y, x + i) = pen[BIT(gfx, i)];
}
diff --git a/src/devices/bus/comx35/clm.cpp b/src/devices/bus/comx35/clm.cpp
index ebf7e1f271e..192e5989a36 100644
--- a/src/devices/bus/comx35/clm.cpp
+++ b/src/devices/bus/comx35/clm.cpp
@@ -104,8 +104,8 @@ MC6845_UPDATE_ROW( comx_clm_device::crtc_update_row )
{
for (int column = 0; column < x_count; column++)
{
- uint8_t code = m_video_ram[((ma + column) & 0x7ff)];
- uint16_t addr = (code << 3) | (ra & 0x07);
+ uint8_t const code = m_video_ram[((ma + column) & 0x7ff)];
+ uint16_t const addr = (code << 3) | (ra & 0x07);
uint8_t data = m_char_rom->base()[addr & 0x7ff];
if (BIT(ra, 3) && column == cursor_x)
@@ -115,9 +115,9 @@ MC6845_UPDATE_ROW( comx_clm_device::crtc_update_row )
for (int bit = 0; bit < 8; bit++)
{
- int x = (column * 8) + bit;
+ int const x = (column * 8) + bit;
- bitmap.pix32(vbp + y, hbp + x) = m_palette->pen(BIT(data, 7) && de);
+ bitmap.pix(vbp + y, hbp + x) = m_palette->pen(BIT(data, 7) && de);
data <<= 1;
}
diff --git a/src/devices/bus/ecbbus/grip.cpp b/src/devices/bus/ecbbus/grip.cpp
index 97a33298171..659bab524ad 100644
--- a/src/devices/bus/ecbbus/grip.cpp
+++ b/src/devices/bus/ecbbus/grip.cpp
@@ -179,35 +179,33 @@ MC6845_UPDATE_ROW( ecb_grip21_device::crtc_update_row )
{
for (int column = 0; column < x_count; column++)
{
- uint16_t address = (m_page << 12) | (((ma + column) & 0xfff) << 3) | (ra & 0x07);
- uint8_t data = m_video_ram[address];
+ uint16_t const address = (m_page << 12) | (((ma + column) & 0xfff) << 3) | (ra & 0x07);
+ uint8_t const data = m_video_ram[address];
for (int bit = 0; bit < 8; bit++)
{
- int x = (column * 8) + bit;
- int color = (m_flash ? 0 : BIT(data, bit)) && de;
+ int const x = (column * 8) + bit;
+ int const color = (m_flash ? 0 : BIT(data, bit)) && de;
- bitmap.pix32(vbp + y, hbp + x) = m_palette->pen(color);
+ bitmap.pix(vbp + y, hbp + x) = m_palette->pen(color);
}
}
}
/*
MC6845_UPDATE_ROW( ecb_grip21_device::grip5_update_row )
{
- const rgb_t *palette = m_palette->palette()->entry_list_raw();
- int column, bit;
-
- for (column = 0; column < x_count; column++)
+ rgb_t const *const palette = m_palette->palette()->entry_list_raw();
+ for (int column = 0; column < x_count; column++)
{
- uint16_t address = (m_dpage << 12) | (((ma + column) & 0xfff) << 3) | (ra & 0x07);
- uint8_t data = m_video_ram[address];
+ uint16_t const address = (m_dpage << 12) | (((ma + column) & 0xfff) << 3) | (ra & 0x07);
+ uint8_t const data = m_video_ram[address];
- for (bit = 0; bit < 8; bit++)
+ for (int bit = 0; bit < 8; bit++)
{
- int x = (column * 8) + bit;
- int color = m_flash ? 0 : BIT(data, bit);
+ int const x = (column * 8) + bit;
+ int const color = m_flash ? 0 : BIT(data, bit);
- bitmap.pix32(y, x) = palette[color];
+ bitmap.pix(y, x) = palette[color];
}
}
}
diff --git a/src/devices/bus/einstein/pipe/tk02.cpp b/src/devices/bus/einstein/pipe/tk02.cpp
index b0cf5998131..74cd880e151 100644
--- a/src/devices/bus/einstein/pipe/tk02.cpp
+++ b/src/devices/bus/einstein/pipe/tk02.cpp
@@ -185,14 +185,14 @@ MC6845_UPDATE_ROW( tk02_device::crtc_update_row )
if (i == cursor_x)
data ^= 0xff;
- bitmap.pix32(y, i * 8 + 0) = pen[BIT(data, 7)];
- bitmap.pix32(y, i * 8 + 1) = pen[BIT(data, 6)];
- bitmap.pix32(y, i * 8 + 2) = pen[BIT(data, 5)];
- bitmap.pix32(y, i * 8 + 3) = pen[BIT(data, 4)];
- bitmap.pix32(y, i * 8 + 4) = pen[BIT(data, 3)];
- bitmap.pix32(y, i * 8 + 5) = pen[BIT(data, 2)];
- bitmap.pix32(y, i * 8 + 6) = pen[BIT(data, 1)];
- bitmap.pix32(y, i * 8 + 7) = pen[BIT(data, 0)];
+ bitmap.pix(y, i * 8 + 0) = pen[BIT(data, 7)];
+ bitmap.pix(y, i * 8 + 1) = pen[BIT(data, 6)];
+ bitmap.pix(y, i * 8 + 2) = pen[BIT(data, 5)];
+ bitmap.pix(y, i * 8 + 3) = pen[BIT(data, 4)];
+ bitmap.pix(y, i * 8 + 4) = pen[BIT(data, 3)];
+ bitmap.pix(y, i * 8 + 5) = pen[BIT(data, 2)];
+ bitmap.pix(y, i * 8 + 6) = pen[BIT(data, 1)];
+ bitmap.pix(y, i * 8 + 7) = pen[BIT(data, 0)];
}
}
diff --git a/src/devices/bus/electron/mode7.cpp b/src/devices/bus/electron/mode7.cpp
index 103c861c4ae..408b6a92300 100644
--- a/src/devices/bus/electron/mode7.cpp
+++ b/src/devices/bus/electron/mode7.cpp
@@ -195,7 +195,7 @@ void electron_mode7_device::expbus_w(offs_t offset, uint8_t data)
MC6845_UPDATE_ROW(electron_mode7_device::crtc_update_row)
{
- uint32_t* p = &bitmap.pix32(y);
+ uint32_t* p = &bitmap.pix(y);
m_trom->lose_w(1);
m_trom->lose_w(0);
diff --git a/src/devices/bus/gio64/newport.cpp b/src/devices/bus/gio64/newport.cpp
index 1be643afddd..142947b4ae0 100644
--- a/src/devices/bus/gio64/newport.cpp
+++ b/src/devices/bus/gio64/newport.cpp
@@ -1302,7 +1302,7 @@ uint32_t newport_base_device::screen_update(screen_device &device, bitmap_rgb32
/* loop over rows and copy to the destination */
for (int y = cliprect.min_y, sy = y_start; y <= cliprect.max_y && sy < y_end; y++, sy++)
{
- uint32_t *dest = &bitmap.pix32(y, cliprect.min_x);
+ uint32_t *dest = &bitmap.pix(y, cliprect.min_x);
const uint32_t *src_rgbci = m_rb2->rgbci(y);
const uint32_t *src_cidaux = m_rb2->cidaux(y);
diff --git a/src/devices/bus/hp_dio/hp98543.cpp b/src/devices/bus/hp_dio/hp98543.cpp
index bd96c95852d..eb73c56c6f4 100644
--- a/src/devices/bus/hp_dio/hp98543.cpp
+++ b/src/devices/bus/hp_dio/hp98543.cpp
@@ -235,7 +235,7 @@ uint32_t dio16_98543_device::screen_update(screen_device &screen, bitmap_rgb32 &
}
for (int y = 0; y < m_v_pix; y++) {
- uint32_t *scanline = &bitmap.pix32(y);
+ uint32_t *scanline = &bitmap.pix(y);
for (int x = 0; x < m_h_pix; x++) {
uint8_t tmp = m_vram[y * m_h_pix + x];
diff --git a/src/devices/bus/hp_dio/hp98544.cpp b/src/devices/bus/hp_dio/hp98544.cpp
index 842a7a78229..fe83f227ad9 100644
--- a/src/devices/bus/hp_dio/hp98544.cpp
+++ b/src/devices/bus/hp_dio/hp98544.cpp
@@ -165,25 +165,22 @@ WRITE_LINE_MEMBER(dio16_98544_device::int_w)
uint32_t dio16_98544_device::screen_update(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect)
{
- int startx, starty, endx, endy;
-
-
if (!m_topcat->has_changed())
return UPDATE_HAS_NOT_CHANGED;
for (int y = 0; y < m_v_pix; y++) {
- uint32_t *scanline = &bitmap.pix32(y);
+ uint32_t *scanline = &bitmap.pix(y);
for (int x = 0; x < m_h_pix; x++) {
uint8_t tmp = m_vram[y * m_h_pix + x];
*scanline++ = tmp ? rgb_t(255,255,255) : rgb_t(0, 0, 0);
}
}
+ int startx, starty, endx, endy;
m_topcat->get_cursor_pos(startx, starty, endx, endy);
for (int y = starty; y <= endy; y++) {
- uint32_t *scanline = &bitmap.pix32(y);
- memset(scanline + startx, 0xff, (endx - startx) << 2);
+ std::fill_n(&bitmap.pix(y, startx), endx - startx + 1, rgb_t(255,255,255));
}
return 0;
diff --git a/src/devices/bus/hp_dio/hp98550.cpp b/src/devices/bus/hp_dio/hp98550.cpp
index 738926eae77..38f70d2d670 100644
--- a/src/devices/bus/hp_dio/hp98550.cpp
+++ b/src/devices/bus/hp_dio/hp98550.cpp
@@ -218,7 +218,7 @@ uint32_t dio32_98550_device::screen_update(screen_device &screen, bitmap_rgb32 &
mask |= ce->plane_enabled();
for (int y = 0; y < m_v_pix; y++) {
- uint32_t *scanline = &bitmap.pix32(y);
+ uint32_t *scanline = &bitmap.pix(y);
for (int x = 0; x < m_h_pix; x++) {
const int offset = y * m_fb_width +x;
diff --git a/src/devices/bus/iq151/grafik.cpp b/src/devices/bus/iq151/grafik.cpp
index 304bcf87b43..497012cf2cd 100644
--- a/src/devices/bus/iq151/grafik.cpp
+++ b/src/devices/bus/iq151/grafik.cpp
@@ -178,7 +178,7 @@ void iq151_grafik_device::video_update(bitmap_ind16 &bitmap, const rectangle &cl
{
for (int ra = 0; ra < 8; ra++)
{
- bitmap.pix16(y, x*8 + ra) |= BIT(m_videoram[(32*8 -1 - y)*64 + x], ra);
+ bitmap.pix(y, x*8 + ra) |= BIT(m_videoram[(32*8 -1 - y)*64 + x], ra);
}
}
}
diff --git a/src/devices/bus/iq151/minigraf.cpp b/src/devices/bus/iq151/minigraf.cpp
index d5bf2da1f8b..e0962048411 100644
--- a/src/devices/bus/iq151/minigraf.cpp
+++ b/src/devices/bus/iq151/minigraf.cpp
@@ -162,7 +162,7 @@ void iq151_minigraf_device::plotter_update(uint8_t control)
// if pen is down draws a point
if (m_pen)
- m_paper->pix16(((PAPER_HEIGHT-PAPER_MAX_Y)/2) + m_posy, ((PAPER_WIDTH-PAPER_MAX_X)/2) + m_posx) = 1;
+ m_paper->pix(((PAPER_HEIGHT-PAPER_MAX_Y)/2) + m_posy, ((PAPER_WIDTH-PAPER_MAX_X)/2) + m_posx) = 1;
m_control = control;
}
diff --git a/src/devices/bus/iq151/ms151a.cpp b/src/devices/bus/iq151/ms151a.cpp
index 447c9f0d43a..651e82bfe6f 100644
--- a/src/devices/bus/iq151/ms151a.cpp
+++ b/src/devices/bus/iq151/ms151a.cpp
@@ -164,5 +164,5 @@ void iq151_ms151a_device::plotter_update(uint8_t offset, uint8_t data)
// if pen is down draws a point
if (m_pen)
- m_paper->pix16(((PAPER_HEIGHT-PAPER_MAX_Y)/2) + m_posy, ((PAPER_WIDTH-PAPER_MAX_X)/2) + m_posx) = 1;
+ m_paper->pix(((PAPER_HEIGHT-PAPER_MAX_Y)/2) + m_posy, ((PAPER_WIDTH-PAPER_MAX_X)/2) + m_posx) = 1;
}
diff --git a/src/devices/bus/iq151/video32.cpp b/src/devices/bus/iq151/video32.cpp
index fce21b963e9..2d3f75b66ed 100644
--- a/src/devices/bus/iq151/video32.cpp
+++ b/src/devices/bus/iq151/video32.cpp
@@ -126,7 +126,7 @@ void iq151_video32_device::video_update(bitmap_ind16 &bitmap, const rectangle &c
{
for (int ra = 0; ra < 8; ra++)
{
- uint16_t *p = &bitmap.pix16(sy++);
+ uint16_t *p = &bitmap.pix(sy++);
for (int x = ma; x < ma + 32; x++)
{
diff --git a/src/devices/bus/iq151/video64.cpp b/src/devices/bus/iq151/video64.cpp
index a965abbd19e..487bf63ca33 100644
--- a/src/devices/bus/iq151/video64.cpp
+++ b/src/devices/bus/iq151/video64.cpp
@@ -140,7 +140,7 @@ void iq151_video64_device::video_update(bitmap_ind16 &bitmap, const rectangle &c
{
for (int ra = 0; ra < 8; ra++)
{
- uint16_t *p = &bitmap.pix16(sy++);
+ uint16_t *p = &bitmap.pix(sy++);
for (int x = ma; x < ma + 64; x++)
{
diff --git a/src/devices/bus/isa/aga.cpp b/src/devices/bus/isa/aga.cpp
index 244fbc0bb66..81e6ba053fe 100644
--- a/src/devices/bus/isa/aga.cpp
+++ b/src/devices/bus/isa/aga.cpp
@@ -288,7 +288,7 @@ MC6845_UPDATE_ROW( isa8_aga_device::mda_text_inten_update_row )
{
rgb_t const *const palette = m_palette->palette()->entry_list_raw();
uint8_t const *const videoram = m_videoram.get();
- uint32_t *p = &bitmap.pix32(y);
+ uint32_t *p = &bitmap.pix(y);
uint16_t const chr_base = (ra & 0x08) ? 0x800 | (ra & 0x07) : ra;
if (y == 0) logerror("mda_text_inten_update_row\n");
@@ -345,7 +345,7 @@ MC6845_UPDATE_ROW( isa8_aga_device::mda_text_blink_update_row )
{
uint8_t const *const videoram = m_videoram.get();
rgb_t const *const palette = m_palette->palette()->entry_list_raw();
- uint32_t *p = &bitmap.pix32(y);
+ uint32_t *p = &bitmap.pix(y);
uint16_t const chr_base = (ra & 0x08) ? 0x800 | (ra & 0x07) : ra;
if (y == 0) logerror("mda_text_blink_update_row\n");
@@ -402,7 +402,7 @@ MC6845_UPDATE_ROW( isa8_aga_device::cga_text_inten_update_row )
{
uint8_t const *const videoram = m_videoram.get();
rgb_t const *const palette = m_palette->palette()->entry_list_raw();
- uint32_t *p = &bitmap.pix32(y);
+ uint32_t *p = &bitmap.pix(y);
if (y == 0) logerror("cga_text_inten_update_row\n");
for (int i = 0; i < x_count; i++) {
@@ -431,7 +431,7 @@ MC6845_UPDATE_ROW( isa8_aga_device::cga_text_inten_alt_update_row )
{
rgb_t const *const palette = m_palette->palette()->entry_list_raw();
uint8_t const *const videoram = m_videoram.get();
- uint32_t *p = &bitmap.pix32(y);
+ uint32_t *p = &bitmap.pix(y);
if (y == 0) logerror("cga_text_inten_alt_update_row\n");
for (int i = 0; i < x_count; i++) {
@@ -459,7 +459,7 @@ MC6845_UPDATE_ROW( isa8_aga_device::cga_text_blink_update_row )
{
rgb_t const *const palette = m_palette->palette()->entry_list_raw();
uint8_t const *const videoram = m_videoram.get();
- uint32_t *p = &bitmap.pix32(y);
+ uint32_t *p = &bitmap.pix(y);
for (int i = 0; i < x_count; i++) {
uint16_t const offset = ((ma + i) << 1) & 0x3fff;
@@ -491,7 +491,7 @@ MC6845_UPDATE_ROW( isa8_aga_device::cga_text_blink_alt_update_row )
{
rgb_t const *const palette = m_palette->palette()->entry_list_raw();
uint8_t const *const videoram = m_videoram.get();
- uint32_t *p = &bitmap.pix32(y);
+ uint32_t *p = &bitmap.pix(y);
if (y == 0) logerror("cga_text_blink_alt_update_row\n");
for (int i = 0; i < x_count; i++) {
@@ -526,7 +526,7 @@ MC6845_UPDATE_ROW( isa8_aga_device::cga_gfx_4bppl_update_row )
{
rgb_t const *const palette = m_palette->palette()->entry_list_raw();
uint8_t const *const videoram = m_videoram.get();
- uint32_t *p = &bitmap.pix32(y);
+ uint32_t *p = &bitmap.pix(y);
if (y == 0) logerror("cga_gfx_4bppl_update_row\n");
for (int i = 0; i < x_count; i++) {
@@ -551,7 +551,7 @@ MC6845_UPDATE_ROW( isa8_aga_device::cga_gfx_4bpph_update_row )
{
uint8_t const *const videoram = m_videoram.get();
rgb_t const *const palette = m_palette->palette()->entry_list_raw();
- uint32_t *p = &bitmap.pix32(y);
+ uint32_t *p = &bitmap.pix(y);
if (y == 0) logerror("cga_gfx_4bpph_update_row\n");
for (int i = 0; i < x_count; i++) {
@@ -584,7 +584,7 @@ MC6845_UPDATE_ROW( isa8_aga_device::cga_gfx_2bpp_update_row )
{
uint8_t const *const videoram = m_videoram.get();
rgb_t const *const palette = m_palette->palette()->entry_list_raw();
- uint32_t *p = &bitmap.pix32(y);
+ uint32_t *p = &bitmap.pix(y);
//if (y == 0) logerror("cga_gfx_2bpp_update_row\n");
for (int i = 0; i < x_count; i++) {
@@ -609,7 +609,7 @@ MC6845_UPDATE_ROW( isa8_aga_device::cga_gfx_1bpp_update_row )
{
uint8_t const *const videoram = m_videoram.get();
rgb_t const *const palette = m_palette->palette()->entry_list_raw();
- uint32_t *p = &bitmap.pix32(y);
+ uint32_t *p = &bitmap.pix(y);
uint8_t const fg = m_cga_color_select & 0x0f;
if (y == 0) logerror("cga_gfx_1bpp_update_row\n");
diff --git a/src/devices/bus/isa/cga.cpp b/src/devices/bus/isa/cga.cpp
index ff30f3690ad..52a0407f065 100644
--- a/src/devices/bus/isa/cga.cpp
+++ b/src/devices/bus/isa/cga.cpp
@@ -469,47 +469,43 @@ isa8_cga_superimpose_device::isa8_cga_superimpose_device(const machine_config &m
template<bool blink, bool si, bool comp, bool alt, int width>
MC6845_UPDATE_ROW( isa8_cga_device::cga_text )
{
- uint8_t *videoram = &m_vram[m_start_offset];
- uint32_t *p = &bitmap.pix32(y);
- const rgb_t *palette = m_palette->palette()->entry_list_raw();
- int i;
+ uint8_t const *const videoram = &m_vram[m_start_offset];
+ uint32_t *p = &bitmap.pix(y);
+ rgb_t const *const palette = m_palette->palette()->entry_list_raw();
- if ( y == 0 ) CGA_LOG(1,"cga_text_8",("\n"));
- for ( i = 0; i < x_count; i++ )
+ if (y == 0) CGA_LOG(1,"cga_text_8",("\n"));
+ for (int i = 0; i < x_count; i++)
{
- uint16_t offset = ( ( ma + i ) << 1 ) & 0x3fff;
- uint8_t chr = videoram[ offset ];
- uint8_t attr = videoram[ offset +1 ];
- uint8_t data = m_chr_gen[ chr * width + ra ];
+ uint16_t const offset = ((ma + i) << 1) & 0x3fff;
+ uint8_t const chr = videoram[offset];
+ uint8_t const attr = videoram[offset +1];
+ uint8_t data = m_chr_gen[chr * width + ra];
uint16_t fg, bg;
- uint8_t xi;
- if ( comp )
+ if (comp)
{
- fg = 0x10 + ( attr & 0x0F );
- bg = alt ? 0 : ( 0x10 + ( ( attr >> 4 ) & 0x07 ) );
+ fg = 0x10 + (attr & 0x0f);
+ bg = alt ? 0 : (0x10 + ((attr >> 4) & 0x07));
}
else
{
fg = attr & 0x0F;
- bg = alt ? 0 : ( ( attr >> 4 ) & ( blink ? 0x07 : 0x0f ) );
+ bg = alt ? 0 : ((attr >> 4) & (blink ? 0x07 : 0x0f));
}
- if ( ( i == cursor_x ) && ( m_framecnt & 0x08 ) )
- data = 0xFF;
- else if ( blink && ( attr & 0x80 ) && ( m_framecnt & 0x10 ) )
+ if ((i == cursor_x) && (m_framecnt & 0x08))
+ data = 0xff;
+ else if (blink && (attr & 0x80) && (m_framecnt & 0x10))
{
data = 0x00;
- bg = ( attr >> 4 ) & 0x07;
+ bg = (attr >> 4) & 0x07;
}
- for(xi=0;xi<8;xi++)
+ for (int xi = 0; xi < 8; xi++)
{
- uint8_t pen_data, dot;
-
- dot = (data & (1 << (7-xi)));
- pen_data = dot ? fg : bg;
- if(!si || (pen_data || dot))
+ uint8_t const dot = (data & (1 << (7 - xi)));
+ uint8_t const pen_data = dot ? fg : bg;
+ if (!si || (pen_data || dot))
*p = palette[pen_data];
p++;
}
@@ -521,28 +517,29 @@ MC6845_UPDATE_ROW( isa8_cga_device::cga_text )
MC6845_UPDATE_ROW( isa8_cga_device::cga_gfx_4bppl_update_row )
{
- uint8_t *videoram = &m_vram[m_start_offset];
- uint32_t *p = &bitmap.pix32(y);
- const rgb_t *palette = m_palette->palette()->entry_list_raw();
- int i;
+ uint8_t const *const videoram = &m_vram[m_start_offset];
+ uint32_t *p = &bitmap.pix(y);
+ rgb_t const *const palette = m_palette->palette()->entry_list_raw();
- if ( y == 0 ) CGA_LOG(1,"cga_gfx_4bppl_update_row",("\n"));
- for ( i = 0; i < x_count; i++ )
+ if (y == 0) CGA_LOG(1,"cga_gfx_4bppl_update_row",("\n"));
+ for (int i = 0; i < x_count; i++)
{
- uint16_t offset = ( ( ( ma + i ) << 1 ) & 0x1fff ) | ( ( y & 1 ) << 13 );
- uint8_t data = videoram[ offset ];
+ uint16_t const offset = (((ma + i) << 1) & 0x1fff) | ((y & 1) << 13);
+ uint8_t data;
+
+ data = videoram[offset];
- *p = palette[data >> 4]; p++;
- *p = palette[data >> 4]; p++;
- *p = palette[data & 0x0F]; p++;
- *p = palette[data & 0x0F]; p++;
+ *p++ = palette[data >> 4];
+ *p++ = palette[data >> 4];
+ *p++ = palette[data & 0x0f];
+ *p++ = palette[data & 0x0f];
- data = videoram[ offset + 1 ];
+ data = videoram[offset + 1];
- *p = palette[data >> 4]; p++;
- *p = palette[data >> 4]; p++;
- *p = palette[data & 0x0F]; p++;
- *p = palette[data & 0x0F]; p++;
+ *p++ = palette[data >> 4];
+ *p++ = palette[data >> 4];
+ *p++ = palette[data & 0x0f];
+ *p++ = palette[data & 0x0f];
}
}
@@ -580,37 +577,37 @@ static const uint8_t yc_lut[16][8] =
MC6845_UPDATE_ROW( isa8_cga_device::cga_gfx_4bpph_update_row )
{
- uint8_t *videoram = &m_vram[m_start_offset];
- uint32_t *p = &bitmap.pix32(y);
- const rgb_t *palette = m_palette->palette()->entry_list_raw();
- int i;
-
- if ( y == 0 ) CGA_LOG(1,"cga_gfx_4bpph_update_row",("\n"));
+ uint8_t const *const videoram = &m_vram[m_start_offset];
+ uint32_t *p = &bitmap.pix(y);
+ rgb_t const *const palette = m_palette->palette()->entry_list_raw();
- for ( i = 0; i < x_count; i++ )
+ if (y == 0) CGA_LOG(1,"cga_gfx_4bpph_update_row",("\n"));
+ for (int i = 0; i < x_count; i++)
{
- uint16_t offset = ( ( ( ma + i ) << 1 ) & 0x1fff ) | ( ( y & 1 ) << 13 );
- uint8_t data = videoram[ offset ];
-
- *p = palette[data >> 4]; p++;
- *p = palette[data >> 4]; p++;
- *p = palette[data >> 4]; p++;
- *p = palette[data >> 4]; p++;
- *p = palette[data & 0x0F]; p++;
- *p = palette[data & 0x0F]; p++;
- *p = palette[data & 0x0F]; p++;
- *p = palette[data & 0x0F]; p++;
-
- data = videoram[ offset + 1 ];
-
- *p = palette[data >> 4]; p++;
- *p = palette[data >> 4]; p++;
- *p = palette[data >> 4]; p++;
- *p = palette[data >> 4]; p++;
- *p = palette[data & 0x0F]; p++;
- *p = palette[data & 0x0F]; p++;
- *p = palette[data & 0x0F]; p++;
- *p = palette[data & 0x0F]; p++;
+ uint16_t const offset = (((ma + i) << 1) & 0x1fff) | ((y & 1) << 13);
+ uint8_t data;
+
+ data = videoram[offset];
+
+ *p++ = palette[data >> 4];
+ *p++ = palette[data >> 4];
+ *p++ = palette[data >> 4];
+ *p++ = palette[data >> 4];
+ *p++ = palette[data & 0x0f];
+ *p++ = palette[data & 0x0f];
+ *p++ = palette[data & 0x0f];
+ *p++ = palette[data & 0x0f];
+
+ data = videoram[offset + 1];
+
+ *p++ = palette[data >> 4];
+ *p++ = palette[data >> 4];
+ *p++ = palette[data >> 4];
+ *p++ = palette[data >> 4];
+ *p++ = palette[data & 0x0f];
+ *p++ = palette[data & 0x0f];
+ *p++ = palette[data & 0x0f];
+ *p++ = palette[data & 0x0f];
}
}
@@ -623,28 +620,29 @@ MC6845_UPDATE_ROW( isa8_cga_device::cga_gfx_4bpph_update_row )
MC6845_UPDATE_ROW( isa8_cga_device::cga_gfx_2bpp_update_row )
{
- uint8_t *videoram = &m_vram[m_start_offset];
- uint32_t *p = &bitmap.pix32(y);
- const rgb_t *palette = m_palette->palette()->entry_list_raw();
- int i;
+ uint8_t const *const videoram = &m_vram[m_start_offset];
+ uint32_t *p = &bitmap.pix(y);
+ rgb_t const *const palette = m_palette->palette()->entry_list_raw();
- if ( y == 0 ) CGA_LOG(1,"cga_gfx_2bpp_update_row",("\n"));
- for ( i = 0; i < x_count; i++ )
+ if (y == 0) CGA_LOG(1,"cga_gfx_2bpp_update_row",("\n"));
+ for (int i = 0; i < x_count; i++)
{
- uint16_t offset = ( ( ( ma + i ) << 1 ) & 0x1fff ) | ( ( ra & 1 ) << 13 );
- uint8_t data = videoram[ offset ];
+ uint16_t const offset = (((ma + i) << 1) & 0x1fff) | ((ra & 1) << 13);
+ uint8_t data;
+
+ data = videoram[offset];
- *p = palette[m_palette_lut_2bpp[ ( data >> 6 ) & 0x03 ]]; p++;
- *p = palette[m_palette_lut_2bpp[ ( data >> 4 ) & 0x03 ]]; p++;
- *p = palette[m_palette_lut_2bpp[ ( data >> 2 ) & 0x03 ]]; p++;
- *p = palette[m_palette_lut_2bpp[ data & 0x03 ]]; p++;
+ *p++ = palette[m_palette_lut_2bpp[(data >> 6) & 0x03]];
+ *p++ = palette[m_palette_lut_2bpp[(data >> 4) & 0x03]];
+ *p++ = palette[m_palette_lut_2bpp[(data >> 2) & 0x03]];
+ *p++ = palette[m_palette_lut_2bpp[ data & 0x03]];
- data = videoram[ offset+1 ];
+ data = videoram[offset + 1];
- *p = palette[m_palette_lut_2bpp[ ( data >> 6 ) & 0x03 ]]; p++;
- *p = palette[m_palette_lut_2bpp[ ( data >> 4 ) & 0x03 ]]; p++;
- *p = palette[m_palette_lut_2bpp[ ( data >> 2 ) & 0x03 ]]; p++;
- *p = palette[m_palette_lut_2bpp[ data & 0x03 ]]; p++;
+ *p++ = palette[m_palette_lut_2bpp[(data >> 6) & 0x03]];
+ *p++ = palette[m_palette_lut_2bpp[(data >> 4) & 0x03]];
+ *p++ = palette[m_palette_lut_2bpp[(data >> 2) & 0x03]];
+ *p++ = palette[m_palette_lut_2bpp[ data & 0x03]];
}
}
@@ -658,37 +656,38 @@ MC6845_UPDATE_ROW( isa8_cga_device::cga_gfx_2bpp_update_row )
MC6845_UPDATE_ROW( isa8_cga_device::cga_gfx_1bpp_update_row )
{
- uint8_t *videoram = &m_vram[m_start_offset];
- uint32_t *p = &bitmap.pix32(y);
- const rgb_t *palette = m_palette->palette()->entry_list_raw();
- uint8_t fg = m_color_select & 0x0F;
- int i;
+ uint8_t const *const videoram = &m_vram[m_start_offset];
+ uint32_t *p = &bitmap.pix(y);
+ rgb_t const *const palette = m_palette->palette()->entry_list_raw();
+ uint8_t const fg = m_color_select & 0x0f;
- if ( y == 0 ) CGA_LOG(1,"cga_gfx_1bpp_update_row",("\n"));
- for ( i = 0; i < x_count; i++ )
+ if (y == 0) CGA_LOG(1,"cga_gfx_1bpp_update_row",("\n"));
+ for (int i = 0; i < x_count; i++)
{
- uint16_t offset = ( ( ( ma + i ) << 1 ) & 0x1fff ) | ( ( ra & 1 ) << 13 );
- uint8_t data = videoram[ offset ];
-
- *p = palette[( data & 0x80 ) ? fg : 0]; p++;
- *p = palette[( data & 0x40 ) ? fg : 0]; p++;
- *p = palette[( data & 0x20 ) ? fg : 0]; p++;
- *p = palette[( data & 0x10 ) ? fg : 0]; p++;
- *p = palette[( data & 0x08 ) ? fg : 0]; p++;
- *p = palette[( data & 0x04 ) ? fg : 0]; p++;
- *p = palette[( data & 0x02 ) ? fg : 0]; p++;
- *p = palette[( data & 0x01 ) ? fg : 0]; p++;
-
- data = videoram[ offset + 1 ];
-
- *p = palette[( data & 0x80 ) ? fg : 0]; p++;
- *p = palette[( data & 0x40 ) ? fg : 0]; p++;
- *p = palette[( data & 0x20 ) ? fg : 0]; p++;
- *p = palette[( data & 0x10 ) ? fg : 0]; p++;
- *p = palette[( data & 0x08 ) ? fg : 0]; p++;
- *p = palette[( data & 0x04 ) ? fg : 0]; p++;
- *p = palette[( data & 0x02 ) ? fg : 0]; p++;
- *p = palette[( data & 0x01 ) ? fg : 0]; p++;
+ uint16_t const offset = (((ma + i) << 1) & 0x1fff) | ((ra & 1) << 13);
+ uint8_t data;
+
+ data = videoram[offset];
+
+ *p++ = palette[(data & 0x80) ? fg : 0];
+ *p++ = palette[(data & 0x40) ? fg : 0];
+ *p++ = palette[(data & 0x20) ? fg : 0];
+ *p++ = palette[(data & 0x10) ? fg : 0];
+ *p++ = palette[(data & 0x08) ? fg : 0];
+ *p++ = palette[(data & 0x04) ? fg : 0];
+ *p++ = palette[(data & 0x02) ? fg : 0];
+ *p++ = palette[(data & 0x01) ? fg : 0];
+
+ data = videoram[offset + 1];
+
+ *p++ = palette[(data & 0x80) ? fg : 0];
+ *p++ = palette[(data & 0x40) ? fg : 0];
+ *p++ = palette[(data & 0x20) ? fg : 0];
+ *p++ = palette[(data & 0x10) ? fg : 0];
+ *p++ = palette[(data & 0x08) ? fg : 0];
+ *p++ = palette[(data & 0x04) ? fg : 0];
+ *p++ = palette[(data & 0x02) ? fg : 0];
+ *p++ = palette[(data & 0x01) ? fg : 0];
}
}
@@ -961,205 +960,200 @@ void isa8_cga_device::io_write(offs_t offset, uint8_t data)
// proc = cga_pgfx_4bpp;
//
-//static inline void pgfx_plot_unit_4bpp(bitmap_ind16 &bitmap,
-// int x, int y, int offs)
-//{
-// int color, values[2];
-// int i;
-//
-// if (cga.plantronics & 0x40)
-// {
-// values[0] = videoram[offs | 0x4000];
-// values[1] = videoram[offs];
-// }
-// else
-// {
-// values[0] = videoram[offs];
-// values[1] = videoram[offs | 0x4000];
-// }
-// for (i=3; i>=0; i--)
-// {
-// color = ((values[0] & 0x3) << 1) |
-// ((values[1] & 2) >> 1) |
-// ((values[1] & 1) << 3);
-// bitmap.pix16(y, x+i) = Machine->pens[color];
-// values[0]>>=2;
-// values[1]>>=2;
-// }
-//}
-//
-//
-//
+#if 0
+static inline void pgfx_plot_unit_4bpp(bitmap_ind16 &bitmap, int x, int y, int offs)
+{
+ int values[2];
+
+ if (cga.plantronics & 0x40)
+ {
+ values[0] = videoram[offs | 0x4000];
+ values[1] = videoram[offs];
+ }
+ else
+ {
+ values[0] = videoram[offs];
+ values[1] = videoram[offs | 0x4000];
+ }
+ for (int i = 3; i >= 0; i--)
+ {
+ int const color =
+ ((values[0] & 0x3) << 1) |
+ ((values[1] & 2) >> 1) |
+ ((values[1] & 1) << 3);
+ bitmap.pix(y, x + i) = Machine->pens[color];
+ values[0] >>= 2;
+ values[1] >>= 2;
+ }
+}
+#endif
+
+
///***************************************************************************
// Draw graphics mode with 640x200 pixels (default) with 2 bits/pixel.
// Even scanlines are from CGA_base + 0x0000, odd from CGA_base + 0x2000
// Second plane at CGA_base + 0x4000 / 0x6000
-//***************************************************************************/
-//
-//static void cga_pgfx_4bpp(bitmap_ind16 &bitmap, struct mscrtc6845 *crtc)
-//{
-// int i, sx, sy, sh;
-// int offs = mscrtc6845_get_start(crtc)*2;
-// int lines = mscrtc6845_get_char_lines(crtc);
-// int height = mscrtc6845_get_char_height(crtc);
-// int columns = mscrtc6845_get_char_columns(crtc)*2;
-//
-// for (sy=0; sy<lines; sy++,offs=(offs+columns)&0x1fff)
-// {
-// for (sh=0; sh<height; sh++, offs|=0x2000)
-// {
-// // char line 0 used as a12 line in graphic mode
-// if (!(sh & 1))
-// {
-// for (i=offs, sx=0; sx<columns; sx++, i=(i+1)&0x1fff)
-// {
-// pgfx_plot_unit_4bpp(bitmap, sx*4, sy*height+sh, i);
-// }
-// }
-// else
-// {
-// for (i=offs|0x2000, sx=0; sx<columns; sx++, i=((i+1)&0x1fff)|0x2000)
-// {
-// pgfx_plot_unit_4bpp(bitmap, sx*4, sy*height+sh, i);
-// }
-// }
-// }
-// }
-//}
-//
-//
-//
-//static inline void pgfx_plot_unit_2bpp(bitmap_ind16 &bitmap,
-// int x, int y, const uint16_t *palette, int offs)
-//{
-// int i;
-// uint8_t bmap[2], values[2];
-// uint16_t *dest;
-//
-// if (cga.plantronics & 0x40)
-// {
-// values[0] = videoram[offs];
-// values[1] = videoram[offs | 0x4000];
-// }
-// else
-// {
-// values[0] = videoram[offs | 0x4000];
-// values[1] = videoram[offs];
-// }
-// bmap[0] = bmap[1] = 0;
-// for (i=3; i>=0; i--)
-// {
-// bmap[0] = bmap[0] << 1; if (values[0] & 0x80) bmap[0] |= 1;
-// bmap[0] = bmap[0] << 1; if (values[1] & 0x80) bmap[0] |= 1;
-// bmap[1] = bmap[1] << 1; if (values[0] & 0x08) bmap[1] |= 1;
-// bmap[1] = bmap[1] << 1; if (values[1] & 0x08) bmap[1] |= 1;
-// values[0] = values[0] << 1;
-// values[1] = values[1] << 1;
-// }
-//
-// dest = &bitmap.pix16(y, x);
-// *(dest++) = palette[(bmap[0] >> 6) & 0x03];
-// *(dest++) = palette[(bmap[0] >> 4) & 0x03];
-// *(dest++) = palette[(bmap[0] >> 2) & 0x03];
-// *(dest++) = palette[(bmap[0] >> 0) & 0x03];
-// *(dest++) = palette[(bmap[1] >> 6) & 0x03];
-// *(dest++) = palette[(bmap[1] >> 4) & 0x03];
-// *(dest++) = palette[(bmap[1] >> 2) & 0x03];
-// *(dest++) = palette[(bmap[1] >> 0) & 0x03];
-//}
-//
-//
-//
+//****************************************************************************
+
+#if 0
+static void cga_pgfx_4bpp(bitmap_ind16 &bitmap, struct mscrtc6845 *crtc)
+{
+ int offs = mscrtc6845_get_start(crtc) * 2;
+ int const lines = mscrtc6845_get_char_lines(crtc);
+ int const height = mscrtc6845_get_char_height(crtc);
+ int columns = mscrtc6845_get_char_columns(crtc) * 2;
+
+ for (int sy = 0; sy < lines; sy++, offs = (offs + columns) & 0x1fff)
+ {
+ for (int sh = 0; sh < height; sh++, offs |= 0x2000)
+ {
+ // char line 0 used as a12 line in graphic mode
+ if (!(sh & 1))
+ {
+ for (int i = offs, sx = 0; sx < columns; sx++, i = (i + 1) & 0x1fff)
+ {
+ pgfx_plot_unit_4bpp(bitmap, sx * 4, sy * height + sh, i);
+ }
+ }
+ else
+ {
+ for (int i = offs | 0x2000, sx = 0; sx < columns; sx++, i = ((i + 1) & 0x1fff) | 0x2000)
+ {
+ pgfx_plot_unit_4bpp(bitmap, sx * 4, sy * height + sh, i);
+ }
+ }
+ }
+ }
+}
+#endif
+
+
+#if 0
+static inline void pgfx_plot_unit_2bpp(bitmap_ind16 &bitmap, int x, int y, const uint16_t *palette, int offs)
+{
+ uint8_t values[2];
+ if (cga.plantronics & 0x40)
+ {
+ values[0] = videoram[offs];
+ values[1] = videoram[offs | 0x4000];
+ }
+ else
+ {
+ values[0] = videoram[offs | 0x4000];
+ values[1] = videoram[offs];
+ }
+ uint8_t bmap[2] = { 0, 0 };
+ for (int i = 3; i >= 0; i--)
+ {
+ bmap[0] = (bmap[0] << 1) | BIT(values[0], 7);
+ bmap[0] = (bmap[0] << 1) | BIT(values[1], 7);
+ bmap[1] = (bmap[1] << 1) | BIT(values[0], 3);
+ bmap[1] = (bmap[1] << 1) | BIT(values[1], 3);
+ values[0] <<= 1;
+ values[1] <<= 1;
+ }
+
+ uint16_t *dest = &bitmap.pix(y, x);
+ *dest++ = palette[(bmap[0] >> 6) & 0x03];
+ *dest++ = palette[(bmap[0] >> 4) & 0x03];
+ *dest++ = palette[(bmap[0] >> 2) & 0x03];
+ *dest++ = palette[(bmap[0] >> 0) & 0x03];
+ *dest++ = palette[(bmap[1] >> 6) & 0x03];
+ *dest++ = palette[(bmap[1] >> 4) & 0x03];
+ *dest++ = palette[(bmap[1] >> 2) & 0x03];
+ *dest++ = palette[(bmap[1] >> 0) & 0x03];
+}
+#endif
+
+
///***************************************************************************
// Draw graphics mode with 320x200 pixels (default) with 2 bits/pixel.
// Even scanlines are from CGA_base + 0x0000, odd from CGA_base + 0x2000
// cga fetches 2 byte per mscrtc6845 access (not modeled here)!
-//***************************************************************************/
-//
-//static void cga_pgfx_2bpp(bitmap_ind16 &bitmap, struct mscrtc6845 *crtc)
-//{
-// int i, sx, sy, sh;
-// int offs = mscrtc6845_get_start(crtc)*2;
-// int lines = mscrtc6845_get_char_lines(crtc);
-// int height = mscrtc6845_get_char_height(crtc);
-// int columns = mscrtc6845_get_char_columns(crtc)*2;
-// int colorset = cga.color_select & 0x3F;
-// const uint16_t *palette;
-//
-// /* Most chipsets use bit 2 of the mode control register to
-// * access a third palette. But not consistently. */
-// pc_cga_check_palette();
-// switch(CGA_CHIPSET)
-// {
-// /* The IBM Professional Graphics Controller behaves like
-// * the PC1512, btw. */
-// case CGA_CHIPSET_PC1512:
-// if ((colorset < 32) && (cga.mode_control & 4)) colorset += 64;
-// break;
-//
-// case CGA_CHIPSET_IBM:
-// case CGA_CHIPSET_PC200:
-// case CGA_CHIPSET_ATI:
-// case CGA_CHIPSET_PARADISE:
-// if (cga.mode_control & 4) colorset = (colorset & 0x1F) + 64;
-// break;
-// }
-//
-//
-// /* The fact that our palette is located in cga_colortable is a vestigial
-// * aspect from when we were doing that ugly trick where drawgfx() would
-// * handle graphics drawing. Truthfully, we should probably be using
-// * palette_set_color_rgb() here and not doing the palette lookup in the loop
-// */
-// palette = &cga_colortable[256*2 + 16*2] + colorset * 4;
-//
-// for (sy=0; sy<lines; sy++,offs=(offs+columns)&0x1fff) {
-//
-// for (sh=0; sh<height; sh++)
-// {
-// if (!(sh&1)) { // char line 0 used as a12 line in graphic mode
-// for (i=offs, sx=0; sx<columns; sx++, i=(i+1)&0x1fff)
-// {
-// pgfx_plot_unit_2bpp(bitmap, sx*8, sy*height+sh, palette, i);
-// }
-// }
-// else
-// {
-// for (i=offs|0x2000, sx=0; sx<columns; sx++, i=((i+1)&0x1fff)|0x2000)
-// {
-// pgfx_plot_unit_2bpp(bitmap, sx*8, sy*height+sh, palette, i);
-// }
-// }
-// }
-// }
-//}
+//****************************************************************************
+
+#if 0
+static void cga_pgfx_2bpp(bitmap_ind16 &bitmap, struct mscrtc6845 *crtc)
+{
+ int offs = mscrtc6845_get_start(crtc) * 2;
+ int const lines = mscrtc6845_get_char_lines(crtc);
+ int const height = mscrtc6845_get_char_height(crtc);
+ int const columns = mscrtc6845_get_char_columns(crtc) * 2;
+
+ /* Most chipsets use bit 2 of the mode control register to access a third palette. But not consistently. */
+ int colorset = cga.color_select & 0x3f;
+ pc_cga_check_palette();
+ switch (CGA_CHIPSET)
+ {
+ /* The IBM Professional Graphics Controller behaves like the PC1512, btw. */
+ case CGA_CHIPSET_PC1512:
+ if ((colorset < 32) && (cga.mode_control & 4)) colorset += 64;
+ break;
+
+ case CGA_CHIPSET_IBM:
+ case CGA_CHIPSET_PC200:
+ case CGA_CHIPSET_ATI:
+ case CGA_CHIPSET_PARADISE:
+ if (cga.mode_control & 4) colorset = (colorset & 0x1f) + 64;
+ break;
+ }
+
+ /* The fact that our palette is located in cga_colortable is a vestigial
+ * aspect from when we were doing that ugly trick where drawgfx() would
+ * handle graphics drawing. Truthfully, we should probably be using
+ * palette_set_color_rgb() here and not doing the palette lookup in the loop
+ */
+ uint16_t const *const palette = &cga_colortable[256*2 + 16*2] + colorset * 4;
+
+ for (int sy = 0; sy < lines; sy++, offs = (offs + columns) & 0x1fff)
+ {
+
+ for (int sh = 0; sh < height; sh++)
+ {
+ if (!(sh & 1)) // char line 0 used as a12 line in graphic mode
+ {
+ for (int i = offs, sx = 0; sx < columns; sx++, i = (i + 1) & 0x1fff)
+ {
+ pgfx_plot_unit_2bpp(bitmap, sx * 8, sy * height + sh, palette, i);
+ }
+ }
+ else
+ {
+ for (int i = offs | 0x2000, sx = 0; sx < columns; sx++, i= ((i + 1) & 0x1fff) | 0x2000)
+ {
+ pgfx_plot_unit_2bpp(bitmap, sx * 8, sy * height + sh, palette, i);
+ }
+ }
+ }
+ }
+}
+#endif
MC6845_UPDATE_ROW( isa8_cga_pc1512_device::pc1512_gfx_4bpp_update_row )
{
- uint8_t *videoram = &m_vram[m_start_offset];
- uint32_t *p = &bitmap.pix32(y);
- const rgb_t *palette = m_palette->palette()->entry_list_raw();
- uint16_t offset_base = ra << 13;
- int j;
+ uint8_t const *const videoram = &m_vram[m_start_offset];
+ uint32_t *p = &bitmap.pix(y);
+ rgb_t const *const palette = m_palette->palette()->entry_list_raw();
+ uint16_t const offset_base = ra << 13;
- if ( y == 0 ) CGA_LOG(1,"pc1512_gfx_4bpp_update_row",("\n"));
- for ( j = 0; j < x_count; j++ )
+ if (y == 0) CGA_LOG(1,"pc1512_gfx_4bpp_update_row",("\n"));
+ for (int j = 0; j < x_count; j++)
{
- uint16_t offset = offset_base | ( ( ma + j ) & 0x1FFF );
- uint16_t i = ( m_color_select & 8 ) ? videoram[ isa8_cga_pc1512_device::vram_offset[3] | offset ] << 3 : 0;
- uint16_t r = ( m_color_select & 4 ) ? videoram[ isa8_cga_pc1512_device::vram_offset[2] | offset ] << 2 : 0;
- uint16_t g = ( m_color_select & 2 ) ? videoram[ isa8_cga_pc1512_device::vram_offset[1] | offset ] << 1 : 0;
- uint16_t b = ( m_color_select & 1 ) ? videoram[ isa8_cga_pc1512_device::vram_offset[0] | offset ] : 0;
-
- *p = palette[( ( i & 0x400 ) | ( r & 0x200 ) | ( g & 0x100 ) | ( b & 0x80 ) ) >> 7]; p++;
- *p = palette[( ( i & 0x200 ) | ( r & 0x100 ) | ( g & 0x080 ) | ( b & 0x40 ) ) >> 6]; p++;
- *p = palette[( ( i & 0x100 ) | ( r & 0x080 ) | ( g & 0x040 ) | ( b & 0x20 ) ) >> 5]; p++;
- *p = palette[( ( i & 0x080 ) | ( r & 0x040 ) | ( g & 0x020 ) | ( b & 0x10 ) ) >> 4]; p++;
- *p = palette[( ( i & 0x040 ) | ( r & 0x020 ) | ( g & 0x010 ) | ( b & 0x08 ) ) >> 3]; p++;
- *p = palette[( ( i & 0x020 ) | ( r & 0x010 ) | ( g & 0x008 ) | ( b & 0x04 ) ) >> 2]; p++;
- *p = palette[( ( i & 0x010 ) | ( r & 0x008 ) | ( g & 0x004 ) | ( b & 0x02 ) ) >> 1]; p++;
- *p = palette[ ( i & 0x008 ) | ( r & 0x004 ) | ( g & 0x002 ) | ( b & 0x01 ) ]; p++;
+ uint16_t const offset = offset_base | ((ma + j) & 0x1fff);
+ uint16_t const i = (m_color_select & 8) ? videoram[isa8_cga_pc1512_device::vram_offset[3] | offset] << 3 : 0;
+ uint16_t const r = (m_color_select & 4) ? videoram[isa8_cga_pc1512_device::vram_offset[2] | offset] << 2 : 0;
+ uint16_t const g = (m_color_select & 2) ? videoram[isa8_cga_pc1512_device::vram_offset[1] | offset] << 1 : 0;
+ uint16_t const b = (m_color_select & 1) ? videoram[isa8_cga_pc1512_device::vram_offset[0] | offset] : 0;
+
+ *p++ = palette[((i & 0x400) | (r & 0x200) | (g & 0x100) | (b & 0x80) ) >> 7];
+ *p++ = palette[((i & 0x200) | (r & 0x100) | (g & 0x080) | (b & 0x40) ) >> 6];
+ *p++ = palette[((i & 0x100) | (r & 0x080) | (g & 0x040) | (b & 0x20) ) >> 5];
+ *p++ = palette[((i & 0x080) | (r & 0x040) | (g & 0x020) | (b & 0x10) ) >> 4];
+ *p++ = palette[((i & 0x040) | (r & 0x020) | (g & 0x010) | (b & 0x08) ) >> 3];
+ *p++ = palette[((i & 0x020) | (r & 0x010) | (g & 0x008) | (b & 0x04) ) >> 2];
+ *p++ = palette[((i & 0x010) | (r & 0x008) | (g & 0x004) | (b & 0x02) ) >> 1];
+ *p++ = palette[ (i & 0x008) | (r & 0x004) | (g & 0x002) | (b & 0x01) ];
}
}
@@ -1500,31 +1494,38 @@ void isa8_wyse700_device::device_reset()
uint32_t isa8_wyse700_device::screen_update(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect)
{
- if (m_control & 0x08) {
- const rgb_t *palette = m_palette->palette()->entry_list_raw();
- uint8_t fg = m_color_select & 0x0F;
+ if (m_control & 0x08)
+ {
+ rgb_t const *const palette = m_palette->palette()->entry_list_raw();
+ uint8_t const fg = m_color_select & 0x0F;
uint32_t addr = 0;
- for (int y = 0; y < 800; y++) {
- uint8_t *src = &m_vram[addr];
+ for (int y = 0; y < 800; y++)
+ {
+ uint8_t const *src = &m_vram[addr];
- if (y & 1) {
+ if (y & 1)
+ {
src += 0x10000;
addr += 160;
}
- for (int x = 0; x < (1280 / 8); x++) {
+ for (int x = 0; x < (1280 / 8); x++)
+ {
uint8_t val = src[x];
- for (int i = 0; i < 8; i++) {
- bitmap.pix32(y,x*8+i) = (val & 0x80) ? palette[fg] : palette[0x00];
+ for (int i = 0; i < 8; i++)
+ {
+ bitmap.pix(y, x * 8 + i) = (val & 0x80) ? palette[fg] : palette[0x00];
val <<= 1;
}
}
}
- } else {
+ return 0;
+ }
+ else
+ {
return isa8_cga_device::screen_update(screen, bitmap, cliprect);
}
- return 0;
}
@@ -1837,7 +1838,7 @@ uint8_t isa8_cga_m24_device::io_read(offs_t offset)
MC6845_UPDATE_ROW(isa8_cga_m24_device::crtc_update_row)
{
- if(m_mode2 & 1)
+ if (m_mode2 & 1)
{
m24_gfx_1bpp_m24_update_row(bitmap, cliprect, ma, ra, y, x_count, cursor_x, de, hbp, vbp);
return;
@@ -1847,7 +1848,7 @@ MC6845_UPDATE_ROW(isa8_cga_m24_device::crtc_update_row)
return;
y = m_y;
- if(m_y >= bitmap.height())
+ if (m_y >= bitmap.height())
return;
switch (m_update_row_type)
@@ -1885,37 +1886,38 @@ MC6845_UPDATE_ROW(isa8_cga_m24_device::crtc_update_row)
MC6845_UPDATE_ROW( isa8_cga_m24_device::m24_gfx_1bpp_m24_update_row )
{
- uint8_t *videoram = &m_vram[m_start_offset];
- uint32_t *p = &bitmap.pix32(y);
- const rgb_t *palette = m_palette->palette()->entry_list_raw();
- uint8_t fg = m_color_select & 0x0F;
- int i;
+ uint8_t const *const videoram = &m_vram[m_start_offset];
+ uint32_t *p = &bitmap.pix(y);
+ rgb_t const *const palette = m_palette->palette()->entry_list_raw();
+ uint8_t const fg = m_color_select & 0x0f;
- if ( y == 0 ) CGA_LOG(1,"m24_gfx_1bpp_m24_update_row",("\n"));
- for ( i = 0; i < x_count; i++ )
+ if (y == 0) CGA_LOG(1,"m24_gfx_1bpp_m24_update_row",("\n"));
+ for (int i = 0; i < x_count; i++)
{
- uint16_t offset = ( ( ( ma + i ) << 1 ) & 0x1fff ) | ( ( ra & 3 ) << 13 );
- uint8_t data = videoram[ offset ];
-
- *p = palette[( data & 0x80 ) ? fg : 0]; p++;
- *p = palette[( data & 0x40 ) ? fg : 0]; p++;
- *p = palette[( data & 0x20 ) ? fg : 0]; p++;
- *p = palette[( data & 0x10 ) ? fg : 0]; p++;
- *p = palette[( data & 0x08 ) ? fg : 0]; p++;
- *p = palette[( data & 0x04 ) ? fg : 0]; p++;
- *p = palette[( data & 0x02 ) ? fg : 0]; p++;
- *p = palette[( data & 0x01 ) ? fg : 0]; p++;
-
- data = videoram[ offset + 1 ];
-
- *p = palette[( data & 0x80 ) ? fg : 0]; p++;
- *p = palette[( data & 0x40 ) ? fg : 0]; p++;
- *p = palette[( data & 0x20 ) ? fg : 0]; p++;
- *p = palette[( data & 0x10 ) ? fg : 0]; p++;
- *p = palette[( data & 0x08 ) ? fg : 0]; p++;
- *p = palette[( data & 0x04 ) ? fg : 0]; p++;
- *p = palette[( data & 0x02 ) ? fg : 0]; p++;
- *p = palette[( data & 0x01 ) ? fg : 0]; p++;
+ uint16_t const offset = (((ma + i) << 1 ) & 0x1fff) | ((ra & 3) << 13);
+ uint8_t data;
+
+ data = videoram[offset];
+
+ *p++ = palette[(data & 0x80) ? fg : 0];
+ *p++ = palette[(data & 0x40) ? fg : 0];
+ *p++ = palette[(data & 0x20) ? fg : 0];
+ *p++ = palette[(data & 0x10) ? fg : 0];
+ *p++ = palette[(data & 0x08) ? fg : 0];
+ *p++ = palette[(data & 0x04) ? fg : 0];
+ *p++ = palette[(data & 0x02) ? fg : 0];
+ *p++ = palette[(data & 0x01) ? fg : 0];
+
+ data = videoram[offset + 1];
+
+ *p++ = palette[(data & 0x80) ? fg : 0];
+ *p++ = palette[(data & 0x40) ? fg : 0];
+ *p++ = palette[(data & 0x20) ? fg : 0];
+ *p++ = palette[(data & 0x10) ? fg : 0];
+ *p++ = palette[(data & 0x08) ? fg : 0];
+ *p++ = palette[(data & 0x04) ? fg : 0];
+ *p++ = palette[(data & 0x02) ? fg : 0];
+ *p++ = palette[(data & 0x01) ? fg : 0];
}
}
diff --git a/src/devices/bus/isa/ega.cpp b/src/devices/bus/isa/ega.cpp
index e3d75e4070a..45d169f3dff 100644
--- a/src/devices/bus/isa/ega.cpp
+++ b/src/devices/bus/isa/ega.cpp
@@ -783,7 +783,7 @@ WRITE_LINE_MEMBER( isa8_ega_device::vblank_changed )
CRTC_EGA_ROW_UPDATE( isa8_ega_device::pc_ega_graphics )
{
- uint16_t *p = &bitmap.pix16(y);
+ uint16_t *p = &bitmap.pix(y);
LOG("%s: y = %d, x_count = %d, ma = %d, ra = %d\n", FUNCNAME, y, x_count, ma, ra );
@@ -844,12 +844,11 @@ CRTC_EGA_ROW_UPDATE( isa8_ega_device::pc_ega_graphics )
CRTC_EGA_ROW_UPDATE( isa8_ega_device::pc_ega_text )
{
- uint16_t *p = &bitmap.pix16(y);
- int i;
+ uint16_t *p = &bitmap.pix(y);
LOG("%s: y = %d, x_count = %d, ma = %d, ra = %d\n", FUNCNAME, y, x_count, ma, ra );
- for ( i = 0; i < x_count; i++ )
+ for ( int i = 0; i < x_count; i++ )
{
uint16_t offset = ma + i;
uint8_t chr = m_plane[0][ offset ];
@@ -901,8 +900,6 @@ CRTC_EGA_ROW_UPDATE( isa8_ega_device::pc_ega_text )
void isa8_ega_device::change_mode()
{
- int clock, pixels;
-
m_video_mode = 0;
/* Check for graphics mode */
@@ -938,8 +935,8 @@ void isa8_ega_device::change_mode()
}
/* Check for changes to the crtc input clock and number of pixels per clock */
- clock = ( ( m_misc_output & 0x0c ) ? 16257000 : 14318181 );
- pixels = ( ( m_sequencer.data[0x01] & 0x01 ) ? 8 : 9 );
+ int clock = ( ( m_misc_output & 0x0c ) ? 16257000 : 14318181 );
+ int pixels = ( ( m_sequencer.data[0x01] & 0x01 ) ? 8 : 9 );
if ( m_sequencer.data[0x01] & 0x08 )
{
diff --git a/src/devices/bus/isa/eis_hgb107x.cpp b/src/devices/bus/isa/eis_hgb107x.cpp
index 32aeac02c3e..25b16a38fe3 100644
--- a/src/devices/bus/isa/eis_hgb107x.cpp
+++ b/src/devices/bus/isa/eis_hgb107x.cpp
@@ -420,10 +420,6 @@ inline int isa8_epc_mda_device::get_yres()
MC6845_UPDATE_ROW(isa8_epc_mda_device::crtc_update_row)
{
- uint32_t *p = &bitmap.pix32(y);
- uint16_t chr_base = ra;
- int i;
-
// Get som debug data from a couple of rows now and then
if ( y < (16 * 0 + 0x20) && (m_framecnt & 0xff) == 0 )
{
@@ -436,7 +432,7 @@ MC6845_UPDATE_ROW(isa8_epc_mda_device::crtc_update_row)
{
for (int i = 0; i < get_xres(); i++)
{
- bitmap.pix32(y, i) = rgb_t::black();
+ bitmap.pix(y, i) = rgb_t::black();
}
}
@@ -449,14 +445,17 @@ MC6845_UPDATE_ROW(isa8_epc_mda_device::crtc_update_row)
// Text modes using one of two 9x16 fonts in character rom
else
{
+ uint32_t *p = &bitmap.pix(y);
+ uint16_t chr_base = ra;
+
// Adjust row pointer if in monochrome text mode as we insert two scanlines per row of characters (see below)
if (m_vmode & VM_MONO)
{
- p = &bitmap.pix32((y / 14) * 16 + y % 14);
+ p = &bitmap.pix((y / 14) * 16 + y % 14);
}
// Loop over each character in a row
- for ( i = 0; i < x_count; i++ )
+ for ( int i = 0; i < x_count; i++ )
{
uint16_t offset = ( ( ma + i ) << 1 ) & 0x0FFF;
uint8_t chr = m_videoram[ offset ];
@@ -555,14 +554,14 @@ MC6845_UPDATE_ROW(isa8_epc_mda_device::crtc_update_row)
{
if (chr >= 0xb3 && chr <= 0xdf) // Handle the meta graphics characters
{
- bitmap.pix32(row + 1, j + i * 9) = (*m_pal)[( data & (0x80 >> j) ) || (j == 8 && (data & 0x01)) ? fg : bg];
- bitmap.pix32(row + 2, j + i * 9) = (*m_pal)[( data & (0x80 >> j) ) || (j == 8 && (data & 0x01)) ? fg : bg];
+ bitmap.pix(row + 1, j + i * 9) = (*m_pal)[( data & (0x80 >> j) ) || (j == 8 && (data & 0x01)) ? fg : bg];
+ bitmap.pix(row + 2, j + i * 9) = (*m_pal)[( data & (0x80 >> j) ) || (j == 8 && (data & 0x01)) ? fg : bg];
}
else
{
// Handle underline
- bitmap.pix32(row + 1, j + i * 9) =(*m_pal)[( attr & ATTR_FOREG ) == ATTR_ULINE ? fg : bg];
- bitmap.pix32(row + 2, j + i * 9) = (*m_pal)[bg];
+ bitmap.pix(row + 1, j + i * 9) =(*m_pal)[( attr & ATTR_FOREG ) == ATTR_ULINE ? fg : bg];
+ bitmap.pix(row + 2, j + i * 9) = (*m_pal)[bg];
}
}
}
diff --git a/src/devices/bus/isa/ex1280.cpp b/src/devices/bus/isa/ex1280.cpp
index 84c8bb8d269..2d9153616e9 100644
--- a/src/devices/bus/isa/ex1280.cpp
+++ b/src/devices/bus/isa/ex1280.cpp
@@ -144,15 +144,15 @@ void isa16_ex1280_device::vram_w(offs_t offset, uint16_t data, uint16_t mem_mask
TMS340X0_SCANLINE_RGB32_CB_MEMBER(isa16_ex1280_device::scanline_update)
{
- uint16_t *src = &m_vram[params->rowaddr << 8];
- uint32_t *dest = &bitmap.pix32(scanline);
- const pen_t *pens = m_ramdac->pens();
+ uint16_t const *const src = &m_vram[params->rowaddr << 8];
+ uint32_t *const dest = &bitmap.pix(scanline);
+ pen_t const *const pens = m_ramdac->pens();
int coladdr = params->coladdr << 1;
/* copy the non-blanked portions of this scanline */
for (int x = params->heblnk; x < params->hsblnk; x += 4)
{
- uint16_t pixels = src[coladdr++];
+ uint16_t const pixels = src[coladdr++];
dest[x + 0] = pens[pixels & 0x0f];
dest[x + 1] = pens[(pixels >> 4) & 0x0f];
dest[x + 2] = pens[(pixels >> 8) & 0x0f];
diff --git a/src/devices/bus/isa/mach32.cpp b/src/devices/bus/isa/mach32.cpp
index 602147aa060..e9f4ad8d197 100644
--- a/src/devices/bus/isa/mach32.cpp
+++ b/src/devices/bus/isa/mach32.cpp
@@ -180,11 +180,8 @@ uint32_t mach32_device::screen_update(screen_device &screen, bitmap_rgb32 &bitma
return 0;
uint32_t src = (m_cursor_address & 0x000fffff) << 2;
- uint32_t* dst; // destination pixel
- uint8_t x,y,z;
- uint32_t colour0;
- uint32_t colour1;
+ uint32_t colour0, colour1;
if(depth == 8)
{
colour0 = pen(m_cursor_colour0_b);
@@ -197,18 +194,18 @@ uint32_t mach32_device::screen_update(screen_device &screen, bitmap_rgb32 &bitma
}
// draw hardware pointer (64x64 max)
- for(y=0;y<64;y++)
+ for(uint8_t y=0;y<64;y++)
{
- dst = &bitmap.pix32(m_cursor_vertical + y, m_cursor_horizontal);
- for(x=0;x<64;x+=8)
+ uint32_t *dst = &bitmap.pix(m_cursor_vertical + y, m_cursor_horizontal);
+ for(uint8_t x=0;x<64;x+=8)
{
- uint16_t bits = (vga.memory[(src+0) % vga.svga_intf.vram_size] | ((vga.memory[(src+1) % vga.svga_intf.vram_size]) << 8));
+ uint16_t const bits = (vga.memory[(src+0) % vga.svga_intf.vram_size] | ((vga.memory[(src+1) % vga.svga_intf.vram_size]) << 8));
- for(z=0;z<8;z++)
+ for(uint8_t z=0;z<8;z++)
{
if(((z + x) > (m_cursor_offset_horizontal-1)) && (y < (63 - m_cursor_offset_vertical)))
{
- uint8_t val = (bits >> (z*2)) & 0x03;
+ uint8_t const val = (bits >> (z*2)) & 0x03;
switch(val)
{
case 0: // cursor colour 0
diff --git a/src/devices/bus/isa/mda.cpp b/src/devices/bus/isa/mda.cpp
index cf4a6aa3803..ae61e78e116 100644
--- a/src/devices/bus/isa/mda.cpp
+++ b/src/devices/bus/isa/mda.cpp
@@ -225,27 +225,26 @@ void isa8_mda_device::device_reset()
***************************************************************************/
MC6845_UPDATE_ROW( isa8_mda_device::mda_text_inten_update_row )
{
- const rgb_t *palette = m_palette->palette()->entry_list_raw();
- uint32_t *p = &bitmap.pix32(y);
- uint16_t chr_base = ( ra & 0x08 ) ? 0x800 | ( ra & 0x07 ) : ra;
- int i;
+ rgb_t const *const palette = m_palette->palette()->entry_list_raw();
+ uint32_t *p = &bitmap.pix(y);
+ uint16_t const chr_base = (ra & 0x08) ? 0x800 | (ra & 0x07) : ra;
- if ( y == 0 ) LOGROW("%11.6f: %-24s\n", machine().time().as_double(), FUNCNAME);
- for ( i = 0; i < x_count; i++ )
+ if (y == 0) LOGROW("%11.6f: %-24s\n", machine().time().as_double(), FUNCNAME);
+ for (int i = 0; i < x_count; i++)
{
- uint16_t offset = ( ( ma + i ) << 1 ) & 0x0FFF;
- uint8_t chr = m_videoram[ offset ];
- uint8_t attr = m_videoram[ offset + 1 ];
- uint8_t data = m_chr_gen[ chr_base + chr * 8 ];
- uint8_t fg = ( attr & 0x08 ) ? 3 : 2;
+ uint16_t const offset = ((ma + i) << 1) & 0x0fff;
+ uint8_t const chr = m_videoram[offset];
+ uint8_t const attr = m_videoram[offset + 1];
+ uint8_t data = m_chr_gen[chr_base + chr * 8];
+ uint8_t fg = (attr & 0x08) ? 3 : 2;
uint8_t bg = 0;
- if ( ( attr & ~0x88 ) == 0 )
+ if ((attr & ~0x88) == 0)
{
data = 0x00;
}
- switch( attr )
+ switch (attr)
{
case 0x70:
bg = 2;
@@ -255,36 +254,36 @@ MC6845_UPDATE_ROW( isa8_mda_device::mda_text_inten_update_row )
bg = 2;
fg = 1;
break;
- case 0xF0:
+ case 0xf0:
bg = 3;
fg = 0;
break;
- case 0xF8:
+ case 0xf8:
bg = 3;
fg = 1;
break;
}
- if ( ( i == cursor_x && ( m_framecnt & 0x08 ) ) || ( attr & 0x07 ) == 0x01 )
+ if ((i == cursor_x && (m_framecnt & 0x08)) || (attr & 0x07) == 0x01)
{
- data = 0xFF;
+ data = 0xff;
}
- *p = palette[( data & 0x80 ) ? fg : bg]; p++;
- *p = palette[( data & 0x40 ) ? fg : bg]; p++;
- *p = palette[( data & 0x20 ) ? fg : bg]; p++;
- *p = palette[( data & 0x10 ) ? fg : bg]; p++;
- *p = palette[( data & 0x08 ) ? fg : bg]; p++;
- *p = palette[( data & 0x04 ) ? fg : bg]; p++;
- *p = palette[( data & 0x02 ) ? fg : bg]; p++;
- *p = palette[( data & 0x01 ) ? fg : bg]; p++;
- if ( ( chr & 0xE0 ) == 0xC0 )
+ *p++ = palette[(data & 0x80) ? fg : bg];
+ *p++ = palette[(data & 0x40) ? fg : bg];
+ *p++ = palette[(data & 0x20) ? fg : bg];
+ *p++ = palette[(data & 0x10) ? fg : bg];
+ *p++ = palette[(data & 0x08) ? fg : bg];
+ *p++ = palette[(data & 0x04) ? fg : bg];
+ *p++ = palette[(data & 0x02) ? fg : bg];
+ *p++ = palette[(data & 0x01) ? fg : bg];
+ if ((chr & 0xe0) == 0xc0)
{
- *p = palette[( data & 0x01 ) ? fg : bg]; p++;
+ *p++ = palette[(data & 0x01) ? fg : bg];
}
else
{
- *p = palette[bg]; p++;
+ *p++ = palette[bg];
}
}
}
@@ -298,75 +297,74 @@ MC6845_UPDATE_ROW( isa8_mda_device::mda_text_inten_update_row )
MC6845_UPDATE_ROW( isa8_mda_device::mda_text_blink_update_row )
{
- const rgb_t *palette = m_palette->palette()->entry_list_raw();
- uint32_t *p = &bitmap.pix32(y);
- uint16_t chr_base = ( ra & 0x08 ) ? 0x800 | ( ra & 0x07 ) : ra;
- int i;
+ rgb_t const *const palette = m_palette->palette()->entry_list_raw();
+ uint32_t *p = &bitmap.pix(y);
+ uint16_t const chr_base = (ra & 0x08) ? 0x800 | (ra & 0x07) : ra;
- if ( y == 0 ) LOGROW("%11.6f: %-24s\n", machine().time().as_double(), FUNCNAME);
- for ( i = 0; i < x_count; i++ )
+ if (y == 0) LOGROW("%11.6f: %-24s\n", machine().time().as_double(), FUNCNAME);
+ for (int i = 0; i < x_count; i++)
{
- uint16_t offset = ( ( ma + i ) << 1 ) & 0x0FFF;
- uint8_t chr = m_videoram[ offset ];
- uint8_t attr = m_videoram[ offset + 1 ];
- uint8_t data = m_chr_gen[ chr_base + chr * 8 ];
- uint8_t fg = ( attr & 0x08 ) ? 3 : 2;
+ uint16_t const offset = ((ma + i) << 1) & 0x0fff;
+ uint8_t const chr = m_videoram[offset];
+ uint8_t const attr = m_videoram[offset + 1];
+ uint8_t data = m_chr_gen[chr_base + chr * 8];
+ uint8_t fg = (attr & 0x08) ? 3 : 2;
uint8_t bg = 0;
- if ( ( attr & ~0x88 ) == 0 )
+ if ((attr & ~0x88) == 0)
{
data = 0x00;
}
- switch( attr )
+ switch (attr)
{
case 0x70:
- case 0xF0:
+ case 0xf0:
bg = 2;
fg = 0;
break;
case 0x78:
- case 0xF8:
+ case 0xf8:
bg = 2;
fg = 1;
break;
}
- if ( ( attr & 0x07 ) == 0x01 )
+ if ((attr & 0x07) == 0x01)
{
- data = 0xFF;
+ data = 0xff;
}
- if ( i == cursor_x )
+ if (i == cursor_x)
{
- if ( m_framecnt & 0x08 )
+ if (m_framecnt & 0x08)
{
- data = 0xFF;
+ data = 0xff;
}
}
else
{
- if ( ( attr & 0x80 ) && ( m_framecnt & 0x10 ) )
+ if ((attr & 0x80) && (m_framecnt & 0x10))
{
data = 0x00;
}
}
- *p = palette[( data & 0x80 ) ? fg : bg]; p++;
- *p = palette[( data & 0x40 ) ? fg : bg]; p++;
- *p = palette[( data & 0x20 ) ? fg : bg]; p++;
- *p = palette[( data & 0x10 ) ? fg : bg]; p++;
- *p = palette[( data & 0x08 ) ? fg : bg]; p++;
- *p = palette[( data & 0x04 ) ? fg : bg]; p++;
- *p = palette[( data & 0x02 ) ? fg : bg]; p++;
- *p = palette[( data & 0x01 ) ? fg : bg]; p++;
- if ( ( chr & 0xE0 ) == 0xC0 )
+ *p++ = palette[(data & 0x80) ? fg : bg];
+ *p++ = palette[(data & 0x40) ? fg : bg];
+ *p++ = palette[(data & 0x20) ? fg : bg];
+ *p++ = palette[(data & 0x10) ? fg : bg];
+ *p++ = palette[(data & 0x08) ? fg : bg];
+ *p++ = palette[(data & 0x04) ? fg : bg];
+ *p++ = palette[(data & 0x02) ? fg : bg];
+ *p++ = palette[(data & 0x01) ? fg : bg];
+ if ((chr & 0xe0) == 0xc0)
{
- *p = palette[( data & 0x01 ) ? fg : bg]; p++;
+ *p++ = palette[(data & 0x01) ? fg : bg];
}
else
{
- *p = palette[bg]; p++;
+ *p++ = palette[bg];
}
}
}
@@ -631,34 +629,36 @@ void isa8_hercules_device::device_reset()
MC6845_UPDATE_ROW( isa8_hercules_device::hercules_gfx_update_row )
{
- const rgb_t *palette = m_palette->palette()->entry_list_raw();
- uint32_t *p = &bitmap.pix32(y);
- uint16_t gfx_base = ( ( m_mode_control & 0x80 ) ? 0x8000 : 0x0000 ) | ( ( ra & 0x03 ) << 13 );
- int i;
- if ( y == 0 ) LOGROW("%11.6f: %-24s\n", machine().time().as_double(), FUNCNAME);
- for ( i = 0; i < x_count; i++ )
+ rgb_t const *const palette = m_palette->palette()->entry_list_raw();
+ uint32_t *p = &bitmap.pix(y);
+ uint16_t const gfx_base = ((m_mode_control & 0x80) ? 0x8000 : 0x0000) | ((ra & 0x03) << 13);
+
+ if (y == 0) LOGROW("%11.6f: %-24s\n", machine().time().as_double(), FUNCNAME);
+ for (int i = 0; i < x_count; i++)
{
- uint8_t data = m_videoram[ gfx_base + ( ( ma + i ) << 1 ) ];
-
- *p = palette[( data & 0x80 ) ? 2 : 0]; p++;
- *p = palette[( data & 0x40 ) ? 2 : 0]; p++;
- *p = palette[( data & 0x20 ) ? 2 : 0]; p++;
- *p = palette[( data & 0x10 ) ? 2 : 0]; p++;
- *p = palette[( data & 0x08 ) ? 2 : 0]; p++;
- *p = palette[( data & 0x04 ) ? 2 : 0]; p++;
- *p = palette[( data & 0x02 ) ? 2 : 0]; p++;
- *p = palette[( data & 0x01 ) ? 2 : 0]; p++;
-
- data = m_videoram[ gfx_base + ( ( ma + i ) << 1 ) + 1 ];
-
- *p = palette[( data & 0x80 ) ? 2 : 0]; p++;
- *p = palette[( data & 0x40 ) ? 2 : 0]; p++;
- *p = palette[( data & 0x20 ) ? 2 : 0]; p++;
- *p = palette[( data & 0x10 ) ? 2 : 0]; p++;
- *p = palette[( data & 0x08 ) ? 2 : 0]; p++;
- *p = palette[( data & 0x04 ) ? 2 : 0]; p++;
- *p = palette[( data & 0x02 ) ? 2 : 0]; p++;
- *p = palette[( data & 0x01 ) ? 2 : 0]; p++;
+ uint8_t data;
+
+ data = m_videoram[gfx_base + ((ma + i) << 1)];
+
+ *p++ = palette[(data & 0x80) ? 2 : 0];
+ *p++ = palette[(data & 0x40) ? 2 : 0];
+ *p++ = palette[(data & 0x20) ? 2 : 0];
+ *p++ = palette[(data & 0x10) ? 2 : 0];
+ *p++ = palette[(data & 0x08) ? 2 : 0];
+ *p++ = palette[(data & 0x04) ? 2 : 0];
+ *p++ = palette[(data & 0x02) ? 2 : 0];
+ *p++ = palette[(data & 0x01) ? 2 : 0];
+
+ data = m_videoram[gfx_base + ((ma + i) << 1) + 1];
+
+ *p++ = palette[(data & 0x80) ? 2 : 0];
+ *p++ = palette[(data & 0x40) ? 2 : 0];
+ *p++ = palette[(data & 0x20) ? 2 : 0];
+ *p++ = palette[(data & 0x10) ? 2 : 0];
+ *p++ = palette[(data & 0x08) ? 2 : 0];
+ *p++ = palette[(data & 0x04) ? 2 : 0];
+ *p++ = palette[(data & 0x02) ? 2 : 0];
+ *p++ = palette[(data & 0x01) ? 2 : 0];
}
}
@@ -816,27 +816,26 @@ void isa8_ec1840_0002_device::device_reset()
MC6845_UPDATE_ROW( isa8_ec1840_0002_device::mda_lowres_text_inten_update_row )
{
- const rgb_t *palette = m_palette->palette()->entry_list_raw();
- uint32_t *p = &bitmap.pix32(y);
- uint16_t chr_base = ra;
- int i;
+ rgb_t const *const palette = m_palette->palette()->entry_list_raw();
+ uint32_t *p = &bitmap.pix(y);
+ uint16_t const chr_base = ra;
- if ( y == 0 ) LOGROW("%11.6f: %-24s\n", machine().time().as_double(), FUNCNAME);
- for ( i = 0; i < x_count; i++ )
+ if (y == 0) LOGROW("%11.6f: %-24s\n", machine().time().as_double(), FUNCNAME);
+ for (int i = 0; i < x_count; i++)
{
- uint16_t offset = ( ( ma + i ) << 1 ) & 0x0FFF;
- uint8_t chr = m_videoram[ offset ];
- uint8_t attr = m_videoram[ offset + 1 ];
- uint8_t data = m_chr_gen[ (chr_base + chr * 16) << 1 ];
- uint8_t fg = ( attr & 0x08 ) ? 3 : 2;
+ uint16_t const offset = ((ma + i) << 1) & 0x0fff;
+ uint8_t const chr = m_videoram[offset];
+ uint8_t const attr = m_videoram[offset + 1];
+ uint8_t data = m_chr_gen[(chr_base + chr * 16) << 1];
+ uint8_t fg = (attr & 0x08) ? 3 : 2;
uint8_t bg = 0;
- if ( ( attr & ~0x88 ) == 0 )
+ if ((attr & ~0x88) == 0)
{
data = 0x00;
}
- switch( attr )
+ switch (attr)
{
case 0x70:
bg = 2;
@@ -846,29 +845,29 @@ MC6845_UPDATE_ROW( isa8_ec1840_0002_device::mda_lowres_text_inten_update_row )
bg = 2;
fg = 1;
break;
- case 0xF0:
+ case 0xf0:
bg = 3;
fg = 0;
break;
- case 0xF8:
+ case 0xf8:
bg = 3;
fg = 1;
break;
}
- if ( ( i == cursor_x && ( m_framecnt & 0x08 ) ) || ( attr & 0x07 ) == 0x01 )
+ if ((i == cursor_x && (m_framecnt & 0x08)) || (attr & 0x07) == 0x01)
{
- data = 0xFF;
+ data = 0xff;
}
- *p = palette[( data & 0x80 ) ? fg : bg]; p++;
- *p = palette[( data & 0x40 ) ? fg : bg]; p++;
- *p = palette[( data & 0x20 ) ? fg : bg]; p++;
- *p = palette[( data & 0x10 ) ? fg : bg]; p++;
- *p = palette[( data & 0x08 ) ? fg : bg]; p++;
- *p = palette[( data & 0x04 ) ? fg : bg]; p++;
- *p = palette[( data & 0x02 ) ? fg : bg]; p++;
- *p = palette[( data & 0x01 ) ? fg : bg]; p++;
+ *p++ = palette[(data & 0x80) ? fg : bg];
+ *p++ = palette[(data & 0x40) ? fg : bg];
+ *p++ = palette[(data & 0x20) ? fg : bg];
+ *p++ = palette[(data & 0x10) ? fg : bg];
+ *p++ = palette[(data & 0x08) ? fg : bg];
+ *p++ = palette[(data & 0x04) ? fg : bg];
+ *p++ = palette[(data & 0x02) ? fg : bg];
+ *p++ = palette[(data & 0x01) ? fg : bg];
}
}
@@ -880,68 +879,67 @@ MC6845_UPDATE_ROW( isa8_ec1840_0002_device::mda_lowres_text_inten_update_row )
MC6845_UPDATE_ROW( isa8_ec1840_0002_device::mda_lowres_text_blink_update_row )
{
- const rgb_t *palette = m_palette->palette()->entry_list_raw();
- uint32_t *p = &bitmap.pix32(y);
- uint16_t chr_base = ra;
- int i;
+ rgb_t const *const palette = m_palette->palette()->entry_list_raw();
+ uint32_t *p = &bitmap.pix(y);
+ uint16_t const chr_base = ra;
- if ( y == 0 ) LOGROW("%11.6f: %-24s\n", machine().time().as_double(), FUNCNAME);
- for ( i = 0; i < x_count; i++ )
+ if (y == 0) LOGROW("%11.6f: %-24s\n", machine().time().as_double(), FUNCNAME);
+ for (int i = 0; i < x_count; i++)
{
- uint16_t offset = ( ( ma + i ) << 1 ) & 0x0FFF;
- uint8_t chr = m_videoram[ offset ];
- uint8_t attr = m_videoram[ offset + 1 ];
- uint8_t data = m_chr_gen[ (chr_base + chr * 16) << 1 ];
- uint8_t fg = ( attr & 0x08 ) ? 3 : 2;
+ uint16_t const offset = ((ma + i) << 1) & 0x0fff;
+ uint8_t const chr = m_videoram[offset];
+ uint8_t const attr = m_videoram[offset + 1];
+ uint8_t data = m_chr_gen[(chr_base + chr * 16) << 1];
+ uint8_t fg = (attr & 0x08) ? 3 : 2;
uint8_t bg = 0;
- if ( ( attr & ~0x88 ) == 0 )
+ if ((attr & ~0x88) == 0)
{
data = 0x00;
}
- switch( attr )
+ switch (attr)
{
case 0x70:
- case 0xF0:
+ case 0xf0:
bg = 2;
fg = 0;
break;
case 0x78:
- case 0xF8:
+ case 0xf8:
bg = 2;
fg = 1;
break;
}
- if ( ( attr & 0x07 ) == 0x01 )
+ if ((attr & 0x07) == 0x01)
{
- data = 0xFF;
+ data = 0xff;
}
- if ( i == cursor_x )
+ if (i == cursor_x)
{
- if ( m_framecnt & 0x08 )
+ if (m_framecnt & 0x08)
{
- data = 0xFF;
+ data = 0xff;
}
}
else
{
- if ( ( attr & 0x80 ) && ( m_framecnt & 0x10 ) )
+ if ((attr & 0x80) && (m_framecnt & 0x10))
{
data = 0x00;
}
}
- *p = palette[( data & 0x80 ) ? fg : bg]; p++;
- *p = palette[( data & 0x40 ) ? fg : bg]; p++;
- *p = palette[( data & 0x20 ) ? fg : bg]; p++;
- *p = palette[( data & 0x10 ) ? fg : bg]; p++;
- *p = palette[( data & 0x08 ) ? fg : bg]; p++;
- *p = palette[( data & 0x04 ) ? fg : bg]; p++;
- *p = palette[( data & 0x02 ) ? fg : bg]; p++;
- *p = palette[( data & 0x01 ) ? fg : bg]; p++;
+ *p++ = palette[(data & 0x80) ? fg : bg];
+ *p++ = palette[(data & 0x40) ? fg : bg];
+ *p++ = palette[(data & 0x20) ? fg : bg];
+ *p++ = palette[(data & 0x10) ? fg : bg];
+ *p++ = palette[(data & 0x08) ? fg : bg];
+ *p++ = palette[(data & 0x04) ? fg : bg];
+ *p++ = palette[(data & 0x02) ? fg : bg];
+ *p++ = palette[(data & 0x01) ? fg : bg];
}
}
diff --git a/src/devices/bus/isa/num9rev.cpp b/src/devices/bus/isa/num9rev.cpp
index 07a35ee073c..632eb8b544b 100644
--- a/src/devices/bus/isa/num9rev.cpp
+++ b/src/devices/bus/isa/num9rev.cpp
@@ -36,7 +36,7 @@ UPD7220_DISPLAY_PIXELS_MEMBER( isa8_number_9_rev_device::hgdc_display_pixels )
color.set_r(pal->entry_color(m_ram[addr] | ((overlay & 0xf) << 8)).r());
color.set_g(pal->entry_color(m_ram[addr + 0x40000] | ((overlay & 0xf0) << 4)).g());
color.set_b(pal->entry_color(m_ram[addr + 0x80000] | (overlay & 0xf00)).b());
- bitmap.pix32(y, x + i) = color;
+ bitmap.pix(y, x + i) = color;
}
}
else
@@ -44,7 +44,7 @@ UPD7220_DISPLAY_PIXELS_MEMBER( isa8_number_9_rev_device::hgdc_display_pixels )
if(((address << 3) + 16) > (1024*1024))
return;
for(int i = 0; i < 16; i++)
- bitmap.pix32(y, x + i) = pal->entry_color(m_ram[(address << 4) + i]);
+ bitmap.pix(y, x + i) = pal->entry_color(m_ram[(address << 4) + i]);
}
}
diff --git a/src/devices/bus/isa/pgc.cpp b/src/devices/bus/isa/pgc.cpp
index 1366bc92dbc..f204333f9f2 100644
--- a/src/devices/bus/isa/pgc.cpp
+++ b/src/devices/bus/isa/pgc.cpp
@@ -401,14 +401,11 @@ uint8_t isa8_pgc_device::init_r()
uint32_t isa8_pgc_device::screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect)
{
- uint16_t *p;
- uint8_t *v;
-
for (int y = 0; y < PGC_DISP_VERT; y++)
{
// XXX address translation happens in hardware
- v = &m_vram[y * 1024];
- p = &bitmap.pix16(y + PGC_VERT_START, PGC_HORZ_START);
+ uint8_t const *v = &m_vram[y * 1024];
+ uint16_t *p = &bitmap.pix(y + PGC_VERT_START, PGC_HORZ_START);
for (int x = 0; x < PGC_DISP_HORZ; x++)
{
diff --git a/src/devices/bus/isa/trident.cpp b/src/devices/bus/isa/trident.cpp
index 0d64df5ba27..5fc2d2d6d19 100644
--- a/src/devices/bus/isa/trident.cpp
+++ b/src/devices/bus/isa/trident.cpp
@@ -212,29 +212,22 @@ void trident_vga_device::device_reset()
uint32_t trident_vga_device::screen_update(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect)
{
- uint8_t cur_mode;
-
svga_device::screen_update(screen,bitmap,cliprect);
- cur_mode = pc_vga_choosevideomode();
+ uint8_t const cur_mode = pc_vga_choosevideomode();
// draw hardware graphics cursor
if(tri.cursor_ctrl & 0x80) // if cursor is enabled
{
- uint32_t src;
- uint32_t* dst;
- uint8_t val;
- int x,y;
- uint16_t cx = tri.cursor_x & 0x0fff;
- uint16_t cy = tri.cursor_y & 0x0fff;
- uint32_t bg_col;
- uint32_t fg_col;
- uint8_t cursor_size = (tri.cursor_ctrl & 0x01) ? 64 : 32;
+ uint16_t const cx = tri.cursor_x & 0x0fff;
+ uint16_t const cy = tri.cursor_y & 0x0fff;
+ uint8_t const cursor_size = (tri.cursor_ctrl & 0x01) ? 64 : 32;
if(cur_mode == SCREEN_OFF || cur_mode == TEXT_MODE || cur_mode == MONO_MODE || cur_mode == CGA_MODE || cur_mode == EGA_MODE)
return 0; // cursor only works in VGA or SVGA modes
- src = tri.cursor_loc * 1024; // start address is in units of 1024 bytes
+ uint32_t src = tri.cursor_loc * 1024; // start address is in units of 1024 bytes
+ uint32_t bg_col, fg_col;
if(cur_mode == RGB16_MODE)
{
bg_col = tri.cursor_bg;
@@ -246,11 +239,11 @@ uint32_t trident_vga_device::screen_update(screen_device &screen, bitmap_rgb32 &
fg_col = pen(tri.cursor_fg & 0xff);
}
- for(y=0;y<cursor_size;y++)
+ for(int y=0;y<cursor_size;y++)
{
uint8_t bitcount = 31;
- dst = &bitmap.pix32(cy + y, cx);
- for(x=0;x<cursor_size;x++)
+ uint32_t *const dst = &bitmap.pix(cy + y, cx);
+ for(int x=0;x<cursor_size;x++)
{
uint32_t bitb = (vga.memory[(src+3) % vga.svga_intf.vram_size]
| ((vga.memory[(src+2) % vga.svga_intf.vram_size]) << 8)
@@ -260,7 +253,7 @@ uint32_t trident_vga_device::screen_update(screen_device &screen, bitmap_rgb32 &
| ((vga.memory[(src+6) % vga.svga_intf.vram_size]) << 8)
| ((vga.memory[(src+5) % vga.svga_intf.vram_size]) << 16)
| ((vga.memory[(src+4) % vga.svga_intf.vram_size]) << 24));
- val = (BIT(bita << 1,bitcount+1) << 1 | BIT(bitb,bitcount));
+ uint8_t const val = (BIT(bita << 1,bitcount+1) << 1 | BIT(bitb,bitcount));
if(tri.cursor_ctrl & 0x40)
{ // X11 mode
switch(val)
diff --git a/src/devices/bus/macpds/pds_tpdfpd.cpp b/src/devices/bus/macpds/pds_tpdfpd.cpp
index 833d1d3820f..6d9dd93b4ed 100644
--- a/src/devices/bus/macpds/pds_tpdfpd.cpp
+++ b/src/devices/bus/macpds/pds_tpdfpd.cpp
@@ -154,27 +154,23 @@ void macpds_sedisplay_device::device_timer(emu_timer &timer, device_timer_id tid
uint32_t macpds_sedisplay_device::screen_update(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect)
{
- uint32_t *scanline;
- int x, y;
- uint8_t pixels, *vram;
+ uint8_t const *const vram = m_vram.get();
- vram = m_vram.get();
-
- for (y = 0; y < 870; y++)
+ for (int y = 0; y < 870; y++)
{
- scanline = &bitmap.pix32(y);
- for (x = 0; x < 640/8; x++)
+ uint32_t *scanline = &bitmap.pix(y);
+ for (int x = 0; x < 640/8; x++)
{
- pixels = vram[(y * (1024/8)) + (x^1)];
-
- *scanline++ = m_palette[((pixels>>7)&0x1)^1];
- *scanline++ = m_palette[((pixels>>6)&0x1)^1];
- *scanline++ = m_palette[((pixels>>5)&0x1)^1];
- *scanline++ = m_palette[((pixels>>4)&0x1)^1];
- *scanline++ = m_palette[((pixels>>3)&0x1)^1];
- *scanline++ = m_palette[((pixels>>2)&0x1)^1];
- *scanline++ = m_palette[((pixels>>1)&0x1)^1];
- *scanline++ = m_palette[(pixels&1)^1];
+ uint8_t const pixels = vram[(y * (1024/8)) + (x^1)];
+
+ *scanline++ = m_palette[BIT(~pixels, 7)];
+ *scanline++ = m_palette[BIT(~pixels, 6)];
+ *scanline++ = m_palette[BIT(~pixels, 5)];
+ *scanline++ = m_palette[BIT(~pixels, 4)];
+ *scanline++ = m_palette[BIT(~pixels, 3)];
+ *scanline++ = m_palette[BIT(~pixels, 2)];
+ *scanline++ = m_palette[BIT(~pixels, 1)];
+ *scanline++ = m_palette[BIT(~pixels, 0)];
}
}
diff --git a/src/devices/bus/mtx/sdx.cpp b/src/devices/bus/mtx/sdx.cpp
index e413e997f5b..09e7199ac53 100644
--- a/src/devices/bus/mtx/sdx.cpp
+++ b/src/devices/bus/mtx/sdx.cpp
@@ -417,7 +417,7 @@ MC6845_UPDATE_ROW(mtx_sdxcpm_device::crtc_update_row)
int color = BIT(data, 7) ? fg : bg;
- bitmap.pix32(y, x) = pen[de ? color : 0];
+ bitmap.pix(y, x) = pen[de ? color : 0];
data <<= 1;
}
diff --git a/src/devices/bus/nasbus/avc.cpp b/src/devices/bus/nasbus/avc.cpp
index f7bc8e95596..f4590b2ac3f 100644
--- a/src/devices/bus/nasbus/avc.cpp
+++ b/src/devices/bus/nasbus/avc.cpp
@@ -120,7 +120,7 @@ MC6845_UPDATE_ROW( nascom_avc_device::crtc_update_row )
}
// plot the pixel
- bitmap.pix32(y, x) = m_palette->pen_color((b << 2) | (g << 1) | (r << 0));
+ bitmap.pix(y, x) = m_palette->pen_color((b << 2) | (g << 1) | (r << 0));
}
}
diff --git a/src/devices/bus/nubus/laserview.cpp b/src/devices/bus/nubus/laserview.cpp
index 2c58b6e8dc3..7e802b58988 100644
--- a/src/devices/bus/nubus/laserview.cpp
+++ b/src/devices/bus/nubus/laserview.cpp
@@ -117,30 +117,26 @@ void nubus_laserview_device::device_reset()
uint32_t nubus_laserview_device::screen_update(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect)
{
- uint32_t *scanline;
- int x, y;
- uint8_t pixels;
-
if (!m_vbl_disable)
{
raise_slot_irq();
}
- for (y = 0; y < 600; y++)
+ for (int y = 0; y < 600; y++)
{
- scanline = &bitmap.pix32(y);
- for (x = 0; x < 832/8; x++)
+ uint32_t *scanline = &bitmap.pix(y);
+ for (int x = 0; x < 832/8; x++)
{
- pixels = m_vram[(y * 104) + (BYTE4_XOR_BE(x)) + 0x20];
-
- *scanline++ = m_palette[(pixels>>7)&1];
- *scanline++ = m_palette[(pixels>>6)&1];
- *scanline++ = m_palette[(pixels>>5)&1];
- *scanline++ = m_palette[(pixels>>4)&1];
- *scanline++ = m_palette[(pixels>>3)&1];
- *scanline++ = m_palette[(pixels>>2)&1];
- *scanline++ = m_palette[(pixels>>1)&1];
- *scanline++ = m_palette[(pixels&1)];
+ uint8_t const pixels = m_vram[(y * 104) + (BYTE4_XOR_BE(x)) + 0x20];
+
+ *scanline++ = m_palette[BIT(pixels, 7)];
+ *scanline++ = m_palette[BIT(pixels, 6)];
+ *scanline++ = m_palette[BIT(pixels, 5)];
+ *scanline++ = m_palette[BIT(pixels, 4)];
+ *scanline++ = m_palette[BIT(pixels, 3)];
+ *scanline++ = m_palette[BIT(pixels, 2)];
+ *scanline++ = m_palette[BIT(pixels, 1)];
+ *scanline++ = m_palette[BIT(pixels, 0)];
}
}
diff --git a/src/devices/bus/nubus/nubus_48gc.cpp b/src/devices/bus/nubus/nubus_48gc.cpp
index 9105414f3e0..b9b831c6de2 100644
--- a/src/devices/bus/nubus/nubus_48gc.cpp
+++ b/src/devices/bus/nubus/nubus_48gc.cpp
@@ -12,6 +12,9 @@
#include "nubus_48gc.h"
#include "screen.h"
+#include <algorithm>
+
+
#define VRAM_SIZE (0x200000) // 2 megs, maxed out
#define GC48_SCREEN_NAME "48gc_screen"
@@ -152,10 +155,7 @@ void jmfb_device::device_timer(emu_timer &timer, device_timer_id tid, int param,
uint32_t jmfb_device::screen_update(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect)
{
- uint32_t *scanline, *base;
- int x, y;
- uint8_t *vram8 = &m_vram[0];
- uint8_t pixels;
+ uint8_t const *const vram8 = &m_vram[0xa00];
// first time? kick off the VBL timer
if (!m_screen)
@@ -164,37 +164,35 @@ uint32_t jmfb_device::screen_update(screen_device &screen, bitmap_rgb32 &bitmap,
m_timer->adjust(m_screen->time_until_pos(479, 0), 0);
}
- vram8 += 0xa00;
-
switch (m_mode)
{
case 0: // 1bpp
- for (y = 0; y < m_yres; y++)
+ for (int y = 0; y < m_yres; y++)
{
- scanline = &bitmap.pix32(y);
- for (x = 0; x < m_xres/8; x++)
+ uint32_t *scanline = &bitmap.pix(y);
+ for (int x = 0; x < m_xres/8; x++)
{
- pixels = vram8[(y * m_stride) + (BYTE4_XOR_BE(x))];
-
- *scanline++ = m_palette[(pixels>>7)&1];
- *scanline++ = m_palette[(pixels>>6)&1];
- *scanline++ = m_palette[(pixels>>5)&1];
- *scanline++ = m_palette[(pixels>>4)&1];
- *scanline++ = m_palette[(pixels>>3)&1];
- *scanline++ = m_palette[(pixels>>2)&1];
- *scanline++ = m_palette[(pixels>>1)&1];
- *scanline++ = m_palette[pixels&1];
+ uint8_t const pixels = vram8[(y * m_stride) + (BYTE4_XOR_BE(x))];
+
+ *scanline++ = m_palette[BIT(pixels, 7)];
+ *scanline++ = m_palette[BIT(pixels, 6)];
+ *scanline++ = m_palette[BIT(pixels, 5)];
+ *scanline++ = m_palette[BIT(pixels, 4)];
+ *scanline++ = m_palette[BIT(pixels, 3)];
+ *scanline++ = m_palette[BIT(pixels, 2)];
+ *scanline++ = m_palette[BIT(pixels, 1)];
+ *scanline++ = m_palette[BIT(pixels, 0)];
}
}
break;
case 1: // 2bpp
- for (y = 0; y < m_yres; y++)
+ for (int y = 0; y < m_yres; y++)
{
- scanline = &bitmap.pix32(y);
- for (x = 0; x < m_xres/4; x++)
+ uint32_t *scanline = &bitmap.pix(y);
+ for (int x = 0; x < m_xres/4; x++)
{
- pixels = vram8[(y * m_stride) + (BYTE4_XOR_BE(x))];
+ uint8_t const pixels = vram8[(y * m_stride) + (BYTE4_XOR_BE(x))];
*scanline++ = m_palette[(pixels>>6)&0x3];
*scanline++ = m_palette[(pixels>>4)&0x3];
@@ -205,13 +203,12 @@ uint32_t jmfb_device::screen_update(screen_device &screen, bitmap_rgb32 &bitmap,
break;
case 2: // 4 bpp
- for (y = 0; y < m_yres; y++)
+ for (int y = 0; y < m_yres; y++)
{
- scanline = &bitmap.pix32(y);
-
- for (x = 0; x < m_xres/2; x++)
+ uint32_t *scanline = &bitmap.pix(y);
+ for (int x = 0; x < m_xres/2; x++)
{
- pixels = vram8[(y * m_stride) + (BYTE4_XOR_BE(x))];
+ uint8_t const pixels = vram8[(y * m_stride) + (BYTE4_XOR_BE(x))];
*scanline++ = m_palette[(pixels>>4)&0xf];
*scanline++ = m_palette[pixels&0xf];
@@ -220,27 +217,22 @@ uint32_t jmfb_device::screen_update(screen_device &screen, bitmap_rgb32 &bitmap,
break;
case 3: // 8 bpp
- for (y = 0; y < m_yres; y++)
+ for (int y = 0; y < m_yres; y++)
{
- scanline = &bitmap.pix32(y);
-
- for (x = 0; x < m_xres; x++)
+ uint32_t *scanline = &bitmap.pix(y);
+ for (int x = 0; x < m_xres; x++)
{
- pixels = vram8[(y * m_stride) + (BYTE4_XOR_BE(x))];
+ uint8_t const pixels = vram8[(y * m_stride) + (BYTE4_XOR_BE(x))];
*scanline++ = m_palette[pixels];
}
}
break;
case 4: // 24 bpp
- for (y = 0; y < m_yres; y++)
+ for (int y = 0; y < m_yres; y++)
{
- scanline = &bitmap.pix32(y);
- base = (uint32_t *)&m_vram[y * m_stride];
- for (x = 0; x < m_xres; x++)
- {
- *scanline++ = *base++;
- }
+ uint32_t const *base = (uint32_t *)&m_vram[y * m_stride];
+ std::copy_n(base, m_xres, &bitmap.pix(y));
}
break;
}
diff --git a/src/devices/bus/nubus/nubus_cb264.cpp b/src/devices/bus/nubus/nubus_cb264.cpp
index db964ec2055..db1fd821a11 100644
--- a/src/devices/bus/nubus/nubus_cb264.cpp
+++ b/src/devices/bus/nubus/nubus_cb264.cpp
@@ -17,6 +17,9 @@
#include "nubus_cb264.h"
#include "screen.h"
+#include <algorithm>
+
+
#define CB264_SCREEN_NAME "cb264_screen"
#define CB264_ROM_REGION "cb264_rom"
@@ -122,10 +125,6 @@ void nubus_cb264_device::device_reset()
uint32_t nubus_cb264_device::screen_update(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect)
{
- uint32_t *scanline, *base;
- int x, y;
- uint8_t pixels;
-
if (!m_cb264_vbl_disable)
{
raise_slot_irq();
@@ -134,12 +133,12 @@ uint32_t nubus_cb264_device::screen_update(screen_device &screen, bitmap_rgb32 &
switch (m_cb264_mode)
{
case 0: // 1 bpp
- for (y = 0; y < 480; y++)
+ for (int y = 0; y < 480; y++)
{
- scanline = &bitmap.pix32(y);
- for (x = 0; x < 640/8; x++)
+ uint32_t *scanline = &bitmap.pix(y);
+ for (int x = 0; x < 640/8; x++)
{
- pixels = m_vram[(y * 1024) + (BYTE4_XOR_BE(x))];
+ uint8_t const pixels = m_vram[(y * 1024) + (BYTE4_XOR_BE(x))];
*scanline++ = m_palette[pixels&0x80];
*scanline++ = m_palette[(pixels<<1)&0x80];
@@ -154,12 +153,12 @@ uint32_t nubus_cb264_device::screen_update(screen_device &screen, bitmap_rgb32 &
break;
case 1: // 2 bpp (3f/7f/bf/ff)
- for (y = 0; y < 480; y++)
+ for (int y = 0; y < 480; y++)
{
- scanline = &bitmap.pix32(y);
- for (x = 0; x < 640/4; x++)
+ uint32_t *scanline = &bitmap.pix(y);
+ for (int x = 0; x < 640/4; x++)
{
- pixels = m_vram[(y * 1024) + (BYTE4_XOR_BE(x))];
+ uint8_t const pixels = m_vram[(y * 1024) + (BYTE4_XOR_BE(x))];
*scanline++ = m_palette[pixels&0xc0];
*scanline++ = m_palette[(pixels<<2)&0xc0];
@@ -170,13 +169,12 @@ uint32_t nubus_cb264_device::screen_update(screen_device &screen, bitmap_rgb32 &
break;
case 2: // 4 bpp
- for (y = 0; y < 480; y++)
+ for (int y = 0; y < 480; y++)
{
- scanline = &bitmap.pix32(y);
-
- for (x = 0; x < 640/2; x++)
+ uint32_t *scanline = &bitmap.pix(y);
+ for (int x = 0; x < 640/2; x++)
{
- pixels = m_vram[(y * 1024) + (BYTE4_XOR_BE(x))];
+ uint8_t const pixels = m_vram[(y * 1024) + (BYTE4_XOR_BE(x))];
*scanline++ = m_palette[pixels&0xf0];
*scanline++ = m_palette[(pixels<<4)&0xf0];
@@ -185,13 +183,12 @@ uint32_t nubus_cb264_device::screen_update(screen_device &screen, bitmap_rgb32 &
break;
case 3: // 8 bpp
- for (y = 0; y < 480; y++)
+ for (int y = 0; y < 480; y++)
{
- scanline = &bitmap.pix32(y);
-
- for (x = 0; x < 640; x++)
+ uint32_t *scanline = &bitmap.pix(y);
+ for (int x = 0; x < 640; x++)
{
- pixels = m_vram[(y * 1024) + (BYTE4_XOR_BE(x))];
+ uint8_t const pixels = m_vram[(y * 1024) + (BYTE4_XOR_BE(x))];
*scanline++ = m_palette[pixels];
}
}
@@ -200,16 +197,11 @@ uint32_t nubus_cb264_device::screen_update(screen_device &screen, bitmap_rgb32 &
case 4: // 24 bpp
case 7: // ???
{
- uint32_t *vram32 = (uint32_t *)&m_vram[0];
+ uint32_t const *const vram32 = (uint32_t *)&m_vram[0];
- for (y = 0; y < 480; y++)
+ for (int y = 0; y < 480; y++)
{
- scanline = &bitmap.pix32(y);
- base = &vram32[y * 1024];
- for (x = 0; x < 640; x++)
- {
- *scanline++ = *base++;
- }
+ std::copy_n(&vram32[y * 1024], 640, &bitmap.pix(y));
}
}
break;
diff --git a/src/devices/bus/nubus/nubus_m2hires.cpp b/src/devices/bus/nubus/nubus_m2hires.cpp
index 851537685d2..e913c0cb0cb 100644
--- a/src/devices/bus/nubus/nubus_m2hires.cpp
+++ b/src/devices/bus/nubus/nubus_m2hires.cpp
@@ -137,41 +137,37 @@ void nubus_m2hires_device::device_timer(emu_timer &timer, device_timer_id tid, i
uint32_t nubus_m2hires_device::screen_update(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect)
{
- uint32_t *scanline;
- int x, y;
- uint8_t pixels, *vram;
-
- vram = &m_vram[0x20];
+ uint8_t const *const vram = &m_vram[0x20];
switch (m_mode)
{
case 0: // 1 bpp?
- for (y = 0; y < 480; y++)
+ for (int y = 0; y < 480; y++)
{
- scanline = &bitmap.pix32(y);
- for (x = 0; x < 640/8; x++)
+ uint32_t *scanline = &bitmap.pix(y);
+ for (int x = 0; x < 640/8; x++)
{
- pixels = vram[(y * 128) + (BYTE4_XOR_BE(x))];
-
- *scanline++ = m_palette[((pixels>>7)&0x1)];
- *scanline++ = m_palette[((pixels>>6)&0x1)];
- *scanline++ = m_palette[((pixels>>5)&0x1)];
- *scanline++ = m_palette[((pixels>>4)&0x1)];
- *scanline++ = m_palette[((pixels>>3)&0x1)];
- *scanline++ = m_palette[((pixels>>2)&0x1)];
- *scanline++ = m_palette[((pixels>>1)&0x1)];
- *scanline++ = m_palette[(pixels&1)];
+ uint8_t const pixels = vram[(y * 128) + (BYTE4_XOR_BE(x))];
+
+ *scanline++ = m_palette[BIT(pixels, 7)];
+ *scanline++ = m_palette[BIT(pixels, 6)];
+ *scanline++ = m_palette[BIT(pixels, 5)];
+ *scanline++ = m_palette[BIT(pixels, 4)];
+ *scanline++ = m_palette[BIT(pixels, 3)];
+ *scanline++ = m_palette[BIT(pixels, 2)];
+ *scanline++ = m_palette[BIT(pixels, 1)];
+ *scanline++ = m_palette[BIT(pixels, 0)];
}
}
break;
case 1: // 2 bpp
- for (y = 0; y < 480; y++)
+ for (int y = 0; y < 480; y++)
{
- scanline = &bitmap.pix32(y);
- for (x = 0; x < 640/4; x++)
+ uint32_t *scanline = &bitmap.pix(y);
+ for (int x = 0; x < 640/4; x++)
{
- pixels = vram[(y * 256) + (BYTE4_XOR_BE(x))];
+ uint8_t const pixels = vram[(y * 256) + (BYTE4_XOR_BE(x))];
*scanline++ = m_palette[((pixels>>6)&3)];
*scanline++ = m_palette[((pixels>>4)&3)];
@@ -182,13 +178,13 @@ uint32_t nubus_m2hires_device::screen_update(screen_device &screen, bitmap_rgb32
break;
case 2: // 4 bpp
- for (y = 0; y < 480; y++)
+ for (int y = 0; y < 480; y++)
{
- scanline = &bitmap.pix32(y);
+ uint32_t *scanline = &bitmap.pix(y);
- for (x = 0; x < 640/2; x++)
+ for (int x = 0; x < 640/2; x++)
{
- pixels = vram[(y * 512) + (BYTE4_XOR_BE(x))];
+ uint8_t const pixels = vram[(y * 512) + (BYTE4_XOR_BE(x))];
*scanline++ = m_palette[((pixels&0xf0)>>4)];
*scanline++ = m_palette[(pixels&0xf)];
@@ -197,13 +193,13 @@ uint32_t nubus_m2hires_device::screen_update(screen_device &screen, bitmap_rgb32
break;
case 3: // 8 bpp
- for (y = 0; y < 480; y++)
+ for (int y = 0; y < 480; y++)
{
- scanline = &bitmap.pix32(y);
+ uint32_t *scanline = &bitmap.pix(y);
- for (x = 0; x < 640; x++)
+ for (int x = 0; x < 640; x++)
{
- pixels = vram[(y * 1024) + (BYTE4_XOR_BE(x))];
+ uint8_t const pixels = vram[(y * 1024) + (BYTE4_XOR_BE(x))];
*scanline++ = m_palette[pixels];
}
}
diff --git a/src/devices/bus/nubus/nubus_m2video.cpp b/src/devices/bus/nubus/nubus_m2video.cpp
index f557d7631b0..60728d7dd15 100644
--- a/src/devices/bus/nubus/nubus_m2video.cpp
+++ b/src/devices/bus/nubus/nubus_m2video.cpp
@@ -139,21 +139,17 @@ void nubus_m2video_device::device_timer(emu_timer &timer, device_timer_id tid, i
uint32_t nubus_m2video_device::screen_update(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect)
{
- uint32_t *scanline;
- int x, y;
- uint8_t pixels, *vram;
-
- vram = &m_vram[0x20];
+ uint8_t const *const vram = &m_vram[0x20];
switch (m_mode)
{
case 0: // 1 bpp?
- for (y = 0; y < 480; y++)
+ for (int y = 0; y < 480; y++)
{
- scanline = &bitmap.pix32(y);
- for (x = 0; x < 640/8; x++)
+ uint32_t *scanline = &bitmap.pix(y);
+ for (int x = 0; x < 640/8; x++)
{
- pixels = vram[(y * 128) + (BYTE4_XOR_BE(x))];
+ uint8_t const pixels = vram[(y * 128) + (BYTE4_XOR_BE(x))];
*scanline++ = m_palette[(pixels&0x80)];
*scanline++ = m_palette[((pixels<<1)&0x80)];
@@ -168,12 +164,12 @@ uint32_t nubus_m2video_device::screen_update(screen_device &screen, bitmap_rgb32
break;
case 1: // 2 bpp
- for (y = 0; y < 480; y++)
+ for (int y = 0; y < 480; y++)
{
- scanline = &bitmap.pix32(y);
- for (x = 0; x < 640/4; x++)
+ uint32_t *scanline = &bitmap.pix(y);
+ for (int x = 0; x < 640/4; x++)
{
- pixels = vram[(y * 256) + (BYTE4_XOR_BE(x))];
+ uint8_t const pixels = vram[(y * 256) + (BYTE4_XOR_BE(x))];
*scanline++ = m_palette[(pixels&0xc0)];
*scanline++ = m_palette[((pixels<<2)&0xc0)];
@@ -184,13 +180,12 @@ uint32_t nubus_m2video_device::screen_update(screen_device &screen, bitmap_rgb32
break;
case 2: // 4 bpp
- for (y = 0; y < 480; y++)
+ for (int y = 0; y < 480; y++)
{
- scanline = &bitmap.pix32(y);
-
- for (x = 0; x < 640/2; x++)
+ uint32_t *scanline = &bitmap.pix(y);
+ for (int x = 0; x < 640/2; x++)
{
- pixels = vram[(y * 512) + (BYTE4_XOR_BE(x))];
+ uint8_t const pixels = vram[(y * 512) + (BYTE4_XOR_BE(x))];
*scanline++ = m_palette[(pixels&0xf0)];
*scanline++ = m_palette[((pixels&0x0f)<<4)];
@@ -199,13 +194,12 @@ uint32_t nubus_m2video_device::screen_update(screen_device &screen, bitmap_rgb32
break;
case 3: // 8 bpp
- for (y = 0; y < 480; y++)
+ for (int y = 0; y < 480; y++)
{
- scanline = &bitmap.pix32(y);
-
- for (x = 0; x < 640; x++)
+ uint32_t *scanline = &bitmap.pix(y);
+ for (int x = 0; x < 640; x++)
{
- pixels = vram[(y * 1024) + (BYTE4_XOR_BE(x))];
+ uint8_t const pixels = vram[(y * 1024) + (BYTE4_XOR_BE(x))];
*scanline++ = m_palette[pixels];
}
}
diff --git a/src/devices/bus/nubus/nubus_radiustpd.cpp b/src/devices/bus/nubus/nubus_radiustpd.cpp
index f6d152be059..89518f0d223 100644
--- a/src/devices/bus/nubus/nubus_radiustpd.cpp
+++ b/src/devices/bus/nubus/nubus_radiustpd.cpp
@@ -139,27 +139,23 @@ void nubus_radiustpd_device::device_timer(emu_timer &timer, device_timer_id tid,
uint32_t nubus_radiustpd_device::screen_update(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect)
{
- uint32_t *scanline;
- int x, y;
- uint8_t pixels, *vram;
+ uint8_t const *const vram = &m_vram[0x200];
- vram = &m_vram[0x200];
-
- for (y = 0; y < 880; y++)
+ for (int y = 0; y < 880; y++)
{
- scanline = &bitmap.pix32(y);
- for (x = 0; x < 1152/8; x++)
+ uint32_t *scanline = &bitmap.pix(y);
+ for (int x = 0; x < 1152/8; x++)
{
- pixels = vram[(y * (1152/8)) + (BYTE4_XOR_BE(x))];
-
- *scanline++ = m_palette[((pixels>>7)&0x1)];
- *scanline++ = m_palette[((pixels>>6)&0x1)];
- *scanline++ = m_palette[((pixels>>5)&0x1)];
- *scanline++ = m_palette[((pixels>>4)&0x1)];
- *scanline++ = m_palette[((pixels>>3)&0x1)];
- *scanline++ = m_palette[((pixels>>2)&0x1)];
- *scanline++ = m_palette[((pixels>>1)&0x1)];
- *scanline++ = m_palette[(pixels&1)];
+ uint8_t const pixels = vram[(y * (1152/8)) + (BYTE4_XOR_BE(x))];
+
+ *scanline++ = m_palette[BIT(pixels, 7)];
+ *scanline++ = m_palette[BIT(pixels, 6)];
+ *scanline++ = m_palette[BIT(pixels, 5)];
+ *scanline++ = m_palette[BIT(pixels, 4)];
+ *scanline++ = m_palette[BIT(pixels, 3)];
+ *scanline++ = m_palette[BIT(pixels, 2)];
+ *scanline++ = m_palette[BIT(pixels, 1)];
+ *scanline++ = m_palette[BIT(pixels, 0)];
}
}
diff --git a/src/devices/bus/nubus/nubus_spec8.cpp b/src/devices/bus/nubus/nubus_spec8.cpp
index b7a29b6f537..6ca1f9f4489 100644
--- a/src/devices/bus/nubus/nubus_spec8.cpp
+++ b/src/devices/bus/nubus/nubus_spec8.cpp
@@ -144,21 +144,17 @@ void nubus_spec8s3_device::device_timer(emu_timer &timer, device_timer_id tid, i
uint32_t nubus_spec8s3_device::screen_update(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect)
{
- uint32_t *scanline;
- int x, y;
- uint8_t pixels, *vram;
-
- vram = &m_vram[0x400];
+ uint8_t const *const vram = &m_vram[0x400];
switch (m_mode)
{
case 0: // 1 bpp
- for (y = 0; y < 768; y++)
+ for (int y = 0; y < 768; y++)
{
- scanline = &bitmap.pix32(y);
- for (x = 0; x < 1024/8; x++)
+ uint32_t *scanline = &bitmap.pix(y);
+ for (int x = 0; x < 1024/8; x++)
{
- pixels = vram[(y * 512) + (BYTE4_XOR_BE(x))];
+ uint8_t const pixels = vram[(y * 512) + (BYTE4_XOR_BE(x))];
*scanline++ = m_palette[pixels&0x80];
*scanline++ = m_palette[(pixels<<1)&0x80];
@@ -173,12 +169,12 @@ uint32_t nubus_spec8s3_device::screen_update(screen_device &screen, bitmap_rgb32
break;
case 1: // 2 bpp
- for (y = 0; y < 768; y++)
+ for (int y = 0; y < 768; y++)
{
- scanline = &bitmap.pix32(y);
- for (x = 0; x < 1024/4; x++)
+ uint32_t *scanline = &bitmap.pix(y);
+ for (int x = 0; x < 1024/4; x++)
{
- pixels = vram[(y * 512) + (BYTE4_XOR_BE(x))];
+ uint8_t const pixels = vram[(y * 512) + (BYTE4_XOR_BE(x))];
*scanline++ = m_palette[pixels&0xc0];
*scanline++ = m_palette[(pixels<<2)&0xc0];
@@ -189,13 +185,12 @@ uint32_t nubus_spec8s3_device::screen_update(screen_device &screen, bitmap_rgb32
break;
case 2: // 4 bpp
- for (y = 0; y < 768; y++)
+ for (int y = 0; y < 768; y++)
{
- scanline = &bitmap.pix32(y);
-
- for (x = 0; x < 1024/2; x++)
+ uint32_t *scanline = &bitmap.pix(y);
+ for (int x = 0; x < 1024/2; x++)
{
- pixels = vram[(y * 512) + (BYTE4_XOR_BE(x))];
+ uint8_t const pixels = vram[(y * 512) + (BYTE4_XOR_BE(x))];
*scanline++ = m_palette[pixels&0xf0];
*scanline++ = m_palette[(pixels<<4)&0xf0];
@@ -204,13 +199,12 @@ uint32_t nubus_spec8s3_device::screen_update(screen_device &screen, bitmap_rgb32
break;
case 3: // 8 bpp
- for (y = 0; y < 768; y++)
+ for (int y = 0; y < 768; y++)
{
- scanline = &bitmap.pix32(y);
-
- for (x = 0; x < 1024; x++)
+ uint32_t *scanline = &bitmap.pix(y);
+ for (int x = 0; x < 1024; x++)
{
- pixels = vram[(y * 1024) + (BYTE4_XOR_BE(x))];
+ uint8_t const pixels = vram[(y * 1024) + (BYTE4_XOR_BE(x))];
*scanline++ = m_palette[pixels];
}
}
diff --git a/src/devices/bus/nubus/nubus_specpdq.cpp b/src/devices/bus/nubus/nubus_specpdq.cpp
index 891defaa336..c00938c6102 100644
--- a/src/devices/bus/nubus/nubus_specpdq.cpp
+++ b/src/devices/bus/nubus/nubus_specpdq.cpp
@@ -157,22 +157,18 @@ void nubus_specpdq_device::device_timer(emu_timer &timer, device_timer_id tid, i
uint32_t nubus_specpdq_device::screen_update(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect)
{
- uint32_t *scanline;
- int x, y;
- uint8_t pixels, *vram;
-
// first time? kick off the VBL timer
- vram = &m_vram[0x9000];
+ uint8_t const *const vram = &m_vram[0x9000];
switch (m_mode)
{
case 0: // 1 bpp
- for (y = 0; y < 844; y++)
+ for (int y = 0; y < 844; y++)
{
- scanline = &bitmap.pix32(y);
- for (x = 0; x < 1152/8; x++)
+ uint32_t *scanline = &bitmap.pix(y);
+ for (int x = 0; x < 1152/8; x++)
{
- pixels = vram[(y * 512) + (BYTE4_XOR_BE(x))];
+ uint8_t const pixels = vram[(y * 512) + (BYTE4_XOR_BE(x))];
*scanline++ = m_palette_val[(pixels&0x80)];
*scanline++ = m_palette_val[((pixels<<1)&0x80)];
@@ -187,12 +183,12 @@ uint32_t nubus_specpdq_device::screen_update(screen_device &screen, bitmap_rgb32
break;
case 1: // 2 bpp
- for (y = 0; y < 844; y++)
+ for (int y = 0; y < 844; y++)
{
- scanline = &bitmap.pix32(y);
- for (x = 0; x < 1152/4; x++)
+ uint32_t *scanline = &bitmap.pix(y);
+ for (int x = 0; x < 1152/4; x++)
{
- pixels = vram[(y * 512) + (BYTE4_XOR_BE(x))];
+ uint8_t const pixels = vram[(y * 512) + (BYTE4_XOR_BE(x))];
*scanline++ = m_palette_val[(pixels&0xc0)];
*scanline++ = m_palette_val[((pixels<<2)&0xc0)];
@@ -203,13 +199,12 @@ uint32_t nubus_specpdq_device::screen_update(screen_device &screen, bitmap_rgb32
break;
case 2: // 4 bpp
- for (y = 0; y < 844; y++)
+ for (int y = 0; y < 844; y++)
{
- scanline = &bitmap.pix32(y);
-
- for (x = 0; x < 1152/2; x++)
+ uint32_t *scanline = &bitmap.pix(y);
+ for (int x = 0; x < 1152/2; x++)
{
- pixels = vram[(y * 1024) + (BYTE4_XOR_BE(x))];
+ uint8_t const pixels = vram[(y * 1024) + (BYTE4_XOR_BE(x))];
*scanline++ = m_palette_val[(pixels&0xf0)];
*scanline++ = m_palette_val[((pixels<<4)&0xf0)];
@@ -218,13 +213,12 @@ uint32_t nubus_specpdq_device::screen_update(screen_device &screen, bitmap_rgb32
break;
case 3: // 8 bpp
- for (y = 0; y < 844; y++)
+ for (int y = 0; y < 844; y++)
{
- scanline = &bitmap.pix32(y);
-
- for (x = 0; x < 1152; x++)
+ uint32_t *scanline = &bitmap.pix(y);
+ for (int x = 0; x < 1152; x++)
{
- pixels = vram[(y * 1152) + (BYTE4_XOR_BE(x))];
+ uint8_t const pixels = vram[(y * 1152) + (BYTE4_XOR_BE(x))];
*scanline++ = m_palette_val[pixels];
}
}
diff --git a/src/devices/bus/nubus/nubus_vikbw.cpp b/src/devices/bus/nubus/nubus_vikbw.cpp
index 1c25795cd45..18c94f9ba5b 100644
--- a/src/devices/bus/nubus/nubus_vikbw.cpp
+++ b/src/devices/bus/nubus/nubus_vikbw.cpp
@@ -117,30 +117,26 @@ void nubus_vikbw_device::device_reset()
uint32_t nubus_vikbw_device::screen_update(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect)
{
- uint32_t *scanline;
- int x, y;
- uint8_t pixels;
-
if (!m_vbl_disable)
{
raise_slot_irq();
}
- for (y = 0; y < 768; y++)
+ for (int y = 0; y < 768; y++)
{
- scanline = &bitmap.pix32(y);
- for (x = 0; x < 1024/8; x++)
+ uint32_t *scanline = &bitmap.pix(y);
+ for (int x = 0; x < 1024/8; x++)
{
- pixels = m_vram[(y * 128) + (BYTE4_XOR_BE(x))];
-
- *scanline++ = m_palette[(pixels>>7)&1];
- *scanline++ = m_palette[(pixels>>6)&1];
- *scanline++ = m_palette[(pixels>>5)&1];
- *scanline++ = m_palette[(pixels>>4)&1];
- *scanline++ = m_palette[(pixels>>3)&1];
- *scanline++ = m_palette[(pixels>>2)&1];
- *scanline++ = m_palette[(pixels>>1)&1];
- *scanline++ = m_palette[(pixels&1)];
+ uint8_t const pixels = m_vram[(y * 128) + (BYTE4_XOR_BE(x))];
+
+ *scanline++ = m_palette[BIT(pixels, 7)];
+ *scanline++ = m_palette[BIT(pixels, 6)];
+ *scanline++ = m_palette[BIT(pixels, 5)];
+ *scanline++ = m_palette[BIT(pixels, 4)];
+ *scanline++ = m_palette[BIT(pixels, 3)];
+ *scanline++ = m_palette[BIT(pixels, 2)];
+ *scanline++ = m_palette[BIT(pixels, 1)];
+ *scanline++ = m_palette[BIT(pixels, 0)];
}
}
diff --git a/src/devices/bus/nubus/nubus_wsportrait.cpp b/src/devices/bus/nubus/nubus_wsportrait.cpp
index 2f56488bf48..9894e0d7906 100644
--- a/src/devices/bus/nubus/nubus_wsportrait.cpp
+++ b/src/devices/bus/nubus/nubus_wsportrait.cpp
@@ -137,42 +137,38 @@ void nubus_wsportrait_device::device_timer(emu_timer &timer, device_timer_id tid
uint32_t nubus_wsportrait_device::screen_update(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect)
{
- uint32_t *scanline;
- int x, y;
- uint8_t pixels, *vram;
-
// first time? kick off the VBL timer
- vram = &m_vram[0x80];
+ uint8_t const *const vram = &m_vram[0x80];
switch (m_mode)
{
case 0: // 1 bpp?
- for (y = 0; y < 870; y++)
+ for (int y = 0; y < 870; y++)
{
- scanline = &bitmap.pix32(y);
- for (x = 0; x < 640/8; x++)
+ uint32_t *scanline = &bitmap.pix(y);
+ for (int x = 0; x < 640/8; x++)
{
- pixels = vram[(y * 128) + (BYTE4_XOR_BE(x))];
-
- *scanline++ = m_palette[((pixels>>7)&0x1)];
- *scanline++ = m_palette[((pixels>>6)&0x1)];
- *scanline++ = m_palette[((pixels>>5)&0x1)];
- *scanline++ = m_palette[((pixels>>4)&0x1)];
- *scanline++ = m_palette[((pixels>>3)&0x1)];
- *scanline++ = m_palette[((pixels>>2)&0x1)];
- *scanline++ = m_palette[((pixels>>1)&0x1)];
- *scanline++ = m_palette[(pixels&1)];
+ uint8_t const pixels = vram[(y * 128) + (BYTE4_XOR_BE(x))];
+
+ *scanline++ = m_palette[BIT(pixels, 7)];
+ *scanline++ = m_palette[BIT(pixels, 6)];
+ *scanline++ = m_palette[BIT(pixels, 5)];
+ *scanline++ = m_palette[BIT(pixels, 4)];
+ *scanline++ = m_palette[BIT(pixels, 3)];
+ *scanline++ = m_palette[BIT(pixels, 2)];
+ *scanline++ = m_palette[BIT(pixels, 1)];
+ *scanline++ = m_palette[BIT(pixels, 0)];
}
}
break;
case 1: // 2 bpp
- for (y = 0; y < 480; y++)
+ for (int y = 0; y < 480; y++)
{
- scanline = &bitmap.pix32(y);
- for (x = 0; x < 640/4; x++)
+ uint32_t *scanline = &bitmap.pix(y);
+ for (int x = 0; x < 640/4; x++)
{
- pixels = vram[(y * 256) + (BYTE4_XOR_BE(x))];
+ uint8_t const pixels = vram[(y * 256) + (BYTE4_XOR_BE(x))];
*scanline++ = m_palette[((pixels>>6)&3)];
*scanline++ = m_palette[((pixels>>4)&3)];
@@ -183,13 +179,12 @@ uint32_t nubus_wsportrait_device::screen_update(screen_device &screen, bitmap_rg
break;
case 2: // 4 bpp
- for (y = 0; y < 480; y++)
+ for (int y = 0; y < 480; y++)
{
- scanline = &bitmap.pix32(y);
-
- for (x = 0; x < 640/2; x++)
+ uint32_t *scanline = &bitmap.pix(y);
+ for (int x = 0; x < 640/2; x++)
{
- pixels = vram[(y * 512) + (BYTE4_XOR_BE(x))];
+ uint8_t const pixels = vram[(y * 512) + (BYTE4_XOR_BE(x))];
*scanline++ = m_palette[((pixels&0xf0)>>4)];
*scanline++ = m_palette[(pixels&0xf)];
diff --git a/src/devices/bus/nubus/pds30_30hr.cpp b/src/devices/bus/nubus/pds30_30hr.cpp
index 2fe4687fc44..dde2348abc6 100644
--- a/src/devices/bus/nubus/pds30_30hr.cpp
+++ b/src/devices/bus/nubus/pds30_30hr.cpp
@@ -139,41 +139,37 @@ void nubus_xceed30hr_device::device_timer(emu_timer &timer, device_timer_id tid,
uint32_t nubus_xceed30hr_device::screen_update(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect)
{
- uint32_t *scanline;
- int x, y;
- uint8_t pixels, *vram;
-
- vram = &m_vram[1024];
+ uint8_t const *const vram = &m_vram[1024];
switch (m_mode)
{
case 0: // 1 bpp?
- for (y = 0; y < 480; y++)
+ for (int y = 0; y < 480; y++)
{
- scanline = &bitmap.pix32(y);
- for (x = 0; x < 640/8; x++)
+ uint32_t *scanline = &bitmap.pix(y);
+ for (int x = 0; x < 640/8; x++)
{
- pixels = vram[(y * 1024) + (BYTE4_XOR_BE(x))];
-
- *scanline++ = m_palette[(pixels>>7)&1];
- *scanline++ = m_palette[(pixels>>6)&1];
- *scanline++ = m_palette[(pixels>>5)&1];
- *scanline++ = m_palette[(pixels>>4)&1];
- *scanline++ = m_palette[(pixels>>3)&1];
- *scanline++ = m_palette[(pixels>>2)&1];
- *scanline++ = m_palette[(pixels>>1)&1];
- *scanline++ = m_palette[pixels&1];
+ uint8_t const pixels = vram[(y * 1024) + (BYTE4_XOR_BE(x))];
+
+ *scanline++ = m_palette[BIT(pixels, 7)];
+ *scanline++ = m_palette[BIT(pixels, 6)];
+ *scanline++ = m_palette[BIT(pixels, 5)];
+ *scanline++ = m_palette[BIT(pixels, 4)];
+ *scanline++ = m_palette[BIT(pixels, 3)];
+ *scanline++ = m_palette[BIT(pixels, 2)];
+ *scanline++ = m_palette[BIT(pixels, 1)];
+ *scanline++ = m_palette[BIT(pixels, 0)];
}
}
break;
case 1: // 2 bpp
- for (y = 0; y < 480; y++)
+ for (int y = 0; y < 480; y++)
{
- scanline = &bitmap.pix32(y);
- for (x = 0; x < 640/4; x++)
+ uint32_t *scanline = &bitmap.pix(y);
+ for (int x = 0; x < 640/4; x++)
{
- pixels = vram[(y * 1024) + (BYTE4_XOR_BE(x))];
+ uint8_t const pixels = vram[(y * 1024) + (BYTE4_XOR_BE(x))];
*scanline++ = m_palette[((pixels>>6)&3)];
*scanline++ = m_palette[((pixels>>4)&3)];
@@ -184,13 +180,12 @@ uint32_t nubus_xceed30hr_device::screen_update(screen_device &screen, bitmap_rgb
break;
case 2: // 4 bpp
- for (y = 0; y < 480; y++)
+ for (int y = 0; y < 480; y++)
{
- scanline = &bitmap.pix32(y);
-
- for (x = 0; x < 640/2; x++)
+ uint32_t *scanline = &bitmap.pix(y);
+ for (int x = 0; x < 640/2; x++)
{
- pixels = vram[(y * 1024) + (BYTE4_XOR_BE(x))];
+ uint8_t const pixels = vram[(y * 1024) + (BYTE4_XOR_BE(x))];
*scanline++ = m_palette[(pixels>>4)];
*scanline++ = m_palette[(pixels&0xf)];
@@ -199,13 +194,12 @@ uint32_t nubus_xceed30hr_device::screen_update(screen_device &screen, bitmap_rgb
break;
case 3: // 8 bpp
- for (y = 0; y < 480; y++)
+ for (int y = 0; y < 480; y++)
{
- scanline = &bitmap.pix32(y);
-
- for (x = 0; x < 640; x++)
+ uint32_t *scanline = &bitmap.pix(y);
+ for (int x = 0; x < 640; x++)
{
- pixels = vram[(y * 1024) + (BYTE4_XOR_BE(x))];
+ uint8_t const pixels = vram[(y * 1024) + (BYTE4_XOR_BE(x))];
*scanline++ = m_palette[pixels];
}
}
diff --git a/src/devices/bus/nubus/pds30_cb264.cpp b/src/devices/bus/nubus/pds30_cb264.cpp
index aa0ca1df648..388aa5f54d5 100644
--- a/src/devices/bus/nubus/pds30_cb264.cpp
+++ b/src/devices/bus/nubus/pds30_cb264.cpp
@@ -10,6 +10,9 @@
#include "pds30_cb264.h"
#include "screen.h"
+#include <algorithm>
+
+
#define CB264SE30_SCREEN_NAME "cb264_screen"
#define CB264SE30_ROM_REGION "cb264_rom"
@@ -133,21 +136,17 @@ void nubus_cb264se30_device::device_timer(emu_timer &timer, device_timer_id tid,
uint32_t nubus_cb264se30_device::screen_update(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect)
{
- uint32_t *scanline;
- int x, y;
- uint8_t pixels, *vram;
-
- vram = &m_vram[8*1024];
+ uint8_t const *const vram = &m_vram[8*1024];
switch (m_mode)
{
case 0: // 1 bpp?
- for (y = 0; y < 480; y++)
+ for (int y = 0; y < 480; y++)
{
- scanline = &bitmap.pix32(y);
- for (x = 0; x < 640/8; x++)
+ uint32_t *scanline = &bitmap.pix(y);
+ for (int x = 0; x < 640/8; x++)
{
- pixels = vram[(y * 1024) + (BYTE4_XOR_BE(x))];
+ uint8_t const pixels = vram[(y * 1024) + (BYTE4_XOR_BE(x))];
*scanline++ = m_palette[(pixels&0x80)];
*scanline++ = m_palette[((pixels<<1)&0x80)];
@@ -162,12 +161,12 @@ uint32_t nubus_cb264se30_device::screen_update(screen_device &screen, bitmap_rgb
break;
case 1: // 2 bpp
- for (y = 0; y < 480; y++)
+ for (int y = 0; y < 480; y++)
{
- scanline = &bitmap.pix32(y);
- for (x = 0; x < 640/4; x++)
+ uint32_t *scanline = &bitmap.pix(y);
+ for (int x = 0; x < 640/4; x++)
{
- pixels = vram[(y * 1024) + (BYTE4_XOR_BE(x))];
+ uint8_t const pixels = vram[(y * 1024) + (BYTE4_XOR_BE(x))];
*scanline++ = m_palette[(pixels&0xc0)];
*scanline++ = m_palette[((pixels<<2)&0xc0)];
@@ -178,13 +177,12 @@ uint32_t nubus_cb264se30_device::screen_update(screen_device &screen, bitmap_rgb
break;
case 2: // 4 bpp
- for (y = 0; y < 480; y++)
+ for (int y = 0; y < 480; y++)
{
- scanline = &bitmap.pix32(y);
-
- for (x = 0; x < 640/2; x++)
+ uint32_t *scanline = &bitmap.pix(y);
+ for (int x = 0; x < 640/2; x++)
{
- pixels = vram[(y * 1024) + (BYTE4_XOR_BE(x))];
+ uint8_t const pixels = vram[(y * 1024) + (BYTE4_XOR_BE(x))];
*scanline++ = m_palette[(pixels&0xf0)];
*scanline++ = m_palette[((pixels&0x0f)<<4)];
@@ -193,13 +191,12 @@ uint32_t nubus_cb264se30_device::screen_update(screen_device &screen, bitmap_rgb
break;
case 3: // 8 bpp
- for (y = 0; y < 480; y++)
+ for (int y = 0; y < 480; y++)
{
- scanline = &bitmap.pix32(y);
-
- for (x = 0; x < 640; x++)
+ uint32_t *scanline = &bitmap.pix(y);
+ for (int x = 0; x < 640; x++)
{
- pixels = vram[(y * 1024) + (BYTE4_XOR_BE(x))];
+ uint8_t const pixels = vram[(y * 1024) + (BYTE4_XOR_BE(x))];
*scanline++ = m_palette[pixels];
}
}
@@ -207,17 +204,11 @@ uint32_t nubus_cb264se30_device::screen_update(screen_device &screen, bitmap_rgb
case 4: // 24 bpp
{
- uint32_t *vram32 = (uint32_t *)&m_vram[0];
- uint32_t *base;
+ uint32_t const *const vram32 = (uint32_t *)&m_vram[0];
- for (y = 0; y < 480; y++)
+ for (int y = 0; y < 480; y++)
{
- scanline = &bitmap.pix32(y);
- base = &vram32[y * 1024];
- for (x = 0; x < 640; x++)
- {
- *scanline++ = *base++;
- }
+ std::copy_n(&vram32[y * 1024], 640, &bitmap.pix(y));
}
}
break;
diff --git a/src/devices/bus/nubus/pds30_mc30.cpp b/src/devices/bus/nubus/pds30_mc30.cpp
index 20969a5a6b7..87992723319 100644
--- a/src/devices/bus/nubus/pds30_mc30.cpp
+++ b/src/devices/bus/nubus/pds30_mc30.cpp
@@ -13,6 +13,9 @@
#include "pds30_mc30.h"
#include "screen.h"
+#include <algorithm>
+
+
#define XCEEDMC30_SCREEN_NAME "x30hr_screen"
#define XCEEDMC30_ROM_REGION "x30hr_rom"
@@ -135,41 +138,37 @@ void nubus_xceedmc30_device::device_timer(emu_timer &timer, device_timer_id tid,
uint32_t nubus_xceedmc30_device::screen_update(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect)
{
- uint32_t *scanline;
- int x, y;
- uint8_t pixels, *vram;
-
- vram = &m_vram[4*1024];
+ uint8_t const *const vram = &m_vram[4*1024];
switch (m_mode)
{
case 0: // 1 bpp?
- for (y = 0; y < 480; y++)
+ for (int y = 0; y < 480; y++)
{
- scanline = &bitmap.pix32(y);
- for (x = 0; x < 640/8; x++)
+ uint32_t *scanline = &bitmap.pix(y);
+ for (int x = 0; x < 640/8; x++)
{
- pixels = vram[(y * 1024) + (BYTE4_XOR_BE(x))];
-
- *scanline++ = m_palette[(pixels>>7)&1];
- *scanline++ = m_palette[(pixels>>6)&1];
- *scanline++ = m_palette[(pixels>>5)&1];
- *scanline++ = m_palette[(pixels>>4)&1];
- *scanline++ = m_palette[(pixels>>3)&1];
- *scanline++ = m_palette[(pixels>>2)&1];
- *scanline++ = m_palette[(pixels>>1)&1];
- *scanline++ = m_palette[pixels&1];
+ uint8_t const pixels = vram[(y * 1024) + (BYTE4_XOR_BE(x))];
+
+ *scanline++ = m_palette[BIT(pixels, 7)];
+ *scanline++ = m_palette[BIT(pixels, 6)];
+ *scanline++ = m_palette[BIT(pixels, 5)];
+ *scanline++ = m_palette[BIT(pixels, 4)];
+ *scanline++ = m_palette[BIT(pixels, 3)];
+ *scanline++ = m_palette[BIT(pixels, 2)];
+ *scanline++ = m_palette[BIT(pixels, 1)];
+ *scanline++ = m_palette[BIT(pixels, 0)];
}
}
break;
case 1: // 2 bpp
- for (y = 0; y < 480; y++)
+ for (int y = 0; y < 480; y++)
{
- scanline = &bitmap.pix32(y);
- for (x = 0; x < 640/4; x++)
+ uint32_t *scanline = &bitmap.pix(y);
+ for (int x = 0; x < 640/4; x++)
{
- pixels = vram[(y * 1024) + (BYTE4_XOR_BE(x))];
+ uint8_t const pixels = vram[(y * 1024) + (BYTE4_XOR_BE(x))];
*scanline++ = m_palette[((pixels>>6)&3)];
*scanline++ = m_palette[((pixels>>4)&3)];
@@ -180,13 +179,13 @@ uint32_t nubus_xceedmc30_device::screen_update(screen_device &screen, bitmap_rgb
break;
case 2: // 4 bpp
- for (y = 0; y < 480; y++)
+ for (int y = 0; y < 480; y++)
{
- scanline = &bitmap.pix32(y);
+ uint32_t *scanline = &bitmap.pix(y);
- for (x = 0; x < 640/2; x++)
+ for (int x = 0; x < 640/2; x++)
{
- pixels = vram[(y * 1024) + (BYTE4_XOR_BE(x))];
+ uint8_t const pixels = vram[(y * 1024) + (BYTE4_XOR_BE(x))];
*scanline++ = m_palette[(pixels>>4)];
*scanline++ = m_palette[(pixels&0xf)];
@@ -195,13 +194,13 @@ uint32_t nubus_xceedmc30_device::screen_update(screen_device &screen, bitmap_rgb
break;
case 3: // 8 bpp
- for (y = 0; y < 480; y++)
+ for (int y = 0; y < 480; y++)
{
- scanline = &bitmap.pix32(y);
+ uint32_t *scanline = &bitmap.pix(y);
- for (x = 0; x < 640; x++)
+ for (int x = 0; x < 640; x++)
{
- pixels = vram[(y * 1024) + (BYTE4_XOR_BE(x))];
+ uint8_t const pixels = vram[(y * 1024) + (BYTE4_XOR_BE(x))];
*scanline++ = m_palette[pixels];
}
}
@@ -209,17 +208,11 @@ uint32_t nubus_xceedmc30_device::screen_update(screen_device &screen, bitmap_rgb
case 4: // 24 bpp
{
- uint32_t *vram32 = (uint32_t *)vram;
- uint32_t *base;
+ uint32_t const *const vram32 = (uint32_t *)vram;
- for (y = 0; y < 480; y++)
+ for (int y = 0; y < 480; y++)
{
- scanline = &bitmap.pix32(y);
- base = &vram32[y * 1024];
- for (x = 0; x < 640; x++)
- {
- *scanline++ = *base++;
- }
+ std::copy_n(&vram32[y * 1024], 640, &bitmap.pix(y));
}
}
break;
diff --git a/src/devices/bus/nubus/pds30_procolor816.cpp b/src/devices/bus/nubus/pds30_procolor816.cpp
index b251a57c33c..83fd8512704 100644
--- a/src/devices/bus/nubus/pds30_procolor816.cpp
+++ b/src/devices/bus/nubus/pds30_procolor816.cpp
@@ -139,21 +139,17 @@ void nubus_procolor816_device::device_timer(emu_timer &timer, device_timer_id ti
uint32_t nubus_procolor816_device::screen_update(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect)
{
- uint32_t *scanline;
- int x, y;
- uint8_t pixels, *vram;
-
- vram = &m_vram[4];
+ uint8_t const *const vram = &m_vram[4];
switch (m_mode)
{
case 0: // 1 bpp?
- for (y = 0; y < 480; y++)
+ for (int y = 0; y < 480; y++)
{
- scanline = &bitmap.pix32(y);
- for (x = 0; x < 640/8; x++)
+ uint32_t *scanline = &bitmap.pix(y);
+ for (int x = 0; x < 640/8; x++)
{
- pixels = vram[(y * 640/8) + (BYTE4_XOR_BE(x))];
+ uint8_t const pixels = vram[(y * 640/8) + (BYTE4_XOR_BE(x))];
*scanline++ = m_palette[(pixels&0x80)];
*scanline++ = m_palette[((pixels<<1)&0x80)];
@@ -168,12 +164,12 @@ uint32_t nubus_procolor816_device::screen_update(screen_device &screen, bitmap_r
break;
case 1: // 2 bpp
- for (y = 0; y < 480; y++)
+ for (int y = 0; y < 480; y++)
{
- scanline = &bitmap.pix32(y);
- for (x = 0; x < 640/4; x++)
+ uint32_t *scanline = &bitmap.pix(y);
+ for (int x = 0; x < 640/4; x++)
{
- pixels = vram[(y * 640/4) + (BYTE4_XOR_BE(x))];
+ uint8_t const pixels = vram[(y * 640/4) + (BYTE4_XOR_BE(x))];
*scanline++ = m_palette[(pixels&0xc0)];
*scanline++ = m_palette[((pixels<<2)&0xc0)];
@@ -184,13 +180,12 @@ uint32_t nubus_procolor816_device::screen_update(screen_device &screen, bitmap_r
break;
case 2: // 4 bpp
- for (y = 0; y < 480; y++)
+ for (int y = 0; y < 480; y++)
{
- scanline = &bitmap.pix32(y);
-
- for (x = 0; x < 640/2; x++)
+ uint32_t *scanline = &bitmap.pix(y);
+ for (int x = 0; x < 640/2; x++)
{
- pixels = vram[(y * 640/2) + (BYTE4_XOR_BE(x))];
+ uint8_t const pixels = vram[(y * 640/2) + (BYTE4_XOR_BE(x))];
*scanline++ = m_palette[(pixels&0xf0)];
*scanline++ = m_palette[((pixels&0x0f)<<4)];
@@ -199,13 +194,12 @@ uint32_t nubus_procolor816_device::screen_update(screen_device &screen, bitmap_r
break;
case 3: // 8 bpp
- for (y = 0; y < 480; y++)
+ for (int y = 0; y < 480; y++)
{
- scanline = &bitmap.pix32(y);
-
- for (x = 0; x < 640; x++)
+ uint32_t *scanline = &bitmap.pix(y);
+ for (int x = 0; x < 640; x++)
{
- pixels = vram[(y * 640) + (BYTE4_XOR_BE(x))];
+ uint8_t const pixels = vram[(y * 640) + (BYTE4_XOR_BE(x))];
*scanline++ = m_palette[pixels];
}
}
@@ -213,16 +207,15 @@ uint32_t nubus_procolor816_device::screen_update(screen_device &screen, bitmap_r
case 4: // 15 bpp
{
- uint16_t *vram16 = (uint16_t *)&m_vram[0];
- uint16_t pixels;
+ uint16_t const *const vram16 = (uint16_t *)&m_vram[0];
- for (y = 0; y < 480; y++)
+ for (int y = 0; y < 480; y++)
{
- scanline = &bitmap.pix32(y);
- for (x = 0; x < 640; x++)
+ uint32_t *scanline = &bitmap.pix(y);
+ for (int x = 0; x < 640; x++)
{
- pixels = vram16[(y * 640) + (x^1)];
- *scanline++ = rgb_t(((pixels>>10) & 0x1f)<<3, ((pixels>>5) & 0x1f)<<3, (pixels & 0x1f)<<3);
+ uint16_t const pixels = vram16[(y * 640) + BYTE_XOR_BE(x)];
+ *scanline++ = rgb_t(pal5bit((pixels>>10) & 0x1f), pal5bit((pixels>>5) & 0x1f), pal5bit(pixels & 0x1f));
}
}
}
diff --git a/src/devices/bus/nubus/pds30_sigmalview.cpp b/src/devices/bus/nubus/pds30_sigmalview.cpp
index c509b908064..e04e4b2e297 100644
--- a/src/devices/bus/nubus/pds30_sigmalview.cpp
+++ b/src/devices/bus/nubus/pds30_sigmalview.cpp
@@ -132,18 +132,14 @@ void nubus_lview_device::device_timer(emu_timer &timer, device_timer_id tid, int
uint32_t nubus_lview_device::screen_update(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect)
{
- uint32_t *scanline;
- int x, y;
- uint8_t pixels, *vram;
+ uint8_t const *const vram = &m_vram[0x20];
- vram = &m_vram[0x20];
-
- for (y = 0; y < 600; y++)
+ for (int y = 0; y < 600; y++)
{
- scanline = &bitmap.pix32(y);
- for (x = 0; x < 832/8; x++)
+ uint32_t *scanline = &bitmap.pix(y);
+ for (int x = 0; x < 832/8; x++)
{
- pixels = vram[(y * (832/8)) + (BYTE4_XOR_BE(x))];
+ uint8_t const pixels = vram[(y * (832/8)) + (BYTE4_XOR_BE(x))];
*scanline++ = m_palette[(pixels&0x80)];
*scanline++ = m_palette[((pixels<<1)&0x80)];
diff --git a/src/devices/bus/s100/dg640.cpp b/src/devices/bus/s100/dg640.cpp
index 7f79983f17d..f6adb27cfa8 100644
--- a/src/devices/bus/s100/dg640.cpp
+++ b/src/devices/bus/s100/dg640.cpp
@@ -39,28 +39,26 @@ void dg640_device::device_start()
uint32_t dg640_device::screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect)
{
// attributes bit 0 = flash, bit 1 = lores. Also bit 7 of the character = reverse-video (text only).
- uint8_t y,ra,chr,gfx,attr,inv,gfxbit;
- uint16_t sy=0,ma=0,x;
- bool flash;
+ uint16_t sy=0,ma=0;
m_framecnt++;
- for (y = 0; y < 16; y++)
+ for (uint8_t y = 0; y < 16; y++)
{
- for (ra = 0; ra < 16; ra++)
+ for (uint8_t ra = 0; ra < 16; ra++)
{
- uint16_t *p = &bitmap.pix16(sy++);
+ uint16_t *p = &bitmap.pix(sy++);
- for (x = ma; x < ma + 64; x++)
+ for (uint16_t x = ma; x < ma + 64; x++)
{
- attr = m_p_attribram[x];
- chr = m_p_videoram[x];
- flash = BIT(m_framecnt, 4) & BIT(attr, 0);
+ uint8_t attr = m_p_attribram[x];
+ uint8_t chr = m_p_videoram[x];
+ bool flash = BIT(m_framecnt, 4) & BIT(attr, 0);
if (BIT(attr, 1)) // lores gfx - can flash
{
if (flash) chr = 0; // blank part of flashing
- gfxbit = (ra & 0x0c)>>1;
+ uint8_t gfxbit = (ra & 0x0c) >> 1;
/* Display one line of a lores character (8 pixels) */
*p++ = BIT(chr, gfxbit);
*p++ = BIT(chr, gfxbit);
@@ -74,11 +72,11 @@ uint32_t dg640_device::screen_update(screen_device &screen, bitmap_ind16 &bitmap
}
else
{
- gfx = 0;
+ uint8_t gfx = 0;
if (!flash)
{
- inv = BIT(chr, 7) ? 0xff : 0; // text with bit 7 high is reversed
+ uint8_t inv = BIT(chr, 7) ? 0xff : 0; // text with bit 7 high is reversed
chr &= 0x7f;
gfx = inv;
diff --git a/src/devices/bus/s100/polyvti.cpp b/src/devices/bus/s100/polyvti.cpp
index 973e89c0693..242d13a8fe2 100644
--- a/src/devices/bus/s100/polyvti.cpp
+++ b/src/devices/bus/s100/polyvti.cpp
@@ -119,22 +119,22 @@ u32 poly_vti_device::screen_update(screen_device &screen, bitmap_ind16 &bitmap,
{
u8 r = b/5;
if (l==0 && r==0)
- bitmap.pix16(y*15+j, xpos+b ) = BIT(code,5) ? 0 : 1;
+ bitmap.pix(y*15+j, xpos+b ) = BIT(code,5) ? 0 : 1;
if (l==0 && r==1)
- bitmap.pix16(y*15+j, xpos+b ) = BIT(code,2) ? 0 : 1;
+ bitmap.pix(y*15+j, xpos+b ) = BIT(code,2) ? 0 : 1;
if (l==1 && r==0)
- bitmap.pix16(y*15+j, xpos+b ) = BIT(code,4) ? 0 : 1;
+ bitmap.pix(y*15+j, xpos+b ) = BIT(code,4) ? 0 : 1;
if (l==1 && r==1)
- bitmap.pix16(y*15+j, xpos+b ) = BIT(code,1) ? 0 : 1;
+ bitmap.pix(y*15+j, xpos+b ) = BIT(code,1) ? 0 : 1;
if (l==2 && r==0)
- bitmap.pix16(y*15+j, xpos+b ) = BIT(code,3) ? 0 : 1;
+ bitmap.pix(y*15+j, xpos+b ) = BIT(code,3) ? 0 : 1;
if (l==2 && r==1)
- bitmap.pix16(y*15+j, xpos+b ) = BIT(code,0) ? 0 : 1;
+ bitmap.pix(y*15+j, xpos+b ) = BIT(code,0) ? 0 : 1;
}
}
}
@@ -156,11 +156,11 @@ u32 poly_vti_device::screen_update(screen_device &screen, bitmap_ind16 &bitmap,
}
for (int b = 0; b < 7; b++)
- bitmap.pix16(y*15+j, xpos+b ) = (l >> (6-b)) & 1;
+ bitmap.pix(y*15+j, xpos+b ) = (l >> (6-b)) & 1;
- bitmap.pix16(y*15+j, xpos+7 ) = 0;
- bitmap.pix16(y*15+j, xpos+8 ) = 0;
- bitmap.pix16(y*15+j, xpos+9 ) = 0;
+ bitmap.pix(y*15+j, xpos+7 ) = 0;
+ bitmap.pix(y*15+j, xpos+8 ) = 0;
+ bitmap.pix(y*15+j, xpos+9 ) = 0;
}
}
xpos += 10;
diff --git a/src/devices/bus/sbus/bwtwo.cpp b/src/devices/bus/sbus/bwtwo.cpp
index 55d9f92b7b6..c034d43e05f 100644
--- a/src/devices/bus/sbus/bwtwo.cpp
+++ b/src/devices/bus/sbus/bwtwo.cpp
@@ -10,6 +10,9 @@
#include "bwtwo.h"
#include "screen.h"
+#include <algorithm>
+
+
DEFINE_DEVICE_TYPE(SBUS_BWTWO, sbus_bwtwo_device, "bwtwo", "Sun bwtwo SBus Video")
void sbus_bwtwo_device::mem_map(address_map &map)
@@ -72,14 +75,14 @@ void sbus_bwtwo_device::install_device()
uint32_t sbus_bwtwo_device::screen_update(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect)
{
- uint8_t *line = &m_vram[0];
+ uint8_t const *line = &m_vram[0];
for (int y = 0; y < 900; y++)
{
- uint32_t *scanline = &bitmap.pix32(y);
+ uint32_t *scanline = &bitmap.pix(y);
for (int x = 0; x < 1152/8; x++)
{
- memcpy(scanline, m_mono_lut[*line], sizeof(uint32_t) * 8);
+ std::copy_n(m_mono_lut[*line], 8, scanline);
line++;
scanline += 8;
}
diff --git a/src/devices/bus/sbus/cgsix.cpp b/src/devices/bus/sbus/cgsix.cpp
index 5d7bd715efd..65a24e1b505 100644
--- a/src/devices/bus/sbus/cgsix.cpp
+++ b/src/devices/bus/sbus/cgsix.cpp
@@ -171,12 +171,12 @@ void sbus_cgsix_device::device_reset()
uint32_t sbus_cgsix_device::screen_update(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect)
{
- const pen_t *pens = m_ramdac->pens();
- uint8_t *vram = (uint8_t *)&m_vram[0];
+ pen_t const *const pens = m_ramdac->pens();
+ uint8_t const *const vram = (uint8_t *)&m_vram[0];
for (int16_t y = 0; y < 900; y++)
{
- uint32_t *scanline = &bitmap.pix32(y);
+ uint32_t *scanline = &bitmap.pix(y);
const bool cursor_row_hit = (y >= m_cursor_y && y < (m_cursor_y + 32));
for (int16_t x = 0; x < 1152; x++)
{
diff --git a/src/devices/bus/sbus/cgthree.cpp b/src/devices/bus/sbus/cgthree.cpp
index 5ffe6a885c5..ad0ba5c1467 100644
--- a/src/devices/bus/sbus/cgthree.cpp
+++ b/src/devices/bus/sbus/cgthree.cpp
@@ -67,12 +67,12 @@ void sbus_cgthree_device::install_device()
uint32_t sbus_cgthree_device::screen_update(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect)
{
- const pen_t *pens = m_ramdac->pens();
- uint8_t *vram = (uint8_t *)&m_vram[0];
+ pen_t const *const pens = m_ramdac->pens();
+ uint8_t const *const vram = (uint8_t *)&m_vram[0];
for (int y = 0; y < 900; y++)
{
- uint32_t *scanline = &bitmap.pix32(y);
+ uint32_t *scanline = &bitmap.pix(y);
for (int x = 0; x < 1152; x++)
{
const uint8_t pixel = vram[y * 1152 + BYTE4_XOR_BE(x)];
diff --git a/src/devices/bus/svi3x8/slot/sv806.cpp b/src/devices/bus/svi3x8/slot/sv806.cpp
index bc4dafbd415..5a7d858d38b 100644
--- a/src/devices/bus/svi3x8/slot/sv806.cpp
+++ b/src/devices/bus/svi3x8/slot/sv806.cpp
@@ -94,7 +94,7 @@ void sv806_device::device_start()
MC6845_UPDATE_ROW( sv806_device::crtc_update_row )
{
- const pen_t *pen = m_palette->pens();
+ pen_t const *const pen = m_palette->pens();
for (int i = 0; i < x_count; i++)
{
@@ -103,14 +103,14 @@ MC6845_UPDATE_ROW( sv806_device::crtc_update_row )
if (i == cursor_x)
data = 0xff;
- bitmap.pix32(y, i * 8 + 0) = pen[BIT(data, 7)];
- bitmap.pix32(y, i * 8 + 1) = pen[BIT(data, 6)];
- bitmap.pix32(y, i * 8 + 2) = pen[BIT(data, 5)];
- bitmap.pix32(y, i * 8 + 3) = pen[BIT(data, 4)];
- bitmap.pix32(y, i * 8 + 4) = pen[BIT(data, 3)];
- bitmap.pix32(y, i * 8 + 5) = pen[BIT(data, 2)];
- bitmap.pix32(y, i * 8 + 6) = pen[BIT(data, 1)];
- bitmap.pix32(y, i * 8 + 7) = pen[BIT(data, 0)];
+ bitmap.pix(y, i * 8 + 0) = pen[BIT(data, 7)];
+ bitmap.pix(y, i * 8 + 1) = pen[BIT(data, 6)];
+ bitmap.pix(y, i * 8 + 2) = pen[BIT(data, 5)];
+ bitmap.pix(y, i * 8 + 3) = pen[BIT(data, 4)];
+ bitmap.pix(y, i * 8 + 4) = pen[BIT(data, 3)];
+ bitmap.pix(y, i * 8 + 5) = pen[BIT(data, 2)];
+ bitmap.pix(y, i * 8 + 6) = pen[BIT(data, 1)];
+ bitmap.pix(y, i * 8 + 7) = pen[BIT(data, 0)];
}
}
diff --git a/src/devices/bus/tanbus/mpvdu.cpp b/src/devices/bus/tanbus/mpvdu.cpp
index e9f4fe766eb..28cd0b988f9 100644
--- a/src/devices/bus/tanbus/mpvdu.cpp
+++ b/src/devices/bus/tanbus/mpvdu.cpp
@@ -149,7 +149,7 @@ uint8_t tanbus_mpvdu_device::videoram_r(offs_t offset)
MC6845_UPDATE_ROW(tanbus_mpvdu_device::crtc_update_row)
{
- uint32_t *p = &bitmap.pix32(y);
+ uint32_t *p = &bitmap.pix(y);
m_trom->lose_w(1);
m_trom->lose_w(0);
@@ -165,11 +165,11 @@ MC6845_UPDATE_ROW(tanbus_mpvdu_device::crtc_update_row)
m_trom->tr6_w(1);
m_trom->tr6_w(0);
- int col = m_trom->get_rgb() ^ ((column == cursor_x) ? 7 : 0);
+ int const col = m_trom->get_rgb() ^ ((column == cursor_x) ? 7 : 0);
- int r = BIT(col, 0) * 0xff;
- int g = BIT(col, 1) * 0xff;
- int b = BIT(col, 2) * 0xff;
+ int const r = BIT(col, 0) * 0xff;
+ int const g = BIT(col, 1) * 0xff;
+ int const b = BIT(col, 2) * 0xff;
*p++ = rgb_t(r, g, b);
}
diff --git a/src/devices/bus/tanbus/ravdu.cpp b/src/devices/bus/tanbus/ravdu.cpp
index 80664797081..b93b1a41c35 100644
--- a/src/devices/bus/tanbus/ravdu.cpp
+++ b/src/devices/bus/tanbus/ravdu.cpp
@@ -161,7 +161,7 @@ uint8_t tanbus_ravdu_device::videoram_r(offs_t offset)
MC6845_UPDATE_ROW(tanbus_ravdu_device::crtc_update_row)
{
- uint32_t *p = &bitmap.pix32(y);
+ uint32_t *p = &bitmap.pix(y);
m_trom->lose_w(1);
m_trom->lose_w(0);
@@ -178,11 +178,11 @@ MC6845_UPDATE_ROW(tanbus_ravdu_device::crtc_update_row)
m_trom->tr6_w(1);
m_trom->tr6_w(0);
- int col = m_trom->get_rgb() ^ ((column == cursor_x) ? 7 : 0);
+ int const col = m_trom->get_rgb() ^ ((column == cursor_x) ? 7 : 0);
- int r = BIT(col, 0) * 0xff;
- int g = BIT(col, 1) * 0xff;
- int b = BIT(col, 2) * 0xff;
+ int const r = BIT(col, 0) * 0xff;
+ int const g = BIT(col, 1) * 0xff;
+ int const b = BIT(col, 2) * 0xff;
*p++ = rgb_t(r, g, b);
}
diff --git a/src/devices/bus/tanbus/tanhrg.cpp b/src/devices/bus/tanbus/tanhrg.cpp
index 1c8ffc87ab5..b857e84ac69 100644
--- a/src/devices/bus/tanbus/tanhrg.cpp
+++ b/src/devices/bus/tanbus/tanhrg.cpp
@@ -323,16 +323,13 @@ void tanbus_tanhrgc_device::set_inhibit_lines(offs_t offset, int &inhram, int &i
uint32_t tanbus_tanhrg_device::screen_update(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect)
{
- uint16_t offset;
- uint32_t *p;
-
for (int y = 0; y < 256; y++)
{
- p = &bitmap.pix32(y);
+ uint32_t *p = &bitmap.pix(y);
for (int x = 0; x < 256; x++)
{
- offset = (y * 32) + (x / 8);
+ uint16_t const offset = (y * 32) + (x / 8);
*p++ = m_palette->pen_color(BIT(m_videoram[offset], x & 7));
}
@@ -344,21 +341,17 @@ uint32_t tanbus_tanhrg_device::screen_update(screen_device &screen, bitmap_rgb32
uint32_t tanbus_tanhrgc_device::screen_update(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect)
{
- uint8_t r, g, b;
- uint16_t offset;
- uint32_t *p;
-
for (int y = 0; y < 256; y++)
{
- p = &bitmap.pix32(y);
+ uint32_t *p = &bitmap.pix(y);
for (int x = 0; x < 256; x++)
{
- offset = (y * 32) + (x / 8);
+ uint16_t const offset = (y * 32) + (x / 8);
- r = m_videoram[0x0000 | offset];
- b = m_videoram[0x2000 | offset];
- g = m_videoram[0x4000 | offset];
+ uint8_t const r = m_videoram[0x0000 | offset];
+ uint8_t const b = m_videoram[0x2000 | offset];
+ uint8_t const g = m_videoram[0x4000 | offset];
*p++ = m_palette->pen_color(BIT(b, x & 7) << 2 | BIT(g, x & 7) << 1 | BIT(r, x & 7));
}
diff --git a/src/devices/bus/tanbus/tug8082.cpp b/src/devices/bus/tanbus/tug8082.cpp
index 1e4ad1a4504..582ab726c8e 100644
--- a/src/devices/bus/tanbus/tug8082.cpp
+++ b/src/devices/bus/tanbus/tug8082.cpp
@@ -241,18 +241,14 @@ WRITE_LINE_MEMBER(tanbus_tug8082_device::vdu_irq_w)
uint32_t tanbus_tug8082_device::screen_update(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect)
{
- uint32_t *scanline;
- int x, y;
- uint8_t pixels;
+ pen_t const *const pen = m_palette->pens();
- const pen_t *pen = m_palette->pens();
-
- for (y = 0; y < 256; y++)
+ for (int y = 0; y < 256; y++)
{
- scanline = &bitmap.pix32(y);
- for (x = 0; x < 64; x++)
+ uint32_t *scanline = &bitmap.pix(y);
+ for (int x = 0; x < 64; x++)
{
- pixels = m_videoram[(y * 64) + x];
+ uint8_t const pixels = m_videoram[(y * 64) + x];
for (int i = 0; i < 8; ++i)
*scanline++ = pen[BIT(pixels, 7 - i)];
diff --git a/src/devices/bus/ti99/internal/992board.cpp b/src/devices/bus/ti99/internal/992board.cpp
index 031f82d7fe5..2f01c025cb6 100644
--- a/src/devices/bus/ti99/internal/992board.cpp
+++ b/src/devices/bus/ti99/internal/992board.cpp
@@ -202,7 +202,7 @@ void video992_device::device_timer(emu_timer &timer, device_timer_id id, int par
}
int vpos = raw_vpos * m_vertical_size / screen().height();
- uint32_t *p = &m_tmpbmp.pix32(vpos);
+ uint32_t *p = &m_tmpbmp.pix(vpos);
bool endofline = false;
int linelength = 0;
diff --git a/src/devices/bus/vic20/videopak.cpp b/src/devices/bus/vic20/videopak.cpp
index 187224721be..1f2b3c35431 100644
--- a/src/devices/bus/vic20/videopak.cpp
+++ b/src/devices/bus/vic20/videopak.cpp
@@ -77,7 +77,7 @@ MC6845_UPDATE_ROW( vic20_video_pak_device::crtc_update_row )
int x = (column * 8) + bit;
int color = BIT(data, 7) && de;
- bitmap.pix32(vbp + y, hbp + x) = pen[color];
+ bitmap.pix(vbp + y, hbp + x) = pen[color];
data <<= 1;
}
diff --git a/src/devices/bus/wangpc/lvc.cpp b/src/devices/bus/wangpc/lvc.cpp
index 4d31a7b9367..1fd3c0610d4 100644
--- a/src/devices/bus/wangpc/lvc.cpp
+++ b/src/devices/bus/wangpc/lvc.cpp
@@ -62,17 +62,17 @@ MC6845_UPDATE_ROW( wangpc_lvc_device::crtc_update_row )
{
for (int column = 0; column < x_count; column++)
{
- offs_t addr = scroll_y + (m_scroll & 0x3f) + ((ma / 80) * 0x480) + (((ra & 0x0f) << 7) | (column & 0x7f));
+ offs_t const addr = scroll_y + (m_scroll & 0x3f) + ((ma / 80) * 0x480) + (((ra & 0x0f) << 7) | (column & 0x7f));
uint16_t data = m_video_ram[addr & 0x7fff];
for (int bit = 0; bit < 8; bit++)
{
- int x = (column * 8) + bit;
+ int const x = (column * 8) + bit;
int color = (BIT(data, 15) << 1) | BIT(data, 7);
if (column == cursor_x) color = 0x03;
- bitmap.pix32(vbp + y, hbp + x) = de ? m_palette[color] : rgb_t::black();
+ bitmap.pix(vbp + y, hbp + x) = de ? m_palette[color] : rgb_t::black();
data <<= 1;
}
@@ -89,12 +89,12 @@ MC6845_UPDATE_ROW( wangpc_lvc_device::crtc_update_row )
for (int bit = 0; bit < 8; bit++)
{
- int x = (column * 8) + bit;
+ int const x = (column * 8) + bit;
int color = (BIT(data, 31) << 3) | (BIT(data, 23) << 2) | (BIT(data, 15) << 1) | BIT(data, 7);
if (column == cursor_x) color = 0x03;
- bitmap.pix32(vbp + y, hbp + x) = de ? m_palette[color] : rgb_t::black();
+ bitmap.pix(vbp + y, hbp + x) = de ? m_palette[color] : rgb_t::black();
data <<= 1;
}
diff --git a/src/devices/bus/wangpc/mvc.cpp b/src/devices/bus/wangpc/mvc.cpp
index 562e277f982..cff515a05c1 100644
--- a/src/devices/bus/wangpc/mvc.cpp
+++ b/src/devices/bus/wangpc/mvc.cpp
@@ -73,15 +73,15 @@ MC6845_UPDATE_ROW( wangpc_mvc_device::crtc_update_row )
{
for (int sx = 0; sx < 50; sx++)
{
- offs_t addr = (y * 50) + sx;
+ offs_t const addr = (y * 50) + sx;
uint16_t data = m_bitmap_ram[addr];
for (int bit = 0; bit < 16; bit++)
{
- int x = (sx * 16) + bit;
- int color = BIT(data, 15) && de;
+ int const x = (sx * 16) + bit;
+ int const color = BIT(data, 15) && de;
- bitmap.pix32(vbp + y, hbp + x) = PALETTE_MVC[color];
+ bitmap.pix(vbp + y, hbp + x) = PALETTE_MVC[color];
data <<= 1;
}
@@ -89,8 +89,8 @@ MC6845_UPDATE_ROW( wangpc_mvc_device::crtc_update_row )
for (int column = 0; column < x_count; column++)
{
- uint16_t code = m_video_ram[((ma + column) & 0x7ff)];
- uint8_t attr = code & 0xff;
+ uint16_t const code = m_video_ram[((ma + column) & 0x7ff)];
+ uint8_t const attr = code & 0xff;
uint8_t new_ra = ra + 1;
@@ -103,7 +103,7 @@ MC6845_UPDATE_ROW( wangpc_mvc_device::crtc_update_row )
new_ra = ra;
}
- offs_t addr = ((code >> 8) << 4) | (new_ra & 0x0f);
+ offs_t const addr = ((code >> 8) << 4) | (new_ra & 0x0f);
uint16_t data = m_char_ram[addr & 0xfff];
if ((column == cursor_x) || (!ra && ATTR_OVERSCORE) || ((ra == 9) && ATTR_UNDERSCORE))
@@ -113,11 +113,13 @@ MC6845_UPDATE_ROW( wangpc_mvc_device::crtc_update_row )
for (int bit = 0; bit < 10; bit++)
{
- int x = (column * 10) + bit;
+ int const x = (column * 10) + bit;
int color = ((BIT(data, 9) & ~ATTR_BLANK) ^ ATTR_REVERSE);
- if ((color | bitmap.pix32(vbp + y, hbp + x)) & ATTR_BOLD) color = 2;
- if (color) bitmap.pix32(vbp + y, hbp + x) = de ? PALETTE_MVC[color] : rgb_t::black();
+ if ((color | bitmap.pix(vbp + y, hbp + x)) & ATTR_BOLD)
+ color = 2;
+ if (color)
+ bitmap.pix(vbp + y, hbp + x) = de ? PALETTE_MVC[color] : rgb_t::black();
data <<= 1;
}
diff --git a/src/devices/cpu/e0c6200/e0c6s46.cpp b/src/devices/cpu/e0c6200/e0c6s46.cpp
index 9f80774a6e5..5094c36a5f7 100644
--- a/src/devices/cpu/e0c6200/e0c6s46.cpp
+++ b/src/devices/cpu/e0c6200/e0c6s46.cpp
@@ -589,7 +589,7 @@ u32 e0c6s46_device::screen_update(screen_device &screen, bitmap_ind16 &bitmap, c
if (!m_pixel_update_cb.isnull())
m_pixel_update_cb(bitmap, cliprect, m_lcd_contrast, seg, com, pixel);
else if (cliprect.contains(seg, com))
- bitmap.pix16(com, seg) = pixel;
+ bitmap.pix(com, seg) = pixel;
}
}
}
diff --git a/src/devices/cpu/tms34010/tms34010.cpp b/src/devices/cpu/tms34010/tms34010.cpp
index d5fd882a484..ab820fc1599 100644
--- a/src/devices/cpu/tms34010/tms34010.cpp
+++ b/src/devices/cpu/tms34010/tms34010.cpp
@@ -1178,7 +1178,7 @@ uint32_t tms340x0_device::tms340x0_ind16(screen_device &screen, bitmap_ind16 &bi
params.heblnk = params.hsblnk = cliprect.max_x + 1;
/* blank out the blank regions */
- uint16_t *dest = &bitmap.pix16(cliprect.min_y);
+ uint16_t *dest = &bitmap.pix(cliprect.min_y);
for (x = cliprect.min_x; x < params.heblnk; x++)
dest[x] = blackpen;
for (x = params.hsblnk; x <= cliprect.max_x; x++)
@@ -1209,7 +1209,7 @@ uint32_t tms340x0_device::tms340x0_rgb32(screen_device &screen, bitmap_rgb32 &bi
params.heblnk = params.hsblnk = cliprect.max_x + 1;
/* blank out the blank regions */
- uint32_t *dest = &bitmap.pix32(cliprect.min_y);
+ uint32_t *dest = &bitmap.pix(cliprect.min_y);
for (x = cliprect.min_x; x < params.heblnk; x++)
dest[x] = blackpen;
for (x = params.hsblnk; x <= cliprect.max_x; x++)
diff --git a/src/devices/cpu/vt50/vt50.cpp b/src/devices/cpu/vt50/vt50.cpp
index 961dca5aa2c..7a964c4be5b 100644
--- a/src/devices/cpu/vt50/vt50.cpp
+++ b/src/devices/cpu/vt50/vt50.cpp
@@ -284,7 +284,7 @@ void vt5x_cpu_device::draw_char_line()
if (xc > screen().visible_area().right() - 8)
return;
- u32 *pix = &m_bitmap.pix32(m_current_line, xc);
+ u32 *pix = &m_bitmap.pix(m_current_line, xc);
if (m_video_process && m_cursor_ff && m_cursor_active)
std::fill_n(pix, 9, rgb_t::white());
else if (!m_video_process || m_cursor_ff)
diff --git a/src/devices/machine/acorn_vidc.cpp b/src/devices/machine/acorn_vidc.cpp
index 36733555e7d..f0ebf10f612 100644
--- a/src/devices/machine/acorn_vidc.cpp
+++ b/src/devices/machine/acorn_vidc.cpp
@@ -492,9 +492,9 @@ void acorn_vidc10_device::draw(bitmap_rgb32 &bitmap, const rectangle &cliprect,
if (is_cursor == true && dot == 0)
continue;
dot += pen_base;
- bitmap.pix32(dsty, dstx+xi) = this->pen(dot);
+ bitmap.pix(dsty, dstx+xi) = this->pen(dot);
if (m_crtc_interlace)
- bitmap.pix32(dsty+1, dstx+xi) = this->pen(dot);
+ bitmap.pix(dsty+1, dstx+xi) = this->pen(dot);
}
}
}
diff --git a/src/devices/machine/exorterm.cpp b/src/devices/machine/exorterm.cpp
index 0b62597e3f1..9db3f0658e4 100644
--- a/src/devices/machine/exorterm.cpp
+++ b/src/devices/machine/exorterm.cpp
@@ -348,7 +348,7 @@ u32 exorterm155_device::screen_update(screen_device &screen, bitmap_rgb32 &bitma
u16 sy = 0, ma = 0;
u8 disable_fac = m_disable_fac->read() == 0;
u8 display_fac = m_display_fac->read() == 0;
- const rgb_t *palette = m_palette->palette()->entry_list_raw();
+ rgb_t const *const palette = m_palette->palette()->entry_list_raw();
m_framecnt++;
@@ -356,7 +356,7 @@ u32 exorterm155_device::screen_update(screen_device &screen, bitmap_rgb32 &bitma
{
for (u8 ra = 0; ra < 12; ra++)
{
- u32 *p = &bitmap.pix32(sy++);
+ u32 *p = &bitmap.pix(sy++);
// FAC codes are cleared on horizontal sync.
u8 underline1 = 0;
u8 underline2 = 0;
diff --git a/src/devices/machine/ie15.cpp b/src/devices/machine/ie15.cpp
index 3cdb35af145..eba7ace6fa7 100644
--- a/src/devices/machine/ie15.cpp
+++ b/src/devices/machine/ie15.cpp
@@ -637,7 +637,8 @@ void ie15_device::scanline_callback()
uint32_t ie15_device::screen_update(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect)
{
update_leds();
- memcpy(&bitmap.pix32(0), &m_tmpbmp[0], sizeof(uint32_t) * IE15_TOTAL_HORZ * IE15_TOTAL_VERT);
+ for (int y = 0; y < IE15_TOTAL_VERT; y++)
+ std::copy_n(&m_tmpbmp[y * IE15_TOTAL_HORZ], IE15_TOTAL_HORZ, &bitmap.pix(y));
return 0;
}
diff --git a/src/devices/machine/laserdsc.cpp b/src/devices/machine/laserdsc.cpp
index ef3df359859..c376c62977c 100644
--- a/src/devices/machine/laserdsc.cpp
+++ b/src/devices/machine/laserdsc.cpp
@@ -712,10 +712,10 @@ void laserdisc_device::init_video()
fillbitmap_yuy16(frame.m_bitmap, 40, 109, 240);
// make a copy of the bitmap that clips out the VBI and horizontal blanking areas
- frame.m_visbitmap.wrap(&frame.m_bitmap.pix16(44, frame.m_bitmap.width() * 8 / 720),
- frame.m_bitmap.width() - 2 * frame.m_bitmap.width() * 8 / 720,
- frame.m_bitmap.height() - 44,
- frame.m_bitmap.rowpixels());
+ frame.m_visbitmap.wrap(&frame.m_bitmap.pix(
+ 44, frame.m_bitmap.width() * 8 / 720),
+ frame.m_bitmap.width() - 2 * frame.m_bitmap.width() * 8 / 720, frame.m_bitmap.height() - 44,
+ frame.m_bitmap.rowpixels());
frame.m_visbitmap.set_palette(m_videopalette);
}
@@ -789,7 +789,7 @@ void laserdisc_device::fillbitmap_yuy16(bitmap_yuy16 &bitmap, uint8_t yval, uint
// write 32 bits of color (2 pixels at a time)
for (int y = 0; y < bitmap.height(); y++)
{
- uint16_t *dest = &bitmap.pix16(y);
+ uint16_t *dest = &bitmap.pix(y);
for (int x = 0; x < bitmap.width() / 2; x++)
{
*dest++ = color0;
@@ -918,7 +918,8 @@ void laserdisc_device::read_track_data()
frame->m_lastfield = m_curtrack * 2 + m_fieldnum;
// set the video target information
- m_avhuff_config.video.wrap(&frame->m_bitmap.pix16(m_fieldnum), frame->m_bitmap.width(), frame->m_bitmap.height() / 2, frame->m_bitmap.rowpixels() * 2);
+ m_avhuff_video.wrap(&frame->m_bitmap.pix(m_fieldnum), frame->m_bitmap.width(), frame->m_bitmap.height() / 2, frame->m_bitmap.rowpixels() * 2);
+ m_avhuff_config.video = &m_avhuff_video;
// set the audio target information
if (m_audiobufin + m_audiomaxsamples <= m_audiobufsize)
@@ -995,13 +996,13 @@ void laserdisc_device::process_track_data()
// remove the video if we had an error
if (m_readresult != CHDERR_NONE)
- m_avhuff_config.video.reset();
+ m_avhuff_video.reset();
// count the field as read if we are successful
- if (m_avhuff_config.video.valid())
+ if (m_avhuff_video.valid())
{
m_frame[m_videoindex].m_numfields++;
- player_overlay(m_avhuff_config.video);
+ player_overlay(m_avhuff_video);
}
// pass the audio to the callback
diff --git a/src/devices/machine/laserdsc.h b/src/devices/machine/laserdsc.h
index 8ca3abad222..9e80d43df52 100644
--- a/src/devices/machine/laserdsc.h
+++ b/src/devices/machine/laserdsc.h
@@ -277,28 +277,29 @@ private:
std::vector<uint8_t> m_vbidata; // pointer to precomputed VBI data
int m_width; // width of video
int m_height; // height of video
- uint32_t m_fps_times_1million; // frame rate of video
+ uint32_t m_fps_times_1million; // frame rate of video
int m_samplerate; // audio samplerate
int m_readresult; // result of the most recent read
- uint32_t m_chdtracks; // number of tracks in the CHD
- avhuff_decompress_config m_avhuff_config; // decompression configuration
+ uint32_t m_chdtracks; // number of tracks in the CHD
+ bitmap_yuy16 m_avhuff_video; // decompresed frame buffer
+ avhuff_decoder::config m_avhuff_config; // decompression configuration
// async operations
osd_work_queue * m_work_queue; // work queue
- uint32_t m_queued_hunknum; // queued hunk
+ uint32_t m_queued_hunknum; // queued hunk
// core states
- uint8_t m_audiosquelch; // audio squelch state: bit 0 = audio 1, bit 1 = audio 2
- uint8_t m_videosquelch; // video squelch state: bit 0 = on/off
- uint8_t m_fieldnum; // field number (0 or 1)
- int32_t m_curtrack; // current track at this end of this vsync
- uint32_t m_maxtrack; // maximum track number
+ uint8_t m_audiosquelch; // audio squelch state: bit 0 = audio 1, bit 1 = audio 2
+ uint8_t m_videosquelch; // video squelch state: bit 0 = on/off
+ uint8_t m_fieldnum; // field number (0 or 1)
+ int32_t m_curtrack; // current track at this end of this vsync
+ uint32_t m_maxtrack; // maximum track number
attoseconds_t m_attospertrack; // attoseconds per track, or 0 if not moving
attotime m_sliderupdate; // time of last slider update
// video data
frame_data m_frame[3]; // circular list of frames
- uint8_t m_videoindex; // index of the current video buffer
+ uint8_t m_videoindex; // index of the current video buffer
bitmap_yuy16 m_emptyframe; // blank frame
// audio data
diff --git a/src/devices/machine/ldpr8210.cpp b/src/devices/machine/ldpr8210.cpp
index fc94159ff6a..64392ed0c90 100644
--- a/src/devices/machine/ldpr8210.cpp
+++ b/src/devices/machine/ldpr8210.cpp
@@ -784,12 +784,12 @@ void pioneer_pr8210_device::overlay_draw_group(bitmap_yuy16 &bitmap, const uint8
void pioneer_pr8210_device::overlay_erase(bitmap_yuy16 &bitmap, float xstart, float xend)
{
- uint32_t xmin = (uint32_t)(xstart * 256.0f * float(bitmap.width()));
- uint32_t xmax = (uint32_t)(xend * 256.0f * float(bitmap.width()));
+ uint32_t xmin = uint32_t(xstart * 256.0f * float(bitmap.width()));
+ uint32_t xmax = uint32_t(xend * 256.0f * float(bitmap.width()));
for (uint32_t y = OVERLAY_Y; y < (OVERLAY_Y + (OVERLAY_Y_PIXELS + 2) * OVERLAY_PIXEL_HEIGHT); y++)
{
- uint16_t *dest = &bitmap.pix16(y, xmin >> 8);
+ uint16_t *dest = &bitmap.pix(y, xmin >> 8);
uint16_t ymax = *dest >> 8;
uint16_t ymin = ymax * 3 / 8;
uint16_t yres = ymin + ((ymax - ymin) * (xmin & 0xff)) / 256;
@@ -819,8 +819,8 @@ void pioneer_pr8210_device::overlay_erase(bitmap_yuy16 &bitmap, float xstart, fl
void pioneer_pr8210_device::overlay_draw_char(bitmap_yuy16 &bitmap, uint8_t ch, float xstart)
{
- uint32_t xminbase = (uint32_t)(xstart * 256.0f * float(bitmap.width()));
- uint32_t xsize = (uint32_t)(OVERLAY_PIXEL_WIDTH * 256.0f * float(bitmap.width()));
+ uint32_t xminbase = uint32_t(xstart * 256.0f * float(bitmap.width()));
+ uint32_t xsize = uint32_t(OVERLAY_PIXEL_WIDTH * 256.0f * float(bitmap.width()));
// iterate over pixels
const uint8_t *chdataptr = &text_bitmap[ch & 0x3f][0];
@@ -835,7 +835,7 @@ void pioneer_pr8210_device::overlay_draw_char(bitmap_yuy16 &bitmap, uint8_t ch,
uint32_t xmax = xmin + xsize;
for (uint32_t yy = 0; yy < OVERLAY_PIXEL_HEIGHT; yy++)
{
- uint16_t *dest = &bitmap.pix16(OVERLAY_Y + (y + 1) * OVERLAY_PIXEL_HEIGHT + yy, xmin >> 8);
+ uint16_t *dest = &bitmap.pix(OVERLAY_Y + (y + 1) * OVERLAY_PIXEL_HEIGHT + yy, xmin >> 8);
uint16_t ymax = 0xff;
uint16_t ymin = *dest >> 8;
uint16_t yres = ymin + ((ymax - ymin) * (~xmin & 0xff)) / 256;
diff --git a/src/devices/machine/mc68328.cpp b/src/devices/machine/mc68328.cpp
index 3df500d2f0c..e3690287710 100644
--- a/src/devices/machine/mc68328.cpp
+++ b/src/devices/machine/mc68328.cpp
@@ -3044,20 +3044,17 @@ uint16_t mc68328_device::internal_read(offs_t offset, uint16_t mem_mask)
uint32_t mc68328_device::screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect)
{
uint32_t vram_addr = m_regs.lssa & 0x00fffffe;
- uint16_t word;
- uint16_t *line;
- int y, x, b;
if (m_regs.lckcon & LCKCON_LCDC_EN)
{
- for (y = 0; y < 160; y++)
+ for (int y = 0; y < 160; y++)
{
- line = &bitmap.pix16(y);
+ uint16_t *const line = &bitmap.pix(y);
- for (x = 0; x < 160; x += 16, vram_addr += 2)
+ for (int x = 0; x < 160; x += 16, vram_addr += 2)
{
- word = space(AS_PROGRAM).read_word(vram_addr);
- for (b = 0; b < 16; b++)
+ uint16_t const word = space(AS_PROGRAM).read_word(vram_addr);
+ for (int b = 0; b < 16; b++)
{
line[x + b] = (word >> (15 - b)) & 0x0001;
}
@@ -3066,11 +3063,11 @@ uint32_t mc68328_device::screen_update(screen_device &screen, bitmap_ind16 &bitm
}
else
{
- for (y = 0; y < 160; y++)
+ for (int y = 0; y < 160; y++)
{
- line = &bitmap.pix16(y);
+ uint16_t *const line = &bitmap.pix(y);
- for (x = 0; x < 160; x++)
+ for (int x = 0; x < 160; x++)
{
line[x] = 0;
}
diff --git a/src/devices/machine/pxa255.cpp b/src/devices/machine/pxa255.cpp
index 07e7d997b8c..6bd82ec987c 100644
--- a/src/devices/machine/pxa255.cpp
+++ b/src/devices/machine/pxa255.cpp
@@ -1583,7 +1583,7 @@ uint32_t pxa255_periphs_device::screen_update(screen_device &screen, bitmap_rgb3
{
for (int y = 0; y <= (m_lcd_regs.lccr2 & PXA255_LCCR2_LPP); y++)
{
- uint32_t *dst = &bitmap.pix32(y);
+ uint32_t *dst = &bitmap.pix(y);
for (int x = 0; x <= (m_lcd_regs.lccr1 & PXA255_LCCR1_PPL); x++)
{
*dst++ = m_lcd_palette[m_lcd_framebuffer[y * ((m_lcd_regs.lccr1 & PXA255_LCCR1_PPL) + 1) + x]];
diff --git a/src/devices/machine/s2636.cpp b/src/devices/machine/s2636.cpp
index bdf95dc69d0..4d35b829e74 100644
--- a/src/devices/machine/s2636.cpp
+++ b/src/devices/machine/s2636.cpp
@@ -247,7 +247,7 @@ void s2636_device::render_next_line()
// pre-clear the line for convenience
rectangle const &vis_area = screen().visible_area();
- uint16_t *const row = &m_bitmap.pix16(m_screen_line);
+ uint16_t *const row = &m_bitmap.pix(m_screen_line);
m_bitmap.plot_box(0, m_screen_line, m_bitmap.width(), 1, 0);
if ((vis_area.min_y > m_screen_line) || (vis_area.max_y < m_screen_line))
diff --git a/src/devices/machine/s3c24xx.hxx b/src/devices/machine/s3c24xx.hxx
index dcff99a7b70..8fae9ee616e 100644
--- a/src/devices/machine/s3c24xx.hxx
+++ b/src/devices/machine/s3c24xx.hxx
@@ -434,7 +434,7 @@ void S3C24_CLASS_NAME::s3c24xx_lcd_render_tpal()
uint32_t color = s3c24xx_get_color_tpal();
for (int y = m_lcd.vpos_min; y <= m_lcd.vpos_max; y++)
{
- uint32_t *scanline = &bitmap.pix32(y, m_lcd.hpos_min);
+ uint32_t *scanline = &bitmap.pix(y, m_lcd.hpos_min);
for (int x = m_lcd.hpos_min; x <= m_lcd.hpos_max; x++)
{
*scanline++ = color;
@@ -445,7 +445,7 @@ void S3C24_CLASS_NAME::s3c24xx_lcd_render_tpal()
void S3C24_CLASS_NAME::s3c24xx_lcd_render_stn_01()
{
bitmap_rgb32 &bitmap = *m_lcd.bitmap[0];
- uint32_t *scanline = &bitmap.pix32(m_lcd.vpos, m_lcd.hpos);
+ uint32_t *scanline = &bitmap.pix(m_lcd.vpos, m_lcd.hpos);
for (int i = 0; i < 4; i++)
{
uint32_t data = s3c24xx_lcd_dma_read();
@@ -467,7 +467,7 @@ void S3C24_CLASS_NAME::s3c24xx_lcd_render_stn_01()
m_lcd.vpos++;
if (m_lcd.vpos > m_lcd.vpos_max) m_lcd.vpos = m_lcd.vpos_min;
m_lcd.hpos = m_lcd.hpos_min;
- scanline = &bitmap.pix32(m_lcd.vpos, m_lcd.hpos);
+ scanline = &bitmap.pix(m_lcd.vpos, m_lcd.hpos);
}
}
}
@@ -476,7 +476,7 @@ void S3C24_CLASS_NAME::s3c24xx_lcd_render_stn_01()
void S3C24_CLASS_NAME::s3c24xx_lcd_render_stn_02()
{
bitmap_rgb32 &bitmap = *m_lcd.bitmap[0];
- uint32_t *scanline = &bitmap.pix32(m_lcd.vpos, m_lcd.hpos);
+ uint32_t *scanline = &bitmap.pix(m_lcd.vpos, m_lcd.hpos);
for (int i = 0; i < 4; i++)
{
uint32_t data = s3c24xx_lcd_dma_read();
@@ -490,7 +490,7 @@ void S3C24_CLASS_NAME::s3c24xx_lcd_render_stn_02()
m_lcd.vpos++;
if (m_lcd.vpos > m_lcd.vpos_max) m_lcd.vpos = m_lcd.vpos_min;
m_lcd.hpos = m_lcd.hpos_min;
- scanline = &bitmap.pix32(m_lcd.vpos, m_lcd.hpos);
+ scanline = &bitmap.pix(m_lcd.vpos, m_lcd.hpos);
}
}
}
@@ -499,7 +499,7 @@ void S3C24_CLASS_NAME::s3c24xx_lcd_render_stn_02()
void S3C24_CLASS_NAME::s3c24xx_lcd_render_stn_04()
{
bitmap_rgb32 &bitmap = *m_lcd.bitmap[0];
- uint32_t *scanline = &bitmap.pix32(m_lcd.vpos, m_lcd.hpos);
+ uint32_t *scanline = &bitmap.pix(m_lcd.vpos, m_lcd.hpos);
for (int i = 0; i < 4; i++)
{
uint32_t data = s3c24xx_lcd_dma_read();
@@ -513,7 +513,7 @@ void S3C24_CLASS_NAME::s3c24xx_lcd_render_stn_04()
m_lcd.vpos++;
if (m_lcd.vpos > m_lcd.vpos_max) m_lcd.vpos = m_lcd.vpos_min;
m_lcd.hpos = m_lcd.hpos_min;
- scanline = &bitmap.pix32(m_lcd.vpos, m_lcd.hpos);
+ scanline = &bitmap.pix(m_lcd.vpos, m_lcd.hpos);
}
}
}
@@ -522,7 +522,7 @@ void S3C24_CLASS_NAME::s3c24xx_lcd_render_stn_04()
void S3C24_CLASS_NAME::s3c24xx_lcd_render_stn_08()
{
bitmap_rgb32 &bitmap = *m_lcd.bitmap[0];
- uint32_t *scanline = &bitmap.pix32(m_lcd.vpos, m_lcd.hpos);
+ uint32_t *scanline = &bitmap.pix(m_lcd.vpos, m_lcd.hpos);
for (int i = 0; i < 4; i++)
{
uint32_t data = s3c24xx_lcd_dma_read();
@@ -536,7 +536,7 @@ void S3C24_CLASS_NAME::s3c24xx_lcd_render_stn_08()
m_lcd.vpos++;
if (m_lcd.vpos > m_lcd.vpos_max) m_lcd.vpos = m_lcd.vpos_min;
m_lcd.hpos = m_lcd.hpos_min;
- scanline = &bitmap.pix32(m_lcd.vpos, m_lcd.hpos);
+ scanline = &bitmap.pix(m_lcd.vpos, m_lcd.hpos);
}
}
}
@@ -545,7 +545,7 @@ void S3C24_CLASS_NAME::s3c24xx_lcd_render_stn_08()
void S3C24_CLASS_NAME::s3c24xx_lcd_render_stn_12_p()
{
bitmap_rgb32 &bitmap = *m_lcd.bitmap[0];
- uint32_t *scanline = &bitmap.pix32(m_lcd.vpos, m_lcd.hpos);
+ uint32_t *scanline = &bitmap.pix(m_lcd.vpos, m_lcd.hpos);
for (int i = 0; i < 16; i++)
{
*scanline++ = s3c24xx_get_color_stn_12(s3c24xx_lcd_dma_read_bits(12));
@@ -555,7 +555,7 @@ void S3C24_CLASS_NAME::s3c24xx_lcd_render_stn_12_p()
m_lcd.vpos++;
if (m_lcd.vpos > m_lcd.vpos_max) m_lcd.vpos = m_lcd.vpos_min;
m_lcd.hpos = m_lcd.hpos_min;
- scanline = &bitmap.pix32(m_lcd.vpos, m_lcd.hpos);
+ scanline = &bitmap.pix(m_lcd.vpos, m_lcd.hpos);
}
}
}
@@ -563,7 +563,7 @@ void S3C24_CLASS_NAME::s3c24xx_lcd_render_stn_12_p()
void S3C24_CLASS_NAME::s3c24xx_lcd_render_stn_12_u() // not tested
{
bitmap_rgb32 &bitmap = *m_lcd.bitmap[0];
- uint32_t *scanline = &bitmap.pix32(m_lcd.vpos, m_lcd.hpos);
+ uint32_t *scanline = &bitmap.pix(m_lcd.vpos, m_lcd.hpos);
for (int i = 0; i < 4; i++)
{
uint32_t data = s3c24xx_lcd_dma_read();
@@ -577,7 +577,7 @@ void S3C24_CLASS_NAME::s3c24xx_lcd_render_stn_12_u() // not tested
m_lcd.vpos++;
if (m_lcd.vpos > m_lcd.vpos_max) m_lcd.vpos = m_lcd.vpos_min;
m_lcd.hpos = m_lcd.hpos_min;
- scanline = &bitmap.pix32(m_lcd.vpos, m_lcd.hpos);
+ scanline = &bitmap.pix(m_lcd.vpos, m_lcd.hpos);
}
}
}
@@ -586,7 +586,7 @@ void S3C24_CLASS_NAME::s3c24xx_lcd_render_stn_12_u() // not tested
void S3C24_CLASS_NAME::s3c24xx_lcd_render_tft_01()
{
bitmap_rgb32 &bitmap = *m_lcd.bitmap[0];
- uint32_t *scanline = &bitmap.pix32(m_lcd.vpos, m_lcd.hpos);
+ uint32_t *scanline = &bitmap.pix(m_lcd.vpos, m_lcd.hpos);
for (int i = 0; i < 4; i++)
{
uint32_t data = s3c24xx_lcd_dma_read();
@@ -600,7 +600,7 @@ void S3C24_CLASS_NAME::s3c24xx_lcd_render_tft_01()
m_lcd.vpos++;
if (m_lcd.vpos > m_lcd.vpos_max) m_lcd.vpos = m_lcd.vpos_min;
m_lcd.hpos = m_lcd.hpos_min;
- scanline = &bitmap.pix32(m_lcd.vpos, m_lcd.hpos);
+ scanline = &bitmap.pix(m_lcd.vpos, m_lcd.hpos);
}
}
}
@@ -609,7 +609,7 @@ void S3C24_CLASS_NAME::s3c24xx_lcd_render_tft_01()
void S3C24_CLASS_NAME::s3c24xx_lcd_render_tft_02()
{
bitmap_rgb32 &bitmap = *m_lcd.bitmap[0];
- uint32_t *scanline = &bitmap.pix32(m_lcd.vpos, m_lcd.hpos);
+ uint32_t *scanline = &bitmap.pix(m_lcd.vpos, m_lcd.hpos);
for (int i = 0; i < 4; i++)
{
uint32_t data = s3c24xx_lcd_dma_read();
@@ -623,7 +623,7 @@ void S3C24_CLASS_NAME::s3c24xx_lcd_render_tft_02()
m_lcd.vpos++;
if (m_lcd.vpos > m_lcd.vpos_max) m_lcd.vpos = m_lcd.vpos_min;
m_lcd.hpos = m_lcd.hpos_min;
- scanline = &bitmap.pix32(m_lcd.vpos, m_lcd.hpos);
+ scanline = &bitmap.pix(m_lcd.vpos, m_lcd.hpos);
}
}
}
@@ -632,7 +632,7 @@ void S3C24_CLASS_NAME::s3c24xx_lcd_render_tft_02()
void S3C24_CLASS_NAME::s3c24xx_lcd_render_tft_04()
{
bitmap_rgb32 &bitmap = *m_lcd.bitmap[0];
- uint32_t *scanline = &bitmap.pix32(m_lcd.vpos, m_lcd.hpos);
+ uint32_t *scanline = &bitmap.pix(m_lcd.vpos, m_lcd.hpos);
for (int i = 0; i < 4; i++)
{
uint32_t data = s3c24xx_lcd_dma_read();
@@ -646,7 +646,7 @@ void S3C24_CLASS_NAME::s3c24xx_lcd_render_tft_04()
m_lcd.vpos++;
if (m_lcd.vpos > m_lcd.vpos_max) m_lcd.vpos = m_lcd.vpos_min;
m_lcd.hpos = m_lcd.hpos_min;
- scanline = &bitmap.pix32(m_lcd.vpos, m_lcd.hpos);
+ scanline = &bitmap.pix(m_lcd.vpos, m_lcd.hpos);
}
}
}
@@ -655,7 +655,7 @@ void S3C24_CLASS_NAME::s3c24xx_lcd_render_tft_04()
void S3C24_CLASS_NAME::s3c24xx_lcd_render_tft_08()
{
bitmap_rgb32 &bitmap = *m_lcd.bitmap[0];
- uint32_t *scanline = &bitmap.pix32(m_lcd.vpos, m_lcd.hpos);
+ uint32_t *scanline = &bitmap.pix(m_lcd.vpos, m_lcd.hpos);
for (int i = 0; i < 4; i++)
{
uint32_t data = s3c24xx_lcd_dma_read();
@@ -669,7 +669,7 @@ void S3C24_CLASS_NAME::s3c24xx_lcd_render_tft_08()
m_lcd.vpos++;
if (m_lcd.vpos > m_lcd.vpos_max) m_lcd.vpos = m_lcd.vpos_min;
m_lcd.hpos = m_lcd.hpos_min;
- scanline = &bitmap.pix32(m_lcd.vpos, m_lcd.hpos);
+ scanline = &bitmap.pix(m_lcd.vpos, m_lcd.hpos);
}
}
}
@@ -678,7 +678,7 @@ void S3C24_CLASS_NAME::s3c24xx_lcd_render_tft_08()
void S3C24_CLASS_NAME::s3c24xx_lcd_render_tft_16()
{
bitmap_rgb32 &bitmap = *m_lcd.bitmap[0];
- uint32_t *scanline = &bitmap.pix32(m_lcd.vpos, m_lcd.hpos);
+ uint32_t *scanline = &bitmap.pix(m_lcd.vpos, m_lcd.hpos);
for (int i = 0; i < 4; i++)
{
uint32_t data = s3c24xx_lcd_dma_read();
@@ -692,7 +692,7 @@ void S3C24_CLASS_NAME::s3c24xx_lcd_render_tft_16()
m_lcd.vpos++;
if (m_lcd.vpos > m_lcd.vpos_max) m_lcd.vpos = m_lcd.vpos_min;
m_lcd.hpos = m_lcd.hpos_min;
- scanline = &bitmap.pix32(m_lcd.vpos, m_lcd.hpos);
+ scanline = &bitmap.pix(m_lcd.vpos, m_lcd.hpos);
}
}
}
@@ -751,9 +751,9 @@ void S3C24_CLASS_NAME::bitmap_blend( bitmap_rgb32 &bitmap_dst, bitmap_rgb32 &bit
{
for (int y = 0; y < bitmap_dst.height(); y++)
{
- uint32_t *line0 = &bitmap_src_1.pix32(y);
- uint32_t *line1 = &bitmap_src_2.pix32(y);
- uint32_t *line2 = &bitmap_dst.pix32(y);
+ uint32_t const *const line0 = &bitmap_src_1.pix(y);
+ uint32_t const *const line1 = &bitmap_src_2.pix(y);
+ uint32_t *const line2 = &bitmap_dst.pix(y);
for (int x = 0; x < bitmap_dst.width(); x++)
{
uint32_t color0 = line0[x];
@@ -764,9 +764,9 @@ void S3C24_CLASS_NAME::bitmap_blend( bitmap_rgb32 &bitmap_dst, bitmap_rgb32 &bit
uint16_t r1 = (color1 >> 16) & 0x000000ff;
uint16_t g1 = (color1 >> 8) & 0x000000ff;
uint16_t b1 = (color1 >> 0) & 0x000000ff;
- uint8_t r = (uint8_t)((r0 + r1) >> 1);
- uint8_t g = (uint8_t)((g0 + g1) >> 1);
- uint8_t b = (uint8_t)((b0 + b1) >> 1);
+ uint8_t r = uint8_t((r0 + r1) >> 1);
+ uint8_t g = uint8_t((g0 + g1) >> 1);
+ uint8_t b = uint8_t((b0 + b1) >> 1);
line2[x] = (r << 16) | (g << 8) | b;
}
}
diff --git a/src/devices/machine/s3c44b0.cpp b/src/devices/machine/s3c44b0.cpp
index 6672127e20f..bf3a1ed811c 100644
--- a/src/devices/machine/s3c44b0.cpp
+++ b/src/devices/machine/s3c44b0.cpp
@@ -17,6 +17,8 @@
#include "coreutil.h"
+#include <algorithm>
+
#define S3C44B0_INTCON (0x00 / 4) // Interrupt Control
#define S3C44B0_INTPND (0x04 / 4) // Interrupt Request Status
@@ -696,8 +698,8 @@ uint32_t s3c44b0_device::video_update(screen_device &screen, bitmap_rgb32 &bitma
{
for (int y = 0; y < screen.height(); y++)
{
- uint32_t *scanline = &bitmap.pix32(y);
- uint8_t *vram = m_lcd.bitmap.get() + y * (m_lcd.hpos_max - m_lcd.hpos_min + 1);
+ uint32_t *scanline = &bitmap.pix(y);
+ uint8_t const *vram = m_lcd.bitmap.get() + y * (m_lcd.hpos_max - m_lcd.hpos_min + 1);
for (int x = 0; x < screen.width(); x++)
{
*scanline++ = rgb_t(vram[0], vram[1], vram[2]);
@@ -710,8 +712,7 @@ uint32_t s3c44b0_device::video_update(screen_device &screen, bitmap_rgb32 &bitma
{
for (int y = 0; y < screen.height(); y++)
{
- uint32_t *scanline = &bitmap.pix32(y);
- memset(scanline, 0, screen.width() * 4);
+ std::fill_n(&bitmap.pix(y), screen.width(), 0);
}
}
return 0;
diff --git a/src/devices/machine/spg110_video.cpp b/src/devices/machine/spg110_video.cpp
index a76fef3bb60..daf7fa5e158 100644
--- a/src/devices/machine/spg110_video.cpp
+++ b/src/devices/machine/spg110_video.cpp
@@ -4,6 +4,9 @@
#include "emu.h"
#include "spg110_video.h"
+#include <algorithm>
+
+
DEFINE_DEVICE_TYPE(SPG110_VIDEO, spg110_video_device, "spg110_video", "SPG110 System-on-a-Chip (Video)")
spg110_video_device::spg110_video_device(const machine_config &mconfig, device_type type, const char *tag, device_t *owner, uint32_t clock) :
@@ -649,9 +652,9 @@ uint32_t spg110_video_device::screen_update(screen_device &screen, bitmap_rgb32
for (int y = cliprect.min_y; y <= cliprect.max_y; y++)
{
- uint32_t *dest = &bitmap.pix32(y, cliprect.min_x);
- uint32_t *src = &m_screenbuf[cliprect.min_x + 320 * y];
- memcpy(dest, src, sizeof(uint32_t) * ((cliprect.max_x - cliprect.min_x) + 1));
+ uint32_t *dest = &bitmap.pix(y, cliprect.min_x);
+ const uint32_t *src = &m_screenbuf[cliprect.min_x + 320 * y];
+ std::copy_n(src, cliprect.width(), dest);
}
return 0;
diff --git a/src/devices/machine/spg290_ppu.cpp b/src/devices/machine/spg290_ppu.cpp
index 8f47d61bf18..19ff7ccb1d2 100644
--- a/src/devices/machine/spg290_ppu.cpp
+++ b/src/devices/machine/spg290_ppu.cpp
@@ -354,9 +354,9 @@ inline void spg290_ppu_device::argb1555(bitmap_rgb32 &bitmap, const rectangle &c
{
rgb_t color = rgb_t(pal5bit(argb >> 10), pal5bit(argb >> 5), pal5bit(argb >> 0));
if (blend)
- color = blend_colors(bitmap.pix32(posy, posx), color, blend);
+ color = blend_colors(bitmap.pix(posy, posx), color, blend);
- bitmap.pix32(posy, posx) = color;
+ bitmap.pix(posy, posx) = color;
}
}
@@ -366,9 +366,9 @@ inline void spg290_ppu_device::rgb565(bitmap_rgb32 &bitmap, const rectangle &cli
{
rgb_t color = rgb_t(pal5bit(rgb >> 11), pal6bit(rgb >> 5), pal5bit(rgb >> 0));
if (blend)
- color = blend_colors(bitmap.pix32(posy, posx), color, blend);
+ color = blend_colors(bitmap.pix(posy, posx), color, blend);
- bitmap.pix32(posy, posx) = color;
+ bitmap.pix(posy, posx) = color;
}
}
diff --git a/src/devices/machine/spg_renderer.cpp b/src/devices/machine/spg_renderer.cpp
index 0b6efe58c3f..78bc26438ae 100644
--- a/src/devices/machine/spg_renderer.cpp
+++ b/src/devices/machine/spg_renderer.cpp
@@ -831,7 +831,7 @@ void spg_renderer_device::update_palette_lookup()
void spg_renderer_device::apply_saturation_and_fade(bitmap_rgb32& bitmap, const rectangle& cliprect, int scanline)
{
- uint32_t* src = &bitmap.pix32(scanline, cliprect.min_x);
+ uint32_t* src = &bitmap.pix(scanline, cliprect.min_x);
for (int x = cliprect.min_x; x <= cliprect.max_x; x++)
{
diff --git a/src/devices/machine/swtpc8212.cpp b/src/devices/machine/swtpc8212.cpp
index 68af9d42e07..fffd6eefe7f 100644
--- a/src/devices/machine/swtpc8212.cpp
+++ b/src/devices/machine/swtpc8212.cpp
@@ -319,7 +319,7 @@ MC6845_UPDATE_ROW(swtpc8212_device::update_row)
else
font_color = rgb_t(0x00, 0xd0, 0x00);
}
- bitmap.pix32(y, x++) = font_color;
+ bitmap.pix(y, x++) = font_color;
data <<= 1;
}
diff --git a/src/devices/machine/tc009xlvc.cpp b/src/devices/machine/tc009xlvc.cpp
index e6fcb74a181..b2d302d3922 100644
--- a/src/devices/machine/tc009xlvc.cpp
+++ b/src/devices/machine/tc009xlvc.cpp
@@ -347,7 +347,7 @@ u32 tc0090lvc_device::screen_update(screen_device &screen, bitmap_ind16 &bitmap,
{
const int res_x = (global_flip()) ? 320 - x : x;
- bitmap.pix16(y, x) = palette().pen(m_bitmap_ram[count + (res_x & 0x1ff)]);
+ bitmap.pix(y, x) = palette().pen(m_bitmap_ram[count + (res_x & 0x1ff)]);
}
}
}
@@ -398,7 +398,7 @@ u32 tc0091lvc_device::screen_update(screen_device &screen, bitmap_ind16 &bitmap,
{
const int res_x = (global_flip()) ? 320 - x : x;
- bitmap.pix16(y, x) = palette().pen(m_bitmap_ram[count + (res_x & 0x1ff)]);
+ bitmap.pix(y, x) = palette().pen(m_bitmap_ram[count + (res_x & 0x1ff)]);
}
}
}
diff --git a/src/devices/machine/terminal.cpp b/src/devices/machine/terminal.cpp
index fd07c5bff35..ccb101d8036 100644
--- a/src/devices/machine/terminal.cpp
+++ b/src/devices/machine/terminal.cpp
@@ -276,7 +276,7 @@ uint32_t generic_terminal_device::update(screen_device &device, bitmap_rgb32 &bi
{
for (uint8_t ra = 0; ra < 10; ra++)
{
- uint32_t *p = &bitmap.pix32(sy++);
+ uint32_t *p = &bitmap.pix(sy++);
for (uint16_t x = ma; x < ma + m_width; x++)
{
diff --git a/src/devices/sound/cdp1864.cpp b/src/devices/sound/cdp1864.cpp
index e8168004811..f4a46748593 100644
--- a/src/devices/sound/cdp1864.cpp
+++ b/src/devices/sound/cdp1864.cpp
@@ -375,7 +375,7 @@ void cdp1864_device::dma_w(uint8_t data)
color = (gdata << 2) | (bdata << 1) | rdata;
}
- m_bitmap.pix32(y, sx + x) = m_palette[color];
+ m_bitmap.pix(y, sx + x) = m_palette[color];
data <<= 1;
}
diff --git a/src/devices/sound/cdp1869.cpp b/src/devices/sound/cdp1869.cpp
index 98580d7ae54..9e28aa4c048 100644
--- a/src/devices/sound/cdp1869.cpp
+++ b/src/devices/sound/cdp1869.cpp
@@ -574,29 +574,28 @@ void cdp1869_device::sound_stream_update(sound_stream &stream, std::vector<read_
void cdp1869_device::draw_line(bitmap_rgb32 &bitmap, const rectangle &rect, int x, int y, uint8_t data, int color)
{
- int i;
- pen_t fg = m_palette->pen(color);
+ pen_t const fg = m_palette->pen(color);
data <<= 2;
- for (i = 0; i < CH_WIDTH; i++)
+ for (int i = 0; i < CH_WIDTH; i++)
{
if (data & 0x80)
{
- bitmap.pix32(y, x) = fg;
+ bitmap.pix(y, x) = fg;
if (!m_fresvert)
{
- bitmap.pix32(y + 1, x) = fg;
+ bitmap.pix(y + 1, x) = fg;
}
if (!m_freshorz)
{
- bitmap.pix32(y, x + 1) = fg;
+ bitmap.pix(y, x + 1) = fg;
if (!m_fresvert)
{
- bitmap.pix32(y + 1, x + 1) = fg;
+ bitmap.pix(y + 1, x + 1) = fg;
}
}
}
diff --git a/src/devices/sound/mos6560.cpp b/src/devices/sound/mos6560.cpp
index e551df0a93d..fadef01dd20 100644
--- a/src/devices/sound/mos6560.cpp
+++ b/src/devices/sound/mos6560.cpp
@@ -173,20 +173,18 @@ inline uint8_t mos6560_device::read_colorram(offs_t offset)
void mos6560_device::draw_character( int ybegin, int yend, int ch, int yoff, int xoff, uint16_t *color )
{
- int y, code;
-
- for (y = ybegin; y <= yend; y++)
+ for (int y = ybegin; y <= yend; y++)
{
- code = read_videoram((m_chargenaddr + ch * m_charheight + y) & 0x3fff);
-
- m_bitmap.pix32(y + yoff, xoff + 0) = PALETTE_MOS[color[code >> 7]];
- m_bitmap.pix32(y + yoff, xoff + 1) = PALETTE_MOS[color[(code >> 6) & 1]];
- m_bitmap.pix32(y + yoff, xoff + 2) = PALETTE_MOS[color[(code >> 5) & 1]];
- m_bitmap.pix32(y + yoff, xoff + 3) = PALETTE_MOS[color[(code >> 4) & 1]];
- m_bitmap.pix32(y + yoff, xoff + 4) = PALETTE_MOS[color[(code >> 3) & 1]];
- m_bitmap.pix32(y + yoff, xoff + 5) = PALETTE_MOS[color[(code >> 2) & 1]];
- m_bitmap.pix32(y + yoff, xoff + 6) = PALETTE_MOS[color[(code >> 1) & 1]];
- m_bitmap.pix32(y + yoff, xoff + 7) = PALETTE_MOS[color[code & 1]];
+ int code = read_videoram((m_chargenaddr + ch * m_charheight + y) & 0x3fff);
+
+ m_bitmap.pix(y + yoff, xoff + 0) = PALETTE_MOS[color[BIT(code, 7)]];
+ m_bitmap.pix(y + yoff, xoff + 1) = PALETTE_MOS[color[BIT(code, 6)]];
+ m_bitmap.pix(y + yoff, xoff + 2) = PALETTE_MOS[color[BIT(code, 5)]];
+ m_bitmap.pix(y + yoff, xoff + 3) = PALETTE_MOS[color[BIT(code, 4)]];
+ m_bitmap.pix(y + yoff, xoff + 4) = PALETTE_MOS[color[BIT(code, 3)]];
+ m_bitmap.pix(y + yoff, xoff + 5) = PALETTE_MOS[color[BIT(code, 2)]];
+ m_bitmap.pix(y + yoff, xoff + 6) = PALETTE_MOS[color[BIT(code, 1)]];
+ m_bitmap.pix(y + yoff, xoff + 7) = PALETTE_MOS[color[BIT(code, 0)]];
}
}
@@ -197,20 +195,18 @@ void mos6560_device::draw_character( int ybegin, int yend, int ch, int yoff, int
void mos6560_device::draw_character_multi( int ybegin, int yend, int ch, int yoff, int xoff, uint16_t *color )
{
- int y, code;
-
- for (y = ybegin; y <= yend; y++)
+ for (int y = ybegin; y <= yend; y++)
{
- code = read_videoram((m_chargenaddr + ch * m_charheight + y) & 0x3fff);
-
- m_bitmap.pix32(y + yoff, xoff + 0) =
- m_bitmap.pix32(y + yoff, xoff + 1) = PALETTE_MOS[color[code >> 6]];
- m_bitmap.pix32(y + yoff, xoff + 2) =
- m_bitmap.pix32(y + yoff, xoff + 3) = PALETTE_MOS[color[(code >> 4) & 3]];
- m_bitmap.pix32(y + yoff, xoff + 4) =
- m_bitmap.pix32(y + yoff, xoff + 5) = PALETTE_MOS[color[(code >> 2) & 3]];
- m_bitmap.pix32(y + yoff, xoff + 6) =
- m_bitmap.pix32(y + yoff, xoff + 7) = PALETTE_MOS[color[code & 3]];
+ int code = read_videoram((m_chargenaddr + ch * m_charheight + y) & 0x3fff);
+
+ m_bitmap.pix(y + yoff, xoff + 0) = m_bitmap.pix(y + yoff, xoff + 1) =
+ PALETTE_MOS[color[code >> 6]];
+ m_bitmap.pix(y + yoff, xoff + 2) = m_bitmap.pix(y + yoff, xoff + 3) =
+ PALETTE_MOS[color[(code >> 4) & 3]];
+ m_bitmap.pix(y + yoff, xoff + 4) = m_bitmap.pix(y + yoff, xoff + 5) =
+ PALETTE_MOS[color[(code >> 2) & 3]];
+ m_bitmap.pix(y + yoff, xoff + 6) = m_bitmap.pix(y + yoff, xoff + 7) =
+ PALETTE_MOS[color[code & 3]];
}
}
@@ -221,9 +217,7 @@ void mos6560_device::draw_character_multi( int ybegin, int yend, int ch, int yof
void mos6560_device::drawlines( int first, int last )
{
- int line, vline;
- int offs, yoff, xoff, ybegin, yend, i, j;
- int attr, ch;
+ int line;
m_lastline = last;
if (first >= last)
@@ -231,12 +225,13 @@ void mos6560_device::drawlines( int first, int last )
for (line = first; (line < m_ypos) && (line < last); line++)
{
- for (j = 0; j < m_total_xsize; j++)
- m_bitmap.pix32(line, j) = PALETTE_MOS[m_framecolor];
+ for (int j = 0; j < m_total_xsize; j++)
+ m_bitmap.pix(line, j) = PALETTE_MOS[m_framecolor];
}
- for (vline = line - m_ypos; (line < last) && (line < m_ypos + m_ysize);)
+ for (int vline = line - m_ypos; (line < last) && (line < m_ypos + m_ysize);)
{
+ int offs, yoff, xoff, ybegin, yend;
if (m_matrix8x16)
{
offs = (vline >> 4) * m_chars_x;
@@ -254,16 +249,16 @@ void mos6560_device::drawlines( int first, int last )
if (m_xpos > 0)
{
- for (i = ybegin; i <= yend; i++)
- for (j = 0; j < m_xpos; j++)
- m_bitmap.pix32(yoff + i, j) = PALETTE_MOS[m_framecolor];
+ for (int i = ybegin; i <= yend; i++)
+ for (int j = 0; j < m_xpos; j++)
+ m_bitmap.pix(yoff + i, j) = PALETTE_MOS[m_framecolor];
}
for (xoff = m_xpos; (xoff < m_xpos + m_xsize) && (xoff < m_total_xsize); xoff += 8, offs++)
{
- ch = read_videoram((m_videoaddr + offs) & 0x3fff);
+ int ch = read_videoram((m_videoaddr + offs) & 0x3fff);
- attr = (read_colorram((m_videoaddr + offs) & 0x3fff)) & 0xf;
+ int attr = (read_colorram((m_videoaddr + offs) & 0x3fff)) & 0xf;
if (m_variant == TYPE_ATTACK_UFO)
{
@@ -301,9 +296,9 @@ void mos6560_device::drawlines( int first, int last )
if (xoff < m_total_xsize)
{
- for (i = ybegin; i <= yend; i++)
- for (j = xoff; j < m_total_xsize; j++)
- m_bitmap.pix32(yoff + i, j) = PALETTE_MOS[m_framecolor];
+ for (int i = ybegin; i <= yend; i++)
+ for (int j = xoff; j < m_total_xsize; j++)
+ m_bitmap.pix(yoff + i, j) = PALETTE_MOS[m_framecolor];
}
if (m_matrix8x16)
@@ -319,8 +314,8 @@ void mos6560_device::drawlines( int first, int last )
}
for (; line < last; line++)
- for (j = 0; j < m_total_xsize; j++)
- m_bitmap.pix32(line, j) = PALETTE_MOS[m_framecolor];
+ for (int j = 0; j < m_total_xsize; j++)
+ m_bitmap.pix(line, j) = PALETTE_MOS[m_framecolor];
}
diff --git a/src/devices/sound/mos7360.cpp b/src/devices/sound/mos7360.cpp
index 993cade8ec2..aa9604b3a78 100644
--- a/src/devices/sound/mos7360.cpp
+++ b/src/devices/sound/mos7360.cpp
@@ -513,106 +513,93 @@ void mos7360_device::sound_stream_update(sound_stream &stream, std::vector<read_
void mos7360_device::draw_character(int ybegin, int yend, int ch, int yoff, int xoff, uint16_t *color)
{
- int y, code;
-
- for (y = ybegin; y <= yend; y++)
+ for (int y = ybegin; y <= yend; y++)
{
+ int code;
if (INROM)
code = read_rom(m_chargenaddr + ch * 8 + y);
else
code = read_ram(m_chargenaddr + ch * 8 + y);
- m_bitmap.pix32(y + yoff, 0 + xoff) = PALETTE_MOS[color[code >> 7]];
- m_bitmap.pix32(y + yoff, 1 + xoff) = PALETTE_MOS[color[(code >> 6) & 1]];
- m_bitmap.pix32(y + yoff, 2 + xoff) = PALETTE_MOS[color[(code >> 5) & 1]];
- m_bitmap.pix32(y + yoff, 3 + xoff) = PALETTE_MOS[color[(code >> 4) & 1]];
- m_bitmap.pix32(y + yoff, 4 + xoff) = PALETTE_MOS[color[(code >> 3) & 1]];
- m_bitmap.pix32(y + yoff, 5 + xoff) = PALETTE_MOS[color[(code >> 2) & 1]];
- m_bitmap.pix32(y + yoff, 6 + xoff) = PALETTE_MOS[color[(code >> 1) & 1]];
- m_bitmap.pix32(y + yoff, 7 + xoff) = PALETTE_MOS[color[code & 1]];
+ m_bitmap.pix(y + yoff, 0 + xoff) = PALETTE_MOS[color[BIT(code, 7)]];
+ m_bitmap.pix(y + yoff, 1 + xoff) = PALETTE_MOS[color[BIT(code, 6)]];
+ m_bitmap.pix(y + yoff, 2 + xoff) = PALETTE_MOS[color[BIT(code, 5)]];
+ m_bitmap.pix(y + yoff, 3 + xoff) = PALETTE_MOS[color[BIT(code, 4)]];
+ m_bitmap.pix(y + yoff, 4 + xoff) = PALETTE_MOS[color[BIT(code, 3)]];
+ m_bitmap.pix(y + yoff, 5 + xoff) = PALETTE_MOS[color[BIT(code, 2)]];
+ m_bitmap.pix(y + yoff, 6 + xoff) = PALETTE_MOS[color[BIT(code, 1)]];
+ m_bitmap.pix(y + yoff, 7 + xoff) = PALETTE_MOS[color[BIT(code, 0)]];
}
}
void mos7360_device::draw_character_multi(int ybegin, int yend, int ch, int yoff, int xoff)
{
- int y, code;
-
- for (y = ybegin; y <= yend; y++)
+ for (int y = ybegin; y <= yend; y++)
{
+ int code;
if (INROM)
code = read_rom(m_chargenaddr + ch * 8 + y);
else
code = read_ram(m_chargenaddr + ch * 8 + y);
- m_bitmap.pix32(y + yoff, 0 + xoff) =
- m_bitmap.pix32(y + yoff, 1 + xoff) = PALETTE_MOS[m_multi[code >> 6]];
- m_bitmap.pix32(y + yoff, 2 + xoff) =
- m_bitmap.pix32(y + yoff, 3 + xoff) = PALETTE_MOS[m_multi[(code >> 4) & 3]];
- m_bitmap.pix32(y + yoff, 4 + xoff) =
- m_bitmap.pix32(y + yoff, 5 + xoff) = PALETTE_MOS[m_multi[(code >> 2) & 3]];
- m_bitmap.pix32(y + yoff, 6 + xoff) =
- m_bitmap.pix32(y + yoff, 7 + xoff) = PALETTE_MOS[m_multi[code & 3]];
+ m_bitmap.pix(y + yoff, 0 + xoff) = m_bitmap.pix(y + yoff, 1 + xoff) =
+ PALETTE_MOS[m_multi[code >> 6]];
+ m_bitmap.pix(y + yoff, 2 + xoff) = m_bitmap.pix(y + yoff, 3 + xoff) =
+ PALETTE_MOS[m_multi[(code >> 4) & 3]];
+ m_bitmap.pix(y + yoff, 4 + xoff) = m_bitmap.pix(y + yoff, 5 + xoff) =
+ PALETTE_MOS[m_multi[(code >> 2) & 3]];
+ m_bitmap.pix(y + yoff, 6 + xoff) = m_bitmap.pix(y + yoff, 7 + xoff) =
+ PALETTE_MOS[m_multi[code & 3]];
}
}
void mos7360_device::draw_bitmap(int ybegin, int yend, int ch, int yoff, int xoff)
{
- int y, code;
-
- for (y = ybegin; y <= yend; y++)
+ for (int y = ybegin; y <= yend; y++)
{
- code = read_ram(m_bitmapaddr + ch * 8 + y);
-
- m_bitmap.pix32(y + yoff, 0 + xoff) = PALETTE_MOS[m_c16_bitmap[code >> 7]];
- m_bitmap.pix32(y + yoff, 1 + xoff) = PALETTE_MOS[m_c16_bitmap[(code >> 6) & 1]];
- m_bitmap.pix32(y + yoff, 2 + xoff) = PALETTE_MOS[m_c16_bitmap[(code >> 5) & 1]];
- m_bitmap.pix32(y + yoff, 3 + xoff) = PALETTE_MOS[m_c16_bitmap[(code >> 4) & 1]];
- m_bitmap.pix32(y + yoff, 4 + xoff) = PALETTE_MOS[m_c16_bitmap[(code >> 3) & 1]];
- m_bitmap.pix32(y + yoff, 5 + xoff) = PALETTE_MOS[m_c16_bitmap[(code >> 2) & 1]];
- m_bitmap.pix32(y + yoff, 6 + xoff) = PALETTE_MOS[m_c16_bitmap[(code >> 1) & 1]];
- m_bitmap.pix32(y + yoff, 7 + xoff) = PALETTE_MOS[m_c16_bitmap[code & 1]];
+ int code = read_ram(m_bitmapaddr + ch * 8 + y);
+
+ m_bitmap.pix(y + yoff, 0 + xoff) = PALETTE_MOS[m_c16_bitmap[BIT(code, 7)]];
+ m_bitmap.pix(y + yoff, 1 + xoff) = PALETTE_MOS[m_c16_bitmap[BIT(code, 6)]];
+ m_bitmap.pix(y + yoff, 2 + xoff) = PALETTE_MOS[m_c16_bitmap[BIT(code, 5)]];
+ m_bitmap.pix(y + yoff, 3 + xoff) = PALETTE_MOS[m_c16_bitmap[BIT(code, 4)]];
+ m_bitmap.pix(y + yoff, 4 + xoff) = PALETTE_MOS[m_c16_bitmap[BIT(code, 3)]];
+ m_bitmap.pix(y + yoff, 5 + xoff) = PALETTE_MOS[m_c16_bitmap[BIT(code, 2)]];
+ m_bitmap.pix(y + yoff, 6 + xoff) = PALETTE_MOS[m_c16_bitmap[BIT(code, 1)]];
+ m_bitmap.pix(y + yoff, 7 + xoff) = PALETTE_MOS[m_c16_bitmap[BIT(code, 0)]];
}
}
void mos7360_device::draw_bitmap_multi(int ybegin, int yend, int ch, int yoff, int xoff)
{
- int y, code;
-
- for (y = ybegin; y <= yend; y++)
+ for (int y = ybegin; y <= yend; y++)
{
- code = read_ram(m_bitmapaddr + ch * 8 + y);
-
- m_bitmap.pix32(y + yoff, 0 + xoff) =
- m_bitmap.pix32(y + yoff, 1 + xoff) = PALETTE_MOS[m_bitmapmulti[code >> 6]];
- m_bitmap.pix32(y + yoff, 2 + xoff) =
- m_bitmap.pix32(y + yoff, 3 + xoff) = PALETTE_MOS[m_bitmapmulti[(code >> 4) & 3]];
- m_bitmap.pix32(y + yoff, 4 + xoff) =
- m_bitmap.pix32(y + yoff, 5 + xoff) = PALETTE_MOS[m_bitmapmulti[(code >> 2) & 3]];
- m_bitmap.pix32(y + yoff, 6 + xoff) =
- m_bitmap.pix32(y + yoff, 7 + xoff) = PALETTE_MOS[m_bitmapmulti[code & 3]];
+ int code = read_ram(m_bitmapaddr + ch * 8 + y);
+
+ m_bitmap.pix(y + yoff, 0 + xoff) = m_bitmap.pix(y + yoff, 1 + xoff) =
+ PALETTE_MOS[m_bitmapmulti[code >> 6]];
+ m_bitmap.pix(y + yoff, 2 + xoff) = m_bitmap.pix(y + yoff, 3 + xoff) =
+ PALETTE_MOS[m_bitmapmulti[(code >> 4) & 3]];
+ m_bitmap.pix(y + yoff, 4 + xoff) = m_bitmap.pix(y + yoff, 5 + xoff) =
+ PALETTE_MOS[m_bitmapmulti[(code >> 2) & 3]];
+ m_bitmap.pix(y + yoff, 6 + xoff) = m_bitmap.pix(y + yoff, 7 + xoff) =
+ PALETTE_MOS[m_bitmapmulti[code & 3]];
}
}
void mos7360_device::draw_cursor(int ybegin, int yend, int yoff, int xoff, int color)
{
- int y;
-
- for (y = ybegin; y <= yend; y++)
+ for (int y = ybegin; y <= yend; y++)
{
for (int x = 0; x < 8; x++)
{
- m_bitmap.pix32(y + yoff, x + xoff) = PALETTE_MOS[color];
+ m_bitmap.pix(y + yoff, x + xoff) = PALETTE_MOS[color];
}
}
}
void mos7360_device::drawlines(int first, int last)
{
- int line, vline, end;
- int attr, ch, c1, c2, ecm;
- int offs, yoff, xoff, ybegin, yend, xbegin, xend;
- int i;
-
m_lastline = last;
/* top part of display not rastered */
@@ -625,34 +612,44 @@ void mos7360_device::drawlines(int first, int last)
if (!SCREENON)
{
- for (line = first; (line < last) && (line < m_bitmap.height()); line++)
+ for (int line = first; (line < last) && (line < m_bitmap.height()); line++)
{
for (int x = 0; x < m_bitmap.width(); x++)
{
- m_bitmap.pix32(line, x) = PALETTE_MOS[FRAMECOLOR];
+ m_bitmap.pix(line, x) = PALETTE_MOS[FRAMECOLOR];
}
}
return;
}
+ int xbegin, xend;
if (COLUMNS40)
- xbegin = XPOS, xend = xbegin + 320;
+ {
+ xbegin = XPOS;
+ xend = xbegin + 320;
+ }
else
- xbegin = XPOS + 7, xend = xbegin + 304;
+ {
+ xbegin = XPOS + 7;
+ xend = xbegin + 304;
+ }
+ int end;
if (last < m_y_begin)
end = last;
else
end = m_y_begin + YPOS;
+
+ int line;
+ for (line = first; line < end; line++)
{
- for (line = first; line < end; line++)
+ for (int x = 0; x < m_bitmap.width(); x++)
{
- for (int x = 0; x < m_bitmap.width(); x++)
- {
- m_bitmap.pix32(line, x) = PALETTE_MOS[FRAMECOLOR];
- }
+ m_bitmap.pix(line, x) = PALETTE_MOS[FRAMECOLOR];
}
}
+
+ int vline;
if (LINES25)
vline = line - m_y_begin - YPOS;
else
@@ -663,23 +660,23 @@ void mos7360_device::drawlines(int first, int last)
else
end = m_y_end + YPOS;
- for (; line < end; vline = (vline + 8) & ~7, line = line + 1 + yend - ybegin)
+ for (int ybegin, yend; line < end; vline = (vline + 8) & ~7, line = line + 1 + yend - ybegin)
{
- offs = (vline >> 3) * 40;
+ int offs = (vline >> 3) * 40;
ybegin = vline & 7;
- yoff = line - ybegin;
+ int yoff = line - ybegin;
yend = (yoff + 7 < end) ? 7 : (end - yoff - 1);
/* rendering 39 characters */
/* left and right borders are overwritten later */
- for (xoff = m_x_begin + XPOS; xoff < m_x_end + XPOS; xoff += 8, offs++)
+ for (int xoff = m_x_begin + XPOS; xoff < m_x_end + XPOS; xoff += 8, offs++)
{
if (HIRESON)
{
- ch = read_ram((m_videoaddr | 0x400) + offs);
- attr = read_ram(m_videoaddr + offs);
- c1 = ((ch >> 4) & 0xf) | (attr << 4);
- c2 = (ch & 0xf) | (attr & 0x70);
+ int ch = read_ram((m_videoaddr | 0x400) + offs);
+ int attr = read_ram(m_videoaddr + offs);
+ int c1 = ((ch >> 4) & 0xf) | (attr << 4);
+ int c2 = (ch & 0xf) | (attr & 0x70);
m_bitmapmulti[1] = m_c16_bitmap[1] = c1 & 0x7f;
m_bitmapmulti[2] = m_c16_bitmap[0] = c2 & 0x7f;
if (MULTICOLORON)
@@ -693,13 +690,13 @@ void mos7360_device::drawlines(int first, int last)
}
else
{
- ch = read_ram((m_videoaddr | 0x400) + offs);
- attr = read_ram(m_videoaddr + offs);
+ int ch = read_ram((m_videoaddr | 0x400) + offs);
+ int attr = read_ram(m_videoaddr + offs);
// levente harsfalvi's docu says cursor off in ecm and multicolor
if (ECMON)
{
// hardware reverse off
- ecm = ch >> 6;
+ int ecm = ch >> 6;
m_ecmcolor[0] = m_colors[ecm];
m_ecmcolor[1] = attr & 0x7f;
draw_character(ybegin, yend, ch & ~0xc0, yoff, xoff, m_ecmcolor);
@@ -741,16 +738,16 @@ void mos7360_device::drawlines(int first, int last)
}
}
- for (i = ybegin; i <= yend; i++)
+ for (int i = ybegin; i <= yend; i++)
{
for (int x = 0; x < xbegin; x++)
{
- m_bitmap.pix32(yoff + i, x) = PALETTE_MOS[FRAMECOLOR];
+ m_bitmap.pix(yoff + i, x) = PALETTE_MOS[FRAMECOLOR];
}
for (int x = xend; x < m_bitmap.width(); x++)
{
- m_bitmap.pix32(yoff + i, x) = PALETTE_MOS[FRAMECOLOR];
+ m_bitmap.pix(yoff + i, x) = PALETTE_MOS[FRAMECOLOR];
}
}
}
@@ -764,7 +761,7 @@ void mos7360_device::drawlines(int first, int last)
{
for (int x = 0; x < m_bitmap.width(); x++)
{
- m_bitmap.pix32(line, x) = PALETTE_MOS[FRAMECOLOR];
+ m_bitmap.pix(line, x) = PALETTE_MOS[FRAMECOLOR];
}
}
}
diff --git a/src/devices/sound/vgm_visualizer.cpp b/src/devices/sound/vgm_visualizer.cpp
index c1f438f2b2c..bab3c909ddf 100644
--- a/src/devices/sound/vgm_visualizer.cpp
+++ b/src/devices/sound/vgm_visualizer.cpp
@@ -158,7 +158,7 @@ void vgmviz_device::apply_fft()
void vgmviz_device::apply_waterfall()
{
- int total_bars = FFT_LENGTH / 2;
+ const int total_bars = FFT_LENGTH / 2;
WDL_FFT_COMPLEX* bins[2] = { (WDL_FFT_COMPLEX*)m_fft_buf[0], (WDL_FFT_COMPLEX*)m_fft_buf[1] };
for (int bar = 0; bar < std::min<int>(total_bars, SCREEN_HEIGHT); bar++)
{
@@ -555,7 +555,7 @@ template <int BarSize, int SpecMode> void vgmviz_device::draw_spectrogram(bitmap
m_clear_pending = false;
}
- const pen_t *pal = m_palette->pens();
+ pen_t const *const pal = m_palette->pens();
int width = SCREEN_WIDTH;
switch (SpecMode)
@@ -563,31 +563,26 @@ template <int BarSize, int SpecMode> void vgmviz_device::draw_spectrogram(bitmap
case SPEC_VIZ_PILLAR:
for (int y = 2; y < SCREEN_HEIGHT; y++)
{
- uint32_t *src = &m_bitmap.pix32(y);
- uint32_t *dst = &bitmap.pix32(y - 2);
+ uint32_t const *const src = &m_bitmap.pix(y);
+ uint32_t *const dst = &bitmap.pix(y - 2);
for (int x = SCREEN_WIDTH - 1; x >= 1; x--)
{
dst[x] = src[x - 1];
}
}
- width = (int)(SCREEN_WIDTH * 0.75f);
+ width = int(SCREEN_WIDTH * 0.75f);
break;
case SPEC_VIZ_TOP:
for (int y = 1; y < SCREEN_HEIGHT; y++)
{
- uint32_t *src = &m_bitmap.pix32(y);
- uint32_t *dst = &bitmap.pix32(y - 1);
- for (int x = 0; x < SCREEN_WIDTH; x++)
- {
- dst[x] = src[x];
- }
+ std::copy_n(&m_bitmap.pix(y), SCREEN_WIDTH, &bitmap.pix(y - 1));
}
break;
default:
break;
}
- int total_bars = FFT_LENGTH / 2;
+ const int total_bars = FFT_LENGTH / 2;
WDL_FFT_COMPLEX *bins[2] = { (WDL_FFT_COMPLEX *)m_fft_buf[0], (WDL_FFT_COMPLEX *)m_fft_buf[1] };
for (int bar = 2; bar < total_bars && bar < width; bar += BarSize)
@@ -614,8 +609,8 @@ template <int BarSize, int SpecMode> void vgmviz_device::draw_spectrogram(bitmap
}
for (int y = 0; y < SCREEN_HEIGHT; y++)
{
- int bar_y = SCREEN_HEIGHT - y;
- uint32_t *line = &bitmap.pix32(y);
+ const int bar_y = SCREEN_HEIGHT - y;
+ uint32_t *const line = &bitmap.pix(y);
for (int x = 0; x < BarSize; x++)
{
line[(bar - 2) + x] = bar_y <= level ? pal[256 + pal_index] : pal[black_index];
@@ -631,8 +626,8 @@ template <int BarSize, int SpecMode> void vgmviz_device::draw_spectrogram(bitmap
for (int y = 0; y < SCREEN_HEIGHT; y++)
{
- int bar_y = SCREEN_HEIGHT - y;
- uint32_t *line = &bitmap.pix32(y);
+ const int bar_y = SCREEN_HEIGHT - y;
+ uint32_t *const line = &bitmap.pix(y);
line[0] = 0;
if (bar_y > level)
{
@@ -643,9 +638,9 @@ template <int BarSize, int SpecMode> void vgmviz_device::draw_spectrogram(bitmap
{
if (bar_y < (level - 1))
{
- const uint8_t r = (uint8_t)(((entry >> 16) & 0xff) * 0.75f);
- const uint8_t g = (uint8_t)(((entry >> 8) & 0xff) * 0.75f);
- const uint8_t b = (uint8_t)(((entry >> 0) & 0xff) * 0.75f);
+ const uint8_t r = uint8_t(((entry >> 16) & 0xff) * 0.75f);
+ const uint8_t g = uint8_t(((entry >> 8) & 0xff) * 0.75f);
+ const uint8_t b = uint8_t(((entry >> 0) & 0xff) * 0.75f);
line[(bar - 2) + x] = 0xff000000 | (r << 16) | (g << 8) | b;
}
else
@@ -653,9 +648,9 @@ template <int BarSize, int SpecMode> void vgmviz_device::draw_spectrogram(bitmap
line[(bar - 2) + x] = pal[256 + pal_index];
}
}
- const uint8_t r = (uint8_t)(((entry >> 16) & 0xff) * 0.5f);
- const uint8_t g = (uint8_t)(((entry >> 8) & 0xff) * 0.5f);
- const uint8_t b = (uint8_t)(((entry >> 0) & 0xff) * 0.5f);
+ const uint8_t r = uint8_t(((entry >> 16) & 0xff) * 0.5f);
+ const uint8_t g = uint8_t(((entry >> 8) & 0xff) * 0.5f);
+ const uint8_t b = uint8_t(((entry >> 0) & 0xff) * 0.5f);
line[(bar - 2) + (BarSize - 1)] = 0xff000000 | (r << 16) | (g << 8) | b;
if (bar_y < level)
{
@@ -664,10 +659,11 @@ template <int BarSize, int SpecMode> void vgmviz_device::draw_spectrogram(bitmap
}
for (int x = 0; x < SCREEN_WIDTH; x++)
{
- bitmap.pix32(SCREEN_HEIGHT - 1, x) = 0;
- bitmap.pix32(SCREEN_HEIGHT - 2, x) = 0;
+ bitmap.pix(SCREEN_HEIGHT - 1, x) = 0;
+ bitmap.pix(SCREEN_HEIGHT - 2, x) = 0;
}
- memcpy(&m_bitmap.pix32(0), &bitmap.pix32(0), sizeof(uint32_t) * SCREEN_WIDTH * SCREEN_HEIGHT);
+ for (int y = 0; y < SCREEN_HEIGHT; y++)
+ std::copy_n(&bitmap.pix(y), SCREEN_WIDTH, &m_bitmap.pix(y));
break;
case SPEC_VIZ_TOP:
level = int(raw_level * 63.0f);
@@ -678,10 +674,11 @@ template <int BarSize, int SpecMode> void vgmviz_device::draw_spectrogram(bitmap
for (int x = 0; x < BarSize; x++)
{
- bitmap.pix32(SCREEN_HEIGHT - 1, (bar - 2) + x) = level > 0 ? pal[256 + pal_index] : pal[black_index];
+ bitmap.pix(SCREEN_HEIGHT - 1, (bar - 2) + x) = level > 0 ? pal[256 + pal_index] : pal[black_index];
}
- memcpy(&m_bitmap.pix32(0), &bitmap.pix32(0), sizeof(uint32_t) * SCREEN_WIDTH * SCREEN_HEIGHT);
+ for (int y = 0; y < SCREEN_HEIGHT; y++)
+ std::copy_n(&bitmap.pix(y), SCREEN_WIDTH, &m_bitmap.pix(y));
break;
}
}
@@ -700,7 +697,7 @@ void vgmviz_device::draw_waterfall(bitmap_rgb32 &bitmap)
const int v0_index = (int)v0h;
const int v1_index = (int)v1h;
const float interp = v0h - (float)v0_index;
- uint32_t* line = &bitmap.pix32(y);
+ uint32_t* line = &bitmap.pix(y);
for (int x = 0; x < SCREEN_WIDTH; x++)
{
if (m_waterfall_length < SCREEN_WIDTH)
@@ -736,8 +733,8 @@ void vgmviz_device::draw_waveform(bitmap_rgb32 &bitmap)
for (int x = 0; x < SCREEN_WIDTH; x++)
{
- bitmap.pix32(CHANNEL_CENTER, x) = MED_GRAY;
- bitmap.pix32(CHANNEL_HEIGHT + 1 + CHANNEL_CENTER, x) = MED_GRAY;
+ bitmap.pix(CHANNEL_CENTER, x) = MED_GRAY;
+ bitmap.pix(CHANNEL_HEIGHT + 1 + CHANNEL_CENTER, x) = MED_GRAY;
const float raw_l = m_audio_buf[1 - m_audio_fill_index][0][((int)m_history_length + 1 + x) % FFT_LENGTH];
const int sample_l = (int)((raw_l - 0.5f) * (CHANNEL_HEIGHT - 1));
@@ -746,7 +743,7 @@ void vgmviz_device::draw_waveform(bitmap_rgb32 &bitmap)
int y = endy_l - sample_l;
do
{
- bitmap.pix32(y, x) = LEFT_COLOR;
+ bitmap.pix(y, x) = LEFT_COLOR;
y += dy_l;
} while(y != endy_l);
@@ -757,11 +754,11 @@ void vgmviz_device::draw_waveform(bitmap_rgb32 &bitmap)
y = endy_r - sample_r;
do
{
- bitmap.pix32(y, x) = RIGHT_COLOR;
+ bitmap.pix(y, x) = RIGHT_COLOR;
y += dy_r;
} while(y != endy_r);
- bitmap.pix32(CHANNEL_HEIGHT, x) = WHITE;
- bitmap.pix32(CHANNEL_HEIGHT + 1, x) = WHITE;
+ bitmap.pix(CHANNEL_HEIGHT, x) = WHITE;
+ bitmap.pix(CHANNEL_HEIGHT + 1, x) = WHITE;
}
}
diff --git a/src/devices/video/315_5124.cpp b/src/devices/video/315_5124.cpp
index 4e7d04bcab6..9a3a0f8c339 100644
--- a/src/devices/video/315_5124.cpp
+++ b/src/devices/video/315_5124.cpp
@@ -1723,8 +1723,8 @@ void sega315_5124_device::draw_scanline(int pixel_offset_x, int pixel_plot_y, in
void sega315_5124_device::blit_scanline(int *line_buffer, int *priority_selected, int pixel_offset_x, int pixel_plot_y, int line)
{
- u32 *p_bitmap = &m_tmpbitmap.pix32(pixel_plot_y + line, pixel_offset_x);
- u8 *p_y1 = &m_y1_bitmap.pix8(pixel_plot_y + line, pixel_offset_x);
+ u32 *const p_bitmap = &m_tmpbitmap.pix(pixel_plot_y + line, pixel_offset_x);
+ u8 *const p_y1 = &m_y1_bitmap.pix(pixel_plot_y + line, pixel_offset_x);
int x = 0;
if (m_vdp_mode == 4 && BIT(m_reg[0x00], 5))
@@ -1755,8 +1755,8 @@ void sega315_5377_device::blit_scanline(int *line_buffer, int *priority_selected
}
else
{
- u32 *p_bitmap = &m_tmpbitmap.pix32(pixel_plot_y + line, pixel_offset_x);
- u8 *p_y1 = &m_y1_bitmap.pix8(pixel_plot_y + line, pixel_offset_x);
+ u32 *const p_bitmap = &m_tmpbitmap.pix(pixel_plot_y + line, pixel_offset_x);
+ u8 *const p_y1 = &m_y1_bitmap.pix(pixel_plot_y + line, pixel_offset_x);
int x = 0;
/* border on left side of the GG active screen */
diff --git a/src/devices/video/315_5313.cpp b/src/devices/video/315_5313.cpp
index 77bd8a9094a..4360a4e78a1 100644
--- a/src/devices/video/315_5313.cpp
+++ b/src/devices/video/315_5313.cpp
@@ -2108,7 +2108,7 @@ void sega315_5313_device::render_videobuffer_to_screenbuffer(int scanline)
if (scanline >= m_render_bitmap->height()) // safety, shouldn't happen now we allocate a fixed amount tho
return;
- lineptr = &m_render_bitmap->pix32(scanline);
+ lineptr = &m_render_bitmap->pix(scanline);
}
else
lineptr = m_render_line.get();
diff --git a/src/devices/video/cdp1861.cpp b/src/devices/video/cdp1861.cpp
index 6a79087990d..03bcd3e0e90 100644
--- a/src/devices/video/cdp1861.cpp
+++ b/src/devices/video/cdp1861.cpp
@@ -248,12 +248,11 @@ void cdp1861_device::dma_w(uint8_t data)
{
int sx = screen().hpos() + 4;
int y = screen().vpos();
- int x;
- for (x = 0; x < 8; x++)
+ for (int x = 0; x < 8; x++)
{
pen_t color = BIT(data, 7) ? rgb_t::white() : rgb_t::black();
- m_bitmap.pix32(y, sx + x) = color;
+ m_bitmap.pix(y, sx + x) = color;
data <<= 1;
}
}
diff --git a/src/devices/video/cdp1862.cpp b/src/devices/video/cdp1862.cpp
index 977615955fe..66fa8d9e684 100644
--- a/src/devices/video/cdp1862.cpp
+++ b/src/devices/video/cdp1862.cpp
@@ -131,7 +131,6 @@ void cdp1862_device::dma_w(uint8_t data)
int rd = 1, bd = 1, gd = 1;
int sx = screen().hpos() + 4;
int y = screen().vpos();
- int x;
if (!m_con)
{
@@ -140,7 +139,7 @@ void cdp1862_device::dma_w(uint8_t data)
gd = m_read_gd();
}
- for (x = 0; x < 8; x++)
+ for (int x = 0; x < 8; x++)
{
int color = CDP1862_BACKGROUND_COLOR_SEQUENCE[m_bgcolor] + 8;
@@ -149,7 +148,7 @@ void cdp1862_device::dma_w(uint8_t data)
color = (gd << 2) | (bd << 1) | rd;
}
- m_bitmap.pix32(y, sx + x) = m_palette[color];
+ m_bitmap.pix(y, sx + x) = m_palette[color];
data <<= 1;
}
diff --git a/src/devices/video/cesblit.cpp b/src/devices/video/cesblit.cpp
index 4cea7aef4f5..7e0e6a2085b 100644
--- a/src/devices/video/cesblit.cpp
+++ b/src/devices/video/cesblit.cpp
@@ -213,8 +213,6 @@ void cesblit_device::do_blit()
// Draw
bitmap_ind16 &bitmap = m_bitmap[layer][buffer];
- int x,y;
- uint16_t pen;
switch (mode & 0x20)
{
@@ -227,17 +225,17 @@ void cesblit_device::do_blit()
uint8_t dst_pen = (m_color >> 8) & 0xff;
uint8_t src_pen = (m_color >> 0) & 0xff;
- for (y = y0; y != y1; y += dy)
+ for (int y = y0; y != y1; y += dy)
{
- for (x = x0; x != x1; x += dx)
+ for (int x = x0; x != x1; x += dx)
{
- pen = m_space->read_byte(addr);
+ uint16_t pen = m_space->read_byte(addr);
if (pen == src_pen)
pen = dst_pen;
if (pen != 0xff)
- bitmap.pix16((sy + y) & 0x1ff, (sx + x) & 0x1ff) = pen + color;
+ bitmap.pix((sy + y) & 0x1ff, (sx + x) & 0x1ff) = pen + color;
++addr;
}
@@ -247,14 +245,14 @@ void cesblit_device::do_blit()
{
// copy from ROM as is
- for (y = y0; y != y1; y += dy)
+ for (int y = y0; y != y1; y += dy)
{
- for (x = x0; x != x1; x += dx)
+ for (int x = x0; x != x1; x += dx)
{
- pen = m_space->read_byte(addr);
+ uint16_t pen = m_space->read_byte(addr);
if (pen != 0xff)
- bitmap.pix16((sy + y) & 0x1ff, (sx + x) & 0x1ff) = pen + color;
+ bitmap.pix((sy + y) & 0x1ff, (sx + x) & 0x1ff) = pen + color;
++addr;
}
@@ -263,16 +261,18 @@ void cesblit_device::do_blit()
break;
case 0x20: // solid fill
- pen = ((m_addr_hi >> 8) & 0xff) + color;
+ {
+ uint16_t pen = ((m_addr_hi >> 8) & 0xff) + color;
- if ((pen & 0xff) == 0xff)
- pen = 0xff;
+ if ((pen & 0xff) == 0xff)
+ pen = 0xff;
- for (y = y0; y != y1; y += dy)
- {
- for (x = x0; x != x1; x += dx)
+ for (int y = y0; y != y1; y += dy)
{
- bitmap.pix16((sy + y) & 0x1ff, (sx + x) & 0x1ff) = pen;
+ for (int x = x0; x != x1; x += dx)
+ {
+ bitmap.pix((sy + y) & 0x1ff, (sx + x) & 0x1ff) = pen;
+ }
}
}
break;
diff --git a/src/devices/video/clgd542x.cpp b/src/devices/video/clgd542x.cpp
index ace2e7a4820..eff9f5473c8 100644
--- a/src/devices/video/clgd542x.cpp
+++ b/src/devices/video/clgd542x.cpp
@@ -134,7 +134,6 @@ void cirrus_gd5428_device::device_reset()
uint32_t cirrus_gd5428_device::screen_update(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect)
{
- int x,y,bit;
uint32_t ptr = (vga.svga_intf.vram_size - 0x4000); // cursor patterns are stored in the last 16kB of VRAM
svga_device::screen_update(screen, bitmap, cliprect);
@@ -145,11 +144,11 @@ uint32_t cirrus_gd5428_device::screen_update(screen_device &screen, bitmap_rgb32
if(m_cursor_attr & 0x04) // 64x64
{
ptr += ((m_cursor_addr & 0x3c) * 256);
- for(y=0;y<64;y++)
+ for(int y=0;y<64;y++)
{
- for(x=0;x<64;x+=8)
+ for(int x=0;x<64;x+=8)
{
- for(bit=0;bit<8;bit++)
+ for(int bit=0;bit<8;bit++)
{
uint8_t pixel1 = vga.memory[ptr % vga.svga_intf.vram_size] >> (7-bit);
uint8_t pixel2 = vga.memory[(ptr+512) % vga.svga_intf.vram_size] >> (7-bit);
@@ -159,13 +158,13 @@ uint32_t cirrus_gd5428_device::screen_update(screen_device &screen, bitmap_rgb32
case 0: // transparent - do nothing
break;
case 1: // background
- bitmap.pix32(m_cursor_y+y,m_cursor_x+x+bit) = (m_ext_palette[0].red << 16) | (m_ext_palette[0].green << 8) | (m_ext_palette[0].blue);
+ bitmap.pix(m_cursor_y+y,m_cursor_x+x+bit) = (m_ext_palette[0].red << 16) | (m_ext_palette[0].green << 8) | (m_ext_palette[0].blue);
break;
case 2: // XOR
- bitmap.pix32(m_cursor_y+y,m_cursor_x+x+bit) = ~bitmap.pix32(m_cursor_y+y,m_cursor_x+x+bit);
+ bitmap.pix(m_cursor_y+y,m_cursor_x+x+bit) = ~bitmap.pix(m_cursor_y+y,m_cursor_x+x+bit);
break;
case 3: // foreground
- bitmap.pix32(m_cursor_y+y,m_cursor_x+x+bit) = (m_ext_palette[15].red << 16) | (m_ext_palette[15].green << 8) | (m_ext_palette[15].blue);
+ bitmap.pix(m_cursor_y+y,m_cursor_x+x+bit) = (m_ext_palette[15].red << 16) | (m_ext_palette[15].green << 8) | (m_ext_palette[15].blue);
break;
}
}
@@ -175,11 +174,11 @@ uint32_t cirrus_gd5428_device::screen_update(screen_device &screen, bitmap_rgb32
else
{
ptr += ((m_cursor_addr & 0x3f) * 256);
- for(y=0;y<32;y++)
+ for(int y=0;y<32;y++)
{
- for(x=0;x<32;x+=8)
+ for(int x=0;x<32;x+=8)
{
- for(bit=0;bit<8;bit++)
+ for(int bit=0;bit<8;bit++)
{
uint8_t pixel1 = vga.memory[ptr % vga.svga_intf.vram_size] >> (7-bit);
uint8_t pixel2 = vga.memory[(ptr+128) % vga.svga_intf.vram_size] >> (7-bit);
@@ -189,13 +188,13 @@ uint32_t cirrus_gd5428_device::screen_update(screen_device &screen, bitmap_rgb32
case 0: // transparent - do nothing
break;
case 1: // background
- bitmap.pix32(m_cursor_y+y,m_cursor_x+x+bit) = (m_ext_palette[0].red << 18) | (m_ext_palette[0].green << 10) | (m_ext_palette[0].blue << 2);
+ bitmap.pix(m_cursor_y+y,m_cursor_x+x+bit) = (m_ext_palette[0].red << 18) | (m_ext_palette[0].green << 10) | (m_ext_palette[0].blue << 2);
break;
case 2: // XOR
- bitmap.pix32(m_cursor_y+y,m_cursor_x+x+bit) = ~bitmap.pix32(m_cursor_y+y,m_cursor_x+x+bit);
+ bitmap.pix(m_cursor_y+y,m_cursor_x+x+bit) = ~bitmap.pix(m_cursor_y+y,m_cursor_x+x+bit);
break;
case 3: // foreground
- bitmap.pix32(m_cursor_y+y,m_cursor_x+x+bit) = (m_ext_palette[15].red << 18) | (m_ext_palette[15].green << 10) | (m_ext_palette[15].blue << 2);
+ bitmap.pix(m_cursor_y+y,m_cursor_x+x+bit) = (m_ext_palette[15].red << 18) | (m_ext_palette[15].green << 10) | (m_ext_palette[15].blue << 2);
break;
}
}
diff --git a/src/devices/video/ef9340_1.cpp b/src/devices/video/ef9340_1.cpp
index 9cc05ab747b..39fe1b752c7 100644
--- a/src/devices/video/ef9340_1.cpp
+++ b/src/devices/video/ef9340_1.cpp
@@ -357,7 +357,7 @@ void ef9340_1_device::ef9340_scanline(int vpos)
{
// Service row is disabled
for (int i = 0; i < 40 * 8; i++)
- m_tmp_bitmap.pix16(m_offset_y + vpos, m_offset_x + i) = 8;
+ m_tmp_bitmap.pix(m_offset_y + vpos, m_offset_x + i) = 8;
return;
}
}
@@ -466,7 +466,7 @@ void ef9340_1_device::ef9340_scanline(int vpos)
for (int i = 0; i < 8; i++)
{
uint16_t d = blank ? 0 : (char_data & 1) ? fg : bg;
- m_tmp_bitmap.pix16(m_offset_y + vpos, m_offset_x + x*8 + i) = d | 8;
+ m_tmp_bitmap.pix(m_offset_y + vpos, m_offset_x + x*8 + i) = d | 8;
char_data >>= 1;
}
@@ -480,7 +480,7 @@ void ef9340_1_device::ef9340_scanline(int vpos)
else
{
for (int i = 0; i < 40 * 8; i++)
- m_tmp_bitmap.pix16(m_offset_y + vpos, m_offset_x + i) = 0;
+ m_tmp_bitmap.pix(m_offset_y + vpos, m_offset_x + i) = 0;
}
// determine next h parity
@@ -499,7 +499,7 @@ uint32_t ef9340_1_device::screen_update(screen_device &screen, bitmap_ind16 &bit
// note: palette d3 is transparency (datasheet calls it "I"), this handler masks it off
for (int y = cliprect.min_y; y <= cliprect.max_y; y++)
for (int x = cliprect.min_x; x <= cliprect.max_x; x++)
- bitmap.pix16(y, x) = m_tmp_bitmap.pix16(y, x) & 7;
+ bitmap.pix(y, x) = m_tmp_bitmap.pix(y, x) & 7;
return 0;
}
diff --git a/src/devices/video/ef9345.cpp b/src/devices/video/ef9345.cpp
index 74aa3334c1c..4b8907d0da7 100644
--- a/src/devices/video/ef9345.cpp
+++ b/src/devices/video/ef9345.cpp
@@ -225,7 +225,7 @@ void ef9345_device::draw_char_40(uint8_t *c, uint16_t x, uint16_t y)
for(int i = 0; i < scan_ysize; i++)
for(int j = 0; j < scan_xsize; j++)
- m_screen_out.pix32(y * 10 + i, x * 8 + j) = palette[c[8 * i + j] & 0x07];
+ m_screen_out.pix(y * 10 + i, x * 8 + j) = palette[c[8 * i + j] & 0x07];
}
// draw a char in 80 char line mode
@@ -237,7 +237,7 @@ void ef9345_device::draw_char_80(uint8_t *c, uint16_t x, uint16_t y)
for(int i = 0; i < scan_ysize; i++)
for(int j = 0; j < scan_xsize; j++)
- m_screen_out.pix32(y * 10 + i, x * 6 + j) = palette[c[6 * i + j] & 0x07];
+ m_screen_out.pix(y * 10 + i, x * 6 + j) = palette[c[6 * i + j] & 0x07];
}
diff --git a/src/devices/video/ef9364.cpp b/src/devices/video/ef9364.cpp
index 858b7309ca6..cef0a33664e 100644
--- a/src/devices/video/ef9364.cpp
+++ b/src/devices/video/ef9364.cpp
@@ -178,30 +178,27 @@ void ef9364_device::draw_border(uint16_t line)
uint32_t ef9364_device::screen_update(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect)
{
- int x,y,r;
- unsigned char c;
-
- for( r = 0 ; r < NB_OF_ROWS ; r++ )
+ for( int r = 0 ; r < NB_OF_ROWS ; r++ )
{
- for( y = 0 ; y < 8 ; y++ )
+ for( int y = 0 ; y < 8 ; y++ )
{
- for( x = 0 ; x < NB_OF_COLUMNS * 8 ; x++ )
+ for( int x = 0 ; x < NB_OF_COLUMNS * 8 ; x++ )
{
if( ( ( x >> 3 ) != x_curs_pos ) || ( r != y_curs_pos ) || !cursor_state)
{
- c = m_textram->read_byte( ( r * NB_OF_COLUMNS ) + ( x>>3 ) );
+ unsigned char c = m_textram->read_byte( ( r * NB_OF_COLUMNS ) + ( x>>3 ) );
if( m_charset[((c&0x7F)<<3) + y] & (0x80>>(x&7)) )
- m_screen_out.pix32((r*12)+y, x) = palette[1];
+ m_screen_out.pix((r*12)+y, x) = palette[1];
else
- m_screen_out.pix32((r*12)+y, x) = palette[0];
+ m_screen_out.pix((r*12)+y, x) = palette[0];
}
else
{
if(y != 7)
- m_screen_out.pix32((r*12)+y, x) = palette[0];
+ m_screen_out.pix((r*12)+y, x) = palette[0];
else
- m_screen_out.pix32((r*12)+y, x) = palette[1];
+ m_screen_out.pix((r*12)+y, x) = palette[1];
}
}
}
diff --git a/src/devices/video/ef9365.cpp b/src/devices/video/ef9365.cpp
index a24783298d1..7697e6885e6 100644
--- a/src/devices/video/ef9365.cpp
+++ b/src/devices/video/ef9365.cpp
@@ -1156,18 +1156,15 @@ void ef9365_device::ef9365_exec(uint8_t cmd)
uint32_t ef9365_device::screen_update(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect)
{
- int i,j,ptr,p;
- unsigned char color_index;
-
- for(j=0;j<bitplane_yres;j++)
+ for(int j=0;j<bitplane_yres;j++)
{
- for(i=0;i<bitplane_xres;i++)
+ for(int i=0;i<bitplane_xres;i++)
{
- color_index = 0x00;
+ unsigned char color_index = 0x00;
- ptr = ( bitplane_xres * j ) + i;
+ int ptr = ( bitplane_xres * j ) + i;
- for( p = 0; p < nb_of_bitplanes; p++)
+ for(int p = 0; p < nb_of_bitplanes; p++)
{
if( m_videoram->read_byte( (BITPLANE_MAX_SIZE*p) + (ptr>>3)) & (0x80>>(ptr&7)))
{
@@ -1175,7 +1172,7 @@ uint32_t ef9365_device::screen_update(screen_device &screen, bitmap_rgb32 &bitma
}
}
- m_screen_out.pix32(j, i) = m_palette->pen( color_index );
+ m_screen_out.pix(j, i) = m_palette->pen( color_index );
}
}
diff --git a/src/devices/video/gb_lcd.cpp b/src/devices/video/gb_lcd.cpp
index 4f02d39bfab..06cceeca7b0 100644
--- a/src/devices/video/gb_lcd.cpp
+++ b/src/devices/video/gb_lcd.cpp
@@ -671,7 +671,7 @@ void cgb_ppu_device::device_reset()
inline void dmg_ppu_device::plot_pixel(int x, int y, uint16_t color)
{
- m_bitmap.pix16(y, x) = color;
+ m_bitmap.pix(y, x) = color;
}
diff --git a/src/devices/video/gba_lcd.cpp b/src/devices/video/gba_lcd.cpp
index ab71569a9fe..e3e46b5ceae 100644
--- a/src/devices/video/gba_lcd.cpp
+++ b/src/devices/video/gba_lcd.cpp
@@ -267,7 +267,7 @@ inline void gba_lcd_device::update_mask(uint8_t* mask, int y)
void gba_lcd_device::draw_scanline(int y)
{
- uint16_t *scanline = &m_bitmap.pix16(y);
+ uint16_t *const scanline = &m_bitmap.pix(y);
if (is_set(dispcnt::forced_blank))
{
diff --git a/src/devices/video/gf4500.cpp b/src/devices/video/gf4500.cpp
index e8c35e7ff25..b703e7cb8c3 100644
--- a/src/devices/video/gf4500.cpp
+++ b/src/devices/video/gf4500.cpp
@@ -89,12 +89,11 @@ static rgb_t gf4500_get_color_16( uint16_t data )
uint32_t gf4500_device::screen_update(screen_device &device, bitmap_rgb32 &bitmap, const rectangle &cliprect)
{
- uint16_t *vram = (uint16_t *)(m_data.get() + GF4500_FRAMEBUF_OFFSET / 4);
- int x, y;
- for (y = 0; y < 240; y++)
+ uint16_t const *vram = (uint16_t *)(m_data.get() + GF4500_FRAMEBUF_OFFSET / 4);
+ for (int y = 0; y < 240; y++)
{
- uint32_t *scanline = &bitmap.pix32(y);
- for (x = 0; x < 320; x++)
+ uint32_t *scanline = &bitmap.pix(y);
+ for (int x = 0; x < 320; x++)
{
*scanline++ = gf4500_get_color_16(*vram++);
}
diff --git a/src/devices/video/hd44102.cpp b/src/devices/video/hd44102.cpp
index 3b05f1e5e69..1bb8cbf5a4d 100644
--- a/src/devices/video/hd44102.cpp
+++ b/src/devices/video/hd44102.cpp
@@ -268,7 +268,7 @@ uint32_t hd44102_device::screen_update(screen_device &screen, bitmap_ind16 &bitm
{
int color = (m_status & STATUS_DISPLAY_OFF) ? 0 : BIT(data, z % 8);
- bitmap.pix16(sy, sx) = color;
+ bitmap.pix(sy, sx) = color;
}
z++;
diff --git a/src/devices/video/hd44352.cpp b/src/devices/video/hd44352.cpp
index 7fa4b53f1d0..1ca378723f3 100644
--- a/src/devices/video/hd44352.cpp
+++ b/src/devices/video/hd44352.cpp
@@ -152,7 +152,7 @@ uint32_t hd44352_device::screen_update(screen_device &screen, bitmap_ind16 &bitm
uint8_t d = compute_newval((m_cursor_status>>5) & 0x07, m_video_ram[a][py*16*cw + px*cw + c + m_scroll * 48], m_cursor[c]);
for (int b=0; b<8; b++)
{
- bitmap.pix16(py*8 + b, a*cw*16 + px*cw + c) = BIT(d, 7-b);
+ bitmap.pix(py*8 + b, a*cw*16 + px*cw + c) = BIT(d, 7-b);
}
}
}
@@ -163,7 +163,7 @@ uint32_t hd44352_device::screen_update(screen_device &screen, bitmap_ind16 &bitm
uint8_t d = m_video_ram[a][py*16*cw + px*cw + c + m_scroll * 48];
for (int b=0; b<8; b++)
{
- bitmap.pix16(py*8 + b, a*cw*16 + px*cw + c) = BIT(d, 7-b);
+ bitmap.pix(py*8 + b, a*cw*16 + px*cw + c) = BIT(d, 7-b);
}
}
}
diff --git a/src/devices/video/hd44780.cpp b/src/devices/video/hd44780.cpp
index 7abf8e0a979..8d6db247ba7 100644
--- a/src/devices/video/hd44780.cpp
+++ b/src/devices/video/hd44780.cpp
@@ -274,7 +274,7 @@ inline void hd44780_device::pixel_update(bitmap_ind16 &bitmap, u8 line, u8 pos,
if (m_lines <= 2)
{
if (pos < m_chars)
- bitmap.pix16(line * (line_height + 1) + y, pos * 6 + x) = state;
+ bitmap.pix(line * (line_height + 1) + y, pos * 6 + x) = state;
}
else if (m_lines <= 4)
{
@@ -287,7 +287,7 @@ inline void hd44780_device::pixel_update(bitmap_ind16 &bitmap, u8 line, u8 pos,
}
if (line < m_lines)
- bitmap.pix16(line * (line_height + 1) + y, pos * 6 + x) = state;
+ bitmap.pix(line * (line_height + 1) + y, pos * 6 + x) = state;
}
}
else
diff --git a/src/devices/video/hd61830.cpp b/src/devices/video/hd61830.cpp
index 26ee97cb22f..55bf2bbd588 100644
--- a/src/devices/video/hd61830.cpp
+++ b/src/devices/video/hd61830.cpp
@@ -360,9 +360,9 @@ uint16_t hd61830_device::draw_scanline(bitmap_ind16 &bitmap, const rectangle &cl
if(y >= 0 && y < bitmap.height())
{
if(((sx * m_hp) + x) >= 0 && ((sx * m_hp) + x) < bitmap.width())
- bitmap.pix16(y, (sx * m_hp) + x) = BIT(data1, x);
+ bitmap.pix(y, (sx * m_hp) + x) = BIT(data1, x);
if(((sx * m_hp) + x + m_hp) >= 0 && ((sx * m_hp) + x + m_hp) < bitmap.width())
- bitmap.pix16(y, (sx * m_hp) + x + m_hp) = BIT(data2, x);
+ bitmap.pix(y, (sx * m_hp) + x + m_hp) = BIT(data2, x);
}
}
}
@@ -454,7 +454,7 @@ void hd61830_device::draw_char(bitmap_ind16 &bitmap, const rectangle &cliprect,
}
if (sy < screen().height() && sx < screen().width())
- bitmap.pix16(sy, sx) = pixel;
+ bitmap.pix(sy, sx) = pixel;
}
}
}
diff --git a/src/devices/video/hd63484.cpp b/src/devices/video/hd63484.cpp
index e0b08389492..a740aaa93f9 100644
--- a/src/devices/video/hd63484.cpp
+++ b/src/devices/video/hd63484.cpp
@@ -2107,7 +2107,7 @@ void hd63484_device::draw_graphics_line(bitmap_ind16 &bitmap, const rectangle &c
if (!m_display_cb.isnull())
m_display_cb(bitmap, cliprect, y, px, data & mask);
else if (cliprect.contains(px, y))
- bitmap.pix16(y, px) = data & mask;
+ bitmap.pix(y, px) = data & mask;
data >>= bpp;
}
diff --git a/src/devices/video/hd66421.cpp b/src/devices/video/hd66421.cpp
index 22efe3689e8..6be96c81e1f 100644
--- a/src/devices/video/hd66421.cpp
+++ b/src/devices/video/hd66421.cpp
@@ -208,7 +208,7 @@ void hd66421_device::reg_dat_w(uint8_t data)
void hd66421_device::plot_pixel(bitmap_ind16 &bitmap, int x, int y, uint32_t color)
{
- bitmap.pix16(y, x) = (uint16_t)color;
+ bitmap.pix(y, x) = (uint16_t)color;
}
uint32_t hd66421_device::update_screen(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect)
diff --git a/src/devices/video/hp1ll3.cpp b/src/devices/video/hp1ll3.cpp
index 9a1952d8c25..006b8823122 100644
--- a/src/devices/video/hp1ll3.cpp
+++ b/src/devices/video/hp1ll3.cpp
@@ -810,14 +810,14 @@ uint32_t hp1ll3_device::screen_update(screen_device &screen, bitmap_ind16 &bitma
{
if (!m_enable_video)
{
- bitmap.fill(rgb_t::black());
+ bitmap.fill(0);
return 0;
}
for (int y = 0; y < m_vert_pix_total; y++)
{
int const offset = m_sad + y*m_conf[CONF_WPL];
- uint16_t *p = &m_bitmap.pix16(y);
+ uint16_t *p = &m_bitmap.pix(y);
for (int x = offset; x < offset + m_horiz_pix_total / 16; x++)
{
diff --git a/src/devices/video/huc6260.cpp b/src/devices/video/huc6260.cpp
index 1160f7edf13..08ca9abc5d9 100644
--- a/src/devices/video/huc6260.cpp
+++ b/src/devices/video/huc6260.cpp
@@ -69,7 +69,7 @@ void huc6260_device::device_timer(emu_timer &timer, device_timer_id id, int para
int hpos = screen().hpos();
int h = m_last_h;
int v = m_last_v;
- uint16_t *bitmap_line = &m_bmp->pix16(v);
+ uint16_t *bitmap_line = &m_bmp->pix(v);
while ( h != hpos || v != vpos )
{
@@ -112,7 +112,7 @@ void huc6260_device::device_timer(emu_timer &timer, device_timer_id id, int para
m_hsync_changed_cb( 1 );
m_pixel_clock = 0;
v = ( v + 1 ) % m_height;
- bitmap_line = &m_bmp->pix16(v);
+ bitmap_line = &m_bmp->pix(v);
break;
case HUC6260_HSYNC_START + 30: /* End/Start of VSync */
diff --git a/src/devices/video/huc6261.cpp b/src/devices/video/huc6261.cpp
index 42568090447..4ff0080777a 100644
--- a/src/devices/video/huc6261.cpp
+++ b/src/devices/video/huc6261.cpp
@@ -100,7 +100,7 @@ void huc6261_device::device_timer(emu_timer &timer, device_timer_id id, int para
int hpos = screen().hpos();
int h = m_last_h;
int v = m_last_v;
- uint32_t *bitmap_line = &m_bmp->pix32(v);
+ uint32_t *bitmap_line = &m_bmp->pix(v);
while ( h != hpos || v != vpos )
{
@@ -153,7 +153,7 @@ void huc6261_device::device_timer(emu_timer &timer, device_timer_id id, int para
m_huc6270_b->hsync_changed( 1 );
m_pixel_clock = 0;
v = ( v + 1 ) % m_height;
- bitmap_line = &m_bmp->pix32(v);
+ bitmap_line = &m_bmp->pix(v);
break;
case HUC6261_HSYNC_START + 30: /* End/Start of VSync */
diff --git a/src/devices/video/i8244.cpp b/src/devices/video/i8244.cpp
index 8288dd9e552..bab576103be 100644
--- a/src/devices/video/i8244.cpp
+++ b/src/devices/video/i8244.cpp
@@ -508,7 +508,7 @@ uint32_t i8244_device::screen_update(screen_device &screen, bitmap_ind16 &bitmap
if (cliprect.contains(px, scanline))
{
m_collision_map[ px ] |= 0x20;
- bitmap.pix16( scanline, px ) = color;
+ bitmap.pix( scanline, px ) = color;
}
}
}
@@ -535,7 +535,7 @@ uint32_t i8244_device::screen_update(screen_device &screen, bitmap_ind16 &bitmap
if (cliprect.contains(px, scanline))
{
m_collision_map[ px ] |= 0x20;
- bitmap.pix16( scanline, px ) = color;
+ bitmap.pix( scanline, px ) = color;
}
}
}
@@ -562,7 +562,7 @@ uint32_t i8244_device::screen_update(screen_device &screen, bitmap_ind16 &bitmap
if (cliprect.contains(px, scanline))
{
m_collision_map[ px ] |= 0x10;
- bitmap.pix16( scanline, px ) = color;
+ bitmap.pix( scanline, px ) = color;
}
}
}
@@ -619,7 +619,7 @@ uint32_t i8244_device::screen_update(screen_device &screen, bitmap_ind16 &bitmap
m_collision_status |= colx;
m_collision_map[ px ] |= 0x80;
- bitmap.pix16( scanline, px ) = color;
+ bitmap.pix( scanline, px ) = color;
}
}
}
@@ -667,7 +667,7 @@ uint32_t i8244_device::screen_update(screen_device &screen, bitmap_ind16 &bitmap
m_collision_status |= colx;
m_collision_map[ px ] |= 0x80;
- bitmap.pix16( scanline, px ) = color;
+ bitmap.pix( scanline, px ) = color;
}
}
}
@@ -726,7 +726,7 @@ uint32_t i8244_device::screen_update(screen_device &screen, bitmap_ind16 &bitmap
m_collision_status |= m_collision_map[ px ];
m_collision_map[ px ] |= mask;
- bitmap.pix16( scanline, px ) = color;
+ bitmap.pix( scanline, px ) = color;
}
}
}
diff --git a/src/devices/video/imagetek_i4100.cpp b/src/devices/video/imagetek_i4100.cpp
index 030314636c1..c742407f9fb 100644
--- a/src/devices/video/imagetek_i4100.cpp
+++ b/src/devices/video/imagetek_i4100.cpp
@@ -923,8 +923,8 @@ void imagetek_i4100_device::draw_spritegfx(screen_device &screen, bitmap_rgb32 &
for (int y = sy; y < ey; y++)
{
const u8 *source = source_base + (y_index >> 16) * width;
- u32 *dest = &bitmap.pix32(y);
- u8 *pri = &priority_bitmap.pix8(y);
+ u32 *dest = &bitmap.pix(y);
+ u8 *pri = &priority_bitmap.pix(y);
int x_index = x_index_base;
for (int x = sx; x < ex; x++)
{
@@ -1200,8 +1200,8 @@ void imagetek_i4100_device::draw_tilemap(screen_device &screen, bitmap_rgb32 &bi
int const srctilerow = srcline >> tileshift;
srcline &= tilemask;
- u32 *dst = &bitmap.pix32(y);
- u8 *priority_baseaddr = &priority_bitmap.pix8(y);
+ u32 *dst = &bitmap.pix(y);
+ u8 *priority_baseaddr = &priority_bitmap.pix(y);
for (int x = cliprect.min_x; x <= cliprect.max_x; x++)
{
diff --git a/src/devices/video/m50458.cpp b/src/devices/video/m50458.cpp
index 97e67af8a75..e2404684700 100644
--- a/src/devices/video/m50458.cpp
+++ b/src/devices/video/m50458.cpp
@@ -204,21 +204,19 @@ void m50458_device::device_validity_check(validity_checker &valid) const
void m50458_device::device_start()
{
- uint16_t tmp;
- uint8_t *pcg = memregion("m50458")->base();
- int tile;
- int yi;
- uint16_t src,dst;
+ uint8_t const *const pcg = memregion("m50458")->base();
/* Create an array for shadow gfx */
/* this will spread the source ROM into four directions (up-left, up-right, down-left, down-right) thus creating a working shadow copy */
m_shadow_gfx = make_unique_clear<uint8_t[]>(0x1200);
- for(tile=0;tile<0x80;tile++)
+ for(int tile=0;tile<0x80;tile++)
{
- for(yi=1;yi<17;yi++)
+ for(int yi=1;yi<17;yi++)
{
- src = (tile & 0x7f)*36+yi*2; /* source offset */
+ uint16_t tmp, dst;
+
+ uint16_t const src = (tile & 0x7f)*36+yi*2; /* source offset */
dst = (tile & 0x7f)*36+(yi-1)*2; /* destination offset */
@@ -331,40 +329,34 @@ WRITE_LINE_MEMBER( m50458_device::set_clock_line )
uint32_t m50458_device::screen_update(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect)
{
- int x,y;
- uint8_t *pcg = memregion("m50458")->base();
- uint8_t bg_r,bg_g,bg_b;
+ uint8_t const *const pcg = memregion("m50458")->base();
/* TODO: there's probably a way to control the brightness in this */
- bg_r = m_phase & 1 ? 0xdf : 0;
- bg_g = m_phase & 2 ? 0xdf : 0;
- bg_b = m_phase & 4 ? 0xdf : 0;
+ uint8_t const bg_r = m_phase & 1 ? 0xdf : 0;
+ uint8_t const bg_g = m_phase & 2 ? 0xdf : 0;
+ uint8_t const bg_b = m_phase & 4 ? 0xdf : 0;
bitmap.fill(rgb_t(0xff,bg_r,bg_g,bg_b),cliprect);
- for(y=0;y<12;y++)
+ for(int y=0;y<12;y++)
{
- for(x=0;x<24;x++)
+ for(int x=0;x<24;x++)
{
- int xi,yi;
- uint16_t tile;
int y_base = y;
if(y != 0 && m_scrr > 1) { y_base+=(m_scrr - 1); }
if(y_base > 11) { y_base -= 11; }
if(m_scrr && y == 11) { y_base = 0; } /* Guess: repeat line 0 if scrolling is active */
- tile = read_word(x+y_base*24);
+ uint16_t const tile = read_word(x+y_base*24);
- for(yi=0;yi<18;yi++)
+ for(int yi=0;yi<18;yi++)
{
- for(xi=4;xi<16;xi++) /* TODO: remove 4 / 16 / -4 offset once that the ROM is fixed */
+ for(int xi=4;xi<16;xi++) /* TODO: remove 4 / 16 / -4 offset once that the ROM is fixed */
{
- uint8_t pix;
- uint8_t color = (tile & 0x700) >> 8;
- uint16_t offset = ((tile & 0x7f)*36+yi*2);
- int res_y,res_x;
- uint8_t xh,yh;
+ uint8_t const color = (tile & 0x700) >> 8;
+ uint16_t const offset = ((tile & 0x7f)*36+yi*2);
+ uint8_t pix;
if(xi>=8)
pix = ((pcg[offset+1] >> (7-(xi & 0x7))) & 1) << 1;
else
@@ -382,8 +374,8 @@ uint32_t m50458_device::screen_update(screen_device &screen, bitmap_rgb32 &bitma
if(yi == 17 && tile & 0x1000) /* underline? */
pix |= 1;
- res_y = y*18+yi;
- res_x = x*12+(xi-4);
+ int res_y = y*18+yi;
+ int res_x = x*12+(xi-4);
if(y != 0 && y != 11)
{
@@ -419,9 +411,9 @@ uint32_t m50458_device::screen_update(screen_device &screen, bitmap_rgb32 &bitma
if(res_y > 215 || res_x > 288)
continue;
- for(yh=0;yh<m_vsz1+1;yh++)
- for(xh=0;xh<m_hsz1+1;xh++)
- bitmap.pix32(res_y+yh,res_x+xh) = r << 16 | g << 8 | b;
+ for(uint8_t yh=0;yh<m_vsz1+1;yh++)
+ for(uint8_t xh=0;xh<m_hsz1+1;xh++)
+ bitmap.pix(res_y+yh,res_x+xh) = r << 16 | g << 8 | b;
}
else if(y_base == 11)
{
@@ -432,9 +424,9 @@ uint32_t m50458_device::screen_update(screen_device &screen, bitmap_rgb32 &bitma
if(res_y > 215 || res_x > 288)
continue;
- for(yh=0;yh<m_vsz3+1;yh++)
- for(xh=0;xh<m_hsz3+1;xh++)
- bitmap.pix32(res_y+yh,res_x+xh) = r << 16 | g << 8 | b;
+ for(uint8_t yh=0;yh<m_vsz3+1;yh++)
+ for(uint8_t xh=0;xh<m_hsz3+1;xh++)
+ bitmap.pix(res_y+yh,res_x+xh) = r << 16 | g << 8 | b;
}
else
{
@@ -444,9 +436,9 @@ uint32_t m50458_device::screen_update(screen_device &screen, bitmap_rgb32 &bitma
if(res_y > 215 || res_x > 288)
continue;
- for(yh=0;yh<m_vsz2+1;yh++)
- for(xh=0;xh<m_hsz2+1;xh++)
- bitmap.pix32(res_y+yh,res_x+xh) = r << 16 | g << 8 | b;
+ for(uint8_t yh=0;yh<m_vsz2+1;yh++)
+ for(uint8_t xh=0;xh<m_hsz2+1;xh++)
+ bitmap.pix(res_y+yh,res_x+xh) = r << 16 | g << 8 | b;
}
}
}
diff --git a/src/devices/video/mb88303.cpp b/src/devices/video/mb88303.cpp
index 1112012db1d..16a24122306 100644
--- a/src/devices/video/mb88303.cpp
+++ b/src/devices/video/mb88303.cpp
@@ -339,7 +339,7 @@ void mb88303_device::update_bitmap(bitmap_rgb32 &bitmap, const rectangle &clipre
const uint32_t color = BIT(gfx[row], bit) ? 0xffffffff : 0;
if (!show_background() && !color)
continue;
- bitmap.pix32(bitmap_y + row + m_vert_display_pos, bitmap_x + (6 - bit) + m_horiz_display_pos) = color;
+ bitmap.pix(bitmap_y + row + m_vert_display_pos, bitmap_x + (6 - bit) + m_horiz_display_pos) = color;
}
}
}
diff --git a/src/devices/video/mb90082.cpp b/src/devices/video/mb90082.cpp
index b56e4e61409..27ef9238ec6 100644
--- a/src/devices/video/mb90082.cpp
+++ b/src/devices/video/mb90082.cpp
@@ -207,44 +207,37 @@ void mb90082_device::write(uint8_t data)
uint32_t mb90082_device::screen_update(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect)
{
- int x,y;
- uint8_t *pcg = memregion("mb90082")->base();
- uint16_t tile,attr;
- uint8_t bg_r,bg_g,bg_b;
+ uint8_t const *const pcg = memregion("mb90082")->base();
/* TODO: there's probably a way to control the brightness in this */
- bg_b = m_uc & 1 ? 0xdf : 0;
- bg_g = m_uc & 2 ? 0xdf : 0;
- bg_r = m_uc & 4 ? 0xdf : 0;
+ uint8_t const bg_b = m_uc & 1 ? 0xdf : 0;
+ uint8_t const bg_g = m_uc & 2 ? 0xdf : 0;
+ uint8_t const bg_r = m_uc & 4 ? 0xdf : 0;
bitmap.fill(rgb_t(0xff,bg_r,bg_g,bg_b),cliprect);
- for(y=0;y<12;y++)
+ for(int y=0;y<12;y++)
{
- for(x=0;x<24;x++)
+ for(int x=0;x<24;x++)
{
- int xi,yi;
-
- tile = read_word(x+y*24);
- attr = read_word((x+y*24)|0x200);
+ uint16_t tile = read_word(x+y*24);
+ uint16_t attr = read_word((x+y*24)|0x200);
/* TODO: charset hook-up is obviously WRONG so following mustn't be trusted at all */
- for(yi=0;yi<16;yi++)
+ for(int yi=0;yi<16;yi++)
{
- for(xi=0;xi<16;xi++)
+ for(int xi=0;xi<16;xi++)
{
- uint8_t pix;
- uint8_t color = (attr & 0x70) >> 4;
- uint8_t r,g,b;
+ uint8_t const color = (attr & 0x70) >> 4;
- pix = (pcg[(tile*8)+(yi >> 1)] >> (7-(xi >> 1))) & 1;
+ uint8_t const pix = (pcg[(tile*8)+(yi >> 1)] >> (7-(xi >> 1))) & 1;
/* TODO: check this */
- b = (color & 1) ? 0xff : 0;
- g = (color & 2) ? 0xff : 0;
- r = (color & 4) ? 0xff : 0;
+ uint8_t const b = (color & 1) ? 0xff : 0;
+ uint8_t const g = (color & 2) ? 0xff : 0;
+ uint8_t const r = (color & 4) ? 0xff : 0;
if(tile != 0xff && pix != 0)
- bitmap.pix32(y*16+yi,x*16+xi) = r << 16 | g << 8 | b;
+ bitmap.pix(y*16+yi,x*16+xi) = r << 16 | g << 8 | b;
}
}
}
diff --git a/src/devices/video/mb_vcu.cpp b/src/devices/video/mb_vcu.cpp
index 745675243e6..09ac807f13a 100644
--- a/src/devices/video/mb_vcu.cpp
+++ b/src/devices/video/mb_vcu.cpp
@@ -526,36 +526,33 @@ void mb_vcu_device::vbank_clear_w(uint8_t data)
uint32_t mb_vcu_device::screen_update(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect)
{
- int x,y;
- uint8_t dot;
-
bitmap.fill(m_palette->pen(0x100),cliprect);
- for(y=0;y<256;y++)
+ for(int y=0;y<256;y++)
{
- for(x=0;x<256;x++)
+ for(int x=0;x<256;x++)
{
- dot = read_byte((x >> 0)|(y<<8)|1<<16|(m_vbank ^ 1)<<18);
+ uint8_t dot = read_byte((x >> 0)|(y<<8)|1<<16|(m_vbank ^ 1)<<18);
//if(dot != 0xf)
{
dot|= m_vregs[1] << 4;
- bitmap.pix32(y,x) = m_palette->pen(dot);
+ bitmap.pix(y,x) = m_palette->pen(dot);
}
}
}
- for(y=0;y<256;y++)
+ for(int y=0;y<256;y++)
{
- for(x=0;x<256;x++)
+ for(int x=0;x<256;x++)
{
- dot = read_byte((x >> 0)|(y<<8)|0<<16|(m_vbank ^ 1)<<18);
+ uint8_t dot = read_byte((x >> 0)|(y<<8)|0<<16|(m_vbank ^ 1)<<18);
if(dot != 0xf)
{
dot|= m_vregs[1] << 4;
- bitmap.pix32(y,x) = m_palette->pen(dot);
+ bitmap.pix(y,x) = m_palette->pen(dot);
}
}
}
diff --git a/src/devices/video/mc6845.cpp b/src/devices/video/mc6845.cpp
index 01c7b36e500..4370cf6e457 100644
--- a/src/devices/video/mc6845.cpp
+++ b/src/devices/video/mc6845.cpp
@@ -1779,7 +1779,7 @@ MC6845_UPDATE_ROW( mos8563_device::vdc_update_row )
if (x < 0) x = 0;
int color = BIT(code, 7) ? fg : bg;
- bitmap.pix32(vbp + y, hbp + x) = pen(de ? color : 0);
+ bitmap.pix(vbp + y, hbp + x) = pen(de ? color : 0);
}
}
else
@@ -1815,7 +1815,7 @@ MC6845_UPDATE_ROW( mos8563_device::vdc_update_row )
if (x < 0) x = 0;
int color = BIT(data, 7) ? fg : bg;
- bitmap.pix32(vbp + y, hbp + x) = pen(de ? color : 0);
+ bitmap.pix(vbp + y, hbp + x) = pen(de ? color : 0);
if ((bit < 8) || !HSS_SEMI) data <<= 1;
}
diff --git a/src/devices/video/mc6847.h b/src/devices/video/mc6847.h
index 78a8ad57345..78fe0eac5f3 100644
--- a/src/devices/video/mc6847.h
+++ b/src/devices/video/mc6847.h
@@ -81,7 +81,7 @@ protected:
pixel_t *bitmap_addr(bitmap_rgb32 &bitmap, int y, int x)
{
- return &bitmap.pix32(y, x);
+ return &bitmap.pix(y, x);
}
static uint8_t simplify_mode(uint8_t data, uint8_t mode)
@@ -183,8 +183,8 @@ protected:
if( (mode & MODE_AS) || ((mode & (MODE_AG|MODE_GM0) ) == MODE_AG) )
{
- pixel_t *line1 = &bitmap.pix32(y + base_y, base_x);
- pixel_t *line2 = &bitmap.pix32(y + base_y + 1, base_x);
+ pixel_t *line1 = &bitmap.pix(y + base_y, base_x);
+ pixel_t *line2 = &bitmap.pix(y + base_y + 1, base_x);
std::map<std::pair<pixel_t,pixel_t>,pixel_t>::const_iterator newColor;
for( int pixel = 0; pixel < bitmap.width() - (base_x * 2); ++pixel )
diff --git a/src/devices/video/mos6566.cpp b/src/devices/video/mos6566.cpp
index b88cad06c64..a6e3c246a76 100644
--- a/src/devices/video/mos6566.cpp
+++ b/src/devices/video/mos6566.cpp
@@ -515,55 +515,37 @@ inline void mos6566_device::draw_background()
inline void mos6566_device::draw_mono( uint16_t p, uint8_t c0, uint8_t c1 )
{
- uint8_t c[2];
+ uint8_t const c[2] = { c0, c1 };
uint8_t data = m_gfx_data;
- c[0] = c0;
- c[1] = c1;
-
- m_bitmap.pix32(VIC2_RASTER_2_EMU(m_rasterline), p + 7) = PALETTE_MOS[c[data & 1]];
- m_fore_coll_buf[p + 7] = data & 1; data >>= 1;
- m_bitmap.pix32(VIC2_RASTER_2_EMU(m_rasterline), p + 6) = PALETTE_MOS[c[data & 1]];
- m_fore_coll_buf[p + 6] = data & 1; data >>= 1;
- m_bitmap.pix32(VIC2_RASTER_2_EMU(m_rasterline), p + 5) = PALETTE_MOS[c[data & 1]];
- m_fore_coll_buf[p + 5] = data & 1; data >>= 1;
- m_bitmap.pix32(VIC2_RASTER_2_EMU(m_rasterline), p + 4) = PALETTE_MOS[c[data & 1]];
- m_fore_coll_buf[p + 4] = data & 1; data >>= 1;
- m_bitmap.pix32(VIC2_RASTER_2_EMU(m_rasterline), p + 3) = PALETTE_MOS[c[data & 1]];
- m_fore_coll_buf[p + 3] = data & 1; data >>= 1;
- m_bitmap.pix32(VIC2_RASTER_2_EMU(m_rasterline), p + 2) = PALETTE_MOS[c[data & 1]];
- m_fore_coll_buf[p + 2] = data & 1; data >>= 1;
- m_bitmap.pix32(VIC2_RASTER_2_EMU(m_rasterline), p + 1) = PALETTE_MOS[c[data & 1]];
- m_fore_coll_buf[p + 1] = data & 1; data >>= 1;
- m_bitmap.pix32(VIC2_RASTER_2_EMU(m_rasterline), p + 0) = PALETTE_MOS[c[data]];
- m_fore_coll_buf[p + 0] = data & 1;
+ for (unsigned i = 0; i < 8; i++)
+ {
+ m_bitmap.pix(VIC2_RASTER_2_EMU(m_rasterline), p + 7 - i) = PALETTE_MOS[c[data & 1]];
+ m_fore_coll_buf[p + 7 - i] = data & 1;
+ data >>= 1;
+ }
}
inline void mos6566_device::draw_multi( uint16_t p, uint8_t c0, uint8_t c1, uint8_t c2, uint8_t c3 )
{
- uint8_t c[4];
+ uint8_t const c[4] = { c0, c1, c2, c3 };
uint8_t data = m_gfx_data;
- c[0] = c0;
- c[1] = c1;
- c[2] = c2;
- c[3] = c3;
-
- m_bitmap.pix32(VIC2_RASTER_2_EMU(m_rasterline), p + 7) = PALETTE_MOS[c[data & 3]];
+ m_bitmap.pix(VIC2_RASTER_2_EMU(m_rasterline), p + 7) = PALETTE_MOS[c[data & 3]];
m_fore_coll_buf[p + 7] = data & 2;
- m_bitmap.pix32(VIC2_RASTER_2_EMU(m_rasterline), p + 6) = PALETTE_MOS[c[data & 3]];
+ m_bitmap.pix(VIC2_RASTER_2_EMU(m_rasterline), p + 6) = PALETTE_MOS[c[data & 3]];
m_fore_coll_buf[p + 6] = data & 2; data >>= 2;
- m_bitmap.pix32(VIC2_RASTER_2_EMU(m_rasterline), p + 5) = PALETTE_MOS[c[data & 3]];
+ m_bitmap.pix(VIC2_RASTER_2_EMU(m_rasterline), p + 5) = PALETTE_MOS[c[data & 3]];
m_fore_coll_buf[p + 5] = data & 2;
- m_bitmap.pix32(VIC2_RASTER_2_EMU(m_rasterline), p + 4) = PALETTE_MOS[c[data & 3]];
+ m_bitmap.pix(VIC2_RASTER_2_EMU(m_rasterline), p + 4) = PALETTE_MOS[c[data & 3]];
m_fore_coll_buf[p + 4] = data & 2; data >>= 2;
- m_bitmap.pix32(VIC2_RASTER_2_EMU(m_rasterline), p + 3) = PALETTE_MOS[c[data & 3]];
+ m_bitmap.pix(VIC2_RASTER_2_EMU(m_rasterline), p + 3) = PALETTE_MOS[c[data & 3]];
m_fore_coll_buf[p + 3] = data & 2;
- m_bitmap.pix32(VIC2_RASTER_2_EMU(m_rasterline), p + 2) = PALETTE_MOS[c[data & 3]];
+ m_bitmap.pix(VIC2_RASTER_2_EMU(m_rasterline), p + 2) = PALETTE_MOS[c[data & 3]];
m_fore_coll_buf[p + 2] = data & 2; data >>= 2;
- m_bitmap.pix32(VIC2_RASTER_2_EMU(m_rasterline), p + 1) = PALETTE_MOS[c[data]];
+ m_bitmap.pix(VIC2_RASTER_2_EMU(m_rasterline), p + 1) = PALETTE_MOS[c[data]];
m_fore_coll_buf[p + 1] = data & 2;
- m_bitmap.pix32(VIC2_RASTER_2_EMU(m_rasterline), p + 0) = PALETTE_MOS[c[data]];
+ m_bitmap.pix(VIC2_RASTER_2_EMU(m_rasterline), p + 0) = PALETTE_MOS[c[data]];
m_fore_coll_buf[p + 0] = data & 2;
}
@@ -2078,57 +2060,23 @@ void mos6566_device::draw_graphics()
draw_mono(p, tmp_col, m_color_data & 0x0f);
break;
case 5:
- m_bitmap.pix32(VIC2_RASTER_2_EMU(m_rasterline), p + 7) = PALETTE_MOS[0];
- m_fore_coll_buf[p + 7] = 0;
- m_bitmap.pix32(VIC2_RASTER_2_EMU(m_rasterline), p + 6) = PALETTE_MOS[0];
- m_fore_coll_buf[p + 6] = 0;
- m_bitmap.pix32(VIC2_RASTER_2_EMU(m_rasterline), p + 5) = PALETTE_MOS[0];
- m_fore_coll_buf[p + 5] = 0;
- m_bitmap.pix32(VIC2_RASTER_2_EMU(m_rasterline), p + 4) = PALETTE_MOS[0];
- m_fore_coll_buf[p + 4] = 0;
- m_bitmap.pix32(VIC2_RASTER_2_EMU(m_rasterline), p + 3) = PALETTE_MOS[0];
- m_fore_coll_buf[p + 3] = 0;
- m_bitmap.pix32(VIC2_RASTER_2_EMU(m_rasterline), p + 2) = PALETTE_MOS[0];
- m_fore_coll_buf[p + 2] = 0;
- m_bitmap.pix32(VIC2_RASTER_2_EMU(m_rasterline), p + 1) = PALETTE_MOS[0];
- m_fore_coll_buf[p + 1] = 0;
- m_bitmap.pix32(VIC2_RASTER_2_EMU(m_rasterline), p + 0) = PALETTE_MOS[0];
- m_fore_coll_buf[p + 0] = 0;
- break;
case 6:
- m_bitmap.pix32(VIC2_RASTER_2_EMU(m_rasterline), p + 7) = PALETTE_MOS[0];
- m_fore_coll_buf[p + 7] = 0;
- m_bitmap.pix32(VIC2_RASTER_2_EMU(m_rasterline), p + 6) = PALETTE_MOS[0];
- m_fore_coll_buf[p + 6] = 0;
- m_bitmap.pix32(VIC2_RASTER_2_EMU(m_rasterline), p + 5) = PALETTE_MOS[0];
- m_fore_coll_buf[p + 5] = 0;
- m_bitmap.pix32(VIC2_RASTER_2_EMU(m_rasterline), p + 4) = PALETTE_MOS[0];
- m_fore_coll_buf[p + 4] = 0;
- m_bitmap.pix32(VIC2_RASTER_2_EMU(m_rasterline), p + 3) = PALETTE_MOS[0];
- m_fore_coll_buf[p + 3] = 0;
- m_bitmap.pix32(VIC2_RASTER_2_EMU(m_rasterline), p + 2) = PALETTE_MOS[0];
- m_fore_coll_buf[p + 2] = 0;
- m_bitmap.pix32(VIC2_RASTER_2_EMU(m_rasterline), p + 1) = PALETTE_MOS[0];
- m_fore_coll_buf[p + 1] = 0;
- m_bitmap.pix32(VIC2_RASTER_2_EMU(m_rasterline), p + 0) = PALETTE_MOS[0];
- m_fore_coll_buf[p + 0] = 0;
- break;
case 7:
- m_bitmap.pix32(VIC2_RASTER_2_EMU(m_rasterline), p + 7) = PALETTE_MOS[0];
+ m_bitmap.pix(VIC2_RASTER_2_EMU(m_rasterline), p + 7) = PALETTE_MOS[0];
m_fore_coll_buf[p + 7] = 0;
- m_bitmap.pix32(VIC2_RASTER_2_EMU(m_rasterline), p + 6) = PALETTE_MOS[0];
+ m_bitmap.pix(VIC2_RASTER_2_EMU(m_rasterline), p + 6) = PALETTE_MOS[0];
m_fore_coll_buf[p + 6] = 0;
- m_bitmap.pix32(VIC2_RASTER_2_EMU(m_rasterline), p + 5) = PALETTE_MOS[0];
+ m_bitmap.pix(VIC2_RASTER_2_EMU(m_rasterline), p + 5) = PALETTE_MOS[0];
m_fore_coll_buf[p + 5] = 0;
- m_bitmap.pix32(VIC2_RASTER_2_EMU(m_rasterline), p + 4) = PALETTE_MOS[0];
+ m_bitmap.pix(VIC2_RASTER_2_EMU(m_rasterline), p + 4) = PALETTE_MOS[0];
m_fore_coll_buf[p + 4] = 0;
- m_bitmap.pix32(VIC2_RASTER_2_EMU(m_rasterline), p + 3) = PALETTE_MOS[0];
+ m_bitmap.pix(VIC2_RASTER_2_EMU(m_rasterline), p + 3) = PALETTE_MOS[0];
m_fore_coll_buf[p + 3] = 0;
- m_bitmap.pix32(VIC2_RASTER_2_EMU(m_rasterline), p + 2) = PALETTE_MOS[0];
+ m_bitmap.pix(VIC2_RASTER_2_EMU(m_rasterline), p + 2) = PALETTE_MOS[0];
m_fore_coll_buf[p + 2] = 0;
- m_bitmap.pix32(VIC2_RASTER_2_EMU(m_rasterline), p + 1) = PALETTE_MOS[0];
+ m_bitmap.pix(VIC2_RASTER_2_EMU(m_rasterline), p + 1) = PALETTE_MOS[0];
m_fore_coll_buf[p + 1] = 0;
- m_bitmap.pix32(VIC2_RASTER_2_EMU(m_rasterline), p + 0) = PALETTE_MOS[0];
+ m_bitmap.pix(VIC2_RASTER_2_EMU(m_rasterline), p + 0) = PALETTE_MOS[0];
m_fore_coll_buf[p + 0] = 0;
break;
}
@@ -2203,12 +2151,12 @@ void mos6566_device::draw_sprites()
if (SPRITE_PRIORITY(snum))
{
if (m_fore_coll_buf[p + i] == 0)
- m_bitmap.pix32(VIC2_RASTER_2_EMU(m_rasterline), p + i) = PALETTE_MOS[col];
+ m_bitmap.pix(VIC2_RASTER_2_EMU(m_rasterline), p + i) = PALETTE_MOS[col];
m_spr_coll_buf[p + i] = sbit;
}
else
{
- m_bitmap.pix32(VIC2_RASTER_2_EMU(m_rasterline), p + i) = PALETTE_MOS[col];
+ m_bitmap.pix(VIC2_RASTER_2_EMU(m_rasterline), p + i) = PALETTE_MOS[col];
m_spr_coll_buf[p + i] = sbit;
}
}
@@ -2251,12 +2199,12 @@ void mos6566_device::draw_sprites()
if (SPRITE_PRIORITY(snum))
{
if (m_fore_coll_buf[p + i] == 0)
- m_bitmap.pix32(VIC2_RASTER_2_EMU(m_rasterline), p + i) = PALETTE_MOS[col];
+ m_bitmap.pix(VIC2_RASTER_2_EMU(m_rasterline), p + i) = PALETTE_MOS[col];
m_spr_coll_buf[p + i] = sbit;
}
else
{
- m_bitmap.pix32(VIC2_RASTER_2_EMU(m_rasterline), p + i) = PALETTE_MOS[col];
+ m_bitmap.pix(VIC2_RASTER_2_EMU(m_rasterline), p + i) = PALETTE_MOS[col];
m_spr_coll_buf[p + i] = sbit;
}
}
@@ -2282,12 +2230,12 @@ void mos6566_device::draw_sprites()
if (SPRITE_PRIORITY(snum))
{
if (m_fore_coll_buf[p + i] == 0)
- m_bitmap.pix32(VIC2_RASTER_2_EMU(m_rasterline), p + i) = PALETTE_MOS[color];
+ m_bitmap.pix(VIC2_RASTER_2_EMU(m_rasterline), p + i) = PALETTE_MOS[color];
m_spr_coll_buf[p + i] = sbit;
}
else
{
- m_bitmap.pix32(VIC2_RASTER_2_EMU(m_rasterline), p + i) = PALETTE_MOS[color];
+ m_bitmap.pix(VIC2_RASTER_2_EMU(m_rasterline), p + i) = PALETTE_MOS[color];
m_spr_coll_buf[p + i] = sbit;
}
}
@@ -2308,12 +2256,12 @@ void mos6566_device::draw_sprites()
if (SPRITE_PRIORITY(snum))
{
if (m_fore_coll_buf[p + i] == 0)
- m_bitmap.pix32(VIC2_RASTER_2_EMU(m_rasterline), p + i) = PALETTE_MOS[color];
+ m_bitmap.pix(VIC2_RASTER_2_EMU(m_rasterline), p + i) = PALETTE_MOS[color];
m_spr_coll_buf[p + i] = sbit;
}
else
{
- m_bitmap.pix32(VIC2_RASTER_2_EMU(m_rasterline), p + i) = PALETTE_MOS[color];
+ m_bitmap.pix(VIC2_RASTER_2_EMU(m_rasterline), p + i) = PALETTE_MOS[color];
m_spr_coll_buf[p + i] = sbit;
}
}
@@ -2363,12 +2311,12 @@ void mos6566_device::draw_sprites()
if (SPRITE_PRIORITY(snum))
{
if (m_fore_coll_buf[p + i] == 0)
- m_bitmap.pix32(VIC2_RASTER_2_EMU(m_rasterline), p + i) = PALETTE_MOS[col];
+ m_bitmap.pix(VIC2_RASTER_2_EMU(m_rasterline), p + i) = PALETTE_MOS[col];
m_spr_coll_buf[p + i] = sbit;
}
else
{
- m_bitmap.pix32(VIC2_RASTER_2_EMU(m_rasterline), p + i) = PALETTE_MOS[col];
+ m_bitmap.pix(VIC2_RASTER_2_EMU(m_rasterline), p + i) = PALETTE_MOS[col];
m_spr_coll_buf[p + i] = sbit;
}
}
@@ -2393,12 +2341,12 @@ void mos6566_device::draw_sprites()
if (SPRITE_PRIORITY(snum))
{
if (m_fore_coll_buf[p + i] == 0)
- m_bitmap.pix32(VIC2_RASTER_2_EMU(m_rasterline), p + i) = PALETTE_MOS[color];
+ m_bitmap.pix(VIC2_RASTER_2_EMU(m_rasterline), p + i) = PALETTE_MOS[color];
m_spr_coll_buf[p + i] = sbit;
}
else
{
- m_bitmap.pix32(VIC2_RASTER_2_EMU(m_rasterline), p + i) = PALETTE_MOS[color];
+ m_bitmap.pix(VIC2_RASTER_2_EMU(m_rasterline), p + i) = PALETTE_MOS[color];
m_spr_coll_buf[p + i] = sbit;
}
}
diff --git a/src/devices/video/msm6255.cpp b/src/devices/video/msm6255.cpp
index f7f0ee2928a..de34d079cde 100644
--- a/src/devices/video/msm6255.cpp
+++ b/src/devices/video/msm6255.cpp
@@ -328,9 +328,7 @@ void msm6255_device::draw_scanline(bitmap_ind16 &bitmap, const rectangle &clipre
uint8_t cpd = m_cpr & CPR_CPD_MASK;
uint16_t car = (m_cur << 8) | m_clr;
- int sx, x;
-
- for (sx = 0; sx < hn; sx++)
+ for (int sx = 0; sx < hn; sx++)
{
uint8_t data = read_byte(ma, ra);
@@ -345,9 +343,9 @@ void msm6255_device::draw_scanline(bitmap_ind16 &bitmap, const rectangle &clipre
}
}
- for (x = 0; x < hp; x++)
+ for (int x = 0; x < hp; x++)
{
- bitmap.pix16(y, (sx * hp) + x) = BIT(data, 7);
+ bitmap.pix(y, (sx * hp) + x) = BIT(data, 7);
data <<= 1;
}
diff --git a/src/devices/video/nt7534.cpp b/src/devices/video/nt7534.cpp
index e777aac55dc..15fd1fb41e5 100644
--- a/src/devices/video/nt7534.cpp
+++ b/src/devices/video/nt7534.cpp
@@ -148,7 +148,7 @@ uint32_t nt7534_device::screen_update(screen_device &screen, bitmap_ind16 &bitma
{
uint8_t py = (y + m_display_start_line - 32) % 65;
uint8_t page = py/8;
- bitmap.pix16(y, x) = BIT(m_ddram[page*132 + px], py%8);
+ bitmap.pix(y, x) = BIT(m_ddram[page*132 + px], py%8);
}
}
diff --git a/src/devices/video/pc_vga.cpp b/src/devices/video/pc_vga.cpp
index 33f2f48d999..9f0bf5c48a7 100644
--- a/src/devices/video/pc_vga.cpp
+++ b/src/devices/video/pc_vga.cpp
@@ -449,42 +449,37 @@ uint32_t vga_device::start_addr()
void vga_device::vga_vh_text(bitmap_rgb32 &bitmap, const rectangle &cliprect)
{
- uint8_t ch, attr;
- uint8_t bits;
- uint32_t font_base;
- uint32_t *bitmapline;
int width=VGA_CH_WIDTH, height = (vga.crtc.maximum_scan_line) * (vga.crtc.scan_doubling + 1);
- int pos, line, column, mask, w, h, addr;
- uint8_t blink_en,fore_col,back_col;
- pen_t pen;
if(vga.crtc.cursor_enable)
vga.cursor.visible = screen().frame_number() & 0x10;
else
vga.cursor.visible = 0;
- for (addr = vga.crtc.start_addr, line = -vga.crtc.preset_row_scan; line < TEXT_LINES;
+ for (int addr = vga.crtc.start_addr, line = -vga.crtc.preset_row_scan; line < TEXT_LINES;
line += height, addr += (offset()>>1))
{
- for (pos = addr, column=0; column<TEXT_COLUMNS; column++, pos++)
+ for (int pos = addr, column=0; column<TEXT_COLUMNS; column++, pos++)
{
- ch = vga.memory[(pos<<1) + 0];
- attr = vga.memory[(pos<<1) + 1];
- font_base = 0x20000+(ch<<5);
+ uint8_t ch = vga.memory[(pos<<1) + 0];
+ uint8_t attr = vga.memory[(pos<<1) + 1];
+ uint32_t font_base = 0x20000+(ch<<5);
font_base += ((attr & 8) ? vga.sequencer.char_sel.A : vga.sequencer.char_sel.B)*0x2000;
- blink_en = (vga.attribute.data[0x10]&8&&screen().frame_number() & 0x20) ? attr & 0x80 : 0;
+ uint8_t blink_en = (vga.attribute.data[0x10]&8&&screen().frame_number() & 0x20) ? attr & 0x80 : 0;
- fore_col = attr & 0xf;
- back_col = (attr & 0x70) >> 4;
+ uint8_t fore_col = attr & 0xf;
+ uint8_t back_col = (attr & 0x70) >> 4;
back_col |= (vga.attribute.data[0x10]&8) ? 0 : ((attr & 0x80) >> 4);
- for (h = std::max(-line, 0); (h < height) && (line+h < std::min(TEXT_LINES, bitmap.height())); h++)
+ for (int h = std::max(-line, 0); (h < height) && (line+h < std::min(TEXT_LINES, bitmap.height())); h++)
{
- bitmapline = &bitmap.pix32(line+h);
- bits = vga.memory[font_base+(h>>(vga.crtc.scan_doubling))];
+ uint32_t *const bitmapline = &bitmap.pix(line+h);
+ uint8_t bits = vga.memory[font_base+(h>>(vga.crtc.scan_doubling))];
+ int mask, w;
for (mask=0x80, w=0; (w<width)&&(w<8); w++, mask>>=1)
{
+ pen_t pen;
if (bits&mask)
pen = vga.pens[blink_en ? back_col : fore_col];
else
@@ -498,6 +493,7 @@ void vga_device::vga_vh_text(bitmap_rgb32 &bitmap, const rectangle &cliprect)
if (w<width)
{
/* 9 column */
+ pen_t pen;
if (TEXT_COPY_9COLUMN(ch)&&(bits&1))
pen = vga.pens[blink_en ? back_col : fore_col];
else
@@ -510,7 +506,7 @@ void vga_device::vga_vh_text(bitmap_rgb32 &bitmap, const rectangle &cliprect)
}
if (vga.cursor.visible&&(pos==vga.crtc.cursor_addr))
{
- for (h=vga.crtc.cursor_scan_start;
+ for (int h=vga.crtc.cursor_scan_start;
(h<=vga.crtc.cursor_scan_end)&&(h<height)&&(line+h<TEXT_LINES);
h++)
{
@@ -525,34 +521,29 @@ void vga_device::vga_vh_text(bitmap_rgb32 &bitmap, const rectangle &cliprect)
void vga_device::vga_vh_ega(bitmap_rgb32 &bitmap, const rectangle &cliprect)
{
- int pos, line, column, c, addr, i, yi;
int height = vga.crtc.maximum_scan_line * (vga.crtc.scan_doubling + 1);
- uint32_t *bitmapline;
- pen_t pen;
int pel_shift = (vga.attribute.pel_shift & 7);
// popmessage("%08x %02x",EGA_START_ADDRESS,pel_shift);
/**/
- for (addr=EGA_START_ADDRESS, pos=0, line=0; line<LINES;
- line += height, addr += offset())
+ for (int addr=EGA_START_ADDRESS, line=0; line<LINES; line += height, addr += offset())
{
- for(yi=0;yi<height;yi++)
+ for (int yi=0;yi<height;yi++)
{
- bitmapline = &bitmap.pix32(line + yi);
+ uint32_t *const bitmapline = &bitmap.pix(line + yi);
- for (pos=addr, c=0, column=0; column<EGA_COLUMNS+1; column++, c+=8, pos=(pos+1)&0xffff)
+ for (int pos=addr, c=0, column=0; column<EGA_COLUMNS+1; column++, c+=8, pos=(pos+1)&0xffff)
{
- int data[4];
+ int data[4] = {
+ vga.memory[(pos & 0xffff)],
+ vga.memory[(pos & 0xffff)+0x10000]<<1,
+ vga.memory[(pos & 0xffff)+0x20000]<<2,
+ vga.memory[(pos & 0xffff)+0x30000]<<3 };
- data[0]=vga.memory[(pos & 0xffff)];
- data[1]=vga.memory[(pos & 0xffff)+0x10000]<<1;
- data[2]=vga.memory[(pos & 0xffff)+0x20000]<<2;
- data[3]=vga.memory[(pos & 0xffff)+0x30000]<<3;
-
- for (i = 7; i >= 0; i--)
+ for (int i = 7; i >= 0; i--)
{
- pen = vga.pens[(data[0]&1) | (data[1]&2) | (data[2]&4) | (data[3]&8)];
+ pen_t pen = vga.pens[(data[0]&1) | (data[1]&2) | (data[2]&4) | (data[3]&8)];
data[0]>>=1;
data[1]>>=1;
@@ -571,26 +562,21 @@ void vga_device::vga_vh_ega(bitmap_rgb32 &bitmap, const rectangle &cliprect)
/* TODO: I'm guessing that in 256 colors mode every pixel actually outputs two pixels. Is it right? */
void vga_device::vga_vh_vga(bitmap_rgb32 &bitmap, const rectangle &cliprect)
{
- int pos, line, column, c, addr, curr_addr;
- uint32_t *bitmapline;
- uint16_t mask_comp;
int height = vga.crtc.maximum_scan_line * (vga.crtc.scan_doubling + 1);
- int yi;
- int xi;
int pel_shift = (vga.attribute.pel_shift & 6);
int addrmask = vga.crtc.no_wrap ? -1 : 0xffff;
/* line compare is screen sensitive */
- mask_comp = 0x3ff; //| (LINES & 0x300);
+ uint16_t mask_comp = 0x3ff; //| (LINES & 0x300);
// popmessage("%02x %02x",vga.attribute.pel_shift,vga.sequencer.data[4] & 0x08);
- curr_addr = 0;
+ int curr_addr = 0;
if(!(vga.sequencer.data[4] & 0x08))
{
- for (addr = start_addr(), line=0; line<LINES; line+=height, addr+=offset(), curr_addr+=offset())
+ for (int addr = start_addr(), line=0; line<LINES; line+=height, addr+=offset(), curr_addr+=offset())
{
- for(yi = 0;yi < height; yi++)
+ for(int yi = 0;yi < height; yi++)
{
if((line + yi) < (vga.crtc.line_compare & mask_comp))
curr_addr = addr;
@@ -599,15 +585,15 @@ void vga_device::vga_vh_vga(bitmap_rgb32 &bitmap, const rectangle &cliprect)
curr_addr = 0;
pel_shift = 0;
}
- bitmapline = &bitmap.pix32(line + yi);
- for (pos=curr_addr, c=0, column=0; column<VGA_COLUMNS+1; column++, c+=8, pos++)
+ uint32_t *const bitmapline = &bitmap.pix(line + yi);
+ for (int pos=curr_addr, c=0, column=0; column<VGA_COLUMNS+1; column++, c+=8, pos++)
{
if(pos > 0x80000/4)
return;
- for(xi=0;xi<8;xi++)
+ for(int xi=0;xi<8;xi++)
{
- if(!screen().visible_area().contains(c+xi-(pel_shift), line + yi))
+ if (!screen().visible_area().contains(c+xi-(pel_shift), line + yi))
continue;
bitmapline[c+xi-(pel_shift)] = pen(vga.memory[(pos & addrmask)+((xi >> 1)*0x10000)]);
}
@@ -617,22 +603,22 @@ void vga_device::vga_vh_vga(bitmap_rgb32 &bitmap, const rectangle &cliprect)
}
else
{
- for (addr = start_addr(), line=0; line<LINES; line+=height, addr+=offset(), curr_addr+=offset())
+ for (int addr = start_addr(), line=0; line<LINES; line+=height, addr+=offset(), curr_addr+=offset())
{
- for(yi = 0;yi < height; yi++)
+ for(int yi = 0;yi < height; yi++)
{
if((line + yi) < (vga.crtc.line_compare & mask_comp))
curr_addr = addr;
if((line + yi) == (vga.crtc.line_compare & mask_comp))
curr_addr = 0;
- bitmapline = &bitmap.pix32(line + yi);
+ uint32_t *const bitmapline = &bitmap.pix(line + yi);
//addr %= 0x80000;
- for (pos=curr_addr, c=0, column=0; column<VGA_COLUMNS+1; column++, c+=0x10, pos+=0x8)
+ for (int pos=curr_addr, c=0, column=0; column<VGA_COLUMNS+1; column++, c+=0x10, pos+=0x8)
{
if(pos + 0x08 > 0x80000)
return;
- for(xi=0;xi<0x10;xi++)
+ for (int xi=0;xi<0x10;xi++)
{
if(!screen().visible_area().contains(c+xi-(pel_shift), line + yi))
continue;
@@ -646,28 +632,23 @@ void vga_device::vga_vh_vga(bitmap_rgb32 &bitmap, const rectangle &cliprect)
void vga_device::vga_vh_cga(bitmap_rgb32 &bitmap, const rectangle &cliprect)
{
- uint32_t *bitmapline;
int height = (vga.crtc.scan_doubling + 1);
- int x,xi,y,yi;
- uint32_t addr;
- pen_t pen;
- int width;
- width = (vga.crtc.horz_disp_end + 1) * 8;
+ int width = (vga.crtc.horz_disp_end + 1) * 8;
- for(y=0;y<LINES;y++)
+ for(int y=0;y<LINES;y++)
{
- addr = ((y & 1) * 0x2000) + (((y & ~1) >> 1) * width/4);
+ uint32_t addr = ((y & 1) * 0x2000) + (((y & ~1) >> 1) * width/4);
- for(x=0;x<width;x+=4)
+ for(int x=0;x<width;x+=4)
{
- for(yi=0;yi<height;yi++)
+ for(int yi=0;yi<height;yi++)
{
- bitmapline = &bitmap.pix32(y * height + yi);
+ uint32_t *const bitmapline = &bitmap.pix(y * height + yi);
- for(xi=0;xi<4;xi++)
+ for(int xi=0;xi<4;xi++)
{
- pen = vga.pens[(vga.memory[addr] >> (6-xi*2)) & 3];
+ pen_t pen = vga.pens[(vga.memory[addr] >> (6-xi*2)) & 3];
if(!screen().visible_area().contains(x+xi, y * height + yi))
continue;
bitmapline[x+xi] = pen;
@@ -681,28 +662,23 @@ void vga_device::vga_vh_cga(bitmap_rgb32 &bitmap, const rectangle &cliprect)
void vga_device::vga_vh_mono(bitmap_rgb32 &bitmap, const rectangle &cliprect)
{
- uint32_t *bitmapline;
int height = (vga.crtc.scan_doubling + 1);
- int x,xi,y,yi;
- uint32_t addr;
- pen_t pen;
- int width;
- width = (vga.crtc.horz_disp_end + 1) * 8;
+ int width = (vga.crtc.horz_disp_end + 1) * 8;
- for(y=0;y<LINES;y++)
+ for(int y=0;y<LINES;y++)
{
- addr = ((y & 1) * 0x2000) + (((y & ~1) >> 1) * width/8);
+ uint32_t addr = ((y & 1) * 0x2000) + (((y & ~1) >> 1) * width/8);
- for(x=0;x<width;x+=8)
+ for(int x=0;x<width;x+=8)
{
- for(yi=0;yi<height;yi++)
+ for(int yi=0;yi<height;yi++)
{
- bitmapline = &bitmap.pix32(y * height + yi);
+ uint32_t *const bitmapline = &bitmap.pix(y * height + yi);
- for(xi=0;xi<8;xi++)
+ for(int xi=0;xi<8;xi++)
{
- pen = vga.pens[(vga.memory[addr] >> (7-xi)) & 1];
+ pen_t pen = vga.pens[(vga.memory[addr] >> (7-xi)) & 1];
if(!screen().visible_area().contains(x+xi, y * height + yi))
continue;
bitmapline[x+xi] = pen;
@@ -716,18 +692,12 @@ void vga_device::vga_vh_mono(bitmap_rgb32 &bitmap, const rectangle &cliprect)
void svga_device::svga_vh_rgb8(bitmap_rgb32 &bitmap, const rectangle &cliprect)
{
- int pos, line, column, c, addr, curr_addr;
- uint32_t *bitmapline;
- uint16_t mask_comp;
int height = vga.crtc.maximum_scan_line * (vga.crtc.scan_doubling + 1);
- int yi;
- int xi;
- uint8_t start_shift;
-// uint16_t line_length;
/* line compare is screen sensitive */
- mask_comp = 0x3ff;
- curr_addr = 0;
+ uint16_t mask_comp = 0x3ff;
+ int curr_addr = 0;
+// uint16_t line_length;
// if(vga.crtc.dw)
// line_length = vga.crtc.offset << 3; // doubleword mode
// else
@@ -735,29 +705,27 @@ void svga_device::svga_vh_rgb8(bitmap_rgb32 &bitmap, const rectangle &cliprect)
// line_length = vga.crtc.offset << 4;
// }
- start_shift = (!(vga.sequencer.data[4] & 0x08)) ? 2 : 0;
+ uint8_t start_shift = (!(vga.sequencer.data[4] & 0x08)) ? 2 : 0;
+ for (int addr = VGA_START_ADDRESS << start_shift, line=0; line<LINES; line+=height, addr+=offset(), curr_addr+=offset())
{
- for (addr = VGA_START_ADDRESS << start_shift, line=0; line<LINES; line+=height, addr+=offset(), curr_addr+=offset())
+ for (int yi = 0;yi < height; yi++)
{
- for(yi = 0;yi < height; yi++)
+ if((line + yi) < (vga.crtc.line_compare & mask_comp))
+ curr_addr = addr;
+ if((line + yi) == (vga.crtc.line_compare & mask_comp))
+ curr_addr = 0;
+ uint32_t *const bitmapline = &bitmap.pix(line + yi);
+ addr %= vga.svga_intf.vram_size;
+ for (int pos=curr_addr, c=0, column=0; column<VGA_COLUMNS; column++, c+=8, pos+=0x8)
{
- if((line + yi) < (vga.crtc.line_compare & mask_comp))
- curr_addr = addr;
- if((line + yi) == (vga.crtc.line_compare & mask_comp))
- curr_addr = 0;
- bitmapline = &bitmap.pix32(line + yi);
- addr %= vga.svga_intf.vram_size;
- for (pos=curr_addr, c=0, column=0; column<VGA_COLUMNS; column++, c+=8, pos+=0x8)
- {
- if(pos + 0x08 >= vga.svga_intf.vram_size)
- return;
+ if(pos + 0x08 >= vga.svga_intf.vram_size)
+ return;
- for(xi=0;xi<8;xi++)
- {
- if(!screen().visible_area().contains(c+xi, line + yi))
- continue;
- bitmapline[c+xi] = pen(vga.memory[(pos+(xi))]);
- }
+ for (int xi=0;xi<8;xi++)
+ {
+ if(!screen().visible_area().contains(c+xi, line + yi))
+ continue;
+ bitmapline[c+xi] = pen(vga.memory[(pos+(xi))]);
}
}
}
@@ -767,38 +735,29 @@ void svga_device::svga_vh_rgb8(bitmap_rgb32 &bitmap, const rectangle &cliprect)
void svga_device::svga_vh_rgb15(bitmap_rgb32 &bitmap, const rectangle &cliprect)
{
#define MV(x) (vga.memory[x]+(vga.memory[x+1]<<8))
- #define IV 0xff000000
+ constexpr uint32_t IV = 0xff000000;
int height = vga.crtc.maximum_scan_line * (vga.crtc.scan_doubling + 1);
- int xi;
- int yi;
- int xm;
- int pos, line, column, c, addr, curr_addr;
-
- uint32_t *bitmapline;
-// uint16_t mask_comp;
/* line compare is screen sensitive */
-// mask_comp = 0xff | (TLINES & 0x300);
- curr_addr = 0;
- yi=0;
- for (addr = TGA_START_ADDRESS, line=0; line<TLINES; line+=height, addr+=offset(), curr_addr+=offset())
+// uint16_t mask_comp = 0xff | (TLINES & 0x300);
+ int curr_addr = 0;
+ int yi=0;
+ for (int addr = TGA_START_ADDRESS, line=0; line<TLINES; line+=height, addr+=offset(), curr_addr+=offset())
{
- bitmapline = &bitmap.pix32(line);
+ uint32_t *const bitmapline = &bitmap.pix(line);
addr %= vga.svga_intf.vram_size;
- for (pos=addr, c=0, column=0; column<TGA_COLUMNS; column++, c+=8, pos+=0x10)
+ for (int pos=addr, c=0, column=0; column<TGA_COLUMNS; column++, c+=8, pos+=0x10)
{
if(pos + 0x10 >= vga.svga_intf.vram_size)
return;
- for(xi=0,xm=0;xi<8;xi++,xm+=2)
+ for(int xi=0,xm=0;xi<8;xi++,xm+=2)
{
- int r,g,b;
-
if(!screen().visible_area().contains(c+xi, line + yi))
continue;
- r = (MV(pos+xm)&0x7c00)>>10;
- g = (MV(pos+xm)&0x03e0)>>5;
- b = (MV(pos+xm)&0x001f)>>0;
+ int r = (MV(pos+xm)&0x7c00)>>10;
+ int g = (MV(pos+xm)&0x03e0)>>5;
+ int b = (MV(pos+xm)&0x001f)>>0;
r = (r << 3) | (r & 0x7);
g = (g << 3) | (g & 0x7);
b = (b << 3) | (b & 0x7);
@@ -811,38 +770,29 @@ void svga_device::svga_vh_rgb15(bitmap_rgb32 &bitmap, const rectangle &cliprect)
void svga_device::svga_vh_rgb16(bitmap_rgb32 &bitmap, const rectangle &cliprect)
{
#define MV(x) (vga.memory[x]+(vga.memory[x+1]<<8))
- #define IV 0xff000000
+ constexpr uint32_t IV = 0xff000000;
int height = vga.crtc.maximum_scan_line * (vga.crtc.scan_doubling + 1);
- int xi;
- int yi;
- int xm;
- int pos, line, column, c, addr, curr_addr;
-
- uint32_t *bitmapline;
-// uint16_t mask_comp;
/* line compare is screen sensitive */
-// mask_comp = 0xff | (TLINES & 0x300);
- curr_addr = 0;
- yi=0;
- for (addr = TGA_START_ADDRESS, line=0; line<TLINES; line+=height, addr+=offset(), curr_addr+=offset())
+// uint16_t mask_comp = 0xff | (TLINES & 0x300);
+ int curr_addr = 0;
+ int yi=0;
+ for (int addr = TGA_START_ADDRESS, line=0; line<TLINES; line+=height, addr+=offset(), curr_addr+=offset())
{
- bitmapline = &bitmap.pix32(line);
+ uint32_t *const bitmapline = &bitmap.pix(line);
addr %= vga.svga_intf.vram_size;
- for (pos=addr, c=0, column=0; column<TGA_COLUMNS; column++, c+=8, pos+=0x10)
+ for (int pos=addr, c=0, column=0; column<TGA_COLUMNS; column++, c+=8, pos+=0x10)
{
if(pos + 0x10 >= vga.svga_intf.vram_size)
return;
- for(xi=0,xm=0;xi<8;xi++,xm+=2)
+ for (int xi=0,xm=0;xi<8;xi++,xm+=2)
{
- int r,g,b;
-
if(!screen().visible_area().contains(c+xi, line + yi))
continue;
- r = (MV(pos+xm)&0xf800)>>11;
- g = (MV(pos+xm)&0x07e0)>>5;
- b = (MV(pos+xm)&0x001f)>>0;
+ int r = (MV(pos+xm)&0xf800)>>11;
+ int g = (MV(pos+xm)&0x07e0)>>5;
+ int b = (MV(pos+xm)&0x001f)>>0;
r = (r << 3) | (r & 0x7);
g = (g << 2) | (g & 0x3);
b = (b << 3) | (b & 0x7);
@@ -855,39 +805,30 @@ void svga_device::svga_vh_rgb16(bitmap_rgb32 &bitmap, const rectangle &cliprect)
void svga_device::svga_vh_rgb24(bitmap_rgb32 &bitmap, const rectangle &cliprect)
{
#define MD(x) (vga.memory[x]+(vga.memory[x+1]<<8)+(vga.memory[x+2]<<16))
- #define ID 0xff000000
+ constexpr uint32_t ID = 0xff000000;
int height = vga.crtc.maximum_scan_line * (vga.crtc.scan_doubling + 1);
- int xi;
- int yi;
- int xm;
- int pos, line, column, c, addr, curr_addr;
- uint32_t *bitmapline;
-
-// uint16_t mask_comp;
/* line compare is screen sensitive */
-// mask_comp = 0xff | (TLINES & 0x300);
- curr_addr = 0;
- yi=0;
- for (addr = TGA_START_ADDRESS<<1, line=0; line<TLINES; line+=height, addr+=offset(), curr_addr+=offset())
+// uint16_t mask_comp = 0xff | (TLINES & 0x300);
+ int curr_addr = 0;
+ int yi=0;
+ for (int addr = TGA_START_ADDRESS<<1, line=0; line<TLINES; line+=height, addr+=offset(), curr_addr+=offset())
{
- bitmapline = &bitmap.pix32(line);
+ uint32_t *const bitmapline = &bitmap.pix(line);
addr %= vga.svga_intf.vram_size;
- for (pos=addr, c=0, column=0; column<TGA_COLUMNS; column++, c+=8, pos+=24)
+ for (int pos=addr, c=0, column=0; column<TGA_COLUMNS; column++, c+=8, pos+=24)
{
if(pos + 24 >= vga.svga_intf.vram_size)
return;
- for(xi=0,xm=0;xi<8;xi++,xm+=3)
+ for (int xi=0,xm=0;xi<8;xi++,xm+=3)
{
- int r,g,b;
-
if(!screen().visible_area().contains(c+xi, line + yi))
continue;
- r = (MD(pos+xm)&0xff0000)>>16;
- g = (MD(pos+xm)&0x00ff00)>>8;
- b = (MD(pos+xm)&0x0000ff)>>0;
- bitmapline[c+xi] = IV|(r<<16)|(g<<8)|(b<<0);
+ int r = (MD(pos+xm)&0xff0000)>>16;
+ int g = (MD(pos+xm)&0x00ff00)>>8;
+ int b = (MD(pos+xm)&0x0000ff)>>0;
+ bitmapline[c+xi] = ID|(r<<16)|(g<<8)|(b<<0);
}
}
}
@@ -896,39 +837,32 @@ void svga_device::svga_vh_rgb24(bitmap_rgb32 &bitmap, const rectangle &cliprect)
void svga_device::svga_vh_rgb32(bitmap_rgb32 &bitmap, const rectangle &cliprect)
{
#define MD(x) (vga.memory[x]+(vga.memory[x+1]<<8)+(vga.memory[x+2]<<16))
- #define ID 0xff000000
+ constexpr uint32_t ID = 0xff000000;
int height = vga.crtc.maximum_scan_line * (vga.crtc.scan_doubling + 1);
- int xi;
- int yi;
- int xm;
- int pos, line, column, c, addr, curr_addr;
- uint32_t *bitmapline;
// uint16_t mask_comp;
/* line compare is screen sensitive */
// mask_comp = 0xff | (TLINES & 0x300);
- curr_addr = 0;
- yi=0;
- for (addr = TGA_START_ADDRESS, line=0; line<TLINES; line+=height, addr+=(offset()), curr_addr+=(offset()))
+ int curr_addr = 0;
+ int yi=0;
+ for (int addr = TGA_START_ADDRESS, line=0; line<TLINES; line+=height, addr+=(offset()), curr_addr+=(offset()))
{
- bitmapline = &bitmap.pix32(line);
+ uint32_t *const bitmapline = &bitmap.pix(line);
addr %= vga.svga_intf.vram_size;
- for (pos=addr, c=0, column=0; column<TGA_COLUMNS; column++, c+=8, pos+=0x20)
+ for (int pos=addr, c=0, column=0; column<TGA_COLUMNS; column++, c+=8, pos+=0x20)
{
if(pos + 0x20 >= vga.svga_intf.vram_size)
return;
- for(xi=0,xm=0;xi<8;xi++,xm+=4)
+ for (int xi=0,xm=0;xi<8;xi++,xm+=4)
{
- int r,g,b;
-
if(!screen().visible_area().contains(c+xi, line + yi))
continue;
- r = (MD(pos+xm)&0xff0000)>>16;
- g = (MD(pos+xm)&0x00ff00)>>8;
- b = (MD(pos+xm)&0x0000ff)>>0;
- bitmapline[c+xi] = IV|(r<<16)|(g<<8)|(b<<0);
+ int r = (MD(pos+xm)&0xff0000)>>16;
+ int g = (MD(pos+xm)&0x00ff00)>>8;
+ int b = (MD(pos+xm)&0x0000ff)>>0;
+ bitmapline[c+xi] = ID|(r<<16)|(g<<8)|(b<<0);
}
}
}
@@ -936,13 +870,11 @@ void svga_device::svga_vh_rgb32(bitmap_rgb32 &bitmap, const rectangle &cliprect)
uint8_t vga_device::pc_vga_choosevideomode()
{
- int i;
-
if (vga.crtc.sync_en)
{
if (vga.dac.dirty)
{
- for (i=0; i<256;i++)
+ for (int i=0; i<256;i++)
{
/* TODO: color shifters? */
set_pen_color(i, (vga.dac.color[3*(i & vga.dac.mask)] & 0x3f) << 2,
@@ -954,7 +886,7 @@ uint8_t vga_device::pc_vga_choosevideomode()
if (vga.attribute.data[0x10] & 0x80)
{
- for (i=0; i<16;i++)
+ for (int i=0; i<16;i++)
{
vga.pens[i] = pen((vga.attribute.data[i]&0x0f)
|((vga.attribute.data[0x14]&0xf)<<4));
@@ -962,7 +894,7 @@ uint8_t vga_device::pc_vga_choosevideomode()
}
else
{
- for (i=0; i<16;i++)
+ for (int i=0; i<16;i++)
{
vga.pens[i] = pen((vga.attribute.data[i]&0x3f)
|((vga.attribute.data[0x14]&0xc)<<4));
@@ -997,13 +929,11 @@ uint8_t vga_device::pc_vga_choosevideomode()
uint8_t svga_device::pc_vga_choosevideomode()
{
- int i;
-
if (vga.crtc.sync_en)
{
if (vga.dac.dirty)
{
- for (i=0; i<256;i++)
+ for (int i=0; i<256;i++)
{
/* TODO: color shifters? */
set_pen_color(i, (vga.dac.color[3*(i & vga.dac.mask)] & 0x3f) << 2,
@@ -1015,7 +945,7 @@ uint8_t svga_device::pc_vga_choosevideomode()
if (vga.attribute.data[0x10] & 0x80)
{
- for (i=0; i<16;i++)
+ for (int i=0; i<16;i++)
{
vga.pens[i] = pen((vga.attribute.data[i]&0x0f)
|((vga.attribute.data[0x14]&0xf)<<4));
@@ -1023,7 +953,7 @@ uint8_t svga_device::pc_vga_choosevideomode()
}
else
{
- for (i=0; i<16;i++)
+ for (int i=0; i<16;i++)
{
vga.pens[i] = pen((vga.attribute.data[i]&0x3f)
|((vga.attribute.data[0x14]&0xc)<<4));
@@ -1132,32 +1062,26 @@ uint32_t svga_device::screen_update(screen_device &screen, bitmap_rgb32 &bitmap,
uint32_t s3_vga_device::screen_update(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect)
{
- uint8_t cur_mode;
-
svga_device::screen_update(screen, bitmap, cliprect);
- cur_mode = pc_vga_choosevideomode();
+ uint8_t cur_mode = pc_vga_choosevideomode();
// draw hardware graphics cursor
// TODO: support 16 bit and greater video modes
if(s3.cursor_mode & 0x01) // if cursor is enabled
{
- uint32_t src;
- uint32_t* dst;
- uint8_t val;
- int x,y;
uint16_t cx = s3.cursor_x & 0x07ff;
uint16_t cy = s3.cursor_y & 0x07ff;
- uint32_t bg_col;
- uint32_t fg_col;
- int r,g,b;
- uint32_t datax;
if(cur_mode == SCREEN_OFF || cur_mode == TEXT_MODE || cur_mode == MONO_MODE || cur_mode == CGA_MODE || cur_mode == EGA_MODE)
return 0; // cursor only works in VGA or SVGA modes
- src = s3.cursor_start_addr * 1024; // start address is in units of 1024 bytes
+ uint32_t src = s3.cursor_start_addr * 1024; // start address is in units of 1024 bytes
+ uint32_t bg_col;
+ uint32_t fg_col;
+ int r,g,b;
+ uint32_t datax;
switch(cur_mode)
{
case RGB15_MODE:
@@ -1204,16 +1128,16 @@ uint32_t s3_vga_device::screen_update(screen_device &screen, bitmap_rgb32 &bitma
// ,(s3.cursor_fg[0])|(s3.cursor_fg[1]<<8)|(s3.cursor_fg[2]<<16)|(s3.cursor_fg[3]<<24));
// for(x=0;x<64;x++)
// printf("%08x: %02x %02x %02x %02x\n",src+x*4,vga.memory[src+x*4],vga.memory[src+x*4+1],vga.memory[src+x*4+2],vga.memory[src+x*4+3]);
- for(y=0;y<64;y++)
+ for(int y=0;y<64;y++)
{
if(cy + y < cliprect.max_y && cx < cliprect.max_x)
{
- dst = &bitmap.pix32(cy + y, cx);
- for(x=0;x<64;x++)
+ uint32_t *const dst = &bitmap.pix(cy + y, cx);
+ for(int x=0;x<64;x++)
{
uint16_t bita = (vga.memory[(src+1) % vga.svga_intf.vram_size] | ((vga.memory[(src+0) % vga.svga_intf.vram_size]) << 8)) >> (15-(x % 16));
uint16_t bitb = (vga.memory[(src+3) % vga.svga_intf.vram_size] | ((vga.memory[(src+2) % vga.svga_intf.vram_size]) << 8)) >> (15-(x % 16));
- val = ((bita & 0x01) << 1) | (bitb & 0x01);
+ uint8_t val = ((bita & 0x01) << 1) | (bitb & 0x01);
if(s3.extended_dac_ctrl & 0x10)
{ // X11 mode
switch(val)
diff --git a/src/devices/video/ppu2c0x.cpp b/src/devices/video/ppu2c0x.cpp
index 6dccd546a35..82036c4c8c0 100644
--- a/src/devices/video/ppu2c0x.cpp
+++ b/src/devices/video/ppu2c0x.cpp
@@ -641,7 +641,7 @@ void ppu2c0x_device::draw_background(uint8_t* line_priority)
/* set up dest */
int start_x = (m_x_fine ^ 0x07) - 7;
- uint32_t* dest = &bitmap.pix32(m_scanline, start_x);
+ uint32_t* dest = &bitmap.pix(m_scanline, start_x);
m_tilecount = 0;
@@ -698,7 +698,7 @@ void ppu2c0x_device::draw_background(uint8_t* line_priority)
/* if the left 8 pixels for the background are off, blank 'em */
if (!(m_regs[PPU_CONTROL1] & PPU_CONTROL1_BACKGROUND_L8))
{
- dest = &bitmap.pix32(m_scanline);
+ dest = &bitmap.pix(m_scanline);
for (int i = 0; i < 8; i++)
{
draw_back_pen(dest, back_pen);
@@ -727,7 +727,7 @@ void ppu2c0x_device::draw_background_pen()
// Fill this scanline with the background pen.
for (int i = 0; i < bitmap.width(); i++)
- draw_back_pen(&bitmap.pix32(m_scanline, i), back_pen);
+ draw_back_pen(&bitmap.pix(m_scanline, i), back_pen);
}
void ppu2c0x_device::read_sprite_plane_data(int address)
@@ -763,7 +763,7 @@ void ppu2c0x_device::draw_sprite_pixel(int sprite_xpos, int color, int pixel, ui
palval |= ((m_regs[PPU_CONTROL1] & PPU_CONTROL1_COLOR_EMPHASIS) << 1);
uint32_t pix = m_nespens[palval];
- bitmap.pix32(m_scanline, sprite_xpos + pixel) = pix;
+ bitmap.pix(m_scanline, sprite_xpos + pixel) = pix;
}
void ppu2c0x_device::read_extra_sprite_bits(int sprite_index)
@@ -1066,7 +1066,7 @@ void ppu2c0x_device::update_visible_disabled_scanline()
// Fill this scanline with the background pen.
for (int i = 0; i < bitmap.width(); i++)
- draw_back_pen(&bitmap.pix32(m_scanline, i), back_pen);
+ draw_back_pen(&bitmap.pix(m_scanline, i), back_pen);
}
void ppu2c0x_device::update_visible_scanline()
diff --git a/src/devices/video/ppu2c0x_sh6578.cpp b/src/devices/video/ppu2c0x_sh6578.cpp
index 66ede857004..dac397f5778 100644
--- a/src/devices/video/ppu2c0x_sh6578.cpp
+++ b/src/devices/video/ppu2c0x_sh6578.cpp
@@ -91,7 +91,7 @@ void ppu_sh6578_device::scanline_increment_fine_ycounter()
void ppu_sh6578_device::draw_sprite_pixel(int sprite_xpos, int color, int pixel, uint8_t pixel_data, bitmap_rgb32& bitmap)
{
uint8_t palval = m_palette_ram[(pixel_data | color << 2)] & 0x3f;
- bitmap.pix32(m_scanline, sprite_xpos + pixel) = m_nespens[palval];
+ bitmap.pix(m_scanline, sprite_xpos + pixel) = m_nespens[palval];
}
void ppu_sh6578_device::read_tile_plane_data(int address, int color)
@@ -193,7 +193,7 @@ void ppu_sh6578_device::draw_background(uint8_t* line_priority)
/* set up dest */
int start_x = (m_x_fine ^ 0x07) - 7;
- uint32_t* dest = &bitmap.pix32(m_scanline, start_x);
+ uint32_t* dest = &bitmap.pix(m_scanline, start_x);
m_tilecount = 0;
@@ -246,7 +246,7 @@ void ppu_sh6578_device::draw_background(uint8_t* line_priority)
/* if the left 8 pixels for the background are off, blank 'em */
if (!(m_regs[PPU_CONTROL1] & PPU_CONTROL1_BACKGROUND_L8))
{
- dest = &bitmap.pix32(m_scanline);
+ dest = &bitmap.pix(m_scanline);
for (int i = 0; i < 8; i++)
{
*(dest++) = back_pen;
diff --git a/src/devices/video/ppu2c0x_vt.cpp b/src/devices/video/ppu2c0x_vt.cpp
index 739b5490c8f..ad1439a90e1 100644
--- a/src/devices/video/ppu2c0x_vt.cpp
+++ b/src/devices/video/ppu2c0x_vt.cpp
@@ -364,7 +364,7 @@ void ppu_vt03_device::draw_sprite_pixel(int sprite_xpos, int color, int pixel, u
if (!is16pix)
{
uint8_t pen = pixel_data + (4 * color);
- draw_tile_pixel_inner(pen, &bitmap.pix32(m_scanline, sprite_xpos + pixel));
+ draw_tile_pixel_inner(pen, &bitmap.pix(m_scanline, sprite_xpos + pixel));
}
else
{
@@ -374,13 +374,13 @@ void ppu_vt03_device::draw_sprite_pixel(int sprite_xpos, int color, int pixel, u
if ((pixel_data & 0x03) != 0)
{
uint8_t pen = (pixel_data & 0x03) + (4 * color);
- draw_tile_pixel_inner(pen, &bitmap.pix32(m_scanline, sprite_xpos + pixel));
+ draw_tile_pixel_inner(pen, &bitmap.pix(m_scanline, sprite_xpos + pixel));
}
if (((pixel_data >> 5) & 0x03) != 0)
{
uint8_t pen = ((pixel_data >> 5) & 0x03) + (4 * color);
- draw_tile_pixel_inner(pen, &bitmap.pix32(m_scanline, sprite_xpos + pixel + 8));
+ draw_tile_pixel_inner(pen, &bitmap.pix(m_scanline, sprite_xpos + pixel + 8));
}
//ppu2c0x_device::draw_sprite_pixel(sprite_xpos, color, pixel, pixel_data & 0x03, bitmap);
//ppu2c0x_device::draw_sprite_pixel(sprite_xpos, color, pixel + 8, (pixel_data >> 5) & 0x03, bitmap);
diff --git a/src/devices/video/psx.cpp b/src/devices/video/psx.cpp
index 83cd0e5c02d..b73adb2a319 100644
--- a/src/devices/video/psx.cpp
+++ b/src/devices/video/psx.cpp
@@ -265,8 +265,8 @@ void psxgpu_device::DebugMesh( int n_coordx, int n_coordy )
(int16_t)n_x.w.h <= width - 1 &&
(int16_t)n_y.w.h <= height - 1 )
{
- if( m_debug.mesh->pix16( n_y.w.h, n_x.w.h ) != 0xffff )
- m_debug.mesh->pix16( n_y.w.h, n_x.w.h ) = n_colour;
+ if( m_debug.mesh->pix( n_y.w.h, n_x.w.h ) != 0xffff )
+ m_debug.mesh->pix( n_y.w.h, n_x.w.h ) = n_colour;
}
n_x.d += n_dx;
@@ -364,7 +364,7 @@ int psxgpu_device::DebugMeshDisplay( bitmap_rgb32 &bitmap, const rectangle &clip
if( m_debug.b_mesh )
{
for( int y = cliprect.min_y; y <= cliprect.max_y; y++ )
- draw_scanline16( bitmap, cliprect.min_x, y, cliprect.max_x + 1 - cliprect.min_x, &m_debug.mesh->pix16( y ), pens() );
+ draw_scanline16( bitmap, cliprect.min_x, y, cliprect.max_x + 1 - cliprect.min_x, &m_debug.mesh->pix( y ), pens() );
}
m_debug.b_clear = 1;
@@ -772,7 +772,7 @@ uint32_t psxgpu_device::update_screen(screen_device &screen, bitmap_rgb32 &bitma
while( n_line > 0 )
{
uint16_t *p_n_src = p_p_vram[ n_y + n_displaystarty ] + 3 * n_x + n_displaystartx;
- uint32_t *p_n_dest = &bitmap.pix32(n_y + n_top, n_x + n_left);
+ uint32_t *p_n_dest = &bitmap.pix(n_y + n_top, n_x + n_left);
n_column = n_columns;
while( n_column > 0 )
diff --git a/src/devices/video/saa5050.cpp b/src/devices/video/saa5050.cpp
index 77af6be01ea..b873edfbbb9 100644
--- a/src/devices/video/saa5050.cpp
+++ b/src/devices/video/saa5050.cpp
@@ -661,9 +661,7 @@ uint32_t saa5050_device::screen_update(screen_device &screen, bitmap_rgb32 &bitm
int g = BIT(color, 1) * 0xff;
int b = BIT(color, 2) * 0xff;
- rgb_t rgb = rgb_t(r, g, b);
-
- bitmap.pix32(y, x++) = rgb;
+ bitmap.pix(y, x++) = rgb_t(r, g, b);
}
}
}
diff --git a/src/devices/video/scn2674.cpp b/src/devices/video/scn2674.cpp
index 17fc68c6b9a..96e1e7d3ca5 100644
--- a/src/devices/video/scn2674.cpp
+++ b/src/devices/video/scn2674.cpp
@@ -1178,7 +1178,7 @@ TIMER_CALLBACK_MEMBER(scn2674_device::scanline_timer)
}
if (!m_display_enabled)
- std::fill_n(&m_bitmap.pix32(m_linecounter), m_character_per_row * m_hpixels_per_column, rgb_t::black());
+ std::fill_n(&m_bitmap.pix(m_linecounter), m_character_per_row * m_hpixels_per_column, rgb_t::black());
if (m_gfx_enabled || (charrow == (m_scanline_per_char_row - 1)))
m_address = address;
diff --git a/src/devices/video/sed1330.cpp b/src/devices/video/sed1330.cpp
index 101ebe72944..37d95caac7b 100644
--- a/src/devices/video/sed1330.cpp
+++ b/src/devices/video/sed1330.cpp
@@ -605,7 +605,7 @@ void sed1330_device::data_w(uint8_t data)
void sed1330_device::draw_text_scanline(bitmap_ind16 &bitmap, const rectangle &cliprect, int y, int r, uint16_t va, bool cursor)
{
- uint16_t *p = &bitmap.pix16(y, 0);
+ uint16_t *p = &bitmap.pix(y);
for (int sx = 0; sx < m_cr; sx++, p += m_fx)
{
@@ -653,7 +653,7 @@ void sed1330_device::draw_graphics_scanline(bitmap_ind16 &bitmap, const rectangl
for (int x = 0; x < m_fx; x++)
{
- bitmap.pix16(y, (sx * m_fx) + x) = BIT(data, 7);
+ bitmap.pix(y, (sx * m_fx) + x) = BIT(data, 7);
data <<= 1;
}
}
diff --git a/src/devices/video/snes_ppu.cpp b/src/devices/video/snes_ppu.cpp
index a74f7af905d..e0b4eb544b1 100644
--- a/src/devices/video/snes_ppu.cpp
+++ b/src/devices/video/snes_ppu.cpp
@@ -1251,7 +1251,7 @@ void snes_ppu_device::refresh_scanline( bitmap_rgb32 &bitmap, uint16_t curline )
if (m_screen_disabled) /* screen is forced blank */
for (int x = 0; x < SNES_SCR_WIDTH * 2; x++)
- bitmap.pix32(0, x) = rgb_t::black();
+ bitmap.pix(0, x) = rgb_t::black();
else
{
uint8_t window_above[256];
@@ -1323,8 +1323,8 @@ void snes_ppu_device::refresh_scanline( bitmap_rgb32 &bitmap, uint16_t curline )
const int g = (c & 0x3e0) >> 5;
const int b = (c & 0x7c00) >> 10;
- bitmap.pix32(0, x * 2 + 0) = rgb_t(pal5bit(r), pal5bit(g), pal5bit(b));
- bitmap.pix32(0, x * 2 + 1) = rgb_t(pal5bit(r), pal5bit(g), pal5bit(b));
+ bitmap.pix(0, x * 2 + 0) = rgb_t(pal5bit(r), pal5bit(g), pal5bit(b));
+ bitmap.pix(0, x * 2 + 1) = rgb_t(pal5bit(r), pal5bit(g), pal5bit(b));
}
else if (!blurring)
{
@@ -1337,8 +1337,8 @@ void snes_ppu_device::refresh_scanline( bitmap_rgb32 &bitmap, uint16_t curline )
const int b0 = (c0 & 0x7c00) >> 10;
const int b1 = (c1 & 0x7c00) >> 10;
- bitmap.pix32(0, x * 2 + 0) = rgb_t(pal5bit(r0), pal5bit(g0), pal5bit(b0));
- bitmap.pix32(0, x * 2 + 1) = rgb_t(pal5bit(r1), pal5bit(g1), pal5bit(b1));
+ bitmap.pix(0, x * 2 + 0) = rgb_t(pal5bit(r0), pal5bit(g0), pal5bit(b0));
+ bitmap.pix(0, x * 2 + 1) = rgb_t(pal5bit(r1), pal5bit(g1), pal5bit(b1));
}
else
{
@@ -1348,7 +1348,7 @@ void snes_ppu_device::refresh_scanline( bitmap_rgb32 &bitmap, uint16_t curline )
const int r0 = (c0 & 0x1f);
const int g0 = (c0 & 0x3e0) >> 5;
const int b0 = (c0 & 0x7c00) >> 10;
- bitmap.pix32(0, x * 2 + 0) = rgb_t(pal5bit(r0), pal5bit(g0), pal5bit(b0));
+ bitmap.pix(0, x * 2 + 0) = rgb_t(pal5bit(r0), pal5bit(g0), pal5bit(b0));
prev = curr;
curr = luma[pixel(x, above, below, window_above, window_below)];
@@ -1357,7 +1357,7 @@ void snes_ppu_device::refresh_scanline( bitmap_rgb32 &bitmap, uint16_t curline )
const int r1 = (c1 & 0x1f);
const int g1 = (c1 & 0x3e0) >> 5;
const int b1 = (c1 & 0x7c00) >> 10;
- bitmap.pix32(0, x * 2 + 1) = rgb_t(pal5bit(r1), pal5bit(g1), pal5bit(b1));
+ bitmap.pix(0, x * 2 + 1) = rgb_t(pal5bit(r1), pal5bit(g1), pal5bit(b1));
prev = curr;
}
diff --git a/src/devices/video/stvvdp2.cpp b/src/devices/video/stvvdp2.cpp
index 473fa710f7d..f79f0aec207 100644
--- a/src/devices/video/stvvdp2.cpp
+++ b/src/devices/video/stvvdp2.cpp
@@ -2530,11 +2530,11 @@ void saturn_state::stv_vdp2_drawgfxzoom(
{
for( y=sy; y<ey; y++ )
{
- const uint8_t *source = source_base + (y_index>>16) * gfx->rowbytes();
- uint32_t *dest = &dest_bmp.pix32(y);
+ uint8_t const *const source = source_base + (y_index>>16) * gfx->rowbytes();
+ uint32_t *const dest = &dest_bmp.pix(y);
- int x, x_index = x_index_base;
- for( x=sx; x<ex; x++ )
+ int x_index = x_index_base;
+ for( int x=sx; x<ex; x++ )
{
if(stv_vdp2_window_process(x,y))
{
@@ -2552,11 +2552,11 @@ void saturn_state::stv_vdp2_drawgfxzoom(
{
for( y=sy; y<ey; y++ )
{
- const uint8_t *source = source_base + (y_index>>16) * gfx->rowbytes();
- uint32_t *dest = &dest_bmp.pix32(y);
+ uint8_t const *const source = source_base + (y_index>>16) * gfx->rowbytes();
+ uint32_t *const dest = &dest_bmp.pix(y);
- int x, x_index = x_index_base;
- for( x=sx; x<ex; x++ )
+ int x_index = x_index_base;
+ for( int x=sx; x<ex; x++ )
{
if(stv_vdp2_window_process(x,y))
{
@@ -2574,11 +2574,11 @@ void saturn_state::stv_vdp2_drawgfxzoom(
{
for( y=sy; y<ey; y++ )
{
- const uint8_t *source = source_base + (y_index>>16) * gfx->rowbytes();
- uint32_t *dest = &dest_bmp.pix32(y);
+ uint8_t const *const source = source_base + (y_index>>16) * gfx->rowbytes();
+ uint32_t *const dest = &dest_bmp.pix(y);
- int x, x_index = x_index_base;
- for( x=sx; x<ex; x++ )
+ int x_index = x_index_base;
+ for( int x=sx; x<ex; x++ )
{
if(stv_vdp2_window_process(x,y))
{
@@ -2716,17 +2716,16 @@ void saturn_state::stv_vdp2_drawgfxzoom_rgb555(
{
for( y=sy; y<ey; y++ )
{
- const uint8_t *source = gfxdata + (y_index>>16)*16;
- uint32_t *dest = &dest_bmp.pix32(y);
- int r,g,b,data;
+ uint8_t const *const source = gfxdata + (y_index>>16)*16;
+ uint32_t *const dest = &dest_bmp.pix(y);
- int x, x_index = x_index_base;
- for( x=sx; x<ex; x++ )
+ int x_index = x_index_base;
+ for( int x=sx; x<ex; x++ )
{
- data = (source[(x_index>>16)*2] << 8) | source[(x_index>>16)*2+1];
- b = pal5bit((data & 0x7c00) >> 10);
- g = pal5bit((data & 0x03e0) >> 5);
- r = pal5bit( data & 0x001f);
+ int data = (source[(x_index>>16)*2] << 8) | source[(x_index>>16)*2+1];
+ int b = pal5bit((data & 0x7c00) >> 10);
+ int g = pal5bit((data & 0x03e0) >> 5);
+ int r = pal5bit( data & 0x001f);
if(stv2_current_tilemap.fade_control & 1)
stv_vdp2_compute_color_offset(&r,&g,&b,stv2_current_tilemap.fade_control & 2);
@@ -2743,17 +2742,16 @@ void saturn_state::stv_vdp2_drawgfxzoom_rgb555(
{
for( y=sy; y<ey; y++ )
{
- const uint8_t *source = gfxdata + (y_index>>16)*16;
- uint32_t *dest = &dest_bmp.pix32(y);
- int r,g,b,data;
+ uint8_t const *const source = gfxdata + (y_index>>16)*16;
+ uint32_t *const dest = &dest_bmp.pix(y);
- int x, x_index = x_index_base;
- for( x=sx; x<ex; x++ )
+ int x_index = x_index_base;
+ for( int x=sx; x<ex; x++ )
{
- data = (source[(x_index*2+0)>>16]<<0)|(source[(x_index*2+1)>>16]<<8);
- b = pal5bit((data & 0x7c00) >> 10);
- g = pal5bit((data & 0x03e0) >> 5);
- r = pal5bit( data & 0x001f);
+ int data = (source[(x_index*2+0)>>16]<<0)|(source[(x_index*2+1)>>16]<<8);
+ int b = pal5bit((data & 0x7c00) >> 10);
+ int g = pal5bit((data & 0x03e0) >> 5);
+ int r = pal5bit( data & 0x001f);
if(stv2_current_tilemap.fade_control & 1)
stv_vdp2_compute_color_offset(&r,&g,&b,stv2_current_tilemap.fade_control & 2);
@@ -2770,17 +2768,16 @@ void saturn_state::stv_vdp2_drawgfxzoom_rgb555(
{
for( y=sy; y<ey; y++ )
{
- const uint8_t *source = gfxdata + (y_index>>16)*16;
- uint32_t *dest = &dest_bmp.pix32(y);
- int r,g,b,data;
+ uint8_t const *const source = gfxdata + (y_index>>16)*16;
+ uint32_t *const dest = &dest_bmp.pix(y);
- int x, x_index = x_index_base;
- for( x=sx; x<ex; x++ )
+ int x_index = x_index_base;
+ for( int x=sx; x<ex; x++ )
{
- data = (source[(x_index>>16)*2] << 8) | source[(x_index>>16)*2+1];
- b = pal5bit((data & 0x7c00) >> 10);
- g = pal5bit((data & 0x03e0) >> 5);
- r = pal5bit( data & 0x001f);
+ int data = (source[(x_index>>16)*2] << 8) | source[(x_index>>16)*2+1];
+ int b = pal5bit((data & 0x7c00) >> 10);
+ int g = pal5bit((data & 0x03e0) >> 5);
+ int r = pal5bit( data & 0x001f);
if(stv2_current_tilemap.fade_control & 1)
stv_vdp2_compute_color_offset(&r,&g,&b,stv2_current_tilemap.fade_control & 2);
@@ -2877,21 +2874,18 @@ void saturn_state::stv_vdp2_drawgfx_rgb555( bitmap_rgb32 &dest_bmp, const rectan
for( y=sy; y<ey; y++ )
{
- const uint8_t *source = gfxdata + (y_index>>16)*16;
- uint32_t *dest = &dest_bmp.pix32(y);
- uint16_t data;
+ uint8_t const *const source = gfxdata + (y_index>>16)*16;
+ uint32_t *const dest = &dest_bmp.pix(y);
- int x, x_index = x_index_base;
- for( x=sx; x<ex; x++ )
+ int x_index = x_index_base;
+ for( int x=sx; x<ex; x++ )
{
- int r,g,b;
-
- data = (source[(x_index>>16)*2] << 8) | source[(x_index>>16)*2+1];
+ uint16_t data = (source[(x_index>>16)*2] << 8) | source[(x_index>>16)*2+1];
if ((data & 0x8000) || (transparency & STV_TRANSPARENCY_NONE))
{
- b = pal5bit((data & 0x7c00) >> 10);
- g = pal5bit((data & 0x03e0) >> 5);
- r = pal5bit( data & 0x001f);
+ int b = pal5bit((data & 0x7c00) >> 10);
+ int g = pal5bit((data & 0x03e0) >> 5);
+ int r = pal5bit( data & 0x001f);
if(stv2_current_tilemap.fade_control & 1)
stv_vdp2_compute_color_offset(&r,&g,&b,stv2_current_tilemap.fade_control & 2);
@@ -2986,26 +2980,21 @@ void saturn_state::stv_vdp2_drawgfx_rgb888( bitmap_rgb32 &dest_bmp, const rectan
if( ex>sx )
{ /* skip if inner loop doesn't draw anything */
- int y;
-
- for( y=sy; y<ey; y++ )
+ for( int y=sy; y<ey; y++ )
{
- const uint8_t *source = gfxdata + (y_index>>16)*32;
- uint32_t *dest = &dest_bmp.pix32(y);
- uint32_t data;
+ uint8_t const *const source = gfxdata + (y_index>>16)*32;
+ uint32_t *const dest = &dest_bmp.pix(y);
- int x, x_index = x_index_base;
+ int x_index = x_index_base;
- for( x=sx; x<ex; x++ )
+ for( int x=sx; x<ex; x++ )
{
- int r,g,b;
-
- data = (source[(x_index>>16)*4+0] << 24) | (source[(x_index>>16)*4+1] << 16) | (source[(x_index>>16)*4+2] << 8) | (source[(x_index>>16)*4+3] << 0);
+ uint32_t data = (source[(x_index>>16)*4+0] << 24) | (source[(x_index>>16)*4+1] << 16) | (source[(x_index>>16)*4+2] << 8) | (source[(x_index>>16)*4+3] << 0);
if ((data & 0x80000000) || (transparency & STV_TRANSPARENCY_NONE))
{
- b = (data & 0xff0000) >> 16;
- g = (data & 0x00ff00) >> 8;
- r = (data & 0x0000ff);
+ int b = (data & 0xff0000) >> 16;
+ int g = (data & 0x00ff00) >> 8;
+ int r = (data & 0x0000ff);
if(stv2_current_tilemap.fade_control & 1)
stv_vdp2_compute_color_offset(&r,&g,&b,stv2_current_tilemap.fade_control & 2);
@@ -3078,27 +3067,23 @@ void saturn_state::stv_vdp2_drawgfx_alpha(bitmap_rgb32 &dest_bmp,const rectangle
/* skip if inner loop doesn't draw anything */
if (ex > sx)
{
- int x, y;
-
+ for (int y = sy; y < ey; y++)
{
- for (y = sy; y < ey; y++)
+ uint8_t const *const source = source_base + y_index*gfx->rowbytes();
+ uint32_t *const dest = &dest_bmp.pix(y);
+ int x_index = x_index_base;
+ for (int x = sx; x < ex; x++)
{
- const uint8_t *source = source_base + y_index*gfx->rowbytes();
- uint32_t *dest = &dest_bmp.pix32(y);
- int x_index = x_index_base;
- for (x = sx; x < ex; x++)
+ if(stv_vdp2_window_process(x,y))
{
- if(stv_vdp2_window_process(x,y))
- {
- int c = (source[x_index]);
- if ((transparency & STV_TRANSPARENCY_NONE) || (c != 0))
- dest[x] = alpha_blend_r32( dest[x], pal[c], alpha );
- }
-
- x_index += xinc;
+ int c = (source[x_index]);
+ if ((transparency & STV_TRANSPARENCY_NONE) || (c != 0))
+ dest[x] = alpha_blend_r32( dest[x], pal[c], alpha );
}
- y_index += yinc;
+
+ x_index += xinc;
}
+ y_index += yinc;
}
}
}
@@ -3155,27 +3140,23 @@ void saturn_state::stv_vdp2_drawgfx_transpen(bitmap_rgb32 &dest_bmp,const rectan
/* skip if inner loop doesn't draw anything */
if (ex > sx)
{
- int x, y;
-
+ for (int y = sy; y < ey; y++)
{
- for (y = sy; y < ey; y++)
+ uint8_t const *const source = source_base + y_index*gfx->rowbytes();
+ uint32_t *const dest = &dest_bmp.pix(y);
+ int x_index = x_index_base;
+ for (int x = sx; x < ex; x++)
{
- const uint8_t *source = source_base + y_index*gfx->rowbytes();
- uint32_t *dest = &dest_bmp.pix32(y);
- int x_index = x_index_base;
- for (x = sx; x < ex; x++)
+ if(stv_vdp2_window_process(x,y))
{
- if(stv_vdp2_window_process(x,y))
- {
- int c = (source[x_index]);
- if ((transparency & STV_TRANSPARENCY_NONE) || (c != 0))
- dest[x] = pal[c];
- }
-
- x_index += xinc;
+ int c = (source[x_index]);
+ if ((transparency & STV_TRANSPARENCY_NONE) || (c != 0))
+ dest[x] = pal[c];
}
- y_index += yinc;
+
+ x_index += xinc;
}
+ y_index += yinc;
}
}
}
@@ -3227,9 +3208,9 @@ void saturn_state::draw_4bpp_bitmap(bitmap_rgb32 &bitmap, const rectangle &clipr
dot_data += pal_bank;
if ( stv2_current_tilemap.colour_calculation_enabled == 0 )
- bitmap.pix32(ydst, xdst) = m_palette->pen(dot_data);
+ bitmap.pix(ydst, xdst) = m_palette->pen(dot_data);
else
- bitmap.pix32(ydst, xdst) = alpha_blend_r32(bitmap.pix32(ydst, xdst), m_palette->pen(dot_data), stv2_current_tilemap.alpha);
+ bitmap.pix(ydst, xdst) = alpha_blend_r32(bitmap.pix(ydst, xdst), m_palette->pen(dot_data), stv2_current_tilemap.alpha);
}
}
}
@@ -3287,9 +3268,9 @@ void saturn_state::draw_8bpp_bitmap(bitmap_rgb32 &bitmap, const rectangle &clipr
dot_data += pal_bank;
if ( stv2_current_tilemap.colour_calculation_enabled == 0 )
- bitmap.pix32(ydst, xdst) = m_palette->pen(dot_data);
+ bitmap.pix(ydst, xdst) = m_palette->pen(dot_data);
else
- bitmap.pix32(ydst, xdst) = alpha_blend_r32(bitmap.pix32(ydst, xdst), m_palette->pen(dot_data), stv2_current_tilemap.alpha);
+ bitmap.pix(ydst, xdst) = alpha_blend_r32(bitmap.pix(ydst, xdst), m_palette->pen(dot_data), stv2_current_tilemap.alpha);
}
}
}
@@ -3344,9 +3325,9 @@ void saturn_state::draw_11bpp_bitmap(bitmap_rgb32 &bitmap, const rectangle &clip
dot_data += pal_bank;
if ( stv2_current_tilemap.colour_calculation_enabled == 0 )
- bitmap.pix32(ydst, xdst) = m_palette->pen(dot_data);
+ bitmap.pix(ydst, xdst) = m_palette->pen(dot_data);
else
- bitmap.pix32(ydst, xdst) = alpha_blend_r32(bitmap.pix32(ydst, xdst), m_palette->pen(dot_data), stv2_current_tilemap.alpha);
+ bitmap.pix(ydst, xdst) = alpha_blend_r32(bitmap.pix(ydst, xdst), m_palette->pen(dot_data), stv2_current_tilemap.alpha);
}
}
}
@@ -3403,9 +3384,9 @@ void saturn_state::draw_rgb15_bitmap(bitmap_rgb32 &bitmap, const rectangle &clip
stv_vdp2_compute_color_offset(&r,&g,&b,stv2_current_tilemap.fade_control & 2);
if ( stv2_current_tilemap.colour_calculation_enabled == 0 )
- bitmap.pix32(ydst, xdst) = rgb_t(r, g, b);
+ bitmap.pix(ydst, xdst) = rgb_t(r, g, b);
else
- bitmap.pix32(ydst, xdst) = alpha_blend_r32( bitmap.pix32(ydst, xdst), rgb_t(r, g, b), stv2_current_tilemap.alpha );
+ bitmap.pix(ydst, xdst) = alpha_blend_r32( bitmap.pix(ydst, xdst), rgb_t(r, g, b), stv2_current_tilemap.alpha );
}
}
}
@@ -3461,9 +3442,9 @@ void saturn_state::draw_rgb32_bitmap(bitmap_rgb32 &bitmap, const rectangle &clip
stv_vdp2_compute_color_offset(&r,&g,&b,stv2_current_tilemap.fade_control & 2);
if ( stv2_current_tilemap.colour_calculation_enabled == 0 )
- bitmap.pix32(ydst, xdst) = rgb_t(r, g, b);
+ bitmap.pix(ydst, xdst) = rgb_t(r, g, b);
else
- bitmap.pix32(ydst, xdst) = alpha_blend_r32( bitmap.pix32(ydst, xdst), rgb_t(r, g, b), stv2_current_tilemap.alpha );
+ bitmap.pix(ydst, xdst) = alpha_blend_r32( bitmap.pix(ydst, xdst), rgb_t(r, g, b), stv2_current_tilemap.alpha );
}
}
}
@@ -4354,9 +4335,9 @@ void saturn_state::stv_vdp2_draw_line(bitmap_rgb32 &bitmap, const rectangle &cli
uint16_t pen;
pen = (gfxdata[base_offs+0]<<8)|gfxdata[base_offs+1];
- pix = bitmap.pix32(y, x);
+ pix = bitmap.pix(y, x);
- bitmap.pix32(y, x) = add_blend_r32(m_palette->pen(pen & 0x7ff),pix);
+ bitmap.pix(y, x) = add_blend_r32(m_palette->pen(pen & 0x7ff),pix);
}
}
}
@@ -4364,12 +4345,8 @@ void saturn_state::stv_vdp2_draw_line(bitmap_rgb32 &bitmap, const rectangle &cli
void saturn_state::stv_vdp2_draw_mosaic(bitmap_rgb32 &bitmap, const rectangle &cliprect, uint8_t is_roz)
{
- int x,y,xi,yi;
- uint8_t h_size,v_size;
- uint32_t pix;
-
- h_size = STV_VDP2_MZSZH+1;
- v_size = STV_VDP2_MZSZV+1;
+ uint8_t h_size = STV_VDP2_MZSZH+1;
+ uint8_t v_size = STV_VDP2_MZSZV+1;
if(is_roz)
v_size = 1;
@@ -4380,15 +4357,15 @@ void saturn_state::stv_vdp2_draw_mosaic(bitmap_rgb32 &bitmap, const rectangle &c
if(STV_VDP2_LSMD == 3)
v_size <<= 1;
- for(y=cliprect.top();y<=cliprect.bottom();y+=v_size)
+ for(int y=cliprect.top();y<=cliprect.bottom();y+=v_size)
{
- for(x=cliprect.left();x<=cliprect.right();x+=h_size)
+ for(int x=cliprect.left();x<=cliprect.right();x+=h_size)
{
- pix = bitmap.pix32(y, x);
+ uint32_t pix = bitmap.pix(y, x);
- for(yi=0;yi<v_size;yi++)
- for(xi=0;xi<h_size;xi++)
- bitmap.pix32(y+yi, x+xi) = pix;
+ for(int yi=0;yi<v_size;yi++)
+ for(int xi=0;xi<h_size;xi++)
+ bitmap.pix(y+yi, x+xi) = pix;
}
}
}
@@ -4726,7 +4703,7 @@ void saturn_state::stv_vdp2_copy_roz_bitmap(bitmap_rgb32 &bitmap,
//dx = (RP.A * RP.dx) + (RP.B * RP.dy);
//dy = (RP.D * RP.dx) + (RP.E * RP.dy);
- line = &bitmap.pix32(vcnt);
+ line = &bitmap.pix(vcnt);
// TODO: nuke this spaghetti code
if ( !use_coeff_table || RP.dkax == 0 )
@@ -4814,7 +4791,7 @@ void saturn_state::stv_vdp2_copy_roz_bitmap(bitmap_rgb32 &bitmap,
continue;
}
- pix = roz_bitmap.pix32(y & planerenderedsizey, x & planerenderedsizex);
+ pix = roz_bitmap.pix(y & planerenderedsizey, x & planerenderedsizex);
if (stv2_current_tilemap.transparency & STV_TRANSPARENCY_ALPHA)
{
if ((stv2_current_tilemap.transparency & STV_TRANSPARENCY_NONE) || (pix & 0xffffff))
@@ -4918,7 +4895,7 @@ void saturn_state::stv_vdp2_copy_roz_bitmap(bitmap_rgb32 &bitmap,
if ( x & clipxmask || y & clipymask ) continue;
- pix = roz_bitmap.pix32(y & planerenderedsizey, x & planerenderedsizex);
+ pix = roz_bitmap.pix(y & planerenderedsizey, x & planerenderedsizex);
if (stv2_current_tilemap.transparency & STV_TRANSPARENCY_ALPHA)
{
if ((stv2_current_tilemap.transparency & STV_TRANSPARENCY_NONE) || (pix & 0xffffff))
@@ -5753,12 +5730,9 @@ void saturn_state::stv_vdp2_draw_RBG0(bitmap_rgb32 &bitmap, const rectangle &cli
void saturn_state::stv_vdp2_draw_back(bitmap_rgb32 &bitmap, const rectangle &cliprect)
{
- int x,y;
- uint8_t* gfxdata = m_vdp2.gfx_decode.get();
- uint32_t base_offs,base_mask;
- uint8_t interlace;
+ uint8_t const *const gfxdata = m_vdp2.gfx_decode.get();
- interlace = (STV_VDP2_LSMD == 3)+1;
+ uint8_t interlace = (STV_VDP2_LSMD == 3)+1;
// popmessage("Back screen %08x %08x %08x",STV_VDP2_BDCLMD,STV_VDP2_BKCLMD,STV_VDP2_BKTA);
@@ -5767,27 +5741,24 @@ void saturn_state::stv_vdp2_draw_back(bitmap_rgb32 &bitmap, const rectangle &cli
bitmap.fill(m_palette->black_pen(), cliprect);
else
{
- base_mask = STV_VDP2_VRAMSZ ? 0x7ffff : 0x3ffff;
+ uint32_t base_mask = STV_VDP2_VRAMSZ ? 0x7ffff : 0x3ffff;
- for(y=cliprect.top();y<=cliprect.bottom();y++)
+ for(int y=cliprect.top();y<=cliprect.bottom();y++)
{
- base_offs = ((STV_VDP2_BKTA ) & base_mask) << 1;
+ uint32_t base_offs = ((STV_VDP2_BKTA ) & base_mask) << 1;
if(STV_VDP2_BKCLMD)
base_offs += ((y / interlace) << 1);
- for(x=cliprect.left();x<=cliprect.right();x++)
+ for(int x=cliprect.left();x<=cliprect.right();x++)
{
- int r,g,b;
- uint16_t dot;
-
- dot = (gfxdata[base_offs+0]<<8)|gfxdata[base_offs+1];
- b = pal5bit((dot & 0x7c00) >> 10);
- g = pal5bit((dot & 0x03e0) >> 5);
- r = pal5bit( dot & 0x001f);
+ uint16_t dot = (gfxdata[base_offs+0]<<8)|gfxdata[base_offs+1];
+ int b = pal5bit((dot & 0x7c00) >> 10);
+ int g = pal5bit((dot & 0x03e0) >> 5);
+ int r = pal5bit( dot & 0x001f);
if(STV_VDP2_BKCOEN)
stv_vdp2_compute_color_offset( &r, &g, &b, STV_VDP2_BKCOSL );
- bitmap.pix32(y, x) = rgb_t(r, g, b);
+ bitmap.pix(y, x) = rgb_t(r, g, b);
}
}
}
@@ -6737,7 +6708,7 @@ void saturn_state::draw_sprites(bitmap_rgb32 &bitmap, const rectangle &cliprect,
continue;
framebuffer_line = m_vdp1.framebuffer_display_lines[y];
- bitmap_line = &bitmap.pix32(y);
+ bitmap_line = &bitmap.pix(y);
for ( x = cliprect.left(); x <= cliprect.right(); x++ )
{
@@ -6830,7 +6801,7 @@ void saturn_state::draw_sprites(bitmap_rgb32 &bitmap, const rectangle &cliprect,
continue;
framebuffer_line = m_vdp1.framebuffer_display_lines[y];
- bitmap_line = &bitmap.pix32(y);
+ bitmap_line = &bitmap.pix(y);
for ( x = cliprect.left(); x <= cliprect.right(); x++ )
{
@@ -6941,12 +6912,12 @@ void saturn_state::draw_sprites(bitmap_rgb32 &bitmap, const rectangle &cliprect,
framebuffer_line = m_vdp1.framebuffer_display_lines[y];
if ( interlace_framebuffer == 0 )
{
- bitmap_line = &bitmap.pix32(y);
+ bitmap_line = &bitmap.pix(y);
}
else
{
- bitmap_line = &bitmap.pix32(2*y);
- bitmap_line2 = &bitmap.pix32(2*y + 1);
+ bitmap_line = &bitmap.pix(2*y);
+ bitmap_line2 = &bitmap.pix(2*y + 1);
}
for ( x = cliprect.left(); x <= cliprect.right() /(double_x+1) ; x++ )
diff --git a/src/devices/video/t6963c.cpp b/src/devices/video/t6963c.cpp
index 96995f62c68..215911ed3ff 100644
--- a/src/devices/video/t6963c.cpp
+++ b/src/devices/video/t6963c.cpp
@@ -346,7 +346,7 @@ uint32_t t6963c_device::screen_update(screen_device &screen, bitmap_ind16 &bitma
data = m_display_ram->read_byte(m_cgram_offset + c * 8 + cy);
for(int cx=0; cx<m_font_size; cx++)
- bitmap.pix16(y * 8 + cy, x * m_font_size + cx) = BIT(data, m_font_size - 1 - cx);
+ bitmap.pix(y * 8 + cy, x * m_font_size + cx) = BIT(data, m_font_size - 1 - cx);
}
}
@@ -362,13 +362,13 @@ uint32_t t6963c_device::screen_update(screen_device &screen, bitmap_ind16 &bitma
switch(m_mode & 7)
{
case 0: // OR
- bitmap.pix16(y, x * m_font_size + i) |= pix;
+ bitmap.pix(y, x * m_font_size + i) |= pix;
break;
case 1: // EXOR
- bitmap.pix16(y, x * m_font_size + i) ^= pix;
+ bitmap.pix(y, x * m_font_size + i) ^= pix;
break;
case 3: // AND
- bitmap.pix16(y, x * m_font_size + i) &= pix;
+ bitmap.pix(y, x * m_font_size + i) &= pix;
break;
case 4: // Text attribute
logerror("%s: Unimplemented Text attribute\n", machine().describe_context());
diff --git a/src/devices/video/t6a04.cpp b/src/devices/video/t6a04.cpp
index 8b55f8ce153..a5dc8bfa928 100644
--- a/src/devices/video/t6a04.cpp
+++ b/src/devices/video/t6a04.cpp
@@ -110,7 +110,7 @@ uint32_t t6a04_device::screen_update(screen_device &screen, bitmap_ind16 &bitmap
for (int b=7; b>=0; b--)
{
- bitmap.pix16(x&0x3f, y*8+b) = data & 1;
+ bitmap.pix(x&0x3f, y*8+b) = data & 1;
data>>=1;
}
}
diff --git a/src/devices/video/tms3556.cpp b/src/devices/video/tms3556.cpp
index dbd45105a97..3088e02e685 100644
--- a/src/devices/video/tms3556.cpp
+++ b/src/devices/video/tms3556.cpp
@@ -573,12 +573,12 @@ void tms3556_device::draw_line(bitmap_ind16 &bmp, int line)
// if (m_control_regs[4] & 0x??)
// { // interlaced mode
-// ln = &bmp->pix16(line, m_field);
+// ln = &bmp->pix(line, m_field);
// }
// else
{ /* non-interlaced mode */
- ln = &bmp.pix16(line);
- ln2 = &bmp.pix16(line, 1);
+ ln = &bmp.pix(line);
+ ln2 = &bmp.pix(line, 1);
double_lines = 1;
}
diff --git a/src/devices/video/tms9928a.cpp b/src/devices/video/tms9928a.cpp
index 129b364e860..27395fecacb 100644
--- a/src/devices/video/tms9928a.cpp
+++ b/src/devices/video/tms9928a.cpp
@@ -365,7 +365,7 @@ void tms9928a_device::device_timer(emu_timer &timer, device_timer_id id, int par
int raw_vpos = screen().vpos();
int vpos = raw_vpos * m_vertical_size / screen().height();
uint16_t BackColour = m_Regs[7] & 15;
- uint32_t *p = &m_tmpbmp.pix32(vpos);
+ uint32_t *p = &m_tmpbmp.pix(vpos);
int y = vpos - m_top_border;
diff --git a/src/devices/video/v9938.cpp b/src/devices/video/v9938.cpp
index 0876a3b9923..e82858056e7 100644
--- a/src/devices/video/v9938.cpp
+++ b/src/devices/video/v9938.cpp
@@ -1863,12 +1863,12 @@ void v99x8_device::refresh_32(int line)
if (m_cont_reg[9] & 0x08)
{
- ln = &m_bitmap.pix32(m_scanline*2+((m_stat_reg[2]>>1)&1));
+ ln = &m_bitmap.pix(m_scanline*2+((m_stat_reg[2]>>1)&1));
}
else
{
- ln = &m_bitmap.pix32(m_scanline*2);
- ln2 = &m_bitmap.pix32(m_scanline*2+1);
+ ln = &m_bitmap.pix(m_scanline*2);
+ ln2 = &m_bitmap.pix(m_scanline*2+1);
double_lines = true;
}
diff --git a/src/devices/video/vic4567.cpp b/src/devices/video/vic4567.cpp
index c493e3d3a05..6b8cae5f04f 100644
--- a/src/devices/video/vic4567.cpp
+++ b/src/devices/video/vic4567.cpp
@@ -20,6 +20,8 @@
#include "screen.h"
+#include <algorithm>
+
/*****************************************************************************
CONSTANTS
@@ -424,105 +426,93 @@ TIMER_CALLBACK_MEMBER( vic3_device::timer_timeout )
void vic3_device::draw_character( int ybegin, int yend, int ch, int yoff, int xoff, uint16_t *color, int start_x, int end_x )
{
- int code;
-
for (int y = ybegin; y <= yend; y++)
{
- code = m_dma_read_cb(m_chargenaddr + ch * 8 + y);
+ int code = m_dma_read_cb(m_chargenaddr + ch * 8 + y);
m_screenptr[y + yoff][xoff >> 3] = code;
- if ((xoff + 0 > start_x) && (xoff + 0 < end_x)) m_bitmap->pix16(y + yoff + FIRSTLINE, xoff + 0) = color[code >> 7];
- if ((xoff + 1 > start_x) && (xoff + 0 < end_x)) m_bitmap->pix16(y + yoff + FIRSTLINE, xoff + 1) = color[(code >> 6) & 1];
- if ((xoff + 2 > start_x) && (xoff + 0 < end_x)) m_bitmap->pix16(y + yoff + FIRSTLINE, xoff + 2) = color[(code >> 5) & 1];
- if ((xoff + 3 > start_x) && (xoff + 0 < end_x)) m_bitmap->pix16(y + yoff + FIRSTLINE, xoff + 3) = color[(code >> 4) & 1];
- if ((xoff + 4 > start_x) && (xoff + 0 < end_x)) m_bitmap->pix16(y + yoff + FIRSTLINE, xoff + 4) = color[(code >> 3) & 1];
- if ((xoff + 5 > start_x) && (xoff + 0 < end_x)) m_bitmap->pix16(y + yoff + FIRSTLINE, xoff + 5) = color[(code >> 2) & 1];
- if ((xoff + 6 > start_x) && (xoff + 0 < end_x)) m_bitmap->pix16(y + yoff + FIRSTLINE, xoff + 6) = color[(code >> 1) & 1];
- if ((xoff + 7 > start_x) && (xoff + 0 < end_x)) m_bitmap->pix16(y + yoff + FIRSTLINE, xoff + 7) = color[code & 1];
+ if ((xoff + 0 > start_x) && (xoff + 0 < end_x)) m_bitmap->pix(y + yoff + FIRSTLINE, xoff + 0) = color[code >> 7];
+ if ((xoff + 1 > start_x) && (xoff + 0 < end_x)) m_bitmap->pix(y + yoff + FIRSTLINE, xoff + 1) = color[(code >> 6) & 1];
+ if ((xoff + 2 > start_x) && (xoff + 0 < end_x)) m_bitmap->pix(y + yoff + FIRSTLINE, xoff + 2) = color[(code >> 5) & 1];
+ if ((xoff + 3 > start_x) && (xoff + 0 < end_x)) m_bitmap->pix(y + yoff + FIRSTLINE, xoff + 3) = color[(code >> 4) & 1];
+ if ((xoff + 4 > start_x) && (xoff + 0 < end_x)) m_bitmap->pix(y + yoff + FIRSTLINE, xoff + 4) = color[(code >> 3) & 1];
+ if ((xoff + 5 > start_x) && (xoff + 0 < end_x)) m_bitmap->pix(y + yoff + FIRSTLINE, xoff + 5) = color[(code >> 2) & 1];
+ if ((xoff + 6 > start_x) && (xoff + 0 < end_x)) m_bitmap->pix(y + yoff + FIRSTLINE, xoff + 6) = color[(code >> 1) & 1];
+ if ((xoff + 7 > start_x) && (xoff + 0 < end_x)) m_bitmap->pix(y + yoff + FIRSTLINE, xoff + 7) = color[code & 1];
}
}
void vic3_device::draw_character_multi( int ybegin, int yend, int ch, int yoff, int xoff, int start_x, int end_x )
{
- int code;
-
for (int y = ybegin; y <= yend; y++)
{
- code = m_dma_read_cb(m_chargenaddr + ch * 8 + y);
+ int code = m_dma_read_cb(m_chargenaddr + ch * 8 + y);
m_screenptr[y + yoff][xoff >> 3] = m_foreground[code];
- if ((xoff + 0 > start_x) && (xoff + 0 < end_x)) m_bitmap->pix16(y + yoff + FIRSTLINE, xoff + 0) = m_multi[code >> 6];
- if ((xoff + 1 > start_x) && (xoff + 1 < end_x)) m_bitmap->pix16(y + yoff + FIRSTLINE, xoff + 1) = m_multi[code >> 6];
- if ((xoff + 2 > start_x) && (xoff + 2 < end_x)) m_bitmap->pix16(y + yoff + FIRSTLINE, xoff + 2) = m_multi[(code >> 4) & 3];
- if ((xoff + 3 > start_x) && (xoff + 3 < end_x)) m_bitmap->pix16(y + yoff + FIRSTLINE, xoff + 3) = m_multi[(code >> 4) & 3];
- if ((xoff + 4 > start_x) && (xoff + 4 < end_x)) m_bitmap->pix16(y + yoff + FIRSTLINE, xoff + 4) = m_multi[(code >> 2) & 3];
- if ((xoff + 5 > start_x) && (xoff + 5 < end_x)) m_bitmap->pix16(y + yoff + FIRSTLINE, xoff + 5) = m_multi[(code >> 2) & 3];
- if ((xoff + 6 > start_x) && (xoff + 6 < end_x)) m_bitmap->pix16(y + yoff + FIRSTLINE, xoff + 6) = m_multi[code & 3];
- if ((xoff + 7 > start_x) && (xoff + 7 < end_x)) m_bitmap->pix16(y + yoff + FIRSTLINE, xoff + 7) = m_multi[code & 3];
+ if ((xoff + 0 > start_x) && (xoff + 0 < end_x)) m_bitmap->pix(y + yoff + FIRSTLINE, xoff + 0) = m_multi[code >> 6];
+ if ((xoff + 1 > start_x) && (xoff + 1 < end_x)) m_bitmap->pix(y + yoff + FIRSTLINE, xoff + 1) = m_multi[code >> 6];
+ if ((xoff + 2 > start_x) && (xoff + 2 < end_x)) m_bitmap->pix(y + yoff + FIRSTLINE, xoff + 2) = m_multi[(code >> 4) & 3];
+ if ((xoff + 3 > start_x) && (xoff + 3 < end_x)) m_bitmap->pix(y + yoff + FIRSTLINE, xoff + 3) = m_multi[(code >> 4) & 3];
+ if ((xoff + 4 > start_x) && (xoff + 4 < end_x)) m_bitmap->pix(y + yoff + FIRSTLINE, xoff + 4) = m_multi[(code >> 2) & 3];
+ if ((xoff + 5 > start_x) && (xoff + 5 < end_x)) m_bitmap->pix(y + yoff + FIRSTLINE, xoff + 5) = m_multi[(code >> 2) & 3];
+ if ((xoff + 6 > start_x) && (xoff + 6 < end_x)) m_bitmap->pix(y + yoff + FIRSTLINE, xoff + 6) = m_multi[code & 3];
+ if ((xoff + 7 > start_x) && (xoff + 7 < end_x)) m_bitmap->pix(y + yoff + FIRSTLINE, xoff + 7) = m_multi[code & 3];
}
}
void vic3_device::draw_bitmap( int ybegin, int yend, int ch, int yoff, int xoff, int start_x, int end_x )
{
- int code;
-
for (int y = ybegin; y <= yend; y++)
{
- code = m_dma_read_cb((m_chargenaddr & 0x2000) + ch * 8 + y);
+ int code = m_dma_read_cb((m_chargenaddr & 0x2000) + ch * 8 + y);
m_screenptr[y + yoff][xoff >> 3] = code;
- if ((xoff + 0 > start_x) && (xoff + 0 < end_x)) m_bitmap->pix16(y + yoff + FIRSTLINE, xoff + 0) = m_c64_bitmap[code >> 7];
- if ((xoff + 1 > start_x) && (xoff + 1 < end_x)) m_bitmap->pix16(y + yoff + FIRSTLINE, xoff + 1) = m_c64_bitmap[(code >> 6) & 1];
- if ((xoff + 2 > start_x) && (xoff + 2 < end_x)) m_bitmap->pix16(y + yoff + FIRSTLINE, xoff + 2) = m_c64_bitmap[(code >> 5) & 1];
- if ((xoff + 3 > start_x) && (xoff + 3 < end_x)) m_bitmap->pix16(y + yoff + FIRSTLINE, xoff + 3) = m_c64_bitmap[(code >> 4) & 1];
- if ((xoff + 4 > start_x) && (xoff + 4 < end_x)) m_bitmap->pix16(y + yoff + FIRSTLINE, xoff + 4) = m_c64_bitmap[(code >> 3) & 1];
- if ((xoff + 5 > start_x) && (xoff + 5 < end_x)) m_bitmap->pix16(y + yoff + FIRSTLINE, xoff + 5) = m_c64_bitmap[(code >> 2) & 1];
- if ((xoff + 6 > start_x) && (xoff + 6 < end_x)) m_bitmap->pix16(y + yoff + FIRSTLINE, xoff + 6) = m_c64_bitmap[(code >> 1) & 1];
- if ((xoff + 7 > start_x) && (xoff + 7 < end_x)) m_bitmap->pix16(y + yoff + FIRSTLINE, xoff + 7) = m_c64_bitmap[code & 1];
+ if ((xoff + 0 > start_x) && (xoff + 0 < end_x)) m_bitmap->pix(y + yoff + FIRSTLINE, xoff + 0) = m_c64_bitmap[code >> 7];
+ if ((xoff + 1 > start_x) && (xoff + 1 < end_x)) m_bitmap->pix(y + yoff + FIRSTLINE, xoff + 1) = m_c64_bitmap[(code >> 6) & 1];
+ if ((xoff + 2 > start_x) && (xoff + 2 < end_x)) m_bitmap->pix(y + yoff + FIRSTLINE, xoff + 2) = m_c64_bitmap[(code >> 5) & 1];
+ if ((xoff + 3 > start_x) && (xoff + 3 < end_x)) m_bitmap->pix(y + yoff + FIRSTLINE, xoff + 3) = m_c64_bitmap[(code >> 4) & 1];
+ if ((xoff + 4 > start_x) && (xoff + 4 < end_x)) m_bitmap->pix(y + yoff + FIRSTLINE, xoff + 4) = m_c64_bitmap[(code >> 3) & 1];
+ if ((xoff + 5 > start_x) && (xoff + 5 < end_x)) m_bitmap->pix(y + yoff + FIRSTLINE, xoff + 5) = m_c64_bitmap[(code >> 2) & 1];
+ if ((xoff + 6 > start_x) && (xoff + 6 < end_x)) m_bitmap->pix(y + yoff + FIRSTLINE, xoff + 6) = m_c64_bitmap[(code >> 1) & 1];
+ if ((xoff + 7 > start_x) && (xoff + 7 < end_x)) m_bitmap->pix(y + yoff + FIRSTLINE, xoff + 7) = m_c64_bitmap[code & 1];
}
}
void vic3_device::draw_bitmap_multi( int ybegin, int yend, int ch, int yoff, int xoff, int start_x, int end_x )
{
- int code;
-
for (int y = ybegin; y <= yend; y++)
{
- code = m_dma_read_cb((m_chargenaddr & 0x2000) + ch * 8 + y);
+ int code = m_dma_read_cb((m_chargenaddr & 0x2000) + ch * 8 + y);
m_screenptr[y + yoff][xoff >> 3] = m_foreground[code];
- if ((xoff + 0 > start_x) && (xoff + 0 < end_x)) m_bitmap->pix16(y + yoff + FIRSTLINE, xoff + 0) = m_bitmapmulti[code >> 6];
- if ((xoff + 1 > start_x) && (xoff + 1 < end_x)) m_bitmap->pix16(y + yoff + FIRSTLINE, xoff + 1) = m_bitmapmulti[code >> 6];
- if ((xoff + 2 > start_x) && (xoff + 2 < end_x)) m_bitmap->pix16(y + yoff + FIRSTLINE, xoff + 2) = m_bitmapmulti[(code >> 4) & 3];
- if ((xoff + 3 > start_x) && (xoff + 3 < end_x)) m_bitmap->pix16(y + yoff + FIRSTLINE, xoff + 3) = m_bitmapmulti[(code >> 4) & 3];
- if ((xoff + 4 > start_x) && (xoff + 4 < end_x)) m_bitmap->pix16(y + yoff + FIRSTLINE, xoff + 4) = m_bitmapmulti[(code >> 2) & 3];
- if ((xoff + 5 > start_x) && (xoff + 5 < end_x)) m_bitmap->pix16(y + yoff + FIRSTLINE, xoff + 5) = m_bitmapmulti[(code >> 2) & 3];
- if ((xoff + 6 > start_x) && (xoff + 6 < end_x)) m_bitmap->pix16(y + yoff + FIRSTLINE, xoff + 6) = m_bitmapmulti[code & 3];
- if ((xoff + 7 > start_x) && (xoff + 7 < end_x)) m_bitmap->pix16(y + yoff + FIRSTLINE, xoff + 7) = m_bitmapmulti[code & 3];
+ if ((xoff + 0 > start_x) && (xoff + 0 < end_x)) m_bitmap->pix(y + yoff + FIRSTLINE, xoff + 0) = m_bitmapmulti[code >> 6];
+ if ((xoff + 1 > start_x) && (xoff + 1 < end_x)) m_bitmap->pix(y + yoff + FIRSTLINE, xoff + 1) = m_bitmapmulti[code >> 6];
+ if ((xoff + 2 > start_x) && (xoff + 2 < end_x)) m_bitmap->pix(y + yoff + FIRSTLINE, xoff + 2) = m_bitmapmulti[(code >> 4) & 3];
+ if ((xoff + 3 > start_x) && (xoff + 3 < end_x)) m_bitmap->pix(y + yoff + FIRSTLINE, xoff + 3) = m_bitmapmulti[(code >> 4) & 3];
+ if ((xoff + 4 > start_x) && (xoff + 4 < end_x)) m_bitmap->pix(y + yoff + FIRSTLINE, xoff + 4) = m_bitmapmulti[(code >> 2) & 3];
+ if ((xoff + 5 > start_x) && (xoff + 5 < end_x)) m_bitmap->pix(y + yoff + FIRSTLINE, xoff + 5) = m_bitmapmulti[(code >> 2) & 3];
+ if ((xoff + 6 > start_x) && (xoff + 6 < end_x)) m_bitmap->pix(y + yoff + FIRSTLINE, xoff + 6) = m_bitmapmulti[code & 3];
+ if ((xoff + 7 > start_x) && (xoff + 7 < end_x)) m_bitmap->pix(y + yoff + FIRSTLINE, xoff + 7) = m_bitmapmulti[code & 3];
}
}
void vic3_device::draw_sprite_code( int y, int xbegin, int code, int color, int start_x, int end_x )
{
- int mask, x;
-
if ((y < YPOS) || (y >= (VIC2_STARTVISIBLELINES + VIC2_VISIBLELINES)) || (xbegin <= 1) || (xbegin >= (VIC2_STARTVISIBLECOLUMNS + VIC2_VISIBLECOLUMNS)))
return;
- for (x = 0, mask = 0x80; x < 8; x++, mask >>= 1)
+ for (int x = 0, mask = 0x80; x < 8; x++, mask >>= 1)
{
if (code & mask)
{
if ((xbegin + x > start_x) && (xbegin + x < end_x))
- m_bitmap->pix16(y + FIRSTLINE, xbegin + x) = color;
+ m_bitmap->pix(y + FIRSTLINE, xbegin + x) = color;
}
}
}
void vic3_device::draw_sprite_code_multi( int y, int xbegin, int code, int prior, int start_x, int end_x )
{
- int x, mask, shift;
-
if ((y < YPOS) || (y >= (VIC2_STARTVISIBLELINES + VIC2_VISIBLELINES)) || (xbegin <= 1) || (xbegin >= (VIC2_STARTVISIBLECOLUMNS + VIC2_VISIBLECOLUMNS)))
return;
- for (x = 0, mask = 0xc0, shift = 6; x < 8; x += 2, mask >>= 2, shift -= 2)
+ for (int x = 0, mask = 0xc0, shift = 6; x < 8; x += 2, mask >>= 2, shift -= 2)
{
if (code & mask)
{
@@ -530,17 +520,17 @@ void vic3_device::draw_sprite_code_multi( int y, int xbegin, int code, int prior
{
case 1:
if ((xbegin + x + 1 > start_x) && (xbegin + x + 1 < end_x))
- m_bitmap->pix16(y + FIRSTLINE, xbegin + x + 1) = m_spritemulti[(code >> shift) & 3];
+ m_bitmap->pix(y + FIRSTLINE, xbegin + x + 1) = m_spritemulti[(code >> shift) & 3];
break;
case 2:
if ((xbegin + x > start_x) && (xbegin + x < end_x))
- m_bitmap->pix16(y + FIRSTLINE, xbegin + x) = m_spritemulti[(code >> shift) & 3];
+ m_bitmap->pix(y + FIRSTLINE, xbegin + x) = m_spritemulti[(code >> shift) & 3];
break;
case 3:
if ((xbegin + x > start_x) && (xbegin + x < end_x))
- m_bitmap->pix16(y + FIRSTLINE, xbegin + x) = m_spritemulti[(code >> shift) & 3];
+ m_bitmap->pix(y + FIRSTLINE, xbegin + x) = m_spritemulti[(code >> shift) & 3];
if ((xbegin + x + 1> start_x) && (xbegin + x + 1< end_x))
- m_bitmap->pix16(y + FIRSTLINE, xbegin + x + 1) = m_spritemulti[(code >> shift) & 3];
+ m_bitmap->pix(y + FIRSTLINE, xbegin + x + 1) = m_spritemulti[(code >> shift) & 3];
break;
}
}
@@ -549,8 +539,6 @@ void vic3_device::draw_sprite_code_multi( int y, int xbegin, int code, int prior
void vic3_device::sprite_collision( int nr, int y, int x, int mask )
{
- int value, xdiff;
-
for (int i = 7; i > nr; i--)
{
if (!SPRITEON(i) || !m_sprites[i].paintedline[y] || (SPRITE_COLLISION(i) && SPRITE_COLLISION(nr)))
@@ -559,8 +547,9 @@ void vic3_device::sprite_collision( int nr, int y, int x, int mask )
if ((x + 7 < SPRITE_X_POS(i)) || (x >= SPRITE_X_POS(i) + SPRITE_X_SIZE(i)))
continue;
- xdiff = x - SPRITE_X_POS(i);
+ int xdiff = x - SPRITE_X_POS(i);
+ int value;
if ((x & 7) == (SPRITE_X_POS(i) & 7))
value = m_sprites[i].bitmap[y][xdiff >> 3];
else if (xdiff < 0)
@@ -785,17 +774,6 @@ void vic3_device::draw_sprite_multi( int nr, int yoff, int ybegin, int yend, int
}
}
-#ifndef memset16
-static void *memset16(void *dest, int value, size_t size)
-{
- int i;
-
- for (i = 0; i < size; i++)
- ((short *) dest)[i] = value;
- return dest;
-}
-#endif
-
void vic3_device::drawlines( int first, int last, int start_x, int end_x )
{
int line, vline, end;
@@ -825,7 +803,7 @@ void vic3_device::drawlines( int first, int last, int start_x, int end_x )
{
for (line = first; (line < last) && (line < m_bitmap->height()); line++)
{
- memset16(&m_bitmap->pix16(line + FIRSTLINE), 0, m_bitmap->width());
+ std::fill_n(&m_bitmap->pix(line + FIRSTLINE), m_bitmap->width(), 0);
}
return;
}
@@ -841,7 +819,7 @@ void vic3_device::drawlines( int first, int last, int start_x, int end_x )
for (line = first; line < end; line++)
{
- memset16(&m_bitmap->pix16(line + FIRSTLINE), FRAMECOLOR, m_bitmap->width());
+ std::fill_n(&m_bitmap->pix(line + FIRSTLINE), m_bitmap->width(), FRAMECOLOR);
}
if (LINES25)
@@ -1013,20 +991,14 @@ void vic3_device::drawlines( int first, int last, int start_x, int end_x )
for (; line < end; line++)
{
- memset16(&m_bitmap->pix16(line + FIRSTLINE), FRAMECOLOR, m_bitmap->width());
+ std::fill_n(&m_bitmap->pix(line + FIRSTLINE), m_bitmap->width(), FRAMECOLOR);
}
}
void vic3_device::vic2_drawlines( int first, int last, int start_x, int end_x )
{
- int line, vline, end;
- int attr, ch, ecm;
- int syend;
- int offs, yoff, xoff, ybegin, yend, xbegin, xend;
- int i;
-
if (VIC3_BITPLANES)
- return ;
+ return;
/* temporary allowing vic3 displaying 80 columns */
if (m_reg[0x31] & 0x80)
@@ -1040,8 +1012,8 @@ void vic3_device::vic2_drawlines( int first, int last, int start_x, int end_x )
/* top part of display not rastered */
first -= VIC2_YPOS - YPOS;
- xbegin = VIC2_STARTVISIBLECOLUMNS;
- xend = xbegin + VIC2_VISIBLECOLUMNS;
+ int xbegin = VIC2_STARTVISIBLECOLUMNS;
+ int xend = xbegin + VIC2_VISIBLECOLUMNS;
if (!SCREENON)
{
xbegin = VIC2_STARTVISIBLECOLUMNS;
@@ -1068,12 +1040,13 @@ void vic3_device::vic2_drawlines( int first, int last, int start_x, int end_x )
xend = xbegin + 304;
}
+ int end;
if (first + 1 < m_y_begin)
end = first + 1;
else
end = m_y_begin + YPOS;
- line = first;
+ int line = first;
// top border
if (line < end)
{
@@ -1088,7 +1061,7 @@ void vic3_device::vic2_drawlines( int first, int last, int start_x, int end_x )
line = end;
}
- vline = line - YPOS + 3 - VERTICALPOS;
+ int vline = line - YPOS + 3 - VERTICALPOS;
if (first + 1 < m_y_end + YPOS)
end = first + 1;
@@ -1097,23 +1070,23 @@ void vic3_device::vic2_drawlines( int first, int last, int start_x, int end_x )
if (line < end)
{
- offs = (vline >> 3) * 40;
- ybegin = vline & 7;
- yoff = line - ybegin;
- yend = (yoff + 7 < end) ? 7 : (end - yoff - 1);
+ int offs = (vline >> 3) * 40;
+ int ybegin = vline & 7;
+ int yoff = line - ybegin;
+ int yend = (yoff + 7 < end) ? 7 : (end - yoff - 1);
/* rendering 39 characters */
/* left and right borders are overwritten later */
m_shift[line] = HORIZONTALPOS;
- for (xoff = m_x_begin + XPOS; xoff < m_x_end + XPOS; xoff += 8, offs++)
+ for (int xoff = m_x_begin + XPOS; xoff < m_x_end + XPOS; xoff += 8, offs++)
{
- ch = m_dma_read_cb(m_videoaddr + offs);
+ int ch = m_dma_read_cb(m_videoaddr + offs);
#if 0
- attr = m_dma_read_color_cb(m_videoaddr + offs);
+ int attr = m_dma_read_color_cb(m_videoaddr + offs);
#else
/* temporary until vic3 finished */
- attr = m_dma_read_color_cb((m_videoaddr + offs)&0x3ff)&0x0f;
+ int attr = m_dma_read_color_cb((m_videoaddr + offs)&0x3ff)&0x0f;
#endif
if (HIRESON)
{
@@ -1131,7 +1104,7 @@ void vic3_device::vic2_drawlines( int first, int last, int start_x, int end_x )
}
else if (ECMON)
{
- ecm = ch >> 6;
+ int ecm = ch >> 6;
m_ecmcolor[0] = m_colors[ecm];
m_ecmcolor[1] = attr;
draw_character(ybegin, yend, ch & ~0xC0, yoff, xoff, m_ecmcolor, start_x, end_x);
@@ -1149,7 +1122,7 @@ void vic3_device::vic2_drawlines( int first, int last, int start_x, int end_x )
}
/* sprite priority, sprite overwrites lowerprior pixels */
- for (i = 7; i >= 0; i--)
+ for (int i = 7; i >= 0; i--)
{
if (SPRITEON (i) &&
(yoff + ybegin >= SPRITE_Y_POS (i)) &&
@@ -1158,7 +1131,7 @@ void vic3_device::vic2_drawlines( int first, int last, int start_x, int end_x )
{
int wrapped = - SPRITE_Y_POS (i) + 6;
- syend = yend;
+ int syend = yend;
if (SPRITE_Y_EXPAND (i))
{
@@ -1187,7 +1160,7 @@ void vic3_device::vic2_drawlines( int first, int last, int start_x, int end_x )
{
int wrapped = yoff + ybegin - SPRITE_Y_POS (i);
- syend = yend;
+ int syend = yend;
if (SPRITE_Y_EXPAND (i))
{
@@ -1659,77 +1632,76 @@ uint8_t vic3_device::port_r(offs_t offset)
}
-#define VIC3_MASK(M) \
- if (M) \
- { \
- if (M & 0x01) \
- colors[0] = m_c64_mem_r_cb(VIC3_ADDR(0) + offset); \
- if (M & 0x02) \
- colors[1] = m_c64_mem_r_cb(VIC3_ADDR(1) + offset) << 1; \
- if (M & 0x04) \
- colors[2] = m_c64_mem_r_cb(VIC3_ADDR(2) + offset) << 2; \
- if (M & 0x08) \
- colors[3] = m_c64_mem_r_cb(VIC3_ADDR(3) + offset) << 3; \
- if (M & 0x10) \
- colors[4] = m_c64_mem_r_cb(VIC3_ADDR(4) + offset) << 4; \
- if (M & 0x20) \
- colors[5] = m_c64_mem_r_cb(VIC3_ADDR(5) + offset) << 5; \
- if (M & 0x40) \
- colors[6] = m_c64_mem_r_cb(VIC3_ADDR(6) + offset) << 6; \
- if (M & 0x80) \
- colors[7] = m_c64_mem_r_cb(VIC3_ADDR(7) + offset) << 7; \
- for (i = 7; i >= 0; i--) \
- { \
- p = 0; \
- if (M & 0x01) \
- { \
- p = colors[0] & 0x01; \
- colors[0] >>= 1; \
- } \
- if (M & 0x02) \
- { \
- p |= colors[1] & 0x02; \
- colors[1] >>= 1; \
- } \
- if (M & 0x04) \
- { \
- p |= colors[2] & 0x04; \
- colors[2] >>= 1; \
- } \
- if (M & 0x08) \
- { \
- p |= colors[3] & 0x08; \
- colors[3] >>= 1; \
- } \
- if (M & 0x10) \
- { \
- p |= colors[4] & 0x10; \
- colors[4] >>= 1; \
- } \
- if (M & 0x20) \
- { \
- p |= colors[5] & 0x20; \
- colors[5] >>= 1; \
- } \
- if (M & 0x40) \
- { \
- p |= colors[6] & 0x40; \
- colors[6] >>= 1; \
- } \
- if (M & 0x80) \
- { \
- p |= colors[7] & 0x80; \
- colors[7] >>= 1; \
- } \
- m_bitmap->pix16(YPOS + y, XPOS + x + i) = p; \
- } \
+#define VIC3_MASK(M) \
+ if (M) \
+ { \
+ if (M & 0x01) \
+ colors[0] = m_c64_mem_r_cb(VIC3_ADDR(0) + offset); \
+ if (M & 0x02) \
+ colors[1] = m_c64_mem_r_cb(VIC3_ADDR(1) + offset) << 1; \
+ if (M & 0x04) \
+ colors[2] = m_c64_mem_r_cb(VIC3_ADDR(2) + offset) << 2; \
+ if (M & 0x08) \
+ colors[3] = m_c64_mem_r_cb(VIC3_ADDR(3) + offset) << 3; \
+ if (M & 0x10) \
+ colors[4] = m_c64_mem_r_cb(VIC3_ADDR(4) + offset) << 4; \
+ if (M & 0x20) \
+ colors[5] = m_c64_mem_r_cb(VIC3_ADDR(5) + offset) << 5; \
+ if (M & 0x40) \
+ colors[6] = m_c64_mem_r_cb(VIC3_ADDR(6) + offset) << 6; \
+ if (M & 0x80) \
+ colors[7] = m_c64_mem_r_cb(VIC3_ADDR(7) + offset) << 7; \
+ for (int i = 7; i >= 0; i--) \
+ { \
+ int p = 0; \
+ if (M & 0x01) \
+ { \
+ p = colors[0] & 0x01; \
+ colors[0] >>= 1; \
+ } \
+ if (M & 0x02) \
+ { \
+ p |= colors[1] & 0x02; \
+ colors[1] >>= 1; \
+ } \
+ if (M & 0x04) \
+ { \
+ p |= colors[2] & 0x04; \
+ colors[2] >>= 1; \
+ } \
+ if (M & 0x08) \
+ { \
+ p |= colors[3] & 0x08; \
+ colors[3] >>= 1; \
+ } \
+ if (M & 0x10) \
+ { \
+ p |= colors[4] & 0x10; \
+ colors[4] >>= 1; \
+ } \
+ if (M & 0x20) \
+ { \
+ p |= colors[5] & 0x20; \
+ colors[5] >>= 1; \
+ } \
+ if (M & 0x40) \
+ { \
+ p |= colors[6] & 0x40; \
+ colors[6] >>= 1; \
+ } \
+ if (M & 0x80) \
+ { \
+ p |= colors[7] & 0x80; \
+ colors[7] >>= 1; \
+ } \
+ m_bitmap->pix(YPOS + y, XPOS + x + i) = p; \
+ } \
}
#define VIC3_ADDR(a) VIC3_BITPLANE_IADDR(a)
void vic3_device::interlace_draw_block( int x, int y, int offset )
{
int colors[8] = {0};
- int i, p;
switch (VIC3_BITPLANES_MASK)
{
@@ -1776,13 +1748,13 @@ void vic3_device::interlace_draw_block( int x, int y, int offset )
if (VIC3_BITPLANES_MASK & 0x80)
colors[7] = m_c64_mem_r_cb(VIC3_BITPLANE_IADDR(7) + offset) << 7;
- for (i = 7; i >= 0; i--)
+ for (int i = 7; i >= 0; i--)
{
- m_bitmap->pix16(YPOS + y, XPOS + x + i) =
- (colors[0] & 0x01) | (colors[1] & 0x02)
- | (colors[2] & 0x04) | (colors[3] & 0x08)
- | (colors[4] & 0x10) | (colors[5] & 0x20)
- | (colors[6] & 0x40) | (colors[7] & 0x80);
+ m_bitmap->pix(YPOS + y, XPOS + x + i) =
+ (colors[0] & 0x01) | (colors[1] & 0x02) |
+ (colors[2] & 0x04) | (colors[3] & 0x08) |
+ (colors[4] & 0x10) | (colors[5] & 0x20) |
+ (colors[6] & 0x40) | (colors[7] & 0x80);
colors[0] >>= 1;
colors[1] >>= 1;
colors[2] >>= 1;
@@ -1800,7 +1772,6 @@ void vic3_device::interlace_draw_block( int x, int y, int offset )
void vic3_device::draw_block( int x, int y, int offset )
{
int colors[8] = {0};
- int i, p;
switch (VIC3_BITPLANES_MASK)
{
@@ -1847,13 +1818,13 @@ void vic3_device::draw_block( int x, int y, int offset )
if (VIC3_BITPLANES_MASK & 0x80)
colors[7] = m_c64_mem_r_cb(VIC3_BITPLANE_ADDR(7) + offset) << 7;
- for (i = 7; i >= 0; i--)
+ for (int i = 7; i >= 0; i--)
{
- m_bitmap->pix16(YPOS + y, XPOS + x + i) =
- (colors[0] & 0x01) | (colors[1] & 0x02)
- | (colors[2] & 0x04) | (colors[3] & 0x08)
- | (colors[4] & 0x10) | (colors[5] & 0x20)
- | (colors[6] & 0x40) | (colors[7] & 0x80);
+ m_bitmap->pix(YPOS + y, XPOS + x + i) =
+ (colors[0] & 0x01) | (colors[1] & 0x02) |
+ (colors[2] & 0x04) | (colors[3] & 0x08) |
+ (colors[4] & 0x10) | (colors[5] & 0x20) |
+ (colors[6] & 0x40) | (colors[7] & 0x80);
colors[0] >>= 1;
colors[1] >>= 1;
colors[2] >>= 1;
@@ -1869,17 +1840,15 @@ void vic3_device::draw_block( int x, int y, int offset )
void vic3_device::draw_bitplanes()
{
- int x, y, y1s, offset;
- rectangle vis;
const rectangle &visarea = screen().visible_area();
if (VIC3_LINES == 400)
{ /* interlaced! */
- for (y1s = 0, offset = 0; y1s < 400; y1s += 16)
+ for (int y1s = 0, offset = 0; y1s < 400; y1s += 16)
{
- for (x = 0; x < VIC3_BITPLANES_WIDTH; x += 8)
+ for (int x = 0; x < VIC3_BITPLANES_WIDTH; x += 8)
{
- for (y = y1s; y < y1s + 16; y += 2, offset++)
+ for (int y = y1s; y < y1s + 16; y += 2, offset++)
{
if (m_interlace)
draw_block(x, y, offset);
@@ -1892,11 +1861,11 @@ void vic3_device::draw_bitplanes()
}
else
{
- for (y1s = 0, offset = 0; y1s < 200; y1s += 8)
+ for (int y1s = 0, offset = 0; y1s < 200; y1s += 8)
{
- for (x = 0; x < VIC3_BITPLANES_WIDTH; x += 8)
+ for (int x = 0; x < VIC3_BITPLANES_WIDTH; x += 8)
{
- for (y = y1s; y < y1s + 8; y++, offset++)
+ for (int y = y1s; y < y1s + 8; y++, offset++)
{
draw_block(x, y, offset);
}
@@ -1906,25 +1875,25 @@ void vic3_device::draw_bitplanes()
if (XPOS > 0)
{
- vis.set(0, XPOS - 1, 0, visarea.bottom());
+ rectangle vis(0, XPOS - 1, 0, visarea.bottom());
m_bitmap->fill(FRAMECOLOR, vis);
}
if (XPOS + VIC3_BITPLANES_WIDTH < visarea.right())
{
- vis.set(XPOS + VIC3_BITPLANES_WIDTH, visarea.right(), 0, visarea.bottom());
+ rectangle vis(XPOS + VIC3_BITPLANES_WIDTH, visarea.right(), 0, visarea.bottom());
m_bitmap->fill(FRAMECOLOR, vis);
}
if (YPOS > 0)
{
- vis.set(0, visarea.right(), 0, YPOS - 1);
+ rectangle vis(0, visarea.right(), 0, YPOS - 1);
m_bitmap->fill(FRAMECOLOR, vis);
}
if (YPOS + VIC3_LINES < visarea.bottom())
{
- vis.set(0, visarea.right(), YPOS + VIC3_LINES, visarea.bottom());
+ rectangle vis(0, visarea.right(), YPOS + VIC3_LINES, visarea.bottom());
m_bitmap->fill(FRAMECOLOR, vis);
}
}
diff --git a/src/devices/video/voodoo.cpp b/src/devices/video/voodoo.cpp
index 72ef43032ef..ebc9555f25c 100644
--- a/src/devices/video/voodoo.cpp
+++ b/src/devices/video/voodoo.cpp
@@ -917,8 +917,8 @@ int voodoo_device::voodoo_update(bitmap_rgb32 &bitmap, const rectangle &cliprect
for (y = cliprect.min_y; y <= cliprect.max_y; y++)
if (y >= fbi.yoffs)
{
- uint16_t *src = (uint16_t *)(fbi.ram + fbi.rgboffs[drawbuf]) + (y - fbi.yoffs) * fbi.rowpixels - fbi.xoffs;
- uint32_t *dst = &bitmap.pix32(y);
+ uint16_t const *const src = (uint16_t *)(fbi.ram + fbi.rgboffs[drawbuf]) + (y - fbi.yoffs) * fbi.rowpixels - fbi.xoffs;
+ uint32_t *const dst = &bitmap.pix(y);
for (x = cliprect.min_x; x <= cliprect.max_x; x++)
dst[x] = fbi.pen[src[x]];
}
@@ -944,8 +944,8 @@ int voodoo_device::voodoo_update(bitmap_rgb32 &bitmap, const rectangle &cliprect
{
for (y = cliprect.min_y; y <= cliprect.max_y; y++)
{
- uint16_t* src = (uint16_t*)(fbi.ram + fbi.auxoffs) + (y - fbi.yoffs) * fbi.rowpixels - fbi.xoffs;
- uint32_t* dst = &bitmap.pix32(y);
+ uint16_t const *const src = (uint16_t*)(fbi.ram + fbi.auxoffs) + (y - fbi.yoffs) * fbi.rowpixels - fbi.xoffs;
+ uint32_t *const dst = &bitmap.pix(y);
for (x = cliprect.min_x; x <= cliprect.max_x; x++)
dst[x] = ((src[x] << 8) & 0xff0000) | ((src[x] >> 0) & 0xff00) | ((src[x] >> 8) & 0xff);
}
diff --git a/src/devices/video/vrender0.cpp b/src/devices/video/vrender0.cpp
index f2bb5c74ac1..8a0e7c9319c 100644
--- a/src/devices/video/vrender0.cpp
+++ b/src/devices/video/vrender0.cpp
@@ -716,7 +716,7 @@ uint32_t vr0video_device::screen_update(screen_device &screen, bitmap_ind16 &bit
uint32_t const dx = cliprect.left();
for (int y = cliprect.top(); y <= cliprect.bottom(); y++)
- std::copy_n(&m_DisplayDest[(y * 1024) + dx], width, &bitmap.pix16(y, dx));
+ std::copy_n(&m_DisplayDest[(y * 1024) + dx], width, &bitmap.pix(y, dx));
return 0;
}
diff --git a/src/devices/video/zeus2.cpp b/src/devices/video/zeus2.cpp
index 0c6c34e3fcc..c585373c74e 100644
--- a/src/devices/video/zeus2.cpp
+++ b/src/devices/video/zeus2.cpp
@@ -8,6 +8,9 @@
#include "emu.h"
#include "zeus2.h"
+#include <algorithm>
+
+
#define LOG_REGS 1
// Setting ALWAYS_LOG_FIFO will always log the fifo versus having to hold 'L'
#define ALWAYS_LOG_FIFO 0
@@ -236,10 +239,7 @@ uint32_t zeus2_device::screen_update(screen_device &screen, bitmap_rgb32 &bitmap
for (y = cliprect.min_y; y <= cliprect.max_y; y++)
{
uint32_t *colorptr = &m_frameColor[frame_addr_from_xy(0, y, false)];
- uint32_t *dest = &bitmap.pix32(y);
- for (x = cliprect.min_x; x <= cliprect.max_x; x++) {
- dest[x] = colorptr[x];
- }
+ std::copy(colorptr + cliprect.min_x, colorptr + cliprect.max_x + 1, &bitmap.pix(y, cliprect.min_x));
}
}
@@ -265,7 +265,7 @@ uint32_t zeus2_device::screen_update(screen_device &screen, bitmap_rgb32 &bitmap
int xoffs = screen.visible_area().min_x;
for (y = cliprect.min_y; y <= cliprect.max_y; y++)
{
- uint32_t *dest = &bitmap.pix32(y);
+ uint32_t *const dest = &bitmap.pix(y);
for (x = cliprect.min_x; x <= cliprect.max_x; x++)
{
if (1) {
diff --git a/src/emu/crsshair.cpp b/src/emu/crsshair.cpp
index 6145e668a23..eb8bd09d440 100644
--- a/src/emu/crsshair.cpp
+++ b/src/emu/crsshair.cpp
@@ -168,7 +168,6 @@ void render_crosshair::set_default_bitmap()
void render_crosshair::create_bitmap()
{
- int x, y;
rgb_t color = m_player < ARRAY_LENGTH(crosshair_colors) ? crosshair_colors[m_player] : rgb_t::white();
// if we have a bitmap and texture for this player, kill it
@@ -204,14 +203,14 @@ void render_crosshair::create_bitmap()
m_bitmap->fill(rgb_t(0x00,0xff,0xff,0xff));
/* extract the raw source data to it */
- for (y = 0; y < CROSSHAIR_RAW_SIZE / 2; y++)
+ for (int y = 0; y < CROSSHAIR_RAW_SIZE / 2; y++)
{
/* assume it is mirrored vertically */
- u32 *dest0 = &m_bitmap->pix32(y);
- u32 *dest1 = &m_bitmap->pix32(CROSSHAIR_RAW_SIZE - 1 - y);
+ u32 *const dest0 = &m_bitmap->pix(y);
+ u32 *const dest1 = &m_bitmap->pix(CROSSHAIR_RAW_SIZE - 1 - y);
/* extract to two rows simultaneously */
- for (x = 0; x < CROSSHAIR_RAW_SIZE; x++)
+ for (int x = 0; x < CROSSHAIR_RAW_SIZE; x++)
if ((crosshair_raw_top[y * CROSSHAIR_RAW_ROWBYTES + x / 8] << (x % 8)) & 0x80)
dest0[x] = dest1[x] = rgb_t(0xff,0x00,0x00,0x00) | color;
}
diff --git a/src/emu/render.cpp b/src/emu/render.cpp
index 46123a02b3f..817ae6e14cc 100644
--- a/src/emu/render.cpp
+++ b/src/emu/render.cpp
@@ -483,7 +483,7 @@ void render_texture::get_scaled(u32 dwidth, u32 dheight, render_texinfo &texinfo
// finally fill out the new info
primlist.add_reference(scaled->bitmap);
- texinfo.base = &scaled->bitmap->pix32(0);
+ texinfo.base = &scaled->bitmap->pix(0);
texinfo.rowpixels = scaled->bitmap->rowpixels();
texinfo.width = dwidth;
texinfo.height = dheight;
@@ -718,8 +718,8 @@ void render_container::overlay_scale(bitmap_argb32 &dest, bitmap_argb32 &source,
// simply replicate the source bitmap over the target
for (int y = 0; y < dest.height(); y++)
{
- u32 *src = &source.pix32(y % source.height());
- u32 *dst = &dest.pix32(y);
+ u32 const *const src = &source.pix(y % source.height());
+ u32 *dst = &dest.pix(y);
int sx = 0;
// loop over columns
diff --git a/src/emu/rendfont.cpp b/src/emu/rendfont.cpp
index 7b69a6e97e5..13249a083fc 100644
--- a/src/emu/rendfont.cpp
+++ b/src/emu/rendfont.cpp
@@ -664,7 +664,7 @@ void render_font::char_expand(char32_t chnum, glyph &gl)
for (int y = 0; y < gl.bmheight; y++)
{
int desty = y + m_height_cmd + m_yoffs_cmd - gl.yoffs - gl.bmheight;
- u32 *dest = (desty >= 0 && desty < m_height_cmd) ? &gl.bitmap.pix32(desty, 0) : nullptr;
+ u32 *dest = (desty >= 0 && desty < m_height_cmd) ? &gl.bitmap.pix(desty, 0) : nullptr;
{
for (int x = 0; x < gl.bmwidth; x++)
{
@@ -723,7 +723,7 @@ void render_font::char_expand(char32_t chnum, glyph &gl)
for (int y = 0; y < gl.bmheight; ++y)
{
int const desty(y + m_height + m_yoffs - gl.yoffs - gl.bmheight);
- u32 *dest(((0 <= desty) && (m_height > desty)) ? &gl.bitmap.pix32(desty) : nullptr);
+ u32 *dest(((0 <= desty) && (m_height > desty)) ? &gl.bitmap.pix(desty) : nullptr);
if (m_format == format::TEXT)
{
@@ -1531,7 +1531,7 @@ bool render_font::save_cached(const char *filename, u64 length, u32 hash)
for (int y = 0; y < gl.bmheight; y++)
{
int desty = y + m_height + m_yoffs - gl.yoffs - gl.bmheight;
- const u32 *src = (desty >= 0 && desty < m_height) ? &gl.bitmap.pix32(desty) : nullptr;
+ u32 const *const src = (desty >= 0 && desty < m_height) ? &gl.bitmap.pix(desty) : nullptr;
for (int x = 0; x < gl.bmwidth; x++)
{
if (src != nullptr && rgb_t(src[x]).a() != 0)
diff --git a/src/emu/rendlay.cpp b/src/emu/rendlay.cpp
index 46502185e29..de64a98bf30 100644
--- a/src/emu/rendlay.cpp
+++ b/src/emu/rendlay.cpp
@@ -1432,7 +1432,7 @@ private:
m_bitmap.fill(0);
for (int step = 0; step < 100; step += 25)
for (int line = 0; line < 100; line++)
- m_bitmap.pix32((step + line) % 100, line % 100) = rgb_t(0xff,0xff,0xff,0xff);
+ m_bitmap.pix((step + line) % 100, line % 100) = rgb_t(0xff,0xff,0xff,0xff);
// log an error
if (m_alphafile.empty())
@@ -2437,8 +2437,8 @@ protected:
if (effy >= bounds.top() && effy <= bounds.bottom())
{
- u32 *src = &tempbitmap2.pix32(y);
- u32 *d = &dest.pix32(effy);
+ u32 const *const src = &tempbitmap2.pix(y);
+ u32 *const d = &dest.pix(effy);
for (int x = 0; x < dest.width(); x++)
{
int effx = x;
@@ -2484,8 +2484,8 @@ protected:
if (effy >= bounds.top() && effy <= bounds.bottom())
{
- u32 *src = &tempbitmap.pix32(y);
- u32 *d = &dest.pix32(effy);
+ u32 const *const src = &tempbitmap.pix(y);
+ u32 *const d = &dest.pix(effy);
for (int x = 0; x < chbounds.width(); x++)
{
int effx = curx + x + chbounds.left();
@@ -2597,8 +2597,8 @@ private:
if (effy >= bounds.top() && effy <= bounds.bottom())
{
- u32 *src = &tempbitmap2.pix32(y);
- u32 *d = &dest.pix32(effy);
+ u32 const *const src = &tempbitmap2.pix(y);
+ u32 *const d = &dest.pix(effy);
for (int x = 0; x < ourwidth/num_shown; x++)
{
int effx = basex + x;
@@ -2645,8 +2645,8 @@ private:
if (effy >= bounds.top() && effy <= bounds.bottom())
{
- u32 *src = &tempbitmap.pix32(y);
- u32 *d = &dest.pix32(effy);
+ u32 const *const src = &tempbitmap.pix(y);
+ u32 *const d = &dest.pix(effy);
for (int x = 0; x < chbounds.width(); x++)
{
int effx = basex + curx + x;
@@ -3109,8 +3109,8 @@ void layout_element::component::draw_text(
int effy = bounds.top() + y;
if (effy >= bounds.top() && effy <= bounds.bottom())
{
- u32 *src = &tempbitmap.pix32(y);
- u32 *d = &dest.pix32(effy);
+ u32 const *const src = &tempbitmap.pix(y);
+ u32 *const d = &dest.pix(effy);
for (int x = 0; x < chbounds.width(); x++)
{
int effx = curx + x + chbounds.left();
@@ -3149,8 +3149,8 @@ void layout_element::component::draw_segment_horizontal_caps(bitmap_argb32 &dest
// loop over the width of the segment
for (int y = 0; y < width / 2; y++)
{
- u32 *d0 = &dest.pix32(midy - y);
- u32 *d1 = &dest.pix32(midy + y);
+ u32 *const d0 = &dest.pix(midy - y);
+ u32 *const d1 = &dest.pix(midy + y);
int ty = (y < width / 8) ? width / 8 : y;
// loop over the length of the segment
@@ -3182,8 +3182,8 @@ void layout_element::component::draw_segment_vertical_caps(bitmap_argb32 &dest,
// loop over the width of the segment
for (int x = 0; x < width / 2; x++)
{
- u32 *d0 = &dest.pix32(0, midx - x);
- u32 *d1 = &dest.pix32(0, midx + x);
+ u32 *const d0 = &dest.pix(0, midx - x);
+ u32 *const d1 = &dest.pix(0, midx + x);
int tx = (x < width / 8) ? width / 8 : x;
// loop over the length of the segment
@@ -3219,7 +3219,7 @@ void layout_element::component::draw_segment_diagonal_1(bitmap_argb32 &dest, int
for (int x = minx; x < maxx; x++)
if (x >= 0 && x < dest.width())
{
- u32 *d = &dest.pix32(0, x);
+ u32 *const d = &dest.pix(0, x);
int step = (x - minx) * ratio;
for (int y = maxy - width - step; y < maxy - step; y++)
@@ -3244,7 +3244,7 @@ void layout_element::component::draw_segment_diagonal_2(bitmap_argb32 &dest, int
for (int x = minx; x < maxx; x++)
if (x >= 0 && x < dest.width())
{
- u32 *d = &dest.pix32(0, x);
+ u32 *const d = &dest.pix(0, x);
int step = (x - minx) * ratio;
for (int y = miny + step; y < miny + step + width; y++)
@@ -3267,8 +3267,8 @@ void layout_element::component::draw_segment_decimal(bitmap_argb32 &dest, int mi
// iterate over y
for (u32 y = 0; y <= width; y++)
{
- u32 *d0 = &dest.pix32(midy - y);
- u32 *d1 = &dest.pix32(midy + y);
+ u32 *const d0 = &dest.pix(midy - y);
+ u32 *const d1 = &dest.pix(midy + y);
float xval = width * sqrt(1.0f - (float)(y * y) * ooradius2);
s32 left, right;
@@ -3296,7 +3296,7 @@ void layout_element::component::draw_segment_comma(bitmap_argb32 &dest, int minx
// draw line
for (int x = minx; x < maxx; x++)
{
- u32 *d = &dest.pix32(0, x);
+ u32 *const d = &dest.pix(0, x);
int step = (x - minx) * ratio;
for (int y = maxy; y < maxy - width - step; y--)
@@ -3313,7 +3313,7 @@ void layout_element::component::apply_skew(bitmap_argb32 &dest, int skewwidth)
{
for (int y = 0; y < dest.height(); y++)
{
- u32 *destrow = &dest.pix32(y);
+ u32 *const destrow = &dest.pix(y);
int offs = skewwidth * (dest.height() - y) / dest.height();
for (int x = dest.width() - skewwidth - 1; x >= 0; x--)
destrow[x + offs] = destrow[x];
diff --git a/src/emu/rendutil.cpp b/src/emu/rendutil.cpp
index f3e4950f598..18755ffb340 100644
--- a/src/emu/rendutil.cpp
+++ b/src/emu/rendutil.cpp
@@ -42,7 +42,7 @@ void render_resample_argb_bitmap_hq(bitmap_argb32 &dest, bitmap_argb32 &source,
return;
/* adjust the source base */
- const u32 *sbase = &source.pix32(0);
+ const u32 *sbase = &source.pix(0);
/* determine the steppings */
u32 swidth = source.width();
@@ -599,11 +599,11 @@ void render_load_jpeg(bitmap_argb32 &bitmap, emu_file &file, const char *dirname
if (s == 1)
for (int i = 0; i < w; ++i)
- bitmap.pix32(j, i) = rgb_t(0xFF, buffer[0][i], buffer[0][i], buffer[0][i]);
+ bitmap.pix(j, i) = rgb_t(0xFF, buffer[0][i], buffer[0][i], buffer[0][i]);
else if (s == 3)
for (int i = 0; i < w; ++i)
- bitmap.pix32(j, i) = rgb_t(0xFF, buffer[0][i * s], buffer[0][i * s + 1], buffer[0][i * s + 2]);
+ bitmap.pix(j, i) = rgb_t(0xFF, buffer[0][i * s], buffer[0][i * s + 1], buffer[0][i * s + 2]);
else
{
osd_printf_error("Cannot read JPEG data from %s file.\n", fname);
@@ -726,7 +726,7 @@ static bool copy_png_alpha_to_bitmap(bitmap_argb32 &bitmap, const png_info &png)
{
for (u32 x = 0; width > x; ++x, ++src)
{
- bitmap_argb32::pixel_t &dest(png.interlace_method ? bitmap.pix32(y_trans(y), x_trans(x)) : bitmap.pix32(y, x));
+ bitmap_argb32::pixel_t &dest(png.interlace_method ? bitmap.pix(y_trans(y), x_trans(x)) : bitmap.pix(y, x));
rgb_t const pixel(dest);
u8 const alpha(rgb_t(png.palette[*src * 3], png.palette[*src * 3 + 1], png.palette[*src * 3 + 2]).brightness());
accumalpha &= alpha;
@@ -741,7 +741,7 @@ static bool copy_png_alpha_to_bitmap(bitmap_argb32 &bitmap, const png_info &png)
{
for (u32 x = 0; width > x; ++x, ++src)
{
- bitmap_argb32::pixel_t &dest(png.interlace_method ? bitmap.pix32(y_trans(y), x_trans(x)) : bitmap.pix32(y, x));
+ bitmap_argb32::pixel_t &dest(png.interlace_method ? bitmap.pix(y_trans(y), x_trans(x)) : bitmap.pix(y, x));
rgb_t const pixel(dest);
accumalpha &= *src;
dest = rgb_t(*src, pixel.r(), pixel.g(), pixel.b());
@@ -755,7 +755,7 @@ static bool copy_png_alpha_to_bitmap(bitmap_argb32 &bitmap, const png_info &png)
{
for (u32 x = 0; width > x; ++x, src += 2)
{
- bitmap_argb32::pixel_t &dest(png.interlace_method ? bitmap.pix32(y_trans(y), x_trans(x)) : bitmap.pix32(y, x));
+ bitmap_argb32::pixel_t &dest(png.interlace_method ? bitmap.pix(y_trans(y), x_trans(x)) : bitmap.pix(y, x));
rgb_t const pixel(dest);
accumalpha &= *src;
dest = rgb_t(*src, pixel.r(), pixel.g(), pixel.b());
@@ -769,7 +769,7 @@ static bool copy_png_alpha_to_bitmap(bitmap_argb32 &bitmap, const png_info &png)
{
for (u32 x = 0; width > x; ++x, src += 3)
{
- bitmap_argb32::pixel_t &dest(png.interlace_method ? bitmap.pix32(y_trans(y), x_trans(x)) : bitmap.pix32(y, x));
+ bitmap_argb32::pixel_t &dest(png.interlace_method ? bitmap.pix(y_trans(y), x_trans(x)) : bitmap.pix(y, x));
rgb_t const pixel(dest);
u8 const alpha(rgb_t(src[0], src[1], src[2]).brightness());
accumalpha &= alpha;
@@ -784,7 +784,7 @@ static bool copy_png_alpha_to_bitmap(bitmap_argb32 &bitmap, const png_info &png)
{
for (u32 x = 0; width > x; ++x, src += 4)
{
- bitmap_argb32::pixel_t &dest(png.interlace_method ? bitmap.pix32(y_trans(y), x_trans(x)) : bitmap.pix32(y, x));
+ bitmap_argb32::pixel_t &dest(png.interlace_method ? bitmap.pix(y_trans(y), x_trans(x)) : bitmap.pix(y, x));
rgb_t const pixel(dest);
u8 const alpha(rgb_t(src[0], src[1], src[2]).brightness());
accumalpha &= alpha;
diff --git a/src/emu/screen.cpp b/src/emu/screen.cpp
index 8c6e69c0059..cacd16d5982 100644
--- a/src/emu/screen.cpp
+++ b/src/emu/screen.cpp
@@ -1730,9 +1730,9 @@ void screen_device::create_composited_bitmap()
{
for (int y = 0; y < dstheight; y++)
{
- bitmap_ind16 &srcbitmap = *(bitmap_ind16 *)m_scan_bitmaps[m_curbitmap][y];
- u16 *dst = &curbitmap.as_ind16().pix16(y);
- const u16 *src = &srcbitmap.pix16(0);
+ const bitmap_ind16 &srcbitmap = *(bitmap_ind16 *)m_scan_bitmaps[m_curbitmap][y];
+ u16 *dst = &curbitmap.as_ind16().pix(y);
+ const u16 *src = &srcbitmap.pix(0);
const int dx = (m_scan_widths[y] << 15) / dstwidth;
for (int x = 0; x < m_scan_widths[y]; x += dx)
{
@@ -1746,9 +1746,9 @@ void screen_device::create_composited_bitmap()
{
for (int y = 0; y < dstheight; y++)
{
- bitmap_rgb32 &srcbitmap = *(bitmap_rgb32 *)m_scan_bitmaps[m_curbitmap][y];
- u32 *dst = &curbitmap.as_rgb32().pix32(y);
- const u32 *src = &srcbitmap.pix32(0);
+ const bitmap_rgb32 &srcbitmap = *(bitmap_rgb32 *)m_scan_bitmaps[m_curbitmap][y];
+ u32 *dst = &curbitmap.as_rgb32().pix(y);
+ const u32 *src = &srcbitmap.pix(0);
const int dx = (m_scan_widths[y] << 15) / dstwidth;
for (int x = 0; x < dstwidth << 15; x += dx)
{
@@ -1837,10 +1837,10 @@ void screen_device::update_burnin()
// iterate over rows in the destination
for (int y = 0, srcy = ystart; y < dstheight; y++, srcy += ystep)
{
- bitmap_ind16 &srcbitmap = per_scanline ? *(bitmap_ind16 *)m_scan_bitmaps[m_curbitmap][y] : curbitmap.as_ind16();
- u64 *dst = &m_burnin.pix64(y);
- const u16 *src = &srcbitmap.pix16(per_scanline ? 0 : (srcy >> 16));
- const rgb_t *palette = m_palette->palette()->entry_list_adjusted();
+ const bitmap_ind16 &srcbitmap = per_scanline ? *(bitmap_ind16 *)m_scan_bitmaps[m_curbitmap][y] : curbitmap.as_ind16();
+ u64 *const dst = &m_burnin.pix(y);
+ u16 const *const src = &srcbitmap.pix(per_scanline ? 0 : (srcy >> 16));
+ rgb_t const *const palette = m_palette->palette()->entry_list_adjusted();
for (int x = 0, srcx = xstart; x < dstwidth; x++, srcx += xstep)
{
rgb_t pixel = palette[src[srcx >> 16]];
@@ -1855,9 +1855,9 @@ void screen_device::update_burnin()
// iterate over rows in the destination
for (int y = 0, srcy = ystart; y < dstheight; y++, srcy += ystep)
{
- bitmap_rgb32 &srcbitmap = per_scanline ? *(bitmap_rgb32 *)m_scan_bitmaps[m_curbitmap][y] : curbitmap.as_rgb32();
- u64 *dst = &m_burnin.pix64(y);
- const u32 *src = &srcbitmap.pix32(per_scanline ? 0 : (srcy >> 16));
+ const bitmap_rgb32 &srcbitmap = per_scanline ? *(bitmap_rgb32 *)m_scan_bitmaps[m_curbitmap][y] : curbitmap.as_rgb32();
+ u64 *const dst = &m_burnin.pix(y);
+ u32 const *const src = &srcbitmap.pix(per_scanline ? 0 : (srcy >> 16));
for (int x = 0, srcx = xstart; x < dstwidth; x++, srcx += xstep)
{
rgb_t pixel = src[srcx >> 16];
@@ -1900,7 +1900,7 @@ void screen_device::finalize_burnin()
u64 maxval = 0;
for (int y = 0; y < srcheight; y++)
{
- u64 *src = &m_burnin.pix64(y);
+ u64 const *const src = &m_burnin.pix(y);
for (int x = 0; x < srcwidth; x++)
{
minval = std::min(minval, src[x]);
@@ -1914,8 +1914,8 @@ void screen_device::finalize_burnin()
// now normalize and convert to RGB
for (int y = 0, srcy = 0; y < dstheight; y++, srcy += ystep)
{
- u64 *src = &m_burnin.pix64(srcy >> 16);
- u32 *dst = &finalmap.pix32(y);
+ u64 const *const src = &m_burnin.pix(srcy >> 16);
+ u32 *const dst = &finalmap.pix(y);
for (int x = 0, srcx = 0; x < dstwidth; x++, srcx += xstep)
{
int brightness = u64(maxval - src[srcx >> 16]) * 255 / (maxval - minval);
diff --git a/src/emu/tilemap.cpp b/src/emu/tilemap.cpp
index fab04e8f162..4252b9259a2 100644
--- a/src/emu/tilemap.cpp
+++ b/src/emu/tilemap.cpp
@@ -860,8 +860,8 @@ u8 tilemap_t::tile_draw(const u8 *pendata, u32 x0, u32 y0, u32 palette_base, u8
u8 andmask = ~0, ormask = 0;
for (u16 ty = 0; ty < m_tileheight; ty++)
{
- u16 *pixptr = &m_pixmap.pix16(y0, x0);
- u8 *flagsptr = &m_flagsmap.pix8(y0, x0);
+ u16 *pixptr = &m_pixmap.pix(y0, x0);
+ u8 *flagsptr = &m_flagsmap.pix(y0, x0);
// pre-advance to the next row
y0 += dy0;
@@ -913,7 +913,7 @@ u8 tilemap_t::tile_apply_bitmask(const u8 *maskdata, u32 x0, u32 y0, u8 category
for (u16 ty = 0; ty < m_tileheight; ty++)
{
// pre-advance to the next row
- u8 *flagsptr = &m_flagsmap.pix8(y0, x0);
+ u8 *flagsptr = &m_flagsmap.pix(y0, x0);
y0 += dy0;
// anywhere the bitmask is 0 should be transparent
@@ -1182,7 +1182,7 @@ void tilemap_t::draw_instance(screen_device &screen, _BitmapClass &dest, const b
// look up priority and destination base addresses for y1
bitmap_ind8 &priority_bitmap = *blit.priority;
- u8 *priority_baseaddr = &priority_bitmap.pix8(y1, xpos);
+ u8 *priority_baseaddr = &priority_bitmap.pix(y1, xpos);
typename _BitmapClass::pixel_t *dest_baseaddr = nullptr;
int dest_rowpixels = 0;
if (dest.valid())
@@ -1198,8 +1198,8 @@ void tilemap_t::draw_instance(screen_device &screen, _BitmapClass &dest, const b
y2 -= ypos;
// get tilemap pixels
- const u16 *source_baseaddr = &m_pixmap.pix16(y1);
- const u8 *mask_baseaddr = &m_flagsmap.pix8(y1);
+ const u16 *source_baseaddr = &m_pixmap.pix(y1);
+ const u8 *mask_baseaddr = &m_flagsmap.pix(y1);
// get start/stop columns, rounding outward
int mincol = x1 / m_tilewidth;
@@ -1396,9 +1396,9 @@ void tilemap_t::draw_roz_core(screen_device &screen, _BitmapClass &destbitmap, c
u32 cy = starty >> 16;
// get source and priority pointers
- u8 *pri = (priority != 0xff00) ? &priority_bitmap.pix8(sy, sx) : nullptr;
- const u16 *src = &m_pixmap.pix16(cy);
- const u8 *maskptr = &m_flagsmap.pix8(cy);
+ u8 *pri = (priority != 0xff00) ? &priority_bitmap.pix(sy, sx) : nullptr;
+ const u16 *src = &m_pixmap.pix(cy);
+ const u8 *maskptr = &m_flagsmap.pix(cy);
typename _BitmapClass::pixel_t *dest = &destbitmap.pix(sy, sx);
// loop over columns
@@ -1440,15 +1440,15 @@ void tilemap_t::draw_roz_core(screen_device &screen, _BitmapClass &destbitmap, c
// get dest and priority pointers
typename _BitmapClass::pixel_t *dest = &destbitmap.pix(sy, sx);
- u8 *pri = (priority != 0xff00) ? &priority_bitmap.pix8(sy, sx) : nullptr;
+ u8 *pri = (priority != 0xff00) ? &priority_bitmap.pix(sy, sx) : nullptr;
// loop over columns
while (x <= ex)
{
// plot if we match the mask
- if ((m_flagsmap.pix8((cy >> 16) & ymask, (cx >> 16) & xmask) & mask) == value)
+ if ((m_flagsmap.pix((cy >> 16) & ymask, (cx >> 16) & xmask) & mask) == value)
{
- ROZ_PLOT_PIXEL(m_pixmap.pix16((cy >> 16) & ymask, (cx >> 16) & xmask));
+ ROZ_PLOT_PIXEL(m_pixmap.pix((cy >> 16) & ymask, (cx >> 16) & xmask));
if (priority != 0xff00)
*pri = (*pri & (priority >> 8)) | priority;
}
@@ -1482,16 +1482,16 @@ void tilemap_t::draw_roz_core(screen_device &screen, _BitmapClass &destbitmap, c
// get dest and priority pointers
typename _BitmapClass::pixel_t *dest = &destbitmap.pix(sy, sx);
- u8 *pri = (priority != 0xff00) ? &priority_bitmap.pix8(sy, sx) : nullptr;
+ u8 *pri = (priority != 0xff00) ? &priority_bitmap.pix(sy, sx) : nullptr;
// loop over columns
while (x <= ex)
{
// plot if we're within the bitmap and we match the mask
if (cx < widthshifted && cy < heightshifted)
- if ((m_flagsmap.pix8(cy >> 16, cx >> 16) & mask) == value)
+ if ((m_flagsmap.pix(cy >> 16, cx >> 16) & mask) == value)
{
- ROZ_PLOT_PIXEL(m_pixmap.pix16(cy >> 16, cx >> 16));
+ ROZ_PLOT_PIXEL(m_pixmap.pix(cy >> 16, cx >> 16));
if (priority != 0xff00)
*pri = (*pri & (priority >> 8)) | priority;
}
diff --git a/src/emu/video.cpp b/src/emu/video.cpp
index e28e6aa1bae..6f88d9ae03d 100644
--- a/src/emu/video.cpp
+++ b/src/emu/video.cpp
@@ -1075,9 +1075,9 @@ void video_manager::create_snapshot_bitmap(screen_device *screen)
render_primitive_list &primlist = m_snap_target->get_primitives();
primlist.acquire_lock();
if (machine().options().snap_bilinear())
- snap_renderer_bilinear::draw_primitives(primlist, &m_snap_bitmap.pix32(0), width, height, m_snap_bitmap.rowpixels());
+ snap_renderer_bilinear::draw_primitives(primlist, &m_snap_bitmap.pix(0), width, height, m_snap_bitmap.rowpixels());
else
- snap_renderer::draw_primitives(primlist, &m_snap_bitmap.pix32(0), width, height, m_snap_bitmap.rowpixels());
+ snap_renderer::draw_primitives(primlist, &m_snap_bitmap.pix(0), width, height, m_snap_bitmap.rowpixels());
primlist.release_lock();
}
diff --git a/src/frontend/mame/ui/selmenu.cpp b/src/frontend/mame/ui/selmenu.cpp
index 92bdd3ada64..cfcb6175dc5 100644
--- a/src/frontend/mame/ui/selmenu.cpp
+++ b/src/frontend/mame/ui/selmenu.cpp
@@ -392,9 +392,9 @@ menu_select_launch::cache::cache(running_machine &machine)
// create a texture for snapshot
m_snapx_texture.reset(render.texture_alloc(render_texture::hq_scale));
- std::memcpy(&m_no_avail_bitmap.pix32(0), no_avail_bmp, 256 * 256 * sizeof(uint32_t));
+ std::memcpy(&m_no_avail_bitmap.pix(0), no_avail_bmp, 256 * 256 * sizeof(uint32_t));
- std::memcpy(&m_star_bitmap.pix32(0), favorite_star_bmp, 32 * 32 * sizeof(uint32_t));
+ std::memcpy(&m_star_bitmap.pix(0), favorite_star_bmp, 32 * 32 * sizeof(uint32_t));
m_star_texture.reset(render.texture_alloc());
m_star_texture->set_bitmap(m_star_bitmap, m_star_bitmap.cliprect(), TEXFORMAT_ARGB32);
@@ -410,7 +410,7 @@ menu_select_launch::cache::cache(running_machine &machine)
m_toolbar_texture.emplace_back(render.texture_alloc(), render);
m_sw_toolbar_texture.emplace_back(render.texture_alloc(), render);
- std::memcpy(&m_toolbar_bitmap.back().pix32(0), toolbar_bitmap_bmp[i], 32 * 32 * sizeof(uint32_t));
+ std::memcpy(&m_toolbar_bitmap.back().pix(0), toolbar_bitmap_bmp[i], 32 * 32 * sizeof(uint32_t));
if (m_toolbar_bitmap.back().valid())
m_toolbar_texture.back()->set_bitmap(m_toolbar_bitmap.back(), m_toolbar_bitmap.back().cliprect(), TEXFORMAT_ARGB32);
else
@@ -418,7 +418,7 @@ menu_select_launch::cache::cache(running_machine &machine)
if ((i == 0U) || (i == 2U))
{
- std::memcpy(&m_sw_toolbar_bitmap.back().pix32(0), toolbar_bitmap_bmp[i], 32 * 32 * sizeof(uint32_t));
+ std::memcpy(&m_sw_toolbar_bitmap.back().pix(0), toolbar_bitmap_bmp[i], 32 * 32 * sizeof(uint32_t));
if (m_sw_toolbar_bitmap.back().valid())
m_sw_toolbar_texture.back()->set_bitmap(m_sw_toolbar_bitmap.back(), m_sw_toolbar_bitmap.back().cliprect(), TEXFORMAT_ARGB32);
else
@@ -1147,7 +1147,7 @@ bool menu_select_launch::scale_icon(bitmap_argb32 &&src, texture_and_bitmap &dst
dst.bitmap.allocate(max_width, max_height);
for (int y = 0; tmp.height() > y; ++y)
for (int x = 0; tmp.width() > x; ++x)
- dst.bitmap.pix32(y, x) = tmp.pix32(y, x);
+ dst.bitmap.pix(y, x) = tmp.pix(y, x);
dst.texture->set_bitmap(dst.bitmap, dst.bitmap.cliprect(), TEXFORMAT_ARGB32);
return true;
}
@@ -2412,7 +2412,7 @@ void menu_select_launch::arts_render_images(bitmap_argb32 &&tmp_bitmap, float or
for (int x = 0; x < 256; x++)
{
for (int y = 0; y < 256; y++)
- tmp_bitmap.pix32(y, x) = src.pix32(y, x);
+ tmp_bitmap.pix(y, x) = src.pix(y, x);
}
no_available = true;
}
@@ -2475,7 +2475,7 @@ void menu_select_launch::arts_render_images(bitmap_argb32 &&tmp_bitmap, float or
for (int x = 0; x < dest_xPixel; x++)
for (int y = 0; y < dest_yPixel; y++)
- snapx_bitmap.pix32(y + y1, x + x1) = dest_bitmap.pix32(y, x);
+ snapx_bitmap.pix(y + y1, x + x1) = dest_bitmap.pix(y, x);
// apply bitmap
m_cache->snapx_texture()->set_bitmap(snapx_bitmap, snapx_bitmap.cliprect(), TEXFORMAT_ARGB32);
diff --git a/src/frontend/mame/ui/ui.cpp b/src/frontend/mame/ui/ui.cpp
index ff16d117117..c229110caac 100644
--- a/src/frontend/mame/ui/ui.cpp
+++ b/src/frontend/mame/ui/ui.cpp
@@ -216,7 +216,7 @@ void mame_ui_manager::init()
config_save_delegate(&mame_ui_manager::config_save, this));
// create mouse bitmap
- uint32_t *dst = &m_mouse_bitmap.pix32(0);
+ uint32_t *dst = &m_mouse_bitmap.pix(0);
memcpy(dst,mouse_bitmap,32*32*sizeof(uint32_t));
m_mouse_arrow_texture = machine().render().texture_alloc();
m_mouse_arrow_texture->set_bitmap(m_mouse_bitmap, m_mouse_bitmap.cliprect(), TEXFORMAT_ARGB32);
diff --git a/src/frontend/mame/ui/viewgfx.cpp b/src/frontend/mame/ui/viewgfx.cpp
index 5b4d187bc95..bc6dee9cd47 100644
--- a/src/frontend/mame/ui/viewgfx.cpp
+++ b/src/frontend/mame/ui/viewgfx.cpp
@@ -994,18 +994,16 @@ static void gfxset_draw_item(running_machine &machine, gfx_element &gfx, int ind
{
int width = (rotate & ORIENTATION_SWAP_XY) ? gfx.height() : gfx.width();
int height = (rotate & ORIENTATION_SWAP_XY) ? gfx.width() : gfx.height();
- const rgb_t *palette = dpalette->palette()->entry_list_raw() + gfx.colorbase() + color * gfx.granularity();
-
- int x, y;
+ rgb_t const *const palette = dpalette->