summaryrefslogtreecommitdiffstatshomepage
path: root/src/mess
diff options
context:
space:
mode:
author Miodrag Milanovic <mmicko@gmail.com>2014-02-27 13:35:15 +0000
committer Miodrag Milanovic <mmicko@gmail.com>2014-02-27 13:35:15 +0000
commit64ac8f6776fc4451d756b0eb3bb6dbd22c49801a (patch)
treebb1d096fecec4684c8ab2b7be1b4d539ca06e57b /src/mess
parentf9d3fbaa73ccdab2e5fcf9fc095a14b4f24c3133 (diff)
Huge update, palette is now device (nw)
note: Aaron please give more descriptive text for release log I have no more strength :)
Diffstat (limited to 'src/mess')
-rw-r--r--src/mess/drivers/a2600.c4
-rw-r--r--src/mess/drivers/a310.c2
-rw-r--r--src/mess/drivers/a5105.c9
-rw-r--r--src/mess/drivers/a51xx.c4
-rw-r--r--src/mess/drivers/a6809.c2
-rw-r--r--src/mess/drivers/a7000.c18
-rw-r--r--src/mess/drivers/a7150.c3
-rw-r--r--src/mess/drivers/a7800.c13
-rw-r--r--src/mess/drivers/ac1.c5
-rw-r--r--src/mess/drivers/ace.c3
-rw-r--r--src/mess/drivers/advision.c3
-rw-r--r--src/mess/drivers/alesis.c11
-rw-r--r--src/mess/drivers/alphasma.c11
-rw-r--r--src/mess/drivers/alphatro.c28
-rw-r--r--src/mess/drivers/amiga.c12
-rw-r--r--src/mess/drivers/amstrad.c25
-rw-r--r--src/mess/drivers/apc.c17
-rw-r--r--src/mess/drivers/apexc.c13
-rw-r--r--src/mess/drivers/apogee.c4
-rw-r--r--src/mess/drivers/apple1.c3
-rw-r--r--src/mess/drivers/apple2.c6
-rw-r--r--src/mess/drivers/apple2gs.c10
-rw-r--r--src/mess/drivers/apple3.c4
-rw-r--r--src/mess/drivers/applix.c9
-rw-r--r--src/mess/drivers/apricotf.c4
-rw-r--r--src/mess/drivers/apricotp.c2
-rw-r--r--src/mess/drivers/aquarius.c6
-rw-r--r--src/mess/drivers/arcadia.c13
-rw-r--r--src/mess/drivers/argo.c3
-rw-r--r--src/mess/drivers/astrocde.c2
-rw-r--r--src/mess/drivers/at.c3
-rw-r--r--src/mess/drivers/atari400.c10
-rw-r--r--src/mess/drivers/atarist.c10
-rw-r--r--src/mess/drivers/avigo.c3
-rw-r--r--src/mess/drivers/ax20.c5
-rw-r--r--src/mess/drivers/b16.c6
-rw-r--r--src/mess/drivers/b2m.c3
-rw-r--r--src/mess/drivers/bbc.c12
-rw-r--r--src/mess/drivers/bcs3.c3
-rw-r--r--src/mess/drivers/beehive.c3
-rw-r--r--src/mess/drivers/bigbord2.c3
-rw-r--r--src/mess/drivers/binbug.c6
-rw-r--r--src/mess/drivers/bk.c3
-rw-r--r--src/mess/drivers/bmjr.c9
-rw-r--r--src/mess/drivers/bml3.c9
-rw-r--r--src/mess/drivers/busicom.c4
-rw-r--r--src/mess/drivers/bw2.c9
-rw-r--r--src/mess/drivers/c10.c3
-rw-r--r--src/mess/drivers/c128.c2
-rw-r--r--src/mess/drivers/c65.c20
-rw-r--r--src/mess/drivers/c900.c3
-rw-r--r--src/mess/drivers/camplynx.c12
-rw-r--r--src/mess/drivers/casloopy.c8
-rw-r--r--src/mess/drivers/cat.c6
-rw-r--r--src/mess/drivers/cd2650.c3
-rw-r--r--src/mess/drivers/cdc721.c12
-rw-r--r--src/mess/drivers/cfx9850.c15
-rw-r--r--src/mess/drivers/cgenie.c24
-rw-r--r--src/mess/drivers/channelf.c16
-rw-r--r--src/mess/drivers/clcd.c8
-rw-r--r--src/mess/drivers/compucolor.c7
-rw-r--r--src/mess/drivers/comquest.c5
-rw-r--r--src/mess/drivers/concept.c3
-rw-r--r--src/mess/drivers/craft.c2
-rw-r--r--src/mess/drivers/ct486.c2
-rw-r--r--src/mess/drivers/cxhumax.c3
-rw-r--r--src/mess/drivers/cybiko.c19
-rw-r--r--src/mess/drivers/d6800.c3
-rw-r--r--src/mess/drivers/dai.c3
-rw-r--r--src/mess/drivers/dccons.c2
-rw-r--r--src/mess/drivers/dct11em.c3
-rw-r--r--src/mess/drivers/dgn_beta.c7
-rw-r--r--src/mess/drivers/dim68k.c3
-rw-r--r--src/mess/drivers/dm7000.c3
-rw-r--r--src/mess/drivers/dms5000.c3
-rw-r--r--src/mess/drivers/dmv.c3
-rw-r--r--src/mess/drivers/ec65.c6
-rw-r--r--src/mess/drivers/einstein.c6
-rw-r--r--src/mess/drivers/electron.c7
-rw-r--r--src/mess/drivers/elwro800.c4
-rw-r--r--src/mess/drivers/exelv.c16
-rw-r--r--src/mess/drivers/fk1.c3
-rw-r--r--src/mess/drivers/fm7.c20
-rw-r--r--src/mess/drivers/fp1100.c2
-rw-r--r--src/mess/drivers/fp200.c11
-rw-r--r--src/mess/drivers/fp6000.c10
-rw-r--r--src/mess/drivers/galaxy.c6
-rw-r--r--src/mess/drivers/galeb.c5
-rw-r--r--src/mess/drivers/gamecom.c9
-rw-r--r--src/mess/drivers/gamepock.c3
-rw-r--r--src/mess/drivers/gb.c36
-rw-r--r--src/mess/drivers/gba.c7
-rw-r--r--src/mess/drivers/geniusiq.c13
-rw-r--r--src/mess/drivers/gizmondo.c4
-rw-r--r--src/mess/drivers/gmaster.c9
-rw-r--r--src/mess/drivers/gp2x.c2
-rw-r--r--src/mess/drivers/gp32.c12
-rw-r--r--src/mess/drivers/grfd2301.c3
-rw-r--r--src/mess/drivers/h19.c3
-rw-r--r--src/mess/drivers/h89.c3
-rw-r--r--src/mess/drivers/harriet.c10
-rw-r--r--src/mess/drivers/hec2hrp.c13
-rw-r--r--src/mess/drivers/homelab.c9
-rw-r--r--src/mess/drivers/homez80.c5
-rw-r--r--src/mess/drivers/hp16500.c2
-rw-r--r--src/mess/drivers/hp48.c3
-rw-r--r--src/mess/drivers/hp49gp.c4
-rw-r--r--src/mess/drivers/hp9k.c3
-rw-r--r--src/mess/drivers/hprot1.c11
-rw-r--r--src/mess/drivers/hx20.c9
-rw-r--r--src/mess/drivers/ibm6580.c12
-rw-r--r--src/mess/drivers/ie15.c11
-rw-r--r--src/mess/drivers/if800.c4
-rw-r--r--src/mess/drivers/interact.c4
-rw-r--r--src/mess/drivers/intv.c22
-rw-r--r--src/mess/drivers/ip20.c2
-rw-r--r--src/mess/drivers/ip22.c2
-rw-r--r--src/mess/drivers/ipds.c3
-rw-r--r--src/mess/drivers/iq151.c3
-rw-r--r--src/mess/drivers/irisha.c3
-rw-r--r--src/mess/drivers/itt3030.c5
-rw-r--r--src/mess/drivers/jonos.c3
-rw-r--r--src/mess/drivers/jr100.c3
-rw-r--r--src/mess/drivers/jr200.c11
-rw-r--r--src/mess/drivers/jtc.c10
-rw-r--r--src/mess/drivers/juicebox.c2
-rw-r--r--src/mess/drivers/jupiter.c3
-rw-r--r--src/mess/drivers/k8915.c3
-rw-r--r--src/mess/drivers/kaypro.c7
-rw-r--r--src/mess/drivers/kc.c8
-rw-r--r--src/mess/drivers/konin.c3
-rw-r--r--src/mess/drivers/korgm1.c4
-rw-r--r--src/mess/drivers/kramermc.c5
-rw-r--r--src/mess/drivers/lcmate2.c11
-rw-r--r--src/mess/drivers/lisa.c3
-rw-r--r--src/mess/drivers/llc.c6
-rw-r--r--src/mess/drivers/lola8a.c9
-rw-r--r--src/mess/drivers/lviv.c3
-rw-r--r--src/mess/drivers/lynx.c7
-rw-r--r--src/mess/drivers/m20.c7
-rw-r--r--src/mess/drivers/m79152pc.c3
-rw-r--r--src/mess/drivers/mac.c43
-rw-r--r--src/mess/drivers/macpci.c3
-rw-r--r--src/mess/drivers/mbc200.c5
-rw-r--r--src/mess/drivers/mbc55x.c8
-rw-r--r--src/mess/drivers/mbee.c16
-rw-r--r--src/mess/drivers/mc10.c2
-rw-r--r--src/mess/drivers/mc80.c6
-rw-r--r--src/mess/drivers/megadriv.c4
-rw-r--r--src/mess/drivers/mes.c3
-rw-r--r--src/mess/drivers/micronic.c9
-rw-r--r--src/mess/drivers/microtan.c3
-rw-r--r--src/mess/drivers/microvsn.c36
-rw-r--r--src/mess/drivers/mikro80.c3
-rw-r--r--src/mess/drivers/mikrosha.c4
-rw-r--r--src/mess/drivers/mini2440.c4
-rw-r--r--src/mess/drivers/mk85.c3
-rw-r--r--src/mess/drivers/mk90.c3
-rw-r--r--src/mess/drivers/mmodular.c10
-rw-r--r--src/mess/drivers/modellot.c7
-rw-r--r--src/mess/drivers/molecular.c8
-rw-r--r--src/mess/drivers/ms0515.c41
-rw-r--r--src/mess/drivers/mstation.c11
-rw-r--r--src/mess/drivers/msx.c4
-rw-r--r--src/mess/drivers/multi16.c4
-rw-r--r--src/mess/drivers/multi8.c11
-rw-r--r--src/mess/drivers/mx2178.c3
-rw-r--r--src/mess/drivers/myb3k.c5
-rw-r--r--src/mess/drivers/mycom.c3
-rw-r--r--src/mess/drivers/mz2000.c26
-rw-r--r--src/mess/drivers/mz2500.c37
-rw-r--r--src/mess/drivers/mz3500.c12
-rw-r--r--src/mess/drivers/mz6500.c2
-rw-r--r--src/mess/drivers/mz700.c3
-rw-r--r--src/mess/drivers/mz80.c3
-rw-r--r--src/mess/drivers/n64.c2
-rw-r--r--src/mess/drivers/nakajies.c11
-rw-r--r--src/mess/drivers/nanos.c3
-rw-r--r--src/mess/drivers/nascom1.c3
-rw-r--r--src/mess/drivers/nc.c9
-rw-r--r--src/mess/drivers/nes.c3
-rw-r--r--src/mess/drivers/ngp.c5
-rw-r--r--src/mess/drivers/octopus.c3
-rw-r--r--src/mess/drivers/odyssey2.c32
-rw-r--r--src/mess/drivers/okean240.c4
-rw-r--r--src/mess/drivers/ondra.c3
-rw-r--r--src/mess/drivers/orao.c3
-rw-r--r--src/mess/drivers/oric.c7
-rw-r--r--src/mess/drivers/orion.c12
-rw-r--r--src/mess/drivers/osbexec.c13
-rw-r--r--src/mess/drivers/osborne1.c11
-rw-r--r--src/mess/drivers/p112.c3
-rw-r--r--src/mess/drivers/p2000t.c14
-rw-r--r--src/mess/drivers/palm.c8
-rw-r--r--src/mess/drivers/palmz22.c4
-rw-r--r--src/mess/drivers/partner.c4
-rw-r--r--src/mess/drivers/paso1600.c10
-rw-r--r--src/mess/drivers/pasogo.c9
-rw-r--r--src/mess/drivers/pasopia.c2
-rw-r--r--src/mess/drivers/pasopia7.c32
-rw-r--r--src/mess/drivers/pb1000.c13
-rw-r--r--src/mess/drivers/pc.c11
-rw-r--r--src/mess/drivers/pc100.c8
-rw-r--r--src/mess/drivers/pc1500.c11
-rw-r--r--src/mess/drivers/pc2000.c11
-rw-r--r--src/mess/drivers/pc4.c9
-rw-r--r--src/mess/drivers/pc6001.c65
-rw-r--r--src/mess/drivers/pc8001.c8
-rw-r--r--src/mess/drivers/pc8801.c36
-rw-r--r--src/mess/drivers/pc88va.c16
-rw-r--r--src/mess/drivers/pc9801.c28
-rw-r--r--src/mess/drivers/pce.c4
-rw-r--r--src/mess/drivers/pce220.c12
-rw-r--r--src/mess/drivers/pcm.c3
-rw-r--r--src/mess/drivers/pcw.c4
-rw-r--r--src/mess/drivers/pcw16.c4
-rw-r--r--src/mess/drivers/pda600.c3
-rw-r--r--src/mess/drivers/pdp1.c18
-rw-r--r--src/mess/drivers/pegasus.c3
-rw-r--r--src/mess/drivers/phunsy.c9
-rw-r--r--src/mess/drivers/pitagjr.c11
-rw-r--r--src/mess/drivers/pk8000.c4
-rw-r--r--src/mess/drivers/pk8020.c3
-rw-r--r--src/mess/drivers/plan80.c3
-rw-r--r--src/mess/drivers/pmd85.c4
-rw-r--r--src/mess/drivers/pocketc.c6
-rw-r--r--src/mess/drivers/pockstat.c3
-rw-r--r--src/mess/drivers/poisk1.c3
-rw-r--r--src/mess/drivers/pokemini.c15
-rw-r--r--src/mess/drivers/poly88.c3
-rw-r--r--src/mess/drivers/portfoli.c9
-rw-r--r--src/mess/drivers/pp01.c3
-rw-r--r--src/mess/drivers/prestige.c11
-rw-r--r--src/mess/drivers/primo.c3
-rw-r--r--src/mess/drivers/psion.c9
-rw-r--r--src/mess/drivers/ptcsol.c3
-rw-r--r--src/mess/drivers/pv1000.c16
-rw-r--r--src/mess/drivers/pv9234.c3
-rw-r--r--src/mess/drivers/px4.c18
-rw-r--r--src/mess/drivers/px8.c9
-rw-r--r--src/mess/drivers/pyl601.c3
-rw-r--r--src/mess/drivers/qx10.c17
-rw-r--r--src/mess/drivers/radio86.c4
-rw-r--r--src/mess/drivers/rainbow.c4
-rw-r--r--src/mess/drivers/rd110.c11
-rw-r--r--src/mess/drivers/replicator.c11
-rw-r--r--src/mess/drivers/rex6000.c11
-rw-r--r--src/mess/drivers/rm380z.c3
-rw-r--r--src/mess/drivers/rmnimbus.c7
-rw-r--r--src/mess/drivers/rmt32.c11
-rw-r--r--src/mess/drivers/rt1715.c13
-rw-r--r--src/mess/drivers/rx78.c6
-rw-r--r--src/mess/drivers/samcoupe.c9
-rw-r--r--src/mess/drivers/sapi1.c3
-rw-r--r--src/mess/drivers/saturn.c2
-rw-r--r--src/mess/drivers/sbrain.c3
-rw-r--r--src/mess/drivers/scv.c39
-rw-r--r--src/mess/drivers/sm1800.c15
-rw-r--r--src/mess/drivers/smc777.c43
-rw-r--r--src/mess/drivers/sms.c12
-rw-r--r--src/mess/drivers/socrates.c18
-rw-r--r--src/mess/drivers/sorcerer.c3
-rw-r--r--src/mess/drivers/spec128.c2
-rw-r--r--src/mess/drivers/special.c12
-rw-r--r--src/mess/drivers/spectrum.c5
-rw-r--r--src/mess/drivers/ssem.c3
-rw-r--r--src/mess/drivers/ssystem3.c4
-rw-r--r--src/mess/drivers/super80.c13
-rw-r--r--src/mess/drivers/supracan.c17
-rw-r--r--src/mess/drivers/svi318.c2
-rw-r--r--src/mess/drivers/svision.c19
-rw-r--r--src/mess/drivers/svmu.c11
-rw-r--r--src/mess/drivers/sys2900.c3
-rw-r--r--src/mess/drivers/tavernie.c3
-rw-r--r--src/mess/drivers/tdv2324.c3
-rw-r--r--src/mess/drivers/tek405x.c6
-rw-r--r--src/mess/drivers/tek410x.c5
-rw-r--r--src/mess/drivers/terak.c3
-rw-r--r--src/mess/drivers/thomson.c4
-rw-r--r--src/mess/drivers/ti85.c22
-rw-r--r--src/mess/drivers/ti89.c9
-rw-r--r--src/mess/drivers/ti990_10.c4
-rw-r--r--src/mess/drivers/ti990_4.c10
-rw-r--r--src/mess/drivers/ti99_2.c11
-rw-r--r--src/mess/drivers/tiki100.c10
-rw-r--r--src/mess/drivers/tim011.c3
-rw-r--r--src/mess/drivers/tim100.c6
-rw-r--r--src/mess/drivers/tk80bs.c5
-rw-r--r--src/mess/drivers/trs80.c8
-rw-r--r--src/mess/drivers/tvc.c7
-rw-r--r--src/mess/drivers/tx0.c18
-rw-r--r--src/mess/drivers/uknc.c3
-rw-r--r--src/mess/drivers/unior.c6
-rw-r--r--src/mess/drivers/unistar.c12
-rw-r--r--src/mess/drivers/univac.c3
-rw-r--r--src/mess/drivers/unixpc.c3
-rw-r--r--src/mess/drivers/ut88.c5
-rw-r--r--src/mess/drivers/v6809.c3
-rw-r--r--src/mess/drivers/vboy.c33
-rw-r--r--src/mess/drivers/vc4000.c8
-rw-r--r--src/mess/drivers/vector06.c3
-rw-r--r--src/mess/drivers/vg5k.c2
-rw-r--r--src/mess/drivers/victor9k.c3
-rw-r--r--src/mess/drivers/vii.c6
-rw-r--r--src/mess/drivers/vt100.c4
-rw-r--r--src/mess/drivers/vt220.c3
-rw-r--r--src/mess/drivers/vt240.c3
-rw-r--r--src/mess/drivers/vt320.c3
-rw-r--r--src/mess/drivers/vt520.c3
-rw-r--r--src/mess/drivers/vta2000.c13
-rw-r--r--src/mess/drivers/vtech2.c17
-rw-r--r--src/mess/drivers/wswan.c15
-rw-r--r--src/mess/drivers/x07.c9
-rw-r--r--src/mess/drivers/x1.c32
-rw-r--r--src/mess/drivers/x1twin.c4
-rw-r--r--src/mess/drivers/x68k.c8
-rw-r--r--src/mess/drivers/xavix.c7
-rw-r--r--src/mess/drivers/xerox820.c2
-rw-r--r--src/mess/drivers/ymmu100.c10
-rw-r--r--src/mess/drivers/z100.c14
-rw-r--r--src/mess/drivers/z1013.c3
-rw-r--r--src/mess/drivers/z88.c3
-rw-r--r--src/mess/drivers/z9001.c2
-rw-r--r--src/mess/drivers/zaurus.c7
-rw-r--r--src/mess/drivers/zorba.c12
-rw-r--r--src/mess/drivers/zrt80.c3
-rw-r--r--src/mess/drivers/zx.c26
-rw-r--r--src/mess/includes/a7800.h2
-rw-r--r--src/mess/includes/advision.h2
-rw-r--r--src/mess/includes/alesis.h2
-rw-r--r--src/mess/includes/aquarius.h2
-rw-r--r--src/mess/includes/arcadia.h2
-rw-r--r--src/mess/includes/avigo.h2
-rw-r--r--src/mess/includes/b2m.h2
-rw-r--r--src/mess/includes/busicom.h2
-rw-r--r--src/mess/includes/bw2.h2
-rw-r--r--src/mess/includes/c65.h1
-rw-r--r--src/mess/includes/channelf.h2
-rw-r--r--src/mess/includes/cybiko.h1
-rw-r--r--src/mess/includes/dai.h2
-rw-r--r--src/mess/includes/dgn_beta.h2
-rw-r--r--src/mess/includes/electron.h2
-rw-r--r--src/mess/includes/fm7.h2
-rw-r--r--src/mess/includes/gamecom.h2
-rw-r--r--src/mess/includes/gba.h2
-rw-r--r--src/mess/includes/hp48.h2
-rw-r--r--src/mess/includes/hx20.h2
-rw-r--r--src/mess/includes/intv.h2
-rw-r--r--src/mess/includes/lviv.h2
-rw-r--r--src/mess/includes/lynx.h4
-rw-r--r--src/mess/includes/mbc55x.h2
-rw-r--r--src/mess/includes/micronic.h2
-rw-r--r--src/mess/includes/mz700.h2
-rw-r--r--src/mess/includes/nc.h2
-rw-r--r--src/mess/includes/nes.h2
-rw-r--r--src/mess/includes/oric.h2
-rw-r--r--src/mess/includes/osborne1.h2
-rw-r--r--src/mess/includes/pc4.h2
-rw-r--r--src/mess/includes/pcw.h2
-rw-r--r--src/mess/includes/pcw16.h2
-rw-r--r--src/mess/includes/pdp1.h2
-rw-r--r--src/mess/includes/pk8020.h2
-rw-r--r--src/mess/includes/pmd85.h2
-rw-r--r--src/mess/includes/poisk1.h2
-rw-r--r--src/mess/includes/portfoli.h2
-rw-r--r--src/mess/includes/pp01.h2
-rw-r--r--src/mess/includes/psion.h2
-rw-r--r--src/mess/includes/px8.h2
-rw-r--r--src/mess/includes/rmnimbus.h2
-rw-r--r--src/mess/includes/samcoupe.h2
-rw-r--r--src/mess/includes/ssystem3.h2
-rw-r--r--src/mess/includes/svision.h2
-rw-r--r--src/mess/includes/ti85.h2
-rw-r--r--src/mess/includes/ti89.h2
-rw-r--r--src/mess/includes/tiki100.h2
-rw-r--r--src/mess/includes/tvc.h2
-rw-r--r--src/mess/includes/tx0.h2
-rw-r--r--src/mess/includes/vc4000.h2
-rw-r--r--src/mess/includes/vector06.h2
-rw-r--r--src/mess/includes/vtech2.h2
-rw-r--r--src/mess/includes/wswan.h2
-rw-r--r--src/mess/includes/x07.h2
-rw-r--r--src/mess/includes/z88.h2
-rw-r--r--src/mess/includes/zx.h2
-rw-r--r--src/mess/machine/aim65.c2
-rw-r--r--src/mess/machine/amstrad.c14
-rw-r--r--src/mess/machine/apple2gs.c4
-rw-r--r--src/mess/machine/b2m.c4
-rw-r--r--src/mess/machine/cgenie.c2
-rw-r--r--src/mess/machine/lisa.c2
-rw-r--r--src/mess/machine/lynx.c14
-rw-r--r--src/mess/machine/pk8020.c2
-rw-r--r--src/mess/machine/svi318.c4
-rw-r--r--src/mess/machine/ti99/videowrp.h2
-rw-r--r--src/mess/machine/vector06.c2
-rw-r--r--src/mess/video/733_asr.c31
-rw-r--r--src/mess/video/733_asr.h12
-rw-r--r--src/mess/video/911_vdt.c30
-rw-r--r--src/mess/video/911_vdt.h10
-rw-r--r--src/mess/video/abc800.c10
-rw-r--r--src/mess/video/abc806.c10
-rw-r--r--src/mess/video/ac1.c4
-rw-r--r--src/mess/video/advision.c4
-rw-r--r--src/mess/video/apollo.c5
-rw-r--r--src/mess/video/apple3.c2
-rw-r--r--src/mess/video/aquarius.c8
-rw-r--r--src/mess/video/arcadia.c6
-rw-r--r--src/mess/video/atarist.c14
-rw-r--r--src/mess/video/avigo.c6
-rw-r--r--src/mess/video/b2m.c4
-rw-r--r--src/mess/video/busicom.c8
-rw-r--r--src/mess/video/cgc7900.c8
-rw-r--r--src/mess/video/cgenie.c24
-rw-r--r--src/mess/video/channelf.c4
-rw-r--r--src/mess/video/comquest.c2
-rw-r--r--src/mess/video/dai.c4
-rw-r--r--src/mess/video/ef9345.c2
-rw-r--r--src/mess/video/fm7.c12
-rw-r--r--src/mess/video/galeb.c2
-rw-r--r--src/mess/video/hec2video.c32
-rw-r--r--src/mess/video/hp48.c4
-rw-r--r--src/mess/video/intv.c12
-rw-r--r--src/mess/video/isa_cga.c12
-rw-r--r--src/mess/video/isa_cga.h1
-rw-r--r--src/mess/video/isa_ega.c10
-rw-r--r--src/mess/video/isa_ega.h1
-rw-r--r--src/mess/video/isa_mda.c14
-rw-r--r--src/mess/video/isa_mda.h3
-rw-r--r--src/mess/video/isa_pc1640_iga.c2
-rw-r--r--src/mess/video/isa_svga_cirrus.c2
-rw-r--r--src/mess/video/isa_svga_s3.c4
-rw-r--r--src/mess/video/isa_svga_tseng.c2
-rw-r--r--src/mess/video/isa_vga_ati.c2
-rw-r--r--src/mess/video/k1ge.c10
-rw-r--r--src/mess/video/kaypro.c6
-rw-r--r--src/mess/video/kc.c2
-rw-r--r--src/mess/video/kramermc.c2
-rw-r--r--src/mess/video/kyocera.c16
-rw-r--r--src/mess/video/lviv.c4
-rw-r--r--src/mess/video/mac.c14
-rw-r--r--src/mess/video/mbee.c12
-rw-r--r--src/mess/video/mos6566.c134
-rw-r--r--src/mess/video/mz700.c16
-rw-r--r--src/mess/video/nascom1.c8
-rw-r--r--src/mess/video/nc.c4
-rw-r--r--src/mess/video/nes.c4
-rw-r--r--src/mess/video/orion.c2
-rw-r--r--src/mess/video/osi.c30
-rw-r--r--src/mess/video/p2000m.c2
-rw-r--r--src/mess/video/pc1251.c4
-rw-r--r--src/mess/video/pc1401.c4
-rw-r--r--src/mess/video/pc1403.c12
-rw-r--r--src/mess/video/pc1512.c12
-rw-r--r--src/mess/video/pc8401a.c12
-rw-r--r--src/mess/video/pc_aga.c6
-rw-r--r--src/mess/video/pc_t1t.c12
-rw-r--r--src/mess/video/pcw.c4
-rw-r--r--src/mess/video/pcw16.c4
-rw-r--r--src/mess/video/pdp1.c4
-rw-r--r--src/mess/video/pk8020.c4
-rw-r--r--src/mess/video/pmd85.c4
-rw-r--r--src/mess/video/pocketc.c8
-rw-r--r--src/mess/video/poisk1.c4
-rw-r--r--src/mess/video/pp01.c4
-rw-r--r--src/mess/video/radio86.c2
-rw-r--r--src/mess/video/rmnimbus.c2
-rw-r--r--src/mess/video/s3virge.c2
-rw-r--r--src/mess/video/special.c8
-rw-r--r--src/mess/video/spectrum.c2
-rw-r--r--src/mess/video/ssystem3.c4
-rw-r--r--src/mess/video/stic.c12
-rw-r--r--src/mess/video/super80.c2
-rw-r--r--src/mess/video/thomson.c2
-rw-r--r--src/mess/video/ti85.c12
-rw-r--r--src/mess/video/tmc600.c1
-rw-r--r--src/mess/video/trs80.c2
-rw-r--r--src/mess/video/tx0.c4
-rw-r--r--src/mess/video/ut88.c2
-rw-r--r--src/mess/video/uv201.c20
-rw-r--r--src/mess/video/uv201.h2
-rw-r--r--src/mess/video/vector06.c4
-rw-r--r--src/mess/video/vic4567.c20
-rw-r--r--src/mess/video/vic4567.h4
-rw-r--r--src/mess/video/vtech2.c16
-rw-r--r--src/mess/video/vtvideo.c60
-rw-r--r--src/mess/video/vtvideo.h3
-rw-r--r--src/mess/video/x68k.c4
-rw-r--r--src/mess/video/z88.c8
-rw-r--r--src/mess/video/zx8301.c8
489 files changed, 1868 insertions, 1934 deletions
diff --git a/src/mess/drivers/a2600.c b/src/mess/drivers/a2600.c
index 21039fe0c09..d55e3a67214 100644
--- a/src/mess/drivers/a2600.c
+++ b/src/mess/drivers/a2600.c
@@ -1954,7 +1954,7 @@ static MACHINE_CONFIG_START( a2600, a2600_state )
MCFG_SCREEN_RAW_PARAMS( MASTER_CLOCK_NTSC, 228, 26, 26 + 160 + 16, 262, 24 , 24 + 192 + 31 )
MCFG_SCREEN_UPDATE_DEVICE("tia_video", tia_video_device, screen_update)
- MCFG_PALETTE_LENGTH( TIA_PALETTE_LENGTH )
+ MCFG_PALETTE_ADD( "palette", TIA_PALETTE_LENGTH )
/* sound hardware */
MCFG_SPEAKER_STANDARD_MONO("mono")
@@ -1990,7 +1990,7 @@ static MACHINE_CONFIG_START( a2600p, a2600_state )
MCFG_SCREEN_RAW_PARAMS( MASTER_CLOCK_PAL, 228, 26, 26 + 160 + 16, 312, 32, 32 + 228 + 31 )
MCFG_SCREEN_UPDATE_DEVICE("tia_video", tia_video_device, screen_update)
- MCFG_PALETTE_LENGTH( TIA_PALETTE_LENGTH )
+ MCFG_PALETTE_ADD( "palette", TIA_PALETTE_LENGTH )
/* sound hardware */
MCFG_SPEAKER_STANDARD_MONO("mono")
diff --git a/src/mess/drivers/a310.c b/src/mess/drivers/a310.c
index 35cb1ce2c15..e1c8dd93e3d 100644
--- a/src/mess/drivers/a310.c
+++ b/src/mess/drivers/a310.c
@@ -309,7 +309,7 @@ static MACHINE_CONFIG_START( a310, a310_state )
MCFG_SCREEN_VISIBLE_AREA(0*8, 1280 - 1, 0*16, 1024 - 1)
MCFG_SCREEN_UPDATE_DRIVER(archimedes_state, screen_update)
- MCFG_PALETTE_LENGTH(32768)
+ MCFG_PALETTE_ADD("palette", 32768)
MCFG_RAM_ADD(RAM_TAG)
MCFG_RAM_DEFAULT_SIZE("2M")
diff --git a/src/mess/drivers/a5105.c b/src/mess/drivers/a5105.c
index d3c2fd94ba1..eaba3721917 100644
--- a/src/mess/drivers/a5105.c
+++ b/src/mess/drivers/a5105.c
@@ -82,7 +82,7 @@ public:
UINT8 m_memsel[4];
virtual void machine_reset();
virtual void video_start();
- virtual void palette_init();
+ DECLARE_PALETTE_INIT(a5105);
DECLARE_FLOPPY_FORMATS( floppy_formats );
required_device<ram_device> m_ram;
required_device<gfxdecode_device> m_gfxdecode;
@@ -516,7 +516,7 @@ static GFXDECODE_START( a5105 )
GFXDECODE_END
-void a5105_state::palette_init()
+PALETTE_INIT_MEMBER(a5105_state, a5105)
{
int i;
int r,g,b;
@@ -527,7 +527,7 @@ void a5105_state::palette_init()
g = i & 2 ? ((i & 8) ? 0xaa : 0xff) : 0x00;
b = i & 1 ? ((i & 8) ? 0xaa : 0xff) : 0x00;
- palette_set_color(machine(), i, rgb_t(r,g,b));
+ palette.set_pen_color(i, rgb_t(r,g,b));
}
}
@@ -600,7 +600,8 @@ static MACHINE_CONFIG_START( a5105, a5105_state )
MCFG_SCREEN_SIZE(40*8, 32*8)
MCFG_SCREEN_VISIBLE_AREA(0, 40*8-1, 0, 25*8-1)
MCFG_GFXDECODE_ADD("gfxdecode", a5105)
- MCFG_PALETTE_LENGTH(16)
+ MCFG_PALETTE_ADD("palette", 16)
+ MCFG_PALETTE_INIT_OWNER(a5105_state, a5105)
/* sound hardware */
MCFG_SPEAKER_STANDARD_MONO("mono")
diff --git a/src/mess/drivers/a51xx.c b/src/mess/drivers/a51xx.c
index b9520aca27f..cc597df63f6 100644
--- a/src/mess/drivers/a51xx.c
+++ b/src/mess/drivers/a51xx.c
@@ -124,8 +124,8 @@ static MACHINE_CONFIG_START( a5120, a51xx_state )
MCFG_SCREEN_UPDATE_DRIVER(a51xx_state, screen_update_a5120)
MCFG_GFXDECODE_ADD("gfxdecode", a51xx)
- MCFG_PALETTE_LENGTH(2)
- MCFG_PALETTE_INIT_OVERRIDE(driver_device, black_and_white)
+
+ MCFG_PALETTE_ADD_BLACK_AND_WHITE("palette")
MACHINE_CONFIG_END
diff --git a/src/mess/drivers/a6809.c b/src/mess/drivers/a6809.c
index f24e3775718..059dc72e8a8 100644
--- a/src/mess/drivers/a6809.c
+++ b/src/mess/drivers/a6809.c
@@ -258,7 +258,7 @@ static MACHINE_CONFIG_START( a6809, a6809_state )
MCFG_SCREEN_SIZE(40 * 12, 25 * 20)
MCFG_SCREEN_VISIBLE_AREA(0, 40 * 12 - 1, 0, 25 * 20 - 1)
MCFG_SCREEN_UPDATE_DEVICE("saa5050", saa5050_device, screen_update)
- MCFG_PALETTE_LENGTH(8)
+ MCFG_PALETTE_ADD("palette", 8)
/* sound hardware */
MCFG_SPEAKER_STANDARD_MONO("mono")
diff --git a/src/mess/drivers/a7000.c b/src/mess/drivers/a7000.c
index 7d3f92c79af..a145ab87a3c 100644
--- a/src/mess/drivers/a7000.c
+++ b/src/mess/drivers/a7000.c
@@ -204,7 +204,7 @@ WRITE32_MEMBER( a7000_state::a7000_vidc20_w )
g = (data & 0x00ff00) >> 8;
b = (data & 0xff0000) >> 16;
- palette_set_color_rgb(machine(),m_vidc20_pal_index & 0xff,r,g,b);
+ m_palette->set_pen_color(m_vidc20_pal_index & 0xff,r,g,b);
/* auto-increment & wrap-around */
m_vidc20_pal_index++;
@@ -225,7 +225,7 @@ WRITE32_MEMBER( a7000_state::a7000_vidc20_w )
g = (data & 0x00ff00) >> 8;
b = (data & 0xff0000) >> 16;
- palette_set_color_rgb(machine(),0x100,r,g,b);
+ m_palette->set_pen_color(0x100,r,g,b);
break;
case 5: // Cursor Palette Logical Colour n
case 6:
@@ -236,7 +236,7 @@ WRITE32_MEMBER( a7000_state::a7000_vidc20_w )
g = (data & 0x00ff00) >> 8;
b = (data & 0xff0000) >> 16;
- palette_set_color_rgb(machine(),cursor_index,r,g,b);
+ m_palette->set_pen_color(cursor_index,r,g,b);
break;
case 8: // Horizontal
horz_reg = (data >> 24) & 0xf;
@@ -277,7 +277,7 @@ UINT32 a7000_state::screen_update(screen_device &screen, bitmap_rgb32 &bitmap, c
UINT32 count;
UINT8 *vram = memregion("vram")->base();
- bitmap.fill(machine().pens[0x100], cliprect);
+ bitmap.fill(m_palette->pen(0x100), cliprect);
x_size = (m_vidc20_horz_reg[HDER]-m_vidc20_horz_reg[HDSR]);
y_size = (m_vidc20_vert_reg[VDER]-m_vidc20_vert_reg[VDSR]);
@@ -301,7 +301,7 @@ UINT32 a7000_state::screen_update(screen_device &screen, bitmap_rgb32 &bitmap, c
for(x=0;x<x_size;x+=8)
{
for(xi=0;xi<8;xi++)
- bitmap.pix32(y+y_start, x+xi+x_start) = machine().pens[(vram[count]>>(xi))&1];
+ bitmap.pix32(y+y_start, x+xi+x_start) = m_palette->pen((vram[count]>>(xi))&1);
count++;
}
@@ -315,7 +315,7 @@ UINT32 a7000_state::screen_update(screen_device &screen, bitmap_rgb32 &bitmap, c
for(x=0;x<x_size;x+=4)
{
for(xi=0;xi<4;xi++)
- bitmap.pix32(y+y_start, x+xi+x_start) = machine().pens[(vram[count]>>(xi*2))&3];
+ bitmap.pix32(y+y_start, x+xi+x_start) = m_palette->pen((vram[count]>>(xi*2))&3);
count++;
}
@@ -329,7 +329,7 @@ UINT32 a7000_state::screen_update(screen_device &screen, bitmap_rgb32 &bitmap, c
for(x=0;x<x_size;x+=2)
{
for(xi=0;xi<2;xi++)
- bitmap.pix32(y+y_start, x+xi+x_start) = machine().pens[(vram[count]>>(xi*4))&0xf];
+ bitmap.pix32(y+y_start, x+xi+x_start) = m_palette->pen((vram[count]>>(xi*4))&0xf);
count++;
}
@@ -342,7 +342,7 @@ UINT32 a7000_state::screen_update(screen_device &screen, bitmap_rgb32 &bitmap, c
{
for(x=0;x<x_size;x++)
{
- bitmap.pix32(y+y_start, x+x_start) = machine().pens[(vram[count])&0xff];
+ bitmap.pix32(y+y_start, x+x_start) = m_palette->pen((vram[count])&0xff);
count++;
}
@@ -807,7 +807,7 @@ static MACHINE_CONFIG_START( a7000, a7000_state )
MCFG_SCREEN_SIZE(1900, 1080) //max available size
MCFG_SCREEN_VISIBLE_AREA(0, 1900-1, 0, 1080-1)
MCFG_SCREEN_UPDATE_DRIVER(a7000_state, screen_update)
- MCFG_PALETTE_LENGTH(0x200)
+ MCFG_PALETTE_ADD("palette", 0x200)
MACHINE_CONFIG_END
static MACHINE_CONFIG_DERIVED( a7000p, a7000 )
diff --git a/src/mess/drivers/a7150.c b/src/mess/drivers/a7150.c
index 53d01cbd2ad..13009999317 100644
--- a/src/mess/drivers/a7150.c
+++ b/src/mess/drivers/a7150.c
@@ -64,8 +64,7 @@ static MACHINE_CONFIG_START( a7150, a7150_state )
MCFG_SCREEN_VISIBLE_AREA(0, 640-1, 0, 480-1)
MCFG_SCREEN_UPDATE_DRIVER(a7150_state, screen_update_a7150)
- MCFG_PALETTE_LENGTH(2)
- MCFG_PALETTE_INIT_OVERRIDE(driver_device, black_and_white)
+ MCFG_PALETTE_ADD_BLACK_AND_WHITE("palette")
MACHINE_CONFIG_END
diff --git a/src/mess/drivers/a7800.c b/src/mess/drivers/a7800.c
index fb0e10244d4..1920c1df209 100644
--- a/src/mess/drivers/a7800.c
+++ b/src/mess/drivers/a7800.c
@@ -1006,15 +1006,15 @@ define NTSC_LIGHT_ORANGE
***************************************************************************/
/* Initialise the palette */
-void a7800_state::palette_init()
+PALETTE_INIT_MEMBER(a7800_state, a7800)
{
- palette_set_colors(machine(), 0, a7800_palette, ARRAY_LENGTH(a7800_palette));
+ palette.set_pen_colors(0, a7800_palette, ARRAY_LENGTH(a7800_palette));
}
PALETTE_INIT_MEMBER(a7800_state,a7800p)
{
- palette_set_colors(machine(), 0, a7800p_palette, ARRAY_LENGTH(a7800p_palette));
+ palette.set_pen_colors(0, a7800p_palette, ARRAY_LENGTH(a7800p_palette));
}
@@ -1034,7 +1034,8 @@ static MACHINE_CONFIG_START( a7800_ntsc, a7800_state )
MCFG_SCREEN_RAW_PARAMS( 7159090, 456, 0, 320, 262, 26, 26 + 192 + 30 )
MCFG_SCREEN_UPDATE_DRIVER(a7800_state, screen_update_a7800)
- MCFG_PALETTE_LENGTH(ARRAY_LENGTH(a7800_palette))
+ MCFG_PALETTE_ADD("palette", ARRAY_LENGTH(a7800_palette))
+ MCFG_PALETTE_INIT_OWNER(a7800_state, a7800)
/* sound hardware */
@@ -1069,7 +1070,9 @@ static MACHINE_CONFIG_DERIVED( a7800_pal, a7800_ntsc )
MCFG_SCREEN_MODIFY( "screen" )
MCFG_SCREEN_RAW_PARAMS( 7093788, 456, 0, 320, 312, 34, 34 + 228 + 30 )
- MCFG_PALETTE_INIT_OVERRIDE(a7800_state, a7800p )
+
+ MCFG_PALETTE_MODIFY("palette")
+ MCFG_PALETTE_INIT_OWNER(a7800_state, a7800p )
/* sound hardware */
MCFG_DEVICE_REMOVE("pokey")
diff --git a/src/mess/drivers/ac1.c b/src/mess/drivers/ac1.c
index 204525d379f..ff1354e1725 100644
--- a/src/mess/drivers/ac1.c
+++ b/src/mess/drivers/ac1.c
@@ -136,10 +136,9 @@ static MACHINE_CONFIG_START( ac1, ac1_state )
MCFG_SCREEN_VISIBLE_AREA(0, 64*6-1, 0, 16*8-1)
MCFG_SCREEN_UPDATE_DRIVER(ac1_state, screen_update_ac1)
- MCFG_GFXDECODE_ADD("gfxdecode", ac1 )
+ MCFG_GFXDECODE_ADD("gfxdecode", ac1 )
- MCFG_PALETTE_LENGTH(2)
- MCFG_PALETTE_INIT_OVERRIDE(driver_device, black_and_white)
+ MCFG_PALETTE_ADD_BLACK_AND_WHITE("palette")
MCFG_SPEAKER_STANDARD_MONO("mono")
diff --git a/src/mess/drivers/ace.c b/src/mess/drivers/ace.c
index 49d6b5dd063..19c42b1fce6 100644
--- a/src/mess/drivers/ace.c
+++ b/src/mess/drivers/ace.c
@@ -739,8 +739,7 @@ static MACHINE_CONFIG_START( ace, ace_state )
MCFG_TIMER_DRIVER_ADD_SCANLINE("set_irq", ace_state, set_irq, SCREEN_TAG, 31*8, 264)
MCFG_TIMER_DRIVER_ADD_SCANLINE("clear_irq", ace_state, clear_irq, SCREEN_TAG, 32*8, 264)
- MCFG_PALETTE_LENGTH(2)
- MCFG_PALETTE_INIT_OVERRIDE(driver_device, black_and_white)
+ MCFG_PALETTE_ADD_BLACK_AND_WHITE("palette")
MCFG_GFXDECODE_ADD("gfxdecode", ace)
diff --git a/src/mess/drivers/advision.c b/src/mess/drivers/advision.c
index 2a069a4365d..b1cb11f3358 100644
--- a/src/mess/drivers/advision.c
+++ b/src/mess/drivers/advision.c
@@ -79,7 +79,8 @@ static MACHINE_CONFIG_START( advision, advision_state )
MCFG_SCREEN_UPDATE_DRIVER(advision_state, screen_update)
MCFG_SCREEN_SIZE(320, 200)
MCFG_SCREEN_VISIBLE_AREA(0, 320-1, 0, 200-1)
- MCFG_PALETTE_LENGTH(8)
+ MCFG_PALETTE_ADD("palette", 8)
+ MCFG_PALETTE_INIT_OWNER(advision_state, advision)
/* sound hardware */
MCFG_SPEAKER_STANDARD_MONO("mono")
diff --git a/src/mess/drivers/alesis.c b/src/mess/drivers/alesis.c
index dd3b8253d13..87808e78308 100644
--- a/src/mess/drivers/alesis.c
+++ b/src/mess/drivers/alesis.c
@@ -220,10 +220,10 @@ static INPUT_PORTS_START( sr16 )
INPUT_PORTS_END
-void alesis_state::palette_init()
+PALETTE_INIT_MEMBER(alesis_state, alesis)
{
- palette_set_color(machine(), 0, rgb_t(138, 146, 148));
- palette_set_color(machine(), 1, rgb_t(92, 83, 88));
+ palette.set_pen_color(0, rgb_t(138, 146, 148));
+ palette.set_pen_color(1, rgb_t(92, 83, 88));
}
void alesis_state::machine_reset()
@@ -267,7 +267,8 @@ static MACHINE_CONFIG_START( hr16, alesis_state )
MCFG_DEFAULT_LAYOUT(layout_lcd)
MCFG_SCREEN_UPDATE_DEVICE("hd44780", hd44780_device, screen_update)
- MCFG_PALETTE_LENGTH(2)
+ MCFG_PALETTE_ADD_BLACK_AND_WHITE("palette")
+ MCFG_PALETTE_INIT_OWNER(alesis_state, alesis)
MCFG_CASSETTE_ADD( "cassette", hr16_cassette_interface )
@@ -292,8 +293,6 @@ static MACHINE_CONFIG_DERIVED( sr16, hr16 )
MCFG_SCREEN_VISIBLE_AREA(0, 6*8-1, 0, 9*2-1)
MCFG_DEFAULT_LAYOUT(layout_sr16)
- MCFG_PALETTE_INIT_OVERRIDE(driver_device, black_and_white)
-
MCFG_DEVICE_MODIFY("hd44780")
MCFG_HD44780_LCD_SIZE(2, 8)
MCFG_HD44780_PIXEL_UPDATE_CB(sr16_pixel_update)
diff --git a/src/mess/drivers/alphasma.c b/src/mess/drivers/alphasma.c
index 600ca7be2cd..036eda171f9 100644
--- a/src/mess/drivers/alphasma.c
+++ b/src/mess/drivers/alphasma.c
@@ -72,7 +72,7 @@ public:
virtual void machine_start();
virtual void machine_reset();
- virtual void palette_init();
+ DECLARE_PALETTE_INIT(alphasmart);
virtual UINT32 screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
DECLARE_INPUT_CHANGED_MEMBER(kb_irq);
@@ -345,10 +345,10 @@ static INPUT_PORTS_START( alphasmart )
PORT_CONFSETTING (0x01, DEF_STR(Normal))
INPUT_PORTS_END
-void alphasmart_state::palette_init()
+PALETTE_INIT_MEMBER(alphasmart_state, alphasmart)
{
- palette_set_color(machine(), 0, rgb_t(138, 146, 148));
- palette_set_color(machine(), 1, rgb_t(92, 83, 88));
+ palette.set_pen_color(0, rgb_t(138, 146, 148));
+ palette.set_pen_color(1, rgb_t(92, 83, 88));
}
UINT32 alphasmart_state::screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect)
@@ -397,7 +397,8 @@ static MACHINE_CONFIG_START( alphasmart, alphasmart_state )
MCFG_SCREEN_UPDATE_DRIVER(alphasmart_state, screen_update)
MCFG_SCREEN_SIZE(6*40, 9*4)
MCFG_SCREEN_VISIBLE_AREA(0, (6*40)-1, 0, (9*4)-1)
- MCFG_PALETTE_LENGTH(2)
+ MCFG_PALETTE_ADD("palette", 2)
+ MCFG_PALETTE_INIT_OWNER(alphasmart_state, alphasmart)
MCFG_DEFAULT_LAYOUT(layout_lcd)
MCFG_NVRAM_ADD_0FILL("nvram")
diff --git a/src/mess/drivers/alphatro.c b/src/mess/drivers/alphatro.c
index 8a668f7c8f3..a2b68cc39f2 100644
--- a/src/mess/drivers/alphatro.c
+++ b/src/mess/drivers/alphatro.c
@@ -80,12 +80,11 @@ public:
virtual void machine_start();
virtual void machine_reset();
virtual void device_timer(emu_timer &timer, device_timer_id id, int param, void *ptr);
-
+ DECLARE_PALETTE_INIT(alphatro);
private:
UINT8 m_timer_bit;
UINT8 m_cass_data[4];
- bool m_cass_state;
- virtual void palette_init();
+ bool m_cass_state;
};
READ8_MEMBER( alphatro_state::port10_r )
@@ -379,19 +378,19 @@ void alphatro_state::machine_reset()
m_beep->set_frequency(950); /* piezo-device needs to be measured */
}
-void alphatro_state::palette_init()
+PALETTE_INIT_MEMBER(alphatro_state, alphatro)
{
// RGB colours
- palette_set_color_rgb(machine(), 0, 0x00, 0x00, 0x00);
- palette_set_color_rgb(machine(), 1, 0x00, 0x00, 0xff);
- palette_set_color_rgb(machine(), 2, 0xff, 0x00, 0x00);
- palette_set_color_rgb(machine(), 3, 0xff, 0x00, 0xff);
- palette_set_color_rgb(machine(), 4, 0x00, 0xff, 0x00);
- palette_set_color_rgb(machine(), 5, 0x00, 0xff, 0xff);
- palette_set_color_rgb(machine(), 6, 0xff, 0xff, 0x00);
- palette_set_color_rgb(machine(), 7, 0xff, 0xff, 0xff);
+ palette.set_pen_color(0, 0x00, 0x00, 0x00);
+ palette.set_pen_color(1, 0x00, 0x00, 0xff);
+ palette.set_pen_color(2, 0xff, 0x00, 0x00);
+ palette.set_pen_color(3, 0xff, 0x00, 0xff);
+ palette.set_pen_color(4, 0x00, 0xff, 0x00);
+ palette.set_pen_color(5, 0x00, 0xff, 0xff);
+ palette.set_pen_color(6, 0xff, 0xff, 0x00);
+ palette.set_pen_color(7, 0xff, 0xff, 0xff);
// Amber
- palette_set_color_rgb(machine(), 8, 0xf7, 0xaa, 0x00);
+ palette.set_pen_color(8, 0xf7, 0xaa, 0x00);
}
@@ -458,7 +457,8 @@ static MACHINE_CONFIG_START( alphatro, alphatro_state )
MCFG_SCREEN_SIZE(32*8, 32*8)
MCFG_SCREEN_VISIBLE_AREA(0*8, 32*8-1, 2*8, 30*8-1)
MCFG_GFXDECODE_ADD("gfxdecode", alphatro)
- MCFG_PALETTE_LENGTH(9) // 8 colours + amber
+ MCFG_PALETTE_ADD("palette", 9) // 8 colours + amber
+ MCFG_PALETTE_INIT_OWNER(alphatro_state, alphatro)
/* sound hardware */
MCFG_SPEAKER_STANDARD_MONO("mono")
diff --git a/src/mess/drivers/amiga.c b/src/mess/drivers/amiga.c
index d8f03086723..ccdb27876e8 100644
--- a/src/mess/drivers/amiga.c
+++ b/src/mess/drivers/amiga.c
@@ -658,8 +658,8 @@ static MACHINE_CONFIG_START( ntsc, amiga_state )
MCFG_SCREEN_RAW_PARAMS(AMIGA_68000_NTSC_CLOCK*2,228*4,214,228*4,262,34,262)
MCFG_SCREEN_UPDATE_DRIVER(amiga_state, screen_update_amiga)
- MCFG_PALETTE_LENGTH(4096)
- MCFG_PALETTE_INIT_OVERRIDE(amiga_state, amiga )
+ MCFG_PALETTE_ADD("palette", 4096)
+ MCFG_PALETTE_INIT_OWNER(amiga_state, amiga )
MCFG_VIDEO_START_OVERRIDE(amiga_state,amiga)
@@ -865,8 +865,8 @@ static MACHINE_CONFIG_START( a1200n, a1200_state )
MCFG_DEFAULT_LAYOUT(layout_amiga)
- MCFG_PALETTE_LENGTH(4096)
- MCFG_PALETTE_INIT_OVERRIDE(amiga_state, amiga )
+ MCFG_PALETTE_ADD("palette", 4096)
+ MCFG_PALETTE_INIT_OWNER(amiga_state, amiga )
MCFG_VIDEO_START_OVERRIDE(amiga_state,amiga)
@@ -972,8 +972,8 @@ static MACHINE_CONFIG_START( a3000n, amiga_state )
// MCFG_SCREEN_VISIBLE_AREA(214, (228*4)-1, 34, 262-1)
MCFG_SCREEN_UPDATE_DRIVER(amiga_state, screen_update_amiga)
- MCFG_PALETTE_LENGTH(4096)
- MCFG_PALETTE_INIT_OVERRIDE(amiga_state, amiga )
+ MCFG_PALETTE_ADD("palette", 4096)
+ MCFG_PALETTE_INIT_OWNER(amiga_state, amiga )
MCFG_VIDEO_START_OVERRIDE(amiga_state,amiga)
diff --git a/src/mess/drivers/amstrad.c b/src/mess/drivers/amstrad.c
index 6f9d7b8fd29..2df7a2b579d 100644
--- a/src/mess/drivers/amstrad.c
+++ b/src/mess/drivers/amstrad.c
@@ -295,11 +295,11 @@ INPUT_CHANGED_MEMBER(amstrad_state::cpc_monitor_changed)
{
if ( (m_io_green_display->read()) & 0x01 )
{
- PALETTE_INIT_CALL_MEMBER( amstrad_cpc_green );
+ PALETTE_INIT_NAME( amstrad_cpc_green )(m_palette);
}
else
{
- PALETTE_INIT_CALL_MEMBER( amstrad_cpc );
+ PALETTE_INIT_NAME( amstrad_cpc )(m_palette);
}
}
@@ -893,8 +893,8 @@ static MACHINE_CONFIG_START( amstrad_nofdc, amstrad_state )
MCFG_VIDEO_ATTRIBUTES(VIDEO_ALWAYS_UPDATE)
- MCFG_PALETTE_LENGTH(32)
- MCFG_PALETTE_INIT_OVERRIDE(amstrad_state,amstrad_cpc)
+ MCFG_PALETTE_ADD("palette", 32)
+ MCFG_PALETTE_INIT_OWNER(amstrad_state,amstrad_cpc)
MCFG_MC6845_ADD( "mc6845", MC6845, NULL, XTAL_16MHz / 16, amstrad_mc6845_intf )
@@ -943,7 +943,8 @@ static MACHINE_CONFIG_DERIVED( kccomp, amstrad )
MCFG_MACHINE_START_OVERRIDE(amstrad_state,kccomp)
MCFG_MACHINE_RESET_OVERRIDE(amstrad_state,kccomp)
- MCFG_PALETTE_INIT_OVERRIDE(amstrad_state,kccomp)
+ MCFG_PALETTE_MODIFY("palette")
+ MCFG_PALETTE_INIT_OWNER(amstrad_state,kccomp)
MACHINE_CONFIG_END
@@ -968,8 +969,8 @@ static MACHINE_CONFIG_START( cpcplus, amstrad_state )
MCFG_VIDEO_ATTRIBUTES(VIDEO_ALWAYS_UPDATE)
- MCFG_PALETTE_LENGTH(4096)
- MCFG_PALETTE_INIT_OVERRIDE(amstrad_state,amstrad_plus)
+ MCFG_PALETTE_ADD("palette", 4096)
+ MCFG_PALETTE_INIT_OWNER(amstrad_state,amstrad_plus)
MCFG_MC6845_ADD( "mc6845", MC6845, NULL, XTAL_40MHz / 40, amstrad_plus_mc6845_intf )
@@ -1028,8 +1029,8 @@ static MACHINE_CONFIG_START( gx4000, amstrad_state )
MCFG_VIDEO_ATTRIBUTES(VIDEO_ALWAYS_UPDATE)
- MCFG_PALETTE_LENGTH(4096)
- MCFG_PALETTE_INIT_OVERRIDE(amstrad_state,amstrad_plus)
+ MCFG_PALETTE_ADD("palette", 4096)
+ MCFG_PALETTE_INIT_OWNER(amstrad_state,amstrad_plus)
MCFG_MC6845_ADD( "mc6845", MC6845, NULL, XTAL_40MHz / 40, amstrad_plus_mc6845_intf )
@@ -1056,8 +1057,10 @@ static MACHINE_CONFIG_DERIVED( aleste, amstrad )
MCFG_SOUND_REPLACE("ay", AY8912, XTAL_16MHz / 16)
MCFG_SOUND_CONFIG(ay8912_interface)
MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.25)
- MCFG_PALETTE_LENGTH(32+64)
- MCFG_PALETTE_INIT_OVERRIDE(amstrad_state,aleste)
+
+ MCFG_DEVICE_REMOVE("palette")
+ MCFG_PALETTE_ADD("palette", 32+64)
+ MCFG_PALETTE_INIT_OWNER(amstrad_state,aleste)
MCFG_MC146818_ADD( "rtc", XTAL_4_194304Mhz )
MCFG_DEVICE_REMOVE("upd765")
diff --git a/src/mess/drivers/apc.c b/src/mess/drivers/apc.c
index 68110b82301..5a4fc6dd69c 100644
--- a/src/mess/drivers/apc.c
+++ b/src/mess/drivers/apc.c
@@ -160,7 +160,6 @@ protected:
virtual void machine_reset();
virtual void video_start();
- virtual void palette_init();
inline void set_dma_channel(int channel, int state);
};
@@ -172,7 +171,7 @@ void apc_state::video_start()
UINT32 apc_state::screen_update( screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect )
{
- bitmap.fill(get_black_pen(machine()), cliprect);
+ bitmap.fill(m_palette->black_pen(), cliprect);
/* graphics */
m_hgdc2->screen_update(screen, bitmap, cliprect);
@@ -776,10 +775,6 @@ void apc_state::machine_reset()
}
-void apc_state::palette_init()
-{
-}
-
static UPD7220_INTERFACE( hgdc_1_intf )
{
NULL,
@@ -979,9 +974,9 @@ PALETTE_INIT_MEMBER(apc_state,apc)
int i;
for(i=0;i<8;i++)
- palette_set_color_rgb(machine(), i, pal1bit(i >> 1), pal1bit(i >> 2), pal1bit(i >> 0));
- for(i=8;i<machine().total_colors();i++)
- palette_set_color_rgb(machine(), i, pal1bit(0), pal1bit(0), pal1bit(0));
+ palette.set_pen_color(i, pal1bit(i >> 1), pal1bit(i >> 2), pal1bit(i >> 0));
+ for(i=8;i<palette.entries();i++)
+ palette.set_pen_color(i, pal1bit(0), pal1bit(0), pal1bit(0));
}
static const upd1771_interface upd1771c_config = { DEVCB_NULL };
@@ -1024,8 +1019,8 @@ static MACHINE_CONFIG_START( apc, apc_state )
MCFG_UPD7220_ADD("upd7220_chr", XTAL_3_579545MHz, hgdc_1_intf, upd7220_1_map) // unk clock
MCFG_UPD7220_ADD("upd7220_btm", XTAL_3_579545MHz, hgdc_2_intf, upd7220_2_map) // unk clock
- MCFG_PALETTE_LENGTH(16)
- MCFG_PALETTE_INIT_OVERRIDE(apc_state,apc)
+ MCFG_PALETTE_ADD("palette", 16)
+ MCFG_PALETTE_INIT_OWNER(apc_state,apc)
/* sound hardware */
MCFG_SPEAKER_STANDARD_MONO("mono")
diff --git a/src/mess/drivers/apexc.c b/src/mess/drivers/apexc.c
index 10fe4111ace..14038a8a858 100644
--- a/src/mess/drivers/apexc.c
+++ b/src/mess/drivers/apexc.c
@@ -34,7 +34,7 @@ public:
DECLARE_DRIVER_INIT(apexc);
virtual void machine_start();
virtual void video_start();
- virtual void palette_init();
+ DECLARE_PALETTE_INIT(apexc);
UINT32 screen_update_apexc(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
INTERRUPT_GEN_MEMBER(apexc_interrupt);
DECLARE_READ8_MEMBER(tape_read);
@@ -560,9 +560,9 @@ static const rectangle teletyper_scroll_clear_window(
);
//static const int var_teletyper_scroll_step = - teletyper_scroll_step;
-void apexc_state::palette_init()
+PALETTE_INIT_MEMBER(apexc_state, apexc)
{
- palette_set_colors(machine(), 0, apexc_palette, APEXC_PALETTE_SIZE);
+ palette.set_pen_colors(0, apexc_palette, APEXC_PALETTE_SIZE);
}
void apexc_state::video_start()
@@ -588,7 +588,7 @@ void apexc_state::apexc_draw_led(bitmap_ind16 &bitmap, int x, int y, int state)
/* write a single char on screen */
void apexc_state::apexc_draw_char(bitmap_ind16 &bitmap, char character, int x, int y, int color)
{
- m_gfxdecode->gfx(0)->transpen(bitmap,bitmap.cliprect(), character-32, color, 0, 0,
+ m_gfxdecode->gfx(0)->transpen(m_palette,bitmap,bitmap.cliprect(), character-32, color, 0, 0,
x+1, y, 0);
}
@@ -650,7 +650,7 @@ void apexc_state::apexc_teletyper_linefeed()
for (y=teletyper_window_offset_y; y<teletyper_window_offset_y+teletyper_window_height-teletyper_scroll_step; y++)
{
extract_scanline8(*m_bitmap, teletyper_window_offset_x, y+teletyper_scroll_step, teletyper_window_width, buf);
- draw_scanline8(*m_bitmap, teletyper_window_offset_x, y, teletyper_window_width, buf, machine().pens);
+ draw_scanline8(*m_bitmap, teletyper_window_offset_x, y, teletyper_window_width, buf, m_palette->pens());
}
m_bitmap->fill(0, teletyper_scroll_clear_window);
@@ -890,7 +890,8 @@ static MACHINE_CONFIG_START( apexc, apexc_state )
MCFG_SCREEN_UPDATE_DRIVER(apexc_state, screen_update_apexc)
MCFG_GFXDECODE_ADD("gfxdecode", apexc)
- MCFG_PALETTE_LENGTH(APEXC_PALETTE_SIZE)
+ MCFG_PALETTE_ADD("palette", APEXC_PALETTE_SIZE)
+ MCFG_PALETTE_INIT_OWNER(apexc_state, apexc)
MCFG_APEXC_CYLINDER_ADD("cylinder")
diff --git a/src/mess/drivers/apogee.c b/src/mess/drivers/apogee.c
index 23cd7d88798..1a56fa06d35 100644
--- a/src/mess/drivers/apogee.c
+++ b/src/mess/drivers/apogee.c
@@ -227,8 +227,8 @@ static MACHINE_CONFIG_START( apogee, apogee_state )
MCFG_SCREEN_VISIBLE_AREA(0, 78*6-1, 0, 30*10-1)
MCFG_GFXDECODE_ADD("gfxdecode", apogee)
- MCFG_PALETTE_LENGTH(3)
- MCFG_PALETTE_INIT_OVERRIDE(apogee_state,radio86)
+ MCFG_PALETTE_ADD("palette", 3)
+ MCFG_PALETTE_INIT_OWNER(apogee_state,radio86)
MCFG_SPEAKER_STANDARD_MONO("mono")
MCFG_SOUND_WAVE_ADD(WAVE_TAG, "cassette")
diff --git a/src/mess/drivers/apple1.c b/src/mess/drivers/apple1.c
index 3aa7d9d0811..feeaa3a96cb 100644
--- a/src/mess/drivers/apple1.c
+++ b/src/mess/drivers/apple1.c
@@ -301,9 +301,8 @@ static MACHINE_CONFIG_START( apple1, apple1_state )
MCFG_GFXDECODE_ADD("gfxdecode", apple1)
- MCFG_PALETTE_LENGTH(2)
- MCFG_PALETTE_INIT_OVERRIDE(driver_device, black_and_white)
+ MCFG_PALETTE_ADD_BLACK_AND_WHITE("palette")
MCFG_DEVICE_ADD( "pia", PIA6821, 0)
MCFG_PIA_READPA_HANDLER(READ8(apple1_state,apple1_pia0_kbdin))
diff --git a/src/mess/drivers/apple2.c b/src/mess/drivers/apple2.c
index a58be69b7db..3c10714f51f 100644
--- a/src/mess/drivers/apple2.c
+++ b/src/mess/drivers/apple2.c
@@ -933,7 +933,7 @@ static const rgb_t apple2_palette[] =
/* Initialize the palette */
PALETTE_INIT_MEMBER(apple2_state,apple2)
{
- palette_set_colors(machine(), 0, apple2_palette, ARRAY_LENGTH(apple2_palette));
+ palette.set_pen_colors(0, apple2_palette, ARRAY_LENGTH(apple2_palette));
}
static const cassette_interface apple2_cassette_interface =
@@ -1019,8 +1019,8 @@ static MACHINE_CONFIG_START( apple2_common, apple2_state )
MCFG_SCREEN_VISIBLE_AREA(0, (280*2)-1,0,192-1)
MCFG_SCREEN_UPDATE_DRIVER(apple2_state, screen_update_apple2)
- MCFG_PALETTE_LENGTH(ARRAY_LENGTH(apple2_palette))
- MCFG_PALETTE_INIT_OVERRIDE(apple2_state,apple2)
+ MCFG_PALETTE_ADD("palette", ARRAY_LENGTH(apple2_palette))
+ MCFG_PALETTE_INIT_OWNER(apple2_state,apple2)
MCFG_VIDEO_START_OVERRIDE(apple2_state,apple2)
diff --git a/src/mess/drivers/apple2gs.c b/src/mess/drivers/apple2gs.c
index 787fe122da3..c08b2593373 100644
--- a/src/mess/drivers/apple2gs.c
+++ b/src/mess/drivers/apple2gs.c
@@ -143,11 +143,11 @@ PALETTE_INIT_MEMBER(apple2gs_state,apple2gs)
{
int i;
- PALETTE_INIT_CALL_MEMBER(apple2);
+ PALETTE_INIT_NAME(apple2)(palette);
for (i = 0; i < 16; i++)
{
- palette_set_color_rgb(machine(), i,
+ palette.set_pen_color(i,
apple2gs_palette[(3*i)]*17,
apple2gs_palette[(3*i)+1]*17,
apple2gs_palette[(3*i)+2]*17);
@@ -344,13 +344,13 @@ static MACHINE_CONFIG_START( apple2gs, apple2gs_state )
MCFG_SCREEN_VISIBLE_AREA(0,703,0,230)
MCFG_SCREEN_UPDATE_DRIVER(apple2gs_state, screen_update_apple2gs)
- MCFG_PALETTE_LENGTH( 16+256 )
- MCFG_GFXDECODE_ADD("gfxdecode", apple2gs )
+ MCFG_PALETTE_ADD( "palette", 16+256 )
+ MCFG_PALETTE_INIT_OWNER(apple2gs_state, apple2gs )
+ MCFG_GFXDECODE_ADD("gfxdecode", apple2gs )
MCFG_MACHINE_START_OVERRIDE(apple2gs_state, apple2gs )
MCFG_MACHINE_RESET_OVERRIDE(apple2gs_state, apple2gs )
- MCFG_PALETTE_INIT_OVERRIDE(apple2gs_state, apple2gs )
MCFG_VIDEO_START_OVERRIDE(apple2gs_state, apple2gs )
/* keyboard controller */
diff --git a/src/mess/drivers/apple3.c b/src/mess/drivers/apple3.c
index 57586f3e637..fc4f9492cc0 100644
--- a/src/mess/drivers/apple3.c
+++ b/src/mess/drivers/apple3.c
@@ -72,8 +72,8 @@ static MACHINE_CONFIG_START( apple3, apple3_state )
MCFG_SCREEN_VISIBLE_AREA(0, (280*2)-1,0,192-1)
MCFG_SCREEN_UPDATE_DRIVER(apple3_state, screen_update_apple3)
- MCFG_PALETTE_LENGTH(32)
- MCFG_PALETTE_INIT_OVERRIDE(apple3_state, apple3 )
+ MCFG_PALETTE_ADD("palette", 32)
+ MCFG_PALETTE_INIT_OWNER(apple3_state, apple3 )
MCFG_VIDEO_START_OVERRIDE(apple3_state, apple3 )
diff --git a/src/mess/drivers/applix.c b/src/mess/drivers/applix.c
index af159a354da..bec43f0dbf8 100644
--- a/src/mess/drivers/applix.c
+++ b/src/mess/drivers/applix.c
@@ -135,7 +135,7 @@ public:
UINT8 m_pa;
virtual void machine_reset();
virtual void video_start();
- virtual void palette_init();
+ DECLARE_PALETTE_INIT(applix);
UINT8 m_palette_latch[4];
required_shared_ptr<UINT16> m_base;
private:
@@ -734,7 +734,7 @@ static SLOT_INTERFACE_START( applix_floppies )
SLOT_INTERFACE_END
-void applix_state::palette_init()
+PALETTE_INIT_MEMBER(applix_state, applix)
{ // shades need to be verified - the names on the right are from the manual
const UINT8 colors[16*3] = {
0x00, 0x00, 0x00, // 0 Black
@@ -759,7 +759,7 @@ void applix_state::palette_init()
for (i = 0; i < 48; color_count++)
{
r = colors[i++]; g = colors[i++]; b = colors[i++];
- palette_set_color(machine(), color_count, rgb_t(r, g, b));
+ palette.set_pen_color(color_count, rgb_t(r, g, b));
}
}
@@ -870,7 +870,8 @@ static MACHINE_CONFIG_START( applix, applix_state )
MCFG_SCREEN_SIZE(640, 200)
MCFG_SCREEN_VISIBLE_AREA(0, 640-1, 0, 200-1)
MCFG_SCREEN_UPDATE_DEVICE("crtc", mc6845_device, screen_update)
- MCFG_PALETTE_LENGTH(16)
+ MCFG_PALETTE_ADD("palette", 16)
+ MCFG_PALETTE_INIT_OWNER(applix_state, applix)
/* sound hardware */
MCFG_SPEAKER_STANDARD_STEREO("lspeaker", "rspeaker")
diff --git a/src/mess/drivers/apricotf.c b/src/mess/drivers/apricotf.c
index 52f8f44d116..41f87c0ab26 100644
--- a/src/mess/drivers/apricotf.c
+++ b/src/mess/drivers/apricotf.c
@@ -93,7 +93,7 @@ WRITE16_MEMBER( f1_state::palette_w )
g = ((m_p_paletteram[offset] & 4)>>1) | i;
b = ((m_p_paletteram[offset] & 8)>>2) | i;
- palette_set_color_rgb(machine(), offset, pal2bit(r), pal2bit(g), pal2bit(b));
+ m_palette->set_pen_color(offset, pal2bit(r), pal2bit(g), pal2bit(b));
}
}
@@ -332,7 +332,7 @@ static MACHINE_CONFIG_START( act_f1, f1_state )
MCFG_SCREEN_UPDATE_DRIVER(f1_state, screen_update)
MCFG_SCREEN_SIZE(640, 256)
MCFG_SCREEN_VISIBLE_AREA(0, 640-1, 0, 256-1)
- MCFG_PALETTE_LENGTH(16)
+ MCFG_PALETTE_ADD("palette", 16)
MCFG_GFXDECODE_ADD("gfxdecode", act_f1)
/* Devices */
diff --git a/src/mess/drivers/apricotp.c b/src/mess/drivers/apricotp.c
index 673835326ec..fd1f641dbff 100644
--- a/src/mess/drivers/apricotp.c
+++ b/src/mess/drivers/apricotp.c
@@ -602,7 +602,7 @@ static MACHINE_CONFIG_START( fp, fp_state )
MCFG_SCREEN_SIZE(640, 256)
MCFG_SCREEN_VISIBLE_AREA(0, 640-1, 0, 256-1)
- MCFG_PALETTE_LENGTH(16)
+ MCFG_PALETTE_ADD("palette", 16)
MCFG_GFXDECODE_ADD("gfxdecode", act_f1)
MCFG_MC6845_ADD(MC6845_TAG, MC6845, SCREEN_CRT_TAG, 4000000, crtc_intf)
diff --git a/src/mess/drivers/aquarius.c b/src/mess/drivers/aquarius.c
index 0322786cc5d..7d3727a5a2f 100644
--- a/src/mess/drivers/aquarius.c
+++ b/src/mess/drivers/aquarius.c
@@ -371,9 +371,9 @@ static MACHINE_CONFIG_START( aquarius, aquarius_state )
MCFG_SCREEN_VISIBLE_AREA(0, 40 * 8 - 1, 0 * 8, 25 * 8 - 1)
MCFG_SCREEN_UPDATE_DRIVER(aquarius_state, screen_update_aquarius)
- MCFG_GFXDECODE_ADD("gfxdecode", aquarius )
- MCFG_PALETTE_LENGTH(512)
-
+ MCFG_GFXDECODE_ADD("gfxdecode", aquarius )
+ MCFG_PALETTE_ADD("palette", 512)
+ MCFG_PALETTE_INIT_OWNER(aquarius_state, aquarius)
/* sound hardware */
MCFG_SPEAKER_STANDARD_MONO("mono")
diff --git a/src/mess/drivers/arcadia.c b/src/mess/drivers/arcadia.c
index 8f433f1e446..fd62afac9ee 100644
--- a/src/mess/drivers/arcadia.c
+++ b/src/mess/drivers/arcadia.c
@@ -438,17 +438,15 @@ static const unsigned short arcadia_palette[128+8] = /* bgnd, fgnd */
7,0, 7,1, 7,2, 7,3, 7,4, 7,5, 7,6, 7,7
};
-void arcadia_state::palette_init()
+PALETTE_INIT_MEMBER(arcadia_state, arcadia)
{
int i;
- machine().colortable = colortable_alloc(machine(), 8);
-
for (i = 0; i < 8; i++)
- colortable_palette_set_color(machine().colortable, i, arcadia_colors[i]);
+ palette.set_indirect_color(i, arcadia_colors[i]);
for (i = 0; i < 128+8; i++)
- colortable_entry_set_value(machine().colortable, i, arcadia_palette[i]);
+ palette.set_pen_indirect(i, arcadia_palette[i]);
}
DEVICE_IMAGE_LOAD_MEMBER( arcadia_state, arcadia_cart )
@@ -541,8 +539,9 @@ static MACHINE_CONFIG_START( arcadia, arcadia_state )
MCFG_SCREEN_VISIBLE_AREA(0, 2*XPOS+128-1, 0, 262-1)
MCFG_SCREEN_UPDATE_DRIVER(arcadia_state, screen_update_arcadia)
- MCFG_GFXDECODE_ADD("gfxdecode", arcadia )
- MCFG_PALETTE_LENGTH(ARRAY_LENGTH(arcadia_palette))
+ MCFG_GFXDECODE_ADD("gfxdecode", arcadia )
+ MCFG_PALETTE_ADD("palette", ARRAY_LENGTH(arcadia_palette))
+ MCFG_PALETTE_INIT_OWNER(arcadia_state, arcadia)
/* sound hardware */
diff --git a/src/mess/drivers/argo.c b/src/mess/drivers/argo.c
index 3dc26395aeb..f69030b6b54 100644
--- a/src/mess/drivers/argo.c
+++ b/src/mess/drivers/argo.c
@@ -358,8 +358,7 @@ static MACHINE_CONFIG_START( argo, argo_state )
MCFG_SCREEN_UPDATE_DRIVER(argo_state, screen_update)
MCFG_SCREEN_SIZE(640, 250)
MCFG_SCREEN_VISIBLE_AREA(0, 639, 0, 249)
- MCFG_PALETTE_LENGTH(2)
- MCFG_PALETTE_INIT_OVERRIDE(driver_device, black_and_white)
+ MCFG_PALETTE_ADD_BLACK_AND_WHITE("palette")
MACHINE_CONFIG_END
/* ROM definition */
diff --git a/src/mess/drivers/astrocde.c b/src/mess/drivers/astrocde.c
index e31abe09ffd..a8aa03c4db7 100644
--- a/src/mess/drivers/astrocde.c
+++ b/src/mess/drivers/astrocde.c
@@ -260,7 +260,7 @@ static MACHINE_CONFIG_START( astrocde, astrocde_mess_state )
MCFG_SCREEN_RAW_PARAMS(ASTROCADE_CLOCK, 455, 0, 352, 262, 0, 240)
MCFG_SCREEN_UPDATE_DRIVER(astrocde_state, screen_update_astrocde)
- MCFG_PALETTE_LENGTH(512)
+ MCFG_PALETTE_ADD("palette", 512)
/* sound hardware */
diff --git a/src/mess/drivers/at.c b/src/mess/drivers/at.c
index 1f7a1f1d291..53ab2059c9c 100644
--- a/src/mess/drivers/at.c
+++ b/src/mess/drivers/at.c
@@ -360,9 +360,6 @@ static MACHINE_CONFIG_FRAGMENT( at_motherboard )
MCFG_SPEAKER_STANDARD_MONO("mono")
MCFG_SOUND_ADD("speaker", SPEAKER_SOUND, 0)
MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.50)
-
- /* video hardware */
- MCFG_PALETTE_LENGTH( 256 )
MACHINE_CONFIG_END
static MACHINE_CONFIG_START( ibm5170, at_state )
diff --git a/src/mess/drivers/atari400.c b/src/mess/drivers/atari400.c
index f18a546319d..1e483cb2dfa 100644
--- a/src/mess/drivers/atari400.c
+++ b/src/mess/drivers/atari400.c
@@ -298,7 +298,7 @@ public:
DECLARE_MACHINE_START(a800);
DECLARE_MACHINE_START(a800xl);
DECLARE_MACHINE_START(a5200);
- virtual void palette_init();
+ DECLARE_PALETTE_INIT(a400);
DECLARE_WRITE8_MEMBER(a1200xl_pia_pb_w);
DECLARE_WRITE8_MEMBER(a800xl_pia_pb_w);
DECLARE_WRITE8_MEMBER(xegs_pia_pb_w);
@@ -922,13 +922,13 @@ static const UINT8 atari_palette[256*3] =
/* Initialise the palette */
-void a400_state::palette_init()
+PALETTE_INIT_MEMBER(a400_state, a400)
{
int i;
for ( i = 0; i < sizeof(atari_palette) / 3; i++ )
{
- palette_set_color_rgb(machine(), i, atari_palette[i*3], atari_palette[i*3+1], atari_palette[i*3+2]);
+ palette.set_pen_color(i, atari_palette[i*3], atari_palette[i*3+1], atari_palette[i*3+2]);
}
}
/******************************************************************
@@ -2481,9 +2481,11 @@ static MACHINE_CONFIG_START( atari_common_nodac, a400_state )
MCFG_SCREEN_ADD("screen", RASTER)
MCFG_SCREEN_VBLANK_TIME(ATTOSECONDS_IN_USEC(1))
MCFG_SCREEN_VISIBLE_AREA(MIN_X, MAX_X, MIN_Y, MAX_Y)
- MCFG_PALETTE_LENGTH(sizeof(atari_palette) / 3)
MCFG_SCREEN_UPDATE_STATIC(atari)
+ MCFG_PALETTE_ADD("palette", sizeof(atari_palette) / 3)
+ MCFG_PALETTE_INIT_OWNER(a400_state, a400)
+
MCFG_VIDEO_START(atari)
MCFG_DEVICE_ADD("pia", PIA6821, 0)
diff --git a/src/mess/drivers/atarist.c b/src/mess/drivers/atarist.c
index 885684d5f41..a5dd77b69cf 100644
--- a/src/mess/drivers/atarist.c
+++ b/src/mess/drivers/atarist.c
@@ -2190,7 +2190,7 @@ static MACHINE_CONFIG_START( st, st_state )
MCFG_SCREEN_UPDATE_DRIVER(st_state, screen_update)
MCFG_SCREEN_RAW_PARAMS(Y2/2, ATARIST_HTOT_PAL*2, ATARIST_HBEND_PAL*2, ATARIST_HBSTART_PAL*2, ATARIST_VTOT_PAL, ATARIST_VBEND_PAL, ATARIST_VBSTART_PAL)
- MCFG_PALETTE_LENGTH(16)
+ MCFG_PALETTE_ADD("palette", 16)
// sound hardware
MCFG_SPEAKER_STANDARD_MONO("mono")
@@ -2268,7 +2268,7 @@ static MACHINE_CONFIG_START( megast, megast_state )
MCFG_SCREEN_UPDATE_DRIVER(megast_state, screen_update)
MCFG_SCREEN_RAW_PARAMS(Y2/4, ATARIST_HTOT_PAL, ATARIST_HBEND_PAL, ATARIST_HBSTART_PAL, ATARIST_VTOT_PAL, ATARIST_VBEND_PAL, ATARIST_VBSTART_PAL)
- MCFG_PALETTE_LENGTH(16)
+ MCFG_PALETTE_ADD("palette", 16)
// sound hardware
MCFG_SPEAKER_STANDARD_MONO("mono")
@@ -2347,7 +2347,7 @@ static MACHINE_CONFIG_START( ste, ste_state )
MCFG_SCREEN_UPDATE_DRIVER(ste_state, screen_update)
MCFG_SCREEN_RAW_PARAMS(Y2/4, ATARIST_HTOT_PAL, ATARIST_HBEND_PAL, ATARIST_HBSTART_PAL, ATARIST_VTOT_PAL, ATARIST_VBEND_PAL, ATARIST_VBSTART_PAL)
- MCFG_PALETTE_LENGTH(512)
+ MCFG_PALETTE_ADD("palette", 512)
// sound hardware
MCFG_SPEAKER_STANDARD_STEREO("lspeaker", "rspeaker")
@@ -2450,9 +2450,7 @@ static MACHINE_CONFIG_START( stbook, stbook_state )
MCFG_SCREEN_SIZE(640, 400)
MCFG_SCREEN_VISIBLE_AREA(0, 639, 0, 399)
- MCFG_PALETTE_LENGTH(2)
-
- MCFG_PALETTE_INIT_OVERRIDE(driver_device, black_and_white)
+ MCFG_PALETTE_ADD_BLACK_AND_WHITE("palette")
// sound hardware
MCFG_SPEAKER_STANDARD_MONO("mono")
diff --git a/src/mess/drivers/avigo.c b/src/mess/drivers/avigo.c
index ae242a404ac..7fec9b8cbf8 100644
--- a/src/mess/drivers/avigo.c
+++ b/src/mess/drivers/avigo.c
@@ -902,7 +902,8 @@ static MACHINE_CONFIG_START( avigo, avigo_state )
MCFG_DEFAULT_LAYOUT(layout_avigo)
MCFG_GFXDECODE_ADD("gfxdecode", avigo)
- MCFG_PALETTE_LENGTH(AVIGO_NUM_COLOURS)
+ MCFG_PALETTE_ADD("palette", AVIGO_NUM_COLOURS)
+ MCFG_PALETTE_INIT_OWNER(avigo_state, avigo)
/* sound hardware */
MCFG_SPEAKER_STANDARD_MONO("mono")
diff --git a/src/mess/drivers/ax20.c b/src/mess/drivers/ax20.c
index 4e5eb7e2bbf..4ade8f729a8 100644
--- a/src/mess/drivers/ax20.c
+++ b/src/mess/drivers/ax20.c
@@ -48,7 +48,7 @@ UINT32 ax20_state::screen_update(screen_device &screen, bitmap_ind16 &bitmap, co
{
UINT16 tile = m_p_vram[24 + y * 128 + x ] & 0x7f;
- m_gfxdecode->gfx(0)->opaque(bitmap,cliprect, tile, 0, 0, 0, x*8, y*12);
+ m_gfxdecode->gfx(0)->opaque(m_palette,bitmap,cliprect, tile, 0, 0, 0, x*8, y*12);
}
}
@@ -119,8 +119,7 @@ static MACHINE_CONFIG_START( ax20, ax20_state )
MCFG_SCREEN_SIZE(80*8, 24*12)
MCFG_SCREEN_VISIBLE_AREA(0, 80*8-1, 0, 24*12-1)
MCFG_GFXDECODE_ADD("gfxdecode", ax20)
- MCFG_PALETTE_LENGTH(2)
- MCFG_PALETTE_INIT_OVERRIDE(driver_device, monochrome_green)
+ MCFG_PALETTE_ADD_MONOCHROME_GREEN("palette")
/* Devices */
MCFG_LEGACY_FLOPPY_DRIVE_ADD(FLOPPY_0, ax20_floppy_interface)
diff --git a/src/mess/drivers/b16.c b/src/mess/drivers/b16.c
index 6ad72618c3c..d30d417aa76 100644
--- a/src/mess/drivers/b16.c
+++ b/src/mess/drivers/b16.c
@@ -101,7 +101,7 @@ UINT32 b16_state::screen_update(screen_device &screen, bitmap_ind16 &bitmap, con
pen = (gfx_rom[tile*16+yi] >> (7-xi) & 1) ? color : 0;
if(y*mc6845_tile_height < 400 && x*8+xi < 640) /* TODO: safety check */
- bitmap.pix16(y*mc6845_tile_height+yi, x*8+xi) = machine().pens[pen];
+ bitmap.pix16(y*mc6845_tile_height+yi, x*8+xi) = m_palette->pen(pen);
}
}
}
@@ -313,8 +313,8 @@ static MACHINE_CONFIG_START( b16, b16_state )
MCFG_I8237_ADD("8237dma", XTAL_14_31818MHz/2, b16_dma8237_interface)
MCFG_GFXDECODE_ADD("gfxdecode", b16)
- MCFG_PALETTE_LENGTH(8)
-// MCFG_PALETTE_INIT_OVERRIDE(driver_device, black_and_white) // TODO
+ MCFG_PALETTE_ADD("palette", 8)
+// MCFG_PALETTE_INIT_STANDARD(black_and_white) // TODO
MACHINE_CONFIG_END
diff --git a/src/mess/drivers/b2m.c b/src/mess/drivers/b2m.c
index d09bb1a4df3..c29c06dbfae 100644
--- a/src/mess/drivers/b2m.c
+++ b/src/mess/drivers/b2m.c
@@ -196,7 +196,8 @@ static MACHINE_CONFIG_START( b2m, b2m_state )
MCFG_SCREEN_VISIBLE_AREA(0, 384-1, 0, 256-1)
MCFG_SCREEN_UPDATE_DRIVER(b2m_state, screen_update_b2m)
- MCFG_PALETTE_LENGTH(4)
+ MCFG_PALETTE_ADD("palette", 4)
+ MCFG_PALETTE_INIT_OWNER(b2m_state, b2m)
MCFG_DEVICE_ADD("pit8253", PIT8253, 0)
MCFG_PIT8253_CLK0(0)
diff --git a/src/mess/drivers/bbc.c b/src/mess/drivers/bbc.c
index 373e04a69df..10c1fc3e242 100644
--- a/src/mess/drivers/bbc.c
+++ b/src/mess/drivers/bbc.c
@@ -300,7 +300,7 @@ static const rgb_t bbc_palette[8]=
PALETTE_INIT_MEMBER(bbc_state, bbc)
{
- palette_set_colors(machine(), 0, bbc_palette, ARRAY_LENGTH(bbc_palette));
+ palette.set_pen_colors(0, bbc_palette, ARRAY_LENGTH(bbc_palette));
}
@@ -699,9 +699,9 @@ static MACHINE_CONFIG_START( bbca, bbc_state )
MCFG_SCREEN_VBLANK_TIME(ATTOSECONDS_IN_USEC(128))
MCFG_SCREEN_UPDATE_DEVICE("mc6845", mc6845_device, screen_update)
- MCFG_PALETTE_LENGTH(16)
- MCFG_PALETTE_INIT_OVERRIDE(bbc_state, bbc)
- MCFG_SAA5050_ADD("saa5050", XTAL_12MHz/2, trom_intf)
+ MCFG_PALETTE_ADD("palette", 16)
+ MCFG_PALETTE_INIT_OWNER(bbc_state,bbc)
+ MCFG_SAA5050_ADD("saa505x", XTAL_12MHz/2, trom_intf)
/* crtc */
MCFG_MC6845_ADD("mc6845", MC6845, "screen", 2000000, bbc_mc6845_intf)
@@ -909,9 +909,9 @@ static MACHINE_CONFIG_START( bbcm, bbc_state )
MCFG_SCREEN_VBLANK_TIME(ATTOSECONDS_IN_USEC(128))
MCFG_SCREEN_SIZE(640, 256)
MCFG_SCREEN_VISIBLE_AREA(0, 640-1, 0, 256-1)
- MCFG_PALETTE_LENGTH(16)
- MCFG_PALETTE_INIT_OVERRIDE(bbc_state, bbc)
MCFG_SCREEN_UPDATE_DEVICE("mc6845", mc6845_device, screen_update)
+ MCFG_PALETTE_ADD("palette", 16)
+ MCFG_PALETTE_INIT_OWNER(bbc_state,bbc)
MCFG_SAA5050_ADD("saa5050", XTAL_12MHz/2, trom_intf)
diff --git a/src/mess/drivers/bcs3.c b/src/mess/drivers/bcs3.c
index 1785c120ea8..d449598a5bc 100644
--- a/src/mess/drivers/bcs3.c
+++ b/src/mess/drivers/bcs3.c
@@ -427,8 +427,7 @@ static MACHINE_CONFIG_START( bcs3, bcs3_state )
MCFG_SCREEN_VISIBLE_AREA(0,28*8-1,0,12*10-1)
MCFG_SCREEN_UPDATE_DRIVER(bcs3_state, screen_update_bcs3)
MCFG_GFXDECODE_ADD("gfxdecode", bcs3)
- MCFG_PALETTE_LENGTH(2)
- MCFG_PALETTE_INIT_OVERRIDE(driver_device, black_and_white)
+ MCFG_PALETTE_ADD_BLACK_AND_WHITE("palette")
MACHINE_CONFIG_END
static MACHINE_CONFIG_DERIVED( bcs3a, bcs3 )
diff --git a/src/mess/drivers/beehive.c b/src/mess/drivers/beehive.c
index 3bbfd7f0a05..14dbc4b90b6 100644
--- a/src/mess/drivers/beehive.c
+++ b/src/mess/drivers/beehive.c
@@ -299,8 +299,7 @@ static MACHINE_CONFIG_START( beehive, beehive_state )
MCFG_SCREEN_UPDATE_DRIVER(beehive_state, screen_update)
MCFG_SCREEN_SIZE(640, 250)
MCFG_SCREEN_VISIBLE_AREA(0, 639, 0, 249)
- MCFG_PALETTE_LENGTH(2)
- MCFG_PALETTE_INIT_OVERRIDE(driver_device, monochrome_green)
+ MCFG_PALETTE_ADD_MONOCHROME_GREEN("palette")
MACHINE_CONFIG_END
/* ROM definition */
diff --git a/src/mess/drivers/bigbord2.c b/src/mess/drivers/bigbord2.c
index b52156ddc2b..bc7c379bc41 100644
--- a/src/mess/drivers/bigbord2.c
+++ b/src/mess/drivers/bigbord2.c
@@ -652,8 +652,7 @@ static MACHINE_CONFIG_START( bigbord2, bigbord2_state )
MCFG_SCREEN_RAW_PARAMS(XTAL_10_69425MHz, 700, 0, 560, 260, 0, 240)
MCFG_SCREEN_UPDATE_DEVICE("crtc", mc6845_device, screen_update)
MCFG_GFXDECODE_ADD("gfxdecode", bigbord2)
- MCFG_PALETTE_LENGTH(2)
- MCFG_PALETTE_INIT_OVERRIDE(driver_device, black_and_white)
+ MCFG_PALETTE_ADD_BLACK_AND_WHITE("palette")
/* keyboard */
MCFG_TIMER_DRIVER_ADD_PERIODIC("ctc", bigbord2_state, ctc_tick, attotime::from_hz(MAIN_CLOCK))
diff --git a/src/mess/drivers/binbug.c b/src/mess/drivers/binbug.c
index 856a98cda4b..5b08d098690 100644
--- a/src/mess/drivers/binbug.c
+++ b/src/mess/drivers/binbug.c
@@ -311,8 +311,7 @@ static MACHINE_CONFIG_START( binbug, binbug_state )
MCFG_SCREEN_SIZE(512, 256)
MCFG_SCREEN_VISIBLE_AREA(0, 511, 0, 255)
MCFG_GFXDECODE_ADD("gfxdecode", dg640)
- MCFG_PALETTE_LENGTH(2)
- MCFG_PALETTE_INIT_OVERRIDE(driver_device, monochrome_amber)
+ MCFG_PALETTE_ADD_MONOCHROME_AMBER("palette")
/* Keyboard */
MCFG_SERIAL_KEYBOARD_ADD(KEYBOARD_TAG, keyboard_intf, 300)
@@ -570,8 +569,7 @@ static MACHINE_CONFIG_START( dg680, dg680_state )
MCFG_SCREEN_SIZE(512, 256)
MCFG_SCREEN_VISIBLE_AREA(0, 511, 0, 255)
MCFG_GFXDECODE_ADD("gfxdecode", dg640)
- MCFG_PALETTE_LENGTH(2)
- MCFG_PALETTE_INIT_OVERRIDE(driver_device, monochrome_amber)
+ MCFG_PALETTE_ADD_MONOCHROME_AMBER("palette")
/* Keyboard */
MCFG_ASCII_KEYBOARD_ADD("keyb", dg680_keyboard_intf)
diff --git a/src/mess/drivers/bk.c b/src/mess/drivers/bk.c
index 9154994eadc..6018ba0275a 100644
--- a/src/mess/drivers/bk.c
+++ b/src/mess/drivers/bk.c
@@ -181,8 +181,7 @@ static MACHINE_CONFIG_START( bk0010, bk_state )
MCFG_SCREEN_VISIBLE_AREA(0, 512-1, 0, 256-1)
MCFG_SCREEN_UPDATE_DRIVER(bk_state, screen_update_bk0010)
- MCFG_PALETTE_LENGTH(2)
- MCFG_PALETTE_INIT_OVERRIDE(driver_device, black_and_white)
+ MCFG_PALETTE_ADD_BLACK_AND_WHITE("palette")
MCFG_SPEAKER_STANDARD_MONO("mono")
diff --git a/src/mess/drivers/bmjr.c b/src/mess/drivers/bmjr.c
index 646f067f625..58b9f636cfd 100644
--- a/src/mess/drivers/bmjr.c
+++ b/src/mess/drivers/bmjr.c
@@ -53,7 +53,7 @@ public:
virtual void machine_start();
virtual void machine_reset();
virtual void video_start();
- virtual void palette_init();
+ DECLARE_PALETTE_INIT(bmjr);
UINT32 screen_update_bmjr(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
};
@@ -324,12 +324,12 @@ static GFXDECODE_START( bmjr )
GFXDECODE_ENTRY( "chargen", 0x0000, bmjr_charlayout, 0, 4 )
GFXDECODE_END
-void bmjr_state::palette_init()
+PALETTE_INIT_MEMBER(bmjr_state, bmjr)
{
int i;
for(i=0;i<8;i++)
- palette_set_color_rgb(machine(), i, pal1bit(i >> 1),pal1bit(i >> 2),pal1bit(i >> 0));
+ palette.set_pen_color(i, pal1bit(i >> 1),pal1bit(i >> 2),pal1bit(i >> 0));
}
@@ -359,7 +359,8 @@ static MACHINE_CONFIG_START( bmjr, bmjr_state )
MCFG_SCREEN_SIZE(256, 192)
MCFG_SCREEN_VISIBLE_AREA(0, 256-1, 0, 192-1)
MCFG_SCREEN_UPDATE_DRIVER(bmjr_state, screen_update_bmjr)
- MCFG_PALETTE_LENGTH(8)
+ MCFG_PALETTE_ADD("palette", 8)
+ MCFG_PALETTE_INIT_OWNER(bmjr_state, bmjr)
MCFG_GFXDECODE_ADD("gfxdecode", bmjr)
/* Audio */
diff --git a/src/mess/drivers/bml3.c b/src/mess/drivers/bml3.c
index 5a3cd4814e2..c54d37008da 100644
--- a/src/mess/drivers/bml3.c
+++ b/src/mess/drivers/bml3.c
@@ -122,6 +122,7 @@ public:
TIMER_DEVICE_CALLBACK_MEMBER(keyboard_callback);
DECLARE_READ8_MEMBER(bml3_ym2203_r);
DECLARE_WRITE8_MEMBER(bml3_ym2203_w);
+ DECLARE_PALETTE_INIT(bml3);
private:
UINT8 m_psg_latch;
UINT8 m_attr_latch;
@@ -139,7 +140,6 @@ private:
UINT8 m_cass_data[4];
virtual void machine_reset();
virtual void machine_start();
- virtual void palette_init();
void m6845_change_clock(UINT8 setting);
UINT8 m_crtc_index;
UINT8 *m_extram;
@@ -770,12 +770,12 @@ INTERRUPT_GEN_MEMBER(bml3_state::bml3_timer_firq)
}
}
-void bml3_state::palette_init()
+PALETTE_INIT_MEMBER(bml3_state, bml3)
{
int i;
for(i=0;i<8;i++)
- palette_set_color_rgb(machine(), i, pal1bit(i >> 1),pal1bit(i >> 2),pal1bit(i >> 0));
+ palette.set_pen_color(i, pal1bit(i >> 1),pal1bit(i >> 2),pal1bit(i >> 0));
}
void bml3_state::machine_start()
@@ -1000,7 +1000,8 @@ static MACHINE_CONFIG_START( bml3_common, bml3_state )
MCFG_SCREEN_SIZE(640, 400)
MCFG_SCREEN_VISIBLE_AREA(0, 320-1, 0, 200-1)
MCFG_SCREEN_UPDATE_DEVICE("crtc", mc6845_device, screen_update)
- MCFG_PALETTE_LENGTH(8)
+ MCFG_PALETTE_ADD("palette", 8)
+ MCFG_PALETTE_INIT_OWNER(bml3_state, bml3)
/* Devices */
// CRTC clock should be synchronous with the CPU clock.
diff --git a/src/mess/drivers/busicom.c b/src/mess/drivers/busicom.c
index 2786412bd4b..ff79db2d429 100644
--- a/src/mess/drivers/busicom.c
+++ b/src/mess/drivers/busicom.c
@@ -224,8 +224,8 @@ static MACHINE_CONFIG_START( busicom, busicom_state )
MCFG_SCREEN_VISIBLE_AREA(0, 40*17-1, 0, 44*11-1)
MCFG_SCREEN_UPDATE_DRIVER(busicom_state, screen_update_busicom)
- MCFG_PALETTE_LENGTH(16)
-
+ MCFG_PALETTE_ADD("palette", 16)
+ MCFG_PALETTE_INIT_OWNER(busicom_state, busicom)
MCFG_TIMER_DRIVER_ADD_PERIODIC("busicom_timer", busicom_state, timer_callback, attotime::from_msec(28*2))
MACHINE_CONFIG_END
diff --git a/src/mess/drivers/bw2.c b/src/mess/drivers/bw2.c
index b8f163f9db5..a44d5c3136e 100644
--- a/src/mess/drivers/bw2.c
+++ b/src/mess/drivers/bw2.c
@@ -567,10 +567,10 @@ SLOT_INTERFACE_END
//**************************************************************************
-void bw2_state::palette_init()
+PALETTE_INIT_MEMBER(bw2_state, bw2)
{
- palette_set_color_rgb(machine(), 0, 0xa5, 0xad, 0xa5);
- palette_set_color_rgb(machine(), 1, 0x31, 0x39, 0x10);
+ palette.set_pen_color(0, 0xa5, 0xad, 0xa5);
+ palette.set_pen_color(1, 0x31, 0x39, 0x10);
}
@@ -615,7 +615,8 @@ static MACHINE_CONFIG_START( bw2, bw2_state )
MCFG_SCREEN_UPDATE_DEVICE( MSM6255_TAG, msm6255_device, screen_update )
MCFG_SCREEN_SIZE(640, 200)
MCFG_SCREEN_VISIBLE_AREA(0, 640-1, 0, 200-1)
- MCFG_PALETTE_LENGTH(2)
+ MCFG_PALETTE_ADD("palette", 2)
+ MCFG_PALETTE_INIT_OWNER(bw2_state, bw2)
// devices
MCFG_DEVICE_ADD(I8253_TAG, PIT8253, 0)
diff --git a/src/mess/drivers/c10.c b/src/mess/drivers/c10.c
index 7ab9ac1ea54..21266f6cb50 100644
--- a/src/mess/drivers/c10.c
+++ b/src/mess/drivers/c10.c
@@ -164,8 +164,7 @@ static MACHINE_CONFIG_START( c10, c10_state )
MCFG_SCREEN_SIZE(640, 250)
MCFG_SCREEN_VISIBLE_AREA(0, 639, 0, 249)
MCFG_GFXDECODE_ADD("gfxdecode", c10)
- MCFG_PALETTE_LENGTH(2)
- MCFG_PALETTE_INIT_OVERRIDE(driver_device, black_and_white)
+ MCFG_PALETTE_ADD_BLACK_AND_WHITE("palette")
MACHINE_CONFIG_END
DRIVER_INIT_MEMBER(c10_state,c10)
diff --git a/src/mess/drivers/c128.c b/src/mess/drivers/c128.c
index b02c23e88e9..c3b01256388 100644
--- a/src/mess/drivers/c128.c
+++ b/src/mess/drivers/c128.c
@@ -1466,6 +1466,7 @@ static MACHINE_CONFIG_START( ntsc, c128_state )
// video hardware
MCFG_MOS8563_ADD(MOS8563_TAG, SCREEN_VDC_TAG, VIC6567_CLOCK*2, vdc_intf, vdc_videoram_map)
MCFG_MOS8564_ADD(MOS8564_TAG, SCREEN_VIC_TAG, M8502_TAG, VIC6567_CLOCK, vic_videoram_map, vic_colorram_map, WRITELINE(c128_state, vic_irq_w), WRITE8(c128_state, vic_k_w))
+
MCFG_GFXDECODE_ADD("gfxdecode", c128)
// sound hardware
@@ -1598,6 +1599,7 @@ static MACHINE_CONFIG_START( pal, c128_state )
// video hardware
MCFG_MOS8563_ADD(MOS8563_TAG, SCREEN_VDC_TAG, VIC6569_CLOCK*2, vdc_intf, vdc_videoram_map)
MCFG_MOS8566_ADD(MOS8564_TAG, SCREEN_VIC_TAG, M8502_TAG, VIC6569_CLOCK, vic_videoram_map, vic_colorram_map, WRITELINE(c128_state, vic_irq_w), WRITE8(c128_state, vic_k_w))
+
MCFG_GFXDECODE_ADD("gfxdecode", c128)
// sound hardware
diff --git a/src/mess/drivers/c65.c b/src/mess/drivers/c65.c
index 310b7b1e735..d6ad1585751 100644
--- a/src/mess/drivers/c65.c
+++ b/src/mess/drivers/c65.c
@@ -347,23 +347,6 @@ INPUT_PORTS_END
/*************************************
*
- * Graphics definitions
- *
- *************************************/
-
-PALETTE_INIT_MEMBER(c65_state,c65)
-{
- int i;
-
- for ( i = 0; i < 0x100; i++ )
- {
- palette_set_color_rgb(machine(), i, 0, 0, 0);
- }
-}
-
-
-/*************************************
- *
* Sound definitions
*
*************************************/
@@ -582,9 +565,6 @@ static MACHINE_CONFIG_START( c65, c65_state )
MCFG_SCREEN_VISIBLE_AREA(VIC6567_STARTVISIBLECOLUMNS ,(VIC6567_STARTVISIBLECOLUMNS + VIC6567_VISIBLECOLUMNS - 1) * 2, VIC6567_STARTVISIBLELINES, VIC6567_STARTVISIBLELINES + VIC6567_VISIBLELINES - 1)
MCFG_SCREEN_UPDATE_DRIVER(c65_state, screen_update_c65)
- MCFG_PALETTE_LENGTH(0x100)
- MCFG_PALETTE_INIT_OVERRIDE(c65_state, c65 )
-
MCFG_VIC3_ADD("vic3", c65_vic3_ntsc_intf)
/* sound hardware */
diff --git a/src/mess/drivers/c900.c b/src/mess/drivers/c900.c
index 0ac5821a501..10a5d03880b 100644
--- a/src/mess/drivers/c900.c
+++ b/src/mess/drivers/c900.c
@@ -116,8 +116,7 @@ static MACHINE_CONFIG_START( c900, c900_state )
MCFG_GENERIC_TERMINAL_ADD(TERMINAL_TAG, terminal_intf)
MCFG_GFXDECODE_ADD("gfxdecode", c900)
- MCFG_PALETTE_LENGTH(2)
- MCFG_PALETTE_INIT_OVERRIDE(driver_device, black_and_white)
+ MCFG_PALETTE_ADD_BLACK_AND_WHITE("palette")
MACHINE_CONFIG_END
ROM_START( c900 )
diff --git a/src/mess/drivers/camplynx.c b/src/mess/drivers/camplynx.c
index fdb33da528f..89331ba2904 100644
--- a/src/mess/drivers/camplynx.c
+++ b/src/mess/drivers/camplynx.c
@@ -107,7 +107,7 @@ public:
DECLARE_WRITE8_MEMBER(lynx128k_irq);
DECLARE_DRIVER_INIT(lynx48k);
virtual void video_start();
- virtual void palette_init();
+ DECLARE_PALETTE_INIT(camplynx);
DECLARE_MACHINE_RESET(lynx128k);
};
@@ -370,14 +370,14 @@ static const UINT8 lynx48k_palette[8*3] =
0xff, 0xff, 0xff, /* 7 White */
};
-void camplynx_state::palette_init()
+PALETTE_INIT_MEMBER(camplynx_state, camplynx)
{
UINT8 r, b, g, i=0, color_count = 8;
while (color_count--)
{
r = lynx48k_palette[i++]; g = lynx48k_palette[i++]; b = lynx48k_palette[i++];
- palette_set_color(machine(), 7-color_count, rgb_t(r, g, b));
+ palette.set_pen_color(7-color_count, rgb_t(r, g, b));
}
}
@@ -479,7 +479,8 @@ static MACHINE_CONFIG_START( lynx48k, camplynx_state )
MCFG_SCREEN_SIZE(512, 480)
MCFG_SCREEN_VISIBLE_AREA(0, 511, 0, 479)
MCFG_SCREEN_UPDATE_DEVICE("crtc", mc6845_device, screen_update)
- MCFG_PALETTE_LENGTH(8)
+ MCFG_PALETTE_ADD("palette", 8)
+ MCFG_PALETTE_INIT_OWNER(camplynx_state, camplynx)
/* sound hardware */
MCFG_SPEAKER_STANDARD_MONO("mono")
@@ -506,7 +507,8 @@ static MACHINE_CONFIG_START( lynx128k, camplynx_state )
MCFG_SCREEN_SIZE(512, 480)
MCFG_SCREEN_VISIBLE_AREA(0, 511, 0, 479)
MCFG_SCREEN_UPDATE_DEVICE("crtc", mc6845_device, screen_update)
- MCFG_PALETTE_LENGTH(8)
+ MCFG_PALETTE_ADD("palette", 8)
+ MCFG_PALETTE_INIT_OWNER(camplynx_state, camplynx)
/* sound hardware */
MCFG_SPEAKER_STANDARD_MONO("mono")
diff --git a/src/mess/drivers/casloopy.c b/src/mess/drivers/casloopy.c
index 1685d134c05..e17001ae6be 100644
--- a/src/mess/drivers/casloopy.c
+++ b/src/mess/drivers/casloopy.c
@@ -252,7 +252,7 @@ UINT32 casloopy_state::screen_update_casloopy(screen_device &screen, bitmap_ind1
r = pal5bit((m_vregs[0x4/4] >> 10) & 0x1f);
g = pal5bit((m_vregs[0x4/4] >> 5) & 0x1f);
b = pal5bit((m_vregs[0x4/4] >> 0) & 0x1f);
- palette_set_color(machine(),0x100,rgb_t(r^0xff,g^0xff,b^0xff));
+ m_palette->set_pen_color(0x100,rgb_t(r^0xff,g^0xff,b^0xff));
bitmap.fill( 0x100 ,cliprect);
#endif
@@ -265,7 +265,7 @@ UINT32 casloopy_state::screen_update_casloopy(screen_device &screen, bitmap_ind1
tile &= 0x7ff; //???
- gfx->transpen(bitmap,cliprect,tile,7,0,0,x*8,y*8,0xffffffff);
+ gfx->transpen(m_palette,bitmap,cliprect,tile,7,0,0,x*8,y*8,0xffffffff);
count+=2;
}
@@ -328,7 +328,7 @@ WRITE16_MEMBER(casloopy_state::casloopy_pal_w)
g = ((m_paletteram[offset])&0x03e0)>>5;
r = ((m_paletteram[offset])&0x7c00)>>10;
- palette_set_color_rgb(machine(), offset, pal5bit(r), pal5bit(g), pal5bit(b));
+ m_palette->set_pen_color(offset, pal5bit(r), pal5bit(g), pal5bit(b));
}
READ8_MEMBER(casloopy_state::casloopy_vram_r)
@@ -493,7 +493,7 @@ static MACHINE_CONFIG_START( casloopy, casloopy_state )
// MCFG_SCREEN_VISIBLE_AREA(0*8, 32*8-1, 0*8, 32*8-1)
MCFG_SCREEN_UPDATE_DRIVER(casloopy_state, screen_update_casloopy)
- MCFG_PALETTE_LENGTH(512)
+ MCFG_PALETTE_ADD("palette", 512)
MCFG_GFXDECODE_ADD("gfxdecode", empty)
diff --git a/src/mess/drivers/cat.c b/src/mess/drivers/cat.c
index 445d0bfdb3c..f50bfe596b1 100644
--- a/src/mess/drivers/cat.c
+++ b/src/mess/drivers/cat.c
@@ -1126,8 +1126,7 @@ static MACHINE_CONFIG_START( cat, cat_state )
MCFG_SCREEN_VISIBLE_AREA(0, 672-1, 0, 344-1)
MCFG_SCREEN_UPDATE_DRIVER(cat_state, screen_update_cat)
- MCFG_PALETTE_LENGTH(2)
- MCFG_PALETTE_INIT_OVERRIDE(driver_device, black_and_white)
+ MCFG_PALETTE_ADD_BLACK_AND_WHITE("palette")
MCFG_VIDEO_START_OVERRIDE(cat_state,cat)
@@ -1463,8 +1462,7 @@ static MACHINE_CONFIG_START( swyft, cat_state )
MCFG_SCREEN_VISIBLE_AREA(0, 320-1, 0, 242-1)
MCFG_SCREEN_UPDATE_DRIVER(cat_state, screen_update_swyft)
- MCFG_PALETTE_LENGTH(2)
- MCFG_PALETTE_INIT_OVERRIDE(driver_device, black_and_white)
+ MCFG_PALETTE_ADD_BLACK_AND_WHITE("palette")
MCFG_VIDEO_START_OVERRIDE(cat_state,swyft)
diff --git a/src/mess/drivers/cd2650.c b/src/mess/drivers/cd2650.c
index 54993cb7996..176cb6ded7f 100644
--- a/src/mess/drivers/cd2650.c
+++ b/src/mess/drivers/cd2650.c
@@ -292,8 +292,7 @@ static MACHINE_CONFIG_START( cd2650, cd2650_state )
MCFG_SCREEN_SIZE(640, 160)
MCFG_SCREEN_VISIBLE_AREA(0, 639, 0, 159)
MCFG_GFXDECODE_ADD("gfxdecode", cd2650)
- MCFG_PALETTE_LENGTH(2)
- MCFG_PALETTE_INIT_OVERRIDE(driver_device, black_and_white)
+ MCFG_PALETTE_ADD_BLACK_AND_WHITE("palette")
/* quickload */
MCFG_QUICKLOAD_ADD("quickload", cd2650_state, cd2650, "pgm", 1)
diff --git a/src/mess/drivers/cdc721.c b/src/mess/drivers/cdc721.c
index 1f87fe4f981..128833b80af 100644
--- a/src/mess/drivers/cdc721.c
+++ b/src/mess/drivers/cdc721.c
@@ -22,7 +22,7 @@ public:
public:
virtual void machine_reset();
- void palette_init_cdc721();
+ DECLARE_PALETTE_INIT(cdc721);
const UINT8 *m_p_chargen;
UINT32 screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
required_shared_ptr<const UINT8> m_p_videoram;
@@ -71,9 +71,9 @@ GFXDECODE_END
PALETTE_INIT_MEMBER( cdc721_state, cdc721 )
{
- palette_set_color_rgb( machine(), 0, 0, 0, 0 ); /* Black */
- palette_set_color_rgb( machine(), 1, 0, 255, 0 ); /* Full */
- palette_set_color_rgb( machine(), 2, 0, 128, 0 ); /* Dimmed */
+ palette.set_pen_color(0, 0, 0, 0 ); /* Black */
+ palette.set_pen_color(1, 0, 255, 0 ); /* Full */
+ palette.set_pen_color(2, 0, 128, 0 ); /* Dimmed */
}
UINT32 cdc721_state::screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect)
@@ -122,8 +122,8 @@ static MACHINE_CONFIG_START( cdc721, cdc721_state )
MCFG_SCREEN_UPDATE_DRIVER(cdc721_state, screen_update)
MCFG_SCREEN_SIZE(640, 240)
MCFG_SCREEN_VISIBLE_AREA(0, 639, 0, 239)
- MCFG_PALETTE_LENGTH(3)
- MCFG_PALETTE_INIT_OVERRIDE(cdc721_state, cdc721)
+ MCFG_PALETTE_ADD("palette", 3)
+ MCFG_PALETTE_INIT_OWNER(cdc721_state, cdc721)
MCFG_GFXDECODE_ADD("gfxdecode", cdc721)
MACHINE_CONFIG_END
diff --git a/src/mess/drivers/cfx9850.c b/src/mess/drivers/cfx9850.c
index accdb6f0b09..756de4b8e49 100644
--- a/src/mess/drivers/cfx9850.c
+++ b/src/mess/drivers/cfx9850.c
@@ -49,7 +49,7 @@ public:
required_shared_ptr<UINT8> m_video_ram;
required_shared_ptr<UINT8> m_display_ram;
UINT16 m_ko; /* KO lines KO1 - KO14 */
- virtual void palette_init();
+ DECLARE_PALETTE_INIT(cfx9850);
UINT32 screen_update_cfx9850(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
protected:
@@ -218,12 +218,12 @@ static INPUT_PORTS_START( cfx9850 )
INPUT_PORTS_END
-void cfx9850_state::palette_init()
+PALETTE_INIT_MEMBER(cfx9850_state, cfx9850)
{
- palette_set_color_rgb( machine(), 0, 0xff, 0xff, 0xff );
- palette_set_color_rgb( machine(), 1, 0x00, 0x00, 0xff );
- palette_set_color_rgb( machine(), 2, 0x00, 0xff, 0x00 );
- palette_set_color_rgb( machine(), 3, 0xff, 0x00, 0x00 );
+ palette.set_pen_color( 0, 0xff, 0xff, 0xff );
+ palette.set_pen_color( 1, 0x00, 0x00, 0xff );
+ palette.set_pen_color( 2, 0x00, 0xff, 0x00 );
+ palette.set_pen_color( 3, 0xff, 0x00, 0x00 );
}
@@ -269,7 +269,8 @@ static MACHINE_CONFIG_START( cfx9850, cfx9850_state )
MCFG_DEFAULT_LAYOUT(layout_lcd)
/* TODO: It uses a color display, but I'm being lazy here. 3 colour lcd */
- MCFG_PALETTE_LENGTH( 4 )
+ MCFG_PALETTE_ADD( "palette", 4 )
+ MCFG_PALETTE_INIT_OWNER(cfx9850_state, cfx9850)
MACHINE_CONFIG_END
diff --git a/src/mess/drivers/cgenie.c b/src/mess/drivers/cgenie.c
index 15ae711bc7b..90674403b05 100644
--- a/src/mess/drivers/cgenie.c
+++ b/src/mess/drivers/cgenie.c
@@ -447,32 +447,28 @@ PALETTE_INIT_MEMBER(cgenie_state,cgenie)
{
UINT8 i, r, g, b;
- machine().colortable = colortable_alloc(machine(), 49);
-
for ( i = 0; i < 49; i++ )
{
r = cgenie_colors[i*3]; g = cgenie_colors[i*3+1]; b = cgenie_colors[i*3+2];
- colortable_palette_set_color(machine().colortable, i, rgb_t(r, g, b));
+ palette.set_indirect_color(i, rgb_t(r, g, b));
}
for(i=0; i<108; i++)
- colortable_entry_set_value(machine().colortable, i, cgenie_palette[i]);
+ palette.set_pen_indirect(i, cgenie_palette[i]);
}
PALETTE_INIT_MEMBER(cgenie_state,cgenienz)
{
UINT8 i, r, g, b;
- machine().colortable = colortable_alloc(machine(), 49);
-
for ( i = 0; i < 49; i++ )
{
r = cgenienz_colors[i*3]; g = cgenienz_colors[i*3+1]; b = cgenienz_colors[i*3+2];
- colortable_palette_set_color(machine().colortable, i, rgb_t(r, g, b));
+ palette.set_indirect_color(i, rgb_t(r, g, b));
}
for(i=0; i<108; i++)
- colortable_entry_set_value(machine().colortable, i, cgenie_palette[i]);
+ palette.set_pen_indirect(i, cgenie_palette[i]);
}
static const ay8910_interface cgenie_ay8910_interface =
@@ -536,8 +532,8 @@ static MACHINE_CONFIG_START( cgenie_common, cgenie_state )
MCFG_SCREEN_VISIBLE_AREA(0*8, 48*8-1,0*8,32*8-1)
MCFG_SCREEN_UPDATE_DRIVER(cgenie_state, screen_update_cgenie)
- MCFG_GFXDECODE_ADD("gfxdecode", cgenie )
- MCFG_PALETTE_LENGTH(108)
+ MCFG_GFXDECODE_ADD("gfxdecode", cgenie )
+ MCFG_PALETTE_ADD("palette", 108)
// Actually the video is driven by an HD46505 clocked at XTAL_17_73447MHz/16
@@ -566,13 +562,13 @@ static MACHINE_CONFIG_START( cgenie_common, cgenie_state )
MACHINE_CONFIG_END
static MACHINE_CONFIG_DERIVED( cgenie, cgenie_common )
-
- MCFG_PALETTE_INIT_OVERRIDE(cgenie_state, cgenie )
+ MCFG_PALETTE_MODIFY("palette")
+ MCFG_PALETTE_INIT_OWNER(cgenie_state, cgenie )
MACHINE_CONFIG_END
static MACHINE_CONFIG_DERIVED( cgenienz, cgenie_common )
-
- MCFG_PALETTE_INIT_OVERRIDE(cgenie_state, cgenienz )
+ MCFG_PALETTE_MODIFY("palette")
+ MCFG_PALETTE_INIT_OWNER(cgenie_state, cgenienz )
MACHINE_CONFIG_END
/***************************************************************************
diff --git a/src/mess/drivers/channelf.c b/src/mess/drivers/channelf.c
index 4545ec38f84..22d87263264 100644
--- a/src/mess/drivers/channelf.c
+++ b/src/mess/drivers/channelf.c
@@ -272,8 +272,8 @@ static MACHINE_CONFIG_START( channelf, channelf_state )
MCFG_SCREEN_VISIBLE_AREA(4, 112 - 7, 4, 64 - 3)
MCFG_SCREEN_UPDATE_DRIVER(channelf_state, screen_update_channelf)
- MCFG_PALETTE_LENGTH(8)
-
+ MCFG_PALETTE_ADD("palette", 8)
+ MCFG_PALETTE_INIT_OWNER(channelf_state, channelf)
/* sound hardware */
MCFG_SPEAKER_STANDARD_MONO("mono")
@@ -298,8 +298,8 @@ static MACHINE_CONFIG_START( sabavdpl, channelf_state )
MCFG_SCREEN_VISIBLE_AREA(4, 112 - 7, 4, 64 - 3)
MCFG_SCREEN_UPDATE_DRIVER(channelf_state, screen_update_channelf)
- MCFG_PALETTE_LENGTH(8)
-
+ MCFG_PALETTE_ADD("palette", 8)
+ MCFG_PALETTE_INIT_OWNER(channelf_state, channelf)
/* sound hardware */
MCFG_SPEAKER_STANDARD_MONO("mono")
@@ -325,8 +325,8 @@ static MACHINE_CONFIG_START( channlf2, channelf_state )
MCFG_SCREEN_VISIBLE_AREA(4, 112 - 7, 4, 64 - 3)
MCFG_SCREEN_UPDATE_DRIVER(channelf_state, screen_update_channelf)
- MCFG_PALETTE_LENGTH(8)
-
+ MCFG_PALETTE_ADD("palette", 8)
+ MCFG_PALETTE_INIT_OWNER(channelf_state, channelf)
/* sound hardware */
MCFG_SPEAKER_STANDARD_MONO("mono")
@@ -352,8 +352,8 @@ static MACHINE_CONFIG_START( sabavpl2, channelf_state )
MCFG_SCREEN_VISIBLE_AREA(4, 112 - 7, 4, 64 - 3)
MCFG_SCREEN_UPDATE_DRIVER(channelf_state, screen_update_channelf)
- MCFG_PALETTE_LENGTH(8)
-
+ MCFG_PALETTE_ADD("palette", 8)
+ MCFG_PALETTE_INIT_OWNER(channelf_state, channelf)
/* sound hardware */
MCFG_SPEAKER_STANDARD_MONO("mono")
diff --git a/src/mess/drivers/clcd.c b/src/mess/drivers/clcd.c
index ab747f01a3a..2e7e60db612 100644
--- a/src/mess/drivers/clcd.c
+++ b/src/mess/drivers/clcd.c
@@ -89,10 +89,10 @@ public:
m_rtc->cs1_w(1);
}
- void palette_init()
+ DECLARE_PALETTE_INIT(hprot1)
{
- palette_set_color(machine(), 0, rgb_t(36,72,36));
- palette_set_color(machine(), 1, rgb_t(2,4,2));
+ palette.set_pen_color(0, rgb_t(36,72,36));
+ palette.set_pen_color(1, rgb_t(2,4,2));
}
UINT32 screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect)
@@ -782,7 +782,7 @@ static MACHINE_CONFIG_START(clcd, clcd_state)
MCFG_SCREEN_VISIBLE_AREA(0, 480-1, 0, 128-1)
MCFG_DEFAULT_LAYOUT(layout_lcd)
- MCFG_PALETTE_LENGTH(2)
+ MCFG_PALETTE_ADD("palette", 2)
// sound hardware
MCFG_SPEAKER_STANDARD_MONO("mono")
diff --git a/src/mess/drivers/compucolor.c b/src/mess/drivers/compucolor.c
index 4c89bfa05a5..e554a13bfc3 100644
--- a/src/mess/drivers/compucolor.c
+++ b/src/mess/drivers/compucolor.c
@@ -92,7 +92,7 @@ public:
virtual void machine_start();
virtual void machine_reset();
- virtual void palette_init();
+ DECLARE_PALETTE_INIT(compucolor2);
UINT32 screen_update(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect);
@@ -442,7 +442,7 @@ void compucolor2_state::machine_reset()
m_rs232->write_dtr(1);
}
-void compucolor2_state::palette_init()
+PALETTE_INIT_MEMBER(compucolor2_state, compucolor2)
{
for (int i = 0; i < 8; i++)
{
@@ -456,6 +456,9 @@ static MACHINE_CONFIG_START( compucolor2, compucolor2_state )
MCFG_CPU_PROGRAM_MAP(compucolor2_mem)
MCFG_CPU_IO_MAP(compucolor2_io)
+ MCFG_PALETTE_ADD("palette", 8)
+ MCFG_PALETTE_INIT_OWNER(compucolor2_state, compucolor2)
+
// video hardware
MCFG_SCREEN_ADD("screen", RASTER)
MCFG_SCREEN_REFRESH_RATE(60)
diff --git a/src/mess/drivers/comquest.c b/src/mess/drivers/comquest.c
index 0d12cdfc0c2..e57291e4c8a 100644
--- a/src/mess/drivers/comquest.c
+++ b/src/mess/drivers/comquest.c
@@ -254,9 +254,8 @@ static MACHINE_CONFIG_START( comquest, comquest_state )
MCFG_SCREEN_VISIBLE_AREA(0, 64*4-1, 0, 128-1)
MCFG_SCREEN_UPDATE_DRIVER(comquest_state, screen_update_comquest)
- MCFG_GFXDECODE_ADD("gfxdecode", comquest )
- MCFG_PALETTE_LENGTH(2)
- MCFG_PALETTE_INIT_OVERRIDE(driver_device, black_and_white)
+ MCFG_GFXDECODE_ADD("gfxdecode", comquest )
+ MCFG_PALETTE_ADD_BLACK_AND_WHITE("palette")
/* sound hardware */
diff --git a/src/mess/drivers/concept.c b/src/mess/drivers/concept.c
index 576b1a0a03f..2e15cdfc2b7 100644
--- a/src/mess/drivers/concept.c
+++ b/src/mess/drivers/concept.c
@@ -221,8 +221,7 @@ static MACHINE_CONFIG_START( concept, concept_state )
MCFG_SCREEN_VISIBLE_AREA(0, 720-1, 0, 560-1)
MCFG_SCREEN_UPDATE_DRIVER(concept_state, screen_update_concept)
- MCFG_PALETTE_LENGTH(2)
- MCFG_PALETTE_INIT_OVERRIDE(driver_device, black_and_white)
+ MCFG_PALETTE_ADD_BLACK_AND_WHITE("palette")
/* no sound? */
diff --git a/src/mess/drivers/craft.c b/src/mess/drivers/craft.c
index 59111ffceb9..5bddd6cc8cf 100644
--- a/src/mess/drivers/craft.c
+++ b/src/mess/drivers/craft.c
@@ -255,7 +255,7 @@ static MACHINE_CONFIG_START( craft, craft_state )
MCFG_SCREEN_SIZE(635, 525)
MCFG_SCREEN_VISIBLE_AREA(47, 526, 36, 515)
MCFG_SCREEN_UPDATE_DRIVER(craft_state, screen_update_craft)
- MCFG_PALETTE_LENGTH(0x1000)
+ MCFG_PALETTE_ADD("palette", 0x1000)
/* sound hardware */
MCFG_SPEAKER_STANDARD_MONO("avr8")
diff --git a/src/mess/drivers/ct486.c b/src/mess/drivers/ct486.c
index e5441149387..6d78b01b19a 100644
--- a/src/mess/drivers/ct486.c
+++ b/src/mess/drivers/ct486.c
@@ -185,7 +185,7 @@ static MACHINE_CONFIG_START( ct486, ct486_state )
MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.50)
// video hardware
- MCFG_PALETTE_LENGTH(256) // todo: really needed?
+ MCFG_PALETTE_ADD("palette", 256) // todo: really needed?
MACHINE_CONFIG_END
diff --git a/src/mess/drivers/cxhumax.c b/src/mess/drivers/cxhumax.c
index 63bbad9847d..13852bc7c2b 100644
--- a/src/mess/drivers/cxhumax.c
+++ b/src/mess/drivers/cxhumax.c
@@ -1070,8 +1070,7 @@ static MACHINE_CONFIG_START( cxhumax, cxhumax_state )
MCFG_SCREEN_VISIBLE_AREA(0, 1920-1, 0, 1080-1)
MCFG_SCREEN_UPDATE_DRIVER(cxhumax_state, screen_update_cxhumax)
- MCFG_PALETTE_LENGTH(2)
- MCFG_PALETTE_INIT_OVERRIDE(driver_device, black_and_white)
+ MCFG_PALETTE_ADD_BLACK_AND_WHITE("palette")
MCFG_GENERIC_TERMINAL_ADD(TERMINAL_TAG, terminal_intf)
diff --git a/src/mess/drivers/cybiko.c b/src/mess/drivers/cybiko.c
index 17844d56355..b7483644c65 100644
--- a/src/mess/drivers/cybiko.c
+++ b/src/mess/drivers/cybiko.c
@@ -281,22 +281,6 @@ static INPUT_PORTS_START( cybikoxt )
INPUT_PORTS_END
////////////////////
-// PALETTE INIT //
-////////////////////
-
-void cybiko_state::palette_init()
-{
- // init palette
- for (int i = 0; i < 4; i++)
- {
- palette_set_color(machine(), i, rgb_t::white);
-#ifndef HD66421_BRIGHTNESS_DOES_NOT_WORK
- palette_set_pen_contrast(machine(), i, 1.0 * i / (4 - 1));
-#endif
- }
-}
-
-////////////////////
// MACHINE DRIVER //
////////////////////
@@ -311,10 +295,9 @@ static MACHINE_CONFIG_START( cybikov1, cybiko_state )
MCFG_SCREEN_SIZE( HD66421_WIDTH, HD66421_HEIGHT )
MCFG_SCREEN_VISIBLE_AREA( 0, HD66421_WIDTH - 1, 0, HD66421_HEIGHT - 1 )
MCFG_SCREEN_UPDATE_DEVICE("hd66421", hd66421_device, update_screen)
-
+ MCFG_SCREEN_PALETTE("hd66421:palette")
// video
MCFG_HD66421_ADD("hd66421")
- MCFG_PALETTE_LENGTH(4)
MCFG_DEFAULT_LAYOUT(layout_lcd)
// sound
MCFG_SPEAKER_STANDARD_MONO("mono")
diff --git a/src/mess/drivers/d6800.c b/src/mess/drivers/d6800.c
index cfc69bf562b..aa201dd7128 100644
--- a/src/mess/drivers/d6800.c
+++ b/src/mess/drivers/d6800.c
@@ -401,8 +401,7 @@ static MACHINE_CONFIG_START( d6800, d6800_state )
MCFG_SCREEN_VISIBLE_AREA(0, 63, 0, 31)
MCFG_SCREEN_UPDATE_DRIVER(d6800_state, screen_update_d6800)
MCFG_SCREEN_VBLANK_TIME(ATTOSECONDS_IN_USEC(25))
- MCFG_PALETTE_LENGTH(2)
- MCFG_PALETTE_INIT_OVERRIDE(driver_device, black_and_white)
+ MCFG_PALETTE_ADD_BLACK_AND_WHITE("palette")
/* sound hardware */
MCFG_SPEAKER_STANDARD_MONO("mono")
diff --git a/src/mess/drivers/dai.c b/src/mess/drivers/dai.c
index 338e7efc9b8..1ddb2b86c6c 100644
--- a/src/mess/drivers/dai.c
+++ b/src/mess/drivers/dai.c
@@ -221,7 +221,8 @@ static MACHINE_CONFIG_START( dai, dai_state )
MCFG_SCREEN_UPDATE_DRIVER(dai_state, screen_update_dai)
MCFG_GFXDECODE_ADD("gfxdecode", dai)
- MCFG_PALETTE_LENGTH(sizeof (dai_palette) / 3)
+ MCFG_PALETTE_ADD("palette", sizeof (dai_palette) / 3)
+ MCFG_PALETTE_INIT_OWNER(dai_state, dai)
/* sound hardware */
diff --git a/src/mess/drivers/dccons.c b/src/mess/drivers/dccons.c
index b9bc51292e6..e2673fb4e12 100644
--- a/src/mess/drivers/dccons.c
+++ b/src/mess/drivers/dccons.c
@@ -637,7 +637,7 @@ static MACHINE_CONFIG_START( dc, dc_cons_state )
MCFG_SCREEN_ADD("screen", RASTER)
MCFG_SCREEN_RAW_PARAMS(13458568*2, 857, 0, 640, 524, 0, 480) /* TODO: where pclk actually comes? */
MCFG_SCREEN_UPDATE_DEVICE("powervr2", powervr2_device, screen_update)
- MCFG_PALETTE_LENGTH(0x1000)
+ MCFG_PALETTE_ADD("palette", 0x1000)
MCFG_POWERVR2_ADD("powervr2", WRITE8(dc_state, pvr_irq))
MCFG_SPEAKER_STANDARD_STEREO("lspeaker", "rspeaker")
diff --git a/src/mess/drivers/dct11em.c b/src/mess/drivers/dct11em.c
index 235a2f3e52e..8da94a6ab21 100644
--- a/src/mess/drivers/dct11em.c
+++ b/src/mess/drivers/dct11em.c
@@ -61,8 +61,7 @@ static MACHINE_CONFIG_START( dct11em, dct11em_state )
MCFG_SCREEN_SIZE(640, 480)
MCFG_SCREEN_VISIBLE_AREA(0, 640-1, 0, 480-1)
MCFG_SCREEN_UPDATE_DRIVER(dct11em_state, screen_update_dct11em)
- MCFG_PALETTE_LENGTH(2)
- MCFG_PALETTE_INIT_OVERRIDE(driver_device, black_and_white)
+ MCFG_PALETTE_ADD_BLACK_AND_WHITE("palette")
MACHINE_CONFIG_END
/* ROM definition */
diff --git a/src/mess/drivers/dgn_beta.c b/src/mess/drivers/dgn_beta.c
index 48edd4d9e39..fa2295634b9 100644
--- a/src/mess/drivers/dgn_beta.c
+++ b/src/mess/drivers/dgn_beta.c
@@ -277,12 +277,12 @@ static INPUT_PORTS_START( dgnbeta )
INPUT_PORTS_END
-void dgn_beta_state::palette_init()
+PALETTE_INIT_MEMBER(dgn_beta_state, dgn)
{
int i;
for ( i = 0; i < sizeof(dgnbeta_palette) / 3; i++ ) {
- palette_set_color_rgb(machine(), i, dgnbeta_palette[i*3], dgnbeta_palette[i*3+1], dgnbeta_palette[i*3+2]);
+ palette.set_pen_color(i, dgnbeta_palette[i*3], dgnbeta_palette[i*3+1], dgnbeta_palette[i*3+2]);
}
}
@@ -337,7 +337,8 @@ static MACHINE_CONFIG_START( dgnbeta, dgn_beta_state )
MCFG_SCREEN_UPDATE_DEVICE( "crtc", hd6845_device, screen_update )
MCFG_GFXDECODE_ADD("gfxdecode", dgnbeta)
- MCFG_PALETTE_LENGTH(ARRAY_LENGTH(dgnbeta_palette) / 3)
+ MCFG_PALETTE_ADD("palette", ARRAY_LENGTH(dgnbeta_palette) / 3)
+ MCFG_PALETTE_INIT_OWNER(dgn_beta_state, dgn)
MCFG_VIDEO_ATTRIBUTES(VIDEO_UPDATE_AFTER_VBLANK)
/* PIA 0 at $FC20-$FC23 I46 */
diff --git a/src/mess/drivers/dim68k.c b/src/mess/drivers/dim68k.c
index 5d83e3d38bd..9a9be08ac49 100644
--- a/src/mess/drivers/dim68k.c
+++ b/src/mess/drivers/dim68k.c
@@ -333,8 +333,7 @@ static MACHINE_CONFIG_START( dim68k, dim68k_state )
MCFG_SCREEN_UPDATE_DEVICE("crtc", mc6845_device, screen_update)
MCFG_SCREEN_SIZE(640, 480)
MCFG_SCREEN_VISIBLE_AREA(0, 640-1, 0, 250-1)
- MCFG_PALETTE_LENGTH(2)
- MCFG_PALETTE_INIT_OVERRIDE(driver_device, black_and_white)
+ MCFG_PALETTE_ADD_BLACK_AND_WHITE("palette")
MCFG_GFXDECODE_ADD("gfxdecode", dim68k)
/* sound hardware */
diff --git a/src/mess/drivers/dm7000.c b/src/mess/drivers/dm7000.c
index 64072937dc2..ddf8d66c083 100644
--- a/src/mess/drivers/dm7000.c
+++ b/src/mess/drivers/dm7000.c
@@ -324,8 +324,7 @@ static MACHINE_CONFIG_START( dm7000, dm7000_state )
MCFG_SCREEN_VISIBLE_AREA(0, 640-1, 0, 480-1)
MCFG_SCREEN_UPDATE_DRIVER(dm7000_state, screen_update_dm7000)
- MCFG_PALETTE_LENGTH(2)
- MCFG_PALETTE_INIT_OVERRIDE(driver_device, black_and_white)
+ MCFG_PALETTE_ADD_BLACK_AND_WHITE("palette")
MCFG_GENERIC_TERMINAL_ADD(TERMINAL_TAG, terminal_intf)
diff --git a/src/mess/drivers/dms5000.c b/src/mess/drivers/dms5000.c
index 928ab01776e..d4e13922a3c 100644
--- a/src/mess/drivers/dms5000.c
+++ b/src/mess/drivers/dms5000.c
@@ -66,8 +66,7 @@ static MACHINE_CONFIG_START( dms5000, dms5000_state )
MCFG_SCREEN_SIZE(640, 480)
MCFG_SCREEN_VISIBLE_AREA(0, 640-1, 0, 480-1)
MCFG_SCREEN_UPDATE_DRIVER(dms5000_state, screen_update_dms5000)
- MCFG_PALETTE_LENGTH(2)
- MCFG_PALETTE_INIT_OVERRIDE(driver_device, black_and_white)
+ MCFG_PALETTE_ADD_BLACK_AND_WHITE("palette")
MACHINE_CONFIG_END
/* ROM definition */
diff --git a/src/mess/drivers/dmv.c b/src/mess/drivers/dmv.c
index 7d42154522b..c15f1caa286 100644
--- a/src/mess/drivers/dmv.c
+++ b/src/mess/drivers/dmv.c
@@ -332,8 +332,7 @@ static MACHINE_CONFIG_START( dmv, dmv_state )
MCFG_SCREEN_VISIBLE_AREA(0, 640-1, 0, 480-1)
MCFG_GFXDECODE_ADD("gfxdecode", dmv)
- MCFG_PALETTE_LENGTH(2)
- MCFG_PALETTE_INIT_OVERRIDE(driver_device, black_and_white)
+ MCFG_PALETTE_ADD_BLACK_AND_WHITE("palette")
MCFG_DEFAULT_LAYOUT(layout_dmv)
// devices
diff --git a/src/mess/drivers/ec65.c b/src/mess/drivers/ec65.c
index 84a2b4b5241..d9803fba140 100644
--- a/src/mess/drivers/ec65.c
+++ b/src/mess/drivers/ec65.c
@@ -202,8 +202,7 @@ static MACHINE_CONFIG_START( ec65, ec65_state )
MCFG_SCREEN_UPDATE_DEVICE(MC6845_TAG, mc6845_device, screen_update)
MCFG_GFXDECODE_ADD("gfxdecode", ec65)
- MCFG_PALETTE_LENGTH(2)
- MCFG_PALETTE_INIT_OVERRIDE(driver_device, black_and_white)
+ MCFG_PALETTE_ADD_BLACK_AND_WHITE("palette")
MCFG_MC6845_ADD(MC6845_TAG, MC6845, "screen", XTAL_16MHz / 8, ec65_crtc6845_interface)
@@ -237,8 +236,7 @@ static MACHINE_CONFIG_START( ec65k, ec65k_state )
MCFG_SCREEN_UPDATE_DEVICE(MC6845_TAG, mc6845_device, screen_update)
MCFG_GFXDECODE_ADD("gfxdecode", ec65)
- MCFG_PALETTE_LENGTH(2)
- MCFG_PALETTE_INIT_OVERRIDE(driver_device, black_and_white)
+ MCFG_PALETTE_ADD_BLACK_AND_WHITE("palette")
MCFG_MC6845_ADD(MC6845_TAG, MC6845, "screen", XTAL_16MHz / 8, ec65_crtc6845_interface)
diff --git a/src/mess/drivers/einstein.c b/src/mess/drivers/einstein.c
index 4ae807aac1a..b3d283bc9b5 100644
--- a/src/mess/drivers/einstein.c
+++ b/src/mess/drivers/einstein.c
@@ -445,8 +445,8 @@ MACHINE_RESET_MEMBER(einstein_state,einstein2)
einstein_state::machine_reset();
/* 80 column card palette */
- palette_set_color(machine(), TMS9928A_PALETTE_SIZE, rgb_t::black);
- palette_set_color(machine(), TMS9928A_PALETTE_SIZE + 1, rgb_t(0, 224, 0));
+ m_palette->set_pen_color(TMS9928A_PALETTE_SIZE, rgb_t::black);
+ m_palette->set_pen_color(TMS9928A_PALETTE_SIZE + 1, rgb_t(0, 224, 0));
}
MACHINE_START_MEMBER(einstein_state,einstein2)
@@ -823,7 +823,7 @@ static MACHINE_CONFIG_DERIVED( einstei2, einstein )
MCFG_GFXDECODE_ADD("gfxdecode", einstei2)
/* 2 additional colors for the 80 column screen */
- MCFG_PALETTE_LENGTH(TMS9928A_PALETTE_SIZE + 2)
+ MCFG_PALETTE_ADD("palette", TMS9928A_PALETTE_SIZE + 2)
MCFG_MC6845_ADD("crtc", MC6845, "80column", XTAL_X002 / 4, einstein_crtc6845_interface)
MACHINE_CONFIG_END
diff --git a/src/mess/drivers/electron.c b/src/mess/drivers/electron.c
index 8f8ee523237..a0884842ede 100644
--- a/src/mess/drivers/electron.c
+++ b/src/mess/drivers/electron.c
@@ -44,9 +44,9 @@ static const rgb_t electron_palette[8]=
rgb_t(0x000,0x000,0x000)
};
-void electron_state::palette_init()
+PALETTE_INIT_MEMBER(electron_state, electron)
{
- palette_set_colors(machine(), 0, electron_palette, ARRAY_LENGTH(electron_palette));
+ palette.set_pen_colors(0, electron_palette, ARRAY_LENGTH(electron_palette));
}
static ADDRESS_MAP_START(electron_mem, AS_PROGRAM, 8, electron_state )
@@ -190,7 +190,8 @@ static MACHINE_CONFIG_START( electron, electron_state )
MCFG_SCREEN_VISIBLE_AREA( 0, 640-1, 0, 256-1 )
MCFG_SCREEN_UPDATE_DRIVER(electron_state, screen_update_electron)
- MCFG_PALETTE_LENGTH( 16 )
+ MCFG_PALETTE_ADD( "palette", 16 )
+ MCFG_PALETTE_INIT_OWNER(electron_state, electron)
MCFG_VIDEO_ATTRIBUTES(VIDEO_UPDATE_SCANLINE)
diff --git a/src/mess/drivers/elwro800.c b/src/mess/drivers/elwro800.c
index 1cb8170a40c..96dd15fb39d 100644
--- a/src/mess/drivers/elwro800.c
+++ b/src/mess/drivers/elwro800.c
@@ -575,8 +575,8 @@ static MACHINE_CONFIG_START( elwro800, elwro800_state )
MCFG_SCREEN_UPDATE_DRIVER(elwro800_state, screen_update_spectrum )
MCFG_SCREEN_VBLANK_DRIVER(elwro800_state, screen_eof_spectrum)
- MCFG_PALETTE_LENGTH(16)
- MCFG_PALETTE_INIT_OVERRIDE(elwro800_state, spectrum )
+ MCFG_PALETTE_ADD("palette", 16)
+ MCFG_PALETTE_INIT_OWNER(elwro800_state, spectrum )
MCFG_GFXDECODE_ADD("gfxdecode", elwro800)
MCFG_VIDEO_START_OVERRIDE(elwro800_state, spectrum )
diff --git a/src/mess/drivers/exelv.c b/src/mess/drivers/exelv.c
index 565e7dad8a2..d4f553c923b 100644
--- a/src/mess/drivers/exelv.c
+++ b/src/mess/drivers/exelv.c
@@ -103,7 +103,7 @@ public:
/* mailbox data */
UINT8 m_wx318; /* data of 74ls374 labeled wx318 */
UINT8 m_wx319; /* data of 74sl374 labeled wx319 */
- virtual void palette_init();
+ DECLARE_PALETTE_INIT(exelv);
TIMER_DEVICE_CALLBACK_MEMBER(exelv_hblank_interrupt);
};
@@ -474,7 +474,7 @@ static INPUT_PORTS_START(exelv)
INPUT_PORTS_END
-void exelv_state::palette_init()
+PALETTE_INIT_MEMBER(exelv_state, exelv)
{
int i, red, green, blue;
@@ -484,7 +484,7 @@ void exelv_state::palette_init()
red = (i & 1) ? 255 : 0; /* red */
green = (i & 2) ? 255 : 0; /* green */
blue = (i & 4) ? 255 : 0; /* blue */
- palette_set_color_rgb(machine(), i, red, green, blue);
+ palette.set_pen_color(i, red, green, blue);
}
}
@@ -535,11 +535,12 @@ static MACHINE_CONFIG_START( exl100, exelv_state )
MCFG_SCREEN_SIZE(TMS3556_TOTAL_WIDTH, TMS3556_TOTAL_HEIGHT*2)
MCFG_SCREEN_VISIBLE_AREA(0, TMS3556_TOTAL_WIDTH-1, 0, TMS3556_TOTAL_HEIGHT*2-1)
#endif
- MCFG_PALETTE_LENGTH(8)
-
MCFG_SCREEN_REFRESH_RATE(50)
MCFG_SCREEN_VBLANK_TIME(ATTOSECONDS_IN_USEC(2500)) /* not accurate */
+ MCFG_PALETTE_ADD("palette", 8)
+ MCFG_PALETTE_INIT_OWNER(exelv_state, exelv)
+
MCFG_DEVICE_ADD("vsm", SPEECHROM, 0)
/* sound */
@@ -577,11 +578,12 @@ static MACHINE_CONFIG_START( exeltel, exelv_state )
MCFG_SCREEN_SIZE(TMS3556_TOTAL_WIDTH, TMS3556_TOTAL_HEIGHT*2)
MCFG_SCREEN_VISIBLE_AREA(0, TMS3556_TOTAL_WIDTH-1, 0, TMS3556_TOTAL_HEIGHT*2-1)
#endif
- MCFG_PALETTE_LENGTH(8)
-
MCFG_SCREEN_REFRESH_RATE(50)
MCFG_SCREEN_VBLANK_TIME(ATTOSECONDS_IN_USEC(2500)) /* not accurate */
+ MCFG_PALETTE_ADD("palette", 8)
+ MCFG_PALETTE_INIT_OWNER(exelv_state, exelv)
+
MCFG_DEVICE_ADD("vsm", SPEECHROM, 0)
/* sound */
diff --git a/src/mess/drivers/fk1.c b/src/mess/drivers/fk1.c
index d09ae273d18..84f9b6aa398 100644
--- a/src/mess/drivers/fk1.c
+++ b/src/mess/drivers/fk1.c
@@ -446,8 +446,7 @@ static MACHINE_CONFIG_START( fk1, fk1_state )
MCFG_SCREEN_UPDATE_DRIVER(fk1_state, screen_update)
MCFG_SCREEN_SIZE(512, 256)
MCFG_SCREEN_VISIBLE_AREA(0, 512-1, 0, 256-1)
- MCFG_PALETTE_LENGTH(2)
- MCFG_PALETTE_INIT_OVERRIDE(driver_device, monochrome_green)
+ MCFG_PALETTE_ADD_MONOCHROME_GREEN("palette")
MCFG_DEVICE_ADD("pit8253", PIT8253, 0)
MCFG_PIT8253_CLK0(50)
diff --git a/src/mess/drivers/fm7.c b/src/mess/drivers/fm7.c
index 6a40b688f97..efbdbd5a880 100644
--- a/src/mess/drivers/fm7.c
+++ b/src/mess/drivers/fm7.c
@@ -2049,8 +2049,8 @@ static MACHINE_CONFIG_START( fm7, fm7_state )
MCFG_SCREEN_VISIBLE_AREA(0, 640-1, 0, 200-1)
MCFG_SCREEN_UPDATE_DRIVER(fm7_state, screen_update_fm7)
- MCFG_PALETTE_LENGTH(8)
-
+ MCFG_PALETTE_ADD("palette", 8)
+ MCFG_PALETTE_INIT_OWNER(fm7_state, fm7)
MCFG_CASSETTE_ADD("cassette", fm7_cassette_interface)
@@ -2098,8 +2098,8 @@ static MACHINE_CONFIG_START( fm8, fm7_state )
MCFG_SCREEN_VISIBLE_AREA(0, 640-1, 0, 200-1)
MCFG_SCREEN_UPDATE_DRIVER(fm7_state, screen_update_fm7)
- MCFG_PALETTE_LENGTH(8)
-
+ MCFG_PALETTE_ADD("palette", 8)
+ MCFG_PALETTE_INIT_OWNER(fm7_state, fm7)
MCFG_CASSETTE_ADD("cassette", fm7_cassette_interface)
@@ -2147,8 +2147,8 @@ static MACHINE_CONFIG_START( fm77av, fm7_state )
MCFG_SCREEN_VISIBLE_AREA(0, 640-1, 0, 200-1)
MCFG_SCREEN_UPDATE_DRIVER(fm7_state, screen_update_fm7)
- MCFG_PALETTE_LENGTH(8 + 4096)
-
+ MCFG_PALETTE_ADD("palette", 8 + 4096)
+ MCFG_PALETTE_INIT_OWNER(fm7_state, fm7)
MCFG_CASSETTE_ADD("cassette", fm7_cassette_interface)
@@ -2200,8 +2200,8 @@ static MACHINE_CONFIG_START( fm11, fm7_state )
MCFG_SCREEN_VISIBLE_AREA(0, 640-1, 0, 200-1)
MCFG_SCREEN_UPDATE_DRIVER(fm7_state, screen_update_fm7)
- MCFG_PALETTE_LENGTH(8)
-
+ MCFG_PALETTE_ADD("palette", 8)
+ MCFG_PALETTE_INIT_OWNER(fm7_state, fm7)
MCFG_CASSETTE_ADD("cassette", fm7_cassette_interface)
@@ -2247,8 +2247,8 @@ static MACHINE_CONFIG_START( fm16beta, fm7_state )
MCFG_SCREEN_VISIBLE_AREA(0, 640-1, 0, 200-1)
MCFG_SCREEN_UPDATE_DRIVER(fm7_state, screen_update_fm7)
- MCFG_PALETTE_LENGTH(8)
-
+ MCFG_PALETTE_ADD("palette", 8)
+ MCFG_PALETTE_INIT_OWNER(fm7_state, fm7)
MCFG_CASSETTE_ADD("cassette", fm7_cassette_interface)
diff --git a/src/mess/drivers/fp1100.c b/src/mess/drivers/fp1100.c
index e56008faaac..7e04b3489c2 100644
--- a/src/mess/drivers/fp1100.c
+++ b/src/mess/drivers/fp1100.c
@@ -360,7 +360,7 @@ static MACHINE_CONFIG_START( fp1100, fp1100_state )
MCFG_SCREEN_SIZE(640, 480)
MCFG_SCREEN_VISIBLE_AREA(0, 640-1, 0, 480-1)
MCFG_SCREEN_UPDATE_DEVICE("crtc", h46505_device, screen_update)
- MCFG_PALETTE_LENGTH(8)
+ MCFG_PALETTE_ADD("palette", 8)
MCFG_GFXDECODE_ADD("gfxdecode", fp1100)
/* Devices */
diff --git a/src/mess/drivers/fp200.c b/src/mess/drivers/fp200.c
index 0862db8b5e1..b4ac4f97aab 100644
--- a/src/mess/drivers/fp200.c
+++ b/src/mess/drivers/fp200.c
@@ -65,13 +65,13 @@ public:
DECLARE_WRITE_LINE_MEMBER(sod_w);
DECLARE_READ_LINE_MEMBER(sid_r);
+ DECLARE_PALETTE_INIT(fp200);
protected:
// driver_device overrides
virtual void machine_start();
virtual void machine_reset();
virtual void video_start();
- virtual void palette_init();
};
void fp200_state::video_start()
@@ -561,10 +561,10 @@ void fp200_state::machine_reset()
}
-void fp200_state::palette_init()
+PALETTE_INIT_MEMBER(fp200_state, fp200)
{
- palette_set_color_rgb(machine(), 0, 0xa0, 0xa8, 0xa0);
- palette_set_color_rgb(machine(), 1, 0x30, 0x38, 0x10);
+ palette.set_pen_color(0, 0xa0, 0xa8, 0xa0);
+ palette.set_pen_color(1, 0x30, 0x38, 0x10);
}
WRITE_LINE_MEMBER( fp200_state::sod_w )
@@ -596,7 +596,8 @@ static MACHINE_CONFIG_START( fp200, fp200_state )
MCFG_GFXDECODE_ADD("gfxdecode", fp200)
- MCFG_PALETTE_LENGTH(2)
+ MCFG_PALETTE_ADD("palette", 2)
+ MCFG_PALETTE_INIT_OWNER(fp200_state, fp200)
/* sound hardware */
MCFG_SPEAKER_STANDARD_MONO("mono")
diff --git a/src/mess/drivers/fp6000.c b/src/mess/drivers/fp6000.c
index 22f96cb34f8..095c1e3d9e5 100644
--- a/src/mess/drivers/fp6000.c
+++ b/src/mess/drivers/fp6000.c
@@ -101,7 +101,7 @@ UINT32 fp6000_state::screen_update_fp6000(screen_device &screen, bitmap_ind16 &b
int dot = (m_gvram[count] >> (12-xi*4)) & 0xf;
if(y < 400 && x*4+xi < 640) /* TODO: safety check */
- bitmap.pix16(y, x*4+xi) = machine().pens[dot];
+ bitmap.pix16(y, x*4+xi) = m_palette->pen(dot);
}
count++;
@@ -124,7 +124,7 @@ UINT32 fp6000_state::screen_update_fp6000(screen_device &screen, bitmap_ind16 &b
if(pen != -1)
if(y*mc6845_tile_height < 400 && x*8+xi < 640) /* TODO: safety check */
- bitmap.pix16(y*mc6845_tile_height+yi, x*8+xi) = machine().pens[pen];
+ bitmap.pix16(y*mc6845_tile_height+yi, x*8+xi) = m_palette->pen(pen);
}
}
}
@@ -139,7 +139,7 @@ UINT32 fp6000_state::screen_update_fp6000(screen_device &screen, bitmap_ind16 &b
{
x = mc6845_cursor_addr % mc6845_h_display;
y = mc6845_cursor_addr / mc6845_h_display;
- bitmap.pix16(y*mc6845_tile_height+yi, x*8+xi) = machine().pens[7];
+ bitmap.pix16(y*mc6845_tile_height+yi, x*8+xi) = m_palette->pen(7);
}
}
}
@@ -318,8 +318,8 @@ static MACHINE_CONFIG_START( fp6000, fp6000_state )
MCFG_MC6845_ADD("crtc", H46505, "screen", 16000000/5, mc6845_intf) /* unknown clock, hand tuned to get ~60 fps */
- MCFG_PALETTE_LENGTH(8)
-// MCFG_PALETTE_INIT_OVERRIDE(driver_device, black_and_white)
+ MCFG_PALETTE_ADD("palette", 8)
+// MCFG_PALETTE_INIT(black_and_white)
MCFG_GFXDECODE_ADD("gfxdecode", fp6000)
MACHINE_CONFIG_END
diff --git a/src/mess/drivers/galaxy.c b/src/mess/drivers/galaxy.c
index 2da489c4f45..fe0b506baf3 100644
--- a/src/mess/drivers/galaxy.c
+++ b/src/mess/drivers/galaxy.c
@@ -199,8 +199,7 @@ static MACHINE_CONFIG_START( galaxy, galaxy_state )
MCFG_SCREEN_UPDATE_DRIVER(galaxy_state, screen_update_galaxy)
MCFG_GFXDECODE_ADD("gfxdecode", galaxy)
- MCFG_PALETTE_LENGTH(2)
- MCFG_PALETTE_INIT_OVERRIDE(driver_device, black_and_white)
+ MCFG_PALETTE_ADD_BLACK_AND_WHITE("palette")
/* snapshot */
@@ -235,8 +234,7 @@ static MACHINE_CONFIG_START( galaxyp, galaxy_state )
MCFG_SCREEN_VISIBLE_AREA(0, 384-1, 0, 208-1)
MCFG_SCREEN_UPDATE_DRIVER(galaxy_state, screen_update_galaxy)
- MCFG_PALETTE_LENGTH(2)
- MCFG_PALETTE_INIT_OVERRIDE(driver_device, black_and_white)
+ MCFG_PALETTE_ADD_BLACK_AND_WHITE("palette")
/* snapshot */
diff --git a/src/mess/drivers/galeb.c b/src/mess/drivers/galeb.c
index 5bf38fb623c..a55917cc292 100644
--- a/src/mess/drivers/galeb.c
+++ b/src/mess/drivers/galeb.c
@@ -138,10 +138,9 @@ static MACHINE_CONFIG_START( galeb, galeb_state )
MCFG_SCREEN_VISIBLE_AREA(0, 48*8-1, 0, 16*8-1)
MCFG_SCREEN_UPDATE_DRIVER(galeb_state, screen_update_galeb)
- MCFG_GFXDECODE_ADD("gfxdecode", galeb )
+ MCFG_GFXDECODE_ADD("gfxdecode", galeb )
- MCFG_PALETTE_LENGTH(2)
- MCFG_PALETTE_INIT_OVERRIDE(driver_device, black_and_white)
+ MCFG_PALETTE_ADD_BLACK_AND_WHITE("palette")
/* audio hardware */
diff --git a/src/mess/drivers/gamecom.c b/src/mess/drivers/gamecom.c
index d59a131c0fd..b9b723ae6f0 100644
--- a/src/mess/drivers/gamecom.c
+++ b/src/mess/drivers/gamecom.c
@@ -62,7 +62,7 @@ static INPUT_PORTS_START( gamecom )
PORT_BIT( 0xff, 80, IPT_LIGHTGUN_Y ) PORT_CROSSHAIR(Y, 1, 0, 0) PORT_MINMAX(0,159) PORT_SENSITIVITY(50) PORT_KEYDELTA(8)
INPUT_PORTS_END
-static const unsigned char palette[] =
+static const unsigned char palette_gamecom[] =
{
0xDF, 0xFF, 0x8F, /* White */
0x8F, 0xCF, 0x8F, /* Gray 3 */
@@ -71,12 +71,12 @@ static const unsigned char palette[] =
0x00, 0x00, 0x00, /* Black */
};
-void gamecom_state::palette_init()
+PALETTE_INIT_MEMBER(gamecom_state, gamecom)
{
int index;
for ( index = 0; index < 5; index++ )
{
- palette_set_color_rgb(machine(), 4-index, palette[index*3+0], palette[index*3+1], palette[index*3+2] );
+ palette.set_pen_color(4-index, palette_gamecom[index*3+0], palette_gamecom[index*3+1], palette_gamecom[index*3+2] );
}
}
@@ -114,7 +114,8 @@ static MACHINE_CONFIG_START( gamecom, gamecom_state )
MCFG_SCREEN_VISIBLE_AREA( 0, 199, 0, 159 )
MCFG_DEFAULT_LAYOUT(layout_lcd)
- MCFG_PALETTE_LENGTH(5)
+ MCFG_PALETTE_ADD("palette", 5)
+ MCFG_PALETTE_INIT_OWNER(gamecom_state, gamecom)
/* sound hardware */
MCFG_SPEAKER_STANDARD_STEREO( "lspeaker", "rspeaker" )
diff --git a/src/mess/drivers/gamepock.c b/src/mess/drivers/gamepock.c
index bc46104ba99..1674ba44de7 100644
--- a/src/mess/drivers/gamepock.c
+++ b/src/mess/drivers/gamepock.c
@@ -76,8 +76,7 @@ static MACHINE_CONFIG_START( gamepock, gamepock_state )
MCFG_DEFAULT_LAYOUT(layout_lcd)
- MCFG_PALETTE_LENGTH( 2 )
- MCFG_PALETTE_INIT_OVERRIDE(driver_device, black_and_white)
+ MCFG_PALETTE_ADD_BLACK_AND_WHITE("palette")
/* sound hardware */
MCFG_SPEAKER_STANDARD_MONO("mono")
diff --git a/src/mess/drivers/gb.c b/src/mess/drivers/gb.c
index d6103681379..fede93f4132 100644
--- a/src/mess/drivers/gb.c
+++ b/src/mess/drivers/gb.c
@@ -667,7 +667,7 @@ SLOT_INTERFACE_END
-static const unsigned char palette[] =
+static const unsigned char palette_gb[] =
{
/* Simple black and white palette */
/* 0xFF,0xFF,0xFF,
@@ -696,13 +696,13 @@ static const unsigned char palette_megaduck[] = {
PALETTE_INIT_MEMBER(gb_state, gb)
{
for (int i = 0; i < 4; i++)
- palette_set_color_rgb(machine(), i, palette[i * 3 + 0], palette[i * 3 + 1], palette[i * 3 + 2]);
+ palette.set_pen_color(i, palette_gb[i * 3 + 0], palette_gb[i * 3 + 1], palette_gb[i * 3 + 2]);
}
PALETTE_INIT_MEMBER(gb_state, gbp)
{
for (int i = 0; i < 4; i++)
- palette_set_color_rgb(machine(), i, palette[(i + 4) * 3 + 0], palette[(i + 4) * 3 + 1], palette[(i + 4) * 3 + 2]);
+ palette.set_pen_color(i, palette_gb[(i + 4) * 3 + 0], palette_gb[(i + 4) * 3 + 1], palette_gb[(i + 4) * 3 + 2]);
}
PALETTE_INIT_MEMBER(gb_state, sgb)
@@ -714,7 +714,7 @@ PALETTE_INIT_MEMBER(gb_state, sgb)
r = (i & 0x1F) << 3;
g = ((i >> 5) & 0x1F) << 3;
b = ((i >> 10) & 0x1F) << 3;
- palette_set_color_rgb(machine(), i, r, g, b);
+ palette.set_pen_color(i, r, g, b);
}
}
@@ -727,14 +727,14 @@ PALETTE_INIT_MEMBER(gb_state, gbc)
r = (i & 0x1F) << 3;
g = ((i >> 5) & 0x1F) << 3;
b = ((i >> 10) & 0x1F) << 3;
- palette_set_color_rgb(machine(), i, r, g, b);
+ palette.set_pen_color(i, r, g, b);
}
}
PALETTE_INIT_MEMBER(megaduck_state, megaduck)
{
for (int i = 0; i < 4; i++)
- palette_set_color_rgb(machine(), i, palette_megaduck[i * 3 + 0], palette_megaduck[i * 3 + 1], palette_megaduck[i * 3 + 2]);
+ palette.set_pen_color(i, palette_megaduck[i * 3 + 0], palette_megaduck[i * 3 + 1], palette_megaduck[i * 3 + 2]);
}
@@ -761,8 +761,8 @@ static MACHINE_CONFIG_START( gameboy, gb_state )
MCFG_SCREEN_VISIBLE_AREA(0*8, 20*8-1, 0*8, 18*8-1)
MCFG_GFXDECODE_ADD("gfxdecode", gb)
- MCFG_PALETTE_LENGTH(4)
- MCFG_PALETTE_INIT_OVERRIDE(gb_state,gb)
+ MCFG_PALETTE_ADD("palette", 4)
+ MCFG_PALETTE_INIT_OWNER(gb_state,gb)
MCFG_GB_LCD_DMG_ADD( "lcd" )
@@ -795,8 +795,10 @@ static MACHINE_CONFIG_DERIVED( supergb, gameboy )
MCFG_SCREEN_MODIFY("screen")
MCFG_SCREEN_SIZE(32*8, 28*8)
MCFG_SCREEN_VISIBLE_AREA(0*8, 32*8-1, 0*8, 28*8-1)
- MCFG_PALETTE_LENGTH(32768)
- MCFG_PALETTE_INIT_OVERRIDE(gb_state,sgb)
+
+ MCFG_DEVICE_REMOVE("palette")
+ MCFG_PALETTE_ADD("palette", 32768)
+ MCFG_PALETTE_INIT_OWNER(gb_state,sgb)
MCFG_DEVICE_REMOVE("lcd")
MCFG_GB_LCD_SGB_ADD( "lcd" )
@@ -810,7 +812,9 @@ static MACHINE_CONFIG_DERIVED( gbpocket, gameboy )
MCFG_MACHINE_START_OVERRIDE(gb_state, gbpocket)
MCFG_MACHINE_RESET_OVERRIDE(gb_state, gbpocket)
- MCFG_PALETTE_INIT_OVERRIDE(gb_state,gbp)
+
+ MCFG_PALETTE_MODIFY("palette")
+ MCFG_PALETTE_INIT_OWNER(gb_state,gbp)
MCFG_DEVICE_REMOVE("lcd")
MCFG_GB_LCD_MGB_ADD( "lcd" )
@@ -824,8 +828,9 @@ static MACHINE_CONFIG_DERIVED( gbcolor, gameboy )
MCFG_MACHINE_START_OVERRIDE(gb_state,gbc)
MCFG_MACHINE_RESET_OVERRIDE(gb_state,gbc)
- MCFG_PALETTE_LENGTH(32768)
- MCFG_PALETTE_INIT_OVERRIDE(gb_state,gbc)
+ MCFG_DEVICE_REMOVE("palette")
+ MCFG_PALETTE_ADD("palette", 32768)
+ MCFG_PALETTE_INIT_OWNER(gb_state,gbc)
MCFG_DEVICE_REMOVE("lcd")
MCFG_GB_LCD_CGB_ADD( "lcd" )
@@ -863,8 +868,9 @@ static MACHINE_CONFIG_START( megaduck, megaduck_state )
MCFG_DEFAULT_LAYOUT(layout_lcd)
MCFG_GFXDECODE_ADD("gfxdecode", gb)
- MCFG_PALETTE_LENGTH(4)
- MCFG_PALETTE_INIT_OVERRIDE(megaduck_state,megaduck)
+
+ MCFG_PALETTE_ADD("palette", 4)
+ MCFG_PALETTE_INIT_OWNER(megaduck_state,megaduck)
MCFG_GB_LCD_DMG_ADD( "lcd" )
diff --git a/src/mess/drivers/gba.c b/src/mess/drivers/gba.c
index 3255528d980..3212939bbff 100644
--- a/src/mess/drivers/gba.c
+++ b/src/mess/drivers/gba.c
@@ -43,7 +43,7 @@ INLINE void ATTR_PRINTF(3,4) verboselog(running_machine &machine, int n_level, c
static const UINT32 timer_clks[4] = { 16777216, 16777216/64, 16777216/256, 16777216/1024 };
-void gba_state::palette_init()
+PALETTE_INIT_MEMBER(gba_state, gba)
{
UINT8 r, g, b;
for( b = 0; b < 32; b++ )
@@ -52,7 +52,7 @@ void gba_state::palette_init()
{
for( r = 0; r < 32; r++ )
{
- palette_set_color_rgb( machine(), ( b << 10 ) | ( g << 5 ) | r, pal5bit(r), pal5bit(g), pal5bit(b) );
+ palette.set_pen_color( ( b << 10 ) | ( g << 5 ) | r, pal5bit(r), pal5bit(g), pal5bit(b) );
}
}
}
@@ -2257,7 +2257,8 @@ static MACHINE_CONFIG_START( gbadv, gba_state )
MCFG_SCREEN_UPDATE_DRIVER(gba_state, screen_update)
MCFG_DEFAULT_LAYOUT(layout_lcd)
- MCFG_PALETTE_LENGTH(32768)
+ MCFG_PALETTE_ADD("palette", 32768)
+ MCFG_PALETTE_INIT_OWNER(gba_state, gba)
MCFG_SPEAKER_STANDARD_STEREO("spkleft", "spkright")
MCFG_SOUND_ADD("custom", GAMEBOY, 0)
diff --git a/src/mess/drivers/geniusiq.c b/src/mess/drivers/geniusiq.c
index 88e5efcb216..7d60282ea57 100644
--- a/src/mess/drivers/geniusiq.c
+++ b/src/mess/drivers/geniusiq.c
@@ -265,7 +265,7 @@ public:
virtual void machine_start();
virtual void machine_reset();
- virtual void palette_init();
+ DECLARE_PALETTE_INIT(geniusiq);
virtual UINT32 screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
DECLARE_READ16_MEMBER(input_r);
@@ -316,10 +316,10 @@ public:
virtual UINT32 screen_update(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect);
};
-void geniusiq_state::palette_init()
+PALETTE_INIT_MEMBER(geniusiq_state, geniusiq)
{
// shades need to be verified
- const UINT8 palette[] =
+ const UINT8 palette_val[] =
{
0x00, 0x00, 0x00, // Black?? (used in the cursor for transparency)
0xff, 0xff, 0xff, // White
@@ -339,8 +339,8 @@ void geniusiq_state::palette_init()
0xff, 0x00, 0xff // Pink
};
- for (int i=0; i<ARRAY_LENGTH(palette)/3; i++)
- palette_set_color_rgb(machine(), i, palette[i*3], palette[i*3+1], palette[i*3+2]);
+ for (int i=0; i<ARRAY_LENGTH(palette_val)/3; i++)
+ palette.set_pen_color(i, palette_val[i*3], palette_val[i*3+1], palette_val[i*3+2]);
}
UINT32 gl8008cx_state::screen_update(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect)
@@ -810,7 +810,8 @@ static MACHINE_CONFIG_START( iq128, geniusiq_state )
MCFG_SCREEN_SIZE(512, 256)
MCFG_SCREEN_VISIBLE_AREA(0, 512-1, 0, 256-1)
MCFG_SCREEN_UPDATE_DRIVER( geniusiq_state, screen_update )
- MCFG_PALETTE_LENGTH(16)
+ MCFG_PALETTE_ADD("palette", 16)
+ MCFG_PALETTE_INIT_OWNER(geniusiq_state, geniusiq)
/* internal flash */
MCFG_AMD_29F010_ADD("flash")
diff --git a/src/mess/drivers/gizmondo.c b/src/mess/drivers/gizmondo.c
index d91049458e7..b57975838e9 100644
--- a/src/mess/drivers/gizmondo.c
+++ b/src/mess/drivers/gizmondo.c
@@ -202,7 +202,7 @@ static MACHINE_CONFIG_START( gizmondo, gizmondo_state )
MCFG_CPU_ADD("maincpu", ARM9, 40000000)
MCFG_CPU_PROGRAM_MAP(gizmondo_map)
- MCFG_PALETTE_LENGTH(32768)
+ MCFG_PALETTE_ADD("palette", 32768)
MCFG_SCREEN_ADD("screen", LCD)
MCFG_SCREEN_REFRESH_RATE(60)
@@ -215,7 +215,7 @@ static MACHINE_CONFIG_START( gizmondo, gizmondo_state )
MCFG_GF4500_ADD("gf4500")
- MCFG_S3C2440_ADD("s3c2440", 12000000, gizmondo_s3c2440_intf)
+ MCFG_S3C2440_ADD("s3c2440", 12000000, gizmondo_s3c2440_intf, "palette")
MCFG_DISKONCHIP_G3_ADD("diskonchip", 64)
diff --git a/src/mess/drivers/gmaster.c b/src/mess/drivers/gmaster.c
index 5f261c53053..08cc5a7e6d0 100644
--- a/src/mess/drivers/gmaster.c
+++ b/src/mess/drivers/gmaster.c
@@ -20,7 +20,7 @@ public:
{ }
virtual void machine_start();
- virtual void palette_init();
+ DECLARE_PALETTE_INIT(gmaster);
DECLARE_READ8_MEMBER(gmaster_io_r);
DECLARE_WRITE8_MEMBER(gmaster_io_w);
@@ -215,13 +215,13 @@ static const unsigned char gmaster_palette[2][3] =
};
-void gmaster_state::palette_init()
+PALETTE_INIT_MEMBER(gmaster_state, gmaster)
{
int i;
for (i = 0; i < 2; i++)
{
- palette_set_color_rgb(machine(), i, gmaster_palette[i][0], gmaster_palette[i][1], gmaster_palette[i][2]);
+ palette.set_pen_color(i, gmaster_palette[i][0], gmaster_palette[i][1], gmaster_palette[i][2]);
}
}
@@ -299,7 +299,8 @@ static MACHINE_CONFIG_START( gmaster, gmaster_state )
MCFG_SCREEN_VISIBLE_AREA(0, 64-1-3, 0, 64-1)
MCFG_SCREEN_UPDATE_DRIVER(gmaster_state, screen_update_gmaster)
- MCFG_PALETTE_LENGTH(sizeof(gmaster_palette)/sizeof(gmaster_palette[0]))
+ MCFG_PALETTE_ADD("palette", sizeof(gmaster_palette)/sizeof(gmaster_palette[0]))
+ MCFG_PALETTE_INIT_OWNER(gmaster_state, gmaster)
MCFG_DEFAULT_LAYOUT(layout_lcd)
MCFG_SPEAKER_STANDARD_MONO("mono")
diff --git a/src/mess/drivers/gp2x.c b/src/mess/drivers/gp2x.c
index 1183cf74aa4..fbe006e999e 100644
--- a/src/mess/drivers/gp2x.c
+++ b/src/mess/drivers/gp2x.c
@@ -356,7 +356,7 @@ static MACHINE_CONFIG_START( gp2x, gp2x_state )
MCFG_CPU_ADD("maincpu", ARM9, 80000000)
MCFG_CPU_PROGRAM_MAP(gp2x_map)
- MCFG_PALETTE_LENGTH(32768)
+ MCFG_PALETTE_ADD("palette", 32768)
MCFG_SCREEN_ADD("screen", RASTER)
MCFG_SCREEN_REFRESH_RATE(60)
diff --git a/src/mess/drivers/gp32.c b/src/mess/drivers/gp32.c
index 0751275f634..9e6be05a5c3 100644
--- a/src/mess/drivers/gp32.c
+++ b/src/mess/drivers/gp32.c
@@ -134,7 +134,7 @@ void gp32_state::s3c240x_lcd_render_01( )
UINT32 data = s3c240x_lcd_dma_read();
for (j = 0; j < 32; j++)
{
- *scanline++ = palette_get_color( machine(), (data >> 31) & 0x01);
+ *scanline++ = m_palette->pen_color((data >> 31) & 0x01);
data = data << 1;
m_s3c240x_lcd.hpos++;
if (m_s3c240x_lcd.hpos >= (m_s3c240x_lcd.pagewidth_max << 4))
@@ -157,7 +157,7 @@ void gp32_state::s3c240x_lcd_render_02( )
UINT32 data = s3c240x_lcd_dma_read();
for (j = 0; j < 16; j++)
{
- *scanline++ = palette_get_color( machine(), (data >> 30) & 0x03);
+ *scanline++ = m_palette->pen_color((data >> 30) & 0x03);
data = data << 2;
m_s3c240x_lcd.hpos++;
if (m_s3c240x_lcd.hpos >= (m_s3c240x_lcd.pagewidth_max << 3))
@@ -180,7 +180,7 @@ void gp32_state::s3c240x_lcd_render_04( )
UINT32 data = s3c240x_lcd_dma_read( );
for (j = 0; j < 8; j++)
{
- *scanline++ = palette_get_color( machine(), (data >> 28) & 0x0F);
+ *scanline++ = m_palette->pen_color((data >> 28) & 0x0F);
data = data << 4;
m_s3c240x_lcd.hpos++;
if (m_s3c240x_lcd.hpos >= (m_s3c240x_lcd.pagewidth_max << 2))
@@ -203,7 +203,7 @@ void gp32_state::s3c240x_lcd_render_08( )
UINT32 data = s3c240x_lcd_dma_read();
for (j = 0; j < 4; j++)
{
- *scanline++ = palette_get_color( machine(), (data >> 24) & 0xFF);
+ *scanline++ = m_palette->pen_color((data >> 24) & 0xFF);
data = data << 8;
m_s3c240x_lcd.hpos++;
if (m_s3c240x_lcd.hpos >= (m_s3c240x_lcd.pagewidth_max << 1))
@@ -387,7 +387,7 @@ WRITE32_MEMBER(gp32_state::s3c240x_lcd_palette_w)
{
verboselog( machine(), 0, "s3c240x_lcd_palette_w: unknown mask %08x\n", mem_mask);
}
- palette_set_color( machine(), offset, s3c240x_get_color_5551( data & 0xFFFF));
+ m_palette->set_pen_color( offset, s3c240x_get_color_5551( data & 0xFFFF));
}
// CLOCK & POWER MANAGEMENT
@@ -1678,7 +1678,7 @@ static MACHINE_CONFIG_START( gp32, gp32_state )
MCFG_CPU_ADD("maincpu", ARM9, 40000000)
MCFG_CPU_PROGRAM_MAP(gp32_map)
- MCFG_PALETTE_LENGTH(32768)
+ MCFG_PALETTE_ADD("palette", 32768)
MCFG_SCREEN_ADD("screen", LCD)
MCFG_SCREEN_REFRESH_RATE(60)
diff --git a/src/mess/drivers/grfd2301.c b/src/mess/drivers/grfd2301.c
index 232b5fa8e34..517b03e8227 100644
--- a/src/mess/drivers/grfd2301.c
+++ b/src/mess/drivers/grfd2301.c
@@ -122,8 +122,7 @@ static MACHINE_CONFIG_START( grfd2301, grfd2301_state )
MCFG_SCREEN_UPDATE_DRIVER(grfd2301_state, screen_update)
MCFG_SCREEN_SIZE(640, 240)
MCFG_SCREEN_VISIBLE_AREA(0, 639, 0, 239)
- MCFG_PALETTE_LENGTH(2)
- MCFG_PALETTE_INIT_OVERRIDE(driver_device, black_and_white)
+ MCFG_PALETTE_ADD_BLACK_AND_WHITE("palette")
MACHINE_CONFIG_END
ROM_START( grfd2301 )
diff --git a/src/mess/drivers/h19.c b/src/mess/drivers/h19.c
index 6c833bf2973..a5dfff50c7d 100644
--- a/src/mess/drivers/h19.c
+++ b/src/mess/drivers/h19.c
@@ -429,8 +429,7 @@ static MACHINE_CONFIG_START( h19, h19_state )
MCFG_SCREEN_SIZE(640, 200)
MCFG_SCREEN_VISIBLE_AREA(0, 640 - 1, 0, 200 - 1)
MCFG_GFXDECODE_ADD("gfxdecode", h19)
- MCFG_PALETTE_LENGTH(2)
- MCFG_PALETTE_INIT_OVERRIDE(driver_device, monochrome_green)
+ MCFG_PALETTE_ADD_MONOCHROME_GREEN("palette")
MCFG_MC6845_ADD("crtc", MC6845, "screen", XTAL_12_288MHz / 8, h19_crtc6845_interface) // clk taken from schematics
MCFG_INS8250_ADD( "ins8250", h19_ace_interface, XTAL_12_288MHz / 4) // 3.072mhz clock which gets divided down for the various baud rates
diff --git a/src/mess/drivers/h89.c b/src/mess/drivers/h89.c
index 506b3c3f95e..f29c1ec9c98 100644
--- a/src/mess/drivers/h89.c
+++ b/src/mess/drivers/h89.c
@@ -143,8 +143,7 @@ static MACHINE_CONFIG_START( h89, h89_state )
MCFG_SCREEN_VISIBLE_AREA(0, 640-1, 0, 480-1)
MCFG_SCREEN_UPDATE_STATIC(h89)
- MCFG_PALETTE_LENGTH(2)
- MCFG_PALETTE_INIT_OVERRIDE(driver_device, black_and_white)
+ MCFG_PALETTE_ADD_BLACK_AND_WHITE("palette")
#endif
MCFG_INS8250_ADD( "ins8250", h89_ins8250_interface, XTAL_1_8432MHz )
diff --git a/src/mess/drivers/harriet.c b/src/mess/drivers/harriet.c
index 6d462ca60fe..5e128f9788d 100644
--- a/src/mess/drivers/harriet.c
+++ b/src/mess/drivers/harriet.c
@@ -43,14 +43,12 @@ public:
DECLARE_READ8_MEMBER(unk3_r);
DECLARE_READ8_MEMBER(keyboard_status_r);
DECLARE_WRITE8_MEMBER( kbd_put );
-
protected:
// driver_device overrides
virtual void machine_start();
virtual void machine_reset();
virtual void video_start();
- virtual void palette_init();
};
void harriet_state::video_start()
@@ -196,12 +194,6 @@ void harriet_state::machine_reset()
}
-void harriet_state::palette_init()
-{
-}
-
-
-
static MACHINE_CONFIG_START( harriet, harriet_state )
/* basic machine hardware */
@@ -211,7 +203,7 @@ static MACHINE_CONFIG_START( harriet, harriet_state )
/* video hardware */
MCFG_GENERIC_TERMINAL_ADD(TERMINAL_TAG, terminal_intf)
- MCFG_PALETTE_LENGTH(8)
+ MCFG_PALETTE_ADD("palette", 8)
/* sound hardware */
MCFG_SPEAKER_STANDARD_MONO("mono")
diff --git a/src/mess/drivers/hec2hrp.c b/src/mess/drivers/hec2hrp.c
index 168ae7c62da..f560c0d8b33 100644
--- a/src/mess/drivers/hec2hrp.c
+++ b/src/mess/drivers/hec2hrp.c
@@ -446,7 +446,7 @@ static MACHINE_CONFIG_START( hec2hr, hec2hrp_state )
MCFG_SCREEN_VISIBLE_AREA(0, 243, 0, 227)
MCFG_SCREEN_UPDATE_DRIVER(hec2hrp_state, screen_update_hec2hrp)
- MCFG_PALETTE_LENGTH(16)
+ MCFG_PALETTE_ADD("palette", 16)
MCFG_VIDEO_START_OVERRIDE(hec2hrp_state,hec2hrp)
/* sound hardware */
@@ -489,7 +489,7 @@ static MACHINE_CONFIG_START( hec2hrp, hec2hrp_state )
MCFG_SCREEN_VISIBLE_AREA(0, 243, 0, 227)
MCFG_SCREEN_UPDATE_DRIVER(hec2hrp_state, screen_update_hec2hrp)
- MCFG_PALETTE_LENGTH(16)
+ MCFG_PALETTE_ADD("palette", 16)
MCFG_VIDEO_START_OVERRIDE(hec2hrp_state,hec2hrp)
/* sound hardware */
@@ -544,7 +544,7 @@ static MACHINE_CONFIG_START( hec2mx40, hec2hrp_state )
MCFG_SCREEN_VISIBLE_AREA(0, 243, 0, 227)
MCFG_SCREEN_UPDATE_DRIVER(hec2hrp_state, screen_update_hec2hrp)
- MCFG_PALETTE_LENGTH(16)
+ MCFG_PALETTE_ADD("palette", 16)
MCFG_VIDEO_START_OVERRIDE(hec2hrp_state,hec2hrp)
/* sound hardware */
@@ -594,7 +594,7 @@ static MACHINE_CONFIG_START( hec2hrx, hec2hrp_state )
MCFG_SCREEN_VISIBLE_AREA(0, 243, 0, 227)
MCFG_SCREEN_UPDATE_DRIVER(hec2hrp_state, screen_update_hec2hrp)
- MCFG_PALETTE_LENGTH(16)
+ MCFG_PALETTE_ADD("palette", 16)
MCFG_VIDEO_START_OVERRIDE(hec2hrp_state,hec2hrp)
/* sound hardware */
@@ -641,8 +641,7 @@ static MACHINE_CONFIG_START( hec2mdhrx, hec2hrp_state )
MCFG_SCREEN_VISIBLE_AREA(0, 243, 0, 227)
MCFG_SCREEN_UPDATE_DRIVER(hec2hrp_state, screen_update_hec2hrp)
- MCFG_PALETTE_LENGTH(16)
- MCFG_PALETTE_INIT_OVERRIDE(driver_device, black_and_white)
+ MCFG_PALETTE_ADD_BLACK_AND_WHITE("palette")
MCFG_VIDEO_START_OVERRIDE(hec2hrp_state,hec2hrp)
/* sound hardware */
@@ -693,7 +692,7 @@ static MACHINE_CONFIG_START( hec2mx80, hec2hrp_state )
MCFG_SCREEN_VISIBLE_AREA(0, 243, 0, 227)
MCFG_SCREEN_UPDATE_DRIVER(hec2hrp_state, screen_update_hec2hrp)
- MCFG_PALETTE_LENGTH(16)
+ MCFG_PALETTE_ADD("palette", 16)
MCFG_VIDEO_START_OVERRIDE(hec2hrp_state,hec2hrp)
/* sound hardware */
diff --git a/src/mess/drivers/homelab.c b/src/mess/drivers/homelab.c
index c18e2d4395c..7f5decce481 100644
--- a/src/mess/drivers/homelab.c
+++ b/src/mess/drivers/homelab.c
@@ -761,8 +761,7 @@ static MACHINE_CONFIG_START( homelab, homelab_state )
MCFG_VIDEO_START_OVERRIDE(homelab_state,homelab2)
MCFG_SCREEN_UPDATE_DRIVER(homelab_state, screen_update_homelab2)
MCFG_GFXDECODE_ADD("gfxdecode", homelab)
- MCFG_PALETTE_LENGTH(2)
- MCFG_PALETTE_INIT_OVERRIDE(driver_device, monochrome_green)
+ MCFG_PALETTE_ADD_MONOCHROME_GREEN("palette")
/* sound hardware */
MCFG_SPEAKER_STANDARD_MONO("mono")
@@ -791,8 +790,7 @@ static MACHINE_CONFIG_START( homelab3, homelab_state )
MCFG_VIDEO_START_OVERRIDE(homelab_state,homelab3)
MCFG_SCREEN_UPDATE_DRIVER(homelab_state, screen_update_homelab3)
MCFG_GFXDECODE_ADD("gfxdecode", homelab)
- MCFG_PALETTE_LENGTH(2)
- MCFG_PALETTE_INIT_OVERRIDE(driver_device, monochrome_green)
+ MCFG_PALETTE_ADD_MONOCHROME_GREEN("palette")
/* sound hardware */
MCFG_SPEAKER_STANDARD_MONO("mono")
@@ -821,8 +819,7 @@ static MACHINE_CONFIG_START( brailab4, homelab_state )
MCFG_VIDEO_START_OVERRIDE(homelab_state,brailab4)
MCFG_SCREEN_UPDATE_DRIVER(homelab_state, screen_update_homelab3)
MCFG_GFXDECODE_ADD("gfxdecode", homelab)
- MCFG_PALETTE_LENGTH(2)
- MCFG_PALETTE_INIT_OVERRIDE(driver_device, monochrome_green)
+ MCFG_PALETTE_ADD_MONOCHROME_GREEN("palette")
/* sound hardware */
MCFG_SPEAKER_STANDARD_MONO("mono")
diff --git a/src/mess/drivers/homez80.c b/src/mess/drivers/homez80.c
index c2f481e4d3e..6937b35964e 100644
--- a/src/mess/drivers/homez80.c
+++ b/src/mess/drivers/homez80.c
@@ -292,9 +292,8 @@ static MACHINE_CONFIG_START( homez80, homez80_state )
MCFG_SCREEN_UPDATE_DRIVER(homez80_state, screen_update)
MCFG_SCREEN_SIZE(344, 32*8)
MCFG_SCREEN_VISIBLE_AREA(0, 344-1, 0, 32*8-1)
- MCFG_PALETTE_LENGTH(2)
- MCFG_PALETTE_INIT_OVERRIDE(driver_device, black_and_white)
- MCFG_GFXDECODE_ADD("gfxdecode", homez80 )
+ MCFG_PALETTE_ADD_BLACK_AND_WHITE("palette")
+ MCFG_GFXDECODE_ADD("gfxdecode", homez80 )
MACHINE_CONFIG_END
/* ROM definition */
diff --git a/src/mess/drivers/hp16500.c b/src/mess/drivers/hp16500.c
index 43f13323a9d..e0c23ed96f6 100644
--- a/src/mess/drivers/hp16500.c
+++ b/src/mess/drivers/hp16500.c
@@ -63,7 +63,7 @@ static MACHINE_CONFIG_START( hp16500, hp16500_state )
MCFG_SCREEN_VISIBLE_AREA(0, 640-1, 0, 480-1)
MCFG_SCREEN_UPDATE_DRIVER(hp16500_state, screen_update_hp16500)
- MCFG_PALETTE_LENGTH(256)
+ MCFG_PALETTE_ADD("palette", 256)
MCFG_SPEAKER_STANDARD_STEREO("lspeaker", "rspeaker")
diff --git a/src/mess/drivers/hp48.c b/src/mess/drivers/hp48.c
index eadda806c14..1f72e352016 100644
--- a/src/mess/drivers/hp48.c
+++ b/src/mess/drivers/hp48.c
@@ -947,7 +947,8 @@ static MACHINE_CONFIG_START( hp48_common, hp48_state )
MCFG_SCREEN_VISIBLE_AREA( 0, 130, 0, 63 )
MCFG_SCREEN_UPDATE_DRIVER(hp48_state, screen_update_hp48)
- MCFG_PALETTE_LENGTH( 256 ) /* monochrome, but with varying contrast and grayscale */
+ MCFG_PALETTE_ADD( "palette", 256 ) /* monochrome, but with varying contrast and grayscale */
+ MCFG_PALETTE_INIT_OWNER(hp48_state, hp48)
/* sound */
MCFG_SPEAKER_STANDARD_MONO( "mono" )
diff --git a/src/mess/drivers/hp49gp.c b/src/mess/drivers/hp49gp.c
index b6e17c26722..55599a3184f 100644
--- a/src/mess/drivers/hp49gp.c
+++ b/src/mess/drivers/hp49gp.c
@@ -298,7 +298,7 @@ static MACHINE_CONFIG_START( hp49gp, hp49gp_state )
MCFG_CPU_ADD("maincpu", ARM9, 400000000)
MCFG_CPU_PROGRAM_MAP(hp49gp_map)
- MCFG_PALETTE_LENGTH(32768)
+ MCFG_PALETTE_ADD("palette", 32768)
MCFG_SCREEN_ADD("screen", LCD)
MCFG_SCREEN_REFRESH_RATE(60)
@@ -310,7 +310,7 @@ static MACHINE_CONFIG_START( hp49gp, hp49gp_state )
MCFG_DEFAULT_LAYOUT(layout_lcd)
- MCFG_S3C2410_ADD("s3c2410", 12000000, hp49gp_s3c2410_intf)
+ MCFG_S3C2410_ADD("s3c2410", 12000000, hp49gp_s3c2410_intf, "palette")
MACHINE_CONFIG_END
static INPUT_PORTS_START( hp49gp )
diff --git a/src/mess/drivers/hp9k.c b/src/mess/drivers/hp9k.c
index 1721e8b50c7..6467d946ef6 100644
--- a/src/mess/drivers/hp9k.c
+++ b/src/mess/drivers/hp9k.c
@@ -420,8 +420,7 @@ static MACHINE_CONFIG_START( hp9k, hp9k_state )
MCFG_SCREEN_UPDATE_DRIVER(hp9k_state, screen_update)
MCFG_GFXDECODE_ADD("gfxdecode", hp9k)
- MCFG_PALETTE_LENGTH(2)
- MCFG_PALETTE_INIT_OVERRIDE(driver_device, black_and_white)
+ MCFG_PALETTE_ADD_BLACK_AND_WHITE("palette")
MCFG_MC6845_ADD( "mc6845", MC6845, "screen", XTAL_16MHz / 16, hp9k_mc6845_intf )
MACHINE_CONFIG_END
diff --git a/src/mess/drivers/hprot1.c b/src/mess/drivers/hprot1.c
index 0eacb71d004..724c5fcfe71 100644
--- a/src/mess/drivers/hprot1.c
+++ b/src/mess/drivers/hprot1.c
@@ -63,10 +63,10 @@ public:
//DECLARE_WRITE8_MEMBER(henry_io_w);
DECLARE_READ8_MEMBER(henry_io_r);
DECLARE_DRIVER_INIT(hprot1);
+ DECLARE_PALETTE_INIT(hprot1);
private:
virtual void machine_start();
virtual void machine_reset();
- virtual void palette_init();
required_device<cpu_device> m_maincpu;
required_device<hd44780_device> m_lcdc;
};
@@ -210,10 +210,10 @@ WRITE8_MEMBER(hprot1_state::henry_io_w)
}
*/
-void hprot1_state::palette_init()
+PALETTE_INIT_MEMBER(hprot1_state, hprot1)
{
- palette_set_color(machine(), 0, rgb_t(138, 146, 148));
- palette_set_color(machine(), 1, rgb_t(92, 83, 88));
+ palette.set_pen_color(0, rgb_t(138, 146, 148));
+ palette.set_pen_color(1, rgb_t(92, 83, 88));
}
static const gfx_layout henry_prot_charlayout =
@@ -245,7 +245,8 @@ static MACHINE_CONFIG_START( hprot1, hprot1_state )
MCFG_SCREEN_SIZE(6*16, 9*2)
MCFG_SCREEN_VISIBLE_AREA(0, 6*16-1, 0, 9*2-1)
MCFG_DEFAULT_LAYOUT(layout_lcd)
- MCFG_PALETTE_LENGTH(2)
+ MCFG_PALETTE_ADD("palette", 2)
+ MCFG_PALETTE_INIT_OWNER(hprot1_state, hprot1)
MCFG_GFXDECODE_ADD("gfxdecode", hprot1)
MCFG_HD44780_ADD("hd44780")
diff --git a/src/mess/drivers/hx20.c b/src/mess/drivers/hx20.c
index 25adeaa0d2c..56ee88c4fc8 100644
--- a/src/mess/drivers/hx20.c
+++ b/src/mess/drivers/hx20.c
@@ -760,10 +760,10 @@ WRITE_LINE_MEMBER( hx20_state::rtc_irq_w )
// VIDEO
//**************************************************************************
-void hx20_state::palette_init()
+PALETTE_INIT_MEMBER(hx20_state, hx20)
{
- palette_set_color_rgb(machine(), 0, 0xa5, 0xad, 0xa5);
- palette_set_color_rgb(machine(), 1, 0x31, 0x39, 0x10);
+ palette.set_pen_color(0, 0xa5, 0xad, 0xa5);
+ palette.set_pen_color(1, 0x31, 0x39, 0x10);
}
@@ -832,7 +832,8 @@ static MACHINE_CONFIG_START( hx20, hx20_state )
MCFG_SCREEN_SIZE(120, 32)
MCFG_SCREEN_VISIBLE_AREA(0, 120-1, 0, 32-1)
MCFG_SCREEN_UPDATE_DRIVER(hx20_state, screen_update)
- MCFG_PALETTE_LENGTH(2)
+ MCFG_PALETTE_ADD("palette", 2)
+ MCFG_PALETTE_INIT_OWNER(hx20_state, hx20)
MCFG_UPD7227_ADD(UPD7227_0_TAG, 0, 0)
MCFG_UPD7227_ADD(UPD7227_1_TAG, 40, 0)
MCFG_UPD7227_ADD(UPD7227_2_TAG, 80, 0)
diff --git a/src/mess/drivers/ibm6580.c b/src/mess/drivers/ibm6580.c
index e614af7610e..c77b74573b5 100644
--- a/src/mess/drivers/ibm6580.c
+++ b/src/mess/drivers/ibm6580.c
@@ -28,7 +28,7 @@ public:
{ }
const UINT8 *m_p_chargen;
- void palette_init_ibm6580();
+ DECLARE_PALETTE_INIT(ibm6580);
UINT32 screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
private:
virtual void machine_reset();
@@ -59,9 +59,9 @@ UINT32 ibm6580_state::screen_update(screen_device &screen, bitmap_ind16 &bitmap,
PALETTE_INIT_MEMBER( ibm6580_state, ibm6580 )
{
- palette_set_color_rgb( machine(), 0, 0, 0, 0 ); /* Black */
- palette_set_color_rgb( machine(), 1, 0, 255, 0 ); /* Full */
- palette_set_color_rgb( machine(), 2, 0, 128, 0 ); /* Dimmed */
+ palette.set_pen_color(0, 0, 0, 0 ); /* Black */
+ palette.set_pen_color(1, 0, 255, 0 ); /* Full */
+ palette.set_pen_color(2, 0, 128, 0 ); /* Dimmed */
}
void ibm6580_state::machine_reset()
@@ -82,8 +82,8 @@ static MACHINE_CONFIG_START( ibm6580, ibm6580_state )
MCFG_SCREEN_UPDATE_DRIVER(ibm6580_state, screen_update)
MCFG_SCREEN_SIZE(640, 240)
MCFG_SCREEN_VISIBLE_AREA(0, 639, 0, 239)
- MCFG_PALETTE_LENGTH(3)
- MCFG_PALETTE_INIT_OVERRIDE(ibm6580_state, ibm6580)
+ MCFG_PALETTE_ADD("palette", 3)
+ MCFG_PALETTE_INIT_OWNER(ibm6580_state, ibm6580)
MACHINE_CONFIG_END
/* ROM definition */
diff --git a/src/mess/drivers/ie15.c b/src/mess/drivers/ie15.c
index d9a894c0296..8215a532880 100644
--- a/src/mess/drivers/ie15.c
+++ b/src/mess/drivers/ie15.c
@@ -66,7 +66,7 @@ public:
virtual void machine_reset();
virtual void video_start();
- virtual void palette_init();
+ DECLARE_PALETTE_INIT(ie15);
UINT32 screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
UINT32 screen_update_hle(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
TIMER_DEVICE_CALLBACK_MEMBER(scanline_callback);
@@ -613,10 +613,10 @@ static GFXDECODE_START( ie15 )
GFXDECODE_ENTRY( "chargen", 0x0000, ie15_charlayout, 0, 1 )
GFXDECODE_END
-void ie15_state::palette_init()
+PALETTE_INIT_MEMBER(ie15_state, ie15)
{
- palette_set_color(machine(), 0, rgb_t::black); // black
- palette_set_color_rgb(machine(), 1, 0x00, 0xc0, 0x00); // green
+ palette.set_pen_color(0, rgb_t::black); // black
+ palette.set_pen_color(1, 0x00, 0xc0, 0x00); // green
}
static MACHINE_CONFIG_START( ie15, ie15_state )
@@ -634,7 +634,8 @@ static MACHINE_CONFIG_START( ie15, ie15_state )
IE15_HORZ_START+IE15_DISP_HORZ,IE15_TOTAL_VERT,IE15_VERT_START,
IE15_VERT_START+IE15_DISP_VERT);
MCFG_GFXDECODE_ADD("gfxdecode", ie15)
- MCFG_PALETTE_LENGTH(2)
+ MCFG_PALETTE_ADD("palette", 2)
+ MCFG_PALETTE_INIT_OWNER(ie15_state, ie15)
/* Devices */
MCFG_ASCII_KEYBOARD_ADD(KEYBOARD_TAG, keyboard_intf)
diff --git a/src/mess/drivers/if800.c b/src/mess/drivers/if800.c
index 4eab0039d7b..60393ba3cca 100644
--- a/src/mess/drivers/if800.c
+++ b/src/mess/drivers/if800.c
@@ -103,8 +103,8 @@ static MACHINE_CONFIG_START( if800, if800_state )
MCFG_SCREEN_VISIBLE_AREA(0, 640-1, 0, 480-1)
MCFG_SCREEN_UPDATE_DEVICE("upd7220", upd7220_device, screen_update)
- MCFG_PALETTE_LENGTH(8)
-// MCFG_PALETTE_INIT_OVERRIDE(driver_device, black_and_white)
+ MCFG_PALETTE_ADD("palette", 8)
+// MCFG_PALETTE_INIT(black_and_white)
// MCFG_VIDEO_START_OVERRIDE(if800_state,if800)
MACHINE_CONFIG_END
diff --git a/src/mess/drivers/interact.c b/src/mess/drivers/interact.c
index e6bac8e2d8b..40d39fe8c0e 100644
--- a/src/mess/drivers/interact.c
+++ b/src/mess/drivers/interact.c
@@ -155,7 +155,7 @@ static MACHINE_CONFIG_START( interact, interact_state )
MCFG_SCREEN_VISIBLE_AREA(0, 112, 0, 77)
MCFG_SCREEN_UPDATE_DRIVER(interact_state, screen_update_interact)
- MCFG_PALETTE_LENGTH(16) /* 8 colours, but only 4 at a time*/
+ MCFG_PALETTE_ADD("palette", 16) /* 8 colours, but only 4 at a time*/
MCFG_VIDEO_START_OVERRIDE(interact_state,hec2hrp)
/* sound hardware */
@@ -197,7 +197,7 @@ static MACHINE_CONFIG_START( hector1, interact_state )
MCFG_SCREEN_VISIBLE_AREA(0, 112, 0, 77)
MCFG_SCREEN_UPDATE_DRIVER(interact_state, screen_update_interact)
- MCFG_PALETTE_LENGTH(16) /* 8 colours, but only 4 at a time*/
+ MCFG_PALETTE_ADD("palette", 16) /* 8 colours, but only 4 at a time*/
MCFG_VIDEO_START_OVERRIDE(interact_state,hec2hrp)
/* sound hardware */
diff --git a/src/mess/drivers/intv.c b/src/mess/drivers/intv.c
index 02ff6b182b7..cd9df0cf431 100644
--- a/src/mess/drivers/intv.c
+++ b/src/mess/drivers/intv.c
@@ -84,29 +84,27 @@ static const unsigned char intv_colors[] =
0xB5, 0x1A, 0x58 /* PURPLE */
};
-void intv_state::palette_init()
+PALETTE_INIT_MEMBER(intv_state, intv)
{
int k = 0;
UINT8 r, g, b;
/* Two copies of everything (why?) */
- machine().colortable = colortable_alloc(machine(), 32);
-
for (int i = 0; i < 16; i++)
{
r = intv_colors[i * 3 + 0];
g = intv_colors[i * 3 + 1];
b = intv_colors[i * 3 + 2];
- colortable_palette_set_color(machine().colortable, i, rgb_t(r, g, b));
- colortable_palette_set_color(machine().colortable, i + 16, rgb_t(r, g, b));
+ palette.set_indirect_color(i, rgb_t(r, g, b));
+ palette.set_indirect_color(i + 16, rgb_t(r, g, b));
}
for (int i = 0; i < 16; i++)
{
for (int j = 0; j < 16; j++)
{
- colortable_entry_set_value(machine().colortable, k++, i);
- colortable_entry_set_value(machine().colortable, k++, j);
+ palette.set_pen_indirect(k++, i);
+ palette.set_pen_indirect(k++, j);
}
}
@@ -114,8 +112,8 @@ void intv_state::palette_init()
{
for (int j = 16; j < 32; j++)
{
- colortable_entry_set_value(machine().colortable, k++, i);
- colortable_entry_set_value(machine().colortable, k++, j);
+ palette.set_pen_indirect(k++, i);
+ palette.set_pen_indirect(k++, j);
}
}
}
@@ -826,7 +824,8 @@ static MACHINE_CONFIG_START( intv, intv_state )
MCFG_SCREEN_SIZE((STIC_OVERSCAN_LEFT_WIDTH+STIC_BACKTAB_WIDTH*STIC_CARD_WIDTH-1+STIC_OVERSCAN_RIGHT_WIDTH)*STIC_X_SCALE*INTV_X_SCALE, (STIC_OVERSCAN_TOP_HEIGHT+STIC_BACKTAB_HEIGHT*STIC_CARD_HEIGHT+STIC_OVERSCAN_BOTTOM_HEIGHT)*STIC_Y_SCALE*INTV_Y_SCALE)
MCFG_SCREEN_VISIBLE_AREA(0, (STIC_OVERSCAN_LEFT_WIDTH+STIC_BACKTAB_WIDTH*STIC_CARD_WIDTH-1+STIC_OVERSCAN_RIGHT_WIDTH)*STIC_X_SCALE*INTV_X_SCALE-1, 0, (STIC_OVERSCAN_TOP_HEIGHT+STIC_BACKTAB_HEIGHT*STIC_CARD_HEIGHT+STIC_OVERSCAN_BOTTOM_HEIGHT)*STIC_Y_SCALE*INTV_Y_SCALE-1)
- MCFG_PALETTE_LENGTH(0x400)
+ MCFG_PALETTE_ADD("palette", 0x400)
+ MCFG_PALETTE_INIT_OWNER(intv_state, intv)
/* sound hardware */
MCFG_SPEAKER_STANDARD_MONO("mono")
@@ -879,6 +878,9 @@ static MACHINE_CONFIG_DERIVED( intvkbd, intv )
/* video hardware */
MCFG_GFXDECODE_ADD("gfxdecode", intvkbd)
+ MCFG_PALETTE_MODIFY("palette")
+ MCFG_PALETTE_INIT_OWNER(intv_state, intv)
+
MCFG_SCREEN_MODIFY("screen")
MCFG_SCREEN_SIZE((STIC_OVERSCAN_LEFT_WIDTH+STIC_BACKTAB_WIDTH*STIC_CARD_WIDTH-1+STIC_OVERSCAN_RIGHT_WIDTH)*STIC_X_SCALE*INTVKBD_X_SCALE, (STIC_OVERSCAN_TOP_HEIGHT+STIC_BACKTAB_HEIGHT*STIC_CARD_HEIGHT+STIC_OVERSCAN_BOTTOM_HEIGHT)*STIC_Y_SCALE*INTVKBD_Y_SCALE)
MCFG_SCREEN_VISIBLE_AREA(0, (STIC_OVERSCAN_LEFT_WIDTH+STIC_BACKTAB_WIDTH*STIC_CARD_WIDTH-1+STIC_OVERSCAN_RIGHT_WIDTH)*STIC_X_SCALE*INTVKBD_X_SCALE-1, 0, (STIC_OVERSCAN_TOP_HEIGHT+STIC_BACKTAB_HEIGHT*STIC_CARD_HEIGHT+STIC_OVERSCAN_BOTTOM_HEIGHT)*STIC_Y_SCALE*INTVKBD_Y_SCALE-1)
diff --git a/src/mess/drivers/ip20.c b/src/mess/drivers/ip20.c
index 376fbc56db8..04a6770f4b8 100644
--- a/src/mess/drivers/ip20.c
+++ b/src/mess/drivers/ip20.c
@@ -603,7 +603,7 @@ static MACHINE_CONFIG_START( ip204415, ip20_state )
MCFG_SCREEN_VISIBLE_AREA(0, 799, 0, 599)
MCFG_SCREEN_UPDATE_DRIVER(ip20_state, screen_update_ip204415)
- MCFG_PALETTE_LENGTH(65536)
+ MCFG_PALETTE_ADD("palette", 65536)
MCFG_SPEAKER_STANDARD_MONO("mono")
diff --git a/src/mess/drivers/ip22.c b/src/mess/drivers/ip22.c
index 51d5c9615a0..82a50e08c24 100644
--- a/src/mess/drivers/ip22.c
+++ b/src/mess/drivers/ip22.c
@@ -1624,7 +1624,7 @@ static MACHINE_CONFIG_START( ip225015, ip22_state )
MCFG_SCREEN_VISIBLE_AREA(0, 1279, 0, 1023)
MCFG_SCREEN_UPDATE_DEVICE("newport", newport_video_device, screen_update)
- MCFG_PALETTE_LENGTH(65536)
+ MCFG_PALETTE_ADD("palette", 65536)
MCFG_NEWPORT_ADD("newport")
diff --git a/src/mess/drivers/ipds.c b/src/mess/drivers/ipds.c
index 7ef475023ba..1ec7b32140e 100644
--- a/src/mess/drivers/ipds.c
+++ b/src/mess/drivers/ipds.c
@@ -153,8 +153,7 @@ static MACHINE_CONFIG_START( ipds, ipds_state )
MCFG_SCREEN_SIZE(640, 480)
MCFG_SCREEN_VISIBLE_AREA(0, 640-1, 0, 480-1)
MCFG_GFXDECODE_ADD("gfxdecode", ipds)
- MCFG_PALETTE_LENGTH(2)
- MCFG_PALETTE_INIT_OVERRIDE(driver_device, monochrome_green)
+ MCFG_PALETTE_ADD_MONOCHROME_GREEN("palette")
MCFG_I8275_ADD ( "i8275", ipds_i8275_interface)
MCFG_ASCII_KEYBOARD_ADD(KEYBOARD_TAG, keyboard_intf)
diff --git a/src/mess/drivers/iq151.c b/src/mess/drivers/iq151.c
index ed90ef1d707..ff53a8ca15d 100644
--- a/src/mess/drivers/iq151.c
+++ b/src/mess/drivers/iq151.c
@@ -433,8 +433,7 @@ static MACHINE_CONFIG_START( iq151, iq151_state )
MCFG_SCREEN_UPDATE_DRIVER(iq151_state, screen_update)
MCFG_SCREEN_SIZE(64*8, 32*8)
MCFG_SCREEN_VISIBLE_AREA(0, 32*8-1, 0, 32*8-1)
- MCFG_PALETTE_LENGTH(2)
- MCFG_PALETTE_INIT_OVERRIDE(driver_device, monochrome_green)
+ MCFG_PALETTE_ADD_MONOCHROME_GREEN("palette")
/* sound hardware */
MCFG_SPEAKER_STANDARD_MONO("mono")
diff --git a/src/mess/drivers/irisha.c b/src/mess/drivers/irisha.c
index a8c46fc1203..469be379702 100644
--- a/src/mess/drivers/irisha.c
+++ b/src/mess/drivers/irisha.c
@@ -407,8 +407,7 @@ static MACHINE_CONFIG_START( irisha, irisha_state )
MCFG_SCREEN_VISIBLE_AREA(0, 320-1, 0, 200-1)
MCFG_SCREEN_UPDATE_DRIVER(irisha_state, screen_update_irisha)
MCFG_GFXDECODE_ADD("gfxdecode", irisha)
- MCFG_PALETTE_LENGTH(2)
- MCFG_PALETTE_INIT_OVERRIDE(driver_device, black_and_white)
+ MCFG_PALETTE_ADD_BLACK_AND_WHITE("palette")
/* sound hardware */
MCFG_SPEAKER_STANDARD_MONO("mono")
diff --git a/src/mess/drivers/itt3030.c b/src/mess/drivers/itt3030.c
index f7d05bfcff6..3012adab916 100644
--- a/src/mess/drivers/itt3030.c
+++ b/src/mess/drivers/itt3030.c
@@ -360,7 +360,7 @@ UINT32 itt3030_state::screen_update( screen_device &screen, bitmap_ind16 &bitmap
for(int x = 0; x < 80; x++ )
{
UINT8 code = m_vram[x + y*128];
- m_gfxdecode->gfx(0)->opaque(bitmap,cliprect, code , 0, 0,0, x*8,y*16);
+ m_gfxdecode->gfx(0)->opaque(m_palette,bitmap,cliprect, code , 0, 0,0, x*8,y*16);
}
}
@@ -626,8 +626,7 @@ static MACHINE_CONFIG_START( itt3030, itt3030_state )
MCFG_GFXDECODE_ADD("gfxdecode", itt3030)
- MCFG_PALETTE_LENGTH(2)
- MCFG_PALETTE_INIT_OVERRIDE(driver_device, black_and_white)
+ MCFG_PALETTE_ADD_BLACK_AND_WHITE("palette")
/* internal ram */
MCFG_RAM_ADD("mainram")
diff --git a/src/mess/drivers/jonos.c b/src/mess/drivers/jonos.c
index 61722e9b53d..1721d470f45 100644
--- a/src/mess/drivers/jonos.c
+++ b/src/mess/drivers/jonos.c
@@ -131,8 +131,7 @@ static MACHINE_CONFIG_START( jonos, jonos_state )
MCFG_SCREEN_SIZE(640, 300)
MCFG_SCREEN_VISIBLE_AREA(0, 639, 0, 299)
MCFG_GFXDECODE_ADD("gfxdecode", jonos)
- MCFG_PALETTE_LENGTH(2)
- MCFG_PALETTE_INIT_OVERRIDE(driver_device, black_and_white)
+ MCFG_PALETTE_ADD_BLACK_AND_WHITE("palette")
MACHINE_CONFIG_END
DRIVER_INIT_MEMBER(jonos_state,jonos)
diff --git a/src/mess/drivers/jr100.c b/src/mess/drivers/jr100.c
index 4b85f7a806c..d7d1f424866 100644
--- a/src/mess/drivers/jr100.c
+++ b/src/mess/drivers/jr100.c
@@ -385,8 +385,7 @@ static MACHINE_CONFIG_START( jr100, jr100_state )
MCFG_SCREEN_UPDATE_DRIVER(jr100_state, screen_update_jr100)
MCFG_GFXDECODE_ADD("gfxdecode", jr100)
- MCFG_PALETTE_LENGTH(2)
- MCFG_PALETTE_INIT_OVERRIDE(driver_device, black_and_white)
+ MCFG_PALETTE_ADD_BLACK_AND_WHITE("palette")
MCFG_DEVICE_ADD("via", VIA6522, XTAL_14_31818MHz / 16)
MCFG_VIA6522_READPB_HANDLER(READ8(jr100_state,jr100_via_read_b))
diff --git a/src/mess/drivers/jr200.c b/src/mess/drivers/jr200.c
index 09e567842ea..cd84eea4767 100644
--- a/src/mess/drivers/jr200.c
+++ b/src/mess/drivers/jr200.c
@@ -69,7 +69,7 @@ public:
virtual void machine_start();
virtual void machine_reset();
virtual void video_start();
- virtual void palette_init();
+ DECLARE_PALETTE_INIT(jr200);
UINT32 screen_update_jr200(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
TIMER_CALLBACK_MEMBER(timer_d_callback);
@@ -200,7 +200,7 @@ UINT32 jr200_state::screen_update_jr200(screen_device &screen, bitmap_ind16 &bit
pen = (gfx_data[(tile*8)+yi]>>(7-xi) & 1) ? (attr & 0x7) : ((attr & 0x38) >> 3);
}
- bitmap.pix16(y*8+yi+16, x*8+xi+16) = machine().pens[pen];
+ bitmap.pix16(y*8+yi+16, x*8+xi+16) = m_palette->pen(pen);
}
}
}
@@ -493,12 +493,12 @@ static INPUT_PORTS_START( jr200 )
PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_NAME("RIGHT CTRL") PORT_CODE(KEYCODE_RCONTROL) PORT_CHAR(UCHAR_MAMEKEY(RCONTROL))
INPUT_PORTS_END
-void jr200_state::palette_init()
+PALETTE_INIT_MEMBER(jr200_state, jr200)
{
int i;
for (i = 0; i < 8; i++)
- palette_set_color_rgb(machine(), i, pal1bit(i >> 1), pal1bit(i >> 2), pal1bit(i >> 0));
+ palette.set_pen_color(i, pal1bit(i >> 1), pal1bit(i >> 2), pal1bit(i >> 0));
}
static const gfx_layout tiles8x8_layout =
@@ -556,7 +556,8 @@ static MACHINE_CONFIG_START( jr200, jr200_state )
MCFG_SCREEN_UPDATE_DRIVER(jr200_state, screen_update_jr200)
MCFG_GFXDECODE_ADD("gfxdecode", jr200)
- MCFG_PALETTE_LENGTH(8)
+ MCFG_PALETTE_ADD("palette", 8)
+ MCFG_PALETTE_INIT_OWNER(jr200_state, jr200)
MCFG_SPEAKER_STANDARD_MONO("mono")
diff --git a/src/mess/drivers/jtc.c b/src/mess/drivers/jtc.c
index 9d980a79515..4d6486d4056 100644
--- a/src/mess/drivers/jtc.c
+++ b/src/mess/drivers/jtc.c
@@ -756,8 +756,7 @@ static MACHINE_CONFIG_DERIVED( jtc, basic )
MCFG_SCREEN_SIZE(64, 64)
MCFG_SCREEN_VISIBLE_AREA(0, 64-1, 0, 64-1)
- MCFG_PALETTE_LENGTH(2)
- MCFG_PALETTE_INIT_OVERRIDE(driver_device, black_and_white)
+ MCFG_PALETTE_ADD_BLACK_AND_WHITE("palette")
/* internal ram */
MCFG_RAM_ADD(RAM_TAG)
@@ -788,8 +787,7 @@ static MACHINE_CONFIG_DERIVED_CLASS( jtces23, basic, jtces23_state )
MCFG_SCREEN_VISIBLE_AREA(0, 128-1, 0, 128-1)
MCFG_GFXDECODE_ADD("gfxdecode", jtces23)
- MCFG_PALETTE_LENGTH(2)
- MCFG_PALETTE_INIT_OVERRIDE(driver_device, black_and_white)
+ MCFG_PALETTE_ADD_BLACK_AND_WHITE("palette")
/* internal ram */
MCFG_RAM_ADD(RAM_TAG)
@@ -810,8 +808,8 @@ static MACHINE_CONFIG_DERIVED_CLASS( jtces40, basic, jtces40_state )
MCFG_SCREEN_VISIBLE_AREA(0, 320-1, 0, 192-1)
MCFG_GFXDECODE_ADD("gfxdecode", jtces40)
- MCFG_PALETTE_LENGTH(16)
- MCFG_PALETTE_INIT_OVERRIDE(jtc_state,jtc_es40)
+ MCFG_PALETTE_ADD("palette", 16)
+ MCFG_PALETTE_INIT_OWNER(jtc_state,jtc_es40)
/* internal ram */
MCFG_RAM_ADD(RAM_TAG)
diff --git a/src/mess/drivers/juicebox.c b/src/mess/drivers/juicebox.c
index e4109406d5c..a47d106ab98 100644
--- a/src/mess/drivers/juicebox.c
+++ b/src/mess/drivers/juicebox.c
@@ -319,7 +319,7 @@ static MACHINE_CONFIG_START( juicebox, juicebox_state )
MCFG_CPU_ADD("maincpu", ARM7, 66000000)
MCFG_CPU_PROGRAM_MAP(juicebox_map)
- MCFG_PALETTE_LENGTH(32768)
+ MCFG_PALETTE_ADD("palette", 32768)
MCFG_SCREEN_ADD("screen", LCD)
MCFG_SCREEN_REFRESH_RATE(60)
diff --git a/src/mess/drivers/jupiter.c b/src/mess/drivers/jupiter.c
index 47fb5f0d241..6601c56edcc 100644
--- a/src/mess/drivers/jupiter.c
+++ b/src/mess/drivers/jupiter.c
@@ -289,8 +289,7 @@ static MACHINE_CONFIG_START( jupiter3, jupiter3_state )
MCFG_SCREEN_UPDATE_DRIVER(jupiter3_state, screen_update)
MCFG_SCREEN_SIZE(512, 320)
MCFG_SCREEN_VISIBLE_AREA(0, 512-1, 0, 320-1)
- MCFG_PALETTE_LENGTH(2)
- MCFG_PALETTE_INIT_OVERRIDE(driver_device, black_and_white)
+ MCFG_PALETTE_ADD_BLACK_AND_WHITE("palette")
// devices
MCFG_FD1771_ADD(INS1771N1_TAG, fdc_intf)
diff --git a/src/mess/drivers/k8915.c b/src/mess/drivers/k8915.c
index bba54b0e1b3..55d405d5205 100644
--- a/src/mess/drivers/k8915.c
+++ b/src/mess/drivers/k8915.c
@@ -167,8 +167,7 @@ static MACHINE_CONFIG_START( k8915, k8915_state )
MCFG_SCREEN_UPDATE_DRIVER(k8915_state, screen_update)
MCFG_SCREEN_SIZE(640, 250)
MCFG_SCREEN_VISIBLE_AREA(0, 639, 0, 249)
- MCFG_PALETTE_LENGTH(2)
- MCFG_PALETTE_INIT_OVERRIDE(driver_device, monochrome_green)
+ MCFG_PALETTE_ADD_MONOCHROME_GREEN("palette")
MCFG_ASCII_KEYBOARD_ADD(KEYBOARD_TAG, keyboard_intf)
MACHINE_CONFIG_END
diff --git a/src/mess/drivers/kaypro.c b/src/mess/drivers/kaypro.c
index 40d03eb17cd..fc7899bcc31 100644
--- a/src/mess/drivers/kaypro.c
+++ b/src/mess/drivers/kaypro.c
@@ -210,8 +210,7 @@ static MACHINE_CONFIG_START( kayproii, kaypro_state )
MCFG_VIDEO_START_OVERRIDE(kaypro_state, kaypro )
MCFG_SCREEN_UPDATE_DRIVER(kaypro_state, screen_update_kayproii)
MCFG_GFXDECODE_ADD("gfxdecode", kayproii)
- MCFG_PALETTE_LENGTH(2)
- MCFG_PALETTE_INIT_OVERRIDE(driver_device, monochrome_green)
+ MCFG_PALETTE_ADD_MONOCHROME_GREEN("palette")
/* sound hardware */
MCFG_SPEAKER_STANDARD_MONO("mono")
@@ -265,8 +264,8 @@ static MACHINE_CONFIG_START( kaypro2x, kaypro_state )
MCFG_VIDEO_START_OVERRIDE(kaypro_state, kaypro )
MCFG_SCREEN_UPDATE_DRIVER(kaypro_state, screen_update_kaypro2x)
MCFG_GFXDECODE_ADD("gfxdecode", kaypro2x)
- MCFG_PALETTE_LENGTH(3)
- MCFG_PALETTE_INIT_OVERRIDE(kaypro_state,kaypro)
+ MCFG_PALETTE_ADD("palette", 3)
+ MCFG_PALETTE_INIT_OWNER(kaypro_state,kaypro)
/* sound hardware */
MCFG_SPEAKER_STANDARD_MONO("mono")
diff --git a/src/mess/drivers/kc.c b/src/mess/drivers/kc.c
index bd5c333d67d..3201cfffdad 100644
--- a/src/mess/drivers/kc.c
+++ b/src/mess/drivers/kc.c
@@ -144,8 +144,8 @@ static MACHINE_CONFIG_START( kc85_3, kc_state )
MCFG_SCREEN_UPDATE_DRIVER(kc_state, screen_update)
MCFG_TIMER_DRIVER_ADD_SCANLINE("scantimer", kc_state, kc_scanline, "screen", 0, 1)
- MCFG_PALETTE_LENGTH(KC85_PALETTE_SIZE)
- MCFG_PALETTE_INIT_OVERRIDE(kc_state, kc85 )
+ MCFG_PALETTE_ADD("palette", KC85_PALETTE_SIZE)
+ MCFG_PALETTE_INIT_OWNER(kc_state, kc85 )
MCFG_KC_KEYBOARD_ADD("keyboard", XTAL_4MHz, kc85_keyboard_interface)
@@ -196,8 +196,8 @@ static MACHINE_CONFIG_START( kc85_4, kc85_4_state )
MCFG_SCREEN_UPDATE_DRIVER(kc85_4_state, screen_update)
MCFG_TIMER_DRIVER_ADD_SCANLINE("scantimer", kc85_4_state, kc_scanline, "screen", 0, 1)
- MCFG_PALETTE_LENGTH(KC85_PALETTE_SIZE)
- MCFG_PALETTE_INIT_OVERRIDE(kc85_4_state, kc85 )
+ MCFG_PALETTE_ADD("palette", KC85_PALETTE_SIZE)
+ MCFG_PALETTE_INIT_OWNER(kc85_4_state, kc85 )
MCFG_KC_KEYBOARD_ADD("keyboard", XTAL_4MHz, kc85_keyboard_interface)
diff --git a/src/mess/drivers/konin.c b/src/mess/drivers/konin.c
index cef7bb4dc02..a47a2158161 100644
--- a/src/mess/drivers/konin.c
+++ b/src/mess/drivers/konin.c
@@ -89,8 +89,7 @@ static MACHINE_CONFIG_START( konin, konin_state )
MCFG_SCREEN_SIZE(640, 480)
MCFG_SCREEN_VISIBLE_AREA(0, 640-1, 0, 480-1)
MCFG_SCREEN_UPDATE_DRIVER(konin_state, screen_update_konin)
- MCFG_PALETTE_LENGTH(2)
- MCFG_PALETTE_INIT_OVERRIDE(driver_device, black_and_white)
+ MCFG_PALETTE_ADD_BLACK_AND_WHITE("palette")
MACHINE_CONFIG_END
/* ROM definition */
diff --git a/src/mess/drivers/korgm1.c b/src/mess/drivers/korgm1.c
index b0145389798..00c96dfcb5d 100644
--- a/src/mess/drivers/korgm1.c
+++ b/src/mess/drivers/korgm1.c
@@ -157,7 +157,7 @@ void korgm1_state::machine_reset()
}
-void korgm1_state::palette_init()
+PALETTE_INIT_MEMBER(korgm1_state, korgm1)
{
}
@@ -179,7 +179,7 @@ static MACHINE_CONFIG_START( korgm1, korgm1_state )
MCFG_GFXDECODE_ADD("gfxdecode", korgm1)
- MCFG_PALETTE_LENGTH(8)
+ MCFG_PALETTE_ADD("palette", 8)
/* sound hardware */
MCFG_SPEAKER_STANDARD_MONO("mono")
diff --git a/src/mess/drivers/kramermc.c b/src/mess/drivers/kramermc.c
index ba8a0fa19de..10c3d39b818 100644
--- a/src/mess/drivers/kramermc.c
+++ b/src/mess/drivers/kramermc.c
@@ -120,10 +120,9 @@ static MACHINE_CONFIG_START( kramermc, kramermc_state )
MCFG_SCREEN_VISIBLE_AREA(0, 64*8-1, 0, 16*8-1)
MCFG_SCREEN_UPDATE_DRIVER(kramermc_state, screen_update_kramermc)
- MCFG_GFXDECODE_ADD("gfxdecode", kramermc )
+ MCFG_GFXDECODE_ADD("gfxdecode", kramermc )
- MCFG_PALETTE_LENGTH(2)
- MCFG_PALETTE_INIT_OVERRIDE(driver_device, black_and_white)
+ MCFG_PALETTE_ADD_BLACK_AND_WHITE("palette")
MACHINE_CONFIG_END
diff --git a/src/mess/drivers/lcmate2.c b/src/mess/drivers/lcmate2.c
index 0f9cf9a9b01..d53bced8526 100644
--- a/src/mess/drivers/lcmate2.c
+++ b/src/mess/drivers/lcmate2.c
@@ -59,7 +59,7 @@ public:
DECLARE_READ8_MEMBER( key_r );
DECLARE_WRITE8_MEMBER( speaker_w );
DECLARE_WRITE8_MEMBER( bankswitch_w );
- virtual void palette_init();
+ DECLARE_PALETTE_INIT(lcmate2);
};
WRITE8_MEMBER( lcmate2_state::speaker_w )
@@ -194,10 +194,10 @@ static INPUT_PORTS_START( lcmate2 )
PORT_BIT(0x80, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_UNUSED
INPUT_PORTS_END
-void lcmate2_state::palette_init()
+PALETTE_INIT_MEMBER(lcmate2_state, lcmate2)
{
- palette_set_color(machine(), 0, rgb_t(138, 146, 148));
- palette_set_color(machine(), 1, rgb_t(92, 83, 88));
+ palette.set_pen_color(0, rgb_t(138, 146, 148));
+ palette.set_pen_color(1, rgb_t(92, 83, 88));
}
void lcmate2_state::machine_start()
@@ -240,7 +240,8 @@ static MACHINE_CONFIG_START( lcmate2, lcmate2_state )
MCFG_SCREEN_UPDATE_DEVICE("hd44780", hd44780_device, screen_update)
MCFG_SCREEN_SIZE(120, 18)
MCFG_SCREEN_VISIBLE_AREA(0, 120-1, 0, 18-1)
- MCFG_PALETTE_LENGTH(2)
+ MCFG_PALETTE_ADD("palette", 2)
+ MCFG_PALETTE_INIT_OWNER(lcmate2_state, lcmate2)
MCFG_DEFAULT_LAYOUT(layout_lcd)
MCFG_GFXDECODE_ADD("gfxdecode", lcmate2)
diff --git a/src/mess/drivers/lisa.c b/src/mess/drivers/lisa.c
index 3f08c546c6b..eeb116acc64 100644
--- a/src/mess/drivers/lisa.c
+++ b/src/mess/drivers/lisa.c
@@ -152,8 +152,7 @@ static MACHINE_CONFIG_START( lisa, lisa_state )
MCFG_SCREEN_VISIBLE_AREA(0, 720-1, 0, 364-1)
MCFG_SCREEN_UPDATE_DRIVER(lisa_state, screen_update_lisa)
- MCFG_PALETTE_LENGTH(2)
- MCFG_PALETTE_INIT_OVERRIDE(driver_device, black_and_white)
+ MCFG_PALETTE_ADD_BLACK_AND_WHITE("palette")
/* sound hardware */
diff --git a/src/mess/drivers/llc.c b/src/mess/drivers/llc.c
index 39573968c98..f6475f15514 100644
--- a/src/mess/drivers/llc.c
+++ b/src/mess/drivers/llc.c
@@ -217,8 +217,7 @@ static MACHINE_CONFIG_START( llc1, llc_state )
MCFG_SCREEN_VISIBLE_AREA(0, 64*8-1, 0, 16*8-1)
MCFG_SCREEN_UPDATE_DRIVER(llc_state, screen_update_llc1)
MCFG_GFXDECODE_ADD("gfxdecode", llc1)
- MCFG_PALETTE_LENGTH(2)
- MCFG_PALETTE_INIT_OVERRIDE(driver_device, black_and_white)
+ MCFG_PALETTE_ADD_BLACK_AND_WHITE("palette")
MCFG_DEFAULT_LAYOUT(layout_llc1)
MCFG_Z80PIO_ADD( "z80pio1", XTAL_3MHz, llc1_z80pio1_intf )
@@ -244,8 +243,7 @@ static MACHINE_CONFIG_START( llc2, llc_state )
MCFG_SCREEN_VISIBLE_AREA(0, 64*8-1, 0, 32*8-1)
MCFG_SCREEN_UPDATE_DRIVER(llc_state, screen_update_llc2)
MCFG_GFXDECODE_ADD("gfxdecode", llc2)
- MCFG_PALETTE_LENGTH(2)
- MCFG_PALETTE_INIT_OVERRIDE(driver_device, black_and_white)
+ MCFG_PALETTE_ADD_BLACK_AND_WHITE("palette")
/* sound hardware */
MCFG_SPEAKER_STANDARD_MONO("mono")
diff --git a/src/mess/drivers/lola8a.c b/src/mess/drivers/lola8a.c
index 6ad1b371811..8a35a4a6ecb 100644
--- a/src/mess/drivers/lola8a.c
+++ b/src/mess/drivers/lola8a.c
@@ -41,7 +41,7 @@ public:
required_device<cpu_device> m_maincpu;
- virtual void palette_init();
+ DECLARE_PALETTE_INIT(lola8a);
virtual void machine_reset() { m_maincpu->set_pc(0x8000); }
DECLARE_READ8_MEMBER(lola8a_port_a_r);
@@ -184,12 +184,12 @@ static INPUT_PORTS_START( lola8a )
INPUT_PORTS_END
-void lola8a_state::palette_init()
+PALETTE_INIT_MEMBER(lola8a_state, lola8a)
{
int i;
for(i=0;i<8;i++) {
- palette_set_color_rgb(machine(), i, pal1bit(i >> 1),pal1bit(i >> 2),pal1bit(i >> 0));
+ palette.set_pen_color(i, pal1bit(i >> 1),pal1bit(i >> 2),pal1bit(i >> 0));
}
}
@@ -300,7 +300,8 @@ static MACHINE_CONFIG_START( lola8a, lola8a_state )
MCFG_SCREEN_SIZE(640, 480)
MCFG_SCREEN_VISIBLE_AREA(0, 640-1, 0, 480-1)
MCFG_MC6845_ADD(HD46505SP_TAG, HD6845, "screen", XTAL_8MHz / 8, hd46505sp_intf) // HD6845 == HD46505S
- MCFG_PALETTE_LENGTH(8)
+ MCFG_PALETTE_ADD("palette", 8)
+ MCFG_PALETTE_INIT_OWNER(lola8a_state, lola8a)
/* Cassette */
MCFG_CASSETTE_ADD( "cassette", default_cassette_interface )
diff --git a/src/mess/drivers/lviv.c b/src/mess/drivers/lviv.c
index e1ba77fed25..b88fc17a612 100644
--- a/src/mess/drivers/lviv.c
+++ b/src/mess/drivers/lviv.c
@@ -447,7 +447,8 @@ static MACHINE_CONFIG_START( lviv, lviv_state )
MCFG_SCREEN_VISIBLE_AREA(0, 256-1, 0, 256-1)
MCFG_SCREEN_UPDATE_DRIVER(lviv_state, screen_update_lviv)
- MCFG_PALETTE_LENGTH(sizeof (lviv_palette) / 3)
+ MCFG_PALETTE_ADD("palette", sizeof (lviv_palette) / 3)
+ MCFG_PALETTE_INIT_OWNER(lviv_state, lviv)
/* sound hardware */
diff --git a/src/mess/drivers/lynx.c b/src/mess/drivers/lynx.c
index cf70ecd2c10..2ed2030acae 100644
--- a/src/mess/drivers/lynx.c
+++ b/src/mess/drivers/lynx.c
@@ -40,13 +40,13 @@ static INPUT_PORTS_START( lynx )
// power on and power off buttons
INPUT_PORTS_END
-void lynx_state::palette_init()
+PALETTE_INIT_MEMBER(lynx_state, lynx)
{
int i;
for (i=0; i< 0x1000; i++)
{
- palette_set_color_rgb(machine(), i,
+ palette.set_pen_color(i,
((i >> 0) & 0x0f) * 0x11,
((i >> 4) & 0x0f) * 0x11,
((i >> 8) & 0x0f) * 0x11);
@@ -87,7 +87,8 @@ static MACHINE_CONFIG_START( lynx, lynx_state )
MCFG_SCREEN_VISIBLE_AREA(0, 160-1, 0, 102-1)
MCFG_DEFAULT_LAYOUT(layout_lynx)
- MCFG_PALETTE_LENGTH(0x1000)
+ MCFG_PALETTE_ADD("palette", 0x1000)
+ MCFG_PALETTE_INIT_OWNER(lynx_state, lynx)
/* sound hardware */
MCFG_SPEAKER_STANDARD_MONO("mono")
diff --git a/src/mess/drivers/m20.c b/src/mess/drivers/m20.c
index ea27d08506a..4b3229caa8c 100644
--- a/src/mess/drivers/m20.c
+++ b/src/mess/drivers/m20.c
@@ -129,7 +129,7 @@ UINT32 m20_state::screen_update_m20(screen_device &screen, bitmap_rgb32 &bitmap,
UINT8 pen;
UINT32 count;
- bitmap.fill(get_black_pen(machine()), cliprect);
+ bitmap.fill(m_palette->black_pen(), cliprect);
count = (0);
@@ -142,7 +142,7 @@ UINT32 m20_state::screen_update_m20(screen_device &screen, bitmap_rgb32 &bitmap,
pen = (m_p_videoram[count]) >> (15 - i) & 1;
if (screen.visible_area().contains(x + i, y))
- bitmap.pix32(y, x + i) = machine().pens[pen];
+ bitmap.pix32(y, x + i) = m_palette->pen(pen);
}
count++;
@@ -935,8 +935,7 @@ static MACHINE_CONFIG_START( m20, m20_state )
MCFG_SCREEN_SIZE(512, 256)
MCFG_SCREEN_VISIBLE_AREA(0, 512-1, 0, 256-1)
MCFG_SCREEN_UPDATE_DRIVER(m20_state, screen_update_m20)
- MCFG_PALETTE_LENGTH(2)
- MCFG_PALETTE_INIT_OVERRIDE(driver_device, black_and_white)
+ MCFG_PALETTE_ADD_BLACK_AND_WHITE("palette")
/* Devices */
MCFG_FD1797x_ADD("fd1797", 1000000)
diff --git a/src/mess/drivers/m79152pc.c b/src/mess/drivers/m79152pc.c
index d738d4b5d82..c54629b210d 100644
--- a/src/mess/drivers/m79152pc.c
+++ b/src/mess/drivers/m79152pc.c
@@ -123,8 +123,7 @@ static MACHINE_CONFIG_START( m79152pc, m79152pc_state )
MCFG_SCREEN_VISIBLE_AREA(0, 640-1, 0, 300-1)
MCFG_SCREEN_UPDATE_DRIVER(m79152pc_state, screen_update_m79152pc)
MCFG_GFXDECODE_ADD("gfxdecode", m79152pc)
- MCFG_PALETTE_LENGTH(2)
- MCFG_PALETTE_INIT_OVERRIDE(driver_device, black_and_white)
+ MCFG_PALETTE_ADD_BLACK_AND_WHITE("palette")
MACHINE_CONFIG_END
/* ROM definition */
diff --git a/src/mess/drivers/mac.c b/src/mess/drivers/mac.c
index de2cb1c7c61..d225011faf8 100644
--- a/src/mess/drivers/mac.c
+++ b/src/mess/drivers/mac.c
@@ -135,14 +135,14 @@ WRITE32_MEMBER( mac_state::rbv_ramdac_w )
// Color Classic has no MONTYPE so the default gets us 512x384, which is right
if ((m_montype ? m_montype->read() : 2) == 1)
{
- palette_set_color(space.machine(), m_rbv_clutoffs, rgb_t(m_rbv_colors[2], m_rbv_colors[2], m_rbv_colors[2]));
+ m_palette->set_pen_color(m_rbv_clutoffs, rgb_t(m_rbv_colors[2], m_rbv_colors[2], m_rbv_colors[2]));
m_rbv_palette[m_rbv_clutoffs] = rgb_t(m_rbv_colors[2], m_rbv_colors[2], m_rbv_colors[2]);
m_rbv_clutoffs++;
m_rbv_count = 0;
}
else
{
- palette_set_color(space.machine(), m_rbv_clutoffs, rgb_t(m_rbv_colors[0], m_rbv_colors[1], m_rbv_colors[2]));
+ m_palette->set_pen_color(m_rbv_clutoffs, rgb_t(m_rbv_colors[0], m_rbv_colors[1], m_rbv_colors[2]));
m_rbv_palette[m_rbv_clutoffs] = rgb_t(m_rbv_colors[0], m_rbv_colors[1], m_rbv_colors[2]);
m_rbv_clutoffs++;
m_rbv_count = 0;
@@ -171,14 +171,14 @@ WRITE32_MEMBER( mac_state::ariel_ramdac_w ) // this is for the "Ariel" style RAM
// Color Classic has no MONTYPE so the default gets us 512x384, which is right
if ((m_montype ? m_montype->read() : 2) == 1)
{
- palette_set_color(space.machine(), m_rbv_clutoffs, rgb_t(m_rbv_colors[2], m_rbv_colors[2], m_rbv_colors[2]));
+ m_palette->set_pen_color(m_rbv_clutoffs, rgb_t(m_rbv_colors[2], m_rbv_colors[2], m_rbv_colors[2]));
m_rbv_palette[m_rbv_clutoffs] = rgb_t(m_rbv_colors[2], m_rbv_colors[2], m_rbv_colors[2]);
m_rbv_clutoffs++;
m_rbv_count = 0;
}
else
{
- palette_set_color(space.machine(), m_rbv_clutoffs, rgb_t(m_rbv_colors[0], m_rbv_colors[1], m_rbv_colors[2]));
+ m_palette->set_pen_color(m_rbv_clutoffs, rgb_t(m_rbv_colors[0], m_rbv_colors[1], m_rbv_colors[2]));
m_rbv_palette[m_rbv_clutoffs] = rgb_t(m_rbv_colors[0], m_rbv_colors[1], m_rbv_colors[2]);
m_rbv_clutoffs++;
m_rbv_count = 0;
@@ -934,8 +934,8 @@ static MACHINE_CONFIG_START( mac512ke, mac_state )
MCFG_SCREEN_VISIBLE_AREA(0, MAC_H_VIS-1, 0, MAC_V_VIS-1)
MCFG_SCREEN_UPDATE_DRIVER(mac_state, screen_update_mac)
- MCFG_PALETTE_LENGTH(2)
- MCFG_PALETTE_INIT_OVERRIDE(mac_state,mac)
+ MCFG_PALETTE_ADD("palette", 2)
+ MCFG_PALETTE_INIT_OWNER(mac_state,mac)
MCFG_VIDEO_START_OVERRIDE(mac_state,mac)
@@ -1059,8 +1059,8 @@ static MACHINE_CONFIG_START( macprtb, mac_state )
MCFG_SCREEN_VISIBLE_AREA(0, 639, 0, 399)
MCFG_SCREEN_UPDATE_DRIVER(mac_state, screen_update_macprtb)
- MCFG_PALETTE_LENGTH(2)
- MCFG_PALETTE_INIT_OVERRIDE(mac_state,mac)
+ MCFG_PALETTE_ADD("palette", 2)
+ MCFG_PALETTE_INIT_OWNER(mac_state,mac)
MCFG_VIDEO_START_OVERRIDE(mac_state,macprtb)
@@ -1104,7 +1104,7 @@ static MACHINE_CONFIG_START( macii, mac_state )
MCFG_CPU_ADD("maincpu", M68020PMMU, C15M)
MCFG_CPU_PROGRAM_MAP(macii_map)
- MCFG_PALETTE_LENGTH(256)
+ MCFG_PALETTE_ADD("palette", 256)
/* sound hardware */
MCFG_SPEAKER_STANDARD_STEREO("lspeaker", "rspeaker")
@@ -1219,7 +1219,8 @@ static MACHINE_CONFIG_DERIVED( maclc, macii )
MCFG_CPU_PROGRAM_MAP(maclc_map)
MCFG_CPU_VBLANK_INT_DRIVER(MAC_SCREEN_NAME, mac_state, mac_rbv_vbl)
- MCFG_PALETTE_LENGTH(256)
+ MCFG_DEVICE_REMOVE("palette")
+ MCFG_PALETTE_ADD("palette", 256)
MCFG_VIDEO_START_OVERRIDE(mac_state,macv8)
MCFG_VIDEO_RESET_OVERRIDE(mac_state,macrbv)
@@ -1411,8 +1412,8 @@ static MACHINE_CONFIG_START( macse30, mac_state )
MCFG_SCREEN_VISIBLE_AREA(0, MAC_H_VIS-1, 0, MAC_V_VIS-1)
MCFG_SCREEN_UPDATE_DRIVER(mac_state, screen_update_macse30)
- MCFG_PALETTE_LENGTH(2)
- MCFG_PALETTE_INIT_OVERRIDE(mac_state,mac)
+ MCFG_PALETTE_ADD("palette", 2)
+ MCFG_PALETTE_INIT_OWNER(mac_state,mac)
MCFG_VIDEO_START_OVERRIDE(mac_state,mac)
@@ -1475,8 +1476,8 @@ static MACHINE_CONFIG_START( macpb140, mac_state )
MCFG_SCREEN_VISIBLE_AREA(0, 639, 0, 399)
MCFG_SCREEN_UPDATE_DRIVER(mac_state, screen_update_macpb140)
- MCFG_PALETTE_LENGTH(2)
- MCFG_PALETTE_INIT_OVERRIDE(mac_state,mac)
+ MCFG_PALETTE_ADD("palette", 2)
+ MCFG_PALETTE_INIT_OWNER(mac_state,mac)
MCFG_VIDEO_START_OVERRIDE(mac_state,macprtb)
@@ -1555,8 +1556,8 @@ static MACHINE_CONFIG_START( macpb160, mac_state )
MCFG_SCREEN_VISIBLE_AREA(0, 639, 0, 399)
MCFG_SCREEN_UPDATE_DRIVER(mac_state, screen_update_macpb160)
- MCFG_PALETTE_LENGTH(16)
- MCFG_PALETTE_INIT_OVERRIDE(mac_state,macgsc)
+ MCFG_PALETTE_ADD("palette", 16)
+ MCFG_PALETTE_INIT_OWNER(mac_state,macgsc)
MCFG_VIDEO_START_OVERRIDE(mac_state,macprtb)
@@ -1667,7 +1668,8 @@ static MACHINE_CONFIG_DERIVED( maciici, macii )
MCFG_CPU_PROGRAM_MAP(maciici_map)
MCFG_CPU_VBLANK_INT_DRIVER(MAC_SCREEN_NAME, mac_state, mac_rbv_vbl)
- MCFG_PALETTE_LENGTH(256)
+ MCFG_DEVICE_REMOVE("palette")
+ MCFG_PALETTE_ADD("palette", 256)
// IIci only has slots c/d/e
MCFG_NUBUS_SLOT_REMOVE("nb9")
@@ -1696,7 +1698,8 @@ static MACHINE_CONFIG_DERIVED( maciisi, macii )
MCFG_CPU_PROGRAM_MAP(maciici_map)
MCFG_CPU_VBLANK_INT_DRIVER(MAC_SCREEN_NAME, mac_state, mac_rbv_vbl)
- MCFG_PALETTE_LENGTH(256)
+ MCFG_DEVICE_REMOVE("palette")
+ MCFG_PALETTE_ADD("palette", 256)
MCFG_NUBUS_SLOT_REMOVE("nb9")
MCFG_NUBUS_SLOT_REMOVE("nba")
@@ -1747,7 +1750,7 @@ static MACHINE_CONFIG_START( pwrmac, mac_state )
MCFG_SCREEN_VISIBLE_AREA(0, 640-1, 0, 480-1)
MCFG_SCREEN_UPDATE_DRIVER(mac_state, screen_update_macrbv)
- MCFG_PALETTE_LENGTH(256)
+ MCFG_PALETTE_ADD("palette", 256)
MCFG_VIDEO_START_OVERRIDE(mac_state,macsonora)
MCFG_VIDEO_RESET_OVERRIDE(mac_state,macrbv)
@@ -1811,7 +1814,7 @@ static MACHINE_CONFIG_START( macqd700, mac_state )
MCFG_VIDEO_START_OVERRIDE(mac_state,macdafb)
MCFG_VIDEO_RESET_OVERRIDE(mac_state,macdafb)
- MCFG_PALETTE_LENGTH(256)
+ MCFG_PALETTE_ADD("palette", 256)
/* sound hardware */
MCFG_SPEAKER_STANDARD_STEREO("lspeaker", "rspeaker")
diff --git a/src/mess/drivers/macpci.c b/src/mess/drivers/macpci.c
index 94f5edd49dd..af1e2e10ba1 100644
--- a/src/mess/drivers/macpci.c
+++ b/src/mess/drivers/macpci.c
@@ -105,8 +105,7 @@ static MACHINE_CONFIG_START( pippin, macpci_state )
MCFG_SCREEN_VISIBLE_AREA(0, 640-1, 0, 480-1)
MCFG_SCREEN_UPDATE_DRIVER(macpci_state, screen_update_pippin)
- MCFG_PALETTE_LENGTH(2)
- MCFG_PALETTE_INIT_OVERRIDE(driver_device, black_and_white)
+ MCFG_PALETTE_ADD_BLACK_AND_WHITE("palette")
/* sound hardware */
MCFG_SPEAKER_STANDARD_STEREO("lspeaker", "rspeaker")
diff --git a/src/mess/drivers/mbc200.c b/src/mess/drivers/mbc200.c
index 1cd82c5958a..95f12ffb90f 100644
--- a/src/mess/drivers/mbc200.c
+++ b/src/mess/drivers/mbc200.c
@@ -175,7 +175,7 @@ UINT32 mbc200_state::screen_update_mbc200(screen_device &screen, bitmap_ind16 &b
dot = (m_vram[count] >> (7-xi)) & 1;
if(y*4+yi < 400 && x*8+xi < 640) /* TODO: safety check */
- bitmap.pix16(y*4+yi, x*8+xi) = machine().pens[dot];
+ bitmap.pix16(y*4+yi, x*8+xi) = m_palette->pen(dot);
}
count++;
@@ -270,8 +270,7 @@ static MACHINE_CONFIG_START( mbc200, mbc200_state )
MCFG_SCREEN_VISIBLE_AREA(0, 640-1, 0, 400-1)
MCFG_SCREEN_UPDATE_DRIVER(mbc200_state, screen_update_mbc200)
MCFG_GFXDECODE_ADD("gfxdecode", mbc200)
- MCFG_PALETTE_LENGTH(2)
- MCFG_PALETTE_INIT_OVERRIDE(driver_device, black_and_white)
+ MCFG_PALETTE_ADD_BLACK_AND_WHITE("palette")
MCFG_MC6845_ADD("crtc", H46505, "screen", XTAL_8MHz / 4, mbc200_crtc) // HD46505SP
diff --git a/src/mess/drivers/mbc55x.c b/src/mess/drivers/mbc55x.c
index c274b2e9978..0d1ccfe1312 100644
--- a/src/mess/drivers/mbc55x.c
+++ b/src/mess/drivers/mbc55x.c
@@ -217,14 +217,14 @@ static INPUT_PORTS_START( mbc55x )
INPUT_PORTS_END
-void mbc55x_state::palette_init()
+PALETTE_INIT_MEMBER(mbc55x_state, mbc55x)
{
int colourno;
logerror("initializing palette\n");
for ( colourno = 0; colourno < SCREEN_NO_COLOURS; colourno++ )
- palette_set_color_rgb(machine(), colourno, mbc55x_palette[colourno][RED], mbc55x_palette[colourno][GREEN], mbc55x_palette[colourno][BLUE]);
+ palette.set_pen_color(colourno, mbc55x_palette[colourno][RED], mbc55x_palette[colourno][GREEN], mbc55x_palette[colourno][BLUE]);
}
@@ -241,8 +241,8 @@ static MACHINE_CONFIG_START( mbc55x, mbc55x_state )
MCFG_SCREEN_UPDATE_DEVICE(VID_MC6845_NAME, mc6845_device, screen_update)
MCFG_SCREEN_VBLANK_DRIVER(mbc55x_state, screen_eof_mbc55x)
- MCFG_PALETTE_LENGTH(SCREEN_NO_COLOURS * 3)
-
+ MCFG_PALETTE_ADD("palette", SCREEN_NO_COLOURS * 3)
+ MCFG_PALETTE_INIT_OWNER(mbc55x_state, mbc55x)
// MCFG_SCREEN_SIZE(650, 260)
// MCFG_SCREEN_VISIBLE_AREA(0, 639, 0, 249)
diff --git a/src/mess/drivers/mbee.c b/src/mess/drivers/mbee.c
index d41975bfbad..decf02c7f55 100644
--- a/src/mess/drivers/mbee.c
+++ b/src/mess/drivers/mbee.c
@@ -749,8 +749,7 @@ static MACHINE_CONFIG_START( mbee, mbee_state )
MCFG_SCREEN_UPDATE_DRIVER(mbee_state, screen_update_mbee)
MCFG_GFXDECODE_ADD("gfxdecode", mbee)
- MCFG_PALETTE_LENGTH(2)
- MCFG_PALETTE_INIT_OVERRIDE(driver_device, monochrome_amber) // usually sold with amber or green monitor
+ MCFG_PALETTE_ADD_MONOCHROME_AMBER("palette") // usually sold with amber or green monitor
MCFG_VIDEO_START_OVERRIDE(mbee_state,mbee)
@@ -794,8 +793,9 @@ static MACHINE_CONFIG_START( mbeeic, mbee_state )
MCFG_SCREEN_UPDATE_DRIVER(mbee_state, screen_update_mbee)
MCFG_GFXDECODE_ADD("gfxdecode", mbeeic)
- MCFG_PALETTE_LENGTH(96)
- MCFG_PALETTE_INIT_OVERRIDE(mbee_state,mbeeic)
+
+ MCFG_PALETTE_ADD("palette", 96)
+ MCFG_PALETTE_INIT_OWNER(mbee_state,mbeeic)
MCFG_VIDEO_START_OVERRIDE(mbee_state,mbeeic)
@@ -831,7 +831,8 @@ static MACHINE_CONFIG_DERIVED( mbeepc85, mbeeic )
MACHINE_CONFIG_END
static MACHINE_CONFIG_DERIVED( mbeepc85b, mbeepc85 )
- MCFG_PALETTE_INIT_OVERRIDE(mbee_state,mbeepc85b)
+ MCFG_PALETTE_MODIFY("palette")
+ MCFG_PALETTE_INIT_OWNER(mbee_state,mbeepc85b)
MACHINE_CONFIG_END
static MACHINE_CONFIG_DERIVED( mbeeppc, mbeeic )
@@ -840,8 +841,9 @@ static MACHINE_CONFIG_DERIVED( mbeeppc, mbeeic )
MCFG_CPU_IO_MAP(mbeeppc_io)
MCFG_VIDEO_START_OVERRIDE(mbee_state,mbeeppc)
MCFG_GFXDECODE_MODIFY("gfxdecode", mbeeppc)
- MCFG_PALETTE_LENGTH(16)
- MCFG_PALETTE_INIT_OVERRIDE(mbee_state,mbeeppc)
+ MCFG_DEVICE_REMOVE("palette")
+ MCFG_PALETTE_ADD("palette", 16)
+ MCFG_PALETTE_INIT_OWNER(mbee_state,mbeeppc)
MCFG_DEVICE_REMOVE("crtc")
MCFG_MC6845_ADD("crtc", SY6545_1, "screen", XTAL_13_5MHz / 8, mbeeppc_crtc)
MACHINE_CONFIG_END
diff --git a/src/mess/drivers/mc10.c b/src/mess/drivers/mc10.c
index 548e5261d6d..8881f623a6c 100644
--- a/src/mess/drivers/mc10.c
+++ b/src/mess/drivers/mc10.c
@@ -541,7 +541,7 @@ static MACHINE_CONFIG_START( alice32, mc10_state )
MCFG_SCREEN_UPDATE_DEVICE("ef9345", ef9345_device, screen_update)
MCFG_SCREEN_SIZE(336, 270)
MCFG_SCREEN_VISIBLE_AREA(00, 336-1, 00, 270-1)
- MCFG_PALETTE_LENGTH(8)
+ MCFG_PALETTE_ADD("palette", 8)
MCFG_EF9345_ADD("ef9345", "screen")
MCFG_TIMER_DRIVER_ADD_SCANLINE("alice32_sl", mc10_state, alice32_scanline, "screen", 0, 10)
diff --git a/src/mess/drivers/mc80.c b/src/mess/drivers/mc80.c
index fbcd9d464ef..f0ffa655137 100644
--- a/src/mess/drivers/mc80.c
+++ b/src/mess/drivers/mc80.c
@@ -173,8 +173,7 @@ static MACHINE_CONFIG_START( mc8020, mc80_state )
MCFG_SCREEN_VISIBLE_AREA(0, 32*6-1, 0, 16*8-1)
MCFG_VIDEO_START_OVERRIDE(mc80_state,mc8020)
MCFG_SCREEN_UPDATE_DRIVER(mc80_state, screen_update_mc8020)
- MCFG_PALETTE_LENGTH(2)
- MCFG_PALETTE_INIT_OVERRIDE(driver_device, black_and_white)
+ MCFG_PALETTE_ADD_BLACK_AND_WHITE("palette")
/* Devices */
MCFG_Z80PIO_ADD( "z80pio", XTAL_2_4576MHz, mc8020_z80pio_intf )
@@ -199,8 +198,7 @@ static MACHINE_CONFIG_START( mc8030, mc80_state )
MCFG_SCREEN_VISIBLE_AREA(0, 512-1, 0, 256-1)
MCFG_VIDEO_START_OVERRIDE(mc80_state,mc8030)
MCFG_SCREEN_UPDATE_DRIVER(mc80_state, screen_update_mc8030)
- MCFG_PALETTE_LENGTH(2)
- MCFG_PALETTE_INIT_OVERRIDE(driver_device, black_and_white)
+ MCFG_PALETTE_ADD_BLACK_AND_WHITE("palette")
/* Devices */
MCFG_Z80PIO_ADD( "zve_pio", XTAL_2_4576MHz, mc8030_zve_z80pio_intf )
diff --git a/src/mess/drivers/megadriv.c b/src/mess/drivers/megadriv.c
index 4d1aeda9726..3d8c2ad4a9c 100644
--- a/src/mess/drivers/megadriv.c
+++ b/src/mess/drivers/megadriv.c
@@ -504,6 +504,7 @@ static MACHINE_CONFIG_START( genesis_32x, md_cons_state )
MCFG_MACHINE_RESET_OVERRIDE( md_cons_state, ms_megadriv )
MCFG_DEVICE_ADD("sega32x", SEGA_32X_NTSC, 0)
+ MCFG_SEGA_32X_PALETTE("gen_vdp:palette")
// we need to remove and re-add the sound system because the balance is different
// due to MAME / MESS having severe issues if the dac output is > 0.40? (sound is corrupted even if DAC is slient?!)
@@ -537,6 +538,7 @@ static MACHINE_CONFIG_START( mdj_32x, md_cons_state )
MCFG_MACHINE_RESET_OVERRIDE( md_cons_state, ms_megadriv )
MCFG_DEVICE_ADD("sega32x", SEGA_32X_NTSC, 0)
+ MCFG_SEGA_32X_PALETTE("gen_vdp:palette")
// we need to remove and re-add the sound system because the balance is different
// due to MAME / MESS having severe issues if the dac output is > 0.40? (sound is corrupted even if DAC is slient?!)
@@ -570,6 +572,7 @@ static MACHINE_CONFIG_START( md_32x, md_cons_state )
MCFG_MACHINE_RESET_OVERRIDE( md_cons_state, ms_megadriv )
MCFG_DEVICE_ADD("sega32x", SEGA_32X_PAL, 0)
+ MCFG_SEGA_32X_PALETTE("gen_vdp:palette")
// we need to remove and re-add the sound system because the balance is different
// due to MAME / MESS having severe issues if the dac output is > 0.40? (sound is corrupted even if DAC is slient?!)
@@ -645,6 +648,7 @@ static MACHINE_CONFIG_START( genesis_scd, md_cons_state )
MCFG_SEGACD_GFXDECODE("gfxdecode")
MCFG_GFXDECODE_ADD("gfxdecode", empty)
+
MCFG_CDROM_ADD( "cdrom",scd_cdrom )
MCFG_SOFTWARE_LIST_ADD("cd_list","segacd")
diff --git a/src/mess/drivers/mes.c b/src/mess/drivers/mes.c
index e89e1bc8f63..5a9586eea84 100644
--- a/src/mess/drivers/mes.c
+++ b/src/mess/drivers/mes.c
@@ -116,8 +116,7 @@ static MACHINE_CONFIG_START( mes, mes_state )
MCFG_SCREEN_UPDATE_DRIVER(mes_state, screen_update)
MCFG_SCREEN_SIZE(640, 250)
MCFG_SCREEN_VISIBLE_AREA(0, 639, 0, 249)
- MCFG_PALETTE_LENGTH(2)
- MCFG_PALETTE_INIT_OVERRIDE(driver_device, black_and_white)
+ MCFG_PALETTE_ADD_BLACK_AND_WHITE("palette")
MACHINE_CONFIG_END
diff --git a/src/mess/drivers/micronic.c b/src/mess/drivers/micronic.c
index d8bc980a50d..0c2807ec451 100644
--- a/src/mess/drivers/micronic.c
+++ b/src/mess/drivers/micronic.c
@@ -324,10 +324,10 @@ static NVRAM_HANDLER( micronic )
}
}
-void micronic_state::palette_init()
+PALETTE_INIT_MEMBER(micronic_state, micronic)
{
- palette_set_color(machine(), 0, rgb_t(138, 146, 148));
- palette_set_color(machine(), 1, rgb_t(92, 83, 88));
+ palette.set_pen_color(0, rgb_t(138, 146, 148));
+ palette.set_pen_color(1, rgb_t(92, 83, 88));
}
static HD61830_INTERFACE( lcdc_intf )
@@ -376,7 +376,8 @@ static MACHINE_CONFIG_START( micronic, micronic_state )
MCFG_DEFAULT_LAYOUT(layout_lcd)
- MCFG_PALETTE_LENGTH(2)
+ MCFG_PALETTE_ADD("palette", 2)
+ MCFG_PALETTE_INIT_OWNER(micronic_state, micronic)
MCFG_HD61830_ADD(HD61830_TAG, XTAL_4_9152MHz/2/2, lcdc_intf)
diff --git a/src/mess/drivers/microtan.c b/src/mess/drivers/microtan.c
index b49e18154d8..421b0c9ac75 100644
--- a/src/mess/drivers/microtan.c
+++ b/src/mess/drivers/microtan.c
@@ -230,9 +230,8 @@ static MACHINE_CONFIG_START( microtan, microtan_state )
MCFG_SCREEN_UPDATE_DRIVER(microtan_state, screen_update_microtan)
MCFG_GFXDECODE_ADD("gfxdecode", microtan)
- MCFG_PALETTE_LENGTH(2)
- MCFG_PALETTE_INIT_OVERRIDE(driver_device, black_and_white)
+ MCFG_PALETTE_ADD_BLACK_AND_WHITE("palette")
/* sound hardware */
MCFG_SPEAKER_STANDARD_MONO("mono")
diff --git a/src/mess/drivers/microvsn.c b/src/mess/drivers/microvsn.c
index 62b5cf71e40..ac56206472a 100644
--- a/src/mess/drivers/microvsn.c
+++ b/src/mess/drivers/microvsn.c
@@ -115,22 +115,22 @@ protected:
PALETTE_INIT_MEMBER(microvision_state,microvision)
{
- palette_set_color_rgb( machine(), 15, 0x00, 0x00, 0x00 );
- palette_set_color_rgb( machine(), 14, 0x11, 0x11, 0x11 );
- palette_set_color_rgb( machine(), 13, 0x22, 0x22, 0x22 );
- palette_set_color_rgb( machine(), 12, 0x33, 0x33, 0x33 );
- palette_set_color_rgb( machine(), 11, 0x44, 0x44, 0x44 );
- palette_set_color_rgb( machine(), 10, 0x55, 0x55, 0x55 );
- palette_set_color_rgb( machine(), 9, 0x66, 0x66, 0x66 );
- palette_set_color_rgb( machine(), 8, 0x77, 0x77, 0x77 );
- palette_set_color_rgb( machine(), 7, 0x88, 0x88, 0x88 );
- palette_set_color_rgb( machine(), 6, 0x99, 0x99, 0x99 );
- palette_set_color_rgb( machine(), 5, 0xaa, 0xaa, 0xaa );
- palette_set_color_rgb( machine(), 4, 0xbb, 0xbb, 0xbb );
- palette_set_color_rgb( machine(), 3, 0xcc, 0xcc, 0xcc );
- palette_set_color_rgb( machine(), 2, 0xdd, 0xdd, 0xdd );
- palette_set_color_rgb( machine(), 1, 0xee, 0xee, 0xee );
- palette_set_color_rgb( machine(), 0, 0xff, 0xff, 0xff );
+ palette.set_pen_color( 15, 0x00, 0x00, 0x00 );
+ palette.set_pen_color( 14, 0x11, 0x11, 0x11 );
+ palette.set_pen_color( 13, 0x22, 0x22, 0x22 );
+ palette.set_pen_color( 12, 0x33, 0x33, 0x33 );
+ palette.set_pen_color( 11, 0x44, 0x44, 0x44 );
+ palette.set_pen_color( 10, 0x55, 0x55, 0x55 );
+ palette.set_pen_color( 9, 0x66, 0x66, 0x66 );
+ palette.set_pen_color( 8, 0x77, 0x77, 0x77 );
+ palette.set_pen_color( 7, 0x88, 0x88, 0x88 );
+ palette.set_pen_color( 6, 0x99, 0x99, 0x99 );
+ palette.set_pen_color( 5, 0xaa, 0xaa, 0xaa );
+ palette.set_pen_color( 4, 0xbb, 0xbb, 0xbb );
+ palette.set_pen_color( 3, 0xcc, 0xcc, 0xcc );
+ palette.set_pen_color( 2, 0xdd, 0xdd, 0xdd );
+ palette.set_pen_color( 1, 0xee, 0xee, 0xee );
+ palette.set_pen_color( 0, 0xff, 0xff, 0xff );
}
@@ -655,8 +655,8 @@ static MACHINE_CONFIG_START( microvision, microvision_state )
MCFG_SCREEN_SIZE(16, 16)
MCFG_SCREEN_VISIBLE_AREA(0, 15, 0, 15)
- MCFG_PALETTE_LENGTH(16)
- MCFG_PALETTE_INIT_OVERRIDE(microvision_state,microvision)
+ MCFG_PALETTE_ADD("palette", 16)
+ MCFG_PALETTE_INIT_OWNER(microvision_state,microvision)
MCFG_DEFAULT_LAYOUT(layout_lcd)
diff --git a/src/mess/drivers/mikro80.c b/src/mess/drivers/mikro80.c
index 0e3282fcbad..9a2a2850308 100644
--- a/src/mess/drivers/mikro80.c
+++ b/src/mess/drivers/mikro80.c
@@ -184,8 +184,7 @@ static MACHINE_CONFIG_START( mikro80, mikro80_state )
MCFG_SCREEN_UPDATE_DRIVER(mikro80_state, screen_update_mikro80)
MCFG_GFXDECODE_ADD("gfxdecode", mikro80)
- MCFG_PALETTE_LENGTH(2)
- MCFG_PALETTE_INIT_OVERRIDE(driver_device, black_and_white)
+ MCFG_PALETTE_ADD_BLACK_AND_WHITE("palette")
MCFG_SPEAKER_STANDARD_MONO("mono")
diff --git a/src/mess/drivers/mikrosha.c b/src/mess/drivers/mikrosha.c
index ea5faea7473..cd073eebab1 100644
--- a/src/mess/drivers/mikrosha.c
+++ b/src/mess/drivers/mikrosha.c
@@ -202,8 +202,8 @@ static MACHINE_CONFIG_START( mikrosha, mikrosha_state )
MCFG_SCREEN_VISIBLE_AREA(0, 78*6-1, 0, 30*10-1)
MCFG_GFXDECODE_ADD("gfxdecode", mikrosha)
- MCFG_PALETTE_LENGTH(3)
- MCFG_PALETTE_INIT_OVERRIDE(mikrosha_state,radio86)
+ MCFG_PALETTE_ADD("palette", 3)
+ MCFG_PALETTE_INIT_OWNER(mikrosha_state,radio86)
MCFG_SPEAKER_STANDARD_MONO("mono")
MCFG_SOUND_WAVE_ADD(WAVE_TAG, "cassette")
diff --git a/src/mess/drivers/mini2440.c b/src/mess/drivers/mini2440.c
index 5925590f9d1..74df2b7a05f 100644
--- a/src/mess/drivers/mini2440.c
+++ b/src/mess/drivers/mini2440.c
@@ -235,7 +235,7 @@ static MACHINE_CONFIG_START( mini2440, mini2440_state )
MCFG_CPU_ADD("maincpu", ARM920T, 400000000)
MCFG_CPU_PROGRAM_MAP(mini2440_map)
- MCFG_PALETTE_LENGTH(32768)
+ MCFG_PALETTE_ADD("palette", 32768)
MCFG_SCREEN_ADD("screen", LCD)
MCFG_SCREEN_REFRESH_RATE(60)
@@ -253,7 +253,7 @@ static MACHINE_CONFIG_START( mini2440, mini2440_state )
MCFG_SOUND_ADD("dac2", DAC, 0)
MCFG_SOUND_ROUTE(ALL_OUTPUTS, "rspeaker", 1.0)
- MCFG_S3C2440_ADD("s3c2440", 12000000, mini2440_s3c2440_intf)
+ MCFG_S3C2440_ADD("s3c2440", 12000000, mini2440_s3c2440_intf, "palette")
MCFG_NAND_ADD("nand", mini2440_nand_intf)
MACHINE_CONFIG_END
diff --git a/src/mess/drivers/mk85.c b/src/mess/drivers/mk85.c
index 904bf54af63..dc5ffa142da 100644
--- a/src/mess/drivers/mk85.c
+++ b/src/mess/drivers/mk85.c
@@ -73,8 +73,7 @@ static MACHINE_CONFIG_START( mk85, mk85_state )
MCFG_SCREEN_SIZE(640, 480)
MCFG_SCREEN_VISIBLE_AREA(0, 640-1, 0, 480-1)
MCFG_SCREEN_UPDATE_DRIVER(mk85_state, screen_update_mk85)
- MCFG_PALETTE_LENGTH(2)
- MCFG_PALETTE_INIT_OVERRIDE(driver_device, black_and_white)
+ MCFG_PALETTE_ADD_BLACK_AND_WHITE("palette")
MACHINE_CONFIG_END
/* ROM definition */
diff --git a/src/mess/drivers/mk90.c b/src/mess/drivers/mk90.c
index 6725d67c670..875588140fc 100644
--- a/src/mess/drivers/mk90.c
+++ b/src/mess/drivers/mk90.c
@@ -78,8 +78,7 @@ static MACHINE_CONFIG_START( mk90, mk90_state )
MCFG_SCREEN_SIZE(640, 480)
MCFG_SCREEN_VISIBLE_AREA(0, 640-1, 0, 480-1)
MCFG_SCREEN_UPDATE_DRIVER(mk90_state, screen_update_mk90)
- MCFG_PALETTE_LENGTH(2)
- MCFG_PALETTE_INIT_OVERRIDE(driver_device, black_and_white)
+ MCFG_PALETTE_ADD_BLACK_AND_WHITE("palette")
MACHINE_CONFIG_END
/* ROM definition */
diff --git a/src/mess/drivers/mmodular.c b/src/mess/drivers/mmodular.c
index b4a13af50b8..20f3169922c 100644
--- a/src/mess/drivers/mmodular.c
+++ b/src/mess/drivers/mmodular.c
@@ -1077,9 +1077,9 @@ MACHINE_RESET_MEMBER(polgar_state,academy)
PALETTE_INIT_MEMBER(polgar_state,chess_lcd)
{
- // palette_set_color(machine(), 0, rgb_t(138, 146, 148)); // some think this is closer, but slightly less readable
- palette_set_color(machine(), 0, rgb_t(255, 255, 255));
- palette_set_color(machine(), 1, rgb_t(0, 0, 0));
+ // palette.set_pen_color(0, rgb_t(138, 146, 148)); // some think this is closer, but slightly less readable
+ palette.set_pen_color(0, rgb_t(255, 255, 255));
+ palette.set_pen_color(1, rgb_t(0, 0, 0));
}
static const gfx_layout chess_charlayout =
@@ -1521,8 +1521,8 @@ static MACHINE_CONFIG_FRAGMENT ( chess_common )
MCFG_SCREEN_SIZE(100, 22)
MCFG_SCREEN_VISIBLE_AREA(0, 100-1, 0, 22-3)
MCFG_SCREEN_UPDATE_DEVICE("hd44780", hd44780_device, screen_update)
- MCFG_PALETTE_LENGTH(2)
- MCFG_PALETTE_INIT_OVERRIDE(polgar_state,chess_lcd)
+ MCFG_PALETTE_ADD("palette", 2)
+ MCFG_PALETTE_INIT_OWNER(polgar_state,chess_lcd)
MCFG_QUANTUM_TIME(attotime::from_hz(60))
MCFG_GFXDECODE_ADD("gfxdecode", chess_lcd)
diff --git a/src/mess/drivers/modellot.c b/src/mess/drivers/modellot.c
index 8b282b2dc39..e6a146926c9 100644
--- a/src/mess/drivers/modellot.c
+++ b/src/mess/drivers/modellot.c
@@ -166,10 +166,9 @@ static MACHINE_CONFIG_START( modellot, modellot_state )
MCFG_SCREEN_SIZE(64*8, 16*16)
MCFG_SCREEN_VISIBLE_AREA(0, 64*8-1, 0, 16*16-1)
MCFG_SCREEN_UPDATE_DRIVER(modellot_state, screen_update_modellot)
- MCFG_GFXDECODE_ADD("gfxdecode", modellot )
- MCFG_PALETTE_LENGTH(2)
- MCFG_PALETTE_INIT_OVERRIDE(driver_device, monochrome_green)
-
+ MCFG_GFXDECODE_ADD("gfxdecode", modellot )
+ MCFG_PALETTE_ADD_MONOCHROME_GREEN("palette")
+
/* Devices */
MCFG_ASCII_KEYBOARD_ADD(KEYBOARD_TAG, keyboard_intf)
MACHINE_CONFIG_END
diff --git a/src/mess/drivers/molecular.c b/src/mess/drivers/molecular.c
index 3b567c88803..0f85ab67416 100644
--- a/src/mess/drivers/molecular.c
+++ b/src/mess/drivers/molecular.c
@@ -88,6 +88,8 @@ public:
UINT8 app_ram_enable;
UINT8 file_ram_enable;
+
+ DECLARE_PALETTE_INIT(molecula);
protected:
// driver_device overrides
@@ -95,7 +97,6 @@ protected:
virtual void machine_reset();
virtual void video_start();
- virtual void palette_init();
};
void molecula_state::video_start()
@@ -277,7 +278,7 @@ void molecula_state::machine_reset()
}
-void molecula_state::palette_init()
+PALETTE_INIT_MEMBER(molecula_state, molecula)
{
}
@@ -308,7 +309,8 @@ static MACHINE_CONFIG_START( molecula, molecula_state )
MCFG_GFXDECODE_ADD("gfxdecode", molecula)
- MCFG_PALETTE_LENGTH(8)
+ MCFG_PALETTE_ADD("palette", 8)
+ MCFG_PALETTE_INIT_OWNER(molecula_state, molecula)
/* sound hardware */
MCFG_SPEAKER_STANDARD_MONO("mono")
diff --git a/src/mess/drivers/ms0515.c b/src/mess/drivers/ms0515.c
index f6d2cf9e846..67dea5d0316 100644
--- a/src/mess/drivers/ms0515.c
+++ b/src/mess/drivers/ms0515.c
@@ -34,7 +34,7 @@ public:
UINT8 *m_video_ram;
UINT8 m_sysreg;
int m_blink;
- virtual void palette_init();
+ DECLARE_PALETTE_INIT(ms0515);
UINT32 screen_update_ms0515(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
DECLARE_WRITE8_MEMBER(ms0515_portc_w);
};
@@ -212,25 +212,25 @@ UINT32 ms0515_state::screen_update_ms0515(screen_device &screen, bitmap_ind16 &b
return 0;
}
-void ms0515_state::palette_init()
+PALETTE_INIT_MEMBER(ms0515_state, ms0515)
{
- palette_set_color(machine(), 0, rgb_t(0, 0, 0));
- palette_set_color(machine(), 1, rgb_t(0, 0, 127));
- palette_set_color(machine(), 2, rgb_t(127, 0, 0));
- palette_set_color(machine(), 3, rgb_t(127, 0, 127));
- palette_set_color(machine(), 4, rgb_t(0, 127, 0));
- palette_set_color(machine(), 5, rgb_t(0, 127, 127));
- palette_set_color(machine(), 6, rgb_t(127, 127, 0));
- palette_set_color(machine(), 7, rgb_t(127, 127, 127));
-
- palette_set_color(machine(), 8, rgb_t(127, 127, 127));
- palette_set_color(machine(), 9, rgb_t(127, 127, 255));
- palette_set_color(machine(), 10, rgb_t(255, 127, 127));
- palette_set_color(machine(), 11, rgb_t(255, 127, 255));
- palette_set_color(machine(), 12, rgb_t(127, 255, 127));
- palette_set_color(machine(), 13, rgb_t(127, 255, 255));
- palette_set_color(machine(), 14, rgb_t(255, 255, 127));
- palette_set_color(machine(), 15, rgb_t(255, 255, 255));
+ palette.set_pen_color(0, rgb_t(0, 0, 0));
+ palette.set_pen_color(1, rgb_t(0, 0, 127));
+ palette.set_pen_color(2, rgb_t(127, 0, 0));
+ palette.set_pen_color(3, rgb_t(127, 0, 127));
+ palette.set_pen_color(4, rgb_t(0, 127, 0));
+ palette.set_pen_color(5, rgb_t(0, 127, 127));
+ palette.set_pen_color(6, rgb_t(127, 127, 0));
+ palette.set_pen_color(7, rgb_t(127, 127, 127));
+
+ palette.set_pen_color(8, rgb_t(127, 127, 127));
+ palette.set_pen_color(9, rgb_t(127, 127, 255));
+ palette.set_pen_color(10, rgb_t(255, 127, 127));
+ palette.set_pen_color(11, rgb_t(255, 127, 255));
+ palette.set_pen_color(12, rgb_t(127, 255, 127));
+ palette.set_pen_color(13, rgb_t(127, 255, 255));
+ palette.set_pen_color(14, rgb_t(255, 255, 127));
+ palette.set_pen_color(15, rgb_t(255, 255, 255));
}
WRITE8_MEMBER(ms0515_state::ms0515_portc_w)
@@ -265,7 +265,8 @@ static MACHINE_CONFIG_START( ms0515, ms0515_state )
MCFG_SCREEN_VISIBLE_AREA(0, 640-1, 0, 200-1)
MCFG_SCREEN_UPDATE_DRIVER(ms0515_state, screen_update_ms0515)
- MCFG_PALETTE_LENGTH(16)
+ MCFG_PALETTE_ADD("palette", 16)
+ MCFG_PALETTE_INIT_OWNER(ms0515_state, ms0515)
MCFG_I8255_ADD( "ppi8255_1", ms0515_ppi8255_interface_1 )
//MCFG_I8255_ADD( "ppi8255_2", ms0515_ppi8255_interface_2 )
diff --git a/src/mess/drivers/mstation.c b/src/mess/drivers/mstation.c
index 422955977e2..11fd04ee215 100644
--- a/src/mess/drivers/mstation.c
+++ b/src/mess/drivers/mstation.c
@@ -92,7 +92,7 @@ public:
virtual void machine_start();
virtual void machine_reset();
UINT32 screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
- virtual void palette_init();
+ DECLARE_PALETTE_INIT(mstation);
TIMER_DEVICE_CALLBACK_MEMBER(mstation_1hz_timer);
TIMER_DEVICE_CALLBACK_MEMBER(mstation_kb_timer);
};
@@ -502,10 +502,10 @@ TIMER_DEVICE_CALLBACK_MEMBER(mstation_state::mstation_kb_timer)
refresh_ints();
}
-void mstation_state::palette_init()
+PALETTE_INIT_MEMBER(mstation_state, mstation)
{
- palette_set_color(machine(), 0, rgb_t(138, 146, 148));
- palette_set_color(machine(), 1, rgb_t(92, 83, 88));
+ palette.set_pen_color(0, rgb_t(138, 146, 148));
+ palette.set_pen_color(1, rgb_t(92, 83, 88));
}
static RP5C01_INTERFACE( rtc_intf )
@@ -527,7 +527,8 @@ static MACHINE_CONFIG_START( mstation, mstation_state )
MCFG_SCREEN_SIZE(320, 128)
MCFG_SCREEN_VISIBLE_AREA(0, 320-1, 0, 128-1)
- MCFG_PALETTE_LENGTH(2)
+ MCFG_PALETTE_ADD("palette", 2)
+ MCFG_PALETTE_INIT_OWNER(mstation_state, mstation)
MCFG_DEFAULT_LAYOUT(layout_lcd)
MCFG_AMD_29F080_ADD("flash0")
diff --git a/src/mess/drivers/msx.c b/src/mess/drivers/msx.c
index 5a93105e689..ed57cf5b10a 100644
--- a/src/mess/drivers/msx.c
+++ b/src/mess/drivers/msx.c
@@ -1197,7 +1197,7 @@ static MACHINE_CONFIG_START( msx2, msx_state )
MCFG_SCREEN_SIZE(MSX2_TOTAL_XRES_PIXELS, 262*2)
MCFG_SCREEN_VISIBLE_AREA(MSX2_XBORDER_PIXELS - MSX2_VISIBLE_XBORDER_PIXELS, MSX2_TOTAL_XRES_PIXELS - MSX2_XBORDER_PIXELS + MSX2_VISIBLE_XBORDER_PIXELS - 1, MSX2_YBORDER_PIXELS - MSX2_VISIBLE_YBORDER_PIXELS, MSX2_TOTAL_YRES_PIXELS - MSX2_YBORDER_PIXELS + MSX2_VISIBLE_YBORDER_PIXELS - 1)
- MCFG_PALETTE_LENGTH(512)
+ MCFG_PALETTE_ADD("palette", 512)
/* sound hardware */
MCFG_SPEAKER_STANDARD_MONO("mono")
@@ -1268,8 +1268,6 @@ static MACHINE_CONFIG_START( msx2p, msx_state )
MCFG_SCREEN_SIZE(MSX2_TOTAL_XRES_PIXELS, 262*2)
MCFG_SCREEN_VISIBLE_AREA(MSX2_XBORDER_PIXELS - MSX2_VISIBLE_XBORDER_PIXELS, MSX2_TOTAL_XRES_PIXELS - MSX2_XBORDER_PIXELS + MSX2_VISIBLE_XBORDER_PIXELS - 1, MSX2_YBORDER_PIXELS - MSX2_VISIBLE_YBORDER_PIXELS, MSX2_TOTAL_YRES_PIXELS - MSX2_YBORDER_PIXELS + MSX2_VISIBLE_YBORDER_PIXELS - 1)
- MCFG_PALETTE_LENGTH(19780)
-
/* sound hardware */
MCFG_SPEAKER_STANDARD_MONO("mono")
MCFG_SOUND_ADD("dac", DAC, 0)
diff --git a/src/mess/drivers/multi16.c b/src/mess/drivers/multi16.c
index 8df82838295..577c017f3a2 100644
--- a/src/mess/drivers/multi16.c
+++ b/src/mess/drivers/multi16.c
@@ -76,7 +76,7 @@ UINT32 multi16_state::screen_update_multi16(screen_device &screen, bitmap_ind16
int dot = (BITSWAP16(m_p_vram[count],7,6,5,4,3,2,1,0,15,14,13,12,11,10,9,8) >> (15-xi)) & 0x1;
if(screen.visible_area().contains(x*16+xi, y))
- bitmap.pix16(y, x*16+xi) = machine().pens[dot];
+ bitmap.pix16(y, x*16+xi) = m_palette->pen(dot);
}
count++;
@@ -168,7 +168,7 @@ static MACHINE_CONFIG_START( multi16, multi16_state )
MCFG_SCREEN_SIZE(640, 200)
MCFG_SCREEN_VISIBLE_AREA(0, 640-1, 0, 200-1)
MCFG_SCREEN_UPDATE_DRIVER(multi16_state, screen_update_multi16)
- MCFG_PALETTE_LENGTH(8)
+ MCFG_PALETTE_ADD("palette", 8)
/* Devices */
MCFG_MC6845_ADD("crtc", H46505, "screen", 16000000/5, mc6845_intf) /* unknown clock, hand tuned to get ~60 fps */
diff --git a/src/mess/drivers/multi8.c b/src/mess/drivers/multi8.c
index 5dbc43732db..d0e93261cbf 100644
--- a/src/mess/drivers/multi8.c
+++ b/src/mess/drivers/multi8.c
@@ -69,7 +69,7 @@ public:
virtual void machine_start();
virtual void machine_reset();
virtual void video_start();
- virtual void palette_init();
+ DECLARE_PALETTE_INIT(multi8);
UINT32 screen_update_multi8(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
TIMER_DEVICE_CALLBACK_MEMBER(keyboard_callback);
void multi8_draw_pixel(bitmap_ind16 &bitmap,int y,int x,UINT8 pen,UINT8 width);
@@ -183,7 +183,7 @@ UINT32 multi8_state::screen_update_multi8(screen_device &screen, bitmap_ind16 &b
}
}
- // m_gfxdecode->gfx(0)->opaque(bitmap,cliprect, tile,color >> 5, 0, 0, x*8, y*8);
+ // m_gfxdecode->gfx(0)->opaque(m_palette,bitmap,cliprect, tile,color >> 5, 0, 0, x*8, y*8);
// draw cursor
if(mc6845_cursor_addr+0xc000 == count)
@@ -575,12 +575,12 @@ static MC6845_INTERFACE( mc6845_intf )
NULL /* update address callback */
};
-void multi8_state::palette_init()
+PALETTE_INIT_MEMBER(multi8_state, multi8)
{
UINT8 i;
for(i=0; i<8; i++)
- palette_set_color_rgb(machine(), i, pal1bit(i >> 1),pal1bit(i >> 2),pal1bit(i >> 0));
+ palette.set_pen_color(i, pal1bit(i >> 1),pal1bit(i >> 2),pal1bit(i >> 0));
}
READ8_MEMBER( multi8_state::porta_r )
@@ -673,7 +673,8 @@ static MACHINE_CONFIG_START( multi8, multi8_state )
MCFG_SCREEN_SIZE(640, 200)
MCFG_SCREEN_VISIBLE_AREA(0, 320-1, 0, 200-1)
MCFG_SCREEN_UPDATE_DRIVER(multi8_state, screen_update_multi8)
- MCFG_PALETTE_LENGTH(8)
+ MCFG_PALETTE_ADD("palette", 8)
+ MCFG_PALETTE_INIT_OWNER(multi8_state, multi8)
MCFG_GFXDECODE_ADD("gfxdecode", multi8)
/* Audio */
diff --git a/src/mess/drivers/mx2178.c b/src/mess/drivers/mx2178.c
index 621029285b0..f37a5302629 100644
--- a/src/mess/drivers/mx2178.c
+++ b/src/mess/drivers/mx2178.c
@@ -184,8 +184,7 @@ static MACHINE_CONFIG_START( mx2178, mx2178_state )
MCFG_SCREEN_SIZE(32*8, 32*8)
MCFG_SCREEN_VISIBLE_AREA(0*8, 32*8-1, 2*8, 30*8-1)
MCFG_GFXDECODE_ADD("gfxdecode", mx2178)
- MCFG_PALETTE_LENGTH(2)
- MCFG_PALETTE_INIT_OVERRIDE(driver_device, monochrome_green)
+ MCFG_PALETTE_ADD_MONOCHROME_GREEN("palette")
/* Devices */
MCFG_MC6845_ADD("crtc", MC6845, "screen", 18869600 / 8, crtc_interface) // clk unknown
diff --git a/src/mess/drivers/myb3k.c b/src/mess/drivers/myb3k.c
index 7e1384fdd22..98ec51e562e 100644
--- a/src/mess/drivers/myb3k.c
+++ b/src/mess/drivers/myb3k.c
@@ -92,7 +92,7 @@ UINT32 myb3k_state::screen_update_myb3k(screen_device &screen, bitmap_ind16 &bit
dot = 0;
if(y*mc6845_tile_height+yi < 200 && x*8+xi < 320) /* TODO: safety check */
- bitmap.pix16(y*mc6845_tile_height+yi, x*8+xi) = machine().pens[dot];
+ bitmap.pix16(y*mc6845_tile_height+yi, x*8+xi) = m_palette->pen(dot);
}
}
}
@@ -284,8 +284,7 @@ static MACHINE_CONFIG_START( myb3k, myb3k_state )
MCFG_SCREEN_VISIBLE_AREA(0, 320-1, 0, 200-1)
MCFG_SCREEN_UPDATE_DRIVER(myb3k_state, screen_update_myb3k)
MCFG_GFXDECODE_ADD("gfxdecode", myb3k)
- MCFG_PALETTE_LENGTH(2)
- MCFG_PALETTE_INIT_OVERRIDE(driver_device, black_and_white)
+ MCFG_PALETTE_ADD_BLACK_AND_WHITE("palette")
/* Devices */
MCFG_MC6845_ADD("crtc", H46505, "screen", XTAL_3_579545MHz/4, mc6845_intf) /* unknown clock, hand tuned to get ~60 fps */
diff --git a/src/mess/drivers/mycom.c b/src/mess/drivers/mycom.c
index c286ce74754..2534f2bde7e 100644
--- a/src/mess/drivers/mycom.c
+++ b/src/mess/drivers/mycom.c
@@ -560,8 +560,7 @@ static MACHINE_CONFIG_START( mycom, mycom_state )
MCFG_SCREEN_UPDATE_DEVICE("crtc", mc6845_device, screen_update)
MCFG_SCREEN_SIZE(640, 480)
MCFG_SCREEN_VISIBLE_AREA(0, 320-1, 0, 192-1)
- MCFG_PALETTE_LENGTH(2)
- MCFG_PALETTE_INIT_OVERRIDE(driver_device, black_and_white)
+ MCFG_PALETTE_ADD_BLACK_AND_WHITE("palette")
MCFG_GFXDECODE_ADD("gfxdecode", mycom)
/* Manual states clock is 1.008mhz for 40 cols, and 2.016 mhz for 80 cols.
diff --git a/src/mess/drivers/mz2000.c b/src/mess/drivers/mz2000.c
index caa4dbd3564..0333ab4e6ae 100644
--- a/src/mess/drivers/mz2000.c
+++ b/src/mess/drivers/mz2000.c
@@ -172,8 +172,8 @@ UINT32 mz2000_state::screen_update_mz2000(screen_device &screen, bitmap_ind16 &b
pen |= ((gvram[count+0xc000] >> (xi)) & 1) ? 4 : 0; //G
pen &= m_gvram_mask;
- bitmap.pix16(y*2+0, x+xi) = machine().pens[pen];
- bitmap.pix16(y*2+1, x+xi) = machine().pens[pen];
+ bitmap.pix16(y*2+0, x+xi) = m_palette->pen(pen);
+ bitmap.pix16(y*2+1, x+xi) = m_palette->pen(pen);
}
count++;
}
@@ -213,27 +213,27 @@ UINT32 mz2000_state::screen_update_mz2000(screen_device &screen, bitmap_ind16 &b
{
if(m_width80 == 0)
{
- bitmap.pix16(res_y, res_x*2+0) = machine().pens[pen];
- bitmap.pix16(res_y, res_x*2+1) = machine().pens[pen];
+ bitmap.pix16(res_y, res_x*2+0) = m_palette->pen(pen);
+ bitmap.pix16(res_y, res_x*2+1) = m_palette->pen(pen);
}
else
{
- bitmap.pix16(res_y, res_x) = machine().pens[pen];
+ bitmap.pix16(res_y, res_x) = m_palette->pen(pen);
}
}
else
{
if(m_width80 == 0)
{
- bitmap.pix16(res_y*2+0, res_x*2+0) = machine().pens[pen];
- bitmap.pix16(res_y*2+0, res_x*2+1) = machine().pens[pen];
- bitmap.pix16(res_y*2+1, res_x*2+0) = machine().pens[pen];
- bitmap.pix16(res_y*2+1, res_x*2+1) = machine().pens[pen];
+ bitmap.pix16(res_y*2+0, res_x*2+0) = m_palette->pen(pen);
+ bitmap.pix16(res_y*2+0, res_x*2+1) = m_palette->pen(pen);
+ bitmap.pix16(res_y*2+1, res_x*2+0) = m_palette->pen(pen);
+ bitmap.pix16(res_y*2+1, res_x*2+1) = m_palette->pen(pen);
}
else
{
- bitmap.pix16(res_y*2+0, res_x) = machine().pens[pen];
- bitmap.pix16(res_y*2+1, res_x) = machine().pens[pen];
+ bitmap.pix16(res_y*2+0, res_x) = m_palette->pen(pen);
+ bitmap.pix16(res_y*2+1, res_x) = m_palette->pen(pen);
}
}
}
@@ -573,7 +573,7 @@ void mz2000_state::machine_reset()
g = (m_color_mode) ? (i & 4)>>2 : ((i) ? 1 : 0);
b = (m_color_mode) ? (i & 1)>>0 : 0;
- palette_set_color_rgb(machine(), i,pal1bit(r),pal1bit(g),pal1bit(b));
+ m_palette->set_pen_color(i,pal1bit(r),pal1bit(g),pal1bit(b));
}
}
}
@@ -868,7 +868,7 @@ static MACHINE_CONFIG_START( mz2000, mz2000_state )
MCFG_SCREEN_UPDATE_DRIVER(mz2000_state, screen_update_mz2000)
MCFG_GFXDECODE_ADD("gfxdecode", mz2000)
- MCFG_PALETTE_LENGTH(8)
+ MCFG_PALETTE_ADD("palette", 8)
MCFG_SPEAKER_STANDARD_MONO("mono")
diff --git a/src/mess/drivers/mz2500.c b/src/mess/drivers/mz2500.c
index 1522cc4eb56..2519adc3c0b 100644
--- a/src/mess/drivers/mz2500.c
+++ b/src/mess/drivers/mz2500.c
@@ -185,7 +185,7 @@ public:
virtual void machine_start();
virtual void machine_reset();
virtual void video_start();
- virtual void palette_init();
+ DECLARE_PALETTE_INIT(mz2500);
UINT32 screen_update_mz2500(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
INTERRUPT_GEN_MEMBER(mz2500_vbl);
DECLARE_READ8_MEMBER(mz2500_wd17xx_r);
@@ -251,23 +251,23 @@ void mz2500_state::mz2500_draw_pixel(bitmap_ind16 &bitmap,int x,int y,UINT16 pe
{
if(width && height)
{
- bitmap.pix16(y*2+0, x*2+0) = machine().pens[pen];
- bitmap.pix16(y*2+0, x*2+1) = machine().pens[pen];
- bitmap.pix16(y*2+1, x*2+0) = machine().pens[pen];
- bitmap.pix16(y*2+1, x*2+1) = machine().pens[pen];
+ bitmap.pix16(y*2+0, x*2+0) = m_palette->pen(pen);
+ bitmap.pix16(y*2+0, x*2+1) = m_palette->pen(pen);
+ bitmap.pix16(y*2+1, x*2+0) = m_palette->pen(pen);
+ bitmap.pix16(y*2+1, x*2+1) = m_palette->pen(pen);
}
else if(width)
{
- bitmap.pix16(y, x*2+0) = machine().pens[pen];
- bitmap.pix16(y, x*2+1) = machine().pens[pen];
+ bitmap.pix16(y, x*2+0) = m_palette->pen(pen);
+ bitmap.pix16(y, x*2+1) = m_palette->pen(pen);
}
else if(height)
{
- bitmap.pix16(y*2+0, x) = machine().pens[pen];
- bitmap.pix16(y*2+1, x) = machine().pens[pen];
+ bitmap.pix16(y*2+0, x) = m_palette->pen(pen);
+ bitmap.pix16(y*2+1, x) = m_palette->pen(pen);
}
else
- bitmap.pix16(y, x) = machine().pens[pen];
+ bitmap.pix16(y, x) = m_palette->pen(pen);
}
void mz2500_state::draw_80x25(bitmap_ind16 &bitmap,const rectangle &cliprect,UINT16 map_addr)
@@ -677,7 +677,7 @@ void mz2500_state::draw_cg_screen(bitmap_ind16 &bitmap,const rectangle &cliprect
UINT32 mz2500_state::screen_update_mz2500(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect)
{
- bitmap.fill(machine().pens[0], cliprect); //TODO: correct?
+ bitmap.fill(m_palette->pen(0), cliprect); //TODO: correct?
if(m_screen_enable)
return 0;
@@ -1122,7 +1122,7 @@ WRITE8_MEMBER(mz2500_state::mz2500_tv_crtc_w)
bit2 = i & 0x40 ? 4 : 0;
g = bit0|bit1|bit2;
- palette_set_color_rgb(machine(), i+0x100,pal3bit(r),pal3bit(g),pal3bit(b));
+ m_palette->set_pen_color(i+0x100,pal3bit(r),pal3bit(g),pal3bit(b));
}
}
if(m_text_reg_index >= 0x80 && m_text_reg_index <= 0x8f) //Bitmap 16 clut registers
@@ -1275,7 +1275,7 @@ WRITE8_MEMBER(mz2500_state::palette4096_io_w)
m_pal[pal_entry].b = data & 0x0f;
}
- palette_set_color_rgb(machine(), pal_entry+0x10, pal4bit(m_pal[pal_entry].r), pal4bit(m_pal[pal_entry].g), pal4bit(m_pal[pal_entry].b));
+ m_palette->set_pen_color(pal_entry+0x10, pal4bit(m_pal[pal_entry].r), pal4bit(m_pal[pal_entry].g), pal4bit(m_pal[pal_entry].b));
}
READ8_MEMBER(mz2500_state::mz2500_wd17xx_r)
@@ -2034,16 +2034,16 @@ static const ay8910_interface ay8910_config =
DEVCB_NULL // write B
};
-void mz2500_state::palette_init()
+PALETTE_INIT_MEMBER(mz2500_state, mz2500)
{
int i;
for(i=0;i<0x200;i++)
- palette_set_color_rgb(machine(), i,pal1bit(0),pal1bit(0),pal1bit(0));
+ palette.set_pen_color(i,pal1bit(0),pal1bit(0),pal1bit(0));
/* set up 8 colors (PCG) */
for(i=0;i<8;i++)
- palette_set_color_rgb(machine(), i+8,pal1bit((i & 2)>>1),pal1bit((i & 4)>>2),pal1bit((i & 1)>>0));
+ m_palette->set_pen_color(i+8,pal1bit((i & 2)>>1),pal1bit((i & 4)>>2),pal1bit((i & 1)>>0));
/* set up 16 colors (PCG / CG) */
@@ -2068,7 +2068,7 @@ void mz2500_state::palette_init()
bit2 = i & 0x40 ? 4 : 0;
g = bit0|bit1|bit2;
- palette_set_color_rgb(machine(), i+0x100,pal3bit(r),pal3bit(g),pal3bit(b));
+ m_palette->set_pen_color(i+0x100,pal3bit(r),pal3bit(g),pal3bit(b));
}
}
}
@@ -2147,7 +2147,8 @@ static MACHINE_CONFIG_START( mz2500, mz2500_state )
MCFG_SCREEN_RAW_PARAMS(XTAL_21_4772MHz, 640+108, 0, 640, 480, 0, 200) //unknown clock / divider
MCFG_SCREEN_UPDATE_DRIVER(mz2500_state, screen_update_mz2500)
- MCFG_PALETTE_LENGTH(0x200)
+ MCFG_PALETTE_ADD("palette", 0x200)
+ MCFG_PALETTE_INIT_OWNER(mz2500_state, mz2500)
MCFG_GFXDECODE_ADD("gfxdecode", mz2500)
diff --git a/src/mess/drivers/mz3500.c b/src/mess/drivers/mz3500.c
index 6e4e3d93531..44e4b5e9b12 100644
--- a/src/mess/drivers/mz3500.c
+++ b/src/mess/drivers/mz3500.c
@@ -97,14 +97,13 @@ public:
// screen updates
UINT32 screen_update(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect);
-
+ DECLARE_PALETTE_INIT(mz3500);
protected:
// driver_device overrides
virtual void machine_start();
virtual void machine_reset();
virtual void video_start();
- virtual void palette_init();
};
void mz3500_state::video_start()
@@ -228,7 +227,7 @@ static UPD7220_DRAW_TEXT_LINE( hgdc_draw_text )
UINT32 mz3500_state::screen_update( screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect )
{
- bitmap.fill(machine().pens[(m_crtc[4] & 2) ? m_crtc[3] & 7 : 0], cliprect);
+ bitmap.fill(m_palette->pen((m_crtc[4] & 2) ? m_crtc[3] & 7 : 0), cliprect);
/* graphics */
m_hgdc2->screen_update(screen, bitmap, cliprect);
@@ -824,12 +823,12 @@ void mz3500_state::machine_reset()
-void mz3500_state::palette_init()
+PALETTE_INIT_MEMBER(mz3500_state, mz3500)
{
int i;
for(i=0;i<8;i++)
- palette_set_color_rgb(machine(), i,pal1bit((i >> 1) & 1),pal1bit(i >> 2),pal1bit((i >> 0) & 1));
+ palette.set_pen_color(i,pal1bit((i >> 1) & 1),pal1bit(i >> 2),pal1bit((i >> 0) & 1));
}
@@ -881,7 +880,8 @@ static MACHINE_CONFIG_START( mz3500, mz3500_state )
MCFG_GFXDECODE_ADD("gfxdecode", mz3500)
- MCFG_PALETTE_LENGTH(8)
+ MCFG_PALETTE_ADD("palette", 8)
+ MCFG_PALETTE_INIT_OWNER(mz3500_state, mz3500)
/* sound hardware */
MCFG_SPEAKER_STANDARD_MONO("mono")
diff --git a/src/mess/drivers/mz6500.c b/src/mess/drivers/mz6500.c
index b2c9b63de7a..d3c7d8e8b69 100644
--- a/src/mess/drivers/mz6500.c
+++ b/src/mess/drivers/mz6500.c
@@ -153,7 +153,7 @@ static MACHINE_CONFIG_START( mz6500, mz6500_state )
MCFG_SCREEN_UPDATE_DEVICE("upd7220", upd7220_device, screen_update)
MCFG_SCREEN_SIZE(640, 480)
MCFG_SCREEN_VISIBLE_AREA(0, 640-1, 0, 480-1)
- MCFG_PALETTE_LENGTH(8)
+ MCFG_PALETTE_ADD("palette", 8)
/* Devices */
MCFG_UPD7220_ADD("upd7220", 8000000/6, hgdc_intf, upd7220_map) // unk clock
diff --git a/src/mess/drivers/mz700.c b/src/mess/drivers/mz700.c
index 6fff599683b..c399a7492d4 100644
--- a/src/mess/drivers/mz700.c
+++ b/src/mess/drivers/mz700.c
@@ -340,7 +340,8 @@ static MACHINE_CONFIG_START( mz700, mz_state )
MCFG_SCREEN_UPDATE_DRIVER(mz_state, screen_update_mz700)
MCFG_GFXDECODE_ADD("gfxdecode", mz700)
- MCFG_PALETTE_LENGTH(256*2)
+ MCFG_PALETTE_ADD("palette", 256*2)
+ MCFG_PALETTE_INIT_OWNER(mz_state, mz)
/* sound hardware */
MCFG_SPEAKER_STANDARD_MONO("mono")
diff --git a/src/mess/drivers/mz80.c b/src/mess/drivers/mz80.c
index c5899c07c45..3f3d4b1f9ee 100644
--- a/src/mess/drivers/mz80.c
+++ b/src/mess/drivers/mz80.c
@@ -290,8 +290,7 @@ static MACHINE_CONFIG_START( mz80k, mz80_state )
MCFG_SCREEN_VISIBLE_AREA(0, 319, 0, 199)
MCFG_SCREEN_UPDATE_DRIVER(mz80_state, screen_update_mz80k)
MCFG_GFXDECODE_ADD("gfxdecode", mz80k)
- MCFG_PALETTE_LENGTH(2)
- MCFG_PALETTE_INIT_OVERRIDE(driver_device, black_and_white)
+ MCFG_PALETTE_ADD_BLACK_AND_WHITE("palette")
/* Audio */
MCFG_SPEAKER_STANDARD_MONO("mono")
diff --git a/src/mess/drivers/n64.c b/src/mess/drivers/n64.c
index 5f3bf95e77e..c232512346d 100644
--- a/src/mess/drivers/n64.c
+++ b/src/mess/drivers/n64.c
@@ -298,7 +298,7 @@ static MACHINE_CONFIG_START( n64, n64_mess_state )
MCFG_SCREEN_VISIBLE_AREA(0, 639, 0, 239)
MCFG_SCREEN_UPDATE_DRIVER(n64_state, screen_update_n64)
- MCFG_PALETTE_LENGTH(0x1000)
+ MCFG_PALETTE_ADD("palette", 0x1000)
MCFG_SPEAKER_STANDARD_STEREO("lspeaker", "rspeaker")
diff --git a/src/mess/drivers/nakajies.c b/src/mess/drivers/nakajies.c
index 49dec58a812..c6695842159 100644
--- a/src/mess/drivers/nakajies.c
+++ b/src/mess/drivers/nakajies.c
@@ -335,7 +335,7 @@ public:
/* Banking */
UINT8 m_bank[8];
UINT8 *m_bank_base[8];
- virtual void palette_init();
+ DECLARE_PALETTE_INIT(nakajies);
DECLARE_INPUT_CHANGED_MEMBER(trigger_irq);
TIMER_DEVICE_CALLBACK_MEMBER(kb_timer);
};
@@ -697,10 +697,10 @@ TIMER_DEVICE_CALLBACK_MEMBER(nakajies_state::kb_timer)
}
-void nakajies_state::palette_init()
+PALETTE_INIT_MEMBER(nakajies_state, nakajies)
{
- palette_set_color(machine(), 0, rgb_t(138, 146, 148));
- palette_set_color(machine(), 1, rgb_t(92, 83, 88));
+ palette.set_pen_color(0, rgb_t(138, 146, 148));
+ palette.set_pen_color(1, rgb_t(92, 83, 88));
}
@@ -750,7 +750,8 @@ static MACHINE_CONFIG_START( nakajies210, nakajies_state )
MCFG_SCREEN_SIZE( 80 * 6, 8 * 8 )
MCFG_SCREEN_VISIBLE_AREA( 0, 6 * 80 - 1, 0, 8 * 8 - 1 )
MCFG_GFXDECODE_ADD("gfxdecode", wales210)
- MCFG_PALETTE_LENGTH( 2 )
+ MCFG_PALETTE_ADD( "palette", 2 )
+ MCFG_PALETTE_INIT_OWNER(nakajies_state, nakajies)
MCFG_DEFAULT_LAYOUT(layout_lcd)
/* sound */
diff --git a/src/mess/drivers/nanos.c b/src/mess/drivers/nanos.c
index c714d17c3e4..adb5ce1120d 100644
--- a/src/mess/drivers/nanos.c
+++ b/src/mess/drivers/nanos.c
@@ -570,8 +570,7 @@ static MACHINE_CONFIG_START( nanos, nanos_state )
MCFG_SCREEN_SIZE(80*8, 25*10)
MCFG_SCREEN_VISIBLE_AREA(0,80*8-1,0,25*10-1)
MCFG_GFXDECODE_ADD("gfxdecode", nanos)
- MCFG_PALETTE_LENGTH(2)
- MCFG_PALETTE_INIT_OVERRIDE(driver_device, black_and_white)
+ MCFG_PALETTE_ADD_BLACK_AND_WHITE("palette")
/* devices */
MCFG_Z80CTC_ADD( "z80ctc_0", XTAL_4MHz, ctc_intf)
diff --git a/src/mess/drivers/nascom1.c b/src/mess/drivers/nascom1.c
index d21e10bb3ed..acd67335b3d 100644
--- a/src/mess/drivers/nascom1.c
+++ b/src/mess/drivers/nascom1.c
@@ -296,8 +296,7 @@ static MACHINE_CONFIG_START( nascom1, nascom1_state )
MCFG_SCREEN_UPDATE_DRIVER(nascom1_state, screen_update_nascom1)
MCFG_GFXDECODE_ADD("gfxdecode", nascom1)
- MCFG_PALETTE_LENGTH(2)
- MCFG_PALETTE_INIT_OVERRIDE(driver_device, black_and_white)
+ MCFG_PALETTE_ADD_BLACK_AND_WHITE("palette")
MCFG_AY31015_ADD( "hd6402", nascom1_ay31015_config )
diff --git a/src/mess/drivers/nc.c b/src/mess/drivers/nc.c
index 612e6da176b..db6c8ac4c67 100644
--- a/src/mess/drivers/nc.c
+++ b/src/mess/drivers/nc.c
@@ -1439,7 +1439,9 @@ static MACHINE_CONFIG_START( nc100, nc_state )
MCFG_SCREEN_VISIBLE_AREA(0, 480-1, 0, 64-1)
MCFG_SCREEN_UPDATE_DRIVER(nc_state, screen_update_nc)
- MCFG_PALETTE_LENGTH(NC_NUM_COLOURS)
+ MCFG_PALETTE_ADD("palette", NC_NUM_COLOURS)
+ MCFG_PALETTE_INIT_OWNER(nc_state, nc)
+
MCFG_DEFAULT_LAYOUT(layout_lcd)
/* sound hardware */
@@ -1505,7 +1507,10 @@ static MACHINE_CONFIG_DERIVED( nc200, nc100 )
MCFG_SCREEN_MODIFY("screen")
MCFG_SCREEN_SIZE(NC200_SCREEN_WIDTH, NC200_SCREEN_HEIGHT)
MCFG_SCREEN_VISIBLE_AREA(0, NC200_SCREEN_WIDTH-1, 0, NC200_SCREEN_HEIGHT-1)
- MCFG_PALETTE_LENGTH(NC200_NUM_COLOURS)
+
+ MCFG_DEVICE_REMOVE("palette")
+ MCFG_PALETTE_ADD("palette", NC200_NUM_COLOURS)
+ MCFG_PALETTE_INIT_OWNER(nc_state, nc)
/* printer */
MCFG_DEVICE_MODIFY("centronics")
diff --git a/src/mess/drivers/nes.c b/src/mess/drivers/nes.c
index 3c60574bfb0..50de0c6058a 100644
--- a/src/mess/drivers/nes.c
+++ b/src/mess/drivers/nes.c
@@ -1058,7 +1058,8 @@ static MACHINE_CONFIG_START( nes, nes_state )
MCFG_SCREEN_UPDATE_DRIVER(nes_state, screen_update_nes)
- MCFG_PALETTE_LENGTH(4*16*8)
+ MCFG_PALETTE_ADD("palette", 4*16*8)
+ MCFG_PALETTE_INIT_OWNER(nes_state, nes)
MCFG_PPU2C02_ADD("ppu", nes_ppu_interface)
MCFG_PPU2C0X_SET_NMI(nes_state, ppu_nmi)
diff --git a/src/mess/drivers/ngp.c b/src/mess/drivers/ngp.c
index 8232e96e395..efe6d61abe3 100644
--- a/src/mess/drivers/ngp.c
+++ b/src/mess/drivers/ngp.c
@@ -837,8 +837,6 @@ MACHINE_CONFIG_END
static MACHINE_CONFIG_DERIVED( ngp, ngp_common )
- MCFG_PALETTE_LENGTH( 8 )
-
MCFG_K1GE_ADD( "k1ge", XTAL_6_144MHz, "screen", WRITELINE( ngp_state, ngp_vblank_pin_w ), WRITELINE( ngp_state, ngp_hblank_pin_w ) )
MCFG_CARTSLOT_ADD("cart")
@@ -855,9 +853,6 @@ MACHINE_CONFIG_END
static MACHINE_CONFIG_DERIVED( ngpc, ngp_common )
-
- MCFG_PALETTE_LENGTH( 4096 )
-
MCFG_K2GE_ADD( "k1ge", XTAL_6_144MHz, "screen", WRITELINE( ngp_state, ngp_vblank_pin_w ), WRITELINE( ngp_state, ngp_hblank_pin_w ) )
MCFG_CARTSLOT_ADD("cart")
diff --git a/src/mess/drivers/octopus.c b/src/mess/drivers/octopus.c
index 131645795d9..99cd6989e41 100644
--- a/src/mess/drivers/octopus.c
+++ b/src/mess/drivers/octopus.c
@@ -177,8 +177,7 @@ static MACHINE_CONFIG_START( octopus, octopus_state )
MCFG_SCREEN_SIZE(640, 480)
MCFG_SCREEN_VISIBLE_AREA(0, 640-1, 0, 480-1)
MCFG_SCREEN_UPDATE_DRIVER(octopus_state, screen_update_octopus)
- MCFG_PALETTE_LENGTH(2)
- MCFG_PALETTE_INIT_OVERRIDE(driver_device, black_and_white)
+ MCFG_PALETTE_ADD_BLACK_AND_WHITE("palette")
MACHINE_CONFIG_END
/* ROM definition */
diff --git a/src/mess/drivers/odyssey2.c b/src/mess/drivers/odyssey2.c
index a6a02b895cf..329b39772c1 100644
--- a/src/mess/drivers/odyssey2.c
+++ b/src/mess/drivers/odyssey2.c
@@ -64,7 +64,7 @@ public:
DECLARE_DRIVER_INIT(odyssey2);
virtual void machine_start();
virtual void machine_reset();
- virtual void palette_init();
+ DECLARE_PALETTE_INIT(odyssey2);
UINT32 screen_update_odyssey2(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
DECLARE_WRITE_LINE_MEMBER(the_voice_lrq_callback);
DECLARE_WRITE_LINE_MEMBER(irq_callback);
@@ -111,7 +111,7 @@ public:
required_device<i8243_device> m_i8243;
required_device<ef9340_1_device> m_ef9340_1;
- virtual void palette_init();
+ DECLARE_PALETTE_INIT(g7400);
virtual void machine_start();
virtual void machine_reset();
DECLARE_WRITE8_MEMBER(p2_write);
@@ -264,16 +264,16 @@ const UINT8 odyssey2_colors[] =
};
-void odyssey2_state::palette_init()
+PALETTE_INIT_MEMBER(odyssey2_state, odyssey2)
{
for ( int i = 0; i < 16; i++ )
{
- palette_set_color_rgb( machine(), i, odyssey2_colors[i*3], odyssey2_colors[i*3+1], odyssey2_colors[i*3+2] );
+ palette.set_pen_color( i, odyssey2_colors[i*3], odyssey2_colors[i*3+1], odyssey2_colors[i*3+2] );
}
}
-void g7400_state::palette_init()
+PALETTE_INIT_MEMBER(g7400_state, g7400)
{
const UINT8 g7400_colors[] =
{
@@ -299,7 +299,7 @@ void g7400_state::palette_init()
for ( int i = 0; i < 16; i++ )
{
- palette_set_color_rgb( machine(), i, g7400_colors[i*3], g7400_colors[i*3+1], g7400_colors[i*3+2] );
+ palette.set_pen_color( i, g7400_colors[i*3], g7400_colors[i*3+1], g7400_colors[i*3+2] );
}
}
@@ -776,8 +776,9 @@ static MACHINE_CONFIG_START( odyssey2, odyssey2_state )
MCFG_SCREEN_RAW_PARAMS( XTAL_7_15909MHz/2 * 2, i8244_device::LINE_CLOCKS, i8244_device::START_ACTIVE_SCAN, i8244_device::END_ACTIVE_SCAN, i8244_device::LINES, i8244_device::START_Y, i8244_device::START_Y + i8244_device::SCREEN_HEIGHT )
MCFG_SCREEN_UPDATE_DRIVER(odyssey2_state, screen_update_odyssey2)
- MCFG_GFXDECODE_ADD("gfxdecode", odyssey2 )
- MCFG_PALETTE_LENGTH(32)
+ MCFG_GFXDECODE_ADD("gfxdecode", odyssey2 )
+ MCFG_PALETTE_ADD("palette", 32)
+ MCFG_PALETTE_INIT_OWNER(odyssey2_state, odyssey2)
/* sound hardware */
MCFG_SPEAKER_STANDARD_MONO("mono")
@@ -805,8 +806,9 @@ static MACHINE_CONFIG_START( videopac, odyssey2_state )
MCFG_SCREEN_RAW_PARAMS( XTAL_17_73447MHz/5 * 2, i8244_device::LINE_CLOCKS, i8244_device::START_ACTIVE_SCAN, i8244_device::END_ACTIVE_SCAN, i8245_device::LINES, i8244_device::START_Y, i8244_device::START_Y + i8244_device::SCREEN_HEIGHT )
MCFG_SCREEN_UPDATE_DRIVER(odyssey2_state, screen_update_odyssey2)
- MCFG_GFXDECODE_ADD("gfxdecode", odyssey2 )
- MCFG_PALETTE_LENGTH(16)
+ MCFG_GFXDECODE_ADD("gfxdecode", odyssey2 )
+ MCFG_PALETTE_ADD("palette", 16)
+ MCFG_PALETTE_INIT_OWNER(odyssey2_state, odyssey2)
/* sound hardware */
MCFG_SPEAKER_STANDARD_MONO("mono")
@@ -833,8 +835,9 @@ static MACHINE_CONFIG_START( g7400, g7400_state )
MCFG_SCREEN_RAW_PARAMS( 3540000 * 2, i8244_device::LINE_CLOCKS, i8244_device::START_ACTIVE_SCAN, i8244_device::END_ACTIVE_SCAN, i8245_device::LINES, i8244_device::START_Y, i8244_device::START_Y + i8244_device::SCREEN_HEIGHT )
MCFG_SCREEN_UPDATE_DRIVER(odyssey2_state, screen_update_odyssey2)
- MCFG_GFXDECODE_ADD("gfxdecode", odyssey2 )
- MCFG_PALETTE_LENGTH(16)
+ MCFG_GFXDECODE_ADD("gfxdecode", odyssey2 )
+ MCFG_PALETTE_ADD("palette", 16)
+ MCFG_PALETTE_INIT_OWNER(g7400_state, g7400)
MCFG_I8243_ADD( "i8243", NOOP, WRITE8(g7400_state,i8243_port_w))
@@ -867,8 +870,9 @@ static MACHINE_CONFIG_START( odyssey3, g7400_state )
MCFG_SCREEN_RAW_PARAMS( 3540000 * 2, i8244_device::LINE_CLOCKS, i8244_device::START_ACTIVE_SCAN, i8244_device::END_ACTIVE_SCAN, i8244_device::LINES, i8244_device::START_Y, i8244_device::START_Y + i8244_device::SCREEN_HEIGHT )
MCFG_SCREEN_UPDATE_DRIVER(odyssey2_state, screen_update_odyssey2)
- MCFG_GFXDECODE_ADD("gfxdecode", odyssey2 )
- MCFG_PALETTE_LENGTH(16)
+ MCFG_GFXDECODE_ADD("gfxdecode", odyssey2 )
+ MCFG_PALETTE_ADD("palette", 16)
+ MCFG_PALETTE_INIT_OWNER(g7400_state, g7400)
MCFG_I8243_ADD( "i8243", NOOP, WRITE8(g7400_state,i8243_port_w))
diff --git a/src/mess/drivers/okean240.c b/src/mess/drivers/okean240.c
index 5209e568d58..f02e8b70259 100644
--- a/src/mess/drivers/okean240.c
+++ b/src/mess/drivers/okean240.c
@@ -490,10 +490,10 @@ static MACHINE_CONFIG_START( okean240t, okean240_state )
MCFG_SCREEN_VBLANK_TIME(ATTOSECONDS_IN_USEC(2500)) /* not accurate */
MCFG_SCREEN_SIZE(256, 256)
MCFG_SCREEN_VISIBLE_AREA(0, 255, 0, 255)
- MCFG_PALETTE_LENGTH(2)
- MCFG_PALETTE_INIT_OVERRIDE(driver_device, black_and_white)
MCFG_SCREEN_UPDATE_DRIVER(okean240_state, screen_update_okean240)
+ MCFG_PALETTE_ADD_BLACK_AND_WHITE("palette")
+
MCFG_GENERIC_TERMINAL_ADD(TERMINAL_TAG, terminal_intf)
MACHINE_CONFIG_END
diff --git a/src/mess/drivers/ondra.c b/src/mess/drivers/ondra.c
index 5552a564609..f1fd37d35fb 100644
--- a/src/mess/drivers/ondra.c
+++ b/src/mess/drivers/ondra.c
@@ -136,8 +136,7 @@ static MACHINE_CONFIG_START( ondra, ondra_state )
MCFG_SCREEN_VISIBLE_AREA(0, 320-1, 0, 256-1)
MCFG_SCREEN_UPDATE_DRIVER(ondra_state, screen_update_ondra)
- MCFG_PALETTE_LENGTH(2)
- MCFG_PALETTE_INIT_OVERRIDE(driver_device, black_and_white)
+ MCFG_PALETTE_ADD_BLACK_AND_WHITE("palette")
// sound hardware
diff --git a/src/mess/drivers/orao.c b/src/mess/drivers/orao.c
index e5d3ca2f972..f62fbc9e8e7 100644
--- a/src/mess/drivers/orao.c
+++ b/src/mess/drivers/orao.c
@@ -185,8 +185,7 @@ static MACHINE_CONFIG_START( orao, orao_state )
MCFG_SCREEN_VISIBLE_AREA(0, 256-1, 0, 256-1)
MCFG_SCREEN_UPDATE_DRIVER(orao_state, screen_update_orao)
- MCFG_PALETTE_LENGTH(2)
- MCFG_PALETTE_INIT_OVERRIDE(driver_device, black_and_white)
+ MCFG_PALETTE_ADD_BLACK_AND_WHITE("palette")
/* audio hardware */
diff --git a/src/mess/drivers/oric.c b/src/mess/drivers/oric.c
index 0b8edad8488..e3e9c8e05c5 100644
--- a/src/mess/drivers/oric.c
+++ b/src/mess/drivers/oric.c
@@ -309,12 +309,12 @@ static const unsigned char oric_palette[8*3] =
};
/* Initialise the palette */
-void oric_state::palette_init()
+PALETTE_INIT_MEMBER(oric_state, oric)
{
int i;
for ( i = 0; i < sizeof(oric_palette) / 3; i++ ) {
- palette_set_color_rgb(machine(), i, oric_palette[i*3], oric_palette[i*3+1], oric_palette[i*3+2]);
+ palette.set_pen_color(i, oric_palette[i*3], oric_palette[i*3+1], oric_palette[i*3+2]);
}
}
@@ -381,7 +381,8 @@ static MACHINE_CONFIG_START( oric, oric_state )
MCFG_SCREEN_VISIBLE_AREA(0, 40*6-1, 0, 28*8-1)
MCFG_SCREEN_UPDATE_DRIVER(oric_state, screen_update_oric)
- MCFG_PALETTE_LENGTH(8)
+ MCFG_PALETTE_ADD("palette", 8)
+ MCFG_PALETTE_INIT_OWNER(oric_state, oric)
/* sound hardware */
diff --git a/src/mess/drivers/orion.c b/src/mess/drivers/orion.c
index 9383b60b5e4..b4bc1a26293 100644
--- a/src/mess/drivers/orion.c
+++ b/src/mess/drivers/orion.c
@@ -111,8 +111,8 @@ static MACHINE_CONFIG_START( orion128, orion_state )
MCFG_SCREEN_VISIBLE_AREA(0, 384-1, 0, 256-1)
MCFG_SCREEN_UPDATE_DRIVER(orion_state, screen_update_orion128)
- MCFG_PALETTE_LENGTH(18)
- MCFG_PALETTE_INIT_OVERRIDE(orion_state, orion128 )
+ MCFG_PALETTE_ADD("palette", 18)
+ MCFG_PALETTE_INIT_OWNER(orion_state, orion128 )
MCFG_VIDEO_START_OVERRIDE(orion_state,orion128)
@@ -174,8 +174,8 @@ static MACHINE_CONFIG_START( orionz80, orion_state )
MCFG_SCREEN_VISIBLE_AREA(0, 384-1, 0, 256-1)
MCFG_SCREEN_UPDATE_DRIVER(orion_state, screen_update_orion128)
- MCFG_PALETTE_LENGTH(18)
- MCFG_PALETTE_INIT_OVERRIDE(orion_state, orion128 )
+ MCFG_PALETTE_ADD("palette", 18)
+ MCFG_PALETTE_INIT_OWNER(orion_state, orion128 )
MCFG_VIDEO_START_OVERRIDE(orion_state,orion128)
@@ -236,8 +236,8 @@ static MACHINE_CONFIG_START( orionpro, orion_state )
MCFG_SCREEN_VISIBLE_AREA(0, 384-1, 0, 256-1)
MCFG_SCREEN_UPDATE_DRIVER(orion_state, screen_update_orion128)
- MCFG_PALETTE_LENGTH(18)
- MCFG_PALETTE_INIT_OVERRIDE(orion_state, orion128 )
+ MCFG_PALETTE_ADD("palette", 18)
+ MCFG_PALETTE_INIT_OWNER(orion_state, orion128 )
MCFG_VIDEO_START_OVERRIDE(orion_state,orion128)
diff --git a/src/mess/drivers/osbexec.c b/src/mess/drivers/osbexec.c
index 70704128193..7a232d1aea0 100644
--- a/src/mess/drivers/osbexec.c
+++ b/src/mess/drivers/osbexec.c
@@ -109,7 +109,7 @@ public:
DECLARE_READ8_MEMBER(osbexec_rtc_r);
DECLARE_DRIVER_INIT(osbexec);
virtual void machine_reset();
- virtual void palette_init();
+ DECLARE_PALETTE_INIT(osbexec);
TIMER_CALLBACK_MEMBER(osbexec_video_callback);
DECLARE_READ8_MEMBER(osbexec_pia0_a_r);
DECLARE_WRITE8_MEMBER(osbexec_pia0_a_w);
@@ -307,11 +307,11 @@ static INPUT_PORTS_START( osbexec )
INPUT_PORTS_END
-void osbexec_state::palette_init()
+PALETTE_INIT_MEMBER(osbexec_state, osbexec)
{
- palette_set_color_rgb( machine(), 0, 0, 0, 0 ); /* Black */
- palette_set_color_rgb( machine(), 1, 0, 255, 0 ); /* Full */
- palette_set_color_rgb( machine(), 2, 0, 128, 0 ); /* Dimmed */
+ palette.set_pen_color( 0, 0, 0, 0 ); /* Black */
+ palette.set_pen_color( 1, 0, 255, 0 ); /* Full */
+ palette.set_pen_color( 2, 0, 128, 0 ); /* Dimmed */
}
void osbexec_state::video_start()
@@ -611,7 +611,8 @@ static MACHINE_CONFIG_START( osbexec, osbexec_state )
MCFG_SCREEN_UPDATE_DRIVER(osbexec_state, screen_update)
MCFG_SCREEN_RAW_PARAMS( MAIN_CLOCK/2, 768, 0, 640, 260, 0, 240 ) /* May not be correct */
- MCFG_PALETTE_LENGTH( 3 )
+ MCFG_PALETTE_ADD( "palette", 3 )
+ MCFG_PALETTE_INIT_OWNER(osbexec_state, osbexec)
MCFG_SPEAKER_STANDARD_MONO( "mono" )
MCFG_SOUND_ADD("speaker", SPEAKER_SOUND, 0)
diff --git a/src/mess/drivers/osborne1.c b/src/mess/drivers/osborne1.c
index dd1bb6a8436..ce73cd56640 100644
--- a/src/mess/drivers/osborne1.c
+++ b/src/mess/drivers/osborne1.c
@@ -142,11 +142,11 @@ static INPUT_PORTS_START( osborne1 )
INPUT_PORTS_END
-void osborne1_state::palette_init()
+PALETTE_INIT_MEMBER(osborne1_state, osborne1)
{
- palette_set_color_rgb( machine(), 0, 0, 0, 0 ); /* Black */
- palette_set_color_rgb( machine(), 1, 0, 255, 0 ); /* Full */
- palette_set_color_rgb( machine(), 2, 0, 128, 0 ); /* Dimmed */
+ palette.set_pen_color( 0, 0, 0, 0 ); /* Black */
+ palette.set_pen_color( 1, 0, 255, 0 ); /* Full */
+ palette.set_pen_color( 2, 0, 128, 0 ); /* Dimmed */
}
@@ -243,7 +243,8 @@ static MACHINE_CONFIG_START( osborne1, osborne1_state )
MCFG_SCREEN_UPDATE_DRIVER(osborne1_state, screen_update)
MCFG_SCREEN_RAW_PARAMS( MAIN_CLOCK/2, 512, 0, 416, 260, 0, 240 )
MCFG_GFXDECODE_ADD("gfxdecode", osborne1)
- MCFG_PALETTE_LENGTH( 3 )
+ MCFG_PALETTE_ADD( "palette", 3 )
+ MCFG_PALETTE_INIT_OWNER(osborne1_state, osborne1)
MCFG_SPEAKER_STANDARD_MONO( "mono" )
MCFG_SOUND_ADD( "beeper", BEEP, 0 )
diff --git a/src/mess/drivers/p112.c b/src/mess/drivers/p112.c
index f5d0635cdc8..fa744747a8f 100644
--- a/src/mess/drivers/p112.c
+++ b/src/mess/drivers/p112.c
@@ -95,8 +95,7 @@ static MACHINE_CONFIG_START( p112, p112_state )
MCFG_SCREEN_VISIBLE_AREA(0, 240-1, 0, 320-1)
MCFG_SCREEN_UPDATE_DRIVER(p112_state, screen_update_p112)
- MCFG_PALETTE_LENGTH(2)
- MCFG_PALETTE_INIT_OVERRIDE(driver_device, black_and_white)
+ MCFG_PALETTE_ADD_BLACK_AND_WHITE("palette")
MACHINE_CONFIG_END
diff --git a/src/mess/drivers/p2000t.c b/src/mess/drivers/p2000t.c
index c4b9f48fdb5..f6d99182931 100644
--- a/src/mess/drivers/p2000t.c
+++ b/src/mess/drivers/p2000t.c
@@ -76,10 +76,10 @@ static const gfx_layout p2000m_charlayout =
PALETTE_INIT_MEMBER(p2000t_state,p2000m)
{
- palette_set_color(machine(),0,rgb_t::white); /* white */
- palette_set_color(machine(),1,rgb_t::black); /* black */
- palette_set_color(machine(),2,rgb_t::black); /* black */
- palette_set_color(machine(),3,rgb_t::white); /* white */
+ palette.set_pen_color(0,rgb_t::white); /* white */
+ palette.set_pen_color(1,rgb_t::black); /* black */
+ palette.set_pen_color(2,rgb_t::black); /* black */
+ palette.set_pen_color(3,rgb_t::white); /* white */
}
static GFXDECODE_START( p2000m )
@@ -260,9 +260,9 @@ static MACHINE_CONFIG_START( p2000m, p2000t_state )
MCFG_SCREEN_VISIBLE_AREA(0, 80 * 12 - 1, 0, 24 * 20 - 1)
MCFG_VIDEO_START_OVERRIDE(p2000t_state,p2000m)
MCFG_SCREEN_UPDATE_DRIVER(p2000t_state, screen_update_p2000m)
- MCFG_GFXDECODE_ADD("gfxdecode", p2000m )
- MCFG_PALETTE_LENGTH(4)
- MCFG_PALETTE_INIT_OVERRIDE(p2000t_state,p2000m)
+ MCFG_GFXDECODE_ADD("gfxdecode", p2000m )
+ MCFG_PALETTE_ADD("palette", 4)
+ MCFG_PALETTE_INIT_OWNER(p2000t_state,p2000m)
/* sound hardware */
MCFG_SPEAKER_STANDARD_MONO("mono")
diff --git a/src/mess/drivers/palm.c b/src/mess/drivers/palm.c
index a3d9f6739cd..c6eef79abf5 100644
--- a/src/mess/drivers/palm.c
+++ b/src/mess/drivers/palm.c
@@ -156,8 +156,8 @@ void palm_state::machine_reset()
/* THIS IS PRETTY MUCH TOTALLY WRONG AND DOESN'T REFLECT THE MC68328'S INTERNAL FUNCTIONALITY AT ALL! */
PALETTE_INIT_MEMBER(palm_state, palm)
{
- palette_set_color_rgb(machine(), 0, 0x7b, 0x8c, 0x5a);
- palette_set_color_rgb(machine(), 1, 0x00, 0x00, 0x00);
+ palette.set_pen_color(0, 0x7b, 0x8c, 0x5a);
+ palette.set_pen_color(1, 0x00, 0x00, 0x00);
}
@@ -234,8 +234,8 @@ static MACHINE_CONFIG_START( palm, palm_state )
MCFG_SCREEN_SIZE( 160, 220 )
MCFG_SCREEN_VISIBLE_AREA( 0, 159, 0, 219 )
MCFG_SCREEN_UPDATE_DEVICE(MC68328_TAG, mc68328_device, screen_update)
- MCFG_PALETTE_LENGTH( 2 )
- MCFG_PALETTE_INIT_OVERRIDE(palm_state, palm)
+ MCFG_PALETTE_ADD( "palette", 2 )
+ MCFG_PALETTE_INIT_OWNER(palm_state, palm)
MCFG_DEFAULT_LAYOUT(layout_lcd)
/* audio hardware */
diff --git a/src/mess/drivers/palmz22.c b/src/mess/drivers/palmz22.c
index 0fbe1e57948..8c4cfa77239 100644
--- a/src/mess/drivers/palmz22.c
+++ b/src/mess/drivers/palmz22.c
@@ -303,7 +303,7 @@ static MACHINE_CONFIG_START( palmz22, palmz22_state )
MCFG_CPU_ADD("maincpu", ARM920T, 266000000)
MCFG_CPU_PROGRAM_MAP(palmz22_map)
- MCFG_PALETTE_LENGTH(32768)
+ MCFG_PALETTE_ADD("palette", 32768)
MCFG_SCREEN_ADD("screen", LCD)
MCFG_SCREEN_REFRESH_RATE(60)
@@ -315,7 +315,7 @@ static MACHINE_CONFIG_START( palmz22, palmz22_state )
MCFG_SCREEN_UPDATE_DEVICE("s3c2410", s3c2410_device, screen_update)
- MCFG_S3C2410_ADD("s3c2410", 12000000, palmz22_s3c2410_intf)
+ MCFG_S3C2410_ADD("s3c2410", 12000000, palmz22_s3c2410_intf, "palette")
MCFG_NAND_ADD("nand", palmz22_nand_intf)
MACHINE_CONFIG_END
diff --git a/src/mess/drivers/partner.c b/src/mess/drivers/partner.c
index 7097d7b6eef..855f63f9702 100644
--- a/src/mess/drivers/partner.c
+++ b/src/mess/drivers/partner.c
@@ -208,8 +208,8 @@ static MACHINE_CONFIG_START( partner, partner_state )
MCFG_SCREEN_VISIBLE_AREA(0, 78*6-1, 0, 30*10-1)
MCFG_GFXDECODE_ADD("gfxdecode", partner)
- MCFG_PALETTE_LENGTH(3)
- MCFG_PALETTE_INIT_OVERRIDE(partner_state,radio86)
+ MCFG_PALETTE_ADD("palette", 3)
+ MCFG_PALETTE_INIT_OWNER(partner_state,radio86)
MCFG_SPEAKER_STANDARD_MONO("mono")
MCFG_SOUND_WAVE_ADD(WAVE_TAG, "cassette")
diff --git a/src/mess/drivers/paso1600.c b/src/mess/drivers/paso1600.c
index 54a62d5c498..43419bb255d 100644
--- a/src/mess/drivers/paso1600.c
+++ b/src/mess/drivers/paso1600.c
@@ -115,7 +115,7 @@ UINT32 paso1600_state::screen_update_paso1600(screen_device &screen, bitmap_ind1
int pen = (m_p_gvram[count] >> xi) & 1;
if(y < 475 && x*16+xi < 640) /* TODO: safety check */
- bitmap.pix16(y, x*16+xi) = machine().pens[pen];
+ bitmap.pix16(y, x*16+xi) = m_palette->pen(pen);
}
count++;
@@ -144,7 +144,7 @@ UINT32 paso1600_state::screen_update_paso1600(screen_device &screen, bitmap_ind1
if(pen != -1)
if(y*19 < 475 && x*8+xi < 640) /* TODO: safety check */
- bitmap.pix16(y*19+yi, x*8+xi) = machine().pens[pen];
+ bitmap.pix16(y*19+yi, x*8+xi) = m_palette->pen(pen);
}
}
}
@@ -160,7 +160,7 @@ UINT32 paso1600_state::screen_update_paso1600(screen_device &screen, bitmap_ind1
{
x = mc6845_cursor_addr % mc6845_h_display;
y = mc6845_cursor_addr / mc6845_h_display;
- bitmap.pix16(y*mc6845_tile_height+yi, x*8+xi) = machine().pens[7];
+ bitmap.pix16(y*mc6845_tile_height+yi, x*8+xi) = m_palette->pen(7);
}
}
}
@@ -351,8 +351,8 @@ static MACHINE_CONFIG_START( paso1600, paso1600_state )
MCFG_SCREEN_VISIBLE_AREA(0, 640-1, 0, 480-1)
MCFG_SCREEN_UPDATE_DRIVER(paso1600_state, screen_update_paso1600)
MCFG_GFXDECODE_ADD("gfxdecode", paso1600)
- MCFG_PALETTE_LENGTH(8)
-// MCFG_PALETTE_INIT_OVERRIDE(driver_device, black_and_white)
+ MCFG_PALETTE_ADD("palette", 8)
+// MCFG_PALETTE_INIT(black_and_white)
/* Devices */
MCFG_MC6845_ADD("crtc", H46505, "screen", 16000000/4, mc6845_intf) /* unknown clock, hand tuned to get ~60 fps */
diff --git a/src/mess/drivers/pasogo.c b/src/mess/drivers/pasogo.c
index 07895abb85b..cdcf270781b 100644
--- a/src/mess/drivers/pasogo.c
+++ b/src/mess/drivers/pasogo.c
@@ -172,7 +172,7 @@ public:
ems_t m_ems;
DECLARE_DRIVER_INIT(pasogo);
virtual void machine_reset();
- virtual void palette_init();
+ DECLARE_PALETTE_INIT(pasogo);
UINT32 screen_update_pasogo(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
INTERRUPT_GEN_MEMBER(pasogo_interrupt);
TIMER_DEVICE_CALLBACK_MEMBER(vg230_timer);
@@ -598,13 +598,13 @@ static const unsigned char pasogo_palette[][3] =
};
-void pasogo_state::palette_init()
+PALETTE_INIT_MEMBER(pasogo_state, pasogo)
{
int i;
for ( i = 0; i < ARRAY_LENGTH(pasogo_palette); i++ )
{
- palette_set_color_rgb(machine(), i, pasogo_palette[i][0], pasogo_palette[i][1], pasogo_palette[i][2]);
+ palette.set_pen_color(i, pasogo_palette[i][0], pasogo_palette[i][1], pasogo_palette[i][2]);
}
}
@@ -979,7 +979,8 @@ static MACHINE_CONFIG_START( pasogo, pasogo_state )
MCFG_SCREEN_VISIBLE_AREA(0, 640-1, 0, 400-1)
MCFG_SCREEN_UPDATE_DRIVER(pasogo_state, screen_update_pasogo)
- MCFG_PALETTE_LENGTH(ARRAY_LENGTH(pasogo_palette))
+ MCFG_PALETTE_ADD("palette", ARRAY_LENGTH(pasogo_palette))
+ MCFG_PALETTE_INIT_OWNER(pasogo_state, pasogo)
MCFG_SPEAKER_STANDARD_MONO("mono")
MCFG_SOUND_ADD("speaker", SPEAKER_SOUND, 0)
diff --git a/src/mess/drivers/pasopia.c b/src/mess/drivers/pasopia.c
index 318d99004d1..59cdc0b7f6d 100644
--- a/src/mess/drivers/pasopia.c
+++ b/src/mess/drivers/pasopia.c
@@ -369,7 +369,7 @@ static MACHINE_CONFIG_START( pasopia, pasopia_state )
MCFG_SCREEN_VISIBLE_AREA(0, 640-1, 0, 480-1)
MCFG_SCREEN_UPDATE_DEVICE("crtc", h46505_device, screen_update)
MCFG_GFXDECODE_ADD("gfxdecode", pasopia)
- MCFG_PALETTE_LENGTH(8)
+ MCFG_PALETTE_ADD("palette", 8)
/* Devices */
MCFG_MC6845_ADD("crtc", H46505, "screen", XTAL_4MHz/4, mc6845_intf) /* unknown clock, hand tuned to get ~60 fps */
diff --git a/src/mess/drivers/pasopia7.c b/src/mess/drivers/pasopia7.c
index a9c78d6640c..23ce3d4dae1 100644
--- a/src/mess/drivers/pasopia7.c
+++ b/src/mess/drivers/pasopia7.c
@@ -160,7 +160,7 @@ void pasopia7_state::draw_cg4_screen(bitmap_ind16 &bitmap,const rectangle &clipr
color = pen_g<<2 | pen_r<<1 | pen_b<<0;
- bitmap.pix16(y+yi, x+xi) = machine().pens[color];
+ bitmap.pix16(y+yi, x+xi) = m_palette->pen(color);
}
count+=8;
}
@@ -192,7 +192,7 @@ void pasopia7_state::draw_tv_screen(bitmap_ind16 &bitmap,const rectangle &clipre
int pen;
pen = ((gfx_data[tile*8+yi]>>(7-xi)) & 1) ? color : 0;
- bitmap.pix16(y*8+yi, x*8+xi) = machine().pens[pen];
+ bitmap.pix16(y*8+yi, x*8+xi) = m_palette->pen(pen);
}
}
@@ -216,7 +216,7 @@ void pasopia7_state::draw_tv_screen(bitmap_ind16 &bitmap,const rectangle &clipre
{
for(xc=0;xc<8;xc++)
{
- bitmap.pix16(y*8-yc+7, x*8+xc) = machine().pens[7];
+ bitmap.pix16(y*8-yc+7, x*8+xc) = m_palette->pen(7);
}
}
}
@@ -257,7 +257,7 @@ void pasopia7_state::draw_mixed_screen(bitmap_ind16 &bitmap,const rectangle &cli
pen = pen_g<<2 | pen_r<<1 | pen_b<<0;
- bitmap.pix16(y*8+yi, x*8+xi) = machine().pens[pen];
+ bitmap.pix16(y*8+yi, x*8+xi) = m_palette->pen(pen);
}
}
else
@@ -269,7 +269,7 @@ void pasopia7_state::draw_mixed_screen(bitmap_ind16 &bitmap,const rectangle &cli
int pen;
pen = ((gfx_data[tile*8+yi]>>(7-xi)) & 1) ? color : 0;
- bitmap.pix16(y*8+yi, x*8+xi) = machine().pens[pen];
+ bitmap.pix16(y*8+yi, x*8+xi) = m_palette->pen(pen);
}
}
}
@@ -294,7 +294,7 @@ void pasopia7_state::draw_mixed_screen(bitmap_ind16 &bitmap,const rectangle &cli
{
for(xc=0;xc<8;xc++)
{
- bitmap.pix16(y*8-yc+7, x*8+xc) = machine().pens[7];
+ bitmap.pix16(y*8-yc+7, x*8+xc) = m_palette->pen(7);
}
}
}
@@ -309,7 +309,7 @@ UINT32 pasopia7_state::screen_update_pasopia7(screen_device &screen, bitmap_ind1
{
int width;
- bitmap.fill(machine().pens[0], cliprect);
+ bitmap.fill(m_palette->pen(0), cliprect);
width = m_x_width ? 80 : 40;
@@ -956,7 +956,7 @@ PALETTE_INIT_MEMBER(pasopia7_state,p7_raster)
int i;
for( i = 0; i < 8; i++)
- palette_set_color_rgb(machine(), i, pal1bit(i >> 1), pal1bit(i >> 2), pal1bit(i >> 0));
+ palette.set_pen_color(i, pal1bit(i >> 1), pal1bit(i >> 2), pal1bit(i >> 0));
}
/* TODO: palette values are mostly likely to be wrong in there */
@@ -964,10 +964,10 @@ PALETTE_INIT_MEMBER(pasopia7_state,p7_lcd)
{
int i;
- palette_set_color_rgb(machine(), 0, 0xa0, 0xa8, 0xa0);
+ palette.set_pen_color(0, 0xa0, 0xa8, 0xa0);
for( i = 1; i < 8; i++)
- palette_set_color_rgb(machine(), i, 0x30, 0x38, 0x10);
+ palette.set_pen_color(i, 0x30, 0x38, 0x10);
}
void pasopia7_state::fdc_irq(bool state)
@@ -1015,9 +1015,9 @@ static MACHINE_CONFIG_DERIVED( p7_raster, p7_base )
MCFG_SCREEN_VISIBLE_AREA(0, 640-1, 0, 32-1)
MCFG_VIDEO_START_OVERRIDE(pasopia7_state,pasopia7)
MCFG_SCREEN_UPDATE_DRIVER(pasopia7_state, screen_update_pasopia7)
- MCFG_PALETTE_LENGTH(8)
- MCFG_PALETTE_INIT_OVERRIDE(pasopia7_state,p7_raster)
- MCFG_GFXDECODE_ADD("gfxdecode", pasopia7 )
+ MCFG_PALETTE_ADD("palette", 8)
+ MCFG_PALETTE_INIT_OWNER(pasopia7_state,p7_raster)
+ MCFG_GFXDECODE_ADD("gfxdecode", pasopia7 )
MCFG_MC6845_ADD("crtc", H46505, "screen", VDP_CLOCK, mc6845_intf) /* unknown clock, hand tuned to get ~60 fps */
MACHINE_CONFIG_END
@@ -1031,9 +1031,9 @@ static MACHINE_CONFIG_DERIVED( p7_lcd, p7_base )
MCFG_SCREEN_VISIBLE_AREA(0, 640-1, 0, 200-1)
MCFG_VIDEO_START_OVERRIDE(pasopia7_state,pasopia7)
MCFG_SCREEN_UPDATE_DRIVER(pasopia7_state, screen_update_pasopia7)
- MCFG_PALETTE_LENGTH(8)
- MCFG_PALETTE_INIT_OVERRIDE(pasopia7_state,p7_lcd)
- MCFG_GFXDECODE_ADD("gfxdecode", pasopia7 )
+ MCFG_PALETTE_ADD("palette", 8)
+ MCFG_PALETTE_INIT_OWNER(pasopia7_state,p7_lcd)
+ MCFG_GFXDECODE_ADD("gfxdecode", pasopia7 )
MCFG_MC6845_ADD("crtc", H46505, "screen", LCD_CLOCK, mc6845_intf) /* unknown clock, hand tuned to get ~60 fps */
MCFG_DEFAULT_LAYOUT( layout_lcd )
diff --git a/src/mess/drivers/pb1000.c b/src/mess/drivers/pb1000.c
index 1cbc5c24aa5..7ba27db5b46 100644
--- a/src/mess/drivers/pb1000.c
+++ b/src/mess/drivers/pb1000.c
@@ -52,7 +52,7 @@ public:
UINT16 pb1000_kb_r(running_machine &machine);
void kb_matrix_w(running_machine &machine, UINT8 matrix);
UINT16 read_touchscreen(running_machine &machine, UINT8 line);
- virtual void palette_init();
+ DECLARE_PALETTE_INIT(pb1000);
TIMER_CALLBACK_MEMBER(keyboard_timer);
};
@@ -280,10 +280,10 @@ static INPUT_PORTS_START( pb2000c )
PORT_BIT(0xffff, IP_ACTIVE_HIGH, IPT_UNUSED)
INPUT_PORTS_END
-void pb1000_state::palette_init()
+PALETTE_INIT_MEMBER(pb1000_state, pb1000)
{
- palette_set_color(machine(), 0, rgb_t(138, 146, 148));
- palette_set_color(machine(), 1, rgb_t(92, 83, 88));
+ palette.set_pen_color(0, rgb_t(138, 146, 148));
+ palette.set_pen_color(1, rgb_t(92, 83, 88));
}
@@ -519,8 +519,9 @@ static MACHINE_CONFIG_START( pb1000, pb1000_state )
MCFG_SCREEN_SIZE(192, 32)
MCFG_SCREEN_VISIBLE_AREA(0, 192-1, 0, 32-1)
MCFG_DEFAULT_LAYOUT(layout_lcd)
- MCFG_PALETTE_LENGTH(2)
- MCFG_GFXDECODE_ADD("gfxdecode", pb1000 )
+ MCFG_PALETTE_ADD("palette", 2)
+ MCFG_PALETTE_INIT_OWNER(pb1000_state, pb1000)
+ MCFG_GFXDECODE_ADD("gfxdecode", pb1000 )
MCFG_HD44352_ADD("hd44352", 910000, hd44352_pb1000_conf)
diff --git a/src/mess/drivers/pc.c b/src/mess/drivers/pc.c
index 8952e08a195..f78b916c662 100644
--- a/src/mess/drivers/pc.c
+++ b/src/mess/drivers/pc.c
@@ -837,6 +837,7 @@ static MACHINE_CONFIG_START( pccga, pc_state )
MCFG_RS232_CTS_HANDLER(DEVWRITELINE("ins8250_1", ins8250_uart_device, cts_w))
MCFG_FRAGMENT_ADD( pcvideo_cga )
+
MCFG_GFXDECODE_ADD("gfxdecode", ibm5150)
/* sound hardware */
@@ -961,6 +962,7 @@ static MACHINE_CONFIG_START( europc, europc_pc_state )
/* video hardware */
MCFG_FRAGMENT_ADD( pcvideo_aga )
+
MCFG_GFXDECODE_ADD("gfxdecode", europc)
/* sound hardware */
@@ -1045,6 +1047,7 @@ static MACHINE_CONFIG_START( t1000hx, tandy_pc_state )
/* video hardware */
MCFG_PCVIDEO_T1000_ADD("pcvideo_t1000")
+
MCFG_GFXDECODE_ADD("gfxdecode", t1000)
/* sound hardware */
@@ -1120,6 +1123,7 @@ static MACHINE_CONFIG_START( t1000_16, tandy_pc_state )
/* video hardware */
MCFG_PCVIDEO_T1000_ADD("pcvideo_t1000")
+
MCFG_GFXDECODE_ADD("gfxdecode", t1000)
/* sound hardware */
@@ -1196,6 +1200,7 @@ static MACHINE_CONFIG_START( t1000_286, tandy_pc_state )
/* video hardware */
MCFG_PCVIDEO_T1000_ADD("pcvideo_t1000")
+
MCFG_GFXDECODE_ADD("gfxdecode", t1000)
/* sound hardware */
@@ -1281,6 +1286,7 @@ static MACHINE_CONFIG_START( ibmpcjr, tandy_pc_state )
/* video hardware */
MCFG_PCVIDEO_PCJR_ADD("pcvideo_pcjr")
+
MCFG_GFXDECODE_ADD("gfxdecode", ibmpcjr)
/* sound hardware */
@@ -1372,6 +1378,7 @@ static MACHINE_CONFIG_START( asst128, pc_state )
/* video hardware */
MCFG_FRAGMENT_ADD( pcvideo_mc1502 )
+
MCFG_GFXDECODE_ADD("gfxdecode", ibmpcjr)
/* sound hardware */
@@ -1527,6 +1534,7 @@ static MACHINE_CONFIG_START( poisk2, pc_state )
/* video hardware */
MCFG_FRAGMENT_ADD( pcvideo_poisk2 )
+
MCFG_GFXDECODE_ADD("gfxdecode", ibm5150)
/* sound hardware */
@@ -1596,6 +1604,7 @@ static MACHINE_CONFIG_START( zenith, pc_state )
/* video hardware */
MCFG_FRAGMENT_ADD( pcvideo_cga )
+
MCFG_GFXDECODE_ADD("gfxdecode", ibm5150)
/* sound hardware */
@@ -1665,6 +1674,7 @@ static MACHINE_CONFIG_START( olivetti, pc_state )
/* video hardware */
MCFG_FRAGMENT_ADD( pcvideo_cga )
+
MCFG_GFXDECODE_ADD("gfxdecode", ibm5150)
/* sound hardware */
@@ -1734,6 +1744,7 @@ static MACHINE_CONFIG_START( ibm5550, pc_state )
/* video hardware */
MCFG_FRAGMENT_ADD( pcvideo_cga )
+
MCFG_GFXDECODE_ADD("gfxdecode", ibm5150)
/* sound hardware */
diff --git a/src/mess/drivers/pc100.c b/src/mess/drivers/pc100.c
index 15a08b73736..e66545ef6ec 100644
--- a/src/mess/drivers/pc100.c
+++ b/src/mess/drivers/pc100.c
@@ -164,7 +164,7 @@ UINT32 pc100_state::screen_update_pc100(screen_device &screen, bitmap_ind16 &bit
dot |= pen[pen_i]<<pen_i;
if(y < 512 && x*16+xi < 768) /* TODO: safety check */
- bitmap.pix16(y, x*16+xi) = machine().pens[dot];
+ bitmap.pix16(y, x*16+xi) = m_palette->pen(dot);
}
count++;
@@ -254,7 +254,7 @@ WRITE16_MEMBER( pc100_state::pc100_paletteram_w )
g = (m_palram[offset] >> 3) & 7;
b = (m_palram[offset] >> 6) & 7;
- palette_set_color_rgb(machine(), offset, pal3bit(r),pal3bit(g),pal3bit(b));
+ m_palette->set_pen_color(offset, pal3bit(r),pal3bit(g),pal3bit(b));
}
}
@@ -532,8 +532,8 @@ static MACHINE_CONFIG_START( pc100, pc100_state )
MCFG_SCREEN_RAW_PARAMS(MASTER_CLOCK*4, 1024, 0, 768, 264*2, 0, 512)
MCFG_SCREEN_UPDATE_DRIVER(pc100_state, screen_update_pc100)
MCFG_GFXDECODE_ADD("gfxdecode", pc100)
- MCFG_PALETTE_LENGTH(16)
-// MCFG_PALETTE_INIT_OVERRIDE(driver_device, black_and_white)
+ MCFG_PALETTE_ADD("palette", 16)
+// MCFG_PALETTE_INIT(black_and_white)
MCFG_SPEAKER_STANDARD_MONO("mono")
diff --git a/src/mess/drivers/pc1500.c b/src/mess/drivers/pc1500.c
index 819e8ead110..8c84a58ef1a 100644
--- a/src/mess/drivers/pc1500.c
+++ b/src/mess/drivers/pc1500.c
@@ -43,7 +43,7 @@ public:
DECLARE_WRITE8_MEMBER( port_c_w );
DECLARE_READ8_MEMBER( pc1500_kb_r );
- virtual void palette_init();
+ DECLARE_PALETTE_INIT(pc1500);
};
static ADDRESS_MAP_START( pc1500_mem , AS_PROGRAM, 8, pc1500_state)
@@ -258,10 +258,10 @@ READ8_MEMBER( pc1500_state::port_a_r )
return 0xff;
}
-void pc1500_state::palette_init()
+PALETTE_INIT_MEMBER(pc1500_state, pc1500)
{
- palette_set_color(machine(), 0, rgb_t(138, 146, 148));
- palette_set_color(machine(), 1, rgb_t(92, 83, 88));
+ palette.set_pen_color(0, rgb_t(138, 146, 148));
+ palette.set_pen_color(1, rgb_t(92, 83, 88));
}
static const lh5810_interface lh5810_pc1500_config =
@@ -287,7 +287,8 @@ static MACHINE_CONFIG_START( pc1500, pc1500_state )
MCFG_SCREEN_SIZE(156, 8)
MCFG_SCREEN_VISIBLE_AREA(0, 156-1, 0, 7-1)
MCFG_DEFAULT_LAYOUT(layout_pc1500)
- MCFG_PALETTE_LENGTH(2)
+ MCFG_PALETTE_ADD("palette", 2)
+ MCFG_PALETTE_INIT_OWNER(pc1500_state, pc1500)
MCFG_LH5810_ADD("lh5810", lh5810_pc1500_config)
diff --git a/src/mess/drivers/pc2000.c b/src/mess/drivers/pc2000.c
index dd0166f2193..7522f33b338 100644
--- a/src/mess/drivers/pc2000.c
+++ b/src/mess/drivers/pc2000.c
@@ -58,7 +58,7 @@ public:
DECLARE_WRITE8_MEMBER( rombank2_w );
DECLARE_READ8_MEMBER( beep_r );
DECLARE_WRITE8_MEMBER( beep_w );
- virtual void palette_init();
+ DECLARE_PALETTE_INIT(pc2000);
};
class gl3000s_state : public pc2000_state
@@ -803,10 +803,10 @@ void pc1000_state::machine_reset()
m_bank1->set_entry(0);
}
-void pc2000_state::palette_init()
+PALETTE_INIT_MEMBER(pc2000_state, pc2000)
{
- palette_set_color(machine(), 0, rgb_t(138, 146, 148));
- palette_set_color(machine(), 1, rgb_t(92, 83, 88));
+ palette.set_pen_color(0, rgb_t(138, 146, 148));
+ palette.set_pen_color(1, rgb_t(92, 83, 88));
}
static const gfx_layout hd44780_charlayout =
@@ -842,7 +842,8 @@ static MACHINE_CONFIG_START( pc2000, pc2000_state )
MCFG_SCREEN_SIZE(120, 18) //2x20 chars
MCFG_SCREEN_VISIBLE_AREA(0, 120-1, 0, 18-1)
- MCFG_PALETTE_LENGTH(2)
+ MCFG_PALETTE_ADD("palette", 2)
+ MCFG_PALETTE_INIT_OWNER(pc2000_state, pc2000)
MCFG_GFXDECODE_ADD("gfxdecode", pc2000)
MCFG_DEFAULT_LAYOUT(layout_lcd)
diff --git a/src/mess/drivers/pc4.c b/src/mess/drivers/pc4.c
index a9d9b683701..b1669919ad7 100644
--- a/src/mess/drivers/pc4.c
+++ b/src/mess/drivers/pc4.c
@@ -161,10 +161,10 @@ static INPUT_PORTS_START( pc4 )
PORT_BIT(0x80, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_UNUSED
INPUT_PORTS_END
-void pc4_state::palette_init()
+PALETTE_INIT_MEMBER(pc4_state, pc4)
{
- palette_set_color(machine(), 0, rgb_t(138, 146, 148));
- palette_set_color(machine(), 1, rgb_t(92, 83, 88));
+ palette.set_pen_color(0, rgb_t(138, 146, 148));
+ palette.set_pen_color(1, rgb_t(92, 83, 88));
}
static const gfx_layout pc4_charlayout =
@@ -230,7 +230,8 @@ static MACHINE_CONFIG_START( pc4, pc4_state )
MCFG_SCREEN_SIZE(240, 36)
MCFG_SCREEN_VISIBLE_AREA(0, 240-1, 0, 36-1)
MCFG_DEFAULT_LAYOUT(layout_lcd)
- MCFG_PALETTE_LENGTH(2)
+ MCFG_PALETTE_ADD("palette", 2)
+ MCFG_PALETTE_INIT_OWNER(pc4_state, pc4)
MCFG_GFXDECODE_ADD("gfxdecode", pc4)
/* sound hardware */
diff --git a/src/mess/drivers/pc6001.c b/src/mess/drivers/pc6001.c
index 53225f5c27e..b318707d3b2 100644
--- a/src/mess/drivers/pc6001.c
+++ b/src/mess/drivers/pc6001.c
@@ -247,7 +247,7 @@ public:
virtual void machine_start();
virtual void machine_reset();
virtual void video_start();
- virtual void palette_init();
+ DECLARE_PALETTE_INIT(pc6001);
DECLARE_MACHINE_RESET(pc6001m2);
DECLARE_PALETTE_INIT(pc6001m2);
DECLARE_MACHINE_RESET(pc6001sr);
@@ -362,7 +362,7 @@ void pc6001_state::draw_gfx_mode4(bitmap_ind16 &bitmap,const rectangle &cliprect
color = ((tile)>>(7-xi) & 1) ? fgcol : 0;
- bitmap.pix16((y+24), (x*8+xi)+32) = machine().pens[color];
+ bitmap.pix16((y+24), (x*8+xi)+32) = m_palette->pen(color);
}
}
else
@@ -373,8 +373,8 @@ void pc6001_state::draw_gfx_mode4(bitmap_ind16 &bitmap,const rectangle &cliprect
color = (attr & 2) ? (pen_wattr[col_setting-1][fgcol]) : (pen_gattr[col_setting-1][fgcol]);
- bitmap.pix16((y+24), ((x*8+xi*2)+0)+32) = machine().pens[color];
- bitmap.pix16((y+24), ((x*8+xi*2)+1)+32) = machine().pens[color];
+ bitmap.pix16((y+24), ((x*8+xi*2)+0)+32) = m_palette->pen(color);
+ bitmap.pix16((y+24), ((x*8+xi*2)+1)+32) = m_palette->pen(color);
}
}
}
@@ -407,7 +407,7 @@ void pc6001_state::draw_bitmap_2bpp(bitmap_ind16 &bitmap,const rectangle &clipre
color = ((tile >> i) & 3)+8;
color+= col_bank;
- bitmap.pix16(((y*shrink_y+yi)+24), (x*shrink_x+((shrink_x-1)-xi))+32) = machine().pens[color];
+ bitmap.pix16(((y*shrink_y+yi)+24), (x*shrink_x+((shrink_x-1)-xi))+32) = m_palette->pen(color);
}
}
}
@@ -430,9 +430,9 @@ void pc6001_state::draw_bitmap_2bpp(bitmap_ind16 &bitmap,const rectangle &clipre
color = ((tile >> i) & 3)+8;
color+= col_bank;
- bitmap.pix16((((y+0)*shrink_y+yi)+24), (x*shrink_x+((shrink_x-1)-xi))+32) = machine().pens[color];
- bitmap.pix16((((y+1)*shrink_y+yi)+24), (x*shrink_x+((shrink_x-1)-xi))+32) = machine().pens[color];
- bitmap.pix16((((y+2)*shrink_y+yi)+24), (x*shrink_x+((shrink_x-1)-xi))+32) = machine().pens[color];
+ bitmap.pix16((((y+0)*shrink_y+yi)+24), (x*shrink_x+((shrink_x-1)-xi))+32) = m_palette->pen(color);
+ bitmap.pix16((((y+1)*shrink_y+yi)+24), (x*shrink_x+((shrink_x-1)-xi))+32) = m_palette->pen(color);
+ bitmap.pix16((((y+2)*shrink_y+yi)+24), (x*shrink_x+((shrink_x-1)-xi))+32) = m_palette->pen(color);
}
}
}
@@ -467,7 +467,7 @@ void pc6001_state::draw_tile_3bpp(bitmap_ind16 &bitmap,const rectangle &cliprect
color = ((tile >> i) & 1) ? pen+8 : 0;
- bitmap.pix16(((y*12+(11-yi))+24), (x*8+(7-xi))+32) = machine().pens[color];
+ bitmap.pix16(((y*12+(11-yi))+24), (x*8+(7-xi))+32) = m_palette->pen(color);
}
}
}
@@ -503,7 +503,7 @@ void pc6001_state::draw_tile_text(bitmap_ind16 &bitmap,const rectangle &cliprect
color = pen ? fgcol : 0;
}
- bitmap.pix16(((y*12+yi)+24), (x*8+xi)+32) = machine().pens[color];
+ bitmap.pix16(((y*12+yi)+24), (x*8+xi)+32) = m_palette->pen(color);
}
}
}
@@ -525,7 +525,7 @@ void pc6001_state::draw_border(bitmap_ind16 &bitmap,const rectangle &cliprect,in
else
color = 0; //FIXME: other modes not yet checked
- bitmap.pix16(y, x) = machine().pens[color];
+ bitmap.pix16(y, x) = m_palette->pen(color);
}
}
}
@@ -617,9 +617,9 @@ UINT32 pc6001_state::screen_update_pc6001m2(screen_device &screen, bitmap_ind16
color |= ((pen[1] & 2) << 2);
if (cliprect.contains((x+i)*2+0, y))
- bitmap.pix16(y, (x+i)*2+0) = machine().pens[color];
+ bitmap.pix16(y, (x+i)*2+0) = m_palette->pen(color);
if (cliprect.contains((x+i)*2+1, y))
- bitmap.pix16(y, (x+i)*2+1) = machine().pens[color];
+ bitmap.pix16(y, (x+i)*2+1) = m_palette->pen(color);
}
count++;
@@ -665,7 +665,7 @@ UINT32 pc6001_state::screen_update_pc6001m2(screen_device &screen, bitmap_ind16
}
if (cliprect.contains(x+i, y))
- bitmap.pix16(y, (x+i)) = machine().pens[color];
+ bitmap.pix16(y, (x+i)) = m_palette->pen(color);
}
count++;
@@ -705,7 +705,7 @@ UINT32 pc6001_state::screen_update_pc6001m2(screen_device &screen, bitmap_ind16
color = pen ? fgcol : bgcol;
if (cliprect.contains(x*8+xi, y*12+yi))
- bitmap.pix16(((y*12+yi)), (x*8+xi)) = machine().pens[color];
+ bitmap.pix16(((y*12+yi)), (x*8+xi)) = m_palette->pen(color);
}
}
}
@@ -749,7 +749,7 @@ UINT32 pc6001_state::screen_update_pc6001sr(screen_device &screen, bitmap_ind16
color = pen ? fgcol : bgcol;
if (cliprect.contains(x*8+xi, y*12+yi))
- bitmap.pix16(((y*12+yi)), (x*8+xi)) = machine().pens[color];
+ bitmap.pix16(((y*12+yi)), (x*8+xi)) = m_palette->pen(color);
}
}
}
@@ -768,42 +768,42 @@ UINT32 pc6001_state::screen_update_pc6001sr(screen_device &screen, bitmap_ind16
color = m_video_ram[count] & 0x0f;
if (cliprect.contains(x+0, y+0))
- bitmap.pix16((y+0), (x+0)) = machine().pens[color+0x10];
+ bitmap.pix16((y+0), (x+0)) = m_palette->pen(color+0x10);
color = (m_video_ram[count] & 0xf0) >> 4;
if (cliprect.contains(x+1, y+0))
- bitmap.pix16((y+0), (x+1)) = machine().pens[color+0x10];
+ bitmap.pix16((y+0), (x+1)) = m_palette->pen(color+0x10);
color = m_video_ram[count+1] & 0x0f;
if (cliprect.contains(x+2, y+0))
- bitmap.pix16((y+0), (x+2)) = machine().pens[color+0x10];
+ bitmap.pix16((y+0), (x+2)) = m_palette->pen(color+0x10);
color = (m_video_ram[count+1] & 0xf0) >> 4;
if (cliprect.contains(x+3, y+0))
- bitmap.pix16((y+0), (x+3)) = machine().pens[color+0x10];
+ bitmap.pix16((y+0), (x+3)) = m_palette->pen(color+0x10);
color = m_video_ram[count+2] & 0x0f;
if (cliprect.contains(x+0, y+1))
- bitmap.pix16((y+1), (x+0)) = machine().pens[color+0x10];
+ bitmap.pix16((y+1), (x+0)) = m_palette->pen(color+0x10);
color = (m_video_ram[count+2] & 0xf0) >> 4;
if (cliprect.contains(x+1, y+1))
- bitmap.pix16((y+1), (x+1)) = machine().pens[color+0x10];
+ bitmap.pix16((y+1), (x+1)) = m_palette->pen(color+0x10);
color = m_video_ram[count+3] & 0x0f;
if (cliprect.contains(x+2, y+1))
- bitmap.pix16((y+1), (x+2)) = machine().pens[color+0x10];
+ bitmap.pix16((y+1), (x+2)) = m_palette->pen(color+0x10);
color = (m_video_ram[count+3] & 0xf0) >> 4;
if (cliprect.contains(x+3, y+1))
- bitmap.pix16((y+1), (x+3)) = machine().pens[color+0x10];
+ bitmap.pix16((y+1), (x+3)) = m_palette->pen(color+0x10);
count+=4;
@@ -2229,12 +2229,12 @@ static const rgb_t mk2_defcolors[] =
rgb_t(0xff, 0xff, 0xff) /* WHITE */
};
-void pc6001_state::palette_init()
+PALETTE_INIT_MEMBER(pc6001_state, pc6001)
{
int i;
for(i=0;i<8+4;i++)
- palette_set_color(machine(), i+8,defcolors[i]);
+ palette.set_pen_color(i+8,defcolors[i]);
}
PALETTE_INIT_MEMBER(pc6001_state,pc6001m2)
@@ -2242,10 +2242,10 @@ PALETTE_INIT_MEMBER(pc6001_state,pc6001m2)
int i;
for(i=0;i<8;i++)
- palette_set_color(machine(), i+8,defcolors[i]);
+ palette.set_pen_color(i+8,defcolors[i]);
for(i=0x10;i<0x20;i++)
- palette_set_color(machine(), i,mk2_defcolors[i-0x10]);
+ palette.set_pen_color(i,mk2_defcolors[i-0x10]);
}
#if 0
@@ -2329,7 +2329,8 @@ static MACHINE_CONFIG_START( pc6001, pc6001_state )
MCFG_SCREEN_VISIBLE_AREA(0, 319, 0, 239)
- MCFG_PALETTE_LENGTH(16+4)
+ MCFG_PALETTE_ADD("palette", 16+4)
+ MCFG_PALETTE_INIT_OWNER(pc6001_state, pc6001)
MCFG_I8255_ADD( "ppi8255", pc6001_ppi8255_interface )
/* uart */
@@ -2366,8 +2367,10 @@ static MACHINE_CONFIG_DERIVED( pc6001m2, pc6001 )
MCFG_SCREEN_MODIFY("screen")
MCFG_SCREEN_UPDATE_DRIVER(pc6001_state, screen_update_pc6001m2)
- MCFG_PALETTE_LENGTH(16+16)
- MCFG_PALETTE_INIT_OVERRIDE(pc6001_state,pc6001m2)
+
+ MCFG_DEVICE_REMOVE("palette")
+ MCFG_PALETTE_ADD("palette", 16+16)
+ MCFG_PALETTE_INIT_OWNER(pc6001_state,pc6001m2)
/* basic machine hardware */
MCFG_CPU_MODIFY("maincpu")
diff --git a/src/mess/drivers/pc8001.c b/src/mess/drivers/pc8001.c
index eeb44ddcdcf..11f235882a8 100644
--- a/src/mess/drivers/pc8001.c
+++ b/src/mess/drivers/pc8001.c
@@ -352,7 +352,7 @@ INPUT_PORTS_END
/* uPD3301 Interface */
-static const rgb_t PALETTE[] =
+static const rgb_t PALETTE_PC8001[] =
{
rgb_t::black,
rgb_t(0x00, 0x00, 0xff),
@@ -380,7 +380,7 @@ static UPD3301_DISPLAY_PIXELS( pc8001_display_pixels )
{
int color = BIT(data, 7) ^ rvv;
- bitmap.pix32(y, (sx * 8) + i) = PALETTE[color ? 7 : 0];
+ bitmap.pix32(y, (sx * 8) + i) = PALETTE_PC8001[color ? 7 : 0];
data <<= 1;
}
@@ -393,8 +393,8 @@ static UPD3301_DISPLAY_PIXELS( pc8001_display_pixels )
{
int color = BIT(data, 7) ^ rvv;
- bitmap.pix32(y, (sx/2 * 16) + (i * 2)) = PALETTE[color ? 7 : 0];
- bitmap.pix32(y, (sx/2 * 16) + (i * 2) + 1) = PALETTE[color ? 7 : 0];
+ bitmap.pix32(y, (sx/2 * 16) + (i * 2)) = PALETTE_PC8001[color ? 7 : 0];
+ bitmap.pix32(y, (sx/2 * 16) + (i * 2) + 1) = PALETTE_PC8001[color ? 7 : 0];
data <<= 1;
}
diff --git a/src/mess/drivers/pc8801.c b/src/mess/drivers/pc8801.c
index 4d0ea411bdf..664109e2829 100644
--- a/src/mess/drivers/pc8801.c
+++ b/src/mess/drivers/pc8801.c
@@ -468,13 +468,12 @@ public:
void fdc_irq_w(bool state);
UINT32 screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
-
+ DECLARE_PALETTE_INIT(pc8801);
protected:
virtual void video_start();
virtual void machine_start();
virtual void machine_reset();
- virtual void palette_init();
public:
DECLARE_MACHINE_RESET(pc8801_clock_speed);
DECLARE_MACHINE_RESET(pc8801_dic);
@@ -567,15 +566,15 @@ void pc8801_state::draw_bitmap_3bpp(bitmap_ind16 &bitmap,const rectangle &clipre
if(y_double)
{
if(cliprect.contains(x+xi, y+0))
- bitmap.pix16(y+0, x+xi) = machine().pens[pen & 7];
+ bitmap.pix16(y+0, x+xi) = m_palette->pen(pen & 7);
if(cliprect.contains(x+xi, y+1))
- bitmap.pix16(y+1, x+xi) = machine().pens[pen & 7];
+ bitmap.pix16(y+1, x+xi) = m_palette->pen(pen & 7);
}
else
{
if(cliprect.contains(x+xi, y+0))
- bitmap.pix16(y, x+xi) = machine().pens[pen & 7];
+ bitmap.pix16(y, x+xi) = m_palette->pen(pen & 7);
}
}
@@ -613,15 +612,15 @@ void pc8801_state::draw_bitmap_1bpp(bitmap_ind16 &bitmap,const rectangle &clipre
if((m_gfx_ctrl & 1))
{
if(cliprect.contains(x+xi, y*2+0))
- bitmap.pix16(y*2+0, x+xi) = machine().pens[pen ? color : 0];
+ bitmap.pix16(y*2+0, x+xi) = m_palette->pen(pen ? color : 0);
if(cliprect.contains(x+xi, y*2+1))
- bitmap.pix16(y*2+1, x+xi) = machine().pens[pen ? color : 0];
+ bitmap.pix16(y*2+1, x+xi) = m_palette->pen(pen ? color : 0);
}
else
{
if(cliprect.contains(x+xi, y))
- bitmap.pix16(y, x+xi) = machine().pens[pen ? color : 0];
+ bitmap.pix16(y, x+xi) = m_palette->pen(pen ? color : 0);
}
}
@@ -649,7 +648,7 @@ void pc8801_state::draw_bitmap_1bpp(bitmap_ind16 &bitmap,const rectangle &clipre
pen^=1;
if(cliprect.contains(x+xi, y))
- bitmap.pix16(y, x+xi) = machine().pens[pen ? 7 : 0];
+ bitmap.pix16(y, x+xi) = m_palette->pen(pen ? 7 : 0);
}
count++;
@@ -794,13 +793,13 @@ void pc8801_state::pc8801_draw_char(bitmap_ind16 &bitmap,int x,int y,int pal,UIN
if(color != -1)
{
- bitmap.pix16(res_y, res_x) = machine().pens[color];
+ bitmap.pix16(res_y, res_x) = m_palette->pen(color);
if(width)
{
if(!machine().primary_screen->visible_area().contains(res_x+1, res_y))
continue;
- bitmap.pix16(res_y, res_x+1) = machine().pens[color];
+ bitmap.pix16(res_y, res_x+1) = m_palette->pen(color);
}
}
}
@@ -865,7 +864,7 @@ void pc8801_state::draw_text(bitmap_ind16 &bitmap,int y_size, UINT8 width)
UINT32 pc8801_state::screen_update( screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect)
{
- bitmap.fill(machine().pens[0], cliprect);
+ bitmap.fill(m_palette->pen(0), cliprect);
// popmessage("%04x %04x %02x",m_dma_address[2],m_dma_counter[2],m_dmac_mode);
@@ -1424,7 +1423,7 @@ WRITE8_MEMBER(pc8801_state::pc8801_palram_w)
m_palram[offset].g = data & 4 ? 7 : 0;
}
- palette_set_color_rgb(machine(), offset, pal3bit(m_palram[offset].r), pal3bit(m_palram[offset].g), pal3bit(m_palram[offset].b));
+ m_palette->set_pen_color(offset, pal3bit(m_palram[offset].r), pal3bit(m_palram[offset].g), pal3bit(m_palram[offset].b));
}
WRITE8_MEMBER(pc8801_state::pc8801_layer_masking_w)
@@ -2511,7 +2510,7 @@ void pc8801_state::machine_reset()
int i;
for(i=0;i<0x10;i++) //text + bitmap
- palette_set_color_rgb(machine(), i, pal1bit(i >> 1), pal1bit(i >> 2), pal1bit(i >> 0));
+ m_palette->set_pen_color(i, pal1bit(i >> 1), pal1bit(i >> 2), pal1bit(i >> 0));
}
m_has_clock_speed = 0;
@@ -2554,12 +2553,12 @@ MACHINE_RESET_MEMBER(pc8801_state,pc8801_cdrom)
}
}
-void pc8801_state::palette_init()
+PALETTE_INIT_MEMBER(pc8801_state, pc8801)
{
int i;
for(i=0;i<0x10;i++) //text + bitmap
- palette_set_color_rgb(machine(), i, pal1bit(i >> 1), pal1bit(i >> 2), pal1bit(i >> 0));
+ palette.set_pen_color(i, pal1bit(i >> 1), pal1bit(i >> 2), pal1bit(i >> 0));
}
void pc8801_state::fdc_irq_w(bool state)
@@ -2669,8 +2668,9 @@ static MACHINE_CONFIG_START( pc8801, pc8801_state )
MCFG_SCREEN_RAW_PARAMS(PIXEL_CLOCK_24KHz,848,0,640,448,0,400)
MCFG_SCREEN_UPDATE_DRIVER(pc8801_state, screen_update)
- MCFG_GFXDECODE_ADD("gfxdecode", pc8801 )
- MCFG_PALETTE_LENGTH(0x10)
+ MCFG_GFXDECODE_ADD("gfxdecode", pc8801 )
+ MCFG_PALETTE_ADD("palette", 0x10)
+ MCFG_PALETTE_INIT_OWNER(pc8801_state, pc8801)
// MCFG_VIDEO_START_OVERRIDE(pc8801_state,pc8801)
diff --git a/src/mess/drivers/pc88va.c b/src/mess/drivers/pc88va.c
index 0ffd89d2b3d..b713e444d85 100644
--- a/src/mess/drivers/pc88va.c
+++ b/src/mess/drivers/pc88va.c
@@ -251,7 +251,7 @@ void pc88va_state::draw_sprites(bitmap_rgb32 &bitmap, const rectangle &cliprect)
pen = pen & 1 ? fg_col : (bc) ? 8 : -1;
if(pen != -1) //transparent pen
- bitmap.pix32(yp+y_i, xp+x_i+(x_s)) = machine().pens[pen];
+ bitmap.pix32(yp+y_i, xp+x_i+(x_s)) = m_palette->pen(pen);
}
spr_count+=2;
}
@@ -276,7 +276,7 @@ void pc88va_state::draw_sprites(bitmap_rgb32 &bitmap, const rectangle &cliprect)
pen = (BITSWAP16(tvram[(spda+spr_count) / 2],7,6,5,4,3,2,1,0,15,14,13,12,11,10,9,8)) >> (16-(x_s*8)) & 0xf;
//if(bc != -1) //transparent pen
- bitmap.pix32(yp+y_i, xp+x_i+(x_s)) = machine().pens[pen];
+ bitmap.pix32(yp+y_i, xp+x_i+(x_s)) = m_palette->pen(pen);
}
spr_count+=2;
}
@@ -471,7 +471,7 @@ void pc88va_state::draw_text(bitmap_rgb32 &bitmap, const rectangle &cliprect)
if(secret) { pen = 0; } //hide text
if(pen != -1) //transparent
- bitmap.pix32(res_y, res_x) = machine().pens[pen];
+ bitmap.pix32(res_y, res_x) = m_palette->pen(pen);
}
}
@@ -949,7 +949,7 @@ WRITE16_MEMBER(pc88va_state::palette_ram_w)
r = (m_palram[offset] & 0x03c0) >> 6;
g = (m_palram[offset] & 0x7800) >> 11;
- palette_set_color_rgb(machine(),offset,pal4bit(r),pal4bit(g),pal4bit(b));
+ m_palette->set_pen_color(offset,pal4bit(r),pal4bit(g),pal4bit(b));
}
READ16_MEMBER(pc88va_state::sys_port4_r)
@@ -1716,7 +1716,7 @@ void pc88va_state::machine_reset()
{
UINT8 i;
for(i=0;i<32;i++)
- palette_set_color_rgb(machine(),i,pal1bit((i & 2) >> 1),pal1bit((i & 4) >> 2),pal1bit(i & 1));
+ m_palette->set_pen_color(i,pal1bit((i & 2) >> 1),pal1bit((i & 4) >> 2),pal1bit(i & 1));
}
m_tsp.tvram_vreg_offset = 0;
@@ -1850,9 +1850,9 @@ static MACHINE_CONFIG_START( pc88va, pc88va_state )
MCFG_SCREEN_VISIBLE_AREA(0, 640-1, 0, 200-1)
MCFG_SCREEN_UPDATE_DRIVER(pc88va_state, screen_update_pc88va)
- MCFG_PALETTE_LENGTH(32)
-// MCFG_PALETTE_INIT_OVERRIDE(pc88va_state, pc8801 )
- MCFG_GFXDECODE_ADD("gfxdecode", pc88va )
+ MCFG_PALETTE_ADD("palette", 32)
+// MCFG_PALETTE_INIT_OWNER(pc88va_state, pc8801 )
+ MCFG_GFXDECODE_ADD("gfxdecode", pc88va )
MCFG_I8255_ADD( "d8255_2", master_fdd_intf )
MCFG_I8255_ADD( "d8255_3", r232c_ctrl_intf )
diff --git a/src/mess/drivers/pc9801.c b/src/mess/drivers/pc9801.c
index dcf28f1cbdd..adcf61d67e5 100644
--- a/src/mess/drivers/pc9801.c
+++ b/src/mess/drivers/pc9801.c
@@ -781,7 +781,7 @@ void pc9801_state::video_start()
UINT32 pc9801_state::screen_update(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect)
{
- bitmap.fill(get_black_pen(machine()), cliprect);
+ bitmap.fill(m_palette->black_pen(), cliprect);
/* graphics */
m_hgdc2->screen_update(screen, bitmap, cliprect);
@@ -1462,8 +1462,8 @@ WRITE8_MEMBER(pc9801_state::pc9801_a0_w)
pal_entry = (((offset & 4) >> 1) | ((offset & 2) << 1)) >> 1;
pal_entry ^= 3;
- palette_set_color_rgb(machine(), (pal_entry)|4|8, pal1bit((data & 0x2) >> 1), pal1bit((data & 4) >> 2), pal1bit((data & 1) >> 0));
- palette_set_color_rgb(machine(), (pal_entry)|8, pal1bit((data & 0x20) >> 5), pal1bit((data & 0x40) >> 6), pal1bit((data & 0x10) >> 4));
+ m_palette->set_pen_color((pal_entry)|4|8, pal1bit((data & 0x2) >> 1), pal1bit((data & 4) >> 2), pal1bit((data & 1) >> 0));
+ m_palette->set_pen_color((pal_entry)|8, pal1bit((data & 0x20) >> 5), pal1bit((data & 0x40) >> 6), pal1bit((data & 0x10) >> 4));
return;
}
default:
@@ -2213,7 +2213,7 @@ WRITE8_MEMBER(pc9801_state::pc9801rs_a0_w)
case 0x0e: m_analog16.b[m_analog16.pal_entry] = data & 0xf; break;
}
- palette_set_color_rgb(machine(), (m_analog16.pal_entry)+0x10,
+ m_palette->set_pen_color((m_analog16.pal_entry)+0x10,
pal4bit(m_analog16.r[m_analog16.pal_entry]),
pal4bit(m_analog16.g[m_analog16.pal_entry]),
pal4bit(m_analog16.b[m_analog16.pal_entry]));
@@ -2598,7 +2598,7 @@ WRITE8_MEMBER(pc9801_state::pc9821_a0_w)
case 0x0e: m_analog256.b[m_analog256.pal_entry] = data & 0xff; break;
}
- palette_set_color_rgb(machine(), (m_analog256.pal_entry)+0x20,
+ m_palette->set_pen_color((m_analog256.pal_entry)+0x20,
m_analog256.r[m_analog256.pal_entry],
m_analog256.g[m_analog256.pal_entry],
m_analog256.b[m_analog256.pal_entry]);
@@ -3403,9 +3403,9 @@ PALETTE_INIT_MEMBER(pc9801_state,pc9801)
int i;
for(i=0;i<8;i++)
- palette_set_color_rgb(machine(), i, pal1bit(i >> 1), pal1bit(i >> 2), pal1bit(i >> 0));
- for(i=8;i<machine().total_colors();i++)
- palette_set_color_rgb(machine(), i, pal1bit(0), pal1bit(0), pal1bit(0));
+ palette.set_pen_color(i, pal1bit(i >> 1), pal1bit(i >> 2), pal1bit(i >> 0));
+ for(i=8;i<palette.entries();i++)
+ palette.set_pen_color(i, pal1bit(0), pal1bit(0), pal1bit(0));
}
IRQ_CALLBACK_MEMBER(pc9801_state::irq_callback)
@@ -3715,8 +3715,8 @@ static MACHINE_CONFIG_START( pc9801, pc9801_state )
MCFG_UPD7220_ADD("upd7220_chr", 5000000/2, hgdc_1_intf, upd7220_1_map)
MCFG_UPD7220_ADD("upd7220_btm", 5000000/2, hgdc_2_intf, upd7220_2_map)
- MCFG_PALETTE_LENGTH(16)
- MCFG_PALETTE_INIT_OVERRIDE(pc9801_state,pc9801)
+ MCFG_PALETTE_ADD("palette", 16)
+ MCFG_PALETTE_INIT_OWNER(pc9801_state,pc9801)
MCFG_GFXDECODE_ADD("gfxdecode", pc9801)
MCFG_SPEAKER_STANDARD_MONO("mono")
@@ -3785,8 +3785,8 @@ static MACHINE_CONFIG_START( pc9801rs, pc9801_state )
MCFG_UPD7220_ADD("upd7220_chr", 5000000/2, hgdc_1_intf, upd7220_1_map)
MCFG_UPD7220_ADD("upd7220_btm", 5000000/2, hgdc_2_intf, upd7220_2_map)
- MCFG_PALETTE_LENGTH(16+16)
- MCFG_PALETTE_INIT_OVERRIDE(pc9801_state,pc9801)
+ MCFG_PALETTE_ADD("palette", 16+16)
+ MCFG_PALETTE_INIT_OWNER(pc9801_state,pc9801)
MCFG_GFXDECODE_ADD("gfxdecode", pc9801)
MCFG_SPEAKER_STANDARD_MONO("mono")
@@ -3869,8 +3869,8 @@ static MACHINE_CONFIG_START( pc9821, pc9801_state )
MCFG_UPD7220_ADD("upd7220_chr", 5000000/2, hgdc_1_intf, upd7220_1_map)
MCFG_UPD7220_ADD("upd7220_btm", 5000000/2, hgdc_2_intf, upd7220_2_map)
- MCFG_PALETTE_LENGTH(16+16+256)
- MCFG_PALETTE_INIT_OVERRIDE(pc9801_state,pc9801)
+ MCFG_PALETTE_ADD("palette", 16+16+256)
+ MCFG_PALETTE_INIT_OWNER(pc9801_state,pc9801)
MCFG_GFXDECODE_ADD("gfxdecode", pc9801)
MCFG_SPEAKER_STANDARD_MONO("mono")
diff --git a/src/mess/drivers/pce.c b/src/mess/drivers/pce.c
index 89d7dc190ba..29b5892a011 100644
--- a/src/mess/drivers/pce.c
+++ b/src/mess/drivers/pce.c
@@ -381,8 +381,6 @@ static MACHINE_CONFIG_START( pce_common, pce_state )
MCFG_SCREEN_RAW_PARAMS(MAIN_CLOCK, HUC6260_WPF, 64, 64 + 1024 + 64, HUC6260_LPF, 18, 18 + 242)
MCFG_SCREEN_UPDATE_DRIVER( pce_state, screen_update )
- MCFG_PALETTE_LENGTH( HUC6260_PALETTE_SIZE )
-
MCFG_HUC6260_ADD( "huc6260", MAIN_CLOCK, pce_huc6260_config )
MCFG_HUC6270_ADD( "huc6270", pce_huc6270_config )
@@ -425,8 +423,6 @@ static MACHINE_CONFIG_START( sgx, pce_state )
MCFG_SCREEN_RAW_PARAMS(MAIN_CLOCK, HUC6260_WPF, 64, 64 + 1024 + 64, HUC6260_LPF, 18, 18 + 242)
MCFG_SCREEN_UPDATE_DRIVER( pce_state, screen_update )
- MCFG_PALETTE_LENGTH( HUC6260_PALETTE_SIZE )
-
MCFG_HUC6260_ADD( "huc6260", MAIN_CLOCK, sgx_huc6260_config )
MCFG_HUC6270_ADD( "huc6270_0", sgx_huc6270_0_config )
MCFG_HUC6270_ADD( "huc6270_1", sgx_huc6270_1_config )
diff --git a/src/mess/drivers/pce220.c b/src/mess/drivers/pce220.c
index abbc13d3ec5..49676c1f5b1 100644
--- a/src/mess/drivers/pce220.c
+++ b/src/mess/drivers/pce220.c
@@ -915,8 +915,8 @@ TIMER_DEVICE_CALLBACK_MEMBER(pce220_state::pce220_timer_callback)
PALETTE_INIT_MEMBER(pce220_state,pce220)
{
- palette_set_color(machine(), 0, rgb_t(138, 146, 148));
- palette_set_color(machine(), 1, rgb_t(92, 83, 88));
+ palette.set_pen_color(0, rgb_t(138, 146, 148));
+ palette.set_pen_color(1, rgb_t(92, 83, 88));
}
@@ -935,8 +935,8 @@ static MACHINE_CONFIG_START( pce220, pce220_state )
MCFG_SCREEN_SIZE(24*6, 4*8)
MCFG_SCREEN_VISIBLE_AREA(0, 24*6-1, 0, 4*8-1)
- MCFG_PALETTE_LENGTH(2)
- MCFG_PALETTE_INIT_OVERRIDE(pce220_state,pce220)
+ MCFG_PALETTE_ADD("palette", 2)
+ MCFG_PALETTE_INIT_OWNER(pce220_state,pce220)
MCFG_DEFAULT_LAYOUT(layout_lcd)
/* sound hardware */
@@ -970,8 +970,8 @@ static MACHINE_CONFIG_START( pcg850v, pcg850v_state )
MCFG_SCREEN_SIZE(144, 48)
MCFG_SCREEN_VISIBLE_AREA(0, 144-1, 0, 48-1)
- MCFG_PALETTE_LENGTH(2)
- MCFG_PALETTE_INIT_OVERRIDE(pce220_state,pce220)
+ MCFG_PALETTE_ADD("palette", 2)
+ MCFG_PALETTE_INIT_OWNER(pce220_state,pce220)
MCFG_DEFAULT_LAYOUT(layout_lcd)
/* sound hardware */
diff --git a/src/mess/drivers/pcm.c b/src/mess/drivers/pcm.c
index f5b32d8fcd5..24e51879c36 100644
--- a/src/mess/drivers/pcm.c
+++ b/src/mess/drivers/pcm.c
@@ -327,8 +327,7 @@ static MACHINE_CONFIG_START( pcm, pcm_state )
MCFG_SCREEN_SIZE(64*8, 16*8)
MCFG_SCREEN_VISIBLE_AREA(0, 64*8-1, 0, 16*8-1)
MCFG_GFXDECODE_ADD("gfxdecode", pcm)
- MCFG_PALETTE_LENGTH(2)
- MCFG_PALETTE_INIT_OVERRIDE(driver_device, black_and_white)
+ MCFG_PALETTE_ADD_BLACK_AND_WHITE("palette")
/* Sound */
MCFG_SPEAKER_STANDARD_MONO("mono")
diff --git a/src/mess/drivers/pcw.c b/src/mess/drivers/pcw.c
index 79439db7460..79d09673eda 100644
--- a/src/mess/drivers/pcw.c
+++ b/src/mess/drivers/pcw.c
@@ -1284,8 +1284,8 @@ static MACHINE_CONFIG_START( pcw, pcw_state )
MCFG_SCREEN_VISIBLE_AREA(0, PCW_SCREEN_WIDTH-1, 0, PCW_SCREEN_HEIGHT-1)
MCFG_SCREEN_UPDATE_DRIVER(pcw_state, screen_update_pcw)
- MCFG_PALETTE_LENGTH(PCW_NUM_COLOURS)
-
+ MCFG_PALETTE_ADD("palette", PCW_NUM_COLOURS)
+ MCFG_PALETTE_INIT_OWNER(pcw_state, pcw)
/* sound hardware */
MCFG_SPEAKER_STANDARD_MONO("mono")
diff --git a/src/mess/drivers/pcw16.c b/src/mess/drivers/pcw16.c
index 01bd47aa633..fe9b6bac082 100644
--- a/src/mess/drivers/pcw16.c
+++ b/src/mess/drivers/pcw16.c
@@ -1051,8 +1051,8 @@ static MACHINE_CONFIG_START( pcw16, pcw16_state )
MCFG_SCREEN_VISIBLE_AREA(0, PCW16_SCREEN_WIDTH-1, 0, PCW16_SCREEN_HEIGHT-1)
MCFG_SCREEN_UPDATE_DRIVER(pcw16_state, screen_update_pcw16)
- MCFG_PALETTE_LENGTH(PCW16_NUM_COLOURS)
-
+ MCFG_PALETTE_ADD("palette", PCW16_NUM_COLOURS)
+ MCFG_PALETTE_INIT_OWNER(pcw16_state, pcw16)
/* sound hardware */
MCFG_SPEAKER_STANDARD_MONO("mono")
diff --git a/src/mess/drivers/pda600.c b/src/mess/drivers/pda600.c
index 39037c89937..6ce7eeb6dee 100644
--- a/src/mess/drivers/pda600.c
+++ b/src/mess/drivers/pda600.c
@@ -215,8 +215,7 @@ static MACHINE_CONFIG_START( pda600, pda600_state )
MCFG_SCREEN_UPDATE_DRIVER( pda600_state, screen_update )
MCFG_GFXDECODE_ADD("gfxdecode", pda600)
MCFG_DEFAULT_LAYOUT(layout_lcd)
- MCFG_PALETTE_LENGTH(2)
- MCFG_PALETTE_INIT_OVERRIDE(driver_device, black_and_white)
+ MCFG_PALETTE_ADD_BLACK_AND_WHITE("palette")
// NVRAM needs to be filled with random data to fail the checksum and be initialized correctly
MCFG_NVRAM_ADD_RANDOM_FILL("nvram")
diff --git a/src/mess/drivers/pdp1.c b/src/mess/drivers/pdp1.c
index 3dc7c0a306d..c30d5aeb650 100644
--- a/src/mess/drivers/pdp1.c
+++ b/src/mess/drivers/pdp1.c
@@ -299,7 +299,7 @@ static GFXDECODE_START( pdp1 )
GFXDECODE_END
/* Initialise the palette */
-void pdp1_state::palette_init()
+PALETTE_INIT_MEMBER(pdp1_state, pdp1)
{
/* rgb components for the two color emissions */
const double r1 = .1, g1 = .1, b1 = .924, r2 = .7, g2 = .7, b2 = .076;
@@ -311,8 +311,6 @@ void pdp1_state::palette_init()
double cur_level_1, cur_level_2;
UINT8 i, r, g, b;
- machine().colortable = colortable_alloc(machine(), total_colors_needed);
-
/* initialize CRT palette */
/* compute the decay factor per refresh frame */
@@ -328,28 +326,28 @@ void pdp1_state::palette_init()
g = (int) ((g1*cur_level_1 + g2*cur_level_2) + .5);
b = (int) ((b1*cur_level_1 + b2*cur_level_2) + .5);
/* write color in palette */
- colortable_palette_set_color(machine().colortable, i, rgb_t(r, g, b));
+ m_palette->set_indirect_color(i, rgb_t(r, g, b));
/* apply decay for next iteration */
cur_level_1 *= decay_1;
cur_level_2 *= decay_2;
}
- colortable_palette_set_color(machine().colortable, 0, rgb_t(0, 0, 0));
+ m_palette->set_indirect_color(0, rgb_t(0, 0, 0));
/* load static palette */
for ( i = 0; i < 6; i++ )
{
r = pdp1_colors[i*3]; g = pdp1_colors[i*3+1]; b = pdp1_colors[i*3+2];
- colortable_palette_set_color(machine().colortable, pen_crt_num_levels + i, rgb_t(r, g, b));
+ m_palette->set_indirect_color(pen_crt_num_levels + i, rgb_t(r, g, b));
}
/* copy colortable to palette */
for( i = 0; i < total_colors_needed; i++ )
- colortable_entry_set_value(machine().colortable, i, i);
+ m_palette->set_pen_indirect(i, i);
/* set up palette for text */
for( i = 0; i < 6; i++ )
- colortable_entry_set_value(machine().colortable, total_colors_needed + i, pdp1_palette[i]);
+ m_palette->set_pen_indirect(total_colors_needed + i, pdp1_palette[i]);
}
@@ -1964,8 +1962,8 @@ static MACHINE_CONFIG_START( pdp1, pdp1_state )
MCFG_DEVICE_ADD("drum", PDP1_CYLINDER, 0)
MCFG_GFXDECODE_ADD("gfxdecode", pdp1)
- MCFG_PALETTE_LENGTH(pen_crt_num_levels + sizeof(pdp1_colors) / 3 + sizeof(pdp1_palette))
-
+ MCFG_PALETTE_ADD("palette", pen_crt_num_levels + sizeof(pdp1_colors) / 3 + sizeof(pdp1_palette))
+ MCFG_PALETTE_INIT_OWNER(pdp1_state, pdp1)
MACHINE_CONFIG_END
/*
diff --git a/src/mess/drivers/pegasus.c b/src/mess/drivers/pegasus.c
index 762acfb75c0..3357c25e8d1 100644
--- a/src/mess/drivers/pegasus.c
+++ b/src/mess/drivers/pegasus.c
@@ -478,8 +478,7 @@ static MACHINE_CONFIG_START( pegasus, pegasus_state )
MCFG_SCREEN_SIZE(32*8, 16*16)
MCFG_SCREEN_VISIBLE_AREA(0, 32*8-1, 0, 16*16-1)
MCFG_GFXDECODE_ADD("gfxdecode", pegasus)
- MCFG_PALETTE_LENGTH(2)
- MCFG_PALETTE_INIT_OVERRIDE(driver_device, black_and_white)
+ MCFG_PALETTE_ADD_BLACK_AND_WHITE("palette")
/* sound hardware */
MCFG_SPEAKER_STANDARD_MONO("mono")
diff --git a/src/mess/drivers/phunsy.c b/src/mess/drivers/phunsy.c
index 5958f95729b..ab41e317263 100644
--- a/src/mess/drivers/phunsy.c
+++ b/src/mess/drivers/phunsy.c
@@ -57,6 +57,7 @@ public:
DECLARE_READ8_MEMBER(cass_r);
DECLARE_WRITE_LINE_MEMBER(cass_w);
DECLARE_QUICKLOAD_LOAD_MEMBER(phunsy);
+ DECLARE_PALETTE_INIT(phunsy);
UINT32 screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
private:
const UINT8 *m_p_chargen;
@@ -68,7 +69,6 @@ private:
required_device<speaker_sound_device> m_speaker;
required_device<cassette_image_device> m_cass;
required_shared_ptr<UINT8> m_p_videoram;
- virtual void palette_init();
};
@@ -199,13 +199,13 @@ void phunsy_state::machine_reset()
}
-void phunsy_state::palette_init()
+PALETTE_INIT_MEMBER(phunsy_state, phunsy)
{
for ( int i = 0; i < 8; i++ )
{
int j = ( i << 5 ) | ( i << 2 ) | ( i >> 1 );
- palette_set_color_rgb( machine(), i, j, j, j );
+ palette.set_pen_color( i, j, j, j );
}
}
@@ -364,7 +364,8 @@ static MACHINE_CONFIG_START( phunsy, phunsy_state )
MCFG_SCREEN_RAW_PARAMS(XTAL_8MHz, 480, 0, 64*6, 313, 0, 256)
MCFG_SCREEN_UPDATE_DRIVER(phunsy_state, screen_update)
MCFG_GFXDECODE_ADD("gfxdecode", phunsy)
- MCFG_PALETTE_LENGTH(8)
+ MCFG_PALETTE_ADD("palette", 8)
+ MCFG_PALETTE_INIT_OWNER(phunsy_state, phunsy)
/* sound hardware */
MCFG_SPEAKER_STANDARD_MONO("mono")
diff --git a/src/mess/drivers/pitagjr.c b/src/mess/drivers/pitagjr.c
index 0ac8a308b32..962920fb4bb 100644
--- a/src/mess/drivers/pitagjr.c
+++ b/src/mess/drivers/pitagjr.c
@@ -165,7 +165,7 @@ public:
required_memory_bank m_rombank;
virtual void machine_start();
- virtual void palette_init();
+ DECLARE_PALETTE_INIT(pitagjr);
UINT32 screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
};
@@ -186,10 +186,10 @@ void pitagjr_state::machine_start()
m_rombank->set_entry(1);
}
-void pitagjr_state::palette_init()
+PALETTE_INIT_MEMBER(pitagjr_state, pitagjr)
{
- palette_set_color(machine(), 0, rgb_t(138, 146, 148));
- palette_set_color(machine(), 1, rgb_t(92, 83, 88));
+ palette.set_pen_color(0, rgb_t(138, 146, 148));
+ palette.set_pen_color(1, rgb_t(92, 83, 88));
}
UINT32 pitagjr_state::screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect)
@@ -212,7 +212,8 @@ static MACHINE_CONFIG_START( pitajr, pitagjr_state )
MCFG_DEFAULT_LAYOUT(layout_lcd)
- MCFG_PALETTE_LENGTH(2)
+ MCFG_PALETTE_ADD("palette", 2)
+ MCFG_PALETTE_INIT_OWNER(pitagjr_state, pitagjr)
MACHINE_CONFIG_END
/* ROM definition */
diff --git a/src/mess/drivers/pk8000.c b/src/mess/drivers/pk8000.c
index b395bf892ac..e84a87444fd 100644
--- a/src/mess/drivers/pk8000.c
+++ b/src/mess/drivers/pk8000.c
@@ -390,8 +390,8 @@ static MACHINE_CONFIG_START( pk8000, pk8000_state )
MCFG_SCREEN_VISIBLE_AREA(0, 256+32-1, 0, 192+32-1)
MCFG_SCREEN_UPDATE_DRIVER(pk8000_state, screen_update_pk8000)
- MCFG_PALETTE_LENGTH(16)
-
+ MCFG_PALETTE_ADD("palette", 16)
+ MCFG_PALETTE_INIT_OWNER(pk8000_base_state, pk8000)
MCFG_I8255_ADD( "ppi8255_1", pk8000_ppi8255_interface_1 )
MCFG_I8255_ADD( "ppi8255_2", pk8000_ppi8255_interface_2 )
diff --git a/src/mess/drivers/pk8020.c b/src/mess/drivers/pk8020.c
index 53bca287568..cc94ac9e415 100644
--- a/src/mess/drivers/pk8020.c
+++ b/src/mess/drivers/pk8020.c
@@ -217,7 +217,8 @@ static MACHINE_CONFIG_START( pk8020, pk8020_state )
MCFG_SCREEN_UPDATE_DRIVER(pk8020_state, screen_update_pk8020)
MCFG_GFXDECODE_ADD("gfxdecode", pk8020)
- MCFG_PALETTE_LENGTH(16)
+ MCFG_PALETTE_ADD("palette", 16)
+ MCFG_PALETTE_INIT_OWNER(pk8020_state, pk8020)
MCFG_I8255_ADD( "ppi8255_1", pk8020_ppi8255_interface_1 )
diff --git a/src/mess/drivers/plan80.c b/src/mess/drivers/plan80.c
index 445baab9b15..f495bab29b1 100644
--- a/src/mess/drivers/plan80.c
+++ b/src/mess/drivers/plan80.c
@@ -242,8 +242,7 @@ static MACHINE_CONFIG_START( plan80, plan80_state )
MCFG_SCREEN_SIZE(48*6, 32*8)
MCFG_SCREEN_VISIBLE_AREA(0, 48*6-1, 0, 32*8-1)
MCFG_GFXDECODE_ADD("gfxdecode", plan80)
- MCFG_PALETTE_LENGTH(2)
- MCFG_PALETTE_INIT_OVERRIDE(driver_device, monochrome_green)
+ MCFG_PALETTE_ADD_MONOCHROME_GREEN("palette")
MACHINE_CONFIG_END
/* ROM definition */
diff --git a/src/mess/drivers/pmd85.c b/src/mess/drivers/pmd85.c
index bf3b43a91db..48d6326d9f7 100644
--- a/src/mess/drivers/pmd85.c
+++ b/src/mess/drivers/pmd85.c
@@ -585,8 +585,8 @@ static MACHINE_CONFIG_START( pmd85, pmd85_state )
MCFG_SCREEN_VISIBLE_AREA(0, 288-1, 0, 256-1)
MCFG_SCREEN_UPDATE_DRIVER(pmd85_state, screen_update_pmd85)
- MCFG_PALETTE_LENGTH(sizeof (pmd85_palette) / 3)
-
+ MCFG_PALETTE_ADD("palette", sizeof (pmd85_palette) / 3)
+ MCFG_PALETTE_INIT_OWNER(pmd85_state, pmd85)
/* sound hardware */
MCFG_SPEAKER_STANDARD_MONO("mono")
diff --git a/src/mess/drivers/pocketc.c b/src/mess/drivers/pocketc.c
index 6e00f7ce0b5..67c56f8432f 100644
--- a/src/mess/drivers/pocketc.c
+++ b/src/mess/drivers/pocketc.c
@@ -727,9 +727,9 @@ static MACHINE_CONFIG_FRAGMENT( pocketc )
MCFG_SCREEN_VISIBLE_AREA(0, 594-1, 0, 273-1)
// MCFG_SCREEN_SIZE(640, 273)
// MCFG_SCREEN_VISIBLE_AREA(0, 640-1, 0, 273-1)
- MCFG_GFXDECODE_ADD("gfxdecode", pc1401 )
- MCFG_PALETTE_LENGTH(8*2)
- MCFG_PALETTE_INIT( pocketc )
+ MCFG_GFXDECODE_ADD("gfxdecode", pc1401 )
+ MCFG_PALETTE_ADD("palette", 8*2)
+ MCFG_PALETTE_INIT_LEGACY( pocketc )
/* sound hardware */
/*MCFG_SOUND_ADD("dac", DAC, pocketc_sound_interface)*/
diff --git a/src/mess/drivers/pockstat.c b/src/mess/drivers/pockstat.c
index efb933e05f0..cc4ce551a17 100644
--- a/src/mess/drivers/pockstat.c
+++ b/src/mess/drivers/pockstat.c
@@ -984,8 +984,7 @@ static MACHINE_CONFIG_START( pockstat, pockstat_state )
MCFG_SCREEN_VISIBLE_AREA(0, 32-1, 0, 32-1)
MCFG_SCREEN_UPDATE_DRIVER(pockstat_state, screen_update_pockstat)
- MCFG_PALETTE_LENGTH(2)
- MCFG_PALETTE_INIT_OVERRIDE(driver_device, black_and_white)
+ MCFG_PALETTE_ADD_BLACK_AND_WHITE("palette")
MCFG_SPEAKER_STANDARD_MONO("mono")
MCFG_SOUND_ADD("dac", DAC, 0)
diff --git a/src/mess/drivers/poisk1.c b/src/mess/drivers/poisk1.c
index 71759f4aed2..2f1942a7c78 100644
--- a/src/mess/drivers/poisk1.c
+++ b/src/mess/drivers/poisk1.c
@@ -312,7 +312,8 @@ static MACHINE_CONFIG_START( poisk1, p1_state )
MCFG_SCREEN_UPDATE_DRIVER( p1_state, screen_update )
/* XXX verify palette */
- MCFG_PALETTE_LENGTH( CGA_PALETTE_SETS * 16 )
+ MCFG_PALETTE_ADD("palette", CGA_PALETTE_SETS * 16 )
+ MCFG_PALETTE_INIT_OWNER(p1_state, p1)
/* internal ram */
MCFG_RAM_ADD(RAM_TAG)
diff --git a/src/mess/drivers/pokemini.c b/src/mess/drivers/pokemini.c
index d790518e3d1..cbd6fa16e23 100644
--- a/src/mess/drivers/pokemini.c
+++ b/src/mess/drivers/pokemini.c
@@ -66,7 +66,7 @@ public:
virtual void machine_start();
UINT32 screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
- virtual void palette_init();
+ DECLARE_PALETTE_INIT(pokemini);
TIMER_CALLBACK_MEMBER(pokemini_seconds_timer_callback);
TIMER_CALLBACK_MEMBER(pokemini_256hz_timer_callback);
TIMER_CALLBACK_MEMBER(pokemini_timer1_callback);
@@ -136,12 +136,12 @@ static INPUT_PORTS_START( pokemini )
INPUT_PORTS_END
-void pokemini_state::palette_init()
+PALETTE_INIT_MEMBER(pokemini_state, pokemini)
{
- palette_set_color(machine(), 0, rgb_t(0xff, 0xfb, 0x87));
- palette_set_color(machine(), 1, rgb_t(0xb1, 0xae, 0x4e));
- palette_set_color(machine(), 2, rgb_t(0x84, 0x80, 0x4e));
- palette_set_color(machine(), 3, rgb_t(0x4e, 0x4e, 0x4e));
+ palette.set_pen_color(0, rgb_t(0xff, 0xfb, 0x87));
+ palette.set_pen_color(1, rgb_t(0xb1, 0xae, 0x4e));
+ palette.set_pen_color(2, rgb_t(0x84, 0x80, 0x4e));
+ palette.set_pen_color(3, rgb_t(0x4e, 0x4e, 0x4e));
}
@@ -1790,7 +1790,8 @@ static MACHINE_CONFIG_START( pokemini, pokemini_state )
MCFG_DEFAULT_LAYOUT(layout_lcd)
- MCFG_PALETTE_LENGTH( 4 )
+ MCFG_PALETTE_ADD( "palette", 4 )
+ MCFG_PALETTE_INIT_OWNER(pokemini_state, pokemini)
/* sound hardware */
MCFG_SPEAKER_STANDARD_MONO("mono")
diff --git a/src/mess/drivers/poly88.c b/src/mess/drivers/poly88.c
index 92db0a1050b..93b3469d78d 100644
--- a/src/mess/drivers/poly88.c
+++ b/src/mess/drivers/poly88.c
@@ -183,8 +183,7 @@ static MACHINE_CONFIG_START( poly88, poly88_state )
MCFG_SCREEN_UPDATE_DRIVER(poly88_state, screen_update_poly88)
MCFG_GFXDECODE_ADD("gfxdecode", poly88)
- MCFG_PALETTE_LENGTH(2)
- MCFG_PALETTE_INIT_OVERRIDE(driver_device, black_and_white)
+ MCFG_PALETTE_ADD_BLACK_AND_WHITE("palette")
/* audio hardware */
diff --git a/src/mess/drivers/portfoli.c b/src/mess/drivers/portfoli.c
index 146171e7555..14cc9a98226 100644
--- a/src/mess/drivers/portfoli.c
+++ b/src/mess/drivers/portfoli.c
@@ -651,10 +651,10 @@ INPUT_PORTS_END
// VIDEO
//**************************************************************************
-void portfolio_state::palette_init()
+PALETTE_INIT_MEMBER(portfolio_state, portfolio)
{
- palette_set_color(machine(), 0, rgb_t(138, 146, 148));
- palette_set_color(machine(), 1, rgb_t(92, 83, 88));
+ palette.set_pen_color(0, rgb_t(138, 146, 148));
+ palette.set_pen_color(1, rgb_t(92, 83, 88));
}
@@ -851,7 +851,8 @@ static MACHINE_CONFIG_START( portfolio, portfolio_state )
MCFG_DEFAULT_LAYOUT(layout_lcd)
- MCFG_PALETTE_LENGTH(2)
+ MCFG_PALETTE_ADD("palette", 2)
+ MCFG_PALETTE_INIT_OWNER(portfolio_state, portfolio)
MCFG_GFXDECODE_ADD("gfxdecode", portfolio)
diff --git a/src/mess/drivers/pp01.c b/src/mess/drivers/pp01.c
index 46b626cb512..1fdedbec344 100644
--- a/src/mess/drivers/pp01.c
+++ b/src/mess/drivers/pp01.c
@@ -208,7 +208,8 @@ static MACHINE_CONFIG_START( pp01, pp01_state )
MCFG_SCREEN_SIZE(256, 256)
MCFG_SCREEN_VISIBLE_AREA(0, 256-1, 0, 256-1)
MCFG_SCREEN_UPDATE_DRIVER(pp01_state, screen_update_pp01)
- MCFG_PALETTE_LENGTH(8)
+ MCFG_PALETTE_ADD("palette", 8)
+ MCFG_PALETTE_INIT_OWNER(pp01_state, pp01)
/* sound hardware */
MCFG_SPEAKER_STANDARD_MONO("mono")
diff --git a/src/mess/drivers/prestige.c b/src/mess/drivers/prestige.c
index ec213338526..ce94cb2da05 100644
--- a/src/mess/drivers/prestige.c
+++ b/src/mess/drivers/prestige.c
@@ -112,7 +112,7 @@ public:
DECLARE_WRITE8_MEMBER( kb_w );
DECLARE_READ8_MEMBER( mouse_r );
DECLARE_WRITE8_MEMBER( mouse_w );
- virtual void palette_init();
+ DECLARE_PALETTE_INIT(prestige);
TIMER_DEVICE_CALLBACK_MEMBER(irq_timer);
IRQ_CALLBACK_MEMBER(prestige_int_ack);
};
@@ -442,10 +442,10 @@ void prestige_state::machine_start()
m_vram = ram;
}
-void prestige_state::palette_init()
+PALETTE_INIT_MEMBER(prestige_state, prestige)
{
- palette_set_color(machine(), 0, rgb_t(39, 108, 51));
- palette_set_color(machine(), 1, rgb_t(16, 37, 84));
+ palette.set_pen_color(0, rgb_t(39, 108, 51));
+ palette.set_pen_color(1, rgb_t(16, 37, 84));
}
UINT32 prestige_state::screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect)
@@ -495,7 +495,8 @@ static MACHINE_CONFIG_START( prestige, prestige_state )
MCFG_DEFAULT_LAYOUT( layout_lcd )
- MCFG_PALETTE_LENGTH(2)
+ MCFG_PALETTE_ADD("palette", 2)
+ MCFG_PALETTE_INIT_OWNER(prestige_state, prestige)
/* cartridge */
MCFG_CARTSLOT_ADD("cart")
diff --git a/src/mess/drivers/primo.c b/src/mess/drivers/primo.c
index 32e22401f7c..3d08e32999b 100644
--- a/src/mess/drivers/primo.c
+++ b/src/mess/drivers/primo.c
@@ -263,8 +263,7 @@ static MACHINE_CONFIG_START( primoa32, primo_state )
MCFG_SCREEN_VISIBLE_AREA( 0, 256-1, 0, 192-1 )
MCFG_SCREEN_UPDATE_DRIVER(primo_state, screen_update_primo)
- MCFG_PALETTE_LENGTH(2)
- MCFG_PALETTE_INIT_OVERRIDE(driver_device, black_and_white)
+ MCFG_PALETTE_ADD_BLACK_AND_WHITE("palette")
/* sound hardware */
MCFG_SPEAKER_STANDARD_MONO("mono")
diff --git a/src/mess/drivers/psion.c b/src/mess/drivers/psion.c
index 32439dc3ae7..c4bb185a606 100644
--- a/src/mess/drivers/psion.c
+++ b/src/mess/drivers/psion.c
@@ -451,10 +451,10 @@ HD44780_PIXEL_UPDATE(psion_state::lz_pixel_update)
}
}
-void psion_state::palette_init()
+PALETTE_INIT_MEMBER(psion_state, psion)
{
- palette_set_color(machine(), 0, rgb_t(138, 146, 148));
- palette_set_color(machine(), 1, rgb_t(92, 83, 88));
+ palette.set_pen_color(0, rgb_t(138, 146, 148));
+ palette.set_pen_color(1, rgb_t(92, 83, 88));
}
static const gfx_layout psion_charlayout =
@@ -485,7 +485,8 @@ static MACHINE_CONFIG_START( psion_2lines, psion_state )
MCFG_SCREEN_SIZE(6*16, 9*2)
MCFG_SCREEN_VISIBLE_AREA(0, 6*16-1, 0, 9*2-1)
MCFG_DEFAULT_LAYOUT(layout_lcd)
- MCFG_PALETTE_LENGTH(2)
+ MCFG_PALETTE_ADD("palette", 2)
+ MCFG_PALETTE_INIT_OWNER(psion_state, psion)
MCFG_GFXDECODE_ADD("gfxdecode", psion)
MCFG_HD44780_ADD("hd44780")
diff --git a/src/mess/drivers/ptcsol.c b/src/mess/drivers/ptcsol.c
index b7c4ec101d7..d9b5f7588e1 100644
--- a/src/mess/drivers/ptcsol.c
+++ b/src/mess/drivers/ptcsol.c
@@ -763,8 +763,7 @@ static MACHINE_CONFIG_START( sol20, sol20_state )
MCFG_SCREEN_SIZE(576, 208)
MCFG_SCREEN_VISIBLE_AREA(0, 575, 0, 207)
MCFG_GFXDECODE_ADD("gfxdecode", sol20)
- MCFG_PALETTE_LENGTH(2)
- MCFG_PALETTE_INIT_OVERRIDE(driver_device, black_and_white)
+ MCFG_PALETTE_ADD_BLACK_AND_WHITE("palette")
/* sound hardware */
MCFG_SPEAKER_STANDARD_MONO("mono")
diff --git a/src/mess/drivers/pv1000.c b/src/mess/drivers/pv1000.c
index 4e18f66166e..36252a2f146 100644
--- a/src/mess/drivers/pv1000.c
+++ b/src/mess/drivers/pv1000.c
@@ -168,7 +168,7 @@ public:
required_shared_ptr<UINT8> m_p_videoram;
virtual void machine_start();
virtual void machine_reset();
- virtual void palette_init();
+ DECLARE_PALETTE_INIT(pv1000);
UINT32 screen_update_pv1000(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
TIMER_CALLBACK_MEMBER(d65010_irq_on_cb);
TIMER_CALLBACK_MEMBER(d65010_irq_off_cb);
@@ -295,10 +295,10 @@ static INPUT_PORTS_START( pv1000 )
INPUT_PORTS_END
-void pv1000_state::palette_init()
+PALETTE_INIT_MEMBER(pv1000_state, pv1000)
{
for (int i = 0; i < 8; i++)
- palette_set_color_rgb(machine(), i, pal1bit(i >> 2), pal1bit(i >> 1), pal1bit(i >> 0));
+ palette.set_pen_color(i, pal1bit(i >> 2), pal1bit(i >> 1), pal1bit(i >> 0));
}
@@ -354,12 +354,12 @@ UINT32 pv1000_state::screen_update_pv1000(screen_device &screen, bitmap_ind16 &b
if ( tile < 0xe0 || m_force_pattern )
{
tile += ( m_pcg_bank << 8);
- m_gfxdecode->gfx(0)->opaque(bitmap,cliprect, tile, 0, 0, 0, x*8, y*8 );
+ m_gfxdecode->gfx(0)->opaque(m_palette,bitmap,cliprect, tile, 0, 0, 0, x*8, y*8 );
}
else
{
tile -= 0xe0;
- m_gfxdecode->gfx(1)->opaque(bitmap,cliprect, tile, 0, 0, 0, x*8, y*8 );
+ m_gfxdecode->gfx(1)->opaque(m_palette,bitmap,cliprect, tile, 0, 0, 0, x*8, y*8 );
}
}
}
@@ -463,8 +463,10 @@ static MACHINE_CONFIG_START( pv1000, pv1000_state )
MCFG_SCREEN_RAW_PARAMS( 17897725/3, 380, 0, 256, 262, 0, 192 )
MCFG_SCREEN_UPDATE_DRIVER(pv1000_state, screen_update_pv1000)
- MCFG_PALETTE_LENGTH( 8 )
- MCFG_GFXDECODE_ADD("gfxdecode", pv1000 )
+ MCFG_PALETTE_ADD( "palette", 8 )
+ MCFG_PALETTE_INIT_OWNER(pv1000_state, pv1000)
+
+ MCFG_GFXDECODE_ADD("gfxdecode", pv1000 )
MCFG_SPEAKER_STANDARD_MONO("mono")
MCFG_SOUND_ADD( "pv1000_sound", PV1000, 17897725 )
diff --git a/src/mess/drivers/pv9234.c b/src/mess/drivers/pv9234.c
index a38a47050cf..62378f31e57 100644
--- a/src/mess/drivers/pv9234.c
+++ b/src/mess/drivers/pv9234.c
@@ -148,8 +148,7 @@ static MACHINE_CONFIG_START( pv9234, pv9234_state )
MCFG_SCREEN_VISIBLE_AREA(0, 640-1, 0, 480-1)
MCFG_SCREEN_UPDATE_DRIVER(pv9234_state, screen_update_pv9234)
- MCFG_PALETTE_LENGTH(2)
- MCFG_PALETTE_INIT_OVERRIDE(driver_device, black_and_white)
+ MCFG_PALETTE_ADD_BLACK_AND_WHITE("palette")
MACHINE_CONFIG_END
diff --git a/src/mess/drivers/px4.c b/src/mess/drivers/px4.c
index 8d2fc20dbc6..b19f008687c 100644
--- a/src/mess/drivers/px4.c
+++ b/src/mess/drivers/px4.c
@@ -201,7 +201,7 @@ public:
DECLARE_DRIVER_INIT(px4);
DECLARE_DRIVER_INIT(px4p);
virtual void machine_reset();
- virtual void palette_init();
+ DECLARE_PALETTE_INIT(px4);
DECLARE_MACHINE_START(px4_ramdisk);
DECLARE_PALETTE_INIT(px4p);
UINT32 screen_update_px4(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
@@ -1342,16 +1342,16 @@ INPUT_PORTS_END
// PALETTE
//**************************************************************************
-void px4_state::palette_init()
+PALETTE_INIT_MEMBER(px4_state, px4)
{
- palette_set_color(machine(), 0, rgb_t(138, 146, 148));
- palette_set_color(machine(), 1, rgb_t(92, 83, 88));
+ palette.set_pen_color(0, rgb_t(138, 146, 148));
+ palette.set_pen_color(1, rgb_t(92, 83, 88));
}
PALETTE_INIT_MEMBER(px4_state, px4p)
{
- palette_set_color(machine(), 0, rgb_t(149, 157, 130));
- palette_set_color(machine(), 1, rgb_t(92, 83, 88));
+ palette.set_pen_color(0, rgb_t(149, 157, 130));
+ palette.set_pen_color(1, rgb_t(92, 83, 88));
}
@@ -1383,7 +1383,8 @@ static MACHINE_CONFIG_START( px4, px4_state )
MCFG_DEFAULT_LAYOUT(layout_px4)
- MCFG_PALETTE_LENGTH(2)
+ MCFG_PALETTE_ADD("palette", 2)
+ MCFG_PALETTE_INIT_OWNER(px4_state, px4)
// sound hardware
MCFG_SPEAKER_STANDARD_MONO("mono")
@@ -1442,7 +1443,8 @@ static MACHINE_CONFIG_DERIVED( px4p, px4 )
MCFG_MACHINE_START_OVERRIDE(px4_state, px4_ramdisk)
MCFG_NVRAM_ADD_0FILL("nvram")
- MCFG_PALETTE_INIT_OVERRIDE(px4_state, px4p)
+ MCFG_PALETTE_MODIFY("palette")
+ MCFG_PALETTE_INIT_OWNER(px4_state, px4p)
MCFG_CARTSLOT_ADD("ramdisk")
MCFG_CARTSLOT_NOT_MANDATORY
diff --git a/src/mess/drivers/px8.c b/src/mess/drivers/px8.c
index 93a925e36e0..6a35b38de7e 100644
--- a/src/mess/drivers/px8.c
+++ b/src/mess/drivers/px8.c
@@ -682,10 +682,10 @@ INPUT_PORTS_END
VIDEO
***************************************************************************/
-void px8_state::palette_init()
+PALETTE_INIT_MEMBER(px8_state, px8)
{
- palette_set_color_rgb(machine(), 0, 0xa5, 0xad, 0xa5);
- palette_set_color_rgb(machine(), 1, 0x31, 0x39, 0x10);
+ palette.set_pen_color(0, 0xa5, 0xad, 0xa5);
+ palette.set_pen_color(1, 0x31, 0x39, 0x10);
}
UINT32 px8_state::screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect)
@@ -793,7 +793,8 @@ static MACHINE_CONFIG_START( px8, px8_state )
MCFG_SCREEN_VISIBLE_AREA(0, 479, 0, 63)
MCFG_GFXDECODE_ADD("gfxdecode", px8)
- MCFG_PALETTE_LENGTH(2)
+ MCFG_PALETTE_ADD("palette", 2)
+ MCFG_PALETTE_INIT_OWNER(px8_state, px8)
/* sound hardware */
MCFG_SPEAKER_STANDARD_MONO("mono")
diff --git a/src/mess/drivers/pyl601.c b/src/mess/drivers/pyl601.c
index b1edae25d4e..aeb9d95bf16 100644
--- a/src/mess/drivers/pyl601.c
+++ b/src/mess/drivers/pyl601.c
@@ -567,8 +567,7 @@ static MACHINE_CONFIG_START( pyl601, pyl601_state )
MCFG_SCREEN_VISIBLE_AREA(0, 640 - 1, 0, 200 - 1)
MCFG_SCREEN_UPDATE_DEVICE("crtc", mc6845_device, screen_update)
MCFG_GFXDECODE_ADD("gfxdecode", pyl601)
- MCFG_PALETTE_LENGTH(2)
- MCFG_PALETTE_INIT_OVERRIDE(driver_device, monochrome_green)
+ MCFG_PALETTE_ADD_MONOCHROME_GREEN("palette")
/* sound hardware */
MCFG_SPEAKER_STANDARD_MONO("mono")
diff --git a/src/mess/drivers/qx10.c b/src/mess/drivers/qx10.c
index 29e9c4ecc47..c5525ace07a 100644
--- a/src/mess/drivers/qx10.c
+++ b/src/mess/drivers/qx10.c
@@ -141,7 +141,7 @@ public:
UINT8 rx;
}m_rs232c;
- virtual void palette_init();
+ DECLARE_PALETTE_INIT(qx10);
DECLARE_INPUT_CHANGED_MEMBER(key_stroke);
DECLARE_WRITE_LINE_MEMBER(dma_hrq_changed);
IRQ_CALLBACK_MEMBER(irq_callback);
@@ -235,7 +235,7 @@ static UPD7220_DRAW_TEXT_LINE( hgdc_draw_text )
UINT32 qx10_state::screen_update( screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect )
{
- bitmap.fill(get_black_pen(machine()), cliprect);
+ bitmap.fill(m_palette->black_pen(), cliprect);
m_hgdc->screen_update(screen, bitmap, cliprect);
@@ -731,15 +731,15 @@ void qx10_state::machine_reset()
if(m_color_mode) //color
{
for ( i = 0; i < 8; i++ )
- palette_set_color_rgb(machine(), i, pal1bit((i >> 2) & 1), pal1bit((i >> 1) & 1), pal1bit((i >> 0) & 1));
+ m_palette->set_pen_color(i, pal1bit((i >> 2) & 1), pal1bit((i >> 1) & 1), pal1bit((i >> 0) & 1));
}
else //monochrome
{
for ( i = 0; i < 8; i++ )
- palette_set_color_rgb(machine(), i, pal1bit(0), pal1bit(0), pal1bit(0));
+ m_palette->set_pen_color(i, pal1bit(0), pal1bit(0), pal1bit(0));
- palette_set_color_rgb(machine(), 1, 0x00, 0x9f, 0x00);
- palette_set_color_rgb(machine(), 2, 0x00, 0xff, 0x00);
+ m_palette->set_pen_color(1, 0x00, 0x9f, 0x00);
+ m_palette->set_pen_color(2, 0x00, 0xff, 0x00);
m_vram_bank = 0;
}
}
@@ -781,7 +781,7 @@ static UPD7220_INTERFACE( hgdc_intf )
DEVCB_NULL
};
-void qx10_state::palette_init()
+PALETTE_INIT_MEMBER(qx10_state, qx10)
{
// ...
}
@@ -826,7 +826,8 @@ static MACHINE_CONFIG_START( qx10, qx10_state )
MCFG_SCREEN_SIZE(640, 480)
MCFG_SCREEN_VISIBLE_AREA(0, 640-1, 0, 480-1)
MCFG_GFXDECODE_ADD("gfxdecode", qx10)
- MCFG_PALETTE_LENGTH(8)
+ MCFG_PALETTE_ADD("palette", 8)
+ MCFG_PALETTE_INIT_OWNER(qx10_state, qx10)
/* Devices */
diff --git a/src/mess/drivers/radio86.c b/src/mess/drivers/radio86.c
index eb8127b5506..0cacc04f838 100644
--- a/src/mess/drivers/radio86.c
+++ b/src/mess/drivers/radio86.c
@@ -365,8 +365,8 @@ static MACHINE_CONFIG_START( radio86, radio86_state )
MCFG_SCREEN_SIZE(78*6, 30*10)
MCFG_SCREEN_VISIBLE_AREA(0, 78*6-1, 0, 30*10-1)
MCFG_GFXDECODE_ADD("gfxdecode", radio86)
- MCFG_PALETTE_LENGTH(3)
- MCFG_PALETTE_INIT_OVERRIDE(radio86_state,radio86)
+ MCFG_PALETTE_ADD("palette", 3)
+ MCFG_PALETTE_INIT_OWNER(radio86_state,radio86)
MCFG_SPEAKER_STANDARD_MONO("mono")
MCFG_SOUND_WAVE_ADD(WAVE_TAG, "cassette")
diff --git a/src/mess/drivers/rainbow.c b/src/mess/drivers/rainbow.c
index a05bfdbf1db..d96f0a9cff2 100644
--- a/src/mess/drivers/rainbow.c
+++ b/src/mess/drivers/rainbow.c
@@ -1195,9 +1195,9 @@ static MACHINE_CONFIG_START( rainbow, rainbow_state )
MCFG_SCREEN_SIZE(132*10, 49*10)
MCFG_SCREEN_VISIBLE_AREA(0, 80 * 10-1, 0, 24 * 10-1)
MCFG_SCREEN_UPDATE_DRIVER(rainbow_state, screen_update_rainbow)
+ MCFG_SCREEN_PALETTE("vt100_video:palette")
MCFG_GFXDECODE_ADD("gfxdecode", rainbow)
- MCFG_PALETTE_LENGTH(4)
-
+
MCFG_RAINBOW_VIDEO_ADD("vt100_video", video_interface)
MCFG_FD1793_ADD("wd1793", rainbow_wd17xx_interface )
diff --git a/src/mess/drivers/rd110.c b/src/mess/drivers/rd110.c
index 1515917f0a2..90a49b72142 100644
--- a/src/mess/drivers/rd110.c
+++ b/src/mess/drivers/rd110.c
@@ -58,7 +58,7 @@ public:
virtual void machine_start();
virtual void machine_reset();
- virtual void palette_init();
+ DECLARE_PALETTE_INIT(d110);
UINT32 screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
@@ -195,10 +195,10 @@ WRITE8_MEMBER(d110_state::so_w)
// logerror("so: rw=%d bank=%d led=%d\n", (data >> 3) & 1, (data >> 1) & 3, data & 1);
}
-void d110_state::palette_init()
+PALETTE_INIT_MEMBER(d110_state, d110)
{
- palette_set_color(machine(), 0, rgb_t(0, 255, 0));
- palette_set_color(machine(), 1, rgb_t(0, 0, 0));
+ palette.set_pen_color(0, rgb_t(0, 255, 0));
+ palette.set_pen_color(1, rgb_t(0, 0, 0));
}
static ADDRESS_MAP_START( d110_map, AS_PROGRAM, 8, d110_state )
@@ -240,7 +240,8 @@ static MACHINE_CONFIG_START( d110, d110_state )
// MCFG_SCREEN_SIZE(20*6-1, 2*9-1)
MCFG_SCREEN_SIZE(16*6-1, (16*6-1)*3/4)
MCFG_SCREEN_VISIBLE_AREA(0, 16*6-2, 0, (16*6-1)*3/4-1)
- MCFG_PALETTE_LENGTH(2)
+ MCFG_PALETTE_ADD("palette", 2)
+ MCFG_PALETTE_INIT_OWNER(d110_state, d110)
MCFG_MSM6222B_01_ADD( "lcd" )
diff --git a/src/mess/drivers/replicator.c b/src/mess/drivers/replicator.c
index c51c41dbedc..9bac9135673 100644
--- a/src/mess/drivers/replicator.c
+++ b/src/mess/drivers/replicator.c
@@ -187,7 +187,7 @@ public:
DECLARE_WRITE8_MEMBER(port_w);
DECLARE_DRIVER_INIT(replicator);
virtual void machine_reset();
- virtual void palette_init();
+ DECLARE_PALETTE_INIT(replicator);
};
void replicator_state::machine_start()
@@ -622,11 +622,11 @@ const avr8_config atmega1280_config =
"eeprom"
};
-void replicator_state::palette_init()
+PALETTE_INIT_MEMBER(replicator_state, replicator)
{
//These colors were picked with the color picker in Inkscape, based on a photo of the LCD used in the Replicator 1 3d printer:
- palette_set_color(machine(), 0, rgb_t(0xCA, 0xE7, 0xEB));
- palette_set_color(machine(), 1, rgb_t(0x78, 0xAB, 0xA8));
+ palette.set_pen_color(0, rgb_t(0xCA, 0xE7, 0xEB));
+ palette.set_pen_color(1, rgb_t(0x78, 0xAB, 0xA8));
}
static const gfx_layout hd44780_charlayout =
@@ -667,7 +667,8 @@ static MACHINE_CONFIG_START( replicator, replicator_state )
MCFG_SCREEN_SIZE(120, 18*2) //4x20 chars
MCFG_SCREEN_VISIBLE_AREA(0, 120-1, 0, 18*2-1)
- MCFG_PALETTE_LENGTH(2)
+ MCFG_PALETTE_ADD("palette", 2)
+ MCFG_PALETTE_INIT_OWNER(replicator_state, replicator)
MCFG_GFXDECODE_ADD("gfxdecode", replicator)
MCFG_DEFAULT_LAYOUT(layout_lcd)
diff --git a/src/mess/drivers/rex6000.c b/src/mess/drivers/rex6000.c
index 67c4f301e9f..40156b2c283 100644
--- a/src/mess/drivers/rex6000.c
+++ b/src/mess/drivers/rex6000.c
@@ -116,7 +116,7 @@ public:
DECLARE_WRITE8_MEMBER( flash_0xa000_w );
UINT8 identify_bank_type(UINT32 bank);
- virtual void palette_init();
+ DECLARE_PALETTE_INIT(rex6000);
DECLARE_INPUT_CHANGED_MEMBER(trigger_irq);
TIMER_DEVICE_CALLBACK_MEMBER(irq_timer1);
TIMER_DEVICE_CALLBACK_MEMBER(irq_timer2);
@@ -558,10 +558,10 @@ WRITE_LINE_MEMBER( rex6000_state::alarm_irq )
}
-void rex6000_state::palette_init()
+PALETTE_INIT_MEMBER(rex6000_state, rex6000)
{
- palette_set_color(machine(), 0, rgb_t(138, 146, 148));
- palette_set_color(machine(), 1, rgb_t(92, 83, 88));
+ palette.set_pen_color(0, rgb_t(138, 146, 148));
+ palette.set_pen_color(1, rgb_t(92, 83, 88));
}
QUICKLOAD_LOAD_MEMBER( rex6000_state,rex6000)
@@ -660,7 +660,8 @@ static MACHINE_CONFIG_START( rex6000, rex6000_state )
MCFG_SCREEN_SIZE(240, 120)
MCFG_SCREEN_VISIBLE_AREA(0, 240-1, 0, 120-1)
MCFG_DEFAULT_LAYOUT(layout_lcd)
- MCFG_PALETTE_LENGTH(2)
+ MCFG_PALETTE_ADD("palette", 2)
+ MCFG_PALETTE_INIT_OWNER(rex6000_state, rex6000)
MCFG_GFXDECODE_ADD("gfxdecode", rex6000)
/* quickload */
diff --git a/src/mess/drivers/rm380z.c b/src/mess/drivers/rm380z.c
index ec44eb109cf..38a21af4814 100644
--- a/src/mess/drivers/rm380z.c
+++ b/src/mess/drivers/rm380z.c
@@ -158,8 +158,7 @@ static MACHINE_CONFIG_START( rm380z, rm380z_state )
MCFG_SCREEN_VISIBLE_AREA(0, (RM380Z_SCREENCOLS*(RM380Z_CHDIMX+1))-1, 0, (RM380Z_SCREENROWS*(RM380Z_CHDIMY+1))-1)
MCFG_SCREEN_UPDATE_DRIVER(rm380z_state, screen_update_rm380z)
- MCFG_PALETTE_LENGTH(2)
- MCFG_PALETTE_INIT_OVERRIDE(driver_device, black_and_white)
+ MCFG_PALETTE_ADD_BLACK_AND_WHITE("palette")
/* RAM configurations */
MCFG_RAM_ADD(RAM_TAG)
diff --git a/src/mess/drivers/rmnimbus.c b/src/mess/drivers/rmnimbus.c
index 67bee16a053..97e03f50650 100644
--- a/src/mess/drivers/rmnimbus.c
+++ b/src/mess/drivers/rmnimbus.c
@@ -262,13 +262,13 @@ static ADDRESS_MAP_START( nimbus_iocpu_io , AS_IO, 8, rmnimbus_state )
ADDRESS_MAP_END
-void rmnimbus_state::palette_init()
+PALETTE_INIT_MEMBER(rmnimbus_state, rmnimbus)
{
int colourno;
for ( colourno = 0; colourno < SCREEN_NO_COLOURS; colourno++ )
{
- palette_set_color_rgb(machine(), colourno, nimbus_palette[colourno][RED], nimbus_palette[colourno][GREEN], nimbus_palette[colourno][BLUE]);
+ palette.set_pen_color(colourno, nimbus_palette[colourno][RED], nimbus_palette[colourno][GREEN], nimbus_palette[colourno][BLUE]);
}
}
@@ -294,7 +294,8 @@ static MACHINE_CONFIG_START( nimbus, rmnimbus_state )
MCFG_VIDEO_ATTRIBUTES(VIDEO_UPDATE_SCANLINE)
- MCFG_PALETTE_LENGTH(SCREEN_NO_COLOURS)
+ MCFG_PALETTE_ADD("palette", SCREEN_NO_COLOURS)
+ MCFG_PALETTE_INIT_OWNER(rmnimbus_state, rmnimbus)
// MCFG_SCREEN_SIZE(650, 260)
// MCFG_SCREEN_VISIBLE_AREA(0, 639, 0, 249)
diff --git a/src/mess/drivers/rmt32.c b/src/mess/drivers/rmt32.c
index f1ecfd3f928..dab0fa2d545 100644
--- a/src/mess/drivers/rmt32.c
+++ b/src/mess/drivers/rmt32.c
@@ -196,7 +196,7 @@ public:
virtual void machine_start();
virtual void machine_reset();
- virtual void palette_init();
+ DECLARE_PALETTE_INIT(mt32);
UINT32 screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
@@ -321,10 +321,10 @@ WRITE8_MEMBER(mt32_state::so_w)
// logerror("so: x1=%d bank=%d led=%d\n", (data >> 5) & 1, (data >> 1) & 3, data & 1);
}
-void mt32_state::palette_init()
+PALETTE_INIT_MEMBER(mt32_state, mt32)
{
- palette_set_color(machine(), 0, rgb_t(0, 0, 0));
- palette_set_color(machine(), 1, rgb_t(0, 255, 0));
+ palette.set_pen_color(0, rgb_t(0, 0, 0));
+ palette.set_pen_color(1, rgb_t(0, 255, 0));
}
static ADDRESS_MAP_START( mt32_map, AS_PROGRAM, 8, mt32_state )
@@ -359,7 +359,8 @@ static MACHINE_CONFIG_START( mt32, mt32_state )
// MCFG_SCREEN_SIZE(20*6-1, 9)
MCFG_SCREEN_SIZE(20*6-1, (20*6-1)*3/4)
MCFG_SCREEN_VISIBLE_AREA(0, 20*6-2, 0, (20*6-1)*3/4-1)
- MCFG_PALETTE_LENGTH(2)
+ MCFG_PALETTE_ADD("palette", 2)
+ MCFG_PALETTE_INIT_OWNER(mt32_state, mt32)
MCFG_SED1200D0A_ADD( "lcd" )
diff --git a/src/mess/drivers/rt1715.c b/src/mess/drivers/rt1715.c
index b2362db437f..1700d0bba40 100644
--- a/src/mess/drivers/rt1715.c
+++ b/src/mess/drivers/rt1715.c
@@ -40,7 +40,7 @@ public:
DECLARE_WRITE8_MEMBER(rt1715_rom_disable);
virtual void machine_start();
virtual void machine_reset();
- virtual void palette_init();
+ DECLARE_PALETTE_INIT(rt1715);
required_device<cpu_device> m_maincpu;
required_device<ram_device> m_ram;
};
@@ -172,11 +172,11 @@ static const i8275_interface rt1715_i8275_intf =
PALETTE
***************************************************************************/
-void rt1715_state::palette_init()
+PALETTE_INIT_MEMBER(rt1715_state, rt1715)
{
- palette_set_color(machine(), 0, rgb_t(0x00, 0x00, 0x00)); /* black */
- palette_set_color(machine(), 1, rgb_t(0x00, 0x7f, 0x00)); /* low intensity */
- palette_set_color(machine(), 2, rgb_t(0x00, 0xff, 0x00)); /* high intensitiy */
+ palette.set_pen_color(0, rgb_t(0x00, 0x00, 0x00)); /* black */
+ palette.set_pen_color(1, rgb_t(0x00, 0x7f, 0x00)); /* low intensity */
+ palette.set_pen_color(2, rgb_t(0x00, 0xff, 0x00)); /* high intensitiy */
}
@@ -348,7 +348,8 @@ static MACHINE_CONFIG_START( rt1715, rt1715_state )
MCFG_SCREEN_VISIBLE_AREA(0, 78*6-1, 0, 30*10-1)
MCFG_GFXDECODE_ADD("gfxdecode", rt1715)
- MCFG_PALETTE_LENGTH(3)
+ MCFG_PALETTE_ADD("palette", 3)
+ MCFG_PALETTE_INIT_OWNER(rt1715_state, rt1715)
MCFG_I8275_ADD("a26", rt1715_i8275_intf)
MCFG_Z80CTC_ADD("a30", XTAL_10MHz/4 /* ? */, rt1715_ctc_intf)
diff --git a/src/mess/drivers/rx78.c b/src/mess/drivers/rx78.c
index dfac3a73f5b..92d04dd10ec 100644
--- a/src/mess/drivers/rx78.c
+++ b/src/mess/drivers/rx78.c
@@ -230,7 +230,7 @@ WRITE8_MEMBER( rx78_state::vdp_reg_w )
g = (res & 0x22) == 0x22 ? 0xff : ((res & 0x22) == 0x02 ? 0x7f : 0x00);
b = (res & 0x44) == 0x44 ? 0xff : ((res & 0x44) == 0x04 ? 0x7f : 0x00);
- palette_set_color(machine(), i, rgb_t(r,g,b));
+ m_palette->set_pen_color(i, rgb_t(r,g,b));
}
}
@@ -242,7 +242,7 @@ WRITE8_MEMBER( rx78_state::vdp_bg_reg_w )
g = (data & 0x22) == 0x22 ? 0xff : ((data & 0x22) == 0x02 ? 0x7f : 0x00);
b = (data & 0x44) == 0x44 ? 0xff : ((data & 0x44) == 0x04 ? 0x7f : 0x00);
- palette_set_color(machine(), 0x10, rgb_t(r,g,b));
+ m_palette->set_pen_color(0x10, rgb_t(r,g,b));
}
WRITE8_MEMBER( rx78_state::vdp_pri_mask_w )
@@ -469,7 +469,7 @@ static MACHINE_CONFIG_START( rx78, rx78_state )
MCFG_SCREEN_UPDATE_DRIVER(rx78_state, screen_update)
MCFG_SCREEN_SIZE(192, 184)
MCFG_SCREEN_VISIBLE_AREA(0, 192-1, 0, 184-1)
- MCFG_PALETTE_LENGTH(16+1) //+1 for the background color
+ MCFG_PALETTE_ADD("palette", 16+1) //+1 for the background color
MCFG_GFXDECODE_ADD("gfxdecode", rx78)
MCFG_CARTSLOT_ADD("cart")
diff --git a/src/mess/drivers/samcoupe.c b/src/mess/drivers/samcoupe.c
index e0761a82c04..6bd032a85d0 100644
--- a/src/mess/drivers/samcoupe.c
+++ b/src/mess/drivers/samcoupe.c
@@ -493,7 +493,7 @@ INPUT_PORTS_END
nothing G+4 R+4 B+4 ALL+1 G+2 R+2 B+2
*/
-void samcoupe_state::palette_init()
+PALETTE_INIT_MEMBER(samcoupe_state, samcoupe)
{
for (int i = 0; i < 128; i++)
{
@@ -505,10 +505,10 @@ void samcoupe_state::palette_init()
g <<= 5;
b <<= 5;
- palette_set_color(machine(), i, rgb_t(r, g, b));
+ palette.set_pen_color(i, rgb_t(r, g, b));
}
- machine().palette->normalize_range(0, 127);
+ palette.palette()->normalize_range(0, 127);
}
@@ -551,7 +551,8 @@ static MACHINE_CONFIG_START( samcoupe, samcoupe_state )
MCFG_SCREEN_RAW_PARAMS(SAMCOUPE_XTAL_X1/2, SAM_TOTAL_WIDTH, 0, SAM_BORDER_LEFT + SAM_SCREEN_WIDTH + SAM_BORDER_RIGHT, SAM_TOTAL_HEIGHT, 0, SAM_BORDER_TOP + SAM_SCREEN_HEIGHT + SAM_BORDER_BOTTOM)
MCFG_SCREEN_UPDATE_DRIVER(samcoupe_state, screen_update)
- MCFG_PALETTE_LENGTH(128)
+ MCFG_PALETTE_ADD("palette", 128)
+ MCFG_PALETTE_INIT_OWNER(samcoupe_state, samcoupe)
/* devices */
MCFG_CENTRONICS_ADD("lpt1", centronics_printers, "image")
diff --git a/src/mess/drivers/sapi1.c b/src/mess/drivers/sapi1.c
index 40a7f8e528e..f68ec32d47e 100644
--- a/src/mess/drivers/sapi1.c
+++ b/src/mess/drivers/sapi1.c
@@ -568,8 +568,7 @@ static MACHINE_CONFIG_START( sapi1, sapi1_state )
MCFG_SCREEN_SIZE(40*6, 24*9)
MCFG_SCREEN_VISIBLE_AREA(0, 40*6-1, 0, 24*9-1)
MCFG_SCREEN_UPDATE_DRIVER(sapi1_state, screen_update_sapi1)
- MCFG_PALETTE_LENGTH(2)
- MCFG_PALETTE_INIT_OVERRIDE(driver_device, black_and_white)
+ MCFG_PALETTE_ADD_BLACK_AND_WHITE("palette")
/* internal ram */
MCFG_RAM_ADD(RAM_TAG)
diff --git a/src/mess/drivers/saturn.c b/src/mess/drivers/saturn.c
index 92b733d27f2..5fc497ba172 100644
--- a/src/mess/drivers/saturn.c
+++ b/src/mess/drivers/saturn.c
@@ -780,7 +780,7 @@ static MACHINE_CONFIG_START( saturn, sat_console_state )
MCFG_SCREEN_ADD("screen", RASTER)
MCFG_SCREEN_RAW_PARAMS(MASTER_CLOCK_320/8, 427, 0, 320, 263, 0, 224)
MCFG_SCREEN_UPDATE_DRIVER(sat_console_state, screen_update_stv_vdp2)
- MCFG_PALETTE_LENGTH(2048+(2048*2))//standard palette + extra memory for rgb brightness.
+ MCFG_PALETTE_ADD("palette", 2048+(2048*2))//standard palette + extra memory for rgb brightness.
MCFG_GFXDECODE_ADD("gfxdecode", stv)
diff --git a/src/mess/drivers/sbrain.c b/src/mess/drivers/sbrain.c
index 32d51d1358a..19c6c91860d 100644
--- a/src/mess/drivers/sbrain.c
+++ b/src/mess/drivers/sbrain.c
@@ -339,8 +339,7 @@ static MACHINE_CONFIG_START( sbrain, sbrain_state )
MCFG_SCREEN_UPDATE_DRIVER(sbrain_state, screen_update)
MCFG_SCREEN_SIZE(640, 240)
MCFG_SCREEN_VISIBLE_AREA(0, 639, 0, 239)
- MCFG_PALETTE_LENGTH(2)
- MCFG_PALETTE_INIT_OVERRIDE(driver_device, monochrome_amber)
+ MCFG_PALETTE_ADD_MONOCHROME_AMBER("palette")
/* sound hardware */
MCFG_SPEAKER_STANDARD_MONO("mono")
diff --git a/src/mess/drivers/scv.c b/src/mess/drivers/scv.c
index 439f657f2a3..3b19a957cab 100644
--- a/src/mess/drivers/scv.c
+++ b/src/mess/drivers/scv.c
@@ -48,7 +48,7 @@ public:
bool m_cart_ram_enabled;
virtual void machine_start();
virtual void machine_reset();
- virtual void palette_init();
+ DECLARE_PALETTE_INIT(scv);
void scv_postload();
UINT32 screen_update_scv(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
DECLARE_DEVICE_IMAGE_LOAD_MEMBER( scv_cart );
@@ -362,7 +362,7 @@ DEVICE_IMAGE_LOAD_MEMBER( scv_state, scv_cart )
}
-void scv_state::palette_init()
+PALETTE_INIT_MEMBER(scv_state, scv)
{
/*
SCV Epoch-1A chip RGB voltage readouts from paused Bios color test:
@@ -395,22 +395,22 @@ void scv_state::palette_init()
Quamtizing/scaling/rounding between 0 and 255 we thus get:
*/
- palette_set_color_rgb( machine(), 0, 0, 0, 155);
- palette_set_color_rgb( machine(), 1, 0, 0, 0);
- palette_set_color_rgb( machine(), 2, 0, 0, 255);
- palette_set_color_rgb( machine(), 3, 161, 0, 255);
- palette_set_color_rgb( machine(), 4, 0, 255, 0);
- palette_set_color_rgb( machine(), 5, 160, 255, 157);
- palette_set_color_rgb( machine(), 6, 0, 255, 255);
- palette_set_color_rgb( machine(), 7, 0, 161, 0);
- palette_set_color_rgb( machine(), 8, 255, 0, 0);
- palette_set_color_rgb( machine(), 9, 255, 161, 0);
- palette_set_color_rgb( machine(), 10, 255, 0, 255);
- palette_set_color_rgb( machine(), 11, 255, 160, 159);
- palette_set_color_rgb( machine(), 12, 255, 255, 0);
- palette_set_color_rgb( machine(), 13, 163, 160, 0);
- palette_set_color_rgb( machine(), 14, 161, 160, 157);
- palette_set_color_rgb( machine(), 15, 255, 255, 255);
+ palette.set_pen_color( 0, 0, 0, 155);
+ palette.set_pen_color( 1, 0, 0, 0);
+ palette.set_pen_color( 2, 0, 0, 255);
+ palette.set_pen_color( 3, 161, 0, 255);
+ palette.set_pen_color( 4, 0, 255, 0);
+ palette.set_pen_color( 5, 160, 255, 157);
+ palette.set_pen_color( 6, 0, 255, 255);
+ palette.set_pen_color( 7, 0, 161, 0);
+ palette.set_pen_color( 8, 255, 0, 0);
+ palette.set_pen_color( 9, 255, 161, 0);
+ palette.set_pen_color( 10, 255, 0, 255);
+ palette.set_pen_color( 11, 255, 160, 159);
+ palette.set_pen_color( 12, 255, 255, 0);
+ palette.set_pen_color( 13, 163, 160, 0);
+ palette.set_pen_color( 14, 161, 160, 157);
+ palette.set_pen_color( 15, 255, 255, 255);
}
@@ -831,7 +831,8 @@ static MACHINE_CONFIG_START( scv, scv_state )
MCFG_SCREEN_UPDATE_DRIVER(scv_state, screen_update_scv)
MCFG_GFXDECODE_ADD("gfxdecode", scv)
- MCFG_PALETTE_LENGTH( 16 )
+ MCFG_PALETTE_ADD( "palette", 16 )
+ MCFG_PALETTE_INIT_OWNER(scv_state, scv)
/* Sound is generated by UPD1771C clocked at XTAL_6MHz */
MCFG_SPEAKER_STANDARD_MONO("mono")
diff --git a/src/mess/drivers/sm1800.c b/src/mess/drivers/sm1800.c
index 457417017bc..a26d3875669 100644
--- a/src/mess/drivers/sm1800.c
+++ b/src/mess/drivers/sm1800.c
@@ -41,7 +41,7 @@ public:
DECLARE_READ8_MEMBER(sm1800_8255_portc_r);
UINT8 m_irq_state;
virtual void machine_reset();
- virtual void palette_init();
+ DECLARE_PALETTE_INIT(sm1800);
INTERRUPT_GEN_MEMBER(sm1800_vblank_interrupt);
IRQ_CALLBACK_MEMBER(sm1800_irq_callback);
};
@@ -143,11 +143,11 @@ I8255A_INTERFACE( sm1800_ppi8255_interface )
DEVCB_DRIVER_MEMBER(sm1800_state, sm1800_8255_portc_w)
};
-void sm1800_state::palette_init()
+PALETTE_INIT_MEMBER(sm1800_state, sm1800)
{
- palette_set_color(machine(), 0, rgb_t::black); // black
- palette_set_color_rgb(machine(), 1, 0xa0, 0xa0, 0xa0); // white
- palette_set_color(machine(), 2, rgb_t::white); // highlight
+ palette.set_pen_color(0, rgb_t::black); // black
+ palette.set_pen_color(1, 0xa0, 0xa0, 0xa0); // white
+ palette.set_pen_color(2, rgb_t::white); // highlight
}
@@ -184,9 +184,10 @@ static MACHINE_CONFIG_START( sm1800, sm1800_state )
MCFG_SCREEN_VBLANK_TIME(ATTOSECONDS_IN_USEC(2500)) /* not accurate */
MCFG_SCREEN_SIZE(640, 480)
MCFG_SCREEN_VISIBLE_AREA(0, 640-1, 0, 480-1)
+ MCFG_PALETTE_ADD("palette", 3)
+ MCFG_PALETTE_INIT_OWNER(sm1800_state, sm1800)
- MCFG_GFXDECODE_ADD("gfxdecode", sm1800)
- MCFG_PALETTE_LENGTH(3)
+ MCFG_GFXDECODE_ADD("gfxdecode", sm1800)
/* Devices */
MCFG_I8255_ADD ("i8255", sm1800_ppi8255_interface )
diff --git a/src/mess/drivers/smc777.c b/src/mess/drivers/smc777.c
index fd9c0d4a10c..b8cd1304633 100644
--- a/src/mess/drivers/smc777.c
+++ b/src/mess/drivers/smc777.c
@@ -119,7 +119,7 @@ public:
virtual void machine_start();
virtual void machine_reset();
virtual void video_start();
- virtual void palette_init();
+ DECLARE_PALETTE_INIT(smc777);
UINT32 screen_update_smc777(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
INTERRUPT_GEN_MEMBER(smc777_vblank_irq);
TIMER_DEVICE_CALLBACK_MEMBER(keyboard_callback);
@@ -146,7 +146,7 @@ UINT32 smc777_state::screen_update_smc777(screen_device &screen, bitmap_ind16 &b
// popmessage("%d %d %d %d",mc6845_v_char_total,mc6845_v_total_adj,mc6845_v_display,mc6845_v_sync_pos);
- bitmap.fill(machine().pens[m_backdrop_pen], cliprect);
+ bitmap.fill(m_palette->pen(m_backdrop_pen), cliprect);
x_width = ((m_display_reg & 0x80) >> 7);
@@ -164,23 +164,23 @@ UINT32 smc777_state::screen_update_smc777(screen_device &screen, bitmap_ind16 &b
/* todo: clean this up! */
//if(x_width)
{
- bitmap.pix16(y+yi+CRTC_MIN_Y, x*4+0+CRTC_MIN_X) = machine().pens[color];
- bitmap.pix16(y+yi+CRTC_MIN_Y, x*4+1+CRTC_MIN_X) = machine().pens[color];
+ bitmap.pix16(y+yi+CRTC_MIN_Y, x*4+0+CRTC_MIN_X) = m_palette->pen(color);
+ bitmap.pix16(y+yi+CRTC_MIN_Y, x*4+1+CRTC_MIN_X) = m_palette->pen(color);
}
//else
//{
- // bitmap.pix16(y+yi+CRTC_MIN_Y, x*2+0+CRTC_MIN_X) = machine().pens[color];
+ // bitmap.pix16(y+yi+CRTC_MIN_Y, x*2+0+CRTC_MIN_X) = m_palette->pen(color);
//}
color = (m_gvram[count] & 0x0f) >> 0;
//if(x_width)
{
- bitmap.pix16(y+yi+CRTC_MIN_Y, x*4+2+CRTC_MIN_X) = machine().pens[color];
- bitmap.pix16(y+yi+CRTC_MIN_Y, x*4+3+CRTC_MIN_X) = machine().pens[color];
+ bitmap.pix16(y+yi+CRTC_MIN_Y, x*4+2+CRTC_MIN_X) = m_palette->pen(color);
+ bitmap.pix16(y+yi+CRTC_MIN_Y, x*4+3+CRTC_MIN_X) = m_palette->pen(color);
}
//else
//{
- // bitmap.pix16(y+yi+CRTC_MIN_Y, x*2+1+CRTC_MIN_X) = machine().pens[color];
+ // bitmap.pix16(y+yi+CRTC_MIN_Y, x*2+1+CRTC_MIN_X) = m_palette->pen(color);
//}
count++;
@@ -233,11 +233,11 @@ UINT32 smc777_state::screen_update_smc777(screen_device &screen, bitmap_ind16 &b
{
if(x_width)
{
- bitmap.pix16(y*8+CRTC_MIN_Y+yi, (x*8+xi)*2+0+CRTC_MIN_X) = machine().pens[pen];
- bitmap.pix16(y*8+CRTC_MIN_Y+yi, (x*8+xi)*2+1+CRTC_MIN_X) = machine().pens[pen];
+ bitmap.pix16(y*8+CRTC_MIN_Y+yi, (x*8+xi)*2+0+CRTC_MIN_X) = m_palette->pen(pen);
+ bitmap.pix16(y*8+CRTC_MIN_Y+yi, (x*8+xi)*2+1+CRTC_MIN_X) = m_palette->pen(pen);
}
else
- bitmap.pix16(y*8+CRTC_MIN_Y+yi, x*8+CRTC_MIN_X+xi) = machine().pens[pen];
+ bitmap.pix16(y*8+CRTC_MIN_Y+yi, x*8+CRTC_MIN_X+xi) = m_palette->pen(pen);
}
}
}
@@ -264,11 +264,11 @@ UINT32 smc777_state::screen_update_smc777(screen_device &screen, bitmap_ind16 &b
{
if(x_width)
{
- bitmap.pix16(y*8+CRTC_MIN_Y-yc+7, (x*8+xc)*2+0+CRTC_MIN_X) = machine().pens[0x7];
- bitmap.pix16(y*8+CRTC_MIN_Y-yc+7, (x*8+xc)*2+1+CRTC_MIN_X) = machine().pens[0x7];
+ bitmap.pix16(y*8+CRTC_MIN_Y-yc+7, (x*8+xc)*2+0+CRTC_MIN_X) = m_palette->pen(0x7);
+ bitmap.pix16(y*8+CRTC_MIN_Y-yc+7, (x*8+xc)*2+1+CRTC_MIN_X) = m_palette->pen(0x7);
}
else
- bitmap.pix16(y*8+CRTC_MIN_Y-yc+7, x*8+CRTC_MIN_X+xc) = machine().pens[0x7];
+ bitmap.pix16(y*8+CRTC_MIN_Y-yc+7, x*8+CRTC_MIN_X+xc) = m_palette->pen(0x7);
}
}
}
@@ -564,9 +564,9 @@ WRITE8_MEMBER(smc777_state::smc777_ramdac_w)
switch((offset & 0x3000) >> 12)
{
- case 0: m_pal.r = (data & 0xf0) >> 4; palette_set_color_rgb(machine(), pal_index, pal4bit(m_pal.r), pal4bit(m_pal.g), pal4bit(m_pal.b)); break;
- case 1: m_pal.g = (data & 0xf0) >> 4; palette_set_color_rgb(machine(), pal_index, pal4bit(m_pal.r), pal4bit(m_pal.g), pal4bit(m_pal.b)); break;
- case 2: m_pal.b = (data & 0xf0) >> 4; palette_set_color_rgb(machine(), pal_index, pal4bit(m_pal.r), pal4bit(m_pal.g), pal4bit(m_pal.b)); break;
+ case 0: m_pal.r = (data & 0xf0) >> 4; m_palette->set_pen_color(pal_index, pal4bit(m_pal.r), pal4bit(m_pal.g), pal4bit(m_pal.b)); break;
+ case 1: m_pal.g = (data & 0xf0) >> 4; m_palette->set_pen_color(pal_index, pal4bit(m_pal.r), pal4bit(m_pal.g), pal4bit(m_pal.b)); break;
+ case 2: m_pal.b = (data & 0xf0) >> 4; m_palette->set_pen_color(pal_index, pal4bit(m_pal.r), pal4bit(m_pal.g), pal4bit(m_pal.b)); break;
case 3: printf("RAMdac used with gradient index = 3! pal_index = %02x data = %02x\n",pal_index,data); break;
}
}
@@ -1017,7 +1017,7 @@ static MC6845_INTERFACE( mc6845_intf )
};
/* set-up SMC-70 mode colors */
-void smc777_state::palette_init()
+PALETTE_INIT_MEMBER(smc777_state, smc777)
{
int i;
@@ -1029,8 +1029,8 @@ void smc777_state::palette_init()
g = (i & 2) >> 1;
b = (i & 1) >> 0;
- palette_set_color_rgb(machine(), i, pal1bit(r),pal1bit(g),pal1bit(b));
- palette_set_color_rgb(machine(), i+8, pal1bit(0),pal1bit(0),pal1bit(0));
+ palette.set_pen_color(i, pal1bit(r),pal1bit(g),pal1bit(b));
+ palette.set_pen_color(i+8, pal1bit(0),pal1bit(0),pal1bit(0));
}
}
@@ -1088,7 +1088,8 @@ static MACHINE_CONFIG_START( smc777, smc777_state )
MCFG_SCREEN_VISIBLE_AREA(0, 660-1, 0, 220-1) //normal 640 x 200 + 20 pixels for border color
MCFG_SCREEN_UPDATE_DRIVER(smc777_state, screen_update_smc777)
- MCFG_PALETTE_LENGTH(0x20) // 16 + 8 colors (SMC-777 + SMC-70) + 8 empty entries (SMC-70)
+ MCFG_PALETTE_ADD("palette", 0x20) // 16 + 8 colors (SMC-777 + SMC-70) + 8 empty entries (SMC-70)
+ MCFG_PALETTE_INIT_OWNER(smc777_state, smc777)
MCFG_GFXDECODE_ADD("gfxdecode", empty)
diff --git a/src/mess/drivers/sms.c b/src/mess/drivers/sms.c
index 45510c045d4..5509f1c9dd6 100644
--- a/src/mess/drivers/sms.c
+++ b/src/mess/drivers/sms.c
@@ -563,8 +563,6 @@ static MACHINE_CONFIG_DERIVED( sms2_ntsc, sms_ntsc_base )
SEGA315_5124_HEIGHT_NTSC, SEGA315_5124_TBORDER_START + SEGA315_5124_NTSC_224_TBORDER_HEIGHT, SEGA315_5124_TBORDER_START + SEGA315_5124_NTSC_224_TBORDER_HEIGHT + 224)
MCFG_SCREEN_UPDATE_DRIVER(sms_state, screen_update_sms)
- MCFG_PALETTE_LENGTH(SEGA315_5124_PALETTE_SIZE)
-
MCFG_SEGA315_5246_ADD("sms_vdp", _315_5124_ntsc_intf)
MCFG_SEGA315_5246_SET_SCREEN("screen")
MACHINE_CONFIG_END
@@ -601,8 +599,6 @@ static MACHINE_CONFIG_DERIVED( sms1_ntsc, sms_ntsc_base )
MCFG_VIDEO_START_OVERRIDE(sms_state,sms1)
MCFG_VIDEO_RESET_OVERRIDE(sms_state,sms1)
- MCFG_PALETTE_LENGTH(SEGA315_5124_PALETTE_SIZE)
-
MCFG_SEGA315_5124_ADD("sms_vdp", _315_5124_ntsc_intf)
MCFG_SEGA315_5124_SET_SCREEN("screen")
@@ -635,8 +631,6 @@ static MACHINE_CONFIG_START( sms_sdisp, smssdisp_state )
SEGA315_5124_HEIGHT_NTSC, SEGA315_5124_TBORDER_START + SEGA315_5124_NTSC_224_TBORDER_HEIGHT, SEGA315_5124_TBORDER_START + SEGA315_5124_NTSC_224_TBORDER_HEIGHT + 224)
MCFG_SCREEN_UPDATE_DRIVER(sms_state, screen_update_sms)
- MCFG_PALETTE_LENGTH(SEGA315_5124_PALETTE_SIZE)
-
MCFG_SEGA315_5246_ADD("sms_vdp", sms_store_intf)
MCFG_SEGA315_5246_SET_SCREEN("screen")
@@ -729,8 +723,6 @@ static MACHINE_CONFIG_DERIVED( sms2_pal, sms_pal_base )
SEGA315_5124_HEIGHT_PAL, SEGA315_5124_TBORDER_START + SEGA315_5124_PAL_240_TBORDER_HEIGHT, SEGA315_5124_TBORDER_START + SEGA315_5124_PAL_240_TBORDER_HEIGHT + 240)
MCFG_SCREEN_UPDATE_DRIVER(sms_state, screen_update_sms)
- MCFG_PALETTE_LENGTH(SEGA315_5124_PALETTE_SIZE)
-
MCFG_SEGA315_5246_ADD("sms_vdp", _315_5124_pal_intf)
MCFG_SEGA315_5246_SET_SCREEN("screen")
MACHINE_CONFIG_END
@@ -767,8 +759,6 @@ static MACHINE_CONFIG_DERIVED( sms1_pal, sms_pal_base )
MCFG_VIDEO_START_OVERRIDE(sms_state,sms1)
MCFG_VIDEO_RESET_OVERRIDE(sms_state,sms1)
- MCFG_PALETTE_LENGTH(SEGA315_5124_PALETTE_SIZE)
-
MCFG_SEGA315_5124_ADD("sms_vdp", _315_5124_pal_intf)
MCFG_SEGA315_5124_SET_SCREEN("screen")
@@ -824,8 +814,6 @@ static MACHINE_CONFIG_START( gamegear, sms_state )
MCFG_VIDEO_START_OVERRIDE(sms_state,gamegear)
- MCFG_PALETTE_LENGTH(SEGA315_5378_PALETTE_SIZE)
-
MCFG_SEGA315_5378_ADD("sms_vdp", _315_5124_ntsc_intf)
MCFG_SEGA315_5378_SET_SCREEN("screen")
diff --git a/src/mess/drivers/socrates.c b/src/mess/drivers/socrates.c
index 7c3b0b49dd6..c41ae4a9513 100644
--- a/src/mess/drivers/socrates.c
+++ b/src/mess/drivers/socrates.c
@@ -126,7 +126,7 @@ public:
required_device<cpu_device> m_maincpu;
required_device<socrates_snd_device> m_sound;
- rgb_t m_palette[256];
+ rgb_t m_palette_val[256];
UINT8 m_data[8];
UINT8 m_rom_bank;
@@ -163,7 +163,7 @@ public:
DECLARE_DRIVER_INIT(socrates);
virtual void machine_reset();
virtual void video_start();
- virtual void palette_init();
+ DECLARE_PALETTE_INIT(socrates);
UINT32 screen_update_socrates(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
INTERRUPT_GEN_MEMBER(assert_irq);
TIMER_CALLBACK_MEMBER(clear_speech_cb);
@@ -700,14 +700,14 @@ return composedcolor;
}
-void socrates_state::palette_init()
+PALETTE_INIT_MEMBER(socrates_state, socrates)
{
int i; // iterator
for (i = 0; i < 256; i++)
{
- m_palette[i] = socrates_create_color(i);
+ m_palette_val[i] = socrates_create_color(i);
}
- palette_set_colors(machine(), 0, m_palette, ARRAY_LENGTH(m_palette));
+ palette.set_pen_colors(0, m_palette_val, ARRAY_LENGTH(m_palette_val));
}
void socrates_state::video_start()
@@ -1375,8 +1375,8 @@ static MACHINE_CONFIG_START( socrates, socrates_state )
MCFG_SCREEN_VISIBLE_AREA(0, 263, 0, 219) // the last few rows are usually cut off by the screen bottom but are indeed displayed if you mess with v-hold
MCFG_SCREEN_UPDATE_DRIVER(socrates_state, screen_update_socrates)
- MCFG_PALETTE_LENGTH(256)
-
+ MCFG_PALETTE_ADD("palette", 256)
+ MCFG_PALETTE_INIT_OWNER(socrates_state, socrates)
/* sound hardware */
MCFG_SPEAKER_STANDARD_MONO("mono")
@@ -1409,7 +1409,7 @@ static MACHINE_CONFIG_START( socrates_pal, socrates_state )
MCFG_SCREEN_VISIBLE_AREA(0, 263, 0, 229) // the last few rows are usually cut off by the screen bottom but are indeed displayed if you mess with v-hold
MCFG_SCREEN_UPDATE_DRIVER(socrates_state, screen_update_socrates)
- MCFG_PALETTE_LENGTH(256)
+ MCFG_PALETTE_ADD("palette", 256)
/* sound hardware */
@@ -1454,7 +1454,7 @@ static MACHINE_CONFIG_START( iqunlimz, iqunlim_state )
MCFG_SCREEN_UPDATE_DRIVER(iqunlim_state, screen_update)
MCFG_SCREEN_SIZE(256, 224)
MCFG_SCREEN_VISIBLE_AREA(0, 256-1, 0, 224-1)
- MCFG_PALETTE_LENGTH(256)
+ MCFG_PALETTE_ADD("palette", 256)
/* sound hardware */
MCFG_SPEAKER_STANDARD_MONO("mono")
diff --git a/src/mess/drivers/sorcerer.c b/src/mess/drivers/sorcerer.c
index d14a4363c0d..5f7b4003f84 100644
--- a/src/mess/drivers/sorcerer.c
+++ b/src/mess/drivers/sorcerer.c
@@ -434,8 +434,7 @@ static MACHINE_CONFIG_START( sorcerer, sorcerer_state )
MCFG_SCREEN_VISIBLE_AREA(0, 64*8-1, 0, 30*8-1)
MCFG_SCREEN_UPDATE_DRIVER(sorcerer_state, screen_update)
MCFG_GFXDECODE_ADD("gfxdecode", sorcerer)
- MCFG_PALETTE_LENGTH(2)
- MCFG_PALETTE_INIT_OVERRIDE(driver_device, black_and_white)
+ MCFG_PALETTE_ADD_BLACK_AND_WHITE("palette")
/* sound hardware */
MCFG_SPEAKER_STANDARD_MONO("mono")
diff --git a/src/mess/drivers/spec128.c b/src/mess/drivers/spec128.c
index dcb5945c4c3..4b25c7894d4 100644
--- a/src/mess/drivers/spec128.c
+++ b/src/mess/drivers/spec128.c
@@ -303,8 +303,6 @@ MACHINE_CONFIG_DERIVED( spectrum_128, spectrum )
/* video hardware */
MCFG_SCREEN_MODIFY("screen")
- MCFG_PALETTE_LENGTH(16)
- MCFG_PALETTE_INIT_OVERRIDE(spectrum_state, spectrum )
MCFG_SCREEN_RAW_PARAMS(X1_128_SINCLAIR / 2.5f, 456, 0, 352, 311, 0, 296)
MCFG_VIDEO_START_OVERRIDE(spectrum_state, spectrum_128 )
diff --git a/src/mess/drivers/special.c b/src/mess/drivers/special.c
index 5c5cc4544fb..f6aa2dcc34a 100644
--- a/src/mess/drivers/special.c
+++ b/src/mess/drivers/special.c
@@ -374,7 +374,7 @@ static MACHINE_CONFIG_START( special, special_state )
MCFG_SCREEN_VISIBLE_AREA(0, 384-1, 0, 256-1)
MCFG_VIDEO_START_OVERRIDE(special_state,special)
MCFG_SCREEN_UPDATE_DRIVER(special_state, screen_update_special)
- MCFG_PALETTE_LENGTH(2)
+ MCFG_PALETTE_ADD("palette", 2)
/* audio hardware */
MCFG_SPEAKER_STANDARD_MONO("mono")
@@ -425,8 +425,10 @@ static MACHINE_CONFIG_DERIVED( specimx, special )
MCFG_SCREEN_MODIFY("screen")
MCFG_SCREEN_UPDATE_DRIVER(special_state, screen_update_specimx)
MCFG_VIDEO_START_OVERRIDE(special_state,specimx)
- MCFG_PALETTE_LENGTH(16)
- MCFG_PALETTE_INIT_OVERRIDE(special_state, specimx )
+
+ MCFG_DEVICE_REMOVE("palette")
+ MCFG_PALETTE_ADD("palette", 16)
+ MCFG_PALETTE_INIT_OWNER(special_state, specimx )
/* audio hardware */
MCFG_SOUND_ADD("custom", SPECIMX, 0)
@@ -461,8 +463,8 @@ static MACHINE_CONFIG_START( erik, special_state )
MCFG_SCREEN_VISIBLE_AREA(0, 384-1, 0, 256-1)
MCFG_VIDEO_START_OVERRIDE(special_state,erik)
MCFG_SCREEN_UPDATE_DRIVER(special_state, screen_update_erik)
- MCFG_PALETTE_LENGTH(8)
- MCFG_PALETTE_INIT_OVERRIDE(special_state,erik)
+ MCFG_PALETTE_ADD("palette", 8)
+ MCFG_PALETTE_INIT_OWNER(special_state,erik)
/* audio hardware */
MCFG_SPEAKER_STANDARD_MONO("mono")
diff --git a/src/mess/drivers/spectrum.c b/src/mess/drivers/spectrum.c
index f509b722dd0..40a4267da6e 100644
--- a/src/mess/drivers/spectrum.c
+++ b/src/mess/drivers/spectrum.c
@@ -704,8 +704,9 @@ MACHINE_CONFIG_START( spectrum_common, spectrum_state )
MCFG_SCREEN_UPDATE_DRIVER(spectrum_state, screen_update_spectrum)
MCFG_SCREEN_VBLANK_DRIVER(spectrum_state, screen_eof_spectrum)
- MCFG_PALETTE_LENGTH(16)
- MCFG_PALETTE_INIT_OVERRIDE(spectrum_state, spectrum )
+ MCFG_PALETTE_ADD("palette", 16)
+ MCFG_PALETTE_INIT_OWNER(spectrum_state, spectrum )
+
MCFG_GFXDECODE_ADD("gfxdecode", spectrum)
MCFG_VIDEO_START_OVERRIDE(spectrum_state, spectrum )
diff --git a/src/mess/drivers/ssem.c b/src/mess/drivers/ssem.c
index f2b50433586..d6499789dd4 100644
--- a/src/mess/drivers/ssem.c
+++ b/src/mess/drivers/ssem.c
@@ -645,8 +645,7 @@ static MACHINE_CONFIG_START( ssem, ssem_state )
MCFG_SCREEN_SIZE(256, 280)
MCFG_SCREEN_VISIBLE_AREA(0, 255, 0, 279)
MCFG_SCREEN_UPDATE_DRIVER(ssem_state, screen_update_ssem)
- MCFG_PALETTE_LENGTH(2)
- MCFG_PALETTE_INIT_OVERRIDE(driver_device, black_and_white)
+ MCFG_PALETTE_ADD_BLACK_AND_WHITE("palette")
/* cartridge */
MCFG_CARTSLOT_ADD("cart")
diff --git a/src/mess/drivers/ssystem3.c b/src/mess/drivers/ssystem3.c
index aebeb608273..8008912e769 100644
--- a/src/mess/drivers/ssystem3.c
+++ b/src/mess/drivers/ssystem3.c
@@ -300,8 +300,8 @@ static MACHINE_CONFIG_START( ssystem3, ssystem3_state )
MCFG_SCREEN_VISIBLE_AREA(0, 728-1, 0, 437-1)
MCFG_SCREEN_UPDATE_DRIVER(ssystem3_state, screen_update_ssystem3)
- MCFG_PALETTE_LENGTH(242 + 32768)
-
+ MCFG_PALETTE_ADD("palette", 242 + 32768)
+ MCFG_PALETTE_INIT_OWNER(ssystem3_state, ssystem3)
/* sound hardware */
MCFG_SPEAKER_STANDARD_MONO("mono")
diff --git a/src/mess/drivers/super80.c b/src/mess/drivers/super80.c
index 5b32da2a208..eb5a53520c5 100644
--- a/src/mess/drivers/super80.c
+++ b/src/mess/drivers/super80.c
@@ -649,8 +649,7 @@ static MACHINE_CONFIG_START( super80, super80_state )
MCFG_SCREEN_RAW_PARAMS(PIXEL_CLOCK, HTOTAL, HBEND, HBSTART, VTOTAL, VBEND, VBSTART)
MCFG_SCREEN_UPDATE_DRIVER(super80_state, screen_update_super80)
- MCFG_PALETTE_LENGTH(2)
- MCFG_PALETTE_INIT_OVERRIDE(driver_device, monochrome_green)
+ MCFG_PALETTE_ADD_MONOCHROME_GREEN("palette")
MCFG_GFXDECODE_ADD("gfxdecode", super80)
MCFG_DEFAULT_LAYOUT( layout_super80 )
@@ -697,8 +696,10 @@ static MACHINE_CONFIG_DERIVED( super80m, super80 )
MCFG_CPU_PROGRAM_MAP(super80m_map)
MCFG_GFXDECODE_MODIFY("gfxdecode", super80m)
- MCFG_PALETTE_LENGTH(16)
- MCFG_PALETTE_INIT_OVERRIDE(super80_state,super80m)
+
+ MCFG_DEVICE_REMOVE("palette")
+ MCFG_PALETTE_ADD("palette", 16)
+ MCFG_PALETTE_INIT_OWNER(super80_state,super80m)
MCFG_SCREEN_MODIFY("screen")
MCFG_SCREEN_UPDATE_DRIVER(super80_state, screen_update_super80m)
@@ -721,8 +722,8 @@ static MACHINE_CONFIG_START( super80v, super80_state )
MCFG_SCREEN_UPDATE_DRIVER(super80_state, screen_update_super80v)
MCFG_SCREEN_VBLANK_DRIVER(super80_state, screen_eof_super80m)
- MCFG_PALETTE_LENGTH(16)
- MCFG_PALETTE_INIT_OVERRIDE(super80_state,super80m)
+ MCFG_PALETTE_ADD("palette", 16)
+ MCFG_PALETTE_INIT_OWNER(super80_state,super80m)
MCFG_MC6845_ADD("crtc", MC6845, "screen", MASTER_CLOCK / SUPER80V_DOTS, super80v_crtc)
diff --git a/src/mess/drivers/supracan.c b/src/mess/drivers/supracan.c
index 3f33208406c..7025e0cee46 100644
--- a/src/mess/drivers/supracan.c
+++ b/src/mess/drivers/supracan.c
@@ -209,7 +209,7 @@ public:
virtual void machine_start();
virtual void machine_reset();
virtual void video_start();
- virtual void palette_init();
+ DECLARE_PALETTE_INIT(supracan);
UINT32 screen_update_supracan(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
INTERRUPT_GEN_MEMBER(supracan_irq);
INTERRUPT_GEN_MEMBER(supracan_sound_irq);
@@ -565,7 +565,7 @@ void supracan_state::draw_sprites(bitmap_ind16 &bitmap, const rectangle &cliprec
//printf("sprite data %04x %04x %04x %04x\n", supracan_vram[i+0] , supracan_vram[i+1] , supracan_vram[i+2] ,supracan_vram[i+3] );
- gfx->transpen(bitmap,cliprect,tile,palette,sprite_xflip,sprite_yflip,
+ gfx->transpen(m_palette,bitmap,cliprect,tile,palette,sprite_xflip,sprite_yflip,
x,
y,
0);
@@ -612,7 +612,7 @@ void supracan_state::draw_sprites(bitmap_ind16 &bitmap, const rectangle &cliprec
int tile_xflip = sprite_xflip ^ ((data & 0x0800)>>11);
int tile_yflip = sprite_yflip ^ ((data & 0x0400)>>10);
- gfx->transpen(bitmap,cliprect,tile,palette,tile_xflip,tile_yflip,xpos,ypos,0);
+ gfx->transpen(m_palette,bitmap,cliprect,tile,palette,tile_xflip,tile_yflip,xpos,ypos,0);
}
}
}
@@ -1133,7 +1133,7 @@ static ADDRESS_MAP_START( supracan_mem, AS_PROGRAM, 16, supracan_state )
AM_RANGE( 0xe90030, 0xe9003f ) AM_WRITE( supracan_dma_channel1_w )
AM_RANGE( 0xf00000, 0xf001ff ) AM_READWRITE( supracan_video_r, supracan_video_w )
- AM_RANGE( 0xf00200, 0xf003ff ) AM_RAM AM_WRITE(paletteram_xBBBBBGGGGGRRRRR_word_w) AM_SHARE("paletteram")
+ AM_RANGE( 0xf00200, 0xf003ff ) AM_RAM_DEVWRITE("palette", palette_device, write) AM_SHARE("palette")
AM_RANGE( 0xf40000, 0xf5ffff ) AM_READWRITE(supracan_vram_r, supracan_vram_w)
AM_RANGE( 0xfc0000, 0xfdffff ) AM_MIRROR(0x30000) AM_RAM /* System work ram */
ADDRESS_MAP_END
@@ -1351,7 +1351,7 @@ static INPUT_PORTS_START( supracan )
PORT_BIT(0x8000, IP_ACTIVE_HIGH, IPT_BUTTON1 ) PORT_PLAYER(4) PORT_NAME("P4 Button A")
INPUT_PORTS_END
-void supracan_state::palette_init()
+PALETTE_INIT_MEMBER(supracan_state, supracan)
{
// Used for debugging purposes for now
//#if 0
@@ -1362,7 +1362,7 @@ void supracan_state::palette_init()
r = (i & 0x1f) << 3;
g = ((i >> 5) & 0x1f) << 3;
b = ((i >> 10) & 0x1f) << 3;
- palette_set_color_rgb( machine(), i, r, g, b );
+ palette.set_pen_color( i, r, g, b );
}
//#endif
}
@@ -1922,7 +1922,10 @@ static MACHINE_CONFIG_START( supracan, supracan_state )
MCFG_SCREEN_ADD( "screen", RASTER )
MCFG_SCREEN_RAW_PARAMS(XTAL_10_738635MHz/2, 348, 0, 256, 256, 0, 240 ) /* No idea if this is correct */
MCFG_SCREEN_UPDATE_DRIVER(supracan_state, screen_update_supracan)
- MCFG_PALETTE_LENGTH( 32768 )
+ MCFG_PALETTE_ADD( "palette", 32768 )
+ MCFG_PALETTE_FORMAT(xBBBBBGGGGGRRRRR)
+ MCFG_PALETTE_INIT_OWNER(supracan_state, supracan)
+
MCFG_GFXDECODE_ADD("gfxdecode", supracan)
MCFG_CARTSLOT_ADD("cart")
diff --git a/src/mess/drivers/svi318.c b/src/mess/drivers/svi318.c
index 45acd9e9bd0..da56074ef8c 100644
--- a/src/mess/drivers/svi318.c
+++ b/src/mess/drivers/svi318.c
@@ -443,7 +443,7 @@ static MACHINE_CONFIG_START( svi328_806, svi318_state )
MCFG_TMS9928A_SET_SCREEN( "screen" )
MCFG_TMS9928A_SCREEN_ADD_PAL( "screen" )
MCFG_SCREEN_UPDATE_DEVICE( "tms9928a", tms9929a_device, screen_update )
- MCFG_PALETTE_LENGTH(TMS9928A_PALETTE_SIZE + 2) /* 2 additional entries for monochrome svi806 output */
+ MCFG_PALETTE_ADD("palette", TMS9928A_PALETTE_SIZE + 2) /* 2 additional entries for monochrome svi806 output */
MCFG_SCREEN_ADD("svi806", RASTER)
MCFG_SCREEN_REFRESH_RATE(50)
diff --git a/src/mess/drivers/svision.c b/src/mess/drivers/svision.c
index 80238094308..f07abb71d1a 100644
--- a/src/mess/drivers/svision.c
+++ b/src/mess/drivers/svision.c
@@ -351,12 +351,12 @@ static const unsigned char svisionn_palette[] =
245, 249, 248
};
-void svision_state::palette_init()
+PALETTE_INIT_MEMBER(svision_state, svision)
{
int i;
for( i = 0; i < sizeof(svision_palette) / 3; i++ ) {
- palette_set_color_rgb(machine(), i, svision_palette[i*3], svision_palette[i*3+1], svision_palette[i*3+2] );
+ palette.set_pen_color(i, svision_palette[i*3], svision_palette[i*3+1], svision_palette[i*3+2] );
}
}
PALETTE_INIT_MEMBER(svision_state,svisionn)
@@ -364,7 +364,7 @@ PALETTE_INIT_MEMBER(svision_state,svisionn)
int i;
for ( i = 0; i < sizeof(svisionn_palette) / 3; i++ ) {
- palette_set_color_rgb(machine(), i, svisionn_palette[i*3], svisionn_palette[i*3+1], svisionn_palette[i*3+2] );
+ palette.set_pen_color(i, svisionn_palette[i*3], svisionn_palette[i*3+1], svisionn_palette[i*3+2] );
}
}
PALETTE_INIT_MEMBER(svision_state,svisionp)
@@ -372,7 +372,7 @@ PALETTE_INIT_MEMBER(svision_state,svisionp)
int i;
for ( i = 0; i < sizeof(svisionn_palette) / 3; i++ ) {
- palette_set_color_rgb(machine(), i, svisionp_palette[i*3], svisionp_palette[i*3+1], svisionp_palette[i*3+2] );
+ palette.set_pen_color(i, svisionp_palette[i*3], svisionp_palette[i*3+1], svisionp_palette[i*3+2] );
}
}
@@ -433,7 +433,7 @@ UINT32 svision_state::screen_update_tvlink(screen_device &screen, bitmap_rgb32 &
}
else
{
- bitmap.plot_box(3, 0, 162, 159, machine().pens[PALETTE_START]);
+ bitmap.plot_box(3, 0, 162, 159, m_palette->pen(PALETTE_START));
}
return 0;
}
@@ -554,7 +554,8 @@ static MACHINE_CONFIG_START( svision, svision_state )
MCFG_SCREEN_VISIBLE_AREA(3+0, 3+160-1, 0, 160-1)
MCFG_SCREEN_UPDATE_DRIVER(svision_state, screen_update_svision)
- MCFG_PALETTE_LENGTH(ARRAY_LENGTH(svision_palette) * 3)
+ MCFG_PALETTE_ADD("palette", ARRAY_LENGTH(svision_palette) * 3)
+ MCFG_PALETTE_INIT_OWNER(svision_state, svision )
MCFG_DEFAULT_LAYOUT(layout_svision)
@@ -584,7 +585,8 @@ static MACHINE_CONFIG_DERIVED( svisionp, svision )
MCFG_CPU_CLOCK(4430000)
MCFG_SCREEN_MODIFY("screen")
MCFG_SCREEN_REFRESH_RATE(50)
- MCFG_PALETTE_INIT_OVERRIDE(svision_state, svisionp )
+ MCFG_PALETTE_MODIFY("palette")
+ MCFG_PALETTE_INIT_OWNER(svision_state, svisionp )
MACHINE_CONFIG_END
static MACHINE_CONFIG_DERIVED( svisionn, svision )
@@ -592,7 +594,8 @@ static MACHINE_CONFIG_DERIVED( svisionn, svision )
MCFG_CPU_CLOCK(3560000/*?*/)
MCFG_SCREEN_MODIFY("screen")
MCFG_SCREEN_REFRESH_RATE(60)
- MCFG_PALETTE_INIT_OVERRIDE(svision_state, svisionn )
+ MCFG_PALETTE_MODIFY("palette")
+ MCFG_PALETTE_INIT_OWNER(svision_state, svisionn )
MACHINE_CONFIG_END
static MACHINE_CONFIG_DERIVED( tvlinkp, svisionp )
diff --git a/src/mess/drivers/svmu.c b/src/mess/drivers/svmu.c
index 52bd6aba319..76b7c82c965 100644
--- a/src/mess/drivers/svmu.c
+++ b/src/mess/drivers/svmu.c
@@ -36,7 +36,7 @@ public:
required_device<intelfsh8_device> m_flash;
required_device<speaker_sound_device> m_speaker;
- virtual void palette_init();
+ DECLARE_PALETTE_INIT(svmu);
virtual void machine_reset();
DECLARE_WRITE8_MEMBER(page_w);
@@ -149,10 +149,10 @@ void svmu_state::machine_reset()
m_page = 0;
}
-void svmu_state::palette_init()
+PALETTE_INIT_MEMBER(svmu_state, svmu)
{
- palette_set_color(machine(), 0, rgb_t(138, 146, 148));
- palette_set_color(machine(), 1, rgb_t(92, 83, 88));
+ palette.set_pen_color(0, rgb_t(138, 146, 148));
+ palette.set_pen_color(1, rgb_t(92, 83, 88));
}
static LC8670_LCD_UPDATE( svmu_lcd_update )
@@ -314,7 +314,8 @@ static MACHINE_CONFIG_START( svmu, svmu_state )
MCFG_SCREEN_VISIBLE_AREA(0, 48*(PIXEL_SIZE + PIXEL_DISTANCE) - 1, 0, 32*(PIXEL_SIZE + PIXEL_DISTANCE) - 1)
MCFG_SCREEN_UPDATE_DEVICE("maincpu", lc8670_cpu_device, screen_update)
MCFG_DEFAULT_LAYOUT(layout_svmu)
- MCFG_PALETTE_LENGTH(2)
+ MCFG_PALETTE_ADD("palette", 2)
+ MCFG_PALETTE_INIT_OWNER(svmu_state, svmu)
/* sound hardware */
MCFG_SPEAKER_STANDARD_MONO("mono")
diff --git a/src/mess/drivers/sys2900.c b/src/mess/drivers/sys2900.c
index 69d0bd6211d..2678546bbdf 100644
--- a/src/mess/drivers/sys2900.c
+++ b/src/mess/drivers/sys2900.c
@@ -127,8 +127,7 @@ static MACHINE_CONFIG_START( sys2900, sys2900_state )
MCFG_SCREEN_VISIBLE_AREA(0, 640-1, 0, 480-1)
MCFG_SCREEN_UPDATE_DRIVER(sys2900_state, screen_update_sys2900)
- MCFG_PALETTE_LENGTH(2)
- MCFG_PALETTE_INIT_OVERRIDE(driver_device, black_and_white)
+ MCFG_PALETTE_ADD_BLACK_AND_WHITE("palette")
MACHINE_CONFIG_END
diff --git a/src/mess/drivers/tavernie.c b/src/mess/drivers/tavernie.c
index 7ee46db6947..7404ad2fb6c 100644
--- a/src/mess/drivers/tavernie.c
+++ b/src/mess/drivers/tavernie.c
@@ -373,8 +373,7 @@ static MACHINE_CONFIG_DERIVED( ivg09, cpu09 )
MCFG_SCREEN_SIZE(80*8, 25*10)
MCFG_SCREEN_VISIBLE_AREA(0, 80*8-1, 0, 25*10-1)
MCFG_SCREEN_UPDATE_DEVICE("crtc", mc6845_device, screen_update)
- MCFG_PALETTE_LENGTH(2)
- MCFG_PALETTE_INIT_OVERRIDE(driver_device, black_and_white)
+ MCFG_PALETTE_ADD_BLACK_AND_WHITE("palette")
MCFG_DEFAULT_LAYOUT(layout_tavernie)
/* sound hardware */
diff --git a/src/mess/drivers/tdv2324.c b/src/mess/drivers/tdv2324.c
index 09753731302..7011b8751fc 100644
--- a/src/mess/drivers/tdv2324.c
+++ b/src/mess/drivers/tdv2324.c
@@ -312,8 +312,7 @@ static MACHINE_CONFIG_START( tdv2324, tdv2324_state )
MCFG_SCREEN_SIZE(800, 400)
MCFG_SCREEN_VISIBLE_AREA(0, 800-1, 0, 400-1)
- MCFG_PALETTE_LENGTH(2)
- MCFG_PALETTE_INIT_OVERRIDE(driver_device, monochrome_green)
+ MCFG_PALETTE_ADD_MONOCHROME_GREEN("palette")
MCFG_TMS9927_ADD(TMS9937NL_TAG, XTAL_25_39836MHz, vtac_intf)
diff --git a/src/mess/drivers/tek405x.c b/src/mess/drivers/tek405x.c
index 3b3c1337e92..12f94453a5c 100644
--- a/src/mess/drivers/tek405x.c
+++ b/src/mess/drivers/tek405x.c
@@ -1007,8 +1007,7 @@ static MACHINE_CONFIG_START( tek4051, tek4051_state )
MCFG_SCREEN_VISIBLE_AREA(0, 1024-1, 0, 780-1)
MCFG_SCREEN_UPDATE_DEVICE("vector", vector_device, screen_update)
- MCFG_PALETTE_INIT_OVERRIDE(driver_device, monochrome_green)
- MCFG_PALETTE_LENGTH(2)
+ MCFG_PALETTE_ADD_MONOCHROME_GREEN("palette")
// sound hardware
MCFG_SPEAKER_STANDARD_MONO("mono")
@@ -1120,8 +1119,7 @@ static MACHINE_CONFIG_START( tek4052, tek4052_state )
MCFG_SCREEN_VISIBLE_AREA(0, 1024-1, 0, 780-1)
MCFG_SCREEN_UPDATE_DEVICE("vector", vector_device, screen_update)
- MCFG_PALETTE_INIT_OVERRIDE(driver_device, monochrome_green)
- MCFG_PALETTE_LENGTH(2)
+ MCFG_PALETTE_ADD_MONOCHROME_GREEN("palette")
// sound hardware
MCFG_SPEAKER_STANDARD_MONO("mono")
diff --git a/src/mess/drivers/tek410x.c b/src/mess/drivers/tek410x.c
index 0bfbdfe54a1..5d336b01f5c 100644
--- a/src/mess/drivers/tek410x.c
+++ b/src/mess/drivers/tek410x.c
@@ -98,13 +98,14 @@ static MACHINE_CONFIG_START( tek4107a, tek4107a_state )
MCFG_SCREEN_SIZE(640, 480)
MCFG_SCREEN_VISIBLE_AREA(0, 640-1, 0, 480-1)
- MCFG_PALETTE_LENGTH(64)
+ MCFG_PALETTE_ADD("palette", 64)
MCFG_GFXDECODE_ADD("gfxdecode", tek4107a)
MACHINE_CONFIG_END
static MACHINE_CONFIG_DERIVED( tek4109a, tek4107a )
/* video hardware */
- MCFG_PALETTE_LENGTH(4096)
+ MCFG_DEVICE_REMOVE("palette")
+ MCFG_PALETTE_ADD("palette", 4096)
MACHINE_CONFIG_END
/* ROMs */
diff --git a/src/mess/drivers/terak.c b/src/mess/drivers/terak.c
index ae960fe7f6b..e9d69c18572 100644
--- a/src/mess/drivers/terak.c
+++ b/src/mess/drivers/terak.c
@@ -101,8 +101,7 @@ static MACHINE_CONFIG_START( terak, terak_state )
MCFG_SCREEN_VISIBLE_AREA(0, 640-1, 0, 480-1)
MCFG_SCREEN_UPDATE_DRIVER(terak_state, screen_update_terak)
- MCFG_PALETTE_LENGTH(2)
- MCFG_PALETTE_INIT_OVERRIDE(driver_device, black_and_white)
+ MCFG_PALETTE_ADD_BLACK_AND_WHITE("palette")
MACHINE_CONFIG_END
diff --git a/src/mess/drivers/thomson.c b/src/mess/drivers/thomson.c
index bdbb0dff1df..f67743caa0f 100644
--- a/src/mess/drivers/thomson.c
+++ b/src/mess/drivers/thomson.c
@@ -623,8 +623,8 @@ static MACHINE_CONFIG_START( to7, thomson_state )
MCFG_SCREEN_UPDATE_DRIVER( thomson_state, screen_update_thom )
MCFG_SCREEN_VBLANK_DRIVER( thomson_state, thom_vblank )
- MCFG_PALETTE_LENGTH ( 4097 ) /* 12-bit color + transparency */
- MCFG_PALETTE_INIT_OVERRIDE(thomson_state, thom)
+ MCFG_PALETTE_ADD ( "palette", 4097 ) /* 12-bit color + transparency */
+ MCFG_PALETTE_INIT_OWNER(thomson_state, thom)
MCFG_VIDEO_START_OVERRIDE( thomson_state, thom )
MCFG_DEFAULT_LAYOUT( layout_thomson )
diff --git a/src/mess/drivers/ti85.c b/src/mess/drivers/ti85.c
index 50a5192f075..af2fa19ef1b 100644
--- a/src/mess/drivers/ti85.c
+++ b/src/mess/drivers/ti85.c
@@ -504,8 +504,8 @@ static MACHINE_CONFIG_START( ti81, ti85_state )
MCFG_SCREEN_VISIBLE_AREA(0, 96-1, 0, 64-1)
MCFG_SCREEN_UPDATE_DRIVER(ti85_state, screen_update_ti85)
- MCFG_PALETTE_LENGTH(224)
-
+ MCFG_PALETTE_ADD("palette", 224)
+ MCFG_PALETTE_INIT_OWNER(ti85_state, ti85)
MCFG_NVRAM_ADD_0FILL("nvram")
MACHINE_CONFIG_END
@@ -550,8 +550,10 @@ static MACHINE_CONFIG_DERIVED( ti82, ti81 )
MCFG_SCREEN_MODIFY("screen")
MCFG_SCREEN_UPDATE_DEVICE("t6a04", t6a04_device, screen_update)
- MCFG_PALETTE_LENGTH(2)
- MCFG_PALETTE_INIT_OVERRIDE(ti85_state, ti82 )
+
+ MCFG_DEVICE_REMOVE("palette")
+ MCFG_PALETTE_ADD("palette", 2)
+ MCFG_PALETTE_INIT_OWNER(ti85_state, ti82 )
MCFG_T6A04_ADD("t6a04", ti82_display)
@@ -578,8 +580,10 @@ static MACHINE_CONFIG_DERIVED( ti83, ti81 )
MCFG_SCREEN_MODIFY("screen")
MCFG_SCREEN_UPDATE_DEVICE("t6a04", t6a04_device, screen_update)
- MCFG_PALETTE_LENGTH(2)
- MCFG_PALETTE_INIT_OVERRIDE(ti85_state, ti82 )
+
+ MCFG_DEVICE_REMOVE("palette")
+ MCFG_PALETTE_ADD("palette", 2)
+ MCFG_PALETTE_INIT_OWNER(ti85_state, ti82 )
MCFG_T6A04_ADD("t6a04", ti82_display)
MACHINE_CONFIG_END
@@ -610,8 +614,10 @@ static MACHINE_CONFIG_DERIVED( ti83p, ti81 )
MCFG_SCREEN_MODIFY("screen")
MCFG_SCREEN_UPDATE_DEVICE("t6a04", t6a04_device, screen_update)
- MCFG_PALETTE_LENGTH(2)
- MCFG_PALETTE_INIT_OVERRIDE(ti85_state, ti82 )
+
+ MCFG_DEVICE_REMOVE("palette")
+ MCFG_PALETTE_ADD("palette", 2)
+ MCFG_PALETTE_INIT_OWNER(ti85_state, ti82 )
MCFG_T6A04_ADD("t6a04", ti82_display)
diff --git a/src/mess/drivers/ti89.c b/src/mess/drivers/ti89.c
index 1ba43fc69c6..e6169a4ff0b 100644
--- a/src/mess/drivers/ti89.c
+++ b/src/mess/drivers/ti89.c
@@ -508,10 +508,10 @@ UINT32 ti68k_state::screen_update(screen_device &screen, bitmap_ind16 &bitmap, c
return 0;
}
-void ti68k_state::palette_init()
+PALETTE_INIT_MEMBER(ti68k_state, ti68k)
{
- palette_set_color(machine(), 0, rgb_t(138, 146, 148));
- palette_set_color(machine(), 1, rgb_t(92, 83, 88));
+ palette.set_pen_color(0, rgb_t(138, 146, 148));
+ palette.set_pen_color(1, rgb_t(92, 83, 88));
}
static MACHINE_CONFIG_START( ti89, ti68k_state )
@@ -528,7 +528,8 @@ static MACHINE_CONFIG_START( ti89, ti68k_state )
MCFG_SCREEN_UPDATE_DRIVER(ti68k_state, screen_update)
MCFG_SCREEN_SIZE(240, 128)
MCFG_SCREEN_VISIBLE_AREA(0, 160-1, 0, 100-1)
- MCFG_PALETTE_LENGTH(2)
+ MCFG_PALETTE_ADD("palette", 2)
+ MCFG_PALETTE_INIT_OWNER(ti68k_state, ti68k)
MCFG_DEFAULT_LAYOUT(layout_lcd)
MCFG_SHARP_UNK128MBIT_ADD("flash") //should be LH28F320 for ti89t and v200 and LH28F160S3T for other models
diff --git a/src/mess/drivers/ti990_10.c b/src/mess/drivers/ti990_10.c
index f0e84f3aeb5..368f0289e4d 100644
--- a/src/mess/drivers/ti990_10.c
+++ b/src/mess/drivers/ti990_10.c
@@ -240,11 +240,7 @@ static MACHINE_CONFIG_START( ti990_10, ti990_10_state )
MCFG_SCREEN_VISIBLE_AREA(0, 560-1, 0, /*250*/280-1)
MCFG_SCREEN_UPDATE_DRIVER(ti990_10_state, screen_update_ti990_10)
- MCFG_GFXDECODE_ADD("gfxdecode", vdt911)
- MCFG_PALETTE_LENGTH(8)
-
MCFG_VDT911_VIDEO_ADD("vdt911", vdt911_intf)
- MCFG_VDT911_VIDEO_GFXDECODE("gfxdecode")
/* 911 VDT has a beep tone generator */
MCFG_SPEAKER_STANDARD_MONO("mono")
diff --git a/src/mess/drivers/ti990_4.c b/src/mess/drivers/ti990_4.c
index a7001a72311..b8aae6e7151 100644
--- a/src/mess/drivers/ti990_4.c
+++ b/src/mess/drivers/ti990_4.c
@@ -356,19 +356,9 @@ static MACHINE_CONFIG_START( ti990_4, ti990_4_state )
#endif
#if VIDEO_911
- MCFG_GFXDECODE_ADD("gfxdecode", vdt911)
- MCFG_PALETTE_LENGTH(8)
-#else
- MCFG_GFXDECODE_ADD("gfxdecode", asr733)
- MCFG_PALETTE_LENGTH(2)
-#endif
-
-#if VIDEO_911
MCFG_VDT911_VIDEO_ADD("vdt911", vdt911_intf)
- MCFG_VDT911_VIDEO_GFXDECODE("gfxdecode")
#else
MCFG_ASR733_VIDEO_ADD("asr733", asr733_intf)
- MCFG_ASR733_VIDEO_GFXDECODE("gfxdecode")
#endif
#if VIDEO_911
diff --git a/src/mess/drivers/ti99_2.c b/src/mess/drivers/ti99_2.c
index feef1b342c5..c3bac2da158 100644
--- a/src/mess/drivers/ti99_2.c
+++ b/src/mess/drivers/ti99_2.c
@@ -102,7 +102,6 @@ public:
DECLARE_DRIVER_INIT(ti99_2_24);
DECLARE_DRIVER_INIT(ti99_2_32);
virtual void machine_reset();
- virtual void palette_init();
UINT32 screen_update_ti99_2(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
INTERRUPT_GEN_MEMBER(ti99_2_vblank_interrupt);
required_device<cpu_device> m_maincpu;
@@ -160,12 +159,6 @@ INTERRUPT_GEN_MEMBER(ti99_2_state::ti99_2_vblank_interrupt)
*/
-void ti99_2_state::palette_init()
-{
- palette_set_color(machine(),0,rgb_t::white); /* white */
- palette_set_color(machine(),1,rgb_t::black); /* black */
-}
-
UINT32 ti99_2_state::screen_update_ti99_2(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect)
{
@@ -178,7 +171,7 @@ UINT32 ti99_2_state::screen_update_ti99_2(screen_device &screen, bitmap_ind16 &b
for (i = 0; i < 768; i++)
{
/* Is the char code masked or not ??? */
- m_gfxdecode->gfx(0)->opaque(bitmap,cliprect, videoram[i] & 0x7F, 0,
+ m_gfxdecode->gfx(0)->opaque(m_palette,bitmap,cliprect, videoram[i] & 0x7F, 0,
0, 0, sx, sy);
sx += 8;
@@ -398,7 +391,7 @@ static MACHINE_CONFIG_START( ti99_2, ti99_2_state )
MCFG_SCREEN_UPDATE_DRIVER(ti99_2_state, screen_update_ti99_2)
MCFG_GFXDECODE_ADD("gfxdecode", ti99_2)
- MCFG_PALETTE_LENGTH(2)
+ MCFG_PALETTE_ADD_WHITE_AND_BLACK("palette")
MACHINE_CONFIG_END
diff --git a/src/mess/drivers/tiki100.c b/src/mess/drivers/tiki100.c
index a3456c47246..8f86e2174aa 100644
--- a/src/mess/drivers/tiki100.c
+++ b/src/mess/drivers/tiki100.c
@@ -149,9 +149,9 @@ WRITE8_MEMBER( tiki100_state::video_mode_w )
if (BIT(data, 7))
{
int color = data & 0x0f;
- UINT8 colordata = ~m_palette;
+ UINT8 colordata = ~m_palette_val;
- palette_set_color_rgb(machine(), color, pal3bit(colordata >> 5), pal3bit(colordata >> 2), pal2bit(colordata >> 0));
+ m_palette->set_pen_color(color, pal3bit(colordata >> 5), pal3bit(colordata >> 2), pal2bit(colordata >> 0));
}
}
@@ -172,7 +172,7 @@ WRITE8_MEMBER( tiki100_state::palette_w )
*/
- m_palette = data;
+ m_palette_val = data;
}
WRITE8_MEMBER( tiki100_state::system_w )
@@ -685,7 +685,7 @@ void tiki100_state::machine_start()
save_item(NAME(m_vire));
save_item(NAME(m_scroll));
save_item(NAME(m_mode));
- save_item(NAME(m_palette));
+ save_item(NAME(m_palette_val));
save_item(NAME(m_keylatch));
}
@@ -713,7 +713,7 @@ static MACHINE_CONFIG_START( tiki100, tiki100_state )
MCFG_SCREEN_SIZE(1024, 256)
MCFG_SCREEN_VISIBLE_AREA(0, 1024-1, 0, 256-1)
- MCFG_PALETTE_LENGTH(16)
+ MCFG_PALETTE_ADD("palette", 16)
// pixel clock 20.01782 MHz
/* devices */
diff --git a/src/mess/drivers/tim011.c b/src/mess/drivers/tim011.c
index 72f0b22740e..c696ad7eff1 100644
--- a/src/mess/drivers/tim011.c
+++ b/src/mess/drivers/tim011.c
@@ -157,8 +157,7 @@ static MACHINE_CONFIG_START( tim011,tim011_state )
MCFG_SCREEN_SIZE(512, 256)
MCFG_SCREEN_VISIBLE_AREA(0, 512-1, 0, 256-1)
MCFG_SCREEN_UPDATE_DRIVER(tim011_state, screen_update_tim011)
- MCFG_PALETTE_LENGTH(4)
- MCFG_PALETTE_INIT_OVERRIDE(driver_device, black_and_white)
+ MCFG_PALETTE_ADD_BLACK_AND_WHITE("palette")
MACHINE_CONFIG_END
/* ROM definition */
diff --git a/src/mess/drivers/tim100.c b/src/mess/drivers/tim100.c
index 1a535c873b5..da5a635c622 100644
--- a/src/mess/drivers/tim100.c
+++ b/src/mess/drivers/tim100.c
@@ -56,7 +56,7 @@ static const rgb_t tim100_palette[3] = {
void tim100_state::machine_reset()
{
- palette_set_colors(machine(), 0, tim100_palette, ARRAY_LENGTH(tim100_palette));
+ m_palette->set_pen_colors(0, tim100_palette, ARRAY_LENGTH(tim100_palette));
}
const gfx_layout tim100_charlayout =
@@ -130,11 +130,11 @@ static MACHINE_CONFIG_START( tim100, tim100_state )
MCFG_SCREEN_SIZE(40*16, 16*16)
MCFG_SCREEN_VISIBLE_AREA(0, 40*16-1, 0, 16*16-1)
- MCFG_GFXDECODE_ADD("gfxdecode", tim100 )
+ MCFG_GFXDECODE_ADD("gfxdecode", tim100 )
MCFG_I8275_ADD ( "i8276", tim100_i8276_interface)
- MCFG_PALETTE_LENGTH(3)
+ MCFG_PALETTE_ADD("palette", 3)
MCFG_DEVICE_ADD("uart_u17", I8251, 0)
MCFG_DEVICE_ADD("uart_u18", I8251, 0)
diff --git a/src/mess/drivers/tk80bs.c b/src/mess/drivers/tk80bs.c
index 55023b5859b..e3286b2915e 100644
--- a/src/mess/drivers/tk80bs.c
+++ b/src/mess/drivers/tk80bs.c
@@ -69,7 +69,7 @@ UINT32 tk80bs_state::screen_update_tk80bs(screen_device &screen, bitmap_ind16 &b
{
int tile = m_p_videoram[count++];
- m_gfxdecode->gfx(0)->opaque(bitmap,cliprect, tile, 0, 0, 0, x*8, y*8);
+ m_gfxdecode->gfx(0)->opaque(m_palette,bitmap,cliprect, tile, 0, 0, 0, x*8, y*8);
}
}
@@ -193,8 +193,7 @@ static MACHINE_CONFIG_START( tk80bs, tk80bs_state )
MCFG_SCREEN_SIZE(256, 128)
MCFG_SCREEN_VISIBLE_AREA(0, 256-1, 0, 128-1)
MCFG_SCREEN_UPDATE_DRIVER(tk80bs_state, screen_update_tk80bs)
- MCFG_PALETTE_LENGTH(2)
- MCFG_PALETTE_INIT_OVERRIDE(driver_device, black_and_white)
+ MCFG_PALETTE_ADD_BLACK_AND_WHITE("palette")
MCFG_GFXDECODE_ADD("gfxdecode", tk80bs)
/* Devices */
diff --git a/src/mess/drivers/trs80.c b/src/mess/drivers/trs80.c
index 854da73f197..209742636e6 100644
--- a/src/mess/drivers/trs80.c
+++ b/src/mess/drivers/trs80.c
@@ -592,8 +592,7 @@ static MACHINE_CONFIG_START( trs80, trs80_state ) // the original model I,
MCFG_SCREEN_UPDATE_DRIVER(trs80_state, screen_update_trs80)
MCFG_GFXDECODE_ADD("gfxdecode", trs80)
- MCFG_PALETTE_LENGTH(2)
- MCFG_PALETTE_INIT_OVERRIDE(driver_device, black_and_white)
+ MCFG_PALETTE_ADD_BLACK_AND_WHITE("palette")
/* sound hardware */
@@ -677,8 +676,9 @@ static MACHINE_CONFIG_DERIVED( lnw80, model1 )
MCFG_GFXDECODE_MODIFY("gfxdecode",lnw80)
- MCFG_PALETTE_LENGTH(8)
- MCFG_PALETTE_INIT_OVERRIDE(trs80_state,lnw80)
+ MCFG_DEVICE_REMOVE("palette")
+ MCFG_PALETTE_ADD("palette", 8)
+ MCFG_PALETTE_INIT_OWNER(trs80_state,lnw80)
MCFG_SCREEN_MODIFY("screen")
MCFG_SCREEN_SIZE(80*6, 16*12)
MCFG_SCREEN_VISIBLE_AREA(0,80*6-1,0,16*12-1)
diff --git a/src/mess/drivers/tvc.c b/src/mess/drivers/tvc.c
index 22385115c2e..d1f38341eaa 100644
--- a/src/mess/drivers/tvc.c
+++ b/src/mess/drivers/tvc.c
@@ -573,7 +573,7 @@ static MC6845_UPDATE_ROW( tvc_update_row )
}
}
-void tvc_state::palette_init()
+PALETTE_INIT_MEMBER(tvc_state, tvc)
{
const static unsigned char tvc_palette[16][3] =
{
@@ -597,7 +597,7 @@ void tvc_state::palette_init()
int i;
for(i = 0; i < 16; i++)
- palette_set_color_rgb(machine(), i, tvc_palette[i][0], tvc_palette[i][1], tvc_palette[i][2]);
+ palette.set_pen_color(i, tvc_palette[i][0], tvc_palette[i][1], tvc_palette[i][2]);
}
WRITE_LINE_MEMBER(tvc_state::tvc_int_ff_set)
@@ -687,7 +687,8 @@ static MACHINE_CONFIG_START( tvc, tvc_state )
MCFG_SCREEN_VISIBLE_AREA(0, 512 - 1, 0, 240 - 1)
MCFG_SCREEN_UPDATE_DEVICE("crtc", mc6845_device, screen_update)
- MCFG_PALETTE_LENGTH( 16 )
+ MCFG_PALETTE_ADD( "palette", 16 )
+ MCFG_PALETTE_INIT_OWNER(tvc_state, tvc)
MCFG_MC6845_ADD("crtc", MC6845, "screen", 3125000/2, tvc_crtc6845_interface) // clk taken from schematics
diff --git a/src/mess/drivers/tx0.c b/src/mess/drivers/tx0.c
index 9f1b71f7ecd..4911071ec06 100644
--- a/src/mess/drivers/tx0.c
+++ b/src/mess/drivers/tx0.c
@@ -228,7 +228,7 @@ static GFXDECODE_START( tx0 )
GFXDECODE_END
/* Initialise the palette */
-void tx0_state::palette_init()
+PALETTE_INIT_MEMBER(tx0_state, tx0)
{
/* rgb components for the two color emissions */
const double r1 = .1, g1 = .1, b1 = .924, r2 = .7, g2 = .7, b2 = .076;
@@ -246,8 +246,6 @@ void tx0_state::palette_init()
#endif
UINT8 i, r, g, b;
- machine().colortable = colortable_alloc(machine(), total_colors_needed);
-
/* initialize CRT palette */
/* compute the decay factor per refresh frame */
@@ -263,7 +261,7 @@ void tx0_state::palette_init()
g = (int) ((g1*cur_level_1 + g2*cur_level_2) + .5);
b = (int) ((b1*cur_level_1 + b2*cur_level_2) + .5);
/* write color in palette */
- colortable_palette_set_color(machine().colortable, i, rgb_t(r, g, b));
+ palette.set_indirect_color(i, rgb_t(r, g, b));
/* apply decay for next iteration */
cur_level_1 *= decay_1;
cur_level_2 *= decay_2;
@@ -283,22 +281,22 @@ void tx0_state::palette_init()
mame_printf_debug("File %s line %d: Please take higher value for pen_crt_num_levels or smaller value for decay\n", __FILE__, __LINE__);*/
#endif
#endif
- colortable_palette_set_color(machine().colortable, 0, rgb_t(0, 0, 0));
+ palette.set_indirect_color(0, rgb_t(0, 0, 0));
/* load static palette */
for ( i = 0; i < 6; i++ )
{
r = tx0_colors[i*3]; g = tx0_colors[i*3+1]; b = tx0_colors[i*3+2];
- colortable_palette_set_color(machine().colortable, pen_crt_num_levels + i, rgb_t(r, g, b));
+ palette.set_indirect_color(pen_crt_num_levels + i, rgb_t(r, g, b));
}
/* copy colortable to palette */
for( i = 0; i < total_colors_needed; i++ )
- colortable_entry_set_value(machine().colortable, i, i);
+ palette.set_pen_indirect(i, i);
/* set up palette for text */
for( i = 0; i < 6; i++ )
- colortable_entry_set_value(machine().colortable, total_colors_needed + i, tx0_palette[i]);
+ palette.set_pen_indirect(total_colors_needed + i, tx0_palette[i]);
}
@@ -1598,8 +1596,8 @@ static MACHINE_CONFIG_START( tx0_64kw, tx0_state )
MCFG_DEVICE_ADD("magtape", TX0_MAGTAPE, 0)
MCFG_GFXDECODE_ADD("gfxdecode", tx0)
- MCFG_PALETTE_LENGTH(pen_crt_num_levels + sizeof(tx0_colors) / 3 + sizeof(tx0_palette))
-
+ MCFG_PALETTE_ADD("palette", pen_crt_num_levels + sizeof(tx0_colors) / 3 + sizeof(tx0_palette))
+ MCFG_PALETTE_INIT_OWNER(tx0_state, tx0)
MACHINE_CONFIG_END
static MACHINE_CONFIG_DERIVED( tx0_8kw, tx0_64kw )
diff --git a/src/mess/drivers/uknc.c b/src/mess/drivers/uknc.c
index efbc4a1b8a8..7c6d425e4be 100644
--- a/src/mess/drivers/uknc.c
+++ b/src/mess/drivers/uknc.c
@@ -72,8 +72,7 @@ static MACHINE_CONFIG_START( uknc, uknc_state )
MCFG_SCREEN_SIZE(640, 480)
MCFG_SCREEN_VISIBLE_AREA(0, 640-1, 0, 480-1)
MCFG_SCREEN_UPDATE_DRIVER(uknc_state, screen_update_uknc)
- MCFG_PALETTE_LENGTH(2)
- MCFG_PALETTE_INIT_OVERRIDE(driver_device, black_and_white)
+ MCFG_PALETTE_ADD_BLACK_AND_WHITE("palette")
MACHINE_CONFIG_END
/* ROM definition */
diff --git a/src/mess/drivers/unior.c b/src/mess/drivers/unior.c
index 95d8f3b1177..1fa0118501e 100644
--- a/src/mess/drivers/unior.c
+++ b/src/mess/drivers/unior.c
@@ -291,7 +291,7 @@ static const rgb_t unior_palette[3] =
PALETTE_INIT_MEMBER(unior_state,unior)
{
- palette_set_colors(machine(), 0, unior_palette, ARRAY_LENGTH(unior_palette));
+ palette.set_pen_colors(0, unior_palette, ARRAY_LENGTH(unior_palette));
}
@@ -439,8 +439,8 @@ static MACHINE_CONFIG_START( unior, unior_state )
MCFG_SCREEN_VISIBLE_AREA(0, 640-1, 0, 200-1)
MCFG_SCREEN_UPDATE_DEVICE("crtc", i8275_device, screen_update)
MCFG_GFXDECODE_ADD("gfxdecode", unior)
- MCFG_PALETTE_LENGTH(3)
- MCFG_PALETTE_INIT_OVERRIDE(unior_state,unior)
+ MCFG_PALETTE_ADD("palette", 3)
+ MCFG_PALETTE_INIT_OWNER(unior_state,unior)
/* sound hardware */
MCFG_SPEAKER_STANDARD_MONO("mono")
diff --git a/src/mess/drivers/unistar.c b/src/mess/drivers/unistar.c
index 49165c6d1e4..d62d378fba0 100644
--- a/src/mess/drivers/unistar.c
+++ b/src/mess/drivers/unistar.c
@@ -21,7 +21,7 @@ public:
virtual void machine_reset();
virtual void video_start();
- void palette_init_unistar();
+ DECLARE_PALETTE_INIT(unistar);
UINT32 screen_update_unistar(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
const UINT8 *m_p_chargen;
private:
@@ -54,9 +54,9 @@ void unistar_state::machine_reset()
PALETTE_INIT_MEMBER( unistar_state, unistar )
{
- palette_set_color_rgb( machine(), 0, 0, 0, 0 ); /* Black */
- palette_set_color_rgb( machine(), 1, 0, 255, 0 ); /* Full */
- palette_set_color_rgb( machine(), 2, 0, 128, 0 ); /* Dimmed */
+ palette.set_pen_color(0, 0, 0, 0 ); /* Black */
+ palette.set_pen_color(1, 0, 255, 0 ); /* Full */
+ palette.set_pen_color(2, 0, 128, 0 ); /* Dimmed */
}
void unistar_state::video_start()
@@ -100,8 +100,8 @@ static MACHINE_CONFIG_START( unistar, unistar_state )
MCFG_SCREEN_VISIBLE_AREA(0, 640-1, 0, 480-1)
MCFG_SCREEN_UPDATE_DRIVER(unistar_state, screen_update_unistar)
MCFG_GFXDECODE_ADD("gfxdecode", unistar)
- MCFG_PALETTE_LENGTH(3)
- MCFG_PALETTE_INIT_OVERRIDE(unistar_state, unistar)
+ MCFG_PALETTE_ADD("palette", 3)
+ MCFG_PALETTE_INIT_OWNER(unistar_state, unistar)
MACHINE_CONFIG_END
/* ROM definition */
diff --git a/src/mess/drivers/univac.c b/src/mess/drivers/univac.c
index 308a4eef1d2..e4ac8240cc9 100644
--- a/src/mess/drivers/univac.c
+++ b/src/mess/drivers/univac.c
@@ -148,8 +148,7 @@ static MACHINE_CONFIG_START( uts20, univac_state )
MCFG_SCREEN_UPDATE_DRIVER(univac_state, screen_update)
MCFG_SCREEN_SIZE(640, 250)
MCFG_SCREEN_VISIBLE_AREA(0, 639, 0, 249)
- MCFG_PALETTE_LENGTH(2)
- MCFG_PALETTE_INIT_OVERRIDE(driver_device, black_and_white)
+ MCFG_PALETTE_ADD_BLACK_AND_WHITE("palette")
MACHINE_CONFIG_END
diff --git a/src/mess/drivers/unixpc.c b/src/mess/drivers/unixpc.c
index db3854404f2..adf55de672d 100644
--- a/src/mess/drivers/unixpc.c
+++ b/src/mess/drivers/unixpc.c
@@ -212,8 +212,7 @@ static MACHINE_CONFIG_START( unixpc, unixpc_state )
MCFG_DEFAULT_LAYOUT(layout_unixpc)
- MCFG_PALETTE_LENGTH(2)
- MCFG_PALETTE_INIT_OVERRIDE(driver_device, black_and_white)
+ MCFG_PALETTE_ADD_BLACK_AND_WHITE("palette")
// internal ram
MCFG_RAM_ADD(RAM_TAG)
diff --git a/src/mess/drivers/ut88.c b/src/mess/drivers/ut88.c
index 909e9b4a1e9..61471a5b027 100644
--- a/src/mess/drivers/ut88.c
+++ b/src/mess/drivers/ut88.c
@@ -200,9 +200,8 @@ static MACHINE_CONFIG_START( ut88, ut88_state )
MCFG_SCREEN_VISIBLE_AREA(0, 64*8-1, 0, 28*8-1)
MCFG_VIDEO_START_OVERRIDE(ut88_state,ut88)
MCFG_SCREEN_UPDATE_DRIVER(ut88_state, screen_update_ut88)
- MCFG_PALETTE_LENGTH(2)
- MCFG_PALETTE_INIT_OVERRIDE(driver_device, black_and_white)
- MCFG_GFXDECODE_ADD("gfxdecode", ut88 )
+ MCFG_PALETTE_ADD_BLACK_AND_WHITE("palette")
+ MCFG_GFXDECODE_ADD("gfxdecode", ut88 )
/* audio hardware */
MCFG_SPEAKER_STANDARD_MONO("mono")
diff --git a/src/mess/drivers/v6809.c b/src/mess/drivers/v6809.c
index c0560759954..48dc6a8ad4b 100644
--- a/src/mess/drivers/v6809.c
+++ b/src/mess/drivers/v6809.c
@@ -346,8 +346,7 @@ static MACHINE_CONFIG_START( v6809, v6809_state )
MCFG_SCREEN_SIZE(640, 480)
MCFG_SCREEN_VISIBLE_AREA(0, 640-1, 0, 480-1)
MCFG_SCREEN_UPDATE_DEVICE("crtc", sy6545_1_device, screen_update)
- MCFG_PALETTE_LENGTH(2)
- MCFG_PALETTE_INIT_OVERRIDE(driver_device, black_and_white)
+ MCFG_PALETTE_ADD_BLACK_AND_WHITE("palette")
MCFG_GFXDECODE_ADD("gfxdecode", v6809)
/* sound hardware */
diff --git a/src/mess/drivers/vboy.c b/src/mess/drivers/vboy.c
index 6daf247c354..2379174c904 100644
--- a/src/mess/drivers/vboy.c
+++ b/src/mess/drivers/vboy.c
@@ -211,7 +211,7 @@ public:
virtual void machine_start();
virtual void machine_reset();
virtual void video_start();
- virtual void palette_init();
+ DECLARE_PALETTE_INIT(vboy);
UINT32 screen_update_vboy_left(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
UINT32 screen_update_vboy_right(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
TIMER_DEVICE_CALLBACK_MEMBER(timer_main_tick);
@@ -264,7 +264,7 @@ void vboy_state::put_obj(bitmap_ind16 &bitmap, const rectangle &cliprect, int x,
if (dat)
{
if (cliprect.contains(res_x, res_y))
- bitmap.pix16((res_y), (res_x)) = machine().pens[col];
+ bitmap.pix16((res_y), (res_x)) = m_palette->pen(col);
}
}
}
@@ -379,7 +379,7 @@ void vboy_state::draw_bg_map(bitmap_ind16 &bitmap, const rectangle &cliprect, UI
}
if(pix != -1)
- bitmap.pix16(y1, x1) = machine().pens[pix & 3];
+ bitmap.pix16(y1, x1) = m_palette->pen(pix & 3);
}
}
// g_profiler.stop();
@@ -424,7 +424,7 @@ void vboy_state::draw_affine_map(bitmap_ind16 &bitmap, const rectangle &cliprect
if(pix != -1)
if (cliprect.contains(x1, y1))
- bitmap.pix16(y1, x1) = machine().pens[pix & 3];
+ bitmap.pix16(y1, x1) = m_palette->pen(pix & 3);
}
}
// g_profiler.stop();
@@ -545,7 +545,7 @@ UINT8 vboy_state::display_world(int num, bitmap_ind16 &bitmap, const rectangle &
UINT32 vboy_state::screen_update_vboy_left(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect)
{
- bitmap.fill(machine().pens[m_vip_regs.BKCOL], cliprect);
+ bitmap.fill(m_palette->pen(m_vip_regs.BKCOL), cliprect);
int cur_spt;
if(!(m_vip_regs.DPCTRL & 2)) /* Don't bother if screen is off */
@@ -571,7 +571,7 @@ UINT32 vboy_state::screen_update_vboy_left(screen_device &screen, bitmap_ind16 &
yi = ((y & 0x3)*2);
pix = (pen >> yi) & 3;
- bitmap.pix16(y, x) = machine().pens[pix & 3];
+ bitmap.pix16(y, x) = m_palette->pen(pix & 3);
}
}
}
@@ -581,7 +581,7 @@ UINT32 vboy_state::screen_update_vboy_left(screen_device &screen, bitmap_ind16 &
UINT32 vboy_state::screen_update_vboy_right(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect)
{
- bitmap.fill(machine().pens[m_vip_regs.BKCOL], cliprect);
+ bitmap.fill(m_palette->pen(m_vip_regs.BKCOL), cliprect);
int cur_spt;
if(!(m_vip_regs.DPCTRL & 2)) /* Don't bother if screen is off */
@@ -757,9 +757,9 @@ void vboy_state::m_set_brightness(void)
if(c > 0xff) { c = 0xff; }
// popmessage("%02x %02x %02x %02x",m_vip_regs.BRTA,m_vip_regs.BRTB,m_vip_regs.BRTC,m_vip_regs.REST);
- palette_set_color_rgb(machine(), 1, a,0,0);
- palette_set_color_rgb(machine(), 2, b,0,0);
- palette_set_color_rgb(machine(), 3, c,0,0);
+ m_palette->set_pen_color(1, a,0,0);
+ m_palette->set_pen_color(2, b,0,0);
+ m_palette->set_pen_color(3, c,0,0);
}
READ16_MEMBER( vboy_state::vip_r )
@@ -1249,12 +1249,12 @@ TIMER_DEVICE_CALLBACK_MEMBER(vboy_state::timer_pad_tick)
m_maincpu->set_input_line(0, HOLD_LINE);
}
-void vboy_state::palette_init()
+PALETTE_INIT_MEMBER(vboy_state, vboy)
{
- palette_set_color(machine(), 0, rgb_t::black);
- palette_set_color(machine(), 1, rgb_t::black);
- palette_set_color(machine(), 2, rgb_t::black);
- palette_set_color(machine(), 3, rgb_t::black);
+ palette.set_pen_color(0, rgb_t::black);
+ palette.set_pen_color(1, rgb_t::black);
+ palette.set_pen_color(2, rgb_t::black);
+ palette.set_pen_color(3, rgb_t::black);
}
void vboy_state::m_set_irq(UINT16 irq_vector)
@@ -1430,7 +1430,8 @@ static MACHINE_CONFIG_START( vboy, vboy_state )
/* video hardware */
MCFG_DEFAULT_LAYOUT(layout_vboy)
- MCFG_PALETTE_LENGTH(4)
+ MCFG_PALETTE_ADD("palette", 4)
+ MCFG_PALETTE_INIT_OWNER(vboy_state, vboy)
/* Left screen */
MCFG_SCREEN_ADD("3dleft", RASTER)
diff --git a/src/mess/drivers/vc4000.c b/src/mess/drivers/vc4000.c
index 5e984d68545..14dc4c1ee88 100644
--- a/src/mess/drivers/vc4000.c
+++ b/src/mess/drivers/vc4000.c
@@ -355,9 +355,9 @@ static const rgb_t vc4000_palette[] =
We can do that in the code with ^7 */
};
-void vc4000_state::palette_init()
+PALETTE_INIT_MEMBER(vc4000_state, vc4000)
{
- palette_set_colors(machine(), 0, vc4000_palette, ARRAY_LENGTH(vc4000_palette));
+ palette.set_pen_colors(0, vc4000_palette, ARRAY_LENGTH(vc4000_palette));
}
DEVICE_IMAGE_LOAD_MEMBER( vc4000_state, vc4000_cart )
@@ -424,8 +424,8 @@ static MACHINE_CONFIG_START( vc4000, vc4000_state )
MCFG_SCREEN_VISIBLE_AREA(8, 184, 0, 269)
MCFG_SCREEN_UPDATE_DRIVER(vc4000_state, screen_update_vc4000)
- MCFG_PALETTE_LENGTH(8)
-
+ MCFG_PALETTE_ADD("palette", 8)
+ MCFG_PALETTE_INIT_OWNER(vc4000_state, vc4000)
/* sound hardware */
MCFG_SPEAKER_STANDARD_MONO("mono")
diff --git a/src/mess/drivers/vector06.c b/src/mess/drivers/vector06.c
index 0960a51b0d0..eac86093689 100644
--- a/src/mess/drivers/vector06.c
+++ b/src/mess/drivers/vector06.c
@@ -175,7 +175,8 @@ static MACHINE_CONFIG_START( vector06, vector06_state )
MCFG_SCREEN_SIZE(256+64, 256+64)
MCFG_SCREEN_VISIBLE_AREA(0, 256+64-1, 0, 256+64-1)
MCFG_SCREEN_UPDATE_DRIVER(vector06_state, screen_update_vector06)
- MCFG_PALETTE_LENGTH(16)
+ MCFG_PALETTE_ADD("palette", 16)
+ MCFG_PALETTE_INIT_OWNER(vector06_state, vector06)
MCFG_SPEAKER_STANDARD_MONO("mono")
MCFG_SOUND_WAVE_ADD(WAVE_TAG, "cassette")
diff --git a/src/mess/drivers/vg5k.c b/src/mess/drivers/vg5k.c
index 90f46e1b197..f8bfa840e7c 100644
--- a/src/mess/drivers/vg5k.c
+++ b/src/mess/drivers/vg5k.c
@@ -390,7 +390,7 @@ static MACHINE_CONFIG_START( vg5k, vg5k_state )
MCFG_SCREEN_VISIBLE_AREA(00, 336-1, 00, 270-1)
MCFG_GFXDECODE_ADD("gfxdecode", vg5k)
- MCFG_PALETTE_LENGTH(8)
+ MCFG_PALETTE_ADD("palette", 8)
/* sound hardware */
MCFG_SPEAKER_STANDARD_MONO("mono")
diff --git a/src/mess/drivers/victor9k.c b/src/mess/drivers/victor9k.c
index 22244cb6597..a8b1b7e47bb 100644
--- a/src/mess/drivers/victor9k.c
+++ b/src/mess/drivers/victor9k.c
@@ -950,8 +950,7 @@ static MACHINE_CONFIG_START( victor9k, victor9k_state )
MCFG_SCREEN_SIZE(640, 480)
MCFG_SCREEN_VISIBLE_AREA(0, 640-1, 0, 480-1)
- MCFG_PALETTE_LENGTH(2)
- MCFG_PALETTE_INIT_OVERRIDE(driver_device, monochrome_green)
+ MCFG_PALETTE_ADD_MONOCHROME_GREEN("palette")
MCFG_MC6845_ADD(HD46505S_TAG, HD6845, SCREEN_TAG, 1000000, hd46505s_intf) // HD6845 == HD46505S
diff --git a/src/mess/drivers/vii.c b/src/mess/drivers/vii.c
index dca8bd83193..406cd9da72f 100644
--- a/src/mess/drivers/vii.c
+++ b/src/mess/drivers/vii.c
@@ -1120,7 +1120,7 @@ static MACHINE_CONFIG_START( vii, vii_state )
MCFG_SCREEN_SIZE(320, 240)
MCFG_SCREEN_VISIBLE_AREA(0, 320-1, 0, 240-1)
MCFG_SCREEN_UPDATE_DRIVER(vii_state, screen_update_vii)
- MCFG_PALETTE_LENGTH(32768)
+ MCFG_PALETTE_ADD("palette", 32768)
MCFG_CARTSLOT_ADD( "cart" )
MCFG_CARTSLOT_EXTENSION_LIST( "bin" )
@@ -1142,7 +1142,7 @@ static MACHINE_CONFIG_START( vsmile, vii_state )
MCFG_SCREEN_SIZE(320, 240)
MCFG_SCREEN_VISIBLE_AREA(0, 320-1, 0, 240-1)
MCFG_SCREEN_UPDATE_DRIVER(vii_state, screen_update_vii)
- MCFG_PALETTE_LENGTH(32768)
+ MCFG_PALETTE_ADD("palette", 32768)
MCFG_CARTSLOT_ADD( "cart" )
MCFG_CARTSLOT_EXTENSION_LIST( "bin" )
@@ -1167,7 +1167,7 @@ static MACHINE_CONFIG_START( batman, vii_state )
MCFG_SCREEN_SIZE(320, 240)
MCFG_SCREEN_VISIBLE_AREA(0, 320-1, 0, 240-1)
MCFG_SCREEN_UPDATE_DRIVER(vii_state, screen_update_vii)
- MCFG_PALETTE_LENGTH(32768)
+ MCFG_PALETTE_ADD("palette", 32768)
MACHINE_CONFIG_END
DRIVER_INIT_MEMBER(vii_state,vii)
diff --git a/src/mess/drivers/vt100.c b/src/mess/drivers/vt100.c
index 2eaa8a3b70b..a9474fd91b2 100644
--- a/src/mess/drivers/vt100.c
+++ b/src/mess/drivers/vt100.c
@@ -420,10 +420,10 @@ static MACHINE_CONFIG_START( vt100, vt100_state )
MCFG_SCREEN_SIZE(80*10, 25*10)
MCFG_SCREEN_VISIBLE_AREA(0, 80*10-1, 0, 25*10-1)
MCFG_SCREEN_UPDATE_DRIVER(vt100_state, screen_update_vt100)
+ MCFG_SCREEN_PALETTE("vt100_video:palette")
MCFG_GFXDECODE_ADD("gfxdecode", vt100)
- MCFG_PALETTE_LENGTH(2)
- MCFG_PALETTE_INIT_OVERRIDE(driver_device, monochrome_green)
+// MCFG_PALETTE_ADD_MONOCHROME_GREEN("palette")
MCFG_DEFAULT_LAYOUT( layout_vt100 )
diff --git a/src/mess/drivers/vt220.c b/src/mess/drivers/vt220.c
index a08f1cb7769..3c26c8735f7 100644
--- a/src/mess/drivers/vt220.c
+++ b/src/mess/drivers/vt220.c
@@ -67,8 +67,7 @@ static MACHINE_CONFIG_START( vt220, vt220_state )
MCFG_SCREEN_SIZE(640, 480)
MCFG_SCREEN_VISIBLE_AREA(0, 640-1, 0, 480-1)
MCFG_SCREEN_UPDATE_DRIVER(vt220_state, screen_update_vt220)
- MCFG_PALETTE_LENGTH(2)
- MCFG_PALETTE_INIT_OVERRIDE(driver_device, black_and_white)
+ MCFG_PALETTE_ADD_BLACK_AND_WHITE("palette")
/* internal ram */
MCFG_RAM_ADD(RAM_TAG)
diff --git a/src/mess/drivers/vt240.c b/src/mess/drivers/vt240.c
index 3c7a8e395a6..8fcab8c374a 100644
--- a/src/mess/drivers/vt240.c
+++ b/src/mess/drivers/vt240.c
@@ -176,8 +176,7 @@ static MACHINE_CONFIG_START( vt240, vt240_state )
MCFG_SCREEN_VISIBLE_AREA(0, 640-1, 0, 480-1)
// MCFG_VIDEO_START_OVERRIDE(vt240_state,vt240)
MCFG_SCREEN_UPDATE_DEVICE("upd7220", upd7220_device, screen_update)
- MCFG_PALETTE_LENGTH(2)
- MCFG_PALETTE_INIT_OVERRIDE(driver_device, black_and_white)
+ MCFG_PALETTE_ADD_BLACK_AND_WHITE("palette")
MCFG_GFXDECODE_ADD("gfxdecode", vt240)
MCFG_UPD7220_ADD("upd7220", XTAL_4MHz / 4, hgdc_intf, upd7220_map) //unknown clock
diff --git a/src/mess/drivers/vt320.c b/src/mess/drivers/vt320.c
index c4b86961435..88bfb15e198 100644
--- a/src/mess/drivers/vt320.c
+++ b/src/mess/drivers/vt320.c
@@ -93,8 +93,7 @@ static MACHINE_CONFIG_START( vt320, vt320_state )
MCFG_SCREEN_SIZE(640, 480)
MCFG_SCREEN_VISIBLE_AREA(0, 640-1, 0, 480-1)
MCFG_SCREEN_UPDATE_DRIVER(vt320_state, screen_update_vt320)
- MCFG_PALETTE_LENGTH(2)
- MCFG_PALETTE_INIT_OVERRIDE(driver_device, black_and_white)
+ MCFG_PALETTE_ADD_BLACK_AND_WHITE("palette")
/* internal ram */
MCFG_RAM_ADD(RAM_TAG)
diff --git a/src/mess/drivers/vt520.c b/src/mess/drivers/vt520.c
index f3beb5ff38c..2627ee36b2d 100644
--- a/src/mess/drivers/vt520.c
+++ b/src/mess/drivers/vt520.c
@@ -84,8 +84,7 @@ static MACHINE_CONFIG_START( vt520, vt520_state )
MCFG_SCREEN_SIZE(802, 480)
MCFG_SCREEN_VISIBLE_AREA(0, 802-1, 0, 480-1)
MCFG_SCREEN_UPDATE_DRIVER(vt520_state, screen_update_vt520)
- MCFG_PALETTE_LENGTH(2)
- MCFG_PALETTE_INIT_OVERRIDE(driver_device, black_and_white)
+ MCFG_PALETTE_ADD_BLACK_AND_WHITE("palette")
// On the board there are two M5M44256BJ-7 chips
// Which are DRAM 256K x 4bit
diff --git a/src/mess/drivers/vta2000.c b/src/mess/drivers/vta2000.c
index 935d6e27792..27e38c7144f 100644
--- a/src/mess/drivers/vta2000.c
+++ b/src/mess/drivers/vta2000.c
@@ -34,10 +34,10 @@ public:
const UINT8 *m_p_chargen;
UINT32 screen_update_vta2000(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
required_shared_ptr<UINT8> m_p_videoram;
+ DECLARE_PALETTE_INIT(vta2000);
private:
virtual void machine_reset();
virtual void video_start();
- virtual void palette_init();
required_device<cpu_device> m_maincpu;
};
@@ -150,11 +150,11 @@ static GFXDECODE_START( vta2000 )
GFXDECODE_ENTRY( "chargen", 0x0000, vta2000_charlayout, 0, 1 )
GFXDECODE_END
-void vta2000_state::palette_init()
+PALETTE_INIT_MEMBER(vta2000_state, vta2000)
{
- palette_set_color(machine(), 0, rgb_t::black); // black
- palette_set_color_rgb(machine(), 1, 0x00, 0xc0, 0x00); // green
- palette_set_color_rgb(machine(), 2, 0x00, 0xff, 0x00); // highlight
+ palette.set_pen_color(0, rgb_t::black); // black
+ palette.set_pen_color(1, 0x00, 0xc0, 0x00); // green
+ palette.set_pen_color(2, 0x00, 0xff, 0x00); // highlight
}
static MACHINE_CONFIG_START( vta2000, vta2000_state )
@@ -170,7 +170,8 @@ static MACHINE_CONFIG_START( vta2000, vta2000_state )
MCFG_SCREEN_SIZE(80*8, 25*12)
MCFG_SCREEN_VISIBLE_AREA(0, 80*8-1, 0, 25*12-1)
MCFG_SCREEN_UPDATE_DRIVER(vta2000_state, screen_update_vta2000)
- MCFG_PALETTE_LENGTH(3)
+ MCFG_PALETTE_ADD("palette", 3)
+ MCFG_PALETTE_INIT_OWNER(vta2000_state, vta2000)
MCFG_GFXDECODE_ADD("gfxdecode", vta2000)
MACHINE_CONFIG_END
diff --git a/src/mess/drivers/vtech2.c b/src/mess/drivers/vtech2.c
index 9e5485b9563..cd7ee8dd7da 100644
--- a/src/mess/drivers/vtech2.c
+++ b/src/mess/drivers/vtech2.c
@@ -379,23 +379,21 @@ static const rgb_t vt_colors[] =
/* Initialise the palette */
-void vtech2_state::palette_init()
+PALETTE_INIT_MEMBER(vtech2_state, vtech2)
{
int i;
- machine().colortable = colortable_alloc(machine(), 16);
-
for ( i = 0; i < 16; i++ )
- colortable_palette_set_color(machine().colortable, i, vt_colors[i]);
+ palette.set_indirect_color(i, vt_colors[i]);
for (i = 0; i < 256; i++)
{
- colortable_entry_set_value(machine().colortable, 2*i, i&15);
- colortable_entry_set_value(machine().colortable, 2*i+1, i>>4);
+ palette.set_pen_indirect(2*i, i&15);
+ palette.set_pen_indirect(2*i+1, i>>4);
}
for (i = 0; i < 16; i++)
- colortable_entry_set_value(machine().colortable, 512+i, i);
+ palette.set_pen_indirect(512+i, i);
}
INTERRUPT_GEN_MEMBER(vtech2_state::vtech2_interrupt)
@@ -442,8 +440,9 @@ static MACHINE_CONFIG_START( laser350, vtech2_state )
MCFG_SCREEN_VISIBLE_AREA(0*8, 88*8-1, 0*8, 24*8+32-1)
MCFG_SCREEN_UPDATE_DRIVER(vtech2_state, screen_update_laser)
- MCFG_GFXDECODE_ADD("gfxdecode", vtech2 )
- MCFG_PALETTE_LENGTH(528)
+ MCFG_GFXDECODE_ADD("gfxdecode", vtech2 )
+ MCFG_PALETTE_ADD("palette", 528)
+ MCFG_PALETTE_INIT_OWNER(vtech2_state, vtech2)
/* sound hardware */
diff --git a/src/mess/drivers/wswan.c b/src/mess/drivers/wswan.c
index 78de5af8e2c..81a111adf46 100644
--- a/src/mess/drivers/wswan.c
+++ b/src/mess/drivers/wswan.c
@@ -100,13 +100,13 @@ static GFXDECODE_START( wswan )
GFXDECODE_END
/* WonderSwan can display 16 shades of grey */
-void wswan_state::palette_init()
+PALETTE_INIT_MEMBER(wswan_state, wswan)
{
int ii;
for (ii = 0; ii < 16; ii++)
{
UINT8 shade = ii * (256 / 16);
- palette_set_color_rgb(machine(), 15 - ii, shade, shade, shade);
+ palette.set_pen_color(15 - ii, shade, shade, shade);
}
}
@@ -118,7 +118,7 @@ PALETTE_INIT_MEMBER(wswan_state,wscolor)
int r = (i & 0x0f00) >> 8;
int g = (i & 0x00f0) >> 4;
int b = i & 0x000f;
- palette_set_color_rgb(machine(), i, r << 4, g << 4, b << 4);
+ palette.set_pen_color(i, r << 4, g << 4, b << 4);
}
}
@@ -142,7 +142,8 @@ static MACHINE_CONFIG_START( wswan, wswan_state )
MCFG_GFXDECODE_ADD("gfxdecode", wswan)
- MCFG_PALETTE_LENGTH(16)
+ MCFG_PALETTE_ADD("palette", 16)
+ MCFG_PALETTE_INIT_OWNER(wswan_state, wswan)
/* sound hardware */
MCFG_SPEAKER_STANDARD_STEREO("lspeaker", "rspeaker")
@@ -166,8 +167,10 @@ static MACHINE_CONFIG_DERIVED( wscolor, wswan )
MCFG_CPU_MODIFY("maincpu")
MCFG_CPU_PROGRAM_MAP(wscolor_mem)
MCFG_MACHINE_START_OVERRIDE(wswan_state, wscolor )
- MCFG_PALETTE_LENGTH(4096)
- MCFG_PALETTE_INIT_OVERRIDE(wswan_state, wscolor )
+
+ MCFG_DEVICE_REMOVE("palette")
+ MCFG_PALETTE_ADD("palette", 4096)
+ MCFG_PALETTE_INIT_OWNER(wswan_state, wscolor )
/* software lists */
diff --git a/src/mess/drivers/x07.c b/src/mess/drivers/x07.c
index 7f7bfe7dd3d..920bc222059 100644
--- a/src/mess/drivers/x07.c
+++ b/src/mess/drivers/x07.c
@@ -1070,10 +1070,10 @@ DEVICE_IMAGE_LOAD_MEMBER( x07_state, x07_card )
return IMAGE_INIT_PASS;
}
-void x07_state::palette_init()
+PALETTE_INIT_MEMBER(x07_state, x07)
{
- palette_set_color(machine(), 0, rgb_t(138, 146, 148));
- palette_set_color(machine(), 1, rgb_t(92, 83, 88));
+ palette.set_pen_color(0, rgb_t(138, 146, 148));
+ palette.set_pen_color(1, rgb_t(92, 83, 88));
}
@@ -1506,7 +1506,8 @@ static MACHINE_CONFIG_START( x07, x07_state )
MCFG_SCREEN_UPDATE_DRIVER(x07_state, screen_update)
MCFG_SCREEN_SIZE(120, 32)
MCFG_SCREEN_VISIBLE_AREA(0, 120-1, 0, 32-1)
- MCFG_PALETTE_LENGTH(2)
+ MCFG_PALETTE_ADD("palette", 2)
+ MCFG_PALETTE_INIT_OWNER(x07_state, x07)
MCFG_DEFAULT_LAYOUT(layout_lcd)
MCFG_GFXDECODE_ADD("gfxdecode", x07)
diff --git a/src/mess/drivers/x1.c b/src/mess/drivers/x1.c
index 941ba50b9b1..95e6d4858dd 100644
--- a/src/mess/drivers/x1.c
+++ b/src/mess/drivers/x1.c
@@ -236,23 +236,23 @@ void x1_state::x1_draw_pixel(running_machine &machine, bitmap_rgb32 &bitmap,int
if(width && height)
{
- bitmap.pix32(y+0+m_ystart, x+0+m_xstart) = machine.pens[pen];
- bitmap.pix32(y+0+m_ystart, x+1+m_xstart) = machine.pens[pen];
- bitmap.pix32(y+1+m_ystart, x+0+m_xstart) = machine.pens[pen];
- bitmap.pix32(y+1+m_ystart, x+1+m_xstart) = machine.pens[pen];
+ bitmap.pix32(y+0+m_ystart, x+0+m_xstart) = m_palette->pen(pen);
+ bitmap.pix32(y+0+m_ystart, x+1+m_xstart) = m_palette->pen(pen);
+ bitmap.pix32(y+1+m_ystart, x+0+m_xstart) = m_palette->pen(pen);
+ bitmap.pix32(y+1+m_ystart, x+1+m_xstart) = m_palette->pen(pen);
}
else if(width)
{
- bitmap.pix32(y+m_ystart, x+0+m_xstart) = machine.pens[pen];
- bitmap.pix32(y+m_ystart, x+1+m_xstart) = machine.pens[pen];
+ bitmap.pix32(y+m_ystart, x+0+m_xstart) = m_palette->pen(pen);
+ bitmap.pix32(y+m_ystart, x+1+m_xstart) = m_palette->pen(pen);
}
else if(height)
{
- bitmap.pix32(y+0+m_ystart, x+m_xstart) = machine.pens[pen];
- bitmap.pix32(y+1+m_ystart, x+m_xstart) = machine.pens[pen];
+ bitmap.pix32(y+0+m_ystart, x+m_xstart) = m_palette->pen(pen);
+ bitmap.pix32(y+1+m_ystart, x+m_xstart) = m_palette->pen(pen);
}
else
- bitmap.pix32(y+m_ystart, x+m_xstart) = machine.pens[pen];
+ bitmap.pix32(y+m_ystart, x+m_xstart) = m_palette->pen(pen);
}
#define mc6845_h_char_total (m_crtc_vreg[0])
@@ -1204,7 +1204,7 @@ void x1_state::set_current_palette()
g = ((m_x_g)>>(addr)) & 1;
b = ((m_x_b)>>(addr)) & 1;
- palette_set_color_rgb(machine(), addr|8, pal1bit(r), pal1bit(g), pal1bit(b));
+ m_palette->set_pen_color(addr|8, pal1bit(r), pal1bit(g), pal1bit(b));
}
}
@@ -1221,7 +1221,7 @@ WRITE8_MEMBER( x1_state::x1turboz_4096_palette_w )
g = m_pal_4096[pal_entry+(2<<12)];
b = m_pal_4096[pal_entry+(0<<12)];
- palette_set_color_rgb(machine(), pal_entry+16, pal3bit(r), pal3bit(g), pal3bit(b));
+ m_palette->set_pen_color(pal_entry+16, pal3bit(r), pal3bit(g), pal3bit(b));
}
/* Note: docs claims that reading the palette ports makes the value to change somehow in X1 mode ...
@@ -1402,7 +1402,7 @@ WRITE8_MEMBER( x1_state::x1turbo_txpal_w )
g = (data & 0x30) >> 4;
b = (data & 0x03) >> 0;
- palette_set_color_rgb(machine(), offset, pal2bit(r), pal2bit(g), pal2bit(b));
+ m_palette->set_pen_color(offset, pal2bit(r), pal2bit(g), pal2bit(b));
}
}
@@ -2471,7 +2471,7 @@ MACHINE_RESET_MEMBER(x1_state,x1)
/* Reinitialize palette here if there's a soft reset for the Turbo PAL stuff*/
for(i=0;i<0x10;i++)
- palette_set_color_rgb(machine(), i, pal1bit(i >> 1), pal1bit(i >> 2), pal1bit(i >> 0));
+ m_palette->set_pen_color(i, pal1bit(i >> 1), pal1bit(i >> 2), pal1bit(i >> 0));
m_ram_bank = 0;
// m_old_vpos = -1;
@@ -2534,7 +2534,7 @@ PALETTE_INIT_MEMBER(x1_state,x1)
int i;
for(i=0;i<(0x10+0x1000);i++)
- palette_set_color(machine(), i,rgb_t(0x00,0x00,0x00));
+ palette.set_pen_color(i,rgb_t(0x00,0x00,0x00));
}
static LEGACY_FLOPPY_OPTIONS_START( x1 )
@@ -2584,8 +2584,8 @@ static MACHINE_CONFIG_START( x1, x1_state )
MCFG_SCREEN_UPDATE_DRIVER(x1_state, screen_update_x1)
MCFG_MC6845_ADD("crtc", H46505, "screen", (VDP_CLOCK/48), mc6845_intf) //unknown divider
- MCFG_PALETTE_LENGTH(0x10+0x1000)
- MCFG_PALETTE_INIT_OVERRIDE(x1_state,x1)
+ MCFG_PALETTE_ADD("palette", 0x10+0x1000)
+ MCFG_PALETTE_INIT_OWNER(x1_state,x1)
MCFG_GFXDECODE_ADD("gfxdecode", x1)
diff --git a/src/mess/drivers/x1twin.c b/src/mess/drivers/x1twin.c
index ea3a29c7f1c..32bca554e84 100644
--- a/src/mess/drivers/x1twin.c
+++ b/src/mess/drivers/x1twin.c
@@ -561,8 +561,8 @@ static MACHINE_CONFIG_START( x1twin, x1twin_state )
MCFG_SCREEN_UPDATE_DRIVER(x1twin_state, screen_update_x1pce)
MCFG_MC6845_ADD("crtc", H46505, "x1_screen", (VDP_CLOCK/48), mc6845_intf) //unknown divider
- MCFG_PALETTE_LENGTH(0x10+0x1000)
- MCFG_PALETTE_INIT_OVERRIDE(x1twin_state,x1)
+ MCFG_PALETTE_ADD("palette", 0x10+0x1000)
+ MCFG_PALETTE_INIT_OWNER(x1twin_state,x1)
MCFG_GFXDECODE_ADD("gfxdecode", x1)
diff --git a/src/mess/drivers/x68k.c b/src/mess/drivers/x68k.c
index b87237a5ce4..60fe96a8716 100644
--- a/src/mess/drivers/x68k.c
+++ b/src/mess/drivers/x68k.c
@@ -970,7 +970,7 @@ WRITE16_MEMBER(x68k_state::x68k_vid_w)
{
COMBINE_DATA(m_video.gfx_pal+offset);
val = m_video.gfx_pal[offset];
- palette_set_color_rgb(machine(),offset,(val & 0x07c0) >> 3,(val & 0xf800) >> 8,(val & 0x003e) << 2);
+ m_palette->set_pen_color(offset,(val & 0x07c0) >> 3,(val & 0xf800) >> 8,(val & 0x003e) << 2);
return;
}
@@ -978,7 +978,7 @@ WRITE16_MEMBER(x68k_state::x68k_vid_w)
{
COMBINE_DATA(m_video.text_pal+(offset-0x100));
val = m_video.text_pal[offset-0x100];
- palette_set_color_rgb(machine(),offset,(val & 0x07c0) >> 3,(val & 0xf800) >> 8,(val & 0x003e) << 2);
+ m_palette->set_pen_color(offset,(val & 0x07c0) >> 3,(val & 0xf800) >> 8,(val & 0x003e) << 2);
return;
}
@@ -1951,8 +1951,8 @@ static MACHINE_CONFIG_FRAGMENT( x68000_base )
MCFG_SCREEN_UPDATE_DRIVER(x68k_state, screen_update_x68000)
MCFG_GFXDECODE_ADD("gfxdecode", empty)
- MCFG_PALETTE_LENGTH(65536)
- MCFG_PALETTE_INIT_OVERRIDE(x68k_state, x68000 )
+ MCFG_PALETTE_ADD("palette", 65536)
+ MCFG_PALETTE_INIT_OWNER(x68k_state, x68000 )
MCFG_VIDEO_START_OVERRIDE(x68k_state, x68000 )
diff --git a/src/mess/drivers/xavix.c b/src/mess/drivers/xavix.c
index d0d1c088766..8810443894d 100644
--- a/src/mess/drivers/xavix.c
+++ b/src/mess/drivers/xavix.c
@@ -40,7 +40,6 @@ protected:
virtual void machine_reset();
virtual void video_start();
- virtual void palette_init();
};
void xavix_state::video_start()
@@ -140,10 +139,6 @@ void xavix_state::machine_reset()
}
-void xavix_state::palette_init()
-{
-}
-
static MACHINE_CONFIG_START( xavix, xavix_state )
/* basic machine hardware */
@@ -160,7 +155,7 @@ static MACHINE_CONFIG_START( xavix, xavix_state )
MCFG_GFXDECODE_ADD("gfxdecode", xavix)
- MCFG_PALETTE_LENGTH(16)
+ MCFG_PALETTE_ADD("palette", 16)
/* sound hardware */
MCFG_SPEAKER_STANDARD_MONO("mono")
diff --git a/src/mess/drivers/xerox820.c b/src/mess/drivers/xerox820.c
index e80885d550b..05bd3590f44 100644
--- a/src/mess/drivers/xerox820.c
+++ b/src/mess/drivers/xerox820.c
@@ -695,6 +695,7 @@ static MACHINE_CONFIG_START( xerox820, xerox820_state )
MCFG_SCREEN_ADD(SCREEN_TAG, RASTER)
MCFG_SCREEN_UPDATE_DRIVER(xerox820_state, screen_update)
MCFG_SCREEN_RAW_PARAMS(XTAL_10_69425MHz, 700, 0, 560, 260, 0, 240)
+
MCFG_GFXDECODE_ADD("gfxdecode", xerox820)
/* devices */
@@ -746,6 +747,7 @@ static MACHINE_CONFIG_START( xerox820ii, xerox820ii_state )
MCFG_SCREEN_ADD(SCREEN_TAG, RASTER)
MCFG_SCREEN_UPDATE_DRIVER(xerox820ii_state, screen_update)
MCFG_SCREEN_RAW_PARAMS(XTAL_10_69425MHz, 700, 0, 560, 260, 0, 240)
+
MCFG_GFXDECODE_ADD("gfxdecode", xerox820ii)
/* sound hardware */
diff --git a/src/mess/drivers/ymmu100.c b/src/mess/drivers/ymmu100.c
index 4557acff18a..00b2d4712ce 100644
--- a/src/mess/drivers/ymmu100.c
+++ b/src/mess/drivers/ymmu100.c
@@ -100,8 +100,6 @@ public:
DECLARE_READ8_MEMBER(p1_r);
DECLARE_WRITE8_MEMBER(p2_w);
DECLARE_READ8_MEMBER(p2_r);
-
- virtual void palette_init();
};
@@ -155,12 +153,6 @@ READ8_MEMBER(mu100_state::p2_r)
return cur_p2;
}
-void mu100_state::palette_init()
-{
- palette_set_color(machine(), 0, rgb_t(255, 255, 255));
- palette_set_color(machine(), 1, rgb_t(0, 0, 0));
-}
-
static ADDRESS_MAP_START( mu100_iomap, AS_IO, 8, mu100_state )
AM_RANGE(H8_PORT_1, H8_PORT_1) AM_READWRITE(p1_r, p1_w)
AM_RANGE(H8_PORT_2, H8_PORT_2) AM_READWRITE(p2_r, p2_w)
@@ -181,7 +173,7 @@ static MACHINE_CONFIG_START( mu100, mu100_state )
MCFG_SCREEN_UPDATE_DEVICE("lcd", hd44780_device, screen_update)
MCFG_SCREEN_SIZE(20*6, 4*9)
MCFG_SCREEN_VISIBLE_AREA(0, 20*6-1, 0, 4*9-1)
- MCFG_PALETTE_LENGTH(2)
+ MCFG_PALETTE_ADD_WHITE_AND_BLACK("palette")
MCFG_DEFAULT_LAYOUT(layout_lcd)
MCFG_SPEAKER_STANDARD_STEREO("lspeaker", "rspeaker")
diff --git a/src/mess/drivers/z100.c b/src/mess/drivers/z100.c
index d9fe5fa7a7c..52bee796881 100644
--- a/src/mess/drivers/z100.c
+++ b/src/mess/drivers/z100.c
@@ -203,7 +203,6 @@ public:
virtual void machine_start();
virtual void machine_reset();
virtual void video_start();
- virtual void palette_init();
UINT32 screen_update_z100(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
DECLARE_INPUT_CHANGED_MEMBER(key_stroke);
IRQ_CALLBACK_MEMBER(z100_irq_callback);
@@ -263,7 +262,7 @@ UINT32 z100_state::screen_update_z100(screen_device &screen, bitmap_ind16 &bitma
dot = m_display_mask;
if(y*mc6845_tile_height+yi < 216 && x*8+xi < 640) /* TODO: safety check */
- bitmap.pix16(y*mc6845_tile_height+yi, x*8+xi) = machine().pens[dot];
+ bitmap.pix16(y*mc6845_tile_height+yi, x*8+xi) = m_palette->pen(dot);
}
}
}
@@ -698,11 +697,6 @@ static const floppy_interface z100_floppy_interface =
NULL
};
-void z100_state::palette_init()
-{
- // ...
-}
-
void z100_state::machine_start()
{
m_maincpu->set_irq_acknowledge_callback(device_irq_acknowledge_delegate(FUNC(z100_state::z100_irq_callback),this));
@@ -716,12 +710,12 @@ void z100_state::machine_reset()
if(ioport("CONFIG")->read() & 1)
{
for(i=0;i<8;i++)
- palette_set_color_rgb(machine(), i,pal1bit(i >> 1),pal1bit(i >> 2),pal1bit(i >> 0));
+ m_palette->set_pen_color(i,pal1bit(i >> 1),pal1bit(i >> 2),pal1bit(i >> 0));
}
else
{
for(i=0;i<8;i++)
- palette_set_color_rgb(machine(), i,pal3bit(0),pal3bit(i),pal3bit(0));
+ m_palette->set_pen_color(i,pal3bit(0),pal3bit(i),pal3bit(0));
}
}
@@ -739,7 +733,7 @@ static MACHINE_CONFIG_START( z100, z100_state )
MCFG_SCREEN_SIZE(640, 480)
MCFG_SCREEN_VISIBLE_AREA(0, 640-1, 0, 480-1)
MCFG_SCREEN_UPDATE_DRIVER(z100_state, screen_update_z100)
- MCFG_PALETTE_LENGTH(8)
+ MCFG_PALETTE_ADD("palette", 8)
/* Devices */
MCFG_MC6845_ADD("crtc", MC6845, "screen", XTAL_14_31818MHz/8, mc6845_intf) /* unknown clock, hand tuned to get ~50/~60 fps */
diff --git a/src/mess/drivers/z1013.c b/src/mess/drivers/z1013.c
index fa344e3eb5f..37b3340b691 100644
--- a/src/mess/drivers/z1013.c
+++ b/src/mess/drivers/z1013.c
@@ -409,8 +409,7 @@ static MACHINE_CONFIG_START( z1013, z1013_state )
MCFG_SCREEN_VISIBLE_AREA(0, 32*8-1, 0, 32*8-1)
MCFG_SCREEN_UPDATE_DRIVER(z1013_state, screen_update_z1013)
MCFG_GFXDECODE_ADD("gfxdecode", z1013)
- MCFG_PALETTE_LENGTH(2)
- MCFG_PALETTE_INIT_OVERRIDE(driver_device, black_and_white)
+ MCFG_PALETTE_ADD_BLACK_AND_WHITE("palette")
/* sound hardware */
MCFG_SPEAKER_STANDARD_MONO("mono")
diff --git a/src/mess/drivers/z88.c b/src/mess/drivers/z88.c
index d66dee4b8a5..f823d572e06 100644
--- a/src/mess/drivers/z88.c
+++ b/src/mess/drivers/z88.c
@@ -657,7 +657,8 @@ static MACHINE_CONFIG_START( z88, z88_state )
MCFG_SCREEN_VISIBLE_AREA(0, (Z88_SCREEN_WIDTH - 1), 0, (Z88_SCREEN_HEIGHT - 1))
MCFG_SCREEN_UPDATE_DEVICE("blink", upd65031_device, screen_update)
- MCFG_PALETTE_LENGTH(Z88_NUM_COLOURS)
+ MCFG_PALETTE_ADD("palette", Z88_NUM_COLOURS)
+ MCFG_PALETTE_INIT_OWNER(z88_state, z88)
MCFG_DEFAULT_LAYOUT(layout_lcd)
diff --git a/src/mess/drivers/z9001.c b/src/mess/drivers/z9001.c
index 3b13778f2c1..a7987691668 100644
--- a/src/mess/drivers/z9001.c
+++ b/src/mess/drivers/z9001.c
@@ -251,7 +251,7 @@ static MACHINE_CONFIG_START( z9001, z9001_state )
MCFG_SCREEN_VISIBLE_AREA(0, 40*8-1, 0, 24*8-1)
MCFG_SCREEN_UPDATE_DRIVER(z9001_state, screen_update_z9001)
MCFG_GFXDECODE_ADD("gfxdecode", z9001)
- MCFG_PALETTE_LENGTH(16)
+ MCFG_PALETTE_ADD("palette", 16)
/* Sound */
MCFG_SPEAKER_STANDARD_MONO("mono")
diff --git a/src/mess/drivers/zaurus.c b/src/mess/drivers/zaurus.c
index eb5db827b39..20b8b7a68df 100644
--- a/src/mess/drivers/zaurus.c
+++ b/src/mess/drivers/zaurus.c
@@ -1446,7 +1446,6 @@ protected:
virtual void machine_reset();
virtual void video_start();
- virtual void palette_init();
};
#define VERBOSE_LEVEL ( 5 )
@@ -1729,10 +1728,6 @@ void zaurus_state::machine_reset()
}
-void zaurus_state::palette_init()
-{
-}
-
/* TODO: Hack */
TIMER_DEVICE_CALLBACK_MEMBER(zaurus_state::rtc_irq_callback)
{
@@ -1764,7 +1759,7 @@ static MACHINE_CONFIG_START( zaurus, zaurus_state )
MCFG_SCREEN_SIZE(32*8, 32*8)
MCFG_SCREEN_VISIBLE_AREA(0*8, 32*8-1, 0*8, 32*8-1)
- MCFG_PALETTE_LENGTH(8)
+ MCFG_PALETTE_ADD("palette", 8)
/* sound hardware */
MCFG_SPEAKER_STANDARD_MONO("mono")
diff --git a/src/mess/drivers/zorba.c b/src/mess/drivers/zorba.c
index 7112f32cb7e..702f348c5ed 100644
--- a/src/mess/drivers/zorba.c
+++ b/src/mess/drivers/zorba.c
@@ -64,7 +64,7 @@ public:
public:
const UINT8 *m_p_chargen;
UINT32 screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
- void palette_init_zorba();
+ DECLARE_PALETTE_INIT(zorba);
required_shared_ptr<const UINT8> m_p_videoram;
DECLARE_DRIVER_INIT(zorba);
DECLARE_MACHINE_RESET(zorba);
@@ -250,9 +250,9 @@ WRITE8_MEMBER( zorba_state::pia0_porta_w )
PALETTE_INIT_MEMBER( zorba_state, zorba )
{
- palette_set_color_rgb( machine(), 0, 0, 0, 0 ); /* Black */
- palette_set_color_rgb( machine(), 1, 0, 255, 0 ); /* Full */
- palette_set_color_rgb( machine(), 2, 0, 128, 0 ); /* Dimmed */
+ palette.set_pen_color(0, 0, 0, 0 ); /* Black */
+ palette.set_pen_color(1, 0, 255, 0 ); /* Full */
+ palette.set_pen_color(2, 0, 128, 0 ); /* Dimmed */
}
static I8275_DISPLAY_PIXELS( zorba_update_chr )
@@ -356,8 +356,8 @@ static MACHINE_CONFIG_START( zorba, zorba_state )
MCFG_SCREEN_UPDATE_DRIVER(zorba_state, screen_update)
MCFG_SCREEN_SIZE(640, 276)
MCFG_SCREEN_VISIBLE_AREA(0, 639, 0, 275)
- MCFG_PALETTE_LENGTH(3)
- MCFG_PALETTE_INIT_OVERRIDE(zorba_state, zorba)
+ MCFG_PALETTE_ADD("palette", 3)
+ MCFG_PALETTE_INIT_OWNER(zorba_state, zorba)
/* sound hardware */
MCFG_SPEAKER_STANDARD_MONO("mono")
diff --git a/src/mess/drivers/zrt80.c b/src/mess/drivers/zrt80.c
index 72092fbfb6d..18337b17417 100644
--- a/src/mess/drivers/zrt80.c
+++ b/src/mess/drivers/zrt80.c
@@ -317,8 +317,7 @@ static MACHINE_CONFIG_START( zrt80, zrt80_state )
MCFG_SCREEN_SIZE(640, 200)
MCFG_SCREEN_VISIBLE_AREA(0, 640 - 1, 0, 200 - 1)
MCFG_GFXDECODE_ADD("gfxdecode", zrt80)
- MCFG_PALETTE_LENGTH(2)
- MCFG_PALETTE_INIT_OVERRIDE(driver_device, monochrome_green)
+ MCFG_PALETTE_ADD_MONOCHROME_GREEN("palette")
/* sound hardware */
MCFG_SPEAKER_STANDARD_MONO("mono")
diff --git a/src/mess/drivers/zx.c b/src/mess/drivers/zx.c
index bfd15612ee5..d03066a1fff 100644
--- a/src/mess/drivers/zx.c
+++ b/src/mess/drivers/zx.c
@@ -326,20 +326,20 @@ GFXDECODE_END
/* Palette Initialization */
-void zx_state::palette_init()
+PALETTE_INIT_MEMBER(zx_state, zx)
{
- palette_set_color(machine(),0,rgb_t::white); /* white */
- palette_set_color(machine(),1,rgb_t::black); /* black */
- palette_set_color(machine(),2,rgb_t::black); /* black */
- palette_set_color(machine(),3,rgb_t::white); /* white */
+ palette.set_pen_color(0,rgb_t::white); /* white */
+ palette.set_pen_color(1,rgb_t::black); /* black */
+ palette.set_pen_color(2,rgb_t::black); /* black */
+ palette.set_pen_color(3,rgb_t::white); /* white */
}
PALETTE_INIT_MEMBER(zx_state,ts1000)
{
- palette_set_color(machine(),0,rgb_t(64, 244, 244)); /* cyan */
- palette_set_color(machine(),1,rgb_t::black); /* black */
- palette_set_color(machine(),2,rgb_t::black); /* black */
- palette_set_color(machine(),3,rgb_t(64, 244, 244)); /* cyan */
+ palette.set_pen_color(0,rgb_t(64, 244, 244)); /* cyan */
+ palette.set_pen_color(1,rgb_t::black); /* black */
+ palette.set_pen_color(2,rgb_t::black); /* black */
+ palette.set_pen_color(3,rgb_t(64, 244, 244)); /* cyan */
}
@@ -398,8 +398,8 @@ static MACHINE_CONFIG_START( zx80, zx_state )
MCFG_SCREEN_VBLANK_DRIVER(zx_state, screen_eof_zx)
MCFG_GFXDECODE_ADD("gfxdecode", zx80)
- MCFG_PALETTE_LENGTH(4)
-
+ MCFG_PALETTE_ADD("palette", 4)
+ MCFG_PALETTE_INIT_OWNER(zx_state,zx)
/* sound hardware */
MCFG_SPEAKER_STANDARD_MONO("mono")
@@ -427,8 +427,8 @@ static MACHINE_CONFIG_DERIVED( zx81, zx80 )
MACHINE_CONFIG_END
static MACHINE_CONFIG_DERIVED( ts1000, zx81 )
-
- MCFG_PALETTE_INIT_OVERRIDE(zx_state,ts1000)
+ MCFG_PALETTE_MODIFY("palette")
+ MCFG_PALETTE_INIT_OWNER(zx_state,ts1000)
MACHINE_CONFIG_END
static MACHINE_CONFIG_DERIVED( ts1500, ts1000 )
diff --git a/src/mess/includes/a7800.h b/src/mess/includes/a7800.h
index 7e37f3b068d..10c6e648c98 100644
--- a/src/mess/includes/a7800.h
+++ b/src/mess/includes/a7800.h
@@ -84,7 +84,7 @@ public:
DECLARE_DRIVER_INIT(a7800_ntsc);
virtual void machine_reset();
virtual void video_start();
- virtual void palette_init();
+ DECLARE_PALETTE_INIT(a7800);
DECLARE_PALETTE_INIT(a7800p);
UINT32 screen_update_a7800(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
TIMER_DEVICE_CALLBACK_MEMBER(a7800_interrupt);
diff --git a/src/mess/includes/advision.h b/src/mess/includes/advision.h
index ec3c4c5c638..e8a8833aadf 100644
--- a/src/mess/includes/advision.h
+++ b/src/mess/includes/advision.h
@@ -64,7 +64,7 @@ public:
int m_sound_cmd;
int m_sound_d;
int m_sound_g;
- virtual void palette_init();
+ DECLARE_PALETTE_INIT(advision);
};
#endif
diff --git a/src/mess/includes/alesis.h b/src/mess/includes/alesis.h
index e288714d191..364fa076e14 100644
--- a/src/mess/includes/alesis.h
+++ b/src/mess/includes/alesis.h
@@ -70,7 +70,7 @@ public:
required_device<hd44780_device> m_lcdc;
optional_device<cassette_image_device> m_cassette;
- virtual void palette_init();
+ DECLARE_PALETTE_INIT(alesis);
virtual void machine_reset();
void update_lcd_symbols(bitmap_ind16 &bitmap, UINT8 pos, UINT8 y, UINT8 x, int state);
diff --git a/src/mess/includes/aquarius.h b/src/mess/includes/aquarius.h
index f8cddaf58ff..d179aa1c3df 100644
--- a/src/mess/includes/aquarius.h
+++ b/src/mess/includes/aquarius.h
@@ -72,7 +72,7 @@ public:
DECLARE_DRIVER_INIT(aquarius);
TILE_GET_INFO_MEMBER(aquarius_gettileinfo);
virtual void video_start();
- virtual void palette_init();
+ DECLARE_PALETTE_INIT(aquarius);
UINT32 screen_update_aquarius(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
DECLARE_INPUT_CHANGED_MEMBER(aquarius_reset);
};
diff --git a/src/mess/includes/arcadia.h b/src/mess/includes/arcadia.h
index 019f98b7b63..d1497b0d763 100644
--- a/src/mess/includes/arcadia.h
+++ b/src/mess/includes/arcadia.h
@@ -91,7 +91,7 @@ public:
bitmap_ind16 *m_bitmap;
DECLARE_DRIVER_INIT(arcadia);
virtual void video_start();
- virtual void palette_init();
+ DECLARE_PALETTE_INIT(arcadia);
UINT32 screen_update_arcadia(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
INTERRUPT_GEN_MEMBER(arcadia_video_line);
DECLARE_DEVICE_IMAGE_LOAD_MEMBER( arcadia_cart );
diff --git a/src/mess/includes/avigo.h b/src/mess/includes/avigo.h
index eb172f09d6c..de7e5a78205 100644
--- a/src/mess/includes/avigo.h
+++ b/src/mess/includes/avigo.h
@@ -105,7 +105,7 @@ public:
UINT8 m_screen_column;
UINT8 m_warm_start;
UINT8 * m_ram_base;
- virtual void palette_init();
+ DECLARE_PALETTE_INIT(avigo);
TIMER_DEVICE_CALLBACK_MEMBER(avigo_scan_timer);
TIMER_DEVICE_CALLBACK_MEMBER(avigo_1hz_timer);
diff --git a/src/mess/includes/b2m.h b/src/mess/includes/b2m.h
index 47cc7bf12ee..3e94c6341b1 100644
--- a/src/mess/includes/b2m.h
+++ b/src/mess/includes/b2m.h
@@ -56,7 +56,7 @@ public:
virtual void machine_start();
virtual void machine_reset();
virtual void video_start();
- virtual void palette_init();
+ DECLARE_PALETTE_INIT(b2m);
UINT32 screen_update_b2m(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
INTERRUPT_GEN_MEMBER(b2m_vblank_interrupt);
DECLARE_WRITE_LINE_MEMBER(bm2_pit_out1);
diff --git a/src/mess/includes/busicom.h b/src/mess/includes/busicom.h
index c491cd553a7..b7eb0a8c945 100644
--- a/src/mess/includes/busicom.h
+++ b/src/mess/includes/busicom.h
@@ -31,7 +31,7 @@ public:
virtual void machine_start();
virtual void machine_reset();
virtual void video_start();
- virtual void palette_init();
+ DECLARE_PALETTE_INIT(busicom);
UINT32 screen_update_busicom(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
TIMER_DEVICE_CALLBACK_MEMBER(timer_callback);
required_device<i4004_cpu_device> m_maincpu;
diff --git a/src/mess/includes/bw2.h b/src/mess/includes/bw2.h
index babc69846fb..1b11350b9be 100644
--- a/src/mess/includes/bw2.h
+++ b/src/mess/includes/bw2.h
@@ -110,7 +110,7 @@ public:
// video state
optional_shared_ptr<UINT8> m_video_ram;
- virtual void palette_init();
+ DECLARE_PALETTE_INIT(bw2);
DECLARE_WRITE_LINE_MEMBER(write_centronics_busy);
int m_centronics_busy;
diff --git a/src/mess/includes/c65.h b/src/mess/includes/c65.h
index 70943609181..60479bc5139 100644
--- a/src/mess/includes/c65.h
+++ b/src/mess/includes/c65.h
@@ -132,7 +132,6 @@ public:
DECLARE_READ8_MEMBER( sid_potx_r );
DECLARE_READ8_MEMBER( sid_poty_r );
DECLARE_MACHINE_START(c65);
- DECLARE_PALETTE_INIT(c65);
UINT32 screen_update_c65(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
INTERRUPT_GEN_MEMBER(vic3_raster_irq);
INTERRUPT_GEN_MEMBER(c65_frame_interrupt);
diff --git a/src/mess/includes/channelf.h b/src/mess/includes/channelf.h
index 43e7d10ed4a..f2f970bf08e 100644
--- a/src/mess/includes/channelf.h
+++ b/src/mess/includes/channelf.h
@@ -52,7 +52,7 @@ public:
UINT8 m_col_reg;
UINT8 port_read_with_latch(UINT8 ext, UINT8 latch_state);
virtual void video_start();
- virtual void palette_init();
+ DECLARE_PALETTE_INIT(channelf);
UINT32 screen_update_channelf(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
DECLARE_DEVICE_IMAGE_LOAD_MEMBER( channelf_cart );
required_device<channelf_sound_device> m_custom;
diff --git a/src/mess/includes/cybiko.h b/src/mess/includes/cybiko.h
index c5a7e6dede1..d7bd2e7b6c2 100644
--- a/src/mess/includes/cybiko.h
+++ b/src/mess/includes/cybiko.h
@@ -88,7 +88,6 @@ public:
DECLARE_DRIVER_INIT(cybiko);
virtual void machine_start();
virtual void machine_reset();
- virtual void palette_init();
void machine_stop_cybiko();
DECLARE_QUICKLOAD_LOAD_MEMBER( cybiko );
DECLARE_QUICKLOAD_LOAD_MEMBER( cybikoxt );
diff --git a/src/mess/includes/dai.h b/src/mess/includes/dai.h
index d3efa2a5e1a..26db8bb5dc8 100644
--- a/src/mess/includes/dai.h
+++ b/src/mess/includes/dai.h
@@ -90,7 +90,7 @@ public:
virtual void machine_start();
virtual void machine_reset();
virtual void video_start();
- virtual void palette_init();
+ DECLARE_PALETTE_INIT(dai);
UINT32 screen_update_dai(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
void dai_update_memory(int dai_rom_bank);
IRQ_CALLBACK_MEMBER(int_ack);
diff --git a/src/mess/includes/dgn_beta.h b/src/mess/includes/dgn_beta.h
index 467e765df5b..f9a964c90c3 100644
--- a/src/mess/includes/dgn_beta.h
+++ b/src/mess/includes/dgn_beta.h
@@ -147,7 +147,7 @@ public:
int m_DrawInterlace;
virtual void machine_start();
virtual void machine_reset();
- virtual void palette_init();
+ DECLARE_PALETTE_INIT(dgn);
DECLARE_WRITE8_MEMBER(dgnbeta_ram_b0_w);
DECLARE_WRITE8_MEMBER(dgnbeta_ram_b1_w);
DECLARE_WRITE8_MEMBER(dgnbeta_ram_b2_w);
diff --git a/src/mess/includes/electron.h b/src/mess/includes/electron.h
index 17c878feb39..a4611d18b61 100644
--- a/src/mess/includes/electron.h
+++ b/src/mess/includes/electron.h
@@ -86,7 +86,7 @@ public:
virtual void machine_start();
virtual void machine_reset();
virtual void video_start();
- virtual void palette_init();
+ DECLARE_PALETTE_INIT(electron);
UINT32 screen_update_electron(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
TIMER_CALLBACK_MEMBER(electron_tape_timer_handler);
TIMER_CALLBACK_MEMBER(setup_beep);
diff --git a/src/mess/includes/fm7.h b/src/mess/includes/fm7.h
index fdb2cab5bab..72a7ebc98c6 100644
--- a/src/mess/includes/fm7.h
+++ b/src/mess/includes/fm7.h
@@ -268,7 +268,7 @@ public:
DECLARE_DRIVER_INIT(fm7);
virtual void machine_reset();
virtual void video_start();
- virtual void palette_init();
+ DECLARE_PALETTE_INIT(fm7);
DECLARE_MACHINE_START(fm7);
DECLARE_MACHINE_START(fm77av);
DECLARE_MACHINE_START(fm11);
diff --git a/src/mess/includes/gamecom.h b/src/mess/includes/gamecom.h
index 4f5f76aa92d..eea2f005902 100644
--- a/src/mess/includes/gamecom.h
+++ b/src/mess/includes/gamecom.h
@@ -262,7 +262,7 @@ public:
DECLARE_DRIVER_INIT(gamecom);
virtual void machine_reset();
virtual void video_start();
- virtual void palette_init();
+ DECLARE_PALETTE_INIT(gamecom);
INTERRUPT_GEN_MEMBER(gamecom_interrupt);
TIMER_CALLBACK_MEMBER(gamecom_clock_timer_callback);
TIMER_CALLBACK_MEMBER(gamecom_scanline);
diff --git a/src/mess/includes/gba.h b/src/mess/includes/gba.h
index 05a14c78f6a..b4967c4ddee 100644
--- a/src/mess/includes/gba.h
+++ b/src/mess/includes/gba.h
@@ -245,7 +245,7 @@ public:
DECLARE_DRIVER_INIT(gbadv);
virtual void machine_start();
virtual void machine_reset();
- virtual void palette_init();
+ DECLARE_PALETTE_INIT(gba);
TIMER_CALLBACK_MEMBER(dma_complete);
TIMER_CALLBACK_MEMBER(timer_expire);
TIMER_CALLBACK_MEMBER(handle_irq);
diff --git a/src/mess/includes/hp48.h b/src/mess/includes/hp48.h
index d14d476d2d7..10b9c8106f3 100644
--- a/src/mess/includes/hp48.h
+++ b/src/mess/includes/hp48.h
@@ -69,7 +69,7 @@ public:
int m_cur_screen;
DECLARE_DRIVER_INIT(hp48);
virtual void machine_reset();
- virtual void palette_init();
+ DECLARE_PALETTE_INIT(hp48);
DECLARE_MACHINE_START(hp48gx);
DECLARE_MACHINE_START(hp48g);
DECLARE_MACHINE_START(hp48gp);
diff --git a/src/mess/includes/hx20.h b/src/mess/includes/hx20.h
index 5c7c444371f..828cc1a36ef 100644
--- a/src/mess/includes/hx20.h
+++ b/src/mess/includes/hx20.h
@@ -85,7 +85,7 @@ public:
required_ioport m_sw6;
virtual void machine_start();
- virtual void palette_init();
+ DECLARE_PALETTE_INIT(hx20);
UINT32 screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
DECLARE_WRITE8_MEMBER( ksc_w );
diff --git a/src/mess/includes/intv.h b/src/mess/includes/intv.h
index d2e980e35eb..70ed7a37f4a 100644
--- a/src/mess/includes/intv.h
+++ b/src/mess/includes/intv.h
@@ -115,7 +115,7 @@ public:
virtual void machine_start();
virtual void machine_reset();
virtual void video_start();
- virtual void palette_init();
+ DECLARE_PALETTE_INIT(intv);
void ecs_banks_restore();
UINT32 screen_update_intv(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
UINT32 screen_update_intvkbd(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
diff --git a/src/mess/includes/lviv.h b/src/mess/includes/lviv.h
index ff94943813b..447c3b7e6f7 100644
--- a/src/mess/includes/lviv.h
+++ b/src/mess/includes/lviv.h
@@ -31,7 +31,7 @@ public:
DECLARE_WRITE8_MEMBER(lviv_io_w);
virtual void machine_reset();
virtual void video_start();
- virtual void palette_init();
+ DECLARE_PALETTE_INIT(lviv);
UINT32 screen_update_lviv(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
DECLARE_READ8_MEMBER(lviv_ppi_0_porta_r);
DECLARE_READ8_MEMBER(lviv_ppi_0_portb_r);
diff --git a/src/mess/includes/lynx.h b/src/mess/includes/lynx.h
index 117f2ef81b2..1dd4d377487 100644
--- a/src/mess/includes/lynx.h
+++ b/src/mess/includes/lynx.h
@@ -128,7 +128,7 @@ public:
UINT16 m_granularity;
int m_sign_AB;
int m_sign_CD;
- UINT32 m_palette[0x10];
+ UINT32 m_lynx_palette[0x10];
int m_rotate;
UINT8 m_memory_config;
@@ -154,7 +154,7 @@ public:
void lynx_timer_write(int which, int offset, UINT8 data);
virtual void machine_start();
virtual void machine_reset();
- virtual void palette_init();
+ DECLARE_PALETTE_INIT(lynx);
void sound_cb();
TIMER_CALLBACK_MEMBER(lynx_blitter_timer);
TIMER_CALLBACK_MEMBER(lynx_timer_shot);
diff --git a/src/mess/includes/mbc55x.h b/src/mess/includes/mbc55x.h
index c76fdbb72d6..89ef11569a1 100644
--- a/src/mess/includes/mbc55x.h
+++ b/src/mess/includes/mbc55x.h
@@ -156,7 +156,7 @@ public:
virtual void machine_reset();
virtual void video_start();
virtual void video_reset();
- virtual void palette_init();
+ DECLARE_PALETTE_INIT(mbc55x);
void screen_eof_mbc55x(screen_device &screen, bool state);
TIMER_CALLBACK_MEMBER(keyscan_callback);
IRQ_CALLBACK_MEMBER(mbc55x_irq_callback);
diff --git a/src/mess/includes/micronic.h b/src/mess/includes/micronic.h
index 8e9240d827d..4921712a00d 100644
--- a/src/mess/includes/micronic.h
+++ b/src/mess/includes/micronic.h
@@ -72,7 +72,7 @@ public:
UINT8 m_lcd_contrast;
bool m_lcd_backlight;
UINT8 m_status_flag;
- virtual void palette_init();
+ DECLARE_PALETTE_INIT(micronic);
protected:
required_memory_bank m_bank1;
diff --git a/src/mess/includes/mz700.h b/src/mess/includes/mz700.h
index a0aa2b335dc..b89571eb870 100644
--- a/src/mess/includes/mz700.h
+++ b/src/mess/includes/mz700.h
@@ -88,7 +88,7 @@ public:
DECLARE_DRIVER_INIT(mz800);
DECLARE_DRIVER_INIT(mz700);
virtual void machine_start();
- virtual void palette_init();
+ DECLARE_PALETTE_INIT(mz);
DECLARE_VIDEO_START(mz800);
UINT32 screen_update_mz700(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
UINT32 screen_update_mz800(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
diff --git a/src/mess/includes/nc.h b/src/mess/includes/nc.h
index fcbb68c352f..25f6f810aba 100644
--- a/src/mess/includes/nc.h
+++ b/src/mess/includes/nc.h
@@ -65,6 +65,7 @@ public:
DECLARE_WRITE8_MEMBER(nc200_memory_card_wait_state_w);
DECLARE_WRITE8_MEMBER(nc200_poweroff_control_w);
+ DECLARE_PALETTE_INIT(nc);
DECLARE_MACHINE_START(nc200);
DECLARE_MACHINE_RESET(nc200);
UINT32 screen_update_nc(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
@@ -90,7 +91,6 @@ protected:
virtual void machine_start();
virtual void machine_reset();
virtual void video_start();
- virtual void palette_init();
private:
void nc200_fdc_interrupt(bool state);
diff --git a/src/mess/includes/nes.h b/src/mess/includes/nes.h
index 1e67a0e2622..935dbe5a36e 100644
--- a/src/mess/includes/nes.h
+++ b/src/mess/includes/nes.h
@@ -172,7 +172,7 @@ public:
virtual void machine_reset();
virtual void video_start();
virtual void video_reset();
- virtual void palette_init();
+ DECLARE_PALETTE_INIT(nes);
UINT32 screen_update_nes(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
DECLARE_READ8_MEMBER(psg_4015_r);
DECLARE_WRITE8_MEMBER(psg_4015_w);
diff --git a/src/mess/includes/oric.h b/src/mess/includes/oric.h
index 653c95fd0d8..8af56202edd 100644
--- a/src/mess/includes/oric.h
+++ b/src/mess/includes/oric.h
@@ -129,7 +129,7 @@ public:
virtual void machine_start();
virtual void machine_reset();
virtual void video_start();
- virtual void palette_init();
+ DECLARE_PALETTE_INIT(oric);
DECLARE_MACHINE_START(telestrat);
UINT32 screen_update_oric(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
TIMER_CALLBACK_MEMBER(oric_refresh_tape);
diff --git a/src/mess/includes/osborne1.h b/src/mess/includes/osborne1.h
index e4cf5d4d2f4..849b60e023c 100644
--- a/src/mess/includes/osborne1.h
+++ b/src/mess/includes/osborne1.h
@@ -99,7 +99,7 @@ public:
bool m_beep_state;
DECLARE_DRIVER_INIT(osborne1);
virtual void machine_reset();
- virtual void palette_init();
+ DECLARE_PALETTE_INIT(osborne1);
TIMER_CALLBACK_MEMBER(osborne1_video_callback);
TIMER_CALLBACK_MEMBER(setup_osborne1);
diff --git a/src/mess/includes/pc4.h b/src/mess/includes/pc4.h
index 08459637ab7..003669597b8 100644
--- a/src/mess/includes/pc4.h
+++ b/src/mess/includes/pc4.h
@@ -65,7 +65,7 @@ public:
INT8 m_disp_shift;
INT8 m_direction;
UINT8 m_blink;
- virtual void palette_init();
+ DECLARE_PALETTE_INIT(pc4);
protected:
required_memory_region m_region_charset;
diff --git a/src/mess/includes/pcw.h b/src/mess/includes/pcw.h
index 0d109503ae1..76f279d4160 100644
--- a/src/mess/includes/pcw.h
+++ b/src/mess/includes/pcw.h
@@ -104,7 +104,7 @@ public:
virtual void machine_start();
virtual void machine_reset();
virtual void video_start();
- virtual void palette_init();
+ DECLARE_PALETTE_INIT(pcw);
UINT32 screen_update_pcw(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
UINT32 screen_update_pcw_printer(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
TIMER_CALLBACK_MEMBER(pcw_timer_pulse);
diff --git a/src/mess/includes/pcw16.h b/src/mess/includes/pcw16.h
index 084773bfc83..0ec076fbf48 100644
--- a/src/mess/includes/pcw16.h
+++ b/src/mess/includes/pcw16.h
@@ -128,7 +128,7 @@ public:
virtual void machine_start();
virtual void machine_reset();
virtual void video_start();
- virtual void palette_init();
+ DECLARE_PALETTE_INIT(pcw16);
UINT32 screen_update_pcw16(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
TIMER_DEVICE_CALLBACK_MEMBER(pcw16_timer_callback);
TIMER_DEVICE_CALLBACK_MEMBER(pcw16_keyboard_timer_callback);
diff --git a/src/mess/includes/pdp1.h b/src/mess/includes/pdp1.h
index a50273f15ff..f1503600646 100644
--- a/src/mess/includes/pdp1.h
+++ b/src/mess/includes/pdp1.h
@@ -262,7 +262,7 @@ public:
virtual void machine_start();
virtual void machine_reset();
virtual void video_start();
- virtual void palette_init();
+ DECLARE_PALETTE_INIT(pdp1);
UINT32 screen_update_pdp1(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
void screen_eof_pdp1(screen_device &screen, bool state);
INTERRUPT_GEN_MEMBER(pdp1_interrupt);
diff --git a/src/mess/includes/pk8020.h b/src/mess/includes/pk8020.h
index e567c0dc9f9..332d4e5e941 100644
--- a/src/mess/includes/pk8020.h
+++ b/src/mess/includes/pk8020.h
@@ -59,7 +59,7 @@ public:
virtual void machine_start();
virtual void machine_reset();
virtual void video_start();
- virtual void palette_init();
+ DECLARE_PALETTE_INIT(pk8020);
UINT32 screen_update_pk8020(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
INTERRUPT_GEN_MEMBER(pk8020_interrupt);
DECLARE_READ8_MEMBER(pk8020_porta_r);
diff --git a/src/mess/includes/pmd85.h b/src/mess/includes/pmd85.h
index 02a6102cdcb..02fb5b749af 100644
--- a/src/mess/includes/pmd85.h
+++ b/src/mess/includes/pmd85.h
@@ -74,7 +74,7 @@ public:
DECLARE_DRIVER_INIT(c2717);
virtual void machine_reset();
virtual void video_start();
- virtual void palette_init();
+ DECLARE_PALETTE_INIT(pmd85);
UINT32 screen_update_pmd85(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
TIMER_CALLBACK_MEMBER(pmd85_cassette_timer_callback);
DECLARE_WRITE_LINE_MEMBER(write_cas_tx);
diff --git a/src/mess/includes/poisk1.h b/src/mess/includes/poisk1.h
index 8497c543d4c..e4877d9b232 100644
--- a/src/mess/includes/poisk1.h
+++ b/src/mess/includes/poisk1.h
@@ -50,7 +50,7 @@ public:
IRQ_CALLBACK_MEMBER(p1_irq_callback);
- virtual void palette_init();
+ DECLARE_PALETTE_INIT(p1);
virtual void video_start();
UINT32 screen_update(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect);
void set_palette_luts();
diff --git a/src/mess/includes/portfoli.h b/src/mess/includes/portfoli.h
index fd8a297e786..1562523c69c 100644
--- a/src/mess/includes/portfoli.h
+++ b/src/mess/includes/portfoli.h
@@ -108,7 +108,7 @@ public:
/* peripheral state */
UINT8 m_pid; /* peripheral identification */
- virtual void palette_init();
+ DECLARE_PALETTE_INIT(portfolio);
TIMER_DEVICE_CALLBACK_MEMBER(keyboard_tick);
TIMER_DEVICE_CALLBACK_MEMBER(system_tick);
TIMER_DEVICE_CALLBACK_MEMBER(counter_tick);
diff --git a/src/mess/includes/pp01.h b/src/mess/includes/pp01.h
index 6c1c2311d7b..9fa9ab190fd 100644
--- a/src/mess/includes/pp01.h
+++ b/src/mess/includes/pp01.h
@@ -47,7 +47,7 @@ public:
virtual void machine_start();
virtual void machine_reset();
virtual void video_start();
- virtual void palette_init();
+ DECLARE_PALETTE_INIT(pp01);
UINT32 screen_update_pp01(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
DECLARE_WRITE_LINE_MEMBER(pp01_pit_out0);
DECLARE_WRITE_LINE_MEMBER(pp01_pit_out1);
diff --git a/src/mess/includes/psion.h b/src/mess/includes/psion.h
index 0d0d2e41906..354bca3ee07 100644
--- a/src/mess/includes/psion.h
+++ b/src/mess/includes/psion.h
@@ -68,7 +68,7 @@ public:
void io_rw(address_space &space, UINT16 offset);
DECLARE_WRITE8_MEMBER( io_w );
DECLARE_READ8_MEMBER( io_r );
- virtual void palette_init();
+ DECLARE_PALETTE_INIT(psion);
DECLARE_INPUT_CHANGED_MEMBER(psion_on);
TIMER_DEVICE_CALLBACK_MEMBER(nmi_timer);
diff --git a/src/mess/includes/px8.h b/src/mess/includes/px8.h
index 2ff3e884166..80a908c94a6 100644
--- a/src/mess/includes/px8.h
+++ b/src/mess/includes/px8.h
@@ -76,7 +76,7 @@ public:
/* keyboard state */
int m_ksc; /* keyboard scan column */
- virtual void palette_init();
+ DECLARE_PALETTE_INIT(px8);
UINT32 screen_update_px8(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
};
diff --git a/src/mess/includes/rmnimbus.h b/src/mess/includes/rmnimbus.h
index cdcd5d155f4..aea2488cba3 100644
--- a/src/mess/includes/rmnimbus.h
+++ b/src/mess/includes/rmnimbus.h
@@ -460,7 +460,7 @@ public:
virtual void machine_reset();
virtual void video_start();
virtual void video_reset();
- virtual void palette_init();
+ DECLARE_PALETTE_INIT(rmnimbus);
UINT32 screen_update_nimbus(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
void screen_eof_nimbus(screen_device &screen, bool state);
// TIMER_CALLBACK_MEMBER(internal_timer_int);
diff --git a/src/mess/includes/samcoupe.h b/src/mess/includes/samcoupe.h
index e4242597f76..a2b3446588d 100644
--- a/src/mess/includes/samcoupe.h
+++ b/src/mess/includes/samcoupe.h
@@ -109,7 +109,7 @@ public:
DECLARE_READ8_MEMBER(samcoupe_attributes_r);
virtual void machine_start();
virtual void machine_reset();
- virtual void palette_init();
+ DECLARE_PALETTE_INIT(samcoupe);
INTERRUPT_GEN_MEMBER(samcoupe_frame_interrupt);
TIMER_CALLBACK_MEMBER(irq_off);
TIMER_CALLBACK_MEMBER(samcoupe_mouse_reset);
diff --git a/src/mess/includes/ssystem3.h b/src/mess/includes/ssystem3.h
index a48c390c2b5..174e37eba48 100644
--- a/src/mess/includes/ssystem3.h
+++ b/src/mess/includes/ssystem3.h
@@ -47,7 +47,7 @@ public:
lcd_t m_lcd;
DECLARE_DRIVER_INIT(ssystem3);
virtual void video_start();
- virtual void palette_init();
+ DECLARE_PALETTE_INIT(ssystem3);
UINT32 screen_update_ssystem3(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
DECLARE_WRITE8_MEMBER(ssystem3_via_write_a);
DECLARE_READ8_MEMBER(ssystem3_via_read_a);
diff --git a/src/mess/includes/svision.h b/src/mess/includes/svision.h
index d87536ad1ac..ab936742a72 100644
--- a/src/mess/includes/svision.h
+++ b/src/mess/includes/svision.h
@@ -53,7 +53,7 @@ public:
DECLARE_DRIVER_INIT(svisions);
DECLARE_DRIVER_INIT(svision);
virtual void machine_reset();
- virtual void palette_init();
+ DECLARE_PALETTE_INIT(svision);
DECLARE_PALETTE_INIT(svisionp);
DECLARE_PALETTE_INIT(svisionn);
DECLARE_MACHINE_RESET(tvlink);
diff --git a/src/mess/includes/ti85.h b/src/mess/includes/ti85.h
index 0f89eb982ee..5a689c04e38 100644
--- a/src/mess/includes/ti85.h
+++ b/src/mess/includes/ti85.h
@@ -96,7 +96,7 @@ public:
DECLARE_READ8_MEMBER( ti83p_port_0002_r );
virtual void machine_start();
virtual void video_start();
- virtual void palette_init();
+ DECLARE_PALETTE_INIT(ti85);
DECLARE_MACHINE_RESET(ti85);
DECLARE_PALETTE_INIT(ti82);
DECLARE_MACHINE_START(ti86);
diff --git a/src/mess/includes/ti89.h b/src/mess/includes/ti89.h
index 809297a8815..2317755a901 100644
--- a/src/mess/includes/ti89.h
+++ b/src/mess/includes/ti89.h
@@ -81,7 +81,7 @@ public:
DECLARE_WRITE16_MEMBER ( flash_w );
DECLARE_READ16_MEMBER ( flash_r );
UINT64 m_timer;
- virtual void palette_init();
+ DECLARE_PALETTE_INIT(ti68k);
DECLARE_INPUT_CHANGED_MEMBER(ti68k_on_key);
TIMER_DEVICE_CALLBACK_MEMBER(ti68k_timer_callback);
};
diff --git a/src/mess/includes/tiki100.h b/src/mess/includes/tiki100.h
index c1a07983e01..12d50ee9770 100644
--- a/src/mess/includes/tiki100.h
+++ b/src/mess/includes/tiki100.h
@@ -124,7 +124,7 @@ public:
/* video state */
UINT8 m_scroll;
UINT8 m_mode;
- UINT8 m_palette;
+ UINT8 m_palette_val;
/* keyboard state */
int m_keylatch;
diff --git a/src/mess/includes/tvc.h b/src/mess/includes/tvc.h
index abeada85424..930588d70ca 100644
--- a/src/mess/includes/tvc.h
+++ b/src/mess/includes/tvc.h
@@ -132,7 +132,7 @@ public:
UINT8 m_vram_bank;
UINT8 m_cassette_ff;
UINT8 m_centronics_ff;
- virtual void palette_init();
+ DECLARE_PALETTE_INIT(tvc);
};
diff --git a/src/mess/includes/tx0.h b/src/mess/includes/tx0.h
index 278d5b0c489..dbaa23d50cb 100644
--- a/src/mess/includes/tx0.h
+++ b/src/mess/includes/tx0.h
@@ -154,7 +154,7 @@ public:
virtual void machine_start();
virtual void machine_reset();
virtual void video_start();
- virtual void palette_init();
+ DECLARE_PALETTE_INIT(tx0);
UINT32 screen_update_tx0(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
void screen_eof_tx0(screen_device &screen, bool state);
INTERRUPT_GEN_MEMBER(tx0_interrupt);
diff --git a/src/mess/includes/vc4000.h b/src/mess/includes/vc4000.h
index c13ea301e06..4ca651f5acc 100644
--- a/src/mess/includes/vc4000.h
+++ b/src/mess/includes/vc4000.h
@@ -111,7 +111,7 @@ public:
bitmap_ind16 *m_bitmap;
optional_device<cassette_image_device> m_cassette;
virtual void video_start();
- virtual void palette_init();
+ DECLARE_PALETTE_INIT(vc4000);
UINT32 screen_update_vc4000(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
INTERRUPT_GEN_MEMBER(vc4000_video_line);
DECLARE_DEVICE_IMAGE_LOAD_MEMBER(vc4000_cart);
diff --git a/src/mess/includes/vector06.h b/src/mess/includes/vector06.h
index 412a0c2699f..bfd61ca98aa 100644
--- a/src/mess/includes/vector06.h
+++ b/src/mess/includes/vector06.h
@@ -62,7 +62,7 @@ public:
virtual void machine_start();
virtual void machine_reset();
virtual void video_start();
- virtual void palette_init();
+ DECLARE_PALETTE_INIT(vector06);
UINT32 screen_update_vector06(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
INTERRUPT_GEN_MEMBER(vector06_interrupt);
TIMER_CALLBACK_MEMBER(reset_check_callback);
diff --git a/src/mess/includes/vtech2.h b/src/mess/includes/vtech2.h
index c85b89d9dce..738d52fa650 100644
--- a/src/mess/includes/vtech2.h
+++ b/src/mess/includes/vtech2.h
@@ -56,7 +56,7 @@ public:
DECLARE_DRIVER_INIT(laser);
virtual void machine_reset();
virtual void video_start();
- virtual void palette_init();
+ DECLARE_PALETTE_INIT(vtech2);
DECLARE_MACHINE_RESET(laser500);
DECLARE_MACHINE_RESET(laser700);
UINT32 screen_update_laser(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
diff --git a/src/mess/includes/wswan.h b/src/mess/includes/wswan.h
index bf28134a688..20ccca7087e 100644
--- a/src/mess/includes/wswan.h
+++ b/src/mess/includes/wswan.h
@@ -145,7 +145,7 @@ public:
void wswan_clear_irq_line(int irq);
virtual void machine_start();
virtual void machine_reset();
- virtual void palette_init();
+ DECLARE_PALETTE_INIT(wswan);
DECLARE_MACHINE_START(wscolor);
DECLARE_PALETTE_INIT(wscolor);
TIMER_CALLBACK_MEMBER(wswan_rtc_callback);
diff --git a/src/mess/includes/x07.h b/src/mess/includes/x07.h
index 17cfffb8620..587b289cddb 100644
--- a/src/mess/includes/x07.h
+++ b/src/mess/includes/x07.h
@@ -263,7 +263,7 @@ public:
UINT8 m_prn_char_code;
UINT8 m_prn_buffer[0x100];
UINT8 m_prn_size;
- virtual void palette_init();
+ DECLARE_PALETTE_INIT(x07);
TIMER_CALLBACK_MEMBER(cassette_tick);
TIMER_CALLBACK_MEMBER(cassette_poll);
TIMER_CALLBACK_MEMBER(rsta_clear);
diff --git a/src/mess/includes/z88.h b/src/mess/includes/z88.h
index f15409ab50e..833a053ce78 100644
--- a/src/mess/includes/z88.h
+++ b/src/mess/includes/z88.h
@@ -87,7 +87,7 @@ public:
UINT8 * m_bios;
UINT8 * m_ram_base;
z88cart_slot_device * m_carts[4];
- virtual void palette_init();
+ DECLARE_PALETTE_INIT(z88);
};
#endif /* Z88_H_ */
diff --git a/src/mess/includes/zx.h b/src/mess/includes/zx.h
index b1eb6d26cd6..56cc53da180 100644
--- a/src/mess/includes/zx.h
+++ b/src/mess/includes/zx.h
@@ -75,7 +75,7 @@ public:
DECLARE_DRIVER_INIT(zx);
virtual void machine_reset();
virtual void video_start();
- virtual void palette_init();
+ DECLARE_PALETTE_INIT(zx);
DECLARE_PALETTE_INIT(ts1000);
DECLARE_MACHINE_RESET(pc8300);
DECLARE_MACHINE_RESET(pow3000);
diff --git a/src/mess/machine/aim65.c b/src/mess/machine/aim65.c
index 0f9f2f93328..c10680093c0 100644
--- a/src/mess/machine/aim65.c
+++ b/src/mess/machine/aim65.c
@@ -399,7 +399,7 @@ SCREEN_UPDATE( aim65 )
for (b = 0; b<10; b++)
{
- pen = screen.machine().pens[BIT(data, 0) ? 2 : 0];
+ pen = screen.m_palette->pen(BIT(data, 0) ? 2 : 0);
plot_pixel(bitmap,700 - ((b * 10) + x), y, pen);
data >>= 1;
}
diff --git a/src/mess/machine/amstrad.c b/src/mess/machine/amstrad.c
index bc5f37c8d14..bddc8c74af6 100644
--- a/src/mess/machine/amstrad.c
+++ b/src/mess/machine/amstrad.c
@@ -200,13 +200,13 @@ static const rgb_t amstrad_green_palette[32] =
/* Initialise the palette */
PALETTE_INIT_MEMBER(amstrad_state,amstrad_cpc)
{
- palette_set_colors(machine(), 0, amstrad_palette, ARRAY_LENGTH(amstrad_palette));
+ palette.set_pen_colors(0, amstrad_palette, ARRAY_LENGTH(amstrad_palette));
}
PALETTE_INIT_MEMBER(amstrad_state,amstrad_cpc_green)
{
- palette_set_colors(machine(), 0, amstrad_green_palette, ARRAY_LENGTH(amstrad_green_palette));
+ palette.set_pen_colors(0, amstrad_green_palette, ARRAY_LENGTH(amstrad_green_palette));
}
@@ -301,7 +301,7 @@ PALETTE_INIT_MEMBER(amstrad_state,kccomp)
for (i=0; i<32; i++)
{
- palette_set_color_rgb(machine(), i,
+ palette.set_pen_color(i,
kccomp_get_colour_element((color_prom[i]>>2) & 0x03),
kccomp_get_colour_element((color_prom[i]>>4) & 0x03),
kccomp_get_colour_element((color_prom[i]>>0) & 0x03));
@@ -319,7 +319,7 @@ PALETTE_INIT_MEMBER(amstrad_state,amstrad_plus)
{
int i;
- palette_set_colors(machine(), 0, amstrad_palette, ARRAY_LENGTH(amstrad_palette) / 3);
+ palette.set_pen_colors(0, amstrad_palette, ARRAY_LENGTH(amstrad_palette) / 3);
for ( i = 0; i < 0x1000; i++ )
{
int r, g, b;
@@ -332,7 +332,7 @@ PALETTE_INIT_MEMBER(amstrad_state,amstrad_plus)
g = ( g << 4 ) | ( g );
b = ( b << 4 ) | ( b );
- palette_set_color_rgb(machine(), i, r, g, b);
+ palette.set_pen_color(i, r, g, b);
}
}
@@ -356,7 +356,7 @@ PALETTE_INIT_MEMBER(amstrad_state,aleste)
g = (g << 6);
b = (b << 6);
- palette_set_color_rgb(machine(), i, r, g, b);
+ palette.set_pen_color(i, r, g, b);
}
/* MSX colour palette is 6-bit RGB */
@@ -372,7 +372,7 @@ PALETTE_INIT_MEMBER(amstrad_state,aleste)
g = (g << 6);
b = (b << 6);
- palette_set_color_rgb(machine(), i+32, r, g, b);
+ palette.set_pen_color(i+32, r, g, b);
}
}
diff --git a/src/mess/machine/apple2gs.c b/src/mess/machine/apple2gs.c
index b038c370ecb..423e0c50d0a 100644
--- a/src/mess/machine/apple2gs.c
+++ b/src/mess/machine/apple2gs.c
@@ -1377,7 +1377,7 @@ WRITE8_MEMBER( apple2gs_state::apple2gs_aux4000_w )
{
int color = (offset - 0x19e00) >> 1;
- palette_set_color_rgb(space.machine(), color + 16,
+ m_palette->set_pen_color(color + 16,
((m_slowmem[0x19E00 + (color * 2) + 1] >> 0) & 0x0F) * 17,
((m_slowmem[0x19E00 + (color * 2) + 0] >> 4) & 0x0F) * 17,
((m_slowmem[0x19E00 + (color * 2) + 0] >> 0) & 0x0F) * 17);
@@ -1839,7 +1839,7 @@ WRITE8_MEMBER( apple2gs_state::apple2gs_slowmem_w )
{
int color = (offset - 0x19e00) >> 1;
- palette_set_color_rgb(space.machine(), color + 16,
+ m_palette->set_pen_color(color + 16,
((m_slowmem[0x19E00 + (color * 2) + 1] >> 0) & 0x0F) * 17,
((m_slowmem[0x19E00 + (color * 2) + 0] >> 4) & 0x0F) * 17,
((m_slowmem[0x19E00 + (color * 2) + 0] >> 0) & 0x0F) * 17);
diff --git a/src/mess/machine/b2m.c b/src/mess/machine/b2m.c
index 48e7df29039..7ebd4c1150a 100644
--- a/src/mess/machine/b2m.c
+++ b/src/mess/machine/b2m.c
@@ -275,9 +275,9 @@ WRITE8_MEMBER(b2m_state::b2m_palette_w)
m_b2m_color[offset & 3] = data;
if (ioport("MONITOR")->read()==1) {
- palette_set_color_rgb(machine(),offset, r, g, b);
+ m_palette->set_pen_color(offset, r, g, b);
} else {
- palette_set_color_rgb(machine(),offset, bw, bw, bw);
+ m_palette->set_pen_color(offset, bw, bw, bw);
}
}
diff --git a/src/mess/machine/cgenie.c b/src/mess/machine/cgenie.c
index ff75534668c..8f3cabdd8d6 100644
--- a/src/mess/machine/cgenie.c
+++ b/src/mess/machine/cgenie.c
@@ -220,7 +220,7 @@ WRITE8_MEMBER( cgenie_state::cgenie_port_ff_w )
b = 15;
}
}
- palette_set_color_rgb(machine(), 0, r, g, b);
+ m_palette->set_pen_color(0, r, g, b);
}
/* character mode changed ? */
diff --git a/src/mess/machine/lisa.c b/src/mess/machine/lisa.c
index b6a5a4794fd..92189c57185 100644
--- a/src/mess/machine/lisa.c
+++ b/src/mess/machine/lisa.c
@@ -757,7 +757,7 @@ UINT32 lisa_state::screen_update_lisa(screen_device &screen, bitmap_ind16 &bitma
for (x = 0; x < resx; x++)
// line_buffer[x] = (v[(x+y*resx)>>4] & (0x8000 >> ((x+y*resx) & 0xf))) ? 0 : 1;
line_buffer[x] = (v[(x+y*resx)>>4] & (0x8000 >> (x & 0xf))) ? 0 : 1;
- draw_scanline8(bitmap, 0, y, resx, line_buffer, machine().pens);
+ draw_scanline8(bitmap, 0, y, resx, line_buffer, m_palette->pens());
}
return 0;
}
diff --git a/src/mess/machine/lynx.c b/src/mess/machine/lynx.c
index 76661d5ac61..030bce8a79f 100644
--- a/src/mess/machine/lynx.c
+++ b/src/mess/machine/lynx.c
@@ -1313,8 +1313,8 @@ void lynx_state::lynx_draw_line()
for (x = 160 - 2; x >= 0; j++, x -= 2)
{
byte = lynx_read_ram(j);
- line[x + 1] = m_palette[(byte >> 4) & 0x0f];
- line[x + 0] = m_palette[(byte >> 0) & 0x0f];
+ line[x + 1] = m_lynx_palette[(byte >> 4) & 0x0f];
+ line[x + 0] = m_lynx_palette[(byte >> 0) & 0x0f];
}
}
else
@@ -1323,8 +1323,8 @@ void lynx_state::lynx_draw_line()
for (x = 0; x < 160; j++, x += 2)
{
byte = lynx_read_ram(j);
- line[x + 0] = m_palette[(byte >> 4) & 0x0f];
- line[x + 1] = m_palette[(byte >> 0) & 0x0f];
+ line[x + 0] = m_lynx_palette[(byte >> 4) & 0x0f];
+ line[x + 1] = m_lynx_palette[(byte >> 0) & 0x0f];
}
}
}
@@ -1828,10 +1828,10 @@ WRITE8_MEMBER(lynx_state::mikey_write)
m_mikey.data[offset] = data;
/* RED = 0xb- & 0x0f, GREEN = 0xa- & 0x0f, BLUE = (0xb- & 0xf0) >> 4 */
- m_palette[offset & 0x0f] = machine().pens[
+ m_lynx_palette[offset & 0x0f] = m_palette->pen(
((m_mikey.data[0xb0 + (offset & 0x0f)] & 0x0f)) |
((m_mikey.data[0xa0 + (offset & 0x0f)] & 0x0f) << 4) |
- ((m_mikey.data[0xb0 + (offset & 0x0f)] & 0xf0) << 4)];
+ ((m_mikey.data[0xb0 + (offset & 0x0f)] & 0xf0) << 4));
break;
/* TODO: properly implement these writes */
@@ -1950,7 +1950,7 @@ void lynx_state::machine_start()
save_item(NAME(m_memory_config));
save_item(NAME(m_sign_AB));
save_item(NAME(m_sign_CD));
- save_item(NAME(m_palette));
+ save_item(NAME(m_lynx_palette));
save_item(NAME(m_rotate));
// save blitter variables
save_item(NAME(m_blitter.screen));
diff --git a/src/mess/machine/pk8020.c b/src/mess/machine/pk8020.c
index 2d485bbdd11..f2ebee3e28d 100644
--- a/src/mess/machine/pk8020.c
+++ b/src/mess/machine/pk8020.c
@@ -60,7 +60,7 @@ WRITE8_MEMBER(pk8020_state::sysreg_w)
UINT8 r = ((color & 0x04) ? 0xC0 : 0) + i;
UINT8 g = ((color & 0x02) ? 0xC0 : 0) + i;
UINT8 b = ((color & 0x01) ? 0xC0 : 0) + i;
- palette_set_color( machine(), number, rgb_t(r,g,b) );
+ m_palette->set_pen_color( number, rgb_t(r,g,b) );
}
}
diff --git a/src/mess/machine/svi318.c b/src/mess/machine/svi318.c
index ff32a5632fa..3a5f3f65943 100644
--- a/src/mess/machine/svi318.c
+++ b/src/mess/machine/svi318.c
@@ -379,8 +379,8 @@ MACHINE_RESET_MEMBER(svi318_state,svi328_806)
svi318_set_banks();
/* Set SVI-806 80 column card palette */
- palette_set_color_rgb( machine(), TMS9928A_PALETTE_SIZE, 0, 0, 0 ); /* Monochrome black */
- palette_set_color_rgb( machine(), TMS9928A_PALETTE_SIZE+1, 0, 224, 0 ); /* Monochrome green */
+ m_palette->set_pen_color( TMS9928A_PALETTE_SIZE, 0, 0, 0 ); /* Monochrome black */
+ m_palette->set_pen_color( TMS9928A_PALETTE_SIZE+1, 0, 224, 0 ); /* Monochrome green */
}
/* Init functions */
diff --git a/src/mess/machine/ti99/videowrp.h b/src/mess/machine/ti99/videowrp.h
index 3b96e306c6e..2d3fb628324 100644
--- a/src/mess/machine/ti99/videowrp.h
+++ b/src/mess/machine/ti99/videowrp.h
@@ -167,7 +167,7 @@ protected:
MCFG_SCREEN_VBLANK_TIME(ATTOSECONDS_IN_USEC(_blank)) \
MCFG_SCREEN_SIZE(_x, _y) \
MCFG_SCREEN_VISIBLE_AREA(0, _x - 1, 0, _y - 1) \
- MCFG_PALETTE_LENGTH(512)
+ MCFG_PALETTE_ADD("palette", 512) \
#define MCFG_TI_SOUND_94624_ADD(_tag, _conf) \
MCFG_DEVICE_ADD(_tag, TISOUND_94624, 0) \
diff --git a/src/mess/machine/vector06.c b/src/mess/machine/vector06.c
index 9c2d2ea81c9..28b34f7a44d 100644
--- a/src/mess/machine/vector06.c
+++ b/src/mess/machine/vector06.c
@@ -60,7 +60,7 @@ WRITE8_MEMBER( vector06_state::vector06_color_set )
UINT8 r = (data & 7) << 5;
UINT8 g = ((data >> 3) & 7) << 5;
UINT8 b = ((data >>6) & 3) << 6;
- palette_set_color( machine(), m_color_index, rgb_t(r,g,b) );
+ m_palette->set_pen_color( m_color_index, rgb_t(r,g,b) );
}
diff --git a/src/mess/video/733_asr.c b/src/mess/video/733_asr.c
index 0abee5da615..329334dce0a 100644
--- a/src/mess/video/733_asr.c
+++ b/src/mess/video/733_asr.c
@@ -60,6 +60,7 @@ struct asr_t
bitmap_ind16 *bitmap;
gfxdecode_device *m_gfxdecode;
+ palette_device *m_palette;
};
enum
@@ -90,14 +91,14 @@ static const gfx_layout fontlayout =
8*8 /* every char takes 8 consecutive bytes */
};
-GFXDECODE_START( asr733 )
+static GFXDECODE_START( asr733 )
GFXDECODE_ENTRY( asr733_chr_region, 0, fontlayout, 0, 1 )
GFXDECODE_END
PALETTE_INIT_MEMBER(asr733_device, asr733)
{
- palette_set_color(machine(),0,rgb_t::white); /* white */
- palette_set_color(machine(),1,rgb_t::black); /* black */
+ palette.set_pen_color(0,rgb_t::white); /* white */
+ palette.set_pen_color(1,rgb_t::black); /* black */
}
/*
@@ -222,23 +223,13 @@ const device_type ASR733 = &device_creator<asr733_device>;
asr733_device::asr733_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
: device_t(mconfig, ASR733, "733 ASR", tag, owner, clock, "asr733", __FILE__),
- m_gfxdecode(*this)
+ m_palette(*this, "palette"),
+ m_gfxdecode(*this, "gfxdecode")
{
m_token = global_alloc_clear(asr_t);
}
//-------------------------------------------------
-// static_set_gfxdecode_tag: Set the tag of the
-// gfx decoder
-//-------------------------------------------------
-
-void asr733_device::static_set_gfxdecode_tag(device_t &device, const char *tag)
-{
- downcast<asr733_device &>(device).m_gfxdecode.set_tag(tag);
-}
-
-
-//-------------------------------------------------
// device_config_complete - perform any
// operations now that the configuration is
// complete
@@ -256,6 +247,7 @@ void asr733_device::device_start()
{
asr_t *asr = get_safe_token(this);
asr->m_gfxdecode = m_gfxdecode;
+ asr->m_palette = m_palette;
DEVICE_START_NAME( asr733 )(this);
}
@@ -275,7 +267,7 @@ static void asr_draw_char(device_t *device, int character, int x, int y, int col
{
asr_t *asr = get_safe_token(device);
- asr->m_gfxdecode->gfx(0)->opaque(*asr->bitmap,asr->bitmap->cliprect(), character-32, color, 0, 0,
+ asr->m_gfxdecode->gfx(0)->opaque(*asr->m_palette,*asr->bitmap,asr->bitmap->cliprect(), character-32, color, 0, 0,
x+1, y);
}
@@ -288,7 +280,7 @@ static void asr_linefeed(device_t *device)
for (y=asr_window_offset_y; y<asr_window_offset_y+asr_window_height-asr_scroll_step; y++)
{
extract_scanline8(*asr->bitmap, asr_window_offset_x, y+asr_scroll_step, asr_window_width, buf);
- draw_scanline8(*asr->bitmap, asr_window_offset_x, y, asr_window_width, buf, device->machine().pens);
+ draw_scanline8(*asr->bitmap, asr_window_offset_x, y, asr_window_width, buf,downcast<asr733_device *>(device)->m_palette->pens());
}
const rectangle asr_scroll_clear_window(
@@ -780,7 +772,10 @@ void asr733_keyboard(device_t *device)
}
static MACHINE_CONFIG_FRAGMENT( asr733 )
- MCFG_PALETTE_INIT_OVERRIDE(asr733_device, asr733)
+ MCFG_GFXDECODE_ADD("gfxdecode", asr733)
+
+ MCFG_PALETTE_ADD("palette", 2)
+ MCFG_PALETTE_INIT_OWNER(asr733_device, asr733)
MACHINE_CONFIG_END
//-------------------------------------------------
diff --git a/src/mess/video/733_asr.h b/src/mess/video/733_asr.h
index 772a24892a7..c105c49bd35 100644
--- a/src/mess/video/733_asr.h
+++ b/src/mess/video/733_asr.h
@@ -1,5 +1,5 @@
-#define asr733_chr_region "gfx1"
+#define asr733_chr_region ":gfx1"
enum
{
@@ -14,8 +14,6 @@ struct asr733_init_params_t
void (*int_callback)(running_machine &machine, int state);
};
-GFXDECODE_EXTERN( asr733 );
-
void asr733_init(running_machine &machine);
class asr733_device : public device_t
{
@@ -28,15 +26,14 @@ public:
// access to legacy token
void *token() const { assert(m_token != NULL); return m_token; }
- // static configuration
- static void static_set_gfxdecode_tag(device_t &device, const char *tag);
-
protected:
// device-level overrides
virtual void device_config_complete();
virtual void device_start();
virtual void device_reset();
virtual machine_config_constructor device_mconfig_additions() const;
+public:
+ required_device<palette_device> m_palette;
private:
// internal state
void *m_token;
@@ -50,9 +47,6 @@ extern const device_type ASR733;
MCFG_DEVICE_ADD(_tag, ASR733, 0) \
MCFG_DEVICE_CONFIG(_intf)
-#define MCFG_ASR733_VIDEO_GFXDECODE(_gfxtag) \
- asr733_device::static_set_gfxdecode_tag(*device, "^" _gfxtag);
-
DECLARE_READ8_DEVICE_HANDLER(asr733_cru_r);
DECLARE_WRITE8_DEVICE_HANDLER(asr733_cru_w);
diff --git a/src/mess/video/911_vdt.c b/src/mess/video/911_vdt.c
index 1b435066783..740e505bf1f 100644
--- a/src/mess/video/911_vdt.c
+++ b/src/mess/video/911_vdt.c
@@ -43,7 +43,7 @@ static const gfx_layout fontlayout_8bit =
10*8 /* every char takes 10 consecutive bytes */
};
-GFXDECODE_START( vdt911 )
+static GFXDECODE_START( vdt911 )
/* array must use same order as vdt911_model_t!!! */
/* US */
GFXDECODE_ENTRY( vdt911_chr_region, vdt911_US_chr_offset, fontlayout_7bit, 0, 4 )
@@ -112,6 +112,7 @@ struct vdt_t
int last_modifier_state;
char foreign_mode;
gfxdecode_device * m_gfxdecode;
+ palette_device * m_palette;
};
/*
@@ -136,16 +137,14 @@ PALETTE_INIT_MEMBER(vdt911_device, vdt911)
{
UINT8 i, r, g, b;
- machine().colortable = colortable_alloc(machine(), 3);
-
for ( i = 0; i < 3; i++ )
{
r = vdt911_colors[i*3]; g = vdt911_colors[i*3+1]; b = vdt911_colors[i*3+2];
- colortable_palette_set_color(machine().colortable, i, rgb_t(r, g, b));
+ palette.set_indirect_color(i, rgb_t(r, g, b));
}
for(i=0;i<8;i++)
- colortable_entry_set_value(machine().colortable, i, vdt911_palette[i]);
+ palette.set_pen_indirect(i, vdt911_palette[i]);
}
/*
@@ -274,22 +273,13 @@ const device_type VDT911 = &device_creator<vdt911_device>;
vdt911_device::vdt911_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
: device_t(mconfig, VDT911, "911 VDT", tag, owner, clock, "vdt911", __FILE__),
- m_gfxdecode(*this)
+ m_gfxdecode(*this, "gfxdecode"),
+ m_palette(*this, "palette")
{
m_token = global_alloc_clear(vdt_t);
}
//-------------------------------------------------
-// static_set_gfxdecode_tag: Set the tag of the
-// gfx decoder
-//-------------------------------------------------
-
-void vdt911_device::static_set_gfxdecode_tag(device_t &device, const char *tag)
-{
- downcast<vdt911_device &>(device).m_gfxdecode.set_tag(tag);
-}
-
-//-------------------------------------------------
// device_config_complete - perform any
// operations now that the configuration is
// complete
@@ -307,6 +297,7 @@ void vdt911_device::device_start()
{
vdt_t *vdt = get_safe_token(this);
vdt->m_gfxdecode = m_gfxdecode;
+ vdt->m_palette = m_palette;
DEVICE_START_NAME( vdt911 )(this);
}
@@ -555,7 +546,7 @@ void vdt911_refresh(device_t *device, bitmap_ind16 &bitmap, const rectangle &cli
address++;
- gfx->opaque(bitmap,cliprect, cur_char, color, 0, 0,
+ gfx->opaque(*vdt->m_palette,bitmap,cliprect, cur_char, color, 0, 0,
x+j*7, y+i*10);
}
}
@@ -724,7 +715,10 @@ void vdt911_keyboard(device_t *device)
}
static MACHINE_CONFIG_FRAGMENT( vdt911 )
- MCFG_PALETTE_INIT_OVERRIDE(vdt911_device, vdt911)
+ MCFG_PALETTE_ADD("palette", 8)
+ MCFG_PALETTE_INIT_OWNER(vdt911_device, vdt911)
+
+ MCFG_GFXDECODE_ADD("gfxdecode", vdt911)
MACHINE_CONFIG_END
//-------------------------------------------------
diff --git a/src/mess/video/911_vdt.h b/src/mess/video/911_vdt.h
index 24fc43616fd..7c450202aa6 100644
--- a/src/mess/video/911_vdt.h
+++ b/src/mess/video/911_vdt.h
@@ -1,5 +1,5 @@
-#define vdt911_chr_region "gfx1"
+#define vdt911_chr_region ":gfx1"
enum
{
@@ -17,8 +17,6 @@ enum
vdt911_chr_region_len = vdt911_japanese_chr_offset+256*vdt911_single_char_len
};
-GFXDECODE_EXTERN( vdt911 );
-
enum vdt911_screen_size_t { char_960, char_1920 };
enum vdt911_model_t
{
@@ -52,9 +50,6 @@ public:
// access to legacy token
void *token() const { assert(m_token != NULL); return m_token; }
- // static configuration
- static void static_set_gfxdecode_tag(device_t &device, const char *tag);
-
protected:
// device-level overrides
virtual void device_config_complete();
@@ -64,6 +59,7 @@ private:
// internal state
void *m_token;
required_device<gfxdecode_device> m_gfxdecode;
+ required_device<palette_device> m_palette;
};
extern const device_type VDT911;
@@ -73,8 +69,6 @@ extern const device_type VDT911;
MCFG_DEVICE_ADD(_tag, VDT911, 0) \
MCFG_DEVICE_CONFIG(_intf)
-#define MCFG_VDT911_VIDEO_GFXDECODE(_gfxtag) \
- vdt911_device::static_set_gfxdecode_tag(*device, "^" _gfxtag);
DECLARE_READ8_DEVICE_HANDLER(vdt911_cru_r);
DECLARE_WRITE8_DEVICE_HANDLER(vdt911_cru_w);
diff --git a/src/mess/video/abc800.c b/src/mess/video/abc800.c
index 9f6a1c4f923..84f1918a067 100644
--- a/src/mess/video/abc800.c
+++ b/src/mess/video/abc800.c
@@ -16,7 +16,7 @@
#define VERTICAL_PORCH_HACK 29
-static const rgb_t PALETTE[] =
+static const rgb_t PALETTE_ABC[] =
{
rgb_t::black,
rgb_t(0xff, 0x00, 0x00), // red
@@ -106,11 +106,11 @@ void abc800c_state::hr_update(bitmap_rgb32 &bitmap, const rectangle &cliprect)
if (black || opaque)
{
- bitmap.pix32(y, x) = PALETTE[color];
- bitmap.pix32(y, x + 1) = PALETTE[color];
+ bitmap.pix32(y, x) = PALETTE_ABC[color];
+ bitmap.pix32(y, x + 1) = PALETTE_ABC[color];
- bitmap.pix32(y + 1, x) = PALETTE[color];
- bitmap.pix32(y + 1, x + 1) = PALETTE[color];
+ bitmap.pix32(y + 1, x) = PALETTE_ABC[color];
+ bitmap.pix32(y + 1, x + 1) = PALETTE_ABC[color];
}
}
diff --git a/src/mess/video/abc806.c b/src/mess/video/abc806.c
index 3c6b88a942e..ef594cf034f 100644
--- a/src/mess/video/abc806.c
+++ b/src/mess/video/abc806.c
@@ -26,7 +26,7 @@
#define VERTICAL_PORCH_HACK 27
-static const rgb_t PALETTE[] =
+static const rgb_t PALETTE_ABC[] =
{
rgb_t::black, // black
rgb_t(0xff, 0x00, 0x00), // red
@@ -329,11 +329,11 @@ static MC6845_UPDATE_ROW( abc806_update_row )
{
int color = BIT(chargen_data, 7) ? fg_color : bg_color;
- bitmap.pix32(y, x++) = PALETTE[color];
+ bitmap.pix32(y, x++) = PALETTE_ABC[color];
if (e5 || e6)
{
- bitmap.pix32(y, x++) = PALETTE[color];
+ bitmap.pix32(y, x++) = PALETTE_ABC[color];
}
chargen_data <<= 1;
@@ -448,7 +448,7 @@ void abc806_state::hr_update(bitmap_rgb32 &bitmap, const rectangle &cliprect)
if (BIT(dot, 15) || (bitmap.pix32(y, x) == rgb_t::black))
{
- bitmap.pix32(y, x) = PALETTE[(dot >> 12) & 0x07];
+ bitmap.pix32(y, x) = PALETTE_ABC[(dot >> 12) & 0x07];
}
dot <<= 4;
@@ -505,7 +505,7 @@ UINT32 abc806_state::screen_update(screen_device &screen, bitmap_rgb32 &bitmap,
screen.set_visible_area(0, 767, 0, 311);
// clear screen
- bitmap.fill(get_black_pen(machine()), cliprect);
+ bitmap.fill(m_palette->black_pen(), cliprect);
if (!m_txoff)
{
diff --git a/src/mess/video/ac1.c b/src/mess/video/ac1.c
index fdcf5c58de9..44353fb920c 100644
--- a/src/mess/video/ac1.c
+++ b/src/mess/video/ac1.c
@@ -36,7 +36,7 @@ UINT32 ac1_state::screen_update_ac1(screen_device &screen, bitmap_ind16 &bitmap,
for(x = 0; x < 64; x++ )
{
int code = space.read_byte(AC1_VIDEO_MEMORY + x + y*64);
- m_gfxdecode->gfx(0)->opaque(bitmap,cliprect, code , 0, 0,0, 63*6-x*6,15*8-y*8);
+ m_gfxdecode->gfx(0)->opaque(m_palette,bitmap,cliprect, code , 0, 0,0, 63*6-x*6,15*8-y*8);
}
}
return 0;
@@ -52,7 +52,7 @@ UINT32 ac1_state::screen_update_ac1_32(screen_device &screen, bitmap_ind16 &bitm
for(x = 0; x < 64; x++ )
{
int code = space.read_byte(AC1_VIDEO_MEMORY + x + y*64);
- m_gfxdecode->gfx(0)->opaque(bitmap,cliprect, code , 0, 0,0, 63*6-x*6,31*8-y*8);
+ m_gfxdecode->gfx(0)->opaque(m_palette,bitmap,cliprect, code , 0, 0,0, 63*6-x*6,31*8-y*8);
}
}
return 0;
diff --git a/src/mess/video/advision.c b/src/mess/video/advision.c
index 22adc2708e7..4d3fa95d9dc 100644
--- a/src/mess/video/advision.c
+++ b/src/mess/video/advision.c
@@ -31,14 +31,14 @@ void advision_state::video_start()
***************************************************************************/
-void advision_state::palette_init()
+PALETTE_INIT_MEMBER(advision_state, advision)
{
int i;
for( i = 0; i < 8; i++ )
{
/* 8 shades of RED */
- palette_set_color_rgb(machine(), i, i * 0x22, 0x00, 0x00);
+ m_palette->set_pen_color(i, i * 0x22, 0x00, 0x00);
}
}
diff --git a/src/mess/video/apollo.c b/src/mess/video/apollo.c
index 8d8c64109b6..0277d6b4789 100644
--- a/src/mess/video/apollo.c
+++ b/src/mess/video/apollo.c
@@ -2192,10 +2192,9 @@ WRITE8_DEVICE_HANDLER( apollo_ccr_w )
MACHINE_CONFIG_FRAGMENT( apollo_mono19i )
MCFG_DEFAULT_LAYOUT( layout_apollo )
- MCFG_SCREEN_ADD(VIDEO_SCREEN_TAG, RASTER)
MCFG_VIDEO_ATTRIBUTES(VIDEO_UPDATE_AFTER_VBLANK)
- MCFG_PALETTE_LENGTH(2)
- MCFG_PALETTE_INIT_OVERRIDE(driver_device, black_and_white)
+ MCFG_PALETTE_ADD_BLACK_AND_WHITE("palette")
+ MCFG_SCREEN_ADD(VIDEO_SCREEN_TAG, RASTER)
MCFG_SCREEN_REFRESH_RATE(64)
MCFG_SCREEN_VBLANK_TIME(ATTOSECONDS_IN_USEC(616))
MCFG_SCREEN_SIZE(1280, 1024)
diff --git a/src/mess/video/apple3.c b/src/mess/video/apple3.c
index 5baaaaefeec..6fd638c748a 100644
--- a/src/mess/video/apple3.c
+++ b/src/mess/video/apple3.c
@@ -82,7 +82,7 @@ PALETTE_INIT_MEMBER(apple3_state, apple3)
for (i = 0; i < 32; i++)
{
- palette_set_color_rgb(machine(), i,
+ m_palette->set_pen_color(i,
apple3_palette[(3*i)]*17,
apple3_palette[(3*i)+1]*17,
apple3_palette[(3*i)+2]*17);
diff --git a/src/mess/video/aquarius.c b/src/mess/video/aquarius.c
index 76c1d00cf35..0c822afce78 100644
--- a/src/mess/video/aquarius.c
+++ b/src/mess/video/aquarius.c
@@ -51,17 +51,15 @@ static const unsigned short aquarius_palette[] =
0,15, 1,15, 2,15, 3,15, 4,15, 5,15, 6,15, 7,15, 8,15, 9,15,10,15,11,15,12,15,13,15,14,15,15,15,
};
-void aquarius_state::palette_init()
+PALETTE_INIT_MEMBER(aquarius_state, aquarius)
{
int i;
- machine().colortable = colortable_alloc(machine(), 16);
-
for (i = 0; i < 16; i++)
- colortable_palette_set_color(machine().colortable, i, aquarius_colors[i]);
+ m_palette->set_indirect_color(i, aquarius_colors[i]);
for (i = 0; i < 512; i++)
- colortable_entry_set_value(machine().colortable, i, aquarius_palette[i]);
+ m_palette->set_pen_indirect(i, aquarius_palette[i]);
}
WRITE8_MEMBER(aquarius_state::aquarius_videoram_w)
diff --git a/src/mess/video/arcadia.c b/src/mess/video/arcadia.c
index 82e85c01dd7..79626fb5cbb 100644
--- a/src/mess/video/arcadia.c
+++ b/src/mess/video/arcadia.c
@@ -454,8 +454,8 @@ void arcadia_state::arcadia_draw_char(UINT8 *ch, int charcode, int y, int x)
{
m_bg[y+1][x>>3]|=b>>(x&7);
m_bg[y+1][(x>>3)+1]|=b<<(8-(x&7));
- m_gfxdecode->gfx(0)->opaque(*m_bitmap,m_bitmap->cliprect(), b,colour, 0,0,x,y);
- m_gfxdecode->gfx(0)->opaque(*m_bitmap,m_bitmap->cliprect(), b,colour, 0,0,x,y+1);
+ m_gfxdecode->gfx(0)->opaque(m_palette,*m_bitmap,m_bitmap->cliprect(), b,colour, 0,0,x,y);
+ m_gfxdecode->gfx(0)->opaque(m_palette,*m_bitmap,m_bitmap->cliprect(), b,colour, 0,0,x,y+1);
}
}
}
@@ -467,7 +467,7 @@ void arcadia_state::arcadia_draw_char(UINT8 *ch, int charcode, int y, int x)
m_bg[y][x>>3]|=b>>(x&7);
m_bg[y][(x>>3)+1]|=b<<(8-(x&7));
- m_gfxdecode->gfx(0)->opaque(*m_bitmap,m_bitmap->cliprect(), b,colour, 0,0,x,y);
+ m_gfxdecode->gfx(0)->opaque(m_palette,*m_bitmap,m_bitmap->cliprect(), b,colour, 0,0,x,y);
}
}
}
diff --git a/src/mess/video/atarist.c b/src/mess/video/atarist.c
index 9c179c435a4..240534e78af 100644
--- a/src/mess/video/atarist.c
+++ b/src/mess/video/atarist.c
@@ -64,7 +64,7 @@ inline pen_t st_state::shift_mode_0()
m_shifter_rr[2] <<= 1;
m_shifter_rr[3] <<= 1;
- return machine().pens[color];
+ return m_palette->pen(color);
}
@@ -88,7 +88,7 @@ inline pen_t st_state::shift_mode_1()
m_shifter_shift = 0;
}
- return machine().pens[color];
+ return m_palette->pen(color);
}
@@ -125,7 +125,7 @@ inline pen_t st_state::shift_mode_2()
break;
}
- return machine().pens[color];
+ return m_palette->pen(color);
}
@@ -155,7 +155,7 @@ void st_state::shifter_tick()
break;
default:
- pen = get_black_pen(machine());
+ pen = m_palette->black_pen();
break;
}
@@ -277,7 +277,7 @@ void st_state::glue_tick()
break;
default:
- pen = get_black_pen(machine());
+ pen = m_palette->black_pen();
break;
}
}
@@ -443,7 +443,7 @@ WRITE16_MEMBER( st_state::shifter_palette_w )
m_shifter_palette[offset] = data;
// logerror("SHIFTER Palette[%x] = %x\n", offset, data);
- palette_set_color_rgb(machine(), offset, pal3bit(data >> 8), pal3bit(data >> 4), pal3bit(data));
+ m_palette->set_pen_color(offset, pal3bit(data >> 8), pal3bit(data >> 4), pal3bit(data));
}
@@ -539,7 +539,7 @@ WRITE16_MEMBER( ste_state::shifter_palette_w )
m_shifter_palette[offset] = data;
logerror("SHIFTER palette %x = %x\n", offset, data);
- palette_set_color_rgb(machine(), offset, r, g, b);
+ m_palette->set_pen_color(offset, r, g, b);
}
diff --git a/src/mess/video/avigo.c b/src/mess/video/avigo.c
index a280d721c53..802e3c8de3d 100644
--- a/src/mess/video/avigo.c
+++ b/src/mess/video/avigo.c
@@ -78,10 +78,10 @@ void avigo_state::video_start()
}
/* Initialise the palette */
-void avigo_state::palette_init()
+PALETTE_INIT_MEMBER(avigo_state, avigo)
{
- palette_set_color(machine(),0,rgb_t(0xff,0xff,0xff)); /* white */
- palette_set_color(machine(),1,rgb_t(0x00,0x00,0x00)); /* black */
+ m_palette->set_pen_color(0,rgb_t(0xff,0xff,0xff)); /* white */
+ m_palette->set_pen_color(1,rgb_t(0x00,0x00,0x00)); /* black */
}
UINT32 avigo_state::screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect)
diff --git a/src/mess/video/b2m.c b/src/mess/video/b2m.c
index 3bb006f9d3d..d01fbc9cceb 100644
--- a/src/mess/video/b2m.c
+++ b/src/mess/video/b2m.c
@@ -52,7 +52,7 @@ static const rgb_t b2m_palette[4] = {
rgb_t(0x00, 0x00, 0x00), // 3
};
-void b2m_state::palette_init()
+PALETTE_INIT_MEMBER(b2m_state, b2m)
{
- palette_set_colors(machine(), 0, b2m_palette, ARRAY_LENGTH(b2m_palette));
+ palette.set_pen_colors(0, b2m_palette, ARRAY_LENGTH(b2m_palette));
}
diff --git a/src/mess/video/busicom.c b/src/mess/video/busicom.c
index edf10d37247..a4a3ff82e95 100644
--- a/src/mess/video/busicom.c
+++ b/src/mess/video/busicom.c
@@ -1845,14 +1845,14 @@ static const UINT8 color[] = { 0xFF,0xDB,0xB7,0x92,0x6E,0x49,0x25,0x00 };
static const UINT8 color_red[] = { 0xb0,0xb5,0xc0,0xc5,0xd0,0xd5,0xdf };
-void busicom_state::palette_init()
+PALETTE_INIT_MEMBER(busicom_state, busicom)
{
int i;
for(i=0;i<8;i++) {
- palette_set_color( machine(), i, rgb_t(color[i],color[i],color[i]) );
+ m_palette->set_pen_color( i, rgb_t(color[i],color[i],color[i]) );
}
- palette_set_color( machine(), 8, rgb_t(0xff,0xff,0xff) );
+ m_palette->set_pen_color( 8, rgb_t(0xff,0xff,0xff) );
for(i=0;i<7;i++) {
- palette_set_color( machine(), i+9, rgb_t(color_red[i],0x00,0x00) );
+ m_palette->set_pen_color( i+9, rgb_t(color_red[i],0x00,0x00) );
}
}
diff --git a/src/mess/video/cgc7900.c b/src/mess/video/cgc7900.c
index 9b4418fef9e..8b8d33a411a 100644
--- a/src/mess/video/cgc7900.c
+++ b/src/mess/video/cgc7900.c
@@ -24,7 +24,7 @@
#define OVERLAY_CURSOR_BLINK BIT(m_roll_overlay[0], 12)
#define OVERLAY_CHARACTER_BLINK BIT(m_roll_overlay[0], 11)
-static const rgb_t PALETTE[] =
+static const rgb_t PALETTE_CGC[] =
{
rgb_t::black,
rgb_t(0x00, 0x00, 0xff),
@@ -152,18 +152,18 @@ void cgc7900_state::draw_overlay(screen_device *screen, bitmap_rgb32 &bitmap)
{
if (!OVERLAY_CURSOR_BLINK || m_blink)
{
- bitmap.pix32(y, (sx * 8) + x) = PALETTE[7];
+ bitmap.pix32(y, (sx * 8) + x) = PALETTE_CGC[7];
}
}
else
{
if (BIT(data, x) && (!OVERLAY_CHARACTER_BLINK || m_blink))
{
- if (OVERLAY_VF) bitmap.pix32(y, (sx * 8) + x) = PALETTE[fg];
+ if (OVERLAY_VF) bitmap.pix32(y, (sx * 8) + x) = PALETTE_CGC[fg];
}
else
{
- if (OVERLAY_VB) bitmap.pix32(y, (sx * 8) + x) = PALETTE[bg];
+ if (OVERLAY_VB) bitmap.pix32(y, (sx * 8) + x) = PALETTE_CGC[bg];
}
}
}
diff --git a/src/mess/video/cgenie.c b/src/mess/video/cgenie.c
index b46b6d1b60a..46b5b9eb3b3 100644
--- a/src/mess/video/cgenie.c
+++ b/src/mess/video/cgenie.c
@@ -236,7 +236,7 @@ void cgenie_state::cgenie_refresh_monitor(bitmap_ind16 &bitmap, const rectangle
int i, address, offset, cursor, size, code, x, y;
rectangle r;
- bitmap.fill(get_black_pen(machine()), cliprect);
+ bitmap.fill(m_palette->black_pen(), cliprect);
if(m_crt.vertical_displayed || m_crt.horizontal_displayed)
{
@@ -263,7 +263,7 @@ void cgenie_state::cgenie_refresh_monitor(bitmap_ind16 &bitmap, const rectangle
{
/* get graphics code */
code = videoram[i];
- m_gfxdecode->gfx(1)->opaque(bitmap,r, code, 0,
+ m_gfxdecode->gfx(1)->opaque(m_palette,bitmap,r, code, 0,
0, 0, r.min_x, r.min_y);
}
else
@@ -273,7 +273,7 @@ void cgenie_state::cgenie_refresh_monitor(bitmap_ind16 &bitmap, const rectangle
/* translate defined character sets */
code += m_font_offset[(code >> 6) & 3];
- m_gfxdecode->gfx(0)->opaque(bitmap,r, code, m_colorram[i&0x3ff],
+ m_gfxdecode->gfx(0)->opaque(m_palette,bitmap,r, code, m_colorram[i&0x3ff],
0, 0, r.min_x, r.min_y);
}
@@ -302,7 +302,7 @@ void cgenie_state::cgenie_refresh_monitor(bitmap_ind16 &bitmap, const rectangle
rc.max_x = r.max_x;
rc.min_y = r.min_y + (m_crt.cursor_top & 15);
rc.max_y = r.min_y + (m_crt.cursor_bottom & 15);
- m_gfxdecode->gfx(0)->opaque(bitmap,rc, 0x7f, m_colorram[i&0x3ff],
+ m_gfxdecode->gfx(0)->opaque(m_palette,bitmap,rc, 0x7f, m_colorram[i&0x3ff],
0, 0, rc.min_x, rc.min_y);
}
}
@@ -315,8 +315,8 @@ void cgenie_state::cgenie_refresh_tv_set(bitmap_ind16 &bitmap, const rectangle &
int i, address, offset, cursor, size, code, x, y;
rectangle r;
- m_bitmap.fill(get_black_pen(machine()), cliprect);
- m_dlybitmap.fill(get_black_pen(machine()), cliprect);
+ m_bitmap.fill(m_palette->black_pen(), cliprect);
+ m_dlybitmap.fill(m_palette->black_pen(), cliprect);
if(m_crt.vertical_displayed || m_crt.horizontal_displayed)
{
@@ -343,9 +343,9 @@ void cgenie_state::cgenie_refresh_tv_set(bitmap_ind16 &bitmap, const rectangle &
{
/* get graphics code */
code = videoram[i];
- m_gfxdecode->gfx(1)->opaque(m_bitmap,r, code, 1,
+ m_gfxdecode->gfx(1)->opaque(m_palette,m_bitmap,r, code, 1,
0, 0, r.min_x, r.min_y);
- m_gfxdecode->gfx(1)->opaque(m_dlybitmap,r, code, 2,
+ m_gfxdecode->gfx(1)->opaque(m_palette,m_dlybitmap,r, code, 2,
0, 0, r.min_x, r.min_y);
}
else
@@ -355,9 +355,9 @@ void cgenie_state::cgenie_refresh_tv_set(bitmap_ind16 &bitmap, const rectangle &
/* translate defined character sets */
code += m_font_offset[(code >> 6) & 3];
- m_gfxdecode->gfx(0)->opaque(m_bitmap,r, code, m_colorram[i&0x3ff] + 16,
+ m_gfxdecode->gfx(0)->opaque(m_palette,m_bitmap,r, code, m_colorram[i&0x3ff] + 16,
0, 0, r.min_x, r.min_y);
- m_gfxdecode->gfx(0)->opaque(m_dlybitmap,r, code, m_colorram[i&0x3ff] + 32,
+ m_gfxdecode->gfx(0)->opaque(m_palette,m_dlybitmap,r, code, m_colorram[i&0x3ff] + 32,
0, 0, r.min_x, r.min_y);
}
@@ -387,9 +387,9 @@ void cgenie_state::cgenie_refresh_tv_set(bitmap_ind16 &bitmap, const rectangle &
rc.min_y = r.min_y + (m_crt.cursor_top & 15);
rc.max_y = r.min_y + (m_crt.cursor_bottom & 15);
- m_gfxdecode->gfx(0)->opaque(m_bitmap,rc, 0x7f, m_colorram[i&0x3ff] + 16,
+ m_gfxdecode->gfx(0)->opaque(m_palette,m_bitmap,rc, 0x7f, m_colorram[i&0x3ff] + 16,
0, 0, rc.min_x, rc.min_y);
- m_gfxdecode->gfx(0)->opaque(m_dlybitmap,rc, 0x7f, m_colorram[i&0x3ff] + 32,
+ m_gfxdecode->gfx(0)->opaque(m_palette,m_dlybitmap,rc, 0x7f, m_colorram[i&0x3ff] + 32,
0, 0, rc.min_x, rc.min_y);
}
}
diff --git a/src/mess/video/channelf.c b/src/mess/video/channelf.c
index 596e82b40f0..139f3e48124 100644
--- a/src/mess/video/channelf.c
+++ b/src/mess/video/channelf.c
@@ -29,9 +29,9 @@ static const UINT16 colormap[] = {
};
/* Initialise the palette */
-void channelf_state::palette_init()
+PALETTE_INIT_MEMBER(channelf_state, channelf)
{
- palette_set_colors(machine(), 0, channelf_palette, ARRAY_LENGTH(channelf_palette));
+ palette.set_pen_colors(0, channelf_palette, ARRAY_LENGTH(channelf_palette));
}
void channelf_state::video_start()
diff --git a/src/mess/video/comquest.c b/src/mess/video/comquest.c
index 6160e845795..cf42088b7d3 100644
--- a/src/mess/video/comquest.c
+++ b/src/mess/video/comquest.c
@@ -13,7 +13,7 @@ UINT32 comquest_state::screen_update_comquest(screen_device &screen, bitmap_ind1
for (y=0; y<128;y++) {
for (x=0, j=0; j<8;j++,x+=8*4) {
#if 0
- m_gfxdecode->gfx(0)->opaque(bitmap,0, state->m_data[y][j],0,
+ m_gfxdecode->gfx(0)->opaque(m_palette,bitmap,0, state->m_data[y][j],0,
0,0,x,y);
#endif
}
diff --git a/src/mess/video/dai.c b/src/mess/video/dai.c
index 752d5a32f60..a0e562d8c57 100644
--- a/src/mess/video/dai.c
+++ b/src/mess/video/dai.c
@@ -40,13 +40,13 @@ const unsigned char dai_palette[16*3] =
};
-void dai_state::palette_init()
+PALETTE_INIT_MEMBER(dai_state, dai)
{
int i;
for ( i = 0; i < sizeof(dai_palette) / 3; i++ )
{
- palette_set_color_rgb(machine(), i, dai_palette[i * 3], dai_palette[i * 3 + 1], dai_palette[i * 3 + 2]);
+ m_palette->set_pen_color(i, dai_palette[i * 3], dai_palette[i * 3 + 1], dai_palette[i * 3 + 2]);
}
}
diff --git a/src/mess/video/ef9345.c b/src/mess/video/ef9345.c
index abb84049a49..dac8a671df7 100644
--- a/src/mess/video/ef9345.c
+++ b/src/mess/video/ef9345.c
@@ -120,7 +120,7 @@ void ef9345_device::device_start()
m_charset = region();
m_screen_out.allocate(496, m_screen->height());
- m_screen_out.set_palette(machine().palette);
+ m_screen_out.set_palette(m_screen->palette()->palette());
m_blink_timer->adjust(attotime::from_msec(500), 0, attotime::from_msec(500));
diff --git a/src/mess/video/fm7.c b/src/mess/video/fm7.c
index 7fc64c39a38..0eaa5045d50 100644
--- a/src/mess/video/fm7.c
+++ b/src/mess/video/fm7.c
@@ -991,7 +991,7 @@ WRITE8_MEMBER(fm7_state::fm7_palette_w)
if(data & 0x01)
b = 0xff;
- palette_set_color(machine(),offset,rgb_t(r,g,b));
+ m_palette->set_pen_color(offset,rgb_t(r,g,b));
m_video.fm7_pal[offset] = data & 0x07;
}
@@ -1022,21 +1022,21 @@ WRITE8_MEMBER(fm7_state::fm77av_analog_palette_w)
break;
case 2:
m_video.fm77av_pal_b[m_video.fm77av_pal_selected] = (data & 0x0f) << 4;
- palette_set_color(machine(),m_video.fm77av_pal_selected+8,
+ m_palette->set_pen_color(m_video.fm77av_pal_selected+8,
rgb_t(m_video.fm77av_pal_r[m_video.fm77av_pal_selected],
m_video.fm77av_pal_g[m_video.fm77av_pal_selected],
m_video.fm77av_pal_b[m_video.fm77av_pal_selected]));
break;
case 3:
m_video.fm77av_pal_r[m_video.fm77av_pal_selected] = (data & 0x0f) << 4;
- palette_set_color(machine(),m_video.fm77av_pal_selected+8,
+ m_palette->set_pen_color(m_video.fm77av_pal_selected+8,
rgb_t(m_video.fm77av_pal_r[m_video.fm77av_pal_selected],
m_video.fm77av_pal_g[m_video.fm77av_pal_selected],
m_video.fm77av_pal_b[m_video.fm77av_pal_selected]));
break;
case 4:
m_video.fm77av_pal_g[m_video.fm77av_pal_selected] = (data & 0x0f) << 4;
- palette_set_color(machine(),m_video.fm77av_pal_selected+8,
+ m_palette->set_pen_color(m_video.fm77av_pal_selected+8,
rgb_t(m_video.fm77av_pal_r[m_video.fm77av_pal_selected],
m_video.fm77av_pal_g[m_video.fm77av_pal_selected],
m_video.fm77av_pal_b[m_video.fm77av_pal_selected]));
@@ -1593,11 +1593,11 @@ static const rgb_t fm7_initial_palette[8] = {
rgb_t(0xff, 0xff, 0xff), // 7
};
-void fm7_state::palette_init()
+PALETTE_INIT_MEMBER(fm7_state, fm7)
{
int x;
- palette_set_colors(machine(), 0, fm7_initial_palette, ARRAY_LENGTH(fm7_initial_palette));
+ palette.set_pen_colors(0, fm7_initial_palette, ARRAY_LENGTH(fm7_initial_palette));
for(x=0;x<8;x++)
m_video.fm7_pal[x] = x;
}
diff --git a/src/mess/video/galeb.c b/src/mess/video/galeb.c
index 576036491b4..6fb96ebcd84 100644
--- a/src/mess/video/galeb.c
+++ b/src/mess/video/galeb.c
@@ -36,7 +36,7 @@ UINT32 galeb_state::screen_update_galeb(screen_device &screen, bitmap_ind16 &bit
for(x = 0; x < 48; x++ )
{
int code = m_video_ram[15 + x + y*64];
- m_gfxdecode->gfx(0)->opaque(bitmap,cliprect, code , 0, 0,0, x*8,y*8);
+ m_gfxdecode->gfx(0)->opaque(m_palette,bitmap,cliprect, code , 0, 0,0, x*8,y*8);
}
}
return 0;
diff --git a/src/mess/video/hec2video.c b/src/mess/video/hec2video.c
index 3b17528c24c..4f7f8f3cae5 100644
--- a/src/mess/video/hec2video.c
+++ b/src/mess/video/hec2video.c
@@ -46,24 +46,24 @@ void hec2hrp_state::Init_Hector_Palette()
hector_color[3] = 3; // Ecriture de choix (jaune)
// Color initialisation : full lightning
- palette_set_color( machine(), 0,rgb_t(000,000,000));//Noir
- palette_set_color( machine(), 1,rgb_t(255,000,000));//Rouge
- palette_set_color( machine(), 2,rgb_t(000,255,000));//Vert
- palette_set_color( machine(), 3,rgb_t(255,255,000));//Jaune
- palette_set_color( machine(), 4,rgb_t(000,000,255));//Bleu
- palette_set_color( machine(), 5,rgb_t(255,000,255));//Magneta
- palette_set_color( machine(), 6,rgb_t(000,255,255));//Cyan
- palette_set_color( machine(), 7,rgb_t(255,255,255));//Blanc
+ m_palette->set_pen_color( 0,rgb_t(000,000,000));//Noir
+ m_palette->set_pen_color( 1,rgb_t(255,000,000));//Rouge
+ m_palette->set_pen_color( 2,rgb_t(000,255,000));//Vert
+ m_palette->set_pen_color( 3,rgb_t(255,255,000));//Jaune
+ m_palette->set_pen_color( 4,rgb_t(000,000,255));//Bleu
+ m_palette->set_pen_color( 5,rgb_t(255,000,255));//Magneta
+ m_palette->set_pen_color( 6,rgb_t(000,255,255));//Cyan
+ m_palette->set_pen_color( 7,rgb_t(255,255,255));//Blanc
// 1/2 lightning
- palette_set_color( machine(), 8,rgb_t(000,000,000));//Noir
- palette_set_color( machine(), 9,rgb_t(128,000,000));//Rouge
- palette_set_color( machine(),10,rgb_t(000,128,000));//Vert
- palette_set_color( machine(),11,rgb_t(128,128,000));//Jaune
- palette_set_color( machine(),12,rgb_t(000,000,128));//Bleu
- palette_set_color( machine(),13,rgb_t(128,000,128));//Magneta
- palette_set_color( machine(),14,rgb_t(000,128,128));//Cyan
- palette_set_color( machine(),15,rgb_t(128,128,128));//Blanc
+ m_palette->set_pen_color( 8,rgb_t(000,000,000));//Noir
+ m_palette->set_pen_color( 9,rgb_t(128,000,000));//Rouge
+ m_palette->set_pen_color( 10,rgb_t(000,128,000));//Vert
+ m_palette->set_pen_color( 11,rgb_t(128,128,000));//Jaune
+ m_palette->set_pen_color( 12,rgb_t(000,000,128));//Bleu
+ m_palette->set_pen_color( 13,rgb_t(128,000,128));//Magneta
+ m_palette->set_pen_color( 14,rgb_t(000,128,128));//Cyan
+ m_palette->set_pen_color( 15,rgb_t(128,128,128));//Blanc
}
void hec2hrp_state::hector_hr(bitmap_ind16 &bitmap, UINT8 *page, int ymax, int yram)
diff --git a/src/mess/video/hp48.c b/src/mess/video/hp48.c
index 02d5d847a79..7694ea16608 100644
--- a/src/mess/video/hp48.c
+++ b/src/mess/video/hp48.c
@@ -39,13 +39,13 @@ static const int hp48_fg_color[3] = { 0, 0, 64 }; /* dark blue */
FUNCTIONS
***************************************************************************/
-void hp48_state::palette_init()
+PALETTE_INIT_MEMBER(hp48_state, hp48)
{
int i;
for ( i = 0; i < 255; i++ )
{
float c = i/255.;
- palette_set_color( machine(), i, rgb_t( 0, mix2(0,c), mix2(1,c), mix2(2,c) ) );
+ m_palette->set_pen_color( i, rgb_t( 0, mix2(0,c), mix2(1,c), mix2(2,c) ) );
}
}
diff --git a/src/mess/video/intv.c b/src/mess/video/intv.c
index cd418092c03..889807462a9 100644
--- a/src/mess/video/intv.c
+++ b/src/mess/video/intv.c
@@ -83,7 +83,7 @@ UINT32 intv_state::screen_update_intvkbd(screen_device &screen, bitmap_ind16 &bi
{
offs = current_row*64+x;
- m_gfxdecode->gfx(0)->transpen(bitmap,cliprect,
+ m_gfxdecode->gfx(0)->transpen(m_palette,bitmap,cliprect,
videoram[offs],
7, /* white */
0,0,
@@ -94,7 +94,7 @@ UINT32 intv_state::screen_update_intvkbd(screen_device &screen, bitmap_ind16 &bi
/* draw the cursor as a solid white block */
/* (should use a filled rect here!) */
- m_gfxdecode->gfx(0)->transpen(bitmap,cliprect,
+ m_gfxdecode->gfx(0)->transpen(m_palette,bitmap,cliprect,
191, /* a block */
7, /* white */
0,0,
@@ -107,25 +107,25 @@ UINT32 intv_state::screen_update_intvkbd(screen_device &screen, bitmap_ind16 &bi
#if 0
// debugging
c = tape_motor_mode_desc[m_tape_motor_mode][0];
- m_gfxdecode->gfx(0)->transpen(bitmap,&machine().screen[0].visarea,
+ m_gfxdecode->gfx(0)->transpen(m_palette,bitmap,&machine().screen[0].visarea,
c,
1,
0,0,
0*8,0*8, 0);
for(y=0;y<5;y++)
{
- m_gfxdecode->gfx(0)->transpen(bitmap,&machine().screen[0].visarea,
+ m_gfxdecode->gfx(0)->transpen(m_palette,bitmap,&machine().screen[0].visarea,
m_tape_unknown_write[y]+'0',
1,
0,0,
0*8,(y+2)*8, 0);
}
- m_gfxdecode->gfx(0)->transpen(bitmap,&machine().screen[0].visarea,
+ m_gfxdecode->gfx(0)->transpen(m_palette,bitmap,&machine().screen[0].visarea,
m_tape_unknown_write[5]+'0',
1,
0,0,
0*8,8*8, 0);
- m_gfxdecode->gfx(0)->transpen(bitmap,&machine().screen[0].visarea,
+ m_gfxdecode->gfx(0)->transpen(m_palette,bitmap,&machine().screen[0].visarea,
m_tape_interrupts_enabled+'0',
1,
0,0,
diff --git a/src/mess/video/isa_cga.c b/src/mess/video/isa_cga.c
index ff9fdc2d8e6..3912be5b37c 100644
--- a/src/mess/video/isa_cga.c
+++ b/src/mess/video/isa_cga.c
@@ -628,7 +628,7 @@ static MACHINE_CONFIG_FRAGMENT( cga )
MCFG_SCREEN_RAW_PARAMS(XTAL_14_31818MHz,912,0,640,262,0,200)
MCFG_SCREEN_UPDATE_DEVICE( DEVICE_SELF, isa8_cga_device, screen_update )
- MCFG_PALETTE_LENGTH(/* CGA_PALETTE_SETS * 16*/ 65536 )
+ MCFG_PALETTE_ADD("palette", /* CGA_PALETTE_SETS * 16*/ 65536 )
MCFG_MC6845_ADD(CGA_MC6845_NAME, MC6845, CGA_SCREEN_NAME, XTAL_14_31818MHz/8, mc6845_cga_intf)
MACHINE_CONFIG_END
@@ -680,7 +680,8 @@ isa8_cga_device::isa8_cga_device(const machine_config &mconfig, const char *tag,
device_t(mconfig, ISA8_CGA, "IBM Color/Graphics Monitor Adapter", tag, owner, clock, "cga", __FILE__),
device_isa8_card_interface(mconfig, *this),
m_cga_config(*this, "cga_config"),
- m_vram_size( 0x4000 )
+ m_vram_size( 0x4000 ),
+ m_palette(*this, "palette")
{
m_chr_gen_offset[0] = m_chr_gen_offset[2] = 0x1800;
m_chr_gen_offset[1] = m_chr_gen_offset[3] = 0x1000;
@@ -692,7 +693,8 @@ isa8_cga_device::isa8_cga_device(const machine_config &mconfig, device_type type
device_t(mconfig, type, name, tag, owner, clock, shortname, source),
device_isa8_card_interface(mconfig, *this),
m_cga_config(*this, "cga_config"),
- m_vram_size( 0x4000 )
+ m_vram_size( 0x4000 ),
+ m_palette(*this, "palette")
{
m_chr_gen_offset[0] = m_chr_gen_offset[2] = 0x1800;
m_chr_gen_offset[1] = m_chr_gen_offset[3] = 0x1000;
@@ -719,7 +721,7 @@ void isa8_cga_device::device_start()
for ( i = 0; i < CGA_PALETTE_SETS * 16; i++ )
{
- palette_set_color_rgb( machine(), i, cga_palette[i][0], cga_palette[i][1], cga_palette[i][2] );
+ m_palette->set_pen_color( i, cga_palette[i][0], cga_palette[i][1], cga_palette[i][2] );
}
i = 0x8000;
@@ -729,7 +731,7 @@ void isa8_cga_device::device_start()
{
for ( int b = 0; b < 32; b++ )
{
- palette_set_color_rgb( machine(), i, r << 3, g << 3, b << 3 );
+ m_palette->set_pen_color( i, r << 3, g << 3, b << 3 );
i++;
}
}
diff --git a/src/mess/video/isa_cga.h b/src/mess/video/isa_cga.h
index 9707048d963..d7fdcac5c08 100644
--- a/src/mess/video/isa_cga.h
+++ b/src/mess/video/isa_cga.h
@@ -68,6 +68,7 @@ public:
bool m_superimpose;
UINT8 m_plantronics; /* This should be moved into the appropriate subclass */
offs_t m_start_offset;
+ required_device<palette_device> m_palette;
};
// device type definition
diff --git a/src/mess/video/isa_ega.c b/src/mess/video/isa_ega.c
index 6fa4f9a23d3..b4a6ad0cd49 100644
--- a/src/mess/video/isa_ega.c
+++ b/src/mess/video/isa_ega.c
@@ -472,7 +472,7 @@ MACHINE_CONFIG_FRAGMENT( pcvideo_ega )
MCFG_SCREEN_RAW_PARAMS(16257000,912,0,640,262,0,200)
MCFG_SCREEN_UPDATE_DEVICE(EGA_CRTC_NAME, crtc_ega_device, screen_update)
- MCFG_PALETTE_LENGTH( 64 )
+ MCFG_PALETTE_ADD( "palette", 64 )
MCFG_CRTC_EGA_ADD(EGA_CRTC_NAME, 16257000/8, crtc_ega_ega_intf)
MCFG_CRTC_EGA_SET_SCREEN(EGA_SCREEN_NAME)
MACHINE_CONFIG_END
@@ -567,14 +567,16 @@ ioport_constructor isa8_ega_device::device_input_ports() const
isa8_ega_device::isa8_ega_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) :
device_t(mconfig, ISA8_EGA, "IBM Enhanced Graphics Adapter", tag, owner, clock, "ega", __FILE__),
device_isa8_card_interface(mconfig, *this),
- m_misc_output(0)
+ m_misc_output(0),
+ m_palette(*this, "palette")
{
}
isa8_ega_device::isa8_ega_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock, const char *shortname, const char *source) :
device_t(mconfig, type, name, tag, owner, clock, shortname, source),
device_isa8_card_interface(mconfig, *this),
- m_misc_output(0)
+ m_misc_output(0),
+ m_palette(*this, "palette")
{
}
@@ -594,7 +596,7 @@ void isa8_ega_device::device_start()
UINT8 g = ( ( i & 0x02 ) ? 0xAA : 0x00 ) + ( ( i & 0x10 ) ? 0x55 : 0x00 );
UINT8 b = ( ( i & 0x01 ) ? 0xAA : 0x00 ) + ( ( i & 0x08 ) ? 0x55 : 0x00 );
- palette_set_color_rgb( machine(), i, r, g, b );
+ m_palette->set_pen_color( i, r, g, b );
}
UINT8 *dst = memregion(subtag(tempstring, "user2" ))->base() + 0x0000;
diff --git a/src/mess/video/isa_ega.h b/src/mess/video/isa_ega.h
index 829abbcafa5..f8722c52d92 100644
--- a/src/mess/video/isa_ega.h
+++ b/src/mess/video/isa_ega.h
@@ -96,6 +96,7 @@ public:
UINT8 m_vsync;
UINT8 m_vblank;
UINT8 m_display_enable;
+ required_device<palette_device> m_palette;
};
diff --git a/src/mess/video/isa_mda.c b/src/mess/video/isa_mda.c
index 806304f6766..d000d32056e 100644
--- a/src/mess/video/isa_mda.c
+++ b/src/mess/video/isa_mda.c
@@ -103,7 +103,7 @@ MACHINE_CONFIG_FRAGMENT( pcvideo_mda )
MCFG_SCREEN_RAW_PARAMS(MDA_CLOCK, 882, 0, 720, 370, 0, 350 )
MCFG_SCREEN_UPDATE_DEVICE( MDA_MC6845_NAME, mc6845_device, screen_update )
- MCFG_PALETTE_LENGTH( 4 )
+ MCFG_PALETTE_ADD( "palette", 4 )
MCFG_MC6845_ADD( MDA_MC6845_NAME, MC6845, MDA_SCREEN_NAME, MDA_CLOCK/9, mc6845_mda_intf)
@@ -155,13 +155,15 @@ const rom_entry *isa8_mda_device::device_rom_region() const
isa8_mda_device::isa8_mda_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) :
device_t(mconfig, ISA8_MDA, "IBM Monochrome Display and Printer Adapter", tag, owner, clock, "isa_ibm_mda", __FILE__),
- device_isa8_card_interface(mconfig, *this)
+ device_isa8_card_interface(mconfig, *this),
+ m_palette(*this, "palette")
{
}
isa8_mda_device::isa8_mda_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock, const char *shortname, const char *source) :
device_t(mconfig, type, name, tag, owner, clock, shortname, source),
- device_isa8_card_interface(mconfig, *this)
+ device_isa8_card_interface(mconfig, *this),
+ m_palette(*this, "palette")
{
}
@@ -178,7 +180,7 @@ void isa8_mda_device::device_start()
/* Initialise the mda palette */
for(int i = 0; i < (sizeof(mda_palette) / 3); i++)
- palette_set_color_rgb(machine(), i, mda_palette[i][0], mda_palette[i][1], mda_palette[i][2]);
+ m_palette->set_pen_color(i, mda_palette[i][0], mda_palette[i][1], mda_palette[i][2]);
}
//-------------------------------------------------
@@ -520,7 +522,7 @@ MACHINE_CONFIG_FRAGMENT( pcvideo_hercules )
MCFG_SCREEN_RAW_PARAMS(MDA_CLOCK, 882, 0, 720, 370, 0, 350 )
MCFG_SCREEN_UPDATE_DEVICE( HERCULES_MC6845_NAME, mc6845_device, screen_update )
- MCFG_PALETTE_LENGTH( 4 )
+ MCFG_PALETTE_ADD( "palette", 4 )
MCFG_MC6845_ADD( HERCULES_MC6845_NAME, MC6845, HERCULES_SCREEN_NAME, MDA_CLOCK/9, mc6845_hercules_intf)
@@ -586,7 +588,7 @@ void isa8_hercules_device::device_start()
/* Initialise the mda palette */
for(int i = 0; i < (sizeof(mda_palette) / 3); i++)
- palette_set_color_rgb(machine(), i, mda_palette[i][0], mda_palette[i][1], mda_palette[i][2]);
+ m_palette->set_pen_color(i, mda_palette[i][0], mda_palette[i][1], mda_palette[i][2]);
}
//-------------------------------------------------
diff --git a/src/mess/video/isa_mda.h b/src/mess/video/isa_mda.h
index 17d5fac16b5..0da42bc0051 100644
--- a/src/mess/video/isa_mda.h
+++ b/src/mess/video/isa_mda.h
@@ -39,7 +39,7 @@ public:
protected:
// device-level overrides
virtual void device_start();
- virtual void device_reset();
+ virtual void device_reset();
public:
int m_framecnt;
@@ -51,6 +51,7 @@ public:
UINT8 m_hsync;
UINT8 *m_videoram;
UINT8 m_pixel;
+ required_device<palette_device> m_palette;
};
diff --git a/src/mess/video/isa_pc1640_iga.c b/src/mess/video/isa_pc1640_iga.c
index ca107fcf783..4450a8405e4 100644
--- a/src/mess/video/isa_pc1640_iga.c
+++ b/src/mess/video/isa_pc1640_iga.c
@@ -92,7 +92,7 @@ void isa8_pc1640_iga_device::device_start()
UINT8 g = ( ( i & 0x02 ) ? 0xAA : 0x00 ) + ( ( i & 0x10 ) ? 0x55 : 0x00 );
UINT8 b = ( ( i & 0x01 ) ? 0xAA : 0x00 ) + ( ( i & 0x08 ) ? 0x55 : 0x00 );
- palette_set_color_rgb( machine(), i, r, g, b );
+ m_palette->set_pen_color( i, r, g, b );
}
/* Install 256KB Video ram on our EGA card */
diff --git a/src/mess/video/isa_svga_cirrus.c b/src/mess/video/isa_svga_cirrus.c
index 30b9c8889f7..326d0bf2e4e 100644
--- a/src/mess/video/isa_svga_cirrus.c
+++ b/src/mess/video/isa_svga_cirrus.c
@@ -25,7 +25,7 @@ static MACHINE_CONFIG_FRAGMENT( vga_cirrus )
MCFG_SCREEN_RAW_PARAMS(XTAL_25_1748MHz,900,0,640,526,0,480)
MCFG_SCREEN_UPDATE_DEVICE("vga", cirrus_vga_device, screen_update)
- MCFG_PALETTE_LENGTH(0x100)
+ MCFG_PALETTE_ADD("palette", 0x100)
MCFG_DEVICE_ADD("vga", CIRRUS_VGA, 0)
MACHINE_CONFIG_END
diff --git a/src/mess/video/isa_svga_s3.c b/src/mess/video/isa_svga_s3.c
index f121f70de54..ae87a6e8138 100644
--- a/src/mess/video/isa_svga_s3.c
+++ b/src/mess/video/isa_svga_s3.c
@@ -25,7 +25,7 @@ static MACHINE_CONFIG_FRAGMENT( vga_s3 )
MCFG_SCREEN_RAW_PARAMS(XTAL_25_1748MHz,900,0,640,526,0,480)
MCFG_SCREEN_UPDATE_DEVICE("vga", s3_vga_device, screen_update)
- MCFG_PALETTE_LENGTH(0x100)
+ MCFG_PALETTE_ADD("palette", 0x100)
MCFG_DEVICE_ADD("vga", S3_VGA, 0)
MACHINE_CONFIG_END
@@ -131,7 +131,7 @@ static MACHINE_CONFIG_FRAGMENT( vga_s3virge )
MCFG_SCREEN_RAW_PARAMS(XTAL_25_1748MHz,900,0,640,526,0,480)
MCFG_SCREEN_UPDATE_DEVICE("vga", s3virge_vga_device, screen_update)
- MCFG_PALETTE_LENGTH(0x100)
+ MCFG_PALETTE_ADD("palette", 0x100)
MCFG_DEVICE_ADD("vga", S3VIRGE, 0)
MACHINE_CONFIG_END
diff --git a/src/mess/video/isa_svga_tseng.c b/src/mess/video/isa_svga_tseng.c
index 345e05c9015..cfb0e7f35de 100644
--- a/src/mess/video/isa_svga_tseng.c
+++ b/src/mess/video/isa_svga_tseng.c
@@ -25,7 +25,7 @@ static MACHINE_CONFIG_FRAGMENT( vga_tseng )
MCFG_SCREEN_RAW_PARAMS(XTAL_25_1748MHz,900,0,640,526,0,480)
MCFG_SCREEN_UPDATE_DEVICE("vga", tseng_vga_device, screen_update)
- MCFG_PALETTE_LENGTH(0x100)
+ MCFG_PALETTE_ADD("palette", 0x100)
MCFG_DEVICE_ADD("vga", TSENG_VGA, 0)
MACHINE_CONFIG_END
diff --git a/src/mess/video/isa_vga_ati.c b/src/mess/video/isa_vga_ati.c
index 02a77933776..e92e842df2a 100644
--- a/src/mess/video/isa_vga_ati.c
+++ b/src/mess/video/isa_vga_ati.c
@@ -28,7 +28,7 @@ static MACHINE_CONFIG_FRAGMENT( vga_ati )
MCFG_SCREEN_RAW_PARAMS(XTAL_25_1748MHz,900,0,640,526,0,480)
MCFG_SCREEN_UPDATE_DEVICE("vga", ati_vga_device, screen_update)
- MCFG_PALETTE_LENGTH(0x100)
+ MCFG_PALETTE_ADD("palette", 0x100)
MCFG_DEVICE_ADD("vga", ATI_VGA, 0)
MACHINE_CONFIG_END
diff --git a/src/mess/video/k1ge.c b/src/mess/video/k1ge.c
index f443b2a9bfa..7eb19eaed2f 100644
--- a/src/mess/video/k1ge.c
+++ b/src/mess/video/k1ge.c
@@ -19,7 +19,7 @@ PALETTE_INIT_MEMBER(k1ge_device, k1ge)
{
int j = ( i << 5 ) | ( i << 2 ) | ( i >> 1 );
- palette_set_color_rgb( machine(), 7-i, j, j, j );
+ palette.set_pen_color( 7-i, j, j, j );
}
}
@@ -34,7 +34,7 @@ PALETTE_INIT_MEMBER(k2ge_device, k2ge)
{
for ( r = 0; r < 16; r++ )
{
- palette_set_color_rgb( machine(), ( b << 8 ) | ( g << 4 ) | r, ( r << 4 ) | r, ( g << 4 ) | g, ( b << 4 ) | b );
+ palette.set_pen_color( ( b << 8 ) | ( g << 4 ) | r, ( r << 4 ) | r, ( g << 4 ) | g, ( b << 4 ) | b );
}
}
}
@@ -888,7 +888,8 @@ k1ge_device::k1ge_device(const machine_config &mconfig, device_type type, const
}
static MACHINE_CONFIG_FRAGMENT( k1ge )
- MCFG_PALETTE_INIT_OVERRIDE(k1ge_device, k1ge)
+ MCFG_PALETTE_ADD("palette", 8 )
+ MCFG_PALETTE_INIT_OWNER(k1ge_device, k1ge)
MACHINE_CONFIG_END
//-------------------------------------------------
@@ -910,7 +911,8 @@ k2ge_device::k2ge_device(const machine_config &mconfig, const char *tag, device_
}
static MACHINE_CONFIG_FRAGMENT( k2ge )
- MCFG_PALETTE_INIT_OVERRIDE(k2ge_device, k2ge)
+ MCFG_PALETTE_ADD("palette", 4096 )
+ MCFG_PALETTE_INIT_OWNER(k2ge_device, k2ge)
MACHINE_CONFIG_END
//-------------------------------------------------
diff --git a/src/mess/video/kaypro.c b/src/mess/video/kaypro.c
index 44ddd0dc43d..b4afdc61e7a 100644
--- a/src/mess/video/kaypro.c
+++ b/src/mess/video/kaypro.c
@@ -11,9 +11,9 @@
PALETTE_INIT_MEMBER(kaypro_state,kaypro)
{
- palette_set_color(machine(), 0, rgb_t::black); /* black */
- palette_set_color(machine(), 1, rgb_t(0, 220, 0)); /* green */
- palette_set_color(machine(), 2, rgb_t(0, 110, 0)); /* low intensity green */
+ palette.set_pen_color(0, rgb_t::black); /* black */
+ palette.set_pen_color(1, rgb_t(0, 220, 0)); /* green */
+ palette.set_pen_color(2, rgb_t(0, 110, 0)); /* low intensity green */
}
UINT32 kaypro_state::screen_update_kayproii(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect)
diff --git a/src/mess/video/kc.c b/src/mess/video/kc.c
index 8b4fd39544a..d847e648873 100644
--- a/src/mess/video/kc.c
+++ b/src/mess/video/kc.c
@@ -50,7 +50,7 @@ static const UINT8 kc85_palette[KC85_PALETTE_SIZE * 3] =
PALETTE_INIT_MEMBER(kc_state,kc85)
{
for (int i = 0; i < sizeof(kc85_palette) / 3; i++ )
- palette_set_color_rgb(machine(), i, kc85_palette[i*3], kc85_palette[i*3+1], kc85_palette[i*3+2]);
+ palette.set_pen_color(i, kc85_palette[i*3], kc85_palette[i*3+1], kc85_palette[i*3+2]);
}
/* set new blink state */
diff --git a/src/mess/video/kramermc.c b/src/mess/video/kramermc.c
index dfedb9c59ba..65df531d75c 100644
--- a/src/mess/video/kramermc.c
+++ b/src/mess/video/kramermc.c
@@ -37,7 +37,7 @@ UINT32 kramermc_state::screen_update_kramermc(screen_device &screen, bitmap_ind1
for(x = 0; x < 64; x++ )
{
int code = space.read_byte(KRAMERMC_VIDEO_MEMORY + x + y*64);
- m_gfxdecode->gfx(0)->opaque(bitmap,cliprect, code , 0, 0,0, x*8,y*8);
+ m_gfxdecode->gfx(0)->opaque(m_palette,bitmap,cliprect, code , 0, 0,0, x*8,y*8);
}
}
return 0;
diff --git a/src/mess/video/kyocera.c b/src/mess/video/kyocera.c
index b518547c79a..5074d7c70fe 100644
--- a/src/mess/video/kyocera.c
+++ b/src/mess/video/kyocera.c
@@ -4,14 +4,14 @@
PALETTE_INIT_MEMBER(kc85_state,kc85)
{
- palette_set_color(machine(), 0, rgb_t(138, 146, 148));
- palette_set_color(machine(), 1, rgb_t(92, 83, 88));
+ palette.set_pen_color(0, rgb_t(138, 146, 148));
+ palette.set_pen_color(1, rgb_t(92, 83, 88));
}
PALETTE_INIT_MEMBER(tandy200_state,tandy200)
{
- palette_set_color(machine(), 0, rgb_t(138, 146, 148));
- palette_set_color(machine(), 1, rgb_t(92, 83, 88));
+ palette.set_pen_color(0, rgb_t(138, 146, 148));
+ palette.set_pen_color(1, rgb_t(92, 83, 88));
}
UINT32 kc85_state::screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect)
@@ -56,8 +56,8 @@ MACHINE_CONFIG_FRAGMENT( kc85_video )
MCFG_DEFAULT_LAYOUT(layout_lcd)
- MCFG_PALETTE_LENGTH(2)
- MCFG_PALETTE_INIT_OVERRIDE(kc85_state,kc85)
+ MCFG_PALETTE_ADD("palette", 2)
+ MCFG_PALETTE_INIT_OWNER(kc85_state,kc85)
MCFG_HD44102_ADD(HD44102_0_TAG, SCREEN_TAG, 0, 0)
MCFG_HD44102_ADD(HD44102_1_TAG, SCREEN_TAG, 50, 0)
@@ -83,8 +83,8 @@ MACHINE_CONFIG_FRAGMENT( tandy200_video )
MCFG_DEFAULT_LAYOUT(layout_lcd)
- MCFG_PALETTE_LENGTH(2)
- MCFG_PALETTE_INIT_OVERRIDE(tandy200_state,tandy200)
+ MCFG_PALETTE_ADD("palette", 2)
+ MCFG_PALETTE_INIT_OWNER(tandy200_state,tandy200)
MCFG_HD61830_ADD(HD61830_TAG, XTAL_4_9152MHz/2/2, lcdc_intf)
MCFG_DEVICE_ADDRESS_MAP(AS_0, tandy200_lcdc)
diff --git a/src/mess/video/lviv.c b/src/mess/video/lviv.c
index c9e770e0277..ed7a4b47067 100644
--- a/src/mess/video/lviv.c
+++ b/src/mess/video/lviv.c
@@ -24,12 +24,12 @@ const unsigned char lviv_palette[8*3] =
};
-void lviv_state::palette_init()
+PALETTE_INIT_MEMBER(lviv_state, lviv)
{
int i;
for ( i = 0; i < sizeof(lviv_palette) / 3; i++ ) {
- palette_set_color_rgb(machine(), i, lviv_palette[i*3], lviv_palette[i*3+1], lviv_palette[i*3+2]);
+ m_palette->set_pen_color(i, lviv_palette[i*3], lviv_palette[i*3+1], lviv_palette[i*3+2]);
}
}
diff --git a/src/mess/video/mac.c b/src/mess/video/mac.c
index 9e9f34a857e..3ac1e80e00f 100644
--- a/src/mess/video/mac.c
+++ b/src/mess/video/mac.c
@@ -58,17 +58,17 @@ Apple color FPD 01 11 10 (FPD = Full Page Display)
PALETTE_INIT_MEMBER(mac_state,mac)
{
- palette_set_color_rgb(machine(), 0, 0xff, 0xff, 0xff);
- palette_set_color_rgb(machine(), 1, 0x00, 0x00, 0x00);
+ palette.set_pen_color(0, 0xff, 0xff, 0xff);
+ palette.set_pen_color(1, 0x00, 0x00, 0x00);
}
// 4-level grayscale
PALETTE_INIT_MEMBER(mac_state,macgsc)
{
- palette_set_color_rgb(machine(), 0, 0xff, 0xff, 0xff);
- palette_set_color_rgb(machine(), 1, 0x7f, 0x7f, 0x7f);
- palette_set_color_rgb(machine(), 2, 0x3f, 0x3f, 0x3f);
- palette_set_color_rgb(machine(), 3, 0x00, 0x00, 0x00);
+ palette.set_pen_color(0, 0xff, 0xff, 0xff);
+ palette.set_pen_color(1, 0x7f, 0x7f, 0x7f);
+ palette.set_pen_color(2, 0x3f, 0x3f, 0x3f);
+ palette.set_pen_color(3, 0x00, 0x00, 0x00);
}
VIDEO_START_MEMBER(mac_state,mac)
@@ -1030,7 +1030,7 @@ WRITE32_MEMBER(mac_state::dafb_dac_w)
if (m_rbv_count == 3)
{
- palette_set_color(space.machine(), m_rbv_clutoffs, rgb_t(m_rbv_colors[0], m_rbv_colors[1], m_rbv_colors[2]));
+ m_palette->set_pen_color(m_rbv_clutoffs, rgb_t(m_rbv_colors[0], m_rbv_colors[1], m_rbv_colors[2]));
m_rbv_palette[m_rbv_clutoffs] = rgb_t(m_rbv_colors[0], m_rbv_colors[1], m_rbv_colors[2]);
m_rbv_clutoffs++;
m_rbv_count = 0;
diff --git a/src/mess/video/mbee.c b/src/mess/video/mbee.c
index 805aea44af0..935add4c979 100644
--- a/src/mess/video/mbee.c
+++ b/src/mess/video/mbee.c
@@ -574,7 +574,7 @@ PALETTE_INIT_MEMBER(mbee_state,mbeeic)
r = level[((i>>0)&1)|((i>>2)&2)];
g = level[((i>>1)&1)|((i>>3)&2)];
b = level[((i>>2)&1)|((i>>4)&2)];
- palette_set_color(machine(), i, rgb_t(r, g, b));
+ palette.set_pen_color(i, rgb_t(r, g, b));
}
/* set up foreground palette (64-95) by reading the prom */
@@ -584,7 +584,7 @@ PALETTE_INIT_MEMBER(mbee_state,mbeeic)
r = level[((k>>2)&1)|((k>>4)&2)];
g = level[((k>>1)&1)|((k>>3)&2)];
b = level[((k>>0)&1)|((k>>2)&2)];
- palette_set_color(machine(), i|64, rgb_t(r, g, b));
+ palette.set_pen_color(i|64, rgb_t(r, g, b));
}
}
@@ -602,7 +602,7 @@ PALETTE_INIT_MEMBER(mbee_state,mbeepc85b)
r = level[((i>>0)&1)|((i>>2)&2)];
g = level[((i>>1)&1)|((i>>3)&2)];
b = level[((i>>2)&1)|((i>>4)&2)];
- palette_set_color(machine(), i, rgb_t(r, g, b));
+ palette.set_pen_color(i, rgb_t(r, g, b));
}
level[2] = 0xff;
@@ -614,7 +614,7 @@ PALETTE_INIT_MEMBER(mbee_state,mbeepc85b)
r = level[((k>>2)&1)|((k>>4)&2)];
g = level[((k>>1)&1)|((k>>3)&2)];
b = level[((k>>0)&1)|((k>>2)&2)];
- palette_set_color(machine(), i|64, rgb_t(r, g, b));
+ palette.set_pen_color(i|64, rgb_t(r, g, b));
}
}
@@ -630,7 +630,7 @@ PALETTE_INIT_MEMBER(mbee_state,mbeeppc)
r = (i & 1) ? 0xc0 : 0;
g = (i & 2) ? 0xc0 : 0;
b = (i & 4) ? 0xc0 : 0;
- palette_set_color(machine(), i, rgb_t(r, g, b));
+ palette.set_pen_color(i, rgb_t(r, g, b));
}
/* set up 8 high intensity colours */
@@ -639,6 +639,6 @@ PALETTE_INIT_MEMBER(mbee_state,mbeeppc)
r = (i & 1) ? 0xff : 0;
g = (i & 2) ? 0xff : 0;
b = (i & 4) ? 0xff : 0;
- palette_set_color(machine(), i, rgb_t(r, g, b));
+ palette.set_pen_color(i, rgb_t(r, g, b));
}
}
diff --git a/src/mess/video/mos6566.c b/src/mess/video/mos6566.c
index 8fae5339f33..131c20f4cd9 100644
--- a/src/mess/video/mos6566.c
+++ b/src/mess/video/mos6566.c
@@ -98,7 +98,7 @@ static int UNUSED_BITS[0x40] =
};
// VICE palette
-static const rgb_t PALETTE[] =
+static const rgb_t PALETTE_MOS[] =
{
rgb_t(0x00, 0x00, 0x00),
rgb_t(0xfd, 0xfe, 0xfc),
@@ -511,7 +511,7 @@ inline void mos6566_device::draw_background()
c = 0;
break;
}
- m_bitmap.plot_box(m_graphic_x, VIC2_RASTER_2_EMU(m_rasterline), 8, 1, PALETTE[c]);
+ m_bitmap.plot_box(m_graphic_x, VIC2_RASTER_2_EMU(m_rasterline), 8, 1, PALETTE_MOS[c]);
}
}
@@ -523,21 +523,21 @@ inline void mos6566_device::draw_mono( UINT16 p, UINT8 c0, UINT8 c1 )
c[0] = c0;
c[1] = c1;
- m_bitmap.pix32(VIC2_RASTER_2_EMU(m_rasterline), p + 7) = PALETTE[c[data & 1]];
+ 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[c[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[c[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[c[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[c[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[c[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[c[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[c[data]];
+ m_bitmap.pix32(VIC2_RASTER_2_EMU(m_rasterline), p + 0) = PALETTE_MOS[c[data]];
m_fore_coll_buf[p + 0] = data & 1;
}
@@ -551,21 +551,21 @@ inline void mos6566_device::draw_multi( UINT16 p, UINT8 c0, UINT8 c1, UINT8 c2,
c[2] = c2;
c[3] = c3;
- m_bitmap.pix32(VIC2_RASTER_2_EMU(m_rasterline), p + 7) = PALETTE[c[data & 3]];
+ m_bitmap.pix32(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[c[data & 3]];
+ m_bitmap.pix32(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[c[data & 3]];
+ m_bitmap.pix32(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[c[data & 3]];
+ m_bitmap.pix32(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[c[data & 3]];
+ m_bitmap.pix32(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[c[data & 3]];
+ m_bitmap.pix32(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[c[data]];
+ m_bitmap.pix32(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[c[data]];
+ m_bitmap.pix32(VIC2_RASTER_2_EMU(m_rasterline), p + 0) = PALETTE_MOS[c[data]];
m_fore_coll_buf[p + 0] = data & 2;
}
@@ -1362,24 +1362,24 @@ void mos6566_device::execute_run()
if (m_border_on_sample[0])
for (i = 0; i < 4; i++)
- m_bitmap.plot_box(VIC2_X_2_EMU(i * 8), VIC2_RASTER_2_EMU(m_rasterline), 8, 1, PALETTE[m_border_color_sample[i]]);
+ m_bitmap.plot_box(VIC2_X_2_EMU(i * 8), VIC2_RASTER_2_EMU(m_rasterline), 8, 1, PALETTE_MOS[m_border_color_sample[i]]);
if (m_border_on_sample[1])
- m_bitmap.plot_box(VIC2_X_2_EMU(4 * 8), VIC2_RASTER_2_EMU(m_rasterline), 8, 1, PALETTE[m_border_color_sample[4]]);
+ m_bitmap.plot_box(VIC2_X_2_EMU(4 * 8), VIC2_RASTER_2_EMU(m_rasterline), 8, 1, PALETTE_MOS[m_border_color_sample[4]]);
if (m_border_on_sample[2])
for (i = 5; i < 43; i++)
- m_bitmap.plot_box(VIC2_X_2_EMU(i * 8), VIC2_RASTER_2_EMU(m_rasterline), 8, 1, PALETTE[m_border_color_sample[i]]);
+ m_bitmap.plot_box(VIC2_X_2_EMU(i * 8), VIC2_RASTER_2_EMU(m_rasterline), 8, 1, PALETTE_MOS[m_border_color_sample[i]]);
if (m_border_on_sample[3])
- m_bitmap.plot_box(VIC2_X_2_EMU(43 * 8), VIC2_RASTER_2_EMU(m_rasterline), 8, 1, PALETTE[m_border_color_sample[43]]);
+ m_bitmap.plot_box(VIC2_X_2_EMU(43 * 8), VIC2_RASTER_2_EMU(m_rasterline), 8, 1, PALETTE_MOS[m_border_color_sample[43]]);
if (m_border_on_sample[4])
{
for (i = 44; i < 48; i++)
- m_bitmap.plot_box(VIC2_X_2_EMU(i * 8), VIC2_RASTER_2_EMU(m_rasterline), 8, 1, PALETTE[m_border_color_sample[i]]);
+ m_bitmap.plot_box(VIC2_X_2_EMU(i * 8), VIC2_RASTER_2_EMU(m_rasterline), 8, 1, PALETTE_MOS[m_border_color_sample[i]]);
for (i = 48; i < 53; i++)
- m_bitmap.plot_box(VIC2_X_2_EMU(i * 8), VIC2_RASTER_2_EMU(m_rasterline), 8, 1, PALETTE[m_border_color_sample[47]]);
+ m_bitmap.plot_box(VIC2_X_2_EMU(i * 8), VIC2_RASTER_2_EMU(m_rasterline), 8, 1, PALETTE_MOS[m_border_color_sample[47]]);
}
}
@@ -1931,24 +1931,24 @@ void mos6569_device::execute_run()
if (m_border_on_sample[0])
for (i = 0; i < 4; i++)
- m_bitmap.plot_box(VIC2_X_2_EMU(i * 8), VIC2_RASTER_2_EMU(m_rasterline), 8, 1, PALETTE[m_border_color_sample[i]]);
+ m_bitmap.plot_box(VIC2_X_2_EMU(i * 8), VIC2_RASTER_2_EMU(m_rasterline), 8, 1, PALETTE_MOS[m_border_color_sample[i]]);
if (m_border_on_sample[1])
- m_bitmap.plot_box(VIC2_X_2_EMU(4 * 8), VIC2_RASTER_2_EMU(m_rasterline), 8, 1, PALETTE[m_border_color_sample[4]]);
+ m_bitmap.plot_box(VIC2_X_2_EMU(4 * 8), VIC2_RASTER_2_EMU(m_rasterline), 8, 1, PALETTE_MOS[m_border_color_sample[4]]);
if (m_border_on_sample[2])
for (i = 5; i < 43; i++)
- m_bitmap.plot_box(VIC2_X_2_EMU(i * 8), VIC2_RASTER_2_EMU(m_rasterline), 8, 1, PALETTE[m_border_color_sample[i]]);
+ m_bitmap.plot_box(VIC2_X_2_EMU(i * 8), VIC2_RASTER_2_EMU(m_rasterline), 8, 1, PALETTE_MOS[m_border_color_sample[i]]);
if (m_border_on_sample[3])
- m_bitmap.plot_box(VIC2_X_2_EMU(43 * 8), VIC2_RASTER_2_EMU(m_rasterline), 8, 1, PALETTE[m_border_color_sample[43]]);
+ m_bitmap.plot_box(VIC2_X_2_EMU(43 * 8), VIC2_RASTER_2_EMU(m_rasterline), 8, 1, PALETTE_MOS[m_border_color_sample[43]]);
if (m_border_on_sample[4])
{
for (i = 44; i < 48; i++)
- m_bitmap.plot_box(VIC2_X_2_EMU(i * 8), VIC2_RASTER_2_EMU(m_rasterline), 8, 1, PALETTE[m_border_color_sample[i]]);
+ m_bitmap.plot_box(VIC2_X_2_EMU(i * 8), VIC2_RASTER_2_EMU(m_rasterline), 8, 1, PALETTE_MOS[m_border_color_sample[i]]);
for (i = 48; i < 51; i++)
- m_bitmap.plot_box(VIC2_X_2_EMU(i * 8), VIC2_RASTER_2_EMU(m_rasterline), 8, 1, PALETTE[m_border_color_sample[47]]);
+ m_bitmap.plot_box(VIC2_X_2_EMU(i * 8), VIC2_RASTER_2_EMU(m_rasterline), 8, 1, PALETTE_MOS[m_border_color_sample[47]]);
}
}
@@ -2079,57 +2079,57 @@ 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[0];
+ 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[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[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[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[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[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[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[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[0];
+ 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[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[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[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[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[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[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[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[0];
+ 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[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[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[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[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[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[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[0];
+ m_bitmap.pix32(VIC2_RASTER_2_EMU(m_rasterline), p + 0) = PALETTE_MOS[0];
m_fore_coll_buf[p + 0] = 0;
break;
}
@@ -2204,12 +2204,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[col];
+ m_bitmap.pix32(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[col];
+ m_bitmap.pix32(VIC2_RASTER_2_EMU(m_rasterline), p + i) = PALETTE_MOS[col];
m_spr_coll_buf[p + i] = sbit;
}
}
@@ -2252,12 +2252,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[col];
+ m_bitmap.pix32(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[col];
+ m_bitmap.pix32(VIC2_RASTER_2_EMU(m_rasterline), p + i) = PALETTE_MOS[col];
m_spr_coll_buf[p + i] = sbit;
}
}
@@ -2283,12 +2283,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[color];
+ m_bitmap.pix32(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[color];
+ m_bitmap.pix32(VIC2_RASTER_2_EMU(m_rasterline), p + i) = PALETTE_MOS[color];
m_spr_coll_buf[p + i] = sbit;
}
}
@@ -2309,12 +2309,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[color];
+ m_bitmap.pix32(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[color];
+ m_bitmap.pix32(VIC2_RASTER_2_EMU(m_rasterline), p + i) = PALETTE_MOS[color];
m_spr_coll_buf[p + i] = sbit;
}
}
@@ -2364,12 +2364,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[col];
+ m_bitmap.pix32(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[col];
+ m_bitmap.pix32(VIC2_RASTER_2_EMU(m_rasterline), p + i) = PALETTE_MOS[col];
m_spr_coll_buf[p + i] = sbit;
}
}
@@ -2394,12 +2394,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[color];
+ m_bitmap.pix32(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[color];
+ m_bitmap.pix32(VIC2_RASTER_2_EMU(m_rasterline), p + i) = PALETTE_MOS[color];
m_spr_coll_buf[p + i] = sbit;
}
}
@@ -2436,7 +2436,7 @@ void mos6566_device::draw_sprites()
UINT32 mos6566_device::screen_update(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect)
{
- bitmap.fill(PALETTE[0], cliprect);
+ bitmap.fill(PALETTE_MOS[0], cliprect);
if (m_on)
copybitmap(bitmap, m_bitmap, 0, 0, 0, 0, cliprect);
diff --git a/src/mess/video/mz700.c b/src/mess/video/mz700.c
index 17f4aa466f5..a006a36aac1 100644
--- a/src/mess/video/mz700.c
+++ b/src/mess/video/mz700.c
@@ -28,19 +28,17 @@
} while (0)
-void mz_state::palette_init()
+PALETTE_INIT_MEMBER(mz_state, mz)
{
int i;
- machine().colortable = colortable_alloc(machine(), 8);
-
for (i = 0; i < 8; i++)
- colortable_palette_set_color(machine().colortable, i, rgb_t((i & 2) ? 0xff : 0x00, (i & 4) ? 0xff : 0x00, (i & 1) ? 0xff : 0x00));
+ m_palette->set_indirect_color(i, rgb_t((i & 2) ? 0xff : 0x00, (i & 4) ? 0xff : 0x00, (i & 1) ? 0xff : 0x00));
for (i = 0; i < 256; i++)
{
- colortable_entry_set_value(machine().colortable, i*2, i & 7);
- colortable_entry_set_value(machine().colortable, i*2+1, (i >> 4) & 7);
+ m_palette->set_pen_indirect(i*2, i & 7);
+ m_palette->set_pen_indirect(i*2+1, (i >> 4) & 7);
}
}
@@ -50,7 +48,7 @@ UINT32 mz_state::screen_update_mz700(screen_device &screen, bitmap_ind16 &bitmap
UINT8 *videoram = m_videoram;
int offs;
- bitmap.fill(get_black_pen(machine()), cliprect);
+ bitmap.fill(m_palette->black_pen(), cliprect);
for(offs = 0; offs < 40*25; offs++)
{
@@ -62,7 +60,7 @@ UINT32 mz_state::screen_update_mz700(screen_device &screen, bitmap_ind16 &bitmap
color = m_colorram[offs];
code = videoram[offs] | (color & 0x80) << 1;
- m_gfxdecode->gfx(0)->opaque(bitmap,cliprect, code, color, 0, 0, sx, sy);
+ m_gfxdecode->gfx(0)->opaque(m_palette,bitmap,cliprect, code, color, 0, 0, sx, sy);
}
return 0;
@@ -82,7 +80,7 @@ UINT32 mz_state::screen_update_mz800(screen_device &screen, bitmap_ind16 &bitmap
{
UINT8 *videoram = m_videoram;
- bitmap.fill(get_black_pen(machine()), cliprect);
+ bitmap.fill(m_palette->black_pen(), cliprect);
if (m_mz700_mode)
return screen_update_mz700(screen, bitmap, cliprect);
diff --git a/src/mess/video/nascom1.c b/src/mess/video/nascom1.c
index 1a2356d3654..31099f5e6ed 100644
--- a/src/mess/video/nascom1.c
+++ b/src/mess/video/nascom1.c
@@ -17,7 +17,7 @@ UINT32 nascom1_state::screen_update_nascom1(screen_device &screen, bitmap_ind16
for (sx = 0; sx < 48; sx++)
{
- m_gfxdecode->gfx(0)->opaque(bitmap,cliprect, videoram[0x03ca + sx],
+ m_gfxdecode->gfx(0)->opaque(m_palette,bitmap,cliprect, videoram[0x03ca + sx],
1, 0, 0, sx * 8, 0);
}
@@ -26,7 +26,7 @@ UINT32 nascom1_state::screen_update_nascom1(screen_device &screen, bitmap_ind16
for (sx = 0; sx < 48; sx++)
{
- m_gfxdecode->gfx(0)->opaque(bitmap,cliprect, videoram[0x000a + (sy * 64) + sx],
+ m_gfxdecode->gfx(0)->opaque(m_palette,bitmap,cliprect, videoram[0x000a + (sy * 64) + sx],
1, 0, 0, sx * 8, (sy + 1) * 16);
}
}
@@ -41,7 +41,7 @@ UINT32 nascom1_state::screen_update_nascom2(screen_device &screen, bitmap_ind16
for (sx = 0; sx < 48; sx++)
{
- m_gfxdecode->gfx(0)->opaque(bitmap,cliprect, videoram[0x03ca + sx],
+ m_gfxdecode->gfx(0)->opaque(m_palette,bitmap,cliprect, videoram[0x03ca + sx],
1, 0, 0, sx * 8, 0);
}
@@ -50,7 +50,7 @@ UINT32 nascom1_state::screen_update_nascom2(screen_device &screen, bitmap_ind16
for (sx = 0; sx < 48; sx++)
{
- m_gfxdecode->gfx(0)->opaque(bitmap,cliprect, videoram[0x000a + (sy * 64) + sx],
+ m_gfxdecode->gfx(0)->opaque(m_palette,bitmap,cliprect, videoram[0x000a + (sy * 64) + sx],
1, 0, 0, sx * 8, (sy + 1) * 14);
}
}
diff --git a/src/mess/video/nc.c b/src/mess/video/nc.c
index 15125b7e31c..644af80c854 100644
--- a/src/mess/video/nc.c
+++ b/src/mess/video/nc.c
@@ -37,9 +37,9 @@ static const rgb_t nc_palette[NC_NUM_COLOURS] =
/* Initialise the palette */
-void nc_state::palette_init()
+PALETTE_INIT_MEMBER(nc_state, nc)
{
- palette_set_colors(machine(), 0, nc_palette, ARRAY_LENGTH(nc_palette));
+ palette.set_pen_colors(0, nc_palette, ARRAY_LENGTH(nc_palette));
}
diff --git a/src/mess/video/nes.c b/src/mess/video/nes.c
index 0bc0414aa97..a9a855bf774 100644
--- a/src/mess/video/nes.c
+++ b/src/mess/video/nes.c
@@ -19,9 +19,9 @@ void nes_state::video_start()
m_last_frame_flip = 0;
}
-void nes_state::palette_init()
+PALETTE_INIT_MEMBER(nes_state, nes)
{
- m_ppu->init_palette(machine(), 0);
+ m_ppu->init_palette(palette, 0);
}
diff --git a/src/mess/video/orion.c b/src/mess/video/orion.c
index b9ba0e475c9..2b061ee0df8 100644
--- a/src/mess/video/orion.c
+++ b/src/mess/video/orion.c
@@ -108,5 +108,5 @@ static const rgb_t orion128_palette[18] = {
PALETTE_INIT_MEMBER(orion_state,orion128 )
{
- palette_set_colors(machine(), 0, orion128_palette, ARRAY_LENGTH(orion128_palette));
+ palette.set_pen_colors(0, orion128_palette, ARRAY_LENGTH(orion128_palette));
}
diff --git a/src/mess/video/osi.c b/src/mess/video/osi.c
index b328de8e207..f8a494b11c1 100644
--- a/src/mess/video/osi.c
+++ b/src/mess/video/osi.c
@@ -5,18 +5,18 @@
PALETTE_INIT_MEMBER(sb2m600_state, osi630)
{
/* black and white */
- palette_set_color_rgb(machine(), 0, 0x00, 0x00, 0x00); // black
- palette_set_color_rgb(machine(), 1, 0xff, 0xff, 0xff); // white
+ palette.set_pen_color(0, 0x00, 0x00, 0x00); // black
+ palette.set_pen_color(1, 0xff, 0xff, 0xff); // white
/* color enabled */
- palette_set_color_rgb(machine(), 2, 0xff, 0xff, 0x00); // yellow
- palette_set_color_rgb(machine(), 3, 0xff, 0x00, 0x00); // red
- palette_set_color_rgb(machine(), 4, 0x00, 0xff, 0x00); // green
- palette_set_color_rgb(machine(), 5, 0x00, 0x80, 0x00); // olive green
- palette_set_color_rgb(machine(), 6, 0x00, 0x00, 0xff); // blue
- palette_set_color_rgb(machine(), 7, 0xff, 0x00, 0xff); // purple
- palette_set_color_rgb(machine(), 8, 0x00, 0x00, 0x80); // sky blue
- palette_set_color_rgb(machine(), 9, 0x00, 0x00, 0x00); // black
+ palette.set_pen_color(2, 0xff, 0xff, 0x00); // yellow
+ palette.set_pen_color(3, 0xff, 0x00, 0x00); // red
+ palette.set_pen_color(4, 0x00, 0xff, 0x00); // green
+ palette.set_pen_color(5, 0x00, 0x80, 0x00); // olive green
+ palette.set_pen_color(6, 0x00, 0x00, 0xff); // blue
+ palette.set_pen_color(7, 0xff, 0x00, 0xff); // purple
+ palette.set_pen_color(8, 0x00, 0x00, 0x80); // sky blue
+ palette.set_pen_color(9, 0x00, 0x00, 0x00); // black
}
/* Video Start */
@@ -150,8 +150,7 @@ MACHINE_CONFIG_FRAGMENT( osi600_video )
MCFG_SCREEN_SIZE(64*8, 32*8)
MCFG_SCREEN_VISIBLE_AREA(0*8, 64*8-1, 0, 32*8-1)
- MCFG_PALETTE_LENGTH(2)
- MCFG_PALETTE_INIT_OVERRIDE(driver_device, black_and_white)
+ MCFG_PALETTE_ADD_BLACK_AND_WHITE("palette")
MACHINE_CONFIG_END
MACHINE_CONFIG_FRAGMENT( uk101_video )
@@ -161,8 +160,7 @@ MACHINE_CONFIG_FRAGMENT( uk101_video )
MCFG_SCREEN_SIZE(64*8, 16*16)
MCFG_SCREEN_VISIBLE_AREA(0, 64*8-1, 0, 16*16-1)
- MCFG_PALETTE_LENGTH(2)
- MCFG_PALETTE_INIT_OVERRIDE(driver_device, black_and_white)
+ MCFG_PALETTE_ADD_BLACK_AND_WHITE("palette")
MACHINE_CONFIG_END
MACHINE_CONFIG_FRAGMENT( osi630_video )
@@ -172,6 +170,6 @@ MACHINE_CONFIG_FRAGMENT( osi630_video )
MCFG_SCREEN_SIZE(64*8, 16*16)
MCFG_SCREEN_VISIBLE_AREA(0, 64*8-1, 0, 16*16-1)
- MCFG_PALETTE_LENGTH(8+2)
- MCFG_PALETTE_INIT_OVERRIDE(sb2m600_state, osi630)
+ MCFG_PALETTE_ADD("palette", 8+2)
+ MCFG_PALETTE_INIT_OWNER(sb2m600_state, osi630)
MACHINE_CONFIG_END
diff --git a/src/mess/video/p2000m.c b/src/mess/video/p2000m.c
index 8b8ead9aab6..0c0b6030bc2 100644
--- a/src/mess/video/p2000m.c
+++ b/src/mess/video/p2000m.c
@@ -41,7 +41,7 @@ UINT32 p2000t_state::screen_update_p2000m(screen_device &screen, bitmap_ind16 &b
if (code < 32) code = 32;
}
- m_gfxdecode->gfx(0)->zoom_opaque(bitmap,cliprect, code,
+ m_gfxdecode->gfx(0)->zoom_opaque(m_palette,bitmap,cliprect, code,
videoram[offs + 2048] & 0x08 ? 0 : 1, 0, 0, sx, sy, 0x20000, 0x20000);
if (videoram[offs] & 0x80)
diff --git a/src/mess/video/pc1251.c b/src/mess/video/pc1251.c
index 1bf93ac97bd..e8dce7f3b85 100644
--- a/src/mess/video/pc1251.c
+++ b/src/mess/video/pc1251.c
@@ -125,14 +125,14 @@ UINT32 pc1251_state::screen_update_pc1251(screen_device &screen, bitmap_ind16 &b
for (x=RIGHT,y=DOWN, i=0; i<60; x+=3)
{
for (j=0; j<5; j++, i++, x+=3)
- m_gfxdecode->gfx(0)->opaque(bitmap,cliprect, m_reg[i],
+ m_gfxdecode->gfx(0)->opaque(m_palette,bitmap,cliprect, m_reg[i],
PC1251_CONTRAST,0,0,
x,y);
}
for (i=0x7b; i>=0x40; x+=3)
{
for (j=0; j<5; j++, i--, x+=3)
- m_gfxdecode->gfx(0)->opaque(bitmap,cliprect, m_reg[i],
+ m_gfxdecode->gfx(0)->opaque(m_palette,bitmap,cliprect, m_reg[i],
PC1251_CONTRAST,0,0,
x,y);
}
diff --git a/src/mess/video/pc1401.c b/src/mess/video/pc1401.c
index 4a8f088f1e4..24f828bd6f7 100644
--- a/src/mess/video/pc1401.c
+++ b/src/mess/video/pc1401.c
@@ -148,12 +148,12 @@ UINT32 pc1401_state::screen_update_pc1401(screen_device &screen, bitmap_ind16 &b
for (x=RIGHT,y=DOWN,i=0; i<0x28;x+=2)
{
for (j=0; j<5;j++,i++,x+=2)
- m_gfxdecode->gfx(0)->opaque(bitmap,cliprect, m_reg[i],CONTRAST,0,0,x,y);
+ m_gfxdecode->gfx(0)->opaque(m_palette,bitmap,cliprect, m_reg[i],CO