Previous 15994 Revisions Next

r1680 Thursday 14th February, 2008 at 00:36:45 UTC by Nathan Woods
Updated to MAME 0.123u1 core
[ROOT]whatsnew.txt
[docs]messnew.txt
[src/build]build.mak file2str.c png2bdc.c verinfo.c*
[src/emu]cheat.c cpuexec.c drawgfx.c drawgfx.h emu.mak inptport.c mame.c memory.c sound.c tilemap.c tilemap.h timer.c timer.h video.c
[src/emu/cpu]cpu.mak
[src/emu/cpu/adsp2100]adsp2100.c
[src/emu/cpu/arm7]arm7core.c arm7exec.c
[src/emu/cpu/e132xs]e132xs.c
[src/emu/cpu/f8]f3853.c
[src/emu/cpu/h83002]h8periph.c
[src/emu/cpu/i8039]i8039.c
[src/emu/cpu/m37710]m37710.c
[src/emu/cpu/m6502]m65ce02.c m65ce02.h opsce02.h
[src/emu/cpu/m6800]m6800.c
[src/emu/cpu/mips]mips3com.c
[src/emu/cpu/powerpc]drc_ops.c ppc_mem.c ppc_ops.c
[src/emu/cpu/sh2]sh2.c
[src/emu/cpu/sh4]sh4.c sh4.h
[src/emu/cpu/tlcs90]tlcs90.c
[src/emu/cpu/tms34010]tms34010.c
[src/emu/cpu/tms9900]99xxcore.h
[src/emu/cpu/z180]z180.c
[src/emu/drivers]xtal.h
[src/emu/machine]6522via.c 6526cia.c 6532riot.c 6840ptm.c 6850acia.c 74123.c 8237dma.c 8257dma.c ds2401.c ds2404.c idectrl.c intelfsh.c mb3773.c pc16552d.c pic8259.c pit8253.c rtc65271.c timekpr.c tmp68301.c wd33c93.c z80ctc.c z80dma.c z80sio.c
[src/emu/sound]2203intf.c 2608intf.c 2610intf.c 2612intf.c 262intf.c 3812intf.c es5503.c ics2115.c msm5205.c pokey.c scsp.c sound.mak upd7759.c wave.h ym2151.c ym2413.c ymf262.c ymf271.c ymf278b.c
[src/emu/video]crtc6845.c crtc6845.h mc6845.c* mc6845.h* s2636.c s2636.h tms34061.c voodoo.c
[src/mame]mame.mak mamedriv.c
[src/mame/audio]8080bw.c amiga.c cage.c dcs.c dkong.c exidy.c exidy440.c galaxian.c geebee.c gottlieb.c jaguar.c leland.c n8080.c segag80r.c snes.c taito_en.c vicdual.c warpwarp.c
[src/mame/drivers]1945kiii.c 20pacgal.c 8080bw.c acefruit.c acommand.c aeroboto.c aleck64.c alg.c arkanoid.c astinvad.c astrof.c atarisy1.c atetris.c backfire.c beaminv.c berzerk.c bestleag.c bigfghtr.c bishjan.c bloodbro.c bnstars.c calorie.c capbowl.c carrera.c cave.c cball.c ccastles.c centiped.c cherrym.c cherrym2.c clayshoo.c cliffhgr.c cloud9.c cninja.c cntsteer.c coinmstr.c combatsc.c contra.c coolpool.c couple.c cowrace.c cps2.c cps3.c crystal.c cshooter.c csk.c cultures.c cvs.c cybertnk.c dacholer.c dambustr.c darkhors.c darkmist.c dbz.c dday.c ddayjlc.c ddenlovr.c ddragon.c deco156.c deco32.c deco_mlc.c deniam.c dreamwld.c drmicro.c drtomy.c drw80pkr.c dunhuang.c dynadice.c dynax.c egghunt.c enigma2.c ettrivia.c exctsccr.c exedexes.c exerion.c exterm.c fastfred.c fcombat.c finalizr.c firebeat.c flower.c foodf.c funworld.c fuukifg2.c fuukifg3.c gaelco3d.c galaxian.c galivan.c galpani3.c gamecstl.c gameplan.c gberet.c gdrawpkr.c genesis.c gijoe.c goldstar.c good.c groundfx.c gstream.c gsword.c gticlub.c gunbustr.c gunsmoke.c halleys.c hanaawas.c higemaru.c hitme.c homedata.c hornet.c hyperspt.c hyprduel.c igs_180.c igs_m027.c ikki.c ironhors.c jackal.c jackpool.c jailbrek.c jalmah.c jedi.c jollyjgr.c jpmimpct.c kaneko16.c kchamp.c kinst.c koikoi.c konamigq.c konamigv.c konamigx.c ksys573.c laserbat.c limenko.c looping.c ltcasino.c lucky8.c m10.c* m107.c m72.c m92.c madalien.c magic10.c magicfly.c magmax.c malzak.c marinedt.c mario.c markham.c maxaflex.c mediagx.c megadriv.c megaplay.c megatech.c megazone.c merit.c metro.c mgolf.c midas.c midtunit.c midvunit.c midwunit.c midyunit.c midzeus.c miniboy7.c missile.c mitchell.c model2.c model3.c mogura.c mpu4.c mpu4drvr.c ms32.c murogem.c mw8080bw.c mwarr.c mystwarr.c namcofl.c namcoic.c namcona1.c namcond1.c namcos10.c namcos11.c namcos12.c namcos22.c namcos23.c naomi.c naughtyb.c neogeo.c nmg5.c nmk16.c nova2001.c nwk-tr.c nyny.c ohmygod.c olibochu.c onetwo.c overdriv.c pandoras.c panicr.c peplus.c pingpong.c pipeline.c pirates.c pkscram.c plygonet.c pmpoker.c policetr.c polyplay.c pooyan.c powerbal.c powerins.c ppmast93.c psikyo.c pturn.c punchout.c qdrmfgp.c qix.c quasar.c quizpani.c r2dtank.c rabbit.c raiden2.c rallyx.c rcasino.c retofinv.c rmhaihai.c rockola.c rocnrope.c royalmah.c rungun.c safarir.c sandscrp.c sbowling.c sbrkout.c scotrsht.c seattle.c segae.c segas16b.c segas24.c segas32.c segaybd.c seibuspi.c seta.c shaolins.c silkroad.c simpl156.c simpsons.c skyarmy.c skykid.c skylncr.c slapfght.c spacefb.c spcforce.c speglsht.c spiders.c sprcros2.c srmp6.c ssfindo.c ssingles.c sslam.c ssv.c stactics.c statriv2.c stfight.c strnskil.c stv.c subs.c supdrapo.c superchs.c superdq.c suprgolf.c system1.c system18.c taito_f3.c taitowlf.c talbot.c tatsumi.c tattack.c tceptor.c tecmosys.c tetrisp2.c tickee.c tmaster.c tmnt.c toaplan1.c toaplan2.c toki.c tp84.c trackfld.c trvmadns.c tubep.c tugboat.c tx1.c ultrsprt.c usgames.c vcombat.c* vegas.c vmetal.c vroulet.c vsnes.c wallc.c wardner.c wheelfir.c wilytowr.c wink.c wiping.c witch.c xexex.c xmen.c xyonix.c yumefuda.c zac2650.c zn.c zr107.c
[src/mame/includes]cvs.h dc.h fastfred.h m10.h* nova2001.h* qix.h
[src/mame/machine]amiga.c atari.c atarigen.c balsente.c cubocd32.c dc.c decocass.c galaxian.c harddriv.c irem_cpu.c irobot.c konamigx.c konamiic.c leland.c mcr.c midwayic.c mw8080bw.c n64.c namcoio.c nmk112.c nmk112.h pcshare.c psx.c snes.c stactics.c starwars.c stvcd.c ticket.c williams.c xevious.c
[src/mame/video]1942.c 1943.c 40love.c 4enraya.c actfancr.c aeroboto.c aerofgt.c airbustr.c alpha68k.c ampoker2.c amspdwy.c angelkds.c appoooh.c aquarium.c argus.c arkanoid.c armedf.c ashnojoe.c astrocde.c atari.c atarifb.c atarig1.c atarig42.c atarigt.c atarigx2.c atarimo.c atarisy1.c atarisy2.c atetris.c avgdvg.c badlands.c bagman.c bankp.c baraduke.c batman.c battlane.c battlex.c bbusters.c bfm_adr2.c bigstrkb.c bionicc.c bking.c blktiger.c blmbycar.c blockade.c bloodbro.c blstroid.c blueprnt.c bogeyman.c bombjack.c bosco.c brkthru.c bsktball.c bwing.c cabal.c canyon.c carjmbre.c cave.c cbasebal.c cclimber.c centiped.c chaknpop.c champbas.c changela.c circus.c circusc.c citycon.c cloak.c clshroad.c combatsc.c commando.c compgolf.c contra.c cop01.c cps1.c crbaloon.c crospang.c crshrace.c csk.c cvs.c cyberbal.c darius.c darkmist.c darkseal.c dbz.c dc.c dcheese.c dcon.c dday.c ddragon.c ddragon3.c ddrible.c deadang.c dec0.c dec8.c deco16ic.c deco32.c deco_mlc.c decocass.c deniam.c digdug.c djboy.c djmain.c dkong.c docastle.c dogfgt.c dooyong.c dragrace.c drgnmst.c drmicro.c dynduke.c eprom.c equites.c esd16.c espial.c exctsccr.c exedexes.c exerion.c exprraid.c f1gp.c fastfred.c fastlane.c fcombat.c finalizr.c firetrap.c firetrk.c fitfight.c flkatck.c flower.c flstory.c flyball.c foodf.c freekick.c fromanc2.c fromance.c funkybee.c funworld.c fuukifg2.c fuukifg3.c gaelco.c gaelco2.c gaiden.c galaga.c galaxian.c galivan.c gaplus.c gauntlet.c gberet.c gcpinbal.c gdrawpkr.c ginganin.c gladiatr.c glass.c gng.c goal92.c goindol.c goldstar.c gomoku.c goodejan.c gotcha.c gottlieb.c gotya.c grchamp.c gstriker.c gsword.c gtia.c gticlub.c gumbo.c gundealr.c gunsmoke.c hanaawas.c hcastle.c hexa.c hexion.c higemaru.c hng64.c holeland.c homedata.c homerun.c hyperspt.c hyprduel.c ikki.c inufuku.c iqblock.c ironhors.c itech32.c jack.c jackal.c jaguar.c jailbrek.c jalblend.c jcross.c kaneko16.c kangaroo.c karnov.c kchamp.c kickgoal.c kingobox.c klax.c kncljoe.c konamigx.c konamiic.c kopunch.c ksayakyu.c kyugo.c labyrunr.c ladybug.c ladyfrog.c lasso.c lastduel.c legionna.c lemmings.c liberate.c lkage.c lockon.c lordgun.c lvcards.c lwings.c m10.c* m107.c m52.c m57.c m58.c m62.c m72.c m90.c m92.c macrossp.c madmotor.c magmax.c mainsnk.c malzak.c mappy.c marineb.c mario.c markham.c marvins.c mayumi.c mcatadv.c mcr.c mcr3.c mcr68.c meadows.c megasys1.c megazone.c mermaid.c metlclsh.c metro.c midvunit.c midzeus2.c mikie.c mitchell.c mjkjidai.c mole.c mosaic.c mrdo.c mrjong.c ms32.c msisaac.c mugsmash.c mustache.c mystston.c mystwarr.c n8080.c namcona1.c namcos1.c namcos2.c namcos22.c namcos86.c naughtyb.c nemesis.c neogeo.c news.c ninjakd2.c nitedrvr.c nmk16.c nova2001.c nycaptor.c offtwall.c ohmygod.c ojankohs.c oneshot.c orbit.c othldrby.c pacland.c pacman.c pandoras.c paradise.c pass.c pbaction.c pcktgal.c pgm.c phoenix.c pingpong.c pirates.c pitnrun.c playch10.c playmark.c plygonet.c pokechmp.c polepos.c poolshrk.c pooyan.c popeye.c popper.c portrait.c powerins.c ppu2c0x.c prehisle.c psikyo.c psikyosh.c psychic5.c punchout.c pushman.c qix.c quasar.c quizdna.c quizpani.c raiden.c rallyx.c realbrk.c redclash.c relief.c renegade.c retofinv.c rockola.c rocnrope.c rpunch.c runaway.c rungun.c sauro.c sbasketb.c sbugger.c scotrsht.c sderby.c segag80r.c segaic16.c segaic24.c segas32.c seibuspi.c seicross.c sengokmj.c senjyo.c seta.c sf.c shadfrce.c shangkid.c shaolins.c shisen.c shootout.c shuuz.c sidearms.c sidepckt.c silkroad.c skullxbo.c skydiver.c skykid.c slapfght.c snk68.c solomon.c sonson.c spdodgeb.c speedatk.c speedbal.c speedspn.c splash.c sprcros2.c sprint2.c sprint4.c sprint8.c srumbler.c sshangha.c sslam.c ssozumo.c ssrj.c ssv.c stactics.c stadhero.c starshp1.c stfight.c stlforce.c strnskil.c stvvdp2.c suna8.c superqix.c suprloco.c suprnova.c suprridr.c suprslam.c system1.c system16.c tagteam.c tail2nos.c taito_b.c taito_f2.c taito_f3.c taito_l.c taitoic.c taitojc.c tank8.c tankbatt.c tankbust.c taotaido.c targeth.c tatsumi.c tbowl.c tceptor.c tecmo.c tecmo16.c tehkanwc.c terracre.c tetrisp2.c thedeep.c thepit.c thoop2.c thunderj.c tiamc1.c tigeroad.c timelimt.c timeplt.c tmnt.c toaplan1.c toaplan2.c toki.c toobin.c toypop.c tp84.c trackfld.c travrusa.c triplhnt.c trucocl.c tryout.c tsamurai.c tumbleb.c tunhunt.c turbo.c twin16.c twincobr.c tx1.c ultratnk.c unico.c usgames.c vastar.c vball.c victory.c videopin.c vindictr.c vulgus.c warpwarp.c wc90.c wc90b.c wecleman.c welltris.c wgp.c williams.c wiping.c wrally.c wwfsstar.c wwfwfest.c xain.c xevious.c xorworld.c xybots.c xyonix.c ygv608.c yiear.c yunsun16.c yunsung8.c zac2650.c zaccaria.c zaxxon.c zerozone.c zodiack.c
[src/mess]inputx.c mscommon.c mslegacy.c mslegacy.h
[src/mess/audio]t6721.c
[src/mess/devices]flopdrv.c thomflop.c
[src/mess/drivers]a2600.c a310.c abc80.c abc80x.c atarist.c cbmb.c dc.c einstein.c exidy.c nc.c pet.c ql.c tutor.c x68k.c
[src/mess/machine]6551.c 68901mfp.c 99_dsk.c amigacd.c amigafdc.c amigakbd.c apple2gs.c applefdc.c at29040.c bbc.c cbmb.c centroni.c coco.c compis.c corvushd.c electron.c europc.c gamecom.c gb.c hd63450.c i8271.c ibmpc.c kc.c kim1.c lisa.c lynx.c mac.c matsucd.c mc6843.c mm58274c.c mz700.c nec765.c nes_mmc.c osborne1.c pc_hdc.c pc_mouse.c pce.c pcf8593.c pdp1.c pet.c pmd85.c pokemini.c rp5c15.c rriot.c serial.c sgi.c sms.c svi318.c sym1.c thomson.c tms5501.c tms9901.c tms9902.c tx0.c vc1541.c vectrex.c wd17xx.c z80dart.c zx.c
[src/mess/osd/winui]winui.mak
[src/mess/video]abc80.c abc80x.c aim65.c amstrad.c apple2.c aquarius.c atarist.c cbmb.c cdp1861.c cdp1864.c coco3.c gb.c m6847.c microtan.c osi.c smsvdp.c ted7360.c thomson.c trs80.c vectrex.c x68k.c zx8301.c
[src/osd/windows]windows.mak
[src/osd/winui]mui_main.c winui.mak

whatsnew.txt
r1679r1680
10.123
2-----
3
4
5MAMETesters Bugs Fixed
6----------------------
7taito_f3.c0122u8red [Aaron Giles]
8dubugchunklength0122u7gre [Aaron Giles]
9m62.c0122u7yel [Aaron Giles]
10qix.c0122u8red [Atari Ace]
11yard.c0122u7yel [Aaron Giles]
12
13
14
15Source Changes
16--------------
17Fixed crash in debugcmt with starting with no game on the command-line.
18[Andrew Gardner]
19
20Fixed PSR transfers in the ARM7 core. [R. Belmont]
21
22Fixed regression in cpu_spinuntil* calls that broke a number of games.
23[Aaron Giles]
24
25Fixed ADPCM in m62 games. Did some additional cleanup. [Aaron Giles]
26
27Fixed palette gradient for promutrv. [Pierpaolo Prazzoli]
28
29Fixed watchdog behavior when not explicitly specified. [Aaron Giles]
30
31Fixed sprite placement again in chinagat driver. [Aaron Giles]
32
33Fixed incorrect default screen siz
34
35
36
37New clones added
38----------------
39Vs. Janshi Brandnew Stars (MegaSystem32 Version) [David Haywood]
40
41
42
430.122u8
44-------
45
46
47MAMETesters Bugs Fixed
48----------------------
49stadhero0122u3gra [RansAckeR]
50wboy3_0119u3gra [RansAckeR]
51zerohour0122u6gra [RansAckeR]
52strahl0122u6yel [Mamesick]
53cmv801_0116gra [RansAckeR]
54
55
56
57Source Changes
58--------------
59Added deprecat.h that contains some deprecated/discouraged contructs.
60The idea is to create extra work if a driver wants to use these and
61hopefully gives an incentive to look for an alternate solution. Added
62#include of deprecat.h that rely on these contructs. Removed a bunch
63of unneccassary #include's from these files. [Zsolt Vasvari]
64
65Simplified Star Fire driver. [Zsolt Vasvari]
66
67drawgfx changes: [Zsolt Vasvari]
68 - Removed copybitmap_remap and copyscrollbitmap_remap, neither which
69    was used by anybody
70 - Removed some obsolete commented out code
71 - Fixed up some comments
72 - Removed TRANSPARENCY_NONE case from copybitmap_core, which can
73    never happen
74 - Removed TRANSPARENCY_BLEND completely and TRANSPARENCY_BLEND_RAW
75    as an option to copybitmap. Source tree needs to be recompiled
76    as the transparancy mode enum has changed.
77 - Removed TRANSPARENCY_NONE_RAW, TRANSPARENCY_PENS_RAW and
78    TRANSPARENCY_PEN_TABLE_RAW as they were no longer used.
79 - Changed copybitmap and copyscrollbitmap. There are now 2 versions
80    of each, one without and with transparency.
81
82Fixed crash in masao. [couriersud]
83
84Corrected previous i0851 timer fix to use more accurate IE SFRs.
85[Jim Stolis]
86
87jedi.c updates: [Zsolt Vasvari]
88 - Changed video code to directly manipulate the game bitmap
89 - Background smoothing now happens at the same time as the background
90    is drawn
91
92Fixed the CPS driver to at least display the correct clock in the
93driver info, by degrading the clock through alternate means.
94[David Haywood]
95
96m62.c changes: [couriersud]
97 * fixed wrong resistor value (22K to 2.2K) - verified on spelunkr
98    and kidniki hires pcb pictures
99 * Changed resistor network calculation based on assumption that cs
100    line is active either on tiles or sprites color prom.
101
102Simplified the video code for crgolf. [Zsolt Vasvari]
103
104Added PCB layouts for Penguin Bros & Puzzle De Bowling based on
105Hi-res pics. Corrected the seta2.c 68301 base clock as 50MHz / 3
106(16.66666MHz) as all the Seta2 hardware has a 50MHz OSC. Secondary OSC
107are for other chips (28MHz and or 32.53047MHz). [Brian Troha]
108
109Simplified video code and adjusted some set names in the leland
110driver. [Zsolt Vasvari]
111
112Replaced tables with equations in the Sega C2 driver.
113[Nicola Salmoria]
114
115Added checks for CROSS_BUILD=1 to omit building m68kmake.exe,
116verinfo.exe, png2bdc.exe and file2str. Enables building mame using
117mingw on linux. [couriersud]
118
119Various Irem driver updates: [Aaron Giles]
120 * Properly tagged m52 and m62 sound boards, plus variants.
121 * Updated all connected drivers.
122 * Merged memory maps.
123 * Proper video timing in 10 yard fight.
124 * Converted troangel to tilemaps.
125 * Moved definitions to header files.
126 * Updated mpatrol, yard to use resnet for colors.
127 * Renamed mpatrol -> m52
128 * Renamed troangel -> m57
129 * Renamed yard -> m58
130
131Cleaned up 20pacgal driver, including driver state. Tried improving
132on the ROM mirroring, without any success. [Zsolt Vasvari]
133
134Removed colortables from a number of drivers, as part of a larger
135move to phase out old-style colortables: gotya, gyruss, ampoker,
136circusc, clshroad, champbas, 1943, lucky8, olibochu, yamato,
137appoooh, bking, bladestl, blueprnt, carpolo, centiped, cop01,
138cosmic, ddrible, irobot, ace, alpha68k, arabian, bfm_sc2, carjmbre,
139cclimber, cherrym2, combatsc, contra, fastlane, hcastle, labyrunr,
140cham24, multigam. [Zsolt Vasvari]
141
142Removed non-existent, second M6295 from Hit the Ice. Fixes missing
143sounds (e.g. team select screen). Hit the Ice/Violence Fight now
144share the same sound CPU memory maps. [Philip Bennett]
145
146Improved DIP switches according to manuals for the following drivers:
147wboy, chplft, extdwnhl, zingzip, zaxxon, congo, vanguard, zarzon,
148nibbler, segag80r.c, yard, kaneko16.c. [RansAckeR]
149
150Verified the sound roms for Rock'n 3 and added proper names. Added
151PCB layout for sound rom board only. [Brian Troha]
152
153Cleaned up Time Pilot sound board implementation: [Aaron Giles]
154 * full memory maps
155 * partial machine driver removes need for replicating filtering logic
156 * updated all relevant drivers
157
158Cleaned up Time Pilot and Tutankham drivers: [Aaron Giles]
159 * correct clocks where possible
160 * merged memory maps
161 * fully decoded memory maps
162 * replaced hacky sprite rendering in Time Pilot with partial updates
163 * save state support
164 * removed Power Surge kludge, replaced with unmapped handler control
165 * Tutankham runs at 60fps, with IRQs every other frame
166 * Proper IRQ ack in Tutankham
167 * Proper NMI generation in Time Pilot
168
169Cleaned up pooyan driver. Save states, full memory maps, proper NMI
170generation, etc. Flipped video to align better with Time Pilot.
171[Aaron Giles]
172
173Changed 6840 interrupt handling to work like the recent 6821 changes.
174Updated MPU4 driver accordingly. Updated Scorpion 2 driver to match
175MPU4 coding style. [James Wallace]
176
177Resolved all unknown dips in the galpani2 driver according to kaneko's
178docs, unified memory maps of both CPUs and repositioned a pair of
179graphic ROMS. [Luis Faria]
180
181Made some minor improvements to 1942.c & 1943.c DIPs. Improved
182segas16a.c, segas16b.c & system16.c DIPs and added DIP locations
183from manuals. [RansAckeR]
184
185Removed distinction between *_gettotalcycles() and
186*_gettotalcycles64(). All functions now return 64-bit results. Updated
187all call sites appropriately. [Aaron Giles]
188
189Further improvements to SCSP FM. [kingshriek]
190
191Moved cpu_getiloops() and cpu_scalebyfcount() to deprecat.h. Added
192#include "deprecat.h" where necessary to make this happen. Cleaned up
193cpuexec.c/.h to latest core style. Cleaned up implementation of
194extended INP header in inptport.c. Removed external access to
195cycles_currently_ran(). Replaced use of cycles_currently_ran() in
196v9938 code with mame_rand(), since that is effectively the same thing.
197[Aaron Giles]
198
199Added dip locations to about half the games in seta.c. [Brian Troha]
200
201Removed champbas color PROM. Now uses TRANSPARENCY_PENS instead of
202TRANSPARENCY_COLOR. Hooked up palette bank selector from schematics,
203though I am not sure if it is actually used by the code. Changed set
204names to match title screen, which is why baseball is spelt as
205"Base Ball". [Zsolt Vasvari]
206
207Some minor cleanup to the equites driver, including memory map
208merging. [Aaron Giles]
209
210Added new option VIDEO_UPDATE_SCANLINE, which cases VIDEO_UPDATE to
211be called for every visible scanline. Removed manual implementation
212of this in timeplt, in favor of using the new flag. There are
213probably many more drivers that can leverage this. [Aaron Giles]
214
215Added stream_get_sample_rate(), stream_get_time(), and
216stream_get_sample_period(). These functions are not really tested yet
217-- make sure they give reasonable results when first used! Updated
218streams.h header to latest core style. [Aaron Giles]
219
220Fixed reset crashes in all Z180 games. Removed the various busy loop
221and non-exact optimzations from the Z180 core. [Zsolt Vasvari]
222
223Correct colors in Birdie King 3 -- just needed a new dump. Fixed
224incorrect ROM names. Switched color decoding to use the resnet code.
225[Zsolt Vasvari]
226
227Cleaned up the rockola.c driver. Fixed dip switches for all games.
228Added notes about the games. [stephh]
229
230Reorganized exidy440 audio code to make it easier to eventually use
231the MC3417/18 emulation directly. Added MC3418 variant support to the
232HC55516 audio code. [Zsolt Vasvari]
233
234Updated williams driver to use VIDEO_UPDATE_SCANLINE (most bitmap-
235based drivers should.) Converted to 32bpp to catch mid-screen palette
236tweaks. Removed some unnecessary read/write handlers. [Aaron Giles]
237
238Improved colors in circusc, gyruss, gotya with the resnet code.
239[Zsolt Vasvari]
240
241Significant improvements to Lock-On. Added POLL input handling to the
242NEC V20/V30 core. [Philip Bennett]
243
244Changed debugger-related code to be based off a new makefile define
245(DEBUGGER) which sets a new compile-time define (ENABLE_DEBUGGER).
246This means that MAME_DEBUG no longer means "enable debugger", it
247simply enables debugging features such as assertions and debug code
248in drivers. Also removed the various levels of opbase protection in
249memory.h and always just turned on full bounds checking. [Aaron Giles]
250
251Added some instructions to the H8/30xx CPU: [Luca Elia]
252  or.l ERs, ERd
253  rotl/shal.l ERd
254  not.l/neg.l ERd
255  exts.w Rd
256  sub/or/xor.l #Imm:32, ERd
257  bset/bnot/bclr.b Rn, @ERd
258  bst/bist.b #Imm:3, @ERd
259  bnot.b #Imm:3, @ERd
260
261Added H8/3007 & H8/3044 variants with their memory maps. Preliminary
262implementation of the H8/3007 timers. [Luca Elia]
263
264Added AM_WRITEONLY as a shortcut for AM_WRITE(MWAx_RAM). [Aaron Giles]
265
266Cleaned up Kangaroo driver: [Aaron Giles]
267 * documented MB8841 (needs to be decapped to get code)
268 * proper video timing
269 * full memory maps
270 * simplified and more accurate video logic
271 
272More opcode improvements to Risky Challenge. [robiza]
273
274Added DIP locations to bking.c [RansAckeR]
275
276
277
278New games added or promoted from NOT_WORKING status
279---------------------------------------------------
280Wheels Runner [Luca Elia]
281
282
283
284New clones added
285----------------
286Lock-On (rev. C) [Philip Bennett]
287Progressive Music Trivia (Question set 4) [Andrew Gardner]
288
289
290
291New games marked as GAME_NOT_WORKING
292------------------------------------
293Puzzlet (Japan) [Luca Elia]
294Galaxy Games BIOS [Andrew Gardner]
295
296
297
2980.122u7
299-------
300
301
302MAMETesters Bugs Fixed
303----------------------
304tylz0122u5red [Zsolt Vasvari]
305stadhero0122u3gre [Zsolt Vasvari]
306stadhero0122u3ora [Zsolt Vasvari]
307asterix_1055gre [couriersud]
308blktiger37b15gre [couriersud]
309newui0118u4ora [Atari Ace]
310mpatrol0117u2gre [Aaron Giles]
311realbrk0111u4gra [Brian Troha]
312schmisr0111u5gra [Brian Troha, partial fix]
313penbros0111u5gra [Brian Troha]
314ninjakd2_0111u3gra [Nicola Salmoria]
315mnight0102gre [Nicola Salmoria]
316toki060gre [robiza, Corrado Tomaselli]
317
318
319
320Source Changes
321--------------
322Added internal divider on m680* series CPUs (except the original
323m6800). Updated clocks on all games using them to remove the explicit
324divider. [Aaron Giles]
325
326Reverted experimental D3D fix, since it breaks switchres.
327[Aaron Giles]
328
329dkong updates: [couriersud]
330 * fix dkong sound following Clock Divider update
331 * updated to use XTAL_*
332 * revert a change after sound regression in dkong.
333
334i8085.c updates: [couriersud]
335 * 8085 has an internal clock divider by 2. Changed i8085.c to reflect
336    this for I8085. I8080 still at 1.
337 * Changed driver clocks to reflect internal clock divider
338 * Added some FIXME: comments where clocks for I8085 are outside specs
339
340Space Fighter Mark II: [Zsolt Vasvari]
341 - Changed year to 1979 as per Guru's contact
342 - Renamed set 2 ROMs to allow merging
343 - Removed experimental code left in there
344
345phoenix.c updates: [couriersud]
346 * Modified I8085 clock
347 * Added dip locations
348 * consolidated inputs
349 * tagged inputs
350 * combined memory maps
351 * fixed sound issue related to (auto) save states
352
353pleiads updates: [couriersud]
354 * video timing from schematics
355 * palette from schematics (resnet.h)
356 * no more colortable
357
358survival updates: [couriersud]
359 * palette from schematics (resnet.h)
360
361Removed bogus (bad) dump of Heated Barrel US set 2. [Brian Troha]
362
363RSP Changes: [SGINut, Nicola Salmoria, Ville Linde]
364 - Initialize RSP registers to 0 in lieu of mame_rand
365 - Re-fix RSP single-stepping mode when set by another CPU
366 - Reading the RSP PC returns only the least significant 12 bits
367 - Fixed flag behavior when read out via CFC2
368 - Fixed RSP VRCP instruction to match the real hardware results
369 - Corrected VRCP element lookup
370 - Corrected unaligned DMA behavior
371
372Removed all palette_X_r functions in favor of direct RAM reads.
373[Zsolt Vasvari]
374
375Removed no longer applicable assert from VIDEO_START(generic). Removed
376VIDEO_START(generic) from drivers that didn't need it. Removed
377MDRV_VIDEO_START(generic_bitmapped) from drivers that don't need it.
378[Zsolt Vasvari]
379
380Made detection of dynamic attempts to install ROM/RAM handlers more
381aggressive. Previous checks would not catch modifications in
382DRIVER_INIT or MACHINE_START calls. Fixed a number of cases of
383incorrect usage throughout the drivers. [Aaron Giles]
384
385Changed one of the cheat calls back to using more generic switch
386detection so they can be triggered via joysticks. [Aaron Giles]
387
388Renamed sauro.c sp0256 internal rom to "sp0256-al2.bin".
389Removed BAD_DUMP flag from it as well. [couriersud]
390
391Marked HD6309 as divide-by-4 internally. Updated drivers accordingly.
392[Aaron Giles]
393
394Major cleanup to the ddragon driver: [Aaron Giles]
395 - improved video and interrupt timing
396 - consolidated common memory maps and input ports
397 - added save state support
398 - correct clocks
399
400blktiger.c updates: [couriersud]
401 * combines memory maps
402 * input ports were tagged
403 * all reads use input port tags
404 * added dip switch locations from Romstar manual
405
406Added all known variants of the tms5110 as proper chips. Updated
407dkong, cvs and scramble to use new chips. [couriersud]
408
409Converted atarifb.c to tilemaps. [Zsolt Vasvari]
410
411Switched namcos11/namcos12 over to memory_configure_bank /
412memory_set_bank. Simplified golgo 13 gun reading. [smf]
413
414mpatrol driver cleanup [Aaron Giles]
415 - merged memory maps
416 - complete memory map
417 - correct video timing
418 - correct CPU clocks
419 - replaced protection hack with actual implementation
420 - cleaned up inputs
421
422Added tilemap_get_scrollx / tilemap_get_scrolly. [Nicola Salmoria]
423
424Preserve fractional part of sample offset when looping in SCSP. Fixes
425remaining pitch stability problems. Fixed minor issue with timers
426B&C expiring. [kingshriek, R. Belmont]
427
428auto_malloc() once again actually fails when out of memory.
429[Aaron Giles]
430
431Switched zn.c to use MDRV_IMPORT_FROM. [smf]
432
433mario.c changes: [couriersud]
434 * removed all traces to video/generic.h
435 * fix flipscreen issue with autosave
436 * on a hires pcb picture, verified resistor and capacitor values
437
438Added dip locations to Real Break. Filled in a couple of dips for the
439Pachinko Gindama Shoubu games. [Brian Troha]
440
441Fixed invalid memory_install_*_handler calls in drivers/williams.c.
442Emulated external OR circuit for all drivers using the PIA chip. This
443used to be internal to the PIA emulation, but, in fact, this is
444external logic. The PIA has two seperate INTA and INTB out lines.
445This fixes at least PlayBall. [Zsolt Vasvari]
446
447Added the ability to the HC55516 emulator to take an external
448osciallator. Updated Mouse Trap to use the new interface.
449[Zsolt Vasvari]
450
451Cleaned up and merged ninjakd2, mnight and omegaf drivers into a
452single driver. Additionally: [Nicola Salmoria]
453 - added flip screen support to all games
454 - fixed sprite overdraw mode:
455    - ninjakd2 congratulations screen (e.g. stage 3) shows japanese
456       characters which were previously missing
457    - in ninjakd2, at the beginning of a level items are visible
458       during the initial fade in. I'm not sure if this is correct
459       but the other effects wouldn't work otherwise
460    - in mnight attract mode, when the big ship is firing the other
461       sprites no longer leave trails
462    - in mnight at the end of a level the screen is slowly filled
463       with balls and then slowly cleared to begin the following
464       level. Same effect in the death sequence during attract mode.
465 - added proper computation of sprites to be drawn taking into
466    account double size sprites. This fixes sticking shots in mnight
467    without need for a hack.
468 - lowered ninjakd2 PCM playback rate to 13020 (from 16000). This
469    seems to sound better and is a round division from one of the
470    master clocks.
471 - removed ROM patch that was used to avoid the input protection in
472    omegaf, added a rough but effective protection simulation.
473 - corrected some dip switches
474 - hooked up sound cpu reset line
475 - simplified ROM loading for the older games swizzling address lines
476    in driver init.
477
478Added MDRV_SOUND_ROUTE_EX to specify target input channel. Added
479input id to route struct. Fixed DISCRETE_INPUT_STREAM and added input
480channel # to DISCRETE_INPUT_STREAM. [couriersud]
481
482Fixed default debugger memory view width for CPUs with >byte-sized
483minimum. Made menu updating dynamic at click time, fixing issues with
484incorrect checkmarks. [Aaron Giles]
485
486Fixed Ninja Kuna. Cleaned up memory maps. Renamed files to ninjakun.c.
487[Zsolt Vasvari]
488
489Added MC3417 and MC3418 variants to the HC55516 sound emulation.
490Changed Mouse Trap to use MC3417. [Zsolt Vasvari]
491
492Fixed saving i8085 callbacks across a reset. Added 'pull' callback for
493the SID pin.  This is needed by the Red Alert voice board.
494[Zsolt Vasvari]
495
496Made the text displayed by the various UI sliders more intelligent.
497Basically, it will only print an index for an item if there are
498multiple of a given type. [Zsolt Vasvari]
499
500Updated jailbrek clocks and video timing based on measurements.
501[Aaron Giles]
502
503Fixed i8051 timers from firing when not enabled. Checking TCON alone
504is not enough to invoke timers. Added IE SFR flags in conditional.
505[Jim Stolis]
506
507Added a _CALL variant to all prototype macros. The use of these
508should make it easier to change the signiture of these functions in
509the future. Replaced existing calls with macro where appropriate.
510[Zsolt Vasvari]
511
512Removed VIDEO_START_CALL(generic) from all drivers not needing it,
513which were all of them. Removed VIDEO_START_CALL(generic_bitmapped)
514from jpmimpct. [Zsolt Vasvari]
515
516Changed YM2203 clock in stfight to 3MHz (compared against OST)
517[Yasuhiro Ogawa]
518
519Improved linear zoom effect resolution to address gaps in CPS3
520rendering. [OopsWare]
521
522Rewrote and modernized the redalert driver: [Zsolt Vasvari]
523 - correct colors -- in places different from the manual's description,
524    but matches the flyer perfectly
525 - added speech
526 - fixed AY-8910 sounds
527 - odds and ends
528 - corrected colors in Demoneye-X
529 - added some sound to Demoneye-X
530 - marked Demoneye-X it NOT_WORKING, due to the (still) missing 3rd
531    gfx layer that makes it impossible to pass the 2nd level.
532
533Added all the known Naomi BIOS dumps along with descriptions and
534information about region bytes & version numbers. [Brian Troha]
535
536Removed the freely distributable Exidy games' dependency on Berzerk.
537[Zsolt Vasvari]
538
539Added support for the BLX opcode in ARM7 THUMB mode. [SGINut]
540
541Verified DIP locations from manuals for scramble and 800fath.
542[RansAckeR]
543
544Changed S14001A emulator to allow setting the clock frequency instead
545of the clock multiplier. This is how the real chip works. Changed the
546Berzerk driver to set the S14001A clock as per the schematics. 
547[Zsolt Vasvari]
548
549Removed the use of the global Machine from a number of places in the
550code. [Zsolt Vasvari]
551
552Fixed issues flagged by MSVC warning C4305 (type truncation). Almost
553all of these are harmless double->float narrowing in initializers, but
554one warning spotlighted a bug in segasyse.c, where code to use a
555higher sprite number had no effect due to the insufficient range of
556UINT8. [Atari Ace]
557
558Removed /wd4550 for VS7/VS71 compilers (expression evaluates to a
559function which is missing an argument list). Fixed some VS7-specific
560issues (OPTIMIZE=0 at least compiles now). [Atari Ace]
561
562Added a missing case statement in sm8500d.c, noticed while reviewing
563dead code warnings. [Atari Ace]
564
565Corrected Diet gogo h6280 clock so that it behaves correctly with
566Charles Macdonald fix to the cpu core. Verified and corrected
567frequencies and pin 7 okim6295 on the following games:
568The new zealand story (3 z80 version), Trio The punch, Vandyke,
569paradise.c games, Downtown, Shaolin's Road and Twins.
570[Corrado Tomaselli]
571
572Removed all peplus memory hacks and game specific DRIVER_INIT. There
573are now just two DRIVER_INIT, one for normal boards and one for
574superboards. Temporarily disabled AutoHold Cheat but documented
575addresses for future update. [Jim Stolis]
576
577Added further unencrypted opcodes to risky challenge. The game now
578boots with the intro animation. [robiza]
579
580
581
582New clones added
583----------------
584Jokers Wild Poker (PP0065) [Jim Stolis]
585Double Down Stud Poker (PP0250) [Jim Stolis]
586Standard Draw Poker (PP0447) [Jim Stolis]
587Night Stocker (set 2) [Andrew Gardner]
588Trivial Pursuit (Genus I) (set 2) [Andrew Gardner]
589
590
591
5920.122u6
593-------
594
595
596MAMETesters Bugs Fixed
597----------------------
598pangpoms098u3ora [Brian Troha]
599cuebrckj0102u5gre [Zsolt Vasvari]
600astinvad0106u11gre [Aaron Giles]
601victory137b4gre [Zsolt Vasvari]
602victory37b16gre [Zsolt Vasvari]
603dcs057ora [Aaron Giles]
604pleiads0111u4gre [Robbert]
605armwrest35b9yel [David Haywood]
606gstrik20105u4gra [Brian Troha]
607narc060gra [Aaron Giles]
608mia0106u5gra [RansAckeR]
609nss_smw0115ora [Atari Ace]
610darkplnt0119u3yel [Atari Ace]
611mhhonban0120u3gra [RansAckeR]
612rollerg0111u5gra [RansAckeR]
613bionicc0109ora [RansAckeR]
614lcasino0111ora [RansAckeR]
615megaplay.c0122u4red [Atari Ace]
616nmnlnd0122u3yel [Mamesick]
617cocktail0119yel [Robbert]
618tokisens0122u3gra [RansAckeR]
619alleymas0119u3gre [RansAckeR]
620crbaloon36finalgre [Zsolt Vasvari]
621topsecrt0109gre2 [Bryan McPhail]
622quasar0122u5red [Zsolt Vasvari]
623stadhero0122u3gra [RansAckeR]
624
625
626
627Source Changes
628--------------
629Swinging Singles cleanup: [Tomasz Slanina]
630 - hooked up crt6845
631 - converted to tilemaps
632 - simplified protection(?) emulation
633 - removed tilemap, a bit more low level video hw emulation
634 - fake colors
635
636Lowerd FPS in lasso.c to avoid corrupting Chameleon's high score
637table. [Zsolt Vasvari]
638
639Removed obsolete uitext.c and all references to it. [Aaron Giles]
640
641Some more modernization/clean-up in the exidy driver. [Zsolt Vasvari]
642
643Added VIDEO_ALWAYS_UPDATED for reliable collision detection in the
644CVS driver. [Zsolt Vasvari]
645
646Cleaned up astinvad driver: [Aaron Giles]
647 * Proper video timing
648 * Hooked up 8255 PPIs
649 * Correct interrupt timing
650 * Consolidated code into single file
651
652i8039.c/mario.c updates: [couriersud]
653 * fixed movd instructions
654 * add MB8884 and M58715 cpu types
655 * moved timer hack to M58715
656 * added ram_mask for internal ram access
657 * added R.A11 as 'M' to dasm flags
658 * added EA "IO" port
659 * mario now uses M58715 as sound cpu
660 * hooked up EA line for M58715
661 * fixed portA startup value
662 * documented hardware changes to use a I8039 on a mario board
663
664sauro.c: [couriersud]
665 * revert promsize to 256 for trckydoc
666
667Added XTAL clocks to zaxxon.c. [Aaron Giles]
668
669Cleaned up cojag/jaguar driver: [Aaron Giles]
670 * proper video timing, configured by the chipset
671 * 32-bit rendering, removing 16bpp hacks
672 * support for borders
673 * proper object processor timing, including multiple passes per line
674 * added R3041 as a clone of the R3000
675 * fixed XTALs based on documentation
676
677Consolidated exidy and victory drivers. Removed complicated dirty
678tracking from victory.c. Reorganized the exidy audio hardware code.
679Changed Targ to use a loaded PROM instead of a hard-coded one. Renamed
680Side Trak to Side Track as per the title screen. [Zsolt Vasvari]
681
6826821 PIA changes: [Zsolt Vasvari]
683 - Added orthogonal accessors
684 - Removed hacky update_shared_irq_handler(), now the same
685   IRQ callback maybe called multiple times, but this shouldn't
686   be a problem
687 - IRQ lines are cleared on a reset
688
689Disabled code in the TMS5220 that set the Buffer Empty flag after a
690stop frame. This fixes Victory. This might be the incorrect fix but
691the old code wasn't working either. [Zsolt Vasvari]
692
693Hooked up revx dcs reset line. Signaled IRQ on correct CPU when DCS
694sends data back (duh). [Aaron Giles]
695
696Removed unnecessary check that could cause SCSP hangs in grdforce.
697[kingshriek]
698
699Tweaked deco156 clock speed to be 28 to prevent the games from running
700in slow motion. I suspect the 156 chip has an internal multiplier, the
701usual input pin is 7Mhz IIRC. [David Haywood]
702
703dkong.c changes: [couriersud]
704 * added equivalence circuit for Sanyo EZV audio amplifier
705 * Set DK_C159 = 0 to avoid over-aggressive high-pass filter. Solely
706    based on observations.
707 * added comment on above to source
708 * Added define DK_NO_FILTERS to turn of DAC filters and post-mixer
709    filters for debugging
710
711Adds dips for Water Balls. Adds dip port locations to all dips.
712[Brian Troha]
713
714Added CPUINFO_INT_CLOCK_MULTIPLIER to support CPU clock multipliers.
715Updated all CPU cores to return a CPUINFO_INT_CLOCK_MULTIPLIER of 1.
716Changed the core to actually respect both CPUINFO_INT_CLOCK_MULTIPLIER
717and CPUINFO_INT_CLOCK_DIVIDER. Updated a number of drivers to use
718cpunum_get_clock() instead of Machine->drv->cpu[x].clock. Raw input
719clock speeds should now be specified for all CPUs in the
720MACHINE_DRIVER. [Aaron Giles]
721
722Changed TLC43076 and games using it to RGB32. Removed global Machine
723variable where possible. [Zsolt Vasvari]
724
725Removed dirtybuffer from video/generic.c and all drivers still using
726it. Good riddance... Removed videoram_w, colorram_w and spriteram_w
727and changed all drivers using it to access RAM directly. Removed
728videoram_r, colorram_r, spriteram_r, spriteram16_r and spriteram16_w
729from video/generic.c and changed all games to use (possibly shared)
730RAM. [Zsolt Vasvari]
731
732Cleaned up memory maps in the seibu sound interfaces. Changed to use
733shared sound configs instead of statically copying them in each
734driver. [Aaron Giles]
735
736Verified and changed cpu frequencies and oki m6295 pin 7 on the
737following pcbs: Asuka&Asuka, Cadash, Equites h/w games and sound
738board, F1GP, Super Formula, Gladiator, Ping Pong king, Great
739Swordsman, Irem m52 sound board, Tropical Angel, Explosive Breakers,
740Magical Crystal, Mad Gear, Roller Aces, Chinese Hero, Simpsons,
741Golfing Greats, Time Pilot 84. [Corrado Tomaselli]
742
743Added some more static qualifiers on recent new/changed code.
744[Atari Ace]
745
746Fixed dbreed72 crash introduced in 0.122u5. [Mamesick]
747
748Fixed HuC6280 low-speed mode so it uses 4 cycles instead of 3.
749[Charles MacDonald]
750
751Hand fixed Road Runner's corrupted ROM. We are 99.99% sure that the
752bad bytes are the same as the Desert Gun ones. [Zsolt Vasvari]
753
754Cleaned up leland clocks a little. Made the i186 divide-by-2 clock
755internal. [Aaron Giles]
756
757Added clocks to the MCR sound boards and some of the MCR games. Added
758TMS5220 variants TMS5200 and TMC0285 as proper chips. Changed MCR
759squawk & talk to use the TMS5200 as documented. [Aaron Giles]
760
761Cleaned up Crazy Baloon driver: proper memory maps, crystals, etc.
762Implemented the missing features of the collision detector custom IC.
763[Zsolt Vasvari]
764
765First pass at fixing the cpu clock speeds on the playstation based
766hardware. The system 10 & 12 clock speeds have been raised as they
767run on an upgraded chipset. The internal divide in the CPU core has
768been set to 4 as we have no wait states, incorrect dma timing,
769no gpu timing, no dma bus stealing and no gte timing. [smf]
770
771Fixed RET instruction on the i960 core. [Ernesto Corvi, ElSemi]
772
773Removed speedups in the gstream and limenko drivers which were
774breaking the games. [David Haywood]
775
776Fixed regression on i8039 T1 counter mode. [couriersud]
777
778Added CUSTOM_INPUT macro for defining input port callbacks. Pushed
779its usage throughout the code. [Aaron Giles]
780
781phoenix and clones: [couriersud]
782 * video timing from schematics
783 * palette from schematics (resnet.h)
784 * no more colortable
785 * added save state
786
787Minor RSP fixes: [SGINut]
788 - Fixed accumulator state on powerup by testing against real hardware
789 - Fixed single-step behavior by testing against real hardware
790
791Added save state support to atetris.c. [Svante Gerhard]
792
793Fixed up atetris memory maps and clocks according to schematics.
794[Aaron Giles]
795
796Added targ and spectar to TinyMAME. [neoforma]
797
798
799
800New games added or promoted from NOT_WORKING status
801---------------------------------------------------
802Ripper Ribbit [Aaron Giles]
803Chicken Farm [Aaron Giles]
804Crazzy Clownz [Aaron Giles]
805Space Fighter Mark II [Zsolt Vasvari, Guru]
806
807
808
809New clones added
810----------------
811Heated Barrel (US set 2) [Corrado Tomaselli]
812Player's Edge Plus (XMP00006) Multi-Poker [Jim Stolis]
813
814
815
816New games marked as GAME_NOT_WORKING
817------------------------------------
818International Toote (Germany) [Luca Elia]
819Dodge City [Roberto Fresca]
820
821
822
8230.122u5
824-------
825
826
827MAMETesters Bugs Fixed
828----------------------
829scorpion0111u5gra [couriersud]
830qbert37b14gre1 [Zsolt Vasvari]
831blktiger060gre [robiza]
832kinstc081u7gre [Aaron Giles]
833kinst2083gre [Aaron Giles]
834umk3059gre [Aaron Giles]
835umk3137b5gre [Aaron Giles]
836lasso056gre_1 [Zsolt Vasvari]
837lasso056gre_2 [Zsolt Vasvari]
838term20103u4gre [Aaron Giles]
839term20104u2gre [Aaron Giles]
840m72_0115u3yel [Mamesick, Aaron Giles]
841deadang0119u2red [David Haywood]
842tmnt095gre [Zsolt Vasvari]
843memleak0122u2ora [Atari Ace]
844junglek055gre [Zsolt Vasvari]
845
846
847
848Source Changes
849--------------
850Fixed flipped tilemap offset for scramble and clones (playable
851cocktail mode). [couriersud]
852
853Changed Exidy driver to draws the background directly from memory
854avoiding having to decode the gfx repeadately. [Zsolt Vasvari]
855
856Added machine and cpunum parameters to INTERRUPT_GEN callbacks. Fixed
857several places that were not using INTERRUPT_GEN or OPBASE_HANDLER
858macros. [Atari Ace]
859
860Minor bugfixes to the gfxlayout cleanups included in u4. [Atari Ace]
861
862Added code to debug 64-bit builds to allocate all address space below
8634GB to help find 64-bit errors. Added environment variable
864OSDDEBUGMALLOC which, if set, explicitly overrides the debug malloc
865debug settings. Added environment variable OSDDEBUG4GB which, if set,
866explicitly overrides the new 64-bit address space allocations. (Sadly
867this is necessary due to some D3D drivers being 64-bit unclean....)
868[Aaron Giles]
869
870Fixed winwork to use proper tchar functions for getenv. [Aaron Giles]
871
872Fixed bug where the 64-bit DRC was not saving rbp. [Aaron Giles]
873
874Cleaned up the lasso driver. [Zsolt Vasvari]
875
876Simplified Y-unit DMA rendering, fixing bugs and removing the macro
877voodoo. [Aaron Giles]
878
879Removed a bunch of dead code from othunder.c. [Zsolt Vasvari]
880
881Implemented proper video timing and scanline interrupts in the m72
882driver. [Mamesick, Aaron Giles]
883
884mario.c improvements: [couriersud]
885 * discrete sound
886 * hooked up z80dma
887 * combined memory maps
888 * statics in mario_state struct
889 * fixed save state issues
890 * combine sh_* writes into one routine
891
892audio/dkong.c: [couriersud]
893 * fixed LS123 constant to match TI datasheet diode circuit constant
894
895TX-1 improvements [Philip Bennett, Guru]:
896 * Fixed remaining arithmetic unit issues
897 * Added correct object colour pixel LUT PROM to tx1a
898 * Fixed x-flipping
899 * Added engine sounds
900
901Added correct DIP switch settings for Big Fight. Also corrected Cycle
902Warriors DIP switches. [Philip Bennett]
903
904Changed and verified frequencies on Ikari Warriors h/w, Tnk3, Hyper
905Sports, Jackal and S.A.R. [Corrado Tomaselli]
906
907Verified and corrected a lot of frequencies and oki6295 pin 7 on pcbs:
908Double Dribble, Chequered Flag, Diet gogo, Boulderdash, Sly Spy,
909Psycho Nics Oscar, Captain Silver, Magical Cat Adventure, Raiden,
910Superman, Twin Hawk, Vimana, Ghox, Dogyunn, truxton2, Pipi and Bibis,
911Fix Eight and Money Money. [Corrado Tomaselli]
912
913Cleaned up brkthru/darwin memory maps. Changed both games to use
914identical video timing parameters based on measurements of darwin.
915Guessed based on available information at the master clock and
916derived all game clocks from it. [Aaron Giles]
917
918Reogranized and started to clean up the CVS driver. Added emulation
919of the speech CPU. Removed CVS BIOS entry. Removed unnecessary
920patching. [Zsolt Vasvari]
921
922sauro.c: [couriersud]
923 * Hooked up sp0256 sound
924 * analyzed and commented some ports
925 * added palette_bank support without real success
926
927Reorganized the Raiden 2 driver.. a bit of extra documentation of the
928'V33' based set, which has been renamed. Nothing new working.
929[David Haywood]
930
931Fixed scan functions for kickgoal background, which were swapped.
932[David Haywood]
933
934Fixed 2650 disassembly of the sense and flag bits. Fixed incorrect
935argument order in OUT instruction. Corrected spacing. [Zsolt Vasvari]
936
937Fixed hang/crash on empty config file. [Wilbert Pol]
938
939Cleaned up tceptor memory maps. [Zsolt Vasvari]
940
941Atari System 2 driver cleanup: [Aaron Giles]
942 * Proper video timing.
943 * Full memory maps.
944 * Save state support.
945 * Removed 720 sound CPU hack in favor of prepopulated EEPROM like
946    the other games.
947
948Added support for outputting 64-bit target addresses in the i386dasm.
949[Aaron Giles]
950
951Added MESS PC-Engine emulatation system. Fixed MAME debug build under
952VC2003. [Mariusz Wojcieszek]
953
954Unified memory maps in tmnt.c and twin16.c. Reversed ROM set names
955of Cuebrick World and Japan versions. Changed some function names to
956reflect parent set. [Zsolt Vasvari]
957
958Changed Konami drivers to allocate and decode graphics using the same
959layouts. Removed the layout parameter from the decodechar() calls.
960[Atari Ace]
961
962Fixed C++ compilation errors. [Dave Dribin]
963
964Made INPs compatible between 64-bit MAME and 32-bit MAME. [Chad]
965
966Complete taitosj memory map from Nicola's ancient notes. General code
967clean-up. [Zsolt Vasvari]
968
969src2html improvments: [Aaron Giles]
970 - added line numbers
971 - added link to the raw file if the src and dst dirs are the same
972 
973"Fix" for full screen switch, which makes no sense, but is included
974based on empirical evidence that is somehow works. [Emuman]
975
976
977
978New games added or promoted from NOT_WORKING status
979---------------------------------------------------
980Name Club Ver.3 (J 970723 V1.000) [David Haywood, Mariusz Wojcieszek]
981Blazing Lazers [Mariusz Wojcieszek, Charles MacDonald, Mr. Do]
982
983
984
985New clones added
986----------------
987Lead Angle (Japan) [Guru]
988A Question of Sport (39-960-107) [Highwayman]
989Gee Bee (F.lli Bertolino license) [Corrado Tomaselli]
990
991
992
993New games marked as GAME_NOT_WORKING
994------------------------------------
995Road Runner (Midway) [Zsolt Vasvari, Guru]
996Paranoia [Mariusz Wojcieszek]
997
998
999
10000.122u4
1001-------
1002
1003
1004MAMETesters Bugs Fixed
1005----------------------
1006gui0121u1gre [Aaron Giles]
1007drivedge0121u4gre [Aaron Giles]
1008bking3076u2red [Pierpaolo Prazzoli]
1009btoads0102u5gre [Aaron Giles]
1010btoads0103u1gre [Aaron Giles]
1011editableui0120u4red [Aaron Giles]
1012cheat0118red [Aaron Giles]
1013altf4_0111u4gre [Aaron Giles]
1014beastrzb097u2red [Oliver Stoneberg]
1015memoryleak0118u1ora [Oliver Stoneberg]
1016memory_leak0111u6ora [Oliver Stoneberg]
1017mahoudai0106u7yel [Philip Bennett]
1018gridiron079gre [David Haywood]
1019maniach37b11gre [David Haywood]
1020matmaniac37b14gre [David Haywood]
1021qzkklgy2_0106u6red [David Haywood]
1022warriorb0109u2gre [David Haywood]
1023vball071u1gre [Bryan McPhail]
1024d3dwindow0117u3red [Aaron Giles, Emuman]
1025arkanoid061gre [Bryan McPhail]
1026flkatck058gre [David Haywood]
1027memleak0119u3ora [Oliver Stoneberg]
1028system24_0120u3red [Atari Ace, Aaron Giles]
1029aleck64_0120red [Aaron Giles]
1030mtetrisc0115u1red [Aaron Giles]
1031suratk0122u3gra [Pierpaolo Prazzoli]
1032suratk0122u3ora [Pierpaolo Prazzoli]
1033skychut37b1yel [couriersud]
1034skychut37b6gre [couriersud]
1035darius2_0114gre [Bryan McPhail]
1036ad2083_0111u5gra [couriersud]
1037abaseb0122u3red [Zsolt Vasvari]
1038ladybug080u1gre [Zsolt Vasvari]
1039suprridr0122u2gra [Zsolt Vasvari]
1040invho2_0122u3red [Zsolt Vasvari]
1041narc37b16yel [Aaron Giles]
1042kingofb37b6gre [robiza]
1043stonebal0117u2gre [Aaron Giles]
1044wotw36b1gre [Zsolt Vasvari]
1045wallst071gre [Zsolt Vasvari]
1046mtrap37b14gre [Zsolt Vasvari]
1047pitfight0109u2gre [Aaron Giles]
1048
1049
1050
1051Source Changes
1052--------------
1053Corrected btoads clocks according XTALs on the PCB. [Aaron Giles]
1054
1055"Simplified" MC8123 decryption, though it's still more complicated
1056than I'd like it to be. [Nicola Salmoria]
1057
1058Cleaned up clocks in the itech32 driver. [Aaron Giles]
1059
1060Added partial key for FD1089B 317-0037. [Nicola Salmoria]
1061
1062Fixed bking3 clocks as per Guru readme. Added GAME_WRONG_COLORS flag
1063to bking3. [Pierpaolo Prazzoli]
1064
1065TMS34020 fixes: [Aaron Giles]
1066 * Allowed 32-bit pixel sizes
1067 * Fixed RPIX instruction
1068
1069Added new function input_poll_keyboard_switches to poll for only key
1070events. Expanded the size of the maximum simultaneously pressed
1071switches. [Aaron Giles]
1072
1073Removed GAME_IMPERFECT_GRAPHICS from all jpmimpct games bar Cluedo
1074(see driver note). [Philip Bennett]
1075
1076mario driver improvements: [couriersud]
1077 - Hooked up flipscreen
1078 - Changed monitor orientation to ROT0
1079
1080Added Z80 DMA chip [couriersud]
1081 - only implements intelligence to emulate dkong3
1082 - fixed a misleading comment in 8257dma.h
1083
1084dkong driver improvements: [couriersud]
1085 - hooked up z80dma
1086 - removed 2nd player inputs from sdbk input_ports
1087 - fixed some dump "copy/paste" bugs in dip locations
1088
1089Added redumped Turkey USA to the seta2.c driver. [Brian Troha]
1090
1091Fixed bad ram pages errors in stactics service mode.
1092[Pierpaolo Prazzoli]
1093
1094Atari updates: [Aaron Giles]
1095 - Added save state support to slapstic.
1096 - Added save state support to YM2413.
1097 - Modified slapstic code to support address range mirrors.
1098 - Cleaned up Rampart driver:
1099    - simplified rendering code
1100    - full memory map
1101    - added save state support
1102
1103Implemented decent-sounding FM in the SCSP. [kingshriek]
1104
1105Updated Naomi driver, now boots and shows some test menus (press F2
1106to get into test, use 9 to navigate). Also hooked up ROM board PIO
1107and skeleton for DMA. [R. Belmont, Samuele Zannoli, ElSemi]
1108
1109N64 improvements: [SGINut]
1110 - Move texture masking to occur after coordinate adjustment
1111 - Fix 32-bit texturing in load_tile (Mario Kart 64 title screen)
1112 - Add zero-alpha early-out (Mario 64 trees/stars, Mario Kart 64
1113    trees/karts)
1114
1115ad2083 improvements: [couriersud]
1116 * completed tms5110A code
1117 * working speech synthesis
1118 * documented analysis done on pcb pictures and findings
1119 * as a consequence, marked all sound roms as BAD DUMP
1120 * created sound driver in scramble.c
1121
1122Cleaned up graphics layouts in preparation for new format. Added new
1123GFXLAYOUT_RAW() macro to normalize definition. Added new validation
1124code. Made all remaining instances of gfx_layouts const. [Atari Ace]
1125
1126Updated Amiga driver to use formal XTALs. [Dirk Best]
1127
1128Changed 6522 emulation such that when writing to the ACR register with
1129the timer 1 in continuous counting mode, the timer 1 value should not
1130be reloaded but keep on counting. [Wilbert Pol]
1131
1132Added XTAL defines to bfm_sc2.c and cleaned up lvcards.c.
1133[James Wallace]
1134
1135Added default layout to neogeo games allowing for either cropping or
1136stretching to the alternate 304x224 layout. Removed default cropping
1137in the driver. [David Haywood, Aaron Giles]
1138
1139Fixed crash when saving state of older DCS-based games. Added save
1140state support to the midvunit driver. [Aaron Giles]
1141
1142Major improvements to Cycle Warriors video code (still not perfect,
1143but road layer works now). [Bryan McPhail]
1144
1145Major rewrite of skychut.c. There are still some glitches and it is
1146not perfect but the following has been achieved: [couriersud]
1147 * adds samples to ipm invaders - just rename your old invaders
1148    samples to ipminvad to test
1149 * added - amongst others - "capsule" dip switch to ipm invaders
1150 * sound ports identified
1151 * demo sound and cabinet type driver configuration
1152
1153Updated memory configuration for Superboard game versions in peplus
1154driver. Fixes CMOS DATA errors on reload. [Jim Stolis]
1155
1156Rewrote the CVS system video code. [Zsolt Vasvari]
1157
1158Fixed S2650 register window display. [Zsolt Vasvari]
1159
1160Added sound to Cycle Warriors and Big Fight. Corrected OKI M6295
1161clock values. [Philip Bennett]
1162
1163Fixed missing arrow in Venture on the zoomed out map, and the
1164incorrect fading twister in Hard Hat. [Zsolt Vasvari]
1165
1166
1167
1168New games added or promoted from NOT_WORKING status
1169---------------------------------------------------
1170Dangerous Curves [Philip Bennett, Dazzer]
1171Big Fight [Bryan McPhail]
1172
1173
1174
1175New clones added
1176----------------
1177Invasion - The Abductors (version 5.0) [Brian Troha]
1178Alien Syndrome (set 5, System 16A, FD1089B 317-0037) [Nicola Salmoria]
1179Dragon Spirit (Atari license) [Satoshi Suzuki]
1180
1181
1182
11830.122u3
1184-------
1185
1186
1187MAMETesters Bugs Fixed
1188----------------------
1189hstennis0103u2gra [Brian Troha]
1190edrandy0113gra [Brian Troha]
1191robocop2_0106u3gra [Brian Troha, Bryan McPhail]
1192mario0110u1gre [couriersud]
1193sbrkout0118yel [R. Belmont, Adam Bousley]
1194pestplce0122red [couriersud]
1195funkyjet055yel [Bryan McPhail]
1196liberate074u1gre [Bryan McPhail]
1197tokiu056gre [Bryan McPhail]
1198powerbls0112u4red [Pierpaolo Prazzoli]
1199wwestern0115u1yel [Atari Ace]
1200namcos1_0118u2yel [Atari Ace]
1201victnine0116u2red [Pierpaolo Prazzoli]
1202btoads0103gre [Aaron Giles]
1203
1204
1205
1206Source Changes
1207--------------
1208Fixes clocks for Orbs. [David Haywood, Tomasz Slanina]
1209
1210Fixed various 64-bit GCC warnings. [R. Belmont]
1211
1212Improves accuracy and documentation of NSS/SNES DSP-1.
1213[Andreas Naive, R. Belmont]
1214
1215Added new file xtal.h, documenting all known arcade PCB clock cystals.
1216Drivers should be updated to use these as a basis for their clocks,
1217and the list should be augmented as additional crystals are found.
1218[Guru, Aaron Giles]
1219
1220suprloco improvements: [Pierpaolo Prazzoli]
1221 * Fixed IC.34 memory test
1222 * Fixed 2nd player cocktail mode
1223 * Changed coin3 to service1
1224 
1225Cleaned up inputs/DIP switches in cninja driver. [Brian Troha]
1226
1227Rewrote mario.c: [couriersud]
1228 - rewrote driver, separate MACHINE_DRIVER(mario_audio)
1229 - palette from schematics
1230 - video timing from schematics
1231 - driver configuration switch Nintendo/Std Monitor
1232 - got rid of COLORTABLE
1233
1234Fixed typo for IO1 irq callback in hyperstone core.
1235[Pierpaolo Prazzoli]
1236
1237Added memory_get_bank() function. Fixed logging in memory.c to to use
1238%p for pointer values. [Aaron Giles]
1239
1240Fixed save states in i8051 cpu core [Pierpaolo Prazzoli]
1241
1242Implemented a few SysCtrl, Maple, and PVR/HOLLY bits for Naomi. The
1243BIOS gets slightly further but is nowhere near starting up.
1244[R. Belmont]
1245
1246Zeus updates: [Aaron Giles]
1247 * Better documented various bit latches.
1248 * Hooked up crusnexo lamp board (added layout).
1249 * Fixed year in MK4 startup test.
1250
1251Fixed TMS5110 tables. [couriersud, Lord Nightmare]
1252
1253Removed ui_popup(). Drivers should always be using popmessage()
1254instead (has been this way for a while). Augmented popmessage() so
1255that you can pass NULL to immediately dismiss any messages.
1256[Aaron Giles, thanks to Oliver Stoneberg's suggestion]
1257
1258Added ATTR_PRINTF to a number of functions that have printf semantics.
1259[Oliver Stoneberg]
1260
1261Rewrote sbrkout driver based on schematics: [Aaron Giles]
1262 * XTAL-based timing
1263 * Correct video timing
1264 * Full memory map
1265 * Correct memory usage ("zero page" RAM is shared with videoram)
1266 * Removed all input hacks
1267 * Fixed interrupt generation
1268 * Connected coin counters
1269 * Added save state support
1270
1271Fixed several UNICODE=1 issues in the debugger. Changed the Windows
1272build process to always enable UNICODE=1 for 64-bit builds.
1273[Oliver Stoneberg, Aaron Giles]
1274
1275Added save state support to btoads. [Aaron Giles]
1276
1277Fixed onna34ro mcu simulation properly. [Pierpaolo Prazzoli]
1278
1279
1280
1281New clones added
1282----------------
1283Mutant Fighter (World, EM-3) [Stefan Lindberg]
1284The Simpsons (2 Players Asia) [Arzeno Fabrice]
1285
1286
1287
12880.122u2
1289-------
1290
1291
1292MAMETesters Bugs Fixed
1293----------------------
1294pestplce0122red [couriersud]
1295hunchbkd0122red [couriersud]
1296radarscp0122yel [couriersud]
1297mwalk0122red [couriersud]
1298qtheater0122u1ora [Philip Bennett]
1299
1300
1301
1302Source Changes
1303--------------
1304Fixed M65C02 optimization. [Peter Trauner]
1305
1306TMS51xx and M58817 speech updates: [couriersud]
1307 - radarsc1 uses tms5110 speech synth
1308 - cvs games: according to PCBInfos speech chip is TMS5100.
1309    Changed driver to use TMS5100 and "game system operational" now
1310    sounds more natural
1311 - removed sound/m58817.*
1312 - added support for multiple coefficients maps to tms5110.*
1313 - added coefficient maps for TMS5100 and M58817 from documented
1314    sources to tms5110r.c
1315 - fixed interpolation factors (see tms5110r.c for reason)
1316 - made lattice calculation precision 9bit
1317 - added support for READBIT and LOADADDRESS commands to tms5110.c
1318 - more changes in line with various patents
1319 - documented TRS-02, TKG-02/03 "voice" interface
1320
1321Completed the addition of static qualifiers to all MAME symbols that
1322aren't explicitly exported. [Atari Ace]
1323
1324Named the input_seq_type enumeration and used it explicitly in several
1325places. [Nathan Woods]
1326
1327Corrected tx1 and tx1a coinage DSW assignments. Reversed buggyboy/
1328buggybjr 'Game Time' settings. [Philip Bennett]
1329
1330TMS3203x core updates: [Aaron Giles]
1331 * fixed interrupt handling
1332 * added support for edge-triggered interrupts on '32
1333 * expanded interrupt support for the '32
1334 * updated drivers using TMS3203x core to deassert interrupts
1335 * added externally accessible functions for converting '3x floating point
1336    format
1337 * updated gaelco3d driver to use new functions
1338
1339Zeus2 (+related) updates: [Aaron Giles]
1340 * fixed save states for DCS games
1341 * cleaned up Zeus2 waveram handling
1342 * added Zeus2 save state support
1343 * added preliminary model and quad rendering support for Zeus2
1344 * added support to timekpr for the ZPRAM used on Zeus2
1345 * hooked up ZPRAM in Zeus2 games
1346 * hooked up controls in Zeus2 games
1347 * updated poly.c to ensure it is idle before saving state
1348 * Added artifical Z offset of -2 to make the full screen show in crusnexo
1349
1350Replaced tekken2/tekken2a/tekken2b 'tes1wave.8k' ROM with the
1351correct, non-byte-swapped dump. [Philip Bennett]
1352
1353Added discrete 74LS624(56789) implementation [couriersud]
1354 - DISCRETE_74LS624 is a VCO needed for dkongjr
1355 - Supports Logic, Energy and Count outputs
1356
1357dkong updates: [couriersud]
1358 - Added dkongjr discrete sound
1359 - Proper interface Z80 - I8035 for dkongjr
1360 - Changed discrete sound output factors
1361 - removed samples support for dkongjr
1362 - Cosmetic changes
1363 - Fixed regression in radarscp sound
1364 - Added dipswitch locations to dkong3b
1365
1366Documentation and clock frequency improvements for seta.c: [Brian Troha]
1367 - Added the Guru's readme info for Thundercade
1368 - Corrected rom name for Thundercade
1369 - changed clocks to OSC by divider IE: 16000000/2 /* 8MHz */
1370 - Changed Orbs clock to 16MHz with note about 14.xx MHz
1371 - Changed Meta Fox's x0-006 (65c02) to same as Thundercade
1372 - Changed the YM3438 in Ultra Toukond Densetsu from 6MHz to 1600000/4
1373    /* 4MHz */ as there is no mention of 6MHz OSC on PCB
1374
1375Verified a number of clock frequencies from real PCBs.
1376[Corrado Tomaselli, Zsolt Vasvari]
1377
1378Fixed several memory leaks related to SCSI CD emulation.
1379[Oliver Stoneberg]
1380
1381Removed the increasing of the R register from each IX/IY related
1382(FD xx or DD xx) instruction on the Z80. According to documentation
1383and the behavior of the Amstrad CPC driver, this is incorrect.
1384[Barry Rodewald]
1385
1386Added initial FPU support to the SH4 core. [Samuele Zannoli]
1387
1388Adjusted most conditional logging in MAME to use the idiom
1389"do { if (VERBOSE) logerror x; } while (0)". This has the benefit that
1390the compiler checks the syntax of the logging even in the case it will
1391be eliminated, and in fact a number of cases here needed adjustments
1392to compile because of this. [Atari Ace]
1393
1394
1395
13960.122u1
1397-------
1398
1399
1400MAMETesters Bugs Fixed
1401----------------------
1402ym2610_0119u2gre [Philip Bennett]
1403
1404
1405
1406Source Changes
1407--------------
1408Zeus updates: [Aaron Giles]
1409 * Figured out data format of 2 matrix form.
1410 * Extracted data for lights.
1411 * Added backface culling which mostly works but fails sometimes, so
1412    it is disabled.
1413 * Started on some initial lighting calculations.
1414 * Cleaned up zeus wave RAM accessors.
1415 * Changed rendering code to allow for greater parallelism on multicore
1416    systems.
1417 * Removed some vestigial zeus 2 hacks.
1418 * Reduced visible area to remove artifacts.
1419 * Made right/bottom vertices inclusive to fix some gapping issues.
1420 * Fixed invasn lightgun offset.
1421
1422Zeus 2 hardware:
1423 * Fixed ROM loading, added banking support.
1424 * Separated zeus 2 video implementation from zeus implementation.
1425 * Implemented direct pixel accesses; enough to get startup screens
1426    to show.
1427 * Hooked up ZPRAM.
1428 * Fixed digital inputs for crusnexo.
1429 * Fixed default screen parameters to match the games.
1430
1431Afega/nmk16 cleanups: [David Haywood, Tomasz Slanina]
1432 * Merged afega.c and nmk16.c drivers
1433 * Removed many hacks from both.
1434 * Fixed a number of games
1435
1436Fixed C219 sample read order and implemented sign+magnitude format.
1437Removed GAME_IMPERFECT_SOUND flag from all Namco NA-1 games.
1438[Philip Bennett]
1439
1440Fixed ROM-based DCS2 system to ignore HLE transfers. (Fixes broken
1441sound in invasn.) Properly reduced internal memory on the ADSP-2104
1442variants. [Aaron Giles]
1443
1444Fixed bug that would cause events to leak through to the game when the
1445debugger was up. [Aaron Giles]
1446
1447Verified some cpu clocks of original boards using a frequency counter:
1448[Corrado Tomaselli]
1449 * Changed Success Joe Ym2203 clock from 3mhz to 4mhz
1450 * Changed Pang M6295 clock from 990khz to 1Mhz
1451 * Changed Halley Comet main cpu clock to 1.664mhz (it's not a
1452    mistake, the clock is very low)
1453 * Besides confirming clocks on some games, I modified:
1454 * Aerofighters and Turbo Force sound z80 to 5mhz
1455 * Midnight Resitance 68k cpu to 10mhz (20mhz crystal) and modified
1456    m6295 clock to 1mhz. Also confirmed pin 7 is high.
1457    (Midnight resistance has a lot of slow downs on the pcb too)
1458
1459Minor "code quality" improvements: [Atari Ace]
1460 * fixed some remaining static/const qualifier missed cases
1461 * fixed some missing #include "foo.h"
1462 * a few global names were modified to make them less generic/more
1463    consistent (voodoo.c, vrender0.c, lethal.c, rungun.c, zac2650.c)
1464 * some dead/useless code was removed (i8051.c,model1.c,romcmp.c)
1465
1466
1467
1468New games added or promoted from NOT_WORKING status
1469---------------------------------------------------
1470Invasion [Aaron Giles]
1471Buggy Boy Junior/Speed Buggy (Upright) [Philip Bennett]
1472Task Force Harrier [David Haywood, Tomasz Slanina]
1473US AAF Mustang [David Haywood, Tomasz Slanina]
1474Black Heart [David Haywood, Tomasz Slanina]
1475Red Hawk [David Haywood, Tomasz Slanina]
1476Stagger I [David Haywood, Tomasz Slanina]
1477Sen Jin - Guardian Storm [David Haywood, Tomasz Slanina]
1478Spectrum 2000 [David Haywood, Tomasz Slanina]
1479Fire Hawk [David Haywood, Tomasz Slanina]
1480
1481
1482
1483New clones added
1484----------------
1485World Class Bowling (v1.3) [Brian Troha]
1486
src/build/png2bdc.c
r1679r1680
5050#include <stdlib.h>
5151#include <string.h>
5252#include <ctype.h>
53#include "osdcore.h"
5453#include "png.h"
5554
5655
src/build/build.mak
r1679r1680
2525
2626FILE2STR = $(BUILDOUT)/file2str$(EXE)
2727PNG2BDC = $(BUILDOUT)/png2bdc$(EXE)
28VERINFO = $(BUILDOUT)/verinfo$(EXE)
2829
2930ifneq ($(CROSS_BUILD),1)
3031BUILD += \
3132   $(FILE2STR) \
3233   $(PNG2BDC) \
34   $(VERINFO) \
3335
3436
3537
r1679r1680
4244
4345$(FILE2STR): $(FILE2STROBJS) $(LIBOCORE)
4446   @echo Linking $@...
45   $(LD) $(LDFLAGS) $^ $(LIBS) -o $@
47   $(LD) $(LDFLAGS) $^ -o $@
4648
4749
4850
r1679r1680
5355PNG2BDCOBJS = \
5456   $(BUILDOBJ)/png2bdc.o \
5557
56$(PNG2BDC): $(PNG2BDCOBJS) $(LIBUTIL) $(LIBOCORE) $(ZLIB) $(EXPAT)
58$(PNG2BDC): $(PNG2BDCOBJS) $(LIBUTIL) $(LIBOCORE) $(ZLIB)
5759   @echo Linking $@...
58   $(LD) $(LDFLAGS) $^ $(LIBS) -o $@
60   $(LD) $(LDFLAGS) $^ $(LIBUTIL) $(LIBOCORE) $(ZLIB) -o $@
5961
62
63
64#-------------------------------------------------
65# verinfo
66#-------------------------------------------------
67
68VERINFOOBJS = \
69   $(BUILDOBJ)/verinfo.o
70
71$(VERINFO): $(VERINFOOBJS) $(LIBOCORE)
72   @echo Linking $@...
73   $(LD) $(LDFLAGS) $^ -o $@
74
6075endif
61
src/build/verinfo.c
r0r1680
1//============================================================
2//
3//  verinfo.c - Version resource emitter code
4//
5//  Copyright Nicola Salmoria and the MAME Team.
6//  Visit http://mamedev.org for licensing and usage restrictions.
7//
8//============================================================
9
10#include <stdio.h>
11#include <ctype.h>
12
13#include <string.h>
14#include <stdlib.h>
15
16#define ARRAY_LENGTH(x)            (sizeof(x) / sizeof(x[0]))
17
18//============================================================
19//  TYPE DEFINITIONS
20//============================================================
21
22typedef struct _version_info version_info;
23struct _version_info
24{
25   int version_major;
26   int version_minor;
27   int version_build;
28   int version_subbuild;
29   const char *version_string;
30   const char *author;
31   const char *comments;
32   const char *company_name;
33   const char *file_description;
34   const char *internal_name;
35   const char *legal_copyright;
36   const char *original_filename;
37   const char *product_name;
38};
39
40
41
42//============================================================
43//  emit_version_info
44//============================================================
45
46static void emit_version_info(const version_info *v)
47{
48   printf("VS_VERSION_INFO VERSIONINFO\n");
49   printf("\tFILEVERSION %d,%d,%d,%d\n", v->version_major, v->version_minor, v->version_build, v->version_subbuild);
50   printf("\tPRODUCTVERSION %d,%d,%d,%d\n", v->version_major, v->version_minor, v->version_build, v->version_subbuild);
51   printf("\tFILEFLAGSMASK 0x3fL\n");
52#ifdef MAME_DEBUG
53   if (v->version_build == 0)
54      printf("\tFILEFLAGS VS_FF_DEBUG\n");
55   else
56      printf("\tFILEFLAGS VS_FF_PRERELEASE | VS_FF_DEBUG\n");
57#else
58   if (v->version_build == 0)
59      printf("\tFILEFLAGS 0x0L\n");
60   else
61      printf("\tFILEFLAGS VS_FF_PRERELEASE\n");
62#endif
63   printf("\tFILEOS VOS_NT_WINDOWS32\n");
64   printf("\tFILETYPE VFT_APP\n");
65   printf("\tFILESUBTYPE VFT2_UNKNOWN\n");
66   printf("BEGIN\n");
67   printf("\tBLOCK \"StringFileInfo\"\n");
68   printf("\tBEGIN\n");
69   printf("#ifdef UNICODE\n");
70   printf("\t\tBLOCK \"040904b0\"\n");
71   printf("#else\n");
72   printf("\t\tBLOCK \"040904E4\"\n");
73   printf("#endif\n");
74   printf("\t\tBEGIN\n");
75   if (v->author != NULL)
76      printf("\t\t\tVALUE \"Author\", \"%s\\0\"\n", v->author);
77   if (v->comments != NULL)
78      printf("\t\t\tVALUE \"Comments\", \"%s\\0\"\n", v->comments);
79   if (v->company_name != NULL)
80      printf("\t\t\tVALUE \"CompanyName\", \"%s\\0\"\n", v->company_name);
81   if (v->file_description != NULL)
82      printf("\t\t\tVALUE \"FileDescription\", \"%s\\0\"\n", v->file_description);
83   printf("\t\t\tVALUE \"FileVersion\", \"%d, %d, %d, %d\\0\"\n", v->version_major, v->version_minor, v->version_build, v->version_subbuild);
84   if (v->internal_name != NULL)
85      printf("\t\t\tVALUE \"InternalName\", \"%s\\0\"\n", v->internal_name);
86   if (v->legal_copyright != NULL)
87      printf("\t\t\tVALUE \"LegalCopyright\", \"%s\\0\"\n", v->legal_copyright);
88   if (v->original_filename != NULL)
89      printf("\t\t\tVALUE \"OriginalFilename\", \"%s\\0\"\n", v->original_filename);
90   if (v->product_name != NULL)
91      printf("\t\t\tVALUE \"ProductName\", \"%s\\0\"\n", v->product_name);
92   printf("\t\t\tVALUE \"ProductVersion\", \"%s\\0\"\n", v->version_string);
93   printf("\t\tEND\n");
94   printf("\tEND\n");
95   printf("\tBLOCK \"VarFileInfo\"\n");
96   printf("\tBEGIN\n");
97   printf("#ifdef UNICODE\n");
98   printf("\t\tVALUE \"Translation\", 0x409, 1200\n");
99   printf("#else\n");
100   printf("\t\tVALUE \"Translation\", 0x409, 1252\n");
101   printf("#endif\n");
102   printf("\tEND\n");
103   printf("END\n");
104}
105
106
107
108//============================================================
109//  parse_version_digit
110//============================================================
111
112static int parse_version_digit(const char *str, int *position)
113{
114   int value = 0;
115
116   while (str[*position] != 0 && !isspace(str[*position]) && !isdigit(str[*position]))
117      (*position)++;
118
119   if (str[*position] != 0 && isdigit(str[*position]))
120   {
121      sscanf(&str[*position], "%d", &value);
122      while (isdigit(str[*position]))
123         (*position)++;
124   }
125   return value;
126}
127
128
129
130//============================================================
131//  parse_version
132//============================================================
133
134static int parse_version(char *str, int *version_major, int *version_minor, int *version_micro, const char **version_string)
135{
136   char *version;
137   int position = 0;
138
139   // find the version string
140   version = strstr(str, "build_version");
141   if (version != NULL)
142      version = strchr(version, '"');
143   if (version == NULL)
144   {
145      fprintf(stderr, "Unable to find build_version string\n");
146      return 1;
147   }
148   version++;
149   *strchr(version, ' ') = 0;
150
151   *version_string = version;
152   *version_major = parse_version_digit(version, &position);
153   *version_minor = parse_version_digit(version, &position);
154   *version_micro = parse_version_digit(version, &position);
155   return 0;
156}
157
158
159
160//============================================================
161//  main
162//============================================================
163
164int main(int argc, char *argv[])
165{
166   version_info v;
167   char legal_copyright[512];
168   char *buffer;
169   size_t size;
170   FILE *f;
171
172   memset(&v, 0, sizeof(v));
173
174   // validate parameters
175   if (argc < 2)
176   {
177      printf("Usage: %s <filename>\n", argv[0]);
178      return 0;
179   }
180
181   // open the file
182   f = fopen(argv[1], "rb");
183   if (f == NULL)
184   {
185      fprintf(stderr, "Error opening file %s\n", argv[1]);
186      return 1;
187   }
188
189   // get the file size
190   fseek(f, 0, SEEK_END);
191   size = ftell(f);
192   fseek(f, 0, SEEK_SET);
193
194   // allocate a buffer
195   buffer = malloc(size + 1);
196   if (buffer == NULL)
197   {
198      fclose(f);
199      fprintf(stderr, "Error allocating %ld bytes\n", (long) size + 1);
200      return 1;
201   }
202
203   // read the file contents and NULL-terminate
204   fread(buffer, 1, size, f);
205   fclose(f);
206   buffer[size] = 0;
207
208   // parse out version string
209   if (parse_version(buffer, &v.version_major, &v.version_minor, &v.version_build, &v.version_string))
210      return 1;
211
212#ifdef MESS
213   // MESS
214   v.author = "MESS Team";
215   v.comments = "Multi Emulation Super System";
216   v.company_name = "MESS Team";
217   v.file_description = "Multi Emulation Super System";
218   v.internal_name = "MESS";
219   v.original_filename = "MESS";
220   v.product_name = "MESS";
221#elif defined(WINUI)
222   // MAMEUI
223   v.author = "Christopher Kirmse and the MAMEUI team";
224   v.comments = "Multiple Arcade Machine Emulator with GUI";
225   v.company_name = "MAME Team";
226   v.file_description = "Multiple Arcade Machine Emulator with GUI";
227   v.internal_name = "MAMEUI";
228   v.original_filename = "MAMEUI";
229   v.product_name = "MAMEUI";
230#else
231   // MAME
232   v.author = "Nicola Salmoria and the MAME Team";
233   v.comments = "Multiple Arcade Machine Emulator";
234   v.company_name = "MAME Team";
235   v.file_description = "Multiple Arcade Machine Emulator";
236   v.internal_name = "MAME";
237   v.original_filename = "MAME";
238   v.product_name = "MAME";
239#endif
240
241   // build legal_copyright string
242   v.legal_copyright = legal_copyright;
243   snprintf(legal_copyright, ARRAY_LENGTH(legal_copyright), "Copyright Nicola Salmoria and the MAME team");
244
245   // emit the info
246   emit_version_info(&v);
247
248   free(buffer);
249   return 0;
250}
src/build/file2str.c
r1679r1680
1010***************************************************************************/
1111
1212#include <stdio.h>
13#include "osdcore.h"
13#include <stdlib.h>
1414
1515
1616/*-------------------------------------------------
r1679r1680
2121{
2222   const char *srcfile, *dstfile, *varname, *type;
2323   FILE *src, *dst;
24   UINT8 *buffer;
24   unsigned char *buffer;
2525   int bytes, offs;
2626   int terminate = 1;
2727
src/mame/audio/warpwarp.c
r1679r1680
5555         * 0.639 * 15k * 1uF -> 0.9585s
5656         */
5757        attotime period = attotime_div(attotime_mul(ATTOTIME_IN_HZ(32768), 95850), 100000);
58      timer_adjust(sound_volume_timer, period, 0, period);
58      timer_adjust_periodic(sound_volume_timer, period, 0, period);
5959   }
6060   else
6161   {
r1679r1680
6868         */
6969//      attotime period = attotime_div(attotime_mul(ATTOTIME_IN_HZ(32768), 702900), 100000);
7070        attotime period = attotime_div(attotime_mul(ATTOTIME_IN_HZ(32768), 191700), 100000);
71      timer_adjust(sound_volume_timer, period, 0, period);
71      timer_adjust_periodic(sound_volume_timer, period, 0, period);
7272    }
7373}
7474
r1679r1680
103103         * ...I'm sure this is off by one number of magnitude :/
104104         */
105105        attotime period = attotime_div(attotime_mul(ATTOTIME_IN_HZ(32768), 95850), 100000);
106      timer_adjust(music_volume_timer, period, 0, period);
106      timer_adjust_periodic(music_volume_timer, period, 0, period);
107107   }
108108   else
109109   {
r1679r1680
114114         */
115115//      attotime period = attotime_div(attotime_mul(ATTOTIME_IN_HZ(32768), 3003300), 100000);
116116        attotime period = attotime_div(attotime_mul(ATTOTIME_IN_HZ(32768),  300330), 100000);
117      timer_adjust(music_volume_timer, period, 0, period);
117      timer_adjust_periodic(music_volume_timer, period, 0, period);
118118   }
119119
120120}
src/mame/audio/snes.c
r1679r1680
11541154
11551155   /* Initialize the timers */
11561156   timers[0].timer = timer_alloc( snes_spc_timer , NULL);
1157   timer_adjust( timers[0].timer, ATTOTIME_IN_HZ(8000), 0, ATTOTIME_IN_HZ(8000) );
1157   timer_adjust_periodic( timers[0].timer, ATTOTIME_IN_HZ(8000), 0, ATTOTIME_IN_HZ(8000) );
11581158   timer_enable( timers[0].timer, 0 );
11591159   timers[1].timer = timer_alloc( snes_spc_timer , NULL);
1160   timer_adjust( timers[1].timer, ATTOTIME_IN_HZ(8000), 1, ATTOTIME_IN_HZ(8000) );
1160   timer_adjust_periodic( timers[1].timer, ATTOTIME_IN_HZ(8000), 1, ATTOTIME_IN_HZ(8000) );
11611161   timer_enable( timers[1].timer, 0 );
11621162   timers[2].timer = timer_alloc( snes_spc_timer , NULL);
1163   timer_adjust( timers[2].timer, ATTOTIME_IN_HZ(64000), 2, ATTOTIME_IN_HZ(64000) );
1163   timer_adjust_periodic( timers[2].timer, ATTOTIME_IN_HZ(64000), 2, ATTOTIME_IN_HZ(64000) );
11641164   timer_enable( timers[2].timer, 0 );
11651165
11661166   DSP_Reset();
src/mame/audio/jaguar.c
r1679r1680
462462         if ((data & 0x3f) == 0x15)
463463         {
464464            attotime rate = attotime_mul(ATTOTIME_IN_HZ(26000000), 32 * 2 * (serial_frequency + 1));
465            timer_adjust(serial_timer, rate, 0, rate);
465            timer_adjust_periodic(serial_timer, rate, 0, rate);
466466         }
467467         break;
468468
src/mame/audio/n8080.c
r1679r1680
155155
156156   update_SN76477_status();
157157
158   timer_adjust(sound_timer[n], expire, n, attotime_zero);
158   timer_adjust_oneshot(sound_timer[n], expire, n);
159159}
160160
161161
r1679r1680
165165
166166   update_SN76477_status();
167167
168   timer_adjust(sound_timer[n], attotime_never, n, attotime_never);
168   timer_adjust_oneshot(sound_timer[n], attotime_never, n);
169169}
170170
171171
src/mame/audio/amiga.c
r1679r1680
9191{
9292   chan->curlocation = CUSTOM_REG_LONG(REG_AUD0LCH + chan->index * 8);
9393   chan->curlength = CUSTOM_REG(REG_AUD0LEN + chan->index * 8);
94   timer_adjust(chan->irq_timer, ATTOTIME_IN_HZ(15750), chan->index, attotime_zero);
94   timer_adjust_oneshot(chan->irq_timer, ATTOTIME_IN_HZ(15750), chan->index);
9595   LOG(("dma_reload(%d): offs=%05X len=%04X\n", chan->index, chan->curlocation, chan->curlength));
9696}
9797
src/mame/audio/galaxian.c
r1679r1680
361361   sample_start_raw(CHANNEL_LFO+2,backgroundwave,ARRAY_LENGTH(backgroundwave),1000,1);
362362
363363   noisetimer = timer_alloc(noise_timer_cb, NULL);
364   timer_adjust(noisetimer, ATTOTIME_IN_NSEC((155000+22000)/100*693*22), 0, ATTOTIME_IN_NSEC((155000+22000)/100*693*22));
364   timer_adjust_periodic(noisetimer, ATTOTIME_IN_NSEC((155000+22000)/100*693*22), 0, ATTOTIME_IN_NSEC((155000+22000)/100*693*22));
365365
366366   lfotimer = timer_alloc(lfo_timer_cb, NULL);
367367
r1679r1680
443443#undef Vbe
444444#undef Vcc
445445   logerror("lfo timer bits:%d%d%d%d r1:%d, r2:%d, re: %d, td: %9.2fsec\n", lfobit[0], lfobit[1], lfobit[2], lfobit[3], (int)r1, (int)r2, (int)Re, td);
446   timer_adjust(lfotimer, attotime_make(0, ATTOSECONDS_PER_SECOND / (MAXFREQ-MINFREQ) * td), 0, attotime_make(0, ATTOSECONDS_PER_SECOND / (MAXFREQ-MINFREQ) * td));
446   timer_adjust_periodic(lfotimer, attotime_make(0, ATTOSECONDS_PER_SECOND / (MAXFREQ-MINFREQ) * td), 0, attotime_make(0, ATTOSECONDS_PER_SECOND / (MAXFREQ-MINFREQ) * td));
447447#else
448448   double r0, r1, rx = 100000.0;
449449
r1679r1680
500500   rx = rx + 2000000.0 * r0 / (r0+r1);
501501
502502   LOG(("lfotimer bits:%d%d%d%d r0:%d, r1:%d, rx: %d, time: %9.2fus\n", lfobit[3], lfobit[2], lfobit[1], lfobit[0], (int)r0, (int)r1, (int)rx, 0.639 * rx));
503   timer_adjust(lfotimer, attotime_make(0, ATTOSECONDS_PER_SECOND / 1000000000 / (MAXFREQ-MINFREQ) * 639 * rx), 0, attotime_make(0, ATTOSECONDS_PER_SECOND / 1000000000 / (MAXFREQ-MINFREQ) * 639 * rx));
503   timer_adjust_periodic(lfotimer, attotime_make(0, ATTOSECONDS_PER_SECOND / 1000000000 / (MAXFREQ-MINFREQ) * 639 * rx), 0, attotime_make(0, ATTOSECONDS_PER_SECOND / 1000000000 / (MAXFREQ-MINFREQ) * 639 * rx));
504504#endif
505505}
506506
src/mame/audio/cage.c
r1679r1680
202202   {
203203      if (dma_timer_enabled)
204204      {
205         timer_adjust(dma_timer, attotime_never, 0, attotime_never);
205         timer_adjust_oneshot(dma_timer, attotime_never, 0);
206206         dma_timer_enabled = 0;
207207      }
208208      return;
r1679r1680
253253      if (!dma_timer_enabled)
254254      {
255255         attotime period = attotime_mul(serial_period_per_word, tms32031_io_regs[DMA_TRANSFER_COUNT]);
256         timer_adjust(dma_timer, period, addr, period);
256         timer_adjust_periodic(dma_timer, period, addr, period);
257257         dma_timer_enabled = 1;
258258      }
259259   }
r1679r1680
261261   /* see if we turned off */
262262   else if (!enabled && dma_enabled)
263263   {
264      timer_adjust(dma_timer, attotime_never, 0, attotime_never);
264      timer_adjust_oneshot(dma_timer, attotime_never, 0);
265265      dma_timer_enabled = 0;
266266   }
267267
r1679r1680
303303      if (tms32031_io_regs[base + TIMER0_GLOBAL_CTL] != 0x2c1)
304304         logerror("CAGE TIMER%d: unexpected timer config %08X!\n", which, tms32031_io_regs[base + TIMER0_GLOBAL_CTL]);
305305
306      timer_adjust(timer[which], period, which, attotime_never);
306      timer_adjust_oneshot(timer[which], period, which);
307307   }
308308
309309   /* see if we turned off */
310310   else if (!enabled && cage_timer_enabled[which])
311311   {
312      timer_adjust(timer[which], attotime_never, which, attotime_never);
312      timer_adjust_oneshot(timer[which], attotime_never, which);
313313   }
314314
315315   /* set the new state */
r1679r1680
551551
552552      dma_enabled = 0;
553553      dma_timer_enabled = 0;
554      timer_adjust(dma_timer, attotime_never, 0, attotime_never);
554      timer_adjust_oneshot(dma_timer, attotime_never, 0);
555555
556556      cage_timer_enabled[0] = 0;
557557      cage_timer_enabled[1] = 0;
558      timer_adjust(timer[0], attotime_never, 0, attotime_never);
559      timer_adjust(timer[1], attotime_never, 0, attotime_never);
558      timer_adjust_oneshot(timer[0], attotime_never, 0);
559      timer_adjust_oneshot(timer[1], attotime_never, 0);
560560
561561      memset(tms32031_io_regs, 0, 0x60 * 4);
562562
src/mame/audio/exidy440.c
r1679r1680
1717#define   FADE_TO_ZERO   1
1818
1919
20#define EXIDY440_AUDIO_CLOCK   (EXIDY440_MASTER_CLOCK / 4 / 4)
21#define EXIDY440_MC3418_CLOCK   (EXIDY440_AUDIO_CLOCK / 16)
22#define EXIDY440_MC3417_CLOCK   (EXIDY440_AUDIO_CLOCK / 32)
2023
24
2125/* internal caching */
2226#define   MAX_CACHE_ENTRIES      1024            /* maximum separate samples we expect to ever see */
2327#define   SAMPLE_BUFFER_LENGTH   1024            /* size of temporary decode buffer on the stack */
r1679r1680
383387 *
384388 *************************************/
385389
386static void exidy440_m6844_update(void)
390static void m6844_update(void)
387391{
388392   /* update the stream */
389393   stream_update(stream);
r1679r1680
419423   int result = 0;
420424
421425   /* first update the current state of the DMA transfers */
422   exidy440_m6844_update();
426   m6844_update();
423427
424428   /* switch off the offset we were given */
425429   switch (offset)
r1679r1680
489493      case 0x16:
490494         result = m6844_chain;
491495         break;
496
497      /* 0x17-0x1f not used */
498      default: break;
492499   }
493500
494501   return result;
r1679r1680
500507   int i;
501508
502509   /* first update the current state of the DMA transfers */
503   exidy440_m6844_update();
510   m6844_update();
504511
505512   /* switch off the offset we were given */
506513   switch (offset)
r1679r1680
591598      case 0x16:
592599         m6844_chain = data;
593600         break;
601
602      /* 0x17-0x1f not used */
603      default: break;
594604   }
595605}
596606
r1679r1680
883893 *************************************/
884894
885895static ADDRESS_MAP_START( exidy440_audio_map, ADDRESS_SPACE_PROGRAM, 8 )
886   AM_RANGE(0x8000, 0x8016) AM_READWRITE(m6844_r, m6844_w) AM_BASE(&m6844_data)
887   AM_RANGE(0x8400, 0x8407) AM_READWRITE(MRA8_RAM, sound_volume_w) AM_BASE(&sound_volume)
888   AM_RANGE(0x8800, 0x8800) AM_READ(sound_command_r)
889   AM_RANGE(0x9400, 0x9403) AM_WRITE(MWA8_RAM) AM_BASE(&sound_banks)
890   AM_RANGE(0x9800, 0x9800) AM_READWRITE(MRA8_NOP, sound_interrupt_clear_w)
896   AM_RANGE(0x0000, 0x7fff) AM_NOP
897   AM_RANGE(0x8000, 0x801f) AM_MIRROR(0x03e0) AM_READWRITE(m6844_r, m6844_w) AM_BASE(&m6844_data)
898   AM_RANGE(0x8400, 0x840f) AM_MIRROR(0x03f0) AM_READWRITE(MRA8_RAM, sound_volume_w) AM_BASE(&sound_volume)
899   AM_RANGE(0x8800, 0x8800) AM_MIRROR(0x03ff) AM_READWRITE(sound_command_r, MWA8_NOP)
900   AM_RANGE(0x8c00, 0x93ff) AM_NOP
901   AM_RANGE(0x9400, 0x9403) AM_MIRROR(0x03fc) AM_READWRITE(MRA8_NOP, MWA8_RAM) AM_BASE(&sound_banks)
902   AM_RANGE(0x9800, 0x9800) AM_MIRROR(0x03ff) AM_READWRITE(MRA8_NOP, sound_interrupt_clear_w)
903   AM_RANGE(0x9c00, 0x9fff) AM_NOP
891904   AM_RANGE(0xa000, 0xbfff) AM_RAM
905   AM_RANGE(0xc000, 0xdfff) AM_NOP
892906   AM_RANGE(0xe000, 0xffff) AM_ROM
893907ADDRESS_MAP_END
894908
r1679r1680
916930
917931MACHINE_DRIVER_START( exidy440_audio )
918932
919   MDRV_CPU_ADD(M6809,EXIDY440_MASTER_CLOCK/4/4)
933   MDRV_CPU_ADD(M6809, EXIDY440_AUDIO_CLOCK)
920934   MDRV_CPU_PROGRAM_MAP(exidy440_audio_map,0)
921935   MDRV_CPU_VBLANK_INT(irq0_line_assert,1)
922936
r1679r1680
926940   MDRV_SOUND_CONFIG(custom_interface)
927941   MDRV_SOUND_ROUTE(0, "left", 1.0)
928942   MDRV_SOUND_ROUTE(1, "right", 1.0)
943
944//  MDRV_SOUND_ADD(MC3418, EXIDY440_MC3418_CLOCK)
945//  MDRV_SOUND_ROUTE(ALL_OUTPUTS, "left", 1.0)
946
947//  MDRV_SOUND_ADD(MC3418, EXIDY440_MC3418_CLOCK)
948//  MDRV_SOUND_ROUTE(ALL_OUTPUTS, "right", 1.0)
949
950//  MDRV_SOUND_ADD(MC3417, EXIDY440_MC3417_CLOCK)
951//  MDRV_SOUND_ROUTE(ALL_OUTPUTS, "left", 1.0)
952
953//  MDRV_SOUND_ADD(MC3417, EXIDY440_MC3417_CLOCK)
954//  MDRV_SOUND_ROUTE(ALL_OUTPUTS, "right", 1.0)
929955MACHINE_DRIVER_END
src/mame/audio/vicdual.c
r1679r1680
168168      if (last_croak)
169169      {
170170         /* The croak will keep playing until .429s after being disabled */
171         timer_adjust(frogs_croak_timer, double_to_attotime(1.1 * RES_K(390) * CAP_U(1)), 0, attotime_zero);
171         timer_adjust_oneshot(frogs_croak_timer, double_to_attotime(1.1 * RES_K(390) * CAP_U(1)), 0);
172172      }
173173   }
174174   if (new_buzzz)
src/mame/audio/leland.c
r1679r1680
819819   if (t->control & 0x0001)
820820   {
821821      int count = t->maxA ? t->maxA : 0x10000;
822      timer_adjust(t->int_timer, attotime_mul(ATTOTIME_IN_HZ(2000000), count), which, attotime_zero);
822      timer_adjust_oneshot(t->int_timer, attotime_mul(ATTOTIME_IN_HZ(2000000), count), which);
823823      if (LOG_TIMER) logerror("  Repriming interrupt\n");
824824   }
825825   else
826      timer_adjust(t->int_timer, attotime_never, which, attotime_never);
826      timer_adjust_oneshot(t->int_timer, attotime_never, which);
827827}
828828
829829
r1679r1680
937937            internal_timer_sync(which);
938938
939939            /* nuke the timer and force the interrupt timer to be recomputed */
940            timer_adjust(t->time_timer, attotime_never, which, attotime_never);
940            timer_adjust_oneshot(t->time_timer, attotime_never, which);
941941            t->time_timer_active = 0;
942942            update_int_timer = 1;
943943         }
r1679r1680
946946         else if ((diff & 0x8000) && (new_control & 0x8000))
947947         {
948948            /* start the timing */
949            timer_adjust(t->time_timer, attotime_never, which, attotime_never);
949            timer_adjust_oneshot(t->time_timer, attotime_never, which);
950950            t->time_timer_active = 1;
951951            update_int_timer = 1;
952952         }
r1679r1680
975975         {
976976            int diff = t->maxA - t->count;
977977            if (diff <= 0) diff += 0x10000;
978            timer_adjust(t->int_timer, attotime_mul(ATTOTIME_IN_HZ(2000000), diff), which, attotime_zero);
978            timer_adjust_oneshot(t->int_timer, attotime_mul(ATTOTIME_IN_HZ(2000000), diff), which);
979979            if (LOG_TIMER) logerror("Set interrupt timer for %d\n", which);
980980         }
981981         else
982            timer_adjust(t->int_timer, attotime_never, which, attotime_never);
982            timer_adjust_oneshot(t->int_timer, attotime_never, which);
983983      }
984984}
985985
r1679r1680
10641064         if (LOG_DMA) logerror("Initiated DMA %d - count = %04X, source = %04X, dest = %04X\n", which, d->count, d->source, d->dest);
10651065
10661066         d->finished = 0;
1067         timer_adjust(d->finish_timer, attotime_mul(ATTOTIME_IN_HZ(dac[dacnum].frequency), count), which, attotime_zero);
1067         timer_adjust_oneshot(d->finish_timer, attotime_mul(ATTOTIME_IN_HZ(dac[dacnum].frequency), count), which);
10681068      }
10691069   }
10701070
r1679r1680
16071607            if (ctr->count == 0) ctr->count = 0x10000;
16081608
16091609            /* reset/start the timer */
1610            timer_adjust(ctr->timer, attotime_never, 0, attotime_never);
1610            timer_adjust_oneshot(ctr->timer, attotime_never, 0);
16111611
16121612            if (LOG_PIT) logerror("PIT counter %d set to %d (%d Hz)\n", which, ctr->count, 4000000 / ctr->count);
16131613
src/mame/audio/dkong.c
r1679r1680
2121/* Set to 1 to disable DAC and post-mixer filters */
2222#define      DK_NO_FILTERS   (0)
2323
24/* Issue surrounded by this define need to be analyzed and
25 * reviewed at a lator time.
26 * Currently, the following issues exist:
27 * - although not present on schematics, a 10K resistor is needed
28 *   as RF in the mixer stage. Without this resistor, the DAC
29 *   sound is completely overmodulated.
30 */
2431
32// FIXME: Review at a later time
33#define      DK_REVIEW      (1)
34
2535#define ACTIVELOW_PORT_BIT(P,A,D)   (((P) & (~(1 << (A)))) | (((D) ^ 1) << (A)))
2636
2737/* Needed for dkongjr ... FIXME */
r1679r1680
216226      {DK_R2, DK_R24, DK_R1, DK_R14},
217227      {0,0,0},   // no variable resistors
218228      {0,0,0},  // no node capacitors
229#if DK_REVIEW
230      0, RES_K(10),
231#else
219232      0, 0,
233#endif
220234      DK_C159,
221235      DK_C12,
222236      0, 1};
r1679r1680
361375   // Amplifier: internal amplifier
362376   DISCRETE_ADDER2(NODE_289,1,NODE_288,5.0*43.0/(100.0+43.0))
363377    DISCRETE_RCINTEGRATE(NODE_294,1,NODE_289,0,150,1000, CAP_U(33),DK_SUP_V,DISC_RC_INTEGRATE_TYPE3)
364   DISCRETE_CRFILTER(NODE_295,1,NODE_294, RES_K(50), DK_C13)
378    DISCRETE_CRFILTER(NODE_295,1,NODE_294, RES_K(50), DK_C13)
379   //DISCRETE_CRFILTER(NODE_295,1,NODE_294, 1000, DK_C13)
365380   // EZV20 equivalent filter circuit ...
366381   DISCRETE_CRFILTER(NODE_296,1,NODE_295, RES_K(1), CAP_U(4.7))
367
368382#if DK_NO_FILTERS
369383   DISCRETE_OUTPUT(NODE_288, 32767.0/5.0 * 10)
370384#else
src/mame/audio/taito_en.c
r1679r1680
121121            case 3:
122122               logerror("Counter:  X1/Clk - divided by 16, counter is %04x, so interrupt every %d cycles\n",counter,(M68000_CLOCK/M68681_CLOCK)*counter*16);
123123               timer_mode=TIMER_SINGLESHOT;
124               timer_adjust(timer_68681, ATTOTIME_IN_CYCLES((M68000_CLOCK/M68681_CLOCK)*counter*16,1), 0, attotime_zero);
124               timer_adjust_oneshot(timer_68681, ATTOTIME_IN_CYCLES((M68000_CLOCK/M68681_CLOCK)*counter*16,1), 0);
125125               break;
126126            case 4:
127127               logerror("Timer:  Unimplemented external IP2\n");
r1679r1680
132132            case 6:
133133               logerror("Timer:  X1/Clk, counter is %04x, so interrupt every %d cycles\n",counter,(M68000_CLOCK/M68681_CLOCK)*counter);
134134               timer_mode=TIMER_PULSE;
135               timer_adjust(timer_68681, ATTOTIME_IN_CYCLES((M68000_CLOCK/M68681_CLOCK)*counter,1), 0, ATTOTIME_IN_CYCLES((M68000_CLOCK/M68681_CLOCK)*counter,1));
135               timer_adjust_periodic(timer_68681, ATTOTIME_IN_CYCLES((M68000_CLOCK/M68681_CLOCK)*counter,1), 0, ATTOTIME_IN_CYCLES((M68000_CLOCK/M68681_CLOCK)*counter,1));
136136               break;
137137            case 7:
138138               logerror("Timer:  Unimplemented X1/Clk - divided by 16\n");
src/mame/audio/geebee.c
r1679r1680
4646         * discharge C33 (1uF) through R50 (22k) -> 0.14058s
4747         */
4848        attotime period = attotime_div(attotime_mul(ATTOTIME_IN_HZ(32768), 14058), 100000);
49      timer_adjust(volume_timer, period, 0, period);
49      timer_adjust_periodic(volume_timer, period, 0, period);
5050   }
5151   else
5252   {
r1679r1680
5858         * maybe half as fast?
5959         */
6060        attotime period = attotime_div(attotime_mul(ATTOTIME_IN_HZ(32768), 29060), 100000);
61      timer_adjust(volume_timer, period, 0, period);
61      timer_adjust_periodic(volume_timer, period, 0, period);
6262    }
6363}
6464
src/mame/audio/segag80r.c
r1679r1680
520520   if ((diff & 0x20) && !(newval & 0x20))
521521   {
522522      //mame_printf_debug("Stopping timer\n");
523      timer_adjust(sega005_sound_timer, attotime_never, 0, attotime_never);
523      timer_adjust_oneshot(sega005_sound_timer, attotime_never, 0);
524524   }
525525
526526   /* if bit 5 goes low, we start the timer again */
527527   if ((diff & 0x20) && (newval & 0x20))
528528   {
529529      //mame_printf_debug("Starting timer\n");
530      timer_adjust(sega005_sound_timer, ATTOTIME_IN_HZ(SEGA005_555_TIMER_FREQ), 0, ATTOTIME_IN_HZ(SEGA005_555_TIMER_FREQ));
530      timer_adjust_periodic(sega005_sound_timer, ATTOTIME_IN_HZ(SEGA005_555_TIMER_FREQ), 0, ATTOTIME_IN_HZ(SEGA005_555_TIMER_FREQ));
531531   }
532532}
533533
src/mame/audio/gottlieb.c
r1679r1680
236236   {
237237      /* base clock is 250kHz divided by 256 */
238238      attotime interval = attotime_mul(ATTOTIME_IN_HZ(250000), 256 * (256-nmi_rate));
239      timer_adjust(nmi_timer, interval, 0, interval);
239      timer_adjust_periodic(nmi_timer, interval, 0, interval);
240240   }
241241   else
242      timer_adjust(nmi_timer, attotime_never, 0, attotime_never);
242      timer_adjust_oneshot(nmi_timer, attotime_never, 0);
243243
244244   /* Bit 1 controls a LED on the sound board. I'm not emulating it */
245245}
src/mame/audio/dcs.c
r1679r1680
832832   /* reset timers */
833833   dcs.timer_enable = 0;
834834   dcs.timer_scale = 1;
835   timer_adjust(dcs.internal_timer, attotime_never, 0, attotime_never);
835   timer_adjust_oneshot(dcs.internal_timer, attotime_never, 0);
836836
837837   /* start the SPORT0 timer */
838838   if (dcs.sport_timer)
839      timer_adjust(dcs.sport_timer, ATTOTIME_IN_HZ(1000), 0, ATTOTIME_IN_HZ(1000));
839      timer_adjust_periodic(dcs.sport_timer, ATTOTIME_IN_HZ(1000), 0, ATTOTIME_IN_HZ(1000));
840840
841841   /* reset the HLE transfer states */
842842   transfer.dcs_state = transfer.state = 0;
r1679r1680
17161716
17171717   /* set the next timer, but only if it's for a reasonable number */
17181718   if (!dcs.timer_ignore && (dcs.timer_period > 10 || dcs.timer_scale > 1))
1719      timer_adjust(dcs.internal_timer, ATTOTIME_IN_CYCLES(target_cycles, dcs.cpunum), 0, attotime_zero);
1719      timer_adjust_oneshot(dcs.internal_timer, ATTOTIME_IN_CYCLES(target_cycles, dcs.cpunum), 0);
17201720   cpunum_set_input_line(machine, dcs.cpunum, ADSP2105_TIMER, PULSE_LINE);
17211721}
17221722
r1679r1680
17511751
17521752   /* adjust the timer if not optimized */
17531753   if (!dcs.timer_ignore)
1754      timer_adjust(dcs.internal_timer, ATTOTIME_IN_CYCLES(dcs.timer_scale * (dcs.timer_start_count + 1), dcs.cpunum), 0, attotime_zero);
1754      timer_adjust_oneshot(dcs.internal_timer, ATTOTIME_IN_CYCLES(dcs.timer_scale * (dcs.timer_start_count + 1), dcs.cpunum), 0);
17551755}
17561756
17571757
r1679r1680
17671767   else
17681768   {
17691769//      mame_printf_debug("Timer disabled\n");
1770      timer_adjust(dcs.internal_timer, attotime_never, 0, attotime_never);
1770      timer_adjust_oneshot(dcs.internal_timer, attotime_never, 0);
17711771   }
17721772}
17731773
r1679r1680
18461846         if ((data & 0x0800) == 0)
18471847         {
18481848            dmadac_enable(0, dcs.channels, 0);
1849            timer_adjust(dcs.reg_timer, attotime_never, 0, attotime_never);
1849            timer_adjust_oneshot(dcs.reg_timer, attotime_never, 0);
18501850         }
18511851         break;
18521852
r1679r1680
18551855         if ((data & 0x0002) == 0)
18561856         {
18571857            dmadac_enable(0, dcs.channels, 0);
1858            timer_adjust(dcs.reg_timer, attotime_never, 0, attotime_never);
1858            timer_adjust_oneshot(dcs.reg_timer, attotime_never, 0);
18591859         }
18601860         break;
18611861
r1679r1680
19661966   if (dcs.incs)
19671967   {
19681968      attotime period = attotime_div(attotime_mul(sample_period, dcs.size), (2 * dcs.channels * dcs.incs));
1969      timer_adjust(dcs.reg_timer, period, 0, period);
1969      timer_adjust_periodic(dcs.reg_timer, period, 0, period);
19701970   }
19711971}
19721972
r1679r1680
20192019   dmadac_enable(0, dcs.channels, 0);
20202020
20212021   /* remove timer */
2022   timer_adjust(dcs.reg_timer, attotime_never, 0, attotime_never);
2022   timer_adjust_oneshot(dcs.reg_timer, attotime_never, 0);
20232023}
20242024
20252025
r1679r1680
20682068      for ( ; transfer.fifo_entries; transfer.fifo_entries--)
20692069         preprocess_write((*dcs.fifo_data_r)());
20702070   }
2071   timer_adjust(transfer.watchdog, ATTOTIME_IN_MSEC(1), transfer.writes_left, attotime_zero);
2071   timer_adjust_oneshot(transfer.watchdog, ATTOTIME_IN_MSEC(1), transfer.writes_left);
20722072}
20732073
20742074
r1679r1680
22982298         transfer.sum = 0;
22992299         if (transfer.hle_enabled)
23002300         {
2301            timer_adjust(transfer.watchdog, ATTOTIME_IN_MSEC(1), transfer.writes_left, attotime_zero);
2301            timer_adjust_oneshot(transfer.watchdog, ATTOTIME_IN_MSEC(1), transfer.writes_left);
23022302            return 1;
23032303         }
23042304         break;
r1679r1680
23252325            if (transfer.state == 0)
23262326            {
23272327               timer_set(ATTOTIME_IN_USEC(1), NULL, transfer.sum, s2_ack_callback);
2328               timer_adjust(transfer.watchdog, attotime_never, 0, attotime_never);
2328               timer_adjust_oneshot(transfer.watchdog, attotime_never, 0);
23292329            }
23302330            return 1;
23312331         }
src/mame/audio/exidy.c
r1679r1680
418418
419419      /* now start counting clock cycles down */
420420      riot_state = RIOT_POST_COUNT;
421      timer_adjust(riot_timer, attotime_mul(ATTOTIME_IN_HZ(SH6532_CLOCK), 0xff), 0, attotime_zero);
421      timer_adjust_oneshot(riot_timer, attotime_mul(ATTOTIME_IN_HZ(SH6532_CLOCK), 0xff), 0);
422422   }
423423
424424   /* if not, we are done counting down */
425425   else
426426   {
427427      riot_state = RIOT_IDLE;
428      timer_adjust(riot_timer, attotime_never, 0, attotime_never);
428      timer_adjust_oneshot(riot_timer, attotime_never, 0);
429429   }
430430}
431431
r1679r1680
499499
500500      /* set a new timer */
501501      riot_clock_divisor = divisors[offset & 0x03];
502      timer_adjust(riot_timer, attotime_mul(ATTOTIME_IN_HZ(SH6532_CLOCK), data * riot_clock_divisor), 0, attotime_zero);
502      timer_adjust_oneshot(riot_timer, attotime_mul(ATTOTIME_IN_HZ(SH6532_CLOCK), data * riot_clock_divisor), 0);
503503      riot_state = RIOT_COUNT;
504504   }
505505}
src/mame/audio/8080bw.c
r1679r1680
800800         if (attotime_compare(schaser_effect_555_time_remain, attotime_zero) != 0)
801801         {
802802            /* timer re-enabled, use up remaining 555 high time */
803            timer_adjust(schaser_effect_555_timer, schaser_effect_555_time_remain, effect, attotime_zero);
803            timer_adjust_oneshot(schaser_effect_555_timer, schaser_effect_555_time_remain, effect);
804804         }
805805         else if (!schaser_effect_555_is_low)
806806         {
807807            /* set 555 high time */
808808            attotime new_time = attotime_make(0, ATTOSECONDS_PER_SECOND * .8873 * schaser_effect_rc[effect]);
809            timer_adjust(schaser_effect_555_timer, new_time, effect, attotime_zero);
809            timer_adjust_oneshot(schaser_effect_555_timer, new_time, effect);
810810         }
811811      }
812812      else
r1679r1680
815815         if (!schaser_effect_555_is_low)
816816         {
817817            schaser_effect_555_time_remain = timer_timeleft(schaser_effect_555_timer);
818            timer_adjust(schaser_effect_555_timer, attotime_never, 0, attotime_never);
818            timer_adjust_oneshot(schaser_effect_555_timer, attotime_never, 0);
819819         }
820820      }
821821      last_effect = effect;
r1679r1680
874874      else
875875         new_time = attotime_never;
876876   }
877   timer_adjust(schaser_effect_555_timer, new_time, effect, attotime_zero);
877   timer_adjust_oneshot(schaser_effect_555_timer, new_time, effect);
878878   SN76477_enable_w(0, !(schaser_effect_555_is_low || schaser_explosion));
879879   SN76477_one_shot_cap_voltage_w(0, !(schaser_effect_555_is_low || schaser_explosion) ? 0 : SN76477_EXTERNAL_VOLTAGE_DISCONNECT);
880880}
r1679r1680
891891MACHINE_RESET( schaser )
892892{
893893   schaser_effect_555_is_low = 0;
894   timer_adjust(schaser_effect_555_timer, attotime_never, 0, attotime_never);
894   timer_adjust_oneshot(schaser_effect_555_timer, attotime_never, 0);
895895   schaser_sh_port_1_w(0, 0);
896896   schaser_sh_port_2_w(0, 0);
897897   schaser_effect_555_time_remain = attotime_zero;
src/mame/machine/xevious.c
r1679r1680
9696   switch (data)
9797   {
9898      case 0x10:
99         timer_adjust(nmi_timer, attotime_never, 0, attotime_never);
99         timer_adjust_oneshot(nmi_timer, attotime_never, 0);
100100         return; /* nop */
101101   }
102   timer_adjust(nmi_timer, ATTOTIME_IN_USEC(166), 0, ATTOTIME_IN_USEC(166));
102   timer_adjust_periodic(nmi_timer, ATTOTIME_IN_USEC(166), 0, ATTOTIME_IN_USEC(166));
103103
104104}
105105
src/mame/machine/irem_cpu.c
r1679r1680
301301const UINT8 gussun_decryption_table[256] = {
302302   0xcd,xxxx,xxxx,0x36,xxxx,0x52,0xb1,0x5b, 0x68,0xcd,xxxx,xxxx,xxxx,0xa8,xxxx,xxxx, /* 00 */
303303//  0x63                          gggg            gggg                gggg
304   xxxx,xxxx,0x75,0x24,0x08,0x83,0x32,0xe9, xxxx,0x7d,xxxx,0x8f,0x22,xxxx,0xac,xxxx, /* 10 */
304   xxxx,xxxx,0x75,0x24,0x08,0x83,0x32,0xe9, xxxx,0x79,xxxx,0x8f,0x22,xxxx,0xac,xxxx, /* 10 */
305305//                      ????                      pppp      gggg
306   0x5d,0xa5,0x11,0x51,0x0a,0x29,0x01,xxxx ,0xf8,0x98,0x91,0x40,0x28,0x00,0x03,0x5f, /* 20 */
307//            gggg           pppp ????       gggg gggg      gggg gggg pppp
306   0x5d,0xa5,0x11,0x51,0x0a,0x29,xxxx,xxxx ,0xf8,0x98,0x91,0x40,0x28,0x00,0x03,0x5f, /* 20 */
307//            gggg           pppp            gggg gggg      gggg gggg pppp
308308   0x26,xxxx,xxxx,0x8b,0x2f,0x02,xxxx,xxxx, 0x8e,0xab,xxxx,xxxx,0xbc,0xf1,0xb3,xxxx, /* 30 */
309309//                      gggg                                          0x90
310   xxxx,0x19,0xc6,xxxx,xxxx,0x3a,0x01,xxxx, xxxx,0x74,0x61,xxxx,0x33,xxxx,0x01,xxxx, /* 40 */
311//       ????                     ????                                     ????
312   xxxx,0x53,0xa0,0xc0,0xc3,0x41,0xfc,0xe7, xxxx,0x2c,0x7e,0x2b,xxxx,xxxx,0xba,0x2a, /* 50 */
313//            gggg           ????                 gggg pppp gggg
314   0xb0,xxxx,0x28,0x79,xxxx,xxxx,0xb5,0x07, 0xb9,xxxx,0x27,0x46,0xf9,xxxx,xxxx,xxxx, /* 60 */
310   0x19,xxxx,0xc6,xxxx,xxxx,0x3a,xxxx,xxxx, xxxx,0x74,0x61,xxxx,0x33,xxxx,xxxx,xxxx, /* 40 */
311//  ????
312   xxxx,0x53,0xa0,0xc0,0xc3,0x41,0xfc,0xe7, xxxx,0x2c,0x7c,0x2b,xxxx,xxxx,0xba,0x2a, /* 50 */
313//            gggg           gggg                 gggg pppp gggg
314   0xb0,xxxx,0x29,0x79,xxxx,xxxx,0xb5,0x07, 0xb9,xxxx,0x27,0x46,0xf9,xxxx,xxxx,xxxx, /* 60 */
315315//            ???? pppp           gggg                 gggg
316   xxxx,0xea,0x72,0x73,0xad,0xd1,0x3b,0x5e, 0xe5,0x57,xxxx,0x0d,xxxx,xxxx,xxxx,0x3c, /* 70 */
317//                 gggg                                     ????
318   xxxx,0x86,0x76,0x7f,0x08,0x25,0x2d,xxxx, 0x9a,0xeb,0x04,0x0b,0xa2,0xb8,0xf6,xxxx, /* 80 */
319//            ???? pppp ????      ????       gggg
320   xxxx,xxxx,0x9d,xxxx,0xbb,xxxx,xxxx,0xcb, 0xa9,0xcf,xxxx,0x60,0x43,0x56,xxxx,0x19, /* 90 */
321//            ????                     gggg                                     ????
316   xxxx,0xea,0x72,0x73,0xad,0xd1,0x3b,0x5e, 0xe5,0x57,xxxx,0x0d,xxxx,xxxx,0x42,0x3c, /* 70 */
317//                 gggg                                     pppp           ????
318   xxxx,0x86,0x78,0x7d,0x30,0x25,0x2d,xxxx, 0x9a,0xeb,0x04,0x0b,0xa2,0xb8,0xf6,xxxx, /* 80 */
319//            ???? pppp ????      pppp       gggg
320   xxxx,xxxx,0x9d,xxxx,0xbb,xxxx,xxxx,0xcb, 0xa9,0xcf,xxxx,0x60,0x43,0x56,xxxx,xxxx, /* 90 */
321//            gggg                     gggg
322322   xxxx,0xa3,xxxx,xxxx,xxxx,xxxx,0xfa,0xb4, xxxx,0x81,0xe6,0x48,0x80,0x8c,0xd4,xxxx, /* a0 */
323323//                                     gggg                 ????      gggg gggg
324   xxxx,0x19,0x00,0x19,0x77,0x3d,0x3e,xxxx, xxxx,0xb6,0x4b,xxxx,xxxx,xxxx,xxxx,xxxx, /* b0 */
325//       ???? ???? ???? gggg      ????            ???? pppp
324   xxxx,xxxx,0x84,0xb6,0x77,0x3d,0x3e,xxxx, xxxx,0xb7,0x4b,xxxx,xxxx,xxxx,xxxx,xxxx, /* b0 */
325//            gggg ???? gggg      gggg            ???? pppp
326326   xxxx,0xff,0x47,xxxx,0x55,0x1e,xxxx,0x59, 0x93,xxxx,xxxx,xxxx,0x88,0xc1,0x01,0xb2, /* c0 */
327//            ????                                                         pppp
328   xxxx,0x2e,0x06,0xc7,0x05,xxxx,0x8a,0x5a, 0x58,0xbe,xxxx,0x4a,xxxx,0x1f,0x23,xxxx, /* d0 */
329//                                                          ????
330   0xe8,xxxx,0x89,0xa1,0xd0,xxxx,0x11,0xe2, 0x38,0xfe,0x50,0x9c,xxxx,xxxx,xxxx,0x49, /* e0 */
331//                                ????                      ????                gggg
332   0xfb,xxxx,0xf3,xxxx,xxxx,0x0f,xxxx,xxxx, xxxx,0x7d,0xf7,0xbd,0x39,0x71,0xbf,xxxx, /* f0 */
333//                                                pppp      gggg      pppp
327//            gggg                                                         pppp
328   0x01,0x2e,0x06,0xc7,0x05,xxxx,0x8a,0x5a, 0x58,0xbe,xxxx,0x4e,xxxx,0x1f,0x23,xxxx, /* d0 */
329//  ????                                                    gggg
330   0xe8,xxxx,0x89,0xa1,0xd0,xxxx,xxxx,0xe2, 0x38,0xfe,0x50,0x9c,xxxx,xxxx,xxxx,0x49, /* e0 */
331//                                                          gggg                gggg
332   0xfb,0x20,0xf3,xxxx,xxxx,0x0f,xxxx,xxxx, xxxx,0x76,0xf7,0xbd,0x39,0x7e,0xbf,xxxx, /* f0 */
333//       pppp                                     gggg      gggg      gggg
334334};
335335
336
336337/*
337338missing opcode:
338339
r1679r1680
342343"????" -> missing
343344"0xHH" -> right code (not supported)
344345
34514 -> 08 (2097b 20980 - routine from 2097a) (00 01 08 09 30 31) probably 08 - after the start and before the menu
34614 -> 08 (2097b 20980 - routine from 2097a) (08 30) probably 08 - after the start and before the menu
346347          - to handle the player number
347j19 -> 79 (1df45 routine from 1df27 / 2282f - routine from 2281f to 22871) no 70,71,76,77,78,7a,7b,7c,7e,7f(ok) ok 79,7d
348.26 -> 29 (14ed_ , 198e_
349.41 -> 19
350.46 -> 10 (1461b
351.4e -> 19 (208ac -
352j5a -> 7e (195eb - (222fc - routine from 222ed to ) (7x j...) no 70,71(ok),77,79,7a,7b,7d,7f ok 76,78,7c,7e
353.62 -> 28 (1cf86 1cfa3 - routine from 1cf61 to 1cff4)  (water in level 1) (01 11 19 29)
354j63 -> 78 (1df7f, 1df8c, 1df95, 21f08 - routine from 1df27 to ) no 71(ok),77(ok),7f(ok) ok 70,76,78,79 7a,7b,7c,7d,7e
355j82 -> 76 (76,78,7c,7e) ->
348.40 -> ??
349j5a -> 78 (195eb - (222fc - routine from 222ed to ) (7x j...) no 70,79,7a,7b,7d,7f ok 78,7c,7e
350.62 -> ?? (1cf86 1cfa3 - routine from 1cf61 to 1cff4)  (water in level 1) (01 11 19 29)
3517e ->  (1e073 -
352j82 -> 78 (78,7c,7e) ->
356353.84 -> 18 (1d8f1 - routine from 1d8c7 to 1d8fc) - three bytes (00,08,18,28,30) (sprite animation)
357.9f -> 19 (
358ab -> 42
359.b1 -> 19
360.b2 -> 20 (20a8b - 20acc             probably 20 - after the start and before the menu - to handle the player number
354ab -> 4f?
361355.b3 -> 19 (216b6 - 216cf
362b9 -> b5 (21210 - ) 2 bytes -
363db ->    (16992
364jf9 -> 7c (16d02(f 16cfa)-16598-165a1-18de7(f 18dc4) no 71,77(ok),(icons? 70,76,78,7a,7c,7e),7f maybe 79,7b,7d
356b9 -> b7 (21210 - ) 2 bytes -
365357
358
366359rz probably:
36019 -> 79 (1df45 routine from 1df27 / 2282f - routine from 2281f to 22871) no 70,78,7a,7b,7c,7e,7f(ok) ok 79,7d
3673612d -> 00 (1df1d - routine from 1dee8 to 1df26) -> 00 - to handle sprite animation
36883 -> 7f (194cd - routine from) no 70,71,76,78,79,7a,7c,7d,7e ok 77(no),7b(white rocks) ok 7f
369b4 -> 77 (1d03a, 1d57a - routine from 1d4df ) no 70,71,76,78,79,7a,7b,7c,7d,7e,7f ok 77
36263 -> 7d (1df7f, 1df8c, 1df95, 21f08 - routine from 1df27 to ) no 70,78,7a,7b,7c,7e,7f(ok) ok 79,7d
3637b -> 0d
36483 -> 7f (194cd - routine from) no 70,78,79,7a,7b,7c,7d,7e ok 77(no) ok 7f
36586 -> 2d
370366ba -> 4b (1094d, 10b28 - routine from 10948 to 10b73) one byte -> probably 4b
371c2 -> 47 (22881, 220ff - routine from 22872 to 22885) (4f?)
372367ce -> 01 (10236 - routine from 1017e to 10254) (01, 09, 19, 21, 29, 31) -> probably 01
373fd -> 71 (1d659 - routine from 1d63c to 1d65e) no 70,76,77,78,79,7a,7b,7c,7d,7e,7f  ok 71
368f1 -> 20 to handle the player number
369fd -> 7e (1d659 - routine from 1d63c to 1d65e) no 70,76,77,78,79,7a,7b, 7c,7d,7e,7f  ok 7e
374370
375371rz guess:
37637206 -> b1 (22872 - routine from 22872 to 2289d)
r1679r1680
38237828 -> f8 (
38337929 -> 98 (1df22 - routine from 1dee8 to 1df26) -> 98 - to handle sprite animation
3843802b -> 40 (1d4d2 1db81 1dba9 - routine from 1d4b2 to 1d4de) -> 40
3852c -> 28 (20333 - routine from 2032a to 20366)
3812c -> 28 (20333 - routine from 2032a to 20366) (18,28)
38638234 -> 2f (20381 - routine from 2037b to 20391) - used to handle number of lives and game over
38738352 -> a0
38455 -> 41
38838559 -> 2c (220cf - 2037f - routine from 2202f to ) 2bytes (2c,
3893865b -> 2b (used in "Service Mode" / "CHARACTER menu")
39038766 -> b5 (1daaf - routine from 1da61 to 1daca) - two bytes (colors effect)
3913886a -> 27 (20368 - routine from 20368 to 2037a) - used to limit the max lives number
39238973 -> 73 (1d4f7 - routine from 1d4df to 1d539) -> (no 70,71,72,74,75,76,77,78,79,7a,7b,7c,7d,7e,7f) - ok 73
39339088 -> 9a
39192 -> 9d
39439297 -> cb
395393a7 -> b4 (2029a - routine from 20290 to
396394ad -> 8c (1d559, 1d8d4 - routine from 1d547 - ; routine from 1d8b8 to 1d8fc) ..............................
397395ae -> d4 (20215 - ) used when you insert a coin to handle the "coin number" in decimal
396b2 -> 84 (20a8b - 20acc) 20,21,84,85 (scroll down the object)  - to handle the player number
397b4 -> 77 (1d03a, 1d57a - routine from 1d4df ) no 70,71,76,78,79,7a,7b,7c,7d,7e,7f ok 77
398b6 -> 3e
399c2 -> 47 (22881, 220ff - routine from 22872 to 22885)
400db -> 4e (18b1a)
401eb -> 9c
398402ef -> 49 (dec CW) (used in "Service Mode" / "CHARACTER menu")
403f9 -> 76 (16d02(f 16cfa)-16598-165a1-18de7(f 18dc4) no 71(no),77(no),(icons? 70,76,78,7a,7c,7e),79,7d,7f(no) maybe 76
399404fb -> bd
400405
406
407
401408missing V35+ core:
40240900    -> 63    not supported (229e2 - routine from 229da to 229ec) (for now we use cd instruction + hack)
4034100f 92 -> of 92 not supported (1011d before of STI instruction) (for now no effects)
src/mame/machine/cubocd32.c
r1679r1680
296296   if (cddanum != -1)
297297   {
298298      cdda_start_audio(cddanum, lba, num_blocks);
299      timer_adjust( akiko.frame_timer, ATTOTIME_IN_HZ( 75 ), 0, attotime_zero );
299      timer_adjust_oneshot( akiko.frame_timer, ATTOTIME_IN_HZ( 75 ), 0 );
300300   }
301301}
302302
r1679r1680
315315         }
316316         else
317317         {
318            timer_adjust( akiko.frame_timer, ATTOTIME_IN_HZ( 75 ), 0, attotime_zero );
318            timer_adjust_oneshot( akiko.frame_timer, ATTOTIME_IN_HZ( 75 ), 0 );
319319         }
320320      }
321321   }
r1679r1680
379379         akiko_set_cd_status( 0x80000000 );   /* subcode ready */
380380      }
381381
382      timer_adjust( akiko.frame_timer, ATTOTIME_IN_HZ( 75 ), 0, attotime_zero );
382      timer_adjust_oneshot( akiko.frame_timer, ATTOTIME_IN_HZ( 75 ), 0 );
383383   }
384384}
385385
r1679r1680
484484   if ( akiko.cdrom_readreqmask == 0 )
485485      akiko_set_cd_status(0x04000000);
486486   else
487      timer_adjust( akiko.dma_timer, ATTOTIME_IN_USEC( CD_SECTOR_TIME / akiko.cdrom_speed ), 0, attotime_zero );
487      timer_adjust_oneshot( akiko.dma_timer, ATTOTIME_IN_USEC( CD_SECTOR_TIME / akiko.cdrom_speed ), 0 );
488488}
489489
490490static void akiko_start_dma( void )
r1679r1680
500500
501501   akiko.cdrom_lba_cur = akiko.cdrom_lba_start;
502502
503   timer_adjust( akiko.dma_timer, ATTOTIME_IN_USEC( CD_SECTOR_TIME / akiko.cdrom_speed ), 0, attotime_zero );
503   timer_adjust_oneshot( akiko.dma_timer, ATTOTIME_IN_USEC( CD_SECTOR_TIME / akiko.cdrom_speed ), 0 );
504504}
505505
506506static void akiko_setup_response( int len, UINT8 *r1 )
src/mame/machine/stactics.c
r1679r1680
4848
4949READ8_HANDLER( stactics_horiz_pos_r )
5050{
51    return stactics_horiz_pos+0x80;
51    return stactics_horiz_pos+0x88;
5252}
5353
5454INTERRUPT_GEN( stactics_interrupt )
src/mame/machine/galaxian.c
r1679r1680
6464
6565   param = (param + 0x10) & 0xff;
6666
67   timer_adjust(int_timer, video_screen_get_time_until_pos(0, param, 0), param, attotime_zero);
67   timer_adjust_oneshot(int_timer, video_screen_get_time_until_pos(0, param, 0), param);
6868
6969   TTL7474_update(0);
7070}
r1679r1680
8686
8787   /* start a timer to generate interrupts */
8888   int_timer = timer_alloc(interrupt_timer, NULL);
89   timer_adjust(int_timer, video_screen_get_time_until_pos(0, 0, 0), 0, attotime_zero);
89   timer_adjust_oneshot(int_timer, video_screen_get_time_until_pos(0, 0, 0), 0);
9090}
9191
9292MACHINE_RESET( galaxian )
src/mame/machine/atari.c
r1679r1680
143143   {
144144      logerror("%s MMU SELFTEST ROM\n", Machine->gamedrv->name);
145145      rbank2 = MRA8_BANK2;
146      wbank2 = MWA8_ROM;
146      wbank2 = MWA8_UNMAP;
147147   }
148148   memory_install_read8_handler(0, ADDRESS_SPACE_PROGRAM, 0x5000, 0x57ff, 0, 0, rbank2);
149149   memory_install_write8_handler(0, ADDRESS_SPACE_PROGRAM, 0x5000, 0x57ff, 0, 0, wbank2);
r1679r1680
162162   {
163163      logerror("%s MMU BIOS ROM\n", Machine->gamedrv->name);
164164      rbank3 = MRA8_BANK3;
165      wbank3 = MWA8_ROM;
165      wbank3 = MWA8_UNMAP;
166166      base3 = memory_region(REGION_CPU1)+0x14000;  /* 8K lo BIOS */
167167      rbank4 = MRA8_BANK4;
168      wbank4 = MWA8_ROM;
168      wbank4 = MWA8_UNMAP;
169169      base4 = memory_region(REGION_CPU1)+0x15800;  /* 4K FP ROM + 8K hi BIOS */
170170   }
171171   else
r1679r1680
197197   {
198198      logerror("%s MMU BASIC ROM\n", Machine->gamedrv->name);
199199      rbank1 = MRA8_BANK1;
200      wbank1 = MWA8_ROM;
200      wbank1 = MWA8_UNMAP;
201201      base1 = memory_region(REGION_CPU1)+0x10000;  /* 8K BASIC */
202202   }
203203   memory_install_read8_handler(0, ADDRESS_SPACE_PROGRAM, 0xa000, 0xbfff, 0, 0, rbank1);
r1679r1680
216216   {
217217      logerror("%s MMU SELFTEST ROM\n", Machine->gamedrv->name);
218218      rbank2 = MRA8_BANK2;
219      wbank2 = MWA8_ROM;
219      wbank2 = MWA8_UNMAP;
220220      base2 = memory_region(REGION_CPU1)+0x15000;  /* 0x0800 bytes */
221221   }
222222   memory_install_read8_handler(0, ADDRESS_SPACE_PROGRAM, 0x5000, 0x57ff, 0, 0, rbank2);
src/mame/machine/decocass.c
r1679r1680
149149WRITE8_HANDLER( decocass_sound_nmi_enable_w )
150150{
151151   LOG(2,("CPU #%d sound NMI enb -> $%02x\n", cpu_getactivecpu(), data));
152   timer_adjust(decocass_sound_timer, ATTOTIME_IN_HZ(256 * 57 / 8 / 2), 0, ATTOTIME_IN_HZ(256 * 57 / 8 / 2));
152   timer_adjust_periodic(decocass_sound_timer, ATTOTIME_IN_HZ(256 * 57 / 8 / 2), 0, ATTOTIME_IN_HZ(256 * 57 / 8 / 2));
153153}
154154
155155READ8_HANDLER( decocass_sound_nmi_enable_r )
156156{
157157   UINT8 data = 0xff;
158158   LOG(2,("CPU #%d sound NMI enb <- $%02x\n", cpu_getactivecpu(), data));
159   timer_adjust(decocass_sound_timer, ATTOTIME_IN_HZ(256 * 57 / 8 / 2), 0, ATTOTIME_IN_HZ(256 * 57 / 8 / 2));
159   timer_adjust_periodic(decocass_sound_timer, ATTOTIME_IN_HZ(256 * 57 / 8 / 2), 0, ATTOTIME_IN_HZ(256 * 57 / 8 / 2));
160160   return data;
161161}
162162
r1679r1680
286286
287287   /* on reset also remove the sound timer */
288288   if (data & 1)
289      timer_adjust(decocass_sound_timer, attotime_never, 0, attotime_never);
289      timer_adjust_oneshot(decocass_sound_timer, attotime_never, 0);
290290
291291   /* 8041 active low reset */
292292   cpunum_set_input_line(Machine, 2, INPUT_LINE_RESET, (data & 0x08) ^ 0x08 );
r1679r1680
16031603      decocass_w(A, mem[A]);
16041604   /* restart the timer if the tape was playing */
16051605   if (0 != tape_dir)
1606      timer_adjust(tape_timer, attotime_never, 0, attotime_never);
1606      timer_adjust_oneshot(tape_timer, attotime_never, 0);
16071607#endif
16081608}
16091609
r1679r1680
19851985   /* remember time */
19861986   tape_time0 = decocass_adjust_tape_time(tape_time0);
19871987
1988   timer_adjust(tape_timer, attotime_never, 0, attotime_never);
1988   timer_adjust_oneshot(tape_timer, attotime_never, 0);
19891989}
19901990
19911991
r1679r1680
20182018      {
20192019         LOG(2,("tape %5.4fs: rewind\n", attotime_to_double(tape_time0)));
20202020         tape_dir = -1;
2021         timer_adjust(tape_timer, attotime_never, 0, attotime_never);
2021         timer_adjust_oneshot(tape_timer, attotime_never, 0);
20222022         set_led_status(0, 1);
20232023      }
20242024      else
r1679r1680
20412041      {
20422042         LOG(2,("tape %5.4fs: forward\n", attotime_to_double(tape_time0)));
20432043         tape_dir = +1;
2044         timer_adjust(tape_timer, attotime_never, 0, attotime_never);
2044         timer_adjust_oneshot(tape_timer, attotime_never, 0);
20452045         set_led_status(0, 1);
20462046      }
20472047      else
r1679r1680
20662066      {
20672067         LOG(2,("tape: fast rewind %s\n", (0 == (data & 0x04)) ? "on" : "off"));
20682068         tape_dir = (tape_speed) ? -7 : -1;
2069         timer_adjust(tape_timer, attotime_never, 0, attotime_never);
2069         timer_adjust_oneshot(tape_timer, attotime_never, 0);
20702070      }
20712071      else
20722072      if (tape_dir > 0)
20732073      {
20742074         LOG(2,("tape: fast forward %s\n", (0 == (data & 0x04)) ? "on" : "off"));
20752075         tape_dir = (tape_speed) ? +7 : +1;
2076         timer_adjust(tape_timer, attotime_never, 0, attotime_never);
2076         timer_adjust_oneshot(tape_timer, attotime_never, 0);
20772077      }
20782078   }
20792079
src/mame/machine/irobot.c
r1679r1680
113113      else
114114         logerror("vg start [busy!] ");
115115      IR_CPU_STATE;
116      timer_adjust(irvg_timer, ATTOTIME_IN_MSEC(10), 0, attotime_zero);
116      timer_adjust_oneshot(irvg_timer, ATTOTIME_IN_MSEC(10), 0);
117117#endif
118118      irvg_running=1;
119119   }
r1679r1680
851851#if IR_TIMING
852852   if (irmb_running == 0)
853853   {
854      timer_adjust(irmb_timer, attotime_mul(ATTOTIME_IN_HZ(12000000), icount), 0, attotime_zero);
854      timer_adjust_oneshot(irmb_timer, attotime_mul(ATTOTIME_IN_HZ(12000000), icount), 0);
855855      logerror("mb start ");
856856      IR_CPU_STATE;
857857   }
r1679r1680
859859   {
860860      logerror("mb start [busy!] ");
861861      IR_CPU_STATE;
862      timer_adjust(irmb_timer, attotime_mul(ATTOTIME_IN_NSEC(200), icount), 0, attotime_zero);
862      timer_adjust_oneshot(irmb_timer, attotime_mul(ATTOTIME_IN_NSEC(200), icount), 0);
863863   }
864864#else
865865   cpunum_set_input_line(Machine, 0, M6809_FIRQ_LINE, ASSERT_LINE);
src/mame/machine/leland.c
r1679r1680
368368
369369MACHINE_RESET( leland )
370370{
371   timer_adjust(master_int_timer, video_screen_get_time_until_pos(0, 8, 0), 8, attotime_zero);
371   timer_adjust_oneshot(master_int_timer, video_screen_get_time_until_pos(0, 8, 0), 8);
372372
373373   /* reset globals */
374374   leland_gfx_control = 0x00;
r1679r1680
422422MACHINE_RESET( ataxx )
423423{
424424   memset(extra_tram, 0, ATAXX_EXTRA_TRAM_SIZE);
425   timer_adjust(master_int_timer, video_screen_get_time_until_pos(0, 8, 0), 8, attotime_zero);
425   timer_adjust_oneshot(master_int_timer, video_screen_get_time_until_pos(0, 8, 0), 8);
426426
427427   /* initialize the XROM */
428428   xrom_length = memory_region_length(REGION_USER1);
r1679r1680
474474   scanline += 16;
475475   if (scanline > 248)
476476      scanline = 8;
477   timer_adjust(master_int_timer, video_screen_get_time_until_pos(0, scanline, 0), scanline, attotime_zero);
477   timer_adjust_oneshot(master_int_timer, video_screen_get_time_until_pos(0, scanline, 0), scanline);
478478}
479479
480480
r1679r1680
486486   cpunum_set_input_line(machine, 0, 0, HOLD_LINE);
487487
488488   /* set a timer for the next one */
489   timer_adjust(master_int_timer, video_screen_get_time_until_pos(0, scanline, 0), scanline, attotime_zero);
489   timer_adjust_oneshot(master_int_timer, video_screen_get_time_until_pos(0, scanline, 0), scanline);
490490}
491491
492492
r1679r1680
12711271         break;
12721272
12731273      case 0x08:   /*  */
1274         timer_adjust(master_int_timer, video_screen_get_time_until_pos(0, data + 1, 0), data + 1, attotime_zero);
1274         timer_adjust_oneshot(master_int_timer, video_screen_get_time_until_pos(0, data + 1, 0), data + 1);
12751275         break;
12761276
12771277      default:
src/mame/machine/midwayic.c
r1679r1680
442442               /* otherwise, flag the time as having just been written for 1/2 second */
443443               else
444444               {
445                  timer_adjust(pic.time_write_timer, ATTOTIME_IN_MSEC(500), 0, attotime_zero);
445                  timer_adjust_oneshot(pic.time_write_timer, ATTOTIME_IN_MSEC(500), 0);
446446                  pic.time_just_written = 1;
447447                  pic.state = 0;
448448               }
src/mame/machine/konamigx.c
r1679r1680
257257   ecx = tx = -tx;
258258
259259   tilebpp = (tilebpp-1) & 7;
260   pal_base = Machine->remapped_colortable;
260   pal_base = Machine->pens;
261261   cmask = colormask[tilebpp];
262262
263263   src_pitch = src_bitmap->rowpixels;
r1679r1680
522522   src_fh    = 16;
523523   src_base  = gfx->gfxdata + (code % gfx->total_elements) * gfx->char_modulo;
524524
525   pal_base  = Machine->remapped_colortable + gfx->color_base + (color % gfx->total_colors) * granularity;
525   pal_base  = Machine->pens + gfx->color_base + (color % gfx->total_colors) * granularity;
526526   shd_base  = Machine->shadow_table;
527527
528528   dst_ptr   = bitmap->base;
src/mame/machine/stvcd.c
r1679r1680
198198   cr3 = (cd_curfad>>16)&0xff;
199199   cr4 = cd_curfad;
200200
201   timer_adjust(sector_timer, ATTOTIME_IN_HZ(150), 0, attotime_zero);
201   timer_adjust_oneshot(sector_timer, ATTOTIME_IN_HZ(150), 0);
202202}
203203
204204// global functions
r1679r1680
274274   }
275275
276276   sector_timer = timer_alloc(sector_cb, NULL);
277   timer_adjust(sector_timer, ATTOTIME_IN_HZ(150), 0, attotime_zero);   // 150 sectors / second = 300kBytes/second
277   timer_adjust_oneshot(sector_timer, ATTOTIME_IN_HZ(150), 0);   // 150 sectors / second = 300kBytes/second
278278}
279279
280280static blockT *cd_alloc_block(UINT8 *blknum)
r1679r1680
776776
777777         // and do the disc I/O
778778         // make sure it doesn't come in too early
779         timer_adjust(sector_timer, attotime_never, 0, attotime_never);
780         timer_adjust(sector_timer, ATTOTIME_IN_HZ(150), 0, attotime_zero);   // 150 sectors / second = 300kBytes/second
779         timer_adjust_oneshot(sector_timer, attotime_never, 0);
780         timer_adjust_oneshot(sector_timer, ATTOTIME_IN_HZ(150), 0);   // 150 sectors / second = 300kBytes/second
781781         break;
782782
783783      case 0x1100: // disk seek
r1679r1680
12851285         playtype = 1;
12861286
12871287         // and do the disc I/O
1288//          timer_adjust(sector_timer, ATTOTIME_IN_HZ(150), 0, attotime_zero);  // 150 sectors / second = 300kBytes/second
1288//          timer_adjust_oneshot(sector_timer, ATTOTIME_IN_HZ(150), 0);  // 150 sectors / second = 300kBytes/second
12891289         break;
12901290
12911291      case 0x7500:
src/mame/machine/ticket.c
r1679r1680
9797      if (!dispenser[0].power)
9898      {
9999         LOG(("PC: %04X  Ticket Power On\n", activecpu_get_pc()));
100         timer_adjust(dispenser[0].timer, ATTOTIME_IN_MSEC(time_msec), 0, attotime_zero);
100         timer_adjust_oneshot(dispenser[0].timer, ATTOTIME_IN_MSEC(time_msec), 0);
101101         dispenser[0].power = 1;
102102
103103         dispenser[0].status = ticketnotdispensed;
r1679r1680
108108      if (dispenser[0].power)
109109      {
110110         LOG(("PC: %04X  Ticket Power Off\n", activecpu_get_pc()));
111         timer_adjust(dispenser[0].timer, attotime_never, 0, attotime_never);
111         timer_adjust_oneshot(dispenser[0].timer, attotime_never, 0);
112112         set_led_status(2,0);
113113         dispenser[0].power = 0;
114114      }
r1679r1680
123123      if (!dispenser[1].power)
124124      {
125125         LOG(("PC: %04X  Ticket Power On\n", activecpu_get_pc()));
126         timer_adjust(dispenser[1].timer, ATTOTIME_IN_MSEC(time_msec), 0, attotime_zero);
126         timer_adjust_oneshot(dispenser[1].timer, ATTOTIME_IN_MSEC(time_msec), 0);
127127         dispenser[1].power = 1;
128128
129129         dispenser[1].status = ticketnotdispensed;
r1679r1680
134134      if (dispenser[1].power)
135135      {
136136         LOG(("PC: %04X  Ticket Power Off\n", activecpu_get_pc()));
137         timer_adjust(dispenser[1].timer, attotime_never, 0, attotime_never);
137         timer_adjust_oneshot(dispenser[1].timer, attotime_never, 0);
138138         set_led_status(2,0);
139139         dispenser[1].power = 0;
140140      }
r1679r1680
158158   {
159159      dispenser->status ^= active_bit;
160160      LOG(("Ticket Status Changed to %02X\n", dispenser->status));
161      timer_adjust(dispenser->timer, ATTOTIME_IN_MSEC(time_msec), 0, attotime_zero);
161      timer_adjust_oneshot(dispenser->timer, ATTOTIME_IN_MSEC(time_msec), 0);
162162   }
163163
164164   if (dispenser->status == ticketdispensed)
src/mame/machine/namcoio.c
r1679r1680
10051005   if ((customio_command[chip] & 0x0f) == 0)
10061006   {
10071007      LOG(("disabling nmi generate timer\n"));
1008      timer_adjust(nmi_timer[chip], attotime_never, chip, attotime_never);
1008      timer_adjust_oneshot(nmi_timer[chip], attotime_never, chip);
10091009   }
10101010   else
10111011   {
r1679r1680
10151015      // inputs if a transfer terminates at the wrong time.
10161016      // On the other hand, the time cannot be too short otherwise the 54XX will
10171017      // not have enough time to process the incoming commands.
1018      timer_adjust(nmi_timer[chip], ATTOTIME_IN_USEC(200), chip, ATTOTIME_IN_USEC(200));
1018      timer_adjust_periodic(nmi_timer[chip], ATTOTIME_IN_USEC(200), chip, ATTOTIME_IN_USEC(200));
10191019
10201020      if (customio_command[chip] & 0x10)
10211021      {
src/mame/machine/dc.c
r1679r1680
66
77#include "driver.h"
88#include "deprecat.h"
9#include "debugger.h"
910#include "dc.h"
1011#include "cpu/sh4/sh4.h"
1112
r1679r1680
119120UINT32 sysctrl_regs[0x200/4];
120121static UINT32 maple_regs[0x100/4];
121122static UINT32 dc_rtcregister[4];
123static UINT32 g1bus_regs[0x100/4];
124extern UINT32 dma_offset;
125static UINT8 maple0x86data1[0x80];
126static UINT8 maple0x86data2[0x400];
122127
123128static UINT32 maple0x82answer[]=
124129{
r1679r1680
137142   // non 32-bit accesses have not yet been seen here, we need to know when they are
138143   if ((mem_mask != U64(0x00000000ffffffff)) && (mem_mask != U64(0xffffffff00000000)))
139144   {
140      assert_always(0, "Wrong mask!\n");
145      mame_printf_verbose("Wrong mask! (PC=%x)\n", activecpu_get_pc());
146      #ifdef ENABLE_DEBUGGER
147      mame_debug_break();
148      #endif
141149   }
142150
143151   if (mem_mask == U64(0x00000000ffffffff))
r1679r1680
214222   reg = decode_reg_64(offset, mem_mask, &shift);
215223
216224   #if DEBUG_SYSCTRL
217   if ((reg != 0x40) && (reg != 0x42))   // filter out IRQ status reads
225   if ((reg != 0x40) && (reg != 0x42) && (reg != 0x23) && (reg > 2))   // filter out IRQ status reads
218226   {
219      mame_printf_verbose("SYSCTRL: read %x @ %x (reg %x: %s), mask %llx (PC=%x)\n", sysctrl_regs[reg], offset, reg, sysctrl_names[reg], mem_mask, activecpu_get_pc());
227      mame_printf_verbose("SYSCTRL: [%08x] read %x @ %x (reg %x: %s), mask %llx (PC=%x)\n", 0x5f6800+reg*4, sysctrl_regs[reg], offset, reg, sysctrl_names[reg], mem_mask, activecpu_get_pc());
220228   }
221229   #endif
222230
r1679r1680
243251         ddtdata.direction=0;
244252         ddtdata.channel=2;
245253         ddtdata.mode=25; //011001
254         /*if (pp == 1)
255                if (sysctrl_regs[SB_C2DLEN] == 0x240)
256                    pp=pp+1;*/
246257         cpunum_set_info_ptr(0,CPUINFO_PTR_SH4_EXTERNAL_DDT_DMA,&ddtdata);
258         #if DEBUG_SYSCTRL
259         mame_printf_verbose("SYSCTRL: Ch2 dma %x from %08x to %08x (lmmode0=%d lmmode1=%d)\n", sysctrl_regs[SB_C2DLEN], ddtdata.source-ddtdata.length, sysctrl_regs[SB_C2DSTAT],sysctrl_regs[SB_LMMODE0],sysctrl_regs[SB_LMMODE1]);
260         #endif
247261         sysctrl_regs[SB_C2DSTAT]=sysctrl_regs[SB_C2DSTAT]+ddtdata.length;
248262         sysctrl_regs[SB_C2DLEN]=0;
249263         sysctrl_regs[SB_C2DST]=0;
r1679r1680
265279   update_interrupt_status();
266280
267281   #if DEBUG_SYSCTRL
268   if ((reg != 0x40) && (reg != 0x42))   // filter out IRQ acks
282   if ((reg != 0x40) && (reg != 0x42) && (reg > 2))   // filter out IRQ acks and ch2 dma
269283   {
270      mame_printf_verbose("SYSCTRL: write %llx to %x (reg %x: %s), mask %llx\n", data>>shift, offset, reg, sysctrl_names[reg], mem_mask);
284      mame_printf_verbose("SYSCTRL: write %llx to %x (reg %x), mask %llx\n", data>>shift, offset, reg, /*sysctrl_names[reg],*/ mem_mask);
271285   }
272286   #endif
273287}
r1679r1680
279293
280294   reg = decode_reg_64(offset, mem_mask, &shift);
281295
296   #if DEBUG_MAPLE
297   mame_printf_verbose("MAPLE:  Unmapped read %08x\n", 0x5f6c00+reg*4);
298   #endif
282299   return (UINT64)maple_regs[reg] << shift;
283300}
284301
r1679r1680
290307   struct sh4_ddt_dma ddtdata;
291308   UINT32 buff[512];
292309   UINT32 endflag,port,pattern,length,command,dap,sap,destination;
310   static int jvs_command = 0,jvs_address = 0;
293311   int chk;
294312   int a;
313   int off,len;
295314
296315   reg = decode_reg_64(offset, mem_mask, &shift);
297316   dat = (UINT32)(data >> shift);
298317   old = maple_regs[reg];
299318
300319   #if DEBUG_MAPLE
301   mame_printf_verbose("MAPLE: write %llx to %x (reg %x: %s), mask %llx\n", data >> shift, offset, reg, maple_names[reg], mem_mask);
320   mame_printf_verbose("MAPLE: [%08x=%x] write %llx to %x (reg %x: %s), mask %llx\n", 0x5f6c00+reg*4, dat, data >> shift, offset, reg, maple_names[reg], mem_mask);
302321   #endif
303322
304323   maple_regs[reg] = dat; // 5f6c00+reg*4=dat
r1679r1680
314333            dat=maple_regs[SB_MDSTAR];
315334            while (1) // do transfers
316335            {
317               ddtdata.source=dat;
318               ddtdata.length=3;
319               ddtdata.size=4;
320               ddtdata.buffer=buff;
321               ddtdata.direction=0;
322               ddtdata.channel= -1;
323               ddtdata.mode= -1;
336               ddtdata.source=dat;      // source address
337               ddtdata.length=3;      // words to transfer
338               ddtdata.size=4;         // bytes per word
339               ddtdata.buffer=buff;   // destination buffer
340               ddtdata.direction=0;   // 0 source to buffer, 1 buffer to source
341               ddtdata.channel= -1;   // not used
342               ddtdata.mode= -1;      // copy from/to buffer
324343               cpunum_set_info_ptr(0, CPUINFO_PTR_SH4_EXTERNAL_DDT_DMA, &ddtdata);
325344
326345               maple_regs[reg] = 0;
r1679r1680
340359                  switch (command)
341360                  {
342361                     case 1:
343                        ddtdata.length=1;
344                        break;
345362                     case 3:
346363                        ddtdata.length=1;
364                        #if DEBUG_MAPLE
365                        mame_printf_verbose("MAPLE: transfer command %d port %d\n", command, port);
366                        #endif
347367                        break;
348                     case 0x80: // compute checksum
368                     case 0x80: // get data and compute checksum
349369                        ddtdata.length=length;
350370                        ddtdata.direction=0;
351371                        ddtdata.channel= -1;
r1679r1680
359379                           chk=chk+(signed char)((buff[a] >> 16) & 255);
360380                           chk=chk+(signed char)((buff[a] >> 24) & 255);
361381                        }
362                        chk=chk+(buff[0] & 255);
382                        chk=chk+(buff[0] & 255); // address (big endian !) last is 0xffffffff
363383                        chk=chk+((buff[0] >> 8) & 255);
364384                        chk=chk+((buff[0] >> 16) & 255);
365385                        chk=chk+((buff[0] >> 24) & 255);
r1679r1680
380400                        ddtdata.mode=-1;
381401                        cpunum_set_info_ptr(0,CPUINFO_PTR_SH4_EXTERNAL_DDT_DMA,&ddtdata);
382402
383                        if ((buff[0] & 0xff) == 3)
403                        if ((buff[0] & 0xff) == 3) // read data
384404                        {
385                           buff[1]=0x14131211;
386                           for (a=0;a < 31;a++)
405                           for (a=0;a < 0x80;a+=4)
387406                           {
388                              buff[2+a]=buff[1+a]+0x04040404;
407                              buff[1+a/4]=(maple0x86data1[a+3] << 24)+(maple0x86data1[a+2] << 16)+(maple0x86data1[a+1] << 8)+maple0x86data1[a];
389408                           }
390                           buff[1]=0x1413b1b9; // put checksum
391                           buff[5]=0x8ab82221; // put checksum
392409                           ddtdata.length=0x84/4;
393410                        }
394                        else if (((buff[0] & 0xff) == 0x31) || ((buff[0] & 0xff) == 0xb) || ((buff[0] & 0xff) == 0x1))
411                        else if ((buff[0] & 0xff) == 0xb) // store data
395412                        {
413                           off=(buff[0] >> 8) & 0xff;
414                           len=(buff[0] >> 16) & 0xff;
415                           for (a=0;a < len;a++)
416                              maple0x86data1[off+a]=(buff[1+a/4] >> (a & 3) * 8) & 255;
417                        }
418                        else if (((buff[0] & 0xff) == 0x31) || ((buff[0] & 0xff) == 0x1))
419                        {
396420                           ddtdata.length=1;
397421                        }
398422                        else if ((buff[0] & 0xff) == 0x17) // send command into jvs serial bus !!!
399423                        {
400                           // 17,*c295407 (77),*c295404,*c295405,*c295406,0,ff,2,f0,d9, 0
401                           // 17,*c295407 (77),*c295404,*c295405,*c295406,0,ff,2,f1,01, 0
402                           // 17,*c295407 (77),*c295404,*c295405,*c295406,0,01,1,10,    01,0
403                           switch (buff[2] & 0xff) // jvs command
404                           {
405                              case 0xf0:
406                              case 0xf1:
407                              case 0x10:
408                                 break;
409                           }
410                           buff[1]=0xe4e3e2e1;
411                           ddtdata.length=2;
424                           // Examples:
425                           // 17,*c295407 (77),*c295404,*c295405,*c295406,0,ff,2,f0,d9, 0 // ff broadcast
426                           // 17,*c295407 (77),*c295404,*c295405,*c295406,0,ff,2,f1,01, 0 // 01 can be any from 01 to 0x1f
427                           // 17,*c295407 (77),*c295404,*c295405,*c295406,0,01,1,10,    01,0 // 01 is address
428                           // Currently:
429                           // 17,?,?,?,?,?,slave address,length,jvs command bytes...
430                           jvs_address = (buff[1] >> 16) & 0xff; // slave address
431                           jvs_command = buff[2] & 0xff; // jvs command
432                           #if DEBUG_MAPLE
433                           mame_printf_verbose("MAPLE: sent jvs command %d\n", jvs_command);
434                           #endif
435                           buff[1] = 0xe4e3e2e1;
436                           ddtdata.length = 2;
412437                        }
413                        else if ((buff[0] & 0xff) == 0x15)
438                        else if ((buff[0] & 0xff) == 0x15) // get response from previous jvs command
414439                        {
440                           int tocopy;
415441                           // 15,0,0,0
416                           buff[1]=0xA4A3A2A1;
417                           for (a=0;a < 7;a++)
442                           maple0x86data1[0] = 0xa0;
443                           for (a=1;a < 32;a++)
444                              maple0x86data2[a] = maple0x86data2[a-1] + 1;
445                           buff[1] = 0xA3A2A1A0;
446                           for (a=0;a < 9;a++)
418447                           {
419448                              buff[2+a]=buff[1+a]+0x04040404;
420449                           }
421                           buff[1]=buff[1] | 0x0c000000;
422                           buff[2]=buff[2] & 0xFFCFFFFF;
450                           buff[1] = buff[1] | 0x0c000000;
451                           maple0x86data2[3] = maple0x86data2[3] | 0x0c;
452                           buff[2] = buff[2] & 0xFFCFFFFF;
453                           maple0x86data2[6] = maple0x86data2[6] & 0xcf;
423454
424                           a=readinputport(0); // mettere qui tasti
425                           buff[2]=buff[2] | (a << 20);
426                           *(((unsigned char *)buff)+0x18)=0;
427                           *(((unsigned char *)buff)+0x1d)=1;
428                           *(((unsigned char *)buff)+0x16)=0x8e;
429                           ddtdata.length=9;
455                           a = readinputport(0); // put keys here
456                           buff[2]= buff[2] | (a << 20);
457                           maple0x86data2[6] = maple0x86data2[6] | (a << 4);
458                           if (jvs_command)
459                              *(((unsigned char *)buff)+0x15+2)=jvs_address;
460                           else
461                              *(((unsigned char *)buff)+0x15+2)=0;
462                           *(((unsigned char *)buff)+0x15+3)=0;
463                           *(((unsigned char *)buff)+0x15+8)=1;
464                           *(((unsigned char *)buff)+0x15+1)=0x8e;
465                           if (jvs_command)
466                              maple0x86data2[0x11+2] = jvs_address;
467                           else
468                              maple0x86data2[0x11+2] = 0;
469                           maple0x86data2[0x11+3] = 0;
470                           maple0x86data2[0x11+8] = 1;
471                           maple0x86data2[0x11+1] = 0x8e;
472                           maple0x86data2[0x11+9] = 1;
473                           // 4 + 1 + 0x10 + ?,8e,addr,0,?,?,addr?,len,status,report1,jvsbytes...
474                           ddtdata.length=11;
475                           tocopy=27;
476                           *(((unsigned char *)buff)+0x15+9)=1;
477                           switch (jvs_command)
478                           {
479                              case 0xf0: // reset
480                              case 0xf1: // set address
481                                 break;
482                              case 0x10:
483                                 strcpy((char *)(maple0x86data2+0x11+10), "MAME test JVS I/O board"); // name
484                                 maple0x86data2[0x11+7]=24+2;
485                                 tocopy += 24;
486                                 break;
487                              case 0x11:
488                                 maple0x86data2[0x11+10]=0x13; // version bcd
489                                 maple0x86data2[0x11+7]=1+2;
490                                 tocopy += 1;
491                                 break;
492                              case 0x12:
493                                 maple0x86data2[0x11+10]=0x30; // version bcd
494                                 maple0x86data2[0x11+7]=1+2;
495                                 tocopy += 1;
496                                 break;
497                              case 0x13:
498                                 maple0x86data2[0x11+10]=0x10; // version bcd
499                                 maple0x86data2[0x11+7]=1+2;
500                                 tocopy += 1;
501                                 break;
502                              case 0x14:
503                                 // four bytes for every available function
504                                 // first function
505                                 maple0x86data2[0x11+10]=1;
506                                 maple0x86data2[0x11+11]=2; // number of players
507                                 maple0x86data2[0x11+12]=7;
508                                 maple0x86data2[0x11+13]=0;
509                                 // second function
510                                 maple0x86data2[0x11+14]=2;
511                                 maple0x86data2[0x11+15]=2; // number of coin slots
512                                 maple0x86data2[0x11+16]=0;
513                                 maple0x86data2[0x11+17]=0;
514                                 // third function
515                                 maple0x86data2[0x11+18]=3;
516                                 maple0x86data2[0x11+19]=2; // channels
517                                 maple0x86data2[0x11+20]=8; // bits
518                                 maple0x86data2[0x11+21]=0;
519                                 // no more functions
520                                 maple0x86data2[0x11+22]=0;
521                                 maple0x86data2[0x11+7]=13+2;
522                                 tocopy += 13;
523                                 break;
524                              case 0x21:
525                                 maple0x86data2[0x11+10]=0; // bits 7-6 status bits 5-0 higer bits of coin count
526                                 maple0x86data2[0x11+11]=0; // lower bits of coin count
527                                 maple0x86data2[0x11+12]=0; // like previuos two but for second coin slot
528                                 maple0x86data2[0x11+13]=0;
529                                 maple0x86data2[0x11+7]=4+2;
530                                 tocopy += 4;
531                                 break;
532                           }
533                           for (a=0;a < tocopy;a=a+4)
534                              buff[1+a/4] = maple0x86data2[a] | (maple0x86data2[a+1] << 8) | (maple0x86data2[a+2] << 16) | (maple0x86data2[a+3] << 24);
535                           jvs_command=0;
536                           ddtdata.length = (tocopy+7)/4;
430537                        }
431538                        else if ((buff[0] & 0xff) == 0x21)
432539                        {
r1679r1680
438545                           ddtdata.length=1;
439546                        }
440547                        break;
548                     default:
549                        #if DEBUG_MAPLE
550                        mame_printf_verbose("MAPLE: unknown transfer command %d port %d\n", command, port);
551                        #endif
552                        break;
441553                  }
442554               }
443555               ddtdata.destination=destination;
r1679r1680
459571      }
460572      break;
461573   }
462#if DEBUG_MAPLE
463   mame_printf_verbose("MAPLE: write %llx to %x, mask %llx\n", data, offset, mem_mask);
464#endif
465574}
466575
467576READ64_HANDLER( dc_gdrom_r )
r1679r1680
500609      off=offset << 1;
501610   }
502611
503   mame_printf_verbose("GDROM: write %llx to %x, mask %llx\n", data, offset, mem_mask);
612   mame_printf_verbose("GDROM: [%08x=%x]write %llx to %x, mask %llx\n", 0x5f7000+off*4, dat, data, offset, mem_mask);
504613}
505614
506615READ64_HANDLER( dc_g1_ctrl_r )
507616{
508   return 0;
617   int reg;
618   UINT64 shift;
619
620   reg = decode_reg_64(offset, mem_mask, &shift);
621   mame_printf_verbose("G1CTRL:  Unmapped read %08x\n", 0x5f7400+reg*4);
622   return (UINT64)g1bus_regs[reg] << shift;
509623}
510624
511625WRITE64_HANDLER( dc_g1_ctrl_w )
512626{
513   mame_printf_verbose("G1CTRL: write %llx to %x, mask %llx\n", data, offset, mem_mask);
627   int reg;
628   UINT64 shift;
629   UINT32 old,dat;
630   struct sh4_ddt_dma ddtdata;
631   UINT8 *ROM = (UINT8 *)memory_region(REGION_USER1);
632
633   reg = decode_reg_64(offset, mem_mask, &shift);
634   dat = (UINT32)(data >> shift);
635   old = g1bus_regs[reg];
636
637   g1bus_regs[reg] = dat; // 5f6c00+reg*4=dat
638   mame_printf_verbose("G1CTRL: [%08x=%x] write %llx to %x, mask %llx\n", 0x5f7400+reg*4, dat, data, offset, mem_mask);
639   switch (reg)
640   {
641   case SB_GDST:
642      if (!(old & 1) && (dat & 1)) // 0 -> 1
643      {
644         if ((g1bus_regs[SB_GDEN] == 0) || (g1bus_regs[SB_GDDIR] == 0))
645         {
646            mame_printf_verbose("G1CTRL: unsupported transfer\n");
647            return;
648         }
649         ddtdata.destination=g1bus_regs[SB_GDSTAR];      // destination address
650         ddtdata.length=g1bus_regs[SB_GDLEN] >> 5;      // words to transfer
651         ddtdata.size=32;         // bytes per word
652         ddtdata.buffer=ROM+dma_offset;   // buffer address
653         ddtdata.direction=1;   // 0 source to buffer, 1 buffer to destination
654         ddtdata.channel= -1;   // not used
655         ddtdata.mode= -1;      // copy from/to buffer
656         mame_printf_verbose("G1CTRL: transfer %x from ROM %08x to sdram %08x\n", g1bus_regs[SB_GDLEN], dma_offset, g1bus_regs[SB_GDSTAR]);
657         cpunum_set_info_ptr(0, CPUINFO_PTR_SH4_EXTERNAL_DDT_DMA, &ddtdata);
658         g1bus_regs[SB_GDST]=0;
659         sysctrl_regs[SB_ISTNRM] |= (1 << 14);
660      }
661      break;
662   }
514663}
515664
516665READ64_HANDLER( dc_g2_ctrl_r )
517666{
667   int reg;
668   UINT64 shift;
669
670   reg = decode_reg_64(offset, mem_mask, &shift);
671   mame_printf_verbose("G2CTRL:  Unmapped read %08x\n", 0x5f7800+reg*4);
518672   return 0;
519673}
520674
521675WRITE64_HANDLER( dc_g2_ctrl_w )
522676{
523   mame_printf_verbose("G2CTRL: write %llx to %x, mask %llx\n", data, offset, mem_mask);
677   int reg;
678   UINT64 shift;
679   UINT32 dat;
680
681   reg = decode_reg_64(offset, mem_mask, &shift);
682   dat = (UINT32)(data >> shift);
683   mame_printf_verbose("G2CTRL: [%08x=%x] write %llx to %x, mask %llx\n", 0x5f7800+reg*4, dat, data, offset, mem_mask);
524684}
525685
526686READ64_HANDLER( dc_modem_r )
527687{
688   int reg;
689   UINT64 shift;
690
691   reg = decode_reg_64(offset, mem_mask, &shift);
692   mame_printf_verbose("MODEM:  Unmapped read %08x\n", 0x600000+reg*4);
528693   return 0;
529694}
530695
531696WRITE64_HANDLER( dc_modem_w )
532697{
533   mame_printf_verbose("MODEM: write %llx to %x, mask %llx\n", data, offset, mem_mask);
698   int reg;
699   UINT64 shift;
700   UINT32 dat;
701
702   reg = decode_reg_64(offset, mem_mask, &shift);
703   dat = (UINT32)(data >> shift);
704   mame_printf_verbose("MODEM: [%08x=%x] write %llx to %x, mask %llx\n", 0x600000+reg*4, dat, data, offset, mem_mask);
534705}
535706
536707READ64_HANDLER( dc_rtc_r )
537708{
709   int reg;
710   UINT64 shift;
711
712   reg = decode_reg_64(offset, mem_mask, &shift);
713   mame_printf_verbose("RTC:  Unmapped read %08x\n", 0x710000+reg*4);
538714   return 0;
539715}
540716
541717WRITE64_HANDLER( dc_rtc_w )
542718{
543UINT32 dat,off;
544UINT32 old;
719   int reg;
720   UINT64 shift;
721   UINT32 old,dat;
545722
546   if ((int)mem_mask & 1) {
547      dat=(UINT32)(data >> 32);
548      off=(offset << 1) | 1;
549   } else {
550      dat=(UINT32)data;
551      off=offset << 1;
723   reg = decode_reg_64(offset, mem_mask, &shift);
724   dat = (UINT32)(data >> shift);
725   old = dc_rtcregister[reg];
726   dc_rtcregister[reg] = dat & 0xFFFF; // 5f6c00+off*4=dat
727   switch (reg)
728   {
729   case RTC1:
730      if (dc_rtcregister[RTC3])
731         dc_rtcregister[RTC3] = 0;
732      else
733         dc_rtcregister[reg] = old;
734      break;
735   case RTC2:
736      if (dc_rtcregister[RTC3] == 0)
737         dc_rtcregister[reg] = old;
738      break;
739   case RTC3:
740      dc_rtcregister[RTC3] &= 1;
741      break;
552742   }
553   old = dc_rtcregister[off];
554   dc_rtcregister[off] = dat & 0xFFFF; // 5f6c00+off*4=dat
555/*  switch (off)
556    {
557    case RTC1:
558        if (dc_rtcregister[RTC3])
559            dc_rtcregister[RTC3] = 0;
560        else
561            dc_rtcregister[off] = old;
562        break;
563    case RTC2:
564        if (dc_rtcregister[RTC3] == 0)
565            dc_rtcregister[off] = old;
566        break;
567    case RTC3:
568        dc_rtcregister[RTC3] &= 1;
569        break;
570    }*/
571   mame_printf_verbose("RTC: write %llx to %x, mask %llx\n", data, offset, mem_mask);
743   mame_printf_verbose("RTC: [%08x=%x] write %llx to %x, mask %llx\n", 0x710000 + reg*4, dat, data, offset, mem_mask);
572744}
573745
574746/*static void dc_rtc_increment(void)
r1679r1680
580752
581753MACHINE_RESET( dc )
582754{
755int a;
756
583757   /* halt the ARM7 */
584758   cpunum_set_input_line(machine, 1, INPUT_LINE_RESET, ASSERT_LINE);
585759
r1679r1680
588762   memset(dc_rtcregister, 0, sizeof(dc_rtcregister));
589763
590764   sysctrl_regs[SB_SBREV] = 0x0b;
765   for (a=0;a < 0x80;a++)
766      maple0x86data1[a]=0x11+a;
767   // checksums
768    maple0x86data1[0]=0xb9;
769    maple0x86data1[1]=0xb1;
770    maple0x86data1[18]=0xb8;
771    maple0x86data1[19]=0x8a;
591772}
592773
593774READ64_HANDLER( dc_aica_reg_r )
r1679r1680
597778
598779   reg = decode_reg_64(offset, mem_mask, &shift);
599780
600//  logerror("dc_aica_reg_r: Unmapped read %08x\n", 0x700000+reg*4);
781   mame_printf_verbose("AICA REG: [%08x] read %llx, mask %llx\n", 0x700000+reg*4, (UINT64)offset, mem_mask);
601782   return 0;
602783}
603784
r1679r1680
623804         cpunum_set_input_line(Machine, 1, INPUT_LINE_RESET, CLEAR_LINE);
624805      }
625806        }
626   mame_printf_verbose("AICA REG: write %llx to %x, mask %llx\n", data, offset, mem_mask);
807   mame_printf_verbose("AICA REG: [%08x=%x] write %llx to %x, mask %llx\n", 0x700000+reg*4, dat, data, offset, mem_mask);
627808}
src/mame/machine/n64.c
r1679r1680
766766
767767   // adjust the timer
768768   period = attotime_mul(ATTOTIME_IN_HZ(DACRATE_NTSC), (ai_dacrate + 1) * (current->length / 4));
769   timer_adjust(audio_timer, period, 0, attotime_zero);
769   timer_adjust_oneshot(audio_timer, period, 0);
770770}
771771
772772static void audio_fifo_pop(void)
r1679r1680
15491549   UINT32 *cart = (UINT32*)memory_region(REGION_USER2);
15501550   UINT64 boot_checksum;
15511551
1552   mi_version = 0;
1553   mi_interrupt = 0;
1554   mi_intr_mask = 0;
1555
1556   sp_mem_addr = 0;
1557   sp_dram_addr = 0;
1558   sp_dma_length = 0;
1559   sp_dma_count = 0;
1560   sp_dma_skip = 0;
1561   sp_semaphore = 0;
1562
1563   dp_start = 0;
1564   dp_end = 0;
1565   dp_current = 0;
1566   dp_status = 0;
1567
1568   n64_vi_width = 0;
1569   n64_vi_origin = 0;
1570   n64_vi_control = 0;
1571   n64_vi_burst = n64_vi_vsync = n64_vi_hsync = n64_vi_leap = n64_vi_hstart = n64_vi_vstart = 0;
1572   n64_vi_intr = n64_vi_vburst = n64_vi_xscale = n64_vi_yscale = 0;
1573
1574   ai_dram_addr = 0;
1575   ai_len = 0 ;
1576   ai_control = 0;
1577   ai_dacrate = 0;
1578   ai_bitrate = 0;
1579   ai_status = 0;
1580
1581   memset(audio_fifo, 0, sizeof(audio_fifo));
1582   audio_fifo_wpos = 0;
1583   audio_fifo_rpos = 0;
1584   audio_fifo_num = 0;
1585
1586   pi_dram_addr = 0;
1587   pi_cart_addr = 0;
1588   pi_first_dma = 1;
1589
1590   memset(pif_ram, 0, sizeof(pif_ram));
1591   memset(pif_cmd, 0, sizeof(pif_cmd));
1592   si_dram_addr = 0;
1593   si_pif_addr = 0;
1594   si_status = 0;
1595
1596   memset(eeprom, 0, sizeof(eeprom));
1597   memset(mempack, 0, sizeof(mempack));
1598
1599   cic_status = 0;
1600
15521601   cpunum_set_info_int(0, CPUINFO_INT_MIPS3_DRC_OPTIONS, MIPS3DRC_FASTEST_OPTIONS + MIPS3DRC_STRICT_VERIFY);
15531602
15541603      /* configure fast RAM regions for DRC */
r1679r1680
15591608   cpunum_set_info_int(0, CPUINFO_INT_MIPS3_FASTRAM_READONLY, 0);
15601609
15611610   audio_timer = timer_alloc(audio_timer_callback, NULL);
1562   timer_adjust(audio_timer, attotime_never, 0, attotime_never);
1611   timer_adjust_oneshot(audio_timer, attotime_never, 0);
15631612
15641613   cpunum_set_input_line(Machine, 1, INPUT_LINE_HALT, ASSERT_LINE);
15651614
src/mame/machine/nmk112.c
r1679r1680
1515#define BANKSIZE 0x10000
1616
1717/* which chips have their sample address table divided into pages */
18static int has_paged_table[MAXCHIPS] = { 1, 1 };
18static UINT8 page_mask;
1919
20static UINT8 current_bank[8] = { ~0, ~0, ~0, ~0, ~0, ~0, ~0, ~0 };
20static UINT8 current_bank[8];
2121
22void NMK112_set_paged_table( int chip, int value )
22void NMK112_init(UINT8 disable_page_mask)
2323{
24   has_paged_table[chip] = value;
24   memset(current_bank, ~0, sizeof(current_bank));
25   page_mask = ~disable_page_mask;
2526}
2627
2728WRITE8_HANDLER( NMK112_okibank_w )
2829{
2930   int chip   =   (offset & 4) >> 2;
3031   int banknum   =   offset & 3;
32   int paged   =   (page_mask & (1 << chip));
3133
3234   UINT8 *rom   =   memory_region(REGION_SOUND1 + chip);
3335   int size         =   memory_region_length(REGION_SOUND1 + chip) - 0x40000;
r1679r1680
3739   current_bank[offset] = data;
3840
3941   /* copy the samples */
40   if ((has_paged_table[chip]) && (banknum == 0))
42   if ((paged) && (banknum == 0))
4143      memcpy(rom + 0x400, rom + 0x40000 + bankaddr+0x400, BANKSIZE-0x400);
4244   else
4345      memcpy(rom + banknum * BANKSIZE, rom + 0x40000 + bankaddr, BANKSIZE);
4446
4547   /* also copy the sample address table, if it is paged on this chip */
46   if (has_paged_table[chip])
48   if (paged)
4749   {
4850      rom += banknum * TABLESIZE;
4951      memcpy(rom, rom + 0x40000 + bankaddr, TABLESIZE);
src/mame/machine/nmk112.h
r1679r1680
11#ifndef NMK112_H
22#define NMK112_H
33
4void NMK112_set_paged_table( int chip, int value );
4void NMK112_init(UINT8 disable_page_mask);
55
66WRITE8_HANDLER( NMK112_okibank_w );
77WRITE16_HANDLER( NMK112_okibank_lsb_w );
src/mame/machine/balsente.c
r1679r1680
111111{
112112   /* next interrupt after scanline 256 is scanline 64 */
113113   if (param == 256)
114      timer_adjust(scanline_timer, video_screen_get_time_until_pos(0, 64, 0), 64, attotime_zero);
114      timer_adjust_oneshot(scanline_timer, video_screen_get_time_until_pos(0, 64, 0), 64);
115115   else
116      timer_adjust(scanline_timer, video_screen_get_time_until_pos(0, param + 64, 0), param + 64, attotime_zero);
116      timer_adjust_oneshot(scanline_timer, video_screen_get_time_until_pos(0, param + 64, 0), param + 64);
117117
118118   /* IRQ starts on scanline 0, 64, 128, etc. */
119119   cpunum_set_input_line(machine, 0, M6809_IRQ_LINE, ASSERT_LINE);
r1679r1680
192192
193193   /* start a timer to generate interrupts */
194194   scanline_timer = timer_alloc(interrupt_timer, NULL);
195   timer_adjust(scanline_timer, video_screen_get_time_until_pos(0, 0, 0), 0, attotime_zero);
195   timer_adjust_oneshot(scanline_timer, video_screen_get_time_until_pos(0, 0, 0), 0);
196196
197197   /* register for saving */
198198   for (i = 0; i < 3; i++)
r1679r1680
683683      if (counter[which].gate && !counter[which].timer_active)
684684      {
685685         counter[which].timer_active = 1;
686         timer_adjust(counter[which].timer, attotime_mul(ATTOTIME_IN_HZ(2000000), counter[which].count), which, attotime_zero);
686         timer_adjust_oneshot(counter[which].timer, attotime_mul(ATTOTIME_IN_HZ(2000000), counter[which].count), which);
687687      }
688688   }
689689}
r1679r1680
693693{
694694   /* only stop the timer if it exists */
695695   if (counter[which].timer_active)
696      timer_adjust(counter[which].timer, attotime_never, 0, attotime_zero);
696      timer_adjust_oneshot(counter[which].timer, attotime_never, 0);
697697   counter[which].timer_active = 0;
698698}
699699
r1679r1680
932932
933933   /* if there's already a timer, remove it */
934934   if (counter_0_timer_active)
935      timer_adjust(counter_0_timer, attotime_never, 0, attotime_zero);
935      timer_adjust_oneshot(counter_0_timer, attotime_never, 0);
936936   counter_0_timer_active = 0;
937937
938938   /* find the counter with the maximum frequency */
r1679r1680
957957   if (maxfreq > 0.0)
958958   {
959959      counter_0_timer_active = 1;
960      timer_adjust(counter_0_timer, ATTOTIME_IN_HZ(maxfreq), 0, ATTOTIME_IN_HZ(maxfreq));
960      timer_adjust_periodic(counter_0_timer, ATTOTIME_IN_HZ(maxfreq), 0, ATTOTIME_IN_HZ(maxfreq));
961961   }
962962}
963963
r1679r1680
10061006   /* if we gate off, remove the timer */
10071007   else if (counter[0].gate && !(data & 0x02) && counter_0_timer_active)
10081008   {
1009      timer_adjust(counter_0_timer, attotime_never, 0, attotime_zero);
1009      timer_adjust_oneshot(counter_0_timer, attotime_never, 0);
10101010      counter_0_timer_active = 0;
10111011   }
10121012
src/mame/machine/snes.c
r1679r1680
8282   cpunum_set_input_line(machine, 0, G65816_LINE_NMI, HOLD_LINE );
8383
8484   // don't happen again
85   timer_adjust(snes_nmi_timer, attotime_never, 0, attotime_never);
85   timer_adjust_oneshot(snes_nmi_timer, attotime_never, 0);
8686}
8787
8888static void snes_hirq_tick(void)
r1679r1680
9494   cpunum_set_input_line(Machine, 0, G65816_LINE_IRQ, HOLD_LINE );
9595
9696   // don't happen again
97   timer_adjust(snes_hirq_timer, attotime_never, 0, attotime_never);
97   timer_adjust_oneshot(snes_hirq_timer, attotime_never, 0);
9898}
9999
100100static TIMER_CALLBACK( snes_hirq_tick_callback )
r1679r1680
148148         }
149149         else
150150         {
151            timer_adjust(snes_hirq_timer, video_screen_get_time_until_pos(0, snes_ppu.beam.current_vert, pixel*snes_htmult), 0, attotime_never);
151            timer_adjust_oneshot(snes_hirq_timer, video_screen_get_time_until_pos(0, snes_ppu.beam.current_vert, pixel*snes_htmult), 0);
152152         }
153153      }
154154       }
r1679r1680
164164      if( snes_ram[NMITIMEN] & 0x80 )   /* NMI only signaled if this bit set */
165165      {
166166         // NMI goes off about 12 cycles after this (otherwise Chrono Trigger, NFL QB Club, etc. lock up)
167         timer_adjust(snes_nmi_timer, ATTOTIME_IN_CYCLES(12, 0), 0, attotime_zero);
167         timer_adjust_oneshot(snes_nmi_timer, ATTOTIME_IN_CYCLES(12, 0), 0);
168168      }
169169   }
170170
r1679r1680
229229
230230   cpuintrf_pop_context();
231231
232   timer_adjust(snes_scanline_timer, attotime_never, 0, attotime_never);
233   timer_adjust(snes_hblank_timer, video_screen_get_time_until_pos(0, snes_ppu.beam.current_vert, hblank_offset*snes_htmult), 0, attotime_never);
232   timer_adjust_oneshot(snes_scanline_timer, attotime_never, 0);
233   timer_adjust_oneshot(snes_hblank_timer, video_screen_get_time_until_pos(0, snes_ppu.beam.current_vert, hblank_offset*snes_htmult), 0);
234234}
235235
236236/* This is called at the start of hblank *before* the scanline indicated in current_vert! */
r1679r1680
241241   snes_ppu.beam.current_vert = video_screen_get_vpos(0);
242242
243243   /* make sure we halt */
244   timer_adjust(snes_hblank_timer, attotime_never, 0, attotime_never);
244   timer_adjust_oneshot(snes_hblank_timer, attotime_never, 0);
245245
246246   // we must guarantee the 65816's context for HDMA to work
247247     cpuintrf_push_context(0);
r1679r1680
273273      nextscan = 0;
274274   }
275275
276   timer_adjust(snes_scanline_timer, video_screen_get_time_until_pos(0, nextscan, 0), 0, attotime_never);
276   timer_adjust_oneshot(snes_scanline_timer, video_screen_get_time_until_pos(0, nextscan, 0), 0);
277277}
278278
279279static void snes_init_ram(void)
r1679r1680
320320
321321   /* init timers and stop them */
322322   snes_scanline_timer = timer_alloc(snes_scanline_tick, NULL);
323   timer_adjust(snes_scanline_timer, attotime_never, 0, attotime_never);
323   timer_adjust_oneshot(snes_scanline_timer, attotime_never, 0);
324324   snes_hblank_timer = timer_alloc(snes_hblank_tick, NULL);
325   timer_adjust(snes_hblank_timer, attotime_never, 0, attotime_never);
325   timer_adjust_oneshot(snes_hblank_timer, attotime_never, 0);
326326   snes_nmi_timer = timer_alloc(snes_nmi_tick, NULL);
327   timer_adjust(snes_nmi_timer, attotime_never, 0, attotime_never);
327   timer_adjust_oneshot(snes_nmi_timer, attotime_never, 0);
328328   snes_hirq_timer = timer_alloc(snes_hirq_tick_callback, NULL);
329   timer_adjust(snes_hirq_timer, attotime_never, 0, attotime_never);
329   timer_adjust_oneshot(snes_hirq_timer, attotime_never, 0);
330330
331331   // SNES hcounter has a 0-339 range.  hblank starts at counter 260.
332332   // clayfighter sets an HIRQ at 260, apparently it wants it to be before hdma kicks off, so we'll delay 2 pixels.
333333   hblank_offset = 268;
334   timer_adjust(snes_hblank_timer, video_screen_get_time_until_pos(0, ((snes_ram[STAT78] & 0x10) == SNES_NTSC) ? SNES_VTOTAL_NTSC-1 : SNES_VTOTAL_PAL-1, hblank_offset), 0, attotime_never);
334   timer_adjust_oneshot(snes_hblank_timer, video_screen_get_time_until_pos(0, ((snes_ram[STAT78] & 0x10) == SNES_NTSC) ? SNES_VTOTAL_NTSC-1 : SNES_VTOTAL_PAL-1, hblank_offset), 0);
335335
336336   // check if DSP1 is present (maybe not 100%?)
337337   has_dsp1 = ((snes_r_bank1(0xffd6) >= 3) && (snes_r_bank1(0xffd6) <= 5)) ? 1 : 0;
src/mame/machine/amiga.c
r1679r1680
10331033    CUSTOM_REG(REG_DMACON) |= 0x4000;
10341034
10351035   /* set a timer */
1036   timer_adjust( amiga_blitter_timer, ATTOTIME_IN_CYCLES( blittime, 0 ), 0, attotime_zero);
1036   timer_adjust_oneshot( amiga_blitter_timer, ATTOTIME_IN_CYCLES( blittime, 0 ), 0);
10371037}
10381038
10391039
r1679r1680
13991399
14001400         /* if 'blitter-nasty' has been turned on and we have a blit pending, reschedule it */
14011401         if ( ( data & 0x400 ) && ( CUSTOM_REG(REG_DMACON) & 0x4000 ) )
1402            timer_adjust( amiga_blitter_timer, ATTOTIME_IN_CYCLES( BLITTER_NASTY_DELAY, 0 ), 0, attotime_zero);
1402            timer_adjust_oneshot( amiga_blitter_timer, ATTOTIME_IN_CYCLES( BLITTER_NASTY_DELAY, 0 ), 0);
14031403
14041404         break;
14051405
r1679r1680
14101410         CUSTOM_REG(offset) = data;
14111411
14121412         if ( temp & 0x8000  ) /* if we're enabling irq's, delay a bit */
1413            timer_adjust( amiga_irq_timer, ATTOTIME_IN_CYCLES( AMIGA_IRQ_DELAY_CYCLES, 0 ), 0, attotime_zero);
1413            timer_adjust_oneshot( amiga_irq_timer, ATTOTIME_IN_CYCLES( AMIGA_IRQ_DELAY_CYCLES, 0 ), 0);
14141414         else /* if we're disabling irq's, process right away */
14151415            update_irqs();
14161416         break;
r1679r1680
14271427         CUSTOM_REG(offset) = data;
14281428
14291429         if ( temp & 0x8000  ) /* if we're generating irq's, delay a bit */
1430            timer_adjust( amiga_irq_timer, ATTOTIME_IN_CYCLES( AMIGA_IRQ_DELAY_CYCLES, 0 ), 0, attotime_zero);
1430            timer_adjust_oneshot( amiga_irq_timer, ATTOTIME_IN_CYCLES( AMIGA_IRQ_DELAY_CYCLES, 0 ), 0);
14311431         else /* if we're clearing irq's, process right away */
14321432            update_irqs();
14331433         break;
src/mame/machine/pcshare.c
r1679r1680
532532   if (pc_keyb.on != on)
533533   {
534534      if (on)
535         timer_adjust(pc_keyboard_timer, keyb_delay, 0, attotime_zero);
535         timer_adjust_oneshot(pc_keyboard_timer, keyb_delay, 0);
536536      else
537537         timer_reset(pc_keyboard_timer, attotime_never);
538538
src/mame/machine/atarigen.c
r1679r1680
171171
172172void atarigen_scanline_int_set(int scrnum, int scanline)
173173{
174   timer_adjust(scanline_interrupt_timer, video_screen_get_time_until_pos(scrnum, scanline, 0), scrnum, attotime_zero);
174   timer_adjust_oneshot(scanline_interrupt_timer, video_screen_get_time_until_pos(scrnum, scanline, 0), scrnum);
175175}
176176
177177
r1679r1680
275275   atarigen_scanline_int_gen(machine, 0);
276276
277277   /* set a new timer to go off at the same scan line next frame */
278   timer_adjust(scanline_interrupt_timer, video_screen_get_frame_period(param), param, attotime_zero);
278   timer_adjust_oneshot(scanline_interrupt_timer, video_screen_get_frame_period(param), param);
279279}
280280
281281
r1679r1680
853853
854854   /* set a timer to go off at scanline 0 */
855855   if (scanline_callback != NULL)
856      timer_adjust(scanline_timer[scrnum], video_screen_get_time_until_pos(scrnum, 0, 0), (scrnum << 16) | 0, attotime_zero);
856      timer_adjust_oneshot(scanline_timer[scrnum], video_screen_get_time_until_pos(scrnum, 0, 0), (scrnum << 16) | 0);
857857}
858858
859859
r1679r1680
876876      scanline += scanlines_per_callback;
877877      if (scanline >= machine->screen[scrnum].height)
878878         scanline = 0;
879      timer_adjust(scanline_timer[scrnum], video_screen_get_time_until_pos(scrnum, scanline, 0), (scrnum << 16) | scanline, attotime_zero);
879      timer_adjust_oneshot(scanline_timer[scrnum], video_screen_get_time_until_pos(scrnum, scanline, 0), (scrnum << 16) | scanline);
880880   }
881881}
882882
r1679r1680
913913      tilemap_set_scrollx(atarigen_playfield2_tilemap, 0, atarivc_state.pf1_xscroll);
914914      tilemap_set_scrolly(atarigen_playfield2_tilemap, 0, atarivc_state.pf1_yscroll);
915915   }
916   timer_adjust(atarivc_eof_update_timer[scrnum], video_screen_get_time_until_pos(scrnum, 0, 0), scrnum, attotime_zero);
916   timer_adjust_oneshot(atarivc_eof_update_timer[scrnum], video_screen_get_time_until_pos(scrnum, 0, 0), scrnum);
917917
918918   /* use this for debugging the video controller values */
919919#if 0
r1679r1680
954954
955955   /* start a timer to go off a little before scanline 0 */
956956   if (atarivc_eof_data)
957      timer_adjust(atarivc_eof_update_timer[scrnum], video_screen_get_time_until_pos(scrnum, 0, 0), scrnum, attotime_zero);
957      timer_adjust_oneshot(atarivc_eof_update_timer[scrnum], video_screen_get_time_until_pos(scrnum, 0, 0), scrnum);
958958}
959959
960960
src/mame/machine/mcr.c
r1679r1680
730730   /* counter 0 is self-updating if clocked externally */
731731   if (counter == 0 && !(m6840_state[counter].control & 0x02))
732732   {
733      timer_adjust(m6840_state[counter].timer, attotime_never, 0, attotime_zero);
733      timer_adjust_oneshot(m6840_state[counter].timer, attotime_never, 0);
734734      m6840_state[counter].timer_active = 0;
735735      return;
736736   }
r1679r1680
751751   /* set the timer */
752752   total_period = attotime_make(0, attotime_to_attoseconds(period) * count);
753753LOG(("reload_count(%d): period = %f  count = %d\n", counter, attotime_to_double(period), count));
754   timer_adjust(m6840_state[counter].timer, total_period, (count << 2) + counter, attotime_zero);
754   timer_adjust_oneshot(m6840_state[counter].timer, total_period, (count << 2) + counter);
755755   m6840_state[counter].timer_active = 1;
756756}
757757
r1679r1680
814814         {
815815            for (i = 0; i < 3; i++)
816816            {
817               timer_adjust(m6840_state[i].timer, attotime_never, 0, attotime_zero);
817               timer_adjust_oneshot(m6840_state[i].timer, attotime_never, 0);
818818               m6840_state[i].timer_active = 0;
819819            }
820820         }
r1679r1680
10161016{
10171017   /* watchdog counter is clocked by 7.3728MHz crystal / 16 */
10181018   /* watchdog is tripped when 14-bit counter overflows => / 32768 = 14.0625Hz*/
1019   timer_adjust(ipu_watchdog_timer, ATTOTIME_IN_HZ(7372800 / 16 / 32768), 0, attotime_zero);
1019   timer_adjust_oneshot(ipu_watchdog_timer, ATTOTIME_IN_HZ(7372800 / 16 / 32768), 0);
10201020   return 0xff;
10211021}
10221022
src/mame/machine/konamiic.c
r1679r1680
6464   timer_period = attotime_mul(ATTOTIME_IN_HZ(44100), 128);   // roughly 2.9us
6565
6666   K056800_sound_cpu_timer = timer_alloc(K056800_sound_cpu_timer_tick, NULL);
67   timer_adjust(K056800_sound_cpu_timer, timer_period, 0, timer_period);
67   timer_adjust_periodic(K056800_sound_cpu_timer, timer_period, 0, timer_period);
6868}
6969
7070READ32_HANDLER(K056800_host_r)
src/mame/machine/harddriv.c
r1679r1680
629629      duart_irq_state = (duart_read_data[0x05] & duart_write_data[0x05]) != 0;
630630      atarigen_update_interrupts();
631631   }
632   timer_adjust(duart_timer, attotime_mul(duart_clock_period(), 65536), 0, attotime_zero);
632   timer_adjust_oneshot(duart_timer, attotime_mul(duart_clock_period(), 65536), 0);
633633}
634634
635635
r1679r1680
656656      case 0x0e:      /* Start-Counter Command 3 */
657657      {
658658         int reps = (duart_write_data[0x06] << 8) | duart_write_data[0x07];
659         timer_adjust(duart_timer, attotime_mul(duart_clock_period(), reps), 0, attotime_zero);
659         timer_adjust_oneshot(duart_timer, attotime_mul(duart_clock_period(), reps), 0);
660660         logerror("DUART timer started (period=%f)\n", attotime_to_double(attotime_mul(duart_clock_period(), reps)));
661661         return 0x00ff;
662662      }
663663      case 0x0f:      /* Stop-Counter Command 3 */
664664         {
665665            int reps = attotime_to_double(attotime_mul(timer_timeleft(duart_timer), duart_clock()));
666            timer_adjust(duart_timer, attotime_never, 0, attotime_zero);
666            timer_adjust_oneshot(duart_timer, attotime_never, 0);
667667            duart_read_data[0x06] = reps >> 8;
668668            duart_read_data[0x07] = reps & 0xff;
669669            logerror("DUART timer stopped (final count=%04X)\n", reps);
src/mame/machine/psx.c
r1679r1680
142142
143143static void dma_start_timer( int n_channel, UINT32 n_ticks )
144144{
145   timer_adjust( m_p_timer_dma[ n_channel ], attotime_mul(ATTOTIME_IN_HZ(33868800), n_ticks), n_channel, attotime_zero);
145   timer_adjust_oneshot( m_p_timer_dma[ n_channel ], attotime_mul(ATTOTIME_IN_HZ(33868800), n_ticks), n_channel);
146146   m_p_n_dma_ticks[ n_channel ] = n_ticks;
147147   m_p_b_dma_running[ n_channel ] = 1;
148148}
149149
150150static void dma_stop_timer( int n_channel )
151151{
152   timer_adjust( m_p_timer_dma[ n_channel ], attotime_never, 0, attotime_never);
152   timer_adjust_oneshot( m_p_timer_dma[ n_channel ], attotime_never, 0);
153153   m_p_b_dma_running[ n_channel ] = 0;
154154}
155155
r1679r1680
542542{
543543   if( ( m_p_n_root_mode[ n_counter ] & RC_STOP ) != 0 )
544544   {
545      timer_adjust( m_p_timer_root[ n_counter ], attotime_never, n_counter, attotime_never);
545      timer_adjust_oneshot( m_p_timer_root[ n_counter ], attotime_never, n_counter);
546546   }
547547   else
548548   {
r1679r1680
556556
557557      n_duration *= root_divider( n_counter );
558558
559      timer_adjust( m_p_timer_root[ n_counter ], attotime_mul(ATTOTIME_IN_HZ(33868800), n_duration), n_counter, attotime_zero);
559      timer_adjust_oneshot( m_p_timer_root[ n_counter ], attotime_mul(ATTOTIME_IN_HZ(33868800), n_duration), n_counter);
560560   }
561561}
562562
r1679r1680
739739      n_time = attotime_never;
740740      verboselog( 2, "sio_timer_adjust( %d ) finished\n", n_port );
741741   }
742   timer_adjust( m_p_timer_sio[ n_port ], n_time, n_port, attotime_zero);
742   timer_adjust_oneshot( m_p_timer_sio[ n_port ], n_time, n_port);
743743}
744744
745745static TIMER_CALLBACK( sio_clock )
src/mame/machine/williams.c
r1679r1680
273273   /* set a timer for the next update */
274274   scanline += 0x20;
275275   if (scanline >= 256) scanline = 0;
276   timer_adjust(scanline_timer, video_screen_get_time_until_pos(0, scanline, 0), scanline, attotime_zero);
276   timer_adjust_oneshot(scanline_timer, video_screen_get_time_until_pos(0, scanline, 0), scanline);
277277}
278278
279279
r1679r1680
293293   timer_set(video_screen_get_time_until_pos(0, 0, 0), NULL, 0, williams_count240_off_callback);
294294
295295   /* set a timer for next frame */
296   timer_adjust(scan240_timer, video_screen_get_time_until_pos(0, 240, 0), 0, attotime_zero);
296   timer_adjust_oneshot(scan240_timer, video_screen_get_time_until_pos(0, 240, 0), 0);
297297}
298298
299299
r1679r1680
364364
365365   /* set a timer to go off every 16 scanlines, to toggle the VA11 line and update the screen */
366366   scanline_timer = timer_alloc(williams_va11_callback, NULL);
367   timer_adjust(scanline_timer, video_screen_get_time_until_pos(0, 0, 0), 0, attotime_zero);
367   timer_adjust_oneshot(scanline_timer, video_screen_get_time_until_pos(0, 0, 0), 0);
368368
369369   /* also set a timer to go off on scanline 240 */
370370   scan240_timer = timer_alloc(williams_count240_callback, NULL);
371   timer_adjust(scan240_timer, video_screen_get_time_until_pos(0, 240, 0), 0, attotime_zero);
371   timer_adjust_oneshot(scan240_timer, video_screen_get_time_until_pos(0, 240, 0), 0);
372372
373373   state_save_register_global(vram_bank);
374374}
r1679r1680
402402   /* set a timer for the next update */
403403   scanline += 0x20;
404404   if (scanline >= 256) scanline = 0;
405   timer_adjust(scanline_timer, video_screen_get_time_until_pos(0, scanline, 0), scanline, attotime_zero);
405   timer_adjust_oneshot(scanline_timer, video_screen_get_time_until_pos(0, scanline, 0), scanline);
406406}
407407
408408
r1679r1680
422422   timer_set(video_screen_get_time_until_pos(0, 8, 0), NULL, 0, williams2_endscreen_off_callback);
423423
424424   /* set a timer for next frame */
425   timer_adjust(scan254_timer, video_screen_get_time_until_pos(0, 254, 0), 0, attotime_zero);
425   timer_adjust_oneshot(scan254_timer, video_screen_get_time_until_pos(0, 254, 0), 0);
426426}
427427
428428
r1679r1680
453453
454454   /* set a timer to go off every 16 scanlines, to toggle the VA11 line and update the screen */
455455   scanline_timer = timer_alloc(williams2_va11_callback, NULL);
456   timer_adjust(scanline_timer, video_screen_get_time_until_pos(0, 0, 0), 0, attotime_zero);
456   timer_adjust_oneshot(scanline_timer, video_screen_get_time_until_pos(0, 0, 0), 0);
457457
458458   /* also set a timer to go off on scanline 254 */
459459   scan254_timer = timer_alloc(williams2_endscreen_callback, NULL);
460   timer_adjust(scan254_timer, video_screen_get_time_until_pos(0, 254, 0), 0, attotime_zero);
460   timer_adjust_oneshot(scan254_timer, video_screen_get_time_until_pos(0, 254, 0), 0);
461461
462462   state_save_register_global(vram_bank);
463463   state_save_register_func_postload(williams2_postload);
src/mame/machine/starwars.c
r1679r1680
388388      M_STOP--; /* Decrease count */
389389   }
390390
391   timer_adjust(math_timer, attotime_mul(ATTOTIME_IN_HZ(MASTER_CLOCK), mptime), 1, attotime_zero);
391   timer_adjust_oneshot(math_timer, attotime_mul(ATTOTIME_IN_HZ(MASTER_CLOCK), mptime), 1);
392392}
393393
394394
src/mame/machine/mw8080bw.c
r1679r1680
8181   }
8282
8383   next_vpos = vysnc_chain_counter_to_vpos(next_counter, next_vblank);
84   timer_adjust(interrupt_timer, video_screen_get_time_until_pos(0, next_vpos, 0), 0, attotime_zero);
84   timer_adjust_oneshot(interrupt_timer, video_screen_get_time_until_pos(0, next_vpos, 0), 0);
8585}
8686
8787
r1679r1680
9494static void mw8080bw_start_interrupt_timer(void)
9595{
9696   int vpos = vysnc_chain_counter_to_vpos(MW8080BW_INT_TRIGGER_COUNT_1, MW8080BW_INT_TRIGGER_VBLANK_1);
97   timer_adjust(interrupt_timer, video_screen_get_time_until_pos(0, vpos, 0), 0, attotime_zero);
97   timer_adjust_oneshot(interrupt_timer, video_screen_get_time_until_pos(0, vpos, 0), 0);
9898}
9999
100100
src/mame/mamedriv.c
r1679r1680
141141   DRIVER( galaxiaj )   /* (c) Namco */
142142   DRIVER( galmidw )   /* (c) Midway */
143143   DRIVER( galmidwo )   /* (c) Midway */
144   DRIVER( galtaito )   /* (c) Taito */
144145   DRIVER( superg )   /* hack */
145146   DRIVER( galapx )   /* hack */
146147   DRIVER( moonaln )   /* [Nichibutsu] (Karateco license) or hack */
r1679r1680
20452046   DRIVER( hellfir1 )   /* B90 / TP-??? (c) 1989 Toaplan + Taito license */
20462047   DRIVER( hellfir2 )   /* B90 / TP-??? (c) 1989 Toaplan + Taito license */
20472048   DRIVER( zerowing )   /* TP-015 (c) 1989 Toaplan */
2049   DRIVER( zerowng2 )   /* TP-015 (c) 1989 Toaplan */
20482050   DRIVER( demonwld )   /* TP-016 (c) 1990 Toaplan (+ Taito license when set to Japan) */
20492051   DRIVER( demonwl1 )   /* TP-016 (c) 1989 Toaplan + Taito license */
20502052   DRIVER( demonwl2 )   /* TP-016 (c) 1989 Toaplan */
r1679r1680
44734475   DRIVER( jailbrek )   /* GX507 (c) 1986 */
44744476   DRIVER( manhatan )   /* GX507 (c) 1986 (Japan) */
44754477      DRIVER( jailbrkb )   /* bootleg */
4476    DRIVER( scotrsht )   /* GX545 (c) 1985 */
4478   DRIVER( scotrsht )   /* GX545 (c) 1985 */
44774479   DRIVER( finalizr )   /* GX523 (c) 1985 */
44784480   DRIVER( finalizb )   /* bootleg */
44794481   DRIVER( ironhors )   /* GX560 (c) 1986 */
r1679r1680
44854487   DRIVER( topgunbl )   /* bootleg */
44864488   DRIVER( ddribble )   /* GX690 (c) 1986 */
44874489   DRIVER( contra )   /* GX633 (c) 1987 */
4490   DRIVER( contra1 )   /* GX633 (c) 1987 */
44884491   DRIVER( contrab )   /* bootleg */
44894492   DRIVER( contraj )   /* GX633 (c) 1987 (Japan) */
44904493   DRIVER( contrajb )   /* bootleg */
r1679r1680
60636066   DRIVER( gauntd24 )   /* (c) 1999 Midway Games */
60646067   DRIVER( cartfury )   /* (c) 2000 Midway Games */
60656068
6066   /* Midway Touchmaster games */
6069   /* Midway Touchmaster / Galaxy Games */
60676070   DRIVER( tm )      /* (c) 1996 Midway Games */
60686071   DRIVER( tm3k )      /* (c) 1996 Midway Games */
60696072   DRIVER( tm4k )      /* (c) 1996 Midway Games */
6073   DRIVER( galgbios )  /* (c) 1998 Creative Electonics & Software (CES) */
60706074
60716075   /* Cinematronics raster games */
60726076   DRIVER( embargo )
r1679r1680
63686372   DRIVER( kirarast )   /* (c) 1996 */
63696373   DRIVER( tp2m32 )   /* (c) 1997 */
63706374   DRIVER( bnstars )   /* (c) 1997 */
6375   DRIVER( wpksocv2 )  /* (c) 1997 */
63716376
63726377   DRIVER( f1superb )   /* (c) 1994 */
63736378
r1679r1680
65906595   DRIVER( blazeon )   /* (c) 1992 Atlus */
65916596   DRIVER( sandscrp )   /* (c) 1992 Face */
65926597   DRIVER( sandscra )   /* (c) 1992 Face */
6598   DRIVER( sandscrb )   /* (c) 1992 Face */
65936599   DRIVER( explbrkr )   /* (c) 1992 Kaneko */
65946600   DRIVER( bakubrkr )   /* (c) 1992 Kaneko */
65956601   DRIVER( shogwarr )   /* (c) 1992 Kaneko */
r1679r1680
77817787   DRIVER( pkscram )   /* (c) 1993 Cosmo Electronics Corporation */
77827788   DRIVER( jollycrd )   /* (c) 1985 TAB-Austria */
77837789   DRIVER( jolycdae )   /* (c) 1985 TAB-Austria */
7790   DRIVER( jolyc3x3 )   /* (c) 1985 TAB-Austria */
7791   DRIVER( jolyc980 )   /* (c) 2000 Spale-Soft */
77847792   DRIVER( jolycdcr )   /* (c) 1993 Soft Design */
77857793   DRIVER( jolycdit )   /* 199? bootleg */
7786   DRIVER( jolycdat )   /* (c) 1986 Fun World */
7787   DRIVER( jolycdab )   /* (c) 1990 Inter Games */
7788   DRIVER( bigdeal )   /* (c) 1986 Fun World */
7789   DRIVER( bigdealb )   /* (c) 1986 Fun World */
7794   DRIVER( jolycdab )   /* (c) 1986 Inter Games */
7795   DRIVER( bigdeal )   /* (c) 1986 Funworld */
7796   DRIVER( bigdealb )   /* (c) 1986 Funworld */
7797   DRIVER( jolycdat )   /* (c) 1986 Funworld */
77907798   DRIVER( cuoreuno )   /* (c) 1996 C.M.C. */
7791   DRIVER( elephfam )   /* (c) 1996 C.M.C. */
7799   DRIVER( elephfam )   /* (c) 1997 C.M.C. */
77927800   DRIVER( elephfmb )   /* (c) 1996 C.M.C. */
77937801   DRIVER( pool10 )   /* (c) 1996 C.M.C. */
77947802   DRIVER( pool10b )   /* (c) 1996 C.M.C. */
77957803   DRIVER( tortufam )   /* (c) 1997 C.M.C. */
77967804   DRIVER( royalcrd )   /* (c) 1991 TAB-Austria */
77977805   DRIVER( royalcdb )   /* (c) 1991 TAB-Austria */
7798   DRIVER( royalcdc )   /* (c) 199? Evona Electronic */
7806   DRIVER( royalcdc )   /* (c) 1991 Evona Electronic */
7807   DRIVER( lluck3x3 )   /* (c) 1991 TAB-Austria */
7808   DRIVER( lluck4x1 )   /* (c) 1991 TAB-Austria */
77997809   DRIVER( magiccrd )   /* (c) 1996 Impera */
7810   DRIVER( magiccda )   /* (c) 1996 Impera */
7811   DRIVER( magiccdb )   /* (c) 1996 Impera */
7812   DRIVER( vegasslw )   /* (c) 1993 Funworld */
7813   DRIVER( vegasfst )   /* (c) 1993 Soft Design */
78007814   DRIVER( jokercrd )   /* (c) 1993 Vesely Svet */
7801   DRIVER( monglfir )   /* 199? bootleg */
7815   DRIVER( mongolnw )   /* 199? bootleg */
78027816   DRIVER( soccernw )   /* 199? bootleg */
78037817   DRIVER( snookr10 )   /* (c) 1998 Sandiy */
78047818   DRIVER( saloon )   /* 199? unknown */
r1679r1680
79257939   DRIVER( drw80pkr )
79267940   DRIVER( blazlaz )
79277941   DRIVER( paranoia )
7928   DRIVER( galgbios )  /* (c) 1998 Creative Electonics */
7942   DRIVER( vcombat )   /* (c) 1993 VR8 Inc. */
7943   DRIVER( shadfgtr )  /* (c) 1989 Sega? */
79297944
79307945#endif   /* DRIVER_RECURSIVE */
src/mame/includes/m10.h
r0r1680
1/***************************************************************************
2
3    IREM M-10,M-11 and M-15 based hardware
4
5****************************************************************************/
6
7
8#define IREMM10_MASTER_CLOCK      (25000000)
9
10#define IREMM10_CPU_CLOCK      (IREMM10_MASTER_CLOCK/20)
11#define IREMM10_PIXEL_CLOCK      (IREMM10_MASTER_CLOCK/5)
12#define IREMM10_HTOTAL         (318)
13#define IREMM10_HBSTART         (248)
14#define IREMM10_HBEND         (8)
15#define IREMM10_VTOTAL         (262)
16#define IREMM10_VBSTART         (240)
17#define IREMM10_VBEND         (16)
18
19#define IREMM15_MASTER_CLOCK   (11730000)
20
21#define IREMM15_CPU_CLOCK      (IREMM15_MASTER_CLOCK/10)
22#define IREMM15_PIXEL_CLOCK      (IREMM15_MASTER_CLOCK/2)
23#define IREMM15_HTOTAL         (372)
24#define IREMM15_HBSTART         (256)
25#define IREMM15_HBEND         (0)
26#define IREMM15_VTOTAL         (262)
27#define IREMM15_VBSTART         (240)
28#define IREMM15_VBEND         (16)
29
30typedef struct _m10_state m10_state;
31struct _m10_state
32{
33   /* memory pointers */
34   UINT8 *         chargen;
35   UINT8 *         memory;
36   UINT8 *         rom;
37
38   /* machine states */
39
40   /* sound state */
41
42   /* video state */
43   UINT8         bottomline;
44   UINT8          flip;
45
46   /* Specific states */
47};
48
49
50/*----------- defined in video/m10.c -----------*/
51
52
53WRITE8_HANDLER( m10_colorram_w );
54WRITE8_HANDLER( m15_chargen_w );
55
56VIDEO_UPDATE( m10 );
57VIDEO_UPDATE( m15 );
58
59VIDEO_START( m10 );
60VIDEO_START( m15 );
61
src/mame/includes/nova2001.h
r0r1680
1extern UINT8 *nova2001_fg_videoram, *nova2001_bg_videoram;
2
3extern WRITE8_HANDLER( nova2001_fg_videoram_w );
4extern WRITE8_HANDLER( nova2001_bg_videoram_w );
5extern WRITE8_HANDLER( ninjakun_bg_videoram_w );
6extern READ8_HANDLER( ninjakun_bg_videoram_r );
7extern WRITE8_HANDLER( nova2001_scroll_x_w );
8extern WRITE8_HANDLER( nova2001_scroll_y_w );
9extern WRITE8_HANDLER( nova2001_flipscreen_w );
10extern WRITE8_HANDLER( pkunwar_flipscreen_w );
11extern WRITE8_HANDLER( ninjakun_paletteram_w );
12
13extern PALETTE_INIT( nova2001 );
14extern VIDEO_START( nova2001 );
15extern VIDEO_UPDATE( nova2001 );
16extern VIDEO_START( ninjakun );
17extern VIDEO_UPDATE( ninjakun );
18extern VIDEO_START( pkunwar );
19extern VIDEO_UPDATE( pkunwar );
20extern VIDEO_START( raiders5 );
21extern VIDEO_UPDATE( raiders5 );
src/mame/includes/cvs.h
r1679r1680
44
55****************************************************************************/
66
7
8#define CVS_S2636_Y_OFFSET      (3)
9#define CVS_S2636_X_OFFSET      (-26)
10
11
712/*----------- defined in driver/cvs.c -----------*/
813
914extern UINT8 *cvs_color_ram;
r1679r1680
1116extern UINT8 *cvs_bullet_ram;
1217extern UINT8 *cvs_palette_ram;
1318extern UINT8 *cvs_character_ram;
19extern UINT8 *cvs_s2636_0_ram;
20extern UINT8 *cvs_s2636_1_ram;
21extern UINT8 *cvs_s2636_2_ram;
1422
1523MACHINE_START( cvs );
1624
r1679r1680
2028READ8_HANDLER( cvs_bullet_ram_or_palette_r );
2129WRITE8_HANDLER( cvs_bullet_ram_or_palette_w );
2230
31READ8_HANDLER( cvs_s2636_0_or_character_ram_r );
32WRITE8_HANDLER( cvs_s2636_0_or_character_ram_w );
2333READ8_HANDLER( cvs_s2636_1_or_character_ram_r );
2434WRITE8_HANDLER( cvs_s2636_1_or_character_ram_w );
2535READ8_HANDLER( cvs_s2636_2_or_character_ram_r );
2636WRITE8_HANDLER( cvs_s2636_2_or_character_ram_w );
27READ8_HANDLER( cvs_s2636_3_or_character_ram_r );
28WRITE8_HANDLER( cvs_s2636_3_or_character_ram_w );
2937
3038UINT8 cvs_get_character_banking_mode(void);
3139
3240
3341/*----------- defined in video/cvs.c -----------*/
3442
35extern mame_bitmap *cvs_collision_bitmap;
3643extern mame_bitmap *cvs_collision_background;
3744extern int cvs_collision_register;
3845
r1679r1680
4754READ8_HANDLER( cvs_collision_clear );
4855
4956void cvs_scroll_stars(void);
50
src/mame/includes/dc.h
r1679r1680
3939#define SB_C2DSTAT   ((0x005F6800-0x005F6800)/4)
4040#define SB_C2DLEN   ((0x005F6804-0x005F6800)/4)
4141#define SB_C2DST   ((0x005F6808-0x005F6800)/4)
42#define SB_LMMODE0   ((0x005F6884-0x005F6800)/4)
43#define SB_LMMODE1   ((0x005F6888-0x005F6800)/4)
4244#define SB_SBREV   ((0x005F689c-0x005F6800)/4)
4345#define SB_ISTNRM   ((0x005F6900-0x005F6800)/4)
4446#define SB_ISTEXT   ((0x005F6904-0x005F6800)/4)
r1679r1680
5658
5759                      /*address*/
5860#define SB_MDSTAR   ((0x005F6C04-0x005F6C00)/4)
61#define SB_MDTSEL   ((0x005F6C10-0x005F6C00)/4)
62#define SB_MDEN      ((0x005F6C14-0x005F6C00)/4)
5963#define SB_MDST      ((0x005F6C18-0x005F6C00)/4)
60#define SB_MDTSEL   ((0x005F6C10-0x005F6C00)/4)
6164#define SB_MSYS      ((0x005F6C80-0x005F6C00)/4)
65#define SB_MST      ((0x005F6C84-0x005F6C00)/4)
66#define SB_MSHTCL   ((0x005F6C88-0x005F6C00)/4)
67#define SB_MDAPRO   ((0x005F6C8C-0x005F6C00)/4)
68#define SB_MMSEL   ((0x005F6CE8-0x005F6C00)/4)
6269
70#define SB_GDSTAR   ((0x005F7404-0x005F7400)/4)
71#define SB_GDLEN   ((0x005F7408-0x005F7400)/4)
72#define SB_GDDIR   ((0x005F740C-0x005F7400)/4)
73#define SB_GDEN      ((0x005F7414-0x005F7400)/4)
74#define SB_GDST      ((0x005F7418-0x005F7400)/4)
75#define SB_G1RRC   ((0x005F7480-0x005F7400)/4)
76#define SB_G1RWC   ((0x005F7484-0x005F7400)/4)
77#define SB_G1FRC   ((0x005F7488-0x005F7400)/4)
78#define SB_G1FWC   ((0x005F748C-0x005F7400)/4)
79#define SB_G1CRC   ((0x005F7490-0x005F7400)/4)
80#define SB_G1CWC   ((0x005F7494-0x005F7400)/4)
81#define SB_G1GDRC   ((0x005F74A0-0x005F7400)/4)
82#define SB_G1GDWC   ((0x005F74A4-0x005F7400)/4)
83#define SB_G1SYSM   ((0x005F74B0-0x005F7400)/4)
84#define SB_G1CRDYC   ((0x005F74B4-0x005F7400)/4)
85#define SB_GDAPRO   ((0x005F74B8-0x005F7400)/4)
6386
87#define RTC1      ((0x00710000-0x00710000)/4)
88#define RTC2      ((0x00710004-0x00710000)/4)
89#define RTC3      ((0x00710008-0x00710000)/4)
90
91
6492/*----------- defined in video/dc.c -----------*/
6593
6694READ64_HANDLER( pvr_ctrl_r );
r1679r1680
81109#define VO_CONTROL      ((0x005F80E8-0x005F8000)/4)
82110#define SPG_STATUS      ((0x005F810c-0x005F8000)/4)
83111#define TA_LIST_INIT   ((0x005F8144-0x005F8000)/4)
112#define TA_OL_BASE      ((0x005F8124-0x005F8000)/4)
113#define TA_ISP_BASE      ((0x005F8128-0x005F8000)/4)
114#define TA_OL_LIMIT      ((0x005F812C-0x005F8000)/4)
115#define TA_ISP_LIMIT   ((0x005F8130-0x005F8000)/4)
116#define TA_ALLOC_CTRL   ((0x005F8140-0x005F8000)/4)
117#define PARAM_BASE      ((0x005F8020-0x005F8000)/4)
118#define REGION_BASE      ((0x005F802C-0x005F8000)/4)
119#define TA_NEXT_OPB_INIT   ((0x005F8164-0x005F8000)/4)
120#define TA_NEXT_OPB      ((0x005F8134-0x005F8000)/4)
121#define TA_ITP_CURRENT   ((0x005F8138-0x005F8000)/4)
84122
85
86123#endif
src/mame/includes/qix.h
r1679r1680
5050extern UINT8 qix_cocktail_flip;
5151
5252VIDEO_START( qix );
53VIDEO_UPDATE( qix );
5354
55WRITE8_HANDLER( qix_mc6845_address_w );
56READ8_HANDLER( qix_mc6845_register_r );
57WRITE8_HANDLER( qix_mc6845_register_w );
5458READ8_HANDLER( qix_scanline_r );
5559READ8_HANDLER( qix_videoram_r );
5660WRITE8_HANDLER( qix_videoram_w );
src/mame/includes/fastfred.h
r1679r1680
1111extern UINT8 *fastfred_spriteram;
1212extern size_t fastfred_spriteram_size;
1313extern UINT8 *fastfred_attributesram;
14extern UINT8 *fastfred_background_color;
1415
1516PALETTE_INIT( fastfred );
1617VIDEO_START( fastfred );
r1679r1680
2021WRITE8_HANDLER( fastfred_charbank2_w );
2122WRITE8_HANDLER( fastfred_colorbank1_w );
2223WRITE8_HANDLER( fastfred_colorbank2_w );
23WRITE8_HANDLER( fastfred_background_color_w );
2424WRITE8_HANDLER( fastfred_flip_screen_x_w );
2525WRITE8_HANDLER( fastfred_flip_screen_y_w );
2626VIDEO_UPDATE( fastfred );
src/mame/mame.mak
r1679r1680
755755   $(MACHINE)/pgmy2ks.o \
756756
757757$(MAMEOBJ)/irem.a: \
758   $(DRIVERS)/m10.o $(VIDEO)/m10.o \
758759   $(DRIVERS)/m52.o $(VIDEO)/m52.o \
759760   $(DRIVERS)/m57.o $(VIDEO)/m57.o \
760761   $(DRIVERS)/m58.o $(VIDEO)/m58.o \
r1679r1680
766767   $(DRIVERS)/olibochu.o \
767768   $(DRIVERS)/redalert.o $(AUDIO)/redalert.o $(VIDEO)/redalert.o \
768769   $(DRIVERS)/shisen.o $(VIDEO)/shisen.o \
769   $(DRIVERS)/skychut.o $(VIDEO)/skychut.o \
770770   $(DRIVERS)/travrusa.o $(VIDEO)/travrusa.o \
771771   $(DRIVERS)/vigilant.o $(VIDEO)/vigilant.o \
772772   $(DRIVERS)/wilytowr.o \
r1679r1680
14411441
14421442$(MAMEOBJ)/upl.a: \
14431443   $(DRIVERS)/mouser.o $(VIDEO)/mouser.o \
1444   $(DRIVERS)/ninjakun.o $(VIDEO)/ninjakun.o \
14451444   $(DRIVERS)/ninjakd2.o $(VIDEO)/ninjakd2.o \
14461445   $(DRIVERS)/nova2001.o $(VIDEO)/nova2001.o \
1447   $(DRIVERS)/pkunwar.o $(VIDEO)/pkunwar.o \
1448   $(DRIVERS)/raiders5.o $(VIDEO)/raiders5.o \
14491446   $(DRIVERS)/xxmissio.o $(VIDEO)/xxmissio.o \
14501447
14511448$(MAMEOBJ)/valadon.a: \
r1679r1680
15401537   $(DRIVERS)/fortecar.o \
15411538   $(DRIVERS)/freekick.o $(VIDEO)/freekick.o \
15421539   $(DRIVERS)/funworld.o $(VIDEO)/funworld.o \
1543   $(DRIVERS)/galgames.o \
15441540   $(DRIVERS)/gamecstl.o \
15451541   $(DRIVERS)/gdrawpkr.o $(VIDEO)/gdrawpkr.o \
15461542   $(DRIVERS)/gtipoker.o \
r1679r1680
16291625   $(DRIVERS)/turbosub.o \
16301626   $(DRIVERS)/usgames.o $(VIDEO)/usgames.o \
16311627   $(DRIVERS)/vamphalf.o \
1628   $(DRIVERS)/vcombat.o \
16321629   $(DRIVERS)/vroulet.o \
16331630   $(DRIVERS)/wldarrow.o \
16341631   $(DRIVERS)/xyonix.o $(VIDEO)/xyonix.o \
src/mame/video/sbugger.c
r1679r1680
3030
3131VIDEO_START(sbugger)
3232{
33   sbugger_tilemap = tilemap_create(get_sbugger_tile_info,tilemap_scan_rows,TILEMAP_TYPE_PEN, 8, 16,64,16);
33   sbugger_tilemap = tilemap_create(get_sbugger_tile_info,tilemap_scan_rows, 8, 16,64,16);
3434}
3535
3636VIDEO_UPDATE(sbugger)
src/mame/video/targeth.c
r1679r1680
7676
7777VIDEO_START( targeth )
7878{
79   pant[0] = tilemap_create(get_tile_info_targeth_screen0,tilemap_scan_rows,TILEMAP_TYPE_PEN,16,16,64,32);
80   pant[1] = tilemap_create(get_tile_info_targeth_screen1,tilemap_scan_rows,TILEMAP_TYPE_PEN,16,16,64,32);
79   pant[0] = tilemap_create(get_tile_info_targeth_screen0,tilemap_scan_rows,16,16,64,32);
80   pant[1] = tilemap_create(get_tile_info_targeth_screen1,tilemap_scan_rows,16,16,64,32);
8181
8282   tilemap_set_transparent_pen(pant[0],0);
8383}
src/mame/video/nycaptor.c
r1679r1680
7272VIDEO_START( nycaptor )
7373{
7474  nycaptor_spriteram = auto_malloc (160);
75  bg_tilemap = tilemap_create( get_tile_info,tilemap_scan_rows,TILEMAP_TYPE_PEN,8,8,32,32 );
75  bg_tilemap = tilemap_create( get_tile_info,tilemap_scan_rows,8,8,32,32 );
7676
7777  tilemap_set_transmask(bg_tilemap,0,0xf800,0x7ff); //split 0
7878  tilemap_set_transmask(bg_tilemap,1,0xfe00,0x01ff);//split 1
src/mame/video/mitchell.c
r1679r1680
5252   paletteram=NULL;
5353
5454
55   bg_tilemap = tilemap_create(get_tile_info,tilemap_scan_rows,TILEMAP_TYPE_PEN,8,8,64,32);
55   bg_tilemap = tilemap_create(get_tile_info,tilemap_scan_rows,8,8,64,32);
5656
5757   tilemap_set_transparent_pen(bg_tilemap,15);
5858
src/mame/video/xevious.c
r1679r1680
221221
222222VIDEO_START( xevious )
223223{
224   bg_tilemap = tilemap_create(get_bg_tile_info,tilemap_scan_rows,TILEMAP_TYPE_PEN,     8,8,64,32);
225   fg_tilemap = tilemap_create(get_fg_tile_info,tilemap_scan_rows,TILEMAP_TYPE_PEN,8,8,64,32);
224   bg_tilemap = tilemap_create(get_bg_tile_info,tilemap_scan_rows,     8,8,64,32);
225   fg_tilemap = tilemap_create(get_fg_tile_info,tilemap_scan_rows,8,8,64,32);
226226
227227   tilemap_set_scrolldx(bg_tilemap,-20,288+27);
228228   tilemap_set_scrolldy(bg_tilemap,-16,-16);
src/mame/video/blktiger.c
r1679r1680
7474{
7575   scroll_ram = auto_malloc(BGRAM_BANK_SIZE * BGRAM_BANKS);
7676
77   tx_tilemap =    tilemap_create(get_tx_tile_info,tilemap_scan_rows,TILEMAP_TYPE_PEN,8,8,32,32);
78   bg_tilemap8x4 = tilemap_create(get_bg_tile_info,bg8x4_scan,       TILEMAP_TYPE_PEN,   16,16,128,64);
79   bg_tilemap4x8 = tilemap_create(get_bg_tile_info,bg4x8_scan,       TILEMAP_TYPE_PEN,   16,16,64,128);
77   tx_tilemap =    tilemap_create(get_tx_tile_info,tilemap_scan_rows,8,8,32,32);
78   bg_tilemap8x4 = tilemap_create(get_bg_tile_info,bg8x4_scan,          16,16,128,64);
79   bg_tilemap4x8 = tilemap_create(get_bg_tile_info,bg4x8_scan,          16,16,64,128);
8080
8181   tilemap_set_transparent_pen(tx_tilemap,3);
8282
src/mame/video/dynduke.c
r1679r1680
8181
8282VIDEO_START( dynduke )
8383{
84   bg_layer = tilemap_create(get_bg_tile_info,tilemap_scan_cols,TILEMAP_TYPE_PEN,      16,16,32,32);
85   fg_layer = tilemap_create(get_fg_tile_info,tilemap_scan_cols,TILEMAP_TYPE_PEN,16,16,32,32);
86   tx_layer = tilemap_create(get_tx_tile_info,tilemap_scan_rows,TILEMAP_TYPE_PEN, 8, 8,32,32);
84   bg_layer = tilemap_create(get_bg_tile_info,tilemap_scan_cols,      16,16,32,32);
85   fg_layer = tilemap_create(get_fg_tile_info,tilemap_scan_cols,16,16,32,32);
86   tx_layer = tilemap_create(get_tx_tile_info,tilemap_scan_rows, 8, 8,32,32);
8787
8888   tilemap_set_transparent_pen(fg_layer,15);
8989   tilemap_set_transparent_pen(tx_layer,15);
src/mame/video/deco_mlc.c
r1679r1680
6363}
6464#endif
6565
66static void mlc_drawgfxzoom( mame_bitmap *dest_bmp,const gfx_element *gfx,
66static void mlc_drawgfxzoom(mame_bitmap *dest_bmp,const gfx_element *gfx,
6767      UINT32 code1,UINT32 code2, UINT32 color,int flipx,int flipy,int sx,int sy,
6868      const rectangle *clip,int transparency,int transparent_color,int use8bpp,
6969      int scalex, int scaley)
r1679r1680
9898   {
9999      if( gfx )
100100      {
101         const pen_t *pal = &Machine->remapped_colortable[gfx->color_base + gfx->color_granularity * (color % gfx->total_colors)];
101         const pen_t *pal = &Machine->pens[gfx->color_base + gfx->color_granularity * (color % gfx->total_colors)];
102102         int source_base1 = (code1 % gfx->total_elements) * gfx->height;
103103         int source_base2 = (code2 % gfx->total_elements) * gfx->height;
104104
src/mame/video/tunhunt.c
r1679r1680
7575   tmpbitmap = auto_bitmap_alloc( 256, 64, machine->screen[0].format );
7676
7777   fg_tilemap = tilemap_create(get_fg_tile_info, tilemap_scan_cols,
78      TILEMAP_TYPE_PEN, 8, 8, 32, 32);
78      8, 8, 32, 32);
7979
8080   tilemap_set_transparent_pen(fg_tilemap, 0);
8181   tilemap_set_scrollx(fg_tilemap, 0, 64);
src/mame/video/tryout.c
r1679r1680
174174
175175VIDEO_START( tryout )
176176{
177   fg_tilemap = tilemap_create(get_fg_tile_info,get_fg_memory_offset,TILEMAP_TYPE_PEN,8,8,32,32);
178   bg_tilemap = tilemap_create(get_bg_tile_info,get_bg_memory_offset,TILEMAP_TYPE_PEN,16,16,64,16);
177   fg_tilemap = tilemap_create(get_fg_tile_info,get_fg_memory_offset,8,8,32,32);
178   bg_tilemap = tilemap_create(get_bg_tile_info,get_bg_memory_offset,16,16,64,16);
179179
180180   tryout_vram=auto_malloc(8 * 0x800);
181181   tryout_vram_gfx=auto_malloc(0x6000);
src/mame/video/rungun.c
r1679r1680
8686   K053936_wraparound_enable(0, 0);
8787   K053936_set_offset(0, 34, 9);
8888
89   rng_936_tilemap = tilemap_create(get_rng_936_tile_info, tilemap_scan_rows, TILEMAP_TYPE_PEN, 16, 16, 128, 128);
89   rng_936_tilemap = tilemap_create(get_rng_936_tile_info, tilemap_scan_rows, 16, 16, 128, 128);
9090   tilemap_set_transparent_pen(rng_936_tilemap, 0);
9191
9292   /* find first empty slot to decode gfx */
r1679r1680
106106           machine->gfx[ttl_gfx_index]->total_colors = machine->drv->total_colors / 16;
107107
108108   // create the tilemap
109   ttl_tilemap = tilemap_create(ttl_get_tile_info, tilemap_scan_rows, TILEMAP_TYPE_PEN, 8, 8, 64, 32);
109   ttl_tilemap = tilemap_create(ttl_get_tile_info, tilemap_scan_rows, 8, 8, 64, 32);
110110
111111   tilemap_set_transparent_pen(ttl_tilemap, 0);
112112
src/mame/video/madmotor.c
r1679r1680
114114
115115VIDEO_START( madmotor )
116116{
117   madmotor_pf1_tilemap = tilemap_create(get_pf1_tile_info, pf1_scan, TILEMAP_TYPE_PEN, 8, 8, 64,64);
118   madmotor_pf2_tilemap = tilemap_create(get_pf2_tile_info, pf2_scan, TILEMAP_TYPE_PEN,16,16, 32,32);
119   madmotor_pf3_tilemap = tilemap_create(get_pf3_tile_info, pf3_scan, TILEMAP_TYPE_PEN,     16,16, 32,64);
120   madmotor_pf3a_tilemap= tilemap_create(get_pf3a_tile_info,pf3a_scan,TILEMAP_TYPE_PEN,     16,16,128,16);
117   madmotor_pf1_tilemap = tilemap_create(get_pf1_tile_info, pf1_scan,  8, 8, 64,64);
118   madmotor_pf2_tilemap = tilemap_create(get_pf2_tile_info, pf2_scan, 16,16, 32,32);
119   madmotor_pf3_tilemap = tilemap_create(get_pf3_tile_info, pf3_scan,      16,16, 32,64);
120   madmotor_pf3a_tilemap= tilemap_create(get_pf3a_tile_info,pf3a_scan,     16,16,128,16);
121121
122122   tilemap_set_transparent_pen(madmotor_pf1_tilemap,0);
123123   tilemap_set_transparent_pen(madmotor_pf2_tilemap,0);
src/mame/video/eprom.c
r1679r1680
9494   };
9595
9696   /* initialize the playfield */
97   atarigen_playfield_tilemap = tilemap_create(get_playfield_tile_info, tilemap_scan_cols, TILEMAP_TYPE_PEN, 8,8, 64,64);
97   atarigen_playfield_tilemap = tilemap_create(get_playfield_tile_info, tilemap_scan_cols, 8,8, 64,64);
9898
9999   /* initialize the motion objects */
100100   atarimo_init(machine, 0, &modesc);
101101
102102   /* initialize the alphanumerics */
103   atarigen_alpha_tilemap = tilemap_create(get_alpha_tile_info, tilemap_scan_rows, TILEMAP_TYPE_PEN, 8,8, 64,32);
103   atarigen_alpha_tilemap = tilemap_create(get_alpha_tile_info, tilemap_scan_rows, 8,8, 64,32);
104104   tilemap_set_transparent_pen(atarigen_alpha_tilemap, 0);
105105}
106106
r1679r1680
145145   };
146146
147147   /* initialize the playfield */
148   atarigen_playfield_tilemap = tilemap_create(guts_get_playfield_tile_info, tilemap_scan_cols, TILEMAP_TYPE_PEN, 8,8, 64,64);
148   atarigen_playfield_tilemap = tilemap_create(guts_get_playfield_tile_info, tilemap_scan_cols, 8,8, 64,64);
149149
150150   /* initialize the motion objects */
151151   atarimo_init(machine, 0, &modesc);
152152
153153   /* initialize the alphanumerics */
154   atarigen_alpha_tilemap = tilemap_create(get_alpha_tile_info, tilemap_scan_rows, TILEMAP_TYPE_PEN, 8,8, 64,32);
154   atarigen_alpha_tilemap = tilemap_create(get_alpha_tile_info, tilemap_scan_rows, 8,8, 64,32);
155155   tilemap_set_transparent_pen(atarigen_alpha_tilemap, 0);
156156}
157157
src/mame/video/rocnrope.c
r1679r1680
77***************************************************************************/
88
99#include "driver.h"
10#include "video/resnet.h"
1011
1112static tilemap *bg_tilemap;
1213
r1679r1680
3031***************************************************************************/
3132PALETTE_INIT( rocnrope )
3233{
34   static const int resistances_rg[3] = { 1000, 470, 220 };
35   static const int resistances_b [2] = { 470, 220 };
36   double rweights[3], gweights[3], bweights[2];
3337   int i;
34   #define TOTAL_COLORS(gfxn) (machine->gfx[gfxn]->total_colors * machine->gfx[gfxn]->color_granularity)
35   #define COLOR(gfxn,offs) (colortable[machine->drv->gfxdecodeinfo[gfxn].color_codes_start + offs])
3638
39   /* compute the color output resistor weights */
40   compute_resistor_weights(0,   255, -1.0,
41         3, &resistances_rg[0], rweights, 1000, 0,
42         3, &resistances_rg[0], gweights, 1000, 0,
43         2, &resistances_b[0],  bweights, 1000, 0);
3744
38   for (i = 0;i < machine->drv->total_colors;i++)
45   /* allocate the colortable */
46   machine->colortable = colortable_alloc(machine, 0x20);
47
48   /* create a lookup table for the palette */
49   for (i = 0; i < 0x20; i++)
3950   {
40      int bit0,bit1,bit2,r,g,b;
51      int bit0, bit1, bit2;
52      int r, g, b;
4153
4254      /* red component */
43      bit0 = (*color_prom >> 0) & 0x01;
44      bit1 = (*color_prom >> 1) & 0x01;
45      bit2 = (*color_prom >> 2) & 0x01;
46      r = 0x21 * bit0 + 0x47 * bit1 + 0x97 * bit2;
55      bit0 = (color_prom[i] >> 0) & 0x01;
56      bit1 = (color_prom[i] >> 1) & 0x01;
57      bit2 = (color_prom[i] >> 2) & 0x01;
58      r = combine_3_weights(rweights, bit0, bit1, bit2);
59
4760      /* green component */
48      bit0 = (*color_prom >> 3) & 0x01;
49      bit1 = (*color_prom >> 4) & 0x01;
50      bit2 = (*color_prom >> 5) & 0x01;
51      g = 0x21 * bit0 + 0x47 * bit1 + 0x97 * bit2;
61      bit0 = (color_prom[i] >> 3) & 0x01;
62      bit1 = (color_prom[i] >> 4) & 0x01;
63      bit2 = (color_prom[i] >> 5) & 0x01;
64      g = combine_3_weights(gweights, bit0, bit1, bit2);
65
5266      /* blue component */
53      bit0 = 0;
54      bit1 = (*color_prom >> 6) & 0x01;
55      bit2 = (*color_prom >> 7) & 0x01;
56      b = 0x21 * bit0 + 0x47 * bit1 + 0x97 * bit2;
67      bit0 = (color_prom[i] >> 6) & 0x01;
68      bit1 = (color_prom[i] >> 7) & 0x01;
69      b = combine_2_weights(bweights, bit0, bit1);
5770
58      palette_set_color(machine,i,MAKE_RGB(r,g,b));
59      color_prom++;
71      colortable_palette_set_color(machine->colortable, i, MAKE_RGB(r, g, b));
6072   }
6173
6274   /* color_prom now points to the beginning of the lookup table */
75   color_prom += 0x20;
6376
64   /* sprites */
65   for (i = 0;i < TOTAL_COLORS(1);i++)
66      COLOR(1,i) = *(color_prom++) & 0x0f;
67
68   /* characters */
69   for (i = 0;i < TOTAL_COLORS(0);i++)
70      COLOR(0,i) = *(color_prom++) & 0x0f;
77   /* sprites and characters */
78   for (i = 0; i < 0x200; i++)
79   {
80      UINT8 ctabentry = color_prom[i] & 0x0f;
81      colortable_entry_set_value(machine->colortable, i, ctabentry);
82   }
7183}
7284
7385WRITE8_HANDLER( rocnrope_videoram_w )
r1679r1680
98110   int color = attr & 0x0f;
99111   int flags = ((attr & 0x40) ? TILE_FLIPX : 0) | ((attr & 0x20) ? TILE_FLIPY : 0);
100112
101   SET_TILE_INFO(0, code, color, flags);
113   SET_TILE_INFO(1, code, color, flags);
102114}
103115
104116VIDEO_START( rocnrope )
105117{
106   bg_tilemap = tilemap_create(get_bg_tile_info, tilemap_scan_rows,
107      TILEMAP_TYPE_PEN, 8, 8, 32, 32);
118   bg_tilemap = tilemap_create(get_bg_tile_info, tilemap_scan_rows, 8, 8, 32, 32);
108119}
109120
110121static void draw_sprites(running_machine *machine, mame_bitmap *bitmap, const rectangle *cliprect )
r1679r1680
113124
114125   for (offs = spriteram_size - 2;offs >= 0;offs -= 2)
115126   {
116      drawgfx(bitmap,machine->gfx[1],
127      int color = spriteram_2[offs] & 0x0f;
128
129      drawgfx(bitmap,machine->gfx[0],
117130            spriteram[offs + 1],
118            spriteram_2[offs] & 0x0f,
131            color,
119132            spriteram_2[offs] & 0x40,~spriteram_2[offs] & 0x80,
120133            240-spriteram[offs],spriteram_2[offs + 1],
121            cliprect,TRANSPARENCY_COLOR,0);
134            cliprect,TRANSPARENCY_PENS,
135            colortable_get_transpen_mask(machine->colortable, machine->gfx[0], color, 0));
122136   }
123137}
124138
src/mame/video/aerofgt.c
r1679r1680
9595
9696VIDEO_START( pspikes )
9797{
98   bg1_tilemap = tilemap_create(get_pspikes_tile_info,tilemap_scan_rows,TILEMAP_TYPE_PEN,8,8,64,32);
98   bg1_tilemap = tilemap_create(get_pspikes_tile_info,tilemap_scan_rows,8,8,64,32);
9999   /* no bg2 in this game */
100100
101101   sprite_gfx = 1;
r1679r1680
104104
105105VIDEO_START( karatblz )
106106{
107   bg1_tilemap = tilemap_create(karatblz_bg1_tile_info,tilemap_scan_rows,TILEMAP_TYPE_PEN,     8,8,64,64);
108   bg2_tilemap = tilemap_create(karatblz_bg2_tile_info,tilemap_scan_rows,TILEMAP_TYPE_PEN,8,8,64,64);
107   bg1_tilemap = tilemap_create(karatblz_bg1_tile_info,tilemap_scan_rows,     8,8,64,64);
108   bg2_tilemap = tilemap_create(karatblz_bg2_tile_info,tilemap_scan_rows,8,8,64,64);
109109
110110   tilemap_set_transparent_pen(bg2_tilemap,15);
111111
r1679r1680
118118{
119119   int i;
120120
121   bg1_tilemap = tilemap_create(spinlbrk_bg1_tile_info,tilemap_scan_rows,TILEMAP_TYPE_PEN,     8,8,64,64);
122   bg2_tilemap = tilemap_create(karatblz_bg2_tile_info,tilemap_scan_rows,TILEMAP_TYPE_PEN,8,8,64,64);
121   bg1_tilemap = tilemap_create(spinlbrk_bg1_tile_info,tilemap_scan_rows,     8,8,64,64);
122   bg2_tilemap = tilemap_create(karatblz_bg2_tile_info,tilemap_scan_rows,8,8,64,64);
123123
124124   tilemap_set_transparent_pen(bg2_tilemap,15);
125125
r1679r1680
143143
144144VIDEO_START( turbofrc )
145145{
146   bg1_tilemap = tilemap_create(get_bg1_tile_info,tilemap_scan_rows,TILEMAP_TYPE_PEN,     8,8,64,64);
147   bg2_tilemap = tilemap_create(get_bg2_tile_info,tilemap_scan_rows,TILEMAP_TYPE_PEN,8,8,64,64);
146   bg1_tilemap = tilemap_create(get_bg1_tile_info,tilemap_scan_rows,     8,8,64,64);
147   bg2_tilemap = tilemap_create(get_bg2_tile_info,tilemap_scan_rows,8,8,64,64);
148148
149149   tilemap_set_transparent_pen(bg2_tilemap,15);
150150
r1679r1680
155155
156156VIDEO_START( wbbc97 )
157157{
158   bg1_tilemap = tilemap_create(get_pspikes_tile_info,tilemap_scan_rows,TILEMAP_TYPE_PEN,8,8,64,32);
158   bg1_tilemap = tilemap_create(get_pspikes_tile_info,tilemap_scan_rows,8,8,64,32);
159159   /* no bg2 in this game */
160160
161161   tilemap_set_transparent_pen(bg1_tilemap,15);
src/mame/video/docastle.c
r1679r1680
111111
112112static void video_start_common(running_machine *machine, UINT32 tile_transmask)
113113{
114   docastle_tilemap = tilemap_create(get_tile_info, tilemap_scan_rows, TILEMAP_TYPE_PEN, 8, 8, 32, 32);
114   docastle_tilemap = tilemap_create(get_tile_info, tilemap_scan_rows, 8, 8, 32, 32);
115115   tilemap_set_transmask(docastle_tilemap, 0, tile_transmask, 0x0000);
116116}
117117
src/mame/video/mystston.c
r1679r1680
124124VIDEO_START( mystston )
125125{
126126   bg_tilemap = tilemap_create(get_bg_tile_info, tilemap_scan_cols_flip_x,
127      TILEMAP_TYPE_PEN, 16, 16, 16, 32);
127      16, 16, 16, 32);
128128
129129   fg_tilemap = tilemap_create(get_fg_tile_info, tilemap_scan_cols_flip_x,
130      TILEMAP_TYPE_PEN, 8, 8, 32, 32);
130      8, 8, 32, 32);
131131
132132   tilemap_set_transparent_pen(fg_tilemap, 0);
133133}
src/mame/video/mainsnk.c
r1679r1680
105105   old_bg_color = -1;
106106   stuff_palette( machine, 0, 0, 16*8 );
107107   stuff_palette( machine, 16*8*3, 16*8, 16*8 );
108   me_fg_tilemap = tilemap_create(get_me_fg_tile_info,tilemap_scan_cols,TILEMAP_TYPE_PEN,8,8,32, 32);
108   me_fg_tilemap = tilemap_create(get_me_fg_tile_info,tilemap_scan_cols,8,8,32, 32);
109109   tilemap_set_transparent_pen(me_fg_tilemap,15);
110   me_bg_tilemap = tilemap_create(get_me_bg_tile_info,tilemap_scan_cols,TILEMAP_TYPE_PEN,8,8,32, 32);
110   me_bg_tilemap = tilemap_create(get_me_bg_tile_info,tilemap_scan_cols,8,8,32, 32);
111111   tilemap_set_scrollx( me_fg_tilemap, 0, -mainsnk_offset );
112112   tilemap_set_scrollx( me_bg_tilemap, 0, -mainsnk_offset );
113113}
src/mame/video/ygv608.c
r1679r1680
515515   namcond1_gfxbank = 0;
516516
517517   /* create tilemaps of all sizes and combinations */
518   tilemap_A_cache_8[0] = tilemap_create(get_tile_info_A_8, get_tile_offset, TILEMAP_TYPE_PEN, 8,8, 32,32);
519   tilemap_A_cache_8[1] = tilemap_create(get_tile_info_A_8, get_tile_offset, TILEMAP_TYPE_PEN, 8,8, 64,32);
520   tilemap_A_cache_8[2] = tilemap_create(get_tile_info_A_8, get_tile_offset, TILEMAP_TYPE_PEN, 8,8, 32,64);
518   tilemap_A_cache_8[0] = tilemap_create(get_tile_info_A_8, get_tile_offset,  8,8, 32,32);
519   tilemap_A_cache_8[1] = tilemap_create(get_tile_info_A_8, get_tile_offset,  8,8, 64,32);
520   tilemap_A_cache_8[2] = tilemap_create(get_tile_info_A_8, get_tile_offset,  8,8, 32,64);
521521
522   tilemap_A_cache_16[0] = tilemap_create(get_tile_info_A_16, get_tile_offset, TILEMAP_TYPE_PEN, 16,16, 32,32);
523   tilemap_A_cache_16[1] = tilemap_create(get_tile_info_A_16, get_tile_offset, TILEMAP_TYPE_PEN, 16,16, 64,32);
524   tilemap_A_cache_16[2] = tilemap_create(get_tile_info_A_16, get_tile_offset, TILEMAP_TYPE_PEN, 16,16, 32,64);
522   tilemap_A_cache_16[0] = tilemap_create(get_tile_info_A_16, get_tile_offset,  16,16, 32,32);
523   tilemap_A_cache_16[1] = tilemap_create(get_tile_info_A_16, get_tile_offset,  16,16, 64,32);
524   tilemap_A_cache_16[2] = tilemap_create(get_tile_info_A_16, get_tile_offset,  16,16, 32,64);
525525
526   tilemap_B_cache_8[0] = tilemap_create(get_tile_info_B_8, get_tile_offset, TILEMAP_TYPE_PEN, 8,8, 32,32);
527   tilemap_B_cache_8[1] = tilemap_create(get_tile_info_B_8, get_tile_offset, TILEMAP_TYPE_PEN, 8,8, 64,32);
528   tilemap_B_cache_8[2] = tilemap_create(get_tile_info_B_8, get_tile_offset, TILEMAP_TYPE_PEN, 8,8, 32,64);
526   tilemap_B_cache_8[0] = tilemap_create(get_tile_info_B_8, get_tile_offset,  8,8, 32,32);
527   tilemap_B_cache_8[1] = tilemap_create(get_tile_info_B_8, get_tile_offset,  8,8, 64,32);
528   tilemap_B_cache_8[2] = tilemap_create(get_tile_info_B_8, get_tile_offset,  8,8, 32,64);
529529
530   tilemap_B_cache_16[0] = tilemap_create(get_tile_info_B_16, get_tile_offset, TILEMAP_TYPE_PEN, 16,16, 32,32);
531   tilemap_B_cache_16[1] = tilemap_create(get_tile_info_B_16, get_tile_offset, TILEMAP_TYPE_PEN, 16,16, 64,32);
532   tilemap_B_cache_16[2] = tilemap_create(get_tile_info_B_16, get_tile_offset, TILEMAP_TYPE_PEN, 16,16, 32,64);
530   tilemap_B_cache_16[0] = tilemap_create(get_tile_info_B_16, get_tile_offset,  16,16, 32,32);
531   tilemap_B_cache_16[1] = tilemap_create(get_tile_info_B_16, get_tile_offset,  16,16, 64,32);
532   tilemap_B_cache_16[2] = tilemap_create(get_tile_info_B_16, get_tile_offset,  16,16, 32,64);
533533
534534   tilemap_A = NULL;
535535   tilemap_B = NULL;
src/mame/video/senjyo.c
r1679r1680
118118
119119VIDEO_START( senjyo )
120120{
121   fg_tilemap = tilemap_create(get_fg_tile_info,tilemap_scan_rows,TILEMAP_TYPE_PEN,8,8,32,32);
121   fg_tilemap = tilemap_create(get_fg_tile_info,tilemap_scan_rows,8,8,32,32);
122122
123123   if (senjyo)
124124   {
125      bg1_tilemap = tilemap_create(senjyo_bg1_tile_info,tilemap_scan_rows,TILEMAP_TYPE_PEN,16,16,16,32);
126      bg2_tilemap = tilemap_create(get_bg2_tile_info,   tilemap_scan_rows,TILEMAP_TYPE_PEN,16,16,16,48);   /* only 16x32 used by Star Force */
127      bg3_tilemap = tilemap_create(get_bg3_tile_info,   tilemap_scan_rows,TILEMAP_TYPE_PEN,16,16,16,56);   /* only 16x32 used by Star Force */
125      bg1_tilemap = tilemap_create(senjyo_bg1_tile_info,tilemap_scan_rows,16,16,16,32);
126      bg2_tilemap = tilemap_create(get_bg2_tile_info,   tilemap_scan_rows,16,16,16,48);   /* only 16x32 used by Star Force */
127      bg3_tilemap = tilemap_create(get_bg3_tile_info,   tilemap_scan_rows,16,16,16,56);   /* only 16x32 used by Star Force */
128128   }
129129   else
130130   {
131      bg1_tilemap = tilemap_create(starforc_bg1_tile_info,tilemap_scan_rows,TILEMAP_TYPE_PEN,16,16,16,32);
132      bg2_tilemap = tilemap_create(get_bg2_tile_info,     tilemap_scan_rows,TILEMAP_TYPE_PEN,16,16,16,32);   /* only 16x32 used by Star Force */
133      bg3_tilemap = tilemap_create(get_bg3_tile_info,     tilemap_scan_rows,TILEMAP_TYPE_PEN,16,16,16,32);   /* only 16x32 used by Star Force */
131      bg1_tilemap = tilemap_create(starforc_bg1_tile_info,tilemap_scan_rows,16,16,16,32);
132      bg2_tilemap = tilemap_create(get_bg2_tile_info,     tilemap_scan_rows,16,16,16,32);   /* only 16x32 used by Star Force */
133      bg3_tilemap = tilemap_create(get_bg3_tile_info,     tilemap_scan_rows,16,16,16,32);   /* only 16x32 used by Star Force */
134134   }
135135
136136   tilemap_set_transparent_pen(fg_tilemap,0);
src/mame/video/yiear.c
r1679r1680
105105VIDEO_START( yiear )
106106{
107107   bg_tilemap = tilemap_create(get_bg_tile_info, tilemap_scan_rows,
108      TILEMAP_TYPE_PEN, 8, 8, 32, 32);
108      8, 8, 32, 32);
109109}
110110
111111static void draw_sprites(running_machine *machine, mame_bitmap *bitmap, const rectangle *cliprect)
src/mame/video/sonson.c
r1679r1680
128128VIDEO_START( sonson )
129129{
130130   bg_tilemap = tilemap_create(get_bg_tile_info, tilemap_scan_rows,
131      TILEMAP_TYPE_PEN, 8, 8, 32, 32);
131      8, 8, 32, 32);
132132
133133   tilemap_set_scroll_rows(bg_tilemap, 32);
134134}
src/mame/video/sslam.c
r1679r1680
142142
143143VIDEO_START(sslam)
144144{
145   sslam_bg_tilemap = tilemap_create(get_sslam_bg_tile_info,tilemap_scan_rows,TILEMAP_TYPE_PEN,16,16,32,32);
146   sslam_md_tilemap = tilemap_create(get_sslam_md_tile_info,tilemap_scan_rows,TILEMAP_TYPE_PEN,16,16,32,32);
147   sslam_tx_tilemap = tilemap_create(get_sslam_tx_tile_info,tilemap_scan_rows,TILEMAP_TYPE_PEN,8,8,64,64);
145   sslam_bg_tilemap = tilemap_create(get_sslam_bg_tile_info,tilemap_scan_rows,16,16,32,32);
146   sslam_md_tilemap = tilemap_create(get_sslam_md_tile_info,tilemap_scan_rows,16,16,32,32);
147   sslam_tx_tilemap = tilemap_create(get_sslam_tx_tile_info,tilemap_scan_rows,8,8,64,64);
148148
149149   tilemap_set_transparent_pen(sslam_md_tilemap,0);
150150   tilemap_set_transparent_pen(sslam_tx_tilemap,0);
r1679r1680
155155
156156VIDEO_START(powerbls)
157157{
158   sslam_bg_tilemap = tilemap_create(get_powerbls_bg_tile_info,tilemap_scan_rows,TILEMAP_TYPE_PEN,8,8,64,64);
158   sslam_bg_tilemap = tilemap_create(get_powerbls_bg_tile_info,tilemap_scan_rows,8,8,64,64);
159159
160160   sprites_x_offset = -21;
161161   state_save_register_global(sprites_x_offset);
src/mame/video/hcastle.c
r1679r1680
128128
129129VIDEO_START( hcastle )
130130{
131   fg_tilemap = tilemap_create(get_fg_tile_info,tilemap_scan,TILEMAP_TYPE_PEN,8,8,64,32);
132   bg_tilemap = tilemap_create(get_bg_tile_info,tilemap_scan,TILEMAP_TYPE_PEN,     8,8,64,32);
131   fg_tilemap = tilemap_create(get_fg_tile_info,tilemap_scan,8,8,64,32);
132   bg_tilemap = tilemap_create(get_bg_tile_info,tilemap_scan,     8,8,64,32);
133133
134134   tilemap_set_transparent_pen(fg_tilemap,0);
135135}
src/mame/video/deadang.c
r1679r1680
7171
7272VIDEO_START( deadang )
7373{
74   pf3_layer = tilemap_create(get_pf3_tile_info,bg_scan,          TILEMAP_TYPE_PEN,     16,16,128,256);
75   pf2_layer = tilemap_create(get_pf2_tile_info,bg_scan,          TILEMAP_TYPE_PEN,16,16,128,256);
76   pf1_layer = tilemap_create(get_pf1_tile_info,tilemap_scan_cols,TILEMAP_TYPE_PEN,16,16, 32, 32);
77   text_layer = tilemap_create(get_text_tile_info,tilemap_scan_rows,TILEMAP_TYPE_PEN, 8, 8, 32, 32);
74   pf3_layer = tilemap_create(get_pf3_tile_info,bg_scan,               16,16,128,256);
75   pf2_layer = tilemap_create(get_pf2_tile_info,bg_scan,          16,16,128,256);
76   pf1_layer = tilemap_create(get_pf1_tile_info,tilemap_scan_cols,16,16, 32, 32);
77   text_layer = tilemap_create(get_text_tile_info,tilemap_scan_rows, 8, 8, 32, 32);
7878
7979   tilemap_set_transparent_pen(pf2_layer, 15);
8080   tilemap_set_transparent_pen(pf1_layer, 15);
src/mame/video/twincobr.c
r1679r1680
1313***************************************************************************/
1414
1515#include "driver.h"
16#include "video/crtc6845.h"
16#include "video/mc6845.h"
1717#include "twincobr.h"
1818
1919
r1679r1680
103103
104104static void twincobr_create_tilemaps(void)
105105{
106   bg_tilemap = tilemap_create(get_bg_tile_info,tilemap_scan_rows,TILEMAP_TYPE_PEN,8,8,64,64);
107   fg_tilemap = tilemap_create(get_fg_tile_info,tilemap_scan_rows,TILEMAP_TYPE_PEN,8,8,64,64);
108   tx_tilemap = tilemap_create(get_tx_tile_info,tilemap_scan_rows,TILEMAP_TYPE_PEN,8,8,64,32);
106   bg_tilemap = tilemap_create(get_bg_tile_info,tilemap_scan_rows,8,8,64,64);
107   fg_tilemap = tilemap_create(get_fg_tile_info,tilemap_scan_rows,8,8,64,64);
108   tx_tilemap = tilemap_create(get_tx_tile_info,tilemap_scan_rows,8,8,64,32);
109109
110110   tilemap_set_transparent_pen(fg_tilemap,0);
111111   tilemap_set_transparent_pen(tx_tilemap,0);
r1679r1680
190190
191191WRITE16_HANDLER( twincobr_crtc_reg_sel_w )
192192{
193   crtc6845_address_w(offset, data);
193//  mc6845_address_w(offset, data);
194194}
195195
196196WRITE16_HANDLER( twincobr_crtc_data_w )
197197{
198   crtc6845_register_w(offset, data);
198//  mc6845_register_w(offset, data);
199199}
200200
201201WRITE16_HANDLER( twincobr_txoffs_w )
r1679r1680
371371
372372WRITE8_HANDLER( wardner_CRTC_reg_sel_w )
373373{
374   crtc6845_address_w(offset, data);
374//  mc6845_address_w(offset, data);
375375}
376376
377377WRITE8_HANDLER( wardner_CRTC_data_w )
378378{
379   crtc6845_register_w(0, data);
379//  mc6845_register_w(0, data);
380380}
381381
382382
src/mame/video/hexion.c
r1679r1680
4343
4444VIDEO_START( hexion )
4545{
46   bg_tilemap[0] = tilemap_create(get_tile_info0,tilemap_scan_rows,TILEMAP_TYPE_PEN,8,8,64,32);
47   bg_tilemap[1] = tilemap_create(get_tile_info1,tilemap_scan_rows,TILEMAP_TYPE_PEN,     8,8,64,32);
46   bg_tilemap[0] = tilemap_create(get_tile_info0,tilemap_scan_rows,8,8,64,32);
47   bg_tilemap[1] = tilemap_create(get_tile_info1,tilemap_scan_rows,     8,8,64,32);
4848
4949   tilemap_set_transparent_pen(bg_tilemap[0],0);
5050   tilemap_set_scrollx(bg_tilemap[1],0,-4);
src/mame/video/bking.c
r1679r1680
246246
247247VIDEO_START( bking )
248248{
249   bg_tilemap = tilemap_create(get_tile_info, tilemap_scan_rows, 0, 8, 8, 32, 32);
249   bg_tilemap = tilemap_create(get_tile_info, tilemap_scan_rows, 8, 8, 32, 32);
250250   helper0 = auto_bitmap_alloc(machine->screen[0].width, machine->screen[0].height, machine->screen[0].format);
251251   helper1 = auto_bitmap_alloc(machine->screen[0].width, machine->screen[0].height, machine->screen[0].format);
252252}
src/mame/video/labyrunr.c
r1679r1680
125125
126126VIDEO_START( labyrunr )
127127{
128   layer0 = tilemap_create(get_tile_info0,tilemap_scan_rows,TILEMAP_TYPE_PEN,8,8,32,32);
129   layer1 = tilemap_create(get_tile_info1,tilemap_scan_rows,TILEMAP_TYPE_PEN,8,8,32,32);
128   layer0 = tilemap_create(get_tile_info0,tilemap_scan_rows,8,8,32,32);
129   layer1 = tilemap_create(get_tile_info1,tilemap_scan_rows,8,8,32,32);
130130
131131   tilemap_set_transparent_pen(layer0,0);
132132   tilemap_set_transparent_pen(layer1,0);
src/mame/video/ddragon3.c
r1679r1680
9494    state_save_register_global(ddragon3_bg_tilebase);
9595
9696    bg_tilemap = tilemap_create(get_bg_tile_info, tilemap_scan_rows,
97      TILEMAP_TYPE_PEN, 16, 16, 32, 32);
97      16, 16, 32, 32);
9898
9999   fg_tilemap = tilemap_create(get_fg_tile_info, tilemap_scan_rows,
100      TILEMAP_TYPE_PEN, 16, 16, 32, 32);
100      16, 16, 32, 32);
101101
102102   tilemap_set_transparent_pen(bg_tilemap, 0);
103103   tilemap_set_transparent_pen(fg_tilemap, 0);
src/mame/video/sprint2.c
r1679r1680
2727{
2828   helper = auto_bitmap_alloc(machine->screen[0].width, machine->screen[0].height, machine->screen[0].format);
2929
30   bg_tilemap = tilemap_create(get_tile_info, tilemap_scan_rows, TILEMAP_TYPE_PEN, 16, 8, 32, 32);
30   bg_tilemap = tilemap_create(get_tile_info, tilemap_scan_rows, 16, 8, 32, 32);
3131}
3232
3333
src/mame/video/dragrace.c
r1679r1680
5050VIDEO_START( dragrace )
5151{
5252   bg_tilemap = tilemap_create(
53      get_tile_info, tilemap_scan_rows, TILEMAP_TYPE_PEN, 16, 16, 16, 16);
53      get_tile_info, tilemap_scan_rows, 16, 16, 16, 16);
5454}
5555
5656
src/mame/video/orbit.c
r1679r1680
4949
5050VIDEO_START( orbit )
5151{
52   bg_tilemap = tilemap_create(get_tile_info, tilemap_scan_rows, 0, 16, 16, 32, 30);
52   bg_tilemap = tilemap_create(get_tile_info, tilemap_scan_rows, 16, 16, 32, 30);
5353}
5454
5555
src/mame/video/seibuspi.c
r1679r1680
332332            UINT8 alpha = alpha_table[global_pen];
333333            if (alpha)
334334            {
335               p[i] = alpha_blend16(p[i], Machine->remapped_colortable[gfx->color_base + global_pen]);
335               p[i] = alpha_blend16(p[i], Machine->pens[gfx->color_base + global_pen]);
336336            }
337337            else
338338            {
339               p[i] = Machine->remapped_colortable[gfx->color_base + global_pen];
339               p[i] = Machine->pens[gfx->color_base + global_pen];
340340            }
341341         }
342342         dp_i += xd;
r1679r1680
482482   int i;
483483   int region_length;
484484
485   text_layer   = tilemap_create( get_text_tile_info, tilemap_scan_rows, TILEMAP_TYPE_PEN, 8,8,64,32 );
486   back_layer   = tilemap_create( get_back_tile_info, tilemap_scan_cols, TILEMAP_TYPE_PEN, 16,16,32,32 );
487   mid_layer   = tilemap_create( get_mid_tile_info, tilemap_scan_cols, TILEMAP_TYPE_PEN, 16,16,32,32 );
488   fore_layer   = tilemap_create( get_fore_tile_info, tilemap_scan_cols, TILEMAP_TYPE_PEN, 16,16,32,32 );
485   text_layer   = tilemap_create( get_text_tile_info, tilemap_scan_rows,  8,8,64,32 );
486   back_layer   = tilemap_create( get_back_tile_info, tilemap_scan_cols,  16,16,32,32 );
487   mid_layer   = tilemap_create( get_mid_tile_info, tilemap_scan_cols,  16,16,32,32 );
488   fore_layer   = tilemap_create( get_fore_tile_info, tilemap_scan_cols,  16,16,32,32 );
489489
490490   tilemap_set_transparent_pen(text_layer, 31);
491491   tilemap_set_transparent_pen(mid_layer, 63);
r1679r1680
598598            UINT8 alpha = alpha_table[pen];
599599            if (alpha)
600600            {
601               *d = alpha_blend16(*d, machine->remapped_colortable[pen]);
601               *d = alpha_blend16(*d, machine->pens[pen]);
602602            }
603603            else
604604            {
605               *d = machine->remapped_colortable[pen];
605               *d = machine->pens[pen];
606606            }
607607         }
608608         ++d;
src/mame/video/sauro.c
r1679r1680
8787VIDEO_START( sauro )
8888{
8989   bg_tilemap = tilemap_create(get_tile_info_bg, tilemap_scan_cols,
90      TILEMAP_TYPE_PEN, 8, 8, 32, 32);
90      8, 8, 32, 32);
9191
9292   fg_tilemap = tilemap_create(get_tile_info_fg, tilemap_scan_cols,
93      TILEMAP_TYPE_PEN, 8, 8, 32, 32);
93      8, 8, 32, 32);
9494
9595   tilemap_set_transparent_pen(fg_tilemap, 0);
9696   palette_bank = 0;
r1679r1680
160160VIDEO_START( trckydoc )
161161{
162162   bg_tilemap = tilemap_create(get_tile_info_bg, tilemap_scan_cols,
163      TILEMAP_TYPE_PEN, 8, 8, 32, 32);
163      8, 8, 32, 32);
164164}
165165
166166static void trckydoc_draw_sprites(running_machine *machine, mame_bitmap *bitmap, const rectangle *cliprect)
src/mame/video/gaplus.c
r1679r1680
195195
196196VIDEO_START( gaplus )
197197{
198   bg_tilemap = tilemap_create(get_tile_info,tilemap_scan,TILEMAP_TYPE_PEN,8,8,36,28);
198   bg_tilemap = tilemap_create(get_tile_info,tilemap_scan,8,8,36,28);
199199
200200   colortable_configure_tilemap_groups(machine->colortable, bg_tilemap, machine->gfx[0], 0xff);
201201
src/mame/video/drmicro.c
r1679r1680
3333      tilemap_mark_tile_dirty(drmicro_bg1,(offset & 0x3ff));
3434}
3535
36READ8_HANDLER( drmicro_videoram_r )
37{
38   return drmicro_videoram[offset];
39}
4036
4137/****************************************************************************/
4238
r1679r1680
7470{
7571   int i;
7672
77   for (i = 0;i < machine->drv->total_colors;i++)
73   /* allocate the colortable */
74   machine->colortable = colortable_alloc(machine, 0x20);
75
76   /* create a lookup table for the palette */
77   for (i = 0; i < 0x20; i++)
7878   {
79      int bit0,bit1,bit2,r,g,b;
79      int bit0, bit1, bit2;
80      int r, g, b;
8081
81      bit0 = (*color_prom >> 0) & 0x01;
82      bit1 = (*color_prom >> 1) & 0x01;
83      bit2 = (*color_prom >> 2) & 0x01;
82      /* red component */
83      bit0 = (color_prom[i] >> 0) & 0x01;
84      bit1 = (color_prom[i] >> 1) & 0x01;
85      bit2 = (color_prom[i] >> 2) & 0x01;
8486      r = 0x21 * bit0 + 0x47 * bit1 + 0x97 * bit2;
85      bit0 = (*color_prom >> 3) & 0x01;
86      bit1 = (*color_prom >> 4) & 0x01;
87      bit2 = (*color_prom >> 5) & 0x01;
87
88      /* green component */
89      bit0 = (color_prom[i] >> 3) & 0x01;
90      bit1 = (color_prom[i] >> 4) & 0x01;
91      bit2 = (color_prom[i] >> 5) & 0x01;
8892      g = 0x21 * bit0 + 0x47 * bit1 + 0x97 * bit2;
93
94      /* blue component */
8995      bit0 = 0;
90      bit1 = (*color_prom >> 6) & 0x01;
91      bit2 = (*color_prom >> 7) & 0x01;
96      bit1 = (color_prom[i] >> 6) & 0x01;
97      bit2 = (color_prom[i] >> 7) & 0x01;
9298      b = 0x21 * bit0 + 0x47 * bit1 + 0x97 * bit2;
9399
94      palette_set_color(machine,i,MAKE_RGB(r,g,b));
95      color_prom++;
100      colortable_palette_set_color(machine->colortable, i, MAKE_RGB(r, g, b));
96101   }
97102
98   for (i=0; i<machine->drv->color_table_len; i++)
99      colortable[i] = color_prom[i] & 0x0f;
103   /* color_prom now points to the beginning of the lookup table */
104   color_prom += 0x20;
105
106   for (i = 0; i < 0x200; i++)
107   {
108      UINT8 ctabentry = color_prom[i] & 0x0f;
109      colortable_entry_set_value(machine->colortable, i, ctabentry);
110   }
100111}
101112
102113VIDEO_START( drmicro)
103114{
104115   drmicro_videoram = auto_malloc(0x1000);
105116
106   drmicro_bg1 = tilemap_create(get_bg1_tile_info, tilemap_scan_rows,TILEMAP_TYPE_PEN, 8,8,32,32);
107   drmicro_bg2 = tilemap_create(get_bg2_tile_info, tilemap_scan_rows,TILEMAP_TYPE_PEN, 8,8,32,32);
117   drmicro_bg1 = tilemap_create(get_bg1_tile_info, tilemap_scan_rows, 8,8,32,32);
118   drmicro_bg2 = tilemap_create(get_bg2_tile_info, tilemap_scan_rows, 8,8,32,32);
108119
109120   tilemap_set_transparent_pen(drmicro_bg2,0);
110121}
src/mame/video/speedatk.c
r1679r1680
9999
100100VIDEO_START( speedatk )
101101{
102   bg_tilemap = tilemap_create(get_tile_info,tilemap_scan_rows,TILEMAP_TYPE_PEN,8,8,34,32);
102   bg_tilemap = tilemap_create(get_tile_info,tilemap_scan_rows,8,8,34,32);
103103}
104104
105105VIDEO_UPDATE( speedatk )
src/mame/video/system1.c
r1679r1680
269269   skip = sprite_base[SPR_SKIP_LO] + (sprite_base[SPR_SKIP_HI] << 8);
270270
271271   height = sprite_base[SPR_Y_BOTTOM] - sprite_base[SPR_Y_TOP];
272   sprite_palette = Machine->remapped_colortable + 0x10 * spr_number;
272   sprite_palette = Machine->pens + 0x10 * spr_number;
273273
274274   sy = sprite_base[SPR_Y_TOP] + 1;
275275
src/mame/video/powerins.c
r1679r1680
200200{
201201   tilemap_0 = tilemap_create(   get_tile_info_0,
202202                        powerins_get_memory_offset_0,
203                        TILEMAP_TYPE_PEN,
203
204204                        16,16,
205205                        DIM_NX_0, DIM_NY_0 );
206206
207207   tilemap_1 = tilemap_create(   get_tile_info_1,
208208                        tilemap_scan_cols,
209                        TILEMAP_TYPE_PEN,
209
210210                        8,8,
211211                        DIM_NX_1, DIM_NY_1 );
212212
src/mame/video/stvvdp2.c
r1679r1680
24132413
24142414   if( gfx )
24152415   {
2416      const pen_t *pal = &Machine->remapped_colortable[gfx->color_base + gfx->color_granularity * (color % gfx->total_colors)];
2416      const pen_t *pal = &Machine->pens[gfx->color_base + gfx->color_granularity * (color % gfx->total_colors)];
24172417      UINT8 *source_base = gfx->gfxdata + (code % gfx->total_elements) * gfx->char_modulo;
24182418
24192419      //int sprite_screen_height = (scaley*gfx->height+0x8000)>>16;
src/mame/video/exedexes.c
r1679r1680
3939PALETTE_INIT( exedexes )
4040{
4141   int i;
42   #define TOTAL_COLORS(gfxn) (machine->gfx[gfxn]->total_colors * machine->gfx[gfxn]->color_granularity)
43   #define COLOR(gfxn,offs) (colortable[machine->drv->gfxdecodeinfo[gfxn].color_codes_start + offs])
4442
43   /* allocate the colortable */
44   machine->colortable = colortable_alloc(machine, 0x100);
4545
46   for (i = 0;i < machine->drv->total_colors;i++)
46   /* create a lookup table for the palette */
47   for (i = 0; i < 0x100; i++)
4748   {
48      int bit0,bit1,bit2,bit3,r,g,b;
49      int r = pal4bit(color_prom[i + 0x000]);
50      int g = pal4bit(color_prom[i + 0x100]);
51      int b = pal4bit(color_prom[i + 0x200]);
4952
50
51      bit0 = (color_prom[0] >> 0) & 0x01;
52      bit1 = (color_prom[0] >> 1) & 0x01;
53      bit2 = (color_prom[0] >> 2) & 0x01;
54      bit3 = (color_prom[0] >> 3) & 0x01;
55      r = 0x0e * bit0 + 0x1f * bit1 + 0x43 * bit2 + 0x8f * bit3;
56      bit0 = (color_prom[machine->drv->total_colors] >> 0) & 0x01;
57      bit1 = (color_prom[machine->drv->total_colors] >> 1) & 0x01;
58      bit2 = (color_prom[machine->drv->total_colors] >> 2) & 0x01;
59      bit3 = (color_prom[machine->drv->total_colors] >> 3) & 0x01;
60      g = 0x0e * bit0 + 0x1f * bit1 + 0x43 * bit2 + 0x8f * bit3;
61      bit0 = (color_prom[2*machine->drv->total_colors] >> 0) & 0x01;
62      bit1 = (color_prom[2*machine->drv->total_colors] >> 1) & 0x01;
63      bit2 = (color_prom[2*machine->drv->total_colors] >> 2) & 0x01;
64      bit3 = (color_prom[2*machine->drv->total_colors] >> 3) & 0x01;
65      b = 0x0e * bit0 + 0x1f * bit1 + 0x43 * bit2 + 0x8f * bit3;
66
67      palette_set_color(machine,i,MAKE_RGB(r,g,b));
68      color_prom++;
53      colortable_palette_set_color(machine->colortable, i, MAKE_RGB(r, g, b));
6954   }
7055
71   color_prom += 2*machine->drv->total_colors;
7256   /* color_prom now points to the beginning of the lookup table */
57   color_prom += 0x300;
7358
74   /* characters use colors 192-207 */
75   for (i = 0;i < TOTAL_COLORS(0);i++)
76      COLOR(0,i) = (*color_prom++) + 192;
59   /* characters use colors 0xc0-0xcf */
60   for (i = 0; i < 0x100; i++)
61   {
62      UINT8 ctabentry = color_prom[i] | 0xc0;
63      colortable_entry_set_value(machine->colortable, i, ctabentry);
64   }
7765
78   /* 32x32 tiles use colors 0-15 */
79   for (i = 0;i < TOTAL_COLORS(1);i++)
80      COLOR(1,i) = (*color_prom++);
66   /* 32x32 tiles use colors 0-0x0f */
67   for (i = 0x100; i < 0x200; i++)
68   {
69      UINT8 ctabentry = color_prom[i];
70      colortable_entry_set_value(machine->colortable, i, ctabentry);
71   }
8172
82   /* 16x16 tiles use colors 64-79 */
83   for (i = 0;i < TOTAL_COLORS(2);i++)
84      COLOR(2,i) = (*color_prom++) + 64;
73   /* 16x16 tiles use colors 0x40-0x4f */
74   for (i = 0x200; i < 0x300; i++)
75   {
76      UINT8 ctabentry = color_prom[i] | 0x40;
77      colortable_entry_set_value(machine->colortable, i, ctabentry);
78   }
8579
86   /* sprites use colors 128-191 in four banks */
87   for (i = 0;i < TOTAL_COLORS(3);i++)
80   /* sprites use colors 0x80-0xbf in four banks */
81   for (i = 0x300; i < 0x400; i++)
8882   {
89      COLOR(3,i) = color_prom[0] + 128 + 16 * color_prom[256];
90      color_prom++;
83      UINT8 ctabentry = color_prom[i] | (color_prom[i + 0x100] << 4) | 0x80;
84      colortable_entry_set_value(machine->colortable, i, ctabentry);
9185   }
9286}
9387
r1679r1680
157151   int code = videoram[tile_index] + 2 * (colorram[tile_index] & 0x80);
158152   int color = colorram[tile_index] & 0x3f;
159153
154   tileinfo->group = color;
155
160156   SET_TILE_INFO(0, code, color, 0);
161157}
162158
r1679r1680
175171VIDEO_START( exedexes )
176172{
177173   bg_tilemap = tilemap_create(get_bg_tile_info, exedexes_bg_tilemap_scan,
178      TILEMAP_TYPE_PEN, 32, 32, 64, 64);
174      32, 32, 64, 64);
179175
180176   fg_tilemap = tilemap_create(get_fg_tile_info, exedexes_fg_tilemap_scan,
181      TILEMAP_TYPE_PEN, 16, 16, 128, 128);
177      16, 16, 128, 128);
182178
183179   tx_tilemap = tilemap_create(get_tx_tile_info, tilemap_scan_rows,
184      TILEMAP_TYPE_COLORTABLE, 8, 8, 32, 32);
180      8, 8, 32, 32);
185181
186182   tilemap_set_transparent_pen(fg_tilemap, 0);
187   tilemap_set_transparent_pen(tx_tilemap, 207);
183   colortable_configure_tilemap_groups(machine->colortable, tx_tilemap, machine->gfx[0], 0xcf);
188184}
189185
190186static void draw_sprites(running_machine *machine, mame_bitmap *bitmap, const rectangle *cliprect, int priority)
r1679r1680
242238   draw_sprites(machine, bitmap, cliprect, 0);
243239
244240   if (chon)
245   {
246241      tilemap_draw(bitmap, cliprect, tx_tilemap, 0, 0);
247   }
242
248243   return 0;
249244}
250245
src/mame/video/suprnova.c
r1679r1680
756756
757757VIDEO_START(skns)
758758{
759   skns_tilemap_A = tilemap_create(get_tilemap_A_tile_info,tilemap_scan_rows,TILEMAP_TYPE_PEN,16,16,64, 64);
759   skns_tilemap_A = tilemap_create(get_tilemap_A_tile_info,tilemap_scan_rows,16,16,64, 64);
760760      tilemap_set_transparent_pen(skns_tilemap_A,0);
761761
762   skns_tilemap_B = tilemap_create(get_tilemap_B_tile_info,tilemap_scan_rows,TILEMAP_TYPE_PEN,16,16,64, 64);
762   skns_tilemap_B = tilemap_create(get_tilemap_B_tile_info,tilemap_scan_rows,16,16,64, 64);
763763      tilemap_set_transparent_pen(skns_tilemap_B,0);
764764
765765   machine->gfx[2]->color_granularity=256;
src/mame/video/flkatck.c
r1679r1680
7272
7373VIDEO_START( flkatck )
7474{
75   k007121_tilemap[0] = tilemap_create(get_tile_info_A,tilemap_scan_rows,TILEMAP_TYPE_PEN,8,8,32,32);
76   k007121_tilemap[1] = tilemap_create(get_tile_info_B,tilemap_scan_rows,TILEMAP_TYPE_PEN,8,8,32,32);
75   k007121_tilemap[0] = tilemap_create(get_tile_info_A,tilemap_scan_rows,8,8,32,32);
76   k007121_tilemap[1] = tilemap_create(get_tile_info_B,tilemap_scan_rows,8,8,32,32);
7777
7878}
7979
src/mame/video/shootout.c
r1679r1680
7272}
7373
7474VIDEO_START( shootout ){
75   background = tilemap_create(get_bg_tile_info,tilemap_scan_rows,TILEMAP_TYPE_PEN,8,8,32,32);
76   foreground = tilemap_create(get_fg_tile_info,tilemap_scan_rows,TILEMAP_TYPE_PEN,8,8,32,32);
75   background = tilemap_create(get_bg_tile_info,tilemap_scan_rows,8,8,32,32);
76   foreground = tilemap_create(get_fg_tile_info,tilemap_scan_rows,8,8,32,32);
7777      tilemap_set_transparent_pen( foreground, 0 );
7878}
7979
src/mame/video/contra.c
r1679r1680
158158
159159VIDEO_START( contra )
160160{
161   bg_tilemap = tilemap_create(get_bg_tile_info,tilemap_scan_rows,TILEMAP_TYPE_PEN,     8,8,32,32);
162   fg_tilemap = tilemap_create(get_fg_tile_info,tilemap_scan_rows,TILEMAP_TYPE_PEN,8,8,32,32);
163   tx_tilemap = tilemap_create(get_tx_tile_info,tilemap_scan_rows,TILEMAP_TYPE_PEN,     8,8,32,32);
161   bg_tilemap = tilemap_create(get_bg_tile_info,tilemap_scan_rows,     8,8,32,32);
162   fg_tilemap = tilemap_create(get_fg_tile_info,tilemap_scan_rows,8,8,32,32);
163   tx_tilemap = tilemap_create(get_tx_tile_info,tilemap_scan_rows,     8,8,32,32);
164164
165165   private_spriteram = auto_malloc(0x800);
166166   private_spriteram_2 = auto_malloc(0x800);
src/mame/video/paradise.c
r1679r1680
156156VIDEO_START( paradise )
157157{
158158   tilemap_0 = tilemap_create(   get_tile_info_0, tilemap_scan_rows,
159                        TILEMAP_TYPE_PEN, 8,8, 0x20,0x20 );
159                        8,8, 0x20,0x20 );
160160
161161   tilemap_1 = tilemap_create(   get_tile_info_1, tilemap_scan_rows,
162                        TILEMAP_TYPE_PEN, 8,8, 0x20,0x20 );
162                        8,8, 0x20,0x20 );
163163
164164   tilemap_2 = tilemap_create(   get_tile_info_2, tilemap_scan_rows,
165                        TILEMAP_TYPE_PEN, 8,8, 0x20,0x20 );
165                        8,8, 0x20,0x20 );
166166
167167   /* pixmap */
168168   tmpbitmap = auto_bitmap_alloc(machine->screen[0].width,machine->screen[0].height,machine->screen[0].format);
src/mame/video/itech32.c
r1679r1680
479479static TIMER_CALLBACK( scanline_interrupt )
480480{
481481   /* set timer for next frame */
482   timer_adjust(scanline_timer, video_screen_get_time_until_pos(0, VIDEO_INTSCANLINE, 0), 0, attotime_zero);
482   timer_adjust_oneshot(scanline_timer, video_screen_get_time_until_pos(0, VIDEO_INTSCANLINE, 0), 0);
483483
484484   /* set the interrupt bit in the status reg */
485485   logerror("-------------- (DISPLAY INT @ %d) ----------------\n", video_screen_get_vpos(0));
r1679r1680
13471347         break;
13481348
13491349      case 0x2c/2:   /* VIDEO_INTSCANLINE */
1350         timer_adjust(scanline_timer, video_screen_get_time_until_pos(0, VIDEO_INTSCANLINE, 0), 0, attotime_zero);
1350         timer_adjust_oneshot(scanline_timer, video_screen_get_time_until_pos(0, VIDEO_INTSCANLINE, 0), 0);
13511351         break;
13521352
13531353      case 0x32/2:   /* VIDEO_VTOTAL */
src/mame/video/chaknpop.c
r1679r1680
176176   UINT8 *RAM = memory_region(REGION_CPU1);
177177
178178   /*                          info                       offset             type             w   h  col row */
179   tx_tilemap = tilemap_create(chaknpop_get_tx_tile_info, tilemap_scan_rows, TILEMAP_TYPE_PEN,  8,  8, 32, 32);
179   tx_tilemap = tilemap_create(chaknpop_get_tx_tile_info, tilemap_scan_rows,   8,  8, 32, 32);
180180
181181   vram1 = &RAM[0x10000];
182182   vram2 = &RAM[0x12000];
src/mame/video/fitfight.c
r1679r1680
103103
104104VIDEO_START(fitfight)
105105{
106   fof_bak_tilemap = tilemap_create(get_fof_bak_tile_info,tilemap_scan_cols,TILEMAP_TYPE_PEN,8,8,128, 32);
106   fof_bak_tilemap = tilemap_create(get_fof_bak_tile_info,tilemap_scan_cols,8,8,128, 32);
107107   /* opaque */
108108
109   fof_mid_tilemap = tilemap_create(get_fof_mid_tile_info,tilemap_scan_cols,TILEMAP_TYPE_PEN,8,8,128, 32);
109   fof_mid_tilemap = tilemap_create(get_fof_mid_tile_info,tilemap_scan_cols,8,8,128, 32);
110110   tilemap_set_transparent_pen(fof_mid_tilemap,0);
111111
112   fof_txt_tilemap = tilemap_create(get_fof_txt_tile_info,tilemap_scan_cols,TILEMAP_TYPE_PEN,8,8,128, 32);
112   fof_txt_tilemap = tilemap_create(get_fof_txt_tile_info,tilemap_scan_cols,8,8,128, 32);
113113   tilemap_set_transparent_pen(fof_txt_tilemap,0);
114114}
115115
src/mame/video/ashnojoe.c
r1679r1680
185185
186186VIDEO_START( ashnojoe )
187187{
188   joetilemap  =  tilemap_create(get_joe_tile_info,  tilemap_scan_rows,TILEMAP_TYPE_PEN, 8, 8,64,32);
189   joetilemap2 =  tilemap_create(get_joe_tile_info_2,tilemap_scan_rows,TILEMAP_TYPE_PEN,16,16,32,32);
190   joetilemap3 =  tilemap_create(get_joe_tile_info_3,tilemap_scan_rows,TILEMAP_TYPE_PEN, 8, 8,64,64);
191   joetilemap4 =  tilemap_create(get_joe_tile_info_4,tilemap_scan_rows,TILEMAP_TYPE_PEN, 8, 8,64,64);
192   joetilemap5 =  tilemap_create(get_joe_tile_info_5,tilemap_scan_rows,TILEMAP_TYPE_PEN,16,16,32,32);
193   joetilemap6 =  tilemap_create(get_joe_tile_info_6,tilemap_scan_rows,TILEMAP_TYPE_PEN,      16,16,32,32);
194   joetilemap7 =  tilemap_create(get_joe_tile_info_7,tilemap_scan_rows,TILEMAP_TYPE_PEN,      16,16,32,32);
188   joetilemap  =  tilemap_create(get_joe_tile_info,  tilemap_scan_rows, 8, 8,64,32);
189   joetilemap2 =  tilemap_create(get_joe_tile_info_2,tilemap_scan_rows,16,16,32,32);
190   joetilemap3 =  tilemap_create(get_joe_tile_info_3,tilemap_scan_rows, 8, 8,64,64);
191   joetilemap4 =  tilemap_create(get_joe_tile_info_4,tilemap_scan_rows, 8, 8,64,64);
192   joetilemap5 =  tilemap_create(get_joe_tile_info_5,tilemap_scan_rows,16,16,32,32);
193   joetilemap6 =  tilemap_create(get_joe_tile_info_6,tilemap_scan_rows,      16,16,32,32);
194   joetilemap7 =  tilemap_create(get_joe_tile_info_7,tilemap_scan_rows,      16,16,32,32);
195195
196196   tilemap_set_transparent_pen(joetilemap, 15);
197197   tilemap_set_transparent_pen(joetilemap2,15);
src/mame/video/terracre.c
r1679r1680
199199
200200VIDEO_START( amazon )
201201{
202   background = tilemap_create(get_bg_tile_info,tilemap_scan_cols,TILEMAP_TYPE_PEN,16,16,64,32);
203   foreground = tilemap_create(get_fg_tile_info,tilemap_scan_cols,TILEMAP_TYPE_PEN,8,8,64,32);
202   background = tilemap_create(get_bg_tile_info,tilemap_scan_cols,16,16,64,32);
203   foreground = tilemap_create(get_fg_tile_info,tilemap_scan_cols,8,8,64,32);
204204      tilemap_set_transparent_pen(foreground,0xf);
205205
206206   /* register for saving */
src/mame/video/malzak.c
r1679r1680
4141UINT8* saa5050_vidram;  /* Video RAM for SAA 5050 */
4242
4343static mame_bitmap* collision_bitmap;
44static s2636_t *s2636_0, *s2636_1;
45UINT8 *malzak_s2636_0_ram;
46UINT8 *malzak_s2636_1_ram;
4447
4548int malzak_x;
4649int malzak_y;
r1679r1680
5760   collision_bitmap = auto_bitmap_alloc(machine->screen[0].width,machine->screen[0].height,BITMAP_FORMAT_INDEXED8);
5861
5962   saa5050_vidram = auto_malloc(0x800);
63
64   /* configure the S2636 chips */
65//  s2636_0 = s2636_config(malzak_s2636_0_ram, machine->screen[0].height, machine->screen[0].width, -8, -16);
66//  s2636_1 = s2636_config(malzak_s2636_1_ram, machine->screen[0].height, machine->screen[0].width, -9, -16);
67   s2636_0 = s2636_config(malzak_s2636_0_ram, machine->screen[0].height, machine->screen[0].width, 0, -16);
68   s2636_1 = s2636_config(malzak_s2636_1_ram, machine->screen[0].height, machine->screen[0].width, 0, -16);
6069}
6170
6271VIDEO_UPDATE( malzak )
r1679r1680
6473   int code, colour;
6574   int sx, sy;
6675   int x,y;
76   mame_bitmap *s2636_0_bitmap;
77   mame_bitmap *s2636_1_bitmap;
6778
6879   fillbitmap(bitmap,0,0);
6980
r1679r1680
169180         {
170181            if (saa5050_state.saa5050_flags & SAA5050_DBLHI)
171182            {
172               drawgfx (bitmap, machine->gfx[4], code, colour, 0, 0,
183               drawgfx (bitmap, machine->gfx[2], code, colour, 0, 0,
173184                  sx * 6, sy * 10, &machine->screen[0].visarea, TRANSPARENCY_NONE, 0);
174               drawgfx (bitmap, machine->gfx[5], code, colour, 0, 0,
185               drawgfx (bitmap, machine->gfx[3], code, colour, 0, 0,
175186                  sx * 6, (sy + 1) * 10, &machine->screen[0].visarea, TRANSPARENCY_NONE, 0);
176187            }
177188            else
178189            {
179               drawgfx (bitmap, machine->gfx[3], code, colour, 0, 0,
190               drawgfx (bitmap, machine->gfx[1], code, colour, 0, 0,
180191                  sx * 6, sy * 10, &machine->screen[0].visarea, TRANSPARENCY_NONE, 0);
181192            }
182193         }
r1679r1680
208219            sx, sy, &machine->screen[0].visarea, TRANSPARENCY_PEN, 0);
209220      }
210221
211   // S2636 - Sprites / Collision detection (x2)
222    /* update the S2636 chips */
223   s2636_0_bitmap = s2636_update(s2636_0, cliprect);
224   s2636_1_bitmap = s2636_update(s2636_1, cliprect);
212225
213   s2636_x_offset = -16;
214//  s2636_y_offset = -8;
226   /* copy the S2636 images into the main bitmap */
227   {
228      int y;
215229
216   s2636_update_bitmap(machine,bitmap,s2636_1_ram,1,collision_bitmap);
217   s2636_update_bitmap(machine,bitmap,s2636_2_ram,2,collision_bitmap);
230      for (y = cliprect->min_y; y <= cliprect->max_y; y++)
231      {
232         int x;
233
234         for (x = cliprect->min_x; x <= cliprect->max_x; x++)
235         {
236            int pixel0 = *BITMAP_ADDR8(s2636_0_bitmap, y, x);
237            int pixel1 = *BITMAP_ADDR8(s2636_1_bitmap, y, x);
238
239            if (S2636_IS_PIXEL_DRAWN(pixel0))
240               *BITMAP_ADDR16(bitmap, y, x) = machine->pens[S2636_PIXEL_COLOR(pixel0)];
241
242            if (S2636_IS_PIXEL_DRAWN(pixel1))
243               *BITMAP_ADDR16(bitmap, y, x) = machine->pens[S2636_PIXEL_COLOR(pixel1)];
244         }
245      }
246   }
247
218248   return 0;
219249}
220250
src/mame/video/deco32.c
r1679r1680
490490   {
491491      if( gfx )
492492      {
493         const pen_t *pal = &Machine->remapped_colortable[gfx->color_base + gfx->color_granularity * (color % gfx->total_colors)];
493         const pen_t *pal = &Machine->pens[gfx->color_base + gfx->color_granularity * (color % gfx->total_colors)];
494494         int source_base = (code % gfx->total_elements) * gfx->height;
495495
496496         if (sprite_screen_width && sprite_screen_height)
r1679r1680
949949
950950VIDEO_START( captaven )
951951{
952   pf1_tilemap = tilemap_create(get_pf1_tile_info,    tilemap_scan_rows,TILEMAP_TYPE_PEN, 8, 8,64,32);
953   pf1a_tilemap =tilemap_create(get_pf1a_tile_info,   deco16_scan_rows,TILEMAP_TYPE_PEN,16,16,64,32);
954   pf2_tilemap = tilemap_create(get_pf2_tile_info,    deco16_scan_rows,TILEMAP_TYPE_PEN,16,16,64,32);
955   pf3_tilemap = tilemap_create(get_ca_pf3_tile_info, tilemap_scan_rows,TILEMAP_TYPE_PEN,16,16,32,32);
952   pf1_tilemap = tilemap_create(get_pf1_tile_info,    tilemap_scan_rows, 8, 8,64,32);
953   pf1a_tilemap =tilemap_create(get_pf1a_tile_info,   deco16_scan_rows,16,16,64,32);
954   pf2_tilemap = tilemap_create(get_pf2_tile_info,    deco16_scan_rows,16,16,64,32);
955   pf3_tilemap = tilemap_create(get_ca_pf3_tile_info, tilemap_scan_rows,16,16,32,32);
956956   deco32_raster_display_list=auto_malloc(10 * 256);
957957   memset(deco32_raster_display_list, 0, 10 * 256);
958958
r1679r1680
968968
969969VIDEO_START( fghthist )
970970{
971   pf1_tilemap = tilemap_create(get_pf1_tile_info, tilemap_scan_rows,TILEMAP_TYPE_PEN, 8, 8,64,32);
972   pf2_tilemap = tilemap_create(get_pf2_tile_info, deco16_scan_rows,TILEMAP_TYPE_PEN,16,16,64,32);
973   pf3_tilemap = tilemap_create(get_pf3_tile_info, deco16_scan_rows,TILEMAP_TYPE_PEN,16,16,64,32);
974   pf4_tilemap = tilemap_create(get_pf4_tile_info, deco16_scan_rows,TILEMAP_TYPE_PEN,     16,16,64,32);
971   pf1_tilemap = tilemap_create(get_pf1_tile_info, tilemap_scan_rows, 8, 8,64,32);
972   pf2_tilemap = tilemap_create(get_pf2_tile_info, deco16_scan_rows,16,16,64,32);
973   pf3_tilemap = tilemap_create(get_pf3_tile_info, deco16_scan_rows,16,16,64,32);
974   pf4_tilemap = tilemap_create(get_pf4_tile_info, deco16_scan_rows,     16,16,64,32);
975975   pf1a_tilemap =0;
976976   dirty_palette = auto_malloc(4096);
977977
r1679r1680
988988
989989VIDEO_START( dragngun )
990990{
991   pf1_tilemap = tilemap_create(get_pf1_tile_info,    tilemap_scan_rows,TILEMAP_TYPE_PEN, 8, 8,64,32);
992   pf2_tilemap = tilemap_create(get_pf2_tile_info,    deco16_scan_rows,TILEMAP_TYPE_PEN,16,16,64,32);
993   pf3_tilemap = tilemap_create(get_ll_pf3_tile_info, deco16_scan_rows,TILEMAP_TYPE_PEN,16,16,64,32);
994   pf4_tilemap = tilemap_create(get_ll_pf4_tile_info, deco16_scan_rows,TILEMAP_TYPE_PEN,     16,16,64,32);
995   pf1a_tilemap =tilemap_create(get_pf1a_tile_info,   deco16_scan_rows,TILEMAP_TYPE_PEN,16,16,64,32);
991   pf1_tilemap = tilemap_create(get_pf1_tile_info,    tilemap_scan_rows, 8, 8,64,32);
992   pf2_tilemap = tilemap_create(get_pf2_tile_info,    deco16_scan_rows,16,16,64,32);
993   pf3_tilemap = tilemap_create(get_ll_pf3_tile_info, deco16_scan_rows,16,16,64,32);
994   pf4_tilemap = tilemap_create(get_ll_pf4_tile_info, deco16_scan_rows,     16,16,64,32);
995   pf1a_tilemap =tilemap_create(get_pf1a_tile_info,   deco16_scan_rows,16,16,64,32);
996996   dirty_palette = auto_malloc(4096);
997997   deco32_raster_display_list = auto_malloc(10 * 256);
998998
r1679r1680
10111011
10121012VIDEO_START( lockload )
10131013{
1014   pf1_tilemap = tilemap_create(get_pf1_tile_info,    tilemap_scan_rows,TILEMAP_TYPE_PEN, 8, 8,64,32);
1015   pf2_tilemap = tilemap_create(get_pf2_tile_info,    deco16_scan_rows,TILEMAP_TYPE_PEN,16,16,64,32);
1016   pf3_tilemap = tilemap_create(get_ll_pf3_tile_info, deco16_scan_rows,TILEMAP_TYPE_PEN,16,16,32,32);
1017   pf4_tilemap = tilemap_create(get_ll_pf4_tile_info, deco16_scan_rows,TILEMAP_TYPE_PEN,     16,16,32,32);
1018   pf1a_tilemap =tilemap_create(get_pf1a_tile_info,   deco16_scan_rows,TILEMAP_TYPE_PEN,16,16,64,32);
1014   pf1_tilemap = tilemap_create(get_pf1_tile_info,    tilemap_scan_rows, 8, 8,64,32);
1015   pf2_tilemap = tilemap_create(get_pf2_tile_info,    deco16_scan_rows,16,16,64,32);
1016   pf3_tilemap = tilemap_create(get_ll_pf3_tile_info, deco16_scan_rows,16,16,32,32);
1017   pf4_tilemap = tilemap_create(get_ll_pf4_tile_info, deco16_scan_rows,     16,16,32,32);
1018   pf1a_tilemap =tilemap_create(get_pf1a_tile_info,   deco16_scan_rows,16,16,64,32);
10191019   dirty_palette = auto_malloc(4096);
10201020   deco32_raster_display_list = auto_malloc(10 * 256);
10211021   memset(deco32_raster_display_list, 0, 10 * 256);
r1679r1680
10351035
10361036VIDEO_START( nslasher )
10371037{
1038   pf1_tilemap = tilemap_create(get_pf1_tile_info, tilemap_scan_rows,TILEMAP_TYPE_PEN, 8, 8,64,32);
1039   pf2_tilemap = tilemap_create(get_pf2_tile_info, deco16_scan_rows,TILEMAP_TYPE_PEN,16,16,64,32);
1040   pf3_tilemap = tilemap_create(get_pf3_tile_info, deco16_scan_rows,TILEMAP_TYPE_PEN,16,16,64,32);
1041   pf4_tilemap = tilemap_create(get_pf4_tile_info, deco16_scan_rows,TILEMAP_TYPE_PEN,     16,16,64,32);
1038   pf1_tilemap = tilemap_create(get_pf1_tile_info, tilemap_scan_rows, 8, 8,64,32);
1039   pf2_tilemap = tilemap_create(get_pf2_tile_info, deco16_scan_rows,16,16,64,32);
1040   pf3_tilemap = tilemap_create(get_pf3_tile_info, deco16_scan_rows,16,16,64,32);
1041   pf4_tilemap = tilemap_create(get_pf4_tile_info, deco16_scan_rows,     16,16,64,32);
10421042   pf1a_tilemap =0;
10431043   dirty_palette = auto_malloc(4096);
10441044
r1679r1680
14141414*/
14151415static void mixDualAlphaSprites(running_machine* machine, mame_bitmap *bitmap, const rectangle *cliprect, const gfx_element *gfx0, const gfx_element *gfx1, int mixAlphaTilemap)
14161416{
1417   const pen_t *pal0 = &machine->remapped_colortable[gfx0->color_base];
1418   const pen_t *pal1 = &machine->remapped_colortable[gfx1->color_base];
1419   const pen_t *pal2 = &machine->remapped_colortable[(deco32_pri&1) ? machine->gfx[1]->color_base : machine->gfx[2]->color_base];
1417   const pen_t *pal0 = &machine->pens[gfx0->color_base];
1418   const pen_t *pal1 = &machine->pens[gfx1->color_base];
1419   const pen_t *pal2 = &machine->pens[(deco32_pri&1) ? machine->gfx[1]->color_base : machine->gfx[2]->color_base];
14201420   int x,y;
14211421
14221422   /* Mix sprites into main bitmap, based on priority & alpha */
src/mame/video/argus.c
r1679r1680
307307{
308308   lowbitscroll = 0;
309309   /*                           info                      offset             type                  w   h  col  row */
310   bg0_tilemap = tilemap_create(argus_get_bg0_tile_info,  tilemap_scan_cols, TILEMAP_TYPE_PEN,      16, 16, 32, 32);
311   bg1_tilemap = tilemap_create(argus_get_bg1_tile_info,  tilemap_scan_cols, TILEMAP_TYPE_PEN, 16, 16, 32, 32);
312   tx_tilemap  = tilemap_create(argus_get_tx_tile_info,   tilemap_scan_cols, TILEMAP_TYPE_PEN,  8,  8, 32, 32);
310   bg0_tilemap = tilemap_create(argus_get_bg0_tile_info,  tilemap_scan_cols,       16, 16, 32, 32);
311   bg1_tilemap = tilemap_create(argus_get_bg1_tile_info,  tilemap_scan_cols,  16, 16, 32, 32);
312   tx_tilemap  = tilemap_create(argus_get_tx_tile_info,   tilemap_scan_cols,   8,  8, 32, 32);
313313
314314   /* dummy RAM for back ground */
315315   argus_dummy_bg0ram = auto_malloc( 0x800 );
r1679r1680
328328VIDEO_START( valtric )
329329{
330330   /*                           info                       offset             type                 w   h  col  row */
331   bg1_tilemap = tilemap_create(valtric_get_bg_tile_info,  tilemap_scan_cols, TILEMAP_TYPE_PEN,      16, 16, 32, 32);
332   tx_tilemap  = tilemap_create(valtric_get_tx_tile_info,  tilemap_scan_cols, TILEMAP_TYPE_PEN,  8,  8, 32, 32);
331   bg1_tilemap = tilemap_create(valtric_get_bg_tile_info,  tilemap_scan_cols,       16, 16, 32, 32);
332   tx_tilemap  = tilemap_create(valtric_get_tx_tile_info,  tilemap_scan_cols,   8,  8, 32, 32);
333333
334334   tilemap_set_transparent_pen( bg1_tilemap, 15 );
335335   tilemap_set_transparent_pen( tx_tilemap,  15 );
r1679r1680
341341VIDEO_START( butasan )
342342{
343343   /*                           info                       offset             type                 w   h  col  row */
344   bg0_tilemap = tilemap_create(butasan_get_bg0_tile_info, tilemap_scan_rows, TILEMAP_TYPE_PEN,      16, 16, 32, 32);
345   bg1_tilemap = tilemap_create(butasan_get_bg1_tile_info, tilemap_scan_rows, TILEMAP_TYPE_PEN,      16, 16, 32, 32);
346   tx_tilemap  = tilemap_create(butasan_get_tx_tile_info,  tilemap_scan_rows, TILEMAP_TYPE_PEN,  8,  8, 32, 32);
344   bg0_tilemap = tilemap_create(butasan_get_bg0_tile_info, tilemap_scan_rows,       16, 16, 32, 32);
345   bg1_tilemap = tilemap_create(butasan_get_bg1_tile_info, tilemap_scan_rows,       16, 16, 32, 32);
346   tx_tilemap  = tilemap_create(butasan_get_tx_tile_info,  tilemap_scan_rows,   8,  8, 32, 32);
347347
348348   butasan_txram = auto_malloc( BUTASAN_TEXT_RAMSIZE );
349349   butasan_bg0ram = auto_malloc( BUTASAN_BG0_RAMSIZE );
r1679r1680
396396VIDEO_START( bombsa )
397397{
398398   /*                           info                       offset             type                 w   h  col  row */
399//  bg1_tilemap = tilemap_create(valtric_get_bg_tile_info,  tilemap_scan_cols, TILEMAP_TYPE_PEN,      16, 16, 32, 32);
400   tx_tilemap  = tilemap_create(valtric_get_tx_tile_info,  tilemap_scan_cols, TILEMAP_TYPE_PEN,  8,  8, 32, 32);
399//  bg1_tilemap = tilemap_create(valtric_get_bg_tile_info,  tilemap_scan_cols,       16, 16, 32, 32);
400   tx_tilemap  = tilemap_create(valtric_get_tx_tile_info,  tilemap_scan_cols,   8,  8, 32, 32);
401401
402402#if 0
403403   /* this might be wrong.. but it looks like there may be a tilemap here that can change between 8x8 and 16x16 mode.. */
404404   /* when you start the game it gets 'corrupted' with data for another layer.. */
405   tx_alt_tilemap  = tilemap_create(bombsa_get_tx_alt_tile_info,  tilemap_scan_cols, TILEMAP_TYPE_PEN,  8,  8, 32, 32);
405   tx_alt_tilemap  = tilemap_create(bombsa_get_tx_alt_tile_info,  tilemap_scan_cols,   8,  8, 32, 32);
406406#endif
407407
408   bombsa_bg_tilemap  = tilemap_create(bombsa_get_bg_tile_info,  tilemap_scan_cols, TILEMAP_TYPE_PEN,  16,  16, 64, 32);
408   bombsa_bg_tilemap  = tilemap_create(bombsa_get_bg_tile_info,  tilemap_scan_cols,   16,  16, 64, 32);
409409
410410#if 0
411411   bombsa_tx_alt_ram = auto_malloc(0x800);
src/mame/video/grchamp.c
r1679r1680
111111   state->work_bitmap = auto_bitmap_alloc(32,32,machine->screen[0].format);
112112
113113   /* allocate tilemaps for each of the three sections */
114   state->text_tilemap = tilemap_create(get_text_tile_info, tilemap_scan_rows, TILEMAP_TYPE_PEN, 8,8, 32,32);
115   state->left_tilemap = tilemap_create(get_left_tile_info, get_memory_offset, TILEMAP_TYPE_PEN, 8,8, 64,32);
116   state->right_tilemap = tilemap_create(get_right_tile_info, get_memory_offset, TILEMAP_TYPE_PEN, 8,8, 64,32);
117   state->center_tilemap = tilemap_create(get_center_tile_info, get_memory_offset, TILEMAP_TYPE_PEN, 8,8, 64,32);
114   state->text_tilemap = tilemap_create(get_text_tile_info, tilemap_scan_rows,  8,8, 32,32);
115   state->left_tilemap = tilemap_create(get_left_tile_info, get_memory_offset,  8,8, 64,32);
116   state->right_tilemap = tilemap_create(get_right_tile_info, get_memory_offset,  8,8, 64,32);
117   state->center_tilemap = tilemap_create(get_center_tile_info, get_memory_offset,  8,8, 64,32);
118118}
119119
120120#if 0
src/mame/video/lkage.c
r1679r1680
8181{
8282   bg_tile_bank = fg_tile_bank = 0;
8383
84   bg_tilemap = tilemap_create(get_bg_tile_info,tilemap_scan_rows,TILEMAP_TYPE_PEN,     8,8,32,32);
85   fg_tilemap = tilemap_create(get_fg_tile_info,tilemap_scan_rows,TILEMAP_TYPE_PEN,8,8,32,32);
86   tx_tilemap = tilemap_create(get_tx_tile_info,tilemap_scan_rows,TILEMAP_TYPE_PEN,8,8,32,32);
84   bg_tilemap = tilemap_create(get_bg_tile_info,tilemap_scan_rows,     8,8,32,32);
85   fg_tilemap = tilemap_create(get_fg_tile_info,tilemap_scan_rows,8,8,32,32);
86   tx_tilemap = tilemap_create(get_tx_tile_info,tilemap_scan_rows,8,8,32,32);
8787
8888   tilemap_set_transparent_pen(fg_tilemap,0);
8989   tilemap_set_transparent_pen(tx_tilemap,0);
src/mame/video/goodejan.c
r1679r1680
8686
8787VIDEO_START( goodejan )
8888{
89   bg_tilemap = tilemap_create(goodejan_bg_tile_info,tilemap_scan_rows,TILEMAP_TYPE_PEN,     16,16,32,32);
90   tx_tilemap = tilemap_create(goodejan_tx_tile_info,tilemap_scan_rows,TILEMAP_TYPE_PEN, 8, 8,32,32);
89   bg_tilemap = tilemap_create(goodejan_bg_tile_info,tilemap_scan_rows,     16,16,32,32);
90   tx_tilemap = tilemap_create(goodejan_tx_tile_info,tilemap_scan_rows, 8, 8,32,32);
9191   tilemap_set_transparent_pen(tx_tilemap,15);
9292}
9393
src/mame/video/gaiden.c
r1679r1680
7878VIDEO_START( gaiden )
7979{
8080   /* set up tile layers */
81   background = tilemap_create(get_bg_tile_info, tilemap_scan_rows, TILEMAP_TYPE_PEN, 16, 16, 64, 32);
82   foreground = tilemap_create(get_fg_tile_info, tilemap_scan_rows, TILEMAP_TYPE_PEN, 16, 16, 64, 32);
83   text_layer = tilemap_create(get_tx_tile_info, tilemap_scan_rows, TILEMAP_TYPE_PEN,  8,  8, 32, 32);
81   background = tilemap_create(get_bg_tile_info, tilemap_scan_rows,  16, 16, 64, 32);
82   foreground = tilemap_create(get_fg_tile_info, tilemap_scan_rows,  16, 16, 64, 32);
83   text_layer = tilemap_create(get_tx_tile_info, tilemap_scan_rows,   8,  8, 32, 32);
8484
8585   tilemap_set_transparent_pen(background, 0);
8686   tilemap_set_transparent_pen(foreground, 0);
r1679r1680
9393   tile_bitmap_bg = auto_bitmap_alloc(machine->screen[0].width, machine->screen[0].height, BITMAP_FORMAT_INDEXED16);
9494   tile_bitmap_fg = auto_bitmap_alloc(machine->screen[0].width, machine->screen[0].height, BITMAP_FORMAT_INDEXED16);
9595
96   background = tilemap_create(get_bg_tile_info,      tilemap_scan_rows,TILEMAP_TYPE_PEN,16,16,64,32);
97   foreground = tilemap_create(get_fg_tile_info_raiga,tilemap_scan_rows,TILEMAP_TYPE_PEN,16,16,64,32);
98   text_layer = tilemap_create(get_tx_tile_info,      tilemap_scan_rows,TILEMAP_TYPE_PEN, 8, 8,32,32);
96   background = tilemap_create(get_bg_tile_info,      tilemap_scan_rows,16,16,64,32);
97   foreground = tilemap_create(get_fg_tile_info_raiga,tilemap_scan_rows,16,16,64,32);
98   text_layer = tilemap_create(get_tx_tile_info,      tilemap_scan_rows, 8, 8,32,32);
9999
100100   tilemap_set_transparent_pen(background,0);
101101   tilemap_set_transparent_pen(foreground,0);
r1679r1680
108108VIDEO_START( drgnbowl )
109109{
110110   /* set up tile layers */
111   background = tilemap_create(get_bg_tile_info, tilemap_scan_rows, TILEMAP_TYPE_PEN,      16, 16, 64, 32);
112   foreground = tilemap_create(get_fg_tile_info, tilemap_scan_rows, TILEMAP_TYPE_PEN, 16, 16, 64, 32);
113   text_layer = tilemap_create(get_tx_tile_info, tilemap_scan_rows, TILEMAP_TYPE_PEN,  8,  8, 32, 32);
111   background = tilemap_create(get_bg_tile_info, tilemap_scan_rows,       16, 16, 64, 32);
112   foreground = tilemap_create(get_fg_tile_info, tilemap_scan_rows,  16, 16, 64, 32);
113   text_layer = tilemap_create(get_tx_tile_info, tilemap_scan_rows,   8,  8, 32, 32);
114114
115115   tilemap_set_transparent_pen(foreground, 15);
116116   tilemap_set_transparent_pen(text_layer, 15);
src/mame/video/zaxxon.c
r1679r1680
136136   memset(congo_custom, 0, sizeof(congo_custom));
137137
138138   /* create a background and foreground tilemap */
139   bg_tilemap = tilemap_create(get_bg_tile_info, tilemap_scan_rows, TILEMAP_TYPE_PEN, 8,8, 32,512);
140   fg_tilemap = tilemap_create(fg_tile_info, tilemap_scan_rows, TILEMAP_TYPE_PEN, 8,8, 32,32);
139   bg_tilemap = tilemap_create(get_bg_tile_info, tilemap_scan_rows,  8,8, 32,512);
140   fg_tilemap = tilemap_create(fg_tile_info, tilemap_scan_rows,  8,8, 32,32);
141141
142142   /* configure the foreground tilemap */
143143   tilemap_set_transparent_pen(fg_tilemap, 0);
src/mame/video/shangkid.c
r1679r1680
5050
5151VIDEO_START( shangkid )
5252{
53   background = tilemap_create(get_bg_tile_info,tilemap_scan_rows,TILEMAP_TYPE_PEN,8,8,64,32);
53   background = tilemap_create(get_bg_tile_info,tilemap_scan_rows,8,8,64,32);
5454}
5555
5656WRITE8_HANDLER( shangkid_videoram_w )
src/mame/video/trackfld.c
r1679r1680
77***************************************************************************/
88
99#include "driver.h"
10#include "video/resnet.h"
1011
1112UINT8 *trackfld_scroll;
1213UINT8 *trackfld_scroll2;
r1679r1680
3435***************************************************************************/
3536PALETTE_INIT( trackfld )
3637{
38   static const int resistances_rg[3] = { 1000, 470, 220 };
39   static const int resistances_b [2] = { 470, 220 };
40   double rweights[3], gweights[3], bweights[2];
3741   int i;
38   #define TOTAL_COLORS(gfxn) (machine->gfx[gfxn]->total_colors * machine->gfx[gfxn]->color_granularity)
39   #define COLOR(gfxn,offs) (colortable[machine->drv->gfxdecodeinfo[gfxn].color_codes_start + offs])
4042
43   /* compute the color output resistor weights */
44   compute_resistor_weights(0,   255, -1.0,
45         3, &resistances_rg[0], rweights, 1000, 0,
46         3, &resistances_rg[0], gweights, 1000, 0,
47         2, &resistances_b[0],  bweights, 1000, 0);
4148
42   for (i = 0;i < machine->drv->total_colors;i++)
49   /* allocate the colortable */
50   machine->colortable = colortable_alloc(machine, 0x20);
51
52   /* create a lookup table for the palette */
53   for (i = 0; i < 0x20; i++)
4354   {
44      int bit0,bit1,bit2,r,g,b;
55      int bit0, bit1, bit2;
56      int r, g, b;
4557
58      /* red component */
59      bit0 = (color_prom[i] >> 0) & 0x01;
60      bit1 = (color_prom[i] >> 1) & 0x01;
61      bit2 = (color_prom[i] >> 2) & 0x01;
62      r = combine_3_weights(rweights, bit0, bit1, bit2);
4663
47      /* red component */
48      bit0 = (*color_prom >> 0) & 0x01;
49      bit1 = (*color_prom >> 1) & 0x01;
50      bit2 = (*color_prom >> 2) & 0x01;
51      r = 0x21 * bit0 + 0x47 * bit1 + 0x97 * bit2;
5264      /* green component */
53      bit0 = (*color_prom >> 3) & 0x01;
54      bit1 = (*color_prom >> 4) & 0x01;
55      bit2 = (*color_prom >> 5) & 0x01;
56      g = 0x21 * bit0 + 0x47 * bit1 + 0x97 * bit2;
65      bit0 = (color_prom[i] >> 3) & 0x01;
66      bit1 = (color_prom[i] >> 4) & 0x01;
67      bit2 = (color_prom[i] >> 5) & 0x01;
68      g = combine_3_weights(gweights, bit0, bit1, bit2);
69
5770      /* blue component */
58      bit0 = 0;
59      bit1 = (*color_prom >> 6) & 0x01;
60      bit2 = (*color_prom >> 7) & 0x01;
61      b = 0x21 * bit0 + 0x47 * bit1 + 0x97 * bit2;
71      bit0 = (color_prom[i] >> 6) & 0x01;
72      bit1 = (color_prom[i] >> 7) & 0x01;
73      b = combine_2_weights(bweights, bit0, bit1);
6274
63      palette_set_color(machine,i,MAKE_RGB(r,g,b));
64
65      color_prom++;
75      colortable_palette_set_color(machine->colortable, i, MAKE_RGB(r, g, b));
6676   }
6777
6878   /* color_prom now points to the beginning of the lookup table */
79   color_prom += 0x20;
6980
70
7181   /* sprites */
72   for (i = 0;i < TOTAL_COLORS(1);i++)
73      COLOR(1,i) = *(color_prom++) & 0x0f;
82   for (i = 0; i < 0x100; i++)
83   {
84      UINT8 ctabentry = color_prom[i] & 0x0f;
85      colortable_entry_set_value(machine->colortable, i, ctabentry);
86   }
7487
7588   /* characters */
76   for (i = 0;i < TOTAL_COLORS(0);i++)
77      COLOR(0,i) = (*(color_prom++) & 0x0f) + 0x10;
89   for (i = 0x100; i < 0x200; i++)
90   {
91      UINT8 ctabentry = (color_prom[i] & 0x0f) | 0x10;
92      colortable_entry_set_value(machine->colortable, i, ctabentry);
93   }
7894}
7995
8096WRITE8_HANDLER( trackfld_videoram_w )
r1679r1680
161177   if( bg_bank )
162178      code |= 0x400;
163179
164   SET_TILE_INFO(0, code, color, flags);
180   SET_TILE_INFO(1, code, color, flags);
165181}
166182
167183VIDEO_START( trackfld )
168184{
169185   bg_tilemap = tilemap_create(get_bg_tile_info, tilemap_scan_rows,
170      TILEMAP_TYPE_PEN, 8, 8, 64, 32);
186      8, 8, 64, 32);
171187
172188   tilemap_set_scroll_rows(bg_tilemap, 32);
173189}
r1679r1680
196212      /* proving that this is a hardware related "feature" */
197213      sy += 1;
198214
199      drawgfx(bitmap, machine->gfx[1],
215      drawgfx(bitmap, machine->gfx[0],
200216         code + sprite_bank1 + sprite_bank2, color,
201217         flipx, flipy,
202218         sx, sy,
203219         cliprect,
204         TRANSPARENCY_COLOR, 0);
220         TRANSPARENCY_PENS,
221         colortable_get_transpen_mask(machine->colortable, machine->gfx[0], color, 0));
205222
206223      /* redraw with wraparound */
207      drawgfx(bitmap,machine->gfx[1],
224      drawgfx(bitmap,machine->gfx[0],
208225         code + sprite_bank1 + sprite_bank2, color,
209226         flipx, flipy,
210227         sx - 256, sy,
211228         cliprect,
212         TRANSPARENCY_COLOR, 0);
229         TRANSPARENCY_PENS,
230         colortable_get_transpen_mask(machine->colortable, machine->gfx[0], color, 0));
213231   }
214232}
215233
src/mame/video/fastfred.c
r1679r1680
88
99#include "driver.h"
1010#include "deprecat.h"
11#include "video/resnet.h"
1112#include "fastfred.h"
1213
1314extern UINT8 galaxian_stars_on;
r1679r1680
1819UINT8 *fastfred_spriteram;
1920size_t fastfred_spriteram_size;
2021UINT8 *fastfred_attributesram;
22UINT8 *fastfred_background_color;
2123UINT8 *imago_fg_videoram;
2224
2325
r1679r1680
3638static UINT16 charbank;
3739static UINT8 colorbank;
3840int fastfred_hardware_type;
39static const UINT8 *fastfred_color_prom;
4041static tilemap *bg_tilemap, *fg_tilemap, *web_tilemap;
4142
4243/***************************************************************************
r1679r1680
5051
5152***************************************************************************/
5253
53static void set_color(pen_t pen, int i)
54{
55   UINT8 r,g,b;
56   int bit0, bit1, bit2, bit3;
57
58   bit0 = (fastfred_color_prom[i] >> 0) & 0x01;
59   bit1 = (fastfred_color_prom[i] >> 1) & 0x01;
60   bit2 = (fastfred_color_prom[i] >> 2) & 0x01;
61   bit3 = (fastfred_color_prom[i] >> 3) & 0x01;
62   r = 0x0e * bit0 + 0x1f * bit1 + 0x43 * bit2 + 0x8f * bit3;
63   bit0 = (fastfred_color_prom[i + 0x100] >> 0) & 0x01;
64   bit1 = (fastfred_color_prom[i + 0x100] >> 1) & 0x01;
65   bit2 = (fastfred_color_prom[i + 0x100] >> 2) & 0x01;
66   bit3 = (fastfred_color_prom[i + 0x100] >> 3) & 0x01;
67   g = 0x0e * bit0 + 0x1f * bit1 + 0x43 * bit2 + 0x8f * bit3;
68   bit0 = (fastfred_color_prom[i + 0x200] >> 0) & 0x01;
69   bit1 = (fastfred_color_prom[i + 0x200] >> 1) & 0x01;
70   bit2 = (fastfred_color_prom[i + 0x200] >> 2) & 0x01;
71   bit3 = (fastfred_color_prom[i + 0x200] >> 3) & 0x01;
72   b = 0x0e * bit0 + 0x1f * bit1 + 0x43 * bit2 + 0x8f * bit3;
73
74   palette_set_color_rgb(Machine,pen,r,g,b);
75}
76
7754PALETTE_INIT( fastfred )
7855{
79   pen_t i;
80   #define TOTAL_COLORS(gfxn) (machine->gfx[gfxn]->total_colors * machine->gfx[gfxn]->color_granularity)
81   #define COLOR(gfxn,offs) (colortable[machine->drv->gfxdecodeinfo[gfxn].color_codes_start + offs])
56   static const int resistances[4] = { 1000, 470, 220, 100 };
57   double rweights[4], gweights[4], bweights[4];
58   int i;
8259
60   /* compute the color output resistor weights */
61   compute_resistor_weights(0,   255, -1.0,
62         4, resistances, rweights, 470, 0,
63         4, resistances, gweights, 470, 0,
64         4, resistances, bweights, 470, 0);
8365
84   fastfred_color_prom = color_prom;   /* we'll need this later */
66   /* allocate the colortable */
67   machine->colortable = colortable_alloc(machine, 0x100);
8568
86   for (i = 0;i < 256;i++)
69   /* create a lookup table for the palette */
70   for (i = 0; i < 0x100; i++)
8771   {
88      set_color(i, i);
89   }
72      int bit0, bit1, bit2, bit3;
73      int r, g, b;
9074
75      /* red component */
76      bit0 = (color_prom[i + 0x000] >> 0) & 0x01;
77      bit1 = (color_prom[i + 0x000] >> 1) & 0x01;
78      bit2 = (color_prom[i + 0x000] >> 2) & 0x01;
79      bit3 = (color_prom[i + 0x000] >> 3) & 0x01;
80      r = combine_4_weights(rweights, bit0, bit1, bit2, bit3);
9181
92   /* characters and sprites use the same palette */
93   for (i = 0; i < TOTAL_COLORS(0); i++)
94   {
95      pen_t color;
82      /* green component */
83      bit0 = (color_prom[i + 0x100] >> 0) & 0x01;
84      bit1 = (color_prom[i + 0x100] >> 1) & 0x01;
85      bit2 = (color_prom[i + 0x100] >> 2) & 0x01;
86      bit3 = (color_prom[i + 0x100] >> 3) & 0x01;
87      g = combine_4_weights(gweights, bit0, bit1, bit2, bit3);
9688
97      if ((i & 0x07) == 0)
98         color = 0;
99      else
100         color = i;
89      /* blue component */
90      bit0 = (color_prom[i + 0x200] >> 0) & 0x01;
91      bit1 = (color_prom[i + 0x200] >> 1) & 0x01;
92      bit2 = (color_prom[i + 0x200] >> 2) & 0x01;
93      bit3 = (color_prom[i + 0x200] >> 3) & 0x01;
94      b = combine_4_weights(bweights, bit0, bit1, bit2, bit3);
10195
102      COLOR(0,i) = COLOR(1,i) = color;
96      colortable_palette_set_color(machine->colortable, i, MAKE_RGB(r, g, b));
10397   }
98
99   /* characters and sprites use the same palette */
100   for (i = 0; i < 0x100; i++)
101      colortable_entry_set_value(machine->colortable, i, i);
104102}
105103
106104/***************************************************************************
r1679r1680
129127
130128VIDEO_START( fastfred )
131129{
132   bg_tilemap = tilemap_create(get_tile_info,tilemap_scan_rows,TILEMAP_TYPE_PEN,8,8,32,32);
130   bg_tilemap = tilemap_create(get_tile_info,tilemap_scan_rows,8,8,32,32);
133131
132   tilemap_set_transparent_pen(bg_tilemap, 0);
134133   tilemap_set_scroll_cols(bg_tilemap, 32);
135134}
136135
r1679r1680
221220}
222221
223222
224WRITE8_HANDLER( fastfred_background_color_w )
225{
226   set_color(0, data);
227}
228223
229
230224WRITE8_HANDLER( fastfred_flip_screen_x_w )
231225{
232226   if (flip_screen_x != (data & 0x01))
r1679r1680
332326
333327VIDEO_UPDATE( fastfred )
334328{
329   fillbitmap(bitmap, *fastfred_background_color, cliprect);
335330   tilemap_draw(bitmap,cliprect,bg_tilemap,0,0);
336
337331   draw_sprites(machine, bitmap, cliprect);
332
338333   return 0;
339334}
340335
r1679r1680
377372
378373VIDEO_START( imago )
379374{
380   web_tilemap = tilemap_create(imago_get_tile_info_web,tilemap_scan_rows,TILEMAP_TYPE_PEN,     8,8,32,32);
381   bg_tilemap   = tilemap_create(imago_get_tile_info_bg, tilemap_scan_rows,TILEMAP_TYPE_PEN,8,8,32,32);
382   fg_tilemap   = tilemap_create(imago_get_tile_info_fg, tilemap_scan_rows,TILEMAP_TYPE_PEN,8,8,32,32);
375   web_tilemap = tilemap_create(imago_get_tile_info_web,tilemap_scan_rows,     8,8,32,32);
376   bg_tilemap   = tilemap_create(imago_get_tile_info_bg, tilemap_scan_rows,8,8,32,32);
377   fg_tilemap   = tilemap_create(imago_get_tile_info_fg, tilemap_scan_rows,8,8,32,32);
383378
384379   tilemap_set_transparent_pen(bg_tilemap, 0);
385380   tilemap_set_transparent_pen(fg_tilemap, 0);
r1679r1680
396391VIDEO_UPDATE( imago )
397392{
398393   tilemap_draw(bitmap,cliprect,web_tilemap,0,0);
399
400394   galaxian_draw_stars(machine, bitmap);
401
402395   tilemap_draw(bitmap,cliprect,bg_tilemap,0,0);
403
404396   draw_sprites(machine, bitmap, cliprect);
405
406397   tilemap_draw(bitmap,cliprect,fg_tilemap,0,0);
398
407399   return 0;
408400}
src/mame/video/karnov.c
r1679r1680
240240   dirty_f=auto_malloc(0x800);
241241   memset(dirty_f,1,0x800);
242242
243   fix_tilemap=tilemap_create(get_fix_tile_info,tilemap_scan_rows,TILEMAP_TYPE_PEN,8,8,32,32);
243   fix_tilemap=tilemap_create(get_fix_tile_info,tilemap_scan_rows,8,8,32,32);
244244
245245   tilemap_set_transparent_pen(fix_tilemap,0);
246246}
r1679r1680
253253   dirty_f=auto_malloc(0x800);
254254   memset(dirty_f,1,0x800);
255255
256   fix_tilemap=tilemap_create(get_fix_tile_info,tilemap_scan_cols,TILEMAP_TYPE_PEN,8,8,32,32);
256   fix_tilemap=tilemap_create(get_fix_tile_info,tilemap_scan_cols,8,8,32,32);
257257
258258   tilemap_set_transparent_pen(fix_tilemap,0);
259259}
src/mame/video/lwings.c
r1679r1680
9191
9292VIDEO_START( lwings )
9393{
94   fg_tilemap  = tilemap_create(get_fg_tile_info,        tilemap_scan_rows,TILEMAP_TYPE_PEN, 8, 8,32,32);
95   bg1_tilemap = tilemap_create(lwings_get_bg1_tile_info,tilemap_scan_cols,TILEMAP_TYPE_PEN,     16,16,32,32);
94   fg_tilemap  = tilemap_create(get_fg_tile_info,        tilemap_scan_rows, 8, 8,32,32);
95   bg1_tilemap = tilemap_create(lwings_get_bg1_tile_info,tilemap_scan_cols,     16,16,32,32);
9696
9797   tilemap_set_transparent_pen(fg_tilemap,3);
9898}
9999
100100VIDEO_START( trojan )
101101{
102   fg_tilemap  = tilemap_create(get_fg_tile_info,        tilemap_scan_rows,    TILEMAP_TYPE_PEN,8, 8,32,32);
103   bg1_tilemap = tilemap_create(trojan_get_bg1_tile_info,tilemap_scan_cols,    TILEMAP_TYPE_PEN,     16,16,32,32);
104   bg2_tilemap = tilemap_create(get_bg2_tile_info,       get_bg2_memory_offset,TILEMAP_TYPE_PEN,    16,16,32,16);
102   fg_tilemap  = tilemap_create(get_fg_tile_info,        tilemap_scan_rows,    8, 8,32,32);
103   bg1_tilemap = tilemap_create(trojan_get_bg1_tile_info,tilemap_scan_cols,         16,16,32,32);
104   bg2_tilemap = tilemap_create(get_bg2_tile_info,       get_bg2_memory_offset,    16,16,32,16);
105105
106106      tilemap_set_transparent_pen(fg_tilemap,3);
107107      tilemap_set_transmask(bg1_tilemap,0,0xffff,0x0001); /* split type 0 is totally transparent in front half */
src/mame/video/punchout.c
r1679r1680
4545  bit 0 -- 2  kohm resistor -- inverter  -- RED/GREEN/BLUE
4646
4747***************************************************************************/
48static void convert_palette(running_machine *machine,const UINT8 *color_prom)
49{
50   int i;
5148
52
53   for (i = 0;i < 1024;i++)
54   {
55      int bit0,bit1,bit2,bit3,r,g,b;
56
57
58      bit0 = (color_prom[0] >> 0) & 0x01;
59      bit1 = (color_prom[0] >> 1) & 0x01;
60      bit2 = (color_prom[0] >> 2) & 0x01;
61      bit3 = (color_prom[0] >> 3) & 0x01;
62      r = 255 - (0x10 * bit0 + 0x21 * bit1 + 0x46 * bit2 + 0x88 * bit3);
63      bit0 = (color_prom[1024] >> 0) & 0x01;
64      bit1 = (color_prom[1024] >> 1) & 0x01;
65      bit2 = (color_prom[1024] >> 2) & 0x01;
66      bit3 = (color_prom[1024] >> 3) & 0x01;
67      g = 255 - (0x10 * bit0 + 0x21 * bit1 + 0x46 * bit2 + 0x88 * bit3);
68      bit0 = (color_prom[2*1024] >> 0) & 0x01;
69      bit1 = (color_prom[2*1024] >> 1) & 0x01;
70      bit2 = (color_prom[2*1024] >> 2) & 0x01;
71      bit3 = (color_prom[2*1024] >> 3) & 0x01;
72      b = 255 - (0x10 * bit0 + 0x21 * bit1 + 0x46 * bit2 + 0x88 * bit3);
73
74      palette_set_color(machine,i,MAKE_RGB(r,g,b));
75      color_prom++;
76   }
77
78   /* reserve the last color for the transparent pen (none of the game colors has */
79   /* these RGB components) */
80   palette_set_color(machine,1024,MAKE_RGB(240,240,240));
81}
82
83
8449/* these depend on jumpers on the board and change from game to game */
8550static int gfx0inv,gfx1inv,gfx2inv,gfx3inv;
8651
8752PALETTE_INIT( punchout )
8853{
8954   int i;
90   #define TOTAL_COLORS(gfxn) (machine->gfx[gfxn]->total_colors * machine->gfx[gfxn]->color_granularity)
91   #define COLOR(gfxn,offs) (colortable[machine->drv->gfxdecodeinfo[gfxn].color_codes_start + (offs)])
9255
56   for (i = 0; i < 0x800; i++)
57   {
58      int pen;
59      int r, g, b;
9360
94   convert_palette(machine,color_prom);
61      if (i < 0x200)
62         /* top monitor chars */
63         pen = ((i - 0x000) ^ gfx0inv) | 0x000;
64      else if (i < 0x400)
65         /* bottom monitor chars */
66         pen = ((i - 0x200) ^ gfx1inv) | 0x200;
67      else if (i < 0x600)
68         /* big sprite #1 */
69         pen = ((i - 0x400) ^ gfx2inv) | 0x200;
70      else
71         /* big sprite #2*/
72         pen = ((i - 0x600) ^ gfx3inv) | 0x200;
9573
74      r = 255 - pal4bit(color_prom[pen + 0x000]);
75      g = 255 - pal4bit(color_prom[pen + 0x400]);
76      b = 255 - pal4bit(color_prom[pen + 0x800]);
9677
97   /* top monitor chars */
98   for (i = 0;i < TOTAL_COLORS(0);i++)
99      COLOR(0,i ^ gfx0inv) = i;
100
101   /* bottom monitor chars */
102   for (i = 0;i < TOTAL_COLORS(1);i++)
103      COLOR(1,i ^ gfx1inv) = i + 512;
104
105   /* big sprite #1 */
106   for (i = 0;i < TOTAL_COLORS(2);i++)
107   {
108      if (i % 8 == 0) COLOR(2,i ^ gfx2inv) = 1024;   /* transparent */
109      else COLOR(2,i ^ gfx2inv) = i + 512;
78      palette_set_color(machine, i, MAKE_RGB(r, g, b));
11079   }
111
112   /* big sprite #2 */
113   for (i = 0;i < TOTAL_COLORS(3);i++)
114   {
115      if (i % 4 == 0) COLOR(3,i ^ gfx3inv) = 1024;   /* transparent */
116      else COLOR(3,i ^ gfx3inv) = i + 512;
117   }
11880}
11981
82
12083PALETTE_INIT( armwrest )
12184{
12285   int i;
123   #define TOTAL_COLORS(gfxn) (machine->gfx[gfxn]->total_colors * machine->gfx[gfxn]->color_granularity)
124   #define COLOR(gfxn,offs) (colortable[machine->drv->gfxdecodeinfo[gfxn].color_codes_start + (offs)])
12586
87   for (i = 0; i < 0xa00; i++)
88   {
89      int pen;
90      int r, g, b;
12691
127   convert_palette(machine,color_prom);
92      if (i < 0x400)
93         /* top monitor chars */
94         pen = (i - 0x000) | 0x000;
95      else if (i < 0x600)
96         /* bottom monitor chars */
97         pen = (i - 0x400) | 0x200;
98      else if (i < 0x800)
99         /* big sprite #1 */
100         pen = (i - 0x600) | 0x200;
101      else
102         /* big sprite #2*/
103         pen = ((i - 0x800) ^ 0x03) | 0x200;
128104
105      r = 255 - pal4bit(color_prom[pen + 0x000]);
106      g = 255 - pal4bit(color_prom[pen + 0x400]);
107      b = 255 - pal4bit(color_prom[pen + 0x800]);
129108
130   /* top monitor / bottom monitor backround chars */
131   for (i = 0;i < TOTAL_COLORS(0);i++)
132      COLOR(0,i) = i;
133
134   /* bottom monitor foreground chars */
135   for (i = 0;i < TOTAL_COLORS(1);i++)
136      COLOR(1,i) = i + 512;
137
138   /* big sprite #1 */
139   for (i = 0;i < TOTAL_COLORS(2);i++)
140   {
141      if (i % 8 == 7) COLOR(2,i) = 1024;   /* transparent */
142      else COLOR(2,i) = i + 512;
109      palette_set_color(machine, i, MAKE_RGB(r, g, b));
143110   }
144
145   /* big sprite #2 - pen order is inverted */
146   for (i = 0;i < TOTAL_COLORS(3);i++)
147   {
148      if (i % 4 == 3) COLOR(3,i ^ 3) = 1024;   /* transparent */
149      else COLOR(3,i ^ 3) = i + 512;
150   }
151111}
152112
153113
154
155114DRIVER_INIT( punchout )
156115{
157116   gfx0inv = 0x03;
r1679r1680
222181
223182VIDEO_START( punchout )
224183{
225   punchout_topTilemap = tilemap_create(top_get_info, tilemap_scan_rows, TILEMAP_TYPE_PEN, 8,8, 32,32);
226   punchout_botTilemap = tilemap_create(bot_get_info, tilemap_scan_rows, TILEMAP_TYPE_PEN, 8,8, 64,32);
184   punchout_topTilemap = tilemap_create(top_get_info, tilemap_scan_rows,  8,8, 32,32);
185   punchout_botTilemap = tilemap_create(bot_get_info, tilemap_scan_rows,  8,8, 64,32);
227186   tilemap_set_scroll_rows(punchout_botTilemap, 32);
228187
229   spr1tilemap = tilemap_create(bs1_get_info, tilemap_scan_rows, TILEMAP_TYPE_PEN, 8,8, 16,32);
230   spr1alttilemap = tilemap_create(bs1_get_info, tilemap_scan_rows, TILEMAP_TYPE_PEN, 8,8, 16,32);
231   spr2tilemap = tilemap_create(bs2_get_info, tilemap_scan_rows, TILEMAP_TYPE_PEN, 8,8, 16,32);
188   spr1tilemap = tilemap_create(bs1_get_info, tilemap_scan_rows,  8,8, 16,32);
189   spr2tilemap = tilemap_create(bs2_get_info, tilemap_scan_rows,  8,8, 16,32);
232190
233191   fgtilemap = NULL;
192
193   tilemap_set_transparent_pen(spr1tilemap, gfx2inv & 0x07);
194   tilemap_set_transparent_pen(spr2tilemap, gfx3inv & 0x03);
234195}
235196
236197
r1679r1680
276237
277238VIDEO_START( armwrest )
278239{
279   punchout_topTilemap = tilemap_create(armwrest_top_get_info, tilemap_scan_rows, TILEMAP_TYPE_PEN, 8,8, 32,32);
280   punchout_botTilemap = tilemap_create(armwrest_bot_get_info, tilemap_scan_rows, TILEMAP_TYPE_PEN, 8,8, 32,32);
240   punchout_topTilemap = tilemap_create(armwrest_top_get_info, tilemap_scan_rows,  8,8, 32,32);
241   punchout_botTilemap = tilemap_create(armwrest_bot_get_info, tilemap_scan_rows,  8,8, 32,32);
281242
282   spr1tilemap = tilemap_create(bs1_get_info, armwrest_bs1_scan, TILEMAP_TYPE_PEN, 8,8, 32,16);
283   spr1alttilemap = tilemap_create(bs1_get_info, armwrest_bs1alt_scan, TILEMAP_TYPE_PEN, 8,8, 32,16);
284   spr2tilemap = tilemap_create(bs2_get_info, tilemap_scan_rows, TILEMAP_TYPE_PEN, 8,8, 16,32);
243   spr1tilemap = tilemap_create(bs1_get_info, armwrest_bs1_scan,  8,8, 32,16);
244   spr1alttilemap = tilemap_create(bs1_get_info, armwrest_bs1alt_scan,  8,8, 32,16);
245   spr2tilemap = tilemap_create(bs2_get_info, tilemap_scan_rows,  8,8, 16,32);
246   fgtilemap = tilemap_create(armwrest_fg_get_info, tilemap_scan_rows,  8,8, 32,32);
285247
286   fgtilemap = tilemap_create(armwrest_fg_get_info, tilemap_scan_rows, TILEMAP_TYPE_PEN, 8,8, 32,32);
287   tilemap_set_transparent_pen(fgtilemap, 7);
248   tilemap_set_transparent_pen(spr1tilemap, 0x07);
249   tilemap_set_transparent_pen(spr1alttilemap, 0x07);
250   tilemap_set_transparent_pen(spr2tilemap, 0x00);
251   tilemap_set_transparent_pen(fgtilemap, 0x07);
288252}
289253
290254
r1679r1680
351315   zoom = punchout_bigsprite1[0] + 256 * (punchout_bigsprite1[1] & 0x0f);
352316   if (zoom)
353317   {
354      mame_bitmap *sprbitmap = tilemap_get_pixmap(spr1tilemap);
355318      int sx,sy;
356319      UINT32 startx,starty;
357320      int incxx,incyy;
r1679r1680
373336
374337      if (punchout_bigsprite1[6] & 1)   /* flip x */
375338      {
376         startx = (sprbitmap->width << 16) - startx - 1;
339         startx = ((16 * 8) << 16) - startx - 1;
377340         incxx = -incxx;
378341      }
379342
380      copyrozbitmap(bitmap,sprbitmap,
343      tilemap_draw_roz(bitmap,cliprect,spr1tilemap,
381344         startx,starty + 0x200*(2) * zoom,
382345         incxx,0,0,incyy,   /* zoom, no rotation */
383346         0,   /* no wraparound */
384         cliprect,TRANSPARENCY_COLOR,1024,0);
347         0,0);
385348   }
386349}
387350
r1679r1680
393356   zoom = punchout_bigsprite1[0] + 256 * (punchout_bigsprite1[1] & 0x0f);
394357   if (zoom)
395358   {
396      mame_bitmap *sprbitmap;
397359      int sx,sy;
398360      UINT32 startx,starty;
399361      int incxx,incyy;
362      tilemap *_tilemap;
400363
401364      sx = 4096 - (punchout_bigsprite1[2] + 256 * (punchout_bigsprite1[3] & 0x0f));
402365      if (sx > 2048) sx -= 4096;
r1679r1680
413376      startx += 3740 * zoom;   /* adjustment to match the screen shots */
414377      starty -= 178 * zoom;   /* and make the hall of fame picture nice */
415378
416       sprbitmap = tilemap_get_pixmap(spr1tilemap);
417
418379      if (punchout_bigsprite1[6] & 1)   /* flip x */
419380      {
420         sprbitmap = tilemap_get_pixmap(spr1alttilemap); // when you catch the money bag in armwrest it either expects wraparound, or a different layout..
421         startx = (bitmap->width << 16) - startx - 1;
381         _tilemap = spr1alttilemap;
382         startx = ((32 * 8) << 16) - startx - 1;
422383         incxx = -incxx;
423384      }
385      else
386         _tilemap = spr1tilemap;
424387
425      copyrozbitmap(bitmap,sprbitmap,
388
389      tilemap_draw_roz(bitmap,cliprect,_tilemap,
426390         startx,starty + 0x200*(2) * zoom,
427391         incxx,0,0,incyy,   /* zoom, no rotation */
428392         0,   /* no wraparound */
429         cliprect,TRANSPARENCY_COLOR,1024,0);
393         0,0);
430394   }
431395}
432396
433397static void drawbs2(running_machine *machine, mame_bitmap *bitmap, const rectangle *cliprect)
434398{
435   mame_bitmap *sprbitmap = tilemap_get_pixmap(spr2tilemap);
436399   int sx,sy;
400   int incxx;
437401
438402   sx = 512 - (punchout_bigsprite2[0] + 256 * (punchout_bigsprite2[1] & 1));
439403   if (sx > 512-127) sx -= 512;
r1679r1680
442406   sy = -punchout_bigsprite2[2] + 256 * (punchout_bigsprite2[3] & 1);
443407   sy += 3;   /* adjustment to match the screen shots */
444408
445   copybitmap_trans(bitmap,sprbitmap, punchout_bigsprite2[4] & 1, 0, sx, sy, cliprect, machine->pens[1024]);
409   sx = -sx << 16;
410   sy = -sy << 16;
411
412   if (punchout_bigsprite2[4] & 1)   /* flip x */
413   {
414      sx = ((16 * 8) << 16) - sx - 1;
415      incxx = -1;
416   }
417   else
418      incxx = 1;
419
420   tilemap_draw_roz(bitmap,cliprect,spr2tilemap,
421      sx, sy, incxx << 16, 0, 0, 1 << 16,
422      0, 0, 0);
446423}
447424
448425VIDEO_UPDATE( punchout )
src/mame/video/kopunch.c
r1679r1680
9191VIDEO_START( kopunch )
9292{
9393   bg_tilemap = tilemap_create(get_bg_tile_info, tilemap_scan_rows,
94      TILEMAP_TYPE_PEN, 8, 8, 32, 32);
94      8, 8, 32, 32);
9595
9696   fg_tilemap = tilemap_create(get_fg_tile_info, tilemap_scan_rows,
97      TILEMAP_TYPE_PEN, 8, 8, 16, 16);
97      8, 8, 16, 16);
9898
9999   tilemap_set_transparent_pen(fg_tilemap, 0);
100100}
src/mame/video/tecmo.c
r1679r1680
8585{
8686   if (tecmo_video_type == 2)   /* gemini */
8787   {
88      bg_tilemap = tilemap_create(gemini_get_bg_tile_info,tilemap_scan_rows,TILEMAP_TYPE_PEN,16,16,32,16);
89      fg_tilemap = tilemap_create(gemini_get_fg_tile_info,tilemap_scan_rows,TILEMAP_TYPE_PEN,16,16,32,16);
88      bg_tilemap = tilemap_create(gemini_get_bg_tile_info,tilemap_scan_rows,16,16,32,16);
89      fg_tilemap = tilemap_create(gemini_get_fg_tile_info,tilemap_scan_rows,16,16,32,16);
9090   }
9191   else   /* rygar, silkworm */
9292   {
93      bg_tilemap = tilemap_create(get_bg_tile_info,tilemap_scan_rows,TILEMAP_TYPE_PEN,16,16,32,16);
94      fg_tilemap = tilemap_create(get_fg_tile_info,tilemap_scan_rows,TILEMAP_TYPE_PEN,16,16,32,16);
93      bg_tilemap = tilemap_create(get_bg_tile_info,tilemap_scan_rows,16,16,32,16);
94      fg_tilemap = tilemap_create(get_fg_tile_info,tilemap_scan_rows,16,16,32,16);
9595   }
96   tx_tilemap = tilemap_create(get_tx_tile_info,tilemap_scan_rows,TILEMAP_TYPE_PEN, 8, 8,32,32);
96   tx_tilemap = tilemap_create(get_tx_tile_info,tilemap_scan_rows, 8, 8,32,32);
9797
9898   tilemap_set_transparent_pen(bg_tilemap,0);
9999   tilemap_set_transparent_pen(fg_tilemap,0);
src/mame/video/news.c
r1679r1680
5252VIDEO_START( news )
5353{
5454
55   fg_tilemap = tilemap_create(get_fg_tile_info,tilemap_scan_rows,TILEMAP_TYPE_PEN,8,8,32, 32);
55   fg_tilemap = tilemap_create(get_fg_tile_info,tilemap_scan_rows,8,8,32, 32);
5656   tilemap_set_transparent_pen(fg_tilemap,0);
5757
58   bg_tilemap = tilemap_create(get_bg_tile_info,tilemap_scan_rows,TILEMAP_TYPE_PEN,8,8,32, 32);
58   bg_tilemap = tilemap_create(get_bg_tile_info,tilemap_scan_rows,8,8,32, 32);
5959}
6060
6161
src/mame/video/finalizr.c
r1679r1680
1919PALETTE_INIT( finalizr )
2020{
2121   int i;
22   #define TOTAL_COLORS(gfxn) (machine->gfx[gfxn]->total_colors * machine->gfx[gfxn]->color_granularity)
23   #define COLOR(gfxn,offs) (colortable[machine->drv->gfxdecodeinfo[gfxn].color_codes_start + offs])
2422
23   /* allocate the colortable */
24   machine->colortable = colortable_alloc(machine, 0x20);
2525
26   for (i = 0;i < machine->drv->total_colors;i++)
26   /* create a lookup table for the palette */
27   for (i = 0; i < 0x20; i++)
2728   {
28      int bit0,bit1,bit2,bit3,r,g,b;
29      int r = pal4bit(color_prom[i + 0x00] >> 0);
30      int g = pal4bit(color_prom[i + 0x00] >> 4);
31      int b = pal4bit(color_prom[i + 0x20] >> 0);
2932
30
31      /* red component */
32      bit0 = (color_prom[0] >> 0) & 0x01;
33      bit1 = (color_prom[0] >> 1) & 0x01;
34      bit2 = (color_prom[0] >> 2) & 0x01;
35      bit3 = (color_prom[0] >> 3) & 0x01;
36      r = 0x0e * bit0 + 0x1f * bit1 + 0x43 * bit2 + 0x8f * bit3;
37      /* green component */
38      bit0 = (color_prom[0] >> 4) & 0x01;
39      bit1 = (color_prom[0] >> 5) & 0x01;
40      bit2 = (color_prom[0] >> 6) & 0x01;
41      bit3 = (color_prom[0] >> 7) & 0x01;
42      g = 0x0e * bit0 + 0x1f * bit1 + 0x43 * bit2 + 0x8f * bit3;
43      /* blue component */
44      bit0 = (color_prom[machine->drv->total_colors] >> 0) & 0x01;
45      bit1 = (color_prom[machine->drv->total_colors] >> 1) & 0x01;
46      bit2 = (color_prom[machine->drv->total_colors] >> 2) & 0x01;
47      bit3 = (color_prom[machine->drv->total_colors] >> 3) & 0x01;
48      b = 0x0e * bit0 + 0x1f * bit1 + 0x43 * bit2 + 0x8f * bit3;
49
50      palette_set_color(machine,i,MAKE_RGB(r,g,b));
51      color_prom++;
33      colortable_palette_set_color(machine->colortable, i, MAKE_RGB(r, g, b));
5234   }
5335
54   color_prom += machine->drv->total_colors;
55   /* color_prom now points to the beginning of the lookup tables */
36   /* color_prom now points to the beginning of the lookup table */
37   color_prom += 0x40;
5638
57   for (i = 0;i < TOTAL_COLORS(1);i++)
39   for (i = 0; i < 0x100; i++)
5840   {
59      if (*color_prom & 0x0f) COLOR(1,i) = *color_prom & 0x0f;
60      else COLOR(1,i) = 0;
61      color_prom++;
41      UINT8 ctabentry = (color_prom[i] & 0x0f) | 0x10;
42      colortable_entry_set_value(machine->colortable, i, ctabentry);
6243   }
63   for (i = 0;i < TOTAL_COLORS(0);i++)
44
45   for (i = 0x100; i < 0x200; i++)
6446   {
65      COLOR(0,i) = (*(color_prom++) & 0x0f) + 0x10;
47      UINT8 ctabentry = color_prom[i] & 0x0f;
48      colortable_entry_set_value(machine->colortable, i, ctabentry);
6649   }
6750}
6851
src/mame/video/shuuz.c
r1679r1680
7373   };
7474
7575   /* initialize the playfield */
76   atarigen_playfield_tilemap = tilemap_create(get_playfield_tile_info, tilemap_scan_cols, TILEMAP_TYPE_PEN, 8,8, 64,64);
76   atarigen_playfield_tilemap = tilemap_create(get_playfield_tile_info, tilemap_scan_cols, 8,8, 64,64);
7777
7878   /* initialize the motion objects */
7979   atarimo_init(machine, 0, &modesc);
src/mame/video/cclimber.c
r1679r1680
786786
787787VIDEO_START( toprollr )
788788{
789   bg_tilemap = tilemap_create(get_tile_info_bg,tilemap_scan_rows,TILEMAP_TYPE_PEN,8,8,32,32);
789   bg_tilemap = tilemap_create(get_tile_info_bg,tilemap_scan_rows,8,8,32,32);
790790}
791791
792792static void toprollr_draw_big_sprite(running_machine *machine, mame_bitmap *bitmap,const rectangle *cliprect,int priority)
src/mame/video/xorworld.c
r1679r1680
7575VIDEO_START( xorworld )
7676{
7777   bg_tilemap = tilemap_create(get_bg_tile_info, tilemap_scan_rows,
78      TILEMAP_TYPE_PEN, 8, 8, 32, 32);
78      8, 8, 32, 32);
7979}
8080
8181/*
src/mame/video/speedspn.c
r1679r1680
2121VIDEO_START(speedspn)
2222{
2323   speedspn_vidram = auto_malloc(0x1000 * 2);
24   speedspn_tilemap = tilemap_create(get_speedspn_tile_info,tilemap_scan_cols,TILEMAP_TYPE_PEN, 8, 8,64,32);
24   speedspn_tilemap = tilemap_create(get_speedspn_tile_info,tilemap_scan_cols, 8, 8,64,32);
2525}
2626
2727WRITE8_HANDLER( speedspn_vidram_w )
src/mame/video/hexa.c
r1679r1680
6464VIDEO_START( hexa )
6565{
6666   bg_tilemap = tilemap_create(get_bg_tile_info, tilemap_scan_rows,
67      TILEMAP_TYPE_PEN, 8, 8, 32, 32);
67      8, 8, 32, 32);
6868}
6969
7070
src/mame/video/cloak.c
r1679r1680
182182VIDEO_START( cloak )
183183{
184184   bg_tilemap = tilemap_create(get_bg_tile_info, tilemap_scan_rows,
185      TILEMAP_TYPE_PEN, 8, 8, 32, 32);
185      8, 8, 32, 32);
186186
187187   tmpbitmap = auto_bitmap_alloc(machine->screen[0].width,machine->screen[0].height,machine->screen[0].format);
188188   tmpbitmap2 = auto_bitmap_alloc(machine->screen[0].width,machine->screen[0].height,machine->screen[0].format);
src/mame/video/gticlub.c
r1679r1680
938938
939939   //if (K001005_status == 2)
940940   {
941      fillbitmap(K001005_bitmap[K001005_bitmap_page], Machine->remapped_colortable[0], &K001005_cliprect);
941      fillbitmap(K001005_bitmap[K001005_bitmap_page], Machine->pens[0], &K001005_cliprect);
942942      fillbitmap(K001005_zbuffer, 0xffffffff, &K001005_cliprect);
943943   }
944944}
src/mame/video/namcona1.c
r1679r1680
228228      bg_tilemap[i] = tilemap_create(
229229         get_info[i],
230230         tilemap_scan_rows,
231         TILEMAP_TYPE_PEN,8,8,64,64 );
231         8,8,64,64 );
232232
233233      tilemap_palette_bank[i] = -1;
234234   }
r1679r1680
278278      mask = machine->gfx[1];
279279      code %= gfx->total_elements;
280280      color %= gfx->total_colors;
281      paldata = &machine->remapped_colortable[gfx->color_base + gfx->color_granularity * color];
281      paldata = &machine->pens[gfx->color_base + gfx->color_granularity * color];
282282      gfx_addr = gfx->gfxdata + code * gfx->char_modulo;
283283      gfx_pitch = gfx->line_modulo;
284284      mask_addr = mask->gfxdata + code * mask->char_modulo;
r1679r1680
413413      gfx = machine->gfx[0];
414414      code %= gfx->total_elements;
415415      color %= gfx->total_colors;
416      paldata = &machine->remapped_colortable[gfx->color_base + gfx->color_granularity * color];
416      paldata = &machine->pens[gfx->color_base + gfx->color_granularity * color];
417417      gfx_addr = gfx->gfxdata + code * gfx->char_modulo;
418418      gfx_pitch = gfx->line_modulo;
419419
r1679r1680
575575   gfx_element *pGfx;
576576
577577   pGfx = machine->gfx[0];
578   paldata = &machine->remapped_colortable[pGfx->color_base + pGfx->color_granularity * tilemap_palette_bank[which]];
578   paldata = &machine->pens[pGfx->color_base + pGfx->color_granularity * tilemap_palette_bank[which]];
579579
580580   /* draw one scanline at a time */
581581   clip.min_x = cliprect->min_x;
src/mame/video/foodf.c
r1679r1680
4343   static const int resistances[3] = { 1000, 470, 220 };
4444
4545   /* initialize the playfield */
46   atarigen_playfield_tilemap = tilemap_create(get_playfield_tile_info, tilemap_scan_cols, TILEMAP_TYPE_PEN, 8,8, 32,32);
46   atarigen_playfield_tilemap = tilemap_create(get_playfield_tile_info, tilemap_scan_cols, 8,8, 32,32);
4747   tilemap_set_transparent_pen(atarigen_playfield_tilemap, 0);
4848
4949   /* adjust the playfield for the 8 pixel offset */
src/mame/video/bsktball.c
r1679r1680
3030VIDEO_START( bsktball )
3131{
3232   bg_tilemap = tilemap_create(get_bg_tile_info, tilemap_scan_rows,
33      TILEMAP_TYPE_PEN, 8, 8, 32, 32);
33      8, 8, 32, 32);
3434}
3535
3636static void draw_sprites(running_machine *machine,  mame_bitmap *bitmap, const rectangle *cliprect)
src/mame/video/armedf.c
r1679r1680
107107      sprite_offy = 128;
108108   }
109109
110   //bg_tilemap = tilemap_create(get_bg_tile_info,tilemap_scan_cols,TILEMAP_TYPE_PEN,16,16,64,32);
111   bg_tilemap = tilemap_create(get_bg_tile_info,tilemap_scan_cols,TILEMAP_TYPE_PEN,16,16,64,32);
112   fg_tilemap = tilemap_create(get_fg_tile_info,tilemap_scan_cols,TILEMAP_TYPE_PEN,16,16,64,32);
113   armedf_tx_tilemap = tilemap_create(get_tx_tile_info,armedf_scan,TILEMAP_TYPE_PEN,8,8,64,32);
110   //bg_tilemap = tilemap_create(get_bg_tile_info,tilemap_scan_cols,16,16,64,32);
111   bg_tilemap = tilemap_create(get_bg_tile_info,tilemap_scan_cols,16,16,64,32);
112   fg_tilemap = tilemap_create(get_fg_tile_info,tilemap_scan_cols,16,16,64,32);
113   armedf_tx_tilemap = tilemap_create(get_tx_tile_info,armedf_scan,8,8,64,32);
114114
115115   tilemap_set_transparent_pen(fg_tilemap,0xf);
116116   tilemap_set_transparent_pen(armedf_tx_tilemap,0xf);
src/mame/video/dkong.c
r1679r1680
827827      counter++;
828828   scanline = (scanline+1) % VTOTAL;
829829   /* come back at the next appropriate scanline */
830   timer_adjust(state->scanline_timer, video_screen_get_time_until_pos(0, scanline, 0), scanline, attotime_zero);
830   timer_adjust_oneshot(state->scanline_timer, video_screen_get_time_until_pos(0, scanline, 0), scanline);
831831}
832832
833833static void check_palette(running_machine *machine)
r1679r1680
894894      case HARDWARE_TRS02:
895895         state->bg_bits = auto_bitmap_alloc(machine->screen[0].width, machine->screen[0].height, machine->screen[0].format);
896896         state->scanline_timer = timer_alloc(scanline_callback, NULL);
897         timer_adjust(state->scanline_timer, video_screen_get_time_until_pos(0, 0, 0), 0, attotime_zero);
897         timer_adjust_oneshot(state->scanline_timer, video_screen_get_time_until_pos(0, 0, 0), 0);
898898          /* fall through */
899899      case HARDWARE_TKG04:
900900      case HARDWARE_TKG02:
901         state->bg_tilemap = tilemap_create(dkong_bg_tile_info, tilemap_scan_rows, TILEMAP_TYPE_PEN, 8, 8, 32, 32);
901         state->bg_tilemap = tilemap_create(dkong_bg_tile_info, tilemap_scan_rows, 8, 8, 32, 32);
902902         tilemap_set_scrolldx(state->bg_tilemap, 0, 128);
903903         break;
904904      case HARDWARE_TRS01:
905         state->bg_tilemap = tilemap_create(radarsc1_bg_tile_info, tilemap_scan_rows, TILEMAP_TYPE_PEN, 8, 8, 32, 32);
905         state->bg_tilemap = tilemap_create(radarsc1_bg_tile_info, tilemap_scan_rows, 8, 8, 32, 32);
906906         tilemap_set_scrolldx(state->bg_tilemap, 0, 128);
907907
908908         state->bg_bits = auto_bitmap_alloc(machine->screen[0].width, machine->screen[0].height, machine->screen[0].format);
909909
910910         state->scanline_timer = timer_alloc(scanline_callback, NULL);
911         timer_adjust(state->scanline_timer, video_screen_get_time_until_pos(0, 0, 0), 0, attotime_zero);
911         timer_adjust_oneshot(state->scanline_timer, video_screen_get_time_until_pos(0, 0, 0), 0);
912912         break;
913913      default:
914914         fatalerror("Invalid hardware type in dkong_video_start");
src/mame/video/sprint4.c
r1679r1680
5656{
5757   helper = auto_bitmap_alloc(machine->screen[0].width, machine->screen[0].height, machine->screen[0].format);
5858
59   playfield = tilemap_create(sprint4_tile_info, tilemap_scan_rows, TILEMAP_TYPE_PEN, 8, 8, 32, 32);
59   playfield = tilemap_create(sprint4_tile_info, tilemap_scan_rows, 8, 8, 32, 32);
6060}
6161
6262
src/mame/video/appoooh.c
r1679r1680
139139***************************************************************************/
140140VIDEO_START( appoooh )
141141{
142   fg_tilemap = tilemap_create(get_fg_tile_info,tilemap_scan_rows,TILEMAP_TYPE_PEN,8,8,32,32);
143   bg_tilemap = tilemap_create(get_bg_tile_info,tilemap_scan_rows,TILEMAP_TYPE_PEN,     8,8,32,32);
142   fg_tilemap = tilemap_create(get_fg_tile_info,tilemap_scan_rows,8,8,32,32);
143   bg_tilemap = tilemap_create(get_bg_tile_info,tilemap_scan_rows,     8,8,32,32);
144144
145145   tilemap_set_transparent_pen(fg_tilemap,0);
146146   tilemap_set_scrolldy(fg_tilemap,8,8);
src/mame/video/travrusa.c
r1679r1680
210210
211211VIDEO_START( travrusa )
212212{
213   bg_tilemap = tilemap_create(get_tile_info,tilemap_scan_rows,TILEMAP_TYPE_PEN,8,8,64,32);
213   bg_tilemap = tilemap_create(get_tile_info,tilemap_scan_rows,8,8,64,32);
214214
215215   tilemap_set_transmask(bg_tilemap,0,0xff,0x00); /* split type 0 is totally transparent in front half */
216216   tilemap_set_transmask(bg_tilemap,1,0x3f,0xc0); /* split type 1 has pens 6 and 7 opaque - tunnels */
src/mame/video/metlclsh.c
r1679r1680
144144{
145145   metlclsh_otherram = auto_malloc(0x800);   // banked ram
146146
147   bg_tilemap = tilemap_create(get_bg_tile_info,metlclsh_bgtilemap_scan,TILEMAP_TYPE_PEN,16,16,32,16);
148   fg_tilemap = tilemap_create(get_fg_tile_info,tilemap_scan_rows,TILEMAP_TYPE_PEN,8,8,32,32);
147   bg_tilemap = tilemap_create(get_bg_tile_info,metlclsh_bgtilemap_scan,16,16,32,16);
148   fg_tilemap = tilemap_create(get_fg_tile_info,tilemap_scan_rows,8,8,32,32);
149149
150150   tilemap_set_transparent_pen( bg_tilemap, 0 );
151151   tilemap_set_transparent_pen( fg_tilemap, 0 );
src/mame/video/kaneko16.c
r1679r1680
133133   VIDEO_START_CALL(kaneko16_sprites);
134134
135135   kaneko16_tmap_0 = tilemap_create(   get_tile_info_0, tilemap_scan_rows,
136                              TILEMAP_TYPE_PEN, 16,16, 0x20,0x20   );
136                              16,16, 0x20,0x20   );
137137   kaneko16_tmap_1 = tilemap_create(   get_tile_info_1, tilemap_scan_rows,
138                              TILEMAP_TYPE_PEN, 16,16, 0x20,0x20   );
138                              16,16, 0x20,0x20   );
139139
140140   kaneko16_tmap_2 = 0;
141141
r1679r1680
179179   VIDEO_START_CALL(kaneko16_1xVIEW2);
180180
181181   kaneko16_tmap_2 = tilemap_create(   get_tile_info_2, tilemap_scan_rows,
182                              TILEMAP_TYPE_PEN, 16,16, 0x20,0x20   );
182                              16,16, 0x20,0x20   );
183183   kaneko16_tmap_3 = tilemap_create(   get_tile_info_3, tilemap_scan_rows,
184                              TILEMAP_TYPE_PEN, 16,16, 0x20,0x20   );
184                              16,16, 0x20,0x20   );
185185
186186   {
187187      int dx, xdim = machine->screen[0].width;
r1679r1680
395395      UINT32 code,UINT32 color,int flipx,int flipy,int sx,int sy,
396396      const rectangle *clip,int priority)
397397{
398   const pen_t *pal = &machine->remapped_colortable[gfx->color_base + gfx->color_granularity * (color % gfx->total_colors)];
398   const pen_t *pal = &machine->pens[gfx->color_base + gfx->color_granularity * (color % gfx->total_colors)];
399399   UINT8 *source_base = gfx->gfxdata + (code % gfx->total_elements) * gfx->char_modulo;
400400
401401   int sprite_screen_height = ((1<<16)*gfx->height+0x8000)>>16;
src/mame/video/dbz.c
r1679r1680
9797   K056832_vh_start(machine, REGION_GFX1, K056832_BPP_4, 1, NULL, dbz_tile_callback, 1);
9898   K053247_vh_start(machine, REGION_GFX2, -52, 16, NORMAL_PLANE_ORDER, dbz_sprite_callback);
9999
100   dbz_bg1_tilemap = tilemap_create(get_dbz_bg1_tile_info,tilemap_scan_rows,TILEMAP_TYPE_PEN, 16, 16,64,32);
101   dbz_bg2_tilemap = tilemap_create(get_dbz_bg2_tile_info,tilemap_scan_rows,TILEMAP_TYPE_PEN, 16, 16,64,32);
100   dbz_bg1_tilemap = tilemap_create(get_dbz_bg1_tile_info,tilemap_scan_rows, 16, 16,64,32);
101   dbz_bg2_tilemap = tilemap_create(get_dbz_bg2_tile_info,tilemap_scan_rows, 16, 16,64,32);
102102
103103   tilemap_set_transparent_pen(dbz_bg1_tilemap,0);
104104   tilemap_set_transparent_pen(dbz_bg2_tilemap,0);
src/mame/video/goldstar.c
r1679r1680
3333   tmpbitmap2 = auto_bitmap_alloc(machine->screen[0].width,machine->screen[0].height,machine->screen[0].format);
3434   tmpbitmap3 = auto_bitmap_alloc(machine->screen[0].width,machine->screen[0].height,machine->screen[0].format);
3535   tmpbitmap4 = auto_bitmap_alloc(machine->screen[0].width,machine->screen[0].height,machine->screen[0].format);
36
37   /* leave everything at the default, but map all foreground 0 pens as transparent */
38//        for (i = 0;i < 16;i++) palette_used_colors[8 * i] = PALETTE_COLOR_TRANSPARENT;
3936}
4037
4138
src/mame/video/wc90.c
r1679r1680
8989
9090VIDEO_START( wc90 )
9191{
92   bg_tilemap = tilemap_create(get_bg_tile_info,tilemap_scan_rows,TILEMAP_TYPE_PEN,     16,16,64,32);
93   fg_tilemap = tilemap_create(get_fg_tile_info,tilemap_scan_rows,TILEMAP_TYPE_PEN,16,16,64,32);
94   tx_tilemap = tilemap_create(get_tx_tile_info,tilemap_scan_rows,TILEMAP_TYPE_PEN, 8, 8,64,32);
92   bg_tilemap = tilemap_create(get_bg_tile_info,tilemap_scan_rows,     16,16,64,32);
93   fg_tilemap = tilemap_create(get_fg_tile_info,tilemap_scan_rows,16,16,64,32);
94   tx_tilemap = tilemap_create(get_tx_tile_info,tilemap_scan_rows, 8, 8,64,32);
9595
9696   tilemap_set_transparent_pen(fg_tilemap,0);
9797   tilemap_set_transparent_pen(tx_tilemap,0);
r1679r1680
9999
100100VIDEO_START( wc90t )
101101{
102   bg_tilemap = tilemap_create(track_get_bg_tile_info,tilemap_scan_rows,TILEMAP_TYPE_PEN,     16,16,64,32);
103   fg_tilemap = tilemap_create(track_get_fg_tile_info,tilemap_scan_rows,TILEMAP_TYPE_PEN,16,16,64,32);
104   tx_tilemap = tilemap_create(get_tx_tile_info,tilemap_scan_rows,TILEMAP_TYPE_PEN, 8, 8,64,32);
102   bg_tilemap = tilemap_create(track_get_bg_tile_info,tilemap_scan_rows,     16,16,64,32);
103   fg_tilemap = tilemap_create(track_get_fg_tile_info,tilemap_scan_rows,16,16,64,32);
104   tx_tilemap = tilemap_create(get_tx_tile_info,tilemap_scan_rows, 8, 8,64,32);
105105
106106   tilemap_set_transparent_pen(fg_tilemap,0);
107107   tilemap_set_transparent_pen(tx_tilemap,0);
src/mame/video/gauntlet.c
r1679r1680
106106   int i, size;
107107
108108   /* initialize the playfield */
109   atarigen_playfield_tilemap = tilemap_create(get_playfield_tile_info, tilemap_scan_cols, TILEMAP_TYPE_PEN, 8,8, 64,64);
109   atarigen_playfield_tilemap = tilemap_create(get_playfield_tile_info, tilemap_scan_cols, 8,8, 64,64);
110110
111111   /* initialize the motion objects */
112112   atarimo_init(machine, 0, &modesc);
113113
114114   /* initialize the alphanumerics */
115   atarigen_alpha_tilemap = tilemap_create(get_alpha_tile_info, tilemap_scan_rows, TILEMAP_TYPE_PEN, 8,8, 64,32);
115   atarigen_alpha_tilemap = tilemap_create(get_alpha_tile_info, tilemap_scan_rows, 8,8, 64,32);
116116   tilemap_set_transparent_pen(atarigen_alpha_tilemap, 0);
117117
118118   /* modify the motion object code lookup table to account for the code XOR */
src/mame/video/ms32.c
r1679r1680
7272
7373VIDEO_START( ms32 )
7474{
75   ms32_tx_tilemap = tilemap_create(get_ms32_tx_tile_info,tilemap_scan_rows,TILEMAP_TYPE_PEN, 8, 8,64,64);
76   ms32_bg_tilemap = tilemap_create(get_ms32_bg_tile_info,tilemap_scan_rows,TILEMAP_TYPE_PEN,16,16,64,64);
77   ms32_roz_tilemap = tilemap_create(get_ms32_roz_tile_info,tilemap_scan_rows,TILEMAP_TYPE_PEN,16,16,128,128);
75   ms32_tx_tilemap = tilemap_create(get_ms32_tx_tile_info,tilemap_scan_rows,8, 8,64,64);
76   ms32_bg_tilemap = tilemap_create(get_ms32_bg_tile_info,tilemap_scan_rows,16,16,64,64);
77   ms32_roz_tilemap = tilemap_create(get_ms32_roz_tile_info,tilemap_scan_rows,16,16,128,128);
7878
7979   tilemap_set_transparent_pen(ms32_tx_tilemap,0);
8080   tilemap_set_transparent_pen(ms32_bg_tilemap,0);
r1679r1680
8989   if (!strcmp(machine->gamedrv->name,"47pie2o"))   ms32_reverse_sprite_order = 0;
9090   if (!strcmp(machine->gamedrv->name,"hayaosi3"))   ms32_reverse_sprite_order = 0;
9191   if (!strcmp(machine->gamedrv->name,"bnstars"))   ms32_reverse_sprite_order = 0;
92   if (!strcmp(machine->gamedrv->name,"wpksocv2"))   ms32_reverse_sprite_order = 0;
9293
9394   // tp2m32 doesn't set the brightness registers so we need sensible defaults
9495   brt[0] = brt[1] = 0xffff;
src/mame/video/darkseal.c
r1679r1680
268268
269269VIDEO_START( darkseal )
270270{
271   pf1_tilemap = tilemap_create(get_fg_tile_info, tilemap_scan_rows,TILEMAP_TYPE_PEN, 8, 8,64,64);
272   pf2_tilemap = tilemap_create(get_bg_tile_info2,darkseal_scan,    TILEMAP_TYPE_PEN,16,16,64,64);
273   pf3_tilemap = tilemap_create(get_bg_tile_info3,darkseal_scan,    TILEMAP_TYPE_PEN,     16,16,64,64);
271   pf1_tilemap = tilemap_create(get_fg_tile_info, tilemap_scan_rows, 8, 8,64,64);
272   pf2_tilemap = tilemap_create(get_bg_tile_info2,darkseal_scan,    16,16,64,64);
273   pf3_tilemap = tilemap_create(get_bg_tile_info3,darkseal_scan,         16,16,64,64);
274274
275275   tilemap_set_transparent_pen(pf1_tilemap,0);
276276   tilemap_set_transparent_pen(pf2_tilemap,0);
src/mame/video/seicross.c
r1679r1680
8888VIDEO_START( seicross )
8989{
9090   bg_tilemap = tilemap_create(get_bg_tile_info, tilemap_scan_rows,
91      TILEMAP_TYPE_PEN, 8, 8, 32, 32);
91      8, 8, 32, 32);
9292
9393   tilemap_set_scroll_cols(bg_tilemap, 32);
9494}
src/mame/video/system16.c
r1679r1680
209209   int shadow,
210210   int shadow_pen, int eos )
211211{
212   const pen_t *shadow_base = machine->remapped_colortable + machine->gfx[0]->color_base + (machine->drv->total_colors/2);
212   const pen_t *shadow_base = machine->pens + machine->gfx[0]->color_base + (machine->drv->total_colors/2);
213213   const UINT8 *source;
214214   int full_shadow=shadow&SYS16_SPR_SHADOW;
215215   int partial_shadow=shadow&SYS16_SPR_PARTIAL_SHADOW;
r1679r1680
340340
341341static void draw_sprites(running_machine *machine, mame_bitmap *bitmap, const rectangle *cliprect, int b3d ) //*
342342{
343   const pen_t *base_pal = machine->remapped_colortable + machine->gfx[0]->color_base;
343   const pen_t *base_pal = machine->pens + machine->gfx[0]->color_base;
344344   const UINT8 *base_gfx = memory_region(REGION_GFX2);
345345   const int gfx_rom_size = memory_region_length(REGION_GFX2);
346346   const UINT16 *source = sys16_spriteram;
r1679r1680
788788      background = tilemap_create(
789789         get_bg_tile_info,
790790         sys16_bg_map,
791         TILEMAP_TYPE_PEN,
791
792792         8,8,
793793         64*2,32*2 );
794794   else
795795      background = tilemap_create(
796796         get_bg_tile_info,
797797         sys16_bg_map,
798         TILEMAP_TYPE_PEN,
798
799799         8,8,
800800         64*2,32*2 );
801801
802802   foreground = tilemap_create(
803803      get_fg_tile_info,
804804      sys16_bg_map,
805      TILEMAP_TYPE_PEN,
805
806806      8,8,
807807      64*2,32*2 );
808808
809809   text_layer = tilemap_create(
810810      get_text_tile_info,
811811      sys16_text_map,
812      TILEMAP_TYPE_PEN,
812
813813      8,8,
814814      40,28 );
815815
r1679r1680
875875   background2 = tilemap_create(
876876      get_bg2_tile_info,
877877      sys16_bg_map,
878      TILEMAP_TYPE_PEN,
878
879879      8,8,
880880      64*2,32*2 );
881881
882882   foreground2 = tilemap_create(
883883      get_fg2_tile_info,
884884      sys16_bg_map,
885      TILEMAP_TYPE_PEN,
885
886886      8,8,
887887      64*2,32*2 );
888888
src/mame/video/atarimo.c
r1679r1680
323323   scanline += 64;
324324   if (scanline >= machine->screen[0].visarea.max_y)
325325      scanline = 0;
326   timer_adjust(force_update_timer, video_screen_get_time_until_pos(0, scanline, 0), scanline, attotime_zero);
326   timer_adjust_oneshot(force_update_timer, video_screen_get_time_until_pos(0, scanline, 0), scanline);
327327}
328328
329329/*---------------------------------------------------------------
r1679r1680
445445
446446   /* start a timer to update a few times during refresh */
447447   force_update_timer = timer_alloc(force_update, NULL);
448   timer_adjust(force_update_timer,video_screen_get_time_until_pos(0, 0, 0), 0, attotime_zero);
448   timer_adjust_oneshot(force_update_timer,video_screen_get_time_until_pos(0, 0, 0), 0);
449449
450450   init_savestate(map, mo);
451451
src/mame/video/deniam.c
r1679r1680
9898
9999VIDEO_START( deniam )
100100{
101   bg_tilemap = tilemap_create(get_bg_tile_info,scan_pages,       TILEMAP_TYPE_PEN,     8,8,128,64);
102   fg_tilemap = tilemap_create(get_fg_tile_info,scan_pages,       TILEMAP_TYPE_PEN,8,8,128,64);
103   tx_tilemap = tilemap_create(get_tx_tile_info,tilemap_scan_rows,TILEMAP_TYPE_PEN,8,8, 64,32);
101   bg_tilemap = tilemap_create(get_bg_tile_info,scan_pages,            8,8,128,64);
102   fg_tilemap = tilemap_create(get_fg_tile_info,scan_pages,       8,8,128,64);
103   tx_tilemap = tilemap_create(get_tx_tile_info,tilemap_scan_rows,8,8, 64,32);
104104
105105   tilemap_set_transparent_pen(fg_tilemap,0);
106106   tilemap_set_transparent_pen(tx_tilemap,0);
src/mame/video/mcr3.c
r1679r1680
109109VIDEO_START( mcr3 )
110110{
111111   /* initialize the background tilemap */
112   bg_tilemap = tilemap_create(get_bg_tile_info, tilemap_scan_rows, TILEMAP_TYPE_PEN, 16,16, 32,30);
112   bg_tilemap = tilemap_create(get_bg_tile_info, tilemap_scan_rows, 16,16, 32,30);
113113}
114114
115115
116116VIDEO_START( mcrmono )
117117{
118118   /* initialize the background tilemap */
119   bg_tilemap = tilemap_create(mcrmono_get_bg_tile_info, tilemap_scan_rows, TILEMAP_TYPE_PEN, 16,16, 32,30);
119   bg_tilemap = tilemap_create(mcrmono_get_bg_tile_info, tilemap_scan_rows, 16,16, 32,30);
120120}
121121
122122
123123VIDEO_START( spyhunt )
124124{
125125   /* initialize the background tilemap */
126   bg_tilemap = tilemap_create(spyhunt_get_bg_tile_info, spyhunt_bg_scan, TILEMAP_TYPE_PEN, 64,32, 64,32);
126   bg_tilemap = tilemap_create(spyhunt_get_bg_tile_info, spyhunt_bg_scan, 64,32, 64,32);
127127
128128   /* initialize the text tilemap */
129   alpha_tilemap = tilemap_create(spyhunt_get_alpha_tile_info, tilemap_scan_cols, TILEMAP_TYPE_PEN, 16,16, 32,32);
129   alpha_tilemap = tilemap_create(spyhunt_get_alpha_tile_info, tilemap_scan_cols, 16,16, 32,32);
130130   tilemap_set_transparent_pen(alpha_tilemap, 0);
131131   tilemap_set_scrollx(alpha_tilemap, 0, 16);
132132
src/mame/video/stadhero.c
r1679r1680
157157
158158VIDEO_START( stadhero )
159159{
160   pf1_tilemap =     tilemap_create(get_pf1_tile_info,tilemap_scan_rows,TILEMAP_TYPE_PEN, 8, 8,32,32);
161   pf2_tilemap =     tilemap_create(get_pf2_tile_info,stadhero_scan,TILEMAP_TYPE_PEN,     16,16,64,64);
160   pf1_tilemap =     tilemap_create(get_pf1_tile_info,tilemap_scan_rows, 8, 8,32,32);
161   pf2_tilemap =     tilemap_create(get_pf2_tile_info,stadhero_scan,     16,16,64,64);
162162
163163   stadhero_pf2_data = auto_malloc(0x2000 * 2);
164164
src/mame/video/prehisle.c
r1679r1680
9595VIDEO_START( prehisle )
9696{
9797   bg2_tilemap = tilemap_create(get_bg2_tile_info, tilemap_scan_cols,
98      TILEMAP_TYPE_PEN, 16, 16, 1024, 32);
98      16, 16, 1024, 32);
9999
100100   bg_tilemap = tilemap_create(get_bg_tile_info, tilemap_scan_cols,
101      TILEMAP_TYPE_PEN, 16, 16, 256, 32);
101      16, 16, 256, 32);
102102
103103   fg_tilemap = tilemap_create(get_fg_tile_info, tilemap_scan_rows,
104      TILEMAP_TYPE_PEN, 8, 8, 32, 32);
104      8, 8, 32, 32);
105105
106106   tilemap_set_transparent_pen(bg_tilemap, 15);
107107   tilemap_set_transparent_pen(fg_tilemap, 15);
src/mame/video/marvins.c
r1679r1680
161161   stuff_palette( machine, 0, 0, 16*8 ); /* load sprite colors */
162162   stuff_palette( machine, 16*8*3, 16*8, 16*8 ); /* load text colors */
163163
164   fg_tilemap = tilemap_create(get_fg_tilemap_info,tilemap_scan_cols,TILEMAP_TYPE_PEN,8,8,64,32);
165   bg_tilemap = tilemap_create(get_bg_tilemap_info,tilemap_scan_cols,TILEMAP_TYPE_PEN,8,8,64,32);
166   tx_tilemap = tilemap_create(get_tx_tilemap_info,tilemap_scan_cols,TILEMAP_TYPE_PEN,8,8,32,32);
164   fg_tilemap = tilemap_create(get_fg_tilemap_info,tilemap_scan_cols,8,8,64,32);
165   bg_tilemap = tilemap_create(get_bg_tilemap_info,tilemap_scan_cols,8,8,64,32);
166   tx_tilemap = tilemap_create(get_tx_tilemap_info,tilemap_scan_cols,8,8,32,32);
167167
168168   {
169169      tilemap_clip = machine->screen[0].visarea;
src/mame/video/wwfsstar.c
r1679r1680
205205
206206VIDEO_START( wwfsstar )
207207{
208   fg0_tilemap = tilemap_create(get_fg0_tile_info,tilemap_scan_rows,TILEMAP_TYPE_PEN, 8, 8,32,32);
208   fg0_tilemap = tilemap_create(get_fg0_tile_info,tilemap_scan_rows, 8, 8,32,32);
209209   tilemap_set_transparent_pen(fg0_tilemap,0);
210210
211   bg0_tilemap = tilemap_create(get_bg0_tile_info,bg0_scan,TILEMAP_TYPE_PEN, 16, 16,32,32);
211   bg0_tilemap = tilemap_create(get_bg0_tile_info,bg0_scan, 16, 16,32,32);
212212   tilemap_set_transparent_pen(fg0_tilemap,0);
213213}
214214
src/mame/video/polepos.c
r1679r1680
201201
202202VIDEO_START( polepos )
203203{
204   bg_tilemap = tilemap_create(bg_get_tile_info,tilemap_scan_cols,TILEMAP_TYPE_PEN,8,8,64,16);
205   tx_tilemap = tilemap_create(tx_get_tile_info,tilemap_scan_rows,TILEMAP_TYPE_PEN,8,8,32,32);
204   bg_tilemap = tilemap_create(bg_get_tile_info,tilemap_scan_cols,8,8,64,16);
205   tx_tilemap = tilemap_create(tx_get_tile_info,tilemap_scan_rows,8,8,32,32);
206206
207207   colortable_configure_tilemap_groups(machine->colortable, tx_tilemap, machine->gfx[0], 0x2f);
208208}
src/mame/video/actfancr.c
r1679r1680
8787
8888VIDEO_START( actfancr )
8989{
90   pf1_tilemap = tilemap_create(get_tile_info,actfancr_scan,TILEMAP_TYPE_PEN,16,16,256,16);
91   pf1_alt_tilemap = tilemap_create(get_tile_info,actfancr_scan2,TILEMAP_TYPE_PEN,16,16,128,32);
92   pf2_tilemap = tilemap_create(get_pf2_tile_info,tilemap_scan_rows,TILEMAP_TYPE_PEN,8,8,32,32);
90   pf1_tilemap = tilemap_create(get_tile_info,actfancr_scan,16,16,256,16);
91   pf1_alt_tilemap = tilemap_create(get_tile_info,actfancr_scan2,16,16,128,32);
92   pf2_tilemap = tilemap_create(get_pf2_tile_info,tilemap_scan_rows,8,8,32,32);
9393
9494   tilemap_set_transparent_pen(pf2_tilemap,0);
9595
r1679r1680
9898
9999VIDEO_START( triothep )
100100{
101   pf1_tilemap = tilemap_create(get_trio_tile_info,triothep_scan,TILEMAP_TYPE_PEN,16,16,32,32);
102   pf2_tilemap = tilemap_create(get_pf2_tile_info,tilemap_scan_rows,TILEMAP_TYPE_PEN,8,8,32,32);
101   pf1_tilemap = tilemap_create(get_trio_tile_info,triothep_scan,16,16,32,32);
102   pf2_tilemap = tilemap_create(get_pf2_tile_info,tilemap_scan_rows,8,8,32,32);
103103
104104   tilemap_set_transparent_pen(pf2_tilemap,0);
105105
src/mame/video/taito_b.c
r1679r1680
208208   framebuffer[1] = auto_bitmap_alloc(512,256,machine->screen[0].format);
209209   pixel_bitmap = NULL;  /* only hitice needs this */
210210
211   bg_tilemap = tilemap_create(get_bg_tile_info,tilemap_scan_rows,TILEMAP_TYPE_PEN,     16,16,64,64);
212   fg_tilemap = tilemap_create(get_fg_tile_info,tilemap_scan_rows,TILEMAP_TYPE_PEN,16,16,64,64);
213   tx_tilemap = tilemap_create(get_tx_tile_info,tilemap_scan_rows,TILEMAP_TYPE_PEN, 8, 8,64,32);
211   bg_tilemap = tilemap_create(get_bg_tile_info,tilemap_scan_rows,     16,16,64,64);
212   fg_tilemap = tilemap_create(get_fg_tile_info,tilemap_scan_rows,16,16,64,64);
213   tx_tilemap = tilemap_create(get_tx_tile_info,tilemap_scan_rows, 8, 8,64,32);
214214
215215   tilemap_set_transparent_pen(fg_tilemap,0);
216216   tilemap_set_transparent_pen(tx_tilemap,0);
src/mame/video/jackal.c
r1679r1680
1919PALETTE_INIT( jackal )
2020{
2121   int i;
22   #define TOTAL_COLORS(gfxn) (machine->gfx[gfxn]->total_colors * machine->gfx[gfxn]->color_granularity)
23   #define COLOR(gfxn,offs) (colortable[machine->drv->gfxdecodeinfo[gfxn].color_codes_start + offs])
2422
25   for (i = 0;i < TOTAL_COLORS(0);i++)
23   /* allocate the colortable */
24   machine->colortable = colortable_alloc(machine, 0x200);
25
26   for (i = 0; i < 0x1000; i++)
2627   {
27      COLOR(0,i) = (i & 0xff) + 256;
28      UINT16 ctabentry = (i & 0xff) | 0x100;
29
2830      /* this is surely wrong - is there a PROM missing? */
2931      if (i & 0x0f)
30         COLOR(0,i) |= i/256;
32         ctabentry = ctabentry | (i >> 8);
33
34      colortable_entry_set_value(machine->colortable, i, ctabentry);
3135   }
3236
33   for (i = 0;i < TOTAL_COLORS(1);i++)
37   for (i = 0x1000; i < 0x1100; i++)
3438   {
35      COLOR(1,i) = (*color_prom & 0x0f);
36      color_prom++;
39      UINT8 ctabentry = color_prom[i - 0x1000] & 0x0f;
40      colortable_entry_set_value(machine->colortable, i, ctabentry);
3741   }
3842
39   for (i = 0;i < TOTAL_COLORS(3);i++)
43   for (i = 0x1100; i < 0x1200; i++)
4044   {
41      COLOR(3,i) = (*color_prom & 0x0f) + 16;
42      color_prom++;
45      UINT8 ctabentry = (color_prom[i - 0x1100] & 0x0f) | 0x10;
46      colortable_entry_set_value(machine->colortable, i, ctabentry);
4347   }
4448}
4549
50
51static void set_pens(running_machine *machine)
52{
53   int i;
54
55   for (i = 0; i < 0x400; i += 2)
56   {
57      UINT16 data = paletteram[i] | (paletteram[i | 1] << 8);
58
59      rgb_t color = MAKE_RGB(pal5bit(data >> 0), pal5bit(data >> 5), pal5bit(data >> 10));
60
61      colortable_palette_set_color(machine->colortable, i >> 1, color);
62   }
63}
64
65
4666void jackal_mark_tile_dirty(int offset)
4767{
4868   tilemap_mark_tile_dirty(bg_tilemap, offset);
r1679r1680
6282
6383VIDEO_START( jackal )
6484{
65   bg_tilemap = tilemap_create(get_bg_tile_info, tilemap_scan_rows,
66      TILEMAP_TYPE_PEN, 8, 8, 32, 32);
85   bg_tilemap = tilemap_create(get_bg_tile_info, tilemap_scan_rows, 8, 8, 32, 32);
6786}
6887
6988static void draw_background( mame_bitmap *bitmap, const rectangle *cliprect )
r1679r1680
86105         tilemap_set_scroll_rows(bg_tilemap, 32);
87106
88107         for (i = 0; i < 32; i++)
89         {
90108            tilemap_set_scrollx(bg_tilemap, i, jackal_scrollram[i]);
91         }
92109      }
93110
94111      if (jackal_videoctrl[2] & 0x04)
r1679r1680
211228
212229VIDEO_UPDATE( jackal )
213230{
231   set_pens(machine);
214232   draw_background(bitmap, cliprect);
215233   draw_sprites(machine, bitmap, cliprect);
216234   return 0;
src/mame/video/tank8.c
r1679r1680
9090   helper2 = auto_bitmap_alloc(machine->screen[0].width, machine->screen[0].height, machine->screen[0].format);
9191   helper3 = auto_bitmap_alloc(machine->screen[0].width, machine->screen[0].height, machine->screen[0].format);
9292
93   tilemap1 = tilemap_create(tank8_get_tile_info1, tilemap_scan_rows, TILEMAP_TYPE_PEN, 16, 16, 32, 32);
94   tilemap2 = tilemap_create(tank8_get_tile_info2, tilemap_scan_rows, TILEMAP_TYPE_PEN, 16, 16, 32, 32);
93   tilemap1 = tilemap_create(tank8_get_tile_info1, tilemap_scan_rows,  16, 16, 32, 32);
94   tilemap2 = tilemap_create(tank8_get_tile_info2, tilemap_scan_rows,  16, 16, 32, 32);
9595
9696   /* VBLANK starts on scanline #256 and ends on scanline #24 */
9797
src/mame/video/taitoic.c
r1679r1680
797797
798798      if (!PC080SN_dblwidth)   /* standard tilemaps */
799799      {
800         PC080SN_tilemap[i][0] = tilemap_create(PC080SN_get_tile_info[i][0],tilemap_scan_rows,TILEMAP_TYPE_PEN,8,8,64,64);
801         PC080SN_tilemap[i][1] = tilemap_create(PC080SN_get_tile_info[i][1],tilemap_scan_rows,TILEMAP_TYPE_PEN,8,8,64,64);
800         PC080SN_tilemap[i][0] = tilemap_create(PC080SN_get_tile_info[i][0],tilemap_scan_rows,8,8,64,64);
801         PC080SN_tilemap[i][1] = tilemap_create(PC080SN_get_tile_info[i][1],tilemap_scan_rows,8,8,64,64);
802802      }
803803      else   /* double width tilemaps */
804804      {
805         PC080SN_tilemap[i][0] = tilemap_create(PC080SN_get_tile_info[i][0],tilemap_scan_rows,TILEMAP_TYPE_PEN,8,8,128,64);
806         PC080SN_tilemap[i][1] = tilemap_create(PC080SN_get_tile_info[i][1],tilemap_scan_rows,TILEMAP_TYPE_PEN,8,8,128,64);
805         PC080SN_tilemap[i][0] = tilemap_create(PC080SN_get_tile_info[i][0],tilemap_scan_rows,8,8,128,64);
806         PC080SN_tilemap[i][1] = tilemap_create(PC080SN_get_tile_info[i][1],tilemap_scan_rows,8,8,128,64);
807807      }
808808
809809      PC080SN_ram[i] = auto_malloc(PC080SN_RAM_SIZE);
r1679r1680
15341534   TC0080VCO_bg_flip_yoffs = bg_flip_yoffs;   /* usually -2 */
15351535   TC0080VCO_has_tx = has_fg0;   /* for debugging only */
15361536
1537   TC0080VCO_tilemap[0] = tilemap_create(TC0080VCO_get_bg0_tile_info_0,tilemap_scan_rows,TILEMAP_TYPE_PEN,16,16,64,64);
1538   TC0080VCO_tilemap[1] = tilemap_create(TC0080VCO_get_bg1_tile_info_0,tilemap_scan_rows,TILEMAP_TYPE_PEN,16,16,64,64);
1537   TC0080VCO_tilemap[0] = tilemap_create(TC0080VCO_get_bg0_tile_info_0,tilemap_scan_rows,16,16,64,64);
1538   TC0080VCO_tilemap[1] = tilemap_create(TC0080VCO_get_bg1_tile_info_0,tilemap_scan_rows,16,16,64,64);
15391539   TC0080VCO_ram = auto_malloc(TC0080VCO_RAM_SIZE);
15401540
15411541   memset( TC0080VCO_ram,0,TC0080VCO_RAM_SIZE );
r1679r1680
15581558
15591559   /* Perform extra initialisations for text layer */
15601560   {
1561      TC0080VCO_tilemap[2] = tilemap_create(TC0080VCO_get_tx_tile_info,tilemap_scan_rows,TILEMAP_TYPE_PEN,8,8,64,64);
1561      TC0080VCO_tilemap[2] = tilemap_create(TC0080VCO_get_tx_tile_info,tilemap_scan_rows,8,8,64,64);
15621562      TC0080VCO_char_dirty = auto_malloc(TC0080VCO_TOTAL_CHARS);
15631563
15641564      TC0080VCO_dirty_chars();
r1679r1680
19851985         zx, 0, 0, zy,
19861986         0,               /* why no wraparound ?? */
19871987         &machine->screen[0].visarea,
1988         TRANSPARENCY_COLOR, 0, priority);
1988         TRANSPARENCY_PEN, 0, priority);
19891989   }
19901990}
19911991
r1679r1680
22922292      TC0100SCN_dblwidth[i]=0;
22932293
22942294      /* Single width versions */
2295      TC0100SCN_tilemap[i][0][0] = tilemap_create(TC0100SCN_get_tile_info[i][0],tilemap_scan_rows,TILEMAP_TYPE_PEN,8,8,64,64);
2296      TC0100SCN_tilemap[i][1][0] = tilemap_create(TC0100SCN_get_tile_info[i][1],tilemap_scan_rows,TILEMAP_TYPE_PEN,8,8,64,64);
2297      TC0100SCN_tilemap[i][2][0] = tilemap_create(TC0100SCN_get_tile_info[i][2],tilemap_scan_rows,TILEMAP_TYPE_PEN,8,8,64,64);
2295      TC0100SCN_tilemap[i][0][0] = tilemap_create(TC0100SCN_get_tile_info[i][0],tilemap_scan_rows,8,8,64,64);
2296      TC0100SCN_tilemap[i][1][0] = tilemap_create(TC0100SCN_get_tile_info[i][1],tilemap_scan_rows,8,8,64,64);
2297      TC0100SCN_tilemap[i][2][0] = tilemap_create(TC0100SCN_get_tile_info[i][2],tilemap_scan_rows,8,8,64,64);
22982298
22992299      /* Double width versions */
2300      TC0100SCN_tilemap[i][0][1] = tilemap_create(TC0100SCN_get_tile_info[i][0],tilemap_scan_rows,TILEMAP_TYPE_PEN,8,8,128,64);
2301      TC0100SCN_tilemap[i][1][1] = tilemap_create(TC0100SCN_get_tile_info[i][1],tilemap_scan_rows,TILEMAP_TYPE_PEN,8,8,128,64);
2302      TC0100SCN_tilemap[i][2][1] = tilemap_create(TC0100SCN_get_tile_info[i][2],tilemap_scan_rows,TILEMAP_TYPE_PEN,8,8,128,32);
2300      TC0100SCN_tilemap[i][0][1] = tilemap_create(TC0100SCN_get_tile_info[i][0],tilemap_scan_rows,8,8,128,64);
2301      TC0100SCN_tilemap[i][1][1] = tilemap_create(TC0100SCN_get_tile_info[i][1],tilemap_scan_rows,8,8,128,64);
2302      TC0100SCN_tilemap[i][2][1] = tilemap_create(TC0100SCN_get_tile_info[i][2],tilemap_scan_rows,8,8,128,32);
23032303
23042304      /* Set up clipping for multi-TC0100SCN games. We assume
23052305           this code won't ever affect single screen games:
r1679r1680
27872787void TC0280GRD_vh_start(int gfxnum)
27882788{
27892789   TC0280GRD_ram = auto_malloc(TC0280GRD_RAM_SIZE);
2790   TC0280GRD_tilemap = tilemap_create(TC0280GRD_get_tile_info,tilemap_scan_rows,TILEMAP_TYPE_PEN,8,8,64,64);
2790   TC0280GRD_tilemap = tilemap_create(TC0280GRD_get_tile_info,tilemap_scan_rows,8,8,64,64);
27912791
27922792   state_save_register_global_pointer(TC0280GRD_ram, TC0280GRD_RAM_SIZE/2);
27932793   state_save_register_global_array(TC0280GRD_ctrl);
r1679r1680
31653165      TC0480SCP_dblwidth=0;
31663166
31673167      /* Single width versions */
3168      TC0480SCP_tilemap[0][0] = tilemap_create(tc480_get_tile_info[0],tilemap_scan_rows,TILEMAP_TYPE_PEN,16,16,32,32);
3169      TC0480SCP_tilemap[1][0] = tilemap_create(tc480_get_tile_info[1],tilemap_scan_rows,TILEMAP_TYPE_PEN,16,16,32,32);
3170      TC0480SCP_tilemap[2][0] = tilemap_create(tc480_get_tile_info[2],tilemap_scan_rows,TILEMAP_TYPE_PEN,16,16,32,32);
3171      TC0480SCP_tilemap[3][0] = tilemap_create(tc480_get_tile_info[3],tilemap_scan_rows,TILEMAP_TYPE_PEN,16,16,32,32);
3172      TC0480SCP_tilemap[4][0] = tilemap_create(tc480_get_tile_info[4],tilemap_scan_rows,TILEMAP_TYPE_PEN,8,8,64,64);
3168      TC0480SCP_tilemap[0][0] = tilemap_create(tc480_get_tile_info[0],tilemap_scan_rows,16,16,32,32);
3169      TC0480SCP_tilemap[1][0] = tilemap_create(tc480_get_tile_info[1],tilemap_scan_rows,16,16,32,32);
3170      TC0480SCP_tilemap[2][0] = tilemap_create(tc480_get_tile_info[2],tilemap_scan_rows,16,16,32,32);
3171      TC0480SCP_tilemap[3][0] = tilemap_create(tc480_get_tile_info[3],tilemap_scan_rows,16,16,32,32);
3172      TC0480SCP_tilemap[4][0] = tilemap_create(tc480_get_tile_info[4],tilemap_scan_rows,8,8,64,64);
31733173
31743174      /* Double width versions */
3175      TC0480SCP_tilemap[0][1] = tilemap_create(tc480_get_tile_info[0],tilemap_scan_rows,TILEMAP_TYPE_PEN,16,16,64,32);
3176      TC0480SCP_tilemap[1][1] = tilemap_create(tc480_get_tile_info[1],tilemap_scan_rows,TILEMAP_TYPE_PEN,16,16,64,32);
3177      TC0480SCP_tilemap[2][1] = tilemap_create(tc480_get_tile_info[2],tilemap_scan_rows,TILEMAP_TYPE_PEN,16,16,64,32);
3178      TC0480SCP_tilemap[3][1] = tilemap_create(tc480_get_tile_info[3],tilemap_scan_rows,TILEMAP_TYPE_PEN,16,16,64,32);
3179      TC0480SCP_tilemap[4][1] = tilemap_create(tc480_get_tile_info[4],tilemap_scan_rows,TILEMAP_TYPE_PEN,8,8,64,64);
3175      TC0480SCP_tilemap[0][1] = tilemap_create(tc480_get_tile_info[0],tilemap_scan_rows,16,16,64,32);
3176      TC0480SCP_tilemap[1][1] = tilemap_create(tc480_get_tile_info[1],tilemap_scan_rows,16,16,64,32);
3177      TC0480SCP_tilemap[2][1] = tilemap_create(tc480_get_tile_info[2],tilemap_scan_rows,16,16,64,32);
3178      TC0480SCP_tilemap[3][1] = tilemap_create(tc480_get_tile_info[3],tilemap_scan_rows,16,16,64,32);
3179      TC0480SCP_tilemap[4][1] = tilemap_create(tc480_get_tile_info[4],tilemap_scan_rows,8,8,64,64);
31803180
31813181      TC0480SCP_ram = auto_malloc(TC0480SCP_RAM_SIZE);
31823182      TC0480SCP_char_dirty = auto_malloc(TC0480SCP_TOTAL_CHARS);
src/mame/video/namcos86.c
r1679r1680
126126
127127VIDEO_START( namcos86 )
128128{
129   bg_tilemap[0] = tilemap_create(get_tile_info0,tilemap_scan_rows,TILEMAP_TYPE_PEN,8,8,64,32);
130   bg_tilemap[1] = tilemap_create(get_tile_info1,tilemap_scan_rows,TILEMAP_TYPE_PEN,8,8,64,32);
131   bg_tilemap[2] = tilemap_create(get_tile_info2,tilemap_scan_rows,TILEMAP_TYPE_PEN,8,8,64,32);
132   bg_tilemap[3] = tilemap_create(get_tile_info3,tilemap_scan_rows,TILEMAP_TYPE_PEN,8,8,64,32);
129   bg_tilemap[0] = tilemap_create(get_tile_info0,tilemap_scan_rows,8,8,64,32);
130   bg_tilemap[1] = tilemap_create(get_tile_info1,tilemap_scan_rows,8,8,64,32);
131   bg_tilemap[2] = tilemap_create(get_tile_info2,tilemap_scan_rows,8,8,64,32);
132   bg_tilemap[3] = tilemap_create(get_tile_info3,tilemap_scan_rows,8,8,64,32);
133133
134134   tilemap_set_transparent_pen(bg_tilemap[0],7);
135135   tilemap_set_transparent_pen(bg_tilemap[1],7);
r1679r1680
360360
361361   fillbitmap(priority_bitmap, 0, cliprect);
362362
363   fillbitmap(bitmap,machine->remapped_colortable[machine->gfx[0]->color_base + 8*backcolor+7],cliprect);
363   fillbitmap(bitmap,machine->pens[machine->gfx[0]->color_base + 8*backcolor+7],cliprect);
364364
365365   for (layer = 0;layer < 8;layer++)
366366   {
src/mame/video/suna8.c
r1679r1680
184184
185185#if TILEMAPS
186186   bg_tilemap = tilemap_create(   get_tile_info, tilemap_scan_cols,
187                        TILEMAP_TYPE_PEN,
187
188188                        8,8,0x20*((suna8_text_dim > 0)?4:8),0x20);
189189
190190   tilemap_set_transparent_pen(bg_tilemap,15);
src/mame/video/nova2001.c
r1679r1680
1/*******************************************************************************
1#include "driver.h"
2#include "nova2001.h"
23
3     Nova 2001 - Video Description:
4     --------------------------------------------------------------------------
4UINT8 *nova2001_fg_videoram, *nova2001_bg_videoram;
55
6     Foreground Playfield Chars (static)
7        character code index from first set of chars
8     Foreground Playfield color modifier RAM
9        Char colors are normally taken from the first set of 16,
10        This is the pen for "color 1" for this tile (from the first 16 pens)
6static tilemap *bg_tilemap, *fg_tilemap;
117
12     Background Playfield Chars (scrolling)
13        character code index from second set of chars
14     Foreground Playfield color modifier RAM
15        Char colors are normally taken from the second set of 16,
16        This is the pen for "color 1" for this tile (from the second 16 pens)
17     (Scrolling in controlled via the 8910 A and B port outputs)
188
19     Sprite memory is made of 32 byte records:
9/*************************************
10 *
11 *  Palette handling
12 *
13 *************************************/
2014
21        Sprite+0, 0x80 = Sprite Bank
22        Sprite+0, 0x7f = Sprite Character Code
23        Sprite+1, 0xff = X location
24        Sprite+2, 0xff = Y location
25        Sprite+3, 0x20 = Y Flip
26        Sprite+3, 0x10 = X Flip
27        Sprite+3, 0x0f = pen for "color 1" taken from the first 16 colors
28    Sprite+3, 0x80
29    Sprite+3, 0x40
15PALETTE_INIT( nova2001 )
16{
17   int i;
3018
31     All the rest are unknown and/or uneccessary.
19   /* Color #1 is used for palette animation.          */
3220
33*******************************************************************************/
21   /* To handle this, color entries 0-15 are based on  */
22   /* the primary 16 colors, while color entries 16-31 */
23   /* are based on the secondary set.                  */
3424
35#include "driver.h"
25   /* The only difference between 0-15 and 16-31 is that */
26   /* color #1 changes each time */
3627
37UINT8 *nova2001_videoram2, *nova2001_colorram2;
38
39static tilemap *bg_tilemap, *fg_tilemap;
40
41PALETTE_INIT( nova2001 )
42{
43   int i,j;
44
45
46   for (i = 0;i < machine->drv->total_colors;i++)
28   for (i = 0; i < 0x200; ++i)
4729   {
30      int entry;
4831      int intensity,r,g,b;
4932
33      if ((i & 0xf) == 1)
34      {
35         entry = ((i & 0xf0) >> 4) | ((i & 0x100) >> 4);
36      }
37      else
38      {
39         entry = ((i & 0x0f) >> 0) | ((i & 0x100) >> 4);
40      }
5041
51      intensity = (*color_prom >> 0) & 0x03;
42      intensity = (color_prom[entry] >> 0) & 0x03;
5243      /* red component */
53      r = (((*color_prom >> 0) & 0x0c) | intensity) * 0x11;
44      r = (((color_prom[entry] >> 0) & 0x0c) | intensity) * 0x11;
5445      /* green component */
55      g = (((*color_prom >> 2) & 0x0c) | intensity) * 0x11;
46      g = (((color_prom[entry] >> 2) & 0x0c) | intensity) * 0x11;
5647      /* blue component */
57      b = (((*color_prom >> 4) & 0x0c) | intensity) * 0x11;
48      b = (((color_prom[entry] >> 4) & 0x0c) | intensity) * 0x11;
5849
5950      palette_set_color(machine,i,MAKE_RGB(r,g,b));
60      color_prom++;
6151   }
52}
6253
63   /* Color #1 is used for palette animation.          */
54WRITE8_HANDLER( ninjakun_paletteram_w )
55{
56   int i;
6457
65   /* To handle this, color entries 0-15 are based on  */
66   /* the primary 16 colors, while color entries 16-31 */
67   /* are based on the secondary set.                  */
58   paletteram_BBGGRRII_w(offset,data);
6859
69   /* The only difference among 0-15 and 16-31 is that */
70   /* color #1 changes each time */
60   // expand the sprite palette to full length
61   if (offset < 16)
62   {
63      paletteram_BBGGRRII_w(0x200 + offset * 16 + 1, data);
7164
72   for (i = 0;i < 16;i++)
73   {
74      for (j = 0;j < 16;j++)
65      if (offset != 1)
7566      {
76         if (j == 1)
67         for (i = 0; i < 16; i++)
7768         {
78            colortable[16*i+1] = i;
79            colortable[16*i+16*16+1] = i+16;
69            paletteram_BBGGRRII_w(0x200 + offset + i * 16, data);
8070         }
81         else
82         {
83            colortable[16*i+j] = j;
84            colortable[16*i+16*16+j] = j+16;
85         }
8671      }
8772   }
8873}
8974
90WRITE8_HANDLER( nova2001_videoram_w )
75
76
77/*************************************
78 *
79 *  Callbacks for the TileMap code
80 *
81 *************************************/
82
83static TILE_GET_INFO( nova2001_get_bg_tile_info )
9184{
92   videoram[offset] = data;
93   tilemap_mark_tile_dirty(bg_tilemap, offset);
85   int code = nova2001_bg_videoram[tile_index];
86   int color = nova2001_bg_videoram[tile_index + 0x400] & 0x0f;
87
88   SET_TILE_INFO(2, code, color, 0);
9489}
9590
96WRITE8_HANDLER( nova2001_colorram_w )
91static TILE_GET_INFO( nova2001_get_fg_tile_info )
9792{
98   colorram[offset] = data;
99   tilemap_mark_tile_dirty(bg_tilemap, offset);
93   int attr = nova2001_fg_videoram[tile_index + 0x400];
94   int code = nova2001_fg_videoram[tile_index];
95   int color = attr & 0x0f;
96
97   SET_TILE_INFO(1, code, color, 0);
98
99   tileinfo->category = (attr & 0x10) >> 4;
100100}
101101
102WRITE8_HANDLER( nova2001_videoram2_w )
102static TILE_GET_INFO( ninjakun_get_bg_tile_info )
103103{
104   nova2001_videoram2[offset] = data;
105   tilemap_mark_tile_dirty(fg_tilemap, offset);
104   int attr  = nova2001_bg_videoram[tile_index+0x400];
105   int code = nova2001_bg_videoram[tile_index] + ((attr & 0xc0) << 2);
106   int color = attr & 0x0f;
107
108   SET_TILE_INFO(2, code, color, 0);
106109}
107110
108WRITE8_HANDLER( nova2001_colorram2_w )
111static TILE_GET_INFO( ninjakun_get_fg_tile_info )
109112{
110   nova2001_colorram2[offset] = data;
111   tilemap_mark_tile_dirty(fg_tilemap, offset);
113   int attr = nova2001_fg_videoram[tile_index+0x400];
114   int code = nova2001_fg_videoram[tile_index] + ((attr & 0x20) << 3);
115   int color = attr & 0x0f;
116
117   SET_TILE_INFO(1, code, color, 0);
118
119   tileinfo->category = (attr & 0x10) >> 4;
112120}
113121
122static TILE_GET_INFO( pkunwar_get_bg_tile_info )
123{
124   int attr = nova2001_bg_videoram[tile_index + 0x400];
125   int code = nova2001_bg_videoram[tile_index] + ((attr & 0x07) << 8);
126   int color = (attr & 0xf0) >> 4;
127
128   SET_TILE_INFO(1, code, color, 0);
129
130   tileinfo->category = (attr & 0x08) >> 3;
131}
132
133static TILE_GET_INFO( raiders5_get_bg_tile_info )
134{
135   int attr = nova2001_bg_videoram[tile_index+0x400];
136   int code = nova2001_bg_videoram[tile_index] + ((attr & 0x01) << 8);
137   int color = (attr & 0xf0) >> 4;
138
139   SET_TILE_INFO(2, code, color, 0);
140}
141
142static TILE_GET_INFO( raiders5_get_fg_tile_info )
143{
144   int code = nova2001_fg_videoram[tile_index];
145   int color = (nova2001_fg_videoram[tile_index + 0x400] & 0xf0) >> 4;
146
147   SET_TILE_INFO(1, code, color, 0);
148}
149
150
151
152/*************************************
153 *
154 *  Video system start
155 *
156 *************************************/
157
158VIDEO_START( nova2001 )
159{
160   bg_tilemap = tilemap_create(nova2001_get_bg_tile_info, tilemap_scan_rows,  8, 8, 32, 32);
161   fg_tilemap = tilemap_create(nova2001_get_fg_tile_info, tilemap_scan_rows,  8, 8, 32, 32);
162   tilemap_set_transparent_pen(fg_tilemap, 0);
163   tilemap_set_scrolldx(bg_tilemap, 0, -7);
164}
165
166VIDEO_START( pkunwar )
167{
168   bg_tilemap = tilemap_create(pkunwar_get_bg_tile_info, tilemap_scan_rows,  8, 8, 32, 32);
169   tilemap_set_transparent_pen(bg_tilemap, 0);
170}
171
172VIDEO_START( ninjakun )
173{
174   bg_tilemap = tilemap_create(ninjakun_get_bg_tile_info, tilemap_scan_rows,  8, 8, 32, 32);
175   fg_tilemap = tilemap_create(ninjakun_get_fg_tile_info, tilemap_scan_rows,  8, 8, 32, 32);
176   tilemap_set_transparent_pen(fg_tilemap, 0);
177   tilemap_set_scrolldx(bg_tilemap, 7, 0);
178}
179
180VIDEO_START( raiders5 )
181{
182   bg_tilemap = tilemap_create(raiders5_get_bg_tile_info, tilemap_scan_rows,  8, 8, 32, 32);
183   fg_tilemap = tilemap_create(raiders5_get_fg_tile_info, tilemap_scan_rows,  8, 8, 32, 32);
184   tilemap_set_transparent_pen(fg_tilemap, 0);
185   tilemap_set_scrolldx(bg_tilemap, 7, 0);
186}
187
188
189
190/*************************************
191 *
192 *  Memory handlers
193 *
194 *************************************/
195
196WRITE8_HANDLER( nova2001_fg_videoram_w )
197{
198   nova2001_fg_videoram[offset] = data;
199   tilemap_mark_tile_dirty(fg_tilemap, offset & 0x3ff);
200}
201
202WRITE8_HANDLER( nova2001_bg_videoram_w )
203{
204   nova2001_bg_videoram[offset] = data;
205   tilemap_mark_tile_dirty(bg_tilemap,offset & 0x3ff);
206}
207
208WRITE8_HANDLER( ninjakun_bg_videoram_w )
209{
210   int x = tilemap_get_scrollx(bg_tilemap, 0) >> 3;
211   int y = tilemap_get_scrolly(bg_tilemap, 0) >> 3;
212
213   // add scroll registers to address
214   offset = ((offset + x + (y << 5)) & 0x3ff) + (offset & 0x400);
215
216   nova2001_bg_videoram[offset] = data;
217   tilemap_mark_tile_dirty(bg_tilemap,offset & 0x3ff);
218}
219
220READ8_HANDLER( ninjakun_bg_videoram_r )
221{
222   int x = tilemap_get_scrollx(bg_tilemap, 0) >> 3;
223   int y = tilemap_get_scrolly(bg_tilemap, 0) >> 3;
224
225   // add scroll registers to address
226   offset = ((offset + x + (y << 5)) & 0x3ff) + (offset & 0x400);
227
228   return nova2001_bg_videoram[offset];
229}
230
114231WRITE8_HANDLER( nova2001_scroll_x_w )
115232{
116   tilemap_set_scrollx(bg_tilemap, 0, data - (flip_screen ? 0 : 7));
233   tilemap_set_scrollx(bg_tilemap, 0, data);
117234}
118235
119236WRITE8_HANDLER( nova2001_scroll_y_w )
r1679r1680
123240
124241WRITE8_HANDLER( nova2001_flipscreen_w )
125242{
126   if (flip_screen != (~data & 0x01))
127   {
128      flip_screen_set(~data & 0x01);
129      tilemap_mark_all_tiles_dirty(ALL_TILEMAPS);
130   }
243   // inverted
244   flip_screen_set(~data & 1);
131245}
132246
133static TILE_GET_INFO( get_bg_tile_info )
247WRITE8_HANDLER( pkunwar_flipscreen_w )
134248{
135   int code = videoram[tile_index];
136   int color = colorram[tile_index] & 0x0f;
137
138   SET_TILE_INFO(1, code, color, 0);
249   flip_screen_set(data & 1);
139250}
140251
141static TILE_GET_INFO( get_fg_tile_info )
142{
143   int code = nova2001_videoram2[tile_index];
144   int color = nova2001_colorram2[tile_index] & 0x0f;
145252
146   SET_TILE_INFO(0, code, color, 0);
147}
148253
149VIDEO_START( nova2001 )
254/*************************************
255 *
256 *  Video update
257 *
258 *************************************/
259
260static void nova2001_draw_sprites(running_machine *machine, mame_bitmap *bitmap, const rectangle *cliprect )
150261{
151   bg_tilemap = tilemap_create(get_bg_tile_info, tilemap_scan_rows,
152      TILEMAP_TYPE_PEN, 8, 8, 32, 32);
262   const gfx_element *gfx = machine->gfx[0];
263   int offs;
153264
154   fg_tilemap = tilemap_create(get_fg_tile_info, tilemap_scan_rows,
155      TILEMAP_TYPE_PEN, 8, 8, 32, 32);
265   for (offs = 0; offs < 0x800; offs += 32)
266   {
267      int attr = spriteram[offs+3];
268      int flipx = attr & 0x10;
269      int flipy = attr & 0x20;
270      int sx = spriteram[offs+1] - ((attr & 0x40) << 2);   // high bit shown in schematics, not used by game
271      int sy = spriteram[offs+2];
272      int tile = spriteram[offs+0];
273      int color = attr & 0x0f;
156274
157   tilemap_set_transparent_pen(fg_tilemap, 0);
275      if (attr & 0x80)   // disable bit shown in schematics, not used by game
276      {
277         continue;
278      }
279
280      if (flip_screen)
281      {
282         sx = 240 - sx;
283         sy = 240 - sy;
284         flipx = !flipx;
285         flipy = !flipy;
286      }
287
288      drawgfx(bitmap, gfx,
289            tile,
290            color,
291            flipx, flipy,
292            sx, sy,
293            cliprect, TRANSPARENCY_PEN, 0);
294   }
158295}
159296
160static void draw_sprites(running_machine *machine, mame_bitmap *bitmap, const rectangle *cliprect )
297static void pkunwar_draw_sprites(running_machine *machine, mame_bitmap *bitmap, const rectangle *cliprect )
161298{
299   const gfx_element *gfx = machine->gfx[0];
162300   int offs;
163301
164   for (offs = 0;offs < spriteram_size;offs += 32)
302   for (offs = 0; offs < 0x800; offs += 32)
165303   {
166      int flipx = spriteram[offs+3] & 0x10;
167      int flipy = spriteram[offs+3] & 0x20;
304      int attr = spriteram[offs+3];
305      int flipx = spriteram[offs+0] & 0x01;
306      int flipy = spriteram[offs+0] & 0x02;
168307      int sx = spriteram[offs+1];
169308      int sy = spriteram[offs+2];
309      int tile = ((spriteram[offs+0] & 0xfc) >> 2) + ((attr & 0x07) << 6);
310      int color = (attr & 0xf0) >> 4;
170311
312      if (attr & 0x08)   // deducted by comparison, not used by game
313      {
314         continue;
315      }
316
171317      if (flip_screen)
172318      {
173319         sx = 240 - sx;
r1679r1680
176322         flipy = !flipy;
177323      }
178324
179      drawgfx(bitmap,machine->gfx[2 + ((spriteram[offs+0] & 0x80) >> 7)],
180         spriteram[offs+0] & 0x7f,
181         spriteram[offs+3] & 0x0f,
182         flipx,flipy,
183         sx,sy,
184         cliprect,TRANSPARENCY_PEN,0);
325      drawgfx(bitmap, gfx,
326            tile,
327            color,
328            flipx, flipy,
329            sx, sy,
330            cliprect, TRANSPARENCY_PEN, 0);
331
332      // there's no X MSB, so draw with wraparound (fixes title screen)
333      drawgfx(bitmap, gfx,
334            tile,
335            color,
336            flipx, flipy,
337            sx - 256, sy,
338            cliprect, TRANSPARENCY_PEN, 0);
185339   }
186340}
187341
342
343
188344VIDEO_UPDATE( nova2001 )
189345{
190346   tilemap_draw(bitmap, cliprect, bg_tilemap, 0, 0);
191   draw_sprites(machine, bitmap, cliprect);
347
348   nova2001_draw_sprites(machine, bitmap, cliprect);
349
350   // according to the schematics, fg category 0 should be drawn behind sprites,
351   // but it doesn't look right that way
192352   tilemap_draw(bitmap, cliprect, fg_tilemap, 0, 0);
353   tilemap_draw(bitmap, cliprect, fg_tilemap, 1, 0);
354
193355   return 0;
194356}
357
358VIDEO_UPDATE( pkunwar )
359{
360   tilemap_draw(bitmap, cliprect, bg_tilemap, TILEMAP_DRAW_OPAQUE | 0, 0);
361   tilemap_draw(bitmap, cliprect, bg_tilemap, TILEMAP_DRAW_OPAQUE | 1, 0);
362
363   pkunwar_draw_sprites(machine, bitmap, cliprect);
364
365   tilemap_draw(bitmap, cliprect, bg_tilemap, 1, 0);
366
367   return 0;
368}
369
370VIDEO_UPDATE( ninjakun )
371{
372   tilemap_draw(bitmap, cliprect, bg_tilemap, 0, 0);
373
374   tilemap_draw(bitmap, cliprect, fg_tilemap, 1, 0);
375
376   nova2001_draw_sprites(machine, bitmap, cliprect);
377
378   tilemap_draw(bitmap, cliprect, fg_tilemap, 0, 0);
379
380   return 0;
381}
382
383VIDEO_UPDATE( raiders5 )
384{
385   tilemap_draw(bitmap, cliprect, bg_tilemap, 0, 0);
386
387   pkunwar_draw_sprites(machine, bitmap, cliprect);
388
389   tilemap_draw(bitmap, cliprect, fg_tilemap, 0, 0);
390
391   return 0;
392}
src/mame/video/cps1.c
r1679r1680
11421142
11431143    MACHINE_RESET_CALL(cps);
11441144
1145   cps1_bg_tilemap[0] = tilemap_create(get_tile0_info,tilemap0_scan,TILEMAP_TYPE_PEN, 8, 8,64,64);
1146   cps1_bg_tilemap[1] = tilemap_create(get_tile1_info,tilemap1_scan,TILEMAP_TYPE_PEN,16,16,64,64);
1147   cps1_bg_tilemap[2] = tilemap_create(get_tile2_info,tilemap2_scan,TILEMAP_TYPE_PEN,32,32,64,64);
1145   cps1_bg_tilemap[0] = tilemap_create(get_tile0_info,tilemap0_scan, 8, 8,64,64);
1146   cps1_bg_tilemap[1] = tilemap_create(get_tile1_info,tilemap1_scan,16,16,64,64);
1147   cps1_bg_tilemap[2] = tilemap_create(get_tile2_info,tilemap2_scan,32,32,64,64);
11481148
11491149   /* front masks will change at runtime to handle sprite occluding */
11501150   cps1_update_transmasks();
src/mame/video/yunsun16.c
r1679r1680
102102VIDEO_START( yunsun16 )
103103{
104104   tilemap_0 = tilemap_create(   get_tile_info_0,yunsun16_tilemap_scan_pages,
105                        TILEMAP_TYPE_PEN,
105
106106                        16,16,
107107                        TILES_PER_PAGE_X*PAGES_PER_TMAP_X,TILES_PER_PAGE_Y*PAGES_PER_TMAP_Y);
108108
109109   tilemap_1 = tilemap_create(   get_tile_info_1,yunsun16_tilemap_scan_pages,
110                        TILEMAP_TYPE_PEN,
110
111111                        16,16,
112112                        TILES_PER_PAGE_X*PAGES_PER_TMAP_X,TILES_PER_PAGE_Y*PAGES_PER_TMAP_Y);
113113
src/mame/video/stactics.c
r1679r1680
4545
4646---
4747
48As if this wasn't enough, there are also "3D" fire beams made
49of 120 green LED's which are on a mechanism in front of the mirror.
50Along with a single red "sight" LED.  I am reading in the sequence
51ROMS and building up a character set to simulate the LEDS with
52conventional character graphics.
53
54Finally, there is a score display made of 7-segment LEDS, along
55with Credits, Barriers, and Rounds displays made of some other
56type of LED bar graphs.  I'm displaying them the best I can on the
57bottom line of the screen
58
5948***************************************************************************/
6049
6150#include "driver.h"
r1679r1680
7160int stactics_shot_arrive;
7261
7362/* These are needed by driver/stactics.c   */
74UINT8 *stactics_scroll_ram;
7563UINT8 *stactics_videoram_b;
76UINT8 *stactics_chardata_b;
7764UINT8 *stactics_videoram_d;
78UINT8 *stactics_chardata_d;
7965UINT8 *stactics_videoram_e;
80UINT8 *stactics_chardata_e;
8166UINT8 *stactics_videoram_f;
82UINT8 *stactics_chardata_f;
67UINT8 *stactics_palette;
8368UINT8 *stactics_display_buffer;
69UINT8 *stactics_lamps;
8470
85static UINT8 *dirty_videoram_b;
86static UINT8 *dirty_chardata_b;
87static UINT8 *dirty_videoram_d;
88static UINT8 *dirty_chardata_d;
89static UINT8 *dirty_videoram_e;
90static UINT8 *dirty_chardata_e;
91static UINT8 *dirty_videoram_f;
92static UINT8 *dirty_chardata_f;
71static UINT8 y_scroll_d;
72static UINT8 y_scroll_e;
73static UINT8 y_scroll_f;
9374
94static int d_offset;
95static int e_offset;
96static int f_offset;
75static UINT16 beam_state;
76static UINT16 old_beam_state;
77static UINT16 beam_states_per_frame;
9778
98static int palette_select;
9979
100static mame_bitmap *tmpbitmap2;
101static mame_bitmap *bitmap_B;
102static mame_bitmap *bitmap_D;
103static mame_bitmap *bitmap_E;
104static mame_bitmap *bitmap_F;
10580
106static UINT8 *beamdata;
107static int states_per_frame;
108
109#define DIRTY_CHARDATA_SIZE  0x100
110#define BEAMDATA_SIZE        0x800
111
112/* The first 16 came from the 7448 BCD to 7-segment decoder data sheet */
113/* The rest are made up */
114
115static const UINT8 stactics_special_chars[32*8] = {
116    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,   /* Space */
117    0x80, 0x80, 0x80, 0xf0, 0x80, 0x80, 0xf0, 0x00,   /* extras... */
118    0xf0, 0x80, 0x80, 0xf0, 0x00, 0x00, 0xf0, 0x00,   /* extras... */
119    0x90, 0x90, 0x90, 0xf0, 0x00, 0x00, 0x00, 0x00,   /* extras... */
120    0x00, 0x00, 0x00, 0xf0, 0x10, 0x10, 0xf0, 0x00,   /* extras... */
121    0x00, 0x00, 0x00, 0xf0, 0x80, 0x80, 0xf0, 0x00,   /* extras... */
122    0xf0, 0x90, 0x90, 0xf0, 0x10, 0x10, 0xf0, 0x00,   /* 9 */
123    0xf0, 0x90, 0x90, 0xf0, 0x90, 0x90, 0xf0, 0x00,   /* 8 */
124    0xf0, 0x10, 0x10, 0x10, 0x10, 0x10, 0x10, 0x00,   /* 7 */
125    0xf0, 0x80, 0x80, 0xf0, 0x90, 0x90, 0xf0, 0x00,   /* 6 */
126    0xf0, 0x80, 0x80, 0xf0, 0x10, 0x10, 0xf0, 0x00,   /* 5 */
127    0x90, 0x90, 0x90, 0xf0, 0x10, 0x10, 0x10, 0x00,   /* 4 */
128    0xf0, 0x10, 0x10, 0xf0, 0x10, 0x10, 0xf0, 0x00,   /* 3 */
129    0xf0, 0x10, 0x10, 0xf0, 0x80, 0x80, 0xf0, 0x00,   /* 2 */
130    0x10, 0x10, 0x10, 0x10, 0x10, 0x10, 0x10, 0x00,   /* 1 */
131    0xf0, 0x90, 0x90, 0x90, 0x90, 0x90, 0xf0, 0x00,   /* 0 */
132
133    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,   /* Space */
134    0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,   /* 1 pip */
135    0x60, 0x90, 0x80, 0x60, 0x10, 0x90, 0x60, 0x00,   /* S for Score */
136    0x80, 0x00, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00,   /* 2 pips */
137    0x80, 0x00, 0x80, 0x00, 0x80, 0x00, 0x00, 0x00,   /* 3 pips */
138    0x60, 0x90, 0x80, 0x80, 0x80, 0x90, 0x60, 0x00,   /* C for Credits */
139    0xe0, 0x90, 0x90, 0xe0, 0x90, 0x90, 0xe0, 0x00,   /* B for Barriers */
140    0xe0, 0x90, 0x90, 0xe0, 0xc0, 0xa0, 0x90, 0x00,   /* R for Rounds */
141    0x80, 0x00, 0x80, 0x00, 0x80, 0x00, 0x80, 0x00,   /* 4 pips */
142    0x00, 0x60, 0x60, 0x00, 0x60, 0x60, 0x00, 0x00,   /* Colon */
143    0x40, 0xe0, 0x40, 0x00, 0x00, 0x00, 0x00, 0x00,   /* Sight */
144    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,   /* Space (Unused) */
145    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,   /* Space (Unused) */
146    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,   /* Space (Unused) */
147    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,   /* Space (Unused) */
148    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00    /* Space */
149};
150
151
152static int firebeam_state;
153static int old_firebeam_state;
154
15581PALETTE_INIT( stactics )
15682{
157    int i,j;
83   int i;
15884
159    for (i=0;i<16;i++)
160    {
161        int bit0,bit1,bit2, bit3,r,g,b;
85   for (i = 0; i < 0x400; i++)
86   {
87      int bit0 = (color_prom[i] >> 0) & 0x01;
88      int bit1 = (color_prom[i] >> 1) & 0x01;
89      int bit2 = (color_prom[i] >> 2) & 0x01;
90      int bit3 = (color_prom[i] >> 3) & 0x01;
16291
163        bit0 = i & 1;
164        bit1 = (i >> 1) & 1;
165        bit2 = (i >> 2) & 1;
166        bit3 = (i >> 3) & 1;
92      /* red component */
93      int r = 0xff * bit0;
16794
168        /* red component */
169        r = 0xff * bit0;
95      /* green component */
96      int g = 0xff * bit1 - 0xcc * bit3;
17097
171        /* green component */
172        g = 0xff * bit1 - 0xcc * bit3;
98      /* blue component */
99      int b = 0xff * bit2;
173100
174        /* blue component */
175        b = 0xff * bit2;
176
177      palette_set_color(machine,i,MAKE_RGB(r,g,b));
178    }
179
180    /* The color prom in Space Tactics is used for both   */
181    /* color codes, and priority layering of the 4 layers */
182
183    /* Since we are taking care of the layering by our    */
184    /* drawing order, we don't need all of the color prom */
185    /* entries */
186
187    /* For each of 4 color schemes */
188    for(i=0;i<4;i++)
189    {
190        /* For page B - Alphanumerics and alien shots */
191        for(j=0;j<16;j++)
192        {
193            *(colortable++) = 0;
194            *(colortable++) = color_prom[i*0x100+0x01*0x10+j];
195        }
196        /* For page F - Close Aliens (these are all the same color) */
197        for(j=0;j<16;j++)
198        {
199            *(colortable++) = 0;
200            *(colortable++) = color_prom[i*0x100+0x02*0x10];
201        }
202        /* For page E - Medium Aliens (these are all the same color) */
203        for(j=0;j<16;j++)
204        {
205            *(colortable++) = 0;
206            *(colortable++) = color_prom[i*0x100+0x04*0x10+j];
207        }
208        /* For page D - Far Aliens (these are all the same color) */
209        for(j=0;j<16;j++)
210        {
211            *(colortable++) = 0;
212            *(colortable++) = color_prom[i*0x100+0x08*0x10+j];
213        }
214    }
101      palette_set_color(machine, i, MAKE_RGB(r, g, b));
102   }
215103}
216104
217105/***************************************************************************
r1679r1680
222110
223111VIDEO_START( stactics )
224112{
225    int i,j;
226    const UINT8 *firebeam_data;
227    UINT8 firechar[256*8*9];
113   y_scroll_d = 0;
114   y_scroll_e = 0;
115   y_scroll_f = 0;
228116
229    tmpbitmap  = auto_bitmap_alloc(machine->screen[0].width,machine->screen[0].height,machine->screen[0].format);
230    tmpbitmap2 = auto_bitmap_alloc(machine->screen[0].width,machine->screen[0].height,machine->screen[0].format);
231    bitmap_B = auto_bitmap_alloc(machine->screen[0].width,machine->screen[0].height,machine->screen[0].format);
232    bitmap_D = auto_bitmap_alloc(machine->screen[0].width,machine->screen[0].height,machine->screen[0].format);
233    bitmap_E = auto_bitmap_alloc(machine->screen[0].width,machine->screen[0].height,machine->screen[0].format);
234    bitmap_F = auto_bitmap_alloc(machine->screen[0].width,machine->screen[0].height,machine->screen[0].format);
117   stactics_vblank_count = 0;
118   stactics_shot_standby = 1;
119   stactics_shot_arrive = 0;
120   beam_state = 0;
121   old_beam_state = 0;
235122
236   /* Allocate dirty buffers */
237   dirty_videoram_b = auto_malloc(videoram_size);
238   dirty_videoram_d = auto_malloc(videoram_size);
239   dirty_videoram_e = auto_malloc(videoram_size);
240   dirty_videoram_f = auto_malloc(videoram_size);
241   dirty_chardata_b = auto_malloc(DIRTY_CHARDATA_SIZE);
242   dirty_chardata_d = auto_malloc(DIRTY_CHARDATA_SIZE);
243   dirty_chardata_e = auto_malloc(DIRTY_CHARDATA_SIZE);
244   dirty_chardata_f = auto_malloc(DIRTY_CHARDATA_SIZE);
245
246    memset(dirty_videoram_b,1,videoram_size);
247    memset(dirty_videoram_d,1,videoram_size);
248    memset(dirty_videoram_e,1,videoram_size);
249    memset(dirty_videoram_f,1,videoram_size);
250    memset(dirty_chardata_b,1,DIRTY_CHARDATA_SIZE);
251    memset(dirty_chardata_d,1,DIRTY_CHARDATA_SIZE);
252    memset(dirty_chardata_e,1,DIRTY_CHARDATA_SIZE);
253    memset(dirty_chardata_f,1,DIRTY_CHARDATA_SIZE);
254
255    d_offset = 0;
256    e_offset = 0;
257    f_offset = 0;
258
259    palette_select = 0;
260    stactics_vblank_count = 0;
261    stactics_shot_standby = 1;
262    stactics_shot_arrive = 0;
263    firebeam_state = 0;
264    old_firebeam_state = 0;
265
266    /* Create a fake character set for LED fire beam */
267
268    memset(firechar,0,sizeof(firechar));
269    for(i=0;i<256;i++)
270    {
271        for(j=0;j<8;j++)
272        {
273            if ((i>>j)&0x01)
274            {
275                firechar[i*9+(7-j)]   |= (0x01<<(7-j));
276                firechar[i*9+(7-j)+1] |= (0x01<<(7-j));
277            }
278        }
279    }
280
281    for(i=0;i<256;i++)
282    {
283        decodechar(machine->gfx[4],
284                   i,
285                   firechar);
286    }
287
288    /* Decode the Fire Beam ROM for later      */
289    /* (I am basically just juggling the bytes */
290    /* and storing it again to make it easier) */
291
292   beamdata = auto_malloc(BEAMDATA_SIZE);
293
294    firebeam_data = memory_region(REGION_GFX1);
295
296    for(i=0;i<256;i++)
297    {
298        beamdata[i*8]   = firebeam_data[i                   ];
299        beamdata[i*8+1] = firebeam_data[i + 1024            ];
300        beamdata[i*8+2] = firebeam_data[i              + 256];
301        beamdata[i*8+3] = firebeam_data[i + 1024       + 256];
302        beamdata[i*8+4] = firebeam_data[i        + 512      ];
303        beamdata[i*8+5] = firebeam_data[i + 1024 + 512      ];
304        beamdata[i*8+6] = firebeam_data[i        + 512 + 256];
305        beamdata[i*8+7] = firebeam_data[i + 1024 + 512 + 256];
306    }
307
308    /* Build some characters for simulating the LED displays */
309
310    for(i=0;i<32;i++)
311    {
312        decodechar(machine->gfx[5],
313                   i,
314                   stactics_special_chars);
315    }
316
317    stactics_vblank_count = 0;
318    stactics_vert_pos = 0;
319    stactics_horiz_pos = 0;
320    *stactics_motor_on = 0;
123   stactics_vblank_count = 0;
124   stactics_vert_pos = 0;
125   stactics_horiz_pos = 0;
126   *stactics_motor_on = 0;
321127}
322128
323129
324WRITE8_HANDLER( stactics_palette_w )
130WRITE8_HANDLER( stactics_scroll_ram_w )
325131{
326    int old_palette_select = palette_select;
132   switch ((offset & 0x700) >> 8)
133   {
134      case 4:  // Page D
135         if (data&0x01)
136            y_scroll_d = offset&0xff;
137         break;
327138
328    switch (offset)
329    {
330        case 0:
331            palette_select = (palette_select & 0x02) | (data&0x01);
332            break;
333        case 1:
334            palette_select = (palette_select & 0x01) | ((data&0x01)<<1);
335            break;
336        default:
337            return;
338    }
139      case 5:  // Page E
140         if (data&0x01)
141            y_scroll_e = offset&0xff;
142         break;
339143
340    if (old_palette_select != palette_select)
341    {
342        memset(dirty_videoram_b,1,videoram_size);
343        memset(dirty_videoram_d,1,videoram_size);
344        memset(dirty_videoram_e,1,videoram_size);
345        memset(dirty_videoram_f,1,videoram_size);
144      case 6:  // Page F
145         if (data&0x01)
146            y_scroll_f = offset&0xff;
147         break;
346148    }
347    return;
348149}
349150
350
351WRITE8_HANDLER( stactics_scroll_ram_w )
352{
353    int temp;
354
355    if (stactics_scroll_ram[offset] != data)
356    {
357        stactics_scroll_ram[offset] = data;
358        temp = (offset&0x700)>>8;
359        switch(temp)
360        {
361            case 4:  // Page D
362            {
363                if (data&0x01)
364                    d_offset = offset&0xff;
365                break;
366            }
367            case 5:  // Page E
368            {
369                if (data&0x01)
370                    e_offset = offset&0xff;
371                break;
372            }
373            case 6:  // Page F
374            {
375                if (data&0x01)
376                    f_offset = offset&0xff;
377                break;
378            }
379        }
380    }
381}
382
383151WRITE8_HANDLER( stactics_speed_latch_w )
384152{
385    /* This writes to a shift register which is clocked by   */
386    /* a 555 oscillator.  This value determines the speed of */
387    /* the LED fire beams as follows:                        */
153   /* This writes to a shift register which is clocked by   */
154   /* a 555 oscillator.  This value determines the speed of */
155   /* the LED fire beams as follows:                        */
388156
389    /*   555_freq / bits_in_SR * edges_in_SR / states_in_PR67 / frame_rate */
390    /*      = num_led_states_per_frame  */
391    /*   36439 / 8 * x / 32 / 60 ~= 19/8*x */
157   /*   555_freq / bits_in_SR * edges_in_SR / states_in_PR67 / frame_rate */
158   /*      = num_led_states_per_frame  */
159   /*   36439 / 8 * x / 32 / 60 ~= 19/8*x */
392160
393    /* Here, we will count the number of rising edges in the shift register */
161   /* Here, we will count the number of rising edges in the shift register */
394162
395    int i;
396    int num_rising_edges = 0;
163   int i;
164   int num_rising_edges = 0;
397165
398    for(i=0;i<8;i++)
399    {
400        if ( (((data>>i)&0x01) == 1) && (((data>>((i+1)%8))&0x01) == 0))
401            num_rising_edges++;
402    }
166   for(i=0;i<8;i++)
167   {
168      if ( (((data>>i)&0x01) == 1) && (((data>>((i+1)%8))&0x01) == 0))
169         num_rising_edges++;
170   }
403171
404    states_per_frame = num_rising_edges*19/8;
172   beam_states_per_frame = num_rising_edges*19/8;
405173}
406174
407175WRITE8_HANDLER( stactics_shot_trigger_w )
408176{
409    stactics_shot_standby = 0;
177   stactics_shot_standby = 0;
410178}
411179
412180WRITE8_HANDLER( stactics_shot_flag_clear_w )
413181{
414    stactics_shot_arrive = 0;
182   stactics_shot_arrive = 0;
415183}
416184
417WRITE8_HANDLER( stactics_videoram_b_w )
418{
419    if (stactics_videoram_b[offset] != data)
420    {
421        stactics_videoram_b[offset] = data;
422        dirty_videoram_b[offset] = 1;
423    }
424}
425185
426WRITE8_HANDLER( stactics_chardata_b_w )
427{
428    if (stactics_chardata_b[offset] != data)
429    {
430        stactics_chardata_b[offset] = data;
431        dirty_chardata_b[offset>>3] = 1;
432    }
433}
434186
435WRITE8_HANDLER( stactics_videoram_d_w )
187static void update_beam(void)
436188{
437    if (stactics_videoram_d[offset] != data)
438    {
439        stactics_videoram_d[offset] = data;
440        dirty_videoram_d[offset] = 1;
441    }
442}
189   /* An LED fire beam! */
190   /* (There were 120 green LEDS mounted in the cabinet in the game, */
191   /*  and one red one, for the sight)                               */
443192
444WRITE8_HANDLER( stactics_chardata_d_w )
445{
446    if (stactics_chardata_d[offset] != data)
447    {
448        stactics_chardata_d[offset] = data;
449        dirty_chardata_d[offset>>3] = 1;
450    }
451}
193   /* First, update the firebeam state */
452194
453WRITE8_HANDLER( stactics_videoram_e_w )
454{
455    if (stactics_videoram_e[offset] != data)
456    {
457        stactics_videoram_e[offset] = data;
458        dirty_videoram_e[offset] = 1;
459    }
460}
195   old_beam_state = beam_state;
196   if (stactics_shot_standby == 0)
197      beam_state = beam_state + beam_states_per_frame;
461198
462WRITE8_HANDLER( stactics_chardata_e_w )
463{
464    if (stactics_chardata_e[offset] != data)
465    {
466        stactics_chardata_e[offset] = data;
467        dirty_chardata_e[offset>>3] = 1;
468    }
469}
199   /* These are thresholds for the two shots from the LED fire ROM */
200   /* (Note: There are two more for sound triggers, */
201   /*        whenever that gets implemented)        */
202   if ((old_beam_state < 0x8b) & (beam_state >= 0x8b))
203      stactics_shot_arrive = 1;
470204
471WRITE8_HANDLER( stactics_videoram_f_w )
472{
473    if (stactics_videoram_f[offset] != data)
474    {
475        stactics_videoram_f[offset] = data;
476        dirty_videoram_f[offset] = 1;
477    }
478}
205   if ((old_beam_state < 0xca) & (beam_state >= 0xca))
206      stactics_shot_arrive = 1;
479207
480WRITE8_HANDLER( stactics_chardata_f_w )
481{
482    if (stactics_chardata_f[offset] != data)
483    {
484        stactics_chardata_f[offset] = data;
485        dirty_chardata_f[offset>>3] = 1;
486    }
208   if (beam_state >= 0x100)
209   {
210      beam_state = 0;
211      stactics_shot_standby = 1;
212   }
487213}
488214
489/* Actual area for visible monitor stuff is only 30*8 lines */
490/* The rest is used for the score, etc. */
491215
492static const rectangle visible_screen_area = {0*8, 32*8, 0*8, 30*8};
493216
494VIDEO_UPDATE( stactics )
217INLINE int get_pixel_on_plane(UINT8 *videoram, UINT8 y, UINT8 x, UINT8 y_scroll)
495218{
496    int offs, sx, sy, i;
497    int char_number;
498    int color_code;
499    int pixel_x, pixel_y;
219   UINT8 code;
220   UINT8 gfx;
500221
501    int palette_offset = palette_select * 64;
222   /* compute effective row */
223   y = y - y_scroll;
502224
503    for(offs=0x400-1; offs>=0; offs--)
504    {
505        sx = offs%32;
506        sy = offs/32;
225   /* get the character code at the given pixel */
226   code = videoram[((y >> 3) << 5) | (x >> 3)];
507227
508        color_code = palette_offset + (stactics_videoram_b[offs]>>4);
228   /* get the gfx byte */
229   gfx = videoram[0x800 | (code << 3) | (y & 0x07)];
509230
510        /* Draw aliens in Page D */
231   /* return the appropriate pixel within the byte */
232   return (gfx >> (~x & 0x07)) & 0x01;
233}
511234
512        char_number = stactics_videoram_d[offs];
513235
514        if (dirty_chardata_d[char_number] == 1)
515        {
516            decodechar(machine->gfx[3],
517                       char_number,
518                       stactics_chardata_d);
519            dirty_chardata_d[char_number] = 2;
520            dirty_videoram_d[offs] = 1;
521        }
522        else if (dirty_chardata_d[char_number] == 2)
523        {
524            dirty_videoram_d[offs] = 1;
525        }
236static void draw_background(mame_bitmap *bitmap, const rectangle *cliprect, const pen_t *pens)
237{
238   int y;
526239
527        if (dirty_videoram_d[offs])
528        {
529            drawgfx(bitmap_D,machine->gfx[3],
530                    char_number,
531                    color_code,
532                    0,0,
533                    sx*8,sy*8,
534                    cliprect,TRANSPARENCY_NONE,0);
535            dirty_videoram_d[offs] = 0;
536        }
240   fillbitmap(bitmap, pens[0], cliprect);
537241
538        /* Draw aliens in Page E */
242   /* for every row */
243   for (y = 0; y < 0x100; y++)
244   {
245      int x;
539246
540        char_number = stactics_videoram_e[offs];
247      /* for every pixel on the row */
248      for (x = 0; x < 0x100; x++)
249      {
250         /* get the pixels for the four planes */
251         int pixel_b = get_pixel_on_plane(stactics_videoram_b, y, x, 0);
252         int pixel_d = get_pixel_on_plane(stactics_videoram_d, y, x, y_scroll_d);
253         int pixel_e = get_pixel_on_plane(stactics_videoram_e, y, x, y_scroll_e);
254         int pixel_f = get_pixel_on_plane(stactics_videoram_f, y, x, y_scroll_f);
541255
542        if (dirty_chardata_e[char_number] == 1)
543        {
544            decodechar(machine->gfx[2],
545                       char_number,
546                       stactics_chardata_e);
547            dirty_chardata_e[char_number] = 2;
548            dirty_videoram_e[offs] = 1;
549        }
550        else if (dirty_chardata_e[char_number] == 2)
551        {
552            dirty_videoram_e[offs] = 1;
553        }
256         /* get the color for this pixel */
257         UINT8 color = stactics_videoram_b[((y >> 3) << 5) | (x >> 3)] >> 4;
554258
555        if (dirty_videoram_e[offs])
556        {
557            drawgfx(bitmap_E,machine->gfx[2],
558                    char_number,
559                    color_code,
560                    0,0,
561                    sx*8,sy*8,
562                    cliprect,TRANSPARENCY_NONE,0);
563            dirty_videoram_e[offs] = 0;
564        }
259         /* assemble the pen index */
260         int pen = color |
261                 (pixel_b << 4) |
262                 (pixel_f << 5) |
263                 (pixel_e << 6) |
264                 (pixel_d << 7) |
265                 ((stactics_palette[0] & 0x01) << 8) |
266                 ((stactics_palette[1] & 0x01) << 9);
565267
566        /* Draw aliens in Page F */
268         /* compute the effective pixel coordinate after adjusting for the
269               mirror movement - this is mechanical on the real machine */
270         int sy = y + stactics_vert_pos;
271         int sx = x - stactics_horiz_pos;
567272
568        char_number = stactics_videoram_f[offs];
273         /* plot if visible */
274         if ((sy >= 0) && (sy < 0x100) && (sx >= 0) && (sx < 0x100))
275            *BITMAP_ADDR16(bitmap, sy, sx) = pens[pen];
276      }
277   }
278}
569279
570        if (dirty_chardata_f[char_number] == 1)
571        {
572            decodechar(machine->gfx[1],
573                       char_number,
574                       stactics_chardata_f);
575            dirty_chardata_f[char_number] = 2;
576            dirty_videoram_f[offs] = 1;
577        }
578        else if (dirty_chardata_f[char_number] == 2)
579        {
580            dirty_videoram_f[offs] = 1;
581        }
582280
583        if (dirty_videoram_f[offs])
584        {
585            drawgfx(bitmap_F,machine->gfx[1],
586                    char_number,
587                    color_code,
588                    0,0,
589                    sx*8,sy*8,
590                    cliprect,TRANSPARENCY_NONE,0);
591            dirty_videoram_f[offs] = 0;
592        }
281static void set_indicator_leds(int data, const char *output_name, int base_index)
282{
283   /* from 7448 datasheet */
284   static const int to_7seg[0x10] =
285   {
286      0x7e, 0x30, 0x6d, 0x79, 0x33, 0x5b, 0x1f, 0x70,
287      0x7f, 0x73, 0x0d, 0x19, 0x23, 0x4b, 0x0f, 0x00
288   };
593289
594        /* Draw the page B stuff */
290   /* decode the data */
291   data = to_7seg[(data ^ 0x0f) & 0x0f];
595292
596        char_number = stactics_videoram_b[offs];
293   /* set the 4 LEDs */
294   output_set_indexed_value(output_name, base_index + 0, (data >> 4) & 0x01);
295   output_set_indexed_value(output_name, base_index + 1, (data >> 0) & 0x01);
296   output_set_indexed_value(output_name, base_index + 2, (data >> 1) & 0x01);
297   output_set_indexed_value(output_name, base_index + 3, (data >> 2) & 0x01);
298}
597299
598        if (dirty_chardata_b[char_number] == 1)
599        {
600            decodechar(machine->gfx[0],
601                       char_number,
602                       stactics_chardata_b);
603            dirty_chardata_b[char_number] = 2;
604            dirty_videoram_b[offs] = 1;
605        }
606        else if (dirty_chardata_b[char_number] == 2)
607        {
608            dirty_videoram_b[offs] = 1;
609        }
610300
611        if (dirty_videoram_b[offs])
612        {
613            drawgfx(bitmap_B,machine->gfx[0],
614                    char_number,
615                    color_code,
616                    0,0,
617                    sx*8,sy*8,
618                    cliprect,TRANSPARENCY_NONE,0);
619            dirty_videoram_b[offs] = 0;
620        }
301static void update_artwork(void)
302{
303   int i;
304   UINT8 *beam_region = memory_region(REGION_USER1);
621305
622    }
306   /* set the lamps first */
307   output_set_indexed_value("base_lamp", 4, stactics_lamps[0] & 0x01);
308   output_set_indexed_value("base_lamp", 3, stactics_lamps[1] & 0x01);
309   output_set_indexed_value("base_lamp", 2, stactics_lamps[2] & 0x01);
310   output_set_indexed_value("base_lamp", 1, stactics_lamps[3] & 0x01);
311   output_set_indexed_value("base_lamp", 0, stactics_lamps[4] & 0x01);
312   output_set_value("start_lamp",   stactics_lamps[5] & 0x01);
313   output_set_value("barrier_lamp", stactics_lamps[6] & 0x01);  /* this needs to flash on/off, not implemented */
623314
624    /* Now, composite the four layers together */
315   /* laser beam - loop for each LED */
316   for (i = 0; i < 0x40; i++)
317   {
318      offs_t beam_data_offs;
319      UINT8 beam_data;
320      int on;
625321
626    copyscrollbitmap      (tmpbitmap2,bitmap_D,0,0,1,&d_offset,NULL);
627    copyscrollbitmap_trans(tmpbitmap2,bitmap_E,0,0,1,&e_offset,NULL,machine->pens[0]);
628    copyscrollbitmap_trans(tmpbitmap2,bitmap_F,0,0,1,&f_offset,NULL,machine->pens[0]);
629    copybitmap_trans      (tmpbitmap2,bitmap_B,0,0,0,0,NULL,machine->pens[0]);
322      beam_data_offs = ((i & 0x08) << 7) | ((i & 0x30) << 4) | beam_state;
323      beam_data = beam_region[beam_data_offs];
324      on = (beam_data >> (i & 0x07)) & 0x01;
630325
631    /* Now flip X & simulate the monitor motion */
632    fillbitmap(bitmap, machine->pens[0], cliprect);
633    copybitmap(bitmap,tmpbitmap2,1,0,stactics_horiz_pos,stactics_vert_pos,&visible_screen_area);
326      output_set_indexed_value("beam_led_left", i, on);
327      output_set_indexed_value("beam_led_right", i, on);
328   }
634329
635    /* Finally, draw stuff that is on the console or on top of the monitor (LED's) */
330   /* sight LED */
331   output_set_value("sight_led", *stactics_motor_on & 0x01);
636332
637    /***** Draw Score Display *****/
333   /* score display */
334   for (i = 0x01; i < 0x07; i++)
335      output_set_indexed_value("score_7seg", i - 1, ~stactics_display_buffer[i] & 0x0f);
638336
639    pixel_x = 16;
640    pixel_y = 248;
337   /* credits indicator */
338   set_indicator_leds(stactics_display_buffer[0x07], "credit_led", 0x00);
339   set_indicator_leds(stactics_display_buffer[0x08], "credit_led", 0x04);
641340
642    /* Draw an S */
643    drawgfx(bitmap,machine->gfx[5],
644            18,
645            0,
646            0,0,
647            pixel_x,pixel_y,
648            cliprect,TRANSPARENCY_NONE,0);
649    pixel_x+=6;
650    /* Draw a colon */
651    drawgfx(bitmap,machine->gfx[5],
652            25,
653            0,
654            0,0,
655            pixel_x,pixel_y,
656            cliprect,TRANSPARENCY_NONE,0);
657    pixel_x+=6;
658    /* Draw the digits */
659    for(i=1;i<7;i++)
660    {
661        drawgfx(bitmap,machine->gfx[5],
662                stactics_display_buffer[i]&0x0f,
663                16,
664                0,0,
665                pixel_x,pixel_y,
666                cliprect,TRANSPARENCY_NONE,0);
667        pixel_x+=6;
668    }
341   /* barriers indicator */
342   set_indicator_leds(stactics_display_buffer[0x09], "barrier_led", 0x00);
343   set_indicator_leds(stactics_display_buffer[0x0a], "barrier_led", 0x04);
344   set_indicator_leds(stactics_display_buffer[0x0b], "barrier_led", 0x08);
669345
670    /***** Draw Credits Indicator *****/
346   /* rounds indicator */
347   set_indicator_leds(stactics_display_buffer[0x0c], "round_led", 0x00);
348   set_indicator_leds(stactics_display_buffer[0x0d], "round_led", 0x04);
349   set_indicator_leds(stactics_display_buffer[0x0e], "round_led", 0x08);
350   set_indicator_leds(stactics_display_buffer[0x0f], "round_led", 0x0c);
351}
671352
672    pixel_x = 64+16;
673353
674    /* Draw a C */
675    drawgfx(bitmap,machine->gfx[5],
676            21,
677            0,
678            0,0,
679            pixel_x,pixel_y,
680            cliprect,TRANSPARENCY_NONE,0);
681    pixel_x+=6;
682    /* Draw a colon */
683    drawgfx(bitmap,machine->gfx[5],
684            25,
685            0,
686            0,0,
687            pixel_x,pixel_y,
688            cliprect,TRANSPARENCY_NONE,0);
689    pixel_x+=6;
690    /* Draw the pips */
691    for(i=7;i<9;i++)
692    {
693        drawgfx(bitmap,machine->gfx[5],
694                16 + (~stactics_display_buffer[i]&0x0f),
695                16,
696                0,0,
697                pixel_x,pixel_y,
698                cliprect,TRANSPARENCY_NONE,0);
699        pixel_x+=2;
700    }
354VIDEO_UPDATE( stactics )
355{
356   update_beam();
701357
702    /***** Draw Rounds Indicator *****/
358   /* update vblank counter */
359   stactics_vblank_count++;
703360
704    pixel_x = 128+16;
361   draw_background(bitmap, cliprect, machine->pens);
362   update_artwork();
705363
706    /* Draw an R */
707    drawgfx(bitmap,machine->gfx[5],
708            22,
709            0,
710            0,0,
711            pixel_x,pixel_y,
712            cliprect,TRANSPARENCY_NONE,0);
713    pixel_x+=6;
714    /* Draw a colon */
715    drawgfx(bitmap,machine->gfx[5],
716            25,
717            0,
718            0,0,
719            pixel_x,pixel_y,
720            cliprect,TRANSPARENCY_NONE,0);
721    pixel_x+=6;
722    /* Draw the pips */
723    for(i=9;i<12;i++)
724    {
725        drawgfx(bitmap,machine->gfx[5],
726                16 + (~stactics_display_buffer[i]&0x0f),
727                16,
728                0,0,
729                pixel_x,pixel_y,
730                cliprect,TRANSPARENCY_NONE,0);
731        pixel_x+=2;
732    }
733
734    /***** Draw Barriers Indicator *****/
735
736    pixel_x = 192+16;
737    /* Draw a B */
738    drawgfx(bitmap,machine->gfx[5],
739            23,
740            0,
741            0,0,
742            pixel_x,pixel_y,
743            cliprect,TRANSPARENCY_NONE,0);
744    pixel_x+=6;
745    /* Draw a colon */
746    drawgfx(bitmap,machine->gfx[5],
747            25,
748            0,
749            0,0,
750            pixel_x,pixel_y,
751            cliprect,TRANSPARENCY_NONE,0);
752    pixel_x+=6;
753    /* Draw the pips */
754    for(i=12;i<16;i++)
755    {
756        drawgfx(bitmap,machine->gfx[5],
757                16 + (~stactics_display_buffer[i]&0x0f),
758                16,
759                0,0,
760                pixel_x,pixel_y,
761                cliprect,TRANSPARENCY_NONE,0);
762        pixel_x+=2;
763    }
764
765    /* An LED fire beam! */
766    /* (There were 120 green LEDS mounted in the cabinet in the game, */
767    /*  and one red one, for the sight)                               */
768
769    /* First, update the firebeam state */
770
771    old_firebeam_state = firebeam_state;
772    if (stactics_shot_standby == 0)
773    {
774        firebeam_state = (firebeam_state + states_per_frame)%512;
775    }
776
777    /* These are thresholds for the two shots from the LED fire ROM */
778    /* (Note: There are two more for sound triggers, */
779    /*        whenever that gets implemented)        */
780
781    if ((old_firebeam_state < 0x8b) & (firebeam_state >= 0x8b))
782        stactics_shot_arrive = 1;
783
784    if ((old_firebeam_state < 0xca) & (firebeam_state >= 0xca))
785        stactics_shot_arrive = 1;
786
787    if (firebeam_state > 255)
788    {
789        firebeam_state = 0;
790        stactics_shot_standby = 1;
791    }
792
793    /* Now, draw the beam */
794
795    pixel_x = 15;
796    pixel_y = 166;
797
798    for(i=0;i<8;i++)
799    {
800        if ((i%2)==1)
801        {
802            /* Draw 7 LEDS on each side */
803            drawgfx(bitmap,machine->gfx[4],
804                    beamdata[firebeam_state*8+i]&0x7f,
805                    16*2,  /* Make it green */
806                    0,0,
807                    pixel_x,pixel_y,
808                    cliprect,TRANSPARENCY_COLOR,0);
809            drawgfx(bitmap,machine->gfx[4],
810                    beamdata[firebeam_state*8+i]&0x7f,
811                    16*2,  /* Make it green */
812                    1,0,
813                    255-pixel_x,pixel_y,
814                    cliprect,TRANSPARENCY_COLOR,0);
815            pixel_x+=14;
816            pixel_y-=7;
817        }
818        else
819        {
820            /* Draw 8 LEDS on each side */
821            drawgfx(bitmap,machine->gfx[4],
822                    beamdata[firebeam_state*8+i],
823                    16*2,  /* Make it green */
824                    0,0,
825                    pixel_x,pixel_y,
826                    cliprect,TRANSPARENCY_COLOR,0);
827            drawgfx(bitmap,machine->gfx[4],
828                    beamdata[firebeam_state*8+i],
829                    16*2,  /* Make it green */
830                    1,0,
831                    255-pixel_x,pixel_y,
832                    cliprect,TRANSPARENCY_COLOR,0);
833            pixel_x+=16;
834            pixel_y-=8;
835        }
836
837    }
838
839    /* Red Sight LED */
840
841    pixel_x = 134;
842    pixel_y = 112;
843
844    if (*stactics_motor_on & 0x01)
845    {
846        drawgfx(bitmap,machine->gfx[5],
847                26,
848                16, /* red */
849                0,0,
850                pixel_x,pixel_y,
851                cliprect,TRANSPARENCY_COLOR,0);
852    }
853
854    /* Update vblank counter */
855    stactics_vblank_count++;
856
857    /* reset dirty flags */
858    for(i=0;i<0xff;i++)
859    {
860        dirty_chardata_b[i] &= 0x01;
861        dirty_chardata_d[i] &= 0x01;
862        dirty_chardata_e[i] &= 0x01;
863        dirty_chardata_f[i] &= 0x01;
864    }
865
866364   return 0;
867365}
src/mame/video/mermaid.c
r1679r1680
142142VIDEO_START( mermaid )
143143{
144144   bg_tilemap = tilemap_create(get_bg_tile_info, tilemap_scan_rows,
145      TILEMAP_TYPE_PEN, 8, 8, 32, 32);
145      8, 8, 32, 32);
146146
147147   fg_tilemap = tilemap_create(get_fg_tile_info, tilemap_scan_rows,
148      TILEMAP_TYPE_PEN, 8, 8, 32, 32);
148      8, 8, 32, 32);
149149
150150   tilemap_set_scroll_cols(bg_tilemap, 32);
151151   tilemap_set_scroll_cols(fg_tilemap, 32);
src/mame/video/gdrawpkr.c
r1679r1680
88***********************************************************************************/
99
1010#include "driver.h"
11#include "video/mc6845.h"
12
13static mc6845_t *mc6845;
1114static tilemap *bg_tilemap;
1215
1316WRITE8_HANDLER( gdrawpkr_videoram_w )
r1679r1680
4144   SET_TILE_INFO(bank, code, color, 0);
4245}
4346
47WRITE8_HANDLER( gdrawpkr_mc6845_address_w )
48{
49   mc6845_address_w(mc6845, data);
50}
51
52READ8_HANDLER( gdrawpkr_mc6845_register_r )
53{
54   return mc6845_register_r(mc6845);
55}
56
57WRITE8_HANDLER( gdrawpkr_mc6845_register_w )
58{
59   mc6845_register_w(mc6845, data);
60}
61
4462VIDEO_START( gdrawpkr )
4563{
46   bg_tilemap = tilemap_create(get_bg_tile_info, tilemap_scan_rows,
47      TILEMAP_TYPE_PEN, 8, 8, 32, 31);
64   mc6845 = mc6845_config(NULL);
65   bg_tilemap = tilemap_create(get_bg_tile_info, tilemap_scan_rows, 8, 8, 32, 31);
4866}
4967
5068VIDEO_UPDATE( gdrawpkr )
src/mame/video/dcon.c
r1679r1680
131131
132132VIDEO_START( dcon )
133133{
134   background_layer = tilemap_create(get_back_tile_info,tilemap_scan_rows,TILEMAP_TYPE_PEN,     16,16,32,32);
135   foreground_layer = tilemap_create(get_fore_tile_info,tilemap_scan_rows,TILEMAP_TYPE_PEN,16,16,32,32);
136   midground_layer =  tilemap_create(get_mid_tile_info, tilemap_scan_rows,TILEMAP_TYPE_PEN,16,16,32,32);
137   text_layer =       tilemap_create(get_text_tile_info,tilemap_scan_rows,TILEMAP_TYPE_PEN,  8,8,64,32);
134   background_layer = tilemap_create(get_back_tile_info,tilemap_scan_rows,     16,16,32,32);
135   foreground_layer = tilemap_create(get_fore_tile_info,tilemap_scan_rows,16,16,32,32);
136   midground_layer =  tilemap_create(get_mid_tile_info, tilemap_scan_rows,16,16,32,32);
137   text_layer =       tilemap_create(get_text_tile_info,tilemap_scan_rows,  8,8,64,32);
138138
139139   tilemap_set_transparent_pen(midground_layer,15);
140140   tilemap_set_transparent_pen(foreground_layer,15);
src/mame/video/kickgoal.c
r1679r1680
5555
5656VIDEO_START( kickgoal )
5757{
58   kickgoal_fgtm = tilemap_create(get_kickgoal_fg_tile_info,tilemap_scan_kicksfg,TILEMAP_TYPE_PEN, 8, 16,64,64);
58   kickgoal_fgtm = tilemap_create(get_kickgoal_fg_tile_info,tilemap_scan_kicksfg, 8, 16,64,64);
5959      tilemap_set_transparent_pen(kickgoal_fgtm,15);
60   kickgoal_bgtm = tilemap_create(get_kickgoal_bg_tile_info,tilemap_scan_kicksbg,TILEMAP_TYPE_PEN, 16, 32,64,64);
60   kickgoal_bgtm = tilemap_create(get_kickgoal_bg_tile_info,tilemap_scan_kicksbg, 16, 32,64,64);
6161      tilemap_set_transparent_pen(kickgoal_bgtm,15);
62   kickgoal_bg2tm = tilemap_create(get_kickgoal_bg2_tile_info,tilemap_scan_kicksbg2,TILEMAP_TYPE_PEN, 32, 64,64,64);
62   kickgoal_bg2tm = tilemap_create(get_kickgoal_bg2_tile_info,tilemap_scan_kicksbg2, 32, 64,64,64);
6363}
6464
6565
r1679r1680
200200
201201VIDEO_START( actionhw )
202202{
203   kickgoal_fgtm  = tilemap_create(get_actionhw_fg_tile_info,tilemap_scan_actionhwfg,TILEMAP_TYPE_PEN,  8, 8,64,64);
204   kickgoal_bgtm  = tilemap_create(get_actionhw_bg_tile_info,tilemap_scan_actionhwbg,TILEMAP_TYPE_PEN, 16,16,64,64);
205   kickgoal_bg2tm = tilemap_create(get_actionhw_bg2_tile_info,tilemap_scan_actionhwbg2,TILEMAP_TYPE_PEN,    16,16,64,64);
203   kickgoal_fgtm  = tilemap_create(get_actionhw_fg_tile_info,tilemap_scan_actionhwfg,  8, 8,64,64);
204   kickgoal_bgtm  = tilemap_create(get_actionhw_bg_tile_info,tilemap_scan_actionhwbg, 16,16,64,64);
205   kickgoal_bg2tm = tilemap_create(get_actionhw_bg2_tile_info,tilemap_scan_actionhwbg2,    16,16,64,64);
206206
207207   tilemap_set_transparent_pen(kickgoal_fgtm,15);
208208   tilemap_set_transparent_pen(kickgoal_bgtm,15);
src/mame/video/galaxian.c
r1679r1680
514514
515515static void video_start_common(running_machine *machine, tilemap_mapper_callback get_memory_offset)
516516{
517   bg_tilemap = tilemap_create(get_tile_info,get_memory_offset,TILEMAP_TYPE_PEN,8,8,32,32);
517   bg_tilemap = tilemap_create(get_tile_info,get_memory_offset,8,8,32,32);
518518
519519   tilemap_set_transparent_pen(bg_tilemap,0);
520520
r1679r1680
818818VIDEO_START( rockclim )
819819{
820820   VIDEO_START_CALL(galaxian);
821   rockclim_tilemap = tilemap_create(rockclim_get_tile_info,tilemap_scan_rows,TILEMAP_TYPE_PEN,8,8,64,32);
821   rockclim_tilemap = tilemap_create(rockclim_get_tile_info,tilemap_scan_rows,8,8,64,32);
822822   draw_background = rockclim_draw_background;
823823   modify_charcode = mooncrst_modify_charcode;
824824   modify_spritecode = rockclim_modify_spritecode;
r1679r1680
842842
843843VIDEO_START( drivfrcg )
844844{
845   bg_tilemap = tilemap_create(drivfrcg_get_tile_info,tilemap_scan_rows,TILEMAP_TYPE_PEN,8,8,32,32);
845   bg_tilemap = tilemap_create(drivfrcg_get_tile_info,tilemap_scan_rows,8,8,32,32);
846846
847847   tilemap_set_transparent_pen(bg_tilemap,0);
848848   tilemap_set_scroll_cols(bg_tilemap, 32);
r1679r1680
880880
881881VIDEO_START( ad2083 )
882882{
883   bg_tilemap = tilemap_create(drivfrcg_get_tile_info,tilemap_scan_rows,TILEMAP_TYPE_PEN,8,8,32,32);
883   bg_tilemap = tilemap_create(drivfrcg_get_tile_info,tilemap_scan_rows,8,8,32,32);
884884
885885   tilemap_set_transparent_pen(bg_tilemap,0);
886886   tilemap_set_scroll_cols(bg_tilemap, 32);
r1679r1680
938938
939939VIDEO_START( racknrol )
940940{
941   bg_tilemap = tilemap_create(racknrol_get_tile_info,tilemap_scan_rows,TILEMAP_TYPE_PEN,8,8,32,32);
941   bg_tilemap = tilemap_create(racknrol_get_tile_info,tilemap_scan_rows,8,8,32,32);
942942
943943   tilemap_set_transparent_pen(bg_tilemap,0);
944944   tilemap_set_scroll_cols(bg_tilemap, 32);
r1679r1680
10231023
10241024   /* make a copy of the tilemap to emulate background priority */
10251025   dambustr_videoram2 = auto_malloc(0x0400);
1026   dambustr_tilemap2 = tilemap_create(dambustr_get_tile_info2,tilemap_scan_rows,TILEMAP_TYPE_PEN,8,8,32,32);
1026   dambustr_tilemap2 = tilemap_create(dambustr_get_tile_info2,tilemap_scan_rows,8,8,32,32);
10271027
10281028   tilemap_set_transparent_pen(dambustr_tilemap2,0);
10291029}
r1679r1680
20372037
20382038   int period_in_ms = 693 * (ra + 2.0 * rb) * c;
20392039
2040   timer_adjust(stars_blink_timer, ATTOTIME_IN_MSEC(period_in_ms), 0, ATTOTIME_IN_MSEC(period_in_ms));
2040   timer_adjust_periodic(stars_blink_timer, ATTOTIME_IN_MSEC(period_in_ms), 0, ATTOTIME_IN_MSEC(period_in_ms));
20412041}
20422042
20432043
r1679r1680
20512051
20522052static void start_stars_scroll_timer()
20532053{
2054   timer_adjust(stars_scroll_timer, video_screen_get_frame_period(0), 0, video_screen_get_frame_period(0));
2054   timer_adjust_periodic(stars_scroll_timer, video_screen_get_frame_period(0), 0, video_screen_get_frame_period(0));
20552055}
20562056
20572057
src/mame/video/othldrby.c
r1679r1680
5959
6060VIDEO_START( othldrby )
6161{
62   bg_tilemap[0] = tilemap_create(get_tile_info0,tilemap_scan_rows,TILEMAP_TYPE_PEN,16,16,32,32);
63   bg_tilemap[1] = tilemap_create(get_tile_info1,tilemap_scan_rows,TILEMAP_TYPE_PEN,16,16,32,32);
64   bg_tilemap[2] = tilemap_create(get_tile_info2,tilemap_scan_rows,TILEMAP_TYPE_PEN,16,16,32,32);
62   bg_tilemap[0] = tilemap_create(get_tile_info0,tilemap_scan_rows,16,16,32,32);
63   bg_tilemap[1] = tilemap_create(get_tile_info1,tilemap_scan_rows,16,16,32,32);
64   bg_tilemap[2] = tilemap_create(get_tile_info2,tilemap_scan_rows,16,16,32,32);
6565
6666   vram = auto_malloc(VIDEORAM_SIZE * sizeof(vram[0]));
6767   buf_spriteram = auto_malloc(2*SPRITERAM_SIZE * sizeof(buf_spriteram[0]));
src/mame/video/bbusters.c
r1679r1680
7171
7272VIDEO_START( bbuster )
7373{
74   fix_tilemap = tilemap_create(get_bbuster_tile_info,tilemap_scan_rows,TILEMAP_TYPE_PEN,8,8,32,32);
75   pf1_tilemap = tilemap_create(get_pf1_tile_info,tilemap_scan_cols,TILEMAP_TYPE_PEN,16,16,128,32);
76   pf2_tilemap = tilemap_create(get_pf2_tile_info,tilemap_scan_cols,TILEMAP_TYPE_PEN,16,16,128,32);
74   fix_tilemap = tilemap_create(get_bbuster_tile_info,tilemap_scan_rows,8,8,32,32);
75   pf1_tilemap = tilemap_create(get_pf1_tile_info,tilemap_scan_cols,16,16,128,32);
76   pf2_tilemap = tilemap_create(get_pf2_tile_info,tilemap_scan_cols,16,16,128,32);
7777
7878   tilemap_set_transparent_pen(pf1_tilemap, 15);
7979   tilemap_set_transparent_pen(fix_tilemap, 15);
r1679r1680
8181
8282VIDEO_START( mechatt )
8383{
84   fix_tilemap = tilemap_create(get_bbuster_tile_info,tilemap_scan_rows,TILEMAP_TYPE_PEN,8,8,32,32);
85   pf1_tilemap = tilemap_create(get_pf1_tile_info,tilemap_scan_cols,TILEMAP_TYPE_PEN,16,16,256,32);
86   pf2_tilemap = tilemap_create(get_pf2_tile_info,tilemap_scan_cols,TILEMAP_TYPE_PEN,16,16,256,32);
84   fix_tilemap = tilemap_create(get_bbuster_tile_info,tilemap_scan_rows,8,8,32,32);
85   pf1_tilemap = tilemap_create(get_pf1_tile_info,tilemap_scan_cols,16,16,256,32);
86   pf2_tilemap = tilemap_create(get_pf2_tile_info,tilemap_scan_cols,16,16,256,32);
8787
8888   tilemap_set_transparent_pen(pf1_tilemap, 15);
8989   tilemap_set_transparent_pen(fix_tilemap, 15);
r1679r1680
148148
149149static void bbusters_draw_block(running_machine *machine, mame_bitmap *dest,int x,int y,int size,int flipx,int flipy,UINT32 sprite,int color,int bank,int block)
150150{
151   const pen_t *pal = &machine->remapped_colortable[machine->gfx[bank]->color_base + machine->gfx[bank]->color_granularity * (color % machine->gfx[bank]->total_colors)];
151   const pen_t *pal = &machine->pens[machine->gfx[bank]->color_base + machine->gfx[bank]->color_granularity * (color % machine->gfx[bank]->total_colors)];
152152   UINT32 xinc=(scale_line_count * 0x10000 ) / size;
153153   UINT8 pixel;
154154   int x_index;
src/mame/video/gstriker.c
r1679r1680
6767
6868   for (i=0;i<numchips;i++)
6969   {
70      VS920A[i].tmap = tilemap_create(VS920A_get_tile_info,tilemap_scan_rows,TILEMAP_TYPE_PEN,8,8,64,32);
70      VS920A[i].tmap = tilemap_create(VS920A_get_tile_info,tilemap_scan_rows,8,8,64,32);
7171
7272      tilemap_set_transparent_pen(VS920A[i].tmap, 0);
7373   }
r1679r1680
225225
226226   for (i=0;i<numchips;i++)
227227   {
228      MB60553[i].tmap = tilemap_create(MB60553_get_tile_info,twc94_scan,TILEMAP_TYPE_PEN, 16,16,128,64);
228      MB60553[i].tmap = tilemap_create(MB60553_get_tile_info,twc94_scan, 16,16,128,64);
229229
230230      tilemap_set_transparent_pen(MB60553[i].tmap, 0);
231231   }
src/mame/video/hyprduel.c
r1679r1680
318318   hypr_tiletable_old = auto_malloc(hyprduel_tiletable_size);
319319   dirtyindex = auto_malloc(hyprduel_tiletable_size/4);
320320
321   bg_tilemap[0] = tilemap_create(get_tile_info_0_8bit,tilemap_scan_rows,TILEMAP_TYPE_PEN,8,8,WIN_NX,WIN_NY);
322   bg_tilemap[1] = tilemap_create(get_tile_info_1_8bit,tilemap_scan_rows,TILEMAP_TYPE_PEN,8,8,WIN_NX,WIN_NY);
323   bg_tilemap[2] = tilemap_create(get_tile_info_2_8bit,tilemap_scan_rows,TILEMAP_TYPE_PEN,8,8,WIN_NX,WIN_NY);
321   bg_tilemap[0] = tilemap_create(get_tile_info_0_8bit,tilemap_scan_rows,8,8,WIN_NX,WIN_NY);
322   bg_tilemap[1] = tilemap_create(get_tile_info_1_8bit,tilemap_scan_rows,8,8,WIN_NX,WIN_NY);
323   bg_tilemap[2] = tilemap_create(get_tile_info_2_8bit,tilemap_scan_rows,8,8,WIN_NX,WIN_NY);
324324
325325   tilemap_set_transparent_pen(bg_tilemap[0],0);
326326   tilemap_set_transparent_pen(bg_tilemap[1],0);
src/mame/video/flstory.c
r1679r1680
4646
4747VIDEO_START( flstory )
4848{
49   bg_tilemap = tilemap_create( get_tile_info,tilemap_scan_rows,TILEMAP_TYPE_PEN,8,8,32,32 );
49   bg_tilemap = tilemap_create( get_tile_info,tilemap_scan_rows,8,8,32,32 );
5050//  tilemap_set_transparent_pen( bg_tilemap,15 );
5151   tilemap_set_transmask(bg_tilemap,0,0x3fff,0xc000); /* split type 0 has pens 0-13 transparent in front half */
5252   tilemap_set_transmask(bg_tilemap,1,0x8000,0x7fff); /* split type 1 has pen 15 transparent in front half */
r1679r1680
5858
5959VIDEO_START( victnine )
6060{
61   bg_tilemap = tilemap_create( victnine_get_tile_info,tilemap_scan_rows,TILEMAP_TYPE_PEN,8,8,32,32 );
61   bg_tilemap = tilemap_create( victnine_get_tile_info,tilemap_scan_rows,8,8,32,32 );
6262   tilemap_set_scroll_cols(bg_tilemap,32);
6363
6464   paletteram = auto_malloc(0x200);
src/mame/video/suprslam.c
r1679r1680
139139
140140VIDEO_START( suprslam )
141141{
142   suprslam_bg_tilemap = tilemap_create(get_suprslam_bg_tile_info,tilemap_scan_rows,TILEMAP_TYPE_PEN, 16, 16,64,64);
143   suprslam_screen_tilemap = tilemap_create(get_suprslam_tile_info,tilemap_scan_rows,TILEMAP_TYPE_PEN, 8, 8,64,32);
142   suprslam_bg_tilemap = tilemap_create(get_suprslam_bg_tile_info,tilemap_scan_rows, 16, 16,64,64);
143   suprslam_screen_tilemap = tilemap_create(get_suprslam_tile_info,tilemap_scan_rows, 8, 8,64,32);
144144
145145   K053936_wraparound_enable(0, 1);
146146   K053936_set_offset(0, -45, -21);
src/mame/video/strnskil.c
r1679r1680
1010
1111#include "driver.h"
1212
13
14UINT8 *strnskil_xscroll;
1315static UINT8 strnskil_scrl_ctrl;
14static UINT8 strnskil_xscroll[2];
1516
1617static tilemap *bg_tilemap;
1718
19
1820PALETTE_INIT( strnskil )
1921{
2022   int i;
2123
22   for (i = 0;i < machine->drv->total_colors;i++)
24   /* allocate the colortable */
25   machine->colortable = colortable_alloc(machine, 0x100);
26
27   /* create a lookup table for the palette */
28   for (i = 0; i < 0x100; i++)
2329   {
24      int r = color_prom[0];
25      int g = color_prom[machine->drv->total_colors];
26      int b = color_prom[2*machine->drv->total_colors];
30      int r = pal4bit(color_prom[i + 0x000]);
31      int g = pal4bit(color_prom[i + 0x100]);
32      int b = pal4bit(color_prom[i + 0x200]);
2733
28      palette_set_color_rgb(machine,i,pal4bit(r),pal4bit(g),pal4bit(b));
29      color_prom++;
34      colortable_palette_set_color(machine->colortable, i, MAKE_RGB(r, g, b));
3035   }
3136
32   color_prom += 2*machine->drv->total_colors;
33
3437   /* color_prom now points to the beginning of the lookup table */
38   color_prom += 0x300;
3539
3640   /* sprites lookup table */
37   for (i=0; i<512; i++)
38      *(colortable++) = *(color_prom++);
39
40   /* bg lookup table */
41   for (i=0; i<512; i++)
42      *(colortable++) = *(color_prom++);
43
41   for (i = 0; i < 0x400; i++)
42   {
43      UINT8 ctabentry = color_prom[i];
44      colortable_entry_set_value(machine->colortable, i, ctabentry);
45   }
4446}
4547
48
4649WRITE8_HANDLER( strnskil_videoram_w )
4750{
4851   videoram[offset] = data;
4952   tilemap_mark_tile_dirty(bg_tilemap, offset / 2);
5053}
5154
52WRITE8_HANDLER( strnskil_scroll_x_w )
53{
54   strnskil_xscroll[offset] = data;
55}
56
5755WRITE8_HANDLER( strnskil_scrl_ctrl_w )
5856{
5957   strnskil_scrl_ctrl = data >> 5;
r1679r1680
7775VIDEO_START( strnskil )
7876{
7977   bg_tilemap = tilemap_create(get_bg_tile_info, tilemap_scan_cols,
80      TILEMAP_TYPE_PEN, 8, 8, 32, 32);
78      8, 8, 32, 32);
8179
8280   tilemap_set_scroll_rows(bg_tilemap, 32);
8381}
r1679r1680
118116         flipx, flipy,
119117         px, py,
120118         cliprect,
121         TRANSPARENCY_COLOR, 0);
119         TRANSPARENCY_PENS,
120         colortable_get_transpen_mask(machine->colortable, machine->gfx[1], color, 0));
122121   }
123122}
124123
src/mame/video/atetris.c
r1679r1680
4949
5050VIDEO_START( atetris )
5151{
52   bg_tilemap = tilemap_create(get_tile_info, tilemap_scan_rows, TILEMAP_TYPE_PEN, 8,8, 64,32);
52   bg_tilemap = tilemap_create(get_tile_info, tilemap_scan_rows, 8,8, 64,32);
5353}
5454
5555
src/mame/video/shaolins.c
r1679r1680
77***************************************************************************/
88
99#include "driver.h"
10#include "video/resnet.h"
1011
1112extern UINT8 shaolins_nmi_enable;
1213
r1679r1680
3031***************************************************************************/
3132PALETTE_INIT( shaolins )
3233{
34   static const int resistances[4] = { 2200, 1000, 470, 220 };
35   double rweights[4], gweights[4], bweights[4];
3336   int i;
34   #define TOTAL_COLORS(gfxn) (machine->gfx[gfxn]->total_colors * machine->gfx[gfxn]->color_granularity)
35   #define COLOR(gfxn,offs) (colortable[machine->drv->gfxdecodeinfo[gfxn].color_codes_start + offs])
3637
38   /* compute the color output resistor weights */
39   compute_resistor_weights(0,   255, -1.0,
40         4, resistances, rweights, 470, 0,
41         4, resistances, gweights, 470, 0,
42         4, resistances, bweights, 470, 0);
3743
38   for (i = 0;i < machine->drv->total_colors;i++)
44   /* allocate the colortable */
45   machine->colortable = colortable_alloc(machine, 0x100);
46
47   /* create a lookup table for the palette */
48   for (i = 0; i < 0x100; i++)
3949   {
40      int bit0,bit1,bit2,bit3,r,g,b;
50      int bit0, bit1, bit2, bit3;
51      int r, g, b;
4152
53      /* red component */
54      bit0 = (color_prom[i + 0x000] >> 0) & 0x01;
55      bit1 = (color_prom[i + 0x000] >> 1) & 0x01;
56      bit2 = (color_prom[i + 0x000] >> 2) & 0x01;
57      bit3 = (color_prom[i + 0x000] >> 3) & 0x01;
58      r = combine_4_weights(rweights, bit0, bit1, bit2, bit3);
4259
43      bit0 = (color_prom[0] >> 0) & 0x01;
44      bit1 = (color_prom[0] >> 1) & 0x01;
45      bit2 = (color_prom[0] >> 2) & 0x01;
46      bit3 = (color_prom[0] >> 3) & 0x01;
47      r = 0x0e * bit0 + 0x1f * bit1 + 0x43 * bit2 + 0x8f * bit3;
48      bit0 = (color_prom[machine->drv->total_colors] >> 0) & 0x01;
49      bit1 = (color_prom[machine->drv->total_colors] >> 1) & 0x01;
50      bit2 = (color_prom[machine->drv->total_colors] >> 2) & 0x01;
51      bit3 = (color_prom[machine->drv->total_colors] >> 3) & 0x01;
52      g = 0x0e * bit0 + 0x1f * bit1 + 0x43 * bit2 + 0x8f * bit3;
53      bit0 = (color_prom[2*machine->drv->total_colors] >> 0) & 0x01;
54      bit1 = (color_prom[2*machine->drv->total_colors] >> 1) & 0x01;
55      bit2 = (color_prom[2*machine->drv->total_colors] >> 2) & 0x01;
56      bit3 = (color_prom[2*machine->drv->total_colors] >> 3) & 0x01;
57      b = 0x0e * bit0 + 0x1f * bit1 + 0x43 * bit2 + 0x8f * bit3;
60      /* green component */
61      bit0 = (color_prom[i + 0x100] >> 0) & 0x01;
62      bit1 = (color_prom[i + 0x100] >> 1) & 0x01;
63      bit2 = (color_prom[i + 0x100] >> 2) & 0x01;
64      bit3 = (color_prom[i + 0x100] >> 3) & 0x01;
65      g = combine_4_weights(gweights, bit0, bit1, bit2, bit3);
5866
59      palette_set_color(machine,i,MAKE_RGB(r,g,b));
60      color_prom++;
67      /* blue component */
68      bit0 = (color_prom[i + 0x200] >> 0) & 0x01;
69      bit1 = (color_prom[i + 0x200] >> 1) & 0x01;
70      bit2 = (color_prom[i + 0x200] >> 2) & 0x01;
71      bit3 = (color_prom[i + 0x200] >> 3) & 0x01;
72      b = combine_4_weights(bweights, bit0, bit1, bit2, bit3);
73
74      colortable_palette_set_color(machine->colortable, i, MAKE_RGB(r, g, b));
6175   }
6276
63   color_prom += 2*machine->drv->total_colors;
64   /* color_prom now points to the beginning of the character lookup table */
77   /* color_prom now points to the beginning of the lookup table,*/
78   color_prom += 0x300;
6579
66
67   /* there are eight 32 colors palette banks; sprites use colors 0-15 and */
68   /* characters 16-31 of each bank. */
69   for (i = 0;i < TOTAL_COLORS(0)/8;i++)
80   /* characters use colors 0x10-0x1f of each 0x20 color bank,
81       while sprites use colors 0-0x0f */
82   for (i = 0; i < 0x200; i++)
7083   {
7184      int j;
7285
73
74      for (j = 0;j < 8;j++)
75         COLOR(0,i + j * TOTAL_COLORS(0)/8) = (*color_prom & 0x0f) + 32 * j + 16;
76
77      color_prom++;
78   }
79
80   for (i = 0;i < TOTAL_COLORS(1)/8;i++)
81   {
82      int j;
83
84
85      for (j = 0;j < 8;j++)
86      for (j = 0; j < 8; j++)
8687      {
87         /* preserve transparency */
88         if ((*color_prom & 0x0f) == 0) COLOR(1,i + j * TOTAL_COLORS(1)/8) = 0;
89         else COLOR(1,i + j * TOTAL_COLORS(1)/8) = (*color_prom & 0x0f) + 32 * j;
88         UINT8 ctabentry = (j << 5) | ((~i & 0x100) >> 4) | (color_prom[i] & 0x0f);
89         colortable_entry_set_value(machine->colortable, ((i & 0x100) << 3) | (j << 8) | (i & 0xff), ctabentry);
9090      }
91
92      color_prom++;
9391   }
9492}
9593
r1679r1680
119117   int col;
120118
121119   for (col = 4; col < 32; col++)
122   {
123120      tilemap_set_scrolly(bg_tilemap, col, data + 1);
124   }
125121}
126122
127123WRITE8_HANDLER( shaolins_nmi_w )
r1679r1680
148144VIDEO_START( shaolins )
149145{
150146   bg_tilemap = tilemap_create(get_bg_tile_info, tilemap_scan_rows,
151      TILEMAP_TYPE_PEN, 8, 8, 32, 32);
147      8, 8, 32, 32);
152148
153149   tilemap_set_scroll_cols(bg_tilemap, 32);
154150}
r1679r1680
162158      if (spriteram[offs] && spriteram[offs + 6]) /* stop rogue sprites on high score screen */
163159      {
164160         int code = spriteram[offs + 8];
165         int color = (spriteram[offs + 9] & 0x0f) + 16 * palettebank;
161         int color = (spriteram[offs + 9] & 0x0f) | (palettebank << 4);
166162         int flipx = !(spriteram[offs + 9] & 0x40);
167163         int flipy = spriteram[offs + 9] & 0x80;
168164         int sx = 240 - spriteram[offs + 6];
r1679r1680
180176            code, color,
181177            flipx, flipy,
182178            sx, sy,
183            cliprect,
184            TRANSPARENCY_COLOR, 0);
185            /* transparency_color, otherwise sprites in test mode are not visible */
179            cliprect,TRANSPARENCY_PENS,
180            colortable_get_transpen_mask(machine->colortable, machine->gfx[1], color, palettebank << 5));
186181      }
187182   }
188183}
src/mame/video/sshangha.c
r1679r1680
173173
174174VIDEO_START( sshangha )
175175{
176   pf1_8x8_tilemap   = tilemap_create(get_pf1_8x8_tile_info,  tilemap_scan_rows,TILEMAP_TYPE_PEN, 8, 8,64,32);
177   pf1_16x16_tilemap = tilemap_create(get_pf1_16x16_tile_info,tilemap_scan_rows,TILEMAP_TYPE_PEN,16,16,32,32);
178   pf2_tilemap = tilemap_create(get_pf2_tile_info,tilemap_scan_rows,    TILEMAP_TYPE_PEN,     16,16,32,32);
176   pf1_8x8_tilemap   = tilemap_create(get_pf1_8x8_tile_info,  tilemap_scan_rows, 8, 8,64,32);
177   pf1_16x16_tilemap = tilemap_create(get_pf1_16x16_tile_info,tilemap_scan_rows,16,16,32,32);
178   pf2_tilemap = tilemap_create(get_pf2_tile_info,tilemap_scan_rows,         16,16,32,32);
179179
180180   tilemap_set_transparent_pen(pf1_8x8_tilemap,0);
181181   tilemap_set_transparent_pen(pf1_16x16_tilemap,0);
src/mame/video/wiping.c
r1679r1680
77***************************************************************************/
88
99#include "driver.h"
10#include "video/resnet.h"
1011
1112
1213static int flipscreen;
r1679r1680
2021
2122PALETTE_INIT( wiping )
2223{
24   static const int resistances_rg[3] = { 1000, 470, 220 };
25   static const int resistances_b [2] = { 470, 220 };
26   double rweights[3], gweights[3], bweights[2];
2327   int i;
24   #define TOTAL_COLORS(gfxn) (machine->gfx[gfxn]->total_colors * machine->gfx[gfxn]->color_granularity)
25   #define COLOR(gfxn,offs) (colortable[machine->drv->gfxdecodeinfo[gfxn].color_codes_start + (offs)])
2628
29   /* compute the color output resistor weights */
30   compute_resistor_weights(0,   255, -1.0,
31         3, &resistances_rg[0], rweights, 470, 0,
32         3, &resistances_rg[0], gweights, 470, 0,
33         2, &resistances_b[0],  bweights, 470, 0);
2734
28   for (i = 0;i < machine->drv->total_colors;i++)
35   /* allocate the colortable */
36   machine->colortable = colortable_alloc(machine, 0x20);
37
38   /* create a lookup table for the palette */
39   for (i = 0; i < 0x20; i++)
2940   {
30      int bit0,bit1,bit2,r,g,b;
41      int bit0, bit1, bit2;
42      int r, g, b;
3143
44      /* red component */
45      bit0 = (color_prom[i] >> 0) & 0x01;
46      bit1 = (color_prom[i] >> 1) & 0x01;
47      bit2 = (color_prom[i] >> 2) & 0x01;
48      r = combine_3_weights(rweights, bit0, bit1, bit2);
3249
33      /* red component */
34      bit0 = (*color_prom >> 0) & 0x01;
35      bit1 = (*color_prom >> 1) & 0x01;
36      bit2 = (*color_prom >> 2) & 0x01;
37      r = 0x21 * bit0 + 0x47 * bit1 + 0x97 * bit2;
3850      /* green component */
39      bit0 = (*color_prom >> 3) & 0x01;
40      bit1 = (*color_prom >> 4) & 0x01;
41      bit2 = (*color_prom >> 5) & 0x01;
42      g = 0x21 * bit0 + 0x47 * bit1 + 0x97 * bit2;
51      bit0 = (color_prom[i] >> 3) & 0x01;
52      bit1 = (color_prom[i] >> 4) & 0x01;
53      bit2 = (color_prom[i] >> 5) & 0x01;
54      g = combine_3_weights(gweights, bit0, bit1, bit2);
55
4356      /* blue component */
44      bit0 = (*color_prom >> 6) & 0x01;
45      bit1 = (*color_prom >> 7) & 0x01;
46      b = 0x4f * bit0 + 0xa8 * bit1;
57      bit0 = (color_prom[i] >> 6) & 0x01;
58      bit1 = (color_prom[i] >> 7) & 0x01;
59      b = combine_2_weights(bweights, bit0, bit1);
4760
48      palette_set_color(machine,i,MAKE_RGB(r,g,b));
49      color_prom++;
61      colortable_palette_set_color(machine->colortable, i, MAKE_RGB(r, g, b));
5062   }
5163
5264   /* color_prom now points to the beginning of the lookup table */
65   color_prom += 0x20;
5366
5467   /* chars use colors 0-15 */
55   for (i = 0;i < TOTAL_COLORS(0);i++)
56      COLOR(0,i ^ 3) = *(color_prom++) & 0x0f;
68   for (i = 0; i < 0x100; i++)
69   {
70      UINT8 ctabentry = color_prom[i ^ 0x03] & 0x0f;
71      colortable_entry_set_value(machine->colortable, i, ctabentry);
72   }
5773
5874   /* sprites use colors 16-31 */
59   for (i = 0;i < TOTAL_COLORS(1);i++)
60      COLOR(1,i ^ 3) = (*(color_prom++) & 0x0f) + 0x10;
75   for (i = 0x100; i < 0x200; i++)
76   {
77      UINT8 ctabentry = (color_prom[i ^ 0x03] & 0x0f) | 0x10;
78      colortable_entry_set_value(machine->colortable, i, ctabentry);
79   }
6180}
6281
6382
r1679r1680
112131   /* Note, we're counting up on purpose ! */
113132   /* This way the vacuum cleaner is always on top */
114133   for (offs = 0x0; offs < 128; offs += 2) {
115      int sx,sy,flipx,flipy,otherbank;
134      int sx,sy,color,flipx,flipy,otherbank;
116135
117136      sx = spriteram[offs+0x100+1] + ((spriteram[offs+0x81] & 0x01) << 8) - 40;
118137      sy = 224 - spriteram[offs+0x100];
138      color = spriteram[offs+1] & 0x3f;
119139
120140      otherbank = spriteram[offs+0x80] & 0x01;
121141
r1679r1680
131151
132152      drawgfx(bitmap,machine->gfx[1],
133153         (spriteram[offs] & 0x3f) + 64 * otherbank,
134         spriteram[offs+1] & 0x3f,
154         color,
135155         flipx,flipy,
136156         sx,sy,
137         &machine->screen[0].visarea,TRANSPARENCY_COLOR,0x1f);
157         &machine->screen[0].visarea,TRANSPARENCY_PENS,
158         colortable_get_transpen_mask(machine->colortable, machine->gfx[1], color, 0x1f));
138159   }
139160
140161   /* redraw high priority chars */
src/mame/video/kyugo.c
r1679r1680
6363   color_codes = memory_region(REGION_PROMS) + 0x300;
6464
6565
66   fg_tilemap = tilemap_create(get_fg_tile_info, tilemap_scan_rows, TILEMAP_TYPE_PEN, 8,8, 64,32);
67   bg_tilemap = tilemap_create(get_bg_tile_info, tilemap_scan_rows, TILEMAP_TYPE_PEN,      8,8, 64,32);
66   fg_tilemap = tilemap_create(get_fg_tile_info, tilemap_scan_rows,  8,8, 64,32);
67   bg_tilemap = tilemap_create(get_bg_tile_info, tilemap_scan_rows,       8,8, 64,32);
6868
6969   tilemap_set_transparent_pen(fg_tilemap,0);
7070
src/mame/video/segaic24.c
r1679r1680
149149
150150   sys24_char_dirtymap = auto_malloc(SYS24_TILES);
151151
152   sys24_tile_layer[0] = tilemap_create(sys24_tile_info_0s, tilemap_scan_rows, TILEMAP_TYPE_PEN, 8, 8, 64, 64);
153   sys24_tile_layer[1] = tilemap_create(sys24_tile_info_0w, tilemap_scan_rows, TILEMAP_TYPE_PEN, 8, 8, 64, 64);
154   sys24_tile_layer[2] = tilemap_create(sys24_tile_info_1s, tilemap_scan_rows, TILEMAP_TYPE_PEN, 8, 8, 64, 64);
155   sys24_tile_layer[3] = tilemap_create(sys24_tile_info_1w, tilemap_scan_rows, TILEMAP_TYPE_PEN, 8, 8, 64, 64);
152   sys24_tile_layer[0] = tilemap_create(sys24_tile_info_0s, tilemap_scan_rows,  8, 8, 64, 64);
153   sys24_tile_layer[1] = tilemap_create(sys24_tile_info_0w, tilemap_scan_rows,  8, 8, 64, 64);
154   sys24_tile_layer[2] = tilemap_create(sys24_tile_info_1s, tilemap_scan_rows,  8, 8, 64, 64);
155   sys24_tile_layer[3] = tilemap_create(sys24_tile_info_1w, tilemap_scan_rows,  8, 8, 64, 64);
156156
157157   tilemap_set_transparent_pen(sys24_tile_layer[0], 0);
158158   tilemap_set_transparent_pen(sys24_tile_layer[1], 0);
src/mame/video/popeye.c
r1679r1680
269269   bitmap_type = TYPE_SKYSKIPR;
270270
271271   fg_tilemap = tilemap_create(get_fg_tile_info, tilemap_scan_rows,
272      TILEMAP_TYPE_PEN, 16, 16, 32, 32);
272      16, 16, 32, 32);
273273
274274   tilemap_set_transparent_pen(fg_tilemap, 0);
275275}
r1679r1680
283283   bitmap_type = TYPE_POPEYE;
284284
285285   fg_tilemap = tilemap_create(get_fg_tile_info, tilemap_scan_rows,
286      TILEMAP_TYPE_PEN, 16, 16, 32, 32);
286      16, 16, 32, 32);
287287
288288   tilemap_set_transparent_pen(fg_tilemap, 0);
289289}
src/mame/video/4enraya.c
r1679r1680
2929
3030VIDEO_START( 4enraya )
3131{
32   bg_tilemap = tilemap_create( get_tile_info,tilemap_scan_rows,TILEMAP_TYPE_PEN,8,8,32,32 );
32   bg_tilemap = tilemap_create( get_tile_info,tilemap_scan_rows,8,8,32,32 );
3333}
3434
3535VIDEO_UPDATE( 4enraya)
src/mame/video/blockade.c
r1679r1680
2525VIDEO_START( blockade )
2626{
2727   bg_tilemap = tilemap_create(get_bg_tile_info, tilemap_scan_rows,
28      TILEMAP_TYPE_PEN, 8, 8, 32, 32);
28      8, 8, 32, 32);
2929}
3030
3131VIDEO_UPDATE( blockade )
src/mame/video/compgolf.c
r1679r1680
7171
7272VIDEO_START( compgolf )
7373{
74   background_tilemap = tilemap_create(get_back_info,back_scan,TILEMAP_TYPE_PEN, 16, 16, 32, 32);
75   text_tilemap = tilemap_create(get_text_info,tilemap_scan_rows,TILEMAP_TYPE_PEN, 8, 8, 32, 32);
74   background_tilemap = tilemap_create(get_back_info,back_scan, 16, 16, 32, 32);
75   text_tilemap = tilemap_create(get_text_info,tilemap_scan_rows, 8, 8, 32, 32);
7676
7777   tilemap_set_transparent_pen(text_tilemap,0);
7878}
src/mame/video/lordgun.c
r1679r1680
123123VIDEO_START( lordgun )
124124{
125125   tilemap_0 = tilemap_create(   get_tile_info_0, tilemap_scan_rows,
126                        TILEMAP_TYPE_PEN, 8,8, 0x100, 0x40 );
126                        8,8, 0x100, 0x40 );
127127
128128   tilemap_1 = tilemap_create(   get_tile_info_1, tilemap_scan_rows,
129                        TILEMAP_TYPE_PEN, 16,16, 0x80,0x20 );
129                        16,16, 0x80,0x20 );
130130
131131   tilemap_2 = tilemap_create(   get_tile_info_2, tilemap_scan_rows,
132                        TILEMAP_TYPE_PEN, 32,32, 0x40,0x40 );
132                        32,32, 0x40,0x40 );
133133
134134   tilemap_3 = tilemap_create(   get_tile_info_3, tilemap_scan_rows,
135                        TILEMAP_TYPE_PEN, 8,8, 0x40,0x20 );
135                        8,8, 0x40,0x20 );
136136
137137   tilemap_set_scroll_rows(tilemap_0,1);
138138   tilemap_set_scroll_cols(tilemap_0,1);
src/mame/video/pushman.c
r1679r1680
4949
5050VIDEO_START( pushman )
5151{
52   bg_tilemap = tilemap_create(get_back_tile_info,background_scan_rows,TILEMAP_TYPE_PEN,     32,32,128,64);
53   tx_tilemap = tilemap_create(get_text_tile_info,tilemap_scan_rows,   TILEMAP_TYPE_PEN, 8, 8, 32,32);
52   bg_tilemap = tilemap_create(get_back_tile_info,background_scan_rows,     32,32,128,64);
53   tx_tilemap = tilemap_create(get_text_tile_info,tilemap_scan_rows,    8, 8, 32,32);
5454
5555   tilemap_set_transparent_pen(tx_tilemap,3);
5656}
src/mame/video/lemmings.c
r1679r1680
9595VIDEO_START( lemmings )
9696{
9797   bitmap0 = auto_bitmap_alloc(2048,256,machine->screen[0].format);
98   vram_tilemap = tilemap_create(get_tile_info,tilemap_scan_cols,TILEMAP_TYPE_PEN,8,8,64,32);
98   vram_tilemap = tilemap_create(get_tile_info,tilemap_scan_cols,8,8,64,32);
9999
100100   vram_buffer = (UINT8*)auto_malloc(2048*64); /* 64 bytes per VRAM character */
101101   vram_dirty = (UINT8*)auto_malloc(2048);
src/mame/video/zerozone.c
r1679r1680
4040{
4141   // i'm not 100% sure it should be opaque, pink title screen looks strange in las vegas girls
4242   // but if its transparent other things look incorrect
43   zerozone_tilemap = tilemap_create(get_zerozone_tile_info,tilemap_scan_cols,TILEMAP_TYPE_PEN,      8, 8, 64,32);
43   zerozone_tilemap = tilemap_create(get_zerozone_tile_info,tilemap_scan_cols,      8, 8, 64,32);
4444}
4545
4646VIDEO_UPDATE( zerozone )
src/mame/video/espial.c
r1679r1680
100100
101101VIDEO_START( espial )
102102{
103   bg_tilemap = tilemap_create(get_tile_info,tilemap_scan_rows,TILEMAP_TYPE_PEN,8,8,32,32);
103   bg_tilemap = tilemap_create(get_tile_info,tilemap_scan_rows,8,8,32,32);
104104
105105   tilemap_set_scroll_cols(bg_tilemap, 32);
106106}
r1679r1680
108108VIDEO_START( netwars )
109109{
110110   /* Net Wars has a tile map that's twice as big as Espial's */
111   bg_tilemap = tilemap_create(get_tile_info,tilemap_scan_rows,TILEMAP_TYPE_PEN,8,8,32,64);
111   bg_tilemap = tilemap_create(get_tile_info,tilemap_scan_rows,8,8,32,64);
112112
113113   tilemap_set_scroll_cols(bg_tilemap, 32);
114114   tilemap_set_scrolldy(bg_tilemap, 0, 0x100);
src/mame/video/hyperspt.c
r1679r1680
77***************************************************************************/
88
99#include "driver.h"
10#include "video/resnet.h"
1011
1112UINT8 *hyperspt_scroll;
1213
r1679r1680
3233***************************************************************************/
3334PALETTE_INIT( hyperspt )
3435{
36   static const int resistances_rg[3] = { 1000, 470, 220 };
37   static const int resistances_b [2] = { 470, 220 };
38   double rweights[3], gweights[3], bweights[2];
3539   int i;
36   #define TOTAL_COLORS(gfxn) (machine->gfx[gfxn]->total_colors * machine->gfx[gfxn]->color_granularity)
37   #define COLOR(gfxn,offs) (colortable[machine->drv->gfxdecodeinfo[gfxn].color_codes_start + offs])
3840
41   /* compute the color output resistor weights */
42   compute_resistor_weights(0,   255, -1.0,
43         3, &resistances_rg[0], rweights, 1000, 0,
44         3, &resistances_rg[0], gweights, 1000, 0,
45         2, &resistances_b[0],  bweights, 1000, 0);
3946
40   for (i = 0;i < machine->drv->total_colors;i++)
47   /* allocate the colortable */
48   machine->colortable = colortable_alloc(machine, 0x20);
49
50   /* create a lookup table for the palette */
51   for (i = 0; i < 0x20; i++)
4152   {
42      int bit0,bit1,bit2,r,g,b;
53      int bit0, bit1, bit2;
54      int r, g, b;
4355
4456      /* red component */
45      bit0 = (*color_prom >> 0) & 0x01;
46      bit1 = (*color_prom >> 1) & 0x01;
47      bit2 = (*color_prom >> 2) & 0x01;
48      r = 0x21 * bit0 + 0x47 * bit1 + 0x97 * bit2;
57      bit0 = (color_prom[i] >> 0) & 0x01;
58      bit1 = (color_prom[i] >> 1) & 0x01;
59      bit2 = (color_prom[i] >> 2) & 0x01;
60      r = combine_3_weights(rweights, bit0, bit1, bit2);
61
4962      /* green component */
50      bit0 = (*color_prom >> 3) & 0x01;
51      bit1 = (*color_prom >> 4) & 0x01;
52      bit2 = (*color_prom >> 5) & 0x01;
53      g = 0x21 * bit0 + 0x47 * bit1 + 0x97 * bit2;
63      bit0 = (color_prom[i] >> 3) & 0x01;
64      bit1 = (color_prom[i] >> 4) & 0x01;
65      bit2 = (color_prom[i] >> 5) & 0x01;
66      g = combine_3_weights(gweights, bit0, bit1, bit2);
67
5468      /* blue component */
55      bit0 = 0;
56      bit1 = (*color_prom >> 6) & 0x01;
57      bit2 = (*color_prom >> 7) & 0x01;
58      b = 0x21 * bit0 + 0x47 * bit1 + 0x97 * bit2;
69      bit0 = (color_prom[i] >> 6) & 0x01;
70      bit1 = (color_prom[i] >> 7) & 0x01;
71      b = combine_2_weights(bweights, bit0, bit1);
5972
60      palette_set_color(machine,i,MAKE_RGB(r,g,b));
61      color_prom++;
73      colortable_palette_set_color(machine->colortable, i, MAKE_RGB(r, g, b));
6274   }
6375
6476   /* color_prom now points to the beginning of the lookup table */
77   color_prom += 0x20;
6578
66
6779   /* sprites */
68   for (i = 0;i < TOTAL_COLORS(1);i++)
69      COLOR(1,i) = *(color_prom++) & 0x0f;
80   for (i = 0; i < 0x100; i++)
81   {
82      UINT8 ctabentry = color_prom[i] & 0x0f;
83      colortable_entry_set_value(machine->colortable, i, ctabentry);
84   }
7085
7186   /* characters */
72   for (i = 0;i < TOTAL_COLORS(0);i++)
73      COLOR(0,i) = (*(color_prom++) & 0x0f) + 0x10;
87   for (i = 0x100; i < 0x200; i++)
88   {
89      UINT8 ctabentry = (color_prom[i] & 0x0f) | 0x10;
90      colortable_entry_set_value(machine->colortable, i, ctabentry);
91   }
7492}
7593
7694WRITE8_HANDLER( hyperspt_videoram_w )
r1679r1680
100118   int color = colorram[tile_index] & 0x0f;
101119   int flags = ((colorram[tile_index] & 0x10) ? TILE_FLIPX : 0) | ((colorram[tile_index] & 0x20) ? TILE_FLIPY : 0);
102120
103   SET_TILE_INFO(0, code, color, flags);
121   SET_TILE_INFO(1, code, color, flags);
104122}
105123
106124VIDEO_START( hyperspt )
107125{
108   bg_tilemap = tilemap_create(get_bg_tile_info, tilemap_scan_rows,
109      TILEMAP_TYPE_PEN, 8, 8, 64, 32);
126   bg_tilemap = tilemap_create(get_bg_tile_info, tilemap_scan_rows, 8, 8, 64, 32);
110127
111128   tilemap_set_scroll_rows(bg_tilemap, 32);
112129}
r1679r1680
119136   {
120137      int sx = spriteram[offs + 3];
121138      int sy = 240 - spriteram[offs + 1];
139      int code = spriteram[offs + 2] + 8 * (spriteram[offs] & 0x20);
140      int color = spriteram[offs] & 0x0f;
122141      int flipx = ~spriteram[offs] & 0x40;
123142      int flipy = spriteram[offs] & 0x80;
124143
r1679r1680
133152
134153      sy += 1;
135154
136      drawgfx(bitmap,machine->gfx[1],
137         spriteram[offs + 2] + 8 * (spriteram[offs] & 0x20),
138         spriteram[offs] & 0x0f,
155      drawgfx(bitmap,machine->gfx[0],
156         code, color,
139157         flipx, flipy,
140158         sx, sy,
141159         cliprect,
142         TRANSPARENCY_COLOR, 0);
160         TRANSPARENCY_PENS,
161         colortable_get_transpen_mask(machine->colortable, machine->gfx[0], color, 0));
143162
144163      /* redraw with wraparound */
145164
146      drawgfx(bitmap,machine->gfx[1],
147         spriteram[offs + 2] + 8 * (spriteram[offs] & 0x20),
148         spriteram[offs] & 0x0f,
165      drawgfx(bitmap,machine->gfx[0],
166         code, color,
149167         flipx, flipy,
150168         sx - 256, sy,
151169         cliprect,
152         TRANSPARENCY_COLOR, 0);
170         TRANSPARENCY_PENS,
171         colortable_get_transpen_mask(machine->colortable, machine->gfx[0], color, 0));
153172   }
154173}
155174
r1679r1680
177196   int color = colorram[tile_index] & 0x0f;
178197   int flags = (colorram[tile_index] & 0x10) ? TILE_FLIPX : 0;
179198
180   SET_TILE_INFO(0, code, color, flags);
199   SET_TILE_INFO(1, code, color, flags);
181200}
182201
183202VIDEO_START( roadf )
184203{
185   bg_tilemap = tilemap_create(roadf_get_bg_tile_info, tilemap_scan_rows,
186      TILEMAP_TYPE_PEN, 8, 8, 64, 32);
204   bg_tilemap = tilemap_create(roadf_get_bg_tile_info, tilemap_scan_rows, 8, 8, 64, 32);
187205
188206   tilemap_set_scroll_rows(bg_tilemap, 32);
189207}
src/mame/video/tiamc1.c
r1679r1680
141141VIDEO_START( tiamc1 )
142142{
143143   bg_tilemap1 = tilemap_create(get_bg1_tile_info, tilemap_scan_rows,
144      TILEMAP_TYPE_PEN, 8, 8, 32, 32);
144      8, 8, 32, 32);
145145
146146   bg_tilemap2 = tilemap_create(get_bg2_tile_info, tilemap_scan_rows,
147      TILEMAP_TYPE_PEN, 8, 8, 32, 32);
147      8, 8, 32, 32);
148148
149149   tiamc1_bg_vshift = 0;
150150   tiamc1_bg_hshift = 0;
src/mame/video/toaplan1.c
r1679r1680
256256
257257static void toaplan1_create_tilemaps(void)
258258{
259   pf1_tilemap = tilemap_create(get_pf1_tile_info,tilemap_scan_rows,TILEMAP_TYPE_PEN,8,8,64,64);
260   pf2_tilemap = tilemap_create(get_pf2_tile_info,tilemap_scan_rows,TILEMAP_TYPE_PEN,8,8,64,64);
261   pf3_tilemap = tilemap_create(get_pf3_tile_info,tilemap_scan_rows,TILEMAP_TYPE_PEN,8,8,64,64);
262   pf4_tilemap = tilemap_create(get_pf4_tile_info,tilemap_scan_rows,TILEMAP_TYPE_PEN,8,8,64,64);
259   pf1_tilemap = tilemap_create(get_pf1_tile_info,tilemap_scan_rows,8,8,64,64);
260   pf2_tilemap = tilemap_create(get_pf2_tile_info,tilemap_scan_rows,8,8,64,64);
261   pf3_tilemap = tilemap_create(get_pf3_tile_info,tilemap_scan_rows,8,8,64,64);
262   pf4_tilemap = tilemap_create(get_pf4_tile_info,tilemap_scan_rows,8,8,64,64);
263263
264264   tilemap_set_transparent_pen(pf1_tilemap,0);
265265   tilemap_set_transparent_pen(pf2_tilemap,0);
r1679r1680
946946      UINT32 code,UINT32 color,int flipx,int flipy,int sx,int sy,
947947      const rectangle *clip,int priority)
948948{
949   const pen_t *pal = &Machine->remapped_colortable[gfx->color_base + gfx->color_granularity * (color % gfx->total_colors)];
949   const pen_t *pal = &Machine->pens[gfx->color_base + gfx->color_granularity * (color % gfx->total_colors)];
950950   UINT8 *source_base = gfx->gfxdata + (code % gfx->total_elements) * gfx->char_modulo;
951951
952952   int sprite_screen_height = ((1<<16)*gfx->height+0x8000)>>16;
src/mame/video/segag80r.c
r1679r1680
228228      /* and one vertically scrolling */
229229      case G80_BACKGROUND_SPACEOD:
230230         spaceod_bg_init_palette(machine);
231         spaceod_bg_htilemap = tilemap_create(spaceod_get_tile_info, spaceod_scan_rows, TILEMAP_TYPE_PEN, 8,8, 128,32);
232         spaceod_bg_vtilemap = tilemap_create(spaceod_get_tile_info, spaceod_scan_rows, TILEMAP_TYPE_PEN, 8,8, 32,128);
231         spaceod_bg_htilemap = tilemap_create(spaceod_get_tile_info, spaceod_scan_rows,  8,8, 128,32);
232         spaceod_bg_vtilemap = tilemap_create(spaceod_get_tile_info, spaceod_scan_rows,  8,8, 32,128);
233233         break;
234234
235235      /* background tilemap is effectively 1 screen x n screens */
236236      case G80_BACKGROUND_MONSTERB:
237         bg_tilemap = tilemap_create(bg_get_tile_info, tilemap_scan_rows, TILEMAP_TYPE_PEN, 8,8, 32,memory_region_length(REGION_GFX2) / 32);
237         bg_tilemap = tilemap_create(bg_get_tile_info, tilemap_scan_rows, 8,8, 32,memory_region_length(REGION_GFX2) / 32);
238238         break;
239239
240240      /* background tilemap is effectively 4 screens x n screens */
241241      case G80_BACKGROUND_PIGNEWT:
242242      case G80_BACKGROUND_SINDBADM:
243         bg_tilemap = tilemap_create(bg_get_tile_info, tilemap_scan_rows, TILEMAP_TYPE_PEN, 8,8, 128,memory_region_length(REGION_GFX2) / 128);
243         bg_tilemap = tilemap_create(bg_get_tile_info, tilemap_scan_rows, 8,8, 128,memory_region_length(REGION_GFX2) / 128);
244244         break;
245245   }
246246
src/mame/video/tmnt.c
r1679r1680
280280   K052109_vh_start(machine,REGION_GFX1,NORMAL_PLANE_ORDER,tmnt_tile_callback);
281281   K053245_vh_start(machine,0, REGION_GFX2,NORMAL_PLANE_ORDER,lgtnfght_sprite_callback);
282282
283   roz_tilemap = tilemap_create(glfgreat_get_roz_tile_info,tilemap_scan_rows,TILEMAP_TYPE_PEN,16,16,512,512);
283   roz_tilemap = tilemap_create(glfgreat_get_roz_tile_info,tilemap_scan_rows,16,16,512,512);
284284
285285   tilemap_set_transparent_pen(roz_tilemap,0);
286286
r1679r1680
301301   K052109_vh_start(machine,REGION_GFX1,NORMAL_PLANE_ORDER,tmnt_tile_callback);
302302   K053245_vh_start(machine,0, REGION_GFX2,NORMAL_PLANE_ORDER,prmrsocr_sprite_callback);
303303
304   roz_tilemap = tilemap_create(prmrsocr_get_roz_tile_info,tilemap_scan_rows,TILEMAP_TYPE_PEN,16,16,512,256);
304   roz_tilemap = tilemap_create(prmrsocr_get_roz_tile_info,tilemap_scan_rows,16,16,512,256);
305305
306306   tilemap_set_transparent_pen(roz_tilemap,0);
307307
src/mame/video/zodiack.c
r1679r1680
133133VIDEO_START( zodiack )
134134{
135135   bg_tilemap = tilemap_create(get_bg_tile_info, tilemap_scan_rows,
136      TILEMAP_TYPE_PEN, 8, 8, 32, 32);
136      8, 8, 32, 32);
137137
138138   fg_tilemap = tilemap_create(get_fg_tile_info, tilemap_scan_rows,
139      TILEMAP_TYPE_PEN, 8, 8, 32, 32);
139      8, 8, 32, 32);
140140
141141   tilemap_set_transparent_pen(fg_tilemap, 0);
142142   tilemap_set_scroll_cols(fg_tilemap, 32);
src/mame/video/dc.c
r1679r1680
1515
1616static UINT32 pvrctrl_regs[0x100/4];
1717static UINT32 pvrta_regs[0x2000/4];
18static int pvr_parconfseq[] = {1,2,3,2,3,4,5,6,5,6,7,8,9,10,11,12,13,14,13,14,15,16,17,16,17,0,0,0,0,0,18,19,20,19,20,21,22,23,22,23};
19static int pvr_wordsvertex[24]  = {8,8,8,8,8,16,16,8,8,8, 8, 8,8,8,8,8,16,16, 8,16,16,8,16,16};
20static int pvr_wordspolygon[24] = {8,8,8,8,8, 8, 8,8,8,8,16,16,8,8,8,8, 8, 8,16,16,16,8, 8, 8};
21static int pvr_parameterconfig[64];
1822
1923UINT64 *dc_texture_ram;
2024static UINT32 tafifo_buff[32];
2125static int tafifo_pos, tafifo_mask, tafifo_vertexwords, tafifo_listtype;
2226static int start_render_received;
27static int alloc_ctrl_OPB_Mode, alloc_ctrl_PT_OPB, alloc_ctrl_TM_OPB, alloc_ctrl_T_OPB, alloc_ctrl_ZM_OPB, alloc_ctrl_O_OPB;
2328
2429struct testsprites
2530{
r1679r1680
6671   reg = decode_reg_64(offset, mem_mask, &shift);
6772
6873   #if DEBUG_PVRCTRL
69   mame_printf_verbose("PVRCTRL: read %x @ %x (reg %x), mask %llx (PC=%x)\n", pvrctrl_regs[reg], offset, reg, mem_mask, activecpu_get_pc());
74   mame_printf_verbose("PVRCTRL: [%08x] read %x @ %x (reg %x), mask %llx (PC=%x)\n", 0x5f7c00+reg*4, pvrctrl_regs[reg], offset, reg, mem_mask, activecpu_get_pc());
7075   #endif
7176
7277   return (UINT64)pvrctrl_regs[reg] << shift;
r1679r1680
7681{
7782   int reg;
7883   UINT64 shift;
84   UINT32 dat;
7985
8086   reg = decode_reg_64(offset, mem_mask, &shift);
87   dat = (UINT32)(data >> shift);
8188
8289   #if DEBUG_PVRCTRL
83   mame_printf_verbose("PVRCTRL: write %llx to %x (reg %x), mask %llx\n", data>>shift, offset, reg, mem_mask);
90   mame_printf_verbose("PVRCTRL: [%08x=%x] write %llx to %x (reg %x), mask %llx\n", 0x5f7c00+reg*4, dat, data>>shift, offset, reg, mem_mask);
8491   #endif
8592
86   pvrctrl_regs[reg] |= data >> shift;
93   pvrctrl_regs[reg] |= dat;
8794}
8895
8996READ64_HANDLER( pvr_ta_r )
r1679r1680
100107      break;
101108   }
102109
103   #if DEBUG_PVRTA
104   mame_printf_verbose("PVRTA: read %x @ %x (reg %x), mask %llx (PC=%x)\n", pvrta_regs[reg], offset, reg, mem_mask, activecpu_get_pc());
110   #if DEBUG_PVRTA_REGS
111   mame_printf_verbose("PVRTA: [%08x] read %x @ %x (reg %x), mask %llx (PC=%x)\n", 0x5f8000+reg*4, pvrta_regs[reg], offset, reg, mem_mask, activecpu_get_pc());
105112   #endif
106113   return (UINT64)pvrta_regs[reg] << shift;
107114}
r1679r1680
119126   switch (reg)
120127   {
121128   case SOFTRESET:
122      #if DEBUG_PVRTA_REGS
123129      if (dat & 1)
124130      {
131         #if DEBUG_PVRTA
125132         mame_printf_verbose("pvr_ta_w:  TA soft reset\n");
133         #endif
126134      }
127135      if (dat & 2)
128136      {
137         #if DEBUG_PVRTA
129138         mame_printf_verbose("pvr_ta_w:  Core Pipeline soft reset\n");
139         #endif
140         if (start_render_received == 1)
141            start_render_received = 0;
130142      }
131143      if (dat & 4)
132144      {
145         #if DEBUG_PVRTA
133146         mame_printf_verbose("pvr_ta_w:  sdram I/F soft reset\n");
147         #endif
134148      }
135      #endif
136149      break;
137150   case STARTRENDER:
151      #if DEBUG_PVRTA
152      mame_printf_verbose("Start Render Received:\n");
153      mame_printf_verbose("  Region Array at %08x\n",pvrta_regs[REGION_BASE]);
154      mame_printf_verbose("  ISP/TSP Parameters at %08x\n",pvrta_regs[PARAM_BASE]);
155      #endif
138156      start_render_received=1;
139157      break;
158   case TA_ALLOC_CTRL:
159      alloc_ctrl_OPB_Mode = dat & 0x100000; // 0 up 1 down
160      alloc_ctrl_PT_OPB = (4 << ((dat >> 16) & 3)) & 0x38; // number of 32 bit words (0,8,16,32)
161      alloc_ctrl_TM_OPB = (4 << ((dat >> 12) & 3)) & 0x38;
162      alloc_ctrl_T_OPB = (4 << ((dat >> 8) & 3)) & 0x38;
163      alloc_ctrl_ZM_OPB = (4 << ((dat >> 4) & 3)) & 0x38;
164      alloc_ctrl_O_OPB = (4 << ((dat >> 0) & 3)) & 0x38;
165      break;
140166   case TA_LIST_INIT:
141167      tafifo_pos=0;
142168      tafifo_mask=7;
143169      tafifo_vertexwords=8;
144170      tafifo_listtype= -1;
145171      toerasesprites=1;
172   #if DEBUG_PVRTA
173      mame_printf_verbose("TA_OL_BASE       %08x TA_OL_LIMIT  %08x\n", pvrta_regs[TA_OL_BASE], pvrta_regs[TA_OL_LIMIT]);
174      mame_printf_verbose("TA_ISP_BASE      %08x TA_ISP_LIMIT %08x\n", pvrta_regs[TA_ISP_BASE], pvrta_regs[TA_ISP_LIMIT]);
175      mame_printf_verbose("TA_ALLOC_CTRL    %08x\n", pvrta_regs[TA_ALLOC_CTRL]);
176      mame_printf_verbose("TA_NEXT_OPB_INIT %08x\n", pvrta_regs[TA_NEXT_OPB_INIT]);
177   #endif
178      pvrta_regs[TA_NEXT_OPB] = pvrta_regs[TA_NEXT_OPB_INIT];
179      pvrta_regs[TA_ITP_CURRENT] = pvrta_regs[TA_ISP_BASE];
146180      break;
147181   }
148182
149   #if DEBUG_PVRTA
150   mame_printf_verbose("PVRTA: write %llx to %x (reg %x %x), mask %llx\n", data>>shift, offset, reg, (reg*4)+0x8000, mem_mask);
183   #if DEBUG_PVRTA_REGS
184   mame_printf_verbose("PVRTA: [%08x=%x] write %llx to %x (reg %x %x), mask %llx\n", 0x5f8000+reg*4, dat, data>>shift, offset, reg, (reg*4)+0x8000, mem_mask);
151185   #endif
152186}
153187
154188WRITE64_HANDLER( ta_fifo_poly_w )
155189{
156190   UINT32 a;
157   static UINT32 paracontrol,paratype,endofstrip,listtype;
191   static UINT32 paracontrol,paratype,endofstrip,listtype,global_paratype,parameterconfig;
158192   static UINT32 groupcontrol,groupen,striplen,userclip;
159193   static UINT32 objcontrol,shadow,volume,coltype,texture,offfset,gouraud,uv16bit;
160194   static UINT32 textureusize,texturevsize,texturesizes,textureaddress,scanorder,pixelformat;
r1679r1680
173207   }
174208   else
175209   {
176      logerror("ta_fifo_poly_w:  Only 64 bit writes supported!\n");
210      mame_printf_debug("ta_fifo_poly_w:  Only 64 bit writes supported!\n");
177211   }
178212
179213   tafifo_pos &= tafifo_mask;
180214   if (tafifo_pos == 0)
181215   {
182216      paracontrol=(tafifo_buff[0] >> 24) & 0xff;
183
184217      // 0 end of list
185218      // 1 user tile clip
186219      // 2 object list set
r1679r1680
192225      paratype=(paracontrol >> 5) & 7;
193226      endofstrip=(paracontrol >> 4) & 1;
194227      listtype=(paracontrol >> 0) & 7;
195      groupcontrol=(tafifo_buff[0] >> 16) & 0xff;
196      groupen=(groupcontrol >> 7) & 1;
197      striplen=(groupcontrol >> 2) & 3;
198      userclip=(groupcontrol >> 0) & 3;
199      objcontrol=(tafifo_buff[0] >> 0) & 0xffff;
200      shadow=(objcontrol >> 7) & 1;
201      volume=(objcontrol >> 6) & 1;
202      coltype=(objcontrol >> 4) & 3;
203      texture=(objcontrol >> 3) & 1;
204      offfset=(objcontrol >> 2) & 1;
205      gouraud=(objcontrol >> 1) & 1;
206      uv16bit=(objcontrol >> 0) & 1;
228      if ((paratype >= 4) && (paratype <= 6))
229      {
230         global_paratype = paratype;
231         groupcontrol=(tafifo_buff[0] >> 16) & 0xff;
232         groupen=(groupcontrol >> 7) & 1;
233         striplen=(groupcontrol >> 2) & 3;
234         userclip=(groupcontrol >> 0) & 3;
235         objcontrol=(tafifo_buff[0] >> 0) & 0xffff;
236         shadow=(objcontrol >> 7) & 1;
237         volume=(objcontrol >> 6) & 1;
238         coltype=(objcontrol >> 4) & 3;
239         texture=(objcontrol >> 3) & 1;
240         offfset=(objcontrol >> 2) & 1;
241         gouraud=(objcontrol >> 1) & 1;
242         uv16bit=(objcontrol >> 0) & 1;
243      }
207244
208245      if (toerasesprites == 1)
209246      {
r1679r1680
214251      // check if we need 8 words more
215252      if (tafifo_mask == 7)
216253      {
217         if ((paratype == 4) && (((coltype >= 2) && (offfset == 1)) || ((coltype >= 2) && (volume == 1))))
254         parameterconfig = pvr_parameterconfig[objcontrol & 0x3d];
255         // decide number of words per vertex
256         if (paratype == 7)
218257         {
219            tafifo_mask = 15;
220            tafifo_pos = 8;
221            return;
258            if ((global_paratype == 5) || (tafifo_listtype == 1) || (tafifo_listtype == 3))
259               tafifo_vertexwords = 16;
260            if (tafifo_vertexwords == 16)
261            {
262               tafifo_mask = 15;
263               tafifo_pos = 8;
264               return;
265            }
222266         }
223
224         if ((paratype == 7) && (tafifo_vertexwords == 16))
225         {
226            tafifo_mask = 15;
227            tafifo_pos = 8;
228            return;
229         }
267         tafifo_vertexwords=pvr_wordsvertex[parameterconfig];
268         if ((paratype == 4) && ((listtype != 1) && (listtype != 3)))
269            if (pvr_wordspolygon[parameterconfig] == 16)
270            {
271               tafifo_mask = 15;
272               tafifo_pos = 8;
273               return;
274            }
230275      }
231276      else
232277      {
r1679r1680
235280
236281      // now we heve all the needed words
237282      // interpret their meaning
238      if (tafifo_buff[0] == 0)
239      {
283      if (paratype == 0)
284      { // end of list
240285         a=0; // 6-10 0-3
241286         switch (tafifo_listtype)
242287         {
r1679r1680
255300         case 4:
256301            a = 1 << 21;
257302            break;
258            break;
259303         }
260304         sysctrl_regs[SB_ISTNRM] |= a;
261305         update_interrupt_status();
262         tafifo_listtype= -1;
306         tafifo_listtype= -1; // no list being received
263307      }
308      else if (paratype == 1)
309      {
310         #if DEBUG_PVRDLIST
311         mame_printf_verbose("Para Type 1 User Tile Clip\n");
312         mame_printf_verbose(" (%d , %d)-(%d , %d)\n", tafifo_buff[4], tafifo_buff[5], tafifo_buff[6], tafifo_buff[7]);
313         #endif
314      }
315      else if (paratype == 2)
316      {
317         #if DEBUG_PVRDLIST
318         mame_printf_verbose("Para Type 2 Object List Set at %08x\n", tafifo_buff[1]);
319         mame_printf_verbose(" (%d , %d)-(%d , %d)\n", tafifo_buff[4], tafifo_buff[5], tafifo_buff[6], tafifo_buff[7]);
320         #endif
321      }
322      else if (paratype == 3)
323      {
324         #if DEBUG_PVRDLIST
325         mame_printf_verbose("Para Type %x Unknown!\n", tafifo_buff[0]);
326         #endif
327      }
264328      else
265329      {
266330         #if DEBUG_PVRDLIST
267331         mame_printf_verbose("Para Type %d End of Strip %d List Type %d\n", paratype, endofstrip, listtype);
268332         #endif
269333
270         if (((paratype == 4) && (texture == 1)) || (paratype == 5))
334         // set type of list currently being recieved
335         if ((paratype == 4) || (paratype == 5) || (paratype == 6))
271336         {
337            if (tafifo_listtype < 0)
338            {
339               tafifo_listtype = listtype;
340            }
341         }
342
343         if ((paratype == 4) || (paratype == 5))
344         { // quad or polygon
272345            depthcomparemode=(tafifo_buff[1] >> 29) & 7;
273346            cullingmode=(tafifo_buff[1] >> 27) & 3;
274347            zwritedisable=(tafifo_buff[1] >> 26) & 1;
r1679r1680
292365            sstexture=(tafifo_buff[2] >> 12) & 1;
293366            mmdadjust=(tafifo_buff[2] >> 8) & 1;
294367            tsinstruction=(tafifo_buff[2] >> 6) & 3;
295            textureaddress=(tafifo_buff[3] & 0x1FFFFF) << 3;
296            scanorder=(tafifo_buff[3] >> 26) & 1;
297            pixelformat=(tafifo_buff[3] >> 27) & 7;
298            mipmapped=(tafifo_buff[3] >> 31) & 1;
299            vqcompressed=(tafifo_buff[3] >> 30) & 1;
300            strideselect=(tafifo_buff[3] >> 25) & 1;
301
302            #if DEBUG_PVRDLIST
303            mame_printf_verbose(" Texture %d x %d at %08x format %d\n", textureusize, texturevsize, (tafifo_buff[3] & 0x1FFFFF) << 3, pixelformat);
304            #endif
368            if (texture == 1)
369            {
370               textureaddress=(tafifo_buff[3] & 0x1FFFFF) << 3;
371               scanorder=(tafifo_buff[3] >> 26) & 1;
372               pixelformat=(tafifo_buff[3] >> 27) & 7;
373               mipmapped=(tafifo_buff[3] >> 31) & 1;
374               vqcompressed=(tafifo_buff[3] >> 30) & 1;
375               strideselect=(tafifo_buff[3] >> 25) & 1;
376               #if DEBUG_PVRDLIST
377               mame_printf_verbose(" Texture %d x %d at %08x format %d\n", textureusize, texturevsize, (tafifo_buff[3] & 0x1FFFFF) << 3, pixelformat);
378               #endif
379            }
380            if (paratype == 4)
381            {
382               #if DEBUG_PVRDLIST
383               mame_printf_verbose(" Sprite\n");
384               #endif
385            }
386            if (paratype == 5)
387            {
388               #if DEBUG_PVRDLIST
389               mame_printf_verbose(" Polygon\n");
390               #endif
391            }
305392         }
306393
307394         if (paratype == 7)
308395         { // vertex
309            #if DEBUG_PVRDLIST
310            mame_printf_verbose(" test vertex ");
311            for (a=1; a <= 11; a++)
396            if (global_paratype == 5)
312397            {
313               mame_printf_verbose(" %e", u2f(tafifo_buff[a]));
314            }
315            mame_printf_verbose("\n");
316            mame_printf_verbose(" %e %e %e %e %e %e\n",u2f(tafifo_buff[13] & 0xffff0000),u2f((tafifo_buff[13] & 0xffff) << 16),u2f(tafifo_buff[14] & 0xffff0000),u2f((tafifo_buff[14] & 0xffff) << 16),u2f(tafifo_buff[15] & 0xffff0000),u2f((tafifo_buff[15] & 0xffff) << 16));
317            #endif
398               #if DEBUG_PVRDLIST
399               mame_printf_verbose(" Vertex sprite");
400               for (a=1; a <= 11; a++)
401               {
402                  mame_printf_verbose(" %f", u2f(tafifo_buff[a]));
403               }
404               mame_printf_verbose("\n");
405               #endif
406               if (texture == 1)
407               {
408                  #if DEBUG_PVRDLIST
409                  mame_printf_verbose(" %f %f %f %f %f %f\n",u2f(tafifo_buff[13] & 0xffff0000),u2f((tafifo_buff[13] & 0xffff) << 16),u2f(tafifo_buff[14] & 0xffff0000),u2f((tafifo_buff[14] & 0xffff) << 16),u2f(tafifo_buff[15] & 0xffff0000),u2f((tafifo_buff[15] & 0xffff) << 16));
410                  #endif
318411/* test video start */
319            // pixely=u2f((tafifo_buff[13] & 0xffff) << 16)*1024
320            showsprites[testsprites_size].positionx=u2f(tafifo_buff[1]);
321            showsprites[testsprites_size].positiony=u2f(tafifo_buff[2]);
322            showsprites[testsprites_size].sizex=u2f(tafifo_buff[4])-u2f(tafifo_buff[1]);
323            showsprites[testsprites_size].sizey=u2f(tafifo_buff[8])-u2f(tafifo_buff[2]);
324            showsprites[testsprites_size].u=u2f(tafifo_buff[13] & 0xffff0000);
325            showsprites[testsprites_size].v=u2f((tafifo_buff[13] & 0xffff) << 16);
326            showsprites[testsprites_size].du=u2f(tafifo_buff[14] & 0xffff0000)-showsprites[testsprites_size].u;
327            showsprites[testsprites_size].dv=u2f((tafifo_buff[15] & 0xffff) << 16)-showsprites[testsprites_size].v;
328            showsprites[testsprites_size].textureaddress=textureaddress;
329            showsprites[testsprites_size].texturesizex=textureusize;
330            showsprites[testsprites_size].texturesizey=texturevsize;
331            showsprites[testsprites_size].texturemode=scanorder;
332            showsprites[testsprites_size].texturesizes=texturesizes;
333            showsprites[testsprites_size].texturepf=pixelformat;
334            testsprites_size=testsprites_size+1;
412                  showsprites[testsprites_size].positionx=u2f(tafifo_buff[1]);
413                  showsprites[testsprites_size].positiony=u2f(tafifo_buff[2]);
414                  showsprites[testsprites_size].sizex=u2f(tafifo_buff[4])-u2f(tafifo_buff[1]);
415                  showsprites[testsprites_size].sizey=u2f(tafifo_buff[8])-u2f(tafifo_buff[2]);
416                  showsprites[testsprites_size].u=u2f(tafifo_buff[13] & 0xffff0000);
417                  showsprites[testsprites_size].v=u2f((tafifo_buff[13] & 0xffff) << 16);
418                  showsprites[testsprites_size].du=u2f(tafifo_buff[14] & 0xffff0000)-showsprites[testsprites_size].u;
419                  showsprites[testsprites_size].dv=u2f((tafifo_buff[15] & 0xffff) << 16)-showsprites[testsprites_size].v;
420                  showsprites[testsprites_size].textureaddress=textureaddress;
421                  showsprites[testsprites_size].texturesizex=textureusize;
422                  showsprites[testsprites_size].texturesizey=texturevsize;
423                  showsprites[testsprites_size].texturemode=scanorder+vqcompressed*2;
424                  showsprites[testsprites_size].texturesizes=texturesizes;
425                  showsprites[testsprites_size].texturepf=pixelformat;
426                  testsprites_size=testsprites_size+1;
335427/* test video end */
336         }
337
338         if (paratype != 7)
339         {
340            tafifo_vertexwords=8;
341         }
342         if (((paratype == 4) && ((texture == 1) || (coltype == 1))) || (paratype == 5))
343         {
344            tafifo_vertexwords=16;
345         }
346         if ((paratype == 4) || (paratype == 5) || (paratype == 6))
347         {
348            if (tafifo_listtype < 0)
428               }
429            }
430            if ((tafifo_listtype == 1) || (tafifo_listtype == 3))
349431            {
350               tafifo_listtype = listtype;
432               #if DEBUG_PVRDLIST
433               mame_printf_verbose(" Vertex modifier volume");
434               for (a=1; a <= 11; a++)
435               {
436                  mame_printf_verbose(" %f", u2f(tafifo_buff[a]));
437               }
438               mame_printf_verbose("\n");
439               #endif
351440            }
441            if (global_paratype == 4)
442            {
443               #if DEBUG_PVRDLIST
444               mame_printf_verbose(" Vertex polygon");
445               mame_printf_verbose("\n");
446               #endif
447            }
352448         }
353449      }
354450   } // if (tafifo_pos == 0)
r1679r1680
356452
357453WRITE64_HANDLER( ta_fifo_yuv_w )
358454{
359   mame_printf_verbose("YUV FIFO: write %llx to %x, mask %llx\n", data, offset, mem_mask);
455   int reg;
456   UINT64 shift;
457   UINT32 dat;
458
459   reg = decode_reg_64(offset, mem_mask, &shift);
460   dat = (UINT32)(data >> shift);
461
462   mame_printf_verbose("YUV FIFO: [%08x=%x] write %llx to %x, mask %llx\n", 0x10800000+reg*4, dat, data, offset, mem_mask);
360463}
361464
362465/* test video start */
r1679r1680
414517   UINT32 *bmpaddr;
415518   int c,xt,yt,cd;
416519
417   fillbitmap(bitmap,MAKE_RGB(128,128,128),cliprect);
520   fillbitmap(bitmap,program_read_dword_64le(0x05000000+6*4),cliprect);
418521   for (cs=0;cs < testsprites_size;cs++)
419522   {
420523      dx=showsprites[cs].sizex;
r1679r1680
446549
447550            if (showsprites[cs].texturemode == 1)
448551               addrp=showsprites[cs].textureaddress+(showsprites[cs].texturesizex*yt+xt)*2;
552            else if (showsprites[cs].texturemode == 0)
553               addrp=showsprites[cs].textureaddress+(dilated1[cd][xt] + dilated0[cd][yt])*2;
449554            else
450               addrp=showsprites[cs].textureaddress+(dilated1[cd][xt] + dilated0[cd][yt])*2;
555            {
556               c=0x800+(dilated1[cd][xt >> 1] + dilated0[cd][yt >> 1]);
557               c=*(((UINT8 *)dc_texture_ram) + BYTE_XOR_LE(showsprites[cs].textureaddress+c));
558               addrp=showsprites[cs].textureaddress+c*8+(dilated1[cd][xt & 1] + dilated0[cd][yt & 1])*2;
559            }
451560
452561            c=*(((UINT16 *)dc_texture_ram) + (WORD2_XOR_LE(addrp) >> 1));
453562            if (showsprites[cs].texturepf == 2)
r1679r1680
468577}
469578/* test video end */
470579
580static void pvr_build_parameterconfig(void)
581{
582   int a,b,c,d,e,p;
583
584   for (a = 0;a <= 63;a++)
585      pvr_parameterconfig[a] = -1;
586   p=0;
587   // volume,col_type,texture,offset,16bit_uv
588   for (a = 0;a <= 1;a++)
589      for (b = 0;b <= 3;b++)
590         for (c = 0;c <= 1;c++)
591            if (c == 0)
592            {
593               for (d = 0;d <= 1;d++)
594                  for (e = 0;e <= 1;e++)
595                     pvr_parameterconfig[(a << 6) | (b << 4) | (c << 3) | (d << 2) | (e << 0)] = pvr_parconfseq[p];
596               p++;
597            }
598            else
599               for (d = 0;d <= 1;d++)
600                  for (e = 0;e <= 1;e++)
601                  {
602                     pvr_parameterconfig[(a << 6) | (b << 4) | (c << 3) | (d << 2) | (e << 0)] = pvr_parconfseq[p];
603                     p++;
604                  }
605   for (a = 1;a <= 63;a++)
606      if (pvr_parameterconfig[a] < 0)
607         pvr_parameterconfig[a] = pvr_parameterconfig[a-1];
608}
609
471610VIDEO_START(dc)
472611{
473612   memset(pvrctrl_regs, 0, sizeof(pvrctrl_regs));
474613   memset(pvrta_regs, 0, sizeof(pvrta_regs));
614   pvr_build_parameterconfig();
475615
476616   // if the next 2 registers do not have the correct values, the naomi bios will hang
477617   pvrta_regs[PVRID]=0x17fd11db;
src/mame/video/mole.c
r1679r1680
3232   tileram = (UINT16 *)auto_malloc(0x400 * sizeof(UINT16));
3333
3434   bg_tilemap = tilemap_create(get_bg_tile_info, tilemap_scan_rows,
35      TILEMAP_TYPE_PEN, 8, 8, 40, 25);
35      8, 8, 40, 25);
3636}
3737
3838WRITE8_HANDLER( mole_videoram_w )
src/mame/video/taitojc.c
r1679r1680
205205
206206   assert(taitojc_gfx_index != MAX_GFX_ELEMENTS);
207207
208   taitojc_tilemap = tilemap_create(taitojc_tile_info, tilemap_scan_rows, TILEMAP_TYPE_PEN, 16, 16, 64, 64);
208   taitojc_tilemap = tilemap_create(taitojc_tile_info, tilemap_scan_rows, 16, 16, 64, 64);
209209   taitojc_dirty_map = auto_malloc(TAITOJC_NUM_TILES);
210210
211211   tilemap_set_transparent_pen(taitojc_tilemap, 0);
src/mame/video/pitnrun.c
r1679r1680
177177
178178VIDEO_START(pitnrun)
179179{
180   fg = tilemap_create( get_tile_info1,tilemap_scan_rows,TILEMAP_TYPE_PEN,8,8,32,32 );
181   bg = tilemap_create( get_tile_info2,tilemap_scan_rows,TILEMAP_TYPE_PEN,8,8,32*4,32 );
180   fg = tilemap_create( get_tile_info1,tilemap_scan_rows,8,8,32,32 );
181   bg = tilemap_create( get_tile_info2,tilemap_scan_rows,8,8,32*4,32 );
182182   tilemap_set_transparent_pen( fg, 0 );
183183   tmp_bitmap[0] = auto_bitmap_alloc(128,128,machine->screen[0].format);
184184   tmp_bitmap[1] = auto_bitmap_alloc(128,128,machine->screen[0].format);
src/mame/video/segaic16.c
r1679r1680
12661266   }
12671267
12681268   /* create the tilemap for the text layer */
1269   info->textmap = tilemap_create(get_text_info, tilemap_scan_rows, TILEMAP_TYPE_PEN, 8,8, 64,28);
1269   info->textmap = tilemap_create(get_text_info, tilemap_scan_rows, 8,8, 64,28);
12701270
12711271   /* configure it */
12721272   info->textmap_info.rambase = info->textram;
r1679r1680
12821282   for (pagenum = 0; pagenum < info->numpages; pagenum++)
12831283   {
12841284      /* each page is 64x32 */
1285      info->tilemaps[pagenum] = tilemap_create(get_tile_info, tilemap_scan_rows, TILEMAP_TYPE_PEN, 8,8, 64,32);
1285      info->tilemaps[pagenum] = tilemap_create(get_tile_info, tilemap_scan_rows, 8,8, 64,32);
12861286
12871287      /* configure the tilemap */
12881288      info->tilemap_info[pagenum].rambase = info->tileram + pagenum * 64*32;
src/mame/video/midzeus2.c
r1679r1680
535535            zeus_fifo_words = 0;
536536
537537         /* set the interrupt signal to indicate we can handle more */
538         timer_adjust(int_timer, ATTOTIME_IN_NSEC(500), 0, attotime_zero);
538         timer_adjust_oneshot(int_timer, ATTOTIME_IN_NSEC(500), 0);
539539         break;
540540
541541      case 0x20:
src/mame/video/tehkanwc.c
r1679r1680
9292VIDEO_START( tehkanwc )
9393{
9494   bg_tilemap = tilemap_create(get_bg_tile_info, tilemap_scan_rows,
95      TILEMAP_TYPE_PEN, 16, 8, 32, 32);
95      16, 8, 32, 32);
9696
9797   fg_tilemap = tilemap_create(get_fg_tile_info, tilemap_scan_rows,
98      TILEMAP_TYPE_PEN, 8, 8, 32, 32);
98      8, 8, 32, 32);
9999
100100   tilemap_set_transparent_pen(fg_tilemap, 0);
101101}
src/mame/video/bionicc.c
r1679r1680
9393
9494VIDEO_START( bionicc )
9595{
96   tx_tilemap = tilemap_create(get_tx_tile_info,tilemap_scan_rows,TILEMAP_TYPE_PEN,  8,8,32,32);
97   fg_tilemap = tilemap_create(get_fg_tile_info,tilemap_scan_rows,TILEMAP_TYPE_PEN,      16,16,64,64);
98   bg_tilemap = tilemap_create(get_bg_tile_info,tilemap_scan_rows,TILEMAP_TYPE_PEN,  8,8,64,64);
96   tx_tilemap = tilemap_create(get_tx_tile_info,tilemap_scan_rows,  8,8,32,32);
97   fg_tilemap = tilemap_create(get_fg_tile_info,tilemap_scan_rows,      16,16,64,64);
98   bg_tilemap = tilemap_create(get_bg_tile_info,tilemap_scan_rows,  8,8,64,64);
9999
100100   tilemap_set_transparent_pen(tx_tilemap,3);
101101   tilemap_set_transmask(fg_tilemap,0,0xffff,0x8000); /* split type 0 is completely transparent in front half */
src/mame/video/citycon.c
r1679r1680
6161
6262VIDEO_START( citycon )
6363{
64   fg_tilemap = tilemap_create(get_fg_tile_info,citycon_scan,TILEMAP_TYPE_PEN,8,8,128,32);
65   bg_tilemap = tilemap_create(get_bg_tile_info,citycon_scan,TILEMAP_TYPE_PEN,     8,8,128,32);
64   fg_tilemap = tilemap_create(get_fg_tile_info,citycon_scan,8,8,128,32);
65   bg_tilemap = tilemap_create(get_bg_tile_info,citycon_scan,     8,8,128,32);
6666
6767   tilemap_set_transparent_pen(fg_tilemap,0);
6868   tilemap_set_scroll_rows(fg_tilemap,32);
src/mame/video/suprridr.c
r1679r1680
4747
4848VIDEO_START( suprridr )
4949{
50   fg_tilemap          = tilemap_create(get_tile_info2, tilemap_scan_rows, TILEMAP_TYPE_PEN, 8,8, 32,32);
51   bg_tilemap          = tilemap_create(get_tile_info,  tilemap_scan_rows, TILEMAP_TYPE_PEN,      8,8, 32,32);
52   bg_tilemap_noscroll = tilemap_create(get_tile_info,  tilemap_scan_rows, TILEMAP_TYPE_PEN,      8,8, 32,32);
50   fg_tilemap          = tilemap_create(get_tile_info2, tilemap_scan_rows,  8,8, 32,32);
51   bg_tilemap          = tilemap_create(get_tile_info,  tilemap_scan_rows,       8,8, 32,32);
52   bg_tilemap_noscroll = tilemap_create(get_tile_info,  tilemap_scan_rows,       8,8, 32,32);
5353
5454   tilemap_set_transparent_pen(fg_tilemap, 0);
5555}
src/mame/video/psikyo.c
r1679r1680
170170
171171   tilemap_0_size0   =   tilemap_create(   get_tile_info_0,
172172                           tilemap_scan_rows,
173                           TILEMAP_TYPE_PEN,
173
174174                           16,16,
175175                           0x20, 0x80 );
176176   tilemap_0_size1   =   tilemap_create(   get_tile_info_0,
177177                           tilemap_scan_rows,
178                           TILEMAP_TYPE_PEN,
178
179179                           16,16,
180180                           0x40, 0x40 );
181181
182182   tilemap_0_size2   =   tilemap_create(   get_tile_info_0,
183183                           tilemap_scan_rows,
184                           TILEMAP_TYPE_PEN,
184
185185                           16,16,
186186                           0x80, 0x20 );
187187
188188   tilemap_0_size3   =   tilemap_create(   get_tile_info_0,
189189                           tilemap_scan_rows,
190                           TILEMAP_TYPE_PEN,
190
191191                           16,16,
192192                           0x100, 0x10 );
193193
194194   tilemap_1_size0   =   tilemap_create(   get_tile_info_1,
195195                           tilemap_scan_rows,
196                           TILEMAP_TYPE_PEN,
196
197197                           16,16,
198198                           0x20, 0x80 );
199199
200200   tilemap_1_size1   =   tilemap_create(   get_tile_info_1,
201201                           tilemap_scan_rows,
202                           TILEMAP_TYPE_PEN,
202
203203                           16,16,
204204                           0x40, 0x40 );
205205
206206   tilemap_1_size2   =   tilemap_create(   get_tile_info_1,
207207                           tilemap_scan_rows,
208                           TILEMAP_TYPE_PEN,
208
209209                           16,16,
210210                           0x80, 0x20 );
211211
212212   tilemap_1_size3   =   tilemap_create(   get_tile_info_1,
213213                           tilemap_scan_rows,
214                           TILEMAP_TYPE_PEN,
214
215215                           16,16,
216216                           0x100, 0x10 );
217217
src/mame/video/playmark.c
r1679r1680
112112
113113VIDEO_START( bigtwin )
114114{
115   tx_tilemap = tilemap_create(bigtwin_get_tx_tile_info,tilemap_scan_rows,TILEMAP_TYPE_PEN, 8, 8,64,32);
116   fg_tilemap = tilemap_create(bigtwin_get_fg_tile_info,tilemap_scan_rows,TILEMAP_TYPE_PEN,     16,16,32,32);
115   tx_tilemap = tilemap_create(bigtwin_get_tx_tile_info,tilemap_scan_rows, 8, 8,64,32);
116   fg_tilemap = tilemap_create(bigtwin_get_fg_tile_info,tilemap_scan_rows,     16,16,32,32);
117117
118118   tilemap_set_transparent_pen(tx_tilemap,0);
119119
r1679r1680
125125
126126VIDEO_START( wbeachvl )
127127{
128   tx_tilemap = tilemap_create(wbeachvl_get_tx_tile_info,tilemap_scan_rows,TILEMAP_TYPE_PEN, 8, 8,64,32);
129   fg_tilemap = tilemap_create(wbeachvl_get_fg_tile_info,tilemap_scan_rows,TILEMAP_TYPE_PEN,16,16,64,32);
130   bg_tilemap = tilemap_create(wbeachvl_get_bg_tile_info,tilemap_scan_rows,TILEMAP_TYPE_PEN,     16,16,64,32);
128   tx_tilemap = tilemap_create(wbeachvl_get_tx_tile_info,tilemap_scan_rows, 8, 8,64,32);
129   fg_tilemap = tilemap_create(wbeachvl_get_fg_tile_info,tilemap_scan_rows,16,16,64,32);
130   bg_tilemap = tilemap_create(wbeachvl_get_bg_tile_info,tilemap_scan_rows,     16,16,64,32);
131131
132132   tilemap_set_transparent_pen(tx_tilemap,0);
133133   tilemap_set_transparent_pen(fg_tilemap,0);
r1679r1680
139139
140140VIDEO_START( excelsr )
141141{
142   tx_tilemap = tilemap_create(bigtwin_get_tx_tile_info,tilemap_scan_rows,TILEMAP_TYPE_PEN,16,16,32,32);
143   fg_tilemap = tilemap_create(bigtwin_get_fg_tile_info,tilemap_scan_rows,TILEMAP_TYPE_PEN,     16,16,32,32);
142   tx_tilemap = tilemap_create(bigtwin_get_tx_tile_info,tilemap_scan_rows,16,16,32,32);
143   fg_tilemap = tilemap_create(bigtwin_get_fg_tile_info,tilemap_scan_rows,     16,16,32,32);
144144
145145   tilemap_set_transparent_pen(tx_tilemap,0);
146146
r1679r1680
151151
152152VIDEO_START( hotmind )
153153{
154   tx_tilemap = tilemap_create(hrdtimes_get_tx_tile_info,tilemap_scan_rows,TILEMAP_TYPE_PEN, 8, 8,64,64);
155   fg_tilemap = tilemap_create(hrdtimes_get_fg_tile_info,tilemap_scan_rows,TILEMAP_TYPE_PEN,16,16,32,32);
156   bg_tilemap = tilemap_create(hrdtimes_get_bg_tile_info,tilemap_scan_rows,TILEMAP_TYPE_PEN,     16,16,32,32);
154   tx_tilemap = tilemap_create(hrdtimes_get_tx_tile_info,tilemap_scan_rows, 8, 8,64,64);
155   fg_tilemap = tilemap_create(hrdtimes_get_fg_tile_info,tilemap_scan_rows,16,16,32,32);
156   bg_tilemap = tilemap_create(hrdtimes_get_bg_tile_info,tilemap_scan_rows,     16,16,32,32);
157157
158158   tilemap_set_transparent_pen(tx_tilemap,0);
159159   tilemap_set_transparent_pen(fg_tilemap,0);
r1679r1680
173173
174174VIDEO_START( hrdtimes )
175175{
176   tx_tilemap = tilemap_create(hrdtimes_get_tx_tile_info,tilemap_scan_rows,TILEMAP_TYPE_PEN, 8, 8,64,64);
177   fg_tilemap = tilemap_create(hrdtimes_get_fg_tile_info,tilemap_scan_rows,TILEMAP_TYPE_PEN,16,16,32,32);
178   bg_tilemap = tilemap_create(hrdtimes_get_bg_tile_info,tilemap_scan_rows,TILEMAP_TYPE_PEN,     16,16,32,32);
176   tx_tilemap = tilemap_create(hrdtimes_get_tx_tile_info,tilemap_scan_rows, 8, 8,64,64);
177   fg_tilemap = tilemap_create(hrdtimes_get_fg_tile_info,tilemap_scan_rows,16,16,32,32);
178   bg_tilemap = tilemap_create(hrdtimes_get_bg_tile_info,tilemap_scan_rows,     16,16,32,32);
179179
180180   tilemap_set_transparent_pen(tx_tilemap,0);
181181   tilemap_set_transparent_pen(fg_tilemap,0);
src/mame/video/ampoker2.c
r1679r1680
102102VIDEO_START(ampoker2)
103103{
104104   bg_tilemap = tilemap_create(get_bg_tile_info, tilemap_scan_rows,
105      TILEMAP_TYPE_PEN, 8, 8, 64, 32);
105      8, 8, 64, 32);
106106}
107107
108108VIDEO_START(sigma2k)
109109{
110110   bg_tilemap = tilemap_create(s2k_get_bg_tile_info, tilemap_scan_rows,
111      TILEMAP_TYPE_PEN, 8, 8, 64, 32);
111      8, 8, 64, 32);
112112}
113113
114114VIDEO_UPDATE(ampoker2)
src/mame/video/esd16.c
r1679r1680
133133VIDEO_START( esd16 )
134134{
135135   esdtilemap_0 = tilemap_create(   get_tile_info_0, tilemap_scan_rows,
136                        TILEMAP_TYPE_PEN,         8,8,   0x80,0x40);
136                                 8,8,   0x80,0x40);
137137
138138   esdtilemap_1 = tilemap_create(   get_tile_info_1, tilemap_scan_rows,
139                        TILEMAP_TYPE_PEN,   8,8,   0x80,0x40);
139                           8,8,   0x80,0x40);
140140
141141   /* hedpanic changes tilemap 1 to 16x16 at various times */
142142   esdtilemap_1_16x16 = tilemap_create(   get_tile_info_1_16x16, tilemap_scan_rows,
143                        TILEMAP_TYPE_PEN,   16,16,   0x40,0x40);
143                           16,16,   0x40,0x40);
144144
145145   tilemap_set_scrolldx(esdtilemap_0, -0x60 + 2, -0x60     );
146146   tilemap_set_scrolldx(esdtilemap_1, -0x60    , -0x60 + 2 );
src/mame/video/pgm.c
r1679r1680
307307
308308VIDEO_START( pgm )
309309{
310   pgm_tx_tilemap= tilemap_create(get_pgm_tx_tilemap_tile_info,tilemap_scan_rows,TILEMAP_TYPE_PEN, 8, 8,64,32);
310   pgm_tx_tilemap= tilemap_create(get_pgm_tx_tilemap_tile_info,tilemap_scan_rows, 8, 8,64,32);
311311   tilemap_set_transparent_pen(pgm_tx_tilemap,15);
312312
313   pgm_bg_tilemap = tilemap_create(get_pgm_bg_tilemap_tile_info,tilemap_scan_rows,TILEMAP_TYPE_PEN, 32, 32,64,64);
313   pgm_bg_tilemap = tilemap_create(get_pgm_bg_tilemap_tile_info,tilemap_scan_rows, 32, 32,64,64);
314314   tilemap_set_transparent_pen(pgm_bg_tilemap,31);
315315   tilemap_set_scroll_rows(pgm_bg_tilemap,64*32);
316316
src/mame/video/iqblock.c
r1679r1680
4747
4848VIDEO_START( iqblock )
4949{
50   bg_tilemap = tilemap_create(get_bg_tile_info,tilemap_scan_rows,TILEMAP_TYPE_PEN,     8, 8,64,32);
51   fg_tilemap = tilemap_create(get_fg_tile_info,tilemap_scan_rows,TILEMAP_TYPE_PEN,8,32,64, 8);
50   bg_tilemap = tilemap_create(get_bg_tile_info,tilemap_scan_rows,     8, 8,64,32);
51   fg_tilemap = tilemap_create(get_fg_tile_info,tilemap_scan_rows,8,32,64, 8);
5252
5353   tilemap_set_transparent_pen(bg_tilemap,0);
5454   tilemap_set_scroll_cols(fg_tilemap,64);
src/mame/video/ikki.c
r1679r1680
1010
1111#include "driver.h"
1212
13static UINT8 ikki_flipscreen, ikki_scroll[2];
13UINT8 *ikki_scroll;
1414
15static mame_bitmap *sprite_bitmap;
16static UINT8 ikki_flipscreen;
17static int punch_through_pen;
18
1519PALETTE_INIT( ikki )
1620{
1721   int i;
1822
19   for (i = 0; i<256; i++)
23   /* allocate the colortable - extra pen for the punch through pen */
24   machine->colortable = colortable_alloc(machine, 0x101);
25
26   /* create a lookup table for the palette */
27   for (i = 0; i < 0x100; i++)
2028   {
21      palette_set_color_rgb(machine,i,pal4bit(color_prom[0]),pal4bit(color_prom[256]),pal4bit(color_prom[2*256]));
29      int r = pal4bit(color_prom[i + 0x000]);
30      int g = pal4bit(color_prom[i + 0x100]);
31      int b = pal4bit(color_prom[i + 0x200]);
2232
23      color_prom++;
33      colortable_palette_set_color(machine->colortable, i, MAKE_RGB(r, g, b));
2434   }
2535
26   /* 256th color is not drawn on screen */
27   /* this is used for special transparent function */
28   palette_set_color(machine,256,MAKE_RGB(0,0,1));
29
30   color_prom += 2*256;
31
3236   /* color_prom now points to the beginning of the lookup table */
37   color_prom += 0x300;
3338
3439   /* sprites lookup table */
35   for (i=0; i<512; i++)
40   for (i = 0; i < 0x200; i++)
3641   {
37      int d = 255-*(color_prom++);
38      if ( ((i % 8) == 7) && (d == 0) )
39         *(colortable++) = 256; /* special transparent */
40      else
41         *(colortable++) = d; /* normal color */
42      UINT16 ctabentry = color_prom[i] ^ 0xff;
43
44      if (((i & 0x07) == 0x07) && (ctabentry == 0))
45      {
46         /* punch through */
47         punch_through_pen = i;
48         ctabentry = 0x100;
49      }
50
51      colortable_entry_set_value(machine->colortable, i, ctabentry);
4252   }
4353
4454   /* bg lookup table */
45   for (i=0; i<512; i++)
46      *(colortable++) = *(color_prom++);
47
55   for (i = 0x200; i < 0x400; i++)
56   {
57      UINT8 ctabentry = color_prom[i];
58      colortable_entry_set_value(machine->colortable, i, ctabentry);
59   }
4860}
4961
5062WRITE8_HANDLER( ikki_scroll_w )
r1679r1680
5769   ikki_flipscreen = (data >> 2) & 1;
5870}
5971
72
73static void draw_sprites(running_machine *machine, mame_bitmap *bitmap, const rectangle *cliprect)
74{
75   int y;
76   offs_t offs;
77
78   fillbitmap(sprite_bitmap, punch_through_pen, cliprect);
79
80   for (offs = 0; offs < 0x800; offs += 4)
81   {
82      int code = (spriteram[offs + 2] & 0x80) | (spriteram[offs + 1] >> 1);
83      int color = spriteram[offs + 2] & 0x3f;
84
85      int x = spriteram[offs + 3];
86          y = spriteram[offs + 0];
87
88      if (ikki_flipscreen)
89         x = 240 - x;
90      else
91         y = 224 - y;
92
93      x = x & 0xff;
94      y = y & 0xff;
95
96      if (x > 248)
97         x = x - 256;
98
99      if (y > 240)
100         y = y - 256;
101
102      drawgfx(sprite_bitmap,machine->gfx[1],
103            code, color,
104            ikki_flipscreen,ikki_flipscreen,
105            x,y,
106            cliprect, TRANSPARENCY_PENS,
107            colortable_get_transpen_mask(machine->colortable, machine->gfx[1], color, 0));
108   }
109
110   /* copy the sprite bitmap into the main bitmap, skipping the transparent pixels */
111   for (y = cliprect->min_y; y <= cliprect->max_y; y++)
112   {
113      int x;
114
115      for (x = cliprect->min_x; x <= cliprect->max_x; x++)
116      {
117         UINT16 pen = *BITMAP_ADDR16(sprite_bitmap, y, x);
118
119         if (colortable_entry_get_value(machine->colortable, pen) != 0x100)
120            *BITMAP_ADDR16(bitmap, y, x) = pen;
121      }
122   }
123}
124
125
126VIDEO_START( ikki )
127{
128   sprite_bitmap = auto_bitmap_alloc(machine->screen[0].width, machine->screen[0].height, machine->screen[0].format);
129}
130
131
60132VIDEO_UPDATE( ikki )
61133{
62
63   int offs,chr,col,px,py,f,bank,d;
134   offs_t offs;
64135   UINT8 *VIDEOATTR = memory_region( REGION_USER1 );
65136
66   f = ikki_flipscreen;
67
68137   /* draw bg layer */
69138
70139   for (offs=0; offs<(videoram_size/2); offs++)
71140   {
72      int sx,sy;
141      int color, bank;
73142
74      sx = offs / 32;
75      sy = offs % 32;
143      int sx = offs / 32;
144      int sy = offs % 32;
145      int y = sy*8;
146      int x = sx*8;
76147
77      py = sy*8;
78      px = sx*8;
148      int d = VIDEOATTR[ sx ];
79149
80      d = VIDEOATTR[ sx ];
81
82150      switch (d)
83151      {
84152         case 0x02: /* scroll area */
85            px = sx*8 - ikki_scroll[1];
86            if (px<0)
87               px=px+8*22;
88            py = (sy*8 + ~ikki_scroll[0]) & 0xff;
153            x = sx*8 - ikki_scroll[1];
154            if (x<0)
155               x=x+8*22;
156            y = (sy*8 + ~ikki_scroll[0]) & 0xff;
89157            break;
90158
91159         case 0x03: /* non-scroll area */
r1679r1680
104172            break;
105173      }
106174
107      if (f != 0)
175      if (ikki_flipscreen)
108176      {
109         px = 248-px;
110         py = 248-py;
177         x = 248-x;
178         y = 248-y;
111179      }
112180
113      col = videoram[offs*2];
114      bank = (col & 0xe0) << 3;
115      col = ((col & 0x1f)<<0) | ((col & 0x80) >> 2);
181      color = videoram[offs*2];
182      bank = (color & 0xe0) << 3;
183      color = ((color & 0x1f)<<0) | ((color & 0x80) >> 2);
116184
117185      drawgfx(bitmap,machine->gfx[0],
118186         videoram[offs*2+1] + bank,
119         col,
120         f,f,
121         px,py,
187         color,
188         ikki_flipscreen,ikki_flipscreen,
189         x,y,
122190         cliprect,TRANSPARENCY_NONE,0);
123191   }
124192
125/* draw sprites */
193   draw_sprites(machine, bitmap, cliprect);
126194
127   fillbitmap(tmpbitmap, machine->pens[256], 0);
128
129   /* c060 - c0ff */
130   for (offs=0x00; offs<0x800; offs +=4)
131   {
132      chr = spriteram[offs+1] >> 1 ;
133      col = spriteram[offs+2];
134
135      px = spriteram[offs+3];
136      py = spriteram[offs+0];
137
138      chr += (col & 0x80);
139      col = (col & 0x3f) >> 0 ;
140
141      if (f==0)
142         py = 224-py;
143      else
144         px = 240-px;
145
146      px = px & 0xff;
147      py = py & 0xff;
148
149      if (px>248)
150         px = px-256;
151      if (py>240)
152         py = py-256;
153
154      drawgfx(tmpbitmap,machine->gfx[1],
155         chr,
156         col,
157         f,f,
158         px,py,
159         cliprect,TRANSPARENCY_COLOR,0);
160   }
161
162   copybitmap_trans(bitmap,tmpbitmap,0,0,0,0,cliprect,machine->pens[256]);
163
164
165195   /* mask sprites */
166196
167197   for (offs=0; offs<(videoram_size/2); offs++)
168198   {
169      int sx,sy;
199      int sx = offs / 32;
200      int sy = offs % 32;
170201
171      sx = offs / 32;
172      sy = offs % 32;
202      int d = VIDEOATTR[ sx ];
173203
174      d = VIDEOATTR[ sx ];
175
176204      if ( (d == 0) || (d == 0x0d) )
177205      {
178         py = sy*8;
179         px = sx*8;
206         int color, bank;
180207
181         if (f != 0)
208         int y = sy*8;
209         int x = sx*8;
210
211         if (ikki_flipscreen)
182212         {
183            px = 248-px;
184            py = 248-py;
213            x = 248-x;
214            y = 248-y;
185215         }
186216
187         col = videoram[offs*2];
188         bank = (col & 0xe0) << 3;
189         col = ((col & 0x1f)<<0) | ((col & 0x80) >> 2);
217         color = videoram[offs*2];
218         bank = (color & 0xe0) << 3;
219         color = ((color & 0x1f)<<0) | ((color & 0x80) >> 2);
190220
191221         drawgfx(bitmap,machine->gfx[0],
192222            videoram[offs*2+1] + bank,
193            col,
194            f,f,
195            px,py,
223            color,
224            ikki_flipscreen,ikki_flipscreen,
225            x,y,
196226            cliprect,TRANSPARENCY_NONE,0);
197227      }
198228   }
src/mame/video/darius.c
r1679r1680
4545
4646VIDEO_START( darius )
4747{
48   fg_tilemap = tilemap_create(get_fg_tile_info,tilemap_scan_rows,TILEMAP_TYPE_PEN,8,8,128,64);
48   fg_tilemap = tilemap_create(get_fg_tile_info,tilemap_scan_rows,8,8,128,64);
4949
5050   spritelist = auto_malloc(0x800 * sizeof(*spritelist));
5151
src/mame/video/cbasebal.c
r1679r1680
4848   cbasebal_textram = auto_malloc(0x1000);
4949   cbasebal_scrollram = auto_malloc(0x1000);
5050
51   bg_tilemap = tilemap_create(get_bg_tile_info,tilemap_scan_rows,TILEMAP_TYPE_PEN,   16,16,64,32);
52   fg_tilemap = tilemap_create(get_fg_tile_info,tilemap_scan_rows,TILEMAP_TYPE_PEN,8,8,64,32);
51   bg_tilemap = tilemap_create(get_bg_tile_info,tilemap_scan_rows,   16,16,64,32);
52   fg_tilemap = tilemap_create(get_fg_tile_info,tilemap_scan_rows,8,8,64,32);
5353
5454   tilemap_set_transparent_pen(fg_tilemap,3);
5555}
src/mame/video/sbasketb.c
r1679r1680
125125VIDEO_START( sbasketb )
126126{
127127   bg_tilemap = tilemap_create(get_bg_tile_info, tilemap_scan_rows,
128      TILEMAP_TYPE_PEN, 8, 8, 32, 32);
128      8, 8, 32, 32);
129129
130130   tilemap_set_scroll_cols(bg_tilemap, 32);
131131}
src/mame/video/qix.c
r1679r1680
77***************************************************************************/
88
99#include "driver.h"
10#include "deprecat.h"
10#include "video/mc6845.h"
1111#include "qix.h"
12#include "video/crtc6845.h"
1312
1413
15/* Constants */
16#define SCANLINE_INCREMENT   1
17
18
1914/* Globals */
2015UINT8 *qix_videoaddress;
2116UINT8 qix_cocktail_flip;
2217
2318
2419/* Local variables */
20static mc6845_t *mc6845;
2521static UINT8 vram_mask;
2622static UINT8 qix_palettebank;
2723static UINT8 leds;
28static emu_timer *scanline_timer;
2924static UINT8 scanline_latch;
3025
3126
r1679r1680
3833
3934static void qix_display_enable_changed(int display_enabled);
4035
41static TIMER_CALLBACK( scanline_callback );
36static void *qix_begin_update(mame_bitmap *bitmap, const rectangle *cliprect);
4237
43static void *qix_begin_update(running_machine *machine,
44                       int screen,
45                       mame_bitmap *bitmap,
46                       const rectangle *cliprect);
47
4838static void qix_update_row(mame_bitmap *bitmap,
4939                     const rectangle *cliprect,
5040                     UINT16 ma,
r1679r1680
6151 *
6252 *************************************/
6353
64static const crtc6845_interface crtc6845_intf =
54static const mc6845_interface mc6845_intf =
6555{
6656   0,                  /* screen we are acting on */
6757   QIX_CHARACTER_CLOCK,    /* the clock (pin 21) of the chip */
r1679r1680
7666VIDEO_START( qix )
7767{
7868   /* configure the CRT controller */
79   crtc6845_config(0, &crtc6845_intf);
69   mc6845 = mc6845_config(&mc6845_intf);
8070
8171   /* allocate memory for the full video RAM */
8272   videoram = auto_malloc(256 * 256);
r1679r1680
8474   /* initialize the mask for games that don't use it */
8575   vram_mask = 0xff;
8676
87   /* allocate a timer */
88   scanline_timer = timer_alloc(scanline_callback, NULL);
89   timer_adjust(scanline_timer, video_screen_get_time_until_pos(0, 1, 0), 1, attotime_zero);
90
9177   /* set up save states */
9278   state_save_register_global_pointer(videoram, 256 * 256);
9379   state_save_register_global(qix_cocktail_flip);
r1679r1680
10086
10187/*************************************
10288 *
103 *  Scanline caching
104 *
105 *************************************/
106
107static TIMER_CALLBACK( scanline_callback )
108{
109   int scanline = param;
110
111   /* force a partial update */
112   video_screen_update_partial(0, scanline - 1);
113
114   /* set a timer for the next increment */
115   scanline += SCANLINE_INCREMENT;
116   if (scanline > machine->screen[0].visarea.max_y)
117      scanline = SCANLINE_INCREMENT;
118   timer_adjust(scanline_timer, video_screen_get_time_until_pos(0, scanline, 0), scanline, attotime_zero);
119}
120
121
122
123/*************************************
124 *
12589 *  Current scanline read
12690 *
12791 *************************************/
r1679r1680
13195   /* on the rising edge, latch the scanline */
13296   if (display_enabled)
13397   {
134      UINT16 ma = crtc6845_get_ma(0);
135      UINT8 ra = crtc6845_get_ra(0);
98      UINT16 ma = mc6845_get_ma(mc6845);
99      UINT8 ra = mc6845_get_ra(mc6845);
136100
137101      /* RA0-RA2 goes to D0-D2 and MA5-MA9 goes to D3-D7 */
138102      scanline_latch = ((ma >> 2) & 0xf8) | (ra & 0x07);
r1679r1680
188152
189153WRITE8_HANDLER( qix_videoram_w )
190154{
155   /* update the screen in case the game is writing "behind" the beam -
156       Zookeeper likes to do this */
157   video_screen_update_partial(0, video_screen_get_vpos(0) - 1);
158
191159   /* add in the upper bit of the address latch */
192160   offset += (qix_videoaddress[0] & 0x80) << 8;
193161
r1679r1680
238206 *
239207 *************************************/
240208
209#define NUM_PENS   (0x100)
210
211
241212WRITE8_HANDLER( qix_paletteram_w )
242213{
214   UINT8 old_data = paletteram[offset];
215
216   /* set the palette RAM value */
217   paletteram[offset] = data;
218
219   /* trigger an update if a currently visible pen has changed */
220   if (((offset >> 8) == qix_palettebank) &&
221       (old_data != data))
222      video_screen_update_partial(0, video_screen_get_vpos(0) - 1);
223}
224
225
226WRITE8_HANDLER( qix_palettebank_w )
227{
228   /* set the bank value */
229   if (qix_palettebank != (data & 3))
230   {
231      video_screen_update_partial(0, video_screen_get_vpos(0) - 1);
232      qix_palettebank = data & 3;
233   }
234
235   /* LEDs are in the upper 6 bits */
236   leds = ~data & 0xfc;
237}
238
239
240static void get_pens(pen_t *pens)
241{
242   offs_t offs;
243
243244   /* this conversion table should be about right. It gives a reasonable */
244245   /* gray scale in the test screen, and the red, green and blue squares */
245246   /* in the same screen are barely visible, as the manual requires. */
r1679r1680
262263      0xb6,   /* value = 3, intensity = 2 */
263264      0xff   /* value = 3, intensity = 3 */
264265   };
265   int bits, intensity, red, green, blue;
266266
267   /* set the palette RAM value */
268   paletteram[offset] = data;
267   for (offs = qix_palettebank << 8; offs < (qix_palettebank << 8) + NUM_PENS; offs++)
268   {
269      int bits, intensity, r, g, b;
269270
270   /* compute R, G, B from the table */
271   intensity = (data >> 0) & 0x03;
272   bits = (data >> 6) & 0x03;
273   red = table[(bits << 2) | intensity];
274   bits = (data >> 4) & 0x03;
275   green = table[(bits << 2) | intensity];
276   bits = (data >> 2) & 0x03;
277   blue = table[(bits << 2) | intensity];
271      UINT8 data = paletteram[offs];
278272
279   /* update the palette */
280   palette_set_color(Machine, offset, MAKE_RGB(red, green, blue));
273      /* compute R, G, B from the table */
274      intensity = (data >> 0) & 0x03;
275      bits = (data >> 6) & 0x03;
276      r = table[(bits << 2) | intensity];
277      bits = (data >> 4) & 0x03;
278      g = table[(bits << 2) | intensity];
279      bits = (data >> 2) & 0x03;
280      b = table[(bits << 2) | intensity];
281
282      /* update the palette */
283      pens[offs & 0xff] = MAKE_RGB(r, g, b);
284   }
281285}
282286
283287
284WRITE8_HANDLER( qix_palettebank_w )
288
289/*************************************
290 *
291 *  M6845 access
292 *
293 *************************************/
294
295WRITE8_HANDLER( qix_mc6845_address_w )
285296{
286   /* set the bank value */
287   if (qix_palettebank != (data & 3))
288   {
289      video_screen_update_partial(0, video_screen_get_vpos(0) - 1);
290      qix_palettebank = data & 3;
291   }
297   mc6845_address_w(mc6845, data);
298}
292299
293   /* LEDs are in the upper 6 bits */
294   leds = ~data & 0xfc;
300
301READ8_HANDLER( qix_mc6845_register_r )
302{
303   return mc6845_register_r(mc6845);
295304}
296305
297306
307WRITE8_HANDLER( qix_mc6845_register_w )
308{
309   mc6845_register_w(mc6845, data);
310}
298311
312
313
299314/*************************************
300315 *
301 *  CRTC callbacks for updating
316 *  M6845 callbacks for updating
302317 *  the screen
303318 *
304319 *************************************/
305320
306static void *qix_begin_update(running_machine *machine, int screen,
307                       mame_bitmap *bitmap, const rectangle *cliprect)
321static void *qix_begin_update(mame_bitmap *bitmap, const rectangle *cliprect)
308322{
309323#if 0
310324   // note the confusing bit order!
311325   popmessage("self test leds: %d%d %d%d%d%d",BIT(leds,7),BIT(leds,5),BIT(leds,6),BIT(leds,4),BIT(leds,2),BIT(leds,3));
312326#endif
313327
314   /* return the pens we are going to use to update the display */
315   return (void *)&machine->pens[qix_palettebank * 256];
328   /* create the pens */
329   static pen_t pens[NUM_PENS];
330
331   get_pens(pens);
332
333   return pens;
316334}
317335
318336
r1679r1680
333351
334352   draw_scanline8(bitmap, 0, y, x_count * 8, scanline, pens, -1);
335353}
354
355
356
357/*************************************
358 *
359 *  Standard video update
360 *
361 *************************************/
362
363VIDEO_UPDATE( qix  )
364{
365   mc6845_update(mc6845, bitmap, cliprect);
366
367   return 0;
368}
src/mame/video/ksayakyu.c
r1679r1680
100100
101101VIDEO_START(ksayakyu)
102102{
103   ksayakyu_tilemap = tilemap_create(get_ksayakyu_tile_info,tilemap_scan_rows,TILEMAP_TYPE_PEN, 8, 8,32,32*8);
104   ksayakyu_textmap = tilemap_create(get_text_tile_info,tilemap_scan_rows,TILEMAP_TYPE_PEN, 8, 8,32,32);
103   ksayakyu_tilemap = tilemap_create(get_ksayakyu_tile_info,tilemap_scan_rows, 8, 8,32,32*8);
104   ksayakyu_textmap = tilemap_create(get_text_tile_info,tilemap_scan_rows, 8, 8,32,32);
105105   tilemap_set_transparent_pen(ksayakyu_textmap,0);
106106}
107107
src/mame/video/ironhors.c
r1679r1680
77***************************************************************************/
88
99#include "driver.h"
10#include "video/resnet.h"
1011
1112UINT8 *ironhors_scroll;
1213static int palettebank, charbank, spriterambank;
r1679r1680
1718
1819  Convert the color PROMs into a more useable format.
1920
20  Iron Horse has three 256x4 palette PROMs (one per gun) and two 256x4
21  lookup table PROMs (one for characters, one for sprites).
22  I don't know for sure how the palette PROMs are connected to the RGB
23  output, but it's probably the usual:
24
25  bit 3 -- 220 ohm resistor  -- RED/GREEN/BLUE
26        -- 470 ohm resistor  -- RED/GREEN/BLUE
27        -- 1  kohm resistor  -- RED/GREEN/BLUE
28  bit 0 -- 2.2kohm resistor  -- RED/GREEN/BLUE
29
3021***************************************************************************/
3122PALETTE_INIT( ironhors )
3223{
24   static const int resistances[4] = { 2000, 1000, 470, 220 };
25   double rweights[4], gweights[4], bweights[4];
3326   int i;
34   #define TOTAL_COLORS(gfxn) (machine->gfx[gfxn]->total_colors * machine->gfx[gfxn]->color_granularity)
35   #define COLOR(gfxn,offs) (colortable[machine->drv->gfxdecodeinfo[gfxn].color_codes_start + offs])
3627
28   /* compute the color output resistor weights */
29   compute_resistor_weights(0,   255, -1.0,
30         4, resistances, rweights, 1000, 0,
31         4, resistances, gweights, 1000, 0,
32         4, resistances, bweights, 1000, 0);
3733
38   for (i = 0;i < machine->drv->total_colors;i++)
34   /* allocate the colortable */
35   machine->colortable = colortable_alloc(machine, 0x100);
36
37   /* create a lookup table for the palette */
38   for (i = 0; i < 0x100; i++)
3939   {
40      int bit0,bit1,bit2,bit3,r,g,b;
40      int bit0, bit1, bit2, bit3;
41      int r, g, b;
4142
43      /* red component */
44      bit0 = (color_prom[i + 0x000] >> 0) & 0x01;
45      bit1 = (color_prom[i + 0x000] >> 1) & 0x01;
46      bit2 = (color_prom[i + 0x000] >> 2) & 0x01;
47      bit3 = (color_prom[i + 0x000] >> 3) & 0x01;
48      r = combine_4_weights(rweights, bit0, bit1, bit2, bit3);
4249
43      bit0 = (color_prom[0] >> 0) & 0x01;
44      bit1 = (color_prom[0] >> 1) & 0x01;
45      bit2 = (color_prom[0] >> 2) & 0x01;
46      bit3 = (color_prom[0] >> 3) & 0x01;
47      r = 0x0e * bit0 + 0x1f * bit1 + 0x43 * bit2 + 0x8f * bit3;
48      bit0 = (color_prom[machine->drv->total_colors] >> 0) & 0x01;
49      bit1 = (color_prom[machine->drv->total_colors] >> 1) & 0x01;
50      bit2 = (color_prom[machine->drv->total_colors] >> 2) & 0x01;
51      bit3 = (color_prom[machine->drv->total_colors] >> 3) & 0x01;
52      g = 0x0e * bit0 + 0x1f * bit1 + 0x43 * bit2 + 0x8f * bit3;
53      bit0 = (color_prom[2*machine->drv->total_colors] >> 0) & 0x01;
54      bit1 = (color_prom[2*machine->drv->total_colors] >> 1) & 0x01;
55      bit2 = (color_prom[2*machine->drv->total_colors] >> 2) & 0x01;
56      bit3 = (color_prom[2*machine->drv->total_colors] >> 3) & 0x01;
57      b = 0x0e * bit0 + 0x1f * bit1 + 0x43 * bit2 + 0x8f * bit3;
50      /* green component */
51      bit0 = (color_prom[i + 0x100] >> 0) & 0x01;
52      bit1 = (color_prom[i + 0x100] >> 1) & 0x01;
53      bit2 = (color_prom[i + 0x100] >> 2) & 0x01;
54      bit3 = (color_prom[i + 0x100] >> 3) & 0x01;
55      g = combine_4_weights(gweights, bit0, bit1, bit2, bit3);
5856
59      palette_set_color(machine,i,MAKE_RGB(r,g,b));
60      color_prom++;
57      /* blue component */
58      bit0 = (color_prom[i + 0x200] >> 0) & 0x01;
59      bit1 = (color_prom[i + 0x200] >> 1) & 0x01;
60      bit2 = (color_prom[i + 0x200] >> 2) & 0x01;
61      bit3 = (color_prom[i + 0x200] >> 3) & 0x01;
62      b = combine_4_weights(bweights, bit0, bit1, bit2, bit3);
63
64      colortable_palette_set_color(machine->colortable, i, MAKE_RGB(r, g, b));
6165   }
6266
63   color_prom += 2*machine->drv->total_colors;
64   /* color_prom now points to the beginning of the character lookup table */
67   /* color_prom now points to the beginning of the lookup table,*/
68   color_prom += 0x300;
6569
66
67   /* there are eight 32 colors palette banks; sprites use colors 0-15 and */
68   /* characters 16-31 of each bank. */
69   for (i = 0;i < TOTAL_COLORS(0)/8;i++)
70   /* characters use colors 0x10-0x1f of each 0x20 color bank,
71       while sprites use colors 0-0x0f */
72   for (i = 0; i < 0x200; i++)
7073   {
7174      int j;
7275
73
74      for (j = 0;j < 8;j++)
75         COLOR(0,i + j * TOTAL_COLORS(0)/8) = (*color_prom & 0x0f) + 32 * j + 16;
76
77      color_prom++;
76      for (j = 0; j < 8; j++)
77      {
78         UINT8 ctabentry = (j << 5) | ((~i & 0x100) >> 4) | (color_prom[i] & 0x0f);
79         colortable_entry_set_value(machine->colortable, ((i & 0x100) << 3) | (j << 8) | (i & 0xff), ctabentry);
80      }
7881   }
79
80   for (i = 0;i < TOTAL_COLORS(1)/8;i++)
81   {
82      int j;
83
84
85      for (j = 0;j < 8;j++)
86         COLOR(1,i + j * TOTAL_COLORS(1)/8) = (*color_prom & 0x0f) + 32 * j;
87
88      color_prom++;
89   }
9082}
9183
9284WRITE8_HANDLER( ironhors_videoram_w )
r1679r1680
155147VIDEO_START( ironhors )
156148{
157149   bg_tilemap = tilemap_create(get_bg_tile_info, tilemap_scan_rows,
158      TILEMAP_TYPE_PEN, 8, 8, 32, 32);
150      8, 8, 32, 32);
159151
160152   tilemap_set_scroll_rows(bg_tilemap, 32);
161153}
src/mame/video/battlex.c
r1679r1680
7979VIDEO_START( battlex )
8080{
8181   bg_tilemap = tilemap_create(get_bg_tile_info, tilemap_scan_rows,
82      TILEMAP_TYPE_PEN, 8, 8, 64, 32);
82      8, 8, 64, 32);
8383}
8484
8585static void draw_sprites(running_machine *machine, mame_bitmap *bitmap, const rectangle *cliprect )
src/mame/video/skullxbo.c
r1679r1680
8484   };
8585
8686   /* initialize the playfield */
87   atarigen_playfield_tilemap = tilemap_create(get_playfield_tile_info, tilemap_scan_cols, TILEMAP_TYPE_PEN, 16,8, 64,64);
87   atarigen_playfield_tilemap = tilemap_create(get_playfield_tile_info, tilemap_scan_cols, 16,8, 64,64);
8888
8989   /* initialize the motion objects */
9090   atarimo_init(machine, 0, &modesc);
9191
9292   /* initialize the alphanumerics */
93   atarigen_alpha_tilemap = tilemap_create(get_alpha_tile_info, tilemap_scan_rows, TILEMAP_TYPE_PEN, 16,8, 64,32);
93   atarigen_alpha_tilemap = tilemap_create(get_alpha_tile_info, tilemap_scan_rows, 16,8, 64,32);
9494   tilemap_set_transparent_pen(atarigen_alpha_tilemap, 0);
9595}
9696
src/mame/video/glass.c
r1679r1680
132132
133133VIDEO_START( glass )
134134{
135   pant[0] = tilemap_create(get_tile_info_glass_screen0,tilemap_scan_rows,TILEMAP_TYPE_PEN,16,16,32,32);
136   pant[1] = tilemap_create(get_tile_info_glass_screen1,tilemap_scan_rows,TILEMAP_TYPE_PEN,16,16,32,32);
135   pant[0] = tilemap_create(get_tile_info_glass_screen0,tilemap_scan_rows,16,16,32,32);
136   pant[1] = tilemap_create(get_tile_info_glass_screen1,tilemap_scan_rows,16,16,32,32);
137137   screen_bitmap = auto_bitmap_alloc (320, 200, machine->screen[0].format);
138138
139139   tilemap_set_transparent_pen(pant[0],0);
src/mame/video/mcatadv.c
r1679r1680
251251
252252VIDEO_START( mcatadv )
253253{
254   mcatadv_tilemap1 = tilemap_create(get_mcatadv_tile_info1,tilemap_scan_rows,TILEMAP_TYPE_PEN, 16, 16,32,32);
254   mcatadv_tilemap1 = tilemap_create(get_mcatadv_tile_info1,tilemap_scan_rows, 16, 16,32,32);
255255   tilemap_set_transparent_pen(mcatadv_tilemap1,0);
256256
257   mcatadv_tilemap2 = tilemap_create(get_mcatadv_tile_info2,tilemap_scan_rows,TILEMAP_TYPE_PEN, 16, 16,32,32);
257   mcatadv_tilemap2 = tilemap_create(get_mcatadv_tile_info2,tilemap_scan_rows, 16, 16,32,32);
258258   tilemap_set_transparent_pen(mcatadv_tilemap2,0);
259259
260260   spriteram_old = auto_malloc(spriteram_size);
src/mame/video/toaplan2.c
r1679r1680
406406***************************************************************************/
407407static void create_tilemaps_0(void)
408408{
409   top_tilemap[0] = tilemap_create(get_top0_tile_info,tilemap_scan_rows,TILEMAP_TYPE_PEN,16,16,32,32);
410   fg_tilemap[0] = tilemap_create(get_fg0_tile_info,tilemap_scan_rows,TILEMAP_TYPE_PEN,16,16,32,32);
411   bg_tilemap[0] = tilemap_create(get_bg0_tile_info,tilemap_scan_rows,TILEMAP_TYPE_PEN,16,16,32,32);
409   top_tilemap[0] = tilemap_create(get_top0_tile_info,tilemap_scan_rows,16,16,32,32);
410   fg_tilemap[0] = tilemap_create(get_fg0_tile_info,tilemap_scan_rows,16,16,32,32);
411   bg_tilemap[0] = tilemap_create(get_bg0_tile_info,tilemap_scan_rows,16,16,32,32);
412412
413413   tilemap_set_transparent_pen(top_tilemap[0],0);
414414   tilemap_set_transparent_pen(fg_tilemap[0],0);
r1679r1680
417417
418418static void create_tilemaps_1(void)
419419{
420   top_tilemap[1] = tilemap_create(get_top1_tile_info,tilemap_scan_rows,TILEMAP_TYPE_PEN,16,16,32,32);
421   fg_tilemap[1] = tilemap_create(get_fg1_tile_info,tilemap_scan_rows,TILEMAP_TYPE_PEN,16,16,32,32);
422   bg_tilemap[1] = tilemap_create(get_bg1_tile_info,tilemap_scan_rows,TILEMAP_TYPE_PEN,16,16,32,32);
420   top_tilemap[1] = tilemap_create(get_top1_tile_info,tilemap_scan_rows,16,16,32,32);
421   fg_tilemap[1] = tilemap_create(get_fg1_tile_info,tilemap_scan_rows,16,16,32,32);
422   bg_tilemap[1] = tilemap_create(get_bg1_tile_info,tilemap_scan_rows,16,16,32,32);
423423
424424   tilemap_set_transparent_pen(top_tilemap[1],0);
425425   tilemap_set_transparent_pen(fg_tilemap[1],0);
r1679r1680
428428
429429static void truxton2_create_tilemaps_0(void)
430430{
431   tx_tilemap = tilemap_create(get_text_tile_info,tilemap_scan_rows,TILEMAP_TYPE_PEN,8,8,64,32);
432   top_tilemap[0] = tilemap_create(get_top0_tile_info,tilemap_scan_rows,TILEMAP_TYPE_PEN,16,16,32,32);
433   fg_tilemap[0] = tilemap_create(get_fg0_tile_info,tilemap_scan_rows,TILEMAP_TYPE_PEN,16,16,32,32);
434   bg_tilemap[0] = tilemap_create(get_bg0_tile_info,tilemap_scan_rows,TILEMAP_TYPE_PEN,16,16,32,32);
431   tx_tilemap = tilemap_create(get_text_tile_info,tilemap_scan_rows,8,8,64,32);
432   top_tilemap[0] = tilemap_create(get_top0_tile_info,tilemap_scan_rows,16,16,32,32);
433   fg_tilemap[0] = tilemap_create(get_fg0_tile_info,tilemap_scan_rows,16,16,32,32);
434   bg_tilemap[0] = tilemap_create(get_bg0_tile_info,tilemap_scan_rows,16,16,32,32);
435435
436436   tilemap_set_scroll_rows(tx_tilemap,8*32);   /* line scrolling */
437437   tilemap_set_scroll_cols(tx_tilemap,1);
r1679r1680
444444
445445static void batrider_create_tilemaps_0(void)
446446{
447   tx_tilemap = tilemap_create(get_text_tile_info,tilemap_scan_rows,TILEMAP_TYPE_PEN,8,8,64,32);
448   top_tilemap[0] = tilemap_create(batrider_get_top0_tile_info,tilemap_scan_rows,TILEMAP_TYPE_PEN,16,16,32,32);
449   fg_tilemap[0] = tilemap_create(batrider_get_fg0_tile_info,tilemap_scan_rows,TILEMAP_TYPE_PEN,16,16,32,32);
450   bg_tilemap[0] = tilemap_create(batrider_get_bg0_tile_info,tilemap_scan_rows,TILEMAP_TYPE_PEN,16,16,32,32);
447   tx_tilemap = tilemap_create(get_text_tile_info,tilemap_scan_rows,8,8,64,32);
448   top_tilemap[0] = tilemap_create(batrider_get_top0_tile_info,tilemap_scan_rows,16,16,32,32);
449   fg_tilemap[0] = tilemap_create(batrider_get_fg0_tile_info,tilemap_scan_rows,16,16,32,32);
450   bg_tilemap[0] = tilemap_create(batrider_get_bg0_tile_info,tilemap_scan_rows,16,16,32,32);
451451
452452   tilemap_set_scroll_rows(tx_tilemap,8*32);   /* line scrolling */
453453   tilemap_set_scroll_cols(tx_tilemap,1);
src/mame/video/mjkjidai.c
r1679r1680
3232
3333VIDEO_START( mjkjidai )
3434{
35   bg_tilemap = tilemap_create(get_tile_info,tilemap_scan_rows,TILEMAP_TYPE_PEN,8,8,64,32);
35   bg_tilemap = tilemap_create(get_tile_info,tilemap_scan_rows,8,8,64,32);
3636}
3737
3838
src/mame/video/jailbrek.c
r1679r1680
77
88PALETTE_INIT( jailbrek )
99{
10   #define TOTAL_COLORS(gfxn) (machine->gfx[gfxn]->total_colors * machine->gfx[gfxn]->color_granularity)
11   #define COLOR(gfxn,offs) (colortable[machine->drv->gfxdecodeinfo[gfxn].color_codes_start + offs])
1210   int i;
1311
14   for ( i = 0; i < machine->drv->total_colors; i++ )
12   /* allocate the colortable */
13   machine->colortable = colortable_alloc(machine, 0x20);
14
15   /* create a lookup table for the palette */
16   for (i = 0; i < 0x20; i++)
1517   {
16      int bit0,bit1,bit2,bit3,r,g,b;
18      int r = pal4bit(color_prom[i + 0x00] >> 0);
19      int g = pal4bit(color_prom[i + 0x00] >> 4);
20      int b = pal4bit(color_prom[i + 0x20] >> 0);
1721
22      colortable_palette_set_color(machine->colortable, i, MAKE_RGB(r, g, b));
23   }
1824
19      bit0 = (color_prom[0] >> 0) & 0x01;
20      bit1 = (color_prom[0] >> 1) & 0x01;
21      bit2 = (color_prom[0] >> 2) & 0x01;
22      bit3 = (color_prom[0] >> 3) & 0x01;
23      r = 0x0e * bit0 + 0x1f * bit1 + 0x43 * bit2 + 0x8f * bit3;
25   /* color_prom now points to the beginning of the lookup table */
26   color_prom += 0x40;
2427
25      bit0 = (color_prom[0] >> 4) & 0x01;
26      bit1 = (color_prom[0] >> 5) & 0x01;
27      bit2 = (color_prom[0] >> 6) & 0x01;
28      bit3 = (color_prom[0] >> 7) & 0x01;
29      g = 0x0e * bit0 + 0x1f * bit1 + 0x43 * bit2 + 0x8f * bit3;
30
31      bit0 = (color_prom[machine->drv->total_colors] >> 0) & 0x01;
32      bit1 = (color_prom[machine->drv->total_colors] >> 1) & 0x01;
33      bit2 = (color_prom[machine->drv->total_colors] >> 2) & 0x01;
34      bit3 = (color_prom[machine->drv->total_colors] >> 3) & 0x01;
35      b = 0x0e * bit0 + 0x1f * bit1 + 0x43 * bit2 + 0x8f * bit3;
36
37      palette_set_color(machine,i,MAKE_RGB(r,g,b));
38      color_prom++;
28   for (i = 0; i < 0x100; i++)
29   {
30      UINT8 ctabentry = (color_prom[i] & 0x0f) | 0x10;
31      colortable_entry_set_value(machine->colortable, i, ctabentry);
3932   }
4033
41   color_prom += machine->drv->total_colors;
42
43   for ( i = 0; i < TOTAL_COLORS(0); i++ )
44      COLOR(0,i) = ( *color_prom++ ) + 0x10;
45
46   for ( i = 0; i < TOTAL_COLORS(1); i++ )
47      COLOR(1,i) = *color_prom++;
34   for (i = 0x100; i < 0x200; i++)
35   {
36      UINT8 ctabentry = color_prom[i] & 0x0f;
37      colortable_entry_set_value(machine->colortable, i, ctabentry);
38   }
4839}
4940
5041WRITE8_HANDLER( jailbrek_videoram_w )
r1679r1680
7162VIDEO_START( jailbrek )
7263{
7364   bg_tilemap = tilemap_create(get_bg_tile_info, tilemap_scan_rows,
74      TILEMAP_TYPE_PEN, 8, 8, 64, 32);
65      8, 8, 64, 32);
7566   tilemap_set_scrolldx(bg_tilemap, 0, 396 - 256);
7667}
7768
r1679r1680
9889      }
9990
10091      drawgfx(bitmap, machine->gfx[1], code, color, flipx, flipy,
101         sx, sy, cliprect, TRANSPARENCY_COLOR, 0);
92         sx, sy, cliprect, TRANSPARENCY_PENS,
93         colortable_get_transpen_mask(machine->colortable, machine->gfx[1], color, 0));
10294   }
10395}
10496
r1679r1680
115107      tilemap_set_scrollx(bg_tilemap, 0, 0);
116108
117109      for (i = 0; i < 32; i++)
118      {
119110         tilemap_set_scrolly(bg_tilemap, i, ((jailbrek_scroll_x[i + 32] << 8) + jailbrek_scroll_x[i]));
120      }
121111   }
122112   else
123113   {
r1679r1680
126116      tilemap_set_scrolly(bg_tilemap, 0, 0);
127117
128118      for (i = 0; i < 32; i++)
129      {
130119         tilemap_set_scrollx(bg_tilemap, i, ((jailbrek_scroll_x[i + 32] << 8) + jailbrek_scroll_x[i]));
131      }
132120   }
133121
134122   tilemap_draw(bitmap, cliprect, bg_tilemap, 0, 0);
src/mame/video/gaelco.c
r1679r1680
8181
8282VIDEO_START( bigkarnk )
8383{
84   pant[0] = tilemap_create(get_tile_info_gaelco_screen0,tilemap_scan_rows,TILEMAP_TYPE_PEN,16,16,32,32);
85   pant[1] = tilemap_create(get_tile_info_gaelco_screen1,tilemap_scan_rows,TILEMAP_TYPE_PEN,16,16,32,32);
84   pant[0] = tilemap_create(get_tile_info_gaelco_screen0,tilemap_scan_rows,16,16,32,32);
85   pant[1] = tilemap_create(get_tile_info_gaelco_screen1,tilemap_scan_rows,16,16,32,32);
8686
8787   tilemap_set_transmask(pant[0],0,0xff01,0x00ff); /* pens 1-7 opaque, pens 0, 8-15 transparent */
8888   tilemap_set_transmask(pant[1],0,0xff01,0x00ff); /* pens 1-7 opaque, pens 0, 8-15 transparent */
r1679r1680
9090
9191VIDEO_START( maniacsq )
9292{
93   pant[0] = tilemap_create(get_tile_info_gaelco_screen0,tilemap_scan_rows,TILEMAP_TYPE_PEN,16,16,32,32);
94   pant[1] = tilemap_create(get_tile_info_gaelco_screen1,tilemap_scan_rows,TILEMAP_TYPE_PEN,16,16,32,32);
93   pant[0] = tilemap_create(get_tile_info_gaelco_screen0,tilemap_scan_rows,16,16,32,32);
94   pant[1] = tilemap_create(get_tile_info_gaelco_screen1,tilemap_scan_rows,16,16,32,32);
9595
9696   tilemap_set_transparent_pen(pant[0],0);
9797   tilemap_set_transparent_pen(pant[1],0);
src/mame/video/bankp.c
r1679r1680
155155VIDEO_START( bankp )
156156{
157157   bg_tilemap = tilemap_create(get_bg_tile_info, tilemap_scan_rows,
158      TILEMAP_TYPE_PEN, 8, 8, 32, 32);
158      8, 8, 32, 32);
159159
160160   fg_tilemap = tilemap_create(get_fg_tile_info, tilemap_scan_rows,
161      TILEMAP_TYPE_PEN, 8, 8, 32, 32);
161      8, 8, 32, 32);
162162
163163   colortable_configure_tilemap_groups(machine->colortable, bg_tilemap, machine->gfx[1], 0);
164164   colortable_configure_tilemap_groups(machine->colortable, fg_tilemap, machine->gfx[0], 0);
src/mame/video/tankbust.c
r1679r1680
8383VIDEO_START( tankbust )
8484{
8585   /* not scrollable */
86   txt_tilemap = tilemap_create(get_txt_tile_info, tilemap_scan_rows, TILEMAP_TYPE_PEN, 8, 8, 64, 32);
86   txt_tilemap = tilemap_create(get_txt_tile_info, tilemap_scan_rows, 8, 8, 64, 32);
8787
8888   /* scrollable */
89   bg_tilemap = tilemap_create(get_bg_tile_info, tilemap_scan_rows, TILEMAP_TYPE_PEN, 8, 8, 64, 32);
89   bg_tilemap = tilemap_create(get_bg_tile_info, tilemap_scan_rows, 8, 8, 64, 32);
9090
9191
9292   tilemap_set_transparent_pen(txt_tilemap, 0);
src/mame/video/wecleman.c
r1679r1680
106106
107107static void get_sprite_info(running_machine *machine)
108108{
109   const pen_t *base_pal = machine->remapped_colortable;
109   const pen_t *base_pal = machine->pens;
110110   UINT8 *base_gfx = memory_region(REGION_GFX1);
111111   int gfx_max     = memory_region_length(REGION_GFX1);
112112
r1679r1680
566566   int scrollx, sy, sx;
567567   int mdy, tdy, i;
568568
569   rgb_ptr = machine->remapped_colortable;
569   rgb_ptr = machine->pens;
570570
571571   if (priority == 0x02)
572572   {
r1679r1680
683683   dst_pitch = bitmap->rowpixels;
684684   dst_base = (UINT16 *)bitmap->base + (y0+dy)*dst_pitch + (x0+dx);
685685
686   pal_base = machine->remapped_colortable + pal_offset * gfx->color_granularity;
686   pal_base = machine->pens + pal_offset * gfx->color_granularity;
687687
688688   alpha <<= 6;
689689
r1679r1680
922922
923923   bg_tilemap = tilemap_create(wecleman_get_bg_tile_info,
924924                        tilemap_scan_rows,
925                        TILEMAP_TYPE_PEN,   /* We draw part of the road below */
925                           /* We draw part of the road below */
926926                        8,8,
927927                        PAGE_NX * 2, PAGE_NY * 2 );
928928
929929   fg_tilemap = tilemap_create(wecleman_get_fg_tile_info,
930930                        tilemap_scan_rows,
931                        TILEMAP_TYPE_PEN,
931
932932                        8,8,
933933                        PAGE_NX * 2, PAGE_NY * 2);
934934
935935   txt_tilemap = tilemap_create(wecleman_get_txt_tile_info,
936936                         tilemap_scan_rows,
937                         TILEMAP_TYPE_PEN,
937
938938                         8,8,
939939                         PAGE_NX * 1, PAGE_NY * 1);
940940
r1679r1680
10221022   int cloud_sx, cloud_sy;
10231023   int i, j, k;
10241024
1025   mrct = machine->remapped_colortable;
1025   mrct = machine->pens;
10261026
10271027   video_on = wecleman_irqctrl & 0x40;
10281028
src/mame/video/crbaloon.c
r1679r1680
7878
7979VIDEO_START( crbaloon )
8080{
81   bg_tilemap = tilemap_create(get_bg_tile_info, tilemap_scan_rows_flip_xy, TILEMAP_TYPE_PEN, 8, 8, 32, 32);
81   bg_tilemap = tilemap_create(get_bg_tile_info, tilemap_scan_rows_flip_xy, 8, 8, 32, 32);
8282
8383   state_save_register_global(crbaloon_collision_address);
8484   state_save_register_global(crbaloon_collision_address_clear);
src/mame/video/portrait.c
r1679r1680
6161
6262VIDEO_START( portrait )
6363{
64   background = tilemap_create( get_bg_tile_info, tilemap_scan_rows, TILEMAP_TYPE_PEN,      16, 16, 32, 32 );
65   foreground = tilemap_create( get_fg_tile_info, tilemap_scan_rows, TILEMAP_TYPE_PEN, 16, 16, 32, 32 );
64   background = tilemap_create( get_bg_tile_info, tilemap_scan_rows,       16, 16, 32, 32 );
65   foreground = tilemap_create( get_fg_tile_info, tilemap_scan_rows,  16, 16, 32, 32 );
6666
6767      tilemap_set_transparent_pen( foreground, 0 );
6868}
src/mame/video/bosco.c
r1679r1680
136136
137137VIDEO_START( bosco )
138138{
139   bg_tilemap = tilemap_create(bg_get_tile_info,tilemap_scan_rows,TILEMAP_TYPE_PEN,8,8,32,32);
140   fg_tilemap = tilemap_create(fg_get_tile_info,fg_tilemap_scan,  TILEMAP_TYPE_PEN,8,8, 8,32);
139   bg_tilemap = tilemap_create(bg_get_tile_info,tilemap_scan_rows,8,8,32,32);
140   fg_tilemap = tilemap_create(fg_get_tile_info,fg_tilemap_scan,  8,8, 8,32);
141141
142142   colortable_configure_tilemap_groups(machine->colortable, bg_tilemap, machine->gfx[0], 0x1f);
143143   colortable_configure_tilemap_groups(machine->colortable, fg_tilemap, machine->gfx[0], 0x1f);
src/mame/video/funkybee.c
r1679r1680
9090VIDEO_START( funkybee )
9191{
9292   bg_tilemap = tilemap_create(get_bg_tile_info, funkybee_tilemap_scan,
93      TILEMAP_TYPE_PEN, 8, 8, 32, 32);
93      8, 8, 32, 32);
9494}
9595
9696static void draw_sprites(running_machine *machine, mame_bitmap *bitmap, const rectangle *cliprect)
src/mame/video/tetrisp2.c
r1679r1680
268268VIDEO_START( tetrisp2 )
269269{
270270   tilemap_bg = tilemap_create(   get_tile_info_bg,tilemap_scan_rows,
271                        TILEMAP_TYPE_PEN,
271
272272                        16,16,NX_0,NY_0);
273273
274274   tilemap_fg = tilemap_create(   get_tile_info_fg,tilemap_scan_rows,
275                        TILEMAP_TYPE_PEN,
275
276276                        8,8,NX_1,NY_1);
277277
278278   tilemap_rot = tilemap_create(   get_tile_info_rot,tilemap_scan_rows,
279                        TILEMAP_TYPE_PEN,
279
280280                        16,16,NX_0*2,NY_0*2);
281281
282282   tilemap_set_transparent_pen(tilemap_bg,0);
r1679r1680
287287VIDEO_START( rockntread )
288288{
289289   tilemap_bg = tilemap_create(   get_tile_info_bg,tilemap_scan_rows,
290                        TILEMAP_TYPE_PEN,
290
291291                        16, 16, 256, 16);   // rockn ms(main),1,2,3,4
292292
293293   tilemap_fg = tilemap_create(   get_tile_info_fg,tilemap_scan_rows,
294                        TILEMAP_TYPE_PEN,
294
295295                        8, 8, 64, 64);
296296
297297   tilemap_rot = tilemap_create(   get_tile_info_rot,tilemap_scan_rows,
298                        TILEMAP_TYPE_PEN,
298
299299                        16, 16, 128, 128);
300300
301301   tilemap_set_transparent_pen(tilemap_bg, 0);
r1679r1680
307307VIDEO_START( rocknms )
308308{
309309   tilemap_bg = tilemap_create(get_tile_info_bg,tilemap_scan_rows,
310               TILEMAP_TYPE_PEN,
310
311311               16, 16, 256, 16);   // rockn ms(main),1,2,3,4
312312
313313   tilemap_fg = tilemap_create(get_tile_info_fg,tilemap_scan_rows,
314               TILEMAP_TYPE_PEN,
314
315315               8, 8, 64, 64);
316316
317317   tilemap_rot = tilemap_create(get_tile_info_rot,tilemap_scan_rows,
318               TILEMAP_TYPE_PEN,
318
319319               16, 16, 128, 128);
320320
321321   tilemap_sub_bg = tilemap_create(get_tile_info_rocknms_sub_bg,tilemap_scan_rows,
322               TILEMAP_TYPE_PEN,
322
323323               16, 16, 32, 256);   // rockn ms(sub)
324324
325325   tilemap_sub_fg = tilemap_create(get_tile_info_rocknms_sub_fg,tilemap_scan_rows,
326               TILEMAP_TYPE_PEN,
326
327327               8, 8, 64, 64);
328328
329329   tilemap_sub_rot = tilemap_create( get_tile_info_rocknms_sub_rot,tilemap_scan_rows,
330               TILEMAP_TYPE_PEN,
330
331331               16, 16, 128, 128);
332332
333333   tilemap_set_transparent_pen(tilemap_bg, 0);
src/mame/video/lastduel.c
r1679r1680
8787
8888VIDEO_START( lastduel )
8989{
90   bg_tilemap = tilemap_create(ld_get_bg_tile_info,tilemap_scan_rows,TILEMAP_TYPE_PEN,16,16,64,64);
91   fg_tilemap = tilemap_create(ld_get_fg_tile_info,tilemap_scan_rows,TILEMAP_TYPE_PEN,16,16,64,64);
92   tx_tilemap = tilemap_create(get_fix_info,tilemap_scan_rows,TILEMAP_TYPE_PEN,8,8,64,32);
90   bg_tilemap = tilemap_create(ld_get_bg_tile_info,tilemap_scan_rows,16,16,64,64);
91   fg_tilemap = tilemap_create(ld_get_fg_tile_info,tilemap_scan_rows,16,16,64,64);
92   tx_tilemap = tilemap_create(get_fix_info,tilemap_scan_rows,8,8,64,32);
9393
9494   tilemap_set_transmask(fg_tilemap,0,0xffff,0x0001);
9595   tilemap_set_transmask(fg_tilemap,1,0xf07f,0x0f81);
r1679r1680
101101
102102VIDEO_START( madgear )
103103{
104   bg_tilemap = tilemap_create(get_bg_tile_info,tilemap_scan_cols,TILEMAP_TYPE_PEN,16,16,64,32);
105   fg_tilemap = tilemap_create(get_fg_tile_info,tilemap_scan_cols,TILEMAP_TYPE_PEN,16,16,64,32);
106   tx_tilemap = tilemap_create(get_fix_info,tilemap_scan_rows,TILEMAP_TYPE_PEN,8,8,64,32);
104   bg_tilemap = tilemap_create(get_bg_tile_info,tilemap_scan_cols,16,16,64,32);
105   fg_tilemap = tilemap_create(get_fg_tile_info,tilemap_scan_cols,16,16,64,32);
106   tx_tilemap = tilemap_create(get_fix_info,tilemap_scan_rows,8,8,64,32);
107107
108108   tilemap_set_transmask(fg_tilemap,0,0xffff,0x8000);
109109   tilemap_set_transmask(fg_tilemap,1,0x80ff,0xff00);
src/mame/video/alpha68k.c
r1679r1680
6969
7070VIDEO_START( alpha68k )
7171{
72   fix_tilemap = tilemap_create(get_tile_info,tilemap_scan_cols,TILEMAP_TYPE_PEN,8,8,32,32);
72   fix_tilemap = tilemap_create(get_tile_info,tilemap_scan_cols,8,8,32,32);
7373
7474   tilemap_set_transparent_pen(fix_tilemap,0);
7575}
src/mame/video/drgnmst.c
r1679r1680
133133
134134VIDEO_START(drgnmst)
135135{
136   drgnmst_fg_tilemap = tilemap_create(get_drgnmst_fg_tile_info,drgnmst_fg_tilemap_scan_cols,TILEMAP_TYPE_PEN,      8, 8, 64,64);
136   drgnmst_fg_tilemap = tilemap_create(get_drgnmst_fg_tile_info,drgnmst_fg_tilemap_scan_cols,      8, 8, 64,64);
137137   tilemap_set_transparent_pen(drgnmst_fg_tilemap,15);
138138
139   drgnmst_md_tilemap = tilemap_create(get_drgnmst_md_tile_info,drgnmst_md_tilemap_scan_cols,TILEMAP_TYPE_PEN,      16, 16, 64,64);
139   drgnmst_md_tilemap = tilemap_create(get_drgnmst_md_tile_info,drgnmst_md_tilemap_scan_cols,      16, 16, 64,64);
140140   tilemap_set_transparent_pen(drgnmst_md_tilemap,15);
141141
142   drgnmst_bg_tilemap = tilemap_create(get_drgnmst_bg_tile_info,drgnmst_bg_tilemap_scan_cols,TILEMAP_TYPE_PEN,      32, 32, 64,64);
142   drgnmst_bg_tilemap = tilemap_create(get_drgnmst_bg_tile_info,drgnmst_bg_tilemap_scan_cols,      32, 32, 64,64);
143143   tilemap_set_transparent_pen(drgnmst_bg_tilemap,15);
144144
145145   // do the other tilemaps have rowscroll too? probably not ..
src/mame/video/freekick.c
r1679r1680
1919
2020VIDEO_START(freekick)
2121{
22   freek_tilemap = tilemap_create(get_freek_tile_info,tilemap_scan_rows,TILEMAP_TYPE_PEN, 8, 8,32,32);
22   freek_tilemap = tilemap_create(get_freek_tile_info,tilemap_scan_rows, 8, 8,32,32);
2323}
2424
2525
src/mame/video/namcos22.c
r1679r1680
490490   int dx = extent->param[0].dpdx * 65536.0f;
491491   const poly_extra_data *extra = extradata;
492492   mame_bitmap *destmap = destbase;
493   const pen_t *pal = &Machine->remapped_colortable[extra->color];
493   const pen_t *pal = &Machine->pens[extra->color];
494494   int prioverchar = extra->prioverchar;
495495   int z = extra->z;
496496   int alpha = extra->alpha;
r1679r1680
22242224
22252225static VIDEO_START( common )
22262226{
2227   bgtilemap = tilemap_create( TextTilemapGetInfo,tilemap_scan_rows,TILEMAP_TYPE_PEN,16,16,64,64 );
2227   bgtilemap = tilemap_create( TextTilemapGetInfo,tilemap_scan_rows,16,16,64,64 );
22282228      tilemap_set_transparent_pen( bgtilemap, 0xf );
22292229
22302230   mbDSPisActive = 0;
src/mame/video/redclash.c
r1679r1680
155155VIDEO_START( redclash )
156156{
157157   fg_tilemap = tilemap_create(get_fg_tile_info, tilemap_scan_rows,
158      TILEMAP_TYPE_PEN, 8, 8, 32, 32);
158      8, 8, 32, 32);
159159
160160   tilemap_set_transparent_pen(fg_tilemap, 0);
161161}
src/mame/video/flyball.c
r1679r1680
5050VIDEO_START( flyball )
5151{
5252   flyball_tilemap = tilemap_create(flyball_get_tile_info,
53      flyball_get_memory_offset, TILEMAP_TYPE_PEN, 8, 16, 32, 16);
53      flyball_get_memory_offset, 8, 16, 32, 16);
5454}
5555
5656
src/mame/video/xybots.c
r1679r1680
8282   };
8383
8484   /* initialize the playfield */
85   atarigen_playfield_tilemap = tilemap_create(get_playfield_tile_info, tilemap_scan_rows, TILEMAP_TYPE_PEN, 8,8, 64,32);
85   atarigen_playfield_tilemap = tilemap_create(get_playfield_tile_info, tilemap_scan_rows, 8,8, 64,32);
8686
8787   /* initialize the motion objects */
8888   atarimo_init(machine, 0, &modesc);
8989
9090   /* initialize the alphanumerics */
91   atarigen_alpha_tilemap = tilemap_create(get_alpha_tile_info, tilemap_scan_rows, TILEMAP_TYPE_PEN, 8,8, 64,32);
91   atarigen_alpha_tilemap = tilemap_create(get_alpha_tile_info, tilemap_scan_rows, 8,8, 64,32);
9292   tilemap_set_transparent_pen(atarigen_alpha_tilemap, 0);
9393}
9494
src/mame/video/rockola.c
r1679r1680
88
99#include "driver.h"
1010#include "deprecat.h"
11#include "video/mc6845.h"
1112
13
1214UINT8 *rockola_videoram2;
1315UINT8 *rockola_charram;
1416
1517static int charbank;
1618static int backcolor;
1719
18static tilemap *bg_tilemap, *fg_tilemap;
20static mc6845_t *mc6845;
21static tilemap *bg_tilemap;
22static tilemap *fg_tilemap;
1923
2024static rgb_t palette[64];
2125
r1679r1680
110114   }
111115}
112116
117
118WRITE8_HANDLER( rockola_mc6845_address_w )
119{
120   mc6845_address_w(mc6845, data);
121}
122
123
124WRITE8_HANDLER( rockola_mc6845_register_w )
125{
126   mc6845_register_w(mc6845, data);
127}
128
129
113130WRITE8_HANDLER( rockola_flipscreen_w )
114131{
115132   int bank;
r1679r1680
176193
177194VIDEO_START( rockola )
178195{
179   bg_tilemap = tilemap_create(get_bg_tile_info, tilemap_scan_rows,
180      TILEMAP_TYPE_PEN, 8, 8, 32, 32);
196   mc6845 = mc6845_config(NULL);
181197
182   fg_tilemap = tilemap_create(get_fg_tile_info, tilemap_scan_rows,
183      TILEMAP_TYPE_PEN, 8, 8, 32, 32);
198   bg_tilemap = tilemap_create(get_bg_tile_info, tilemap_scan_rows, 8, 8, 32, 32);
199   fg_tilemap = tilemap_create(get_fg_tile_info, tilemap_scan_rows, 8, 8, 32, 32);
184200
185201   tilemap_set_transparent_pen(fg_tilemap, 0);
186202}
r1679r1680
299315
300316VIDEO_START( satansat )
301317{
302   bg_tilemap = tilemap_create(satansat_get_bg_tile_info, tilemap_scan_rows,
303      TILEMAP_TYPE_PEN, 8, 8, 32, 32);
318   mc6845 = mc6845_config(NULL);
304319
305   fg_tilemap = tilemap_create(satansat_get_fg_tile_info, tilemap_scan_rows,
306      TILEMAP_TYPE_PEN, 8, 8, 32, 32);
320   bg_tilemap = tilemap_create(satansat_get_bg_tile_info, tilemap_scan_rows, 8, 8, 32, 32);
321   fg_tilemap = tilemap_create(satansat_get_fg_tile_info, tilemap_scan_rows, 8, 8, 32, 32);
307322
308323   tilemap_set_transparent_pen(fg_tilemap, 0);
309324}
src/mame/video/centiped.c
r1679r1680
8787
8888VIDEO_START( centiped )
8989{
90   bg_tilemap = tilemap_create(centiped_get_tile_info, tilemap_scan_rows, TILEMAP_TYPE_PEN, 8,8, 32,32);
90   bg_tilemap = tilemap_create(centiped_get_tile_info, tilemap_scan_rows, 8,8, 32,32);
9191
9292   init_penmask();
9393
r1679r1680
100100
101101VIDEO_START( warlords )
102102{
103   bg_tilemap = tilemap_create(warlords_get_tile_info, tilemap_scan_rows, TILEMAP_TYPE_PEN, 8,8, 32,32);
103   bg_tilemap = tilemap_create(warlords_get_tile_info, tilemap_scan_rows, 8,8, 32,32);
104104
105105   /* we overload centiped_flipscreen here to track the cocktail/upright state */
106106   centiped_flipscreen = readinputport(0) & 0x80;
r1679r1680
110110
111111VIDEO_START( milliped )
112112{
113   bg_tilemap = tilemap_create(milliped_get_tile_info, tilemap_scan_rows, TILEMAP_TYPE_PEN, 8,8, 32,32);
113   bg_tilemap = tilemap_create(milliped_get_tile_info, tilemap_scan_rows, 8,8, 32,32);
114114
115115   init_penmask();
116116
r1679r1680
122122
123123VIDEO_START( bullsdrt )
124124{
125   bg_tilemap = tilemap_create(bullsdrt_get_tile_info, tilemap_scan_rows, TILEMAP_TYPE_PEN, 8,8, 32,32);
125   bg_tilemap = tilemap_create(bullsdrt_get_tile_info, tilemap_scan_rows, 8,8, 32,32);
126126
127127   init_penmask();
128128
src/mame/video/atarisy1.c
r1679r1680
197197   decode_gfx(machine, playfield_lookup, motable);
198198
199199   /* initialize the playfield */
200   atarigen_playfield_tilemap = tilemap_create(get_playfield_tile_info, tilemap_scan_rows, TILEMAP_TYPE_PEN, 8,8, 64,64);
200   atarigen_playfield_tilemap = tilemap_create(get_playfield_tile_info, tilemap_scan_rows, 8,8, 64,64);
201201
202202   /* initialize the motion objects */
203203   atarimo_init(machine, 0, &modesc);
204204
205205   /* initialize the alphanumerics */
206   atarigen_alpha_tilemap = tilemap_create(get_alpha_tile_info, tilemap_scan_rows, TILEMAP_TYPE_PEN, 8,8, 64,32);
206   atarigen_alpha_tilemap = tilemap_create(get_alpha_tile_info, tilemap_scan_rows, 8,8, 64,32);
207207   tilemap_set_transparent_pen(atarigen_alpha_tilemap, 0);
208208
209209   /* modify the motion object code lookup */
r1679r1680
351351
352352   /* but since we've adjusted it, we must reset it to the normal value
353353       once we hit scanline 0 again */
354   timer_adjust(yscroll_reset_timer, video_screen_get_time_until_pos(0, 0, 0), newscroll, attotime_zero);
354   timer_adjust_oneshot(yscroll_reset_timer, video_screen_get_time_until_pos(0, 0, 0), newscroll);
355355
356356   /* update the data */
357357   *atarigen_yscroll = newscroll;
r1679r1680
419419   atarigen_scanline_int_gen(machine, 0);
420420
421421   /* set a timer to turn it off */
422   timer_adjust(int3off_timer, video_screen_get_scan_period(0), 0, attotime_zero);
422   timer_adjust_oneshot(int3off_timer, video_screen_get_scan_period(0), 0);
423423
424424   /* determine the time of the next one */
425425   next_timer_scanline = -1;
r1679r1680
498498
499499      /* set a new one */
500500      if (best != -1)
501         timer_adjust(scanline_timer, video_screen_get_time_until_pos(0, best, 0), best, attotime_zero);
501         timer_adjust_oneshot(scanline_timer, video_screen_get_time_until_pos(0, best, 0), best);
502502      else
503         timer_adjust(scanline_timer, attotime_never, 0, attotime_zero);
503         timer_adjust_oneshot(scanline_timer, attotime_never, 0);
504504   }
505505}
506506
src/mame/video/wgp.c
r1679r1680
5656
5757static void wgp_core_vh_start(running_machine *machine, int x_offs,int y_offs,int piv_xoffs,int piv_yoffs)
5858{
59   wgp_piv_tilemap[0] = tilemap_create(get_piv0_tile_info,tilemap_scan_rows,TILEMAP_TYPE_PEN,16,16,64,64);
60   wgp_piv_tilemap[1] = tilemap_create(get_piv1_tile_info,tilemap_scan_rows,TILEMAP_TYPE_PEN,16,16,64,64);
61   wgp_piv_tilemap[2] = tilemap_create(get_piv2_tile_info,tilemap_scan_rows,TILEMAP_TYPE_PEN,16,16,64,64);
59   wgp_piv_tilemap[0] = tilemap_create(get_piv0_tile_info,tilemap_scan_rows,16,16,64,64);
60   wgp_piv_tilemap[1] = tilemap_create(get_piv1_tile_info,tilemap_scan_rows,16,16,64,64);
61   wgp_piv_tilemap[2] = tilemap_create(get_piv2_tile_info,tilemap_scan_rows,16,16,64,64);
6262
6363   TC0100SCN_vh_start(machine,1,TC0100SCN_GFX_NUM,x_offs,y_offs,0,0,0,0,0);
6464
src/mame/video/welltris.c
r1679r1680
218218
219219VIDEO_START( welltris )
220220{
221   char_tilemap = tilemap_create(get_welltris_tile_info, tilemap_scan_rows, TILEMAP_TYPE_PEN, 8, 8, 64, 32);
221   char_tilemap = tilemap_create(get_welltris_tile_info, tilemap_scan_rows, 8, 8, 64, 32);
222222
223223   tilemap_set_transparent_pen(char_tilemap, 15);
224224}
src/mame/video/sprint8.c
r1679r1680
8181   helper1 = auto_bitmap_alloc(machine->screen[0].width, machine->screen[0].height, machine->screen[0].format);
8282   helper2 = auto_bitmap_alloc(machine->screen[0].width, machine->screen[0].height, machine->screen[0].format);
8383
84   tilemap1 = tilemap_create(get_tile_info1, tilemap_scan_rows, TILEMAP_TYPE_PEN, 16, 8, 32, 32);
85   tilemap2 = tilemap_create(get_tile_info2, tilemap_scan_rows, TILEMAP_TYPE_PEN, 16, 8, 32, 32);
84   tilemap1 = tilemap_create(get_tile_info1, tilemap_scan_rows,  16, 8, 32, 32);
85   tilemap2 = tilemap_create(get_tile_info2, tilemap_scan_rows,  16, 8, 32, 32);
8686
8787   tilemap_set_scrolly(tilemap1, 0, +24);
8888   tilemap_set_scrolly(tilemap2, 0, +24);
src/mame/video/gumbo.c
r1679r1680
3838
3939VIDEO_START( gumbo )
4040{
41   gumbo_bg_tilemap = tilemap_create(get_gumbo_bg_tile_info,tilemap_scan_rows,TILEMAP_TYPE_PEN,      8, 8, 64,32);
42   gumbo_fg_tilemap = tilemap_create(get_gumbo_fg_tile_info,tilemap_scan_rows,TILEMAP_TYPE_PEN, 4, 4,128,64);
41   gumbo_bg_tilemap = tilemap_create(get_gumbo_bg_tile_info,tilemap_scan_rows,      8, 8, 64,32);
42   gumbo_fg_tilemap = tilemap_create(get_gumbo_fg_tile_info,tilemap_scan_rows, 4, 4,128,64);
4343   tilemap_set_transparent_pen(gumbo_fg_tilemap,0xff);
4444}
4545
src/mame/video/dec0.c
r1679r1680
699699
700700VIDEO_START( dec0_nodma )
701701{
702   pf1_tilemap_0 = tilemap_create(get_pf1_tile_info,tile_shape0_8x8_scan,TILEMAP_TYPE_PEN, 8, 8,128, 32);
703   pf1_tilemap_1 = tilemap_create(get_pf1_tile_info,tile_shape1_8x8_scan,TILEMAP_TYPE_PEN, 8, 8, 64, 64);
704   pf1_tilemap_2 = tilemap_create(get_pf1_tile_info,tile_shape2_8x8_scan,TILEMAP_TYPE_PEN, 8, 8, 32,128);
705   pf2_tilemap_0 = tilemap_create(get_pf2_tile_info,tile_shape0_scan,    TILEMAP_TYPE_PEN,16,16, 64, 16);
706   pf2_tilemap_1 = tilemap_create(get_pf2_tile_info,tile_shape1_scan,    TILEMAP_TYPE_PEN,16,16, 32, 32);
707   pf2_tilemap_2 = tilemap_create(get_pf2_tile_info,tile_shape2_scan,    TILEMAP_TYPE_PEN,16,16, 16, 64);
708   pf3_tilemap_0 = tilemap_create(get_pf3_tile_info,tile_shape0_scan,    TILEMAP_TYPE_PEN,16,16, 64, 16);
709   pf3_tilemap_1 = tilemap_create(get_pf3_tile_info,tile_shape1_scan,    TILEMAP_TYPE_PEN,16,16, 32, 32);
710   pf3_tilemap_2 = tilemap_create(get_pf3_tile_info,tile_shape2_scan,    TILEMAP_TYPE_PEN,16,16, 16, 64);
702   pf1_tilemap_0 = tilemap_create(get_pf1_tile_info,tile_shape0_8x8_scan, 8, 8,128, 32);
703   pf1_tilemap_1 = tilemap_create(get_pf1_tile_info,tile_shape1_8x8_scan, 8, 8, 64, 64);
704   pf1_tilemap_2 = tilemap_create(get_pf1_tile_info,tile_shape2_8x8_scan, 8, 8, 32,128);
705   pf2_tilemap_0 = tilemap_create(get_pf2_tile_info,tile_shape0_scan,    16,16, 64, 16);
706   pf2_tilemap_1 = tilemap_create(get_pf2_tile_info,tile_shape1_scan,    16,16, 32, 32);
707   pf2_tilemap_2 = tilemap_create(get_pf2_tile_info,tile_shape2_scan,    16,16, 16, 64);
708   pf3_tilemap_0 = tilemap_create(get_pf3_tile_info,tile_shape0_scan,    16,16, 64, 16);
709   pf3_tilemap_1 = tilemap_create(get_pf3_tile_info,tile_shape1_scan,    16,16, 32, 32);
710   pf3_tilemap_2 = tilemap_create(get_pf3_tile_info,tile_shape2_scan,    16,16, 16, 64);
711711
712712   dec0_spriteram=spriteram16;
713713}
src/mame/video/ssv.c
r1679r1680
230230   eaglshot_dirty_tile   =   (char*)auto_malloc(4 * 0x100000 / (16*8));
231231
232232   gdfs_tmap         =   tilemap_create(   get_tile_info_0, tilemap_scan_rows,
233                                 TILEMAP_TYPE_PEN, 16,16, 0x100,0x100   );
233                                  16,16, 0x100,0x100   );
234234
235235   tilemap_set_transparent_pen(gdfs_tmap, 0);
236236}
src/mame/video/atarig42.c
r1679r1680
120120   atarigen_blend_gfx(machine, 0, 2, 0x0f, 0x30);
121121
122122   /* initialize the playfield */
123   atarigen_playfield_tilemap = tilemap_create(get_playfield_tile_info, atarig42_playfield_scan, TILEMAP_TYPE_PEN, 8,8, 128,64);
123   atarigen_playfield_tilemap = tilemap_create(get_playfield_tile_info, atarig42_playfield_scan, 8,8, 128,64);
124124
125125   /* initialize the motion objects */
126126   adjusted_modesc.palettebase = atarig42_motion_object_base;
r1679r1680
129129   atarirle_init(0, &adjusted_modesc);
130130
131131   /* initialize the alphanumerics */
132   atarigen_alpha_tilemap = tilemap_create(get_alpha_tile_info, tilemap_scan_rows, TILEMAP_TYPE_PEN, 8,8, 64,32);
132   atarigen_alpha_tilemap = tilemap_create(get_alpha_tile_info, tilemap_scan_rows, 8,8, 64,32);
133133   tilemap_set_transparent_pen(atarigen_alpha_tilemap, 0);
134134
135135   /* reset statics */
src/mame/video/tceptor.c
r1679r1680
1111#define TX_TILE_OFFSET_RIGHT   (32 * 0 + 2)
1212#define TX_TILE_OFFSET_LEFT   (32 * 31 + 2)
1313
14#define SPR_TRANS_COLOR      (0xff + 768)
15#define SPR_MASK_COLOR      (0xfe + 768)
14#define SPR_TRANS_COLOR      (0xff + 0x300)
15#define SPR_MASK_COLOR      (0xfe + 0x300)
1616
1717
1818UINT8 *tceptor_tile_ram;
r1679r1680
4242
4343PALETTE_INIT( tceptor )
4444{
45   int totcolors, totlookup;
4645   int i;
4746
48   totcolors = machine->drv->total_colors;
49   totlookup = machine->drv->color_table_len;
47   /* allocate the colortable */
48   machine->colortable = colortable_alloc(machine, 0x400);
5049
51   for (i = 0; i < totcolors; i++)
50   /* create a lookup table for the palette */
51   for (i = 0; i < 0x400; i++)
5252   {
53      int bit0, bit1, bit2, bit3, r, g, b;
53      int r = pal4bit(color_prom[i + 0x000]);
54      int g = pal4bit(color_prom[i + 0x400]);
55      int b = pal4bit(color_prom[i + 0x800]);
5456
55      bit0 = (color_prom[0] >> 0) & 0x01;
56      bit1 = (color_prom[0] >> 1) & 0x01;
57      bit2 = (color_prom[0] >> 2) & 0x01;
58      bit3 = (color_prom[0] >> 3) & 0x01;
59      r = 0x0e * bit0 + 0x1f * bit1 + 0x43 * bit2 + 0x8f * bit3;
60      bit0 = (color_prom[totcolors] >> 0) & 0x01;
61      bit1 = (color_prom[totcolors] >> 1) & 0x01;
62      bit2 = (color_prom[totcolors] >> 2) & 0x01;
63      bit3 = (color_prom[totcolors] >> 3) & 0x01;
64      g = 0x0e * bit0 + 0x1f * bit1 + 0x43 * bit2 + 0x8f * bit3;
65      bit0 = (color_prom[2*totcolors] >> 0) & 0x01;
66      bit1 = (color_prom[2*totcolors] >> 1) & 0x01;
67      bit2 = (color_prom[2*totcolors] >> 2) & 0x01;
68      bit3 = (color_prom[2*totcolors] >> 3) & 0x01;
69      b = 0x0e * bit0 + 0x1f * bit1 + 0x43 * bit2 + 0x8f * bit3;
70
71      palette_set_color(machine, i, MAKE_RGB(r, g, b));
72      color_prom++;
57      colortable_palette_set_color(machine->colortable, i, MAKE_RGB(r, g, b));
7358   }
7459
75   color_prom += 2 * totcolors;
7660   /* color_prom now points to the beginning of the lookup table */
61   color_prom += 0xc00;
7762
63
7864   /*
7965          color lookup table:
8066            0-    +1024 ( 4 * 256) colors: text   (use 0-   256 colors)
r1679r1680
8470        */
8571
8672   /* tiles lookup table (1024 colors) */
87   for (i = 0; i < 1024;i++)
88      colortable[i] = *color_prom++;
73   for (i = 0; i < 0x0400; i++)
74   {
75      int ctabentry = color_prom[i];
76      colortable_entry_set_value(machine->colortable, i, ctabentry);
77   }
8978
90   /* road lookup table (256 colors) */
91   for (i = 0; i < 256; i++)
92      colortable[i + 0xf00] = *(color_prom++) + 512;
93
9479   /* sprites lookup table (1024 colors) */
95   for (i = 0;i < 1024; i++)
96      colortable[i + 1024] = *(color_prom++) + 768;
80   for (i = 0x0400; i < 0x0800; i++)
81   {
82      int ctabentry = color_prom[i] | 0x300;
83      colortable_entry_set_value(machine->colortable, i, ctabentry);
84   }
9785
98   /* background: lookup prom is not presented, use prom directly (512 colors) */
99   for (i = 0;i < 512; i++)
100      colortable[i + 2048] = i;
86   /* background: no lookup PROM, use directly (512 colors) */
87   for (i = 0x0a00; i < 0x0c00; i++)
88   {
89      int ctabentry = i & 0x1ff;
90      colortable_entry_set_value(machine->colortable, i, ctabentry);
91   }
10192
93   /* road lookup table (256 colors) */
94   for (i = 0x0f00; i < 0x1000; i++)
95   {
96      int ctabentry = color_prom[i - 0x700] | 0x200;
97      colortable_entry_set_value(machine->colortable, i, ctabentry);
98   }
99
102100   /* setup sprite mask color map */
103101   /* tceptor2: only 0x23 */
104102   memset(is_mask_spr, 0, sizeof is_mask_spr);
105   for (i = 0; i < 1024; i++)
106      if (colortable[i + 1024] == SPR_MASK_COLOR)
107         is_mask_spr[i / 16] = 1;
103   for (i = 0; i < 0x400; i++)
104      if (colortable_entry_get_value(machine->colortable, i | 0x400) == SPR_MASK_COLOR)
105         is_mask_spr[i >> 4] = 1;
108106}
109107
110108
r1679r1680
132130   int code = tceptor_tile_ram[offset];
133131   int color = tceptor_tile_attr[offset];
134132
133   tileinfo->group = color;
134
135135   SET_TILE_INFO(0, code, color, 0);
136136}
137137
r1679r1680
430430
431431   namco_road_init(machine, gfx_index);
432432
433   namco_road_set_transparent_color(machine->remapped_colortable[0xfff]);
433   namco_road_set_transparent_color(colortable_entry_get_value(machine->colortable, 0xfff));
434434
435   tx_tilemap = tilemap_create(get_tx_tile_info, tilemap_scan_cols, TILEMAP_TYPE_COLORTABLE, 8, 8, 34, 28);
435   tx_tilemap = tilemap_create(get_tx_tile_info, tilemap_scan_cols, 8, 8, 34, 28);
436436
437437   tilemap_set_scrollx(tx_tilemap, 0, -2*8);
438438   tilemap_set_scrolly(tx_tilemap, 0, 0);
439   tilemap_set_transparent_pen(tx_tilemap, 7);
439   colortable_configure_tilemap_groups(machine->colortable, tx_tilemap, machine->gfx[0], 7);
440440
441   bg1_tilemap = tilemap_create(get_bg1_tile_info, tilemap_scan_rows, TILEMAP_TYPE_PEN, 8, 8, 64, 32);
442   bg2_tilemap = tilemap_create(get_bg2_tile_info, tilemap_scan_rows, TILEMAP_TYPE_PEN, 8, 8, 64, 32);
441   bg1_tilemap = tilemap_create(get_bg1_tile_info, tilemap_scan_rows,  8, 8, 64, 32);
442   bg2_tilemap = tilemap_create(get_bg2_tile_info, tilemap_scan_rows,  8, 8, 64, 32);
443443
444444   state_save_register_global_pointer(tceptor_sprite_ram_buffered, 0x200 / 2);
445445   state_save_register_global(bg1_scroll_x);
r1679r1680
533533                     flipx, flipy,
534534                     x, y,
535535                     cliprect,
536                     TRANSPARENCY_COLOR, SPR_TRANS_COLOR,
536                     TRANSPARENCY_PENS,
537                     colortable_get_transpen_mask(machine->colortable, machine->gfx[gfx], color, SPR_TRANS_COLOR),
537538                     scalex,
538539                     scaley);
539540      }
r1679r1680
546547
547548      for (x = cliprect->min_x; x <= cliprect->max_x; x++)
548549         for (y = cliprect->min_y; y <= cliprect->max_y; y++)
549            if (*BITMAP_ADDR16(bitmap, y, x) == SPR_MASK_COLOR)
550            {
550            if (colortable_entry_get_value(machine->colortable, *BITMAP_ADDR16(bitmap, y, x)) == SPR_MASK_COLOR)
551551               // restore pixel
552552               *BITMAP_ADDR16(bitmap, y, x) = *BITMAP_ADDR16(temp_bitmap, y, x);
553            }
554553   }
555554}
556555
src/mame/video/cop01.c
r1679r1680
105105
106106VIDEO_START( cop01 )
107107{
108   bg_tilemap = tilemap_create(get_bg_tile_info,tilemap_scan_rows,TILEMAP_TYPE_PEN,      8,8,64,32);
109   fg_tilemap = tilemap_create(get_fg_tile_info,tilemap_scan_rows,TILEMAP_TYPE_PEN,8,8,32,32);
108   bg_tilemap = tilemap_create(get_bg_tile_info,tilemap_scan_rows,      8,8,64,32);
109   fg_tilemap = tilemap_create(get_fg_tile_info,tilemap_scan_rows,8,8,32,32);
110110
111111   tilemap_set_transparent_pen(fg_tilemap,15);
112112
src/mame/video/vindictr.c
r1679r1680
9696   };
9797
9898   /* initialize the playfield */
99   atarigen_playfield_tilemap = tilemap_create(get_playfield_tile_info, tilemap_scan_cols, TILEMAP_TYPE_PEN, 8,8, 64,64);
99   atarigen_playfield_tilemap = tilemap_create(get_playfield_tile_info, tilemap_scan_cols, 8,8, 64,64);
100100
101101   /* initialize the motion objects */
102102   atarimo_init(machine, 0, &modesc);
103103
104104   /* initialize the alphanumerics */
105   atarigen_alpha_tilemap = tilemap_create(get_alpha_tile_info, tilemap_scan_rows, TILEMAP_TYPE_PEN, 8,8, 64,32);
105   atarigen_alpha_tilemap = tilemap_create(get_alpha_tile_info, tilemap_scan_rows, 8,8, 64,32);
106106   tilemap_set_transparent_pen(atarigen_alpha_tilemap, 0);
107107}
108108
src/mame/video/hanaawas.c
r1679r1680
1919PALETTE_INIT( hanaawas )
2020{
2121   int i;
22   #define TOTAL_COLORS(gfxn) (machine->gfx[gfxn]->total_colors * machine->gfx[gfxn]->color_granularity)
23   #define COLOR(gfxn,offs) (colortable[machine->drv->gfxdecodeinfo[gfxn].color_codes_start + offs])
2422
23   /* allocate the colortable */
24   machine->colortable = colortable_alloc(machine, 0x10);
2525
26   for (i = 0;i < machine->drv->total_colors;i++)
26   /* create a lookup table for the palette */
27   for (i = 0; i < 0x10; i++)
2728   {
28      int bit0,bit1,bit2,r,g,b;
29      int bit0, bit1, bit2;
30      int r, g, b;
2931
30
3132      /* red component */
32      bit0 = (*color_prom >> 0) & 0x01;
33      bit1 = (*color_prom >> 1) & 0x01;
34      bit2 = (*color_prom >> 2) & 0x01;
33      bit0 = (color_prom[i] >> 0) & 0x01;
34      bit1 = (color_prom[i] >> 1) & 0x01;
35      bit2 = (color_prom[i] >> 2) & 0x01;
3536      r = 0x21 * bit0 + 0x47 * bit1 + 0x97 * bit2;
37
3638      /* green component */
37      bit0 = (*color_prom >> 3) & 0x01;
38      bit1 = (*color_prom >> 4) & 0x01;
39      bit2 = (*color_prom >> 5) & 0x01;
39      bit0 = (color_prom[i] >> 3) & 0x01;
40      bit1 = (color_prom[i] >> 4) & 0x01;
41      bit2 = (color_prom[i] >> 5) & 0x01;
4042      g = 0x21 * bit0 + 0x47 * bit1 + 0x97 * bit2;
43
4144      /* blue component */
4245      bit0 = 0;
43      bit1 = (*color_prom >> 6) & 0x01;
44      bit2 = (*color_prom >> 7) & 0x01;
46      bit1 = (color_prom[i] >> 6) & 0x01;
47      bit2 = (color_prom[i] >> 7) & 0x01;
4548      b = 0x21 * bit0 + 0x47 * bit1 + 0x97 * bit2;
4649
47      palette_set_color(machine,i,MAKE_RGB(r,g,b));
48      color_prom++;
50      colortable_palette_set_color(machine->colortable, i, MAKE_RGB(r, g, b));
4951   }
5052
51   color_prom += 0x10;
5253   /* color_prom now points to the beginning of the lookup table */
54   color_prom += 0x20;
5355
54
5556   /* character lookup table.  The 1bpp tiles really only use colors 0-0x0f and the
5657       3bpp ones 0x10-0x1f */
57
58   for (i = 0;i < TOTAL_COLORS(0)/8 ;i++)
58   for (i = 0; i < 0x100; i++)
5959   {
60      COLOR(0,i*8+0) = color_prom[i*4+0x00] & 0x0f;
61      COLOR(0,i*8+1) = color_prom[i*4+0x01] & 0x0f;
62      COLOR(0,i*8+2) = color_prom[i*4+0x02] & 0x0f;
63      COLOR(0,i*8+3) = color_prom[i*4+0x03] & 0x0f;
64      COLOR(0,i*8+4) = color_prom[i*4+0x80] & 0x0f;
65      COLOR(0,i*8+5) = color_prom[i*4+0x81] & 0x0f;
66      COLOR(0,i*8+6) = color_prom[i*4+0x82] & 0x0f;
67      COLOR(0,i*8+7) = color_prom[i*4+0x83] & 0x0f;
60      int swapped_i = BITSWAP8(i,2,7,6,5,4,3,1,0);
61      UINT8 ctabentry = color_prom[swapped_i] & 0x0f;
62      colortable_entry_set_value(machine->colortable, i, ctabentry);
6863   }
6964}
7065
r1679r1680
107102
108103VIDEO_START( hanaawas )
109104{
110   bg_tilemap = tilemap_create(get_bg_tile_info, tilemap_scan_rows,
111      TILEMAP_TYPE_PEN, 8, 8, 32, 32);
105   bg_tilemap = tilemap_create(get_bg_tile_info, tilemap_scan_rows, 8, 8, 32, 32);
112106}
113107
114108VIDEO_UPDATE( hanaawas )
src/mame/video/aquarium.c
r1679r1680
153153
154154VIDEO_START(aquarium)
155155{
156   aquarium_txt_tilemap = tilemap_create(get_aquarium_txt_tile_info,tilemap_scan_rows,TILEMAP_TYPE_PEN, 8, 8,64,64);
156   aquarium_txt_tilemap = tilemap_create(get_aquarium_txt_tile_info,tilemap_scan_rows, 8, 8,64,64);
157157   tilemap_set_transparent_pen(aquarium_txt_tilemap,0);
158158
159   aquarium_bak_tilemap = tilemap_create(get_aquarium_bak_tile_info,tilemap_scan_rows,TILEMAP_TYPE_PEN, 16, 16,32,32);
160   aquarium_mid_tilemap = tilemap_create(get_aquarium_mid_tile_info,tilemap_scan_rows,TILEMAP_TYPE_PEN, 16, 16,32,32);
159   aquarium_bak_tilemap = tilemap_create(get_aquarium_bak_tile_info,tilemap_scan_rows, 16, 16,32,32);
160   aquarium_mid_tilemap = tilemap_create(get_aquarium_mid_tile_info,tilemap_scan_rows, 16, 16,32,32);
161161   tilemap_set_transparent_pen(aquarium_mid_tilemap,0);
162162}
163163
src/mame/video/metro.c
r1679r1680
392392   metro_tiletable_old = auto_malloc(metro_tiletable_size);
393393   dirtyindex = auto_malloc(metro_tiletable_size/4);
394394
395   bg_tilemap[0] = tilemap_create(get_tile_info_0,tilemap_scan_rows,TILEMAP_TYPE_PEN,8,8,WIN_NX,WIN_NY);
396   bg_tilemap[1] = tilemap_create(get_tile_info_1,tilemap_scan_rows,TILEMAP_TYPE_PEN,8,8,WIN_NX,WIN_NY);
397   bg_tilemap[2] = tilemap_create(get_tile_info_2,tilemap_scan_rows,TILEMAP_TYPE_PEN,8,8,WIN_NX,WIN_NY);
395   bg_tilemap[0] = tilemap_create(get_tile_info_0,tilemap_scan_rows,8,8,WIN_NX,WIN_NY);
396   bg_tilemap[1] = tilemap_create(get_tile_info_1,tilemap_scan_rows,8,8,WIN_NX,WIN_NY);
397   bg_tilemap[2] = tilemap_create(get_tile_info_2,tilemap_scan_rows,8,8,WIN_NX,WIN_NY);
398398
399399   tilemap_16x16[0] = NULL;
400400   tilemap_16x16[1] = NULL;
r1679r1680
415415   metro_tiletable_old = auto_malloc(metro_tiletable_size);
416416   dirtyindex = auto_malloc(metro_tiletable_size/4);
417417
418   bg_tilemap[0] = tilemap_create(get_tile_info_0_8bit,tilemap_scan_rows,TILEMAP_TYPE_PEN,8,8,WIN_NX,WIN_NY);
419   bg_tilemap[1] = tilemap_create(get_tile_info_1_8bit,tilemap_scan_rows,TILEMAP_TYPE_PEN,8,8,WIN_NX,WIN_NY);
420   bg_tilemap[2] = tilemap_create(get_tile_info_2_8bit,tilemap_scan_rows,TILEMAP_TYPE_PEN,8,8,WIN_NX,WIN_NY);
418   bg_tilemap[0] = tilemap_create(get_tile_info_0_8bit,tilemap_scan_rows,8,8,WIN_NX,WIN_NY);
419   bg_tilemap[1] = tilemap_create(get_tile_info_1_8bit,tilemap_scan_rows,8,8,WIN_NX,WIN_NY);
420   bg_tilemap[2] = tilemap_create(get_tile_info_2_8bit,tilemap_scan_rows,8,8,WIN_NX,WIN_NY);
421421
422422   tilemap_16x16[0] = NULL;
423423   tilemap_16x16[1] = NULL;
r1679r1680
442442   metro_tiletable_old = auto_malloc(metro_tiletable_size);
443443   dirtyindex = auto_malloc(metro_tiletable_size/4);
444444
445   bg_tilemap[0] = tilemap_create(get_tile_info_0_8bit,tilemap_scan_rows,TILEMAP_TYPE_PEN,8,8,WIN_NX,WIN_NY);
446   bg_tilemap[1] = tilemap_create(get_tile_info_1_8bit,tilemap_scan_rows,TILEMAP_TYPE_PEN,8,8,WIN_NX,WIN_NY);
447   bg_tilemap[2] = tilemap_create(get_tile_info_2_8bit,tilemap_scan_rows,TILEMAP_TYPE_PEN,8,8,WIN_NX,WIN_NY);
445   bg_tilemap[0] = tilemap_create(get_tile_info_0_8bit,tilemap_scan_rows,8,8,WIN_NX,WIN_NY);
446   bg_tilemap[1] = tilemap_create(get_tile_info_1_8bit,tilemap_scan_rows,8,8,WIN_NX,WIN_NY);
447   bg_tilemap[2] = tilemap_create(get_tile_info_2_8bit,tilemap_scan_rows,8,8,WIN_NX,WIN_NY);
448448
449   tilemap_16x16[0] = tilemap_create(get_tile_info_0_16x16_8bit,tilemap_scan_rows,TILEMAP_TYPE_PEN,16,16,WIN_NX,WIN_NY);
450   tilemap_16x16[1] = tilemap_create(get_tile_info_1_16x16_8bit,tilemap_scan_rows,TILEMAP_TYPE_PEN,16,16,WIN_NX,WIN_NY);
451   tilemap_16x16[2] = tilemap_create(get_tile_info_2_16x16_8bit,tilemap_scan_rows,TILEMAP_TYPE_PEN,16,16,WIN_NX,WIN_NY);
449   tilemap_16x16[0] = tilemap_create(get_tile_info_0_16x16_8bit,tilemap_scan_rows,16,16,WIN_NX,WIN_NY);
450   tilemap_16x16[1] = tilemap_create(get_tile_info_1_16x16_8bit,tilemap_scan_rows,16,16,WIN_NX,WIN_NY);
451   tilemap_16x16[2] = tilemap_create(get_tile_info_2_16x16_8bit,tilemap_scan_rows,16,16,WIN_NX,WIN_NY);
452452
453453   tilemap_set_transparent_pen(bg_tilemap[0],0);
454454   tilemap_set_transparent_pen(bg_tilemap[1],0);
r1679r1680
465465   has_zoom = 1;
466466
467467   metro_K053936_tilemap = tilemap_create(metro_K053936_get_tile_info, tilemap_scan_rows,
468                        TILEMAP_TYPE_PEN, 8,8, 256, 512 );
468                        8,8, 256, 512 );
469469
470470   K053936_wraparound_enable(0, 0);
471471   K053936_set_offset(0, -69, -21);
r1679r1680
482482   has_zoom = 1;
483483
484484   metro_K053936_tilemap = tilemap_create(metro_K053936_gstrik2_get_tile_info, tilemap_scan_gstrik2,
485                        TILEMAP_TYPE_PEN, 16,16, 128, 256 );
485                        16,16, 128, 256 );
486486
487487   K053936_wraparound_enable(0, 0);
488488   K053936_set_offset(0, -69, -19);
src/mame/video/angelkds.c
r1679r1680
264264VIDEO_START( angelkds )
265265{
266266
267   tx_tilemap = tilemap_create(get_tx_tile_info,tilemap_scan_rows,TILEMAP_TYPE_PEN, 8, 8,32,32);
267   tx_tilemap = tilemap_create(get_tx_tile_info,tilemap_scan_rows, 8, 8,32,32);
268268   tilemap_set_transparent_pen(tx_tilemap,0);
269269
270   bgbot_tilemap = tilemap_create(get_bgbot_tile_info,tilemap_scan_rows,TILEMAP_TYPE_PEN, 8, 8,32,32);
270   bgbot_tilemap = tilemap_create(get_bgbot_tile_info,tilemap_scan_rows, 8, 8,32,32);
271271   tilemap_set_transparent_pen(bgbot_tilemap,15);
272272
273   bgtop_tilemap = tilemap_create(get_bgtop_tile_info,tilemap_scan_rows,TILEMAP_TYPE_PEN, 8, 8,32,32);
273   bgtop_tilemap = tilemap_create(get_bgtop_tile_info,tilemap_scan_rows, 8, 8,32,32);
274274   tilemap_set_transparent_pen(bgtop_tilemap,15);
275275}
276276
src/mame/video/circusc.c
r1679r1680
110110{
111111   UINT8 attr = circusc_colorram[tile_index];
112112   tileinfo->category = (attr & 0x10) >> 4;
113   tileinfo->group = attr & 0x0f;
114113
115114   SET_TILE_INFO(0,
116115              circusc_videoram[tile_index] + ((attr & 0x20) << 3),
r1679r1680
128127
129128VIDEO_START( circusc )
130129{
131   bg_tilemap = tilemap_create(get_tile_info,tilemap_scan_rows,TILEMAP_TYPE_PEN,8,8,32,32);
130   bg_tilemap = tilemap_create(get_tile_info,tilemap_scan_rows,8,8,32,32);
132131
133132   tilemap_set_scroll_cols(bg_tilemap,32);
134133}
src/mame/video/mikie.c
r1679r1680
131131VIDEO_START( mikie )
132132{
133133   bg_tilemap = tilemap_create(get_bg_tile_info, tilemap_scan_rows,
134      TILEMAP_TYPE_PEN, 8, 8, 32, 32);
134      8, 8, 32, 32);
135135}
136136
137137static void draw_sprites(running_machine *machine, mame_bitmap *bitmap, const rectangle *cliprect)
src/mame/video/midvunit.c
r1679r1680
6161   if (scanline != -1)
6262   {
6363      cpunum_set_input_line(machine, 0, 0, ASSERT_LINE);
64      timer_adjust(scanline_timer, video_screen_get_time_until_pos(0, scanline + 1, 0), scanline, attotime_zero);
64      timer_adjust_oneshot(scanline_timer, video_screen_get_time_until_pos(0, scanline + 1, 0), scanline);
6565      timer_set(ATTOTIME_IN_HZ(25000000), NULL, -1, scanline_timer_cb);
6666   }
6767   else
r1679r1680
449449
450450   /* update the scanline timer */
451451   if (offset == 0)
452      timer_adjust(scanline_timer, video_screen_get_time_until_pos(0, (data & 0x1ff) + 1, 0), data & 0x1ff, attotime_zero);
452      timer_adjust_oneshot(scanline_timer, video_screen_get_time_until_pos(0, (data & 0x1ff) + 1, 0), data & 0x1ff);
453453
454454   /* if something changed, update our parameters */
455455   if (old != video_regs[offset] && video_regs[6] != 0 && video_regs[11] != 0)
src/mame/video/usgames.c
r1679r1680
11#include "driver.h"
2#include "video/mc6845.h"
23#include "deprecat.h"
34
4UINT8 *usg_videoram,*usg_charram;
5UINT8 *usgames_videoram,*usgames_charram;
56
67
7static tilemap *usg_tilemap;
8static mc6845_t *mc6845;
9static tilemap *usgames_tilemap;
810
911
1012
11PALETTE_INIT(usg)
13PALETTE_INIT(usgames)
1214{
1315   int j;
1416
r1679r1680
3537
3638
3739
38static TILE_GET_INFO( get_usg_tile_info )
40static TILE_GET_INFO( get_usgames_tile_info )
3941{
4042   int tileno, colour;
4143
42   tileno = usg_videoram[tile_index*2];
43   colour = usg_videoram[tile_index*2+1];
44   tileno = usgames_videoram[tile_index*2];
45   colour = usgames_videoram[tile_index*2+1];
4446
4547   SET_TILE_INFO(0,tileno,colour,0);
4648}
4749
48VIDEO_START(usg)
50VIDEO_START(usgames)
4951{
50   usg_tilemap = tilemap_create(get_usg_tile_info,tilemap_scan_rows,TILEMAP_TYPE_PEN, 8, 8,64,32);
52   mc6845 = mc6845_config(NULL);
53   usgames_tilemap = tilemap_create(get_usgames_tile_info,tilemap_scan_rows, 8, 8,64,32);
5154}
5255
5356
54WRITE8_HANDLER( usg_videoram_w )
57WRITE8_HANDLER( usgames_videoram_w )
5558{
56   usg_videoram[offset] = data;
57   tilemap_mark_tile_dirty(usg_tilemap,offset/2);
59   usgames_videoram[offset] = data;
60   tilemap_mark_tile_dirty(usgames_tilemap,offset/2);
5861}
5962
60WRITE8_HANDLER( usg_charram_w )
63WRITE8_HANDLER( usgames_charram_w )
6164{
62   usg_charram[offset] = data;
65   usgames_charram[offset] = data;
6366
64   decodechar(Machine->gfx[0], offset/8, usg_charram);
67   decodechar(Machine->gfx[0], offset/8, usgames_charram);
6568
66   tilemap_mark_all_tiles_dirty(usg_tilemap);
69   tilemap_mark_all_tiles_dirty(usgames_tilemap);
6770}
6871
6972
73WRITE8_HANDLER( usgames_mc6845_address_w )
74{
75   mc6845_address_w(mc6845, data);
76}
7077
71VIDEO_UPDATE(usg)
78
79WRITE8_HANDLER( usgames_mc6845_register_w )
7280{
73   tilemap_draw(bitmap,cliprect,usg_tilemap,0,0);
81   mc6845_register_w(mc6845, data);
82}
83
84
85VIDEO_UPDATE(usgames)
86{
87   tilemap_draw(bitmap,cliprect,usgames_tilemap,0,0);
7488   return 0;
7589}
src/mame/video/zaccaria.c
r1679r1680
149149
150150VIDEO_START( zaccaria )
151151{
152   bg_tilemap = tilemap_create(get_tile_info,tilemap_scan_rows,TILEMAP_TYPE_PEN,8,8,32,32);
152   bg_tilemap = tilemap_create(get_tile_info,tilemap_scan_rows,8,8,32,32);
153153
154154   tilemap_set_scroll_cols(bg_tilemap,32);
155155}
src/mame/video/shadfrce.c
r1679r1680
6666
6767VIDEO_START( shadfrce )
6868{
69   shadfrce_fgtilemap = tilemap_create(get_shadfrce_fgtile_info,tilemap_scan_rows,TILEMAP_TYPE_PEN, 8, 8,64,32);
69   shadfrce_fgtilemap = tilemap_create(get_shadfrce_fgtile_info,tilemap_scan_rows, 8, 8,64,32);
7070      tilemap_set_transparent_pen(shadfrce_fgtilemap,0);
7171
72   shadfrce_bg0tilemap = tilemap_create(get_shadfrce_bg0tile_info,tilemap_scan_rows,TILEMAP_TYPE_PEN, 16, 16,32,32);
72   shadfrce_bg0tilemap = tilemap_create(get_shadfrce_bg0tile_info,tilemap_scan_rows, 16, 16,32,32);
7373      tilemap_set_transparent_pen(shadfrce_bg0tilemap,0);
7474
75   shadfrce_bg1tilemap = tilemap_create(get_shadfrce_bg1tile_info,tilemap_scan_rows,TILEMAP_TYPE_PEN, 16, 16,32,32);
75   shadfrce_bg1tilemap = tilemap_create(get_shadfrce_bg1tile_info,tilemap_scan_rows, 16, 16,32,32);
7676
7777   shadfrce_spvideoram_old = auto_malloc(spriteram_size);
7878}
src/mame/video/speedbal.c
r1679r1680
3939
4040VIDEO_START( speedbal )
4141{
42   bg_tilemap = tilemap_create(get_tile_info_bg, tilemap_scan_cols_flip_x, TILEMAP_TYPE_PEN, 16, 16, 16, 16);
43   fg_tilemap = tilemap_create(get_tile_info_fg, tilemap_scan_cols_flip_x, TILEMAP_TYPE_PEN,  8,  8, 32, 32);
42   bg_tilemap = tilemap_create(get_tile_info_bg, tilemap_scan_cols_flip_x,  16, 16, 16, 16);
43   fg_tilemap = tilemap_create(get_tile_info_fg, tilemap_scan_cols_flip_x,   8,  8, 32, 32);
4444
4545   tilemap_set_transmask(bg_tilemap,0,0xffff,0x0000); /* split type 0 is totally transparent in front half */
4646   tilemap_set_transmask(bg_tilemap,1,0x00f7,0x0000); /* split type 1 has pen 0-2, 4-7 transparent in front half */
src/mame/video/tagteam.c
r1679r1680
130130VIDEO_START( tagteam )
131131{
132132   bg_tilemap = tilemap_create(get_bg_tile_info, tilemap_scan_rows_flip_x,
133      TILEMAP_TYPE_PEN, 8, 8, 32, 32);
133      8, 8, 32, 32);
134134}
135135
136136static void draw_sprites(running_machine *machine, mame_bitmap *bitmap, const rectangle *cliprect)
src/mame/video/gtia.c
r1679r1680
4242 * set both color clocks equal for one color
4343 **********************************************/
4444#define SETCOL_B(o,d) \
45   antic.color_lookup[o] = (Machine->remapped_colortable[d] << 8) | Machine->remapped_colortable[d]
45   antic.color_lookup[o] = (Machine->pens[d] << 8) | Machine->pens[d]
4646
4747/**********************************************
4848 * set left color clock for one color
4949 **********************************************/
5050#define SETCOL_L(o,d) \
51   *((UINT8*)&antic.color_lookup[o] + 0) = Machine->remapped_colortable[d]
51   *((UINT8*)&antic.color_lookup[o] + 0) = Machine->pens[d]
5252
5353/**********************************************
5454 * set right color clock for one color
5555 **********************************************/
5656#define SETCOL_R(o,d) \
57   *((UINT8*)&antic.color_lookup[o] + 1) = Machine->remapped_colortable[d]
57   *((UINT8*)&antic.color_lookup[o] + 1) = Machine->pens[d]
5858
5959
6060
src/mame/video/bagman.c
r1679r1680
104104VIDEO_START( bagman )
105105{
106106   bg_tilemap = tilemap_create(get_bg_tile_info, tilemap_scan_rows,
107      TILEMAP_TYPE_PEN, 8, 8, 32, 32);
107      8, 8, 32, 32);
108108}
109109
110110static void draw_sprites(running_machine *machine, mame_bitmap *bitmap, const rectangle *cliprect)
src/mame/video/inufuku.c
r1679r1680
222222
223223VIDEO_START( inufuku )
224224{
225   inufuku_bg_tilemap = tilemap_create(get_inufuku_bg_tile_info, tilemap_scan_rows, TILEMAP_TYPE_PEN, 8, 8, 64, 64);
226   inufuku_text_tilemap = tilemap_create(get_inufuku_text_tile_info, tilemap_scan_rows, TILEMAP_TYPE_PEN, 8, 8, 64, 64);
225   inufuku_bg_tilemap = tilemap_create(get_inufuku_bg_tile_info, tilemap_scan_rows,  8, 8, 64, 64);
226   inufuku_text_tilemap = tilemap_create(get_inufuku_text_tile_info, tilemap_scan_rows,  8, 8, 64, 64);
227227
228228   tilemap_set_transparent_pen(inufuku_bg_tilemap, 255);
229229   tilemap_set_transparent_pen(inufuku_text_tilemap, 255);
src/mame/video/commando.c
r1679r1680
8989VIDEO_START( commando )
9090{
9191   bg_tilemap = tilemap_create(get_bg_tile_info, tilemap_scan_cols,
92      TILEMAP_TYPE_PEN, 16, 16, 32, 32);
92      16, 16, 32, 32);
9393
9494   fg_tilemap = tilemap_create(get_fg_tile_info, tilemap_scan_rows,
95      TILEMAP_TYPE_PEN, 8, 8, 32, 32);
95      8, 8, 32, 32);
9696
9797   tilemap_set_transparent_pen(fg_tilemap, 3);
9898}
src/mame/video/atarisy2.c
r1679r1680
124124   atarigen_playfield = &vram[0x2000];
125125
126126   /* initialize the playfield */
127   atarigen_playfield_tilemap = tilemap_create(get_playfield_tile_info, tilemap_scan_rows, TILEMAP_TYPE_PEN, 8,8, 128,64);
127   atarigen_playfield_tilemap = tilemap_create(get_playfield_tile_info, tilemap_scan_rows, 8,8, 128,64);
128128
129129   /* initialize the motion objects */
130130   atarimo_init(machine, 0, &modesc);
131131
132132   /* initialize the alphanumerics */
133   atarigen_alpha_tilemap = tilemap_create(get_alpha_tile_info, tilemap_scan_rows, TILEMAP_TYPE_PEN, 8,8, 64,48);
133   atarigen_alpha_tilemap = tilemap_create(get_alpha_tile_info, tilemap_scan_rows, 8,8, 64,48);
134134   tilemap_set_transparent_pen(atarigen_alpha_tilemap, 0);
135135
136136   /* reset the statics */
r1679r1680
196196   if (!(newscroll & 0x10))
197197      tilemap_set_scrolly(atarigen_playfield_tilemap, 0, (newscroll >> 6) - video_screen_get_vpos(0));
198198   else
199      timer_adjust(yscroll_reset_timer, video_screen_get_time_until_pos(0, 0, 0), newscroll >> 6, attotime_zero);
199      timer_adjust_oneshot(yscroll_reset_timer, video_screen_get_time_until_pos(0, 0, 0), newscroll >> 6);
200200
201201   /* update the playfield banking */
202202   if (playfield_tile_bank[1] != (newscroll & 0x0f) * 0x400)
src/mame/video/ninjakd2.c
r1679r1680
2525static UINT8* robokid_bg2_videoram;
2626
2727
28/*************************************
29 *
30 *  Callbacks for the TileMap code
31 *
32 *************************************/
33
2834static TILE_GET_INFO( get_fg_tile_info )
2935{
3036   int const lo = ninjakd2_fg_videoram[(tile_index << 1)];
r1679r1680
113119
114120
115121
122/*************************************
123 *
124 *  Video system start
125 *
126 *************************************/
127
116128static void videoram_alloc(const running_machine* const machine, int const size)
117129{
118130   if (size)
r1679r1680
135147{
136148   videoram_alloc(machine, 0);
137149
138   fg_tilemap = tilemap_create(         get_fg_tile_info, tilemap_scan_rows, TILEMAP_TYPE_PEN,  8,  8, 32, 32);
139   bg_tilemap = tilemap_create(ninjakd2_get_bg_tile_info, tilemap_scan_rows, TILEMAP_TYPE_PEN, 16, 16, 32, 32);
150   fg_tilemap = tilemap_create(         get_fg_tile_info, tilemap_scan_rows,   8,  8, 32, 32);
151   bg_tilemap = tilemap_create(ninjakd2_get_bg_tile_info, tilemap_scan_rows,  16, 16, 32, 32);
140152
141153   tilemap_set_transparent_pen(fg_tilemap, 15);
142154
r1679r1680
147159{
148160   videoram_alloc(machine, 0);
149161
150   fg_tilemap = tilemap_create(       get_fg_tile_info, tilemap_scan_rows, TILEMAP_TYPE_PEN,  8,  8, 32, 32);
151   bg_tilemap = tilemap_create(mnight_get_bg_tile_info, tilemap_scan_rows, TILEMAP_TYPE_PEN, 16, 16, 32, 32);
162   fg_tilemap = tilemap_create(       get_fg_tile_info, tilemap_scan_rows,   8,  8, 32, 32);
163   bg_tilemap = tilemap_create(mnight_get_bg_tile_info, tilemap_scan_rows,  16, 16, 32, 32);
152164
153165   tilemap_set_transparent_pen(fg_tilemap, 15);
154166
r1679r1680
161173
162174   videoram_alloc(machine, 0x0800);
163175
164   fg_tilemap  = tilemap_create(        get_fg_tile_info,  tilemap_scan_rows, TILEMAP_TYPE_PEN,  8,  8, 32, 32);
165   bg0_tilemap = tilemap_create(robokid_get_bg0_tile_info, robokid_bg_scan,   TILEMAP_TYPE_PEN, 16, 16, 32, 32);
166   bg1_tilemap = tilemap_create(robokid_get_bg1_tile_info, robokid_bg_scan,   TILEMAP_TYPE_PEN, 16, 16, 32, 32);
167   bg2_tilemap = tilemap_create(robokid_get_bg2_tile_info, robokid_bg_scan,   TILEMAP_TYPE_PEN, 16, 16, 32, 32);
176   fg_tilemap  = tilemap_create(        get_fg_tile_info,  tilemap_scan_rows,   8,  8, 32, 32);
177   bg0_tilemap = tilemap_create(robokid_get_bg0_tile_info, robokid_bg_scan,    16, 16, 32, 32);
178   bg1_tilemap = tilemap_create(robokid_get_bg1_tile_info, robokid_bg_scan,    16, 16, 32, 32);
179   bg2_tilemap = tilemap_create(robokid_get_bg2_tile_info, robokid_bg_scan,    16, 16, 32, 32);
168180
169181   tilemap_set_transparent_pen(fg_tilemap,  15);
170182   tilemap_set_transparent_pen(bg1_tilemap, 15);
r1679r1680
179191
180192   videoram_alloc(machine, 0x2000);
181193
182   fg_tilemap  = tilemap_create(        get_fg_tile_info,  tilemap_scan_rows, TILEMAP_TYPE_PEN,  8,  8,  32, 32);
183   bg0_tilemap = tilemap_create(robokid_get_bg0_tile_info, omegaf_bg_scan,    TILEMAP_TYPE_PEN, 16, 16, 128, 32);
184   bg1_tilemap = tilemap_create(robokid_get_bg1_tile_info, omegaf_bg_scan,    TILEMAP_TYPE_PEN, 16, 16, 128, 32);
185   bg2_tilemap = tilemap_create(robokid_get_bg2_tile_info, omegaf_bg_scan,    TILEMAP_TYPE_PEN, 16, 16, 128, 32);
194   fg_tilemap  = tilemap_create(        get_fg_tile_info,  tilemap_scan_rows,   8,  8,  32, 32);
195   bg0_tilemap = tilemap_create(robokid_get_bg0_tile_info, omegaf_bg_scan,     16, 16, 128, 32);
196   bg1_tilemap = tilemap_create(robokid_get_bg1_tile_info, omegaf_bg_scan,     16, 16, 128, 32);
197   bg2_tilemap = tilemap_create(robokid_get_bg2_tile_info, omegaf_bg_scan,     16, 16, 128, 32);
186198
187199   tilemap_set_transparent_pen(fg_tilemap,  15);
188200   tilemap_set_transparent_pen(bg0_tilemap, 15);
r1679r1680
194206
195207
196208
209/*************************************
210 *
211 *  Memory handlers
212 *
213 *************************************/
214
197215WRITE8_HANDLER( ninjakd2_bgvideoram_w )
198216{
199217   ninjakd2_bg_videoram[offset] = data;
r1679r1680
310328}
311329
312330
331
332/*************************************
333 *
334 *  Video update
335 *
336 *************************************/
337
313338static void draw_sprites(running_machine* const machine, mame_bitmap* const bitmap, const rectangle* const cliprect)
314339{
315340   const gfx_element* const gfx = machine->gfx[1];
src/mame/video/skydiver.c
r1679r1680
5555
5656VIDEO_START( skydiver )
5757{
58   bg_tilemap = tilemap_create(get_tile_info,tilemap_scan_rows,TILEMAP_TYPE_PEN,8,8,32,32);
58   bg_tilemap = tilemap_create(get_tile_info,tilemap_scan_rows,8,8,32,32);
5959}
6060
6161
src/mame/video/yunsung8.c
r1679r1680
167167VIDEO_START( yunsung8 )
168168{
169169   tilemap_0 = tilemap_create(   get_tile_info_0, tilemap_scan_rows,
170                        TILEMAP_TYPE_PEN, 8,8, DIM_NX_0, DIM_NY_0 );
170                        8,8, DIM_NX_0, DIM_NY_0 );
171171
172172   tilemap_1 = tilemap_create(   get_tile_info_1, tilemap_scan_rows,
173                        TILEMAP_TYPE_PEN, 8,8, DIM_NX_1, DIM_NY_1 );
173                        8,8, DIM_NX_1, DIM_NY_1 );
174174
175175      tilemap_set_transparent_pen(tilemap_1,0);
176176}
src/mame/video/m52.c
r1679r1680
155155
156156VIDEO_START( m52 )
157157{
158   bg_tilemap = tilemap_create(get_tile_info, tilemap_scan_rows, TILEMAP_TYPE_PEN, 8, 8, 32, 32);
158   bg_tilemap = tilemap_create(get_tile_info, tilemap_scan_rows, 8, 8, 32, 32);
159159
160160   tilemap_set_transparent_pen(bg_tilemap, 0);
161161   tilemap_set_scrolldx(bg_tilemap, 128 - 1, -1);
r1679r1680
332332      rect.max_y = ypos + 2 * BGHEIGHT - 1;
333333   }
334334
335   fillbitmap(bitmap, machine->remapped_colortable[machine->gfx[image]->color_base + 3], &rect);
335   fillbitmap(bitmap, machine->pens[machine->gfx[image]->color_base + 3], &rect);
336336}
337337
338338
src/mame/video/warpwarp.c
r1679r1680
181181
182182VIDEO_START( geebee )
183183{
184   bg_tilemap = tilemap_create(geebee_get_tile_info,tilemap_scan,TILEMAP_TYPE_PEN,8,8,34,28);
184   bg_tilemap = tilemap_create(geebee_get_tile_info,tilemap_scan,8,8,34,28);
185185}
186186
187187VIDEO_START( navarone )
188188{
189   bg_tilemap = tilemap_create(navarone_get_tile_info,tilemap_scan,TILEMAP_TYPE_PEN,8,8,34,28);
189   bg_tilemap = tilemap_create(navarone_get_tile_info,tilemap_scan,8,8,34,28);
190190}
191191
192192VIDEO_START( warpwarp )
193193{
194   bg_tilemap = tilemap_create(warpwarp_get_tile_info,tilemap_scan,TILEMAP_TYPE_PEN,8,8,34,28);
194   bg_tilemap = tilemap_create(warpwarp_get_tile_info,tilemap_scan,8,8,34,28);
195195}
196196
197197
src/mame/video/jaguar.c
r1679r1680
291291      return FALSE;
292292
293293   /* adjust the timer */
294   timer_adjust(object_timer, video_screen_get_time_until_pos(0, vc / 2, hdb), vc | (hdb << 16), attotime_never);
294   timer_adjust_oneshot(object_timer, video_screen_get_time_until_pos(0, vc / 2, hdb), vc | (hdb << 16));
295295   return TRUE;
296296}
297297
src/mame/video/jalblend.c
r1679r1680
9191      {
9292         for (xtile = xstart; xtile != xend; xtile += xinc )
9393         {
94            const pen_t *pal = &Machine->remapped_colortable[gfx->color_base + gfx->color_granularity * (color % gfx->total_colors)];
94            const pen_t *pal = &Machine->pens[gfx->color_base + gfx->color_granularity * (color % gfx->total_colors)];
9595            const UINT8 *alpha = &jal_blend_table[gfx->color_granularity * (color % gfx->total_colors)];
9696            int source_base = ((code + code_offset++) % gfx->total_elements) * gfx->height;
9797
src/mame/video/gng.c
r1679r1680
5555
5656VIDEO_START( gng )
5757{
58   fg_tilemap = tilemap_create(get_fg_tile_info,tilemap_scan_rows,TILEMAP_TYPE_PEN,8,8,32,32);
59   bg_tilemap = tilemap_create(get_bg_tile_info,tilemap_scan_cols,TILEMAP_TYPE_PEN,    16,16,32,32);
58   fg_tilemap = tilemap_create(get_fg_tile_info,tilemap_scan_rows,8,8,32,32);
59   bg_tilemap = tilemap_create(get_bg_tile_info,tilemap_scan_cols,    16,16,32,32);
6060
6161   tilemap_set_transparent_pen(fg_tilemap,3);
6262
src/mame/video/ojankohs.c
r1679r1680
279279
280280VIDEO_START( ojankohs )
281281{
282   ojankohs_tilemap = tilemap_create(ojankohs_get_tile_info, tilemap_scan_rows, TILEMAP_TYPE_PEN, 8, 4, 64, 64);
282   ojankohs_tilemap = tilemap_create(ojankohs_get_tile_info, tilemap_scan_rows, 8, 4, 64, 64);
283283   ojankohs_videoram = auto_malloc(0x2000);
284284   ojankohs_colorram = auto_malloc(0x1000);
285285   ojankohs_paletteram = auto_malloc(0x800);
r1679r1680
287287
288288VIDEO_START( ojankoy )
289289{
290   ojankohs_tilemap = tilemap_create(ojankoy_get_tile_info, tilemap_scan_rows, TILEMAP_TYPE_PEN, 8, 4, 64, 64);
290   ojankohs_tilemap = tilemap_create(ojankoy_get_tile_info, tilemap_scan_rows, 8, 4, 64, 64);
291291   ojankohs_videoram = auto_malloc(0x2000);
292292   ojankohs_colorram = auto_malloc(0x1000);
293293   ojankohs_paletteram = auto_malloc(0x800);
src/mame/video/bfm_adr2.c
r1679r1680
209209   state_save_register_item_array("Adder", 0, adder_ram);
210210   state_save_register_item_2d_array("Adder", 0, adder_screen_ram);
211211
212   tilemap0 = tilemap_create(get_tile0_info, tilemap_scan_rows, TILEMAP_TYPE_PEN, 8, 8, 50, 35);
212   tilemap0 = tilemap_create(get_tile0_info, tilemap_scan_rows, 8, 8, 50, 35);
213213
214   tilemap1 = tilemap_create(get_tile1_info, tilemap_scan_rows, TILEMAP_TYPE_PEN, 8, 8, 50, 35);
214   tilemap1 = tilemap_create(get_tile1_info, tilemap_scan_rows, 8, 8, 50, 35);
215215}
216216
217217// video update ///////////////////////////////////////////////////////////
src/mame/video/n8080.c
r1679r1680
6565{
6666   spacefev_red_cannon = 1;
6767
68   timer_adjust(cannon_timer, ATTOTIME_IN_USEC(550 * 68 * 10), 0, attotime_zero);
68   timer_adjust_oneshot(cannon_timer, ATTOTIME_IN_USEC(550 * 68 * 10), 0);
6969}
7070
7171
r1679r1680
7373{
7474   spacefev_red_cannon = 0;
7575
76   timer_adjust(cannon_timer, attotime_never, 0, attotime_never);
76   timer_adjust_oneshot(cannon_timer, attotime_never, 0);
7777}
7878
7979
src/mame/video/wc90b.c
r1679r1680
6262
6363VIDEO_START( wc90b )
6464{
65   bg_tilemap = tilemap_create(get_bg_tile_info,tilemap_scan_rows,TILEMAP_TYPE_PEN,     16,16,64,32);
66   fg_tilemap = tilemap_create(get_fg_tile_info,tilemap_scan_rows,TILEMAP_TYPE_PEN,16,16,64,32);
67   tx_tilemap = tilemap_create(get_tx_tile_info,tilemap_scan_rows,TILEMAP_TYPE_PEN, 8, 8,64,32);
65   bg_tilemap = tilemap_create(get_bg_tile_info,tilemap_scan_rows,     16,16,64,32);
66   fg_tilemap = tilemap_create(get_fg_tile_info,tilemap_scan_rows,16,16,64,32);
67   tx_tilemap = tilemap_create(get_tx_tile_info,tilemap_scan_rows, 8, 8,64,32);
6868
6969   tilemap_set_transparent_pen(fg_tilemap,15);
7070   tilemap_set_transparent_pen(tx_tilemap,15);
src/mame/video/kncljoe.c
r1679r1680
112112
113113VIDEO_START( kncljoe )
114114{
115   bg_tilemap = tilemap_create(get_bg_tile_info,tilemap_scan_rows,TILEMAP_TYPE_PEN,8,8,64,32);
115   bg_tilemap = tilemap_create(get_bg_tile_info,tilemap_scan_rows,8,8,64,32);
116116
117117   tilemap_set_scroll_rows(bg_tilemap,4);
118118
src/mame/video/holeland.c
r1679r1680
5656
5757VIDEO_START( holeland )
5858{
59   bg_tilemap = tilemap_create(holeland_get_tile_info,tilemap_scan_rows,TILEMAP_TYPE_PEN,16,16,32,32);
59   bg_tilemap = tilemap_create(holeland_get_tile_info,tilemap_scan_rows,16,16,32,32);
6060
6161   tilemap_set_transmask(bg_tilemap,0,0xff,0x00); /* split type 0 is totally transparent in front half */
6262   tilemap_set_transmask(bg_tilemap,1,0x01,0xfe); /* split type 1 has pen 0? transparent in front half */
r1679r1680
6464
6565VIDEO_START( crzrally )
6666{
67   bg_tilemap = tilemap_create(crzrally_get_tile_info,tilemap_scan_cols,TILEMAP_TYPE_PEN,8,8,32,32);
67   bg_tilemap = tilemap_create(crzrally_get_tile_info,tilemap_scan_cols,8,8,32,32);
6868}
6969
7070WRITE8_HANDLER( holeland_videoram_w )
src/mame/video/liberate.c
r1679r1680
119119
120120VIDEO_START( prosoccr )
121121{
122   background_tilemap = tilemap_create(get_back_tile_info,back_scan,TILEMAP_TYPE_PEN,16,16,32,32);
123   fix_tilemap = tilemap_create(get_fix_tile_info,fix_scan,TILEMAP_TYPE_PEN,8,8,32,32);
122   background_tilemap = tilemap_create(get_back_tile_info,back_scan,16,16,32,32);
123   fix_tilemap = tilemap_create(get_fix_tile_info,fix_scan,8,8,32,32);
124124
125125   tilemap_set_transparent_pen(fix_tilemap,0);
126126}
127127
128128VIDEO_START( boomrang )
129129{
130   background_tilemap = tilemap_create(get_back_tile_info,back_scan,TILEMAP_TYPE_PEN,16,16,32,32);
131   fix_tilemap = tilemap_create(get_fix_tile_info,fix_scan,TILEMAP_TYPE_PEN,8,8,32,32);
130   background_tilemap = tilemap_create(get_back_tile_info,back_scan,16,16,32,32);
131   fix_tilemap = tilemap_create(get_fix_tile_info,fix_scan,8,8,32,32);
132132
133133   tilemap_set_transmask(background_tilemap,0,0x0001,0x007e); /* Bottom 1 pen/Top 7 pens */
134134   tilemap_set_transparent_pen(fix_tilemap,0);
r1679r1680
136136
137137VIDEO_START( liberate )
138138{
139   background_tilemap = tilemap_create(get_back_tile_info,back_scan,TILEMAP_TYPE_PEN,16,16,32,32);
140   fix_tilemap = tilemap_create(get_fix_tile_info,fix_scan,TILEMAP_TYPE_PEN,8,8,32,32);
139   background_tilemap = tilemap_create(get_back_tile_info,back_scan,16,16,32,32);
140   fix_tilemap = tilemap_create(get_fix_tile_info,fix_scan,8,8,32,32);
141141
142142   tilemap_set_transparent_pen(fix_tilemap,0);
143143}
src/mame/video/spdodgeb.c
r1679r1680
7979
8080VIDEO_START( spdodgeb )
8181{
82   bg_tilemap = tilemap_create(get_bg_tile_info,background_scan,TILEMAP_TYPE_PEN,8,8,64,32);
82   bg_tilemap = tilemap_create(get_bg_tile_info,background_scan,8,8,64,32);
8383}
8484
8585
src/mame/video/gunsmoke.c
r1679r1680
2929{
3030   int i;
3131
32   for (i = 0; i < machine->drv->total_colors; i++)
32   /* allocate the colortable */
33   machine->colortable = colortable_alloc(machine, 0x100);
34
35   /* create a lookup table for the palette */
36   for (i = 0; i < 0x100; i++)
3337   {
34      int bit0, bit1, bit2, bit3, r, g, b;
38      int r = pal4bit(color_prom[i + 0x000]);
39      int g = pal4bit(color_prom[i + 0x100]);
40      int b = pal4bit(color_prom[i + 0x200]);
3541
36      bit0 = (color_prom[0] >> 0) & 0x01;
37      bit1 = (color_prom[0] >> 1) & 0x01;
38      bit2 = (color_prom[0] >> 2) & 0x01;
39      bit3 = (color_prom[0] >> 3) & 0x01;
40
41      r = 0x0e * bit0 + 0x1f * bit1 + 0x43 * bit2 + 0x8f * bit3;
42
43      bit0 = (color_prom[machine->drv->total_colors] >> 0) & 0x01;
44      bit1 = (color_prom[machine->drv->total_colors] >> 1) & 0x01;
45      bit2 = (color_prom[machine->drv->total_colors] >> 2) & 0x01;
46      bit3 = (color_prom[machine->drv->total_colors] >> 3) & 0x01;
47
48      g = 0x0e * bit0 + 0x1f * bit1 + 0x43 * bit2 + 0x8f * bit3;
49
50      bit0 = (color_prom[2*machine->drv->total_colors] >> 0) & 0x01;
51      bit1 = (color_prom[2*machine->drv->total_colors] >> 1) & 0x01;
52      bit2 = (color_prom[2*machine->drv->total_colors] >> 2) & 0x01;
53      bit3 = (color_prom[2*machine->drv->total_colors] >> 3) & 0x01;
54
55      b = 0x0e * bit0 + 0x1f * bit1 + 0x43 * bit2 + 0x8f * bit3;
56
57      palette_set_color(machine, i, MAKE_RGB(r, g, b));
58      color_prom++;
42      colortable_palette_set_color(machine->colortable, i, MAKE_RGB(r, g, b));
5943   }
6044
61   color_prom += 2 * machine->drv->total_colors;
6245   /* color_prom now points to the beginning of the lookup table */
46   color_prom += 0x300;
6347
64   /* characters use colors 64-79 */
65   for (i = 0; i < TOTAL_COLORS(0); i++)
66      COLOR(0, i) = *(color_prom++) + 64;
67   color_prom += 128;   /* skip the bottom half of the PROM - not used */
48   /* characters use colors 0x40-0x4f */
49   for (i = 0; i < 0x80; i++)
50   {
51      UINT8 ctabentry = color_prom[i] | 0x40;
52      colortable_entry_set_value(machine->colortable, i, ctabentry);
53   }
6854
69   /* background tiles use colors 0-63 */
70   for (i = 0; i < TOTAL_COLORS(1); i++)
55   /* background tiles use colors 0-0x3f */
56   for (i = 0x100; i < 0x200; i++)
7157   {
72      COLOR(1, i) = color_prom[0] + 16 * (color_prom[256] & 0x03);
73      color_prom++;
58      UINT8 ctabentry = color_prom[i] | ((color_prom[i + 0x100] & 0x03) << 4);
59      colortable_entry_set_value(machine->colortable, i - 0x80, ctabentry);
7460   }
75   color_prom += TOTAL_COLORS(1);
7661
77   /* sprites use colors 128-255 */
78   for (i = 0; i < TOTAL_COLORS(2); i++)
62   /* sprites use colors 0x80-0xff */
63   for (i = 0x300; i < 0x400; i++)
7964   {
80      COLOR(2, i) = color_prom[0] + 16 * (color_prom[256] & 0x07) + 128;
81      color_prom++;
65      UINT8 ctabentry = color_prom[i] | ((color_prom[i + 0x100] & 0x07) << 4) | 0x80;
66      colortable_entry_set_value(machine->colortable, i - 0x180, ctabentry);
8267   }
83   color_prom += TOTAL_COLORS(2);
8468}
8569
8670WRITE8_HANDLER( gunsmoke_videoram_w )
r1679r1680
144128   int code = videoram[tile_index] + ((attr & 0xe0) << 2);
145129   int color = attr & 0x1f;
146130
131   tileinfo->group = color;
132
147133   SET_TILE_INFO(0, code, color, 0);
148134}
149135
r1679r1680
154140   memory_configure_bank(1, 0, 4, &rombase[0x10000], 0x4000);
155141
156142   /* create tilemaps */
157   bg_tilemap = tilemap_create(get_bg_tile_info, tilemap_scan_cols,
158      TILEMAP_TYPE_PEN, 32, 32, 2048, 8);
143   bg_tilemap = tilemap_create(get_bg_tile_info, tilemap_scan_cols,  32, 32, 2048, 8);
144   fg_tilemap = tilemap_create(get_fg_tile_info, tilemap_scan_rows,  8, 8, 32, 32);
159145
160   fg_tilemap = tilemap_create(get_fg_tile_info, tilemap_scan_rows,
161      TILEMAP_TYPE_COLORTABLE, 8, 8, 32, 32);
146   colortable_configure_tilemap_groups(machine->colortable, fg_tilemap, machine->gfx[0], 0x4f);
162147
163   tilemap_set_transparent_pen(fg_tilemap, 0x4f);
164
165148   /* register for saving */
166149   state_save_register_global(chon);
167150   state_save_register_global(objon);
src/mame/video/cvs.c
r1679r1680
1212#include "cvs.h"
1313
1414
15#define MAX_STARS        250
16#define STARS_COLOR_BASE 16
15#define SPRITE_PEN_BASE      (0x820)
16#define BULLET_STAR_PEN      (0x828)
1717
18#define MAX_STARS           250
19#define STARS_COLOR_BASE    16
1820
19#ifdef LSB_FIRST
20#define BL0 0
21#define BL1 1
22#define BL2 2
23#define BL3 3
24#define WL0 0
25#define WL1 1
26#else
27#define BL0 3
28#define BL1 2
29#define BL2 1
30#define BL3 0
31#define WL0 1
32#define WL1 0
33#endif
3421
22static s2636_t *s2636_0, *s2636_1, *s2636_2;
23static mame_bitmap *background_bitmap;
24mame_bitmap *cvs_collision_background;
25static mame_bitmap *scrolled_collision_background;
3526
27int cvs_collision_register;
28
3629struct star
3730{
3831   int x,y,code;
r1679r1680
4538static UINT8  scroll_reg;
4639static int    stars_scroll;
4740
48static mame_bitmap *background_bitmap;
49mame_bitmap *cvs_collision_bitmap;
50mame_bitmap *cvs_collision_background;
51static mame_bitmap *scrolled_background;
5241
53int cvs_collision_register;
54
55
5642/******************************************************
5743 * Convert Colour prom to format for Mame Colour Map  *
5844 *                                                    *
r1679r1680
6450
6551PALETTE_INIT( cvs )
6652{
67   int attr,col,map;
53   int i, attr;
6854
69   #define COLOR(gfxn,offs) (colortable[machine->drv->gfxdecodeinfo[gfxn].color_codes_start + offs])
55   /* allocate the colortable */
56   machine->colortable = colortable_alloc(machine, 0x10);
7057
71   /* Colour Mapping Prom */
72
73   for(attr = 0;attr < 256; attr++)
58   /* color mapping PROM */
59   for (attr = 0; attr < 0x100; attr++)
7460   {
75      for(col = 0; col < 8; col++)
61      for (i = 0; i < 8; i++)
7662      {
77         map = color_prom[(col * 256) + attr];
63         UINT8 ctabentry = color_prom[(i << 8) | attr] & 0x07;
7864
7965         /* bits 0 and 2 are swapped */
66         ctabentry = BITSWAP8(ctabentry,7,6,5,4,3,0,1,2);
8067
81         COLOR(0,attr*8 + col) = ((map & 1) << 2) + (map & 2) + ((map & 4) >> 2);
68         colortable_entry_set_value(machine->colortable, (attr << 3) | i, ctabentry);
8269      }
8370   }
8471
85   /* Background Collision Map */
86
87   for(map=0;map<8;map++)
72   /* background collision map */
73   for (i = 0; i < 8; i++)
8874   {
89      COLOR(0,2048+map) = (map & 4) >> 2;
90      COLOR(0,2056+map) = (map & 2) >> 1;
91      COLOR(0,2064+map) = ((map & 2) >> 1) || ((map & 4) >> 2);
75      colortable_entry_set_value(machine->colortable, 0x800 + i, 0);
76      colortable_entry_set_value(machine->colortable, 0x808 + i, i & 0x04);
77      colortable_entry_set_value(machine->colortable, 0x810 + i, i & 0x02);
78      colortable_entry_set_value(machine->colortable, 0x818 + i, i & 0x06);
9279   }
9380
94   /* Sprites */
81   /* sprites */
82   for (i = 0; i < 8; i++)
83      colortable_entry_set_value(machine->colortable, SPRITE_PEN_BASE + i, i | 0x08);
9584
96   for(map=0;map<8;map++)
85   /* bullet */
86   colortable_entry_set_value(machine->colortable, BULLET_STAR_PEN, 7);
87}
88
89
90static void set_pens(running_machine *machine)
91{
92   int i;
93
94   for (i = 0; i < 0x10; i++)
9795   {
98      COLOR(1,map*2+0) = 0;
99      COLOR(1,map*2+1) = 8 + map;
100   }
96      int r = pal2bit(~cvs_palette_ram[i] >> 0);
97      int g = pal3bit(~cvs_palette_ram[i] >> 2);
98      int b = pal3bit(~cvs_palette_ram[i] >> 5);
10199
102    /* set the sprite chip offsets */
103   s2636_x_offset = -26;
104   s2636_y_offset = 3;
100      colortable_palette_set_color(machine->colortable, i, MAKE_RGB(r, g, b));
101   }
105102}
106103
107104
105
108106WRITE8_HANDLER( cvs_video_fx_w )
109107{
110108   if (data & 0xce)
r1679r1680
185183      }
186184   }
187185
186   /* configure the S2636 chips */
187   s2636_0 = s2636_config(cvs_s2636_0_ram, machine->screen[0].height, machine->screen[0].width, CVS_S2636_Y_OFFSET, CVS_S2636_X_OFFSET);
188   s2636_1 = s2636_config(cvs_s2636_1_ram, machine->screen[0].height, machine->screen[0].width, CVS_S2636_Y_OFFSET, CVS_S2636_X_OFFSET);
189   s2636_2 = s2636_config(cvs_s2636_2_ram, machine->screen[0].height, machine->screen[0].width, CVS_S2636_Y_OFFSET, CVS_S2636_X_OFFSET);
188190
189   /* create the bitmaps for the S2636 chips */
190   s2636_1_bitmap = auto_bitmap_alloc(machine->screen[0].width, machine->screen[0].height, BITMAP_FORMAT_INDEXED8);
191   s2636_2_bitmap = auto_bitmap_alloc(machine->screen[0].width, machine->screen[0].height, BITMAP_FORMAT_INDEXED8);
192   s2636_3_bitmap = auto_bitmap_alloc(machine->screen[0].width, machine->screen[0].height, BITMAP_FORMAT_INDEXED8);
193
194
195191   /* create helper bitmaps */
196192   background_bitmap = auto_bitmap_alloc(machine->screen[0].width, machine->screen[0].height, machine->screen[0].format);
197   cvs_collision_bitmap = auto_bitmap_alloc(machine->screen[0].width, machine->screen[0].height, BITMAP_FORMAT_INDEXED8);
198   cvs_collision_background = auto_bitmap_alloc(machine->screen[0].width, machine->screen[0].height, BITMAP_FORMAT_INDEXED8);
199   scrolled_background = auto_bitmap_alloc(machine->screen[0].width, machine->screen[0].height, BITMAP_FORMAT_INDEXED8);
193   cvs_collision_background = auto_bitmap_alloc(machine->screen[0].width, machine->screen[0].height, machine->screen[0].format);
194   scrolled_collision_background = auto_bitmap_alloc(machine->screen[0].width, machine->screen[0].height, machine->screen[0].format);
200195}
201196
202197
r1679r1680
215210   offs_t offs;
216211   int scroll[8];
217212   UINT8 character_banking_mode;
213   mame_bitmap *s2636_0_bitmap;
214   mame_bitmap *s2636_1_bitmap;
215   mame_bitmap *s2636_2_bitmap;
218216
217   set_pens(machine);
219218
220   /* set the palette */
221   for (offs = 0; offs < 0x10; offs++)
222   {
223      UINT8 data = cvs_palette_ram[offs];
224
225      palette_set_color_rgb(machine, offs, pal2bit(~data >> 0), pal3bit(~data >> 2), pal3bit(~data >> 5));
226   }
227
228
229219   /* create our background character set, which is a software
230220       selectable mixture of RAM and ROM based tiles */
231221
r1679r1680
239229   for (; code < 0x100; code++)
240230      decodechar(machine->gfx[0], code, cvs_character_ram);
241231
242
243232   /* draw the background */
244233   for (offs = 0; offs < 0x0400; offs++)
245234   {
246      int collision_color = 0;
235      int collision_color = 0x100;
247236
248237      UINT8 code = cvs_video_ram[offs];
249238      UINT8 color = cvs_color_ram[offs];
r1679r1680
259248
260249      /* foreground for collision detection */
261250      if (color & 0x80)
262         collision_color = 258;
251         collision_color = 0x103;
263252      else
264253      {
265         if ((color & 0x03) == 3)
266            collision_color = 256;
267         else if((color & 0x01) == 0)
268            collision_color = 257;
254         if ((color & 0x03) == 0x03)
255            collision_color = 0x101;
256         else if ((color & 0x01) == 0)
257            collision_color = 0x102;
269258      }
270259
271      if (collision_color)
272         drawgfx(cvs_collision_background, machine->gfx[0],
273               code, collision_color,
274               0, 0,
275               x, y,
276               0, TRANSPARENCY_NONE, 0);
260      drawgfx(cvs_collision_background, machine->gfx[0],
261            code, collision_color,
262            0, 0,
263            x, y,
264            0, TRANSPARENCY_NONE, 0);
277265   }
278266
279267
r1679r1680
288276    scroll[6] = 0;
289277    scroll[7] = 0;
290278
291   copyscrollbitmap(bitmap,background_bitmap,0,0,8,scroll,&machine->screen[0].visarea);
292   copyscrollbitmap(scrolled_background,cvs_collision_background,0,0,8,scroll,&machine->screen[0].visarea);
279   copyscrollbitmap(bitmap, background_bitmap, 0, 0, 8, scroll, cliprect);
280   copyscrollbitmap(scrolled_collision_background, cvs_collision_background, 0, 0, 8, scroll, cliprect);
293281
294    /* 2636's */
282    /* update the S2636 chips */
283   s2636_0_bitmap = s2636_update(s2636_0, cliprect);
284   s2636_1_bitmap = s2636_update(s2636_1, cliprect);
285   s2636_2_bitmap = s2636_update(s2636_2, cliprect);
295286
296   fillbitmap(s2636_1_bitmap,0,0);
297   s2636_update_bitmap(machine,s2636_1_bitmap,s2636_1_ram,1,cvs_collision_bitmap);
298
299   fillbitmap(s2636_2_bitmap,0,0);
300   s2636_update_bitmap(machine,s2636_2_bitmap,s2636_2_ram,2,cvs_collision_bitmap);
301
302   fillbitmap(s2636_3_bitmap,0,0);
303   s2636_update_bitmap(machine,s2636_3_bitmap,s2636_3_ram,3,cvs_collision_bitmap);
304
305287    /* Bullet Hardware */
306
307288    for (offs = 8; offs < 256; offs++ )
308289    {
309290        if (cvs_bullet_ram[offs] != 0)
r1679r1680
314295               int bx=255-7-cvs_bullet_ram[offs]-ct;
315296
316297               /* Bullet/Object Collision */
317            if ((*BITMAP_ADDR8(s2636_1_bitmap, offs, bx) != 0) ||
318               (*BITMAP_ADDR8(s2636_2_bitmap, offs, bx) != 0) ||
319               (*BITMAP_ADDR8(s2636_3_bitmap, offs, bx) != 0))
320               cvs_collision_register |= 8;
298            if ((*BITMAP_ADDR8(s2636_0_bitmap, offs, bx) != 0) ||
299               (*BITMAP_ADDR8(s2636_1_bitmap, offs, bx) != 0) ||
300               (*BITMAP_ADDR8(s2636_2_bitmap, offs, bx) != 0))
301               cvs_collision_register |= 0x08;
321302
322303               /* Bullet/Background Collision */
323            if (*BITMAP_ADDR8(scrolled_background, offs, bx) != machine->pens[0])
304            if (colortable_entry_get_value(machine->colortable, *BITMAP_ADDR16(scrolled_collision_background, offs, bx)))
324305                      cvs_collision_register |= 0x80;
325306
326            *BITMAP_ADDR16(bitmap, offs, bx) = machine->pens[7];
307            *BITMAP_ADDR16(bitmap, offs, bx) = machine->pens[BULLET_STAR_PEN];
327308            }
328309        }
329310    }
330311
331   /* Update 2636 images */
332312
313   /* mix and copy the S2636 images into the main bitmap, also check for collision */
333314   {
334      int x;
335      UINT32 S1,S2,S3,SB,pen;
315      int y;
336316
337      for(x=255;x>7;x--)
317      for (y = cliprect->min_y; y <= cliprect->max_y; y++)
338318      {
339         UINT32 *sp1 = (UINT32 *)BITMAP_ADDR8(s2636_1_bitmap, x, 0);
340         UINT32 *sp2 = (UINT32 *)BITMAP_ADDR8(s2636_2_bitmap, x, 0);
341         UINT32 *sp3 = (UINT32 *)BITMAP_ADDR8(s2636_3_bitmap, x, 0);
342         UINT64 *dst = (UINT64 *)BITMAP_ADDR16(bitmap, x, 0);
343         UINT8  *spb = (UINT8  *)BITMAP_ADDR8(scrolled_background, x, 0);
319         int x;
344320
345         for(offs=0;offs<62;offs++)
321         for (x = cliprect->min_x; x <= cliprect->max_x; x++)
346322         {
347            S1 = (*sp1++);
348            S2 = (*sp2++);
349            S3 = (*sp3++);
323            int pixel0 = *BITMAP_ADDR8(s2636_0_bitmap, y, x);
324            int pixel1 = *BITMAP_ADDR8(s2636_1_bitmap, y, x);
325            int pixel2 = *BITMAP_ADDR8(s2636_2_bitmap, y, x);
350326
351            pen = S1 | S2 | S3;
327            int pixel = pixel0 | pixel1 | pixel2;
352328
353            if(pen)
329            if (S2636_IS_PIXEL_DRAWN(pixel))
354330            {
355               UINT16 *address = (UINT16 *)dst;
356               if (pen & 0xff000000) address[BL3] = machine->pens[(pen >> 24) & 15];
357               if (pen & 0x00ff0000) address[BL2] = machine->pens[(pen >> 16) & 15];
358               if (pen & 0x0000ff00) address[BL1] = machine->pens[(pen >>  8) & 15];
359               if (pen & 0x000000ff) address[BL0] = machine->pens[(pen & 15)];
331               *BITMAP_ADDR16(bitmap, y, x) = machine->pens[SPRITE_PEN_BASE + S2636_PIXEL_COLOR(pixel)];
360332
361               /* Collision Detection */
333               /* S2636 vs. S2636 collision detection */
334               if (S2636_IS_PIXEL_DRAWN(pixel0) && S2636_IS_PIXEL_DRAWN(pixel1)) cvs_collision_register |= 0x01;
335               if (S2636_IS_PIXEL_DRAWN(pixel1) && S2636_IS_PIXEL_DRAWN(pixel2)) cvs_collision_register |= 0x02;
336               if (S2636_IS_PIXEL_DRAWN(pixel0) && S2636_IS_PIXEL_DRAWN(pixel2)) cvs_collision_register |= 0x04;
362337
363               SB = 0;
364               if (spb[BL3] != machine->pens[0]) SB =  0x08000000;
365               if (spb[BL2] != machine->pens[0]) SB |= 0x00080000;
366               if (spb[BL1] != machine->pens[0]) SB |= 0x00000800;
367               if (spb[BL0] != machine->pens[0]) SB |= 0x00000008;
368
369               if (S1 & S2) cvs_collision_register |= 1;
370               if (S2 & S3) cvs_collision_register |= 2;
371               if (S1 & S3) cvs_collision_register |= 4;
372
373               if (SB)
338               /* S2636 vs. background collision detection */
339               if (colortable_entry_get_value(machine->colortable, *BITMAP_ADDR16(scrolled_collision_background, y, x)))
374340               {
375                  if (S1 & SB) cvs_collision_register |= 16;
376                  if (S2 & SB) cvs_collision_register |= 32;
377                  if (S3 & SB) cvs_collision_register |= 64;
341                  if (S2636_IS_PIXEL_DRAWN(pixel0)) cvs_collision_register |= 0x10;
342                  if (S2636_IS_PIXEL_DRAWN(pixel1)) cvs_collision_register |= 0x20;
343                  if (S2636_IS_PIXEL_DRAWN(pixel2)) cvs_collision_register |= 0x40;
378344               }
379345            }
380
381            dst++;
382            spb+=4;
383346         }
384347      }
385348   }
r1679r1680
405368               if (flip_screen_y)
406369                  y = ~y;
407370
408               if (*BITMAP_ADDR16(bitmap, y, x) == machine->pens[0])
409               {
410                  *BITMAP_ADDR16(bitmap, y, x) = machine->pens[7];
411               }
371               if (colortable_entry_get_value(machine->colortable, *BITMAP_ADDR16(bitmap, y, x)) == 0)
372                  *BITMAP_ADDR16(bitmap, y, x) = machine->pens[BULLET_STAR_PEN];
412373            }
413374         }
414375      }
415376   }
416377
417
418378   return 0;
419379}
src/mame/video/turbo.c
r1679r1680
179179   turbo_state *state = machine->driver_data;
180180
181181   /* initialize the foreground tilemap */
182   state->fg_tilemap = tilemap_create(get_fg_tile_info, tilemap_scan_rows, TILEMAP_TYPE_PEN, 8,8, 32,32);
182   state->fg_tilemap = tilemap_create(get_fg_tile_info, tilemap_scan_rows, 8,8, 32,32);
183183}
184184
185185
r1679r1680
188188   turbo_state *state = machine->driver_data;
189189
190190   /* initialize the foreground tilemap */
191   state->fg_tilemap = tilemap_create(get_fg_tile_info, tilemap_scan_rows, TILEMAP_TYPE_PEN, 8,8, 32,32);
191   state->fg_tilemap = tilemap_create(get_fg_tile_info, tilemap_scan_rows, 8,8, 32,32);
192192
193193   /* allocate the bitmap RAM */
194194   state->buckrog_bitmap_ram = auto_malloc(0xe000);
src/mame/video/seta.c
r1679r1680
446446
447447   /* layer 0 */
448448   tilemap_0 = tilemap_create(   get_tile_info_0, tilemap_scan_rows,
449                        TILEMAP_TYPE_PEN, 16,16, 64,32 );
449                        16,16, 64,32 );
450450
451451   tilemap_1 = tilemap_create(   get_tile_info_1, tilemap_scan_rows,
452                        TILEMAP_TYPE_PEN, 16,16, 64,32 );
452                        16,16, 64,32 );
453453
454454
455455   /* layer 1 */
456456   tilemap_2 = tilemap_create(   get_tile_info_2, tilemap_scan_rows,
457                        TILEMAP_TYPE_PEN, 16,16, 64,32 );
457                        16,16, 64,32 );
458458
459459   tilemap_3 = tilemap_create(   get_tile_info_3, tilemap_scan_rows,
460                        TILEMAP_TYPE_PEN, 16,16, 64,32 );
460                        16,16, 64,32 );
461461
462462      tilemaps_flip = 0;
463463
r1679r1680
479479
480480   /* layer 0 */
481481   tilemap_0 = tilemap_create(   get_tile_info_0, tilemap_scan_rows,
482                        TILEMAP_TYPE_PEN, 16,16, 64,32 );
482                        16,16, 64,32 );
483483
484484   tilemap_1 = tilemap_create(   get_tile_info_1, tilemap_scan_rows,
485                        TILEMAP_TYPE_PEN, 16,16, 64,32 );
485                        16,16, 64,32 );
486486
487487
488488   /* NO layer 1 */
r1679r1680
505505
506506   /* layer 0 */
507507   tilemap_0 = tilemap_create(   twineagl_get_tile_info_0, tilemap_scan_rows,
508                        TILEMAP_TYPE_PEN, 16,16, 64,32 );
508                        16,16, 64,32 );
509509
510510   tilemap_1 = tilemap_create(   twineagl_get_tile_info_1, tilemap_scan_rows,
511                        TILEMAP_TYPE_PEN, 16,16, 64,32 );
511                        16,16, 64,32 );
512512
513513
514514   /* NO layer 1 */
src/mame/video/tp84.c
r1679r1680
77***************************************************************************/
88
99#include "driver.h"
10#include "video/resnet.h"
1011#include "deprecat.h"
1112
1213UINT8 *tp84_videoram2, *tp84_colorram2;
r1679r1680
5152*/
5253PALETTE_INIT( tp84 )
5354{
55   static const int resistances[4] = { 1000, 470, 220, 100 };
56   double rweights[4], gweights[4], bweights[4];
5457   int i;
55   #define TOTAL_COLORS(gfxn) (machine->gfx[gfxn]->total_colors * machine->gfx[gfxn]->color_granularity)
56   #define COLOR(gfxn,offs) (colortable[machine->drv->gfxdecodeinfo[gfxn].color_codes_start + offs])
5758
59   /* compute the color output resistor weights */
60   compute_resistor_weights(0,   255, -1.0,
61         4, resistances, rweights, 470, 0,
62         4, resistances, gweights, 470, 0,
63         4, resistances, bweights, 470, 0);
5864
59   for (i = 0;i < machine->drv->total_colors;i++)
65   /* allocate the colortable */
66   machine->colortable = colortable_alloc(machine, 0x100);
67
68   /* create a lookup table for the palette */
69   for (i = 0; i < 0x100; i++)
6070   {
61      int bit0,bit1,bit2,bit3,r,g,b;
71      int bit0, bit1, bit2, bit3;
72      int r, g, b;
6273
6374      /* red component */
64      bit0 = (color_prom[0] >> 0) & 0x01;
65      bit1 = (color_prom[0] >> 1) & 0x01;
66      bit2 = (color_prom[0] >> 2) & 0x01;
67      bit3 = (color_prom[0] >> 3) & 0x01;
68      r = 0x0e * bit0 + 0x1f * bit1 + 0x42 * bit2 + 0x90 * bit3;
75      bit0 = (color_prom[i + 0x000] >> 0) & 0x01;
76      bit1 = (color_prom[i + 0x000] >> 1) & 0x01;
77      bit2 = (color_prom[i + 0x000] >> 2) & 0x01;
78      bit3 = (color_prom[i + 0x000] >> 3) & 0x01;
79      r = combine_4_weights(rweights, bit0, bit1, bit2, bit3);
80
6981      /* green component */
70      bit0 = (color_prom[machine->drv->total_colors] >> 0) & 0x01;
71      bit1 = (color_prom[machine->drv->total_colors] >> 1) & 0x01;
72      bit2 = (color_prom[machine->drv->total_colors] >> 2) & 0x01;
73      bit3 = (color_prom[machine->drv->total_colors] >> 3) & 0x01;
74      g = 0x0e * bit0 + 0x1f * bit1 + 0x42 * bit2 + 0x90 * bit3;
82      bit0 = (color_prom[i + 0x100] >> 0) & 0x01;
83      bit1 = (color_prom[i + 0x100] >> 1) & 0x01;
84      bit2 = (color_prom[i + 0x100] >> 2) & 0x01;
85      bit3 = (color_prom[i + 0x100] >> 3) & 0x01;
86      g = combine_4_weights(gweights, bit0, bit1, bit2, bit3);
87
7588      /* blue component */
76      bit0 = (color_prom[2*machine->drv->total_colors] >> 0) & 0x01;
77      bit1 = (color_prom[2*machine->drv->total_colors] >> 1) & 0x01;
78      bit2 = (color_prom[2*machine->drv->total_colors] >> 2) & 0x01;
79      bit3 = (color_prom[2*machine->drv->total_colors] >> 3) & 0x01;
80      b = 0x0e * bit0 + 0x1f * bit1 + 0x42 * bit2 + 0x90 * bit3;
89      bit0 = (color_prom[i + 0x200] >> 0) & 0x01;
90      bit1 = (color_prom[i + 0x200] >> 1) & 0x01;
91      bit2 = (color_prom[i + 0x200] >> 2) & 0x01;
92      bit3 = (color_prom[i + 0x200] >> 3) & 0x01;
93      b = combine_4_weights(bweights, bit0, bit1, bit2, bit3);
8194
82      palette_set_color(machine,i,MAKE_RGB(r,g,b));
83
84      color_prom++;
95      colortable_palette_set_color(machine->colortable, i, MAKE_RGB(r, g, b));
8596   }
8697
87   color_prom += 2*machine->drv->total_colors;
8898   /* color_prom now points to the beginning of the lookup table */
99   color_prom += 0x300;
89100
90
91   /* characters use colors 128-255 */
92   for (i = 0;i < TOTAL_COLORS(0)/8;i++)
101   /* characters use colors 0x80-0xff, sprites use colors 0-0x7f */
102   for (i = 0; i < 0x200; i++)
93103   {
94104      int j;
95105
96
97      for (j = 0;j < 8;j++)
98         COLOR(0,i+256*j) = *color_prom + 128 + 16*j;
99
100      color_prom++;
101   }
102
103   /* sprites use colors 0-127 */
104   for (i = 0;i < TOTAL_COLORS(1)/8;i++)
105   {
106      int j;
107
108
109      for (j = 0;j < 8;j++)
106      for (j = 0; j < 8; j++)
110107      {
111         if (*color_prom) COLOR(1,i+256*j) = *color_prom + 16*j;
112         else COLOR(1,i+256*j) = 0;   /* preserve transparency */
108         UINT8 ctabentry = ((~i & 0x100) >> 1) | (j << 4) | (color_prom[i] & 0x0f);
109         colortable_entry_set_value(machine->colortable, ((i & 0x100) << 3) | (j << 8) | (i & 0xff), ctabentry);
113110      }
114
115      color_prom++;
116111   }
117112}
118113
r1679r1680
204199VIDEO_START( tp84 )
205200{
206201   bg_tilemap = tilemap_create(get_bg_tile_info, tilemap_scan_rows,
207      TILEMAP_TYPE_PEN, 8, 8, 32, 32);
202      8, 8, 32, 32);
208203
209204   fg_tilemap = tilemap_create(get_fg_tile_info, tilemap_scan_rows,
210      TILEMAP_TYPE_PEN, 8, 8, 32, 32);
205      8, 8, 32, 32);
211206
212207   tilemap_set_transparent_pen(fg_tilemap, 0);
213208
r1679r1680
248243                  color,
249244                  flipx,flipy,
250245                  sx,sy,
251                  &clip,TRANSPARENCY_COLOR,0);
246                  &clip,TRANSPARENCY_PENS,
247                  colortable_get_transpen_mask(machine->colortable, gfx, color, coloffset));
252248         }
253249      }
254250   }
src/mame/video/vball.c
r1679r1680
5050
5151VIDEO_START( vb )
5252{
53   bg_tilemap = tilemap_create(get_bg_tile_info,background_scan,TILEMAP_TYPE_PEN, 8, 8,64,64);
53   bg_tilemap = tilemap_create(get_bg_tile_info,background_scan, 8, 8,64,64);
5454
5555   tilemap_set_scroll_rows(bg_tilemap,32);
5656}
src/mame/video/plygonet.c
r1679r1680
7575           machine->gfx[ttl_gfx_index]->total_colors = machine->drv->total_colors / 16;
7676
7777   // create the tilemap
78   ttl_tilemap = tilemap_create(ttl_get_tile_info, tilemap_scan_rows, TILEMAP_TYPE_PEN, 8, 8, 64, 32);
78   ttl_tilemap = tilemap_create(ttl_get_tile_info, tilemap_scan_rows, 8, 8, 64, 32);
7979
8080   tilemap_set_transparent_pen(ttl_tilemap, 0);
8181
src/mame/video/higemaru.c
r1679r1680
2222PALETTE_INIT( higemaru )
2323{
2424   int i;
25   #define TOTAL_COLORS(gfxn) (machine->gfx[gfxn]->total_colors * machine->gfx[gfxn]->color_granularity)
26   #define COLOR(gfxn,offs) (colortable[machine->drv->gfxdecodeinfo[gfxn].color_codes_start + offs])
2725
26   /* allocate the colortable */
27   machine->colortable = colortable_alloc(machine, 0x20);
2828
29   for (i = 0;i < machine->drv->total_colors;i++)
29   /* create a lookup table for the palette */
30   for (i = 0; i < 0x20; i++)
3031   {
31      int bit0,bit1,bit2,r,g,b;
32      int bit0, bit1, bit2;
33      int r, g, b;
3234
3335      /* red component */
34      bit0 = (*color_prom >> 0) & 0x01;
35      bit1 = (*color_prom >> 1) & 0x01;
36      bit2 = (*color_prom >> 2) & 0x01;
36      bit0 = (color_prom[i] >> 0) & 0x01;
37      bit1 = (color_prom[i] >> 1) & 0x01;
38      bit2 = (color_prom[i] >> 2) & 0x01;
3739      r = 0x21 * bit0 + 0x47 * bit1 + 0x97 * bit2;
40
3841      /* green component */
39      bit0 = (*color_prom >> 3) & 0x01;
40      bit1 = (*color_prom >> 4) & 0x01;
41      bit2 = (*color_prom >> 5) & 0x01;
42      bit0 = (color_prom[i] >> 3) & 0x01;
43      bit1 = (color_prom[i] >> 4) & 0x01;
44      bit2 = (color_prom[i] >> 5) & 0x01;
4245      g = 0x21 * bit0 + 0x47 * bit1 + 0x97 * bit2;
46
4347      /* blue component */
4448      bit0 = 0;
45      bit1 = (*color_prom >> 6) & 0x01;
46      bit2 = (*color_prom >> 7) & 0x01;
49      bit1 = (color_prom[i] >> 6) & 0x01;
50      bit2 = (color_prom[i] >> 7) & 0x01;
4751      b = 0x21 * bit0 + 0x47 * bit1 + 0x97 * bit2;
4852
49      palette_set_color(machine,i,MAKE_RGB(r,g,b));
50      color_prom++;
53      colortable_palette_set_color(machine->colortable, i, MAKE_RGB(r, g, b));
5154   }
5255
5356   /* color_prom now points to the beginning of the lookup table */
57   color_prom += 0x20;
5458
5559   /* characters use colors 0-15 */
56   for (i = 0;i < TOTAL_COLORS(0);i++)
57      COLOR(0,i) = *(color_prom++) & 0x0f;
60   for (i = 0; i < 0x80; i++)
61   {
62      UINT8 ctabentry = color_prom[i] & 0x0f;
63      colortable_entry_set_value(machine->colortable, i, ctabentry);
64   }
5865
59   color_prom += 128;   /* the bottom half of the PROM doesn't seem to be used */
60
6166   /* sprites use colors 16-31 */
62   for (i = 0;i < TOTAL_COLORS(1);i++)
63      COLOR(1,i) = (*(color_prom++) & 0x0f) + 0x10;
67   for (i = 0x80; i < 0x180; i++)
68   {
69      UINT8 ctabentry = (color_prom[i + 0x80] & 0x0f) | 0x10;
70      colortable_entry_set_value(machine->colortable, i, ctabentry);
71   }
6472}
6573
6674WRITE8_HANDLER( higemaru_c800_w )
r1679r1680
8997
9098VIDEO_START( higemaru )
9199{
92   bg_tilemap = tilemap_create(get_bg_tile_info, tilemap_scan_rows,
93      TILEMAP_TYPE_PEN, 8, 8, 32, 32);
100   bg_tilemap = tilemap_create(get_bg_tile_info, tilemap_scan_rows, 8, 8, 32, 32);
94101}
95102
96103static void draw_sprites(running_machine *machine, mame_bitmap *bitmap, const rectangle *cliprect)
src/mame/video/batman.c
r1679r1680
106106   };
107107
108108   /* initialize the playfield */
109   atarigen_playfield_tilemap = tilemap_create(get_playfield_tile_info, tilemap_scan_cols, TILEMAP_TYPE_PEN, 8,8, 64,64);
109   atarigen_playfield_tilemap = tilemap_create(get_playfield_tile_info, tilemap_scan_cols, 8,8, 64,64);
110110
111111   /* initialize the second playfield */
112   atarigen_playfield2_tilemap = tilemap_create(get_playfield2_tile_info, tilemap_scan_cols, TILEMAP_TYPE_PEN, 8,8, 64,64);
112   atarigen_playfield2_tilemap = tilemap_create(get_playfield2_tile_info, tilemap_scan_cols, 8,8, 64,64);
113113   tilemap_set_transparent_pen(atarigen_playfield2_tilemap, 0);
114114
115115   /* initialize the motion objects */
116116   atarimo_init(machine, 0, &modesc);
117117
118118   /* initialize the alphanumerics */
119   atarigen_alpha_tilemap = tilemap_create(get_alpha_tile_info, tilemap_scan_rows, TILEMAP_TYPE_PEN, 8,8, 64,32);
119   atarigen_alpha_tilemap = tilemap_create(get_alpha_tile_info, tilemap_scan_rows, 8,8, 64,32);
120120   tilemap_set_transparent_pen(atarigen_alpha_tilemap, 0);
121121}
122122
src/mame/video/nemesis.c
r1679r1680
211211   spriteram_words = spriteram_size / 2;
212212
213213   background = tilemap_create(
214      get_bg_tile_info, tilemap_scan_rows, TILEMAP_TYPE_PEN, 8,8, 64,32 );
214      get_bg_tile_info, tilemap_scan_rows, 8,8, 64,32 );
215215
216216   foreground = tilemap_create(
217      get_fg_tile_info, tilemap_scan_rows, TILEMAP_TYPE_PEN, 8,8, 64,32 );
217      get_fg_tile_info, tilemap_scan_rows, 8,8, 64,32 );
218218
219219   tilemap_set_transparent_pen( background, 0 );
220220   tilemap_set_transparent_pen( foreground, 0 );
src/mame/video/magmax.c
r1679r1680
1111
1212UINT16 *magmax_scroll_x;
1313UINT16 *magmax_scroll_y;
14UINT16 magmax_vreg;
14UINT16 *magmax_vreg;
1515static int flipscreen = 0;
1616
17static UINT32 pens_line_tab[256];
18static UINT32 *prom_tab = NULL;
17static UINT32 *prom_tab;
1918
2019
21static void blit_horiz_pixel_line(mame_bitmap *b,int x,int y,int w, UINT32* pens)
22{
23   UINT16* lineadr = BITMAP_ADDR16(b, y, x);
24   while(w-->0)
25   {
26      *lineadr++ = (UINT16)(*pens);
27      pens++;
28   }
29}
30
31
3220/***************************************************************************
3321
3422  Convert the color PROMs into a more useable format.
r1679r1680
4533PALETTE_INIT( magmax )
4634{
4735   int i;
48   #define TOTAL_COLORS(gfxn) (machine->gfx[gfxn]->total_colors * machine->gfx[gfxn]->color_granularity)
49   #define COLOR(gfxn, offs) (colortable[machine->drv->gfxdecodeinfo[gfxn].color_codes_start + offs])
5036
51   for (i = 0; i < machine->drv->total_colors; i++)
37   /* allocate the colortable */
38   machine->colortable = colortable_alloc(machine, 0x100);
39
40   /* create a lookup table for the palette */
41   for (i = 0; i < 0x100; i++)
5242   {
53      int bit0, bit1, bit2, bit3, r, g, b;
43      int r = pal4bit(color_prom[i + 0x000]);
44      int g = pal4bit(color_prom[i + 0x100]);
45      int b = pal4bit(color_prom[i + 0x200]);
5446
55      bit0 = (color_prom[0] >> 0) & 0x01;
56      bit1 = (color_prom[0] >> 1) & 0x01;
57      bit2 = (color_prom[0] >> 2) & 0x01;
58      bit3 = (color_prom[0] >> 3) & 0x01;
59      r = 0x0e * bit0 + 0x1f * bit1 + 0x43 * bit2 + 0x8f * bit3;
60      bit0 = (color_prom[machine->drv->total_colors] >> 0) & 0x01;
61      bit1 = (color_prom[machine->drv->total_colors] >> 1) & 0x01;
62      bit2 = (color_prom[machine->drv->total_colors] >> 2) & 0x01;
63      bit3 = (color_prom[machine->drv->total_colors] >> 3) & 0x01;
64      g = 0x0e * bit0 + 0x1f * bit1 + 0x43 * bit2 + 0x8f * bit3;
65      bit0 = (color_prom[2*machine->drv->total_colors] >> 0) & 0x01;
66      bit1 = (color_prom[2*machine->drv->total_colors] >> 1) & 0x01;
67      bit2 = (color_prom[2*machine->drv->total_colors] >> 2) & 0x01;
68      bit3 = (color_prom[2*machine->drv->total_colors] >> 3) & 0x01;
69      b = 0x0e * bit0 + 0x1f * bit1 + 0x43 * bit2 + 0x8f * bit3;
70
71      palette_set_color(machine,i,MAKE_RGB(r,g,b));
72      color_prom++;
47      colortable_palette_set_color(machine->colortable, i, MAKE_RGB(r, g, b));
7348   }
7449
75   color_prom += 2*machine->drv->total_colors;
76   /* color_prom now points to the beginning of the lookup tables */
50   /* color_prom now points to the beginning of the lookup table */
51   color_prom += 0x300;
7752
78   /* characters use colors 0-15 */
79   for (i = 0; i < TOTAL_COLORS(0);i++)
80      COLOR(0, i) = i;
53   /* characters use colors 0-0x0f */
54   for (i = 0; i < 0x10; i++)
55      colortable_entry_set_value(machine->colortable, i, i);
8156
82   /*sprites use colors 16-32, color 31 being transparent*/
83   for (i = 0; i < TOTAL_COLORS(1);i++)
57   /*sprites use colors 0x10-0x1f, color 0x1f being transparent*/
58   for (i = 0x10; i < 0x110; i++)
8459   {
85      COLOR(1, i) = *(color_prom++) + 16;
60      UINT8 ctabentry = (color_prom[i - 0x10] & 0x0f) | 0x10;
61      colortable_entry_set_value(machine->colortable, i, ctabentry);
8662   }
8763
64   /* background uses all colors (no lookup table) */
65   for (i = 0x110; i < 0x210; i++)
66      colortable_entry_set_value(machine->colortable, i, i - 0x110);
67
8868}
8969
9070VIDEO_START( magmax )
r1679r1680
9373   UINT8 * prom14D = memory_region(REGION_USER2);
9474
9575   /* Set up save state */
96   state_save_register_global(magmax_vreg);
76   state_save_register_global(flipscreen);
9777
9878   prom_tab = auto_malloc(256 * sizeof(UINT32));
9979
r1679r1680
11494   int offs;
11595
11696   /* bit 2 flip screen */
117   if (flipscreen != (magmax_vreg & 0x04))
118   {
119      flipscreen = magmax_vreg & 0x04;
120   }
97   flipscreen = *magmax_vreg & 0x04;
12198
12299   /* copy the background graphics */
123   if (magmax_vreg & 0x40)      /* background disable */
124   {
100   if (*magmax_vreg & 0x40)      /* background disable */
125101      fillbitmap(bitmap, machine->pens[0], cliprect);
126   }
127102   else
128103   {
129      UINT32 h,v;
104      int v;
130105      UINT8 * rom18B = memory_region(REGION_USER1);
131106      UINT32 scroll_h = (*magmax_scroll_x) & 0x3fff;
132107      UINT32 scroll_v = (*magmax_scroll_y) & 0xff;
r1679r1680
136111
137112      for (v = 2*8; v < 30*8; v++) /*only for visible area*/
138113      {
114         int h;
115         UINT8 line_data[256];
116
139117         UINT32 map_v_scr_100 =   (scroll_v + v) & 0x100;
140118         UINT32 rom18D_addr   =  ((scroll_v + v) & 0xf8)     + (map_v_scr_100<<5);
141119         UINT32 rom15F_addr   = (((scroll_v + v) & 0x07)<<2) + (map_v_scr_100<<5);
142120         UINT32 map_v_scr_1fe_6 =((scroll_v + v) & 0x1fe)<<6;
143121
144         const pen_t *pens = &machine->pens[2*16 + (map_v_scr_100>>1)];
122         const pen_t *pens = &machine->pens[0x110 + 0x20 + (map_v_scr_100>>1)];
145123
146         if (!map_v_scr_100)
124         for (h = 0; h < 0x100; h++)
147125         {
148            /* we are drawing surface */
149            for (h = 0; h < 0x80; h++)
150            {
151               UINT32 graph_data;
152               UINT32 graph_color;
153               UINT32 LS283;
154               UINT32 prom_data;
126            UINT32 graph_data;
127            UINT32 graph_color;
128            UINT32 LS283;
129            UINT32 prom_data;
155130
156               LS283 =   scroll_h + h + rom18B[ map_v_scr_1fe_6 + h ] + 0xff01;
131            LS283 =   scroll_h + h;
157132
158               prom_data = prom_tab[ (LS283 >> 6) & 0xff ];
159
160               rom18D_addr &= 0x20f8;
161               rom18D_addr += (prom_data & 0x1f00) + ((LS283 & 0x38) >>3);
162
163               rom15F_addr &= 0x201c;
164               rom15F_addr += (rom18B[0x4000 + rom18D_addr ]<<5) + ((LS283 & 0x6)>>1);
165               rom15F_addr += (prom_data & 0x4000);
166
167               graph_color = (prom_data & 0x0070);
168
169               graph_data = rom18B[0x8000 + rom15F_addr];
170               if ((LS283 & 1))
171                  graph_data >>= 4;
172               graph_data &= 0x0f;
173
174               pens_line_tab[h] = pens[graph_color + graph_data];
175
176               /*priority: background over sprites*/
177               /* not possible on the surface*/
178               //if ((map_v_scr_100) && ((graph_data & 0x0c)==0x0c))
179               //{
180               //  *BITMAP_ADDR16(tmpbitmap, v, h) = pens[graph_color + graph_data];
181               //}
182            }
183            for (h = 0x80; h < 0x100; h++)
133            if (!map_v_scr_100)
184134            {
185               UINT32 graph_data;
186               UINT32 graph_color;
187               UINT32 LS283;
188               UINT32 prom_data;
189
190               LS283 =   scroll_h + h + (rom18B[ (map_v_scr_1fe_6) + (h ^ 0xff) ] ^ 0xff);
191
192               prom_data = prom_tab[ (LS283 >> 6) & 0xff ];
193
194               rom18D_addr &= 0x20f8;
195               rom18D_addr += (prom_data & 0x1f00) + ((LS283 & 0x38) >>3);
196
197               rom15F_addr &= 0x201c;
198               rom15F_addr += (rom18B[0x4000 + rom18D_addr ]<<5) + ((LS283 & 0x6)>>1);
199               rom15F_addr += (prom_data & 0x4000);
200
201               graph_color = (prom_data & 0x0070);
202
203               graph_data = rom18B[0x8000 + rom15F_addr];
204               if ((LS283 & 1))
205                  graph_data >>= 4;
206               graph_data &= 0x0f;
207
208               pens_line_tab[h] = pens[graph_color + graph_data];
209
210               /*priority: background over sprites*/
211               /* not possible on the surface*/
212               //if ((map_v_scr_100) && ((graph_data & 0x0c)==0x0c))
213               //{
214               //  *BITMAP_ADDR16(tmpbitmap, v, h) = pens[graph_color + graph_data];
215               //}
135               if (h & 0x80)
136                  LS283 =   LS283 + (rom18B[ map_v_scr_1fe_6 + (h ^ 0xff) ] ^ 0xff);
137               else
138                  LS283 =   LS283 + rom18B[ map_v_scr_1fe_6 + h ] + 0xff01;
216139            }
217         }
218         else
219         {
220            /* we are drawing underground */
221            for (h = 0; h < 0x80; h++)
222            {
223               UINT32 graph_data;
224               UINT32 graph_color;
225               UINT32 LS283;
226               UINT32 prom_data;
227140
228               LS283 =   scroll_h + h;
141            prom_data = prom_tab[ (LS283 >> 6) & 0xff ];
229142
230               prom_data = prom_tab[ (LS283 >> 6) & 0xff ];
143            rom18D_addr &= 0x20f8;
144            rom18D_addr += (prom_data & 0x1f00) + ((LS283 & 0x38) >>3);
231145
232               rom18D_addr &= 0x20f8;
233               rom18D_addr += (prom_data & 0x1f00) + ((LS283 & 0x38) >>3);
146            rom15F_addr &= 0x201c;
147            rom15F_addr += (rom18B[0x4000 + rom18D_addr ]<<5) + ((LS283 & 0x6)>>1);
148            rom15F_addr += (prom_data & 0x4000);
234149
235               rom15F_addr &= 0x201c;
236               rom15F_addr += (rom18B[0x4000 + rom18D_addr ]<<5) + ((LS283 & 0x6)>>1);
237               rom15F_addr += (prom_data & 0x4000);
150            graph_color = (prom_data & 0x0070);
238151
239               graph_color = (prom_data & 0x0070);
152            graph_data = rom18B[0x8000 + rom15F_addr];
153            if ((LS283 & 1))
154               graph_data >>= 4;
155            graph_data &= 0x0f;
240156
241               graph_data = rom18B[0x8000 + rom15F_addr];
242               if ((LS283 & 1))
243                  graph_data >>= 4;
244               graph_data &= 0x0f;
157            line_data[h] = graph_color + graph_data;
245158
246               pens_line_tab[h] = pens[graph_color + graph_data];
247
248               /*priority: background over sprites*/
249               if (/*(map_v_scr_100) &&*/ ((graph_data & 0x0c)==0x0c))
250               {
251                  *BITMAP_ADDR16(tmpbitmap, v, h) = pens[graph_color + graph_data];
252               }
253            }
254            for (h = 0x80; h < 0x100; h++)
255            {
256               UINT32 graph_data;
257               UINT32 graph_color;
258               UINT32 LS283;
259               UINT32 prom_data;
260
261               LS283 =   scroll_h + h;
262
263               prom_data = prom_tab[ (LS283 >> 6) & 0xff ];
264
265               rom18D_addr &= 0x20f8;
266               rom18D_addr += (prom_data & 0x1f00) + ((LS283 & 0x38) >>3);
267
268               rom15F_addr &= 0x201c;
269               rom15F_addr += (rom18B[0x4000 + rom18D_addr ]<<5) + ((LS283 & 0x6)>>1);
270               rom15F_addr += (prom_data & 0x4000);
271
272               graph_color = (prom_data & 0x0070);
273
274               graph_data = rom18B[0x8000 + rom15F_addr];
275               if ((LS283 & 1))
276                  graph_data >>= 4;
277               graph_data &= 0x0f;
278
279               pens_line_tab[h] = pens[graph_color + graph_data];
280
281               /*priority: background over sprites*/
282               if (/*(map_v_scr_100) &&*/ ((graph_data & 0x0c)==0x0c))
283               {
284                  *BITMAP_ADDR16(tmpbitmap, v, h) = pens[graph_color + graph_data];
285               }
286            }
159            /*priority: background over sprites*/
160            if (map_v_scr_100 && ((graph_data & 0x0c)==0x0c))
161               *BITMAP_ADDR16(tmpbitmap, v, h) = pens[graph_color + graph_data];
287162         }
288163
289164         if (flipscreen)
290165         {
291166            int i;
292            UINT32 pens_line_tab_flipped[256];
167            UINT8 line_data_flip_x[256];
293168            for (i=0; i<256; i++)
294               pens_line_tab_flipped[i] = pens_line_tab[255-i];
295            blit_horiz_pixel_line(bitmap,0,255-v,256,pens_line_tab_flipped);
169               line_data_flip_x[i] = line_data[255-i];
170            draw_scanline8(bitmap, 0, 255-v, 256, line_data_flip_x, pens, -1);
296171         }
297172         else
298            blit_horiz_pixel_line(bitmap,0,    v,256,pens_line_tab);
173            draw_scanline8(bitmap, 0, v, 256, line_data, pens, -1);
299174      }
300175   }
301176
r1679r1680
305180      int sx, sy;
306181
307182      sy = spriteram16[offs] & 0xff;
183
308184      if (sy)
309185      {
310186         int code = spriteram16[offs + 1] & 0xff;
r1679r1680
325201         }
326202
327203         if (code & 0x80)   /* sprite bankswitch */
328         {
329            code += (magmax_vreg & 0x30) * 0x8;
330         }
204            code += (*magmax_vreg & 0x30) * 0x8;
331205
332206         drawgfx(bitmap, machine->gfx[1],
333207               code,
334208               color,
335209               flipx, flipy,
336210               sx, sy,
337               cliprect, TRANSPARENCY_COLOR, 31);
211               cliprect, TRANSPARENCY_PENS,
212               colortable_get_transpen_mask(machine->colortable, machine->gfx[1], color, 0x1f));
338213      }
339214   }
340215
341   if (!(magmax_vreg & 0x40))      /* background disable */
216   if (!(*magmax_vreg & 0x40))      /* background disable */
342217      copybitmap_trans(bitmap, tmpbitmap, flipscreen,flipscreen,0,0, cliprect, 0);
343218
344
345219   /* draw the foreground characters */
346220   for (offs = 32*32-1; offs >= 0; offs -= 1)
347221   {
348      //int page = (magmax_vreg>>3) & 0x1;
222      //int page = (*magmax_vreg>>3) & 0x1;
349223      int code;
350224
351225      code = videoram16[offs /*+ page*/] & 0xff;
r1679r1680
365239               0,
366240               flipscreen, flipscreen,
367241               8 * sx, 8 * sy,
368               cliprect, TRANSPARENCY_PEN, 15);
242               cliprect, TRANSPARENCY_PEN, 0x0f);
369243      }
370244   }
371245   return 0;
src/mame/video/timelimt.c
r1679r1680
7373VIDEO_START( timelimt )
7474{
7575   bg_tilemap = tilemap_create(get_bg_tile_info, tilemap_scan_rows,
76      TILEMAP_TYPE_PEN, 8, 8, 64, 32);
76      8, 8, 64, 32);
7777
7878   fg_tilemap = tilemap_create(get_fg_tile_info, tilemap_scan_rows,
79      TILEMAP_TYPE_PEN, 8, 8, 32, 32);
79      8, 8, 32, 32);
8080
8181   tilemap_set_transparent_pen(fg_tilemap, 0);
8282}
src/mame/video/deco16ic.c
r1679r1680
520520{
521521   sprite_priority_bitmap = auto_bitmap_alloc( Machine->screen[0].width, Machine->screen[0].height, BITMAP_FORMAT_INDEXED8 );
522522
523   pf1_tilemap_16x16 =   tilemap_create(get_pf1_tile_info,   deco16_scan_rows, TILEMAP_TYPE_PEN,16,16,64,32);
524   pf1_tilemap_8x8 =   tilemap_create(get_pf1_tile_info_b, tilemap_scan_rows,TILEMAP_TYPE_PEN,8,8,64,32);
523   pf1_tilemap_16x16 =   tilemap_create(get_pf1_tile_info,   deco16_scan_rows, 16,16,64,32);
524   pf1_tilemap_8x8 =   tilemap_create(get_pf1_tile_info_b, tilemap_scan_rows,8,8,64,32);
525525
526526   if (split)
527      pf2_tilemap_16x16 =   tilemap_create(get_pf2_tile_info,   deco16_scan_rows, TILEMAP_TYPE_PEN,16,16,full_width ? 64 : 32,32);
527      pf2_tilemap_16x16 =   tilemap_create(get_pf2_tile_info,   deco16_scan_rows, 16,16,full_width ? 64 : 32,32);
528528   else
529      pf2_tilemap_16x16 =   tilemap_create(get_pf2_tile_info,   deco16_scan_rows, TILEMAP_TYPE_PEN,16,16,full_width ? 64 : 32,32);
530   pf2_tilemap_8x8 =   tilemap_create(get_pf2_tile_info_b, tilemap_scan_rows,TILEMAP_TYPE_PEN,8,8,full_width ? 64 : 32,32);
529      pf2_tilemap_16x16 =   tilemap_create(get_pf2_tile_info,   deco16_scan_rows, 16,16,full_width ? 64 : 32,32);
530   pf2_tilemap_8x8 =   tilemap_create(get_pf2_tile_info_b, tilemap_scan_rows,8,8,full_width ? 64 : 32,32);
531531
532532   dirty_palette = auto_malloc(4096);
533533   deco16_raster_display_list=auto_malloc(20 * 256);
534534
535535   if (!pf12_only)
536536   {
537      pf4_tilemap_16x16 =   tilemap_create(get_pf4_tile_info,   deco16_scan_rows, TILEMAP_TYPE_PEN,16,16,full_width ? 64 : 32,32);
538      pf3_tilemap_16x16 =   tilemap_create(get_pf3_tile_info,   deco16_scan_rows, TILEMAP_TYPE_PEN,16,16,full_width ? 64 : 32,32);
537      pf4_tilemap_16x16 =   tilemap_create(get_pf4_tile_info,   deco16_scan_rows, 16,16,full_width ? 64 : 32,32);
538      pf3_tilemap_16x16 =   tilemap_create(get_pf3_tile_info,   deco16_scan_rows, 16,16,full_width ? 64 : 32,32);
539539   }
540540   else
541541   {
r1679r1680
838838   int ox,oy,cx,cy;
839839   int x_index,y_index,x,y;
840840
841   const pen_t *pal = &Machine->remapped_colortable[gfx->color_base + gfx->color_granularity * (color % gfx->total_colors)];
841   const pen_t *pal = &Machine->pens[gfx->color_base + gfx->color_granularity * (color % gfx->total_colors)];
842842   int source_base = (code % gfx->total_elements) * gfx->height;
843843
844844   /* check bounds */
src/mame/video/goal92.c
r1679r1680
135135
136136VIDEO_START( goal92 )
137137{
138   background_layer = tilemap_create(get_back_tile_info,tilemap_scan_rows,TILEMAP_TYPE_PEN,16,16,32,32);
139   foreground_layer = tilemap_create(get_fore_tile_info,tilemap_scan_rows,TILEMAP_TYPE_PEN,16,16,32,32);
140   text_layer       = tilemap_create(get_text_tile_info,tilemap_scan_rows,TILEMAP_TYPE_PEN,  8,8,64,32);
138   background_layer = tilemap_create(get_back_tile_info,tilemap_scan_rows,16,16,32,32);
139   foreground_layer = tilemap_create(get_fore_tile_info,tilemap_scan_rows,16,16,32,32);
140   text_layer       = tilemap_create(get_text_tile_info,tilemap_scan_rows,  8,8,64,32);
141141
142142   buffered_spriteram16 = auto_malloc(0x400*2);
143143
src/mame/video/1942.c
r1679r1680
132132***************************************************************************/
133133VIDEO_START( 1942 )
134134{
135   fg_tilemap = tilemap_create(get_fg_tile_info,tilemap_scan_rows,TILEMAP_TYPE_PEN, 8, 8,32,32);
136   bg_tilemap = tilemap_create(get_bg_tile_info,tilemap_scan_cols,TILEMAP_TYPE_PEN,     16,16,32,16);
135   fg_tilemap = tilemap_create(get_fg_tile_info,tilemap_scan_rows, 8, 8,32,32);
136   bg_tilemap = tilemap_create(get_bg_tile_info,tilemap_scan_cols,     16,16,32,16);
137137
138138   tilemap_set_transparent_pen(fg_tilemap,0);
139139
src/mame/video/poolshrk.c
r1679r1680
2323VIDEO_START( poolshrk )
2424{
2525   bg_tilemap = tilemap_create(get_tile_info, tilemap_scan_rows,
26      TILEMAP_TYPE_PEN, 8, 8, 32, 32);
26      8, 8, 32, 32);
2727
2828   tilemap_set_transparent_pen(bg_tilemap, 0);
2929}
src/mame/video/mayumi.c
r1679r1680
2424{
2525   mayumi_videoram = auto_malloc(0x1800);
2626
27   mayumi_tilemap = tilemap_create( get_tile_info,tilemap_scan_rows,TILEMAP_TYPE_PEN,8,8,64,32 );
27   mayumi_tilemap = tilemap_create( get_tile_info,tilemap_scan_rows,8,8,64,32 );
2828}
2929
3030WRITE8_HANDLER( mayumi_videoram_w )
src/mame/video/raiden.c
r1679r1680
6969
7070VIDEO_START( raiden )
7171{
72   bg_layer = tilemap_create(get_back_tile_info,tilemap_scan_cols,TILEMAP_TYPE_PEN,     16,16,32,32);
73   fg_layer = tilemap_create(get_fore_tile_info,tilemap_scan_cols,TILEMAP_TYPE_PEN,16,16,32,32);
74   tx_layer = tilemap_create(get_text_tile_info,tilemap_scan_cols,TILEMAP_TYPE_PEN,8,8,32,32);
72   bg_layer = tilemap_create(get_back_tile_info,tilemap_scan_cols,     16,16,32,32);
73   fg_layer = tilemap_create(get_fore_tile_info,tilemap_scan_cols,16,16,32,32);
74   tx_layer = tilemap_create(get_text_tile_info,tilemap_scan_cols,8,8,32,32);
7575   alternate=0;
7676
7777   tilemap_set_transparent_pen(fg_layer,15);
r1679r1680
8080
8181VIDEO_START( raidena )
8282{
83   bg_layer = tilemap_create(get_back_tile_info,tilemap_scan_cols,TILEMAP_TYPE_PEN,     16,16,32,32);
84   fg_layer = tilemap_create(get_fore_tile_info,tilemap_scan_cols,TILEMAP_TYPE_PEN,16,16,32,32);
85   tx_layer = tilemap_create(get_text_tile_info,tilemap_scan_rows,TILEMAP_TYPE_PEN,8,8,32,32);
83   bg_layer = tilemap_create(get_back_tile_info,tilemap_scan_cols,     16,16,32,32);
84   fg_layer = tilemap_create(get_fore_tile_info,tilemap_scan_cols,16,16,32,32);
85   tx_layer = tilemap_create(get_text_tile_info,tilemap_scan_rows,8,8,32,32);
8686   alternate=1;
8787
8888   tilemap_set_transparent_pen(fg_layer,15);
src/mame/video/bloodbro.c
r1679r1680
5959
6060VIDEO_START( bloodbro )
6161{
62   bg_tilemap = tilemap_create(get_bg_tile_info,tilemap_scan_rows,TILEMAP_TYPE_PEN,     16,16,32,16);
63   fg_tilemap = tilemap_create(get_fg_tile_info,tilemap_scan_rows,TILEMAP_TYPE_PEN,16,16,32,16);
64   tx_tilemap = tilemap_create(get_tx_tile_info,tilemap_scan_rows,TILEMAP_TYPE_PEN, 8, 8,32,32);
62   bg_tilemap = tilemap_create(get_bg_tile_info,tilemap_scan_rows,     16,16,32,16);
63   fg_tilemap = tilemap_create(get_fg_tile_info,tilemap_scan_rows,16,16,32,16);
64   tx_tilemap = tilemap_create(get_tx_tile_info,tilemap_scan_rows, 8, 8,32,32);
6565
6666   tilemap_set_transparent_pen(fg_tilemap,15);
6767   tilemap_set_transparent_pen(tx_tilemap,15);
src/mame/video/fromanc2.c
r1679r1680
371371
372372VIDEO_START( fromanc2 )
373373{
374   fromanc2_tilemap[0][0] = tilemap_create(fromanc2_get_v0_l0_tile_info, tilemap_scan_rows, TILEMAP_TYPE_PEN,      8, 8, 64, 64);
375   fromanc2_tilemap[0][1] = tilemap_create(fromanc2_get_v0_l1_tile_info, tilemap_scan_rows, TILEMAP_TYPE_PEN, 8, 8, 64, 64);
376   fromanc2_tilemap[0][2] = tilemap_create(fromanc2_get_v0_l2_tile_info, tilemap_scan_rows, TILEMAP_TYPE_PEN, 8, 8, 64, 64);
377   fromanc2_tilemap[0][3] = tilemap_create(fromanc2_get_v0_l3_tile_info, tilemap_scan_rows, TILEMAP_TYPE_PEN, 8, 8, 64, 64);
378   fromanc2_tilemap[1][0] = tilemap_create(fromanc2_get_v1_l0_tile_info, tilemap_scan_rows, TILEMAP_TYPE_PEN,      8, 8, 64, 64);
379   fromanc2_tilemap[1][1] = tilemap_create(fromanc2_get_v1_l1_tile_info, tilemap_scan_rows, TILEMAP_TYPE_PEN, 8, 8, 64, 64);
380   fromanc2_tilemap[1][2] = tilemap_create(fromanc2_get_v1_l2_tile_info, tilemap_scan_rows, TILEMAP_TYPE_PEN, 8, 8, 64, 64);
381   fromanc2_tilemap[1][3] = tilemap_create(fromanc2_get_v1_l3_tile_info, tilemap_scan_rows, TILEMAP_TYPE_PEN, 8, 8, 64, 64);
374   fromanc2_tilemap[0][0] = tilemap_create(fromanc2_get_v0_l0_tile_info, tilemap_scan_rows,       8, 8, 64, 64);
375   fromanc2_tilemap[0][1] = tilemap_create(fromanc2_get_v0_l1_tile_info, tilemap_scan_rows,  8, 8, 64, 64);
376   fromanc2_tilemap[0][2] = tilemap_create(fromanc2_get_v0_l2_tile_info, tilemap_scan_rows,  8, 8, 64, 64);
377   fromanc2_tilemap[0][3] = tilemap_create(fromanc2_get_v0_l3_tile_info, tilemap_scan_rows,  8, 8, 64, 64);
378   fromanc2_tilemap[1][0] = tilemap_create(fromanc2_get_v1_l0_tile_info, tilemap_scan_rows,       8, 8, 64, 64);
379   fromanc2_tilemap[1][1] = tilemap_create(fromanc2_get_v1_l1_tile_info, tilemap_scan_rows,  8, 8, 64, 64);
380   fromanc2_tilemap[1][2] = tilemap_create(fromanc2_get_v1_l2_tile_info, tilemap_scan_rows,  8, 8, 64, 64);
381   fromanc2_tilemap[1][3] = tilemap_create(fromanc2_get_v1_l3_tile_info, tilemap_scan_rows,  8, 8, 64, 64);
382382
383383   fromanc2_videoram[0][0] = auto_malloc((64 * 64) * sizeof(UINT16));
384384   fromanc2_videoram[0][1] = auto_malloc((64 * 64) * sizeof(UINT16));
r1679r1680
402402
403403VIDEO_START( fromancr )
404404{
405   fromanc2_tilemap[0][0] = tilemap_create(fromancr_get_v0_l0_tile_info, tilemap_scan_rows, TILEMAP_TYPE_PEN,      8, 8, 64, 64);
406   fromanc2_tilemap[0][1] = tilemap_create(fromancr_get_v0_l1_tile_info, tilemap_scan_rows, TILEMAP_TYPE_PEN, 8, 8, 64, 64);
407   fromanc2_tilemap[0][2] = tilemap_create(fromancr_get_v0_l2_tile_info, tilemap_scan_rows, TILEMAP_TYPE_PEN, 8, 8, 64, 64);
405   fromanc2_tilemap[0][0] = tilemap_create(fromancr_get_v0_l0_tile_info, tilemap_scan_rows,       8, 8, 64, 64);
406   fromanc2_tilemap[0][1] = tilemap_create(fromancr_get_v0_l1_tile_info, tilemap_scan_rows,  8, 8, 64, 64);
407   fromanc2_tilemap[0][2] = tilemap_create(fromancr_get_v0_l2_tile_info, tilemap_scan_rows,  8, 8, 64, 64);
408408   fromanc2_tilemap[0][3] = 0;
409   fromanc2_tilemap[1][0] = tilemap_create(fromancr_get_v1_l0_tile_info, tilemap_scan_rows, TILEMAP_TYPE_PEN,      8, 8, 64, 64);
410   fromanc2_tilemap[1][1] = tilemap_create(fromancr_get_v1_l1_tile_info, tilemap_scan_rows, TILEMAP_TYPE_PEN, 8, 8, 64, 64);
411   fromanc2_tilemap[1][2] = tilemap_create(fromancr_get_v1_l2_tile_info, tilemap_scan_rows, TILEMAP_TYPE_PEN, 8, 8, 64, 64);
409   fromanc2_tilemap[1][0] = tilemap_create(fromancr_get_v1_l0_tile_info, tilemap_scan_rows,       8, 8, 64, 64);
410   fromanc2_tilemap[1][1] = tilemap_create(fromancr_get_v1_l1_tile_info, tilemap_scan_rows,  8, 8, 64, 64);
411   fromanc2_tilemap[1][2] = tilemap_create(fromancr_get_v1_l2_tile_info, tilemap_scan_rows,  8, 8, 64, 64);
412412   fromanc2_tilemap[1][3] = 0;
413413
414414   fromanc2_videoram[0][0] = auto_malloc((64 * 64) * sizeof(UINT16));
r1679r1680
430430
431431VIDEO_START( fromanc4 )
432432{
433   fromanc2_tilemap[0][0] = tilemap_create(fromancr_get_v0_l0_tile_info, tilemap_scan_rows, TILEMAP_TYPE_PEN,      8, 8, 256, 64);
434   fromanc2_tilemap[0][1] = tilemap_create(fromancr_get_v0_l1_tile_info, tilemap_scan_rows, TILEMAP_TYPE_PEN, 8, 8, 256, 64);
435   fromanc2_tilemap[0][2] = tilemap_create(fromancr_get_v0_l2_tile_info, tilemap_scan_rows, TILEMAP_TYPE_PEN, 8, 8, 256, 64);
433   fromanc2_tilemap[0][0] = tilemap_create(fromancr_get_v0_l0_tile_info, tilemap_scan_rows,       8, 8, 256, 64);
434   fromanc2_tilemap[0][1] = tilemap_create(fromancr_get_v0_l1_tile_info, tilemap_scan_rows,  8, 8, 256, 64);
435   fromanc2_tilemap[0][2] = tilemap_create(fromancr_get_v0_l2_tile_info, tilemap_scan_rows,  8, 8, 256, 64);
436436   fromanc2_tilemap[0][3] = 0;
437   fromanc2_tilemap[1][0] = tilemap_create(fromancr_get_v1_l0_tile_info, tilemap_scan_rows, TILEMAP_TYPE_PEN,      8, 8, 256, 64);
438   fromanc2_tilemap[1][1] = tilemap_create(fromancr_get_v1_l1_tile_info, tilemap_scan_rows, TILEMAP_TYPE_PEN, 8, 8, 256, 64);
439   fromanc2_tilemap[1][2] = tilemap_create(fromancr_get_v1_l2_tile_info, tilemap_scan_rows, TILEMAP_TYPE_PEN, 8, 8, 256, 64);
437   fromanc2_tilemap[1][0] = tilemap_create(fromancr_get_v1_l0_tile_info, tilemap_scan_rows,       8, 8, 256, 64);
438   fromanc2_tilemap[1][1] = tilemap_create(fromancr_get_v1_l1_tile_info, tilemap_scan_rows,  8, 8, 256, 64);
439   fromanc2_tilemap[1][2] = tilemap_create(fromancr_get_v1_l2_tile_info, tilemap_scan_rows,  8, 8, 256, 64);
440440   fromanc2_tilemap[1][3] = 0;
441441
442442   fromanc2_videoram[0][0] = auto_malloc((256 * 64) * sizeof(UINT16));
src/mame/video/bombjack.c
r1679r1680
6666VIDEO_START( bombjack )
6767{
6868   bg_tilemap = tilemap_create(get_bg_tile_info, tilemap_scan_rows,
69      TILEMAP_TYPE_PEN, 16, 16, 16, 16);
69      16, 16, 16, 16);
7070
7171   fg_tilemap = tilemap_create(get_fg_tile_info, tilemap_scan_rows,
72      TILEMAP_TYPE_PEN, 8, 8, 32, 32);
72      8, 8, 32, 32);
7373
7474   tilemap_set_transparent_pen(fg_tilemap, 0);
7575
src/mame/video/rallyx.c
r1679r1680
2828***************************************************************************/
2929
3030#include "driver.h"
31#include "video/resnet.h"
3132
3233
3334
3435UINT8 *rallyx_videoram,*rallyx_radarattr;
3536
3637static UINT8 *rallyx_radarx,*rallyx_radary;
37static int video_type, spriteram_base;
38static int spriteram_base;
3839
3940static tilemap *bg_tilemap,*fg_tilemap;
4041
4142#define MAX_STARS 1000
42#define STARS_COLOR_BASE 32
43#define STARS_COLOR_BASE   (0x104)
4344
4445static int stars_enable;
4546
r1679r1680
5152static int total_stars;
5253
5354
54enum
55{
56   TYPE_RALLYX,
57   TYPE_JUNGLER,
58   TYPE_TACTCIAN,
59   TYPE_LOCOMOTN,
60   TYPE_COMMSEGA
61};
62
63
64DRIVER_INIT( rallyx )
65{
66   video_type = TYPE_RALLYX;
67}
68
69DRIVER_INIT( jungler )
70{
71   video_type = TYPE_JUNGLER;
72}
73
74DRIVER_INIT( tactcian )
75{
76   video_type = TYPE_TACTCIAN;
77}
78
79DRIVER_INIT( locomotn )
80{
81   video_type = TYPE_LOCOMOTN;
82}
83
84DRIVER_INIT( commsega )
85{
86   video_type = TYPE_COMMSEGA;
87}
88
89
90
9155/***************************************************************************
9256
9357  Convert the color PROMs.
r1679r1680
11074***************************************************************************/
11175PALETTE_INIT( rallyx )
11276{
77   static const int resistances_rg[3] = { 1000, 470, 220 };
78   static const int resistances_b [2] = { 470, 220 };
79   double rweights[3], gweights[3], bweights[2];
11380   int i;
114   #define TOTAL_COLORS(gfxn) (machine->gfx[gfxn]->total_colors * machine->gfx[gfxn]->color_granularity)
115   #define COLOR(gfxn,offs) (colortable[machine->drv->gfxdecodeinfo[gfxn].color_codes_start + offs])
11681
82   /* compute the color output resistor weights */
83   compute_resistor_weights(0,   255, -1.0,
84         3, &resistances_rg[0], rweights,    0, 0,
85         3, &resistances_rg[0], gweights,    0, 0,
86         2, &resistances_b[0],  bweights, 1000, 0);
11787
118   for (i = 0;i < 32;i++)
88   /* allocate the colortable */
89   machine->colortable = colortable_alloc(machine, 0x20);
90
91   /* create a lookup table for the palette */
92   for (i = 0; i < 0x20; i++)
11993   {
120      int bit0,bit1,bit2,r,g,b;
94      int bit0, bit1, bit2;
95      int r, g, b;
12196
97      /* red component */
98      bit0 = (color_prom[i] >> 0) & 0x01;
99      bit1 = (color_prom[i] >> 1) & 0x01;
100      bit2 = (color_prom[i] >> 2) & 0x01;
101      r = combine_3_weights(rweights, bit0, bit1, bit2);
122102
123      /* red component */
124      bit0 = (*color_prom >> 0) & 0x01;
125      bit1 = (*color_prom >> 1) & 0x01;
126      bit2 = (*color_prom >> 2) & 0x01;
127      r = 0x21 * bit0 + 0x47 * bit1 + 0x97 * bit2;
128103      /* green component */
129      bit0 = (*color_prom >> 3) & 0x01;
130      bit1 = (*color_prom >> 4) & 0x01;
131      bit2 = (*color_prom >> 5) & 0x01;
132      g = 0x21 * bit0 + 0x47 * bit1 + 0x97 * bit2;
104      bit0 = (color_prom[i] >> 3) & 0x01;
105      bit1 = (color_prom[i] >> 4) & 0x01;
106      bit2 = (color_prom[i] >> 5) & 0x01;
107      g = combine_3_weights(gweights, bit0, bit1, bit2);
108
133109      /* blue component */
134      if (video_type == TYPE_RALLYX)
135      {
136         bit0 = 0;
137         bit1 = (*color_prom >> 6) & 0x01;
138         bit2 = (*color_prom >> 7) & 0x01;
139         b = 0x21 * bit0 + 0x47 * bit1 + 0x97 * bit2;
140      }
141      else
142      {
143         bit0 = (*color_prom >> 6) & 0x01;
144         bit1 = (*color_prom >> 7) & 0x01;
145         b = 0x50 * bit0 + 0xab * bit1;
146      }
110      bit0 = (color_prom[i] >> 6) & 0x01;
111      bit1 = (color_prom[i] >> 7) & 0x01;
112      b = combine_2_weights(bweights, bit0, bit1);
147113
148      palette_set_color(machine,i,MAKE_RGB(r,g,b));
149
150      color_prom++;
114      colortable_palette_set_color(machine->colortable, i, MAKE_RGB(r, g, b));
151115   }
152116
153117   /* color_prom now points to the beginning of the lookup table */
118   color_prom += 0x20;
154119
155   /* character lookup table */
156   /* sprites use the same color lookup table as characters */
157   for (i = 0;i < TOTAL_COLORS(0);i++)
158      COLOR(0,i) = *(color_prom++) & 0x0f;
120   /* character/sprites lookup table */
121   for (i = 0x000; i < 0x100; i++)
122   {
123      UINT8 ctabentry = color_prom[i] & 0x0f;
124      colortable_entry_set_value(machine->colortable, i, ctabentry);
125   }
159126
160   /* radar dots lookup table */
161   /* they use colors 16-19 */
162   for (i = 0;i < 4;i++)
163      COLOR(2,i) = 16 + i;
127   /* bullets use colors 0x10-0x13 */
128   for (i = 0x100; i < 0x104; i++)
129      colortable_entry_set_value(machine->colortable, i, (i - 0x100) | 0x10);
130}
164131
165   /* Rally X doesn't have the optional starfield generator */
166   if (video_type != TYPE_RALLYX)
132
133PALETTE_INIT( jungler )
134{
135   static const int resistances_rg[3]   = { 1000, 470, 220 };
136   static const int resistances_b [2]   = { 470, 220 };
137   static const int resistances_star[3] = { 150, 100 };
138   double rweights[3], gweights[3], bweights[2];
139   double rweights_star[2], gweights_star[2], bweights_star[2];
140   int i;
141
142   /* compute the color output resistor weights */
143   double scale = compute_resistor_weights(0,   255, -1.0,
144                  2, resistances_star, rweights_star, 0, 0,
145                  2, resistances_star, gweights_star, 0, 0,
146                  2, resistances_star, bweights_star, 0, 0);
147
148               compute_resistor_weights(0,   255, scale,
149                  3, resistances_rg, rweights, 1000, 0,
150                  3, resistances_rg, gweights, 1000, 0,
151                  2, resistances_b,  bweights, 1000, 0);
152
153   /* allocate the colortable */
154   machine->colortable = colortable_alloc(machine, 0x60);
155
156   /* create a lookup table for the palette */
157   for (i = 0; i < 0x20; i++)
167158   {
168      /* now the stars */
169      for (i = 0;i < 64;i++)
170      {
171         int bits,r,g,b;
172         static const int map[4] = { 0x00, 0x47, 0x97, 0xde };
159      int bit0, bit1, bit2;
160      int r, g, b;
173161
174         bits = (i >> 0) & 0x03;
175         r = map[bits];
176         bits = (i >> 2) & 0x03;
177         g = map[bits];
178         bits = (i >> 4) & 0x03;
179         b = map[bits];
162      /* red component */
163      bit0 = (color_prom[i] >> 0) & 0x01;
164      bit1 = (color_prom[i] >> 1) & 0x01;
165      bit2 = (color_prom[i] >> 2) & 0x01;
166      r = combine_3_weights(rweights, bit0, bit1, bit2);
180167
181         palette_set_color(machine,i + 32,MAKE_RGB(r,g,b));
182      }
168      /* green component */
169      bit0 = (color_prom[i] >> 3) & 0x01;
170      bit1 = (color_prom[i] >> 4) & 0x01;
171      bit2 = (color_prom[i] >> 5) & 0x01;
172      g = combine_3_weights(gweights, bit0, bit1, bit2);
173
174      /* blue component */
175      bit0 = (color_prom[i] >> 6) & 0x01;
176      bit1 = (color_prom[i] >> 7) & 0x01;
177      b = combine_2_weights(bweights, bit0, bit1);
178
179      colortable_palette_set_color(machine->colortable, i, MAKE_RGB(r, g, b));
183180   }
181
182   /* star pens */
183   for (i = 0x20; i < 0x60; i++)
184   {
185      int bit0, bit1;
186      int r, g, b;
187
188      /* red component */
189      bit0 = ((i - 0x20) >> 0) & 0x01;
190      bit1 = ((i - 0x20) >> 1) & 0x01;
191      r = combine_2_weights(rweights_star, bit0, bit1);
192
193      /* green component */
194      bit0 = ((i - 0x20) >> 2) & 0x01;
195      bit1 = ((i - 0x20) >> 3) & 0x01;
196      g = combine_2_weights(gweights_star, bit0, bit1);
197
198      /* blue component */
199      bit0 = ((i - 0x20) >> 4) & 0x01;
200      bit1 = ((i - 0x20) >> 5) & 0x01;
201      b = combine_2_weights(bweights_star, bit0, bit1);
202
203      colortable_palette_set_color(machine->colortable, i, MAKE_RGB(r, g, b));
204   }
205
206   /* color_prom now points to the beginning of the lookup table */
207   color_prom += 0x20;
208
209   /* character/sprites lookup table */
210   for (i = 0x000; i < 0x100; i++)
211   {
212      UINT8 ctabentry = color_prom[i] & 0x0f;
213      colortable_entry_set_value(machine->colortable, i, ctabentry);
214   }
215
216   /* bullets use colors 0x10-0x13 */
217   for (i = 0x100; i < 0x104; i++)
218      colortable_entry_set_value(machine->colortable, i, (i - 0x100) | 0x10);
219
220   /* stars */
221   for (i = 0x104; i < 0x144; i++)
222      colortable_entry_set_value(machine->colortable, i, (i - 0x104) + 0x20);
184223}
185224
186225
r1679r1680
251290
252291***************************************************************************/
253292
254VIDEO_START( rallyx )
293static void calculate_star_field(void)
255294{
256   int i;
295   int generator;
296   int x,y;
257297
258   if (video_type == TYPE_RALLYX || video_type == TYPE_JUNGLER)
298   /* precalculate the star background */
299   total_stars = 0;
300   generator = 0;
301
302   for (y = 0;y < 256;y++)
259303   {
260      bg_tilemap = tilemap_create(rallyx_bg_get_tile_info,tilemap_scan_rows,TILEMAP_TYPE_PEN,8,8,32,32);
261      fg_tilemap = tilemap_create(rallyx_fg_get_tile_info,fg_tilemap_scan,  TILEMAP_TYPE_PEN,8,8, 8,32);
304      for (x = 0;x < 288;x++)
305      {
306         int bit1,bit2;
307
308         generator <<= 1;
309         bit1 = (~generator >> 17) & 1;
310         bit2 = (generator >> 5) & 1;
311
312         if (bit1 ^ bit2) generator |= 1;
313
314         if (((~generator >> 16) & 1) &&
315               (generator & 0xfe) == 0xfe)
316         {
317            int color;
318
319            color = (~(generator >> 8)) & 0x3f;
320
321            if (color && total_stars < MAX_STARS)
322            {
323               stars[total_stars].x = x;
324               stars[total_stars].y = y;
325               stars[total_stars].color = color;
326
327               total_stars++;
328            }
329         }
330      }
262331   }
263   else
264   {
265      bg_tilemap = tilemap_create(locomotn_bg_get_tile_info,tilemap_scan_rows,TILEMAP_TYPE_PEN,8,8,32,32);
266      fg_tilemap = tilemap_create(locomotn_fg_get_tile_info,fg_tilemap_scan,  TILEMAP_TYPE_PEN,8,8, 8,32);
267   }
332}
268333
334
335VIDEO_START( rallyx )
336{
337   int i;
338
339   bg_tilemap = tilemap_create(rallyx_bg_get_tile_info,tilemap_scan_rows,8,8,32,32);
340   fg_tilemap = tilemap_create(rallyx_fg_get_tile_info,fg_tilemap_scan,  8,8, 8,32);
341
269342   /* the scrolling tilemap is slightly misplaced in Rally X */
270   if (video_type == TYPE_RALLYX)
271      tilemap_set_scrolldx(bg_tilemap,3,3);
343   tilemap_set_scrolldx(bg_tilemap,3,3);
272344
273   /* commsega has more sprites and bullets than the other games */
274   if (video_type == TYPE_COMMSEGA)
275      spriteram_base = 0x00;
276   else
277      spriteram_base = 0x14;
345   spriteram_base = 0x14;
346
278347   spriteram = rallyx_videoram + 0x00;
279348   spriteram_2 = spriteram + 0x800;
280349   rallyx_radarx = rallyx_videoram + 0x20;
r1679r1680
282351
283352   for (i = 0;i < 16;i++)
284353      machine->shadow_table[i] = i+16;
354
285355   for (i = 16;i < 32;i++)
286356      machine->shadow_table[i] = i;
357
287358   for (i = 0;i < 3;i++)
288359      gfx_drawmode_table[i] = DRAWMODE_SHADOW;
360
289361   gfx_drawmode_table[3] = DRAWMODE_NONE;
362}
290363
291364
292   /* Rally X doesn't have the optional starfield generator */
293   if (video_type != TYPE_RALLYX)
294   {
295      int generator;
296      int x,y;
365VIDEO_START( jungler )
366{
367   int i;
297368
298      /* precalculate the star background */
299      /* this comes from the Galaxian hardware, Bosconian is probably different */
300      total_stars = 0;
301      generator = 0;
369   bg_tilemap = tilemap_create(rallyx_bg_get_tile_info,tilemap_scan_rows,8,8,32,32);
370   fg_tilemap = tilemap_create(rallyx_fg_get_tile_info,fg_tilemap_scan,  8,8, 8,32);
302371
303      for (y = 0;y < 256;y++)
304      {
305         for (x = 0;x < 288;x++)
306         {
307            int bit1,bit2;
372   spriteram_base = 0x14;
308373
374   spriteram = rallyx_videoram + 0x00;
375   spriteram_2 = spriteram + 0x800;
376   rallyx_radarx = rallyx_videoram + 0x20;
377   rallyx_radary = rallyx_radarx + 0x800;
309378
310            generator <<= 1;
311            bit1 = (~generator >> 17) & 1;
312            bit2 = (generator >> 5) & 1;
379   for (i = 0;i < 16;i++)
380      machine->shadow_table[i] = i+16;
313381
314            if (bit1 ^ bit2) generator |= 1;
382   for (i = 16;i < 32;i++)
383      machine->shadow_table[i] = i;
315384
316            if (((~generator >> 16) & 1) &&
317                  (generator & 0xfe) == 0xfe)
318            {
319               int color;
385   for (i = 0;i < 3;i++)
386      gfx_drawmode_table[i] = DRAWMODE_SHADOW;
320387
321               color = (~(generator >> 8)) & 0x3f;
322               if (color && total_stars < MAX_STARS)
323               {
324                  stars[total_stars].x = x;
325                  stars[total_stars].y = y;
326                  stars[total_stars].color = machine->pens[color + STARS_COLOR_BASE];
388   gfx_drawmode_table[3] = DRAWMODE_NONE;
327389
328                  total_stars++;
329               }
330            }
331         }
332      }
333   }
390   calculate_star_field();
334391}
335392
336393
394VIDEO_START( locomotn )
395{
396   int i;
337397
398   bg_tilemap = tilemap_create(locomotn_bg_get_tile_info,tilemap_scan_rows,8,8,32,32);
399   fg_tilemap = tilemap_create(locomotn_fg_get_tile_info,fg_tilemap_scan,  8,8, 8,32);
400
401   spriteram_base = 0x14;
402
403   spriteram = rallyx_videoram + 0x00;
404   spriteram_2 = spriteram + 0x800;
405   rallyx_radarx = rallyx_videoram + 0x20;
406   rallyx_radary = rallyx_radarx + 0x800;
407
408   for (i = 0;i < 16;i++)
409      machine->shadow_table[i] = i+16;
410
411   for (i = 16;i < 32;i++)
412      machine->shadow_table[i] = i;
413
414   for (i = 0;i < 3;i++)
415      gfx_drawmode_table[i] = DRAWMODE_SHADOW;
416
417   gfx_drawmode_table[3] = DRAWMODE_NONE;
418
419   calculate_star_field();
420}
421
422
423VIDEO_START( commsega )
424{
425   int i;
426
427   bg_tilemap = tilemap_create(locomotn_bg_get_tile_info,tilemap_scan_rows,8,8,32,32);
428   fg_tilemap = tilemap_create(locomotn_fg_get_tile_info,fg_tilemap_scan,  8,8, 8,32);
429
430   /* commsega has more sprites and bullets than the other games */
431   spriteram_base = 0x00;
432
433   spriteram = rallyx_videoram + 0x00;
434   spriteram_2 = spriteram + 0x800;
435   rallyx_radarx = rallyx_videoram + 0x20;
436   rallyx_radary = rallyx_radarx + 0x800;
437
438   for (i = 0;i < 16;i++)
439      machine->shadow_table[i] = i+16;
440
441   for (i = 16;i < 32;i++)
442      machine->shadow_table[i] = i;
443
444   for (i = 0;i < 3;i++)
445      gfx_drawmode_table[i] = DRAWMODE_SHADOW;
446
447   gfx_drawmode_table[3] = DRAWMODE_NONE;
448
449   calculate_star_field();
450}
451
452
338453/***************************************************************************
339454
340455  Memory handlers
r1679r1680
369484
370485static void plot_star(running_machine *machine, mame_bitmap *bitmap, const rectangle *cliprect, int x, int y, int color)
371486{
372   int bpen = machine->pens[0];
373
374487   if (y < cliprect->min_y ||
375488      y > cliprect->max_y ||
376489      x < cliprect->min_x ||
r1679r1680
378491      return;
379492
380493   if (flip_screen_x)
381   {
382494      x = 255 - x;
383   }
495
384496   if (flip_screen_y)
385   {
386497      y = 255 - y;
387   }
388498
389   if (*BITMAP_ADDR16(bitmap, y, x) == bpen)
499   if (colortable_entry_get_value(machine->colortable, *BITMAP_ADDR16(bitmap, y, x) % 0x144) == 0)
390500      *BITMAP_ADDR16(bitmap, y, x) = machine->pens[STARS_COLOR_BASE + color];
391501}
392502
r1679r1680
396506
397507   for (offs = 0;offs < total_stars;offs++)
398508   {
399      int x,y;
509      int x = stars[offs].x;
510      int y = stars[offs].y;
400511
401
402      x = stars[offs].x;
403      y = stars[offs].y;
404
405512      if ((y & 0x01) ^ ((x >> 3) & 0x01))
406      {
407513         plot_star(machine, bitmap, cliprect, x, y, stars[offs].color);
408      }
409514   }
410515}
411516
r1679r1680
418523   {
419524      int sx = spriteram[offs + 1] + ((spriteram_2[offs + 1] & 0x80) << 1) - displacement;
420525      int sy = 241 - spriteram_2[offs] - displacement;
526      int color = spriteram_2[offs + 1] & 0x3f;
421527      int flipx = spriteram[offs] & 1;
422528      int flipy = spriteram[offs] & 2;
423529      if (flip_screen) sx -= 2*displacement;
424530
425531      pdrawgfx(bitmap,machine->gfx[1],
426532            (spriteram[offs] & 0xfc) >> 2,
427            spriteram_2[offs + 1] & 0x3f,
533            color,
428534            flipx,flipy,
429535            sx,sy,
430            cliprect,TRANSPARENCY_COLOR,0,0x02);
536            cliprect,TRANSPARENCY_PENS,
537            colortable_get_transpen_mask(machine->colortable, machine->gfx[1], color, 0),
538            0x02);
431539   }
432540}
433541
r1679r1680
439547   {
440548      int sx = spriteram[offs + 1] + ((spriteram_2[offs + 1] & 0x80) << 1);
441549      int sy = 241 - spriteram_2[offs] - displacement;
550      int color = spriteram_2[offs + 1] & 0x3f;
442551      int flip = spriteram[offs] & 2;
443552
444553      /* handle reduced visible area in some games */
r1679r1680
446555
447556      pdrawgfx(bitmap,machine->gfx[1],
448557            ((spriteram[offs] & 0x7c) >> 2) + 0x20*(spriteram[offs] & 0x01) + ((spriteram[offs] & 0x80) >> 1),
449            spriteram_2[offs + 1] & 0x3f,
558            color,
450559            flip,flip,
451560            sx,sy,
452            cliprect,TRANSPARENCY_COLOR,0,0x02);
561            cliprect,TRANSPARENCY_PENS,
562            colortable_get_transpen_mask(machine->colortable, machine->gfx[1], color, 0),
563            0x02);
453564   }
454565}
455566
r1679r1680
547658
548659   tilemap_draw(bitmap,&bg_clip,bg_tilemap,0,0);
549660   tilemap_draw(bitmap,&fg_clip,fg_tilemap,0,0);
550   /* tile priority doesn't seem to be supported in Jungler */
551   tilemap_draw(bitmap,&bg_clip,bg_tilemap,1,video_type == TYPE_JUNGLER ? 0 : 1);
552   tilemap_draw(bitmap,&fg_clip,fg_tilemap,1,video_type == TYPE_JUNGLER ? 0 : 1);
661   tilemap_draw(bitmap,&bg_clip,bg_tilemap,1,1);
662   tilemap_draw(bitmap,&fg_clip,fg_tilemap,1,1);
553663
554   switch (video_type)
664   rallyx_draw_bullets(machine, bitmap,cliprect,TRANSPARENCY_PEN);
665   rallyx_draw_sprites(machine, bitmap,cliprect,1);
666   rallyx_draw_bullets(machine, bitmap,cliprect,TRANSPARENCY_PEN_TABLE);
667
668   return 0;
669}
670
671
672VIDEO_UPDATE( jungler )
673{
674   /* the radar tilemap is just 8x32. We rely on the tilemap code to repeat it across
675       the screen, and clip it to only the position where it is supposed to be shown */
676   rectangle fg_clip = *cliprect;
677   rectangle bg_clip = *cliprect;
678   if (flip_screen)
555679   {
556      case TYPE_RALLYX:
557         rallyx_draw_bullets(machine, bitmap,cliprect,TRANSPARENCY_PEN);
558         rallyx_draw_sprites(machine, bitmap,cliprect,1);
559         rallyx_draw_bullets(machine, bitmap,cliprect,TRANSPARENCY_PEN_TABLE);
560         break;
680      bg_clip.min_x = 8*8;
681      fg_clip.max_x = 8*8-1;
682   }
683   else
684   {
685      bg_clip.max_x = 28*8-1;
686      fg_clip.min_x = 28*8;
687   }
561688
562      case TYPE_JUNGLER:
563         jungler_draw_bullets(machine, bitmap,cliprect,TRANSPARENCY_PEN);
564         rallyx_draw_sprites(machine, bitmap,cliprect,0);
565         jungler_draw_bullets(machine, bitmap,cliprect,TRANSPARENCY_PEN_TABLE);
566         break;
689   fillbitmap(priority_bitmap,0,cliprect);
567690
568      case TYPE_TACTCIAN:
569      case TYPE_LOCOMOTN:
570      case TYPE_COMMSEGA:
571         locomotn_draw_bullets(machine, bitmap,cliprect,TRANSPARENCY_PEN);
572         locomotn_draw_sprites(machine, bitmap,cliprect,0);
573         locomotn_draw_bullets(machine, bitmap,cliprect,TRANSPARENCY_PEN_TABLE);
574         break;
691   /* tile priority doesn't seem to be supported in Jungler */
692   tilemap_draw(bitmap,&bg_clip,bg_tilemap,0,0);
693   tilemap_draw(bitmap,&fg_clip,fg_tilemap,0,0);
694   tilemap_draw(bitmap,&bg_clip,bg_tilemap,1,0);
695   tilemap_draw(bitmap,&fg_clip,fg_tilemap,1,0);
696
697   jungler_draw_bullets(machine, bitmap,cliprect,TRANSPARENCY_PEN);
698   rallyx_draw_sprites(machine, bitmap,cliprect,0);
699   jungler_draw_bullets(machine, bitmap,cliprect,TRANSPARENCY_PEN_TABLE);
700
701   if (stars_enable)
702      draw_stars(machine, bitmap, cliprect);
703
704   return 0;
705}
706
707
708VIDEO_UPDATE( locomotn )
709{
710   /* the radar tilemap is just 8x32. We rely on the tilemap code to repeat it across
711       the screen, and clip it to only the position where it is supposed to be shown */
712   rectangle fg_clip = *cliprect;
713   rectangle bg_clip = *cliprect;
714   if (flip_screen)
715   {
716      bg_clip.min_x = 8*8;
717      fg_clip.max_x = 8*8-1;
575718   }
719   else
720   {
721      bg_clip.max_x = 28*8-1;
722      fg_clip.min_x = 28*8;
723   }
576724
577   /* Rally X doesn't have the optional starfield generator */
578   if (video_type != TYPE_RALLYX)
579      if (stars_enable) draw_stars(machine, bitmap,cliprect);
725   fillbitmap(priority_bitmap,0,cliprect);
726
727   tilemap_draw(bitmap,&bg_clip,bg_tilemap,0,0);
728   tilemap_draw(bitmap,&fg_clip,fg_tilemap,0,0);
729   tilemap_draw(bitmap,&bg_clip,bg_tilemap,1,1);
730   tilemap_draw(bitmap,&fg_clip,fg_tilemap,1,1);
731
732   locomotn_draw_bullets(machine, bitmap,cliprect,TRANSPARENCY_PEN);
733   locomotn_draw_sprites(machine, bitmap,cliprect,0);
734   locomotn_draw_bullets(machine, bitmap,cliprect,TRANSPARENCY_PEN_TABLE);
735
736   if (stars_enable)
737      draw_stars(machine, bitmap, cliprect);
738
580739   return 0;
581740}
741
src/mame/video/trucocl.c
r1679r1680
7272
7373VIDEO_START( trucocl )
7474{
75   bg_tilemap = tilemap_create( get_bg_tile_info, tilemap_scan_rows, TILEMAP_TYPE_PEN, 8, 8, 32, 32 );
75   bg_tilemap = tilemap_create( get_bg_tile_info, tilemap_scan_rows, 8, 8, 32, 32 );
7676}
7777
7878VIDEO_UPDATE( trucocl )
src/mame/video/unico.c
r1679r1680
142142VIDEO_START( unico )
143143{
144144   tilemap_0 = tilemap_create(   get_tile_info_0,tilemap_scan_rows,
145                        TILEMAP_TYPE_PEN,   16,16,   0x40, 0x40);
145                           16,16,   0x40, 0x40);
146146
147147   tilemap_1 = tilemap_create(   get_tile_info_1,tilemap_scan_rows,
148                        TILEMAP_TYPE_PEN,   16,16,   0x40, 0x40);
148                           16,16,   0x40, 0x40);
149149
150150   tilemap_2 = tilemap_create(   get_tile_info_2,tilemap_scan_rows,
151                        TILEMAP_TYPE_PEN,   16,16,   0x40, 0x40);
151                           16,16,   0x40, 0x40);
152152
153153   sprites_scrolldx = -0x3f;
154154   sprites_scrolldy = -0x0e;
r1679r1680
169169VIDEO_START( zeropnt2 )
170170{
171171   tilemap_0 = tilemap_create(   get_tile_info32_0,tilemap_scan_rows,
172                        TILEMAP_TYPE_PEN,   16,16,   0x40, 0x40);
172                           16,16,   0x40, 0x40);
173173
174174   tilemap_1 = tilemap_create(   get_tile_info32_1,tilemap_scan_rows,
175                        TILEMAP_TYPE_PEN,   16,16,   0x40, 0x40);
175                           16,16,   0x40, 0x40);
176176
177177   tilemap_2 = tilemap_create(   get_tile_info32_2,tilemap_scan_rows,
178                        TILEMAP_TYPE_PEN,   16,16,   0x40, 0x40);
178                           16,16,   0x40, 0x40);
179179
180180   sprites_scrolldx = -0x3f;
181181   sprites_scrolldy = -0x0e;
src/mame/video/gcpinbal.c
r1679r1680
6969   int xoffs = 0;
7070   int yoffs = 0;
7171
72   gcpinbal_tilemap[0] = tilemap_create(get_bg0_tile_info,tilemap_scan_rows,TILEMAP_TYPE_PEN,16,16,32,32);
73   gcpinbal_tilemap[1] = tilemap_create(get_bg1_tile_info,tilemap_scan_rows,TILEMAP_TYPE_PEN,16,16,32,32);
74   gcpinbal_tilemap[2] = tilemap_create(get_fg_tile_info, tilemap_scan_rows,TILEMAP_TYPE_PEN,8,8,64,64);
72   gcpinbal_tilemap[0] = tilemap_create(get_bg0_tile_info,tilemap_scan_rows,16,16,32,32);
73   gcpinbal_tilemap[1] = tilemap_create(get_bg1_tile_info,tilemap_scan_rows,16,16,32,32);
74   gcpinbal_tilemap[2] = tilemap_create(get_fg_tile_info, tilemap_scan_rows,8,8,64,64);
7575
7676   tilemap_set_transparent_pen( gcpinbal_tilemap[0],0 );
7777   tilemap_set_transparent_pen( gcpinbal_tilemap[1],0 );
src/mame/video/realbrk.c
r1679r1680
155155{
156156   /* Backgrounds */
157157   tilemap_0 = tilemap_create(   get_tile_info_0, tilemap_scan_rows,
158                        TILEMAP_TYPE_PEN,
158
159159                        16,16,
160160                        0x40, 0x20);
161161
162162   tilemap_1 = tilemap_create(   get_tile_info_1, tilemap_scan_rows,
163                        TILEMAP_TYPE_PEN,
163
164164                        16,16,
165165                        0x40, 0x20);
166166
167167   /* Text */
168168   tilemap_2 = tilemap_create(   get_tile_info_2, tilemap_scan_rows,
169                        TILEMAP_TYPE_PEN,
169
170170                        8,8,
171171                        0x40, 0x20);
172172
src/mame/video/carjmbre.c
r1679r1680
8181VIDEO_START( carjmbre )
8282{
8383
84   carjmbre_tilemap = tilemap_create( get_carjmbre_tile_info,tilemap_scan_rows,TILEMAP_TYPE_PEN,8,8,32,32 );
84   carjmbre_tilemap = tilemap_create( get_carjmbre_tile_info,tilemap_scan_rows,8,8,32,32 );
8585
8686   state_save_register_global(carjmbre_flipscreen);
8787   state_save_register_global(carjmbre_bgcolor);
src/mame/video/flower.c
r1679r1680
1010{
1111   int i;
1212
13   for (i=0; i<256; i++)
13   /* allocate the colortable */
14   machine->colortable = colortable_alloc(machine, 0x100);
15
16   /* create a lookup table for the palette */
17   for (i = 0; i < 0x100; i++)
1418   {
15      palette_set_color_rgb(machine, i, pal4bit(color_prom[i]), pal4bit(color_prom[i+0x100]), pal4bit(color_prom[i+0x200]));
16      colortable[i] = i;
19      int r = pal4bit(color_prom[i + 0x000]);
20      int g = pal4bit(color_prom[i + 0x100]);
21      int b = pal4bit(color_prom[i + 0x200]);
22
23      colortable_palette_set_color(machine->colortable, i, MAKE_RGB(r, g, b));
1724   }
25
26   for (i = 0; i < 0x100; i++)
27      colortable_entry_set_value(machine->colortable, i, i);
1828}
1929
2030static void draw_sprites(running_machine *machine, mame_bitmap *bitmap, const rectangle *cliprect )
r1679r1680
138148
139149VIDEO_START(flower)
140150{
141   flower_bg0_tilemap        = tilemap_create(get_bg0_tile_info, tilemap_scan_rows,TILEMAP_TYPE_PEN,     16,16,16,16);
142   flower_bg1_tilemap        = tilemap_create(get_bg1_tile_info, tilemap_scan_rows,TILEMAP_TYPE_PEN,16,16,16,16);
143   flower_text_tilemap       = tilemap_create(get_text_tile_info,tilemap_scan_rows,TILEMAP_TYPE_PEN, 8, 8,32,32);
144   flower_text_right_tilemap = tilemap_create(get_text_tile_info,tilemap_scan_cols,TILEMAP_TYPE_PEN, 8, 8, 2,32);
151   flower_bg0_tilemap        = tilemap_create(get_bg0_tile_info, tilemap_scan_rows,     16,16,16,16);
152   flower_bg1_tilemap        = tilemap_create(get_bg1_tile_info, tilemap_scan_rows,16,16,16,16);
153   flower_text_tilemap       = tilemap_create(get_text_tile_info,tilemap_scan_rows, 8, 8,32,32);
154   flower_text_right_tilemap = tilemap_create(get_text_tile_info,tilemap_scan_cols, 8, 8, 2,32);
145155
146156   tilemap_set_transparent_pen(flower_bg1_tilemap,15);
147157   tilemap_set_transparent_pen(flower_text_tilemap,3);
src/mame/video/xain.c
r1679r1680
8888
8989VIDEO_START( xain )
9090{
91   bgram0_tilemap = tilemap_create(get_bgram0_tile_info,back_scan,    TILEMAP_TYPE_PEN,16,16,32,32);
92   bgram1_tilemap = tilemap_create(get_bgram1_tile_info,back_scan,    TILEMAP_TYPE_PEN,16,16,32,32);
93   char_tilemap = tilemap_create(get_char_tile_info,tilemap_scan_rows,TILEMAP_TYPE_PEN, 8, 8,32,32);
91   bgram0_tilemap = tilemap_create(get_bgram0_tile_info,back_scan,    16,16,32,32);
92   bgram1_tilemap = tilemap_create(get_bgram1_tile_info,back_scan,    16,16,32,32);
93   char_tilemap = tilemap_create(get_char_tile_info,tilemap_scan_rows, 8, 8,32,32);
9494
9595   tilemap_set_transparent_pen(bgram0_tilemap,0);
9696   tilemap_set_transparent_pen(bgram1_tilemap,0);
src/mame/video/namcos1.c
r1679r1680
108108   namcos1_spriteram = auto_malloc(0x1000);
109109
110110   /* initialize playfields */
111   bg_tilemap[0] = tilemap_create(bg_get_info0,tilemap_scan_rows,TILEMAP_TYPE_PEN,8,8,64,64);
112   bg_tilemap[1] = tilemap_create(bg_get_info1,tilemap_scan_rows,TILEMAP_TYPE_PEN,8,8,64,64);
113   bg_tilemap[2] = tilemap_create(bg_get_info2,tilemap_scan_rows,TILEMAP_TYPE_PEN,8,8,64,64);
114   bg_tilemap[3] = tilemap_create(bg_get_info3,tilemap_scan_rows,TILEMAP_TYPE_PEN,8,8,64,32);
115   bg_tilemap[4] = tilemap_create(fg_get_info4,tilemap_scan_rows,TILEMAP_TYPE_PEN,8,8,36,28);
116   bg_tilemap[5] = tilemap_create(fg_get_info5,tilemap_scan_rows,TILEMAP_TYPE_PEN,8,8,36,28);
111   bg_tilemap[0] = tilemap_create(bg_get_info0,tilemap_scan_rows,8,8,64,64);
112   bg_tilemap[1] = tilemap_create(bg_get_info1,tilemap_scan_rows,8,8,64,64);
113   bg_tilemap[2] = tilemap_create(bg_get_info2,tilemap_scan_rows,8,8,64,64);
114   bg_tilemap[3] = tilemap_create(bg_get_info3,tilemap_scan_rows,8,8,64,32);
115   bg_tilemap[4] = tilemap_create(fg_get_info4,tilemap_scan_rows,8,8,36,28);
116   bg_tilemap[5] = tilemap_create(fg_get_info5,tilemap_scan_rows,8,8,36,28);
117117
118118   tilemap_set_scrolldx(bg_tilemap[4],73,512-73);
119119   tilemap_set_scrolldx(bg_tilemap[5],73,512-73);
src/mame/video/mrdo.c
r1679r1680
153153
154154VIDEO_START( mrdo )
155155{
156   bg_tilemap = tilemap_create(get_bg_tile_info,tilemap_scan_rows,TILEMAP_TYPE_PEN,8,8,32,32);
157   fg_tilemap = tilemap_create(get_fg_tile_info,tilemap_scan_rows,TILEMAP_TYPE_PEN,8,8,32,32);
156   bg_tilemap = tilemap_create(get_bg_tile_info,tilemap_scan_rows,8,8,32,32);
157   fg_tilemap = tilemap_create(get_fg_tile_info,tilemap_scan_rows,8,8,32,32);
158158
159159   tilemap_set_transparent_pen(bg_tilemap,0);
160160   tilemap_set_transparent_pen(fg_tilemap,0);
src/mame/video/gundealr.c
r1679r1680
6060
6161VIDEO_START( gundealr )
6262{
63   bg_tilemap = tilemap_create(get_bg_tile_info,tilemap_scan_cols,TILEMAP_TYPE_PEN,      8, 8,32,32);
64   fg_tilemap = tilemap_create(get_fg_tile_info,gundealr_scan,    TILEMAP_TYPE_PEN,16,16,64,32);
63   bg_tilemap = tilemap_create(get_bg_tile_info,tilemap_scan_cols,      8, 8,32,32);
64   fg_tilemap = tilemap_create(get_fg_tile_info,gundealr_scan,    16,16,64,32);
6565
6666   tilemap_set_transparent_pen(fg_tilemap,15);
6767}
src/mame/video/m62.c
r1679r1680
401401
402402static void m62_start( tile_get_info_callback tile_get_info, int rows, int cols, int x1, int y1, int x2, int y2 )
403403{
404   m62_background = tilemap_create( tile_get_info, tilemap_scan_rows, TILEMAP_TYPE_PEN, x1, y1, x2, y2 );
404   m62_background = tilemap_create( tile_get_info, tilemap_scan_rows, x1, y1, x2, y2 );
405405
406406   m62_background_hscroll = 0;
407407   m62_background_vscroll = 0;
r1679r1680
420420
421421static void m62_textlayer( tile_get_info_callback tile_get_info, int rows, int cols, int x1, int y1, int x2, int y2 )
422422{
423   m62_foreground = tilemap_create( tile_get_info, tilemap_scan_rows, TILEMAP_TYPE_PEN, x1, y1, x2, y2 );
423   m62_foreground = tilemap_create( tile_get_info, tilemap_scan_rows, x1, y1, x2, y2 );
424424
425425   if( rows != 0 )
426426   {
r1679r1680
734734
735735VIDEO_START( kidniki )
736736{
737   m62_background = tilemap_create( get_kidniki_bg_tile_info, tilemap_scan_rows, TILEMAP_TYPE_PEN, 8, 8, 64, 32 );
737   m62_background = tilemap_create( get_kidniki_bg_tile_info, tilemap_scan_rows, 8, 8, 64, 32 );
738738
739739   m62_background_hscroll = 0;
740740   m62_background_vscroll = 0;
src/mame/video/astrocde.c
r1679r1680
226226{
227227   /* allocate a per-scanline timer */
228228   scanline_timer = timer_alloc(scanline_callback, NULL);
229   timer_adjust(scanline_timer, video_screen_get_time_until_pos(0, 1, 0), 1, attotime_zero);
229   timer_adjust_oneshot(scanline_timer, video_screen_get_time_until_pos(0, 1, 0), 1);
230230
231231   /* register for save states */
232232   init_savestate();
r1679r1680
241241{
242242   /* allocate a per-scanline timer */
243243   scanline_timer = timer_alloc(scanline_callback, NULL);
244   timer_adjust(scanline_timer, video_screen_get_time_until_pos(0, 1, 0), 1, attotime_zero);
244   timer_adjust_oneshot(scanline_timer, video_screen_get_time_until_pos(0, 1, 0), 1);
245245
246246   /* allocate videoram */
247247   profpac_videoram = auto_malloc(0x4000 * 4 * sizeof(*profpac_videoram));
r1679r1680
493493   scanline++;
494494   if (scanline >= machine->screen[0].height)
495495      scanline = 0;
496   timer_adjust(scanline_timer, video_screen_get_time_until_pos(0, scanline, 0), scanline, attotime_zero);
496   timer_adjust_oneshot(scanline_timer, video_screen_get_time_until_pos(0, scanline, 0), scanline);
497497}
498498
499499
src/mame/video/megazone.c
r1679r1680
77***************************************************************************/
88
99#include "driver.h"
10#include "video/resnet.h"
1011
1112UINT8 *megazone_scrollx;
1213UINT8 *megazone_scrolly;
r1679r1680
4344***************************************************************************/
4445PALETTE_INIT( megazone )
4546{
47   static const int resistances_rg[3] = { 1000, 470, 220 };
48   static const int resistances_b [2] = { 470, 220 };
49   double rweights[3], gweights[3], bweights[2];
4650   int i;
47   #define TOTAL_COLORS(gfxn) (machine->gfx[gfxn]->total_colors * machine->gfx[gfxn]->color_granularity)
48   #define COLOR(gfxn,offs) (colortable[machine->drv->gfxdecodeinfo[gfxn].color_codes_start + offs])
4951
52   /* compute the color output resistor weights */
53   compute_resistor_weights(0,   255, -1.0,
54         3, &resistances_rg[0], rweights, 1000, 0,
55         3, &resistances_rg[0], gweights, 1000, 0,
56         2, &resistances_b[0],  bweights, 1000, 0);
5057
51   for (i = 0;i < machine->drv->total_colors;i++)
58   /* allocate the colortable */
59   machine->colortable = colortable_alloc(machine, 0x20);
60
61   /* create a lookup table for the palette */
62   for (i = 0; i < 0x20; i++)
5263   {
53      int bit0,bit1,bit2,r,g,b;
64      int bit0, bit1, bit2;
65      int r, g, b;
5466
5567      /* red component */
56      bit0 = (*color_prom >> 0) & 0x01;
57      bit1 = (*color_prom >> 1) & 0x01;
58      bit2 = (*color_prom >> 2) & 0x01;
59      r = 0x21 * bit0 + 0x47 * bit1 + 0x97 * bit2;
68      bit0 = (color_prom[i] >> 0) & 0x01;
69      bit1 = (color_prom[i] >> 1) & 0x01;
70      bit2 = (color_prom[i] >> 2) & 0x01;
71      r = combine_3_weights(rweights, bit0, bit1, bit2);
72
6073      /* green component */
61      bit0 = (*color_prom >> 3) & 0x01;
62      bit1 = (*color_prom >> 4) & 0x01;
63      bit2 = (*color_prom >> 5) & 0x01;
64      g = 0x21 * bit0 + 0x47 * bit1 + 0x97 * bit2;
74      bit0 = (color_prom[i] >> 3) & 0x01;
75      bit1 = (color_prom[i] >> 4) & 0x01;
76      bit2 = (color_prom[i] >> 5) & 0x01;
77      g = combine_3_weights(gweights, bit0, bit1, bit2);
78
6579      /* blue component */
66      bit0 = 0;
67      bit1 = (*color_prom >> 6) & 0x01;
68      bit2 = (*color_prom >> 7) & 0x01;
69      b = 0x21 * bit0 + 0x47 * bit1 + 0x97 * bit2;
80      bit0 = (color_prom[i] >> 6) & 0x01;
81      bit1 = (color_prom[i] >> 7) & 0x01;
82      b = combine_2_weights(bweights, bit0, bit1);
7083
71      palette_set_color(machine,i,MAKE_RGB(r,g,b));
72      color_prom++;
84      colortable_palette_set_color(machine->colortable, i, MAKE_RGB(r, g, b));
7385   }
7486
7587   /* color_prom now points to the beginning of the lookup table */
88   color_prom += 0x20;
7689
7790   /* sprites */
78   for (i = 0;i < TOTAL_COLORS(1);i++)
79      COLOR(1,i) = *(color_prom++) & 0x0f;
91   for (i = 0; i < 0x100; i++)
92   {
93      UINT8 ctabentry = color_prom[i] & 0x0f;
94      colortable_entry_set_value(machine->colortable, i, ctabentry);
95   }
8096
8197   /* characters */
82   for (i = 0;i < TOTAL_COLORS(0);i++)
83      COLOR(0,i) = (*(color_prom++) & 0x0f) + 0x10;
98   for (i = 0x100; i < 0x200; i++)
99   {
100      UINT8 ctabentry = (color_prom[i] & 0x0f) | 0x10;
101      colortable_entry_set_value(machine->colortable, i, ctabentry);
102   }
84103}
85104
86105WRITE8_HANDLER( megazone_flipscreen_w )
r1679r1680
116135         flipy = !flipy;
117136      }
118137
119      drawgfx(tmpbitmap,machine->gfx[0],
138      drawgfx(tmpbitmap,machine->gfx[1],
120139            ((int)videoram[offs]) + ((colorram[offs] & (1<<7) ? 256 : 0) ),
121140            (colorram[offs] & 0x0f) + 0x10,
122141            flipx,flipy,
r1679r1680
149168   {
150169      for (offs = spriteram_size-4; offs >= 0;offs -= 4)
151170      {
152         int sx,sy,flipx,flipy;
171         int sx = spriteram[offs + 3];
172         int sy = 255-((spriteram[offs + 1]+16)&0xff);
173         int color =  spriteram[offs + 0] & 0x0f;
174         int flipx = ~spriteram[offs + 0] & 0x40;
175         int flipy =  spriteram[offs + 0] & 0x80;
153176
177         if (flipscreen)
178         {
179            sx = sx - 11;
180            sy = sy + 2;
181         }
182         else
183            sx = sx + 32;
154184
155         sx = spriteram[offs + 3];
156         if (flipscreen) sx-=11; else sx+=4*8;        // Sprite y-position correction depending on screen flip
157         sy = 255-((spriteram[offs + 1]+16)&0xff);
158         if (flipscreen) sy+=2;                 // Sprite x-position correction depending on screen flip
159
160         flipx = ~spriteram[offs+0] & 0x40;
161         flipy = spriteram[offs+0] & 0x80;
162
163         drawgfx(bitmap,machine->gfx[1],
185         drawgfx(bitmap,machine->gfx[0],
164186               spriteram[offs + 2],
165               spriteram[offs + 0] & 0x0f,
187               color,
166188               flipx,flipy,
167189               sx,sy,
168               cliprect,TRANSPARENCY_COLOR,0);
190               cliprect,TRANSPARENCY_PENS,
191               colortable_get_transpen_mask(machine->colortable, machine->gfx[0], color, 0));
169192      }
170193   }
171194
r1679r1680
193216
194217
195218
196         drawgfx(bitmap,machine->gfx[0],
219         drawgfx(bitmap,machine->gfx[1],
197220               ((int)megazone_videoram2[offs]) + ((megazone_colorram2[offs] & (1<<7) ? 256 : 0) ),
198221               (megazone_colorram2[offs] & 0x0f) + 0x10,
199222               flipx,flipy,
src/mame/video/pass.c
r1679r1680
5959
6060VIDEO_START( pass )
6161{
62   pass_bg_tilemap = tilemap_create(get_pass_bg_tile_info,tilemap_scan_rows,TILEMAP_TYPE_PEN, 8, 8,64,32);
63   pass_fg_tilemap = tilemap_create(get_pass_fg_tile_info,tilemap_scan_rows,TILEMAP_TYPE_PEN, 4, 4,128,64);
62   pass_bg_tilemap = tilemap_create(get_pass_bg_tile_info,tilemap_scan_rows, 8, 8,64,32);
63   pass_fg_tilemap = tilemap_create(get_pass_fg_tile_info,tilemap_scan_rows, 4, 4,128,64);
6464
6565   tilemap_set_transparent_pen(pass_fg_tilemap,255);
6666}
src/mame/video/toki.c
r1679r1680
9898
9999VIDEO_START( toki )
100100{
101   text_layer       = tilemap_create(get_text_tile_info,tilemap_scan_rows,TILEMAP_TYPE_PEN,  8,8,32,32);
102   background_layer = tilemap_create(get_back_tile_info,tilemap_scan_rows,TILEMAP_TYPE_PEN,16,16,32,32);
103   foreground_layer = tilemap_create(get_fore_tile_info,tilemap_scan_rows,TILEMAP_TYPE_PEN,16,16,32,32);
101   text_layer       = tilemap_create(get_text_tile_info,tilemap_scan_rows,  8,8,32,32);
102   background_layer = tilemap_create(get_back_tile_info,tilemap_scan_rows,16,16,32,32);
103   foreground_layer = tilemap_create(get_fore_tile_info,tilemap_scan_rows,16,16,32,32);
104104
105105   tilemap_set_transparent_pen(text_layer,15);
106106   tilemap_set_transparent_pen(background_layer,15);
src/mame/video/40love.c
r1679r1680
110110   pixel_bitmap1 = auto_bitmap_alloc(256,256,machine->screen[0].format);
111111   pixel_bitmap2 = auto_bitmap_alloc(256,256,machine->screen[0].format);
112112
113   background  = tilemap_create(get_bg_tile_info, tilemap_scan_rows,TILEMAP_TYPE_PEN, 8,8,64,32);
113   background  = tilemap_create(get_bg_tile_info, tilemap_scan_rows, 8,8,64,32);
114114
115115   tilemap_set_scroll_rows(background,32);
116116   tilemap_set_transparent_pen(background,0);
src/mame/video/renegade.c
r1679r1680
7070
7171VIDEO_START( renegade )
7272{
73   bg_tilemap = tilemap_create(get_bg_tilemap_info, tilemap_scan_rows, TILEMAP_TYPE_PEN,     16, 16, 64, 16);
74   fg_tilemap = tilemap_create(get_fg_tilemap_info, tilemap_scan_rows, TILEMAP_TYPE_PEN,  8, 8, 32, 32);
73   bg_tilemap = tilemap_create(get_bg_tilemap_info, tilemap_scan_rows,      16, 16, 64, 16);
74   fg_tilemap = tilemap_create(get_fg_tilemap_info, tilemap_scan_rows,   8, 8, 32, 32);
7575
7676   tilemap_set_transparent_pen(fg_tilemap, 0);
7777   tilemap_set_scrolldx(bg_tilemap, 256, 0);
src/mame/video/galaga.c
r1679r1680
440440
441441VIDEO_START( galaga )
442442{
443   tx_tilemap = tilemap_create(get_tile_info,tilemap_scan,TILEMAP_TYPE_PEN,8,8,36,28);
443   tx_tilemap = tilemap_create(get_tile_info,tilemap_scan,8,8,36,28);
444444   colortable_configure_tilemap_groups(machine->colortable, tx_tilemap, machine->gfx[0], 0x1f);
445445
446446   galaga_gfxbank = 0;
src/mame/video/lasso.c
r1679r1680
174174VIDEO_START( lasso )
175175{
176176   /* create tilemap */
177   bg_tilemap = tilemap_create(lasso_get_bg_tile_info, tilemap_scan_rows, TILEMAP_TYPE_PEN, 8,8, 32,32);
177   bg_tilemap = tilemap_create(lasso_get_bg_tile_info, tilemap_scan_rows, 8,8, 32,32);
178178
179179   /* register for saving */
180180   state_save_register_global(gfxbank);
r1679r1680
183183VIDEO_START( wwjgtin )
184184{
185185   /* create tilemaps */
186   bg_tilemap =    tilemap_create(lasso_get_bg_tile_info,      tilemap_scan_rows, TILEMAP_TYPE_PEN, 8, 8,  32,  32);
187   track_tilemap = tilemap_create(wwjgtin_get_track_tile_info, tilemap_scan_rows, TILEMAP_TYPE_PEN,      16,16, 0x80,0x40);
186   bg_tilemap =    tilemap_create(lasso_get_bg_tile_info,      tilemap_scan_rows,  8, 8,  32,  32);
187   track_tilemap = tilemap_create(wwjgtin_get_track_tile_info, tilemap_scan_rows,       16,16, 0x80,0x40);
188188
189189   tilemap_set_transparent_pen(bg_tilemap,0);
190190
r1679r1680
196196VIDEO_START( pinbo )
197197{
198198   /* create tilemap */
199   bg_tilemap = tilemap_create(pinbo_get_bg_tile_info, tilemap_scan_rows, TILEMAP_TYPE_PEN, 8,8, 32,32);
199   bg_tilemap = tilemap_create(pinbo_get_bg_tile_info, tilemap_scan_rows, 8,8, 32,32);
200200
201201   /* register for saving */
202202   state_save_register_global(gfxbank);
src/mame/video/psychic5.c
r1679r1680
283283   memset(jal_blend_table,0,0xc00) ;
284284
285285   bg_tilemap = tilemap_create(get_bg_tile_info, tilemap_scan_cols,
286      TILEMAP_TYPE_PEN, 16, 16, 64, 32);
286      16, 16, 64, 32);
287287
288288   fg_tilemap = tilemap_create(get_fg_tile_info, tilemap_scan_cols,
289      TILEMAP_TYPE_PEN, 8, 8, 32, 32);
289      8, 8, 32, 32);
290290
291291   tilemap_set_transparent_pen(fg_tilemap, 15);
292292}
src/mame/video/ginganin.c
r1679r1680
142142
143143VIDEO_START( ginganin )
144144{
145   bg_tilemap = tilemap_create(get_bg_tile_info,tilemap_scan_cols,TILEMAP_TYPE_PEN,16,16,BG_NX,BG_NY);
146   fg_tilemap = tilemap_create(get_fg_tile_info,tilemap_scan_cols,TILEMAP_TYPE_PEN,16,16,FG_NX,FG_NY);
147   tx_tilemap = tilemap_create(get_txt_tile_info,tilemap_scan_rows,TILEMAP_TYPE_PEN,8,8,TXT_NX,TXT_NY);
145   bg_tilemap = tilemap_create(get_bg_tile_info,tilemap_scan_cols,16,16,BG_NX,BG_NY);
146   fg_tilemap = tilemap_create(get_fg_tile_info,tilemap_scan_cols,16,16,FG_NX,FG_NY);
147   tx_tilemap = tilemap_create(get_txt_tile_info,tilemap_scan_rows,8,8,TXT_NX,TXT_NY);
148148
149149   tilemap_set_transparent_pen(fg_tilemap,15);
150150   tilemap_set_transparent_pen(tx_tilemap,15);
src/mame/video/tail2nos.c
r1679r1680
5252
5353VIDEO_START( tail2nos )
5454{
55   bg_tilemap = tilemap_create(get_tile_info,tilemap_scan_rows,TILEMAP_TYPE_PEN,8,8,64,32);
55   bg_tilemap = tilemap_create(get_tile_info,tilemap_scan_rows,8,8,64,32);
5656
5757   K051316_vh_start_0(machine,REGION_GFX3,-4,TRUE,0,zoom_callback);
5858
src/mame/video/quasar.c
r1679r1680
1919#include "video/s2636.h"
2020#include "cpu/s2650/s2650.h"
2121
22#ifdef LSB_FIRST
23#define BL0 0
24#define BL1 1
25#define BL2 2
26#define BL3 3
27#define WL0 0
28#define WL1 1
29#else
30#define BL0 3
31#define BL1 2
32#define BL2 1
33#define BL3 0
34#define WL0 1
35#define WL1 0
36#endif
3722
38
39// Used here
40//static int    scroll[8];
41//static int    scroll_reg = 0;
42
4323UINT8 *quasar_effectram;
44int quasar_effectcontrol;
24UINT8 quasar_effectcontrol;
4525
46static mame_bitmap *effect_bitmap;
47static mame_bitmap *background_bitmap;
26static s2636_t *s2636_0, *s2636_1, *s2636_2;
4827
4928PALETTE_INIT( quasar )
5029{
51   int i,col,map;
30   int i;
5231
53   #define COLOR(gfxn,offs) (colortable[machine->drv->gfxdecodeinfo[gfxn].color_codes_start + offs])
32   /* allocate the colortable */
33   machine->colortable = colortable_alloc(machine, 0x500);
5434
55   // Standard 1 bit per colour palette (background and sprites)
56
57   for(col = 0;col < 8; col++)
35   /* standard 1 bit per color palette (background and sprites) */
36   for (i = 0; i < 8; i++)
5837   {
59      palette_set_color_rgb(machine,col,pal1bit(col >> 0),pal1bit(col >> 1),pal1bit(col >> 2));
38      rgb_t color = MAKE_RGB(pal1bit(i >> 0), pal1bit(i >> 1), pal1bit(i >> 2));
39      colortable_palette_set_color(machine->colortable, i, color);
6040   }
6141
62   // Address 0-2 from graphic rom
63   //         3-5 from colour ram
64   //         6-8 from sprite chips (Used for priority)
65
66   for(col = 0; col < 512; col++)
42   /* effects color map */
43   for (i = 0; i < 0x100; i++)
6744   {
68      COLOR(0,col) = color_prom[col] & 7;
69   }
45      rgb_t color;
46      int bit0, bit1, bit2;
47      int r, g, b;
7048
71   /* Background for collision */
72
73   COLOR(0,512) = 0;         // Black
74   for(col=1;col<8;col++)      // White
75      COLOR(0,512+col) = 7;
76
77   /* Effects Colour Map */
78
79   for (i = 0;i < 256;i++)
80   {
81      int bit0,bit1,bit2,r,g,b;
82
8349      /* red component */
84      bit0 = BIT(i,0);
85      bit1 = BIT(i,1);
86      bit2 = BIT(i,2);
50      bit0 = BIT(i, 0);
51      bit1 = BIT(i, 1);
52      bit2 = BIT(i, 2);
8753      r = 0x21 * bit0 + 0x47 * bit1 + 0x97 * bit2;
54
8855      /* green component */
89      bit0 = BIT(i,3);
90      bit1 = BIT(i,4);
91      bit2 = BIT(i,5);
56      bit0 = BIT(i, 3);
57      bit1 = BIT(i, 4);
58      bit2 = BIT(i, 5);
9259      g = 0x21 * bit0 + 0x47 * bit1 + 0x97 * bit2;
60
9361      /* blue component */
94      bit0 = BIT(i,6);
95      bit1 = BIT(i,7);
62      bit0 = BIT(i, 6);
63      bit1 = BIT(i, 7);
9664      b = 0x4f * bit0 + 0xa8 * bit1;
9765
98      // Intensity 1
99         palette_set_color_rgb(machine,256+i,r>>2,g>>2,b>>2);
66      /* intensity 0 */
67         colortable_palette_set_color(machine->colortable, 0x100 + i, RGB_BLACK);
10068
101      // Intensity 2
102        palette_set_color_rgb(machine,512+i,(r>>2)+(r>>3),(g>>2)+(g>>3),(b>>2)+(b>>2));
69      /* intensity 1 */
70      color = MAKE_RGB(r >> 2, g >> 2, b >> 2);
71         colortable_palette_set_color(machine->colortable, 0x200 + i, color);
10372
104      // Intensity 3
105         palette_set_color_rgb(machine,768+i,r>>1,g>>1,b>>1);
73      /* intensity 2 */
74      color = MAKE_RGB((r >> 2) + (r >> 3), (g >> 2) + (g >> 3), (b >> 2) + (b >> 2));
75        colortable_palette_set_color(machine->colortable, 0x300 + i, color);
76
77      /* intensity 3 */
78      color = MAKE_RGB(r >> 1, g >> 1, b >> 1);
79         colortable_palette_set_color(machine->colortable, 0x400 + i, color);
10680   }
10781
108    /* Sprites */
82   // Address 0-2 from graphic rom
83   //         3-5 from color ram
84   //         6-8 from sprite chips (Used for priority)
85   for (i = 0; i < 0x200; i++)
86      colortable_entry_set_value(machine->colortable, i, color_prom[i] & 0x07);
10987
110    for(map=0;map<8;map++)
111    {
112       COLOR(0,map*2 + 2072) = 0;
113       COLOR(0,map*2 + 2073) = 8 + map;
114    }
88   /* background for collision */
89   for (i = 1; i < 8; i++)
90      colortable_entry_set_value(machine->colortable, 0x200 + i, 7);
91   colortable_entry_set_value(machine->colortable, 0x200, 0);
11592
116    /* Set Sprite chip offsets */
117
118   s2636_x_offset = -26;
119   s2636_y_offset = 3;
93   /* effects */
94   for (i = 0; i < 0x400; i++)
95      colortable_entry_set_value(machine->colortable, 0x208 + i, 0x100 + i);
12096}
12197
98
12299VIDEO_START( quasar )
123100{
124   quasar_effectram   = auto_malloc(0x400);
101   quasar_effectram = auto_malloc(0x400);
125102
126   effect_bitmap = auto_bitmap_alloc(machine->screen[0].width,machine->screen[0].height,machine->screen[0].format);
127   background_bitmap = auto_bitmap_alloc(machine->screen[0].width, machine->screen[0].height, machine->screen[0].format);
103   /* configure the S2636 chips */
104   s2636_0 = s2636_config(cvs_s2636_0_ram, machine->screen[0].height, machine->screen[0].width, CVS_S2636_Y_OFFSET, CVS_S2636_X_OFFSET);
105   s2636_1 = s2636_config(cvs_s2636_1_ram, machine->screen[0].height, machine->screen[0].width, CVS_S2636_Y_OFFSET, CVS_S2636_X_OFFSET);
106   s2636_2 = s2636_config(cvs_s2636_2_ram, machine->screen[0].height, machine->screen[0].width, CVS_S2636_Y_OFFSET, CVS_S2636_X_OFFSET);
128107
129   VIDEO_START_CALL(cvs);
108   /* create helper bitmaps */
109   cvs_collision_background = auto_bitmap_alloc(machine->screen[0].width, machine->screen[0].height, machine->screen[0].format);
130110}
131111
132112VIDEO_UPDATE( quasar )
133113{
134   int offs,character;
135   int sx,sy, ox, oy;
136    int forecolor;
114   int offs;
115   mame_bitmap *s2636_0_bitmap;
116   mame_bitmap *s2636_1_bitmap;
117   mame_bitmap *s2636_2_bitmap;
137118
138   /* for every character in the Video RAM, check if it has been modified */
139   /* since last time and update it accordingly. */
140
119   /* for every character in the video RAM */
141120   for (offs = 0; offs < 0x0400; offs++)
142121   {
143        character = cvs_video_ram[offs];
122      int ox, oy;
123        UINT8 code = cvs_video_ram[offs];
144124
145      sx = (offs % 32) * 8;
146      sy = (offs / 32) * 8;
125      UINT8 x = (offs & 0x1f) << 3;
126      UINT8 y = (offs >> 5) << 3;
147127
148128      // While we have the current character code, draw the effects layer
149129      // intensity / on and off controlled by latch
150130
151      if (quasar_effectcontrol == 0x30)
152         forecolor = 0;
153      else
154         forecolor = quasar_effectram[offs] + (256 * (((quasar_effectcontrol >> 4) ^ 3) & 3));
131      int forecolor = 0x208 + quasar_effectram[offs] + (256 * (((quasar_effectcontrol >> 4) ^ 3) & 3));
155132
156133      for(ox=0;ox<8;ox++)
157134         for(oy=0;oy<8;oy++)
158            *BITMAP_ADDR16(effect_bitmap, sy+oy, sx+ox) = forecolor;
135            *BITMAP_ADDR16(bitmap, y+oy, x+ox) = forecolor;
159136
160137      /* Main Screen */
161138
162      drawgfx(background_bitmap,machine->gfx[0],
163            character,
164            cvs_color_ram[offs],
139      drawgfx(bitmap,machine->gfx[0],
140            code,
141            cvs_color_ram[offs] & 0x3f,
165142            0,0,
166            sx,sy,
167            0,TRANSPARENCY_NONE,0);
143            x,y,
144            cliprect,TRANSPARENCY_PEN,0);
168145
169146
170147      /* background for Collision Detection (it can only hit certain items) */
r1679r1680
172149      if((cvs_color_ram[offs] & 7) == 0)
173150      {
174151         drawgfx(cvs_collision_background,machine->gfx[0],
175               character,
152               code,
176153               64,
177154               0,0,
178               sx,sy,
179               0,TRANSPARENCY_NONE,0);
155               x,y,
156               cliprect,TRANSPARENCY_NONE,0);
180157      }
181158   }
182159
183    /* Update screen */
160    /* update the S2636 chips */
161   s2636_0_bitmap = s2636_update(s2636_0, cliprect);
162   s2636_1_bitmap = s2636_update(s2636_1, cliprect);
163   s2636_2_bitmap = s2636_update(s2636_2, cliprect);
184164
185   copybitmap      (bitmap,effect_bitmap,    0,0,0,0,cliprect);
186   copybitmap_trans(bitmap,background_bitmap,0,0,0,0,cliprect,0);
187
188    /* 2636's */
189
190   fillbitmap(s2636_1_bitmap,0,0);
191   s2636_update_bitmap(machine,s2636_1_bitmap,s2636_1_ram,1,cvs_collision_bitmap);
192
193   fillbitmap(s2636_2_bitmap,0,0);
194   s2636_update_bitmap(machine,s2636_2_bitmap,s2636_2_ram,2,cvs_collision_bitmap);
195
196   fillbitmap(s2636_3_bitmap,0,0);
197   s2636_update_bitmap(machine,s2636_3_bitmap,s2636_3_ram,3,cvs_collision_bitmap);
198
199165    /* Bullet Hardware */
200
201166    for (offs = 8; offs < 256; offs++ )
202167    {
203168        if(cvs_bullet_ram[offs] != 0)
r1679r1680
207172            {
208173               int bx=255-9-cvs_bullet_ram[offs]-ct;
209174
210               /* Bullet/Object Collision */
175               /* bullet/object Collision */
176            if (*BITMAP_ADDR8(s2636_0_bitmap, offs, bx) != 0) cvs_collision_register |= 0x04;
177            if (*BITMAP_ADDR8(s2636_2_bitmap, offs, bx) != 0) cvs_collision_register |= 0x08;
211178
212            if (*BITMAP_ADDR8(s2636_1_bitmap, offs, bx) != 0) cvs_collision_register |= 4;
213            if (*BITMAP_ADDR8(s2636_3_bitmap, offs, bx) != 0) cvs_collision_register |= 8;
214
215179            *BITMAP_ADDR16(bitmap, offs, bx) = machine->pens[7];
216180            }
217181        }
218182    }
219183
220    /* Update 2636 images */
221184
222    {
223        UINT32 S1,S2,S3,SB,pen;
185   /* mix and copy the S2636 images into the main bitmap, also check for collision */
186   {
187      int y;
224188
225        for(sx=255;sx>7;sx--)
226        {
227           UINT32 *sp1 = (UINT32 *)BITMAP_ADDR8(s2636_1_bitmap, sx, 0);
228          UINT32 *sp2 = (UINT32 *)BITMAP_ADDR8(s2636_2_bitmap, sx, 0);
229          UINT32 *sp3 = (UINT32 *)BITMAP_ADDR8(s2636_3_bitmap, sx, 0);
230           UINT64 *dst = (UINT64 *)BITMAP_ADDR16(bitmap, sx, 0);
231          UINT8  *spb = (UINT8  *)BITMAP_ADDR8(cvs_collision_background, sx, 0);
189      for (y = cliprect->min_y; y <= cliprect->max_y; y++)
190      {
191         int x;
232192
233            for(offs=0;offs<62;offs++)
234            {
235                S1 = (*sp1++);
236                 S2 = (*sp2++);
237                 S3 = (*sp3++);
193         for (x = cliprect->min_x; x <= cliprect->max_x; x++)
194         {
195            int pixel0 = *BITMAP_ADDR8(s2636_0_bitmap, y, x);
196            int pixel1 = *BITMAP_ADDR8(s2636_1_bitmap, y, x);
197            int pixel2 = *BITMAP_ADDR8(s2636_2_bitmap, y, x);
238198
239                pen = S1 | S2 | S3;
199            int pixel = pixel0 | pixel1 | pixel2;
240200
241                 if(pen)
242                 {
243                    UINT16 *address = (UINT16 *)dst;
244                if (pen & 0xff000000) address[BL3] = machine->pens[(pen >> 24) & 15];
245                if (pen & 0x00ff0000) address[BL2] = machine->pens[(pen >> 16) & 15];
246                if (pen & 0x0000ff00) address[BL1] = machine->pens[(pen >>  8) & 15];
247                if (pen & 0x000000ff) address[BL0] = machine->pens[(pen & 15)];
201            if (S2636_IS_PIXEL_DRAWN(pixel))
202            {
203               *BITMAP_ADDR16(bitmap, y, x) = machine->pens[S2636_PIXEL_COLOR(pixel)];
248204
249                    /* Collision Detection */
205               /* S2636 vs. background collision detection */
206               if (colortable_entry_get_value(machine->colortable, *BITMAP_ADDR16(cvs_collision_background, y, x)))
207               {
208                  if (S2636_IS_PIXEL_DRAWN(pixel0)) cvs_collision_register |= 0x01;
209                  if (S2636_IS_PIXEL_DRAWN(pixel2)) cvs_collision_register |= 0x02;
210               }
211            }
212         }
213      }
214   }
250215
251                    SB = 0;
252                if (spb[BL3] != machine->pens[0]) SB =  0x08000000;
253                if (spb[BL2] != machine->pens[0]) SB |= 0x00080000;
254                if (spb[BL1] != machine->pens[0]) SB |= 0x00000800;
255                if (spb[BL0] != machine->pens[0]) SB |= 0x00000008;
256
257                    if (SB)
258                    {
259                     if (S1 & SB) cvs_collision_register |= 1;
260                          if (S3 & SB) cvs_collision_register |= 2;
261                    }
262                 }
263
264                   dst++;
265                 spb+=4;
266            }
267        }
268    }
269216   return 0;
270217}
src/mame/video/mrjong.c
r1679r1680
9393VIDEO_START( mrjong )
9494{
9595   bg_tilemap = tilemap_create(get_bg_tile_info, tilemap_scan_rows_flip_xy,
96      TILEMAP_TYPE_PEN, 8, 8, 32, 32);
96      8, 8, 32, 32);
9797}
9898
9999static void draw_sprites(running_machine *machine, mame_bitmap *bitmap, const rectangle *cliprect)
src/mame/video/xyonix.c
r1679r1680
5353
5454VIDEO_START(xyonix)
5555{
56   xyonix_tilemap = tilemap_create(get_xyonix_tile_info,tilemap_scan_rows,TILEMAP_TYPE_PEN, 4, 8,80,32);
56   xyonix_tilemap = tilemap_create(get_xyonix_tile_info,tilemap_scan_rows, 4, 8,80,32);
5757}
5858
5959VIDEO_UPDATE(xyonix)
src/mame/video/victory.c
r1679r1680
531531
532532   if (!micro.timer)
533533   {
534      timer_adjust(micro.timer, attotime_never, 0, attotime_zero);
534      timer_adjust_oneshot(micro.timer, attotime_never, 0);
535535      micro.timer_active = 1;
536536      micro.endtime = state_time;
537537   }
538538   else if (attotime_compare(timer_timeelapsed(micro.timer), micro.endtime) > 0)
539539   {
540      timer_adjust(micro.timer, attotime_never, 0, attotime_zero);
540      timer_adjust_oneshot(micro.timer, attotime_never, 0);
541541      micro.timer_active = 1;
542542      micro.endtime = state_time;
543543   }
src/mame/video/1943.c
r1679r1680
181181VIDEO_START( 1943 )
182182{
183183   bg2_tilemap = tilemap_create(c1943_get_bg2_tile_info, tilemap_scan_cols,
184      TILEMAP_TYPE_PEN, 32, 32, 2048, 8);
184      32, 32, 2048, 8);
185185
186186   bg_tilemap = tilemap_create(c1943_get_bg_tile_info, tilemap_scan_cols,
187      TILEMAP_TYPE_PEN, 32, 32, 2048, 8);
187      32, 32, 2048, 8);
188188
189189   fg_tilemap = tilemap_create(c1943_get_fg_tile_info, tilemap_scan_rows,
190      TILEMAP_TYPE_PEN, 8, 8, 32, 32);
190      8, 8, 32, 32);
191191
192192   colortable_configure_tilemap_groups(machine->colortable, bg_tilemap, machine->gfx[1], 0x0f);
193193   tilemap_set_transparent_pen(fg_tilemap, 0);
src/mame/video/pacland.c
r1679r1680
206206   fg_bitmap = auto_bitmap_alloc(machine->screen[0].width,machine->screen[0].height,machine->screen[0].format);
207207   fillbitmap(fg_bitmap, 0xffff, NULL);
208208
209   bg_tilemap = tilemap_create(get_bg_tile_info,tilemap_scan_rows,TILEMAP_TYPE_PEN,8,8,64,32);
210   fg_tilemap = tilemap_create(get_fg_tile_info,tilemap_scan_rows,TILEMAP_TYPE_PEN,8,8,64,32);
209   bg_tilemap = tilemap_create(get_bg_tile_info,tilemap_scan_rows,8,8,64,32);
210   fg_tilemap = tilemap_create(get_fg_tile_info,tilemap_scan_rows,8,8,64,32);
211211
212212   tilemap_set_scroll_rows(fg_tilemap, 32);
213213
src/mame/video/jcross.c
r1679r1680
9696   stuff_palette( machine, 0, 0, 16*8 );
9797   stuff_palette( machine, 16*8*3, 16*8, 16*8 );
9898
99   bg_tilemap = tilemap_create(get_bg_tilemap_info,tilemap_scan_cols,TILEMAP_TYPE_PEN,8,8,64,64);
100   tx_tilemap = tilemap_create(get_tx_tilemap_info,tilemap_scan_cols,TILEMAP_TYPE_PEN,8,8,32,32);
99   bg_tilemap = tilemap_create(get_bg_tilemap_info,tilemap_scan_cols,8,8,64,64);
100   tx_tilemap = tilemap_create(get_tx_tilemap_info,tilemap_scan_cols,8,8,32,32);
101101
102102   tilemap_set_transparent_pen(tx_tilemap,0xf);
103103   tilemap_set_scrolldx( bg_tilemap,   16, 22 );
src/mame/video/popper.c
r1679r1680
156156
157157VIDEO_START( popper )
158158{
159   popper_p123_tilemap    = tilemap_create( get_popper_p123_tile_info,   tilemap_scan_cols,TILEMAP_TYPE_PEN,8,8,33,32 );
160   popper_p0_tilemap      = tilemap_create( get_popper_p0_tile_info,     tilemap_scan_cols,TILEMAP_TYPE_PEN,8,8,33,32 );
161   popper_ol_p123_tilemap = tilemap_create( get_popper_ol_p123_tile_info,tilemap_scan_cols,TILEMAP_TYPE_PEN,8,8,2 ,32 );
162   popper_ol_p0_tilemap   = tilemap_create( get_popper_ol_p0_tile_info,  tilemap_scan_cols,TILEMAP_TYPE_PEN,8,8,2 ,32 );
159   popper_p123_tilemap    = tilemap_create( get_popper_p123_tile_info,   tilemap_scan_cols,8,8,33,32 );
160   popper_p0_tilemap      = tilemap_create( get_popper_p0_tile_info,     tilemap_scan_cols,8,8,33,32 );
161   popper_ol_p123_tilemap = tilemap_create( get_popper_ol_p123_tile_info,tilemap_scan_cols,8,8,2 ,32 );
162   popper_ol_p0_tilemap   = tilemap_create( get_popper_ol_p0_tile_info,  tilemap_scan_cols,8,8,2 ,32 );
163163
164164   tilemap_set_transmask(popper_p123_tilemap,   0,0x0f,0x01);
165165   tilemap_set_transmask(popper_p123_tilemap,   1,0x01,0x0f);
src/mame/video/ddrible.c
r1679r1680
134134
135135VIDEO_START( ddrible )
136136{
137   fg_tilemap = tilemap_create(get_fg_tile_info,tilemap_scan,TILEMAP_TYPE_PEN,8,8,64,32);
138   bg_tilemap = tilemap_create(get_bg_tile_info,tilemap_scan,TILEMAP_TYPE_PEN,     8,8,64,32);
137   fg_tilemap = tilemap_create(get_fg_tile_info,tilemap_scan,8,8,64,32);
138   bg_tilemap = tilemap_create(get_bg_tile_info,tilemap_scan,     8,8,64,32);
139139
140140   tilemap_set_transparent_pen(fg_tilemap,0);
141141}
src/mame/video/ladyfrog.c
r1679r1680
137137VIDEO_START( ladyfrog )
138138{
139139  ladyfrog_spriteram = auto_malloc (160);
140  bg_tilemap = tilemap_create( get_tile_info,tilemap_scan_rows,TILEMAP_TYPE_PEN,8,8,32,32 );
140  bg_tilemap = tilemap_create( get_tile_info,tilemap_scan_rows,8,8,32,32 );
141141
142142  paletteram = auto_malloc(0x200);
143143  paletteram_2 = auto_malloc(0x200);
src/mame/video/djboy.c
r1679r1680
4545
4646VIDEO_START( djboy )
4747{
48   background = tilemap_create(get_bg_tile_info,tilemap_scan_rows,TILEMAP_TYPE_PEN,16,16,64,32);
48   background = tilemap_create(get_bg_tile_info,tilemap_scan_rows,16,16,64,32);
4949   pandora_start(0,0,0);
5050}
5151
src/mame/video/sidearms.c
r1679r1680
152152   if (!sidearms_gameid)
153153   {
154154      bg_tilemap = tilemap_create(get_sidearms_bg_tile_info, sidearms_tilemap_scan,
155         TILEMAP_TYPE_PEN, 32, 32, 128, 128);
155          32, 32, 128, 128);
156156
157157      tilemap_set_transparent_pen(bg_tilemap, 15);
158158   }
159159   else
160160   {
161      bg_tilemap = tilemap_create(get_philko_bg_tile_info, sidearms_tilemap_scan,TILEMAP_TYPE_PEN, 32, 32, 128, 128);
161      bg_tilemap = tilemap_create(get_philko_bg_tile_info, sidearms_tilemap_scan, 32, 32, 128, 128);
162162   }
163163
164164   fg_tilemap = tilemap_create(get_fg_tile_info, tilemap_scan_rows,
165      TILEMAP_TYPE_PEN, 8, 8, 64, 64);
165      8, 8, 64, 64);
166166
167167   tilemap_set_transparent_pen(fg_tilemap, 3);
168168
src/mame/video/jack.c
r1679r1680
5555
5656VIDEO_START( jack )
5757{
58   bg_tilemap = tilemap_create(get_bg_tile_info, tilemap_scan_cols_flipy, TILEMAP_TYPE_PEN, 8, 8, 32, 32);
58   bg_tilemap = tilemap_create(get_bg_tile_info, tilemap_scan_cols_flipy, 8, 8, 32, 32);
5959}
6060
6161static void jack_draw_sprites(running_machine *machine, mame_bitmap *bitmap, const rectangle *cliprect)
r1679r1680
136136
137137VIDEO_START( joinem )
138138{
139   bg_tilemap = tilemap_create(joinem_get_bg_tile_info, tilemap_scan_cols_flipy, TILEMAP_TYPE_PEN, 8, 8, 32, 32);
139   bg_tilemap = tilemap_create(joinem_get_bg_tile_info, tilemap_scan_cols_flipy, 8, 8, 32, 32);
140140}
141141
142142static void joinem_draw_sprites(running_machine *machine, mame_bitmap *bitmap, const rectangle *cliprect)
src/mame/video/dogfgt.c
r1679r1680
8181
8282VIDEO_START( dogfgt )
8383{
84   bg_tilemap = tilemap_create(get_tile_info,tilemap_scan_rows,TILEMAP_TYPE_PEN,16,16,32,32);
84   bg_tilemap = tilemap_create(get_tile_info,tilemap_scan_rows,16,16,32,32);
8585
8686   bitmapram = auto_malloc(BITMAPRAM_SIZE);
8787
src/mame/video/avgdvg.c
r1679r1680
12011201
12021202      /* If halt flag was set, let CPU catch up before we make halt visible */
12031203      if (vg->halt && !(vg->state_latch & 0x10))
1204         timer_adjust(vg_halt_timer, attotime_mul(ATTOTIME_IN_HZ(MASTER_CLOCK), cycles), 1, attotime_zero);
1204         timer_adjust_oneshot(vg_halt_timer, attotime_mul(ATTOTIME_IN_HZ(MASTER_CLOCK), cycles), 1);
12051205
12061206      vg->state_latch = (vg->halt << 4) | (vg->state_latch & 0xf);
12071207      cycles += 8;
12081208   }
12091209
1210   timer_adjust(vg_run_timer, attotime_mul(ATTOTIME_IN_HZ(MASTER_CLOCK), cycles), 0, attotime_zero);
1210   timer_adjust_oneshot(vg_run_timer, attotime_mul(ATTOTIME_IN_HZ(MASTER_CLOCK), cycles), 0);
12111211}
12121212
12131213
r1679r1680
12371237
12381238   vgc->vggo(vg);
12391239   vg_set_halt(0);
1240   timer_adjust(vg_run_timer, attotime_zero, 0, attotime_zero);
1240   timer_adjust_oneshot(vg_run_timer, attotime_zero, 0);
12411241}
12421242
12431243WRITE16_HANDLER( avgdvg_go_word_w )
src/mame/video/kingobox.c
r1679r1680
189189VIDEO_START( kingofb )
190190{
191191   bg_tilemap = tilemap_create(get_bg_tile_info, tilemap_scan_cols_flip_y,
192      TILEMAP_TYPE_PEN, 16, 16, 16, 16);
192      16, 16, 16, 16);
193193
194194   fg_tilemap = tilemap_create(get_fg_tile_info, tilemap_scan_cols_flip_y,
195      TILEMAP_TYPE_PEN, 8, 8, 32, 32);
195      8, 8, 32, 32);
196196
197197   tilemap_set_transparent_pen(fg_tilemap, 0);
198198}
r1679r1680
255255VIDEO_START( ringking )
256256{
257257   bg_tilemap = tilemap_create(ringking_get_bg_tile_info, tilemap_scan_cols_flip_y,
258      TILEMAP_TYPE_PEN, 16, 16, 16, 16);
258      16, 16, 16, 16);
259259
260260   fg_tilemap = tilemap_create(get_fg_tile_info, tilemap_scan_cols_flip_y,
261      TILEMAP_TYPE_PEN, 8, 8, 32, 32);
261      8, 8, 32, 32);
262262
263263   tilemap_set_transparent_pen(fg_tilemap, 0);
264264}
src/mame/video/galivan.c
r1679r1680
4545
4646static tilemap *bg_tilemap, *tx_tilemap;
4747
48static const UINT8 *spritepalettebank;
49
5048/* Notes:
5149     write_layers and layers are used in galivan/dangar but not ninjemak
5250     ninjemak_dispdisable is used in ninjemak but not galivan/dangar
53     spritepalettebank is set at palette init and doesn't need to be saved
5451*/
5552
5653
r1679r1680
6461PALETTE_INIT( galivan )
6562{
6663   int i;
67   #define TOTAL_COLORS(gfxn) (machine->gfx[gfxn]->total_colors * machine->gfx[gfxn]->color_granularity)
68   #define COLOR(gfxn,offs) (colortable[machine->drv->gfxdecodeinfo[gfxn].color_codes_start + offs])
6964
70   for (i = 0;i < machine->drv->total_colors;i++)
65   /* allocate the colortable */
66   machine->colortable = colortable_alloc(machine, 0x100);
67
68   /* create a lookup table for the palette */
69   for (i = 0; i < 0x100; i++)
7170   {
72      int bit0,bit1,bit2,bit3,r,g,b;
71      int r = pal4bit(color_prom[i + 0x000]);
72      int g = pal4bit(color_prom[i + 0x100]);
73      int b = pal4bit(color_prom[i + 0x200]);
7374
74      bit0 = (color_prom[0] >> 0) & 0x01;
75      bit1 = (color_prom[0] >> 1) & 0x01;
76      bit2 = (color_prom[0] >> 2) & 0x01;
77      bit3 = (color_prom[0] >> 3) & 0x01;
78      r = 0x0e * bit0 + 0x1f * bit1 + 0x43 * bit2 + 0x8f * bit3;
79      bit0 = (color_prom[machine->drv->total_colors] >> 0) & 0x01;
80      bit1 = (color_prom[machine->drv->total_colors] >> 1) & 0x01;
81      bit2 = (color_prom[machine->drv->total_colors] >> 2) & 0x01;
82      bit3 = (color_prom[machine->drv->total_colors] >> 3) & 0x01;
83      g = 0x0e * bit0 + 0x1f * bit1 + 0x43 * bit2 + 0x8f * bit3;
84      bit0 = (color_prom[2*machine->drv->total_colors] >> 0) & 0x01;
85      bit1 = (color_prom[2*machine->drv->total_colors] >> 1) & 0x01;
86      bit2 = (color_prom[2*machine->drv->total_colors] >> 2) & 0x01;
87      bit3 = (color_prom[2*machine->drv->total_colors] >> 3) & 0x01;
88      b = 0x0e * bit0 + 0x1f * bit1 + 0x43 * bit2 + 0x8f * bit3;
89
90      palette_set_color(machine,i,MAKE_RGB(r,g,b));
91      color_prom++;
75      colortable_palette_set_color(machine->colortable, i, MAKE_RGB(r, g, b));
9276   }
9377
94   color_prom += 2*machine->drv->total_colors;
95   /* color_prom now points to the beginning of the lookup tables */
78   /* color_prom now points to the beginning of the lookup table */
79   color_prom += 0x300;
9680
81   /* characters use colors 0-0x7f */
82   for (i = 0; i < 0x80; i++)
83      colortable_entry_set_value(machine->colortable, i, i);
9784
98   /* characters use colors 0-127 */
99   for (i = 0;i < TOTAL_COLORS(0);i++)
100      COLOR(0,i) = i;
101
10285   /* I think that */
103   /* background tiles use colors 192-255 in four banks */
86   /* background tiles use colors 0xc0-0xff in four banks */
10487   /* the bottom two bits of the color code select the palette bank for */
10588   /* pens 0-7; the top two bits for pens 8-15. */
106   for (i = 0;i < TOTAL_COLORS(1);i++)
89   for (i = 0; i < 0x100; i++)
10790   {
108      if (i & 8) COLOR(1,i) = 192 + (i & 0x0f) + ((i & 0xc0) >> 2);
109      else COLOR(1,i) = 192 + (i & 0x0f) + ((i & 0x30) >> 0);
110   }
91      UINT8 ctabentry;
11192
93      if (i & 0x08)
94         ctabentry = 0xc0 | (i & 0x0f) | ((i & 0xc0) >> 2);
95      else
96         ctabentry = 0xc0 | (i & 0x0f) | ((i & 0x30) >> 0);
11297
113   /* sprites use colors 128-191 in four banks */
98      colortable_entry_set_value(machine->colortable, 0x80 + i, ctabentry);
99   }
100
101   /* sprites use colors 0x80-0xbf in four banks */
114102   /* The lookup table tells which colors to pick from the selected bank */
115103   /* the bank is selected by another PROM and depends on the top 7 bits of */
116104   /* the sprite code. The PROM selects the bank *separately* for pens 0-7 and */
117105   /* 8-15 (like for tiles). */
118   for (i = 0;i < TOTAL_COLORS(2)/16;i++)
106   for (i = 0; i < 0x1000; i++)
119107   {
120      int j;
108      UINT8 ctabentry;
109      int i_swapped = ((i & 0x0f) << 8) | ((i & 0xff0) >> 4);
121110
122      for (j = 0;j < 16;j++)
123      {
124         if (i & 8)
125            COLOR(2,i + j * (TOTAL_COLORS(2)/16)) = 128 + ((j & 0x0c) << 2) + (*color_prom & 0x0f);
126         else
127            COLOR(2,i + j * (TOTAL_COLORS(2)/16)) = 128 + ((j & 0x03) << 4) + (*color_prom & 0x0f);
128      }
111      if (i & 0x80)
112         ctabentry = 0x80 | ((i & 0x0c) << 2) | (color_prom[i >> 4] & 0x0f);
113      else
114         ctabentry = 0x80 | ((i & 0x03) << 4) | (color_prom[i >> 4] & 0x0f);
129115
130      color_prom++;
116      colortable_entry_set_value(machine->colortable, 0x180 + i_swapped, ctabentry);
131117   }
132118
133   /* color_prom now points to the beginning of the sprite palette bank table */
134   spritepalettebank = color_prom;   /* we'll need it at run time */
119//  for (i = 0;i < TOTAL_COLORS(2)/16;i++)
120//  {
121//      int j;
122
123//      for (j = 0;j < 16;j++)
124//      {
125//          if (i & 8)
126//              COLOR(2,i + j * (TOTAL_COLORS(2)/16)) = 128 + ((j & 0x0c) << 2) + (*color_prom & 0x0f);
127//          else
128//              COLOR(2,i + j * (TOTAL_COLORS(2)/16)) = 128 + ((j & 0x03) << 4) + (*color_prom & 0x0f);
129//      }
130
131//      color_prom++;
132//  }
135133}
136134
137135
r1679r1680
203201   UINT8 *rombase = memory_region(REGION_CPU1);
204202   memory_configure_bank(1, 0, 2, &rombase[0x10000], 0x2000);
205203
206   bg_tilemap = tilemap_create(get_bg_tile_info,tilemap_scan_rows,TILEMAP_TYPE_PEN,   16,16,128,128);
207   tx_tilemap = tilemap_create(get_tx_tile_info,tilemap_scan_cols,TILEMAP_TYPE_PEN,8,8,32,32);
204   bg_tilemap = tilemap_create(get_bg_tile_info,tilemap_scan_rows,   16,16,128,128);
205   tx_tilemap = tilemap_create(get_tx_tile_info,tilemap_scan_cols,8,8,32,32);
208206
209207   tilemap_set_transparent_pen(tx_tilemap,15);
210208
r1679r1680
222220   UINT8 *rombase = memory_region(REGION_CPU1);
223221   memory_configure_bank(1, 0, 4, &rombase[0x10000], 0x2000);
224222
225   bg_tilemap = tilemap_create(ninjemak_get_bg_tile_info,tilemap_scan_cols,TILEMAP_TYPE_PEN,   16,16,512,32);
226   tx_tilemap = tilemap_create(ninjemak_get_tx_tile_info,tilemap_scan_cols,TILEMAP_TYPE_PEN,8,8,32,32);
223   bg_tilemap = tilemap_create(ninjemak_get_bg_tile_info,tilemap_scan_cols,   16,16,512,32);
224   tx_tilemap = tilemap_create(ninjemak_get_tx_tile_info,tilemap_scan_cols,8,8,32,32);
227225
228226   tilemap_set_transparent_pen(tx_tilemap,15);
229227
r1679r1680
367365
368366static void draw_sprites(running_machine *machine, mame_bitmap *bitmap, const rectangle *cliprect)
369367{
368   const UINT8 *spritepalettebank = memory_region(REGION_USER1);
370369   int offs;
371370
372371   /* draw the sprites */
src/mame/video/tsamurai.c
r1679r1680
5555
5656VIDEO_START( tsamurai )
5757{
58   background = tilemap_create(get_bg_tile_info,tilemap_scan_rows,TILEMAP_TYPE_PEN,8,8,32,32);
59   foreground = tilemap_create(get_fg_tile_info,tilemap_scan_rows,TILEMAP_TYPE_PEN,8,8,32,32);
58   background = tilemap_create(get_bg_tile_info,tilemap_scan_rows,8,8,32,32);
59   foreground = tilemap_create(get_fg_tile_info,tilemap_scan_rows,8,8,32,32);
6060
6161   tilemap_set_transparent_pen(background,0);
6262   tilemap_set_transparent_pen(foreground,0);
r1679r1680
255255
256256VIDEO_START( vsgongf )
257257{
258   foreground = tilemap_create(get_vsgongf_tile_info,tilemap_scan_rows,TILEMAP_TYPE_PEN,8,8,32,32);
258   foreground = tilemap_create(get_vsgongf_tile_info,tilemap_scan_rows,8,8,32,32);
259259}
260260
261261VIDEO_UPDATE( vsgongf )
src/mame/video/canyon.c
r1679r1680
3030VIDEO_START( canyon )
3131{
3232   bg_tilemap = tilemap_create(get_bg_tile_info, tilemap_scan_rows,
33      TILEMAP_TYPE_PEN, 8, 8, 32, 32);
33      8, 8, 32, 32);
3434}
3535
3636
src/mame/video/splash.c
r1679r1680
178178
179179VIDEO_START( splash )
180180{
181   bg_tilemap[0] = tilemap_create(get_tile_info_splash_tilemap0,tilemap_scan_rows,TILEMAP_TYPE_PEN, 8, 8,64,32);
182   bg_tilemap[1] = tilemap_create(get_tile_info_splash_tilemap1,tilemap_scan_rows,TILEMAP_TYPE_PEN,16,16,32,32);
181   bg_tilemap[0] = tilemap_create(get_tile_info_splash_tilemap0,tilemap_scan_rows, 8, 8,64,32);
182   bg_tilemap[1] = tilemap_create(get_tile_info_splash_tilemap1,tilemap_scan_rows,16,16,32,32);
183183
184184   tilemap_set_transparent_pen(bg_tilemap[0],0);
185185   tilemap_set_transparent_pen(bg_tilemap[1],0);
src/mame/video/f1gp.c
r1679r1680
5555
5656VIDEO_START( f1gp )
5757{
58   roz_tilemap = tilemap_create(f1gp_get_roz_tile_info,tilemap_scan_rows,TILEMAP_TYPE_PEN,16,16,64,64);
59   fg_tilemap =  tilemap_create(get_fg_tile_info,      tilemap_scan_rows,TILEMAP_TYPE_PEN, 8, 8,64,32);
58   roz_tilemap = tilemap_create(f1gp_get_roz_tile_info,tilemap_scan_rows,16,16,64,64);
59   fg_tilemap =  tilemap_create(get_fg_tile_info,      tilemap_scan_rows, 8, 8,64,32);
6060
6161   K053936_wraparound_enable(0, 1);
6262   K053936_set_offset(0, -58, -2);
r1679r1680
7171
7272VIDEO_START( f1gpb )
7373{
74   roz_tilemap = tilemap_create(f1gp_get_roz_tile_info,tilemap_scan_rows,TILEMAP_TYPE_PEN,16,16,64,64);
75   fg_tilemap =  tilemap_create(get_fg_tile_info,      tilemap_scan_rows,TILEMAP_TYPE_PEN, 8, 8,64,32);
74   roz_tilemap = tilemap_create(f1gp_get_roz_tile_info,tilemap_scan_rows,16,16,64,64);
75   fg_tilemap =  tilemap_create(get_fg_tile_info,      tilemap_scan_rows, 8, 8,64,32);
7676
7777   tilemap_set_transparent_pen(fg_tilemap,0xff);
7878
r1679r1680
8484
8585VIDEO_START( f1gp2 )
8686{
87   roz_tilemap = tilemap_create(f1gp2_get_roz_tile_info,tilemap_scan_rows,TILEMAP_TYPE_PEN,16,16,64,64);
88   fg_tilemap =  tilemap_create(get_fg_tile_info,       tilemap_scan_rows,TILEMAP_TYPE_PEN, 8, 8,64,32);
87   roz_tilemap = tilemap_create(f1gp2_get_roz_tile_info,tilemap_scan_rows,16,16,64,64);
88   fg_tilemap =  tilemap_create(get_fg_tile_info,       tilemap_scan_rows, 8, 8,64,32);
8989
9090   K053936_wraparound_enable(0, 1);
9191   K053936_set_offset(0, -48, -21);
src/mame/video/lvcards.c
r1679r1680
105105VIDEO_START( lvcards )
106106{
107107   bg_tilemap = tilemap_create(get_bg_tile_info, tilemap_scan_rows,
108      TILEMAP_TYPE_PEN, 8, 8, 32, 32);
108      8, 8, 32, 32);
109109}
110110
111111VIDEO_UPDATE( lvcards )
src/mame/video/namcos2.c
r1679r1680
323323VIDEO_START( namcos2 )
324324{
325325   namco_tilemap_init(2,memory_region(REGION_GFX4),TilemapCB);
326   tilemap_roz = tilemap_create(get_tile_info_roz,tilemap_scan_rows,TILEMAP_TYPE_PEN,8,8,256,256);
326   tilemap_roz = tilemap_create(get_tile_info_roz,tilemap_scan_rows,8,8,256,256);
327327   tilemap_set_transparent_pen(tilemap_roz,0xff);
328328   DrawSpriteInit();
329329}
src/mame/video/tx1.c
r1679r1680
477477
478478VIDEO_START( tx1 )
479479{
480   tx1_tilemap = tilemap_create(get_tx1_tile_info, tilemap_scan_rows, TILEMAP_TYPE_PEN, 8, 8, 128, 64);
480   tx1_tilemap = tilemap_create(get_tx1_tile_info, tilemap_scan_rows, 8, 8, 128, 64);
481481   tilemap_set_transparent_pen(tx1_tilemap, 0xff);
482482
483483   /* Allocate a large bitmap that covers the three screens */
r1679r1680
15661566
15671567VIDEO_START( buggyboy )
15681568{
1569   buggyboy_tilemap = tilemap_create(get_buggyboy_tile_info, tilemap_scan_rows, TILEMAP_TYPE_PEN, 8, 8, 128, 64);
1569   buggyboy_tilemap = tilemap_create(get_buggyboy_tile_info, tilemap_scan_rows, 8, 8, 128, 64);
15701570   tilemap_set_transparent_pen(buggyboy_tilemap, 0);
15711571}
15721572
src/mame/video/pingpong.c
r1679r1680
4444PALETTE_INIT( pingpong )
4545{
4646   int i;
47   #define TOTAL_COLORS(gfxn) (machine->gfx[gfxn]->total_colors * machine->gfx[gfxn]->color_granularity)
48   #define COLOR(gfxn,offs) (colortable[machine->drv->gfxdecodeinfo[gfxn].color_codes_start + offs])
4947
50   for (i = 0;i < machine->drv->total_colors;i++)
48   /* allocate the colortable */
49   machine->colortable = colortable_alloc(machine, 0x20);
50
51   /* create a lookup table for the palette */
52   for (i = 0; i < 0x20; i++)
5153   {
52      int bit0,bit1,bit2,r,g,b;
54      int bit0, bit1, bit2;
55      int r, g, b;
5356
5457      /* red component */
55      bit0 = (*color_prom >> 0) & 0x01;
56      bit1 = (*color_prom >> 1) & 0x01;
57      bit2 = (*color_prom >> 2) & 0x01;
58      bit0 = (color_prom[i] >> 0) & 0x01;
59      bit1 = (color_prom[i] >> 1) & 0x01;
60      bit2 = (color_prom[i] >> 2) & 0x01;
5861      r = 0x21 * bit0 + 0x47 * bit1 + 0x97 * bit2;
62
5963      /* green component */
60      bit0 = (*color_prom >> 3) & 0x01;
61      bit1 = (*color_prom >> 4) & 0x01;
62      bit2 = (*color_prom >> 5) & 0x01;
64      bit0 = (color_prom[i] >> 3) & 0x01;
65      bit1 = (color_prom[i] >> 4) & 0x01;
66      bit2 = (color_prom[i] >> 5) & 0x01;
6367      g = 0x21 * bit0 + 0x47 * bit1 + 0x97 * bit2;
68
6469      /* blue component */
6570      bit0 = 0;
66      bit1 = (*color_prom >> 6) & 0x01;
67      bit2 = (*color_prom >> 7) & 0x01;
71      bit1 = (color_prom[i] >> 6) & 0x01;
72      bit2 = (color_prom[i] >> 7) & 0x01;
6873      b = 0x21 * bit0 + 0x47 * bit1 + 0x97 * bit2;
6974
70      palette_set_color(machine,i,MAKE_RGB(r,g,b));
71      color_prom++;
75      colortable_palette_set_color(machine->colortable, i, MAKE_RGB(r, g, b));
7276   }
7377
74   /* color_prom now points to the beginning of the char lookup table */
78   /* color_prom now points to the beginning of the lookup table */
79   color_prom += 0x20;
7580
76   /* sprites */
77   for (i = 0;i < TOTAL_COLORS(1);i++)
81   /* characters */
82   for (i = 0; i < 0x100; i++)
7883   {
79      int code;
80      int bit0,bit1,bit2,bit3;
81
82      /* the bits of the color code are in reverse order - 0123 instead of 3210 */
83      code = *(color_prom++) & 0x0f;
84      bit0 = (code >> 0) & 1;
85      bit1 = (code >> 1) & 1;
86      bit2 = (code >> 2) & 1;
87      bit3 = (code >> 3) & 1;
88      code = (bit0 << 3) | (bit1 << 2) | (bit2 << 1) | (bit3 << 0);
89      COLOR(1,i) = code;
84      UINT8 ctabentry = (color_prom[i] & 0x0f) | 0x10;
85      colortable_entry_set_value(machine->colortable, i, ctabentry);
9086   }
9187
92   /* characters */
93   for (i = 0;i < TOTAL_COLORS(0);i++)
94      COLOR(0,i) = (*(color_prom++) & 0x0f) + 0x10;
88   /* sprites */
89   for (i = 0x100; i < 0x200; i++)
90   {
91      UINT8 ctabentry = BITSWAP8(color_prom[i],7,6,5,4,0,1,2,3);
92      colortable_entry_set_value(machine->colortable, i, ctabentry);
93   }
9594}
9695
9796WRITE8_HANDLER( pingpong_videoram_w )
r1679r1680
118117
119118VIDEO_START( pingpong )
120119{
121   bg_tilemap = tilemap_create(get_bg_tile_info, tilemap_scan_rows,
122      TILEMAP_TYPE_PEN, 8, 8, 32, 32);
120   bg_tilemap = tilemap_create(get_bg_tile_info, tilemap_scan_rows, 8, 8, 32, 32);
123121}
124122
125123static void draw_sprites(running_machine *machine, mame_bitmap *bitmap, const rectangle *cliprect )
r1679r1680
136134
137135      flipx = spriteram[offs] & 0x40;
138136      flipy = spriteram[offs] & 0x80;
139      color = spriteram[offs] & 0x1F;
140      schar = spriteram[offs + 2] & 0x7F;
137      color = spriteram[offs] & 0x1f;
138      schar = spriteram[offs + 2] & 0x7f;
141139
142140      drawgfx(bitmap,machine->gfx[1],
143141            schar,
144142            color,
145143            flipx,flipy,
146144            sx,sy,
147            &spritevisiblearea,TRANSPARENCY_COLOR,0);
145            &spritevisiblearea,TRANSPARENCY_PENS,
146            colortable_get_transpen_mask(machine->colortable, machine->gfx[1], color, 0));
148147   }
149148}
150149
src/mame/video/ssrj.c
r1679r1680
232232
233233VIDEO_START( ssrj )
234234{
235   tilemap1 = tilemap_create( get_tile_info1,tilemap_scan_rows,TILEMAP_TYPE_PEN,8,8,32,32 );
236   tilemap2 = tilemap_create( get_tile_info2,tilemap_scan_rows,TILEMAP_TYPE_PEN,8,8,32,32 );
237   tilemap4 = tilemap_create( get_tile_info4,tilemap_scan_rows,TILEMAP_TYPE_PEN,8,8,32,32 );
235   tilemap1 = tilemap_create( get_tile_info1,tilemap_scan_rows,8,8,32,32 );
236   tilemap2 = tilemap_create( get_tile_info2,tilemap_scan_rows,8,8,32,32 );
237   tilemap4 = tilemap_create( get_tile_info4,tilemap_scan_rows,8,8,32,32 );
238238   tilemap_set_transparent_pen(tilemap2,0);
239239   tilemap_set_transparent_pen(tilemap4,0);
240240}
src/mame/video/blstroid.c
r1679r1680
8282   };
8383
8484   /* initialize the playfield */
85   atarigen_playfield_tilemap = tilemap_create(get_playfield_tile_info, tilemap_scan_rows, TILEMAP_TYPE_PEN, 16,8, 64,64);
85   atarigen_playfield_tilemap = tilemap_create(get_playfield_tile_info, tilemap_scan_rows, 16,8, 64,64);
8686
8787   /* initialize the motion objects */
8888   atarimo_init(machine, 0, &modesc);
src/mame/video/gotya.c
r1679r1680
111111VIDEO_START( gotya )
112112{
113113   bg_tilemap = tilemap_create(get_bg_tile_info, tilemap_scan_rows_thehand,
114      TILEMAP_TYPE_PEN, 8, 8, 64, 32);
114      8, 8, 64, 32);
115115}
116116
117117static void draw_status_row(running_machine *machine, mame_bitmap *bitmap, const rectangle *cliprect, int sx, int col)
src/mame/video/tatsumi.c
r1679r1680
194194
195195VIDEO_START( apache3 )
196196{
197   tx_layer = tilemap_create(get_text_tile_info,tilemap_scan_rows,TILEMAP_TYPE_PEN,8,8,64,64);
197   tx_layer = tilemap_create(get_text_tile_info,tilemap_scan_rows,8,8,64,64);
198198   shadow_pen_array = auto_malloc(8192);
199199   temp_bitmap = auto_bitmap_alloc(512, 512, BITMAP_FORMAT_RGB32);
200200
r1679r1680
204204
205205VIDEO_START( roundup5 )
206206{
207   tx_layer = tilemap_create(get_text_tile_info,tilemap_scan_rows,TILEMAP_TYPE_PEN,8,8,128,64);
207   tx_layer = tilemap_create(get_text_tile_info,tilemap_scan_rows,8,8,128,64);
208208   shadow_pen_array = auto_malloc(8192);
209209   roundup5_vram = auto_malloc(0x48000 * 4);
210210
r1679r1680
214214
215215VIDEO_START( cyclwarr )
216216{
217   layer0 = tilemap_create(get_tile_info_bigfight_0,tilemap_scan_rows,TILEMAP_TYPE_PEN,8,8,64,512);
218   //layer1 = tilemap_create(get_tile_info_bigfight_0,tilemap_scan_rows,TILEMAP_TYPE_PEN,8,8,64,512);
219   layer1 = tilemap_create(get_tile_info_bigfight_0,tilemap_scan_rows,TILEMAP_TYPE_PEN,8,8,128,256);
220   layer2 = tilemap_create(get_tile_info_bigfight_1,tilemap_scan_rows,TILEMAP_TYPE_PEN,8,8,64,512);
221   layer3 = tilemap_create(get_tile_info_bigfight_1,tilemap_scan_rows,TILEMAP_TYPE_PEN,8,8,64,512);
217   layer0 = tilemap_create(get_tile_info_bigfight_0,tilemap_scan_rows,8,8,64,512);
218   //layer1 = tilemap_create(get_tile_info_bigfight_0,tilemap_scan_rows,8,8,64,512);
219   layer1 = tilemap_create(get_tile_info_bigfight_0,tilemap_scan_rows,8,8,128,256);
220   layer2 = tilemap_create(get_tile_info_bigfight_1,tilemap_scan_rows,8,8,64,512);
221   layer3 = tilemap_create(get_tile_info_bigfight_1,tilemap_scan_rows,8,8,64,512);
222222
223223   shadow_pen_array = auto_malloc(8192);
224224   memset(shadow_pen_array, 0, 8192);
r1679r1680
226226
227227VIDEO_START( bigfight )
228228{
229   layer0 = tilemap_create(get_tile_info_bigfight_0,tilemap_scan_rows,TILEMAP_TYPE_PEN,8,8,128,256);
230   layer1 = tilemap_create(get_tile_info_bigfight_0,tilemap_scan_rows,TILEMAP_TYPE_PEN,8,8,128,256);
231   layer2 = tilemap_create(get_tile_info_bigfight_1,tilemap_scan_rows,TILEMAP_TYPE_PEN,8,8,128,256);
232   layer3 = tilemap_create(get_tile_info_bigfight_1,tilemap_scan_rows,TILEMAP_TYPE_PEN,8,8,128,256);
229   layer0 = tilemap_create(get_tile_info_bigfight_0,tilemap_scan_rows,8,8,128,256);
230   layer1 = tilemap_create(get_tile_info_bigfight_0,tilemap_scan_rows,8,8,128,256);
231   layer2 = tilemap_create(get_tile_info_bigfight_1,tilemap_scan_rows,8,8,128,256);
232   layer3 = tilemap_create(get_tile_info_bigfight_1,tilemap_scan_rows,8,8,128,256);
233233
234234   shadow_pen_array = auto_malloc(8192);
235235   memset(shadow_pen_array, 0, 8192);
r1679r1680
271271   {
272272      if( gfx )
273273      {
274         const pen_t *pal = &Machine->remapped_colortable[gfx->color_base + gfx->color_granularity * (color % gfx->total_colors)];
274         const pen_t *pal = &Machine->pens[gfx->color_base + gfx->color_granularity * (color % gfx->total_colors)];
275275         const UINT8 *shadow_pens = shadow_pen_array + (gfx->color_granularity * (color % gfx->total_colors));
276276         int source_base = (code % gfx->total_elements) * gfx->height;
277277
src/mame/video/konamiic.c
r1679r1680
15261526   K007342_gfxnum = gfx_index;
15271527   K007342_callback = callback;
15281528
1529   K007342_tilemap[0] = tilemap_create(K007342_get_tile_info0,K007342_scan,TILEMAP_TYPE_PEN,8,8,64,32);
1530   K007342_tilemap[1] = tilemap_create(K007342_get_tile_info1,K007342_scan,TILEMAP_TYPE_PEN,8,8,64,32);
1529   K007342_tilemap[0] = tilemap_create(K007342_get_tile_info0,K007342_scan,8,8,64,32);
1530   K007342_tilemap[1] = tilemap_create(K007342_get_tile_info1,K007342_scan,8,8,64,32);
15311531
15321532   K007342_ram = auto_malloc(0x2000);
15331533   K007342_scroll_ram = auto_malloc(0x0200);
r1679r1680
20442044
20452045   has_extra_video_ram = 0;
20462046
2047   K052109_tilemap[0] = tilemap_create(K052109_get_tile_info0,tilemap_scan_rows,TILEMAP_TYPE_PEN,8,8,64,32);
2048   K052109_tilemap[1] = tilemap_create(K052109_get_tile_info1,tilemap_scan_rows,TILEMAP_TYPE_PEN,8,8,64,32);
2049   K052109_tilemap[2] = tilemap_create(K052109_get_tile_info2,tilemap_scan_rows,TILEMAP_TYPE_PEN,8,8,64,32);
2047   K052109_tilemap[0] = tilemap_create(K052109_get_tile_info0,tilemap_scan_rows,8,8,64,32);
2048   K052109_tilemap[1] = tilemap_create(K052109_get_tile_info1,tilemap_scan_rows,8,8,64,32);
2049   K052109_tilemap[2] = tilemap_create(K052109_get_tile_info2,tilemap_scan_rows,8,8,64,32);
20502050
20512051   K052109_ram = auto_malloc(0x6000);
20522052
r1679r1680
47034703   K051316_bpp[chip] = bpp;
47044704   K051316_callback[chip] = callback;
47054705
4706   K051316_tilemap[chip] = tilemap_create(get_tile_info[chip],tilemap_scan_rows,TILEMAP_TYPE_PEN,16,16,32,32);
4706   K051316_tilemap[chip] = tilemap_create(get_tile_info[chip],tilemap_scan_rows,16,16,32,32);
47074707
47084708   K051316_ram[chip] = auto_malloc(0x800);
47094709
r1679r1680
57825782
57835783   K056832_videoram = auto_malloc(0x2000 * (K056832_PAGE_COUNT+1));
57845784
5785   K056832_tilemap[0x0] = tilemap_create(K056832_get_tile_info0, tilemap_scan_rows, TILEMAP_TYPE_PEN, 8, 8, 64, 32);
5786   K056832_tilemap[0x1] = tilemap_create(K056832_get_tile_info1, tilemap_scan_rows, TILEMAP_TYPE_PEN, 8, 8, 64, 32);
5787   K056832_tilemap[0x2] = tilemap_create(K056832_get_tile_info2, tilemap_scan_rows, TILEMAP_TYPE_PEN, 8, 8, 64, 32);
5788   K056832_tilemap[0x3] = tilemap_create(K056832_get_tile_info3, tilemap_scan_rows, TILEMAP_TYPE_PEN, 8, 8, 64, 32);
5789   K056832_tilemap[0x4] = tilemap_create(K056832_get_tile_info4, tilemap_scan_rows, TILEMAP_TYPE_PEN, 8, 8, 64, 32);
5790   K056832_tilemap[0x5] = tilemap_create(K056832_get_tile_info5, tilemap_scan_rows, TILEMAP_TYPE_PEN, 8, 8, 64, 32);
5791   K056832_tilemap[0x6] = tilemap_create(K056832_get_tile_info6, tilemap_scan_rows, TILEMAP_TYPE_PEN, 8, 8, 64, 32);
5792   K056832_tilemap[0x7] = tilemap_create(K056832_get_tile_info7, tilemap_scan_rows, TILEMAP_TYPE_PEN, 8, 8, 64, 32);
5793   K056832_tilemap[0x8] = tilemap_create(K056832_get_tile_info8, tilemap_scan_rows, TILEMAP_TYPE_PEN, 8, 8, 64, 32);
5794   K056832_tilemap[0x9] = tilemap_create(K056832_get_tile_info9, tilemap_scan_rows, TILEMAP_TYPE_PEN, 8, 8, 64, 32);
5795   K056832_tilemap[0xa] = tilemap_create(K056832_get_tile_infoa, tilemap_scan_rows, TILEMAP_TYPE_PEN, 8, 8, 64, 32);
5796   K056832_tilemap[0xb] = tilemap_create(K056832_get_tile_infob, tilemap_scan_rows, TILEMAP_TYPE_PEN, 8, 8, 64, 32);
5797   K056832_tilemap[0xc] = tilemap_create(K056832_get_tile_infoc, tilemap_scan_rows, TILEMAP_TYPE_PEN, 8, 8, 64, 32);
5798   K056832_tilemap[0xd] = tilemap_create(K056832_get_tile_infod, tilemap_scan_rows, TILEMAP_TYPE_PEN, 8, 8, 64, 32);
5799   K056832_tilemap[0xe] = tilemap_create(K056832_get_tile_infoe, tilemap_scan_rows, TILEMAP_TYPE_PEN, 8, 8, 64, 32);
5800   K056832_tilemap[0xf] = tilemap_create(K056832_get_tile_infof, tilemap_scan_rows, TILEMAP_TYPE_PEN, 8, 8, 64, 32);
5785   K056832_tilemap[0x0] = tilemap_create(K056832_get_tile_info0, tilemap_scan_rows,  8, 8, 64, 32);
5786   K056832_tilemap[0x1] = tilemap_create(K056832_get_tile_info1, tilemap_scan_rows,  8, 8, 64, 32);
5787   K056832_tilemap[0x2] = tilemap_create(K056832_get_tile_info2, tilemap_scan_rows,  8, 8, 64, 32);
5788   K056832_tilemap[0x3] = tilemap_create(K056832_get_tile_info3, tilemap_scan_rows,  8, 8, 64, 32);
5789   K056832_tilemap[0x4] = tilemap_create(K056832_get_tile_info4, tilemap_scan_rows,  8, 8, 64, 32);
5790   K056832_tilemap[0x5] = tilemap_create(K056832_get_tile_info5, tilemap_scan_rows,  8, 8, 64, 32);
5791   K056832_tilemap[0x6] = tilemap_create(K056832_get_tile_info6, tilemap_scan_rows,  8, 8, 64, 32);
5792   K056832_tilemap[0x7] = tilemap_create(K056832_get_tile_info7, tilemap_scan_rows,  8, 8, 64, 32);
5793   K056832_tilemap[0x8] = tilemap_create(K056832_get_tile_info8, tilemap_scan_rows,  8, 8, 64, 32);
5794   K056832_tilemap[0x9] = tilemap_create(K056832_get_tile_info9, tilemap_scan_rows,  8, 8, 64, 32);
5795   K056832_tilemap[0xa] = tilemap_create(K056832_get_tile_infoa, tilemap_scan_rows,  8, 8, 64, 32);
5796   K056832_tilemap[0xb] = tilemap_create(K056832_get_tile_infob, tilemap_scan_rows,  8, 8, 64, 32);
5797   K056832_tilemap[0xc] = tilemap_create(K056832_get_tile_infoc, tilemap_scan_rows,  8, 8, 64, 32);
5798   K056832_tilemap[0xd] = tilemap_create(K056832_get_tile_infod, tilemap_scan_rows,  8, 8, 64, 32);
5799   K056832_tilemap[0xe] = tilemap_create(K056832_get_tile_infoe, tilemap_scan_rows,  8, 8, 64, 32);
5800   K056832_tilemap[0xf] = tilemap_create(K056832_get_tile_infof, tilemap_scan_rows,  8, 8, 64, 32);
58015801
58025802   for (i=0; i<K056832_PAGE_COUNT; i++)
58035803   {
src/mame/video/blmbycar.c
r1679r1680
127127VIDEO_START( blmbycar )
128128{
129129   tilemap_0 = tilemap_create(   get_tile_info_0, tilemap_scan_rows,
130                        TILEMAP_TYPE_PEN, 16,16, DIM_NX, DIM_NY );
130                        16,16, DIM_NX, DIM_NY );
131131
132132   tilemap_1 = tilemap_create(   get_tile_info_1, tilemap_scan_rows,
133                        TILEMAP_TYPE_PEN, 16,16, DIM_NX, DIM_NY );
133                        16,16, DIM_NX, DIM_NY );
134134
135135      tilemap_set_scroll_rows(tilemap_0,1);
136136      tilemap_set_scroll_cols(tilemap_0,1);
src/mame/video/retofinv.c
r1679r1680
2020PALETTE_INIT( retofinv )
2121{
2222   int i;
23   #define TOTAL_COLORS(gfxn) (machine->gfx[gfxn]->total_colors * machine->gfx[gfxn]->color_granularity)
24   #define COLOR(gfxn,offs) (colortable[machine->drv->gfxdecodeinfo[gfxn].color_codes_start + offs])
2523
24   /* allocate the colortable */
25   machine->colortable = colortable_alloc(machine, 0x100);
2626
27   for (i = 0;i < machine->drv->total_colors;i++)
27   /* create a lookup table for the palette */
28   for (i = 0; i < 0x100; i++)
2829   {
29      int bit0,bit1,bit2,bit3,r,g,b;
30      int r = pal4bit(color_prom[i + 0x000]);
31      int g = pal4bit(color_prom[i + 0x100]);
32      int b = pal4bit(color_prom[i + 0x200]);
3033
31      bit0 = (color_prom[i + 0*machine->drv->total_colors] >> 0) & 0x01;
32      bit1 = (color_prom[i + 0*machine->drv->total_colors] >> 1) & 0x01;
33      bit2 = (color_prom[i + 0*machine->drv->total_colors] >> 2) & 0x01;
34      bit3 = (color_prom[i + 0*machine->drv->total_colors] >> 3) & 0x01;
35      r = 0x0e * bit0 + 0x1f * bit1 + 0x43 * bit2 + 0x8f * bit3;
36
37      bit0 = (color_prom[i + 1*machine->drv->total_colors] >> 0) & 0x01;
38      bit1 = (color_prom[i + 1*machine->drv->total_colors] >> 1) & 0x01;
39      bit2 = (color_prom[i + 1*machine->drv->total_colors] >> 2) & 0x01;
40      bit3 = (color_prom[i + 1*machine->drv->total_colors] >> 3) & 0x01;
41      g = 0x0e * bit0 + 0x1f * bit1 + 0x43 * bit2 + 0x8f * bit3;
42
43      bit0 = (color_prom[i + 2*machine->drv->total_colors] >> 0) & 0x01;
44      bit1 = (color_prom[i + 2*machine->drv->total_colors] >> 1) & 0x01;
45      bit2 = (color_prom[i + 2*machine->drv->total_colors] >> 2) & 0x01;
46      bit3 = (color_prom[i + 2*machine->drv->total_colors] >> 3) & 0x01;
47      b = 0x0e * bit0 + 0x1f * bit1 + 0x43 * bit2 + 0x8f * bit3;
48
49      palette_set_color(machine,i,MAKE_RGB(r,g,b));
34      colortable_palette_set_color(machine->colortable, i, MAKE_RGB(r, g, b));
5035   }
5136
52   color_prom += 3*machine->drv->total_colors;
5337   /* color_prom now points to the beginning of the lookup table */
38   color_prom += 0x300;
5439
40
5541   /* fg chars (1bpp) */
56   for (i = 0;i < TOTAL_COLORS(0);i++)
42   for (i = 0; i < 0x200; i++)
5743   {
58      if (i % 2)
59         COLOR(0,i) = i/2;
44      UINT8 ctabentry;
45
46      if (i & 0x01)
47         ctabentry = i >> 1;
6048      else
61         COLOR(0,i) = 0;
49         ctabentry = 0;
50
51      colortable_entry_set_value(machine->colortable, i, ctabentry);
6252   }
6353
64   /* sprites */
65   for(i = 0;i < TOTAL_COLORS(2);i++)
66      COLOR(2,i) = BITSWAP8(color_prom[i],4,5,6,7,3,2,1,0);
67
68   /* bg tiles */
69   for(i = 0;i < TOTAL_COLORS(1);i++)
70      COLOR(1,i) = BITSWAP8(color_prom[TOTAL_COLORS(2) + i],4,5,6,7,3,2,1,0);
54   /* sprites and bg tiles */
55   for (i = 0; i < 0x800; i++)
56   {
57      UINT8 ctabentry = BITSWAP8(color_prom[i],4,5,6,7,3,2,1,0);
58      colortable_entry_set_value(machine->colortable, i + 0x200, ctabentry);
59   }
7160}
7261
7362
r1679r1680
9281static TILE_GET_INFO( bg_get_tile_info )
9382{
9483   SET_TILE_INFO(
95         1,
84         2,
9685         retofinv_bg_videoram[tile_index] + 256 * bg_bank,
9786         retofinv_bg_videoram[0x400 + tile_index] & 0x3f,
9887         0);
r1679r1680
10190static TILE_GET_INFO( fg_get_tile_info )
10291{
10392   /* not sure about the transparency thing, but it makes sense */
93   int color = retofinv_fg_videoram[0x400 + tile_index];
94
95   tileinfo->group = color;
96
10497   SET_TILE_INFO(
10598         0,
10699         retofinv_fg_videoram[tile_index] + 256 * fg_bank,
107         retofinv_fg_videoram[0x400 + tile_index],
100         color,
108101         (tile_index < 0x40 || tile_index >= 0x3c0) ? TILE_FORCE_LAYER0 : 0);
109102}
110103
r1679r1680
118111
119112VIDEO_START( retofinv )
120113{
121   bg_tilemap = tilemap_create(bg_get_tile_info,tilemap_scan,TILEMAP_TYPE_PEN,8,8,36,28);
122   fg_tilemap = tilemap_create(fg_get_tile_info,tilemap_scan,TILEMAP_TYPE_COLORTABLE,8,8,36,28);
114   bg_tilemap = tilemap_create(bg_get_tile_info,tilemap_scan,8,8,36,28);
115   fg_tilemap = tilemap_create(fg_get_tile_info,tilemap_scan,8,8,36,28);
123116
124   tilemap_set_transparent_pen(fg_tilemap,0);
117   colortable_configure_tilemap_groups(machine->colortable, fg_tilemap, machine->gfx[0], 0);
125118
126119   spriteram = retofinv_sharedram + 0x0780;
127120   spriteram_2 = retofinv_sharedram + 0x0f80;
r1679r1680
225218      {
226219         for (x = 0;x <= sizex;x++)
227220         {
228            drawgfx(bitmap,machine->gfx[2],
221            drawgfx(bitmap,machine->gfx[1],
229222               sprite + gfx_offs[y ^ (sizey * flipy)][x ^ (sizex * flipx)],
230223               color,
231224               flipx,flipy,
232225               sx + 16*x,sy + 16*y,
233               &spritevisiblearea,TRANSPARENCY_COLOR,0xff);
226               &spritevisiblearea,TRANSPARENCY_PENS,
227               colortable_get_transpen_mask(machine->colortable, machine->gfx[1], color, 0xff));
234228         }
235229      }
236230   }
src/mame/video/meadows.c
r1679r1680
3636
3737VIDEO_START( meadows )
3838{
39   bg_tilemap = tilemap_create(get_tile_info, tilemap_scan_rows, TILEMAP_TYPE_PEN, 8,8, 32,30);
39   bg_tilemap = tilemap_create(get_tile_info, tilemap_scan_rows, 8,8, 32,30);
4040}
4141
4242
src/mame/video/bogeyman.c
r1679r1680
9090VIDEO_START( bogeyman )
9191{
9292   bg_tilemap = tilemap_create(get_bg_tile_info, tilemap_scan_rows,
93      TILEMAP_TYPE_PEN, 16, 16, 16, 16);
93      16, 16, 16, 16);
9494
9595   fg_tilemap = tilemap_create(get_fg_tile_info, tilemap_scan_rows,
96      TILEMAP_TYPE_PEN, 8, 8, 32, 32);
96      8, 8, 32, 32);
9797
9898   tilemap_set_transparent_pen(fg_tilemap, 0);
9999}
src/mame/video/m72.c
r1679r1680
122122
123123VIDEO_START( m72 )
124124{
125   bg_tilemap = tilemap_create(m72_get_bg_tile_info,tilemap_scan_rows,TILEMAP_TYPE_PEN,8,8,64,64);
126   fg_tilemap = tilemap_create(m72_get_fg_tile_info,tilemap_scan_rows,TILEMAP_TYPE_PEN,8,8,64,64);
125   bg_tilemap = tilemap_create(m72_get_bg_tile_info,tilemap_scan_rows,8,8,64,64);
126   fg_tilemap = tilemap_create(m72_get_fg_tile_info,tilemap_scan_rows,8,8,64,64);
127127
128128   m72_spriteram = auto_malloc(spriteram_size);
129129
r1679r1680
148148
149149VIDEO_START( rtype2 )
150150{
151   bg_tilemap = tilemap_create(rtype2_get_bg_tile_info,tilemap_scan_rows,TILEMAP_TYPE_PEN,8,8,64,64);
152   fg_tilemap = tilemap_create(rtype2_get_fg_tile_info,tilemap_scan_rows,TILEMAP_TYPE_PEN,8,8,64,64);
151   bg_tilemap = tilemap_create(rtype2_get_bg_tile_info,tilemap_scan_rows,8,8,64,64);
152   fg_tilemap = tilemap_create(rtype2_get_fg_tile_info,tilemap_scan_rows,8,8,64,64);
153153
154154   m72_spriteram = auto_malloc(spriteram_size);
155155
r1679r1680
186186{
187187// The tilemap can be 256x64, but seems to be used at 128x64 (scroll wraparound).
188188// The layout ramains 256x64, the right half is just not displayed.
189//  bg_tilemap = tilemap_create(rtype2_get_bg_tile_info,tilemap_scan_rows,TILEMAP_TYPE_PEN,8,8,256,64);
190   bg_tilemap = tilemap_create(rtype2_get_bg_tile_info,majtitle_scan_rows,TILEMAP_TYPE_PEN,8,8,128,64);
191   fg_tilemap = tilemap_create(rtype2_get_fg_tile_info,tilemap_scan_rows,TILEMAP_TYPE_PEN,8,8,64,64);
189//  bg_tilemap = tilemap_create(rtype2_get_bg_tile_info,tilemap_scan_rows,8,8,256,64);
190   bg_tilemap = tilemap_create(rtype2_get_bg_tile_info,majtitle_scan_rows,8,8,128,64);
191   fg_tilemap = tilemap_create(rtype2_get_fg_tile_info,tilemap_scan_rows,8,8,64,64);
192192
193193   m72_spriteram = auto_malloc(spriteram_size);
194194
r1679r1680
213213
214214VIDEO_START( hharry )
215215{
216   bg_tilemap = tilemap_create(hharry_get_bg_tile_info,tilemap_scan_rows,TILEMAP_TYPE_PEN,8,8,64,64);
217   fg_tilemap = tilemap_create(m72_get_fg_tile_info,   tilemap_scan_rows,TILEMAP_TYPE_PEN,8,8,64,64);
216   bg_tilemap = tilemap_create(hharry_get_bg_tile_info,tilemap_scan_rows,8,8,64,64);
217   fg_tilemap = tilemap_create(m72_get_fg_tile_info,   tilemap_scan_rows,8,8,64,64);
218218
219219   m72_spriteram = auto_malloc(spriteram_size);
220220
src/mame/video/pokechmp.c
r1679r1680
3030VIDEO_START( pokechmp )
3131{
3232   bg_tilemap = tilemap_create(get_bg_tile_info, tilemap_scan_rows,
33      TILEMAP_TYPE_PEN, 8, 8, 32, 32);
33      8, 8, 32, 32);
3434}
3535
3636static void draw_sprites(running_machine *machine, mame_bitmap *bitmap, const rectangle *cliprect)
src/mame/video/ohmygod.c
r1679r1680
3535
3636VIDEO_START( ohmygod )
3737{
38   bg_tilemap = tilemap_create(get_tile_info,tilemap_scan_rows,TILEMAP_TYPE_PEN,8,8,64,64);
38   bg_tilemap = tilemap_create(get_tile_info,tilemap_scan_rows,8,8,64,64);
3939}
4040
4141
src/mame/video/snk68.c
r1679r1680
8080
8181VIDEO_START( pow )
8282{
83   fix_tilemap = tilemap_create(get_pow_tile_info,tilemap_scan_cols,TILEMAP_TYPE_PEN,8,8,32,32);
83   fix_tilemap = tilemap_create(get_pow_tile_info,tilemap_scan_cols,8,8,32,32);
8484
8585   tilemap_set_transparent_pen(fix_tilemap,0);
8686}
8787
8888VIDEO_START( searchar )
8989{
90   fix_tilemap = tilemap_create(get_sar_tile_info,tilemap_scan_cols,TILEMAP_TYPE_PEN,8,8,32,32);
90   fix_tilemap = tilemap_create(get_sar_tile_info,tilemap_scan_cols,8,8,32,32);
9191
9292   tilemap_set_transparent_pen(fix_tilemap,0);
9393}
9494
9595VIDEO_START( ikari3 )
9696{
97   fix_tilemap = tilemap_create(get_ikari3_tile_info,tilemap_scan_cols,TILEMAP_TYPE_PEN,8,8,32,32);
97   fix_tilemap = tilemap_create(get_ikari3_tile_info,tilemap_scan_cols,8,8,32,32);
9898
9999   tilemap_set_transparent_pen(fix_tilemap,0);
100100}
src/mame/video/aeroboto.c
r1679r1680
4242
4343VIDEO_START( aeroboto )
4444{
45   bg_tilemap = tilemap_create(get_tile_info,tilemap_scan_rows,TILEMAP_TYPE_PEN,8,8,32,64);
45   bg_tilemap = tilemap_create(get_tile_info,tilemap_scan_rows,8,8,32,64);
4646
4747   tilemap_set_transparent_pen(bg_tilemap,0);
4848
src/mame/video/firetrap.c
r1679r1680
136136
137137VIDEO_START( firetrap )
138138{
139   fg_tilemap  = tilemap_create(get_fg_tile_info, get_fg_memory_offset,TILEMAP_TYPE_PEN, 8, 8,32,32);
140   bg1_tilemap = tilemap_create(get_bg1_tile_info,get_bg_memory_offset,TILEMAP_TYPE_PEN,16,16,32,32);
141   bg2_tilemap = tilemap_create(get_bg2_tile_info,get_bg_memory_offset,TILEMAP_TYPE_PEN,     16,16,32,32);
139   fg_tilemap  = tilemap_create(get_fg_tile_info, get_fg_memory_offset, 8, 8,32,32);
140   bg1_tilemap = tilemap_create(get_bg1_tile_info,get_bg_memory_offset,16,16,32,32);
141   bg2_tilemap = tilemap_create(get_bg2_tile_info,get_bg_memory_offset,     16,16,32,32);
142142
143143   tilemap_set_transparent_pen(fg_tilemap,0);
144144   tilemap_set_transparent_pen(bg1_tilemap,0);
src/mame/video/thedeep.c
r1679r1680
108108
109109VIDEO_START( thedeep )
110110{
111   tilemap_0  = tilemap_create(get_tile_info_0,tilemap_scan_rows_back,TILEMAP_TYPE_PEN,16,16,0x20,0x20);
112   tilemap_1  = tilemap_create(get_tile_info_1,tilemap_scan_rows,TILEMAP_TYPE_PEN,8,8,0x20,0x20);
111   tilemap_0  = tilemap_create(get_tile_info_0,tilemap_scan_rows_back,16,16,0x20,0x20);
112   tilemap_1  = tilemap_create(get_tile_info_1,tilemap_scan_rows,8,8,0x20,0x20);
113113
114114   tilemap_set_transparent_pen( tilemap_0,  0 );
115115   tilemap_set_transparent_pen( tilemap_1,  0 );
src/mame/video/oneshot.c
r1679r1680
6767
6868VIDEO_START( oneshot )
6969{
70   oneshot_bg_tilemap = tilemap_create(get_oneshot_bg_tile_info,tilemap_scan_rows,TILEMAP_TYPE_PEN, 16, 16,32,32);
71   oneshot_mid_tilemap = tilemap_create(get_oneshot_mid_tile_info,tilemap_scan_rows,TILEMAP_TYPE_PEN, 16, 16,32,32);
72   oneshot_fg_tilemap = tilemap_create(get_oneshot_fg_tile_info,tilemap_scan_rows,TILEMAP_TYPE_PEN, 16, 16,32,32);
70   oneshot_bg_tilemap = tilemap_create(get_oneshot_bg_tile_info,tilemap_scan_rows, 16, 16,32,32);
71   oneshot_mid_tilemap = tilemap_create(get_oneshot_mid_tile_info,tilemap_scan_rows, 16, 16,32,32);
72   oneshot_fg_tilemap = tilemap_create(get_oneshot_fg_tile_info,tilemap_scan_rows, 16, 16,32,32);
7373
7474   tilemap_set_transparent_pen(oneshot_bg_tilemap,0);
7575   tilemap_set_transparent_pen(oneshot_mid_tilemap,0);
src/mame/video/stlforce.c
r1679r1680
181181
182182VIDEO_START( stlforce )
183183{
184   stlforce_bg_tilemap    = tilemap_create(get_stlforce_bg_tile_info,   tilemap_scan_cols,TILEMAP_TYPE_PEN,      16,16,64,16);
185   stlforce_mlow_tilemap  = tilemap_create(get_stlforce_mlow_tile_info, tilemap_scan_cols,TILEMAP_TYPE_PEN, 16,16,64,16);
186   stlforce_mhigh_tilemap = tilemap_create(get_stlforce_mhigh_tile_info,tilemap_scan_cols,TILEMAP_TYPE_PEN, 16,16,64,16);
187   stlforce_tx_tilemap    = tilemap_create(get_stlforce_tx_tile_info,   tilemap_scan_rows,TILEMAP_TYPE_PEN,  8, 8,64,32);
184   stlforce_bg_tilemap    = tilemap_create(get_stlforce_bg_tile_info,   tilemap_scan_cols,      16,16,64,16);
185   stlforce_mlow_tilemap  = tilemap_create(get_stlforce_mlow_tile_info, tilemap_scan_cols, 16,16,64,16);
186   stlforce_mhigh_tilemap = tilemap_create(get_stlforce_mhigh_tile_info,tilemap_scan_cols, 16,16,64,16);
187   stlforce_tx_tilemap    = tilemap_create(get_stlforce_tx_tile_info,   tilemap_scan_rows,  8, 8,64,32);
188188
189189   tilemap_set_transparent_pen(stlforce_mlow_tilemap,0);
190190   tilemap_set_transparent_pen(stlforce_mhigh_tilemap,0);
src/mame/video/amspdwy.c
r1679r1680
7979VIDEO_START( amspdwy )
8080{
8181   bg_tilemap   =   tilemap_create(   get_tile_info,   tilemap_scan_cols_back,
82                        TILEMAP_TYPE_PEN,   8,8,   0x20, 0x20 );
82                           8,8,   0x20, 0x20 );
8383}
8484
8585
src/mame/video/atarig1.c
r1679r1680
114114   atarigen_blend_gfx(machine, 0, 2, 0x0f, 0x10);
115115
116116   /* initialize the playfield */
117   atarigen_playfield_tilemap = tilemap_create(get_playfield_tile_info, tilemap_scan_rows, TILEMAP_TYPE_PEN, 8,8, 64,64);
117   atarigen_playfield_tilemap = tilemap_create(get_playfield_tile_info, tilemap_scan_rows, 8,8, 64,64);
118118
119119   /* initialize the motion objects */
120120   atarirle_init(0, atarig1_pitfight ? &modesc_pitfight : &modesc_hydra);
121121
122122   /* initialize the alphanumerics */
123   atarigen_alpha_tilemap = tilemap_create(get_alpha_tile_info, tilemap_scan_rows, TILEMAP_TYPE_PEN, 8,8, 64,32);
123   atarigen_alpha_tilemap = tilemap_create(get_alpha_tile_info, tilemap_scan_rows, 8,8, 64,32);
124124   tilemap_set_transparent_pen(atarigen_alpha_tilemap, 0);
125125
126126   /* reset statics */
src/mame/video/toobin.c
r1679r1680
9494   };
9595
9696   /* initialize the playfield */
97   atarigen_playfield_tilemap = tilemap_create(get_playfield_tile_info, tilemap_scan_rows, TILEMAP_TYPE_PEN, 8,8, 128,64);
97   atarigen_playfield_tilemap = tilemap_create(get_playfield_tile_info, tilemap_scan_rows, 8,8, 128,64);
9898
9999   /* initialize the motion objects */
100100   atarimo_init(machine, 0, &modesc);
101101
102102   /* initialize the alphanumerics */
103   atarigen_alpha_tilemap = tilemap_create(get_alpha_tile_info, tilemap_scan_rows, TILEMAP_TYPE_PEN, 8,8, 64,48);
103   atarigen_alpha_tilemap = tilemap_create(get_alpha_tile_info, tilemap_scan_rows, 8,8, 64,48);
104104   tilemap_set_transparent_pen(atarigen_alpha_tilemap, 0);
105105}
106106
src/mame/video/srumbler.c
r1679r1680
5151
5252VIDEO_START( srumbler )
5353{
54   fg_tilemap = tilemap_create(get_fg_tile_info,tilemap_scan_cols,TILEMAP_TYPE_PEN,8,8,64,32);
55   bg_tilemap = tilemap_create(get_bg_tile_info,tilemap_scan_cols,TILEMAP_TYPE_PEN,    16,16,64,64);
54   fg_tilemap = tilemap_create(get_fg_tile_info,tilemap_scan_cols,8,8,64,32);
55   bg_tilemap = tilemap_create(get_bg_tile_info,tilemap_scan_cols,    16,16,64,64);
5656
5757   tilemap_set_transparent_pen(fg_tilemap,3);
5858
src/mame/video/legionna.c
r1679r1680
155155
156156VIDEO_START( legionna )
157157{
158   background_layer = tilemap_create(get_back_tile_info,tilemap_scan_rows,TILEMAP_TYPE_PEN,16,16,32,32);
159   foreground_layer = tilemap_create(get_fore_tile_info,tilemap_scan_rows,TILEMAP_TYPE_PEN,16,16,32,32);
160   midground_layer =  tilemap_create(get_mid_tile_info, tilemap_scan_rows,TILEMAP_TYPE_PEN,16,16,32,32);
161   text_layer =       tilemap_create(get_text_tile_info,tilemap_scan_rows,TILEMAP_TYPE_PEN,  8,8,64,32);
158   background_layer = tilemap_create(get_back_tile_info,tilemap_scan_rows,16,16,32,32);
159   foreground_layer = tilemap_create(get_fore_tile_info,tilemap_scan_rows,16,16,32,32);
160   midground_layer =  tilemap_create(get_mid_tile_info, tilemap_scan_rows,16,16,32,32);
161   text_layer =       tilemap_create(get_text_tile_info,tilemap_scan_rows,  8,8,64,32);
162162
163163   legionna_scrollram16 = auto_malloc(0x60);
164164
r1679r1680
170170
171171VIDEO_START( denjinmk )
172172{
173   background_layer = tilemap_create(get_back_tile_info,tilemap_scan_rows,TILEMAP_TYPE_PEN,16,16,32,32);
174   foreground_layer = tilemap_create(get_fore_tile_info_denji,tilemap_scan_rows,TILEMAP_TYPE_PEN,16,16,32,32);
175   midground_layer =  tilemap_create(get_mid_tile_info_denji, tilemap_scan_rows,TILEMAP_TYPE_PEN,16,16,32,32);
176   text_layer =       tilemap_create(get_text_tile_info,tilemap_scan_rows,TILEMAP_TYPE_PEN,  8,8,64,32);
173   background_layer = tilemap_create(get_back_tile_info,tilemap_scan_rows,16,16,32,32);
174   foreground_layer = tilemap_create(get_fore_tile_info_denji,tilemap_scan_rows,16,16,32,32);
175   midground_layer =  tilemap_create(get_mid_tile_info_denji, tilemap_scan_rows,16,16,32,32);
176   text_layer =       tilemap_create(get_text_tile_info,tilemap_scan_rows,  8,8,64,32);
177177
178178   legionna_scrollram16 = auto_malloc(0x60);
179179
r1679r1680
185185
186186VIDEO_START( cupsoc )
187187{
188   background_layer = tilemap_create(get_back_tile_info,tilemap_scan_rows,TILEMAP_TYPE_PEN,16,16,32,32);
189   foreground_layer = tilemap_create(get_fore_tile_info,tilemap_scan_rows,TILEMAP_TYPE_PEN,16,16,32,32);
190   midground_layer =  tilemap_create(get_mid_tile_info_cupsoc, tilemap_scan_rows,TILEMAP_TYPE_PEN,16,16,32,32);
191   text_layer =       tilemap_create(get_text_tile_info,tilemap_scan_rows,TILEMAP_TYPE_PEN,  8,8,64,32);
188   background_layer = tilemap_create(get_back_tile_info,tilemap_scan_rows,16,16,32,32);
189   foreground_layer = tilemap_create(get_fore_tile_info,tilemap_scan_rows,16,16,32,32);
190   midground_layer =  tilemap_create(get_mid_tile_info_cupsoc, tilemap_scan_rows,16,16,32,32);
191   text_layer =       tilemap_create(get_text_tile_info,tilemap_scan_rows,  8,8,64,32);
192192
193193   legionna_scrollram16 = auto_malloc(0x60);
194194
src/mame/video/pbaction.c
r1679r1680
7474VIDEO_START( pbaction )
7575{
7676   bg_tilemap = tilemap_create(get_bg_tile_info, tilemap_scan_rows,
77      TILEMAP_TYPE_PEN, 8, 8, 32, 32);
77      8, 8, 32, 32);
7878
7979   fg_tilemap = tilemap_create(get_fg_tile_info, tilemap_scan_rows,
80      TILEMAP_TYPE_PEN, 8, 8, 32, 32);
80      8, 8, 32, 32);
8181
8282   tilemap_set_transparent_pen(fg_tilemap, 0);
8383}
src/mame/video/mcr68.c
r1679r1680
6464VIDEO_START( mcr68 )
6565{
6666   /* initialize the background tilemap */
67   bg_tilemap = tilemap_create(get_bg_tile_info, tilemap_scan_rows, TILEMAP_TYPE_PEN, 16,16, 32,32);
67   bg_tilemap = tilemap_create(get_bg_tile_info, tilemap_scan_rows, 16,16, 32,32);
6868   tilemap_set_transparent_pen(bg_tilemap, 0);
6969}
7070
r1679r1680
7777   int code, y, x;
7878
7979   /* initialize the background tilemap */
80   bg_tilemap = tilemap_create(zwackery_get_bg_tile_info, tilemap_scan_rows, TILEMAP_TYPE_PEN, 16,16, 32,32);
80   bg_tilemap = tilemap_create(zwackery_get_bg_tile_info, tilemap_scan_rows, 16,16, 32,32);
8181
8282   /* initialize the foreground tilemap */
83   fg_tilemap = tilemap_create(zwackery_get_fg_tile_info, tilemap_scan_rows, TILEMAP_TYPE_PEN, 16,16, 32,32);
83   fg_tilemap = tilemap_create(zwackery_get_fg_tile_info, tilemap_scan_rows, 16,16, 32,32);
8484   tilemap_set_transparent_pen(fg_tilemap, 0);
8585
8686   /* "colorize" each code */
src/mame/video/funworld.c
r1679r1680
11/**********************************************************************************
22
33
4    FUNWORLD.
4    FUNWORLD / TAB.
55
6
76    Original preliminary driver:    Curt Coder, Peter Trauner.
87    Rewrite and aditional work:     Roberto Fresca.
98
109
10
1111    Games running in this hardware:
1212
13    * Jolly Card (Austria),                     TAB-Austria,        1985.
14    * Jolly Card (Austria, encrypted),          TAB-Austria,        1985.
15    * Jolly Card (Croatia),                     Soft Design,        1993.
16    * Jolly Card (Italia, encrypted),           bootleg,            199?.
17    * Jolly Card (Austria, Fun World, bootleg), Inter Games,        1995.
18    * Big Deal (Hungary, set 1),                Fun World,          1990.
19    * Big Deal (Hungary, set 2),                Fun World,          1990.
20    * Jolly Card (Austria, Fun World),          Fun World,          1990.
21    * Cuore 1 (Italia),                         C.M.C.,             1996.
22    * Elephant Family (Italia, new),            C.M.C.,             1997.
23    * Elephant Family (Italia, old),            C.M.C.,             1996.
24    * Pool 10 (Italia, set 1),                  C.M.C.,             1996.
25    * Pool 10 (Italia, set 2),                  C.M.C.,             1996.
26    * Tortuga Family (Italia),                  C.M.C.,             1997.
27    * Royal Card (Austria, set 1),              TAB-Austria,        1991.
28    * Royal Card (Austria, set 2),              TAB-Austria,        1991.
29    * Royal Card (Slovakia, encrypted),         Evona Electronic,   1991.
30    * Magic Card II (Bulgaria, bootleg),        Impera,             1996.
31    * Joker Card (Ver.A267BC, encrypted),       Vesely Svet,        1993.
32    * Mongolfier New (Italia),                  bootleg,            199?.
33    * Soccer New (Italia),                      bootleg,            199?.
34    * Snooker 10 (Ver 1.11),                    Sandiy,             1998.
35    * Saloon (France, encrypted),               unknown,            199?.
13    * Jolly Card (austrian),                            TAB-Austria,        1985.
14    * Jolly Card (austrian, encrypted),                 TAB-Austria,        1985.
15    * Jolly Card (3x3 deal),                            TAB-Austria,        1985.
16    * Jolly Card Professional 2.0,                      Spale-Soft,         2000.
17    * Jolly Card (croatian),                            Soft Design,        1993.
18    * Jolly Card (italian, blue TAB board, encrypted),  bootleg,            199?.
19    * Jolly Card (austrian, Funworld, bootleg),         Inter Games,        1986.
20    * Big Deal (hungarian, set 1),                      Funworld,           1986.
21    * Big Deal (hungarian, set 2),                      Funworld,           1986.
22    * Jolly Card (austrian, Funworld),                  Funworld,           1986.
23    * Cuore 1 (italian),                                C.M.C.,             1996.
24    * Elephant Family (italian, new),                   C.M.C.,             1997.
25    * Elephant Family (italian, old),                   C.M.C.,             1996.
26    * Pool 10 (italian, set 1),                         C.M.C.,             1996.
27    * Pool 10 (italian, set 2),                         C.M.C.,             1996.
28    * Tortuga Family (italian),                         C.M.C.,             1997.
29    * Royal Card (austrian, set 1),                     TAB-Austria,        1991.
30    * Royal Card (austrian, set 2),                     TAB-Austria,        1991.
31    * Royal Card (slovak, encrypted),                   Evona Electronic,   1991.
32    * Lucky Lady (3x3 deal),                            TAB-Austria,        1991.
33    * Lucky Lady (4x1 aces),                            TAB-Austria,        1991.
34    * Magic Card II (bulgarian),                        Impera,             1996.
35    * Magic Card II (green TAB or Impera board),        Impera,             1996.
36    * Magic Card II (blue TAB board, encrypted),        Impera,             1996.
37    * Royal Vegas Joker Card (slow deal),               Funworld,           1993.
38    * Royal Vegas Joker Card (fast deal),               Soft Design,        1993.
39    * Joker Card (Ver.A267BC, encrypted),               Vesely Svet,        1993.
40    * Mongolfier New (italian),                         bootleg,            199?.
41    * Soccer New (italian),                             bootleg,            199?.
42    * Snooker 10 (Ver 1.11),                            Sandii',            1998.
43    * Saloon (french, encrypted),                       unknown,            199?.
3644
3745
3846***********************************************************************************/
3947
4048
4149#include "driver.h"
50#include "video/mc6845.h"
4251
52static mc6845_t *mc6845;
4353static tilemap *bg_tilemap;
4454
4555
r1679r1680
8696   tilemap_mark_tile_dirty(bg_tilemap, offset);
8797}
8898
99WRITE8_HANDLER( funworld_mc6845_address_w )
100{
101   mc6845_address_w(mc6845, data);
102}
103
104READ8_HANDLER( funworld_mc6845_register_r )
105{
106   return mc6845_register_r(mc6845);
107}
108
109WRITE8_HANDLER( funworld_mc6845_register_w )
110{
111   mc6845_register_w(mc6845, data);
112}
113
89114/**** normal hardware limit ****
90115    - bits -
91116    7654 3210
r1679r1680
111136
112137VIDEO_START(funworld)
113138{
114   bg_tilemap = tilemap_create(get_bg_tile_info, tilemap_scan_rows,
115      TILEMAP_TYPE_PEN, 4, 8, 96, 29);
139   mc6845 = mc6845_config(NULL);
140   bg_tilemap = tilemap_create(get_bg_tile_info, tilemap_scan_rows, 4, 8, 96, 29);
116141}
117142
118143VIDEO_START(magiccrd)
119144{
120   bg_tilemap = tilemap_create(get_bg_tile_info, tilemap_scan_rows,
121      TILEMAP_TYPE_PEN, 4, 8, 112, 34);
145   mc6845 = mc6845_config(NULL);
146   bg_tilemap = tilemap_create(get_bg_tile_info, tilemap_scan_rows, 4, 8, 112, 34);
122147}
123148
149VIDEO_START(snookr10)
150{
151//  mc6845 = mc6845_config(NULL);
152   bg_tilemap = tilemap_create(get_bg_tile_info, tilemap_scan_rows, 4, 8, 128, 32);
153}
154
124155VIDEO_UPDATE(funworld)
125156{
126157   tilemap_draw(bitmap, cliprect, bg_tilemap, 0, 0);
src/mame/video/gsword.c
r1679r1680
1818
1919static tilemap *bg_tilemap;
2020
21PALETTE_INIT( josvolly )
21
22static PALETTE_INIT( common )
2223{
2324   int i;
2425
25   #define TOTAL_COLORS(gfxn) (machine->gfx[gfxn]->total_colors * machine->gfx[gfxn]->color_granularity)
26   #define COLOR(gfxn,offs) (colortable[machine->drv->gfxdecodeinfo[gfxn].color_codes_start + offs])
26   /* characters */
27   for (i = 0; i < 0x100; i++)
28      colortable_entry_set_value(machine->colortable, i, i);
2729
28   for (i = 0;i < machine->drv->total_colors;i++)
30   /* sprites */
31   for (i = 0x100; i < 0x200; i++)
2932   {
30      int bit0,bit1,bit2,bit3,r,g,b;
33      UINT8 ctabentry = (BITSWAP8(color_prom[i - 0x100],7,6,5,4,0,1,2,3) & 0x0f) | 0x80;
34      colortable_entry_set_value(machine->colortable, i, ctabentry);
35   }
36}
3137
3238
33      /* red component */
34      bit0 = (color_prom[0] >> 0) & 0x01;
35      bit1 = (color_prom[0] >> 1) & 0x01;
36      bit2 = (color_prom[0] >> 2) & 0x01;
37      bit3 = (color_prom[0] >> 3) & 0x01;
38      r = 0x0e * bit0 + 0x1f * bit1 + 0x43 * bit2 + 0x8f * bit3;
39      /* green component */
40      bit0 = (color_prom[machine->drv->total_colors] >> 0) & 0x01;
41      bit1 = (color_prom[machine->drv->total_colors] >> 1) & 0x01;
42      bit2 = (color_prom[machine->drv->total_colors] >> 2) & 0x01;
43      bit3 = (color_prom[machine->drv->total_colors] >> 3) & 0x01;
44      g = 0x0e * bit0 + 0x1f * bit1 + 0x43 * bit2 + 0x8f * bit3;
45      /* blue component */
46      bit0 = (color_prom[2*machine->drv->total_colors] >> 0) & 0x01;
47      bit1 = (color_prom[2*machine->drv->total_colors] >> 1) & 0x01;
48      bit2 = (color_prom[2*machine->drv->total_colors] >> 2) & 0x01;
49      bit3 = (color_prom[2*machine->drv->total_colors] >> 3) & 0x01;
50      b = 0x0e * bit0 + 0x1f * bit1 + 0x43 * bit2 + 0x8f * bit3;
39PALETTE_INIT( josvolly )
40{
41   int i;
5142
52      palette_set_color(machine,i,MAKE_RGB(r,g,b));
53      color_prom++;
54   }
43   /* allocate the colortable */
44   machine->colortable = colortable_alloc(machine, 0x100);
5545
56   color_prom += 2*machine->drv->total_colors;
57   /* color_prom now points to the beginning of the sprite lookup table */
46   /* create a lookup table for the palette */
47   for (i = 0; i < 0x100; i++)
48   {
49      int r = pal4bit(color_prom[i + 0x000]);
50      int g = pal4bit(color_prom[i + 0x100]);
51      int b = pal4bit(color_prom[i + 0x200]);
5852
59   /* characters */
60   for (i = 0;i < TOTAL_COLORS(0);i++)
61      COLOR(0,i) = i;
53      colortable_palette_set_color(machine->colortable, i, MAKE_RGB(r, g, b));
54   }
6255
63   /* sprites */
64   for (i = 0;i < TOTAL_COLORS(1);i++)
65      COLOR(1,i) = 0x80 + (BITSWAP8( color_prom[i], 7,6,5,4, 0,1,2,3) & 0xf);
56   /* color_prom now points to the beginning of the lookup table */
57   color_prom += 0x300;
58
59   PALETTE_INIT_CALL(common);
6660}
6761
62
6863PALETTE_INIT( gsword )
6964{
7065   int i;
7166
72   #define TOTAL_COLORS(gfxn) (machine->gfx[gfxn]->total_colors * machine->gfx[gfxn]->color_granularity)
73   #define COLOR(gfxn,offs) (colortable[machine->drv->gfxdecodeinfo[gfxn].color_codes_start + offs])
67   /* allocate the colortable */
68   machine->colortable = colortable_alloc(machine, 0x100);
7469
75   for (i = 0;i < 256;i++)
70   /* create a lookup table for the palette */
71   for (i = 0; i < 0x100; i++)
7672   {
77      int bit0,bit1,bit2,r,g,b;
73      int bit0, bit1, bit2;
74      int r, g, b;
7875
7976      /* red component */
80      bit0 = (color_prom[256+i] >> 0) & 1;
81      bit1 = (color_prom[256+i] >> 1) & 1;
82      bit2 = (color_prom[256+i] >> 2) & 1;
77      bit0 = (color_prom[i + 0x100] >> 0) & 1;
78      bit1 = (color_prom[i + 0x100] >> 1) & 1;
79      bit2 = (color_prom[i + 0x100] >> 2) & 1;
8380      r = 0x21 * bit0 + 0x47 * bit1 + 0x97 * bit2;
81
8482      /* green component */
85      bit0 = (color_prom[256+i] >> 3) & 1;
86      bit1 = (color_prom[i] >> 0) & 1;
87      bit2 = (color_prom[i] >> 1) & 1;
83      bit0 = (color_prom[i + 0x100] >> 3) & 1;
84      bit1 = (color_prom[i + 0x000] >> 0) & 1;
85      bit2 = (color_prom[i + 0x000] >> 1) & 1;
8886      g = 0x21 * bit0 + 0x47 * bit1 + 0x97 * bit2;
87
8988      /* blue component */
9089      bit0 = 0;
91      bit1 = (color_prom[i] >> 2) & 1;
92      bit2 = (color_prom[i] >> 3) & 1;
90      bit1 = (color_prom[i + 0x000] >> 2) & 1;
91      bit2 = (color_prom[i + 0x000] >> 3) & 1;
9392      b = 0x21 * bit0 + 0x47 * bit1 + 0x97 * bit2;
9493
95      palette_set_color(machine,i,MAKE_RGB(r,g,b));
94      colortable_palette_set_color(machine->colortable, i, MAKE_RGB(r, g, b));
9695   }
9796
98   color_prom += 2*256;
99   /* color_prom now points to the beginning of the sprite lookup table */
97   /* color_prom now points to the beginning of the lookup table */
98   color_prom += 0x200;
10099
101   /* characters */
102   for (i = 0;i < TOTAL_COLORS(0);i++)
103      COLOR(0,i) = i;
104
105   /* sprites */
106   for (i = 0;i < TOTAL_COLORS(1);i++)
107      COLOR(1,i) = 0x80 + (BITSWAP8( color_prom[i], 7,6,5,4, 0,1,2,3) & 0xf);
100   PALETTE_INIT_CALL(common);
108101}
109102
110103WRITE8_HANDLER( gsword_videoram_w )
r1679r1680
167160VIDEO_START( gsword )
168161{
169162   bg_tilemap = tilemap_create(get_bg_tile_info, tilemap_scan_rows,
170      TILEMAP_TYPE_PEN, 8, 8, 32, 64);
163      8, 8, 32, 64);
171164}
172165
173166static void draw_sprites(running_machine *machine, mame_bitmap *bitmap, const rectangle *cliprect)
r1679r1680
176169
177170   for (offs = 0; offs < gsword_spritexy_size - 1; offs+=2)
178171   {
179      int sx,sy,flipx,flipy,spritebank,tile;
172      int sx,sy,flipx,flipy,spritebank,tile,color;
180173
181174      if (gsword_spritexy_ram[offs]!=0xf1)
182175      {
183176         spritebank = 0;
184177         tile = gsword_spritetile_ram[offs];
178         color = gsword_spritetile_ram[offs+1] & 0x3f;
185179         sy = 241-gsword_spritexy_ram[offs];
186180         sx = gsword_spritexy_ram[offs+1]-56;
187181         flipx = gsword_spriteattrib_ram[offs] & 0x02;
r1679r1680
204198         }
205199         drawgfx(bitmap,machine->gfx[1+spritebank],
206200               tile,
207               gsword_spritetile_ram[offs+1] & 0x3f,
201               color,
208202               flipx,flipy,
209203               sx,sy,
210               cliprect,TRANSPARENCY_COLOR, 0x8f);
204               cliprect,TRANSPARENCY_PENS,
205               colortable_get_transpen_mask(machine->colortable, machine->gfx[1+spritebank], color, 0x8f));
211206      }
212207   }
213208}
src/mame/video/mario.c
r1679r1680
146146   mario_state   *state = machine->driver_data;
147147
148148   state->bg_tilemap = tilemap_create(get_bg_tile_info, tilemap_scan_rows,
149      TILEMAP_TYPE_PEN, 8, 8, 32, 32);
149      8, 8, 32, 32);
150150
151151   state->gfx_bank = 0;
152152   state->palette_bank = 0;
src/mame/video/atarifb.c
r1679r1680
9898
9999VIDEO_START( atarifb )
100100{
101   alpha1_tilemap = tilemap_create(alpha1_get_tile_info, tilemap_scan_cols, TILEMAP_TYPE_PEN, 8,8,  3,32);
102   alpha2_tilemap = tilemap_create(alpha2_get_tile_info, tilemap_scan_cols, TILEMAP_TYPE_PEN, 8,8,  3,32);
103   field_tilemap  = tilemap_create(field_get_tile_info,  tilemap_scan_rows, TILEMAP_TYPE_PEN, 8,8, 32,32);
101   alpha1_tilemap = tilemap_create(alpha1_get_tile_info, tilemap_scan_cols,  8,8,  3,32);
102   alpha2_tilemap = tilemap_create(alpha2_get_tile_info, tilemap_scan_cols,  8,8,  3,32);
103   field_tilemap  = tilemap_create(field_get_tile_info,  tilemap_scan_rows,  8,8, 32,32);
104104}
105105
106106
src/mame/video/silkroad.c
r1679r1680
137137
138138VIDEO_START(silkroad)
139139{
140   fg_tilemap = tilemap_create(get_fg_tile_info,tilemap_scan_rows,TILEMAP_TYPE_PEN,16,16,64, 64);
140   fg_tilemap = tilemap_create(get_fg_tile_info,tilemap_scan_rows,16,16,64, 64);
141141      tilemap_set_transparent_pen(fg_tilemap,0);
142142
143   fg2_tilemap = tilemap_create(get_fg2_tile_info,tilemap_scan_rows,TILEMAP_TYPE_PEN,16,16,64, 64);
143   fg2_tilemap = tilemap_create(get_fg2_tile_info,tilemap_scan_rows,16,16,64, 64);
144144      tilemap_set_transparent_pen(fg2_tilemap,0);
145145
146   fg3_tilemap = tilemap_create(get_fg3_tile_info,tilemap_scan_rows,TILEMAP_TYPE_PEN,16,16,64, 64);
146   fg3_tilemap = tilemap_create(get_fg3_tile_info,tilemap_scan_rows,16,16,64, 64);
147147      tilemap_set_transparent_pen(fg3_tilemap,0);
148148}
149149
src/mame/video/videopin.c
r1679r1680
3131
3232VIDEO_START( videopin )
3333{
34   bg_tilemap = tilemap_create(get_tile_info, get_memory_offset, TILEMAP_TYPE_PEN, 8, 8, 48, 32);
34   bg_tilemap = tilemap_create(get_tile_info, get_memory_offset, 8, 8, 48, 32);
3535}
3636
3737
src/mame/video/exprraid.c
r1679r1680
8383VIDEO_START( exprraid )
8484{
8585   bg_tilemap = tilemap_create(get_bg_tile_info, tilemap_scan_rows,
86      TILEMAP_TYPE_PEN, 16, 16, 32, 32);
86      16, 16, 32, 32);
8787
8888   fg_tilemap = tilemap_create(get_fg_tile_info, tilemap_scan_rows,
89      TILEMAP_TYPE_PEN, 8, 8, 32, 32);
89      8, 8, 32, 32);
9090
9191   tilemap_set_scroll_rows(bg_tilemap, 2);
9292   tilemap_set_transparent_pen(fg_tilemap, 0);
src/mame/video/tecmo16.c
r1679r1680
7171   /* set up sprites */
7272   sprite_bitmap = auto_bitmap_alloc(machine->screen[0].width, machine->screen[0].height, BITMAP_FORMAT_INDEXED16);
7373
74   fg_tilemap = tilemap_create(fg_get_tile_info,tilemap_scan_rows,TILEMAP_TYPE_PEN,16,16,32,32);
75   bg_tilemap = tilemap_create(bg_get_tile_info,tilemap_scan_rows,TILEMAP_TYPE_PEN,16,16,32,32);
76   tx_tilemap = tilemap_create(tx_get_tile_info,tilemap_scan_rows,TILEMAP_TYPE_PEN, 8, 8,64,32);
74   fg_tilemap = tilemap_create(fg_get_tile_info,tilemap_scan_rows,16,16,32,32);
75   bg_tilemap = tilemap_create(bg_get_tile_info,tilemap_scan_rows,16,16,32,32);
76   tx_tilemap = tilemap_create(tx_get_tile_info,tilemap_scan_rows, 8, 8,64,32);
7777
7878   tilemap_set_transparent_pen(fg_tilemap,0);
7979   tilemap_set_transparent_pen(bg_tilemap,0);
r1679r1680
9393   /* set up sprites */
9494   sprite_bitmap = auto_bitmap_alloc(machine->screen[0].width, machine->screen[0].height, BITMAP_FORMAT_INDEXED16);
9595
96   fg_tilemap = tilemap_create(fg_get_tile_info,tilemap_scan_rows,TILEMAP_TYPE_PEN,16,16,64,32);
97   bg_tilemap = tilemap_create(bg_get_tile_info,tilemap_scan_rows,TILEMAP_TYPE_PEN,16,16,64,32);
98   tx_tilemap = tilemap_create(tx_get_tile_info,tilemap_scan_rows,TILEMAP_TYPE_PEN, 8, 8,64,32);
96   fg_tilemap = tilemap_create(fg_get_tile_info,tilemap_scan_rows,16,16,64,32);
97   bg_tilemap = tilemap_create(bg_get_tile_info,tilemap_scan_rows,16,16,64,32);
98   tx_tilemap = tilemap_create(tx_get_tile_info,tilemap_scan_rows, 8, 8,64,32);
9999
100100   tilemap_set_transparent_pen(fg_tilemap,0);
101101   tilemap_set_transparent_pen(bg_tilemap,0);
r1679r1680
113113   /* set up sprites */
114114   sprite_bitmap = auto_bitmap_alloc(machine->screen[0].width, machine->screen[0].height, BITMAP_FORMAT_INDEXED16);
115115
116   fg_tilemap = tilemap_create(fg_get_tile_info,tilemap_scan_rows,TILEMAP_TYPE_PEN,16,16,64,32);
117   bg_tilemap = tilemap_create(bg_get_tile_info,tilemap_scan_rows,TILEMAP_TYPE_PEN,16,16,64,32);
118   tx_tilemap = tilemap_create(tx_get_tile_info,tilemap_scan_rows,TILEMAP_TYPE_PEN, 8, 8,64,32);
116   fg_tilemap = tilemap_create(fg_get_tile_info,tilemap_scan_rows,16,16,64,32);
117   bg_tilemap = tilemap_create(bg_get_tile_info,tilemap_scan_rows,16,16,64,32);
118   tx_tilemap = tilemap_create(tx_get_tile_info,tilemap_scan_rows, 8, 8,64,32);
119119
120120   tilemap_set_transparent_pen(fg_tilemap,0);
121121   tilemap_set_transparent_pen(bg_tilemap,0);
src/mame/video/csk.c
r1679r1680
197197            0,0,
198198            8*sx,8*sy,
199199            cliprect,
200            (abilityflag) ? TRANSPARENCY_COLOR : TRANSPARENCY_NONE, 0);
200            (abilityflag) ? TRANSPARENCY_PEN : TRANSPARENCY_NONE, 0);
201201   }
202202
203203   return 0;
src/mame/video/naughtyb.c
r1679r1680
6767***************************************************************************/
6868PALETTE_INIT( naughtyb )
6969{
70   int i;
71   #define COLOR(gfxn,offs) (colortable[machine->drv->gfxdecodeinfo[gfxn].color_codes_start + offs])
72
7370   /* note: there is no resistor on second PROM so we define second resistance as 0 */
7471   static const int resistances[2] = { 270, 0 };
75   double weights_r[2], weights_g[2], weights_b[2];
72   double rweights[2], gweights[2], bweights[2];
73   int i;
7674
75   /* compute the color output resistor weights */
76   compute_resistor_weights(0,   255, -1.0,
77         2, resistances, rweights, 270, 270,
78         2, resistances, gweights, 270, 270,
79         2, resistances, bweights, 270, 270);
7780
78   compute_resistor_weights(0,   255,   -1.0,
79         2,   resistances,   weights_r,   270,   270,
80         2,   resistances,   weights_g,   270,   270,
81         2,   resistances,   weights_b,   270,   270);
82
83
84   for (i = 0;i < machine->drv->total_colors;i++)
81   for (i = 0; i < 0x100; i++)
8582   {
86      int bit0,bit1,r,g,b;
83      int bit0, bit1;
84      int r, g, b;
85      int swapped_i;
8786
87      /* red component */
88      bit0 = (color_prom[i | 0x000] >> 0) & 0x01;
89      bit1 = (color_prom[i | 0x100] >> 0) & 0x01;
90      r = combine_2_weights(rweights, bit0, bit1);
8891
89      bit0 = (color_prom[0] >> 0) & 0x01;
90      bit1 = (color_prom[machine->drv->total_colors] >> 0) & 0x01;
92      /* green component */
93      bit0 = (color_prom[i | 0x000] >> 2) & 0x01;
94      bit1 = (color_prom[i | 0x100] >> 2) & 0x01;
95      g = combine_2_weights(gweights, bit0, bit1);
9196
92      /*r = 0x55 * bit0 + 0xaa * bit1;*/
93      r = combine_2_weights(weights_r, bit0, bit1);
97      /* blue component */
98      bit0 = (color_prom[i | 0x000] >> 1) & 0x01;
99      bit1 = (color_prom[i | 0x100] >> 1) & 0x01;
100      b = combine_2_weights(bweights, bit0, bit1);
94101
95      bit0 = (color_prom[0] >> 2) & 0x01;
96      bit1 = (color_prom[machine->drv->total_colors] >> 2) & 0x01;
97
98      /*g = 0x55 * bit0 + 0xaa * bit1;*/
99      g = combine_2_weights(weights_g, bit0, bit1);
100
101      bit0 = (color_prom[0] >> 1) & 0x01;
102      bit1 = (color_prom[machine->drv->total_colors] >> 1) & 0x01;
103
104      /*b = 0x55 * bit0 + 0xaa * bit1;*/
105      b = combine_2_weights(weights_b, bit0, bit1);
106
107      palette_set_color(machine,i,MAKE_RGB(r,g,b));
108      color_prom++;
102      swapped_i = BITSWAP8(i,5,7,6,2,1,0,4,3);
103      palette_set_color(machine, swapped_i, MAKE_RGB(r, g, b));
109104   }
110
111   /* first bank of characters use colors 0-31, 64-95, 128-159 and 192-223 */
112   for (i = 0;i < 8;i++)
113   {
114      int j;
115
116
117      for (j = 0;j < 4;j++)
118      {
119         COLOR(0,4*i + j*4*8) = i + j*64;
120         COLOR(0,4*i + j*4*8 + 1) = 8 + i + j*64;
121         COLOR(0,4*i + j*4*8 + 2) = 2*8 + i + j*64;
122         COLOR(0,4*i + j*4*8 + 3) = 3*8 + i + j*64;
123      }
124   }
125
126   /* second bank of characters use colors 32-63, 96-127, 160-191 and 224-255 */
127   for (i = 0;i < 8;i++)
128   {
129      int j;
130
131
132      for (j = 0;j < 4;j++)
133      {
134         COLOR(1,4*i + j*4*8) = i + 32 + j*64;
135         COLOR(1,4*i + j*4*8 + 1) = 8 + i + 32 + j*64;
136         COLOR(1,4*i + j*4*8 + 2) = 2*8 + i + 32 + j*64;
137         COLOR(1,4*i + j*4*8 + 3) = 3*8 + i + 32 + j*64;
138      }
139   }
140105}
141106
142107
src/mame/video/runaway.c
r1679r1680
7777
7878VIDEO_START( runaway )
7979{
80   bg_tilemap = tilemap_create(runaway_get_tile_info, tilemap_scan_rows, TILEMAP_TYPE_PEN, 8, 8, 32, 30);
80   bg_tilemap = tilemap_create(runaway_get_tile_info, tilemap_scan_rows, 8, 8, 32, 30);
8181}
8282
8383
8484VIDEO_START( qwak )
8585{
86   bg_tilemap = tilemap_create(qwak_get_tile_info, tilemap_scan_rows, TILEMAP_TYPE_PEN, 8, 8, 32, 30);
86   bg_tilemap = tilemap_create(qwak_get_tile_info, tilemap_scan_rows, 8, 8, 32, 30);
8787}
8888
8989
src/mame/video/toypop.c
r1679r1680
122122
123123VIDEO_START( toypop )
124124{
125   bg_tilemap = tilemap_create(get_tile_info,tilemap_scan,TILEMAP_TYPE_PEN,8,8,36,28);
125   bg_tilemap = tilemap_create(get_tile_info,tilemap_scan,8,8,36,28);
126126
127127   tilemap_set_transparent_pen(bg_tilemap, 0);
128128}
src/mame/video/tumbleb.c
r1679r1680
459459
460460VIDEO_START( pangpang )
461461{
462   pf1_tilemap =     tilemap_create(pangpang_get_fg_tile_info, tilemap_scan_rows,TILEMAP_TYPE_PEN, 8, 8,64,32);
463   pf1_alt_tilemap = tilemap_create(pangpang_get_bg1_tile_info,tumblep_scan,TILEMAP_TYPE_PEN,16,16,64,32);
464   pf2_tilemap =     tilemap_create(pangpang_get_bg2_tile_info,tumblep_scan,TILEMAP_TYPE_PEN,     16,16,64,32);
462   pf1_tilemap =     tilemap_create(pangpang_get_fg_tile_info, tilemap_scan_rows, 8, 8,64,32);
463   pf1_alt_tilemap = tilemap_create(pangpang_get_bg1_tile_info,tumblep_scan,16,16,64,32);
464   pf2_tilemap =     tilemap_create(pangpang_get_bg2_tile_info,tumblep_scan,     16,16,64,32);
465465
466466   tilemap_set_transparent_pen(pf1_tilemap,0);
467467   tilemap_set_transparent_pen(pf1_alt_tilemap,0);
r1679r1680
474474
475475VIDEO_START( tumblepb )
476476{
477   pf1_tilemap =     tilemap_create(get_fg_tile_info, tilemap_scan_rows,TILEMAP_TYPE_PEN, 8, 8,64,32);
478   pf1_alt_tilemap = tilemap_create(get_bg1_tile_info,tumblep_scan,TILEMAP_TYPE_PEN,16,16,64,32);
479   pf2_tilemap =     tilemap_create(get_bg2_tile_info,tumblep_scan,TILEMAP_TYPE_PEN,     16,16,64,32);
477   pf1_tilemap =     tilemap_create(get_fg_tile_info, tilemap_scan_rows, 8, 8,64,32);
478   pf1_alt_tilemap = tilemap_create(get_bg1_tile_info,tumblep_scan,16,16,64,32);
479   pf2_tilemap =     tilemap_create(get_bg2_tile_info,tumblep_scan,     16,16,64,32);
480480
481481   tilemap_set_transparent_pen(pf1_tilemap,0);
482482   tilemap_set_transparent_pen(pf1_alt_tilemap,0);
r1679r1680
488488
489489VIDEO_START( sdfight )
490490{
491   pf1_tilemap =     tilemap_create(get_fg_tile_info, tilemap_scan_rows,TILEMAP_TYPE_PEN, 8, 8,64,64); // 64*64 to prevent bad tilemap wrapping? - check real behavior
492   pf1_alt_tilemap = tilemap_create(get_bg1_tile_info,tumblep_scan,TILEMAP_TYPE_PEN,16,16,64,32);
493   pf2_tilemap =     tilemap_create(get_bg2_tile_info,tumblep_scan,TILEMAP_TYPE_PEN,     16,16,64,32);
491   pf1_tilemap =     tilemap_create(get_fg_tile_info, tilemap_scan_rows, 8, 8,64,64); // 64*64 to prevent bad tilemap wrapping? - check real behavior
492   pf1_alt_tilemap = tilemap_create(get_bg1_tile_info,tumblep_scan,16,16,64,32);
493   pf2_tilemap =     tilemap_create(get_bg2_tile_info,tumblep_scan,     16,16,64,32);
494494
495495   tilemap_set_transparent_pen(pf1_tilemap,0);
496496   tilemap_set_transparent_pen(pf1_alt_tilemap,0);
r1679r1680
503503
504504VIDEO_START( fncywld )
505505{
506   pf1_tilemap =     tilemap_create(get_fncywld_fg_tile_info, tilemap_scan_rows,TILEMAP_TYPE_PEN, 8, 8,64,32);
507   pf1_alt_tilemap = tilemap_create(get_fncywld_bg1_tile_info,tumblep_scan,TILEMAP_TYPE_PEN,16,16,64,32);
508   pf2_tilemap =     tilemap_create(get_fncywld_bg2_tile_info,tumblep_scan,TILEMAP_TYPE_PEN,     16,16,64,32);
506   pf1_tilemap =     tilemap_create(get_fncywld_fg_tile_info, tilemap_scan_rows, 8, 8,64,32);
507   pf1_alt_tilemap = tilemap_create(get_fncywld_bg1_tile_info,tumblep_scan,16,16,64,32);
508   pf2_tilemap =     tilemap_create(get_fncywld_bg2_tile_info,tumblep_scan,     16,16,64,32);
509509
510510   tilemap_set_transparent_pen(pf1_tilemap,15);
511511   tilemap_set_transparent_pen(pf1_alt_tilemap,15);
r1679r1680
517517
518518VIDEO_START( jumppop )
519519{
520   pf1_tilemap =     tilemap_create(get_jumppop_fg_tile_info, tilemap_scan_rows,TILEMAP_TYPE_PEN, 8, 8,128,64);
521   pf1_alt_tilemap = tilemap_create(get_jumppop_bg1_tile_info,tilemap_scan_rows,TILEMAP_TYPE_PEN,16,16,64,64);
522   pf2_tilemap =     tilemap_create(get_jumppop_bg2_tile_info,tilemap_scan_rows,TILEMAP_TYPE_PEN,     16,16,64,64);
523   pf2_alt_tilemap =     tilemap_create(get_jumppop_bg2_alt_tile_info,tilemap_scan_rows,TILEMAP_TYPE_PEN,     8,8,128,64);
520   pf1_tilemap =     tilemap_create(get_jumppop_fg_tile_info, tilemap_scan_rows, 8, 8,128,64);
521   pf1_alt_tilemap = tilemap_create(get_jumppop_bg1_tile_info,tilemap_scan_rows,16,16,64,64);
522   pf2_tilemap =     tilemap_create(get_jumppop_bg2_tile_info,tilemap_scan_rows,     16,16,64,64);
523   pf2_alt_tilemap =     tilemap_create(get_jumppop_bg2_alt_tile_info,tilemap_scan_rows,     8,8,128,64);
524524
525525   tilemap_set_transparent_pen(pf1_tilemap,0);
526526   tilemap_set_transparent_pen(pf1_alt_tilemap,0);
r1679r1680
830830
831831VIDEO_START( suprtrio )
832832{
833   pf1_tilemap =     tilemap_create(get_fg_tile_info, tilemap_scan_rows,TILEMAP_TYPE_PEN, 8, 8,64,32);
834   pf1_alt_tilemap = tilemap_create(get_bg1_tile_info,tumblep_scan,TILEMAP_TYPE_PEN,16,16,64,32);
835   pf2_tilemap =     tilemap_create(get_bg2_tile_info,tumblep_scan,TILEMAP_TYPE_PEN,     16,16,64,32);
833   pf1_tilemap =     tilemap_create(get_fg_tile_info, tilemap_scan_rows, 8, 8,64,32);
834   pf1_alt_tilemap = tilemap_create(get_bg1_tile_info,tumblep_scan,16,16,64,32);
835   pf2_tilemap =     tilemap_create(get_bg2_tile_info,tumblep_scan,     16,16,64,32);
836836
837837   tilemap_set_transparent_pen(pf1_alt_tilemap,0);
838838   bcstory_tilebank = 0;
src/mame/video/kchamp.c
r1679r1680
2121      blue = color_prom[2*machine->drv->total_colors+i];
2222
2323      palette_set_color_rgb(machine,i,pal4bit(red),pal4bit(green),pal4bit(blue));
24
25      *(colortable++) = i;
2624   }
2725}
2826
r1679r1680
5452VIDEO_START( kchamp )
5553{
5654   bg_tilemap = tilemap_create(get_bg_tile_info, tilemap_scan_rows,
57      TILEMAP_TYPE_PEN, 8, 8, 32, 32);
55      8, 8, 32, 32);
5856}
5957
6058/*
src/mame/video/digdug.c
r1679r1680
149149
150150VIDEO_START( digdug )
151151{
152   bg_tilemap = tilemap_create(bg_get_tile_info,tilemap_scan,TILEMAP_TYPE_PEN,     8,8,36,28);
153   tx_tilemap = tilemap_create(tx_get_tile_info,tilemap_scan,TILEMAP_TYPE_PEN,8,8,36,28);
152   bg_tilemap = tilemap_create(bg_get_tile_info,tilemap_scan,     8,8,36,28);
153   tx_tilemap = tilemap_create(tx_get_tile_info,tilemap_scan,8,8,36,28);
154154
155155   tilemap_set_transparent_pen(tx_tilemap, 0);
156156
src/mame/video/ultratnk.c
r1679r1680
5555{
5656   helper = auto_bitmap_alloc(machine->screen[0].width, machine->screen[0].height, machine->screen[0].format);
5757
58   playfield = tilemap_create(ultratnk_tile_info, tilemap_scan_rows, TILEMAP_TYPE_PEN, 8, 8, 32, 32);
58   playfield = tilemap_create(ultratnk_tile_info, tilemap_scan_rows, 8, 8, 32, 32);
5959}
6060
6161
src/mame/video/m90.c
r1679r1680
5555
5656VIDEO_START( m90 )
5757{
58   pf1_layer =      tilemap_create(get_pf1_tile_info, tilemap_scan_rows,TILEMAP_TYPE_PEN,8,8,64,64);
59   pf1_wide_layer = tilemap_create(get_pf1w_tile_info,tilemap_scan_rows,TILEMAP_TYPE_PEN,8,8,128,64);
60   pf2_layer =      tilemap_create(get_pf2_tile_info, tilemap_scan_rows,TILEMAP_TYPE_PEN,8,8,64,64);
61   pf2_wide_layer = tilemap_create(get_pf2w_tile_info,tilemap_scan_rows,TILEMAP_TYPE_PEN,8,8,128,64);
58   pf1_layer =      tilemap_create(get_pf1_tile_info, tilemap_scan_rows,8,8,64,64);
59   pf1_wide_layer = tilemap_create(get_pf1w_tile_info,tilemap_scan_rows,8,8,128,64);
60   pf2_layer =      tilemap_create(get_pf2_tile_info, tilemap_scan_rows,8,8,64,64);
61   pf2_wide_layer = tilemap_create(get_pf2w_tile_info,tilemap_scan_rows,8,8,128,64);
6262
6363   tilemap_set_transparent_pen(pf1_layer,0);
6464   tilemap_set_transparent_pen(pf1_wide_layer,0);
src/mame/video/scotrsht.c
r1679r1680
1010PALETTE_INIT( scotrsht )
1111{
1212   int i;
13   #define TOTAL_COLORS(gfxn) (machine->gfx[gfxn]->total_colors * machine->gfx[gfxn]->color_granularity)
14   #define COLOR(gfxn,offs) (colortable[machine->drv->gfxdecodeinfo[gfxn].color_codes_start + offs])
1513
14   /* allocate the colortable */
15   machine->colortable = colortable_alloc(machine, 0x100);
1616
17   for (i = 0;i < machine->drv->total_colors;i++)
17   /* create a lookup table for the palette */
18   for (i = 0; i < 0x100; i++)
1819   {
19      int bit0,bit1,bit2,bit3,r,g,b;
20      int r = pal4bit(color_prom[i + 0x000]);
21      int g = pal4bit(color_prom[i + 0x100]);
22      int b = pal4bit(color_prom[i + 0x200]);
2023
21
22      bit0 = (color_prom[0] >> 0) & 0x01;
23      bit1 = (color_prom[0] >> 1) & 0x01;
24      bit2 = (color_prom[0] >> 2) & 0x01;
25      bit3 = (color_prom[0] >> 3) & 0x01;
26      r = 0x0e * bit0 + 0x1f * bit1 + 0x43 * bit2 + 0x8f * bit3;
27      bit0 = (color_prom[machine->drv->total_colors] >> 0) & 0x01;
28      bit1 = (color_prom[machine->drv->total_colors] >> 1) & 0x01;
29      bit2 = (color_prom[machine->drv->total_colors] >> 2) & 0x01;
30      bit3 = (color_prom[machine->drv->total_colors] >> 3) & 0x01;
31      g = 0x0e * bit0 + 0x1f * bit1 + 0x43 * bit2 + 0x8f * bit3;
32      bit0 = (color_prom[2*machine->drv->total_colors] >> 0) & 0x01;
33      bit1 = (color_prom[2*machine->drv->total_colors] >> 1) & 0x01;
34      bit2 = (color_prom[2*machine->drv->total_colors] >> 2) & 0x01;
35      bit3 = (color_prom[2*machine->drv->total_colors] >> 3) & 0x01;
36      b = 0x0e * bit0 + 0x1f * bit1 + 0x43 * bit2 + 0x8f * bit3;
37
38      palette_set_color(machine,i,MAKE_RGB(r,g,b));
39      color_prom++;
24      colortable_palette_set_color(machine->colortable, i, MAKE_RGB(r, g, b));
4025   }
4126
42   color_prom += 2*machine->drv->total_colors;
43   /* color_prom now points to the beginning of the character lookup table */
27   /* color_prom now points to the beginning of the lookup table */
28   color_prom += 0x300;
4429
45
46   /* there are eight 16 colors palette banks; sprites use colors 0x00-0x7f and */
47   /* characters 0x80-0xff. */
48   for (i = 0;i < TOTAL_COLORS(0)/8;i++)
30   /* characters use colors 0x80-0xff, sprites use colors 0-0x7f */
31   for (i = 0; i < 0x200; i++)
4932   {
5033      int j;
5134
52
53      for (j = 0;j < 8;j++)
54         COLOR(0,i + j * TOTAL_COLORS(0)/8) = (*color_prom & 0x0f) + 16 * j + 0x80;
55
56      color_prom++;
35      for (j = 0; j < 8; j++)
36      {
37         UINT8 ctabentry = ((~i & 0x100) >> 1) | (j << 4) | (color_prom[i] & 0x0f);
38         colortable_entry_set_value(machine->colortable, ((i & 0x100) << 3) | (j << 8) | (i & 0xff), ctabentry);
39      }
5740   }
58
59   for (i = 0;i < TOTAL_COLORS(1)/8;i++)
60   {
61      int j;
62
63
64      for (j = 0;j < 8;j++)
65         COLOR(1,i + j * TOTAL_COLORS(1)/8) = (*color_prom & 0x0f) + 16 * j;
66
67      color_prom++;
68   }
6941}
7042
7143WRITE8_HANDLER( scotrsht_videoram_w )
r1679r1680
145117      }
146118
147119      drawgfx(bitmap, machine->gfx[1], code, color, flipx, flipy,
148         sx, sy, cliprect, TRANSPARENCY_COLOR, scotrsht_palette_bank * 16);
120         sx, sy, cliprect, TRANSPARENCY_PENS,
121         colortable_get_transpen_mask(machine->colortable, machine->gfx[1], color, scotrsht_palette_bank * 16));
149122   }
150123}
151124
152125VIDEO_START( scotrsht )
153126{
154   bg_tilemap = tilemap_create(scotrsht_get_bg_tile_info, tilemap_scan_rows, TILEMAP_TYPE_PEN, 8, 8, 64, 32);
127   bg_tilemap = tilemap_create(scotrsht_get_bg_tile_info, tilemap_scan_rows, 8, 8, 64, 32);
155128
156129   tilemap_set_scroll_cols(bg_tilemap, 64);
157130}
src/mame/video/phoenix.c
r1679r1680
184184
185185    videoram_pg_index = 0;
186186
187   fg_tilemap = tilemap_create(get_fg_tile_info,tilemap_scan_rows,TILEMAP_TYPE_PEN,8,8,32,32);
188   bg_tilemap = tilemap_create(get_bg_tile_info,tilemap_scan_rows,TILEMAP_TYPE_PEN,     8,8,32,32);
187   fg_tilemap = tilemap_create(get_fg_tile_info,tilemap_scan_rows,8,8,32,32);
188   bg_tilemap = tilemap_create(get_bg_tile_info,tilemap_scan_rows,     8,8,32,32);
189189
190190   tilemap_set_transparent_pen(fg_tilemap,0);
191191
src/mame/video/msisaac.c
r1679r1680
6161
6262VIDEO_START( msisaac )
6363{
64   background  = tilemap_create(get_bg_tile_info, tilemap_scan_rows,TILEMAP_TYPE_PEN,     8,8,32,32);
65   background2 = tilemap_create(get_bg2_tile_info,tilemap_scan_rows,TILEMAP_TYPE_PEN,8,8,32,32);
66   foreground  = tilemap_create(get_fg_tile_info, tilemap_scan_rows,TILEMAP_TYPE_PEN,8,8,32,32);
64   background  = tilemap_create(get_bg_tile_info, tilemap_scan_rows,     8,8,32,32);
65   background2 = tilemap_create(get_bg2_tile_info,tilemap_scan_rows,8,8,32,32);
66   foreground  = tilemap_create(get_fg_tile_info, tilemap_scan_rows,8,8,32,32);
6767
6868   tilemap_set_transparent_pen(background2,0);
6969   tilemap_set_transparent_pen(foreground,0);
src/mame/video/markham.c
r1679r1680
1010
1111#include "driver.h"
1212
13static UINT8 markham_xscroll[2];
1413
14UINT8 *markham_xscroll;
15
1516static tilemap *bg_tilemap;
1617
1718PALETTE_INIT( markham )
1819{
1920   int i;
2021
21   for (i = 0;i < machine->drv->total_colors;i++)
22   /* allocate the colortable */
23   machine->colortable = colortable_alloc(machine, 0x100);
24
25   /* create a lookup table for the palette */
26   for (i = 0; i < 0x100; i++)
2227   {
23      int r = color_prom[0];
24      int g = color_prom[machine->drv->total_colors];
25      int b = color_prom[2*machine->drv->total_colors];
28      int r = pal4bit(color_prom[i + 0x000]);
29      int g = pal4bit(color_prom[i + 0x100]);
30      int b = pal4bit(color_prom[i + 0x200]);
2631
27      palette_set_color_rgb(machine,i,pal4bit(r),pal4bit(g),pal4bit(b));
28      color_prom++;
32      colortable_palette_set_color(machine->colortable, i, MAKE_RGB(r, g, b));
2933   }
3034
31   color_prom += 2*machine->drv->total_colors;
32
3335   /* color_prom now points to the beginning of the lookup table */
36   color_prom += 0x300;
3437
3538   /* sprites lookup table */
36   for (i=0; i<512; i++)
37      *(colortable++) = *(color_prom++);
38
39   /* bg lookup table */
40   for (i=0; i<512; i++)
41      *(colortable++) = *(color_prom++);
42
39   for (i = 0; i < 0x400; i++)
40   {
41      UINT8 ctabentry = color_prom[i];
42      colortable_entry_set_value(machine->colortable, i, ctabentry);
43   }
4344}
4445
4546WRITE8_HANDLER( markham_videoram_w )
r1679r1680
4849   tilemap_mark_tile_dirty(bg_tilemap, offset / 2);
4950}
5051
51WRITE8_HANDLER( markham_scroll_x_w )
52{
53   markham_xscroll[offset] = data;
54}
55
5652WRITE8_HANDLER( markham_flipscreen_w )
5753{
5854   if (flip_screen != (data & 0x01))
r1679r1680
7470VIDEO_START( markham )
7571{
7672   bg_tilemap = tilemap_create(get_bg_tile_info, tilemap_scan_cols,
77      TILEMAP_TYPE_PEN, 8, 8, 32, 32);
73      8, 8, 32, 32);
7874
7975   tilemap_set_scroll_rows(bg_tilemap, 32);
8076}
r1679r1680
117113         col,
118114         fx,fy,
119115         px,py,
120         cliprect,TRANSPARENCY_COLOR,0);
116         cliprect,TRANSPARENCY_PENS,
117         colortable_get_transpen_mask(machine->colortable, machine->gfx[1], col, 0));
121118   }
122119}
123120
src/mame/video/superqix.c
r1679r1680
5656
5757VIDEO_START( pbillian )
5858{
59   bg_tilemap = tilemap_create(pb_get_bg_tile_info, tilemap_scan_rows, TILEMAP_TYPE_PEN, 8, 8,32,32);
59   bg_tilemap = tilemap_create(pb_get_bg_tile_info, tilemap_scan_rows, 8, 8,32,32);
6060}
6161
6262VIDEO_START( superqix )
6363{
6464   fg_bitmap[0] = auto_bitmap_alloc(256, 256, machine->screen[0].format);
6565   fg_bitmap[1] = auto_bitmap_alloc(256, 256, machine->screen[0].format);
66   bg_tilemap = tilemap_create(sqix_get_bg_tile_info, tilemap_scan_rows, TILEMAP_TYPE_PEN, 8, 8, 32, 32);
66   bg_tilemap = tilemap_create(sqix_get_bg_tile_info, tilemap_scan_rows, 8, 8, 32, 32);
6767
6868   tilemap_set_transmask(bg_tilemap,0,0xffff,0x0000); /* split type 0 is totally transparent in front half */
6969   tilemap_set_transmask(bg_tilemap,1,0x0001,0xfffe); /* split type 1 has pen 0 transparent in front half */
src/mame/video/playch10.c
r1679r1680
9999VIDEO_START( playch10 )
100100{
101101   bg_tilemap = tilemap_create(get_bg_tile_info, tilemap_scan_rows,
102      TILEMAP_TYPE_PEN, 8, 8, 32, 32);
102      8, 8, 32, 32);
103103
104104   ppu2c0x_init(machine, &ppu_interface );
105105}
src/mame/video/dday.c
r1679r1680
3131
3232READ8_HANDLER( dday_countdown_timer_r )
3333{
34    return ((timer_value / 10) << 4) | (timer_value % 10);
34   return ((timer_value / 10) << 4) | (timer_value % 10);
3535}
3636
3737static TIMER_CALLBACK( countdown_timer_callback )
r1679r1680
3939   timer_value--;
4040
4141   if (timer_value < 0)
42   {
4342      timer_value = 99;
44   }
4543}
4644
4745static void start_countdown_timer(void)
r1679r1680
6260{
6361   int i;
6462
63   palette_set_shadow_factor(machine, 1.0 / 8);
6564
66   palette_set_shadow_factor(machine, 1.0/8);   /* this matches the previous version of the driver (>>3) */
65   /* allocate the colortable */
66   machine->colortable = colortable_alloc(machine, 0x100);
6767
68   for (i = 0; i < machine->drv->total_colors; i++)
68   /* create a lookup table for the palette */
69   for (i = 0; i < 0x100; i++)
6970   {
70      int bit0,bit1,bit2,bit3,r,g,b;
71      int r = pal4bit(color_prom[i + 0x000]);
72      int g = pal4bit(color_prom[i + 0x100]);
73      int b = pal4bit(color_prom[i + 0x200]);
7174
72
73      /* red component */
74      bit0 = (color_prom[i] >> 0) & 0x01;
75      bit1 = (color_prom[i] >> 1) & 0x01;
76      bit2 = (color_prom[i] >> 2) & 0x01;
77      bit3 = (color_prom[i] >> 3) & 0x01;
78      r = 0x0e * bit0 + 0x1f * bit1 + 0x43 * bit2 + 0x8f * bit3;
79      /* green component */
80      bit0 = (color_prom[i + machine->drv->total_colors] >> 0) & 0x01;
81      bit1 = (color_prom[i + machine->drv->total_colors] >> 1) & 0x01;
82      bit2 = (color_prom[i + machine->drv->total_colors] >> 2) & 0x01;
83      bit3 = (color_prom[i + machine->drv->total_colors] >> 3) & 0x01;
84      g = 0x0e * bit0 + 0x1f * bit1 + 0x43 * bit2 + 0x8f * bit3;
85      /* blue component */
86      bit0 = (color_prom[i + 2*machine->drv->total_colors] >> 0) & 0x01;
87      bit1 = (color_prom[i + 2*machine->drv->total_colors] >> 1) & 0x01;
88      bit2 = (color_prom[i + 2*machine->drv->total_colors] >> 2) & 0x01;
89      bit3 = (color_prom[i + 2*machine->drv->total_colors] >> 3) & 0x01;
90      b = 0x0e * bit0 + 0x1f * bit1 + 0x43 * bit2 + 0x8f * bit3;
91
92      palette_set_color(machine,i,MAKE_RGB(r,g,b));
75      colortable_palette_set_color(machine->colortable, i, MAKE_RGB(r, g, b));
9376   }
9477
78   for (i = 0; i < 0x100; i++)
79      colortable_entry_set_value(machine->colortable, i, i);
9580
9681   /* HACK!!! This table is handgenerated, but it matches the screenshot.
9782       I have no clue how it really works */
83   colortable_entry_set_value(machine->colortable, 0*8+0+0, 0x00);
84   colortable_entry_set_value(machine->colortable, 0*8+0+1, 0x01);
85   colortable_entry_set_value(machine->colortable, 0*8+0+2, 0x15);
86   colortable_entry_set_value(machine->colortable, 0*8+0+3, 0x02);
87   colortable_entry_set_value(machine->colortable, 0*8+4+0, 0x00);
88   colortable_entry_set_value(machine->colortable, 0*8+4+1, 0x01);
89   colortable_entry_set_value(machine->colortable, 0*8+4+2, 0x15);
90   colortable_entry_set_value(machine->colortable, 0*8+4+3, 0x02);
9891
99   colortable[0*8+0] = 0;
100   colortable[0*8+1] = 1;
101   colortable[0*8+2] = 21;
102   colortable[0*8+3] = 2;
103   colortable[0*8+4+0] = 0;
104   colortable[0*8+4+1] = 1;
105   colortable[0*8+4+2] = 21;
106   colortable[0*8+4+3] = 2;
92   colortable_entry_set_value(machine->colortable, 1*8+0+0, 0x04);
93   colortable_entry_set_value(machine->colortable, 1*8+0+1, 0x05);
94   colortable_entry_set_value(machine->colortable, 1*8+0+2, 0x03);
95   colortable_entry_set_value(machine->colortable, 1*8+0+3, 0x07);
96   colortable_entry_set_value(machine->colortable, 1*8+4+0, 0x04);
97   colortable_entry_set_value(machine->colortable, 1*8+4+1, 0x05);
98   colortable_entry_set_value(machine->colortable, 1*8+4+2, 0x03);
99   colortable_entry_set_value(machine->colortable, 1*8+4+3, 0x07);
107100
108   colortable[1*8+0] = 4;
109   colortable[1*8+1] = 5;
110   colortable[1*8+2] = 3;
111   colortable[1*8+3] = 7;
112   colortable[1*8+4+0] = 4;
113   colortable[1*8+4+1] = 5;
114   colortable[1*8+4+2] = 3;
115   colortable[1*8+4+3] = 7;
101   colortable_entry_set_value(machine->colortable, 2*8+0+0, 0x08);
102   colortable_entry_set_value(machine->colortable, 2*8+0+1, 0x15);
103   colortable_entry_set_value(machine->colortable, 2*8+0+2, 0x0a);
104   colortable_entry_set_value(machine->colortable, 2*8+0+3, 0x03);
105   colortable_entry_set_value(machine->colortable, 2*8+4+0, 0x08);
106   colortable_entry_set_value(machine->colortable, 2*8+4+1, 0x15);
107   colortable_entry_set_value(machine->colortable, 2*8+4+2, 0x0a);
108   colortable_entry_set_value(machine->colortable, 2*8+4+3, 0x03);
116109
117   colortable[2*8+0] = 8;
118   colortable[2*8+1] = 21;
119   colortable[2*8+2] = 10;
120   colortable[2*8+3] = 3;
121   colortable[2*8+4+0] = 8;
122   colortable[2*8+4+1] = 21;
123   colortable[2*8+4+2] = 10;
124   colortable[2*8+4+3] = 3;
110   colortable_entry_set_value(machine->colortable, 3*8+0+0, 0x08);
111   colortable_entry_set_value(machine->colortable, 3*8+0+1, 0x15);
112   colortable_entry_set_value(machine->colortable, 3*8+0+2, 0x0a);
113   colortable_entry_set_value(machine->colortable, 3*8+0+3, 0x03);
114   colortable_entry_set_value(machine->colortable, 3*8+4+0, 0x08);
115   colortable_entry_set_value(machine->colortable, 3*8+4+1, 0x15);
116   colortable_entry_set_value(machine->colortable, 3*8+4+2, 0x0a);
117   colortable_entry_set_value(machine->colortable, 3*8+4+3, 0x03);
125118
126   colortable[3*8+0] = 8;
127   colortable[3*8+1] = 21;
128   colortable[3*8+2] = 10;
129   colortable[3*8+3] = 3;
130   colortable[3*8+4+0] = 8;
131   colortable[3*8+4+1] = 21;
132   colortable[3*8+4+2] = 10;
133   colortable[3*8+4+3] = 3;
119   colortable_entry_set_value(machine->colortable, 4*8+0+0, 0x10);
120   colortable_entry_set_value(machine->colortable, 4*8+0+1, 0x11);
121   colortable_entry_set_value(machine->colortable, 4*8+0+2, 0x12);
122   colortable_entry_set_value(machine->colortable, 4*8+0+3, 0x07);
123   colortable_entry_set_value(machine->colortable, 4*8+4+0, 0x10);
124   colortable_entry_set_value(machine->colortable, 4*8+4+1, 0x11);
125   colortable_entry_set_value(machine->colortable, 4*8+4+2, 0x12);
126   colortable_entry_set_value(machine->colortable, 4*8+4+3, 0x07);
134127
135   colortable[4*8+0] = 16;
136   colortable[4*8+1] = 17;
137   colortable[4*8+2] = 18;
138   colortable[4*8+3] = 7;
139   colortable[4*8+4+0] = 16;
140   colortable[4*8+4+1] = 17;
141   colortable[4*8+4+2] = 18;
142   colortable[4*8+4+3] = 7;
128   colortable_entry_set_value(machine->colortable, 5*8+0+0, 0x1d);
129   colortable_entry_set_value(machine->colortable, 5*8+0+1, 0x15);
130   colortable_entry_set_value(machine->colortable, 5*8+0+2, 0x16);
131   colortable_entry_set_value(machine->colortable, 5*8+0+3, 0x1b);
132   colortable_entry_set_value(machine->colortable, 5*8+4+0, 0x1d);
133   colortable_entry_set_value(machine->colortable, 5*8+4+1, 0x15);
134   colortable_entry_set_value(machine->colortable, 5*8+4+2, 0x16);
135   colortable_entry_set_value(machine->colortable, 5*8+4+3, 0x1b);
143136
144   colortable[5*8+0] = 29;
145   colortable[5*8+1] = 21;
146   colortable[5*8+2] = 22;
147   colortable[5*8+3] = 27;
148   colortable[5*8+4+0] = 29;
149   colortable[5*8+4+1] = 21;
150   colortable[5*8+4+2] = 22;
151   colortable[5*8+4+3] = 27;
137   colortable_entry_set_value(machine->colortable, 6*8+0+0, 0x1d);
138   colortable_entry_set_value(machine->colortable, 6*8+0+1, 0x15);
139   colortable_entry_set_value(machine->colortable, 6*8+0+2, 0x1a);
140   colortable_entry_set_value(machine->colortable, 6*8+0+3, 0x1b);
141   colortable_entry_set_value(machine->colortable, 6*8+4+0, 0x1d);
142   colortable_entry_set_value(machine->colortable, 6*8+4+1, 0x15);
143   colortable_entry_set_value(machine->colortable, 6*8+4+2, 0x1a);
144   colortable_entry_set_value(machine->colortable, 6*8+4+3, 0x1b);
152145
153   colortable[6*8+0] = 29;
154   colortable[6*8+1] = 21;
155   colortable[6*8+2] = 26;
156   colortable[6*8+3] = 27;
157   colortable[6*8+4+0] = 29;
158   colortable[6*8+4+1] = 21;
159   colortable[6*8+4+2] = 26;
160   colortable[6*8+4+3] = 27;
161
162   colortable[7*8+0] = 29;
163   colortable[7*8+1] = 2;
164   colortable[7*8+2] = 4;
165   colortable[7*8+3] = 27;
166   colortable[7*8+4+0] = 29;
167   colortable[7*8+4+1] = 2;
168   colortable[7*8+4+2] = 4;
169   colortable[7*8+4+3] = 27;
146   colortable_entry_set_value(machine->colortable, 7*8+0+0, 0x1d);
147   colortable_entry_set_value(machine->colortable, 7*8+0+1, 0x02);
148   colortable_entry_set_value(machine->colortable, 7*8+0+2, 0x04);
149   colortable_entry_set_value(machine->colortable, 7*8+0+3, 0x1b);
150   colortable_entry_set_value(machine->colortable, 7*8+4+0, 0x1d);
151   colortable_entry_set_value(machine->colortable, 7*8+4+1, 0x02);
152   colortable_entry_set_value(machine->colortable, 7*8+4+2, 0x04);
153   colortable_entry_set_value(machine->colortable, 7*8+4+3, 0x1b);
170154}
171155
172156
r1679r1680
216200
217201   code = sl_map[flipx ? tile_index ^ 0x0f : tile_index];
218202
219   if (sl_flipx != flipx)
220   {
221      if (code & 0x80)
222      {
223         /* no mirroring, draw dark spot */
224         code = 1;
225      }
226   }
203   if ((sl_flipx != flipx) && (code & 0x80))
204      /* no mirroring, draw dark spot */
205      code = 1;
227206
228207   SET_TILE_INFO(3, code & 0x3f, 0, flipx ? TILE_FLIPX : 0);
229208}
r1679r1680
237216
238217VIDEO_START( dday )
239218{
240   bg_tilemap   = tilemap_create(get_bg_tile_info,  tilemap_scan_rows,TILEMAP_TYPE_PEN,8,8,32,32);
241   fg_tilemap   = tilemap_create(get_fg_tile_info,  tilemap_scan_rows,TILEMAP_TYPE_PEN,8,8,32,32);
242   text_tilemap = tilemap_create(get_text_tile_info,tilemap_scan_rows,TILEMAP_TYPE_PEN,8,8,32,32);
243   sl_tilemap   = tilemap_create(get_sl_tile_info,  tilemap_scan_rows,TILEMAP_TYPE_PEN,8,8,32,32);
219   bg_tilemap   = tilemap_create(get_bg_tile_info,  tilemap_scan_rows,8,8,32,32);
220   fg_tilemap   = tilemap_create(get_fg_tile_info,  tilemap_scan_rows,8,8,32,32);
221   text_tilemap = tilemap_create(get_text_tile_info,tilemap_scan_rows,8,8,32,32);
222   sl_tilemap   = tilemap_create(get_sl_tile_info,  tilemap_scan_rows,8,8,32,32);
244223
245224   main_bitmap = auto_bitmap_alloc(machine->screen[0].width,machine->screen[0].height,machine->screen[0].format);
246225
r1679r1680
280259{
281260   int i;
282261
283
284262   offset &= 0x03e0;
285263
286    dday_colorram[offset & 0x3e0] = data;
264   dday_colorram[offset & 0x3e0] = data;
287265
288    for (i = 0; i < 0x20; i++)
289    {
266   for (i = 0; i < 0x20; i++)
290267      tilemap_mark_tile_dirty(fg_tilemap, offset + i);
291   }
292268}
293269
294270READ8_HANDLER( dday_colorram_r )
295271{
296    return dday_colorram[offset & 0x03e0];
272   return dday_colorram[offset & 0x03e0];
297273}
298274
299275
src/mame/video/cyberbal.c
r1679r1680
170170   atarimo_1_slipram = &current_slip[1];
171171
172172   /* initialize the playfield */
173   atarigen_playfield_tilemap = tilemap_create(get_playfield_tile_info, tilemap_scan_rows, TILEMAP_TYPE_PEN, 16,8, 64,64);
173   atarigen_playfield_tilemap = tilemap_create(get_playfield_tile_info, tilemap_scan_rows, 16,8, 64,64);
174174
175175   /* initialize the motion objects */
176176   atarimo_init(machine, 0, &mo0desc);
177177
178178   /* initialize the alphanumerics */
179   atarigen_alpha_tilemap = tilemap_create(get_alpha_tile_info, tilemap_scan_rows, TILEMAP_TYPE_PEN, 16,8, 64,32);
179   atarigen_alpha_tilemap = tilemap_create(get_alpha_tile_info, tilemap_scan_rows, 16,8, 64,32);
180180   tilemap_set_transparent_pen(atarigen_alpha_tilemap, 0);
181181
182182   /* allocate the second screen if necessary */
183183   if (screens == 2)
184184   {
185185      /* initialize the playfield */
186      atarigen_playfield2_tilemap = tilemap_create(get_playfield2_tile_info, tilemap_scan_rows, TILEMAP_TYPE_PEN, 16,8, 64,64);
186      atarigen_playfield2_tilemap = tilemap_create(get_playfield2_tile_info, tilemap_scan_rows, 16,8, 64,64);
187187      tilemap_set_scrollx(atarigen_playfield2_tilemap, 0, 0);
188188
189189      /* initialize the motion objects */
190190      atarimo_init(machine, 1, &mo1desc);
191191
192192      /* initialize the alphanumerics */
193      atarigen_alpha2_tilemap = tilemap_create(get_alpha2_tile_info, tilemap_scan_rows, TILEMAP_TYPE_PEN, 16,8, 64,32);
193      atarigen_alpha2_tilemap = tilemap_create(get_alpha2_tile_info, tilemap_scan_rows, 16,8, 64,32);
194194      tilemap_set_scrollx(atarigen_alpha2_tilemap, 0, 0);
195195      tilemap_set_transparent_pen(atarigen_alpha2_tilemap, 0);
196196   }
src/mame/video/lockon.c
r1679r1680
118118   if (lockon_main_inten)
119119      cpunum_set_input_line_and_vector(machine, MAIN_CPU, 0, HOLD_LINE, 0xff);
120120
121   timer_adjust(cursor_timer, video_screen_get_time_until_pos(0, CURSOR_YPOS, CURSOR_XPOS), 0, attotime_zero);
121   timer_adjust_oneshot(cursor_timer, video_screen_get_time_until_pos(0, CURSOR_YPOS, CURSOR_XPOS), 0);
122122}
123123
124124/*************************************
r1679r1680
428428      /* End of list marker */
429429      if (lockon_ground_ram[offs + 2] & 0x8000)
430430      {
431         timer_adjust(bufend_timer, attotime_mul(ATTOTIME_IN_HZ(FRAMEBUFFER_CLOCK), FRAMEBUFFER_MAX_X * y), 0, attotime_zero);
431         timer_adjust_oneshot(bufend_timer, attotime_mul(ATTOTIME_IN_HZ(FRAMEBUFFER_CLOCK), FRAMEBUFFER_MAX_X * y), 0);
432432      }
433433   }
434434}
r1679r1680
935935
936936VIDEO_START( lockon )
937937{
938   lockon_tilemap = tilemap_create(get_lockon_tile_info, tilemap_scan_rows,TILEMAP_TYPE_PEN, 8, 8, 64, 32);
938   lockon_tilemap = tilemap_create(get_lockon_tile_info, tilemap_scan_rows, 8, 8, 64, 32);
939939   tilemap_set_transparent_pen(lockon_tilemap, 0);
940940
941941   /* Allocate the two frame buffers for rotation */
r1679r1680
950950
951951   /* Timer for the CRTC cursor pulse */
952952   cursor_timer = timer_alloc(cursor_callback, NULL);
953   timer_adjust(cursor_timer, video_screen_get_time_until_pos(0, CURSOR_YPOS, CURSOR_XPOS), 0, attotime_zero);
953   timer_adjust_oneshot(cursor_timer, video_screen_get_time_until_pos(0, CURSOR_YPOS, CURSOR_XPOS), 0);
954954}
955955
956956VIDEO_UPDATE( lockon )
src/mame/video/mappy.c
r1679r1680
322322
323323VIDEO_START( superpac )
324324{
325   bg_tilemap = tilemap_create(superpac_get_tile_info,superpac_tilemap_scan,TILEMAP_TYPE_PEN,8,8,36,28);
325   bg_tilemap = tilemap_create(superpac_get_tile_info,superpac_tilemap_scan,8,8,36,28);
326326   sprite_bitmap = auto_bitmap_alloc(machine->screen[0].width,machine->screen[0].height,machine->screen[0].format);
327327
328328   colortable_configure_tilemap_groups(machine->colortable, bg_tilemap, machine->gfx[0], 31);
r1679r1680
334334
335335VIDEO_START( phozon )
336336{
337   bg_tilemap = tilemap_create(phozon_get_tile_info,superpac_tilemap_scan,TILEMAP_TYPE_PEN,8,8,36,28);
337   bg_tilemap = tilemap_create(phozon_get_tile_info,superpac_tilemap_scan,8,8,36,28);
338338
339339   colortable_configure_tilemap_groups(machine->colortable, bg_tilemap, machine->gfx[0], 15);
340340
r1679r1680
345345
346346VIDEO_START( mappy )
347347{
348   bg_tilemap = tilemap_create(mappy_get_tile_info,mappy_tilemap_scan,TILEMAP_TYPE_PEN,8,8,36,60);
348   bg_tilemap = tilemap_create(mappy_get_tile_info,mappy_tilemap_scan,8,8,36,60);
349349
350350   colortable_configure_tilemap_groups(machine->colortable, bg_tilemap, machine->gfx[0], 31);
351351   tilemap_set_scroll_cols(bg_tilemap, 36);
src/mame/video/tigeroad.c
r1679r1680
143143VIDEO_START( tigeroad )
144144{
145145   bg_tilemap = tilemap_create(get_bg_tile_info, tigeroad_tilemap_scan,
146      TILEMAP_TYPE_PEN, 32, 32, 128, 128);
146      32, 32, 128, 128);
147147
148148   fg_tilemap = tilemap_create(get_fg_tile_info, tilemap_scan_rows,
149      TILEMAP_TYPE_PEN, 8, 8, 32, 32);
149      8, 8, 32, 32);
150150
151151   tilemap_set_transmask(bg_tilemap, 0, 0xffff, 0);
152152   tilemap_set_transmask(bg_tilemap, 1, 0x1ff, 0xfe00);
src/mame/video/atari.c
r1679r1680
804804   UINT8 n, bits = 0;
805805   UINT8 b = gtia.w.colbk & 0xf0;
806806   UINT8 c = gtia.w.colpf1 & 0x0f;
807   UINT8 atari_A = Machine->remapped_colortable[((b+0x30)&0xf0)+c];
808   UINT8 atari_B = Machine->remapped_colortable[((b+0x70)&0xf0)+c];
809   UINT8 atari_C = Machine->remapped_colortable[b+c];
810   UINT8 atari_D = Machine->remapped_colortable[gtia.w.colbk];
807   UINT8 atari_A = Machine->pens[((b+0x30)&0xf0)+c];
808   UINT8 atari_B = Machine->pens[((b+0x70)&0xf0)+c];
809   UINT8 atari_C = Machine->pens[b+c];
810   UINT8 atari_D = Machine->pens[gtia.w.colbk];
811811
812812   for( x = 0; x < width * 4; x++ )
813813   {
r1679r1680
878878   UINT8 n, bits = 0;
879879   UINT8 b = gtia.w.colpf2 & 0xf0;
880880   UINT8 c = gtia.w.colpf1 & 0x0f;
881   UINT8 atari_A = Machine->remapped_colortable[((b+0x30)&0xf0)+c];
882   UINT8 atari_B = Machine->remapped_colortable[((b+0x70)&0xf0)+c];
883   UINT8 atari_C = Machine->remapped_colortable[b+c];
884   UINT8 atari_D = Machine->remapped_colortable[gtia.w.colpf2];
881   UINT8 atari_A = Machine->pens[((b+0x30)&0xf0)+c];
882   UINT8 atari_B = Machine->pens[((b+0x70)&0xf0)+c];
883   UINT8 atari_C = Machine->pens[b+c];
884   UINT8 atari_D = Machine->pens[gtia.w.colpf2];
885885
886886   for( x = 0; x < width * 4; x++ )
887887   {
src/mame/video/segas32.c
r1679r1680
303303   {
304304      struct cache_entry *entry = auto_malloc(sizeof(struct cache_entry));
305305
306      entry->tmap = tilemap_create(get_tile_info, tilemap_scan_rows, TILEMAP_TYPE_PEN, 16,16, 32,16);
306      entry->tmap = tilemap_create(get_tile_info, tilemap_scan_rows, 16,16, 32,16);
307307      entry->page = 0xff;
308308      entry->bank = 0;
309309      entry->next = cache_head;
src/mame/video/badlands.c
r1679r1680
8282   };
8383
8484   /* initialize the playfield */
85   atarigen_playfield_tilemap = tilemap_create(get_playfield_tile_info, tilemap_scan_rows, TILEMAP_TYPE_PEN, 8,8, 64,32);
85   atarigen_playfield_tilemap = tilemap_create(get_playfield_tile_info, tilemap_scan_rows, 8,8, 64,32);
8686
8787   /* initialize the motion objects */
8888   atarimo_init(machine, 0, &modesc);
src/mame/video/slapfght.c
r1679r1680
7575
7676VIDEO_START( perfrman )
7777{
78   pf1_tilemap = tilemap_create(get_pf_tile_info,tilemap_scan_rows,TILEMAP_TYPE_PEN,8,8,64,32);
78   pf1_tilemap = tilemap_create(get_pf_tile_info,tilemap_scan_rows,8,8,64,32);
7979
8080   tilemap_set_transparent_pen(pf1_tilemap,0);
8181}
8282
8383VIDEO_START( slapfight )
8484{
85   pf1_tilemap = tilemap_create(get_pf1_tile_info,tilemap_scan_rows,TILEMAP_TYPE_PEN,8,8,64,32);
86   fix_tilemap = tilemap_create(get_fix_tile_info,tilemap_scan_rows,TILEMAP_TYPE_PEN,8,8,64,32);
85   pf1_tilemap = tilemap_create(get_pf1_tile_info,tilemap_scan_rows,8,8,64,32);
86   fix_tilemap = tilemap_create(get_fix_tile_info,tilemap_scan_rows,8,8,64,32);
8787
8888   tilemap_set_transparent_pen(fix_tilemap,0);
8989}
src/mame/video/psikyosh.c
r1679r1680
443443         {
444444            for (xtile = xstart; xtile != xend; xtile += xinc )
445445            {
446               const pen_t *pal = &Machine->remapped_colortable[gfx->color_base + gfx->color_granularity * (color % gfx->total_colors)];
446               const pen_t *pal = &Machine->pens[gfx->color_base + gfx->color_granularity * (color % gfx->total_colors)];
447447               int source_base = ((code + code_offset++) % gfx->total_elements) * gfx->height;
448448
449449               int x_index_base, y_index, sx, sy, ex, ey;
r1679r1680
707707      /* Start drawing */
708708      if( gfx )
709709      {
710         const pen_t *pal = &Machine->remapped_colortable[gfx->color_base + gfx->color_granularity * (color % gfx->total_colors)];
710         const pen_t *pal = &Machine->pens[gfx->color_base + gfx->color_granularity * (color % gfx->total_colors)];
711711
712712         int sprite_screen_height = ((high*gfx->height*(0x400*0x400))/zoomy + 0x200)>>10; /* Round up to nearest pixel */
713713         int sprite_screen_width = ((wide*gfx->width*(0x400*0x400))/zoomx + 0x200)>>10;
src/mame/video/quizdna.c
r1679r1680
6060   quizdna_bg_ram = auto_malloc(0x2000);
6161   quizdna_fg_ram = auto_malloc(0x1000);
6262
63   quizdna_bg_tilemap = tilemap_create( get_bg_tile_info,tilemap_scan_rows,TILEMAP_TYPE_PEN,8,8,64,32 );
64   quizdna_fg_tilemap = tilemap_create( get_fg_tile_info,tilemap_scan_rows,TILEMAP_TYPE_PEN,16,8,32,32 );
63   quizdna_bg_tilemap = tilemap_create( get_bg_tile_info,tilemap_scan_rows,8,8,64,32 );
64   quizdna_fg_tilemap = tilemap_create( get_fg_tile_info,tilemap_scan_rows,16,8,32,32 );
6565
6666   tilemap_set_transparent_pen( quizdna_fg_tilemap,0 );
6767}
src/mame/video/offtwall.c
r1679r1680
7373   };
7474
7575   /* initialize the playfield */
76   atarigen_playfield_tilemap = tilemap_create(get_playfield_tile_info, tilemap_scan_cols, TILEMAP_TYPE_PEN, 8,8, 64,64);
76   atarigen_playfield_tilemap = tilemap_create(get_playfield_tile_info, tilemap_scan_cols, 8,8, 64,64);
7777
7878   /* initialize the motion objects */
7979   atarimo_init(machine, 0, &modesc);
src/mame/video/equites.c
r1679r1680
105105
106106VIDEO_START( equites )
107107{
108   charmap0 = tilemap_create(equites_charinfo, tilemap_scan_cols, TILEMAP_TYPE_PEN, 8, 8, 32, 32);
108   charmap0 = tilemap_create(equites_charinfo, tilemap_scan_cols, 8, 8, 32, 32);
109109   tilemap_set_transparent_pen(charmap0, 0);
110110   tilemap_set_scrolldx(charmap0, BMPAD, BMPAD);
111111   tilemap_set_scrolldy(charmap0, BMPAD, BMPAD);
r1679r1680
232232
233233   tmpbitmap = auto_bitmap_alloc(BMW, BMW, machine->screen[0].format);
234234
235   charmap0 = tilemap_create(splndrbt_char0info, tilemap_scan_cols, TILEMAP_TYPE_PEN, 8, 8, 32, 32);
235   charmap0 = tilemap_create(splndrbt_char0info, tilemap_scan_cols, 8, 8, 32, 32);
236236   tilemap_set_transparent_pen(charmap0, 0);
237237   tilemap_set_scrolldx(charmap0, 8, 8);
238238   tilemap_set_scrolldy(charmap0, 32, 32);
239239
240   charmap1 = tilemap_create(splndrbt_char1info, tilemap_scan_cols, TILEMAP_TYPE_PEN, 8, 8, 32, 32);
240   charmap1 = tilemap_create(splndrbt_char1info, tilemap_scan_cols, 8, 8, 32, 32);
241241   tilemap_set_transparent_pen(charmap1, 0);
242242   tilemap_set_scrolldx(charmap1, 8, 8);
243243   tilemap_set_scrolldy(charmap1, 32, 32);
src/mame/video/decocass.c
r1679r1680
584584   char_dirty = auto_malloc(1024);
585585   tile_dirty = auto_malloc(16);
586586
587   bg_tilemap_l = tilemap_create( get_bg_l_tile_info, bgvideoram_scan_cols, TILEMAP_TYPE_PEN, 16, 16, 32, 32 );
588   bg_tilemap_r = tilemap_create( get_bg_r_tile_info, bgvideoram_scan_cols, TILEMAP_TYPE_PEN, 16, 16, 32, 32 );
589   fg_tilemap = tilemap_create( get_fg_tile_info, fgvideoram_scan_cols, TILEMAP_TYPE_PEN,  8,  8, 32, 32 );
587   bg_tilemap_l = tilemap_create( get_bg_l_tile_info, bgvideoram_scan_cols,  16, 16, 32, 32 );
588   bg_tilemap_r = tilemap_create( get_bg_r_tile_info, bgvideoram_scan_cols,  16, 16, 32, 32 );
589   fg_tilemap = tilemap_create( get_fg_tile_info, fgvideoram_scan_cols,   8,  8, 32, 32 );
590590
591591   tilemap_set_transparent_pen( bg_tilemap_l, 0 );
592592   tilemap_set_transparent_pen( bg_tilemap_r, 0 );
src/mame/video/mystwarr.c
r1679r1680
180180   K053936_wraparound_enable(0, 1);
181181   K053936GP_set_offset(0, -10,  0); // floor tiles in demo loop2 (Elaine vs. boss)
182182
183   ult_936_tilemap = tilemap_create(get_gai_936_tile_info, tilemap_scan_rows, TILEMAP_TYPE_PEN, 16, 16, 512, 512);
183   ult_936_tilemap = tilemap_create(get_gai_936_tile_info, tilemap_scan_rows, 16, 16, 512, 512);
184184   tilemap_set_transparent_pen(ult_936_tilemap, 0);
185185}
186186
r1679r1680
224224   K053936_wraparound_enable(0, 1);
225225   K053936GP_set_offset(0, -8, 0); // Brainy's laser
226226
227   ult_936_tilemap = tilemap_create(get_ult_936_tile_info, tilemap_scan_rows, TILEMAP_TYPE_PEN, 16, 16, 512, 512);
227   ult_936_tilemap = tilemap_create(get_ult_936_tile_info, tilemap_scan_rows, 16, 16, 512, 512);
228228   tilemap_set_transparent_pen(ult_936_tilemap, 0);
229229}
230230
src/mame/video/fromance.c
r1679r1680
7777VIDEO_START( fromance )
7878{
7979   /* allocate tilemaps */
80   bg_tilemap = tilemap_create(get_fromance_bg_tile_info, tilemap_scan_rows, TILEMAP_TYPE_PEN,      8,4, 64,64);
81   fg_tilemap = tilemap_create(get_fromance_fg_tile_info, tilemap_scan_rows, TILEMAP_TYPE_PEN, 8,4, 64,64);
80   bg_tilemap = tilemap_create(get_fromance_bg_tile_info, tilemap_scan_rows,       8,4, 64,64);
81   fg_tilemap = tilemap_create(get_fromance_fg_tile_info, tilemap_scan_rows,  8,4, 64,64);
8282
8383   /* allocate local videoram */
8484   local_videoram[0] = auto_malloc(0x1000 * 3);
r1679r1680
116116VIDEO_START( nekkyoku )
117117{
118118   /* allocate tilemaps */
119   bg_tilemap = tilemap_create(get_nekkyoku_bg_tile_info, tilemap_scan_rows, TILEMAP_TYPE_PEN,      8,4, 64,64);
120   fg_tilemap = tilemap_create(get_nekkyoku_fg_tile_info, tilemap_scan_rows, TILEMAP_TYPE_PEN, 8,4, 64,64);
119   bg_tilemap = tilemap_create(get_nekkyoku_bg_tile_info, tilemap_scan_rows,       8,4, 64,64);
120   fg_tilemap = tilemap_create(get_nekkyoku_fg_tile_info, tilemap_scan_rows,  8,4, 64,64);
121121
122122   /* allocate local videoram */
123123   local_videoram[0] = auto_malloc(0x1000 * 3);
r1679r1680
295295{
296296   cpunum_set_input_line(machine, 1, 0, HOLD_LINE);
297297   if (param != 0)
298      timer_adjust(crtc_timer, attotime_make(0, machine->screen[0].refresh / param), 0, attotime_make(0, machine->screen[0].refresh / param));
298      timer_adjust_periodic(crtc_timer, attotime_make(0, machine->screen[0].refresh / param), 0, attotime_make(0, machine->screen[0].refresh / param));
299299}
300300
301301
r1679r1680
307307   {
308308      /* only register we know about.... */
309309      case 0x0b:
310         timer_adjust(crtc_timer, video_screen_get_time_until_pos(0, Machine->screen[0].visarea.max_y + 1, 0), (data > 0x80) ? 2 : 1, attotime_zero);
310         timer_adjust_oneshot(crtc_timer, video_screen_get_time_until_pos(0, Machine->screen[0].visarea.max_y + 1, 0), (data > 0x80) ? 2 : 1);
311311         break;
312312
313313      default:
src/mame/video/skykid.c
r1679r1680
2323PALETTE_INIT( skykid )
2424{
2525   int i;
26   int bit0,bit1,bit2,bit3,r,g,b;
27   int totcolors = machine->drv->total_colors;
2826
29   for (i = 0; i < totcolors; i++)
27   /* allocate the colortable */
28   machine->colortable = colortable_alloc(machine, 0x100);
29
30   /* create a lookup table for the palette */
31   for (i = 0; i < 0x100; i++)
3032   {
31      /* red component */
32      bit0 = (color_prom[totcolors*0] >> 0) & 0x01;
33      bit1 = (color_prom[totcolors*0] >> 1) & 0x01;
34      bit2 = (color_prom[totcolors*0] >> 2) & 0x01;
35      bit3 = (color_prom[totcolors*0] >> 3) & 0x01;
36      r = 0x0e*bit0 + 0x1f*bit1 + 0x43*bit2 + 0x8f*bit3;
33      int r = pal4bit(color_prom[i + 0x000]);
34      int g = pal4bit(color_prom[i + 0x100]);
35      int b = pal4bit(color_prom[i + 0x200]);
3736
38      /* green component */
39      bit0 = (color_prom[totcolors*1] >> 0) & 0x01;
40      bit1 = (color_prom[totcolors*1] >> 1) & 0x01;
41      bit2 = (color_prom[totcolors*1] >> 2) & 0x01;
42      bit3 = (color_prom[totcolors*1] >> 3) & 0x01;
43      g = 0x0e*bit0 + 0x1f*bit1 + 0x43*bit2 + 0x8f*bit3;
44
45      /* blue component */
46      bit0 = (color_prom[totcolors*2] >> 0) & 0x01;
47      bit1 = (color_prom[totcolors*2] >> 1) & 0x01;
48      bit2 = (color_prom[totcolors*2] >> 2) & 0x01;
49      bit3 = (color_prom[totcolors*2] >> 3) & 0x01;
50      b = 0x0e*bit0 + 0x1f*bit1 + 0x43*bit2 + 0x8f*bit3;
51
52      palette_set_color(machine,i,MAKE_RGB(r,g,b));
53      color_prom++;
37      colortable_palette_set_color(machine->colortable, i, MAKE_RGB(r, g, b));
5438   }
5539
56   /* text palette */
57   for (i = 0; i < 64*4; i++)
58      *(colortable++) = i;
59
60   color_prom += 2*totcolors;
6140   /* color_prom now points to the beginning of the lookup table */
41   color_prom += 0x300;
6242
63   /* tiles lookup table */
64   for (i = 0; i < 128*4; i++)
65      *(colortable++) = *(color_prom++);
43   /* text palette */
44   for (i = 0; i < 0x100; i++)
45      colortable_entry_set_value(machine->colortable, i, i);
6646
67   /* sprites lookup table */
68   for (i = 0;i < 64*8;i++)
69      *(colortable++) = *(color_prom++);
47   /* tiles/sprites */
48   for (i = 0x100; i < 0x500; i++)
49   {
50      UINT8 ctabentry = color_prom[i - 0x100];
51      colortable_entry_set_value(machine->colortable, i, ctabentry);
52   }
7053}
7154
7255
r1679r1680
128111
129112VIDEO_START( skykid )
130113{
131   tx_tilemap = tilemap_create(tx_get_tile_info,tx_tilemap_scan,  TILEMAP_TYPE_PEN,8,8,36,28);
132   bg_tilemap = tilemap_create(bg_get_tile_info,tilemap_scan_rows,TILEMAP_TYPE_PEN,     8,8,64,32);
114   tx_tilemap = tilemap_create(tx_get_tile_info,tx_tilemap_scan,  8,8,36,28);
115   bg_tilemap = tilemap_create(bg_get_tile_info,tilemap_scan_rows,     8,8,64,32);
133116
134117   tilemap_set_transparent_pen(tx_tilemap, 0);
135118
r1679r1680
240223               color,
241224               flipx,flipy,
242225               sx + 16*x,sy + 16*y,
243               cliprect,TRANSPARENCY_COLOR,0xff);
226               cliprect,TRANSPARENCY_PENS,
227               colortable_get_transpen_mask(machine->colortable, machine->gfx[2], color, 0xff));
244228         }
245229      }
246230   }
src/mame/video/klax.c
r1679r1680
7373   };
7474
7575   /* initialize the playfield */
76   atarigen_playfield_tilemap = tilemap_create(get_playfield_tile_info, tilemap_scan_cols, TILEMAP_TYPE_PEN, 8,8, 64,32);
76   atarigen_playfield_tilemap = tilemap_create(get_playfield_tile_info, tilemap_scan_cols, 8,8, 64,32);
7777
7878   /* initialize the motion objects */
7979   atarimo_init(machine, 0, &modesc);
src/mame/video/quizpani.c
r1679r1680
7373
7474VIDEO_START( quizpani )
7575{
76   bg_tilemap  = tilemap_create(bg_tile_info, bg_scan,TILEMAP_TYPE_PEN,16,16,256,32);
77   txt_tilemap = tilemap_create(txt_tile_info,bg_scan,TILEMAP_TYPE_PEN,16,16,256,32);
76   bg_tilemap  = tilemap_create(bg_tile_info, bg_scan,16,16,256,32);
77   txt_tilemap = tilemap_create(txt_tile_info,bg_scan,16,16,256,32);
7878   tilemap_set_transparent_pen(txt_tilemap,15);
7979}
8080
src/mame/video/gomoku.c
r1679r1680
121121
122122   gomoku_bg_bitmap = auto_bitmap_alloc(machine->screen[0].width, machine->screen[0].height, machine->screen[0].format);
123123
124   fg_tilemap = tilemap_create(get_fg_tile_info,tilemap_scan_rows,TILEMAP_TYPE_PEN,8,8,32, 32);
124   fg_tilemap = tilemap_create(get_fg_tile_info,tilemap_scan_rows,8,8,32, 32);
125125
126126   tilemap_set_transparent_pen(fg_tilemap,0);
127127
src/mame/video/djmain.c
r1679r1680
173173            order[j] = temp;
174174         }
175175
176   fillbitmap(bitmap, machine->remapped_colortable[0], cliprect);
176   fillbitmap(bitmap, machine->pens[0], cliprect);
177177
178178   for (i = 0; i < NUM_LAYERS + 1; i++)
179179   {
src/mame/video/firetrk.c
r1679r1680
290290   helper1 = auto_bitmap_alloc(machine->screen[0].width, machine->screen[0].height, machine->screen[0].format);
291291   helper2 = auto_bitmap_alloc(machine->screen[0].width, machine->screen[0].height, machine->screen[0].format);
292292
293   tilemap1 = tilemap_create(get_tile_info1, tilemap_scan_rows, TILEMAP_TYPE_PEN, 16, 16, 16, 16);
294   tilemap2 = tilemap_create(get_tile_info2, tilemap_scan_rows, TILEMAP_TYPE_PEN, 16, 16, 16, 16);
293   tilemap1 = tilemap_create(get_tile_info1, tilemap_scan_rows,  16, 16, 16, 16);
294   tilemap2 = tilemap_create(get_tile_info2, tilemap_scan_rows,  16, 16, 16, 16);
295295
296296   memset(&car[0], 0, sizeof (struct sprite_data));
297297   memset(&car[1], 0, sizeof (struct sprite_data));
src/mame/video/m57.c
r1679r1680
126126
127127VIDEO_START( m57 )
128128{
129   bg_tilemap = tilemap_create(get_tile_info, tilemap_scan_rows, TILEMAP_TYPE_PEN, 8, 8, 32, 32);
129   bg_tilemap = tilemap_create(get_tile_info, tilemap_scan_rows, 8, 8, 32, 32);
130130   tilemap_set_scroll_rows(bg_tilemap, 256);
131131}
132132
src/mame/video/mustache.c
r1679r1680
8989VIDEO_START( mustache )
9090{
9191   bg_tilemap = tilemap_create(get_bg_tile_info, tilemap_scan_rows_flip_x,
92      TILEMAP_TYPE_PEN, 8, 8, 64, 32);
92      8, 8, 64, 32);
9393
9494   tilemap_set_scroll_rows(bg_tilemap, 4);
9595}
src/mame/video/neogeo.c
r1679r1680
251251   else
252252      auto_animation_frame_counter = auto_animation_frame_counter - 1;
253253
254   timer_adjust(auto_animation_timer, video_screen_get_time_until_pos(0, NEOGEO_VSSTART, 0), 0, attotime_zero);
254   timer_adjust_oneshot(auto_animation_timer, video_screen_get_time_until_pos(0, NEOGEO_VSSTART, 0), 0);
255255}
256256
257257
r1679r1680
263263
264264static void start_auto_animation_timer(void)
265265{
266   timer_adjust(auto_animation_timer, video_screen_get_time_until_pos(0, NEOGEO_VSSTART, 0), 0, attotime_zero);
266   timer_adjust_oneshot(auto_animation_timer, video_screen_get_time_until_pos(0, NEOGEO_VSSTART, 0), 0);
267267}
268268
269269
r1679r1680
673673   /* let's come back at the beginning of the next line */
674674   scanline = (scanline + 1) % NEOGEO_VTOTAL;
675675
676   timer_adjust(sprite_line_timer, video_screen_get_time_until_pos(0, scanline, 0), scanline, attotime_zero);
676   timer_adjust_oneshot(sprite_line_timer, video_screen_get_time_until_pos(0, scanline, 0), scanline);
677677}
678678
679679
r1679r1680
685685
686686static void start_sprite_line_timer(void)
687687{
688   timer_adjust(sprite_line_timer, video_screen_get_time_until_pos(0, 0, 0), 0, attotime_zero);
688   timer_adjust_oneshot(sprite_line_timer, video_screen_get_time_until_pos(0, 0, 0), 0);
689689}
690690
691691
src/mame/video/konamigx.c
r1679r1680
273273
274274   _gxcommoninit(machine);
275275
276   gx_psac_tilemap = tilemap_create(get_gx_psac3_tile_info, tilemap_scan_rows, TILEMAP_TYPE_PEN, 16, 16, 256, 1024);
276   gx_psac_tilemap = tilemap_create(get_gx_psac3_tile_info, tilemap_scan_rows, 16, 16, 256, 1024);
277277   gx_rozenable = 1;
278278
279279   K053936_wraparound_enable(0, 1);
r1679r1680
286286
287287   _gxcommoninit(machine);
288288
289   gx_psac_tilemap = tilemap_create(get_gx_psac_tile_info, tilemap_scan_rows, TILEMAP_TYPE_PEN, 16, 16, 128, 128);
289   gx_psac_tilemap = tilemap_create(get_gx_psac_tile_info, tilemap_scan_rows, 16, 16, 128, 128);
290290   gx_rozenable = 1;
291291
292292   K053936_wraparound_enable(0, 0);
r1679r1680
321321   K056832_set_LayerOffset(2,  2+1, 0);
322322   K056832_set_LayerOffset(3,  3+1, 0);
323323
324   gx_psac_tilemap = tilemap_create(get_gx_psac1a_tile_info, tilemap_scan_rows, TILEMAP_TYPE_PEN, 16, 16, 128, 128);
325   gx_psac_tilemap2 = tilemap_create(get_gx_psac1b_tile_info, tilemap_scan_rows, TILEMAP_TYPE_PEN, 16, 16, 128, 128);
324   gx_psac_tilemap = tilemap_create(get_gx_psac1a_tile_info, tilemap_scan_rows,  16, 16, 128, 128);
325   gx_psac_tilemap2 = tilemap_create(get_gx_psac1b_tile_info, tilemap_scan_rows,  16, 16, 128, 128);
326326   tilemap_set_transparent_pen(gx_psac_tilemap, 0);
327327   tilemap_set_transparent_pen(gx_psac_tilemap2, 0);
328328
r1679r1680
341341   K056832_set_LayerOffset(2,  2+1, 0);
342342   K056832_set_LayerOffset(3,  3+1, 0);
343343
344   gx_psac_tilemap = tilemap_create(get_gx_psac1a_tile_info, tilemap_scan_rows, TILEMAP_TYPE_PEN, 16, 16, 128, 128);
345   gx_psac_tilemap2 = tilemap_create(get_gx_psac1b_tile_info, tilemap_scan_rows, TILEMAP_TYPE_PEN, 16, 16, 128, 128);
344   gx_psac_tilemap = tilemap_create(get_gx_psac1a_tile_info, tilemap_scan_rows,  16, 16, 128, 128);
345   gx_psac_tilemap2 = tilemap_create(get_gx_psac1b_tile_info, tilemap_scan_rows,  16, 16, 128, 128);
346346   tilemap_set_transparent_pen(gx_psac_tilemap, 0);
347347   tilemap_set_transparent_pen(gx_psac_tilemap2, 0);
348348
src/mame/video/sprcros2.c
r1679r1680
1212
1313PALETTE_INIT( sprcros2 )
1414{
15   int i,bit0,bit1,bit2,r,g,b;
15   int i;
1616
17   for (i = 0;i < machine->drv->total_colors; i++)
17   /* allocate the colortable */
18   machine->colortable = colortable_alloc(machine, 0x20);
19
20   /* create a lookup table for the palette */
21   for (i = 0; i < 0x20; i++)
1822   {
23      int bit0, bit1, bit2;
24      int r, g, b;
25
1926      /* red component */
2027      bit0 = (color_prom[i] >> 0) & 0x01;
2128      bit1 = (color_prom[i] >> 1) & 0x01;
2229      bit2 = (color_prom[i] >> 2) & 0x01;
2330      r = 0x21 * bit0 + 0x47 * bit1 + 0x97 * bit2;
31
2432      /* green component */
2533      bit0 = (color_prom[i] >> 3) & 0x01;
2634      bit1 = (color_prom[i] >> 4) & 0x01;
2735      bit2 = (color_prom[i] >> 5) & 0x01;
2836      g = 0x21 * bit0 + 0x47 * bit1 + 0x97 * bit2;
37
2938      /* blue component */
30      bit1 = (color_prom[i] >> 6) & 0x01;
31      bit2 = (color_prom[i] >> 7) & 0x01;
32      b = 0x47 * bit1 + 0xb8 * bit2;
39      bit0 = (color_prom[i] >> 6) & 0x01;
40      bit1 = (color_prom[i] >> 7) & 0x01;
41      b = 0x47 * bit0 + 0xb8 * bit1;
3342      palette_set_color(machine,i,MAKE_RGB(r,g,b));
43
44      colortable_palette_set_color(machine->colortable, i, MAKE_RGB(r, g, b));
3445   }
3546
36   //cluts
37   for (i = 0;i < 0x100; i++)
47   /* color_prom now points to the beginning of the lookup table */
48   color_prom += 0x20;
49
50   /* bg */
51   for (i = 0; i < 0x100; i++)
3852   {
39      colortable[i]=color_prom[i+0x20]+(color_prom[i+0x120]<<4);      //bg
40      colortable[i+0x100]=color_prom[i+0x220];                  //sprites
41      colortable[i+0x200]=color_prom[i+0x320];                  //fg
53      UINT8 ctabentry = (color_prom[i] & 0x0f) | ((color_prom[i + 0x100] & 0x0f) << 4);
54      colortable_entry_set_value(machine->colortable, i, ctabentry);
4255   }
56
57   /* sprites & fg */
58   for (i = 0x100; i < 0x300; i++)
59   {
60      UINT8 ctabentry = color_prom[i + 0x100];
61      colortable_entry_set_value(machine->colortable, i, ctabentry);
62   }
4363}
4464
4565WRITE8_HANDLER( sprcros2_fgvideoram_w )
r1679r1680
91111{
92112   UINT32 tile_number = sprcros2_fgvideoram[tile_index];
93113   UINT8 attr = sprcros2_fgvideoram[tile_index+0x400];
114   int color = (attr&0xfc)>>2;
94115
116   tileinfo->group = color;
117
95118   //attr
96119   //76543210
97120   //xxxxxx-- colour
r1679r1680
102125   SET_TILE_INFO(
103126         2,
104127         tile_number,
105         (attr&0xfc)>>2,
128         color,
106129         0);
107130}
108131
109132VIDEO_START( sprcros2 )
110133{
111   sprcros2_bgtilemap = tilemap_create( get_sprcros2_bgtile_info,tilemap_scan_rows,TILEMAP_TYPE_PEN,8,8,32,32 );
112   sprcros2_fgtilemap = tilemap_create( get_sprcros2_fgtile_info,tilemap_scan_rows,TILEMAP_TYPE_COLORTABLE,8,8,32,32 );
134   sprcros2_bgtilemap = tilemap_create( get_sprcros2_bgtile_info,tilemap_scan_rows,8,8,32,32 );
135   sprcros2_fgtilemap = tilemap_create( get_sprcros2_fgtile_info,tilemap_scan_rows,8,8,32,32 );
113136
114   tilemap_set_transparent_pen(sprcros2_fgtilemap,0);
137   colortable_configure_tilemap_groups(machine->colortable, sprcros2_fgtilemap, machine->gfx[2], 0);
115138}
116139
117140static void draw_sprites(running_machine *machine, mame_bitmap *bitmap,const rectangle *cliprect)
118141{
119   int offs,sx,sy,flipx,flipy;
142   int offs,sx,sy,color,flipx,flipy;
120143
121144   for (offs = sprcros2_spriteram_size-4; offs >= 0; offs -= 4)
122145   {
r1679r1680
139162
140163         sx = ((sprcros2_spriteram[offs+3]+0x10)%0x100)-0x10;
141164         sy = 225-(((sprcros2_spriteram[offs+2]+0x10)%0x100)-0x10);
165         color = (sprcros2_spriteram[offs+1]&0x38)>>3;
142166         flipx = sprcros2_spriteram[offs+1]&0x02;
143167         flipy = 0;
144168
r1679r1680
152176
153177         drawgfx(bitmap,machine->gfx[1],
154178            sprcros2_spriteram[offs],
155            (sprcros2_spriteram[offs+1]&0x38)>>3,
179            color,
156180            flipx,flipy,
157181            sx,sy,
158            cliprect,TRANSPARENCY_COLOR,0);
182            cliprect,TRANSPARENCY_PENS,
183            colortable_get_transpen_mask(machine->colortable, machine->gfx[1], color, 0));
159184      }
160185   }
161186}
src/mame/video/thunderj.c
r1679r1680
105105   };
106106
107107   /* initialize the playfield */
108   atarigen_playfield_tilemap = tilemap_create(get_playfield_tile_info, tilemap_scan_cols, TILEMAP_TYPE_PEN, 8,8, 64,64);
108   atarigen_playfield_tilemap = tilemap_create(get_playfield_tile_info, tilemap_scan_cols, 8,8, 64,64);
109109
110110   /* initialize the second playfield */
111   atarigen_playfield2_tilemap = tilemap_create(get_playfield2_tile_info, tilemap_scan_cols, TILEMAP_TYPE_PEN, 8,8, 64,64);
111   atarigen_playfield2_tilemap = tilemap_create(get_playfield2_tile_info, tilemap_scan_cols, 8,8, 64,64);
112112   tilemap_set_transparent_pen(atarigen_playfield2_tilemap, 0);
113113
114114   /* initialize the motion objects */
115115   atarimo_init(machine, 0, &modesc);
116116
117117   /* initialize the alphanumerics */
118   atarigen_alpha_tilemap = tilemap_create(get_alpha_tile_info, tilemap_scan_rows, TILEMAP_TYPE_PEN, 8,8, 64,32);
118   atarigen_alpha_tilemap = tilemap_create(get_alpha_tile_info, tilemap_scan_rows, 8,8, 64,32);
119119   tilemap_set_transparent_pen(atarigen_alpha_tilemap, 0);
120120}
121121
src/mame/video/ladybug.c
r1679r1680
327327VIDEO_START( ladybug )
328328{
329329   bg_tilemap = tilemap_create(get_bg_tile_info, tilemap_scan_rows,
330      TILEMAP_TYPE_PEN, 8, 8, 32, 32);
330      8, 8, 32, 32);
331331
332332   tilemap_set_scroll_rows(bg_tilemap, 32);
333333}
r1679r1680
335335VIDEO_START( sraider )
336336{
337337   grid_tilemap = tilemap_create(get_grid_tile_info, tilemap_scan_rows,
338      TILEMAP_TYPE_PEN, 8, 8, 32, 32);
338      8, 8, 32, 32);
339339
340340   tilemap_set_scroll_rows(grid_tilemap, 32);
341341
342342   bg_tilemap = tilemap_create(get_bg_tile_info, tilemap_scan_rows,
343      TILEMAP_TYPE_PEN, 8, 8, 32, 32);
343      8, 8, 32, 32);
344344
345345   tilemap_set_scroll_rows(bg_tilemap, 32);
346346
src/mame/video/combatsc.c
r1679r1680
261261{
262262   combasc_vreg = -1;
263263
264   bg_tilemap[0] = tilemap_create(get_tile_info0,tilemap_scan_rows,TILEMAP_TYPE_PEN,8,8,32,32);
265   bg_tilemap[1] = tilemap_create(get_tile_info1,tilemap_scan_rows,TILEMAP_TYPE_PEN,8,8,32,32);
266   textlayer =  tilemap_create(get_text_info, tilemap_scan_rows,TILEMAP_TYPE_PEN,     8,8,32,32);
264   bg_tilemap[0] = tilemap_create(get_tile_info0,tilemap_scan_rows,8,8,32,32);
265   bg_tilemap[1] = tilemap_create(get_tile_info1,tilemap_scan_rows,8,8,32,32);
266   textlayer =  tilemap_create(get_text_info, tilemap_scan_rows,     8,8,32,32);
267267
268268   private_spriteram[0] = auto_malloc(0x800);
269269   private_spriteram[1] = auto_malloc(0x800);
r1679r1680
281281{
282282   combasc_vreg = -1;
283283
284   bg_tilemap[0] = tilemap_create(get_tile_info0_bootleg,tilemap_scan_rows,TILEMAP_TYPE_PEN,8,8,32,32);
285   bg_tilemap[1] = tilemap_create(get_tile_info1_bootleg,tilemap_scan_rows,TILEMAP_TYPE_PEN,8,8,32,32);
286   textlayer =  tilemap_create(get_text_info_bootleg, tilemap_scan_rows,TILEMAP_TYPE_PEN,8,8,32,32);
284   bg_tilemap[0] = tilemap_create(get_tile_info0_bootleg,tilemap_scan_rows,8,8,32,32);
285   bg_tilemap[1] = tilemap_create(get_tile_info1_bootleg,tilemap_scan_rows,8,8,32,32);
286   textlayer =  tilemap_create(get_text_info_bootleg, tilemap_scan_rows,8,8,32,32);
287287
288288   private_spriteram[0] = auto_malloc(0x800);
289289   private_spriteram[1] = auto_malloc(0x800);
src/mame/video/blueprnt.c
r1679r1680
7979VIDEO_START( blueprnt )
8080{
8181   bg_tilemap = tilemap_create(get_bg_tile_info, tilemap_scan_cols_flip_x,
82      TILEMAP_TYPE_PEN, 8, 8, 32, 32);
82      8, 8, 32, 32);
8383
8484   tilemap_set_transparent_pen(bg_tilemap, 0);
8585   tilemap_set_scroll_cols(bg_tilemap, 32);
src/mame/video/ppu2c0x.c
r1679r1680
367367   if (this_ppu->hblank_callback_proc)
368368      (*this_ppu->hblank_callback_proc) (num, this_ppu->scanline, vblank, blanked);
369369
370   timer_adjust(chips[num].hblank_timer, attotime_never, num, attotime_never);
370   timer_adjust_oneshot(chips[num].hblank_timer, attotime_never, num);
371371}
372372
373373static TIMER_CALLBACK( nmi_callback )
r1679r1680
379379   if (intf->nmi_handler[num])
380380      (*intf->nmi_handler[num]) (num, ppu_regs);
381381
382   timer_adjust(chips[num].nmi_timer, attotime_never, num, attotime_never);
382   timer_adjust_oneshot(chips[num].nmi_timer, attotime_never, num);
383383}
384384
385385static void draw_background(const int num, UINT8 *line_priority )
r1679r1680
871871         // a game can read the high bit of $2002 before the NMI is called (potentially resetting the bit
872872         // via a read from $2002 in the NMI handler).
873873         // B-Wings is an example game that needs this.
874         timer_adjust(this_ppu->nmi_timer, ATTOTIME_IN_CYCLES(4, 0), num, attotime_never);
874         timer_adjust_oneshot(this_ppu->nmi_timer, ATTOTIME_IN_CYCLES(4, 0), num);
875875      }
876876   }
877877
r1679r1680
922922      next_scanline = 0;
923923
924924   // Call us back when the hblank starts for this scanline
925   timer_adjust(this_ppu->hblank_timer, ATTOTIME_IN_CYCLES(86.67, 0), num, attotime_never); // ??? FIXME - hardcoding NTSC, need better calculation
925   timer_adjust_oneshot(this_ppu->hblank_timer, ATTOTIME_IN_CYCLES(86.67, 0), num); // ??? FIXME - hardcoding NTSC, need better calculation
926926
927927   // trigger again at the start of the next scanline
928   timer_adjust(this_ppu->scanline_timer, video_screen_get_time_until_pos(0, next_scanline * this_ppu->scan_scale, 0), num, attotime_zero);
928   timer_adjust_oneshot(this_ppu->scanline_timer, video_screen_get_time_until_pos(0, next_scanline * this_ppu->scan_scale, 0), num);
929929}
930930
931931/*************************************
r1679r1680
950950   /* set the scan scale (this is for dual monitor vertical setups) */
951951   chips[num].scan_scale = scan_scale;
952952
953   timer_adjust(chips[num].nmi_timer, attotime_never, num, attotime_never);
953   timer_adjust_oneshot(chips[num].nmi_timer, attotime_never, num);
954954
955955   // Call us back when the hblank starts for this scanline
956   timer_adjust(chips[num].hblank_timer, ATTOTIME_IN_CYCLES(86.67, 0), num, attotime_never); // ??? FIXME - hardcoding NTSC, need better calculation
956   timer_adjust_oneshot(chips[num].hblank_timer, ATTOTIME_IN_CYCLES(86.67, 0), num); // ??? FIXME - hardcoding NTSC, need better calculation
957957
958958   // Call us back at the start of the next scanline
959   timer_adjust(chips[num].scanline_timer, video_screen_get_time_until_pos(0, 1, 0), num, attotime_zero);
959   timer_adjust_oneshot(chips[num].scanline_timer, video_screen_get_time_until_pos(0, 1, 0), num);
960960
961961   /* reset the callbacks */
962962   chips[num].scanline_callback_proc = 0;
src/mame/video/gotcha.c
r1679r1680
3939
4040VIDEO_START( gotcha )
4141{
42   fg_tilemap = tilemap_create(fg_get_tile_info,gotcha_tilemap_scan,TILEMAP_TYPE_PEN,16,16,64,32);
43   bg_tilemap = tilemap_create(bg_get_tile_info,gotcha_tilemap_scan,TILEMAP_TYPE_PEN,     16,16,64,32);
42   fg_tilemap = tilemap_create(fg_get_tile_info,gotcha_tilemap_scan,16,16,64,32);
43   bg_tilemap = tilemap_create(bg_get_tile_info,gotcha_tilemap_scan,     16,16,64,32);
4444
4545   tilemap_set_transparent_pen(fg_tilemap,0);
4646
src/mame/video/starshp1.c
r1679r1680
5151
5252   int i;
5353
54   bg_tilemap = tilemap_create(get_tile_info, tilemap_scan_rows, TILEMAP_TYPE_PEN, 16, 8, 32, 32);
54   bg_tilemap = tilemap_create(get_tile_info, tilemap_scan_rows, 16, 8, 32, 32);
5555
5656   tilemap_set_transparent_pen(bg_tilemap, 0);
5757
src/mame/video/pandoras.c
r1679r1680
11#include "driver.h"
2#include "video/resnet.h"
23
34static int flipscreen;
45static tilemap *layer0;
5extern UINT8 *pandoras_sharedram;
66
77/***********************************************************************
88
r1679r1680
2424***************************************************************************/
2525PALETTE_INIT( pandoras )
2626{
27   static const int resistances_rg[3] = { 1000, 470, 220 };
28   static const int resistances_b [2] = { 470, 220 };
29   double rweights[3], gweights[3], bweights[2];
2730   int i;
28   #define TOTAL_COLORS(gfxn) (machine->gfx[gfxn]->total_colors * machine->gfx[gfxn]->color_granularity)
29   #define COLOR(gfxn,offs) (colortable[machine->drv->gfxdecodeinfo[gfxn].color_codes_start + offs])
3031
31   for (i = 0; i < machine->drv->total_colors; i++)
32   /* compute the color output resistor weights */
33   compute_resistor_weights(0,   255, -1.0,
34         3, &resistances_rg[0], rweights, 1000, 0,
35         3, &resistances_rg[0], gweights, 1000, 0,
36         2, &resistances_b[0],  bweights, 1000, 0);
37
38   /* allocate the colortable */
39   machine->colortable = colortable_alloc(machine, 0x20);
40
41   /* create a lookup table for the palette */
42   for (i = 0; i < 0x20; i++)
3243   {
33      int bit0, bit1, bit2, r, g, b;
44      int bit0, bit1, bit2;
45      int r, g, b;
3446
3547      /* red component */
36      bit0 = (*color_prom >> 0) & 0x01;
37      bit1 = (*color_prom >> 1) & 0x01;
38      bit2 = (*color_prom >> 2) & 0x01;
39      r = 0x21 * bit0 + 0x47 * bit1 + 0x97 * bit2;
48      bit0 = (color_prom[i] >> 0) & 0x01;
49      bit1 = (color_prom[i] >> 1) & 0x01;
50      bit2 = (color_prom[i] >> 2) & 0x01;
51      r = combine_3_weights(rweights, bit0, bit1, bit2);
4052
4153      /* green component */
42      bit0 = (*color_prom >> 3) & 0x01;
43      bit1 = (*color_prom >> 4) & 0x01;
44      bit2 = (*color_prom >> 5) & 0x01;
45      g = 0x21 * bit0 + 0x47 * bit1 + 0x97 * bit2;
54      bit0 = (color_prom[i] >> 3) & 0x01;
55      bit1 = (color_prom[i] >> 4) & 0x01;
56      bit2 = (color_prom[i] >> 5) & 0x01;
57      g = combine_3_weights(gweights, bit0, bit1, bit2);
4658
4759      /* blue component */
48      bit0 = 0;
49      bit1 = (*color_prom >> 6) & 0x01;
50      bit2 = (*color_prom >> 7) & 0x01;
51      b = 0x21 * bit0 + 0x47 * bit1 + 0x97 * bit2;
60      bit0 = (color_prom[i] >> 6) & 0x01;
61      bit1 = (color_prom[i] >> 7) & 0x01;
62      b = combine_2_weights(bweights, bit0, bit1);
5263
53      palette_set_color(machine,i,MAKE_RGB(r,g,b));
54      color_prom++;
64      colortable_palette_set_color(machine->colortable, i, MAKE_RGB(r, g, b));
5565   }
5666
5767   /* color_prom now points to the beginning of the lookup table */
68   color_prom += 0x20;
5869
5970   /* sprites */
60   for (i = 0;i < TOTAL_COLORS(1);i++)
61      COLOR(1,i) = *(color_prom++) & 0x0f;
71   for (i = 0; i < 0x100; i++)
72   {
73      UINT8 ctabentry = color_prom[i] & 0x0f;
74      colortable_entry_set_value(machine->colortable, i, ctabentry);
75   }
6276
6377   /* characters */
64   for (i = 0;i < TOTAL_COLORS(0);i++)
65      COLOR(0,i) = (*(color_prom++) & 0x0f) + 0x10;
78   for (i = 0x100; i < 0x200; i++)
79   {
80      UINT8 ctabentry = (color_prom[i] & 0x0f) | 0x10;
81      colortable_entry_set_value(machine->colortable, i, ctabentry);
82   }
6683}
6784
6885/***************************************************************************
r1679r1680
7592{
7693   UINT8 attr = colorram[tile_index];
7794   SET_TILE_INFO(
78         0,
95         1,
7996         videoram[tile_index] + ((attr & 0x10) << 4),
8097         attr & 0x0f,
8198         TILE_FLIPYX((attr & 0xc0) >> 6));
r1679r1680
90107
91108VIDEO_START( pandoras )
92109{
93   layer0 = tilemap_create(get_tile_info0,tilemap_scan_rows,TILEMAP_TYPE_PEN,8,8,32,32);
110   layer0 = tilemap_create(get_tile_info0,tilemap_scan_rows,8,8,32,32);
94111}
95112
96113/***************************************************************************
r1679r1680
99116
100117***************************************************************************/
101118
102READ8_HANDLER( pandoras_vram_r )
103{
104   return videoram[offset];
105}
106
107READ8_HANDLER( pandoras_cram_r )
108{
109   return colorram[offset];
110}
111
112119WRITE8_HANDLER( pandoras_vram_w )
113120{
114121   tilemap_mark_tile_dirty(layer0,offset);
r1679r1680
146153   {
147154      int sx = sr[offs + 1];
148155      int sy = 240 - sr[offs];
156      int color = sr[offs + 3] & 0x0f;
149157      int nflipx = sr[offs + 3] & 0x40;
150158      int nflipy = sr[offs + 3] & 0x80;
151159
152      drawgfx(bitmap,machine->gfx[1],
160      drawgfx(bitmap,machine->gfx[0],
153161         sr[offs + 2],
154         sr[offs + 3] & 0x0f,
162         color,
155163         !nflipx,!nflipy,
156164         sx,sy,
157         cliprect,TRANSPARENCY_COLOR,0);
165         cliprect,TRANSPARENCY_PENS,
166         colortable_get_transpen_mask(machine->colortable, machine->gfx[0], color, 0));
158167   }
159168}
160169
161170VIDEO_UPDATE( pandoras )
162171{
163172   tilemap_draw( bitmap,cliprect, layer0, 1 ,0);
164   draw_sprites( machine, bitmap,cliprect, &pandoras_sharedram[0x800] );
173   draw_sprites( machine, bitmap,cliprect, &spriteram[0x800] );
165174   tilemap_draw( bitmap,cliprect, layer0, 0 ,0);
166175   return 0;
167176}
src/mame/video/bigstrkb.c
r1679r1680
115115
116116VIDEO_START(bigstrkb)
117117{
118   bsb_tilemap = tilemap_create(get_bsb_tile_info,tilemap_scan_cols,TILEMAP_TYPE_PEN, 8, 8,64,32);
119   bsb_tilemap2 = tilemap_create(get_bsb_tile2_info,bsb_bg_scan,TILEMAP_TYPE_PEN, 16, 16,128,64);
120   bsb_tilemap3 = tilemap_create(get_bsb_tile3_info,bsb_bg_scan,TILEMAP_TYPE_PEN, 16, 16,128,64);
118   bsb_tilemap = tilemap_create(get_bsb_tile_info,tilemap_scan_cols, 8, 8,64,32);
119   bsb_tilemap2 = tilemap_create(get_bsb_tile2_info,bsb_bg_scan, 16, 16,128,64);
120   bsb_tilemap3 = tilemap_create(get_bsb_tile3_info,bsb_bg_scan, 16, 16,128,64);
121121
122122   tilemap_set_transparent_pen(bsb_tilemap,15);
123123//  tilemap_set_transparent_pen(bsb_tilemap2,15);
src/mame/video/taito_f2.c
r1679r1680
374374      UINT32 code,UINT32 color,int flipx,int flipy,int sx,int sy,
375375      const rectangle *clip,int scalex, int scaley)
376376{
377   const pen_t *pal = &Machine->remapped_colortable[gfx->color_base + gfx->color_granularity * (color % gfx->total_colors)];
377   const pen_t *pal = &Machine->pens[gfx->color_base + gfx->color_granularity * (color % gfx->total_colors)];
378378   UINT8 *source_base = gfx->gfxdata + (code % gfx->total_elements) * gfx->char_modulo;
379379
380380   int sprite_screen_height = (scaley*gfx->height+0x8000)>>16;
src/mame/video/gberet.c
r1679r1680
3030PALETTE_INIT( gberet )
3131{
3232   int i;
33   #define TOTAL_COLORS(gfxn) (machine->gfx[gfxn]->total_colors * machine->gfx[gfxn]->color_granularity)
34   #define COLOR(gfxn,offs) (colortable[machine->drv->gfxdecodeinfo[gfxn].color_codes_start + offs])
3533
36   for (i = 0;i < machine->drv->total_colors;i++)
34   /* allocate the colortable */
35   machine->colortable = colortable_alloc(machine, 0x20);
36
37   /* create a lookup table for the palette */
38   for (i = 0; i < 0x20; i++)
3739   {
38      int bit0,bit1,bit2,r,g,b;
40      int bit0, bit1, bit2;
41      int r, g, b;
3942
40      bit0 = (*color_prom >> 0) & 0x01;
41      bit1 = (*color_prom >> 1) & 0x01;
42      bit2 = (*color_prom >> 2) & 0x01;
43      /* red component */
44      bit0 = (color_prom[i] >> 0) & 0x01;
45      bit1 = (color_prom[i] >> 1) & 0x01;
46      bit2 = (color_prom[i] >> 2) & 0x01;
4347      r = 0x21 * bit0 + 0x47 * bit1 + 0x97 * bit2;
44      bit0 = (*color_prom >> 3) & 0x01;
45      bit1 = (*color_prom >> 4) & 0x01;
46      bit2 = (*color_prom >> 5) & 0x01;
48
49      /* green component */
50      bit0 = (color_prom[i] >> 3) & 0x01;
51      bit1 = (color_prom[i] >> 4) & 0x01;
52      bit2 = (color_prom[i] >> 5) & 0x01;
4753      g = 0x21 * bit0 + 0x47 * bit1 + 0x97 * bit2;
54
55      /* blue component */
4856      bit0 = 0;
49      bit1 = (*color_prom >> 6) & 0x01;
50      bit2 = (*color_prom >> 7) & 0x01;
57      bit1 = (color_prom[i] >> 6) & 0x01;
58      bit2 = (color_prom[i] >> 7) & 0x01;
5159      b = 0x21 * bit0 + 0x47 * bit1 + 0x97 * bit2;
5260
53      palette_set_color(machine,i,MAKE_RGB(r,g,b));
54      color_prom++;
61      colortable_palette_set_color(machine->colortable, i, MAKE_RGB(r, g, b));
5562   }
5663
57   for (i = 0;i < TOTAL_COLORS(1);i++)
64   /* color_prom now points to the beginning of the lookup table */
65   color_prom += 0x20;
66
67   for (i = 0; i < 0x100; i++)
5868   {
59      if (*color_prom & 0x0f) COLOR(1,i) = *color_prom & 0x0f;
60      else COLOR(1,i) = 0;
61      color_prom++;
69      UINT8 ctabentry = (color_prom[i] & 0x0f) | 0x10;
70      colortable_entry_set_value(machine->colortable, i, ctabentry);
6271   }
63   for (i = 0;i < TOTAL_COLORS(0);i++)
72
73   for (i = 0x100; i < 0x200; i++)
6474   {
65      COLOR(0,i) = (*(color_prom++) & 0x0f) + 0x10;
75      UINT8 ctabentry;
76
77      if (color_prom[i] & 0x0f)
78         ctabentry = color_prom[i] & 0x0f;
79      else
80         ctabentry = 0;
81
82      colortable_entry_set_value(machine->colortable, i, ctabentry);
6683   }
6784}
6885
r1679r1680
100117   int color = attr & 0x0f;
101118   int flags = TILE_FLIPYX((attr & 0x30) >> 4);
102119
120   tileinfo->group = color;
103121   tileinfo->category = (attr & 0x80) >> 7;
104122
105123   SET_TILE_INFO(0, code, color, flags);
r1679r1680
107125
108126VIDEO_START( gberet )
109127{
110   bg_tilemap = tilemap_create(get_bg_tile_info, tilemap_scan_rows,
111      TILEMAP_TYPE_COLORTABLE, 8, 8, 64, 32);
128   bg_tilemap = tilemap_create(get_bg_tile_info, tilemap_scan_rows,  8, 8, 64, 32);
112129
113   tilemap_set_transparent_pen(bg_tilemap, 0x10);
130   colortable_configure_tilemap_groups(machine->colortable, bg_tilemap, machine->gfx[0], 0x10);
114131   tilemap_set_scroll_rows(bg_tilemap, 32);
115132}
116133
r1679r1680
145162         }
146163
147164         drawgfx(bitmap, machine->gfx[1], code, color, flipx, flipy, sx, sy,
148            cliprect, TRANSPARENCY_COLOR, 0);
165            cliprect, TRANSPARENCY_PENS,
166            colortable_get_transpen_mask(machine->colortable, machine->gfx[1], color, 0));
149167      }
150168   }
151169}
r1679r1680
197215         }
198216
199217         drawgfx(bitmap, machine->gfx[1], code, color, flipx, flipy, sx, sy,
200            cliprect, TRANSPARENCY_COLOR, 0);
218            cliprect, TRANSPARENCY_PENS,
219            colortable_get_transpen_mask(machine->colortable, machine->gfx[1], color, 0));
201220      }
202221   }
203222}
src/mame/video/stfight.c
r1679r1680
4040PALETTE_INIT( stfight )
4141{
4242   int i;
43   #define TOTAL_COLORS(gfxn) (machine->gfx[gfxn]->total_colors * machine->gfx[gfxn]->color_granularity)
44   #define COLOR(gfxn,offs) (colortable[machine->drv->gfxdecodeinfo[gfxn].color_codes_start + offs])
4543
44   /* allocate the colortable */
45   machine->colortable = colortable_alloc(machine, 0x100);
4646
47   /* unique color for transparency */
48   palette_set_color(machine,256,MAKE_RGB(0x04,0x04,0x04));
47   /* text uses colors 0xc0-0xcf */
48   for (i = 0; i < 0x40; i++)
49   {
50      UINT8 ctabentry = (color_prom[i] & 0x0f) | 0xc0;
51      colortable_entry_set_value(machine->colortable, i, ctabentry);
52   }
4953
50   /* text uses colors 192-207 */
51   for (i = 0;i < TOTAL_COLORS(0);i++)
54   /* fg uses colors 0x40-0x7f */
55   for (i = 0x40; i < 0x140; i++)
5256   {
53      if ((*color_prom & 0x0f) == 0x0f) COLOR(0,i) = 256;   /* transparent */
54      else COLOR(0,i) = (*color_prom & 0x0f) + 0xc0;
55      color_prom++;
57      UINT8 ctabentry = (color_prom[i + 0x1c0] & 0x0f) | ((color_prom[i + 0x0c0] & 0x03) << 4) | 0x40;
58      colortable_entry_set_value(machine->colortable, i, ctabentry);
5659   }
57   color_prom += 256 - TOTAL_COLORS(0);   /* rest of the PROM is unused */
5860
59   /* fg uses colors 64-127 */
60   for (i = 0;i < TOTAL_COLORS(1);i++)
61   /* bg uses colors 0-0x3f */
62   for (i = 0x140; i < 0x240; i++)
6163   {
62      COLOR(1,i) = (color_prom[256] & 0x0f) + 16 * (color_prom[0] & 0x03) + 0x40;
63      color_prom++;
64      UINT8 ctabentry = (color_prom[i + 0x2c0] & 0x0f) | ((color_prom[i + 0x1c0] & 0x03) << 4);
65      colortable_entry_set_value(machine->colortable, i, ctabentry);
6466   }
65   color_prom += 256;
6667
67   /* bg uses colors 0-63 */
68   for (i = 0;i < TOTAL_COLORS(2);i++)
68   /* bg uses colors 0x80-0xbf */
69   for (i = 0x240; i < 0x340; i++)
6970   {
70      COLOR(2,i) = (color_prom[256] & 0x0f) + 16 * (color_prom[0] & 0x03) + 0x00;
71      color_prom++;
71      UINT8 ctabentry = (color_prom[i + 0x3c0] & 0x0f) | ((color_prom[i + 0x2c0] & 0x03) << 4) | 0x80;
72      colortable_entry_set_value(machine->colortable, i, ctabentry);
7273   }
73   color_prom += 256;
74}
7475
75   /* sprites use colors 128-191 */
76   for (i = 0;i < TOTAL_COLORS(4);i++)
76
77static void set_pens(running_machine *machine)
78{
79   int i;
80
81   for (i = 0; i < 0x100; i++)
7782   {
78      COLOR(4,i) = (color_prom[256] & 0x0f) + 16 * (color_prom[0] & 0x03) + 0x80;
79      color_prom++;
83      UINT16 data = paletteram[i] | (paletteram_2[i] << 8);
84      rgb_t color = MAKE_RGB(pal4bit(data >> 4), pal4bit(data >> 0), pal4bit(data >> 8));
85
86      colortable_palette_set_color(machine->colortable, i, color);
8087   }
81   color_prom += 256;
8288}
8389
90
8491/***************************************************************************
8592
8693  Callbacks for the TileMap code
r1679r1680
135142static TILE_GET_INFO( get_tx_tile_info )
136143{
137144   UINT8 attr = stfight_text_attr_ram[tile_index];
145   int color = attr & 0x0f;
138146
147   tileinfo->group = color;
148
139149   SET_TILE_INFO(
140150         0,
141151         stfight_text_char_ram[tile_index] + ((attr & 0x80) << 1),
r1679r1680
152162
153163VIDEO_START( stfight )
154164{
155   bg_tilemap = tilemap_create(get_bg_tile_info,bg_scan,TILEMAP_TYPE_PEN,     16,16,128,256);
156   fg_tilemap = tilemap_create(get_fg_tile_info,fg_scan,TILEMAP_TYPE_PEN,16,16,128,256);
157   tx_tilemap = tilemap_create(get_tx_tile_info,tilemap_scan_rows,
158         TILEMAP_TYPE_COLORTABLE,8,8,32,32);
165   bg_tilemap = tilemap_create(get_bg_tile_info,bg_scan,     16,16,128,256);
166   fg_tilemap = tilemap_create(get_fg_tile_info,fg_scan,16,16,128,256);
167   tx_tilemap = tilemap_create(get_tx_tile_info,tilemap_scan_rows, 8,8,32,32);
159168
160   tilemap_set_transparent_pen(fg_tilemap,0x0F);
161   tilemap_set_transparent_pen(tx_tilemap,256);
169   tilemap_set_transparent_pen(fg_tilemap,0x0f);
170   colortable_configure_tilemap_groups(machine->colortable, tx_tilemap, machine->gfx[0], 0xcf);
162171}
163172
164173
r1679r1680
285294
286295VIDEO_UPDATE( stfight )
287296{
297   set_pens(machine);
298
288299   fillbitmap(priority_bitmap,0,cliprect);
289300
290301   fillbitmap(bitmap,machine->pens[0],cliprect);   /* in case bg_tilemap is disabled */
src/mame/video/gottlieb.c
r1679r1680
158158static void gottlieb_video_start_common(void)
159159{
160160   bg_tilemap = tilemap_create(get_bg_tile_info, tilemap_scan_rows,
161      TILEMAP_TYPE_PEN, 8, 8, 32, 32);
161      8, 8, 32, 32);
162162
163163   tilemap_set_transparent_pen(bg_tilemap, 0);
164164}
src/mame/video/ddragon.c
r1679r1680
105105
106106VIDEO_START( ddragon )
107107{
108   bg_tilemap = tilemap_create(get_bg_tile_info,background_scan,  TILEMAP_TYPE_PEN,     16,16,32,32);
109   fg_tilemap = tilemap_create(get_fg_tile_info,tilemap_scan_rows,TILEMAP_TYPE_PEN, 8, 8,32,32);
108   bg_tilemap = tilemap_create(get_bg_tile_info,background_scan,  16,16,32,32);
109   fg_tilemap = tilemap_create(get_fg_tile_info,tilemap_scan_rows, 8, 8,32,32);
110110
111111   tilemap_set_transparent_pen(fg_tilemap,0);
112112   tilemap_set_scrolldx(fg_tilemap, 0, 384 - 256);
r1679r1680
120120
121121VIDEO_START( chinagat )
122122{
123   bg_tilemap = tilemap_create(get_bg_tile_info,background_scan,  TILEMAP_TYPE_PEN,     16,16,32,32);
124   fg_tilemap = tilemap_create(get_fg_16color_tile_info,tilemap_scan_rows,TILEMAP_TYPE_PEN, 8, 8,32,32);
123   bg_tilemap = tilemap_create(get_bg_tile_info,background_scan,16,16,32,32);
124   fg_tilemap = tilemap_create(get_fg_16color_tile_info,tilemap_scan_rows,8, 8,32,32);
125125
126126   tilemap_set_transparent_pen(fg_tilemap,0);
127127   tilemap_set_scrolldy(fg_tilemap, -8, -8);
src/mame/video/homedata.c
r1679r1680
503503
504504VIDEO_START( mrokumei )
505505{
506   bg_tilemap[0][0] = tilemap_create( mrokumei_get_info0_0, tilemap_scan_rows, TILEMAP_TYPE_PEN,      8, 8, 64,32 );
507   bg_tilemap[0][1] = tilemap_create( mrokumei_get_info0_1, tilemap_scan_rows, TILEMAP_TYPE_PEN, 8, 8, 64,32 );
508   bg_tilemap[1][0] = tilemap_create( mrokumei_get_info1_0, tilemap_scan_rows, TILEMAP_TYPE_PEN,      8, 8, 64,32 );
509   bg_tilemap[1][1] = tilemap_create( mrokumei_get_info1_1, tilemap_scan_rows, TILEMAP_TYPE_PEN, 8, 8, 64,32 );
506   bg_tilemap[0][0] = tilemap_create( mrokumei_get_info0_0, tilemap_scan_rows,       8, 8, 64,32 );
507   bg_tilemap[0][1] = tilemap_create( mrokumei_get_info0_1, tilemap_scan_rows,  8, 8, 64,32 );
508   bg_tilemap[1][0] = tilemap_create( mrokumei_get_info1_0, tilemap_scan_rows,       8, 8, 64,32 );
509   bg_tilemap[1][1] = tilemap_create( mrokumei_get_info1_1, tilemap_scan_rows,  8, 8, 64,32 );
510510
511511   tilemap_set_transparent_pen(bg_tilemap[0][1],0);
512512   tilemap_set_transparent_pen(bg_tilemap[1][1],0);
r1679r1680
514514
515515VIDEO_START( reikaids )
516516{
517   bg_tilemap[0][0] = tilemap_create( reikaids_get_info0_0, tilemap_scan_rows, TILEMAP_TYPE_PEN, 8, 8, 32, 32 );
518   bg_tilemap[0][1] = tilemap_create( reikaids_get_info0_1, tilemap_scan_rows, TILEMAP_TYPE_PEN, 8, 8, 32, 32 );
519   bg_tilemap[0][2] = tilemap_create( reikaids_get_info0_2, tilemap_scan_rows, TILEMAP_TYPE_PEN, 8, 8, 32, 32 );
520   bg_tilemap[0][3] = tilemap_create( reikaids_get_info0_3, tilemap_scan_rows, TILEMAP_TYPE_PEN, 8, 8, 32, 32 );
521   bg_tilemap[1][0] = tilemap_create( reikaids_get_info1_0, tilemap_scan_rows, TILEMAP_TYPE_PEN, 8, 8, 32, 32 );
522   bg_tilemap[1][1] = tilemap_create( reikaids_get_info1_1, tilemap_scan_rows, TILEMAP_TYPE_PEN, 8, 8, 32, 32 );
523   bg_tilemap[1][2] = tilemap_create( reikaids_get_info1_2, tilemap_scan_rows, TILEMAP_TYPE_PEN, 8, 8, 32, 32 );
524   bg_tilemap[1][3] = tilemap_create( reikaids_get_info1_3, tilemap_scan_rows, TILEMAP_TYPE_PEN, 8, 8, 32, 32 );
517   bg_tilemap[0][0] = tilemap_create( reikaids_get_info0_0, tilemap_scan_rows,  8, 8, 32, 32 );
518   bg_tilemap[0][1] = tilemap_create( reikaids_get_info0_1, tilemap_scan_rows,  8, 8, 32, 32 );
519   bg_tilemap[0][2] = tilemap_create( reikaids_get_info0_2, tilemap_scan_rows,  8, 8, 32, 32 );
520   bg_tilemap[0][3] = tilemap_create( reikaids_get_info0_3, tilemap_scan_rows,  8, 8, 32, 32 );
521   bg_tilemap[1][0] = tilemap_create( reikaids_get_info1_0, tilemap_scan_rows,  8, 8, 32, 32 );
522   bg_tilemap[1][1] = tilemap_create( reikaids_get_info1_1, tilemap_scan_rows,  8, 8, 32, 32 );
523   bg_tilemap[1][2] = tilemap_create( reikaids_get_info1_2, tilemap_scan_rows,  8, 8, 32, 32 );
524   bg_tilemap[1][3] = tilemap_create( reikaids_get_info1_3, tilemap_scan_rows,  8, 8, 32, 32 );
525525
526526   tilemap_set_transparent_pen(bg_tilemap[0][0],0xff);
527527   tilemap_set_transparent_pen(bg_tilemap[0][1],0xff);
r1679r1680
535535
536536VIDEO_START( pteacher )
537537{
538   bg_tilemap[0][0] = tilemap_create( pteacher_get_info0_0, tilemap_scan_rows, TILEMAP_TYPE_PEN,      8, 8, 64,32 );
539   bg_tilemap[0][1] = tilemap_create( pteacher_get_info0_1, tilemap_scan_rows, TILEMAP_TYPE_PEN, 8, 8, 64,32 );
540   bg_tilemap[1][0] = tilemap_create( pteacher_get_info1_0, tilemap_scan_rows, TILEMAP_TYPE_PEN,      8, 8, 64,32 );
541   bg_tilemap[1][1] = tilemap_create( pteacher_get_info1_1, tilemap_scan_rows, TILEMAP_TYPE_PEN, 8, 8, 64,32 );
538   bg_tilemap[0][0] = tilemap_create( pteacher_get_info0_0, tilemap_scan_rows,       8, 8, 64,32 );
539   bg_tilemap[0][1] = tilemap_create( pteacher_get_info0_1, tilemap_scan_rows,  8, 8, 64,32 );
540   bg_tilemap[1][0] = tilemap_create( pteacher_get_info1_0, tilemap_scan_rows,       8, 8, 64,32 );
541   bg_tilemap[1][1] = tilemap_create( pteacher_get_info1_1, tilemap_scan_rows,  8, 8, 64,32 );
542542
543543   tilemap_set_transparent_pen(bg_tilemap[0][1],0xff);
544544   tilemap_set_transparent_pen(bg_tilemap[1][1],0xff);
r1679r1680
546546
547547VIDEO_START( lemnangl )
548548{
549   bg_tilemap[0][0] = tilemap_create( lemnangl_get_info0_0, tilemap_scan_rows, TILEMAP_TYPE_PEN,      8, 8, 64,32 );
550   bg_tilemap[0][1] = tilemap_create( lemnangl_get_info0_1, tilemap_scan_rows, TILEMAP_TYPE_PEN, 8, 8, 64,32 );
551   bg_tilemap[1][0] = tilemap_create( lemnangl_get_info1_0, tilemap_scan_rows, TILEMAP_TYPE_PEN,      8, 8, 64,32 );
552   bg_tilemap[1][1] = tilemap_create( lemnangl_get_info1_1, tilemap_scan_rows, TILEMAP_TYPE_PEN, 8, 8, 64,32 );
549   bg_tilemap[0][0] = tilemap_create( lemnangl_get_info0_0, tilemap_scan_rows,       8, 8, 64,32 );
550   bg_tilemap[0][1] = tilemap_create( lemnangl_get_info0_1, tilemap_scan_rows,  8, 8, 64,32 );
551   bg_tilemap[1][0] = tilemap_create( lemnangl_get_info1_0, tilemap_scan_rows,       8, 8, 64,32 );
552   bg_tilemap[1][1] = tilemap_create( lemnangl_get_info1_1, tilemap_scan_rows,  8, 8, 64,32 );
553553
554554   tilemap_set_transparent_pen(bg_tilemap[0][1],0x0f);
555555   tilemap_set_transparent_pen(bg_tilemap[1][1],0x0f);
src/mame/video/mugsmash.c
r1679r1680
140140VIDEO_START( mugsmash )
141141{
142142
143   mugsmash_tilemap1 = tilemap_create(get_mugsmash_tile_info1,tilemap_scan_rows,TILEMAP_TYPE_PEN, 16, 16,32,32);
143   mugsmash_tilemap1 = tilemap_create(get_mugsmash_tile_info1,tilemap_scan_rows, 16, 16,32,32);
144144   tilemap_set_transparent_pen(mugsmash_tilemap1,0);
145145
146   mugsmash_tilemap2 = tilemap_create(get_mugsmash_tile_info2,tilemap_scan_rows,TILEMAP_TYPE_PEN, 16, 16,32,32);
146   mugsmash_tilemap2 = tilemap_create(get_mugsmash_tile_info2,tilemap_scan_rows, 16, 16,32,32);
147147}
148148
149149VIDEO_UPDATE( mugsmash )
src/mame/video/pcktgal.c
r1679r1680
5656VIDEO_START( pcktgal )
5757{
5858   bg_tilemap = tilemap_create(get_bg_tile_info, tilemap_scan_rows,
59      TILEMAP_TYPE_PEN, 8, 8, 32, 32);
59      8, 8, 32, 32);
6060}
6161
6262static void draw_sprites(running_machine *machine, mame_bitmap *bitmap, const rectangle *cliprect)
src/mame/video/hng64.c
r1679r1680
12531253        tilemap2Offset = hng64_videoregs[0xc] ;
12541254
12551255        tilemap_dispose(hng64_tilemap1) ;
1256        hng64_tilemap1 = tilemap_create(get_hng64_tile2_info,tilemap_scan_rows,TILEMAP_TYPE_PEN, 16, 16, 128,128); // 128x128x4 = 0x10000
1256        hng64_tilemap1 = tilemap_create(get_hng64_tile2_info,tilemap_scan_rows, 16, 16, 128,128); // 128x128x4 = 0x10000
12571257    }
12581258    */
12591259
r1679r1680
12961296
12971297VIDEO_START( hng64 )
12981298{
1299   hng64_tilemap0 = tilemap_create(get_hng64_tile0_info, tilemap_scan_rows, TILEMAP_TYPE_PEN, 8,   8, 128,128); /* 128x128x4 = 0x10000 */
1300   hng64_tilemap1 = tilemap_create(get_hng64_tile1_info, tilemap_scan_rows, TILEMAP_TYPE_PEN, 16, 16, 128,128); /* 128x128x4 = 0x10000 */
1301   hng64_tilemap2 = tilemap_create(get_hng64_tile2_info, tilemap_scan_rows, TILEMAP_TYPE_PEN, 16, 16, 128,128); /* 128x128x4 = 0x10000 */
1302   hng64_tilemap3 = tilemap_create(get_hng64_tile3_info, tilemap_scan_rows, TILEMAP_TYPE_PEN, 16, 16, 128,128); /* 128x128x4 = 0x10000 */
1299   hng64_tilemap0 = tilemap_create(get_hng64_tile0_info, tilemap_scan_rows,  8,   8, 128,128); /* 128x128x4 = 0x10000 */
1300   hng64_tilemap1 = tilemap_create(get_hng64_tile1_info, tilemap_scan_rows,  16, 16, 128,128); /* 128x128x4 = 0x10000 */
1301   hng64_tilemap2 = tilemap_create(get_hng64_tile2_info, tilemap_scan_rows,  16, 16, 128,128); /* 128x128x4 = 0x10000 */
1302   hng64_tilemap3 = tilemap_create(get_hng64_tile3_info, tilemap_scan_rows,  16, 16, 128,128); /* 128x128x4 = 0x10000 */
13031303   tilemap_set_transparent_pen(hng64_tilemap0,0);
13041304   tilemap_set_transparent_pen(hng64_tilemap1,0);
13051305   tilemap_set_transparent_pen(hng64_tilemap2,0);
src/mame/video/solomon.c
r1679r1680
6060VIDEO_START( solomon )
6161{
6262   bg_tilemap = tilemap_create(get_bg_tile_info, tilemap_scan_rows,
63      TILEMAP_TYPE_PEN, 8, 8, 32, 32);
63      8, 8, 32, 32);
6464
6565   fg_tilemap = tilemap_create(get_fg_tile_info, tilemap_scan_rows,
66      TILEMAP_TYPE_PEN, 8, 8, 32, 32);
66      8, 8, 32, 32);
6767
6868   tilemap_set_transparent_pen(fg_tilemap, 0);
6969}
src/mame/video/macrossp.c
r1679r1680
153153   memset(spriteram_old,0,spriteram_size);
154154   memset(spriteram_old2,0,spriteram_size);
155155
156   macrossp_text_tilemap = tilemap_create(get_macrossp_text_tile_info,tilemap_scan_rows,TILEMAP_TYPE_PEN,16,16,64,64);
157   macrossp_scra_tilemap = tilemap_create(get_macrossp_scra_tile_info,tilemap_scan_rows,TILEMAP_TYPE_PEN,16,16,64,64);
158   macrossp_scrb_tilemap = tilemap_create(get_macrossp_scrb_tile_info,tilemap_scan_rows,TILEMAP_TYPE_PEN,16,16,64,64);
159   macrossp_scrc_tilemap = tilemap_create(get_macrossp_scrc_tile_info,tilemap_scan_rows,TILEMAP_TYPE_PEN,16,16,64,64);
156   macrossp_text_tilemap = tilemap_create(get_macrossp_text_tile_info,tilemap_scan_rows,16,16,64,64);
157   macrossp_scra_tilemap = tilemap_create(get_macrossp_scra_tile_info,tilemap_scan_rows,16,16,64,64);
158   macrossp_scrb_tilemap = tilemap_create(get_macrossp_scrb_tile_info,tilemap_scan_rows,16,16,64,64);
159   macrossp_scrc_tilemap = tilemap_create(get_macrossp_scrc_tile_info,tilemap_scan_rows,16,16,64,64);
160160
161161   tilemap_set_transparent_pen(macrossp_text_tilemap,0);
162162   tilemap_set_transparent_pen(macrossp_scra_tilemap,0);
src/mame/video/gladiatr.c
r1679r1680
5454
5555VIDEO_START( ppking )
5656{
57   bg_tilemap = tilemap_create(bg_get_tile_info,tilemap_scan_rows,TILEMAP_TYPE_PEN,8,8,32,64);
58   fg_tilemap = tilemap_create(fg_get_tile_info,tilemap_scan_rows,TILEMAP_TYPE_PEN,8,8,32,64);
57   bg_tilemap = tilemap_create(bg_get_tile_info,tilemap_scan_rows,8,8,32,64);
58   fg_tilemap = tilemap_create(fg_get_tile_info,tilemap_scan_rows,8,8,32,64);
5959
6060   tilemap_set_transparent_pen(fg_tilemap,0);
6161
r1679r1680
6666
6767VIDEO_START( gladiatr )
6868{
69   bg_tilemap = tilemap_create(bg_get_tile_info,tilemap_scan_rows,TILEMAP_TYPE_PEN,8,8,64,32);
70   fg_tilemap = tilemap_create(fg_get_tile_info,tilemap_scan_rows,TILEMAP_TYPE_PEN,8,8,64,32);
69   bg_tilemap = tilemap_create(bg_get_tile_info,tilemap_scan_rows,8,8,64,32);
70   fg_tilemap = tilemap_create(fg_get_tile_info,tilemap_scan_rows,8,8,64,32);
7171
7272   tilemap_set_transparent_pen(fg_tilemap,0);
7373
src/mame/video/goindol.c
r1679r1680
5858
5959VIDEO_START( goindol )
6060{
61   bg_tilemap = tilemap_create(get_bg_tile_info,tilemap_scan_rows,TILEMAP_TYPE_PEN,      8,8,32,32);
62   fg_tilemap = tilemap_create(get_fg_tile_info,tilemap_scan_rows,TILEMAP_TYPE_PEN,8,8,32,32);
61   bg_tilemap = tilemap_create(get_bg_tile_info,tilemap_scan_rows,      8,8,32,32);
62   fg_tilemap = tilemap_create(get_fg_tile_info,tilemap_scan_rows,8,8,32,32);
6363
6464   tilemap_set_transparent_pen(fg_tilemap,0);
6565}
src/mame/video/taito_l.c
r1679r1680
7676{
7777   int i;
7878
79   bg18_tilemap = tilemap_create(get_bg18_tile_info,tilemap_scan_rows,TILEMAP_TYPE_PEN,8,8,64,32);
80   bg19_tilemap = tilemap_create(get_bg19_tile_info,tilemap_scan_rows,TILEMAP_TYPE_PEN,     8,8,64,32);
81   ch1a_tilemap = tilemap_create(get_ch1a_tile_info,tilemap_scan_rows,TILEMAP_TYPE_PEN,8,8,64,32);
79   bg18_tilemap = tilemap_create(get_bg18_tile_info,tilemap_scan_rows,8,8,64,32);
80   bg19_tilemap = tilemap_create(get_bg19_tile_info,tilemap_scan_rows,     8,8,64,32);
81   ch1a_tilemap = tilemap_create(get_ch1a_tile_info,tilemap_scan_rows,8,8,64,32);
8282
8383   bankc[0] = bankc[1] = bankc[2] = bankc[3] = 0;
8484   horshoes_gfxbank = 0;
src/mame/video/fastlane.c
r1679r1680
106106
107107VIDEO_START( fastlane )
108108{
109   layer0 = tilemap_create(get_tile_info0,tilemap_scan_rows,TILEMAP_TYPE_PEN,8,8,32,32);
110   layer1 = tilemap_create(get_tile_info1,tilemap_scan_rows,TILEMAP_TYPE_PEN,8,8,32,32);
109   layer0 = tilemap_create(get_tile_info0,tilemap_scan_rows,8,8,32,32);
110   layer1 = tilemap_create(get_tile_info1,tilemap_scan_rows,8,8,32,32);
111111
112112   tilemap_set_scroll_rows( layer0, 32 );
113113
src/mame/video/kangaroo.c
r1679r1680
2424
2525VIDEO_START( kangaroo )
2626{
27   videoram = auto_malloc(256 * 256);
28   state_save_register_global_pointer(videoram, 256 * 256);
27   /* video RAM is accessed 32 bits at a time (two planes, 4bpp each, 4 pixels) */
28   videoram32 = auto_malloc(256 * 64 * 4);
29   state_save_register_global_pointer(videoram32, 256 * 64);
2930}
3031
3132
3233
3334/*************************************
3435 *
36 *  Video RAM accesses
37 *
38 *************************************/
39
40static void videoram_write(UINT16 offset, UINT8 data, UINT8 mask)
41{
42   UINT32 expdata, layermask;
43
44   /* data contains 4 2-bit values packed as DCBADCBA; expand these into 4 8-bit values */
45   expdata = 0;
46   if (data & 0x01) expdata |= 0x00000055;
47   if (data & 0x10) expdata |= 0x000000aa;
48   if (data & 0x02) expdata |= 0x00005500;
49   if (data & 0x20) expdata |= 0x0000aa00;
50   if (data & 0x04) expdata |= 0x00550000;
51   if (data & 0x40) expdata |= 0x00aa0000;
52   if (data & 0x08) expdata |= 0x55000000;
53   if (data & 0x80) expdata |= 0xaa000000;
54
55   /* determine which layers are enabled */
56   layermask = 0;
57   if (mask & 0x08) layermask |= 0x30303030;
58   if (mask & 0x04) layermask |= 0xc0c0c0c0;
59   if (mask & 0x02) layermask |= 0x03030303;
60   if (mask & 0x01) layermask |= 0x0c0c0c0c;
61
62   /* update layers */
63   videoram32[offset] = (videoram32[offset] & ~layermask) | (expdata & layermask);
64}
65
66
67WRITE8_HANDLER( kangaroo_videoram_w )
68{
69   videoram_write(offset, data, kangaroo_video_control[8]);
70}
71
72
73
74/*************************************
75 *
3576 *  Video control writes
3677 *
3778 *************************************/
r1679r1680
62103
63104static void blitter_execute(void)
64105{
65   int src,dest;
66   int x,y,width,height,old_bank_select,new_bank_select;
106   UINT32 gfxhalfsize = memory_region_length(REGION_GFX1) / 2;
107   const UINT8 *gfxbase = memory_region(REGION_GFX1);
108   UINT16 src = kangaroo_video_control[0] + 256 * kangaroo_video_control[1];
109   UINT16 dst = kangaroo_video_control[2] + 256 * kangaroo_video_control[3];
110   UINT8 height = kangaroo_video_control[5];
111   UINT8 width = kangaroo_video_control[4];
112   UINT8 mask = kangaroo_video_control[8];
113   int x, y;
67114
68   src = kangaroo_video_control[0] + 256 * kangaroo_video_control[1];
69   dest = kangaroo_video_control[2] + 256 * kangaroo_video_control[3];
115   /* during DMA operations, the top 2 bits are ORed together, as well as the bottom 2 bits */
116   /* adjust the mask to account for this */
117   if (mask & 0x0c) mask |= 0x0c;
118   if (mask & 0x03) mask |= 0x03;
70119
71   width = kangaroo_video_control[5];
72   height = kangaroo_video_control[4];
73
74   old_bank_select = new_bank_select = kangaroo_video_control[8];
75
76   if (new_bank_select & 0x0c)  new_bank_select |= 0x0c;
77   if (new_bank_select & 0x03)  new_bank_select |= 0x03;
78
79   kangaroo_video_control_w(8, new_bank_select & 0x05);
80
81   for (x = 0; x <= width; x++)
82   {
83      for (y = 0; y <= height; y++)
84         program_write_byte(dest + y, program_read_byte(src++));
85
86      dest += 256;
87   }
88
89   src = kangaroo_video_control[0] + 256 * kangaroo_video_control[1];
90   dest = kangaroo_video_control[2] + 256 * kangaroo_video_control[3];
91
92   kangaroo_video_control_w(8, new_bank_select & 0x0a);
93
94   for (x = 0; x <= width; x++)
95   {
96      for (y = 0; y <= height; y++)
97         program_write_byte(dest + y, program_read_byte(src++));
98
99      dest += 256;
100   }
101
102   kangaroo_video_control_w(8, old_bank_select);
120   /* loop over height, then width */
121   for (y = 0; y <= height; y++, dst += 256)
122      for (x = 0; x <= width; x++)
123      {
124         UINT16 effdst = (dst + x) & 0x3fff;
125         UINT16 effsrc = src++ & (gfxhalfsize - 1);
126         videoram_write(effdst, gfxbase[0*gfxhalfsize + effsrc], mask & 0x05);
127         videoram_write(effdst, gfxbase[1*gfxhalfsize + effsrc], mask & 0x0a);
128      }
103129}
104130
105131
106132
107133/*************************************
108134 *
109 *  Video RAM writes
110 *
111 *************************************/
112
113WRITE8_HANDLER( kangaroo_videoram_w )
114{
115   int sx, sy, offs;
116
117   sx = (offset / 256) * 4;
118   sy = offset % 256;
119   offs = sy * 256 + sx;
120
121   /* rearrange the bits to a more convenient pattern (from DCBADCBA to DDCCBBAA) */
122   data = BITSWAP8(data, 7,3,6,2,5,1,4,0);
123
124   /* B layer, green & blue bits */
125   if (kangaroo_video_control[8] & 0x08)
126   {
127      videoram[offs  ] = (videoram[offs  ] & 0xcf) | (((data >> 0) & 3) << 4);
128      videoram[offs+1] = (videoram[offs+1] & 0xcf) | (((data >> 2) & 3) << 4);
129      videoram[offs+2] = (videoram[offs+2] & 0xcf) | (((data >> 4) & 3) << 4);
130      videoram[offs+3] = (videoram[offs+3] & 0xcf) | (((data >> 6) & 3) << 4);
131   }
132
133   /* B layer, Z & red bits */
134   if (kangaroo_video_control[8] & 0x04)
135   {
136      videoram[offs  ] = (videoram[offs  ] & 0x3f) | (((data >> 0) & 3) << 6);
137      videoram[offs+1] = (videoram[offs+1] & 0x3f) | (((data >> 2) & 3) << 6);
138      videoram[offs+2] = (videoram[offs+2] & 0x3f) | (((data >> 4) & 3) << 6);
139      videoram[offs+3] = (videoram[offs+3] & 0x3f) | (((data >> 6) & 3) << 6);
140   }
141
142   /* A layer, green & blue bits */
143   if (kangaroo_video_control[8] & 0x02)
144   {
145      videoram[offs  ] = (videoram[offs  ] & 0xfc) | (((data >> 0) & 3) << 0);
146      videoram[offs+1] = (videoram[offs+1] & 0xfc) | (((data >> 2) & 3) << 0);
147      videoram[offs+2] = (videoram[offs+2] & 0xfc) | (((data >> 4) & 3) << 0);
148      videoram[offs+3] = (videoram[offs+3] & 0xfc) | (((data >> 6) & 3) << 0);
149   }
150
151   /* A layer, Z & red bits */
152   if (kangaroo_video_control[8] & 0x01)
153   {
154      videoram[offs  ] = (videoram[offs  ] & 0xf3) | (((data >> 0) & 3) << 2);
155      videoram[offs+1] = (videoram[offs+1] & 0xf3) | (((data >> 2) & 3) << 2);
156      videoram[offs+2] = (videoram[offs+2] & 0xf3) | (((data >> 4) & 3) << 2);
157      videoram[offs+3] = (videoram[offs+3] & 0xf3) | (((data >> 6) & 3) << 2);
158   }
159}
160
161
162
163/*************************************
164 *
165135 *  Video updater
166136 *
167137 *************************************/
r1679r1680
170140{
171141   UINT8 scrolly = kangaroo_video_control[6];
172142   UINT8 scrollx = kangaroo_video_control[7];
173   UINT8 maska = kangaroo_video_control[10] >> 3;
174   UINT8 maskb = kangaroo_video_control[10] >> 0;
143   UINT8 maska = (kangaroo_video_control[10] & 0x28) >> 3;
144   UINT8 maskb = (kangaroo_video_control[10] & 0x07) >> 0;
175145   UINT8 xora = (kangaroo_video_control[9] & 0x20) ? 0xff : 0x00;
176146   UINT8 xorb = (kangaroo_video_control[9] & 0x10) ? 0xff : 0x00;
177147   UINT8 enaa = (kangaroo_video_control[9] & 0x08);
r1679r1680
196166         UINT8 effya = scrolly + (y ^ xora);
197167         UINT8 effxb = (x / 2) ^ xorb;
198168         UINT8 effyb = y ^ xorb;
199         UINT8 pixa = videoram[effya * 256 + effxa] & 0x0f;
200         UINT8 pixb = videoram[effyb * 256 + effxb] >> 4;
169         UINT8 pixa = (videoram32[effya + 256 * (effxa / 4)] >> (8 * (effxa % 4) + 0)) & 0x0f;
170         UINT8 pixb = (videoram32[effyb + 256 * (effxb / 4)] >> (8 * (effxb % 4) + 4)) & 0x0f;
201171         UINT8 finalpens;
202172
173         /* for each layer, contribute bits if (a) enabled, and (b) either has priority or the opposite plane is 0 */
203174         finalpens = 0;
204175         if (enaa && (pria || pixb == 0))
205176            finalpens |= pixa;
206177         if (enab && (prib || pixa == 0))
207178            finalpens |= pixb;
208179
180         /* store the first of two pixels, which is always full brightness */
209181         dest[x + 0] = pens[finalpens & 7];
210182
211183         /* KOS1 alternates at 5MHz, offset from the pixel clock by 1/2 clock */
r1679r1680
213185         finalpens = 0;
214186         if (enaa && (pria || pixb == 0))
215187         {
216            if (!(pixa & 0x08)) pixa &= ~maska;
188            if (!(pixa & 0x08)) pixa &= maska;
217189            finalpens |= pixa;
218190         }
219191         if (enab && (prib || pixa == 0))
220192         {
221            if (!(pixb & 0x08)) pixb &= ~maskb;
193            if (!(pixb & 0x08)) pixb &= maskb;
222194            finalpens |= pixb;
223195         }
224196
197         /* store the second of two pixels, which is affected by KOS1 and the A/B masks */
225198         dest[x + 1] = pens[finalpens & 7];
226199      }
227200   }
src/mame/video/cabal.c
r1679r1680
4242
4343VIDEO_START( cabal )
4444{
45   background_layer = tilemap_create(get_back_tile_info,tilemap_scan_rows,TILEMAP_TYPE_PEN,16,16,16,16);
46   text_layer       = tilemap_create(get_text_tile_info,tilemap_scan_rows,TILEMAP_TYPE_PEN,  8,8,32,32);
45   background_layer = tilemap_create(get_back_tile_info,tilemap_scan_rows,16,16,16,16);
46   text_layer       = tilemap_create(get_text_tile_info,tilemap_scan_rows,  8,8,32,32);
4747
4848   tilemap_set_transparent_pen(text_layer,3);
4949   tilemap_set_transparent_pen(background_layer,15);
src/mame/video/suprloco.c
r1679r1680
9898
9999VIDEO_START( suprloco )
100100{
101   bg_tilemap = tilemap_create(get_tile_info,tilemap_scan_rows,TILEMAP_TYPE_PEN,8,8,32,32);
101   bg_tilemap = tilemap_create(get_tile_info,tilemap_scan_rows,8,8,32,32);
102102
103103   tilemap_set_scroll_rows(bg_tilemap,32);
104104}
r1679r1680
190190   skip = spr_reg[SPR_SKIP_LO] + (spr_reg[SPR_SKIP_HI] << 8);
191191
192192   height      = spr_reg[SPR_Y_BOTTOM] - spr_reg[SPR_Y_TOP];
193   spr_palette   = machine->remapped_colortable + 0x100 + 0x10 * (spr_reg[SPR_COL]&0x03) + ((control & 0x20)?0x100:0);
193   spr_palette   = machine->pens + 0x100 + 0x10 * (spr_reg[SPR_COL]&0x03) + ((control & 0x20)?0x100:0);
194194   sx = spr_reg[SPR_X];
195195   sy = spr_reg[SPR_Y_TOP] + 1;
196196
src/mame/video/m92.c
r1679r1680
250250      pf_layer_info *layer = &pf_layer[laynum];
251251
252252      /* allocate two tilemaps per layer, one normal, one wide */
253      layer->tmap = tilemap_create(get_pf_tile_info, tilemap_scan_rows, TILEMAP_TYPE_PEN, 8,8, 64,64);
254      layer->wide_tmap = tilemap_create(get_pf_tile_info, tilemap_scan_rows, TILEMAP_TYPE_PEN, 8,8, 128,64);
253      layer->tmap = tilemap_create(get_pf_tile_info, tilemap_scan_rows,  8,8, 64,64);
254      layer->wide_tmap = tilemap_create(get_pf_tile_info, tilemap_scan_rows,  8,8, 128,64);
255255
256256      /* set the user data for each one to point to the layer */
257257      tilemap_set_user_data(layer->tmap, &pf_layer[laynum]);
src/mame/video/m58.c
r1679r1680
180180
181181VIDEO_START( yard )
182182{
183   bg_tilemap = tilemap_create(yard_get_bg_tile_info, yard_tilemap_scan_rows, TILEMAP_TYPE_PEN, 8, 8, 64, 32);
183   bg_tilemap = tilemap_create(yard_get_bg_tile_info, yard_tilemap_scan_rows, 8, 8, 64, 32);
184184   tilemap_set_scrolldx(bg_tilemap, machine->screen[0].visarea.min_x, machine->screen[0].width - (machine->screen[0].visarea.max_x + 1));
185185   tilemap_set_scrolldy(bg_tilemap, machine->screen[0].visarea.min_y - 8, machine->screen[0].height + 16 - (machine->screen[0].visarea.max_y + 1));
186186
src/mame/video/fcombat.c
r1679r1680
6060{
6161   int i;
6262
63   for (i = 0; i < machine->drv->total_colors; i++)
63   /* allocate the colortable */
64   machine->colortable = colortable_alloc(machine, 0x20);
65
66   /* create a lookup table for the palette */
67   for (i = 0; i < 0x20; i++)
6468   {
65      int bit0, bit1, bit2, r, g, b;
69      int bit0, bit1, bit2;
70      int r, g, b;
6671
6772      /* red component */
68      bit0 = (*color_prom >> 0) & 0x01;
69      bit1 = (*color_prom >> 1) & 0x01;
70      bit2 = (*color_prom >> 2) & 0x01;
73      bit0 = (color_prom[i] >> 0) & 0x01;
74      bit1 = (color_prom[i] >> 1) & 0x01;
75      bit2 = (color_prom[i] >> 2) & 0x01;
7176      r = 0x21 * bit0 + 0x47 * bit1 + 0x97 * bit2;
77
7278      /* green component */
73      bit0 = (*color_prom >> 3) & 0x01;
74      bit1 = (*color_prom >> 4) & 0x01;
75      bit2 = (*color_prom >> 5) & 0x01;
79      bit0 = (color_prom[i] >> 3) & 0x01;
80      bit1 = (color_prom[i] >> 4) & 0x01;
81      bit2 = (color_prom[i] >> 5) & 0x01;
7682      g = 0x21 * bit0 + 0x47 * bit1 + 0x97 * bit2;
83
7784      /* blue component */
7885      bit0 = 0;
79      bit1 = (*color_prom >> 6) & 0x01;
80      bit2 = (*color_prom >> 7) & 0x01;
86      bit1 = (color_prom[i] >> 6) & 0x01;
87      bit2 = (color_prom[i] >> 7) & 0x01;
8188      b = 0x21 * bit0 + 0x47 * bit1 + 0x97 * bit2;
8289
83      palette_set_color(machine,i,MAKE_RGB(r,g,b));
84      color_prom++;
90      colortable_palette_set_color(machine->colortable, i, MAKE_RGB(r, g, b));
8591   }
8692
87   /* color_prom now points to the beginning of the char lookup table */
93   /* color_prom now points to the beginning of the lookup table */
94   color_prom += 0x20;
8895
89   /* fg chars */
90   for (i = 0; i < 256; i++)
91      colortable[i + 0x000] = 16 + (color_prom[(i & 0xc0) | ((i & 3) << 4) | ((i >> 2) & 15)] & 15);
92   color_prom += 256;
96   /* fg chars/sprites */
97   for (i = 0; i < 0x200; i++)
98   {
99      UINT8 ctabentry = (color_prom[(i & 0x1c0) | ((i & 3) << 4) | ((i >> 2) & 0x0f)] & 0x0f) | 0x10;
100      colortable_entry_set_value(machine->colortable, i, ctabentry);
101   }
93102
94   /* color_prom now points to the beginning of the sprite lookup table */
95
96   /* sprites */
97   for (i = 0; i < 256; i++)
98      colortable[i + 0x100] = 16 + (color_prom[(i & 0xc0) | ((i & 3) << 4) | ((i >> 2) & 15)] & 15);
99   color_prom += 256;
100
101103   /* bg chars (this is not the full story... there are four layers mixed */
102104   /* using another PROM */
103   for (i = 0; i < 256; i++)
104      //colortable[i + 0x200] = 16 + (color_prom[(i & 0xc0) | ((i & 3) << 4) | ((i >> 2) & 15)] & 15);
105   colortable[i + 0x200] = *color_prom++ & 15;
105   for (i = 0x200; i < 0x300; i++)
106   {
107      UINT8 ctabentry = color_prom[i] & 0x0f;
108      colortable_entry_set_value(machine->colortable, i, ctabentry);
109   }
106110}
107111
108112
r1679r1680
115119
116120VIDEO_START( fcombat )
117121{
118   bgmap = tilemap_create(get_bg_tile_info,tilemap_scan_rows,TILEMAP_TYPE_PEN, 16, 16,32*8*2,32);
122   bgmap = tilemap_create(get_bg_tile_info,tilemap_scan_rows, 16, 16,32*8*2,32);
119123}
120124
121125
src/mame/video/thoop2.c
r1679r1680
8888{
8989   int i;
9090
91   pant[0] = tilemap_create(get_tile_info_thoop2_screen0,tilemap_scan_rows,TILEMAP_TYPE_PEN,16,16,32,32);
92   pant[1] = tilemap_create(get_tile_info_thoop2_screen1,tilemap_scan_rows,TILEMAP_TYPE_PEN,16,16,32,32);
91   pant[0] = tilemap_create(get_tile_info_thoop2_screen0,tilemap_scan_rows,16,16,32,32);
92   pant[1] = tilemap_create(get_tile_info_thoop2_screen1,tilemap_scan_rows,16,16,32,32);
9393
9494   tilemap_set_transmask(pant[0],0,0xff01,0x00ff); /* pens 1-7 opaque, pens 0, 8-15 transparent */
9595   tilemap_set_transmask(pant[1],0,0xff01,0x00ff); /* pens 1-7 opaque, pens 0, 8-15 transparent */
src/mame/video/wwfwfest.c
r1679r1680
224224
225225VIDEO_START( wwfwfest )
226226{
227   fg0_tilemap = tilemap_create(get_fg0_tile_info,tilemap_scan_rows,TILEMAP_TYPE_PEN, 8, 8,64,32);
228   bg1_tilemap = tilemap_create(get_bg1_tile_info,tilemap_scan_rows,TILEMAP_TYPE_PEN, 16, 16,32,32);
229   bg0_tilemap = tilemap_create(get_bg0_tile_info,tilemap_scan_rows,TILEMAP_TYPE_PEN, 16, 16,32,32);
227   fg0_tilemap = tilemap_create(get_fg0_tile_info,tilemap_scan_rows, 8, 8,64,32);
228   bg1_tilemap = tilemap_create(get_bg1_tile_info,tilemap_scan_rows, 16, 16,32,32);
229   bg0_tilemap = tilemap_create(get_bg0_tile_info,tilemap_scan_rows, 16, 16,32,32);
230230
231231   tilemap_set_transparent_pen(fg0_tilemap,0);
232232   tilemap_set_transparent_pen(bg1_tilemap,0);
src/mame/video/marineb.c
r1679r1680
4949
5050VIDEO_START( marineb )
5151{
52   bg_tilemap = tilemap_create(get_tile_info,tilemap_scan_rows,TILEMAP_TYPE_PEN,8,8,32,32);
52   bg_tilemap = tilemap_create(get_tile_info,tilemap_scan_rows,8,8,32,32);
5353
5454   tilemap_set_scroll_cols(bg_tilemap, 32);
5555}
src/mame/video/timeplt.c
r1679r1680
113113
114114VIDEO_START( timeplt )
115115{
116   bg_tilemap = tilemap_create(get_tile_info,tilemap_scan_rows,TILEMAP_TYPE_PEN,8,8,32,32);
116   bg_tilemap = tilemap_create(get_tile_info,tilemap_scan_rows,8,8,32,32);
117117}
118118
119119
src/mame/video/atarigx2.c
r1679r1680
120120   atarigen_blend_gfx(machine, 0, 2, 0x0f, 0x30);
121121
122122   /* initialize the playfield */
123   atarigen_playfield_tilemap = tilemap_create(get_playfield_tile_info, atarigx2_playfield_scan, TILEMAP_TYPE_PEN, 8,8, 128,64);
123   atarigen_playfield_tilemap = tilemap_create(get_playfield_tile_info, atarigx2_playfield_scan, 8,8, 128,64);
124124
125125   /* initialize the motion objects */
126126   adjusted_modesc.palettebase = atarigx2_motion_object_base;
r1679r1680
129129   atarirle_init(0, &adjusted_modesc);
130130
131131   /* initialize the alphanumerics */
132   atarigen_alpha_tilemap = tilemap_create(get_alpha_tile_info, tilemap_scan_rows, TILEMAP_TYPE_PEN, 8,8, 64,32);
132   atarigen_alpha_tilemap = tilemap_create(get_alpha_tile_info, tilemap_scan_rows, 8,8, 64,32);
133133   tilemap_set_transparent_pen(atarigen_alpha_tilemap, 0);
134134
135135   /* reset statics */
src/mame/video/fuukifg2.c
r1679r1680
9797VIDEO_START( fuuki16 )
9898{
9999   tilemap_0 = tilemap_create(   get_tile_info_0, tilemap_scan_rows,
100                        TILEMAP_TYPE_PEN, 16, 16, 64,32);
100                        16, 16, 64,32);
101101
102102   tilemap_1 = tilemap_create(   get_tile_info_1, tilemap_scan_rows,
103                        TILEMAP_TYPE_PEN, 16, 16, 64,32);
103                        16, 16, 64,32);
104104
105105   tilemap_2 = tilemap_create(   get_tile_info_2, tilemap_scan_rows,
106                        TILEMAP_TYPE_PEN,  8,  8, 64,32);
106                          8,  8, 64,32);
107107
108108   tilemap_3 = tilemap_create(   get_tile_info_3, tilemap_scan_rows,
109                        TILEMAP_TYPE_PEN,  8,  8, 64,32);
109                          8,  8, 64,32);
110110
111111   tilemap_set_transparent_pen(tilemap_0,0x0f);   // 4 bits
112112   tilemap_set_transparent_pen(tilemap_1,0xff);   // 8 bits
src/mame/video/vulgus.c
r1679r1680
117117
118118VIDEO_START( vulgus )
119119{
120   fg_tilemap = tilemap_create(get_fg_tile_info,tilemap_scan_rows,TILEMAP_TYPE_PEN, 8, 8,32,32);
121   bg_tilemap = tilemap_create(get_bg_tile_info,tilemap_scan_cols,TILEMAP_TYPE_PEN,16,16,32,32);
120   fg_tilemap = tilemap_create(get_fg_tile_info,tilemap_scan_rows, 8, 8,32,32);
121   bg_tilemap = tilemap_create(get_bg_tile_info,tilemap_scan_cols,16,16,32,32);
122122
123123   colortable_configure_tilemap_groups(machine->colortable, fg_tilemap, machine->gfx[0], 47);
124124}
src/mame/video/sderby.c
r1679r1680
9595
9696VIDEO_START( sderby )
9797{
98   sderby_tilemap = tilemap_create(get_sderby_tile_info,tilemap_scan_rows,TILEMAP_TYPE_PEN, 16, 16,32,32);
99   sderby_md_tilemap = tilemap_create(get_sderby_md_tile_info,tilemap_scan_rows,TILEMAP_TYPE_PEN, 16, 16,32,32);
98   sderby_tilemap = tilemap_create(get_sderby_tile_info,tilemap_scan_rows, 16, 16,32,32);
99   sderby_md_tilemap = tilemap_create(get_sderby_md_tile_info,tilemap_scan_rows, 16, 16,32,32);
100100
101101   tilemap_set_transparent_pen(sderby_md_tilemap,0);
102102
103   sderby_fg_tilemap = tilemap_create(get_sderby_fg_tile_info,tilemap_scan_rows,TILEMAP_TYPE_PEN, 8, 8,64,32);
103   sderby_fg_tilemap = tilemap_create(get_sderby_fg_tile_info,tilemap_scan_rows, 8, 8,64,32);
104104   tilemap_set_transparent_pen(sderby_fg_tilemap,0);
105105}
106106
src/mame/video/circus.c
r1679r1680
4848VIDEO_START( circus )
4949{
5050   bg_tilemap = tilemap_create(get_bg_tile_info, tilemap_scan_rows,
51      TILEMAP_TYPE_PEN, 8, 8, 32, 32);
51      8, 8, 32, 32);
5252}
5353
5454static void draw_line(running_machine *machine, mame_bitmap *bitmap, const rectangle *cliprect, int x1, int y1, int x2, int y2, int dotted)
r1679r1680
6565      skip = 1;
6666
6767   if (x1 == x2)
68   {
6968      for (count = y2; count >= y1; count -= skip)
70      {
7169         *BITMAP_ADDR16(bitmap, count, x1) = machine->pens[1];
72      }
73   }
7470   else
75   {
7671      for (count = x2; count >= x1; count -= skip)
77      {
7872         *BITMAP_ADDR16(bitmap, y1, count) = machine->pens[1];
79      }
80   }
8173}
8274
8375static void draw_robot_box (running_machine *machine, mame_bitmap *bitmap, const rectangle *cliprect, int x, int y)
r1679r1680
202194static void ripcord_draw_skydiver(running_machine *machine, mame_bitmap *bitmap, const rectangle *cliprect)
203195{
204196   const gfx_element *gfx;
205   const pen_t *pal_ptr;
206197   UINT8  *src_lineptr, *src_pixptr;
207198   UINT16 *dst_lineptr, *dst_lineend;
208   UINT32 code, color;
199   UINT32 code;
209200   int sx, sy;
210201   int src_pitch, dst_width, dst_height, dst_pitch, dst_pixoffs, dst_pixend;
211202   int collision, eax, edx;
r1679r1680
213204   gfx = machine->gfx[0];
214205
215206   code = clown_z;
216   color = 0;
217207
218208   sx = clown_y;
219209   sy = clown_x - 1;
r1679r1680
222212   edx = 1;
223213
224214   gfx = machine->gfx[1];
225   pal_ptr = &machine->remapped_colortable[gfx->color_base + color * gfx->color_granularity];
226215   src_lineptr = gfx->gfxdata + code * gfx->char_modulo;
227216   src_pitch = gfx->line_modulo;
228217   dst_pitch = bitmap->rowpixels;
r1679r1680
244233         src_pixptr ++;
245234         if (eax)
246235         {
247            eax = pal_ptr[eax];
236            eax = machine->pens[eax];
248237            collision |= dst_lineptr[dst_pixoffs];
249238            dst_lineptr[dst_pixoffs] = eax;
250239         }
src/mame/video/zac2650.c
r1679r1680
77#include "driver.h"
88#include "video/s2636.h"
99
10
11UINT8 *zac2650_s2636_0_ram;
1012static mame_bitmap *spritebitmap;
1113
1214static int CollisionBackground;
r1679r1680
2931
3032READ8_HANDLER( zac_s2636_r )
3133{
32   if(offset!=0xCB) return s2636_1_ram[offset];
34   if(offset!=0xCB) return zac2650_s2636_0_ram[offset];
3335    else return CollisionSprite;
3436}
3537
r1679r1680
4749   int Checksum=0;
4850   int x,y;
4951
50    if((s2636_1_ram[first * 0x10 + 10] < 0xf0) && (s2636_1_ram[second * 0x10 + 10] < 0xf0))
52    if((zac2650_s2636_0_ram[first * 0x10 + 10] < 0xf0) && (zac2650_s2636_0_ram[second * 0x10 + 10] < 0xf0))
5153    {
52       int fx     = (s2636_1_ram[first * 0x10 + 10] * 4)-22;
53        int fy     = (s2636_1_ram[first * 0x10 + 12] * 3)+3;
54       int fx     = (zac2650_s2636_0_ram[first * 0x10 + 10] * 4)-22;
55        int fy     = (zac2650_s2636_0_ram[first * 0x10 + 12] * 3)+3;
5456      int expand = (first==1) ? 2 : 1;
5557
5658        /* Draw first sprite */
r1679r1680
8688             second * 2,
8789             1,
8890             0,0,
89             (s2636_1_ram[second * 0x10 + 10] * 4)-22,(s2636_1_ram[second * 0x10 + 12] * 3) + 3,
91             (zac2650_s2636_0_ram[second * 0x10 + 10] * 4)-22,(zac2650_s2636_0_ram[second * 0x10 + 12] * 3) + 3,
9092             0, TRANSPARENCY_PEN, 0);
9193
9294        /* Remove fingerprint */
r1679r1680
130132VIDEO_START( tinvader )
131133{
132134   bg_tilemap = tilemap_create(get_bg_tile_info, tilemap_scan_rows,
133      TILEMAP_TYPE_PEN, 24, 24, 32, 32);
135      24, 24, 32, 32);
134136
135137   spritebitmap = auto_bitmap_alloc(machine->screen[0].width,machine->screen[0].height,machine->screen[0].format);
136138   tmpbitmap = auto_bitmap_alloc(machine->screen[0].width,machine->screen[0].height,machine->screen[0].format);
r1679r1680
158160
159161    for(offs=0;offs<0x50;offs+=0x10)
160162    {
161       if((s2636_1_ram[offs+10]<0xF0) && (offs!=0x30))
163       if((zac2650_s2636_0_ram[offs+10]<0xF0) && (offs!=0x30))
162164      {
163165            int spriteno = (offs / 8);
164         int expand   = ((s2636_1_ram[0xc0] & (spriteno*2))!=0) ? 2 : 1;
165            int bx       = (s2636_1_ram[offs+10] * 4) - 22;
166            int by       = (s2636_1_ram[offs+12] * 3) + 3;
166         int expand   = ((zac2650_s2636_0_ram[0xc0] & (spriteno*2))!=0) ? 2 : 1;
167            int bx       = (zac2650_s2636_0_ram[offs+10] * 4) - 22;
168            int by       = (zac2650_s2636_0_ram[offs+12] * 3) + 3;
167169            int x,y;
168170
169171         /* 16x8 version */
170         decodechar(machine->gfx[1],spriteno,s2636_1_ram);
172         decodechar(machine->gfx[1],spriteno,zac2650_s2636_0_ram);
171173
172174         /* 16x16 version */
173         decodechar(machine->gfx[2],spriteno,s2636_1_ram);
175         decodechar(machine->gfx[2],spriteno,zac2650_s2636_0_ram);
174176
175177            /* Sprite->Background collision detection */
176178         drawgfx(bitmap,machine->gfx[expand],
src/mame/video/vastar.c
r1679r1680
7272
7373VIDEO_START( vastar )
7474{
75   fg_tilemap  = tilemap_create(get_fg_tile_info, tilemap_scan_rows,TILEMAP_TYPE_PEN,8,8,32,32);
76   bg1_tilemap = tilemap_create(get_bg1_tile_info,tilemap_scan_rows,TILEMAP_TYPE_PEN,8,8,32,32);
77   bg2_tilemap = tilemap_create(get_bg2_tile_info,tilemap_scan_rows,TILEMAP_TYPE_PEN,8,8,32,32);
75   fg_tilemap  = tilemap_create(get_fg_tile_info, tilemap_scan_rows,8,8,32,32);
76   bg1_tilemap = tilemap_create(get_bg1_tile_info,tilemap_scan_rows,8,8,32,32);
77   bg2_tilemap = tilemap_create(get_bg2_tile_info,tilemap_scan_rows,8,8,32,32);
7878
7979   tilemap_set_transparent_pen(fg_tilemap,0);
8080   tilemap_set_transparent_pen(bg1_tilemap,0);
src/mame/video/taotaido.c
r1679r1680
191191
192192VIDEO_START(taotaido)
193193{
194   bg_tilemap = tilemap_create(taotaido_bg_tile_info,taotaido_tilemap_scan_rows,TILEMAP_TYPE_PEN,     16,16,128,64);
194   bg_tilemap = tilemap_create(taotaido_bg_tile_info,taotaido_tilemap_scan_rows,     16,16,128,64);
195195
196196   taotaido_spriteram_old = auto_malloc(0x2000);
197197   taotaido_spriteram_older = auto_malloc(0x2000);
src/mame/video/relief.c
r1679r1680
8686   atarigen_blend_gfx(machine, 1, 2, 0x0f, 0x10);
8787
8888   /* initialize the playfield */
89   atarigen_playfield_tilemap = tilemap_create(get_playfield_tile_info, tilemap_scan_cols, TILEMAP_TYPE_PEN, 8,8, 64,64);
89   atarigen_playfield_tilemap = tilemap_create(get_playfield_tile_info, tilemap_scan_cols, 8,8, 64,64);
9090
9191   /* initialize the second playfield */
92   atarigen_playfield2_tilemap = tilemap_create(get_playfield2_tile_info, tilemap_scan_cols, TILEMAP_TYPE_PEN, 8,8, 64,64);
92   atarigen_playfield2_tilemap = tilemap_create(get_playfield2_tile_info, tilemap_scan_cols, 8,8, 64,64);
9393   tilemap_set_transparent_pen(atarigen_playfield2_tilemap, 0);
9494
9595   /* initialize the motion objects */
src/mame/video/taito_f3.c
r1679r1680
567567   f3_game_config=pCFG;
568568
569569   if (f3_game_config->extend) {
570      pf1_tilemap = tilemap_create(get_tile_info1,tilemap_scan_rows,TILEMAP_TYPE_PEN,16,16,64,32);
571      pf2_tilemap = tilemap_create(get_tile_info2,tilemap_scan_rows,TILEMAP_TYPE_PEN,16,16,64,32);
572      pf3_tilemap = tilemap_create(get_tile_info3,tilemap_scan_rows,TILEMAP_TYPE_PEN,16,16,64,32);
573      pf4_tilemap = tilemap_create(get_tile_info4,tilemap_scan_rows,TILEMAP_TYPE_PEN,16,16,64,32);
570      pf1_tilemap = tilemap_create(get_tile_info1,tilemap_scan_rows,16,16,64,32);
571      pf2_tilemap = tilemap_create(get_tile_info2,tilemap_scan_rows,16,16,64,32);
572      pf3_tilemap = tilemap_create(get_tile_info3,tilemap_scan_rows,16,16,64,32);
573      pf4_tilemap = tilemap_create(get_tile_info4,tilemap_scan_rows,16,16,64,32);
574574
575575      f3_pf_data_1=f3_pf_data+0x0000;
576576      f3_pf_data_2=f3_pf_data+0x0800;
r1679r1680
582582      twidth_mask_bit=6;
583583
584584   } else {
585      pf1_tilemap = tilemap_create(get_tile_info1,tilemap_scan_rows,TILEMAP_TYPE_PEN,16,16,32,32);
586      pf2_tilemap = tilemap_create(get_tile_info2,tilemap_scan_rows,TILEMAP_TYPE_PEN,16,16,32,32);
587      pf3_tilemap = tilemap_create(get_tile_info3,tilemap_scan_rows,TILEMAP_TYPE_PEN,16,16,32,32);
588      pf4_tilemap = tilemap_create(get_tile_info4,tilemap_scan_rows,TILEMAP_TYPE_PEN,16,16,32,32);
585      pf1_tilemap = tilemap_create(get_tile_info1,tilemap_scan_rows,16,16,32,32);
586      pf2_tilemap = tilemap_create(get_tile_info2,tilemap_scan_rows,16,16,32,32);
587      pf3_tilemap = tilemap_create(get_tile_info3,tilemap_scan_rows,16,16,32,32);
588      pf4_tilemap = tilemap_create(get_tile_info4,tilemap_scan_rows,16,16,32,32);
589589
590590      f3_pf_data_1=f3_pf_data+0x0000;
591591      f3_pf_data_2=f3_pf_data+0x0400;
r1679r1680
600600   spriteram32_buffered = (UINT32 *)auto_malloc(0x10000);
601601   spritelist = auto_malloc(0x400 * sizeof(*spritelist));
602602   sprite_end = spritelist;
603   vram_layer = tilemap_create(get_tile_info_vram,tilemap_scan_rows,TILEMAP_TYPE_PEN,8,8,64,64);
604   pixel_layer = tilemap_create(get_tile_info_pixel,tilemap_scan_cols,TILEMAP_TYPE_PEN,8,8,64,32);
603   vram_layer = tilemap_create(get_tile_info_vram,tilemap_scan_rows,8,8,64,64);
604   pixel_layer = tilemap_create(get_tile_info_pixel,tilemap_scan_cols,8,8,64,32);
605605   pivot_dirty = (UINT8 *)auto_malloc(2048);
606606   pf_line_inf = auto_malloc(5 * sizeof(struct f3_playfield_line_inf));
607607   sa_line_inf = auto_malloc(1 * sizeof(struct f3_spritealpha_line_inf));
r1679r1680
13641364      UINT32 orient,
13651365      int skip_layer_num)
13661366{
1367   const pen_t *clut = &machine->remapped_colortable[0];
1367   const pen_t *clut = &machine->pens[0];
13681368   UINT32 bgcolor=clut[0];
13691369   int length;
13701370
r1679r1680
26682668
26692669   if( gfx )
26702670   {
2671      const pen_t *pal = &Machine->remapped_colortable[gfx->color_base + gfx->color_granularity * (color % gfx->total_colors)];
2671      const pen_t *pal = &Machine->pens[gfx->color_base + gfx->color_granularity * (color % gfx->total_colors)];
26722672      int source_base = (code % gfx->total_elements) * 16;
26732673
26742674      {
r1679r1680
28322832
28332833   if( gfx )
28342834   {
2835      const pen_t *pal = &Machine->remapped_colortable[gfx->color_base + gfx->color_granularity * (color % gfx->total_colors)];
2835      const pen_t *pal = &Machine->pens[gfx->color_base + gfx->color_granularity * (color % gfx->total_colors)];
28362836      int source_base = (code % gfx->total_elements) * 16;
28372837
28382838      {
src/mame/video/gaelco2.c
r1679r1680
268268   gaelco2_videoram = spriteram16;
269269
270270   /* create tilemaps */
271   pant[0] = tilemap_create(get_tile_info_gaelco2_screen0,tilemap_scan_rows,TILEMAP_TYPE_PEN,16,16,64,32);
272   pant[1] = tilemap_create(get_tile_info_gaelco2_screen1,tilemap_scan_rows,TILEMAP_TYPE_PEN,16,16,64,32);
271   pant[0] = tilemap_create(get_tile_info_gaelco2_screen0,tilemap_scan_rows,16,16,64,32);
272   pant[1] = tilemap_create(get_tile_info_gaelco2_screen1,tilemap_scan_rows,16,16,64,32);
273273
274274   /* set tilemap properties */
275275   tilemap_set_transparent_pen(pant[0],0);
r1679r1680
288288   gaelco2_videoram = spriteram16;
289289
290290   /* create tilemaps */
291   pant[0] = tilemap_create(get_tile_info_gaelco2_screen0_dual,tilemap_scan_rows,TILEMAP_TYPE_PEN,16,16,64,32);
292   pant[1] = tilemap_create(get_tile_info_gaelco2_screen1_dual,tilemap_scan_rows,TILEMAP_TYPE_PEN,16,16,64,32);
291   pant[0] = tilemap_create(get_tile_info_gaelco2_screen0_dual,tilemap_scan_rows,16,16,64,32);
292   pant[1] = tilemap_create(get_tile_info_gaelco2_screen1_dual,tilemap_scan_rows,16,16,64,32);
293293
294294   /* set tilemap properties */
295295   tilemap_set_transparent_pen(pant[0],0);
src/mame/video/homerun.c
r1679r1680
6363
6464VIDEO_START(homerun)
6565{
66   homerun_tilemap = tilemap_create(get_homerun_tile_info,tilemap_scan_rows,TILEMAP_TYPE_PEN, 8, 8,64,64);
66   homerun_tilemap = tilemap_create(get_homerun_tile_info,tilemap_scan_rows, 8, 8,64,64);
6767}
6868
6969static void draw_sprites(running_machine *machine, mame_bitmap *bitmap, const rectangle *cliprect )
src/mame/video/champbas.c
r1679r1680
134134
135135VIDEO_START( champbas )
136136{
137   bg_tilemap = tilemap_create(get_bg_tile_info, tilemap_scan_rows, TILEMAP_TYPE_PEN, 8, 8, 32, 32);
137   bg_tilemap = tilemap_create(get_bg_tile_info, tilemap_scan_rows, 8, 8, 32, 32);
138138}
139139
140140static void draw_sprites(running_machine *machine, mame_bitmap *bitmap, const rectangle *cliprect)
src/mame/video/baraduke.c
r1679r1680
119119
120120VIDEO_START( baraduke )
121121{
122   tx_tilemap = tilemap_create(tx_get_tile_info,tx_tilemap_scan,TILEMAP_TYPE_PEN,8,8,36,28);
123   bg_tilemap[0] = tilemap_create(get_tile_info0,tilemap_scan_rows,TILEMAP_TYPE_PEN,8,8,64,32);
124   bg_tilemap[1] = tilemap_create(get_tile_info1,tilemap_scan_rows,TILEMAP_TYPE_PEN,8,8,64,32);
122   tx_tilemap = tilemap_create(tx_get_tile_info,tx_tilemap_scan,8,8,36,28);
123   bg_tilemap[0] = tilemap_create(get_tile_info0,tilemap_scan_rows,8,8,64,32);
124   bg_tilemap[1] = tilemap_create(get_tile_info1,tilemap_scan_rows,8,8,64,32);
125125
126126   tilemap_set_transparent_pen(tx_tilemap,3);
127127   tilemap_set_transparent_pen(bg_tilemap[0],7);
src/mame/video/ssozumo.c
r1679r1680
132132VIDEO_START( ssozumo )
133133{
134134   bg_tilemap = tilemap_create(get_bg_tile_info, tilemap_scan_cols_flip_x,
135      TILEMAP_TYPE_PEN, 16, 16, 16, 32);
135      16, 16, 16, 32);
136136
137137   fg_tilemap = tilemap_create(get_fg_tile_info, tilemap_scan_cols_flip_x,
138      TILEMAP_TYPE_PEN, 8, 8, 32, 32);
138      8, 8, 32, 32);
139139
140140   tilemap_set_transparent_pen(fg_tilemap, 0);
141141}
src/mame/video/mcr.c
r1679r1680
9999   switch (mcr_cpu_board)
100100   {
101101      case 90009:
102         bg_tilemap = tilemap_create(mcr_90009_get_tile_info, tilemap_scan_rows, TILEMAP_TYPE_PEN, 16,16, 32,30);
102         bg_tilemap = tilemap_create(mcr_90009_get_tile_info, tilemap_scan_rows, 16,16, 32,30);
103103         break;
104104
105105      case 90010:
106         bg_tilemap = tilemap_create(mcr_90010_get_tile_info, tilemap_scan_rows, TILEMAP_TYPE_PEN, 16,16, 32,30);
106         bg_tilemap = tilemap_create(mcr_90010_get_tile_info, tilemap_scan_rows, 16,16, 32,30);
107107         break;
108108
109109      case 91475:
110         bg_tilemap = tilemap_create(mcr_90010_get_tile_info, tilemap_scan_rows, TILEMAP_TYPE_PEN, 16,16, 32,30);
110         bg_tilemap = tilemap_create(mcr_90010_get_tile_info, tilemap_scan_rows, 16,16, 32,30);
111111         break;
112112
113113      case 91490:
114         bg_tilemap = tilemap_create(mcr_91490_get_tile_info, tilemap_scan_rows, TILEMAP_TYPE_PEN, 16,16, 32,30);
114         bg_tilemap = tilemap_create(mcr_91490_get_tile_info, tilemap_scan_rows, 16,16, 32,30);
115115         break;
116116
117117      default:
src/mame/video/m107.c
r1679r1680
133133      pf_layer_info *layer = &pf_layer[laynum];
134134
135135      /* allocate a tilemaps per layer */
136      layer->tmap = tilemap_create(get_pf_tile_info, tilemap_scan_rows, TILEMAP_TYPE_PEN, 8,8, 64,64);
136      layer->tmap = tilemap_create(get_pf_tile_info, tilemap_scan_rows, 8,8, 64,64);
137137
138138      /* set the user data to point to the layer */
139139      tilemap_set_user_data(layer->tmap, &pf_layer[laynum]);
src/mame/video/arkanoid.c
r1679r1680
8383VIDEO_START( arkanoid )
8484{
8585   bg_tilemap = tilemap_create(get_bg_tile_info, tilemap_scan_rows,
86      TILEMAP_TYPE_PEN, 8, 8, 32, 32);
86      8, 8, 32, 32);
8787
8888   state_save_register_global(gfxbank);
8989   state_save_register_global(palettebank);
src/mame/video/twin16.c
r1679r1680
420420VIDEO_START( twin16 )
421421{
422422   fg_tilemap = tilemap_create(get_fg_tile_info, tilemap_scan_rows_flip_y,
423      TILEMAP_TYPE_PEN, 8, 8, 64, 32);
423      8, 8, 64, 32);
424424
425425   tilemap_set_transparent_pen(fg_tilemap, 0);
426426}
r1679r1680
428428VIDEO_START( fround )
429429{
430430   fg_tilemap = tilemap_create(get_fg_tile_info, tilemap_scan_rows,
431      TILEMAP_TYPE_PEN, 8, 8, 64, 32);
431      8, 8, 64, 32);
432432
433433   tilemap_set_transparent_pen(fg_tilemap, 0);
434434}
src/mame/video/megasys1.c
r1679r1680
386386   {
387387      /* 16x16 tilemaps */
388388      megasys1_tilemap[layer][0][0] = tilemap_create(megasys1_get_scroll_tile_info_16x16, megasys1_scan_16x16,
389                        TILEMAP_TYPE_PEN, 8,8, TILES_PER_PAGE_X * 16, TILES_PER_PAGE_Y * 2);
389                        8,8, TILES_PER_PAGE_X * 16, TILES_PER_PAGE_Y * 2);
390390      megasys1_tilemap[layer][0][1] = tilemap_create(megasys1_get_scroll_tile_info_16x16, megasys1_scan_16x16,
391                        TILEMAP_TYPE_PEN, 8,8, TILES_PER_PAGE_X * 8, TILES_PER_PAGE_Y * 4);
391                        8,8, TILES_PER_PAGE_X * 8, TILES_PER_PAGE_Y * 4);
392392      megasys1_tilemap[layer][0][2] = tilemap_create(megasys1_get_scroll_tile_info_16x16, megasys1_scan_16x16,
393                        TILEMAP_TYPE_PEN, 8,8, TILES_PER_PAGE_X * 4, TILES_PER_PAGE_Y * 8);
393                        8,8, TILES_PER_PAGE_X * 4, TILES_PER_PAGE_Y * 8);
394394      megasys1_tilemap[layer][0][3] = tilemap_create(megasys1_get_scroll_tile_info_16x16, megasys1_scan_16x16,
395                        TILEMAP_TYPE_PEN, 8,8, TILES_PER_PAGE_X * 2, TILES_PER_PAGE_Y * 16);
395                        8,8, TILES_PER_PAGE_X * 2, TILES_PER_PAGE_Y * 16);
396396
397397      /* 8x8 tilemaps */
398398      megasys1_tilemap[layer][1][0] = tilemap_create(megasys1_get_scroll_tile_info_8x8, megasys1_scan_8x8,
399                        TILEMAP_TYPE_PEN, 8,8, TILES_PER_PAGE_X * 8, TILES_PER_PAGE_Y * 1);
399                        8,8, TILES_PER_PAGE_X * 8, TILES_PER_PAGE_Y * 1);
400400      megasys1_tilemap[layer][1][1] = tilemap_create(megasys1_get_scroll_tile_info_8x8, megasys1_scan_8x8,
401                        TILEMAP_TYPE_PEN, 8,8, TILES_PER_PAGE_X * 4, TILES_PER_PAGE_Y * 2);
401                        8,8, TILES_PER_PAGE_X * 4, TILES_PER_PAGE_Y * 2);
402402      megasys1_tilemap[layer][1][2] = tilemap_create(megasys1_get_scroll_tile_info_8x8, megasys1_scan_8x8,
403                        TILEMAP_TYPE_PEN, 8,8, TILES_PER_PAGE_X * 4, TILES_PER_PAGE_Y * 2);
403                        8,8, TILES_PER_PAGE_X * 4, TILES_PER_PAGE_Y * 2);
404404      megasys1_tilemap[layer][1][3] = tilemap_create(megasys1_get_scroll_tile_info_8x8, megasys1_scan_8x8,
405                        TILEMAP_TYPE_PEN, 8,8, TILES_PER_PAGE_X * 2, TILES_PER_PAGE_Y * 4);
405                        8,8, TILES_PER_PAGE_X * 2, TILES_PER_PAGE_Y * 4);
406406
407407      /* set user data and transparency */
408408      for (i = 0; i < 8; i++)
src/mame/video/crshrace.c
r1679r1680
4141
4242VIDEO_START( crshrace )
4343{
44   tilemap1 = tilemap_create(get_tile_info1,tilemap_scan_rows,TILEMAP_TYPE_PEN,16,16,64,64);
45   tilemap2 = tilemap_create(get_tile_info2,tilemap_scan_rows,TILEMAP_TYPE_PEN, 8, 8,64,64);
44   tilemap1 = tilemap_create(get_tile_info1,tilemap_scan_rows,16,16,64,64);
45   tilemap2 = tilemap_create(get_tile_info2,tilemap_scan_rows, 8, 8,64,64);
4646
4747   K053936_wraparound_enable(0, 1);
4848   K053936_set_offset(0, -48, -21);
src/mame/video/airbustr.c
r1679r1680
116116VIDEO_START( airbustr )
117117{
118118   bg_tilemap = tilemap_create(get_bg_tile_info, tilemap_scan_rows,
119      TILEMAP_TYPE_PEN, 16, 16, 32, 32);
119      16, 16, 32, 32);
120120
121121   fg_tilemap = tilemap_create(get_fg_tile_info, tilemap_scan_rows,
122      TILEMAP_TYPE_PEN, 16, 16, 32, 32);
122      16, 16, 32, 32);
123123
124124   sprites_bitmap = auto_bitmap_alloc(machine->screen[0].width,machine->screen[0].height,machine->screen[0].format);
125125   tilemap_set_transparent_pen(fg_tilemap, 0);
src/mame/video/pacman.c
r1679r1680
191191   /* one pixel to the left to get a more correct placement */
192192   xoffsethack = 1;
193193
194   bg_tilemap = tilemap_create( pacman_get_tile_info, pacman_scan_rows, TILEMAP_TYPE_PEN, 8, 8, 36, 28 );
194   bg_tilemap = tilemap_create( pacman_get_tile_info, pacman_scan_rows, 8, 8, 36, 28 );
195195
196196   tilemap_set_scrolldx( bg_tilemap, 0, 384 - 288 );
197197   tilemap_set_scrolldy( bg_tilemap, 0, 264 - 224 );
r1679r1680
313313
314314   xoffsethack = 0;
315315
316   bg_tilemap = tilemap_create( pacman_get_tile_info, pacman_scan_rows, TILEMAP_TYPE_PEN, 8, 8, 36, 28 );
316   bg_tilemap = tilemap_create( pacman_get_tile_info, pacman_scan_rows, 8, 8, 36, 28 );
317317}
318318
319319WRITE8_HANDLER( pengo_palettebank_w )
r1679r1680
389389
390390   xoffsethack = 1;
391391
392   bg_tilemap = tilemap_create( s2650_get_tile_info,tilemap_scan_rows,TILEMAP_TYPE_PEN,8,8,32,32 );
392   bg_tilemap = tilemap_create( s2650_get_tile_info,tilemap_scan_rows,8,8,32,32 );
393393
394394   tilemap_set_scroll_cols(bg_tilemap, 32);
395395}
r1679r1680
562562
563563   xoffsethack = 1;
564564
565   bg_tilemap = tilemap_create( jrpacman_get_tile_info,jrpacman_scan_rows,TILEMAP_TYPE_PEN,8,8,36,54 );
565   bg_tilemap = tilemap_create( jrpacman_get_tile_info,jrpacman_scan_rows,8,8,36,54 );
566566
567567   tilemap_set_transparent_pen( bg_tilemap, 0 );
568568   tilemap_set_scroll_cols( bg_tilemap, 36 );
src/mame/video/clshroad.c
r1679r1680
217217VIDEO_START( firebatl )
218218{
219219   /* These 2 use the graphics and scroll value */
220   tilemap_0a = tilemap_create(get_tile_info_0a,tilemap_scan_rows,TILEMAP_TYPE_PEN,16,16,0x20,0x10);
221   tilemap_0b = tilemap_create(get_tile_info_0b,tilemap_scan_rows,TILEMAP_TYPE_PEN,16,16,0x20,0x10);
220   tilemap_0a = tilemap_create(get_tile_info_0a,tilemap_scan_rows,16,16,0x20,0x10);
221   tilemap_0b = tilemap_create(get_tile_info_0b,tilemap_scan_rows,16,16,0x20,0x10);
222222   /* Text (No scrolling) */
223   tilemap_1  = tilemap_create(get_tile_info_fb1,tilemap_scan_rows_extra,TILEMAP_TYPE_PEN,8,8,0x24,0x20);
223   tilemap_1  = tilemap_create(get_tile_info_fb1,tilemap_scan_rows_extra,8,8,0x24,0x20);
224224
225225   tilemap_set_scroll_rows( tilemap_0a, 1);
226226   tilemap_set_scroll_rows( tilemap_0b, 1);
r1679r1680
240240VIDEO_START( clshroad )
241241{
242242   /* These 2 use the graphics and scroll value */
243   tilemap_0a = tilemap_create(get_tile_info_0a,tilemap_scan_rows,TILEMAP_TYPE_PEN,16,16,0x20,0x10);
244   tilemap_0b = tilemap_create(get_tile_info_0b,tilemap_scan_rows,TILEMAP_TYPE_PEN,16,16,0x20,0x10);
243   tilemap_0a = tilemap_create(get_tile_info_0a,tilemap_scan_rows,16,16,0x20,0x10);
244   tilemap_0b = tilemap_create(get_tile_info_0b,tilemap_scan_rows,16,16,0x20,0x10);
245245   /* Text (No scrolling) */
246   tilemap_1  = tilemap_create(get_tile_info_1,tilemap_scan_rows_extra,TILEMAP_TYPE_PEN,8,8,0x24,0x20);
246   tilemap_1  = tilemap_create(get_tile_info_1,tilemap_scan_rows_extra,8,8,0x24,0x20);
247247
248248   tilemap_set_scroll_rows( tilemap_0a, 1);
249249   tilemap_set_scroll_rows( tilemap_0b, 1);
src/mame/video/dcheese.c
r1679r1680
8181      time = video_screen_get_time_until_pos(0, effscan, 0);
8282      if (attotime_compare(time, video_screen_get_scan_period(0)) < 0)
8383         time = attotime_add(time, video_screen_get_frame_period(0));
84      timer_adjust(blitter_timer, time, 0, attotime_zero);
84      timer_adjust_oneshot(blitter_timer, time, 0);
8585   }
8686}
8787
src/mame/video/bwing.c
r1679r1680
197197   UINT32 *dwptr;
198198   int i;
199199
200   charmap = tilemap_create(get_charinfo,tilemap_scan_cols,TILEMAP_TYPE_PEN, 8, 8,32,32);
201   fgmap = tilemap_create(get_fgtileinfo,bwing_scan_cols,TILEMAP_TYPE_PEN,16,16,64,64);
202   bgmap = tilemap_create(get_bgtileinfo,bwing_scan_cols,TILEMAP_TYPE_PEN,16,16,64,64);
200   charmap = tilemap_create(get_charinfo,tilemap_scan_cols, 8, 8,32,32);
201   fgmap = tilemap_create(get_fgtileinfo,bwing_scan_cols,16,16,64,64);
202   bgmap = tilemap_create(get_bgtileinfo,bwing_scan_cols,16,16,64,64);
203203   srxlat = auto_malloc(0x8000);
204204
205205   scrollmap[0] = fgmap;
src/mame/video/sf.c
r1679r1680
6060
6161VIDEO_START( sf )
6262{
63   bg_tilemap = tilemap_create(get_bg_tile_info,tilemap_scan_cols,TILEMAP_TYPE_PEN,     16,16,2048,16);
64   fg_tilemap = tilemap_create(get_fg_tile_info,tilemap_scan_cols,TILEMAP_TYPE_PEN,16,16,2048,16);
65   tx_tilemap = tilemap_create(get_tx_tile_info,tilemap_scan_rows,TILEMAP_TYPE_PEN, 8, 8,  64,32);
63   bg_tilemap = tilemap_create(get_bg_tile_info,tilemap_scan_cols,     16,16,2048,16);
64   fg_tilemap = tilemap_create(get_fg_tile_info,tilemap_scan_cols,16,16,2048,16);
65   tx_tilemap = tilemap_create(get_tx_tile_info,tilemap_scan_rows, 8, 8,  64,32);
6666
6767   tilemap_set_transparent_pen(fg_tilemap,15);
6868   tilemap_set_transparent_pen(tx_tilemap,3);
src/mame/video/sengokmj.c
r1679r1680
105105
106106VIDEO_START( sengokmj )
107107{
108   bg_tilemap = tilemap_create(sengoku_bg_tile_info,tilemap_scan_rows,TILEMAP_TYPE_PEN,     16,16,32,16);
109   md_tilemap = tilemap_create(sengoku_md_tile_info,tilemap_scan_rows,TILEMAP_TYPE_PEN,16,16,32,16);
110   fg_tilemap = tilemap_create(sengoku_fg_tile_info,tilemap_scan_rows,TILEMAP_TYPE_PEN,16,16,32,16);
111   tx_tilemap = tilemap_create(sengoku_tx_tile_info,tilemap_scan_rows,TILEMAP_TYPE_PEN, 8, 8,64,32);
108   bg_tilemap = tilemap_create(sengoku_bg_tile_info,tilemap_scan_rows,     16,16,32,16);
109   md_tilemap = tilemap_create(sengoku_md_tile_info,tilemap_scan_rows,16,16,32,16);
110   fg_tilemap = tilemap_create(sengoku_fg_tile_info,tilemap_scan_rows,16,16,32,16);
111   tx_tilemap = tilemap_create(sengoku_tx_tile_info,tilemap_scan_rows, 8, 8,64,32);
112112
113113   tilemap_set_transparent_pen(md_tilemap,15);
114114   tilemap_set_transparent_pen(fg_tilemap,15);
src/mame/video/cave.c
r1679r1680
410410   {
411411      case 4:
412412         tilemap_3 = tilemap_create(   get_tile_info_3, tilemap_scan_rows,
413                              TILEMAP_TYPE_PEN, 8,8, 512/8,512/8 );
413                              8,8, 512/8,512/8 );
414414         tilemap_set_transparent_pen(tilemap_3, 0);
415415         tilemap_set_scroll_rows(tilemap_3, 1);
416416         tilemap_set_scroll_cols(tilemap_3, 1);
417417
418418      case 3:
419419         tilemap_2 = tilemap_create(   get_tile_info_2, tilemap_scan_rows,
420                              TILEMAP_TYPE_PEN, 8,8, 512/8,512/8 );
420                              8,8, 512/8,512/8 );
421421         tilemap_set_transparent_pen(tilemap_2, 0);
422422         tilemap_set_scroll_rows(tilemap_2, 1);
423423         tilemap_set_scroll_cols(tilemap_2, 1);
424424
425425      case 2:
426426         tilemap_1 = tilemap_create(   get_tile_info_1, tilemap_scan_rows,
427                              TILEMAP_TYPE_PEN, 8,8, 512/8,512/8 );
427                              8,8, 512/8,512/8 );
428428         tilemap_set_transparent_pen(tilemap_1, 0);
429429         tilemap_set_scroll_rows(tilemap_1, 1);
430430         tilemap_set_scroll_cols(tilemap_1, 1);
431431
432432      case 1:
433433         tilemap_0 = tilemap_create(   get_tile_info_0, tilemap_scan_rows,
434                              TILEMAP_TYPE_PEN, 8,8, 512/8,512/8 );
434                              8,8, 512/8,512/8 );
435435         tilemap_set_transparent_pen(tilemap_0, 0);
436436         tilemap_set_scroll_rows(tilemap_0, 1);
437437         tilemap_set_scroll_cols(tilemap_0, 1);
r1679r1680
479479
480480   /* Layer 2 (8x8) needs to be handled differently */
481481   tilemap_2 = tilemap_create(   sailormn_get_tile_info_2, tilemap_scan_rows,
482                        TILEMAP_TYPE_PEN, 8,8, 512/8,512/8 );
482                        8,8, 512/8,512/8 );
483483   tilemap_set_transparent_pen(tilemap_2, 0);
484484   tilemap_set_scroll_rows(tilemap_2, 1);
485485   tilemap_set_scroll_cols(tilemap_2, 1);
src/mame/video/dooyong.c
r1679r1680
630630
631631   /* Create tilemaps */
632632   bg_tilemap = tilemap_create(get_bg_tile_info, tilemap_scan_cols,
633      TILEMAP_TYPE_PEN, 32, 32, 32, 8);
633      32, 32, 32, 8);
634634   fg_tilemap = tilemap_create(get_fg_tile_info, tilemap_scan_cols,
635      TILEMAP_TYPE_PEN, 32, 32, 32, 8);
635      32, 32, 32, 8);
636636   tx_tilemap = tilemap_create(get_tx_tile_info, tilemap_scan_cols,
637      TILEMAP_TYPE_PEN, 8, 8, 64, 32);
637      8, 8, 64, 32);
638638
639639   /* Configure tilemap transparency */
640640   tilemap_set_transparent_pen(fg_tilemap, 15);
r1679r1680
662662
663663   /* Create tilemaps */
664664   bg_tilemap = tilemap_create(get_bg_tile_info, tilemap_scan_cols,
665      TILEMAP_TYPE_PEN, 32, 32, 32, 8);
665      32, 32, 32, 8);
666666   fg_tilemap = tilemap_create(get_fg_tile_info, tilemap_scan_cols,
667      TILEMAP_TYPE_PEN, 32, 32, 32, 8);
667      32, 32, 32, 8);
668668   tx_tilemap = tilemap_create(get_tx_tile_info, tilemap_scan_cols,
669      TILEMAP_TYPE_PEN, 8, 8, 64, 32);
669      8, 8, 64, 32);
670670
671671   /* Configure tilemap transparency */
672672   tilemap_set_transparent_pen(fg_tilemap, 15);
r1679r1680
693693
694694   /* Create tilemaps */
695695   bg_tilemap = tilemap_create(get_bg_tile_info, tilemap_scan_cols,
696      TILEMAP_TYPE_PEN, 32, 32, 32, 8);
696      32, 32, 32, 8);
697697   fg_tilemap = tilemap_create(get_fg_tile_info, tilemap_scan_cols,
698      TILEMAP_TYPE_PEN, 32, 32, 32, 8);
698      32, 32, 32, 8);
699699   tx_tilemap = tilemap_create(get_tx_tile_info, tilemap_scan_cols,
700      TILEMAP_TYPE_PEN, 8, 8, 64, 32);
700      8, 8, 64, 32);
701701
702702   /* Configure tilemap transparency */
703703   tilemap_set_transparent_pen(fg_tilemap, 15);
r1679r1680
724724
725725   /* Create tilemaps */
726726   bg_tilemap = tilemap_create(get_bg_tile_info, tilemap_scan_cols,
727      TILEMAP_TYPE_PEN, 32, 32, 32, 8);
727      32, 32, 32, 8);
728728   fg_tilemap = tilemap_create(get_fg_tile_info, tilemap_scan_cols,
729      TILEMAP_TYPE_PEN, 32, 32, 32, 8);
729      32, 32, 32, 8);
730730   fg2_tilemap = tilemap_create(get_fg2_tile_info, tilemap_scan_cols,
731      TILEMAP_TYPE_PEN, 32, 32, 32, 8);
731      32, 32, 32, 8);
732732   tx_tilemap = tilemap_create(get_tx_tile_info, tilemap_scan_cols,
733      TILEMAP_TYPE_PEN, 8, 8, 64, 32);
733      8, 8, 64, 32);
734734
735735   /* Configure tilemap transparency */
736736   tilemap_set_transparent_pen(fg_tilemap, 15);
r1679r1680
756756
757757   /* Create tilemaps */
758758   bg_tilemap = tilemap_create(get_bg_tile_info, tilemap_scan_cols,
759      TILEMAP_TYPE_PEN, 32, 32, 32, 8);
759      32, 32, 32, 8);
760760   fg_tilemap = tilemap_create(flytiger_get_fg_tile_info, tilemap_scan_cols,
761      TILEMAP_TYPE_PEN, 32, 32, 32, 8);
761      32, 32, 32, 8);
762762   tx_tilemap = tilemap_create(get_tx_tile_info, tilemap_scan_cols,
763      TILEMAP_TYPE_PEN, 8, 8, 64, 32);
763      8, 8, 64, 32);
764764
765765   /* Configure tilemap transparency */
766766   tilemap_set_transparent_pen(bg_tilemap, 15);
r1679r1680
789789
790790   /* Create tilemaps */
791791   bg_tilemap = tilemap_create(get_bg_tile_info, tilemap_scan_cols,
792      TILEMAP_TYPE_PEN, 32, 32, 32, 8);
792      32, 32, 32, 8);
793793   fg_tilemap = tilemap_create(get_fg_tile_info, tilemap_scan_cols,
794      TILEMAP_TYPE_PEN, 32, 32, 32, 8);
794      32, 32, 32, 8);
795795   tx_tilemap = tilemap_create(get_tx_tile_info, tilemap_scan_cols,
796      TILEMAP_TYPE_PEN, 8, 8, 64, 32);
796      8, 8, 64, 32);
797797
798798   /* Configure tilemap transparency */
799799   tilemap_set_transparent_pen(fg_tilemap, 15);
r1679r1680
823823
824824   /* Create tilemaps */
825825   bg_tilemap = tilemap_create(get_bg_tile_info, tilemap_scan_cols,
826      TILEMAP_TYPE_PEN, 16, 16, 64, 32);
826      16, 16, 64, 32);
827827   bg2_tilemap = tilemap_create(get_bg2_tile_info, tilemap_scan_cols,
828      TILEMAP_TYPE_PEN, 16, 16, 64, 32);
828      16, 16, 64, 32);
829829   fg_tilemap = tilemap_create(get_fg_tile_info, tilemap_scan_cols,
830      TILEMAP_TYPE_PEN, 16, 16, 64, 32);
830      16, 16, 64, 32);
831831   fg2_tilemap = tilemap_create(get_fg2_tile_info, tilemap_scan_cols,
832      TILEMAP_TYPE_PEN, 16, 16, 64, 32);
832      16, 16, 64, 32);
833833
834834   /* Configure tilemap transparency */
835835   tilemap_set_transparent_pen(bg2_tilemap, 15);
r1679r1680
852852
853853   /* Create tilemaps */
854854   bg_tilemap = tilemap_create(get_bg_tile_info, tilemap_scan_cols,
855      TILEMAP_TYPE_PEN, 32, 32, 32, 8);
855      32, 32, 32, 8);
856856   bg2_tilemap = fg_tilemap = fg2_tilemap = NULL;   /* Stop scroll handler from crashing on these */
857857
858858   /* Register for save/restore */
src/mame/video/brkthru.c
r1679r1680
117117
118118VIDEO_START( brkthru )
119119{
120   fg_tilemap = tilemap_create(get_fg_tile_info,tilemap_scan_rows,TILEMAP_TYPE_PEN,8,8,32,32);
121   bg_tilemap = tilemap_create(get_bg_tile_info,tilemap_scan_cols,TILEMAP_TYPE_PEN,16,16,32,16);
120   fg_tilemap = tilemap_create(get_fg_tile_info,tilemap_scan_rows,8,8,32,32);
121   bg_tilemap = tilemap_create(get_bg_tile_info,tilemap_scan_cols,16,16,32,16);
122122
123123   tilemap_set_transparent_pen( fg_tilemap, 0 );
124124   tilemap_set_transparent_pen( bg_tilemap, 0 );
src/mame/video/williams.c
r1679r1680
207207   state_save_register_global_pointer(paletteram, 0x400 * 2);
208208
209209   /* create the tilemap */
210   bg_tilemap = tilemap_create(get_tile_info, tilemap_scan_cols, TILEMAP_TYPE_PEN, 24,16, 128,16);
210   bg_tilemap = tilemap_create(get_tile_info, tilemap_scan_cols, 24,16, 128,16);
211211   tilemap_set_scrolldx(bg_tilemap, 2, 0);
212212
213213   state_save_register();
src/mame/video/dec8.c
r1679r1680
511511
512512VIDEO_START( cobracom )
513513{
514   dec8_pf0_tilemap = tilemap_create(get_bac0_tile_info,bac0_scan_rows,0,16,16,32,32);
515   dec8_pf1_tilemap = tilemap_create(get_bac1_tile_info,bac0_scan_rows,TILEMAP_TYPE_PEN,16,16,32,32);
516   dec8_fix_tilemap = tilemap_create(get_cobracom_fix_tile_info,tilemap_scan_rows,TILEMAP_TYPE_PEN,8,8,32,32);
514   dec8_pf0_tilemap = tilemap_create(get_bac0_tile_info,bac0_scan_rows,16,16,32,32);
515   dec8_pf1_tilemap = tilemap_create(get_bac1_tile_info,bac0_scan_rows,16,16,32,32);
516   dec8_fix_tilemap = tilemap_create(get_cobracom_fix_tile_info,tilemap_scan_rows,8,8,32,32);
517517
518518   tilemap_set_transparent_pen(dec8_pf1_tilemap,0);
519519   tilemap_set_transparent_pen(dec8_fix_tilemap,0);
r1679r1680
559559
560560VIDEO_START( ghostb )
561561{
562   dec8_pf0_tilemap = tilemap_create(get_bac0_tile_info,bac0_scan_rows,0,16,16,32,32);
563   dec8_fix_tilemap = tilemap_create(get_ghostb_fix_tile_info,tilemap_scan_rows,TILEMAP_TYPE_PEN,8,8,32,32);
562   dec8_pf0_tilemap = tilemap_create(get_bac0_tile_info,bac0_scan_rows,16,16,32,32);
563   dec8_fix_tilemap = tilemap_create(get_ghostb_fix_tile_info,tilemap_scan_rows,8,8,32,32);
564564   tilemap_set_transparent_pen(dec8_fix_tilemap,0);
565565
566566   game_uses_priority=0;
r1679r1680
599599
600600VIDEO_START( oscar )
601601{
602   dec8_pf0_tilemap = tilemap_create(get_bac0_tile_info,bac0_scan_rows,TILEMAP_TYPE_PEN,16,16,32,32);
603   dec8_fix_tilemap = tilemap_create(get_oscar_fix_tile_info,tilemap_scan_rows,TILEMAP_TYPE_PEN,8,8,32,32);
602   dec8_pf0_tilemap = tilemap_create(get_bac0_tile_info,bac0_scan_rows,16,16,32,32);
603   dec8_fix_tilemap = tilemap_create(get_oscar_fix_tile_info,tilemap_scan_rows,8,8,32,32);
604604
605605   tilemap_set_transparent_pen(dec8_fix_tilemap,0);
606606   tilemap_set_transmask(dec8_pf0_tilemap,0,0x00ff,0xff00); /* Bottom 8 pens */
r1679r1680
672672
673673VIDEO_START( lastmiss )
674674{
675   dec8_pf0_tilemap = tilemap_create(get_lastmiss_tile_info,lastmiss_scan_rows,0,16,16,32,32);
676   dec8_fix_tilemap = tilemap_create(get_lastmiss_fix_tile_info,tilemap_scan_rows,TILEMAP_TYPE_PEN,8,8,32,32);
675   dec8_pf0_tilemap = tilemap_create(get_lastmiss_tile_info,lastmiss_scan_rows,16,16,32,32);
676   dec8_fix_tilemap = tilemap_create(get_lastmiss_fix_tile_info,tilemap_scan_rows,8,8,32,32);
677677
678678   tilemap_set_transparent_pen(dec8_fix_tilemap,0);
679679   game_uses_priority=0;
r1679r1680
681681
682682VIDEO_START( shackled )
683683{
684   dec8_pf0_tilemap = tilemap_create(get_lastmiss_tile_info,lastmiss_scan_rows,TILEMAP_TYPE_PEN,16,16,32,32);
685   dec8_fix_tilemap = tilemap_create(get_lastmiss_fix_tile_info,tilemap_scan_rows,TILEMAP_TYPE_PEN,8,8,32,32);
684   dec8_pf0_tilemap = tilemap_create(get_lastmiss_tile_info,lastmiss_scan_rows,16,16,32,32);
685   dec8_fix_tilemap = tilemap_create(get_lastmiss_fix_tile_info,tilemap_scan_rows,8,8,32,32);
686686
687687   tilemap_set_transparent_pen(dec8_fix_tilemap,0);
688688   tilemap_set_transmask(dec8_pf0_tilemap,0,0x000f,0xfff0); /* Bottom 12 pens */
r1679r1680
737737
738738VIDEO_START( srdarwin )
739739{
740   dec8_pf0_tilemap = tilemap_create(get_srdarwin_tile_info,tilemap_scan_rows,TILEMAP_TYPE_PEN,16,16,32,16);
741   dec8_fix_tilemap = tilemap_create(get_srdarwin_fix_tile_info,tilemap_scan_rows,TILEMAP_TYPE_PEN,8,8,32,32);
740   dec8_pf0_tilemap = tilemap_create(get_srdarwin_tile_info,tilemap_scan_rows,16,16,32,16);
741   dec8_fix_tilemap = tilemap_create(get_srdarwin_fix_tile_info,tilemap_scan_rows,8,8,32,32);
742742
743743   tilemap_set_transparent_pen(dec8_fix_tilemap,0);
744744   tilemap_set_transmask(dec8_pf0_tilemap,0,0xffff,0x0000); //* draw as background only
r1679r1680
804804
805805VIDEO_START( gondo )
806806{
807   dec8_fix_tilemap=tilemap_create(get_gondo_fix_tile_info,tilemap_scan_rows,TILEMAP_TYPE_PEN,8,8,32,32);
808   dec8_pf0_tilemap=tilemap_create(get_gondo_tile_info,tilemap_scan_rows,TILEMAP_TYPE_PEN,16,16,32,32);
807   dec8_fix_tilemap=tilemap_create(get_gondo_fix_tile_info,tilemap_scan_rows,8,8,32,32);
808   dec8_pf0_tilemap=tilemap_create(get_gondo_tile_info,tilemap_scan_rows,16,16,32,32);
809809
810810   tilemap_set_transparent_pen(dec8_fix_tilemap,0);
811811   tilemap_set_transmask(dec8_pf0_tilemap,0,0x00ff,0xff00); /* Bottom 8 pens */
r1679r1680
814814
815815VIDEO_START( garyoret )
816816{
817   dec8_fix_tilemap=tilemap_create(get_gondo_fix_tile_info,tilemap_scan_rows,TILEMAP_TYPE_PEN,8,8,32,32);
818   dec8_pf0_tilemap=tilemap_create(get_gondo_tile_info,tilemap_scan_rows,TILEMAP_TYPE_PEN,16,16,32,32);
817   dec8_fix_tilemap=tilemap_create(get_gondo_fix_tile_info,tilemap_scan_rows,8,8,32,32);
818   dec8_pf0_tilemap=tilemap_create(get_gondo_tile_info,tilemap_scan_rows,16,16,32,32);
819819
820820   tilemap_set_transparent_pen(dec8_fix_tilemap,0);
821821   game_uses_priority=1;
src/mame/video/fuukifg3.c
r1679r1680
110110   buffered_spriteram32_2 = auto_malloc(spriteram_size);
111111
112112   tilemap_0 = tilemap_create(   get_tile_info_0, tilemap_scan_rows,
113                        TILEMAP_TYPE_PEN, 16, 16, 64,32);
113                        16, 16, 64,32);
114114
115115   tilemap_1 = tilemap_create(   get_tile_info_1, tilemap_scan_rows,
116                        TILEMAP_TYPE_PEN, 16, 16, 64,32);
116                        16, 16, 64,32);
117117
118118   tilemap_2 = tilemap_create(   get_tile_info_2, tilemap_scan_rows,
119                        TILEMAP_TYPE_PEN,  8,  8, 64,32);
119                          8,  8, 64,32);
120120
121121   tilemap_3 = tilemap_create(   get_tile_info_3, tilemap_scan_rows,
122                        TILEMAP_TYPE_PEN,  8,  8, 64,32);
122                          8,  8, 64,32);
123123
124124   tilemap_set_transparent_pen(tilemap_0,0xff);   // 8 bits
125125   tilemap_set_transparent_pen(tilemap_1,0xff);   // 8 bits
src/mame/video/tbowl.c
r1679r1680
204204
205205VIDEO_START( tbowl )
206206{
207   tx_tilemap = tilemap_create(get_tx_tile_info,tilemap_scan_rows,TILEMAP_TYPE_PEN, 8, 8,64,32);
208   bg_tilemap = tilemap_create(get_bg_tile_info,tilemap_scan_rows,TILEMAP_TYPE_PEN, 16, 16,128,32);
209   bg2_tilemap = tilemap_create(get_bg2_tile_info,tilemap_scan_rows,TILEMAP_TYPE_PEN, 16, 16,128,32);
207   tx_tilemap = tilemap_create(get_tx_tile_info,tilemap_scan_rows, 8, 8,64,32);
208   bg_tilemap = tilemap_create(get_bg_tile_info,tilemap_scan_rows, 16, 16,128,32);
209   bg2_tilemap = tilemap_create(get_bg2_tile_info,tilemap_scan_rows, 16, 16,128,32);
210210
211211   tilemap_set_transparent_pen(tx_tilemap,0);
212212   tilemap_set_transparent_pen(bg_tilemap,0);
src/mame/video/battlane.c
r1679r1680
145145VIDEO_START( battlane )
146146{
147147   bg_tilemap = tilemap_create(get_tile_info_bg, battlane_tilemap_scan_rows_2x2,
148      TILEMAP_TYPE_PEN, 16, 16, 32, 32);
148      16, 16, 32, 32);
149149
150150   screen_bitmap = auto_bitmap_alloc(32 * 8, 32 * 8, BITMAP_FORMAT_INDEXED8);
151151}
src/mame/video/atarigt.c
r1679r1680
140140   atarigen_blend_gfx(machine, 0, 2, 0x0f, 0x30);
141141
142142   /* initialize the playfield */
143   atarigen_playfield_tilemap = tilemap_create(get_playfield_tile_info, atarigt_playfield_scan, TILEMAP_TYPE_PEN, 8,8, 128,64);
143   atarigen_playfield_tilemap = tilemap_create(get_playfield_tile_info, atarigt_playfield_scan, 8,8, 128,64);
144144
145145   /* initialize the motion objects */
146146   atarirle_init(0, &adjusted_modesc);
147147
148148   /* initialize the alphanumerics */
149   atarigen_alpha_tilemap = tilemap_create(get_alpha_tile_info, tilemap_scan_rows, TILEMAP_TYPE_PEN, 8,8, 64,32);
149   atarigen_alpha_tilemap = tilemap_create(get_alpha_tile_info, tilemap_scan_rows, 8,8, 64,32);
150150
151151   /* allocate temp bitmaps */
152152   pf_bitmap = auto_bitmap_alloc(machine->screen[0].width, machine->screen[0].height, BITMAP_FORMAT_INDEXED16);
src/mame/video/thepit.c
r1679r1680
147147
148148VIDEO_START( thepit )
149149{
150   thepit_solid_tilemap = tilemap_create(solid_get_tile_info,tilemap_scan_rows,TILEMAP_TYPE_PEN,8,8,32,32);
150   thepit_solid_tilemap = tilemap_create(solid_get_tile_info,tilemap_scan_rows,8,8,32,32);
151151
152   thepit_tilemap = tilemap_create(get_tile_info,tilemap_scan_rows,TILEMAP_TYPE_PEN,8,8,32,32);
152   thepit_tilemap = tilemap_create(get_tile_info,tilemap_scan_rows,8,8,32,32);
153153   tilemap_set_transparent_pen(thepit_tilemap, 0);
154154
155155   tilemap_set_scroll_cols(thepit_solid_tilemap, 32);
src/mame/video/rpunch.c
r1679r1680
7979{
8080   cpunum_set_input_line(machine, 0, 1, HOLD_LINE);
8181   if (param != 0)
82      timer_adjust(crtc_timer, attotime_make(0, machine->screen[0].refresh / param), 0, attotime_make(0, machine->screen[0].refresh / param));
82      timer_adjust_periodic(crtc_timer, attotime_make(0, machine->screen[0].refresh / param), 0, attotime_make(0, machine->screen[0].refresh / param));
8383}
8484
8585
8686VIDEO_START( rpunch )
8787{
8888   /* allocate tilemaps for the backgrounds */
89   background[0] = tilemap_create(get_bg0_tile_info,tilemap_scan_cols,TILEMAP_TYPE_PEN,     8,8,64,64);
90   background[1] = tilemap_create(get_bg1_tile_info,tilemap_scan_cols,TILEMAP_TYPE_PEN,8,8,64,64);
89   background[0] = tilemap_create(get_bg0_tile_info,tilemap_scan_cols,     8,8,64,64);
90   background[1] = tilemap_create(get_bg1_tile_info,tilemap_scan_cols,8,8,64,64);
9191
9292   /* configure the tilemaps */
9393   tilemap_set_transparent_pen(background[1],15);
r1679r1680
165165      {
166166         /* only register we know about.... */
167167         case 0x0b:
168            timer_adjust(crtc_timer, video_screen_get_time_until_pos(0, Machine->screen[0].visarea.max_y + 1, 0), (data == 0xc0) ? 2 : 1, attotime_zero);
168            timer_adjust_oneshot(crtc_timer, video_screen_get_time_until_pos(0, Machine->screen[0].visarea.max_y + 1, 0), (data == 0xc0) ? 2 : 1);
169169            break;
170170
171171         default:
src/mame/video/changela.c
r1679r1680
4848   tree1_bitmap = auto_bitmap_alloc(machine->screen[0].width, machine->screen[0].height, machine->screen[0].format);
4949
5050   changela_scanline_timer = timer_alloc(changela_scanline_callback, NULL);
51   timer_adjust(changela_scanline_timer, video_screen_get_time_until_pos(0, 30, 0), 30, attotime_zero);
51   timer_adjust_oneshot(changela_scanline_timer, video_screen_get_time_until_pos(0, 30, 0), 30);
5252
5353   state_save_register_global(slopeROM_bank);
5454   state_save_register_global(tree_en);
r1679r1680
738738
739739   sy++;
740740   if(sy > 256) sy = 30;
741   timer_adjust(changela_scanline_timer, video_screen_get_time_until_pos(0, sy, 0), sy, attotime_zero);
741   timer_adjust_oneshot(changela_scanline_timer, video_screen_get_time_until_pos(0, sy, 0), sy);
742742}
743743
744744VIDEO_UPDATE( changela )
src/mame/video/triplhnt.c
r1679r1680
3333{
3434   helper = auto_bitmap_alloc(machine->screen[0].width, machine->screen[0].height, machine->screen[0].format);
3535
36   bg_tilemap = tilemap_create(get_tile_info, tilemap_scan_rows, 0, 16, 16, 16, 16);
36   bg_tilemap = tilemap_create(get_tile_info, tilemap_scan_rows, 16, 16, 16, 16);
3737}
3838
3939
src/mame/video/pooyan.c
r1679r1680
55***************************************************************************/
66
77#include "driver.h"
8#include "video/resnet.h"
89#include "pooyan.h"
910
11
1012static tilemap *bg_tilemap;
1113
1214
r1679r1680
3234
3335PALETTE_INIT( pooyan )
3436{
35   rgb_t palette[32];
37   static const int resistances_rg[3] = { 1000, 470, 220 };
38   static const int resistances_b [2] = { 470, 220 };
39   double rweights[3], gweights[3], bweights[2];
3640   int i;
3741
38   for (i = 0;i < 32;i++)
42   /* compute the color output resistor weights */
43   compute_resistor_weights(0,   255, -1.0,
44         3, resistances_rg, rweights, 1000, 0,
45         3, resistances_rg, gweights, 1000, 0,
46         2, resistances_b,  bweights, 1000, 0);
47
48   /* allocate the colortable */
49   machine->colortable = colortable_alloc(machine, 0x20);
50
51   /* create a lookup table for the palette */
52   for (i = 0; i < 0x20; i++)
3953   {
40      int bit0,bit1,bit2,r,g,b;
54      int bit0, bit1, bit2;
55      int r, g, b;
4156
4257      /* red component */
43      bit0 = (*color_prom >> 0) & 0x01;
44      bit1 = (*color_prom >> 1) & 0x01;
45      bit2 = (*color_prom >> 2) & 0x01;
46      r = 0x21 * bit0 + 0x47 * bit1 + 0x97 * bit2;
58      bit0 = (color_prom[i] >> 0) & 0x01;
59      bit1 = (color_prom[i] >> 1) & 0x01;
60      bit2 = (color_prom[i] >> 2) & 0x01;
61      r = combine_3_weights(rweights, bit0, bit1, bit2);
62
4763      /* green component */
48      bit0 = (*color_prom >> 3) & 0x01;
49      bit1 = (*color_prom >> 4) & 0x01;
50      bit2 = (*color_prom >> 5) & 0x01;
51      g = 0x21 * bit0 + 0x47 * bit1 + 0x97 * bit2;
64      bit0 = (color_prom[i] >> 3) & 0x01;
65      bit1 = (color_prom[i] >> 4) & 0x01;
66      bit2 = (color_prom[i] >> 5) & 0x01;
67      g = combine_3_weights(gweights, bit0, bit1, bit2);
68
5269      /* blue component */
53      bit0 = 0;
54      bit1 = (*color_prom >> 6) & 0x01;
55      bit2 = (*color_prom >> 7) & 0x01;
56      b = 0x21 * bit0 + 0x47 * bit1 + 0x97 * bit2;
70      bit0 = (color_prom[i] >> 6) & 0x01;
71      bit1 = (color_prom[i] >> 7) & 0x01;
72      b = combine_2_weights(bweights, bit0, bit1);
5773
58      palette[i] = MAKE_RGB(r,g,b);
59      color_prom++;
74      colortable_palette_set_color(machine->colortable, i, MAKE_RGB(r, g, b));
6075   }
6176
62   /* color_prom now points to the beginning of the char lookup table */
77   /* color_prom now points to the beginning of the lookup table */
78   color_prom += 0x20;
6379
80   /* characters */
81   for (i = 0; i < 0x100; i++)
82   {
83      UINT8 ctabentry = (color_prom[i] & 0x0f) | 0x10;
84      colortable_entry_set_value(machine->colortable, i, ctabentry);
85   }
86
6487   /* sprites */
65   for (i = 0;i < 16*16;i++)
66      palette_set_color(machine, 16*16+i, palette[*color_prom++ & 0x0f]);
67
68   /* characters */
69   for (i = 0;i < 16*16;i++)
70      palette_set_color(machine, i, palette[(*color_prom++ & 0x0f) + 0x10]);
88   for (i = 0x100; i < 0x200; i++)
89   {
90      UINT8 ctabentry = color_prom[i] & 0x0f;
91      colortable_entry_set_value(machine->colortable, i, ctabentry);
92   }
7193}
7294
7395
r1679r1680
98120
99121VIDEO_START( pooyan )
100122{
101   bg_tilemap = tilemap_create(get_bg_tile_info, tilemap_scan_rows, TILEMAP_TYPE_PEN, 8,8, 32,32);
123   bg_tilemap = tilemap_create(get_bg_tile_info, tilemap_scan_rows, 8,8, 32,32);
102124}
103125
104126
r1679r1680
150172      int flipx = ~spriteram_2[offs] & 0x40;
151173      int flipy = spriteram_2[offs] & 0x80;
152174
153      /* Sprite flipscreen is supported by software */
154175      drawgfx(bitmap,machine->gfx[1],
155176         code,
156177         color,
157178         flipx, flipy,
158179         sx, sy,
159180         cliprect,
160         TRANSPARENCY_PEN, 0);
181         TRANSPARENCY_PENS,
182         colortable_get_transpen_mask(machine->colortable, machine->gfx[1], color, 0));
161183   }
162184}
163185
src/mame/video/sidepckt.c
r1679r1680
6565
6666VIDEO_START( sidepckt )
6767{
68   bg_tilemap = tilemap_create(get_tile_info,tilemap_scan_rows,TILEMAP_TYPE_PEN,8,8,32,32);
68   bg_tilemap = tilemap_create(get_tile_info,tilemap_scan_rows,8,8,32,32);
6969
7070   tilemap_set_transmask(bg_tilemap,0,0xff,0x00); /* split type 0 is totally transparent in front half */
7171   tilemap_set_transmask(bg_tilemap,1,0x01,0xfe); /* split type 1 has pen 0 transparent in front half */
src/mame/video/pirates.c
r1679r1680
4040
4141VIDEO_START(pirates)
4242{
43   tx_tilemap = tilemap_create(get_tx_tile_info,tilemap_scan_cols,TILEMAP_TYPE_PEN,8,8,36,32);
43   tx_tilemap = tilemap_create(get_tx_tile_info,tilemap_scan_cols,8,8,36,32);
4444
4545   /* Not sure how big they can be, Pirates uses only 32 columns, Genix 44 */
46   fg_tilemap = tilemap_create(get_fg_tile_info,tilemap_scan_cols,TILEMAP_TYPE_PEN,8,8,64,32);
47   bg_tilemap = tilemap_create(get_bg_tile_info,tilemap_scan_cols,TILEMAP_TYPE_PEN,     8,8,64,32);
46   fg_tilemap = tilemap_create(get_fg_tile_info,tilemap_scan_cols,8,8,64,32);
47   bg_tilemap = tilemap_create(get_bg_tile_info,tilemap_scan_cols,     8,8,64,32);
4848
4949   tilemap_set_transparent_pen(tx_tilemap,0);
5050   tilemap_set_transparent_pen(fg_tilemap,0);
src/mame/video/tankbatt.c
r1679r1680
8080VIDEO_START( tankbatt )
8181{
8282   bg_tilemap = tilemap_create(get_bg_tile_info, tilemap_scan_rows,
83      TILEMAP_TYPE_PEN, 8, 8, 32, 32);
83      8, 8, 32, 32);
8484}
8585
8686static void draw_bullets(running_machine *machine, mame_bitmap *bitmap, const rectangle *cliprect)
src/mame/video/exerion.c
r1679r1680
55***************************************************************************/
66
77#include "driver.h"
8#include "video/resnet.h"
89#include "exerion.h"
910
1011
r1679r1680
4647
4748PALETTE_INIT( exerion )
4849{
50   static const int resistances_rg[3] = { 1000, 470, 220 };
51   static const int resistances_b [2] = { 470, 220 };
52   double rweights[3], gweights[3], bweights[2];
4953   int i;
5054
51   for (i = 0; i < machine->drv->total_colors; i++)
55   /* compute the color output resistor weights */
56   compute_resistor_weights(0,   255, -1.0,
57         3, &resistances_rg[0], rweights, 0, 0,
58         3, &resistances_rg[0], gweights, 0, 0,
59         2, &resistances_b[0],  bweights, 0, 0);
60
61   /* allocate the colortable */
62   machine->colortable = colortable_alloc(machine, 0x20);
63
64   /* create a lookup table for the palette */
65   for (i = 0; i < 0x20; i++)
5266   {
53      int bit0, bit1, bit2, r, g, b;
67      int bit0, bit1, bit2;
68      int r, g, b;
5469
5570      /* red component */
56      bit0 = (*color_prom >> 0) & 0x01;
57      bit1 = (*color_prom >> 1) & 0x01;
58      bit2 = (*color_prom >> 2) & 0x01;
59      r = 0x21 * bit0 + 0x47 * bit1 + 0x97 * bit2;
71      bit0 = (color_prom[i] >> 0) & 0x01;
72      bit1 = (color_prom[i] >> 1) & 0x01;
73      bit2 = (color_prom[i] >> 2) & 0x01;
74      r = combine_3_weights(rweights, bit0, bit1, bit2);
75
6076      /* green component */
61      bit0 = (*color_prom >> 3) & 0x01;
62      bit1 = (*color_prom >> 4) & 0x01;
63      bit2 = (*color_prom >> 5) & 0x01;
64      g = 0x21 * bit0 + 0x47 * bit1 + 0x97 * bit2;
77      bit0 = (color_prom[i] >> 3) & 0x01;
78      bit1 = (color_prom[i] >> 4) & 0x01;
79      bit2 = (color_prom[i] >> 5) & 0x01;
80      g = combine_3_weights(gweights, bit0, bit1, bit2);
81
6582      /* blue component */
66      bit0 = 0;
67      bit1 = (*color_prom >> 6) & 0x01;
68      bit2 = (*color_prom >> 7) & 0x01;
69      b = 0x21 * bit0 + 0x47 * bit1 + 0x97 * bit2;
83      bit0 = (color_prom[i] >> 6) & 0x01;
84      bit1 = (color_prom[i] >> 7) & 0x01;
85      b = combine_2_weights(bweights, bit0, bit1);
7086
71      palette_set_color(machine,i,MAKE_RGB(r,g,b));
72      color_prom++;
87      colortable_palette_set_color(machine->colortable, i, MAKE_RGB(r, g, b));
7388   }
7489
75   /* color_prom now points to the beginning of the char lookup table */
90   /* color_prom now points to the beginning of the lookup table */
91   color_prom += 0x20;
7692
77   /* fg chars */
78   for (i = 0; i < 256; i++)
79      colortable[i + 0x000] = 16 + (color_prom[(i & 0xc0) | ((i & 3) << 4) | ((i >> 2) & 15)] & 15);
80   color_prom += 256;
93   /* fg chars and sprites */
94   for (i = 0; i < 0x200; i++)
95   {
96      UINT8 ctabentry = 0x10 | (color_prom[(i & 0xc0) | ((i & 3) << 4) | ((i >> 2) & 0x0f)] & 0x0f);
97      colortable_entry_set_value(machine->colortable, i, ctabentry);
98   }
8199
82   /* color_prom now points to the beginning of the sprite lookup table */
83
84   /* sprites */
85   for (i = 0; i < 256; i++)
86      colortable[i + 0x100] = 16 + (color_prom[(i & 0xc0) | ((i & 3) << 4) | ((i >> 2) & 15)] & 15);
87   color_prom += 256;
88
89100   /* bg chars (this is not the full story... there are four layers mixed */
90101   /* using another PROM */
91   for (i = 0; i < 256; i++)
92      colortable[i + 0x200] = *color_prom++ & 15;
93}
102   for (i = 0x200; i < 0x300; i++)
103   {
104      UINT8 ctabentry = color_prom[i] & 0x0f;
105      colortable_entry_set_value(machine->colortable, i, ctabentry);
106   }
107 }
94108
95109
96110
r1679r1680
102116
103117VIDEO_START( exerion )
104118{
105   UINT16 *dst;
106   UINT8 *src;
107   int i, x, y;
119   int i;
108120
109121   /* get pointers to the mixing and lookup PROMs */
110122   background_mixer = memory_region(REGION_PROMS) + 0x320;
r1679r1680
132144     */
133145   for (i = 0; i < 4; i++)
134146   {
135      src = memory_region(REGION_GFX3) + i * 0x2000;
136      dst = background_gfx[i];
147      int y;
137148
138      for (y = 0; y < 256; y++)
149      UINT8 *src = memory_region(REGION_GFX3) + i * 0x2000;
150      UINT16 *dst = background_gfx[i];
151
152      for (y = 0; y < 0x100; y++)
139153      {
140         for (x = 0; x < 128; x += 4)
154         int x;
155
156         for (x = 0; x < 0x80; x += 4)
141157         {
142158            UINT8 data = *src++;
143159            UINT16 val;
r1679r1680
158174            if (val) val |= 0x100 >> i;
159175            *dst++ = val << (2 * i);
160176         }
161         for (x = 0; x < 128; x++)
177
178         for (; x < 0x100; x++)
162179            *dst++ = 0;
163180      }
164181   }
r1679r1680
207224   UINT8 snmi = 1;
208225
209226   if (((hcounter & 0x180) == 0x180) && !video_screen_get_vblank(0))
210   {
211227      snmi = !((hcounter >> 6) & 0x01);
212   }
213228
214229   return (video_screen_get_vblank(0) << 1) | snmi;
215230}
r1679r1680
325340      }
326341
327342      /* draw the scanline */
328      pens = &machine->remapped_colortable[0x200 + (background_latches[12] >> 4) * 16];
343      pens = &machine->pens[0x200 + ((background_latches[12] >> 4) << 4)];
329344      draw_scanline8(bitmap, cliprect->min_x, y, cliprect->max_x - cliprect->min_x + 1, &scanline[cliprect->min_x], pens, -1);
330345   }
331346}
r1679r1680
378393            code &= ~0x10, code2 |= 0x10;
379394
380395         drawgfx(bitmap, gfx, code2, color, xflip, yflip, x, y + gfx->height,
381                 cliprect, TRANSPARENCY_COLOR, 16);
396                 cliprect, TRANSPARENCY_PENS,
397                 colortable_get_transpen_mask(machine->colortable, gfx, color, 0x10));
382398      }
383399
384400      drawgfx(bitmap, gfx, code, color, xflip, yflip, x, y,
385              cliprect, TRANSPARENCY_COLOR, 16);
401             cliprect, TRANSPARENCY_PENS,
402             colortable_get_transpen_mask(machine->colortable, gfx, color, 0x10));
386403
387404      if (doubled) i += 4;
388405   }
src/mame/video/wrally.c
r1679r1680
7979
8080VIDEO_START( wrally )
8181{
82   pant[0] = tilemap_create(get_tile_info_wrally_screen0,tilemap_scan_rows,TILEMAP_TYPE_PEN,16,16,64,32);
83   pant[1] = tilemap_create(get_tile_info_wrally_screen1,tilemap_scan_rows,TILEMAP_TYPE_PEN,16,16,64,32);
82   pant[0] = tilemap_create(get_tile_info_wrally_screen0,tilemap_scan_rows,16,16,64,32);
83   pant[1] = tilemap_create(get_tile_info_wrally_screen1,tilemap_scan_rows,16,16,64,32);
8484
8585   tilemap_set_transparent_pen(pant[0],0);
8686   tilemap_set_transparent_pen(pant[1],0);
src/mame/video/mosaic.c
r1679r1680
5252
5353VIDEO_START( mosaic )
5454{
55   fg_tilemap = tilemap_create(get_fg_tile_info,tilemap_scan_rows,TILEMAP_TYPE_PEN,8,8,64,32);
56   bg_tilemap = tilemap_create(get_bg_tile_info,tilemap_scan_rows,TILEMAP_TYPE_PEN,     8,8,64,32);
55   fg_tilemap = tilemap_create(get_fg_tile_info,tilemap_scan_rows,8,8,64,32);
56   bg_tilemap = tilemap_create(get_bg_tile_info,tilemap_scan_rows,     8,8,64,32);
5757
5858   tilemap_set_transparent_pen(fg_tilemap,0xff);
5959}
src/mame/video/crospang.c
r1679r1680
191191
192192VIDEO_START( crospang )
193193{
194   bg_layer = tilemap_create(get_bg_tile_info,tilemap_scan_rows,TILEMAP_TYPE_PEN,16,16,32,32);
195   fg_layer = tilemap_create(get_fg_tile_info,tilemap_scan_rows,TILEMAP_TYPE_PEN,16,16,32,32);
194   bg_layer = tilemap_create(get_bg_tile_info,tilemap_scan_rows,16,16,32,32);
195   fg_layer = tilemap_create(get_fg_tile_info,tilemap_scan_rows,16,16,32,32);
196196
197197   tilemap_set_transparent_pen(fg_layer,0);
198198   bestri_tilebank = 0;
src/mame/video/darkmist.c
r1679r1680
11#include "driver.h"
2#include "deprecat.h"
32
43/*defined in drivers/darkmist.c */
5
6extern UINT8 * darkmist_scroll;
74extern int darkmist_hw;
85
9static int spritebank;
106
7UINT8 *darkmist_scroll;
8UINT8 *darkmist_spritebank;
9
1110/* vis. flags */
1211
1312#define DISPLAY_SPR      1
r1679r1680
7776{
7877   int i;
7978
80   /* black color */
81   palette_set_color(machine, 0x100, MAKE_RGB(0,0,0));
79   /* allocate the colortable */
80   machine->colortable = colortable_alloc(machine, 0x101);
8281
83   /* color lookup tables */
84
85   for (i = 0;i < 256;i++)
82   for (i = 0; i < 0x400; i++)
8683   {
87      if (*color_prom & 0x40)
88         *(colortable++) = 0x100;
89      else
90         *(colortable++) = (*color_prom & 0x3f) + 0x80;
91      color_prom++;
92   }
84      int ctabentry;
9385
94   for (i = 0;i < 256;i++)
95   {
96      if (*color_prom & 0x40)
97         *(colortable++) = 0x100;
86      if (color_prom[i] & 0x40)
87         ctabentry = 0x100;
9888      else
99         *(colortable++) = (*color_prom & 0x3f) + 0x00;
100      color_prom++;
101   }
89      {
90         ctabentry = (color_prom[i] & 0x3f);
10291
103   for (i = 0;i < 256;i++)
104   {
105      if (*color_prom & 0x40)
106         *(colortable++) = 0x100;
107      else
108         *(colortable++) = (*color_prom & 0x3f) + 0x40;
109      color_prom++;
110   }
92         switch (i & 0x300)
93         {
94         case 0x000:  ctabentry = ctabentry | 0x80; break;
95         case 0x100:  ctabentry = ctabentry | 0x00; break;
96         case 0x200:  ctabentry = ctabentry | 0x40; break;
97         case 0x300:  ctabentry = ctabentry | 0xc0; break;
98         }
99      }
111100
112   for (i = 0;i < 256;i++)
113   {
114      if (*color_prom & 0x40)
115         *(colortable++) = 0x100;
116      else
117         *(colortable++) = (*color_prom & 0x3f) + 0xc0;
118      color_prom++;
101      colortable_entry_set_value(machine->colortable, i, ctabentry);
119102   }
120103}
121104
122WRITE8_HANDLER(darkmist_palette_w)
123{
124   paletteram[offset]=data;
125   offset&=0xff;
126   palette_set_color_rgb(Machine, offset, pal4bit(paletteram[offset+0x200]), pal4bit(paletteram[offset] >> 4), pal4bit(paletteram[offset]));
127}
128105
129READ8_HANDLER(darkmist_palette_r)
106static void set_pens(running_machine *machine)
130107{
131   return paletteram[offset];
132}
108   int i;
133109
134WRITE8_HANDLER(darkmist_spritebank_w)
135{
136   spritebank=data<<8;
110   for (i = 0; i < 0x100; i++)
111   {
112      int r = pal4bit(paletteram[i | 0x200] >> 0);
113      int g = pal4bit(paletteram[i | 0x000] >> 4);
114      int b = pal4bit(paletteram[i | 0x000] >> 0);
115
116      colortable_palette_set_color(machine->colortable, i, MAKE_RGB(r, g, b));
117   }
118
119   colortable_palette_set_color(machine->colortable, 0x100, RGB_BLACK);
137120}
138121
122
139123VIDEO_START(darkmist)
140124{
141   bgtilemap = tilemap_create( get_bgtile_info,tilemap_scan_rows,TILEMAP_TYPE_PEN,16,16,512,64 );
142   fgtilemap = tilemap_create( get_fgtile_info,tilemap_scan_rows,TILEMAP_TYPE_PEN,16,16,64,256 );
143   txtilemap = tilemap_create( get_txttile_info,tilemap_scan_rows,TILEMAP_TYPE_PEN,8,8,32,32 );
125   bgtilemap = tilemap_create( get_bgtile_info,tilemap_scan_rows,16,16,512,64 );
126   fgtilemap = tilemap_create( get_fgtile_info,tilemap_scan_rows,16,16,64,256 );
127   txtilemap = tilemap_create( get_txttile_info,tilemap_scan_rows,8,8,32,32 );
144128   tilemap_set_transparent_pen(fgtilemap, 0);
145129   tilemap_set_transparent_pen(txtilemap, 0);
146130}
r1679r1680
150134
151135#define DM_GETSCROLL(n) (((darkmist_scroll[(n)]<<1)&0xff) + ((darkmist_scroll[(n)]&0x80)?1:0) +( ((darkmist_scroll[(n)-1]<<4) | (darkmist_scroll[(n)-1]<<12) )&0xff00))
152136
137   set_pens(machine);
138
153139   tilemap_set_scrollx(bgtilemap, 0, DM_GETSCROLL(0x2));
154140   tilemap_set_scrolly(bgtilemap, 0, DM_GETSCROLL(0x6));
155141   tilemap_set_scrollx(fgtilemap, 0, DM_GETSCROLL(0xa));
r1679r1680
158144   fillbitmap(bitmap, get_black_pen(machine), cliprect);
159145
160146   if(darkmist_hw & DISPLAY_BG)
161   {
162147      tilemap_draw(bitmap,cliprect,bgtilemap, 0,0);
163   }
164148
165
166149   if(darkmist_hw & DISPLAY_FG)
167   {
168150      tilemap_draw(bitmap,cliprect,fgtilemap, 0,0);
169   }
170151
171152   if(darkmist_hw & DISPLAY_SPR)
172153   {
r1679r1680
190171      tile=spriteram[i+0];
191172
192173      if(spriteram[i+1]&0x20)
193      {
194         tile+=spritebank;
195      }
174         tile += (*darkmist_spritebank << 8);
196175
197176      palette=((spriteram[i+1])>>1)&0xf;
198177
r1679r1680
222201
223202   return 0;
224203}
225
226
src/mame/video/exctsccr.c
r1679r1680
1919***************************************************************************/
2020PALETTE_INIT( exctsccr )
2121{
22   int i,idx;
23   #define COLOR(gfxn,offs) (colortable[machine->drv->gfxdecodeinfo[gfxn].color_codes_start + offs])
22   int i;
2423
25   for (i = 0;i < machine->drv->total_colors;i++)
24   /* allocate the colortable */
25   machine->colortable = colortable_alloc(machine, 0x20);
26
27   /* create a lookup table for the palette */
28   for (i = 0; i < 0x20; i++)
2629   {
27      int bit0,bit1,bit2,r,g,b;
30      int bit0, bit1, bit2;
31      int r, g, b;
2832
33      /* red component */
2934      bit0 = (color_prom[i] >> 0) & 0x01;
3035      bit1 = (color_prom[i] >> 1) & 0x01;
3136      bit2 = (color_prom[i] >> 2) & 0x01;
3237      r = 0x21 * bit0 + 0x47 * bit1 + 0x97 * bit2;
38
39      /* green component */
3340      bit0 = (color_prom[i] >> 3) & 0x01;
3441      bit1 = (color_prom[i] >> 4) & 0x01;
3542      bit2 = (color_prom[i] >> 5) & 0x01;
3643      g = 0x21 * bit0 + 0x47 * bit1 + 0x97 * bit2;
44
45      /* blue component */
3746      bit0 = 0;
3847      bit1 = (color_prom[i] >> 6) & 0x01;
3948      bit2 = (color_prom[i] >> 7) & 0x01;
4049      b = 0x21 * bit0 + 0x47 * bit1 + 0x97 * bit2;
4150
42      palette_set_color(machine,i,MAKE_RGB(r,g,b));
51      colortable_palette_set_color(machine->colortable, i, MAKE_RGB(r, g, b));
4352   }
4453
45   color_prom += machine->drv->total_colors;
54   /* color_prom now points to the beginning of the lookup table */
55   color_prom += 0x20;
4656
4757   /* characters */
48   idx = 0;
49   for (i = 0;i < 32;i++)
58   for (i = 0; i < 0x80; i++)
5059   {
51      COLOR(0,idx++) = color_prom[256+0+(i*4)];
52      COLOR(0,idx++) = color_prom[256+1+(i*4)];
53      COLOR(0,idx++) = color_prom[256+2+(i*4)];
54      COLOR(0,idx++) = color_prom[256+3+(i*4)];
55      COLOR(0,idx++) = color_prom[256+128+0+(i*4)];
56      COLOR(0,idx++) = color_prom[256+128+1+(i*4)];
57      COLOR(0,idx++) = color_prom[256+128+2+(i*4)];
58      COLOR(0,idx++) = color_prom[256+128+3+(i*4)];
60      int swapped_i = BITSWAP8(i,2,7,6,5,4,3,1,0);
61      UINT8 ctabentry = color_prom[0x100 + swapped_i];
62      colortable_entry_set_value(machine->colortable, i, ctabentry);
5963   }
6064
6165   /* sprites */
62
63   idx=0;
64
65   for (i = 0;i < 15*16;i++)
66   for (i = 0; i < 0xf0; i++)
6667   {
67      if ( (i%16) < 8 )
68      if ((i & 0x08) == 0)
6869      {
69         COLOR(2,idx) = color_prom[i]+16;
70         idx++;
70         int swapped_i = BITSWAP8(i,3,7,6,5,4,2,1,0);
71         UINT8 ctabentry = color_prom[i] | 0x10;
72         colortable_entry_set_value(machine->colortable, swapped_i + 0x80, ctabentry);
7173      }
7274   }
73   for (i = 15*16;i < 16*16;i++)
75
76   for (i = 0xf0; i < 0x100; i++)
7477   {
75      if ( (i%16) > 7 )
78      if (i & 0x08)
7679      {
77         COLOR(2,idx) = color_prom[i]+16;
78         idx++;
80         int swapped_i = BITSWAP8(i,3,7,6,5,4,2,1,0);
81         UINT8 ctabentry = color_prom[i] | 0x10;
82         colortable_entry_set_value(machine->colortable, swapped_i + 0x80, ctabentry);
7983      }
8084   }
81   for (i = 16;i < 32;i++)
85
86   for (i = 0x80; i < 0x100; i++)
8287   {
83      COLOR(2,idx++) = color_prom[256+0+(i*4)]+16;
84      COLOR(2,idx++) = color_prom[256+1+(i*4)]+16;
85      COLOR(2,idx++) = color_prom[256+2+(i*4)]+16;
86      COLOR(2,idx++) = color_prom[256+3+(i*4)]+16;
87      COLOR(2,idx++) = color_prom[256+128+0+(i*4)]+16;
88      COLOR(2,idx++) = color_prom[256+128+1+(i*4)]+16;
89      COLOR(2,idx++) = color_prom[256+128+2+(i*4)]+16;
90      COLOR(2,idx++) = color_prom[256+128+3+(i*4)]+16;
88      int swapped_i = BITSWAP8(i,2,7,6,5,4,3,1,0);
89      UINT8 ctabentry = color_prom[0x100 + swapped_i] | 0x10;
90      colortable_entry_set_value(machine->colortable, i + 0x80, ctabentry);
9191   }
9292
93   /* Patch for goalkeeper */
94   COLOR(2,29*8+7) = 16;
95
93   /* patch for goalkeeper - but of course, this is totally wrong */
94   colortable_entry_set_value(machine->colortable, 0x80+(0x1d*8)+7, 0x10);
9695}
9796
9897static TIMER_CALLBACK( exctsccr_fm_callback )
r1679r1680
133132static TILE_GET_INFO( get_bg_tile_info )
134133{
135134   int code = videoram[tile_index];
136   int color = colorram[tile_index] & 0x1f;
137135
136   /* ZV 02052008 - this used to be "& 0x1f," but that's not supported by the
137       color PROM decoding, so I am using 0x0f.  I don't see any glitches */
138   int color = colorram[tile_index] & 0x0f;
139
138140   SET_TILE_INFO(gfx_bank, code, color, 0);
139141}
140142
141143VIDEO_START( exctsccr )
142144{
143145   bg_tilemap = tilemap_create(get_bg_tile_info, tilemap_scan_rows,
144      TILEMAP_TYPE_PEN, 8, 8, 32, 32);
146      8, 8, 32, 32);
145147
146148   timer_pulse(ATTOTIME_IN_HZ(75), NULL, 0, exctsccr_fm_callback); /* updates fm */
147149}
r1679r1680
209211
210212         color += 6;
211213      }
214
212215      if ( color==0x1d && gfx_bank==1 )
213216      {
214217         drawgfx(bitmap,machine->gfx[3],
r1679r1680
218221            sx,sy,
219222            cliprect,
220223            TRANSPARENCY_PEN,0);
224
221225         drawgfx(bitmap,machine->gfx[4],
222226            code,
223227            color,
224228            flipx, flipy,
225229            sx,sy,
226230            cliprect,
227            TRANSPARENCY_COLOR, 16);
231            TRANSPARENCY_PENS,
232            colortable_get_transpen_mask(machine->colortable, machine->gfx[4], color, 0x10));
228233
229      } else
234      }
235      else
230236      {
231      drawgfx(bitmap,machine->gfx[bank],
232            code,
233            color,
234            flipx, flipy,
235            sx,sy,
236            cliprect,
237            TRANSPARENCY_PEN,0);
237         drawgfx(bitmap,machine->gfx[bank],
238               code,
239               color,
240               flipx, flipy,
241               sx,sy,
242               cliprect,
243               TRANSPARENCY_PEN,0);
238244      }
239245   }
240246}
src/mame/video/shisen.c
r1679r1680
5656VIDEO_START( sichuan2 )
5757{
5858   bg_tilemap = tilemap_create(get_bg_tile_info, tilemap_scan_rows,
59      TILEMAP_TYPE_PEN, 8, 8, 64, 32);
59      8, 8, 64, 32);
6060}
6161
6262VIDEO_UPDATE( sichuan2 )
src/mame/video/nmk16.c
r1679r1680
9999
100100VIDEO_START( bioship )
101101{
102   bg_tilemap = tilemap_create(macross_get_bg_tile_info,bg_scan,TILEMAP_TYPE_PEN,16,16,256,32);
103   tx_tilemap = tilemap_create(macross_get_tx_tile_info,tilemap_scan_cols,TILEMAP_TYPE_PEN,8,8,32,32);
102   bg_tilemap = tilemap_create(macross_get_bg_tile_info,bg_scan,16,16,256,32);
103   tx_tilemap = tilemap_create(macross_get_tx_tile_info,tilemap_scan_cols,8,8,32,32);
104104   spriteram_old = auto_malloc(0x1000);
105105   spriteram_old2 = auto_malloc(0x1000);
106106   background_bitmap = auto_bitmap_alloc(8192,512,machine->screen[0].format);
r1679r1680
118118
119119VIDEO_START( strahl )
120120{
121   bg_tilemap = tilemap_create(macross_get_bg_tile_info,bg_scan,TILEMAP_TYPE_PEN,16,16,256,32);
122   fg_tilemap = tilemap_create(strahl_get_fg_tile_info, bg_scan,TILEMAP_TYPE_PEN,16,16,256,32);
123   tx_tilemap = tilemap_create(macross_get_tx_tile_info,tilemap_scan_cols,TILEMAP_TYPE_PEN,8,8,32,32);
121   bg_tilemap = tilemap_create(macross_get_bg_tile_info,bg_scan,16,16,256,32);
122   fg_tilemap = tilemap_create(strahl_get_fg_tile_info, bg_scan,16,16,256,32);
123   tx_tilemap = tilemap_create(macross_get_tx_tile_info,tilemap_scan_cols,8,8,32,32);
124124   spriteram_old = auto_malloc(0x1000);
125125   spriteram_old2 = auto_malloc(0x1000);
126126
r1679r1680
136136
137137VIDEO_START( macross )
138138{
139   bg_tilemap = tilemap_create(macross_get_bg_tile_info,bg_scan,TILEMAP_TYPE_PEN,16,16,256,32);
140   tx_tilemap = tilemap_create(macross_get_tx_tile_info,tilemap_scan_cols,TILEMAP_TYPE_PEN,8,8,32,32);
139   bg_tilemap = tilemap_create(macross_get_bg_tile_info,bg_scan,16,16,256,32);
140   tx_tilemap = tilemap_create(macross_get_tx_tile_info,tilemap_scan_cols,8,8,32,32);
141141   spriteram_old = auto_malloc(0x1000);
142142   spriteram_old2 = auto_malloc(0x1000);
143143
r1679r1680
152152
153153VIDEO_START( gunnail )
154154{
155   bg_tilemap = tilemap_create(macross_get_bg_tile_info,bg_scan,TILEMAP_TYPE_PEN,16,16,256,32);
156   tx_tilemap = tilemap_create(macross_get_tx_tile_info,tilemap_scan_cols,TILEMAP_TYPE_PEN,8,8,64,32);
155   bg_tilemap = tilemap_create(macross_get_bg_tile_info,bg_scan,16,16,256,32);
156   tx_tilemap = tilemap_create(macross_get_tx_tile_info,tilemap_scan_cols,8,8,64,32);
157157   spriteram_old = auto_malloc(0x1000);
158158   spriteram_old2 = auto_malloc(0x1000);
159159
r1679r1680
170170
171171VIDEO_START( macross2 )
172172{
173   bg_tilemap = tilemap_create(macross_get_bg_tile_info,bg_scan,TILEMAP_TYPE_PEN,16,16,1024,128);
174   tx_tilemap = tilemap_create(macross_get_tx_tile_info,tilemap_scan_cols,TILEMAP_TYPE_PEN,8,8,64,32);
173   bg_tilemap = tilemap_create(macross_get_bg_tile_info,bg_scan,16,16,1024,128);
174   tx_tilemap = tilemap_create(macross_get_tx_tile_info,tilemap_scan_cols,8,8,64,32);
175175   spriteram_old = auto_malloc(0x1000);
176176   spriteram_old2 = auto_malloc(0x1000);
177177
r1679r1680
187187
188188VIDEO_START( tdragon2 )
189189{
190   bg_tilemap = tilemap_create(macross_get_bg_tile_info,bg_scan_td2,TILEMAP_TYPE_PEN,16,16,1024,32);
191   tx_tilemap = tilemap_create(macross_get_tx_tile_info,tilemap_scan_cols,TILEMAP_TYPE_PEN,8,8,64,32);
190   bg_tilemap = tilemap_create(macross_get_bg_tile_info,bg_scan_td2,16,16,1024,32);
191   tx_tilemap = tilemap_create(macross_get_tx_tile_info,tilemap_scan_cols,8,8,64,32);
192192   spriteram_old = auto_malloc(0x1000);
193193   spriteram_old2 = auto_malloc(0x1000);
194194
r1679r1680
204204
205205VIDEO_START( bjtwin )
206206{
207   bg_tilemap = tilemap_create(bjtwin_get_bg_tile_info,tilemap_scan_cols,TILEMAP_TYPE_PEN,8,8,64,32);
207   bg_tilemap = tilemap_create(bjtwin_get_bg_tile_info,tilemap_scan_cols,8,8,64,32);
208208   spriteram_old = auto_malloc(0x1000);
209209   spriteram_old2 = auto_malloc(0x1000);
210210
r1679r1680
997997
998998
999999   tilemap_0 = tilemap_create(   get_tile_info_0, afega_tilemap_scan_pages,
1000                        TILEMAP_TYPE_PEN,
1000
10011001                        16,16,
10021002                        TILES_PER_PAGE_X*PAGES_PER_TMAP_X,TILES_PER_PAGE_Y*PAGES_PER_TMAP_Y);
10031003
10041004   tilemap_1 = tilemap_create(   get_tile_info_1, tilemap_scan_cols,
1005                        TILEMAP_TYPE_PEN,
1005
10061006                        8,8,
10071007                        32,32);
10081008
r1679r1680
10201020
10211021
10221022   tilemap_0 = tilemap_create(   get_tile_info_0, firehawk_tilemap_scan_pages,
1023                        TILEMAP_TYPE_PEN,
1023
10241024                        16,16,
10251025                        TILES_PER_PAGE_X*FIREHAWK_PAGES_PER_TMAP_X,TILES_PER_PAGE_Y*FIREHAWK_PAGES_PER_TMAP_Y);
10261026
10271027   tilemap_1 = tilemap_create(   get_tile_info_1, tilemap_scan_cols,
1028                        TILEMAP_TYPE_PEN,
1028
10291029                        8,8,
10301030                        32,32);
10311031
src/mame/video/nitedrvr.c
r1679r1680
3737VIDEO_START( nitedrvr )
3838{
3939   bg_tilemap = tilemap_create(get_bg_tile_info, tilemap_scan_rows,
40      TILEMAP_TYPE_PEN, 8, 8, 32, 32);
40      8, 8, 32, 32);
4141}
4242
4343static void draw_box(running_machine *machine, mame_bitmap *bitmap, int bx, int by, int ex, int ey )
src/mame/video/m10.c
r0r1680
1/***************************************************************************
2
3  video.c
4
5  Functions to emulate the video hardware of the machine.
6
7  (c) 12/2/1998 Lee Taylor
8
9  2006 - major rewrite by couriersud
10
11***************************************************************************/
12
13#include "driver.h"
14#include "deprecat.h"
15#include "m10.h"
16
17static tilemap *      tx_tilemap;
18static gfx_element *   back_gfx;
19static UINT32         extyoffs[32*8];
20static UINT32         extxoffs[8] = { 0, 1, 2, 3, 4, 5, 6, 7 };
21
22static const gfx_layout backlayout =
23{
24   8,8*32,   /* 8*8 characters */
25   4,   /* 256 characters */
26   1,   /* 1 bits per pixel */
27   { 0 },
28   { 0, 1, 2, 3, 4, 5, 6, 7 },
29   { 0*8*32, 1*8*32, 2*8*32, 3*8*32, 4*8*32, 5*8*32, 6*8*32, 7*8*32 },
30   32*8*8,   /* every char takes 8 consecutive bytes */
31   extxoffs, extyoffs
32};
33
34static const gfx_layout charlayout =
35{
36   8,8,   /* 8*8 characters */
37   256,   /* 256 characters */
38   1,   /* 1 bits per pixel */
39   { 0 },
40   { 0, 1, 2, 3, 4, 5, 6, 7 },
41   { 0*8, 1*8, 2*8, 3*8, 4*8, 5*8, 6*8, 7*8 },
42   8*8   /* every char takes 8 consecutive bytes */
43};
44
45static UINT32 tilemap_scan(UINT32 col,UINT32 row,UINT32 num_cols,UINT32 num_rows)
46{
47   //m10_state *state = Machine->driver_data;
48
49   return (31-col)*32 + row;
50}
51
52
53static void get_tile_info(running_machine *machine, tile_data *tileinfo, tilemap_memory_index tile_index, void *param)
54{
55   SET_TILE_INFO(0, videoram[tile_index], colorram[tile_index] & 0x07, 0);
56}
57
58
59WRITE8_HANDLER( m10_colorram_w )
60{
61   if (colorram[offset] != data)
62   {
63      tilemap_mark_tile_dirty(tx_tilemap, offset);
64      colorram[offset] = data;
65   }
66}
67
68
69WRITE8_HANDLER( m15_chargen_w )
70{
71   m10_state *state = Machine->driver_data;
72
73   if (state->chargen[offset] != data)
74   {
75      state->chargen[offset] = data;
76      /* not very effective ... dirty would be better */
77      decodechar(Machine->gfx[0],offset >> 3,state->chargen);
78   }
79}
80
81
82INLINE void plot_pixel_m10(mame_bitmap *bm, int x, int y, int col)
83{
84   m10_state *state = Machine->driver_data;
85
86   if (!state->flip)
87      *BITMAP_ADDR16(bm, y, x) = col;
88   else
89      *BITMAP_ADDR16(bm, (IREMM10_VBSTART - 1)- (y - IREMM10_VBEND) + 6
90            , (IREMM10_HBSTART - 1)- (x- IREMM10_HBEND)) = col; // only when flip_screen(?)
91}
92
93VIDEO_START( m10 )
94{
95   //m10_state *state = machine->driver_data;
96   int i;
97
98   for (i=0;i<32*8;i++)
99      extyoffs[i] = i*8;
100
101   tx_tilemap = tilemap_create(get_tile_info,tilemap_scan,8,8,32,32);
102   tilemap_set_transparent_pen(tx_tilemap, 0);
103   tilemap_set_scrolldx(tx_tilemap, 0, 62);
104   tilemap_set_scrolldy(tx_tilemap, 0, 0);
105
106   back_gfx = allocgfx(&backlayout);
107   back_gfx->total_colors = 8;
108
109   machine->gfx[1] = back_gfx;
110   return ;
111}
112
113VIDEO_START( m15 )
114{
115   m10_state *state = machine->driver_data;
116
117   machine->gfx[0] = allocgfx(&charlayout);
118   machine->gfx[0]->total_colors = 8;
119
120   decodegfx(machine->gfx[0], state->chargen,0,256);
121
122   tx_tilemap = tilemap_create(get_tile_info,tilemap_scan,8,8,32,32);
123   tilemap_set_scrolldx(tx_tilemap, 0, 116);
124   tilemap_set_scrolldy(tx_tilemap, 0, 0);
125
126   return ;
127}
128
129/***************************************************************************
130
131  Draw the game screen in the given mame_bitmap.
132
133***************************************************************************/
134VIDEO_UPDATE( m10 )
135{
136   m10_state *state = machine->driver_data;
137   int offs;
138   static const int color[4]= { 3, 3, 5, 5 };
139   static const int xpos[4] = { 4*8, 26*8, 7*8, 6*8};
140   int i;
141
142   fillbitmap(bitmap,machine->pens[0],cliprect);
143
144   decodegfx(back_gfx, state->chargen,0,4);
145   for (i=0;i<4;i++)
146      if (state->flip)
147         drawgfx(bitmap, back_gfx, i, color[i], 1, 1, 31*8 - xpos[i], 6, cliprect, 0, 0);
148      else
149         drawgfx(bitmap, back_gfx, i, color[i], 0, 0, xpos[i], 0, cliprect, 0, 0);
150
151   if (state->bottomline)
152   {
153      int y;
154
155      for (y = IREMM10_VBEND;y < IREMM10_VBSTART;y++)
156         plot_pixel_m10(bitmap,16,y,1);
157   }
158
159   for (offs = videoram_size - 1;offs >= 0;offs--)
160      tilemap_mark_tile_dirty(tx_tilemap, offs);
161
162   tilemap_set_flip(tx_tilemap, state->flip ? TILEMAP_FLIPX | TILEMAP_FLIPY : 0);
163   tilemap_draw(bitmap,cliprect,tx_tilemap,0,0);
164
165   return 0;
166}
167
168
169/***************************************************************************
170
171  Draw the game screen in the given mame_bitmap.
172
173***************************************************************************/
174VIDEO_UPDATE( m15 )
175{
176   m10_state *state = machine->driver_data;
177   int offs;
178
179   for (offs = videoram_size - 1;offs >= 0;offs--)
180      tilemap_mark_tile_dirty(tx_tilemap, offs);
181
182   //tilemap_mark_all_tiles_dirty(tx_tilemap);
183   tilemap_set_flip(tx_tilemap, state->flip ? TILEMAP_FLIPX | TILEMAP_FLIPY : 0);
184   tilemap_draw(bitmap,cliprect,tx_tilemap,0,0);
185
186   return 0;
187}
188
src/mame/drivers/rcasino.c
r1679r1680
103103static VIDEO_START(rcasino)
104104{
105105   bg_tilemap = tilemap_create(get_bg_tile_info, tilemap_scan_rows,
106      TILEMAP_TYPE_PEN, 8, 8, 32, 32);
106      8, 8, 32, 32);
107107}
108108
109109static VIDEO_UPDATE(rcasino)
src/mame/drivers/mitchell.c
r1679r1680
684684static INPUT_PORTS_START( marukin )
685685   PORT_START      /* DSW */
686686   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_UNKNOWN )   /* USED - handled in port5_r */
687   PORT_BIT(0x02, 0x02, IPT_SERVICE ) PORT_NAME( DEF_STR( Service_Mode )) PORT_CODE(KEYCODE_F2)
687   PORT_SERVICE_NO_TOGGLE( 0x02, IP_ACTIVE_LOW )
688688   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_UNKNOWN )   /* unused? */
689689   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_UNKNOWN )   /* USED - handled in port5_r */
690690   PORT_BIT( 0x70, IP_ACTIVE_LOW, IPT_UNKNOWN )   /* unused? */
r1679r1680
804804static INPUT_PORTS_START( pkladies )
805805   PORT_START      /* DSW */
806806   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_UNKNOWN )   /* USED - handled in port5_r */
807   PORT_BIT(0x02, 0x02, IPT_SERVICE ) PORT_NAME( DEF_STR( Service_Mode )) PORT_CODE(KEYCODE_F2)
807   PORT_SERVICE_NO_TOGGLE( 0x02, IP_ACTIVE_LOW )
808808   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_UNKNOWN )   /* unused? */
809809   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_UNKNOWN )   /* USED - handled in port5_r */
810810   PORT_BIT( 0x70, IP_ACTIVE_LOW, IPT_UNKNOWN )   /* unused? */
r1679r1680
926926static INPUT_PORTS_START( pang )
927927   PORT_START      /* DSW */
928928   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_UNKNOWN )   /* USED - handled in port5_r */
929   PORT_BIT(0x02, 0x02, IPT_SERVICE ) PORT_NAME( DEF_STR( Service_Mode )) PORT_CODE(KEYCODE_F2)
929   PORT_SERVICE_NO_TOGGLE( 0x02, IP_ACTIVE_LOW )
930930   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_UNKNOWN )   /* unused? */
931931   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_UNKNOWN )   /* USED - handled in port5_r */
932932   PORT_BIT( 0x70, IP_ACTIVE_LOW, IPT_UNKNOWN )   /* unused? */
r1679r1680
966966static INPUT_PORTS_START( spangbl )
967967   PORT_START      /* DSW */
968968   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_UNKNOWN )   /* USED - handled in port5_r */
969   PORT_BIT(0x02, 0x02, IPT_SERVICE ) PORT_NAME( DEF_STR( Service_Mode )) PORT_CODE(KEYCODE_F2)
969   PORT_SERVICE_NO_TOGGLE( 0x02, IP_ACTIVE_LOW )
970970   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_UNKNOWN )   /* unused? */
971971   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_UNKNOWN )   /* USED - handled in port5_r */
972972   PORT_BIT( 0x70, IP_ACTIVE_LOW, IPT_UNKNOWN )   /* unused? */
r1679r1680
10071007   /* this port may not have the same role */
10081008   PORT_START      /* DSW */
10091009   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_UNKNOWN )   /* USED - handled in port5_r */
1010   PORT_BIT(0x02, 0x02, IPT_SERVICE ) PORT_NAME( DEF_STR( Service_Mode )) PORT_CODE(KEYCODE_F2) // useless, all text removed!
1010   PORT_SERVICE_NO_TOGGLE( 0x02, IP_ACTIVE_LOW )
10111011   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_UNKNOWN )   /* unused? */
10121012   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_UNKNOWN )   /* USED - handled in port5_r */
10131013   PORT_BIT( 0x70, IP_ACTIVE_LOW, IPT_UNKNOWN )   /* unused? */
r1679r1680
11231123static INPUT_PORTS_START( qtono1 )
11241124   PORT_START      /* DSW */
11251125   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_UNKNOWN )   /* USED - handled in port5_r */
1126   PORT_BIT(0x02, 0x02, IPT_SERVICE ) PORT_NAME( DEF_STR( Service_Mode )) PORT_CODE(KEYCODE_F2)
1126   PORT_SERVICE_NO_TOGGLE( 0x02, IP_ACTIVE_LOW )
11271127   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_UNKNOWN )   /* unused? */
11281128   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_UNKNOWN )   /* USED - handled in port5_r */
11291129   PORT_BIT( 0x70, IP_ACTIVE_LOW, IPT_UNKNOWN )   /* unused? */
r1679r1680
11631163static INPUT_PORTS_START( block )
11641164   PORT_START      /* DSW */
11651165   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_UNKNOWN )   /* USED - handled in port5_r */
1166   PORT_BIT(0x02, 0x02, IPT_SERVICE ) PORT_NAME( DEF_STR( Service_Mode )) PORT_CODE(KEYCODE_F2)
1166   PORT_SERVICE_NO_TOGGLE( 0x02, IP_ACTIVE_LOW )
11671167   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_UNKNOWN )   /* unused? */
11681168   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_UNKNOWN )   /* USED - handled in port5_r */
11691169   PORT_BIT( 0x70, IP_ACTIVE_LOW, IPT_UNKNOWN )   /* unused? */
r1679r1680
12051205static INPUT_PORTS_START( blockjoy )
12061206   PORT_START      /* DSW */
12071207   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_UNKNOWN )   /* USED - handled in port5_r */
1208   PORT_BIT(0x02, 0x02, IPT_SERVICE ) PORT_NAME( DEF_STR( Service_Mode )) PORT_CODE(KEYCODE_F2)
1208   PORT_SERVICE_NO_TOGGLE( 0x02, IP_ACTIVE_LOW )
12091209   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_UNKNOWN )   /* unused? */
12101210   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_UNKNOWN )   /* USED - handled in port5_r */
12111211   PORT_BIT( 0x70, IP_ACTIVE_LOW, IPT_UNKNOWN )   /* unused? */
src/mame/drivers/mgolf.c
r1679r1680
3535
3636static VIDEO_START( mgolf )
3737{
38   bg_tilemap = tilemap_create(get_tile_info, tilemap_scan_rows, TILEMAP_TYPE_PEN, 8, 8, 32, 32);
38   bg_tilemap = tilemap_create(get_tile_info, tilemap_scan_rows, 8, 8, 32, 32);
3939}
4040
4141
src/mame/drivers/deco_mlc.c
r1679r1680
222222      return;
223223      break;
224224   case 0x14: /* Prepare scanline interrupt */
225      timer_adjust(raster_irq_timer,video_screen_get_time_until_pos(0, irq_ram[0x14/4], 0),0,attotime_never);
225      timer_adjust_oneshot(raster_irq_timer,video_screen_get_time_until_pos(0, irq_ram[0x14/4], 0),0);
226226      //logerror("prepare scanline to fire at %d (currently on %d)\n", irq_ram[0x14/4], video_screen_get_vpos(0));
227227      return;
228228      break;
src/mame/drivers/rungun.c
r1679r1680
391391   PORT_START
392392   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_SPECIAL )   /* EEPROM data */
393393   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_SPECIAL )   /* EEPROM ready (always 1) */
394   PORT_BIT(0x08, IP_ACTIVE_LOW, IPT_SERVICE ) PORT_NAME( DEF_STR( Service_Mode )) PORT_CODE(KEYCODE_F2)
394   PORT_SERVICE_NO_TOGGLE( 0x08, IP_ACTIVE_LOW )
395395   PORT_DIPNAME( 0x10, 0x00, "Monitors" )
396396   PORT_DIPSETTING(    0x00, "1" )
397397   PORT_DIPSETTING(    0x10, "2" )
src/mame/drivers/crystal.c
r1679r1680
253253      attotime period = attotime_mul(ATTOTIME_IN_HZ(43000000), (PD + 1) * (TCV + 1));
254254
255255      if(Timer0ctrl&2)
256         timer_adjust(Timer0,period,0,period);
256         timer_adjust_periodic(Timer0,period,0,period);
257257      else
258         timer_adjust(Timer0,period,0,attotime_zero);
258         timer_adjust_oneshot(Timer0,period,0);
259259   }
260260   COMBINE_DATA(&Timer0ctrl);
261261}
r1679r1680
281281      attotime period = attotime_mul(ATTOTIME_IN_HZ(43000000), (PD + 1) * (TCV + 1));
282282
283283      if(Timer1ctrl&2)
284         timer_adjust(Timer1,period,0,period);
284         timer_adjust_periodic(Timer1,period,0,period);
285285      else
286         timer_adjust(Timer1,period,0,attotime_zero);
286         timer_adjust_oneshot(Timer1,period,0);
287287   }
288288   COMBINE_DATA(&Timer1ctrl);
289289}
r1679r1680
309309      attotime period = attotime_mul(ATTOTIME_IN_HZ(43000000), (PD + 1) * (TCV + 1));
310310
311311      if(Timer2ctrl&2)
312         timer_adjust(Timer2,period,0,period);
312         timer_adjust_periodic(Timer2,period,0,period);
313313      else
314         timer_adjust(Timer2,period,0,attotime_zero);
314         timer_adjust_oneshot(Timer2,period,0);
315315   }
316316   COMBINE_DATA(&Timer2ctrl);
317317}
r1679r1680
337337      attotime period = attotime_mul(ATTOTIME_IN_HZ(43000000), (PD + 1) * (TCV + 1));
338338
339339      if(Timer3ctrl&2)
340         timer_adjust(Timer3,period,0,period);
340         timer_adjust_periodic(Timer3,period,0,period);
341341      else
342         timer_adjust(Timer3,period,0,attotime_zero);
342         timer_adjust_oneshot(Timer3,period,0);
343343   }
344344   COMBINE_DATA(&Timer3ctrl);
345345}
r1679r1680
595595   Timer3ctrl=0;
596596
597597   Timer0=timer_alloc(Timer0cb, NULL);
598   timer_adjust(Timer0,attotime_never,0,attotime_never);
598   timer_adjust_oneshot(Timer0,attotime_never,0);
599599
600600   Timer1=timer_alloc(Timer1cb, NULL);
601   timer_adjust(Timer1,attotime_never,0,attotime_never);
601   timer_adjust_oneshot(Timer1,attotime_never,0);
602602
603603   Timer2=timer_alloc(Timer2cb, NULL);
604   timer_adjust(Timer2,attotime_never,0,attotime_never);
604   timer_adjust_oneshot(Timer2,attotime_never,0);
605605
606606   Timer3=timer_alloc(Timer3cb, NULL);
607   timer_adjust(Timer3,attotime_never,0,attotime_never);
607   timer_adjust_oneshot(Timer3,attotime_never,0);
608608
609609   VR0_Snd_Set_Areas(textureram,frameram);
610610#ifdef IDLE_LOOP_SPEEDUP
r1679r1680
785785   PORT_BIT(0x10, IP_ACTIVE_LOW, IPT_COIN1 )
786786   PORT_BIT(0x20, IP_ACTIVE_LOW, IPT_COIN2 )
787787   PORT_BIT(0x40, IP_ACTIVE_LOW, IPT_SERVICE1 )
788   PORT_BIT(0x80, IP_ACTIVE_LOW, IPT_SERVICE ) PORT_NAME(DEF_STR( Test )) PORT_CODE(KEYCODE_F2)
788   PORT_SERVICE_NO_TOGGLE( 0x80, IP_ACTIVE_LOW )
789789
790790   PORT_START
791791   PORT_DIPNAME( 0x01, 0x01, DEF_STR( Pause ) )
src/mame/drivers/cshooter.c
r1679r1680
139139
140140static VIDEO_START(cshooter)
141141{
142   cshooter_txtilemap = tilemap_create(get_cstx_tile_info,tilemap_scan_rows,TILEMAP_TYPE_PEN,8,8,32, 32);
142   cshooter_txtilemap = tilemap_create(get_cstx_tile_info,tilemap_scan_rows, 8,8,32, 32);
143143   tilemap_set_transparent_pen(cshooter_txtilemap, 3);
144144}
145145
src/mame/drivers/rocnrope.c
r1679r1680
212212};
213213
214214static GFXDECODE_START( rocnrope )
215   GFXDECODE_ENTRY( REGION_GFX1, 0, charlayout,       0, 16 )
216   GFXDECODE_ENTRY( REGION_GFX2, 0, spritelayout, 16*16, 16 )
215   GFXDECODE_ENTRY( REGION_GFX1, 0, spritelayout,     0, 16 )
216   GFXDECODE_ENTRY( REGION_GFX2, 0, charlayout,   16*16, 16 )
217217GFXDECODE_END
218218
219219
r1679r1680
234234   MDRV_SCREEN_SIZE(32*8, 32*8)
235235   MDRV_SCREEN_VISIBLE_AREA(0*8, 32*8-1, 2*8, 30*8-1)
236236   MDRV_GFXDECODE(rocnrope)
237   MDRV_PALETTE_LENGTH(32)
238   MDRV_COLORTABLE_LENGTH(16*16+16*16)
237   MDRV_PALETTE_LENGTH(16*16+16*16)
239238
240239   MDRV_PALETTE_INIT(rocnrope)
241240   MDRV_VIDEO_START(rocnrope)
r1679r1680
263262   ROM_LOAD( "rnr_7a.snd",   0x0000, 0x1000, CRC(75d2c4e2) SHA1(b701019b4e7b06b268be660ce7958b5367318c27) )
264263   ROM_LOAD( "rnr_8a.snd",   0x1000, 0x1000, CRC(ca4325ae) SHA1(34ac035c0c2ed6bcafde1491d976bb9e9d2a2a7d) )
265264
266   ROM_REGION( 0x4000, REGION_GFX1, ROMREGION_DISPOSE )
267   ROM_LOAD( "rnr_h12.vid",  0x0000, 0x2000, CRC(e2114539) SHA1(0ea19ae4d7c2da14f23c81abb8e2c931785b2715) )
268   ROM_LOAD( "rnr_h11.vid",  0x2000, 0x2000, CRC(169a8f3f) SHA1(182c7c9b9849ebb57b3ff7c0b629f2f8e2efa9ba) )
269
270   ROM_REGION( 0x8000, REGION_GFX2, ROMREGION_DISPOSE )
265   ROM_REGION( 0x8000, REGION_GFX1, ROMREGION_DISPOSE )
271266   ROM_LOAD( "rnr_a11.vid",  0x0000, 0x2000, CRC(afdaba5e) SHA1(27c090cb1c3767c997daeedbe1ba24786f9e78f1) )
272267   ROM_LOAD( "rnr_a12.vid",  0x2000, 0x2000, CRC(054cafeb) SHA1(4c3cd850b347217af3dd5c9bb84bcff7b30689bd) )
273268   ROM_LOAD( "rnr_a9.vid",   0x4000, 0x2000, CRC(9d2166b2) SHA1(42d2b05360e58b1b2b3ad06c98eb46d9da2b1c21) )
274269   ROM_LOAD( "rnr_a10.vid",  0x6000, 0x2000, CRC(aff6e22f) SHA1(476d67821519feddc9f9c8537b46e6eede790035) )
275270
271   ROM_REGION( 0x4000, REGION_GFX2, ROMREGION_DISPOSE )
272   ROM_LOAD( "rnr_h12.vid",  0x0000, 0x2000, CRC(e2114539) SHA1(0ea19ae4d7c2da14f23c81abb8e2c931785b2715) )
273   ROM_LOAD( "rnr_h11.vid",  0x2000, 0x2000, CRC(169a8f3f) SHA1(182c7c9b9849ebb57b3ff7c0b629f2f8e2efa9ba) )
274
276275   ROM_REGION( 0x0220, REGION_PROMS, 0 )
277276   ROM_LOAD( "a17_prom.bin", 0x0000, 0x0020, CRC(22ad2c3e) SHA1(1c2198b286c75aa9e78d000432795b1ce86ad6b9) )
278277   ROM_LOAD( "b16_prom.bin", 0x0020, 0x0100, CRC(750a9677) SHA1(7a5b4aed5f87180850657b8852bb3f3138d58b5b) )
r1679r1680
291290   ROM_LOAD( "rnr_7a.snd",   0x0000, 0x1000, CRC(75d2c4e2) SHA1(b701019b4e7b06b268be660ce7958b5367318c27) )
292291   ROM_LOAD( "rnr_8a.snd",   0x1000, 0x1000, CRC(ca4325ae) SHA1(34ac035c0c2ed6bcafde1491d976bb9e9d2a2a7d) )
293292
294   ROM_REGION( 0x4000, REGION_GFX1, ROMREGION_DISPOSE )
295   ROM_LOAD( "rnr_h12.vid",  0x0000, 0x2000, CRC(e2114539) SHA1(0ea19ae4d7c2da14f23c81abb8e2c931785b2715) )
296   ROM_LOAD( "rnr_h11.vid",  0x2000, 0x2000, CRC(169a8f3f) SHA1(182c7c9b9849ebb57b3ff7c0b629f2f8e2efa9ba) )
297
298   ROM_REGION( 0x8000, REGION_GFX2, ROMREGION_DISPOSE )
293   ROM_REGION( 0x8000, REGION_GFX1, ROMREGION_DISPOSE )
299294   ROM_LOAD( "rnr_a11.vid",  0x0000, 0x2000, CRC(afdaba5e) SHA1(27c090cb1c3767c997daeedbe1ba24786f9e78f1) )
300295   ROM_LOAD( "rnr_a12.vid",  0x2000, 0x2000, CRC(054cafeb) SHA1(4c3cd850b347217af3dd5c9bb84bcff7b30689bd) )
301296   ROM_LOAD( "rnr_a9.vid",   0x4000, 0x2000, CRC(9d2166b2) SHA1(42d2b05360e58b1b2b3ad06c98eb46d9da2b1c21) )
302297   ROM_LOAD( "rnr_a10.vid",  0x6000, 0x2000, CRC(aff6e22f) SHA1(476d67821519feddc9f9c8537b46e6eede790035) )
303298
299   ROM_REGION( 0x4000, REGION_GFX2, ROMREGION_DISPOSE )
300   ROM_LOAD( "rnr_h12.vid",  0x0000, 0x2000, CRC(e2114539) SHA1(0ea19ae4d7c2da14f23c81abb8e2c931785b2715) )
301   ROM_LOAD( "rnr_h11.vid",  0x2000, 0x2000, CRC(169a8f3f) SHA1(182c7c9b9849ebb57b3ff7c0b629f2f8e2efa9ba) )
302
304303   ROM_REGION( 0x0220, REGION_PROMS, 0 )
305304   ROM_LOAD( "a17_prom.bin", 0x0000, 0x0020, CRC(22ad2c3e) SHA1(1c2198b286c75aa9e78d000432795b1ce86ad6b9) )
306305   ROM_LOAD( "b16_prom.bin", 0x0020, 0x0100, CRC(750a9677) SHA1(7a5b4aed5f87180850657b8852bb3f3138d58b5b) )
src/mame/drivers/coinmstr.c
r1679r1680
2424
2525#include "driver.h"
2626#include "machine/6821pia.h"
27#include "video/crtc6845.h"
27#include "video/mc6845.h"
2828#include "sound/ay8910.h"
2929
3030
3131static UINT8 *attr_ram1, *attr_ram2;
32static mc6845_t *mc6845;
3233static tilemap *bg_tilemap;
3334
3435static UINT8 question_adr[4];
r1679r1680
115116   question_adr[offset] = data;
116117}
117118
119static WRITE8_HANDLER( coinmstr_mc6845_address_w )
120{
121   mc6845_address_w(mc6845, data);
122}
123
124static WRITE8_HANDLER( coinmstr_mc6845_register_w )
125{
126   mc6845_register_w(mc6845, data);
127}
128
118129// Common memory map
119130
120131static ADDRESS_MAP_START( coinmstr_map, ADDRESS_SPACE_PROGRAM, 8 )
r1679r1680
138149   AM_RANGE(0x50, 0x53) AM_READNOP
139150   AM_RANGE(0x50, 0x53) AM_WRITENOP
140151   AM_RANGE(0x58, 0x5b) AM_READWRITE(pia_2_r, pia_2_w)
141   AM_RANGE(0x70, 0x70) AM_WRITE(crtc6845_address_w)
142   AM_RANGE(0x71, 0x71) AM_WRITE(crtc6845_register_w)
152   AM_RANGE(0x70, 0x70) AM_WRITE(coinmstr_mc6845_address_w)
153   AM_RANGE(0x71, 0x71) AM_WRITE(coinmstr_mc6845_register_w)
143154   AM_RANGE(0xc0, 0xc3) AM_READNOP
144155   AM_RANGE(0xc0, 0xc3) AM_WRITENOP
145156ADDRESS_MAP_END
r1679r1680
148159   ADDRESS_MAP_FLAGS( AMEF_ABITS(8) )
149160   AM_RANGE(0x00, 0x00) AM_READ(question_r)
150161   AM_RANGE(0x00, 0x03) AM_WRITE(question_w)
151   AM_RANGE(0x40, 0x40) AM_WRITE(crtc6845_address_w)
152   AM_RANGE(0x41, 0x41) AM_WRITE(crtc6845_register_w)
162   AM_RANGE(0x40, 0x40) AM_WRITE(coinmstr_mc6845_address_w)
163   AM_RANGE(0x41, 0x41) AM_WRITE(coinmstr_mc6845_register_w)
153164   AM_RANGE(0x48, 0x48) AM_WRITE(AY8910_control_port_0_w)
154165   AM_RANGE(0x49, 0x49) AM_READWRITE(AY8910_read_port_0_r, AY8910_write_port_0_w)
155166   AM_RANGE(0x50, 0x53) AM_READWRITE(pia_0_r, pia_0_w) //?
r1679r1680
165176   AM_RANGE(0x40, 0x41) AM_READNOP
166177   AM_RANGE(0x40, 0x43) AM_WRITENOP
167178   AM_RANGE(0x43, 0x43) AM_READNOP
168   AM_RANGE(0x48, 0x48) AM_WRITE(crtc6845_address_w)
169   AM_RANGE(0x49, 0x49) AM_WRITE(crtc6845_register_w)
179   AM_RANGE(0x48, 0x48) AM_WRITE(coinmstr_mc6845_address_w)
180   AM_RANGE(0x49, 0x49) AM_WRITE(coinmstr_mc6845_register_w)
170181   AM_RANGE(0x50, 0x51) AM_READNOP
171182   AM_RANGE(0x50, 0x53) AM_WRITENOP
172183   AM_RANGE(0x53, 0x53) AM_READNOP
r1679r1680
533544
534545static VIDEO_START( coinmstr )
535546{
536   bg_tilemap = tilemap_create(get_bg_tile_info,tilemap_scan_rows,TILEMAP_TYPE_PEN, 8, 8, 46, 64);
547   mc6845 = mc6845_config(NULL);
548   bg_tilemap = tilemap_create(get_bg_tile_info,tilemap_scan_rows, 8, 8, 46, 64);
537549}
538550
539551static VIDEO_UPDATE( coinmstr )
src/mame/drivers/ultrsprt.c
r1679r1680
3636            if (p1 == 0)
3737            {
3838               UINT8 p2 = ram[BYTE4_XOR_BE(fb_index + i)];
39               bmp[i] = machine->remapped_colortable[0x000 + p2];
39               bmp[i] = machine->pens[0x000 + p2];
4040            }
4141            else
4242            {
43               bmp[i] = machine->remapped_colortable[0x100 + p1];
43               bmp[i] = machine->pens[0x100 + p1];
4444            }
4545         }
4646      }
r1679r1680
223223   PORT_BIT( 0xfff, 0x800, IPT_AD_STICK_Y ) PORT_MINMAX(0x000,0xfff) PORT_SENSITIVITY(70) PORT_KEYDELTA(10) PORT_REVERSE PORT_PLAYER(2)
224224
225225   PORT_START
226   PORT_BIT( 0x1, IP_ACTIVE_LOW, IPT_SERVICE ) PORT_NAME( DEF_STR( Service_Mode )) PORT_CODE(KEYCODE_F2) /* Test Button */
226   PORT_SERVICE_NO_TOGGLE( 0x1, IP_ACTIVE_LOW )
227227
228228INPUT_PORTS_END
229229
src/mame/drivers/midyunit.c
r1679r1680
248248   PORT_BIT( 0x0002, IP_ACTIVE_LOW, IPT_COIN2 )
249249   PORT_BIT( 0x0004, IP_ACTIVE_LOW, IPT_COIN3 )
250250   PORT_BIT( 0x0008, IP_ACTIVE_LOW, IPT_TILT ) /* Slam Switch */
251   PORT_BIT( 0x0010, IP_ACTIVE_LOW, IPT_SERVICE ) PORT_NAME("Advance") PORT_CODE(KEYCODE_F2)
251   PORT_SERVICE_NO_TOGGLE( 0x0010, IP_ACTIVE_LOW )
252252   PORT_BIT( 0x0020, IP_ACTIVE_LOW, IPT_UNUSED ) /* Video Freeze */
253253   PORT_BIT( 0x0040, IP_ACTIVE_LOW, IPT_OTHER ) PORT_NAME("Vault Switch") PORT_CODE(KEYCODE_9)
254254   PORT_BIT( 0x0080, IP_ACTIVE_LOW, IPT_COIN4 )
r1679r1680
302302   PORT_BIT( 0x0002, IP_ACTIVE_LOW, IPT_COIN2 )
303303   PORT_BIT( 0x0004, IP_ACTIVE_LOW, IPT_START1 )
304304   PORT_BIT( 0x0008, IP_ACTIVE_LOW, IPT_TILT ) /* Slam Switch */
305   PORT_BIT( 0x0010, IP_ACTIVE_LOW, IPT_SERVICE ) PORT_NAME(DEF_STR( Test )) PORT_CODE(KEYCODE_F2) PORT_TOGGLE
305   PORT_SERVICE( 0x0010, IP_ACTIVE_LOW )
306306   PORT_BIT( 0x0020, IP_ACTIVE_LOW, IPT_START2 )
307307   PORT_BIT( 0x0040, IP_ACTIVE_LOW, IPT_SERVICE1 )
308308   PORT_BIT( 0x0080, IP_ACTIVE_LOW, IPT_BILL1 )
r1679r1680
401401   PORT_BIT( 0x0002, IP_ACTIVE_LOW, IPT_COIN2 )
402402   PORT_BIT( 0x0004, IP_ACTIVE_LOW, IPT_START1 )
403403   PORT_BIT( 0x0008, IP_ACTIVE_LOW, IPT_TILT ) /* Slam Switch */
404   PORT_BIT( 0x0010, IP_ACTIVE_LOW, IPT_SERVICE ) PORT_NAME(DEF_STR( Test )) PORT_CODE(KEYCODE_F2)
404   PORT_SERVICE_NO_TOGGLE( 0x0010, IP_ACTIVE_LOW )
405405   PORT_BIT( 0x0020, IP_ACTIVE_LOW, IPT_START2 )
406406   PORT_BIT( 0x0040, IP_ACTIVE_LOW, IPT_SERVICE1 )
407407   PORT_BIT( 0x0080, IP_ACTIVE_LOW, IPT_BILL1 )
r1679r1680
497497   PORT_BIT( 0x0002, IP_ACTIVE_LOW, IPT_COIN2 )
498498   PORT_BIT( 0x0004, IP_ACTIVE_LOW, IPT_START1 )
499499   PORT_BIT( 0x0008, IP_ACTIVE_LOW, IPT_TILT ) /* Slam Switch */
500   PORT_BIT( 0x0010, IP_ACTIVE_LOW, IPT_SERVICE ) PORT_NAME(DEF_STR( Test )) PORT_CODE(KEYCODE_F2) PORT_TOGGLE
500   PORT_SERVICE( 0x0010, IP_ACTIVE_LOW )
501501   PORT_BIT( 0x0020, IP_ACTIVE_LOW, IPT_START2 )
502502   PORT_BIT( 0x0040, IP_ACTIVE_LOW, IPT_SERVICE1 )
503503   PORT_BIT( 0x0080, IP_ACTIVE_LOW, IPT_COIN3 )
r1679r1680
593593   PORT_BIT( 0x0002, IP_ACTIVE_LOW, IPT_COIN2 )
594594   PORT_BIT( 0x0004, IP_ACTIVE_LOW, IPT_START1 )
595595   PORT_BIT( 0x0008, IP_ACTIVE_LOW, IPT_TILT ) /* Slam Switch */
596   PORT_BIT( 0x0010, IP_ACTIVE_LOW, IPT_SERVICE ) PORT_NAME(DEF_STR( Test )) PORT_CODE(KEYCODE_F2) PORT_TOGGLE
596   PORT_SERVICE( 0x0010, IP_ACTIVE_LOW )
597597   PORT_BIT( 0x0020, IP_ACTIVE_LOW, IPT_START2 )
598598   PORT_BIT( 0x0040, IP_ACTIVE_LOW, IPT_SERVICE1 )
599599   PORT_BIT( 0x0080, IP_ACTIVE_LOW, IPT_BILL1 )
r1679r1680
685685   PORT_BIT( 0x0002, IP_ACTIVE_LOW, IPT_COIN2 )
686686   PORT_BIT( 0x0004, IP_ACTIVE_LOW, IPT_START1 )
687687   PORT_BIT( 0x0008, IP_ACTIVE_LOW, IPT_TILT ) /* Slam Switch */
688   PORT_BIT( 0x0010, IP_ACTIVE_LOW, IPT_SERVICE ) PORT_NAME(DEF_STR( Test )) PORT_CODE(KEYCODE_F2) PORT_TOGGLE
688   PORT_SERVICE( 0x0010, IP_ACTIVE_LOW )
689689   PORT_BIT( 0x0020, IP_ACTIVE_LOW, IPT_START2 )
690690   PORT_BIT( 0x0040, IP_ACTIVE_LOW, IPT_SERVICE1 )
691691   PORT_BIT( 0x0080, IP_ACTIVE_LOW, IPT_BILL1 )
r1679r1680
772772   PORT_BIT( 0x0002, IP_ACTIVE_LOW, IPT_COIN2 )
773773   PORT_BIT( 0x0004, IP_ACTIVE_LOW, IPT_START1 )
774774   PORT_BIT( 0x0008, IP_ACTIVE_LOW, IPT_TILT ) /* Slam Switch */
775   PORT_BIT( 0x0010, IP_ACTIVE_LOW, IPT_SERVICE ) PORT_NAME(DEF_STR( Test )) PORT_CODE(KEYCODE_F2) PORT_TOGGLE
775   PORT_SERVICE( 0x0010, IP_ACTIVE_LOW )
776776   PORT_BIT( 0x0020, IP_ACTIVE_LOW, IPT_START2 )
777777   PORT_BIT( 0x0040, IP_ACTIVE_LOW, IPT_SERVICE1 )
778778   PORT_BIT( 0x0080, IP_ACTIVE_LOW, IPT_COIN3 )
r1679r1680
878878   PORT_BIT( 0x0002, IP_ACTIVE_LOW, IPT_COIN2 )
879879   PORT_BIT( 0x0004, IP_ACTIVE_LOW, IPT_START1 )
880880   PORT_BIT( 0x0008, IP_ACTIVE_LOW, IPT_TILT ) /* Slam Switch */
881   PORT_BIT( 0x0010, IP_ACTIVE_LOW, IPT_SERVICE ) PORT_NAME(DEF_STR( Test )) PORT_CODE(KEYCODE_F2) PORT_TOGGLE
881   PORT_SERVICE( 0x0010, IP_ACTIVE_LOW )
882882   PORT_BIT( 0x0020, IP_ACTIVE_LOW, IPT_START2 )
883883   PORT_BIT( 0x0040, IP_ACTIVE_LOW, IPT_SERVICE1 )
884884   PORT_BIT( 0x0080, IP_ACTIVE_LOW, IPT_BILL1 )
src/mame/drivers/hitme.c
r1679r1680
5656
5757static VIDEO_START(hitme)
5858{
59   hitme_tilemap = tilemap_create(get_hitme_tile_info,tilemap_scan_rows,TILEMAP_TYPE_PEN, 8,10, 40,19);
59   hitme_tilemap = tilemap_create(get_hitme_tile_info,tilemap_scan_rows, 8,10, 40,19);
6060}
6161
6262
6363static VIDEO_START(barricad)
6464{
65   hitme_tilemap = tilemap_create(get_hitme_tile_info,tilemap_scan_rows,TILEMAP_TYPE_PEN, 8,8, 32,24);
65   hitme_tilemap = tilemap_create(get_hitme_tile_info,tilemap_scan_rows, 8,8, 32,24);
6666}
6767
6868
src/mame/drivers/murogem.c
r1679r1680
9595*/
9696
9797#include "driver.h"
98#include "video/crtc6845.h"
98#include "video/mc6845.h"
9999
100static mc6845_t *mc6845;
100101static UINT8 *murogem_videoram;
101102
103
104static WRITE8_HANDLER( murogem_mc6845_address_w )
105{
106   mc6845_address_w(mc6845, data);
107}
108
109static WRITE8_HANDLER( murogem_mc6845_register_w )
110{
111   mc6845_register_w(mc6845, data);
112}
113
114
102115static ADDRESS_MAP_START( murogem_map, ADDRESS_SPACE_PROGRAM, 8 )
103116   AM_RANGE(0x0000, 0x007f) AM_RAM
104   AM_RANGE(0x4000, 0x4000) AM_WRITE(crtc6845_address_w)
105   AM_RANGE(0x4001, 0x4001) AM_WRITE(crtc6845_register_w)
117   AM_RANGE(0x4000, 0x4000) AM_WRITE(murogem_mc6845_address_w)
118   AM_RANGE(0x4001, 0x4001) AM_WRITE(murogem_mc6845_register_w)
106119   AM_RANGE(0x5000, 0x5000) AM_READ(input_port_0_r)
107120   AM_RANGE(0x5800, 0x5800) AM_READ(input_port_1_r)
108121   AM_RANGE(0x7000, 0x7000) AM_WRITE(MWA8_NOP) // sound? payout?
r1679r1680
167180
168181static VIDEO_START(murogem)
169182{
183   mc6845 = mc6845_config(NULL);
170184}
171185
172186static VIDEO_UPDATE(murogem)
src/mame/drivers/sslam.c
r1679r1680
288288               OKIM6295_data_0_w(0,0x40);
289289            OKIM6295_data_0_w(0,(0x80 | data));
290290            OKIM6295_data_0_w(0,0x81);
291            timer_adjust(music_timer, ATTOTIME_IN_MSEC(4), 0, ATTOTIME_IN_HZ(250));   /* 250Hz for smooth sequencing */
291            timer_adjust_periodic(music_timer, ATTOTIME_IN_MSEC(4), 0, ATTOTIME_IN_HZ(250));   /* 250Hz for smooth sequencing */
292292         }
293293      }
294294      else {
src/mame/drivers/simpl156.c
r1679r1680
111111   PORT_BIT( 0x0001, IP_ACTIVE_LOW, IPT_COIN1 )
112112   PORT_BIT( 0x0002, IP_ACTIVE_LOW, IPT_COIN2 )
113113   PORT_BIT( 0x0004, IP_ACTIVE_LOW, IPT_SERVICE1 )
114   PORT_BIT( 0x0008, IP_ACTIVE_LOW, IPT_SERVICE ) PORT_NAME( DEF_STR( Service_Mode )) PORT_CODE(KEYCODE_F2)
114   PORT_SERVICE_NO_TOGGLE( 0x0008, IP_ACTIVE_LOW )
115115   PORT_BIT( 0x00f0, IP_ACTIVE_HIGH, IPT_VBLANK ) // all bits? check..
116116   PORT_BIT( 0x0100, IP_ACTIVE_HIGH, IPT_SPECIAL ) // eeprom?..
117117
src/mame/drivers/cliffhgr.c
r1679r1680
252252   if ( phillips_code & 0x800000 )
253253      cpunum_set_input_line(machine, 0, 0, ASSERT_LINE);
254254
255   timer_adjust(irq_timer, video_screen_get_time_until_pos(0, param, 0), param, attotime_zero);
255   timer_adjust_oneshot(irq_timer, video_screen_get_time_until_pos(0, param, 0), param);
256256}
257257
258258static void vdp_interrupt (int state)
r1679r1680
272272{
273273   port_bank = 0;
274274   phillips_code = 0;
275   timer_adjust(irq_timer, video_screen_get_time_until_pos(0, 17, 0), 17, attotime_zero);
275   timer_adjust_oneshot(irq_timer, video_screen_get_time_until_pos(0, 17, 0), 17);
276276}
277277
278278/********************************************************/
src/mame/drivers/cntsteer.c
r1679r1680
8282
8383static VIDEO_START( zerotrgt )
8484{
85   bg_tilemap = tilemap_create(get_bg_tile_info,tilemap_scan_rows,       TILEMAP_TYPE_PEN,     16,16,64,64);
86   fg_tilemap = tilemap_create(get_fg_tile_info,tilemap_scan_rows_flip_x,TILEMAP_TYPE_PEN, 8, 8,32,32);
85   bg_tilemap = tilemap_create(get_bg_tile_info,tilemap_scan_rows,       16,16,64,64);
86   fg_tilemap = tilemap_create(get_fg_tile_info,tilemap_scan_rows_flip_x,8, 8,32,32);
8787
8888   tilemap_set_transparent_pen(fg_tilemap,0);
8989
src/mame/drivers/hornet.c
r1679r1680
324324
325325   if (chip == 0)
326326   {
327      K037122_layer[chip][0] = tilemap_create(K037122_0_tile_info_layer0, tilemap_scan_rows, TILEMAP_TYPE_PEN, 8, 8, 256, 64);
328      K037122_layer[chip][1] = tilemap_create(K037122_0_tile_info_layer1, tilemap_scan_rows, TILEMAP_TYPE_PEN, 8, 8, 128, 64);
327      K037122_layer[chip][0] = tilemap_create(K037122_0_tile_info_layer0, tilemap_scan_rows, 8, 8, 256, 64);
328      K037122_layer[chip][1] = tilemap_create(K037122_0_tile_info_layer1, tilemap_scan_rows, 8, 8, 128, 64);
329329   }
330330   else
331331   {
332      K037122_layer[chip][0] = tilemap_create(K037122_1_tile_info_layer0, tilemap_scan_rows, TILEMAP_TYPE_PEN, 8, 8, 256, 64);
333      K037122_layer[chip][1] = tilemap_create(K037122_1_tile_info_layer1, tilemap_scan_rows, TILEMAP_TYPE_PEN, 8, 8, 128, 64);
332      K037122_layer[chip][0] = tilemap_create(K037122_1_tile_info_layer0, tilemap_scan_rows, 8, 8, 256, 64);
333      K037122_layer[chip][1] = tilemap_create(K037122_1_tile_info_layer1, tilemap_scan_rows, 8, 8, 128, 64);
334334   }
335335
336336   tilemap_set_transparent_pen(K037122_layer[chip][0], 0);
r1679r1680
767767   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_COIN1 )
768768   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_COIN2 )
769769   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_SERVICE ) PORT_NAME("Service Button") PORT_CODE(KEYCODE_7)
770   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_SERVICE ) PORT_NAME( DEF_STR( Service_Mode )) PORT_CODE(KEYCODE_F2)
770   PORT_SERVICE_NO_TOGGLE( 0x10, IP_ACTIVE_LOW )
771771   PORT_BIT( 0x0f, IP_ACTIVE_HIGH, IPT_UNUSED )
772772
773773   PORT_START
r1679r1680
815815   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_COIN1 )
816816   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_COIN2 )
817817   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_SERVICE ) PORT_NAME("Service Button") PORT_CODE(KEYCODE_7)
818   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_SERVICE ) PORT_NAME( DEF_STR( Service_Mode )) PORT_CODE(KEYCODE_F2)
818   PORT_SERVICE_NO_TOGGLE( 0x10, IP_ACTIVE_LOW )
819819   PORT_BIT( 0x0f, IP_ACTIVE_HIGH, IPT_UNUSED )
820820
821821   PORT_START
src/mame/drivers/ccastles.c
r1679r1680
165165         break;
166166
167167   /* next one at the start of this scanline */
168   timer_adjust(irq_timer, video_screen_get_time_until_pos(0, curscanline, 0), curscanline, attotime_zero);
168   timer_adjust_oneshot(irq_timer, video_screen_get_time_until_pos(0, curscanline, 0), curscanline);
169169}
170170
171171
src/mame/drivers/exterm.c
r1679r1680
258258   /* this value is latched into up-counters, which are clocked at the */
259259   /* input clock / 256 */
260260   attotime nmi_rate = attotime_mul(ATTOTIME_IN_HZ(4000000), 4096 * (256 - data));
261   timer_adjust(sound_nmi_timer, nmi_rate, 0, nmi_rate);
261   timer_adjust_periodic(sound_nmi_timer, nmi_rate, 0, nmi_rate);
262262}
263263
264264
src/mame/drivers/mediagx.c
r1679r1680
169169   }
170170}
171171
172static void draw_char(mame_bitmap *bitmap, const rectangle *cliprect, const gfx_element *gfx, int ch, int att, int x, int y)
172static void draw_char(running_machine *machine, mame_bitmap *bitmap, const rectangle *cliprect, const gfx_element *gfx, int ch, int att, int x, int y)
173173{
174174   int i,j;
175175   UINT8 *dp;
r1679r1680
183183      {
184184         UINT8 pen = dp[index++];
185185         if (pen)
186         {
187            p[i] = Machine->remapped_colortable[gfx->color_base + (att & 0xf)];
188         }
186            p[i] = machine->pens[gfx->color_base + (att & 0xf)];
189187         else
190188         {
191189            if (((att >> 4) & 7) > 0)
192            {
193               p[i] = Machine->remapped_colortable[gfx->color_base + ((att >> 4) & 0x7)];
194            }
190               p[i] = machine->pens[gfx->color_base + ((att >> 4) & 0x7)];
195191         }
196192      }
197193   }
r1679r1680
304300         int att1 = (cga[index] >> 24) & 0xff;
305301         int ch1 = (cga[index] >> 16) & 0xff;
306302
307         draw_char(bitmap, cliprect, gfx, ch0, att0, i*8, j*8);
308         draw_char(bitmap, cliprect, gfx, ch1, att1, (i*8)+8, j*8);
303         draw_char(machine, bitmap, cliprect, gfx, ch0, att0, i*8, j*8);
304         draw_char(machine, bitmap, cliprect, gfx, ch1, att1, (i*8)+8, j*8);
309305         index++;
310306      }
311307   }
r1679r1680
643639static TIMER_CALLBACK( sound_timer_callback )
644640{
645641   ad1847_sample_counter = 0;
646   timer_adjust(sound_timer, ATTOTIME_IN_MSEC(10), 0, attotime_zero);
642   timer_adjust_oneshot(sound_timer, ATTOTIME_IN_MSEC(10), 0);
647643
648644   dmadac_transfer(0, 1, 0, 1, dacl_ptr, dacl);
649645   dmadac_transfer(1, 1, 0, 1, dacr_ptr, dacr);
r1679r1680
782778
783779static INPUT_PORTS_START(mediagx)
784780   PORT_START
785   PORT_BIT( 0x001, IP_ACTIVE_HIGH, IPT_SERVICE ) PORT_NAME( DEF_STR( Service_Mode )) PORT_CODE(KEYCODE_F2)
781   PORT_SERVICE_NO_TOGGLE( 0x001, IP_ACTIVE_HIGH )
786782   PORT_BIT( 0x002, IP_ACTIVE_HIGH, IPT_SERVICE1 )
787783   PORT_BIT( 0x004, IP_ACTIVE_HIGH, IPT_SERVICE2 )
788784   PORT_BIT( 0x008, IP_ACTIVE_HIGH, IPT_VOLUME_DOWN )
r1679r1680
860856   dacr = auto_malloc(65536 * sizeof(INT16));
861857
862858   sound_timer = timer_alloc(sound_timer_callback, NULL);
863   timer_adjust(sound_timer, ATTOTIME_IN_MSEC(10), 0, attotime_zero);
859   timer_adjust_oneshot(sound_timer, ATTOTIME_IN_MSEC(10), 0);
864860
865861   dmadac_enable(0, 2, 1);
866862   ide_controller_reset(0);
src/mame/drivers/policetr.c
r1679r1680
383383   PORT_BIT( 0x8000, IP_ACTIVE_LOW, IPT_UNKNOWN )
384384
385385   PORT_START
386   PORT_DIPNAME( 0x01, 0x01, DEF_STR( Unknown ))
387   PORT_DIPSETTING(    0x00, DEF_STR( Off ))
388   PORT_DIPSETTING(    0x01, DEF_STR( On ))
389   PORT_DIPNAME( 0x02, 0x02, DEF_STR( Unknown ))
390   PORT_DIPSETTING(    0x00, DEF_STR( Off ))
391   PORT_DIPSETTING(    0x02, DEF_STR( On ))
392   PORT_DIPNAME( 0x04, 0x04, DEF_STR( Unknown ))
393   PORT_DIPSETTING(    0x00, DEF_STR( Off ))
394   PORT_DIPSETTING(    0x04, DEF_STR( On ))
395   PORT_DIPNAME( 0x08, 0x08, DEF_STR( Unknown ))
396   PORT_DIPSETTING(    0x00, DEF_STR( Off ))
397   PORT_DIPSETTING(    0x08, DEF_STR( On ))
398   PORT_DIPNAME( 0x10, 0x10, DEF_STR( Unknown ))
399   PORT_DIPSETTING(    0x00, DEF_STR( Off ))
400   PORT_DIPSETTING(    0x10, DEF_STR( On ))
401   PORT_DIPNAME( 0x20, 0x20, DEF_STR( Unknown )) /* Manuals show dips 1 through 6 as unused */
402   PORT_DIPSETTING(    0x00, DEF_STR( Off ))
403   PORT_DIPSETTING(    0x20, DEF_STR( On ))
404   PORT_DIPNAME( 0x40, 0x40, "Monitor Sync")
386   PORT_DIPUNUSED_DIPLOC( 0x01, 0x01, "SW1:1" )
387   PORT_DIPUNUSED_DIPLOC( 0x02, 0x02, "SW1:2" )
388   PORT_DIPUNUSED_DIPLOC( 0x04, 0x04, "SW1:3" )
389   PORT_DIPUNUSED_DIPLOC( 0x08, 0x08, "SW1:4" )
390   PORT_DIPUNUSED_DIPLOC( 0x10, 0x10, "SW1:5" )
391   PORT_DIPUNUSED_DIPLOC( 0x20, 0x20, "SW1:6" )
392   PORT_DIPNAME( 0x40, 0x40, "Monitor Sync") PORT_DIPLOCATION("SW1:7")
405393   PORT_DIPSETTING(    0x00, "+")
406394   PORT_DIPSETTING(    0x40, "-")
407   PORT_DIPNAME( 0x80, 0x80, DEF_STR( Flip_Screen )) /* For use with mirrored CRTs - Not supported */
395   PORT_DIPNAME( 0x80, 0x80, DEF_STR( Flip_Screen )) PORT_DIPLOCATION("SW1:8") /* For use with mirrored CRTs - Not supported */
408396   PORT_DIPSETTING(    0x00, DEF_STR( Off ))
409397   PORT_DIPSETTING(    0x80, DEF_STR( On ))   /* Will invert the Y axis of guns */
410398   PORT_BIT( 0xff00, IP_ACTIVE_LOW, IPT_UNKNOWN )
src/mame/drivers/seibuspi.c
r1679r1680
12111211   PORT_START_TAG("IN2")
12121212   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_START1 )
12131213   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_START2 )
1214   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_SERVICE ) PORT_NAME( DEF_STR( Service_Mode )) PORT_CODE(KEYCODE_F2) /* Test Button */
1214   PORT_SERVICE_NO_TOGGLE( 0x04, IP_ACTIVE_LOW )
12151215   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_SERVICE ) PORT_NAME("Service Coin") PORT_CODE(KEYCODE_7)
12161216   PORT_BIT( 0xf0, IP_ACTIVE_LOW, IPT_UNUSED )
12171217
r1679r1680
13151315   PORT_BIT( 0x06, IP_ACTIVE_LOW, IPT_OTHER ) PORT_NAME("P1 Ron") PORT_CODE(KEYCODE_Z)
13161316
13171317   PORT_START_TAG("IN2")
1318   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_SERVICE ) PORT_NAME( DEF_STR( Service_Mode )) PORT_CODE(KEYCODE_F2) /* Test Button */
1318   PORT_SERVICE_NO_TOGGLE( 0x04, IP_ACTIVE_LOW )
13191319   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_SERVICE ) PORT_NAME("Service Coin") PORT_CODE(KEYCODE_7)
13201320   PORT_BIT( 0xf3, IP_ACTIVE_LOW, IPT_UNKNOWN )
13211321
src/mame/drivers/coolpool.c
r1679r1680
184184   if (!memcmp(nvram_unlock_seq, nvram_write_seq, sizeof(nvram_unlock_seq)))
185185   {
186186      nvram_write_enable = 1;
187      timer_adjust(nvram_write_timer, ATTOTIME_IN_MSEC(1000), 0, attotime_zero);
187      timer_adjust_oneshot(nvram_write_timer, ATTOTIME_IN_MSEC(1000), 0);
188188   }
189189}
190190
src/mame/drivers/mwarr.c
r1679r1680
310310
311311static VIDEO_START( mwarr )
312312{
313   bg_tilemap    = tilemap_create(get_bg_tile_info,   tilemap_scan_cols,TILEMAP_TYPE_PEN,      16, 16,64,16);
314   mlow_tilemap  = tilemap_create(get_mlow_tile_info, tilemap_scan_cols,TILEMAP_TYPE_PEN, 16, 16,64,16);
315   mhigh_tilemap = tilemap_create(get_mhigh_tile_info,tilemap_scan_cols,TILEMAP_TYPE_PEN, 16, 16,64,16);
316   tx_tilemap    = tilemap_create(get_tx_tile_info,   tilemap_scan_rows,TILEMAP_TYPE_PEN,  8,  8,64,32);
313   bg_tilemap    = tilemap_create(get_bg_tile_info,   tilemap_scan_cols, 16, 16,64,16);
314   mlow_tilemap  = tilemap_create(get_mlow_tile_info, tilemap_scan_cols, 16, 16,64,16);
315   mhigh_tilemap = tilemap_create(get_mhigh_tile_info,tilemap_scan_cols, 16, 16,64,16);
316   tx_tilemap    = tilemap_create(get_tx_tile_info,   tilemap_scan_rows,  8,  8,64,32);
317317
318318   sprites_buffer = auto_malloc(sizeof(UINT16) * 0x800);
319319
src/mame/drivers/midtunit.c
r1679r1680
9191   PORT_BIT( 0x0002, IP_ACTIVE_LOW, IPT_COIN2 )
9292   PORT_BIT( 0x0004, IP_ACTIVE_LOW, IPT_START1 )
9393   PORT_BIT( 0x0008, IP_ACTIVE_LOW, IPT_TILT ) /* Slam Switch */
94   PORT_BIT(0x0010, IP_ACTIVE_LOW, IPT_SERVICE ) PORT_NAME(DEF_STR( Test )) PORT_CODE(KEYCODE_F2) PORT_TOGGLE
94   PORT_SERVICE( 0x0010, IP_ACTIVE_LOW )
9595   PORT_BIT( 0x0020, IP_ACTIVE_LOW, IPT_START2 )
9696   PORT_BIT( 0x0040, IP_ACTIVE_LOW, IPT_SERVICE1 )
9797   PORT_BIT( 0x0080, IP_ACTIVE_LOW, IPT_COIN3 )
r1679r1680
189189   PORT_BIT( 0x0002, IP_ACTIVE_LOW, IPT_COIN2 )
190190   PORT_BIT( 0x0004, IP_ACTIVE_LOW, IPT_START1 )
191191   PORT_BIT( 0x0008, IP_ACTIVE_LOW, IPT_TILT ) /* Slam Switch */
192   PORT_BIT(0x0010, IP_ACTIVE_LOW, IPT_SERVICE ) PORT_NAME(DEF_STR( Test )) PORT_CODE(KEYCODE_F2)
192   PORT_SERVICE( 0x0010, IP_ACTIVE_LOW )
193193   PORT_BIT( 0x0020, IP_ACTIVE_LOW, IPT_START2 )
194194   PORT_BIT( 0x0040, IP_ACTIVE_LOW, IPT_SERVICE1 )
195195   PORT_BIT( 0x0080, IP_ACTIVE_LOW, IPT_COIN3 )
r1679r1680
296296   PORT_BIT( 0x0002, IP_ACTIVE_LOW, IPT_COIN2 )
297297   PORT_BIT( 0x0004, IP_ACTIVE_LOW, IPT_START1 )
298298   PORT_BIT( 0x0008, IP_ACTIVE_LOW, IPT_TILT ) /* Slam Switch */
299   PORT_BIT(0x0010, IP_ACTIVE_LOW, IPT_SERVICE ) PORT_NAME(DEF_STR( Test )) PORT_CODE(KEYCODE_F2) PORT_TOGGLE
299   PORT_SERVICE( 0x0010, IP_ACTIVE_LOW )
300300   PORT_BIT( 0x0020, IP_ACTIVE_LOW, IPT_START2 )
301301   PORT_BIT( 0x0040, IP_ACTIVE_LOW, IPT_SERVICE1 )
302302   PORT_BIT( 0x0080, IP_ACTIVE_LOW, IPT_COIN3 )
r1679r1680
392392   PORT_BIT( 0x0002, IP_ACTIVE_LOW, IPT_COIN2 )
393393   PORT_BIT( 0x0004, IP_ACTIVE_LOW, IPT_START1 )
394394   PORT_BIT( 0x0008, IP_ACTIVE_LOW, IPT_TILT ) /* Slam Switch */
395   PORT_BIT(0x0010, IP_ACTIVE_LOW, IPT_SERVICE ) PORT_NAME(DEF_STR( Test )) PORT_CODE(KEYCODE_F2) PORT_TOGGLE
395   PORT_SERVICE( 0x0010, IP_ACTIVE_LOW )
396396   PORT_BIT( 0x0020, IP_ACTIVE_LOW, IPT_START2 )
397397   PORT_BIT( 0x0040, IP_ACTIVE_LOW, IPT_SERVICE1 )
398398   PORT_BIT( 0x0080, IP_ACTIVE_LOW, IPT_COIN3 )
r1679r1680
495495   PORT_BIT( 0x0002, IP_ACTIVE_LOW, IPT_COIN2 )
496496   PORT_BIT( 0x0004, IP_ACTIVE_LOW, IPT_START1 )
497497   PORT_BIT( 0x0008, IP_ACTIVE_LOW, IPT_TILT ) /* Slam Switch */
498   PORT_BIT(0x0010, IP_ACTIVE_LOW, IPT_SERVICE ) PORT_NAME(DEF_STR( Test )) PORT_CODE(KEYCODE_F2)
498   PORT_SERVICE_NO_TOGGLE( 0x0010, IP_ACTIVE_LOW )
499499   PORT_BIT( 0x0020, IP_ACTIVE_LOW, IPT_START2 )
500500   PORT_BIT( 0x0040, IP_ACTIVE_LOW, IPT_SERVICE1 )
501501   PORT_BIT( 0x0080, IP_ACTIVE_LOW, IPT_COIN3 )
src/mame/drivers/drmicro.c
r1679r1680
2121WRITE8_HANDLER( drmicro_flipscreen_w );
2222WRITE8_HANDLER( drmicro_priority_w );
2323
24READ8_HANDLER( drmicro_videoram_r );
2524WRITE8_HANDLER( drmicro_videoram_w );
2625
2726extern void drmicro_flip_w( int flip );
r1679r1680
7776static ADDRESS_MAP_START( readmem, ADDRESS_SPACE_PROGRAM, 8 )
7877   AM_RANGE(0x0000, 0xbfff) AM_READ(MRA8_ROM)
7978   AM_RANGE(0xc000, 0xdfff) AM_READ(MRA8_RAM)
80   AM_RANGE(0xe000, 0xefff) AM_READ(drmicro_videoram_r)
79   AM_RANGE(0xe000, 0xefff) AM_READ(MRA8_RAM)
8180   AM_RANGE(0xf000, 0xffff) AM_READ(MRA8_RAM)
8281ADDRESS_MAP_END
8382
r1679r1680
245244   MDRV_SCREEN_SIZE(32*8, 32*8)
246245   MDRV_SCREEN_VISIBLE_AREA(0*8, 32*8-1, 2*8, 30*8-1)
247246   MDRV_GFXDECODE(drmicro)
248   MDRV_PALETTE_LENGTH(32)
249   MDRV_COLORTABLE_LENGTH(512)
247   MDRV_PALETTE_LENGTH(512)
250248
251249   MDRV_PALETTE_INIT(drmicro)
252250   MDRV_VIDEO_START(drmicro)
src/mame/drivers/vroulet.c
r1679r1680
8888static VIDEO_START(vroulet)
8989{
9090   bg_tilemap = tilemap_create(get_bg_tile_info, tilemap_scan_rows,
91      TILEMAP_TYPE_PEN, 8, 8, 32, 32);
91      8, 8, 32, 32);
9292}
9393
9494static VIDEO_UPDATE(vroulet)
src/mame/drivers/system1.c
r1679r1680
413413#define IN0_PORT \
414414   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_COIN1 ) \
415415   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_COIN2 ) \
416   PORT_BIT(0x04, IP_ACTIVE_LOW, IPT_SERVICE ) PORT_NAME( DEF_STR( Service_Mode )) PORT_CODE(KEYCODE_F2) \
416   PORT_SERVICE_NO_TOGGLE( 0x04, IP_ACTIVE_LOW ) \
417417   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_SERVICE1 ) \
418418   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_START1 ) \
419419   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_START2 ) \
r1679r1680
955955   PORT_START  /* IN0 */
956956   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_COIN1 )
957957   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_COIN2 )
958   PORT_BIT(0x04, IP_ACTIVE_LOW, IPT_SERVICE ) PORT_NAME( DEF_STR( Service_Mode )) PORT_CODE(KEYCODE_F2)
958   PORT_SERVICE_NO_TOGGLE( 0x04, IP_ACTIVE_LOW )
959959   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_SERVICE1 )
960960   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_START1 )
961961   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_START2 )
r1679r1680
23162316   PORT_START  /* IN0 */
23172317   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_COIN1 )
23182318   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_COIN2 )
2319   PORT_BIT(0x04, IP_ACTIVE_LOW, IPT_SERVICE ) PORT_NAME( DEF_STR( Service_Mode )) PORT_CODE(KEYCODE_F2)
2319   PORT_SERVICE_NO_TOGGLE( 0x04, IP_ACTIVE_LOW )
23202320   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_SERVICE1 )
23212321   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_START1 )
23222322   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_START2 )
src/mame/drivers/cultures.c
r1679r1680
4343
4444static VIDEO_START( cultures )
4545{
46   bg2_tilemap = tilemap_create(get_bg2_tile_info,tilemap_scan_rows,TILEMAP_TYPE_PEN,8,8,512,512);
47   bg1_tilemap = tilemap_create(get_bg1_tile_info,tilemap_scan_rows,TILEMAP_TYPE_PEN,8,8,512,512);
48   bg0_tilemap = tilemap_create(get_bg0_tile_info,tilemap_scan_rows,TILEMAP_TYPE_PEN,8,8, 64,128);
46   bg2_tilemap = tilemap_create(get_bg2_tile_info,tilemap_scan_rows,8,8,512,512);
47   bg1_tilemap = tilemap_create(get_bg1_tile_info,tilemap_scan_rows,8,8,512,512);
48   bg0_tilemap = tilemap_create(get_bg0_tile_info,tilemap_scan_rows,8,8, 64,128);
4949
5050   tilemap_set_transparent_pen(bg1_tilemap,0);
5151   tilemap_set_transparent_pen(bg0_tilemap,0);
src/mame/drivers/powerins.c
r1679r1680
164164   PORT_BIT( 0x0004, IP_ACTIVE_LOW, IPT_SERVICE1 )
165165   PORT_BIT( 0x0008, IP_ACTIVE_LOW, IPT_START1   )
166166   PORT_BIT( 0x0010, IP_ACTIVE_LOW, IPT_START2   )
167   PORT_BIT(0x0020, IP_ACTIVE_LOW, IPT_SERVICE ) PORT_NAME( DEF_STR( Service_Mode )) PORT_CODE(KEYCODE_F2)
167   PORT_SERVICE_NO_TOGGLE( 0x0020, IP_ACTIVE_LOW )
168168   PORT_BIT( 0x0040, IP_ACTIVE_LOW, IPT_UNKNOWN  )
169169   PORT_BIT( 0x0080, IP_ACTIVE_LOW, IPT_UNKNOWN  )
170170
r1679r1680
329329static MACHINE_RESET( powerins )
330330{
331331   oki_bank = -1;   // samples bank "unitialised"
332   NMK112_init(0);
332333}
333334
334335
src/mame/drivers/exedexes.c
r1679r1680
241241   MDRV_SCREEN_SIZE(32*8, 32*8)
242242   MDRV_SCREEN_VISIBLE_AREA(0*8, 32*8-1, 2*8, 30*8-1)
243243   MDRV_GFXDECODE(exedexes)
244   MDRV_PALETTE_LENGTH(256)
245   MDRV_COLORTABLE_LENGTH(64*4+64*4+16*16+16*16)
244   MDRV_PALETTE_LENGTH(64*4+64*4+16*16+16*16)
246245
247246   MDRV_PALETTE_INIT(exedexes)
248247   MDRV_VIDEO_START(exedexes)
src/mame/drivers/jedi.c
r1679r1680
151151   scanline += 32;
152152   if (scanline > 256)
153153      scanline = 32;
154   timer_adjust(jedi_timer,video_screen_get_time_until_pos(0, scanline, 0), scanline, attotime_zero);
154   timer_adjust_oneshot(jedi_timer,video_screen_get_time_until_pos(0, scanline, 0), scanline);
155155}
156156
157157
r1679r1680
171171{
172172   /* set a timer to run the interrupts */
173173   jedi_timer = timer_alloc(generate_interrupt, NULL);
174   timer_adjust(jedi_timer,video_screen_get_time_until_pos(0, 32, 0), 32, attotime_zero);
174   timer_adjust_oneshot(jedi_timer,video_screen_get_time_until_pos(0, 32, 0), 32);
175175
176176   /* configure the banks */
177177   memory_configure_bank(1, 0, 3, memory_region(REGION_CPU1) + 0x10000, 0x4000);
src/mame/drivers/witch.c
r1679r1680
680680
681681static VIDEO_START(witch)
682682{
683   gfx0a_tilemap = tilemap_create(get_gfx0a_tile_info,tilemap_scan_rows,TILEMAP_TYPE_PEN,8,8,32,32);
684   gfx0b_tilemap = tilemap_create(get_gfx0b_tile_info,tilemap_scan_rows,TILEMAP_TYPE_PEN,8,8,32,32);
685   gfx1_tilemap = tilemap_create(get_gfx1_tile_info,tilemap_scan_rows,TILEMAP_TYPE_PEN,8,8,32,32);
683   gfx0a_tilemap = tilemap_create(get_gfx0a_tile_info,tilemap_scan_rows,8,8,32,32);
684   gfx0b_tilemap = tilemap_create(get_gfx0b_tile_info,tilemap_scan_rows,8,8,32,32);
685   gfx1_tilemap = tilemap_create(get_gfx1_tile_info,tilemap_scan_rows,8,8,32,32);
686686
687687   tilemap_set_transparent_pen(gfx0a_tilemap,0);
688688   tilemap_set_transparent_pen(gfx0b_tilemap,0);
src/mame/drivers/namcofl.c
r1679r1680
182182      UINT16 v = paletteram32[offset] >> 16;
183183      UINT16 triggerscanline=(((v>>8)&0xff)|((v&0xff)<<8))-(32+1);
184184
185      timer_adjust(raster_interrupt_timer, video_screen_get_time_until_pos(0, triggerscanline, 0), 0, attotime_zero);
185      timer_adjust_oneshot(raster_interrupt_timer, video_screen_get_time_until_pos(0, triggerscanline, 0), 0);
186186   }
187187}
188188
r1679r1680
211211   PORT_START
212212   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_UNKNOWN )
213213   PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_UNKNOWN )
214   PORT_BIT(0x04, IP_ACTIVE_HIGH, IPT_SERVICE ) PORT_NAME( DEF_STR( Service_Mode )) PORT_TOGGLE PORT_CODE(KEYCODE_F2)
214   PORT_SERVICE( 0x04, IP_ACTIVE_HIGH )
215215   PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_SERVICE1 )
216216   PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_UNKNOWN )
217217   PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_UNKNOWN )
r1679r1680
329329{
330330   video_screen_update_partial(0, video_screen_get_vpos(0));
331331   cpunum_set_input_line(machine, 0, I960_IRQ1, ASSERT_LINE);
332   timer_adjust(raster_interrupt_timer, video_screen_get_frame_period(0), 0, attotime_zero);
332   timer_adjust_oneshot(raster_interrupt_timer, video_screen_get_frame_period(0), 0);
333333}
334334
335335
src/mame/drivers/dynax.c
r1679r1680
21472147   PORT_START_TAG("IN2")
21482148   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_UNKNOWN )   // "17B"
21492149   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_UNKNOWN )   // "18B"
2150   PORT_SERVICE(0x04, IP_ACTIVE_LOW )   // Test (there isn't a dip switch)
2150   PORT_SERVICE(0x04, IP_ACTIVE_LOW )            // Test (there isn't a dip switch)
21512151   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_SERVICE2 )   // Analyzer
21522152   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_SERVICE3 )   // Memory Reset
21532153   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_UNKNOWN )   // "06B"
r1679r1680
21602160
21612161static INPUT_PORTS_START( mjdialq2 )
21622162   PORT_START_TAG("DSW0")
2163   PORT_DIPNAME( 0x01, 0x01, DEF_STR( Unknown ) )
2164   PORT_DIPSETTING(    0x01, DEF_STR( Off ) )
2165   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
2166   PORT_DIPNAME( 0x02, 0x02, DEF_STR( Unknown ) )
2167   PORT_DIPSETTING(    0x02, DEF_STR( Off ) )
2168   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
2163   PORT_DIPNAME( 0x03, 0x03, DEF_STR( Coinage ) )
2164   PORT_DIPSETTING(    0x00, DEF_STR( 3C_1C ) )
2165   PORT_DIPSETTING(    0x02, DEF_STR( 2C_1C ) )
2166   PORT_DIPSETTING(    0x03, DEF_STR( 1C_1C ) )
2167   PORT_DIPSETTING(    0x01, DEF_STR( 1C_2C ) )
21692168   PORT_DIPNAME( 0x04, 0x04, DEF_STR( Unknown ) )
21702169   PORT_DIPSETTING(    0x04, DEF_STR( Off ) )
21712170   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
r1679r1680
21862185   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
21872186
21882187   PORT_START_TAG("DSW1")
2189   PORT_DIPNAME( 0x01, 0x01, DEF_STR( Unknown ) )
2190   PORT_DIPSETTING(    0x01, DEF_STR( Off ) )
2191   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
2192   PORT_DIPNAME( 0x02, 0x02, DEF_STR( Unknown ) )
2193   PORT_DIPSETTING(    0x02, DEF_STR( Off ) )
2194   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
2195   PORT_DIPNAME( 0x04, 0x04, DEF_STR( Unknown ) )
2196   PORT_DIPSETTING(    0x04, DEF_STR( Off ) )
2197   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
2188   PORT_DIPNAME( 0x07, 0x07, "Time Setting" )
2189   PORT_DIPSETTING(    0x07, "08:30" )
2190   PORT_DIPSETTING(    0x06, "09:00" )
2191   PORT_DIPSETTING(    0x05, "09:30" )
2192   PORT_DIPSETTING(    0x04, "10:00" )
2193   PORT_DIPSETTING(    0x03, "10:30" )
2194   PORT_DIPSETTING(    0x02, "11:00" )
2195   PORT_DIPSETTING(    0x01, "11:30" )
2196   PORT_DIPSETTING(    0x00, "12:00" )
21982197   PORT_DIPNAME( 0x08, 0x08, DEF_STR( Unknown ) )
21992198   PORT_DIPSETTING(    0x08, DEF_STR( Off ) )
22002199   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
r1679r1680
22042203   PORT_DIPNAME( 0x20, 0x20, DEF_STR( Unknown ) )
22052204   PORT_DIPSETTING(    0x20, DEF_STR( Off ) )
22062205   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
2207   PORT_DIPNAME( 0x40, 0x40, DEF_STR( Unknown ) )
2206   PORT_DIPNAME( 0x40, 0x40, "Select Special Item" ) /* Allows to select which one of the nine special items you want. */
22082207   PORT_DIPSETTING(    0x40, DEF_STR( Off ) )
22092208   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
22102209   PORT_DIPNAME( 0x80, 0x80, DEF_STR( Unknown ) )
r1679r1680
22142213   PORT_START_TAG("IN2")
22152214   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_UNKNOWN )   // "17B"
22162215   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_UNKNOWN )   // "18B"
2217   PORT_SERVICE_NO_TOGGLE(0x04, IP_ACTIVE_LOW)   // Test (there isn't a dip switch)
2216   PORT_SERVICE_NO_TOGGLE(0x04, IP_ACTIVE_LOW)      // Test (there isn't a dip switch)
22182217   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_SERVICE2 )   // Analyzer
22192218   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_SERVICE3 )   // Memory Reset
22202219   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_UNKNOWN )   // "06B"
r1679r1680
24592458   PORT_DIPSETTING(    0x18, DEF_STR( 1C_1C ) )
24602459//  PORT_DIPSETTING(    0x00, DEF_STR( 1C_1C ) )
24612460   PORT_DIPSETTING(    0x10, DEF_STR( 1C_2C ) )
2462   PORT_DIPNAME( 0x20, 0x20, DEF_STR( Unknown ) )   //*
2461   PORT_DIPNAME( 0x20, 0x20, "Auto TSUMO" )
24632462   PORT_DIPSETTING(    0x20, DEF_STR( Off ) )
24642463   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
24652464   PORT_DIPNAME( 0x40, 0x00, DEF_STR( Demo_Sounds ) )
r1679r1680
24702469   PORT_DIPSETTING(    0x80, DEF_STR( On ) )
24712470
24722471   PORT_START_TAG("DSW1")
2473   PORT_DIPNAME( 0x07, 0x07, DEF_STR( Unknown ) )
2474   PORT_DIPSETTING(    0x07, "0" )
2475   PORT_DIPSETTING(    0x06, "1" )
2476   PORT_DIPSETTING(    0x05, "2" )
2477   PORT_DIPSETTING(    0x04, "3" )
2478   PORT_DIPSETTING(    0x03, "4" )
2479   PORT_DIPSETTING(    0x02, "5" )
2480   PORT_DIPSETTING(    0x01, "6" )
2481   PORT_DIPSETTING(    0x00, "7" )
2472   PORT_DIPNAME( 0x07, 0x07, "Time Setting" )
2473   PORT_DIPSETTING(    0x07, "8:30" )
2474   PORT_DIPSETTING(    0x06, "9:00" )
2475   PORT_DIPSETTING(    0x05, "9:30" )
2476   PORT_DIPSETTING(    0x04, "10:00" )
2477   PORT_DIPSETTING(    0x03, "10:30" )
2478   PORT_DIPSETTING(    0x02, "11:00" )
2479   PORT_DIPSETTING(    0x01, "11:30" )
2480   PORT_DIPSETTING(    0x00, "12:00" )
24822481   PORT_DIPNAME( 0x08, 0x08, DEF_STR( Unknown ) )
24832482   PORT_DIPSETTING(    0x08, DEF_STR( Off ) )
24842483   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
2485   PORT_DIPNAME( 0x10, 0x10, "Choose Bonus (Cheat)")
2484   PORT_DIPNAME( 0x10, 0x10, "Buy Screen Bonus Points" ) /* Sets your points to 100 every time you arrive at the screen for buying special items. */
24862485   PORT_DIPSETTING(    0x10, DEF_STR( Off ) )
24872486   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
2488   PORT_DIPNAME( 0x20, 0x20, DEF_STR( Unknown ) )   //*
2487   /* make your game last at least 4 or 5 minutes. Continue if necessary. Before the next round you begin,
2488    you will get some sort of message in Japanese stating that it is some sort of lucky time of day for you, and
2489    you get 100 bonus points (for purchasing items). */
2490   PORT_DIPNAME( 0x20, 0x20, "Lucky Time Of Day Bonus" )
24892491   PORT_DIPSETTING(    0x20, DEF_STR( Off ) )
24902492   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
2491   PORT_DIPNAME( 0x40, 0x40, DEF_STR( Unknown ) )   //*
2493   PORT_DIPNAME( 0x40, 0x40, DEF_STR( Unknown ) )
24922494   PORT_DIPSETTING(    0x40, DEF_STR( Off ) )
24932495   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
24942496   PORT_SERVICE( 0x80, IP_ACTIVE_LOW )
r1679r1680
26242626   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
26252627
26262628   PORT_START_TAG("DSW1")
2627   PORT_DIPNAME( 0x07, 0x07, "Hours" )
2629   PORT_DIPNAME( 0x07, 0x07, "Time Setting" )
26282630   PORT_DIPSETTING(    0x07, "08:30" )
26292631   PORT_DIPSETTING(    0x06, "09:00" )
26302632   PORT_DIPSETTING(    0x05, "09:30" )
r1679r1680
26362638   PORT_DIPNAME( 0x08, 0x08, "Moles On Gal's Face" )
26372639   PORT_DIPSETTING(    0x08, DEF_STR( Off ) )
26382640   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
2639   PORT_DIPNAME( 0x10, 0x10, "Choose Game Mode" )
2641   PORT_DIPNAME( 0x10, 0x10, "Buy Screen Bonus Points" ) /* Sets your points to 100 every time you arrive at the screen for buying special items. */
26402642   PORT_DIPSETTING(    0x10, DEF_STR( Off ) )
26412643   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
2642   PORT_DIPNAME( 0x20, 0x20, "Bonus Coin Every" )
2643   PORT_DIPSETTING(    0x00, "30" )
2644   PORT_DIPSETTING(    0x20, "150" )
2644   /* make your game last at least 4 or 5 minutes. Continue if necessary. Before the next round you begin,
2645    you will get some sort of message in Japanese stating that it is some sort of lucky time of day for you, and
2646    you get 100 bonus points (for purchasing items). */
2647   PORT_DIPNAME( 0x20, 0x20, "Lucky Time Of Day Bonus" )
2648   PORT_DIPSETTING(    0x20, DEF_STR( Off ) )
2649   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
26452650   PORT_DIPNAME( 0x40, 0x40, DEF_STR( Unknown ) )   //*
26462651   PORT_DIPSETTING(    0x40, DEF_STR( Off ) )
26472652   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
r1679r1680
30773082
30783083static INPUT_PORTS_START( neruton )
30793084   PORT_START_TAG("DSW2") //6a77 (select = 00)
3080   PORT_DIPNAME( 0x07, 0x07, "Hours" )
3085   PORT_DIPNAME( 0x07, 0x07, "Time Setting" )
30813086   PORT_DIPSETTING(    0x07, "08:30" )
30823087   PORT_DIPSETTING(    0x06, "09:00" )
30833088   PORT_DIPSETTING(    0x05, "09:30" )
src/mame/drivers/contra.c
r1679r1680
280280MACHINE_DRIVER_END
281281
282282
283ROM_START( contra )
284   ROM_REGION( 0x28000, REGION_CPU1, 0 )   /* 64k for code + 96k for banked ROMs */
285   ROM_LOAD( "633m03.18a",   0x20000, 0x08000, CRC(d045e1da) SHA1(ec781e98a6efb14861223250c6239b06ec98ed0b) )
286   ROM_CONTINUE(             0x08000, 0x08000 )
287   ROM_LOAD( "633i02.17a",   0x10000, 0x10000, CRC(b2f7bd9a) SHA1(6c29568419bc49f0be3995b0c34edd9038f6f8d9) )
283288
284#if 0
285   /* bootleg versions use smaller gfx ROMs, but the data is the same */
286   ROM_LOAD( "g-7.rom",      0x00000, 0x10000, CRC(57f467d2) )
287   ROM_LOAD( "g-10.rom",     0x10000, 0x10000, CRC(e6db9685) )
288   ROM_LOAD( "g-9.rom",      0x20000, 0x10000, CRC(875c61de) )
289   ROM_LOAD( "g-8.rom",      0x30000, 0x10000, CRC(642765d6) )
290   ROM_LOAD( "g-15.rom",     0x40000, 0x10000, CRC(daa2324b) )
291   ROM_LOAD( "g-16.rom",     0x50000, 0x10000, CRC(e27cc835) )
292   ROM_LOAD( "g-17.rom",     0x60000, 0x10000, CRC(ce4330b9) )
293   ROM_LOAD( "g-18.rom",     0x70000, 0x10000, CRC(1571ce42) )
294   ROM_LOAD( "g-4.rom",      0x80000, 0x10000, CRC(2cc7e52c) )
295   ROM_LOAD( "g-5.rom",      0x90000, 0x10000, CRC(e01a5b9c) )
296   ROM_LOAD( "g-6.rom",      0xa0000, 0x10000, CRC(aeea6744) )
297   ROM_LOAD( "g-14.rom",     0xb0000, 0x10000, CRC(fca77c5a) )
298   ROM_LOAD( "g-11.rom",     0xc0000, 0x10000, CRC(bd9ba92c) )
299   ROM_LOAD( "g-12.rom",     0xd0000, 0x10000, CRC(d0be7ec2) )
300   ROM_LOAD( "g-13.rom",     0xe0000, 0x10000, CRC(2b513d12) )
301#endif
289   ROM_REGION( 0x10000, REGION_CPU2, 0 )   /* 64k for SOUND code */
290   ROM_LOAD( "633e01.12a",   0x08000, 0x08000, CRC(d1549255) SHA1(d700c7de36746ba247e3a5d0410b7aa036aa4073) )
302291
292   ROM_REGION( 0x80000, REGION_GFX1, ROMREGION_DISPOSE )
293   ROM_LOAD16_BYTE( "633e04.7d",    0x00000, 0x40000, CRC(14ddc542) SHA1(c7d8592672a6e50c2fe6b0670001c340022f16f9) )
294   ROM_LOAD16_BYTE( "633e05.7f",    0x00001, 0x40000, CRC(42185044) SHA1(a6e2598d766e6995c1a912e4a04987e6f4d547ff) )
303295
304ROM_START( contra )
296   ROM_REGION( 0x80000, REGION_GFX2, ROMREGION_DISPOSE )
297   ROM_LOAD16_BYTE( "633e06.16d",   0x00000, 0x40000, CRC(9cf6faae) SHA1(9ab79c06cb541ce6fdac322886b8a14a2f3f5cf7) )
298   ROM_LOAD16_BYTE( "633e07.16f",   0x00001, 0x40000, CRC(f2d06638) SHA1(0fa0fbfc53ab5c31b9de22f90153d9af37ff22ce) )
299
300   ROM_REGION( 0x0500, REGION_PROMS, 0 )
301   ROM_LOAD( "633e08.10g",   0x0000, 0x0100, CRC(9f0949fa) SHA1(7c8fefdcae4523d008a7d39062194c7a80aa3500) )   /* 007121 #0 sprite lookup table */
302   ROM_LOAD( "633e09.12g",   0x0100, 0x0100, CRC(14ca5e19) SHA1(eeee2f8b3d1e4acf47de1e74c4e507ff924591e7) )   /* 007121 #0 char lookup table */
303   ROM_LOAD( "633f10.18g",   0x0200, 0x0100, CRC(2b244d84) SHA1(c3bde7afb501bae58d07721c637dc06938c22150) )   /* 007121 #1 sprite lookup table */
304   ROM_LOAD( "633f11.20g",   0x0300, 0x0100, CRC(14ca5e19) SHA1(eeee2f8b3d1e4acf47de1e74c4e507ff924591e7) )   /* 007121 #1 char lookup table */
305ROM_END
306
307ROM_START( contra1 )
305308   ROM_REGION( 0x28000, REGION_CPU1, 0 )   /* 64k for code + 96k for banked ROMs */
306309   ROM_LOAD( "633e03.18a",   0x20000, 0x08000, CRC(7fc0d8cf) SHA1(cf1cf15646a4e5dc72671e957bc51ca44d30995c) )
307   ROM_CONTINUE(           0x08000, 0x08000 )
308   ROM_LOAD( "633e02.17a",   0x10000, 0x10000, CRC(b2f7bd9a) SHA1(6c29568419bc49f0be3995b0c34edd9038f6f8d9) )
310   ROM_CONTINUE(             0x08000, 0x08000 )
311   ROM_LOAD( "633i02.17a",   0x10000, 0x10000, CRC(b2f7bd9a) SHA1(6c29568419bc49f0be3995b0c34edd9038f6f8d9) )
309312
310313   ROM_REGION( 0x10000, REGION_CPU2, 0 )   /* 64k for SOUND code */
311314   ROM_LOAD( "633e01.12a",   0x08000, 0x08000, CRC(d1549255) SHA1(d700c7de36746ba247e3a5d0410b7aa036aa4073) )
r1679r1680
327330
328331ROM_START( contrab )
329332   ROM_REGION( 0x28000, REGION_CPU1, 0 )   /* 64k for code + 96k for banked ROMs */
330   ROM_LOAD( "contra.20",    0x20000, 0x08000, CRC(d045e1da) SHA1(ec781e98a6efb14861223250c6239b06ec98ed0b) )
333   ROM_LOAD( "633m03.18a",   0x20000, 0x08000, CRC(d045e1da) SHA1(ec781e98a6efb14861223250c6239b06ec98ed0b) )
331334   ROM_CONTINUE(             0x08000, 0x08000 )
332   ROM_LOAD( "633e02.17a",   0x10000, 0x10000, CRC(b2f7bd9a) SHA1(6c29568419bc49f0be3995b0c34edd9038f6f8d9) )
335   ROM_LOAD( "633i02.17a",   0x10000, 0x10000, CRC(b2f7bd9a) SHA1(6c29568419bc49f0be3995b0c34edd9038f6f8d9) )
333336
334337   ROM_REGION( 0x10000, REGION_CPU2, 0 )   /* 64k for SOUND code */
335338   ROM_LOAD( "633e01.12a",   0x08000, 0x08000, CRC(d1549255) SHA1(d700c7de36746ba247e3a5d0410b7aa036aa4073) )
336339
337340   ROM_REGION( 0x80000, REGION_GFX1, ROMREGION_DISPOSE )
338   ROM_LOAD16_BYTE( "633e04.7d",    0x00000, 0x40000, CRC(14ddc542) SHA1(c7d8592672a6e50c2fe6b0670001c340022f16f9) )
339   ROM_LOAD16_BYTE( "633e05.7f",    0x00001, 0x40000, CRC(42185044) SHA1(a6e2598d766e6995c1a912e4a04987e6f4d547ff) )
341   /* bootleg versions use smaller gfx ROMs, but the data is the same */
342   ROM_LOAD( "g-7.rom",      0x00000, 0x10000, CRC(57f467d2) SHA1(e30be315980f421143d1357174af678362836285) )
343   ROM_LOAD( "g-10.rom",     0x10000, 0x10000, CRC(e6db9685) SHA1(4d5ccfe95b082fe9830e7a316f88fd6f02464900) )
344   ROM_LOAD( "g-9.rom",      0x20000, 0x10000, CRC(875c61de) SHA1(e8dc42fef810a9f5471d96cb5297eb29296ba472) )
345   ROM_LOAD( "g-8.rom",      0x30000, 0x10000, CRC(642765d6) SHA1(d1563a392b8d8409f0f2159c2e82cd34b9ca2900) )
346   ROM_LOAD( "g-15.rom",     0x40000, 0x10000, CRC(daa2324b) SHA1(8a5fb8b79957291dc952e19e6973c64bb7230816) )
347   ROM_LOAD( "g-16.rom",     0x50000, 0x10000, CRC(e27cc835) SHA1(cb980b1fed110c7e4ef21fa11f44e5aea100881b) )
348   ROM_LOAD( "g-17.rom",     0x60000, 0x10000, CRC(ce4330b9) SHA1(0a2bd31baa0bc5e3745ee5ddac995557a551d58c) )
349   ROM_LOAD( "g-18.rom",     0x70000, 0x10000, CRC(1571ce42) SHA1(04082ed78b5e7f20b99d6edfb6c363574abd6158) )
340350
341351   ROM_REGION( 0x80000, REGION_GFX2, ROMREGION_DISPOSE )
342   ROM_LOAD16_BYTE( "633e06.16d",   0x00000, 0x40000, CRC(9cf6faae) SHA1(9ab79c06cb541ce6fdac322886b8a14a2f3f5cf7) )
343   ROM_LOAD16_BYTE( "633e07.16f",   0x00001, 0x40000, CRC(f2d06638) SHA1(0fa0fbfc53ab5c31b9de22f90153d9af37ff22ce) )
352   /* bootleg versions use smaller gfx ROMs, but the data is the same */
353   ROM_LOAD( "g-4.rom",      0x00000, 0x10000, CRC(2cc7e52c) SHA1(7598a63346bf06dd34fd643fdff53fc3de6768a6) )
354   ROM_LOAD( "g-5.rom",      0x10000, 0x10000, CRC(e01a5b9c) SHA1(58c99cf99f209c584da757320a2f107244056d4c) )
355   ROM_LOAD( "g-6.rom",      0x20000, 0x10000, CRC(aeea6744) SHA1(220b42f707db99967bdcbd9ac66fcc83675a72aa) )
356   ROM_LOAD( "g-14.rom",     0x30000, 0x10000, CRC(765afdc7) SHA1(b7f6871cb154ee7e42e683bce08b73b00e61b0bc) )
357   ROM_LOAD( "g-11.rom",     0x40000, 0x10000, CRC(bd9ba92c) SHA1(e7f65ed20cd7754cc476e8fab7e56105cedcdb98) )
358   ROM_LOAD( "g-12.rom",     0x50000, 0x10000, CRC(d0be7ec2) SHA1(5aa829b8ffbe3f5f92ba672b1c24bfb7836ba1a3) )
359   ROM_LOAD( "g-13.rom",     0x60000, 0x10000, CRC(2b513d12) SHA1(152ebd849751cc2e95513134ce773a6b2eeb320e) )
360   /* This last section, 0x70000-0x7ffff is empty */
344361
345362   ROM_REGION( 0x0500, REGION_PROMS, 0 )
346363   ROM_LOAD( "633e08.10g",   0x0000, 0x0100, CRC(9f0949fa) SHA1(7c8fefdcae4523d008a7d39062194c7a80aa3500) )   /* 007121 #0 sprite lookup table */
r1679r1680
384401   ROM_LOAD( "633e01.12a",   0x08000, 0x08000, CRC(d1549255) SHA1(d700c7de36746ba247e3a5d0410b7aa036aa4073) )
385402
386403   ROM_REGION( 0x80000, REGION_GFX1, ROMREGION_DISPOSE )
387   ROM_LOAD16_BYTE( "633e04.7d",    0x00000, 0x40000, CRC(14ddc542) SHA1(c7d8592672a6e50c2fe6b0670001c340022f16f9) )
388   ROM_LOAD16_BYTE( "633e05.7f",    0x00001, 0x40000, CRC(42185044) SHA1(a6e2598d766e6995c1a912e4a04987e6f4d547ff) )
404   /* bootleg versions use smaller gfx ROMs, but the data is the same */
405   ROM_LOAD( "g-7.rom",      0x00000, 0x10000, CRC(57f467d2) SHA1(e30be315980f421143d1357174af678362836285) )
406   ROM_LOAD( "g-10.rom",     0x10000, 0x10000, CRC(e6db9685) SHA1(4d5ccfe95b082fe9830e7a316f88fd6f02464900) )
407   ROM_LOAD( "g-9.rom",      0x20000, 0x10000, CRC(875c61de) SHA1(e8dc42fef810a9f5471d96cb5297eb29296ba472) )
408   ROM_LOAD( "g-8.rom",      0x30000, 0x10000, CRC(642765d6) SHA1(d1563a392b8d8409f0f2159c2e82cd34b9ca2900) )
409   ROM_LOAD( "g-15.rom",     0x40000, 0x10000, CRC(daa2324b) SHA1(8a5fb8b79957291dc952e19e6973c64bb7230816) )
410   ROM_LOAD( "g-16.rom",     0x50000, 0x10000, CRC(e27cc835) SHA1(cb980b1fed110c7e4ef21fa11f44e5aea100881b) )
411   ROM_LOAD( "g-17.rom",     0x60000, 0x10000, CRC(ce4330b9) SHA1(0a2bd31baa0bc5e3745ee5ddac995557a551d58c) )
412   ROM_LOAD( "g-18.rom",     0x70000, 0x10000, CRC(1571ce42) SHA1(04082ed78b5e7f20b99d6edfb6c363574abd6158) )
389413
390414   ROM_REGION( 0x80000, REGION_GFX2, ROMREGION_DISPOSE )
391   ROM_LOAD16_BYTE( "633e06.16d",   0x00000, 0x40000, CRC(9cf6faae) SHA1(9ab79c06cb541ce6fdac322886b8a14a2f3f5cf7) )
392   ROM_LOAD16_BYTE( "633e07.16f",   0x00001, 0x40000, CRC(f2d06638) SHA1(0fa0fbfc53ab5c31b9de22f90153d9af37ff22ce) )
415   /* bootleg versions use smaller gfx ROMs, but the data is the same */
416   ROM_LOAD( "g-4.rom",      0x00000, 0x10000, CRC(2cc7e52c) SHA1(7598a63346bf06dd34fd643fdff53fc3de6768a6) )
417   ROM_LOAD( "g-5.rom",      0x10000, 0x10000, CRC(e01a5b9c) SHA1(58c99cf99f209c584da757320a2f107244056d4c) )
418   ROM_LOAD( "g-6.rom",      0x20000, 0x10000, CRC(aeea6744) SHA1(220b42f707db99967bdcbd9ac66fcc83675a72aa) )
419   ROM_LOAD( "g-14.rom",     0x30000, 0x10000, CRC(765afdc7) SHA1(b7f6871cb154ee7e42e683bce08b73b00e61b0bc) )
420   ROM_LOAD( "g-11.rom",     0x40000, 0x10000, CRC(bd9ba92c) SHA1(e7f65ed20cd7754cc476e8fab7e56105cedcdb98) )
421   ROM_LOAD( "g-12.rom",     0x50000, 0x10000, CRC(d0be7ec2) SHA1(5aa829b8ffbe3f5f92ba672b1c24bfb7836ba1a3) )
422   ROM_LOAD( "g-13.rom",     0x60000, 0x10000, CRC(2b513d12) SHA1(152ebd849751cc2e95513134ce773a6b2eeb320e) )
423   /* This last section, 0x70000-0x7ffff is empty */
393424
425
394426   ROM_REGION( 0x0400, REGION_PROMS, 0 )
395427   ROM_LOAD( "633e08.10g",   0x0000, 0x0100, CRC(9f0949fa) SHA1(7c8fefdcae4523d008a7d39062194c7a80aa3500) )   /* 007121 #0 sprite lookup table */
396428   ROM_LOAD( "633e09.12g",   0x0100, 0x0100, CRC(14ca5e19) SHA1(eeee2f8b3d1e4acf47de1e74c4e507ff924591e7) )   /* 007121 #0 char lookup table */
r1679r1680
448480
449481
450482
451GAME( 1987, contra,   0,      contra, contra, 0, ROT90, "Konami", "Contra (US)", 0 )
452GAME( 1987, contrab,  contra, contra, contra, 0, ROT90, "bootleg", "Contra (US bootleg)", 0 )
483GAME( 1987, contra,   0,      contra, contra, 0, ROT90, "Konami", "Contra (US, Set 1)", 0 )
484GAME( 1987, contra1,  contra, contra, contra, 0, ROT90, "Konami", "Contra (US, Set 2)", 0 )
485GAME( 1987, contrab,  contra, contra, contra, 0, ROT90, "bootleg", "Contra (bootleg)", 0 )
453486GAME( 1987, contraj,  contra, contra, contra, 0, ROT90, "Konami", "Contra (Japan)", 0 )
454487GAME( 1987, contrajb, contra, contra, contra, 0, ROT90, "bootleg", "Contra (Japan bootleg)", 0 )
455488GAME( 1987, gryzor,   contra, contra, contra, 0, ROT90, "Konami", "Gryzor (Set 1)", 0 )
src/mame/drivers/zn.c
r1679r1680
424424
425425static MACHINE_DRIVER_START( zn1_1mb_vram )
426426   /* basic machine hardware */
427   MDRV_CPU_ADD( PSXCPU, XTAL_67_7376MHz )
427   MDRV_CPU_ADD_TAG( "MAIN", PSXCPU, XTAL_67_7376MHz )
428428   MDRV_CPU_PROGRAM_MAP( zn_map, 0 )
429429   MDRV_CPU_VBLANK_INT( psx_vblank, 1 )
430430
r1679r1680
458458MACHINE_DRIVER_END
459459
460460static MACHINE_DRIVER_START( zn2 )
461   MDRV_IMPORT_FROM( zn1_2mb_vram )
461   /* basic machine hardware */
462   MDRV_CPU_ADD_TAG( "MAIN", PSXCPU, XTAL_100MHz )
463   MDRV_CPU_PROGRAM_MAP( zn_map, 0 )
464   MDRV_CPU_VBLANK_INT( psx_vblank, 1 )
465
466   MDRV_SCREEN_REFRESH_RATE( 60 )
467   MDRV_SCREEN_VBLANK_TIME(DEFAULT_60HZ_VBLANK_DURATION)
468
469   /* video hardware */
470   MDRV_VIDEO_ATTRIBUTES( VIDEO_TYPE_RASTER )
471   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
472   MDRV_SCREEN_SIZE( 1024, 1024 )
473   MDRV_SCREEN_VISIBLE_AREA( 0, 639, 0, 479 )
474   MDRV_PALETTE_LENGTH( 65536 )
475
476   MDRV_PALETTE_INIT( psx )
477   MDRV_VIDEO_START( psx_type2 )
478   MDRV_VIDEO_UPDATE( psx )
479
480   /* sound hardware */
481   MDRV_SPEAKER_STANDARD_STEREO("left", "right")
482
483   MDRV_SOUND_ADD( PSXSPU, 0 )
484   MDRV_SOUND_CONFIG( psxspu_interface )
485   MDRV_SOUND_ROUTE(0, "left", 0.35)
486   MDRV_SOUND_ROUTE(1, "right", 0.35)
462487MACHINE_DRIVER_END
463488
464489/*
r1679r1680
12791304static MACHINE_DRIVER_START( coh1000ta )
12801305   MDRV_IMPORT_FROM( zn1_1mb_vram )
12811306
1307   MDRV_CPU_MODIFY( "MAIN" )
12821308   MDRV_CPU_VBLANK_INT( coh1000t_vblank, 1 )
12831309
12841310   MDRV_CPU_ADD( Z80, 16000000 / 4 )
r1679r1680
13621388static MACHINE_DRIVER_START( coh1000tb )
13631389   MDRV_IMPORT_FROM( zn1_2mb_vram )
13641390
1391   MDRV_CPU_MODIFY( "MAIN" )
13651392   MDRV_CPU_VBLANK_INT( coh1000t_vblank, 1 )
13661393
13671394   MDRV_MACHINE_RESET( coh1000tb )
r1679r1680
24572484static MACHINE_DRIVER_START( coh1002v )
24582485   MDRV_IMPORT_FROM( zn1_2mb_vram )
24592486
2487   MDRV_CPU_MODIFY( "MAIN" )
24602488   MDRV_CPU_VBLANK_INT( coh1002v_vblank, 1 )
24612489
24622490   MDRV_MACHINE_RESET( coh1002v )
r1679r1680
27562784   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNKNOWN )
27572785
27582786   PORT_START      /* IN2 */
2759   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_OTHER ) PORT_NAME("Test Switch") PORT_CODE(KEYCODE_F2)
2787   PORT_SERVICE_NO_TOGGLE( 0x01, IP_ACTIVE_LOW )
27602788   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_SERVICE1 )
27612789   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_TILT )
27622790   PORT_BIT( 0xf8, IP_ACTIVE_LOW, IPT_UNKNOWN )
src/mame/drivers/megadriv.c
r1679r1680
20262026      if (((megadrive_io_data_regs[portnum]&0x40)==0x00) && ((data&0x40) == 0x40))
20272027      {
20282028         io_stage[portnum]++;
2029         timer_adjust(io_timeout[portnum], ATTOTIME_IN_CYCLES(8192,0), 0, attotime_zero);
2029         timer_adjust_oneshot(io_timeout[portnum], ATTOTIME_IN_CYCLES(8192,0), 0);
20302030      }
20312031
20322032   }
r1679r1680
42594259   {
42604260      genesis_scanline_counter++;
42614261//      mame_printf_debug("scanline %d\n",genesis_scanline_counter);
4262      timer_adjust(scanline_timer, attotime_div(ATTOTIME_IN_HZ(megadriv_framerate), megadrive_total_scanlines), 0, attotime_zero);
4263      timer_adjust(render_timer, ATTOTIME_IN_USEC(1), 0, attotime_zero);
4262      timer_adjust_oneshot(scanline_timer, attotime_div(ATTOTIME_IN_HZ(megadriv_framerate), megadrive_total_scanlines), 0);
4263      timer_adjust_oneshot(render_timer, ATTOTIME_IN_USEC(1), 0);
42644264
42654265      if (genesis_scanline_counter==megadrive_irq6_scanline )
42664266      {
42674267      //  mame_printf_debug("x %d",genesis_scanline_counter);
4268         timer_adjust(irq6_on_timer,  ATTOTIME_IN_USEC(6), 0, attotime_zero);
4268         timer_adjust_oneshot(irq6_on_timer,  ATTOTIME_IN_USEC(6), 0);
42694269         megadrive_irq6_pending = 1;
42704270         megadrive_vblank_flag = 1;
42714271      }
r1679r1680
42924292
42934293            if (MEGADRIVE_REG0_IRQ4_ENABLE)
42944294            {
4295               timer_adjust(irq4_on_timer,  ATTOTIME_IN_USEC(1), 0, attotime_zero);
4295               timer_adjust_oneshot(irq4_on_timer,  ATTOTIME_IN_USEC(1), 0);
42964296               //mame_printf_debug("irq4 on scanline %d reload %d\n",genesis_scanline_counter,MEGADRIVE_REG0A_HINT_VALUE);
42974297            }
42984298         }
r1679r1680
43034303         else irq4counter=MEGADRIVE_REG0A_HINT_VALUE;
43044304      }
43054305
4306      //if (genesis_scanline_counter==0) timer_adjust(irq4_on_timer,  ATTOTIME_IN_USEC(2), 0, attotime_zero);
4306      //if (genesis_scanline_counter==0) timer_adjust_oneshot(irq4_on_timer,  ATTOTIME_IN_USEC(2), 0);
43074307
43084308
43094309
r1679r1680
44064406   irq6_on_timer = timer_alloc(irq6_on_callback, NULL);
44074407   irq4_on_timer = timer_alloc(irq4_on_callback, NULL);
44084408
4409   timer_adjust(frame_timer, attotime_zero, 0, attotime_zero);
4410   timer_adjust(scanline_timer,  attotime_zero, 0, attotime_zero);
4409   timer_adjust_oneshot(frame_timer, attotime_zero, 0);
4410   timer_adjust_oneshot(scanline_timer,  attotime_zero, 0);
44114411
44124412//  set_refresh_rate(megadriv_framerate);
44134413   cpunum_set_clockscale(machine, 0, 0.9950f); /* Fatal Rewind is very fussy... */
r1679r1680
44204420
44214421void megadriv_stop_scanline_timer(void)
44224422{
4423   timer_adjust(scanline_timer,  attotime_never, 0, attotime_never);
4423   timer_adjust_oneshot(scanline_timer,  attotime_never, 0);
44244424}
44254425
44264426/*
r1679r1680
45784578      //mame_printf_debug("---------- framet %d, %08x %08x\n",xxx, (UINT32)(frametime>>32),(UINT32)(frametime&0xffffffff));
45794579   }
45804580
4581   timer_adjust(frame_timer,  attotime_zero, 0, attotime_zero);
4582   timer_adjust(scanline_timer,  attotime_zero, 0, attotime_zero);
4581   timer_adjust_oneshot(frame_timer,  attotime_zero, 0);
4582   timer_adjust_oneshot(scanline_timer,  attotime_zero, 0);
45834583
45844584}
45854585
src/mame/drivers/galpani3.c
r1679r1680
136136   PORT_BIT( 0x0200, IP_ACTIVE_LOW, IPT_START2 )
137137   PORT_BIT( 0x0400, IP_ACTIVE_LOW, IPT_COIN1  ) PORT_IMPULSE(2)
138138   PORT_BIT( 0x0800, IP_ACTIVE_LOW, IPT_COIN2  ) PORT_IMPULSE(2)
139   PORT_BIT( 0x1000, IP_ACTIVE_LOW, IPT_SERVICE  ) PORT_NAME( DEF_STR( Service_Mode )) PORT_CODE(KEYCODE_F2)
139   PORT_SERVICE_NO_TOGGLE( 0x1000, IP_ACTIVE_LOW )
140140   PORT_BIT( 0x2000, IP_ACTIVE_LOW, IPT_TILT     )
141141   PORT_BIT( 0x4000, IP_ACTIVE_LOW, IPT_SERVICE1 )
142142   PORT_BIT( 0x8000, IP_ACTIVE_LOW, IPT_UNUSED   )
src/mame/drivers/malzak.c
r1679r1680
4949extern int malzak_y;
5050
5151extern UINT8* saa5050_vidram;  /* Video RAM for SAA 5050 */
52extern UINT8 *malzak_s2636_0_ram;
53extern UINT8 *malzak_s2636_1_ram;
5254
5355// in video/malzak.c
5456VIDEO_START( malzak );
r1679r1680
6870
6971static READ8_HANDLER( fake_VRLE_r )
7072{
71   return (s2636_1_ram[0xcb] & 0x3f) + (video_screen_get_vblank(0)*0x40);
73   return (malzak_s2636_0_ram[0xcb] & 0x3f) + (video_screen_get_vblank(0)*0x40);
7274}
7375
7476static READ8_HANDLER( ram_mirror_r )
r1679r1680
144146   AM_RANGE(0x1100, 0x11ff) AM_WRITE(MWA8_RAM)
145147   AM_RANGE(0x1200, 0x12ff) AM_WRITE(MWA8_RAM)
146148   AM_RANGE(0x1300, 0x13ff) AM_WRITE(MWA8_RAM)
147   AM_RANGE(0x1400, 0x14ff) AM_WRITE(MWA8_RAM) AM_BASE(&s2636_1_ram)
148   AM_RANGE(0x1500, 0x15ff) AM_WRITE(MWA8_RAM) AM_BASE(&s2636_2_ram)
149   AM_RANGE(0x1400, 0x14ff) AM_WRITE(MWA8_RAM) AM_BASE(&malzak_s2636_0_ram)
150   AM_RANGE(0x1500, 0x15ff) AM_WRITE(MWA8_RAM) AM_BASE(&malzak_s2636_1_ram)
149151   AM_RANGE(0x1600, 0x16ff) AM_WRITE(playfield_w)
150152   AM_RANGE(0x1600, 0x16ff) AM_WRITE(MWA8_RAM)
151153   AM_RANGE(0x1700, 0x17ff) AM_WRITE(MWA8_RAM)
r1679r1680
360362   8 * 10
361363};
362364
363//add s2636 decodes here (i.e. from zac2650) and maybe re-arrange them
365
364366static GFXDECODE_START( malzak )
365367   GFXDECODE_ENTRY( REGION_GFX1, 0x0000, charlayout,         0,  16 )
366     GFXDECODE_ENTRY( REGION_CPU1, 0x0000, s2636_gfx_layout,   0,   8 )   /* s2636 #1  */
367   GFXDECODE_ENTRY( REGION_CPU1, 0x0000, s2636_gfx_layout,   0,   8 )   /* s2636 #2  */
368368   GFXDECODE_ENTRY( REGION_GFX2, 0x0000, saa5050_charlayout, 0, 128 )
369369   GFXDECODE_ENTRY( REGION_GFX2, 0x0000, saa5050_hilayout,   0, 128 )
370370   GFXDECODE_ENTRY( REGION_GFX2, 0x0000, saa5050_lolayout,   0, 128 )
src/mame/drivers/deco32.c
r1679r1680
305305   case 1: /* Raster IRQ scanline position, only valid for values between 1 & 239 (0 and 240-256 do NOT generate IRQ's) */
306306      scanline=(data&0xff);
307307      if (raster_enable && scanline>0 && scanline<240)
308         timer_adjust(raster_irq_timer,video_screen_get_time_until_pos(0, scanline-1, 320),0,attotime_never);
308         timer_adjust_oneshot(raster_irq_timer,video_screen_get_time_until_pos(0, scanline-1, 320),0);
309309      else
310         timer_adjust(raster_irq_timer,attotime_never,0,attotime_zero);
310         timer_adjust_oneshot(raster_irq_timer,attotime_never,0);
311311      break;
312312   case 2: /* VBL irq ack */
313313      break;
r1679r1680
13741374   PORT_BIT( 0x0001, IP_ACTIVE_LOW, IPT_COIN1 )
13751375   PORT_BIT( 0x0002, IP_ACTIVE_LOW, IPT_COIN2 )
13761376   PORT_BIT( 0x0004, IP_ACTIVE_LOW, IPT_SERVICE1 )
1377   PORT_BIT(0x0008, IP_ACTIVE_LOW, IPT_SERVICE ) PORT_NAME( DEF_STR( Service_Mode )) PORT_CODE(KEYCODE_F2)
1377   PORT_SERVICE_NO_TOGGLE( 0x0008, IP_ACTIVE_LOW )
13781378   PORT_BIT( 0x0010, IP_ACTIVE_HIGH, IPT_VBLANK )
13791379   PORT_BIT( 0x0020, IP_ACTIVE_LOW, IPT_UNKNOWN )
13801380   PORT_BIT( 0x0040, IP_ACTIVE_LOW, IPT_UNKNOWN )
r1679r1680
14561456   PORT_START
14571457   PORT_BIT( 0x0001, IP_ACTIVE_LOW, IPT_VBLANK )
14581458   PORT_BIT( 0x0002, IP_ACTIVE_LOW, IPT_UNKNOWN )
1459   PORT_BIT(0x0004, 0x04, IPT_DIPSWITCH_NAME ) PORT_NAME( DEF_STR( Service_Mode )) PORT_TOGGLE PORT_CODE(KEYCODE_F2)
1459   PORT_SERVICE( 0x0004, IP_ACTIVE_LOW )
14601460   PORT_BIT( 0x0008, IP_ACTIVE_LOW, IPT_UNKNOWN ) //check  //test BUTTON F2
14611461   PORT_BIT( 0x0010, IP_ACTIVE_LOW, IPT_UNKNOWN )
14621462   PORT_BIT( 0x0020, IP_ACTIVE_LOW, IPT_UNKNOWN )
r1679r1680
15321532   PORT_START
15331533   PORT_BIT( 0x0001, IP_ACTIVE_LOW, IPT_VBLANK ) //IPT_VBLANK )
15341534   PORT_BIT( 0x0002, IP_ACTIVE_LOW, IPT_UNUSED )
1535   PORT_BIT(0x0004, 0x04, IPT_DIPSWITCH_NAME ) PORT_NAME( DEF_STR( Service_Mode )) PORT_TOGGLE PORT_CODE(KEYCODE_F2)
1536//  PORT_BIT(0x0004, IP_ACTIVE_LOW, IPT_SERVICE ) PORT_NAME( DEF_STR( Service_Mode )) PORT_CODE(KEYCODE_F2)
1535   PORT_SERVICE( 0x0004, IP_ACTIVE_LOW )
15371536   PORT_BIT( 0x00f8, IP_ACTIVE_LOW, IPT_UNUSED ) //check  //test BUTTON F2
15381537
15391538   PORT_START
r1679r1680
15801579   PORT_BIT( 0x0001, IP_ACTIVE_LOW, IPT_COIN1 )
15811580   PORT_BIT( 0x0002, IP_ACTIVE_LOW, IPT_COIN2 )
15821581   PORT_BIT( 0x0004, IP_ACTIVE_LOW, IPT_SERVICE1 )
1583   PORT_BIT(0x0008, IP_ACTIVE_LOW, IPT_SERVICE ) PORT_NAME( DEF_STR( Service_Mode )) PORT_CODE(KEYCODE_F2)
1582   PORT_SERVICE_NO_TOGGLE( 0x0008, IP_ACTIVE_LOW )
15841583   PORT_BIT( 0x0010, IP_ACTIVE_LOW, IPT_VBLANK )
15851584   PORT_BIT( 0x0020, IP_ACTIVE_LOW, IPT_UNUSED ) /* 'soundmask' */
15861585   PORT_BIT( 0x0040, IP_ACTIVE_LOW, IPT_UNUSED )
r1679r1680
16181617   PORT_BIT( 0x0001, IP_ACTIVE_LOW, IPT_COIN1 )
16191618   PORT_BIT( 0x0002, IP_ACTIVE_LOW, IPT_COIN2 )
16201619   PORT_BIT( 0x0004, IP_ACTIVE_LOW, IPT_SERVICE1 )
1621   PORT_BIT( 0x0008, IP_ACTIVE_LOW, IPT_SERVICE ) PORT_NAME( DEF_STR( Service_Mode )) PORT_CODE(KEYCODE_F2)
1620   PORT_SERVICE_NO_TOGGLE( 0x0008, IP_ACTIVE_LOW )
16221621   PORT_BIT( 0x0010, IP_ACTIVE_HIGH, IPT_VBLANK )
16231622   PORT_BIT( 0x0020, IP_ACTIVE_LOW, IPT_UNUSED ) /* 'soundmask' */
16241623   PORT_BIT( 0x0040, IP_ACTIVE_LOW, IPT_UNUSED )
src/mame/drivers/midzeus.c
r1679r1680
432432   {
433433      int which = (offset >> 4) & 1;
434434      if (data & 0x40)
435         timer_adjust(timer[which], attotime_never, 0, attotime_never);
435         timer_adjust_oneshot(timer[which], attotime_never, 0);
436436   }
437437   else
438438      logerror("%06X:tms32031_control_w(%02X) = %08X\n", activecpu_get_pc(), offset, data);
r1679r1680
526526   /* generate another interrupt on the next scanline while we are within the BEAM_DY */
527527   beamy++;
528528   if (beamy <= machine->screen[0].visarea.max_y && beamy <= gun_y[player] + BEAM_DY)
529      timer_adjust(gun_timer[player], video_screen_get_time_until_pos(0, beamy, MAX(0, gun_x[player] - BEAM_DX)), player, attotime_never);
529      timer_adjust_oneshot(gun_timer[player], video_screen_get_time_until_pos(0, beamy, MAX(0, gun_x[player] - BEAM_DX)), player);
530530}
531531
532532
r1679r1680
555555         };
556556         gun_x[player] = readinputportbytag(names[player][0]) * (visarea->max_x + 1 - visarea->min_x) / 255 + visarea->min_x + BEAM_XOFFS;
557557         gun_y[player] = readinputportbytag(names[player][1]) * (visarea->max_y + 1 - visarea->min_y) / 255 + visarea->min_y;
558         timer_adjust(gun_timer[player], video_screen_get_time_until_pos(0, MAX(0, gun_y[player] - BEAM_DY), MAX(0, gun_x[player] - BEAM_DX)), player, attotime_never);
558         timer_adjust_oneshot(gun_timer[player], video_screen_get_time_until_pos(0, MAX(0, gun_y[player] - BEAM_DY), MAX(0, gun_x[player] - BEAM_DX)), player);
559559      }
560560   }
561561}
r1679r1680
724724   PORT_BIT( 0x0002, IP_ACTIVE_LOW, IPT_COIN2 )
725725   PORT_BIT( 0x0004, IP_ACTIVE_LOW, IPT_START1 )
726726   PORT_BIT( 0x0008, IP_ACTIVE_LOW, IPT_TILT ) /* Slam Switch */
727   PORT_BIT( 0x0010, IP_ACTIVE_LOW, IPT_SERVICE) PORT_NAME(DEF_STR( Service_Mode )) PORT_CODE(KEYCODE_F2)
727   PORT_SERVICE_NO_TOGGLE( 0x0010, IP_ACTIVE_LOW )
728728   PORT_BIT( 0x0020, IP_ACTIVE_LOW, IPT_START2 )
729729   PORT_BIT( 0x0040, IP_ACTIVE_LOW, IPT_SERVICE1 )
730730   PORT_BIT( 0x0080, IP_ACTIVE_LOW, IPT_COIN3 )
r1679r1680
829829   PORT_BIT( 0x0002, IP_ACTIVE_LOW, IPT_COIN2 )
830830   PORT_BIT( 0x0004, IP_ACTIVE_LOW, IPT_START1 )
831831   PORT_BIT( 0x0008, IP_ACTIVE_LOW, IPT_TILT ) /* Slam Switch */
832   PORT_BIT( 0x0010, IP_ACTIVE_LOW, IPT_SERVICE) PORT_NAME(DEF_STR( Service_Mode )) PORT_CODE(KEYCODE_F2)
832   PORT_SERVICE_NO_TOGGLE( 0x0010, IP_ACTIVE_LOW )
833833   PORT_BIT( 0x0020, IP_ACTIVE_LOW, IPT_START2 )
834834   PORT_BIT( 0x0040, IP_ACTIVE_LOW, IPT_SERVICE1 )
835835   PORT_BIT( 0x0080, IP_ACTIVE_LOW, IPT_COIN3 )
r1679r1680
926926   PORT_BIT( 0x0002, IP_ACTIVE_LOW, IPT_COIN2 )
927927   PORT_BIT( 0x0004, IP_ACTIVE_LOW, IPT_START1 )
928928   PORT_BIT( 0x0008, IP_ACTIVE_LOW, IPT_TILT ) /* Slam Switch */
929   PORT_BIT( 0x0010, IP_ACTIVE_LOW, IPT_SERVICE) PORT_NAME(DEF_STR( Service_Mode )) PORT_CODE(KEYCODE_F2)
929   PORT_SERVICE_NO_TOGGLE( 0x0010, IP_ACTIVE_LOW )
930930   PORT_BIT( 0x0020, IP_ACTIVE_LOW, IPT_START2 )
931931   PORT_BIT( 0x0040, IP_ACTIVE_LOW, IPT_SERVICE1 )
932932   PORT_BIT( 0x0080, IP_ACTIVE_LOW, IPT_COIN3 )
r1679r1680
10621062   PORT_BIT( 0x0002, IP_ACTIVE_LOW, IPT_COIN2 )
10631063   PORT_BIT( 0x0004, IP_ACTIVE_LOW, IPT_START1 )
10641064   PORT_BIT( 0x0008, IP_ACTIVE_LOW, IPT_TILT ) /* Slam Switch */
1065   PORT_BIT( 0x0010, IP_ACTIVE_LOW, IPT_SERVICE) PORT_NAME(DEF_STR( Service_Mode )) PORT_CODE(KEYCODE_F2)
1065   PORT_SERVICE_NO_TOGGLE( 0x0010, IP_ACTIVE_LOW )
10661066   PORT_BIT( 0x0020, IP_ACTIVE_LOW, IPT_START2 )
10671067   PORT_BIT( 0x0040, IP_ACTIVE_LOW, IPT_SERVICE1 )
10681068   PORT_BIT( 0x0080, IP_ACTIVE_LOW, IPT_COIN3 )
src/mame/drivers/drw80pkr.c
r1679r1680
2929#include "driver.h"
3030#include "sound/ay8910.h"
3131#include "cpu/i8039/i8039.h"
32#include "video/crtc6845.h"
3332
3433static tilemap *bg_tilemap;
3534
r1679r1680
108107
109108static VIDEO_START( drw80pkr )
110109{
111   bg_tilemap = tilemap_create(get_bg_tile_info, tilemap_scan_rows, TILEMAP_TYPE_PEN, 8, 8, 40, 25);
110   bg_tilemap = tilemap_create(get_bg_tile_info, tilemap_scan_rows, 8, 8, 40, 25);
112111}
113112
114113static VIDEO_UPDATE( drw80pkr )
src/mame/drivers/superdq.c
r1679r1680
5555
5656static VIDEO_START( superdq )
5757{
58   superdq_tilemap = tilemap_create(get_tile_info,tilemap_scan_rows,TILEMAP_TYPE_PEN, 8, 8, 32, 32);
58   superdq_tilemap = tilemap_create(get_tile_info,tilemap_scan_rows, 8, 8, 32, 32);
5959
6060   add_exit_callback(machine, video_cleanup);
6161}
src/mame/drivers/bestleag.c
r1679r1680
7171
7272static VIDEO_START(bestleag)
7373{
74   tx_tilemap = tilemap_create(get_tx_tile_info,tilemap_scan_cols,TILEMAP_TYPE_PEN,8,8,256, 32);
75   bg_tilemap = tilemap_create(get_bg_tile_info,bsb_bg_scan,TILEMAP_TYPE_PEN,16,16,128, 64);
76   fg_tilemap = tilemap_create(get_fg_tile_info,bsb_bg_scan,TILEMAP_TYPE_PEN,16,16,128, 64);
74   tx_tilemap = tilemap_create(get_tx_tile_info,tilemap_scan_cols,8,8,256, 32);
75   bg_tilemap = tilemap_create(get_bg_tile_info,bsb_bg_scan,16,16,128, 64);
76   fg_tilemap = tilemap_create(get_fg_tile_info,bsb_bg_scan,16,16,128, 64);
7777
7878   tilemap_set_transparent_pen(tx_tilemap,15);
7979   tilemap_set_transparent_pen(fg_tilemap,15);
src/mame/drivers/aleck64.c
r1679r1680
288288
289289   PORT_START
290290      PORT_BIT( 0xff00ffff, IP_ACTIVE_LOW, IPT_UNUSED )
291      PORT_BIT( 0x00200000, IP_ACTIVE_LOW, IPT_SERVICE ) PORT_NAME( DEF_STR( Service_Mode )) PORT_CODE(KEYCODE_F2)
291      PORT_SERVICE_NO_TOGGLE( 0x00200000, IP_ACTIVE_LOW )
292292      PORT_BIT( 0x00100000, IP_ACTIVE_LOW, IPT_SERVICE ) PORT_NAME("Service Button") PORT_CODE(KEYCODE_7)
293293      PORT_BIT( 0x00080000, IP_ACTIVE_LOW, IPT_COIN2 )
294294      PORT_BIT( 0x00040000, IP_ACTIVE_LOW, IPT_COIN1 )
r1679r1680
321321
322322   PORT_START
323323      PORT_BIT( 0xffcc, IP_ACTIVE_LOW, IPT_UNUSED )
324      PORT_BIT( 0x0020, IP_ACTIVE_LOW, IPT_SERVICE ) PORT_NAME( DEF_STR( Service_Mode )) PORT_CODE(KEYCODE_F2)
324      PORT_SERVICE_NO_TOGGLE( 0x0020, IP_ACTIVE_LOW )
325325      PORT_BIT( 0x0010, IP_ACTIVE_LOW, IPT_SERVICE ) PORT_NAME("Service Button") PORT_CODE(KEYCODE_7)
326326      PORT_BIT( 0x0002, IP_ACTIVE_LOW, IPT_COIN2 )
327327      PORT_BIT( 0x0001, IP_ACTIVE_LOW, IPT_COIN1 )
r1679r1680
401401
402402   PORT_START
403403      PORT_BIT( 0xff00ffff, IP_ACTIVE_LOW, IPT_UNUSED )
404      PORT_BIT( 0x00200000, IP_ACTIVE_LOW, IPT_SERVICE ) PORT_NAME( DEF_STR( Service_Mode )) PORT_CODE(KEYCODE_F2)
404      PORT_SERVICE_NO_TOGGLE( 0x00200000, IP_ACTIVE_LOW )
405405      PORT_BIT( 0x00100000, IP_ACTIVE_LOW, IPT_SERVICE ) PORT_NAME("Service Button") PORT_CODE(KEYCODE_7)
406406      PORT_BIT( 0x00080000, IP_ACTIVE_LOW, IPT_COIN2 )
407407      PORT_BIT( 0x00040000, IP_ACTIVE_LOW, IPT_COIN1 )
src/mame/drivers/trackfld.c
r1679r1680
2525#include "sound/msm5205.h"
2626
2727
28extern void konami1_decode(void);
29extern UINT8 konami1_decodebyte( UINT8 opcode, UINT16 address );
28void konami1_decode(void);
29UINT8 konami1_decodebyte( UINT8 opcode, UINT16 address );
3030
3131
3232extern UINT8 *trackfld_scroll;
3333extern UINT8 *trackfld_scroll2;
3434
35extern WRITE8_HANDLER( trackfld_videoram_w );
36extern WRITE8_HANDLER( trackfld_colorram_w );
37extern WRITE8_HANDLER( trackfld_flipscreen_w );
38extern WRITE8_HANDLER( atlantol_gfxbank_w );
35WRITE8_HANDLER( trackfld_videoram_w );
36WRITE8_HANDLER( trackfld_colorram_w );
37WRITE8_HANDLER( trackfld_flipscreen_w );
38WRITE8_HANDLER( atlantol_gfxbank_w );
3939
40extern PALETTE_INIT( trackfld );
41extern VIDEO_START( trackfld );
42extern VIDEO_UPDATE( trackfld );
40PALETTE_INIT( trackfld );
41VIDEO_START( trackfld );
42VIDEO_UPDATE( trackfld );
4343
44extern WRITE8_HANDLER( konami_sh_irqtrigger_w );
45extern READ8_HANDLER( trackfld_sh_timer_r );
46extern READ8_HANDLER( trackfld_speech_r );
47extern WRITE8_HANDLER( trackfld_sound_w );
48extern READ8_HANDLER( hyprolyb_speech_r );
49extern WRITE8_HANDLER( hyprolyb_ADPCM_data_w );
44WRITE8_HANDLER( konami_sh_irqtrigger_w );
45READ8_HANDLER( trackfld_sh_timer_r );
46READ8_HANDLER( trackfld_speech_r );
47WRITE8_HANDLER( trackfld_sound_w );
48READ8_HANDLER( hyprolyb_speech_r );
49WRITE8_HANDLER( hyprolyb_ADPCM_data_w );
5050
5151/*
5252 Track'n'Field has 1k of battery backed RAM which can be erased by setting a dipswitch
r1679r1680
839839};
840840
841841static GFXDECODE_START( trackfld )
842   GFXDECODE_ENTRY( REGION_GFX1, 0, charlayout,       0, 16 )
843   GFXDECODE_ENTRY( REGION_GFX2, 0, spritelayout, 16*16, 16 )
842   GFXDECODE_ENTRY( REGION_GFX1, 0, spritelayout,     0, 16 )
843   GFXDECODE_ENTRY( REGION_GFX2, 0, charlayout,   16*16, 16 )
844844GFXDECODE_END
845845
846846
r1679r1680
880880   MDRV_SCREEN_SIZE(32*8, 32*8)
881881   MDRV_SCREEN_VISIBLE_AREA(0*8, 32*8-1, 2*8, 30*8-1)
882882   MDRV_GFXDECODE(trackfld)
883   MDRV_PALETTE_LENGTH(32)
884   MDRV_COLORTABLE_LENGTH(16*16+16*16)
883   MDRV_PALETTE_LENGTH(16*16+16*16)
885884
886885   MDRV_PALETTE_INIT(trackfld)
887886   MDRV_VIDEO_START(trackfld)
r1679r1680
925924   MDRV_SCREEN_SIZE(32*8, 32*8)
926925   MDRV_SCREEN_VISIBLE_AREA(0*8, 32*8-1, 2*8, 30*8-1)
927926   MDRV_GFXDECODE(trackfld)
928   MDRV_PALETTE_LENGTH(32)
929   MDRV_COLORTABLE_LENGTH(16*16+16*16)
927   MDRV_PALETTE_LENGTH(16*16+16*16)
930928
931929   MDRV_PALETTE_INIT(trackfld)
932930   MDRV_VIDEO_START(trackfld)
r1679r1680
997995   ROM_REGION( 0x10000, REGION_CPU2, 0 )
998996   ROM_LOAD( "c2_d13.bin",   0x0000, 0x2000, CRC(95bf79b6) SHA1(ea9135acd7ad162c19c5cdde356e69792d61b675) )
999997
1000   ROM_REGION( 0x6000, REGION_GFX1, ROMREGION_DISPOSE )
1001   ROM_LOAD( "h16_e12.bin",  0x0000, 0x2000, CRC(50075768) SHA1(dfff92c0f59dd3d8d3d6256944bfd48792cef6a9) )
1002   ROM_LOAD( "h15_e11.bin",  0x2000, 0x2000, CRC(dda9e29f) SHA1(0f41cde82bb60c3f1591ee14dc3cff4642bbddc1) )
1003   ROM_LOAD( "h14_e10.bin",  0x4000, 0x2000, CRC(c2166a5c) SHA1(5ba25900e653ce4edcf35f1fbce758a327a715ce) )
1004
1005   ROM_REGION( 0x8000, REGION_GFX2, ROMREGION_DISPOSE )
998   ROM_REGION( 0x8000, REGION_GFX1, ROMREGION_DISPOSE )
1006999   ROM_LOAD( "c11_d06.bin",  0x0000, 0x2000, CRC(82e2185a) SHA1(1da9ea20e7af0b49c62fb39834a7ec686491af04) )
10071000   ROM_LOAD( "c12_d07.bin",  0x2000, 0x2000, CRC(800ff1f1) SHA1(33d73b18903e3e6bfb30f1a06db4b8105d4040d8) )
10081001   ROM_LOAD( "c13_d08.bin",  0x4000, 0x2000, CRC(d9faf183) SHA1(4448b6242790783d37acf50704d597af5878c2ab) )
10091002   ROM_LOAD( "c14_d09.bin",  0x6000, 0x2000, CRC(5886c802) SHA1(884a12a8f63600da4f23b29be6dbaacef37add20) )
10101003
1004   ROM_REGION( 0x6000, REGION_GFX2, ROMREGION_DISPOSE )
1005   ROM_LOAD( "h16_e12.bin",  0x0000, 0x2000, CRC(50075768) SHA1(dfff92c0f59dd3d8d3d6256944bfd48792cef6a9) )
1006   ROM_LOAD( "h15_e11.bin",  0x2000, 0x2000, CRC(dda9e29f) SHA1(0f41cde82bb60c3f1591ee14dc3cff4642bbddc1) )
1007   ROM_LOAD( "h14_e10.bin",  0x4000, 0x2000, CRC(c2166a5c) SHA1(5ba25900e653ce4edcf35f1fbce758a327a715ce) )
1008
10111009   ROM_REGION( 0x0220, REGION_PROMS, 0 )
10121010   ROM_LOAD( "361b16.f1",    0x0000, 0x0020, CRC(d55f30b5) SHA1(4d6a851f4886778307f75771645078b97ad55f5f) ) /* palette */
10131011   ROM_LOAD( "361b17.b16",   0x0020, 0x0100, CRC(d2ba4d32) SHA1(894b5cedf01ba9225a0d6215291857e455b84903) ) /* sprite lookup table */
r1679r1680
10281026   ROM_REGION( 0x10000, REGION_CPU2, 0 )
10291027   ROM_LOAD( "c2_d13.bin",   0x0000, 0x2000, CRC(95bf79b6) SHA1(ea9135acd7ad162c19c5cdde356e69792d61b675) )
10301028
1031   ROM_REGION( 0x6000, REGION_GFX1, ROMREGION_DISPOSE )
1032   ROM_LOAD( "h16_e12.bin",  0x0000, 0x2000, CRC(50075768) SHA1(dfff92c0f59dd3d8d3d6256944bfd48792cef6a9) )
1033   ROM_LOAD( "h15_e11.bin",  0x2000, 0x2000, CRC(dda9e29f) SHA1(0f41cde82bb60c3f1591ee14dc3cff4642bbddc1) )
1034   ROM_LOAD( "h14_e10.bin",  0x4000, 0x2000, CRC(c2166a5c) SHA1(5ba25900e653ce4edcf35f1fbce758a327a715ce) )
1035
1036   ROM_REGION( 0x8000, REGION_GFX2, ROMREGION_DISPOSE )
1029   ROM_REGION( 0x8000, REGION_GFX1, ROMREGION_DISPOSE )
10371030   ROM_LOAD( "c11_d06.bin",  0x0000, 0x2000, CRC(82e2185a) SHA1(1da9ea20e7af0b49c62fb39834a7ec686491af04) )
10381031   ROM_LOAD( "c12_d07.bin",  0x2000, 0x2000, CRC(800ff1f1) SHA1(33d73b18903e3e6bfb30f1a06db4b8105d4040d8) )
10391032   ROM_LOAD( "c13_d08.bin",  0x4000, 0x2000, CRC(d9faf183) SHA1(4448b6242790783d37acf50704d597af5878c2ab) )
10401033   ROM_LOAD( "c14_d09.bin",  0x6000, 0x2000, CRC(5886c802) SHA1(884a12a8f63600da4f23b29be6dbaacef37add20) )
10411034
1035   ROM_REGION( 0x6000, REGION_GFX2, ROMREGION_DISPOSE )
1036   ROM_LOAD( "h16_e12.bin",  0x0000, 0x2000, CRC(50075768) SHA1(dfff92c0f59dd3d8d3d6256944bfd48792cef6a9) )
1037   ROM_LOAD( "h15_e11.bin",  0x2000, 0x2000, CRC(dda9e29f) SHA1(0f41cde82bb60c3f1591ee14dc3cff4642bbddc1) )
1038   ROM_LOAD( "h14_e10.bin",  0x4000, 0x2000, CRC(c2166a5c) SHA1(5ba25900e653ce4edcf35f1fbce758a327a715ce) )
1039
10421040   ROM_REGION( 0x0220, REGION_PROMS, 0 )
10431041   ROM_LOAD( "361b16.f1",    0x0000, 0x0020, CRC(d55f30b5) SHA1(4d6a851f4886778307f75771645078b97ad55f5f) ) /* palette */
10441042   ROM_LOAD( "361b17.b16",   0x0020, 0x0100, CRC(d2ba4d32) SHA1(894b5cedf01ba9225a0d6215291857e455b84903) ) /* sprite lookup table */
r1679r1680
10591057   ROM_REGION( 0x10000, REGION_CPU2, 0 )
10601058   ROM_LOAD( "c2_d13.bin",   0x0000, 0x2000, CRC(95bf79b6) SHA1(ea9135acd7ad162c19c5cdde356e69792d61b675) ) /* 361-d13.c03 */
10611059
1062   ROM_REGION( 0x6000, REGION_GFX1, ROMREGION_DISPOSE )
1063   ROM_LOAD( "361-d12.h16", 0x0000, 0x2000, CRC(768bb63d) SHA1(effc46615c389245e5a4aac18292e1d764ff0e46) )
1064   ROM_LOAD( "361-d11.h15", 0x2000, 0x2000, CRC(3af0e2a8) SHA1(450f35fd7e45ecc88ee80bf57499b2e9f06f6487) )
1065   ROM_LOAD( "h14_e10.bin",  0x4000, 0x2000, CRC(c2166a5c) SHA1(5ba25900e653ce4edcf35f1fbce758a327a715ce) ) /* 361-d10.h14 */
1066
1067   ROM_REGION( 0x8000, REGION_GFX2, ROMREGION_DISPOSE )
1060   ROM_REGION( 0x8000, REGION_GFX1, ROMREGION_DISPOSE )
10681061   ROM_LOAD( "c11_d06.bin",  0x0000, 0x2000, CRC(82e2185a) SHA1(1da9ea20e7af0b49c62fb39834a7ec686491af04) ) /* 361-d06.c11 */
10691062   ROM_LOAD( "c12_d07.bin",  0x2000, 0x2000, CRC(800ff1f1) SHA1(33d73b18903e3e6bfb30f1a06db4b8105d4040d8) ) /* 361-d07.c12 */
10701063   ROM_LOAD( "c13_d08.bin",  0x4000, 0x2000, CRC(d9faf183) SHA1(4448b6242790783d37acf50704d597af5878c2ab) ) /* 361-d08.c13 */
10711064   ROM_LOAD( "c14_d09.bin",  0x6000, 0x2000, CRC(5886c802) SHA1(884a12a8f63600da4f23b29be6dbaacef37add20) ) /* 361-d09.c14 */
10721065
1066   ROM_REGION( 0x6000, REGION_GFX2, ROMREGION_DISPOSE )
1067   ROM_LOAD( "361-d12.h16", 0x0000, 0x2000, CRC(768bb63d) SHA1(effc46615c389245e5a4aac18292e1d764ff0e46) )
1068   ROM_LOAD( "361-d11.h15", 0x2000, 0x2000, CRC(3af0e2a8) SHA1(450f35fd7e45ecc88ee80bf57499b2e9f06f6487) )
1069   ROM_LOAD( "h14_e10.bin",  0x4000, 0x2000, CRC(c2166a5c) SHA1(5ba25900e653ce4edcf35f1fbce758a327a715ce) ) /* 361-d10.h14 */
1070
10731071   ROM_REGION( 0x0220, REGION_PROMS, 0 ) /* Prom names = 361-b16.f01 / 361-b17.b16 / 361-b18.e15 */
10741072   ROM_LOAD( "361b16.f1",    0x0000, 0x0020, CRC(d55f30b5) SHA1(4d6a851f4886778307f75771645078b97ad55f5f) ) /* palette */
10751073   ROM_LOAD( "361b17.b16",   0x0020, 0x0100, CRC(d2ba4d32) SHA1(894b5cedf01ba9225a0d6215291857e455b84903) ) /* sprite lookup table */
r1679r1680
10981096   ROM_LOAD( "2764.3",       0xc000, 0x2000, CRC(c3ec42e1) SHA1(048a95726c4f031552e629c3788952c1bc5e7251) )
10991097   ROM_LOAD( "2764.4",       0xe000, 0x2000, CRC(76998389) SHA1(499189b0e20296af88712199b93b958655083608) )
11001098
1101   ROM_REGION( 0x6000, REGION_GFX1, ROMREGION_DISPOSE )
1102   ROM_LOAD( "361-d12.h16", 0x0000, 0x2000, CRC(768bb63d) SHA1(effc46615c389245e5a4aac18292e1d764ff0e46) )
1103   ROM_LOAD( "361-d11.h15", 0x2000, 0x2000, CRC(3af0e2a8) SHA1(450f35fd7e45ecc88ee80bf57499b2e9f06f6487) )
1104   ROM_LOAD( "h14_e10.bin",  0x4000, 0x2000, CRC(c2166a5c) SHA1(5ba25900e653ce4edcf35f1fbce758a327a715ce) )
1105
1106   ROM_REGION( 0x8000, REGION_GFX2, ROMREGION_DISPOSE )
1099   ROM_REGION( 0x8000, REGION_GFX1, ROMREGION_DISPOSE )
11071100   ROM_LOAD( "c11_d06.bin",  0x0000, 0x2000, CRC(82e2185a) SHA1(1da9ea20e7af0b49c62fb39834a7ec686491af04) )
11081101   ROM_LOAD( "c12_d07.bin",  0x2000, 0x2000, CRC(800ff1f1) SHA1(33d73b18903e3e6bfb30f1a06db4b8105d4040d8) )
11091102   ROM_LOAD( "c13_d08.bin",  0x4000, 0x2000, CRC(d9faf183) SHA1(4448b6242790783d37acf50704d597af5878c2ab) )
11101103   ROM_LOAD( "c14_d09.bin",  0x6000, 0x2000, CRC(5886c802) SHA1(884a12a8f63600da4f23b29be6dbaacef37add20) )
11111104
1105   ROM_REGION( 0x6000, REGION_GFX2, ROMREGION_DISPOSE )
1106   ROM_LOAD( "361-d12.h16", 0x0000, 0x2000, CRC(768bb63d) SHA1(effc46615c389245e5a4aac18292e1d764ff0e46) )
1107   ROM_LOAD( "361-d11.h15", 0x2000, 0x2000, CRC(3af0e2a8) SHA1(450f35fd7e45ecc88ee80bf57499b2e9f06f6487) )
1108   ROM_LOAD( "h14_e10.bin",  0x4000, 0x2000, CRC(c2166a5c) SHA1(5ba25900e653ce4edcf35f1fbce758a327a715ce) )
1109
11121110   ROM_REGION( 0x0220, REGION_PROMS, 0 )
11131111   ROM_LOAD( "361b16.f1",    0x0000, 0x0020, CRC(d55f30b5) SHA1(4d6a851f4886778307f75771645078b97ad55f5f) ) /* palette */
11141112   ROM_LOAD( "361b17.b16",   0x0020, 0x0100, CRC(d2ba4d32) SHA1(894b5cedf01ba9225a0d6215291857e455b84903) ) /* sprite lookup table */
r1679r1680
11301128   ROM_LOAD( "atl36", 0x00000, 0x10000, CRC(0bae8489) SHA1(fbaeac99733f9c46b0b8d9a601c57df4004e2044) )
11311129   ROM_CONTINUE(      0x00000, 0x10000 )
11321130
1133   ROM_REGION( 0x20000, REGION_GFX1, ROMREGION_DISPOSE )
1134   ROM_LOAD( "atl40", 0x00000, 0x20000, CRC(c915f53a) SHA1(5983fa68f8a494fe0c71e8dae79b45eee178bbcd) )
1135
1136   ROM_REGION( 0x40000, REGION_GFX2, ROMREGION_DISPOSE )
1131   ROM_REGION( 0x40000, REGION_GFX1, ROMREGION_DISPOSE )
11371132   ROM_LOAD( "atl38", 0x00000, 0x20000, CRC(dbbcbcda) SHA1(df84fd73425bac2dcde0b650369ed1ff105f729f) )
11381133   ROM_LOAD( "atl39", 0x20000, 0x20000, CRC(d08f067f) SHA1(077446bf3269dba2881e745434f1581f3a901d99) )
11391134
1135   ROM_REGION( 0x20000, REGION_GFX2, ROMREGION_DISPOSE )
1136   ROM_LOAD( "atl40", 0x00000, 0x20000, CRC(c915f53a) SHA1(5983fa68f8a494fe0c71e8dae79b45eee178bbcd) )
1137
11401138   ROM_REGION( 0x0220, REGION_PROMS, 0 )
11411139   ROM_LOAD( "361b16.f1",    0x0000, 0x0020, CRC(d55f30b5) SHA1(4d6a851f4886778307f75771645078b97ad55f5f) ) /* palette */
11421140   ROM_LOAD( "361b17.b16",   0x0020, 0x0100, CRC(d2ba4d32) SHA1(894b5cedf01ba9225a0d6215291857e455b84903) ) /* sprite lookup table */
r1679r1680
11521150   ROM_REGION( 0x10000, REGION_CPU2, 0 )
11531151   ROM_LOAD( "mk1",          0x0000, 0x2000, CRC(95bf79b6) SHA1(ea9135acd7ad162c19c5cdde356e69792d61b675) )
11541152
1155   ROM_REGION( 0x6000, REGION_GFX1, ROMREGION_DISPOSE )
1156   ROM_LOAD( "mk12",         0x0000, 0x2000, CRC(8b1a19cf) SHA1(9f75f69828eeaeb2d0dcf20fb80425546124b21e) )
1157   ROM_LOAD( "mk11",         0x2000, 0x2000, CRC(1a56d24d) SHA1(e64b8a9bdbcf6d2d583ded0750d5f48721785459) )
1158   ROM_LOAD( "mk10",         0x4000, 0x2000, CRC(e7d05634) SHA1(e7532749fe9b955ba221517807888b34a7754db7) )
1159
1160   ROM_REGION( 0x8000, REGION_GFX2, ROMREGION_DISPOSE )
1153   ROM_REGION( 0x8000, REGION_GFX1, ROMREGION_DISPOSE )
11611154   ROM_LOAD( "mk6",          0x0000, 0x2000, CRC(18fbe047) SHA1(d2c6aeb1dfd9751f4db386944d144e293001b497) )
11621155   ROM_LOAD( "mk7",          0x2000, 0x2000, CRC(47dee791) SHA1(9c2d5c2ef1e2e8f329160a1c536119b078803347) )
11631156   ROM_LOAD( "mk8",          0x4000, 0x2000, CRC(9c091ead) SHA1(fce50c9d260f20873289921926bd632d6d49ef15) )
11641157   ROM_LOAD( "mk9",          0x6000, 0x2000, CRC(5c8ed3fe) SHA1(a878fcd547aad5388fef9fe2825c1122444c216d) )
11651158
1159   ROM_REGION( 0x6000, REGION_GFX2, ROMREGION_DISPOSE )
1160   ROM_LOAD( "mk12",         0x0000, 0x2000, CRC(8b1a19cf) SHA1(9f75f69828eeaeb2d0dcf20fb80425546124b21e) )
1161   ROM_LOAD( "mk11",         0x2000, 0x2000, CRC(1a56d24d) SHA1(e64b8a9bdbcf6d2d583ded0750d5f48721785459) )
1162   ROM_LOAD( "mk10",         0x4000, 0x2000, CRC(e7d05634) SHA1(e7532749fe9b955ba221517807888b34a7754db7) )
1163
11661164   ROM_REGION( 0x0220, REGION_PROMS, 0 )
11671165   ROM_LOAD( "prom.1",       0x0000, 0x0020, NO_DUMP ) /* palette */
11681166   ROM_LOAD( "prom.3",       0x0020, 0x0100, NO_DUMP ) /* sprite lookup table */
r1679r1680
11971195   ROM_REGION( 0x10000, REGION_CPU2, 0 )
11981196   ROM_LOAD( "zandz.2c",     0x0000, 0x2000, CRC(3daca93a) SHA1(743c2b787aeb2c893ea476efc95d92e33b9bd159) )
11991197
1200   ROM_REGION( 0x6000, REGION_GFX1, ROMREGION_DISPOSE )
1198   ROM_REGION( 0x4000, REGION_GFX1, ROMREGION_DISPOSE )
1199   ROM_LOAD( "rom.11c",      0x0000, 0x2000, CRC(87d060d4) SHA1(22da2dfaf71d78a4789ca34c27571733ab65ea30) )
1200   ROM_LOAD( "rom.14c",      0x2000, 0x2000, CRC(5bff1607) SHA1(20c4b74c93511f9cafd6e3f2d048baad3a3a8aa4) )
1201
1202   ROM_REGION( 0x6000, REGION_GFX2, ROMREGION_DISPOSE )
12011203   ROM_LOAD( "rom.16h",      0x0000, 0x2000, CRC(e6728bda) SHA1(8bd029af5136b0ed6c0087989c69f0b1c23305fb) )
12021204   ROM_LOAD( "rom.15h",      0x2000, 0x2000, CRC(9c067ef4) SHA1(2a66beee4fa76d40ca18637c0061b196d3873df3) )
12031205   ROM_LOAD( "rom.14h",      0x4000, 0x2000, CRC(3bbad920) SHA1(f5c491f37aa6855181c62fe6bb2975c7d011cc72) )
12041206
1205   ROM_REGION( 0x4000, REGION_GFX2, ROMREGION_DISPOSE )
1206   ROM_LOAD( "rom.11c",      0x0000, 0x2000, CRC(87d060d4) SHA1(22da2dfaf71d78a4789ca34c27571733ab65ea30) )
1207   ROM_LOAD( "rom.14c",      0x2000, 0x2000, CRC(5bff1607) SHA1(20c4b74c93511f9cafd6e3f2d048baad3a3a8aa4) )
1208
12091207   ROM_REGION( 0x0220, REGION_PROMS, 0 )
12101208   ROM_LOAD( "361b16.f1",    0x0000, 0x0020, CRC(d55f30b5) SHA1(4d6a851f4886778307f75771645078b97ad55f5f) ) /* palette */
12111209   ROM_LOAD( "361b17.b16",   0x0020, 0x0100, CRC(d2ba4d32) SHA1(894b5cedf01ba9225a0d6215291857e455b84903) ) /* sprite lookup table */
r1679r1680
12401238   ROM_REGION( 0x10000, REGION_CPU2, 0 )
12411239   ROM_LOAD( "02c.bin",      0x0000, 0x2000, CRC(3daca93a) SHA1(743c2b787aeb2c893ea476efc95d92e33b9bd159) )
12421240
1243   ROM_REGION( 0x6000, REGION_GFX1, ROMREGION_DISPOSE )
1241   ROM_REGION( 0x4000, REGION_GFX1, ROMREGION_DISPOSE )
1242   ROM_LOAD( "11c.bin",      0x0000, 0x2000, CRC(87d060d4) SHA1(22da2dfaf71d78a4789ca34c27571733ab65ea30) )
1243   ROM_LOAD( "14c.bin",      0x2000, 0x2000, CRC(5bff1607) SHA1(20c4b74c93511f9cafd6e3f2d048baad3a3a8aa4) )
1244
1245   ROM_REGION( 0x6000, REGION_GFX2, ROMREGION_DISPOSE )
12441246   ROM_LOAD( "16h.bin",      0x0000, 0x2000, CRC(e6728bda) SHA1(8bd029af5136b0ed6c0087989c69f0b1c23305fb) )
12451247   ROM_LOAD( "15h.bin",      0x2000, 0x2000, CRC(9c067ef4) SHA1(2a66beee4fa76d40ca18637c0061b196d3873df3) )
12461248   ROM_LOAD( "14h.bin",      0x4000, 0x2000, CRC(3bbad920) SHA1(f5c491f37aa6855181c62fe6bb2975c7d011cc72) )
12471249
1248   ROM_REGION( 0x4000, REGION_GFX2, ROMREGION_DISPOSE )
1249   ROM_LOAD( "11c.bin",      0x0000, 0x2000, CRC(87d060d4) SHA1(22da2dfaf71d78a4789ca34c27571733ab65ea30) )
1250   ROM_LOAD( "14c.bin",      0x2000, 0x2000, CRC(5bff1607) SHA1(20c4b74c93511f9cafd6e3f2d048baad3a3a8aa4) )
1251
12521250   ROM_REGION( 0x0220, REGION_PROMS, 0 )
12531251   ROM_LOAD( "361b16.f1",    0x0000, 0x0020, CRC(d55f30b5) SHA1(4d6a851f4886778307f75771645078b97ad55f5f) ) /* palette */
12541252   ROM_LOAD( "361b17.b16",   0x0020, 0x0100, CRC(d2ba4d32) SHA1(894b5cedf01ba9225a0d6215291857e455b84903) ) /* sprite lookup table */
r1679r1680
12701268   ROM_LOAD( "2c.bin",   0x0000, 0x2000, CRC(105a8beb) SHA1(4bd9a0076fece8dc9a830e76a60fbcefe08940f7) )
12711269   ROM_CONTINUE(0x0000,0x2000)
12721270
1273   ROM_REGION( 0x6000, REGION_GFX1, ROMREGION_DISPOSE )
1274   ROM_LOAD( "16h.bin",  0x0000, 0x2000, CRC(cb062c3b) SHA1(4a1c1a662dec26cb49310de596e1e1416d101d5d) )
1275   ROM_CONTINUE(0x0000,0x2000)
1276   ROM_LOAD( "15h.bin",  0x2000, 0x2000, CRC(df83e659) SHA1(435523f3747c5aaf0a2d3a826766cb9b9ebb821e) )
1277   ROM_CONTINUE(0x2000,0x2000)
1278   ROM_LOAD( "14h.bin",  0x4000, 0x2000, CRC(5ca53215) SHA1(650338a95465b61d9388bede716053523855eeee) )
1279   ROM_CONTINUE(0x4000,0x2000)
1280
1281   ROM_REGION( 0x8000, REGION_GFX2, ROMREGION_DISPOSE )
1271   ROM_REGION( 0x8000, REGION_GFX1, ROMREGION_DISPOSE )
12821272   ROM_LOAD( "11c.bin",  0x0000, 0x2000, CRC(d24553fa) SHA1(ad4f2dd6c7236f33841bc59ce150a212fbe871cd) )
12831273   ROM_CONTINUE(0x0000,0x2000)
12841274   ROM_LOAD( "14c.bin",  0x4000, 0x2000, CRC(4d0ab831) SHA1(2009b263fff3fd512a055fef23e667e76af1c584) )
r1679r1680
12881278   ROM_LOAD( "15c.bin",  0x6000, 0x2000, CRC(bf1e608d) SHA1(ad5f16c091439358bbece9bc50e5979d44e85980) )
12891279   ROM_CONTINUE(0x6000,0x2000)
12901280
1281   ROM_REGION( 0x6000, REGION_GFX2, ROMREGION_DISPOSE )
1282   ROM_LOAD( "16h.bin",  0x0000, 0x2000, CRC(cb062c3b) SHA1(4a1c1a662dec26cb49310de596e1e1416d101d5d) )
1283   ROM_CONTINUE(0x0000,0x2000)
1284   ROM_LOAD( "15h.bin",  0x2000, 0x2000, CRC(df83e659) SHA1(435523f3747c5aaf0a2d3a826766cb9b9ebb821e) )
1285   ROM_CONTINUE(0x2000,0x2000)
1286   ROM_LOAD( "14h.bin",  0x4000, 0x2000, CRC(5ca53215) SHA1(650338a95465b61d9388bede716053523855eeee) )
1287   ROM_CONTINUE(0x4000,0x2000)
1288
12911289   /* Proms, and speech rom (unused?) are unchanged from the original */
12921290   ROM_REGION( 0x0220, REGION_PROMS, 0 )
12931291   ROM_LOAD( "361b16.f1",    0x0000, 0x0020, CRC(d55f30b5) SHA1(4d6a851f4886778307f75771645078b97ad55f5f) ) /* palette */
r1679r1680
13141312
13151313   /* not encrypted opcodes */
13161314   for (A = 0;A < 0x6000;A++)
1317   {
13181315      decrypt[A] = rom[A];
1319   }
13201316
13211317   /* "konami1" encrypted opcodes */
13221318   for (A = 0x6000;A < size;A++)
1323   {
13241319      decrypt[A] = konami1_decodebyte(rom[A],A);
1325   }
13261320
13271321   memory_install_write8_handler(0, ADDRESS_SPACE_PROGRAM, 0x1000, 0x1000, 0, 0, MWA8_NOP );
13281322}
r1679r1680
13551349
13561350   /* decrypt program rom */
13571351   for( i = 0; i < 0x2000; i++ )
1358   {
13591352      ROM[i] = BITSWAP8(ROM[i],0,1,2,3,4,5,6,7);
1360   }
13611353
13621354   ROM = memory_region(REGION_USER1);
13631355
13641356   /* decrypt questions roms */
13651357   for( i = 0; i < 0x40000; i++ )
1366   {
13671358      ROM[i] = BITSWAP8(ROM[i],0,1,2,3,4,5,6,7);
1368   }
13691359}
13701360
13711361
1372GAME( 1983, trackfld, 0,        trackfld, trackfld, trackfld, ROT0, "Konami", "Track & Field", 0 )
1373GAME( 1983, trackflc, trackfld, trackfld, trackfld, trackfld, ROT0, "Konami (Centuri license)", "Track & Field (Centuri)", 0 )
1374GAME( 1983, hyprolym, trackfld, trackfld, trackfld, trackfld, ROT0, "Konami", "Hyper Olympic", 0 )
1375GAME( 1983, hyprolyb, trackfld, hyprolyb, trackfld, trackfld, ROT0, "bootleg", "Hyper Olympic (bootleg)", GAME_IMPERFECT_SOUND )
1376GAME( 1996, atlantol, trackfld, hyprolyb, atlantol,   atlantol, ROT0, "bootleg", "Atlant Olimpic", 0 )
1377GAME( 1988, mastkin,  0,        mastkin,  mastkin,  mastkin,  ROT0, "Du Tech", "The Masters of Kin", GAME_WRONG_COLORS )
1378GAME( 1985, wizzquiz, 0,        wizzquiz, wizzquiz, wizzquiz, ROT0, "Konami", "Wizz Quiz (Konami version)", 0 )
1379GAME( 1985, wizzquza, wizzquiz, wizzquiz, wizzquiz, wizzquiz, ROT0, "Zilec - Zenitone", "Wizz Quiz (version 4)", 0 )
1380GAME( 1987, reaktor,  0,        reaktor,  reaktor,  0,        ROT90, "Zilec", "Reaktor (Track & Field Conversion)", 0 )
1362GAME( 1983, trackfld, 0,        trackfld, trackfld, trackfld, ROT0,  "Konami", "Track & Field", 0 )
1363GAME( 1983, trackflc, trackfld, trackfld, trackfld, trackfld, ROT0,  "Konami (Centuri license)", "Track & Field (Centuri)", 0 )
1364GAME( 1983, hyprolym, trackfld, trackfld, trackfld, trackfld, ROT0,  "Konami", "Hyper Olympic", 0 )
1365GAME( 1983, hyprolyb, trackfld, hyprolyb, trackfld, trackfld, ROT0,  "bootleg", "Hyper Olympic (bootleg)", GAME_IMPERFECT_SOUND )
1366GAME( 1996, atlantol, trackfld, hyprolyb, atlantol,   atlantol, ROT0,  "bootleg", "Atlant Olimpic", 0 )
1367GAME( 1988, mastkin,  0,        mastkin,  mastkin,  mastkin,  ROT0,  "Du Tech", "The Masters of Kin", GAME_WRONG_COLORS )
1368GAME( 1985, wizzquiz, 0,        wizzquiz, wizzquiz, wizzquiz, ROT0,  "Konami", "Wizz Quiz (Konami version)", 0 )
1369GAME( 1985, wizzquza, wizzquiz, wizzquiz, wizzquiz, wizzquiz, ROT0,  "Zilec - Zenitone", "Wizz Quiz (version 4)", 0 )
1370GAME( 1987, reaktor,  0,        reaktor,  reaktor,  0,        ROT90, "Zilec", "Reaktor (Track & Field conversion)", 0 )
src/mame/drivers/fastfred.c
r1679r1680
116116   AM_RANGE(0xd800, 0xd83f) AM_READWRITE(MRA8_RAM, fastfred_attributes_w) AM_BASE(&fastfred_attributesram)
117117   AM_RANGE(0xd840, 0xd85f) AM_RAM AM_BASE(&fastfred_spriteram) AM_SIZE(&fastfred_spriteram_size)
118118   AM_RANGE(0xd860, 0xdbff) AM_RAM // Unused, but initialized
119   AM_RANGE(0xe000, 0xe000) AM_READWRITE(input_port_0_r, fastfred_background_color_w)
119   AM_RANGE(0xe000, 0xe000) AM_READWRITE(input_port_0_r, MWA8_RAM) AM_BASE(&fastfred_background_color)
120120   AM_RANGE(0xe800, 0xe800) AM_READ(input_port_1_r)
121121   AM_RANGE(0xf000, 0xf000) AM_READWRITE(input_port_2_r, MWA8_NOP)
122122   AM_RANGE(0xf001, 0xf001) AM_WRITE(interrupt_enable_w)
r1679r1680
139139   AM_RANGE(0xd040, 0xd05f) AM_RAM AM_BASE(&fastfred_spriteram) AM_SIZE(&fastfred_spriteram_size)
140140   AM_RANGE(0xd060, 0xd3ff) AM_RAM
141141   AM_RANGE(0xd800, 0xdbff) AM_MIRROR(0x400) AM_READWRITE(MRA8_RAM, fastfred_videoram_w) AM_BASE(&fastfred_videoram)
142   AM_RANGE(0xe000, 0xe000) AM_WRITE(fastfred_background_color_w)
142   AM_RANGE(0xe000, 0xe000) AM_WRITE(MWA8_RAM) AM_BASE(&fastfred_background_color)
143143   AM_RANGE(0xe800, 0xe800) AM_READ(input_port_0_r)
144144   AM_RANGE(0xe801, 0xe801) AM_READ(input_port_1_r)
145145   AM_RANGE(0xe802, 0xe802) AM_READ(input_port_2_r)
r1679r1680
574574   MDRV_SCREEN_SIZE(32*8, 32*8)
575575   MDRV_SCREEN_VISIBLE_AREA(0*8, 32*8-1, 2*8, 30*8-1)
576576   MDRV_GFXDECODE(fastfred)
577   MDRV_PALETTE_LENGTH(256)
578   MDRV_COLORTABLE_LENGTH(32*8)
577   MDRV_PALETTE_LENGTH(32*8)
579578
580579   MDRV_PALETTE_INIT(fastfred)
581580   MDRV_VIDEO_START(fastfred)
r1679r1680
898897   fastfred_hardware_type = 3;
899898}
900899
901GAME( 1982, flyboy,   0,      fastfred, flyboy,   flyboy,   ROT90, "Kaneko", "Fly-Boy", 0 )
902GAME( 1982, flyboyb,  flyboy, fastfred, flyboy,   flyboyb,  ROT90, "Kaneko", "Fly-Boy (bootleg)", 0 )
903GAME( 1982, fastfred, flyboy, fastfred, fastfred, fastfred, ROT90, "Atari", "Fast Freddie", 0 )
904GAME( 1983, jumpcoas, 0,      jumpcoas, jumpcoas, jumpcoas, ROT90, "Kaneko", "Jump Coaster", 0 )
905GAME( 1983, jumpcoat, jumpcoas,jumpcoas, jumpcoas, jumpcoas, ROT90, "Taito", "Jump Coaster (Taito)", 0 )
906GAME( 1983, boggy84,  0,      jumpcoas, boggy84,  boggy84,  ROT90, "bootleg", "Boggy '84", 0 )
907GAME( 1986, redrobin, 0,      fastfred, redrobin, flyboyb,  ROT90, "Elettronolo", "Red Robin", 0 )
908GAME( 1983, imago,     0,     imago,   imago,     imago,   ROT90, "Acom", "Imago", GAME_IMPERFECT_GRAPHICS )
900GAME( 1982, flyboy,   0,        fastfred, flyboy,   flyboy,   ROT90, "Kaneko", "Fly-Boy", 0 )
901GAME( 1982, flyboyb,  flyboy,   fastfred, flyboy,   flyboyb,  ROT90, "Kaneko", "Fly-Boy (bootleg)", 0 )
902GAME( 1982, fastfred, flyboy,   fastfred, fastfred, fastfred, ROT90, "Atari", "Fast Freddie", 0 )
903GAME( 1983, jumpcoas, 0,        jumpcoas, jumpcoas, jumpcoas, ROT90, "Kaneko", "Jump Coaster", 0 )
904GAME( 1983, jumpcoat, jumpcoas, jumpcoas, jumpcoas, jumpcoas, ROT90, "Taito", "Jump Coaster (Taito)", 0 )
905GAME( 1983, boggy84,  0,        jumpcoas, boggy84,  boggy84,  ROT90, "bootleg", "Boggy '84", 0 )
906GAME( 1986, redrobin, 0,        fastfred, redrobin, flyboyb,  ROT90, "Elettronolo", "Red Robin", 0 )
907GAME( 1983, imago,     0,       imago,    imago,    imago,    ROT90, "Acom", "Imago", GAME_IMPERFECT_GRAPHICS )
src/mame/drivers/astrof.c
r1679r1680
100100{
101101   cpunum_set_input_line(machine, 0, 0, ASSERT_LINE);
102102
103   timer_adjust(irq_timer, video_screen_get_time_until_pos(0, VBSTART, 0), 0, attotime_zero);
103   timer_adjust_oneshot(irq_timer, video_screen_get_time_until_pos(0, VBSTART, 0), 0);
104104}
105105
106106
r1679r1680
112112
113113static void start_irq_timer(void)
114114{
115   timer_adjust(irq_timer, video_screen_get_time_until_pos(0, VBSTART, 0), 0, attotime_zero);
115   timer_adjust_oneshot(irq_timer, video_screen_get_time_until_pos(0, VBSTART, 0), 0);
116116}
117117
118118
src/mame/drivers/maxaflex.c
r1679r1680
202202      }
203203
204204      period = attotime_mul(ATTOTIME_IN_HZ(3579545), divider);
205      timer_adjust( mcu_timer, period, 0, period);
205      timer_adjust_periodic( mcu_timer, period, 0, period);
206206   }
207207}
208208
src/mame/drivers/punchout.c
r1679r1680
799799   /* video hardware */
800800   MDRV_VIDEO_ATTRIBUTES(VIDEO_TYPE_RASTER)
801801   MDRV_GFXDECODE(punchout)
802   MDRV_PALETTE_LENGTH(1024+1)
803   MDRV_COLORTABLE_LENGTH(128*4+128*4+64*8+128*4)
802   MDRV_PALETTE_LENGTH(128*4+128*4+64*8+128*4)
804803   MDRV_DEFAULT_LAYOUT(layout_dualhuov)
805804
806805   MDRV_SCREEN_ADD("top", 0x000)
r1679r1680
844843
845844   /* video hardware */
846845   MDRV_GFXDECODE(armwrest)
847   MDRV_COLORTABLE_LENGTH(256*4+64*8+64*8+128*4)
846   MDRV_PALETTE_LENGTH(256*4+64*8+64*8+128*4)
848847
849848   MDRV_PALETTE_INIT(armwrest)
850849   MDRV_VIDEO_START(armwrest)
src/mame/drivers/vegas.c
r1679r1680
965965      if (regs[1] & 2)
966966         logerror("Unexpected value: timer %d is prescaled\n", which);
967967      if (scale != 0)
968         timer_adjust(timer[which], attotime_mul(TIMER_PERIOD, scale), which, attotime_never);
968         timer_adjust_oneshot(timer[which], attotime_mul(TIMER_PERIOD, scale), which);
969969   }
970970
971971   /* trigger the interrupt */
r1679r1680
11781178            if (nile_regs[offset] & 2)
11791179               logerror("Unexpected value: timer %d is prescaled\n", which);
11801180            if (scale != 0)
1181               timer_adjust(timer[which], attotime_mul(TIMER_PERIOD, scale), which, attotime_never);
1181               timer_adjust_oneshot(timer[which], attotime_mul(TIMER_PERIOD, scale), which);
11821182            if (LOG_TIMERS) logerror("Starting timer %d at a rate of %d Hz\n", which, (int)ATTOSECONDS_TO_HZ(attotime_mul(TIMER_PERIOD, nile_regs[offset + 1] + 1).attoseconds));
11831183         }
11841184
r1679r1680
11881188            if (nile_regs[offset] & 2)
11891189               logerror("Unexpected value: timer %d is prescaled\n", which);
11901190            nile_regs[offset + 1] = attotime_to_double(timer_timeleft(timer[which])) * SYSTEM_CLOCK;
1191            timer_adjust(timer[which], attotime_never, which, attotime_never);
1191            timer_adjust_oneshot(timer[which], attotime_never, which);
11921192         }
11931193         break;
11941194
r1679r1680
12041204         {
12051205            if (nile_regs[offset - 1] & 2)
12061206               logerror("Unexpected value: timer %d is prescaled\n", which);
1207            timer_adjust(timer[which], attotime_mul(TIMER_PERIOD, nile_regs[offset]), which, attotime_never);
1207            timer_adjust_oneshot(timer[which], attotime_mul(TIMER_PERIOD, nile_regs[offset]), which);
12081208         }
12091209         break;
12101210
r1679r1680
17811781   PORT_BIT( 0x0002, IP_ACTIVE_LOW, IPT_COIN2 )
17821782   PORT_BIT( 0x0004, IP_ACTIVE_LOW, IPT_START1 )
17831783   PORT_BIT( 0x0008, IP_ACTIVE_LOW, IPT_TILT )
1784   PORT_BIT( 0x0010, IP_ACTIVE_LOW, IPT_SERVICE ) PORT_NAME(DEF_STR( Service_Mode )) PORT_CODE(KEYCODE_F2) /* Test switch */
1784   PORT_SERVICE_NO_TOGGLE( 0x0010, IP_ACTIVE_LOW )
17851785   PORT_BIT( 0x0020, IP_ACTIVE_LOW, IPT_START2 )
17861786   PORT_BIT( 0x0040, IP_ACTIVE_LOW, IPT_SERVICE1 )
17871787   PORT_BIT( 0x0080, IP_ACTIVE_LOW, IPT_COIN3 )
src/mame/drivers/finalizr.c
r1679r1680
423423   MDRV_SCREEN_SIZE(36*8, 32*8)
424424   MDRV_SCREEN_VISIBLE_AREA(1*8, 35*8-1, 2*8, 30*8-1)
425425   MDRV_GFXDECODE(finalizr)
426   MDRV_PALETTE_LENGTH(32)
427   MDRV_COLORTABLE_LENGTH(2*16*16)
426   MDRV_PALETTE_LENGTH(2*16*16)
428427
429428   MDRV_PALETTE_INIT(finalizr)
430429   MDRV_VIDEO_START(finalizr)
r1679r1680
470469   ROM_REGION( 0x0240, REGION_PROMS, 0 )
471470   ROM_LOAD( "523h10.2f",    0x0000, 0x0020, CRC(ec15dd15) SHA1(710384b154a9363fdc88edffda252f1d60e000dc) ) /* palette */
472471   ROM_LOAD( "523h11.3f",    0x0020, 0x0020, CRC(54be2e83) SHA1(3200abc7f2238d62d7204ef57a6daa2df150538d) ) /* palette */
473   ROM_LOAD( "523h12.10f",   0x0040, 0x0100, CRC(53166a2a) SHA1(6cdde206036df7176679711f7888d72acee27c8f) ) /* sprites */
474   ROM_LOAD( "523h13.11f",   0x0140, 0x0100, CRC(4e0647a0) SHA1(fb87f878456b8b76bb2c028cb890d2a5c1c3e388) ) /* characters */
472   ROM_LOAD( "523h13.11f",   0x0040, 0x0100, CRC(4e0647a0) SHA1(fb87f878456b8b76bb2c028cb890d2a5c1c3e388) ) /* characters */
473   ROM_LOAD( "523h12.10f",   0x0140, 0x0100, CRC(53166a2a) SHA1(6cdde206036df7176679711f7888d72acee27c8f) ) /* sprites */
475474ROM_END
476475
477476ROM_START( finalizb )
r1679r1680
494493   ROM_REGION( 0x0240, REGION_PROMS, 0 )
495494   ROM_LOAD( "523h10.2f",    0x0000, 0x0020, CRC(ec15dd15) SHA1(710384b154a9363fdc88edffda252f1d60e000dc) ) /* palette */
496495   ROM_LOAD( "523h11.3f",    0x0020, 0x0020, CRC(54be2e83) SHA1(3200abc7f2238d62d7204ef57a6daa2df150538d) ) /* palette */
497   ROM_LOAD( "523h12.10f",   0x0040, 0x0100, CRC(53166a2a) SHA1(6cdde206036df7176679711f7888d72acee27c8f) ) /* sprites */
498   ROM_LOAD( "523h13.11f",   0x0140, 0x0100, CRC(4e0647a0) SHA1(fb87f878456b8b76bb2c028cb890d2a5c1c3e388) ) /* characters */
496   ROM_LOAD( "523h13.11f",   0x0040, 0x0100, CRC(4e0647a0) SHA1(fb87f878456b8b76bb2c028cb890d2a5c1c3e388) ) /* characters */
497   ROM_LOAD( "523h12.10f",   0x0140, 0x0100, CRC(53166a2a) SHA1(6cdde206036df7176679711f7888d72acee27c8f) ) /* sprites */
499498ROM_END
500499
501500
src/mame/drivers/segaybd.c
r1679r1680
164164   update_main_irqs();
165165
166166   /* come back at the next appropriate scanline */
167   timer_adjust(interrupt_timer, video_screen_get_time_until_pos(0, scanline, 0), scanline, attotime_zero);
167   timer_adjust_oneshot(interrupt_timer, video_screen_get_time_until_pos(0, scanline, 0), scanline);
168168
169169#if TWEAK_IRQ2_SCANLINE
170170   if (scanline == 223)
r1679r1680
186186static MACHINE_RESET( yboard )
187187{
188188    interrupt_timer = timer_alloc(scanline_callback, NULL);
189    timer_adjust(interrupt_timer, video_screen_get_time_until_pos(0, 223, 0), 223, attotime_zero);
189    timer_adjust_oneshot(interrupt_timer, video_screen_get_time_until_pos(0, 223, 0), 223);
190190
191191   state_save_register_global_array(misc_io_data);
192192   state_save_register_global_array(analog_data);
src/mame/drivers/enigma2.c
r1679r1680
108108      next_counter = INT_TRIGGER_COUNT_1;
109109
110110   next_vpos = vysnc_chain_counter_to_vpos(next_counter);
111   timer_adjust(interrupt_assert_timer, video_screen_get_time_until_pos(0, next_vpos, 0), 0, attotime_zero);
112   timer_adjust(interrupt_clear_timer, video_screen_get_time_until_pos(0, vpos + 1, 0), 0, attotime_zero);
111   timer_adjust_oneshot(interrupt_assert_timer, video_screen_get_time_until_pos(0, next_vpos, 0), 0);
112   timer_adjust_oneshot(interrupt_clear_timer, video_screen_get_time_until_pos(0, vpos + 1, 0), 0);
113113}
114114
115115
r1679r1680
123123static void start_interrupt_timers(void)
124124{
125125   int vpos = vysnc_chain_counter_to_vpos(INT_TRIGGER_COUNT_1);
126   timer_adjust(interrupt_assert_timer, video_screen_get_time_until_pos(0, vpos, 0), 0, attotime_zero);
126   timer_adjust_oneshot(interrupt_assert_timer, video_screen_get_time_until_pos(0, vpos, 0), 0);
127127}
128128
129129
src/mame/drivers/cowrace.c
r1679r1680
3434static VIDEO_START( cowrace )
3535{
3636   tmap = tilemap_create(   get_tile_info, tilemap_scan_rows,
37                     TILEMAP_TYPE_PEN, 8,8, 0x20,0x20   );
37                     8,8, 0x20,0x20   );
3838
3939   tilemap_set_transparent_pen(tmap, 0);
4040}
src/mame/drivers/koikoi.c
r1679r1680
211211
212212static VIDEO_START(koikoi)
213213{
214   koikoi_tilemap = tilemap_create(get_tile_info,tilemap_scan_rows,TILEMAP_TYPE_PEN,8,8,32,32);
214   koikoi_tilemap = tilemap_create(get_tile_info,tilemap_scan_rows,8,8,32,32);
215215}
216216
217217static VIDEO_UPDATE(koikoi)
src/mame/drivers/gticlub.c
r1679r1680
102102
103103static VIDEO_UPDATE( hangplt )
104104{
105   fillbitmap(bitmap, machine->remapped_colortable[0], cliprect);
105   fillbitmap(bitmap, machine->pens[0], cliprect);
106106
107107   K001604_tile_update(screen);
108108//  K001604_draw_back_layer(bitmap, cliprect);
r1679r1680
563563   PORT_BIT( 0xff, IP_ACTIVE_LOW, IPT_UNKNOWN )
564564
565565   PORT_START
566   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_SERVICE ) PORT_NAME( DEF_STR( Service_Mode )) PORT_CODE(KEYCODE_F2)
566   PORT_SERVICE_NO_TOGGLE( 0x80, IP_ACTIVE_LOW )
567567   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNUSED )
568568   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_COIN1 )
569569   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_COIN2 )
r1679r1680
610610   PORT_BIT( 0xff, IP_ACTIVE_LOW, IPT_UNKNOWN )
611611
612612   PORT_START
613   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_SERVICE ) PORT_NAME( DEF_STR( Service_Mode )) PORT_CODE(KEYCODE_F2)
613   PORT_SERVICE_NO_TOGGLE( 0x80, IP_ACTIVE_LOW )
614614   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_SERVICE1 ) PORT_NAME("Service Button") PORT_CODE(KEYCODE_8)
615615   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_COIN1 )
616616   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_COIN2 )
r1679r1680
660660   PORT_BIT( 0xff, IP_ACTIVE_LOW, IPT_UNKNOWN )
661661
662662   PORT_START
663   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_SERVICE ) PORT_NAME( DEF_STR( Service_Mode )) PORT_CODE(KEYCODE_F2)
663   PORT_SERVICE_NO_TOGGLE( 0x80, IP_ACTIVE_LOW )
664664   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_SERVICE1 ) PORT_NAME("Service Button") PORT_CODE(KEYCODE_8)
665665   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_COIN1 )
666666   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_COIN2 )
r1679r1680
697697   PORT_BIT( 0xff, IP_ACTIVE_LOW, IPT_UNKNOWN )
698698
699699   PORT_START
700   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_SERVICE ) PORT_NAME( DEF_STR( Service_Mode )) PORT_CODE(KEYCODE_F2)
700   PORT_SERVICE_NO_TOGGLE( 0x80, IP_ACTIVE_LOW )
701701   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_SERVICE1 ) PORT_NAME("Service Button") PORT_CODE(KEYCODE_8)
702702   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_COIN1 )
703703   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_COIN2 )
src/mame/drivers/foodf.c
r1679r1680
146146      scanline = 0;
147147
148148   /* set a timer for it */
149   timer_adjust(scanline_timer, video_screen_get_time_until_pos(0, scanline, 0), scanline, attotime_zero);
149   timer_adjust_oneshot(scanline_timer, video_screen_get_time_until_pos(0, scanline, 0), scanline);
150150}
151151
152152
r1679r1680
160160static MACHINE_RESET( foodf )
161161{
162162   atarigen_interrupt_reset(update_interrupts);
163   timer_adjust(scanline_timer, video_screen_get_time_until_pos(0, 0, 0), 0, attotime_zero);
163   timer_adjust_oneshot(scanline_timer, video_screen_get_time_until_pos(0, 0, 0), 0);
164164}
165165
166166
src/mame/drivers/namcona1.c
r1679r1680
324324   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_COIN3 )
325325   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_COIN2 )
326326   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_COIN1 )
327   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_SERVICE ) PORT_NAME( DEF_STR( Service_Mode ) ) PORT_TOGGLE PORT_CODE(KEYCODE_F2)
327   PORT_SERVICE( 0x40, IP_ACTIVE_LOW )
328328   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_SERVICE1 )
329329INPUT_PORTS_END
330330
r1679r1680
380380   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_COIN3 )
381381   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_COIN2 )
382382   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_COIN1 )
383   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_SERVICE ) PORT_NAME( DEF_STR( Service_Mode ) ) PORT_TOGGLE PORT_CODE(KEYCODE_F2)
383   PORT_SERVICE( 0x40, IP_ACTIVE_LOW )
384384   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_SERVICE1 )
385385INPUT_PORTS_END
386386
src/mame/drivers/acefruit.c
r1679r1680
4343
4444   vpos = ( ( vpos / 8 ) + 1 ) * 8;
4545
46   timer_adjust( acefruit_refresh_timer, video_screen_get_time_until_pos( 0, vpos, 0 ), 0, attotime_never );
46   timer_adjust_oneshot( acefruit_refresh_timer, video_screen_get_time_until_pos( 0, vpos, 0 ), 0 );
4747}
4848
4949static VIDEO_START( acefruit )
r1679r1680
5454static INTERRUPT_GEN( acefruit_vblank )
5555{
5656   cpunum_set_input_line(machine, 0, 0, HOLD_LINE );
57   timer_adjust( acefruit_refresh_timer, attotime_zero, 0, attotime_never );
57   timer_adjust_oneshot( acefruit_refresh_timer, attotime_zero, 0 );
5858}
5959
6060static VIDEO_UPDATE( acefruit )
src/mame/drivers/ddenlovr.c
r1679r1680
66496649   MDRV_SCREEN_SIZE(336, 256)
66506650   MDRV_SCREEN_VISIBLE_AREA(0, 336-1, 5, 256-16+5-1)
66516651   MDRV_PALETTE_LENGTH(0x100)
6652   MDRV_COLORTABLE_LENGTH(0x100)
66536652
66546653   MDRV_VIDEO_START(ddenlovr)
66556654   MDRV_VIDEO_EOF(ddenlovr)
r1679r1680
67256724   MDRV_SCREEN_SIZE(336, 256)
67266725   MDRV_SCREEN_VISIBLE_AREA(0, 336-1, 5, 256-16+5-1)
67276726   MDRV_PALETTE_LENGTH(0x100)
6728   MDRV_COLORTABLE_LENGTH(0x100)
67296727
67306728   MDRV_VIDEO_START(mmpanic)   // extra layers
67316729   MDRV_VIDEO_EOF(ddenlovr)
src/mame/drivers/kaneko16.c
r1679r1680
1717          VU-003                                        <- High Colour Background
1818          VIEW2-CHIP 23160-509 9047EAI (144pin PQFP)    <- Tilemaps
1919          MUX2-CHIP                    (64pin PQFP)
20          HELP1-CHIP
20          HELP1-CHIP                   (64pin PQFP)
2121          IU-001 9045KP002             (44pin PQFP)
2222          I/O JAMMA MC-8282 047        (46pin)          <- Inputs
2323
r1679r1680
282891  The Berlin Wall
2929    Magical Crystals           Z00FC-02
303092  Bakuretsu Breaker          ZOOFC-02
31    Blaze On                               2 Sprites Chips !?
31    Blaze On                   Z02AT-002   2 VU-002 Sprites Chips (Atlus PCB ID: ATL-67140)
3232    Shogun Warriors            ZO1DK-002   CALC3 MCU protection (EEPROM handling, 68k code snippet, data - palettes, tilemaps, fighters)
3333    B.Rap Boys                 ZO1DK-002   CALC3 MCU protection (EEPROM handling, 68k code snippet, data - palettes, tilemaps, fighters)
343494  Great 1000 Miles Rally                 TBSOP01 MCU protection (EEPROM handling etc.)
r1679r1680
892892   PORT_DIPUNUSED_DIPLOC( 0x0040, 0x0040, "SW1:7" ) /* Listed as "Unused" */
893893   PORT_DIPUNUSED_DIPLOC( 0x0080, 0x0080, "SW1:8" ) /* Listed as "Unused" */
894894
895   PORT_BIT(  0x0100, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_8WAY PORT_PLAYER(1)
896   PORT_BIT(  0x0200, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_8WAY PORT_PLAYER(1)
897   PORT_BIT(  0x0400, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_8WAY PORT_PLAYER(1)
898   PORT_BIT(  0x0800, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_8WAY PORT_PLAYER(1)
899   PORT_BIT(  0x1000, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(1)
900   PORT_BIT(  0x2000, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_PLAYER(1)
901   PORT_BIT(  0x4000, IP_ACTIVE_LOW, IPT_UNKNOWN )
902   PORT_BIT(  0x8000, IP_ACTIVE_LOW, IPT_UNKNOWN )
895   PORT_BIT( 0x0100, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_8WAY PORT_PLAYER(1)
896   PORT_BIT( 0x0200, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_8WAY PORT_PLAYER(1)
897   PORT_BIT( 0x0400, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_8WAY PORT_PLAYER(1)
898   PORT_BIT( 0x0800, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_8WAY PORT_PLAYER(1)
899   PORT_BIT( 0x1000, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(1)
900   PORT_BIT( 0x2000, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_PLAYER(1)
901   PORT_BIT( 0x4000, IP_ACTIVE_LOW, IPT_UNKNOWN )
902   PORT_BIT( 0x8000, IP_ACTIVE_LOW, IPT_UNKNOWN )
903903
904904   PORT_START   // IN1 - Player 2 - e00002.b
905   PORT_BIT(  0x0100, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_8WAY PORT_PLAYER(2)
906   PORT_BIT(  0x0200, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_8WAY PORT_PLAYER(2)
907   PORT_BIT(  0x0400, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_8WAY PORT_PLAYER(2)
908   PORT_BIT(  0x0800, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_8WAY PORT_PLAYER(2)
909   PORT_BIT(  0x1000, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(2)
910   PORT_BIT(  0x2000, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_PLAYER(2)
911   PORT_BIT(  0x4000, IP_ACTIVE_LOW, IPT_UNKNOWN )
912   PORT_BIT(  0x8000, IP_ACTIVE_LOW, IPT_UNKNOWN )
905   PORT_BIT( 0x0100, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_8WAY PORT_PLAYER(2)
906   PORT_BIT( 0x0200, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_8WAY PORT_PLAYER(2)
907   PORT_BIT( 0x0400, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_8WAY PORT_PLAYER(2)
908   PORT_BIT( 0x0800, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_8WAY PORT_PLAYER(2)
909   PORT_BIT( 0x1000, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(2)
910   PORT_BIT( 0x2000, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_PLAYER(2)
911   PORT_BIT( 0x4000, IP_ACTIVE_LOW, IPT_UNKNOWN )
912   PORT_BIT( 0x8000, IP_ACTIVE_LOW, IPT_UNKNOWN )
913913
914914   PORT_START   // IN2 - Coins - e00004.b
915   PORT_BIT(  0x0100, IP_ACTIVE_LOW, IPT_START1   )
916   PORT_BIT(  0x0200, IP_ACTIVE_LOW, IPT_START2   )
915   PORT_BIT( 0x0100, IP_ACTIVE_LOW, IPT_START1   )
916   PORT_BIT( 0x0200, IP_ACTIVE_LOW, IPT_START2   )
917917   PORT_BIT( 0x0400, IP_ACTIVE_LOW, IPT_COIN1 ) PORT_IMPULSE(2)
918918   PORT_BIT( 0x0800, IP_ACTIVE_LOW, IPT_COIN2 ) PORT_IMPULSE(2)
919   PORT_BIT( 0x1000, IP_ACTIVE_LOW, IPT_SERVICE ) PORT_NAME( DEF_STR( Service_Mode )) PORT_CODE(KEYCODE_F2)
920   PORT_BIT(  0x2000, IP_ACTIVE_LOW, IPT_TILT      )   // pause
921   PORT_BIT(  0x4000, IP_ACTIVE_LOW, IPT_SERVICE1   )
922   PORT_BIT(  0x8000, IP_ACTIVE_LOW, IPT_UNKNOWN   )
919   PORT_SERVICE_NO_TOGGLE( 0x1000, IP_ACTIVE_LOW )
920   PORT_BIT( 0x2000, IP_ACTIVE_LOW, IPT_TILT      )   // pause
921   PORT_BIT( 0x4000, IP_ACTIVE_LOW, IPT_SERVICE1   )
922   PORT_BIT( 0x8000, IP_ACTIVE_LOW, IPT_UNKNOWN   )
923923
924924   PORT_START   // IN3 - Seems unused ! - e00006.b
925   PORT_BIT(  0x0100, IP_ACTIVE_LOW, IPT_UNKNOWN )
926   PORT_BIT(  0x0200, IP_ACTIVE_LOW, IPT_UNKNOWN )
927   PORT_BIT(  0x0400, IP_ACTIVE_LOW, IPT_UNKNOWN )
928   PORT_BIT(  0x0800, IP_ACTIVE_LOW, IPT_UNKNOWN )
929   PORT_BIT(  0x1000, IP_ACTIVE_LOW, IPT_UNKNOWN )
930   PORT_BIT(  0x2000, IP_ACTIVE_LOW, IPT_UNKNOWN )
931   PORT_BIT(  0x4000, IP_ACTIVE_LOW, IPT_UNKNOWN )
932   PORT_BIT(  0x8000, IP_ACTIVE_LOW, IPT_UNKNOWN )
925   PORT_BIT( 0x0100, IP_ACTIVE_LOW, IPT_UNKNOWN )
926   PORT_BIT( 0x0200, IP_ACTIVE_LOW, IPT_UNKNOWN )
927   PORT_BIT( 0x0400, IP_ACTIVE_LOW, IPT_UNKNOWN )
928   PORT_BIT( 0x0800, IP_ACTIVE_LOW, IPT_UNKNOWN )
929   PORT_BIT( 0x1000, IP_ACTIVE_LOW, IPT_UNKNOWN )
930   PORT_BIT( 0x2000, IP_ACTIVE_LOW, IPT_UNKNOWN )
931   PORT_BIT( 0x4000, IP_ACTIVE_LOW, IPT_UNKNOWN )
932   PORT_BIT( 0x8000, IP_ACTIVE_LOW, IPT_UNKNOWN )
933933INPUT_PORTS_END
934934
935935
r1679r1680
939939
940940static INPUT_PORTS_START( berlwall )
941941   PORT_START   // IN0 - Player 1 - 680000.w
942   PORT_BIT(  0x0100, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_8WAY PORT_PLAYER(1)
943   PORT_BIT(  0x0200, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_8WAY PORT_PLAYER(1)
944   PORT_BIT(  0x0400, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_8WAY PORT_PLAYER(1)
945   PORT_BIT(  0x0800, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_8WAY PORT_PLAYER(1)
946   PORT_BIT(  0x1000, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(1)
947   PORT_BIT(  0x2000, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_PLAYER(1)
948   PORT_BIT(  0x4000, IP_ACTIVE_LOW, IPT_BUTTON3 ) PORT_PLAYER(1)
949   PORT_BIT(  0x8000, IP_ACTIVE_LOW, IPT_UNKNOWN )
942   PORT_BIT( 0x0100, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_8WAY PORT_PLAYER(1)
943   PORT_BIT( 0x0200, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_8WAY PORT_PLAYER(1)
944   PORT_BIT( 0x0400, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_8WAY PORT_PLAYER(1)
945   PORT_BIT( 0x0800, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_8WAY PORT_PLAYER(1)
946   PORT_BIT( 0x1000, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(1)
947   PORT_BIT( 0x2000, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_PLAYER(1)
948   PORT_BIT( 0x4000, IP_ACTIVE_LOW, IPT_BUTTON3 ) PORT_PLAYER(1)
949   PORT_BIT( 0x8000, IP_ACTIVE_LOW, IPT_UNKNOWN )
950950
951951   PORT_START   // IN1 - Player 2 - 680002.w
952   PORT_BIT(  0x0100, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_8WAY PORT_PLAYER(2)
953   PORT_BIT(  0x0200, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_8WAY PORT_PLAYER(2)
954   PORT_BIT(  0x0400, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_8WAY PORT_PLAYER(2)
955   PORT_BIT(  0x0800, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_8WAY PORT_PLAYER(2)
956   PORT_BIT(  0x1000, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(2)
957   PORT_BIT(  0x2000, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_PLAYER(2)
958   PORT_BIT(  0x4000, IP_ACTIVE_LOW, IPT_BUTTON3 ) PORT_PLAYER(2)
959   PORT_BIT(  0x8000, IP_ACTIVE_LOW, IPT_UNKNOWN )
952   PORT_BIT( 0x0100, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_8WAY PORT_PLAYER(2)
953   PORT_BIT( 0x0200, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_8WAY PORT_PLAYER(2)
954   PORT_BIT( 0x0400, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_8WAY PORT_PLAYER(2)
955   PORT_BIT( 0x0800, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_8WAY PORT_PLAYER(2)
956   PORT_BIT( 0x1000, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(2)
957   PORT_BIT( 0x2000, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_PLAYER(2)
958   PORT_BIT( 0x4000, IP_ACTIVE_LOW, IPT_BUTTON3 ) PORT_PLAYER(2)
959   PORT_BIT( 0x8000, IP_ACTIVE_LOW, IPT_UNKNOWN )
960960
961961   PORT_START   // IN2 - Coins - 680004.w
962   PORT_BIT(  0x0100, IP_ACTIVE_LOW, IPT_START1   )
963   PORT_BIT(  0x0200, IP_ACTIVE_LOW, IPT_START2   )
962   PORT_BIT( 0x0100, IP_ACTIVE_LOW, IPT_START1   )
963   PORT_BIT( 0x0200, IP_ACTIVE_LOW, IPT_START2   )
964964   PORT_BIT( 0x0400, IP_ACTIVE_LOW, IPT_COIN1 ) PORT_IMPULSE(2)
965965   PORT_BIT( 0x0800, IP_ACTIVE_LOW, IPT_COIN2 ) PORT_IMPULSE(2)
966   PORT_BIT( 0x1000, IP_ACTIVE_LOW, IPT_SERVICE ) PORT_NAME( DEF_STR( Service_Mode )) PORT_CODE(KEYCODE_F2)
967   PORT_BIT(  0x2000, IP_ACTIVE_LOW, IPT_TILT      )
968   PORT_BIT(  0x4000, IP_ACTIVE_LOW, IPT_SERVICE1   )
969   PORT_BIT(  0x8000, IP_ACTIVE_LOW, IPT_UNKNOWN   )
966   PORT_SERVICE_NO_TOGGLE( 0x1000, IP_ACTIVE_LOW )
967   PORT_BIT( 0x2000, IP_ACTIVE_LOW, IPT_TILT      )
968   PORT_BIT( 0x4000, IP_ACTIVE_LOW, IPT_SERVICE1   )
969   PORT_BIT( 0x8000, IP_ACTIVE_LOW, IPT_UNKNOWN   )
970970
971971   PORT_START   // IN3 - ? - 680006.w
972   PORT_BIT(  0x0100, IP_ACTIVE_LOW, IPT_UNKNOWN )
973   PORT_BIT(  0x0200, IP_ACTIVE_LOW, IPT_UNKNOWN )
974   PORT_BIT(  0x0400, IP_ACTIVE_LOW, IPT_UNKNOWN )
975   PORT_BIT(  0x0800, IP_ACTIVE_LOW, IPT_UNKNOWN )
976   PORT_BIT(  0x1000, IP_ACTIVE_LOW, IPT_UNKNOWN )
977   PORT_BIT(  0x2000, IP_ACTIVE_LOW, IPT_UNKNOWN )
978   PORT_BIT(  0x4000, IP_ACTIVE_LOW, IPT_UNKNOWN )
979   PORT_BIT(  0x8000, IP_ACTIVE_LOW, IPT_UNKNOWN )
972   PORT_BIT( 0x0100, IP_ACTIVE_LOW, IPT_UNKNOWN )
973   PORT_BIT( 0x0200, IP_ACTIVE_LOW, IPT_UNKNOWN )
974   PORT_BIT( 0x0400, IP_ACTIVE_LOW, IPT_UNKNOWN )
975   PORT_BIT( 0x0800, IP_ACTIVE_LOW, IPT_UNKNOWN )
976   PORT_BIT( 0x1000, IP_ACTIVE_LOW, IPT_UNKNOWN )
977   PORT_BIT( 0x2000, IP_ACTIVE_LOW, IPT_UNKNOWN )
978   PORT_BIT( 0x4000, IP_ACTIVE_LOW, IPT_UNKNOWN )
979   PORT_BIT( 0x8000, IP_ACTIVE_LOW, IPT_UNKNOWN )
980980
981981   PORT_START_TAG("DSW1")   // IN4 - DSW 1 - $200018.b <- ! $80001d.b
982982   PORT_DIPNAME( 0x01, 0x01, DEF_STR( Flip_Screen ) ) PORT_DIPLOCATION("SW1:1")
r1679r1680
11301130   PORT_BIT( 0x0400, IP_ACTIVE_LOW, IPT_UNKNOWN  )
11311131   PORT_BIT( 0x0800, IP_ACTIVE_LOW, IPT_UNKNOWN  )
11321132   PORT_BIT( 0x1000, IP_ACTIVE_LOW, IPT_UNKNOWN  )
1133   PORT_BIT( 0x2000, IP_ACTIVE_LOW, IPT_SERVICE  ) PORT_NAME( DEF_STR( Service_Mode )) PORT_CODE(KEYCODE_F2)
1133   PORT_SERVICE_NO_TOGGLE( 0x2000, IP_ACTIVE_LOW )
11341134   PORT_BIT( 0x4000, IP_ACTIVE_LOW, IPT_TILT     )
11351135   PORT_BIT( 0x8000, IP_ACTIVE_LOW, IPT_SERVICE1 )
11361136INPUT_PORTS_END
r1679r1680
11411141
11421142static INPUT_PORTS_START( bloodwar )
11431143   PORT_START   // IN0 - Player 1 - b00000.w
1144   PORT_BIT(  0x0100, IP_ACTIVE_LOW, IPT_JOYSTICK_UP      ) PORT_PLAYER(1)
1145   PORT_BIT(  0x0200, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN      ) PORT_PLAYER(1)
1146   PORT_BIT(  0x0400, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT      ) PORT_PLAYER(1)
1147   PORT_BIT(  0x0800, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT   ) PORT_PLAYER(1)
1148   PORT_BIT(  0x1000, IP_ACTIVE_LOW, IPT_BUTTON1         ) PORT_PLAYER(1)
1149   PORT_BIT(  0x2000, IP_ACTIVE_LOW, IPT_BUTTON2         ) PORT_PLAYER(1)
1150   PORT_BIT(  0x4000, IP_ACTIVE_LOW, IPT_BUTTON3         ) PORT_PLAYER(1)
1151   PORT_BIT(  0x8000, IP_ACTIVE_LOW, IPT_BUTTON4         ) PORT_PLAYER(1)
1144   PORT_BIT( 0x0100, IP_ACTIVE_LOW, IPT_JOYSTICK_UP      ) PORT_PLAYER(1)
1145   PORT_BIT( 0x0200, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN      ) PORT_PLAYER(1)
1146   PORT_BIT( 0x0400, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT      ) PORT_PLAYER(1)
1147   PORT_BIT( 0x0800, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT   ) PORT_PLAYER(1)
1148   PORT_BIT( 0x1000, IP_ACTIVE_LOW, IPT_BUTTON1         ) PORT_PLAYER(1)
1149   PORT_BIT( 0x2000, IP_ACTIVE_LOW, IPT_BUTTON2         ) PORT_PLAYER(1)
1150   PORT_BIT( 0x4000, IP_ACTIVE_LOW, IPT_BUTTON3         ) PORT_PLAYER(1)
1151   PORT_BIT( 0x8000, IP_ACTIVE_LOW, IPT_BUTTON4         ) PORT_PLAYER(1)
11521152
11531153   PORT_START   // IN1 - Player 2 - b00002.w
1154   PORT_BIT(  0x0100, IP_ACTIVE_LOW, IPT_JOYSTICK_UP      ) PORT_PLAYER(2)
1155   PORT_BIT(  0x0200, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN      ) PORT_PLAYER(2)
1156   PORT_BIT(  0x0400, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT      ) PORT_PLAYER(2)
1157   PORT_BIT(  0x0800, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT   ) PORT_PLAYER(2)
1158   PORT_BIT(  0x1000, IP_ACTIVE_LOW, IPT_BUTTON1         ) PORT_PLAYER(2)
1159   PORT_BIT(  0x2000, IP_ACTIVE_LOW, IPT_BUTTON2         ) PORT_PLAYER(2)
1160   PORT_BIT(  0x4000, IP_ACTIVE_LOW, IPT_BUTTON3         ) PORT_PLAYER(2)
1161   PORT_BIT(  0x8000, IP_ACTIVE_LOW, IPT_UNKNOWN )
1154   PORT_BIT( 0x0100, IP_ACTIVE_LOW, IPT_JOYSTICK_UP      ) PORT_PLAYER(2)
1155   PORT_BIT( 0x0200, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN      ) PORT_PLAYER(2)
1156   PORT_BIT( 0x0400, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT      ) PORT_PLAYER(2)
1157   PORT_BIT( 0x0800, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT   ) PORT_PLAYER(2)
1158   PORT_BIT( 0x1000, IP_ACTIVE_LOW, IPT_BUTTON1         ) PORT_PLAYER(2)
1159   PORT_BIT( 0x2000, IP_ACTIVE_LOW, IPT_BUTTON2         ) PORT_PLAYER(2)
1160   PORT_BIT( 0x4000, IP_ACTIVE_LOW, IPT_BUTTON3         ) PORT_PLAYER(2)
1161   PORT_BIT( 0x8000, IP_ACTIVE_LOW, IPT_UNKNOWN )
11621162
11631163   PORT_START   // IN2 - Coins - b00004.w
1164   PORT_BIT(  0x0100, IP_ACTIVE_LOW, IPT_START1   )
1165   PORT_BIT(  0x0200, IP_ACTIVE_LOW, IPT_START2   )
1166   PORT_BIT(  0x0400, IP_ACTIVE_LOW, IPT_COIN1 ) PORT_IMPULSE(2)
1167   PORT_BIT(  0x0800, IP_ACTIVE_LOW, IPT_COIN2 ) PORT_IMPULSE(2)
1168   PORT_BIT(  0x1000, IP_ACTIVE_LOW, IPT_SERVICE ) PORT_NAME( DEF_STR( Service_Mode )) PORT_CODE(KEYCODE_F2)
1169   PORT_BIT(  0x2000, IP_ACTIVE_LOW, IPT_TILT      )
1170   PORT_BIT(  0x4000, IP_ACTIVE_LOW, IPT_SERVICE1   )
1171   PORT_BIT(  0x8000, IP_ACTIVE_LOW, IPT_SERVICE2   )   // tested
1164   PORT_BIT( 0x0100, IP_ACTIVE_LOW, IPT_START1   )
1165   PORT_BIT( 0x0200, IP_ACTIVE_LOW, IPT_START2   )
1166   PORT_BIT( 0x0400, IP_ACTIVE_LOW, IPT_COIN1 ) PORT_IMPULSE(2)
1167   PORT_BIT( 0x0800, IP_ACTIVE_LOW, IPT_COIN2 ) PORT_IMPULSE(2)
1168   PORT_SERVICE_NO_TOGGLE( 0x1000, IP_ACTIVE_LOW )
1169   PORT_BIT( 0x2000, IP_ACTIVE_LOW, IPT_TILT      )
1170   PORT_BIT( 0x4000, IP_ACTIVE_LOW, IPT_SERVICE1   )
1171   PORT_BIT( 0x8000, IP_ACTIVE_LOW, IPT_SERVICE2   )   // tested
11721172
11731173   PORT_START   // IN3 - ? - b00006.w
1174   PORT_BIT(  0x0100, IP_ACTIVE_LOW, IPT_UNKNOWN )   // tested
1175   PORT_BIT(  0x0200, IP_ACTIVE_LOW, IPT_UNKNOWN )
1176   PORT_BIT(  0x0400, IP_ACTIVE_LOW, IPT_BUTTON4 ) PORT_PLAYER(2)   // tested
1177   PORT_BIT(  0x0800, IP_ACTIVE_LOW, IPT_UNKNOWN )
1178   PORT_BIT(  0x1000, IP_ACTIVE_LOW, IPT_UNKNOWN )
1179   PORT_BIT(  0x2000, IP_ACTIVE_LOW, IPT_UNKNOWN )
1180   PORT_BIT(  0x4000, IP_ACTIVE_LOW, IPT_UNKNOWN )
1181   PORT_BIT(  0x8000, IP_ACTIVE_LOW, IPT_UNKNOWN )
1174   PORT_BIT( 0x0100, IP_ACTIVE_LOW, IPT_UNKNOWN )   // tested
1175   PORT_BIT( 0x0200, IP_ACTIVE_LOW, IPT_UNKNOWN )
1176   PORT_BIT( 0x0400, IP_ACTIVE_LOW, IPT_BUTTON4 ) PORT_PLAYER(2)   // tested
1177   PORT_BIT( 0x0800, IP_ACTIVE_LOW, IPT_UNKNOWN )
1178   PORT_BIT( 0x1000, IP_ACTIVE_LOW, IPT_UNKNOWN )
1179   PORT_BIT( 0x2000, IP_ACTIVE_LOW, IPT_UNKNOWN )
1180   PORT_BIT( 0x4000, IP_ACTIVE_LOW, IPT_UNKNOWN )
1181   PORT_BIT( 0x8000, IP_ACTIVE_LOW, IPT_UNKNOWN )
11821182
11831183   PORT_START   // IN4 - DSW from the MCU - $10497e.b <- $208000.b
11841184   PORT_DIPNAME( 0x0100, 0x0100, DEF_STR( Demo_Sounds ) ) PORT_DIPLOCATION("SW1:1")
r1679r1680
12111211
12121212static INPUT_PORTS_START( bonkadv )
12131213   PORT_START   // IN0 - Player 1 - b00000.w
1214   PORT_BIT(  0x0100, IP_ACTIVE_LOW, IPT_JOYSTICK_UP      ) PORT_PLAYER(1)
1215   PORT_BIT(  0x0200, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN      ) PORT_PLAYER(1)
1216   PORT_BIT(  0x0400, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT      ) PORT_PLAYER(1)
1217   PORT_BIT(  0x0800, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT   ) PORT_PLAYER(1)
1218   PORT_BIT(  0x1000, IP_ACTIVE_LOW, IPT_BUTTON1         ) PORT_PLAYER(1)
1219   PORT_BIT(  0x2000, IP_ACTIVE_LOW, IPT_BUTTON2         ) PORT_PLAYER(1)
1220   PORT_BIT(  0x4000, IP_ACTIVE_LOW, IPT_BUTTON3         ) PORT_PLAYER(1)
1221   PORT_BIT(  0x8000, IP_ACTIVE_LOW, IPT_BUTTON4         ) PORT_PLAYER(1)
1214   PORT_BIT( 0x0100, IP_ACTIVE_LOW, IPT_JOYSTICK_UP      ) PORT_PLAYER(1)
1215   PORT_BIT( 0x0200, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN      ) PORT_PLAYER(1)
1216   PORT_BIT( 0x0400, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT      ) PORT_PLAYER(1)
1217   PORT_BIT( 0x0800, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT   ) PORT_PLAYER(1)
1218   PORT_BIT( 0x1000, IP_ACTIVE_LOW, IPT_BUTTON1         ) PORT_PLAYER(1)
1219   PORT_BIT( 0x2000, IP_ACTIVE_LOW, IPT_BUTTON2         ) PORT_PLAYER(1)
1220   PORT_BIT( 0x4000, IP_ACTIVE_LOW, IPT_BUTTON3         ) PORT_PLAYER(1)
1221   PORT_BIT( 0x8000, IP_ACTIVE_LOW, IPT_BUTTON4         ) PORT_PLAYER(1)
12221222
12231223   PORT_START   // IN1 - Player 2 - b00002.w
1224   PORT_BIT(  0x0100, IP_ACTIVE_LOW, IPT_JOYSTICK_UP      ) PORT_PLAYER(2)
1225   PORT_BIT(  0x0200, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN      ) PORT_PLAYER(2)
1226   PORT_BIT(  0x0400, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT      ) PORT_PLAYER(2)
1227   PORT_BIT(  0x0800, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT   ) PORT_PLAYER(2)
1228   PORT_BIT(  0x1000, IP_ACTIVE_LOW, IPT_BUTTON1         ) PORT_PLAYER(2)
1229   PORT_BIT(  0x2000, IP_ACTIVE_LOW, IPT_BUTTON2         ) PORT_PLAYER(2)
1230   PORT_BIT(  0x4000, IP_ACTIVE_LOW, IPT_BUTTON3         ) PORT_PLAYER(2)
1231   PORT_BIT(  0x8000, IP_ACTIVE_LOW, IPT_BUTTON4         ) PORT_PLAYER(2)
1224   PORT_BIT( 0x0100, IP_ACTIVE_LOW, IPT_JOYSTICK_UP      ) PORT_PLAYER(2)
1225   PORT_BIT( 0x0200, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN      ) PORT_PLAYER(2)
1226   PORT_BIT( 0x0400, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT      ) PORT_PLAYER(2)
1227   PORT_BIT( 0x0800, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT   ) PORT_PLAYER(2)
1228   PORT_BIT( 0x1000, IP_ACTIVE_LOW, IPT_BUTTON1         ) PORT_PLAYER(2)
1229   PORT_BIT( 0x2000, IP_ACTIVE_LOW, IPT_BUTTON2         ) PORT_PLAYER(2)
1230   PORT_BIT( 0x4000, IP_ACTIVE_LOW, IPT_BUTTON3         ) PORT_PLAYER(2)
1231   PORT_BIT( 0x8000, IP_ACTIVE_LOW, IPT_BUTTON4         ) PORT_PLAYER(2)
12321232
12331233   PORT_START   // IN2 - Coins - b00004.w
1234   PORT_BIT(  0x0100, IP_ACTIVE_LOW, IPT_START1   )
1235   PORT_BIT(  0x0200, IP_ACTIVE_LOW, IPT_START2   )
1236   PORT_BIT(  0x0400, IP_ACTIVE_LOW, IPT_COIN1 ) PORT_IMPULSE(2)
1237   PORT_BIT(  0x0800, IP_ACTIVE_LOW, IPT_COIN2 ) PORT_IMPULSE(2)
1238   PORT_BIT(  0x1000, IP_ACTIVE_LOW, IPT_SERVICE ) PORT_NAME( DEF_STR( Service_Mode )) PORT_CODE(KEYCODE_F2)
1239   PORT_BIT(  0x2000, IP_ACTIVE_LOW, IPT_TILT      )
1240   PORT_BIT(  0x4000, IP_ACTIVE_LOW, IPT_SERVICE1   )
1241   PORT_BIT(  0x8000, IP_ACTIVE_LOW, IPT_SERVICE2   )
1234   PORT_BIT( 0x0100, IP_ACTIVE_LOW, IPT_START1   )
1235   PORT_BIT( 0x0200, IP_ACTIVE_LOW, IPT_START2   )
1236   PORT_BIT( 0x0400, IP_ACTIVE_LOW, IPT_COIN1 ) PORT_IMPULSE(2)
1237   PORT_BIT( 0x0800, IP_ACTIVE_LOW, IPT_COIN2 ) PORT_IMPULSE(2)
1238   PORT_SERVICE_NO_TOGGLE( 0x1000, IP_ACTIVE_LOW )
1239   PORT_BIT( 0x2000, IP_ACTIVE_LOW, IPT_TILT      )
1240   PORT_BIT( 0x4000, IP_ACTIVE_LOW, IPT_SERVICE1   )
1241   PORT_BIT( 0x8000, IP_ACTIVE_LOW, IPT_SERVICE2   )
12421242
12431243   PORT_START   // IN3 - ? - b00006.w
1244   PORT_BIT(  0x0100, IP_ACTIVE_LOW, IPT_UNKNOWN )
1245   PORT_BIT(  0x0200, IP_ACTIVE_LOW, IPT_UNKNOWN )
1246   PORT_BIT(  0x0400, IP_ACTIVE_LOW, IPT_UNKNOWN )
1247   PORT_BIT(  0x0800, IP_ACTIVE_LOW, IPT_UNKNOWN )
1248   PORT_BIT(  0x1000, IP_ACTIVE_LOW, IPT_UNKNOWN ) // tested
1249   PORT_BIT(  0x2000, IP_ACTIVE_LOW, IPT_UNKNOWN ) // tested
1250   PORT_BIT(  0x4000, IP_ACTIVE_LOW, IPT_UNKNOWN )
1251   PORT_BIT(  0x8000, IP_ACTIVE_LOW, IPT_UNKNOWN )
1244   PORT_BIT( 0x0100, IP_ACTIVE_LOW, IPT_UNKNOWN )
1245   PORT_BIT( 0x0200, IP_ACTIVE_LOW, IPT_UNKNOWN )
1246   PORT_BIT( 0x0400, IP_ACTIVE_LOW, IPT_UNKNOWN )
1247   PORT_BIT( 0x0800, IP_ACTIVE_LOW, IPT_UNKNOWN )
1248   PORT_BIT( 0x1000, IP_ACTIVE_LOW, IPT_UNKNOWN ) // tested
1249   PORT_BIT( 0x2000, IP_ACTIVE_LOW, IPT_UNKNOWN ) // tested
1250   PORT_BIT( 0x4000, IP_ACTIVE_LOW, IPT_UNKNOWN )
1251   PORT_BIT( 0x8000, IP_ACTIVE_LOW, IPT_UNKNOWN )
12521252
12531253   PORT_START   // IN4 - DSW from the MCU - $10019e.b <- $200200.b
12541254   PORT_DIPNAME( 0x0100, 0x0100, DEF_STR( Flip_Screen ) )
r1679r1680
12821282
12831283static INPUT_PORTS_START( gtmr )
12841284   PORT_START   // IN0 - Player 1 - b00000.w
1285   PORT_BIT(  0x0100, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_8WAY PORT_PLAYER(1)
1286   PORT_BIT(  0x0200, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_8WAY PORT_PLAYER(1)
1287   PORT_BIT(  0x0400, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_8WAY PORT_PLAYER(1)
1288   PORT_BIT(  0x0800, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_8WAY PORT_PLAYER(1)
1289   PORT_BIT(  0x1000, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_PLAYER(1) // swapped for consistency:
1290   PORT_BIT(  0x2000, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(1) // button1 is usually accel.
1291   PORT_BIT(  0x4000, IP_ACTIVE_LOW, IPT_UNKNOWN )
1292   PORT_BIT(  0x8000, IP_ACTIVE_LOW, IPT_UNKNOWN )
1285   PORT_BIT( 0x0100, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_8WAY PORT_PLAYER(1)
1286   PORT_BIT( 0x0200, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_8WAY PORT_PLAYER(1)
1287   PORT_BIT( 0x0400, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_8WAY PORT_PLAYER(1)
1288   PORT_BIT( 0x0800, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_8WAY PORT_PLAYER(1)
1289   PORT_BIT( 0x1000, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_PLAYER(1) // swapped for consistency:
1290   PORT_BIT( 0x2000, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(1) // button1 is usually accel.
1291   PORT_BIT( 0x4000, IP_ACTIVE_LOW, IPT_UNKNOWN )
1292   PORT_BIT( 0x8000, IP_ACTIVE_LOW, IPT_UNKNOWN )
12931293
12941294   PORT_START   // IN1 - Player 2 - b00002.w
1295   PORT_BIT(  0x0100, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_8WAY PORT_PLAYER(2)
1296   PORT_BIT(  0x0200, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_8WAY PORT_PLAYER(2)
1297   PORT_BIT(  0x0400, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_8WAY PORT_PLAYER(2)
1298   PORT_BIT(  0x0800, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_8WAY PORT_PLAYER(2)
1299   PORT_BIT(  0x1000, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_PLAYER(2) // swapped for consistency:
1300   PORT_BIT(  0x2000, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(2) // button1 is usually accel.
1301   PORT_BIT(  0x4000, IP_ACTIVE_LOW, IPT_UNKNOWN )
1302   PORT_BIT(  0x8000, IP_ACTIVE_LOW, IPT_UNKNOWN )
1295   PORT_BIT( 0x0100, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_8WAY PORT_PLAYER(2)
1296   PORT_BIT( 0x0200, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_8WAY PORT_PLAYER(2)
1297   PORT_BIT( 0x0400, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_8WAY PORT_PLAYER(2)
1298   PORT_BIT( 0x0800, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_8WAY PORT_PLAYER(2)
1299   PORT_BIT( 0x1000, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_PLAYER(2) // swapped for consistency:
1300   PORT_BIT( 0x2000, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(2) // button1 is usually accel.
1301   PORT_BIT( 0x4000, IP_ACTIVE_LOW, IPT_UNKNOWN )
1302   PORT_BIT( 0x8000, IP_ACTIVE_LOW, IPT_UNKNOWN )
13031303
13041304   PORT_START   // IN2 - Coins - b00004.w
1305   PORT_BIT(  0x0100, IP_ACTIVE_LOW, IPT_START1   )
1306   PORT_BIT(  0x0200, IP_ACTIVE_LOW, IPT_START2   )
1305   PORT_BIT( 0x0100, IP_ACTIVE_LOW, IPT_START1   )
1306   PORT_BIT( 0x0200, IP_ACTIVE_LOW, IPT_START2   )
13071307   PORT_BIT( 0x0400, IP_ACTIVE_LOW, IPT_COIN1 ) PORT_IMPULSE(2)
13081308   PORT_BIT( 0x0800, IP_ACTIVE_LOW, IPT_COIN2 ) PORT_IMPULSE(2)
1309   PORT_BIT( 0x1000, IP_ACTIVE_LOW, IPT_SERVICE ) PORT_NAME( DEF_STR( Service_Mode )) PORT_CODE(KEYCODE_F2)
1310   PORT_BIT(  0x2000, IP_ACTIVE_LOW, IPT_TILT      )
1311   PORT_BIT(  0x4000, IP_ACTIVE_LOW, IPT_SERVICE1   )
1312   PORT_BIT(  0x8000, IP_ACTIVE_LOW, IPT_UNKNOWN   )
1309   PORT_SERVICE_NO_TOGGLE( 0x1000, IP_ACTIVE_LOW )
1310   PORT_BIT( 0x2000, IP_ACTIVE_LOW, IPT_TILT      )
1311   PORT_BIT( 0x4000, IP_ACTIVE_LOW, IPT_SERVICE1   )
1312   PORT_BIT( 0x8000, IP_ACTIVE_LOW, IPT_UNKNOWN   )
13131313
13141314   PORT_START   // IN3 - Seems unused ! - b00006.w
1315   PORT_BIT(  0x0100, IP_ACTIVE_LOW, IPT_UNKNOWN )
1316   PORT_BIT(  0x0200, IP_ACTIVE_LOW, IPT_UNKNOWN )
1317   PORT_BIT(  0x0400, IP_ACTIVE_LOW, IPT_UNKNOWN )
1318   PORT_BIT(  0x0800, IP_ACTIVE_LOW, IPT_UNKNOWN )
1319   PORT_BIT(  0x1000, IP_ACTIVE_LOW, IPT_UNKNOWN )
1320   PORT_BIT(  0x2000, IP_ACTIVE_LOW, IPT_UNKNOWN )
1321   PORT_BIT(  0x4000, IP_ACTIVE_LOW, IPT_UNKNOWN )
1322   PORT_BIT(  0x8000, IP_ACTIVE_LOW, IPT_UNKNOWN )
1315   PORT_BIT( 0x0100, IP_ACTIVE_LOW, IPT_UNKNOWN )
1316   PORT_BIT( 0x0200, IP_ACTIVE_LOW, IPT_UNKNOWN )
1317   PORT_BIT( 0x0400, IP_ACTIVE_LOW, IPT_UNKNOWN )
1318   PORT_BIT( 0x0800, IP_ACTIVE_LOW, IPT_UNKNOWN )
1319   PORT_BIT( 0x1000, IP_ACTIVE_LOW, IPT_UNKNOWN )
1320   PORT_BIT( 0x2000, IP_ACTIVE_LOW, IPT_UNKNOWN )
1321   PORT_BIT( 0x4000, IP_ACTIVE_LOW, IPT_UNKNOWN )
1322   PORT_BIT( 0x8000, IP_ACTIVE_LOW, IPT_UNKNOWN )
13231323
13241324   PORT_START   // IN4 - DSW from the MCU - 101265.b <- 206000.b
13251325   PORT_SERVICE_DIPLOC(  0x0100, IP_ACTIVE_LOW, "SW1:1" )
r1679r1680
13551355
13561356static INPUT_PORTS_START( gtmr2 )
13571357   PORT_START   // IN0 - Player 1 - 100004.w <- b00000.w (cpl)
1358   PORT_BIT(  0x0100, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_8WAY PORT_PLAYER(1)
1359   PORT_BIT(  0x0200, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_8WAY PORT_PLAYER(1)
1360   PORT_BIT(  0x0400, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_8WAY PORT_PLAYER(1)
1361   PORT_BIT(  0x0800, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_8WAY PORT_PLAYER(1)
1362   PORT_BIT(  0x1000, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_PLAYER(1) // swapped for consistency:
1363   PORT_BIT(  0x2000, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(1) // button1 is usually accel.
1364   PORT_BIT(  0x4000, IP_ACTIVE_LOW, IPT_UNKNOWN )
1365   PORT_BIT(  0x8000, IP_ACTIVE_LOW, IPT_UNKNOWN )
1358   PORT_BIT( 0x0100, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_8WAY PORT_PLAYER(1)
1359   PORT_BIT( 0x0200, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_8WAY PORT_PLAYER(1)
1360   PORT_BIT( 0x0400, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_8WAY PORT_PLAYER(1)
1361   PORT_BIT( 0x0800, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_8WAY PORT_PLAYER(1)
1362   PORT_BIT( 0x1000, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_PLAYER(1) // swapped for consistency:
1363   PORT_BIT( 0x2000, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(1) // button1 is usually accel.
1364   PORT_BIT( 0x4000, IP_ACTIVE_LOW, IPT_UNKNOWN )
1365   PORT_BIT( 0x8000, IP_ACTIVE_LOW, IPT_UNKNOWN )
13661366
13671367   PORT_START   // IN1 - Player 2 - 10000c.w <- b00002.w (cpl) - for "test mode" only
1368   PORT_BIT(  0x0100, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_8WAY PORT_PLAYER(2)
1369   PORT_BIT(  0x0200, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_8WAY PORT_PLAYER(2)
1370   PORT_BIT(  0x0400, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_8WAY PORT_PLAYER(2)
1371   PORT_BIT(  0x0800, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_8WAY PORT_PLAYER(2)
1372   PORT_BIT(  0x1000, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_PLAYER(2) // swapped for consistency:
1373   PORT_BIT(  0x2000, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(2) // button1 is usually accel.
1374   PORT_BIT(  0x4000, IP_ACTIVE_LOW, IPT_UNKNOWN )
1375   PORT_BIT(  0x8000, IP_ACTIVE_LOW, IPT_UNKNOWN )
1368   PORT_BIT( 0x0100, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_8WAY PORT_PLAYER(2)
1369   PORT_BIT( 0x0200, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_8WAY PORT_PLAYER(2)
1370   PORT_BIT( 0x0400, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_8WAY PORT_PLAYER(2)
1371   PORT_BIT( 0x0800, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_8WAY PORT_PLAYER(2)
1372   PORT_BIT( 0x1000, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_PLAYER(2) // swapped for consistency:
1373   PORT_BIT( 0x2000, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(2) // button1 is usually accel.
1374   PORT_BIT( 0x4000, IP_ACTIVE_LOW, IPT_UNKNOWN )
1375   PORT_BIT( 0x8000, IP_ACTIVE_LOW, IPT_UNKNOWN )
13761376
13771377   PORT_START   // IN2 - Coins - 100014.w <- b00004.w (cpl)
1378   PORT_BIT(  0x0100, IP_ACTIVE_LOW, IPT_START1   )
1379   PORT_BIT(  0x0200, IP_ACTIVE_LOW, IPT_START2   )   // only in "test mode"
1378   PORT_BIT( 0x0100, IP_ACTIVE_LOW, IPT_START1   )
1379   PORT_BIT( 0x0200, IP_ACTIVE_LOW, IPT_START2   )   // only in "test mode"
13801380   PORT_BIT( 0x0400, IP_ACTIVE_LOW, IPT_COIN1 ) PORT_IMPULSE(2)
13811381   PORT_BIT( 0x0800, IP_ACTIVE_LOW, IPT_COIN2 ) PORT_IMPULSE(2)
1382   PORT_BIT( 0x1000, IP_ACTIVE_LOW, IPT_SERVICE ) PORT_NAME( DEF_STR( Service_Mode )) PORT_CODE(KEYCODE_F2)
1383   PORT_BIT(  0x2000, IP_ACTIVE_LOW, IPT_TILT   )
1384   PORT_BIT(  0x4000, IP_ACTIVE_LOW, IPT_SERVICE1   )
1385   PORT_BIT(  0x8000, IP_ACTIVE_LOW, IPT_UNKNOWN   )
1382   PORT_SERVICE_NO_TOGGLE( 0x1000, IP_ACTIVE_LOW )
1383   PORT_BIT( 0x2000, IP_ACTIVE_LOW, IPT_TILT   )
1384   PORT_BIT( 0x4000, IP_ACTIVE_LOW, IPT_SERVICE1   )
1385   PORT_BIT( 0x8000, IP_ACTIVE_LOW, IPT_UNKNOWN   )
13861386
13871387   PORT_START   // IN3 - 100017.w <- b00006.w
1388   PORT_BIT(  0x0100, IP_ACTIVE_LOW, IPT_UNKNOWN )
1389   PORT_BIT(  0x0200, IP_ACTIVE_LOW, IPT_UNKNOWN )
1390   PORT_BIT(  0x0400, IP_ACTIVE_LOW, IPT_UNKNOWN )
1391   PORT_BIT(  0x0800, IP_ACTIVE_LOW, IPT_UNKNOWN )
1392   PORT_BIT(  0x1000, IP_ACTIVE_LOW, IPT_UNKNOWN )
1393   PORT_BIT(  0x2000, IP_ACTIVE_LOW, IPT_UNKNOWN )
1388   PORT_BIT( 0x0100, IP_ACTIVE_LOW, IPT_UNKNOWN )
1389   PORT_BIT( 0x0200, IP_ACTIVE_LOW, IPT_UNKNOWN )
1390   PORT_BIT( 0x0400, IP_ACTIVE_LOW, IPT_UNKNOWN )
1391   PORT_BIT( 0x0800, IP_ACTIVE_LOW, IPT_UNKNOWN )
1392   PORT_BIT( 0x1000, IP_ACTIVE_LOW, IPT_UNKNOWN )
1393   PORT_BIT( 0x2000, IP_ACTIVE_LOW, IPT_UNKNOWN )
13941394   PORT_BIT( 0x4000, IP_ACTIVE_LOW, IPT_BUTTON3 ) PORT_NAME("IN 3-6")   // Code at 0x002236 - Centers 270D wheel ?
1395   PORT_BIT( 0x8000, IP_ACTIVE_LOW, IPT_UNKNOWN )
1395   PORT_BIT( 0x8000, IP_ACTIVE_LOW, IPT_UNKNOWN )
13961396
13971397   PORT_START   // IN4 - DSW from the MCU - 1016f7.b <- 206000.b
13981398   PORT_DIPNAME( 0x0700, 0x0700, "Linked Operation Board Number" ) PORT_DIPLOCATION("SW1:6,7,8")
r1679r1680
14301430
14311431   PORT_START   // Fake IN1 - To be pressed during boot sequence - Code at 0x000c9e
14321432   PORT_BIT( 0x0100, IP_ACTIVE_LOW, IPT_BUTTON5 ) PORT_NAME("IN 1-0") PORT_CODE(KEYCODE_H)   // "sound test"
1433   PORT_BIT(  0x2000, IP_ACTIVE_LOW, IPT_UNKNOWN )
1434   PORT_BIT(  0x4000, IP_ACTIVE_LOW, IPT_UNKNOWN )
1435   PORT_BIT(  0x8000, IP_ACTIVE_LOW, IPT_UNKNOWN )
1433   PORT_BIT( 0x2000, IP_ACTIVE_LOW, IPT_UNKNOWN )
1434   PORT_BIT( 0x4000, IP_ACTIVE_LOW, IPT_UNKNOWN )
1435   PORT_BIT( 0x8000, IP_ACTIVE_LOW, IPT_UNKNOWN )
14361436   PORT_BIT( 0x1000, IP_ACTIVE_LOW, IPT_BUTTON6 ) PORT_NAME("IN 1-4") PORT_CODE(KEYCODE_J)   // "view tiles"
14371437   PORT_BIT( 0x2000, IP_ACTIVE_LOW, IPT_BUTTON7 ) PORT_NAME("IN 1-5") PORT_CODE(KEYCODE_K)   // "view memory"
14381438   PORT_BIT( 0x4000, IP_ACTIVE_LOW, IPT_BUTTON8 ) PORT_NAME("IN 1-6") PORT_CODE(KEYCODE_L)   // "view sprites ?"
1439   PORT_BIT( 0x8000, IP_ACTIVE_LOW, IPT_UNKNOWN )
1439   PORT_BIT( 0x8000, IP_ACTIVE_LOW, IPT_UNKNOWN )
14401440INPUT_PORTS_END
14411441
14421442
r1679r1680
14581458   PORT_DIPUNUSED_DIPLOC( 0x0040, 0x0040, "SW1:7" ) /* Listed as "Unused" */
14591459   PORT_DIPUNUSED_DIPLOC( 0x0080, 0x0080, "SW1:8" ) /* Listed as "Unused" */
14601460
1461   PORT_BIT(  0x0100, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_PLAYER(1)
1462   PORT_BIT(  0x0200, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_PLAYER(1)
1463   PORT_BIT(  0x0400, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_PLAYER(1)
1464   PORT_BIT(  0x0800, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_PLAYER(1)
1465   PORT_BIT(  0x1000, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(1)
1466   PORT_BIT(  0x2000, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_PLAYER(1)
1467   PORT_BIT(  0x4000, IP_ACTIVE_LOW, IPT_UNKNOWN )
1468   PORT_BIT(  0x8000, IP_ACTIVE_LOW, IPT_UNKNOWN )
1461   PORT_BIT( 0x0100, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_PLAYER(1)
1462   PORT_BIT( 0x0200, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_PLAYER(1)
1463   PORT_BIT( 0x0400, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_PLAYER(1)
1464   PORT_BIT( 0x0800, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_PLAYER(1)
1465   PORT_BIT( 0x1000, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(1)
1466   PORT_BIT( 0x2000, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_PLAYER(1)
1467   PORT_BIT( 0x4000, IP_ACTIVE_LOW, IPT_UNKNOWN )
1468   PORT_BIT( 0x8000, IP_ACTIVE_LOW, IPT_UNKNOWN )
14691469
14701470   PORT_START   // IN1 - Player 2 - c00002.b
1471   PORT_BIT(  0x0001, IP_ACTIVE_LOW, IPT_UNKNOWN )
1472   PORT_BIT(  0x0002, IP_ACTIVE_LOW, IPT_UNKNOWN )
1473   PORT_BIT(  0x0004, IP_ACTIVE_LOW, IPT_UNKNOWN )
1474   PORT_BIT(  0x0008, IP_ACTIVE_LOW, IPT_UNKNOWN )
1475   PORT_BIT(  0x0010, IP_ACTIVE_LOW, IPT_UNKNOWN )
1476   PORT_BIT(  0x0020, IP_ACTIVE_LOW, IPT_UNKNOWN )
1477   PORT_BIT(  0x0040, IP_ACTIVE_LOW, IPT_UNKNOWN )
1478   PORT_BIT(  0x0080, IP_ACTIVE_LOW, IPT_UNKNOWN )
1471   PORT_BIT( 0x0001, IP_ACTIVE_LOW, IPT_UNKNOWN )
1472   PORT_BIT( 0x0002, IP_ACTIVE_LOW, IPT_UNKNOWN )
1473   PORT_BIT( 0x0004, IP_ACTIVE_LOW, IPT_UNKNOWN )
1474   PORT_BIT( 0x0008, IP_ACTIVE_LOW, IPT_UNKNOWN )
1475   PORT_BIT( 0x0010, IP_ACTIVE_LOW, IPT_UNKNOWN )
1476   PORT_BIT( 0x0020, IP_ACTIVE_LOW, IPT_UNKNOWN )
1477   PORT_BIT( 0x0040, IP_ACTIVE_LOW, IPT_UNKNOWN )
1478   PORT_BIT( 0x0080, IP_ACTIVE_LOW, IPT_UNKNOWN )
14791479
1480   PORT_BIT(  0x0100, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_PLAYER(2)
1481   PORT_BIT(  0x0200, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_PLAYER(2)
1482   PORT_BIT(  0x0400, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_PLAYER(2)
1483   PORT_BIT(  0x0800, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_PLAYER(2)
1484   PORT_BIT(  0x1000, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(2)
1485   PORT_BIT(  0x2000, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_PLAYER(2)
1486   PORT_BIT(  0x4000, IP_ACTIVE_LOW, IPT_UNKNOWN )
1487   PORT_BIT(  0x8000, IP_ACTIVE_LOW, IPT_UNKNOWN )
1480   PORT_BIT( 0x0100, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_PLAYER(2)
1481   PORT_BIT( 0x0200, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_PLAYER(2)
1482   PORT_BIT( 0x0400, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_PLAYER(2)
1483   PORT_BIT( 0x0800, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_PLAYER(2)
1484   PORT_BIT( 0x1000, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(2)
1485   PORT_BIT( 0x2000, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_PLAYER(2)
1486   PORT_BIT( 0x4000, IP_ACTIVE_LOW, IPT_UNKNOWN )
1487   PORT_BIT( 0x8000, IP_ACTIVE_LOW, IPT_UNKNOWN )
14881488
14891489   PORT_START   // IN2 - Other Buttons - c00004.b
14901490   PORT_BIT( 0x00ff, IP_ACTIVE_LOW, IPT_UNKNOWN  )
r1679r1680
14921492   PORT_BIT( 0x0200, IP_ACTIVE_LOW, IPT_START2   )
14931493   PORT_BIT( 0x0400, IP_ACTIVE_LOW, IPT_COIN1 ) PORT_IMPULSE(2)
14941494   PORT_BIT( 0x0800, IP_ACTIVE_LOW, IPT_COIN2 ) PORT_IMPULSE(2)
1495   PORT_BIT( 0x1000, IP_ACTIVE_LOW, IPT_SERVICE ) PORT_NAME( DEF_STR( Service_Mode )) PORT_CODE(KEYCODE_F2)
1495   PORT_SERVICE_NO_TOGGLE( 0x1000, IP_ACTIVE_LOW )
14961496   PORT_BIT( 0x2000, IP_ACTIVE_LOW, IPT_TILT     )
14971497   PORT_BIT( 0x4000, IP_ACTIVE_LOW, IPT_SERVICE1 )
14981498   PORT_BIT( 0x8000, IP_ACTIVE_LOW, IPT_UNKNOWN  )
r1679r1680
15061506
15071507static INPUT_PORTS_START( shogwarr )
15081508   PORT_START   // IN0 - - b80000.w
1509   PORT_BIT(  0x0100, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_8WAY PORT_PLAYER(1)
1510   PORT_BIT(  0x0200, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_8WAY PORT_PLAYER(1)
1511   PORT_BIT(  0x0400, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_8WAY PORT_PLAYER(1)
1512   PORT_BIT(  0x0800, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_8WAY PORT_PLAYER(1)
1513   PORT_BIT(  0x1000, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(1)
1514   PORT_BIT(  0x2000, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_PLAYER(1)
1515   PORT_BIT(  0x4000, IP_ACTIVE_LOW, IPT_BUTTON3 ) PORT_PLAYER(1)
1516   PORT_BIT(  0x8000, IP_ACTIVE_LOW, IPT_UNKNOWN )   // ? tested
1509   PORT_BIT( 0x0100, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_8WAY PORT_PLAYER(1)
1510   PORT_BIT( 0x0200, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_8WAY PORT_PLAYER(1)
1511   PORT_BIT( 0x0400, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_8WAY PORT_PLAYER(1)
1512   PORT_BIT( 0x0800, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_8WAY PORT_PLAYER(1)
1513   PORT_BIT( 0x1000, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(1)
1514   PORT_BIT( 0x2000, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_PLAYER(1)
1515   PORT_BIT( 0x4000, IP_ACTIVE_LOW, IPT_BUTTON3 ) PORT_PLAYER(1)
1516   PORT_BIT( 0x8000, IP_ACTIVE_LOW, IPT_UNKNOWN )   // ? tested
15171517
15181518   PORT_START   // IN1 - - b80002.w
1519   PORT_BIT(  0x0100, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_8WAY PORT_PLAYER(2)
1520   PORT_BIT(  0x0200, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_8WAY PORT_PLAYER(2)
1521   PORT_BIT(  0x0400, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_8WAY PORT_PLAYER(2)
1522   PORT_BIT(  0x0800, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_8WAY PORT_PLAYER(2)
1523   PORT_BIT(  0x1000, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(2)
1524   PORT_BIT(  0x2000, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_PLAYER(2)
1525   PORT_BIT(  0x4000, IP_ACTIVE_LOW, IPT_BUTTON3 ) PORT_PLAYER(2)
1526   PORT_BIT(  0x8000, IP_ACTIVE_LOW, IPT_UNKNOWN )   // ? tested
1519   PORT_BIT( 0x0100, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_8WAY PORT_PLAYER(2)
1520   PORT_BIT( 0x0200, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_8WAY PORT_PLAYER(2)
1521   PORT_BIT( 0x0400, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_8WAY PORT_PLAYER(2)
1522   PORT_BIT( 0x0800, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_8WAY PORT_PLAYER(2)
1523   PORT_BIT( 0x1000, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(2)
1524   PORT_BIT( 0x2000, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_PLAYER(2)
1525   PORT_BIT( 0x4000, IP_ACTIVE_LOW, IPT_BUTTON3 ) PORT_PLAYER(2)
1526   PORT_BIT( 0x8000, IP_ACTIVE_LOW, IPT_UNKNOWN )   // ? tested
15271527
15281528   PORT_START   // IN2 - Coins - b80004.w
1529   PORT_BIT(  0x0100, IP_ACTIVE_LOW, IPT_START1   )
1530   PORT_BIT(  0x0200, IP_ACTIVE_LOW, IPT_START2   )
1531   PORT_BIT(  0x0400, IP_ACTIVE_LOW, IPT_COIN1 ) PORT_IMPULSE(2)
1532   PORT_BIT(  0x0800, IP_ACTIVE_LOW, IPT_COIN2 ) PORT_IMPULSE(2)
1533   PORT_BIT(  0x1000, IP_ACTIVE_LOW, IPT_SERVICE ) PORT_NAME( DEF_STR( Service_Mode )) PORT_CODE(KEYCODE_F2)
1534   PORT_BIT(  0x2000, IP_ACTIVE_LOW, IPT_TILT      )
1535   PORT_BIT(  0x4000, IP_ACTIVE_LOW, IPT_SERVICE1   )
1536   PORT_BIT(  0x8000, IP_ACTIVE_LOW, IPT_UNKNOWN   )   // ? tested
1529   PORT_BIT( 0x0100, IP_ACTIVE_LOW, IPT_START1   )
1530   PORT_BIT( 0x0200, IP_ACTIVE_LOW, IPT_START2   )
1531   PORT_BIT( 0x0400, IP_ACTIVE_LOW, IPT_COIN1 ) PORT_IMPULSE(2)
1532   PORT_BIT( 0x0800, IP_ACTIVE_LOW, IPT_COIN2 ) PORT_IMPULSE(2)
1533   PORT_SERVICE_NO_TOGGLE( 0x1000, IP_ACTIVE_LOW )
1534   PORT_BIT( 0x2000, IP_ACTIVE_LOW, IPT_TILT      )
1535   PORT_BIT( 0x4000, IP_ACTIVE_LOW, IPT_SERVICE1   )
1536   PORT_BIT( 0x8000, IP_ACTIVE_LOW, IPT_UNKNOWN   )   // ? tested
15371537
15381538   PORT_START   // IN3 - ? - b80006.w
1539   PORT_BIT(  0x0100, IP_ACTIVE_LOW, IPT_UNKNOWN )
1540   PORT_BIT(  0x0200, IP_ACTIVE_LOW, IPT_UNKNOWN )
1541   PORT_BIT(  0x0400, IP_ACTIVE_LOW, IPT_UNKNOWN )
1542   PORT_BIT(  0x0800, IP_ACTIVE_LOW, IPT_UNKNOWN )
1543   PORT_BIT(  0x1000, IP_ACTIVE_LOW, IPT_UNKNOWN )
1544   PORT_BIT(  0x2000, IP_ACTIVE_LOW, IPT_UNKNOWN )
1545   PORT_BIT(  0x4000, IP_ACTIVE_LOW, IPT_UNKNOWN )
1546   PORT_BIT(  0x8000, IP_ACTIVE_LOW, IPT_UNKNOWN )
1539   PORT_BIT( 0x0100, IP_ACTIVE_LOW, IPT_UNKNOWN )
1540   PORT_BIT( 0x0200, IP_ACTIVE_LOW, IPT_UNKNOWN )
1541   PORT_BIT( 0x0400, IP_ACTIVE_LOW, IPT_UNKNOWN )
1542   PORT_BIT( 0x0800, IP_ACTIVE_LOW, IPT_UNKNOWN )
1543   PORT_BIT( 0x1000, IP_ACTIVE_LOW, IPT_UNKNOWN )
1544   PORT_BIT( 0x2000, IP_ACTIVE_LOW, IPT_UNKNOWN )
1545   PORT_BIT( 0x4000, IP_ACTIVE_LOW, IPT_UNKNOWN )
1546   PORT_BIT( 0x8000, IP_ACTIVE_LOW, IPT_UNKNOWN )
15471547
15481548   PORT_START   // IN4 - DSW from the MCU - 102e15.b <- 200059.b
15491549   PORT_DIPNAME( 0x01, 0x01, DEF_STR( Flip_Screen ) ) PORT_DIPLOCATION("SW1:1")
r1679r1680
23872387 BZ_BG.U2           57C8200       BG CHR
23882388 BZ_SP1.U20         27C8001       OBJ
23892389 BZ_SP2.U21         27C8001       OBJ
2390 BZ_SP1.U68 ( == BZ_SP1.U20)
2391 BZ_SP2.U86 ( == BZ_SP2.U21)
2390 BZ_SP1.U68         27C8001       OBJ (same as BZ_SP1.U20 for 2nd sprite chip)
2391 BZ_SP2.U86         27C8001       OBJ (same as BZ_SP2.U21 for 2nd sprite chip)
23922392
23932393***************************************************************************/
23942394
src/mame/drivers/goldstar.c
r1679r1680
299299   MDRV_SCREEN_VISIBLE_AREA(0*8, 64*8-1, 2*8, 30*8-1)
300300   MDRV_GFXDECODE(goldstar)
301301   MDRV_PALETTE_LENGTH(256)
302   MDRV_COLORTABLE_LENGTH(256)
303302   MDRV_NVRAM_HANDLER(goldstar)
304303
305304   MDRV_VIDEO_START(goldstar)
r1679r1680
336335   MDRV_SCREEN_VISIBLE_AREA(0*8, 64*8-1, 2*8, 30*8-1)
337336   MDRV_GFXDECODE(bl)
338337   MDRV_PALETTE_LENGTH(256)
339   MDRV_COLORTABLE_LENGTH(256)
340338   MDRV_NVRAM_HANDLER(goldstar)
341339
342340   MDRV_VIDEO_START(goldstar)
r1679r1680
372370   MDRV_SCREEN_VISIBLE_AREA(0*8, 64*8-1, 2*8, 30*8-1)
373371   MDRV_GFXDECODE(ml)
374372   MDRV_PALETTE_LENGTH(256)
375   MDRV_COLORTABLE_LENGTH(256)
376373   MDRV_NVRAM_HANDLER(goldstar)
377374
378375   MDRV_VIDEO_START(goldstar)
src/mame/drivers/dbz.c
r1679r1680
269269   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_START2 )
270270   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_START1 )
271271   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_SERVICE1 )
272   PORT_BIT(0x08, IP_ACTIVE_LOW, IPT_SERVICE ) PORT_NAME("Test Switch") PORT_CODE(KEYCODE_F2)            // "Test"
272   PORT_SERVICE_NO_TOGGLE( 0x08, IP_ACTIVE_LOW )
273273   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_COIN2 )
274274   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_COIN1 )
275275   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_BUTTON4 ) PORT_PLAYER(2)
r1679r1680
362362   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_START2 )
363363   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_START1 )
364364   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_SERVICE1 )
365   PORT_BIT(0x08, IP_ACTIVE_LOW, IPT_SERVICE ) PORT_NAME("Test Switch") PORT_CODE(KEYCODE_F2)      // "Test"
365   PORT_SERVICE_NO_TOGGLE( 0x08, IP_ACTIVE_LOW )
366366   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_COIN2 )
367367   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_COIN1 )
368368   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_BUTTON4 ) PORT_PLAYER(2)
src/mame/drivers/cybertnk.c
r1679r1680
193193
194194static VIDEO_START( cybertnk )
195195{
196   tx_tilemap = tilemap_create(get_tx_tile_info,tilemap_scan_rows,TILEMAP_TYPE_PEN,8,8,128,32);
196   tx_tilemap = tilemap_create(get_tx_tile_info,tilemap_scan_rows,8,8,128,32);
197197}
198198
199199static VIDEO_UPDATE( cybertnk )
r1679r1680
409409   PORT_BIT( 0x0100, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(2) // MG 2
410410   PORT_BIT( 0x0200, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_PLAYER(2) // Cannon 2
411411   PORT_BIT( 0x0400, IP_ACTIVE_LOW, IPT_SERVICE1 )
412   PORT_BIT( 0x0800, IP_ACTIVE_LOW, IPT_SERVICE ) PORT_NAME(DEF_STR( Test )) PORT_CODE(KEYCODE_F2)
412   PORT_SERVICE_NO_TOGGLE( 0x0800, IP_ACTIVE_LOW )
413413   PORT_BIT( 0x1000, IP_ACTIVE_LOW, IPT_START2 )
414414   PORT_BIT( 0x2000, IP_ACTIVE_LOW, IPT_START1 )
415415   PORT_BIT( 0x4000, IP_ACTIVE_LOW, IPT_COIN2 )
src/mame/drivers/namcos10.c
r1679r1680
404404static INPUT_PORTS_START( namcos10 )
405405   /* IN 0 */
406406   PORT_START
407   PORT_BIT( 0x8000, IP_ACTIVE_HIGH, IPT_OTHER ) PORT_NAME("Test Switch") PORT_CODE(KEYCODE_F2)
407   PORT_SERVICE_NO_TOGGLE( 0x8000, IP_ACTIVE_HIGH )
408408   PORT_BIT( 0x7fff, IP_ACTIVE_HIGH, IPT_UNUSED )
409409
410410   /* IN 1 */
src/mame/drivers/ms32.c
r1679r1680
20382038   ROM_LOAD( "mr96004-10.22",  0x000000, 0x400000, CRC(83f4303a) SHA1(90ee010591afe1d35744925ef0e8d9a7e2ef3378) )
20392039ROM_END
20402040
2041/*
2042
2043World PK Soccer V2
2044(c)1996 Jaleco
2045
2046MegaSystem32 with I/O subboard OZ-93155
2047
2048ROM board:
2049MB-93138A EB91022-20078-1
2050
205125 (actual label is "PK SOCCER V2 ROM 25 VER. 1.1") IC36
205227 (actual label is "PK SOCCER V2 ROM 27 VER. 1.1") IC38
205329 (actual label is "PK SOCCER V2 ROM 29 VER. 1.1") IC40
205431 (actual label is "PK SOCCER V2 ROM 31 VER. 1.1") IC42
205532 (actual label is "PK SOCCER V2 ROM 32 VER. 1.1") IC43
2056
2057MR92042-01.22 (16M mask) IC33
2058MR92042-08.23 (16M mask) IC34
2059
2060ws-21 25 (actual label is "MB93138 Ver1.0 WS-21") IC30
2061
2062MR95033-01.13 (16M mask) IC20
2063MR95033-02.1  (16M mask) IC3
2064MR95033-03.14 (16M mask) IC21
2065MR95033-04.2  (16M mask) IC4
2066MR95033-05.15 (16M mask) IC22
2067MR95033-06.3  (16M mask) IC5
2068
2069MR95033-07.9  (16M mask) IC11
2070
2071MR95033-09.11 (16M mask) IC13
2072
2073Daughter board:
2074SE-93139 EB91022-30056
2075Custom chip: SS92046-01 9338EV 436091 06441
2076
2077*/
2078
2079ROM_START( wpksocv2 )
2080   ROM_REGION( 0x200000, REGION_CPU1, 0 ) /* V70 code */
2081   ROM_LOAD32_BYTE( "25", 0x000003, 0x80000, CRC(6c22a56c) SHA1(a03cbcfc024b39d2776f9e9897d1da07df6ae2d7) )
2082   ROM_LOAD32_BYTE( "27", 0x000002, 0x80000, CRC(50c594a8) SHA1(454a63d7b2a07399a64449205271b797bca1dec1) )
2083   ROM_LOAD32_BYTE( "29", 0x000001, 0x80000, CRC(22acd835) SHA1(0fa96a6dfde737d541842f85dc257776044e15b5) )
2084   ROM_LOAD32_BYTE( "31", 0x000000, 0x80000, CRC(f25e50f5) SHA1(b58722f11a8b94ef053caf531ac94a959350288a) )
2085
2086   ROM_REGION( 0xc00000, REGION_GFX1, 0 ) /* sprites, don't dispose since we use GFX_RAW */
2087   ROM_LOAD32_WORD( "mr95033-01.13", 0x000000, 0x200000, CRC(1f76ed57) SHA1(af9076b4b4c26b362825d892f46d2c04b4bb9d07) )
2088   ROM_LOAD32_WORD( "mr95033-02.1",  0x000002, 0x200000, CRC(5b119910) SHA1(aff44e355227dd159e388ab85a5b6d48644ff421) )
2089   ROM_LOAD32_WORD( "mr95033-03.14", 0x400000, 0x200000, CRC(8b6099ed) SHA1(c514cec1491aed00a5714c0b8d17c96e87ba50aa) )
2090   ROM_LOAD32_WORD( "mr95033-04.2",  0x400002, 0x200000, CRC(59144dc6) SHA1(0e192001d668791c91ca2af6b367067a5106a4b2) )
2091   ROM_LOAD32_WORD( "mr95033-05.15", 0x800000, 0x200000, CRC(cc5b8d0b) SHA1(70a5b9db600fc168d13ad54653cf1c8d2a45d991) )
2092   ROM_LOAD32_WORD( "mr95033-06.3",  0x800002, 0x200000, CRC(2f79942f) SHA1(73417d10f37bcd539b8081312226cf142a5a0d3d) )
2093
2094   ROM_REGION( 0x200000, REGION_GFX2, 0 ) /* roz tiles, don't dispose since we use GFX_RAW */
2095   ROM_LOAD( "mr95033-07.9", 0x000000, 0x200000, CRC(76cd2e0b) SHA1(41aa18dfb4e06547d1f6d7ce49e5225027d16bbb) )
2096
2097   ROM_REGION( 0x200000, REGION_GFX3, 0 ) /* bg tiles, don't dispose since we use GFX_RAW */
2098   ROM_LOAD( "mr95033-09.11", 0x000000, 0x200000, CRC(8a6dae81) SHA1(e235f2865a9a003330bff1e4d0a017e5d10efd2a) )
2099
2100   ROM_REGION( 0x080000, REGION_GFX4, 0 ) /* tx tiles, don't dispose since we use GFX_RAW */
2101   ROM_LOAD( "32", 0x000000, 0x080000, CRC(becc25c2) SHA1(4ae7665cd45ebd9586068e99327145194ba216fc) )
2102
2103   ROM_REGION( 0x50000, REGION_CPU2, 0 ) /* z80 program */
2104   ROM_LOAD( "ws-21", 0x000000, 0x040000, CRC(bdeff5d6) SHA1(920a6fc983d53f09510887e4e81ee89ccd5079e6) )
2105   ROM_RELOAD(              0x010000, 0x40000 )
2106
2107   ROM_REGION( 0x400000, REGION_SOUND1, 0 ) /* samples */
2108   ROM_LOAD( "mr92042-01.22", 0x000000, 0x200000, CRC(0fa26f65) SHA1(e92b14862fbce33ea4ab4567ec48199bfcbbdd84) )
2109   ROM_LOAD( "mr95033-08.23", 0x200000, 0x200000, CRC(89a291fa) SHA1(7746a0490134fc902ce2dc7b0d33b455d792c105) )
2110ROM_END
2111
2112
20412113/********** DECRYPT **********/
20422114
20432115/* 4 known types */
r1679r1680
22822354GAME( 1996, kirarast, 0,        ms32, kirarast, kirarast,   ROT0,   "Jaleco", "Ryuusei Janshi Kirara Star", GAME_IMPERFECT_GRAPHICS | GAME_IMPERFECT_SOUND | GAME_SUPPORTS_SAVE )
22832355GAME( 1997, tp2m32,   tetrisp2, ms32, tp2m32,   ss91022_10, ROT0,   "Jaleco", "Tetris Plus 2 (MegaSystem 32 Version)", GAME_IMPERFECT_GRAPHICS | GAME_IMPERFECT_SOUND | GAME_SUPPORTS_SAVE )
22842356GAME( 1997, bnstars,  bnstars1, ms32, 47pie2,   bnstars,    ROT0,   "Jaleco", "Vs. Janshi Brandnew Stars (MegaSystem32 Version)", GAME_IMPERFECT_GRAPHICS | GAME_IMPERFECT_SOUND | GAME_SUPPORTS_SAVE )
2357GAME( 1996, wpksocv2, 0,        ms32, ms32,     ss92046_01, ROT0,   "Jaleco", "World PK Soccer V2 (ver 1.1)", GAME_IMPERFECT_GRAPHICS | GAME_IMPERFECT_SOUND | GAME_SUPPORTS_SAVE | GAME_NOT_WORKING ) // custom IO board not emulated
22852358
2359
22862360/* these boot and show something */
22872361GAME( 1994, f1superb, 0,        ms32, f1superb, f1superb, ROT0,   "Jaleco", "F1 Super Battle", GAME_NOT_WORKING | GAME_NO_SOUND | GAME_SUPPORTS_SAVE )
src/mame/drivers/mpu4.c
r1679r1680
594594      {
595595         ic23_active=1;
596596         ic24_output(0);
597         timer_adjust(ic24_timer, double_to_attotime(duration), 0, attotime_zero);
597         timer_adjust_oneshot(ic24_timer, double_to_attotime(duration), 0);
598598      }
599599   }
600600}
src/mame/drivers/skylncr.c
r1679r1680
7272{
7373
7474   tmap = tilemap_create(   get_tile_info, tilemap_scan_rows,
75                     TILEMAP_TYPE_PEN, 8,8, 0x40,0x20   );
75                     8,8, 0x40,0x20   );
7676
7777   tmap2 = tilemap_create(   get_tile_info2, skylncr_tilemap_scan_pages,
78                     TILEMAP_TYPE_PEN, 8,32,
78                     8,32,
7979                     TILES_PER_PAGE_X*PAGES_PER_TMAP_X,TILES_PER_PAGE_Y*PAGES_PER_TMAP_Y );
8080
8181   tilemap_set_transparent_pen(tmap,  0);
src/mame/drivers/20pacgal.c
r1679r1680
272272   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_UNKNOWN )
273273   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_UNKNOWN )
274274   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNKNOWN )
275   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_SERVICE ) PORT_NAME( DEF_STR( Service_Mode )) PORT_CODE(KEYCODE_F2)
275   PORT_SERVICE_NO_TOGGLE( 0x80, IP_ACTIVE_LOW )
276276INPUT_PORTS_END
277277
278278
src/mame/drivers/deniam.c
r1679r1680
178178   PORT_START
179179   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_COIN1 )
180180   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_COIN2 )
181   PORT_BIT(0x04, IP_ACTIVE_LOW, IPT_SERVICE ) PORT_NAME( DEF_STR( Service_Mode )) PORT_CODE(KEYCODE_F2)
181   PORT_SERVICE_NO_TOGGLE( 0x04, IP_ACTIVE_LOW )
182182   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_SERVICE1 )
183183   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_START1 )
184184   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_START2 )
r1679r1680
233233   PORT_START
234234   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_COIN1 )
235235   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_COIN2 )
236   PORT_BIT(0x04, IP_ACTIVE_LOW, IPT_SERVICE ) PORT_NAME( DEF_STR( Service_Mode )) PORT_CODE(KEYCODE_F2)
236   PORT_SERVICE_NO_TOGGLE( 0x04, IP_ACTIVE_LOW )
237237   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_SERVICE1 )
238238   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_START1 )
239239   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_START2 )
src/mame/drivers/nyny.c
r1679r1680
6666#include "deprecat.h"
6767#include "machine/6821pia.h"
6868#include "machine/74123.h"
69#include "video/crtc6845.h"
69#include "video/mc6845.h"
7070#include "cpu/m6800/m6800.h"
7171#include "cpu/m6809/m6809.h"
7272#include "sound/ay8910.h"
r1679r1680
8383#define AUDIO_CPU_2_CLOCK      (AUDIO_2_MASTER_CLOCK)
8484
8585
86static mc6845_t *mc6845;
8687static UINT8 *nyny_videoram_1;
8788static UINT8 *nyny_videoram_2;
8889static UINT8 *nyny_colorram_1;
r1679r1680
269270#define NUM_PENS   (8)
270271
271272
273static WRITE8_HANDLER( nyny_mc6845_address_w )
274{
275   mc6845_address_w(mc6845, data);
276}
277
278
279static WRITE8_HANDLER( nyny_mc6845_register_w )
280{
281   mc6845_register_w(mc6845, data);
282}
283
284
272285static WRITE8_HANDLER( flipscreen_w )
273286{
274287   flipscreen = data ? 0 : 1;
275288}
276289
277290
278static void *nyny_begin_update(running_machine *machine, int screen,
279                        mame_bitmap *bitmap, const rectangle *cliprect)
291static void *nyny_begin_update(mame_bitmap *bitmap, const rectangle *cliprect)
280292{
281293   /* create the pens */
282294   offs_t i;
r1679r1680
403415}
404416
405417
406static const crtc6845_interface crtc6845_intf =
418static const mc6845_interface mc6845_intf =
407419{
408420   0,                     /* screen we are acting on */
409421   CRTC_CLOCK,             /* the clock (pin 21) of the chip */
r1679r1680
418430static VIDEO_START( nyny )
419431{
420432   /* configure the CRT controller */
421   crtc6845_config(0, &crtc6845_intf);
433   mc6845 = mc6845_config(&mc6845_intf);
422434}
423435
424436
437static VIDEO_UPDATE( nyny )
438{
439   mc6845_update(mc6845, bitmap, cliprect);
425440
441   return 0;
442}
443
444
445
426446/*************************************
427447 *
428448 *  Audio system - CPU 1
r1679r1680
521541   AM_RANGE(0x6000, 0x7fff) AM_RAM AM_BASE(&nyny_colorram_2)
522542   AM_RANGE(0x8000, 0x9fff) AM_RAM
523543   AM_RANGE(0xa000, 0xa0ff) AM_RAM AM_BASE(&generic_nvram) AM_SIZE(&generic_nvram_size) /* SRAM (coin counter, shown when holding F2) */
524   AM_RANGE(0xa100, 0xa100) AM_MIRROR(0x00fe) AM_WRITE(crtc6845_address_w)
525   AM_RANGE(0xa101, 0xa101) AM_MIRROR(0x00fe) AM_WRITE(crtc6845_register_w)
544   AM_RANGE(0xa100, 0xa100) AM_MIRROR(0x00fe) AM_WRITE(nyny_mc6845_address_w)
545   AM_RANGE(0xa101, 0xa101) AM_MIRROR(0x00fe) AM_WRITE(nyny_mc6845_register_w)
526546   AM_RANGE(0xa200, 0xa20f) AM_MIRROR(0x00f0) AM_READWRITE(nyny_pia_1_2_r, nyny_pia_1_2_w)
527547   AM_RANGE(0xa300, 0xa300) AM_MIRROR(0x00ff) AM_READWRITE(soundlatch3_r, audio_1_command_w)
528548   AM_RANGE(0xa400, 0xa7ff) AM_NOP
r1679r1680
674694   /* video hardware */
675695   MDRV_VIDEO_ATTRIBUTES(VIDEO_TYPE_RASTER)
676696   MDRV_VIDEO_START(nyny)
677   MDRV_VIDEO_UPDATE(crtc6845)
697   MDRV_VIDEO_UPDATE(nyny)
678698
679699   MDRV_SCREEN_ADD("main", 0)
680700   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_RGB32)
src/mame/drivers/limenko.c
r1679r1680
275275
276276static VIDEO_START( limenko )
277277{
278   bg_tilemap = tilemap_create(get_bg_tile_info,tilemap_scan_rows,TILEMAP_TYPE_PEN,     8,8,128,64);
279   md_tilemap = tilemap_create(get_md_tile_info,tilemap_scan_rows,TILEMAP_TYPE_PEN,8,8,128,64);
280   fg_tilemap = tilemap_create(get_fg_tile_info,tilemap_scan_rows,TILEMAP_TYPE_PEN,8,8,128,64);
278   bg_tilemap = tilemap_create(get_bg_tile_info,tilemap_scan_rows,8,8,128,64);
279   md_tilemap = tilemap_create(get_md_tile_info,tilemap_scan_rows,8,8,128,64);
280   fg_tilemap = tilemap_create(get_fg_tile_info,tilemap_scan_rows,8,8,128,64);
281281
282282   tilemap_set_transparent_pen(md_tilemap,0);
283283   tilemap_set_transparent_pen(fg_tilemap,0);
src/mame/drivers/pipeline.c
r1679r1680
9191static VIDEO_START ( pipeline )
9292{
9393   palram=auto_malloc(0x1000);
94   tilemap1 = tilemap_create( get_tile_info,tilemap_scan_rows,TILEMAP_TYPE_PEN,8,8,64,32 );
95   tilemap2 = tilemap_create( get_tile_info2,tilemap_scan_rows,TILEMAP_TYPE_PEN,8,8,64,32 );
94   tilemap1 = tilemap_create( get_tile_info,tilemap_scan_rows,8,8,64,32 );
95   tilemap2 = tilemap_create( get_tile_info2,tilemap_scan_rows,8,8,64,32 );
9696   tilemap_set_transparent_pen(tilemap2,0);
9797}
9898
src/mame/drivers/simpsons.c
r1679r1680
158158   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNKNOWN ) //SERVICE4 Unused
159159
160160   PORT_START /* IN5 */
161   PORT_BIT(0x01, IP_ACTIVE_LOW, IPT_SERVICE ) PORT_NAME( DEF_STR( Service_Mode )) PORT_CODE(KEYCODE_F2)
161   PORT_SERVICE_NO_TOGGLE( 0x01, IP_ACTIVE_LOW )
162162   PORT_BIT( 0xfe, IP_ACTIVE_LOW, IPT_UNKNOWN )
163163INPUT_PORTS_END
164164
r1679r1680
214214   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNKNOWN ) //SERVICE4 Unused
215215
216216   PORT_START /* IN5 */
217   PORT_BIT(0x01, IP_ACTIVE_LOW, IPT_SERVICE ) PORT_NAME( DEF_STR( Service_Mode )) PORT_CODE(KEYCODE_F2)
217   PORT_SERVICE_NO_TOGGLE( 0x01, IP_ACTIVE_LOW )
218218   PORT_BIT( 0xfe, IP_ACTIVE_LOW, IPT_UNKNOWN )
219219INPUT_PORTS_END
220220
src/mame/drivers/jackal.c
r1679r1680
99  that the two 4bpp tilemaps from the two chips are merged to form a single
1010  8bpp tilemap.
1111- topgunbl is derived from a completely different version, which supports gun
12  turret rotation. The copyright year is also deiffrent, but this doesn't
12  turret rotation. The copyright year is also different, but this doesn't
1313  necessarily mean anything.
1414
1515TODO:
r1679r1680
8585static ADDRESS_MAP_START( slave_map, ADDRESS_SPACE_PROGRAM, 8 )
8686   AM_RANGE(0x2000, 0x2000) AM_WRITE(YM2151_register_port_0_w)
8787   AM_RANGE(0x2001, 0x2001) AM_READWRITE(YM2151_status_port_0_r, YM2151_data_port_0_w)
88   AM_RANGE(0x4000, 0x43ff) AM_RAM AM_WRITE(paletteram_xBBBBBGGGGGRRRRR_le_w) AM_BASE(&paletteram)   // COLOR RAM (Self test only check 0x4000-0x423f)
88   AM_RANGE(0x4000, 0x43ff) AM_RAM AM_WRITE(MWA8_RAM) AM_BASE(&paletteram)   // self test only checks 0x4000-0x423f)
8989   AM_RANGE(0x6000, 0x605f) AM_RAM                                                   // SOUND RAM (Self test check 0x6000-605f, 0x7c00-0x7fff)
9090   AM_RANGE(0x6060, 0x7fff) AM_RAM AM_SHARE(1)
9191   AM_RANGE(0x8000, 0xffff) AM_ROM
r1679r1680
276276   MDRV_SCREEN_SIZE(32*8, 32*8)
277277   MDRV_SCREEN_VISIBLE_AREA(1*8, 31*8-1, 2*8, 30*8-1)
278278   MDRV_GFXDECODE(jackal)
279   MDRV_PALETTE_LENGTH(512)
280   MDRV_COLORTABLE_LENGTH(256*16+16*16+16*16)
279   MDRV_PALETTE_LENGTH(256*16+16*16+16*16)
281280
282281   MDRV_PALETTE_INIT(jackal)
283282   MDRV_VIDEO_START(jackal)
src/mame/drivers/mw8080bw.c
r1679r1680
20292029      /* multiply by the precentage and divide by 100 to get the ON period */
20302030      attotime on_period = attotime_div(attotime_mul(SPCENCTR_STROBE_PERIOD, SPCENCTR_DUTY_CYCLE), 100);
20312031
2032      timer_adjust(spcenctr_strobe_on_timer, attotime_zero, 1, SPCENCTR_STROBE_PERIOD);
2033      timer_adjust(spcenctr_strobe_off_timer, on_period, 0, SPCENCTR_STROBE_PERIOD);
2032      timer_adjust_periodic(spcenctr_strobe_on_timer, attotime_zero, 1, SPCENCTR_STROBE_PERIOD);
2033      timer_adjust_periodic(spcenctr_strobe_off_timer, on_period, 0, SPCENCTR_STROBE_PERIOD);
20342034   }
20352035   else
20362036   {
2037      timer_adjust(spcenctr_strobe_on_timer, attotime_never, 0, attotime_zero);
2038      timer_adjust(spcenctr_strobe_off_timer, attotime_zero, 0, attotime_zero);
2037      timer_adjust_oneshot(spcenctr_strobe_on_timer, attotime_never, 0);
2038      timer_adjust_oneshot(spcenctr_strobe_off_timer, attotime_zero, 0);
20392039   }
20402040}
20412041
src/mame/drivers/qdrmfgp.c
r1679r1680
438438   PORT_BIT( 0x0800, IP_ACTIVE_LOW, IPT_BUTTON4 ) PORT_PLAYER(2)
439439
440440   PORT_BIT( 0x1000, IP_ACTIVE_LOW, IPT_SERVICE1 )   /* SERVICE */
441   PORT_BIT(0x2000, IP_ACTIVE_LOW, IPT_SERVICE ) PORT_NAME( DEF_STR( Service_Mode )) PORT_CODE(KEYCODE_F2)   /* TEST SW */
441   PORT_SERVICE_NO_TOGGLE( 0x2000, IP_ACTIVE_LOW )
442442   PORT_BIT( 0x4000, IP_ACTIVE_LOW, IPT_TILT )
443443   PORT_BIT( 0x8000, IP_ACTIVE_LOW, IPT_COIN1 )
444444
r1679r1680
518518   PORT_BIT( 0x0800, IP_ACTIVE_LOW, IPT_BUTTON4 ) PORT_PLAYER(2)
519519
520520   PORT_BIT( 0x1000, IP_ACTIVE_LOW, IPT_SERVICE1 )   /* SERVICE */
521   PORT_BIT(0x2000, IP_ACTIVE_LOW, IPT_SERVICE ) PORT_NAME( DEF_STR( Service_Mode )) PORT_CODE(KEYCODE_F2)   /* TEST */
521   PORT_SERVICE_NO_TOGGLE( 0x2000, IP_ACTIVE_LOW )
522522   PORT_BIT( 0x4000, IP_ACTIVE_LOW, IPT_TILT )
523523   PORT_BIT( 0x8000, IP_ACTIVE_LOW, IPT_COIN1 )
524524
src/mame/drivers/nova2001.c
r1679r1680
1/*******************************************************************************
1/******************************************************************************
22
3     Nova 2001 - by UPL - 1983
3UPL "orthogonal palette" hardware
44
5     driver by Howie Cohen, Frank Palazzolo, Alex Pasadyn
5driver by Howie Cohen, Frank Palazzolo, Alex Pasadyn, David Haywood, Steph, Phil Stroffolino, Uki
66
7     Memory Map:
7The peculiar feature of this hardware is the palette layout. 16 colors are
8arranged in a 16x16 matrix, with all columns containing a single color, except
9for column 1, which is a copy of row 1. Essentially, the 4bpp graphics are
10drawn using a fixed palette except for one color that changes.
11Nova 2001 and Penguin Kun Wars have palette PROMs and the effect applies to both
12tilemaps and sprites. Ninjakun and Raiders5 have palette RAM and the effect
13applies only to sprites while tilemaps use a normal palette.
814
9     Address Range:     R/W:     Function:
10     --------------------------------------------------------------------------
11     0000 - 7fff        R        Program ROM (7000-7fff mirror of 6000-6fff)
12     a000 - a3ff        R/W      Foreground Playfield character RAM
13     a400 - a7ff        R/W      Foreground Playfield color modifier RAM
14     a800 - abff        R/W      Scrolling Playfield character RAM
15     ac00 - a7ff        R/W      Scrolling Playfield color modifier RAM
16     b000 - b7ff        R/W      Sprite RAM
17     bfff               W        flip screen
18     c000               R/W      AY8910 #1 Data R/W
19     c001               R/W      AY8910 #2 Data R/W
20     c002               W        AY8910 #1 Control W
21     c003               W        AY8910 #2 Control W
22     c004               R        Interrupt acknowledge / Watchdog reset
23     c006               R        Player 1 Controls
24     c007               R        Player 2 Controls
25     c00e               R        Coin Inputs, etc.
26     e000 - e7ff        R/W      Work RAM
2715
28 the parent set is VERY sensitive to coin inputs, if the coin isn't held down
29 long enough, or is held down too long the game will reset, likewise if coins
30 are inserted too quickly
16Another peculiar characteristic is that in the later scrolling games (that is
17Ninjakun and Raiders5, but not Nova 2001) the bg scroll registers are added to
18the videoram address not only when the video circuitry is accessing it, as
19usually happens, but also when the CPU is accessing it.
3120
32*******************************************************************************/
3321
22Game                      Board
23------------------------  ---------
24Nova 2001                 UPL-83005
25Ninjakun Majou no Bouken  UPL-84003
26Penguin Kun Wars          UPL-?????
27Raiders5                  UPL-85004
28
29Hardware Overview:
30------------------
311xZ80 @ 3MHz (2x in Ninjakun and Raiders5)
322xAY8910 @ various frequencies
33
34Resolution: 256x192
3564 sprites
36Tilemaps: fg 256x256 (8x8) + bg 256x256 (8x8) (Penguin Kun Wars has only one)
37
38
39Designers:
40----------
41Nova 2001:
42* Staff : Ryuichi Nishizawa (Bucha), HAL, Fukushi, Hiromi
43
44Penguin Kun Wars:
45* Tsutomu Fuzisawa, Ogata, Nobuyuki Narita, Kosikawa
46
47Ninjakun Majou no Bouken:
48* Staff : Ryuichi Nishizawa (Bucha), Todo, Fukushi, Tsutomu Fuzisawa, Tateno
49
50Raiders5:
51* Staff : Tsutomu Fuzisawa, Suzuko, Naotsugu
52* Game, software and character design by : Ryuichi Nishizawa
53* Hardware and effect design by : Nobuyuki Narita
54
55
56Notes:
57------
58- nova2001 is VERY sensitive to coin inputs, if the coin isn't held down long
59  enough, or is held down too long the game will reset, likewise if coins are
60  inserted too quickly. This only happens in nova2001 and not in nova2001u.
61
62- Nova 2001 draws black bars on the sides of the screen so the visible area becomes
63  240x192, however the physical resolution is still 256x192, the game probably does
64  that to avoid wraparound glitches in the background without having to care about
65  the sprite X MSB.
66
67- In Ninjakun, hold P1 Start after a reset to skip the startup memory tests.
68
69- The production year of Penguin Kun Wars is uncertain since it's not shown on
70  screen. The console/home computer ports were made by ASCII in 1985, and the
71  Ninjakun character appears in the audience (just on the left of the timer) so
72  this game must have been produced after Ninjakun. This restricts the possibilities
73  to 1985 or 1984.
74
75- Penguin Kun Wars has some tile/sprite priority issues that have been verified
76  to happen on the real board (e.g. the blob thing that moves in the middle of
77  the table is not obscured by the text box at the end of a set).
78
79TODO:
80-----
81- The Nova 2001 schematics show a FG priority bit, which should control priority
82  over sprites. However that bit is set by the game only during the screen fade
83  effect at the end of a level, so it would make the score area appear below
84  the sprites, which definitely doesn't look right. For this reason, the priority
85  bit is implemented in the video driver but it is ignored and the FG is always
86  drawn above sprites.
87
88- In Ninjakun, some garbage is drawn behind the GAME OVER text at the end of a
89  game. Correct behaviour?
90
91- The IRQ source of Ninjakun and Raiders5 CPU 2 is unknown.
92
93- Several unknown memory read accesses in Raiders5.
94
95*******************************************************************************
96
97Nova 2001 Memory Map:
98
99Address Range:     R/W:     Function:
100--------------------------------------------------------------------------
1010000 - 7fff        R        Program ROM (7000-7fff mirror of 6000-6fff)
102a000 - a3ff        R/W      Foreground Playfield character RAM
103a400 - a7ff        R/W      Foreground Playfield color modifier RAM
104a800 - abff        R/W      Scrolling Playfield character RAM
105ac00 - a7ff        R/W      Scrolling Playfield color modifier RAM
106b000 - b7ff        R/W      Sprite RAM
107bfff               W        flip screen
108c000               R/W      AY8910 #1 Data R/W
109c001               R/W      AY8910 #2 Data R/W
110c002               W        AY8910 #1 Control W
111c003               W        AY8910 #2 Control W
112c004               R        Interrupt acknowledge / Watchdog reset
113c006               R        Player 1 Controls
114c007               R        Player 2 Controls
115c00e               R        Coin Inputs, etc.
116e000 - e7ff        R/W      Work RAM
117
118******************************************************************************/
119
34120#include "driver.h"
35121#include "sound/ay8910.h"
122#include "nova2001.h"
36123
37/* From video/nova2001.c */
38extern UINT8 *nova2001_videoram2, *nova2001_colorram2;
124#define MAIN_CLOCK XTAL_12MHz
39125
40extern WRITE8_HANDLER( nova2001_videoram_w );
41extern WRITE8_HANDLER( nova2001_colorram_w );
42extern WRITE8_HANDLER( nova2001_videoram2_w );
43extern WRITE8_HANDLER( nova2001_colorram2_w );
44extern WRITE8_HANDLER( nova2001_scroll_x_w );
45extern WRITE8_HANDLER( nova2001_scroll_y_w );
46extern WRITE8_HANDLER( nova2001_flipscreen_w );
47126
48extern PALETTE_INIT( nova2001 );
49extern VIDEO_START( nova2001 );
50extern VIDEO_UPDATE( nova2001 );
127/*************************************
128 *
129 *  Ninjakun 0xA000 Read / Write Handlers
130 *
131 *************************************/
51132
133static UINT8 ninjakun_io_a002_ctrl;
52134
135static READ8_HANDLER( ninjakun_io_A002_r )
136{
137   return ninjakun_io_a002_ctrl | readinputport(2); /* vblank */
138}
53139
140static WRITE8_HANDLER( ninjakun_cpu1_io_A002_w )
141{
142   if( data == 0x80 ) ninjakun_io_a002_ctrl |= 0x04;
143   if( data == 0x40 ) ninjakun_io_a002_ctrl &= ~0x08;
144}
145
146static WRITE8_HANDLER( ninjakun_cpu2_io_A002_w )
147{
148   if( data == 0x40 ) ninjakun_io_a002_ctrl |= 0x08;
149   if( data == 0x80 ) ninjakun_io_a002_ctrl &= ~0x04;
150}
151
152
153
154/*************************************
155 *
156 *  Init
157 *
158 *************************************/
159
160static MACHINE_START( ninjakun )
161{
162   /* Save State Stuff */
163   state_save_register_global(ninjakun_io_a002_ctrl);
164}
165
166
167
168/*************************************
169 *
170 *  Memory maps
171 *
172 *************************************/
173
54174static ADDRESS_MAP_START( nova2001_map, ADDRESS_SPACE_PROGRAM, 8 )
55175   AM_RANGE(0x0000, 0x7fff) AM_ROM
56   AM_RANGE(0xa000, 0xa3ff) AM_RAM AM_WRITE(nova2001_videoram2_w) AM_BASE(&nova2001_videoram2)
57   AM_RANGE(0xa400, 0xa7ff) AM_RAM AM_WRITE(nova2001_colorram2_w) AM_BASE(&nova2001_colorram2)
58   AM_RANGE(0xa800, 0xabff) AM_RAM AM_WRITE(nova2001_videoram_w) AM_BASE(&videoram)
59   AM_RANGE(0xac00, 0xafff) AM_RAM AM_WRITE(nova2001_colorram_w) AM_BASE(&colorram)
60   AM_RANGE(0xb000, 0xb7ff) AM_RAM AM_BASE(&spriteram) AM_SIZE(&spriteram_size)
61   AM_RANGE(0xbfff, 0xbfff) AM_WRITE(nova2001_flipscreen_w)
176   AM_RANGE(0xa000, 0xa7ff) AM_RAM AM_WRITE(nova2001_fg_videoram_w) AM_BASE(&nova2001_fg_videoram)
177   AM_RANGE(0xa800, 0xafff) AM_RAM AM_WRITE(nova2001_bg_videoram_w) AM_BASE(&nova2001_bg_videoram)
178   AM_RANGE(0xb000, 0xb7ff) AM_RAM AM_BASE(&spriteram)
179   AM_RANGE(0xb800, 0xbfff) AM_WRITE(nova2001_flipscreen_w)
62180   AM_RANGE(0xc000, 0xc000) AM_READWRITE(AY8910_read_port_0_r, AY8910_write_port_0_w)
63181   AM_RANGE(0xc001, 0xc001) AM_READWRITE(AY8910_read_port_1_r, AY8910_write_port_1_w)
64182   AM_RANGE(0xc002, 0xc002) AM_WRITE(AY8910_control_port_0_w)
r1679r1680
71189ADDRESS_MAP_END
72190
73191
192static ADDRESS_MAP_START( ninjakun_cpu1_map, ADDRESS_SPACE_PROGRAM, 8 )
193   AM_RANGE(0x0000, 0x1fff) AM_ROM
194   AM_RANGE(0x2000, 0x7fff) AM_ROM
195   AM_RANGE(0x8000, 0x8000) AM_WRITE(AY8910_control_port_0_w)
196   AM_RANGE(0x8001, 0x8001) AM_READWRITE(AY8910_read_port_0_r, AY8910_write_port_0_w)
197   AM_RANGE(0x8002, 0x8002) AM_WRITE(AY8910_control_port_1_w)
198   AM_RANGE(0x8003, 0x8003) AM_READWRITE(AY8910_read_port_1_r, AY8910_write_port_1_w)
199   AM_RANGE(0xa000, 0xa000) AM_READ(input_port_0_r)
200   AM_RANGE(0xa001, 0xa001) AM_READ(input_port_1_r)
201   AM_RANGE(0xa002, 0xa002) AM_READWRITE(ninjakun_io_A002_r, ninjakun_cpu1_io_A002_w)
202   AM_RANGE(0xa003, 0xa003) AM_WRITE(pkunwar_flipscreen_w)
203   AM_RANGE(0xc000, 0xc7ff) AM_READWRITE(MRA8_RAM, nova2001_fg_videoram_w) AM_BASE(&nova2001_fg_videoram) AM_SHARE(1)
204   AM_RANGE(0xc800, 0xcfff) AM_READWRITE(ninjakun_bg_videoram_r, ninjakun_bg_videoram_w) AM_BASE(&nova2001_bg_videoram) AM_SHARE(2)
205   AM_RANGE(0xd000, 0xd7ff) AM_RAM AM_BASE(&spriteram) AM_SHARE(3)
206   AM_RANGE(0xd800, 0xd9ff) AM_READWRITE(MRA8_RAM, ninjakun_paletteram_w) AM_BASE(&paletteram) AM_SHARE(4)
207   AM_RANGE(0xe000, 0xe3ff) AM_RAM AM_SHARE(5)
208   AM_RANGE(0xe400, 0xe7ff) AM_RAM AM_SHARE(6)
209ADDRESS_MAP_END
74210
211static ADDRESS_MAP_START( ninjakun_cpu2_map, ADDRESS_SPACE_PROGRAM, 8 )
212   AM_RANGE(0x0000, 0x1fff) AM_ROM
213   AM_RANGE(0x2000, 0x7fff) AM_ROM AM_REGION(REGION_CPU1, 0x2000)
214   AM_RANGE(0x8000, 0x8000) AM_WRITE(AY8910_control_port_0_w)
215   AM_RANGE(0x8001, 0x8001) AM_READWRITE(AY8910_read_port_0_r, AY8910_write_port_0_w)
216   AM_RANGE(0x8002, 0x8002) AM_WRITE(AY8910_control_port_1_w)
217   AM_RANGE(0x8003, 0x8003) AM_READWRITE(AY8910_read_port_1_r, AY8910_write_port_1_w)
218   AM_RANGE(0xa000, 0xa000) AM_READ(input_port_0_r)
219   AM_RANGE(0xa001, 0xa001) AM_READ(input_port_1_r)
220   AM_RANGE(0xa002, 0xa002) AM_READWRITE(ninjakun_io_A002_r, ninjakun_cpu2_io_A002_w)
221   AM_RANGE(0xa003, 0xa003) AM_WRITE(nova2001_flipscreen_w)
222   AM_RANGE(0xc000, 0xc7ff) AM_READWRITE(MRA8_RAM, nova2001_fg_videoram_w) AM_SHARE(1)
223   AM_RANGE(0xc800, 0xcfff) AM_READWRITE(ninjakun_bg_videoram_r, ninjakun_bg_videoram_w) AM_SHARE(2)
224   AM_RANGE(0xd000, 0xd7ff) AM_RAM AM_SHARE(3)
225   AM_RANGE(0xd800, 0xd9ff) AM_READWRITE(MRA8_RAM, ninjakun_paletteram_w) AM_SHARE(4)
226   AM_RANGE(0xe000, 0xe3ff) AM_RAM AM_SHARE(6) /* swapped wrt CPU1 */
227   AM_RANGE(0xe400, 0xe7ff) AM_RAM AM_SHARE(5) /* swapped wrt CPU1 */
228ADDRESS_MAP_END
229
230
231static ADDRESS_MAP_START( pkunwar_map, ADDRESS_SPACE_PROGRAM, 8 )
232   AM_RANGE(0x0000, 0x7fff) AM_ROM
233   AM_RANGE(0x8000, 0x87ff) AM_RAM AM_BASE(&spriteram)
234   AM_RANGE(0x8800, 0x8fff) AM_RAM AM_WRITE(nova2001_bg_videoram_w) AM_BASE(&nova2001_bg_videoram)
235   AM_RANGE(0xa000, 0xa000) AM_WRITE(&AY8910_control_port_0_w)
236   AM_RANGE(0xa001, 0xa001) AM_READWRITE(AY8910_read_port_0_r, AY8910_write_port_0_w)
237   AM_RANGE(0xa002, 0xa002) AM_WRITE(AY8910_control_port_1_w)
238   AM_RANGE(0xa003, 0xa003) AM_READWRITE(AY8910_read_port_1_r, AY8910_write_port_1_w)
239   AM_RANGE(0xc000, 0xc7ff) AM_RAM
240   AM_RANGE(0xe000, 0xffff) AM_ROM
241ADDRESS_MAP_END
242
243static ADDRESS_MAP_START( pkunwar_io, ADDRESS_SPACE_IO, 8 )
244   ADDRESS_MAP_FLAGS( AMEF_ABITS(8) )
245   AM_RANGE(0x00, 0x00) AM_WRITE(pkunwar_flipscreen_w)
246ADDRESS_MAP_END
247
248
249static ADDRESS_MAP_START( raiders5_cpu1_map, ADDRESS_SPACE_PROGRAM, 8 )
250   AM_RANGE(0x0000, 0x7fff) AM_ROM
251   AM_RANGE(0x8000, 0x87ff) AM_RAM AM_BASE(&spriteram)
252   AM_RANGE(0x8800, 0x8fff) AM_RAM AM_WRITE(nova2001_fg_videoram_w) AM_BASE(&nova2001_fg_videoram)
253   AM_RANGE(0x9000, 0x97ff) AM_READWRITE(ninjakun_bg_videoram_r, ninjakun_bg_videoram_w) AM_BASE(&nova2001_bg_videoram)
254   AM_RANGE(0xa000, 0xa000) AM_WRITE(nova2001_scroll_x_w)
255   AM_RANGE(0xa001, 0xa001) AM_WRITE(nova2001_scroll_y_w)
256   AM_RANGE(0xa002, 0xa002) AM_WRITE(pkunwar_flipscreen_w)
257   AM_RANGE(0xc000, 0xc000) AM_WRITE(AY8910_control_port_0_w)
258   AM_RANGE(0xc001, 0xc001) AM_READWRITE(AY8910_read_port_0_r, AY8910_write_port_0_w)
259   AM_RANGE(0xc002, 0xc002) AM_WRITE(AY8910_control_port_1_w)
260   AM_RANGE(0xc003, 0xc003) AM_READWRITE(AY8910_read_port_1_r, AY8910_write_port_1_w)
261   AM_RANGE(0xd000, 0xd1ff) AM_READWRITE(MRA8_RAM, ninjakun_paletteram_w) AM_BASE(&paletteram)
262   AM_RANGE(0xe000, 0xe7ff) AM_RAM AM_SHARE(1)
263ADDRESS_MAP_END
264
265static ADDRESS_MAP_START( raiders5_cpu2_map, ADDRESS_SPACE_PROGRAM, 8 )
266   AM_RANGE(0x0000, 0x3fff) AM_ROM
267   AM_RANGE(0x8000, 0x8000) AM_WRITE(AY8910_control_port_0_w)
268   AM_RANGE(0x8001, 0x8001) AM_READWRITE(AY8910_read_port_0_r, AY8910_write_port_0_w)
269   AM_RANGE(0x8002, 0x8002) AM_WRITE(AY8910_control_port_1_w)
270   AM_RANGE(0x8003, 0x8003) AM_READWRITE(AY8910_read_port_1_r, AY8910_write_port_1_w)
271   AM_RANGE(0x9000, 0x9000) AM_READ(MRA8_NOP) /* unknown */
272   AM_RANGE(0xa000, 0xa7ff) AM_RAM AM_SHARE(1)
273   AM_RANGE(0xc000, 0xc000) AM_READ(MRA8_NOP) /* unknown */
274   AM_RANGE(0xc800, 0xc800) AM_READ(MRA8_NOP) /* unknown */
275   AM_RANGE(0xd000, 0xd000) AM_READ(MRA8_NOP) /* unknown */
276   AM_RANGE(0xe000, 0xe000) AM_WRITE(nova2001_scroll_x_w)
277   AM_RANGE(0xe001, 0xe001) AM_WRITE(nova2001_scroll_y_w)
278   AM_RANGE(0xe002, 0xe002) AM_WRITE(pkunwar_flipscreen_w)
279ADDRESS_MAP_END
280
281static ADDRESS_MAP_START( raiders5_io, ADDRESS_SPACE_IO, 8 )
282   AM_RANGE(0x00, 0x00) AM_READ(MRA8_NOP) /* unknown */
283ADDRESS_MAP_END
284
285
286
287/*************************************
288 *
289 *  Port definitions
290 *
291 *************************************/
292
75293static INPUT_PORTS_START( nova2001 )
76    PORT_START
77    PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_8WAY
78    PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_8WAY
79    PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_8WAY
80    PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_8WAY
81    PORT_BIT( 0x30, IP_ACTIVE_LOW, IPT_UNUSED )
82    PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_BUTTON2 )   // pause
83    PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_BUTTON1 )   // fire
294   PORT_START
295   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_8WAY
296   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_8WAY
297   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_8WAY
298   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_8WAY
299   PORT_BIT( 0x30, IP_ACTIVE_LOW, IPT_UNUSED )
300   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_BUTTON2 )   // pause
301   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_BUTTON1 )   // fire
84302
85    PORT_START
86    PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_8WAY PORT_COCKTAIL
87    PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_8WAY PORT_COCKTAIL
88    PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_8WAY PORT_COCKTAIL
89    PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_8WAY PORT_COCKTAIL
90    PORT_BIT( 0x30, IP_ACTIVE_LOW, IPT_UNUSED )
91    PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_COCKTAIL
92    PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_COCKTAIL
303   PORT_START
304   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_8WAY PORT_COCKTAIL
305   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_8WAY PORT_COCKTAIL
306   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_8WAY PORT_COCKTAIL
307   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_8WAY PORT_COCKTAIL
308   PORT_BIT( 0x30, IP_ACTIVE_LOW, IPT_UNUSED )
309   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_COCKTAIL
310   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_COCKTAIL
93311
94    PORT_START
312   PORT_START
95313   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_COIN1 ) PORT_IMPULSE(4)
96314   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_START1 )
97    PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_START2 )
98    PORT_BIT( 0x78, IP_ACTIVE_LOW, IPT_UNUSED )
99    PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_VBLANK )
315   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_START2 )
316   PORT_BIT( 0x78, IP_ACTIVE_LOW, IPT_UNUSED )
317   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_VBLANK )
100318
101    PORT_START  /* dsw0 */
102    PORT_DIPNAME( 0x01, 0x00, DEF_STR( Cabinet ) )
103    PORT_DIPSETTING(    0x00, DEF_STR( Upright ) )
104    PORT_DIPSETTING(    0x01, DEF_STR( Cocktail ) )
105    PORT_DIPNAME( 0x02, 0x02, DEF_STR( Lives ) )
106    PORT_DIPSETTING(    0x02, "3" )
107    PORT_DIPSETTING(    0x00, "4" )
108    PORT_DIPNAME( 0x04, 0x04, "1st Bonus Life" )
109    PORT_DIPSETTING(    0x04, "20K" )
110    PORT_DIPSETTING(    0x00, "30K" )
111    PORT_DIPNAME( 0x18, 0x18, "Extra Bonus Life" )
112    PORT_DIPSETTING(    0x18, "60K" )
113    PORT_DIPSETTING(    0x10, "70K" )
114    PORT_DIPSETTING(    0x08, "90K" )
115    PORT_DIPSETTING(    0x00, DEF_STR( None ) )
116    PORT_DIPNAME( 0x60, 0x60, DEF_STR( Coinage ) )
117    PORT_DIPSETTING(    0x40, DEF_STR( 2C_1C ) )
118    PORT_DIPSETTING(    0x00, DEF_STR( 2C_2C ) )
119    PORT_DIPSETTING(    0x60, DEF_STR( 1C_1C ) )
120    PORT_DIPSETTING(    0x20, DEF_STR( 1C_2C ) )
121    PORT_DIPNAME( 0x80, 0x80, DEF_STR( Free_Play ) )
122    PORT_DIPSETTING(    0x80, DEF_STR( Off ) )
123    PORT_DIPSETTING(    0x00, DEF_STR( On ) )
319   PORT_START  /* dsw0 */
320   PORT_DIPNAME( 0x01, 0x00, DEF_STR( Cabinet ) ) PORT_DIPLOCATION("SW1:1")
321   PORT_DIPSETTING(    0x00, DEF_STR( Upright ) )
322   PORT_DIPSETTING(    0x01, DEF_STR( Cocktail ) )
323   PORT_DIPNAME( 0x02, 0x02, DEF_STR( Lives ) ) PORT_DIPLOCATION("SW1:2")
324   PORT_DIPSETTING(    0x02, "3" )
325   PORT_DIPSETTING(    0x00, "4" )
326   PORT_DIPNAME( 0x04, 0x04, "1st Bonus Life" ) PORT_DIPLOCATION("SW1:3")
327   PORT_DIPSETTING(    0x04, "20K" )
328   PORT_DIPSETTING(    0x00, "30K" )
329   PORT_DIPNAME( 0x18, 0x18, "Extra Bonus Life" ) PORT_DIPLOCATION("SW1:4,5")
330   PORT_DIPSETTING(    0x18, "60K" )
331   PORT_DIPSETTING(    0x10, "70K" )
332   PORT_DIPSETTING(    0x08, "90K" )
333   PORT_DIPSETTING(    0x00, DEF_STR( None ) )
334   PORT_DIPNAME( 0x60, 0x60, DEF_STR( Coinage ) ) PORT_DIPLOCATION("SW1:6,7")
335   PORT_DIPSETTING(    0x40, DEF_STR( 2C_1C ) )
336   PORT_DIPSETTING(    0x00, DEF_STR( 2C_2C ) )
337   PORT_DIPSETTING(    0x60, DEF_STR( 1C_1C ) )
338   PORT_DIPSETTING(    0x20, DEF_STR( 1C_2C ) )
339   PORT_DIPNAME( 0x80, 0x80, DEF_STR( Free_Play ) ) PORT_DIPLOCATION("SW1:8")
340   PORT_DIPSETTING(    0x80, DEF_STR( Off ) )
341   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
124342
125    PORT_START  /* dsw1 */
126    PORT_DIPNAME( 0x03, 0x00, DEF_STR( Difficulty ) )
127    PORT_DIPSETTING(    0x00, DEF_STR( Easy ) )
128    PORT_DIPSETTING(    0x03, DEF_STR( Medium ) )
129    PORT_DIPSETTING(    0x02, DEF_STR( Hard ) )
130    PORT_DIPSETTING(    0x01, DEF_STR( Hardest ) )
131    PORT_DIPNAME( 0x04, 0x00, DEF_STR( Demo_Sounds ) )
132    PORT_DIPSETTING(    0x04, DEF_STR( Off ) )
133    PORT_DIPSETTING(    0x00, DEF_STR( On ) )
343   PORT_START  /* dsw1 */
344   PORT_DIPNAME( 0x03, 0x00, DEF_STR( Difficulty ) ) PORT_DIPLOCATION("SW2:1,2")
345   PORT_DIPSETTING(    0x00, DEF_STR( Easy ) )
346   PORT_DIPSETTING(    0x03, DEF_STR( Medium ) )
347   PORT_DIPSETTING(    0x02, DEF_STR( Hard ) )
348   PORT_DIPSETTING(    0x01, DEF_STR( Hardest ) )
349   PORT_DIPNAME( 0x04, 0x00, DEF_STR( Demo_Sounds ) ) PORT_DIPLOCATION("SW2:3")
350   PORT_DIPSETTING(    0x04, DEF_STR( Off ) )
351   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
352   PORT_DIPNAME( 0x08, 0x08, "High Score Names" ) PORT_DIPLOCATION("SW2:4")
353   PORT_DIPSETTING(    0x00, "3 Letters" )
354   PORT_DIPSETTING(    0x08, "8 Letters" )
355   PORT_DIPUNUSED_DIPLOC( 0x10, IP_ACTIVE_LOW, "SW2:5" )
356   PORT_DIPUNUSED_DIPLOC( 0x20, IP_ACTIVE_LOW, "SW2:6" )
357   PORT_DIPUNUSED_DIPLOC( 0x40, IP_ACTIVE_LOW, "SW2:7" )
358   PORT_SERVICE_DIPLOC( 0x80, IP_ACTIVE_LOW, "SW2:8" )
359INPUT_PORTS_END
360
361static INPUT_PORTS_START( ninjakun )
362   PORT_START_TAG("IN0")   /* 0xa000 */
363   PORT_BIT( 0x01, IP_ACTIVE_LOW,   IPT_JOYSTICK_LEFT ) PORT_2WAY /* "XPOS1" */
364   PORT_BIT( 0x02, IP_ACTIVE_LOW,   IPT_JOYSTICK_RIGHT ) PORT_2WAY
365   PORT_BIT( 0x04, IP_ACTIVE_LOW,   IPT_BUTTON2 )
366   PORT_BIT( 0x08, IP_ACTIVE_LOW,   IPT_BUTTON1 )
367   PORT_BIT( 0x10, IP_ACTIVE_LOW,   IPT_UNKNOWN )
368   PORT_BIT( 0x20, IP_ACTIVE_LOW,   IPT_START1  )
369   PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_UNKNOWN )
370   PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_UNKNOWN )
371
372   PORT_START_TAG("IN1")   /* 0xa001 */
373   PORT_BIT( 0x01, IP_ACTIVE_LOW,   IPT_JOYSTICK_LEFT) PORT_2WAY PORT_COCKTAIL /* "YPOS1" */
374   PORT_BIT( 0x02, IP_ACTIVE_LOW,   IPT_JOYSTICK_RIGHT) PORT_2WAY PORT_COCKTAIL
375   PORT_BIT( 0x04, IP_ACTIVE_LOW,   IPT_BUTTON2 ) PORT_COCKTAIL
376   PORT_BIT( 0x08, IP_ACTIVE_LOW,   IPT_BUTTON1 ) PORT_COCKTAIL
377   PORT_BIT( 0x10, IP_ACTIVE_LOW,   IPT_UNKNOWN )
378   PORT_BIT( 0x20, IP_ACTIVE_LOW,   IPT_START2  )
379   PORT_SERVICE( 0x40, IP_ACTIVE_HIGH )
380   PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_COIN1 )
381
382   PORT_START_TAG("IN2")   /* 0xa002 */
383   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_VBLANK )
384
385   PORT_START_TAG("DSW1")
386   PORT_DIPNAME( 0x01, 0x00, DEF_STR( Cabinet ) )
387   PORT_DIPSETTING(    0x00, DEF_STR( Upright ) )
388   PORT_DIPSETTING(    0x01, DEF_STR( Cocktail ) )
389   PORT_DIPNAME( 0x06, 0x04, DEF_STR( Lives ) )
390   PORT_DIPSETTING(    0x02, "2" )
391   PORT_DIPSETTING(    0x04, "3" )
392   PORT_DIPSETTING(    0x06, "4" )
393   PORT_DIPSETTING(    0x00, "5" )
394   PORT_DIPNAME( 0x08, 0x08, "First Bonus" )
395   PORT_DIPSETTING(    0x08, "30000" )
396   PORT_DIPSETTING(    0x00, "40000" )
397   PORT_DIPNAME( 0x30, 0x30, "Second Bonus" )
398   PORT_DIPSETTING(    0x00, "No Bonus" )
399   PORT_DIPSETTING(    0x10, "Every 30000" )
400   PORT_DIPSETTING(    0x30, "Every 50000" )
401   PORT_DIPSETTING(    0x20, "Every 70000" )
402   PORT_DIPNAME( 0x40, 0x00, DEF_STR( Demo_Sounds ) )
403   PORT_DIPSETTING(    0x40, DEF_STR( Off ) )
404   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
405   PORT_DIPNAME( 0x80, 0x80, DEF_STR( Difficulty ) )
406   PORT_DIPSETTING(    0x80, DEF_STR( Normal ) )
407   PORT_DIPSETTING(    0x00, DEF_STR( Hard )   )
408
409   PORT_START_TAG("DSW2")
410   PORT_DIPNAME( 0x07, 0x07, DEF_STR( Coinage ) )
411   PORT_DIPSETTING(    0x04, DEF_STR( 4C_1C ) )
412   PORT_DIPSETTING(    0x05, DEF_STR( 3C_1C ) )
413   PORT_DIPSETTING(    0x00, DEF_STR( 4C_2C ) )
414   PORT_DIPSETTING(    0x06, DEF_STR( 2C_1C ) )
415   PORT_DIPSETTING(    0x01, DEF_STR( 3C_2C ) )
416   PORT_DIPSETTING(    0x02, DEF_STR( 2C_2C ) )
417   PORT_DIPSETTING(    0x07, DEF_STR( 1C_1C ) )
418   PORT_DIPSETTING(    0x03, DEF_STR( 1C_2C ) )
134419   PORT_DIPNAME( 0x08, 0x08, "High Score Names" )
135420   PORT_DIPSETTING(    0x00, "3 Letters" )
136421   PORT_DIPSETTING(    0x08, "8 Letters" )
137    PORT_BIT( 0x70, IP_ACTIVE_LOW, IPT_UNUSED )
138   PORT_SERVICE( 0x80, IP_ACTIVE_LOW )
422   PORT_DIPNAME( 0x10, 0x00, DEF_STR( Allow_Continue ) )
423   PORT_DIPSETTING(    0x10, DEF_STR( No ) )
424   PORT_DIPSETTING(    0x00, DEF_STR( Yes ) )
425   PORT_DIPNAME( 0x20, 0x20, DEF_STR( Unknown ) )/* Probably Unused */
426   PORT_DIPSETTING(    0x20, DEF_STR( Off ) )
427   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
428   PORT_DIPNAME( 0x40, 0x40, DEF_STR( Free_Play ) )
429   PORT_DIPSETTING(    0x40, DEF_STR( Off ) )
430   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
431   PORT_DIPNAME( 0x80, 0x80, "Infinite Lives (If Free Play)" )
432   PORT_DIPSETTING(    0x80, DEF_STR( Off ) )
433   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
139434INPUT_PORTS_END
140435
436static INPUT_PORTS_START( pkunwar )
437   PORT_START   /* IN0 */
438   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_2WAY
439   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_2WAY
440   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_BUTTON1 )
441   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_UNKNOWN )
442   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_UNKNOWN )
443   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_START1 )
444   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNKNOWN )
445   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_VBLANK )
141446
447   PORT_START   /* IN1 */
448   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_2WAY PORT_COCKTAIL
449   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_2WAY PORT_COCKTAIL
450   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_COCKTAIL
451   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_UNKNOWN )
452   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_UNKNOWN )
453   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_START2 )
454   PORT_SERVICE( 0x40, IP_ACTIVE_LOW )
455   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_COIN1 )
142456
143static const gfx_layout charlayout =
457   PORT_START   /* DSW0 */
458   PORT_DIPNAME( 0x01, 0x01, DEF_STR( Unknown ) )
459   PORT_DIPSETTING(    0x01, DEF_STR( Off ) )
460   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
461   PORT_DIPNAME( 0x02, 0x02, DEF_STR( Unknown ) )
462   PORT_DIPSETTING(    0x02, DEF_STR( Off ) )
463   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
464   PORT_DIPNAME( 0x04, 0x04, DEF_STR( Unknown ) )
465   PORT_DIPSETTING(    0x04, DEF_STR( Off ) )
466   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
467   PORT_DIPNAME( 0x08, 0x08, DEF_STR( Unknown ) )
468   PORT_DIPSETTING(    0x08, DEF_STR( Off ) )
469   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
470   PORT_DIPNAME( 0x10, 0x10, DEF_STR( Unknown ) )
471   PORT_DIPSETTING(    0x10, DEF_STR( Off ) )
472   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
473   PORT_DIPNAME( 0x20, 0x20, DEF_STR( Unknown ) )
474   PORT_DIPSETTING(    0x20, DEF_STR( Off ) )
475   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
476   PORT_DIPNAME( 0x40, 0x40, DEF_STR( Unknown ) )
477   PORT_DIPSETTING(    0x40, DEF_STR( Off ) )
478   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
479   PORT_DIPNAME( 0x80, 0x80, DEF_STR( Unknown ) )
480   PORT_DIPSETTING(    0x80, DEF_STR( Off ) )
481   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
482
483   PORT_START   /* DSW1 */
484   PORT_DIPNAME( 0x03, 0x03, DEF_STR( Coinage ) )
485   PORT_DIPSETTING(    0x00, DEF_STR( 3C_1C ) )
486   PORT_DIPSETTING(    0x02, DEF_STR( 2C_1C ) )
487   PORT_DIPSETTING(    0x03, DEF_STR( 1C_1C ) )
488   PORT_DIPSETTING(    0x01, DEF_STR( 1C_2C ) )
489   PORT_DIPNAME( 0x04, 0x00, DEF_STR( Cabinet ) )
490   PORT_DIPSETTING(    0x00, DEF_STR( Upright ) )
491   PORT_DIPSETTING(    0x04, DEF_STR( Cocktail ) )
492   PORT_DIPNAME( 0x08, 0x08, DEF_STR( Demo_Sounds ) )
493   PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
494   PORT_DIPSETTING(    0x08, DEF_STR( On ) )
495   PORT_DIPNAME( 0x30, 0x30, DEF_STR( Difficulty ) )
496   PORT_DIPSETTING(    0x10, DEF_STR( Easy ) )
497   PORT_DIPSETTING(    0x30, DEF_STR( Medium ) )
498   PORT_DIPSETTING(    0x20, DEF_STR( Hard ) )
499   PORT_DIPSETTING(    0x00, DEF_STR( Hardest ) )
500   PORT_DIPNAME( 0x40, 0x40, DEF_STR( Flip_Screen ) )
501   PORT_DIPSETTING(    0x40, DEF_STR( Off ) )
502   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
503   PORT_DIPNAME( 0x80, 0x80, DEF_STR( Free_Play ) )
504   PORT_DIPSETTING(    0x80, DEF_STR( Off ) )
505   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
506INPUT_PORTS_END
507
508static INPUT_PORTS_START( raiders5 )
509   PORT_START
510   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_VBLANK )
511   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNKNOWN )
512   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_START1 )
513   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_BUTTON1 )
514   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_4WAY
515   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_4WAY
516   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_4WAY
517   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_4WAY
518
519   PORT_START
520   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_COIN1 ) PORT_IMPULSE(5)
521   PORT_SERVICE( 0x40, IP_ACTIVE_LOW )
522   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_START2 )
523   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_COCKTAIL
524   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_4WAY PORT_COCKTAIL
525   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_4WAY PORT_COCKTAIL
526   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_4WAY PORT_COCKTAIL
527   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_4WAY PORT_COCKTAIL
528
529   PORT_START   /* DSW1 */
530   PORT_DIPNAME( 0x01, 0x00, DEF_STR( Cabinet ) )
531   PORT_DIPSETTING(    0x00, DEF_STR( Upright ) )
532   PORT_DIPSETTING(    0x01, DEF_STR( Cocktail ) )
533   PORT_DIPNAME( 0x06, 0x06, DEF_STR( Lives ) )
534   PORT_DIPSETTING(    0x00, "2" )
535   PORT_DIPSETTING(    0x06, "3" )
536   PORT_DIPSETTING(    0x04, "4" )
537   PORT_DIPSETTING(    0x02, "5" )
538   PORT_DIPNAME( 0x08, 0x08, "1st Bonus" )
539   PORT_DIPSETTING(    0x08, "30000" )
540   PORT_DIPSETTING(    0x00, "40000" )
541   PORT_DIPNAME( 0x30, 0x30, "2nd Bonus" )
542   PORT_DIPSETTING(    0x30, "Every(?) 50000" )
543   PORT_DIPSETTING(    0x20, "Every(?) 70000" )
544   PORT_DIPSETTING(    0x10, "Every(?) 90000" )
545   PORT_DIPSETTING(    0x00, DEF_STR( None ) )
546   PORT_DIPNAME( 0x40, 0x40, "Exercise" )
547   PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
548   PORT_DIPSETTING(    0x40, DEF_STR( On ) )
549   PORT_DIPNAME( 0x80, 0x80, DEF_STR( Difficulty ) )
550   PORT_DIPSETTING(    0x80, DEF_STR( Normal ) )
551   PORT_DIPSETTING(    0x00, DEF_STR( Hard ) )
552
553   PORT_START   /* DSW2*/
554   PORT_DIPNAME( 0x07, 0x07, DEF_STR( Coinage ) )
555   PORT_DIPSETTING(    0x04, DEF_STR( 4C_1C ) )
556   PORT_DIPSETTING(    0x05, DEF_STR( 3C_1C ) )
557   PORT_DIPSETTING(    0x00, DEF_STR( 4C_2C ) )
558   PORT_DIPSETTING(    0x06, DEF_STR( 2C_1C ) )
559   PORT_DIPSETTING(    0x01, DEF_STR( 3C_2C ) )
560   PORT_DIPSETTING(    0x02, DEF_STR( 2C_2C ) )
561   PORT_DIPSETTING(    0x07, DEF_STR( 1C_1C ) )
562   PORT_DIPSETTING(    0x03, DEF_STR( 1C_2C ) )
563   PORT_DIPNAME( 0x08, 0x08, "High Score Names" )
564   PORT_DIPSETTING(    0x00, "3 Letters" )
565   PORT_DIPSETTING(    0x08, "8 Letters" )
566   PORT_DIPNAME( 0x10, 0x10, DEF_STR( Allow_Continue ) )
567   PORT_DIPSETTING(    0x00, DEF_STR( No ) )
568   PORT_DIPSETTING(    0x10, DEF_STR( Yes ) )
569   PORT_DIPNAME( 0x20, 0x20, DEF_STR( Unknown ) )
570   PORT_DIPSETTING(    0x20, DEF_STR( Off ) )
571   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
572   PORT_DIPNAME( 0x40, 0x40, DEF_STR( Free_Play ) )
573   PORT_DIPSETTING(    0x40, DEF_STR( Off ) )
574   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
575   PORT_DIPNAME( 0x80, 0x80, "Unlimited Lives (If Free Play)" )
576   PORT_DIPSETTING(    0x80, DEF_STR( Off ) )
577   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
578
579INPUT_PORTS_END
580
581
582
583/*************************************
584 *
585 *  Graphics layouts
586 *
587 *************************************/
588
589static const gfx_layout layout8x8 =
144590{
145   8,8,    /* 8*8 characters */
146   256,    /* 256 characters */
147   4,       /* 4 bits per pixel */
148   {0,1,2,3 }, /* the bitplanes are packed in one nibble */
149   {0, 4, 8192*8+0, 8192*8+4, 8, 12, 8192*8+8, 8192*8+12},
150   {16*0, 16*1, 16*2, 16*3, 16*4, 16*5, 16*6, 16*7},
151   8*16
591   8,8,
592   RGN_FRAC(1,1),
593   4,
594   { STEP4(0,1) },
595   { STEP8(0,4) },
596   { STEP8(0,32) },
597   32*8
152598};
153599
154static const gfx_layout spritelayout =
600static const gfx_layout layout8x8_part =
155601{
156   16,16,    /* 16*16 characters */
157   128,      /* 128 sprites */
158   4,       /* 4 bits per pixel */
159   {0,1,2,3}, /* the bitplanes are packed in one nibble */
160   {0,  4,  8192*8+0,  8192*8+4,  8, 12,  8192*8+8, 8192*8+12,
161         16*8+0, 16*8+4, 16*8+8192*8+0, 16*8+8192*8+4, 16*8+8, 16*8+12, 16*8+8192*8+8, 16*8+8192*8+12},
162   {16*0, 16*1, 16*2, 16*3, 16*4, 16*5, 16*6, 16*7,
163         32*8+16*0, 32*8+16*1, 32*8+16*2, 32*8+16*3, 32*8+16*4, 32*8+16*5, 32*8+16*6, 32*8+16*7},
164   8*64
602   8,8,
603   RGN_FRAC(1,4),
604   4,
605   { STEP4(0,1) },
606   { STEP8(0,4) },
607   { STEP8(0,32) },
608   32*8
165609};
166610
611static const gfx_layout layout16x16 =
612{
613   16,16,
614   RGN_FRAC(1,1),
615   4,
616   { STEP4(0,1) },
617   { STEP8(0,4), STEP8(32*8,4) },
618   { STEP8(0,32), STEP8(64*8,32) },
619   128*8
620};
621
167622static GFXDECODE_START( nova2001 )
168   GFXDECODE_ENTRY( REGION_GFX1, 0x0000, charlayout,       0, 16 )
169   GFXDECODE_ENTRY( REGION_GFX2, 0x0000, charlayout,   16*16, 16 )
170   GFXDECODE_ENTRY( REGION_GFX1, 0x0000, spritelayout,     0, 16 )
171   GFXDECODE_ENTRY( REGION_GFX2, 0x0000, spritelayout,     0, 16 )
623   GFXDECODE_ENTRY( REGION_GFX1, 0x0000, layout16x16,    0x000, 16 )   // sprites
624   GFXDECODE_ENTRY( REGION_GFX1, 0x0000, layout8x8_part, 0x000, 16 )   // fg tiles (using only 1/4th of the ROM space)
625   GFXDECODE_ENTRY( REGION_GFX1, 0x4000, layout8x8_part, 0x100, 16 )   // bg tiles (using only 1/4th of the ROM space)
172626GFXDECODE_END
173627
628static GFXDECODE_START( ninjakun )
629   GFXDECODE_ENTRY( REGION_GFX1, 0, layout16x16, 0x200, 16 )   // sprites
630   GFXDECODE_ENTRY( REGION_GFX1, 0, layout8x8,   0x000, 16 )   // fg tiles
631   GFXDECODE_ENTRY( REGION_GFX2, 0, layout8x8,   0x100, 16 )   // bg tiles
632GFXDECODE_END
174633
634static GFXDECODE_START( pkunwar )
635   GFXDECODE_ENTRY( REGION_GFX1, 0, layout16x16, 0x000, 16 )   // sprites
636   GFXDECODE_ENTRY( REGION_GFX1, 0, layout8x8,   0x100, 16 )   // bg tiles
637GFXDECODE_END
175638
176static const struct AY8910interface ay8910_interface_1 =
639static GFXDECODE_START( raiders5 )
640   GFXDECODE_ENTRY( REGION_GFX1, 0, layout16x16,    0x200, 16 )   // sprites
641   GFXDECODE_ENTRY( REGION_GFX1, 0, layout8x8_part, 0x000, 16 )   // fg tiles (using only 1/4th of the ROM space)
642   GFXDECODE_ENTRY( REGION_GFX2, 0, layout8x8,      0x100, 16 )   // bg tiles
643GFXDECODE_END
644
645
646
647/*************************************
648 *
649 *  Sound definitions
650 *
651 *************************************/
652
653static const struct AY8910interface nova2001_ay8910_interface_1 =
177654{
178655   0,
179656   0,
180   nova2001_scroll_x_w, /* writes are connected to pf scroll */
657   nova2001_scroll_x_w,
181658   nova2001_scroll_y_w
182659};
183660
184static const struct AY8910interface ay8910_interface_2 =
661static const struct AY8910interface nova2001_ay8910_interface_2 =
185662{
186663   input_port_3_r,
187664   input_port_4_r
188665};
189666
667static const struct AY8910interface pkunwar_ay8910_interface_1 =
668{
669   input_port_0_r,
670   input_port_1_r
671};
672
673static const struct AY8910interface pkunwar_ay8910_interface_2 =
674{
675   input_port_2_r,
676   input_port_3_r
677};
678
679
680
681/*************************************
682 *
683 *  Machine drivers
684 *
685 *************************************/
686
190687static MACHINE_DRIVER_START( nova2001 )
191688
192689   /* basic machine hardware */
193   MDRV_CPU_ADD(Z80, 12000000/4)   // 3 MHz
690   MDRV_CPU_ADD(Z80, MAIN_CLOCK/4)   // 3 MHz verified on schematics
194691   MDRV_CPU_PROGRAM_MAP(nova2001_map,0)
195692   MDRV_CPU_VBLANK_INT(irq0_line_hold,1)
196693
694   /* video hardware */
197695   MDRV_SCREEN_REFRESH_RATE(60)
198   MDRV_SCREEN_VBLANK_TIME(DEFAULT_REAL_60HZ_VBLANK_DURATION)
199
200   /* video hardware */
201696   MDRV_VIDEO_ATTRIBUTES(VIDEO_TYPE_RASTER)
202697   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
203698   MDRV_SCREEN_SIZE(32*8, 32*8)
204   MDRV_SCREEN_VISIBLE_AREA(1*8, 31*8-1, 4*8, 28*8-1)
699   MDRV_SCREEN_VISIBLE_AREA(0*8, 32*8-1, 4*8, 28*8-1)
205700   MDRV_GFXDECODE(nova2001)
206   MDRV_PALETTE_LENGTH(32)
207   MDRV_COLORTABLE_LENGTH(32*16)
701   MDRV_PALETTE_LENGTH(0x200)
208702
209703   MDRV_PALETTE_INIT(nova2001)
210704   MDRV_VIDEO_START(nova2001)
r1679r1680
213707   /* sound hardware */
214708   MDRV_SPEAKER_STANDARD_MONO("mono")
215709
216   MDRV_SOUND_ADD(AY8910, 6000000/3)
217   MDRV_SOUND_CONFIG(ay8910_interface_1)
710   MDRV_SOUND_ADD(AY8910, MAIN_CLOCK/6)   // 2 MHz verified on schematics
711   MDRV_SOUND_CONFIG(nova2001_ay8910_interface_1)
218712   MDRV_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.25)
219713
220   MDRV_SOUND_ADD(AY8910, 6000000/3)
221   MDRV_SOUND_CONFIG(ay8910_interface_2)
714   MDRV_SOUND_ADD(AY8910, MAIN_CLOCK/6)
715   MDRV_SOUND_CONFIG(nova2001_ay8910_interface_2)
222716   MDRV_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.25)
223717MACHINE_DRIVER_END
224718
719static MACHINE_DRIVER_START( ninjakun )
225720
721   /* basic machine hardware */
722   MDRV_CPU_ADD(Z80, MAIN_CLOCK/4)   // 3 MHz
723   MDRV_CPU_PROGRAM_MAP(ninjakun_cpu1_map,0)
724   MDRV_CPU_VBLANK_INT(irq0_line_hold,1)
226725
726   MDRV_CPU_ADD(Z80, MAIN_CLOCK/4)   // 3 MHz
727   MDRV_CPU_PROGRAM_MAP(ninjakun_cpu2_map,0)
728   MDRV_CPU_VBLANK_INT(irq0_line_hold,4) /* ? */
729
730   MDRV_INTERLEAVE(100)   /* 100 CPU slices per frame */
731
732   MDRV_MACHINE_START(ninjakun)
733
734    /* video hardware */
735   MDRV_SCREEN_REFRESH_RATE(60)
736   MDRV_VIDEO_ATTRIBUTES(VIDEO_TYPE_RASTER)
737   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
738   MDRV_SCREEN_SIZE(32*8, 32*8)
739   MDRV_SCREEN_VISIBLE_AREA(0*8, 32*8-1, 4*8, 28*8-1 )
740   MDRV_GFXDECODE(ninjakun)
741   MDRV_PALETTE_LENGTH(0x300)
742
743   MDRV_VIDEO_START(ninjakun)
744   MDRV_VIDEO_UPDATE(ninjakun)
745
746   /* sound hardware */
747   MDRV_SPEAKER_STANDARD_MONO("mono")
748
749   MDRV_SOUND_ADD(AY8910, MAIN_CLOCK/4)   // 3 MHz
750   MDRV_SOUND_CONFIG(nova2001_ay8910_interface_2)   // note swapped order wrt nova2001
751   MDRV_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.20)
752
753   MDRV_SOUND_ADD(AY8910, MAIN_CLOCK/4)   // 3 MHz
754   MDRV_SOUND_CONFIG(nova2001_ay8910_interface_1)
755   MDRV_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.20)
756MACHINE_DRIVER_END
757
758static MACHINE_DRIVER_START( pkunwar )
759
760   /* basic machine hardware */
761   MDRV_CPU_ADD(Z80, MAIN_CLOCK/4)   // 3 MHz
762   MDRV_CPU_PROGRAM_MAP(pkunwar_map,0)
763   MDRV_CPU_IO_MAP(pkunwar_io,0)
764   MDRV_CPU_VBLANK_INT(irq0_line_hold,1)
765
766   /* video hardware */
767   MDRV_SCREEN_REFRESH_RATE(60)
768   MDRV_VIDEO_ATTRIBUTES(VIDEO_TYPE_RASTER)
769   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
770   MDRV_SCREEN_SIZE(32*8, 32*8)
771   MDRV_SCREEN_VISIBLE_AREA(0*8, 32*8-1, 4*8, 28*8-1)
772   MDRV_GFXDECODE(pkunwar)
773   MDRV_PALETTE_LENGTH(0x200)
774
775   MDRV_PALETTE_INIT(nova2001)
776   MDRV_VIDEO_START(pkunwar)
777   MDRV_VIDEO_UPDATE(pkunwar)
778
779   /* sound hardware */
780   MDRV_SPEAKER_STANDARD_MONO("mono")
781
782   MDRV_SOUND_ADD(AY8910, MAIN_CLOCK/8)   // 1.5MHz (correct?)
783   MDRV_SOUND_CONFIG(pkunwar_ay8910_interface_1)
784   MDRV_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.25)
785
786   MDRV_SOUND_ADD(AY8910, MAIN_CLOCK/8)
787   MDRV_SOUND_CONFIG(pkunwar_ay8910_interface_2)
788   MDRV_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.25)
789MACHINE_DRIVER_END
790
791static MACHINE_DRIVER_START( raiders5 )
792
793   /* basic machine hardware */
794   MDRV_CPU_ADD(Z80, MAIN_CLOCK/4)   // 3 MHz
795   MDRV_CPU_PROGRAM_MAP(raiders5_cpu1_map,0)
796   MDRV_CPU_IO_MAP(raiders5_io,0)
797   MDRV_CPU_VBLANK_INT(irq0_line_hold,1)
798
799   MDRV_CPU_ADD(Z80, MAIN_CLOCK/4)   // 3 MHz
800   MDRV_CPU_PROGRAM_MAP(raiders5_cpu2_map,0)
801   MDRV_CPU_VBLANK_INT(irq0_line_hold,4)   /* ? */
802
803   MDRV_INTERLEAVE(400)
804
805   /* video hardware */
806   MDRV_SCREEN_REFRESH_RATE(60)
807   MDRV_VIDEO_ATTRIBUTES(VIDEO_TYPE_RASTER)
808   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
809   MDRV_SCREEN_SIZE(32*8, 32*8)
810   MDRV_SCREEN_VISIBLE_AREA(0*8, 32*8-1, 4*8, 28*8-1)
811   MDRV_GFXDECODE(raiders5)
812   MDRV_PALETTE_LENGTH(0x300)
813
814   MDRV_VIDEO_START(raiders5)
815   MDRV_VIDEO_UPDATE(raiders5)
816
817   /* sound hardware */
818   MDRV_SPEAKER_STANDARD_MONO("mono")
819
820   MDRV_SOUND_ADD(AY8910, MAIN_CLOCK/8)   // 1.5MHz
821   MDRV_SOUND_CONFIG(pkunwar_ay8910_interface_1)
822   MDRV_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.25)
823
824   MDRV_SOUND_ADD(AY8910, MAIN_CLOCK/8)
825   MDRV_SOUND_CONFIG(pkunwar_ay8910_interface_2)
826   MDRV_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.25)
827MACHINE_DRIVER_END
828
829
830
831/*************************************
832 *
833 *  ROM definitions
834 *
835 *************************************/
836
227837ROM_START( nova2001 )
228838   ROM_REGION( 0x10000, REGION_CPU1, 0 )
229839   ROM_LOAD( "1.6c",         0x0000, 0x2000, CRC(368cffc0) SHA1(b756c0542d5b86640af62639bdd0d32f6e364dd3) )
230840   ROM_LOAD( "2.6d",         0x2000, 0x2000, CRC(bc4e442b) SHA1(6e1dca5dde442db95403377bf49aaad2a337813e) )
231841   ROM_LOAD( "3.6f",         0x4000, 0x2000, CRC(b2849038) SHA1(b56c7c03ef7c677cc6df0280a485f9cda3435b23) )
232842   ROM_LOAD( "4.6g",         0x6000, 0x1000, CRC(6b5bb12d) SHA1(74aee3d08a7ee1f98eaec4a4b3062aa9d17948ec) )
233   ROM_RELOAD(               0x7000, 0x1000 )
843   ROM_RELOAD(               0x7000, 0x1000 )   // half size ROM, mirrored
234844
235   ROM_REGION( 0x4000, REGION_GFX1, ROMREGION_DISPOSE )
236   ROM_LOAD( "5.12s",        0x0000, 0x2000, CRC(54198941) SHA1(fe762a0bbcf10b13ece87ded2ea730257cfbe7d3) )
237   ROM_LOAD( "6.12p",        0x2000, 0x2000, CRC(cbd90dca) SHA1(7eacde832f5783f4389fb98d6bf6b26dd494665d) )
845   ROM_REGION( 0x8000, REGION_GFX1, ROMREGION_DISPOSE )
846   ROM_LOAD16_BYTE( "5.12s",        0x0000, 0x2000, CRC(54198941) SHA1(fe762a0bbcf10b13ece87ded2ea730257cfbe7d3) )
847   ROM_LOAD16_BYTE( "6.12p",        0x0001, 0x2000, CRC(cbd90dca) SHA1(7eacde832f5783f4389fb98d6bf6b26dd494665d) )
848   ROM_LOAD16_BYTE( "7.12n",        0x4000, 0x2000, CRC(9ebd8806) SHA1(26b6caa0d0a7ae52a182070ecc7bc696c12038b3) )
849   ROM_LOAD16_BYTE( "8.12l",        0x4001, 0x2000, CRC(d1b18389) SHA1(2d808fee774f1bb4cec42e23cfef36b54eee0efa) )
238850
239   ROM_REGION( 0x4000, REGION_GFX2, ROMREGION_DISPOSE )
240   ROM_LOAD( "7.12n",        0x0000, 0x2000, CRC(9ebd8806) SHA1(26b6caa0d0a7ae52a182070ecc7bc696c12038b3) )
241   ROM_LOAD( "8.12l",        0x2000, 0x2000, CRC(d1b18389) SHA1(2d808fee774f1bb4cec42e23cfef36b54eee0efa) )
242
243851   ROM_REGION( 0x0020, REGION_PROMS, 0 )
244852   ROM_LOAD( "nova2001.clr", 0x0000, 0x0020, CRC(a2fac5cd) SHA1(ad14aa2be57722d1f48b47171fe72f96091423b6) )
245853ROM_END
r1679r1680
250858   ROM_LOAD( "nova2001.2",   0x2000, 0x2000, CRC(fab87144) SHA1(506703f9d96443839f864ef5bde1a71120f54384) )
251859   ROM_LOAD( "3.6f",         0x4000, 0x2000, CRC(b2849038) SHA1(b56c7c03ef7c677cc6df0280a485f9cda3435b23) )
252860   ROM_LOAD( "4.6g",         0x6000, 0x1000, CRC(6b5bb12d) SHA1(74aee3d08a7ee1f98eaec4a4b3062aa9d17948ec) )
253   ROM_RELOAD(               0x7000, 0x1000 )
861   ROM_RELOAD(               0x7000, 0x1000 )   // half size ROM, mirrored
254862
255   ROM_REGION( 0x4000, REGION_GFX1, ROMREGION_DISPOSE )
256   ROM_LOAD( "nova2001.5",   0x0000, 0x2000, CRC(8ea576e8) SHA1(d8dbcfd43aafe25afad7f947a80737cdc55b23d7) )
257   ROM_LOAD( "nova2001.6",   0x2000, 0x2000, CRC(0c61656c) SHA1(41c480799798c95543b5a805694e68282b9f563a) )
863   ROM_REGION( 0x8000, REGION_GFX1, ROMREGION_DISPOSE )
864   ROM_LOAD16_BYTE( "nova2001.5",   0x0000, 0x2000, CRC(8ea576e8) SHA1(d8dbcfd43aafe25afad7f947a80737cdc55b23d7) )
865   ROM_LOAD16_BYTE( "nova2001.6",   0x0001, 0x2000, CRC(0c61656c) SHA1(41c480799798c95543b5a805694e68282b9f563a) )
866   ROM_LOAD16_BYTE( "7.12n",        0x4000, 0x2000, CRC(9ebd8806) SHA1(26b6caa0d0a7ae52a182070ecc7bc696c12038b3) )
867   ROM_LOAD16_BYTE( "8.12l",        0x4001, 0x2000, CRC(d1b18389) SHA1(2d808fee774f1bb4cec42e23cfef36b54eee0efa) )
258868
259   ROM_REGION( 0x4000, REGION_GFX2, ROMREGION_DISPOSE )
260   ROM_LOAD( "7.12n",        0x0000, 0x2000, CRC(9ebd8806) SHA1(26b6caa0d0a7ae52a182070ecc7bc696c12038b3) )
261   ROM_LOAD( "8.12l",        0x2000, 0x2000, CRC(d1b18389) SHA1(2d808fee774f1bb4cec42e23cfef36b54eee0efa) )
262
263869   ROM_REGION( 0x0020, REGION_PROMS, 0 )
264870   ROM_LOAD( "nova2001.clr", 0x0000, 0x0020, CRC(a2fac5cd) SHA1(ad14aa2be57722d1f48b47171fe72f96091423b6) )
265871ROM_END
266872
873ROM_START( ninjakun ) /* Original Board? */
874   ROM_REGION( 0x10000, REGION_CPU1, 0 )
875   ROM_LOAD( "ninja-1.7a",  0x0000, 0x02000, CRC(1c1dc141) SHA1(423d3ed35e73a8d5bfce075a889b0322b207bd0d) )
876   ROM_LOAD( "ninja-2.7b",  0x2000, 0x02000, CRC(39cc7d37) SHA1(7f0d0e1e92cb6a57f15eb7fc51a67112f1c5fc8e) )
877   ROM_LOAD( "ninja-3.7d",  0x4000, 0x02000, CRC(d542bfe3) SHA1(3814d8f5b1acda21438fff4f71670fa653dc7b30) )
878   ROM_LOAD( "ninja-4.7e",  0x6000, 0x02000, CRC(a57385c6) SHA1(77925a281e64889bfe967c3d42a388529aaf7eb6) )
267879
880   ROM_REGION( 0x10000, REGION_CPU2, 0 )
881   ROM_LOAD( "ninja-5.7h",  0x0000, 0x02000, CRC(164a42c4) SHA1(16b434b33b76b878514f67c23315d4c6da7bfc9e) )
268882
269GAME( 1983, nova2001, 0,        nova2001, nova2001, 0, ROT0, "UPL", "Nova 2001 (Japan)", 0 )
270GAME( 1983, nov2001u, nova2001, nova2001, nova2001, 0, ROT0, "UPL (Universal license)", "Nova 2001 (US)", 0 )
883   ROM_REGION( 0x08000, REGION_GFX1, ROMREGION_DISPOSE )
884   ROM_LOAD16_BYTE( "ninja-6.7n",  0x0000, 0x02000, CRC(a74c4297) SHA1(87184d14c67331f2c8a2412e28f31427eddae799) )
885   ROM_LOAD16_BYTE( "ninja-7.7p",  0x0001, 0x02000, CRC(53a72039) SHA1(d77d608ce9388a8956831369badd88a8eda8e102) )
886   ROM_LOAD16_BYTE( "ninja-8.7s",  0x4000, 0x02000, CRC(4a99d857) SHA1(6aadb6a5c721a161a5c1bef5569c1e323e380cff) )
887   ROM_LOAD16_BYTE( "ninja-9.7t",  0x4001, 0x02000, CRC(dede49e4) SHA1(8ce4bc02ec583b3885ca63fb5e2d5dad185fe192) )
888
889   ROM_REGION( 0x08000, REGION_GFX2, ROMREGION_DISPOSE )
890   ROM_LOAD16_BYTE( "ninja-10.2c", 0x0000, 0x02000, CRC(0d55664a) SHA1(955a607b4401ce9f3f807d53833a766152b0ef9b) )
891   ROM_LOAD16_BYTE( "ninja-11.2d", 0x0001, 0x02000, CRC(12ff9597) SHA1(10b572844ab32e3ae54abe3600fecc1a811ac713) )
892   ROM_LOAD16_BYTE( "ninja-12.4c", 0x4000, 0x02000, CRC(e9b75807) SHA1(cf4c8ac962f785e9de5502df58eab9b3725aaa28) )
893   ROM_LOAD16_BYTE( "ninja-13.4d", 0x4001, 0x02000, CRC(1760ed2c) SHA1(ee4c8efcce483c8051873714856824a1a1e14b61) )
894ROM_END
895
896ROM_START( pkunwar )
897   ROM_REGION( 0x10000, REGION_CPU1, 0 )
898   ROM_LOAD( "pkwar.01r",    0x0000, 0x4000, CRC(ce2d2c7b) SHA1(2ffe2eb339fd668ec4fe90eff66124a334db0693) )
899   ROM_LOAD( "pkwar.02r",    0x4000, 0x4000, CRC(abc1f661) SHA1(c4bf4a345efd4271617de9f334303d81c6885aa5) )
900   ROM_LOAD( "pkwar.03r",    0xe000, 0x2000, CRC(56faebea) SHA1(dd0406c723a08f5d1120655857a115ab8c2d2a11) )
901
902   ROM_REGION( 0x10000, REGION_GFX1, ROMREGION_DISPOSE )   // (need lineswapping)
903   ROM_LOAD( "pkwar.01y",    0x0000, 0x4000, CRC(428d3b92) SHA1(7fe11e8d785fe829d34e512f233bb9ccc70cd431) )
904   ROM_LOAD( "pkwar.02y",    0x4000, 0x4000, CRC(ce1da7bc) SHA1(a2357b61703a689ce63aec7dd44702b119894f8e) )
905   ROM_LOAD( "pkwar.03y",    0x8000, 0x4000, CRC(63204400) SHA1(1ba87ad3425c51150cb65408f04ee0147ef332d3) )
906   ROM_LOAD( "pkwar.04y",    0xc000, 0x4000, CRC(061dfca8) SHA1(0a2dd8fc790d607195ca18dfc55575c2b9ddc58a) )
907
908   ROM_REGION( 0x0020, REGION_PROMS, 0 )
909   ROM_LOAD( "pkwar.col",    0x0000, 0x0020, CRC(af0fc5e2) SHA1(480908bf893211b580ae19cfb40dc35ad1bbc343) )
910ROM_END
911
912ROM_START( pkunwarj )
913   ROM_REGION( 0x10000, REGION_CPU1, 0 )
914   ROM_LOAD( "pgunwar.6",    0x0000, 0x4000, CRC(357f3ef3) SHA1(bc651fb7701b395ae8cda1888814af5c5aa325a6) )
915   ROM_LOAD( "pgunwar.5",    0x4000, 0x4000, CRC(0092e49e) SHA1(7945361036f7679e4f4bb6b94f60f3ca09c077dc) )
916   ROM_LOAD( "pkwar.03r",    0xe000, 0x2000, CRC(56faebea) SHA1(dd0406c723a08f5d1120655857a115ab8c2d2a11) )
917
918   ROM_REGION( 0x10000, REGION_GFX1, ROMREGION_DISPOSE )   // (need lineswapping)
919   ROM_LOAD( "pkwar.01y",    0x0000, 0x4000, CRC(428d3b92) SHA1(7fe11e8d785fe829d34e512f233bb9ccc70cd431) )
920   ROM_LOAD( "pkwar.02y",    0x4000, 0x4000, CRC(ce1da7bc) SHA1(a2357b61703a689ce63aec7dd44702b119894f8e) )
921   ROM_LOAD( "pgunwar.2",    0x8000, 0x4000, CRC(a2a43443) SHA1(4e10569886d364eb2539928ea81dc1565b60b590) )
922   ROM_LOAD( "pkwar.04y",    0xc000, 0x4000, CRC(061dfca8) SHA1(0a2dd8fc790d607195ca18dfc55575c2b9ddc58a) )
923
924   ROM_REGION( 0x0020, REGION_PROMS, 0 )
925   ROM_LOAD( "pkwar.col",    0x0000, 0x0020, CRC(af0fc5e2) SHA1(480908bf893211b580ae19cfb40dc35ad1bbc343) )
926ROM_END
927
928ROM_START( raiders5 )
929   ROM_REGION( 0x10000, REGION_CPU1, 0 )
930   ROM_LOAD( "raiders5.1", 0x0000,  0x4000, CRC(47cea11f) SHA1(0499e6627ad9c16775fdc59f2ff56dfdfc23490a) )
931   ROM_LOAD( "raiders5.2", 0x4000,  0x4000, CRC(eb2ff410) SHA1(5c995b66b6301cd3cd58efd173481deaa036f842) )
932
933   ROM_REGION( 0x10000, REGION_CPU2, 0 )
934   ROM_LOAD( "raiders5.2", 0x0000,  0x4000, CRC(eb2ff410) SHA1(5c995b66b6301cd3cd58efd173481deaa036f842) )
935
936   ROM_REGION( 0x8000, REGION_GFX1, ROMREGION_DISPOSE )   // (need lineswapping)
937   ROM_LOAD( "raiders3.11f", 0x0000,  0x4000, CRC(30041d58) SHA1(a33087de7afb276925879898a96f418128a5a38c) )
938   ROM_LOAD( "raiders4.11g", 0x4000,  0x4000, CRC(e441931c) SHA1(f39b4c25de779c671a6e2b02df64e7fed726f4da) )
939
940   ROM_REGION( 0x4000, REGION_GFX2, ROMREGION_DISPOSE )   // (need lineswapping)
941   ROM_LOAD( "raiders5.11n", 0x0000,  0x4000, CRC(c0895090) SHA1(a3a1ae57ed66bc095ea9bfb26470290f67aab1fe) )
942ROM_END
943
944ROM_START( raidrs5t )
945   ROM_REGION( 0x10000, REGION_CPU1, 0 )
946   ROM_LOAD( "raiders1.4c", 0x0000,  0x4000, CRC(4e2d5679) SHA1(a1c1603ba98814a83b92ad024ca4422aea872111) )
947   ROM_LOAD( "raiders2.4d", 0x4000,  0x4000, CRC(c8604be1) SHA1(6d23f26174bb9b2f7db3a5fa6b39674fe237135b) )
948
949   ROM_REGION( 0x10000, REGION_CPU2, 0 )
950   ROM_LOAD( "raiders2.4d", 0x0000,  0x4000, CRC(c8604be1) SHA1(6d23f26174bb9b2f7db3a5fa6b39674fe237135b) )
951
952   ROM_REGION( 0x8000, REGION_GFX1, ROMREGION_DISPOSE )   // (need lineswapping)
953   ROM_LOAD( "raiders3.11f", 0x0000,  0x4000, CRC(30041d58) SHA1(a33087de7afb276925879898a96f418128a5a38c) )
954   ROM_LOAD( "raiders4.11g", 0x4000,  0x4000, CRC(e441931c) SHA1(f39b4c25de779c671a6e2b02df64e7fed726f4da) )
955
956   ROM_REGION( 0x4000, REGION_GFX2, ROMREGION_DISPOSE )   // (need lineswapping)
957   ROM_LOAD( "raiders5.11n", 0x0000,  0x4000, CRC(c0895090) SHA1(a3a1ae57ed66bc095ea9bfb26470290f67aab1fe) )
958ROM_END
959
960
961
962/*************************************
963 *
964 *  Gfx ROM swizzling
965 *
966 *************************************/
967
968/******************************************************************************
969
970Gfx ROMs in pkunwar have an unusual layout, where a high address bit
971(which is no the top bit) separates parts of the same tile.
972
973This all originates from Nova2001 apparently, which uses 0x2000 bytes ROMs for
974the graphics. When the number of tiles was increased, the same 0x2000 blocks
975were maintained even if the ROMs got larger.
976
977To make it possible to decode graphics without resorting to ROM_CONTINUE
978trickery, this function makes an address line rotation, bringing bit "bit" to
979bit 0 and shifting left by one place all the intervening bits.
980
981This code is overly generic because it is used for several games in ninjakd2.c
982
983******************************************************************************/
984
985static void lineswap_gfx_roms(const int region, const int bit)
986{
987   const int length = memory_region_length(region);
988
989   UINT8* const src = memory_region(region);
990
991   UINT8* const temp = malloc_or_die(length);
992
993   const int mask = (1 << (bit + 1)) - 1;
994
995   int sa;
996
997   for (sa = 0; sa < length; sa++)
998   {
999      const int da = (sa & ~mask) | ((sa << 1) & mask) | ((sa >> bit) & 1);
1000
1001      temp[da] = src[sa];
1002   }
1003
1004   memcpy(src, temp, length);
1005
1006   free(temp);
1007}
1008
1009
1010
1011/*************************************
1012 *
1013 *  Driver initialization
1014 *
1015 *************************************/
1016
1017static DRIVER_INIT( pkunwar )
1018{
1019   lineswap_gfx_roms(REGION_GFX1, 13);
1020}
1021
1022static DRIVER_INIT( raiders5 )
1023{
1024   lineswap_gfx_roms(REGION_GFX1, 13);
1025   lineswap_gfx_roms(REGION_GFX2, 13);
1026}
1027
1028
1029
1030/*************************************
1031 *
1032 *  Game drivers
1033 *
1034 *************************************/
1035
1036GAME( 1983, nova2001, 0,        nova2001, nova2001, 0,        ROT0, "UPL", "Nova 2001 (Japan)", 0 )
1037GAME( 1983, nov2001u, nova2001, nova2001, nova2001, 0,        ROT0, "UPL (Universal license)", "Nova 2001 (US)", 0 )
1038GAME( 1984, ninjakun, 0,        ninjakun, ninjakun, 0,        ROT0, "[UPL] (Taito license)", "Ninjakun Majou no Bouken", 0 )
1039GAME( 1985?,pkunwar,  0,        pkunwar,  pkunwar,  pkunwar,  ROT0, "UPL", "Penguin-Kun Wars (US)", 0 )
1040GAME( 1985?,pkunwarj, pkunwar,  pkunwar,  pkunwar,  pkunwar,  ROT0, "UPL", "Penguin-Kun Wars (Japan)", 0 )
1041GAME( 1985, raiders5, 0,        raiders5, raiders5, raiders5, ROT0, "UPL", "Raiders5", 0 )
1042GAME( 1985, raidrs5t, raiders5, raiders5, raiders5, raiders5, ROT0, "UPL (Taito license)", "Raiders5 (Japan)", 0 )
src/mame/drivers/stactics.c
r1679r1680
5757/* Defined in video/stactics.c */
5858VIDEO_START( stactics );
5959VIDEO_UPDATE( stactics );
60extern UINT8 *stactics_scroll_ram;
6160extern UINT8 *stactics_videoram_b;
62extern UINT8 *stactics_chardata_b;
6361extern UINT8 *stactics_videoram_d;
64extern UINT8 *stactics_chardata_d;
6562extern UINT8 *stactics_videoram_e;
66extern UINT8 *stactics_chardata_e;
6763extern UINT8 *stactics_videoram_f;
68extern UINT8 *stactics_chardata_f;
64extern UINT8 *stactics_palette;
6965extern UINT8 *stactics_display_buffer;
66extern UINT8 *stactics_lamps;
7067
7168PALETTE_INIT( stactics );
7269
r1679r1680
7673WRITE8_HANDLER( stactics_shot_trigger_w );
7774WRITE8_HANDLER( stactics_shot_flag_clear_w );
7875
79WRITE8_HANDLER( stactics_videoram_b_w );
80WRITE8_HANDLER( stactics_chardata_b_w );
81WRITE8_HANDLER( stactics_videoram_d_w );
82WRITE8_HANDLER( stactics_chardata_d_w );
83WRITE8_HANDLER( stactics_videoram_e_w );
84WRITE8_HANDLER( stactics_chardata_e_w );
85WRITE8_HANDLER( stactics_videoram_f_w );
86WRITE8_HANDLER( stactics_chardata_f_w );
8776
88static ADDRESS_MAP_START( readmem, ADDRESS_SPACE_PROGRAM, 8 )
89    AM_RANGE(0x0000, 0x2fff) AM_READ(MRA8_ROM)
90    AM_RANGE(0x4000, 0x47ff) AM_READ(MRA8_RAM)
91    AM_RANGE(0x5000, 0x5fff) AM_READ(input_port_0_r)
92    AM_RANGE(0x6000, 0x6fff) AM_READ(input_port_1_r)
93    AM_RANGE(0x7000, 0x7fff) AM_READ(stactics_port_2_r)
94    AM_RANGE(0x8000, 0x8fff) AM_READ(stactics_port_3_r)
95    AM_RANGE(0x9000, 0x9fff) AM_READ(stactics_vert_pos_r)
96    AM_RANGE(0xa000, 0xafff) AM_READ(stactics_horiz_pos_r)
97
98    AM_RANGE(0xb000, 0xbfff) AM_READ(MRA8_RAM)   /* B RAM page */
99    AM_RANGE(0xd000, 0xdfff) AM_READ(MRA8_RAM)   /* D RAM page */
100    AM_RANGE(0xe000, 0xefff) AM_READ(MRA8_RAM)   /* E RAM page */
101    AM_RANGE(0xf000, 0xffff) AM_READ(MRA8_RAM)   /* F RAM page */
77static ADDRESS_MAP_START( main_map, ADDRESS_SPACE_PROGRAM, 8 )
78    AM_RANGE(0x0000, 0x2fff) AM_ROM
79    AM_RANGE(0x4000, 0x47ff) AM_RAM
80    AM_RANGE(0x5000, 0x5000) AM_MIRROR(0x0fff) AM_READ(input_port_0_r)
81    AM_RANGE(0x6000, 0x6000) AM_MIRROR(0x0fff) AM_READ(input_port_1_r)
82    AM_RANGE(0x6000, 0x6001) AM_MIRROR(0x0f08) AM_WRITE(stactics_coin_lockout_w)
83    AM_RANGE(0x6002, 0x6005) AM_MIRROR(0x0f08) AM_WRITE(MWA8_NOP)
84    AM_RANGE(0x6006, 0x6007) AM_MIRROR(0x0f08) AM_WRITE(MWA8_RAM) AM_BASE(&stactics_palette)
85 /* AM_RANGE(0x6010, 0x6017) AM_MIRROR(0x0f08) AM_WRITE(stactics_sound_w) */
86    AM_RANGE(0x6016, 0x6016) AM_MIRROR(0x0f08) AM_WRITE(MWA8_RAM) AM_BASE(&stactics_motor_on)  /* Note: This overlaps rocket sound */
87    AM_RANGE(0x6020, 0x6027) AM_MIRROR(0x0f08) AM_WRITE(MWA8_RAM) AM_BASE(&stactics_lamps)
88    AM_RANGE(0x6030, 0x6030) AM_MIRROR(0x0f0f) AM_WRITE(stactics_speed_latch_w)
89    AM_RANGE(0x6040, 0x6040) AM_MIRROR(0x0f0f) AM_WRITE(stactics_shot_trigger_w)
90    AM_RANGE(0x6050, 0x6050) AM_MIRROR(0x0f0f) AM_WRITE(stactics_shot_flag_clear_w)
91    AM_RANGE(0x6060, 0x606f) AM_MIRROR(0x0f00) AM_WRITE(MWA8_RAM) AM_BASE(&stactics_display_buffer)
92    AM_RANGE(0x6070, 0x609f) AM_MIRROR(0x0f00) AM_WRITE(MWA8_NOP)
93 /* AM_RANGE(0x60a0, 0x60ef) AM_MIRROR(0x0f00) AM_WRITE(stactics_sound2_w) */
94    AM_RANGE(0x60f0, 0x60ff) AM_MIRROR(0x0f00) AM_WRITE(MWA8_NOP)
95    AM_RANGE(0x7000, 0x7000) AM_MIRROR(0x0fff) AM_READ(stactics_port_2_r)
96    AM_RANGE(0x8000, 0x8000) AM_MIRROR(0x0fff) AM_READ(stactics_port_3_r)
97    AM_RANGE(0x8000, 0x8fff) AM_WRITE(stactics_scroll_ram_w)
98    AM_RANGE(0x9000, 0x9000) AM_MIRROR(0x0fff) AM_READ(stactics_vert_pos_r)
99    AM_RANGE(0xa000, 0xa000) AM_MIRROR(0x0fff) AM_READ(stactics_horiz_pos_r)
100    AM_RANGE(0xb000, 0xbfff) AM_RAM AM_BASE(&stactics_videoram_b)
101    AM_RANGE(0xc000, 0xcfff) AM_NOP
102    AM_RANGE(0xd000, 0xdfff) AM_RAM AM_BASE(&stactics_videoram_d)
103    AM_RANGE(0xe000, 0xefff) AM_RAM AM_BASE(&stactics_videoram_e)
104    AM_RANGE(0xf000, 0xffff) AM_RAM AM_BASE(&stactics_videoram_f)
102105ADDRESS_MAP_END
103106
104static ADDRESS_MAP_START( writemem, ADDRESS_SPACE_PROGRAM, 8 )
105    AM_RANGE(0x4000, 0x47ff) AM_WRITE(MWA8_RAM)
106    AM_RANGE(0x6000, 0x6001) AM_WRITE(stactics_coin_lockout_w)
107    AM_RANGE(0x6006, 0x6007) AM_WRITE(stactics_palette_w)
108    /* AM_RANGE(0x6010, 0x601f) AM_WRITE(stactics_sound_w) */
109    AM_RANGE(0x6016, 0x6016) AM_WRITE(MWA8_RAM) AM_BASE(&stactics_motor_on)  /* Note: This overlaps rocket sound */
110    /* AM_RANGE(0x6020, 0x602f) AM_WRITE(stactics_lamp_latch_w) */
111    AM_RANGE(0x6030, 0x603f) AM_WRITE(stactics_speed_latch_w)
112    AM_RANGE(0x6040, 0x604f) AM_WRITE(stactics_shot_trigger_w)
113    AM_RANGE(0x6050, 0x605f) AM_WRITE(stactics_shot_flag_clear_w)
114    AM_RANGE(0x6060, 0x606f) AM_WRITE(MWA8_RAM) AM_BASE(&stactics_display_buffer)
115    /* AM_RANGE(0x60a0, 0x60ef) AM_WRITE(stactics_sound2_w) */
116107
117    AM_RANGE(0x8000, 0x8fff) AM_WRITE(stactics_scroll_ram_w) AM_BASE(&stactics_scroll_ram)
118
119    AM_RANGE(0xb000, 0xb3ff) AM_WRITE(stactics_videoram_b_w) AM_BASE(&stactics_videoram_b) AM_SIZE(&videoram_size)
120    AM_RANGE(0xb400, 0xb7ff) AM_WRITE(MWA8_RAM)   /* Unused, but initialized */
121    AM_RANGE(0xb800, 0xbfff) AM_WRITE(stactics_chardata_b_w) AM_BASE(&stactics_chardata_b)
122
123    AM_RANGE(0xc000, 0xcfff) AM_WRITE(MWA8_NOP) /* according to the schematics, nothing is mapped here */
124                                 /* but, the game still tries to clear this out         */
125
126    AM_RANGE(0xd000, 0xd3ff) AM_WRITE(stactics_videoram_d_w) AM_BASE(&stactics_videoram_d)
127    AM_RANGE(0xd400, 0xd7ff) AM_WRITE(MWA8_RAM)   /* Used as scratch RAM, high scores, etc. */
128    AM_RANGE(0xd800, 0xdfff) AM_WRITE(stactics_chardata_d_w) AM_BASE(&stactics_chardata_d)
129
130    AM_RANGE(0xe000, 0xe3ff) AM_WRITE(stactics_videoram_e_w) AM_BASE(&stactics_videoram_e)
131    AM_RANGE(0xe400, 0xe7ff) AM_WRITE(MWA8_RAM)   /* Used as scratch RAM, high scores, etc. */
132    AM_RANGE(0xe800, 0xefff) AM_WRITE(stactics_chardata_e_w) AM_BASE(&stactics_chardata_e)
133
134    AM_RANGE(0xf000, 0xf3ff) AM_WRITE(stactics_videoram_f_w) AM_BASE(&stactics_videoram_f)
135    AM_RANGE(0xf400, 0xf7ff) AM_WRITE(MWA8_RAM)   /* Used as scratch RAM, high scores, etc. */
136    AM_RANGE(0xf800, 0xffff) AM_WRITE(stactics_chardata_f_w) AM_BASE(&stactics_chardata_f)
137
138ADDRESS_MAP_END
139
140108static INPUT_PORTS_START( stactics )
141109
142110    PORT_START  /*  IN0 */
r1679r1680
207175    PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_8WAY
208176INPUT_PORTS_END
209177
210/* For the character graphics */
211178
212static const gfx_layout gfxlayout =
213{
214    8,8,
215    256,
216    1,     /* 1 bit per pixel */
217    { 0 },
218    { 0, 1, 2, 3, 4, 5, 6, 7 },
219    { 0*8, 1*8, 2*8, 3*8, 4*8, 5*8, 6*8, 7*8 },
220    8*8
221};
222
223/* For the LED Fire Beam (made up) */
224
225static const gfx_layout firelayout =
226{
227    16,9,
228    256,
229    1,     /* 1 bit per pixel */
230    { 0 },
231    { 0, 0, 1, 1, 2, 2, 3, 3, 4, 4, 5, 5, 6, 6, 7, 7 },
232    { 0*8, 1*8, 2*8, 3*8, 4*8, 5*8, 6*8, 7*8, 8*8 },
233    8*9
234};
235
236static GFXDECODE_START( stactics )
237    GFXDECODE_ENTRY( 0, 0, gfxlayout,  0,      64*4 )    /* Dynamically decoded from RAM */
238    GFXDECODE_ENTRY( 0, 0, gfxlayout,  1*2*16, 64*4 )    /* Dynamically decoded from RAM */
239    GFXDECODE_ENTRY( 0, 0, gfxlayout,  2*2*16, 64*4 )    /* Dynamically decoded from RAM */
240    GFXDECODE_ENTRY( 0, 0, gfxlayout,  3*2*16, 64*4 )    /* Dynamically decoded from RAM */
241    GFXDECODE_ENTRY( 0, 0, firelayout, 0, 64*4 )         /* LED Fire beam (synthesized gfx) */
242    GFXDECODE_ENTRY( 0, 0, gfxlayout,  0, 64*4 )         /* LED and Misc. Display characters */
243GFXDECODE_END
244
245179static MACHINE_DRIVER_START( stactics )
246180
247181   /* basic machine hardware */
248182   MDRV_CPU_ADD(8080, 1933560)
249   MDRV_CPU_PROGRAM_MAP(readmem,writemem)
183   MDRV_CPU_PROGRAM_MAP(main_map,0)
250184   MDRV_CPU_VBLANK_INT(stactics_interrupt,1)
251185
252186   MDRV_SCREEN_REFRESH_RATE(60)
253187   MDRV_SCREEN_VBLANK_TIME(DEFAULT_60HZ_VBLANK_DURATION)
254188
255189   /* video hardware */
256   MDRV_VIDEO_ATTRIBUTES(VIDEO_TYPE_RASTER)
190   MDRV_VIDEO_ATTRIBUTES(VIDEO_TYPE_RASTER | VIDEO_ALWAYS_UPDATE)
257191   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
258192   MDRV_SCREEN_SIZE(32*8, 32*8)
259   MDRV_SCREEN_VISIBLE_AREA(0*8, 32*8-1, 0*8, 32*8-1)
260   MDRV_GFXDECODE(stactics)
261   MDRV_PALETTE_LENGTH(16)
262   MDRV_COLORTABLE_LENGTH(16*4*4*2)
193   MDRV_SCREEN_VISIBLE_AREA(0*8, 32*8-1, 0*8, 30*8-1)
194   MDRV_PALETTE_LENGTH(0x400)
263195
264196   MDRV_PALETTE_INIT(stactics)
265197   MDRV_VIDEO_START(stactics)
r1679r1680
285217   ROM_LOAD( "epr-222y",     0x2000, 0x0800, CRC(24dd2bcc) SHA1(f77c59beccc1a77e3bfc2928ff532d6e221ff42d) )
286218   ROM_LOAD( "epr-223x",     0x2800, 0x0800, CRC(7fef0940) SHA1(5b2af55f75ef0130f9202b6a916a96dbd601fcfa) )
287219
288   ROM_REGION( 0x1060, REGION_GFX1, ROMREGION_DISPOSE )   /* gfx decoded in vh_start */
289   ROM_LOAD( "epr-217",      0x0000, 0x0800, CRC(38259f5f) SHA1(1f4182ffc2d78fca22711526bb2ae2cfe040173c) )      /* LED fire beam data      */
220   ROM_REGION( 0x1040, REGION_PROMS, 0 )
221   ROM_LOAD( "pr54",         0x0000, 0x0800, CRC(9640bd6e) SHA1(dd12952a6591f2056ac1b5688dca0a3a2ef69f2d) )      /* color/priority PROM */
290222   ROM_LOAD( "pr55",         0x0800, 0x0800, CRC(f162673b) SHA1(83743780b6c1f8014df24fa0650000b7cb137d92) )      /* timing PROM (unused)    */
291223   ROM_LOAD( "pr65",         0x1000, 0x0020, CRC(a1506b9d) SHA1(037c3db2ea40eca459e8acba9d1506dd28d72d10) )      /* timing PROM (unused)    */
292224   ROM_LOAD( "pr66",         0x1020, 0x0020, CRC(78dcf300) SHA1(37034cc0cfa4a8ec47937a2a34b77ec56b387a9b) )      /* timing PROM (unused)    */
293   ROM_LOAD( "pr67",         0x1040, 0x0020, CRC(b27874e7) SHA1(c24bc78c4b2ae01aaed5d994ce2e7c5e0f2eece8) )      /* LED timing ROM (unused) */
294225
295   ROM_REGION( 0x0800, REGION_PROMS, 0 )
296   ROM_LOAD( "pr54",         0x0000, 0x0800, CRC(9640bd6e) SHA1(dd12952a6591f2056ac1b5688dca0a3a2ef69f2d) )         /* color/priority prom */
226   ROM_REGION( 0x0820, REGION_USER1, 0 )
227   ROM_LOAD( "epr-217",      0x0000, 0x0800, CRC(38259f5f) SHA1(1f4182ffc2d78fca22711526bb2ae2cfe040173c) )      /* LED fire beam data      */
228   ROM_LOAD( "pr67",         0x0800, 0x0020, CRC(b27874e7) SHA1(c24bc78c4b2ae01aaed5d994ce2e7c5e0f2eece8) )      /* LED timing ROM (unused) */
297229ROM_END
298230
299231
300232
301GAME( 1981, stactics, 0, stactics, stactics, 0, ROT0, "Sega", "Space Tactics", GAME_NO_SOUND )
233GAME( 1981, stactics, 0, stactics, stactics, 0, ORIENTATION_FLIP_X, "Sega", "Space Tactics", GAME_IMPERFECT_GRAPHICS | GAME_NO_SOUND )
302234
src/mame/drivers/calorie.c
r1679r1680
109109
110110static VIDEO_START( calorie )
111111{
112   bg_tilemap = tilemap_create(get_bg_tile_info,tilemap_scan_rows,TILEMAP_TYPE_PEN,     16,16,16,16);
113   fg_tilemap = tilemap_create(get_fg_tile_info,tilemap_scan_rows,TILEMAP_TYPE_PEN, 8, 8,32,32);
112   bg_tilemap = tilemap_create(get_bg_tile_info,tilemap_scan_rows,16,16,16,16);
113   fg_tilemap = tilemap_create(get_fg_tile_info,tilemap_scan_rows,8, 8,32,32);
114114
115115   tilemap_set_transparent_pen(fg_tilemap,0);
116116}
src/mame/drivers/drtomy.c
r1679r1680
9191
9292static VIDEO_START( drtomy )
9393{
94   tilemap_bg = tilemap_create(get_tile_info_bg,tilemap_scan_rows,TILEMAP_TYPE_PEN,      16,16,32,32);
95   tilemap_fg = tilemap_create(get_tile_info_fg,tilemap_scan_rows,TILEMAP_TYPE_PEN, 16,16,32,32);
94   tilemap_bg = tilemap_create(get_tile_info_bg,tilemap_scan_rows,16,16,32,32);
95   tilemap_fg = tilemap_create(get_tile_info_fg,tilemap_scan_rows,16,16,32,32);
9696
9797   tilemap_set_transparent_pen(tilemap_fg,0);
9898}
src/mame/drivers/gdrawpkr.c
r1679r1680
236236
237237#include "driver.h"
238238#include "sound/ay8910.h"
239#include "video/crtc6845.h"
240239#include "machine/6821pia.h"
241240
242241/* from video */
243extern WRITE8_HANDLER( gdrawpkr_videoram_w );
244extern WRITE8_HANDLER( gdrawpkr_colorram_w );
245extern PALETTE_INIT( gdrawpkr );
246extern VIDEO_START( gdrawpkr );
247extern VIDEO_UPDATE( gdrawpkr );
242WRITE8_HANDLER( gdrawpkr_videoram_w );
243WRITE8_HANDLER( gdrawpkr_colorram_w );
244WRITE8_HANDLER( gdrawpkr_mc6845_address_w );
245READ8_HANDLER( gdrawpkr_mc6845_register_r );
246WRITE8_HANDLER( gdrawpkr_mc6845_register_w );
247PALETTE_INIT( gdrawpkr );
248VIDEO_START( gdrawpkr );
249VIDEO_UPDATE( gdrawpkr );
248250
249251
250252/*************************
r1679r1680
255257   AM_RANGE(0x0000, 0x07ff) AM_RAM AM_BASE(&generic_nvram) AM_SIZE(&generic_nvram_size)
256258   AM_RANGE(0x0840, 0x0840) AM_WRITE(AY8910_control_port_0_w)
257259   AM_RANGE(0x0841, 0x0841) AM_WRITE(AY8910_write_port_0_w)
258   AM_RANGE(0x0880, 0x0880) AM_WRITE(crtc6845_address_w)
259   AM_RANGE(0x0881, 0x0881) AM_READWRITE(crtc6845_register_r, crtc6845_register_w)
260   AM_RANGE(0x0880, 0x0880) AM_WRITE(gdrawpkr_mc6845_address_w)
261   AM_RANGE(0x0881, 0x0881) AM_READWRITE(gdrawpkr_mc6845_register_r, gdrawpkr_mc6845_register_w)
260262   AM_RANGE(0x08c4, 0x08c7) AM_READWRITE(pia_0_r, pia_0_w)
261263   AM_RANGE(0x08c8, 0x08cb) AM_READWRITE(pia_1_r, pia_1_w)
262264   AM_RANGE(0x1000, 0x13ff) AM_RAM AM_WRITE(gdrawpkr_videoram_w) AM_BASE(&videoram)
r1679r1680
268270   AM_RANGE(0x0000, 0x07ff) AM_RAM AM_BASE(&generic_nvram) AM_SIZE(&generic_nvram_size)
269271   AM_RANGE(0x0840, 0x0840) AM_WRITE(AY8910_control_port_0_w)
270272   AM_RANGE(0x0841, 0x0841) AM_WRITE(AY8910_write_port_0_w)
271   AM_RANGE(0x0880, 0x0880) AM_WRITE(crtc6845_address_w)
272   AM_RANGE(0x0881, 0x0881) AM_READWRITE(crtc6845_register_r, crtc6845_register_w)
273   AM_RANGE(0x0880, 0x0880) AM_WRITE(gdrawpkr_mc6845_address_w)
274   AM_RANGE(0x0881, 0x0881) AM_READWRITE(gdrawpkr_mc6845_register_r, gdrawpkr_mc6845_register_w)
273275   AM_RANGE(0x08c4, 0x08c7) AM_READWRITE(pia_0_r, pia_0_w)
274276   AM_RANGE(0x08c8, 0x08cb) AM_READWRITE(pia_1_r, pia_1_w)
275277   AM_RANGE(0x1000, 0x13ff) AM_RAM AM_WRITE(gdrawpkr_videoram_w) AM_BASE(&videoram)
r1679r1680
578580   MDRV_SCREEN_VISIBLE_AREA(0*8, 32*8-1, 0*8, 31*8-1)    /* Taken from MC6845 init, registers 01 & 06 */
579581
580582   MDRV_GFXDECODE(gdrawpkr)
581   MDRV_PALETTE_LENGTH(256)
582   MDRV_COLORTABLE_LENGTH(1024)
583   MDRV_PALETTE_LENGTH(1024)
583584
584585   MDRV_PALETTE_INIT(gdrawpkr)
585586   MDRV_VIDEO_START(gdrawpkr)
r1679r1680
619620   ROM_LOAD( "cg-2b.u69",    0x0800, 0x0800, CRC(6bbb1e2d) SHA1(51ee282219bf84218886ad11a24bc6a8e7337527) )
620621   ROM_LOAD( "cg-2a.u68",    0x1000, 0x0800, CRC(6e3e9b1d) SHA1(14eb8d14ce16719a6ad7d13db01e47c8f05955f0) )
621622
622   ROM_REGION( 0x100, REGION_PROMS, 0 )
623   ROM_REGION( 0x400, REGION_PROMS, 0 )
623624   ROM_LOAD( "82s129n.u28", 0x0000, 0x0100, CRC(6db5a344) SHA1(5f1a81ac02a2a74252decd3bb95a5436cc943930) )
625   ROM_RELOAD(              0x0100, 0x0100 )
626   ROM_RELOAD(              0x0200, 0x0100 )
627   ROM_RELOAD(              0x0300, 0x0100 )
624628ROM_END
625629
626630ROM_START( elgrande )
r1679r1680
639643   ROM_LOAD( "d1.u69",   0x0800, 0x0800, CRC(ed3c83b7) SHA1(93e2134de3d9f79a6cff0391c1a32fccd3840c3f) )
640644   ROM_LOAD( "d1.u68",   0x1000, 0x0800, BAD_DUMP CRC(3ab70570) SHA1(5ff84015a78d15a5207499f84ce637e49bca136f) ) /* bad bits */
641645
642   ROM_REGION( 0x200, REGION_PROMS, 0 )
646   ROM_REGION( 0x0500, REGION_PROMS, 0 )
643647   ROM_LOAD( "d1.u28", 0x0000, 0x0200, CRC(a6d43709) SHA1(cbff2cb60137462dc0b7c7719a64574218d96c62) )
648   ROM_RELOAD(         0x0100, 0x0200 )
649   ROM_RELOAD(         0x0200, 0x0200 )
650   ROM_RELOAD(         0x0300, 0x0200 )
644651ROM_END
645652
646653
r1679r1680
654661   int x;
655662   UINT8 *BPR = memory_region( REGION_PROMS );
656663
657   for (x=0x0000;x<0x0100;x++)
664   for (x=0x0000;x<0x0400;x++)
658665   {
659666      if (BPR[x] == 0x07)
660667         BPR[x] = 0x04;   /* blue background */
r1679r1680
672679   UINT8 *ROM = memory_region( REGION_GFX2 );
673680
674681   /* Palette transformed by PLDs? */
675   for (x=0x0000;x<0x0100;x++)
682   for (x=0x0000;x<0x0400;x++)
676683   {
677684      if (BPR[x] == 0x07)
678685         BPR[x] = 0x00; /* black background */
src/mame/drivers/gaelco3d.c
r1679r1680
528528         if ((data & 0x0800) == 0)
529529         {
530530            dmadac_enable(0, SOUND_CHANNELS, 0);
531            timer_adjust(adsp_autobuffer_timer, attotime_never, 0, attotime_never);
531            timer_adjust_oneshot(adsp_autobuffer_timer, attotime_never, 0);
532532         }
533533         break;
534534
r1679r1680
537537         if ((data & 0x0002) == 0)
538538         {
539539            dmadac_enable(0, SOUND_CHANNELS, 0);
540            timer_adjust(adsp_autobuffer_timer, attotime_never, 0, attotime_never);
540            timer_adjust_oneshot(adsp_autobuffer_timer, attotime_never, 0);
541541         }
542542         break;
543543
r1679r1680
644644         /* fire off a timer wich will hit every half-buffer */
645645         sample_period = attotime_div(attotime_mul(sample_period, adsp_size), SOUND_CHANNELS * adsp_incs);
646646
647         timer_adjust(adsp_autobuffer_timer, sample_period, 0, sample_period);
647         timer_adjust_periodic(adsp_autobuffer_timer, sample_period, 0, sample_period);
648648
649649         return;
650650      }
r1679r1680
656656   dmadac_enable(0, SOUND_CHANNELS, 0);
657657
658658   /* remove timer */
659   timer_adjust(adsp_autobuffer_timer, attotime_never, 0, attotime_never);
659   timer_adjust_oneshot(adsp_autobuffer_timer, attotime_never, 0);
660660}
661661
662662
src/mame/drivers/namcos11.c
r1679r1680
798798   emu_timer *timer;
799799
800800   timer = timer_alloc( mcu_timer , NULL);
801   timer_adjust( timer, ATTOTIME_IN_HZ( 600 ), 0, ATTOTIME_IN_HZ( 600 ) );
801   timer_adjust_periodic( timer, ATTOTIME_IN_HZ( 600 ), 0, ATTOTIME_IN_HZ( 600 ) );
802802
803803   psx_driver_init();
804804   namcoc7x_on_driver_init();
r1679r1680
912912   PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_UNKNOWN )
913913   PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_UNKNOWN )
914914   PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_SERVICE1 )
915   PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_OTHER ) PORT_NAME( "Test Switch" ) PORT_CODE( KEYCODE_F2 )
915   PORT_SERVICE( 0x04, IP_ACTIVE_HIGH )
916916   PORT_DIPNAME( 0x02, 0x00, "DIP1 (Test)" )
917917   PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
918918   PORT_DIPSETTING(    0x02, DEF_STR( On ) )
src/mame/drivers/galaxian.c
r1679r1680
13421342   PORT_BIT( 0xf0, IP_ACTIVE_HIGH, IPT_UNUSED )
13431343INPUT_PORTS_END
13441344
1345static INPUT_PORTS_START( galtaito )
1346   PORT_START_TAG("IN0")
1347   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_COIN1 )
1348   PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_COIN2 )
1349   PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_JOYSTICK_LEFT ) PORT_2WAY
1350   PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_JOYSTICK_RIGHT ) PORT_2WAY
1351   PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_BUTTON1 )
1352   PORT_DIPNAME( 0x20, 0x20, DEF_STR( Cabinet ) )
1353   PORT_DIPSETTING(    0x20, DEF_STR( Upright ) )
1354   PORT_DIPSETTING(    0x00, DEF_STR( Cocktail ) )
1355   PORT_SERVICE( 0x40, IP_ACTIVE_HIGH )
1356   PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_SERVICE1 )
1357
1358GAL_IN1
1359
1360   PORT_START_TAG("DSW0")
1361   PORT_DIPNAME( 0x03, 0x01, DEF_STR( Bonus_Life ) )
1362   PORT_DIPSETTING(    0x00, DEF_STR( None ) )
1363   PORT_DIPSETTING(    0x01, "4000" )
1364   PORT_DIPSETTING(    0x02, "5000" )
1365   PORT_DIPSETTING(    0x03, "7000" )
1366   PORT_DIPNAME( 0x04, 0x00, DEF_STR( Lives ) )
1367   PORT_DIPSETTING(    0x00, "3" )
1368   PORT_DIPSETTING(    0x04, "5" )
1369   PORT_DIPNAME( 0x08, 0x00, DEF_STR( Unused ) )
1370   PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
1371   PORT_DIPSETTING(    0x08, DEF_STR( On ) )
1372   PORT_BIT( 0xf0, IP_ACTIVE_HIGH, IPT_UNUSED )
1373INPUT_PORTS_END
1374
13451375static INPUT_PORTS_START( superg )
13461376GAL_IN0
13471377GAL_IN1
13481378
13491379   PORT_START_TAG("DSW0")
13501380   PORT_DIPNAME( 0x03, 0x01, DEF_STR( Bonus_Life ) )
1381   PORT_DIPSETTING(    0x00, DEF_STR( None ) )
13511382   PORT_DIPSETTING(    0x01, "4000" )
13521383   PORT_DIPSETTING(    0x02, "5000" )
13531384   PORT_DIPSETTING(    0x03, "7000" )
1354   PORT_DIPSETTING(    0x00, DEF_STR( None ) )
13551385   PORT_DIPNAME( 0x04, 0x00, DEF_STR( Lives ) )
13561386   PORT_DIPSETTING(    0x00, "3" )
13571387   PORT_DIPSETTING(    0x04, "5" )
r1679r1680
49614991   ROM_LOAD( "6l.bpr",       0x0000, 0x0020, CRC(c3ac9467) SHA1(f382ad5a34d282056c78a5ec00c30ec43772bae2) )
49624992ROM_END
49634993
4994ROM_START( galtaito )
4995   ROM_REGION( 0x10000, REGION_CPU1, 0 )
4996   ROM_LOAD( "gl-03.8g",  0x0000, 0x0800, CRC(e8f3aa67) SHA1(a0e9576784dbe602dd9780e667f01f31defd7c00) ) /* All eprom are HN462716 eproms */
4997   ROM_LOAD( "gl-04.8f",  0x0800, 0x0800, CRC(f58283e3) SHA1(edc6e72516c50fd3402281d9936574d276581ce9) )
4998   ROM_LOAD( "gl-05.8e",  0x1000, 0x0800, CRC(4c7031c0) SHA1(97f7ab0cedcd8eba1c8f6f516d84d672a2108258) )
4999   ROM_LOAD( "gl-06.8d",  0x1800, 0x0800, CRC(097d92a2) SHA1(63ef86657286a4e1fae4f795e0e6b410ca2ef06b) )
5000   ROM_LOAD( "gl-07.8c",  0x2000, 0x0800, CRC(5341d75a) SHA1(40bc8fcc598f58c6ff944e2a4a9288463e75a09d) )
5001
5002   ROM_REGION( 0x1000, REGION_GFX1, ROMREGION_DISPOSE )
5003   ROM_LOAD( "gl-01.1j",  0x0000, 0x0800, CRC(968b6016) SHA1(f13e4a8d0fdeb121d39ca76120acdc6c7e7f377c) )
5004   ROM_LOAD( "gl-02.1k",  0x0800, 0x0800, CRC(d14f7510) SHA1(cd09e6ee0a3890d01b2415f5b8346c42c02d15a3) )
5005
5006   ROM_REGION( 0x0020, REGION_PROMS, 0 )
5007   ROM_LOAD( "6l.bpr",    0x0000, 0x0020, CRC(c3ac9467) SHA1(f382ad5a34d282056c78a5ec00c30ec43772bae2) )
5008ROM_END
5009
49645010ROM_START( superg )
49655011   ROM_REGION( 0x10000, REGION_CPU1, 0 )
49665012   ROM_LOAD( "7f.bin",       0x0000, 0x1000, CRC(4335b1de) SHA1(e41e3d90dac738cf71377f3b476ec67b14dee27a) )
r1679r1680
69727018GAME( 1979, galaxiaj, galaxian, galaxian, superg,   0,        ROT90,  "Namco", "Galaxian (Namco set 2)", GAME_SUPPORTS_SAVE )
69737019GAME( 1979, galmidw,  galaxian, galaxian, galaxian, 0,        ROT90,  "[Namco] (Midway license)", "Galaxian (Midway)", GAME_SUPPORTS_SAVE )
69747020GAME( 1979, galmidwo, galaxian, galaxian, galaxian, 0,        ROT90,  "[Namco] (Midway license)", "Galaxian (Midway, old rev)", GAME_SUPPORTS_SAVE )
7021GAME( 1979, galtaito, galaxian, galaxian, galtaito, 0,        ROT90,  "[Namco] (Taito license)", "Galaxian (Taito)", GAME_SUPPORTS_SAVE )
69757022GAME( 1979, superg,   galaxian, galaxian, superg,   0,        ROT90,  "hack", "Super Galaxians", GAME_SUPPORTS_SAVE )
69767023GAME( 1979, galapx,   galaxian, galaxian, superg,   0,        ROT90,  "hack", "Galaxian Part X", GAME_SUPPORTS_SAVE )
69777024GAME( 19??, moonaln,  galaxian, galaxian, superg,   0,        ROT90,  "[Nichibutsu] (Karateco license)", "Moon Alien", GAME_SUPPORTS_SAVE )
src/mame/drivers/hyprduel.c
r1679r1680
611611
612612static INPUT_PORTS_START( hyprduel )
613613   PORT_START
614   PORT_BIT(    0x8000, IP_ACTIVE_LOW, IPT_SERVICE ) PORT_NAME( DEF_STR( Service_Mode )) PORT_CODE(KEYCODE_F2)
614   PORT_SERVICE_NO_TOGGLE( 0x8000, IP_ACTIVE_LOW )
615615   PORT_DIPNAME( 0x4000, 0x0000, "Show Warning" )
616616   PORT_DIPSETTING(      0x4000, DEF_STR( Off ) )
617617   PORT_DIPSETTING(      0x0000, DEF_STR( On ) )
src/mame/drivers/strnskil.c
r1679r1680
1818#include "deprecat.h"
1919#include "sound/sn76496.h"
2020
21static UINT8 *strnskil_sharedram;
22
2321/****************************************************************************/
2422
25extern WRITE8_HANDLER( strnskil_videoram_w );
26extern WRITE8_HANDLER( strnskil_scroll_x_w );
27extern WRITE8_HANDLER( strnskil_scrl_ctrl_w );
23WRITE8_HANDLER( strnskil_videoram_w );
24WRITE8_HANDLER( strnskil_scrl_ctrl_w );
2825
29extern PALETTE_INIT( strnskil );
30extern VIDEO_START( strnskil );
31extern VIDEO_UPDATE( strnskil );
26PALETTE_INIT( strnskil );
27VIDEO_START( strnskil );
28VIDEO_UPDATE( strnskil );
3229
33static WRITE8_HANDLER( strnskil_sharedram_w )
34{
35   strnskil_sharedram[offset] = data;
36}
30extern UINT8 *strnskil_xscroll;
3731
38static READ8_HANDLER( strnskil_sharedram_r )
39{
40   return strnskil_sharedram[offset];
41}
4232
33
4334static READ8_HANDLER( strnskil_d800_r )
4435{
4536/* bit0: interrupt type?, bit1: CPU2 busack? */
r1679r1680
10091   AM_RANGE(0x0000, 0x9fff) AM_READ(MRA8_ROM)
10192
10293   AM_RANGE(0xc000, 0xc7ff) AM_READ(MRA8_RAM)
103   AM_RANGE(0xc800, 0xcfff) AM_READ(strnskil_sharedram_r)
94   AM_RANGE(0xc800, 0xcfff) AM_READ(MRA8_RAM) AM_SHARE(1)
10495   AM_RANGE(0xd000, 0xd7ff) AM_READ(MRA8_RAM) /* videoram */
10596
10697   AM_RANGE(0xd800, 0xd800) AM_READ(strnskil_d800_r)
r1679r1680
115106   AM_RANGE(0x0000, 0x9fff) AM_WRITE(MWA8_ROM)
116107
117108   AM_RANGE(0xc000, 0xc7ff) AM_WRITE(MWA8_RAM)
118   AM_RANGE(0xc800, 0xcfff) AM_WRITE(strnskil_sharedram_w)
109   AM_RANGE(0xc800, 0xcfff) AM_WRITE(MWA8_RAM) AM_SHARE(1)
119110   AM_RANGE(0xd000, 0xd7ff) AM_WRITE(strnskil_videoram_w) AM_BASE(&videoram)
120111
121112   AM_RANGE(0xd808, 0xd808) AM_WRITE(strnskil_scrl_ctrl_w)
122113   AM_RANGE(0xd809, 0xd809) AM_WRITE(MWA8_NOP) /* coin counter? */
123   AM_RANGE(0xd80a, 0xd80b) AM_WRITE(strnskil_scroll_x_w)
114   AM_RANGE(0xd80a, 0xd80b) AM_WRITE(MWA8_RAM) AM_BASE(&strnskil_xscroll)
124115ADDRESS_MAP_END
125116
126117static ADDRESS_MAP_START( strnskil_readmem2, ADDRESS_SPACE_PROGRAM, 8 )
127118   AM_RANGE(0x0000, 0x5fff) AM_READ(MRA8_ROM)
128119   AM_RANGE(0xc000, 0xc7ff) AM_READ(MRA8_RAM)
129   AM_RANGE(0xc800, 0xcfff) AM_READ(MRA8_RAM)
120   AM_RANGE(0xc800, 0xcfff) AM_READ(MRA8_RAM) AM_SHARE(1)
130121ADDRESS_MAP_END
131122
132123static ADDRESS_MAP_START( strnskil_writemem2, ADDRESS_SPACE_PROGRAM, 8 )
133124   AM_RANGE(0x0000, 0x5fff) AM_WRITE(MWA8_ROM)
134125   AM_RANGE(0xc000, 0xc7ff) AM_WRITE(MWA8_RAM) AM_BASE(&spriteram) AM_SIZE(&spriteram_size)
135   AM_RANGE(0xc800, 0xcfff) AM_WRITE(MWA8_RAM) AM_BASE(&strnskil_sharedram)
126   AM_RANGE(0xc800, 0xcfff) AM_WRITE(MWA8_RAM) AM_SHARE(1)
136127
137128   AM_RANGE(0xd801, 0xd801) AM_WRITE(SN76496_0_w)
138129   AM_RANGE(0xd802, 0xd802) AM_WRITE(SN76496_1_w)
r1679r1680
362353   MDRV_SCREEN_SIZE(32*8, 32*8)
363354   MDRV_SCREEN_VISIBLE_AREA(1*8, 31*8-1, 2*8, 30*8-1)
364355   MDRV_GFXDECODE(strnskil)
365   MDRV_PALETTE_LENGTH(256)
366   MDRV_COLORTABLE_LENGTH(1024)
356   MDRV_PALETTE_LENGTH(1024)
367357
368358   MDRV_PALETTE_INIT(strnskil)
369359   MDRV_VIDEO_START(strnskil)
src/mame/drivers/atetris.c
r1679r1680
8787   scanline += 32;
8888   if (scanline >= 256)
8989      scanline -= 256;
90   timer_adjust(interrupt_timer, video_screen_get_time_until_pos(0, scanline, 0), scanline, attotime_zero);
90   timer_adjust_oneshot(interrupt_timer, video_screen_get_time_until_pos(0, scanline, 0), scanline);
9191}
9292
9393
r1679r1680
130130   reset_bank();
131131
132132   /* start interrupts going (32V clocked by 16V) */
133   timer_adjust(interrupt_timer, video_screen_get_time_until_pos(0, 48, 0), 48, attotime_zero);
133   timer_adjust_oneshot(interrupt_timer, video_screen_get_time_until_pos(0, 48, 0), 48);
134134}
135135
136136
src/mame/drivers/shaolins.c
r1679r1680
1313
1414UINT8 shaolins_nmi_enable;
1515
16extern WRITE8_HANDLER( shaolins_videoram_w );
17extern WRITE8_HANDLER( shaolins_colorram_w );
18extern WRITE8_HANDLER( shaolins_palettebank_w );
19extern WRITE8_HANDLER( shaolins_scroll_w );
20extern WRITE8_HANDLER( shaolins_nmi_w );
16WRITE8_HANDLER( shaolins_videoram_w );
17WRITE8_HANDLER( shaolins_colorram_w );
18WRITE8_HANDLER( shaolins_palettebank_w );
19WRITE8_HANDLER( shaolins_scroll_w );
20WRITE8_HANDLER( shaolins_nmi_w );
2121
22extern PALETTE_INIT( shaolins );
23extern VIDEO_START( shaolins );
24extern VIDEO_UPDATE( shaolins );
22PALETTE_INIT( shaolins );
23VIDEO_START( shaolins );
24VIDEO_UPDATE( shaolins );
2525
2626
2727static INTERRUPT_GEN( shaolins_interrupt )
r1679r1680
231231   MDRV_SCREEN_SIZE(32*8, 32*8)
232232   MDRV_SCREEN_VISIBLE_AREA(0*8, 32*8-1, 2*8, 30*8-1)
233233   MDRV_GFXDECODE(shaolins)
234   MDRV_PALETTE_LENGTH(256)
235   MDRV_COLORTABLE_LENGTH(16*8*16+16*8*16)
234   MDRV_PALETTE_LENGTH(16*8*16+16*8*16)
236235
237236   MDRV_PALETTE_INIT(shaolins)
238237   MDRV_VIDEO_START(shaolins)
r1679r1680
302301
303302
304303GAME( 1985, kicker,   0,      shaolins, shaolins, 0, ROT90, "Konami", "Kicker", 0 )
305GAME( 1985, shaolins, kicker, shaolins, shaolins, 0, ROT90, "Konami", "Shao-Lin's Road", 0 )
304GAME( 1985, shaolins, kicker, shaolins, shaolins, 0, ROT90, "Konami", "Shao-lin's Road", 0 )
src/mame/drivers/model2.c
r1679r1680
303303
304304   model2_timerorig[offset] = model2_timervals[offset];
305305   period = attotime_mul(ATTOTIME_IN_HZ(25000000), model2_timerorig[offset]);
306   timer_adjust(model2_timers[offset], period, 0, attotime_zero);
306   timer_adjust_oneshot(model2_timers[offset], period, 0);
307307   model2_timerrun[offset] = 1;
308308}
309309
310310static void model2_timer_exp(int tnum, int bit)
311311{
312   timer_adjust(model2_timers[tnum], attotime_never, 0, attotime_never);
312   timer_adjust_oneshot(model2_timers[tnum], attotime_never, 0);
313313
314314   model2_intreq |= (1<<bit);
315315   if (model2_intena & (1<<bit))
r1679r1680
348348   model2_timers[2] = timer_alloc(model2_timer_2_cb, NULL);
349349   model2_timers[3] = timer_alloc(model2_timer_3_cb, NULL);
350350
351   timer_adjust(model2_timers[0], attotime_never, 0, attotime_never);
352   timer_adjust(model2_timers[1], attotime_never, 0, attotime_never);
353   timer_adjust(model2_timers[2], attotime_never, 0, attotime_never);
354   timer_adjust(model2_timers[3], attotime_never, 0, attotime_never);
351   timer_adjust_oneshot(model2_timers[0], attotime_never, 0);
352   timer_adjust_oneshot(model2_timers[1], attotime_never, 0);
353   timer_adjust_oneshot(model2_timers[2], attotime_never, 0);
354   timer_adjust_oneshot(model2_timers[3], attotime_never, 0);
355355}
356356
357357static MACHINE_RESET(model2o)
r1679r1680
14251425   PORT_START
14261426   PORT_BIT(0x01, IP_ACTIVE_LOW, IPT_COIN1 )
14271427   PORT_BIT(0x02, IP_ACTIVE_LOW, IPT_COIN2 )
1428   PORT_BIT(0x04, IP_ACTIVE_LOW, IPT_SERVICE ) PORT_NAME(DEF_STR( Test )) PORT_CODE(KEYCODE_F2)
1428   PORT_SERVICE_NO_TOGGLE( 0x04, IP_ACTIVE_LOW )
14291429   PORT_BIT(0x08, IP_ACTIVE_LOW, IPT_SERVICE1 )
14301430   PORT_BIT(0x10, IP_ACTIVE_LOW, IPT_START1 )
14311431   PORT_BIT(0x20, IP_ACTIVE_LOW, IPT_START2 )
r1679r1680
14431443   PORT_START
14441444   PORT_BIT(0x01, IP_ACTIVE_LOW, IPT_COIN1 )
14451445   PORT_BIT(0x02, IP_ACTIVE_LOW, IPT_COIN2 )
1446   PORT_BIT(0x04, IP_ACTIVE_LOW, IPT_SERVICE ) PORT_NAME(DEF_STR( Test )) PORT_CODE(KEYCODE_F2)
1446   PORT_SERVICE_NO_TOGGLE( 0x04, IP_ACTIVE_LOW )
14471447   PORT_BIT(0x08, IP_ACTIVE_LOW, IPT_SERVICE1 )
14481448   PORT_BIT(0x10, IP_ACTIVE_LOW, IPT_START1 )
14491449   PORT_BIT(0x20, IP_ACTIVE_LOW, IPT_BUTTON4 ) PORT_PLAYER(1) // VR 1 (Blue)
r1679r1680
14741474   PORT_START
14751475   PORT_BIT(0x01, IP_ACTIVE_LOW, IPT_COIN1 )
14761476   PORT_BIT(0x02, IP_ACTIVE_LOW, IPT_COIN2 )
1477   PORT_BIT(0x04, IP_ACTIVE_LOW, IPT_SERVICE ) PORT_NAME(DEF_STR( Test )) PORT_CODE(KEYCODE_F2)
1477   PORT_SERVICE_NO_TOGGLE( 0x04, IP_ACTIVE_LOW )
14781478   PORT_BIT(0x08, IP_ACTIVE_LOW, IPT_SERVICE1 )
14791479   PORT_BIT(0x10, IP_ACTIVE_LOW, IPT_START1 )
14801480   PORT_BIT(0x20, IP_ACTIVE_LOW, IPT_BUTTON4 ) PORT_PLAYER(1) // VR 1 (Red)
r1679r1680
15071507   PORT_BIT(0x01, IP_ACTIVE_LOW, IPT_COIN1 )
15081508   PORT_BIT(0x02, IP_ACTIVE_LOW, IPT_COIN2 )
15091509   PORT_BIT(0x04, IP_ACTIVE_LOW, IPT_SERVICE1 )
1510   PORT_BIT(0x08, IP_ACTIVE_LOW, IPT_SERVICE ) PORT_NAME(DEF_STR( Test )) PORT_CODE(KEYCODE_F2)
1510   PORT_SERVICE_NO_TOGGLE( 0x08, IP_ACTIVE_LOW )
15111511   PORT_BIT(0x10, IP_ACTIVE_LOW, IPT_START1 )
15121512   PORT_BIT(0x20, IP_ACTIVE_LOW, IPT_START2 )
15131513   PORT_BIT(0x40, IP_ACTIVE_LOW, IPT_SERVICE ) PORT_NAME("1P Push Switch") PORT_CODE(KEYCODE_7)
src/mame/drivers/wiping.c
r1679r1680
326326   MDRV_SCREEN_SIZE(36*8, 28*8)
327327   MDRV_SCREEN_VISIBLE_AREA(0*8, 36*8-1, 0*8, 28*8-1)
328328   MDRV_GFXDECODE(wiping)
329   MDRV_PALETTE_LENGTH(32)
330   MDRV_COLORTABLE_LENGTH(64*4+64*4)
329   MDRV_PALETTE_LENGTH(64*4+64*4)
331330
332331   MDRV_PALETTE_INIT(wiping)
333332   MDRV_VIDEO_UPDATE(wiping)
src/mame/drivers/gstream.c
r1679r1680
326326
327327static VIDEO_START(gstream)
328328{
329   gstream_tilemap1 = tilemap_create(get_gs1_tile_info,tilemap_scan_rows,TILEMAP_TYPE_PEN, 32, 32,16,16);
330   gstream_tilemap2 = tilemap_create(get_gs2_tile_info,tilemap_scan_rows,TILEMAP_TYPE_PEN, 32, 32,16,16);
331   gstream_tilemap3 = tilemap_create(get_gs3_tile_info,tilemap_scan_rows,TILEMAP_TYPE_PEN, 32, 32,16,16);
329   gstream_tilemap1 = tilemap_create(get_gs1_tile_info,tilemap_scan_rows, 32, 32,16,16);
330   gstream_tilemap2 = tilemap_create(get_gs2_tile_info,tilemap_scan_rows, 32, 32,16,16);
331   gstream_tilemap3 = tilemap_create(get_gs3_tile_info,tilemap_scan_rows, 32, 32,16,16);
332332
333333   tilemap_set_transparent_pen(gstream_tilemap1,0);
334334   tilemap_set_transparent_pen(gstream_tilemap2,0);
src/mame/drivers/cps2.c
r1679r1680
542542  - Any new region sets will need full encryption tables dumped to extract the proper
543543    keys or they will need to be brute forced. XORs are no longer supported nor wanted.
544544
545
546Stephh's inputs notes (based on some tests on the "parent" set) :
547
5480) All games
549
550  - All inputs have been mapped according to the "test mode"
551    (even if some buttons don't physically exist on the machine).
552  - Joysticks and buttons can be fully tested.
553  - COINn sometimes don't show anything but are OK ingame.
554  - Unless I notify something below for some games, there is no extra button !
555
5561) 'mmancp2u'
557
558  - BUTTON3 doesn't physically exist on the machine and has no effect ingame.
559
5602) 'megaman2'
561
562  - BUTTON3 doesn't physically exist on the machine and has no effect ingame.
563
5643) 'mpang'
565
566  - BUTTON2 doesn't physically exist on the machine and can't be seen in the "test mode".
567    However, if you map it where it should be, it has the same effect as BUTTON1.
568
5694) 'pzloop2'
570
571  - Whatever your settings are, the paddle can't be tested in the "test mode" !
572    I can't tell at the moment if it's an emulation or an ingame bug :(
573
5745) 'dimahoo'
575
576  - BUTTON3 doesn't physically exist on the machine.
577    However, it acts like a rapid fire (keep button pressed).
578
5796) 'progear'
580
581  - BUTTON3 doesn't physically exist on the machine and has no effect ingame.
582
545583***************************************************************************/
546584
547585#include "driver.h"
r1679r1680
564602}
565603#endif
566604
605
606/*************************************
607 *
608 *  Constants
609 *
610 *************************************/
611
567612/* Maximum size of Q Sound Z80 region */
568613#define QSOUND_SIZE 0x50000
569614
r1679r1680
572617#define CODE_SIZE   0x0400000
573618
574619
620/*************************************
621 *
622 *  Global variables
623 *
624 *************************************/
625
575626static int readpaddle;
576627static int cps2networkpresent;
577628
629
630/*************************************
631 *
632 *  Interrupt generation
633 *
634 *************************************/
635
578636static INTERRUPT_GEN( cps2_interrupt )
579637{
580638   static int scancount;
r1679r1680
633691}
634692
635693
694/*************************************
695 *
696 *  EEPROM
697 *
698 *************************************/
636699
637700static const struct EEPROM_interface cps2_eeprom_interface =
638701{
r1679r1680
656719   }
657720}
658721
659static READ16_HANDLER( cps2_eeprom_port_r )
722static CUSTOM_INPUT( cps2_eeprom_port_r )
660723{
661    return (input_port_2_word_r(offset,0) & 0xfffe) | EEPROM_read_bit();
724    return EEPROM_read_bit();
662725}
663726
664727static WRITE16_HANDLER( cps2_eeprom_port_w )
r1679r1680
729792    }
730793}
731794
795
796/*************************************
797 *
798 *  Sound ?
799 *
800 *************************************/
801
732802static READ16_HANDLER( cps2_qsound_volume_r )
733803{
734804   /* Extra adapter memory (0x660000-0x663fff) available when bit 14 = 0 */
r1679r1680
742812}
743813
744814
745static UINT8 CPS2_Read8(offs_t address)
815/*************************************
816 *
817 *  ???
818 *
819 *************************************/
820
821static UINT8  cps2_read8(offs_t address)
746822{
747823   return m68k_read_pcrelative_8(address);
748824}
749825
750static UINT16 CPS2_Read16(offs_t address)
826static UINT16 cps2_read16(offs_t address)
751827{
752828   return m68k_read_pcrelative_16(address);
753829}
754830
755static UINT32 CPS2_Read32(offs_t address)
831static UINT32 cps2_read32(offs_t address)
756832{
757833   return m68k_read_pcrelative_32(address);
758834}
759835
760836
837/*************************************
838 *
839 *  Read handlers
840 *
841 *************************************/
761842
762843static READ16_HANDLER( kludge_r )
763844{
764845   return 0xffff;
765846}
766847
848static READ16_HANDLER( joy_or_paddle_r )
849{
850   if (readpaddle != 0)
851      return (readinputportbytag("IN0"));
852   else
853      return (readinputportbytag("PADDLE1") & 0xff) | (readinputportbytag("PADDLE2") << 8);
854}
767855
856
857/*************************************
858 *
859 *  Memory map
860 *
861 *************************************/
862
768863static ADDRESS_MAP_START( cps2_readmem, ADDRESS_SPACE_PROGRAM, 16 )
769   AM_RANGE(0x000000, 0x3fffff) AM_READ(MRA16_ROM)            /* 68000 ROM */
770   AM_RANGE(0x400000, 0x40000b) AM_READ(MRA16_RAM)            /* CPS2 object output */
771   AM_RANGE(0x618000, 0x619fff) AM_READ(qsound_sharedram1_r)      /* Q RAM */
772   AM_RANGE(0x662000, 0x662001) AM_READ(MRA16_RAM)            /* Network adapter related, accessed in SSF2TB */
773   AM_RANGE(0x662008, 0x662009) AM_READ(MRA16_RAM)            /* Network adapter related, accessed in SSF2TB */
774   AM_RANGE(0x662020, 0x662021) AM_READ(MRA16_RAM)            /* Network adapter related, accessed in SSF2TB */
775   AM_RANGE(0x660000, 0x663fff) AM_READ(MRA16_RAM)            /* When bit 14 of 0x804030 equals 0 this space is available. Many games store highscores and other info here if available. */
776   AM_RANGE(0x664000, 0x664001) AM_READ(MRA16_RAM)            /* Unknown - Only used if 0x660000-0x663fff available (could be RAM enable?) */
777   AM_RANGE(0x708000, 0x709fff) AM_READ(cps2_objram2_r)         /* Object RAM */
778   AM_RANGE(0x70a000, 0x70bfff) AM_READ(cps2_objram2_r)         /* mirror */
779   AM_RANGE(0x70c000, 0x70dfff) AM_READ(cps2_objram2_r)         /* mirror */
780   AM_RANGE(0x70e000, 0x70ffff) AM_READ(cps2_objram2_r)         /* mirror */
781   AM_RANGE(0x800100, 0x8001ff) AM_READ(cps1_output_r)         /* Output ports mirror (sfa) */
782   AM_RANGE(0x804000, 0x804001) AM_READ(input_port_0_word_r)      /* IN0 */
783   AM_RANGE(0x804010, 0x804011) AM_READ(input_port_1_word_r)      /* IN1 */
784   AM_RANGE(0x804020, 0x804021) AM_READ(cps2_eeprom_port_r)      /* IN2 + EEPROM */
785   AM_RANGE(0x804030, 0x804031) AM_READ(cps2_qsound_volume_r)      /* Master volume. Also when bit 14=0 addon memory is present, when bit 15=0 network adapter present. */
786   AM_RANGE(0x8040b0, 0x8040b3) AM_READ(kludge_r)              /* unknown (xmcotaj hangs if this is 0) */
787   AM_RANGE(0x804100, 0x8041ff) AM_READ(cps1_output_r)         /* CPS1 Output ports */
788   AM_RANGE(0x900000, 0x92ffff) AM_READ(MRA16_RAM)            /* Video RAM */
789   AM_RANGE(0xff0000, 0xffffff) AM_READ(MRA16_RAM)            /* RAM */
864   AM_RANGE(0x000000, 0x3fffff) AM_READ(MRA16_ROM)                   /* 68000 ROM */
865   AM_RANGE(0x400000, 0x40000b) AM_READ(MRA16_RAM)                   /* CPS2 object output */
866   AM_RANGE(0x618000, 0x619fff) AM_READ(qsound_sharedram1_r)         /* Q RAM */
867   AM_RANGE(0x662000, 0x662001) AM_READ(MRA16_RAM)                   /* Network adapter related, accessed in SSF2TB */
868   AM_RANGE(0x662008, 0x662009) AM_READ(MRA16_RAM)                   /* Network adapter related, accessed in SSF2TB */
869   AM_RANGE(0x662020, 0x662021) AM_READ(MRA16_RAM)                   /* Network adapter related, accessed in SSF2TB */
870   AM_RANGE(0x660000, 0x663fff) AM_READ(MRA16_RAM)                   /* When bit 14 of 0x804030 equals 0 this space is available. Many games store highscores and other info here if available. */
871   AM_RANGE(0x664000, 0x664001) AM_READ(MRA16_RAM)                   /* Unknown - Only used if 0x660000-0x663fff available (could be RAM enable?) */
872   AM_RANGE(0x708000, 0x709fff) AM_READ(cps2_objram2_r)              /* Object RAM */
873   AM_RANGE(0x70a000, 0x70bfff) AM_READ(cps2_objram2_r)              /* mirror */
874   AM_RANGE(0x70c000, 0x70dfff) AM_READ(cps2_objram2_r)              /* mirror */
875   AM_RANGE(0x70e000, 0x70ffff) AM_READ(cps2_objram2_r)              /* mirror */
876   AM_RANGE(0x800100, 0x8001ff) AM_READ(cps1_output_r)               /* Output ports mirror (sfa) */
877   AM_RANGE(0x804000, 0x804001) AM_READ_PORT("IN0")                  /* IN0 */
878   AM_RANGE(0x804010, 0x804011) AM_READ_PORT("IN1")                  /* IN1 */
879   AM_RANGE(0x804020, 0x804021) AM_READ_PORT("IN2")                  /* IN2 + EEPROM */
880   AM_RANGE(0x804030, 0x804031) AM_READ(cps2_qsound_volume_r)        /* Master volume. Also when bit 14=0 addon memory is present, when bit 15=0 network adapter present. */
881   AM_RANGE(0x8040b0, 0x8040b3) AM_READ(kludge_r)                    /* unknown (xmcotaj hangs if this is 0) */
882   AM_RANGE(0x804100, 0x8041ff) AM_READ(cps1_output_r)               /* CPS1 Output ports */
883   AM_RANGE(0x900000, 0x92ffff) AM_READ(MRA16_RAM)                   /* Video RAM */
884   AM_RANGE(0xff0000, 0xffffff) AM_READ(MRA16_RAM)                   /* RAM */
790885ADDRESS_MAP_END
791886
792887static ADDRESS_MAP_START( cps2_writemem, ADDRESS_SPACE_PROGRAM, 16 )
793   AM_RANGE(0x000000, 0x3fffff) AM_WRITE(MWA16_ROM)            /* ROM */
794   AM_RANGE(0x400000, 0x40000b) AM_WRITE(MWA16_RAM) AM_BASE(&cps2_output) AM_SIZE(&cps2_output_size)   /* CPS2 output */
795   AM_RANGE(0x618000, 0x619fff) AM_WRITE(qsound_sharedram1_w)      /* Q RAM */
796   AM_RANGE(0x662000, 0x662001) AM_WRITE(MWA16_RAM)            /* Network adapter related, accessed in SSF2TB */
797   AM_RANGE(0x662008, 0x662009) AM_WRITE(MWA16_RAM)            /* Network adapter related, accessed in SSF2TB (not sure if this port is write only yet)*/
798   AM_RANGE(0x662020, 0x662021) AM_WRITE(MWA16_RAM)            /* Network adapter related, accessed in SSF2TB */
799   AM_RANGE(0x660000, 0x663fff) AM_WRITE(MWA16_RAM)            /* When bit 14 of 0x804030 equals 0 this space is available. Many games store highscores and other info here if available. */
800   AM_RANGE(0x664000, 0x664001) AM_WRITE(MWA16_RAM)            /* Unknown - Only used if 0x660000-0x663fff available (could be RAM enable?) */
801   AM_RANGE(0x700000, 0x701fff) AM_WRITE(cps2_objram1_w) AM_BASE(&cps2_objram1)   /* Object RAM, no game seems to use it directly */
802   AM_RANGE(0x708000, 0x709fff) AM_WRITE(cps2_objram2_w) AM_BASE(&cps2_objram2)   /* Object RAM */
803   AM_RANGE(0x70a000, 0x70bfff) AM_WRITE(cps2_objram2_w)         /* mirror */
804   AM_RANGE(0x70c000, 0x70dfff) AM_WRITE(cps2_objram2_w)         /* mirror */
805   AM_RANGE(0x70e000, 0x70ffff) AM_WRITE(cps2_objram2_w)         /* mirror */
806   AM_RANGE(0x800100, 0x8001ff) AM_WRITE(cps1_output_w)         /* Output ports mirror (sfa) */
807   AM_RANGE(0x804040, 0x804041) AM_WRITE(cps2_eeprom_port_w)      /* EEPROM */
808   AM_RANGE(0x8040a0, 0x8040a1) AM_WRITE(MWA16_NOP)            /* Unknown (reset once on startup) */
809   AM_RANGE(0x8040e0, 0x8040e1) AM_WRITE(cps2_objram_bank_w)      /* bit 0 = Object ram bank swap */
810   AM_RANGE(0x804100, 0x8041ff) AM_WRITE(cps1_output_w) AM_BASE(&cps1_output) AM_SIZE(&cps1_output_size)  /* Output ports */
888   AM_RANGE(0x000000, 0x3fffff) AM_WRITE(MWA16_ROM)                  /* ROM */
889   AM_RANGE(0x400000, 0x40000b) AM_WRITE(MWA16_RAM) AM_BASE(&cps2_output) AM_SIZE(&cps2_output_size)    /* CPS2 output */
890   AM_RANGE(0x618000, 0x619fff) AM_WRITE(qsound_sharedram1_w)        /* Q RAM */
891   AM_RANGE(0x662000, 0x662001) AM_WRITE(MWA16_RAM)                  /* Network adapter related, accessed in SSF2TB */
892   AM_RANGE(0x662008, 0x662009) AM_WRITE(MWA16_RAM)                  /* Network adapter related, accessed in SSF2TB (not sure if this port is write only yet)*/
893   AM_RANGE(0x662020, 0x662021) AM_WRITE(MWA16_RAM)                  /* Network adapter related, accessed in SSF2TB */
894   AM_RANGE(0x660000, 0x663fff) AM_WRITE(MWA16_RAM)                  /* When bit 14 of 0x804030 equals 0 this space is available. Many games store highscores and other info here if available. */
895   AM_RANGE(0x664000, 0x664001) AM_WRITE(MWA16_RAM)                  /* Unknown - Only used if 0x660000-0x663fff available (could be RAM enable?) */
896   AM_RANGE(0x700000, 0x701fff) AM_WRITE(cps2_objram1_w) AM_BASE(&cps2_objram1)     /* Object RAM, no game seems to use it directly */
897   AM_RANGE(0x708000, 0x709fff) AM_WRITE(cps2_objram2_w) AM_BASE(&cps2_objram2)     /* Object RAM */
898   AM_RANGE(0x70a000, 0x70bfff) AM_WRITE(cps2_objram2_w)             /* mirror */
899   AM_RANGE(0x70c000, 0x70dfff) AM_WRITE(cps2_objram2_w)             /* mirror */
900   AM_RANGE(0x70e000, 0x70ffff) AM_WRITE(cps2_objram2_w)             /* mirror */
901   AM_RANGE(0x800100, 0x8001ff) AM_WRITE(cps1_output_w)              /* Output ports mirror (sfa) */
902   AM_RANGE(0x804040, 0x804041) AM_WRITE(cps2_eeprom_port_w)         /* EEPROM */
903   AM_RANGE(0x8040a0, 0x8040a1) AM_WRITE(MWA16_NOP)                  /* Unknown (reset once on startup) */
904   AM_RANGE(0x8040e0, 0x8040e1) AM_WRITE(cps2_objram_bank_w)         /* bit 0 = Object ram bank swap */
905   AM_RANGE(0x804100, 0x8041ff) AM_WRITE(cps1_output_w) AM_BASE(&cps1_output) AM_SIZE(&cps1_output_size)     /* Output ports */
811906   AM_RANGE(0x900000, 0x92ffff) AM_WRITE(cps1_gfxram_w) AM_BASE(&cps1_gfxram) AM_SIZE(&cps1_gfxram_size)
812   AM_RANGE(0xff0000, 0xffffff) AM_WRITE(MWA16_RAM)            /* RAM */
907   AM_RANGE(0xff0000, 0xffffff) AM_WRITE(MWA16_RAM)                  /* RAM */
813908ADDRESS_MAP_END
814909
815910
911/*************************************
912 *
913 *  Generic port definitions
914 *
915 *************************************/
816916
817
818static INPUT_PORTS_START( 19xx )
819    PORT_START      /* IN0 (0x00) */
917static INPUT_PORTS_START( cps2 )
918    PORT_START_TAG("IN0")      /* IN0 (0x00) */
820919    PORT_BIT( 0x0001, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_8WAY PORT_PLAYER(1)
821920    PORT_BIT( 0x0002, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_8WAY PORT_PLAYER(1)
822921    PORT_BIT( 0x0004, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_8WAY PORT_PLAYER(1)
823922    PORT_BIT( 0x0008, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_8WAY PORT_PLAYER(1)
824923    PORT_BIT( 0x0010, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(1)
825924    PORT_BIT( 0x0020, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_PLAYER(1)
826    PORT_BIT( 0x0040, IP_ACTIVE_LOW, IPT_UNKNOWN )
827    PORT_BIT( 0x0080, IP_ACTIVE_LOW, IPT_UNKNOWN )
828    PORT_BIT( 0x0100, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_8WAY PORT_PLAYER(2)
829    PORT_BIT( 0x0200, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_8WAY PORT_PLAYER(2)
830    PORT_BIT( 0x0400, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_8WAY PORT_PLAYER(2)
831    PORT_BIT( 0x0800, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_8WAY PORT_PLAYER(2)
832    PORT_BIT( 0x1000, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(2)
833    PORT_BIT( 0x2000, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_PLAYER(2)
834    PORT_BIT( 0x4000, IP_ACTIVE_LOW, IPT_UNKNOWN )
835    PORT_BIT( 0x8000, IP_ACTIVE_LOW, IPT_UNKNOWN )
836
837    PORT_START      /* IN1 (0x10) */
838    PORT_BIT( 0x0001, IP_ACTIVE_LOW, IPT_UNKNOWN )
839    PORT_BIT( 0x0002, IP_ACTIVE_LOW, IPT_UNKNOWN )
840    PORT_BIT( 0x0004, IP_ACTIVE_LOW, IPT_UNKNOWN )
841    PORT_BIT( 0x0008, IP_ACTIVE_LOW, IPT_UNKNOWN )
842    PORT_BIT( 0x0010, IP_ACTIVE_LOW, IPT_UNKNOWN )
843    PORT_BIT( 0x0020, IP_ACTIVE_LOW, IPT_UNKNOWN )
844    PORT_BIT( 0x0040, IP_ACTIVE_LOW, IPT_UNKNOWN )
845    PORT_BIT( 0x0080, IP_ACTIVE_LOW, IPT_UNKNOWN )
846    PORT_BIT( 0xff00, IP_ACTIVE_LOW, IPT_UNKNOWN )
847
848    PORT_START      /* IN2 (0x20) */
849    PORT_BIT( 0x0001, IP_ACTIVE_LOW, IPT_SPECIAL )   /* EEPROM bit */
850   PORT_BIT(0x0002, IP_ACTIVE_LOW, IPT_SERVICE ) PORT_NAME( DEF_STR( Service_Mode )) PORT_CODE(KEYCODE_F2)
851    PORT_BIT( 0x0004, IP_ACTIVE_LOW, IPT_SERVICE1 )
852    PORT_BIT( 0x00f8, IP_ACTIVE_LOW, IPT_UNKNOWN )
853    PORT_BIT( 0x0100, IP_ACTIVE_LOW, IPT_START1 )
854    PORT_BIT( 0x0200, IP_ACTIVE_LOW, IPT_START2 )
855    PORT_BIT( 0x0400, IP_ACTIVE_LOW, IPT_UNKNOWN )
856    PORT_BIT( 0x0800, IP_ACTIVE_LOW, IPT_UNKNOWN )
857    PORT_BIT( 0x1000, IP_ACTIVE_LOW, IPT_COIN1 )
858    PORT_BIT( 0x2000, IP_ACTIVE_LOW, IPT_COIN2 )
859    PORT_BIT( 0x4000, IP_ACTIVE_LOW, IPT_UNKNOWN )
860    PORT_BIT( 0x8000, IP_ACTIVE_LOW, IPT_UNKNOWN )
861INPUT_PORTS_END
862
863static INPUT_PORTS_START( cybots )
864    PORT_START      /* IN0 (0x00) */
865    PORT_BIT( 0x0001, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_8WAY PORT_PLAYER(1)
866    PORT_BIT( 0x0002, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_8WAY PORT_PLAYER(1)
867    PORT_BIT( 0x0004, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_8WAY PORT_PLAYER(1)
868    PORT_BIT( 0x0008, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_8WAY PORT_PLAYER(1)
869    PORT_BIT( 0x0010, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(1)
870    PORT_BIT( 0x0020, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_PLAYER(1)
871925    PORT_BIT( 0x0040, IP_ACTIVE_LOW, IPT_BUTTON3 ) PORT_PLAYER(1)
872    PORT_BIT( 0x0080, IP_ACTIVE_LOW, IPT_UNKNOWN )
873    PORT_BIT( 0x0100, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_8WAY PORT_PLAYER(2)
874    PORT_BIT( 0x0200, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_8WAY PORT_PLAYER(2)
875    PORT_BIT( 0x0400, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_8WAY PORT_PLAYER(2)
876    PORT_BIT( 0x0800, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_8WAY PORT_PLAYER(2)
877    PORT_BIT( 0x1000, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(2)
878    PORT_BIT( 0x2000, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_PLAYER(2)
879    PORT_BIT( 0x4000, IP_ACTIVE_LOW, IPT_BUTTON3 ) PORT_PLAYER(2)
880    PORT_BIT( 0x8000, IP_ACTIVE_LOW, IPT_UNKNOWN )
881
882    PORT_START      /* IN1 (0x10) */
883    PORT_BIT( 0x0001, IP_ACTIVE_LOW, IPT_BUTTON4 ) PORT_PLAYER(1)
884    PORT_BIT( 0x0002, IP_ACTIVE_LOW, IPT_UNKNOWN )
885    PORT_BIT( 0x0004, IP_ACTIVE_LOW, IPT_UNKNOWN )
886    PORT_BIT( 0x0008, IP_ACTIVE_LOW, IPT_UNKNOWN )
887    PORT_BIT( 0x0010, IP_ACTIVE_LOW, IPT_BUTTON4 ) PORT_PLAYER(2)
888    PORT_BIT( 0x0020, IP_ACTIVE_LOW, IPT_UNKNOWN )
889    PORT_BIT( 0x0040, IP_ACTIVE_LOW, IPT_UNKNOWN )
890    PORT_BIT( 0x0080, IP_ACTIVE_LOW, IPT_UNKNOWN )
891    PORT_BIT( 0xff00, IP_ACTIVE_LOW, IPT_UNKNOWN )
892
893    PORT_START      /* IN2 (0x20) */
894    PORT_BIT( 0x0001, IP_ACTIVE_LOW, IPT_SPECIAL )   /* EEPROM bit */
895   PORT_BIT(0x0002, IP_ACTIVE_LOW, IPT_SERVICE ) PORT_NAME( DEF_STR( Service_Mode )) PORT_CODE(KEYCODE_F2)
896    PORT_BIT( 0x0004, IP_ACTIVE_LOW, IPT_SERVICE1 )
897    PORT_BIT( 0x00f8, IP_ACTIVE_LOW, IPT_UNKNOWN )
898    PORT_BIT( 0x0100, IP_ACTIVE_LOW, IPT_START1 )
899    PORT_BIT( 0x0200, IP_ACTIVE_LOW, IPT_START2 )
900    PORT_BIT( 0x0400, IP_ACTIVE_LOW, IPT_UNKNOWN )
901    PORT_BIT( 0x0800, IP_ACTIVE_LOW, IPT_UNKNOWN )
902    PORT_BIT( 0x1000, IP_ACTIVE_LOW, IPT_COIN1 )
903    PORT_BIT( 0x2000, IP_ACTIVE_LOW, IPT_COIN2 )
904    PORT_BIT( 0x4000, IP_ACTIVE_LOW, IPT_UNKNOWN )
905    PORT_BIT( 0x8000, IP_ACTIVE_LOW, IPT_UNKNOWN )
906INPUT_PORTS_END
907
908static INPUT_PORTS_START( ssf2 )
909    PORT_START      /* IN0 (0x00) */
910    PORT_BIT( 0x0001, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_8WAY PORT_PLAYER(1)
911    PORT_BIT( 0x0002, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_8WAY PORT_PLAYER(1)
912    PORT_BIT( 0x0004, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_8WAY PORT_PLAYER(1)
913    PORT_BIT( 0x0008, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_8WAY PORT_PLAYER(1)
914    PORT_BIT( 0x0010, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(1)
915    PORT_BIT( 0x0020, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_PLAYER(1)
916    PORT_BIT( 0x0040, IP_ACTIVE_LOW, IPT_BUTTON3 ) PORT_PLAYER(1)
917    PORT_BIT( 0x0080, IP_ACTIVE_LOW, IPT_UNKNOWN )
918    PORT_BIT( 0x0100, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_8WAY PORT_PLAYER(2)
919    PORT_BIT( 0x0200, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_8WAY PORT_PLAYER(2)
920    PORT_BIT( 0x0400, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_8WAY PORT_PLAYER(2)
921    PORT_BIT( 0x0800, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_8WAY PORT_PLAYER(2)
922    PORT_BIT( 0x1000, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(2)
923    PORT_BIT( 0x2000, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_PLAYER(2)
924    PORT_BIT( 0x4000, IP_ACTIVE_LOW, IPT_BUTTON3 ) PORT_PLAYER(2)
925    PORT_BIT( 0x8000, IP_ACTIVE_LOW, IPT_UNKNOWN )
926
927    PORT_START      /* IN1 (0x10) */
928    PORT_BIT( 0x0001, IP_ACTIVE_LOW, IPT_BUTTON4 ) PORT_PLAYER(1)
929    PORT_BIT( 0x0002, IP_ACTIVE_LOW, IPT_BUTTON5 ) PORT_PLAYER(1)
930    PORT_BIT( 0x0004, IP_ACTIVE_LOW, IPT_BUTTON6 ) PORT_PLAYER(1)
931    PORT_BIT( 0x0008, IP_ACTIVE_LOW, IPT_UNKNOWN )
932    PORT_BIT( 0x0010, IP_ACTIVE_LOW, IPT_BUTTON4 ) PORT_PLAYER(2)
933    PORT_BIT( 0x0020, IP_ACTIVE_LOW, IPT_BUTTON5 ) PORT_PLAYER(2)
934    PORT_BIT( 0x0040, IP_ACTIVE_LOW, IPT_UNKNOWN )
935    PORT_BIT( 0x0080, IP_ACTIVE_LOW, IPT_UNKNOWN )
936    PORT_BIT( 0xff00, IP_ACTIVE_LOW, IPT_UNKNOWN )
937
938    PORT_START      /* IN2 (0x20) */
939    PORT_BIT( 0x0001, IP_ACTIVE_LOW, IPT_SPECIAL )   /* EEPROM bit */
940   PORT_BIT(0x0002, IP_ACTIVE_LOW, IPT_SERVICE ) PORT_NAME( DEF_STR( Service_Mode )) PORT_CODE(KEYCODE_F2)
941    PORT_BIT( 0x0004, IP_ACTIVE_LOW, IPT_SERVICE1 )
942    PORT_BIT( 0x00f8, IP_ACTIVE_LOW, IPT_UNKNOWN )
943    PORT_BIT( 0x0100, IP_ACTIVE_LOW, IPT_START1 )
944    PORT_BIT( 0x0200, IP_ACTIVE_LOW, IPT_START2 )
945    PORT_BIT( 0x0400, IP_ACTIVE_LOW, IPT_UNKNOWN )
946    PORT_BIT( 0x0800, IP_ACTIVE_LOW, IPT_UNKNOWN )
947    PORT_BIT( 0x1000, IP_ACTIVE_LOW, IPT_COIN1 )
948    PORT_BIT( 0x2000, IP_ACTIVE_LOW, IPT_COIN2 )
949    PORT_BIT( 0x4000, IP_ACTIVE_LOW, IPT_BUTTON6 ) PORT_PLAYER(2)
950    PORT_BIT( 0x8000, IP_ACTIVE_LOW, IPT_UNKNOWN )
951INPUT_PORTS_END
952
953static INPUT_PORTS_START( ddtod )
954    PORT_START      /* IN0 (0x00) */
955    PORT_BIT( 0x0001, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_8WAY PORT_PLAYER(1)
956    PORT_BIT( 0x0002, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_8WAY PORT_PLAYER(1)
957    PORT_BIT( 0x0004, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_8WAY PORT_PLAYER(1)
958    PORT_BIT( 0x0008, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_8WAY PORT_PLAYER(1)
959    PORT_BIT( 0x0010, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(1)
960    PORT_BIT( 0x0020, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_PLAYER(1)
961    PORT_BIT( 0x0040, IP_ACTIVE_LOW, IPT_BUTTON3 ) PORT_PLAYER(1)
962926    PORT_BIT( 0x0080, IP_ACTIVE_LOW, IPT_BUTTON4 ) PORT_PLAYER(1)
963927    PORT_BIT( 0x0100, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_8WAY PORT_PLAYER(2)
964928    PORT_BIT( 0x0200, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_8WAY PORT_PLAYER(2)
r1679r1680
969933    PORT_BIT( 0x4000, IP_ACTIVE_LOW, IPT_BUTTON3 ) PORT_PLAYER(2)
970934    PORT_BIT( 0x8000, IP_ACTIVE_LOW, IPT_BUTTON4 ) PORT_PLAYER(2)
971935
972    PORT_START      /* IN1 (0x10) */
936    PORT_START_TAG("IN1")      /* IN1 (0x10) */
973937    PORT_BIT( 0x0001, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_8WAY PORT_PLAYER(3)
974938    PORT_BIT( 0x0002, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_8WAY PORT_PLAYER(3)
975939    PORT_BIT( 0x0004, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_8WAY PORT_PLAYER(3)
r1679r1680
987951    PORT_BIT( 0x4000, IP_ACTIVE_LOW, IPT_BUTTON3 ) PORT_PLAYER(4)
988952    PORT_BIT( 0x8000, IP_ACTIVE_LOW, IPT_BUTTON4 ) PORT_PLAYER(4)
989953
990    PORT_START      /* IN2 (0x20) */
991    PORT_BIT( 0x0001, IP_ACTIVE_LOW, IPT_SPECIAL )   /* EEPROM bit */
992   PORT_BIT(0x0002, IP_ACTIVE_LOW, IPT_SERVICE ) PORT_NAME( DEF_STR( Service_Mode )) PORT_CODE(KEYCODE_F2)
954    PORT_START_TAG("IN2")      /* IN2 (0x20) */
955    PORT_BIT( 0x0001, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM(cps2_eeprom_port_r, NULL)
956   PORT_SERVICE_NO_TOGGLE( 0x0002, IP_ACTIVE_LOW )
993957    PORT_BIT( 0x0004, IP_ACTIVE_LOW, IPT_SERVICE1 )
994958    PORT_BIT( 0x00f8, IP_ACTIVE_LOW, IPT_UNKNOWN )
995959    PORT_BIT( 0x0100, IP_ACTIVE_LOW, IPT_START1 )
r1679r1680
1002966    PORT_BIT( 0x8000, IP_ACTIVE_LOW, IPT_COIN4 )
1003967INPUT_PORTS_END
1004968
1005static INPUT_PORTS_START( avsp )
1006    PORT_START      /* IN0 (0x00) */
1007    PORT_BIT( 0x0001, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_8WAY PORT_PLAYER(1)
1008    PORT_BIT( 0x0002, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_8WAY PORT_PLAYER(1)
1009    PORT_BIT( 0x0004, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_8WAY PORT_PLAYER(1)
1010    PORT_BIT( 0x0008, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_8WAY PORT_PLAYER(1)
1011    PORT_BIT( 0x0010, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(1)
1012    PORT_BIT( 0x0020, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_PLAYER(1)
1013    PORT_BIT( 0x0040, IP_ACTIVE_LOW, IPT_BUTTON3 ) PORT_PLAYER(1)
1014    PORT_BIT( 0x0080, IP_ACTIVE_LOW, IPT_UNKNOWN )
1015    PORT_BIT( 0x0100, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_8WAY PORT_PLAYER(2)
1016    PORT_BIT( 0x0200, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_8WAY PORT_PLAYER(2)
1017    PORT_BIT( 0x0400, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_8WAY PORT_PLAYER(2)
1018    PORT_BIT( 0x0800, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_8WAY PORT_PLAYER(2)
1019    PORT_BIT( 0x1000, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(2)
1020    PORT_BIT( 0x2000, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_PLAYER(2)
1021    PORT_BIT( 0x4000, IP_ACTIVE_LOW, IPT_BUTTON3 ) PORT_PLAYER(2)
1022    PORT_BIT( 0x8000, IP_ACTIVE_LOW, IPT_UNKNOWN )
969/* 4 players and 4 buttons */
970static INPUT_PORTS_START( cps2_4p4b )
971   PORT_INCLUDE(cps2)
972INPUT_PORTS_END
1023973
1024    PORT_START      /* IN1 (0x10) */
1025    PORT_BIT( 0x0001, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_8WAY PORT_PLAYER(3)
1026    PORT_BIT( 0x0002, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_8WAY PORT_PLAYER(3)
1027    PORT_BIT( 0x0004, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_8WAY PORT_PLAYER(3)
1028    PORT_BIT( 0x0008, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_8WAY PORT_PLAYER(3)
1029    PORT_BIT( 0x0010, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(3)
1030    PORT_BIT( 0x0020, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_PLAYER(3)
1031    PORT_BIT( 0x0040, IP_ACTIVE_LOW, IPT_BUTTON3 ) PORT_PLAYER(3)
1032    PORT_BIT( 0x0080, IP_ACTIVE_LOW, IPT_UNKNOWN )
1033    PORT_BIT( 0xff00, IP_ACTIVE_LOW, IPT_UNKNOWN )
974/* 4 players and 3 buttons */
975static INPUT_PORTS_START( cps2_4p3b )
976   PORT_INCLUDE(cps2_4p4b)
1034977
1035    PORT_START      /* IN2 (0x20) */
1036    PORT_BIT( 0x0001, IP_ACTIVE_LOW, IPT_SPECIAL )   /* EEPROM bit */
1037   PORT_BIT(0x0002, IP_ACTIVE_LOW, IPT_SERVICE ) PORT_NAME( DEF_STR( Service_Mode )) PORT_CODE(KEYCODE_F2)
1038    PORT_BIT( 0x0004, IP_ACTIVE_LOW, IPT_SERVICE1 )
1039    PORT_BIT( 0x00f8, IP_ACTIVE_LOW, IPT_UNKNOWN )
1040    PORT_BIT( 0x0100, IP_ACTIVE_LOW, IPT_START1 )
1041    PORT_BIT( 0x0200, IP_ACTIVE_LOW, IPT_START2 )
1042    PORT_BIT( 0x0400, IP_ACTIVE_LOW, IPT_START3 )
1043    PORT_BIT( 0x0800, IP_ACTIVE_LOW, IPT_UNKNOWN )
1044    PORT_BIT( 0x1000, IP_ACTIVE_LOW, IPT_COIN1 )
1045    PORT_BIT( 0x2000, IP_ACTIVE_LOW, IPT_COIN2 )
1046    PORT_BIT( 0x4000, IP_ACTIVE_LOW, IPT_COIN3 )
1047    PORT_BIT( 0x8000, IP_ACTIVE_LOW, IPT_UNKNOWN )
978   PORT_MODIFY("IN0")
979    PORT_BIT( 0x0080, IP_ACTIVE_LOW, IPT_UNUSED )           /* BUTTON4 PORT_PLAYER(1) */
980    PORT_BIT( 0x8000, IP_ACTIVE_LOW, IPT_UNUSED )           /* BUTTON4 PORT_PLAYER(2) */
981
982   PORT_MODIFY("IN1")
983    PORT_BIT( 0x0080, IP_ACTIVE_LOW, IPT_UNUSED )           /* BUTTON4 PORT_PLAYER(3) */
984    PORT_BIT( 0x8000, IP_ACTIVE_LOW, IPT_UNUSED )           /* BUTTON4 PORT_PLAYER(4) */
1048985INPUT_PORTS_END
1049986
1050static INPUT_PORTS_START( qndream )
1051    PORT_START      /* IN0 (0x00) */
1052    PORT_BIT( 0x0001, IP_ACTIVE_LOW, IPT_BUTTON4 ) PORT_PLAYER(1)
1053    PORT_BIT( 0x0002, IP_ACTIVE_LOW, IPT_BUTTON3 ) PORT_PLAYER(1)
1054    PORT_BIT( 0x0004, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_PLAYER(1)
1055    PORT_BIT( 0x0008, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(1)
1056    PORT_BIT( 0x0010, IP_ACTIVE_LOW, IPT_UNKNOWN )
1057    PORT_BIT( 0x0020, IP_ACTIVE_LOW, IPT_UNKNOWN )
1058    PORT_BIT( 0x0040, IP_ACTIVE_LOW, IPT_UNKNOWN )
1059    PORT_BIT( 0x0080, IP_ACTIVE_LOW, IPT_UNKNOWN )
1060    PORT_BIT( 0x0100, IP_ACTIVE_LOW, IPT_BUTTON4 ) PORT_PLAYER(2)
1061    PORT_BIT( 0x0200, IP_ACTIVE_LOW, IPT_BUTTON3 ) PORT_PLAYER(2)
1062    PORT_BIT( 0x0400, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_PLAYER(2)
1063    PORT_BIT( 0x0800, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(2)
1064    PORT_BIT( 0x1000, IP_ACTIVE_LOW, IPT_UNKNOWN )
1065    PORT_BIT( 0x2000, IP_ACTIVE_LOW, IPT_UNKNOWN )
1066    PORT_BIT( 0x4000, IP_ACTIVE_LOW, IPT_UNKNOWN )
1067    PORT_BIT( 0x8000, IP_ACTIVE_LOW, IPT_UNKNOWN )
987/* 4 players and 2 buttons */
988static INPUT_PORTS_START( cps2_4p2b )
989   PORT_INCLUDE(cps2_4p3b)
1068990
1069    PORT_START      /* IN1 (0x10) */
1070    PORT_BIT( 0xff00, IP_ACTIVE_LOW, IPT_UNKNOWN )
991   PORT_MODIFY("IN0")
992    PORT_BIT( 0x0040, IP_ACTIVE_LOW, IPT_UNUSED )           /* BUTTON3 PORT_PLAYER(1) */
993    PORT_BIT( 0x4000, IP_ACTIVE_LOW, IPT_UNUSED )           /* BUTTON3 PORT_PLAYER(2) */
1071994
1072    PORT_START      /* IN2 (0x20) */
1073    PORT_BIT( 0x0001, IP_ACTIVE_LOW, IPT_SPECIAL )   /* EEPROM bit */
1074   PORT_BIT(0x0002, IP_ACTIVE_LOW, IPT_SERVICE ) PORT_NAME( DEF_STR( Service_Mode )) PORT_CODE(KEYCODE_F2)
1075    PORT_BIT( 0x0004, IP_ACTIVE_LOW, IPT_SERVICE1 )
1076    PORT_BIT( 0x00f8, IP_ACTIVE_LOW, IPT_UNKNOWN )
1077    PORT_BIT( 0x0100, IP_ACTIVE_LOW, IPT_START1 )
1078    PORT_BIT( 0x0200, IP_ACTIVE_LOW, IPT_START2 )
1079    PORT_BIT( 0x0400, IP_ACTIVE_LOW, IPT_UNKNOWN )
1080    PORT_BIT( 0x0800, IP_ACTIVE_LOW, IPT_UNKNOWN )
1081    PORT_BIT( 0x1000, IP_ACTIVE_LOW, IPT_COIN1 )
1082    PORT_BIT( 0x2000, IP_ACTIVE_LOW, IPT_COIN2 )
1083    PORT_BIT( 0x4000, IP_ACTIVE_LOW, IPT_UNKNOWN )
1084    PORT_BIT( 0x8000, IP_ACTIVE_LOW, IPT_UNKNOWN )
995   PORT_MODIFY("IN1")
996    PORT_BIT( 0x0040, IP_ACTIVE_LOW, IPT_UNUSED )           /* BUTTON3 PORT_PLAYER(3) */
997    PORT_BIT( 0x4000, IP_ACTIVE_LOW, IPT_UNUSED )           /* BUTTON3 PORT_PLAYER(4) */
1085998INPUT_PORTS_END
1086999
1087static INPUT_PORTS_START( batcir )
1088    PORT_START      /* IN0 (0x00) */
1089    PORT_BIT( 0x0001, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_8WAY PORT_PLAYER(1)
1090    PORT_BIT( 0x0002, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_8WAY PORT_PLAYER(1)
1091    PORT_BIT( 0x0004, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_8WAY PORT_PLAYER(1)
1092    PORT_BIT( 0x0008, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_8WAY PORT_PLAYER(1)
1093    PORT_BIT( 0x0010, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(1)
1094    PORT_BIT( 0x0020, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_PLAYER(1)
1095    PORT_BIT( 0x0040, IP_ACTIVE_LOW, IPT_UNKNOWN )
1096    PORT_BIT( 0x0080, IP_ACTIVE_LOW, IPT_UNKNOWN )
1097    PORT_BIT( 0x0100, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_8WAY PORT_PLAYER(2)
1098    PORT_BIT( 0x0200, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_8WAY PORT_PLAYER(2)
1099    PORT_BIT( 0x0400, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_8WAY PORT_PLAYER(2)
1100    PORT_BIT( 0x0800, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_8WAY PORT_PLAYER(2)
1101    PORT_BIT( 0x1000, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(2)
1102    PORT_BIT( 0x2000, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_PLAYER(2)
1103    PORT_BIT( 0x4000, IP_ACTIVE_LOW, IPT_UNKNOWN )
1104    PORT_BIT( 0x8000, IP_ACTIVE_LOW, IPT_UNKNOWN )
1000/* 3 players and 4 buttons */
1001static INPUT_PORTS_START( cps2_3p4b )
1002   PORT_INCLUDE(cps2_4p4b)
11051003
1106    PORT_START      /* IN1 (0x10) */
1107    PORT_BIT( 0x0001, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_8WAY PORT_PLAYER(3)
1108    PORT_BIT( 0x0002, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_8WAY PORT_PLAYER(3)
1109    PORT_BIT( 0x0004, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_8WAY PORT_PLAYER(3)
1110    PORT_BIT( 0x0008, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_8WAY PORT_PLAYER(3)
1111    PORT_BIT( 0x0010, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(3)
1112    PORT_BIT( 0x0020, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_PLAYER(3)
1113    PORT_BIT( 0x0040, IP_ACTIVE_LOW, IPT_UNKNOWN )
1114    PORT_BIT( 0x0080, IP_ACTIVE_LOW, IPT_UNKNOWN )
1115    PORT_BIT( 0x0100, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_8WAY PORT_PLAYER(4)
1116    PORT_BIT( 0x0200, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_8WAY PORT_PLAYER(4)
1117    PORT_BIT( 0x0400, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_8WAY PORT_PLAYER(4)
1118    PORT_BIT( 0x0800, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_8WAY PORT_PLAYER(4)
1119    PORT_BIT( 0x1000, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(4)
1120    PORT_BIT( 0x2000, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_PLAYER(4)
1121    PORT_BIT( 0x4000, IP_ACTIVE_LOW, IPT_UNKNOWN )
1122    PORT_BIT( 0x8000, IP_ACTIVE_LOW, IPT_UNKNOWN )
1004   PORT_MODIFY("IN1")
1005    PORT_BIT( 0xff00, IP_ACTIVE_LOW, IPT_UNUSED )           /* PORT_PLAYER(4) inputs */
11231006
1124    PORT_START      /* IN2 (0x20) */
1125    PORT_BIT( 0x0001, IP_ACTIVE_LOW, IPT_SPECIAL )   /* EEPROM bit */
1126   PORT_BIT(0x0002, IP_ACTIVE_LOW, IPT_SERVICE ) PORT_NAME( DEF_STR( Service_Mode )) PORT_CODE(KEYCODE_F2)
1127    PORT_BIT( 0x0004, IP_ACTIVE_LOW, IPT_SERVICE1 )
1128    PORT_BIT( 0x00f8, IP_ACTIVE_LOW, IPT_UNKNOWN )
1129    PORT_BIT( 0x0100, IP_ACTIVE_LOW, IPT_START1 )
1130    PORT_BIT( 0x0200, IP_ACTIVE_LOW, IPT_START2 )
1131    PORT_BIT( 0x0400, IP_ACTIVE_LOW, IPT_START3 )
1132    PORT_BIT( 0x0800, IP_ACTIVE_LOW, IPT_START4 )
1133    PORT_BIT( 0x1000, IP_ACTIVE_LOW, IPT_COIN1 )
1134    PORT_BIT( 0x2000, IP_ACTIVE_LOW, IPT_COIN2 )
1135    PORT_BIT( 0x4000, IP_ACTIVE_LOW, IPT_COIN3 )
1136    PORT_BIT( 0x8000, IP_ACTIVE_LOW, IPT_COIN4 )
1007   PORT_MODIFY("IN2")
1008    PORT_BIT( 0x0800, IP_ACTIVE_LOW, IPT_UNUSED )           /* START4 */
1009    PORT_BIT( 0x8000, IP_ACTIVE_LOW, IPT_UNUSED )           /* COIN4 */
11371010INPUT_PORTS_END
11381011
1139static INPUT_PORTS_START( sgemf )
1140    PORT_START      /* IN0 (0x00) */
1141    PORT_BIT( 0x0001, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_8WAY PORT_PLAYER(1)
1142    PORT_BIT( 0x0002, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_8WAY PORT_PLAYER(1)
1143    PORT_BIT( 0x0004, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_8WAY PORT_PLAYER(1)
1144    PORT_BIT( 0x0008, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_8WAY PORT_PLAYER(1)
1145    PORT_BIT( 0x0010, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(1)
1146    PORT_BIT( 0x0020, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_PLAYER(1)
1147    PORT_BIT( 0x0040, IP_ACTIVE_LOW, IPT_BUTTON3 ) PORT_PLAYER(1)
1148    PORT_BIT( 0x0080, IP_ACTIVE_LOW, IPT_UNKNOWN )
1149    PORT_BIT( 0x0100, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_8WAY PORT_PLAYER(2)
1150    PORT_BIT( 0x0200, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_8WAY PORT_PLAYER(2)
1151    PORT_BIT( 0x0400, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_8WAY PORT_PLAYER(2)
1152    PORT_BIT( 0x0800, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_8WAY PORT_PLAYER(2)
1153    PORT_BIT( 0x1000, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(2)
1154    PORT_BIT( 0x2000, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_PLAYER(2)
1155    PORT_BIT( 0x4000, IP_ACTIVE_LOW, IPT_BUTTON3 ) PORT_PLAYER(2)
1156    PORT_BIT( 0x8000, IP_ACTIVE_LOW, IPT_UNKNOWN )
1012/* 3 players and 3 buttons */
1013static INPUT_PORTS_START( cps2_3p3b )
1014   PORT_INCLUDE(cps2_3p4b)
11571015
1158    PORT_START      /* IN1 (0x10) */
1159    PORT_BIT( 0x0001, IP_ACTIVE_LOW, IPT_UNKNOWN )
1160    PORT_BIT( 0x0002, IP_ACTIVE_LOW, IPT_UNKNOWN )
1161    PORT_BIT( 0x0004, IP_ACTIVE_LOW, IPT_UNKNOWN )
1162    PORT_BIT( 0x0008, IP_ACTIVE_LOW, IPT_UNKNOWN )
1163    PORT_BIT( 0x0010, IP_ACTIVE_LOW, IPT_UNKNOWN )
1164    PORT_BIT( 0x0020, IP_ACTIVE_LOW, IPT_UNKNOWN )
1165    PORT_BIT( 0x0040, IP_ACTIVE_LOW, IPT_UNKNOWN )
1166    PORT_BIT( 0x0080, IP_ACTIVE_LOW, IPT_UNKNOWN )
1167    PORT_BIT( 0xff00, IP_ACTIVE_LOW, IPT_UNKNOWN )
1016   PORT_MODIFY("IN0")
1017    PORT_BIT( 0x0080, IP_ACTIVE_LOW, IPT_UNUSED )           /* BUTTON4 PORT_PLAYER(1) */
1018    PORT_BIT( 0x8000, IP_ACTIVE_LOW, IPT_UNUSED )           /* BUTTON4 PORT_PLAYER(2) */
11681019
1169    PORT_START      /* IN2 (0x20) */
1170    PORT_BIT( 0x0001, IP_ACTIVE_LOW, IPT_SPECIAL )   /* EEPROM bit */
1171   PORT_BIT(0x0002, IP_ACTIVE_LOW, IPT_SERVICE ) PORT_NAME( DEF_STR( Service_Mode )) PORT_CODE(KEYCODE_F2)
1172    PORT_BIT( 0x0004, IP_ACTIVE_LOW, IPT_SERVICE1 )
1173    PORT_BIT( 0x00f8, IP_ACTIVE_LOW, IPT_UNKNOWN )
1174    PORT_BIT( 0x0100, IP_ACTIVE_LOW, IPT_START1 )
1175    PORT_BIT( 0x0200, IP_ACTIVE_LOW, IPT_START2 )
1176    PORT_BIT( 0x0400, IP_ACTIVE_LOW, IPT_UNKNOWN )
1177    PORT_BIT( 0x0800, IP_ACTIVE_LOW, IPT_UNKNOWN )
1178    PORT_BIT( 0x1000, IP_ACTIVE_LOW, IPT_COIN1 )
1179    PORT_BIT( 0x2000, IP_ACTIVE_LOW, IPT_COIN2 )
1180    PORT_BIT( 0x4000, IP_ACTIVE_LOW, IPT_UNKNOWN )
1181    PORT_BIT( 0x8000, IP_ACTIVE_LOW, IPT_UNKNOWN )
1020   PORT_MODIFY("IN1")
1021    PORT_BIT( 0x0080, IP_ACTIVE_LOW, IPT_UNUSED )           /* BUTTON4 PORT_PLAYER(3) */
11821022INPUT_PORTS_END
11831023
1184static INPUT_PORTS_START( cps2 )
1185    PORT_START      /* IN0 (0x00) */
1186    PORT_BIT( 0x0001, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_8WAY PORT_PLAYER(1)
1187    PORT_BIT( 0x0002, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_8WAY PORT_PLAYER(1)
1188    PORT_BIT( 0x0004, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_8WAY PORT_PLAYER(1)
1189    PORT_BIT( 0x0008, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_8WAY PORT_PLAYER(1)
1190    PORT_BIT( 0x0010, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(1)
1191    PORT_BIT( 0x0020, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_PLAYER(1)
1192    PORT_BIT( 0x0040, IP_ACTIVE_LOW, IPT_BUTTON3 ) PORT_PLAYER(1)
1193    PORT_BIT( 0x0080, IP_ACTIVE_LOW, IPT_UNKNOWN )
1194    PORT_BIT( 0x0100, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_8WAY PORT_PLAYER(2)
1195    PORT_BIT( 0x0200, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_8WAY PORT_PLAYER(2)
1196    PORT_BIT( 0x0400, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_8WAY PORT_PLAYER(2)
1197    PORT_BIT( 0x0800, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_8WAY PORT_PLAYER(2)
1198    PORT_BIT( 0x1000, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(2)
1199    PORT_BIT( 0x2000, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_PLAYER(2)
1200    PORT_BIT( 0x4000, IP_ACTIVE_LOW, IPT_BUTTON3 ) PORT_PLAYER(2)
1201    PORT_BIT( 0x8000, IP_ACTIVE_LOW, IPT_UNKNOWN )
1024/* 3 players and 2 buttons */
1025static INPUT_PORTS_START( cps2_3p2b )
1026   PORT_INCLUDE(cps2_3p3b)
12021027
1203    PORT_START      /* IN1 (0x10) */
1028   PORT_MODIFY("IN0")
1029    PORT_BIT( 0x0040, IP_ACTIVE_LOW, IPT_UNUSED )           /* BUTTON3 PORT_PLAYER(1) */
1030    PORT_BIT( 0x4000, IP_ACTIVE_LOW, IPT_UNUSED )           /* BUTTON3 PORT_PLAYER(2) */
1031
1032   PORT_MODIFY("IN1")
1033    PORT_BIT( 0x0040, IP_ACTIVE_LOW, IPT_UNUSED )           /* BUTTON3 PORT_PLAYER(3) */
1034INPUT_PORTS_END
1035
1036/* 2 players and 4 buttons */
1037static INPUT_PORTS_START( cps2_2p4b )
1038   PORT_INCLUDE(cps2_3p4b)
1039
1040   PORT_MODIFY("IN1")
1041    PORT_BIT( 0x00ff, IP_ACTIVE_LOW, IPT_UNUSED )           /* PORT_PLAYER(3) inputs */
1042
1043   PORT_MODIFY("IN2")
1044    PORT_BIT( 0x0400, IP_ACTIVE_LOW, IPT_UNUSED )           /* START3 */
1045    PORT_BIT( 0x4000, IP_ACTIVE_LOW, IPT_UNUSED )           /* COIN3 */
1046INPUT_PORTS_END
1047
1048/* 2 players and 3 buttons */
1049static INPUT_PORTS_START( cps2_2p3b )
1050   PORT_INCLUDE(cps2_2p4b)
1051
1052   PORT_MODIFY("IN0")
1053    PORT_BIT( 0x0080, IP_ACTIVE_LOW, IPT_UNUSED )           /* BUTTON4 PORT_PLAYER(1) */
1054    PORT_BIT( 0x8000, IP_ACTIVE_LOW, IPT_UNUSED )           /* BUTTON4 PORT_PLAYER(2) */
1055INPUT_PORTS_END
1056
1057/* 2 players and 2 buttons */
1058static INPUT_PORTS_START( cps2_2p2b )
1059   PORT_INCLUDE(cps2_2p3b)
1060
1061   PORT_MODIFY("IN0")
1062    PORT_BIT( 0x0040, IP_ACTIVE_LOW, IPT_UNUSED )           /* BUTTON3 PORT_PLAYER(1) */
1063    PORT_BIT( 0x4000, IP_ACTIVE_LOW, IPT_UNUSED )           /* BUTTON3 PORT_PLAYER(2) */
1064INPUT_PORTS_END
1065
1066/* 2 players and 1 button */
1067static INPUT_PORTS_START( cps2_2p1b )
1068   PORT_INCLUDE(cps2_2p2b)
1069
1070   PORT_MODIFY("IN0")
1071    PORT_BIT( 0x0020, IP_ACTIVE_LOW, IPT_UNUSED )           /* BUTTON2 PORT_PLAYER(1) */
1072    PORT_BIT( 0x2000, IP_ACTIVE_LOW, IPT_UNUSED )           /* BUTTON2 PORT_PLAYER(2) */
1073INPUT_PORTS_END
1074
1075/* 2 players and 6 buttons (2 rows of 3 buttons) */
1076static INPUT_PORTS_START( cps2_2p6b )
1077   PORT_INCLUDE(cps2_2p3b)
1078
1079   PORT_MODIFY("IN1")
12041080    PORT_BIT( 0x0001, IP_ACTIVE_LOW, IPT_BUTTON4 ) PORT_PLAYER(1)
12051081    PORT_BIT( 0x0002, IP_ACTIVE_LOW, IPT_BUTTON5 ) PORT_PLAYER(1)
12061082    PORT_BIT( 0x0004, IP_ACTIVE_LOW, IPT_BUTTON6 ) PORT_PLAYER(1)
1207    PORT_BIT( 0x0008, IP_ACTIVE_LOW, IPT_UNKNOWN )
12081083    PORT_BIT( 0x0010, IP_ACTIVE_LOW, IPT_BUTTON4 ) PORT_PLAYER(2)
12091084    PORT_BIT( 0x0020, IP_ACTIVE_LOW, IPT_BUTTON5 ) PORT_PLAYER(2)
1210    PORT_BIT( 0x0040, IP_ACTIVE_LOW, IPT_UNKNOWN )
1211    PORT_BIT( 0x0080, IP_ACTIVE_LOW, IPT_UNKNOWN )
1212    PORT_BIT( 0xff00, IP_ACTIVE_LOW, IPT_UNKNOWN )
12131085
1214    PORT_START      /* IN2 (0x20) */
1215    PORT_BIT( 0x0001, IP_ACTIVE_LOW, IPT_SPECIAL )   /* EEPROM bit */
1216   PORT_BIT(0x0002, IP_ACTIVE_LOW, IPT_SERVICE ) PORT_NAME( DEF_STR( Service_Mode )) PORT_CODE(KEYCODE_F2)
1217    PORT_BIT( 0x0004, IP_ACTIVE_LOW, IPT_SERVICE1 )
1218    PORT_BIT( 0x00f8, IP_ACTIVE_LOW, IPT_UNKNOWN )
1219    PORT_BIT( 0x0100, IP_ACTIVE_LOW, IPT_START1 )
1220    PORT_BIT( 0x0200, IP_ACTIVE_LOW, IPT_START2 )
1221    PORT_BIT( 0x0400, IP_ACTIVE_LOW, IPT_UNKNOWN )
1222    PORT_BIT( 0x0800, IP_ACTIVE_LOW, IPT_UNKNOWN )
1223    PORT_BIT( 0x1000, IP_ACTIVE_LOW, IPT_COIN1 )
1224    PORT_BIT( 0x2000, IP_ACTIVE_LOW, IPT_COIN2 )
1086   PORT_MODIFY("IN2")
12251087    PORT_BIT( 0x4000, IP_ACTIVE_LOW, IPT_BUTTON6 ) PORT_PLAYER(2)
1226    PORT_BIT( 0x8000, IP_ACTIVE_LOW, IPT_UNKNOWN )
12271088INPUT_PORTS_END
12281089
1090/* 1 player and 4 buttons */
1091static INPUT_PORTS_START( cps2_1p4b )
1092   PORT_INCLUDE(cps2_2p4b)
12291093
1230static INPUT_PORTS_START( puzloop2 )
1231    PORT_START      /* IN0 (0x00) */
1232    PORT_BIT( 0x0001, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_8WAY PORT_PLAYER(1)
1233    PORT_BIT( 0x0002, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_8WAY PORT_PLAYER(1)
1234    PORT_BIT( 0x0004, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_8WAY PORT_PLAYER(1)
1235    PORT_BIT( 0x0008, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_8WAY PORT_PLAYER(1)
1236    PORT_BIT( 0x0010, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(1)
1237    PORT_BIT( 0x0020, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_PLAYER(1)
1238    PORT_BIT( 0x0040, IP_ACTIVE_LOW, IPT_BUTTON3 ) PORT_PLAYER(1)
1239    PORT_BIT( 0x0080, IP_ACTIVE_LOW, IPT_BUTTON4 ) PORT_PLAYER(1)
1240    PORT_BIT( 0x0100, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_8WAY PORT_PLAYER(2)
1241    PORT_BIT( 0x0200, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_8WAY PORT_PLAYER(2)
1242    PORT_BIT( 0x0400, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_8WAY PORT_PLAYER(2)
1243    PORT_BIT( 0x0800, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_8WAY PORT_PLAYER(2)
1244    PORT_BIT( 0x1000, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(2)
1245    PORT_BIT( 0x2000, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_PLAYER(2)
1246    PORT_BIT( 0x4000, IP_ACTIVE_LOW, IPT_BUTTON3 ) PORT_PLAYER(2)
1247    PORT_BIT( 0x8000, IP_ACTIVE_LOW, IPT_BUTTON4 ) PORT_PLAYER(2)
1094   PORT_MODIFY("IN0")
1095    PORT_BIT( 0xff00, IP_ACTIVE_LOW, IPT_UNUSED )           /* PORT_PLAYER(2) inputs */
12481096
1249    PORT_START      /* IN1 (0x10) */
1250    PORT_BIT( 0x0001, IP_ACTIVE_LOW, IPT_UNKNOWN )
1251    PORT_BIT( 0x0002, IP_ACTIVE_LOW, IPT_UNKNOWN )
1252    PORT_BIT( 0x0004, IP_ACTIVE_LOW, IPT_UNKNOWN )
1253    PORT_BIT( 0x0008, IP_ACTIVE_LOW, IPT_UNKNOWN )
1254    PORT_BIT( 0x0010, IP_ACTIVE_LOW, IPT_UNKNOWN )
1255    PORT_BIT( 0x0020, IP_ACTIVE_LOW, IPT_UNKNOWN )
1256    PORT_BIT( 0x0040, IP_ACTIVE_LOW, IPT_UNKNOWN )
1257    PORT_BIT( 0x0080, IP_ACTIVE_LOW, IPT_UNKNOWN )
1258    PORT_BIT( 0xff00, IP_ACTIVE_LOW, IPT_UNKNOWN )
1097   PORT_MODIFY("IN2")
1098    PORT_BIT( 0x0200, IP_ACTIVE_LOW, IPT_UNUSED )           /* START2 */
1099    PORT_BIT( 0x2000, IP_ACTIVE_LOW, IPT_UNUSED )           /* COIN2 */
1100INPUT_PORTS_END
12591101
1260    PORT_START      /* IN2 (0x20) */
1261    PORT_BIT( 0x0001, IP_ACTIVE_LOW, IPT_SPECIAL )   /* EEPROM bit */
1262   PORT_BIT(0x0002, IP_ACTIVE_LOW, IPT_SERVICE ) PORT_NAME( DEF_STR( Service_Mode )) PORT_CODE(KEYCODE_F2)
1263    PORT_BIT( 0x0004, IP_ACTIVE_LOW, IPT_SERVICE1 )
1264    PORT_BIT( 0x00f8, IP_ACTIVE_LOW, IPT_UNKNOWN )
1265    PORT_BIT( 0x0100, IP_ACTIVE_LOW, IPT_START1 )
1266    PORT_BIT( 0x0200, IP_ACTIVE_LOW, IPT_START2 )
1267    PORT_BIT( 0x0400, IP_ACTIVE_LOW, IPT_UNKNOWN )
1268    PORT_BIT( 0x0800, IP_ACTIVE_LOW, IPT_UNKNOWN )
1269    PORT_BIT( 0x1000, IP_ACTIVE_LOW, IPT_COIN1 )
1270    PORT_BIT( 0x2000, IP_ACTIVE_LOW, IPT_COIN2 )
1271    PORT_BIT( 0x4000, IP_ACTIVE_LOW, IPT_UNKNOWN )
1272    PORT_BIT( 0x8000, IP_ACTIVE_LOW, IPT_UNKNOWN )
1102/* 1 player and 3 buttons */
1103static INPUT_PORTS_START( cps2_1p3b )
1104   PORT_INCLUDE(cps2_1p4b)
12731105
1274   PORT_START  /* Paddles */
1106   PORT_MODIFY("IN0")
1107    PORT_BIT( 0x0080, IP_ACTIVE_LOW, IPT_UNUSED )           /* BUTTON4 PORT_PLAYER(1) */
1108INPUT_PORTS_END
1109
1110/* 1 player and 2 buttons */
1111static INPUT_PORTS_START( cps2_1p2b )
1112   PORT_INCLUDE(cps2_1p3b)
1113
1114   PORT_MODIFY("IN0")
1115    PORT_BIT( 0x0040, IP_ACTIVE_LOW, IPT_UNUSED )           /* BUTTON3 PORT_PLAYER(1) */
1116INPUT_PORTS_END
1117
1118
1119/*************************************
1120 *
1121 *  Game-specific port definitions
1122 *
1123 *************************************/
1124
1125/* According to the "test mode", buttons layout look like a 2 players 6 buttons machine where buttons have been removed */
1126static INPUT_PORTS_START( cybots )
1127   PORT_INCLUDE(cps2_2p6b)
1128
1129   PORT_MODIFY("IN1")
1130    PORT_BIT( 0x0001, IP_ACTIVE_LOW, IPT_BUTTON4 ) PORT_PLAYER(1)
1131    PORT_BIT( 0x0002, IP_ACTIVE_LOW, IPT_UNUSED )                     /* BUTTON5 PORT_PLAYER(1) */
1132    PORT_BIT( 0x0004, IP_ACTIVE_LOW, IPT_UNUSED )                     /* BUTTON6 PORT_PLAYER(1) */
1133    PORT_BIT( 0x0010, IP_ACTIVE_LOW, IPT_BUTTON4 ) PORT_PLAYER(2)
1134    PORT_BIT( 0x0020, IP_ACTIVE_LOW, IPT_UNUSED )                     /* BUTTON5 PORT_PLAYER(2) */
1135
1136   PORT_MODIFY("IN2")
1137    PORT_BIT( 0x4000, IP_ACTIVE_LOW, IPT_UNUSED )                     /* BUTTON6 PORT_PLAYER(2) */
1138INPUT_PORTS_END
1139
1140/* 2 players, no joysticks which are replaced with 4 buttons, no other buttons */
1141static INPUT_PORTS_START( qndream )
1142   PORT_INCLUDE(cps2_2p4b)
1143
1144   PORT_MODIFY("IN0")
1145    PORT_BIT( 0x0001, IP_ACTIVE_LOW, IPT_BUTTON4 ) PORT_PLAYER(1)
1146    PORT_BIT( 0x0002, IP_ACTIVE_LOW, IPT_BUTTON3 ) PORT_PLAYER(1)
1147    PORT_BIT( 0x0004, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_PLAYER(1)
1148    PORT_BIT( 0x0008, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(1)
1149    PORT_BIT( 0x00f0, IP_ACTIVE_LOW, IPT_UNUSED )
1150    PORT_BIT( 0x0100, IP_ACTIVE_LOW, IPT_BUTTON4 ) PORT_PLAYER(2)
1151    PORT_BIT( 0x0200, IP_ACTIVE_LOW, IPT_BUTTON3 ) PORT_PLAYER(2)
1152    PORT_BIT( 0x0400, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_PLAYER(2)
1153    PORT_BIT( 0x0800, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(2)
1154    PORT_BIT( 0xf000, IP_ACTIVE_LOW, IPT_UNUSED )
1155INPUT_PORTS_END
1156
1157/* 2 players and 1 button - either 2 8-way joysticks, 2 2-way joysticks, or 2 paddles */
1158static INPUT_PORTS_START( pzloop2 )
1159   PORT_INCLUDE(cps2_2p1b)
1160
1161   PORT_START_TAG("PADDLE1")
12751162   PORT_BIT( 0xff, 0x00, IPT_DIAL ) PORT_SENSITIVITY(100) PORT_KEYDELTA(15) PORT_PLAYER(1)
12761163
1277   PORT_START
1164   PORT_START_TAG("PADDLE2")
12781165   PORT_BIT( 0xff, 0x00, IPT_DIAL ) PORT_SENSITIVITY(100) PORT_KEYDELTA(15) PORT_PLAYER(2)
1279
12801166INPUT_PORTS_END
12811167
1282static READ16_HANDLER( pl2_port_0_word_r )
1283{
1284   if(readpaddle != 0)
1285      return readinputport(0);
1286   else
1287      return readinputport(3) + (readinputport(4) << 8);
1288}
1168/* 1 player and 3 buttons, but 2 coins slots */
1169static INPUT_PORTS_START( choko )
1170   PORT_INCLUDE(cps2_1p3b)
12891171
1172   PORT_MODIFY("IN2")
1173    PORT_BIT( 0x2000, IP_ACTIVE_LOW, IPT_COIN2 )
1174INPUT_PORTS_END
12901175
12911176
1177/*************************************
1178 *
1179 *  Graphics layouts
1180 *
1181 *************************************/
1182
12921183static const gfx_layout cps1_layout8x8 =
12931184{
12941185   8,8,
r1679r1680
13221213GFXDECODE_END
13231214
13241215
1216/*************************************
1217 *
1218 *  M68K encryption interface
1219 *
1220 *************************************/
13251221
13261222static const struct m68k_encryption_interface cps2_encryption =
13271223{
1328   CPS2_Read8, CPS2_Read16, CPS2_Read32,
1329   CPS2_Read16, CPS2_Read32
1224   cps2_read8, cps2_read16, cps2_read32,
1225   cps2_read16, cps2_read32
13301226};
13311227
1228
1229/*************************************
1230 *
1231 *  Machine driver
1232 *
1233 *************************************/
1234
13321235static MACHINE_DRIVER_START( cps2 )
13331236
13341237   /* basic machine hardware */
r1679r1680
13681271   MDRV_SOUND_ROUTE(1, "right", 1.0)
13691272MACHINE_DRIVER_END
13701273
1274
1275/*************************************
1276 *
1277 *  ROM definitions
1278 *
1279 *************************************/
1280
13711281ROM_START( 1944 )
13721282   ROM_REGION( CODE_SIZE, REGION_CPU1, 0 )      /* 68000 code */
13731283   ROM_LOAD16_WORD_SWAP( "nffu.03", 0x000000, 0x80000, CRC(9693cf8f) SHA1(c296cb008e282f77b44374d1c3638a3f4d5d5d4e) )
r1679r1680
71837093ROM_END
71847094
71857095
7096/*************************************
7097 *
7098 *  Games initialisation
7099 *
7100 *************************************/
71867101
7187
7188
71897102static DRIVER_INIT( cps2 )
71907103{
71917104   /* Decrypt the game - see machine/cps2crpt.c */
r1679r1680
72067119
72077120}
72087121
7209static DRIVER_INIT ( puzloop2 )
7122static DRIVER_INIT ( pzloop2 )
72107123{
72117124   DRIVER_INIT_CALL(cps2);
7212   memory_install_read16_handler(0, ADDRESS_SPACE_PROGRAM, 0x804000, 0x804001, 0, 0, pl2_port_0_word_r);
7125   memory_install_read16_handler(0, ADDRESS_SPACE_PROGRAM, 0x804000, 0x804001, 0, 0, joy_or_paddle_r);
72137126}
72147127
7215GAME( 1993, ssf2,     0,       cps2, ssf2,    cps2, ROT0,   "Capcom", "Super Street Fighter II: The New Challengers (World 930911)", 0 )
7216GAME( 1993, ssf2u,    ssf2,    cps2, ssf2,    cps2, ROT0,   "Capcom", "Super Street Fighter II: The New Challengers (USA 930911)", 0 )
7217GAME( 1993, ssf2a,    ssf2,    cps2, ssf2,    cps2, ROT0,   "Capcom", "Super Street Fighter II: The New Challengers (Asia 931005)", 0 )
7218GAME( 1993, ssf2ar1,  ssf2,    cps2, ssf2,    cps2, ROT0,   "Capcom", "Super Street Fighter II: The New Challengers (Asia 930914)", 0 )
7219GAME( 1993, ssf2j,    ssf2,    cps2, ssf2,    cps2, ROT0,   "Capcom", "Super Street Fighter II: The New Challengers (Japan 931005)", 0 )
7220GAME( 1993, ssf2jr1,  ssf2,    cps2, ssf2,    cps2, ROT0,   "Capcom", "Super Street Fighter II: The New Challengers (Japan 930911)", 0 )
7221GAME( 1993, ssf2jr2,  ssf2,    cps2, ssf2,    cps2, ROT0,   "Capcom", "Super Street Fighter II: The New Challengers (Japan 930910)", 0 )
7222GAME( 1993, ssf2tb,   ssf2,    cps2, ssf2,    ssf2tb, ROT0, "Capcom", "Super Street Fighter II: The Tournament Battle (World 931119)", 0 )   // works, but not in tournament mode
7223GAME( 1993, ssf2tbr1, ssf2,    cps2, ssf2,    ssf2tb, ROT0, "Capcom", "Super Street Fighter II: The Tournament Battle (World 930911)", 0 )   // works, but not in tournament mode
7224GAME( 1993, ssf2tbj,  ssf2,    cps2, ssf2,    ssf2tb, ROT0, "Capcom", "Super Street Fighter II: The Tournament Battle (Japan 930911)", 0 )   // works, but not in tournament mode
7225GAME( 1993, ddtod,    0,       cps2, ddtod,   cps2, ROT0,   "Capcom", "Dungeons & Dragons: Tower of Doom (Euro 940412)", 0 )
7226GAME( 1993, ddtodr1,  ddtod,   cps2, ddtod,   cps2, ROT0,   "Capcom", "Dungeons & Dragons: Tower of Doom (Euro 940113)", 0 )
7227GAME( 1993, ddtodu,   ddtod,   cps2, ddtod,   cps2, ROT0,   "Capcom", "Dungeons & Dragons: Tower of Doom (USA 940125)", 0 )
7228GAME( 1993, ddtodur1, ddtod,   cps2, ddtod,   cps2, ROT0,   "Capcom", "Dungeons & Dragons: Tower of Doom (USA 940113)", 0 )
7229GAME( 1993, ddtodj,   ddtod,   cps2, ddtod,   cps2, ROT0,   "Capcom", "Dungeons & Dragons: Tower of Doom (Japan 940125)", 0 )
7230GAME( 1993, ddtodjr1, ddtod,   cps2, ddtod,   cps2, ROT0,   "Capcom", "Dungeons & Dragons: Tower of Doom (Japan 940113)", 0 )
7231GAME( 1993, ddtoda,   ddtod,   cps2, ddtod,   cps2, ROT0,   "Capcom", "Dungeons & Dragons: Tower of Doom (Asia 940113)", 0 )
7232GAME( 1993, ddtodh,   ddtod,   cps2, ddtod,   cps2, ROT0,   "Capcom", "Dungeons & Dragons: Tower of Doom (Hispanic 940125)", 0 )
7233GAME( 1993, ecofghtr, 0,       cps2, sgemf,   cps2, ROT0,   "Capcom", "Eco Fighters (World 931203)", 0 )
7234GAME( 1993, ecofghtu, ecofghtr,cps2, sgemf,   cps2, ROT0,   "Capcom", "Eco Fighters (USA 940215)", 0 )
7235GAME( 1993, ecofgtu1, ecofghtr,cps2, sgemf,   cps2, ROT0,   "Capcom", "Eco Fighters (USA 931203)", 0 )
7236GAME( 1993, uecology, ecofghtr,cps2, sgemf,   cps2, ROT0,   "Capcom", "Ultimate Ecology (Japan 931203)", 0 )
7237GAME( 1993, ecofghta, ecofghtr,cps2, sgemf,   cps2, ROT0,   "Capcom", "Eco Fighters (Asia 931203)", 0 )
7238GAME( 1994, ssf2t,    ssf2,    cps2, ssf2,    cps2, ROT0,   "Capcom", "Super Street Fighter II Turbo (World 940223)", 0 )
7239GAME( 1994, ssf2ta,   ssf2,    cps2, ssf2,    cps2, ROT0,   "Capcom", "Super Street Fighter II Turbo (Asia 940223)", 0 )
7240GAME( 1994, ssf2tu,   ssf2,    cps2, ssf2,    cps2, ROT0,   "Capcom", "Super Street Fighter II Turbo (USA 940323)", 0 )
7241GAME( 1994, ssf2tur1, ssf2,    cps2, ssf2,    cps2, ROT0,   "Capcom", "Super Street Fighter II Turbo (USA 940223)", 0 )
7242GAME( 1994, ssf2xj,   ssf2,    cps2, ssf2,    cps2, ROT0,   "Capcom", "Super Street Fighter II X: Grand Master Challenge (Japan 940223)", 0 )
7243GAME( 1994, xmcota,   0,       cps2, ssf2,    cps2, ROT0,   "Capcom", "X-Men: Children of the Atom (Euro 950105)", 0 )
7244GAME( 1994, xmcotau,  xmcota,  cps2, ssf2,    cps2, ROT0,   "Capcom", "X-Men: Children of the Atom (USA 950105)", 0 )
7245GAME( 1994, xmcotah,  xmcota,  cps2, ssf2,    cps2, ROT0,   "Capcom", "X-Men: Children of the Atom (Hispanic 950331)", 0 )
7246GAME( 1994, xmcotaj,  xmcota,  cps2, ssf2,    cps2, ROT0,   "Capcom", "X-Men: Children of the Atom (Japan 941222)", 0 )
7247GAME( 1994, xmcotaj1, xmcota,  cps2, ssf2,    cps2, ROT0,   "Capcom", "X-Men: Children of the Atom (Japan 941219)", 0 )
7248GAME( 1994, xmcotaj2, xmcota,  cps2, ssf2,    cps2, ROT0,   "Capcom", "X-Men: Children of the Atom (Japan 941217)", 0 )
7249GAME( 1994, xmcotajr, xmcota,  cps2, ssf2,    cps2, ROT0,   "Capcom", "X-Men: Children of the Atom (Japan 941208 rent version)", 0 )
7250GAME( 1994, xmcotaa,  xmcota,  cps2, ssf2,    cps2, ROT0,   "Capcom", "X-Men: Children of the Atom (Asia 941217)", 0 )
7251GAME( 1994, armwar,   0,       cps2, avsp,    cps2, ROT0,   "Capcom", "Armored Warriors (Euro 941024)", 0 )
7252GAME( 1994, armwarr1, armwar,  cps2, avsp,    cps2, ROT0,   "Capcom", "Armored Warriors (Euro 941011)", 0 )
7253GAME( 1994, armwaru,  armwar,  cps2, avsp,    cps2, ROT0,   "Capcom", "Armored Warriors (USA 941024)", 0 )
7254GAME( 1994, pgear,    armwar,  cps2, avsp,    cps2, ROT0,   "Capcom", "Powered Gear: Strategic Variant Armor Equipment (Japan 941024)", 0 )
7255GAME( 1994, pgearr1,  armwar,  cps2, avsp,    cps2, ROT0,   "Capcom", "Powered Gear: Strategic Variant Armor Equipment (Japan 940916)", 0 )
7256GAME( 1994, armwara,  armwar,  cps2, avsp,    cps2, ROT0,   "Capcom", "Armored Warriors (Asia 940920)", 0 )
7257GAME( 1994, avsp,     0,       cps2, avsp,    cps2, ROT0,   "Capcom", "Alien vs. Predator (Euro 940520)", 0 )
7258GAME( 1994, avspu,    avsp,    cps2, avsp,    cps2, ROT0,   "Capcom", "Alien vs. Predator (USA 940520)", 0 )
7259GAME( 1994, avspj,    avsp,    cps2, avsp,    cps2, ROT0,   "Capcom", "Alien vs. Predator (Japan 940520)", 0 )
7260GAME( 1994, avspa,    avsp,    cps2, avsp,    cps2, ROT0,   "Capcom", "Alien vs. Predator (Asia 940520)", 0 )
7261GAME( 1994, avsph,    avsp,    cps2, avsp,    cps2, ROT0,   "Capcom", "Alien vs. Predator (Hispanic 940520)", 0 )
7262GAME( 1994, dstlk,    0,       cps2, ssf2,    cps2, ROT0,   "Capcom", "Darkstalkers: The Night Warriors (Euro 940705)", 0 )
7263GAME( 1994, dstlku,   dstlk,   cps2, ssf2,    cps2, ROT0,   "Capcom", "Darkstalkers: The Night Warriors (USA 940818)", 0 )
7264GAME( 1994, dstlkur1, dstlk,   cps2, ssf2,    cps2, ROT0,   "Capcom", "Darkstalkers: The Night Warriors (USA 940705)", 0 )
7265GAME( 1994, dstlka,   dstlk,   cps2, ssf2,    cps2, ROT0,   "Capcom", "Darkstalkers: The Night Warriors (Asia 940705)", 0 )
7266GAME( 1994, vampj,    dstlk,   cps2, ssf2,    cps2, ROT0,   "Capcom", "Vampire: The Night Warriors (Japan 940705)", 0 )   // one of these two must be a bad dump
7267GAME( 1994, vampja,   dstlk,   cps2, ssf2,    cps2, ROT0,   "Capcom", "Vampire: The Night Warriors (Japan 940705 alt)", 0 )
7268GAME( 1994, vampjr1,  dstlk,   cps2, ssf2,    cps2, ROT0,   "Capcom", "Vampire: The Night Warriors (Japan 940630)", 0 )
7269GAME( 1994, ringdest, 0,       cps2, ssf2,    cps2, ROT0,   "Capcom", "Ring of Destruction: Slammasters II (Euro 940902)", 0 )
7270GAME( 1994, smbomb,   ringdest,cps2, ssf2,    cps2, ROT0,   "Capcom", "Super Muscle Bomber: The International Blowout (Japan 940831)", 0 )
7271GAME( 1994, smbombr1, ringdest,cps2, ssf2,    cps2, ROT0,   "Capcom", "Super Muscle Bomber: The International Blowout (Japan 940808)", 0 )
7272GAME( 1995, cybots,   0,       cps2, cybots,  cps2, ROT0,   "Capcom", "Cyberbots: Fullmetal Madness (Euro 950424)", 0 )
7273GAME( 1995, cybotsu,  cybots,  cps2, cybots,  cps2, ROT0,   "Capcom", "Cyberbots: Fullmetal Madness (USA 950424)", 0 )
7274GAME( 1995, cybotsj,  cybots,  cps2, cybots,  cps2, ROT0,   "Capcom", "Cyberbots: Fullmetal Madness (Japan 950420)", 0 )
7275GAME( 1995, msh,      0,       cps2, ssf2,    cps2, ROT0,   "Capcom", "Marvel Super Heroes (Euro 951024)", 0 )
7276GAME( 1995, mshu,     msh,     cps2, ssf2,    cps2, ROT0,   "Capcom", "Marvel Super Heroes (USA 951024)", 0 )
7277GAME( 1995, mshj,     msh,     cps2, ssf2,    cps2, ROT0,   "Capcom", "Marvel Super Heroes (Japan 951117)", 0 )
7278GAME( 1995, mshjr1,   msh,     cps2, ssf2,    cps2, ROT0,   "Capcom", "Marvel Super Heroes (Japan 951024)", 0 )
7279GAME( 1995, msha,     msh,     cps2, ssf2,    cps2, ROT0,   "Capcom", "Marvel Super Heroes (Asia 951024)", 0 )
7280GAME( 1995, mshh,     msh,     cps2, ssf2,    cps2, ROT0,   "Capcom", "Marvel Super Heroes (Hispanic 951117)", 0 )
7281GAME( 1995, mshb,     msh,     cps2, ssf2,    cps2, ROT0,   "Capcom", "Marvel Super Heroes (Brazil 951117)", 0 )
7282GAME( 1995, nwarr,    0,       cps2, ssf2,    cps2, ROT0,   "Capcom", "Night Warriors: Darkstalkers' Revenge (Euro 950316)", 0 )
7283GAME( 1995, nwarru,   nwarr,   cps2, ssf2,    cps2, ROT0,   "Capcom", "Night Warriors: Darkstalkers' Revenge (USA 950406)", 0 )
7284GAME( 1995, nwarrh,   nwarr,   cps2, ssf2,    cps2, ROT0,   "Capcom", "Night Warriors: Darkstalkers' Revenge (Hispanic 950403)", 0 )
7285GAME( 1995, nwarrb,   nwarr,   cps2, ssf2,    cps2, ROT0,   "Capcom", "Night Warriors: Darkstalkers' Revenge (Brazil 950403)", 0 )
7286GAME( 1995, vhuntj,   nwarr,   cps2, ssf2,    cps2, ROT0,   "Capcom", "Vampire Hunter: Darkstalkers' Revenge (Japan 950316)", 0 )
7287GAME( 1995, vhuntjr1, nwarr,   cps2, ssf2,    cps2, ROT0,   "Capcom", "Vampire Hunter: Darkstalkers' Revenge (Japan 950307)", 0 )
7288GAME( 1995, vhuntjr2, nwarr,   cps2, ssf2,    cps2, ROT0,   "Capcom", "Vampire Hunter: Darkstalkers' Revenge (Japan 950302)", 0 )
7289GAME( 1995, sfa,      0,       cps2, ssf2,    cps2, ROT0,   "Capcom", "Street Fighter Alpha: Warriors' Dreams (Euro 950727)", 0 )
7290GAME( 1995, sfar1,    sfa,     cps2, ssf2,    cps2, ROT0,   "Capcom", "Street Fighter Alpha: Warriors' Dreams (Euro 950718)", 0 )
7291GAME( 1995, sfar2,    sfa,     cps2, ssf2,    cps2, ROT0,   "Capcom", "Street Fighter Alpha: Warriors' Dreams (Euro 950627)", 0 )
7292GAME( 1995, sfar3,    sfa,     cps2, ssf2,    cps2, ROT0,   "Capcom", "Street Fighter Alpha: Warriors' Dreams (Euro 950605)", 0 )
7293GAME( 1995, sfau,     sfa,     cps2, ssf2,    cps2, ROT0,   "Capcom", "Street Fighter Alpha: Warriors' Dreams (USA 950627)", 0 )
7294GAME( 1995, sfza,     sfa,     cps2, ssf2,    cps2, ROT0,   "Capcom", "Street Fighter Zero (Asia 950627)", 0 )
7295GAME( 1995, sfzj,     sfa,     cps2, ssf2,    cps2, ROT0,   "Capcom", "Street Fighter Zero (Japan 950727)", 0 )
7296GAME( 1995, sfzjr1,   sfa,     cps2, ssf2,    cps2, ROT0,   "Capcom", "Street Fighter Zero (Japan 950627)", 0 )
7297GAME( 1995, sfzjr2,   sfa,     cps2, ssf2,    cps2, ROT0,   "Capcom", "Street Fighter Zero (Japan 950605)", 0 )
7298GAME( 1995, sfzh,     sfa,     cps2, ssf2,    cps2, ROT0,   "Capcom", "Street Fighter Zero (Hispanic 950627)", 0 )
7299GAME( 1995, sfzb,     sfa,     cps2, ssf2,    cps2, ROT0,   "Capcom", "Street Fighter Zero (Brazil 951109)", 0 )
7300GAME( 1995, sfzbr1,   sfa,     cps2, ssf2,    cps2, ROT0,   "Capcom", "Street Fighter Zero (Brazil 950727)", 0 )
7301GAME( 1995, mmancp2u, megaman, cps2, sgemf,   cps2, ROT0,   "Capcom", "Mega Man - The Power Battle (CPS2, USA 951006, SAMPLE Version)", 0 )
7302GAME( 1995, rmancp2j, megaman, cps2, sgemf,   cps2, ROT0,   "Capcom", "Rockman: The Power Battle (CPS2, Japan 950922)", 0 )
7303GAME( 1996, 19xx,     0,       cps2, 19xx,    cps2, ROT270, "Capcom", "19XX: The War Against Destiny (USA 951207)", 0 )
7304GAME( 1996, 19xxa,    19xx,    cps2, 19xx,    cps2, ROT270, "Capcom", "19XX: The War Against Destiny (Asia 951207)", 0 )
7305GAME( 1996, 19xxj,    19xx,    cps2, 19xx,    cps2, ROT270, "Capcom", "19XX: The War Against Destiny (Japan 951225)", 0 )
7306GAME( 1996, 19xxjr1,  19xx,    cps2, 19xx,    cps2, ROT270, "Capcom", "19XX: The War Against Destiny (Japan 951207)", 0 )
7307GAME( 1996, 19xxh,    19xx,    cps2, 19xx,    cps2, ROT270, "Capcom", "19XX: The War Against Destiny (Hispanic 951218)", 0 )
7308GAME( 1996, 19xxb,    19xx,    cps2, 19xx,    cps2, ROT270, "Capcom", "19XX: The War Against Destiny (Brazil 951218)", 0 )
7309GAME( 1996, ddsom,    0,       cps2, ddtod,   cps2, ROT0,   "Capcom", "Dungeons & Dragons: Shadow over Mystara (Euro 960619)", 0 )
7310GAME( 1996, ddsomr1,  ddsom,   cps2, ddtod,   cps2, ROT0,   "Capcom", "Dungeons & Dragons: Shadow over Mystara (Euro 960223)", 0 )
7311GAME( 1996, ddsomr2,  ddsom,   cps2, ddtod,   cps2, ROT0,   "Capcom", "Dungeons & Dragons: Shadow over Mystara (Euro 960209)", 0 )
7312GAME( 1996, ddsomr3,  ddsom,   cps2, ddtod,   cps2, ROT0,   "Capcom", "Dungeons & Dragons: Shadow over Mystara (Euro 960208)", 0 )
7313GAME( 1996, ddsomu,   ddsom,   cps2, ddtod,   cps2, ROT0,   "Capcom", "Dungeons & Dragons: Shadow over Mystara (USA 960619)", 0 )
7314GAME( 1996, ddsomur1, ddsom,   cps2, ddtod,   cps2, ROT0,   "Capcom", "Dungeons & Dragons: Shadow over Mystara (USA 960209)", 0 )
7315GAME( 1996, ddsomj,   ddsom,   cps2, ddtod,   cps2, ROT0,   "Capcom", "Dungeons & Dragons: Shadow over Mystara (Japan 960619)", 0 )
7316GAME( 1996, ddsomjr1, ddsom,   cps2, ddtod,   cps2, ROT0,   "Capcom", "Dungeons & Dragons: Shadow over Mystara (Japan 960206)", 0 )
7317GAME( 1996, ddsoma,   ddsom,   cps2, ddtod,   cps2, ROT0,   "Capcom", "Dungeons & Dragons: Shadow over Mystara (Asia 960619)", 0 )
7318GAME( 1996, ddsomb,   ddsom,   cps2, ddtod,   cps2, ROT0,   "Capcom", "Dungeons & Dragons: Shadow over Mystara (Brazil 960223)", 0 )
7319GAME( 1996, megaman2, 0,       cps2, sgemf,   cps2, ROT0,   "Capcom", "Mega Man 2: The Power Fighters (USA 960708)", 0 )
7320GAME( 1996, megamn2a, megaman2,cps2, sgemf,   cps2, ROT0,   "Capcom", "Mega Man 2: The Power Fighters (Asia 960708)", 0 )
7321GAME( 1996, rckman2j, megaman2,cps2, sgemf,   cps2, ROT0,   "Capcom", "Rockman 2: The Power Fighters (Japan 960708)", 0 )
7322GAME( 1996, qndream,  0,       cps2, qndream, cps2, ROT0,   "Capcom", "Quiz Nanairo Dreams: Nijiirochou no Kiseki (Japan 960826)", 0 )
7323GAME( 1996, sfa2,     0,       cps2, ssf2,    cps2, ROT0,   "Capcom", "Street Fighter Alpha 2 (USA 960306)", 0 )
7324GAME( 1996, sfz2j,    sfa2,    cps2, ssf2,    cps2, ROT0,   "Capcom", "Street Fighter Zero 2 (Japan 960227)", 0 )
7325GAME( 1996, sfz2a,    sfa2,    cps2, ssf2,    cps2, ROT0,   "Capcom", "Street Fighter Zero 2 (Asia 960227)", 0 )
7326GAME( 1996, sfz2b,    sfa2,    cps2, ssf2,    cps2, ROT0,   "Capcom", "Street Fighter Zero 2 (Brazil 960531)", 0 )
7327GAME( 1996, sfz2br1,  sfa2,    cps2, ssf2,    cps2, ROT0,   "Capcom", "Street Fighter Zero 2 (Brazil 960304)", 0 )
7328GAME( 1996, sfz2h,    sfa2,    cps2, ssf2,    cps2, ROT0,   "Capcom", "Street Fighter Zero 2 (Hispanic 960304)", 0 )
7329GAME( 1996, sfz2n,    sfa2,    cps2, ssf2,    cps2, ROT0,   "Capcom", "Street Fighter Zero 2 (Oceania 960229)", 0 )
7330GAME( 1996, sfz2aj,   sfa2,    cps2, ssf2,    cps2, ROT0,   "Capcom", "Street Fighter Zero 2 Alpha (Japan 960805)", 0 )
7331GAME( 1996, sfz2ah,   sfa2,    cps2, ssf2,    cps2, ROT0,   "Capcom", "Street Fighter Zero 2 Alpha (Hispanic 960813)", 0 )
7332GAME( 1996, sfz2ab,   sfa2,    cps2, ssf2,    cps2, ROT0,   "Capcom", "Street Fighter Zero 2 Alpha (Brazil 960813)", 0 )
7333GAME( 1996, sfz2aa,   sfa2,    cps2, ssf2,    cps2, ROT0,   "Capcom", "Street Fighter Zero 2 Alpha (Asia 960826)", 0 )
7334GAME( 1996, spf2t,    0,       cps2, 19xx,    cps2, ROT0,   "Capcom", "Super Puzzle Fighter II Turbo (USA 960620)", 0 )
7335GAME( 1996, spf2xj,   spf2t,   cps2, 19xx,    cps2, ROT0,   "Capcom", "Super Puzzle Fighter II X (Japan 960531)", 0 )
7336GAME( 1996, spf2ta,   spf2t,   cps2, 19xx,    cps2, ROT0,   "Capcom", "Super Puzzle Fighter II Turbo (Asia 960529)", 0 )
7337GAME( 1996, xmvsf,    0,       cps2, ssf2,    cps2, ROT0,   "Capcom", "X-Men Vs. Street Fighter (Euro 961004)", 0 )
7338GAME( 1996, xmvsfr1,  xmvsf,   cps2, ssf2,    cps2, ROT0,   "Capcom", "X-Men Vs. Street Fighter (Euro 960910)", 0 )
7339GAME( 1996, xmvsfu,   xmvsf,   cps2, ssf2,    cps2, ROT0,   "Capcom", "X-Men Vs. Street Fighter (USA 961023)", 0 )
7340GAME( 1996, xmvsfur1, xmvsf,   cps2, ssf2,    cps2, ROT0,   "Capcom", "X-Men Vs. Street Fighter (USA 961004)", 0 )
7341GAME( 1996, xmvsfj,   xmvsf,   cps2, ssf2,    cps2, ROT0,   "Capcom", "X-Men Vs. Street Fighter (Japan 961004)", 0 )
7342GAME( 1996, xmvsfjr1, xmvsf,   cps2, ssf2,    cps2, ROT0,   "Capcom", "X-Men Vs. Street Fighter (Japan 960910)", 0 )
7343GAME( 1996, xmvsfjr2, xmvsf,   cps2, ssf2,    cps2, ROT0,   "Capcom", "X-Men Vs. Street Fighter (Japan 960909)", 0 )
7344GAME( 1996, xmvsfa,   xmvsf,   cps2, ssf2,    cps2, ROT0,   "Capcom", "X-Men Vs. Street Fighter (Asia 961023)", 0 )
7345GAME( 1996, xmvsfar1, xmvsf,   cps2, ssf2,    cps2, ROT0,   "Capcom", "X-Men Vs. Street Fighter (Asia 960919)", 0 )
7346GAME( 1996, xmvsfh,   xmvsf,   cps2, ssf2,    cps2, ROT0,   "Capcom", "X-Men Vs. Street Fighter (Hispanic 961004)", 0 )
7347GAME( 1996, xmvsfb,   xmvsf,   cps2, ssf2,    cps2, ROT0,   "Capcom", "X-Men Vs. Street Fighter (Brazil 961023)", 0 )
7348GAME( 1997, batcir,   0,       cps2, batcir,  cps2, ROT0,   "Capcom", "Battle Circuit (Euro 970319)", 0 )
7349GAME( 1997, batcira,  batcir,  cps2, batcir,  cps2, ROT0,   "Capcom", "Battle Circuit (Asia 970319)", 0 )
7350GAME( 1997, batcirj,  batcir,  cps2, batcir,  cps2, ROT0,   "Capcom", "Battle Circuit (Japan 970319)", 0 )
7351GAME( 1997, csclub,   0,       cps2, sgemf,   cps2, ROT0,   "Capcom", "Capcom Sports Club (Euro 970722)", 0 )
7352GAME( 1997, cscluba,  csclub,  cps2, sgemf,   cps2, ROT0,   "Capcom", "Capcom Sports Club (Asia 970722)", 0 )
7353GAME( 1997, csclubj,  csclub,  cps2, sgemf,   cps2, ROT0,   "Capcom", "Capcom Sports Club (Japan 970722)", 0 )
7354GAME( 1997, csclubh,  csclub,  cps2, sgemf,   cps2, ROT0,   "Capcom", "Capcom Sports Club (Hispanic 970722)", 0 )
7355GAME( 1997, mshvsf,   0,       cps2, ssf2,    cps2, ROT0,   "Capcom", "Marvel Super Heroes Vs. Street Fighter (Euro 970625)", 0 )
7356GAME( 1997, mshvsfu,  mshvsf,  cps2, ssf2,    cps2, ROT0,   "Capcom", "Marvel Super Heroes Vs. Street Fighter (USA 970827)", 0 )
7357GAME( 1997, mshvsfu1, mshvsf,  cps2, ssf2,    cps2, ROT0,   "Capcom", "Marvel Super Heroes Vs. Street Fighter (USA 970625)", 0 )
7358GAME( 1997, mshvsfj,  mshvsf,  cps2, ssf2,    cps2, ROT0,   "Capcom", "Marvel Super Heroes Vs. Street Fighter (Japan 970707)", 0 )
7359GAME( 1997, mshvsfj1, mshvsf,  cps2, ssf2,    cps2, ROT0,   "Capcom", "Marvel Super Heroes Vs. Street Fighter (Japan 970702)", 0 )
7360GAME( 1997, mshvsfj2, mshvsf,  cps2, ssf2,    cps2, ROT0,   "Capcom", "Marvel Super Heroes Vs. Street Fighter (Japan 970625)", 0 )
7361GAME( 1997, mshvsfh,  mshvsf,  cps2, ssf2,    cps2, ROT0,   "Capcom", "Marvel Super Heroes Vs. Street Fighter (Hispanic 970625)", 0 )
7362GAME( 1997, mshvsfa,  mshvsf,  cps2, ssf2,    cps2, ROT0,   "Capcom", "Marvel Super Heroes Vs. Street Fighter (Asia 970625)", 0 )
7363GAME( 1997, mshvsfa1, mshvsf,  cps2, ssf2,    cps2, ROT0,   "Capcom", "Marvel Super Heroes Vs. Street Fighter (Asia 970620)", 0 )
7364GAME( 1997, mshvsfb,  mshvsf,  cps2, ssf2,    cps2, ROT0,   "Capcom", "Marvel Super Heroes Vs. Street Fighter (Brazil 970827)", 0 )
7365GAME( 1997, mshvsfb1, mshvsf,  cps2, ssf2,    cps2, ROT0,   "Capcom", "Marvel Super Heroes Vs. Street Fighter (Brazil 970625)", 0 )
7366GAME( 1997, sgemf,    0,       cps2, sgemf,   cps2, ROT0,   "Capcom", "Super Gem Fighter Mini Mix (USA 970904)", 0 )
7367GAME( 1997, pfghtj,   sgemf,   cps2, sgemf,   cps2, ROT0,   "Capcom", "Pocket Fighter (Japan 970904)", 0 )
7368GAME( 1997, sgemfa,   sgemf,   cps2, sgemf,   cps2, ROT0,   "Capcom", "Super Gem Fighter: Mini Mix (Asia 970904)", 0 )
7369GAME( 1997, sgemfh,   sgemf,   cps2, sgemf,   cps2, ROT0,   "Capcom", "Super Gem Fighter: Mini Mix (Hispanic 970904)", 0 )
7370GAME( 1997, vhunt2,   0,       cps2, ssf2,    cps2, ROT0,   "Capcom", "Vampire Hunter 2: Darkstalkers Revenge (Japan 970929)", 0 )
7371GAME( 1997, vhunt2r1, vhunt2,  cps2, ssf2,    cps2, ROT0,   "Capcom", "Vampire Hunter 2: Darkstalkers Revenge (Japan 970913)", 0 )
7372GAME( 1997, vsav,     0,       cps2, ssf2,    cps2, ROT0,   "Capcom", "Vampire Savior: The Lord of Vampire (Euro 970519)", 0 )
7373GAME( 1997, vsavu,    vsav,    cps2, ssf2,    cps2, ROT0,   "Capcom", "Vampire Savior: The Lord of Vampire (USA 970519)", 0 )
7374GAME( 1997, vsavj,    vsav,    cps2, ssf2,    cps2, ROT0,   "Capcom", "Vampire Savior: The Lord of Vampire (Japan 970519)", 0 )
7375GAME( 1997, vsava,    vsav,    cps2, ssf2,    cps2, ROT0,   "Capcom", "Vampire Savior: The Lord of Vampire (Asia 970519)", 0 )
7376GAME( 1997, vsavh,    vsav,    cps2, ssf2,    cps2, ROT0,   "Capcom", "Vampire Savior: The Lord of Vampire (Hispanic 970519)", 0 )
7377GAME( 1997, vsav2,    0,       cps2, ssf2,    cps2, ROT0,   "Capcom", "Vampire Savior 2: The Lord of Vampire (Japan 970913)", 0 )
7378GAME( 1998, mvsc,     0,       cps2, ssf2,    cps2, ROT0,   "Capcom", "Marvel Vs. Capcom: Clash of Super Heroes (Euro 980112)", 0 )
7379GAME( 1998, mvscu,    mvsc,    cps2, ssf2,    cps2, ROT0,   "Capcom", "Marvel Vs. Capcom: Clash of Super Heroes (USA 980123)", 0 )
7380GAME( 1998, mvscj,    mvsc,    cps2, ssf2,    cps2, ROT0,   "Capcom", "Marvel Vs. Capcom: Clash of Super Heroes (Japan 980123)", 0 )
7381GAME( 1998, mvscjr1,  mvsc,    cps2, ssf2,    cps2, ROT0,   "Capcom", "Marvel Vs. Capcom: Clash of Super Heroes (Japan 980112)", 0 )
7382GAME( 1998, mvsca,    mvsc,    cps2, ssf2,    cps2, ROT0,   "Capcom", "Marvel Vs. Capcom: Clash of Super Heroes (Asia 980123)", 0 )
7383GAME( 1998, mvscar1,  mvsc,    cps2, ssf2,    cps2, ROT0,   "Capcom", "Marvel Vs. Capcom: Clash of Super Heroes (Asia 980112)", 0 )
7384GAME( 1998, mvsch,    mvsc,    cps2, ssf2,    cps2, ROT0,   "Capcom", "Marvel Vs. Capcom: Clash of Super Heroes (Hispanic 980123)", 0 )
7385GAME( 1998, mvscb,    mvsc,    cps2, ssf2,    cps2, ROT0,   "Capcom", "Marvel Vs. Capcom: Clash of Super Heroes (Brazil 980123)", 0 )
7386GAME( 1998, sfa3,     0,       cps2, ssf2,    cps2, ROT0,   "Capcom", "Street Fighter Alpha 3 (Euro 980904)", 0 )
7387GAME( 1998, sfa3u,    sfa3,    cps2, ssf2,    cps2, ROT0,   "Capcom", "Street Fighter Alpha 3 (USA 980904)", 0 )
7388GAME( 1998, sfa3ur1,  sfa3,    cps2, ssf2,    cps2, ROT0,   "Capcom", "Street Fighter Alpha 3 (USA 980629)", 0 )
7389GAME( 1998, sfa3b,    sfa3,    cps2, ssf2,    cps2, ROT0,   "Capcom", "Street Fighter Alpha 3 (Brazil 980629)", 0 )
7390GAME( 1998, sfz3j,    sfa3,    cps2, ssf2,    cps2, ROT0,   "Capcom", "Street Fighter Zero 3 (Japan 980904)", 0 )
7391GAME( 1998, sfz3jr1,  sfa3,    cps2, ssf2,    cps2, ROT0,   "Capcom", "Street Fighter Zero 3 (Japan 980727)", 0 )
7392GAME( 1998, sfz3jr2,  sfa3,    cps2, ssf2,    cps2, ROT0,   "Capcom", "Street Fighter Zero 3 (Japan 980629)", 0 )
7393GAME( 1998, sfz3a,    sfa3,    cps2, ssf2,    cps2, ROT0,   "Capcom", "Street Fighter Zero 3 (Asia 980904)", 0 )
7394GAME( 1998, sfz3ar1,  sfa3,    cps2, ssf2,    cps2, ROT0,   "Capcom", "Street Fighter Zero 3 (Asia 980701)", 0 )
7395GAME( 1999, jyangoku, 0,       cps2, ssf2,    cps2, ROT0,   "Capcom", "Jyangokushi: Haoh no Saihai (Japan 990527)", 0 )
7396GAME( 2004, hsf2,     0,       cps2, ssf2,    cps2, ROT0,   "Capcom", "Hyper Street Fighter 2: The Anniversary Edition (Asia 040202)", 0 )
7397GAME( 2004, hsf2j,    hsf2,    cps2, ssf2,    cps2, ROT0,   "Capcom", "Hyper Street Fighter 2: The Anniversary Edition (Japan 031222)", 0 )
73987128
7129/*************************************
7130 *
7131 *  Game drivers
7132 *
7133 *************************************/
7134
7135GAME( 1993, ssf2,     0,        cps2, cps2_2p6b, cps2,     ROT0,   "Capcom", "Super Street Fighter II: The New Challengers (World 930911)", 0 )
7136GAME( 1993, ssf2u,    ssf2,     cps2, cps2_2p6b, cps2,     ROT0,   "Capcom", "Super Street Fighter II: The New Challengers (USA 930911)", 0 )
7137GAME( 1993, ssf2a,    ssf2,     cps2, cps2_2p6b, cps2,     ROT0,   "Capcom", "Super Street Fighter II: The New Challengers (Asia 931005)", 0 )
7138GAME( 1993, ssf2ar1,  ssf2,     cps2, cps2_2p6b, cps2,     ROT0,   "Capcom", "Super Street Fighter II: The New Challengers (Asia 930914)", 0 )
7139GAME( 1993, ssf2j,    ssf2,     cps2, cps2_2p6b, cps2,     ROT0,   "Capcom", "Super Street Fighter II: The New Challengers (Japan 931005)", 0 )
7140GAME( 1993, ssf2jr1,  ssf2,     cps2, cps2_2p6b, cps2,     ROT0,   "Capcom", "Super Street Fighter II: The New Challengers (Japan 930911)", 0 )
7141GAME( 1993, ssf2jr2,  ssf2,     cps2, cps2_2p6b, cps2,     ROT0,   "Capcom", "Super Street Fighter II: The New Challengers (Japan 930910)", 0 )
7142GAME( 1993, ssf2tb,   ssf2,     cps2, cps2_2p6b, ssf2tb,   ROT0,   "Capcom", "Super Street Fighter II: The Tournament Battle (World 931119)", 0 )   // works, but not in tournament mode
7143GAME( 1993, ssf2tbr1, ssf2,     cps2, cps2_2p6b, ssf2tb,   ROT0,   "Capcom", "Super Street Fighter II: The Tournament Battle (World 930911)", 0 )   // works, but not in tournament mode
7144GAME( 1993, ssf2tbj,  ssf2,     cps2, cps2_2p6b, ssf2tb,   ROT0,   "Capcom", "Super Street Fighter II: The Tournament Battle (Japan 930911)", 0 )   // works, but not in tournament mode
7145GAME( 1993, ddtod,    0,        cps2, cps2_4p4b, cps2,     ROT0,   "Capcom", "Dungeons & Dragons: Tower of Doom (Euro 940412)", 0 )
7146GAME( 1993, ddtodr1,  ddtod,    cps2, cps2_4p4b, cps2,     ROT0,   "Capcom", "Dungeons & Dragons: Tower of Doom (Euro 940113)", 0 )
7147GAME( 1993, ddtodu,   ddtod,    cps2, cps2_4p4b, cps2,     ROT0,   "Capcom", "Dungeons & Dragons: Tower of Doom (USA 940125)", 0 )
7148GAME( 1993, ddtodur1, ddtod,    cps2, cps2_4p4b, cps2,     ROT0,   "Capcom", "Dungeons & Dragons: Tower of Doom (USA 940113)", 0 )
7149GAME( 1993, ddtodj,   ddtod,    cps2, cps2_4p4b, cps2,     ROT0,   "Capcom", "Dungeons & Dragons: Tower of Doom (Japan 940125)", 0 )
7150GAME( 1993, ddtodjr1, ddtod,    cps2, cps2_4p4b, cps2,     ROT0,   "Capcom", "Dungeons & Dragons: Tower of Doom (Japan 940113)", 0 )
7151GAME( 1993, ddtoda,   ddtod,    cps2, cps2_4p4b, cps2,     ROT0,   "Capcom", "Dungeons & Dragons: Tower of Doom (Asia 940113)", 0 )
7152GAME( 1993, ddtodh,   ddtod,    cps2, cps2_4p4b, cps2,     ROT0,   "Capcom", "Dungeons & Dragons: Tower of Doom (Hispanic 940125)", 0 )
7153GAME( 1993, ecofghtr, 0,        cps2, cps2_2p3b, cps2,     ROT0,   "Capcom", "Eco Fighters (World 931203)", 0 )
7154GAME( 1993, ecofghtu, ecofghtr, cps2, cps2_2p3b, cps2,     ROT0,   "Capcom", "Eco Fighters (USA 940215)", 0 )
7155GAME( 1993, ecofgtu1, ecofghtr, cps2, cps2_2p3b, cps2,     ROT0,   "Capcom", "Eco Fighters (USA 931203)", 0 )
7156GAME( 1993, uecology, ecofghtr, cps2, cps2_2p3b, cps2,     ROT0,   "Capcom", "Ultimate Ecology (Japan 931203)", 0 )
7157GAME( 1993, ecofghta, ecofghtr, cps2, cps2_2p3b, cps2,     ROT0,   "Capcom", "Eco Fighters (Asia 931203)", 0 )
7158GAME( 1994, ssf2t,    ssf2,     cps2, cps2_2p6b, cps2,     ROT0,   "Capcom", "Super Street Fighter II Turbo (World 940223)", 0 )
7159GAME( 1994, ssf2ta,   ssf2,     cps2, cps2_2p6b, cps2,     ROT0,   "Capcom", "Super Street Fighter II Turbo (Asia 940223)", 0 )
7160GAME( 1994, ssf2tu,   ssf2,     cps2, cps2_2p6b, cps2,     ROT0,   "Capcom", "Super Street Fighter II Turbo (USA 940323)", 0 )
7161GAME( 1994, ssf2tur1, ssf2,     cps2, cps2_2p6b, cps2,     ROT0,   "Capcom", "Super Street Fighter II Turbo (USA 940223)", 0 )
7162GAME( 1994, ssf2xj,   ssf2,     cps2, cps2_2p6b, cps2,     ROT0,   "Capcom", "Super Street Fighter II X: Grand Master Challenge (Japan 940223)", 0 )
7163GAME( 1994, xmcota,   0,        cps2, cps2_2p6b, cps2,     ROT0,   "Capcom", "X-Men: Children of the Atom (Euro 950105)", 0 )
7164GAME( 1994, xmcotau,  xmcota,   cps2, cps2_2p6b, cps2,     ROT0,   "Capcom", "X-Men: Children of the Atom (USA 950105)", 0 )
7165GAME( 1994, xmcotah,  xmcota,   cps2, cps2_2p6b, cps2,     ROT0,   "Capcom", "X-Men: Children of the Atom (Hispanic 950331)", 0 )
7166GAME( 1994, xmcotaj,  xmcota,   cps2, cps2_2p6b, cps2,     ROT0,   "Capcom", "X-Men: Children of the Atom (Japan 941222)", 0 )
7167GAME( 1994, xmcotaj1, xmcota,   cps2, cps2_2p6b, cps2,     ROT0,   "Capcom", "X-Men: Children of the Atom (Japan 941219)", 0 )
7168GAME( 1994, xmcotaj2, xmcota,   cps2, cps2_2p6b, cps2,     ROT0,   "Capcom", "X-Men: Children of the Atom (Japan 941217)", 0 )
7169GAME( 1994, xmcotajr, xmcota,   cps2, cps2_2p6b, cps2,     ROT0,   "Capcom", "X-Men: Children of the Atom (Japan 941208 rent version)", 0 )
7170GAME( 1994, xmcotaa,  xmcota,   cps2, cps2_2p6b, cps2,     ROT0,   "Capcom", "X-Men: Children of the Atom (Asia 941217)", 0 )
7171GAME( 1994, armwar,   0,        cps2, cps2_3p3b, cps2,     ROT0,   "Capcom", "Armored Warriors (Euro 941024)", 0 )
7172GAME( 1994, armwarr1, armwar,   cps2, cps2_3p3b, cps2,     ROT0,   "Capcom", "Armored Warriors (Euro 941011)", 0 )
7173GAME( 1994, armwaru,  armwar,   cps2, cps2_3p3b, cps2,     ROT0,   "Capcom", "Armored Warriors (USA 941024)", 0 )
7174GAME( 1994, pgear,    armwar,   cps2, cps2_3p3b, cps2,     ROT0,   "Capcom", "Powered Gear: Strategic Variant Armor Equipment (Japan 941024)", 0 )
7175GAME( 1994, pgearr1,  armwar,   cps2, cps2_3p3b, cps2,     ROT0,   "Capcom", "Powered Gear: Strategic Variant Armor Equipment (Japan 940916)", 0 )
7176GAME( 1994, armwara,  armwar,   cps2, cps2_3p3b, cps2,     ROT0,   "Capcom", "Armored Warriors (Asia 940920)", 0 )
7177GAME( 1994, avsp,     0,        cps2, cps2_3p3b, cps2,     ROT0,   "Capcom", "Alien vs. Predator (Euro 940520)", 0 )
7178GAME( 1994, avspu,    avsp,     cps2, cps2_3p3b, cps2,     ROT0,   "Capcom", "Alien vs. Predator (USA 940520)", 0 )
7179GAME( 1994, avspj,    avsp,     cps2, cps2_3p3b, cps2,     ROT0,   "Capcom", "Alien vs. Predator (Japan 940520)", 0 )
7180GAME( 1994, avspa,    avsp,     cps2, cps2_3p3b, cps2,     ROT0,   "Capcom", "Alien vs. Predator (Asia 940520)", 0 )
7181GAME( 1994, avsph,    avsp,     cps2, cps2_3p3b, cps2,     ROT0,   "Capcom", "Alien vs. Predator (Hispanic 940520)", 0 )
7182GAME( 1994, dstlk,    0,        cps2, cps2_2p6b, cps2,     ROT0,   "Capcom", "Darkstalkers: The Night Warriors (Euro 940705)", 0 )
7183GAME( 1994, dstlku,   dstlk,    cps2, cps2_2p6b, cps2,     ROT0,   "Capcom", "Darkstalkers: The Night Warriors (USA 940818)", 0 )
7184GAME( 1994, dstlkur1, dstlk,    cps2, cps2_2p6b, cps2,     ROT0,   "Capcom", "Darkstalkers: The Night Warriors (USA 940705)", 0 )
7185GAME( 1994, dstlka,   dstlk,    cps2, cps2_2p6b, cps2,     ROT0,   "Capcom", "Darkstalkers: The Night Warriors (Asia 940705)", 0 )
7186GAME( 1994, vampj,    dstlk,    cps2, cps2_2p6b, cps2,     ROT0,   "Capcom", "Vampire: The Night Warriors (Japan 940705)", 0 )   // one of these two must be a bad dump
7187GAME( 1994, vampja,   dstlk,    cps2, cps2_2p6b, cps2,     ROT0,   "Capcom", "Vampire: The Night Warriors (Japan 940705 alt)", 0 )
7188GAME( 1994, vampjr1,  dstlk,    cps2, cps2_2p6b, cps2,     ROT0,   "Capcom", "Vampire: The Night Warriors (Japan 940630)", 0 )
7189GAME( 1994, ringdest, 0,        cps2, cps2_2p6b, cps2,     ROT0,   "Capcom", "Ring of Destruction: Slammasters II (Euro 940902)", 0 )
7190GAME( 1994, smbomb,   ringdest, cps2, cps2_2p6b, cps2,     ROT0,   "Capcom", "Super Muscle Bomber: The International Blowout (Japan 940831)", 0 )
7191GAME( 1994, smbombr1, ringdest, cps2, cps2_2p6b, cps2,     ROT0,   "Capcom", "Super Muscle Bomber: The International Blowout (Japan 940808)", 0 )
7192GAME( 1995, cybots,   0,        cps2, cybots,    cps2,     ROT0,   "Capcom", "Cyberbots: Fullmetal Madness (Euro 950424)", 0 )
7193GAME( 1995, cybotsu,  cybots,   cps2, cybots,    cps2,     ROT0,   "Capcom", "Cyberbots: Fullmetal Madness (USA 950424)", 0 )
7194GAME( 1995, cybotsj,  cybots,   cps2, cybots,    cps2,     ROT0,   "Capcom", "Cyberbots: Fullmetal Madness (Japan 950420)", 0 )
7195GAME( 1995, msh,      0,        cps2, cps2_2p6b, cps2,     ROT0,   "Capcom", "Marvel Super Heroes (Euro 951024)", 0 )
7196GAME( 1995, mshu,     msh,      cps2, cps2_2p6b, cps2,     ROT0,   "Capcom", "Marvel Super Heroes (USA 951024)", 0 )
7197GAME( 1995, mshj,     msh,      cps2, cps2_2p6b, cps2,     ROT0,   "Capcom", "Marvel Super Heroes (Japan 951117)", 0 )
7198GAME( 1995, mshjr1,   msh,      cps2, cps2_2p6b, cps2,     ROT0,   "Capcom", "Marvel Super Heroes (Japan 951024)", 0 )
7199GAME( 1995, msha,     msh,      cps2, cps2_2p6b, cps2,     ROT0,   "Capcom", "Marvel Super Heroes (Asia 951024)", 0 )
7200GAME( 1995, mshh,     msh,      cps2, cps2_2p6b, cps2,     ROT0,   "Capcom", "Marvel Super Heroes (Hispanic 951117)", 0 )
7201GAME( 1995, mshb,     msh,      cps2, cps2_2p6b, cps2,     ROT0,   "Capcom", "Marvel Super Heroes (Brazil 951117)", 0 )
7202GAME( 1995, nwarr,    0,        cps2, cps2_2p6b, cps2,     ROT0,   "Capcom", "Night Warriors: Darkstalkers' Revenge (Euro 950316)", 0 )
7203GAME( 1995, nwarru,   nwarr,    cps2, cps2_2p6b, cps2,     ROT0,   "Capcom", "Night Warriors: Darkstalkers' Revenge (USA 950406)", 0 )
7204GAME( 1995, nwarrh,   nwarr,    cps2, cps2_2p6b, cps2,     ROT0,   "Capcom", "Night Warriors: Darkstalkers' Revenge (Hispanic 950403)", 0 )
7205GAME( 1995, nwarrb,   nwarr,    cps2, cps2_2p6b, cps2,     ROT0,   "Capcom", "Night Warriors: Darkstalkers' Revenge (Brazil 950403)", 0 )
7206GAME( 1995, vhuntj,   nwarr,    cps2, cps2_2p6b, cps2,     ROT0,   "Capcom", "Vampire Hunter: Darkstalkers' Revenge (Japan 950316)", 0 )
7207GAME( 1995, vhuntjr1, nwarr,    cps2, cps2_2p6b, cps2,     ROT0,   "Capcom", "Vampire Hunter: Darkstalkers' Revenge (Japan 950307)", 0 )
7208GAME( 1995, vhuntjr2, nwarr,    cps2, cps2_2p6b, cps2,     ROT0,   "Capcom", "Vampire Hunter: Darkstalkers' Revenge (Japan 950302)", 0 )
7209GAME( 1995, sfa,      0,        cps2, cps2_2p6b, cps2,     ROT0,   "Capcom", "Street Fighter Alpha: Warriors' Dreams (Euro 950727)", 0 )
7210GAME( 1995, sfar1,    sfa,      cps2, cps2_2p6b, cps2,     ROT0,   "Capcom", "Street Fighter Alpha: Warriors' Dreams (Euro 950718)", 0 )
7211GAME( 1995, sfar2,    sfa,      cps2, cps2_2p6b, cps2,     ROT0,   "Capcom", "Street Fighter Alpha: Warriors' Dreams (Euro 950627)", 0 )
7212GAME( 1995, sfar3,    sfa,      cps2, cps2_2p6b, cps2,     ROT0,   "Capcom", "Street Fighter Alpha: Warriors' Dreams (Euro 950605)", 0 )
7213GAME( 1995, sfau,     sfa,      cps2, cps2_2p6b, cps2,     ROT0,   "Capcom", "Street Fighter Alpha: Warriors' Dreams (USA 950627)", 0 )
7214GAME( 1995, sfza,     sfa,      cps2, cps2_2p6b, cps2,     ROT0,   "Capcom", "Street Fighter Zero (Asia 950627)", 0 )
7215GAME( 1995, sfzj,     sfa,      cps2, cps2_2p6b, cps2,     ROT0,   "Capcom", "Street Fighter Zero (Japan 950727)", 0 )
7216GAME( 1995, sfzjr1,   sfa,      cps2, cps2_2p6b, cps2,     ROT0,   "Capcom", "Street Fighter Zero (Japan 950627)", 0 )
7217GAME( 1995, sfzjr2,   sfa,      cps2, cps2_2p6b, cps2,     ROT0,   "Capcom", "Street Fighter Zero (Japan 950605)", 0 )
7218GAME( 1995, sfzh,     sfa,      cps2, cps2_2p6b, cps2,     ROT0,   "Capcom", "Street Fighter Zero (Hispanic 950627)", 0 )
7219GAME( 1995, sfzb,     sfa,      cps2, cps2_2p6b, cps2,     ROT0,   "Capcom", "Street Fighter Zero (Brazil 951109)", 0 )
7220GAME( 1995, sfzbr1,   sfa,      cps2, cps2_2p6b, cps2,     ROT0,   "Capcom", "Street Fighter Zero (Brazil 950727)", 0 )
7221GAME( 1995, mmancp2u, megaman,  cps2, cps2_2p3b, cps2,     ROT0,   "Capcom", "Mega Man - The Power Battle (CPS2, USA 951006, SAMPLE Version)", 0 )
7222GAME( 1995, rmancp2j, megaman,  cps2, cps2_2p3b, cps2,     ROT0,   "Capcom", "Rockman: The Power Battle (CPS2, Japan 950922)", 0 )
7223GAME( 1996, 19xx,     0,        cps2, cps2_2p2b, cps2,     ROT270, "Capcom", "19XX: The War Against Destiny (USA 951207)", 0 )
7224GAME( 1996, 19xxa,    19xx,     cps2, cps2_2p2b, cps2,     ROT270, "Capcom", "19XX: The War Against Destiny (Asia 951207)", 0 )
7225GAME( 1996, 19xxj,    19xx,     cps2, cps2_2p2b, cps2,     ROT270, "Capcom", "19XX: The War Against Destiny (Japan 951225)", 0 )
7226GAME( 1996, 19xxjr1,  19xx,     cps2, cps2_2p2b, cps2,     ROT270, "Capcom", "19XX: The War Against Destiny (Japan 951207)", 0 )
7227GAME( 1996, 19xxh,    19xx,     cps2, cps2_2p2b, cps2,     ROT270, "Capcom", "19XX: The War Against Destiny (Hispanic 951218)", 0 )
7228GAME( 1996, 19xxb,    19xx,     cps2, cps2_2p2b, cps2,     ROT270, "Capcom", "19XX: The War Against Destiny (Brazil 951218)", 0 )
7229GAME( 1996, ddsom,    0,        cps2, cps2_4p4b, cps2,     ROT0,   "Capcom", "Dungeons & Dragons: Shadow over Mystara (Euro 960619)", 0 )
7230GAME( 1996, ddsomr1,  ddsom,    cps2, cps2_4p4b, cps2,     ROT0,   "Capcom", "Dungeons & Dragons: Shadow over Mystara (Euro 960223)", 0 )
7231GAME( 1996, ddsomr2,  ddsom,    cps2, cps2_4p4b, cps2,     ROT0,   "Capcom", "Dungeons & Dragons: Shadow over Mystara (Euro 960209)", 0 )
7232GAME( 1996, ddsomr3,  ddsom,    cps2, cps2_4p4b, cps2,     ROT0,   "Capcom", "Dungeons & Dragons: Shadow over Mystara (Euro 960208)", 0 )
7233GAME( 1996, ddsomu,   ddsom,    cps2, cps2_4p4b, cps2,     ROT0,   "Capcom", "Dungeons & Dragons: Shadow over Mystara (USA 960619)", 0 )
7234GAME( 1996, ddsomur1, ddsom,    cps2, cps2_4p4b, cps2,     ROT0,   "Capcom", "Dungeons & Dragons: Shadow over Mystara (USA 960209)", 0 )
7235GAME( 1996, ddsomj,   ddsom,    cps2, cps2_4p4b, cps2,     ROT0,   "Capcom", "Dungeons & Dragons: Shadow over Mystara (Japan 960619)", 0 )
7236GAME( 1996, ddsomjr1, ddsom,    cps2, cps2_4p4b, cps2,     ROT0,   "Capcom", "Dungeons & Dragons: Shadow over Mystara (Japan 960206)", 0 )
7237GAME( 1996, ddsoma,   ddsom,    cps2, cps2_4p4b, cps2,     ROT0,   "Capcom", "Dungeons & Dragons: Shadow over Mystara (Asia 960619)", 0 )
7238GAME( 1996, ddsomb,   ddsom,    cps2, cps2_4p4b, cps2,     ROT0,   "Capcom", "Dungeons & Dragons: Shadow over Mystara (Brazil 960223)", 0 )
7239GAME( 1996, megaman2, 0,        cps2, cps2_2p3b, cps2,     ROT0,   "Capcom", "Mega Man 2: The Power Fighters (USA 960708)", 0 )
7240GAME( 1996, megamn2a, megaman2, cps2, cps2_2p3b, cps2,     ROT0,   "Capcom", "Mega Man 2: The Power Fighters (Asia 960708)", 0 )
7241GAME( 1996, rckman2j, megaman2, cps2, cps2_2p3b, cps2,     ROT0,   "Capcom", "Rockman 2: The Power Fighters (Japan 960708)", 0 )
7242GAME( 1996, qndream,  0,        cps2, qndream,   cps2,     ROT0,   "Capcom", "Quiz Nanairo Dreams: Nijiirochou no Kiseki (Japan 960826)", 0 )
7243GAME( 1996, sfa2,     0,        cps2, cps2_2p6b, cps2,     ROT0,   "Capcom", "Street Fighter Alpha 2 (USA 960306)", 0 )
7244GAME( 1996, sfz2j,    sfa2,     cps2, cps2_2p6b, cps2,     ROT0,   "Capcom", "Street Fighter Zero 2 (Japan 960227)", 0 )
7245GAME( 1996, sfz2a,    sfa2,     cps2, cps2_2p6b, cps2,     ROT0,   "Capcom", "Street Fighter Zero 2 (Asia 960227)", 0 )
7246GAME( 1996, sfz2b,    sfa2,     cps2, cps2_2p6b, cps2,     ROT0,   "Capcom", "Street Fighter Zero 2 (Brazil 960531)", 0 )
7247GAME( 1996, sfz2br1,  sfa2,     cps2, cps2_2p6b, cps2,     ROT0,   "Capcom", "Street Fighter Zero 2 (Brazil 960304)", 0 )
7248GAME( 1996, sfz2h,    sfa2,     cps2, cps2_2p6b, cps2,     ROT0,   "Capcom", "Street Fighter Zero 2 (Hispanic 960304)", 0 )
7249GAME( 1996, sfz2n,    sfa2,     cps2, cps2_2p6b, cps2,     ROT0,   "Capcom", "Street Fighter Zero 2 (Oceania 960229)", 0 )
7250GAME( 1996, sfz2aj,   sfa2,     cps2, cps2_2p6b, cps2,     ROT0,   "Capcom", "Street Fighter Zero 2 Alpha (Japan 960805)", 0 )
7251GAME( 1996, sfz2ah,   sfa2,     cps2, cps2_2p6b, cps2,     ROT0,   "Capcom", "Street Fighter Zero 2 Alpha (Hispanic 960813)", 0 )
7252GAME( 1996, sfz2ab,   sfa2,     cps2, cps2_2p6b, cps2,     ROT0,   "Capcom", "Street Fighter Zero 2 Alpha (Brazil 960813)", 0 )
7253GAME( 1996, sfz2aa,   sfa2,     cps2, cps2_2p6b, cps2,     ROT0,   "Capcom", "Street Fighter Zero 2 Alpha (Asia 960826)", 0 )
7254GAME( 1996, spf2t,    0,        cps2, cps2_2p2b, cps2,     ROT0,   "Capcom", "Super Puzzle Fighter II Turbo (USA 960620)", 0 )
7255GAME( 1996, spf2xj,   spf2t,    cps2, cps2_2p2b, cps2,     ROT0,   "Capcom", "Super Puzzle Fighter II X (Japan 960531)", 0 )
7256GAME( 1996, spf2ta,   spf2t,    cps2, cps2_2p2b, cps2,     ROT0,   "Capcom", "Super Puzzle Fighter II Turbo (Asia 960529)", 0 )
7257GAME( 1996, xmvsf,    0,        cps2, cps2_2p6b, cps2,     ROT0,   "Capcom", "X-Men Vs. Street Fighter (Euro 961004)", 0 )
7258GAME( 1996, xmvsfr1,  xmvsf,    cps2, cps2_2p6b, cps2,     ROT0,   "Capcom", "X-Men Vs. Street Fighter (Euro 960910)", 0 )
7259GAME( 1996, xmvsfu,   xmvsf,    cps2, cps2_2p6b, cps2,     ROT0,   "Capcom", "X-Men Vs. Street Fighter (USA 961023)", 0 )
7260GAME( 1996, xmvsfur1, xmvsf,    cps2, cps2_2p6b, cps2,     ROT0,   "Capcom", "X-Men Vs. Street Fighter (USA 961004)", 0 )
7261GAME( 1996, xmvsfj,   xmvsf,    cps2, cps2_2p6b, cps2,     ROT0,   "Capcom", "X-Men Vs. Street Fighter (Japan 961004)", 0 )
7262GAME( 1996, xmvsfjr1, xmvsf,    cps2, cps2_2p6b, cps2,     ROT0,   "Capcom", "X-Men Vs. Street Fighter (Japan 960910)", 0 )
7263GAME( 1996, xmvsfjr2, xmvsf,    cps2, cps2_2p6b, cps2,     ROT0,   "Capcom", "X-Men Vs. Street Fighter (Japan 960909)", 0 )
7264GAME( 1996, xmvsfa,   xmvsf,    cps2, cps2_2p6b, cps2,     ROT0,   "Capcom", "X-Men Vs. Street Fighter (Asia 961023)", 0 )
7265GAME( 1996, xmvsfar1, xmvsf,    cps2, cps2_2p6b, cps2,     ROT0,   "Capcom", "X-Men Vs. Street Fighter (Asia 960919)", 0 )
7266GAME( 1996, xmvsfh,   xmvsf,    cps2, cps2_2p6b, cps2,     ROT0,   "Capcom", "X-Men Vs. Street Fighter (Hispanic 961004)", 0 )
7267GAME( 1996, xmvsfb,   xmvsf,    cps2, cps2_2p6b, cps2,     ROT0,   "Capcom", "X-Men Vs. Street Fighter (Brazil 961023)", 0 )
7268GAME( 1997, batcir,   0,        cps2, cps2_4p2b, cps2,     ROT0,   "Capcom", "Battle Circuit (Euro 970319)", 0 )
7269GAME( 1997, batcira,  batcir,   cps2, cps2_4p2b, cps2,     ROT0,   "Capcom", "Battle Circuit (Asia 970319)", 0 )
7270GAME( 1997, batcirj,  batcir,   cps2, cps2_4p2b, cps2,     ROT0,   "Capcom", "Battle Circuit (Japan 970319)", 0 )
7271GAME( 1997, csclub,   0,        cps2, cps2_2p3b, cps2,     ROT0,   "Capcom", "Capcom Sports Club (Euro 970722)", 0 )
7272GAME( 1997, cscluba,  csclub,   cps2, cps2_2p3b, cps2,     ROT0,   "Capcom", "Capcom Sports Club (Asia 970722)", 0 )
7273GAME( 1997, csclubj,  csclub,   cps2, cps2_2p3b, cps2,     ROT0,   "Capcom", "Capcom Sports Club (Japan 970722)", 0 )
7274GAME( 1997, csclubh,  csclub,   cps2, cps2_2p3b, cps2,     ROT0,   "Capcom", "Capcom Sports Club (Hispanic 970722)", 0 )
7275GAME( 1997, mshvsf,   0,        cps2, cps2_2p6b, cps2,     ROT0,   "Capcom", "Marvel Super Heroes Vs. Street Fighter (Euro 970625)", 0 )
7276GAME( 1997, mshvsfu,  mshvsf,   cps2, cps2_2p6b, cps2,     ROT0,   "Capcom", "Marvel Super Heroes Vs. Street Fighter (USA 970827)", 0 )
7277GAME( 1997, mshvsfu1, mshvsf,   cps2, cps2_2p6b, cps2,     ROT0,   "Capcom", "Marvel Super Heroes Vs. Street Fighter (USA 970625)", 0 )
7278GAME( 1997, mshvsfj,  mshvsf,   cps2, cps2_2p6b, cps2,     ROT0,   "Capcom", "Marvel Super Heroes Vs. Street Fighter (Japan 970707)", 0 )
7279GAME( 1997, mshvsfj1, mshvsf,   cps2, cps2_2p6b, cps2,     ROT0,   "Capcom", "Marvel Super Heroes Vs. Street Fighter (Japan 970702)", 0 )
7280GAME( 1997, mshvsfj2, mshvsf,   cps2, cps2_2p6b, cps2,     ROT0,   "Capcom", "Marvel Super Heroes Vs. Street Fighter (Japan 970625)", 0 )
7281GAME( 1997, mshvsfh,  mshvsf,   cps2, cps2_2p6b, cps2,     ROT0,   "Capcom", "Marvel Super Heroes Vs. Street Fighter (Hispanic 970625)", 0 )
7282GAME( 1997, mshvsfa,  mshvsf,   cps2, cps2_2p6b, cps2,     ROT0,   "Capcom", "Marvel Super Heroes Vs. Street Fighter (Asia 970625)", 0 )
7283GAME( 1997, mshvsfa1, mshvsf,   cps2, cps2_2p6b, cps2,     ROT0,   "Capcom", "Marvel Super Heroes Vs. Street Fighter (Asia 970620)", 0 )
7284GAME( 1997, mshvsfb,  mshvsf,   cps2, cps2_2p6b, cps2,     ROT0,   "Capcom", "Marvel Super Heroes Vs. Street Fighter (Brazil 970827)", 0 )
7285GAME( 1997, mshvsfb1, mshvsf,   cps2, cps2_2p6b, cps2,     ROT0,   "Capcom", "Marvel Super Heroes Vs. Street Fighter (Brazil 970625)", 0 )
7286GAME( 1997, sgemf,    0,        cps2, cps2_2p3b, cps2,     ROT0,   "Capcom", "Super Gem Fighter Mini Mix (USA 970904)", 0 )
7287GAME( 1997, pfghtj,   sgemf,    cps2, cps2_2p3b, cps2,     ROT0,   "Capcom", "Pocket Fighter (Japan 970904)", 0 )
7288GAME( 1997, sgemfa,   sgemf,    cps2, cps2_2p3b, cps2,     ROT0,   "Capcom", "Super Gem Fighter: Mini Mix (Asia 970904)", 0 )
7289GAME( 1997, sgemfh,   sgemf,    cps2, cps2_2p3b, cps2,     ROT0,   "Capcom", "Super Gem Fighter: Mini Mix (Hispanic 970904)", 0 )
7290GAME( 1997, vhunt2,   0,        cps2, cps2_2p6b, cps2,     ROT0,   "Capcom", "Vampire Hunter 2: Darkstalkers Revenge (Japan 970929)", 0 )
7291GAME( 1997, vhunt2r1, vhunt2,   cps2, cps2_2p6b, cps2,     ROT0,   "Capcom", "Vampire Hunter 2: Darkstalkers Revenge (Japan 970913)", 0 )
7292GAME( 1997, vsav,     0,        cps2, cps2_2p6b, cps2,     ROT0,   "Capcom", "Vampire Savior: The Lord of Vampire (Euro 970519)", 0 )
7293GAME( 1997, vsavu,    vsav,     cps2, cps2_2p6b, cps2,     ROT0,   "Capcom", "Vampire Savior: The Lord of Vampire (USA 970519)", 0 )
7294GAME( 1997, vsavj,    vsav,     cps2, cps2_2p6b, cps2,     ROT0,   "Capcom", "Vampire Savior: The Lord of Vampire (Japan 970519)", 0 )
7295GAME( 1997, vsava,    vsav,     cps2, cps2_2p6b, cps2,     ROT0,   "Capcom", "Vampire Savior: The Lord of Vampire (Asia 970519)", 0 )
7296GAME( 1997, vsavh,    vsav,     cps2, cps2_2p6b, cps2,     ROT0,   "Capcom", "Vampire Savior: The Lord of Vampire (Hispanic 970519)", 0 )
7297GAME( 1997, vsav2,    0,        cps2, cps2_2p6b, cps2,     ROT0,   "Capcom", "Vampire Savior 2: The Lord of Vampire (Japan 970913)", 0 )
7298GAME( 1998, mvsc,     0,        cps2, cps2_2p6b, cps2,     ROT0,   "Capcom", "Marvel Vs. Capcom: Clash of Super Heroes (Euro 980112)", 0 )
7299GAME( 1998, mvscu,    mvsc,     cps2, cps2_2p6b, cps2,     ROT0,   "Capcom", "Marvel Vs. Capcom: Clash of Super Heroes (USA 980123)", 0 )
7300GAME( 1998, mvscj,    mvsc,     cps2, cps2_2p6b, cps2,     ROT0,   "Capcom", "Marvel Vs. Capcom: Clash of Super Heroes (Japan 980123)", 0 )
7301GAME( 1998, mvscjr1,  mvsc,     cps2, cps2_2p6b, cps2,     ROT0,   "Capcom", "Marvel Vs. Capcom: Clash of Super Heroes (Japan 980112)", 0 )
7302GAME( 1998, mvsca,    mvsc,     cps2, cps2_2p6b, cps2,     ROT0,   "Capcom", "Marvel Vs. Capcom: Clash of Super Heroes (Asia 980123)", 0 )
7303GAME( 1998, mvscar1,  mvsc,     cps2, cps2_2p6b, cps2,     ROT0,   "Capcom", "Marvel Vs. Capcom: Clash of Super Heroes (Asia 980112)", 0 )
7304GAME( 1998, mvsch,    mvsc,     cps2, cps2_2p6b, cps2,     ROT0,   "Capcom", "Marvel Vs. Capcom: Clash of Super Heroes (Hispanic 980123)", 0 )
7305GAME( 1998, mvscb,    mvsc,     cps2, cps2_2p6b, cps2,     ROT0,   "Capcom", "Marvel Vs. Capcom: Clash of Super Heroes (Brazil 980123)", 0 )
7306GAME( 1998, sfa3,     0,        cps2, cps2_2p6b, cps2,     ROT0,   "Capcom", "Street Fighter Alpha 3 (Euro 980904)", 0 )
7307GAME( 1998, sfa3u,    sfa3,     cps2, cps2_2p6b, cps2,     ROT0,   "Capcom", "Street Fighter Alpha 3 (USA 980904)", 0 )
7308GAME( 1998, sfa3ur1,  sfa3,     cps2, cps2_2p6b, cps2,     ROT0,   "Capcom", "Street Fighter Alpha 3 (USA 980629)", 0 )
7309GAME( 1998, sfa3b,    sfa3,     cps2, cps2_2p6b, cps2,     ROT0,   "Capcom", "Street Fighter Alpha 3 (Brazil 980629)", 0 )
7310GAME( 1998, sfz3j,    sfa3,     cps2, cps2_2p6b, cps2,     ROT0,   "Capcom", "Street Fighter Zero 3 (Japan 980904)", 0 )
7311GAME( 1998, sfz3jr1,  sfa3,     cps2, cps2_2p6b, cps2,     ROT0,   "Capcom", "Street Fighter Zero 3 (Japan 980727)", 0 )
7312GAME( 1998, sfz3jr2,  sfa3,     cps2, cps2_2p6b, cps2,     ROT0,   "Capcom", "Street Fighter Zero 3 (Japan 980629)", 0 )
7313GAME( 1998, sfz3a,    sfa3,     cps2, cps2_2p6b, cps2,     ROT0,   "Capcom", "Street Fighter Zero 3 (Asia 980904)", 0 )
7314GAME( 1998, sfz3ar1,  sfa3,     cps2, cps2_2p6b, cps2,     ROT0,   "Capcom", "Street Fighter Zero 3 (Asia 980701)", 0 )
7315GAME( 1999, jyangoku, 0,        cps2, cps2_1p2b, cps2,     ROT0,   "Capcom", "Jyangokushi: Haoh no Saihai (Japan 990527)", 0 )
7316GAME( 2004, hsf2,     0,        cps2, cps2_2p6b, cps2,     ROT0,   "Capcom", "Hyper Street Fighter 2: The Anniversary Edition (Asia 040202)", 0 )
7317GAME( 2004, hsf2j,    hsf2,     cps2, cps2_2p6b, cps2,     ROT0,   "Capcom", "Hyper Street Fighter 2: The Anniversary Edition (Japan 031222)", 0 )
7318
73997319/* Games released on CPS-2 hardware by Takumi */
74007320
7401GAME( 1999, gigawing, 0,       cps2, 19xx,    cps2, ROT0,   "Capcom, supported by Takumi", "Giga Wing (USA 990222)", 0 )
7402GAME( 1999, gwingj,   gigawing,cps2, 19xx,    cps2, ROT0,   "Capcom, supported by Takumi", "Giga Wing (Japan 990223)", 0 )
7403GAME( 1999, gwinga,   gigawing,cps2, 19xx,    cps2, ROT0,   "Capcom, supported by Takumi", "Giga Wing (Asia 990222)", 0 )
7404GAME( 2000, mmatrix,  0,       cps2, 19xx,    cps2, ROT0,   "Capcom, supported by Takumi", "Mars Matrix: Hyper Solid Shooting (USA 000412)", 0 )
7405GAME( 2000, mmatrixj, mmatrix, cps2, 19xx,    cps2, ROT0,   "Capcom, supported by Takumi", "Mars Matrix: Hyper Solid Shooting (Japan 000412)", 0 )
7321GAME( 1999, gigawing, 0,        cps2, cps2_2p2b, cps2,     ROT0,   "Capcom, supported by Takumi", "Giga Wing (USA 990222)", 0 )
7322GAME( 1999, gwingj,   gigawing, cps2, cps2_2p2b, cps2,     ROT0,   "Capcom, supported by Takumi", "Giga Wing (Japan 990223)", 0 )
7323GAME( 1999, gwinga,   gigawing, cps2, cps2_2p2b, cps2,     ROT0,   "Capcom, supported by Takumi", "Giga Wing (Asia 990222)", 0 )
7324GAME( 2000, mmatrix,  0,        cps2, cps2_2p1b, cps2,     ROT0,   "Capcom, supported by Takumi", "Mars Matrix: Hyper Solid Shooting (USA 000412)", 0 )
7325GAME( 2000, mmatrixj, mmatrix,  cps2, cps2_2p1b, cps2,     ROT0,   "Capcom, supported by Takumi", "Mars Matrix: Hyper Solid Shooting (Japan 000412)", 0 )
74067326
74077327/* Games released on CPS-2 hardware by Mitchell */
74087328
7409GAME( 2000, mpang,    0,       cps2, ssf2,    cps2, ROT0,   "Mitchell, distributed by Capcom", "Mighty! Pang (USA 001010)", 0 )
7410GAME( 2000, mpangj,   mpang,   cps2, ssf2,    cps2, ROT0,   "Mitchell, distributed by Capcom", "Mighty! Pang (Japan 001011)", 0 )
7411GAME( 2001, pzloop2,  0,       cps2, puzloop2,puzloop2,ROT0,"Mitchell, distributed by Capcom", "Puzz Loop 2 (Euro 010302)", 0 )
7412GAME( 2001, pzloop2j, pzloop2, cps2, puzloop2,puzloop2,ROT0,"Mitchell, distributed by Capcom", "Puzz Loop 2 (Japan 010205)", 0 )
7413GAME( 2001, choko,    0,       cps2, cps2,    cps2, ROT0,   "Mitchell, distributed by Capcom", "Choko (Japan 010820)", 0 )
7329GAME( 2000, mpang,    0,        cps2, cps2_2p1b, cps2,     ROT0,   "Mitchell, distributed by Capcom", "Mighty! Pang (USA 001010)", 0 )
7330GAME( 2000, mpangj,   mpang,    cps2, cps2_2p1b, cps2,     ROT0,   "Mitchell, distributed by Capcom", "Mighty! Pang (Japan 001011)", 0 )
7331GAME( 2001, pzloop2,  0,        cps2, pzloop2,   pzloop2,  ROT0,   "Mitchell, distributed by Capcom", "Puzz Loop 2 (Euro 010302)", 0 )
7332GAME( 2001, pzloop2j, pzloop2,  cps2, pzloop2,   pzloop2,  ROT0,   "Mitchell, distributed by Capcom", "Puzz Loop 2 (Japan 010205)", 0 )
7333GAME( 2001, choko,    0,        cps2, choko,     cps2,     ROT0,   "Mitchell, distributed by Capcom", "Choko (Japan 010820)", 0 )
74147334
74157335/* Games released on CPS-2 hardware by Eighting/Raizing */
74167336
7417GAME( 2000, dimahoo,  0,       cps2, sgemf,   cps2, ROT270, "Eighting/Raizing, distributed by Capcom", "Dimahoo (Euro 000121)", 0 )
7418GAME( 2000, dimahoou, dimahoo, cps2, sgemf,   cps2, ROT270, "Eighting/Raizing, distributed by Capcom", "Dimahoo (USA 000121)", 0 )
7419GAME( 2000, gmahou,   dimahoo, cps2, sgemf,   cps2, ROT270, "Eighting/Raizing, distributed by Capcom", "Great Mahou Daisakusen (Japan 000121)", 0 )
7420GAME( 2000, 1944,     0,       cps2, 19xx,    cps2, ROT0,   "Capcom, supported by Eighting/Raizing", "1944: The Loop Master (USA 000620)", 0 )
7421GAME( 2000, 1944j,    1944,    cps2, 19xx,    cps2, ROT0,   "Capcom, supported by Eighting/Raizing", "1944: The Loop Master (Japan 000620)", 0 )
7337GAME( 2000, dimahoo,  0,        cps2, cps2_2p3b, cps2,     ROT270, "Eighting/Raizing, distributed by Capcom", "Dimahoo (Euro 000121)", 0 )
7338GAME( 2000, dimahoou, dimahoo,  cps2, cps2_2p3b, cps2,     ROT270, "Eighting/Raizing, distributed by Capcom", "Dimahoo (USA 000121)", 0 )
7339GAME( 2000, gmahou,   dimahoo,  cps2, cps2_2p3b, cps2,     ROT270, "Eighting/Raizing, distributed by Capcom", "Great Mahou Daisakusen (Japan 000121)", 0 )
7340GAME( 2000, 1944,     0,        cps2, cps2_2p2b, cps2,     ROT0,   "Capcom, supported by Eighting/Raizing", "1944: The Loop Master (USA 000620)", 0 )
7341GAME( 2000, 1944j,    1944,     cps2, cps2_2p2b, cps2,     ROT0,   "Capcom, supported by Eighting/Raizing", "1944: The Loop Master (Japan 000620)", 0 )
74227342
74237343/* Games released on CPS-2 hardware by Cave */
74247344
7425GAME( 2001, progear,  0,       cps2, sgemf,   cps2, ROT0,   "Capcom, supported by Cave", "Progear (USA 010117)", 0 )
7426GAME( 2001, progearj, progear, cps2, sgemf,   cps2, ROT0,   "Capcom, supported by Cave", "Progear no Arashi (Japan 010117)", 0 )
7427GAME( 2001, progeara, progear, cps2, sgemf,   cps2, ROT0,   "Capcom, supported by Cave", "Progear (Asia 010117)", 0 )
7345GAME( 2001, progear,  0,        cps2, cps2_2p3b, cps2,     ROT0,   "Capcom, supported by Cave", "Progear (USA 010117)", 0 )
7346GAME( 2001, progearj, progear,  cps2, cps2_2p3b, cps2,     ROT0,   "Capcom, supported by Cave", "Progear no Arashi (Japan 010117)", 0 )
7347GAME( 2001, progeara, progear,  cps2, cps2_2p3b, cps2,     ROT0,   "Capcom, supported by Cave", "Progear (Asia 010117)", 0 )
src/mame/drivers/hyperspt.c
r1679r1680
414414};
415415
416416static GFXDECODE_START( hyperspt )
417   GFXDECODE_ENTRY( REGION_GFX1, 0, hyperspt_charlayout,      0, 16 )
418   GFXDECODE_ENTRY( REGION_GFX2, 0, hyperspt_spritelayout, 16*16, 16 )
417   GFXDECODE_ENTRY( REGION_GFX1, 0, hyperspt_spritelayout,     0, 16 )
418   GFXDECODE_ENTRY( REGION_GFX2, 0, hyperspt_charlayout,    16*16, 16 )
419419GFXDECODE_END
420420
421421
r1679r1680
444444};
445445
446446static GFXDECODE_START( roadf )
447   GFXDECODE_ENTRY( REGION_GFX1, 0, roadf_charlayout,      0, 16 )
448   GFXDECODE_ENTRY( REGION_GFX2, 0, roadf_spritelayout, 16*16, 16 )
447   GFXDECODE_ENTRY( REGION_GFX1, 0, roadf_spritelayout,     0, 16 )
448   GFXDECODE_ENTRY( REGION_GFX2, 0, roadf_charlayout,    16*16, 16 )
449449GFXDECODE_END
450450
451451
r1679r1680
479479   MDRV_SCREEN_SIZE(32*8, 32*8)
480480   MDRV_SCREEN_VISIBLE_AREA(0*8, 32*8-1, 2*8, 30*8-1)
481481   MDRV_GFXDECODE(hyperspt)
482   MDRV_PALETTE_LENGTH(32)
483   MDRV_COLORTABLE_LENGTH(16*16+16*16)
482   MDRV_PALETTE_LENGTH(16*16+16*16)
484483
485484   MDRV_PALETTE_INIT(hyperspt)
486485   MDRV_VIDEO_START(hyperspt)
r1679r1680
528527   ROM_LOAD( "c10",          0x0000, 0x2000, CRC(3dc1a6ff) SHA1(1e67cac46b6c8a9a0bb1560e135983435520f1fc) )
529528   ROM_LOAD( "c09",          0x2000, 0x2000, CRC(9b525c3e) SHA1(d8775ec3b4f12117431a2b7c7eaa038c1255241b) )
530529
531   ROM_REGION( 0x08000, REGION_GFX1, ROMREGION_DISPOSE )
532   ROM_LOAD( "c26",          0x00000, 0x2000, CRC(a6897eac) SHA1(a1dd950c29885f7bb4784fed46810ae47bff87dd) )
533   ROM_LOAD( "c24",          0x02000, 0x2000, CRC(5fb230c0) SHA1(8caebf3788c1fb71c1ba72b0045503d45936d4ce) )
534   ROM_LOAD( "c22",          0x04000, 0x2000, CRC(ed9271a0) SHA1(a458ad79922383f45f6522775e19cf693e226883) )
535   ROM_LOAD( "c20",          0x06000, 0x2000, CRC(183f4324) SHA1(f6bcd03c25dea300876ace950f118a971557168f) )
536
537   ROM_REGION( 0x10000, REGION_GFX2, ROMREGION_DISPOSE )
530   ROM_REGION( 0x10000, REGION_GFX1, ROMREGION_DISPOSE )
538531   ROM_LOAD( "c14",          0x00000, 0x2000, CRC(c72d63be) SHA1(0677b4f7196551ebc1bbbecd0e15d79f8e32857d) )
539532   ROM_LOAD( "c13",          0x02000, 0x2000, CRC(76565608) SHA1(418fb9a81c0583d0214afb27fea28794563b8460) )
540533   ROM_LOAD( "c12",          0x04000, 0x2000, CRC(74d2cc69) SHA1(684b65455217f243b3690822d445efdcb18211bb) )
r1679r1680
544537   ROM_LOAD( "c16",          0x0c000, 0x2000, CRC(d7ff9f2b) SHA1(b0e6a056db96027ba0c10d3ee3bfdef145a236e2) )
545538   ROM_LOAD( "c15",          0x0e000, 0x2000, CRC(f3d454e6) SHA1(9d04dcd1b0354e01773923295bba2602e00467f9) )
546539
540   ROM_REGION( 0x08000, REGION_GFX2, ROMREGION_DISPOSE )
541   ROM_LOAD( "c26",          0x00000, 0x2000, CRC(a6897eac) SHA1(a1dd950c29885f7bb4784fed46810ae47bff87dd) )
542   ROM_LOAD( "c24",          0x02000, 0x2000, CRC(5fb230c0) SHA1(8caebf3788c1fb71c1ba72b0045503d45936d4ce) )
543   ROM_LOAD( "c22",          0x04000, 0x2000, CRC(ed9271a0) SHA1(a458ad79922383f45f6522775e19cf693e226883) )
544   ROM_LOAD( "c20",          0x06000, 0x2000, CRC(183f4324) SHA1(f6bcd03c25dea300876ace950f118a971557168f) )
545
547546   ROM_REGION( 0x0220, REGION_PROMS, 0 )
548547   ROM_LOAD( "c03_c27.bin",  0x0000, 0x0020, CRC(bc8a5956) SHA1(90746145d9f380c29919edea3ef7a8434c48c9d9) )
549548   ROM_LOAD( "j12_c28.bin",  0x0020, 0x0100, CRC(2c891d59) SHA1(79050fbe058c24349927edc7937ec68a77f450f1) )
r1679r1680
566565   ROM_LOAD( "c10",          0x0000, 0x2000, CRC(3dc1a6ff) SHA1(1e67cac46b6c8a9a0bb1560e135983435520f1fc) )
567566   ROM_LOAD( "c09",          0x2000, 0x2000, CRC(9b525c3e) SHA1(d8775ec3b4f12117431a2b7c7eaa038c1255241b) )
568567
569   ROM_REGION( 0x08000, REGION_GFX1, ROMREGION_DISPOSE )
570   ROM_LOAD( "c26",          0x00000, 0x2000, CRC(a6897eac) SHA1(a1dd950c29885f7bb4784fed46810ae47bff87dd) )
571   ROM_LOAD( "330e24.bin",   0x02000, 0x2000, CRC(f9bbfe1d) SHA1(f24a0c3e10e727e3e9fd123cda8bb557af1fea12) )
572   ROM_LOAD( "c22",          0x04000, 0x2000, CRC(ed9271a0) SHA1(a458ad79922383f45f6522775e19cf693e226883) )
573   ROM_LOAD( "330e20.bin",   0x06000, 0x2000, CRC(29969b92) SHA1(baf394c56b8a2855f32b9e6d7346faf50e75bcf2) )
574
575   ROM_REGION( 0x10000, REGION_GFX2, ROMREGION_DISPOSE )
568   ROM_REGION( 0x10000, REGION_GFX1, ROMREGION_DISPOSE )
576569   ROM_LOAD( "c14",          0x00000, 0x2000, CRC(c72d63be) SHA1(0677b4f7196551ebc1bbbecd0e15d79f8e32857d) )
577570   ROM_LOAD( "c13",          0x02000, 0x2000, CRC(76565608) SHA1(418fb9a81c0583d0214afb27fea28794563b8460) )
578571   ROM_LOAD( "c12",          0x04000, 0x2000, CRC(74d2cc69) SHA1(684b65455217f243b3690822d445efdcb18211bb) )
r1679r1680
582575   ROM_LOAD( "c16",          0x0c000, 0x2000, CRC(d7ff9f2b) SHA1(b0e6a056db96027ba0c10d3ee3bfdef145a236e2) )
583576   ROM_LOAD( "c15",          0x0e000, 0x2000, CRC(f3d454e6) SHA1(9d04dcd1b0354e01773923295bba2602e00467f9) )
584577
578   ROM_REGION( 0x08000, REGION_GFX2, ROMREGION_DISPOSE )
579   ROM_LOAD( "c26",          0x00000, 0x2000, CRC(a6897eac) SHA1(a1dd950c29885f7bb4784fed46810ae47bff87dd) )
580   ROM_LOAD( "330e24.bin",   0x02000, 0x2000, CRC(f9bbfe1d) SHA1(f24a0c3e10e727e3e9fd123cda8bb557af1fea12) )
581   ROM_LOAD( "c22",          0x04000, 0x2000, CRC(ed9271a0) SHA1(a458ad79922383f45f6522775e19cf693e226883) )
582   ROM_LOAD( "330e20.bin",   0x06000, 0x2000, CRC(29969b92) SHA1(baf394c56b8a2855f32b9e6d7346faf50e75bcf2) )
583
585584   ROM_REGION( 0x0220, REGION_PROMS, 0 )
586585   ROM_LOAD( "c03_c27.bin",  0x0000, 0x0020, CRC(bc8a5956) SHA1(90746145d9f380c29919edea3ef7a8434c48c9d9) )
587586   ROM_LOAD( "j12_c28.bin",  0x0020, 0x0100, CRC(2c891d59) SHA1(79050fbe058c24349927edc7937ec68a77f450f1) )
r1679r1680
603602   ROM_REGION( 0x10000, REGION_CPU2, 0 )
604603   ROM_LOAD( "a17_d10.bin",  0x0000, 0x2000, CRC(c33c927e) SHA1(f1a8522e3bfc3a07bb42408d2937a4129e4c3fee) )
605604
606   ROM_REGION( 0x0c000, REGION_GFX1, ROMREGION_DISPOSE )
605   ROM_REGION( 0x08000, REGION_GFX1, ROMREGION_DISPOSE )
606   ROM_LOAD( "j19_e14.bin",  0x00000, 0x4000, CRC(16d2bcff) SHA1(37c63faaaca43909bfb1e2ccb370efe4b276d8a9) )
607   ROM_LOAD( "g19_e18.bin",  0x04000, 0x4000, CRC(490685ff) SHA1(5ca0aa3771d60688671aae196f10f9feecb15106) )
608
609   ROM_REGION( 0x0c000, REGION_GFX2, ROMREGION_DISPOSE )
607610   ROM_LOAD( "a14_e26.bin",  0x00000, 0x4000, CRC(f5c738e2) SHA1(9f10be775791dee9801b1167f838a9110084842d) )
608611   ROM_LOAD( "a12_d24.bin",  0x04000, 0x2000, CRC(2d82c930) SHA1(fea26c00ad3acb1f44a5fdc79a7dd8ddce17d317) )
609612   ROM_LOAD( "c14_e22.bin",  0x06000, 0x4000, CRC(fbcfbeb9) SHA1(e5a938fc2fe2378d836dfe8ba516994cd5cf0bb5) )
610613   ROM_LOAD( "c12_d20.bin",  0x0a000, 0x2000, CRC(5e0cf994) SHA1(c81274d809c685ccf24108f56a4fa54146d4f493) )
611614
612   ROM_REGION( 0x08000, REGION_GFX2, ROMREGION_DISPOSE )
613   ROM_LOAD( "j19_e14.bin",  0x00000, 0x4000, CRC(16d2bcff) SHA1(37c63faaaca43909bfb1e2ccb370efe4b276d8a9) )
614   ROM_LOAD( "g19_e18.bin",  0x04000, 0x4000, CRC(490685ff) SHA1(5ca0aa3771d60688671aae196f10f9feecb15106) )
615
616615   ROM_REGION( 0x0220, REGION_PROMS, 0 )
617616   ROM_LOAD( "c03_c27.bin",  0x0000, 0x0020, CRC(45d5e352) SHA1(0f4d358aaffcb68193247090e82f093752730518) )
618617   ROM_LOAD( "j12_c28.bin",  0x0020, 0x0100, CRC(2955e01f) SHA1(b0652d177a45571edc5978143d4023e7b173b383) )
r1679r1680
631630   ROM_REGION( 0x10000, REGION_CPU2, 0 )
632631   ROM_LOAD( "a17_d10.bin",  0x0000, 0x2000, CRC(c33c927e) SHA1(f1a8522e3bfc3a07bb42408d2937a4129e4c3fee) )
633632
634   ROM_REGION( 0x0c000, REGION_GFX1, ROMREGION_DISPOSE )
633   ROM_REGION( 0x08000, REGION_GFX1, ROMREGION_DISPOSE )
634   ROM_LOAD( "j19_e14.bin",  0x00000, 0x4000, CRC(16d2bcff) SHA1(37c63faaaca43909bfb1e2ccb370efe4b276d8a9) )
635   ROM_LOAD( "g19_e18.bin",  0x04000, 0x4000, CRC(490685ff) SHA1(5ca0aa3771d60688671aae196f10f9feecb15106) )
636
637   ROM_REGION( 0x0c000, REGION_GFX2, ROMREGION_DISPOSE )
635638   ROM_LOAD( "a14_e26.bin",  0x00000, 0x4000, CRC(f5c738e2) SHA1(9f10be775791dee9801b1167f838a9110084842d) )
636639   ROM_LOAD( "a12_d24.bin",  0x04000, 0x2000, CRC(2d82c930) SHA1(fea26c00ad3acb1f44a5fdc79a7dd8ddce17d317) )
637640   ROM_LOAD( "c14_e22.bin",  0x06000, 0x4000, CRC(fbcfbeb9) SHA1(e5a938fc2fe2378d836dfe8ba516994cd5cf0bb5) )
638641   ROM_LOAD( "c12_d20.bin",  0x0a000, 0x2000, CRC(5e0cf994) SHA1(c81274d809c685ccf24108f56a4fa54146d4f493) )
639642
640   ROM_REGION( 0x08000, REGION_GFX2, ROMREGION_DISPOSE )
641   ROM_LOAD( "j19_e14.bin",  0x00000, 0x4000, CRC(16d2bcff) SHA1(37c63faaaca43909bfb1e2ccb370efe4b276d8a9) )
642   ROM_LOAD( "g19_e18.bin",  0x04000, 0x4000, CRC(490685ff) SHA1(5ca0aa3771d60688671aae196f10f9feecb15106) )
643
644643   ROM_REGION( 0x0220, REGION_PROMS, 0 )
645644   ROM_LOAD( "c03_c27.bin",  0x0000, 0x0020, CRC(45d5e352) SHA1(0f4d358aaffcb68193247090e82f093752730518) )
646645   ROM_LOAD( "j12_c28.bin",  0x0020, 0x0100, CRC(2955e01f) SHA1(b0652d177a45571edc5978143d4023e7b173b383) )
src/mame/drivers/toaplan1.c
r1679r1680
1919    hellfir1    B90         HellFire (1 Player version) Uses Taito rom ID number
2020    hellfir2    B90         HellFire (2 Player, ealier version) Uses Taito rom ID number
2121    zerowing    TP-015      Zero Wing
22    zerowng2    TP-015      Zero Wing (2 player simultaneous version, Williams Electronics Games, Inc)
2223    demonwld    TP-016      Demon's World/Horror Story [1990]
2324    demonwl1    TP-016      Demon's World/Horror Story [1989] (Taito license)
2425    fireshrk    TP-017      Fire Shark (World)           [1990]
r1679r1680
545546
546547   TOAPLAN1_PLAYER_INPUT( 2, IPT_UNKNOWN, )
547548
548   PORT_START      /* DSW A */
549   PORT_START_TAG("DSWA")      /* DSW A */
549550   PORT_DIPNAME( 0x01, 0x00, DEF_STR( Unused ) )
550551   PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
551552   PORT_DIPSETTING(    0x01, DEF_STR( On ) )
r1679r1680
567568   PORT_DIPSETTING(    0x80, DEF_STR( 1C_4C ) )
568569   PORT_DIPSETTING(    0xc0, DEF_STR( 1C_6C ) )
569570
570   PORT_START      /* DSWB */
571   PORT_START_TAG("DSWB")      /* DSWB */
571572   PORT_DIPNAME( 0x03, 0x00, DEF_STR( Difficulty ) )
572573   PORT_DIPSETTING(    0x01, DEF_STR( Easy ) )
573574   PORT_DIPSETTING(    0x00, DEF_STR( Medium ) )
r1679r1680
592593
593594   TOAPLAN1_SYSTEM_INPUTS
594595
595   PORT_START      /* Territory Jumper block */
596   PORT_START_TAG("TJUMP")      /* Territory Jumper block */
596597   PORT_DIPNAME( 0x03, 0x02, "Territory" )
597598   PORT_DIPSETTING(    0x02, DEF_STR( Europe ) )
598599//  PORT_DIPSETTING(    0x03, DEF_STR( Europe ) )
r1679r1680
608609INPUT_PORTS_END
609610
610611static INPUT_PORTS_START( hellfir1 )
611   TOAPLAN1_VBLANK_INPUT
612   PORT_INCLUDE( hellfire )
612613
613   TOAPLAN1_PLAYER_INPUT( 1, IPT_UNKNOWN, )
614
615   TOAPLAN1_PLAYER_INPUT( 2, IPT_UNKNOWN, )
616
617   PORT_START      /* DSW A */
614   PORT_MODIFY("DSWA")
618615   PORT_DIPNAME( 0x01, 0x01, DEF_STR( Cabinet ) )
619616   PORT_DIPSETTING(    0x01, DEF_STR( Upright ) )
620617   PORT_DIPSETTING(    0x00, DEF_STR( Cocktail ) )
621   PORT_DIPNAME( 0x02, 0x00, DEF_STR( Flip_Screen ) )
622   PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
623   PORT_DIPSETTING(    0x02, DEF_STR( On ) )
624   PORT_SERVICE( 0x04, IP_ACTIVE_HIGH )
625   PORT_DIPNAME( 0x08, 0x00, DEF_STR( Demo_Sounds ) )
626   PORT_DIPSETTING(    0x08, DEF_STR( Off ) )
627   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
628   PORT_DIPNAME( 0x30, 0x00, DEF_STR( Coin_A ) )
629   PORT_DIPSETTING(    0x30, DEF_STR( 4C_1C ) )
630   PORT_DIPSETTING(    0x20, DEF_STR( 3C_1C ) )
631   PORT_DIPSETTING(    0x10, DEF_STR( 2C_1C ) )
632   PORT_DIPSETTING(    0x00, DEF_STR( 1C_1C ) )
633   PORT_DIPNAME( 0xc0, 0x00, DEF_STR( Coin_B ) )
634   PORT_DIPSETTING(    0x00, DEF_STR( 1C_2C ) )
635   PORT_DIPSETTING(    0x40, DEF_STR( 1C_3C ) )
636   PORT_DIPSETTING(    0x80, DEF_STR( 1C_4C ) )
637   PORT_DIPSETTING(    0xc0, DEF_STR( 1C_6C ) )
638
639   PORT_START      /* DSWB */
640   PORT_DIPNAME( 0x03, 0x00, DEF_STR( Difficulty ) )
641   PORT_DIPSETTING(    0x01, DEF_STR( Easy ) )
642   PORT_DIPSETTING(    0x00, DEF_STR( Medium ) )
643   PORT_DIPSETTING(    0x02, DEF_STR( Hard ) )
644   PORT_DIPSETTING(    0x03, DEF_STR( Hardest ) )
645   PORT_DIPNAME( 0x0c, 0x00, DEF_STR( Bonus_Life ) )
646   PORT_DIPSETTING(    0x00, "70K, every 200K" )
647   PORT_DIPSETTING(    0x04, "100K, every 250K" )
648   PORT_DIPSETTING(    0x08, "100K" )
649   PORT_DIPSETTING(    0x0c, "200K" )
650   PORT_DIPNAME( 0x30, 0x00, DEF_STR( Lives ) )
651   PORT_DIPSETTING(    0x30, "2" )
652   PORT_DIPSETTING(    0x00, "3" )
653   PORT_DIPSETTING(    0x20, "4" )
654   PORT_DIPSETTING(    0x10, "5" )
655   PORT_DIPNAME( 0x40, 0x00, "Invulnerability" )
656   PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
657   PORT_DIPSETTING(    0x40, DEF_STR( On ) )
658   PORT_DIPNAME( 0x80, 0x00, DEF_STR( Allow_Continue ) )
659   PORT_DIPSETTING(    0x80, DEF_STR( No ) )
660   PORT_DIPSETTING(    0x00, DEF_STR( Yes ) )
661
662   TOAPLAN1_SYSTEM_INPUTS
663
664   PORT_START      /* Territory Jumper block */
665   PORT_DIPNAME( 0x03, 0x02, "Territory" )
666   PORT_DIPSETTING(    0x02, DEF_STR( Europe ) )
667//  PORT_DIPSETTING(    0x03, DEF_STR( Europe ) )
668   PORT_DIPSETTING(    0x01, "US" )
669   PORT_DIPSETTING(    0x00, DEF_STR( Japan ) )
670   PORT_DIPNAME( 0x04, 0x00, DEF_STR( Unused ) )
671   PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
672   PORT_DIPSETTING(    0x04, DEF_STR( On ) )
673   PORT_DIPNAME( 0x08, 0x00, DEF_STR( Unused ) )
674   PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
675   PORT_DIPSETTING(    0x08, DEF_STR( On ) )
676   PORT_BIT( 0xf0, IP_ACTIVE_HIGH, IPT_UNKNOWN )
677618INPUT_PORTS_END
678619
679620static INPUT_PORTS_START( zerowing )
r1679r1680
683624
684625   TOAPLAN1_PLAYER_INPUT( 2, IPT_UNKNOWN, PORT_COCKTAIL )
685626
686   PORT_START      /* DSW A */
627   PORT_START_TAG("DSWA")      /* DSW A */
687628   PORT_DIPNAME( 0x01, 0x01, DEF_STR( Cabinet ) )
688629   PORT_DIPSETTING(    0x01, DEF_STR( Upright ) )
689630   PORT_DIPSETTING(    0x00, DEF_STR( Cocktail ) )
r1679r1680
705646   PORT_DIPSETTING(    0x80, DEF_STR( 1C_4C ) )
706647   PORT_DIPSETTING(    0xc0, DEF_STR( 1C_6C ) )
707648
708   PORT_START      /* DSW B */
649   PORT_START_TAG("DSWB")      /* DSW B */
709650   PORT_DIPNAME( 0x03, 0x00, DEF_STR( Difficulty ) )
710651   PORT_DIPSETTING(    0x01, DEF_STR( Easy ) )
711652   PORT_DIPSETTING(    0x00, DEF_STR( Medium ) )
r1679r1680
730671
731672   TOAPLAN1_SYSTEM_INPUTS
732673
733   PORT_START      /* Territory Jumper block */
674   PORT_START_TAG("TJUMP")      /* Territory Jumper block */
734675   PORT_DIPNAME( 0x03, 0x02, "Territory" )
735676   PORT_DIPSETTING(    0x02, DEF_STR( Europe ) )
736677//  PORT_DIPSETTING(    0x03, DEF_STR( Europe ) )
r1679r1680
745686   PORT_BIT( 0xf0, IP_ACTIVE_HIGH, IPT_UNKNOWN )
746687INPUT_PORTS_END
747688
689
690static INPUT_PORTS_START( zerowng2 ) /* Always shows "Williams Electronics Games, Inc" */
691   PORT_INCLUDE( zerowing )
692
693   PORT_MODIFY("TJUMP")      /* Territory Jumper block */
694   PORT_DIPNAME( 0x01, 0x00, DEF_STR( Unused ) )
695   PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
696   PORT_DIPSETTING(    0x01, DEF_STR( On ) )
697   PORT_DIPNAME( 0x02, 0x00, DEF_STR( Unused ) )
698   PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
699   PORT_DIPSETTING(    0x02, DEF_STR( On ) )
700INPUT_PORTS_END
701
748702static INPUT_PORTS_START( demonwld )
749703   TOAPLAN1_VBLANK_INPUT
750704
r1679r1680
752706
753707   TOAPLAN1_PLAYER_INPUT( 2, IPT_BUTTON3, )
754708
755   PORT_START      /* DSW A */
709   PORT_START_TAG("DSWA")      /* DSW A */
756710   PORT_DIPNAME( 0x01, 0x00, DEF_STR( Unused ) )
757711   PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
758712   PORT_DIPSETTING(    0x01, DEF_STR( On ) )
r1679r1680
774728   PORT_DIPSETTING(    0x80, DEF_STR( 1C_4C ) )
775729   PORT_DIPSETTING(    0xc0, DEF_STR( 1C_6C ) )
776730
777   PORT_START      /* DSW B */
731   PORT_START_TAG("DSWB")      /* DSW B */
778732   PORT_DIPNAME( 0x03, 0x00, DEF_STR( Difficulty ) )
779733   PORT_DIPSETTING(    0x01, DEF_STR( Easy ) )
780734   PORT_DIPSETTING(    0x00, DEF_STR( Medium ) )
r1679r1680
799753
800754   TOAPLAN1_SYSTEM_INPUTS
801755
802   PORT_START      /* Territory Jumper Block */
756   PORT_START_TAG("TJUMP")      /* Territory Jumper Block */
803757   PORT_DIPNAME( 0x01, 0x01, "Territory/Copyright" )
804758   PORT_DIPSETTING(    0x01, "Toaplan" )
805759   PORT_DIPSETTING(    0x00, "Japan/Taito Corp" )
r1679r1680
816770INPUT_PORTS_END
817771
818772static INPUT_PORTS_START( demonwl1 )
819   TOAPLAN1_VBLANK_INPUT
773   PORT_INCLUDE( demonwld )
820774
821   TOAPLAN1_PLAYER_INPUT( 1, IPT_BUTTON3, )
822
823   TOAPLAN1_PLAYER_INPUT( 2, IPT_BUTTON3, )
824
825   PORT_START      /* DSW A */
826   PORT_DIPNAME( 0x01, 0x00, DEF_STR( Unused ) )
827   PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
828   PORT_DIPSETTING(    0x01, DEF_STR( On ) )
829   PORT_DIPNAME( 0x02, 0x00, DEF_STR( Flip_Screen ) )
830   PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
831   PORT_DIPSETTING(    0x02, DEF_STR( On ) )
832   PORT_SERVICE( 0x04, IP_ACTIVE_HIGH )
833   PORT_DIPNAME( 0x08, 0x00, DEF_STR( Demo_Sounds ) )
834   PORT_DIPSETTING(    0x08, DEF_STR( Off ) )
835   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
836   PORT_DIPNAME( 0x30, 0x00, DEF_STR( Coin_A ) )
837   PORT_DIPSETTING(    0x30, DEF_STR( 4C_1C ) )
838   PORT_DIPSETTING(    0x20, DEF_STR( 3C_1C ) )
839   PORT_DIPSETTING(    0x10, DEF_STR( 2C_1C ) )
840   PORT_DIPSETTING(    0x00, DEF_STR( 1C_1C ) )
841   PORT_DIPNAME( 0xc0, 0x00, DEF_STR( Coin_B ) )
842   PORT_DIPSETTING(    0x00, DEF_STR( 1C_2C ) )
843   PORT_DIPSETTING(    0x40, DEF_STR( 1C_3C ) )
844   PORT_DIPSETTING(    0x80, DEF_STR( 1C_4C ) )
845   PORT_DIPSETTING(    0xc0, DEF_STR( 1C_6C ) )
846
847   PORT_START      /* DSW B */
848   PORT_DIPNAME( 0x03, 0x00, DEF_STR( Difficulty ) )
849   PORT_DIPSETTING(    0x01, DEF_STR( Easy ) )
850   PORT_DIPSETTING(    0x00, DEF_STR( Medium ) )
851   PORT_DIPSETTING(    0x02, DEF_STR( Hard ) )
852   PORT_DIPSETTING(    0x03, DEF_STR( Hardest ) )
853   PORT_DIPNAME( 0x0c, 0x00, DEF_STR( Bonus_Life ) )
854   PORT_DIPSETTING(    0x00, "30K, every 100K" )
855   PORT_DIPSETTING(    0x04, "50K and 100K" )
856   PORT_DIPSETTING(    0x08, "100K only" )
857   PORT_DIPSETTING(    0x0c, DEF_STR( None ) )
858   PORT_DIPNAME( 0x30, 0x00, DEF_STR( Lives ) )
859   PORT_DIPSETTING(    0x30, "1" )
860   PORT_DIPSETTING(    0x20, "2" )
861   PORT_DIPSETTING(    0x00, "3" )
862   PORT_DIPSETTING(    0x10, "5" )
863   PORT_DIPNAME( 0x40, 0x00, "Invulnerability" )
864   PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
865   PORT_DIPSETTING(    0x40, DEF_STR( On ) )
866   PORT_DIPNAME( 0x80, 0x00, DEF_STR( Unused ) )
867   PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
868   PORT_DIPSETTING(    0x80, DEF_STR( On ) )
869
870   TOAPLAN1_SYSTEM_INPUTS
871
872   PORT_START      /* Territory Jumper Block */
775   PORT_MODIFY("TJUMP")      /* Territory Jumper Block */
873776   PORT_DIPNAME( 0x03, 0x02, "Territory/Copyright" )
874777   PORT_DIPSETTING(    0x02, "World/Taito Japan" )
875778   PORT_DIPSETTING(    0x03, "US/Toaplan" )
876779   PORT_DIPSETTING(    0x01, "US/Taito America" )
877780   PORT_DIPSETTING(    0x00, "Japan/Taito Corp" )
878   PORT_DIPNAME( 0x04, 0x00, DEF_STR( Unknown ) )
879   PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
880   PORT_DIPSETTING(    0x04, DEF_STR( On ) )
881   PORT_DIPNAME( 0x08, 0x00, DEF_STR( Unknown ) )
882   PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
883   PORT_DIPSETTING(    0x08, DEF_STR( On ) )
884   PORT_BIT( 0xf0, IP_ACTIVE_HIGH, IPT_UNKNOWN )
885781INPUT_PORTS_END
886782
887783static INPUT_PORTS_START( samesame )
r1679r1680
891787
892788   TOAPLAN1_PLAYER_INPUT( 2, IPT_UNKNOWN, PORT_COCKTAIL )
893789
894   PORT_START      /* DSW A */
790   PORT_START_TAG("DSWA")      /* DSW A */
895791   PORT_DIPNAME( 0x01, 0x01, DEF_STR( Cabinet ) )
896792   PORT_DIPSETTING(    0x01, DEF_STR( Upright ) )
897793   PORT_DIPSETTING(    0x00, DEF_STR( Cocktail ) )
r1679r1680
927823    PORT_DIPSETTING(    0x40, DEF_STR( 1C_2C ) )
928824*/
929825
930   PORT_START      /* DSW B */
826   PORT_START_TAG("DSWB")      /* DSW B */
931827   PORT_DIPNAME( 0x03, 0x00, DEF_STR( Difficulty ) )
932828   PORT_DIPSETTING(    0x01, DEF_STR( Easy ) )
933829   PORT_DIPSETTING(    0x00, DEF_STR( Medium ) )
r1679r1680
952848
953849   TOAPLAN1_SYSTEM_INPUTS
954850
955   PORT_START      /* Territory Jumper Block */
851   PORT_START_TAG("TJUMP")      /* Territory Jumper Block */
956852   PORT_DIPNAME( 0x01, 0x00, DEF_STR( Unknown ) )
957853   PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
958854   PORT_DIPSETTING(    0x01, DEF_STR( On ) )
r1679r1680
969865INPUT_PORTS_END
970866
971867static INPUT_PORTS_START( samesam2 )
972   TOAPLAN1_VBLANK_INPUT
868   PORT_INCLUDE( samesame )
973869
974   TOAPLAN1_PLAYER_INPUT( 1, IPT_UNKNOWN, )
975
976   TOAPLAN1_PLAYER_INPUT( 2, IPT_UNKNOWN, )
977
978   PORT_START      /* DSW A */
979   PORT_DIPNAME( 0x01, 0x00, DEF_STR( Unknown ) )
980   PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
981   PORT_DIPSETTING(    0x01, DEF_STR( On ) )
982   PORT_DIPNAME( 0x02, 0x00, DEF_STR( Flip_Screen ) )
983   PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
984   PORT_DIPSETTING(    0x02, DEF_STR( On ) )
985   PORT_SERVICE( 0x04, IP_ACTIVE_HIGH )
986   PORT_DIPNAME( 0x08, 0x00, DEF_STR( Demo_Sounds ) )
987   PORT_DIPSETTING(    0x08, DEF_STR( Off ) )
988   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
989   PORT_DIPNAME( 0x10, 0x00, DEF_STR( Unknown ) )
990   PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
991   PORT_DIPSETTING(    0x10, DEF_STR( On ) )
992   PORT_DIPNAME( 0x20, 0x00, DEF_STR( Unknown ) )
993   PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
994   PORT_DIPSETTING(    0x20, DEF_STR( On ) )
995   PORT_DIPNAME( 0x40, 0x00, DEF_STR( Unknown ) )
996   PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
997   PORT_DIPSETTING(    0x40, DEF_STR( On ) )
998   PORT_DIPNAME( 0x80, 0x00, DEF_STR( Unknown ) )
999   PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
1000   PORT_DIPSETTING(    0x80, DEF_STR( On ) )
1001/* settings listed in service mode, but not actually used ???
1002    PORT_DIPNAME( 0x30, 0x00, DEF_STR( Coin_A ) )
1003    PORT_DIPSETTING(    0x20, DEF_STR( 2C_1C ) )
1004    PORT_DIPSETTING(    0x00, DEF_STR( 1C_1C ) )
1005    PORT_DIPSETTING(    0x30, DEF_STR( 2C_3C ) )
1006    PORT_DIPSETTING(    0x10, DEF_STR( 1C_2C ) )
1007    PORT_DIPNAME( 0xc0, 0x00, DEF_STR( Coin_B ) )
1008    PORT_DIPSETTING(    0x80, DEF_STR( 2C_1C ) )
1009    PORT_DIPSETTING(    0x00, DEF_STR( 1C_1C ) )
1010    PORT_DIPSETTING(    0xc0, DEF_STR( 2C_3C ) )
1011    PORT_DIPSETTING(    0x40, DEF_STR( 1C_2C ) )
1012*/
1013
1014   PORT_START      /* DSW B */
1015   PORT_DIPNAME( 0x03, 0x00, DEF_STR( Difficulty ) )
1016   PORT_DIPSETTING(    0x01, DEF_STR( Easy ) )
1017   PORT_DIPSETTING(    0x00, DEF_STR( Medium ) )
1018   PORT_DIPSETTING(    0x02, DEF_STR( Hard ) )
1019   PORT_DIPSETTING(    0x03, DEF_STR( Hardest ) )
1020   PORT_DIPNAME( 0x0c, 0x00, DEF_STR( Bonus_Life ) )
1021   PORT_DIPSETTING(    0x04, "50K, every 150K" )
1022   PORT_DIPSETTING(    0x00, "70K, every 200K" )
1023   PORT_DIPSETTING(    0x08, "100K" )
1024   PORT_DIPSETTING(    0x0c, DEF_STR( None ) )
1025   PORT_DIPNAME( 0x30, 0x00, DEF_STR( Lives ) )
1026   PORT_DIPSETTING(    0x30, "2" )
1027   PORT_DIPSETTING(    0x00, "3" )
1028   PORT_DIPSETTING(    0x20, "4" )
1029   PORT_DIPSETTING(    0x10, "5" )
1030   PORT_DIPNAME( 0x40, 0x00, "Invulnerability" )
1031   PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
1032   PORT_DIPSETTING(    0x40, DEF_STR( On ) )
1033   PORT_DIPNAME( 0x80, 0x00, DEF_STR( Unknown ) )
1034   PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
1035   PORT_DIPSETTING(    0x80, DEF_STR( On ) )
1036
1037   TOAPLAN1_SYSTEM_INPUTS
1038
1039   PORT_START      /* Territory Jumper Block */
870   PORT_MODIFY("TJUMP")      /* Territory Jumper Block */
1040871/* settings listed in service mode, but not actually used
1041872    PORT_DIPNAME( 0x03, 0x00, "Territory" )
1042873//  PORT_DIPSETTING(    0x01, DEF_STR( Europe ) )
r1679r1680
1050881//  PORT_DIPNAME( 0x02, 0x00, "Show Territory Notice" ) /* Same as Bit 1 */
1051882//  PORT_DIPSETTING(    0x02, DEF_STR( No ) )
1052883//  PORT_DIPSETTING(    0x00, DEF_STR( Yes ) )
1053   PORT_DIPNAME( 0x04, 0x00, DEF_STR( Unknown ) )
1054   PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
1055   PORT_DIPSETTING(    0x04, DEF_STR( On ) )
1056   PORT_DIPNAME( 0x08, 0x00, DEF_STR( Unknown ) )
1057   PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
1058   PORT_DIPSETTING(    0x08, DEF_STR( On ) )
1059884   PORT_BIT( 0xf2, IP_ACTIVE_HIGH, IPT_UNKNOWN )   /* Mask bit 2 aswell */
1060885INPUT_PORTS_END
1061886
1062887static INPUT_PORTS_START( fireshrk )
1063   TOAPLAN1_VBLANK_INPUT
888   PORT_INCLUDE( samesame )
1064889
1065   TOAPLAN1_PLAYER_INPUT( 1, IPT_UNKNOWN, )
1066
1067   TOAPLAN1_PLAYER_INPUT( 2, IPT_UNKNOWN, )
1068
1069   PORT_START      /* DSW A */
1070   PORT_DIPNAME( 0x01, 0x00, DEF_STR( Unused ) )
1071   PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
1072   PORT_DIPSETTING(    0x01, DEF_STR( On ) )
1073   PORT_DIPNAME( 0x02, 0x00, DEF_STR( Flip_Screen ) )
1074   PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
1075   PORT_DIPSETTING(    0x02, DEF_STR( On ) )
1076   PORT_SERVICE( 0x04, IP_ACTIVE_HIGH )
1077   PORT_DIPNAME( 0x08, 0x00, DEF_STR( Demo_Sounds ) )
1078   PORT_DIPSETTING(    0x08, DEF_STR( Off ) )
1079   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
890   PORT_MODIFY("DSWA")      /* DSW A */
1080891   PORT_DIPNAME( 0x30, 0x00, DEF_STR( Coin_A ) )
1081892   PORT_DIPSETTING(    0x30, DEF_STR( 4C_1C ) )
1082893   PORT_DIPSETTING(    0x20, DEF_STR( 3C_1C ) )
r1679r1680
1088899   PORT_DIPSETTING(    0x80, DEF_STR( 1C_4C ) )
1089900   PORT_DIPSETTING(    0xc0, DEF_STR( 1C_6C ) )
1090901
1091   PORT_START      /* DSW B */
1092   PORT_DIPNAME( 0x03, 0x00, DEF_STR( Difficulty ) )
1093   PORT_DIPSETTING(    0x01, DEF_STR( Easy ) )
1094   PORT_DIPSETTING(    0x00, DEF_STR( Medium ) )
1095   PORT_DIPSETTING(    0x02, DEF_STR( Hard ) )
1096   PORT_DIPSETTING(    0x03, DEF_STR( Hardest ) )
1097   PORT_DIPNAME( 0x0c, 0x00, DEF_STR( Bonus_Life ) )
1098   PORT_DIPSETTING(    0x04, "50K, every 150K" )
1099   PORT_DIPSETTING(    0x00, "70K, every 200K" )
1100   PORT_DIPSETTING(    0x08, "100K" )
1101   PORT_DIPSETTING(    0x0c, DEF_STR( None ) )
1102   PORT_DIPNAME( 0x30, 0x00, DEF_STR( Lives ) )
1103   PORT_DIPSETTING(    0x30, "2" )
1104   PORT_DIPSETTING(    0x00, "3" )
1105   PORT_DIPSETTING(    0x20, "4" )
1106   PORT_DIPSETTING(    0x10, "5" )
1107   PORT_DIPNAME( 0x40, 0x00, "Invulnerability" )
1108   PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
1109   PORT_DIPSETTING(    0x40, DEF_STR( On ) )
1110   PORT_DIPNAME( 0x80,   0x00, DEF_STR( Unused ) )
1111   PORT_DIPSETTING(   0x00, DEF_STR( Off ) )
1112   PORT_DIPSETTING(   0x80, DEF_STR( On ) )
1113
1114   TOAPLAN1_SYSTEM_INPUTS
1115
1116   PORT_START      /* Territory Jumper Block */
1117   PORT_DIPNAME( 0x01, 0x00, DEF_STR( Unknown ) )
1118   PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
1119   PORT_DIPSETTING(    0x01, DEF_STR( On ) )
902   PORT_MODIFY("TJUMP")      /* Territory Jumper Block */
1120903   PORT_DIPNAME( 0x06, 0x02, "Territory" )
1121904   PORT_DIPSETTING(    0x02, DEF_STR( Europe ) )
1122905   PORT_DIPSETTING(    0x04, DEF_STR( USA ) )
1123906   PORT_DIPSETTING(    0x00, "USA (Romstar)" )
1124   PORT_DIPNAME( 0x08, 0x00, DEF_STR( Unknown ) )
1125   PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
1126   PORT_DIPSETTING(    0x08, DEF_STR( On ) )
1127   PORT_BIT( 0xf0, IP_ACTIVE_HIGH, IPT_UNKNOWN )
1128907INPUT_PORTS_END
1129908
1130909static INPUT_PORTS_START( outzone )
r1679r1680
1134913
1135914   TOAPLAN1_PLAYER_INPUT( 2, IPT_BUTTON3, )
1136915
1137   PORT_START      /* DSW A */
916   PORT_START_TAG("DSWA")      /* DSW A */
1138917   PORT_DIPNAME( 0x01, 0x00, DEF_STR( Unused ) )
1139918   PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
1140919   PORT_DIPSETTING(    0x01, DEF_STR( On ) )
r1679r1680
1156935   PORT_DIPSETTING(    0x80, DEF_STR( 1C_4C ) )
1157936   PORT_DIPSETTING(    0xc0, DEF_STR( 1C_6C ) )
1158937
1159   PORT_START      /* DSW B */
938   PORT_START_TAG("DSWB")      /* DSW B */
1160939   PORT_DIPNAME( 0x03, 0x00, DEF_STR( Difficulty ) )
1161940   PORT_DIPSETTING(    0x01, DEF_STR( Easy ) )
1162941   PORT_DIPSETTING(    0x00, DEF_STR( Medium ) )
r1679r1680
1181960
1182961   TOAPLAN1_SYSTEM_INPUTS
1183962
1184   PORT_START      /* Territory Jumper Block */
963   PORT_START_TAG("TJUMP")      /* Territory Jumper Block */
1185964   PORT_DIPNAME( 0x0f, 0x02, "Territory" )
1186965   PORT_DIPSETTING(    0x00, DEF_STR( Japan ) )
1187966   PORT_DIPSETTING(    0x01, "US" )
r1679r1680
1189968   PORT_DIPSETTING(    0x03, "Hong Kong" )
1190969   PORT_DIPSETTING(    0x04, "Korea" )
1191970   PORT_DIPSETTING(    0x05, "Taiwan" )
1192   PORT_DIPSETTING(    0x06, "Taiwan (Spacy License)" )
971   PORT_DIPSETTING(    0x06, "Taiwan (Spacy Co License)" )
1193972   PORT_DIPSETTING(    0x07, "US (Romstar License)" )
1194973   PORT_DIPSETTING(    0x08, "Hong Kong (Honest Trading License)" )
1195974//  PORT_DIPSETTING(    0x09, DEF_STR( Japan ) )
r1679r1680
1203982INPUT_PORTS_END
1204983
1205984static INPUT_PORTS_START( outzoneb )
1206   TOAPLAN1_VBLANK_INPUT
985   PORT_INCLUDE( outzone )
1207986
1208   TOAPLAN1_PLAYER_INPUT( 1, IPT_BUTTON3, )
1209
1210   TOAPLAN1_PLAYER_INPUT( 2, IPT_BUTTON3, )
1211
1212   PORT_START      /* DSW A */
1213   PORT_DIPNAME( 0x01, 0x00, DEF_STR( Unused ) )
1214   PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
1215   PORT_DIPSETTING(    0x01, DEF_STR( On ) )
1216   PORT_DIPNAME( 0x02, 0x00, DEF_STR( Flip_Screen ) )
1217   PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
1218   PORT_DIPSETTING(    0x02, DEF_STR( On ) )
1219   PORT_SERVICE( 0x04, IP_ACTIVE_HIGH )
1220   PORT_DIPNAME( 0x08, 0x00, DEF_STR( Demo_Sounds ) )
1221   PORT_DIPSETTING(    0x08, DEF_STR( Off ) )
1222   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
1223   PORT_DIPNAME( 0x30, 0x00, DEF_STR( Coin_A ) )
1224   PORT_DIPSETTING(    0x30, DEF_STR( 4C_1C ) )
1225   PORT_DIPSETTING(    0x20, DEF_STR( 3C_1C ) )
1226   PORT_DIPSETTING(    0x10, DEF_STR( 2C_1C ) )
1227   PORT_DIPSETTING(    0x00, DEF_STR( 1C_1C ) )
1228   PORT_DIPNAME( 0xc0, 0x00, DEF_STR( Coin_B ) )
1229   PORT_DIPSETTING(    0x00, DEF_STR( 1C_2C ) )
1230   PORT_DIPSETTING(    0x40, DEF_STR( 1C_3C ) )
1231   PORT_DIPSETTING(    0x80, DEF_STR( 1C_4C ) )
1232   PORT_DIPSETTING(    0xc0, DEF_STR( 1C_6C ) )
1233
1234   PORT_START      /* DSW B */
1235   PORT_DIPNAME( 0x03, 0x00, DEF_STR( Difficulty ) )
1236   PORT_DIPSETTING(    0x01, DEF_STR( Easy ) )
1237   PORT_DIPSETTING(    0x00, DEF_STR( Medium ) )
1238   PORT_DIPSETTING(    0x02, DEF_STR( Hard ) )
1239   PORT_DIPSETTING(    0x03, DEF_STR( Hardest ) )
1240   PORT_DIPNAME( 0x0c, 0x00, DEF_STR( Bonus_Life ) )
1241   PORT_DIPSETTING(    0x00, "Every 300K" )
1242   PORT_DIPSETTING(    0x04, "200K and 500K" )
1243   PORT_DIPSETTING(    0x08, "300K only" )
1244   PORT_DIPSETTING(    0x0c, DEF_STR( None ) )
1245   PORT_DIPNAME( 0x30, 0x00, DEF_STR( Lives ) )
1246   PORT_DIPSETTING(    0x30, "1" )
1247   PORT_DIPSETTING(    0x20, "2" )
1248   PORT_DIPSETTING(    0x00, "3" )
1249   PORT_DIPSETTING(    0x10, "5" )
1250   PORT_DIPNAME( 0x40, 0x00, "Invulnerability" )
1251   PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
1252   PORT_DIPSETTING(    0x40, DEF_STR( On ) )
1253   PORT_DIPNAME( 0x80, 0x00, DEF_STR( Unused ) )
1254   PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
1255   PORT_DIPSETTING(    0x80, DEF_STR( On ) )
1256
1257   TOAPLAN1_SYSTEM_INPUTS
1258
1259   PORT_START      /* Territory Jumper Block */
987   PORT_MODIFY("TJUMP")      /* Territory Jumper Block */
1260988   PORT_DIPNAME( 0x07, 0x02, "Territory" )
1261989   PORT_DIPSETTING(    0x00, DEF_STR( Japan ) )
1262990   PORT_DIPSETTING(    0x01, "US" )
r1679r1680
1269997   PORT_DIPNAME( 0x80, 0x00, DEF_STR( Unused ) ) // doesn't seem to matter on this set
1270998   PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
1271999   PORT_DIPSETTING(    0x80, DEF_STR( On ) )
1272   PORT_BIT( 0xf0, IP_ACTIVE_HIGH, IPT_UNKNOWN )
12731000INPUT_PORTS_END
12741001
12751002static INPUT_PORTS_START( outzonec )
1276   TOAPLAN1_VBLANK_INPUT
1003   PORT_INCLUDE( outzone )
12771004
1278   TOAPLAN1_PLAYER_INPUT( 1, IPT_BUTTON3, )
1279
1280   TOAPLAN1_PLAYER_INPUT( 2, IPT_BUTTON3, )
1281
1282   PORT_START      /* DSW A */
1283   PORT_DIPNAME( 0x01, 0x00, DEF_STR( Unused ) )
1284   PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
1285   PORT_DIPSETTING(    0x01, DEF_STR( On ) )
1286   PORT_DIPNAME( 0x02, 0x00, DEF_STR( Flip_Screen ) )
1287   PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
1288   PORT_DIPSETTING(    0x02, DEF_STR( On ) )
1289   PORT_SERVICE( 0x04, IP_ACTIVE_HIGH )
1290   PORT_DIPNAME( 0x08, 0x00, DEF_STR( Demo_Sounds ) )
1291   PORT_DIPSETTING(    0x08, DEF_STR( Off ) )
1292   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
1293   PORT_DIPNAME( 0x30, 0x00, DEF_STR( Coin_A ) )
1294   PORT_DIPSETTING(    0x30, DEF_STR( 4C_1C ) )
1295   PORT_DIPSETTING(    0x20, DEF_STR( 3C_1C ) )
1296   PORT_DIPSETTING(    0x10, DEF_STR( 2C_1C ) )
1297   PORT_DIPSETTING(    0x00, DEF_STR( 1C_1C ) )
1298   PORT_DIPNAME( 0xc0, 0x00, DEF_STR( Coin_B ) )
1299   PORT_DIPSETTING(    0x00, DEF_STR( 1C_2C ) )
1300   PORT_DIPSETTING(    0x40, DEF_STR( 1C_3C ) )
1301   PORT_DIPSETTING(    0x80, DEF_STR( 1C_4C ) )
1302   PORT_DIPSETTING(    0xc0, DEF_STR( 1C_6C ) )
1303
1304   PORT_START      /* DSW B */
1305   PORT_DIPNAME( 0x03, 0x00, DEF_STR( Difficulty ) )
1306   PORT_DIPSETTING(    0x01, DEF_STR( Easy ) )
1307   PORT_DIPSETTING(    0x00, DEF_STR( Medium ) )
1308   PORT_DIPSETTING(    0x02, DEF_STR( Hard ) )
1309   PORT_DIPSETTING(    0x03, DEF_STR( Hardest ) )
1310   PORT_DIPNAME( 0x0c, 0x00, DEF_STR( Bonus_Life ) )
1311   PORT_DIPSETTING(    0x00, "Every 300K" )
1312   PORT_DIPSETTING(    0x04, "200K and 500K" )
1313   PORT_DIPSETTING(    0x08, "300K only" )
1314   PORT_DIPSETTING(    0x0c, DEF_STR( None ) )
1315   PORT_DIPNAME( 0x30, 0x00, DEF_STR( Lives ) )
1316   PORT_DIPSETTING(    0x30, "1" )
1317   PORT_DIPSETTING(    0x20, "2" )
1318   PORT_DIPSETTING(    0x00, "3" )
1319   PORT_DIPSETTING(    0x10, "5" )
1320   PORT_DIPNAME( 0x40, 0x00, "Invulnerability" )
1321   PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
1322   PORT_DIPSETTING(    0x40, DEF_STR( On ) )
1323   PORT_DIPNAME( 0x80, 0x00, DEF_STR( Unused ) )
1324   PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
1325   PORT_DIPSETTING(    0x80, DEF_STR( On ) )
1326
1327   TOAPLAN1_SYSTEM_INPUTS
1328
1329   PORT_START      /* Territory Jumper Block */
1005   PORT_MODIFY("TJUMP")      /* Territory Jumper Block */
13301006   PORT_DIPNAME( 0x0f, 0x02, "Territory" )
13311007   PORT_DIPSETTING(    0x00, DEF_STR( Japan ) )
13321008   PORT_DIPSETTING(    0x01, "US" )
r1679r1680
13441020//  PORT_DIPSETTING(    0x0d, DEF_STR( Japan ) )
13451021//  PORT_DIPSETTING(    0x0e, DEF_STR( Japan ) )
13461022//  PORT_DIPSETTING(    0x0f, DEF_STR( Japan ) )
1347   PORT_BIT( 0xf0, IP_ACTIVE_HIGH, IPT_UNKNOWN )
13481023INPUT_PORTS_END
13491024
1025
13501026static INPUT_PORTS_START( vimana )
13511027   TOAPLAN1_VBLANK_INPUT
13521028
r1679r1680
13541030
13551031   TOAPLAN1_PLAYER_INPUT( 2, IPT_BUTTON3, )
13561032
1357   PORT_START      /* DSW A */
1033   PORT_START_TAG("DSWA")      /* DSW A */
13581034   PORT_DIPNAME( 0x01, 0x00, DEF_STR( Unused ) )
13591035   PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
13601036   PORT_DIPSETTING(    0x01, DEF_STR( On ) )
r1679r1680
13761052   PORT_DIPSETTING(    0x80, DEF_STR( 1C_4C ) )
13771053   PORT_DIPSETTING(    0xc0, DEF_STR( 1C_6C ) )
13781054
1379   PORT_START      /* DSW B */
1055   PORT_START_TAG("DSWB")      /* DSW B */
13801056   PORT_DIPNAME( 0x03, 0x00, DEF_STR( Difficulty ) )
13811057   PORT_DIPSETTING(    0x01, DEF_STR( Easy ) )
13821058   PORT_DIPSETTING(    0x00, DEF_STR( Medium ) )
r1679r1680
14011077
14021078   TOAPLAN1_SYSTEM_INPUTS
14031079
1404   PORT_START      /* Territory Jumper Block */
1080   PORT_START_TAG("TJUMP")      /* Territory Jumper Block */
14051081   PORT_DIPNAME( 0x0f, 0x02, "Territory / License" )
14061082   PORT_DIPSETTING(    0x00, "Japan (Distributed by Tecmo)" )
14071083   PORT_DIPSETTING(    0x01, "US" )
r1679r1680
14231099INPUT_PORTS_END
14241100
14251101static INPUT_PORTS_START( vimanan )
1426   TOAPLAN1_VBLANK_INPUT
1102   PORT_INCLUDE( vimana )
14271103
1428   TOAPLAN1_PLAYER_INPUT( 1, IPT_BUTTON3, )
1429
1430   TOAPLAN1_PLAYER_INPUT( 2, IPT_BUTTON3, )
1431
1432   PORT_START      /* DSW A */
1433   PORT_DIPNAME( 0x01, 0x00, DEF_STR( Unused ) )
1434   PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
1435   PORT_DIPSETTING(    0x01, DEF_STR( On ) )
1436   PORT_DIPNAME( 0x02, 0x00, DEF_STR( Flip_Screen ) )
1437   PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
1438   PORT_DIPSETTING(    0x02, DEF_STR( On ) )
1439   PORT_SERVICE( 0x04, IP_ACTIVE_HIGH )
1440   PORT_DIPNAME( 0x08, 0x00, DEF_STR( Demo_Sounds ) )
1104   PORT_MODIFY("DSWA")      /* DSW A */
14411105   PORT_DIPSETTING(    0x08, DEF_STR( Off ) )
14421106   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
14431107   PORT_DIPNAME( 0x10, 0x00, DEF_STR( Unused ) )
r1679r1680
14651129    PORT_DIPSETTING(    0xc0, DEF_STR( 1C_6C ) )
14661130*/
14671131
1468   PORT_START      /* DSW B */
1469   PORT_DIPNAME( 0x03, 0x00, DEF_STR( Difficulty ) )
1470   PORT_DIPSETTING(    0x01, DEF_STR( Easy ) )
1471   PORT_DIPSETTING(    0x00, DEF_STR( Medium ) )
1472   PORT_DIPSETTING(    0x02, DEF_STR( Hard ) )
1473   PORT_DIPSETTING(    0x03, DEF_STR( Hardest ) )
1474   PORT_DIPNAME( 0x0c, 0x00, DEF_STR( Bonus_Life ) )
1475   PORT_DIPSETTING(    0x00, "70K and 200K" )
1476   PORT_DIPSETTING(    0x04, "100K and 250K" )
1477   PORT_DIPSETTING(    0x08, "100K" )
1478   PORT_DIPSETTING(    0x0c, "200K" )
1479   PORT_DIPNAME( 0x30, 0x00, DEF_STR( Lives ) )
1480   PORT_DIPSETTING(    0x30, "2" )
1481   PORT_DIPSETTING(    0x00, "3" )
1482   PORT_DIPSETTING(    0x20, "4" )
1483   PORT_DIPSETTING(    0x10, "5" )
1484   PORT_DIPNAME( 0x40, 0x00, "Invulnerability" )
1485   PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
1486   PORT_DIPSETTING(    0x40, DEF_STR( On ) )
1487   PORT_DIPNAME( 0x80, 0x00, DEF_STR( Allow_Continue ) )
1488   PORT_DIPSETTING(    0x80, DEF_STR( No ) )
1489   PORT_DIPSETTING(    0x00, DEF_STR( Yes ) )
1490
1491   TOAPLAN1_SYSTEM_INPUTS
1492
1493   PORT_START      /* Territory Jumper Block */
1132   PORT_MODIFY("TJUMP")      /* Territory Jumper Block */
14941133   PORT_DIPNAME( 0x0f, 0x02, "Territory / License" )
14951134   PORT_DIPSETTING(    0x00, "Japan (Distributed by Tecmo)" )
14961135   PORT_DIPSETTING(    0x01, "US" )
r1679r1680
15081147//  PORT_DIPSETTING(    0x0d, DEF_STR( Unused ) )
15091148//  PORT_DIPSETTING(    0x0e, DEF_STR( Unused ) )
15101149//  PORT_DIPSETTING(    0x0f, "Japan (Distributed by Tecmo)" ) // duplicate of 0x00
1511   PORT_BIT( 0xf0, IP_ACTIVE_HIGH, IPT_UNKNOWN )
15121150INPUT_PORTS_END
15131151
15141152
r1679r1680
20341672   ROM_LOAD( "tp015_15.bpr",  0x20, 0x20, CRC(a1e17492) SHA1(9ddec4c97f2d541f69f3c32c47aaa21fd9699ae2) )   /* ??? */
20351673ROM_END
20361674
1675ROM_START( zerowng2 ) /* 2 player simultaneous version */
1676   ROM_REGION( 0x080000, REGION_CPU1, 0 )   /* Main 68K code */
1677   ROM_LOAD16_BYTE( "o15-11iiw.bin",  0x000000, 0x08000, CRC(38b0bb5b) SHA1(e5a4c0b6c279a55701c82bf9e285a806054f8d23) )
1678   ROM_LOAD16_BYTE( "o15-12iiw.bin",  0x000001, 0x08000, CRC(74c91e6f) SHA1(8cf5d10a5f4efda0903a4c5d56599861ccc8f1c1) )
1679   ROM_LOAD16_BYTE( "o15-09.rom",     0x040000, 0x20000, CRC(13764e95) SHA1(61da49b73ba81edd951e96e9ce6673c1c3bd65f2) )
1680   ROM_LOAD16_BYTE( "o15-10.rom",     0x040001, 0x20000, CRC(351ba71a) SHA1(937331549140506711b08252497cc0f2efa58268) )
1681
1682   ROM_REGION( 0x10000, REGION_CPU2, 0 )   /* Sound Z80 code */
1683   ROM_LOAD( "o15-13.rom",  0x0000, 0x8000, CRC(e7b72383) SHA1(ea1f6f33a86d14d58bd396fd46081462f00177d5) )
1684
1685   ROM_REGION( 0x80000, REGION_GFX1, ROMREGION_DISPOSE )
1686   ROM_LOAD( "o15-05.rom",  0x00000, 0x20000, CRC(4e5dd246) SHA1(5366b4a6f3c900a4f57a6583b7399163a06f42d7) )
1687   ROM_LOAD( "o15-06.rom",  0x20000, 0x20000, CRC(c8c6d428) SHA1(76ee5bcb8f10fe201fc5c32697beee3de9d8b751) )
1688   ROM_LOAD( "o15-07.rom",  0x40000, 0x20000, CRC(efc40e99) SHA1(a04fad4197a7fb4787cd9bebf43e1d9b02b2f61b) )
1689   ROM_LOAD( "o15-08.rom",  0x60000, 0x20000, CRC(1b019eab) SHA1(c9569ca85696825142acc5cde9ac829e82b1ca1b) )
1690
1691   ROM_REGION( 0x80000, REGION_GFX2, ROMREGION_DISPOSE )
1692   ROM_LOAD( "o15-03.rom",  0x00000, 0x20000, CRC(7f245fd3) SHA1(efbcb3663d4accc4f8128a8fee5475bc109bc17a) )
1693   ROM_LOAD( "o15-04.rom",  0x20000, 0x20000, CRC(0b1a1289) SHA1(ce6c06342392d11952873e3b1d6aea8dc02a551c) )
1694   ROM_LOAD( "o15-01.rom",  0x40000, 0x20000, CRC(70570e43) SHA1(acc9baec71b0930cb2f193677e0663efa5d5551d) )
1695   ROM_LOAD( "o15-02.rom",  0x60000, 0x20000, CRC(724b487f) SHA1(06af31520866eea69aebbd5d428f80e882289a15) )
1696
1697   ROM_REGION( 0x40, REGION_PROMS, 0 )      /* nibble bproms, lo/hi order to be determined */
1698   ROM_LOAD( "tp015_14.bpr",  0x00, 0x20, CRC(bc88cced) SHA1(5055362710c0f58823c05fb4c0e0eec638b91e3d) )   /* sprite attribute (flip/position) ?? */
1699   ROM_LOAD( "tp015_15.bpr",  0x20, 0x20, CRC(a1e17492) SHA1(9ddec4c97f2d541f69f3c32c47aaa21fd9699ae2) )   /* ??? */
1700ROM_END
1701
20371702ROM_START( demonwld )
20381703   ROM_REGION( 0x040000, REGION_CPU1, 0 )   /* Main 68K code */
20391704   ROM_LOAD16_BYTE( "rom10.v2",  0x000000, 0x20000, CRC(ca8194f3) SHA1(176da6739b35ba38b40150fc62380108bcae5a24) )
r1679r1680
24252090GAME( 1989, hellfir1, hellfire, hellfire, hellfir1, toaplan1, ROT0,   "Toaplan (Taito license)", "Hellfire (1P Ver.)", 0 )
24262091GAME( 1989, hellfir2, hellfire, hellfire, hellfire, toaplan1, ROT0,   "Toaplan (Taito license)", "Hellfire (2P Ver., first edition)", 0 )
24272092GAME( 1989, zerowing, 0,        zerowing, zerowing, toaplan1, ROT0,   "Toaplan", "Zero Wing", 0 )
2093GAME( 1989, zerowng2, zerowing, zerowing, zerowng2, toaplan1, ROT0,   "[Toaplan] Williams Electronics Games, Inc", "Zero Wing (2 player simultaneous ver.)", 0 )
24282094GAME( 1990, demonwld, 0,        demonwld, demonwld, demonwld, ROT0,   "Toaplan", "Demon's World / Horror Story", 0 )
24292095GAME( 1989, demonwl1, demonwld, demonwld, demonwl1, demonwld, ROT0,   "Toaplan (Taito license)", "Demon's World / Horror Story (Taito license)", 0 )
24302096GAME( 1989, demonwl2, demonwld, demonwld, demonwl1, demonwld, ROT0,   "Toaplan", "Demon's World / Horror Story (first edition)", 0 )
src/mame/drivers/magic10.c
r1679r1680
295295
296296static VIDEO_START( magic10 )
297297{
298   layer0_tilemap = tilemap_create(get_layer0_tile_info,tilemap_scan_rows,TILEMAP_TYPE_PEN,     16,16,32,32);
299   layer1_tilemap = tilemap_create(get_layer1_tile_info,tilemap_scan_rows,TILEMAP_TYPE_PEN,16,16,32,32);
300   layer2_tilemap = tilemap_create(get_layer2_tile_info,tilemap_scan_rows,TILEMAP_TYPE_PEN, 8, 8,64,64);
298   layer0_tilemap = tilemap_create(get_layer0_tile_info,tilemap_scan_rows,16,16,32,32);
299   layer1_tilemap = tilemap_create(get_layer1_tile_info,tilemap_scan_rows,16,16,32,32);
300   layer2_tilemap = tilemap_create(get_layer2_tile_info,tilemap_scan_rows, 8, 8,64,64);
301301
302302   tilemap_set_transparent_pen(layer1_tilemap,0);
303303   tilemap_set_transparent_pen(layer2_tilemap,0);
src/mame/drivers/tmnt.c
r1679r1680
19521952   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_COIN1 )
19531953   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_COIN2 )
19541954   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_SERVICE1 )
1955   PORT_BIT(0x08, IP_ACTIVE_LOW, IPT_SERVICE ) PORT_NAME( DEF_STR( Service_Mode )) PORT_CODE(KEYCODE_F2)
1955   PORT_SERVICE_NO_TOGGLE( 0x08, IP_ACTIVE_LOW )
19561956   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_START1 )
19571957   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_START2 )
19581958   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNKNOWN )   /* VBLANK? OBJMPX? */
r1679r1680
20412041   PORT_BIT( 0x0080, IP_ACTIVE_LOW, IPT_UNKNOWN )
20422042   PORT_BIT( 0x0100, IP_ACTIVE_LOW, IPT_START1 )
20432043   PORT_BIT( 0x0200, IP_ACTIVE_LOW, IPT_START2 )
2044   PORT_BIT(0x0400, IP_ACTIVE_LOW, IPT_SERVICE ) PORT_NAME( DEF_STR( Service_Mode )) PORT_CODE(KEYCODE_F2)
2044   PORT_SERVICE_NO_TOGGLE( 0x0400, IP_ACTIVE_LOW )
20452045   PORT_DIPNAME( 0x8000, 0x0000, "Freeze" )   /* ?? VBLANK ?? */
20462046   PORT_DIPSETTING(      0x0000, DEF_STR( Off ) )
20472047   PORT_DIPSETTING(      0x8000, DEF_STR( On ) )
r1679r1680
20822082   PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_VBLANK )   /* ?? TMNT2: NVBLK */
20832083   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_UNKNOWN )   /* ?? TMNT2: IPL0 */
20842084   PORT_BIT( 0x60, IP_ACTIVE_LOW, IPT_UNKNOWN )   /* unused? */
2085   PORT_BIT(0x80, IP_ACTIVE_LOW, IPT_SERVICE ) PORT_NAME( DEF_STR( Service_Mode )) PORT_CODE(KEYCODE_F2)
2085   PORT_SERVICE_NO_TOGGLE( 0x80, IP_ACTIVE_LOW )
20862086INPUT_PORTS_END
20872087
20882088static INPUT_PORTS_START( ssridr4p )
r1679r1680
21092109   PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_VBLANK )   /* ?? TMNT2: NVBLK */
21102110   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_UNKNOWN )   /* ?? TMNT2: IPL0 */
21112111   PORT_BIT( 0x60, IP_ACTIVE_LOW, IPT_UNKNOWN )   /* unused? */
2112   PORT_BIT(0x80, IP_ACTIVE_LOW, IPT_SERVICE ) PORT_NAME( DEF_STR( Service_Mode )) PORT_CODE(KEYCODE_F2)
2112   PORT_SERVICE_NO_TOGGLE( 0x80, IP_ACTIVE_LOW )
21132113
21142114   PORT_START   /* IN2 */
21152115   KONAMI_PLAYERS_INPUT_LSB( 3, IPT_UNKNOWN, IPT_UNKNOWN )
r1679r1680
21442144   PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_VBLANK )   /* ?? TMNT2: NVBLK */
21452145   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_UNKNOWN )   /* ?? TMNT2: IPL0 */
21462146   PORT_BIT( 0x60, IP_ACTIVE_LOW, IPT_UNKNOWN )   /* unused? */
2147   PORT_BIT(0x80, IP_ACTIVE_LOW, IPT_SERVICE ) PORT_NAME( DEF_STR( Service_Mode )) PORT_CODE(KEYCODE_F2)
2147   PORT_SERVICE_NO_TOGGLE( 0x80, IP_ACTIVE_LOW )
21482148
21492149   PORT_START   /* IN2 */
21502150   KONAMI_PLAYERS_INPUT_LSB( 3, IPT_UNKNOWN, IPT_START3 )
r1679r1680
21752175   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_SPECIAL )   /* EEPROM data */
21762176   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_SPECIAL )   /* EEPROM status? - always 1 */
21772177   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_UNKNOWN )
2178   PORT_BIT(0x08, IP_ACTIVE_LOW, IPT_SERVICE ) PORT_NAME( DEF_STR( Service_Mode )) PORT_CODE(KEYCODE_F2)
2178   PORT_SERVICE_NO_TOGGLE( 0x08, IP_ACTIVE_LOW )
21792179   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_UNKNOWN )
21802180   PORT_BIT( 0x60, IP_ACTIVE_LOW, IPT_UNKNOWN )   /* unused? */
2181   PORT_BIT(0x80, IP_ACTIVE_LOW, IPT_SERVICE ) PORT_NAME( DEF_STR( Service_Mode )) PORT_CODE(KEYCODE_F2)
2181   PORT_SERVICE_NO_TOGGLE( 0x80, IP_ACTIVE_LOW )
21822182
21832183   PORT_START   /* IN2 */
21842184   KONAMI_PLAYERS_INPUT_LSB( 3, IPT_UNKNOWN, IPT_START3 )
r1679r1680
22252225   PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_VBLANK )   /* ?? TMNT2: NVBLK (needs to be ACTIVE_HIGH to avoid problems) */
22262226   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_UNKNOWN )   /* ?? TMNT2: IPL0 */
22272227   PORT_BIT( 0x60, IP_ACTIVE_LOW, IPT_UNKNOWN )   /* unused? */
2228   PORT_BIT(0x80, IP_ACTIVE_LOW, IPT_SERVICE ) PORT_NAME( DEF_STR( Service_Mode )) PORT_CODE(KEYCODE_F2)
2228   PORT_SERVICE_NO_TOGGLE( 0x80, IP_ACTIVE_LOW )
22292229INPUT_PORTS_END
22302230
22312231static INPUT_PORTS_START( thndrx2 )
r1679r1680
22342234   PORT_BIT( 0x0100, IP_ACTIVE_LOW, IPT_COIN1 )
22352235   PORT_BIT( 0x0200, IP_ACTIVE_LOW, IPT_COIN2 )
22362236   PORT_BIT( 0x0400, IP_ACTIVE_LOW, IPT_SERVICE1 )
2237   PORT_BIT(0x0800, IP_ACTIVE_LOW, IPT_SERVICE ) PORT_NAME( DEF_STR( Service_Mode )) PORT_CODE(KEYCODE_F2)
2237   PORT_SERVICE_NO_TOGGLE( 0x0800, IP_ACTIVE_LOW )
22382238   PORT_BIT( 0x1000, IP_ACTIVE_LOW, IPT_UNKNOWN )
22392239   PORT_BIT( 0x2000, IP_ACTIVE_LOW, IPT_UNKNOWN )
22402240   PORT_BIT( 0x4000, IP_ACTIVE_LOW, IPT_UNKNOWN )
r1679r1680
22562256   PORT_START
22572257   KONAMI_PLAYERS_INPUT_LSB( 1, IPT_UNKNOWN, IPT_START1 )
22582258   PORT_BIT( 0x0100, IP_ACTIVE_LOW, IPT_SERVICE1 )
2259   PORT_BIT(0x0200, IP_ACTIVE_LOW, IPT_SERVICE ) PORT_NAME( DEF_STR( Service_Mode )) PORT_CODE(KEYCODE_F2)
2259   PORT_SERVICE_NO_TOGGLE( 0x0200, IP_ACTIVE_LOW )
22602260   PORT_BIT( 0x0400, IP_ACTIVE_LOW, IPT_COIN1 )
22612261   PORT_BIT( 0x0800, IP_ACTIVE_LOW, IPT_UNKNOWN )
22622262   PORT_DIPNAME( 0x1000, 0x0000, "Sound" )
src/mame/drivers/jpmimpct.c
r1679r1680
301301      case 0xe:
302302      {
303303         attotime rate = attotime_mul(ATTOTIME_IN_HZ(MC68681_1_CLOCK), 16 * duart_1.CT);
304         timer_adjust(duart_1_timer, rate, 0, rate);
304         timer_adjust_periodic(duart_1_timer, rate, 0, rate);
305305         break;
306306      }
307307      case 0xf:
src/mame/drivers/namcos12.c
r1679r1680
15541554   PORT_BIT( 0x0800, IP_ACTIVE_LOW, IPT_UNKNOWN )
15551555   PORT_BIT( 0x1000, IP_ACTIVE_LOW, IPT_COIN2 )
15561556   PORT_BIT( 0x2000, IP_ACTIVE_LOW, IPT_COIN1 )
1557   PORT_BIT( 0x4000, IP_ACTIVE_LOW, IPT_OTHER ) PORT_NAME("Test Switch") PORT_CODE(KEYCODE_F2)
1557   PORT_SERVICE_NO_TOGGLE( 0x4000, IP_ACTIVE_LOW )
15581558   PORT_BIT( 0x8000, IP_ACTIVE_LOW, IPT_SERVICE1 )
15591559INPUT_PORTS_END
15601560
src/mame/drivers/raiden2.c
r1679r1680
252252
253253static VIDEO_START( raiden2 )
254254{
255   text_layer       = tilemap_create(get_text_tile_info, tilemap_scan_rows, TILEMAP_TYPE_PEN,  8, 8, 64,32 );
256   background_layer = tilemap_create(get_back_tile_info, tilemap_scan_rows, TILEMAP_TYPE_PEN, 16,16, 32,32 );
257   midground_layer  = tilemap_create(get_mid_tile_info,  tilemap_scan_rows, TILEMAP_TYPE_PEN, 16,16, 32,32 );
258   foreground_layer = tilemap_create(get_fore_tile_info, tilemap_scan_rows, TILEMAP_TYPE_PEN, 16,16, 32,32 );
255   text_layer       = tilemap_create(get_text_tile_info, tilemap_scan_rows,  8, 8, 64,32 );
256   background_layer = tilemap_create(get_back_tile_info, tilemap_scan_rows, 16,16, 32,32 );
257   midground_layer  = tilemap_create(get_mid_tile_info,  tilemap_scan_rows, 16,16, 32,32 );
258   foreground_layer = tilemap_create(get_fore_tile_info, tilemap_scan_rows, 16,16, 32,32 );
259259
260260   tilemap_set_transparent_pen(midground_layer, 15);
261261   tilemap_set_transparent_pen(foreground_layer, 15);
src/mame/drivers/mogura.c
r1679r1680
5555
5656static VIDEO_START( mogura )
5757{
58   mogura_tilemap = tilemap_create(get_mogura_tile_info,tilemap_scan_rows,TILEMAP_TYPE_PEN,8,8,64, 32);
58   mogura_tilemap = tilemap_create(get_mogura_tile_info,tilemap_scan_rows,8,8,64, 32);
5959}
6060
6161static VIDEO_UPDATE( mogura )
src/mame/drivers/system18.c
r1679r1680
13011301   PORT_START /* service */
13021302   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_COIN1 )
13031303   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_COIN2 )
1304   PORT_BIT(0x04, IP_ACTIVE_LOW, IPT_SERVICE ) PORT_NAME( DEF_STR( Service_Mode )) PORT_CODE(KEYCODE_F2)
1305   PORT_BIT(0x08, 0x08, IPT_TILT ) PORT_NAME(DEF_STR( Test )) PORT_CODE(KEYCODE_T)
1304   PORT_SERVICE_NO_TOGGLE( 0x04, IP_ACTIVE_LOW )
1305   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_SERVICE1 )
13061306   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_START1 )
13071307   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_START2 )
13081308   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNKNOWN )
src/mame/drivers/berzerk.c
r1679r1680
167167   next_v256 = irq_trigger_v256s[next_irq_number];
168168
169169   next_vpos = vysnc_chain_counter_to_vpos(next_counter, next_v256);
170   timer_adjust(irq_timer, video_screen_get_time_until_pos(0, next_vpos, 0), next_irq_number, attotime_zero);
170   timer_adjust_oneshot(irq_timer, video_screen_get_time_until_pos(0, next_vpos, 0), next_irq_number);
171171}
172172
173173
r1679r1680
180180static void start_irq_timer(void)
181181{
182182   int vpos = vysnc_chain_counter_to_vpos(irq_trigger_counts[0], irq_trigger_v256s[0]);
183   timer_adjust(irq_timer, video_screen_get_time_until_pos(0, vpos, 0), 0, attotime_zero);
183   timer_adjust_oneshot(irq_timer, video_screen_get_time_until_pos(0, vpos, 0), 0);
184184}
185185
186186
r1679r1680
244244   next_v256 = nmi_trigger_v256s[next_nmi_number];
245245
246246   next_vpos = vysnc_chain_counter_to_vpos(next_counter, next_v256);
247   timer_adjust(nmi_timer, video_screen_get_time_until_pos(0, next_vpos, 0), next_nmi_number, attotime_zero);
247   timer_adjust_oneshot(nmi_timer, video_screen_get_time_until_pos(0, next_vpos, 0), next_nmi_number);
248248}
249249
250250
r1679r1680
257257static void start_nmi_timer(void)
258258{
259259   int vpos = vysnc_chain_counter_to_vpos(nmi_trigger_counts[0], nmi_trigger_v256s[0]);
260   timer_adjust(nmi_timer, video_screen_get_time_until_pos(0, vpos, 0), 0, attotime_zero);
260   timer_adjust_oneshot(nmi_timer, video_screen_get_time_until_pos(0, vpos, 0), 0);
261261}
262262
263263
src/mame/drivers/psikyo.c
r1679r1680
532532   PORT_BIT( 0x0004, IP_ACTIVE_HIGH, IPT_SPECIAL  ) \
533533   PORT_BIT( 0x0008, IP_ACTIVE_LOW,  IPT_UNKNOWN  ) \
534534   PORT_BIT( 0x0010, IP_ACTIVE_LOW,  IPT_SERVICE1 ) \
535   PORT_BIT(0x0020, IP_ACTIVE_LOW, IPT_SERVICE ) PORT_NAME( DEF_STR( Service_Mode )) PORT_CODE(KEYCODE_F2) \
535   PORT_SERVICE_NO_TOGGLE( 0x0020, IP_ACTIVE_LOW ) \
536536   PORT_BIT( 0x0040, IP_ACTIVE_LOW,  IPT_TILT     ) \
537537   PORT_BIT( 0x0080, IP_ACTIVE_HIGH, IPT_SPECIAL  )   // From Sound CPU
538538
src/mame/drivers/dynadice.c
r1679r1680
174174static VIDEO_START( dynadice )
175175{
176176   /* pacman - style videoram layout */
177   bg_tilemap = tilemap_create(get_tile_info,tilemap_scan_rows,TILEMAP_TYPE_PEN,8,8,32,32);
178   top_tilemap = tilemap_create(get_tile_info,tilemap_scan_cols,TILEMAP_TYPE_PEN,8,8,2,32);
177   bg_tilemap = tilemap_create(get_tile_info,tilemap_scan_rows,8,8,32,32);
178   top_tilemap = tilemap_create(get_tile_info,tilemap_scan_cols,8,8,2,32);
179179   tilemap_set_scrollx(bg_tilemap, 0, -16 );
180180}
181181
src/mame/drivers/dacholer.c
r1679r1680
255255
256256static VIDEO_START( dacholer )
257257{
258   bg_tilemap = tilemap_create(get_bg_tile_info,tilemap_scan_rows,TILEMAP_TYPE_PEN,     8,8,32,32);
259   fg_tilemap = tilemap_create(get_fg_tile_info,tilemap_scan_rows,TILEMAP_TYPE_PEN,8,8,32,32);
258   bg_tilemap = tilemap_create(get_bg_tile_info,tilemap_scan_rows,8,8,32,32);
259   fg_tilemap = tilemap_create(get_fg_tile_info,tilemap_scan_rows,8,8,32,32);
260260
261261   tilemap_set_transparent_pen(fg_tilemap,0);
262262}
src/mame/drivers/model3.c
r1679r1680
15171517PORT_START_TAG("IN0") \
15181518   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_COIN1 ) \
15191519   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_COIN2 ) \
1520   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_SERVICE ) PORT_NAME( DEF_STR( Service_Mode )) PORT_CODE(KEYCODE_F2) /* Test Button */ \
1521   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_SERVICE1 ) \
1520   PORT_SERVICE_NO_TOGGLE( 0x04, IP_ACTIVE_LOW ) /* Test Button A */ \
1521   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_SERVICE1 ) /* Service Button A */ \
15221522   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_START1 ) \
15231523   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_START2 ) \
15241524   PORT_BIT( 0xc0, IP_ACTIVE_LOW, IPT_UNKNOWN )
r1679r1680
17581758   PORT_START_TAG("IN0") \
17591759   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_COIN1 )
17601760   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_COIN2 )
1761   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_SERVICE ) PORT_NAME( DEF_STR( Service_Mode )) PORT_CODE(KEYCODE_F2) /* Test Button */ \
1762   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_SERVICE1 )
1761   PORT_SERVICE_NO_TOGGLE( 0x04, IP_ACTIVE_LOW ) /* Test Button A */
1762   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_SERVICE1 ) /* Service Button A */
17631763   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_START3 )      /* Select 3 */
17641764   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_BUTTON2 )   /* Pole Left */
17651765   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_START1 )      /* Select 1 */
17661766   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_START2 )      /* Select 2 */
17671767
17681768   PORT_START_TAG("IN1") \
1769   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_SERVICE ) PORT_NAME("Service Button B") PORT_CODE(KEYCODE_8) \
1770   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_SERVICE ) PORT_NAME("Test Button B") PORT_CODE(KEYCODE_7) \
1769   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_SERVICE ) PORT_NAME("Service Button B") PORT_CODE(KEYCODE_8)
1770   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_SERVICE ) PORT_NAME("Test Button B") PORT_CODE(KEYCODE_7)
17711771   PORT_BIT( 0x3f, IP_ACTIVE_LOW, IPT_UNUSED )
17721772
17731773   PORT_START
src/mame/drivers/gameplan.c
r1679r1680
312312   via_0_ca1_w(0, (UINT8)param);
313313
314314   if (param)
315      timer_adjust(via_0_ca1_timer, video_screen_get_time_until_pos(0, VBSTART, 0), 0, attotime_zero);
315      timer_adjust_oneshot(via_0_ca1_timer, video_screen_get_time_until_pos(0, VBSTART, 0), 0);
316316   else
317      timer_adjust(via_0_ca1_timer, video_screen_get_time_until_pos(0, VBEND, 0), 1, attotime_zero);
317      timer_adjust_oneshot(via_0_ca1_timer, video_screen_get_time_until_pos(0, VBEND, 0), 1);
318318}
319319
320320
r1679r1680
326326
327327static void start_via_0_timer(void)
328328{
329   timer_adjust(via_0_ca1_timer, video_screen_get_time_until_pos(0, VBSTART, 0), 0, attotime_zero);
329   timer_adjust_oneshot(via_0_ca1_timer, video_screen_get_time_until_pos(0, VBSTART, 0), 0);
330330}
331331
332332
src/mame/drivers/ikki.c
r1679r1680
1212#include "deprecat.h"
1313#include "sound/sn76496.h"
1414
15
16extern UINT8 *ikki_scroll;
17
1518PALETTE_INIT( ikki );
19VIDEO_START( ikki );
1620VIDEO_UPDATE( ikki );
1721
22
1823/****************************************************************************/
1924
20WRITE8_HANDLER( ikki_scroll_w );
2125WRITE8_HANDLER( ikki_scrn_ctrl_w );
2226
2327static READ8_HANDLER( ikki_e000_r )
r1679r1680
5054   AM_RANGE(0xe005, 0xe005) AM_READ(input_port_3_r) /* player2 */
5155   AM_RANGE(0xe008, 0xe008) AM_WRITE(ikki_scrn_ctrl_w)
5256   AM_RANGE(0xe009, 0xe009) AM_WRITE(ikki_coin_counters)
53   AM_RANGE(0xe00a, 0xe00b) AM_WRITE(ikki_scroll_w)
57   AM_RANGE(0xe00a, 0xe00b) AM_WRITE(MWA8_RAM) AM_BASE(&ikki_scroll)
5458ADDRESS_MAP_END
5559
5660static ADDRESS_MAP_START( ikki_cpu2, ADDRESS_SPACE_PROGRAM, 8 )
r1679r1680
208212   MDRV_SCREEN_SIZE(32*8, 32*8)
209213   MDRV_SCREEN_VISIBLE_AREA(1*8, 31*8-1, 2*8, 30*8-1)
210214   MDRV_GFXDECODE(ikki)
211   MDRV_PALETTE_LENGTH(256+1)
212   MDRV_COLORTABLE_LENGTH(1024)
215   MDRV_PALETTE_LENGTH(1024)
213216
214217   MDRV_PALETTE_INIT(ikki)
215   MDRV_VIDEO_START(generic)
218   MDRV_VIDEO_START(ikki)
216219   MDRV_VIDEO_UPDATE(ikki)
217220
218221   /* sound hardware */
src/mame/drivers/capbowl.c
r1679r1680
319319   PORT_START   /* FAKE */
320320   /* This fake input port is used to get the status of the F2 key, */
321321   /* and activate the test mode, which is triggered by a NMI */
322   PORT_BIT(0x01, IP_ACTIVE_HIGH, IPT_SERVICE ) PORT_NAME( DEF_STR( Service_Mode )) PORT_CODE(KEYCODE_F2)
322   PORT_SERVICE_NO_TOGGLE( 0x01, IP_ACTIVE_HIGH )
323323INPUT_PORTS_END
324324
325325
src/mame/drivers/ssingles.c
r1679r1680
2323
2424#include "driver.h"
2525#include "sound/ay8910.h"
26#include "video/crtc6845.h"
26#include "video/mc6845.h"
2727
28static mc6845_t *mc6845;
2829static UINT8 *ssingles_videoram;
2930static UINT8 *ssingles_colorram;
3031static UINT8 prot_data;
r1679r1680
8384   }
8485}
8586
86static const crtc6845_interface crtc6845_intf =
87static const mc6845_interface mc6845_intf =
8788{
8889      0,
8990      1000000, /* ? MHz */
r1679r1680
104105   ssingles_colorram[offset]=data;
105106}
106107
108static WRITE8_HANDLER( ssingles_mc6845_address_w )
109{
110   mc6845_address_w(mc6845, data);
111}
112
113
114static WRITE8_HANDLER( ssingles_mc6845_register_w )
115{
116   mc6845_register_w(mc6845, data);
117}
118
119
107120static VIDEO_START(ssingles)
108121{
109   crtc6845_config(0, &crtc6845_intf);
122   mc6845 = mc6845_config(&mc6845_intf);
110123
111124   {
112125      int i;
r1679r1680
118131}
119132
120133
134static VIDEO_UPDATE( ssingles )
135{
136   mc6845_update(mc6845, bitmap, cliprect);
137
138   return 0;
139}
140
141
121142static READ8_HANDLER(c000_r)
122143{
123144   return prot_data;
r1679r1680
171192   AM_RANGE(0x18, 0x18) AM_READ(input_port_3_r)
172193   AM_RANGE(0x1c, 0x1c) AM_READ(controls_r)
173194   AM_RANGE(0x1a, 0x1a) AM_WRITENOP //video/crt related
174   AM_RANGE(0xfe, 0xfe) AM_WRITE(crtc6845_address_w)
175   AM_RANGE(0xff, 0xff) AM_WRITE(crtc6845_register_w)
195   AM_RANGE(0xfe, 0xfe) AM_WRITE(ssingles_mc6845_address_w)
196   AM_RANGE(0xff, 0xff) AM_WRITE(ssingles_mc6845_register_w)
176197
177198ADDRESS_MAP_END
178199
r1679r1680
263284   MDRV_PALETTE_LENGTH(4) //guess
264285
265286   MDRV_VIDEO_START(ssingles)
266   MDRV_VIDEO_UPDATE(crtc6845)
287   MDRV_VIDEO_UPDATE(ssingles)
267288
268289   /* sound hardware */
269290   MDRV_SPEAKER_STANDARD_MONO("mono")
src/mame/drivers/kinst.c
r1679r1680
442442   PORT_BIT( 0x0200, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_PLAYER(1)
443443   PORT_BIT( 0x0400, IP_ACTIVE_LOW, IPT_START1 )
444444   PORT_BIT( 0x0800, IP_ACTIVE_LOW, IPT_COIN1 )
445   PORT_BIT( 0x1000, IP_ACTIVE_LOW, IPT_SERVICE ) PORT_NAME( DEF_STR( Service_Mode )) PORT_CODE(KEYCODE_F2)
445   PORT_SERVICE_NO_TOGGLE( 0x1000, IP_ACTIVE_LOW )
446446   PORT_BIT( 0x2000, IP_ACTIVE_LOW, IPT_COIN3 )
447447   PORT_BIT( 0x4000, IP_ACTIVE_LOW, IPT_COIN4 )
448448   PORT_BIT( 0x8000, IP_ACTIVE_LOW, IPT_SPECIAL )   /* door */
r1679r1680
546546   PORT_BIT( 0x0200, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_PLAYER(1)
547547   PORT_BIT( 0x0400, IP_ACTIVE_LOW, IPT_START1 )
548548   PORT_BIT( 0x0800, IP_ACTIVE_LOW, IPT_COIN1 )
549   PORT_BIT( 0x1000, IP_ACTIVE_LOW, IPT_SERVICE ) PORT_NAME( DEF_STR( Service_Mode )) PORT_CODE(KEYCODE_F2)
549   PORT_SERVICE_NO_TOGGLE( 0x1000, IP_ACTIVE_LOW )
550550   PORT_BIT( 0x2000, IP_ACTIVE_LOW, IPT_COIN3 )
551551   PORT_BIT( 0x4000, IP_ACTIVE_LOW, IPT_COIN4 )
552552   PORT_BIT( 0x8000, IP_ACTIVE_LOW, IPT_SPECIAL )   /* door */
src/mame/drivers/skyarmy.c
r1679r1680
9999
100100static VIDEO_START( skyarmy )
101101{
102        skyarmy_tilemap = tilemap_create(get_skyarmy_tile_info,tilemap_scan_rows,TILEMAP_TYPE_PEN,8,8,32,32);
102        skyarmy_tilemap = tilemap_create(get_skyarmy_tile_info,tilemap_scan_rows,8,8,32,32);
103103        tilemap_set_scroll_cols(skyarmy_tilemap,32);
104104}
105105
src/mame/drivers/qix.c
r1679r1680
225225#include "qix.h"
226226#include "cpu/m6805/m6805.h"
227227#include "machine/6821pia.h"
228#include "video/crtc6845.h"
229228#include "sound/sn76496.h"
230229#include "sound/discrete.h"
231230
r1679r1680
290289   AM_RANGE(0x9400, 0x9400) AM_MIRROR(0x03fc) AM_READWRITE(qix_addresslatch_r, qix_addresslatch_w)
291290   AM_RANGE(0x9402, 0x9403) AM_MIRROR(0x03fc) AM_WRITE(MWA8_RAM) AM_BASE(&qix_videoaddress)
292291   AM_RANGE(0x9800, 0x9800) AM_MIRROR(0x03ff) AM_READ(qix_scanline_r)
293   AM_RANGE(0x9c00, 0x9c00) AM_MIRROR(0x03fe) AM_WRITE(crtc6845_0_address_w)
294   AM_RANGE(0x9c01, 0x9c01) AM_MIRROR(0x03fe) AM_READWRITE(crtc6845_0_register_r, crtc6845_0_register_w)
292   AM_RANGE(0x9c00, 0x9c00) AM_MIRROR(0x03fe) AM_WRITE(qix_mc6845_address_w)
293   AM_RANGE(0x9c01, 0x9c01) AM_MIRROR(0x03fe) AM_READWRITE(qix_mc6845_register_r, qix_mc6845_register_w)
295294   AM_RANGE(0xa000, 0xffff) AM_ROM
296295ADDRESS_MAP_END
297296
r1679r1680
308307   AM_RANGE(0x9400, 0x9400) AM_MIRROR(0x03fc) AM_READWRITE(qix_addresslatch_r, qix_addresslatch_w)
309308   AM_RANGE(0x9402, 0x9403) AM_MIRROR(0x03fc) AM_WRITE(MWA8_RAM) AM_BASE(&qix_videoaddress)
310309   AM_RANGE(0x9800, 0x9800) AM_MIRROR(0x03ff) AM_READ(qix_scanline_r)
311   AM_RANGE(0x9c00, 0x9c00) AM_MIRROR(0x03fe) AM_WRITE(crtc6845_0_address_w)
312   AM_RANGE(0x9c01, 0x9c01) AM_MIRROR(0x03fe) AM_READWRITE(crtc6845_0_register_r, crtc6845_0_register_w)
310   AM_RANGE(0x9c00, 0x9c00) AM_MIRROR(0x03fe) AM_WRITE(qix_mc6845_address_w)
311   AM_RANGE(0x9c01, 0x9c01) AM_MIRROR(0x03fe) AM_READWRITE(qix_mc6845_register_r, qix_mc6845_register_w)
313312   AM_RANGE(0xa000, 0xbfff) AM_ROMBANK(1)
314313   AM_RANGE(0xc000, 0xffff) AM_ROM
315314ADDRESS_MAP_END
r1679r1680
631630
632631   /* video hardware */
633632   MDRV_VIDEO_ATTRIBUTES(VIDEO_TYPE_RASTER)
634   MDRV_PALETTE_LENGTH(1024)
635633   MDRV_VIDEO_START(qix)
636   MDRV_VIDEO_UPDATE(crtc6845)
634   MDRV_VIDEO_UPDATE(qix)
637635
638636   MDRV_SCREEN_ADD("main", 0)
639   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
637   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_RGB32)
640638   MDRV_SCREEN_RAW_PARAMS(QIX_CHARACTER_CLOCK*8, 256, 0, 256, 256, 0, 256)   /* temporary, CRTC will configure screen */
641639
642640   /* sound hardware */
src/mame/drivers/suprgolf.c
r1679r1680
6262
6363static VIDEO_START( suprgolf )
6464{
65   suprgolf_tilemap = tilemap_create( get_tile_info,tilemap_scan_rows,TILEMAP_TYPE_PEN,8,8,32,32 );
65   suprgolf_tilemap = tilemap_create( get_tile_info,tilemap_scan_rows,8,8,32,32 );
6666}
6767
6868static VIDEO_UPDATE( suprgolf )
src/mame/drivers/xexex.c
r1679r1680
331331            xexex_objdma(0);
332332
333333            // schedule DMA end interrupt
334            timer_adjust(dmadelay_timer, XE_DMADELAY, 0, attotime_zero);
334            timer_adjust_oneshot(dmadelay_timer, XE_DMADELAY, 0);
335335         }
336336
337337         // IRQ 4 is the V-blank interrupt. It controls color, sound and
r1679r1680
438438   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_SPECIAL )   /* EEPROM data */
439439   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_SPECIAL )   /* EEPROM ready (always 1) */
440440   PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_UNKNOWN )
441   PORT_BIT(0x08, IP_ACTIVE_LOW, IPT_SERVICE ) PORT_NAME( DEF_STR( Service_Mode )) PORT_CODE(KEYCODE_F2)
441   PORT_SERVICE_NO_TOGGLE( 0x08, IP_ACTIVE_LOW )
442442   PORT_BIT( 0xf0, IP_ACTIVE_HIGH, IPT_UNKNOWN )
443443
444444   PORT_START
src/mame/drivers/wallc.c
r1679r1680
127127
128128static VIDEO_START( wallc )
129129{
130   bg_tilemap = tilemap_create(get_bg_tile_info, tilemap_scan_cols_flip_y,   TILEMAP_TYPE_PEN, 8, 8, 32, 32);
130   bg_tilemap = tilemap_create(get_bg_tile_info, tilemap_scan_cols_flip_y,   8, 8, 32, 32);
131131}
132132
133133static VIDEO_UPDATE( wallc )
src/mame/drivers/marinedt.c
r1679r1680
354354   PORT_DIPSETTING(    0x02, DEF_STR( On ) )
355355//freezes the game before the reset
356356//doesn't seem to be done as a dip, but what about mixing with diops like this?
357   PORT_BIT(0x04, IP_ACTIVE_HIGH, IPT_SERVICE ) PORT_NAME( DEF_STR( Service_Mode )) PORT_TOGGLE PORT_CODE(KEYCODE_F2)
357   PORT_SERVICE( 0x04, IP_ACTIVE_HIGH )
358358   PORT_DIPNAME( 0x08, 0x08, DEF_STR( Cabinet ) )
359359   PORT_DIPSETTING(    0x08, DEF_STR( Upright ) )
360360   PORT_DIPSETTING(    0x00, DEF_STR( Cocktail ) )
r1679r1680
450450
451451static VIDEO_START( marinedt )
452452{
453   tx_tilemap = tilemap_create(get_tile_info, tilemap_scan_rows, TILEMAP_TYPE_PEN, 8, 8,32,32);
453   tx_tilemap = tilemap_create(get_tile_info, tilemap_scan_rows, 8, 8,32,32);
454454
455455   tilemap_set_transparent_pen(tx_tilemap, 0);
456456   tilemap_set_scrolldx(tx_tilemap, 0, 4*8);
src/mame/drivers/ironhors.c
r1679r1680
413413   MDRV_SCREEN_SIZE(32*8, 32*8)
414414   MDRV_SCREEN_VISIBLE_AREA(1*8, 31*8-1, 2*8, 30*8-1)
415415   MDRV_GFXDECODE(ironhors)
416   MDRV_PALETTE_LENGTH(256)
417   MDRV_COLORTABLE_LENGTH(16*8*16+16*8*16)
416   MDRV_PALETTE_LENGTH(16*8*16+16*8*16)
418417
419418   MDRV_PALETTE_INIT(ironhors)
420419   MDRV_VIDEO_START(ironhors)
src/mame/drivers/konamigq.c
r1679r1680
474474   PORT_BIT( 0x040000, IP_ACTIVE_LOW, IPT_UNKNOWN )
475475   PORT_BIT( 0x080000, IP_ACTIVE_LOW, IPT_UNKNOWN )
476476   PORT_BIT( 0x100000, IP_ACTIVE_LOW, IPT_UNKNOWN )
477   PORT_BIT( 0x200000, IP_ACTIVE_LOW, IPT_OTHER ) PORT_NAME("Test Switch") PORT_CODE(KEYCODE_F2)
477   PORT_SERVICE_NO_TOGGLE( 0x200000, IP_ACTIVE_LOW )
478478   PORT_BIT( 0x400000, IP_ACTIVE_LOW, IPT_UNKNOWN )
479479   PORT_BIT( 0x800000, IP_ACTIVE_LOW, IPT_UNKNOWN )
480480
src/mame/drivers/cps3.c
r1679r1680
24372437   PORT_BIT( 0x00004000, IP_ACTIVE_LOW, IPT_BUTTON3 ) PORT_PLAYER(2)
24382438   PORT_BIT( 0x00008000, IP_ACTIVE_LOW, IPT_UNUSED ) // nothing here?
24392439   PORT_BIT( 0x00010000, IP_ACTIVE_LOW, IPT_SERVICE1 )
2440   PORT_BIT( 0x00020000, IP_ACTIVE_LOW, IPT_SERVICE ) PORT_NAME( DEF_STR( Service_Mode )) PORT_CODE(KEYCODE_F2)
2440   PORT_SERVICE_NO_TOGGLE( 0x00020000, IP_ACTIVE_LOW )
24412441   PORT_BIT( 0x00fc0000, IP_ACTIVE_LOW, IPT_UNUSED ) // nothing here?
24422442   PORT_BIT( 0x01000000, IP_ACTIVE_LOW, IPT_COIN1 )
24432443   PORT_BIT( 0x02000000, IP_ACTIVE_LOW, IPT_COIN2 )
r1679r1680
25222522   {
25232523      fastboot_timer = timer_alloc(fastboot_timer_callback, NULL);
25242524   //  printf("reset\n");
2525      timer_adjust(fastboot_timer, attotime_zero, 0, attotime_zero);
2525      timer_adjust_oneshot(fastboot_timer, attotime_zero, 0);
25262526   }
25272527}
25282528
src/mame/drivers/spiders.c
r1679r1680
2121    $0000-$1bff Video Memory (bit0)
2222    $4000-$5bff Video Memory (bit1)
2323    $8000-$9bff Video Memory (bit2)
24    $c000-$c001 6845 CRT Controller (crtc6845)
24    $c000-$c001 6845 CRT Controller (mc6845)
2525    $c020-$c027 NVRAM
2626    $c044-$c047 MC6821 PIA 1 (Control input port - all input)
2727    $c048-$c04b MC6821 PIA 2 (Sprite data port - see machine/spiders.c)
r1679r1680
3636    $0000-$1bff Video Memory (bit0)
3737    $4000-$5bff Video Memory (bit1)
3838    $8000-$9bff Video Memory (bit2)
39    $c000-$c001 6845 CRT Controller (crtc6845)
39    $c000-$c001 6845 CRT Controller (mc6845)
4040    $c044-$c047 MC6821 PIA 1
4141    $c048-$c04b MC6821 PIA 2 (Video port)
4242    $c050-$c053 MC6821 PIA 3
r1679r1680
192192#include "deprecat.h"
193193#include "cpu/m6800/m6800.h"
194194#include "cpu/m6809/m6809.h"
195#include "video/crtc6845.h"
195#include "video/mc6845.h"
196196#include "machine/6821pia.h"
197197#include "machine/74123.h"
198198#include "spiders.h"
r1679r1680
203203#define CRTC_CLOCK            (MAIN_CPU_MASTER_CLOCK / 16)
204204
205205
206static mc6845_t *mc6845;
206207static UINT8 *spiders_ram;
207208static UINT8 flipscreen;
208209static UINT16 gfx_rom_address;
r1679r1680
409410#define NUM_PENS   (8)
410411
411412
413static WRITE8_HANDLER( spiders_mc6845_address_w )
414{
415   mc6845_address_w(mc6845, data);
416}
417
418
419static READ8_HANDLER( spiders_mc6845_register_r )
420{
421   return mc6845_register_r(mc6845);
422}
423
424
425static WRITE8_HANDLER( spiders_mc6845_register_w )
426{
427   mc6845_register_w(mc6845, data);
428}
429
430
412431static WRITE8_HANDLER( flipscreen_w )
413432{
414433   flipscreen = data;
415434}
416435
417436
418static void *begin_update(running_machine *machine, int screen,
419                    mame_bitmap *bitmap, const rectangle *cliprect)
437static void *begin_update(mame_bitmap *bitmap, const rectangle *cliprect)
420438{
421439   /* create the pens */
422440   offs_t i;
r1679r1680
497515}
498516
499517
500static const crtc6845_interface crtc6845_intf =
518static const mc6845_interface mc6845_intf =
501519{
502520   0,                  /* screen we are acting on */
503521   CRTC_CLOCK,          /* the clock (pin 21) of the chip */
r1679r1680
512530static VIDEO_START( spiders )
513531{
514532   /* configure the CRT controller */
515   crtc6845_config(0, &crtc6845_intf);
533   mc6845 = mc6845_config(&mc6845_intf);
516534}
517535
518536
537static VIDEO_UPDATE( spiders )
538{
539   mc6845_update(mc6845, bitmap, cliprect);
519540
541   return 0;
542}
543
544
545
520546/*************************************
521547 *
522548 *  Graphics ROM access - see the
r1679r1680
565591
566592static ADDRESS_MAP_START( spiders_main_map, ADDRESS_SPACE_PROGRAM, 8 )
567593   AM_RANGE(0x0000, 0xbfff) AM_RAM AM_BASE(&spiders_ram)
568   AM_RANGE(0xc000, 0xc000) AM_WRITE(crtc6845_address_w)
569   AM_RANGE(0xc001, 0xc001) AM_READWRITE(crtc6845_register_r, crtc6845_register_w)
594   AM_RANGE(0xc000, 0xc000) AM_WRITE(spiders_mc6845_address_w)
595   AM_RANGE(0xc001, 0xc001) AM_READWRITE(spiders_mc6845_register_r, spiders_mc6845_register_w)
570596   AM_RANGE(0xc020, 0xc027) AM_RAM AM_BASE(&generic_nvram) AM_SIZE(&generic_nvram_size)
571597   AM_RANGE(0xc044, 0xc047) AM_READWRITE(pia_1_r, pia_1_w)
572598   AM_RANGE(0xc048, 0xc04b) AM_READWRITE(pia_2_alt_r, pia_2_alt_w)
r1679r1680
597623    PORT_START      /* IN0 */
598624   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_SERVICE1 )
599625   PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_COIN1 )
600   PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_SERVICE ) PORT_NAME( DEF_STR( Service_Mode )) PORT_CODE(KEYCODE_F2)
626   PORT_SERVICE_NO_TOGGLE( 0x04, IP_ACTIVE_HIGH )
601627    PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_BUTTON1 ) PORT_PLAYER(1)
602628   PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_BUTTON1 ) PORT_PLAYER(2)
603629    PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_START1 )
r1679r1680
702728   /* video hardware */
703729   MDRV_VIDEO_ATTRIBUTES(VIDEO_TYPE_RASTER)
704730   MDRV_VIDEO_START(spiders)
705   MDRV_VIDEO_UPDATE(crtc6845)
731   MDRV_VIDEO_UPDATE(spiders)
706732
707733   MDRV_SCREEN_ADD("main", 0)
708734   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_RGB32)
src/mame/drivers/toaplan2.c
r1679r1680
431431   current_bank = 2;
432432   memory_set_bankptr(1, &Z80[0x10000]);
433433
434   NMK112_init(0);
434435   MACHINE_RESET_CALL(toaplan2);
435436}
436437
src/mame/drivers/jailbrek.c
r1679r1680
251251   /* video hardware */
252252   MDRV_VIDEO_ATTRIBUTES(VIDEO_TYPE_RASTER)
253253   MDRV_GFXDECODE(jailbrek)
254   MDRV_PALETTE_LENGTH(32)
255   MDRV_COLORTABLE_LENGTH(512)
254   MDRV_PALETTE_LENGTH(512)
256255
257256   MDRV_SCREEN_ADD("main", 0)
258257   MDRV_SCREEN_RAW_PARAMS(MASTER_CLOCK/3, 396, 8, 248, 256, 16, 240)
src/mame/drivers/couple.c
r1679r1680
3636#include "driver.h"
3737#include "machine/8255ppi.h"
3838#include "sound/ay8910.h"
39#include "video/crtc6845.h"
39#include "video/mc6845.h"
4040
4141static tilemap *bg_tilemap;
42static mc6845_t *mc6845;
4243static UINT8 *vram_lo,*vram_hi;
4344static UINT8 *backup_ram;
4445
r1679r1680
5354---- ---- xxxx xxxx tile number
5455*/
5556
57static WRITE8_HANDLER( couple_mc6845_address_w )
58{
59   mc6845_address_w(mc6845, data);
60}
61
62static WRITE8_HANDLER( couple_mc6845_register_w )
63{
64   mc6845_register_w(mc6845, data);
65}
66
5667static TILE_GET_INFO( get_tile_info )
5768{
5869   UINT16 vram_data = (((vram_hi[tile_index] & 0xff) << 8) | (vram_lo[tile_index] & 0xff));
r1679r1680
6576
6677static VIDEO_START( couple )
6778{
68   bg_tilemap = tilemap_create(get_tile_info,tilemap_scan_rows,TILEMAP_TYPE_PEN,8,8,64,32);
79   mc6845 = mc6845_config(NULL);
80   bg_tilemap = tilemap_create(get_tile_info,tilemap_scan_rows,8,8,64,32);
6981}
7082
7183static VIDEO_UPDATE( couple )
r1679r1680
146158//  AM_RANGE( 0xc000, 0xc00f ) AM_READ(dummy_inputs_r)
147159//  AM_RANGE( 0xc008, 0xc008 ) AM_READ(input_port_0_r)
148160//  AM_RANGE( 0xc00a, 0xc00a ) AM_READ(input_port_1_r)
149     AM_RANGE( 0xe000, 0xe000 ) AM_WRITE(crtc6845_address_w)
150     AM_RANGE( 0xe001, 0xe001 ) AM_WRITE(crtc6845_register_w)
161     AM_RANGE( 0xe000, 0xe000 ) AM_WRITE(couple_mc6845_address_w)
162     AM_RANGE( 0xe001, 0xe001 ) AM_WRITE(couple_mc6845_register_w)
151163   AM_RANGE( 0xe800, 0xefff ) AM_READWRITE(MRA8_RAM, couple_vram_hi_w) AM_BASE(&vram_hi)
152164   AM_RANGE( 0xf000, 0xf7ff ) AM_READWRITE(MRA8_RAM, couple_vram_lo_w) AM_BASE(&vram_lo)
153165   AM_RANGE( 0xf800, 0xfbff ) AM_RAM /*extra VRAM?*/
src/mame/drivers/seattle.c
r1679r1680
916916
917917   /* if we're a timer, adjust the timer to fire again */
918918   if (galileo.reg[GREG_TIMER_CONTROL] & (2 << (2 * which)))
919      timer_adjust(timer->timer, attotime_mul(TIMER_PERIOD, timer->count), which, attotime_zero);
919      timer_adjust_oneshot(timer->timer, attotime_mul(TIMER_PERIOD, timer->count), which);
920920   else
921921      timer->active = timer->count = 0;
922922
r1679r1680
12271227                  if (which != 0)
12281228                     timer->count &= 0xffffff;
12291229               }
1230               timer_adjust(timer->timer, attotime_mul(TIMER_PERIOD, timer->count), which, attotime_zero);
1230               timer_adjust_oneshot(timer->timer, attotime_mul(TIMER_PERIOD, timer->count), which);
12311231               if (LOG_TIMERS)
12321232                  logerror("Adjusted timer to fire in %f secs\n", attotime_to_double(attotime_mul(TIMER_PERIOD, timer->count)));
12331233            }
r1679r1680
12361236               UINT32 elapsed = attotime_to_double(attotime_mul(timer_timeelapsed(timer->timer), SYSTEM_CLOCK));
12371237               timer->active = 0;
12381238               timer->count = (timer->count > elapsed) ? (timer->count - elapsed) : 0;
1239               timer_adjust(timer->timer, attotime_never, which, attotime_zero);
1239               timer_adjust_oneshot(timer->timer, attotime_never, which);
12401240               if (LOG_TIMERS)
12411241                  logerror("Disabled timer\n");
12421242            }
r1679r1680
18121812   PORT_BIT( 0x0002, IP_ACTIVE_LOW, IPT_COIN2 )
18131813   PORT_BIT( 0x0004, IP_ACTIVE_LOW, IPT_START1 )
18141814   PORT_BIT( 0x0008, IP_ACTIVE_LOW, IPT_TILT )
1815   PORT_BIT( 0x0010, IP_ACTIVE_LOW, IPT_SERVICE ) PORT_NAME( DEF_STR( Service_Mode )) PORT_CODE(KEYCODE_F2) /* Test switch */
1815   PORT_SERVICE_NO_TOGGLE( 0x0010, IP_ACTIVE_LOW )
18161816   PORT_BIT( 0x0020, IP_ACTIVE_LOW, IPT_START2 )
18171817   PORT_BIT( 0x0040, IP_ACTIVE_LOW, IPT_SERVICE1 )
18181818   PORT_BIT( 0x0080, IP_ACTIVE_LOW, IPT_COIN3 )
src/mame/drivers/tetrisp2.c
r1679r1680
113113      if (offset == 0x0c)
114114      {
115115         attotime timer = attotime_mul(ROCKN_TIMER_BASE, 4096 - data);
116         timer_adjust(rockn_timer_l4, timer, 0, timer);
116         timer_adjust_periodic(rockn_timer_l4, timer, 0, timer);
117117      }
118118   }
119119}
r1679r1680
127127      if (offset == 0x0c)
128128      {
129129         attotime timer = attotime_mul(ROCKN_TIMER_BASE, 4096 - data);
130         timer_adjust(rockn_timer_sub_l4, timer, 0, timer);
130         timer_adjust_periodic(rockn_timer_sub_l4, timer, 0, timer);
131131      }
132132   }
133133}
src/mame/drivers/lucky8.c
r1679r1680
8686static VIDEO_START(lucky8)
8787{
8888   bg_tilemap = tilemap_create(get_bg_tile_info, tilemap_scan_rows,
89      TILEMAP_TYPE_PEN, 8, 8, 64, 32);
89      8, 8, 64, 32);
9090}
9191
9292static VIDEO_UPDATE(lucky8)
src/mame/drivers/tmaster.c
r1679r1680
11/***************************************************************************
22
3                          -= Touch Master Games =-
3                      -= Touch Master / Galaxy Games =-
44
55                    driver by   Luca Elia (l.elia@tin.it)
66
r1679r1680
88CPU:    68000
99Video:  Blitter, double framebuffer
1010Sound:  OKI6295
11
12[Touch Master]
13
1114Input:  Pressure sensitive touch screen
1215Other:  Dallas NVRAM + optional RTC
13
14
1516To Do:
1617
1718- Proper touchscreen controller emulation. Currently it's flakey and
r1679r1680
2122- RTC emulation (there's code to check the upper bytes of NVRAM to see if
2223  the real time clock is present, and to only use it in that case)
2324
25[Galaxy Games]
2426
27Input:  Trackballs and buttons
28Other:  EEPROM
29To Do:
30
31- Coin optics
32
2533***************************************************************************/
2634
2735#include "driver.h"
2836#include "deprecat.h"
2937#include "sound/okim6295.h"
38#include "machine/eeprom.h"
3039
3140/***************************************************************************
3241
r1679r1680
125134
126135                                Video & Blitter
127136
137
138    Offset:     Bits:           Value:
139
140        02
141                fedc ba-- ---- ----
142                ---- --9- ---- ----       Layer 1 Buffer To Display
143                ---- ---8 ---- ----       Layer 0 Buffer To Display
144                ---- ---- 7654 3210
145
146        04                                Width
147        06                                X
148
149        08                                Height - 1
150        0A                                Y
151
152        0C                                Source Address (low)
153        0E                                Source Address (mid)
154
155        10      fedc ba98 ---- ----
156                ---- ---- 7--- ----       Layer
157                ---- ---- -6-- ----       Buffer
158                ---- ---- --5- ----       Solid Fill
159                ---- ---- ---4 ----       flipped by lev.3 interrupt routine
160                ---- ---- ---- 3---       flipped by lev.2 interrupt routine
161                ---- ---- ---- -2--       flipped by lev.1 interrupt routine
162                ---- ---- ---- --1-       Flip Y
163                ---- ---- ---- ---0       Flip X
164
165        12      fedc ba98 ---- ----       Solid Fill Pen
166                ---- ---- 7654 3210       Source Address (high)
167
168    A write to the source address (high) triggers the blit.
169    A the end of the blit, a level 2 IRQ is issued.
170
128171***************************************************************************/
129172
130static mame_bitmap *tmaster_bitmap[2];
173static mame_bitmap *tmaster_bitmap[2][2];   // 2 layers, 2 buffers per layer
131174static UINT16 *tmaster_regs;
132175static UINT16 tmaster_color;
133176static UINT16 tmaster_addr;
177static int (*compute_addr) (UINT16 reg_low, UINT16 reg_mid, UINT16 reg_high);
134178
179int tmaster_compute_addr(UINT16 reg_low, UINT16 reg_mid, UINT16 reg_high)
180{
181   return (reg_low & 0xff) | ((reg_mid & 0x1ff) << 8) | (reg_high << 17);
182}
183
184int galgames_compute_addr(UINT16 reg_low, UINT16 reg_mid, UINT16 reg_high)
185{
186   return reg_low | (reg_mid << 16);
187}
188
135189static VIDEO_START( tmaster )
136190{
137   int i;
138   for (i = 0; i < 2; i++)
139      tmaster_bitmap[i] = auto_bitmap_alloc(machine->screen[0].width,machine->screen[0].height,machine->screen[0].format);
191   int layer, buffer;
192   for (layer = 0; layer < 2; layer++)
193   {
194      for (buffer = 0; buffer < 2; buffer++)
195      {
196         tmaster_bitmap[layer][buffer] = auto_bitmap_alloc(machine->screen[0].width,machine->screen[0].height,machine->screen[0].format);
197         bitmap_fill(tmaster_bitmap[layer][buffer], NULL, 0xff);
198      }
199   }
200
201   compute_addr = tmaster_compute_addr;
140202}
141203
204static VIDEO_START( galgames )
205{
206   VIDEO_START_CALL( tmaster );
207   compute_addr = galgames_compute_addr;
208}
209
142210static VIDEO_UPDATE( tmaster )
143211{
144   // double buffering
145   copybitmap(bitmap,tmaster_bitmap[(tmaster_regs[0x02/2]>>8)&1],0,0,0,0,cliprect);
212   int layers_ctrl = -1;
146213
147   show_touchscreen();
214#ifdef MAME_DEBUG
215   if (input_code_pressed(KEYCODE_Z))
216   {
217      int mask = 0;
218      if (input_code_pressed(KEYCODE_Q))   mask |= 1;
219      if (input_code_pressed(KEYCODE_W))   mask |= 2;
220      if (mask != 0) layers_ctrl &= mask;
221   }
222#endif
223
224
225   if (layers_ctrl & 1)   copybitmap         (bitmap,tmaster_bitmap[0][(tmaster_regs[0x02/2]>>8)&1],0,0,0,0,&machine->screen[0].visarea);
226   else               fillbitmap(bitmap,get_black_pen(machine),cliprect);
227
228   if (layers_ctrl & 2)   copybitmap_trans   (bitmap,tmaster_bitmap[1][(tmaster_regs[0x02/2]>>9)&1],0,0,0,0,&machine->screen[0].visarea,0xff);
229
148230   return 0;
149231}
150232
151233static WRITE16_HANDLER( tmaster_color_w )
152234{
153235   COMBINE_DATA( &tmaster_color );
236#if 0
154237   if (tmaster_color & ~7)
155238      logerror("%06x: color %04x\n", activecpu_get_pc(), tmaster_color);
239#endif
156240}
157241
158242static WRITE16_HANDLER( tmaster_addr_w )
r1679r1680
162246
163247static void tmaster_draw(void)
164248{
165   int x,y,x0,x1,y0,y1,dx,dy,flipx,flipy,sx,sy,sw,sh, addr, mode, dest;
249   int x,y,x0,x1,y0,y1,dx,dy,flipx,flipy,sx,sy,sw,sh, addr, mode, layer,buffer, color;
166250
167251   UINT8 *gfxdata   =   memory_region( REGION_GFX1 );
168252   size_t size      =   memory_region_length( REGION_GFX1 );
r1679r1680
171255
172256   mame_bitmap *bitmap;
173257
174   dest   =    (tmaster_regs[0x02/2] >> 8) & 1;
175    sw      =     tmaster_regs[0x04/2];
176   sx      =     tmaster_regs[0x06/2];
177   sh      =     tmaster_regs[0x08/2] + 1;
178   sy      =     tmaster_regs[0x0a/2];
179   addr   =   ( tmaster_regs[0x0c/2] & 0xff) |
180            ((tmaster_regs[0x0e/2] & 0x1ff) << 8) | (tmaster_addr << 17);
181   mode   =     tmaster_regs[0x10/2];
258   buffer   =   (tmaster_regs[0x02/2] >> 8) & 3;   // 1 bit per layer, selects the currently displayed buffer
259    sw      =    tmaster_regs[0x04/2];
260   sx      =    tmaster_regs[0x06/2];
261   sh      =    tmaster_regs[0x08/2] + 1;
262   sy      =    tmaster_regs[0x0a/2];
263   addr   =   compute_addr(
264             tmaster_regs[0x0c/2],
265             tmaster_regs[0x0e/2], tmaster_addr);
266   mode   =    tmaster_regs[0x10/2];
182267
183   dest   ^=   (mode >> 6) & 1;
184   bitmap   =   tmaster_bitmap[dest];
268   layer   =   (mode >> 7) & 1;   // layer to draw to
269   buffer   =   ((mode >> 6) & 1) ^ ((buffer >> layer) & 1);   // bit 6 selects whether to use the opposite buffer to that displayed
270   bitmap   =   tmaster_bitmap[layer][buffer];
185271
186272   addr <<= 1;
187273
r1679r1680
200286   if (flipy)   { y0 = sh-1;   y1 = -1;   dy = -1;   sy -= sh-1;   }
201287   else      { y0 = 0;      y1 = sh;   dy = +1;   }
202288
289   sx = (sx & 0x7fff) - (sx & 0x8000);
290   sy = (sy & 0x7fff) - (sy & 0x8000);
291
292   color = (tmaster_color & 7) << 8;
293
203294   switch (mode & 0x20)
204295   {
205296      case 0x00:                     // blit with transparency
206         if (addr > (size - sw*sh))
297         if (addr > size - sw*sh)
207298         {
208299            logerror("%06x: blit error, addr %06x out of bounds\n", activecpu_get_pc(),addr);
209            return;
300            addr = size - sw*sh;
210301         }
211302
212303         for (y = y0; y != y1; y += dy)
r1679r1680
216307               data = gfxdata[addr++];
217308
218309               if ((data != 0xff) && (sx + x >= 0) && (sx + x < 400) && (sy + y >= 0) && (sy + y < 256))
219                  *BITMAP_ADDR16(bitmap, sy + y, sx + x) = data + ((tmaster_color & 7) << 8);
310                  *BITMAP_ADDR16(bitmap, sy + y, sx + x) = data + color;
220311            }
221312         }
222313         break;
223314
224315      case 0x20:                     // solid fill
225         data = tmaster_addr & 0xff;
316         data = ((tmaster_addr >> 8) & 0xff) + color;
226317         for (y = y0; y != y1; y += dy)
227318         {
228319            for (x = x0; x != x1; x += dx)
229320            {
230321               if ((sx + x >= 0) && (sx + x < 400) && (sy + y >= 0) && (sy + y < 256))
231                  *BITMAP_ADDR16(bitmap, sy + y, sx + x) = data + ((tmaster_color & 7) << 8);
322                  *BITMAP_ADDR16(bitmap, sy + y, sx + x) = data;
232323            }
233324         }
234325         break;
r1679r1680
259350
260351***************************************************************************/
261352
353/***************************************************************************
354                                Touch Master
355***************************************************************************/
356
262357static READ16_HANDLER( tmaster_coins_r )
263358{
264359   return readinputportbytag("COIN")|(mame_rand(Machine)&0x0800);
r1679r1680
296391
297392
298393/***************************************************************************
394                                Galaxy Games
395***************************************************************************/
299396
397// NVRAM
398
399static const struct EEPROM_interface galgames_eeprom_interface =
400{
401   10,               // address bits 10
402   8,               // data bits    8
403   "*1100",         // read         110 0aaaaaaaaaa
404   "*1010",         // write        101 0aaaaaaaaaa dddddddd
405   "*1110",         // erase        111 0aaaaaaaaaa
406   "*10000xxxxxxxxx",   // lock         100 00xxxxxxxxx
407   "*10011xxxxxxxxx",   // unlock       100 11xxxxxxxxx
408   0,               // multi_read
409   1               // reset_delay
410};
411
412static READ16_HANDLER( galgames_eeprom_r )
413{
414   return EEPROM_read_bit() ? 0x80 : 0x00;
415}
416
417static WRITE16_HANDLER( galgames_eeprom_w )
418{
419   if (data & ~0x0003)
420      logerror("CPU #0 PC: %06X - Unknown EEPROM bit written %04X\n",activecpu_get_pc(),data);
421
422   if ( ACCESSING_LSB )
423   {
424      // latch the bit
425      EEPROM_write_bit(data & 0x0001);
426
427      // clock line asserted: write latch or select next bit to read
428      EEPROM_set_clock_line((data & 0x0002) ? ASSERT_LINE : CLEAR_LINE );
429   }
430}
431
432static NVRAM_HANDLER( galgames )
433{
434   if (read_or_write)
435      EEPROM_save(file);
436   else
437   {
438      EEPROM_init(&galgames_eeprom_interface);
439      if (file)   EEPROM_load(file);
440   }
441}
442
443// BT481A Palette RAMDAC
444static UINT32 palette_offset;
445static UINT8 palette_index;
446static UINT8 palette_data[3];
447
448static WRITE16_HANDLER( galgames_palette_offset_w )
449{
450   if (ACCESSING_LSB)
451   {
452      palette_offset = data & 0xff;
453      palette_index = 0;
454   }
455}
456static WRITE16_HANDLER( galgames_palette_data_w )
457{
458   if (ACCESSING_LSB)
459   {
460      palette_data[palette_index] = data & 0xff;
461      if (++palette_index == 3)
462      {
463         palette_set_color(Machine, palette_offset, MAKE_RGB(palette_data[0], palette_data[1], palette_data[2]));
464         palette_index = 0;
465         palette_offset++;
466      }
467   }
468}
469
470// Sound
471static READ16_HANDLER( galgames_okiram_r )
472{
473   return memory_region(REGION_SOUND1)[offset] | 0xff00;
474}
475static WRITE16_HANDLER( galgames_okiram_w )
476{
477   if (ACCESSING_LSB)
478      memory_region(REGION_SOUND1)[offset] = data & 0xff;
479}
480
481
482// Carts communication (preliminary, no cart is dumped yet)
483
484static WRITE16_HANDLER( galgames_cart_sel_w )
485{
486   // cart selection (0 1 2 3 4 7)
487
488   // 7 resets the eeprom
489   if (ACCESSING_LSB)
490      EEPROM_set_cs_line(((data&0xff) == 0x07) ? ASSERT_LINE : CLEAR_LINE);
491}
492
493static READ16_HANDLER( galgames_cart_clock_r )
494{
495   return 0x0080;
496}
497
498static WRITE16_HANDLER( galgames_cart_clock_w )
499{
500   if (ACCESSING_LSB)
501   {
502      // bit 3 = clock
503
504      // ROM/RAM banking
505      if ((data & 0xf7) == 0x05)
506      {
507         memory_set_bank(1, 1);   // ram
508         memory_set_bank(3, 0);   // rom
509         logerror("%06x: romram bank = %04x\n", activecpu_get_pc(), data);
510      }
511      else
512      {
513         memory_set_bank(1, 0);   // rom
514         logerror("%06x: unknown romram bank = %04x\n", activecpu_get_pc(), data);
515      }
516   }
517}
518
519static READ16_HANDLER( galgames_cart_data_r )
520{
521   return 0;
522}
523static WRITE16_HANDLER( galgames_cart_data_w )
524{
525}
526
527
528static READ16_HANDLER( dummy_read_01 )
529{
530   return 0x3;   // Pass the check at PC = 0xfae & a later one
531}
532
533static ADDRESS_MAP_START( galgames_map, ADDRESS_SPACE_PROGRAM, 16 )
534
535   AM_RANGE( 0x000000, 0x03ffff ) AM_READWRITE(MRA16_BANK1, MWA16_BANK2)
536   AM_RANGE( 0x040000, 0x1fffff ) AM_ROM AM_REGION( REGION_CPU1, 0 )
537   AM_RANGE( 0x200000, 0x23ffff ) AM_READWRITE(MRA16_BANK3, MWA16_BANK4)
538   AM_RANGE( 0x240000, 0x3fffff ) AM_ROM AM_REGION( REGION_CPU1, 0 )
539
540   AM_RANGE( 0x400000, 0x400011 ) AM_WRITE( tmaster_blitter_w ) AM_BASE( &tmaster_regs )
541   AM_RANGE( 0x400012, 0x400013 ) AM_WRITE( tmaster_addr_w )
542   AM_RANGE( 0x400014, 0x400015 ) AM_WRITE( tmaster_color_w )
543   AM_RANGE( 0x400020, 0x400021 ) AM_READ ( tmaster_blitter_r )
544
545   AM_RANGE( 0x600000, 0x600001 ) AM_READWRITE( dummy_read_01, MWA16_NOP )
546   AM_RANGE( 0x700000, 0x700001 ) AM_READWRITE( dummy_read_01, MWA16_NOP )
547   AM_RANGE( 0x800020, 0x80003f ) AM_NOP   // ?
548   AM_RANGE( 0x900000, 0x900001 ) AM_WRITE( watchdog_reset16_w )
549
550   AM_RANGE( 0xa00000, 0xa00001 ) AM_READWRITE( OKIM6295_status_0_lsb_r, OKIM6295_data_0_lsb_w )
551   AM_RANGE( 0xb00000, 0xb7ffff ) AM_READWRITE( galgames_okiram_r, galgames_okiram_w ) // (only low bytes tested) 4x N341024SJ-15
552
553   AM_RANGE( 0xc00000, 0xc00001 ) AM_WRITE( galgames_palette_offset_w )
554   AM_RANGE( 0xc00002, 0xc00003 ) AM_WRITE( galgames_palette_data_w )
555
556   AM_RANGE( 0xd00000, 0xd00001 ) AM_READ ( input_port_0_word_r )   // trackball p1 x
557   AM_RANGE( 0xd00000, 0xd00001 ) AM_WRITE( MWA16_NOP )
558   AM_RANGE( 0xd00002, 0xd00003 ) AM_READ ( input_port_1_word_r )   // trackball p1 y
559   AM_RANGE( 0xd00004, 0xd00005 ) AM_READ ( input_port_2_word_r )   // trackball p2 x
560   AM_RANGE( 0xd00006, 0xd00007 ) AM_READ ( input_port_3_word_r )   // trackball p2 y
561   AM_RANGE( 0xd00008, 0xd00009 ) AM_READ ( input_port_4_word_r )
562   AM_RANGE( 0xd0000a, 0xd0000b ) AM_READ ( input_port_5_word_r )
563   AM_RANGE( 0xd0000c, 0xd0000d ) AM_READWRITE( input_port_6_word_r, MWA16_NOP )
564
565   AM_RANGE( 0xd0000e, 0xd0000f ) AM_WRITE ( galgames_cart_sel_w )
566   AM_RANGE( 0xd00010, 0xd00011 ) AM_READWRITE( galgames_eeprom_r, galgames_eeprom_w )
567   AM_RANGE( 0xd00012, 0xd00013 ) AM_READWRITE( galgames_cart_data_r, galgames_cart_data_w )
568   AM_RANGE( 0xd00014, 0xd00015 ) AM_READWRITE( galgames_cart_clock_r, galgames_cart_clock_w )
569
570ADDRESS_MAP_END
571
572
573/***************************************************************************
574
300575                                Input Ports
301576
302577***************************************************************************/
r1679r1680
329604   PORT_BIT( 0x8000, IP_ACTIVE_LOW,  IPT_COIN4      )   // e. coin 4
330605INPUT_PORTS_END
331606
607static INPUT_PORTS_START( galgames )
608   PORT_START_TAG("TRACKBALL_1_X")
609    PORT_BIT( 0xff, 0x00, IPT_TRACKBALL_X ) PORT_SENSITIVITY(25) PORT_KEYDELTA(5) PORT_PLAYER(1) PORT_RESET
610   PORT_START_TAG("TRACKBALL_1_Y")
611    PORT_BIT( 0xff, 0x00, IPT_TRACKBALL_Y ) PORT_SENSITIVITY(25) PORT_KEYDELTA(5) PORT_PLAYER(1) PORT_RESET
332612
613   PORT_START_TAG("TRACKBALL_2_X")
614    PORT_BIT( 0xff, 0x00, IPT_TRACKBALL_X ) PORT_SENSITIVITY(25) PORT_KEYDELTA(5) PORT_PLAYER(2) PORT_RESET
615   PORT_START_TAG("TRACKBALL_2_Y")
616    PORT_BIT( 0xff, 0x00, IPT_TRACKBALL_Y ) PORT_SENSITIVITY(25) PORT_KEYDELTA(5) PORT_PLAYER(2) PORT_RESET
617
618   PORT_START_TAG("IN4")
619   PORT_BIT( 0x0001, IP_ACTIVE_LOW, IPT_UNKNOWN )
620   PORT_BIT( 0x0002, IP_ACTIVE_LOW, IPT_UNKNOWN )
621   PORT_BIT( 0x0004, IP_ACTIVE_LOW, IPT_UNKNOWN )
622   PORT_BIT( 0x0008, IP_ACTIVE_LOW, IPT_UNKNOWN )
623   PORT_BIT( 0x0010, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_PLAYER(1)   // Button A (right)
624   PORT_BIT( 0x0020, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(1)   // Button B (left)
625   PORT_BIT( 0x0040, IP_ACTIVE_LOW, IPT_UNKNOWN )
626   PORT_BIT( 0x0080, IP_ACTIVE_LOW, IPT_UNKNOWN )
627   PORT_BIT( 0xff00, IP_ACTIVE_LOW, IPT_UNKNOWN )
628
629   PORT_START_TAG("IN5")
630   PORT_BIT( 0x0001, IP_ACTIVE_LOW, IPT_UNKNOWN )
631   PORT_BIT( 0x0002, IP_ACTIVE_LOW, IPT_UNKNOWN )
632   PORT_BIT( 0x0004, IP_ACTIVE_LOW, IPT_UNKNOWN )
633   PORT_BIT( 0x0008, IP_ACTIVE_LOW, IPT_UNKNOWN )
634   PORT_BIT( 0x0010, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_PLAYER(2)   // Button A (right)
635   PORT_BIT( 0x0020, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(2)   // Button B (left)
636   PORT_BIT( 0x0040, IP_ACTIVE_LOW, IPT_SERVICE1)               // DBA (coin)
637   PORT_BIT( 0x0080, IP_ACTIVE_LOW, IPT_UNKNOWN )
638   PORT_BIT( 0xff00, IP_ACTIVE_LOW, IPT_UNKNOWN )
639
640   PORT_START_TAG("IN6")
641   PORT_BIT( 0x0001, IP_ACTIVE_LOW, IPT_COIN1 )   // CS 1 (coin)
642   PORT_BIT( 0x0002, IP_ACTIVE_LOW, IPT_COIN2 )   // CS 2 (coin)
643   PORT_SERVICE_NO_TOGGLE( 0x0004, IP_ACTIVE_LOW )   // System Check
644   PORT_BIT( 0x0008, IP_ACTIVE_LOW, IPT_UNKNOWN )
645   PORT_BIT( 0x0010, IP_ACTIVE_LOW, IPT_UNKNOWN )
646   PORT_BIT( 0x0020, IP_ACTIVE_LOW, IPT_UNKNOWN )
647   PORT_BIT( 0x0040, IP_ACTIVE_LOW, IPT_UNKNOWN )
648   PORT_BIT( 0x0080, IP_ACTIVE_LOW, IPT_UNKNOWN )
649   PORT_BIT( 0xff00, IP_ACTIVE_LOW, IPT_UNKNOWN )
650INPUT_PORTS_END
651
652
333653/***************************************************************************
334654
335655                               Machine Drivers
r1679r1680
408728MACHINE_DRIVER_END
409729
410730
731static INTERRUPT_GEN( galgames_interrupt )
732{
733   switch (cpu_getiloops())
734   {
735      case 0:      cpunum_set_input_line(machine, 0, 3, HOLD_LINE);   break;
736               // lev 2 triggered at the end of a blit
737      default:   cpunum_set_input_line(machine, 0, 1, HOLD_LINE);   break;
738   }
739}
740
741static MACHINE_RESET( galgames )
742{
743   memory_set_bank(1, 0);   // rom
744   memory_set_bank(3, 1);   // ram
745
746   memory_set_bank(2, 0);   // ram
747   memory_set_bank(4, 0);   // ram
748}
749
750static MACHINE_DRIVER_START( galgames )
751   MDRV_CPU_ADD_TAG("main", M68000, XTAL_24MHz / 2)
752   MDRV_CPU_PROGRAM_MAP(galgames_map,0)
753   MDRV_CPU_VBLANK_INT(galgames_interrupt, 1+20)   // ??
754
755   MDRV_NVRAM_HANDLER( galgames )
756   MDRV_MACHINE_RESET( galgames )
757
758   /* video hardware */
759   MDRV_VIDEO_ATTRIBUTES(VIDEO_TYPE_RASTER)
760   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
761
762   MDRV_SCREEN_REFRESH_RATE(60)
763   MDRV_SCREEN_VBLANK_TIME(DEFAULT_60HZ_VBLANK_DURATION)
764
765   MDRV_SCREEN_SIZE(400, 256)
766   MDRV_SCREEN_VISIBLE_AREA(0, 400-1, 0, 256-1)
767   MDRV_PALETTE_LENGTH(0x800)   // only 0x100 used
768
769   MDRV_VIDEO_START(galgames)
770   MDRV_VIDEO_UPDATE(tmaster)
771
772   /* sound hardware */
773   MDRV_SPEAKER_STANDARD_MONO("mono")
774
775   MDRV_SOUND_ADD(OKIM6295, XTAL_24MHz / 8)   // ??
776   MDRV_SOUND_CONFIG(okim6295_interface_region_1_pin7low) // clock frequency & pin 7 not verified
777   MDRV_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.0)
778MACHINE_DRIVER_END
779
411780/***************************************************************************
412781
413782                               ROMs Loading
r1679r1680
543912   ROM_LOAD( "tm4k_u8.bin", 0x00000, 0x100000, CRC(48c3782b) SHA1(bfe105ddbde8bbbd84665dfdd565d6d41926834a) )
544913ROM_END
545914
915/***************************************************************************
916
917Galaxy Games BIOS v. 1.90
918
919This is a multi-game cocktail cabinet released in 1998.  Namco seems to have
920made some cartridges for it (or at least licensed their IP).
921
922Trackball-based. 'BIOS' has 7 built-in games. There are two LEDs on the PCB.
923
924More information here : http://www.cesgames.com/museum/galaxy/index.html
925
926----
927
928Board silkscreend  237-0211-00
929                   REV.-D
930
931Cartridge based mother board
932Holds up to 4 cartridges
933Chips labeled
934    GALAXY U1 V1.90 12/1/98
935    GALAXY U2 V1.90 12/1/98
936
937NAMCO 307 Cartridge has surface mount Flash chips in it (not dumped).
938
939Motorola MC68HC000FN12
94024 MHz oscillator
941Xilinx XC5206
942Xilinx XC5202
943BT481AKPJ110 (Palette RAMDAC)
944NKK N341024SJ-15    x8  (128kB RAM)
945OKI M6295 8092352-2
946
947PAL16V8H-15 @ U24   Blue dot on it
948PAL16V8H-15 @ U25   Yellow dot on it
949PAL16V8H-15 @ U26   Red dot on it
950PAL16V8H-15 @ U27   Green dot on it
951PAL16V8H-15 @ U45   red dot on it
952
953***************************************************************************/
954
955ROM_START( galgbios )
956   ROM_REGION( 0x200000 + 0x40000, REGION_CPU1, 0 )
957   ROM_LOAD16_BYTE( "galaxy.u2", 0x1c0000, 0x020000, CRC(e51ff184) SHA1(aaa795f2c15ec29b3ceeb5c917b643db0dbb7083) )
958   ROM_CONTINUE(                 0x000000, 0x0e0000 )
959   ROM_LOAD16_BYTE( "galaxy.u1", 0x1c0001, 0x020000, CRC(c6d7bc6d) SHA1(93c032f9aa38cbbdda59a8a25ff9f38f7ad9c760) )
960   ROM_CONTINUE(                 0x000001, 0x0e0000 )
961   ROM_FILL(                     0x200000, 0x040000, 0)   // RAM
962
963   ROM_REGION( 0x200000, REGION_GFX1, 0 )
964   ROM_LOAD16_BYTE( "galaxy.u2", 0x000000, 0x100000, CRC(e51ff184) SHA1(aaa795f2c15ec29b3ceeb5c917b643db0dbb7083) )
965   ROM_LOAD16_BYTE( "galaxy.u1", 0x000001, 0x100000, CRC(c6d7bc6d) SHA1(93c032f9aa38cbbdda59a8a25ff9f38f7ad9c760) )
966
967   ROM_REGION( 0x40000, REGION_SOUND1, ROMREGION_ERASE )
968   // RAM, filled by the 68000 and fed to the OKI
969ROM_END
970
546971static DRIVER_INIT( tm3k )
547972{
548973   // try this if you need to calibrate
r1679r1680
569994   ROM[0x8346C/2] = 0x6002;
570995}
571996
572GAME( 1996, tm,   0, tm,   tmaster, 0,    ROT0, "Midway", "Touchmaster",              GAME_NOT_WORKING )
573GAME( 1997, tm3k, 0, tm3k, tmaster, tm3k, ROT0, "Midway", "Touchmaster 3000 (v5.01)", GAME_NOT_WORKING | GAME_IMPERFECT_GRAPHICS)
574GAME( 1998, tm4k, 0, tm3k, tmaster, tm4k, ROT0, "Midway", "Touchmaster 4000 (v6.02)", GAME_NOT_WORKING )
997static DRIVER_INIT( galgames )
998{
999   // configure memory banks
1000   memory_configure_bank(1, 0, 2, memory_region(REGION_CPU1)+0x1c0000, 0x40000);
1001   memory_configure_bank(3, 0, 2, memory_region(REGION_CPU1)+0x1c0000, 0x40000);
1002
1003   memory_configure_bank(2, 0, 1, memory_region(REGION_CPU1)+0x200000, 0x40000);
1004   memory_configure_bank(4, 0, 1, memory_region(REGION_CPU1)+0x200000, 0x40000);
1005}
1006
1007GAME( 1996, tm,       0, tm,       tmaster,  0,        ROT0, "Midway",                         "Touchmaster",               GAME_NOT_WORKING )
1008GAME( 1997, tm3k,     0, tm3k,     tmaster,  tm3k,     ROT0, "Midway",                         "Touchmaster 3000 (v5.01)",  GAME_NOT_WORKING | GAME_IMPERFECT_GRAPHICS)   // imp. graphics due to bad dump
1009GAME( 1998, tm4k,     0, tm3k,     tmaster,  tm4k,     ROT0, "Midway",                         "Touchmaster 4000 (v6.02)",  GAME_NOT_WORKING )
1010GAME( 1998, galgbios, 0, galgames, galgames, galgames, ROT0, "Creative Electonics & Software", "Galaxy Games (BIOS v1.90)", GAME_IS_BIOS_ROOT )
src/mame/drivers/namcos22.c
r1679r1680
35083508   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_COIN1 )
35093509   PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_UNKNOWN )
35103510   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_SERVICE1 )
3511   PORT_BIT(0x08, IP_ACTIVE_LOW, IPT_SERVICE ) PORT_NAME( DEF_STR( Service_Mode ) ) PORT_TOGGLE PORT_CODE(KEYCODE_F2)
3511   PORT_SERVICE( 0x08, IP_ACTIVE_LOW )
35123512   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_BUTTON1 ) /* DECISION */
35133513   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_BUTTON2 ) /* L SELECTION */
35143514   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_BUTTON3 ) /* R SELECTION */
r1679r1680
35893589   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_BUTTON5 )
35903590//  PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_UNKNOWN )
35913591   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_SERVICE1 )
3592   PORT_BIT(0x08, IP_ACTIVE_LOW, IPT_SERVICE ) PORT_NAME( DEF_STR( Service_Mode ) ) PORT_TOGGLE PORT_CODE(KEYCODE_F2)
3592   PORT_SERVICE( 0x08, IP_ACTIVE_LOW )
35933593   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_BUTTON2 ) /* Missle */
35943594   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_BUTTON1 ) /* Gun */
3595   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_START )
3595   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_START )
35963596   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_BUTTON4 )
35973597//  PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_UNKNOWN )
35983598
r1679r1680
36313631   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_COIN1 )
36323632   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_UNKNOWN )
36333633   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_SERVICE1 )
3634   PORT_BIT(0x08, IP_ACTIVE_LOW, IPT_SERVICE ) PORT_NAME( DEF_STR( Service_Mode ) ) PORT_TOGGLE PORT_CODE(KEYCODE_F2)
3634   PORT_SERVICE( 0x08, IP_ACTIVE_LOW )
36353635   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_BUTTON1 ) /* VIEW */
36363636   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_UNKNOWN )
36373637   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNKNOWN )
r1679r1680
36953695   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_COIN1 )
36963696   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_UNKNOWN )
36973697   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_SERVICE1 )
3698   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_SERVICE ) PORT_NAME( DEF_STR( Service_Mode ) ) PORT_TOGGLE PORT_CODE(KEYCODE_F2)
3698   PORT_SERVICE( 0x08, IP_ACTIVE_LOW )
36993699   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_UNKNOWN )
37003700   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_UNKNOWN )
37013701   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNKNOWN )
r1679r1680
37743774   PORT_BIT( 0x0080, IP_ACTIVE_LOW, IPT_UNKNOWN )
37753775   PORT_BIT( 0x0100, IP_ACTIVE_LOW, IPT_UNKNOWN )
37763776   PORT_BIT( 0x0200, IP_ACTIVE_LOW, IPT_COIN2 )
3777   PORT_BIT(0x0400, IP_ACTIVE_LOW, IPT_SERVICE ) PORT_NAME( DEF_STR( Service_Mode ) ) PORT_TOGGLE PORT_CODE(KEYCODE_F2)
3777   PORT_SERVICE( 0x0400, IP_ACTIVE_LOW )
37783778   PORT_BIT( 0x0800, IP_ACTIVE_LOW, IPT_SERVICE1 )
37793779   PORT_BIT( 0x1000, IP_ACTIVE_LOW, IPT_COIN1 )
37803780   PORT_BIT( 0x2000, IP_ACTIVE_LOW, IPT_UNKNOWN )
r1679r1680
38253825   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_COIN1 )
38263826   PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_UNKNOWN )
38273827   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_SERVICE1 )
3828   PORT_BIT(0x08, IP_ACTIVE_LOW, IPT_SERVICE ) PORT_NAME( DEF_STR( Service_Mode ) ) PORT_TOGGLE PORT_CODE(KEYCODE_F2)
3828   PORT_SERVICE( 0x08, IP_ACTIVE_LOW )
38293829   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_BUTTON1 ) /* shot */
38303830   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_BUTTON2 ) /* pedal */
38313831   PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_UNKNOWN )
src/mame/drivers/speglsht.c
r1679r1680
224224   PORT_DIPSETTING(    0x4000, DEF_STR( Japan ) )
225225   PORT_DIPSETTING(    0x0000, DEF_STR( USA ) )
226226   PORT_BIT( 0x00008000, IP_ACTIVE_LOW, IPT_UNUSED )
227   PORT_BIT( 0x00010000, IP_ACTIVE_HIGH, IPT_SERVICE ) PORT_NAME("Test Mode") PORT_CODE(KEYCODE_F2)
227   PORT_SERVICE_NO_TOGGLE( 0x00010000, IP_ACTIVE_HIGH )
228228   PORT_BIT( 0x00020000, IP_ACTIVE_LOW, IPT_TILT )
229229   PORT_BIT( 0x00040000, IP_ACTIVE_LOW, IPT_COIN1 )
230230   PORT_BIT( 0x00080000, IP_ACTIVE_LOW, IPT_COIN2 )
src/mame/drivers/rockola.c
r1679r1680
265265#include "driver.h"
266266#include "deprecat.h"
267267#include "cpu/m6502/m6502.h"
268#include "video/crtc6845.h"
269268#include "sound/sn76477.h"
270269#include "sound/custom.h"
271270#include "sound/samples.h"
r1679r1680
285284extern UINT8 *rockola_videoram2;
286285extern UINT8 *rockola_charram;
287286
288extern WRITE8_HANDLER( rockola_videoram_w );
289extern WRITE8_HANDLER( rockola_videoram2_w );
290extern WRITE8_HANDLER( rockola_colorram_w );
291extern WRITE8_HANDLER( rockola_charram_w );
292extern WRITE8_HANDLER( rockola_flipscreen_w );
293extern WRITE8_HANDLER( rockola_scrollx_w );
294extern WRITE8_HANDLER( rockola_scrolly_w );
287WRITE8_HANDLER( rockola_videoram_w );
288WRITE8_HANDLER( rockola_videoram2_w );
289WRITE8_HANDLER( rockola_colorram_w );
290WRITE8_HANDLER( rockola_charram_w );
291WRITE8_HANDLER( rockola_mc6845_address_w );
292WRITE8_HANDLER( rockola_mc6845_register_w );
293WRITE8_HANDLER( rockola_flipscreen_w );
294WRITE8_HANDLER( rockola_scrollx_w );
295WRITE8_HANDLER( rockola_scrolly_w );
295296
296extern PALETTE_INIT( rockola );
297extern VIDEO_START( rockola );
298extern VIDEO_UPDATE( rockola );
297PALETTE_INIT( rockola );
298VIDEO_START( rockola );
299VIDEO_UPDATE( rockola );
299300
300extern WRITE8_HANDLER( satansat_charram_w );
301extern WRITE8_HANDLER( satansat_b002_w );
302extern WRITE8_HANDLER( satansat_backcolor_w );
301WRITE8_HANDLER( satansat_charram_w );
302WRITE8_HANDLER( satansat_b002_w );
303WRITE8_HANDLER( satansat_backcolor_w );
303304
304extern PALETTE_INIT( satansat );
305extern VIDEO_START( satansat );
305PALETTE_INIT( satansat );
306VIDEO_START( satansat );
306307
307308/* audio */
308309
r1679r1680
337338   sasuke_counter = 0;
338339
339340   sasuke_timer = timer_alloc(sasuke_update_counter, NULL);
340   timer_adjust(sasuke_timer, attotime_zero, 0, ATTOTIME_IN_HZ(11289000/8));   // 1.4 MHz
341   timer_adjust_periodic(sasuke_timer, attotime_zero, 0, ATTOTIME_IN_HZ(11289000/8));   // 1.4 MHz
341342}
342343
343344
r1679r1680
370371   AM_RANGE(0x0800, 0x0bff) AM_RAM AM_WRITE(rockola_videoram_w) AM_BASE(&videoram)
371372   AM_RANGE(0x0c00, 0x0fff) AM_RAM AM_WRITE(rockola_colorram_w) AM_BASE(&colorram)
372373   AM_RANGE(0x1000, 0x1fff) AM_RAM AM_WRITE(rockola_charram_w) AM_BASE(&rockola_charram)
373   AM_RANGE(0x3000, 0x3000) AM_WRITE(crtc6845_address_w)
374   AM_RANGE(0x3001, 0x3001) AM_WRITE(crtc6845_register_w)
374   AM_RANGE(0x3000, 0x3000) AM_WRITE(rockola_mc6845_address_w)
375   AM_RANGE(0x3001, 0x3001) AM_WRITE(rockola_mc6845_register_w)
375376   AM_RANGE(0x4000, 0x8fff) AM_ROM
376377   AM_RANGE(0xb000, 0xb001) AM_WRITE(sasuke_sound_w)
377378   AM_RANGE(0xb002, 0xb002) AM_WRITE(satansat_b002_w)   /* flip screen & irq enable */
r1679r1680
389390   AM_RANGE(0x0800, 0x0bff) AM_RAM AM_WRITE(rockola_videoram_w) AM_BASE(&videoram)
390391   AM_RANGE(0x0c00, 0x0fff) AM_RAM AM_WRITE(rockola_colorram_w) AM_BASE(&colorram)
391392   AM_RANGE(0x1000, 0x1fff) AM_RAM AM_WRITE(rockola_charram_w) AM_BASE(&rockola_charram)
392   AM_RANGE(0x3000, 0x3000) AM_WRITE(crtc6845_address_w)
393   AM_RANGE(0x3001, 0x3001) AM_WRITE(crtc6845_register_w)
393   AM_RANGE(0x3000, 0x3000) AM_WRITE(rockola_mc6845_address_w)
394   AM_RANGE(0x3001, 0x3001) AM_WRITE(rockola_mc6845_register_w)
394395   AM_RANGE(0x4000, 0x97ff) AM_ROM
395396   AM_RANGE(0xb000, 0xb001) AM_WRITE(satansat_sound_w)
396397   AM_RANGE(0xb002, 0xb002) AM_WRITE(satansat_b002_w)   /* flip screen & irq enable */
r1679r1680
408409   AM_RANGE(0x0800, 0x0bff) AM_RAM AM_WRITE(rockola_videoram_w) AM_BASE(&videoram)
409410   AM_RANGE(0x0c00, 0x0fff) AM_RAM AM_WRITE(rockola_colorram_w) AM_BASE(&colorram)
410411   AM_RANGE(0x1000, 0x1fff) AM_RAM AM_WRITE(rockola_charram_w) AM_BASE(&rockola_charram)
411   AM_RANGE(0x3000, 0x3000) AM_WRITE(crtc6845_address_w)
412   AM_RANGE(0x3001, 0x3001) AM_WRITE(crtc6845_register_w)
412   AM_RANGE(0x3000, 0x3000) AM_WRITE(rockola_mc6845_address_w)
413   AM_RANGE(0x3001, 0x3001) AM_WRITE(rockola_mc6845_register_w)
413414   AM_RANGE(0x3100, 0x3102) AM_WRITE(vanguard_sound_w)
414415   AM_RANGE(0x3103, 0x3103) AM_WRITE(rockola_flipscreen_w)
415416   AM_RANGE(0x3104, 0x3104) AM_READ_PORT("IN0")
r1679r1680
429430   AM_RANGE(0x0800, 0x0bff) AM_RAM AM_WRITE(rockola_videoram_w) AM_BASE(&videoram)
430431   AM_RANGE(0x0c00, 0x0fff) AM_RAM AM_WRITE(rockola_colorram_w) AM_BASE(&colorram)
431432   AM_RANGE(0x1000, 0x1fff) AM_RAM AM_WRITE(rockola_charram_w) AM_BASE(&rockola_charram)
432   AM_RANGE(0x2000, 0x2000) AM_WRITE(crtc6845_address_w)
433   AM_RANGE(0x2001, 0x2001) AM_WRITE(crtc6845_register_w)
433   AM_RANGE(0x2000, 0x2000) AM_WRITE(rockola_mc6845_address_w)
434   AM_RANGE(0x2001, 0x2001) AM_WRITE(rockola_mc6845_register_w)
434435   AM_RANGE(0x2100, 0x2103) AM_WRITE(fantasy_sound_w)
435436   AM_RANGE(0x2104, 0x2104) AM_READ_PORT("IN0")
436437   AM_RANGE(0x2105, 0x2105) AM_READ_PORT("IN1")
r1679r1680
450451   AM_RANGE(0x0c00, 0x0fff) AM_RAM AM_WRITE(rockola_colorram_w) AM_BASE(&colorram)
451452   AM_RANGE(0x1000, 0x1fff) AM_RAM AM_WRITE(rockola_charram_w) AM_BASE(&rockola_charram)
452453   AM_RANGE(0x3000, 0x9fff) AM_ROM
453   AM_RANGE(0xb000, 0xb000) AM_WRITE(crtc6845_address_w)
454   AM_RANGE(0xb001, 0xb001) AM_WRITE(crtc6845_register_w)
454   AM_RANGE(0xb000, 0xb000) AM_WRITE(rockola_mc6845_address_w)
455   AM_RANGE(0xb001, 0xb001) AM_WRITE(rockola_mc6845_register_w)
455456   AM_RANGE(0xb100, 0xb103) AM_WRITE(fantasy_sound_w)
456457   AM_RANGE(0xb104, 0xb104) AM_READ_PORT("IN0")
457458   AM_RANGE(0xb105, 0xb105) AM_READ_PORT("IN1")
src/mame/drivers/magicfly.c
r1679r1680
314314#define MASTER_CLOCK   10000000   /* 10MHz */
315315
316316#include "driver.h"
317#include "video/crtc6845.h"
317#include "video/mc6845.h"
318318
319319
320320/*************************
321321*     Video Hardware     *
322322*************************/
323323
324static mc6845_t *mc6845;
324325static tilemap *bg_tilemap;
325326
326327static WRITE8_HANDLER( magicfly_videoram_w )
r1679r1680
335336   tilemap_mark_tile_dirty(bg_tilemap, offset);
336337}
337338
339static WRITE8_HANDLER( magicfly_mc6845_address_w )
340{
341   mc6845_address_w(mc6845, data);
342}
343
344static READ8_HANDLER( magicfly_mc6845_register_r )
345{
346   return mc6845_register_r(mc6845);
347}
348
349static WRITE8_HANDLER( magicfly_mc6845_register_w )
350{
351   mc6845_register_w(mc6845, data);
352}
353
338354static TILE_GET_INFO( get_magicfly_tile_info )
339355{
340356/*  - bits -
r1679r1680
363379
364380static VIDEO_START(magicfly)
365381{
366   bg_tilemap = tilemap_create(get_magicfly_tile_info, tilemap_scan_rows,
367      TILEMAP_TYPE_PEN, 8, 8, 32, 29);
382   mc6845 = mc6845_config(NULL);
383   bg_tilemap = tilemap_create(get_magicfly_tile_info, tilemap_scan_rows, 8, 8, 32, 29);
368384}
369385
370386static TILE_GET_INFO( get_7mezzo_tile_info )
r1679r1680
396412static VIDEO_START( 7mezzo )
397413{
398414   bg_tilemap = tilemap_create(get_7mezzo_tile_info, tilemap_scan_rows,
399      TILEMAP_TYPE_PEN, 8, 8, 32, 29);
415      8, 8, 32, 29);
400416}
401417
402418static VIDEO_UPDATE( magicfly )
r1679r1680
454470
455471static ADDRESS_MAP_START( magicfly_map, ADDRESS_SPACE_PROGRAM, 8 )
456472   AM_RANGE(0x0000, 0x07ff) AM_RAM AM_BASE(&generic_nvram) AM_SIZE(&generic_nvram_size)    /* MK48Z02B NVRAM */
457   AM_RANGE(0x0800, 0x0800) AM_WRITE(crtc6845_address_w)                                   /* MC6845P register addressing */
458   AM_RANGE(0x0801, 0x0801) AM_READWRITE(crtc6845_register_r, crtc6845_register_w)         /* MC6845P register values */
473   AM_RANGE(0x0800, 0x0800) AM_WRITE(magicfly_mc6845_address_w)
474   AM_RANGE(0x0801, 0x0801) AM_READWRITE(magicfly_mc6845_register_r, magicfly_mc6845_register_w)
459475   AM_RANGE(0x1000, 0x13ff) AM_RAM AM_WRITE(magicfly_videoram_w) AM_BASE(&videoram)        /* HM6116LP #1 (2K x 8) RAM (only 1st half used) */
460476   AM_RANGE(0x1800, 0x1bff) AM_RAM AM_WRITE(magicfly_colorram_w) AM_BASE(&colorram)        /* HM6116LP #2 (2K x 8) RAM (only 1st half used) */
461477   AM_RANGE(0x2800, 0x2800) AM_READ(mux_port_r)  /* multiplexed input port */
src/mame/drivers/centiped.c
r1679r1680
456456   if (scanline >= 256)
457457      scanline = 0;
458458
459   timer_adjust(interrupt_timer, video_screen_get_time_until_pos(0, scanline, 0), scanline, attotime_zero);
459   timer_adjust_oneshot(interrupt_timer, video_screen_get_time_until_pos(0, scanline, 0), scanline);
460460}
461461
462462
r1679r1680
471471static MACHINE_RESET( centiped )
472472{
473473   interrupt_timer = timer_alloc(generate_interrupt, NULL);
474   timer_adjust(interrupt_timer, video_screen_get_time_until_pos(0, 0, 0), 0, attotime_zero);
474   timer_adjust_oneshot(interrupt_timer, video_screen_get_time_until_pos(0, 0, 0), 0);
475475   cpunum_set_input_line(machine, 0, 0, CLEAR_LINE);
476476   dsw_select = 0;
477477   control_select = 0;
src/mame/drivers/atarisy1.c
r1679r1680
228228
229229   /* clear any existing interrupt and set a timer for a new one */
230230   joystick_int = 0;
231   timer_adjust(joystick_timer, ATTOTIME_IN_USEC(50), newval, attotime_zero);
231   timer_adjust_oneshot(joystick_timer, ATTOTIME_IN_USEC(50), newval);
232232   atarigen_update_interrupts();
233233
234234   return joystick_value;
src/mame/drivers/pturn.c
r1679r1680
119119
120120static VIDEO_START(pturn)
121121{
122   pturn_fgmap = tilemap_create(get_pturn_tile_info,tilemap_scan_rows,TILEMAP_TYPE_PEN, 8, 8,32,32);
122   pturn_fgmap = tilemap_create(get_pturn_tile_info,tilemap_scan_rows,8, 8,32,32);
123123   tilemap_set_transparent_pen(pturn_fgmap,0);
124   pturn_bgmap = tilemap_create(get_pturn_bg_tile_info,tilemap_scan_rows,TILEMAP_TYPE_PEN, 8, 8,32,32*8);
124   pturn_bgmap = tilemap_create(get_pturn_bg_tile_info,tilemap_scan_rows,8, 8,32,32*8);
125125   tilemap_set_transparent_pen(pturn_bgmap,0);
126126}
127127
src/mame/drivers/ssv.c
r1679r1680
20172017
20182018   PORT_START   // IN3 - $21000a
20192019   PORT_BIT( 0x0001, IP_ACTIVE_LOW, IPT_UNKNOWN  )   //-
2020   PORT_BIT( 0x0002, IP_ACTIVE_LOW, IPT_SERVICE ) PORT_NAME( DEF_STR( Service_Mode )) PORT_CODE(KEYCODE_F2)   //test
2020   PORT_SERVICE_NO_TOGGLE( 0x0002, IP_ACTIVE_LOW )
20212021   PORT_BIT( 0x0004, IP_ACTIVE_LOW, IPT_UNKNOWN  )   //-
20222022   PORT_BIT( 0x0008, IP_ACTIVE_LOW, IPT_SERVICE3 )   //payout
20232023   PORT_BIT( 0x0010, IP_ACTIVE_LOW, IPT_UNKNOWN  )   //-
src/mame/drivers/tceptor.c
r1679r1680
462462   /* video hardware */
463463   MDRV_VIDEO_ATTRIBUTES(VIDEO_TYPE_RASTER)
464464   MDRV_GFXDECODE(tceptor)
465   MDRV_PALETTE_LENGTH(1024)
466   MDRV_COLORTABLE_LENGTH(4096)
465   MDRV_PALETTE_LENGTH(4096)
467466   MDRV_DEFAULT_LAYOUT(layout_horizont)
468467
469468   MDRV_SCREEN_ADD("2D", 0x000)
r1679r1680
543542   ROM_LOAD( "tc1-20.10e", 0x00000, 0x08000, CRC(3e5054b7) SHA1(ed359f8659a4a46d5ff7299d0da10550b1496db8) )
544543   ROM_LOAD( "tc1-19.10d", 0x08000, 0x04000, CRC(7406e6e7) SHA1(61ad77667e94fd7e11037da2721f7bbe0130286a) )
545544
546   ROM_REGION( 0X10000, REGION_GFX3, ROMREGION_DISPOSE )   // 16x16 sprites
545   ROM_REGION( 0x10000, REGION_GFX3, ROMREGION_DISPOSE )   // 16x16 sprites
547546   ROM_LOAD( "tc1-16.8t",  0x00000, 0x08000, CRC(7c72be33) SHA1(397e11727b86688d550c28fbdcb864bb9335d891) )
548547   ROM_LOAD( "tc1-15.10t", 0x08000, 0x08000, CRC(51268075) SHA1(75b6b935c6721adbc984795b9bf0a791fb8b209e) )
549548
550   ROM_REGION( 0X80000, REGION_GFX4, ROMREGION_DISPOSE )   // 32x32 sprites
549   ROM_REGION( 0x80000, REGION_GFX4, ROMREGION_DISPOSE )   // 32x32 sprites
551550   ROM_LOAD( "tc1-8.8m",   0x00000, 0x10000, CRC(192a1f1f) SHA1(8424a6a19c080da0a83e173e33915f4d9326f379) )
552551   ROM_LOAD( "tc1-10.8p",  0x10000, 0x08000, CRC(7876bcef) SHA1(09180b26d0eab51de18a13723f46d763541979fb) )
553552   ROM_RELOAD(             0x18000, 0x08000 )
r1679r1680
563562   ROM_LOAD( "tc1-13.10s", 0x70000, 0x08000, CRC(e67cef29) SHA1(ba8559caf498bbc1d9278d74da03ee2d910f76d8) )
564563   ROM_RELOAD(             0x78000, 0x08000 )
565564
566   ROM_REGION( 0x3600, REGION_PROMS, 0 )
565   ROM_REGION( 0x3500, REGION_PROMS, 0 )
567566   ROM_LOAD( "tc1-3.1k",   0x00000, 0x00400, CRC(fd2fcb57) SHA1(97d5b7527714acfd729b26ac56f0a9210982c551) )   // red components
568567   ROM_LOAD( "tc1-1.1h",   0x00400, 0x00400, CRC(0241cf67) SHA1(9b2b579425b72a5b1f2c632f53d1c1d172b4ed1e) )   // green components
569568   ROM_LOAD( "tc1-2.1j",   0x00800, 0x00400, CRC(ea9eb3da) SHA1(0d7cfceac57afc53a063d7fe67cfc9bda0a8dbc8) )   // blue components
570569   ROM_LOAD( "tc1-5.6a",   0x00c00, 0x00400, CRC(afa8eda8) SHA1(783efbcbf0bb7e4cf2e2618ddd0ef3b52a4518cc) )   // tiles color table
571   ROM_LOAD( "tc1-4.2e",   0x01000, 0x00100, CRC(a4e73d53) SHA1(df8231720e9b57cf2751f86ac3ed7433804f51ca) )   // road color table
572   ROM_LOAD( "tc1-6.7s",   0x01100, 0x00400, CRC(72707677) SHA1(122c1b619c9efa3b7055908dda3102ee28230504) )   // sprite color table
570   ROM_LOAD( "tc1-6.7s",   0x01000, 0x00400, CRC(72707677) SHA1(122c1b619c9efa3b7055908dda3102ee28230504) )   // sprite color table
571   ROM_LOAD( "tc1-4.2e",   0x01400, 0x00100, CRC(a4e73d53) SHA1(df8231720e9b57cf2751f86ac3ed7433804f51ca) )   // road color table
573572   ROM_LOAD( "tc1-17.7k",  0x01500, 0x02000, CRC(90db1bf6) SHA1(dbb9e50a8efc3b4012fcf587cc87da9ef42a1b80) )   // sprite related
574573ROM_END
575574
r1679r1680
614613   ROM_LOAD( "tc2-11.10r", 0x60000, 0x10000, CRC(40724380) SHA1(57549094fc8403f1f528e57fe3fa64844bf89e22) )
615614   ROM_LOAD( "tc2-13.10s", 0x70000, 0x10000, CRC(519ec7c1) SHA1(c4abe279d7cf6f626dcbb6f6c4dc2a138b818f51) )
616615
617   ROM_REGION( 0x3600, REGION_PROMS, 0 )
616   ROM_REGION( 0x3500, REGION_PROMS, 0 )
618617   ROM_LOAD( "tc2-3.1k",   0x00000, 0x00400, CRC(e3504f1a) SHA1(1ac3968e993030a6b2f4719702ff870267ab6918) )   // red components
619618   ROM_LOAD( "tc2-1.1h",   0x00400, 0x00400, CRC(e8a96fda) SHA1(42e5d2b351000ac0705b01ab484c5fe8e294a08b) )   // green components
620619   ROM_LOAD( "tc2-2.1j",   0x00800, 0x00400, CRC(c65eda61) SHA1(c316b748daa6be68eebbb480557637efc9f44781) )   // blue components
621620   ROM_LOAD( "tc1-5.6a",   0x00c00, 0x00400, CRC(afa8eda8) SHA1(783efbcbf0bb7e4cf2e2618ddd0ef3b52a4518cc) )   // tiles color table
622   ROM_LOAD( "tc2-4.2e",   0x01000, 0x00100, CRC(6b49fc30) SHA1(66ca39cd7985643acd71905111ae2d931c082465) )   // road color table
623   ROM_LOAD( "tc2-6.7s",   0x01100, 0x00400, CRC(badcda76) SHA1(726e0019241d31716f3af9ebe900089bce771477) )   // sprite color table
621   ROM_LOAD( "tc2-6.7s",   0x01000, 0x00400, CRC(badcda76) SHA1(726e0019241d31716f3af9ebe900089bce771477) )   // sprite color table
622   ROM_LOAD( "tc2-4.2e",   0x01400, 0x00100, CRC(6b49fc30) SHA1(66ca39cd7985643acd71905111ae2d931c082465) )   // road color table
624623   ROM_LOAD( "tc1-17.7k",  0x01500, 0x02000, CRC(90db1bf6) SHA1(dbb9e50a8efc3b4012fcf587cc87da9ef42a1b80) )   // sprite related
625624ROM_END
626625
src/mame/drivers/hanaawas.c
r1679r1680
219219   MDRV_SCREEN_SIZE(32*8, 32*8)
220220   MDRV_SCREEN_VISIBLE_AREA(0*8, 32*8-1, 0*8, 32*8-1)
221221   MDRV_GFXDECODE(hanaawas)
222   MDRV_PALETTE_LENGTH(16)
223   MDRV_COLORTABLE_LENGTH(32*8)
222   MDRV_PALETTE_LENGTH(32*8)
224223
225224   MDRV_PALETTE_INIT(hanaawas)
226225   MDRV_VIDEO_START(hanaawas)
r1679r1680
262261
263262
264263
265GAME( 1982, hanaawas, 0, hanaawas, hanaawas, 0, ROT0, "Seta", "Hana Awase (Flower Matching)", 0 )
264GAME( 1982, hanaawas, 0, hanaawas, hanaawas, 0, ROT0, "Setakikaku, Ltd.", "Hana Awase", 0 )
src/mame/drivers/mpu4drvr.c
r1679r1680
179179#include "machine/6850acia.h"
180180#include "sound/saa1099.h"
181181//Deal 'Em
182#include "video/crtc6845.h"
182#include "video/mc6845.h"
183183
184184#ifdef MAME_DEBUG
185185#define MPU4VIDVERBOSE 1
r1679r1680
191191
192192#define VIDEO_MASTER_CLOCK (10000000)
193193
194static mc6845_t *mc6845;
195
194196static UINT8 m6840_irq_state;
195197static UINT8 m6850_irq_state;
196198static UINT8 scn2674_irq_state;
r1679r1680
434436static UINT8 IR13_scn2674_scroll_end;
435437static UINT8 IR13_scn2674_split_register_2;
436438
437VIDEO_UPDATE( mpu4_vid )
439static VIDEO_UPDATE( mpu4_vid )
438440{
439441   int i;
440442
r1679r1680
499501   return 0;
500502}
501503
502READ16_HANDLER( mpu4_vid_vidram_r )
504static READ16_HANDLER( mpu4_vid_vidram_r )
503505{
504506   return mpu4_vid_vidram[offset];
505507}
506508
507WRITE16_HANDLER( mpu4_vid_vidram_w )
509static WRITE16_HANDLER( mpu4_vid_vidram_w )
508510{
509511   COMBINE_DATA(&mpu4_vid_vidram[offset]);
510512   offset <<= 1;
r1679r1680
877879
878880}
879881
880READ16_HANDLER( mpu4_vid_scn2674_r )
882static READ16_HANDLER( mpu4_vid_scn2674_r )
881883{
882884   /*
883885    Offset:  Purpose
r1679r1680
925927   return 0xffff;
926928}
927929
928WRITE16_HANDLER( mpu4_vid_scn2674_w )
930static WRITE16_HANDLER( mpu4_vid_scn2674_w )
929931{
930932   /*
931933    Offset:  Purpose
r1679r1680
960962   }
961963}
962964
963VIDEO_START( mpu4_vid )
965static VIDEO_START( mpu4_vid )
964966{
965967   /* if anything uses tile sizes other than 8x8 we can't really do it this way.. we'll have to draw tiles by hand.
966968      maybe we will anyway, but for now we don't need to */
r1679r1680
12521254
12531255INPUT_PORTS_END
12541256
1255INTERRUPT_GEN(mpu4_vid_irq)
1257static INTERRUPT_GEN(mpu4_vid_irq)
12561258{
12571259   LOGSTUFF(("scn2674_irq_mask %02x\n",scn2674_irq_mask));
12581260   if (cpu_getiloops()==0) // vbl
r1679r1680
14651467   GFXDECODE_ENTRY( REGION_GFX1, 0x0000, dealemcharlayout, 0, 32 )
14661468GFXDECODE_END
14671469
1468UINT8 *dealem_videoram;
1470static UINT8 *dealem_videoram;
14691471
1472static WRITE8_HANDLER( dealem_mc6845_address_w )
1473{
1474   mc6845_address_w(mc6845, data);
1475}
1476
1477static READ8_HANDLER( dealem_mc6845_register_r )
1478{
1479   return mc6845_register_r(mc6845);
1480}
1481
1482static WRITE8_HANDLER( dealem_mc6845_register_w )
1483{
1484   mc6845_register_w(mc6845, data);
1485}
1486
14701487/***************************************************************************
14711488
14721489  Convert the color PROMs into a more useable format.
r1679r1680
14861503
14871504***************************************************************************/
14881505
1489PALETTE_INIT( dealem )
1506static PALETTE_INIT( dealem )
14901507{
14911508   int i;
14921509   for (i = 0;i < memory_region_length(REGION_PROMS);i++)
r1679r1680
15151532
15161533}
15171534
1518VIDEO_START(dealem)
1535static VIDEO_START(dealem)
15191536{
1537   mc6845 = mc6845_config(NULL);
15201538}
15211539
1522VIDEO_UPDATE(dealem)
1540static VIDEO_UPDATE(dealem)
15231541{
15241542   int x,y;
15251543   int count = 0;
r1679r1680
15411559
15421560   AM_RANGE(0x0000, 0x07ff) AM_RAM AM_BASE(&generic_nvram) AM_SIZE(&generic_nvram_size)
15431561
1544   AM_RANGE(0x0800, 0x0800) AM_WRITE(crtc6845_address_w)
1545   AM_RANGE(0x0801, 0x0801) AM_READWRITE(crtc6845_register_r, crtc6845_register_w)
1562   AM_RANGE(0x0800, 0x0800) AM_WRITE(dealem_mc6845_address_w)
1563   AM_RANGE(0x0801, 0x0801) AM_READWRITE(dealem_mc6845_register_r, dealem_mc6845_register_w)
15461564
15471565//  AM_RANGE(0x0850, 0x0850) AM_WRITE(bankswitch_w) // write bank (rom page select)
15481566
r1679r1680
16561674
16571675MACHINE_DRIVER_END
16581676
1659DRIVER_INIT (crmaze)
1677static DRIVER_INIT (crmaze)
16601678{
16611679   int x;
16621680   static const UINT8 chr_table[72]={0x00,0x84,0x94,0x3C,0xEC,0x5C,0xEC,0x50,
r1679r1680
16751693   }
16761694}
16771695
1678DRIVER_INIT (mating)
1696static DRIVER_INIT (mating)
16791697{
16801698   int x;
16811699   static const UINT8 chr_table[72]={0x00,0x18,0xC8,0xA4,0x0C,0x80,0x0C,0x90,
src/mame/drivers/metro.c
r1679r1680
285285static WRITE16_HANDLER( mouja_irq_timer_ctrl_w )
286286{
287287   double freq = 58.0 + (0xff - (data & 0xff)) / 2.2;               /* 0xff=58Hz, 0x80=116Hz? */
288   timer_adjust(mouja_irq_timer, attotime_zero, 0, ATTOTIME_IN_HZ(freq));
288   timer_adjust_periodic(mouja_irq_timer, attotime_zero, 0, ATTOTIME_IN_HZ(freq));
289289}
290290
291291static INTERRUPT_GEN( mouja_interrupt )
r1679r1680
51685168Dharma Doujou
51695169Metro 1994
51705170
5171MTR5260-A
5172|-----------------------------------------------|
5173|TA7222            3.579545MHz                  |
5174|            YM3012                      6116   |
5175|C3403  C3403      YM2151  M6295                |
5176|       26.666MHz                JA-7     JA-8  |
5177|            6264                               |
5178|J           6264           |--------|  D78C10  |
5179|A           6264           |IMAGETEK|          |
5180|M                          |14220   |          |
5181|M               MM1035     |        |          |
5182|A         |------------|   |--------|          |
5183|          |    68000   |                 JB-1  |
5184|          |------------|                       |
5185|                                         JB-2  |
5186|              24MHz                            |
5187|       MACH110                           JB-3  |
5188|                  6264                         |
5189|DSW1              6264                   JB-4  |
5190|DSW2     JC-6      JC-5                        |
5191|-----------------------------------------------|
5192Notes:
5193      68000 clock     - 12.000MHz [24/2]
5194      D78C10 clock    - 12.000MHz [24/2]
5195      YM2151 clock    - 3.579545MHz
5196      Oki M6295 clock - 1.200MHz [24/20], sample rate = 1200000 / 132
5197      VSync - 60Hz
5198      HSync - 15.55kHz
51715199
5172                  M6395  JA-7 JA-8
51735200
5174     26.666MHz          NEC78C10
5175      7C199
5176      7C199
5177      7C199               JB-1
5178                          JB-2
5179                          JB-3
5180           68000-12       JB-4
5201Korean version of Dharma runs on Metro hardware PCB Number - METRO CORP. MTR527
51815202
5182           24MHz
5183                  6264
5184                  6264
5185           JC-5 JC-6
5186
51875203***************************************************************************/
51885204
51895205ROM_START( dharma )
r1679r1680
52055221   ROM_LOAD( "ja-7", 0x000000, 0x040000, CRC(7ce817eb) SHA1(9dfb79021a552877fbc26049cca853c0b93735b5) )
52065222ROM_END
52075223
5208/*
5209
5210This is a Korean version of Dharma
5211Runs on Metro hardware.
5212PCB Number - METRO CORP. MTR527
5213Imagetek 14220 gfx chip
521468000 CPU
5215XTALs 26.666MHz, 24.0MHz, 3.579545MHz
5216YM2413
5217OKI M6295
5218D78C10
5219MACH110
52208-position DSW x2
52216116 SRAM x1
52226264 SRAM x5
5223
5224*/
5225
52265224ROM_START( dharmak )
52275225   ROM_REGION( 0x040000, REGION_CPU1, 0 )      /* 68000 Code */
52285226   ROM_LOAD16_BYTE( "5.bin", 0x000000, 0x020000, CRC(7dec1f77) SHA1(86cda990392e738f1bacec9d7a232d27887c1135) )
r1679r1680
52815279      VSync - 60Hz
52825280      HSync - 15.55kHz
52835281
528468000 @ 12MHz
5285NEC D78C10
5286AMD Mach110
5287Imagetek 14220
5288YM2151 + M6295 + YM3012
52895282RAM - CY7C199 (x2), 6164 (x2), LH5168 (x2), 6116 (x1)
5290DIPSW 8-position (x2)
5291XTAL - 3.579545MHz (near YM2151 & M6295)
5292OSC - 24MHz (near 68000 & Mach110)
5293OSC - 26.666MHz (near 14220)
52945283ROMs 5+6 = Main Prg
52955284ROMs 7+8 = Sound Data
52965285ROMs 1-4 = GFX Data
src/mame/drivers/midvunit.c
r1679r1680
55    driver by Aaron Giles
66
77    Games supported:
8        * Cruis'n USA (1994) [3 sets]
9        * Cruis'n World (1996) [4 sets]
8        * Cruis'n USA (1994)       [3 sets]
9        * Cruis'n World (1996)     [4 sets]
1010        * War Gods (1996)
1111        * Off Road Challenge (1997)
1212
r1679r1680
298298      int which = (offset >> 4) & 1;
299299//  logerror("%06X:tms32031_control_w(%02X) = %08X\n", activecpu_get_pc(), offset, data);
300300      if (data & 0x40)
301         timer_adjust(timer[which], attotime_never, 0, attotime_never);
301         timer_adjust_oneshot(timer[which], attotime_never, 0);
302302
303303      /* bit 0x200 selects internal clocking, which is 1/2 the main CPU clock rate */
304304      if (data & 0x200)
r1679r1680
682682   PORT_BIT( 0x0002, IP_ACTIVE_LOW, IPT_COIN2 )
683683   PORT_BIT( 0x0004, IP_ACTIVE_LOW, IPT_START1 )
684684   PORT_BIT( 0x0008, IP_ACTIVE_LOW, IPT_TILT ) /* Slam Switch */
685   PORT_BIT(0x0010, IP_ACTIVE_LOW, IPT_OTHER ) PORT_NAME("Enter") PORT_CODE(KEYCODE_F2) /* Test switch */
685   PORT_BIT( 0x0010, IP_ACTIVE_LOW, IPT_OTHER ) PORT_NAME("Enter") PORT_CODE(KEYCODE_F2) /* Test switch */
686686   PORT_BIT( 0x0020, IP_ACTIVE_LOW, IPT_UNUSED )
687687   PORT_BIT( 0x0040, IP_ACTIVE_LOW, IPT_SERVICE1 )
688688   PORT_BIT( 0x0080, IP_ACTIVE_LOW, IPT_COIN3 )
r1679r1680
803803   PORT_BIT( 0x0002, IP_ACTIVE_LOW, IPT_COIN2 )
804804   PORT_BIT( 0x0004, IP_ACTIVE_LOW, IPT_START1 )
805805   PORT_BIT( 0x0008, IP_ACTIVE_LOW, IPT_TILT ) /* Slam Switch */
806   PORT_BIT(0x0010, IP_ACTIVE_LOW, IPT_OTHER ) PORT_NAME("Enter") PORT_CODE(KEYCODE_F2) /* Test switch */
806   PORT_BIT( 0x0010, IP_ACTIVE_LOW, IPT_OTHER ) PORT_NAME("Enter") PORT_CODE(KEYCODE_F2) /* Test switch */
807807   PORT_BIT( 0x0020, IP_ACTIVE_LOW, IPT_UNUSED )
808808   PORT_BIT( 0x0040, IP_ACTIVE_LOW, IPT_SERVICE1 )
809809   PORT_BIT( 0x0080, IP_ACTIVE_LOW, IPT_COIN3 )
r1679r1680
955955   PORT_BIT( 0x0002, IP_ACTIVE_LOW, IPT_COIN2 )
956956   PORT_BIT( 0x0004, IP_ACTIVE_LOW, IPT_START1 )
957957   PORT_BIT( 0x0008, IP_ACTIVE_LOW, IPT_TILT ) /* Slam Switch */
958   PORT_BIT(0x0010, IP_ACTIVE_LOW, IPT_SERVICE ) PORT_NAME( DEF_STR( Service_Mode )) PORT_CODE(KEYCODE_F2)
958   PORT_SERVICE_NO_TOGGLE( 0x0010, IP_ACTIVE_LOW )
959959   PORT_BIT( 0x0020, IP_ACTIVE_LOW, IPT_START2 )
960960   PORT_BIT( 0x0040, IP_ACTIVE_LOW, IPT_SERVICE1 )
961961   PORT_BIT( 0x0080, IP_ACTIVE_LOW, IPT_COIN3 )
src/mame/drivers/namcond1.c
r1679r1680
115115   PORT_DIPSETTING(    0x0000, DEF_STR( On ) )
116116   PORT_BIT( 0x1000, IP_ACTIVE_LOW, IPT_COIN1 )
117117   PORT_BIT( 0x2000, IP_ACTIVE_LOW, IPT_COIN2 )
118   PORT_BIT( 0x4000, IP_ACTIVE_LOW, IPT_SERVICE ) PORT_NAME(DEF_STR( Test )) PORT_CODE(KEYCODE_F2) PORT_TOGGLE
118   PORT_SERVICE( 0x4000, IP_ACTIVE_LOW )
119119   PORT_BIT( 0x8000, IP_ACTIVE_LOW, IPT_SERVICE1 )
120120   PORT_BIT( 0x00ff, IP_ACTIVE_LOW, IPT_UNUSED )
121121INPUT_PORTS_END
src/mame/drivers/usgames.c
r1679r1680
2424*/
2525
2626#include "driver.h"
27#include "video/crtc6845.h"
2827#include "sound/ay8910.h"
2928
3029/* video */
31WRITE8_HANDLER( usg_videoram_w );
32WRITE8_HANDLER( usg_charram_w );
33VIDEO_START(usg);
34PALETTE_INIT(usg);
35VIDEO_UPDATE(usg);
36extern tilemap *usg_tilemap;
30WRITE8_HANDLER( usgames_videoram_w );
31WRITE8_HANDLER( usgames_charram_w );
32WRITE8_HANDLER( usgames_mc6845_address_w );
33WRITE8_HANDLER( usgames_mc6845_register_w );
34VIDEO_START(usgames);
35PALETTE_INIT(usgames);
36VIDEO_UPDATE(usgames);
3737
3838
39extern UINT8 *usg_videoram,*usg_charram;
39extern UINT8 *usgames_videoram,*usgames_charram;
4040
4141
42static WRITE8_HANDLER( usg_rombank_w )
42static WRITE8_HANDLER( usgames_rombank_w )
4343{
4444   UINT8 *RAM = memory_region(REGION_CPU1);
4545
r1679r1680
6868
6969
7070
71static ADDRESS_MAP_START( usg_readmem, ADDRESS_SPACE_PROGRAM, 8 )
71static ADDRESS_MAP_START( usgames_readmem, ADDRESS_SPACE_PROGRAM, 8 )
7272   AM_RANGE(0x0000, 0x1fff) AM_READ(MRA8_RAM)
7373
7474   AM_RANGE(0x2000, 0x2000) AM_READ(input_port_1_r)
r1679r1680
9696   AM_RANGE(0x8000, 0xffff) AM_READ(MRA8_ROM)
9797ADDRESS_MAP_END
9898
99static ADDRESS_MAP_START( usg_writemem, ADDRESS_SPACE_PROGRAM, 8 )
99static ADDRESS_MAP_START( usgames_writemem, ADDRESS_SPACE_PROGRAM, 8 )
100100   AM_RANGE(0x0000, 0x1fff) AM_WRITE(MWA8_RAM) AM_BASE(&generic_nvram) AM_SIZE(&generic_nvram_size)
101101
102102   AM_RANGE(0x2020, 0x2020) AM_WRITE(lamps1_w)
103103   AM_RANGE(0x2030, 0x2030) AM_WRITE(lamps2_w)
104104
105   AM_RANGE(0x2040, 0x2040) AM_WRITE(crtc6845_address_w)
106   AM_RANGE(0x2041, 0x2041) AM_WRITE(crtc6845_register_w)
105   AM_RANGE(0x2040, 0x2040) AM_WRITE(usgames_mc6845_address_w)
106   AM_RANGE(0x2041, 0x2041) AM_WRITE(usgames_mc6845_register_w)
107107
108108   AM_RANGE(0x2400, 0x2400) AM_WRITE(AY8910_control_port_0_w)
109109   AM_RANGE(0x2401, 0x2401) AM_WRITE(AY8910_write_port_0_w)
110110
111   AM_RANGE(0x2060, 0x2060) AM_WRITE(usg_rombank_w)
111   AM_RANGE(0x2060, 0x2060) AM_WRITE(usgames_rombank_w)
112112
113   AM_RANGE(0x2800, 0x2fff) AM_WRITE(usg_charram_w) AM_BASE(&usg_charram)
114   AM_RANGE(0x3000, 0x3fff) AM_WRITE(usg_videoram_w) AM_BASE(&usg_videoram)
113   AM_RANGE(0x2800, 0x2fff) AM_WRITE(usgames_charram_w) AM_BASE(&usgames_charram)
114   AM_RANGE(0x3000, 0x3fff) AM_WRITE(usgames_videoram_w) AM_BASE(&usgames_videoram)
115115   AM_RANGE(0x4000, 0x7fff) AM_WRITE(MWA8_ROM)
116116   AM_RANGE(0x8000, 0xffff) AM_WRITE(MWA8_ROM)
117117ADDRESS_MAP_END
r1679r1680
122122   AM_RANGE(0x2420, 0x2420) AM_WRITE(lamps1_w)
123123   AM_RANGE(0x2430, 0x2430) AM_WRITE(lamps2_w)
124124
125   AM_RANGE(0x2440, 0x2440) AM_WRITE(crtc6845_address_w)
126   AM_RANGE(0x2441, 0x2441) AM_WRITE(crtc6845_register_w)
125   AM_RANGE(0x2440, 0x2440) AM_WRITE(usgames_mc6845_address_w)
126   AM_RANGE(0x2441, 0x2441) AM_WRITE(usgames_mc6845_register_w)
127127
128128   AM_RANGE(0x2000, 0x2000) AM_WRITE(AY8910_control_port_0_w)
129129   AM_RANGE(0x2001, 0x2001) AM_WRITE(AY8910_write_port_0_w)
130130
131   AM_RANGE(0x2460, 0x2460) AM_WRITE(usg_rombank_w)
131   AM_RANGE(0x2460, 0x2460) AM_WRITE(usgames_rombank_w)
132132
133   AM_RANGE(0x2800, 0x2fff) AM_WRITE(usg_charram_w) AM_BASE(&usg_charram)
134   AM_RANGE(0x3000, 0x3fff) AM_WRITE(usg_videoram_w) AM_BASE(&usg_videoram)
133   AM_RANGE(0x2800, 0x2fff) AM_WRITE(usgames_charram_w) AM_BASE(&usgames_charram)
134   AM_RANGE(0x3000, 0x3fff) AM_WRITE(usgames_videoram_w) AM_BASE(&usgames_videoram)
135135   AM_RANGE(0x4000, 0x7fff) AM_WRITE(MWA8_ROM)
136136   AM_RANGE(0x8000, 0xffff) AM_WRITE(MWA8_ROM)
137137ADDRESS_MAP_END
r1679r1680
286286
287287
288288
289static MACHINE_DRIVER_START( usg )
289static MACHINE_DRIVER_START( usg32 )
290290
291291   /* basic machine hardware */
292292   MDRV_CPU_ADD_TAG("main", M6809, 2000000) /* ?? */
293   MDRV_CPU_PROGRAM_MAP(usg_readmem,usg_writemem)
293   MDRV_CPU_PROGRAM_MAP(usgames_readmem,usgames_writemem)
294294   MDRV_CPU_VBLANK_INT(irq0_line_hold,5) /* ?? */
295295
296296   MDRV_SCREEN_REFRESH_RATE(60)
r1679r1680
307307   MDRV_PALETTE_LENGTH(16)
308308   MDRV_COLORTABLE_LENGTH(2*256)
309309
310   MDRV_PALETTE_INIT(usg)
311   MDRV_VIDEO_START(usg)
312   MDRV_VIDEO_UPDATE(usg)
310   MDRV_PALETTE_INIT(usgames)
311   MDRV_VIDEO_START(usgames)
312   MDRV_VIDEO_UPDATE(usgames)
313313
314314   /* sound hardware */
315315   MDRV_SPEAKER_STANDARD_MONO("mono")
r1679r1680
319319MACHINE_DRIVER_END
320320
321321static MACHINE_DRIVER_START( usg185 )
322   MDRV_IMPORT_FROM(usg)
322   MDRV_IMPORT_FROM(usg32)
323323   MDRV_CPU_MODIFY("main")
324324   MDRV_CPU_PROGRAM_MAP(usg185_readmem,usg185_writemem)
325325MACHINE_DRIVER_END
r1679r1680
443443ROM_END
444444
445445
446GAME( 1987, usg32,  0,     usg,    usg32, 0, ROT0, "U.S. Games", "Super Duper Casino (California V3.2)", 0 )
447GAME( 1988, usg83,  0,     usg,    usg83, 0, ROT0, "U.S. Games", "Super Ten V8.3", 0 )
448GAME( 1988, usg83x, usg83, usg,    usg83, 0, ROT0, "U.S. Games", "Super Ten V8.3X", 0 )
449GAME( 1988, usg82,  usg83, usg,    usg83, 0, ROT0, "U.S. Games", "Super Ten V8.2" , 0)   // "Feb.08,1988"
446GAME( 1987, usg32,  0,     usg32,  usg32, 0, ROT0, "U.S. Games", "Super Duper Casino (California V3.2)", 0 )
447GAME( 1988, usg83,  0,     usg32,  usg83, 0, ROT0, "U.S. Games", "Super Ten V8.3", 0 )
448GAME( 1988, usg83x, usg83, usg32,  usg83, 0, ROT0, "U.S. Games", "Super Ten V8.3X", 0 )
449GAME( 1988, usg82,  usg83, usg32,  usg83, 0, ROT0, "U.S. Games", "Super Ten V8.2" , 0)   // "Feb.08,1988"
450450GAME( 1989, usg182, 0,     usg185, usg83, 0, ROT0, "U.S. Games", "Games V18.2", 0 )
451451GAME( 1991, usg185, 0,     usg185, usg83, 0, ROT0, "U.S. Games", "Games V18.7C", 0 )
452452GAME( 1992, usg252, 0,     usg185, usg83, 0, ROT0, "U.S. Games", "Games V25.4X", 0 )
src/mame/drivers/pmpoker.c
r1679r1680
367367#define MASTER_CLOCK   10000000   /* 10MHz */
368368
369369#include "driver.h"
370#include "video/crtc6845.h"
370#include "video/mc6845.h"
371371#include "machine/6821pia.h"
372372#include "sound/discrete.h"
373373
r1679r1680
380380*     Video Hardware     *
381381*************************/
382382
383static mc6845_t *mc6845;
383384static tilemap *bg_tilemap;
384385
386static WRITE8_HANDLER( pmpoker_mc6845_address_w )
387{
388   mc6845_address_w(mc6845, data);
389}
390
391static READ8_HANDLER( pmpoker_mc6845_register_r )
392{
393   return mc6845_register_r(mc6845);
394}
395
396static WRITE8_HANDLER( pmpoker_mc6845_register_w )
397{
398   mc6845_register_w(mc6845, data);
399}
400
385401static WRITE8_HANDLER( pmpoker_videoram_w )
386402{
387403   videoram[offset] = data;
r1679r1680
415431
416432static VIDEO_START( pmpoker )
417433{
418   bg_tilemap = tilemap_create(get_bg_tile_info, tilemap_scan_rows,
419      TILEMAP_TYPE_PEN, 8, 8, 32, 29);
434   mc6845 = mc6845_config(NULL);
435   bg_tilemap = tilemap_create(get_bg_tile_info, tilemap_scan_rows, 8, 8, 32, 29);
420436}
421437
422438static VIDEO_UPDATE( pmpoker )
r1679r1680
468484
469485static ADDRESS_MAP_START( pmpoker_map, ADDRESS_SPACE_PROGRAM, 8 )
470486   AM_RANGE(0x0000, 0x07ff) AM_RAM AM_BASE(&generic_nvram) AM_SIZE(&generic_nvram_size)   /* battery backed RAM */
471   AM_RANGE(0x0800, 0x0800) AM_WRITE(crtc6845_address_w)
472   AM_RANGE(0x0801, 0x0801) AM_READWRITE(crtc6845_register_r, crtc6845_register_w)
487   AM_RANGE(0x0800, 0x0800) AM_WRITE(pmpoker_mc6845_address_w)
488   AM_RANGE(0x0801, 0x0801) AM_READWRITE(pmpoker_mc6845_register_r, pmpoker_mc6845_register_w)
473489   AM_RANGE(0x0844, 0x0847) AM_READWRITE(pia_0_r, pia_0_w)
474490   AM_RANGE(0x0848, 0x084b) AM_READWRITE(pia_1_r, pia_1_w)
475491   AM_RANGE(0x1000, 0x13ff) AM_RAM AM_WRITE(pmpoker_videoram_w) AM_BASE(&videoram)
r1679r1680
480496
481497static ADDRESS_MAP_START( jokerpkr_map, ADDRESS_SPACE_PROGRAM, 8 )
482498   AM_RANGE(0x0000, 0x07ff) AM_RAM AM_BASE(&generic_nvram) AM_SIZE(&generic_nvram_size)   /* battery backed RAM */
483   AM_RANGE(0x0800, 0x0800) AM_WRITE(crtc6845_address_w)
484   AM_RANGE(0x0801, 0x0801) AM_READWRITE(crtc6845_register_r, crtc6845_register_w)
499   AM_RANGE(0x0800, 0x0800) AM_WRITE(pmpoker_mc6845_address_w)
500   AM_RANGE(0x0801, 0x0801) AM_READWRITE(pmpoker_mc6845_register_r, pmpoker_mc6845_register_w)
485501   AM_RANGE(0x0844, 0x0847) AM_READWRITE(pia_0_r, pia_0_w)
486502   AM_RANGE(0x0848, 0x084b) AM_READWRITE(pia_1_r, pia_1_w)
487503   AM_RANGE(0x1000, 0x13ff) AM_RAM AM_WRITE(pmpoker_videoram_w) AM_BASE(&videoram)
src/mame/drivers/yumefuda.c
r1679r1680
7373
7474static VIDEO_START( yumefuda )
7575{
76   bg_tilemap = tilemap_create(y_get_bg_tile_info,tilemap_scan_rows,TILEMAP_TYPE_PEN,8,8,32,32);
76   bg_tilemap = tilemap_create(y_get_bg_tile_info,tilemap_scan_rows,8,8,32,32);
7777}
7878
7979static VIDEO_UPDATE( yumefuda )
src/mame/drivers/firebeat.c
r1679r1680
22922292{
22932293   // set keyboard timer
22942294   keyboard_timer = timer_alloc(keyboard_timer_callback, NULL);
2295   timer_adjust(keyboard_timer, ATTOTIME_IN_MSEC(10), 0, ATTOTIME_IN_MSEC(10));
2295   timer_adjust_periodic(keyboard_timer, ATTOTIME_IN_MSEC(10), 0, ATTOTIME_IN_MSEC(10));
22962296}
22972297
22982298static DRIVER_INIT(kbm)
src/mame/drivers/clayshoo.c
r1679r1680
107107
108108   analog_port_val = 0xff;
109109
110   timer_adjust(analog_timer_1, compute_duration(readinputportbytag("AN1")), 0x02, attotime_zero);
111   timer_adjust(analog_timer_2, compute_duration(readinputportbytag("AN2")), 0x01, attotime_zero);
110   timer_adjust_oneshot(analog_timer_1, compute_duration(readinputportbytag("AN1")), 0x02);
111   timer_adjust_oneshot(analog_timer_2, compute_duration(readinputportbytag("AN2")), 0x01);
112112}
113113
114114
src/mame/drivers/namcos23.c
r1679r1680
370370
371371static VIDEO_START( ss23 )
372372{
373   bgtilemap = tilemap_create( TextTilemapGetInfo,tilemap_scan_rows,TILEMAP_TYPE_PEN,16,16,64,64 );
373   bgtilemap = tilemap_create( TextTilemapGetInfo,tilemap_scan_rows,16,16,64,64 );
374374   tilemap_set_transparent_pen( bgtilemap, 0xf );
375375}
376376
src/mame/drivers/tattack.c
r1679r1680
4949
5050static VIDEO_START( tattack )
5151{
52      tmap = tilemap_create( get_tile_info,tilemap_scan_rows,TILEMAP_TYPE_PEN,8,8,32,32 );
52      tmap = tilemap_create( get_tile_info,tilemap_scan_rows,8,8,32,32 );
5353}
5454
5555static ADDRESS_MAP_START( mem, ADDRESS_SPACE_PROGRAM, 8 )
src/mame/drivers/spacefb.c
r1679r1680
135135   else
136136      next_vpos = SPACEFB_INT_TRIGGER_COUNT_1;
137137
138   timer_adjust(interrupt_timer, video_screen_get_time_until_pos(0, next_vpos, 0), 0, attotime_zero);
138   timer_adjust_oneshot(interrupt_timer, video_screen_get_time_until_pos(0, next_vpos, 0), 0);
139139}
140140
141141
r1679r1680
147147
148148static void start_interrupt_timer(void)
149149{
150   timer_adjust(interrupt_timer, video_screen_get_time_until_pos(0, SPACEFB_INT_TRIGGER_COUNT_1, 0), 0, attotime_zero);
150   timer_adjust_oneshot(interrupt_timer, video_screen_get_time_until_pos(0, SPACEFB_INT_TRIGGER_COUNT_1, 0), 0);
151151}
152152
153153
src/mame/drivers/wheelfir.c
r1679r1680
577577   {
578578      scanline_counter++;
579579      cpunum_set_input_line(machine, 0, 5, HOLD_LINE); // raster IRQ, changes scroll values for road
580      timer_adjust(scanline_timer, attotime_div(ATTOTIME_IN_HZ(60), total_scanlines), 0, attotime_zero);
580      timer_adjust_oneshot(scanline_timer, attotime_div(ATTOTIME_IN_HZ(60), total_scanlines), 0);
581581
582582      if (scanline_counter<256)
583583      {
r1679r1680
608608   scanline_counter = -1;
609609   fillbitmap(wheelfir_tmp_bitmap[0], 0,&machine->screen[0].visarea);
610610
611   timer_adjust(frame_timer,  attotime_zero, 0, attotime_zero);
612   timer_adjust(scanline_timer,  attotime_zero, 0, attotime_zero);
611   timer_adjust_oneshot(frame_timer,  attotime_zero, 0);
612   timer_adjust_oneshot(scanline_timer,  attotime_zero, 0);
613613}
614614
615615static MACHINE_RESET(wheelfir)
616616{
617617   frame_timer = timer_alloc(frame_timer_callback, NULL);
618618   scanline_timer = timer_alloc(scanline_timer_callback, NULL);
619   timer_adjust(frame_timer, attotime_zero, 0, attotime_zero);
620   timer_adjust(scanline_timer,  attotime_zero, 0, attotime_zero);
619   timer_adjust_oneshot(frame_timer, attotime_zero, 0);
620   timer_adjust_oneshot(scanline_timer,  attotime_zero, 0);
621621   scanline_counter = -1;
622622}
623623
src/mame/drivers/dunhuang.c
r1679r1680
9595static VIDEO_START(dunhuang)
9696{
9797   tmap = tilemap_create(   get_tile_info, tilemap_scan_rows,
98                     TILEMAP_TYPE_PEN, 8,8, 0x40,0x20   );
98                     8,8, 0x40,0x20   );
9999
100100   tmap2 = tilemap_create(   get_tile_info2, tilemap_scan_rows,
101                     TILEMAP_TYPE_PEN, 8,32, 0x40,0x8   );
101                     8,32, 0x40,0x8   );
102102
103103   tilemap_set_transparent_pen(tmap,   0);
104104   tilemap_set_transparent_pen(tmap2,  0);
src/mame/drivers/onetwo.c
r1679r1680
242242
243243static VIDEO_START( onetwo )
244244{
245   fg_tilemap = tilemap_create(get_fg_tile_info,tilemap_scan_rows,TILEMAP_TYPE_PEN,8,8,64,32);
245   fg_tilemap = tilemap_create(get_fg_tile_info,tilemap_scan_rows,8,8,64,32);
246246}
247247
248248static VIDEO_UPDATE( onetwo )
src/mame/drivers/gunsmoke.c
r1679r1680
303303   MDRV_SCREEN_SIZE(32*8, 32*8)
304304   MDRV_SCREEN_VISIBLE_AREA(0*8, 32*8-1, 2*8, 30*8-1)
305305   MDRV_GFXDECODE(gunsmoke)
306   MDRV_PALETTE_LENGTH(256)
307   MDRV_COLORTABLE_LENGTH(32*4+16*16+16*16)
306   MDRV_PALETTE_LENGTH(32*4+16*16+16*16)
308307
309308   MDRV_PALETTE_INIT(gunsmoke)
310309   MDRV_VIDEO_START(gunsmoke)
src/mame/drivers/cvs.c
r1679r1680
9292#include "cvs.h"
9393
9494
95/* Turn to 1 so all inputs are always available (this shall only be a debug feature) */
96#define CVS_SHOW_ALL_INPUTS   0
97
98
9599#define VERBOSE 1
96100#define LOG(x) do { if (VERBOSE) logerror x; } while (0)
97101
r1679r1680
121125UINT8 *cvs_bullet_ram;
122126UINT8 *cvs_palette_ram;
123127UINT8 *cvs_character_ram;
128UINT8 *cvs_s2636_0_ram;
129UINT8 *cvs_s2636_1_ram;
130UINT8 *cvs_s2636_2_ram;
124131
125132static UINT8 *cvs_4_bit_dac_data;
126133static UINT8 *cvs_tms5110_ctl_data;
r1679r1680
178185}
179186
180187
181READ8_HANDLER( cvs_s2636_1_or_character_ram_r )
188READ8_HANDLER( cvs_s2636_0_or_character_ram_r )
182189{
183190   if (activecpu_get_reg(S2650_FO))
184191      return cvs_character_ram[(0 * 0x800) | 0x400 | character_ram_page_start | offset];
185192   else
186      return s2636_1_ram[offset];
193      return cvs_s2636_0_ram[offset];
187194}
188195
189WRITE8_HANDLER( cvs_s2636_1_or_character_ram_w )
196WRITE8_HANDLER( cvs_s2636_0_or_character_ram_w )
190197{
191198   if (activecpu_get_reg(S2650_FO))
192199      cvs_character_ram[(0 * 0x800) | 0x400 | character_ram_page_start | offset] = data;
193200   else
194      s2636_1_ram[offset] = data;
201      cvs_s2636_0_ram[offset] = data;
195202}
196203
197204
198READ8_HANDLER( cvs_s2636_2_or_character_ram_r )
205READ8_HANDLER( cvs_s2636_1_or_character_ram_r )
199206{
200207   if (activecpu_get_reg(S2650_FO))
201208      return cvs_character_ram[(1 * 0x800) | 0x400 | character_ram_page_start | offset];
202209   else
203      return s2636_2_ram[offset];
210      return cvs_s2636_1_ram[offset];
204211}
205212
206WRITE8_HANDLER( cvs_s2636_2_or_character_ram_w )
213WRITE8_HANDLER( cvs_s2636_1_or_character_ram_w )
207214{
208215   if (activecpu_get_reg(S2650_FO))
209216      cvs_character_ram[(1 * 0x800) | 0x400 | character_ram_page_start | offset] = data;
210217   else
211      s2636_2_ram[offset] = data;
218      cvs_s2636_1_ram[offset] = data;
212219}
213220
214221
215READ8_HANDLER( cvs_s2636_3_or_character_ram_r )
222READ8_HANDLER( cvs_s2636_2_or_character_ram_r )
216223{
217224   if (activecpu_get_reg(S2650_FO))
218225      return cvs_character_ram[(2 * 0x800) | 0x400 | character_ram_page_start | offset];
219226   else
220      return s2636_3_ram[offset];
227      return cvs_s2636_2_ram[offset];
221228}
222229
223WRITE8_HANDLER( cvs_s2636_3_or_character_ram_w )
230WRITE8_HANDLER( cvs_s2636_2_or_character_ram_w )
224231{
225232   if (activecpu_get_reg(S2650_FO))
226233      cvs_character_ram[(2 * 0x800) | 0x400 | character_ram_page_start | offset] = data;
227234   else
228      s2636_3_ram[offset] = data;
235      cvs_s2636_2_ram[offset] = data;
229236}
230237
231238
r1679r1680
480487                                                    by allocating twice the amount,
481488                                                    we can use the same gfx_layout */
482489   /* register state save */
490   state_save_register_global_pointer(cvs_color_ram, 0x400);
491   state_save_register_global_pointer(cvs_palette_ram, 0x10);
492   state_save_register_global_pointer(cvs_character_ram, 3 * 0x800);
483493   state_save_register_global(character_banking_mode);
484494   state_save_register_global(character_ram_page_start);
485495   state_save_register_global(speech_rom_bit_address);
r1679r1680
497507   ADDRESS_MAP_FLAGS( AMEF_ABITS(15) )
498508   AM_RANGE(0x0000, 0x13ff) AM_ROM
499509    AM_RANGE(0x1400, 0x14ff) AM_MIRROR(0x6000) AM_READWRITE(cvs_bullet_ram_or_palette_r, cvs_bullet_ram_or_palette_w) AM_BASE(&cvs_bullet_ram)
500    AM_RANGE(0x1500, 0x15ff) AM_MIRROR(0x6000) AM_READWRITE(cvs_s2636_3_or_character_ram_r, cvs_s2636_3_or_character_ram_w) AM_BASE(&s2636_3_ram)
501    AM_RANGE(0x1600, 0x16ff) AM_MIRROR(0x6000) AM_READWRITE(cvs_s2636_2_or_character_ram_r, cvs_s2636_2_or_character_ram_w) AM_BASE(&s2636_2_ram)
502    AM_RANGE(0x1700, 0x17ff) AM_MIRROR(0x6000) AM_READWRITE(cvs_s2636_1_or_character_ram_r, cvs_s2636_1_or_character_ram_w) AM_BASE(&s2636_1_ram)
510    AM_RANGE(0x1500, 0x15ff) AM_MIRROR(0x6000) AM_READWRITE(cvs_s2636_2_or_character_ram_r, cvs_s2636_2_or_character_ram_w) AM_BASE(&cvs_s2636_2_ram)
511    AM_RANGE(0x1600, 0x16ff) AM_MIRROR(0x6000) AM_READWRITE(cvs_s2636_1_or_character_ram_r, cvs_s2636_1_or_character_ram_w) AM_BASE(&cvs_s2636_1_ram)
512    AM_RANGE(0x1700, 0x17ff) AM_MIRROR(0x6000) AM_READWRITE(cvs_s2636_0_or_character_ram_r, cvs_s2636_0_or_character_ram_w) AM_BASE(&cvs_s2636_0_ram)
503513   AM_RANGE(0x1800, 0x1bff) AM_MIRROR(0x6000) AM_READWRITE(cvs_video_or_color_ram_r, cvs_video_or_color_ram_w) AM_BASE(&cvs_video_ram)
504514    AM_RANGE(0x1c00, 0x1fff) AM_MIRROR(0x6000) AM_RAM
505515   AM_RANGE(0x2000, 0x33ff) AM_ROM
r1679r1680
565575
566576/*************************************
567577 *
568 *  Standard CVS port definition
578 *  Standard CVS port definitions
569579 *
570580 *************************************/
571581
572582static INPUT_PORTS_START( cvs )
583   PORT_START_TAG("IN0")   /* Matrix 0 */
584    PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_START1 )
585    PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_START2 )
586   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_COIN2 )
587   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_COIN1 )
588   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_COCKTAIL        /* "Red button" */
589   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_BUTTON1 )                      /* "Red button" */
590    PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNKNOWN )
591    PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNKNOWN )
573592
574   PORT_START   /* Matrix 0 */
575    PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_START1 )            /* confirmed */
576    PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_START2 )            /* confirmed */
577   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_COIN2 )            /* confirmed */
578   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_COIN1 )            /* confirmed */
579   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_COCKTAIL
580   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_BUTTON1 )         /* confirmed */
581    PORT_BIT( 0xC0, IP_ACTIVE_LOW, IPT_UNKNOWN )
593   PORT_START_TAG("IN1")   /* Dunno */
594   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_COCKTAIL        /* "Green button" */
595   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_BUTTON2 )                      /* "Green button" */
596   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_COCKTAIL
597   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT )  PORT_COCKTAIL
598   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT )
599   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT )
600    PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNKNOWN )
601    PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNKNOWN )
582602
583   PORT_START   /* Dunno */
584   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_BUTTON2) PORT_COCKTAIL
585   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_BUTTON2 )         /* confirmed */
586   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT )      /* confirmed */
587   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT )       /* confirmed */
588    PORT_BIT( 0xcc, IP_ACTIVE_LOW, IPT_UNKNOWN )
589
590   PORT_START   /* Dunno */
591   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_COIN2 )            /* duplicate? */
603   PORT_START_TAG("IN2")   /* Dunno */
604    PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_SERVICE1 )           /* not sure it's SERVICE1 : it uses "Coin B" coinage and doesn't say "CREDIT" */
592605    PORT_BIT( 0xfe, IP_ACTIVE_LOW, IPT_UNKNOWN )
593606
594   PORT_START   /* Dunno */
595   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_JOYSTICK_UP )      /* confirmed */
596   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN )      /* confirmed */
597    PORT_BIT( 0xcf, IP_ACTIVE_LOW, IPT_UNKNOWN )
607   PORT_START_TAG("IN3")   /* Dunno */
608    PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_UNKNOWN )
609    PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_UNKNOWN )
610   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_JOYSTICK_UP )    PORT_COCKTAIL
611   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN )  PORT_COCKTAIL
612   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_JOYSTICK_UP )
613   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN )
614    PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNKNOWN )
615    PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNKNOWN )
598616
599   PORT_START   /* SW BANK 3 */
600   PORT_DIPNAME( 0x01, 0x00, "Color" )
601   PORT_DIPSETTING(    0x00, "Option 1" )
602   PORT_DIPSETTING(    0x01, "Option 2" )
603   PORT_DIPNAME( 0x02, 0x02, DEF_STR( Cabinet ) )
604   PORT_DIPSETTING(    0x02, DEF_STR( Upright ) )
605   PORT_DIPSETTING(    0x00, DEF_STR( Cocktail ) )
606    PORT_DIPNAME( 0x0C, 0x00, DEF_STR( Bonus_Life ) )
607    PORT_DIPSETTING(    0x00, "10k only" )
608    PORT_DIPSETTING(    0x04, "20k only" )
609    PORT_DIPSETTING(    0x08, "30k and every 40k" )
610    PORT_DIPSETTING(    0x0c, "40k and every 80k" )
611   PORT_DIPNAME( 0x10, 0x00, "Registration Length" )
612   PORT_DIPSETTING(    0x00, "3" )
613   PORT_DIPSETTING(    0x10, "10" )
614   PORT_DIPNAME( 0x20, 0x00, "Registration" )
615   PORT_DIPSETTING(    0x20, DEF_STR( Off ) )
616   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
617   PORT_START_TAG("DSW3")   /* SW BANK 3 */
618   PORT_DIPUNUSED( 0x01, IP_ACTIVE_HIGH )                  /* can't tell if it's ACTIVE_HIGH or ACTIVE_LOW */
619   PORT_DIPUNUSED( 0x02, IP_ACTIVE_HIGH )                  /* can't tell if it's ACTIVE_HIGH or ACTIVE_LOW */
620   PORT_DIPUNUSED( 0x04, IP_ACTIVE_HIGH )                  /* can't tell if it's ACTIVE_HIGH or ACTIVE_LOW */
621   PORT_DIPUNUSED( 0x08, IP_ACTIVE_HIGH )                  /* can't tell if it's ACTIVE_HIGH or ACTIVE_LOW */
622   PORT_DIPNAME( 0x10, 0x00, DEF_STR( Cabinet ) )
623   PORT_DIPSETTING(    0x00, DEF_STR( Upright ) )
624   PORT_DIPSETTING(    0x10, DEF_STR( Cocktail ) )
625   PORT_DIPUNUSED( 0x20, IP_ACTIVE_HIGH )                  /* can't tell if it's ACTIVE_HIGH or ACTIVE_LOW */
617626
618    PORT_START   /* SW BANK 2 */
619   PORT_DIPNAME( 0x03, 0x00, "Coins for 1 Play" )         /* confirmed */
620   PORT_DIPSETTING(    0x00, "1" )
621   PORT_DIPSETTING(    0x01, "2" )
622    PORT_DIPSETTING(    0x02, "3" )
623    PORT_DIPSETTING(    0x03, "4" )
624    PORT_DIPNAME( 0x0C, 0x0c, "Plays for 1 Coin" )         /* confirmed */
625    PORT_DIPSETTING(    0x0C, "2" )
626    PORT_DIPSETTING(    0x08, "3" )
627    PORT_DIPSETTING(    0x04, "4" )
628    PORT_DIPSETTING(    0x00, "5" )
629   PORT_DIPNAME( 0x10, 0x00, DEF_STR( Lives ) )         /* confirmed */
627    PORT_START_TAG("DSW2")   /* SW BANK 2 */
628   PORT_DIPNAME( 0x03, 0x00, DEF_STR( Coin_A ) )
629   PORT_DIPSETTING(    0x03, DEF_STR( 4C_1C ) )
630   PORT_DIPSETTING(    0x01, DEF_STR( 3C_1C ) )
631   PORT_DIPSETTING(    0x02, DEF_STR( 2C_1C ) )
632   PORT_DIPSETTING(    0x00, DEF_STR( 1C_1C ) )
633   PORT_DIPNAME( 0x0c, 0x0c, DEF_STR( Coin_B ) )
634   PORT_DIPSETTING(    0x0c, DEF_STR( 1C_2C ) )
635   PORT_DIPSETTING(    0x04, DEF_STR( 1C_3C ) )
636   PORT_DIPSETTING(    0x08, DEF_STR( 1C_4C ) )
637   PORT_DIPSETTING(    0x00, DEF_STR( 1C_5C ) )
638   PORT_DIPNAME( 0x10, 0x00, DEF_STR( Lives ) )
630639   PORT_DIPSETTING(    0x00, "3" )
631640   PORT_DIPSETTING(    0x10, "5" )
632   PORT_DIPNAME( 0x20, 0x00, "Meter Pulses" )
633   PORT_DIPSETTING(    0x00, "2" )
634   PORT_DIPSETTING(    0x20, "5" )
641   PORT_DIPUNUSED( 0x20, IP_ACTIVE_HIGH )                  /* can't tell if it's ACTIVE_HIGH or ACTIVE_LOW */
635642
636643   PORT_START   /* SENSE */
637644   PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_VBLANK )
638645INPUT_PORTS_END
639646
647static INPUT_PORTS_START( cvs_registration )
648   PORT_INCLUDE(cvs)
649
650   PORT_MODIFY("DSW3")
651   PORT_DIPNAME( 0x01, 0x01, "Registration" )              /* can't tell what shall be the default value */
652   PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
653   PORT_DIPSETTING(    0x01, DEF_STR( On ) )
654   PORT_DIPNAME( 0x02, 0x02, "Registration Length" )       /* can't tell what shall be the default value */
655   PORT_DIPSETTING(    0x02, "3" )
656   PORT_DIPSETTING(    0x00, "10" )
657   /* bits 2 and 3 determine bonus life settings but they might change from game to game - they are sometimes unused */
658
659   PORT_MODIFY("DSW2")
660   /* Told to be "Meter Pulses" but I don't know what this means */
661   PORT_DIPNAME( 0x20, 0x00, DEF_STR( Unknown ) )          /* has an effect when COIN2 is pressed (when COIN1 is pressed, value always 1 */
662   PORT_DIPSETTING(    0x00, "2" )
663   PORT_DIPSETTING(    0x20, "5" )
664INPUT_PORTS_END
665
666
667/*************************************
668 *
669 *  Games port definitions
670 *
671 *************************************/
672
673static INPUT_PORTS_START( cosmos )
674   PORT_INCLUDE(cvs)
675
676#if !CVS_SHOW_ALL_INPUTS
677   PORT_MODIFY("IN2")
678    PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_UNUSED )             /* IPT_SERVICE1 */
679
680   PORT_MODIFY("IN3")
681   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_UNUSED )             /* IPT_JOYSTICK_UP   PORT_COCKTAIL */
682   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_UNUSED )             /* IPT_JOYSTICK_DOWN PORT_COCKTAIL */
683   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_UNUSED )             /* IPT_JOYSTICK_UP */
684   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_UNUSED )             /* IPT_JOYSTICK_DOWN */
685#endif
686
687   PORT_MODIFY("DSW3")
688    /* DSW3 bits 0 and 1 stored at 0x7d55 (0, 2, 1, 3) - code at 0x66f3 - not read back */
689    PORT_DIPNAME( 0x0c, 0x0c, DEF_STR( Bonus_Life ) )
690    PORT_DIPSETTING(    0x0c, "10k only" )                  /* displays "10000" */
691    PORT_DIPSETTING(    0x08, "20k only" )                  /* displays "20000" */
692    PORT_DIPSETTING(    0x04, "30k only" )                  /* displays "30000" */
693    PORT_DIPSETTING(    0x00, "40k only" )                  /* displays "40000" */
694INPUT_PORTS_END
695
696static INPUT_PORTS_START( darkwar )
697   PORT_INCLUDE(cvs)
698
699#if !CVS_SHOW_ALL_INPUTS
700   PORT_MODIFY("IN1")
701   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_UNUSED )             /* IPT_BUTTON2 PORT_COCKTAIL */
702   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_UNUSED )             /* IPT_BUTTON2 */
703
704   PORT_MODIFY("IN2")
705    PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_UNUSED )             /* IPT_SERVICE1 */
706
707   PORT_MODIFY("IN3")
708   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_UNUSED )             /* IPT_JOYSTICK_UP   PORT_COCKTAIL */
709   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_UNUSED )             /* IPT_JOYSTICK_DOWN PORT_COCKTAIL */
710   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_UNUSED )             /* IPT_JOYSTICK_UP */
711   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_UNUSED )             /* IPT_JOYSTICK_DOWN */
712#endif
713
714    /* DSW3 bits 0 to 3 are not read */
715INPUT_PORTS_END
716
717static INPUT_PORTS_START( spacefrt )
718   PORT_INCLUDE(cvs)
719
720#if !CVS_SHOW_ALL_INPUTS
721   PORT_MODIFY("IN2")
722    PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_UNUSED )             /* IPT_SERVICE1 */
723
724   PORT_MODIFY("IN3")
725   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_UNUSED )             /* IPT_JOYSTICK_UP   PORT_COCKTAIL */
726   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_UNUSED )             /* IPT_JOYSTICK_DOWN PORT_COCKTAIL */
727   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_UNUSED )             /* IPT_JOYSTICK_UP */
728   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_UNUSED )             /* IPT_JOYSTICK_DOWN */
729#endif
730
731   PORT_MODIFY("DSW3")
732    /* DSW3 bits 0 and 1 stored at 0x7d3f (0, 2, 1, 3) - code at 0x6895 - not read back */
733    PORT_DIPNAME( 0x0c, 0x0c, DEF_STR( Bonus_Life ) )
734    PORT_DIPSETTING(    0x0c, "100k only" )                 /* displays "50000" */
735    PORT_DIPSETTING(    0x08, "150k only" )                 /* displays "110000" */
736    PORT_DIPSETTING(    0x04, "200k only" )                 /* displays "200000" */
737    PORT_DIPSETTING(    0x00, DEF_STR( None ) )             /* displays "200000" */
738INPUT_PORTS_END
739
740
741static INPUT_PORTS_START( 8ball )
742   PORT_INCLUDE(cvs_registration)
743
744#if !CVS_SHOW_ALL_INPUTS
745   PORT_MODIFY("IN1")
746   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_UNUSED )             /* IPT_BUTTON2 PORT_COCKTAIL */
747   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_UNUSED )             /* IPT_BUTTON2 */
748#endif
749
750   PORT_MODIFY("DSW3")
751    PORT_DIPNAME( 0x0c, 0x0c, DEF_STR( Bonus_Life ) )
752    PORT_DIPSETTING(    0x0c, "10k only" )                  /* displays "10000" */
753    PORT_DIPSETTING(    0x08, "20k only" )                  /* displays "20000" */
754    PORT_DIPSETTING(    0x04, "40k only" )                  /* displays "80000" */
755    PORT_DIPSETTING(    0x00, "80k only" )                  /* displays "80000" */
756   PORT_DIPNAME( 0x20, 0x00, "Colors" )                    /* stored at 0x1ed4 - code at 0x0847 ('8ball') or 0x08af ('8ball1') */
757   PORT_DIPSETTING(    0x00, "Palette 1" )                 /* table at 0x0781 ('8ball') or 0x07e9 ('8ball1') - 16 bytes */
758   PORT_DIPSETTING(    0x20, "Palette 2" )                 /* table at 0x0791 ('8ball') or 0x07f9 ('8ball1') - 16 bytes */
759
760   /* DSW2 bit 5 stored at 0x1d93 - code at 0x0858 ('8ball') or 0x08c0 ('8ball1') - read back code at 0x0073 */
761INPUT_PORTS_END
762
763static INPUT_PORTS_START( logger )
764   PORT_INCLUDE(cvs_registration)
765
766#if !CVS_SHOW_ALL_INPUTS
767   PORT_MODIFY("IN1")
768   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_UNUSED )             /* IPT_BUTTON2 PORT_COCKTAIL */
769   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_UNUSED )             /* IPT_BUTTON2 */
770#endif
771
772   PORT_MODIFY("DSW3")
773    PORT_DIPNAME( 0x0c, 0x0c, DEF_STR( Bonus_Life ) )
774    PORT_DIPSETTING(    0x0c, "10k only" )                  /* displays "10000" */
775    PORT_DIPSETTING(    0x08, "20k only" )                  /* displays "20000" */
776    PORT_DIPSETTING(    0x04, "40k only" )                  /* displays "40000" */
777    PORT_DIPSETTING(    0x00, "80k only" )                  /* displays "80000" */
778   /* DSW3 bit 5 stored at 0x7dc8 - code at 0x6eb6 - not read back */
779
780   /* DSW2 bit 5 stored at 0x7da1 - code at 0x6ec7 - read back code at 0x0073 */
781INPUT_PORTS_END
782
783static INPUT_PORTS_START( dazzler )
784   PORT_INCLUDE(cvs_registration)
785
786#if !CVS_SHOW_ALL_INPUTS
787   PORT_MODIFY("IN1")
788   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_UNUSED )             /* IPT_BUTTON2 PORT_COCKTAIL */
789   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_UNUSED )             /* IPT_BUTTON2 */
790#endif
791
792   PORT_MODIFY("DSW3")
793    PORT_DIPNAME( 0x0c, 0x0c, DEF_STR( Bonus_Life ) )
794    PORT_DIPSETTING(    0x0c, "10k only" )                  /* displays "10000" */
795    PORT_DIPSETTING(    0x04, "20k only" )                  /* displays "20000" */
796    PORT_DIPSETTING(    0x08, "40k only" )                  /* displays "40000" */
797    PORT_DIPSETTING(    0x00, "80k only" )                  /* displays "80000" */
798
799   /* DSW2 bit 5 stored at 0x7d9c - code at 0x6b51 - read back code at 0x0099 */
800INPUT_PORTS_END
801
802static INPUT_PORTS_START( wallst )
803   PORT_INCLUDE(cvs_registration)
804
805#if !CVS_SHOW_ALL_INPUTS
806   PORT_MODIFY("IN1")
807   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_UNUSED )             /* IPT_BUTTON2 PORT_COCKTAIL */
808   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_UNUSED )             /* IPT_BUTTON2 */
809#endif
810
811   PORT_MODIFY("DSW3")
812    PORT_DIPNAME( 0x0c, 0x0c, DEF_STR( Bonus_Life ) )
813    PORT_DIPSETTING(    0x0c, "10k only" )                  /* displays "10000" */
814    PORT_DIPSETTING(    0x04, "20k only" )                  /* displays "20000" */
815    PORT_DIPSETTING(    0x08, "40k only" )                  /* displays "40000" */
816    PORT_DIPSETTING(    0x00, "80k only" )                  /* displays "80000" */
817
818   /* DSW2 bit 5 stored at 0x1e95 - code at 0x1232 - read back code at 0x6054 */
819INPUT_PORTS_END
820
821static INPUT_PORTS_START( radarzon )
822   PORT_INCLUDE(cvs_registration)
823
824#if !CVS_SHOW_ALL_INPUTS
825   PORT_MODIFY("IN1")
826   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_UNUSED )             /* IPT_BUTTON2 PORT_COCKTAIL */
827   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_UNUSED )             /* IPT_BUTTON2 */
828#endif
829
830   PORT_MODIFY("DSW3")
831    PORT_DIPNAME( 0x0c, 0x0c, DEF_STR( Bonus_Life ) )
832    PORT_DIPSETTING(    0x0c, "100k only" )                 /* displays "100000" */
833    PORT_DIPSETTING(    0x04, "200k only" )                 /* displays "200000" */
834    PORT_DIPSETTING(    0x08, "400k only" )                 /* displays "400000" */
835    PORT_DIPSETTING(    0x00, "800k only" )                 /* displays "800000" */
836
837   /* DSW2 bit 5 stored at 0x3d6e - code at 0x22aa - read back code at 0x00e4 */
838INPUT_PORTS_END
839
840static INPUT_PORTS_START( goldbug )
841   PORT_INCLUDE(cvs_registration)
842
843#if !CVS_SHOW_ALL_INPUTS
844   PORT_MODIFY("IN1")
845   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_UNUSED )             /* IPT_BUTTON2 PORT_COCKTAIL */
846   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_UNUSED )             /* IPT_BUTTON2 */
847#endif
848
849   PORT_MODIFY("DSW3")
850    PORT_DIPNAME( 0x0c, 0x0c, DEF_STR( Bonus_Life ) )
851    PORT_DIPSETTING(    0x0c, "100k only" )                 /* displays "100000" */
852    PORT_DIPSETTING(    0x04, "200k only" )                 /* displays "200000" */
853    PORT_DIPSETTING(    0x08, "400k only" )                 /* displays "400000" */
854    PORT_DIPSETTING(    0x00, "800k only" )                 /* displays "800000" */
855
856   /* DSW2 bit 5 stored at 0x3d89 - code at 0x3377 - read back code at 0x6054 */
857INPUT_PORTS_END
858
859static INPUT_PORTS_START( diggerc )
860   PORT_INCLUDE(cvs_registration)
861
862#if !CVS_SHOW_ALL_INPUTS
863   PORT_MODIFY("IN1")
864   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_UNUSED )             /* IPT_BUTTON2 PORT_COCKTAIL */
865   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_UNUSED )             /* IPT_BUTTON2 */
866#endif
867
868   PORT_MODIFY("DSW3")
869    PORT_DIPNAME( 0x0c, 0x0c, DEF_STR( Bonus_Life ) )
870    PORT_DIPSETTING(    0x0c, "50k only" )                  /* displays "50000" */
871    PORT_DIPSETTING(    0x04, "100k only" )                 /* displays "100000" */
872    PORT_DIPSETTING(    0x08, "150k only" )                 /* displays "150000" */
873    PORT_DIPSETTING(    0x00, "200k only" )                 /* displays "200000" */
874
875   /* DSW2 bit 5 stored at 0x3db3 - code at 0x22ad - read back code at 0x00e4 */
876INPUT_PORTS_END
877
878static INPUT_PORTS_START( heartatk )
879   PORT_INCLUDE(cvs_registration)
880
881    /* DSW3 bits 2 and 3 stored at 0x1c61 (0, 2, 1, 3) - code at 0x0c52
882       read back code at 0x2197 but untested value : bonus life always at 100000 */
883
884   /* DSW2 bit 5 stored at 0x1e76 - code at 0x0c5c - read back code at 0x00e4 */
885INPUT_PORTS_END
886
887static INPUT_PORTS_START( hunchbak )
888   PORT_INCLUDE(cvs_registration)
889
890#if !CVS_SHOW_ALL_INPUTS
891   PORT_MODIFY("IN1")
892   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_UNUSED )             /* IPT_BUTTON2 PORT_COCKTAIL */
893   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_UNUSED )             /* IPT_BUTTON2 */
894
895   PORT_MODIFY("IN3")
896   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_UNUSED )             /* IPT_JOYSTICK_UP   PORT_COCKTAIL */
897   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_UNUSED )             /* IPT_JOYSTICK_DOWN PORT_COCKTAIL */
898   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_UNUSED )             /* IPT_JOYSTICK_UP */
899   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_UNUSED )             /* IPT_JOYSTICK_DOWN */
900#endif
901
902   PORT_MODIFY("DSW3")
903    PORT_DIPNAME( 0x0c, 0x0c, DEF_STR( Bonus_Life ) )
904    PORT_DIPSETTING(    0x0c, "10k only" )                  /* displays "10000" */
905    PORT_DIPSETTING(    0x04, "20k only" )                  /* displays "20000" */
906    PORT_DIPSETTING(    0x08, "40k only" )                  /* displays "40000" */
907    PORT_DIPSETTING(    0x00, "80k only" )                  /* displays "80000" */
908
909   /* hunchbak : DSW2 bit 5 stored at 0x5e97 - code at 0x516c - read back code at 0x6054 */
910   /* hunchbka : DSW2 bit 5 stored at 0x1e97 - code at 0x0c0c - read back code at 0x6054 */
911INPUT_PORTS_END
912
913static INPUT_PORTS_START( superbik )
914   PORT_INCLUDE(cvs_registration)
915
916    /* DSW3 bits 2 and 3 are not read : bonus life alaways at 5000 */
917
918   /* DSW2 bit 5 stored at 0x1e79 - code at 0x060f - read back code at 0x25bf */
919INPUT_PORTS_END
920
921static INPUT_PORTS_START( raiders )
922   PORT_INCLUDE(cvs_registration)
923
924    /* DSW3 bits 2 and 3 are not read : bonus life alaways at 100000 */
925
926   PORT_MODIFY("DSW2")
927   PORT_DIPUNUSED( 0x10, IP_ACTIVE_HIGH )                  /* always 4 lives - table at 0x4218 - 2 bytes */
928   /* DSW2 bit 5 stored at 0x1e79 - code at 0x1307 - read back code at 0x251d */
929INPUT_PORTS_END
930
931static INPUT_PORTS_START( hero )
932   PORT_INCLUDE(cvs_registration)
933
934#if !CVS_SHOW_ALL_INPUTS
935   PORT_MODIFY("IN1")
936   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_UNUSED )             /* IPT_BUTTON2 PORT_COCKTAIL */
937   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_UNUSED )             /* IPT_BUTTON2 */
938#endif
939
940    /* DSW3 bits 2 and 3 are not read : bonus life alaways at 150000 */
941
942   PORT_MODIFY("DSW2")
943   PORT_DIPUNUSED( 0x10, IP_ACTIVE_HIGH )                  /* always 3 lives - table at 0x4ebb - 2 bytes */
944   /* DSW2 bit 5 stored at 0x1e99 - code at 0x0fdd - read back code at 0x0352 */
945INPUT_PORTS_END
946
947static INPUT_PORTS_START( huncholy )
948   PORT_INCLUDE(cvs_registration)
949
950#if !CVS_SHOW_ALL_INPUTS
951   PORT_MODIFY("IN1")
952   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_UNUSED )             /* IPT_BUTTON2 PORT_COCKTAIL */
953   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_UNUSED )             /* IPT_BUTTON2 */
954#endif
955
956    /* DSW3 bits 2 and 3 are not read : bonus life alaways at 20000 */
957
958   PORT_MODIFY("DSW2")
959   PORT_DIPUNUSED( 0x10, IP_ACTIVE_HIGH )                  /* always 3 lives - table at 0x4531 - 2 bytes */
960   /* DSW2 bit 5 stored at 0x1e7c - code at 0x067d - read back code at 0x2f95 */
961INPUT_PORTS_END
962
963
964/*************************************
965 *
966 *  Graphics definitions
967 *
968 *************************************/
969
640970static const gfx_layout charlayout =
641971{
642972   8,8,   /* 8*8 characters */
r1679r1680
649979};
650980
651981static GFXDECODE_START( cvs )
652   GFXDECODE_ENTRY( REGION_GFX1, 0x0000, charlayout,                  0, 256+3 )   /* chars */
653     GFXDECODE_ENTRY( REGION_GFX1, 0x0000, s2636_gfx_layout, (256+3)*8, 8        )   /* s2636 #1 */
654     GFXDECODE_ENTRY( REGION_GFX1, 0x0000, s2636_gfx_layout, (256+3)*8, 8        )   /* s2636 #2 */
655     GFXDECODE_ENTRY( REGION_GFX1, 0x0000, s2636_gfx_layout, (256+3)*8, 8        )   /* s2636 #3 */
982   GFXDECODE_ENTRY( REGION_GFX1, 0x0000, charlayout, 0, 256+4 )
656983GFXDECODE_END
657984
658985
r1679r1680
6871014   MDRV_VIDEO_UPDATE(cvs)
6881015
6891016   MDRV_GFXDECODE(cvs)
690   MDRV_PALETTE_LENGTH(16)
691   MDRV_COLORTABLE_LENGTH((256+3)*8+(8*2))
1017   MDRV_PALETTE_LENGTH((256+4)*8+8+1)
6921018   MDRV_PALETTE_INIT(cvs)
6931019
6941020   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
r1679r1680
12871613 *
12881614 *************************************/
12891615
1290#define CVS_GAME(year, name, parent, init, company, desc) \
1291GAME( year, name, parent, cvs, cvs, init, ROT90, company, desc, GAME_NO_COCKTAIL )
1292
1293/*        YEAR  NAME      PARENT    INIT */
1294CVS_GAME( 1981, cosmos,   0,        0,       "Century Electronics", "Cosmos" )
1295CVS_GAME( 1981, darkwar,  0,        0,       "Century Electronics", "Dark Warrior" )
1296CVS_GAME( 1981, spacefrt, 0,        0,       "Century Electronics", "Space Fortress (CVS)" )
1297CVS_GAME( 1982, 8ball,    0,        0,       "Century Electronics", "Video Eight Ball" )
1298CVS_GAME( 1982, 8ball1,   8ball,    0,       "Century Electronics", "Video Eight Ball (Rev.1)" )
1299CVS_GAME( 1982, logger,   0,        0,       "Century Electronics", "Logger" )
1300CVS_GAME( 1982, dazzler,  0,        0,       "Century Electronics", "Dazzler" )
1301CVS_GAME( 1982, wallst,   0,        0,       "Century Electronics", "Wall Street" )
1302CVS_GAME( 1982, radarzon, 0,        0,       "Century Electronics", "Radar Zone" )
1303CVS_GAME( 1982, radarzn1, radarzon, 0,       "Century Electronics", "Radar Zone (Rev.1)" )
1304CVS_GAME( 1982, radarznt, radarzon, 0,       "Century Electronics (Tuni Electro Service Inc)", "Radar Zone (Tuni)" )
1305CVS_GAME( 1982, outline,  radarzon, 0,       "Century Electronics", "Outline" )
1306CVS_GAME( 1982, goldbug,  0,        0,       "Century Electronics", "Gold Bug" )
1307CVS_GAME( 1982, diggerc,  0,        0,       "Century Electronics", "Digger (CVS)" )
1308CVS_GAME( 1983, heartatk, 0,        0,       "Century Electronics", "Heart Attack" )
1309CVS_GAME( 1983, hunchbak, 0,        0,       "Century Electronics", "Hunchback (set 1)" )
1310CVS_GAME( 1983, hunchbka, hunchbak, hunchbka,"Century Electronics", "Hunchback (set 2)" )
1311CVS_GAME( 1983, superbik, 0,        superbik,"Century Electronics", "Superbike" )
1312CVS_GAME( 1983, raiders,  0,        raiders, "Century Electronics", "Raiders" )
1313CVS_GAME( 1983, hero,     0,        hero,    "Seatongrove Ltd",     "Hero" )
1314CVS_GAME( 1984, huncholy, 0,        huncholy,"Seatongrove Ltd",     "Hunchback Olympic" )
1616GAME( 1981, cosmos,   0,        cvs,     cosmos,   0,        ROT90, "Century Electronics", "Cosmos", GAME_NO_COCKTAIL )
1617GAME( 1981, darkwar,  0,        cvs,     darkwar,  0,        ROT90, "Century Electronics", "Dark Warrior", GAME_NO_COCKTAIL )
1618GAME( 1981, spacefrt, 0,        cvs,     spacefrt, 0,        ROT90, "Century Electronics", "Space Fortress (CVS)", GAME_NO_COCKTAIL )
1619GAME( 1982, 8ball,    0,        cvs,     8ball,    0,        ROT90, "Century Electronics", "Video Eight Ball", GAME_NO_COCKTAIL )
1620GAME( 1982, 8ball1,   8ball,    cvs,     8ball,    0,        ROT90, "Century Electronics", "Video Eight Ball (Rev.1)", GAME_NO_COCKTAIL )
1621GAME( 1982, logger,   0,        cvs,     logger,   0,        ROT90, "Century Electronics", "Logger", GAME_NO_COCKTAIL )
1622GAME( 1982, dazzler,  0,        cvs,     dazzler,  0,        ROT90, "Century Electronics", "Dazzler", GAME_NO_COCKTAIL )
1623GAME( 1982, wallst,   0,        cvs,     wallst,   0,        ROT90, "Century Electronics", "Wall Street", GAME_NO_COCKTAIL )
1624GAME( 1982, radarzon, 0,        cvs,     radarzon, 0,        ROT90, "Century Electronics", "Radar Zone", GAME_NO_COCKTAIL )
1625GAME( 1982, radarzn1, radarzon, cvs,     radarzon, 0,        ROT90, "Century Electronics", "Radar Zone (Rev.1)", GAME_NO_COCKTAIL )
1626GAME( 1982, radarznt, radarzon, cvs,     radarzon, 0,        ROT90, "Century Electronics (Tuni Electro Service Inc)", "Radar Zone (Tuni)", GAME_NO_COCKTAIL )
1627GAME( 1982, outline,  radarzon, cvs,     radarzon, 0,        ROT90, "Century Electronics", "Outline", GAME_NO_COCKTAIL )
1628GAME( 1982, goldbug,  0,        cvs,     goldbug,  0,        ROT90, "Century Electronics", "Gold Bug", GAME_NO_COCKTAIL )
1629GAME( 1982, diggerc,  0,        cvs,     diggerc,  0,        ROT90, "Century Electronics", "Digger (CVS)", GAME_NO_COCKTAIL )
1630GAME( 1983, heartatk, 0,        cvs,     heartatk, 0,        ROT90, "Century Electronics", "Heart Attack", GAME_NO_COCKTAIL )
1631GAME( 1983, hunchbak, 0,        cvs,     hunchbak, 0,        ROT90, "Century Electronics", "Hunchback (set 1)", GAME_NO_COCKTAIL )
1632GAME( 1983, hunchbka, hunchbak, cvs,     hunchbak, hunchbka, ROT90, "Century Electronics", "Hunchback (set 2)", GAME_NO_COCKTAIL )
1633GAME( 1983, superbik, 0,        cvs,     superbik, superbik, ROT90, "Century Electronics", "Superbike", GAME_NO_COCKTAIL )
1634GAME( 1983, raiders,  0,        cvs,     raiders,  raiders,  ROT90, "Century Electronics", "Raiders", GAME_NO_COCKTAIL )
1635GAME( 1983, hero,     0,        cvs,     hero,     hero,     ROT90, "Seatongrove Ltd",     "Hero", GAME_NO_COCKTAIL )
1636GAME( 1984, huncholy, 0,        cvs,     huncholy, huncholy, ROT90, "Seatongrove Ltd",     "Hunchback Olympic", GAME_NO_COCKTAIL )
src/mame/drivers/seta.c
r1679r1680
13261326
13271327   if( max != 0 ) {
13281328      attotime period = attotime_mul(ATTOTIME_IN_HZ(cpunum_get_clock(0)), 16 * max);
1329      timer_adjust( uPD71054.timer[no], period, no, attotime_zero );
1329      timer_adjust_oneshot( uPD71054.timer[no], period, no );
13301330   } else {
1331      timer_adjust( uPD71054.timer[no], attotime_never, no, attotime_never);
1331      timer_adjust_oneshot( uPD71054.timer[no], attotime_never, no);
13321332      logerror( "CPU #0 PC %06X: uPD71054 error, timer %d duration is 0\n",
13331333            activecpu_get_pc(), no );
13341334   }
src/mame/drivers/laserbat.c
r1679r1680
3131static tilemap *bg_tilemap;
3232static int laserbat_video_page = 0;
3333static int laserbat_input_mux = 0;
34static s2636_t *s2636_0, *s2636_1, *s2636_2;
35static UINT8 *s2636_0_ram;
36static UINT8 *s2636_1_ram;
37static UINT8 *s2636_2_ram;
3438
3539static mame_bitmap *collision_bitmap;
3640
r1679r1680
182186   AM_RANGE(0x7800, 0x7bff) AM_ROM
183187
184188   AM_RANGE(0x1400, 0x14ff) AM_MIRROR(0x6000) AM_WRITENOP // always 0 (bullet ram in Quasar)
185   AM_RANGE(0x1500, 0x15ff) AM_MIRROR(0x6000) AM_RAM AM_BASE(&s2636_1_ram)
186   AM_RANGE(0x1600, 0x16ff) AM_MIRROR(0x6000) AM_RAM AM_BASE(&s2636_2_ram)
187   AM_RANGE(0x1700, 0x17ff) AM_MIRROR(0x6000) AM_RAM AM_BASE(&s2636_3_ram)
189   AM_RANGE(0x1500, 0x15ff) AM_MIRROR(0x6000) AM_RAM AM_BASE(&s2636_0_ram)
190   AM_RANGE(0x1600, 0x16ff) AM_MIRROR(0x6000) AM_RAM AM_BASE(&s2636_1_ram)
191   AM_RANGE(0x1700, 0x17ff) AM_MIRROR(0x6000) AM_RAM AM_BASE(&s2636_2_ram)
188192   AM_RANGE(0x1800, 0x1bff) AM_MIRROR(0x6000) AM_WRITE(laserbat_videoram_w)
189193   AM_RANGE(0x1c00, 0x1fff) AM_MIRROR(0x6000) AM_RAM
190194ADDRESS_MAP_END
r1679r1680
489493
490494static GFXDECODE_START( laserbat )
491495   GFXDECODE_ENTRY( REGION_GFX1, 0x0000, charlayout,       0, 256 )   /* Rom chars */
492   GFXDECODE_ENTRY( REGION_CPU1, 0x1500, s2636_gfx_layout, 0,   8 )   /* s2636 #1  */
493   GFXDECODE_ENTRY( REGION_CPU1, 0x1600, s2636_gfx_layout, 0,   8 )   /* s2636 #2  */
494   GFXDECODE_ENTRY( REGION_CPU1, 0x1700, s2636_gfx_layout, 0,   8 )   /* s2636 #3  */
495496   GFXDECODE_ENTRY( REGION_GFX2, 0x0000, sprites_layout,   0,   8 )   /* Sprites   */
496497GFXDECODE_END
497498
r1679r1680
503504
504505static VIDEO_START( laserbat )
505506{
506   bg_tilemap = tilemap_create(get_tile_info,tilemap_scan_rows,TILEMAP_TYPE_PEN,8,8,32,32);
507   bg_tilemap = tilemap_create(get_tile_info,tilemap_scan_rows,8,8,32,32);
507508
508509   videoram = (UINT8 *)auto_malloc(0x400);
509510   colorram = (UINT8 *)auto_malloc(0x400);
510511
511512   collision_bitmap = auto_bitmap_alloc(machine->screen[0].width,machine->screen[0].height,BITMAP_FORMAT_INDEXED8);
512513
513   s2636_x_offset = -19;
514   /* configure the S2636 chips */
515   s2636_0 = s2636_config(s2636_0_ram, machine->screen[0].height, machine->screen[0].width, 0, -19);
516   s2636_1 = s2636_config(s2636_1_ram, machine->screen[0].height, machine->screen[0].width, 0, -19);
517   s2636_2 = s2636_config(s2636_2_ram, machine->screen[0].height, machine->screen[0].width, 0, -19);
514518}
515519
516520static VIDEO_UPDATE( laserbat )
517521{
522   int y;
523   mame_bitmap *s2636_0_bitmap;
524   mame_bitmap *s2636_1_bitmap;
525   mame_bitmap *s2636_2_bitmap;
526
518527   tilemap_draw(bitmap, cliprect, bg_tilemap, 0, 0);
519528
520   s2636_update_bitmap(machine,bitmap,s2636_1_ram,1,collision_bitmap);
521   s2636_update_bitmap(machine,bitmap,s2636_2_ram,2,collision_bitmap);
522   s2636_update_bitmap(machine,bitmap,s2636_3_ram,3,collision_bitmap);
529    /* update the S2636 chips */
530   s2636_0_bitmap = s2636_update(s2636_0, cliprect);
531   s2636_1_bitmap = s2636_update(s2636_1, cliprect);
532   s2636_2_bitmap = s2636_update(s2636_2, cliprect);
523533
534   /* copy the S2636 images into the main bitmap */
535   for (y = cliprect->min_y; y <= cliprect->max_y; y++)
536   {
537      int x;
538
539      for (x = cliprect->min_x; x <= cliprect->max_x; x++)
540      {
541         int pixel0 = *BITMAP_ADDR8(s2636_0_bitmap, y, x);
542         int pixel1 = *BITMAP_ADDR8(s2636_1_bitmap, y, x);
543         int pixel2 = *BITMAP_ADDR8(s2636_2_bitmap, y, x);
544
545         if (S2636_IS_PIXEL_DRAWN(pixel0))
546            *BITMAP_ADDR16(bitmap, y, x) = machine->pens[S2636_PIXEL_COLOR(pixel0)];
547
548         if (S2636_IS_PIXEL_DRAWN(pixel1))
549            *BITMAP_ADDR16(bitmap, y, x) = machine->pens[S2636_PIXEL_COLOR(pixel1)];
550
551         if (S2636_IS_PIXEL_DRAWN(pixel2))
552            *BITMAP_ADDR16(bitmap, y, x) = machine->pens[S2636_PIXEL_COLOR(pixel2)];
553      }
554   }
555
524556   if(sprite_info.enable)
525      drawgfx(bitmap,machine->gfx[4],
557      drawgfx(bitmap,machine->gfx[1],
526558              sprite_info.code,
527559            sprite_info.color,
528560            0,0,
529561            sprite_info.x - 6,sprite_info.y,
530562            cliprect,TRANSPARENCY_PEN,0);
563
531564   return 0;
532565}
533566
r1679r1680
677710
678711   MDRV_GFXDECODE(laserbat)
679712   MDRV_PALETTE_LENGTH(1024)
680   MDRV_COLORTABLE_LENGTH(4096)
681713
682714   MDRV_VIDEO_START(laserbat)
683715   MDRV_VIDEO_UPDATE(laserbat)
src/mame/drivers/tp84.c
r1679r1680
8989
9090extern UINT8 *tp84_videoram2, *tp84_colorram2;
9191
92extern WRITE8_HANDLER( tp84_videoram_w );
93extern WRITE8_HANDLER( tp84_colorram_w );
94extern WRITE8_HANDLER( tp84_videoram2_w );
95extern WRITE8_HANDLER( tp84_colorram2_w );
96extern WRITE8_HANDLER( tp84_scroll_x_w );
97extern WRITE8_HANDLER( tp84_scroll_y_w );
98extern WRITE8_HANDLER( tp84_flipscreen_x_w );
99extern WRITE8_HANDLER( tp84_flipscreen_y_w );
100extern WRITE8_HANDLER( tp84_col0_w );
101extern READ8_HANDLER( tp84_scanline_r );
92WRITE8_HANDLER( tp84_videoram_w );
93WRITE8_HANDLER( tp84_colorram_w );
94WRITE8_HANDLER( tp84_videoram2_w );
95WRITE8_HANDLER( tp84_colorram2_w );
96WRITE8_HANDLER( tp84_scroll_x_w );
97WRITE8_HANDLER( tp84_scroll_y_w );
98WRITE8_HANDLER( tp84_flipscreen_x_w );
99WRITE8_HANDLER( tp84_flipscreen_y_w );
100WRITE8_HANDLER( tp84_col0_w );
101READ8_HANDLER( tp84_scanline_r );
102102
103extern PALETTE_INIT( tp84 );
104extern VIDEO_START( tp84 );
105extern VIDEO_UPDATE( tp84 );
103PALETTE_INIT( tp84 );
104VIDEO_START( tp84 );
105VIDEO_UPDATE( tp84 );
106106
107extern INTERRUPT_GEN( tp84_6809_interrupt );
107INTERRUPT_GEN( tp84_6809_interrupt );
108108
109109
110static UINT8 *sharedram;
111110
112static READ8_HANDLER( sharedram_r )
113{
114   return sharedram[offset];
115}
116
117static WRITE8_HANDLER( sharedram_w )
118{
119   sharedram[offset] = data;
120}
121
122
123
124111static READ8_HANDLER( tp84_sh_timer_r )
125112{
126113   /* main xtal 14.318MHz, divided by 4 to get the CPU clock, further */
r1679r1680
172159   AM_RANGE(0x2860, 0x2860) AM_READ(input_port_3_r)
173160   AM_RANGE(0x3000, 0x3000) AM_READ(input_port_4_r)
174161   AM_RANGE(0x4000, 0x4fff) AM_READ(MRA8_RAM)
175   AM_RANGE(0x5000, 0x57ff) AM_READ(sharedram_r)
162   AM_RANGE(0x5000, 0x57ff) AM_READ(MRA8_RAM) AM_SHARE(1)
176163   AM_RANGE(0x8000, 0xffff) AM_READ(MRA8_ROM)
177164ADDRESS_MAP_END
178165
r1679r1680
191178   AM_RANGE(0x4400, 0x47ff) AM_WRITE(tp84_videoram2_w) AM_BASE(&tp84_videoram2)
192179   AM_RANGE(0x4800, 0x4bff) AM_WRITE(tp84_colorram_w) AM_BASE(&colorram)
193180   AM_RANGE(0x4c00, 0x4fff) AM_WRITE(tp84_colorram2_w) AM_BASE(&tp84_colorram2)
194   AM_RANGE(0x5000, 0x57ff) AM_WRITE(sharedram_w) AM_BASE(&sharedram)
181   AM_RANGE(0x5000, 0x57ff) AM_WRITE(MWA8_RAM) AM_SHARE(1)
195182   AM_RANGE(0x8000, 0xffff) AM_WRITE(MWA8_ROM)
196183ADDRESS_MAP_END
197184
r1679r1680
200187   AM_RANGE(0x0400, 0x07ff) AM_RAM AM_WRITE(tp84_videoram2_w) AM_BASE(&tp84_videoram2)
201188   AM_RANGE(0x0800, 0x0bff) AM_RAM AM_WRITE(tp84_colorram_w) AM_BASE(&colorram)
202189   AM_RANGE(0x0c00, 0x0fff) AM_RAM AM_WRITE(tp84_colorram2_w) AM_BASE(&tp84_colorram2)
203   AM_RANGE(0x1000, 0x17ff) AM_READWRITE(sharedram_r, sharedram_w) AM_BASE(&sharedram)
190   AM_RANGE(0x1000, 0x17ff) AM_RAM AM_SHARE(1)
204191   AM_RANGE(0x1800, 0x1800) AM_WRITE(watchdog_reset_w)
205192   AM_RANGE(0x1a00, 0x1a00) AM_READWRITE(input_port_0_r, tp84_col0_w)
206193   AM_RANGE(0x1a20, 0x1a20) AM_READ(input_port_1_r)
r1679r1680
222209//  AM_RANGE(0x0000, 0x0000) AM_READ(MRA8_RAM)
223210   AM_RANGE(0x2000, 0x2000) AM_READ(tp84_scanline_r) /* beam position */
224211   AM_RANGE(0x6000, 0x67ff) AM_READ(MRA8_RAM)
225   AM_RANGE(0x8000, 0x87ff) AM_READ(sharedram_r)
212   AM_RANGE(0x8000, 0x87ff) AM_READ(MRA8_RAM) AM_SHARE(1)
226213   AM_RANGE(0xe000, 0xffff) AM_READ(MRA8_ROM)
227214ADDRESS_MAP_END
228215
r1679r1680
232219   AM_RANGE(0x4000, 0x4000) AM_WRITE(interrupt_enable_w) /* IRQ enable */
233220   AM_RANGE(0x6000, 0x679f) AM_WRITE(MWA8_RAM)
234221   AM_RANGE(0x67a0, 0x67ff) AM_WRITE(MWA8_RAM) AM_BASE(&spriteram) AM_SIZE(&spriteram_size)   /* REAL (multiplexed) */
235   AM_RANGE(0x8000, 0x87ff) AM_WRITE(sharedram_w)
222   AM_RANGE(0x8000, 0x87ff) AM_WRITE(MWA8_RAM) AM_SHARE(1)
236223   AM_RANGE(0xe000, 0xffff) AM_WRITE(MWA8_ROM)
237224ADDRESS_MAP_END
238225
r1679r1680
495482   MDRV_SCREEN_SIZE(32*8, 32*8)
496483   MDRV_SCREEN_VISIBLE_AREA(0*8, 32*8-1, 2*8, 30*8-1)
497484   MDRV_GFXDECODE(tp84)
498   MDRV_PALETTE_LENGTH(256)
499   MDRV_COLORTABLE_LENGTH(4096)
485   MDRV_PALETTE_LENGTH(4096)
500486
501487   MDRV_PALETTE_INIT(tp84)
502488   MDRV_VIDEO_START(tp84)
src/mame/drivers/higemaru.c
r1679r1680
186186   MDRV_SCREEN_SIZE(32*8, 32*8)
187187   MDRV_SCREEN_VISIBLE_AREA(0*8, 32*8-1, 2*8, 30*8-1)
188188   MDRV_GFXDECODE(higemaru)
189   MDRV_PALETTE_LENGTH(32)
190   MDRV_COLORTABLE_LENGTH(32*4+16*16)
189   MDRV_PALETTE_LENGTH(32*4+16*16)
191190
192191   MDRV_PALETTE_INIT(higemaru)
193192   MDRV_VIDEO_START(higemaru)
src/mame/drivers/plygonet.c
r1679r1680
729729   PORT_START
730730
731731   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_COIN1)
732   PORT_BIT(0x02, IP_ACTIVE_LOW, IPT_SERVICE ) PORT_NAME( DEF_STR( Service_Mode )) PORT_CODE(KEYCODE_F2)
732   PORT_SERVICE_NO_TOGGLE( 0x02, IP_ACTIVE_LOW )
733733   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_COIN2)
734734   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_COIN3)
735735   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_START1)
r1679r1680
750750   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_SPECIAL )   /* EEPROM data */
751751   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_SPECIAL )   /* EEPROM ready (always 1) */
752752   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_UNKNOWN )
753   PORT_BIT(0x08, IP_ACTIVE_LOW, IPT_SERVICE ) PORT_NAME( DEF_STR( Service_Mode )) PORT_CODE(KEYCODE_F2)
754   PORT_DIPNAME(0x10, 0x00, "Monitors")
755   PORT_DIPSETTING(0x00, "1 Monitor")
756   PORT_DIPSETTING(0x10, "2 Monitors")
757//  PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_UNKNOWN )
753   PORT_SERVICE_NO_TOGGLE( 0x08, IP_ACTIVE_LOW )
754   PORT_DIPNAME( 0x10, 0x00, "Monitors" )
755   PORT_DIPSETTING( 0x00, "1 Monitor" )
756   PORT_DIPSETTING( 0x10, "2 Monitors" )
758757   PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_UNKNOWN )
759758   PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_UNKNOWN )
760759   PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_UNKNOWN )
src/mame/drivers/naomi.c
r1679r1680
503503
504504#include "driver.h"
505505#include "video/generic.h"
506#include "machine/eeprom.h"
507#include "machine/x76f100.h"
506508#include "cpu/sh4/sh4.h"
507509#include "cpu/arm7/arm7core.h"
508510#include "dc.h"
r1679r1680
513515
514516static UINT32 *dc_sound_ram;
515517extern UINT64 *dc_texture_ram;
516static UINT32 rom_offset, dma_offset;
518static UINT32 rom_offset, dma_count;
519UINT32 dma_offset;
517520
518521static INTERRUPT_GEN( naomi_vblank )
519522{
r1679r1680
587590
588591      return ret;
589592   }
593   else if ((offset == 15) && ((mem_mask & U64(0xffff00000000)) == 0)) // boardid read
594   {
595      UINT64 ret;
596
597      ret = x76f100_sda_read( 0 ) << 15;
598
599      return ret << 32;
600   }
590601   else
591602   {
592603      mame_printf_verbose("ROM: read mask %llx @ %x (PC=%x)\n", mem_mask, offset, activecpu_get_pc());
r1679r1680
597608
598609static WRITE64_HANDLER( naomi_rom_board_w )
599610{
600   if ((offset == 1) && ((mem_mask & U64(0xffff)) == 0))
611   if ((offset == 1) && ((mem_mask & U64(0xffff00000000)) == 0))
601612   {
602613      // DMA_OFFSETH
603614      dma_offset &= 0xffff;
604      dma_offset |= (data & 0x1fff)<<16;
615      dma_offset |= (data >> 16) & 0x1fff0000;
605616   }
606   else if ((offset == 1) && ((mem_mask & U64(0xffff00000000)) == 0))
617   else if ((offset == 2) && ((mem_mask & U64(0xffff)) == 0))
607618   {
608619      // DMA_OFFSETL
609620      dma_offset &= 0xffff0000;
r1679r1680
621632      rom_offset &= 0xffff0000;
622633      rom_offset |= (data & 0xffff);
623634   }
635   else if ((offset == 15) && ((mem_mask & 0xffff) == 0))
636   {
637      // NAOMI_BOARDID_WRITE
638      x76f100_cs_write(0, (data >> 2) & 1 );
639      x76f100_rst_write(0, (data >> 3) & 1 );
640      x76f100_scl_write(0, (data >> 1) & 1 );
641      x76f100_sda_write(0, (data >> 0) & 1 );
642   }
643   else if ((offset == 2) && ((mem_mask & U64(0xffffffff00000000)) == 0))
644   {
645      // NAOMI_DMA_COUNT
646      dma_count = data >> 32;
647   }
624648   else
625649   {
626650      mame_printf_verbose("ROM: write %llx to %x, mask %llx (PC=%x)\n", data, offset, mem_mask, activecpu_get_pc());
627651   }
628652}
629653
654static NVRAM_HANDLER( naomi_eeproms )
655{
656   static UINT8 eeprom_romboard[20+48] = {0x19,0x00,0xaa,0x55,0,0,0,0,0,0,0,0,0x69,0x79,0x68,0x6b,0x74,0x6d,0x68,0x6d};
657
658   if (read_or_write)
659      /*EEPROM_save(file)*/;
660   else
661   {
662      EEPROM_init(&eeprom_interface_93C46);
663      /*if (file)
664            EEPROM_load(file);
665        else*/
666      EEPROM_set_data((UINT8 *)"\011\241                              0000000000000000", 48);  // 2*checksum 30*unknown 16*serial
667      x76f100_init( 0, eeprom_romboard );
668      memcpy(eeprom_romboard+20,"\241\011                              0000000000000000",48);
669   }
670}
671
672static READ64_HANDLER( eeprom_93c46a_r )
673{
674   int res;
675
676   /* bit 3 is EEPROM data */
677   res = EEPROM_read_bit() << 4;
678   return res;
679}
680
681static WRITE64_HANDLER( eeprom_93c46a_w )
682{
683   /* bit 4 is data */
684   /* bit 2 is clock */
685   /* bit 5 is cs */
686   EEPROM_write_bit(data & 0x8);
687   EEPROM_set_cs_line((data & 0x20) ? CLEAR_LINE : ASSERT_LINE);
688   EEPROM_set_clock_line((data & 0x4) ? ASSERT_LINE : CLEAR_LINE);
689}
690
630691static ADDRESS_MAP_START( naomi_map, ADDRESS_SPACE_PROGRAM, 64 )
631   AM_RANGE(0x00000000, 0x001fffff) AM_ROM                           // BIOS
632   AM_RANGE(0x00200000, 0x00207fff) AM_RAM                           // bios uses it (battery backed ram ?)
692   AM_RANGE(0x00000000, 0x001fffff) AM_ROM                                             // BIOS
693   AM_RANGE(0x00200000, 0x00207fff) AM_RAM                                             // bios uses it (battery backed ram ?)
633694   AM_RANGE(0x005f6800, 0x005f69ff) AM_READWRITE( dc_sysctrl_r, dc_sysctrl_w )
634695   AM_RANGE(0x005f6c00, 0x005f6cff) AM_READWRITE( dc_maple_r, dc_maple_w )
635696   AM_RANGE(0x005f7000, 0x005f70ff) AM_READWRITE( naomi_rom_board_r, naomi_rom_board_w )
r1679r1680
640701   AM_RANGE(0x00600000, 0x006007ff) AM_READWRITE( dc_modem_r, dc_modem_w )
641702   AM_RANGE(0x00700000, 0x00707fff) AM_READWRITE( dc_aica_reg_r, dc_aica_reg_w )
642703   AM_RANGE(0x00710000, 0x0071000f) AM_READWRITE( dc_rtc_r, dc_rtc_w )
643   AM_RANGE(0x00800000, 0x009fffff) AM_READWRITE( naomi_arm_r, naomi_arm_w ) // sound RAM
644   AM_RANGE(0x0103ff00, 0x0103ffff) AM_READWRITE( naomi_unknown1_r, naomi_unknown1_w )    // bios uses it, actual start and end addresses not known
645   AM_RANGE(0x04000000, 0x04ffffff) AM_RAM   AM_SHARE(2) AM_BASE( &dc_texture_ram )          // texture memory
646   AM_RANGE(0x05000000, 0x05ffffff) AM_RAM AM_SHARE(2)                     // mirror of texture RAM
647   AM_RANGE(0x0c000000, 0x0cffffff) AM_RAM AM_SHARE(1)
648   AM_RANGE(0x0d000000, 0x0dffffff) AM_RAM AM_SHARE(1)                     // mirror of main RAM
704   AM_RANGE(0x00800000, 0x00ffffff) AM_READWRITE( naomi_arm_r, naomi_arm_w )           // sound RAM (8 MB)
705   AM_RANGE(0x0103ff00, 0x0103ffff) AM_READWRITE( naomi_unknown1_r, naomi_unknown1_w ) // bios uses it, actual start and end addresses not known
706   AM_RANGE(0x04000000, 0x04ffffff) AM_RAM   AM_SHARE(2) AM_BASE( &dc_texture_ram )      // texture memory 64 bit access
707   AM_RANGE(0x05000000, 0x05ffffff) AM_RAM AM_SHARE(2)                                 // mirror of texture RAM 32 bit access
708   AM_RANGE(0x0c000000, 0x0dffffff) AM_RAM
649709   AM_RANGE(0x10000000, 0x107fffff) AM_WRITE( ta_fifo_poly_w )
650710   AM_RANGE(0x10800000, 0x10ffffff) AM_WRITE( ta_fifo_yuv_w )
651   AM_RANGE(0x11000000, 0x11ffffff) AM_RAM AM_SHARE(2)                     // another mirror of texture memory
711   AM_RANGE(0x11000000, 0x11ffffff) AM_RAM AM_SHARE(2)                                 // another mirror of texture memory
652712   AM_RANGE(0xa0000000, 0xa01fffff) AM_ROM AM_REGION(REGION_CPU1, 0)
653713ADDRESS_MAP_END
654714
715static ADDRESS_MAP_START( naomi_port, ADDRESS_SPACE_IO, 64 )
716   AM_RANGE(0x00, 0x0f) AM_READWRITE(eeprom_93c46a_r, eeprom_93c46a_w)
717ADDRESS_MAP_END
718
655719static READ32_HANDLER( test1 )
656720{
657721   return -1;
658722}
659723
660724static ADDRESS_MAP_START( dc_audio_map, ADDRESS_SPACE_PROGRAM, 32 )
661   AM_RANGE(0x00000000, 0x001fffff) AM_RAM   AM_BASE( &dc_sound_ram )   /* shared with SH-4 */
662   AM_RANGE(0x00200000, 0x002000ff) AM_READ( test1 )   // for bug (?) in sound bios
663   AM_RANGE(0x00800000, 0x00807fff) AM_READWRITE( dc_aica_arm_r, dc_aica_arm_w )   /* shared with SH-4 */
725   AM_RANGE(0x00000000, 0x007fffff) AM_RAM   AM_BASE( &dc_sound_ram )                /* shared with SH-4 */
726   AM_RANGE(0x00800000, 0x00807fff) AM_READWRITE( dc_aica_arm_r, dc_aica_arm_w )   /* shared with SH-4 */
727   AM_RANGE(0x00808000, 0x008080ff) AM_READ( test1 )                               // for bug (?) in sound bios
664728ADDRESS_MAP_END
665729
666730static INPUT_PORTS_START( naomi )
667731   PORT_START
668732   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_SERVICE1 ) PORT_NAME("Service")
669   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_SERVICE ) PORT_NAME(DEF_STR( Test )) PORT_CODE(KEYCODE_F2)
733   PORT_SERVICE_NO_TOGGLE( 0x01, IP_ACTIVE_LOW )
670734INPUT_PORTS_END
671735
672736static MACHINE_DRIVER_START( naomi )
r1679r1680
674738   MDRV_CPU_ADD_TAG("main", SH4, CPU_CLOCK) // SH4!!!
675739   MDRV_CPU_CONFIG(sh4cpu_config)
676740   MDRV_CPU_PROGRAM_MAP(naomi_map,0)
677   MDRV_CPU_VBLANK_INT(naomi_vblank,479)
741   MDRV_CPU_IO_MAP(naomi_port,0)
742   MDRV_CPU_VBLANK_INT(naomi_vblank,1)
678743
679   MDRV_CPU_ADD_TAG("sound", ARM7, 45000000)
744   MDRV_CPU_ADD_TAG("sound", ARM7, ((XTAL_33_8688MHz*2)/3)/8)   // AICA bus clock is 2/3rds * 33.8688.  ARM7 gets 1 bus cycle out of each 8.
680745   MDRV_CPU_PROGRAM_MAP(dc_audio_map, 0)
681746
682747   MDRV_MACHINE_RESET( dc )
r1679r1680
684749   MDRV_SCREEN_REFRESH_RATE(60)
685750   MDRV_SCREEN_VBLANK_TIME(DEFAULT_60HZ_VBLANK_DURATION)
686751
752   MDRV_NVRAM_HANDLER(naomi_eeproms)
753
687754   /* video hardware */
688755   MDRV_VIDEO_ATTRIBUTES(VIDEO_TYPE_RASTER)
689756   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_RGB32)
r1679r1680
716783EPR-21578a - NAOMI BOOT ROM 1999 02/15  1.20 (Export)
717784EPR-21579  - No known dump (Korea)
718785EPR-21580  - No known dump (Australia)
719EPR-22851  - NAOMI BOOT ROM 1999 08/30  1.35 (Multisystem 3 screen)
786EPR-22851  - NAOMI BOOT ROM 1999 08/30  1.35 (Multisystem 3 screen Ferrari F355)
720787
721788EPR-21577e & EPR-2178e differ by 7 bytes:
722789
r1679r1680
7247910x1ffffa-0x1fffff is the BIOS checksum
725792
726793
794House of the Dead 2 specific Naomi BIOS roms:
795
796Info from roms starting at 0x1ff060
797
798EPR-21330  - HOUSE OF THE DEAD 2 IPL ROM 1998 11/14 (USA)
799EPR-21331  - HOUSE OF THE DEAD 2 IPL ROM 1998 11/14 (Export)
800
801EPR-21330 & EPR-21331 differ by 7 bytes:
802
8030x40000 is the region byte (only one region byte)
8040x1ffffa-0x1fffff is the BIOS checksum
805
806
727807Region byte encoding is as follows:
728808
7298090x00 = Japan
7308100x01 = USA
7318110x02 = Export
732???? = Korea
733???? = Australia
8120x?? = Korea
8130x?? = Australia
734814
735815Scan ROM for the text string "LOADING TEST MODE NOW" back up four (4) bytes for the region byte.
736  NOTE: this doesn't work for the multi screen boot rom
816  NOTE: this doesn't work for the HOTD2 or multi screen boot roms
737817
738818*/
739819
740820#define NAOMI_BIOS \
741   ROM_SYSTEM_BIOS( 0, "bios0", "epr-21578e" ) \
821   ROM_SYSTEM_BIOS( 0, "bios0", "epr-21578e (Export)" ) \
742822   ROM_LOAD16_WORD_SWAP_BIOS( 0, "epr-21578e.bin",  0x000000, 0x200000, CRC(087f09a3) SHA1(0418eb2cf9766f0b1b874a4e92528779e22c0a4a) ) \
743   ROM_SYSTEM_BIOS( 1, "bios1", "epr-21578d" ) \
823   ROM_SYSTEM_BIOS( 1, "bios1", "epr-21578d (Export)" ) \
744824   ROM_LOAD16_WORD_SWAP_BIOS( 1, "epr-21578d.bin",  0x000000, 0x200000, CRC(dfd5f42a) SHA1(614a0db4743a5e5a206190d6786ade24325afbfd) ) \
745   ROM_SYSTEM_BIOS( 2, "bios2", "epr-21578a" ) \
825   ROM_SYSTEM_BIOS( 2, "bios2", "epr-21578a (Export)" ) \
746826   ROM_LOAD16_WORD_SWAP_BIOS( 2, "epr-21578a.bin",  0x000000, 0x200000, CRC(6c9aad83) SHA1(555918de76d8dbee2a97d8a95297ef694b3e803f) ) \
747   ROM_SYSTEM_BIOS( 3, "bios3", "epr-21577e" ) \
827   ROM_SYSTEM_BIOS( 3, "bios3", "epr-21577e (USA)" ) \
748828   ROM_LOAD16_WORD_SWAP_BIOS( 3, "epr-21577e.bin",  0x000000, 0x200000, CRC(cf36e97b) SHA1(b085305982e7572e58b03a9d35f17ae319c3bbc6) ) \
749   ROM_SYSTEM_BIOS( 4, "bios4", "epr-21577d" ) \
829   ROM_SYSTEM_BIOS( 4, "bios4", "epr-21577d (USA)" ) \
750830   ROM_LOAD16_WORD_SWAP_BIOS( 4, "epr-21577d.bin",  0x000000, 0x200000, CRC(60ddcbbe) SHA1(58b15096d269d6df617ca1810b66b47deb184958) ) \
751   ROM_SYSTEM_BIOS( 5, "bios5", "epr-21576g" ) \
831   ROM_SYSTEM_BIOS( 5, "bios5", "epr-21576g (Japan)" ) \
752832   ROM_LOAD16_WORD_SWAP_BIOS( 5, "epr-21576g.bin",  0x000000, 0x200000, CRC(d2a1c6bf) SHA1(6d27d71aec4dfba98f66316ae74a1426d567698a) ) \
753   ROM_SYSTEM_BIOS( 6, "bios6", "epr-22851" ) \
833   ROM_SYSTEM_BIOS( 6, "bios6", "Ferrari F355" ) \
754834   ROM_LOAD16_WORD_SWAP_BIOS( 6, "epr-22851.bin",   0x000000, 0x200000, CRC(62483677) SHA1(3e3bcacf5f972c376b569f45307ee7fd0b5031b7) ) \
755   ROM_SYSTEM_BIOS( 7, "bios7", "Naomi Dev BIOS" ) \
756   ROM_LOAD16_WORD_SWAP_BIOS( 7, "dcnaodev.bios",   0x000000, 0x080000, CRC(7a50fab9) SHA1(ef79f448e0bf735d1264ad4f051d24178822110f) ) /* This one comes from a dev / beta board. The eprom was a 27C4096 */
835   ROM_SYSTEM_BIOS( 7, "bios7", "HOTD2 (US)" ) \
836   ROM_LOAD16_WORD_SWAP_BIOS( 7, "epr-21330.bin",   0x000000, 0x200000, CRC(9e3bfa1b) SHA1(b539d38c767b0551b8e7956c1ff795de8bbe2fbc) ) \
837   ROM_SYSTEM_BIOS( 8, "bios8", "HOTD2 (Export)" ) \
838   ROM_LOAD16_WORD_SWAP_BIOS( 8, "epr-21331.bin",   0x000000, 0x200000, CRC(065f8500) SHA1(49a3881e8d76f952ef5e887200d77b4a415d47fe) ) \
839   ROM_SYSTEM_BIOS( 9, "bios9", "Naomi Dev BIOS" ) \
840   ROM_LOAD16_WORD_SWAP_BIOS( 9, "dcnaodev.bios",   0x000000, 0x080000, CRC(7a50fab9) SHA1(ef79f448e0bf735d1264ad4f051d24178822110f) ) /* This one comes from a dev / beta board. The eprom was a 27C4096 */
757841
758842
759843/* NAOMI2 BIOS:
r1679r1680
7698530x1ecf40 is a second region byte (value is the same as the first region byte )
7708540x1fffa-1ffff is the BIOS rom checksum
771855
772EPR-23605  - Japan  (region = 0x00)
773EPR-23605b - Japan  (region = 0x00)
774EPR-23607  - USA    (region = 0x01)
775EPR-23607b - USA    (region = 0x01)
776EPR-23608b - Export (region = 0x02)
777EPR-23608  - Export (region = 0x02)
856EPR-23605 & EPR-23605b - Japan  (region = 0x00)
857EPR-23607 & EPR-23607b - USA    (region = 0x01)
858EPR-23608 & EPR-23608b - Export (region = 0x02)
778859
779860*/
780861
src/mame/drivers/magmax.c
r1679r1680
1717VIDEO_UPDATE( magmax );
1818VIDEO_START( magmax );
1919
20extern UINT16 magmax_vreg;
20extern UINT16 *magmax_vreg;
2121extern UINT16 *magmax_scroll_x;
2222extern UINT16 *magmax_scroll_y;
2323
r1679r1680
6969   scanline += 128;
7070   scanline &= 255;
7171
72   timer_adjust(interrupt_timer, video_screen_get_time_until_pos(0, scanline, 0), scanline, attotime_zero);
72   timer_adjust_oneshot(interrupt_timer, video_screen_get_time_until_pos(0, scanline, 0), scanline);
7373}
7474
7575static MACHINE_START( magmax )
r1679r1680
8686
8787static MACHINE_RESET( magmax )
8888{
89   timer_adjust(interrupt_timer, video_screen_get_time_until_pos(0, 64, 0), 64, attotime_zero);
89   timer_adjust_oneshot(interrupt_timer, video_screen_get_time_until_pos(0, 64, 0), 64);
9090
9191#if 0
9292   {
r1679r1680
187187   /* bit4 - sprite bank LSB (DP0) */
188188   /* bit5 - sprite bank MSB (DP1) */
189189   /* bit6 - BG display enable (BE)*/
190   COMBINE_DATA(&magmax_vreg);
190   COMBINE_DATA(magmax_vreg);
191191}
192192
193193
r1679r1680
208208   AM_RANGE(0x018000, 0x018fff) AM_WRITE(MWA16_RAM)
209209   AM_RANGE(0x020000, 0x0207ff) AM_WRITE(MWA16_RAM) AM_BASE(&videoram16) AM_SIZE(&videoram_size)
210210   AM_RANGE(0x028000, 0x0281ff) AM_WRITE(MWA16_RAM) AM_BASE(&spriteram16) AM_SIZE(&spriteram_size)
211   AM_RANGE(0x030010, 0x030011) AM_WRITE(magmax_vreg_w)
211   AM_RANGE(0x030010, 0x030011) AM_WRITE(magmax_vreg_w) AM_BASE(&magmax_vreg)
212212   AM_RANGE(0x030012, 0x030013) AM_WRITE(MWA16_RAM) AM_BASE(&magmax_scroll_x)
213213   AM_RANGE(0x030014, 0x030015) AM_WRITE(MWA16_RAM) AM_BASE(&magmax_scroll_y)
214214   AM_RANGE(0x03001c, 0x03001d) AM_WRITE(magmax_sound_w)
r1679r1680
363363static MACHINE_DRIVER_START( magmax )
364364
365365   /* basic machine hardware */
366   MDRV_CPU_ADD(M68000, 8000000)   /* 8 MHz */
366   MDRV_CPU_ADD(M68000, XTAL_16MHz/2)   /* verified on pcb */
367367   MDRV_CPU_PROGRAM_MAP(magmax_readmem,magmax_writemem)
368368   MDRV_CPU_VBLANK_INT(irq1_line_hold,1)
369369
370   MDRV_CPU_ADD(Z80,10000000/4)
371   /* audio CPU */   /* 2.5 MHz */
370   MDRV_CPU_ADD(Z80,XTAL_20MHz/8) /* verified on pcb */
371   /* audio CPU */
372372   MDRV_CPU_PROGRAM_MAP(magmax_soundreadmem,magmax_soundwritemem)
373373   MDRV_CPU_IO_MAP(magmax_soundreadport,magmax_soundwriteport)
374374
r1679r1680
384384   MDRV_SCREEN_SIZE(32*8, 32*8)
385385   MDRV_SCREEN_VISIBLE_AREA(0*8, 32*8-1, 2*8, 30*8-1)
386386   MDRV_GFXDECODE(magmax)
387   MDRV_PALETTE_LENGTH(256)
388   MDRV_COLORTABLE_LENGTH(1*16 + 16*16)
387   MDRV_PALETTE_LENGTH(1*16 + 16*16 + 256)
389388
390389   MDRV_PALETTE_INIT(magmax)
391390   MDRV_VIDEO_START(magmax)
r1679r1680
394393   /* sound hardware */
395394   MDRV_SPEAKER_STANDARD_MONO("mono")
396395
397   MDRV_SOUND_ADD(AY8910, 10000000/8)
396   MDRV_SOUND_ADD(AY8910, XTAL_20MHz/16) /* verified on pcb */
398397   MDRV_SOUND_CONFIG(ay8910_interface)
399398   MDRV_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.40)
400399
401   MDRV_SOUND_ADD(AY8910, 10000000/8)
400   MDRV_SOUND_ADD(AY8910, XTAL_20MHz/16) /* verified on pcb */
402401   MDRV_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.40)
403402
404   MDRV_SOUND_ADD(AY8910, 10000000/8)
403   MDRV_SOUND_ADD(AY8910, XTAL_20MHz/16) /* verified on pcb */
405404   MDRV_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.40)
406405MACHINE_DRIVER_END
407406
408407
409408ROM_START( magmax )
410   ROM_REGION( 0x14000, REGION_CPU1, 0 ) /* 68000 (main) cpu code */
409   ROM_REGION( 0x14000, REGION_CPU1, 0 )
411410   ROM_LOAD16_BYTE( "1.3b", 0x00001, 0x4000, CRC(33793cbb) SHA1(a0bc0e4be434d9fc8115de8d63c92e942334bc85) )
412411   ROM_LOAD16_BYTE( "6.3d", 0x00000, 0x4000, CRC(677ef450) SHA1(9003ff1c1c455970c1bd036b0b5e44dae2e379a5) )
413412   ROM_LOAD16_BYTE( "2.5b", 0x08001, 0x4000, CRC(1a0c84df) SHA1(77ff21de33392a148d7ca69a77acc654260af0db) )
r1679r1680
415414   ROM_LOAD16_BYTE( "3.6b", 0x10001, 0x2000, CRC(d06e6cae) SHA1(94047b2bcf030d34295ff8107f95097ce57efe6b) )
416415   ROM_LOAD16_BYTE( "8.6d", 0x10000, 0x2000, CRC(790a82be) SHA1(9a25d5a7c87aeef5e736b0f2fb8dde1c9be70039) )
417416
418   ROM_REGION( 0x10000, REGION_CPU2, 0 ) /* Z80 (sound) cpu code */
417   ROM_REGION( 0x10000, REGION_CPU2, 0 )
419418   ROM_LOAD( "15.17b", 0x00000, 0x2000, CRC(19e7b983) SHA1(b1cd0b728e7cce87d9b1039be179d0915d939a4f) )
420419   ROM_LOAD( "16.18b", 0x02000, 0x2000, CRC(055e3126) SHA1(8c9b03eb7588512ef17f8c1b731a2fd7cf372bf8) )
421420
src/mame/drivers/powerbal.c
r1679r1680
364364
365365static VIDEO_START( powerbal )
366366{
367   bg_tilemap = tilemap_create(powerbal_get_bg_tile_info,tilemap_scan_rows,TILEMAP_TYPE_PEN, 8, 8,64,32);
367   bg_tilemap = tilemap_create(powerbal_get_bg_tile_info,tilemap_scan_rows,8, 8,64,32);
368368
369369   xoffset = -20;
370370
src/mame/drivers/stv.c
r1679r1680
22092209   PORT_START
22102210   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_COIN1 )
22112211   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_COIN2 )
2212   PORT_BIT(0x04, IP_ACTIVE_LOW, IPT_SERVICE ) PORT_NAME(DEF_STR( Test )) PORT_CODE(KEYCODE_F2)
2212   PORT_SERVICE_NO_TOGGLE( 0x04, IP_ACTIVE_LOW )
22132213   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_SERVICE1 )
22142214   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_START1 )
22152215   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_START2 )
2216   PORT_BIT(0x40, IP_ACTIVE_LOW, IPT_SERVICE ) PORT_NAME("1P Push Switch") PORT_CODE(KEYCODE_7)
2217   PORT_BIT(0x80, IP_ACTIVE_LOW, IPT_SERVICE ) PORT_NAME("2P Push Switch") PORT_CODE(KEYCODE_8)
2216   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_SERVICE ) PORT_NAME("1P Push Switch") PORT_CODE(KEYCODE_7)
2217   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_SERVICE ) PORT_NAME("2P Push Switch") PORT_CODE(KEYCODE_8)
22182218
22192219   /*This *might* be unused...*/
22202220   PORT_START
r1679r1680
22452245   PORT_DIPSETTING(    0x0d, "Sud America Pal" )
22462246
22472247   PORT_START   /* Pad data 1a */
2248   PORT_BIT(0x01, IP_ACTIVE_HIGH, IPT_OTHER ) PORT_NAME("B") PORT_CODE(KEYCODE_U)
2249   PORT_BIT(0x02, IP_ACTIVE_HIGH, IPT_OTHER ) PORT_NAME("C") PORT_CODE(KEYCODE_Y)
2250   PORT_BIT(0x04, IP_ACTIVE_HIGH, IPT_OTHER ) PORT_NAME("A") PORT_CODE(KEYCODE_T)
2251   PORT_BIT(0x08, IP_ACTIVE_HIGH, IPT_OTHER ) PORT_NAME("Start") PORT_CODE(KEYCODE_O)
2252   PORT_BIT(0x10, IP_ACTIVE_HIGH, IPT_OTHER ) PORT_NAME("Up") PORT_CODE(KEYCODE_I)
2253   PORT_BIT(0x20, IP_ACTIVE_HIGH, IPT_OTHER ) PORT_NAME("Down") PORT_CODE(KEYCODE_K)
2254   PORT_BIT(0x40, IP_ACTIVE_HIGH, IPT_OTHER ) PORT_NAME("Left") PORT_CODE(KEYCODE_J)
2255   PORT_BIT(0x80, IP_ACTIVE_HIGH, IPT_OTHER ) PORT_NAME("Right") PORT_CODE(KEYCODE_L)
2248   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_OTHER ) PORT_NAME("B") PORT_CODE(KEYCODE_U)
2249   PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_OTHER ) PORT_NAME("C") PORT_CODE(KEYCODE_Y)
2250   PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_OTHER ) PORT_NAME("A") PORT_CODE(KEYCODE_T)
2251   PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_OTHER ) PORT_NAME("Start") PORT_CODE(KEYCODE_O)
2252   PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_OTHER ) PORT_NAME("Up") PORT_CODE(KEYCODE_I)
2253   PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_OTHER ) PORT_NAME("Down") PORT_CODE(KEYCODE_K)
2254   PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_OTHER ) PORT_NAME("Left") PORT_CODE(KEYCODE_J)
2255   PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_OTHER ) PORT_NAME("Right") PORT_CODE(KEYCODE_L)
22562256
22572257   PORT_START   /* Pad data 1b */
2258   PORT_BIT(0x08, IP_ACTIVE_HIGH, IPT_OTHER ) PORT_NAME("L trig") PORT_CODE(KEYCODE_A)
2259   PORT_BIT(0x10, IP_ACTIVE_HIGH, IPT_OTHER ) PORT_NAME("Z") PORT_CODE(KEYCODE_Q)
2260   PORT_BIT(0x20, IP_ACTIVE_HIGH, IPT_OTHER ) PORT_NAME("Y") PORT_CODE(KEYCODE_W)
2261   PORT_BIT(0x40, IP_ACTIVE_HIGH, IPT_OTHER ) PORT_NAME("X") PORT_CODE(KEYCODE_E)
2262   PORT_BIT(0x80, IP_ACTIVE_HIGH, IPT_OTHER ) PORT_NAME("R trig") PORT_CODE(KEYCODE_S)
2258   PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_OTHER ) PORT_NAME("L trig") PORT_CODE(KEYCODE_A)
2259   PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_OTHER ) PORT_NAME("Z") PORT_CODE(KEYCODE_Q)
2260   PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_OTHER ) PORT_NAME("Y") PORT_CODE(KEYCODE_W)
2261   PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_OTHER ) PORT_NAME("X") PORT_CODE(KEYCODE_E)
2262   PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_OTHER ) PORT_NAME("R trig") PORT_CODE(KEYCODE_S)
22632263   #endif
22642264INPUT_PORTS_END
22652265
r1679r1680
23472347   PORT_START
23482348   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_COIN1 )
23492349   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_COIN2 )
2350   PORT_BIT(0x04, IP_ACTIVE_LOW, IPT_SERVICE ) PORT_NAME(DEF_STR( Test )) PORT_CODE(KEYCODE_F2)
2350   PORT_SERVICE_NO_TOGGLE( 0x04, IP_ACTIVE_LOW )
23512351   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_SERVICE1 )
23522352   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_START1 )
23532353   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_START2 )
2354   PORT_BIT(0x40, IP_ACTIVE_LOW, IPT_SERVICE ) PORT_NAME("1P Push Switch") PORT_CODE(KEYCODE_7)
2355   PORT_BIT(0x80, IP_ACTIVE_LOW, IPT_SERVICE ) PORT_NAME("2P Push Switch") PORT_CODE(KEYCODE_8)
2354   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_SERVICE ) PORT_NAME("1P Push Switch") PORT_CODE(KEYCODE_7)
2355   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_SERVICE ) PORT_NAME("2P Push Switch") PORT_CODE(KEYCODE_8)
23562356
23572357   /*This *might* be unused...*/
23582358   PORT_START
r1679r1680
23732373   PORT_START/*7*/
23742374   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_MAHJONG_KAN )
23752375   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_START1 )
2376   PORT_BIT ( 0x04, IP_ACTIVE_LOW, IPT_UNUSED )
2377   PORT_BIT ( 0x08, IP_ACTIVE_LOW, IPT_UNUSED )
2376   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_UNUSED )
2377   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_UNUSED )
23782378   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_MAHJONG_E )
23792379   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_MAHJONG_A )
23802380   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_MAHJONG_M )
r1679r1680
23822382
23832383   PORT_START/*8*/
23842384   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_MAHJONG_RON )
2385   PORT_BIT ( 0x02, IP_ACTIVE_LOW, IPT_UNUSED )
2386   PORT_BIT ( 0x04, IP_ACTIVE_LOW, IPT_UNUSED )
2387   PORT_BIT ( 0x08, IP_ACTIVE_LOW, IPT_UNUSED )
2385   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_UNUSED )
2386   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_UNUSED )
2387   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_UNUSED )
23882388   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_MAHJONG_F )
23892389   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_MAHJONG_B )
23902390   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_MAHJONG_N )
r1679r1680
23922392
23932393   PORT_START/*9*/
23942394   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_MAHJONG_REACH )
2395   PORT_BIT ( 0x02, IP_ACTIVE_LOW, IPT_UNUSED )
2396   PORT_BIT ( 0x04, IP_ACTIVE_LOW, IPT_UNUSED )
2397   PORT_BIT ( 0x08, IP_ACTIVE_LOW, IPT_UNUSED )
2395   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_UNUSED )
2396   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_UNUSED )
2397   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_UNUSED )
23982398   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_MAHJONG_G )
23992399   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_MAHJONG_C )
24002400   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_MAHJONG_CHI )
24012401   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_MAHJONG_K )
24022402
24032403   PORT_START/*10*/
2404   PORT_BIT ( 0x01, IP_ACTIVE_LOW, IPT_UNUSED )
2405   PORT_BIT ( 0x02, IP_ACTIVE_LOW, IPT_UNUSED )
2406   PORT_BIT ( 0x04, IP_ACTIVE_LOW, IPT_UNUSED )
2407   PORT_BIT ( 0x08, IP_ACTIVE_LOW, IPT_UNUSED )
2404   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_UNUSED )
2405   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_UNUSED )
2406   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_UNUSED )
2407   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_UNUSED )
24082408   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_MAHJONG_H )
24092409   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_MAHJONG_D )
24102410   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_MAHJONG_PON )
24112411   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_MAHJONG_L )
24122412
24132413   PORT_START/*11*/
2414   PORT_BIT ( 0x01, IP_ACTIVE_LOW, IPT_UNUSED )
2415   PORT_BIT ( 0x02, IP_ACTIVE_LOW, IPT_UNUSED )
2416   PORT_BIT ( 0x04, IP_ACTIVE_LOW, IPT_UNUSED )
2417   PORT_BIT ( 0x08, IP_ACTIVE_LOW, IPT_UNUSED )
2418   PORT_BIT ( 0x10, IP_ACTIVE_LOW, IPT_UNUSED )
2419   PORT_BIT ( 0x20, IP_ACTIVE_LOW, IPT_UNUSED )
2414   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_UNUSED )
2415   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_UNUSED )
2416   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_UNUSED )
2417   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_UNUSED )
2418   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_UNUSED )
2419   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_UNUSED )
24202420   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_MAHJONG_FLIP_FLOP )
2421   PORT_BIT ( 0x80, IP_ACTIVE_LOW, IPT_UNUSED )
2421   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNUSED )
24222422
24232423   /*Mahjong panel/player 2 side*/
24242424   PORT_START/*12*/
24252425   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_MAHJONG_KAN ) PORT_PLAYER(2)
24262426   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_START2 )
2427   PORT_BIT ( 0x04, IP_ACTIVE_LOW, IPT_UNUSED )
2428   PORT_BIT ( 0x08, IP_ACTIVE_LOW, IPT_UNUSED )
2427   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_UNUSED )
2428   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_UNUSED )
24292429   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_MAHJONG_E ) PORT_PLAYER(2)
24302430   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_MAHJONG_A ) PORT_PLAYER(2)
24312431   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_MAHJONG_M ) PORT_PLAYER(2)
r1679r1680
24332433
24342434   PORT_START/*13*/
24352435   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_MAHJONG_RON ) PORT_PLAYER(2)
2436   PORT_BIT ( 0x02, IP_ACTIVE_LOW, IPT_UNUSED )
2437   PORT_BIT ( 0x04, IP_ACTIVE_LOW, IPT_UNUSED )
2438   PORT_BIT ( 0x08, IP_ACTIVE_LOW, IPT_UNUSED )
2436   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_UNUSED )
2437   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_UNUSED )
2438   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_UNUSED )
24392439   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_MAHJONG_F ) PORT_PLAYER(2)
24402440   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_MAHJONG_B ) PORT_PLAYER(2)
24412441   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_MAHJONG_N ) PORT_PLAYER(2)
r1679r1680
24432443
24442444   PORT_START/*14*/
24452445   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_MAHJONG_REACH ) PORT_PLAYER(2)
2446   PORT_BIT ( 0x02, IP_ACTIVE_LOW, IPT_UNUSED )
2447   PORT_BIT ( 0x04, IP_ACTIVE_LOW, IPT_UNUSED )
2448   PORT_BIT ( 0x08, IP_ACTIVE_LOW, IPT_UNUSED )
2446   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_UNUSED )
2447   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_UNUSED )
2448   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_UNUSED )
24492449   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_MAHJONG_G ) PORT_PLAYER(2)
24502450   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_MAHJONG_C ) PORT_PLAYER(2)
24512451   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_MAHJONG_CHI ) PORT_PLAYER(2)
24522452   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_MAHJONG_K ) PORT_PLAYER(2)
24532453
24542454   PORT_START/*15*/
2455   PORT_BIT ( 0x01, IP_ACTIVE_LOW, IPT_UNUSED )
2456   PORT_BIT ( 0x02, IP_ACTIVE_LOW, IPT_UNUSED )
2457   PORT_BIT ( 0x04, IP_ACTIVE_LOW, IPT_UNUSED )
2458   PORT_BIT ( 0x08, IP_ACTIVE_LOW, IPT_UNUSED )
2455   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_UNUSED )
2456   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_UNUSED )
2457   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_UNUSED )
2458   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_UNUSED )
24592459   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_MAHJONG_H ) PORT_PLAYER(2)
24602460   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_MAHJONG_D ) PORT_PLAYER(2)
24612461   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_MAHJONG_PON ) PORT_PLAYER(2)
24622462   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_MAHJONG_L ) PORT_PLAYER(2)
24632463
24642464   PORT_START/*16*/
2465   PORT_BIT ( 0x01, IP_ACTIVE_LOW, IPT_UNUSED )
2466   PORT_BIT ( 0x02, IP_ACTIVE_LOW, IPT_UNUSED )
2467   PORT_BIT ( 0x04, IP_ACTIVE_LOW, IPT_UNUSED )
2468   PORT_BIT ( 0x08, IP_ACTIVE_LOW, IPT_UNUSED )
2469   PORT_BIT ( 0x10, IP_ACTIVE_LOW, IPT_UNUSED )
2470   PORT_BIT ( 0x20, IP_ACTIVE_LOW, IPT_UNUSED )
2465   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_UNUSED )
2466   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_UNUSED )
2467   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_UNUSED )
2468   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_UNUSED )
2469   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_UNUSED )
2470   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_UNUSED )
24712471   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_MAHJONG_FLIP_FLOP ) PORT_PLAYER(2)
2472   PORT_BIT ( 0x80, IP_ACTIVE_LOW, IPT_UNUSED )
2472   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNUSED )
24732473INPUT_PORTS_END
24742474
24752475static WRITE32_HANDLER ( w60ffc44_write )
src/mame/drivers/megatech.c
r1679r1680
129129    PORT_DIPNAME( 0x0040, 0x0040, DEF_STR( Unknown ) )
130130    PORT_DIPSETTING(      0x0040, DEF_STR( Off ) )
131131    PORT_DIPSETTING(      0x0000, DEF_STR( On ) )
132   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_SERVICE ) PORT_NAME("Test mode") PORT_CODE(KEYCODE_F2)
132   PORT_SERVICE_NO_TOGGLE( 0x80, IP_ACTIVE_LOW )
133133
134134   PORT_START_TAG("BIOS_IN1") // port 6
135135   PORT_BIT(  0x01, IP_ACTIVE_LOW, IPT_COIN1 )  // a few coin inputs here
src/mame/drivers/talbot.c
r1679r1680
155155
156156static VIDEO_START( talbot )
157157{
158   bg_tilemap = tilemap_create(get_tile_info_bg, tilemap_scan_rows, TILEMAP_TYPE_PEN, 8, 8, 32, 32);
158   bg_tilemap = tilemap_create(get_tile_info_bg, tilemap_scan_rows, 8, 8, 32, 32);
159159}
160160
161161static void draw_sprites(running_machine *machine, mame_bitmap *bitmap, const rectangle *cliprect)
src/mame/drivers/bloodbro.c
r1679r1680
526526
527527static MACHINE_DRIVER_START( bloodbro )
528528   // basic machine hardware
529   MDRV_CPU_ADD_TAG("main", M68000, 10000000) // 10 MHz
529   MDRV_CPU_ADD_TAG("main", M68000, XTAL_20MHz/2) /* verified on pcb */
530530   MDRV_CPU_PROGRAM_MAP(bloodbro_map, 0)
531531   MDRV_CPU_VBLANK_INT(irq4_line_hold, 1)
532532
533   SEIBU_SOUND_SYSTEM_CPU(14318180/4)
533   SEIBU_SOUND_SYSTEM_CPU(XTAL_7_15909MHz/2) /* verified on pcb */
534534
535535   MDRV_SCREEN_REFRESH_RATE(60)
536536   MDRV_SCREEN_VBLANK_TIME(DEFAULT_REAL_60HZ_VBLANK_DURATION)
r1679r1680
549549   MDRV_VIDEO_UPDATE(bloodbro)
550550
551551   // sound hardware
552   SEIBU_SOUND_SYSTEM_YM3812_INTERFACE(14318180/4, 1320000, 1)
552   SEIBU_SOUND_SYSTEM_YM3812_RAIDEN_INTERFACE(XTAL_7_15909MHz/2, XTAL_12MHz/12, 1)
553553MACHINE_DRIVER_END
554554
555555static MACHINE_DRIVER_START( weststry )
src/mame/drivers/alg.c
r1679r1680
178178
179179   /* if there's more to come, set another timer */
180180   if (laserdisc_line_r(discinfo, LASERDISC_LINE_DATA_AVAIL) == ASSERT_LINE)
181      timer_adjust(serial_timer, amiga_get_serial_char_period(), 0, attotime_zero);
181      timer_adjust_oneshot(serial_timer, amiga_get_serial_char_period(), 0);
182182   else
183183      serial_timer_active = FALSE;
184184}
r1679r1680
192192   /* if we have data available, set a timer to read it */
193193   if (!serial_timer_active && laserdisc_line_r(discinfo, LASERDISC_LINE_DATA_AVAIL) == ASSERT_LINE)
194194   {
195      timer_adjust(serial_timer, amiga_get_serial_char_period(), 0, attotime_zero);
195      timer_adjust_oneshot(serial_timer, amiga_get_serial_char_period(), 0);
196196      serial_timer_active = TRUE;
197197   }
198198}
r1679r1680
206206   /* if we have data available, set a timer to read it */
207207   if (!serial_timer_active && laserdisc_line_r(discinfo, LASERDISC_LINE_DATA_AVAIL) == ASSERT_LINE)
208208   {
209      timer_adjust(serial_timer, amiga_get_serial_char_period(), 0, attotime_zero);
209      timer_adjust_oneshot(serial_timer, amiga_get_serial_char_period(), 0);
210210      serial_timer_active = TRUE;
211211   }
212212}
r1679r1680
384384   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNUSED )
385385
386386   PORT_START_TAG("P1JOY")      /* referenced by JOY0DAT */
387   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_SERVICE ) PORT_NAME( DEF_STR( Service_Mode )) PORT_CODE(KEYCODE_F2)
387   PORT_SERVICE_NO_TOGGLE( 0x01, IP_ACTIVE_HIGH )
388388   PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_START1 )
389389   PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_COIN1 )
390390   PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_COIN2 )
src/mame/drivers/rallyx.c
r1679r1680
192192WRITE8_HANDLER( rallyx_scrolly_w );
193193WRITE8_HANDLER( tactcian_starson_w );
194194PALETTE_INIT( rallyx );
195PALETTE_INIT( jungler );
195196VIDEO_START( rallyx );
197VIDEO_START( jungler );
198VIDEO_START( locomotn );
199VIDEO_START( commsega );
196200VIDEO_UPDATE( rallyx );
197DRIVER_INIT( rallyx );
198DRIVER_INIT( jungler );
199DRIVER_INIT( tactcian );
200DRIVER_INIT( locomotn );
201DRIVER_INIT( commsega );
201VIDEO_UPDATE( jungler );
202VIDEO_UPDATE( locomotn );
202203
203204
204205static WRITE8_HANDLER( rallyx_interrupt_vector_w )
r1679r1680
327328ADDRESS_MAP_END
328329
329330
330static ADDRESS_MAP_START( locomotn_map, ADDRESS_SPACE_PROGRAM, 8 )
331static ADDRESS_MAP_START( jungler_map, ADDRESS_SPACE_PROGRAM, 8 )
331332   AM_RANGE(0x0000, 0x7fff) AM_ROM
332333   AM_RANGE(0x8000, 0x8fff) AM_READWRITE(MRA8_RAM, rallyx_videoram_w) AM_BASE(&rallyx_videoram)
333334   AM_RANGE(0x9800, 0x9fff) AM_RAM
r1679r1680
850851   MDRV_SCREEN_SIZE(36*8, 32*8)
851852   MDRV_SCREEN_VISIBLE_AREA(0*8, 36*8-1, 2*8, 30*8-1)
852853   MDRV_GFXDECODE(rallyx)
853   MDRV_PALETTE_LENGTH(32)
854   MDRV_COLORTABLE_LENGTH(64*4+4)
854   MDRV_PALETTE_LENGTH(64*4+4)
855855
856856   MDRV_PALETTE_INIT(rallyx)
857857   MDRV_VIDEO_START(rallyx)
r1679r1680
870870MACHINE_DRIVER_END
871871
872872
873static MACHINE_DRIVER_START( tactcian )
873static MACHINE_DRIVER_START( jungler )
874874
875875   /* basic machine hardware */
876876   MDRV_CPU_ADD(Z80, 18432000/6)   /* 3.072 MHz */
877   MDRV_CPU_PROGRAM_MAP(locomotn_map,0)
877   MDRV_CPU_PROGRAM_MAP(jungler_map,0)
878878   MDRV_CPU_VBLANK_INT(nmi_line_pulse,1)
879879
880880   MDRV_SCREEN_REFRESH_RATE(60)
r1679r1680
886886   MDRV_SCREEN_SIZE(36*8, 32*8)
887887   MDRV_SCREEN_VISIBLE_AREA(0*8, 36*8-1, 2*8, 30*8-1)
888888   MDRV_GFXDECODE(jungler)
889   MDRV_PALETTE_LENGTH(32+64)
890   MDRV_COLORTABLE_LENGTH(64*4+4)
889   MDRV_PALETTE_LENGTH(64*4+4+64)
891890
892   MDRV_PALETTE_INIT(rallyx)
893   MDRV_VIDEO_START(rallyx)
894   MDRV_VIDEO_UPDATE(rallyx)
891   MDRV_PALETTE_INIT(jungler)
892   MDRV_VIDEO_START(jungler)
893   MDRV_VIDEO_UPDATE(jungler)
895894
896895   /* sound hardware */
897896   MDRV_IMPORT_FROM(locomotn_sound)
898897MACHINE_DRIVER_END
899898
900899
900static MACHINE_DRIVER_START( tactcian )
901
902   /* basic machine hardware */
903   MDRV_IMPORT_FROM(jungler)
904
905   /* video hardware */
906   MDRV_VIDEO_START(locomotn)
907   MDRV_VIDEO_UPDATE(locomotn)
908MACHINE_DRIVER_END
909
910
901911static MACHINE_DRIVER_START( locomotn )
902912
903913   /* basic machine hardware */
904   MDRV_IMPORT_FROM(tactcian)
914   MDRV_IMPORT_FROM(jungler)
905915
906916   /* video hardware */
907917   MDRV_SCREEN_VISIBLE_AREA(0*8, 32*8-1, 2*8, 30*8-1)
918   MDRV_VIDEO_START(locomotn)
919   MDRV_VIDEO_UPDATE(locomotn)
908920MACHINE_DRIVER_END
909921
910922
923static MACHINE_DRIVER_START( commsega )
911924
925   /* basic machine hardware */
926   MDRV_IMPORT_FROM(jungler)
927
928   /* video hardware */
929   MDRV_SCREEN_VISIBLE_AREA(0*8, 32*8-1, 2*8, 30*8-1)
930   MDRV_VIDEO_START(commsega)
931   MDRV_VIDEO_UPDATE(locomotn)
932MACHINE_DRIVER_END
933
934
935
912936/***************************************************************************
913937
914938  Game driver(s)
r1679r1680
11931217
11941218
11951219
1196GAME( 1980, rallyx,   0,        rallyx,   rallyx,   rallyx,   ROT0, "Namco", "Rally X", 0 )
1197GAME( 1980, rallyxm,  rallyx,   rallyx,   rallyx,   rallyx,   ROT0, "[Namco] (Midway license)", "Rally X (Midway)", 0 )
1198GAME( 1981, nrallyx,  0,        rallyx,   nrallyx,  rallyx,   ROT0, "Namco", "New Rally X", 0 )
1199
1200GAME( 1981, jungler,  0,        tactcian, jungler,  jungler,  ROT90, "Konami", "Jungler", 0 )
1201GAME( 1981, junglers, jungler,  tactcian, jungler,  jungler,  ROT90, "[Konami] (Stern license)", "Jungler (Stern)", 0 )
1202GAME( 1982, tactcian, 0,        tactcian, tactcian, tactcian, ROT90, "[Konami] (Sega license)", "Tactician (set 1)", 0 )
1203GAME( 1981, tactcan2, tactcian, tactcian, tactcian, tactcian, ROT90, "[Konami] (Sega license)", "Tactician (set 2)", 0 )
1204GAME( 1982, locomotn, 0,        locomotn, locomotn, locomotn, ROT90, "Konami (Centuri license)", "Loco-Motion", 0 )
1205GAME( 1982, gutangtn, locomotn, locomotn, locomotn, locomotn, ROT90, "Konami (Sega license)", "Guttang Gottong", 0 )
1206GAME( 1982, cottong,  locomotn, locomotn, locomotn, locomotn, ROT90, "bootleg", "Cotocoto Cottong", 0 )
1207GAME( 1983, commsega, 0,        locomotn, commsega, commsega, ROT90, "Sega", "Commando (Sega)", GAME_IMPERFECT_SOUND )
1220GAME( 1980, rallyx,   0,        rallyx,   rallyx,   0, ROT0,  "Namco", "Rally X", 0 )
1221GAME( 1980, rallyxm,  rallyx,   rallyx,   rallyx,   0, ROT0,  "[Namco] (Midway license)", "Rally X (Midway)", 0 )
1222GAME( 1981, nrallyx,  0,        rallyx,   nrallyx,  0, ROT0,  "Namco", "New Rally X", 0 )
1223GAME( 1981, jungler,  0,        jungler,  jungler,  0, ROT90, "Konami", "Jungler", 0 )
1224GAME( 1981, junglers, jungler,  jungler,  jungler,  0, ROT90, "[Konami] (Stern license)", "Jungler (Stern)", 0 )
1225GAME( 1982, tactcian, 0,        tactcian, tactcian, 0, ROT90, "[Konami] (Sega license)", "Tactician (set 1)", 0 )
1226GAME( 1981, tactcan2, tactcian, tactcian, tactcian, 0, ROT90, "[Konami] (Sega license)", "Tactician (set 2)", 0 )
1227GAME( 1982, locomotn, 0,        locomotn, locomotn, 0, ROT90, "Konami (Centuri license)", "Loco-Motion", 0 )
1228GAME( 1982, gutangtn, locomotn, locomotn, locomotn, 0, ROT90, "Konami (Sega license)", "Guttang Gottong", 0 )
1229GAME( 1982, cottong,  locomotn, locomotn, locomotn, 0, ROT90, "bootleg", "Cotocoto Cottong", 0 )
1230GAME( 1983, commsega, 0,        commsega, commsega, 0, ROT90, "Sega", "Commando (Sega)", GAME_IMPERFECT_SOUND )
src/mame/drivers/bnstars.c
r1679r1680
467467
468468static VIDEO_START(bnstars)
469469{
470   ms32_tx_tilemap[0] = tilemap_create(get_ms32_tx0_tile_info,tilemap_scan_rows,TILEMAP_TYPE_PEN, 8, 8,64,64);
471   ms32_tx_tilemap[1] = tilemap_create(get_ms32_tx1_tile_info,tilemap_scan_rows,TILEMAP_TYPE_PEN, 8, 8,64,64);
470   ms32_tx_tilemap[0] = tilemap_create(get_ms32_tx0_tile_info,tilemap_scan_rows, 8, 8,64,64);
471   ms32_tx_tilemap[1] = tilemap_create(get_ms32_tx1_tile_info,tilemap_scan_rows, 8, 8,64,64);
472472   tilemap_set_transparent_pen(ms32_tx_tilemap[0],0);
473473   tilemap_set_transparent_pen(ms32_tx_tilemap[1],0);
474474
475   ms32_bg_tilemap[0] = tilemap_create(get_ms32_bg0_tile_info,tilemap_scan_rows,TILEMAP_TYPE_PEN,16,16,64,64);
476   ms32_bg_tilemap[1] = tilemap_create(get_ms32_bg1_tile_info,tilemap_scan_rows,TILEMAP_TYPE_PEN,16,16,64,64);
475   ms32_bg_tilemap[0] = tilemap_create(get_ms32_bg0_tile_info,tilemap_scan_rows,16,16,64,64);
476   ms32_bg_tilemap[1] = tilemap_create(get_ms32_bg1_tile_info,tilemap_scan_rows,16,16,64,64);
477477   tilemap_set_transparent_pen(ms32_bg_tilemap[0],0);
478478   tilemap_set_transparent_pen(ms32_bg_tilemap[1],0);
479479
480   ms32_roz_tilemap[0] = tilemap_create(get_ms32_roz0_tile_info,tilemap_scan_rows,TILEMAP_TYPE_PEN,16,16,128,128);
481   ms32_roz_tilemap[1] = tilemap_create(get_ms32_roz1_tile_info,tilemap_scan_rows,TILEMAP_TYPE_PEN,16,16,128,128);
480   ms32_roz_tilemap[0] = tilemap_create(get_ms32_roz0_tile_info,tilemap_scan_rows,16,16,128,128);
481   ms32_roz_tilemap[1] = tilemap_create(get_ms32_roz1_tile_info,tilemap_scan_rows,16,16,128,128);
482482   tilemap_set_transparent_pen(ms32_roz_tilemap[0],0);
483483   tilemap_set_transparent_pen(ms32_roz_tilemap[1],0);
484484
src/mame/drivers/vmetal.c
r1679r1680
396396
397397static VIDEO_START(varia)
398398{
399   vmetal_texttilemap = tilemap_create(get_vmetal_texttilemap_tile_info,tilemap_scan_rows,TILEMAP_TYPE_PEN,      8, 8, 256,256);
400   vmetal_mid1tilemap = tilemap_create(get_vmetal_mid1tilemap_tile_info,tilemap_scan_rows,TILEMAP_TYPE_PEN,      16,16, 256,256);
401   vmetal_mid2tilemap = tilemap_create(get_vmetal_mid2tilemap_tile_info,tilemap_scan_rows,TILEMAP_TYPE_PEN,      16,16, 256,256);
399   vmetal_texttilemap = tilemap_create(get_vmetal_texttilemap_tile_info,tilemap_scan_rows, 8, 8, 256,256);
400   vmetal_mid1tilemap = tilemap_create(get_vmetal_mid1tilemap_tile_info,tilemap_scan_rows,16,16, 256,256);
401   vmetal_mid2tilemap = tilemap_create(get_vmetal_mid2tilemap_tile_info,tilemap_scan_rows,16,16, 256,256);
402402   tilemap_set_transparent_pen(vmetal_texttilemap,0);
403403   tilemap_set_transparent_pen(vmetal_mid1tilemap,0);
404404   tilemap_set_transparent_pen(vmetal_mid2tilemap,0);
src/mame/drivers/superchs.c
r1679r1680
279279   PORT_BIT( 0x0002, IP_ACTIVE_LOW,  IPT_UNKNOWN )
280280   PORT_BIT( 0x0004, IP_ACTIVE_LOW,  IPT_UNKNOWN )
281281   PORT_BIT( 0x0008, IP_ACTIVE_HIGH, IPT_BUTTON6 ) PORT_PLAYER(1)   /* Freeze input */
282   PORT_BIT(0x0010, IP_ACTIVE_LOW, IPT_SERVICE ) PORT_NAME( DEF_STR( Service_Mode )) PORT_CODE(KEYCODE_F2)
282   PORT_SERVICE_NO_TOGGLE( 0x0010, IP_ACTIVE_LOW )
283283   PORT_BIT( 0x0020, IP_ACTIVE_LOW,  IPT_SERVICE1 )
284284   PORT_BIT( 0x0040, IP_ACTIVE_LOW,  IPT_COIN2 )
285285   PORT_BIT( 0x0080, IP_ACTIVE_LOW,  IPT_COIN1 )
src/mame/drivers/flower.c
r1679r1680
259259
260260   MDRV_PALETTE_INIT(flower)
261261   MDRV_PALETTE_LENGTH(256)
262   MDRV_COLORTABLE_LENGTH(384)
263262
264263   MDRV_VIDEO_START(flower)
265264   MDRV_VIDEO_UPDATE(flower)
src/mame/drivers/dreamwld.c
r1679r1680
143143
144144static VIDEO_START(dreamwld)
145145{
146   dreamwld_bg_tilemap = tilemap_create(get_dreamwld_bg_tile_info,tilemap_scan_rows,TILEMAP_TYPE_PEN,      16, 16, 64,32);
147   dreamwld_bg2_tilemap = tilemap_create(get_dreamwld_bg2_tile_info,tilemap_scan_rows,TILEMAP_TYPE_PEN,      16, 16, 64,32);
146   dreamwld_bg_tilemap = tilemap_create(get_dreamwld_bg_tile_info,tilemap_scan_rows, 16, 16, 64,32);
147   dreamwld_bg2_tilemap = tilemap_create(get_dreamwld_bg2_tile_info,tilemap_scan_rows, 16, 16, 64,32);
148148   tilemap_set_transparent_pen(dreamwld_bg2_tilemap,0);
149149   dreamwld_tilebankold[0] = dreamwld_tilebankold[1] = -1;
150150   dreamwld_tilebank[0] = dreamwld_tilebank[1] = 0;
src/mame/drivers/megazone.c
r1679r1680
280280};
281281
282282static GFXDECODE_START( megazone )
283   GFXDECODE_ENTRY( REGION_GFX1, 0, charlayout,       0, 16 )
284   GFXDECODE_ENTRY( REGION_GFX2, 0, spritelayout, 16*16, 16 )
283   GFXDECODE_ENTRY( REGION_GFX1, 0, spritelayout,     0, 16 )
284   GFXDECODE_ENTRY( REGION_GFX2, 0, charlayout,   16*16, 16 )
285285GFXDECODE_END
286286
287287
r1679r1680
323323   MDRV_SCREEN_SIZE(36*8, 32*8)
324324   MDRV_SCREEN_VISIBLE_AREA(0*8, 36*8-1, 2*8, 30*8-1)
325325   MDRV_GFXDECODE(megazone)
326   MDRV_PALETTE_LENGTH(32)
327   MDRV_COLORTABLE_LENGTH(16*16+16*16)
326   MDRV_PALETTE_LENGTH(16*16+16*16)
328327
329328   MDRV_PALETTE_INIT(megazone)
330329   MDRV_VIDEO_START(megazone)
r1679r1680
372371   ROM_REGION( 0x1000, REGION_CPU3, 0 )     /* 4k for the 8039 DAC CPU */
373372   ROM_LOAD( "319e01.bin",   0x0000, 0x1000, CRC(ed5725a0) SHA1(64f54621487291fbfe827fb4cecca299fd0db781) )
374373
375   ROM_REGION( 0x04000, REGION_GFX1, ROMREGION_DISPOSE )
376   ROM_LOAD( "319e12.bin",    0x0000, 0x2000, CRC(e0fb7835) SHA1(44ccaaf92bdb83323f45e08dbe118697720e9105) )
377   ROM_LOAD( "319e13.bin",    0x2000, 0x2000, CRC(3d8f3743) SHA1(1f6fbf804dacfa44cd11b4cf41d0bedb7f2ff6b6) )
378
379   ROM_REGION( 0x08000, REGION_GFX2, ROMREGION_DISPOSE )
374   ROM_REGION( 0x08000, REGION_GFX1, ROMREGION_DISPOSE )
380375   ROM_LOAD( "319e11.bin",    0x0000, 0x2000, CRC(965a7ff6) SHA1(210aae91a3838e5f7c78747d9b7419d266538ffc) )
381376   ROM_LOAD( "319e09.bin",    0x2000, 0x2000, CRC(5eaa7f3e) SHA1(4c038e80d575988407252897a1f1bc6b76af597c) )
382377   ROM_LOAD( "319e10.bin",    0x4000, 0x2000, CRC(7bb1aeee) SHA1(be2dd46cd0121cedad6dab90a22643798a3176ab) )
383378   ROM_LOAD( "319e08.bin",    0x6000, 0x2000, CRC(6add71b1) SHA1(fc8c0ecd3b7f03d63b6c3143143986883345fa38) )
384379
380   ROM_REGION( 0x04000, REGION_GFX2, ROMREGION_DISPOSE )
381   ROM_LOAD( "319e12.bin",    0x0000, 0x2000, CRC(e0fb7835) SHA1(44ccaaf92bdb83323f45e08dbe118697720e9105) )
382   ROM_LOAD( "319e13.bin",    0x2000, 0x2000, CRC(3d8f3743) SHA1(1f6fbf804dacfa44cd11b4cf41d0bedb7f2ff6b6) )
383
385384   ROM_REGION( 0x0260, REGION_PROMS, 0 )
386385   ROM_LOAD( "319b18.a16",  0x0000, 0x020, CRC(23cb02af) SHA1(aba459826a75ec07bc6d97580e934f58aa22f4f4) ) /* palette */
387386   ROM_LOAD( "319b16.c6",   0x0020, 0x100, CRC(5748e933) SHA1(c1478c31533a11421cd4579ccfdbb430e193d17b) ) /* sprite lookup table */
r1679r1680
404403   ROM_REGION( 0x1000, REGION_CPU3, 0 )     /* 4k for the 8039 DAC CPU */
405404   ROM_LOAD( "319e01.bin",   0x0000, 0x1000, CRC(ed5725a0) SHA1(64f54621487291fbfe827fb4cecca299fd0db781) )
406405
407   ROM_REGION( 0x04000, REGION_GFX1, ROMREGION_DISPOSE )
408   ROM_LOAD( "ic40_vid.bin",  0x0000, 0x2000, CRC(07b8b24b) SHA1(faadcb20ee8b26b9ab0692df6a81e5423514863e) )
409   ROM_LOAD( "319e13.bin",    0x2000, 0x2000, CRC(3d8f3743) SHA1(1f6fbf804dacfa44cd11b4cf41d0bedb7f2ff6b6) )
410
411   ROM_REGION( 0x08000, REGION_GFX2, ROMREGION_DISPOSE )
406   ROM_REGION( 0x08000, REGION_GFX1, ROMREGION_DISPOSE )
412407   ROM_LOAD( "319e11.bin",    0x0000, 0x2000, CRC(965a7ff6) SHA1(210aae91a3838e5f7c78747d9b7419d266538ffc) )
413408   ROM_LOAD( "319e09.bin",    0x2000, 0x2000, CRC(5eaa7f3e) SHA1(4c038e80d575988407252897a1f1bc6b76af597c) )
414409   ROM_LOAD( "319e10.bin",    0x4000, 0x2000, CRC(7bb1aeee) SHA1(be2dd46cd0121cedad6dab90a22643798a3176ab) )
415410   ROM_LOAD( "319e08.bin",    0x6000, 0x2000, CRC(6add71b1) SHA1(fc8c0ecd3b7f03d63b6c3143143986883345fa38) )
416411
412   ROM_REGION( 0x04000, REGION_GFX2, ROMREGION_DISPOSE )
413   ROM_LOAD( "ic40_vid.bin",  0x0000, 0x2000, CRC(07b8b24b) SHA1(faadcb20ee8b26b9ab0692df6a81e5423514863e) )
414   ROM_LOAD( "319e13.bin",    0x2000, 0x2000, CRC(3d8f3743) SHA1(1f6fbf804dacfa44cd11b4cf41d0bedb7f2ff6b6) )
415
417416   ROM_REGION( 0x0260, REGION_PROMS, 0 )
418417   ROM_LOAD( "319b18.a16",  0x0000, 0x020, CRC(23cb02af) SHA1(aba459826a75ec07bc6d97580e934f58aa22f4f4) ) /* palette */
419418   ROM_LOAD( "319b16.c6",   0x0020, 0x100, CRC(5748e933) SHA1(c1478c31533a11421cd4579ccfdbb430e193d17b) ) /* sprite lookup table */
r1679r1680
487486   ROM_REGION( 0x1000, REGION_CPU3, 0 )     /* 4k for the 8039 DAC CPU */
488487   ROM_LOAD( "319-h01",   0x0000, 0x1000, CRC(ed5725a0) SHA1(64f54621487291fbfe827fb4cecca299fd0db781) ) // same as e01?
489488
490   ROM_REGION( 0x04000, REGION_GFX1, ROMREGION_DISPOSE )
491   ROM_LOAD( "319e12.bin",    0x0000, 0x2000, CRC(e0fb7835) SHA1(44ccaaf92bdb83323f45e08dbe118697720e9105) ) // 12.9c
492   ROM_LOAD( "319-g13",  0x2000, 0x2000, CRC(3d8f3743) SHA1(1f6fbf804dacfa44cd11b4cf41d0bedb7f2ff6b6) ) // same as e13?
493
494   ROM_REGION( 0x08000, REGION_GFX2, ROMREGION_DISPOSE )
489   ROM_REGION( 0x08000, REGION_GFX1, ROMREGION_DISPOSE )
495490   ROM_LOAD( "319e11.bin",    0x0000, 0x2000, CRC(965a7ff6) SHA1(210aae91a3838e5f7c78747d9b7419d266538ffc) )
496491   ROM_LOAD( "319e09.bin",    0x2000, 0x2000, CRC(5eaa7f3e) SHA1(4c038e80d575988407252897a1f1bc6b76af597c) )
497492   ROM_LOAD( "319e10.bin",    0x4000, 0x2000, CRC(7bb1aeee) SHA1(be2dd46cd0121cedad6dab90a22643798a3176ab) )
498493   ROM_LOAD( "319e08.bin",    0x6000, 0x2000, CRC(6add71b1) SHA1(fc8c0ecd3b7f03d63b6c3143143986883345fa38) )
499494
495   ROM_REGION( 0x04000, REGION_GFX2, ROMREGION_DISPOSE )
496   ROM_LOAD( "319e12.bin",    0x0000, 0x2000, CRC(e0fb7835) SHA1(44ccaaf92bdb83323f45e08dbe118697720e9105) ) // 12.9c
497   ROM_LOAD( "319-g13",  0x2000, 0x2000, CRC(3d8f3743) SHA1(1f6fbf804dacfa44cd11b4cf41d0bedb7f2ff6b6) ) // same as e13?
498
500499   ROM_REGION( 0x0260, REGION_PROMS, 0 )
501500   ROM_LOAD( "319b18.a16",  0x0000, 0x020, CRC(23cb02af) SHA1(aba459826a75ec07bc6d97580e934f58aa22f4f4) ) /* palette */
502501   ROM_LOAD( "319b16.c6",   0x0020, 0x100, CRC(5748e933) SHA1(c1478c31533a11421cd4579ccfdbb430e193d17b) ) /* sprite lookup table */
r1679r1680
519518   ROM_REGION( 0x1000, REGION_CPU3, 0 )     /* 4k for the 8039 DAC CPU */
520519   ROM_LOAD( "319-h01",   0x0000, 0x1000, CRC(ed5725a0) SHA1(64f54621487291fbfe827fb4cecca299fd0db781) ) // same as e01?
521520
522   ROM_REGION( 0x04000, REGION_GFX1, ROMREGION_DISPOSE )
523   ROM_LOAD( "319e12.bin",    0x0000, 0x2000, CRC(e0fb7835) SHA1(44ccaaf92bdb83323f45e08dbe118697720e9105) ) // 12.9c
524   ROM_LOAD( "319-g13",  0x2000, 0x2000, CRC(3d8f3743) SHA1(1f6fbf804dacfa44cd11b4cf41d0bedb7f2ff6b6) ) // same as e13?
525
526   ROM_REGION( 0x08000, REGION_GFX2, ROMREGION_DISPOSE )
521   ROM_REGION( 0x08000, REGION_GFX1, ROMREGION_DISPOSE )
527522   ROM_LOAD( "319e11.bin",    0x0000, 0x2000, CRC(965a7ff6) SHA1(210aae91a3838e5f7c78747d9b7419d266538ffc) )
528523   ROM_LOAD( "319e09.bin",    0x2000, 0x2000, CRC(5eaa7f3e) SHA1(4c038e80d575988407252897a1f1bc6b76af597c) )
529524   ROM_LOAD( "319e10.bin",    0x4000, 0x2000, CRC(7bb1aeee) SHA1(be2dd46cd0121cedad6dab90a22643798a3176ab) )
530525   ROM_LOAD( "319e08.bin",    0x6000, 0x2000, CRC(6add71b1) SHA1(fc8c0ecd3b7f03d63b6c3143143986883345fa38) )
531526
527   ROM_REGION( 0x04000, REGION_GFX2, ROMREGION_DISPOSE )
528   ROM_LOAD( "319e12.bin",    0x0000, 0x2000, CRC(e0fb7835) SHA1(44ccaaf92bdb83323f45e08dbe118697720e9105) ) // 12.9c
529   ROM_LOAD( "319-g13",  0x2000, 0x2000, CRC(3d8f3743) SHA1(1f6fbf804dacfa44cd11b4cf41d0bedb7f2ff6b6) ) // same as e13?
530
532531   ROM_REGION( 0x0260, REGION_PROMS, 0 )
533532   ROM_LOAD( "319b18.a16",  0x0000, 0x020, CRC(23cb02af) SHA1(aba459826a75ec07bc6d97580e934f58aa22f4f4) ) /* palette */
534533   ROM_LOAD( "319b16.c6",   0x0020, 0x100, CRC(5748e933) SHA1(c1478c31533a11421cd4579ccfdbb430e193d17b) ) /* sprite lookup table */
r1679r1680
551550   ROM_REGION( 0x1000, REGION_CPU3, 0 )     /* 4k for the 8039 DAC CPU */
552551   ROM_LOAD( "319-h01",   0x0000, 0x1000, CRC(ed5725a0) SHA1(64f54621487291fbfe827fb4cecca299fd0db781) ) // same as e01?
553552
554   ROM_REGION( 0x04000, REGION_GFX1, ROMREGION_DISPOSE )
555   ROM_LOAD( "319e12.bin",    0x0000, 0x2000, CRC(e0fb7835) SHA1(44ccaaf92bdb83323f45e08dbe118697720e9105) ) // 12.9c
556   ROM_LOAD( "319-g13",  0x2000, 0x2000, CRC(3d8f3743) SHA1(1f6fbf804dacfa44cd11b4cf41d0bedb7f2ff6b6) ) // same as e13?
557
558   ROM_REGION( 0x08000, REGION_GFX2, ROMREGION_DISPOSE )
553   ROM_REGION( 0x08000, REGION_GFX1, ROMREGION_DISPOSE )
559554   ROM_LOAD( "319e11.bin",    0x0000, 0x2000, CRC(965a7ff6) SHA1(210aae91a3838e5f7c78747d9b7419d266538ffc) )
560555   ROM_LOAD( "319e09.bin",    0x2000, 0x2000, CRC(5eaa7f3e) SHA1(4c038e80d575988407252897a1f1bc6b76af597c) )
561556   ROM_LOAD( "319e10.bin",    0x4000, 0x2000, CRC(7bb1aeee) SHA1(be2dd46cd0121cedad6dab90a22643798a3176ab) )
562557   ROM_LOAD( "319e08.bin",    0x6000, 0x2000, CRC(6add71b1) SHA1(fc8c0ecd3b7f03d63b6c3143143986883345fa38) )
563558
559   ROM_REGION( 0x04000, REGION_GFX2, ROMREGION_DISPOSE )
560   ROM_LOAD( "319e12.bin",    0x0000, 0x2000, CRC(e0fb7835) SHA1(44ccaaf92bdb83323f45e08dbe118697720e9105) ) // 12.9c
561   ROM_LOAD( "319-g13",  0x2000, 0x2000, CRC(3d8f3743) SHA1(1f6fbf804dacfa44cd11b4cf41d0bedb7f2ff6b6) ) // same as e13?
562
564563   ROM_REGION( 0x0260, REGION_PROMS, 0 )
565564   ROM_LOAD( "319b18.a16",  0x0000, 0x020, CRC(23cb02af) SHA1(aba459826a75ec07bc6d97580e934f58aa22f4f4) ) /* palette */
566565   ROM_LOAD( "319b16.c6",   0x0020, 0x100, CRC(5748e933) SHA1(c1478c31533a11421cd4579ccfdbb430e193d17b) ) /* sprite lookup table */
src/mame/drivers/deco156.c
r1679r1680
303303   PORT_BIT( 0x0001, IP_ACTIVE_LOW, IPT_COIN1 )
304304   PORT_BIT( 0x0002, IP_ACTIVE_LOW, IPT_COIN2 )
305305   PORT_BIT( 0x0004, IP_ACTIVE_LOW, IPT_SERVICE1 )
306   PORT_BIT( 0x0008, IP_ACTIVE_LOW, IPT_SERVICE ) PORT_NAME( DEF_STR( Service_Mode )) PORT_CODE(KEYCODE_F2)
306   PORT_SERVICE_NO_TOGGLE( 0x0008, IP_ACTIVE_LOW )
307307   PORT_BIT( 0x0010, IP_ACTIVE_HIGH, IPT_VBLANK )
308308   PORT_BIT( 0x0020, IP_ACTIVE_LOW, IPT_UNUSED )
309309   PORT_BIT( 0x0040, IP_ACTIVE_LOW, IPT_UNUSED )
r1679r1680
341341   PORT_BIT( 0x0001, IP_ACTIVE_LOW, IPT_COIN1 )
342342   PORT_BIT( 0x0002, IP_ACTIVE_LOW, IPT_COIN2 )
343343   PORT_BIT( 0x0004, IP_ACTIVE_LOW, IPT_SERVICE1 )
344   PORT_BIT( 0x0008, IP_ACTIVE_LOW, IPT_SERVICE ) PORT_NAME( DEF_STR( Service_Mode )) PORT_CODE(KEYCODE_F2)
344   PORT_SERVICE_NO_TOGGLE( 0x0008, IP_ACTIVE_LOW )
345345   PORT_BIT( 0x0010, IP_ACTIVE_LOW, IPT_VBLANK )
346346   PORT_BIT( 0x0020, IP_ACTIVE_LOW, IPT_UNUSED ) /* 'soundmask' */
347347   PORT_BIT( 0x0040, IP_ACTIVE_LOW, IPT_UNUSED )
src/mame/drivers/toki.c
r1679r1680
436436static MACHINE_DRIVER_START( toki ) /* KOYO 20.000MHz near the cpu */
437437
438438   /* basic machine hardware */
439   MDRV_CPU_ADD(M68000,20000000/2)    /* verified on pcb */
439   MDRV_CPU_ADD(M68000,XTAL_20MHz /2)    /* verified on pcb */
440440   MDRV_CPU_PROGRAM_MAP(toki_map,0)
441441   MDRV_CPU_VBLANK_INT(irq1_line_hold,1)/* VBL */
442442
443   SEIBU_SOUND_SYSTEM_CPU(14318180/4)   /* verifed on pcb */
443   SEIBU_SOUND_SYSTEM_CPU(XTAL_14_31818MHz/4)   /* verifed on pcb */
444444
445445   MDRV_SCREEN_REFRESH_RATE(60)
446446   MDRV_MACHINE_RESET(seibu_sound_1)
r1679r1680
458458   MDRV_VIDEO_UPDATE(toki)
459459
460460   /* sound hardware */
461   SEIBU_SOUND_SYSTEM_YM3812_INTERFACE(14318180/4,1000000,1) /* verifed on pcb */
461   SEIBU_SOUND_SYSTEM_YM3812_RAIDEN_INTERFACE(XTAL_14_31818MHz/4,XTAL_12MHz/12 ,1) /* verifed on pcb */
462462MACHINE_DRIVER_END
463463
464464
src/mame/drivers/panicr.c
r1679r1680
7171{
7272   int i;
7373
74   /* allocate the colortable */
75   machine->colortable = colortable_alloc(machine, 0x100);
7476
75   PALETTE_INIT_CALL(RRRR_GGGG_BBBB);
76   color_prom += 256*3;
77   /* create a lookup table for the palette */
78   for (i = 0; i < 0x100; i++)
79   {
80      int r = pal4bit(color_prom[i + 0x000]);
81      int g = pal4bit(color_prom[i + 0x100]);
82      int b = pal4bit(color_prom[i + 0x200]);
7783
84      colortable_palette_set_color(machine->colortable, i, MAKE_RGB(r, g, b));
85   }
86
87   /* color_prom now points to the beginning of the lookup table */
88   color_prom += 0x300;
89
7890   // txt lookup table
79   for (i = 0;i < 256;i++)
91   for (i = 0; i < 0x100; i++)
8092   {
81      if (*color_prom & 0x40)
82         *(colortable++) = 0;
93      UINT8 ctabentry;
94
95      if (color_prom[i] & 0x40)
96         ctabentry = 0;
8397      else
84         *(colortable++) = (*color_prom & 0x3f) + 0x80;
85      color_prom++;
98         ctabentry = (color_prom[i] & 0x3f) | 0x80;
99
100      colortable_entry_set_value(machine->colortable, i, ctabentry);
86101   }
87102
88103   // tile lookup table
89   for (i = 0;i < 256;i++)
104   for (i = 0x100; i < 0x200; i++)
90105   {
91      *(colortable++) = (*color_prom & 0x3f) + 0x00;
92      color_prom++;
106      UINT8 ctabentry = (color_prom[i] & 0x3f) | 0x00;
107
108      colortable_entry_set_value(machine->colortable, i, ctabentry);
93109   }
94110
95111   // sprite lookup table
96   for (i = 0;i < 256;i++)
112   for (i = 0x200; i < 0x300; i++)
97113   {
98      if (*color_prom & 0x40)
99         *(colortable++) = 0;
114      UINT8 ctabentry;
115
116      if (color_prom[i] & 0x40)
117         ctabentry = 0;
100118      else
101         *(colortable++) = (*color_prom & 0x3f) + 0x40;
102      color_prom++;
119         ctabentry = (color_prom[i] & 0x3f) | 0x40;
120
121      colortable_entry_set_value(machine->colortable, i, ctabentry);
103122   }
104123}
105124
r1679r1680
119138
120139static TILE_GET_INFO( get_txttile_info )
121140{
122   int code,attr;
141   int code=videoram[tile_index*4];
142   int attr=videoram[tile_index*4+2];
143   int color = attr & 0x07;
123144
124   code=videoram[tile_index*4];
125   attr=videoram[tile_index*4+2];
145   tileinfo->group = color;
146
126147   SET_TILE_INFO(
127148      0,
128149      code + ((attr & 8) << 5),
129      attr&7,
150      color,
130151      0);
131152}
132153
r1679r1680
167188
168189static VIDEO_START( panicr )
169190{
170   bgtilemap = tilemap_create( get_bgtile_info,tilemap_scan_rows,TILEMAP_TYPE_PEN,16,16,1024,16 );
171   txttilemap = tilemap_create( get_txttile_info,tilemap_scan_rows,TILEMAP_TYPE_COLORTABLE,8,8,32,32 );
172   tilemap_set_transparent_pen(txttilemap, 0);
191   bgtilemap = tilemap_create( get_bgtile_info,tilemap_scan_rows,16,16,1024,16 );
192
193   txttilemap = tilemap_create( get_txttile_info,tilemap_scan_rows,8,8,32,32 );
194   colortable_configure_tilemap_groups(machine->colortable, txttilemap, machine->gfx[0], 0);
173195}
174196
175197static void draw_sprites(running_machine *machine, mame_bitmap *bitmap,const rectangle *cliprect )
r1679r1680
191213      drawgfx(bitmap,machine->gfx[2],
192214            sprite,
193215            color,fx,fy,x,y,
194            cliprect,TRANSPARENCY_COLOR,0);
216            cliprect,TRANSPARENCY_PENS,
217            colortable_get_transpen_mask(machine->colortable, machine->gfx[2], color, 0));
195218   }
196219}
197220
r1679r1680
348371   MDRV_SCREEN_SIZE(32*8, 32*8)
349372   MDRV_SCREEN_VISIBLE_AREA(0*8, 32*8-1, 2*8, 30*8-1)
350373   MDRV_GFXDECODE(panicr)
351   MDRV_PALETTE_LENGTH(256)
352   MDRV_COLORTABLE_LENGTH(256*3)
374   MDRV_PALETTE_LENGTH(256*3)
353375   MDRV_PALETTE_INIT(panicr)
354376
355377   MDRV_VIDEO_START(panicr)
src/mame/drivers/sbowling.c
r1679r1680
103103static VIDEO_START(sbowling)
104104{
105105   tmpbitmap = auto_bitmap_alloc(32*8,32*8,machine->screen[0].format);
106   sb_tilemap = tilemap_create(get_sb_tile_info, tilemap_scan_rows, TILEMAP_TYPE_PEN, 8, 8, 32, 32);
106   sb_tilemap = tilemap_create(get_sb_tile_info, tilemap_scan_rows, 8, 8, 32, 32);
107107}
108108
109109static WRITE8_HANDLER( pix_shift_w )
src/mame/drivers/good.c
r1679r1680
7070
7171static VIDEO_START( good )
7272{
73   bg_tilemap = tilemap_create(get_bg_tile_info,tilemap_scan_rows,TILEMAP_TYPE_PEN, 16, 16, 32,32);
74   fg_tilemap = tilemap_create(get_fg_tile_info,tilemap_scan_rows,TILEMAP_TYPE_PEN, 16, 16, 32,32);
73   bg_tilemap = tilemap_create(get_bg_tile_info,tilemap_scan_rows, 16, 16, 32,32);
74   fg_tilemap = tilemap_create(get_fg_tile_info,tilemap_scan_rows, 16, 16, 32,32);
7575   tilemap_set_transparent_pen(fg_tilemap,0xf);
7676}
7777
src/mame/drivers/8080bw.c
r1679r1680
1313/*    because according to KLOV, Midway was only allowed to make minor      */
1414/*    modifications of the Taito code.                                      */
1515/*                                                                          */
16/*  - DIP Locations verified from manual for:                               */
17/*      -sitv                                                               */
18/*      -sicv                                                               */
19/*      -invadpt2                                                           */
20/*      -lrescue                                                            */
21/*      -invasion                                                           */
1622/*                                                                          */
1723/*  To Do:                                                                  */
1824/*  -----                                                                   */
r1679r1680
112118   PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_UNKNOWN )
113119
114120   PORT_START_TAG("DSW0")
115   PORT_DIPNAME( 0x03, 0x00, DEF_STR( Lives ) )
121   PORT_DIPNAME( 0x03, 0x00, DEF_STR( Lives ) ) PORT_DIPLOCATION("SW1:1,2")
116122   PORT_DIPSETTING(    0x00, "3" )
117123   PORT_DIPSETTING(    0x01, "4" )
118124   PORT_DIPSETTING(    0x02, "5" )
119125   PORT_DIPSETTING(    0x03, "6" )
120   PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_TILT )
121   PORT_DIPNAME( 0x08, 0x00, DEF_STR( Bonus_Life ) )
126   PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_TILT ) PORT_DIPLOCATION("SW1:3")
127   PORT_DIPNAME( 0x08, 0x00, DEF_STR( Bonus_Life ) ) PORT_DIPLOCATION("SW1:4")
122128   PORT_DIPSETTING(    0x08, "1000" )
123129   PORT_DIPSETTING(    0x00, "1500" )
124   PORT_BIT( 0x70, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM(invaders_in2_control_r, 0)
125   PORT_DIPNAME( 0x80, 0x00, "Coin Info" )
130   /* SW1:5,6,7: In OFF, PL2 can have no control of joystick, going auto left/right and other problems like no laser gun.
131    Be sure these are always ON */
132   PORT_BIT( 0x70, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM(invaders_in2_control_r, 0) PORT_DIPLOCATION("SW1:5,6,7") /* Labeled as "FACTORY" */
133   PORT_DIPNAME( 0x80, 0x00, "Coin Info" ) PORT_DIPLOCATION("SW1:8")
126134   PORT_DIPSETTING(    0x80, DEF_STR( Off ) )
127135   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
128136
r1679r1680
177185   PORT_BIT( 0x80, IP_ACTIVE_LOW,  IPT_UNKNOWN )
178186
179187   PORT_START_TAG("DSW0")
180   PORT_DIPNAME( 0x03, 0x00, DEF_STR( Lives ) )
188   PORT_DIPNAME( 0x03, 0x00, DEF_STR( Lives ) ) PORT_DIPLOCATION("SW1:1,2")
181189   PORT_DIPSETTING(    0x00, "3" )
182190   PORT_DIPSETTING(    0x01, "4" )
183191   PORT_DIPSETTING(    0x02, "5" )
184192   PORT_DIPSETTING(    0x03, "6" )
185   PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_TILT )
186   PORT_DIPNAME( 0x08, 0x00, DEF_STR( Bonus_Life ) )
193   PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_TILT ) PORT_DIPLOCATION("SW1:3")
194   PORT_DIPNAME( 0x08, 0x00, DEF_STR( Bonus_Life ) ) PORT_DIPLOCATION("SW1:4")
187195   PORT_DIPSETTING(    0x08, "1000" )
188196   PORT_DIPSETTING(    0x00, "1500" )
189   PORT_BIT( 0x70, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM(invaders_in2_control_r, 0)
190   PORT_DIPNAME( 0x80, 0x00, "Coin Info" )
197   /* SW1:5,6,7: In OFF, PL2 can have no control of joystick, going auto left/right and other problems like no laser gun.
198    Be sure these are always ON */
199   PORT_BIT( 0x70, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM(invaders_in2_control_r, 0) PORT_DIPLOCATION("SW1:5,6,7") /* Labeled as "FACTORY" */
200   PORT_DIPNAME( 0x80, 0x00, "Coin Info" ) PORT_DIPLOCATION("SW1:8")
191201   PORT_DIPSETTING(    0x80, DEF_STR( Off ) )
192202   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
193203
r1679r1680
240250   PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_UNKNOWN )
241251
242252   PORT_START_TAG("DSW0")
243   PORT_DIPNAME( 0x03, 0x00, DEF_STR( Lives ) )
253   PORT_DIPNAME( 0x03, 0x00, DEF_STR( Lives ) ) PORT_DIPLOCATION("SW1:1,2")
244254   PORT_DIPSETTING(    0x00, "3" )
245255   PORT_DIPSETTING(    0x01, "4" )
246256   PORT_DIPSETTING(    0x02, "5" )
247257   PORT_DIPSETTING(    0x03, "6" )
248   PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_TILT )
249   PORT_DIPNAME( 0x08, 0x00, DEF_STR( Bonus_Life ) )
258   PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_TILT ) PORT_DIPLOCATION("SW1:3")
259   PORT_DIPNAME( 0x08, 0x00, DEF_STR( Bonus_Life ) ) PORT_DIPLOCATION("SW1:4")
250260   PORT_DIPSETTING(    0x00, "1500" )
251261   PORT_DIPSETTING(    0x08, "3000" ) /* This is different to invaders */
252   PORT_BIT( 0x70, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM(invaders_in2_control_r, 0)
253   PORT_DIPNAME( 0x80, 0x00, "Coin Info" )
262   /* SW1:5,6,7: In OFF, PL2 can have no control of joystick, going auto left/right and other problems like no laser gun.
263    Be sure these are always ON */
264   PORT_BIT( 0x70, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM(invaders_in2_control_r, 0) PORT_DIPLOCATION("SW1:5,6,7") /* Labeled as "FACTORY" */
265   PORT_DIPNAME( 0x80, 0x00, "Coin Info" ) PORT_DIPLOCATION("SW1:8")
254266   PORT_DIPSETTING(    0x80, DEF_STR( Off ) )
255267   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
256268
r1679r1680
314326   PORT_BIT( 0x80, IP_ACTIVE_LOW,  IPT_UNKNOWN )
315327
316328   PORT_START_TAG("DSW0")
317   PORT_DIPNAME( 0x01, 0x00, DEF_STR( Lives ) )
329   PORT_DIPNAME( 0x01, 0x00, DEF_STR( Lives ) ) PORT_DIPLOCATION("SW1:1")
318330   PORT_DIPSETTING(    0x00, "3" )
319331   PORT_DIPSETTING(    0x01, "4" )
320   PORT_DIPNAME( 0x02, 0x00, DEF_STR( Unknown ) )
332   /* SW1:2 doesn't seem to work? */
333   PORT_DIPNAME( 0x02, 0x00, "Rotate Images" ) PORT_DIPLOCATION("SW1:2") /* "When ON, the images on screen will be rotated. Default is ON." */
334   PORT_DIPSETTING(    0x02, DEF_STR( Off ) )
335   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
336   PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_TILT ) PORT_DIPLOCATION("SW1:3")
337   PORT_DIPNAME( 0x08, 0x00, "Preset Mode" ) PORT_DIPLOCATION("SW1:4") /* Preset Mode: "Switch for checking, when OFF checking can be done." */
321338   PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
322   PORT_DIPSETTING(    0x02, DEF_STR( On ) )
323   PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_TILT )
324   PORT_DIPNAME( 0x08, 0x00, "High Score Preset Mode" )
325   PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
326339   PORT_DIPSETTING(    0x08, DEF_STR( On ) )
327   PORT_BIT( 0x70, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM(invaders_in2_control_r, 0)
328   PORT_DIPNAME( 0x80, 0x00, "Coin Info" )
340   PORT_BIT( 0x70, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM(invaders_in2_control_r, 0) PORT_DIPLOCATION("SW1:5,6,7")
341   PORT_DIPNAME( 0x80, 0x00, "Coin Info" ) PORT_DIPLOCATION("SW1:8")
329342   PORT_DIPSETTING(    0x80, DEF_STR( Off ) )
330343   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
331344
r1679r1680
945958   PORT_BIT( 0x80, IP_ACTIVE_LOW,  IPT_UNKNOWN )
946959
947960   PORT_START_TAG("DSW0")
948   PORT_DIPNAME( 0x03, 0x00, DEF_STR( Lives ) )
961   PORT_DIPNAME( 0x03, 0x00, DEF_STR( Lives ) ) PORT_DIPLOCATION("SW1:1,2")
949962   PORT_DIPSETTING(    0x00, "3" )
950963   PORT_DIPSETTING(    0x01, "4" )
951964   PORT_DIPSETTING(    0x02, "5" )
952965   PORT_DIPSETTING(    0x03, "6" )
953   PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_TILT )
954   PORT_DIPNAME( 0x08, 0x00, DEF_STR( Unknown ) )
955   PORT_DIPSETTING(    0x08, DEF_STR( Off ) )
956   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
957   PORT_BIT( 0x70, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM(invaders_in2_control_r, 0)
958   PORT_DIPNAME( 0x80, 0x00, DEF_STR( Unknown ) )
959   PORT_DIPSETTING(    0x80, DEF_STR( Off ) )
960   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
966   /* SW1:3-8 Unused according to manual: "Factory Adjustments". Default is ON. */
967   PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_TILT ) PORT_DIPLOCATION("SW1:3")
968   PORT_DIPUNUSED_DIPLOC( 0x08, 0x00, "SW1:4" )
969   PORT_BIT( 0x70, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM(invaders_in2_control_r, 0) PORT_DIPLOCATION("SW1:5,6,7")
970   PORT_DIPUNUSED_DIPLOC( 0x80, 0x00, "SW1:8" )
961971
962972   /* Dummy controls port, P1 */
963973   PORT_START_TAG(INVADERS_P1_CONTROL_PORT_TAG)
r1679r1680
10861096   PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_UNKNOWN )
10871097
10881098   PORT_START_TAG("IN1")
1089   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_COIN1 )
1099   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_COIN1 )
10901100   PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_START2 )
10911101   PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_START1 )
10921102   PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_UNKNOWN )
10931103   PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_BUTTON1 )
10941104   PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_JOYSTICK_LEFT ) PORT_2WAY
10951105   PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_JOYSTICK_RIGHT ) PORT_2WAY
1096   PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_UNKNOWN )
1106   PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_COIN2 )
10971107
10981108   PORT_START_TAG("DSW0")
1099   PORT_DIPNAME( 0x03, 0x00, DEF_STR( Lives ) )
1109   /* SW1:5-8 Unused according to manual. */
1110   PORT_DIPNAME( 0x03, 0x03, DEF_STR( Lives ) ) PORT_DIPLOCATION("SW1:3,4") /* Default is OFF, OFF (6) */
11001111   PORT_DIPSETTING(    0x00, "3" )
11011112   PORT_DIPSETTING(    0x01, "4" )
11021113   PORT_DIPSETTING(    0x02, "5" )
11031114   PORT_DIPSETTING(    0x03, "6" )
1104   PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_UNKNOWN )
1105   PORT_DIPNAME( 0x08, 0x00, DEF_STR( Bonus_Life ) )
1115   PORT_DIPUNUSED_DIPLOC( 0x04, 0x04, "SW1:8" ) /* Default OFF */
1116   PORT_DIPNAME( 0x08, 0x00, DEF_STR( Bonus_Life ) ) PORT_DIPLOCATION("SW1:2") /* Default is ON (2500) */
11061117   PORT_DIPSETTING(    0x08, "1500" )
11071118   PORT_DIPSETTING(    0x00, "2500" )
1108   PORT_BIT( 0x70, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM(invaders_in2_control_r, 0)
1109   PORT_DIPNAME( 0x80, 0x00, "Laser Bonus Info" )
1110   PORT_DIPSETTING(    0x80, DEF_STR( Off ) )
1111   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
1119   PORT_BIT( 0x70, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM(invaders_in2_control_r, 0) PORT_DIPLOCATION("SW1:5,6,7") /* Default ON */
1120   PORT_DIPNAME( 0x80, 0x00, "Laser Bonus Info" ) PORT_DIPLOCATION("SW1:1") /* Default is OFF (Info on) */
1121   PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
1122   PORT_DIPSETTING(    0x80, DEF_STR( On ) )
11121123
11131124   /* Dummy controls port, P1 */
11141125   PORT_START_TAG(INVADERS_P1_CONTROL_PORT_TAG)
r1679r1680
11491160   PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_UNKNOWN )
11501161
11511162   PORT_START_TAG("IN1")
1152   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_COIN1 )
1163   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_COIN1 )
11531164   PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_START2 )
11541165   PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_START1 )
11551166   PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_UNKNOWN )
11561167   PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_BUTTON1 )
11571168   PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_JOYSTICK_LEFT ) PORT_2WAY
11581169   PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_JOYSTICK_RIGHT ) PORT_2WAY
1159   PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_UNKNOWN ) /* Must be high or game instantly crashes */
1170   PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_COIN2 )
11601171
11611172   PORT_START_TAG("DSW0")
11621173   PORT_DIPNAME( 0x03, 0x00, DEF_STR( Lives ) )
src/mame/drivers/quasar.c
r1679r1680
7171
7272
7373extern UINT8 *quasar_effectram;
74extern int quasar_effectcontrol;
74extern UINT8 quasar_effectcontrol;
7575
76static int page = 0;
77static int IOpage = 8;
76static UINT8 page = 0;
77static UINT8 IOpage = 8;
7878
7979
8080/************************************************************************
r1679r1680
8787
8888************************************************************************/
8989
90static WRITE8_HANDLER( page_0_w )
90static WRITE8_HANDLER( video_page_select_w )
9191{
92   page = 0;
92   page = offset & 0x03;
9393}
9494
95static WRITE8_HANDLER( page_1_w )
95static WRITE8_HANDLER( io_page_select_w )
9696{
97   page = 1;
97   IOpage = offset & 0x03;
9898}
9999
100static WRITE8_HANDLER( page_2_w )
101{
102   page = 2;
103}
104
105static WRITE8_HANDLER( page_3_w )
106{
107   page = 3;
108}
109
110static WRITE8_HANDLER( page_8_w )
111{
112   IOpage = 8;
113}
114
115static WRITE8_HANDLER( page_9_w )
116{
117   IOpage = 9;
118}
119
120static WRITE8_HANDLER( page_A_w )
121{
122   IOpage = 10;
123}
124
125static WRITE8_HANDLER( page_B_w )
126{
127   IOpage = 11;
128}
129
130100static WRITE8_HANDLER( quasar_video_w )
131101{
132102   switch (page)
r1679r1680
140110
141111static READ8_HANDLER( quasar_IO_r )
142112{
143   UINT32 ans = 0;
113   UINT8 ans = 0;
144114
145   if (IOpage == 8) ans = input_port_0_r(0);
146   if (IOpage == 9) ans = input_port_1_r(0);
147   if (IOpage == 10) ans = input_port_2_r(0);
148   if (IOpage == 11) ans = input_port_3_r(0);
115   if (IOpage == 0) ans = input_port_0_r(0);
116   if (IOpage == 1) ans = input_port_1_r(0);
117   if (IOpage == 2) ans = input_port_2_r(0);
118   if (IOpage == 3) ans = input_port_3_r(0);
149119
150120   return ans;
151121}
r1679r1680
198168static ADDRESS_MAP_START( quasar, ADDRESS_SPACE_PROGRAM, 8 )
199169   AM_RANGE(0x0000, 0x13ff) AM_ROM
200170    AM_RANGE(0x1400, 0x14ff) AM_MIRROR(0x6000) AM_READWRITE(cvs_bullet_ram_or_palette_r, quasar_bullet_w) AM_BASE(&cvs_bullet_ram)
201    AM_RANGE(0x1500, 0x15ff) AM_MIRROR(0x6000) AM_READWRITE(cvs_s2636_1_or_character_ram_r, cvs_s2636_1_or_character_ram_w) AM_BASE(&s2636_1_ram)
202    AM_RANGE(0x1600, 0x16ff) AM_MIRROR(0x6000) AM_READWRITE(cvs_s2636_2_or_character_ram_r, cvs_s2636_2_or_character_ram_w) AM_BASE(&s2636_2_ram)
203    AM_RANGE(0x1700, 0x17ff) AM_MIRROR(0x6000) AM_READWRITE(cvs_s2636_3_or_character_ram_r, cvs_s2636_3_or_character_ram_w) AM_BASE(&s2636_3_ram)
171    AM_RANGE(0x1500, 0x15ff) AM_MIRROR(0x6000) AM_READWRITE(cvs_s2636_0_or_character_ram_r, cvs_s2636_0_or_character_ram_w) AM_BASE(&cvs_s2636_0_ram)
172    AM_RANGE(0x1600, 0x16ff) AM_MIRROR(0x6000) AM_READWRITE(cvs_s2636_1_or_character_ram_r, cvs_s2636_1_or_character_ram_w) AM_BASE(&cvs_s2636_1_ram)
173    AM_RANGE(0x1700, 0x17ff) AM_MIRROR(0x6000) AM_READWRITE(cvs_s2636_2_or_character_ram_r, cvs_s2636_2_or_character_ram_w) AM_BASE(&cvs_s2636_2_ram)
204174   AM_RANGE(0x1800, 0x1bff) AM_MIRROR(0x6000) AM_READWRITE(cvs_video_or_color_ram_r, quasar_video_w) AM_BASE(&cvs_video_ram)
205175   AM_RANGE(0x1c00, 0x1fff) AM_MIRROR(0x6000) AM_RAM
206176   AM_RANGE(0x2000, 0x33ff) AM_ROM
r1679r1680
209179ADDRESS_MAP_END
210180
211181static ADDRESS_MAP_START( quasar_io, ADDRESS_SPACE_IO, 8 )
212   AM_RANGE(0x00, 0x00) AM_READWRITE(quasar_IO_r, page_0_w)
213   AM_RANGE(0x01, 0x01) AM_WRITE(page_1_w)
214   AM_RANGE(0x02, 0x02) AM_WRITE(page_2_w)
215   AM_RANGE(0x03, 0x03) AM_WRITE(page_3_w)
216   AM_RANGE(0x08, 0x08) AM_WRITE(page_8_w)
217   AM_RANGE(0x09, 0x09) AM_WRITE(page_9_w)
218   AM_RANGE(0x0A, 0x0A) AM_WRITE(page_A_w)
219   AM_RANGE(0x0B, 0x0B) AM_WRITE(page_B_w)
182   AM_RANGE(0x00, 0x03) AM_READWRITE(quasar_IO_r, video_page_select_w)
183   AM_RANGE(0x08, 0x0b) AM_WRITE(io_page_select_w)
220184   AM_RANGE(S2650_DATA_PORT,  S2650_DATA_PORT) AM_READWRITE(cvs_collision_clear, quasar_sh_command_w)
221185   AM_RANGE(S2650_CTRL_PORT,  S2650_CTRL_PORT) AM_READWRITE(cvs_collision_r, MWA8_NOP)
222186   AM_RANGE(S2650_SENSE_PORT, S2650_SENSE_PORT) AM_READ(input_port_4_r)
r1679r1680
364328/* S2636 Mappings */
365329
366330static GFXDECODE_START( quasar )
367   GFXDECODE_ENTRY( REGION_GFX1, 0x0000, charlayout,           0, 256 )   /* Rom chars */
368     GFXDECODE_ENTRY( REGION_GFX1, 0x0000, s2636_gfx_layout,  2072,   8 )   /* s2636 #1  */
369     GFXDECODE_ENTRY( REGION_GFX1, 0x0000, s2636_gfx_layout,  2072,   8 )   /* s2636 #2  */
370     GFXDECODE_ENTRY( REGION_GFX1, 0x0000, s2636_gfx_layout,  2072,   8 )   /* s2636 #3  */
331   GFXDECODE_ENTRY( REGION_GFX1, 0x0000, charlayout, 0, 64+1 )   /* ROM chars */
371332GFXDECODE_END
372333
373334static INTERRUPT_GEN( quasar_interrupt )
r1679r1680
404365   MDRV_SCREEN_VISIBLE_AREA(1*8+1, 29*8-1, 2*8, 32*8-1)
405366
406367   MDRV_GFXDECODE(quasar)
407   MDRV_PALETTE_LENGTH(1024)
408   MDRV_COLORTABLE_LENGTH(4096)
368   MDRV_PALETTE_LENGTH((64+1)*8+(4*256))
409369
410370   MDRV_PALETTE_INIT(quasar)
411371   MDRV_VIDEO_START(quasar)
src/mame/drivers/vsnes.c
r1679r1680
10201020   PORT_DIPNAME( 0x40, 0x00, DEF_STR( Unknown ) )
10211021   PORT_DIPSETTING(   0x00, DEF_STR( Off ) )
10221022   PORT_DIPSETTING(   0x40, DEF_STR( On ) )
1023   PORT_BIT(    0x80, 0x00, IPT_DIPSWITCH_NAME ) PORT_NAME("Service Mode (Left Side) PORT_TOGGLE") PORT_CODE(KEYCODE_F2)
1023   PORT_BIT(    0x80, 0x00, IPT_DIPSWITCH_NAME ) PORT_NAME("Service Mode (Left Side)") PORT_TOGGLE PORT_CODE(KEYCODE_F2)
10241024   PORT_DIPSETTING(   0x00, DEF_STR( Off ) )
10251025   PORT_DIPSETTING(   0x80, DEF_STR( On ) )
10261026
r1679r1680
10471047   PORT_DIPNAME( 0x40, 0x00, DEF_STR( Unknown ) )
10481048   PORT_DIPSETTING(   0x00, DEF_STR( Off ) )
10491049   PORT_DIPSETTING(   0x40, DEF_STR( On ) )
1050   PORT_BIT(    0x80, 0x00, IPT_DIPSWITCH_NAME ) PORT_NAME("Service Mode (Right Side) PORT_TOGGLE") PORT_CODE(KEYCODE_F1)
1050   PORT_BIT(    0x80, 0x00, IPT_DIPSWITCH_NAME ) PORT_NAME("Service Mode (Right Side)") PORT_TOGGLE PORT_CODE(KEYCODE_F1)
10511051   PORT_DIPSETTING(   0x00, DEF_STR( Off ) )
10521052   PORT_DIPSETTING(   0x80, DEF_STR( On ) )
10531053INPUT_PORTS_END
src/mame/drivers/xyonix.c
r1679r1680
174174   AM_RANGE(0xe0, 0xe0) AM_WRITE(xyonix_io_w)
175175   AM_RANGE(0x40, 0x40) AM_WRITE(MWA8_NOP)   // NMI ack?
176176   AM_RANGE(0x50, 0x50) AM_WRITE(xyonix_irqack_w)
177   AM_RANGE(0x60, 0x61) AM_WRITE(MWA8_NOP)   // crtc6845
177   AM_RANGE(0x60, 0x61) AM_WRITE(MWA8_NOP)   // mc6845
178178ADDRESS_MAP_END
179179
180180/* Inputs Ports **************************************************************/
src/mame/drivers/cninja.c
r1679r1680
8585   deco16_raster_display_list[deco16_raster_display_position++]=deco16_pf34_control[4]&0xffff;
8686
8787   cpunum_set_input_line(machine, 0, (cninja_irq_mask&0x10) ? 3 : 4, ASSERT_LINE);
88   timer_adjust(raster_irq_timer,attotime_never,0,attotime_zero);
88   timer_adjust_oneshot(raster_irq_timer,attotime_never,0);
8989}
9090
9191static READ16_HANDLER( cninja_irq_r )
r1679r1680
121121   case 1: /* Raster IRQ scanline position, only valid for values between 1 & 239 (0 and 240-256 do NOT generate IRQ's) */
122122      cninja_scanline=data&0xff;
123123      if ((cninja_irq_mask&0x2)==0 && cninja_scanline>0 && cninja_scanline<240)
124         timer_adjust(raster_irq_timer, video_screen_get_time_until_pos(0, cninja_scanline, 0), cninja_scanline, attotime_never);
124         timer_adjust_oneshot(raster_irq_timer, video_screen_get_time_until_pos(0, cninja_scanline, 0), cninja_scanline);
125125      else
126         timer_adjust(raster_irq_timer,attotime_never,0,attotime_zero);
126         timer_adjust_oneshot(raster_irq_timer,attotime_never,0);
127127      return;
128128
129129   case 2: /* VBL irq ack */
src/mame/drivers/wardner.c
r1679r1680
125125
126126#include "driver.h"
127127#include "deprecat.h"
128#include "video/crtc6845.h"
129128#include "cpu/tms32010/tms32010.h"
130129#include "twincobr.h"
131130#include "sound/3812intf.h"
src/mame/drivers/missile.c
r1679r1680
306306      curv = ((curv + 32) & 0xff) & ~0x10;
307307
308308   /* next one at the start of this scanline */
309   timer_adjust(irq_timer, video_screen_get_time_until_pos(0, v_to_scanline(curv), 0), curv, attotime_zero);
309   timer_adjust_oneshot(irq_timer, video_screen_get_time_until_pos(0, v_to_scanline(curv), 0), curv);
310310}
311311
312312
r1679r1680
352352
353353   /* scanline for the next run */
354354   curv ^= 224;
355   timer_adjust(cpu_timer, video_screen_get_time_until_pos(0, v_to_scanline(curv), 0), curv, attotime_zero);
355   timer_adjust_oneshot(cpu_timer, video_screen_get_time_until_pos(0, v_to_scanline(curv), 0), curv);
356356}
357357
358358
r1679r1680
393393
394394   /* create a timer to speed/slow the CPU */
395395   cpu_timer = timer_alloc(adjust_cpu_speed, NULL);
396   timer_adjust(cpu_timer, video_screen_get_time_until_pos(0, v_to_scanline(0), 0), 0, attotime_zero);
396   timer_adjust_oneshot(cpu_timer, video_screen_get_time_until_pos(0, v_to_scanline(0), 0), 0);
397397
398398   /* create a timer for IRQs and set up the first callback */
399399   irq_timer = timer_alloc(clock_irq, NULL);
src/mame/drivers/galivan.c
r1679r1680
579579   MDRV_SCREEN_SIZE(32*8, 32*8)
580580   MDRV_SCREEN_VISIBLE_AREA(0*8, 32*8-1, 2*8, 30*8-1)
581581   MDRV_GFXDECODE(galivan)
582   MDRV_PALETTE_LENGTH(256)
583   MDRV_COLORTABLE_LENGTH(8*16+16*16+256*16)
582   MDRV_PALETTE_LENGTH(8*16+16*16+256*16)
584583
585584   MDRV_PALETTE_INIT(galivan)
586585   MDRV_VIDEO_START(galivan)
r1679r1680
624623   MDRV_SCREEN_SIZE(32*8, 32*8)
625624   MDRV_SCREEN_VISIBLE_AREA(1*8, 31*8-1, 2*8, 30*8-1)
626625   MDRV_GFXDECODE(ninjemak)
627   MDRV_PALETTE_LENGTH(256)
628   MDRV_COLORTABLE_LENGTH(8*16+16*16+256*16)
626   MDRV_PALETTE_LENGTH(8*16+16*16+256*16)
629627
630628   MDRV_PALETTE_INIT(galivan)
631629   MDRV_VIDEO_START(ninjemak)
r1679r1680
678676   ROM_LOAD( "gv6.19d",      0x0000, 0x4000, CRC(da38168b) SHA1(a12decd55fd1cf32fd192f13bd33d2f1f4129d2c) )
679677   ROM_LOAD( "gv5.17d",      0x4000, 0x4000, CRC(22492d2a) SHA1(c8d36949abc2fcc8f2b12276eb82b330a940bc38) )
680678
681   ROM_REGION( 0x0500, REGION_PROMS, 0 )
679   ROM_REGION( 0x0400, REGION_PROMS, 0 )
682680   ROM_LOAD( "mb7114e.9f",   0x0000, 0x0100, CRC(de782b3e) SHA1(c76da7d5cbd9170be93c9591e525646a4360203c) )   /* red */
683681   ROM_LOAD( "mb7114e.10f",  0x0100, 0x0100, CRC(0ae2a857) SHA1(cdf84c0c75d483a81013dbc050e7aa8c8503c74c) )   /* green */
684682   ROM_LOAD( "mb7114e.11f",  0x0200, 0x0100, CRC(7ba8b9d1) SHA1(5942b403eda046e2f2584062443472cbf559db5c) )   /* blue */
685683   ROM_LOAD( "mb7114e.2d",   0x0300, 0x0100, CRC(75466109) SHA1(6196d12ab7103f6ef991b826d8b93303a61d4c48) )   /* sprite lookup table */
686   ROM_LOAD( "mb7114e.7f",   0x0400, 0x0100, CRC(06538736) SHA1(a2fb2ecb768686839f3087e691102e2dc2eb65b5) )   /* sprite palette bank */
684
685   ROM_REGION( 0x0100, REGION_USER1, 0 )
686   ROM_LOAD( "mb7114e.7f",   0x0000, 0x0100, CRC(06538736) SHA1(a2fb2ecb768686839f3087e691102e2dc2eb65b5) )   /* sprite palette bank */
687687ROM_END
688688
689689ROM_START( galivan2 )
r1679r1680
713713   ROM_LOAD( "gv6.19d",      0x0000, 0x4000, CRC(da38168b) SHA1(a12decd55fd1cf32fd192f13bd33d2f1f4129d2c) )
714714   ROM_LOAD( "gv5.17d",      0x4000, 0x4000, CRC(22492d2a) SHA1(c8d36949abc2fcc8f2b12276eb82b330a940bc38) )
715715
716   ROM_REGION( 0x0500, REGION_PROMS, 0 )
716   ROM_REGION( 0x0400, REGION_PROMS, 0 )
717717   ROM_LOAD( "mb7114e.9f",   0x0000, 0x0100, CRC(de782b3e) SHA1(c76da7d5cbd9170be93c9591e525646a4360203c) )   /* red */
718718   ROM_LOAD( "mb7114e.10f",  0x0100, 0x0100, CRC(0ae2a857) SHA1(cdf84c0c75d483a81013dbc050e7aa8c8503c74c) )   /* green */
719719   ROM_LOAD( "mb7114e.11f",  0x0200, 0x0100, CRC(7ba8b9d1) SHA1(5942b403eda046e2f2584062443472cbf559db5c) )   /* blue */
720720   ROM_LOAD( "mb7114e.2d",   0x0300, 0x0100, CRC(75466109) SHA1(6196d12ab7103f6ef991b826d8b93303a61d4c48) )   /* sprite lookup table */
721   ROM_LOAD( "mb7114e.7f",   0x0400, 0x0100, CRC(06538736) SHA1(a2fb2ecb768686839f3087e691102e2dc2eb65b5) )   /* sprite palette bank */
721
722   ROM_REGION( 0x0100, REGION_USER1, 0 )
723   ROM_LOAD( "mb7114e.7f",   0x0000, 0x0100, CRC(06538736) SHA1(a2fb2ecb768686839f3087e691102e2dc2eb65b5) )   /* sprite palette bank */
722724ROM_END
723725
724726ROM_START( dangar )
r1679r1680
748750   ROM_LOAD( "dangar07.19d", 0x0000, 0x4000, CRC(6dba32cf) SHA1(e6433f291364202c1291b137d6ee1840ecf7d72d) )
749751   ROM_LOAD( "dangar06.17d", 0x4000, 0x4000, CRC(6c899071) SHA1(9a776aae897d57e66ebdbcf79f3c673da8b78b05) )
750752
751   ROM_REGION( 0x0500, REGION_PROMS, 0 )
753   ROM_REGION( 0x0400, REGION_PROMS, 0 )
752754   ROM_LOAD( "82s129.9f",    0x0000, 0x0100, CRC(b29f6a07) SHA1(17c82f439f314c212470bafd917b3f7e12462d16) )   /* red */
753755   ROM_LOAD( "82s129.10f",   0x0100, 0x0100, CRC(c6de5ecb) SHA1(d5b6cb784b5df16332c5e2b19b763c8858a0b6a7) )   /* green */
754756   ROM_LOAD( "82s129.11f",   0x0200, 0x0100, CRC(a5bbd6dc) SHA1(5587844900a24d833500d204f049c05493c4a25a) )   /* blue */
755757   ROM_LOAD( "82s129.2d",    0x0300, 0x0100, CRC(a4ac95a5) SHA1(3b31cd3fd6caedd89d1bedc606a978081fc5431f) )   /* sprite lookup table */
756   ROM_LOAD( "82s129.7f",    0x0400, 0x0100, CRC(29bc6216) SHA1(1d7864ad06ad0cd5e3d1905fc6066bee1cd90995) )   /* sprite palette bank */
758
759   ROM_REGION( 0x0100, REGION_USER1, 0 )
760   ROM_LOAD( "82s129.7f",    0x0000, 0x0100, CRC(29bc6216) SHA1(1d7864ad06ad0cd5e3d1905fc6066bee1cd90995) )   /* sprite palette bank */
757761ROM_END
758762
759763ROM_START( dangar2 )
r1679r1680
783787   ROM_LOAD( "dangar07.19d", 0x0000, 0x4000, CRC(6dba32cf) SHA1(e6433f291364202c1291b137d6ee1840ecf7d72d) )
784788   ROM_LOAD( "dangar06.17d", 0x4000, 0x4000, CRC(6c899071) SHA1(9a776aae897d57e66ebdbcf79f3c673da8b78b05) )
785789
786   ROM_REGION( 0x0500, REGION_PROMS, 0 )
790   ROM_REGION( 0x0400, REGION_PROMS, 0 )
787791   ROM_LOAD( "82s129.9f",    0x0000, 0x0100, CRC(b29f6a07) SHA1(17c82f439f314c212470bafd917b3f7e12462d16) )   /* red */
788792   ROM_LOAD( "82s129.10f",   0x0100, 0x0100, CRC(c6de5ecb) SHA1(d5b6cb784b5df16332c5e2b19b763c8858a0b6a7) )   /* green */
789793   ROM_LOAD( "82s129.11f",   0x0200, 0x0100, CRC(a5bbd6dc) SHA1(5587844900a24d833500d204f049c05493c4a25a) )   /* blue */
790794   ROM_LOAD( "82s129.2d",    0x0300, 0x0100, CRC(a4ac95a5) SHA1(3b31cd3fd6caedd89d1bedc606a978081fc5431f) )   /* sprite lookup table */
791   ROM_LOAD( "82s129.7f",    0x0400, 0x0100, CRC(29bc6216) SHA1(1d7864ad06ad0cd5e3d1905fc6066bee1cd90995) )   /* sprite palette bank */
795
796   ROM_REGION( 0x0100, REGION_USER1, 0 )
797   ROM_LOAD( "82s129.7f",    0x0000, 0x0100, CRC(29bc6216) SHA1(1d7864ad06ad0cd5e3d1905fc6066bee1cd90995) )   /* sprite palette bank */
792798ROM_END
793799
794800ROM_START( dangarb )
r1679r1680
818824   ROM_LOAD( "dangar07.19d", 0x0000, 0x4000, CRC(6dba32cf) SHA1(e6433f291364202c1291b137d6ee1840ecf7d72d) )
819825   ROM_LOAD( "dangar06.17d", 0x4000, 0x4000, CRC(6c899071) SHA1(9a776aae897d57e66ebdbcf79f3c673da8b78b05) )
820826
821   ROM_REGION( 0x0500, REGION_PROMS, 0 )
827   ROM_REGION( 0x0400, REGION_PROMS, 0 )
822828   ROM_LOAD( "82s129.9f",    0x0000, 0x0100, CRC(b29f6a07) SHA1(17c82f439f314c212470bafd917b3f7e12462d16) )   /* red */
823829   ROM_LOAD( "82s129.10f",   0x0100, 0x0100, CRC(c6de5ecb) SHA1(d5b6cb784b5df16332c5e2b19b763c8858a0b6a7) )   /* green */
824830   ROM_LOAD( "82s129.11f",   0x0200, 0x0100, CRC(a5bbd6dc) SHA1(5587844900a24d833500d204f049c05493c4a25a) )   /* blue */
825831   ROM_LOAD( "82s129.2d",    0x0300, 0x0100, CRC(a4ac95a5) SHA1(3b31cd3fd6caedd89d1bedc606a978081fc5431f) )   /* sprite lookup table */
826   ROM_LOAD( "82s129.7f",    0x0400, 0x0100, CRC(29bc6216) SHA1(1d7864ad06ad0cd5e3d1905fc6066bee1cd90995) )   /* sprite palette bank */
832
833   ROM_REGION( 0x0100, REGION_USER1, 0 )
834   ROM_LOAD( "82s129.7f",    0x0000, 0x0100, CRC(29bc6216) SHA1(1d7864ad06ad0cd5e3d1905fc6066bee1cd90995) )   /* sprite palette bank */
827835ROM_END
828836
829837ROM_START( ninjemak )
r1679r1680
858866   ROM_REGION( 0x4000, REGION_GFX5, 0 )   /* data for mcu/blitter? */
859867   ROM_LOAD( "ninjemak.5",   0x0000, 0x4000, CRC(5f91dd30) SHA1(3513c0a2e4ca83f602cacad6af9c07fe9e4b16a1) )   /* text layer data */
860868
861   ROM_REGION( 0x0500, REGION_PROMS, 0 )   /* Region 3 - color data */
869   ROM_REGION( 0x0400, REGION_PROMS, 0 )   /* Region 3 - color data */
862870   ROM_LOAD( "ninjemak.pr1", 0x0000, 0x0100, CRC(8a62d4e4) SHA1(99ca4da01ea1b5585f6e3ebf162c3f988ab317e5) )   /* red */
863871   ROM_LOAD( "ninjemak.pr2", 0x0100, 0x0100, CRC(2ccf976f) SHA1(b804ee761793697087fbe3372352f301a22feeab) )   /* green */
864872   ROM_LOAD( "ninjemak.pr3", 0x0200, 0x0100, CRC(16b2a7a4) SHA1(53c410b439c8a835447f15f2ab250b363b3f7888) )   /* blue */
865873   ROM_LOAD( "yncp-2d.bin",  0x0300, 0x0100, BAD_DUMP CRC(23bade78) SHA1(7e2de5eb08d888f97830807b6dbe85d09bb3b7f8)  )   /* sprite lookup table */
866   ROM_LOAD( "yncp-7f.bin",  0x0400, 0x0100, BAD_DUMP CRC(262d0809) SHA1(a67281af02cef082023c0d7d57e3824aeef67450)  )   /* sprite palette bank */
874
875   ROM_REGION( 0x0100, REGION_USER1, 0 )
876   ROM_LOAD( "yncp-7f.bin",  0x0000, 0x0100, BAD_DUMP CRC(262d0809) SHA1(a67281af02cef082023c0d7d57e3824aeef67450)  )   /* sprite palette bank */
867877ROM_END
868878
869879ROM_START( youma )
r1679r1680
898908   ROM_REGION( 0x4000, REGION_GFX5, 0 )   /* data for mcu/blitter? */
899909   ROM_LOAD( "ync-5.bin",    0x0000, 0x4000, CRC(993e4ab2) SHA1(aceafc83b36db4db923d27f77ad045e626678bae) )   /* text layer data */
900910
901   ROM_REGION( 0x0500, REGION_PROMS, 0 )   /* Region 3 - color data */
911   ROM_REGION( 0x0400, REGION_PROMS, 0 )   /* Region 3 - color data */
902912   ROM_LOAD( "yncp-6e.bin",  0x0000, 0x0100, CRC(ea47b91a) SHA1(9921aa1ef882fb664d85d3e065223610262ca112) )   /* red */
903913   ROM_LOAD( "yncp-7e.bin",  0x0100, 0x0100, CRC(e94c0fed) SHA1(68581c91e9aa485f78af6b6a5c98612372cd5b17) )   /* green */
904914   ROM_LOAD( "yncp-8e.bin",  0x0200, 0x0100, CRC(ffb4b287) SHA1(c3c7018e6d5e18cc2db135812d0dc3824710ab4c) )   /* blue */
905915   ROM_LOAD( "yncp-2d.bin",  0x0300, 0x0100, CRC(23bade78) SHA1(7e2de5eb08d888f97830807b6dbe85d09bb3b7f8) )   /* sprite lookup table */
906   ROM_LOAD( "yncp-7f.bin",  0x0400, 0x0100, CRC(262d0809) SHA1(a67281af02cef082023c0d7d57e3824aeef67450) )   /* sprite palette bank */
916
917   ROM_REGION( 0x0100, REGION_USER1, 0 )
918   ROM_LOAD( "yncp-7f.bin",  0x0000, 0x0100, CRC(262d0809) SHA1(a67281af02cef082023c0d7d57e3824aeef67450) )   /* sprite palette bank */
907919ROM_END
908920
909921ROM_START( youmab )
r1679r1680
911923   ROM_LOAD( "electric1.3u", 0x00000, 0x8000, CRC(cc4fdb92) SHA1(9ce963db23f91f91e775a0b9a819f00db869120f) )
912924   ROM_LOAD( "electric3.3r", 0x10000, 0x8000, CRC(c1bc7387) SHA1(ad05bff02ece515465a9506e09c252c446c8f81d) )
913925
914   ROM_REGION( 0x10000, REGION_USER1, 0 )   /* main cpu code */
926   ROM_REGION( 0x10000, REGION_USER2, 0 )   /* main cpu code */
915927   /* This rom is double the size of the original one, appears to have extra (banked) code for 0x8000 */
916928   ROM_LOAD( "electric2.3t", 0x00000, 0x8000, CRC(99aee3bc) SHA1(5ffd60b959dda3fd41609c89a3486a989b1e2530) )
917929
r1679r1680
939951   ROM_LOAD( "electric7.3a",   0x0000, 0x4000, CRC(80c20d36) SHA1(f20724754824030d62059388f3ea2224f5b7a60e) )
940952   ROM_LOAD( "electric6.3b",   0x4000, 0x4000, CRC(1da7a651) SHA1(5307452058164a0bc39d144dd204627a9ead7543) )
941953
942   ROM_REGION( 0x0500, REGION_PROMS, 0 )   /* Region 3 - color data */
954   ROM_REGION( 0x0400, REGION_PROMS, 0 )   /* Region 3 - color data */
943955   ROM_LOAD( "prom82s129.2n",  0x0000, 0x0100, CRC(ea47b91a) SHA1(9921aa1ef882fb664d85d3e065223610262ca112) )   /* red */
944956   ROM_LOAD( "prom82s129.2m",  0x0100, 0x0100, CRC(e94c0fed) SHA1(68581c91e9aa485f78af6b6a5c98612372cd5b17) )   /* green */
945957   ROM_LOAD( "prom82s129.2l",  0x0200, 0x0100, CRC(ffb4b287) SHA1(c3c7018e6d5e18cc2db135812d0dc3824710ab4c) )   /* blue */
946958   ROM_LOAD( "prom82s129.3s",  0x0300, 0x0100, CRC(23bade78) SHA1(7e2de5eb08d888f97830807b6dbe85d09bb3b7f8) )   /* sprite lookup table */
947   ROM_LOAD( "prom82s129.1l",  0x0400, 0x0100, CRC(262d0809) SHA1(a67281af02cef082023c0d7d57e3824aeef67450) )   /* sprite palette bank */
959
960   ROM_REGION( 0x0100, REGION_USER1, 0 )
961   ROM_LOAD( "prom82s129.1l",  0x0000, 0x0100, CRC(262d0809) SHA1(a67281af02cef082023c0d7d57e3824aeef67450) )   /* sprite palette bank */
948962ROM_END
949963
950964
r1679r1680
953967   ROM_LOAD( "1.1d",     0x00000, 0x8000, CRC(692ae497) SHA1(572e5a1eae9b0bb48f65dce5de2df5c5ae95a3bd) )
954968   ROM_LOAD( "3.4d",     0x10000, 0x8000, CRC(ebf61afc) SHA1(30235a90e8316f5033d44d31f02cca97c64f2d5e) )
955969
956   ROM_REGION( 0x10000, REGION_USER1, 0 )   /* main cpu code */
970   ROM_REGION( 0x10000, REGION_USER2, 0 )   /* main cpu code */
957971   /* This rom is double the size of the original one, appears to have extra (banked) code for 0x8000 */
958972   ROM_LOAD( "2.2d", 0x00000, 0x8000, CRC(99aee3bc) SHA1(5ffd60b959dda3fd41609c89a3486a989b1e2530) ) // same as first bootleg
959973
r1679r1680
980994   ROM_LOAD( "6.18d",   0x0000, 0x4000, CRC(80c20d36) SHA1(f20724754824030d62059388f3ea2224f5b7a60e) )
981995   ROM_LOAD( "5.17d",   0x4000, 0x4000, CRC(1da7a651) SHA1(5307452058164a0bc39d144dd204627a9ead7543) )
982996
983   ROM_REGION( 0x0500, REGION_PROMS, 0 )   /* Region 3 - color data */
997   ROM_REGION( 0x0400, REGION_PROMS, 0 )   /* Region 3 - color data */
984998   ROM_LOAD( "pr.6e",  0x0000, 0x0100, CRC(ea47b91a) SHA1(9921aa1ef882fb664d85d3e065223610262ca112) )   /* red */
985999   ROM_LOAD( "pr.7e",  0x0100, 0x0100, CRC(6d66da81) SHA1(ffdd1778ce5b7614b90b5da85589c5871405d3fe) )   /* green */ // different (bad?)
9861000   ROM_LOAD( "pr.8e",  0x0200, 0x0100, CRC(ffb4b287) SHA1(c3c7018e6d5e18cc2db135812d0dc3824710ab4c) )   /* blue */
9871001   ROM_LOAD( "pr.2e",  0x0300, 0x0100, CRC(23bade78) SHA1(7e2de5eb08d888f97830807b6dbe85d09bb3b7f8) )   /* sprite lookup table */
988   ROM_LOAD( "pr.7h",  0x0400, 0x0100, CRC(262d0809) SHA1(a67281af02cef082023c0d7d57e3824aeef67450) )   /* sprite palette bank */
1002
1003   ROM_REGION( 0x0100, REGION_USER1, 0 )
1004   ROM_LOAD( "pr.7h",  0x0000, 0x0100, CRC(262d0809) SHA1(a67281af02cef082023c0d7d57e3824aeef67450) )   /* sprite palette bank */
9891005ROM_END
9901006
9911007
r1679r1680
9931009{
9941010   if (data==0xff)
9951011   {
996      memory_set_bankptr( 2, memory_region(REGION_USER1)+0x4000 );
1012      memory_set_bankptr( 2, memory_region(REGION_USER2)+0x4000 );
9971013   }
9981014   else if (data==0x00)
9991015   {
1000      memory_set_bankptr( 2, memory_region(REGION_USER1) );
1016      memory_set_bankptr( 2, memory_region(REGION_USER2) );
10011017   }
10021018   else
10031019   {
r1679r1680
10241040{
10251041   memory_install_write8_handler(0, ADDRESS_SPACE_IO, 0x82, 0x82, 0, 0, youmab_extra_bank_w); // banks rom at 0x8000? writes 0xff and 0x00 before executing code there
10261042   memory_install_read8_handler(0, ADDRESS_SPACE_PROGRAM, 0x8000, 0xbfff, 0, 0, MRA8_BANK2);
1027   memory_set_bankptr( 2, memory_region(REGION_USER1) );
1043   memory_set_bankptr( 2, memory_region(REGION_USER2) );
10281044
10291045   memory_install_write8_handler(0, ADDRESS_SPACE_IO, 0x81, 0x81, 0, 0, youmab_81_w); // ?? often, alternating values
10301046   memory_install_write8_handler(0, ADDRESS_SPACE_IO, 0x84, 0x84, 0, 0, youmab_84_w); // ?? often, sequence..
src/mame/drivers/igs_m027.c
r1679r1680
132132
133133static VIDEO_START(igs_majhong)
134134{
135   igs_tx_tilemap= tilemap_create(get_tx_tilemap_tile_info,tilemap_scan_rows,TILEMAP_TYPE_PEN, 8, 8,64,32);
135   igs_tx_tilemap= tilemap_create(get_tx_tilemap_tile_info,tilemap_scan_rows, 8, 8,64,32);
136136   tilemap_set_transparent_pen(igs_tx_tilemap,15);
137   igs_bg_tilemap= tilemap_create(get_bg_tilemap_tile_info,tilemap_scan_rows,0, 8, 8,64,32);
138   //igs_bg_tilemap= tilemap_create(get_bg_tilemap_tile_info,tilemap_scan_rows,TILEMAP_TYPE_PEN, 8, 8,64,32);
137   igs_bg_tilemap= tilemap_create(get_bg_tilemap_tile_info,tilemap_scan_rows, 8, 8,64,32);
138   //igs_bg_tilemap= tilemap_create(get_bg_tilemap_tile_info,tilemap_scan_rows, 8, 8,64,32);
139139   //tilemap_set_transparent_pen(igs_bg_tilemap,15);
140140   logerror("Video START OK!\n");
141141}
src/mame/drivers/ettrivia.c
r1679r1680
194194
195195static VIDEO_START( ettrivia )
196196{
197   bg_tilemap = tilemap_create( get_tile_info_bg,tilemap_scan_rows,TILEMAP_TYPE_PEN,8,8,64,32 );
198   fg_tilemap = tilemap_create( get_tile_info_fg,tilemap_scan_rows,TILEMAP_TYPE_PEN,8,8,64,32 );
197   bg_tilemap = tilemap_create( get_tile_info_bg,tilemap_scan_rows,8,8,64,32 );
198   fg_tilemap = tilemap_create( get_tile_info_fg,tilemap_scan_rows,8,8,64,32 );
199199
200200   tilemap_set_transparent_pen(fg_tilemap,0);
201201}
r1679r1680
244244   MDRV_SCREEN_VISIBLE_AREA(0*8, 32*8-1, 0*8, 28*8-1)
245245   MDRV_GFXDECODE(ettrivia)
246246   MDRV_PALETTE_LENGTH(256)
247   MDRV_COLORTABLE_LENGTH(32*4+32*4)
248247
249248   MDRV_PALETTE_INIT(naughtyb)
250249   MDRV_VIDEO_START(ettrivia)
src/mame/drivers/jalmah.c
r1679r1680
180180
181181static VIDEO_START( jalmah )
182182{
183   sc0_tilemap = tilemap_create(get_sc0_tile_info,bg_scan,TILEMAP_TYPE_PEN,16,16,256,32);
184   sc1_tilemap = tilemap_create(get_sc1_tile_info,bg_scan,TILEMAP_TYPE_PEN,16,16,256,32);
185   sc2_tilemap = tilemap_create(get_sc2_tile_info,bg_scan,TILEMAP_TYPE_PEN,16,16,256,32);
186   sc3_tilemap = tilemap_create(get_sc3_tile_info,tilemap_scan_cols,TILEMAP_TYPE_PEN,8,8,256,32);
183   sc0_tilemap = tilemap_create(get_sc0_tile_info,bg_scan,16,16,256,32);
184   sc1_tilemap = tilemap_create(get_sc1_tile_info,bg_scan,16,16,256,32);
185   sc2_tilemap = tilemap_create(get_sc2_tile_info,bg_scan,16,16,256,32);
186   sc3_tilemap = tilemap_create(get_sc3_tile_info,tilemap_scan_cols,8,8,256,32);
187187
188188   jm_scrollram = auto_malloc(0x80);
189189   jm_vregs = auto_malloc(0x40);
src/mame/drivers/supdrapo.c
r1679r1680
251251
252252static VIDEO_START( supdrapo )
253253{
254   fg_tilemap = tilemap_create(get_tile_info,tilemap_scan_rows,TILEMAP_TYPE_PEN,8,8,32,32);
254   fg_tilemap = tilemap_create(get_tile_info,tilemap_scan_rows,8,8,32,32);
255255}
256256
257257static VIDEO_UPDATE( supdrapo )
src/mame/drivers/midwunit.c
r1679r1680
208208   PORT_BIT( 0x0002, IP_ACTIVE_LOW, IPT_COIN2 )
209209   PORT_BIT( 0x0004, IP_ACTIVE_LOW, IPT_START1 )
210210   PORT_BIT( 0x0008, IP_ACTIVE_LOW, IPT_TILT ) /* Slam Switch */
211   PORT_BIT(0x0010, IP_ACTIVE_LOW, IPT_SERVICE ) PORT_NAME(DEF_STR( Test )) PORT_CODE(KEYCODE_F2)
211   PORT_SERVICE_NO_TOGGLE( 0x0010, IP_ACTIVE_LOW )
212212   PORT_BIT( 0x0020, IP_ACTIVE_LOW, IPT_START2 )
213213   PORT_BIT( 0x0040, IP_ACTIVE_LOW, IPT_SERVICE1 )
214214   PORT_BIT( 0x0080, IP_ACTIVE_LOW, IPT_COIN3 )
r1679r1680
317317   PORT_BIT( 0x0002, IP_ACTIVE_LOW, IPT_COIN2 )
318318   PORT_BIT( 0x0004, IP_ACTIVE_LOW, IPT_START1 )
319319   PORT_BIT( 0x0008, IP_ACTIVE_LOW, IPT_TILT ) /* Slam Switch */
320   PORT_BIT(0x0010, IP_ACTIVE_LOW, IPT_SERVICE ) PORT_NAME(DEF_STR( Test )) PORT_CODE(KEYCODE_F2)
320   PORT_SERVICE_NO_TOGGLE( 0x0010, IP_ACTIVE_LOW )
321321   PORT_BIT( 0x0020, IP_ACTIVE_LOW, IPT_START2 )
322322   PORT_BIT( 0x0040, IP_ACTIVE_LOW, IPT_SERVICE1 )
323323   PORT_BIT( 0x0080, IP_ACTIVE_LOW, IPT_COIN3 )
r1679r1680
410410   PORT_BIT( 0x0002, IP_ACTIVE_LOW, IPT_COIN2 )
411411   PORT_BIT( 0x0004, IP_ACTIVE_LOW, IPT_START1 )
412412   PORT_BIT( 0x0008, IP_ACTIVE_LOW, IPT_TILT ) /* Slam Switch */
413   PORT_BIT(0x0010, IP_ACTIVE_LOW, IPT_SERVICE ) PORT_NAME(DEF_STR( Test )) PORT_CODE(KEYCODE_F2)
413   PORT_SERVICE_NO_TOGGLE( 0x0010, IP_ACTIVE_LOW )
414414   PORT_BIT( 0x0020, IP_ACTIVE_LOW, IPT_START2 )
415415   PORT_BIT( 0x0040, IP_ACTIVE_LOW, IPT_SERVICE1 )
416416   PORT_BIT( 0x0080, IP_ACTIVE_LOW, IPT_COIN3 )
r1679r1680
503503   PORT_BIT( 0x0002, IP_ACTIVE_LOW, IPT_COIN2 )
504504   PORT_BIT( 0x0004, IP_ACTIVE_LOW, IPT_START1 )
505505   PORT_BIT( 0x0008, IP_ACTIVE_LOW, IPT_TILT ) /* Slam Switch */
506   PORT_BIT(0x0010, IP_ACTIVE_LOW, IPT_SERVICE ) PORT_NAME(DEF_STR( Test )) PORT_CODE(KEYCODE_F2)
506   PORT_SERVICE_NO_TOGGLE( 0x0010, IP_ACTIVE_LOW )
507507   PORT_BIT( 0x0020, IP_ACTIVE_LOW, IPT_START2 )
508508   PORT_BIT( 0x0040, IP_ACTIVE_LOW, IPT_SERVICE1 )
509509   PORT_BIT( 0x0080, IP_ACTIVE_LOW, IPT_COIN3 )
r1679r1680
589589   PORT_BIT( 0x0002, IP_ACTIVE_LOW, IPT_COIN2 )
590590   PORT_BIT( 0x0004, IP_ACTIVE_LOW, IPT_START1 )
591591   PORT_BIT( 0x0008, IP_ACTIVE_LOW, IPT_TILT ) /* Slam Switch */
592   PORT_BIT(0x0010, IP_ACTIVE_LOW, IPT_SERVICE ) PORT_NAME(DEF_STR( Test )) PORT_CODE(KEYCODE_F2)
592   PORT_SERVICE_NO_TOGGLE( 0x0010, IP_ACTIVE_LOW )
593593   PORT_BIT( 0x0020, IP_ACTIVE_LOW, IPT_START2 )
594594   PORT_BIT( 0x0040, IP_ACTIVE_LOW, IPT_SERVICE1 )
595595   PORT_BIT( 0x0080, IP_ACTIVE_LOW, IPT_COIN3 )
src/mame/drivers/tecmosys.c
r1679r1680
401401
402402static VIDEO_START(deroon)
403403{
404   txt_tilemap = tilemap_create(get_tile_info,tilemap_scan_rows,TILEMAP_TYPE_PEN,8,8,32*2,32*2);
404   txt_tilemap = tilemap_create(get_tile_info,tilemap_scan_rows,8,8,32*2,32*2);
405405   tilemap_set_transparent_pen(txt_tilemap,0);
406406}
407407
src/mame/drivers/polyplay.c
r1679r1680
245245static WRITE8_HANDLER( polyplay_start_timer2 )
246246{
247247   if (data == 0x03)
248      timer_adjust(polyplay_timer, attotime_never, 0, attotime_never);
248      timer_adjust_oneshot(polyplay_timer, attotime_never, 0);
249249
250250   if (data == 0xb5)
251      timer_adjust(polyplay_timer, ATTOTIME_IN_HZ(40), 0, ATTOTIME_IN_HZ(40));
251      timer_adjust_periodic(polyplay_timer, ATTOTIME_IN_HZ(40), 0, ATTOTIME_IN_HZ(40));
252252}
253253
254254static READ8_HANDLER( polyplay_random_read )
src/mame/drivers/tx1.c
r1679r1680
173173PORT_START_TAG("PPI_PORTC")
174174   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_COIN1 )
175175   PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_COIN2 )
176   PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_SERVICE ) PORT_NAME( DEF_STR( Service_Mode )) PORT_CODE(KEYCODE_F2) PORT_TOGGLE
176   PORT_SERVICE( 0x04, IP_ACTIVE_HIGH )
177177   PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_BUTTON1 ) PORT_NAME("Gear Change") PORT_CODE(KEYCODE_SPACE) PORT_TOGGLE
178178
179179PORT_START_TAG("PPI_PORTD")
r1679r1680
278278   PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_COIN2 )
279279   PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_COIN3 )
280280   PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_BUTTON1 ) PORT_NAME("Gear Change") PORT_CODE(KEYCODE_SPACE) PORT_TOGGLE
281   PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_SERVICE ) PORT_NAME( DEF_STR( Service_Mode )) PORT_CODE(KEYCODE_F2) PORT_TOGGLE
281   PORT_SERVICE( 0x80, IP_ACTIVE_HIGH )
282282
283283PORT_START_TAG("PPI_PORTC")
284284   PORT_DIPNAME( 0xff, 0x80, "Sound PCB Jumper:" )
r1679r1680
362362   PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_COIN2 )
363363   PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_COIN3 )
364364   PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_BUTTON1 ) PORT_NAME("Gear Change") PORT_CODE(KEYCODE_SPACE) PORT_TOGGLE
365   PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_SERVICE ) PORT_NAME( DEF_STR( Service_Mode )) PORT_CODE(KEYCODE_F2) PORT_TOGGLE
365   PORT_SERVICE( 0x80, IP_ACTIVE_HIGH )
366366
367367/* Wire jumper setting on sound PCB */
368368PORT_START_TAG("YM2149_IC19_B")
src/mame/drivers/merit.c
r1679r1680
732732
733733static VIDEO_START( merit )
734734{
735   bg_tilemap = tilemap_create(get_tile_info_bg,tilemap_scan_rows,TILEMAP_TYPE_PEN,8,8,64,32);
735   bg_tilemap = tilemap_create(get_tile_info_bg,tilemap_scan_rows,8,8,64,32);
736736}
737737
738738static VIDEO_UPDATE( merit )
src/mame/drivers/dambustr.c
r1679r1680
201201   MDRV_SCREEN_VISIBLE_AREA(0*8, 32*8-1, 2*8, 30*8-1)
202202   MDRV_GFXDECODE(dambustr)
203203   MDRV_PALETTE_LENGTH(32+2+64+8)      /* 32 for the characters, 2 for the bullets, 64 for the stars, 8 for the background */
204   MDRV_COLORTABLE_LENGTH(8*4)
205204
206205   MDRV_PALETTE_INIT(dambustr)
207206   MDRV_VIDEO_START(dambustr)
src/mame/drivers/pingpong.c
r1679r1680
468468   MDRV_SCREEN_SIZE(32*8, 32*8)
469469   MDRV_SCREEN_VISIBLE_AREA(0*8, 32*8-1, 2*8, 30*8-1)
470470   MDRV_GFXDECODE(pingpong)
471   MDRV_PALETTE_LENGTH(32)
472   MDRV_COLORTABLE_LENGTH(64*4+64*4)
471   MDRV_PALETTE_LENGTH(64*4+64*4)
473472
474473   MDRV_PALETTE_INIT(pingpong)
475474   MDRV_VIDEO_START(pingpong)
r1679r1680
512511
513512   ROM_REGION( 0x0220, REGION_PROMS, 0 )
514513   ROM_LOAD( "pingpong.3j",  0x0000, 0x0020, CRC(3e04f06e) SHA1(a642c350f148e062d56eb2a2fc53c470603000e3) ) /* palette (this might be bad) */
515   ROM_LOAD( "pingpong.11j", 0x0020, 0x0100, CRC(09d96b08) SHA1(81405e33eacc47f91ea4c7221d122f7e6f5b1e5d) ) /* sprites */
516   ROM_LOAD( "pingpong.5h",  0x0120, 0x0100, CRC(8456046a) SHA1(8226f1325c14eb8aed5cd3c3d6bad9f9fd88c5fa) ) /* characters */
514   ROM_LOAD( "pingpong.5h",  0x0020, 0x0100, CRC(8456046a) SHA1(8226f1325c14eb8aed5cd3c3d6bad9f9fd88c5fa) ) /* characters */
515   ROM_LOAD( "pingpong.11j", 0x0120, 0x0100, CRC(09d96b08) SHA1(81405e33eacc47f91ea4c7221d122f7e6f5b1e5d) ) /* sprites */
517516ROM_END
518517
519518ROM_START( merlinmm )
r1679r1680
528527
529528   ROM_REGION( 0x0220, REGION_PROMS, 0 )
530529   ROM_LOAD( "merlinmm.3j",  0x0000, 0x0020, CRC(d56e91f4) SHA1(152d88e4d168f697030d96c02ab9aeb220cc765d) ) /* palette */
531   ROM_LOAD( "pingpong.11j", 0x0020, 0x0100, CRC(09d96b08) SHA1(81405e33eacc47f91ea4c7221d122f7e6f5b1e5d) ) /* sprites */
532   ROM_LOAD( "pingpong.5h",  0x0120, 0x0100, CRC(8456046a) SHA1(8226f1325c14eb8aed5cd3c3d6bad9f9fd88c5fa) ) /* characters */
530   ROM_LOAD( "pingpong.5h",  0x0020, 0x0100, CRC(8456046a) SHA1(8226f1325c14eb8aed5cd3c3d6bad9f9fd88c5fa) ) /* characters */
531   ROM_LOAD( "pingpong.11j", 0x0120, 0x0100, CRC(09d96b08) SHA1(81405e33eacc47f91ea4c7221d122f7e6f5b1e5d) ) /* sprites */
533532ROM_END
534533
535534ROM_START( cashquiz )
r1679r1680
564563
565564   ROM_REGION( 0x0220, REGION_PROMS, 0 )
566565   ROM_LOAD( "cashquiz.3j",  0x0000, 0x0020, CRC(dc70e23b) SHA1(90948f76d5c61eb57838e013aa93d733913a2d92) ) /* palette */
567   ROM_LOAD( "pingpong.11j", 0x0020, 0x0100, CRC(09d96b08) SHA1(81405e33eacc47f91ea4c7221d122f7e6f5b1e5d) ) /* sprites */
568   ROM_LOAD( "pingpong.5h",  0x0120, 0x0100, CRC(8456046a) SHA1(8226f1325c14eb8aed5cd3c3d6bad9f9fd88c5fa) ) /* characters */
566   ROM_LOAD( "pingpong.5h",  0x0020, 0x0100, CRC(8456046a) SHA1(8226f1325c14eb8aed5cd3c3d6bad9f9fd88c5fa) ) /* characters */
567   ROM_LOAD( "pingpong.11j", 0x0120, 0x0100, CRC(09d96b08) SHA1(81405e33eacc47f91ea4c7221d122f7e6f5b1e5d) ) /* sprites */
569568ROM_END
570569
571570static DRIVER_INIT( merlinmm )
r1679r1680
613612}
614613
615614
616GAME( 1985, pingpong, 0, pingpong, pingpong, 0,         ROT0, "Konami", "Ping Pong", 0 )
615GAME( 1985, pingpong, 0, pingpong, pingpong, 0,         ROT0, "Konami", "Konami's Ping-Pong", 0 )
617616GAME( 1986, merlinmm, 0, merlinmm, merlinmm, merlinmm, ROT90,"Zilec - Zenitone", "Merlins Money Maze", 0 )
618617GAME( 1986, cashquiz, 0, merlinmm, cashquiz, cashquiz, ROT0, "Zilec - Zenitone", "Cash Quiz (Type B, Version 5)", GAME_IMPERFECT_GRAPHICS )
src/mame/drivers/tatsumi.c
r1679r1680
364364
365365static INPUT_PORTS_START( apache3 )
366366   PORT_START
367   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_SERVICE ) PORT_NAME( DEF_STR( Service_Mode )) PORT_CODE(KEYCODE_F2)
367   PORT_SERVICE_NO_TOGGLE( 0x01, IP_ACTIVE_LOW )
368368   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_NAME( "Trigger" )
369369   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_BUTTON3 ) PORT_NAME( "Power" )
370370   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_COIN1 )
r1679r1680
440440   PORT_BIT( 0x0080, IP_ACTIVE_LOW, IPT_UNKNOWN )
441441
442442   PORT_START
443   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_SERVICE ) PORT_NAME( DEF_STR( Service_Mode )) PORT_CODE(KEYCODE_F2)
443   PORT_SERVICE_NO_TOGGLE( 0x01, IP_ACTIVE_LOW )
444444   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_COIN1 )
445445   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_COIN2 )
446446   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_SERVICE1 )
src/mame/drivers/retofinv.c
r1679r1680
356356
357357static GFXDECODE_START( retofinv )
358358   GFXDECODE_ENTRY( REGION_GFX1, 0, charlayout,             0, 256 )
359   GFXDECODE_ENTRY( REGION_GFX2, 0, bglayout,     64*16+256*2,  64 )
360   GFXDECODE_ENTRY( REGION_GFX3, 0, spritelayout,       256*2,  64 )
359   GFXDECODE_ENTRY( REGION_GFX2, 0, spritelayout,       256*2,  64 )
360   GFXDECODE_ENTRY( REGION_GFX3, 0, bglayout,     64*16+256*2,  64 )
361361GFXDECODE_END
362362
363363
r1679r1680
390390   MDRV_SCREEN_SIZE(36*8, 28*8)
391391   MDRV_SCREEN_VISIBLE_AREA(0*8, 36*8-1, 0*8, 28*8-1)
392392   MDRV_GFXDECODE(retofinv)
393   MDRV_PALETTE_LENGTH(256)
394   MDRV_COLORTABLE_LENGTH(256*2+64*16+64*16)
393   MDRV_PALETTE_LENGTH(256*2+64*16+64*16)
395394
396395   MDRV_PALETTE_INIT(retofinv)
397396   MDRV_VIDEO_START(retofinv)
r1679r1680
442441   ROM_REGION( 0x02000, REGION_GFX1, ROMREGION_DISPOSE )
443442   ROM_LOAD( "a37-16.61", 0x0000, 0x2000, CRC(4e3f501c) SHA1(2d832f4038ae65bfdeedfab870f6f1176ec6b676) )
444443
445   ROM_REGION( 0x04000, REGION_GFX2, ROMREGION_DISPOSE )
446   ROM_LOAD( "a37-14.55", 0x0000, 0x2000, CRC(ef7f8651) SHA1(2d91057501e5e9c4255e0d55fff0d99c2a5be7e8) )
447   ROM_LOAD( "a37-15.56", 0x2000, 0x2000, CRC(03b40905) SHA1(c10d87796e8a6e6a2a37c6fb713821cc87299cc8) )
448
449   ROM_REGION( 0x08000, REGION_GFX3, ROMREGION_DISPOSE )
444   ROM_REGION( 0x08000, REGION_GFX2, ROMREGION_DISPOSE )
450445   ROM_LOAD( "a37-10.8",  0x0000, 0x2000, CRC(6afdeec8) SHA1(782fe0a8aea48c3c270318b7ba011fc6fce0db7a) )
451446   ROM_LOAD( "a37-11.9",  0x2000, 0x2000, CRC(d3dc9da3) SHA1(0d98d6e993b5a4845a23802751023b7a593dce29) )
452447   ROM_LOAD( "a37-12.10", 0x4000, 0x2000, CRC(d10b2eed) SHA1(3809a0adf935a119f9ee0d4c24f1456c35d2a6fa) )
453448   ROM_LOAD( "a37-13.11", 0x6000, 0x2000, CRC(00ca6b3d) SHA1(08ce5b13d5ebc79cc803949f4ba9e630e6cd92b8) )
454449
450   ROM_REGION( 0x04000, REGION_GFX3, ROMREGION_DISPOSE )
451   ROM_LOAD( "a37-14.55", 0x0000, 0x2000, CRC(ef7f8651) SHA1(2d91057501e5e9c4255e0d55fff0d99c2a5be7e8) )
452   ROM_LOAD( "a37-15.56", 0x2000, 0x2000, CRC(03b40905) SHA1(c10d87796e8a6e6a2a37c6fb713821cc87299cc8) )
453
455454   ROM_REGION( 0x0b00, REGION_PROMS, 0 )
456455   ROM_LOAD( "a37-06.13", 0x0000, 0x0100, CRC(e9643b8b) SHA1(7bbb92a42e7c3effb701fc7b2c24f2470f31b063) )   /* palette red bits  */
457456   ROM_LOAD( "a37-07.4",  0x0100, 0x0100, CRC(e8f34e11) SHA1(8f438561b8d46ffff00747ed8baf0ebb6a081615) )   /* palette green bits */
r1679r1680
474473   ROM_REGION( 0x02000, REGION_GFX1, ROMREGION_DISPOSE )
475474   ROM_LOAD( "a37-16.61", 0x0000, 0x2000, CRC(4e3f501c) SHA1(2d832f4038ae65bfdeedfab870f6f1176ec6b676) )
476475
477   ROM_REGION( 0x04000, REGION_GFX2, ROMREGION_DISPOSE )
478   ROM_LOAD( "a37-14.55", 0x0000, 0x2000, CRC(ef7f8651) SHA1(2d91057501e5e9c4255e0d55fff0d99c2a5be7e8) )
479   ROM_LOAD( "a37-15.56", 0x2000, 0x2000, CRC(03b40905) SHA1(c10d87796e8a6e6a2a37c6fb713821cc87299cc8) )
480
481   ROM_REGION( 0x08000, REGION_GFX3, ROMREGION_DISPOSE )
476   ROM_REGION( 0x08000, REGION_GFX2, ROMREGION_DISPOSE )
482477   ROM_LOAD( "a37-10.8",  0x0000, 0x2000, CRC(6afdeec8) SHA1(782fe0a8aea48c3c270318b7ba011fc6fce0db7a) )
483478   ROM_LOAD( "a37-11.9",  0x2000, 0x2000, CRC(d3dc9da3) SHA1(0d98d6e993b5a4845a23802751023b7a593dce29) )
484479   ROM_LOAD( "a37-12.10", 0x4000, 0x2000, CRC(d10b2eed) SHA1(3809a0adf935a119f9ee0d4c24f1456c35d2a6fa) )
485480   ROM_LOAD( "a37-13.11", 0x6000, 0x2000, CRC(00ca6b3d) SHA1(08ce5b13d5ebc79cc803949f4ba9e630e6cd92b8) )
486481
482   ROM_REGION( 0x04000, REGION_GFX3, ROMREGION_DISPOSE )
483   ROM_LOAD( "a37-14.55", 0x0000, 0x2000, CRC(ef7f8651) SHA1(2d91057501e5e9c4255e0d55fff0d99c2a5be7e8) )
484   ROM_LOAD( "a37-15.56", 0x2000, 0x2000, CRC(03b40905) SHA1(c10d87796e8a6e6a2a37c6fb713821cc87299cc8) )
485
487486   ROM_REGION( 0x0b00, REGION_PROMS, 0 )
488487   ROM_LOAD( "a37-06.13", 0x0000, 0x0100, CRC(e9643b8b) SHA1(7bbb92a42e7c3effb701fc7b2c24f2470f31b063) )   /* palette red bits  */
489488   ROM_LOAD( "a37-07.4",  0x0100, 0x0100, CRC(e8f34e11) SHA1(8f438561b8d46ffff00747ed8baf0ebb6a081615) )   /* palette green bits */
r1679r1680
506505   ROM_REGION( 0x02000, REGION_GFX1, ROMREGION_DISPOSE )
507506   ROM_LOAD( "a37-16.61", 0x0000, 0x2000, CRC(4e3f501c) SHA1(2d832f4038ae65bfdeedfab870f6f1176ec6b676) )
508507
509   ROM_REGION( 0x04000, REGION_GFX2, ROMREGION_DISPOSE )
510   ROM_LOAD( "a37-14.55", 0x0000, 0x2000, CRC(ef7f8651) SHA1(2d91057501e5e9c4255e0d55fff0d99c2a5be7e8) )
511   ROM_LOAD( "a37-15.56", 0x2000, 0x2000, CRC(03b40905) SHA1(c10d87796e8a6e6a2a37c6fb713821cc87299cc8) )
512
513   ROM_REGION( 0x08000, REGION_GFX3, ROMREGION_DISPOSE )
508   ROM_REGION( 0x08000, REGION_GFX2, ROMREGION_DISPOSE )
514509   ROM_LOAD( "a37-10.8",  0x0000, 0x2000, CRC(6afdeec8) SHA1(782fe0a8aea48c3c270318b7ba011fc6fce0db7a) )
515510   ROM_LOAD( "a37-11.9",  0x2000, 0x2000, CRC(d3dc9da3) SHA1(0d98d6e993b5a4845a23802751023b7a593dce29) )
516511   ROM_LOAD( "a37-12.10", 0x4000, 0x2000, CRC(d10b2eed) SHA1(3809a0adf935a119f9ee0d4c24f1456c35d2a6fa) )
517512   ROM_LOAD( "a37-13.11", 0x6000, 0x2000, CRC(00ca6b3d) SHA1(08ce5b13d5ebc79cc803949f4ba9e630e6cd92b8) )
518513
514   ROM_REGION( 0x04000, REGION_GFX3, ROMREGION_DISPOSE )
515   ROM_LOAD( "a37-14.55", 0x0000, 0x2000, CRC(ef7f8651) SHA1(2d91057501e5e9c4255e0d55fff0d99c2a5be7e8) )
516   ROM_LOAD( "a37-15.56", 0x2000, 0x2000, CRC(03b40905) SHA1(c10d87796e8a6e6a2a37c6fb713821cc87299cc8) )
517
519518   ROM_REGION( 0x0b00, REGION_PROMS, 0 )
520519   ROM_LOAD( "a37-06.13", 0x0000, 0x0100, CRC(e9643b8b) SHA1(7bbb92a42e7c3effb701fc7b2c24f2470f31b063) )   /* palette red bits  */
521520   ROM_LOAD( "a37-07.4",  0x0100, 0x0100, CRC(e8f34e11) SHA1(8f438561b8d46ffff00747ed8baf0ebb6a081615) )   /* palette green bits */
src/mame/drivers/megaplay.c
r1679r1680
126126    PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_UNKNOWN ) PORT_NAME("0x6400 bit 4") PORT_CODE(KEYCODE_T) \
127127    PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_UNKNOWN ) PORT_NAME("0x6400 bit 5") PORT_CODE(KEYCODE_Y) \
128128   PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_UNKNOWN ) PORT_NAME("0x6400 bit 6") PORT_CODE(KEYCODE_U) \
129   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_SERVICE ) PORT_NAME(DEF_STR( Test )) PORT_CODE(KEYCODE_F2)
129   PORT_SERVICE_NO_TOGGLE( 0x80, IP_ACTIVE_LOW )
130130
131131#define MEGAPLAY_COIN \
132132   PORT_START \
r1679r1680
184184   MEGAPLAY_COIN
185185   MEGAPLAY_DSWA
186186   MEGAPLAY_DSWB
187
188187INPUT_PORTS_END
189188
190189static INPUT_PORTS_START ( mp_sonic )
r1679r1680
201200    PORT_DIPSETTING( 0x01, "3" )
202201    PORT_DIPSETTING( 0x02, "2" )
203202    PORT_DIPSETTING( 0x03, "1" )
204
205203   PORT_DIPNAME( 0x0c, 0x0c, DEF_STR( Difficulty ) ) PORT_DIPLOCATION("SW3:3,4")
206204    PORT_DIPSETTING( 0x00, DEF_STR( Hardest ) )
207205    PORT_DIPSETTING( 0x04, DEF_STR( Hard ) )
r1679r1680
212210//  PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_UNKNOWN ) PORT_NAME("0x6201 bit 5") PORT_CODE(KEYCODE_H)
213211//  PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNKNOWN ) PORT_NAME("0x6201 bit 6") PORT_CODE(KEYCODE_J)
214212//  PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNKNOWN ) PORT_NAME("0x6201 bit 7") PORT_CODE(KEYCODE_K)
215
216213INPUT_PORTS_END
217214
218215static INPUT_PORTS_START ( mp_gaxe2 )
r1679r1680
227224   PORT_DIPNAME( 0x01, 0x01, DEF_STR( Difficulty ) ) PORT_DIPLOCATION("SW3:1")
228225    PORT_DIPSETTING( 0x01, DEF_STR( Normal ) )
229226    PORT_DIPSETTING( 0x00, DEF_STR( Hard ) )
230
231227   PORT_DIPNAME( 0x02, 0x00, "Life" ) PORT_DIPLOCATION("SW3:2")
232228    PORT_DIPSETTING( 0x02, "1" )
233229    PORT_DIPSETTING( 0x00, "2" )
234
235230   PORT_DIPNAME( 0x04, 0x04, "Initial Players" ) PORT_DIPLOCATION("SW3:3")
236231    PORT_DIPSETTING( 0x00, "1" )
237232    PORT_DIPSETTING( 0x04, "2" )
238
239233   PORT_DIPNAME( 0x08, 0x00, "Timer" ) PORT_DIPLOCATION("SW3:4")
240234    PORT_DIPSETTING( 0x08, DEF_STR( Off )  )
241235    PORT_DIPSETTING( 0x00, DEF_STR( On ) )
242
243236    // Who knows...
244237//  PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_UNKNOWN ) PORT_NAME("0x6201 bit 4") PORT_CODE(KEYCODE_G)
245238//  PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_UNKNOWN ) PORT_NAME("0x6201 bit 5") PORT_CODE(KEYCODE_H)
246239//  PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNKNOWN ) PORT_NAME("0x6201 bit 6") PORT_CODE(KEYCODE_J)
247240//  PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNKNOWN ) PORT_NAME("0x6201 bit 7") PORT_CODE(KEYCODE_K)
248
249241INPUT_PORTS_END
250242
251243static INPUT_PORTS_START ( mp_col3 )
r1679r1680
260252   PORT_DIPNAME( 0x01, 0x01, DEF_STR( Language ) ) PORT_DIPLOCATION("SW3:1")
261253    PORT_DIPSETTING( 0x01, DEF_STR( English ) )
262254    PORT_DIPSETTING( 0x00, DEF_STR( Japanese ) )
263
264255   PORT_DIPNAME( 0x02, 0x02, "2P Mode Games" ) PORT_DIPLOCATION("SW3:2")
265256    PORT_DIPSETTING( 0x02, "1" )
266257    PORT_DIPSETTING( 0x00, "3" )
267
268258   PORT_DIPNAME( 0x0c, 0x0c, "Speed / Difficulty" ) PORT_DIPLOCATION("SW3:3,4")
269259    PORT_DIPSETTING( 0x08, "Slow"  )
270260    PORT_DIPSETTING( 0x0c, "Middle"  )
271261    PORT_DIPSETTING( 0x04, "Fast"  )
272262    PORT_DIPSETTING( 0x00, "Max"  )
273
274263    // Who knows...
275264//  PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_UNKNOWN ) PORT_NAME("0x6201 bit 4") PORT_CODE(KEYCODE_G)
276265//  PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_UNKNOWN ) PORT_NAME("0x6201 bit 5") PORT_CODE(KEYCODE_H)
277266//  PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNKNOWN ) PORT_NAME("0x6201 bit 6") PORT_CODE(KEYCODE_J)
278267//  PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNKNOWN ) PORT_NAME("0x6201 bit 7") PORT_CODE(KEYCODE_K)
279
280268INPUT_PORTS_END
281269
282270static INPUT_PORTS_START ( mp_twc )
r1679r1680
291279   PORT_DIPNAME( 0x01, 0x01, "Time" ) PORT_DIPLOCATION("SW3:1")
292280    PORT_DIPSETTING( 0x01, DEF_STR( Normal ) )
293281    PORT_DIPSETTING( 0x00, "Short" )
294
295282   PORT_DIPNAME( 0x0e, 0x08, "Level" ) PORT_DIPLOCATION("SW3:2,3,4")
296283    PORT_DIPSETTING( 0x00, "0" )
297284    PORT_DIPSETTING( 0x02, "0" )
r1679r1680
301288    PORT_DIPSETTING( 0x0a, "2" )
302289    PORT_DIPSETTING( 0x0c, "1" )
303290    PORT_DIPSETTING( 0x0e, "0" )
304
305291INPUT_PORTS_END
306292
307293static INPUT_PORTS_START ( mp_sor2 )
r1679r1680
318304    PORT_DIPSETTING( 0x01, "3" )
319305    PORT_DIPSETTING( 0x02, "2" )
320306    PORT_DIPSETTING( 0x03, "1" )
321
322307   PORT_DIPNAME( 0xc, 0x0c, DEF_STR ( Difficulty ) ) PORT_DIPLOCATION("SW3:3,4")
323308    PORT_DIPSETTING( 0x00, DEF_STR ( Hardest ) )
324309    PORT_DIPSETTING( 0x04, DEF_STR ( Hard ) )
325310    PORT_DIPSETTING( 0x08, DEF_STR ( Easy ) )
326311    PORT_DIPSETTING( 0x0c, DEF_STR ( Normal ) )
327
328312INPUT_PORTS_END
329313
330314static INPUT_PORTS_START ( mp_bio )
r1679r1680
341325    PORT_DIPSETTING( 0x01, "4" )
342326    PORT_DIPSETTING( 0x02, "2" )
343327    PORT_DIPSETTING( 0x03, "3" )
344
345328   PORT_DIPNAME( 0xc, 0x0c, DEF_STR ( Difficulty ) ) PORT_DIPLOCATION("SW3:3,4")
346329    PORT_DIPSETTING( 0x00, DEF_STR ( Hardest ) )
347330    PORT_DIPSETTING( 0x04, DEF_STR ( Hard ) )
348331    PORT_DIPSETTING( 0x08, DEF_STR ( Easy ) )
349332    PORT_DIPSETTING( 0x0c, DEF_STR ( Normal ) )
350
351333INPUT_PORTS_END
352334
353335static INPUT_PORTS_START ( mp_gslam )
r1679r1680
368350    PORT_DIPSETTING( 0x05, "2:30" )
369351    PORT_DIPSETTING( 0x06, "2:00" )
370352    PORT_DIPSETTING( 0x07, "1:30" )
371
372
373353   PORT_DIPNAME( 0x08, 0x08, "2P-Play Continue" ) PORT_DIPLOCATION("SW3:4")
374354    PORT_DIPSETTING( 0x00, "1 Credit" )
375355    PORT_DIPSETTING( 0x08, "2 Credits" )
376
377356INPUT_PORTS_END
378357
379358static INPUT_PORTS_START ( mp_mazin )
r1679r1680
388367   PORT_DIPNAME( 0x01, 0x01, "Initial Player" ) PORT_DIPLOCATION("SW3:1")
389368    PORT_DIPSETTING( 0x01, "2" )
390369    PORT_DIPSETTING( 0x00, "1" )
391
392370   PORT_DIPNAME( 0x02, 0x02, "Initial Player" ) PORT_DIPLOCATION("SW3:2")
393371    PORT_DIPSETTING( 0x02, "1" )
394372    PORT_DIPSETTING( 0x00, "4" )
395
396373   PORT_DIPNAME( 0x04, 0x04, DEF_STR ( Difficulty ) ) PORT_DIPLOCATION("SW3:3")
397374    PORT_DIPSETTING( 0x04, DEF_STR ( Hard ) )
398375    PORT_DIPSETTING( 0x00, DEF_STR ( Normal ) )
399
400376   PORT_DIPNAME( 0x08, 0x08, "Title" ) PORT_DIPLOCATION("SW3:4")
401377    PORT_DIPSETTING( 0x08, "EUROPE" )
402378    PORT_DIPSETTING( 0x00, "U.S.A" )
403
404379INPUT_PORTS_END
405380
406381static INPUT_PORTS_START ( mp_soni2 )
r1679r1680
417392    PORT_DIPSETTING( 0x01, "3" )
418393    PORT_DIPSETTING( 0x02, "2" )
419394    PORT_DIPSETTING( 0x03, "1" )
420
421395   PORT_DIPNAME( 0x0c, 0x0c, "Initial Players (Dual mode)" ) PORT_DIPLOCATION("SW3:3,4")
422396    PORT_DIPSETTING( 0x00, "4" )
423397    PORT_DIPSETTING( 0x04, "2" )
424398    PORT_DIPSETTING( 0x08, "1" )
425399    PORT_DIPSETTING( 0x0c, "3" )
426
427400INPUT_PORTS_END
428401
429402/*MEGAPLAY specific*/
src/mame/drivers/m72.c
r1679r1680
9999{
100100   m72_irq_base = 0x20;
101101   MACHINE_RESET_CALL(m72_sound);
102   timer_adjust(scanline_timer, video_screen_get_time_until_pos(0, 0, 0), 0, attotime_never);
102   timer_adjust_oneshot(scanline_timer, video_screen_get_time_until_pos(0, 0, 0), 0);
103103}
104104
105105static MACHINE_RESET( xmultipl )
106106{
107107   m72_irq_base = 0x08;
108108   MACHINE_RESET_CALL(m72_sound);
109   timer_adjust(scanline_timer, video_screen_get_time_until_pos(0, 0, 0), 0, attotime_never);
109   timer_adjust_oneshot(scanline_timer, video_screen_get_time_until_pos(0, 0, 0), 0);
110110}
111111
112112static MACHINE_RESET( kengo )
113113{
114114   m72_irq_base = 0x18;
115115   MACHINE_RESET_CALL(m72_sound);
116   timer_adjust(scanline_timer, video_screen_get_time_until_pos(0, 0, 0), 0, attotime_never);
116   timer_adjust_oneshot(scanline_timer, video_screen_get_time_until_pos(0, 0, 0), 0);
117117}
118118
119119static TIMER_CALLBACK( m72_scanline_interrupt )
r1679r1680
137137   /* adjust for next scanline */
138138   if (++scanline >= machine->screen[0].height)
139139      scanline = 0;
140   timer_adjust(scanline_timer, video_screen_get_time_until_pos(0, scanline, 0), scanline, attotime_never);
140   timer_adjust_oneshot(scanline_timer, video_screen_get_time_until_pos(0, scanline, 0), scanline);
141141}
142142
143143
src/mame/drivers/r2dtank.c
r1679r1680
3535#include "rescap.h"
3636#include "machine/6821pia.h"
3737#include "machine/74123.h"
38#include "video/crtc6845.h"
38#include "video/mc6845.h"
3939#include "cpu/m6800/m6800.h"
4040#include "cpu/m6809/m6809.h"
4141#include "sound/ay8910.h"
r1679r1680
4848#define CRTC_CLOCK            (MAIN_CPU_MASTER_CLOCK / 16)
4949
5050
51static mc6845_t *mc6845;
5152static UINT8 *r2dtank_videoram;
5253static UINT8 *r2dtank_colorram;
5354static UINT8 flipscreen;
r1679r1680
303304#define NUM_PENS   (8)
304305
305306
307static WRITE8_HANDLER( r2dtank_mc6845_address_w )
308{
309   mc6845_address_w(mc6845, data);
310}
311
312
313static WRITE8_HANDLER( r2dtank_mc6845_register_w )
314{
315   mc6845_register_w(mc6845, data);
316}
317
318
306319static WRITE8_HANDLER( flipscreen_w )
307320{
308321   flipscreen = !data;
309322}
310323
311324
312static void *begin_update(running_machine *machine, int screen,
313                    mame_bitmap *bitmap, const rectangle *cliprect)
325static void *begin_update(mame_bitmap *bitmap, const rectangle *cliprect)
314326{
315327   /* create the pens */
316328   offs_t i;
r1679r1680
381393}
382394
383395
384static const crtc6845_interface crtc6845_intf =
396static const mc6845_interface mc6845_intf =
385397{
386398   0,                  /* screen we are acting on */
387399   CRTC_CLOCK,          /* the clock (pin 21) of the chip */
r1679r1680
396408static VIDEO_START( r2dtank )
397409{
398410   /* configure the CRT controller */
399   crtc6845_config(0, &crtc6845_intf);
411   mc6845 = mc6845_config(&mc6845_intf);
400412}
401413
402414
415static VIDEO_UPDATE( r2dtank )
416{
417   mc6845_update(mc6845, bitmap, cliprect);
403418
419   return 0;
420}
421
422
423
404424/*************************************
405425 *
406426 *  Memory handlers
r1679r1680
420440   AM_RANGE(0x6000, 0x7fff) AM_RAM
421441   AM_RANGE(0x8000, 0x8003) AM_READWRITE(pia_0_r, pia_comp_0_w)
422442   AM_RANGE(0x8004, 0x8004) AM_READWRITE(audio_answer_r, audio_command_w)
423   AM_RANGE(0xb000, 0xb000) AM_WRITE(crtc6845_address_w)
424   AM_RANGE(0xb001, 0xb001) AM_WRITE(crtc6845_register_w)
443   AM_RANGE(0xb000, 0xb000) AM_WRITE(r2dtank_mc6845_address_w)
444   AM_RANGE(0xb001, 0xb001) AM_WRITE(r2dtank_mc6845_register_w)
425445   AM_RANGE(0xc000, 0xc007) AM_RAM AM_BASE(&generic_nvram) AM_SIZE(&generic_nvram_size)
426446   AM_RANGE(0xc800, 0xffff) AM_ROM
427447ADDRESS_MAP_END
r1679r1680
540560   /* video hardware */
541561   MDRV_VIDEO_ATTRIBUTES(VIDEO_TYPE_RASTER)
542562   MDRV_VIDEO_START(r2dtank)
543   MDRV_VIDEO_UPDATE(crtc6845)
563   MDRV_VIDEO_UPDATE(r2dtank)
544564
545565   MDRV_SCREEN_ADD("main", 0)
546566   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_RGB32)
src/mame/drivers/ohmygod.c
r1679r1680
105105   PORT_BIT( 0x0040, IP_ACTIVE_LOW, IPT_UNKNOWN )
106106   PORT_BIT( 0x0080, IP_ACTIVE_LOW, IPT_START1 )
107107   PORT_BIT( 0x0100, IP_ACTIVE_LOW, IPT_COIN1 )
108   PORT_BIT(0x0200, IP_ACTIVE_LOW, IPT_SERVICE ) PORT_NAME( DEF_STR( Service_Mode )) PORT_CODE(KEYCODE_F2)
108   PORT_SERVICE_NO_TOGGLE( 0x0200, IP_ACTIVE_LOW )
109109   PORT_BIT( 0x0400, IP_ACTIVE_LOW, IPT_UNKNOWN )
110110   PORT_BIT( 0x0800, IP_ACTIVE_LOW, IPT_UNKNOWN )
111111   PORT_BIT( 0x1000, IP_ACTIVE_LOW, IPT_UNKNOWN )
r1679r1680
205205   PORT_BIT( 0x0040, IP_ACTIVE_LOW, IPT_UNKNOWN )
206206   PORT_BIT( 0x0080, IP_ACTIVE_LOW, IPT_START1 )
207207   PORT_BIT( 0x0100, IP_ACTIVE_LOW, IPT_COIN1 )
208   PORT_BIT(0x0200, IP_ACTIVE_LOW, IPT_SERVICE ) PORT_NAME( DEF_STR( Service_Mode )) PORT_CODE(KEYCODE_F2)
208   PORT_SERVICE_NO_TOGGLE( 0x0200, IP_ACTIVE_LOW )
209209   PORT_BIT( 0x0400, IP_ACTIVE_LOW, IPT_UNKNOWN )
210210   PORT_BIT( 0x0800, IP_ACTIVE_LOW, IPT_UNKNOWN )
211211   PORT_BIT( 0x1000, IP_ACTIVE_LOW, IPT_UNKNOWN )
src/mame/drivers/madalien.c
r1679r1680
88
99#include "driver.h"
1010#include "deprecat.h"
11#include "video/crtc6845.h"
11#include "video/mc6845.h"
1212#include "sound/ay8910.h"
1313
1414#define MAIN_CLOCK 10595000
r1679r1680
3030static UINT8 madalien_shift_count;
3131static UINT8 madalien_shift_data;
3232
33static mc6845_t *mc6845;
34
3335static tilemap* tilemap_fg;
3436
3537static tilemap* tilemap_edge1[4];
r1679r1680
8587}
8688
8789
90static WRITE8_HANDLER( madalien_mc6845_address_w )
91{
92   mc6845_address_w(mc6845, data);
93}
94
95static READ8_HANDLER( madalien_mc6845_register_r )
96{
97   return mc6845_register_r(mc6845);
98}
99
100static WRITE8_HANDLER( madalien_mc6845_register_w )
101{
102   mc6845_register_w(mc6845, data);
103}
104
105
88106static void update_edges(int area)
89107{
90108   UINT8* map = memory_region(REGION_GFX2) + 0x200 * area;
r1679r1680
161179{
162180   rectangle rect = { 0, 127, 0, 127 };
163181
164   static const crtc6845_interface crtc6845_intf =
182   static const mc6845_interface mc6845_intf =
165183   {
166184      0,                /* screen we are acting on */
167185      PIXEL_CLOCK / 8,  /* the clock of the chip  */
r1679r1680
172190      NULL              /* call back for display state changes */
173191   };
174192
175   crtc6845_config(0, &crtc6845_intf);
193   mc6845 = mc6845_config(&mc6845_intf);
176194
177195   tilemap_fg = tilemap_create(get_tile_info_FG,
178      tilemap_scan_cols_flip_x, TILEMAP_TYPE_PEN, 8, 8, 32, 32);
196      tilemap_scan_cols_flip_x, 8, 8, 32, 32);
179197
180198   tilemap_set_transparent_pen(tilemap_fg, 0);
181199
182200   tilemap_edge1[0] = tilemap_create(get_tile_info_BG,
183      scan_mode0, TILEMAP_TYPE_PEN, 16, 16, 16, 8);
201      scan_mode0, 16, 16, 16, 8);
184202   tilemap_edge1[1] = tilemap_create(get_tile_info_BG,
185      scan_mode1, TILEMAP_TYPE_PEN, 16, 16, 16, 8);
203      scan_mode1, 16, 16, 16, 8);
186204   tilemap_edge1[2] = tilemap_create(get_tile_info_BG,
187      scan_mode2, TILEMAP_TYPE_PEN, 16, 16, 32, 8);
205      scan_mode2, 16, 16, 32, 8);
188206   tilemap_edge1[3] = tilemap_create(get_tile_info_BG,
189      scan_mode3, TILEMAP_TYPE_PEN, 16, 16, 32, 8);
207      scan_mode3, 16, 16, 32, 8);
190208
191209   tilemap_edge2[0] = tilemap_create(get_tile_info_BG,
192      scan_mode0, TILEMAP_TYPE_PEN, 16, 16, 16, 8);
210      scan_mode0, 16, 16, 16, 8);
193211   tilemap_edge2[1] = tilemap_create(get_tile_info_BG,
194      scan_mode1, TILEMAP_TYPE_PEN, 16, 16, 16, 8);
212      scan_mode1, 16, 16, 16, 8);
195213   tilemap_edge2[2] = tilemap_create(get_tile_info_BG,
196      scan_mode2, TILEMAP_TYPE_PEN, 16, 16, 32, 8);
214      scan_mode2, 16, 16, 32, 8);
197215   tilemap_edge2[3] = tilemap_create(get_tile_info_BG,
198      scan_mode3, TILEMAP_TYPE_PEN, 16, 16, 32, 8);
216      scan_mode3, 16, 16, 32, 8);
199217
200218   update_edges(0);
201219
r1679r1680
497515   AM_RANGE(0x6400, 0x67ff) AM_RAM
498516   AM_RANGE(0x6800, 0x7fff) AM_RAM AM_BASE(&madalien_charram)
499517
500   AM_RANGE(0x8000, 0x8000) AM_MIRROR(0x0ff0) AM_WRITE(crtc6845_address_w)
501   AM_RANGE(0x8001, 0x8001) AM_MIRROR(0x0ff0) AM_READWRITE(crtc6845_register_r, crtc6845_register_w)
518   AM_RANGE(0x8000, 0x8000) AM_MIRROR(0x0ff0) AM_WRITE(madalien_mc6845_address_w)
519   AM_RANGE(0x8001, 0x8001) AM_MIRROR(0x0ff0) AM_READWRITE(madalien_mc6845_register_r, madalien_mc6845_register_w)
502520   AM_RANGE(0x8004, 0x8004) AM_MIRROR(0x0ff0) AM_WRITE(madalien_screen_control_w)
503521   AM_RANGE(0x8005, 0x8005) AM_MIRROR(0x0ff0) AM_WRITE(madalien_output_w)
504522   AM_RANGE(0x8006, 0x8006) AM_MIRROR(0x0ff0) AM_READWRITE(soundlatch2_r, madalien_sound_command_w)
src/mame/drivers/igs_180.c
r1679r1680
1818
1919static VIDEO_START(igs_180)
2020{
21   fg_tilemap = tilemap_create(get_fg_tile_info,tilemap_scan_rows,TILEMAP_TYPE_PEN,8,8,64,32);
21   fg_tilemap = tilemap_create(get_fg_tile_info,tilemap_scan_rows,8,8,64,32);
2222}
2323
2424static VIDEO_UPDATE(igs_180)
src/mame/drivers/aeroboto.c
r1679r1680
22
33Formation Z / Aeroboto
44
5PCB ID: JALECO FZ-8420
6
57Driver by Carlos A. Lozano
68
7
89TODO:
910- star field
1011  Uki's report:
r1679r1680
253254static MACHINE_DRIVER_START( formatz )
254255
255256   /* basic machine hardware */
256   MDRV_CPU_ADD(M6809, 1250000) // 1.25MHz
257   MDRV_CPU_ADD(M6809, XTAL_10MHz/8) /* verified on pcb */
257258   MDRV_CPU_PROGRAM_MAP(readmem,writemem)
258259   MDRV_CPU_VBLANK_INT(aeroboto_interrupt,1)
259260
260   MDRV_CPU_ADD(M6809, 640000)
261   MDRV_CPU_ADD(M6809, XTAL_10MHz/16) /* verified on pcb */
261262   /* audio CPU */
262263   MDRV_CPU_PROGRAM_MAP(readmem_sound,writemem_sound)
263264   MDRV_CPU_VBLANK_INT(irq0_line_hold,1)
r1679r1680
281282   /* sound hardware */
282283   MDRV_SPEAKER_STANDARD_MONO("mono")
283284
284   MDRV_SOUND_ADD(AY8910, 1500000)
285   MDRV_SOUND_ADD(AY8910, XTAL_10MHz/8) /* verified on pcb */
285286   MDRV_SOUND_CONFIG(ay8910_interface)
286287   MDRV_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.25)
287288
288   MDRV_SOUND_ADD(AY8910, 1500000)
289   MDRV_SOUND_ADD(AY8910, XTAL_10MHz/16) /* verified on pcb */
289290   MDRV_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.25)
290291MACHINE_DRIVER_END
291292
src/mame/drivers/konamigv.c
r1679r1680
395395   PORT_BIT( 0x00000200, IP_ACTIVE_LOW, IPT_START1 )
396396   PORT_BIT( 0x00000400, IP_ACTIVE_LOW, IPT_COIN1 )
397397   PORT_BIT( 0x00000800, IP_ACTIVE_LOW, IPT_SERVICE1 )
398   PORT_BIT( 0x00001000, IP_ACTIVE_LOW, IPT_OTHER ) PORT_NAME("Test Switch") PORT_CODE(KEYCODE_F2)
398   PORT_SERVICE_NO_TOGGLE( 0x00001000, IP_ACTIVE_LOW )
399399   PORT_BIT( 0x00002000, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM( eeprom_bit_r, 0 )
400400   PORT_BIT( 0x00004000, IP_ACTIVE_LOW, IPT_UNKNOWN )
401401   PORT_BIT( 0x00008000, IP_ACTIVE_LOW, IPT_UNKNOWN )
src/mame/drivers/rmhaihai.c
r1679r1680
5959static VIDEO_START( rmhaihai )
6060{
6161   bg_tilemap = tilemap_create(get_bg_tile_info, tilemap_scan_rows,
62      TILEMAP_TYPE_PEN, 8, 8, 64, 32);
62      8, 8, 64, 32);
6363}
6464
6565static VIDEO_UPDATE( rmhaihai )
src/mame/drivers/zr107.c
r1679r1680
9191
9292static VIDEO_UPDATE( jetwave )
9393{
94   fillbitmap(bitmap, machine->remapped_colortable[0], cliprect);
94   fillbitmap(bitmap, machine->pens[0], cliprect);
9595
9696   K001604_tile_update(machine, 0);
9797   K001005_draw(bitmap, cliprect);
r1679r1680
138138
139139static VIDEO_UPDATE( zr107 )
140140{
141   fillbitmap(bitmap, machine->remapped_colortable[0], cliprect);
141   fillbitmap(bitmap, machine->pens[0], cliprect);
142142
143143   K056832_set_LayerOffset(0, -29, -27);
144144   K056832_set_LayerOffset(1, -29, -27);
r1679r1680
427427   PORT_BIT( 0xff, IP_ACTIVE_HIGH, IPT_UNKNOWN )
428428
429429   PORT_START
430   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_SERVICE ) PORT_NAME( DEF_STR( Service_Mode )) PORT_CODE(KEYCODE_F2)
430   PORT_SERVICE_NO_TOGGLE( 0x80, IP_ACTIVE_LOW )
431431   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_SERVICE1 ) PORT_NAME("Service Button") PORT_CODE(KEYCODE_8)
432432   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_COIN1 )
433433   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_COIN2 )
r1679r1680
470470   PORT_BIT( 0xff, IP_ACTIVE_HIGH, IPT_UNKNOWN )
471471
472472   PORT_START
473   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_SERVICE ) PORT_NAME( DEF_STR( Service_Mode )) PORT_CODE(KEYCODE_F2)
473   PORT_SERVICE_NO_TOGGLE( 0x80, IP_ACTIVE_LOW )
474474   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_SERVICE1 ) PORT_NAME("Service Button") PORT_CODE(KEYCODE_8)
475475   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_COIN1 )
476476   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_COIN2 )
r1679r1680
513513   PORT_BIT( 0xff, IP_ACTIVE_HIGH, IPT_UNKNOWN )
514514
515515   PORT_START
516   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_SERVICE ) PORT_NAME( DEF_STR( Service_Mode )) PORT_CODE(KEYCODE_F2)
516   PORT_SERVICE_NO_TOGGLE( 0x80, IP_ACTIVE_LOW )
517517   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_SERVICE1 ) PORT_NAME("Service Button") PORT_CODE(KEYCODE_8)
518518   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_COIN1 )
519519   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_COIN2 )
src/mame/drivers/segae.c
r1679r1680
726726/* stop timer and clear ram.. used on megatech when we switch between genesis and sms mode */
727727void segae_md_sms_stop_scanline_timer(void)
728728{
729   timer_adjust(md_sms_vdp->sms_scanline_timer,  attotime_never, 0, attotime_never);
729   timer_adjust_oneshot(md_sms_vdp->sms_scanline_timer,  attotime_never, 0);
730730   memset(md_sms_vdp->vram,0x00,0x4000);
731731}
732732
r1679r1680
12931293   if (chip->sms_scanline_counter<(chip->sms_total_scanlines-1))
12941294   {
12951295      chip->sms_scanline_counter++;
1296      timer_adjust(chip->sms_scanline_timer, ATTOTIME_IN_HZ(chip->sms_framerate * chip->sms_total_scanlines), 0, attotime_zero);
1296      timer_adjust_oneshot(chip->sms_scanline_timer, ATTOTIME_IN_HZ(chip->sms_framerate * chip->sms_total_scanlines), 0);
12971297
12981298      if (chip->sms_scanline_counter>sms_mode_table[chip->screen_mode].sms2_height)
12991299      {
r1679r1680
14581458
14591459   chip->sms_scanline_counter = -1;
14601460   chip->yscroll = chip->regs[0x9]; // this can't change mid-frame
1461   timer_adjust(chip->sms_scanline_timer, attotime_zero, 0, attotime_zero);
1461   timer_adjust_oneshot(chip->sms_scanline_timer, attotime_zero, 0);
14621462}
14631463
14641464#ifdef UNUSED_FUNCTION
r1679r1680
14801480#ifdef UNUSED_FUNCTION
14811481MACHINE_RESET(sms)
14821482{
1483   timer_adjust(vdp1->sms_scanline_timer, attotime_zero, 0, attotime_zero);
1483   timer_adjust_oneshot(vdp1->sms_scanline_timer, attotime_zero, 0);
14841484}
14851485#endif
14861486
r1679r1680
19381938
19391939static MACHINE_RESET(systeme)
19401940{
1941   timer_adjust(vdp1->sms_scanline_timer, attotime_zero, 0, attotime_zero);
1942   timer_adjust(vdp2->sms_scanline_timer, attotime_zero, 0, attotime_zero);
1941   timer_adjust_oneshot(vdp1->sms_scanline_timer, attotime_zero, 0);
1942   timer_adjust_oneshot(vdp2->sms_scanline_timer, attotime_zero, 0);
19431943}
19441944
19451945MACHINE_RESET(megatech_md_sms)
19461946{
1947   timer_adjust(md_sms_vdp->sms_scanline_timer, attotime_zero, 0, attotime_zero);
1947   timer_adjust_oneshot(md_sms_vdp->sms_scanline_timer, attotime_zero, 0);
19481948}
19491949
19501950MACHINE_RESET(megatech_bios)
19511951{
1952   timer_adjust(vdp1->sms_scanline_timer, attotime_zero, 0, attotime_zero);
1952   timer_adjust_oneshot(vdp1->sms_scanline_timer, attotime_zero, 0);
19531953}
19541954
19551955static VIDEO_EOF(systeme)
src/mame/drivers/ksys573.c
r1679r1680
463463   int i, n_this;
464464   UINT8 sector_buffer[ 4096 ];
465465
466   timer_adjust(atapi_timer, attotime_never, 0, attotime_never);
466   timer_adjust_oneshot(atapi_timer, attotime_never, 0);
467467
468468//  verboselog( 2, "atapi_xfer_end( %d ) atapi_xferlen = %d, atapi_xfermod=%d\n", x, atapi_xfermod, atapi_xferlen );
469469
r1679r1680
508508      atapi_regs[ATAPI_REG_COUNTLOW] = atapi_xferlen & 0xff;
509509      atapi_regs[ATAPI_REG_COUNTHIGH] = (atapi_xferlen>>8)&0xff;
510510
511      timer_adjust(atapi_timer, ATTOTIME_IN_CYCLES((ATAPI_CYCLES_PER_SECTOR * (atapi_xferlen/2048)), 0), 0, attotime_zero);
511      timer_adjust_oneshot(atapi_timer, ATTOTIME_IN_CYCLES((ATAPI_CYCLES_PER_SECTOR * (atapi_xferlen/2048)), 0), 0);
512512   }
513513   else
514514   {
r1679r1680
734734
735735               case 0x45: // PLAY
736736                  atapi_regs[ATAPI_REG_CMDSTATUS] = ATAPI_STAT_BSY;
737                  timer_adjust( atapi_timer, ATTOTIME_IN_CYCLES( ATAPI_CYCLES_PER_SECTOR, 0 ), 0, attotime_zero );
737                  timer_adjust_oneshot( atapi_timer, ATTOTIME_IN_CYCLES( ATAPI_CYCLES_PER_SECTOR, 0 ), 0 );
738738                  break;
739739            }
740740
r1679r1680
906906   atapi_cdata_wait = 0;
907907
908908   atapi_timer = timer_alloc( atapi_xfer_end , NULL);
909   timer_adjust(atapi_timer, attotime_never, 0, attotime_never);
909   timer_adjust_oneshot(atapi_timer, attotime_never, 0);
910910
911911   for( i = 0; i < 2; i++ )
912912   {
r1679r1680
973973   verboselog( 2, "atapi_xfer_end: %d %d\n", atapi_xferlen, atapi_xfermod );
974974
975975   // set a transfer complete timer (Note: CYCLES_PER_SECTOR can't be lower than 2000 or the BIOS ends up "out of order")
976   timer_adjust(atapi_timer, ATTOTIME_IN_CYCLES((ATAPI_CYCLES_PER_SECTOR * (atapi_xferlen/2048)), 0), 0, attotime_zero);
976   timer_adjust_oneshot(atapi_timer, ATTOTIME_IN_CYCLES((ATAPI_CYCLES_PER_SECTOR * (atapi_xferlen/2048)), 0), 0);
977977}
978978
979979static UINT32 m_n_security_control;
r1679r1680
11851185{
11861186   if( ( m_p_n_root_mode[ n_counter ] & RC_STOP ) != 0 )
11871187   {
1188      timer_adjust( m_p_timer_root[ n_counter ], attotime_never, n_counter, attotime_zero);
1188      timer_adjust_oneshot( m_p_timer_root[ n_counter ], attotime_never, n_counter);
11891189   }
11901190   else
11911191   {
r1679r1680
11991199
12001200      n_duration *= root_divider( n_counter );
12011201
1202      timer_adjust( m_p_timer_root[ n_counter ], attotime_mul(ATTOTIME_IN_HZ(33868800), n_duration), n_counter, attotime_zero);
1202      timer_adjust_oneshot( m_p_timer_root[ n_counter ], attotime_mul(ATTOTIME_IN_HZ(33868800), n_duration), n_counter);
12031203   }
12041204}
12051205
r1679r1680
28262826   PORT_START_TAG("IN3")
28272827   PORT_BIT( 0x00000100, IP_ACTIVE_LOW, IPT_BUTTON4 ) PORT_PLAYER(1)
28282828   PORT_BIT( 0x00000200, IP_ACTIVE_LOW, IPT_BUTTON5 ) PORT_PLAYER(1)
2829   PORT_BIT( 0x00000400, IP_ACTIVE_LOW, IPT_OTHER ) PORT_NAME("Test Switch") PORT_CODE(KEYCODE_F2)
2829   PORT_SERVICE_NO_TOGGLE( 0x00000400, IP_ACTIVE_LOW )
28302830   PORT_BIT( 0x00000800, IP_ACTIVE_LOW, IPT_BUTTON6 ) PORT_PLAYER(1)
28312831   PORT_BIT( 0x01000000, IP_ACTIVE_LOW, IPT_BUTTON4 ) PORT_PLAYER(2)
28322832   PORT_BIT( 0x02000000, IP_ACTIVE_LOW, IPT_BUTTON5 ) PORT_PLAYER(2)
src/mame/drivers/sbrkout.c
r1679r1680
9797
9898static MACHINE_RESET( sbrkout )
9999{
100   timer_adjust(scanline_timer, video_screen_get_time_until_pos(0, 0, 0), 0, attotime_never);
100   timer_adjust_oneshot(scanline_timer, video_screen_get_time_until_pos(0, 0, 0), 0);
101101}
102102
103103
r1679r1680
126126   if (scanline == machine->screen[0].visarea.max_y + 1)
127127   {
128128      UINT8 potvalue = readinputportbytag("PADDLE");
129      timer_adjust(pot_timer, video_screen_get_time_until_pos(0, 72 + (potvalue / 2), (potvalue % 2) * 128), 0, attotime_never);
129      timer_adjust_oneshot(pot_timer, video_screen_get_time_until_pos(0, 72 + (potvalue / 2), (potvalue % 2) * 128), 0);
130130   }
131131
132132   /* call us back in 4 scanlines */
133133   scanline += 4;
134134   if (scanline >= machine->screen[0].height)
135135      scanline = 0;
136   timer_adjust(scanline_timer, video_screen_get_time_until_pos(0, scanline, 0), scanline, attotime_never);
136   timer_adjust_oneshot(scanline_timer, video_screen_get_time_until_pos(0, scanline, 0), scanline);
137137}
138138
139139
r1679r1680
286286
287287static VIDEO_START( sbrkout )
288288{
289   bg_tilemap = tilemap_create(get_bg_tile_info, tilemap_scan_rows, TILEMAP_TYPE_PEN, 8, 8, 32, 32);
289   bg_tilemap = tilemap_create(get_bg_tile_info, tilemap_scan_rows, 8, 8, 32, 32);
290290}
291291
292292
src/mame/drivers/midas.c
r1679r1680
6767static VIDEO_START( livequiz )
6868{
6969   tmap = tilemap_create(   get_tile_info, tilemap_scan_cols,
70                     TILEMAP_TYPE_PEN, 8,8, 0x80,0x20   );
70                     8,8, 0x80,0x20   );
7171
7272   tilemap_set_transparent_pen(tmap, 0);
7373}
src/mame/drivers/funworld.c
r1679r1680
11/**********************************************************************************
22
33
4    FUNWORLD.
4    FUNWORLD / TAB.
55
6
76    Original preliminary driver:    Curt Coder, Peter Trauner.
87    Rewrite and aditional work:     Roberto Fresca.
98
109
10
1111    Games running in this hardware:
1212
13    * Jolly Card (Austria),                     TAB-Austria,        1985.
14    * Jolly Card (Austria, encrypted),          TAB-Austria,        1985.
15    * Jolly Card (Croatia),                     Soft Design,        1993.
16    * Jolly Card (Italia, encrypted),           bootleg,            199?.
17    * Jolly Card (Austria, Fun World, bootleg), Inter Games,        1995.
18    * Big Deal (Hungary, set 1),                Fun World,          1990.
19    * Big Deal (Hungary, set 2),                Fun World,          1990.
20    * Jolly Card (Austria, Fun World),          Fun World,          1990.
21    * Cuore 1 (Italia),                         C.M.C.,             1996.
22    * Elephant Family (Italia, new),            C.M.C.,             1997.
23    * Elephant Family (Italia, old),            C.M.C.,             1996.
24    * Pool 10 (Italia, set 1),                  C.M.C.,             1996.
25    * Pool 10 (Italia, set 2),                  C.M.C.,             1996.
26    * Tortuga Family (Italia),                  C.M.C.,             1997.
27    * Royal Card (Austria, set 1),              TAB-Austria,        1991.
28    * Royal Card (Austria, set 2),              TAB-Austria,        1991.
29    * Royal Card (Slovakia, encrypted),         Evona Electronic,   1991.
30    * Magic Card II (Bulgaria, bootleg),        Impera,             1996.
31    * Joker Card (Ver.A267BC, encrypted),       Vesely Svet,        1993.
32    * Mongolfier New (Italia),                  bootleg,            199?.
33    * Soccer New (Italia),                      bootleg,            199?.
34    * Snooker 10 (Ver 1.11),                    Sandiy,             1998.
35    * Saloon (France, encrypted),               unknown,            199?.
13    * Jolly Card (austrian),                            TAB-Austria,        1985.
14    * Jolly Card (austrian, encrypted),                 TAB-Austria,        1985.
15    * Jolly Card (3x3 deal),                            TAB-Austria,        1985.
16    * Jolly Card Professional 2.0,                      Spale-Soft,         2000.
17    * Jolly Card (croatian),                            Soft Design,        1993.
18    * Jolly Card (italian, blue TAB board, encrypted),  bootleg,            199?.
19    * Jolly Card (austrian, Funworld, bootleg),         Inter Games,        1986.
20    * Big Deal (hungarian, set 1),                      Funworld,           1986.
21    * Big Deal (hungarian, set 2),                      Funworld,           1986.
22    * Jolly Card (austrian, Funworld),                  Funworld,           1986.
23    * Cuore 1 (italian),                                C.M.C.,             1996.
24    * Elephant Family (italian, new),                   C.M.C.,             1997.
25    * Elephant Family (italian, old),                   C.M.C.,             1996.
26    * Pool 10 (italian, set 1),                         C.M.C.,             1996.
27    * Pool 10 (italian, set 2),                         C.M.C.,             1996.
28    * Tortuga Family (italian),                         C.M.C.,             1997.
29    * Royal Card (austrian, set 1),                     TAB-Austria,        1991.
30    * Royal Card (austrian, set 2),                     TAB-Austria,        1991.
31    * Royal Card (slovak, encrypted),                   Evona Electronic,   1991.
32    * Lucky Lady (3x3 deal),                            TAB-Austria,        1991.
33    * Lucky Lady (4x1 aces),                            TAB-Austria,        1991.
34    * Magic Card II (bulgarian),                        Impera,             1996.
35    * Magic Card II (green TAB or Impera board),        Impera,             1996.
36    * Magic Card II (blue TAB board, encrypted),        Impera,             1996.
37    * Royal Vegas Joker Card (slow deal),               Funworld,           1993.
38    * Royal Vegas Joker Card (fast deal),               Soft Design,        1993.
39    * Joker Card (Ver.A267BC, encrypted),               Vesely Svet,        1993.
40    * Mongolfier New (italian),                         bootleg,            199?.
41    * Soccer New (italian),                             bootleg,            199?.
42    * Snooker 10 (Ver 1.11),                            Sandii',            1998.
43    * Saloon (french, encrypted),                       unknown,            199?.
3644
3745
3846***********************************************************************************
r1679r1680
93101
94102    - Encryption.
95103
96            A) Encrypted CPU. At least two Fun World boards have custom encrypted CPUs:
104            A) Encrypted CPU. At least two Funworld boards have custom encrypted CPUs:
97105
98106                - Joker Card from Vesely Svet use a custom unknown CPU and use encrypted prg roms.
99                - Royal Card (Slovakia, encrypted) from Evona Electronic seems to use a block
107                - Royal Card (slovak, encrypted) from Evona Electronic seems to use a block
100108                  with CPU + extras (ICs, TTL, etc) to manage the encryption.
101109
102110            B) General encryption. Managed through hardware:
103111
104                - Jolly Card (Italia, encrypted GFXs) use substitution for each byte nibble. See DRIVER_INIT for the algorythm.
105                - Jolly Card (Austria, encrypted) use simple XOR with a fixed value.
112                - Jolly Card (italian, blue TAB board, encrypted) & Magic Card II (Impera, Blue TAB board)
113                  use substitution for each byte nibble. See DRIVER_INIT for the algorithm.
114                - Jolly Card (austrian, encrypted) use simple XOR with a fixed value.
106115
107116    - Microcontroller. Some games are using an extra microcontroller mainly for protection.
108117
r1679r1680
157166    the supported set is the program rom that is double sized, having identical halves.
158167
159168
160    - Jolly Card (Austria, Fun World, bootleg)
169    - Jolly Card (austrian, Funworld, bootleg)
161170
162171    This one seems to have normal RAM instead of NVRAM.
163172    Going through the code, there's not any NVRAM initialization routine through service 1 & 2.
164173
165174
175    - Jolly Card Professional 2.0 (Spale-Soft)
176
177    Each 1st boot, this game show a generated code. You must enter this code in a DOS program to
178    get the input codes necessary to allow boot the game.
179
180
181    - Magic Card II (Impera)
182
183    Impera made 2 graphics sets for this game. One of them is encrypted, and meant for the TAB blue board.
184    This board has two HY18CV85 (electrically-erasable PLD) that handle the encryption.
185    In another hand, the sound has some weir things.
186
187
166188    - Mongolfier New
167189    - Soccer New
168190
r1679r1680
176198    a complete Royal Card set, so... Is possible the existence of a shortcut,'easter egg',
177199    simple hack or DIP switches combination to enable the Royal Card game.
178200
201    These games should be moved to a new driver in a near future, as soon as we know a bit more
202    about them and start to implement the missing pieces for an accurate emulation.
179203
204
180205    - Snooker 10
181206
182207    This game is running in a complete different hardware.
r1679r1680
322347    ---------------------------------------------------
323348
324349
325    Jolly Card (Austria, Fun World, bootleg)
350    Jolly Card (austrian, Funworld, bootleg)
326351    ----------------------------------------
327352
328353    - 1x G65SC02P (CPU)
r1679r1680
350375    - 1x Crystal : 16.000 MHz
351376
352377
353    Jolly Card (Italia)
354    -------------------
378    Jolly Card (italian, blue Tab board, encrypted)
379    -----------------------------------------------
355380
356381    - 1x HY6264LP
357382    - 1x MC6845P
r1679r1680
364389            1x M5M27256 (jn)
365390    - 1x prom N82S147
366391    - 1x GAL16V8B
392    - 2x HY18CV85 (electrically-erasable PLD)
367393    - 1x 8 DIP switches
368394    - 1x 22x2 edge connector
369395    - 1x 18x2 edge connector
370396    - 1x trimmer (volume)(missing)
371397
372398
373    Big Deal (Hungary)
399    Big Deal (hungarian)
374400    ------------------
375401
376402    - 1x MC6845P
r1679r1680
379405    - 1x Crystal 16.000 MHz
380406
381407
382    Magic Card II (Bulgaria, bootleg)
408    Magic Card II (bulgarian)
383409    ---------------------------------
384410
385411    - 1x Special CPU with CM602 (??) on it
r1679r1680
387413    - 1x YM2149F
388414    - 2x MC6821P
389415    - 1x Crystal 16.000 MHz
416    - 2x HY18CV85 (electrically-erasable PLD)
390417
391418
392    Cuore Uno (Italia)
393    ------------------
419    Cuore Uno (italian)
420    -----------------------------------
394421
395422    - CPU 1x G65SC02P
396423    - 1x MC68B45P (CRT controller)
r1679r1680
408435    - 1x battery
409436
410437
411    Elephant Family (Italia, old)
438    Elephant Family (italian, old)
412439    -----------------------------
413440
414441    - CPU 1x R65C02P2
r1679r1680
427454    - 1x battery
428455
429456
430    Pool 10 (Italia)
431    ----------------
457    Pool 10 (italian)
458    -----------------
432459
433460    - 1x R65C02P2 (main)
434461    - 1x YM2149F (sound)
r1679r1680
448475    - 1x battery
449476
450477
451    Tortuga Family (Italia)
452    -----------------------
478    Tortuga Family (italian)
479    ------------------------
453480
454481    - 1x G65SC02P2 (main)
455482    - 1x 95101 (sound)
r1679r1680
555582    - 1x green led
556583
557584
558    Soccer New (Italia)
559    -------------------
585    Soccer New (italian)
586    --------------------
560587
561588    - 1x G65SC02P2 (main)
562589    - 1x KC89C72 (sound)
r1679r1680
736763    - Added new game: Saloon (France, encrypted). Preliminary.
737764    - Updated technical notes.
738765
766    2008/02/10
767    - Switched to XTAL def.
768    - Fixed Magic Card II graphics issues.
769    - Fixed Magic Card II inputs.
770    - Fixed screen and visible area to snooker10.
771    - Renamed set monglfir to mongolnw.
772    - Renamed sets description based on languages instead of countries.
773    - Added new game: Magic Card II (green TAB or Impera board). Not working yet.
774    - Added new game: Magic Card II (blue TAB board, encrypted). Not working yet.
775    - Added new game: Jolly Card (3x3 deal).
776    - Added new game: Jolly Card Professional 2.0 (with 'enter code' screen to boot).
777    - Added new game: Lucky Lady (3x3 deal).
778    - Added new game: Lucky Lady (4x1 aces).
779    - Added new game: Royal Vegas Joker Card (fast deal).
780    - Added new game: Royal Vegas Joker Card (slow deal).
781    - Fixed some years and manufacturers.
782    - Updated technical notes.
783    - Cleaned up the driver.
739784
740785
741786    *** TO DO ***
742787
743    - Fix the last 2 GFX planes in magiccrd.
744788    - Figure out the royalcdc, jokercrd and saloon encryption.
789    - Fix the imperfect sound in Magic Card II.
790    - Reverse-engineering the boot code of Jolly Card Professional 2.0 to get the proper input codes to boot.
745791    - Analyze the unknown writes to $2000/$4000 in some games.
746792    - Check for the reads to the ay8910 output ports in some games.
747793    - Figure out the MCU in monglfir and soccernw.
r1679r1680
751797***********************************************************************************/
752798
753799
754#define MASTER_CLOCK   16000000
800#define MASTER_CLOCK   XTAL_16MHz
755801
756802#include "driver.h"
757803#include "sound/ay8910.h"
758#include "video/crtc6845.h"
759804#include "machine/6821pia.h"
760805
761806#include "funworld.lh"
762807
763808/* from video */
764extern WRITE8_HANDLER( funworld_videoram_w );
765extern WRITE8_HANDLER( funworld_colorram_w );
766extern PALETTE_INIT( funworld );
767extern VIDEO_START( funworld );
768extern VIDEO_START( magiccrd );
769extern VIDEO_UPDATE( funworld );
809WRITE8_HANDLER( funworld_videoram_w );
810WRITE8_HANDLER( funworld_colorram_w );
811WRITE8_HANDLER( funworld_mc6845_address_w );
812READ8_HANDLER( funworld_mc6845_register_r );
813WRITE8_HANDLER( funworld_mc6845_register_w );
814PALETTE_INIT( funworld );
815VIDEO_START( funworld );
816VIDEO_START( magiccrd );
817VIDEO_START( snookr10 );
818VIDEO_UPDATE( funworld );
770819
771820
772821/**********************
r1679r1680
804853   AM_RANGE(0x0a00, 0x0a03) AM_READWRITE(pia_1_r, pia_1_w)
805854   AM_RANGE(0x0c00, 0x0c00) AM_READWRITE(AY8910_read_port_0_r, AY8910_control_port_0_w)
806855   AM_RANGE(0x0c01, 0x0c01) AM_WRITE(AY8910_write_port_0_w)
807   AM_RANGE(0x0e00, 0x0e00) AM_WRITE(crtc6845_address_w)
808   AM_RANGE(0x0e01, 0x0e01) AM_READWRITE(crtc6845_register_r, crtc6845_register_w)
856   AM_RANGE(0x0e00, 0x0e00) AM_WRITE(funworld_mc6845_address_w)
857   AM_RANGE(0x0e01, 0x0e01) AM_READWRITE(funworld_mc6845_register_r, funworld_mc6845_register_w)
809858   AM_RANGE(0x2000, 0x2fff) AM_RAM AM_WRITE(funworld_videoram_w) AM_BASE(&videoram)
810859   AM_RANGE(0x3000, 0x3fff) AM_RAM   AM_WRITE(funworld_colorram_w) AM_BASE(&colorram)
811860   AM_RANGE(0x4000, 0x4000) AM_READNOP
r1679r1680
819868   AM_RANGE(0x0a00, 0x0a03) AM_READWRITE(pia_1_r, pia_1_w)
820869   AM_RANGE(0x0c00, 0x0c00) AM_READWRITE(AY8910_read_port_0_r, AY8910_control_port_0_w)
821870   AM_RANGE(0x0c01, 0x0c01) AM_WRITE(AY8910_write_port_0_w)
822   AM_RANGE(0x0e00, 0x0e00) AM_WRITE(crtc6845_address_w)
823   AM_RANGE(0x0e01, 0x0e01) AM_READWRITE(crtc6845_register_r, crtc6845_register_w)
871   AM_RANGE(0x0e00, 0x0e00) AM_WRITE(funworld_mc6845_address_w)
872   AM_RANGE(0x0e01, 0x0e01) AM_READWRITE(funworld_mc6845_register_r, funworld_mc6845_register_w)
824873   AM_RANGE(0x3600, 0x36ff) AM_RAM   // some games use $3603-05 range for protection.
825874   AM_RANGE(0x4000, 0x4fff) AM_RAM AM_WRITE(funworld_videoram_w) AM_BASE(&videoram)
826875   AM_RANGE(0x5000, 0x5fff) AM_RAM   AM_WRITE(funworld_colorram_w) AM_BASE(&colorram)
r1679r1680
833882   AM_RANGE(0x0a00, 0x0a03) AM_READWRITE(pia_1_r, pia_1_w)
834883   AM_RANGE(0x0c00, 0x0c00) AM_READWRITE(AY8910_read_port_0_r, AY8910_control_port_0_w)
835884   AM_RANGE(0x0c01, 0x0c01) AM_WRITE(AY8910_write_port_0_w)
836   AM_RANGE(0x0e00, 0x0e00) AM_WRITE(crtc6845_address_w)
837   AM_RANGE(0x0e01, 0x0e01) AM_READWRITE(crtc6845_register_r, crtc6845_register_w)
885   AM_RANGE(0x0e00, 0x0e00) AM_WRITE(funworld_mc6845_address_w)
886   AM_RANGE(0x0e01, 0x0e01) AM_READWRITE(funworld_mc6845_register_r, funworld_mc6845_register_w)
838887   AM_RANGE(0x2000, 0x2000) AM_READNOP   // some unknown reads
839888   AM_RANGE(0x3e00, 0x3fff) AM_RAM   // some games use $3e03-05 range for protection.
840889   AM_RANGE(0x6000, 0x6fff) AM_RAM AM_WRITE(funworld_videoram_w) AM_BASE(&videoram)
r1679r1680
848897   AM_RANGE(0x2a00, 0x2a03) AM_READWRITE(pia_1_r, pia_1_w)
849898   AM_RANGE(0x2c00, 0x2c00) AM_READWRITE(AY8910_read_port_0_r, AY8910_control_port_0_w)
850899   AM_RANGE(0x2c01, 0x2c01) AM_WRITE(AY8910_write_port_0_w)
851   AM_RANGE(0x2e00, 0x2e00) AM_WRITE(crtc6845_address_w)
852   AM_RANGE(0x2e01, 0x2e01) AM_READWRITE(crtc6845_register_r, crtc6845_register_w)
900   AM_RANGE(0x2e00, 0x2e00) AM_WRITE(funworld_mc6845_address_w)
901   AM_RANGE(0x2e01, 0x2e01) AM_READWRITE(funworld_mc6845_register_r, funworld_mc6845_register_w)
853902   AM_RANGE(0x4000, 0x4fff) AM_RAM AM_WRITE(funworld_videoram_w) AM_BASE(&videoram)
854903   AM_RANGE(0x5000, 0x5fff) AM_RAM   AM_WRITE(funworld_colorram_w) AM_BASE(&colorram)
855904   AM_RANGE(0x6000, 0xffff) AM_ROM
r1679r1680
11341183   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_BUTTON3 ) PORT_NAME("Hold 3") PORT_CODE(KEYCODE_C)
11351184   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_UNKNOWN )
11361185   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_UNKNOWN )
1137   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_UNKNOWN )
1186   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_SERVICE ) PORT_NAME("Hopper SW") PORT_CODE(KEYCODE_8)
11381187   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_COIN2 )
11391188   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNKNOWN )
11401189   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_BUTTON7 ) PORT_NAME("Payout") PORT_CODE(KEYCODE_M)
r1679r1680
11561205   PORT_DIPNAME( 0x02, 0x00, DEF_STR( Unknown ) )   PORT_DIPLOCATION("SW1:7")   // remote credits settings are always 10 Points/Pulse.
11571206   PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
11581207   PORT_DIPSETTING(    0x02, DEF_STR( On ) )
1159   PORT_DIPNAME( 0x04, 0x00, DEF_STR( Coin_A ) )   PORT_DIPLOCATION("SW1:6")
1208   PORT_DIPNAME( 0x04, 0x00, DEF_STR( Coin_B ) )   PORT_DIPLOCATION("SW1:6")
11601209   PORT_DIPSETTING(    0x00, "5 Points/Coin" )
11611210   PORT_DIPSETTING(    0x04, "10 Points/Coin" )
1162   PORT_DIPNAME( 0x08, 0x00, DEF_STR( Coin_B ) )   PORT_DIPLOCATION("SW1:5")
1211   PORT_DIPNAME( 0x08, 0x00, DEF_STR( Coin_A ) )   PORT_DIPLOCATION("SW1:5")
11631212   PORT_DIPSETTING(    0x00, "5 Points/Coin" )
11641213   PORT_DIPSETTING(    0x08, "10 Points/Coin" )
11651214   PORT_DIPNAME( 0x10, 0x00, DEF_STR( Unknown ) )   PORT_DIPLOCATION("SW1:4")
r1679r1680
14221471   MDRV_DEFAULT_LAYOUT(layout_funworld)
14231472
14241473   MDRV_PALETTE_LENGTH(0x200)
1425   MDRV_COLORTABLE_LENGTH(0x200)
14261474   MDRV_PALETTE_INIT(funworld)
14271475   MDRV_VIDEO_START(funworld)
14281476   MDRV_VIDEO_UPDATE(funworld)
r1679r1680
14501498   MDRV_CPU_PROGRAM_MAP(magiccrd_map, 0)
14511499
14521500   MDRV_SCREEN_SIZE((123+1)*4, (36+1)*8)         // Taken from MC6845 init, registers 00 & 04. Normally programmed with (value-1).
1453   MDRV_SCREEN_VISIBLE_AREA(0*4, 112*4-1, 0*8, 34*8-1)   // Taken from MC6845 init, registers 01 & 06.
1454//  MDRV_SCREEN_VISIBLE_AREA(0*4, 98*4-1, 0*8, 32*8-1)     // adjusted to screen for testing purposes.
1501//  MDRV_SCREEN_VISIBLE_AREA(0*4, 112*4-1, 0*8, 34*8-1) // Taken from MC6845 init, registers 01 & 06.
1502   MDRV_SCREEN_VISIBLE_AREA(0*4, 98*4-1, 0*8, 32*8-1)     // adjusted to screen for testing purposes.
14551503
14561504   MDRV_GFXDECODE(funworld)
14571505   MDRV_VIDEO_START(magiccrd)
r1679r1680
14931541   // video hardware
14941542   MDRV_VIDEO_ATTRIBUTES(VIDEO_TYPE_RASTER)
14951543   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
1496   MDRV_SCREEN_SIZE((124+1)*4, (30+1)*8)
1497   MDRV_SCREEN_VISIBLE_AREA(0*4, 96*4-1, 0*8, 29*8-1)
1544   MDRV_SCREEN_SIZE((128+1)*4, (30+1)*8)
1545   MDRV_SCREEN_VISIBLE_AREA(0*4, 96*4-1, 0*8, 30*8-1)
1546//  MDRV_SCREEN_SIZE((124+1)*4, (30+1)*8)
1547//  MDRV_SCREEN_VISIBLE_AREA(0*4, 96*4-1, 0*8, 29*8-1)
14981548
14991549   MDRV_GFXDECODE(sn10)
15001550
15011551//  MDRV_DEFAULT_LAYOUT(layout_funworld)
15021552
15031553   MDRV_PALETTE_LENGTH(0x200)
1504   MDRV_COLORTABLE_LENGTH(0x200)
15051554   MDRV_PALETTE_INIT(funworld)
1506   MDRV_VIDEO_START(funworld)
1555   MDRV_VIDEO_START(snookr10)
15071556   MDRV_VIDEO_UPDATE(funworld)
15081557MACHINE_DRIVER_END
15091558
r1679r1680
15361585   ROM_LOAD( "82s147.bin",   0x0000, 0x0200, CRC(5ebc5659) SHA1(8d59011a181399682ab6e8ed14f83101e9bfa0c6) )
15371586ROM_END
15381587
1588ROM_START( jolyc3x3 )
1589   ROM_REGION( 0x10000, REGION_CPU1, 0 )
1590   ROM_LOAD( "jc3x3.bin", 0x8000, 0x8000, CRC(71e304ad) SHA1(238b792d841432582c94b21a674d46a95e8f3826) )
1591
1592   ROM_REGION( 0x10000, REGION_GFX1, ROMREGION_DISPOSE )
1593   ROM_LOAD( "jolycard.ch2", 0x0000, 0x8000, CRC(c512b103) SHA1(1f4e78e97855afaf0332fb75e1b5571aafd01c29) )
1594   ROM_LOAD( "jolycard.ch1", 0x8000, 0x8000, CRC(0f24f39d) SHA1(ac1f6a8a4a2a37cbc0d45c15187b33c25371bffb) )
1595
1596   ROM_REGION( 0x0200, REGION_PROMS, 0 )
1597   ROM_LOAD( "82s147.bin",   0x0000, 0x0200, CRC(5ebc5659) SHA1(8d59011a181399682ab6e8ed14f83101e9bfa0c6) )
1598ROM_END
1599
1600ROM_START( jolyc980 )
1601   ROM_REGION( 0x10000, REGION_CPU1, 0 )
1602   ROM_LOAD( "j980.bin", 0x8000, 0x8000, CRC(48249fff) SHA1(390cd0eb3399446a66363dc6760458170e1970fd) )
1603
1604   ROM_REGION( 0x10000, REGION_GFX1, ROMREGION_DISPOSE )
1605   ROM_LOAD( "jolycard.ch2", 0x0000, 0x8000, CRC(c512b103) SHA1(1f4e78e97855afaf0332fb75e1b5571aafd01c29) )
1606   ROM_LOAD( "jolycard.ch1", 0x8000, 0x8000, CRC(0f24f39d) SHA1(ac1f6a8a4a2a37cbc0d45c15187b33c25371bffb) )
1607
1608   ROM_REGION( 0x0200, REGION_PROMS, 0 )
1609   ROM_LOAD( "82s147.bin",   0x0000, 0x0200, CRC(5ebc5659) SHA1(8d59011a181399682ab6e8ed14f83101e9bfa0c6) )
1610ROM_END
1611
15391612ROM_START( jolycdcr )
15401613   ROM_REGION( 0x10000, REGION_CPU1, 0 )
15411614   ROM_LOAD( "jollypkr.003", 0x8000, 0x8000, CRC(ea7340b4) SHA1(7dd468f28a488a4781521809d06db1d7917048ad) )
r1679r1680
15631636   ROM_LOAD( "gal16v8b.bin", 0x0000, 0x0117, CRC(3ad712b1) SHA1(54214841fb178e4b59bf6051522718f7667bad28) )
15641637ROM_END
15651638
1566ROM_START( jolycdat )   // there are unused pieces of code that compare or jumps within $4000-$5000 range.
1567   ROM_REGION( 0x10000, REGION_CPU1, 0 )
1568   ROM_LOAD( "bonucard.cpu", 0x8000, 0x4000, CRC(da342100) SHA1(451fa6074aad19e9efd148c3d18115a20a3d344a) )
1569   ROM_CONTINUE(           0xc000, 0x4000 )
1570
1571   ROM_REGION( 0x10000, REGION_GFX1, ROMREGION_DISPOSE )
1572   ROM_LOAD( "jolycard.ch2", 0x0000, 0x8000, CRC(c512b103) SHA1(1f4e78e97855afaf0332fb75e1b5571aafd01c29) )
1573   ROM_LOAD( "jolycard.ch1", 0x8000, 0x8000, CRC(0f24f39d) SHA1(ac1f6a8a4a2a37cbc0d45c15187b33c25371bffb) )
1574
1575   ROM_REGION( 0x0200, REGION_PROMS, 0 )
1576   ROM_LOAD( "82s147.bin",   0x0000, 0x0200, CRC(5ebc5659) SHA1(8d59011a181399682ab6e8ed14f83101e9bfa0c6) )   // jollycrd palette till a dump appear.
1577ROM_END
1578
15791639ROM_START( jolycdab )
15801640   ROM_REGION( 0x10000, REGION_CPU1, 0 )   // program is testing/writting RAM in offset $8800-$BFFF (ROM)...??
15811641   ROM_LOAD( "ig1poker.run", 0x8000, 0x8000, CRC(c96e6542) SHA1(ed6c0cf9fe8597dba9149b2225320d8d9c39219a) )
r1679r1680
16131673   ROM_LOAD( "82s147.bin",   0x0000, 0x0200, CRC(5ebc5659) SHA1(8d59011a181399682ab6e8ed14f83101e9bfa0c6) )   // jollycrd palette till a dump appear.
16141674ROM_END
16151675
1676ROM_START( jolycdat )   // there are unused pieces of code that compare or jumps within $4000-$5000 range.
1677   ROM_REGION( 0x10000, REGION_CPU1, 0 )
1678   ROM_LOAD( "bonucard.cpu", 0x8000, 0x4000, CRC(da342100) SHA1(451fa6074aad19e9efd148c3d18115a20a3d344a) )
1679   ROM_CONTINUE(           0xc000, 0x4000 )
1680
1681   ROM_REGION( 0x10000, REGION_GFX1, ROMREGION_DISPOSE )
1682   ROM_LOAD( "jolycard.ch2", 0x0000, 0x8000, CRC(c512b103) SHA1(1f4e78e97855afaf0332fb75e1b5571aafd01c29) )
1683   ROM_LOAD( "jolycard.ch1", 0x8000, 0x8000, CRC(0f24f39d) SHA1(ac1f6a8a4a2a37cbc0d45c15187b33c25371bffb) )
1684
1685   ROM_REGION( 0x0200, REGION_PROMS, 0 )
1686   ROM_LOAD( "82s147.bin",   0x0000, 0x0200, CRC(5ebc5659) SHA1(8d59011a181399682ab6e8ed14f83101e9bfa0c6) )   // jollycrd palette till a dump appear.
1687ROM_END
1688
16161689ROM_START( cuoreuno )
16171690   ROM_REGION( 0x10000, REGION_CPU1, 0 )
16181691   ROM_LOAD( "cuore1a.u2", 0x8000, 0x8000, CRC(6e112184) SHA1(283ac534fc1cb33d11bbdf3447630333f2fc957f) )
r1679r1680
17691842   ROM_LOAD( "2-peel18cv8p.bin",   0x0400, 0x0155, NO_DUMP )   // not present in the set.
17701843ROM_END
17711844
1772ROM_START( magiccrd )
1845ROM_START( lluck3x3 )
1846   ROM_REGION( 0x10000, REGION_CPU1, 0 )
1847   ROM_LOAD( "l3x3.bin", 0x8000, 0x8000, CRC(dbdb07ff) SHA1(6be43aa0b2c10d83373f20f477606cb031bc6dd9) )
1848
1849   ROM_REGION( 0x10000, REGION_GFX1, ROMREGION_DISPOSE )
1850   ROM_LOAD( "l2.bin", 0x0000, 0x8000, CRC(8ca90a8f) SHA1(bc3db3f8c097f89eff488e3aca39bf24ff2b5cff) )
1851   ROM_LOAD( "l1.bin", 0x8000, 0x8000, CRC(beadc35c) SHA1(8a6a5954a827def8c4c3b904d8ee58a4bde53d85) )
1852
1853   ROM_REGION( 0x0200, REGION_PROMS, 0 )
1854   ROM_LOAD( "n82s147.bin",    0x0000, 0x0200, CRC(8bc86f48) SHA1(4c677ab9314a1f571e35104b22659e6811aeb194) )
1855ROM_END
1856
1857ROM_START( lluck4x1 )
1858   ROM_REGION( 0x10000, REGION_CPU1, 0 )
1859   ROM_LOAD( "rk4x1.bin", 0x8000, 0x8000, CRC(37f8a355) SHA1(a6eb4c53464e373bdecbbaaf146f5f7cf66b4bcd) )
1860
1861   ROM_REGION( 0x10000, REGION_GFX1, ROMREGION_DISPOSE )
1862   ROM_LOAD( "l2.bin", 0x0000, 0x8000, CRC(8ca90a8f) SHA1(bc3db3f8c097f89eff488e3aca39bf24ff2b5cff) )
1863   ROM_LOAD( "l1.bin", 0x8000, 0x8000, CRC(beadc35c) SHA1(8a6a5954a827def8c4c3b904d8ee58a4bde53d85) )
1864
1865   ROM_REGION( 0x0200, REGION_PROMS, 0 )
1866   ROM_LOAD( "n82s147.bin",    0x0000, 0x0200, CRC(8bc86f48) SHA1(4c677ab9314a1f571e35104b22659e6811aeb194) )
1867ROM_END
1868
1869ROM_START( magiccrd )   /* Impera */
17731870   ROM_REGION( 0x18000, REGION_CPU1, 0 )
17741871    ROM_LOAD( "magicard.004", 0x0000, 0x8000,  CRC(f6e948b8) SHA1(7d5983015a508ab135ccbf69b7f3c526c229e3ef) ) // only last 16kbyte visible?
17751872   ROM_LOAD( "magicard.01",  0x8000, 0x10000, CRC(c94767d4) SHA1(171ac946bdf2575f9e4a31e534a8e641597af519) ) // 1ST AND 2ND HALF IDENTICAL
17761873
17771874   ROM_REGION( 0x10000, REGION_GFX1, ROMREGION_DISPOSE )
1778   ROM_LOAD( "magicard.03",  0x0000, 0x8000, CRC(733da697) SHA1(45122c64d5a371ec91cecc67b7faf179078e714d) )
1779   ROM_LOAD( "magicard.001", 0x8000, 0x8000, CRC(685f7a67) SHA1(fc65a9d26a5cbbe2fa08dc0f27212dae2d8bcbdc) ) // bad dump?, or sprite plane
1875   ROM_LOAD( "mc2gr2.bin",   0x0000, 0x8000, CRC(733da697) SHA1(45122c64d5a371ec91cecc67b7faf179078e714d) )
1876   ROM_LOAD( "mc2gr1.bin",   0x8000, 0x8000, CRC(2406b8d2) SHA1(e9d7a25562fd5adee351d7ef6ba02fff6aab021a) )
17801877
17811878   ROM_REGION( 0x0200, REGION_PROMS, 0 )
1782   ROM_LOAD( "82s147_mc.bin",   0x0000, 0x0200, NO_DUMP )   // not present in the set.
1879   ROM_LOAD( "mc2-82s147.bin",   0x0000, 0x0200, CRC(aa91cc35) SHA1(79f9a755441500e618c4183f524f969fffd44100) )
1880
1881   ROM_REGION( 0x0200, REGION_PLDS, 0 )
1882   ROM_LOAD( "gal16v8uni.bin", 0x0000, 0x0117, CRC(b81d7e0a) SHA1(7fef0b2bcea931a830d38ae0f1102434cf281d2d) )
17831883ROM_END
17841884
1885ROM_START( magiccda )   /* for green TAB or Impera boards */
1886   ROM_REGION( 0x10000, REGION_CPU1, 0 )
1887    ROM_LOAD( "mc2prgv1.bin", 0x8000, 0x8000,  CRC(7f759b70) SHA1(23a1a6e8eda57c4a90c51a970302f9a7bf590083) )
1888//    ROM_LOAD( "mc2prgv2.bin", 0x8000, 0x8000,  CRC(b0ed6b40) SHA1(7167e67608f1b0b1cd956c838dacc1310861cb4a) )
1889
1890   ROM_REGION( 0x10000, REGION_GFX1, ROMREGION_DISPOSE )
1891   ROM_LOAD( "mc2gr2.bin",   0x0000, 0x8000, CRC(733da697) SHA1(45122c64d5a371ec91cecc67b7faf179078e714d) )
1892   ROM_LOAD( "mc2gr1.bin",   0x8000, 0x8000, CRC(2406b8d2) SHA1(e9d7a25562fd5adee351d7ef6ba02fff6aab021a) )
1893
1894   ROM_REGION( 0x0200, REGION_PROMS, 0 )
1895   ROM_LOAD( "mc2-82s147.bin",   0x0000, 0x0200, CRC(aa91cc35) SHA1(79f9a755441500e618c4183f524f969fffd44100) )
1896
1897   ROM_REGION( 0x0200, REGION_PLDS, 0 )
1898   ROM_LOAD( "gal16v8uni.bin", 0x0000, 0x0117, CRC(b81d7e0a) SHA1(7fef0b2bcea931a830d38ae0f1102434cf281d2d) )
1899ROM_END
1900
1901ROM_START( magiccdb )   /* for blue TAB board (encrypted)*/
1902   ROM_REGION( 0x10000, REGION_CPU1, 0 )
1903//    ROM_LOAD( "mc2prgv1.bin", 0x8000, 0x8000,  CRC(7f759b70) SHA1(23a1a6e8eda57c4a90c51a970302f9a7bf590083) )
1904    ROM_LOAD( "mc2prgv2.bin", 0x8000, 0x8000,  CRC(b0ed6b40) SHA1(7167e67608f1b0b1cd956c838dacc1310861cb4a) )
1905
1906   ROM_REGION( 0x10000, REGION_GFX1, ROMREGION_DISPOSE )
1907   ROM_LOAD( "mc2gr1b.bin",  0x0000, 0x8000, CRC(ce2629a7) SHA1(84767ed5da8dcee44a210255537e10372bcc264b) )
1908   ROM_LOAD( "mc2gr2b.bin",  0x8000, 0x8000, CRC(d2bf8bde) SHA1(975b8f43a0396c09e357b96d5ae7381b12152b9e) )
1909
1910   ROM_REGION( 0x0200, REGION_PROMS, 0 )
1911   ROM_LOAD( "mc2-82s147.bin",   0x0000, 0x0200, CRC(aa91cc35) SHA1(79f9a755441500e618c4183f524f969fffd44100) )
1912
1913   ROM_REGION( 0x0200, REGION_PLDS, 0 )
1914   ROM_LOAD( "gal16v8uni.bin", 0x0000, 0x0117, CRC(b81d7e0a) SHA1(7fef0b2bcea931a830d38ae0f1102434cf281d2d) )
1915ROM_END
1916
1917ROM_START( vegasslw )
1918   ROM_REGION( 0x10000, REGION_CPU1, 0 )
1919   ROM_LOAD( "vslow.bin", 0x8000, 0x8000, CRC(9cb7861a) SHA1(f934eacd5b3573a6bbeaa827f521b4a498e5bcdf) )
1920
1921   ROM_REGION( 0x10000, REGION_GFX1, ROMREGION_DISPOSE )
1922   ROM_LOAD( "v2.bin", 0x0000, 0x8000, CRC(af7ab460) SHA1(01ea400424152c09c10eb83a1bd569019969ccb7) )
1923   ROM_LOAD( "v1.bin", 0x8000, 0x8000, CRC(23e0d1c6) SHA1(98967b14d3264c444a1dfbd15c57cde70f41f09d) )
1924
1925   ROM_REGION( 0x0200, REGION_PROMS, 0 )
1926   ROM_LOAD( "82s147.bin",   0x0000, 0x0200, CRC(5ebc5659) SHA1(8d59011a181399682ab6e8ed14f83101e9bfa0c6) )
1927ROM_END
1928
1929ROM_START( vegasfst )
1930   ROM_REGION( 0x10000, REGION_CPU1, 0 )
1931   ROM_LOAD( "vfast.bin", 0x8000, 0x8000, CRC(87dfb28d) SHA1(9a06e695e59722b6c97e5a9fd2c8b238661e5a4a) )
1932
1933   ROM_REGION( 0x10000, REGION_GFX1, ROMREGION_DISPOSE )
1934   ROM_LOAD( "v2.bin", 0x0000, 0x8000, CRC(af7ab460) SHA1(01ea400424152c09c10eb83a1bd569019969ccb7) )
1935   ROM_LOAD( "v1.bin", 0x8000, 0x8000, CRC(23e0d1c6) SHA1(98967b14d3264c444a1dfbd15c57cde70f41f09d) )
1936
1937   ROM_REGION( 0x0200, REGION_PROMS, 0 )
1938   ROM_LOAD( "82s147.bin",   0x0000, 0x0200, CRC(5ebc5659) SHA1(8d59011a181399682ab6e8ed14f83101e9bfa0c6) )
1939ROM_END
1940
17851941ROM_START( jokercrd )
17861942/*  (Multi) Joker Card from Vesely Svet (Sprightly World). Czech poker game.
1787    Program roms seems encrypted. Custom Fun World CPU based on 6502 family.
1943    Program roms seems encrypted. Custom Funworld CPU based on 6502 family.
17881944    Seems to be a Big Deal clone.
17891945*/
17901946   ROM_REGION( 0x18000, REGION_CPU1, 0 )
r1679r1680
18001956   ROM_LOAD( "ic13.bin",   0x0000, 0x0200, CRC(e59fc06e) SHA1(88a3bb89f020fe2b20f768ca010a082e0b974831) )
18011957ROM_END
18021958
1803ROM_START( monglfir )
1959ROM_START( mongolnw )
18041960   ROM_REGION( 0x20000, REGION_CPU1, 0 )
18051961   ROM_LOAD( "prgteov.2.3m.u16", 0x10000, 0x10000, CRC(996b851a) SHA1(ef4e3d036ca10b33c83749024d04c4d4c09feeb7) )
18061962   ROM_COPY( REGION_CPU1,   0x18000, 0x8000, 0x8000 )
r1679r1680
18832039   pia_config(1, &pia1_intf);
18842040}
18852041
1886static DRIVER_INIT( jolycdit )
2042static DRIVER_INIT( tabblue )
18872043{
1888/*  The encryption seems to be...
2044/* +----------------------------------------------------------------------+
2045   | For TAB blue colored PCB with 2 HY18CV85 (electrically-erasable PLD) |
2046   +----------------------------------------------------------------------+
18892047
2048    The encryption seems to be...
2049
18902050    For each nibble:
18912051
18922052    xe = (3 * xd) & 0f  ; where xe = encrypted value, xd = decrypted value.
r1679r1680
20032163*      Game Drivers      *
20042164*************************/
20052165
2006//    YEAR  NAME      PARENT    MACHINE   INPUT     INIT            COMPANY            FULLNAME
2007GAME( 1985, jollycrd, 0,        funworld, funworld, funworld, ROT0, "TAB-Austria",     "Jolly Card (Austria)", 0 )
2008GAME( 1985, jolycdae, jollycrd, funworld, funworld, jolycdae, ROT0, "TAB-Austria",     "Jolly Card (Austria, encrypted)", 0 )
2009GAME( 1993, jolycdcr, jollycrd, cuoreuno, jolycdcr, funworld, ROT0, "Soft Design",     "Jolly Card (Croatia)", 0 )
2010GAME( 199?, jolycdit, jollycrd, cuoreuno, jolycdit, jolycdit, ROT0, "bootleg",         "Jolly Card (Italia, encrypted)", 0 )
2011GAME( 1990, jolycdab, jollycrd, funworld, funworld, funworld, ROT0, "Inter Games",     "Jolly Card (Austria, Fun World, bootleg)", GAME_NOT_WORKING )
2012GAME( 1986, bigdeal,  0,        bigdeal,  bigdeal,  funworld, ROT0, "Fun World",       "Big Deal (Hungary, set 1)", GAME_IMPERFECT_COLORS )
2013GAME( 1986, bigdealb, bigdeal,  bigdeal,  bigdeal,  funworld, ROT0, "Fun World",       "Big Deal (Hungary, set 2)", GAME_IMPERFECT_COLORS )
2014GAME( 1986, jolycdat, bigdeal,  bigdeal,  bigdeal,  funworld, ROT0, "Fun World",       "Jolly Card (Austria, Fun World)", GAME_IMPERFECT_COLORS )
2015GAME( 1996, cuoreuno, 0,        cuoreuno, cuoreuno, funworld, ROT0, "C.M.C.",          "Cuore 1 (Italia)", 0 )
2016GAME( 1997, elephfam, 0,        cuoreuno, cuoreuno, funworld, ROT0, "C.M.C.",          "Elephant Family (Italia, new)", 0 )
2017GAME( 1996, elephfmb, elephfam, cuoreuno, cuoreuno, funworld, ROT0, "C.M.C.",          "Elephant Family (Italia, old)", 0 )
2018GAME( 1996, pool10,   0,        cuoreuno, cuoreuno, funworld, ROT0, "C.M.C.",          "Pool 10 (Italia, set 1)", 0 )
2019GAME( 1996, pool10b,  pool10,   cuoreuno, cuoreuno, funworld, ROT0, "C.M.C.",          "Pool 10 (Italia, set 2)", 0 )
2020GAME( 1997, tortufam, 0,        cuoreuno, cuoreuno, funworld, ROT0, "C.M.C.",          "Tortuga Family (Italia)", 0 )
2021GAME( 1991, royalcrd, 0,        royalcrd, royalcrd, funworld, ROT0, "TAB-Austria",     "Royal Card (Austria, set 1)", 0 )
2022GAME( 1991, royalcdb, royalcrd, royalcrd, royalcrd, funworld, ROT0, "TAB-Austria",     "Royal Card (Austria, set 2)", 0 )
2023GAME( 1991, royalcdc, royalcrd, royalcrd, royalcrd, funworld, ROT0, "Evona Electronic","Royal Card (Slovakia, encrypted)", GAME_WRONG_COLORS | GAME_NOT_WORKING )
2024GAME( 1996, magiccrd, 0,        magiccrd, magiccrd, funworld, ROT0, "Impera",          "Magic Card II (Bulgaria, bootleg)", GAME_WRONG_COLORS | GAME_IMPERFECT_GRAPHICS | GAME_IMPERFECT_SOUND )
2025GAME( 1993, jokercrd, 0,        funworld, funworld, funworld, ROT0, "Vesely Svet",     "Joker Card (Ver.A267BC, encrypted)", GAME_WRONG_COLORS | GAME_NOT_WORKING )
2026GAME( 199?, monglfir, 0,        royalmcu, royalcrd, funworld, ROT0, "bootleg",         "Mongolfier New (Italia)", GAME_UNEMULATED_PROTECTION | GAME_NOT_WORKING )
2027GAME( 199?, soccernw, 0,        royalcrd, royalcrd, soccernw, ROT0, "bootleg",         "Soccer New (Italia)", GAME_UNEMULATED_PROTECTION | GAME_NOT_WORKING )
2028GAME( 1998, snookr10, 0,        snookr10, snookr10, 0,        ROT0, "Sandiy",          "Snooker 10 (Ver 1.11)", GAME_NO_SOUND | GAME_UNEMULATED_PROTECTION | GAME_NOT_WORKING )
2029GAME( 198?, saloon,   0,        funworld, funworld, funworld, ROT0, "Unknown",         "Saloon (France, encrypted)", GAME_NO_SOUND | GAME_WRONG_COLORS | GAME_IMPERFECT_GRAPHICS | GAME_UNEMULATED_PROTECTION | GAME_NOT_WORKING )
2166/*    YEAR  NAME      PARENT    MACHINE   INPUT     INIT             COMPANY            FULLNAME                                          FLAGS  */
2167GAME( 1985, jollycrd, 0,        funworld, funworld, funworld, ROT0, "TAB-Austria",     "Jolly Card (austrian)",                           0 )
2168GAME( 1985, jolycdae, jollycrd, funworld, funworld, jolycdae, ROT0, "TAB-Austria",     "Jolly Card (austrian, encrypted)",                0 )
2169GAME( 1985, jolyc3x3, jollycrd, funworld, funworld, funworld, ROT0, "TAB-Austria",     "Jolly Card (3x3 deal)",                           0 )
2170GAME( 2000, jolyc980, jollycrd, cuoreuno, funworld, funworld, ROT0, "Spale-Soft",      "Jolly Card Professional 2.0",                     0 )
2171GAME( 1993, jolycdcr, jollycrd, cuoreuno, jolycdcr, funworld, ROT0, "Soft Design",     "Jolly Card (croatian)",                           0 )
2172GAME( 199?, jolycdit, jollycrd, cuoreuno, jolycdit, tabblue,  ROT0, "bootleg",         "Jolly Card (italian, blue TAB board, encrypted)", 0 )
2173GAME( 1986, jolycdab, jollycrd, funworld, funworld, funworld, ROT0, "Inter Games",     "Jolly Card (austrian, Funworld, bootleg)",        GAME_NOT_WORKING )
2174GAME( 1986, bigdeal,  0,        bigdeal,  bigdeal,  funworld, ROT0, "Funworld",        "Big Deal (hungarian, set 1)",                     GAME_IMPERFECT_COLORS )
2175GAME( 1986, bigdealb, bigdeal,  bigdeal,  bigdeal,  funworld, ROT0, "Funworld",        "Big Deal (hungarian, set 2)",                     GAME_IMPERFECT_COLORS )
2176GAME( 1986, jolycdat, bigdeal,  bigdeal,  bigdeal,  funworld, ROT0, "Funworld",        "Jolly Card (austrian, Funworld)",                 GAME_IMPERFECT_COLORS )
2177GAME( 1996, cuoreuno, 0,        cuoreuno, cuoreuno, funworld, ROT0, "C.M.C.",          "Cuore 1 (italian)",                               0 )
2178GAME( 1997, elephfam, 0,        cuoreuno, cuoreuno, funworld, ROT0, "C.M.C.",          "Elephant Family (italian, new)",                  0 )
2179GAME( 1996, elephfmb, elephfam, cuoreuno, cuoreuno, funworld, ROT0, "C.M.C.",          "Elephant Family (italian, old)",                  0 )
2180GAME( 1996, pool10,   0,        cuoreuno, cuoreuno, funworld, ROT0, "C.M.C.",          "Pool 10 (italian, set 1)",                        0 )
2181GAME( 1996, pool10b,  pool10,   cuoreuno, cuoreuno, funworld, ROT0, "C.M.C.",          "Pool 10 (italian, set 2)",                        0 )
2182GAME( 1997, tortufam, 0,        cuoreuno, cuoreuno, funworld, ROT0, "C.M.C.",          "Tortuga Family (italian)",                        0 )
2183GAME( 1991, royalcrd, 0,        royalcrd, royalcrd, funworld, ROT0, "TAB-Austria",     "Royal Card (austrian, set 1)",                    0 )
2184GAME( 1991, royalcdb, royalcrd, royalcrd, royalcrd, funworld, ROT0, "TAB-Austria",     "Royal Card (austrian, set 2)",                    0 )
2185GAME( 1991, royalcdc, royalcrd, royalcrd, royalcrd, funworld, ROT0, "Evona Electronic","Royal Card (slovak, encrypted)",                  GAME_WRONG_COLORS | GAME_NOT_WORKING )
2186GAME( 1991, lluck3x3, royalcrd, cuoreuno, royalcrd, funworld, ROT0, "TAB-Austria",     "Lucky Lady (3x3 deal)",                           0 )
2187GAME( 1991, lluck4x1, royalcrd, royalcrd, royalcrd, funworld, ROT0, "TAB-Austria",     "Lucky Lady (4x1 aces)",                           0 )
2188GAME( 1996, magiccrd, 0,        magiccrd, magiccrd, funworld, ROT0, "Impera",          "Magic Card II (bulgarian)",                       GAME_IMPERFECT_SOUND )
2189GAME( 1996, magiccda, magiccrd, magiccrd, magiccrd, funworld, ROT0, "Impera",          "Magic Card II (green TAB or Impera board)",       GAME_NOT_WORKING )
2190GAME( 1996, magiccdb, magiccrd, magiccrd, magiccrd, tabblue,  ROT0, "Impera",          "Magic Card II (blue TAB board, encrypted)",       GAME_NOT_WORKING )
2191GAME( 1993, vegasslw, 0,        funworld, funworld, funworld, ROT0, "Funworld",        "Royal Vegas Joker Card (slow deal)",              0 )
2192GAME( 1993, vegasfst, vegasslw, funworld, funworld, funworld, ROT0, "Soft Design",     "Royal Vegas Joker Card (fast deal)",              0 )
2193GAME( 1993, jokercrd, 0,        funworld, funworld, funworld, ROT0, "Vesely Svet",     "Joker Card (Ver.A267BC, encrypted)",              GAME_WRONG_COLORS | GAME_NOT_WORKING )
2194GAME( 199?, mongolnw, 0,        royalmcu, royalcrd, funworld, ROT0, "bootleg",         "Mongolfier New (italian)",                        GAME_UNEMULATED_PROTECTION | GAME_NOT_WORKING )
2195GAME( 199?, soccernw, 0,        royalcrd, royalcrd, soccernw, ROT0, "bootleg",         "Soccer New (italian)",                            GAME_UNEMULATED_PROTECTION | GAME_NOT_WORKING )
2196GAME( 1998, snookr10, 0,        snookr10, snookr10, 0,        ROT0, "Sandii'",         "Snooker 10 (Ver 1.11)",                           GAME_NO_SOUND | GAME_UNEMULATED_PROTECTION | GAME_NOT_WORKING )
2197GAME( 198?, saloon,   0,        funworld, funworld, funworld, ROT0, "Unknown",         "Saloon (french, encrypted)",                      GAME_NO_SOUND | GAME_WRONG_COLORS | GAME_IMPERFECT_GRAPHICS | GAME_UNEMULATED_PROTECTION | GAME_NOT_WORKING )
src/mame/drivers/overdriv.c
r1679r1680
357357   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_COIN2 )
358358   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_START1 )
359359   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_SERVICE1 )
360   PORT_BIT(0x10, IP_ACTIVE_LOW, IPT_SERVICE ) PORT_NAME( DEF_STR( Service_Mode )) PORT_CODE(KEYCODE_F2)
360   PORT_SERVICE_NO_TOGGLE( 0x10, IP_ACTIVE_LOW )
361361   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_UNKNOWN )
362362   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNKNOWN )
363363   PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_SPECIAL )   // ?
src/mame/drivers/jackpool.c
r1679r1680
142142
143143static VIDEO_START(jackpool)
144144{
145   jackpool_layer0_tilemap = tilemap_create(get_jackpool_layer0_tile_info,tilemap_scan_rows,TILEMAP_TYPE_PEN, 8, 8,64,32);
146   jackpool_layer1_tilemap = tilemap_create(get_jackpool_layer1_tile_info,tilemap_scan_rows,TILEMAP_TYPE_PEN, 8, 8,64,32);
147   jackpool_layer2_tilemap = tilemap_create(get_jackpool_layer2_tile_info,tilemap_scan_rows,TILEMAP_TYPE_PEN, 8, 8,64,32);
145   jackpool_layer0_tilemap = tilemap_create(get_jackpool_layer0_tile_info,tilemap_scan_rows, 8, 8,64,32);
146   jackpool_layer1_tilemap = tilemap_create(get_jackpool_layer1_tile_info,tilemap_scan_rows, 8, 8,64,32);
147   jackpool_layer2_tilemap = tilemap_create(get_jackpool_layer2_tile_info,tilemap_scan_rows, 8, 8,64,32);
148148
149149   tilemap_set_transparent_pen(jackpool_layer0_tilemap,0);
150150   tilemap_set_transparent_pen(jackpool_layer2_tilemap,0);
src/mame/drivers/spcforce.c
r1679r1680
162162   PORT_BIT ( 0x01, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_2WAY PORT_COCKTAIL
163163   PORT_BIT ( 0x02, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_COCKTAIL
164164   PORT_BIT ( 0x04, IP_ACTIVE_LOW, IPT_UNUSED )
165   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_SERVICE ) PORT_NAME( DEF_STR( Service_Mode )) PORT_CODE(KEYCODE_F2)
165   PORT_SERVICE_NO_TOGGLE( 0x08, IP_ACTIVE_LOW )
166166   PORT_BIT ( 0x10, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_COCKTAIL
167167   PORT_BIT ( 0x20, IP_ACTIVE_LOW, IPT_UNUSED )
168168   PORT_BIT ( 0x40, IP_ACTIVE_LOW, IPT_VBLANK )
r1679r1680
206206   PORT_BIT ( 0x80, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_2WAY
207207
208208   PORT_START      /* IN1 */
209   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_SERVICE ) PORT_NAME( DEF_STR( Service_Mode )) PORT_CODE(KEYCODE_F2)
209   PORT_SERVICE_NO_TOGGLE( 0x08, IP_ACTIVE_LOW )
210210   PORT_BIT ( 0x40, IP_ACTIVE_LOW, IPT_VBLANK )
211211INPUT_PORTS_END
212212
src/mame/drivers/gsword.c
r1679r1680
719719   MDRV_SCREEN_SIZE(32*8, 32*8)
720720   MDRV_SCREEN_VISIBLE_AREA(0*8, 32*8-1, 2*8, 30*8-1)
721721   MDRV_GFXDECODE(gsword)
722   MDRV_PALETTE_LENGTH(256)
723   MDRV_COLORTABLE_LENGTH(64*4+64*4)
722   MDRV_PALETTE_LENGTH(64*4+64*4)
724723
725724   MDRV_PALETTE_INIT(gsword)
726725   MDRV_VIDEO_START(gsword)
r1679r1680
767766   MDRV_SCREEN_VISIBLE_AREA(0*8, 32*8-1, 2*8, 30*8-1)
768767
769768   MDRV_GFXDECODE(gsword)
770   MDRV_PALETTE_LENGTH(256)
771   MDRV_COLORTABLE_LENGTH(64*4+64*4)
769   MDRV_PALETTE_LENGTH(64*4+64*4)
772770
773771   MDRV_PALETTE_INIT(josvolly)
774772   MDRV_VIDEO_START(gsword)
r1679r1680
957955#endif
958956}
959957
960static DRIVER_INIT(josvolly)
961{
962}
963958
964GAME( 1984, gsword,   0,      gsword,   gsword, gsword,  ROT0,  "Taito Corporation", "Great Swordsman (World?)", 0 )
965GAME( 1984, gsword2,  gsword, gsword,   gsword, gsword2, ROT0,  "Taito Corporation", "Great Swordsman (Japan?)", 0 )
966GAME( 1983, josvolly, 0,      josvolly, josvolly, josvolly,       ROT90, "Taito Corporation", "Joshi Volleyball", GAME_UNEMULATED_PROTECTION|GAME_IMPERFECT_GRAPHICS|GAME_IMPERFECT_SOUND )
959GAME( 1983, josvolly, 0,      josvolly, josvolly, 0,       ROT90, "Taito Corporation", "Joshi Volleyball", GAME_UNEMULATED_PROTECTION | GAME_IMPERFECT_GRAPHICS | GAME_IMPERFECT_SOUND )
960GAME( 1984, gsword,   0,      gsword,   gsword,   gsword,  ROT0,  "Taito Corporation", "Great Swordsman (World?)", 0 )
961GAME( 1984, gsword2,  gsword, gsword,   gsword,   gsword2, ROT0,  "Taito Corporation", "Great Swordsman (Japan?)", 0 )
src/mame/drivers/nmg5.c
r1679r1680
799799
800800static VIDEO_START( nmg5 )
801801{
802   bg_tilemap = tilemap_create(bg_get_tile_info,tilemap_scan_rows,TILEMAP_TYPE_PEN,     8,8,64,64);
803   fg_tilemap = tilemap_create(fg_get_tile_info,tilemap_scan_rows,TILEMAP_TYPE_PEN,8,8,64,64);
802   bg_tilemap = tilemap_create(bg_get_tile_info,tilemap_scan_rows,8,8,64,64);
803   fg_tilemap = tilemap_create(fg_get_tile_info,tilemap_scan_rows,8,8,64,64);
804804
805805   tilemap_set_transparent_pen(fg_tilemap,0);
806806}
src/mame/drivers/mario.c
r1679r1680
175175   AM_RANGE(0x7e84, 0x7e84) AM_WRITE(interrupt_enable_w)
176176   AM_RANGE(0x7e85, 0x7e85) AM_WRITE(z80dma_0_rdy_w)   /* ==> DMA Chip */
177177   AM_RANGE(0x7f00, 0x7f07) AM_WRITE(mario_sh3_w) /* Sound port */
178   AM_RANGE(0x7f80, 0x7f80) AM_READ_PORT("DSW0")   /* DSW */
178   AM_RANGE(0x7f80, 0x7f80) AM_READ_PORT("DSW")   /* DSW */
179179   AM_RANGE(0x7e00, 0x7e00) AM_WRITE(mario_sh_tuneselect_w)
180180   AM_RANGE(0xf000, 0xffff) AM_ROM
181181ADDRESS_MAP_END
r1679r1680
195195   AM_RANGE(0x7e84, 0x7e84) AM_WRITE(interrupt_enable_w)
196196   AM_RANGE(0x7e85, 0x7e85) AM_WRITE(z80dma_0_rdy_w)   /* ==> DMA Chip */
197197   AM_RANGE(0x7f00, 0x7f00) AM_WRITE(masao_sh_irqtrigger_w)
198   AM_RANGE(0x7f80, 0x7f80) AM_READ_PORT("DSW0")   /* DSW */
198   AM_RANGE(0x7f80, 0x7f80) AM_READ_PORT("DSW")   /* DSW */
199199   AM_RANGE(0xf000, 0xffff) AM_ROM
200200ADDRESS_MAP_END
201201
src/mame/drivers/xmen.c
r1679r1680
368368   PORT_BIT( 0x0400, IP_ACTIVE_LOW, IPT_START3 )
369369   PORT_BIT( 0x0800, IP_ACTIVE_LOW, IPT_START4 )
370370   PORT_BIT( 0x3000, IP_ACTIVE_LOW, IPT_UNKNOWN )   /* unused? */
371   PORT_BIT(0x4000, IP_ACTIVE_LOW, IPT_SERVICE ) PORT_NAME( DEF_STR( Service_Mode )) PORT_CODE(KEYCODE_F2)
371   PORT_SERVICE_NO_TOGGLE( 0x4000, IP_ACTIVE_LOW )
372372   PORT_BIT( 0x8000, IP_ACTIVE_LOW, IPT_UNKNOWN )   /* unused? */
373373INPUT_PORTS_END
374374
r1679r1680
419419   PORT_BIT( 0x0800, IP_ACTIVE_LOW, IPT_START4 )
420420   PORT_BIT( 0x1000, IP_ACTIVE_LOW, IPT_START5 ) /* not verified */
421421   PORT_BIT( 0x2000, IP_ACTIVE_LOW, IPT_START6 ) /* not verified */
422   PORT_BIT(0x4000, IP_ACTIVE_LOW, IPT_SERVICE ) PORT_NAME( DEF_STR( Service_Mode )) PORT_CODE(KEYCODE_F2)
422   PORT_SERVICE_NO_TOGGLE( 0x4000, IP_ACTIVE_LOW )
423423   PORT_BIT( 0x8000, IP_ACTIVE_LOW, IPT_UNKNOWN )   /* screen indicator? */
424424
425425   /* players 5+6 */
r1679r1680
494494   PORT_BIT( 0x0400, IP_ACTIVE_LOW, IPT_UNKNOWN )
495495   PORT_BIT( 0x0800, IP_ACTIVE_LOW, IPT_UNKNOWN )
496496   PORT_BIT( 0x3000, IP_ACTIVE_LOW, IPT_UNKNOWN )   /* unused? */
497   PORT_BIT(0x4000, IP_ACTIVE_LOW, IPT_SERVICE ) PORT_NAME( DEF_STR( Service_Mode )) PORT_CODE(KEYCODE_F2)
497   PORT_SERVICE_NO_TOGGLE( 0x4000, IP_ACTIVE_LOW )
498498   PORT_BIT( 0x8000, IP_ACTIVE_LOW, IPT_UNKNOWN )   /* unused? */
499499INPUT_PORTS_END
500500
src/mame/drivers/silkroad.c
r1679r1680
284284   PORT_BIT( 0x0004, IP_ACTIVE_LOW, IPT_START1 )
285285   PORT_BIT( 0x0008, IP_ACTIVE_LOW, IPT_START2 )
286286   PORT_BIT( 0x0010, IP_ACTIVE_LOW, IPT_SERVICE1 )
287   PORT_BIT(0x0020, IP_ACTIVE_LOW, IPT_SERVICE ) PORT_NAME( DEF_STR( Service_Mode )) PORT_CODE(KEYCODE_F2)
287   PORT_SERVICE_NO_TOGGLE( 0x0020, IP_ACTIVE_LOW )
288288   PORT_BIT( 0x0040, IP_ACTIVE_LOW, IPT_SERVICE2 )   /* Not mentioned in the "test mode" */
289289   PORT_BIT( 0x0080, IP_ACTIVE_LOW, IPT_SPECIAL )   /* See notes - Stephh*/
290290   PORT_BIT( 0x0100, IP_ACTIVE_LOW, IPT_UNKNOWN )   // this input makes the 020 lock up...- RB
src/mame/drivers/wink.c
r1679r1680
270270
271271static VIDEO_START( wink )
272272{
273   bg_tilemap = tilemap_create(get_bg_tile_info, tilemap_scan_rows, TILEMAP_TYPE_PEN, 8, 8, 32, 32);
273   bg_tilemap = tilemap_create(get_bg_tile_info, tilemap_scan_rows, 8, 8, 32, 32);
274274}
275275
276276static VIDEO_UPDATE( wink )
src/mame/drivers/csk.c
r1679r1680
11/*****************************************************************************
22
33Champion Poker by IGS   (documented by Mirko Buffoni)
4Is this a Konami board?
54---
65
76Memory Layout (refers to CSK227IT.  Others may have different addresses)
r1679r1680
8988
9089Unknown:    5080        (RW)    (possibly related to ticket/hopper)
9190            5090-5091   (RW)    (possibly related to eprom counters)
92            50b0-50b1   (W)     (possibly sound related)
91            50b0-50b1   (W)     (OPL2 compatible chip)
9392            5083        (W)     (used only at reset, maybe)
9493            1000-10ff   (W) ???
9594            6000-67ff   (W) ???
r1679r1680
130129
131130#include "driver.h"
132131#include "cpu/z80/z80.h"
132#include "sound/2413intf.h"
133133
134134
135135extern UINT8 * cpk_colorram;
r1679r1680
200200   AM_RANGE(0x5082, 0x5082) AM_READ(input_port_6_r)      /* Coing & Kbd */
201201   AM_RANGE(0x5091, 0x5091) AM_READ(input_port_7_r)      /* Keyboard */
202202   AM_RANGE(0x50a0, 0x50a0) AM_READ(input_port_8_r)      /* Not connected */
203   AM_RANGE(0x50b0, 0x50b0) AM_WRITE(YM2413_register_port_0_w)
204   AM_RANGE(0x50b1, 0x50b1) AM_WRITE(YM2413_data_port_0_w)
203205   AM_RANGE(0x6800, 0x6fff) AM_WRITE(MWA8_RAM) AM_BASE(&cpk_expram)
204206   AM_RANGE(0x7000, 0x77ff) AM_RAM AM_BASE(&cpk_videoram)
205207   AM_RANGE(0x7800, 0x7fff) AM_RAM AM_BASE(&cpk_colorram)
r1679r1680
219221   AM_RANGE(0x5090, 0x5090) AM_WRITE(custom_io_w)
220222   AM_RANGE(0x5091, 0x5091) AM_READ(custom_io_r)         /* used for protection and other */
221223   AM_RANGE(0x50a0, 0x50a0) AM_READ(input_port_8_r)      /* Not connected */
224   AM_RANGE(0x50b0, 0x50b0) AM_WRITE(YM2413_register_port_0_w)
225   AM_RANGE(0x50b1, 0x50b1) AM_WRITE(YM2413_data_port_0_w)
222226   AM_RANGE(0x6800, 0x6fff) AM_WRITE(MWA8_RAM) AM_BASE(&cpk_expram)
223227   AM_RANGE(0x7000, 0x77ff) AM_RAM AM_BASE(&cpk_videoram)
224228   AM_RANGE(0x7800, 0x7fff) AM_RAM AM_BASE(&cpk_colorram)
r1679r1680
569573static MACHINE_DRIVER_START( csk227it )
570574
571575   /* basic machine hardware */
572   MDRV_CPU_ADD_TAG("main",Z80, 3579545)//(4000000?)
576   MDRV_CPU_ADD_TAG("main",Z80, 3579545)
573577   MDRV_CPU_PROGRAM_MAP(map,0)
574578   MDRV_CPU_IO_MAP(csk227_map,0)
575   MDRV_CPU_VBLANK_INT(cska_interrupt,6)
579   MDRV_CPU_VBLANK_INT(cska_interrupt,8)
576580
577581   MDRV_SCREEN_REFRESH_RATE(57)
578582   MDRV_SCREEN_VBLANK_TIME(DEFAULT_60HZ_VBLANK_DURATION)
r1679r1680
585589   MDRV_SCREEN_VISIBLE_AREA(0*8, 64*8-1, 0, 32*8-1)
586590   MDRV_GFXDECODE(csk)
587591   MDRV_PALETTE_LENGTH(2048)
588   MDRV_COLORTABLE_LENGTH(2048)
589592
590593   MDRV_VIDEO_START(cska)
591594   MDRV_VIDEO_UPDATE(cska)
592595
593596   /* sound hardware */
597   MDRV_SPEAKER_STANDARD_MONO("mono")
598
599   MDRV_SOUND_ADD(YM2413, 3579545)
600   MDRV_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.0)
601
594602MACHINE_DRIVER_END
595603
596604static MACHINE_DRIVER_START( csk234it )
r1679r1680
599607   MDRV_CPU_MODIFY("main")
600608   /* basic machine hardware */
601609   MDRV_CPU_IO_MAP(csk234_map,0)
602   MACHINE_DRIVER_END
603610
611MACHINE_DRIVER_END
612
604613/*  ROM Regions definition
605614 */
606615
r1679r1680
701710   }
702711}
703712
704GAME( 198?, csk227it, 0,        csk227it, csk227, cska, ROT0, "IGS", "Champion Skill (with Ability)", GAME_NO_SOUND )               /* SU 062 */
705GAME( 198?, csk234it, csk227it, csk234it, csk234, cska, ROT0, "IGS", "Champion Skill (Ability, Poker & Symbols)", GAME_NO_SOUND )   /* SU 062 */
713GAME( 198?, csk227it, 0,        csk227it, csk227, cska, ROT0, "IGS", "Champion Skill (with Ability)", 0 )               /* SU 062 */
714GAME( 198?, csk234it, csk227it, csk234it, csk234, cska, ROT0, "IGS", "Champion Skill (Ability, Poker & Symbols)", 0 )   /* SU 062 */
706715
707GAME( 1998, stellecu, 0,        csk234it, csk234, 0,    ROT0, "Sure", "Stelle e Cubi (Italy)", GAME_NOT_WORKING|GAME_NO_SOUND )
716GAME( 1998, stellecu, 0,        csk234it, csk234, 0,    ROT0, "Sure", "Stelle e Cubi (Italy)", GAME_NOT_WORKING )
src/mame/drivers/naughtyb.c
r1679r1680
393393   MDRV_SCREEN_VISIBLE_AREA(0*8, 36*8-1, 0*8, 28*8-1)
394394   MDRV_GFXDECODE(naughtyb)
395395   MDRV_PALETTE_LENGTH(256)
396   MDRV_COLORTABLE_LENGTH(32*4+32*4)
397396
398397   MDRV_PALETTE_INIT(naughtyb)
399398   MDRV_VIDEO_START(naughtyb)
r1679r1680
431430   MDRV_SCREEN_VISIBLE_AREA(0*8, 36*8-1, 0*8, 28*8-1)
432431   MDRV_GFXDECODE(naughtyb)
433432   MDRV_PALETTE_LENGTH(256)
434   MDRV_COLORTABLE_LENGTH(32*4+32*4)
435433
436434   MDRV_PALETTE_INIT(naughtyb)
437435   MDRV_VIDEO_START(naughtyb)
src/mame/drivers/taitowlf.c
r1679r1680
3737   }
3838}
3939
40static void draw_char(mame_bitmap *bitmap, const rectangle *cliprect, const gfx_element *gfx, int ch, int att, int x, int y)
40static void draw_char(running_machine *machine, mame_bitmap *bitmap, const rectangle *cliprect, const gfx_element *gfx, int ch, int att, int x, int y)
4141{
4242   int i,j;
4343   UINT8 *dp;
r1679r1680
5151      {
5252         UINT8 pen = dp[index++];
5353         if (pen)
54         {
55            p[i] = Machine->remapped_colortable[gfx->color_base + (att & 0xf)];
56         }
54            p[i] = machine->pens[gfx->color_base + (att & 0xf)];
5755         else
58         {
59            p[i] = Machine->remapped_colortable[gfx->color_base  + ((att >> 4) & 0x7)];
60         }
56            p[i] = machine->pens[gfx->color_base  + ((att >> 4) & 0x7)];
6157      }
6258   }
6359}
r1679r1680
8076         int att1 = (cga[index] >> 24) & 0xff;
8177         int ch1 = (cga[index] >> 16) & 0xff;
8278
83         draw_char(bitmap, cliprect, gfx, ch0, att0, i*8, j*8);
84         draw_char(bitmap, cliprect, gfx, ch1, att1, (i*8)+8, j*8);
79         draw_char(machine, bitmap, cliprect, gfx, ch0, att0, i*8, j*8);
80         draw_char(machine, bitmap, cliprect, gfx, ch1, att1, (i*8)+8, j*8);
8581         index++;
8682      }
8783   }
src/mame/drivers/kchamp.c
r1679r1680
462462   MDRV_SCREEN_VISIBLE_AREA(0, 32*8-1, 2*8, 30*8-1)
463463   MDRV_GFXDECODE(kchamp)
464464   MDRV_PALETTE_LENGTH(256)
465   MDRV_COLORTABLE_LENGTH(256)
466465
467466   MDRV_PALETTE_INIT(kchamp)
468467   MDRV_VIDEO_START(kchamp)
r1679r1680
511510   MDRV_SCREEN_VISIBLE_AREA(0, 32*8-1, 2*8, 30*8-1)
512511   MDRV_GFXDECODE(kchamp)
513512   MDRV_PALETTE_LENGTH(256)
514   MDRV_COLORTABLE_LENGTH(256)
515513
516514   MDRV_PALETTE_INIT(kchamp)
517515   MDRV_VIDEO_START(kchamp)
src/mame/drivers/olibochu.c
r1679r1680
8989static VIDEO_START( olibochu )
9090{
9191   bg_tilemap = tilemap_create(get_bg_tile_info, tilemap_scan_rows,
92      TILEMAP_TYPE_PEN, 8, 8, 32, 32);
92      8, 8, 32, 32);
9393}
9494
9595static void draw_sprites(running_machine *machine, mame_bitmap *bitmap, const rectangle *cliprect)
src/mame/drivers/tugboat.c
r1679r1680
5757
5858
5959
60/* see crtc6845.c. That file is only a placeholder, I process the writes here
60/* see mc6845.c. That file is only a placeholder, I process the writes here
6161   because I need the start_addr register to handle scrolling */
6262static WRITE8_HANDLER( tugboat_hd46505_0_w )
6363{
src/mame/drivers/gunbustr.c
r1679r1680
259259   PORT_BIT( 0x8000, IP_ACTIVE_LOW,  IPT_BUTTON2 ) PORT_PLAYER(2)
260260
261261   PORT_START      /* IN2 */
262   PORT_BIT(0x0001, IP_ACTIVE_LOW, IPT_SERVICE ) PORT_NAME( DEF_STR( Service_Mode )) PORT_CODE(KEYCODE_F2)
262   PORT_SERVICE_NO_TOGGLE( 0x0001, IP_ACTIVE_LOW )
263263   PORT_BIT( 0x0002, IP_ACTIVE_LOW,  IPT_SERVICE1 )
264264   PORT_BIT( 0x0004, IP_ACTIVE_LOW,  IPT_COIN1 )
265265   PORT_BIT( 0x0008, IP_ACTIVE_LOW,  IPT_COIN2 )
src/mame/drivers/scotrsht.c
r1679r1680
242242   MDRV_SCREEN_SIZE(32*8, 32*8)
243243   MDRV_SCREEN_VISIBLE_AREA(0*8, 32*8-1, 2*8, 30*8-1)
244244   MDRV_GFXDECODE(scotrsht)
245   MDRV_PALETTE_LENGTH(256)
246   MDRV_COLORTABLE_LENGTH(16*8*16+16*8*16)
245   MDRV_PALETTE_LENGTH(16*8*16+16*8*16)
247246
248247   MDRV_PALETTE_INIT(scotrsht)
249248   MDRV_VIDEO_START(scotrsht)
src/mame/drivers/markham.c
r1679r1680
1111#include "driver.h"
1212#include "sound/sn76496.h"
1313
14extern WRITE8_HANDLER( markham_videoram_w );
15extern WRITE8_HANDLER( markham_scroll_x_w );
16extern WRITE8_HANDLER( markham_flipscreen_w );
14WRITE8_HANDLER( markham_videoram_w );
15WRITE8_HANDLER( markham_flipscreen_w );
1716
18extern PALETTE_INIT( markham );
19extern VIDEO_START( markham );
20extern VIDEO_UPDATE( markham );
17PALETTE_INIT( markham );
18VIDEO_START( markham );
19VIDEO_UPDATE( markham );
2120
22static UINT8 *markham_sharedram;
21extern UINT8 *markham_xscroll;
2322
24/****************************************************************************/
2523
26
27static WRITE8_HANDLER( markham_sharedram_w )
28{
29   markham_sharedram[offset] = data;
30}
31
32static READ8_HANDLER( markham_sharedram_r )
33{
34   return markham_sharedram[offset];
35}
36
3724static READ8_HANDLER( markham_e004_r )
3825{
3926   return 0;
r1679r1680
4734   AM_RANGE(0xc000, 0xc7ff) AM_READ(MRA8_RAM)
4835   AM_RANGE(0xc800, 0xcfff) AM_READ(MRA8_RAM)
4936   AM_RANGE(0xd000, 0xd7ff) AM_READ(MRA8_RAM)
50   AM_RANGE(0xd800, 0xdfff) AM_READ(markham_sharedram_r)
37   AM_RANGE(0xd800, 0xdfff) AM_READ(MRA8_RAM) AM_SHARE(1)
5138
5239   AM_RANGE(0xe000, 0xe000) AM_READ(input_port_1_r) /* dsw 1 */
5340   AM_RANGE(0xe001, 0xe001) AM_READ(input_port_0_r) /* dsw 2 */
r1679r1680
6653   AM_RANGE(0xc000, 0xc7ff) AM_WRITE(MWA8_RAM)
6754   AM_RANGE(0xc800, 0xcfff) AM_WRITE(MWA8_RAM) AM_BASE(&spriteram) AM_SIZE(&spriteram_size)
6855   AM_RANGE(0xd000, 0xd7ff) AM_WRITE(markham_videoram_w) AM_BASE(&videoram)
69   AM_RANGE(0xd800, 0xdfff) AM_WRITE(markham_sharedram_w)
56   AM_RANGE(0xd800, 0xdfff) AM_WRITE(MWA8_RAM) AM_SHARE(1)
7057
7158   AM_RANGE(0xe008, 0xe008) AM_WRITE(MWA8_NOP) /* coin counter? */
7259
7360   AM_RANGE(0xe009, 0xe009) AM_WRITE(MWA8_NOP) /* to CPU2 busreq */
7461
75   AM_RANGE(0xe00c, 0xe00d) AM_WRITE(markham_scroll_x_w)
62   AM_RANGE(0xe00c, 0xe00d) AM_WRITE(MWA8_RAM) AM_BASE(&markham_xscroll)
7663   AM_RANGE(0xe00e, 0xe00e) AM_WRITE(markham_flipscreen_w)
7764ADDRESS_MAP_END
7865
7966static ADDRESS_MAP_START( readmem2, ADDRESS_SPACE_PROGRAM, 8 )
8067   AM_RANGE(0x0000, 0x5fff) AM_READ(MRA8_ROM)
81   AM_RANGE(0x8000, 0x87ff) AM_READ(MRA8_RAM)
68   AM_RANGE(0x8000, 0x87ff) AM_READ(MRA8_RAM) AM_SHARE(1)
8269ADDRESS_MAP_END
8370
8471static ADDRESS_MAP_START( writemem2, ADDRESS_SPACE_PROGRAM, 8 )
8572   AM_RANGE(0x0000, 0x5fff) AM_WRITE(MWA8_ROM)
86   AM_RANGE(0x8000, 0x87ff) AM_WRITE(MWA8_RAM) AM_BASE(&markham_sharedram)
73   AM_RANGE(0x8000, 0x87ff) AM_WRITE(MWA8_RAM) AM_SHARE(1)
8774
8875   AM_RANGE(0xc000, 0xc000) AM_WRITE(SN76496_0_w)
8976   AM_RANGE(0xc001, 0xc001) AM_WRITE(SN76496_1_w)
r1679r1680
229216   MDRV_SCREEN_SIZE(32*8, 32*8)
230217   MDRV_SCREEN_VISIBLE_AREA(1*8, 31*8-1, 2*8, 30*8-1)
231218   MDRV_GFXDECODE(markham)
232   MDRV_PALETTE_LENGTH(256)
233   MDRV_COLORTABLE_LENGTH(1024)
219   MDRV_PALETTE_LENGTH(1024)
234220
235221   MDRV_PALETTE_INIT(markham)
236222   MDRV_VIDEO_START(markham)
src/mame/drivers/dday.c
r1679r1680
269269   MDRV_SCREEN_VISIBLE_AREA(0*8, 32*8-1, 0*8, 28*8-1)
270270   MDRV_GFXDECODE(dday)
271271   MDRV_PALETTE_LENGTH(256)
272   MDRV_COLORTABLE_LENGTH(256)//8*8+8*4+8*4,
273272   MDRV_PALETTE_INIT(dday)
274273
275274   MDRV_VIDEO_ATTRIBUTES(VIDEO_TYPE_RASTER | VIDEO_HAS_SHADOWS)
src/mame/drivers/safarir.c
r1679r1680
156156
157157static VIDEO_START( safarir )
158158{
159   bg_tilemap = tilemap_create(get_bg_tile_info, tilemap_scan_rows, TILEMAP_TYPE_PEN, 8, 8, 32, 32);
160   fg_tilemap = tilemap_create(get_fg_tile_info, tilemap_scan_rows, TILEMAP_TYPE_PEN, 8, 8, 32, 32);
159   bg_tilemap = tilemap_create(get_bg_tile_info, tilemap_scan_rows, 8, 8, 32, 32);
160   fg_tilemap = tilemap_create(get_fg_tile_info, tilemap_scan_rows, 8, 8, 32, 32);
161161
162162   tilemap_set_transparent_pen(fg_tilemap, 0);
163163}
src/mame/drivers/gijoe.c
r1679r1680
173173      gijoe_objdma();
174174
175175      // 42.7us(clr) + 341.3us(xfer) delay at 6Mhz dotclock
176      timer_adjust(dmadelay_timer, JOE_DMADELAY, 0, attotime_zero);
176      timer_adjust_oneshot(dmadelay_timer, JOE_DMADELAY, 0);
177177   }
178178
179179   // trigger V-blank interrupt
r1679r1680
277277   PORT_BIT( 0x0008, IP_ACTIVE_LOW,  IPT_START4 )
278278   PORT_BIT( 0x0100, IP_ACTIVE_HIGH, IPT_SPECIAL )  // EEPROM data
279279   PORT_BIT( 0x0200, IP_ACTIVE_LOW,  IPT_SPECIAL )  // EEPROM ready (always 1)
280   PORT_BIT(0x0800, IP_ACTIVE_LOW, IPT_SERVICE ) PORT_NAME( DEF_STR( Service_Mode )) PORT_CODE(KEYCODE_F2)
280   PORT_SERVICE_NO_TOGGLE( 0x0800, IP_ACTIVE_LOW )
281281
282282   PORT_START
283283   PORT_BIT( 0x0001, IP_ACTIVE_LOW,  IPT_COIN1 )
src/mame/drivers/wilytowr.c
r1679r1680
155155static VIDEO_START( wilytowr )
156156{
157157   bg_tilemap = tilemap_create(get_bg_tile_info, tilemap_scan_rows,
158      TILEMAP_TYPE_PEN, 8, 8, 32, 32);
158      8, 8, 32, 32);
159159
160160   fg_tilemap = tilemap_create(get_fg_tile_info, tilemap_scan_rows,
161      TILEMAP_TYPE_PEN, 8, 8, 32, 32);
161      8, 8, 32, 32);
162162
163163   tilemap_set_scroll_cols(bg_tilemap, 32);
164164   tilemap_set_transparent_pen(fg_tilemap, 0);
src/mame/drivers/looping.c
r1679r1680
175175{
176176   looping_state *state = machine->driver_data;
177177
178   state->bg_tilemap = tilemap_create(get_tile_info, tilemap_scan_rows, TILEMAP_TYPE_PEN, 8,8, 32,32);
178   state->bg_tilemap = tilemap_create(get_tile_info, tilemap_scan_rows, 8,8, 32,32);
179179
180180   tilemap_set_scroll_cols(state->bg_tilemap, 0x20);
181181}
src/mame/drivers/segas32.c
r1679r1680
482482         if (duration)
483483         {
484484            attotime period = attotime_make(0, attotime_to_attoseconds(ATTOTIME_IN_HZ(TIMER_0_CLOCK)) * duration);
485            timer_adjust(v60_irq_timer[0], period, MAIN_IRQ_TIMER0, attotime_never);
485            timer_adjust_oneshot(v60_irq_timer[0], period, MAIN_IRQ_TIMER0);
486486         }
487487         break;
488488
r1679r1680
493493         if (duration)
494494         {
495495            attotime period = attotime_make(0, attotime_to_attoseconds(ATTOTIME_IN_HZ(TIMER_1_CLOCK)) * duration);
496            timer_adjust(v60_irq_timer[1], period, MAIN_IRQ_TIMER1, attotime_never);
496            timer_adjust_oneshot(v60_irq_timer[1], period, MAIN_IRQ_TIMER1);
497497         }
498498         break;
499499
src/mame/drivers/1945kiii.c
r1679r1680
7676
7777static VIDEO_START(k3)
7878{
79   k3_bg_tilemap = tilemap_create(get_k3_bg_tile_info,tilemap_scan_rows,TILEMAP_TYPE_PEN,      16, 16, 32,64);
79   k3_bg_tilemap = tilemap_create(get_k3_bg_tile_info,tilemap_scan_rows,16, 16, 32,64);
8080}
8181
8282static void draw_sprites(running_machine *machine, mame_bitmap *bitmap, const rectangle *cliprect)
src/mame/drivers/slapfght.c
r1679r1680
459459   PORT_DIPNAME( 0x80, 0x80, DEF_STR( Unused ) )
460460   PORT_DIPSETTING(    0x80, DEF_STR( Off ) )
461461   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
462   PORT_BIT(    0x40, 0x40, IPT_DIPSWITCH_NAME ) PORT_NAME("Dipswitch Test") PORT_CODE(KEYCODE_F2) PORT_TOGGLE
463   PORT_DIPSETTING(    0x40, DEF_STR( Off ) )
464   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
462   PORT_SERVICE( 0x40, IP_ACTIVE_LOW )
465463   /* Actually, the following DIPSW doesnt seem to do anything */
466464   PORT_BIT(    0x20, 0x20, IPT_DIPSWITCH_NAME ) PORT_NAME("Screen Test") PORT_CODE(KEYCODE_F1) PORT_TOGGLE
467465   PORT_DIPSETTING(    0x20, DEF_STR( Off ) )
r1679r1680
530528   PORT_DIPNAME( 0x20, 0x20, DEF_STR( Flip_Screen ) )
531529   PORT_DIPSETTING(    0x20, DEF_STR( Off ) )
532530   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
533   PORT_BIT(    0x40, 0x40, IPT_DIPSWITCH_NAME ) PORT_NAME("Dipswitch Test") PORT_CODE(KEYCODE_F2) PORT_TOGGLE
534   PORT_DIPSETTING(    0x40, DEF_STR( Off ) )
535   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
531   PORT_SERVICE( 0x40, IP_ACTIVE_LOW )
536532   PORT_DIPNAME( 0x80, 0x80, "Player Speed" )
537533   PORT_DIPSETTING(    0x80, DEF_STR( Normal ) )
538534   PORT_DIPSETTING(    0x00, "Fast" )
r1679r1680
592588   PORT_DIPNAME( 0x01, 0x01, DEF_STR( Unknown ) )
593589   PORT_DIPSETTING(    0x01, DEF_STR( Off ) )
594590   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
595   PORT_BIT(    0x02, 0x02, IPT_DIPSWITCH_NAME ) PORT_NAME("Dipswitch Test") PORT_CODE(KEYCODE_F2) PORT_TOGGLE
596   PORT_DIPSETTING(    0x02, DEF_STR( Off ) )
597   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
591   PORT_SERVICE( 0x02, IP_ACTIVE_LOW )
598592   PORT_DIPNAME( 0x0c, 0x0c, DEF_STR( Lives ) )
599593   PORT_DIPSETTING(    0x08, "1" )
600594   PORT_DIPSETTING(    0x00, "2" )
r1679r1680
652646   PORT_DIPNAME( 0x20, 0x20, DEF_STR( Flip_Screen ) )
653647   PORT_DIPSETTING(    0x20, DEF_STR( Off ) )
654648   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
655   PORT_BIT(    0x40, 0x40, IPT_DIPSWITCH_NAME ) PORT_NAME("Dipswitch Test") PORT_CODE(KEYCODE_F2) PORT_TOGGLE
656   PORT_DIPSETTING(    0x40, DEF_STR( Off ) )
657   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
649   PORT_SERVICE( 0x40, IP_ACTIVE_LOW )
658650   PORT_DIPNAME( 0x80, 0x80, DEF_STR( Unknown ) )
659651   PORT_DIPSETTING(    0x80, DEF_STR( Off ) )
660652   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
r1679r1680
723715   PORT_DIPNAME( 0x20, 0x20, DEF_STR( Flip_Screen ) )
724716   PORT_DIPSETTING(    0x20, DEF_STR( Off ) )
725717   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
726   PORT_BIT(    0x40, 0x40, IPT_DIPSWITCH_NAME ) PORT_NAME("Dipswitch Test") PORT_CODE(KEYCODE_F2) PORT_TOGGLE
727   PORT_DIPSETTING(    0x40, DEF_STR( Off ) )
728   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
718   PORT_SERVICE( 0x40, IP_ACTIVE_LOW )
729719   PORT_DIPNAME( 0x80, 0x80, DEF_STR( Unknown ) )
730720   PORT_DIPSETTING(    0x80, DEF_STR( Off ) )
731721   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
r1679r1680
936926static MACHINE_DRIVER_START( tigerh )
937927
938928   /* basic machine hardware */
939   MDRV_CPU_ADD(Z80, 6000000)
929   MDRV_CPU_ADD(Z80, XTAL_36MHz/6) /* verified on pcb */
940930   MDRV_CPU_PROGRAM_MAP(tigerh_readmem,writemem)
941931   MDRV_CPU_IO_MAP(tigerh_readport,tigerh_writeport)
942932   MDRV_CPU_VBLANK_INT(irq0_line_hold,1)
943933
944   MDRV_CPU_ADD(Z80, 6000000)
934   MDRV_CPU_ADD(Z80, XTAL_36MHz/12) /* verified on pcb */
945935   MDRV_CPU_PROGRAM_MAP(sound_readmem,sound_writemem)
946936   MDRV_CPU_VBLANK_INT(nmi_line_pulse,6)    /* ??? */
947937
948   MDRV_CPU_ADD(M68705,4000000)
938   MDRV_CPU_ADD(M68705,XTAL_36MHz/12) /* verified on pcb */
949939   MDRV_CPU_PROGRAM_MAP(m68705_readmem,m68705_writemem)
950940
951941   MDRV_SCREEN_REFRESH_RATE(60)
r1679r1680
970960   /* sound hardware */
971961   MDRV_SPEAKER_STANDARD_MONO("mono")
972962
973   MDRV_SOUND_ADD(AY8910, 1500000)
963   MDRV_SOUND_ADD(AY8910, XTAL_36MHz/24) /* verified on pcb */
974964   MDRV_SOUND_CONFIG(ay8910_interface_1)
975965   MDRV_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.25)
976966
977   MDRV_SOUND_ADD(AY8910, 1500000)
967   MDRV_SOUND_ADD(AY8910, XTAL_36MHz/24) /* verified on pcb */
978968   MDRV_SOUND_CONFIG(ay8910_interface_2)
979969   MDRV_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.25)
980970MACHINE_DRIVER_END
r1679r1680
982972static MACHINE_DRIVER_START( slapfigh )
983973
984974   /* basic machine hardware */
985   MDRV_CPU_ADD_TAG("main",Z80, 6000000)
975   MDRV_CPU_ADD_TAG("main",Z80, XTAL_36MHz/6) /* verified on pcb */
986976   MDRV_CPU_PROGRAM_MAP(readmem,writemem)
987977   MDRV_CPU_IO_MAP(readport,writeport)
988978   MDRV_CPU_VBLANK_INT(irq0_line_hold,1)
989979
990   MDRV_CPU_ADD(Z80, 6000000)
980   MDRV_CPU_ADD(Z80, XTAL_36MHz/12) /* verified on pcb */
991981   MDRV_CPU_PROGRAM_MAP(sound_readmem,sound_writemem)
992982   MDRV_CPU_VBLANK_INT(getstar_interrupt, 3)
993983
r1679r1680
10131003   /* sound hardware */
10141004   MDRV_SPEAKER_STANDARD_MONO("mono")
10151005
1016   MDRV_SOUND_ADD(AY8910, 1500000)
1006   MDRV_SOUND_ADD(AY8910, XTAL_36MHz/24) /* verified on pcb */
10171007   MDRV_SOUND_CONFIG(ay8910_interface_1)
10181008   MDRV_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.25)
10191009
1020   MDRV_SOUND_ADD(AY8910, 1500000)
1010   MDRV_SOUND_ADD(AY8910, XTAL_36MHz/24) /* verified on pcb */
10211011   MDRV_SOUND_CONFIG(ay8910_interface_2)
10221012   MDRV_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.25)
10231013MACHINE_DRIVER_END
src/mame/drivers/astinvad.c
r1679r1680
183183   /* interrupts are asserted on every state change of the 128V line */
184184   cpunum_set_input_line(machine, 0, 0, ASSERT_LINE);
185185   param ^= 128;
186   timer_adjust(int_timer, video_screen_get_time_until_pos(0, param, 0), param, attotime_never);
186   timer_adjust_oneshot(int_timer, video_screen_get_time_until_pos(0, param, 0), param);
187187
188188   /* an RC circuit turns the interrupt off after a short amount of time */
189189   timer_set(double_to_attotime(300 * 0.1e-6), NULL, 0, kamikaze_int_off);
r1679r1680
194194{
195195   ppi8255_init(&ppi8255_intf);
196196   int_timer = timer_alloc(kamizake_int_gen, NULL);
197   timer_adjust(int_timer, video_screen_get_time_until_pos(0, 128, 0), 128, attotime_never);
197   timer_adjust_oneshot(int_timer, video_screen_get_time_until_pos(0, 128, 0), 128);
198198}
199199
200200
src/mame/drivers/darkhors.c
r1679r1680
139139static VIDEO_START( darkhors )
140140{
141141   darkhors_tmap         =   tilemap_create(   get_tile_info_0, tilemap_scan_rows,
142                                    TILEMAP_TYPE_PEN, 16,16, 0x40,0x40   );
142                                    16,16, 0x40,0x40   );
143143
144144   darkhors_tmap2         =   tilemap_create(   get_tile_info_1, tilemap_scan_rows,
145                                    TILEMAP_TYPE_PEN, 16,16, 0x40,0x40   );
145                                    16,16, 0x40,0x40   );
146146
147147   tilemap_set_transparent_pen(darkhors_tmap, 0);
148148   tilemap_set_transparent_pen(darkhors_tmap2, 0);
src/mame/drivers/bishjan.c
r1679r1680
6868static VIDEO_START(bishjan)
6969{
7070   tmap1 = tilemap_create(   get_tile_info1, tilemap_scan_rows,
71                     TILEMAP_TYPE_PEN, 8,8, 0x80,0x40   );
71                      8,8, 0x80,0x40   );
7272
7373   tmap2 = tilemap_create(   get_tile_info2, tilemap_scan_rows,
74                     TILEMAP_TYPE_PEN, 8,8, 0x80,0x40   );
74                      8,8, 0x80,0x40   );
7575
7676   tilemap_set_transparent_pen(tmap1, 0);
7777   tilemap_set_transparent_pen(tmap2, 0);
src/mame/drivers/mystwarr.c
r1679r1680
10841084   PORT_START
10851085   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_SPECIAL )   /* EEPROM data */
10861086   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_SPECIAL )   /* EEPROM ready (always 1) */
1087   PORT_BIT(0x04, IP_ACTIVE_LOW, IPT_SERVICE ) PORT_NAME( DEF_STR( Service_Mode )) PORT_CODE(KEYCODE_F2)
1087   PORT_SERVICE_NO_TOGGLE( 0x04, IP_ACTIVE_LOW )
10881088   PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_SPECIAL )   /* game loops if this is set */
10891089   PORT_DIPNAME( 0x10, 0x00, "Sound Output")
10901090   PORT_DIPSETTING(    0x10, DEF_STR( Mono ))
r1679r1680
11531153   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_SPECIAL )   /* EEPROM data */
11541154   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_SPECIAL )   /* EEPROM ready (always 1) */
11551155   PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_SPECIAL )
1156   PORT_BIT(0x08, IP_ACTIVE_LOW, IPT_SERVICE ) PORT_NAME( DEF_STR( Service_Mode )) PORT_CODE(KEYCODE_F2)
1156   PORT_SERVICE_NO_TOGGLE( 0x04, IP_ACTIVE_LOW )
11571157   PORT_DIPNAME( 0x10, 0x00, "Sound Output")
11581158   PORT_DIPSETTING(    0x10, DEF_STR( Mono ))
11591159   PORT_DIPSETTING(    0x00, DEF_STR( Stereo ))
r1679r1680
12231223   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_SPECIAL )   /* EEPROM data */
12241224   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_SPECIAL )   /* EEPROM ready (always 1) */
12251225   PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_SPECIAL )
1226   PORT_BIT(0x08, IP_ACTIVE_LOW, IPT_SERVICE ) PORT_NAME( DEF_STR( Service_Mode )) PORT_CODE(KEYCODE_F2)
1226   PORT_SERVICE_NO_TOGGLE( 0x08, IP_ACTIVE_LOW )
12271227   PORT_DIPNAME( 0x10, 0x00, "Sound Output")
12281228   PORT_DIPSETTING(    0x10, DEF_STR( Mono ))
12291229   PORT_DIPSETTING(    0x00, DEF_STR( Stereo ))
r1679r1680
12831283   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_COIN1 )
12841284   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_COIN2 )
12851285   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_UNKNOWN )
1286   PORT_BIT(0x08, IP_ACTIVE_LOW, IPT_SERVICE ) PORT_NAME( DEF_STR( Service_Mode )) PORT_CODE(KEYCODE_F2)
1286   PORT_SERVICE_NO_TOGGLE( 0x08, IP_ACTIVE_LOW )
12871287   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_SERVICE1 )
12881288   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_SERVICE2 )
12891289   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNKNOWN )
r1679r1680
12931293   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_SPECIAL )   /* EEPROM data */
12941294   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_SPECIAL )   /* EEPROM ready (always 1) */
12951295   PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_SPECIAL )
1296   PORT_BIT(0x08, IP_ACTIVE_LOW, IPT_SERVICE ) PORT_NAME( DEF_STR( Service_Mode )) PORT_CODE(KEYCODE_F2)
1296   PORT_SERVICE_NO_TOGGLE( 0x08, IP_ACTIVE_LOW )
12971297   PORT_DIPNAME( 0x10, 0x00, "Sound Output")
12981298   PORT_DIPSETTING(    0x10, DEF_STR( Mono ))
12991299   PORT_DIPSETTING(    0x00, DEF_STR( Stereo ))
r1679r1680
13581358   PORT_START
13591359   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_SPECIAL )   /* EEPROM data */
13601360   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_SPECIAL )   /* EEPROM ready (always 1) */
1361   PORT_BIT(0x04, IP_ACTIVE_LOW, IPT_SERVICE ) PORT_NAME( DEF_STR( Service_Mode )) PORT_CODE(KEYCODE_F2)
1361   PORT_SERVICE_NO_TOGGLE( 0x04, IP_ACTIVE_LOW )
13621362   PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_SPECIAL )   /* game loops if this is set */
13631363   PORT_DIPNAME( 0x10, 0x00, "Sound Output")
13641364   PORT_DIPSETTING(    0x10, DEF_STR( Mono ))
src/mame/drivers/jollyjgr.c
r1679r1680
273273
274274static VIDEO_START( jollyjgr )
275275{
276   bg_tilemap = tilemap_create(get_bg_tile_info, tilemap_scan_rows, TILEMAP_TYPE_PEN, 8, 8, 32, 32);
276   bg_tilemap = tilemap_create(get_bg_tile_info, tilemap_scan_rows, 8, 8, 32, 32);
277277
278278   tilemap_set_transparent_pen(bg_tilemap, 0);
279279   tilemap_set_scroll_cols(bg_tilemap, 32);
src/mame/drivers/skykid.c
r1679r1680
473473   MDRV_SCREEN_SIZE(36*8, 28*8)
474474   MDRV_SCREEN_VISIBLE_AREA(0*8, 36*8-1, 0*8, 28*8-1)
475475   MDRV_GFXDECODE(skykid)
476   MDRV_PALETTE_LENGTH(256)
477   MDRV_COLORTABLE_LENGTH(64*4+128*4+64*8)
476   MDRV_PALETTE_LENGTH(64*4+128*4+64*8)
478477
479478   MDRV_PALETTE_INIT(skykid)
480479   MDRV_VIDEO_START(skykid)
r1679r1680
658657}
659658
660659GAME( 1984, drgnbstr, 0,      skykid, drgnbstr, skykid,  ROT0,   "Namco", "Dragon Buster", GAME_SUPPORTS_SAVE )
661GAME( 1985, skykid,   0,      skykid, skykid,   skykid,  ROT180, "Namco", "Sky Kid (New Ver.)", GAME_SUPPORTS_SAVE ) /* Uses CUS63 aka 63a1 */
662GAME( 1985, skykido,  skykid, skykid, skykid,   skykid,  ROT180, "Namco", "Sky Kid (Old Ver.)", GAME_SUPPORTS_SAVE ) /* Uses CUS63 aka 63a1 */
663GAME( 1985, skykidd,  skykid, skykid, skykid,   skykid,  ROT180, "Namco", "Sky Kid (CUS60 Ver.)", GAME_SUPPORTS_SAVE ) /* Uses CUS60 aka 60a1 */
660GAME( 1985, skykid,   0,      skykid, skykid,   skykid,  ROT180, "Namco", "Sky Kid (new version)", GAME_SUPPORTS_SAVE ) /* Uses CUS63 aka 63a1 */
661GAME( 1985, skykido,  skykid, skykid, skykid,   skykid,  ROT180, "Namco", "Sky Kid (old version)", GAME_SUPPORTS_SAVE ) /* Uses CUS63 aka 63a1 */
662GAME( 1985, skykidd,  skykid, skykid, skykid,   skykid,  ROT180, "Namco", "Sky Kid (CUS60 version)", GAME_SUPPORTS_SAVE ) /* Uses CUS60 aka 60a1 */
664663
665664// no license text is displayed but the PCB was licensed by Namco for production by Sipem (formerly Sidam) with Namco supplying the Custom chips (MCU etc.)
666665// the level select is handled in a much more user-friendly way in this set and the dip for it is inverted (although this is displayed incorrectly in the test mode)
667GAME( 1985, skykids,  skykid, skykid, skykids,  skykid,  ROT180, "Namco [Sipem license]", "Sky Kid (Manufactured by Sipem)", GAME_SUPPORTS_SAVE ) /* Uses CUS63 aka 63a1 */
666GAME( 1985, skykids,  skykid, skykid, skykids,  skykid,  ROT180, "Namco [Sipem license]", "Sky Kid (Sipem)", GAME_SUPPORTS_SAVE ) /* Uses CUS63 aka 63a1 */
src/mame/drivers/quizpani.c
r1679r1680
241241GFXDECODE_END
242242
243243
244static MACHINE_RESET( quizpani )
245{
246   NMK112_init(0);
247}
248
244249static MACHINE_DRIVER_START( quizpani )
245250   MDRV_CPU_ADD(M68000, 10000000)
246251   MDRV_CPU_PROGRAM_MAP(quizpani_readmem,quizpani_writemem)
247252   MDRV_CPU_VBLANK_INT(irq4_line_hold,1)
248253   MDRV_CPU_PERIODIC_INT(irq1_line_hold,164) // music tempo
249254
255   MDRV_MACHINE_RESET( quizpani )
256
250257   MDRV_SCREEN_REFRESH_RATE(60)
251258   MDRV_SCREEN_VBLANK_TIME(DEFAULT_60HZ_VBLANK_DURATION)
252259
src/mame/drivers/halleys.c
r1679r1680
10071007      else
10081008      {
10091009         blitter_busy = 1;
1010         timer_adjust(blitter_reset_timer, ATTOTIME_IN_CYCLES(100, 0), 0, attotime_zero); // free blitter if no updates in 100 cycles
1010         timer_adjust_oneshot(blitter_reset_timer, ATTOTIME_IN_CYCLES(100, 0), 0); // free blitter if no updates in 100 cycles
10111011      }
10121012   }
10131013}
src/mame/drivers/ssfindo.c
r1679r1680
268268   int val=((PS7500_IO[T0low]&0xff)|((PS7500_IO[T0high]&0xff)<<8))>>1;
269269
270270   if(val==0)
271      timer_adjust(PS7500timer0, attotime_never, 0, attotime_never);
271      timer_adjust_oneshot(PS7500timer0, attotime_never, 0);
272272   else
273      timer_adjust(PS7500timer0, ATTOTIME_IN_USEC(val ), 0, ATTOTIME_IN_USEC(val ));
273      timer_adjust_periodic(PS7500timer0, ATTOTIME_IN_USEC(val ), 0, ATTOTIME_IN_USEC(val ));
274274}
275275
276276static TIMER_CALLBACK( PS7500_Timer1_callback )
r1679r1680
286286{
287287   int val=((PS7500_IO[T1low]&0xff)|((PS7500_IO[T1high]&0xff)<<8))>>1;
288288   if(val==0)
289      timer_adjust(PS7500timer1, attotime_never, 0, attotime_never);
289      timer_adjust_oneshot(PS7500timer1, attotime_never, 0);
290290   else
291      timer_adjust(PS7500timer1, ATTOTIME_IN_USEC(val ), 0, ATTOTIME_IN_USEC(val ));
291      timer_adjust_periodic(PS7500timer1, ATTOTIME_IN_USEC(val ), 0, ATTOTIME_IN_USEC(val ));
292292}
293293
294294static INTERRUPT_GEN( ssfindo_interrupt )
r1679r1680
305305      PS7500_IO[IOCR]         =   0x3f;
306306      PS7500_IO[VIDCR]      =   0;
307307
308      timer_adjust( PS7500timer0, attotime_never, 0, attotime_never);
309      timer_adjust( PS7500timer1, attotime_never, 0, attotime_never);
308      timer_adjust_oneshot( PS7500timer0, attotime_never, 0);
309      timer_adjust_oneshot( PS7500timer1, attotime_never, 0);
310310}
311311
312312static READ32_HANDLER(PS7500_IO_r)
src/mame/drivers/peplus.c
r1679r1680
623623
624624static VIDEO_START( peplus )
625625{
626   bg_tilemap = tilemap_create(get_bg_tile_info, tilemap_scan_rows, TILEMAP_TYPE_PEN, 8, 8, 40, 25);
626   bg_tilemap = tilemap_create(get_bg_tile_info, tilemap_scan_rows, 8, 8, 40, 25);
627627   palette_ram = auto_malloc(0x3000);
628628   memset(palette_ram, 0, 0x3000);
629629}
src/mame/drivers/segas24.c
r1679r1680
846846   int freq = (irq_timerb << 12) | irq_timera;
847847   freq &= 0x1fff;
848848
849   timer_adjust(irq_timer, ATTOTIME_IN_HZ(freq), 0, ATTOTIME_IN_HZ(freq));
849   timer_adjust_periodic(irq_timer, ATTOTIME_IN_HZ(freq), 0, ATTOTIME_IN_HZ(freq));
850850   logerror("New timer frequency: %0d [%02x %04x]\n", freq, irq_timerb, irq_timera);
851851}
852852
src/mame/drivers/namcoic.c
r1679r1680
6262   mTilemapInfo.videoram = auto_malloc( 0x10000*2 );
6363
6464      /* four scrolling tilemaps */
65      mTilemapInfo.tmap[0] = tilemap_create(get_tile_info0,tilemap_scan_rows,TILEMAP_TYPE_PEN,8,8,64,64);
66      mTilemapInfo.tmap[1] = tilemap_create(get_tile_info1,tilemap_scan_rows,TILEMAP_TYPE_PEN,8,8,64,64);
67      mTilemapInfo.tmap[2] = tilemap_create(get_tile_info2,tilemap_scan_rows,TILEMAP_TYPE_PEN,8,8,64,64);
68      mTilemapInfo.tmap[3] = tilemap_create(get_tile_info3,tilemap_scan_rows,TILEMAP_TYPE_PEN,8,8,64,64);
65      mTilemapInfo.tmap[0] = tilemap_create(get_tile_info0,tilemap_scan_rows,8,8,64,64);
66      mTilemapInfo.tmap[1] = tilemap_create(get_tile_info1,tilemap_scan_rows,8,8,64,64);
67      mTilemapInfo.tmap[2] = tilemap_create(get_tile_info2,tilemap_scan_rows,8,8,64,64);
68      mTilemapInfo.tmap[3] = tilemap_create(get_tile_info3,tilemap_scan_rows,8,8,64,64);
6969
7070      /* two non-scrolling tilemaps */
71      mTilemapInfo.tmap[4] = tilemap_create(get_tile_info4,tilemap_scan_rows,TILEMAP_TYPE_PEN,8,8,36,28);
72      mTilemapInfo.tmap[5] = tilemap_create(get_tile_info5,tilemap_scan_rows,TILEMAP_TYPE_PEN,8,8,36,28);
71      mTilemapInfo.tmap[4] = tilemap_create(get_tile_info4,tilemap_scan_rows,8,8,36,28);
72      mTilemapInfo.tmap[5] = tilemap_create(get_tile_info5,tilemap_scan_rows,8,8,36,28);
7373
7474      /* define offsets for scrolling */
7575      for( i=0; i<4; i++ )
r1679r1680
277277      if( gfx )
278278      {
279279         int shadow_offset = (machine->drv->video_attributes&VIDEO_HAS_SHADOWS)?machine->drv->total_colors:0;
280         const pen_t *pal = &machine->remapped_colortable[gfx->color_base + gfx->color_granularity * (color % gfx->total_colors)];
280         const pen_t *pal = &machine->pens[gfx->color_base + gfx->color_granularity * (color % gfx->total_colors)];
281281         UINT8 *source_base = gfx->gfxdata + (code % gfx->total_elements) * gfx->char_modulo;
282282         int sprite_screen_height = (scaley*gfx->height+0x8000)>>16;
283283         int sprite_screen_width = (scalex*gfx->width+0x8000)>>16;
r1679r1680
11361136         mRozTilemap[i] = tilemap_create(
11371137            roz_info[i],
11381138            namco_roz_scan,
1139            TILEMAP_TYPE_PEN,
11401139            16,16,
11411140            256,256 );
11421141      }
r1679r1680
16241623            machine->gfx[gfxbank] = pGfx;
16251624            mpRoadTilemap = tilemap_create(
16261625               get_road_info,tilemap_scan_rows,
1627               TILEMAP_TYPE_PEN,
16281626               ROAD_TILE_SIZE,ROAD_TILE_SIZE,
16291627               ROAD_COLS,ROAD_ROWS);
16301628
src/mame/drivers/ddayjlc.c
r1679r1680
342342
343343static VIDEO_START( ddayjlc )
344344{
345   bg_tilemap = tilemap_create(get_tile_info_bg,tilemap_scan_rows,TILEMAP_TYPE_PEN,8,8,32,32);
345   bg_tilemap = tilemap_create(get_tile_info_bg,tilemap_scan_rows,8,8,32,32);
346346}
347347
348348static VIDEO_UPDATE( ddayjlc )
src/mame/drivers/neogeo.c
r1679r1680
165165      attotime period = attotime_mul(ATTOTIME_IN_HZ(NEOGEO_PIXEL_CLOCK), display_counter + 1);
166166      if (LOG_VIDEO_SYSTEM) logerror("adjust_display_position_interrupt_timer  current y: %02x  current x: %02x   target y: %x  target x: %x\n", video_screen_get_vpos(0), video_screen_get_hpos(0), (display_counter + 1) / NEOGEO_HTOTAL, (display_counter + 1) % NEOGEO_HTOTAL);
167167
168      timer_adjust(display_position_interrupt_timer, period, 0, attotime_zero);
168      timer_adjust_oneshot(display_position_interrupt_timer, period, 0);
169169   }
170170}
171171
r1679r1680
253253   }
254254
255255   /* set timer for next screen */
256   timer_adjust(display_position_vblank_timer, video_screen_get_time_until_pos(0, NEOGEO_VBSTART, NEOGEO_VBLANK_RELOAD_HPOS), 0, attotime_zero);
256   timer_adjust_oneshot(display_position_vblank_timer, video_screen_get_time_until_pos(0, NEOGEO_VBSTART, NEOGEO_VBLANK_RELOAD_HPOS), 0);
257257}
258258
259259
r1679r1680
269269   update_interrupts(machine);
270270
271271   /* set timer for next screen */
272   timer_adjust(vblank_interrupt_timer, video_screen_get_time_until_pos(0, NEOGEO_VBSTART, 0), 0, attotime_zero);
272   timer_adjust_oneshot(vblank_interrupt_timer, video_screen_get_time_until_pos(0, NEOGEO_VBSTART, 0), 0);
273273}
274274
275275
r1679r1680
283283
284284static void start_interrupt_timers(void)
285285{
286   timer_adjust(vblank_interrupt_timer, video_screen_get_time_until_pos(0, NEOGEO_VBSTART, 0), 0, attotime_zero);
287   timer_adjust(display_position_vblank_timer, video_screen_get_time_until_pos(0, NEOGEO_VBSTART, NEOGEO_VBLANK_RELOAD_HPOS), 0, attotime_zero);
286   timer_adjust_oneshot(vblank_interrupt_timer, video_screen_get_time_until_pos(0, NEOGEO_VBSTART, 0), 0);
287   timer_adjust_oneshot(display_position_vblank_timer, video_screen_get_time_until_pos(0, NEOGEO_VBSTART, NEOGEO_VBLANK_RELOAD_HPOS), 0);
288288}
289289
290290
src/mame/drivers/konamigx.c
r1679r1680
683683   }
684684
685685   // simulate DMA delay
686   timer_adjust(dmadelay_timer, ATTOTIME_IN_USEC(120), 0, attotime_zero);
686   timer_adjust_oneshot(dmadelay_timer, ATTOTIME_IN_USEC(120), 0);
687687}
688688
689689
r1679r1680
14501450   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_UNKNOWN )
14511451   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_UNKNOWN )
14521452   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(1)   /* for gun games */
1453   PORT_BIT(0x08, IP_ACTIVE_LOW, IPT_SERVICE ) PORT_NAME( DEF_STR( Service_Mode )) PORT_CODE(KEYCODE_F2)
1453   PORT_SERVICE_NO_TOGGLE( 0x08, IP_ACTIVE_LOW )
14541454   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_UNKNOWN )
14551455   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_UNKNOWN )
14561456   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNKNOWN )
r1679r1680
15651565   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_UNKNOWN )
15661566   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_UNKNOWN )
15671567   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(1)   /* for gun games */
1568   PORT_BIT(0x08, IP_ACTIVE_LOW, IPT_SERVICE ) PORT_NAME( DEF_STR( Service_Mode )) PORT_CODE(KEYCODE_F2)
1568   PORT_SERVICE_NO_TOGGLE( 0x08, IP_ACTIVE_LOW )
15691569   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_UNKNOWN )
15701570   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_UNKNOWN )
15711571   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNKNOWN )
r1679r1680
16871687   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_UNKNOWN )
16881688   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_UNKNOWN )
16891689   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(1)   /* for gun games */
1690   PORT_BIT(0x08, IP_ACTIVE_LOW, IPT_SERVICE ) PORT_NAME( DEF_STR( Service_Mode )) PORT_CODE(KEYCODE_F2)
1690   PORT_SERVICE_NO_TOGGLE( 0x08, IP_ACTIVE_LOW )
16911691   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_UNKNOWN )
16921692   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_UNKNOWN )
16931693   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNKNOWN )
r1679r1680
18001800   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_UNKNOWN )
18011801   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_UNKNOWN )
18021802   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_UNKNOWN )
1803   PORT_BIT(0x08, IP_ACTIVE_LOW, IPT_SERVICE ) PORT_NAME( DEF_STR( Service_Mode )) PORT_CODE(KEYCODE_F2)
1803   PORT_SERVICE_NO_TOGGLE( 0x08, IP_ACTIVE_LOW )
18041804   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_UNKNOWN )
18051805   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_UNKNOWN )
18061806   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNKNOWN )
r1679r1680
18881888   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_UNKNOWN )
18891889   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_UNKNOWN )
18901890   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_UNKNOWN )
1891   PORT_BIT(0x08, IP_ACTIVE_LOW, IPT_SERVICE ) PORT_NAME( DEF_STR( Service_Mode )) PORT_CODE(KEYCODE_F2)
1891   PORT_SERVICE_NO_TOGGLE( 0x08, IP_ACTIVE_LOW )
18921892   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_UNKNOWN )
18931893   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_UNKNOWN )
18941894   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNKNOWN )
r1679r1680
19771977   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_UNKNOWN )
19781978   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_UNKNOWN )
19791979   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_UNKNOWN )
1980   PORT_BIT(0x08, IP_ACTIVE_LOW, IPT_SERVICE ) PORT_NAME( DEF_STR( Service_Mode )) PORT_CODE(KEYCODE_F2)
1980   PORT_SERVICE_NO_TOGGLE( 0x08, IP_ACTIVE_LOW )
19811981   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_UNKNOWN )
19821982   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_UNKNOWN )
19831983   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNKNOWN )
r1679r1680
20662066   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_UNKNOWN )
20672067   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_UNKNOWN )
20682068   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_UNKNOWN )
2069   PORT_BIT(0x08, IP_ACTIVE_LOW, IPT_SERVICE ) PORT_NAME( DEF_STR( Service_Mode )) PORT_CODE(KEYCODE_F2)
2069   PORT_SERVICE_NO_TOGGLE( 0x08, IP_ACTIVE_LOW )
20702070   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_UNKNOWN )
20712071   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_UNKNOWN )
20722072   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNKNOWN )
src/mame/drivers/sprcros2.c
r1679r1680
322322   MDRV_SCREEN_SIZE(32*8, 32*8)
323323   MDRV_SCREEN_VISIBLE_AREA(1*8, 31*8-1, 2*8, 30*8-1)
324324   MDRV_GFXDECODE(sprcros2)
325   MDRV_PALETTE_LENGTH(18)
326   MDRV_COLORTABLE_LENGTH(768)
325   MDRV_PALETTE_LENGTH(768)
327326
328327   MDRV_PALETTE_INIT(sprcros2)
329328   MDRV_VIDEO_START(sprcros2)
r1679r1680
415414   ROM_LOAD( "sc-60.4k",    0x0320, 0x0100, CRC(d7a4e57d) SHA1(6db02ec6aa55b05422cb505e63c71e36b4b11b4a) )   //fg clut
416415ROM_END
417416
418GAME( 1986, sprcros2, 0,        sprcros2, sprcros2, 0, ROT0, "GM Shoji", "Super Cross 2 (Japan set 1)", 0 )
419GAME( 1986, sprcrs2a, sprcros2, sprcros2, sprcros2, 0, ROT0, "GM Shoji", "Super Cross 2 (Japan set 2)", 0 )
417GAME( 1986, sprcros2, 0,        sprcros2, sprcros2, 0, ROT0, "GM Shoji", "Super Cross II (Japan, set 1)", 0 )
418GAME( 1986, sprcrs2a, sprcros2, sprcros2, sprcros2, 0, ROT0, "GM Shoji", "Super Cross II (Japan, set 2)", 0 )
src/mame/drivers/statriv2.c
r1679r1680
126126
127127static VIDEO_START (statriv2)
128128{
129   statriv2_tilemap = tilemap_create(get_statriv2_tile_info,tilemap_scan_rows,TILEMAP_TYPE_PEN,8,16,64, 16);
129   statriv2_tilemap = tilemap_create(get_statriv2_tile_info,tilemap_scan_rows,8,16,64, 16);
130130}
131131
132132static VIDEO_UPDATE (statriv2)
src/mame/drivers/carrera.c
r1679r1680
4444#include "driver.h"
4545#include "deprecat.h"
4646#include "sound/ay8910.h"
47#include "video/crtc6845.h"
47#include "video/mc6845.h"
4848
4949static UINT8* carrera_tileram;
50static mc6845_t *mc6845;
5051
52
53
54static WRITE8_HANDLER( carrera_mc6845_address_w )
55{
56   mc6845_address_w(mc6845, data);
57}
58
59static WRITE8_HANDLER( carrera_mc6845_register_w )
60{
61   mc6845_register_w(mc6845, data);
62}
63
64
5165static ADDRESS_MAP_START( readmem, ADDRESS_SPACE_PROGRAM, 8 )
5266   AM_RANGE(0x0000, 0x4fff) AM_READ(MRA8_ROM)
5367   AM_RANGE(0xe000, 0xe7ff) AM_READ(MRA8_RAM)
r1679r1680
5771static ADDRESS_MAP_START( writemem, ADDRESS_SPACE_PROGRAM, 8 )
5872   AM_RANGE(0x0000, 0x4fff) AM_WRITE(MWA8_ROM)
5973   AM_RANGE(0xe000, 0xe7ff) AM_WRITE(MWA8_RAM)
60   AM_RANGE(0xe800, 0xe800) AM_WRITE(crtc6845_address_w)
61   AM_RANGE(0xe801, 0xe801) AM_WRITE(crtc6845_register_w)
74   AM_RANGE(0xe800, 0xe800) AM_WRITE(carrera_mc6845_address_w)
75   AM_RANGE(0xe801, 0xe801) AM_WRITE(carrera_mc6845_register_w)
6276   AM_RANGE(0xf000, 0xffff) AM_WRITE(MWA8_RAM) AM_BASE(&carrera_tileram)
6377ADDRESS_MAP_END
6478
r1679r1680
245259
246260static VIDEO_START(carrera)
247261{
262   mc6845 = mc6845_config(NULL);
248263}
249264
250265static VIDEO_UPDATE(carrera)
src/mame/drivers/combatsc.c
r1679r1680
244244      if (boost)
245245      {
246246         boost = 0;
247         timer_adjust(combasc_interleave_timer, attotime_zero, 0, ATTOTIME_IN_CYCLES(80,1));
247         timer_adjust_periodic(combasc_interleave_timer, attotime_zero, 0, ATTOTIME_IN_CYCLES(80,1));
248248      }
249249      else if (status & 2)
250250      {
251251         boost = 1;
252         timer_adjust(combasc_interleave_timer, attotime_zero, 0, attotime_never);
252         timer_adjust_oneshot(combasc_interleave_timer, attotime_zero, 0);
253253      }
254254   }
255255
src/mame/drivers/egghunt.c
r1679r1680
145145
146146static VIDEO_START(egghunt)
147147{
148   bg_tilemap = tilemap_create(get_bg_tile_info,tilemap_scan_rows,TILEMAP_TYPE_PEN,8,8,64, 32);
148   bg_tilemap = tilemap_create(get_bg_tile_info,tilemap_scan_rows,8,8,64, 32);
149149   egghunt_bgram = auto_malloc(0x1000);
150150   egghunt_spram = auto_malloc(0x1000);
151151}
src/mame/drivers/pandoras.c
r1679r1680
2525static int firq_old_data_a, firq_old_data_b;
2626static int i8039_status;
2727
28UINT8 *pandoras_sharedram;
29static UINT8 *pandoras_sharedram2;
30
3128/* from video */
3229PALETTE_INIT( pandoras );
33READ8_HANDLER( pandoras_vram_r );
34READ8_HANDLER( pandoras_cram_r );
3530WRITE8_HANDLER( pandoras_vram_w );
3631WRITE8_HANDLER( pandoras_cram_w );
3732WRITE8_HANDLER( pandoras_flipscreen_w );
r1679r1680
4944      cpunum_set_input_line(machine, 1, M6809_IRQ_LINE, HOLD_LINE);
5045}
5146
52static READ8_HANDLER( pandoras_sharedram_r ){
53   return pandoras_sharedram[offset];
54}
55
56static WRITE8_HANDLER( pandoras_sharedram_w ){
57   pandoras_sharedram[offset] = data;
58}
59
60static READ8_HANDLER( pandoras_sharedram2_r ){
61   return pandoras_sharedram2[offset];
62}
63
64static WRITE8_HANDLER( pandoras_sharedram2_w ){
65   pandoras_sharedram2[offset] = data;
66}
67
6847static WRITE8_HANDLER( pandoras_int_control_w ){
6948   /*  byte 0: irq enable (CPU A)
7049        byte 2: coin counter 1
r1679r1680
135114
136115
137116static ADDRESS_MAP_START( pandoras_readmem_a, ADDRESS_SPACE_PROGRAM, 8 )
138   AM_RANGE(0x0000, 0x0fff) AM_READ(pandoras_sharedram_r)   /* Work RAM (Shared with CPU B) */
139   AM_RANGE(0x1000, 0x13ff) AM_READ(pandoras_cram_r)      /* Color RAM (shared with CPU B) */
140   AM_RANGE(0x1400, 0x17ff) AM_READ(pandoras_vram_r)      /* Video RAM (shared with CPU B) */
117   AM_RANGE(0x0000, 0x0fff) AM_READ(MRA8_RAM) AM_SHARE(1)   /* Work RAM (Shared with CPU B) */
118   AM_RANGE(0x1000, 0x13ff) AM_READ(MRA8_RAM) AM_SHARE(2)    /* Color RAM (shared with CPU B) */
119   AM_RANGE(0x1400, 0x17ff) AM_READ(MRA8_RAM) AM_SHARE(3)   /* Video RAM (shared with CPU B) */
141120   AM_RANGE(0x4000, 0x5fff) AM_READ(MRA8_ROM)            /* space for diagnostic ROM */
142   AM_RANGE(0x6000, 0x67ff) AM_READ(pandoras_sharedram2_r)   /* Shared RAM with CPU B */
121   AM_RANGE(0x6000, 0x67ff) AM_READ(MRA8_RAM) AM_SHARE(4)   /* Shared RAM with CPU B */
143122   AM_RANGE(0x8000, 0xffff) AM_READ(MRA8_ROM)            /* ROM */
144123ADDRESS_MAP_END
145124
146125static ADDRESS_MAP_START( pandoras_writemem_a, ADDRESS_SPACE_PROGRAM, 8 )
147   AM_RANGE(0x0000, 0x0fff) AM_WRITE(pandoras_sharedram_w) AM_BASE(&pandoras_sharedram)   /* Work RAM (Shared with CPU B) */
148   AM_RANGE(0x1000, 0x13ff) AM_WRITE(pandoras_cram_w) AM_BASE(&colorram)               /* Color RAM (shared with CPU B) */
149   AM_RANGE(0x1400, 0x17ff) AM_WRITE(pandoras_vram_w) AM_BASE(&videoram)               /* Video RAM (shared with CPU B) */
126   AM_RANGE(0x0000, 0x0fff) AM_WRITE(MWA8_RAM) AM_SHARE(1) AM_BASE(&spriteram) /* Work RAM (Shared with CPU B) */
127   AM_RANGE(0x1000, 0x13ff) AM_WRITE(pandoras_cram_w) AM_SHARE(2) AM_BASE(&colorram)               /* Color RAM (shared with CPU B) */
128   AM_RANGE(0x1400, 0x17ff) AM_WRITE(pandoras_vram_w) AM_SHARE(3) AM_BASE(&videoram)               /* Video RAM (shared with CPU B) */
150129   AM_RANGE(0x1800, 0x1807) AM_WRITE(pandoras_int_control_w)                  /* INT control */
151130   AM_RANGE(0x1a00, 0x1a00) AM_WRITE(pandoras_scrolly_w)                     /* bg scroll */
152131   AM_RANGE(0x1c00, 0x1c00) AM_WRITE(pandoras_z80_irqtrigger_w)               /* cause INT on the Z80 */
r1679r1680
154133   AM_RANGE(0x2000, 0x2000) AM_WRITE(pandoras_cpub_irqtrigger_w)               /* cause FIRQ on CPU B */
155134   AM_RANGE(0x2001, 0x2001) AM_WRITE(watchdog_reset_w)                     /* watchdog reset */
156135   AM_RANGE(0x4000, 0x5fff) AM_WRITE(MWA8_ROM)                           /* see notes */
157   AM_RANGE(0x6000, 0x67ff) AM_WRITE(pandoras_sharedram2_w) AM_BASE(&pandoras_sharedram2)/* Shared RAM with CPU B */
136   AM_RANGE(0x6000, 0x67ff) AM_WRITE(MWA8_RAM) AM_SHARE(4) /* Shared RAM with CPU B */
158137   AM_RANGE(0x8000, 0xffff) AM_WRITE(MWA8_ROM)                           /* ROM */
159138ADDRESS_MAP_END
160139
161140static ADDRESS_MAP_START( pandoras_readmem_b, ADDRESS_SPACE_PROGRAM, 8 )
162   AM_RANGE(0x0000, 0x0fff) AM_READ(pandoras_sharedram_r)   /* Work RAM (Shared with CPU A) */
163   AM_RANGE(0x1000, 0x13ff) AM_READ(pandoras_cram_r)      /* Color RAM (shared with CPU A) */
164   AM_RANGE(0x1400, 0x17ff) AM_READ(pandoras_vram_r)      /* Video RAM (shared with CPU A) */
141   AM_RANGE(0x0000, 0x0fff) AM_READ(MRA8_RAM) AM_SHARE(1)/* Work RAM (Shared with CPU A) */
142   AM_RANGE(0x1000, 0x13ff) AM_READ(MRA8_RAM) AM_SHARE(2)       /* Color RAM (shared with CPU A) */
143   AM_RANGE(0x1400, 0x17ff) AM_READ(MRA8_RAM) AM_SHARE(3)    /* Video RAM (shared with CPU A) */
165144   AM_RANGE(0x1800, 0x1800) AM_READ(input_port_0_r)         /* DIPSW #1 */
166145   AM_RANGE(0x1a00, 0x1a00) AM_READ(input_port_3_r)         /* COINSW */
167146   AM_RANGE(0x1a01, 0x1a01) AM_READ(input_port_4_r)         /* 1P inputs */
r1679r1680
169148   AM_RANGE(0x1a03, 0x1a03) AM_READ(input_port_2_r)         /* DIPSW #3 */
170149   AM_RANGE(0x1c00, 0x1c00) AM_READ(input_port_1_r)         /* DISPW #2 */
171150//  AM_RANGE(0x1e00, 0x1e00) AM_READ(MRA8_NOP)              /* ??? seems to be important */
172   AM_RANGE(0xc000, 0xc7ff) AM_READ(pandoras_sharedram2_r)   /* Shared RAM with the CPU A */
151   AM_RANGE(0xc000, 0xc7ff) AM_READ(MRA8_RAM) AM_SHARE(4)   /* Shared RAM with the CPU A */
173152   AM_RANGE(0xe000, 0xffff) AM_READ(MRA8_ROM)            /* ROM */
174153ADDRESS_MAP_END
175154
176155static ADDRESS_MAP_START( pandoras_writemem_b, ADDRESS_SPACE_PROGRAM, 8 )
177   AM_RANGE(0x0000, 0x0fff) AM_WRITE(pandoras_sharedram_w)   /* Work RAM (Shared with CPU A) */
178   AM_RANGE(0x1000, 0x13ff) AM_WRITE(pandoras_cram_w)      /* Color RAM (shared with CPU A) */
179   AM_RANGE(0x1400, 0x17ff) AM_WRITE(pandoras_vram_w)      /* Video RAM (shared with CPU A) */
156   AM_RANGE(0x0000, 0x0fff) AM_WRITE(MWA8_RAM)   AM_SHARE(1) /* Work RAM (Shared with CPU A) */
157   AM_RANGE(0x1000, 0x13ff) AM_WRITE(pandoras_cram_w) AM_SHARE(2)       /* Color RAM (shared with CPU A) */
158   AM_RANGE(0x1400, 0x17ff) AM_WRITE(pandoras_vram_w) AM_SHARE(3)       /* Video RAM (shared with CPU A) */
180159   AM_RANGE(0x1800, 0x1807) AM_WRITE(pandoras_int_control_w)   /* INT control */
181160   AM_RANGE(0x8000, 0x8000) AM_WRITE(watchdog_reset_w)      /* watchdog reset */
182161   AM_RANGE(0xa000, 0xa000) AM_WRITE(pandoras_cpua_irqtrigger_w)/* cause FIRQ on CPU A */
183   AM_RANGE(0xc000, 0xc7ff) AM_WRITE(pandoras_sharedram2_w)   /* Shared RAM with the CPU A */
162   AM_RANGE(0xc000, 0xc7ff) AM_WRITE(MWA8_RAM) AM_SHARE(4)   /* Shared RAM with the CPU A */
184163   AM_RANGE(0xe000, 0xffff) AM_WRITE(MWA8_ROM)            /* ROM */
185164ADDRESS_MAP_END
186165
r1679r1680
363342};
364343
365344static GFXDECODE_START( pandoras )
366   GFXDECODE_ENTRY( REGION_GFX1, 0, charlayout,       0, 16 )
367   GFXDECODE_ENTRY( REGION_GFX2, 0, spritelayout, 16*16, 16 )
345   GFXDECODE_ENTRY( REGION_GFX1, 0, spritelayout,     0, 16 )
346   GFXDECODE_ENTRY( REGION_GFX2, 0, charlayout,   16*16, 16 )
368347GFXDECODE_END
369348
370349/***************************************************************************
r1679r1680
427406   MDRV_SCREEN_SIZE(32*8, 32*8)
428407   MDRV_SCREEN_VISIBLE_AREA(0*8, 32*8-1, 2*8, 30*8-1)
429408   MDRV_GFXDECODE(pandoras)
430   MDRV_PALETTE_LENGTH(32)
431   MDRV_COLORTABLE_LENGTH(16*16+16*16)
409   MDRV_PALETTE_LENGTH(16*16+16*16)
432410
433411   MDRV_PALETTE_INIT(pandoras)
434412   MDRV_VIDEO_START(pandoras)
r1679r1680
468446   ROM_REGION( 0x1000, REGION_CPU4, 0 ) /* 4K for the Sound CPU 2 */
469447   ROM_LOAD( "pand_7e.snd",   0x00000, 0x01000, CRC(18b0f9d0) SHA1(2a6119423222577a4c2b99ed78f61ba387eec7f8) )
470448
471   ROM_REGION( 0x4000, REGION_GFX1, ROMREGION_DISPOSE )
472   ROM_LOAD( "pand_a18.cpu",   0x00000, 0x02000, CRC(23706d4a) SHA1(cca92e6ff90e3006a79a214f1211fd659771de53) )   /* tiles */
473   ROM_LOAD( "pand_a19.cpu",   0x02000, 0x02000, CRC(a463b3f9) SHA1(549b7ee6e47325b80186441da11879fb8b1b47be) )
474
475   ROM_REGION( 0x6000, REGION_GFX2, ROMREGION_DISPOSE )
449   ROM_REGION( 0x6000, REGION_GFX1, ROMREGION_DISPOSE )
476450   ROM_LOAD( "pand_j18.cpu",   0x00000, 0x02000, CRC(99a696c5) SHA1(35a27cd5ecc51a9a1acf01eb8078a1028f03be32) )   /* sprites */
477451   ROM_LOAD( "pand_j17.cpu",   0x02000, 0x02000, CRC(38a03c21) SHA1(b0c8f642787bab3cd1d76657e56f07f4f6f9073c) )
478452   ROM_LOAD( "pand_j16.cpu",   0x04000, 0x02000, CRC(e0708a78) SHA1(9dbd08b6ca8a66a61e128d1806888696273de848) )
479453
454   ROM_REGION( 0x4000, REGION_GFX2, ROMREGION_DISPOSE )
455   ROM_LOAD( "pand_a18.cpu",   0x00000, 0x02000, CRC(23706d4a) SHA1(cca92e6ff90e3006a79a214f1211fd659771de53) )   /* tiles */
456   ROM_LOAD( "pand_a19.cpu",   0x02000, 0x02000, CRC(a463b3f9) SHA1(549b7ee6e47325b80186441da11879fb8b1b47be) )
457
480458   ROM_REGION( 0x0220, REGION_PROMS, 0 )
481459   ROM_LOAD( "pandora.2a",      0x0000, 0x020, CRC(4d56f939) SHA1(a8dac604bfdaf4b153b75dbf165de113152b6daa) ) /* palette */
482460   ROM_LOAD( "pandora.17g",   0x0020, 0x100, CRC(c1a90cfc) SHA1(c6581f2d543e38f1de399774183cf0698e61dab5) ) /* sprite lookup table */
src/mame/drivers/gberet.c
r1679r1680
563563   MDRV_SCREEN_SIZE(32*8, 32*8)
564564   MDRV_SCREEN_VISIBLE_AREA(1*8, 31*8-1, 2*8, 30*8-1)
565565   MDRV_GFXDECODE(gberet)
566   MDRV_PALETTE_LENGTH(32)
567   MDRV_COLORTABLE_LENGTH(2*16*16)
566   MDRV_PALETTE_LENGTH(2*16*16)
568567
569568   MDRV_PALETTE_INIT(gberet)
570569   MDRV_VIDEO_START(gberet)
r1679r1680
625624
626625   ROM_REGION( 0x0220, REGION_PROMS, 0 )
627626   ROM_LOAD( "577h09.2f",    0x0000, 0x0020, CRC(c15e7c80) SHA1(c0e8a01e63ed8cf20b33456b68890313b387ad23) ) // palette
628   ROM_LOAD( "577h10.5f",    0x0020, 0x0100, CRC(e9de1e53) SHA1(406b8dfe54e6176082005cc5545e79c098672547) ) // sprites
629   ROM_LOAD( "577h11.6f",    0x0120, 0x0100, CRC(2a1a992b) SHA1(77cff7c9c8433f999a87776021935864cf9dccb4) ) // characters
627   ROM_LOAD( "577h11.6f",    0x0020, 0x0100, CRC(2a1a992b) SHA1(77cff7c9c8433f999a87776021935864cf9dccb4) ) // characters
628   ROM_LOAD( "577h10.5f",    0x0120, 0x0100, CRC(e9de1e53) SHA1(406b8dfe54e6176082005cc5545e79c098672547) ) // sprites
630629ROM_END
631630
632631ROM_START( rushatck )
r1679r1680
646645
647646   ROM_REGION( 0x0220, REGION_PROMS, 0 )
648647   ROM_LOAD( "577h09.2f",    0x0000, 0x0020, CRC(c15e7c80) SHA1(c0e8a01e63ed8cf20b33456b68890313b387ad23) ) // palette
649   ROM_LOAD( "577h10.5f",    0x0020, 0x0100, CRC(e9de1e53) SHA1(406b8dfe54e6176082005cc5545e79c098672547) ) // sprites
650   ROM_LOAD( "577h11.6f",    0x0120, 0x0100, CRC(2a1a992b) SHA1(77cff7c9c8433f999a87776021935864cf9dccb4) ) // characters
648   ROM_LOAD( "577h11.6f",    0x0020, 0x0100, CRC(2a1a992b) SHA1(77cff7c9c8433f999a87776021935864cf9dccb4) ) // characters
649   ROM_LOAD( "577h10.5f",    0x0120, 0x0100, CRC(e9de1e53) SHA1(406b8dfe54e6176082005cc5545e79c098672547) ) // sprites
651650ROM_END
652651
653652ROM_START( gberetb )
r1679r1680
666665
667666   ROM_REGION( 0x0220, REGION_PROMS, 0 )
668667   ROM_LOAD( "577h09",       0x0000, 0x0020, CRC(c15e7c80) SHA1(c0e8a01e63ed8cf20b33456b68890313b387ad23) ) // palette
669   ROM_LOAD( "577h10",       0x0020, 0x0100, CRC(e9de1e53) SHA1(406b8dfe54e6176082005cc5545e79c098672547) ) // sprites
670   ROM_LOAD( "577h11",       0x0120, 0x0100, CRC(2a1a992b) SHA1(77cff7c9c8433f999a87776021935864cf9dccb4) ) // characters
668   ROM_LOAD( "577h11.6f",    0x0020, 0x0100, CRC(2a1a992b) SHA1(77cff7c9c8433f999a87776021935864cf9dccb4) ) // characters
669   ROM_LOAD( "577h10.5f",    0x0120, 0x0100, CRC(e9de1e53) SHA1(406b8dfe54e6176082005cc5545e79c098672547) ) // sprites
671670ROM_END
672671
673672ROM_START( mrgoemon )
r1679r1680
685684
686685   ROM_REGION( 0x0220, REGION_PROMS, 0 )
687686   ROM_LOAD( "621a06.5f",    0x0000, 0x0020, CRC(7c90de5f) SHA1(8ac5708e72e32f3d79ccde0cbaedefc34f8ac57e) ) // palette
688   ROM_LOAD( "621a07.6f",    0x0020, 0x0100, CRC(3980acdc) SHA1(f4e0bd74bccd77b84096c38bc70cf488a42d9562) ) // sprites
689   ROM_LOAD( "621a08.7f",    0x0120, 0x0100, CRC(2fb244dd) SHA1(ceb909ad96c0dabc8684e69b028f4287e227c351) ) // characters
687   ROM_LOAD( "621a08.7f",    0x0020, 0x0100, CRC(2fb244dd) SHA1(ceb909ad96c0dabc8684e69b028f4287e227c351) ) // characters
688   ROM_LOAD( "621a07.6f",    0x0120, 0x0100, CRC(3980acdc) SHA1(f4e0bd74bccd77b84096c38bc70cf488a42d9562) ) // sprites
690689ROM_END
691690
692691/* Game Drivers */
src/mame/drivers/stfight.c
r1679r1680
280280static ADDRESS_MAP_START( writemem_cpu1, ADDRESS_SPACE_PROGRAM, 8 )
281281   AM_RANGE(0x0000, 0x7fff) AM_WRITE(MWA8_ROM)
282282   AM_RANGE(0x8000, 0xbfff) AM_WRITE(MWA8_BANK1)                  /* sf02.bin */
283   AM_RANGE(0xc000, 0xc0ff) AM_WRITE(paletteram_xxxxBBBBRRRRGGGG_split1_w) AM_BASE(&paletteram)
284   AM_RANGE(0xc100, 0xc1ff) AM_WRITE(paletteram_xxxxBBBBRRRRGGGG_split2_w) AM_BASE(&paletteram_2)
283   AM_RANGE(0xc000, 0xc0ff) AM_WRITE(MWA8_RAM) AM_BASE(&paletteram)
284   AM_RANGE(0xc100, 0xc1ff) AM_WRITE(MWA8_RAM) AM_BASE(&paletteram_2)
285285   AM_RANGE(0xc500, 0xc500) AM_WRITE(stfight_fm_w)               /* play fm sound */
286286   AM_RANGE(0xc600, 0xc600) AM_WRITE(stfight_adpcm_control_w)    /* voice control */
287287   AM_RANGE(0xc700, 0xc700) AM_WRITE(stfight_coin_w)             /* coin mech */
r1679r1680
506506   MDRV_SCREEN_SIZE(32*8, 32*8)
507507   MDRV_SCREEN_VISIBLE_AREA(0*8, 32*8-1, 2*8, 30*8-1)
508508   MDRV_GFXDECODE(stfight)
509   MDRV_PALETTE_LENGTH(256+1)
510   MDRV_COLORTABLE_LENGTH(16*4+16*16+16*16+16*16)
509   MDRV_PALETTE_LENGTH(16*4+16*16+16*16+16*16)
511510
512511   MDRV_PALETTE_INIT(stfight)
513512   MDRV_VIDEO_START(stfight)
src/mame/drivers/sandscrp.c
r1679r1680
1/* Sand Scorpian
1/*
22
3    Sand Scorpion (by Face)                MCU protection (collision detection etc.)
3    Sand Scorpion
44
5(C) 1992 FACE
6
7PCB Number: Z03VA-001
8
9      CPU: TMP68HC000N-12
10Sound CPU: Z8400AB1 (Z80A)
11    Sound: OKI6295, YM2203C & Y3014B
12      OSC: 16.000mhz & 12.000mhz
13     Dips: Two 8-way dipswitch banks
14
15Kaneko custom (surfaced scratched):
16   PX79C480FP-3 PANDORA-CHIP (160pin PQFP)  <- Sprites
17   VIEW2-CHIP (144pin PQFP)                 <- Tilemaps
18   HELP1-CHIP (64pin PQFP)
19   CALC1-CHIP (40pin DIP)                   <- Collision Detection etc.
20
21
22+-------------------------------------+
23|  VOL   M6295 7.IC55   Z80A   HELP1  |
24|        Y3014B YM2203C 8.IC51        |
25|            DSW1 DSW2 LH5168D  4.IC32|
26|        12MHz 16MHz   LH5168D  3.IC33|
27|J                     LH5168D   IC30*|
28|A                       VIEW2   IC31*|
29|M       LH5116D             M51257AL |
30|M       LH5116D        PAL  M51257AL |
31|A                               2.IC5|
32|         PAL                    1.IC4|
33|         IC15*       PANDORA    68000|
34|  IC14* 5.IC16   M41464 M41464  CALC1|
35|  IC18* 6.IC17   M41464 M41464       |
36+-------------------------------------+
37
38IC18 unpopulated 28 pin socket (silkscreened EPROM)
39IC14 & IC15 unpopulated 32 pin socket (silkscreened MASK)
40IC30 & IC31 unpopulated 42 pin socket (silkscreened MASK)
41
42RAM:
43 OKI M41464C-10 (x4)
44 OKI M51257AL-10 (x2)
45 Sharp LH5116D-10 (x2)
46 Sharp LH5168D-10L (x3)
47
48PALS:
49 AMI 18CV8PC-25 (Stamped IC25D located at IC25)
50 AMI 18CV8PC-25 (Stamped IC26 located at IC26)
51
52Chips simply labeled 1 through 8
53
54ROM ID    ROM Type
55===================
561.ic4     27C2001
572.ic5     27C2001
583.ic33    27C040
594.ic32    27C040
605.ic16    27C040
616.ic17    27C040
627.ic55    27C2001
638.ic51    27C1001
64
65Alternate Program roms:
6611.ic4    27C2001
6712.ic5    27C2001
68
69Is there an other alt program roms set labeled 9 & 10?
70
571*/
672
773#include "driver.h"
r1679r1680
413479
414480                                Sand Scorpion
415481
416(C) FACE
41768HC000N-12
418Z8400AB1
419OKI6295, YM2203C
420OSC:  16.000mhz,   12.000mhz
482***************************************************************************/
421483
422SANDSC03.BIN     27C040
423SANDSC04.BIN     27C040
424SANDSC05.BIN     27C040
425SANDSC06.BIN     27C040
426SANDSC07.BIN     27C2001
427SANDSC08.BIN     27C1001
428SANDSC11.BIN     27C2001
429SANDSC12.BIN     27C2001
484ROM_START( sandscrp ) /* Z03VA-003 PCB */
485   ROM_REGION( 0x080000, REGION_CPU1, 0 )      /* 68000 Code */
486   ROM_LOAD16_BYTE( "11.bin", 0x000000, 0x040000, CRC(9b24ab40) SHA1(3187422dbe8b15d8053be4cb20e56d3e6afbd5f2) ) /* Location is IC4 */
487   ROM_LOAD16_BYTE( "12.bin", 0x000001, 0x040000, CRC(ad12caee) SHA1(83267445b89c3cf4dc317106aa68763d2f29eff7) ) /* Location is IC5 */
430488
431***************************************************************************/
489   ROM_REGION( 0x24000, REGION_CPU2, 0 )      /* Z80 Code */
490   ROM_LOAD( "8.ic51", 0x00000, 0x0c000, CRC(6f3e9db1) SHA1(06a04fa17f44319986913bff70433510c89e38f1) )
491   ROM_CONTINUE(       0x10000, 0x14000 )
432492
433ROM_START( sandscrp )
493   ROM_REGION( 0x100000, REGION_GFX1, ROMREGION_DISPOSE )   /* Sprites */
494   ROM_LOAD( "5.ic16", 0x000000, 0x080000, CRC(9bb675f6) SHA1(c3f6768cfd99a0e19ca2224fff9aa4e27ec0da24) )
495   ROM_LOAD( "6.ic17", 0x080000, 0x080000, CRC(7df2f219) SHA1(e2a59e201bfededa92d6c86f8dc1b212527ef66f) )
496
497   ROM_REGION( 0x100000, REGION_GFX2, ROMREGION_DISPOSE )   /* Layers */
498   ROM_LOAD16_BYTE( "4.ic32", 0x000000, 0x080000, CRC(b9222ff2) SHA1(a445da3f7f5dea5ff64bb0b048f624f947875a39) )
499   ROM_LOAD16_BYTE( "3.ic33", 0x000001, 0x080000, CRC(adf20fa0) SHA1(67a7a2be774c86916cbb97e4c9b16c2e48125780) )
500
501   ROM_REGION( 0x040000, REGION_SOUND1, 0 )   /* Samples */
502   ROM_LOAD( "7.ic55", 0x000000, 0x040000, CRC(9870ab12) SHA1(5ea3412cbc57bfaa32a1e2552b2eb46f4ceb5fa8) )
503ROM_END
504
505ROM_START( sandscra ) /* Z03VA-003 PCB, earlier program version */
434506   ROM_REGION( 0x080000, REGION_CPU1, 0 )      /* 68000 Code */
435   ROM_LOAD16_BYTE( "sandsc11.bin", 0x000000, 0x040000, CRC(9b24ab40) SHA1(3187422dbe8b15d8053be4cb20e56d3e6afbd5f2) )
436   ROM_LOAD16_BYTE( "sandsc12.bin", 0x000001, 0x040000, CRC(ad12caee) SHA1(83267445b89c3cf4dc317106aa68763d2f29eff7) )
507   ROM_LOAD16_BYTE( "1.ic4", 0x000000, 0x040000, CRC(c0943ae2) SHA1(04dac4e1f116cd96d6292daa61ef40efc7eba919) )
508   ROM_LOAD16_BYTE( "2.ic5", 0x000001, 0x040000, CRC(6a8e0012) SHA1(2350b11c9bd545c8ba4b3c25cd6547ba2ad474b5) )
437509
438510   ROM_REGION( 0x24000, REGION_CPU2, 0 )      /* Z80 Code */
439   ROM_LOAD( "sandsc08.bin", 0x00000, 0x0c000, CRC(6f3e9db1) SHA1(06a04fa17f44319986913bff70433510c89e38f1) )
440   ROM_CONTINUE(             0x10000, 0x14000             )
511   ROM_LOAD( "8.ic51", 0x00000, 0x0c000, CRC(6f3e9db1) SHA1(06a04fa17f44319986913bff70433510c89e38f1) )
512   ROM_CONTINUE(       0x10000, 0x14000 )
441513
442514   ROM_REGION( 0x100000, REGION_GFX1, ROMREGION_DISPOSE )   /* Sprites */
443   ROM_LOAD( "sandsc05.bin", 0x000000, 0x080000, CRC(9bb675f6) SHA1(c3f6768cfd99a0e19ca2224fff9aa4e27ec0da24) )
444   ROM_LOAD( "sandsc06.bin", 0x080000, 0x080000, CRC(7df2f219) SHA1(e2a59e201bfededa92d6c86f8dc1b212527ef66f) )
515   ROM_LOAD( "5.ic16", 0x000000, 0x080000, CRC(9bb675f6) SHA1(c3f6768cfd99a0e19ca2224fff9aa4e27ec0da24) )
516   ROM_LOAD( "6.ic17", 0x080000, 0x080000, CRC(7df2f219) SHA1(e2a59e201bfededa92d6c86f8dc1b212527ef66f) )
445517
446518   ROM_REGION( 0x100000, REGION_GFX2, ROMREGION_DISPOSE )   /* Layers */
447   ROM_LOAD16_BYTE( "sandsc04.bin", 0x000000, 0x080000, CRC(b9222ff2) SHA1(a445da3f7f5dea5ff64bb0b048f624f947875a39) )
448   ROM_LOAD16_BYTE( "sandsc03.bin", 0x000001, 0x080000, CRC(adf20fa0) SHA1(67a7a2be774c86916cbb97e4c9b16c2e48125780) )
519   ROM_LOAD16_BYTE( "4.ic32", 0x000000, 0x080000, CRC(b9222ff2) SHA1(a445da3f7f5dea5ff64bb0b048f624f947875a39) )
520   ROM_LOAD16_BYTE( "3.ic33", 0x000001, 0x080000, CRC(adf20fa0) SHA1(67a7a2be774c86916cbb97e4c9b16c2e48125780) )
449521
450522   ROM_REGION( 0x040000, REGION_SOUND1, 0 )   /* Samples */
451   ROM_LOAD( "sandsc07.bin", 0x000000, 0x040000, CRC(9870ab12) SHA1(5ea3412cbc57bfaa32a1e2552b2eb46f4ceb5fa8) )
523   ROM_LOAD( "7.ic55", 0x000000, 0x040000, CRC(9870ab12) SHA1(5ea3412cbc57bfaa32a1e2552b2eb46f4ceb5fa8) )
452524ROM_END
453525
454526
455ROM_START( sandscra )
527ROM_START( sandscrb ) /* Different rev PCB */
456528   ROM_REGION( 0x080000, REGION_CPU1, 0 )      /* 68000 Code */
457529   ROM_LOAD16_BYTE( "11.ic4", 0x000000, 0x040000, CRC(80020cab) SHA1(4f1f4d8ea07ad745f2d6d3f800686f07fe4bf20f) )
458530   ROM_LOAD16_BYTE( "12.ic5", 0x000001, 0x040000, CRC(8df1d42f) SHA1(2a9db5c4b99a8a3f62bffa9ddd96a95e2042602b) )
459531
460532   ROM_REGION( 0x24000, REGION_CPU2, 0 )      /* Z80 Code */
461   ROM_LOAD( "sandsc08.bin", 0x00000, 0x0c000, CRC(6f3e9db1) SHA1(06a04fa17f44319986913bff70433510c89e38f1) )
462   ROM_CONTINUE(             0x10000, 0x14000             )
533   ROM_LOAD( "8.ic51", 0x00000, 0x0c000, CRC(6f3e9db1) SHA1(06a04fa17f44319986913bff70433510c89e38f1) )
534   ROM_CONTINUE(       0x10000, 0x14000 )
463535
464536   ROM_REGION( 0x100000, REGION_GFX1, ROMREGION_DISPOSE )   /* Sprites */
465537   ROM_LOAD( "ss502.ic16", 0x000000, 0x100000, CRC(d8012ebb) SHA1(975bbb3b57a09e41d2257d4fa3a64097144de554) )
r1679r1680
468540   ROM_LOAD16_WORD_SWAP( "ss501.ic30", 0x000000, 0x100000, CRC(0cf9f99d) SHA1(47f7f120d2bc075bedaff0a44306a8f46a1d848c) )
469541
470542   ROM_REGION( 0x040000, REGION_SOUND1, 0 )   /* Samples */
471   ROM_LOAD( "sandsc07.bin", 0x000000, 0x040000, CRC(9870ab12) SHA1(5ea3412cbc57bfaa32a1e2552b2eb46f4ceb5fa8) )
543   ROM_LOAD( "7.ic55", 0x000000, 0x040000, CRC(9870ab12) SHA1(5ea3412cbc57bfaa32a1e2552b2eb46f4ceb5fa8) )
472544ROM_END
473545
474546
475GAME( 1992, sandscrp, 0,        sandscrp, sandscrp, 0,          ROT90, "Face",   "Sand Scorpion (set 1)", 0 )
476GAME( 1992, sandscra, sandscrp, sandscrp, sandscrp, 0,          ROT90, "Face",   "Sand Scorpion (set 2)", 0 )
547GAME( 1992, sandscrp, 0,        sandscrp, sandscrp, 0,          ROT90, "Face",   "Sand Scorpion", 0 )
548GAME( 1992, sandscra, sandscrp, sandscrp, sandscrp, 0,          ROT90, "Face",   "Sand Scorpion (Earlier)", 0 )
549GAME( 1992, sandscrb, sandscrp, sandscrp, sandscrp, 0,          ROT90, "Face",   "Sand Scorpion (Revised Hardware)", 0 )
src/mame/drivers/ddragon.c
r1679r1680
158158   /* adjust for next scanline */
159159   if (++scanline >= machine->screen[0].height)
160160      scanline = 0;
161   timer_adjust(scanline_timer, video_screen_get_time_until_pos(0, scanline, 0), scanline, attotime_never);
161   timer_adjust_oneshot(scanline_timer, video_screen_get_time_until_pos(0, scanline, 0), scanline);
162162}
163163
164164
r1679r1680
192192{
193193   dd_sub_cpu_busy = 1;
194194   adpcm_idle[0] = adpcm_idle[1] = 1;
195   timer_adjust(scanline_timer, video_screen_get_time_until_pos(0, 0, 0), 0, attotime_never);
195   timer_adjust_oneshot(scanline_timer, video_screen_get_time_until_pos(0, 0, 0), 0);
196196}
197197
198198
src/mame/drivers/acommand.c
r1679r1680
148148
149149static VIDEO_START( acommand )
150150{
151   tx_tilemap = tilemap_create(ac_get_tx_tile_info,tilemap_scan_cols,TILEMAP_TYPE_PEN,8,8,512,32);
152   bg_tilemap = tilemap_create(ac_get_bg_tile_info,bg_scan,TILEMAP_TYPE_PEN,16,16,256,16);
151   tx_tilemap = tilemap_create(ac_get_tx_tile_info,tilemap_scan_cols,8,8,512,32);
152   bg_tilemap = tilemap_create(ac_get_bg_tile_info,bg_scan,16,16,256,16);
153153
154154   ac_vregs = auto_malloc(0x80);
155155
src/mame/drivers/tubep.c
r1679r1680
329329   if (scanline>=264)
330330      scanline=0;
331331
332   timer_adjust(interrupt_timer, video_screen_get_time_until_pos(0, scanline, 0), scanline, attotime_zero);
332   timer_adjust_oneshot(interrupt_timer, video_screen_get_time_until_pos(0, scanline, 0), scanline);
333333}
334334
335335
r1679r1680
361361
362362static MACHINE_RESET( tubep )
363363{
364   timer_adjust(interrupt_timer, video_screen_get_time_until_pos(0, 0, 0), 0, attotime_zero);
364   timer_adjust_oneshot(interrupt_timer, video_screen_get_time_until_pos(0, 0, 0), 0);
365365}
366366
367367
r1679r1680
510510   if (scanline>=264)
511511      scanline=0;
512512
513   timer_adjust(interrupt_timer, video_screen_get_time_until_pos(0, scanline, 0), scanline, attotime_zero);
513   timer_adjust_oneshot(interrupt_timer, video_screen_get_time_until_pos(0, scanline, 0), scanline);
514514}
515515
516516
r1679r1680
524524
525525static MACHINE_RESET( rjammer )
526526{
527   timer_adjust(interrupt_timer, video_screen_get_time_until_pos(0, 0, 0), 0, attotime_zero);
527   timer_adjust_oneshot(interrupt_timer, video_screen_get_time_until_pos(0, 0, 0), 0);
528528}
529529
530530
src/mame/drivers/ppmast93.c
r1679r1680
329329
330330static VIDEO_START( ppmast93 )
331331{
332   ppmast93_bg_tilemap = tilemap_create(get_ppmast93_bg_tile_info,tilemap_scan_rows,TILEMAP_TYPE_PEN,8,8,32, 32);
333   ppmast93_fg_tilemap = tilemap_create(get_ppmast93_fg_tile_info,tilemap_scan_rows,TILEMAP_TYPE_PEN,8,8,32, 32);
332   ppmast93_bg_tilemap = tilemap_create(get_ppmast93_bg_tile_info,tilemap_scan_rows,8,8,32, 32);
333   ppmast93_fg_tilemap = tilemap_create(get_ppmast93_fg_tile_info,tilemap_scan_rows,8,8,32, 32);
334334
335335   tilemap_set_transparent_pen(ppmast93_fg_tilemap,0);
336336}
src/mame/drivers/homedata.c
r1679r1680
780780   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
781781   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_TILT )   // doesn't work in all games
782782   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_SERVICE1 )
783   PORT_BIT(0x10, IP_ACTIVE_LOW, IPT_SERVICE ) PORT_NAME( DEF_STR( Service_Mode )) PORT_CODE(KEYCODE_F2)
783   PORT_SERVICE_NO_TOGGLE( 0x10, IP_ACTIVE_LOW )
784784   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_UNKNOWN )
785785   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNKNOWN )
786786   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNKNOWN )
src/mame/drivers/groundfx.c
r1679r1680
321321   PORT_BIT( 0x8000, IP_ACTIVE_LOW,  IPT_UNUSED )
322322
323323   PORT_START      /* IN2 */
324   PORT_BIT(0x01, IP_ACTIVE_LOW, IPT_SERVICE ) PORT_NAME( DEF_STR( Service_Mode )) PORT_CODE(KEYCODE_F2)
324   PORT_SERVICE_NO_TOGGLE( 0x01, IP_ACTIVE_LOW )
325325   PORT_BIT( 0x02, IP_ACTIVE_LOW,  IPT_SERVICE1 )
326326   PORT_BIT( 0x04, IP_ACTIVE_LOW,  IPT_COIN1 )
327327   PORT_BIT( 0x08, IP_ACTIVE_LOW,  IPT_COIN2 )
src/mame/drivers/gamecstl.c
r1679r1680
6767{
6868   int i;
6969   for (i=0; i < 16; i++)
70   {
7170      palette_set_color(machine, i, cga_palette[i]);
72   }
7371}
7472
75static void draw_char(mame_bitmap *bitmap, const rectangle *cliprect, const gfx_element *gfx, int ch, int att, int x, int y)
73static void draw_char(running_machine *machine, mame_bitmap *bitmap, const rectangle *cliprect, const gfx_element *gfx, int ch, int att, int x, int y)
7674{
7775   int i,j;
7876   UINT8 *dp;
r1679r1680
8280   for (j=y; j < y+8; j++)
8381   {
8482      UINT16 *p = BITMAP_ADDR16(bitmap, j, 0);
83
8584      for (i=x; i < x+8; i++)
8685      {
8786         UINT8 pen = dp[index++];
8887         if (pen)
89         {
90            p[i] = Machine->remapped_colortable[gfx->color_base + (att & 0xf)];
91         }
88            p[i] = machine->pens[gfx->color_base + (att & 0xf)];
9289         else
93         {
94            p[i] = Machine->remapped_colortable[gfx->color_base  + ((att >> 4) & 0x7)];
95         }
90            p[i] = machine->pens[gfx->color_base  + ((att >> 4) & 0x7)];
9691      }
9792   }
9893}
r1679r1680
115110         int att1 = (cga[index] >> 24) & 0xff;
116111         int ch1 = (cga[index] >> 16) & 0xff;
117112
118         draw_char(bitmap, cliprect, gfx, ch0, att0, i*8, j*8);
119         draw_char(bitmap, cliprect, gfx, ch1, att1, (i*8)+8, j*8);
113         draw_char(machine, bitmap, cliprect, gfx, ch0, att0, i*8, j*8);
114         draw_char(machine, bitmap, cliprect, gfx, ch1, att1, (i*8)+8, j*8);
120115         index++;
121116      }
122117   }
src/mame/drivers/tickee.c
r1679r1680
7272   int beamx, beamy;
7373
7474   /* set a timer to do this again next frame */
75   timer_adjust(setup_gun_timer, video_screen_get_time_until_pos(0, 0, 0), 0, attotime_zero);
75   timer_adjust_oneshot(setup_gun_timer, video_screen_get_time_until_pos(0, 0, 0), 0);
7676
7777   /* only do work if the palette is flashed */
7878   if (!tickee_control[2])
r1679r1680
101101{
102102   /* start a timer going on the first scanline of every frame */
103103   setup_gun_timer = timer_alloc(setup_gun_interrupts, NULL);
104   timer_adjust(setup_gun_timer, video_screen_get_time_until_pos(0, 0, 0), 0, attotime_zero);
104   timer_adjust_oneshot(setup_gun_timer, video_screen_get_time_until_pos(0, 0, 0), 0);
105105}
106106
107107
src/mame/drivers/m92.c
r1679r1680
231231
232232static MACHINE_RESET( m92 )
233233{
234   timer_adjust(scanline_timer, video_screen_get_time_until_pos(0, 0, 0), 0, attotime_never);
234   timer_adjust_oneshot(scanline_timer, video_screen_get_time_until_pos(0, 0, 0), 0);
235235}
236236
237237/*****************************************************************************/
r1679r1680
257257   /* adjust for next scanline */
258258   if (++scanline >= machine->screen[0].height)
259259      scanline = 0;
260   timer_adjust(scanline_timer, video_screen_get_time_until_pos(0, scanline, 0), scanline, attotime_never);
260   timer_adjust_oneshot(scanline_timer, video_screen_get_time_until_pos(0, scanline, 0), scanline);
261261}
262262
263263/*****************************************************************************/
src/mame/drivers/fcombat.c
r1679r1680
322322   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
323323   MDRV_SCREEN_RAW_PARAMS(FCOMBAT_PIXEL_CLOCK, FCOMBAT_HTOTAL, FCOMBAT_HBEND, FCOMBAT_HBSTART, FCOMBAT_VTOTAL, FCOMBAT_VBEND, FCOMBAT_VBSTART)
324324   MDRV_GFXDECODE(fcombat)
325   MDRV_PALETTE_LENGTH(32)
326   MDRV_COLORTABLE_LENGTH(256*3)
325   MDRV_PALETTE_LENGTH(256*3)
327326
328327   MDRV_PALETTE_INIT(fcombat)
329328   MDRV_VIDEO_START(fcombat)
src/mame/drivers/segas16b.c
r1679r1680
32793279   MDRV_MACHINE_RESET(atomicp)
32803280
32813281   /* sound hardware */
3282   MDRV_SOUND_REPLACE("2151", YM2413, 4000000)
3282   MDRV_SOUND_REPLACE("2151", YM2413, 5000000) /* 20MHz OSC divided by 4 */
32833283   MDRV_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.0)
32843284
32853285   MDRV_SOUND_REMOVE("7759")
r1679r1680
37093709 **************************************************************************************************************************
37103710 **************************************************************************************************************************
37113711    Atomic Point
3712    CPU: 68000
3713    Custom Korean Board - NOT Sega
3712
3713    Custom Korean Board - NOT Sega:
3714
3715    CPU: TMP68000P-10
3716    OSC: 25.1748MHz & 20MHz
3717  Chips: Philko PK8702
3718         Philko PK8811
3719   Dips: Two 8-way dipswitch banks
3720  Sound: Yamaha YM2413
3721
37143722*/
37153723ROM_START( atomicp )
37163724   ROM_REGION( 0x020000, REGION_CPU1, 0 ) /* 68000 code */
src/mame/drivers/fuukifg2.c
r1679r1680
7070   UINT16 new_data   =   COMBINE_DATA(&fuuki16_vregs[offset]);
7171   if ((offset == 0x1c/2) && old_data != new_data)
7272   {
73      timer_adjust(raster_interrupt_timer, video_screen_get_time_until_pos(0, new_data, Machine->screen[0].visarea.max_x + 1), 0, video_screen_get_frame_period(0));
73      timer_adjust_periodic(raster_interrupt_timer, video_screen_get_time_until_pos(0, new_data, Machine->screen[0].visarea.max_x + 1), 0, video_screen_get_frame_period(0));
7474   }
7575}
7676
r1679r1680
538538{
539539   cpunum_set_input_line(machine, 0, 5, PULSE_LINE);   // Raster Line IRQ
540540   video_screen_update_partial(0, video_screen_get_vpos(0));
541   timer_adjust(raster_interrupt_timer, video_screen_get_frame_period(0), 0, attotime_zero);
541   timer_adjust_oneshot(raster_interrupt_timer, video_screen_get_frame_period(0), 0);
542542}
543543
544544
r1679r1680
552552{
553553   timer_set(video_screen_get_time_until_pos(0, 248, 0), NULL, 0, level_1_interrupt_callback);
554554   timer_set(video_screen_get_time_until_pos(0, machine->screen[0].visarea.max_y + 1, 0), NULL, 0, vblank_interrupt_callback);
555   timer_adjust(raster_interrupt_timer, video_screen_get_time_until_pos(0, 0, machine->screen[0].visarea.max_x + 1), 0, attotime_zero);
555   timer_adjust_oneshot(raster_interrupt_timer, video_screen_get_time_until_pos(0, 0, machine->screen[0].visarea.max_x + 1), 0);
556556}
557557
558558
src/mame/drivers/nwk-tr.c
r1679r1680
248248   {
249249      int roz_tile_size = K001604_roz_size[chip] ? 16 : 8;
250250      int roz_width = K001604_layer_size ? 64 : 128;
251      K001604_layer_8x8[chip][0] = tilemap_create(K001604_0_tile_info_layer_8x8, K001604_scan_layer_8x8_0, TILEMAP_TYPE_PEN, 8, 8, 64, 64);
252      K001604_layer_8x8[chip][1] = tilemap_create(K001604_0_tile_info_layer_8x8, K001604_scan_layer_8x8_1, TILEMAP_TYPE_PEN, 8, 8, 64, 64);
251      K001604_layer_8x8[chip][0] = tilemap_create(K001604_0_tile_info_layer_8x8, K001604_scan_layer_8x8_0, 8, 8, 64, 64);
252      K001604_layer_8x8[chip][1] = tilemap_create(K001604_0_tile_info_layer_8x8, K001604_scan_layer_8x8_1, 8, 8, 64, 64);
253253
254      K001604_layer_roz[chip][0] = tilemap_create(K001604_0_tile_info_layer_roz, K001604_scan_layer_roz_0, TILEMAP_TYPE_PEN, roz_tile_size, roz_tile_size, roz_width, 64);
255      K001604_layer_roz[chip][1] = tilemap_create(K001604_0_tile_info_layer_roz, K001604_scan_layer_roz_1, TILEMAP_TYPE_PEN, roz_tile_size, roz_tile_size, 64, 64);
254      K001604_layer_roz[chip][0] = tilemap_create(K001604_0_tile_info_layer_roz, K001604_scan_layer_roz_0, roz_tile_size, roz_tile_size, roz_width, 64);
255      K001604_layer_roz[chip][1] = tilemap_create(K001604_0_tile_info_layer_roz, K001604_scan_layer_roz_1, roz_tile_size, roz_tile_size, 64, 64);
256256   }
257257   else
258258   {
259259      int roz_tile_size = K001604_roz_size[chip] ? 16 : 8;
260260      int roz_width = K001604_layer_size ? 64 : 128;
261      K001604_layer_8x8[chip][0] = tilemap_create(K001604_1_tile_info_layer_8x8, K001604_scan_layer_8x8_0, TILEMAP_TYPE_PEN, 8, 8, 64, 64);
262      K001604_layer_8x8[chip][1] = tilemap_create(K001604_1_tile_info_layer_8x8, K001604_scan_layer_8x8_1, TILEMAP_TYPE_PEN, 8, 8, 64, 64);
261      K001604_layer_8x8[chip][0] = tilemap_create(K001604_1_tile_info_layer_8x8, K001604_scan_layer_8x8_0, 8, 8, 64, 64);
262      K001604_layer_8x8[chip][1] = tilemap_create(K001604_1_tile_info_layer_8x8, K001604_scan_layer_8x8_1, 8, 8, 64, 64);
263263
264      K001604_layer_roz[chip][0] = tilemap_create(K001604_1_tile_info_layer_roz, K001604_scan_layer_roz_0, TILEMAP_TYPE_PEN, roz_tile_size, roz_tile_size, roz_width, 64);
265      K001604_layer_roz[chip][1] = tilemap_create(K001604_1_tile_info_layer_roz, K001604_scan_layer_roz_1, TILEMAP_TYPE_PEN, roz_tile_size, roz_tile_size, 64, 64);
264      K001604_layer_roz[chip][0] = tilemap_create(K001604_1_tile_info_layer_roz, K001604_scan_layer_roz_0, roz_tile_size, roz_tile_size, roz_width, 64);
265      K001604_layer_roz[chip][1] = tilemap_create(K001604_1_tile_info_layer_roz, K001604_scan_layer_roz_1, roz_tile_size, roz_tile_size, 64, 64);
266266   }
267267
268268   tilemap_set_transparent_pen(K001604_layer_8x8[chip][0], 0);
r1679r1680
545545
546546static VIDEO_UPDATE( nwktr )
547547{
548   fillbitmap(bitmap, machine->remapped_colortable[0], cliprect);
548   fillbitmap(bitmap, machine->pens[0], cliprect);
549549
550550   voodoo_update(0, bitmap, cliprect);
551551
r1679r1680
838838   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_COIN1 )
839839   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_COIN2 )
840840   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_SERVICE ) PORT_NAME("Service Button") PORT_CODE(KEYCODE_7)
841   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_SERVICE ) PORT_NAME( DEF_STR( Service_Mode )) PORT_CODE(KEYCODE_F2)
841   PORT_SERVICE_NO_TOGGLE( 0x10, IP_ACTIVE_LOW )
842842   PORT_BIT( 0x0f, IP_ACTIVE_LOW, IPT_UNKNOWN )
843843
844844   PORT_START
src/mame/drivers/zac2650.c
r1679r1680
1414
1515#include "tinv2650.lh"
1616
17extern UINT8 *zac2650_s2636_0_ram;
1718WRITE8_HANDLER( tinvader_videoram_w );
1819static WRITE8_HANDLER( tinvader_sound_w );
1920READ8_HANDLER( zac_s2636_r );
r1679r1680
4344    AM_RANGE(0x1d00, 0x1dff) AM_WRITE(MWA8_RAM)
4445    AM_RANGE(0x1e80, 0x1e80) AM_WRITE(tinvader_sound_w)
4546   AM_RANGE(0x1e86, 0x1e86) AM_WRITE(MWA8_NOP)            /* Dodgem Only */
46   AM_RANGE(0x1f00, 0x1fff) AM_WRITE(MWA8_RAM) AM_BASE(&s2636_1_ram)
47   AM_RANGE(0x1f00, 0x1fff) AM_WRITE(MWA8_RAM) AM_BASE(&zac2650_s2636_0_ram)
4748ADDRESS_MAP_END
4849
4950static ADDRESS_MAP_START( readport, ADDRESS_SPACE_IO, 8 )
r1679r1680
236237
237238static PALETTE_INIT( zac2650 )
238239{
239   palette_set_color(machine,0,MAKE_RGB(0x00,0x00,0x00)); /* BLACK */
240   palette_set_color(machine,1,MAKE_RGB(0xff,0xff,0xff)); /* WHITE */
241   colortable[0] = 0;
242   colortable[1] = 1;
243   colortable[2] = 0;
244   colortable[3] = 0;
240   palette_set_color(machine,0,RGB_BLACK);
241   palette_set_color(machine,1,RGB_WHITE);
242   palette_set_color(machine,2,RGB_BLACK);
243   palette_set_color(machine,3,RGB_BLACK);
245244}
246245
247246/************************************************************************************************
r1679r1680
333332   MDRV_SCREEN_SIZE(30*24, 32*24)
334333   MDRV_SCREEN_VISIBLE_AREA(0, 719, 0, 767)
335334   MDRV_GFXDECODE(tinvader)
336   MDRV_PALETTE_LENGTH(2)
337   MDRV_COLORTABLE_LENGTH(4)
335   MDRV_PALETTE_LENGTH(4)
338336
339337   MDRV_PALETTE_INIT(zac2650)
340338   MDRV_VIDEO_START(tinvader)
src/mame/drivers/vcombat.c
r0r1680
1/*
2Virtual Combat hardware games.
3
4----
5
6There are two known games on this hardware.  Both are developed by
7Kyle Hodgetts.
8
9Virtual Combat (c) VR8 Inc. 1993
10http://arcade.sonzogni.com/VRCombat/
11
12Shadow Fighters (German) (c) Sega? 1989?
13
14----
15
16There are two boards to this hardware.  The upper, which contains the
17graphics ROMs and the i860, and the lower which contains the main
18and sound CPU's.  Virtual Combat sports two upper boards which presumably
19output a different rasterization of the scene for each stereo eye.
20
21UPPER:
22    Intel I860 XR processor
23    MB8298-25P-SK RAMS x12 (silkscreen said 62256)
24    Analog device ADV476KN50E (silkscreen said BT476)
25    20 MHZ Oscillator
26    8-way DIP switch
27    574200D x4
28    PAL palce24v10 x2 (next to the i860)
29
30LOWER:
31    Motorola MC68000P12 x2
32    12 MHz Oscillator x2
33    Harris ADC0804LCN x2
34    4 MB8298-25P-SK RAMS (in groups of 2 off by themselves)
35    1 CXK58257SP-10L at each end of the SNDCPU ROMS and the CPU ROMS (4 chips total)
36    Motorola MC6845P CRT controller
37    2x 27C010A containing sound code
38    Xx 27C040 containing sound data (VOC files)
39    Dallas DS1220Y - closest to pin 64 of CPU - read as a 2716 - (silkscreened "6116")
40    Xx 27c040 containing program code, etc.
41
42----
43
44NOTES : Shadow Fighters appears to have been dumped from an earlier
45            revision of the hardware.  There are no IC labels, and
46            lots of factory rework has been done to the bottom board.
47        Because the board was so early for Shadow Fighters, there were
48            no IC locations silkscreened on the PCB.  The locations
49            from Virtual Combat have been used.
50        The Shadow Fighters bottom board has an extra 20 mhz xtal on it.
51        The data stored in REGION_SOUND1 is simply a series of
52            Creative Media VOC files concatenated to eachother.
53        The sound program (REGION_CPU2) is about 640 bytes long.
54        The graphics ROMs have had images successfully extracted from
55            them.  Pictures for Shadow Fighters can be found online.
56        The hardware is said to run at medium resolution.
57        The SRAM module dump can likely be thrown away for both games.
58        The PAL that's dumped for Shadow Fighters looks pretty bad.
59        Websites seem to say Shadow Fighters is a SEGA game, but I
60            couldn't find a SEGA string anywhere in the ROMs.  I also,
61            however, could not find a VR8 string in the Virtual Combat
62            ROMs, so who knows...  Kyle's name is easily found in both
63            though :).
64
65TODO :  This is a skeleton driver.  Nearly everything.
66        i860XR-25 CPU core!
67
68*/
69
70#include <stdio.h>
71#include "driver.h"
72#include "video/generic.h"
73
74static ADDRESS_MAP_START( main_map, ADDRESS_SPACE_PROGRAM, 16 )
75   AM_RANGE(0x000000, 0xfffff) AM_ROM
76ADDRESS_MAP_END
77
78static ADDRESS_MAP_START( sound_map, ADDRESS_SPACE_PROGRAM, 16 )
79   AM_RANGE(0x000000, 0x3ffff) AM_ROM
80ADDRESS_MAP_END
81
82/*
83static ADDRESS_MAP_START( video_map, ADDRESS_SPACE_PROGRAM, 16 )
84    AM_RANGE(0x000000, 0x1fffff) AM_ROM
85ADDRESS_MAP_END
86*/
87
88static INPUT_PORTS_START( vcombat )
89INPUT_PORTS_END
90
91
92static MACHINE_DRIVER_START( vcombat )
93   MDRV_CPU_ADD_TAG("main", M68000, XTAL_12MHz)
94   MDRV_CPU_PROGRAM_MAP(main_map,0)
95
96   MDRV_CPU_ADD_TAG("sound", M68000, XTAL_12MHz)
97   MDRV_CPU_PROGRAM_MAP(sound_map,0)
98/*
99    Virtual combat has an i860 on each of its two upper boards.
100    MDRV_CPU_ADD_TAG("video", i860, XTAL_20MHz)
101    MDRV_CPU_PROGRAM_MAP(video_map,0)
102*/
103   MDRV_VIDEO_ATTRIBUTES(VIDEO_TYPE_RASTER)
104   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_RGB32)
105
106   MDRV_SCREEN_REFRESH_RATE(60)
107   MDRV_SCREEN_VBLANK_TIME(DEFAULT_60HZ_VBLANK_DURATION)
108
109   MDRV_SCREEN_SIZE(640, 480)
110   MDRV_SCREEN_VISIBLE_AREA(0, 640-1, 0, 480-1)
111   MDRV_PALETTE_LENGTH(0x100)
112
113   MDRV_VIDEO_START(generic_bitmapped)
114   MDRV_VIDEO_UPDATE(generic_bitmapped)
115MACHINE_DRIVER_END
116
117
118ROM_START( vcombat )
119   ROM_REGION( 0x100000, REGION_CPU1, 0 )
120   ROM_LOAD16_BYTE( "ep8v2.b49", 0x00000, 0x80000, CRC(98d5a45d) SHA1(099e314f11c93ad6e642ceaa311e2a5b6fd7193c) )
121   ROM_LOAD16_BYTE( "ep7v2.b51", 0x00001, 0x80000, CRC(06185bcb) SHA1(855b11ae7644d6c7c1c935b2f5aec484071ca870) )
122
123   ROM_REGION( 0x40000, REGION_CPU2, 0 )
124   ROM_LOAD16_BYTE( "ep1v2.b42", 0x00000, 0x20000, CRC(560b2e6c) SHA1(e35c0466a1e14beab080e3155f873e9c2a1c028b) )
125   ROM_LOAD16_BYTE( "ep6v2.b33", 0x00001, 0x20000, CRC(37928a5d) SHA1(7850be26dbd356cdeef2a0d87738de16420f6291) )
126
127   ROM_REGION( 0x180000, REGION_SOUND1, 0 )
128   ROM_LOAD16_BYTE( "ep2v2.b41", 0x000000, 0x80000, CRC(7dad3458) SHA1(deae5ebef0346250d3f9744933423253a336bb67) )
129   ROM_LOAD16_BYTE( "ep4v2.b37", 0x000001, 0x80000, CRC(b0be2e91) SHA1(66f3a9f5abeb4b95ac806e4bb165f938dca38b2d) )
130   ROM_LOAD16_BYTE( "ep3v2.b40", 0x100000, 0x40000, CRC(8c491526) SHA1(95c6bcbe0adcfffb12fd2b86c9f4ca26aa188bbf) )
131   ROM_LOAD16_BYTE( "ep5v2.b36", 0x100001, 0x40000, CRC(7592b2eb) SHA1(92a540726306d7adbf207fe86a4c4fa66958f90b) )
132
133   ROM_REGION( 0x800, REGION_USER1, 0 )   /* The SRAM module */
134   ROM_LOAD( "ds1220y.b53", 0x000, 0x800, CRC(b21cfe5f) SHA1(898ace3cd0913ea4b0dc84320219777773ef856f) )
135
136   /* These roms are identical on both of the upper boards */
137   ROM_REGION( 0x200000, REGION_GFX1, 0 )
138   ROM_LOAD( "9.u54",  0x000000, 0x80000, CRC(a276e18b) SHA1(6d60e519196a4858b82241504592413df498e12f) )
139   ROM_LOAD( "10.u55", 0x080000, 0x80000, CRC(8921f20e) SHA1(6e9ca2eaad3e1108ba0e1d7792fd5d0305bec201) )
140   ROM_LOAD( "11.u56", 0x100000, 0x80000, CRC(a83094ce) SHA1(c3512375fecdb5e7eb02a4aa140ae4efe0233cb8) )
141   ROM_LOAD( "12.u57", 0x180000, 0x80000, CRC(0cdffd4f) SHA1(65ace78711b3ef6e0ff9a7ad7343b5558e652f6c) )
142
143   ROM_REGION( 0x400, REGION_PLDS, 0 )
144   ROM_LOAD( "pal1_w2.u51", 0x000, 0x1f1, CRC(af497420) SHA1(03aa82189d91ae194dd5a6e7b9dbdb7cd473ddb6) )
145   ROM_LOAD( "pal2_w2.u52", 0x200, 0x1f1, CRC(4a6df05d) SHA1(236b951e5daf927c050d0f35558c171a020156ab) )
146ROM_END
147
148ROM_START( shadfgtr )
149   ROM_REGION( 0x100000, REGION_CPU1, 0 )
150   ROM_LOAD16_BYTE( "shadfgtr.b49", 0x00000, 0x80000, CRC(2d9d31a1) SHA1(45854915bcb9db2e4076a7f26a0a349077cd10bc) )
151   ROM_LOAD16_BYTE( "shadfgtr.b51", 0x00001, 0x80000, CRC(03d0f075) SHA1(06013a4363305a23d7e8ba8fe2fa961cd540391d) )
152
153   ROM_REGION( 0x40000, REGION_CPU2, 0 )
154   ROM_LOAD16_BYTE( "shadfgtr.b42", 0x00000, 0x20000, CRC(f8605dcd) SHA1(1b29f47856ccc757bc96674682ae48f87e6b0e54) )
155   ROM_LOAD16_BYTE( "shadfgtr.b33", 0x00001, 0x20000, CRC(291d59ac) SHA1(cc4904c2ac8ef6a12033c10893246a438ac44014) )
156
157   ROM_REGION( 0x100000, REGION_SOUND1, 0 )
158   ROM_LOAD16_BYTE( "shadfgtr.b41", 0x00000, 0x80000, CRC(9e4b4df3) SHA1(8101197275e9f728acdeef85737eecbdec132b27) )
159   ROM_LOAD16_BYTE( "shadfgtr.b37", 0x00001, 0x80000, CRC(98446ba2) SHA1(1c8cc0d9c5de54d9e53699a5ab281579d15edc96) )
160
161   ROM_REGION( 0x800, REGION_USER1, 0 )   /* The SRAM module */
162   ROM_LOAD( "shadfgtr.b53", 0x000, 0x800, CRC(e766a3ab) SHA1(e7696ec08d5c86f64d768480f43edbd19ded162d) )
163
164   ROM_REGION( 0x200000, REGION_GFX1, 0 )
165   ROM_LOAD( "shadfgtr.u54", 0x000000, 0x80000, CRC(c45d68d6) SHA1(a133e4f13d3af18bccf0d060a659d64ac699b159) )
166   ROM_LOAD( "shadfgtr.u55", 0x080000, 0x80000, CRC(e807631d) SHA1(9027ff7dc60b808434dac292c08f0630d3d52186) )
167   ROM_LOAD( "shadfgtr.u56", 0x100000, 0x80000, CRC(fb76db5a) SHA1(fa546f465df113c13037abed1162bfa6f9b1dc9b) )
168   ROM_LOAD( "shadfgtr.u57", 0x180000, 0x80000, CRC(60d701d7) SHA1(936473b5e3b2e9e9e3b50cf977fc5a670a097850) )
169
170   ROM_REGION( 0x200, REGION_PLDS, 0 )
171   ROM_LOAD( "shadfgtr.u51", 0x000, 0x1f1, CRC(bab58337) SHA1(c4a79c8e53aeadb7f64d49d214b607b5b36f144e) )
172   /* The second upper-board PAL couldn't be read */
173ROM_END
174
175/*    YEAR  NAME      PARENT  MACHINE  INPUT    INIT MONITOR COMPANY     FULLNAME           FLAGS */
176GAME( 1993, vcombat,  0,      vcombat, vcombat, 0,   ROT0,   "VR8 Inc.", "Virtual Combat",  GAME_NOT_WORKING | GAME_NO_SOUND )
177GAME( 1989, shadfgtr, 0,      vcombat, vcombat, 0,   ROT0,   "Sega?",    "Shadow Fighters", GAME_NOT_WORKING | GAME_NO_SOUND )
src/mame/drivers/pkscram.c
r1679r1680
212212   {
213213       if (out&0x2000)
214214          cpunum_set_input_line(machine, 0, 1, ASSERT_LINE);
215      timer_adjust(scanline_timer, video_screen_get_time_until_pos(0, param+1, 0), param+1, attotime_zero);
215      timer_adjust_oneshot(scanline_timer, video_screen_get_time_until_pos(0, param+1, 0), param+1);
216216      interrupt_line_active = 1;
217217   }
218218   else
219219   {
220220      if (interrupt_line_active)
221221          cpunum_set_input_line(machine, 0, 1, CLEAR_LINE);
222      timer_adjust(scanline_timer, video_screen_get_time_until_pos(0, interrupt_scanline, 0), interrupt_scanline, attotime_zero);
222      timer_adjust_oneshot(scanline_timer, video_screen_get_time_until_pos(0, interrupt_scanline, 0), interrupt_scanline);
223223      interrupt_line_active = 0;
224224   }
225225}
226226
227227static VIDEO_START( pkscramble )
228228{
229   bg_tilemap = tilemap_create(get_bg_tile_info, tilemap_scan_rows, TILEMAP_TYPE_PEN,      8, 8,32,32);
230   md_tilemap = tilemap_create(get_md_tile_info, tilemap_scan_rows, TILEMAP_TYPE_PEN, 8, 8,32,32);
231   fg_tilemap = tilemap_create(get_fg_tile_info, tilemap_scan_rows, TILEMAP_TYPE_PEN, 8, 8,32,32);
229   bg_tilemap = tilemap_create(get_bg_tile_info, tilemap_scan_rows, 8, 8,32,32);
230   md_tilemap = tilemap_create(get_md_tile_info, tilemap_scan_rows, 8, 8,32,32);
231   fg_tilemap = tilemap_create(get_fg_tile_info, tilemap_scan_rows, 8, 8,32,32);
232232
233233   tilemap_set_transparent_pen(md_tilemap,15);
234234   tilemap_set_transparent_pen(fg_tilemap,15);
r1679r1680
275275   out = 0;
276276   interrupt_line_active=0;
277277   scanline_timer = timer_alloc(scanline_callback, NULL);
278   timer_adjust(scanline_timer, video_screen_get_time_until_pos(0, interrupt_scanline, 0), interrupt_scanline, attotime_zero);
278   timer_adjust_oneshot(scanline_timer, video_screen_get_time_until_pos(0, interrupt_scanline, 0), interrupt_scanline);
279279
280280   state_save_register_global(out);
281281   state_save_register_global(interrupt_line_active);
src/mame/drivers/taito_f3.c
r1679r1680
219219
220220   PORT_START
221221   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_SPECIAL ) /* Eprom data bit */
222   PORT_BIT(0x02, IP_ACTIVE_LOW, IPT_SERVICE ) PORT_NAME( DEF_STR( Service_Mode )) PORT_CODE(KEYCODE_F2)
222   PORT_SERVICE_NO_TOGGLE( 0x02, IP_ACTIVE_LOW )
223223   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_UNKNOWN )
224224   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_UNUSED ) /* Another service mode */
225225   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_COIN1 )
r1679r1680
285285
286286   PORT_START
287287   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_SPECIAL ) /* Eprom data bit */
288   PORT_BIT(0x02, IP_ACTIVE_LOW, IPT_SERVICE ) PORT_NAME( DEF_STR( Service_Mode )) PORT_CODE(KEYCODE_F2)
288   PORT_SERVICE_NO_TOGGLE( 0x02, IP_ACTIVE_LOW )
289289   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_UNKNOWN )
290290   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_UNUSED ) /* Another service mode */
291291   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_COIN1 )
src/mame/drivers/beaminv.c
r1679r1680
8787   next_interrupt_number = (interrupt_number + 1) % INTERRUPTS_PER_FRAME;
8888   next_vpos = interrupt_lines[next_interrupt_number];
8989
90   timer_adjust(interrupt_timer, video_screen_get_time_until_pos(0, next_vpos, 0), next_interrupt_number, attotime_zero);
90   timer_adjust_oneshot(interrupt_timer, video_screen_get_time_until_pos(0, next_vpos, 0), next_interrupt_number);
9191}
9292
9393
r1679r1680
100100static void start_interrupt_timer(void)
101101{
102102   int vpos = interrupt_lines[0];
103   timer_adjust(interrupt_timer, video_screen_get_time_until_pos(0, vpos, 0), 0, attotime_zero);
103   timer_adjust_oneshot(interrupt_timer, video_screen_get_time_until_pos(0, vpos, 0), 0);
104104}
105105
106106
src/mame/drivers/m107.c
r1679r1680
5151
5252static MACHINE_RESET( m107 )
5353{
54   timer_adjust(scanline_timer, video_screen_get_time_until_pos(0, 0, 0), 0, attotime_never);
54   timer_adjust_oneshot(scanline_timer, video_screen_get_time_until_pos(0, 0, 0), 0);
5555}
5656
5757/*****************************************************************************/
r1679r1680
7777   /* adjust for next scanline */
7878   if (++scanline >= machine->screen[0].height)
7979      scanline = 0;
80   timer_adjust(scanline_timer, video_screen_get_time_until_pos(0, scanline, 0), scanline, attotime_never);
80   timer_adjust_oneshot(scanline_timer, video_screen_get_time_until_pos(0, scanline, 0), scanline);
8181}
8282
8383
src/mame/drivers/arkanoid.c
r1679r1680
608608static INPUT_PORTS_START( ark1ball )
609609   PORT_INCLUDE(arknoidj)
610610
611   PORT_START_TAG("DSW")
611   PORT_MODIFY("DSW")
612612   PORT_DIPNAME( 0x10, 0x10, DEF_STR( Bonus_Life ) )   /* "ld a,$60" at 0x93bd and "ld a,$60" at 0x9c7f and 0x9c9b */
613613   PORT_DIPSETTING(    0x10, "60K 100K 60K+" )
614614   PORT_DIPSETTING(    0x00, "60K" )
r1679r1680
672672static INPUT_PORTS_START( arktayt2 )
673673   PORT_INCLUDE(arknoidj)
674674
675   PORT_START_TAG("DSW")
675   PORT_MODIFY("DSW")
676676   PORT_DIPNAME( 0x10, 0x10, DEF_STR( Bonus_Life ) )   /* "ld a,$60" at 0x93bd and "ld a,$60" at 0x9c7f and 0x9c9b */
677677   PORT_DIPSETTING(    0x10, "60K 100K 60K+" )
678678   PORT_DIPSETTING(    0x00, "60K" )
src/mame/drivers/srmp6.c
r1679r1680
617617   PORT_BIT ( 0x0020, IP_ACTIVE_LOW, IPT_MAHJONG_KAN )
618618   PORT_BIT ( 0x0040, IP_ACTIVE_LOW, IPT_START1 )
619619   PORT_BIT ( 0x0080, IP_ACTIVE_LOW, IPT_COIN1 ) PORT_IMPULSE(2)
620   PORT_BIT ( 0x0100, IP_ACTIVE_LOW, IPT_SERVICE ) PORT_NAME(DEF_STR( Test )) PORT_CODE(KEYCODE_F2)
620   PORT_SERVICE_NO_TOGGLE( 0x0100, IP_ACTIVE_LOW )
621621
622622   PORT_START
623623   PORT_BIT ( 0xfe41, IP_ACTIVE_LOW, IPT_UNUSED ) // explicitely discarded
src/mame/drivers/cball.c
r1679r1680
2828
2929static VIDEO_START( cball )
3030{
31   bg_tilemap = tilemap_create(get_tile_info, tilemap_scan_rows, TILEMAP_TYPE_PEN, 8, 8, 32, 32);
31   bg_tilemap = tilemap_create(get_tile_info, tilemap_scan_rows, 8, 8, 32, 32);
3232}
3333
3434
src/mame/drivers/cave.c
r1679r1680
16721672   PORT_MODIFY("IN0")   // IN0 - Player 1
16731673   PORT_BIT(  0x0400, IP_ACTIVE_LOW, IPT_BUTTON4 ) PORT_PLAYER(1)
16741674
1675   PORT_MODIFY("IN0")   // IN1 - Player 2
1675   PORT_MODIFY("IN1")   // IN1 - Player 2
16761676   PORT_BIT(  0x0400, IP_ACTIVE_LOW, IPT_BUTTON4 ) PORT_PLAYER(2)
16771677INPUT_PORTS_END
16781678
r1679r1680
40944094   time_vblank_irq = 100;
40954095
40964096   irq_level = 1;
4097
4098   NMK112_init(0);
40974099}
40984100
40994101static DRIVER_INIT( agallet )
r1679r1680
41614163   cave_spritetype = 1;   // "different" sprites (no zooming?)
41624164   time_vblank_irq = 90;
41634165
4164   NMK112_set_paged_table(0, 0);   // chip #0 (music) is not paged
4166   NMK112_init(1<<0);   // chip #0 (music) is not paged
41654167}
41664168
41674169static DRIVER_INIT( esprade )
src/mame/drivers/fuukifg3.c
r1679r1680
148148
149149***************************************************************************/
150150
151/* Define clocks based on actual OSC on the PCB */
152
153#define CPU_CLOCK      (XTAL_40MHz / 2)      /* clock for 68020 */
154#define SOUND_CPU_CLOCK      (XTAL_12MHz / 2)      /* clock for Z80 sound CPU */
155#define FM_SOUND_CLOCK      (XTAL_33_8688MHz / 2)      /* FM clock */
156
157/* NOTE: YMF278B_STD_CLOCK is defined in /src/emu/sound/ymf278b.h */
158
159
151160#include "driver.h"
152161#include "deprecat.h"
153162#include "sound/262intf.h"
r1679r1680
250259      COMBINE_DATA(&fuuki32_vregs[offset]);
251260      if (offset == 0x1c/4)
252261      {
253         timer_adjust(raster_interrupt_timer, video_screen_get_time_until_pos(0, fuuki32_vregs[0x1c/4]>>16, Machine->screen[0].visarea.max_x + 1), 0, video_screen_get_frame_period(0));
262         timer_adjust_periodic(raster_interrupt_timer, video_screen_get_time_until_pos(0, fuuki32_vregs[0x1c/4]>>16, Machine->screen[0].visarea.max_x + 1), 0, video_screen_get_frame_period(0));
254263      }
255264   }
256265}
r1679r1680
555564{
556565   cpunum_set_input_line(machine, 0, 5, PULSE_LINE);   // Raster Line IRQ
557566   video_screen_update_partial(0, video_screen_get_vpos(0));
558   timer_adjust(raster_interrupt_timer, video_screen_get_frame_period(0), 0, attotime_zero);
567   timer_adjust_oneshot(raster_interrupt_timer, video_screen_get_frame_period(0), 0);
559568}
560569
561570
r1679r1680
569578{
570579   timer_set(video_screen_get_time_until_pos(0, 248, 0), NULL, 0, level_1_interrupt_callback);
571580   timer_set(video_screen_get_time_until_pos(0, machine->screen[0].visarea.max_y + 1, 0), NULL, 0, vblank_interrupt_callback);
572   timer_adjust(raster_interrupt_timer, video_screen_get_time_until_pos(0, 0, machine->screen[0].visarea.max_x + 1), 0, attotime_zero);
581   timer_adjust_oneshot(raster_interrupt_timer, video_screen_get_time_until_pos(0, 0, machine->screen[0].visarea.max_x + 1), 0);
573582}
574583
575584
r1679r1680
591600static MACHINE_DRIVER_START( fuuki32 )
592601
593602   /* basic machine hardware */
594   MDRV_CPU_ADD(M68EC020, 20000000) /* verified */
603   MDRV_CPU_ADD(M68EC020, CPU_CLOCK) /* 20MHz verified */
595604   MDRV_CPU_PROGRAM_MAP(fuuki32_readmem,fuuki32_writemem)
596605
597   MDRV_CPU_ADD_TAG("sound", Z80, 6000000) /* verified */
606   MDRV_CPU_ADD_TAG("sound", Z80, SOUND_CPU_CLOCK) /* 6MHz verified */
598607   MDRV_CPU_PROGRAM_MAP(fuuki32_sound_readmem,fuuki32_sound_writemem)
599608   MDRV_CPU_IO_MAP(fuuki32_sound_readport,fuuki32_sound_writeport)
600609
r1679r1680
618627   /* sound hardware */
619628   MDRV_SPEAKER_STANDARD_STEREO("left", "right")
620629
621   MDRV_SOUND_ADD(YMF262, 14318180)
630   MDRV_SOUND_ADD(YMF262, FM_SOUND_CLOCK) /* 33.8688MHz OSC divided by 2 is 16.9344MHz */
622631   MDRV_SOUND_CONFIG(ymf262_interface)
623632   MDRV_SOUND_ROUTE(0, "left", 0.50)
624633   MDRV_SOUND_ROUTE(1, "right", 0.50)
625634   MDRV_SOUND_ROUTE(2, "left", 0.50)
626635   MDRV_SOUND_ROUTE(3, "right", 0.50)
627636
628   MDRV_SOUND_ADD(YMF278B, YMF278B_STD_CLOCK)
637   MDRV_SOUND_ADD(YMF278B, YMF278B_STD_CLOCK) /* YMF278B_STD_CLOCK = OSC 33.8688MHz */
629638   MDRV_SOUND_CONFIG(ymf278b_interface)
630639   MDRV_SOUND_ROUTE(0, "left", 0.50)
631640   MDRV_SOUND_ROUTE(1, "right", 0.50)
r1679r1680
641650
642651/***************************************************************************
643652
644                                Asura Blade
645Fuuki, 1999
653                 Asura Blade - Sword of Dynasty (Japan)
646654
647This dump is taken from a ROM board with number FG-3J ROM-J
648There's nothing on the board except some 4M EPROMs and several
649surface mounted MASK ROMs.
655Fuuki, 1999   Consists of a FG-3J MAIN-J mainboard &  FG-3J ROM-J combo
650656
651The connectors on the board and the size of the board is similar
652to Jaleco Megasys32, however it's not compatible with it due to the
653connector spacing being different. The physical size of the board
654is too large to fit an SSV board.
655So, I have no idea what the main hardware is, the game probably
656runs on a custom Fuuki system board named 'FG-3'?
657
658657***************************************************************************/
659658
660659ROM_START( asurabld )
r1679r1680
692691   ROM_LOAD( "pcm.u6", 0x00000, 0x400000, CRC(ac72225a) SHA1(8d16399ed34ac5bd69dbf43b2de2b0db9ac1c610) )
693692ROM_END
694693
694/***************************************************************************
695
696                 Asura Buster - Eternal Warriors (Japan)
697
698Fuuki, 2000   Consists of a FG-3J MAIN-J mainboard &  FG-3J ROM-J combo
699
700***************************************************************************/
701
695702ROM_START( asurabus )
696703   ROM_REGION( 0x200000, REGION_CPU1, 0 ) /* M68020 */
697704   ROM_LOAD32_BYTE( "pgm3.u1", 0x000000, 0x80000, CRC(2c6b5271) SHA1(188371f1f003823ac719e962e048719d76696b2f) )
src/mame/drivers/cherrym2.c
r1679r1680
5454static VIDEO_START(cm2)
5555{
5656   bg_tilemap = tilemap_create(get_bg_tile_info, tilemap_scan_rows,
57      TILEMAP_TYPE_PEN, 8, 8, 32, 32);
57      8, 8, 32, 32);
5858}
5959
6060static VIDEO_UPDATE(cm2)
src/mame/drivers/bigfghtr.c
r1679r1680
162162
163163static VIDEO_START( bigfghtr )
164164{
165   bg_tilemap = tilemap_create(get_bg_tile_info,tilemap_scan_cols,TILEMAP_TYPE_PEN,16,16,64,32);
166   fg_tilemap = tilemap_create(get_fg_tile_info,tilemap_scan_cols,TILEMAP_TYPE_PEN,16,16,64,32);
167   tx_tilemap = tilemap_create(get_tx_tile_info,tilemap_scan_cols,TILEMAP_TYPE_PEN,8,8,64,32);
165   bg_tilemap = tilemap_create(get_bg_tile_info,tilemap_scan_cols,16,16,64,32);
166   fg_tilemap = tilemap_create(get_fg_tile_info,tilemap_scan_cols,16,16,64,32);
167   tx_tilemap = tilemap_create(get_tx_tile_info,tilemap_scan_cols,8,8,64,32);
168168
169169   tilemap_set_transparent_pen(fg_tilemap,0xf);
170170   tilemap_set_transparent_pen(tx_tilemap,0xf);
src/mame/drivers/genesis.c
r1679r1680
115115      scanline = 0;
116116
117117   /* set a timer */
118   timer_adjust(scan_timer, video_screen_get_time_until_pos(0, scanline, 320), scanline, attotime_zero);
118   timer_adjust_oneshot(scan_timer, video_screen_get_time_until_pos(0, scanline, 320), scanline);
119119}
120120
121121
r1679r1680
174174
175175   /* set the first scanline 0 timer to go off */
176176   scan_timer = timer_alloc(vdp_reload_counter, NULL);
177   timer_adjust(scan_timer, video_screen_get_time_until_pos(0, 0, 320), 0, attotime_zero);
177   timer_adjust_oneshot(scan_timer, video_screen_get_time_until_pos(0, 0, 320), 0);
178178}
179179
180180
src/mame/drivers/trvmadns.c
r1679r1680
264264
265265static VIDEO_START( trvmadns )
266266{
267   bg_tilemap = tilemap_create(get_bg_tile_info, tilemap_scan_rows, TILEMAP_TYPE_PEN, 8, 8, 32, 32);
267   bg_tilemap = tilemap_create(get_bg_tile_info, tilemap_scan_rows, 8, 8, 32, 32);
268268
269269   tilemap_set_transparent_pen(bg_tilemap,1);
270270}
src/mame/drivers/cloud9.c
r1679r1680
132132   curscanline = (curscanline + 64) & 255;
133133
134134   /* next one at the start of this scanline */
135   timer_adjust(irq_timer, video_screen_get_time_until_pos(0, curscanline, 0), curscanline, attotime_zero);
135   timer_adjust_oneshot(irq_timer, video_screen_get_time_until_pos(0, curscanline, 0), curscanline);
136136}
137137
138138
src/mame/drivers/rabbit.c
r1679r1680
346346   memset(rabbit_tilemap_ram[2], 0, 0x20000);
347347   memset(rabbit_tilemap_ram[3], 0, 0x20000);
348348
349   rabbit_tilemap[0] = tilemap_create(get_rabbit_tilemap0_tile_info,tilemap_scan_rows,TILEMAP_TYPE_PEN ,     16, 16, 128,32);
350   rabbit_tilemap[1] = tilemap_create(get_rabbit_tilemap1_tile_info,tilemap_scan_rows,TILEMAP_TYPE_PEN ,     16, 16, 128,32);
351   rabbit_tilemap[2] = tilemap_create(get_rabbit_tilemap2_tile_info,tilemap_scan_rows,TILEMAP_TYPE_PEN ,     16, 16, 128,32);
352   rabbit_tilemap[3] = tilemap_create(get_rabbit_tilemap3_tile_info,tilemap_scan_rows,TILEMAP_TYPE_PEN ,     8, 8, 128,32);
349   rabbit_tilemap[0] = tilemap_create(get_rabbit_tilemap0_tile_info,tilemap_scan_rows,16, 16, 128,32);
350   rabbit_tilemap[1] = tilemap_create(get_rabbit_tilemap1_tile_info,tilemap_scan_rows,16, 16, 128,32);
351   rabbit_tilemap[2] = tilemap_create(get_rabbit_tilemap2_tile_info,tilemap_scan_rows,16, 16, 128,32);
352   rabbit_tilemap[3] = tilemap_create(get_rabbit_tilemap3_tile_info,tilemap_scan_rows, 8,  8, 128,32);
353353   tilemap_set_transparent_pen(rabbit_tilemap[0],0x0);
354354   tilemap_set_transparent_pen(rabbit_tilemap[1],0x0);
355355   tilemap_set_transparent_pen(rabbit_tilemap[2],0x0);
r1679r1680
11361136   memset(rabbit_tilemap_ram[2], 0, 0x20000);
11371137   memset(rabbit_tilemap_ram[3], 0, 0x20000);
11381138
1139   rabbit_tilemap[0] = tilemap_create(get_tmmjprd_tilemap0_tile_info,tilemap_scan_rows,TILEMAP_TYPE_PEN ,     8, 8, 64, 64);
1140   rabbit_tilemap[1] = tilemap_create(get_tmmjprd_tilemap1_tile_info,tilemap_scan_rows,TILEMAP_TYPE_PEN ,     16, 16, 64, 64);
1141   rabbit_tilemap[2] = tilemap_create(get_tmmjprd_tilemap2_tile_info,tilemap_scan_rows,TILEMAP_TYPE_PEN ,     16, 16, 64, 64);
1142   rabbit_tilemap[3] = tilemap_create(get_tmmjprd_tilemap3_tile_info,tilemap_scan_rows,TILEMAP_TYPE_PEN ,     16, 16, 64, 64);
1139   rabbit_tilemap[0] = tilemap_create(get_tmmjprd_tilemap0_tile_info,tilemap_scan_rows, 8, 8, 64, 64);
1140   rabbit_tilemap[1] = tilemap_create(get_tmmjprd_tilemap1_tile_info,tilemap_scan_rows,16, 16, 64, 64);
1141   rabbit_tilemap[2] = tilemap_create(get_tmmjprd_tilemap2_tile_info,tilemap_scan_rows,16, 16, 64, 64);
1142   rabbit_tilemap[3] = tilemap_create(get_tmmjprd_tilemap3_tile_info,tilemap_scan_rows,16, 16, 64, 64);
11431143   tilemap_set_transparent_pen(rabbit_tilemap[0],0x0);
11441144   tilemap_set_transparent_pen(rabbit_tilemap[1],0x0);
11451145   tilemap_set_transparent_pen(rabbit_tilemap[2],0x0);
src/mame/drivers/pooyan.c
r1679r1680
267267
268268   ROM_REGION( 0x0220, REGION_PROMS, 0 )
269269   ROM_LOAD( "pooyan.pr1",   0x0000, 0x0020, CRC(a06a6d0e) SHA1(ae131320b66d76d4bc9108da6708f6f874b2e123) ) /* palette */
270   ROM_LOAD( "pooyan.pr2",   0x0020, 0x0100, CRC(82748c0b) SHA1(9ce8eb92e482eba5a9077e9db99841d65b011346) ) /* sprites */
271   ROM_LOAD( "pooyan.pr3",   0x0120, 0x0100, CRC(8cd4cd60) SHA1(e0188ecd5b53a8e6e28c1de80def676740772334) ) /* characters */
270   ROM_LOAD( "pooyan.pr3",   0x0020, 0x0100, CRC(8cd4cd60) SHA1(e0188ecd5b53a8e6e28c1de80def676740772334) ) /* characters */
271   ROM_LOAD( "pooyan.pr2",   0x0120, 0x0100, CRC(82748c0b) SHA1(9ce8eb92e482eba5a9077e9db99841d65b011346) ) /* sprites */
272272ROM_END
273273
274274ROM_START( pooyans )
r1679r1680
292292
293293   ROM_REGION( 0x0220, REGION_PROMS, 0 )
294294   ROM_LOAD( "pooyan.pr1",   0x0000, 0x0020, CRC(a06a6d0e) SHA1(ae131320b66d76d4bc9108da6708f6f874b2e123) ) /* palette */
295   ROM_LOAD( "pooyan.pr2",   0x0020, 0x0100, CRC(82748c0b) SHA1(9ce8eb92e482eba5a9077e9db99841d65b011346) ) /* sprites */
296   ROM_LOAD( "pooyan.pr3",   0x0120, 0x0100, CRC(8cd4cd60) SHA1(e0188ecd5b53a8e6e28c1de80def676740772334) ) /* characters */
295   ROM_LOAD( "pooyan.pr3",   0x0020, 0x0100, CRC(8cd4cd60) SHA1(e0188ecd5b53a8e6e28c1de80def676740772334) ) /* characters */
296   ROM_LOAD( "pooyan.pr2",   0x0120, 0x0100, CRC(82748c0b) SHA1(9ce8eb92e482eba5a9077e9db99841d65b011346) ) /* sprites */
297297ROM_END
298298
299299ROM_START( pootan )
r1679r1680
317317
318318   ROM_REGION( 0x0220, REGION_PROMS, 0 )
319319   ROM_LOAD( "pooyan.pr1",   0x0000, 0x0020, CRC(a06a6d0e) SHA1(ae131320b66d76d4bc9108da6708f6f874b2e123) ) /* palette */
320   ROM_LOAD( "pooyan.pr2",   0x0020, 0x0100, CRC(82748c0b) SHA1(9ce8eb92e482eba5a9077e9db99841d65b011346) ) /* sprites */
321   ROM_LOAD( "pooyan.pr3",   0x0120, 0x0100, CRC(8cd4cd60) SHA1(e0188ecd5b53a8e6e28c1de80def676740772334) ) /* characters */
320   ROM_LOAD( "pooyan.pr3",   0x0020, 0x0100, CRC(8cd4cd60) SHA1(e0188ecd5b53a8e6e28c1de80def676740772334) ) /* characters */
321   ROM_LOAD( "pooyan.pr2",   0x0120, 0x0100, CRC(82748c0b) SHA1(9ce8eb92e482eba5a9077e9db99841d65b011346) ) /* sprites */
322322ROM_END
323323
324324
src/mame/drivers/backfire.c
r1679r1680
384384   PORT_BIT( 0x0001, IP_ACTIVE_LOW, IPT_COIN1 )
385385   PORT_BIT( 0x0002, IP_ACTIVE_LOW, IPT_COIN2 )
386386   PORT_BIT( 0x0004, IP_ACTIVE_LOW, IPT_SERVICE1 )
387   PORT_BIT( 0x0008, IP_ACTIVE_LOW, IPT_SERVICE ) PORT_NAME( DEF_STR( Service_Mode )) PORT_CODE(KEYCODE_F2)
387   PORT_SERVICE_NO_TOGGLE( 0x0008, IP_ACTIVE_LOW )
388388   PORT_BIT( 0x0010, IP_ACTIVE_HIGH, IPT_VBLANK )
389389   PORT_BIT( 0x0020, IP_ACTIVE_LOW, IPT_UNUSED ) /* 'soundmask' */
390390   PORT_BIT( 0x0040, IP_ACTIVE_LOW, IPT_UNUSED )
r1679r1680
402402   PORT_BIT( 0x0001, IP_ACTIVE_LOW, IPT_COIN1 )
403403   PORT_BIT( 0x0002, IP_ACTIVE_LOW, IPT_COIN2 )
404404   PORT_BIT( 0x0004, IP_ACTIVE_LOW, IPT_SERVICE1 )
405   PORT_BIT( 0x0008, IP_ACTIVE_LOW, IPT_SERVICE ) PORT_NAME( DEF_STR( Service_Mode )) PORT_CODE(KEYCODE_F2)
405   PORT_SERVICE_NO_TOGGLE( 0x0008, IP_ACTIVE_LOW )
406406   PORT_BIT( 0x0010, IP_ACTIVE_HIGH, IPT_VBLANK )
407407   PORT_BIT( 0x0020, IP_ACTIVE_LOW, IPT_UNUSED ) /* 'soundmask' */
408408   PORT_BIT( 0x0040, IP_ACTIVE_HIGH, IPT_VBLANK )
src/mame/drivers/pirates.c
r1679r1680
211211
212212static INPUT_PORTS_START( pirates )
213213   PORT_START   // IN0 - 0x300000.w
214   PORT_BIT(  0x0001, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_PLAYER(1)
215   PORT_BIT(  0x0002, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_PLAYER(1)
216   PORT_BIT(  0x0004, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_PLAYER(1)
217   PORT_BIT(  0x0008, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_PLAYER(1)
218   PORT_BIT(  0x0010, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(1)
219   PORT_BIT(  0x0020, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_PLAYER(1)
220   PORT_BIT(  0x0040, IP_ACTIVE_LOW, IPT_BUTTON3 ) PORT_PLAYER(1)
221   PORT_BIT(  0x0080, IP_ACTIVE_LOW, IPT_START1 )
222   PORT_BIT(  0x0100, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_PLAYER(2)
223   PORT_BIT(  0x0200, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_PLAYER(2)
224   PORT_BIT(  0x0400, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_PLAYER(2)
225   PORT_BIT(  0x0800, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_PLAYER(2)
226   PORT_BIT(  0x1000, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(2)
227   PORT_BIT(  0x2000, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_PLAYER(2)
228   PORT_BIT(  0x4000, IP_ACTIVE_LOW, IPT_BUTTON3 ) PORT_PLAYER(2)
229   PORT_BIT(  0x8000, IP_ACTIVE_LOW, IPT_START2 )
214   PORT_BIT( 0x0001, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_PLAYER(1)
215   PORT_BIT( 0x0002, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_PLAYER(1)
216   PORT_BIT( 0x0004, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_PLAYER(1)
217   PORT_BIT( 0x0008, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_PLAYER(1)
218   PORT_BIT( 0x0010, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(1)
219   PORT_BIT( 0x0020, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_PLAYER(1)
220   PORT_BIT( 0x0040, IP_ACTIVE_LOW, IPT_BUTTON3 ) PORT_PLAYER(1)
221   PORT_BIT( 0x0080, IP_ACTIVE_LOW, IPT_START1 )
222   PORT_BIT( 0x0100, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_PLAYER(2)
223   PORT_BIT( 0x0200, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_PLAYER(2)
224   PORT_BIT( 0x0400, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_PLAYER(2)
225   PORT_BIT( 0x0800, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_PLAYER(2)
226   PORT_BIT( 0x1000, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(2)
227   PORT_BIT( 0x2000, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_PLAYER(2)
228   PORT_BIT( 0x4000, IP_ACTIVE_LOW, IPT_BUTTON3 ) PORT_PLAYER(2)
229   PORT_BIT( 0x8000, IP_ACTIVE_LOW, IPT_START2 )
230230
231231   PORT_START   // IN1 - 0x400000.w
232   PORT_BIT(  0x0001, IP_ACTIVE_LOW, IPT_COIN1 )
233   PORT_BIT(  0x0002, IP_ACTIVE_LOW, IPT_COIN2 )
234   PORT_BIT(  0x0004, IP_ACTIVE_LOW, IPT_SERVICE1 )
235   PORT_BIT( 0x0008, IP_ACTIVE_LOW, IPT_SERVICE ) PORT_NAME( DEF_STR( Service_Mode )) PORT_CODE(KEYCODE_F2)
236   PORT_BIT(  0x0010, IP_ACTIVE_HIGH,IPT_SPECIAL )      // EEPROM data
237   PORT_BIT(  0x0020, IP_ACTIVE_HIGH, IPT_UNKNOWN )      // seems checked in "test mode"
238   PORT_BIT(  0x0040, IP_ACTIVE_HIGH, IPT_UNKNOWN )      // seems checked in "test mode"
239   PORT_BIT(  0x0080, IP_ACTIVE_HIGH,IPT_SPECIAL )      // protection (see pirates_in1_r)
232   PORT_BIT( 0x0001, IP_ACTIVE_LOW, IPT_COIN1 )
233   PORT_BIT( 0x0002, IP_ACTIVE_LOW, IPT_COIN2 )
234   PORT_BIT( 0x0004, IP_ACTIVE_LOW, IPT_SERVICE1 )
235   PORT_SERVICE_NO_TOGGLE( 0x0008, IP_ACTIVE_LOW )
236   PORT_BIT( 0x0010, IP_ACTIVE_HIGH,IPT_SPECIAL )      // EEPROM data
237   PORT_BIT( 0x0020, IP_ACTIVE_HIGH, IPT_UNKNOWN )      // seems checked in "test mode"
238   PORT_BIT( 0x0040, IP_ACTIVE_HIGH, IPT_UNKNOWN )      // seems checked in "test mode"
239   PORT_BIT( 0x0080, IP_ACTIVE_HIGH,IPT_SPECIAL )      // protection (see pirates_in1_r)
240240   /* What do these bits do ? */
241   PORT_BIT(  0x0100, IP_ACTIVE_HIGH, IPT_UNKNOWN )
242   PORT_BIT(  0x0200, IP_ACTIVE_HIGH, IPT_UNKNOWN )
243   PORT_BIT(  0x0400, IP_ACTIVE_HIGH, IPT_UNKNOWN )
244   PORT_BIT(  0x0800, IP_ACTIVE_HIGH, IPT_UNKNOWN )
245   PORT_BIT(  0x1000, IP_ACTIVE_HIGH, IPT_UNKNOWN )
246   PORT_BIT(  0x2000, IP_ACTIVE_HIGH, IPT_UNKNOWN )
247   PORT_BIT(  0x4000, IP_ACTIVE_HIGH, IPT_UNKNOWN )
248   PORT_BIT(  0x8000, IP_ACTIVE_HIGH, IPT_UNKNOWN )
241   PORT_BIT( 0x0100, IP_ACTIVE_HIGH, IPT_UNKNOWN )
242   PORT_BIT( 0x0200, IP_ACTIVE_HIGH, IPT_UNKNOWN )
243   PORT_BIT( 0x0400, IP_ACTIVE_HIGH, IPT_UNKNOWN )
244   PORT_BIT( 0x0800, IP_ACTIVE_HIGH, IPT_UNKNOWN )
245   PORT_BIT( 0x1000, IP_ACTIVE_HIGH, IPT_UNKNOWN )
246   PORT_BIT( 0x2000, IP_ACTIVE_HIGH, IPT_UNKNOWN )
247   PORT_BIT( 0x4000, IP_ACTIVE_HIGH, IPT_UNKNOWN )
248   PORT_BIT( 0x8000, IP_ACTIVE_HIGH, IPT_UNKNOWN )
249249INPUT_PORTS_END
250250
251251
src/mame/drivers/cherrym.c
r1679r1680
8989         int flipy = attr & 0x20;
9090
9191         drawgfx(bitmap, machine->gfx[1], code, color, flipx, flipy, sx, sy,
92            cliprect, TRANSPARENCY_COLOR, 0);
92            cliprect, TRANSPARENCY_PEN, 0);
9393      }
9494   }
9595}
r1679r1680
9898static VIDEO_START(cm)
9999{
100100   bg_tilemap = tilemap_create(get_bg_tile_info, tilemap_scan_rows,
101      TILEMAP_TYPE_PEN, 8, 8, 64, 32);
101      8, 8, 64, 32);
102102}
103103
104104static VIDEO_UPDATE(cm)
src/mame/drivers/exerion.c
r1679r1680
291291   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
292292   MDRV_SCREEN_RAW_PARAMS(EXERION_PIXEL_CLOCK, EXERION_HTOTAL, EXERION_HBEND, EXERION_HBSTART, EXERION_VTOTAL, EXERION_VBEND, EXERION_VBSTART)
293293   MDRV_GFXDECODE(exerion)
294   MDRV_PALETTE_LENGTH(32)
295   MDRV_COLORTABLE_LENGTH(256*3)
294   MDRV_PALETTE_LENGTH(256*3)
296295
297296   MDRV_PALETTE_INIT(exerion)
298297   MDRV_VIDEO_START(exerion)
src/mame/drivers/ltcasino.c
r1679r1680
3636
3737static VIDEO_START(ltcasino)
3838{
39   ltcasino_tilemap = tilemap_create(get_ltcasino_tile_info,tilemap_scan_rows,TILEMAP_TYPE_PEN, 8, 8,64,32);
39   ltcasino_tilemap = tilemap_create(get_ltcasino_tile_info,tilemap_scan_rows,8, 8,64,32);
4040}
4141
4242
src/mame/drivers/royalmah.c
r1679r1680
24372437   PORT_DIPNAME( 0x02, 0x02, "Unknown 3-1" )
24382438   PORT_DIPSETTING(    0x02, DEF_STR( Off ) )
24392439   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
2440   PORT_DIPNAME( 0x04, 0x04, "Unknown 3-2" )
2440   PORT_DIPNAME( 0x04, 0x04, "F-Rate" )
24412441   PORT_DIPSETTING(    0x04, DEF_STR( Off ) )
24422442   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
24432443   PORT_DIPNAME( 0x08, 0x08, "Unknown 3-3" )
24442444   PORT_DIPSETTING(    0x08, DEF_STR( Off ) )
24452445   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
2446   PORT_DIPNAME( 0x10, 0x10, "Unknown 3-4" )
2446   PORT_DIPNAME( 0x10, 0x10, "Bye-Byte Bonus" )
24472447   PORT_DIPSETTING(    0x10, DEF_STR( Off ) )
24482448   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
24492449   PORT_DIPNAME( 0x20, 0x20, "Unknown 3-5" )
24502450   PORT_DIPSETTING(    0x20, DEF_STR( Off ) )
24512451   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
2452   PORT_DIPNAME( 0x40, 0x40, "Unknown 3-6" )
2452   PORT_DIPNAME( 0x40, 0x40, "Auto-Mode After Reached" )
24532453   PORT_DIPSETTING(    0x40, DEF_STR( Off ) )
24542454   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
2455   PORT_DIPNAME( 0x80, 0x80, "Unknown 3-7" )
2456   PORT_DIPSETTING(    0x80, DEF_STR( Off ) )
2457   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
2455   PORT_DIPNAME( 0x80, 0x80, "Background Color" )
2456   PORT_DIPSETTING(    0x80, "Black" )
2457   PORT_DIPSETTING(    0x00, "Blue" )
24582458
24592459   PORT_START   // IN14 - DSW4 ($8000)
24602460   PORT_DIPNAME( 0x01, 0x01, "Unknown 4-0" )
r1679r1680
24662466   PORT_DIPNAME( 0x04, 0x04, "Unknown 4-2" )
24672467   PORT_DIPSETTING(    0x04, DEF_STR( Off ) )
24682468   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
2469   PORT_DIPNAME( 0x08, 0x08, "Unknown 4-3" )
2470   PORT_DIPSETTING(    0x08, "129" )
2471   PORT_DIPSETTING(    0x00, "212" )
2469   PORT_DIPNAME( 0x08, 0x08, "Flip-Flop" )
2470   PORT_DIPSETTING(    0x08, DEF_STR( Off ) )
2471   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
24722472   PORT_DIPNAME( 0x10, 0x10, DEF_STR( Demo_Sounds ) )
24732473   PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
24742474   PORT_DIPSETTING(    0x10, DEF_STR( On ) )
24752475   PORT_DIPNAME( 0x20, 0x20, DEF_STR( Flip_Screen ) )
24762476   PORT_DIPSETTING(    0x20, DEF_STR( Off ) )
24772477   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
2478   PORT_DIPNAME( 0x40, 0x40, "Unknown 4-6" )
2478   PORT_DIPNAME( 0x40, 0x40, "Animation" )
24792479   PORT_DIPSETTING(    0x40, DEF_STR( Off ) )
24802480   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
24812481   PORT_DIPNAME( 0x80, 0x80, "Full Tests" )
src/mame/drivers/subs.c
r1679r1680
122122   PORT_BIT ( 0x08, IP_ACTIVE_LOW, IPT_START1 )
123123   PORT_BIT ( 0x10, IP_ACTIVE_LOW, IPT_VBLANK )
124124   PORT_BIT ( 0x20, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(2)
125   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_SERVICE ) PORT_NAME("Self Test") PORT_CODE(KEYCODE_F2) PORT_TOGGLE
125   PORT_SERVICE_NO_TOGGLE( 0x40, IP_ACTIVE_LOW )
126126   PORT_BIT ( 0x80, IP_ACTIVE_LOW, IPT_BUTTON1 )
127127
128128   PORT_START      /* IN3 */
src/mame/drivers/darkmist.c
r1679r1680
2828#include "audio/t5182.h"
2929
3030
31READ8_HANDLER(darkmist_palette_r);
32WRITE8_HANDLER(darkmist_palette_w);
33WRITE8_HANDLER(darkmist_spritebank_w);
3431VIDEO_START(darkmist);
3532VIDEO_UPDATE(darkmist);
3633PALETTE_INIT(darkmist);
3734
38UINT8 * darkmist_scroll;
35extern UINT8 *darkmist_scroll;
36extern UINT8 *darkmist_spritebank;
3937static UINT8 * darkmist_workram;
4038
4139int darkmist_hw;
r1679r1680
6664   AM_RANGE(0xc802, 0xc802) AM_READ(input_port_1_r)
6765   AM_RANGE(0xc803, 0xc803) AM_READ(input_port_2_r)
6866   AM_RANGE(0xc804, 0xc804) AM_WRITE(darkmist_hw_w)
69   AM_RANGE(0xc805, 0xc805) AM_WRITE(darkmist_spritebank_w)
67   AM_RANGE(0xc805, 0xc805) AM_WRITE(MWA8_RAM) AM_BASE(&darkmist_spritebank)
7068   AM_RANGE(0xc806, 0xc806) AM_READ(input_port_3_r)
7169   AM_RANGE(0xc807, 0xc807) AM_READ(input_port_4_r)
7270   AM_RANGE(0xc808, 0xc808) AM_READ(input_port_5_r)
73   AM_RANGE(0xd000, 0xd3ff) AM_WRITE(darkmist_palette_w) AM_READ(darkmist_palette_r) AM_BASE(&paletteram)
71   AM_RANGE(0xd000, 0xd3ff) AM_RAM AM_BASE(&paletteram)
7472   AM_RANGE(0xd400, 0xd41f) AM_RAM AM_BASE(&darkmist_scroll)
7573   AM_RANGE(0xd600, 0xd67f) AM_READWRITE(t5182shared_r, t5182shared_w)
7674   AM_RANGE(0xd680, 0xd680) AM_WRITE(t5182_sound_irq_w)
r1679r1680
266264   MDRV_SCREEN_SIZE(256, 256)
267265   MDRV_SCREEN_VISIBLE_AREA(0, 256-1, 16, 256-16-1)
268266   MDRV_GFXDECODE(darkmist)
269   MDRV_PALETTE_LENGTH(0x100+1)
270267   MDRV_PALETTE_INIT(darkmist)
271   MDRV_COLORTABLE_LENGTH(0x100*4)
268   MDRV_PALETTE_LENGTH(0x100*4)
272269   MDRV_VIDEO_START(darkmist)
273270   MDRV_VIDEO_UPDATE(darkmist)
274271
src/mame/drivers/exctsccr.c
r1679r1680
364364};
365365
366366static GFXDECODE_START( exctsccr )
367   GFXDECODE_ENTRY( REGION_GFX1, 0x0000, charlayout1,      0, 32 ) /* chars */
368   GFXDECODE_ENTRY( REGION_GFX1, 0x2000, charlayout2,      0, 32 ) /* chars */
367   GFXDECODE_ENTRY( REGION_GFX1, 0x0000, charlayout1,      0, 16 ) /* chars */
368   GFXDECODE_ENTRY( REGION_GFX1, 0x2000, charlayout2,      0, 16 ) /* chars */
369369   GFXDECODE_ENTRY( REGION_GFX1, 0x1000, spritelayout1, 16*8, 32 ) /* sprites */
370370   GFXDECODE_ENTRY( REGION_GFX1, 0x3000, spritelayout2, 16*8, 32 ) /* sprites */
371371   GFXDECODE_ENTRY( REGION_GFX2, 0x0000, spritelayout,  16*8, 32 ) /* sprites */
r1679r1680
406406   MDRV_SCREEN_SIZE(32*8, 32*8)
407407   MDRV_SCREEN_VISIBLE_AREA(0*8, 32*8-1, 2*8, 30*8-1)
408408   MDRV_GFXDECODE(exctsccr)
409   MDRV_PALETTE_LENGTH(32)
410   MDRV_COLORTABLE_LENGTH(64*8)
409   MDRV_PALETTE_LENGTH(48*8)
411410
412411   MDRV_PALETTE_INIT(exctsccr)
413412   MDRV_VIDEO_START(exctsccr)
r1679r1680
455454   MDRV_SCREEN_SIZE(32*8, 32*8)
456455   MDRV_SCREEN_VISIBLE_AREA(0*8, 32*8-1, 2*8, 30*8-1)
457456   MDRV_GFXDECODE(exctsccr)
458   MDRV_PALETTE_LENGTH(32)
459   MDRV_COLORTABLE_LENGTH(64*8)
457   MDRV_PALETTE_LENGTH(48*8)
460458
461459   MDRV_PALETTE_INIT(exctsccr)
462460   MDRV_VIDEO_START(exctsccr)
src/mame/drivers/nmk16.c
r1679r1680
259259
260260static MACHINE_RESET( nmk16 )
261261{
262   NMK112_init(0);
262263}
263264
264265static MACHINE_RESET( NMK004 )
src/mame/drivers/miniboy7.c
r1679r1680
124124#define MASTER_CLOCK   10000000   /* 10MHz */
125125
126126#include "driver.h"
127#include "video/crtc6845.h"
127#include "video/mc6845.h"
128128
129129
130130/*************************
131131*     Video Hardware     *
132132*************************/
133133
134static mc6845_t *mc6845;
134135static tilemap *bg_tilemap;
135136
136137static WRITE8_HANDLER( miniboy7_videoram_w )
r1679r1680
145146   tilemap_mark_tile_dirty(bg_tilemap, offset);
146147}
147148
149static WRITE8_HANDLER( miniboy7_mc6845_address_w )
150{
151   mc6845_address_w(mc6845, data);
152}
153
154static READ8_HANDLER( miniboy7_mc6845_register_r )
155{
156   return mc6845_register_r(mc6845);
157}
158
159static WRITE8_HANDLER( miniboy7_mc6845_register_w )
160{
161   mc6845_register_w(mc6845, data);
162}
163
148164static TILE_GET_INFO( get_bg_tile_info )
149165{
150166/*  - bits -
r1679r1680
166182
167183static VIDEO_START( miniboy7 )
168184{
169   bg_tilemap = tilemap_create(get_bg_tile_info, tilemap_scan_rows,
170      TILEMAP_TYPE_PEN, 8, 8, 37, 37);
185   mc6845 = mc6845_config(NULL);
186   bg_tilemap = tilemap_create(get_bg_tile_info, tilemap_scan_rows, 8, 8, 37, 37);
171187}
172188
173189static VIDEO_UPDATE( miniboy7 )
r1679r1680
187203   AM_RANGE(0x1000, 0x17ff) AM_RAM AM_WRITE(miniboy7_colorram_w) AM_BASE(&colorram)
188204   AM_RANGE(0x1800, 0x25ff) AM_RAM   /* looks like videoram */
189205   AM_RANGE(0x2600, 0x27ff) AM_RAM
190   AM_RANGE(0x2800, 0x2800) AM_WRITE(crtc6845_address_w)
191   AM_RANGE(0x2801, 0x2801) AM_READWRITE(crtc6845_register_r, crtc6845_register_w)
206   AM_RANGE(0x2800, 0x2800) AM_WRITE(miniboy7_mc6845_address_w)
207   AM_RANGE(0x2801, 0x2801) AM_READWRITE(miniboy7_mc6845_register_r, miniboy7_mc6845_register_w)
192208//  AM_RANGE(0x3000, 0x3001) ????? R/W
193209//  AM_RANGE(0x3080, 0x3083) AM_READWRITE(pia_0_r, pia_0_w)
194210//  AM_RANGE(0x3800, 0x3800) ????? R
src/mame/drivers/m10.c
r0r1680
1/***************************************************************************
2
3    Irem M10/M11/M15 hardware
4
5****************************************************************************
6
7  (c) 12/2/1998 Lee Taylor
8
9Notes:
10- Colors are close to screen shots for IPM Invader. The other games have not
11  been verified.
12- The bitmap strips in IPM Invader might be slightly misplaced
13
14TODO:
15- Dip switches
16
17Head On
18-------
19Irem, 1979? / 1980?
20
21PCB Layout
22----------
23
24    M-15L
25   |---------------------------------------------------------------------------------|
26   |                                                                                 |
27   | DSW(8)  74175   74175   7400  74LS08   74121   M53214     |-------|      E1.9A  |
28   |                                                           | 6502  |             |
29   |          7432   74175   7404    7427    7442  74LS241     |-------|             |
30   |                                                                          E2.9B  |
31   |                                                                                 |
32   |        74LS74    7432  74161   74161    7442  74LS241  74LS367  74LS367         |
33 |-|                                                                          E3.9C  |
34 |          M53214 74LS367   7442    7486    8216     2114  74LS157  74LS367         |
35 |                                                                                   |
36 |4         M53214 74LS367  74161    7486    8216     2114  74LS157     2111  E4.9D  |
37 |4                                                                                  |
38 |W         M53214 74LS367  74161    7486    8216     2114  74LS157     2111         |
39 |A                                                                           E5.9F  |
40 |Y         M53214 74LS367  74161    7486    8216    74166     2114  74LS157         |
41 |                         11.73MHz                                                  |
42 |            7400    7432  7404    74161    8216    74166     2114  74LS157  E6.9G  |
43 |-|                                                                                 |
44   |   VR3 VR2 VR1    7432  7404     7400  *74173     7400  74LS139  74LS157         |
45   |                                       *74S04                                    |
46   |                                                                                 |
47   |---------------------------------------------------------------------------------|
48Notes:
49      All IC's are listed
50      All ROMs type 2708 (1K x8)
51
52      6502 clock: 1.173MHz
53               *: These 2 IC's piggybacked. 74S04 on top
54         VR1/2/3: 5K potentiometers
55            2114: 1K x4 SRAM
56            2111: 256bytes x4 SRAM
57            8216: 256bytes x1 SRAM
58
59Sound PCB
60---------
61
62M-15S
63|---------------------------|
64|                           |
65|  NE555  NE555             |
66|                           |
67|  NE555  NE555             |
68|               LM3900   VR1|
69|                           |
70|  c1815x9               VR2|
71|                           |
72|               LM3900   VR3|
73|                           |
74|                        VR4|
75|                           |
76|                        VR5|
77|    TA7222                 |
78|---------------------------|
79Notes:
80      PCB contains lots of resistors, capacitors, transistors etc.
81
82      VR1/2/3/4/5: Potentiometers for volume of each sound
83            C1815: Transistor (x9)
84           TA7222: Power Amp
85
86***************************************************************************/
87
88/***************************************************************************
89Notes (couriersud)
90
91    From http://www.crazykong.com/tech/IremBoardList.txt
92
93    skychut:        M-11
94    andromed:       N/A
95    ipminvad:       N/A
96    spacbeam:       not listed
97    headon:         not listed
98    greenber:       N/A
99
100    M10-Board: Has SN76477
101
102***************************************************************************/
103#include "driver.h"
104#include "deprecat.h"
105#include "sound/samples.h"
106#include "m10.h"
107
108
109/*************************************
110 *
111 *  Defines
112 *
113 *************************************/
114
115#define DEBUG      (0)
116
117/*************************************
118 *
119 *  Initialization
120 *
121 *************************************/
122
123static PALETTE_INIT( m10 )
124{
125   int i;
126
127   for (i = 0; i < 0x10; i++)
128   {
129      rgb_t color;
130
131      if (i & 0x01)
132         color = MAKE_RGB(pal1bit(~i >> 3), pal1bit(~i >> 2), pal1bit(~i >> 1));
133      else
134         color = RGB_BLACK;
135
136      palette_set_color(machine, i, color);
137   }
138}
139
140static MACHINE_RESET( irem )
141{
142   m10_state *state = Machine->driver_data;
143
144   state_save_register_global(state->bottomline);
145   state_save_register_global(state->flip);
146}
147
148/*************************************
149 *
150 *  I/O handling
151 *
152 *************************************/
153
154/*
155 * M10 Ctrl Port
156 *
157 * 76543210
158 * ========
159 * e-------     ACTIVE LOW  Demo mode
160 * -?------     ????
161 * --b-----     ACTIVE LOW  Bottom line
162 * ---f----     ACTIVE LOW  Flip screen
163 * ----u---     ACTIVE LOW  Ufo sound enable (SN76477)
164 * -----sss     Sound #sss start
165 *              0x01: MISSILE
166 *              0x02: EXPLOSION
167 *              0x03: INVADER HIT
168 *              0x04: BONUS BASE
169 *              0x05: FLEET MOVE
170 *              0x06: SAUCER HIT
171 */
172
173static WRITE8_HANDLER( m10_ctrl_w )
174{
175   m10_state *state = Machine->driver_data;
176
177#if DEBUG
178   if (data & 0x40)
179      popmessage("ctrl: %02x",data);
180#endif
181
182   /* I have NO IDEA if this is correct or not */
183   state->bottomline = ~data & 0x20;
184
185   if (readinputportbytag("CAB") & 0x01)
186      state->flip = ~data & 0x10;
187
188   if (!(readinputportbytag("CAB") & 0x02))
189      sound_global_enable(~data & 0x80);
190
191   /* sound command in lower 4 bytes */
192   switch (data & 0x07)
193   {
194      case 0x00:
195         /* no sound mapped */
196         break;
197      case 0x01:
198         /* MISSILE sound */
199         sample_start_n(0, 0, 0, 0);
200         break;
201      case 0x02:
202         /* EXPLOSION sound */
203         sample_start_n(0, 1, 1, 0);
204         break;
205      case 0x03:
206         /* INVADER HIT sound */
207         sample_start_n(0, 2, 2, 0);
208         break;
209      case 0x04:
210         /* BONUS BASE sound */
211         sample_start_n(0, 3, 8, 0);
212         break;
213      case 0x05:
214         /* FLEET MOVE sound */
215         sample_start_n(0, 3, 3, 0);
216         break;
217      case 0x06:
218         /* SAUCER HIT SOUND */
219         sample_start_n(0, 2, 7, 0);
220         break;
221      default:
222         popmessage("Unknown sound M10: %02x\n", data & 0x07);
223         break;
224   }
225   /* UFO SOUND */
226   if (data & 0x08)
227      sample_stop_n(0, 4);
228   else
229      sample_start_n(0, 4, 9, 1);
230
231}
232
233/*
234 * M11 Ctrl Port
235 *
236 * 76543210
237 * ========
238 * e-------     ACTIVE LOW  Demo mode
239 * -?------     ????
240 * --b-----     ACTIVE LOW  Bottom line
241 * ---f----     ACTIVE LOW  Flip screen
242 * ----??--     ????
243 * ------cc     Credits indicator ?
244 *              0x03: 0 Credits
245 *              0x02: 1 Credit
246 *              0x00: 2 or more credits
247 *              Will be updated only in attract mode
248 */
249
250static WRITE8_HANDLER( m11_ctrl_w )
251{
252   m10_state *state = Machine->driver_data;
253
254#if DEBUG
255   if (data & 0x4C)
256      popmessage("M11 ctrl: %02x",data);
257#endif
258
259   state->bottomline = ~data & 0x20;
260
261   if (readinputportbytag("CAB") & 0x01)
262      state->flip = ~data & 0x10;
263
264   if (!(readinputportbytag("CAB") & 0x02))
265      sound_global_enable(~data & 0x80);
266}
267
268/*
269 * M15 Ctrl Port
270 *
271 * 76543210
272 * ========
273 * ????----     ????
274 * ----e---     ACTIVE LOW  Demo mode
275 * -----f--     ACTIVE LOW  Flip screen
276 * ------cc     Credits indicator ?
277 *              0x03: 0 Credits
278 *              0x02: 1 Credit
279 *              0x00: 2 or more credits
280 *              Will be updated only in attract mode
281 */
282
283static WRITE8_HANDLER( m15_ctrl_w )
284{
285   m10_state *state = Machine->driver_data;
286
287#if DEBUG
288   if (data & 0xF0)
289      popmessage("M15 ctrl: %02x",data);
290#endif
291   if (readinputportbytag("CAB") & 0x01)
292      state->flip = ~data & 0x04;
293   if (!(readinputportbytag("CAB") & 0x02))
294      sound_global_enable(~data & 0x08);
295}
296
297
298/*
299 * M10 A500
300 *
301 * 76543210
302 * ========
303 * ??????--     Always 111111
304 * ------cc     Credits indicator ?
305 *              0x03: 0 Credits
306 *              0x02: 1 Credit
307 *              0x00: 2 or more credits
308 *              Will be updated only in attract mode
309 */
310
311static WRITE8_HANDLER( m10_a500_w )
312{
313#if DEBUG
314   if (data & 0xFC)
315      popmessage("a500: %02x",data);
316#endif
317}
318
319static WRITE8_HANDLER( m11_a100_w )
320{
321   static int last = 0x00;
322   int raising_bits = data & ~last;
323   //int falling_bits = ~data & last;
324
325   // should a falling bit stop a sample?
326   // This port is written to about 20x per vblank
327#if DEBUG
328   if ((last & 0xE8) != (data & 0xE8))
329      popmessage("A100: %02x\n", data);
330#endif
331   last = data;
332   // audio control!
333   /* MISSILE sound */
334   if (raising_bits & 0x01)
335      sample_start_n(0, 0, 0, 0);
336
337   /* EXPLOSION sound */
338   if (raising_bits & 0x02)
339      sample_start_n(0, 1, 1, 0);
340
341   /* Rapidly falling parachute */
342   if (raising_bits & 0x04)
343      sample_start_n(0, 3, 8, 0);
344
345   /* Background sound ? */
346   if (data & 0x10)
347      sample_start_n(0, 4, 9, 1);
348   else
349      sample_stop_n(0, 4);
350
351}
352
353static WRITE8_HANDLER( m15_a100_w )
354{
355   static int last = 0x00;
356   //int raising_bits = data & ~last;
357   int falling_bits = ~data & last;
358
359   // should a falling bit stop a sample?
360   // Bit 4 is used
361   // Bit 5 is used 0xef
362   // Bit 7 is used
363
364   // headoni
365   // 0x01: Acceleration
366   // 0x04: background (motor) ?
367   // 0x08: explosion
368   // 0x10: player changes lane
369   // 0x20: computer car changes lane
370   // 0x40: dot
371
372#if DEBUG
373   if ((last & 0x82) != (data & 0x82))
374      popmessage("A100: %02x\n", data);
375#endif
376   /* DOT sound */
377   if (falling_bits & 0x40)
378      sample_start_n(0, 0, 0, 0);
379#if 0
380   if (raising_bits & 0x40)
381      sample_stop_n(0, 0);
382#endif
383
384   /* EXPLOSION sound */
385   if (falling_bits & 0x08)
386      sample_start_n(0, 1, 1, 0);
387#if 0
388   if (raising_bits & 0x08)
389      sample_stop_n(0, 1);
390#endif
391
392   /* player changes lane */
393   if (falling_bits & 0x10)
394      sample_start_n(0, 3, 3, 0);
395#if 0
396   if (raising_bits & 0x10)
397      sample_stop_n(0, 3);
398#endif
399
400   /* computer car changes lane */
401   if (falling_bits & 0x20)
402      sample_start_n(0, 4, 4, 0);
403#if 0
404   if (raising_bits & 0x20)
405      sample_stop_n(0, 4);
406#endif
407
408   last = data;
409}
410
411static READ8_HANDLER( m10_a700_r )
412{
413      //printf("rd:%d\n",video_screen_get_vpos(0));
414   cpunum_set_input_line(Machine, 0, 0, CLEAR_LINE);
415   return 0x00;
416}
417
418static READ8_HANDLER( m11_a700_r )
419{
420      //printf("rd:%d\n",video_screen_get_vpos(0));
421   return 0x00;
422}
423
424/*************************************
425 *
426 *  Interrupt handling
427 *
428 *************************************/
429
430static TIMER_CALLBACK( interrupt_callback )
431{
432    if (param==0)
433    {
434       cpunum_set_input_line(machine, 0, 0, ASSERT_LINE);
435       timer_set(video_screen_get_time_until_pos(0, IREMM10_VBSTART+16, 0), NULL, 1,interrupt_callback);
436    }
437    if (param==1)
438    {
439       cpunum_set_input_line(machine, 0, 0, ASSERT_LINE);
440       timer_set(video_screen_get_time_until_pos(0, IREMM10_VBSTART+24, 0), NULL, 2,interrupt_callback);
441    }
442    if (param==-1)
443       cpunum_set_input_line(machine, 0, 0, CLEAR_LINE);
444
445}
446
447static INTERRUPT_GEN( m11_interrupt )
448{
449   if (readinputport(2) & 1)   /* Left Coin */
450        cpunum_set_input_line(machine, 0, INPUT_LINE_NMI, PULSE_LINE);
451    else
452    {
453       cpunum_set_input_line(machine, 0, 0, ASSERT_LINE);
454       timer_set(video_screen_get_time_until_pos(0, IREMM10_VBEND, 0), NULL, -1,interrupt_callback);
455    }
456}
457
458static INTERRUPT_GEN( m10_interrupt )
459{
460   if (readinputport(2) & 1)   /* Left Coin */
461        cpunum_set_input_line(machine, 0, INPUT_LINE_NMI, PULSE_LINE);
462    else
463      cpunum_set_input_line(machine, 0, 0, ASSERT_LINE);
464}
465
466static INTERRUPT_GEN( m15_interrupt )
467{
468   if (readinputport(2) & 1)   /* Left Coin */
469        cpunum_set_input_line(machine, 0, INPUT_LINE_NMI, PULSE_LINE);
470    else
471    {
472      cpunum_set_input_line(machine, 0, 0, ASSERT_LINE);
473       timer_set(video_screen_get_time_until_pos(0, IREMM10_VBSTART+1, 80), NULL, -1,interrupt_callback);
474    }
475}
476
477/*************************************
478 *
479 *  Main CPU memory handlers
480 *
481 *************************************/
482
483static ADDRESS_MAP_START( m10_main, ADDRESS_SPACE_PROGRAM, 8 )
484   AM_RANGE(0x0000, 0x02ff) AM_RAM AM_BASE_MEMBER(m10_state, memory) /* scratch ram */
485   AM_RANGE(0x1000, 0x2fff) AM_READ(MRA8_ROM) AM_BASE_MEMBER(m10_state, rom)
486   AM_RANGE(0x4000, 0x43ff) AM_RAM AM_BASE(&videoram) AM_SIZE(&videoram_size)
487   AM_RANGE(0x4800, 0x4bff) AM_READWRITE(MRA8_RAM, m10_colorram_w) AM_BASE(&colorram) /* foreground colour  */
488   AM_RANGE(0x5000, 0x53ff) AM_RAM AM_BASE_MEMBER(m10_state, chargen) /* background ????? */
489   AM_RANGE(0xa200, 0xa200) AM_READ(input_port_1_r)
490   AM_RANGE(0xa300, 0xa300) AM_READ(input_port_0_r)
491   AM_RANGE(0xa400, 0xa400) AM_WRITE(m10_ctrl_w)   /* line at bottom of screen?, sound, flip screen */
492   AM_RANGE(0xa500, 0xa500) AM_WRITE(m10_a500_w)   /* ??? */
493   AM_RANGE(0xa700, 0xa700) AM_READ(m10_a700_r)
494   AM_RANGE(0xfc00, 0xffff) AM_READ(MRA8_ROM)   /* for the reset / interrupt vectors */
495ADDRESS_MAP_END
496
497static ADDRESS_MAP_START( m11_main, ADDRESS_SPACE_PROGRAM, 8 )
498   AM_RANGE(0x0000, 0x02ff) AM_RAM AM_BASE_MEMBER(m10_state, memory) /* scratch ram */
499   AM_RANGE(0x1000, 0x2fff) AM_READ(MRA8_ROM) AM_BASE_MEMBER(m10_state, rom)
500   AM_RANGE(0x4000, 0x43ff) AM_RAM AM_BASE(&videoram) AM_SIZE(&videoram_size)
501   AM_RANGE(0x4800, 0x4bff) AM_READWRITE(MRA8_RAM, m10_colorram_w) AM_BASE(&colorram) /* foreground colour  */
502   AM_RANGE(0x5000, 0x53ff) AM_RAM AM_BASE_MEMBER(m10_state, chargen) /* background ????? */
503   AM_RANGE(0xa100, 0xa100) AM_WRITE(m11_a100_w) /* sound writes ???? */
504   AM_RANGE(0xa200, 0xa200) AM_READ(input_port_1_r)
505   AM_RANGE(0xa300, 0xa300) AM_READ(input_port_0_r)
506   AM_RANGE(0xa400, 0xa400) AM_WRITE(m11_ctrl_w)   /* line at bottom of screen?, sound, flip screen */
507   AM_RANGE(0xa700, 0xa700) AM_READ(m11_a700_r)
508   AM_RANGE(0xfc00, 0xffff) AM_READ(MRA8_ROM)   /* for the reset / interrupt vectors */
509ADDRESS_MAP_END
510
511static ADDRESS_MAP_START( m15_main, ADDRESS_SPACE_PROGRAM, 8 )
512   AM_RANGE(0x0000, 0x02ff) AM_RAM AM_BASE_MEMBER(m10_state, memory) /* scratch ram */
513   AM_RANGE(0x1000, 0x33ff) AM_READ(MRA8_ROM) AM_BASE_MEMBER(m10_state, rom)
514   AM_RANGE(0x4000, 0x43ff) AM_RAM AM_BASE(&videoram) AM_SIZE(&videoram_size)
515   AM_RANGE(0x4800, 0x4bff) AM_READWRITE(MRA8_RAM, m10_colorram_w) AM_BASE(&colorram) /* foreground colour  */
516   AM_RANGE(0x5000, 0x57ff) AM_READWRITE(MRA8_RAM, m15_chargen_w) AM_BASE_MEMBER(m10_state, chargen) /* background ????? */
517   AM_RANGE(0xa000, 0xa000) AM_READ(input_port_3_r)
518   AM_RANGE(0xa100, 0xa100) AM_WRITE(m15_a100_w) /* sound writes ???? */
519   AM_RANGE(0xa200, 0xa200) AM_READ(input_port_1_r)
520   AM_RANGE(0xa300, 0xa300) AM_READ(input_port_0_r)
521   AM_RANGE(0xa400, 0xa400) AM_WRITE(m15_ctrl_w)   /* sound, flip screen */
522   AM_RANGE(0xfc00, 0xffff) AM_READ(MRA8_ROM)   /* for the reset / interrupt vectors */
523ADDRESS_MAP_END
524
525/*************************************
526 *
527 *  Port definitions
528 *
529 *************************************/
530
531#define CAB_PORTENV \
532   /* fake port for cabinet type */               \
533   PORT_START_TAG("CAB")                        \
534   PORT_CONFNAME( 0x01, 0x00, DEF_STR( Cabinet ) )      \
535   PORT_CONFSETTING(    0x00, DEF_STR( Upright ) )      \
536   PORT_CONFSETTING(    0x01, DEF_STR( Cocktail ) )   \
537   PORT_CONFNAME( 0x02, 0x00, DEF_STR( Demo_Sounds ) )      \
538   PORT_CONFSETTING(    0x00, DEF_STR( Off ) )      \
539   PORT_CONFSETTING(    0x02, DEF_STR( On ) )   \
540   PORT_BIT( 0xfc, IP_ACTIVE_HIGH, IPT_UNUSED )
541
542
543static INPUT_PORTS_START( skychut )
544   PORT_START
545   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_START1 )
546   PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_START2 )
547   PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_BUTTON1 )
548   PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_BUTTON1) PORT_COCKTAIL
549   PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_JOYSTICK_RIGHT )
550   PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_JOYSTICK_LEFT )
551   PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_JOYSTICK_RIGHT ) PORT_COCKTAIL
552   PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_JOYSTICK_LEFT ) PORT_COCKTAIL
553
554   PORT_START   /* IN1 */
555   PORT_DIPNAME(0x03, 0x00, DEF_STR( Lives ) )
556   PORT_DIPSETTING (  0x00, "3" )
557   PORT_DIPSETTING (  0x01, "4" )
558   PORT_DIPSETTING (  0x02, "5" )
559   PORT_DIPNAME( 0x04, 0x00, "Unknown 1" )
560   PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
561   PORT_DIPSETTING(    0x04, DEF_STR( On ) )
562   PORT_DIPNAME( 0x08, 0x00, "Unknown 2" )
563   PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
564   PORT_DIPSETTING(    0x08, DEF_STR( On ) )
565   PORT_DIPNAME( 0x10, 0x00, "Unknown 3" )
566   PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
567   PORT_DIPSETTING(    0x10, DEF_STR( On ) )
568   PORT_DIPNAME( 0x20, 0x00, "Unknown 4" )
569   PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
570   PORT_DIPSETTING(    0x20, DEF_STR( On ) )
571   PORT_DIPNAME( 0x40, 0x00, "Unknown 5" )
572   PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
573   PORT_DIPSETTING(    0x40, DEF_STR( On ) )
574   PORT_DIPNAME( 0x80, 0x00, "Unknown 6" )
575   PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
576   PORT_DIPSETTING(    0x80, DEF_STR( On ) )
577
578   PORT_START   /* FAKE */
579   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_COIN1 ) PORT_IMPULSE(1)
580
581   CAB_PORTENV
582INPUT_PORTS_END
583
584static INPUT_PORTS_START( ipminvad )
585   PORT_START
586   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_START1 )
587   PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_START2 )
588   PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_BUTTON1 )
589   PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_BUTTON1) PORT_COCKTAIL
590   PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_JOYSTICK_RIGHT )
591   PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_JOYSTICK_LEFT )
592   PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_JOYSTICK_RIGHT ) PORT_COCKTAIL
593   PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_JOYSTICK_LEFT ) PORT_COCKTAIL
594
595   PORT_START   /* IN1 */
596   PORT_DIPNAME(0x03, 0x00, DEF_STR( Lives ) )
597   PORT_DIPSETTING (  0x00, "3" )
598   PORT_DIPSETTING (  0x01, "4" )
599   PORT_DIPSETTING (  0x02, "5" )
600   PORT_DIPNAME( 0x04, 0x00, "Capsules" )
601   PORT_DIPSETTING(    0x00, DEF_STR( No ) )
602   PORT_DIPSETTING(    0x04, DEF_STR( Yes ) )
603   PORT_DIPNAME( 0x08, 0x00, DEF_STR( Bonus_Life ) )
604   PORT_DIPSETTING(    0x00, "1500" )
605   PORT_DIPSETTING(    0x08, "1000" )
606   PORT_DIPNAME( 0x10, 0x00, DEF_STR( Coin_A ) )
607   PORT_DIPSETTING(    0x10, DEF_STR( 2C_1C ) )
608   PORT_DIPSETTING(    0x00, DEF_STR( 1C_1C ) )
609   PORT_DIPNAME( 0x20, 0x00, DEF_STR( Unused ) )  // Verified with debugger
610   PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
611   PORT_DIPSETTING(    0x20, DEF_STR( On ) )
612   PORT_DIPNAME( 0x40, 0x00, DEF_STR( Unused ) )
613   PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
614   PORT_DIPSETTING(    0x40, DEF_STR( On ) )
615   PORT_DIPNAME( 0x80, 0x00, DEF_STR( Unused ) )
616   PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
617   PORT_DIPSETTING(    0x80, DEF_STR( On ) )
618
619   PORT_START   /* FAKE */
620   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_COIN1 ) PORT_IMPULSE(1)
621
622   CAB_PORTENV
623INPUT_PORTS_END
624
625static INPUT_PORTS_START( spacbeam )
626   PORT_START
627   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_START1 )
628   PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_START2 )
629   PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_BUTTON1 )
630   PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_JOYSTICK_LEFT )
631   PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_JOYSTICK_RIGHT )
632
633   PORT_START   /* IN1 */
634   PORT_DIPNAME(0x03, 0x01, DEF_STR( Lives ) )
635   PORT_DIPSETTING (  0x00, "2" )
636   PORT_DIPSETTING (  0x01, "3" )
637   PORT_DIPSETTING (  0x02, "4" )
638   PORT_DIPSETTING (  0x03, "5" )
639   PORT_DIPNAME(0x08, 0x00, "Replay" )
640   PORT_DIPSETTING (  0x00, "30000" )
641   PORT_DIPSETTING (  0x08, DEF_STR( None ) )
642   PORT_DIPNAME(0x30, 0x10, DEF_STR( Coinage ) )
643   PORT_DIPSETTING (  0x00, "Testmode" )
644   PORT_DIPSETTING (  0x10, "1 Coin 1 Play" )
645   PORT_DIPSETTING (  0x20, "1 Coin 2 Plays" )
646
647   PORT_START   /* FAKE */
648   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_COIN1 ) PORT_IMPULSE(1)
649
650   PORT_START   /* IN3 */
651   PORT_BIT( 0x03, 0, IPT_UNUSED )
652   PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_BUTTON1 ) PORT_COCKTAIL
653   PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_JOYSTICK_LEFT ) PORT_COCKTAIL
654   PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_JOYSTICK_RIGHT ) PORT_COCKTAIL
655
656   CAB_PORTENV
657INPUT_PORTS_END
658
659static INPUT_PORTS_START( headoni )
660   PORT_START
661   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_START1 )
662   PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_START2 )
663   PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_BUTTON1 )
664   PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_JOYSTICK_UP )
665   PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_JOYSTICK_DOWN )
666   PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_JOYSTICK_LEFT )
667   PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_JOYSTICK_RIGHT )
668   PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_UNKNOWN )
669
670   PORT_START   /* IN1 */
671   PORT_DIPNAME(0x03, 0x01, DEF_STR( Lives ) )
672   PORT_DIPSETTING (  0x00, "2" )
673   PORT_DIPSETTING (  0x01, "3" )
674   PORT_DIPSETTING (  0x02, "4" )
675   PORT_DIPSETTING (  0x03, "5" )
676   PORT_DIPNAME(0x08, 0x00, "Replay" )
677   PORT_DIPSETTING (  0x00, "30000" )
678   PORT_DIPSETTING (  0x08, DEF_STR( None ) )
679   PORT_DIPNAME(0x30, 0x10, DEF_STR( Coinage ) )
680   PORT_DIPSETTING (  0x00, "Testmode" )
681   PORT_DIPSETTING (  0x10, "1 Coin 1 Play" )
682   PORT_DIPSETTING (  0x20, "1 Coin 2 Plays" )
683
684   PORT_START   /* FAKE */
685   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_COIN1 ) PORT_IMPULSE(1)
686
687   PORT_START   /* IN3 */
688   PORT_BIT( 0x03, 0, IPT_UNUSED )
689   PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_BUTTON1 ) PORT_COCKTAIL
690   PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_JOYSTICK_LEFT ) PORT_COCKTAIL
691   PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_JOYSTICK_RIGHT ) PORT_COCKTAIL
692   CAB_PORTENV
693INPUT_PORTS_END
694
695
696
697/*************************************
698 *
699 *  Graphics definitions
700 *
701 *************************************/
702
703
704static const gfx_layout charlayout =
705{
706   8,8,   /* 8*8 characters */
707   256,   /* 256 characters */
708   1,   /* 1 bits per pixel */
709   { 0 },
710   { 0, 1, 2, 3, 4, 5, 6, 7 },
711   { 0*8, 1*8, 2*8, 3*8, 4*8, 5*8, 6*8, 7*8 },
712   8*8   /* every char takes 8 consecutive bytes */
713};
714
715
716static GFXDECODE_START( m10 )
717   GFXDECODE_ENTRY( REGION_GFX1, 0x0000, charlayout, 0, 8 )
718GFXDECODE_END
719
720/*************************************
721 *
722 *  Sound definitions
723 *
724 *************************************/
725
726static const char *m10_sample_names[] =
727{
728   "*ipminvad",
729   "1.wav",      /* shot/missle */
730   "2.wav",      /* base hit/explosion */
731   "3.wav",      /* invader hit */
732   "4.wav",      /* fleet move 1 */
733   "5.wav",      /* fleet move 2 */
734   "6.wav",      /* fleet move 3 */
735   "7.wav",      /* fleet move 4 */
736   "8.wav",      /* UFO/saucer hit */
737   "9.wav",      /* bonus base */
738   "0.wav",      /* UFO sound */
739   0
740};
741
742
743static struct Samplesinterface m10_samples_interface =
744{
745   6,   /* 6 channels */
746   m10_sample_names
747};
748
749/*************************************
750 *
751 *  Machine driver
752 *
753 *************************************/
754
755static MACHINE_DRIVER_START( m10 )
756
757   MDRV_DRIVER_DATA(m10_state)
758
759   /* basic machine hardware */
760   MDRV_CPU_ADD_TAG("main", M6502,IREMM10_CPU_CLOCK)
761   MDRV_CPU_PROGRAM_MAP(m10_main,0)
762
763   MDRV_MACHINE_RESET(irem)
764
765   MDRV_CPU_VBLANK_INT(m10_interrupt,1)
766
767   MDRV_SCREEN_RAW_PARAMS(IREMM10_PIXEL_CLOCK, IREMM10_HTOTAL, IREMM10_HBEND, IREMM10_HBSTART, IREMM10_VTOTAL, IREMM10_VBEND, IREMM10_VBSTART)
768
769   /* video hardware */
770   MDRV_VIDEO_ATTRIBUTES(VIDEO_TYPE_RASTER)
771   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
772   MDRV_GFXDECODE(m10)
773   MDRV_PALETTE_LENGTH(2*8)
774
775   MDRV_PALETTE_INIT(m10)
776   MDRV_VIDEO_START(m10)
777   MDRV_VIDEO_UPDATE(m10)
778
779   /* sound hardware */
780   MDRV_SPEAKER_STANDARD_MONO("mono")
781
782   MDRV_SOUND_ADD(SAMPLES, 0)
783   MDRV_SOUND_CONFIG(m10_samples_interface)
784   MDRV_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.0)
785
786MACHINE_DRIVER_END
787
788static MACHINE_DRIVER_START( m11 )
789
790   MDRV_DRIVER_DATA(m10_state)
791
792   /* basic machine hardware */
793   MDRV_IMPORT_FROM(m10)
794   MDRV_CPU_REPLACE("main", M6502,IREMM10_CPU_CLOCK / 2)
795   //MDRV_CPU_MODIFY("main")
796   MDRV_CPU_PROGRAM_MAP(m11_main,0)
797   MDRV_CPU_VBLANK_INT(m11_interrupt,1)
798
799   /* sound hardware */
800MACHINE_DRIVER_END
801
802static MACHINE_DRIVER_START( m15 )
803
804   MDRV_DRIVER_DATA(m10_state)
805
806   /* basic machine hardware */
807   MDRV_CPU_ADD_TAG("main", M6502,IREMM15_CPU_CLOCK)
808   MDRV_CPU_PROGRAM_MAP(m15_main,0)
809
810   MDRV_MACHINE_RESET(irem)
811
812   MDRV_CPU_VBLANK_INT(m15_interrupt,1)
813
814   MDRV_SCREEN_RAW_PARAMS(IREMM15_PIXEL_CLOCK, IREMM15_HTOTAL, IREMM15_HBEND, IREMM15_HBSTART, IREMM15_VTOTAL, IREMM15_VBEND, IREMM15_VBSTART)
815
816   /* video hardware */
817   MDRV_VIDEO_ATTRIBUTES(VIDEO_TYPE_RASTER)
818   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
819   MDRV_PALETTE_LENGTH(2*8)
820
821   MDRV_PALETTE_INIT(m10)
822   MDRV_VIDEO_START( m15 )
823   MDRV_VIDEO_UPDATE(m15)
824
825   /* sound hardware */
826   MDRV_SPEAKER_STANDARD_MONO("mono")
827
828   MDRV_SOUND_ADD(SAMPLES, 0)
829   MDRV_SOUND_CONFIG(m10_samples_interface)
830   MDRV_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.0)
831
832MACHINE_DRIVER_END
833
834
835static MACHINE_DRIVER_START( headoni )
836   MDRV_IMPORT_FROM(m15)
837   MDRV_CPU_REPLACE("main", M6502,11730000/16)
838MACHINE_DRIVER_END
839
840static DRIVER_INIT( andromed )
841{
842   int i;
843   m10_state *state = machine->driver_data;
844
845   for (i=0x1c00;i<0x2000;i++)
846      state->rom[i]=0x60;
847}
848
849
850/***************************************************************************
851
852  Game driver(s)
853
854***************************************************************************/
855
856ROM_START( andromed )//Jumps to an unmapped sub-routine at $2fc9
857   ROM_REGION( 0x10000, REGION_CPU1, 0 )
858   ROM_LOAD( "am1",  0x1000, 0x0400, CRC(53df0152) SHA1(d27113740094d219b0e05a930d8daa4c22129183) )
859   ROM_LOAD( "am2",  0x1400, 0x0400, CRC(dab64957) SHA1(77ced520f8e78bb08ddab4213646cf55d834e63e) )
860   ROM_LOAD( "am3",  0x1800, 0x0400, CRC(f983f35c) SHA1(1bfee6cf7d18b56594831f2efa7dcc53b47d7e30) )
861   ROM_LOAD( "am4",  0x1c00, 0x0400, CRC(09f20717) SHA1(c54c9b7d16b40a7ab49eac255906b43b03939d2b) )
862   ROM_RELOAD(       0xfc00, 0x0400 )   /* for the reset and interrupt vectors */
863   ROM_LOAD( "am5",  0x2000, 0x0400, CRC(518a3b88) SHA1(5e20c905c2190b381a105327e112fcc0a127bb2f) )
864   ROM_LOAD( "am6",  0x2400, 0x0400, CRC(ce3d5fff) SHA1(c34178aca9ffb8b2dd468d9e3369a985f52daf9a) )
865   ROM_LOAD( "am7",  0x2800, 0x0400, CRC(30d3366f) SHA1(aa73bba194fa6d1f3909f8df517a0bff07583ea9) )
866   ROM_LOAD( "am8",  0x2c00, 0x0400, NO_DUMP ) // $60 entries
867
868   ROM_REGION( 0x0800, REGION_GFX1, ROMREGION_DISPOSE )
869   ROM_LOAD( "am9",  0x0000, 0x0400, CRC(a1c8f4db) SHA1(bedf5d7126c7e9b91ad595188c69aa2c043c71e8) )
870   ROM_LOAD( "am10", 0x0400, 0x0400, CRC(be2de8f3) SHA1(7eb3d1eb88b4481b0dcb7d001207f516a5db32b3) )
871ROM_END
872
873ROM_START( ipminvad )
874   ROM_REGION( 0x10000, REGION_CPU1, 0 )
875   ROM_LOAD( "b1r",  0x1000, 0x0400, CRC(f9a7eb9b) SHA1(93ac65d3ac725d3e4c2fb769816ee808ab609911) )
876   ROM_LOAD( "b2r",  0x1400, 0x0400, CRC(af11c1aa) SHA1(6a74fcc7cb1627b1c427a77da89b69ccf3175800) )
877   ROM_LOAD( "b3r",  0x1800, 0x0400, CRC(ed49e481) SHA1(8771a34f432e6d88acc5f7529f16c980a77485db) )
878   ROM_LOAD( "b4r",  0x1c00, 0x0400, CRC(6d5db95b) SHA1(135500fc17524e8608c3bcfe26321144aa0afb91) )
879   ROM_RELOAD(       0xfc00, 0x0400 )   /* for the reset and interrupt vectors */
880   ROM_LOAD( "b5r",  0x2000, 0x0400, CRC(eabba7aa) SHA1(75e47eacd429f48f0a3a4539e5ecb4b1ea7281b1) )
881   ROM_LOAD( "b6r",  0x2400, 0x0400, CRC(3d0e7fa6) SHA1(14903bfc9506cb8e37807fb397be79f5eab99e3b) )
882   ROM_LOAD( "b7r",  0x2800, 0x0400, CRC(cf04864f) SHA1(6fe3ce208334321b63ada779fed69ec7cf4051ad) )
883
884   ROM_REGION( 0x0800, REGION_GFX1, ROMREGION_DISPOSE )
885   ROM_LOAD( "b9r",  0x0000, 0x0400, CRC(56942cab) SHA1(ba13a856477fc6cf7fd36996e47a3724f862f888) )
886   ROM_LOAD( "b10r", 0x0400, 0x0400, CRC(be4b8585) SHA1(0154eae62585e154cf20edcf4599bda8bd333aa9) )
887ROM_END
888
889ROM_START( skychut )
890   ROM_REGION( 0x10000, REGION_CPU1, 0 )
891   ROM_LOAD( "sc1d",  0x1000, 0x0400, CRC(30b5ded1) SHA1(3a8b4fa344522404661b062808a2ea1d5858fdd0) )
892   ROM_LOAD( "sc2d",  0x1400, 0x0400, CRC(fd1f4b9e) SHA1(e5606979abe1fa4cc9eae0c4f61516769db35c39) )
893   ROM_LOAD( "sc3d",  0x1800, 0x0400, CRC(67ed201e) SHA1(589b1efdc1bbccff296f6420e2b320cd54b4ac8e) )
894   ROM_LOAD( "sc4d",  0x1c00, 0x0400, CRC(9b23a679) SHA1(a101f9b0fdde927a43e53e9b7d0dffb9dcca9e16) )
895   ROM_RELOAD(        0xfc00, 0x0400 )   /* for the reset and interrupt vectors */
896   ROM_LOAD( "sc5a",  0x2000, 0x0400, CRC(51d975e6) SHA1(7d345025ef28c8a81f599cde445eeb336c368fce) )
897   ROM_LOAD( "sc6e",  0x2400, 0x0400, CRC(617f302f) SHA1(4277ef97279eb63fc68b6c40f8545b31abaab474) )
898   ROM_LOAD( "sc7",   0x2800, 0x0400, CRC(dd4c8e1a) SHA1(b5a141d8ac256ba6522308e5f194bfaf5c75fa5b) )
899   ROM_LOAD( "sc8d",  0x2c00, 0x0400, CRC(aca8b798) SHA1(d9048d060314d8f20ab1967fee846d35c22ac693) )
900
901   ROM_REGION( 0x0800, REGION_GFX1, ROMREGION_DISPOSE )
902   ROM_LOAD( "sc9d",  0x0000, 0x0400, CRC(2101029e) SHA1(34cddf076d3d860aa03043db14837f42449aefe7) )
903   ROM_LOAD( "sc10d", 0x0400, 0x0400, CRC(2f81c70c) SHA1(504935c89a4158a067cbf1dcdb27f7421678915d) )
904ROM_END
905
906ROM_START( spacbeam )
907   ROM_REGION( 0x10000, REGION_CPU1, 0 )
908   ROM_LOAD( "m1b", 0x1000, 0x0400, CRC(5a1c3e0b) SHA1(1c9c58359d74b14ce96934fcc6acefbdfaf1e1be) )
909   ROM_LOAD( "m2b", 0x1400, 0x0400, CRC(a02bd9d7) SHA1(d25dfa66b422bdbb29b1922007c84f1947fe9be1) )
910   ROM_LOAD( "m3b", 0x1800, 0x0400, CRC(78040843) SHA1(0b8a3ab09dff951aa527649f82b8877cf01126c1) )
911   ROM_LOAD( "m4b", 0x1c00, 0x0400, CRC(74705a44) SHA1(8fa9d22a58f08086bf2d89e3d92eca097cdd2cbf) )
912   ROM_RELOAD(      0xfc00, 0x0400 )   /* for the reset and interrupt vectors */
913   ROM_LOAD( "m5b", 0x2000, 0x0400, CRC(afdf1242) SHA1(e26a8e91edb3d8ba96b3d225813760f42238b003) )
914   ROM_LOAD( "m6b", 0x2400, 0x0400, CRC(12afb0c2) SHA1(bf6ed90cf4815f0fb41d435954d4c346a55098f5) )
915ROM_END
916
917ROM_START( headoni )
918   ROM_REGION( 0x10000, REGION_CPU1, 0 )
919   ROM_LOAD( "e1.9a", 0x1000, 0x0400, CRC(05da5265) SHA1(17e0c9261978770325a0befdcdd8a1b07ed39df0) )
920   ROM_LOAD( "e2.9b", 0x1400, 0x0400, CRC(dada26a8) SHA1(1368ade1c0c57d33d15594370cf1edf95fc44fd1) )
921   ROM_LOAD( "e3.9c", 0x1800, 0x0400, CRC(61ff24f5) SHA1(0e68aedd01b765fb2af76f914b3d287ecf30f716) )
922   ROM_LOAD( "e4.9d", 0x1c00, 0x0400, CRC(ce4c5a67) SHA1(8db493d43f311a29127405aad7693bc08b570b14) )
923   ROM_RELOAD(      0xfc00, 0x0400 )   /* for the reset and interrupt vectors */
924   ROM_LOAD( "e5.9f", 0x2000, 0x0400, CRC(b5232439) SHA1(39b8fb4bbd00a73b9a2b68bc3e88fb45d3f62d7c) )
925   ROM_LOAD( "e6.9g", 0x2400, 0x0400, CRC(99acd1a6) SHA1(799382c1b079aad3034a1cc738dc06954978a0ac) )
926ROM_END
927
928ROM_START( greenber )
929   ROM_REGION( 0x10000, REGION_CPU1, 0 )
930   ROM_LOAD( "gb1", 0x1000, 0x0400, CRC(018ff672) SHA1(54d082a332831afc28b47704a5656da0a8a902fa) ) // ok
931   ROM_LOAD( "gb2", 0x1400, 0x0400, CRC(ea8f2267) SHA1(ad5bb38a80fbc7c70c8fa6f41086a7ade81655bc) ) // ok
932   ROM_LOAD( "gb3", 0x1800, 0x0400, CRC(8f337920) SHA1(ac3d76eb368645ba23f5823b39c04fae49d481e1) ) // ok
933   ROM_LOAD( "gb4", 0x1c00, 0x0400, CRC(7eeac4eb) SHA1(c668ad45ebc4aca558371539031efc4ec3990e44) ) // ok
934   ROM_RELOAD(      0xfc00, 0x0400 )   /* for the reset and interrupt vectors */
935   ROM_LOAD( "gb5", 0x2000, 0x0400, CRC(b2f8e69a) SHA1(44295e58da890a8c4aba6fe90defe9c578c95592) )
936   ROM_LOAD( "gb6", 0x2400, 0x0400, CRC(50ea8bd3) SHA1(a816c5fcc603b28c2ae59f217871a7e85fb794e1) )
937   ROM_LOAD( "gb7", 0x2800, 0x0400, NO_DUMP ) // 2be8 entry
938   ROM_LOAD( "gb8", 0x2c00, 0x0400, CRC(34700b31) SHA1(c148e2475eaaa0e9d1e2412eea359a7ba744e563) )
939   ROM_LOAD( "gb9", 0x3000, 0x0400, CRC(c27b9ba3) SHA1(a2f4f0c4b61eb03bba13ae5d25dc01009a4f86ee) ) // ok ?
940ROM_END
941
942GAME( 1979, andromed, 0, m11,     skychut,  andromed, ROT270, "Irem", "Andromeda (Japan?)", GAME_NO_COCKTAIL | GAME_NO_SOUND | GAME_IMPERFECT_COLORS | GAME_NOT_WORKING )
943GAME( 1979?,ipminvad, 0, m10,     ipminvad, 0,        ROT270, "Irem", "I P M Invader", GAME_NO_COCKTAIL | GAME_IMPERFECT_COLORS )
944GAME( 1980, skychut,  0, m11,     skychut,  0,        ROT270, "Irem", "Sky Chuter", GAME_NO_COCKTAIL | GAME_NO_SOUND | GAME_IMPERFECT_COLORS )
945GAME( 1979, spacbeam, 0, m15,     spacbeam, 0,        ROT270, "Irem", "Space Beam", GAME_NO_COCKTAIL | GAME_NO_SOUND | GAME_IMPERFECT_COLORS )
946GAME( 1979?,headoni,  0, headoni, headoni,  0,        ROT270, "Irem", "Head On (Irem, M-15 Hardware)", GAME_NO_COCKTAIL | GAME_NO_SOUND | GAME_IMPERFECT_COLORS )
947GAME( 1980, greenber, 0, m15,     spacbeam, 0,        ROT270, "Irem", "Green Beret (Irem)", GAME_NO_COCKTAIL | GAME_NO_SOUND | GAME_IMPERFECT_COLORS | GAME_NOT_WORKING )
src/osd/windows/windows.mak
r1679r1680
286286
287287
288288#-------------------------------------------------
289# rule for making the verinfo tool
290#-------------------------------------------------
291
292VERINFO = $(WINOBJ)/verinfo$(EXE)
293
294ifneq ($(CROSS_BUILD),1)
295BUILD += $(VERINFO)
296
297VERINFOOBJS = \
298   $(WINOBJ)/verinfo.o
299
300$(VERINFO): $(VERINFOOBJS) $(LIBOCORE)
301   @echo Linking $@...
302   $(LD) $(LDFLAGS) $^ $(LIBS) -o $@
303endif
304
305
306
307#-------------------------------------------------
308289# generic rule for the resource compiler
309290#-------------------------------------------------
310291
r1679r1680
320301
321302$(RESFILE): $(WINSRC)/mame.rc $(WINOBJ)/mamevers.rc
322303
323$(WINOBJ)/mamevers.rc: $(VERINFO) $(SRC)/version.c
304$(WINOBJ)/mamevers.rc: $(OBJ)/build/verinfo$(EXE) $(SRC)/version.c
324305   @echo Emitting $@...
325   @$(VERINFO) $(SRC)/version.c > $@
306   @$(OBJ)/build/verinfo$(EXE) $(SRC)/version.c > $@
src/osd/winui/mui_main.c
r1679r1680
1010  that you have read the license and understand and accept it fully.
1111
1212 ***************************************************************************/
13
13#ifndef WINUI
1414#define WINUI
15#endif
1516
1617// import the main() from MAME, but rename it so we can call it indirectly
1718#undef main
src/osd/winui/winui.mak
r1679r1680
6767
6868OBJDIRS += $(UIOBJ)
6969
70DEFS += -DWINUI
7071
71
7272#-------------------------------------------------
7373# configure the resource compiler
7474#-------------------------------------------------
r1679r1680
351351# rule for making the verinfo tool
352352#-------------------------------------------------
353353
354VERINFO = $(UIOBJ)/verinfo$(EXE)
354#VERINFO = $(UIOBJ)/verinfo$(EXE)
355355
356$(VERINFO): $(UIOBJ)/verinfo.o $(LIBOCORE)
357   @echo Linking $@...
358   $(LD) $(LDFLAGS) $^ $(LIBS) -o $@
356#$(VERINFO): $(UIOBJ)/verinfo.o $(LIBOCORE)
357#   @echo Linking $@...
358#   $(LD) $(LDFLAGS) $^ $(LIBS) -o $@
359359
360BUILD += $(VERINFO)
360#BUILD += $(VERINFO)
361361
362362
363363
r1679r1680
365365# Specific rele to compile verinfo util.
366366#-------------------------------------------------
367367
368$(UIOBJ)/verinfo.o : $(WINSRC)/verinfo.c
369   @echo Compiling $<...
370   $(CC) -DWINUI $(CDEFS) $(CFLAGS) -c $< -o $@
368#$(BUILDOBJ)/verinfo.o : $(BUILDSRC)/verinfo.c
369#   @echo Compiling $<...
370#   @echo $(CC) -DWINUI $(CDEFS) $(CFLAGS) -c $< -o $@
371#   $(CC) -DWINUI $(CDEFS) $(CFLAGS) -c $< -o $@
371372
372373
373374
r1679r1680
375376# generic rule for the resource compiler for UI
376377#-------------------------------------------------
377378
378$(UIOBJ)/mameui.res: $(UISRC)/mameui.rc $(UIOBJ)/mamevers.rc
379$(RESFILE): $(UISRC)/mameui.rc $(UIOBJ)/mamevers.rc
379380   @echo Compiling mameui resources $<...
380381   $(RC) $(RCDEFS) $(RCFLAGS) -o $@ -i $<
381382
r1679r1680
385386# rules for resource file
386387#-------------------------------------------------
387388
388#$(UIOBJ)/mameui.res: $(UISRC)/mameui.rc $(UIOBJ)/mamevers.rc
389
390$(UIOBJ)/mamevers.rc: $(VERINFO) $(SRC)/version.c
389$(UIOBJ)/mamevers.rc: $(OBJ)/build/verinfo$(EXE) $(SRC)/version.c
391390   @echo Emitting $@...
392   @$(VERINFO) $(SRC)/version.c > $@
391   @$(OBJ)/build/verinfo$(EXE) $(SRC)/version.c > $@
393392
394393
395394
src/emu/cpu/h83002/h8periph.c
r1679r1680
3434
3535static TIMER_CALLBACK( h8itu_timer_0_cb )
3636{
37   timer_adjust(h8.timer[0], attotime_never, 0, attotime_zero);
37   timer_adjust_oneshot(h8.timer[0], attotime_never, 0);
3838   h8.h8TCNT0 = 0;
3939   h8.per_regs[TSR0] |= 4;
4040   // interrupt on overflow ?
r1679r1680
4646
4747static TIMER_CALLBACK( h8itu_timer_1_cb )
4848{
49   timer_adjust(h8.timer[1], attotime_never, 0, attotime_zero);
49   timer_adjust_oneshot(h8.timer[1], attotime_never, 0);
5050   h8.h8TCNT1 = 0;
5151   h8.per_regs[TSR1] |= 4;
5252   // interrupt on overflow ?
r1679r1680
5858
5959static TIMER_CALLBACK( h8itu_timer_2_cb )
6060{
61   timer_adjust(h8.timer[2], attotime_never, 0, attotime_zero);
61   timer_adjust_oneshot(h8.timer[2], attotime_never, 0);
6262   h8.h8TCNT2 = 0;
6363   h8.per_regs[TSR2] |= 4;
6464   // interrupt on overflow ?
r1679r1680
7070
7171static TIMER_CALLBACK( h8itu_timer_3_cb )
7272{
73   timer_adjust(h8.timer[3], attotime_never, 0, attotime_zero);
73   timer_adjust_oneshot(h8.timer[3], attotime_never, 0);
7474   h8.h8TCNT3 = 0;
7575   h8.per_regs[TSR3] |= 4;
7676   // interrupt on overflow ?
r1679r1680
8282
8383static TIMER_CALLBACK( h8itu_timer_4_cb )
8484{
85   timer_adjust(h8.timer[4], attotime_never, 0, attotime_zero);
85   timer_adjust_oneshot(h8.timer[4], attotime_never, 0);
8686   h8.h8TCNT4 = 0;
8787   h8.per_regs[TSR4] |= 4;
8888   // interrupt on overflow ?
r1679r1680
130130      logerror("H8/3002: Timer %d is using an external clock.  Unsupported!\n", tnum);
131131   }
132132
133   timer_adjust(h8.timer[tnum], period, 0, attotime_zero);
133   timer_adjust_oneshot(h8.timer[tnum], period, 0);
134134}
135135
136136static void h8_itu_sync_timers(int tnum)
r1679r1680
523523      logerror("H8/3007: Timer %d is using an external clock.  Unsupported!\n", tnum);
524524   }
525525
526   timer_adjust(h8.timer[tnum], period, 0, attotime_zero);
526   timer_adjust_oneshot(h8.timer[tnum], period, 0);
527527}
528528
529529INLINE void h8itu_3007_timer_cb(int tnum)
r1679r1680
546546      else
547547      {
548548//          logerror("h8/3007 timer %d GRA match, stopping\n",tnum);
549         timer_adjust(h8.timer[tnum], attotime_never, 0, attotime_zero);
549         timer_adjust_oneshot(h8.timer[tnum], attotime_never, 0);
550550      }
551551
552552      h8.per_regs[0x64] |= 1<<tnum;
r1679r1680
568568      else
569569      {
570570//          logerror("h8/3007 timer %d GRB match, stopping\n",tnum);
571         timer_adjust(h8.timer[tnum], attotime_never, 0, attotime_zero);
571         timer_adjust_oneshot(h8.timer[tnum], attotime_never, 0);
572572      }
573573
574574      h8.per_regs[0x65] |= 1<<tnum;
r1679r1680
839839void h8_itu_reset(void)
840840{
841841   // stop all the timers
842   timer_adjust(h8.timer[0], attotime_never, 0, attotime_zero);
843   timer_adjust(h8.timer[1], attotime_never, 0, attotime_zero);
844   timer_adjust(h8.timer[2], attotime_never, 0, attotime_zero);
845   timer_adjust(h8.timer[3], attotime_never, 0, attotime_zero);
846   timer_adjust(h8.timer[4], attotime_never, 0, attotime_zero);
842   timer_adjust_oneshot(h8.timer[0], attotime_never, 0);
843   timer_adjust_oneshot(h8.timer[1], attotime_never, 0);
844   timer_adjust_oneshot(h8.timer[2], attotime_never, 0);
845   timer_adjust_oneshot(h8.timer[3], attotime_never, 0);
846   timer_adjust_oneshot(h8.timer[4], attotime_never, 0);
847847}
src/emu/cpu/tms34010/tms34010.c
r1679r1680
645645
646646   /* allocate a scanline timer and set it to go off at the start */
647647   state.scantimer = timer_alloc(scanline_callback, NULL);
648   timer_adjust(state.scantimer, attotime_zero, index, attotime_zero);
648   timer_adjust_oneshot(state.scantimer, attotime_zero, index);
649649
650650   /* allocate the shiftreg */
651651   state.shiftreg = auto_malloc(SHIFTREG_SIZE);
r1679r1680
10651065
10661066   /* note that we add !master (0 or 1) as a attoseconds value; this makes no practical difference */
10671067   /* but helps ensure that masters are updated first before slaves */
1068   timer_adjust(state.scantimer, attotime_add_attoseconds(video_screen_get_time_until_pos(state.config->scrnum, vcount, 0), !master), cpunum | (vcount << 8), attotime_zero);
1068   timer_adjust_oneshot(state.scantimer, attotime_add_attoseconds(video_screen_get_time_until_pos(state.config->scrnum, vcount, 0), !master), cpunum | (vcount << 8));
10691069
10701070   /* restore the context */
10711071   cpuintrf_pop_context();
src/emu/cpu/cpu.mak
r1679r1680
534534CPUDEFS += -DHAS_MB8884=$(if $(filter MB8884,$(CPUS)),1,0)
535535CPUDEFS += -DHAS_M58715=$(if $(filter M58715,$(CPUS)),1,0)
536536
537ifneq ($(filter I8035 I8039 I8048 N7751,$(CPUS)),)
537ifneq ($(filter I8035 I8039 I8048 N7751 MB8884 M58715,$(CPUS)),)
538538OBJDIRS += $(CPUOBJ)/i8039
539539CPUOBJS += $(CPUOBJ)/i8039/i8039.o
540540DBGOBJS += $(CPUOBJ)/i8039/8039dasm.o
src/emu/cpu/m37710/m37710.c
r1679r1680
272272   int cpunum = param;
273273
274274   cpuintrf_push_context(cpunum);
275   timer_adjust(m37710i_cpu.timers[0], m37710i_cpu.reload[0], cpunum, attotime_zero);
275   timer_adjust_oneshot(m37710i_cpu.timers[0], m37710i_cpu.reload[0], cpunum);
276276
277277   m37710i_cpu.m37710_regs[m37710_irq_levels[12]] |= 0x04;
278278   m37710_set_irq_line(M37710_LINE_TIMERA0, PULSE_LINE);
r1679r1680
285285   int cpunum = param;
286286
287287   cpuintrf_push_context(cpunum);
288   timer_adjust(m37710i_cpu.timers[1], m37710i_cpu.reload[1], cpunum, attotime_zero);
288   timer_adjust_oneshot(m37710i_cpu.timers[1], m37710i_cpu.reload[1], cpunum);
289289
290290   m37710i_cpu.m37710_regs[m37710_irq_levels[11]] |= 0x04;
291291   m37710_set_irq_line(M37710_LINE_TIMERA1, PULSE_LINE);
r1679r1680
298298   int cpunum = param;
299299
300300   cpuintrf_push_context(cpunum);
301   timer_adjust(m37710i_cpu.timers[2], m37710i_cpu.reload[2], cpunum, attotime_zero);
301   timer_adjust_oneshot(m37710i_cpu.timers[2], m37710i_cpu.reload[2], cpunum);
302302
303303   m37710i_cpu.m37710_regs[m37710_irq_levels[10]] |= 0x04;
304304   m37710_set_irq_line(M37710_LINE_TIMERA2, PULSE_LINE);
r1679r1680
311311   int cpunum = param;
312312
313313   cpuintrf_push_context(cpunum);
314   timer_adjust(m37710i_cpu.timers[3], m37710i_cpu.reload[3], cpunum, attotime_zero);
314   timer_adjust_oneshot(m37710i_cpu.timers[3], m37710i_cpu.reload[3], cpunum);
315315
316316   m37710i_cpu.m37710_regs[m37710_irq_levels[9]] |= 0x04;
317317   m37710_set_irq_line(M37710_LINE_TIMERA3, PULSE_LINE);
r1679r1680
324324   int cpunum = param;
325325
326326   cpuintrf_push_context(cpunum);
327   timer_adjust(m37710i_cpu.timers[4], m37710i_cpu.reload[4], cpunum, attotime_zero);
327   timer_adjust_oneshot(m37710i_cpu.timers[4], m37710i_cpu.reload[4], cpunum);
328328
329329   m37710i_cpu.m37710_regs[m37710_irq_levels[8]] |= 0x04;
330330   m37710_set_irq_line(M37710_LINE_TIMERA4, PULSE_LINE);
r1679r1680
337337   int cpunum = param;
338338
339339   cpuintrf_push_context(cpunum);
340   timer_adjust(m37710i_cpu.timers[5], m37710i_cpu.reload[5], cpunum, attotime_zero);
340   timer_adjust_oneshot(m37710i_cpu.timers[5], m37710i_cpu.reload[5], cpunum);
341341
342342   m37710i_cpu.m37710_regs[m37710_irq_levels[7]] |= 0x04;
343343   m37710_set_irq_line(M37710_LINE_TIMERB0, PULSE_LINE);
r1679r1680
350350   int cpunum = param;
351351
352352   cpuintrf_push_context(cpunum);
353   timer_adjust(m37710i_cpu.timers[6], m37710i_cpu.reload[6], cpunum, attotime_zero);
353   timer_adjust_oneshot(m37710i_cpu.timers[6], m37710i_cpu.reload[6], cpunum);
354354
355355   m37710i_cpu.m37710_regs[m37710_irq_levels[6]] |= 0x04;
356356   m37710_set_irq_line(M37710_LINE_TIMERB1, PULSE_LINE);
r1679r1680
363363   int cpunum = param;
364364
365365   cpuintrf_push_context(cpunum);
366   timer_adjust(m37710i_cpu.timers[7], m37710i_cpu.reload[7], cpunum, attotime_zero);
366   timer_adjust_oneshot(m37710i_cpu.timers[7], m37710i_cpu.reload[7], cpunum);
367367
368368   m37710i_cpu.m37710_regs[m37710_irq_levels[5]] |= 0x04;
369369   m37710_set_irq_line(M37710_LINE_TIMERB2, PULSE_LINE);
r1679r1680
433433               mame_printf_debug("Timer %d in timer mode, %f Hz\n", timer, 1.0 / attotime_to_double(time));
434434               #endif
435435
436               timer_adjust(m37710i_cpu.timers[timer], time, cpunum, attotime_zero);
436               timer_adjust_oneshot(m37710i_cpu.timers[timer], time, cpunum);
437437               m37710i_cpu.reload[timer] = time;
438438               break;
439439
r1679r1680
468468               mame_printf_debug("Timer %d in timer mode, %f Hz\n", timer, 1.0 / attotime_to_double(time));
469469               #endif
470470
471               timer_adjust(m37710i_cpu.timers[timer], time, cpunum, attotime_zero);
471               timer_adjust_oneshot(m37710i_cpu.timers[timer], time, cpunum);
472472               m37710i_cpu.reload[timer] = time;
473473               break;
474474
src/emu/cpu/z180/z180.c
r1679r1680
4343 *
4444 *****************************************************************************/
4545
46/*****************************************************************************
47
48Z180 Info:
49
50Known clock speeds (from ZiLOG): 6, 8, 10, 20 & 33MHz
51
52ZiLOG Z180 codes:
53
54  Speed: 10 = 10MHZ
55         20 = 20MHz
56         33 = 33MHz
57Package: P = 60-Pin Plastic DIP
58         V = 68-Pin PLCC
59         F = 80-Pin QFP
60   Temp: S = 0C to +70C
61         E = -40C to +85C
62
63Environmanetal Flow: C = Plastic Standard
64
65
66Example from Ms.Pac-Man/Galaga - 20 year Reunion hardare (see src/mame/drivers/20pacgal.c):
67
68   CPU is Z8S18020VSC = Z180, 20MHz, 68-Pin PLCC, 0C to +70C, Plastic Standard
69
70
71Other CPUs that use a compatible Z180 core:
72
73Hitachi HD647180 series:
74  Available in QFP80, PLCC84 & DIP90 packages (the QFP80 is not pinout compatible)
75  The HD647180 also has an internal ROM
76
77 *****************************************************************************/
78
4679#include "debugger.h"
4780#include "deprecat.h"
4881#include "z180.h"
src/emu/cpu/i8039/i8039.c
r1679r1680
620620   R.timer = 0;
621621}
622622
623#if (HAS_I8035)
623#if (HAS_I8035||HAS_I8048||HAS_MB8884)
624624static void i8035_init (int index, int clock, const void *config, int (*irqcallback)(int))
625625{
626626   i8039_init(index, clock, config, irqcallback);
627627   R.ram_mask = 0x3F;
628628   R.int_rom_size = 0x400;
629629}
630#endif /* HAS_I8035 */
630#endif
631631
632632#if (HAS_M58715)
633633static void m58715_init (int index, int clock, const void *config, int (*irqcallback)(int))
src/emu/cpu/tlcs90/tlcs90.c
r1679r1680
23452345
23462346   period = attotime_mul(T90.timer_period, prescaler);
23472347
2348   timer_adjust(T90.timer[i], period, i, period);
2348   timer_adjust_periodic(T90.timer[i], period, i, period);
23492349
23502350   logerror("%04X: CPU Timer %d started at %lf Hz\n", activecpu_get_pc(), i, 1.0 / attotime_to_double(period));
23512351}
r1679r1680
23672367
23682368   period = attotime_mul(T90.timer_period, prescaler);
23692369
2370   timer_adjust(T90.timer[4], period, 4, period);
2370   timer_adjust_periodic(T90.timer[4], period, 4, period);
23712371
23722372   logerror("%04X: CPU Timer 4 started at %lf Hz\n", activecpu_get_pc(), 1.0 / attotime_to_double(period));
23732373}
r1679r1680
23752375
23762376static void t90_stop_timer(int i)
23772377{
2378   timer_adjust(T90.timer[i], attotime_never, i, attotime_zero);
2378   timer_adjust_oneshot(T90.timer[i], attotime_never, i);
23792379   logerror("%04X: CPU Timer %d stopped\n", activecpu_get_pc(), i);
23802380}
23812381
src/emu/cpu/e132xs/e132xs.c
r1679r1680
637637   {
638638      UINT64 clocks_until_int = hyperstone.tr_clocks_per_tick - (clocks_since_base % hyperstone.tr_clocks_per_tick);
639639      UINT64 cycles_until_int = (clocks_until_int << hyperstone.clock_scale) + cycles_until_next_clock;
640      timer_adjust(hyperstone.timer, ATTOTIME_IN_CYCLES(cycles_until_int + 1, cpunum), cpunum * 2 + 1, attotime_never);
640      timer_adjust_oneshot(hyperstone.timer, ATTOTIME_IN_CYCLES(cycles_until_int + 1, cpunum), cpunum * 2 + 1);
641641   }
642642
643643   /* else if the timer interrupt is enabled, configure it to fire at the appropriate time */
r1679r1680
648648      if (delta > 0x80000000)
649649      {
650650         if (!hyperstone.timer_int_pending)
651            timer_adjust(hyperstone.timer, attotime_zero, cpunum * 2 + 0, attotime_never);
651            timer_adjust_oneshot(hyperstone.timer, attotime_zero, cpunum * 2 + 0);
652652      }
653653      else
654654      {
655655         UINT64 clocks_until_int = mulu_32x32(delta, hyperstone.tr_clocks_per_tick);
656656         UINT64 cycles_until_int = (clocks_until_int << hyperstone.clock_scale) + cycles_until_next_clock;
657         timer_adjust(hyperstone.timer, ATTOTIME_IN_CYCLES(cycles_until_int, cpunum), cpunum * 2 + 0, attotime_never);
657         timer_adjust_oneshot(hyperstone.timer, ATTOTIME_IN_CYCLES(cycles_until_int, cpunum), cpunum * 2 + 0);
658658      }
659659   }
660660
661661   /* otherwise, disable the timer */
662662   else
663      timer_adjust(hyperstone.timer, attotime_never, 0, attotime_never);
663      timer_adjust_oneshot(hyperstone.timer, attotime_never, 0);
664664}
665665
666666static TIMER_CALLBACK( e132xs_timer_callback )
r1679r1680
15981598
15991599   hyperstone_init(index, clock, config, irqcallback, scale_mask);
16001600}
1601#endif
16011602
1603#if (HAS_E116T)
16021604static void e116t_init(int index, int clock, const void *config, int (*irqcallback)(int))
16031605{
16041606   e116_init(index, clock, config, irqcallback, 0);
16051607}
1608#endif
16061609
1610#if (HAS_E116XT)
16071611static void e116xt_init(int index, int clock, const void *config, int (*irqcallback)(int))
16081612{
16091613   e116_init(index, clock, config, irqcallback, 3);
16101614}
1615#endif
16111616
1617#if (HAS_E116XS)
16121618static void e116xs_init(int index, int clock, const void *config, int (*irqcallback)(int))
16131619{
16141620   e116_init(index, clock, config, irqcallback, 7);
16151621}
1622#endif
16161623
1624#if (HAS_E116XSR)
16171625static void e116xsr_init(int index, int clock, const void *config, int (*irqcallback)(int))
16181626{
16191627   e116_init(index, clock, config, irqcallback, 7);
16201628}
1629#endif
16211630
1631#if (HAS_GMS30C2116)
16221632static void gms30c2116_init(int index, int clock, const void *config, int (*irqcallback)(int))
16231633{
16241634   e116_init(index, clock, config, irqcallback, 0);
16251635}
1636#endif
16261637
1638#if (HAS_GMS30C2216)
16271639static void gms30c2216_init(int index, int clock, const void *config, int (*irqcallback)(int))
16281640{
16291641   e116_init(index, clock, config, irqcallback, 0);
r1679r1680
16471659
16481660   hyperstone_init(index, clock, config, irqcallback, scale_mask);
16491661}
1662#endif
16501663
1664#if (HAS_E132N)
16511665static void e132n_init(int index, int clock, const void *config, int (*irqcallback)(int))
16521666{
16531667   e132_init(index, clock, config, irqcallback, 0);
16541668}
1669#endif
16551670
1671#if (HAS_E132T)
16561672static void e132t_init(int index, int clock, const void *config, int (*irqcallback)(int))
16571673{
16581674   e132_init(index, clock, config, irqcallback, 0);
16591675}
1676#endif
16601677
1678#if (HAS_E132XN)
16611679static void e132xn_init(int index, int clock, const void *config, int (*irqcallback)(int))
16621680{
16631681   e132_init(index, clock, config, irqcallback, 3);
16641682}
1683#endif
16651684
1685#if (HAS_E132XT)
16661686static void e132xt_init(int index, int clock, const void *config, int (*irqcallback)(int))
16671687{
16681688   e132_init(index, clock, config, irqcallback, 3);
16691689}
1690#endif
16701691
1692#if (HAS_E132XS)
16711693static void e132xs_init(int index, int clock, const void *config, int (*irqcallback)(int))
16721694{
16731695   e132_init(index, clock, config, irqcallback, 7);
16741696}
1697#endif
16751698
1699#if (HAS_E132XSR)
16761700static void e132xsr_init(int index, int clock, const void *config, int (*irqcallback)(int))
16771701{
16781702   e132_init(index, clock, config, irqcallback, 7);
16791703}
1704#endif
16801705
1706#if (HAS_GMS30C2132)
16811707static void gms30c2132_init(int index, int clock, const void *config, int (*irqcallback)(int))
16821708{
16831709   e132_init(index, clock, config, irqcallback, 0);
16841710}
1711#endif
16851712
1713#if (HAS_GMS30C2232)
16861714static void gms30c2232_init(int index, int clock, const void *config, int (*irqcallback)(int))
16871715{
16881716   e132_init(index, clock, config, irqcallback, 0);
src/emu/cpu/adsp2100/adsp2100.c
r1679r1680
20712071   }
20722072}
20732073
2074#if (HAS_ADSP2104||HAS_ADSP2105||HAS_ADSP2115||HAS_ADSP2181)
20742075static void adsp21xx_load_boot_data(UINT8 *srcdata, UINT32 *dstdata)
20752076{
20762077   /* see how many words we need to copy */
r1679r1680
20822083      dstdata[i] = opcode;
20832084   }
20842085}
2086#endif
20852087
20862088#if (HAS_ADSP2100)
20872089/**************************************************************************
src/emu/cpu/m6502/opsce02.h
r1679r1680
288288   t1=RDOPARG();                           \
289289   t2=RDOPARG();                           \
290290   t3=RDOPARG();                           \
291   logerror("m65ce02 at pc:%.4x reserved op aug %.2x %.2x %.2x\n", t1,t2,t3);
291   logerror("m65ce02 at pc:%.4x reserved op aug %.2x %.2x %.2x\n", activecpu_get_pc(),t1,t2,t3);
292292
293293/* 65ce02 ******************************************************
294294 *  BBR Branch if bit is reset
src/emu/cpu/m6502/m65ce02.c
r1679r1680
3838*/
3939
4040#include "debugger.h"
41#include "deprecat.h"
4142#include "m65ce02.h"
4243
4344#include "mincce02.h"
4445#include "opsce02.h"
4546
47#define M6502_NMI_VEC   0xfffa
48#define M6502_RST_VEC   0xfffc
49#define M6502_IRQ_VEC   0xfffe
50#define M65CE02_RST_VEC   M6502_RST_VEC
51#define M65CE02_IRQ_VEC   M6502_IRQ_VEC
52#define M65CE02_NMI_VEC   M6502_NMI_VEC
53
4654#define VERBOSE 0
4755
4856#define LOG(x)   do { if (VERBOSE) logerror x; } while (0)
4957
5058
51/* Layout of the registers in the debugger */
52static UINT8 m65ce02_reg_layout[] = {
53   M65CE02_A,M65CE02_X,M65CE02_Y,M65CE02_Z,M65CE02_S,M65CE02_PC,
54   M65CE02_P,
55   -1,
56   M65CE02_EA,M65CE02_ZP,M65CE02_NMI_STATE,M65CE02_IRQ_STATE, M65CE02_B,
57   0
58};
59
60/* Layout of the debugger windows x,y,w,h */
61static UINT8 m65ce02_win_layout[] = {
62   25, 0,55, 2,   /* register window (top, right rows) */
63    0, 0,24,22,   /* disassembler window (left colums) */
64   25, 3,55, 9,   /* memory #1 window (right, upper middle) */
65   25,13,55, 9,   /* memory #2 window (right, lower middle) */
66    0,23,80, 1,   /* command line window (bottom rows) */
67};
68
6959typedef struct {
70   void   (**insn)(void); /* pointer to the function pointer table */
60   void   (*const *insn)(void); /* pointer to the function pointer table */
7161   PAIR   ppc;         /* previous program counter */
72   PAIR   pc;          /* program counter */
73   PAIR   sp;          /* stack pointer (always 100 - 1FF) */
74   PAIR   zp;          /* zero page address */
62   PAIR   pc;            /* program counter */
63   PAIR   sp;            /* stack pointer (always 100 - 1FF) */
64   PAIR   zp;            /* zero page address */
7565   /* contains B register zp.b.h */
76   PAIR   ea;          /* effective address */
66   PAIR   ea;            /* effective address */
7767   UINT8   a;            /* Accumulator */
7868   UINT8   x;            /* X index register */
7969   UINT8   y;            /* Y index register */
r1679r1680
8474   UINT8   nmi_state;
8575   UINT8   irq_state;
8676   int    (*irq_callback)(int irqline);   /* IRQ callback */
77   read8_handler rdmem_id;               /* readmem callback for indexed instructions */
78   write8_handler wrmem_id;            /* writemem callback for indexed instructions */
8779}   m65ce02_Regs;
8880
8981
90int m65ce02_ICount = 0;
82static int m65ce02_ICount = 0;
9183
9284static m65ce02_Regs m65ce02;
9385
r1679r1680
9789
9890#include "t65ce02.c"
9991
100void m65ce02_reset (void *param)
92static void m65ce02_init(int index, int clock, const void *config, int (*irqcallback)(int))
10193{
94   m65ce02.rdmem_id = program_read_byte_8;
95   m65ce02.wrmem_id = program_write_byte_8;
96   m65ce02.irq_callback = irqcallback;
97}
98
99static void m65ce02_reset(void)
100{
102101   m65ce02.insn = insn65ce02;
103102
104103   /* wipe out the rest of the m65ce02 structure */
r1679r1680
119118   change_pc(PCD);
120119}
121120
122void m65ce02_exit(void)
121static void m65ce02_exit(void)
123122{
124123   /* nothing to do yet */
125124}
126125
127unsigned m65ce02_get_context (void *dst)
126static void m65ce02_get_context (void *dst)
128127{
129128   if( dst )
130129      *(m65ce02_Regs*)dst = m65ce02;
131   return sizeof(m65ce02_Regs);
132130}
133131
134void m65ce02_set_context (void *src)
132static void m65ce02_set_context (void *src)
135133{
136134   if( src )
137135   {
r1679r1680
140138   }
141139}
142140
143unsigned m65ce02_get_reg (int regnum)
144{
145   switch( regnum )
146   {
147      case REG_PC: return PCD;
148      case M65CE02_PC: return m65ce02.pc.w.l;
149      case REG_SP: return S;
150      case M65CE02_S: return m65ce02.sp.w.l;
151      case M65CE02_P: return m65ce02.p;
152      case M65CE02_A: return m65ce02.a;
153      case M65CE02_X: return m65ce02.x;
154      case M65CE02_Y: return m65ce02.y;
155      case M65CE02_Z: return m65ce02.z;
156      case M65CE02_B: return m65ce02.zp.b.h;
157      case M65CE02_EA: return m65ce02.ea.w.l;
158      case M65CE02_ZP: return m65ce02.zp.b.l;
159      case M65CE02_NMI_STATE: return m65ce02.nmi_state;
160      case M65CE02_IRQ_STATE: return m65ce02.irq_state;
161      case REG_PREVIOUSPC: return m65ce02.ppc.w.l;
162   }
163   return 0;
164}
165
166void m65ce02_set_reg (int regnum, unsigned val)
167{
168   switch( regnum )
169   {
170      case REG_PC: PCW = val; change_pc(PCD); break;
171      case M65CE02_PC: m65ce02.pc.w.l = val; break;
172      case REG_SP: S = val; break;
173      case M65CE02_S: m65ce02.sp.w.l = val; break;
174      case M65CE02_P: m65ce02.p = val; break;
175      case M65CE02_A: m65ce02.a = val; break;
176      case M65CE02_X: m65ce02.x = val; break;
177      case M65CE02_Y: m65ce02.y = val; break;
178      case M65CE02_Z: m65ce02.z = val; break;
179      case M65CE02_B: m65ce02.zp.b.h = val; break;
180      case M65CE02_EA: m65ce02.ea.w.l = val; break;
181      case M65CE02_ZP: m65ce02.zp.b.l = val; break;
182      case M65CE02_NMI_STATE: m65ce02_set_irq_line( INPUT_LINE_NMI, val ); break;
183      case M65CE02_IRQ_STATE: m65ce02_set_irq_line( 0, val ); break;
184   }
185}
186
187141INLINE void m65ce02_take_irq(void)
188142{
189143   if( !(P & F_I) )
r1679r1680
204158   m65ce02.pending_irq = 0;
205159}
206160
207int m65ce02_execute(int cycles)
161static int m65ce02_execute(int cycles)
208162{
209163   m65ce02_ICount = cycles;
210164
r1679r1680
248202   return cycles - m65ce02_ICount;
249203}
250204
251void m65ce02_set_irq_line(int irqline, int state)
205static void m65ce02_set_irq_line(int irqline, int state)
252206{
253207   if (irqline == INPUT_LINE_NMI)
254208   {
r1679r1680
280234   }
281235}
282236
283void m65ce02_set_irq_callback(int (*callback)(int))
284{
285   m65ce02.irq_callback = callback;
286}
237/**************************************************************************
238 * Generic set_info
239 **************************************************************************/
287240
288void m65ce02_state_save(void *file)
241static void m65ce02_set_info(UINT32 state, cpuinfo *info)
289242{
290   int cpu = cpu_getactivecpu();
291   /* insn is set at restore since it's a pointer */
292   state_save_UINT16(file,"m65ce02",cpu,"PC",&m65ce02.pc.w.l,2);
293   state_save_UINT16(file,"m65ce02",cpu,"SP",&m65ce02.sp.w.l,2);
294   state_save_UINT8(file,"m65ce02",cpu,"P",&m65ce02.p,1);
295   state_save_UINT8(file,"m65ce02",cpu,"A",&m65ce02.a,1);
296   state_save_UINT8(file,"m65ce02",cpu,"X",&m65ce02.x,1);
297   state_save_UINT8(file,"m65ce02",cpu,"Y",&m65ce02.y,1);
298   state_save_UINT8(file,"m65ce02",cpu,"Z",&m65ce02.z,1);
299   state_save_UINT8(file,"m65ce02",cpu,"B",&m65ce02.zp.b.h,1);
300   state_save_UINT8(file,"m65ce02",cpu,"PENDING",&m65ce02.pending_irq,1);
301   state_save_UINT8(file,"m65ce02",cpu,"AFTER_CLI",&m65ce02.after_cli,1);
302   state_save_UINT8(file,"m65ce02",cpu,"NMI_STATE",&m65ce02.nmi_state,1);
303   state_save_UINT8(file,"m65ce02",cpu,"IRQ_STATE",&m65ce02.irq_state,1);
304}
243   switch( state )
244    {
245      /* --- the following bits of info are set as 64-bit signed integers --- */
246      case CPUINFO_INT_INPUT_STATE + M65CE02_IRQ_STATE: m65ce02_set_irq_line( M65CE02_IRQ_LINE, info->i ); break;
247      case CPUINFO_INT_INPUT_STATE + M65CE02_NMI_STATE: m65ce02_set_irq_line( INPUT_LINE_NMI, info->i ); break;
305248
306void m65ce02_state_load(void *file)
307{
308   int cpu = cpu_getactivecpu();
309   m65ce02.insn = insn65ce02;
310   state_load_UINT16(file,"m65ce02",cpu,"PC",&m65ce02.pc.w.l,2);
311   state_load_UINT16(file,"m65ce02",cpu,"SP",&m65ce02.sp.w.l,2);
312   state_load_UINT8(file,"m65ce02",cpu,"P",&m65ce02.p,1);
313   state_load_UINT8(file,"m65ce02",cpu,"A",&m65ce02.a,1);
314   state_load_UINT8(file,"m65ce02",cpu,"X",&m65ce02.x,1);
315   state_load_UINT8(file,"m65ce02",cpu,"Y",&m65ce02.y,1);
316   state_load_UINT8(file,"m65ce02",cpu,"Z",&m65ce02.z,1);
317   state_load_UINT8(file,"m65ce02",cpu,"B",&m65ce02.zp.b.h,1);
318   state_load_UINT8(file,"m65ce02",cpu,"PENDING",&m65ce02.pending_irq,1);
319   state_load_UINT8(file,"m65ce02",cpu,"AFTER_CLI",&m65ce02.after_cli,1);
320   state_load_UINT8(file,"m65ce02",cpu,"NMI_STATE",&m65ce02.nmi_state,1);
321   state_load_UINT8(file,"m65ce02",cpu,"IRQ_STATE",&m65ce02.irq_state,1);
249      case CPUINFO_INT_PC: PCW = info->i; change_pc(PCD); break;
250      case CPUINFO_INT_REGISTER + M65CE02_PC: m65ce02.pc.w.l = info->i; break;
251      case CPUINFO_INT_SP: m65ce02.sp.b.l = info->i; break;
252      case CPUINFO_INT_REGISTER + M65CE02_S: m65ce02.sp.w.l = info->i; break;
253      case CPUINFO_INT_REGISTER + M65CE02_P: m65ce02.p = info->i; break;
254      case CPUINFO_INT_REGISTER + M65CE02_A: m65ce02.a = info->i; break;
255      case CPUINFO_INT_REGISTER + M65CE02_X: m65ce02.x = info->i; break;
256      case CPUINFO_INT_REGISTER + M65CE02_Y: m65ce02.y = info->i; break;
257      case CPUINFO_INT_REGISTER + M65CE02_Z: m65ce02.z = info->i; break;
258      case CPUINFO_INT_REGISTER + M65CE02_B: m65ce02.zp.b.h = info->i; break;
259      case CPUINFO_INT_REGISTER + M65CE02_EA: m65ce02.ea.w.l = info->i; break;
260      case CPUINFO_INT_REGISTER + M65CE02_ZP: m65ce02.zp.b.l = info->i; break;
261
262      /* --- the following bits of info are set as pointers to data or functions --- */
263      case CPUINFO_PTR_M6502_READINDEXED_CALLBACK:   m65ce02.rdmem_id = (read8_handler) info->f; break;
264      case CPUINFO_PTR_M6502_WRITEINDEXED_CALLBACK:   m65ce02.wrmem_id = (write8_handler) info->f; break;
265   }
322266}
323267
324/****************************************************************************
325 * Return a formatted string for a register
326 ****************************************************************************/
327const char *m65ce02_info(void *context, int regnum)
268/**************************************************************************
269 * Generic get_info
270 **************************************************************************/
271
272void m65ce02_get_info(UINT32 state, cpuinfo *info)
328273{
329   char *buffer = cpuintrf_temp_str();
330   m65ce02_Regs *r = context;
274   switch( state )
275   {
276      /* --- the following bits of info are returned as 64-bit signed integers --- */
277      case CPUINFO_INT_CONTEXT_SIZE:               info->i = sizeof(m65ce02);            break;
278      case CPUINFO_INT_INPUT_LINES:               info->i = 2;                     break;
279      case CPUINFO_INT_DEFAULT_IRQ_VECTOR:         info->i = 0;                     break;
280      case CPUINFO_INT_ENDIANNESS:               info->i = CPU_IS_LE;               break;
281      case CPUINFO_INT_CLOCK_MULTIPLIER:            info->i = 1;                     break;
282      case CPUINFO_INT_CLOCK_DIVIDER:               info->i = 1;                     break;
283      case CPUINFO_INT_MIN_INSTRUCTION_BYTES:         info->i = 1;                     break;
284      case CPUINFO_INT_MAX_INSTRUCTION_BYTES:         info->i = 3;                     break;
285      case CPUINFO_INT_MIN_CYCLES:               info->i = 1;                     break;
286      case CPUINFO_INT_MAX_CYCLES:               info->i = 10;                     break;
331287
332   if( !context )
333      r = &m65ce02;
288      case CPUINFO_INT_DATABUS_WIDTH + ADDRESS_SPACE_PROGRAM:   info->i = 8;               break;
289      case CPUINFO_INT_ADDRBUS_WIDTH + ADDRESS_SPACE_PROGRAM: info->i = 20;               break;
290      case CPUINFO_INT_ADDRBUS_SHIFT + ADDRESS_SPACE_PROGRAM: info->i = 0;               break;
291      case CPUINFO_INT_LOGADDR_WIDTH + ADDRESS_SPACE_PROGRAM: info->i = 16;               break;
292      case CPUINFO_INT_PAGE_SHIFT + ADDRESS_SPACE_PROGRAM:   info->i = 13;               break;
293      case CPUINFO_INT_DATABUS_WIDTH + ADDRESS_SPACE_DATA:   info->i = 0;               break;
294      case CPUINFO_INT_ADDRBUS_WIDTH + ADDRESS_SPACE_DATA:   info->i = 0;               break;
295      case CPUINFO_INT_ADDRBUS_SHIFT + ADDRESS_SPACE_DATA:   info->i = 0;               break;
296      case CPUINFO_INT_DATABUS_WIDTH + ADDRESS_SPACE_IO:      info->i = 0;               break;
297      case CPUINFO_INT_ADDRBUS_WIDTH + ADDRESS_SPACE_IO:      info->i = 0;               break;
298      case CPUINFO_INT_ADDRBUS_SHIFT + ADDRESS_SPACE_IO:      info->i = 0;               break;
334299
335   switch( regnum )
336   {
337      case CPU_INFO_REG+M65CE02_PC: sprintf(buffer, "PC:%04X", r->pc.w.l); break;
338      case CPU_INFO_REG+M65CE02_S: sprintf(buffer, "S:%04X", r->sp.w.l); break;
339      case CPU_INFO_REG+M65CE02_P: sprintf(buffer, "P:%02X", r->p); break;
340      case CPU_INFO_REG+M65CE02_A: sprintf(buffer, "A:%02X", r->a); break;
341      case CPU_INFO_REG+M65CE02_X: sprintf(buffer, "X:%02X", r->x); break;
342      case CPU_INFO_REG+M65CE02_Y: sprintf(buffer, "Y:%02X", r->y); break;
343      case CPU_INFO_REG+M65CE02_Z: sprintf(buffer, "Z:%02X", r->z); break;
344      case CPU_INFO_REG+M65CE02_B: sprintf(buffer, "B:%02X", r->zp.b.h); break;
345      case CPU_INFO_REG+M65CE02_EA: sprintf(buffer, "EA:%04X", r->ea.w.l); break;
346      case CPU_INFO_REG+M65CE02_ZP: sprintf(buffer, "ZP:%04X", r->zp.w.l); break;
347      case CPU_INFO_REG+M65CE02_NMI_STATE: sprintf(buffer, "NMI:%X", r->nmi_state); break;
348      case CPU_INFO_REG+M65CE02_IRQ_STATE: sprintf(buffer, "IRQ:%X", r->irq_state); break;
349      case CPU_INFO_FLAGS:
350         sprintf(buffer, "%c%c%c%c%c%c%c%c",
351            r->p & 0x80 ? 'N':'.',
352            r->p & 0x40 ? 'V':'.',
353            r->p & 0x20 ? 'E':'.',
354            r->p & 0x10 ? 'B':'.',
355            r->p & 0x08 ? 'D':'.',
356            r->p & 0x04 ? 'I':'.',
357            r->p & 0x02 ? 'Z':'.',
358            r->p & 0x01 ? 'C':'.');
359         break;
360      case CPU_INFO_NAME: return "M65CE02";
361      case CPU_INFO_FAMILY: return "CBM Semiconductor Group CSG 65CE02";
362      case CPU_INFO_VERSION: return "1.0beta";
363      case CPU_INFO_CREDITS:
364         return "Copyright Juergen Buchmueller\n"
365            "Copyright Peter Trauner\n"
366            "all rights reserved.";
367      case CPU_INFO_FILE: return __FILE__;
368      case CPU_INFO_REG_LAYOUT: return (const char*)m65ce02_reg_layout;
369      case CPU_INFO_WIN_LAYOUT: return (const char*)m65ce02_win_layout;
370   }
371   return buffer;
372}
300      case CPUINFO_INT_INPUT_STATE+M65CE02_NMI_STATE: info->i = m65ce02.nmi_state;         break;
301      case CPUINFO_INT_INPUT_STATE+M65CE02_IRQ_STATE: info->i = m65ce02.irq_state;         break;
373302
374unsigned int m65ce02_dasm(char *buffer, unsigned pc)
375{
303      case CPUINFO_INT_PREVIOUSPC: info->i = m65ce02.ppc.w.l; break;
304
305      case CPUINFO_INT_PC:                     info->i = PCD;                     break;
306      case CPUINFO_INT_REGISTER+M65CE02_PC:         info->i = m65ce02.pc.w.l;            break;
307      case CPUINFO_INT_SP:                     info->i = m65ce02.sp.b.l;            break;
308      case CPUINFO_INT_REGISTER+M65CE02_S:         info->i = m65ce02.sp.w.l;            break;
309      case CPUINFO_INT_REGISTER+M65CE02_P:         info->i = m65ce02.p;               break;
310      case CPUINFO_INT_REGISTER+M65CE02_A:         info->i = m65ce02.a;               break;
311      case CPUINFO_INT_REGISTER+M65CE02_X:         info->i = m65ce02.x;               break;
312      case CPUINFO_INT_REGISTER+M65CE02_Y:         info->i = m65ce02.y;               break;
313      case CPUINFO_INT_REGISTER+M65CE02_Z:         info->i = m65ce02.z;               break;
314      case CPUINFO_INT_REGISTER+M65CE02_B:         info->i = m65ce02.zp.b.h;            break;
315      case CPUINFO_INT_REGISTER+M65CE02_EA:         info->i = m65ce02.ea.w.l;            break;
316      case CPUINFO_INT_REGISTER+M65CE02_ZP:         info->i = m65ce02.zp.w.l;            break;
317
318      /* --- the following bits of info are returned as pointers to data or functions --- */
319      case CPUINFO_PTR_SET_INFO:                  info->setinfo = m65ce02_set_info;         break;
320      case CPUINFO_PTR_GET_CONTEXT:               info->getcontext = m65ce02_get_context;   break;
321      case CPUINFO_PTR_SET_CONTEXT:               info->setcontext = m65ce02_set_context;   break;
322      case CPUINFO_PTR_INIT:                     info->init = m65ce02_init;            break;
323      case CPUINFO_PTR_RESET:                     info->reset = m65ce02_reset;            break;
324      case CPUINFO_PTR_EXIT:                     info->exit = m65ce02_exit;            break;
325      case CPUINFO_PTR_EXECUTE:                  info->execute = m65ce02_execute;         break;
326      case CPUINFO_PTR_BURN:                     info->burn = NULL;                  break;
376327#ifdef ENABLE_DEBUGGER
377   return Dasm65ce02( buffer, pc );
378#else
379   sprintf( buffer, "$%02X", cpu_readop(pc) );
380   return 1;
328      case CPUINFO_PTR_DISASSEMBLE:               info->disassemble = m65ce02_dasm;         break;
381329#endif
382}
330      case CPUINFO_PTR_INSTRUCTION_COUNTER:         info->icount = &m65ce02_ICount;         break;
331      case CPUINFO_PTR_M6502_READINDEXED_CALLBACK:   info->f = (genf *) m65ce02.rdmem_id;      break;
332      case CPUINFO_PTR_M6502_WRITEINDEXED_CALLBACK:   info->f = (genf *) m65ce02.wrmem_id;      break;
383333
334      /* --- the following bits of info are returned as NULL-terminated strings --- */
335      case CPUINFO_STR_NAME: strcpy(info->s, "M65CE02");  break;
336      case CPUINFO_STR_CORE_FAMILY: strcpy(info->s,"CBM Semiconductor Group CSG 65CE02");  break;
337      case CPUINFO_STR_CORE_VERSION: strcpy(info->s,"1.0beta");  break;
338      case CPUINFO_STR_CORE_FILE: strcpy(info->s,__FILE__);
339      case CPUINFO_STR_CORE_CREDITS:
340         strcpy(info->s, "Copyright Juergen Buchmueller\n"
341            "Copyright Peter Trauner\n"
342            "all rights reserved.");  break;
343      case CPUINFO_STR_FLAGS:
344         sprintf(info->s, "%c%c%c%c%c%c%c%c",
345            m65ce02.p & 0x80 ? 'N':'.',
346            m65ce02.p & 0x40 ? 'V':'.',
347            m65ce02.p & 0x20 ? 'E':'.',
348            m65ce02.p & 0x10 ? 'B':'.',
349            m65ce02.p & 0x08 ? 'D':'.',
350            m65ce02.p & 0x04 ? 'I':'.',
351            m65ce02.p & 0x02 ? 'Z':'.',
352            m65ce02.p & 0x01 ? 'C':'.');
353         break;
384354
385
355      case CPUINFO_STR_REGISTER + M65CE02_PC:         sprintf(info->s, "PC:%04X", m65ce02.pc.w.l); break;
356      case CPUINFO_STR_REGISTER + M65CE02_S:         sprintf(info->s, "S:%02X", m65ce02.sp.b.l); break;
357      case CPUINFO_STR_REGISTER + M65CE02_P:         sprintf(info->s, "P:%02X", m65ce02.p); break;
358      case CPUINFO_STR_REGISTER + M65CE02_A:         sprintf(info->s, "A:%02X", m65ce02.a); break;
359      case CPUINFO_STR_REGISTER + M65CE02_X:         sprintf(info->s, "X:%02X", m65ce02.x); break;
360      case CPUINFO_STR_REGISTER + M65CE02_Y:         sprintf(info->s, "Y:%02X", m65ce02.y); break;
361      case CPUINFO_STR_REGISTER + M65CE02_Z:         sprintf(info->s, "Z:%02X", m65ce02.z); break;
362      case CPUINFO_STR_REGISTER + M65CE02_B:         sprintf(info->s, "B:%02X", m65ce02.zp.b.h); break;
363      case CPUINFO_STR_REGISTER + M65CE02_EA:         sprintf(info->s, "EA:%04X", m65ce02.ea.w.l); break;
364      case CPUINFO_STR_REGISTER + M65CE02_ZP:         sprintf(info->s, "ZP:%03X", m65ce02.zp.w.l); break;
365   }
366}
src/emu/cpu/m6502/m65ce02.h
r1679r1680
3232
3333#define M65CE02_IRQ_LINE            M6502_IRQ_LINE
3434
35extern int m65ce02_ICount;            /* cycle count */
35void m65ce02_get_info(UINT32 state, cpuinfo *info);
3636
37extern void m65ce02_reset(void *param);
38extern void m65ce02_exit(void);
39extern int   m65ce02_execute(int cycles);
40extern unsigned m65ce02_get_context (void *dst);
41extern void m65ce02_set_context (void *src);
42extern unsigned m65ce02_get_reg (int regnum);
43extern void m65ce02_set_reg (int regnum, unsigned val);
44extern void m65ce02_set_irq_line(int irqline, int state);
45extern void m65ce02_set_irq_callback(int (*callback)(int irqline));
46extern void m65ce02_state_save(void *file);
47extern void m65ce02_state_load(void *file);
48extern const char *m65ce02_info(void *context, int regnum);
49extern unsigned m65ce02_dasm(char *buffer, unsigned pc);
50
5137#ifdef ENABLE_DEBUGGER
52extern unsigned int Dasm65ce02( char *dst, unsigned pc );
38extern unsigned m65ce02_dasm(char *buffer, offs_t pc, const UINT8 *oprom, const UINT8 *opram);
5339#endif
5440
5541#endif /* _M65CE02_H */
src/emu/cpu/powerpc/ppc_mem.c
r1679r1680
6666
6767/***********************************************************************/
6868
69#if (HAS_PPC601||HAS_PPC602||HAS_PPC603||HAS_MPC8240)
69#if (HAS_PPC601||HAS_PPC602||HAS_PPC603||HAS_PPC604||HAS_MPC8240)
7070static UINT16 ppc_read16_unaligned(UINT32 a)
7171{
7272   return ((UINT16)ppc.read8(a+0) << 8) | ((UINT16)ppc.read8(a+1) << 0);
r1679r1680
372372
373373/***********************************************************************/
374374
375#if (HAS_PPC601||HAS_PPC602||HAS_PPC603||HAS_MPC8240)
375#if (HAS_PPC601||HAS_PPC602||HAS_PPC603||HAS_PPC604||HAS_MPC8240)
376376static int ppc_readop(UINT32 offset, int size, UINT64 *value)
377377{
378378   if (!(ppc.msr & MSR_IR))
src/emu/cpu/powerpc/ppc_ops.c
r1679r1680
17851785
17861786
17871787
1788#if (HAS_PPC601||HAS_PPC602||HAS_PPC603||HAS_MPC8240)
1788#if (HAS_PPC601||HAS_PPC602||HAS_PPC603||HAS_PPC604||HAS_MPC8240)
17891789static void ppc_lfs(UINT32 op)
17901790{
17911791   UINT32 ea = SIMM16;
src/emu/cpu/powerpc/drc_ops.c
r1679r1680
27142714
27152715/* PowerPC 60x Recompilers */
27162716
2717#if (HAS_PPC601||HAS_PPC602||HAS_PPC603||HAS_MPC8240)
2717#if (HAS_PPC601||HAS_PPC602||HAS_PPC603||HAS_PPC604||HAS_MPC8240)
27182718static UINT32 recompile_lfs(drc_core *drc,UINT32 op)
27192719{
27202720   emit_mov_m32_r32(DRCTOP, MABS(&ppc_icount), REG_EBP);
r1679r1680
37983798{
37993799   return RECOMPILE_SUCCESSFUL_CP(1,4);
38003800}
3801#endif
38013802
3803#if (HAS_PPC602||HAS_PPC604||HAS_MPC8240)
38023804static UINT32 recompile_tlbld(drc_core *drc, UINT32 op)
38033805{
38043806   return RECOMPILE_SUCCESSFUL_CP(1,4);
src/emu/cpu/sh2/sh2.c
r1679r1680
24082408   int max_delta = 0xfffff;
24092409   UINT16 frc;
24102410
2411   timer_adjust(sh2.timer, attotime_never, 0, attotime_zero);
2411   timer_adjust_oneshot(sh2.timer, attotime_never, 0);
24122412
24132413   frc = sh2.frc;
24142414   if(!(sh2.m[4] & OCFA)) {
r1679r1680
24342434      if(divider) {
24352435         max_delta <<= divider;
24362436         sh2.frc_base = cpunum_gettotalcycles(sh2.cpu_number);
2437         timer_adjust(sh2.timer, ATTOTIME_IN_CYCLES(max_delta, sh2.cpu_number), sh2.cpu_number, attotime_zero);
2437         timer_adjust_oneshot(sh2.timer, ATTOTIME_IN_CYCLES(max_delta, sh2.cpu_number), sh2.cpu_number);
24382438      } else {
24392439         logerror("SH2.%d: Timer event in %d cycles of external clock", sh2.cpu_number, max_delta);
24402440      }
r1679r1680
25542554         LOG(("SH2: DMA %d start %x, %x, %x, %04x, %d, %d, %d\n", dma, src, dst, count, sh2.m[0x63+4*dma], incs, incd, size));
25552555
25562556         sh2.dma_timer_active[dma] = 1;
2557         timer_adjust(sh2.dma_timer[dma], ATTOTIME_IN_CYCLES(2*count+1, sh2.cpu_number), (sh2.cpu_number<<1)|dma, attotime_zero);
2557         timer_adjust_oneshot(sh2.dma_timer[dma], ATTOTIME_IN_CYCLES(2*count+1, sh2.cpu_number), (sh2.cpu_number<<1)|dma);
25582558
25592559         src &= AM;
25602560         dst &= AM;
r1679r1680
26332633      if(sh2.dma_timer_active[dma])
26342634      {
26352635         logerror("SH2: DMA %d cancelled in-flight", dma);
2636         timer_adjust(sh2.dma_timer[dma], attotime_never, 0, attotime_zero);
2636         timer_adjust_oneshot(sh2.dma_timer[dma], attotime_never, 0);
26372637         sh2.dma_timer_active[dma] = 0;
26382638      }
26392639   }
r1679r1680
29332933   const struct sh2_config *conf = config;
29342934
29352935   sh2.timer = timer_alloc(sh2_timer_callback, NULL);
2936   timer_adjust(sh2.timer, attotime_never, 0, attotime_zero);
2936   timer_adjust_oneshot(sh2.timer, attotime_never, 0);
29372937
29382938   sh2.dma_timer[0] = timer_alloc(sh2_dmac_callback, NULL);
2939   timer_adjust(sh2.dma_timer[0], attotime_never, 0, attotime_zero);
2939   timer_adjust_oneshot(sh2.dma_timer[0], attotime_never, 0);
29402940
29412941   sh2.dma_timer[1] = timer_alloc(sh2_dmac_callback, NULL);
2942   timer_adjust(sh2.dma_timer[1], attotime_never, 0, attotime_zero);
2942   timer_adjust_oneshot(sh2.dma_timer[1], attotime_never, 0);
29432943
29442944   sh2.m = auto_malloc(0x200);
29452945
src/emu/cpu/sh4/sh4.c
r1679r1680
9797   int     is_slave, cpu_number;
9898   int      cpu_clock, bus_clock, pm_clock;
9999   int      fpu_sz, fpu_pr;
100   int      ioport16_pullup, ioport16_direction;
101   int      ioport4_pullup, ioport4_direction;
100102
101103   void   (*ftcsr_read_callback)(UINT32 data);
102104} SH4;
r1679r1680
35173519   sh4_default_exception_priorities();
35183520   memset(sh4.exception_requesting, 0, sizeof(sh4.exception_requesting));
35193521
3520   timer_adjust(sh4.rtc_timer, ATTOTIME_IN_HZ(128), cpunum, attotime_zero);
3522   timer_adjust_oneshot(sh4.rtc_timer, ATTOTIME_IN_HZ(128), cpunum);
35213523   sh4.m[RCR2] = 0x09;
35223524   sh4.m[TCOR0] = 0xffffffff;
35233525   sh4.m[TCNT0] = 0xffffffff;
r1679r1680
36293631   if (ticks < 0)
36303632      ticks = 256 + ticks;
36313633   //((double)rtcnt_div[(sh4.m[RTCSR] >> 3) & 7] / (double)100000000)*ticks
3632   timer_adjust(sh4.refresh_timer, attotime_mul(attotime_mul(ATTOTIME_IN_HZ(sh4.bus_clock), rtcnt_div[(sh4.m[RTCSR] >> 3) & 7]), ticks), sh4.cpu_number, attotime_zero);
3634   timer_adjust_oneshot(sh4.refresh_timer, attotime_mul(attotime_mul(ATTOTIME_IN_HZ(sh4.bus_clock), rtcnt_div[(sh4.m[RTCSR] >> 3) & 7]), ticks), sh4.cpu_number);
36333635   sh4.refresh_timer_base = sh4.m[RTCNT];
36343636}
36353637
r1679r1680
36563658   double ticks;
36573659
36583660   ticks = sh4.m[TCNT0];
3659   timer_adjust(sh4.timer0, sh4_scale_up_mame_time(attotime_mul(ATTOTIME_IN_HZ(sh4.pm_clock), tcnt_div[sh4.m[TCR0] & 7]), ticks), sh4.cpu_number, attotime_zero);
3661   timer_adjust_oneshot(sh4.timer0, sh4_scale_up_mame_time(attotime_mul(ATTOTIME_IN_HZ(sh4.pm_clock), tcnt_div[sh4.m[TCR0] & 7]), ticks), sh4.cpu_number);
36603662}
36613663
36623664static void sh4_timer1_recompute(void)
r1679r1680
36643666   double ticks;
36653667
36663668   ticks = sh4.m[TCNT1];
3667   timer_adjust(sh4.timer1, sh4_scale_up_mame_time(attotime_mul(ATTOTIME_IN_HZ(sh4.pm_clock), tcnt_div[sh4.m[TCR1] & 7]), ticks), sh4.cpu_number, attotime_zero);
3669   timer_adjust_oneshot(sh4.timer1, sh4_scale_up_mame_time(attotime_mul(ATTOTIME_IN_HZ(sh4.pm_clock), tcnt_div[sh4.m[TCR1] & 7]), ticks), sh4.cpu_number);
36683670}
36693671
36703672static void sh4_timer2_recompute(void)
r1679r1680
36723674   double ticks;
36733675
36743676   ticks = sh4.m[TCNT2];
3675   timer_adjust(sh4.timer2, sh4_scale_up_mame_time(attotime_mul(ATTOTIME_IN_HZ(sh4.pm_clock), tcnt_div[sh4.m[TCR2] & 7]), ticks), sh4.cpu_number, attotime_zero);
3677   timer_adjust_oneshot(sh4.timer2, sh4_scale_up_mame_time(attotime_mul(ATTOTIME_IN_HZ(sh4.pm_clock), tcnt_div[sh4.m[TCR2] & 7]), ticks), sh4.cpu_number);
36763678}
36773679
36783680static TIMER_CALLBACK( sh4_refresh_timer_callback )
r1679r1680
37423744      sh4.m[RWKCNT] = 0;
37433745   }
37443746
3747   days = 0;
37453748   year = (sh4.m[RYRCNT] & 0xf) + ((sh4.m[RYRCNT] & 0xf0) >> 4)*10 + ((sh4.m[RYRCNT] & 0xf00) >> 8)*100 + ((sh4.m[RYRCNT] & 0xf000) >> 12)*1000;
37463749   leap = 0;
37473750   if (!(year%100))
r1679r1680
37533756      leap = 1;
37543757   if (sh4.m[RMONCNT] != 2)
37553758      leap = 0;
3756   days = daysmonth[(sh4.m[RMONCNT] & 0xf) + ((sh4.m[RMONCNT] & 0xf0) >> 4)*10 - 1];
3759   if (sh4.m[RMONCNT])
3760      days = daysmonth[(sh4.m[RMONCNT] & 0xf) + ((sh4.m[RMONCNT] & 0xf0) >> 4)*10 - 1];
37573761
37583762   sh4.m[RDAYCNT] = sh4.m[RDAYCNT] + carry;
37593763   if ((sh4.m[RDAYCNT] & 0xf) == 0xa)
r1679r1680
37913795   int cpunum = param;
37923796
37933797   cpuintrf_push_context(cpunum);
3794   timer_adjust(sh4.rtc_timer, ATTOTIME_IN_HZ(128), cpunum, attotime_zero);
3798   timer_adjust_oneshot(sh4.rtc_timer, ATTOTIME_IN_HZ(128), cpunum);
37953799   sh4.m[R64CNT] = (sh4.m[R64CNT]+1) & 0x7f;
37963800   if (sh4.m[R64CNT] == 64)
37973801   {
r1679r1680
39033907   if (timermode == 1)
39043908   {
39053909      sh4.dma_timer_active[channel] = 1;
3906      timer_adjust(sh4.dma_timer[channel], ATTOTIME_IN_CYCLES(2*count+1, sh4.cpu_number), (sh4.cpu_number << 8) | channel, attotime_zero);
3910      timer_adjust_oneshot(sh4.dma_timer[channel], ATTOTIME_IN_CYCLES(2*count+1, sh4.cpu_number), (sh4.cpu_number << 8) | channel);
39073911   }
39083912   else if (timermode == 2)
39093913   {
39103914      sh4.dma_timer_active[channel] = 1;
3911      timer_adjust(sh4.dma_timer[channel], attotime_zero, (sh4.cpu_number << 8) | channel, attotime_zero);
3915      timer_adjust_oneshot(sh4.dma_timer[channel], attotime_zero, (sh4.cpu_number << 8) | channel);
39123916   }
39133917
39143918   src &= AM;
r1679r1680
40514055      if (sh4.dma_timer_active[channel])
40524056      {
40534057         logerror("SH4: DMA %d cancelled in-flight but all data transferred", channel);
4054         timer_adjust(sh4.dma_timer[channel], attotime_never, 0, attotime_zero);
4058         timer_adjust_oneshot(sh4.dma_timer[channel], attotime_never, 0);
40554059         sh4.dma_timer_active[channel] = 0;
40564060      }
40574061   }
r1679r1680
40674071      if (sh4.dma_timer_active[s])
40684072      {
40694073         logerror("SH4: DMA %d cancelled due to NMI but all data transferred", s);
4070         timer_adjust(sh4.dma_timer[s], attotime_never, 0, attotime_zero);
4074         timer_adjust_oneshot(sh4.dma_timer[s], attotime_never, 0);
40714075         sh4.dma_timer_active[s] = 0;
40724076      }
40734077   }
r1679r1680
40754079
40764080WRITE32_HANDLER( sh4_internal_w )
40774081{
4082   int a;
40784083   UINT32 old = sh4.m[offset];
40794084   COMBINE_DATA(sh4.m+offset);
40804085
r1679r1680
40934098      }
40944099      else
40954100      {
4096         timer_adjust(sh4.refresh_timer, attotime_never, 0, attotime_zero);
4101         timer_adjust_oneshot(sh4.refresh_timer, attotime_never, 0);
40974102      }
40984103      break;
40994104
r1679r1680
41394144      }
41404145      if ((sh4.m[RCR2] & 8) && (~old & 8))
41414146      { // 0 -> 1
4142         timer_adjust(sh4.rtc_timer, ATTOTIME_IN_HZ(128), sh4.cpu_number, attotime_zero);
4147         timer_adjust_oneshot(sh4.rtc_timer, ATTOTIME_IN_HZ(128), sh4.cpu_number);
41434148      }
41444149      else if (~(sh4.m[RCR2]) & 8)
41454150      { // 0
4146         timer_adjust(sh4.rtc_timer, attotime_never, 0, attotime_zero);
4151         timer_adjust_oneshot(sh4.rtc_timer, attotime_never, 0);
41474152      }
41484153      break;
41494154
r1679r1680
41524157      if (old & 1)
41534158         sh4.m[TCNT0] = compute_ticks_timer(sh4.timer0, sh4.pm_clock, tcnt_div[sh4.m[TCR0] & 7]);
41544159      if ((sh4.m[TSTR] & 1) == 0) {
4155         timer_adjust(sh4.timer0, attotime_never, 0, attotime_zero);
4160         timer_adjust_oneshot(sh4.timer0, attotime_never, 0);
41564161      } else
41574162         sh4_timer0_recompute();
41584163
41594164      if (old & 2)
41604165         sh4.m[TCNT1] = compute_ticks_timer(sh4.timer1, sh4.pm_clock, tcnt_div[sh4.m[TCR1] & 7]);
41614166      if ((sh4.m[TSTR] & 2) == 0) {
4162         timer_adjust(sh4.timer1, attotime_never, 0, attotime_zero);
4167         timer_adjust_oneshot(sh4.timer1, attotime_never, 0);
41634168      } else
41644169         sh4_timer1_recompute();
41654170
41664171      if (old & 4)
41674172         sh4.m[TCNT2] = compute_ticks_timer(sh4.timer2, sh4.pm_clock, tcnt_div[sh4.m[TCR2] & 7]);
41684173      if ((sh4.m[TSTR] & 4) == 0) {
4169         timer_adjust(sh4.timer2, attotime_never, 0, attotime_zero);
4174         timer_adjust_oneshot(sh4.timer2, attotime_never, 0);
41704175      } else
41714176         sh4_timer2_recompute();
41724177      break;
r1679r1680
42724277      sh4_exception_recompute();
42734278      break;
42744279
4275   // DMA
4280      // DMA
42764281   case SAR0:
42774282   case SAR1:
42784283   case SAR2:
r1679r1680
43144319   case QACR1:
43154320      break;
43164321
4322      // I/O ports
4323   case PCTRA:
4324      sh4.ioport16_pullup = 0;
4325      sh4.ioport16_direction = 0;
4326      for (a=0;a < 16;a++) {
4327         sh4.ioport16_direction |= (sh4.m[PCTRA] & (1 << (a*2))) >> a;
4328         sh4.ioport16_pullup |= (sh4.m[PCTRA] & (1 << (a*2+1))) >> (a+1);
4329      }
4330      sh4.ioport16_direction &= 0xffff;
4331      sh4.ioport16_pullup = (sh4.ioport16_pullup | sh4.ioport16_direction) ^ 0xffff;
4332      if (sh4.m[BCR2] & 1)
4333         io_write_dword_64le(SH4_IOPORT_16, sh4.m[PDTRA] & sh4.ioport16_direction);
4334      break;
4335   case PDTRA:
4336      if (sh4.m[BCR2] & 1)
4337         io_write_dword_64le(SH4_IOPORT_16, sh4.m[PDTRA] & sh4.ioport16_direction);
4338      break;
4339   case PCTRB:
4340      sh4.ioport4_pullup = 0;
4341      sh4.ioport4_direction = 0;
4342      for (a=0;a < 4;a++) {
4343         sh4.ioport4_direction |= (sh4.m[PCTRB] & (1 << (a*2))) >> a;
4344         sh4.ioport4_pullup |= (sh4.m[PCTRB] & (1 << (a*2+1))) >> (a+1);
4345      }
4346      sh4.ioport4_direction &= 0xf;
4347      sh4.ioport4_pullup = (sh4.ioport4_pullup | sh4.ioport4_direction) ^ 0xf;
4348      if (sh4.m[BCR2] & 1)
4349         io_write_dword_64le(SH4_IOPORT_4, sh4.m[PDTRB] & sh4.ioport4_direction);
4350      break;
4351   case PDTRB:
4352      if (sh4.m[BCR2] & 1)
4353         io_write_dword_64le(SH4_IOPORT_4, sh4.m[PDTRB] & sh4.ioport4_direction);
4354      break;
4355
43174356   case SCBRR2:
43184357      break;
43194358
r1679r1680
43574396      else
43584397         return sh4.m[TCNT2];
43594398      break;
4399
4400      // I/O ports
4401   case PDTRA:
4402      if (sh4.m[BCR2] & 1)
4403         return (io_read_dword_64le(SH4_IOPORT_16) & ~sh4.ioport16_direction) | (sh4.m[PDTRA] & sh4.ioport16_direction);
4404      break;
4405   case PDTRB:
4406      if (sh4.m[BCR2] & 1)
4407         return (io_read_dword_64le(SH4_IOPORT_4) & ~sh4.ioport4_direction) | (sh4.m[PDTRB] & sh4.ioport4_direction);
4408      break;
43604409   }
43614410   return sh4.m[offset];
43624411}
r1679r1680
45394588   const struct sh4_config *conf = config;
45404589
45414590   sh4.timer0 = timer_alloc(sh4_timer0_callback, NULL);
4542   timer_adjust(sh4.timer0, attotime_never, 0, attotime_zero);
4591   timer_adjust_oneshot(sh4.timer0, attotime_never, 0);
45434592   sh4.timer1 = timer_alloc(sh4_timer1_callback, NULL);
4544   timer_adjust(sh4.timer1, attotime_never, 0, attotime_zero);
4593   timer_adjust_oneshot(sh4.timer1, attotime_never, 0);
45454594   sh4.timer2 = timer_alloc(sh4_timer2_callback, NULL);
4546   timer_adjust(sh4.timer2, attotime_never, 0, attotime_zero);
4595   timer_adjust_oneshot(sh4.timer2, attotime_never, 0);
45474596
45484597   sh4.dma_timer[0] = timer_alloc(sh4_dmac_callback, NULL);
4549   timer_adjust(sh4.dma_timer[0], attotime_never, 0, attotime_zero);
4598   timer_adjust_oneshot(sh4.dma_timer[0], attotime_never, 0);
45504599   sh4.dma_timer[1] = timer_alloc(sh4_dmac_callback, NULL);
4551   timer_adjust(sh4.dma_timer[1], attotime_never, 0, attotime_zero);
4600   timer_adjust_oneshot(sh4.dma_timer[1], attotime_never, 0);
45524601   sh4.dma_timer[2] = timer_alloc(sh4_dmac_callback, NULL);
4553   timer_adjust(sh4.dma_timer[2], attotime_never, 0, attotime_zero);
4602   timer_adjust_oneshot(sh4.dma_timer[2], attotime_never, 0);
45544603   sh4.dma_timer[3] = timer_alloc(sh4_dmac_callback, NULL);
4555   timer_adjust(sh4.dma_timer[3], attotime_never, 0, attotime_zero);
4604   timer_adjust_oneshot(sh4.dma_timer[3], attotime_never, 0);
45564605
45574606   sh4.refresh_timer = timer_alloc(sh4_refresh_timer_callback, NULL);
4558   timer_adjust(sh4.refresh_timer, attotime_never, 0, attotime_zero);
4607   timer_adjust_oneshot(sh4.refresh_timer, attotime_never, 0);
45594608   sh4.refresh_timer_base = 0;
45604609
45614610   sh4.rtc_timer = timer_alloc(sh4_rtc_timer_callback, NULL);
4562   timer_adjust(sh4.rtc_timer, attotime_never, 0, attotime_zero);
4611   timer_adjust_oneshot(sh4.rtc_timer, attotime_never, 0);
45634612
45644613   sh4.m = auto_malloc(16384*4);
45654614
r1679r1680
46424691{
46434692UINT32 chcr;
46444693UINT32 *p32bits;
4694UINT64 *p32bytes;
46454695UINT32 pos,len,siz;
46464696
46474697   if (sh4.dma_timer_active[s->channel])
r1679r1680
47224772            return;
47234773      sh4_dma_transfer(s->channel, 0, chcr, &s->source, &s->destination, &len);
47244774   } else {
4725      if ((s->direction) == 0) {
4726         len = s->length;
4727         p32bits = (UINT32 *)(s->buffer);
4728         for (pos = 0;pos < len;pos++) {
4729            *p32bits = program_read_dword_64le(s->source);
4730            p32bits++;
4731            s->source = s->source + 4;
4775      if (s->size == 4) {
4776         if ((s->direction) == 0) {
4777            len = s->length;
4778            p32bits = (UINT32 *)(s->buffer);
4779            for (pos = 0;pos < len;pos++) {
4780               *p32bits = program_read_dword_64le(s->source);
4781               p32bits++;
4782               s->source = s->source + 4;
4783            }
4784         } else {
4785            len = s->length;
4786            p32bits = (UINT32 *)(s->buffer);
4787            for (pos = 0;pos < len;pos++) {
4788               program_write_dword_64le(s->destination, *p32bits);
4789               p32bits++;
4790               s->destination = s->destination + 4;
4791            }
47324792         }
4733      } else {
4734         len = s->length;
4735         p32bits = (UINT32 *)(s->buffer);
4736         for (pos = 0;pos < len;pos++) {
4737            program_write_dword_64le(s->destination, *p32bits);
4738            p32bits++;
4739            s->destination = s->destination + 4;
4793      }
4794      if (s->size == 32) {
4795         if ((s->direction) == 0) {
4796            len = s->length * 4;
4797            p32bytes = (UINT64 *)(s->buffer);
4798            for (pos = 0;pos < len;pos++) {
4799#ifdef LSB_FIRST
4800               *p32bytes = program_read_qword_64le(s->source);
4801#else
4802               *p32bytes = program_read_qword_64be(s->source);
4803#endif
4804               p32bytes++;
4805               s->destination = s->destination + 8;
4806            }
4807         } else {
4808            len = s->length * 4;
4809            p32bytes = (UINT64 *)(s->buffer);
4810            for (pos = 0;pos < len;pos++) {
4811#ifdef LSB_FIRST
4812               program_write_qword_64le(s->destination, *p32bytes);
4813#else
4814               program_write_qword_64be(s->destination, *p32bytes);
4815#endif
4816               p32bytes++;
4817               s->destination = s->destination + 8;
4818            }
47404819         }
47414820      }
47424821   }
r1679r1680
49315010      case CPUINFO_INT_DATABUS_WIDTH + ADDRESS_SPACE_DATA:      info->i = 0;            break;
49325011      case CPUINFO_INT_ADDRBUS_WIDTH + ADDRESS_SPACE_DATA:       info->i = 0;            break;
49335012      case CPUINFO_INT_ADDRBUS_SHIFT + ADDRESS_SPACE_DATA:       info->i = 0;            break;
4934      case CPUINFO_INT_DATABUS_WIDTH + ADDRESS_SPACE_IO:      info->i = 0;               break;
4935      case CPUINFO_INT_ADDRBUS_WIDTH + ADDRESS_SPACE_IO:       info->i = 0;               break;
5013      case CPUINFO_INT_DATABUS_WIDTH + ADDRESS_SPACE_IO:      info->i = 64;               break;
5014      case CPUINFO_INT_ADDRBUS_WIDTH + ADDRESS_SPACE_IO:       info->i = 8;               break;
49365015      case CPUINFO_INT_ADDRBUS_SHIFT + ADDRESS_SPACE_IO:       info->i = 0;               break;
49375016
49385017      case CPUINFO_PTR_INTERNAL_MEMORY_MAP + ADDRESS_SPACE_PROGRAM: info->internal_map = construct_map_sh4_internal_map; break;
src/emu/cpu/sh4/sh4.h
r1679r1680
5454   CPUINFO_PTR_SH4_EXTERNAL_DDT_DMA,
5555};
5656
57enum
58{
59   SH4_IOPORT_16=8*0,
60   SH4_IOPORT_4=8*1,
61   // future use
62   SH4_IOPORT_SCI=8*2,
63   SH4_IOPORT_SCIF=8*3
64};
65
5766struct sh4_config
5867{
5968  int md2;
src/emu/cpu/mips/mips3com.c
r1679r1680
185185      UINT32 compare = mips->cpr[0][COP0_Compare];
186186      UINT32 cyclesleft = compare - count;
187187      attotime newtime = ATTOTIME_IN_CYCLES(((INT64)cyclesleft * 2), cpu_getactivecpu());
188      timer_adjust(mips->compare_int_timer, newtime, cpu_getactivecpu(), attotime_zero);
188      timer_adjust_oneshot(mips->compare_int_timer, newtime, cpu_getactivecpu());
189189   }
190190   else
191      timer_adjust(mips->compare_int_timer, attotime_never, cpu_getactivecpu(), attotime_zero);
191      timer_adjust_oneshot(mips->compare_int_timer, attotime_never, cpu_getactivecpu());
192192}
193193
194194
src/emu/cpu/f8/f3853.c
r1679r1680
5858{
5959   attotime period = (value != 0xff) ? attotime_mul(ATTOTIME_IN_HZ(f3853.config.frequency), f3853_value_to_cycle[value]*31) : attotime_never;
6060
61   timer_adjust(f3853.timer, period, 0, attotime_never);
61   timer_adjust_oneshot(f3853.timer, period, 0);
6262}
6363
6464static TIMER_CALLBACK( f3853_timer_callback )
src/emu/cpu/tms9900/99xxcore.h
r1679r1680
18151815*/
18161816static void reset_decrementer(void)
18171817{
1818   timer_adjust(I.timer, attotime_never, 0, attotime_zero);
1818   timer_adjust_oneshot(I.timer, attotime_never, 0);
18191819
18201820   /* reload count */
18211821   I.decrementer_count = I.decrementer_interval;
r1679r1680
18261826   if (I.decrementer_enabled && ! (I.flag & 1))
18271827      {   /* timer */
18281828      attotime period = ATTOTIME_IN_CYCLES(I.decrementer_interval * 16L, cpu_getactivecpu());
1829      timer_adjust(I.timer, period, 0, period);
1829      timer_adjust_periodic(I.timer, period, 0, period);
18301830   }
18311831}
18321832
src/emu/cpu/arm7/arm7core.c
r1679r1680
322322        if( k == 0 ) /* Register shift by 0 is a no-op */
323323        {
324324//          LOG(("%08x:  NO-OP Regshift\n",R15));
325            /* TODO this is wrong for at least ROR by reg with with lower
326             *      5 bits 0 but lower 8 bits non zero */
325327            if (pCarry) *pCarry = GET_CPSR & C_MASK;
326328            return rm;
327329        }
r1679r1680
387389        if (k)
388390        {
389391            while (k > 32) k -= 32;
390            if (pCarry) *pCarry = rm & SIGN_BIT;
392            if (pCarry) *pCarry = rm & (1 << (k - 1));
391393            return ROR(rm, k);
392394        }
393395        else
394396        {
397            /* RRX */
395398            if (pCarry) *pCarry = (rm & 1);
396399            return LSR(rm, 1) | ((GET_CPSR & C_MASK) << 2);
397400        }
r1679r1680
408411    int i,result;
409412
410413    result = 0;
414    rbv &= ~3;
411415    for( i=0; i<16; i++ )
412416    {
413417        if( (pat>>i)&1 )
r1679r1680
431435    int i,result;
432436
433437    result = 0;
438    rbv &= ~3;
434439    for( i=15; i>=0; i-- )
435440    {
436441        if( (pat>>i)&1 )
r1679r1680
514519
515520    /* start up in SVC mode with interrupts disabled. */
516521    SwitchMode(eARM7_MODE_SVC);
517    SET_CPSR(GET_CPSR | I_MASK | F_MASK);
522    SET_CPSR(GET_CPSR | I_MASK | F_MASK | 0x10);
518523    R15 = 0;
519524   change_pc(R15);
520525}
r1679r1680
544549        SwitchMode(eARM7_MODE_ABT);             /* Set ABT mode so PC is saved to correct R14 bank */
545550        SET_REGISTER( 14, pc );                 /* save PC to R14 */
546551        SET_REGISTER( SPSR, cpsr );             /* Save current CPSR */
552        SET_CPSR(GET_CPSR | I_MASK);            /* Mask IRQ */
547553        SET_CPSR(GET_CPSR & ~T_MASK);
548554        R15 = 0x10;                             /* IRQ Vector address */
549555   change_pc(R15);
r1679r1680
551557        return;
552558    }
553559
554    //FIRQ
560    //FIQ
555561    if (ARM7.pendingFiq && (cpsr & F_MASK)==0) {
556562        SwitchMode(eARM7_MODE_FIQ);             /* Set FIQ mode so PC is saved to correct R14 bank */
557563        SET_REGISTER( 14, pc );                 /* save PC to R14 */
558564        SET_REGISTER( SPSR, cpsr );             /* Save current CPSR */
559        SET_CPSR(GET_CPSR | I_MASK | F_MASK);   /* Mask both IRQ & FIRQ*/
565        SET_CPSR(GET_CPSR | I_MASK | F_MASK);   /* Mask both IRQ & FIQ */
560566        SET_CPSR(GET_CPSR & ~T_MASK);
561567        R15 = 0x1c;                             /* IRQ Vector address */
562568   change_pc(R15);
r1679r1680
580586        SwitchMode(eARM7_MODE_ABT);             /* Set ABT mode so PC is saved to correct R14 bank */
581587        SET_REGISTER( 14, pc );                 /* save PC to R14 */
582588        SET_REGISTER( SPSR, cpsr );             /* Save current CPSR */
589        SET_CPSR(GET_CPSR | I_MASK);            /* Mask IRQ */
583590        SET_CPSR(GET_CPSR & ~T_MASK);
584591        R15 = 0x0c;                             /* IRQ Vector address */
585592   change_pc(R15);
r1679r1680
592599        SwitchMode(eARM7_MODE_UND);             /* Set UND mode so PC is saved to correct R14 bank */
593600        SET_REGISTER( 14, pc );                 /* save PC to R14 */
594601        SET_REGISTER( SPSR, cpsr );             /* Save current CPSR */
602        SET_CPSR(GET_CPSR | I_MASK);            /* Mask IRQ */
595603        SET_CPSR(GET_CPSR & ~T_MASK);
596604        R15 = 0x04;                             /* IRQ Vector address */
597605   change_pc(R15);
r1679r1680
612620           SET_REGISTER( 14, pc );                 /* save PC to R14 */
613621   }
614622        SET_REGISTER( SPSR, cpsr );             /* Save current CPSR */
623        SET_CPSR(GET_CPSR | I_MASK);            /* Mask IRQ */
615624        SET_CPSR(GET_CPSR & ~T_MASK);      /* Go to ARM mode */
616625        R15 = 0x08;            /* Jump to the SWI vector */
617626   change_pc(R15);
r1679r1680
845854            {
846855                R15 = READ32(rnv);
847856                R15 -= 4;
848            change_pc(R15);
857      change_pc(R15);
849858                //LDR, PC takes 2S + 2N + 1I (5 total cycles)
850859                ARM7_ICOUNT -= 2;
851860            }
r1679r1680
11261135    //MSR ( bit 21 set ) - Copy value to CPSR/SPSR
11271136    if( (insn & 0x00200000) )
11281137    {
1129        //MSR (register transfer)?
1130        if(insn & 0x10000)
1131        {
1132            val = GET_REGISTER(insn & 0x0f);
1138        //Immediate Value?
1139        if(insn & INSN_I) {
1140            //Value can be specified for a Right Rotate, 2x the value specified.
1141            int by = (insn & INSN_OP2_ROTATE) >> INSN_OP2_ROTATE_SHIFT;
1142            if (by)
1143                val = ROR(insn & INSN_OP2_IMM, by << 1);
1144            else
1145                val = insn & INSN_OP2_IMM;
11331146        }
1134        //MSR (register or immediate transfer - flag bits only)
1147        //Value from Register
11351148        else
1136        {
1137            //Immediate Value?
1138            if(insn & INSN_I) {
1139                //Value can be specified for a Right Rotate, 2x the value specified.
1140                int by = (insn & INSN_OP2_ROTATE) >> INSN_OP2_ROTATE_SHIFT;
1141                if (by)
1142                    val = ROR(insn & INSN_OP2_IMM, by << 1);
1143                else
1144                    val = insn & INSN_OP2_IMM;
1145            }
1146            //Value from Register
1147            else
1148       {
1149                val = GET_REGISTER(insn & 0x0f);
1150            }
1149   {
1150            val = GET_REGISTER(insn & 0x0f);
11511151        }
11521152
11531153   // apply field code bits
11541154   if (reg == eCPSR)
11551155   {
1156      if ((GET_CPSR & 0x1f) > 0x10)
1156      if (oldmode != eARM7_MODE_USER)
11571157      {
11581158         if (insn & 0x00010000)
11591159         {
r1679r1680
11721172      // status flags can be modified regardless of mode
11731173      if (insn & 0x00080000)
11741174      {
1175         newval = (newval & 0x00ffffff) | (val & 0xff000000);
1175         // TODO for non ARMv5E mask should be 0xf0000000 (ie mask Q bit)
1176         newval = (newval & 0x00ffffff) | (val & 0xf8000000);
11761177      }
11771178   }
11781179   else   // SPSR has stricter requirements
r1679r1680
11931194         }
11941195         if (insn & 0x00080000)
11951196         {
1196            newval = (newval & 0x00ffffff) | (val & 0xff000000);
1197            // TODO for non ARMv5E mask should be 0xf0000000 (ie mask Q bit)
1198            newval = (newval & 0x00ffffff) | (val & 0xf8000000);
11971199         }
11981200      }
11991201   }
src/emu/cpu/arm7/arm7exec.c
r1679r1680
374374                              }
375375                              else
376376                              {
377                                 if ((rrd>>(rs-1))&1)
377                                 if ((rrd>>(rrs-1))&1)
378378                                 {
379379                                    SET_CPSR(GET_CPSR | C_MASK);
380380                                 }
r1679r1680
926926            }
927927            break;
928928         case 0xc: /* Multiple Load/Store */
929            if( insn & THUMB_MULTLS ) /* Load */
930929            {
930               UINT32 ld_st_address;
931
931932               rd = ( insn & THUMB_MULTLS_BASE ) >> THUMB_MULTLS_BASE_SHIFT;
932               for( offs = 0; offs < 8; offs++ )
933               ld_st_address = GET_REGISTER(rd) & 0xfffffffc;
934
935               if( insn & THUMB_MULTLS ) /* Load */
933936               {
934                  if( insn & ( 1 << offs ) )
937                  int rd_in_list;
938
939                  rd_in_list = insn & (1 << rd);
940                  for( offs = 0; offs < 8; offs++ )
935941                  {
936                     SET_REGISTER( offs, READ32( (GET_REGISTER(rd)&0xfffffffc) ) );
937                     SET_REGISTER( rd, GET_REGISTER(rd) + 4 );
942                     if( insn & ( 1 << offs ) )
943                     {
944                        SET_REGISTER(offs, READ32(ld_st_address));
945                        ld_st_address += 4;
946                     }
938947                  }
948                  if (!rd_in_list)
949                     SET_REGISTER(rd, ld_st_address);
950                  R15 += 2;
939951               }
940               R15 += 2;
941            }
942            else /* Store */
943            {
944               rd = ( insn & THUMB_MULTLS_BASE ) >> THUMB_MULTLS_BASE_SHIFT;
945               for( offs = 0; offs < 8; offs++ )
952               else /* Store */
946953               {
947                  if( insn & ( 1 << offs ) )
954                  for( offs = 0; offs < 8; offs++ )
948955                  {
949                     WRITE32( (GET_REGISTER(rd)&0xfffffffc), GET_REGISTER(offs) );
950                     SET_REGISTER( rd, GET_REGISTER(rd) + 4 );
956                     if( insn & ( 1 << offs ) )
957                     {
958                        WRITE32(ld_st_address, GET_REGISTER(offs));
959                        ld_st_address += 4;
960                     }
951961                  }
962                  SET_REGISTER(rd, ld_st_address);
963                  R15 += 2;
952964               }
953               R15 += 2;
954965            }
955966            break;
956967         case 0xd: /* Conditional Branch */
r1679r1680
12681279                if( (insn & 0x0c000000) ==0 )   //bits 27-26 == 00 - This check can only exist properly after Multiplication check above
12691280                {
12701281                    /* PSR Transfer (MRS & MSR) */
1271                    if( ((insn&0x0100000)==0) && ((insn&0x01800000)==0x01000000) ) //( S bit must be clear, and bit 24,23 = 10 )
1282                    if( ((insn&0x00100000)==0) && ((insn&0x01800000)==0x01000000) ) //( S bit must be clear, and bit 24,23 = 10 )
12721283                    {
12731284                        HandlePSRTransfer(insn);
12741285                        ARM7_ICOUNT += 2;       //PSR only takes 1 - S Cycle, so we add + 2, since at end, we -3..
src/emu/cpu/m6800/m6800.c
r1679r1680
25282528            {
25292529               int divisor = M6800_RMCR_SS[m6800.rmcr & M6800_RMCR_SS_MASK];
25302530
2531               timer_adjust(m6800_rx_timer, attotime_zero, cpu_getactivecpu(), ATTOTIME_IN_HZ(m6800.clock / divisor));
2532               timer_adjust(m6800_tx_timer, attotime_zero, cpu_getactivecpu(), ATTOTIME_IN_HZ(m6800.clock / divisor));
2531               timer_adjust_periodic(m6800_rx_timer, attotime_zero, cpu_getactivecpu(), ATTOTIME_IN_HZ(m6800.clock / divisor));
2532               timer_adjust_periodic(m6800_tx_timer, attotime_zero, cpu_getactivecpu(), ATTOTIME_IN_HZ(m6800.clock / divisor));
25332533            }
25342534            break;
25352535         }
src/emu/video/crtc6845.c
r1679r1680
1/**********************************************************************
2
3    Motorola 6845 CRT controller emulation
4
5**********************************************************************/
6
7#include "driver.h"
8#include "crtc6845.h"
9
10
11#define LOG      (0)
12
13
14typedef struct _crtc6845_state crtc6845_state;
15
16struct _crtc6845_state
17{
18   const crtc6845_interface *intf;
19
20   /* internal registers */
21   UINT8   address_latch;
22   UINT8   horiz_total;
23   UINT8   horiz_disp;
24   UINT8   horiz_sync_pos;
25   UINT8   sync_width;
26   UINT8   vert_total;
27   UINT8   vert_total_adj;
28   UINT8   vert_disp;
29   UINT8   vert_sync_pos;
30   UINT8   intl_skew;
31   UINT8   max_ras_addr;
32   UINT8   cursor_start_ras;
33   UINT8   cursor_end_ras;
34   UINT16   start_addr;
35   UINT16   cursor;
36   UINT16   light_pen;
37
38   emu_timer *display_enable_changed_timer;
39
40   /* saved screen parameters so we don't call
41       video_screen_configure() unneccessarily.
42       Do NOT state save these! */
43   UINT16   last_horiz_total;
44   UINT16   last_vert_total;
45   UINT16   last_max_x;
46   UINT16   last_max_y;
47   UINT16  current_ma;      /* the MA address currently drawn */
48   int      has_valid_parameters;
49};
50
51static crtc6845_state crtc6845;
52
53
54static void crtc6845_state_save_postload(void *param);
55static void configure_screen(crtc6845_state *chip, int postload);
56static void update_timer(crtc6845_state *chip);
57static TIMER_CALLBACK( display_enable_changed_timer_cb );
58
59
60void crtc6845_init(void)
61{
62   crtc6845_state *chip = &crtc6845;
63   int which = 0;
64
65   state_save_register_func_postload_ptr(crtc6845_state_save_postload, chip);
66
67   state_save_register_item("crtc6845", which, chip->address_latch);
68   state_save_register_item("crtc6845", which, chip->horiz_total);
69   state_save_register_item("crtc6845", which, chip->horiz_disp);
70   state_save_register_item("crtc6845", which, chip->horiz_sync_pos);
71   state_save_register_item("crtc6845", which, chip->sync_width);
72   state_save_register_item("crtc6845", which, chip->vert_total);
73   state_save_register_item("crtc6845", which, chip->vert_total_adj);
74   state_save_register_item("crtc6845", which, chip->vert_disp);
75   state_save_register_item("crtc6845", which, chip->vert_sync_pos);
76   state_save_register_item("crtc6845", which, chip->intl_skew);
77   state_save_register_item("crtc6845", which, chip->max_ras_addr);
78   state_save_register_item("crtc6845", which, chip->cursor_start_ras);
79   state_save_register_item("crtc6845", which, chip->cursor_end_ras);
80   state_save_register_item("crtc6845", which, chip->start_addr);
81   state_save_register_item("crtc6845", which, chip->cursor);
82   state_save_register_item("crtc6845", which, chip->light_pen);
83
84   /* do not configure the screen */
85   chip->intf = 0;
86   chip->has_valid_parameters = FALSE;
87}
88
89
90void crtc6845_config(int which, const crtc6845_interface *intf)
91{
92   crtc6845_state *chip = &crtc6845;
93
94   memset(chip, 0, sizeof(*chip));
95   crtc6845_init();
96
97   chip->intf = intf;
98
99   /* create the timer if the user is interested in getting display enable
100       notifications */
101   if (intf->display_enable_changed)
102      chip->display_enable_changed_timer = timer_alloc(display_enable_changed_timer_cb, chip);
103}
104
105
106static void crtc6845_state_save_postload(void *param)
107{
108   crtc6845_state *chip = (crtc6845_state *)param;
109
110   configure_screen(chip, TRUE);
111}
112
113
114READ8_HANDLER( crtc6845_register_r )
115{
116   crtc6845_state *chip = &crtc6845;
117
118   UINT8 ret = 0xff;
119
120   switch (chip->address_latch)
121   {
122      case 14:
123         ret = chip->cursor >> 8;
124         break;
125      case 15:
126         ret = chip->cursor;
127         break;
128      case 16:
129         ret = chip->light_pen >> 8;
130         break;
131      case 17:
132         ret = chip->light_pen;
133         break;
134      default:
135         /* all other registers are write only */
136         break;
137   }
138   return ret;
139}
140
141
142WRITE8_HANDLER( crtc6845_address_w )
143{
144   crtc6845_state *chip = &crtc6845;
145
146   chip->address_latch = data & 0x1f;
147}
148
149
150WRITE8_HANDLER( crtc6845_register_w )
151{
152   crtc6845_state *chip = &crtc6845;
153
154   int call_configure_screen = FALSE;
155   if (LOG)  logerror("CRT #0 PC %04x: CRTC6845 reg 0x%02x = 0x%02x\n", activecpu_get_pc(), chip->address_latch, data);
156
157   switch (chip->address_latch)
158   {
159      case 0:
160         chip->horiz_total = data;
161         call_configure_screen = TRUE;
162         break;
163      case 1:
164         chip->horiz_disp = data;
165         call_configure_screen = TRUE;
166         break;
167      case 2:
168         chip->horiz_sync_pos = data;
169         break;
170      case 3:
171         chip->sync_width = data & 0x0f;
172         break;
173      case 4:
174         chip->vert_total = data & 0x7f;
175         call_configure_screen = TRUE;
176         break;
177      case 5:
178         chip->vert_total_adj = data & 0x1f;
179         call_configure_screen = TRUE;
180         break;
181      case 6:
182         chip->vert_disp = data & 0x7f;
183         call_configure_screen = TRUE;
184         break;
185      case 7:
186         chip->vert_sync_pos = data & 0x7f;
187         break;
188      case 8:
189         chip->intl_skew = data & 0x03;
190         break;
191      case 9:
192         chip->max_ras_addr = data & 0x1f;
193         call_configure_screen = TRUE;
194         break;
195      case 10:
196         chip->cursor_start_ras = data & 0x7f;
197         break;
198      case 11:
199         chip->cursor_end_ras = data & 0x1f;
200         break;
201      case 12:
202         chip->start_addr &= 0x00ff;
203         chip->start_addr |= (data & 0x3f) << 8;
204         call_configure_screen = TRUE;
205         break;
206      case 13:
207         chip->start_addr &= 0xff00;
208         chip->start_addr |= data;
209         call_configure_screen = TRUE;
210         break;
211      case 14:
212         chip->cursor &= 0x00ff;
213         chip->cursor |= (data & 0x3f) << 8;
214         break;
215      case 15:
216         chip->cursor &= 0xff00;
217         chip->cursor |= data;
218         break;
219      case 16:   /* read-only */
220         break;
221      case 17:   /* read-only */
222         break;
223      default:
224         break;
225   }
226
227   if (call_configure_screen)
228      configure_screen(chip, FALSE);
229}
230
231
232static void configure_screen(crtc6845_state *chip, int postload)
233{
234   if (chip->intf)
235   {
236      /* compute the screen sizes */
237      UINT16 horiz_total = (chip->horiz_total + 1) * chip->intf->hpixels_per_column;
238      UINT16 vert_total = (chip->vert_total + 1) * (chip->max_ras_addr + 1) + chip->vert_total_adj;
239
240      /* determine the visible area, avoid division by 0 */
241      UINT16 max_x = chip->horiz_disp * chip->intf->hpixels_per_column - 1;
242      UINT16 max_y = chip->vert_disp * (chip->max_ras_addr + 1) - 1;
243
244      /* update only if screen parameters changed, unless we are coming here after loading the saved state */
245      if (postload ||
246          (horiz_total != chip->last_horiz_total) || (vert_total != chip->last_vert_total) ||
247         (max_x != chip->last_max_x) || (max_y != chip->last_max_y))
248      {
249         /* update the screen only if we have valid data */
250         if ((chip->horiz_total > 0) && (max_x < horiz_total) && (chip->vert_total > 0) && (max_y < vert_total))
251         {
252            rectangle visarea;
253
254            attoseconds_t refresh = HZ_TO_ATTOSECONDS(chip->intf->clock) * (chip->horiz_total + 1) * vert_total;
255
256            visarea.min_x = 0;
257            visarea.min_y = 0;
258            visarea.max_x = max_x;
259            visarea.max_y = max_y;
260
261            if (LOG) logerror("CRTC6845 config screen: HTOTAL: %x  VTOTAL: %x  MAX_X: %x  MAX_Y: %x  FPS: %f\n",
262                          horiz_total, vert_total, max_x, max_y, 1 / ATTOSECONDS_TO_DOUBLE(refresh));
263
264            video_screen_configure(chip->intf->scrnum, horiz_total, vert_total, &visarea, refresh);
265
266            chip->has_valid_parameters = TRUE;
267         }
268         else
269            chip->has_valid_parameters = FALSE;
270
271         chip->last_horiz_total = horiz_total;
272         chip->last_vert_total = vert_total;
273         chip->last_max_x = max_x;
274         chip->last_max_y = max_y;
275
276         update_timer(chip);
277      }
278   }
279}
280
281
282static int is_display_enabled(crtc6845_state *chip)
283{
284   UINT16 y = video_screen_get_vpos(chip->intf->scrnum);
285   UINT16 x = video_screen_get_hpos(chip->intf->scrnum);
286
287   return (y <= chip->last_max_y) && (x <= chip->last_max_x);
288}
289
290
291static void update_timer(crtc6845_state *chip)
292{
293   INT16 next_y;
294   UINT16 next_x;
295   attotime duration;
296
297   if (chip->has_valid_parameters && (chip->display_enable_changed_timer != 0))
298   {
299      if (is_display_enabled(chip))
300      {
301         /* we are in a display region,
302               get the location of the next blanking start */
303
304         /* normally, it's at end the current raster line */
305         next_y = video_screen_get_vpos(chip->intf->scrnum);
306         next_x = chip->last_max_x + 1;
307
308         /* but if visible width = horiz_total, then we need
309               to go to the beginning of VBLANK */
310         if (next_x == chip->last_horiz_total)
311         {
312            next_y = chip->last_max_y + 1;
313            next_x = 0;
314
315            /* abnormal case, no vertical blanking, either */
316            if (next_y == chip->last_vert_total)
317               next_y = -1;
318         }
319      }
320      else
321      {
322         /* we are in a blanking region,
323               get the location of the next display start */
324         next_x = 0;
325         next_y = (video_screen_get_vpos(chip->intf->scrnum) + 1) % chip->last_vert_total;
326
327         /* if we would now fall in the vertical blanking, we need
328               to go to the top of the screen */
329         if (next_y > chip->last_max_y)
330            next_y = 0;
331      }
332
333      if (next_y != -1)
334         duration = video_screen_get_time_until_pos(chip->intf->scrnum, next_y, next_x);
335      else
336         duration = attotime_never;
337
338      timer_adjust(chip->display_enable_changed_timer, duration, 0, attotime_never);
339   }
340}
341
342
343static TIMER_CALLBACK( display_enable_changed_timer_cb )
344{
345   crtc6845_state *chip = ptr;
346
347   /* call the callback function -- we know it exists */
348   chip->intf->display_enable_changed(is_display_enabled(chip));
349
350   update_timer(chip);
351}
352
353
354UINT16 crtc6845_get_ma(int which)
355{
356   crtc6845_state *chip = &crtc6845;
357
358   UINT16 ret;
359
360   if (chip->has_valid_parameters)
361   {
362      /* get the current raster positions and clamp them to the visible region */
363      int y = video_screen_get_vpos(0);
364      int x = video_screen_get_hpos(0);
365
366      /* since the MA counter stops in the blanking regions, if we are in a
367           VBLANK, both X and Y are at their max */
368      if ((y > chip->last_max_y) || (x > chip->last_max_x))
369         x = chip->last_max_x;
370
371      if (y > chip->last_max_y)
372         y = chip->last_max_y;
373
374      ret = (chip->start_addr +
375            (y / (chip->max_ras_addr + 1)) * chip->horiz_disp +
376            (x / chip->intf->hpixels_per_column)) & 0x3fff;
377   }
378   else
379      ret = 0;
380
381   return ret;
382}
383
384
385UINT8 crtc6845_get_ra(int which)
386{
387   crtc6845_state *chip = &crtc6845;
388
389   UINT8 ret;
390
391   if (chip->has_valid_parameters)
392   {
393      /* get the current vertical raster position and clamp it to the visible region */
394      int y = video_screen_get_vpos(0);
395
396      if (y > chip->last_max_y)
397         y = chip->last_max_y;
398
399      ret = y % (chip->max_ras_addr + 1);
400   }
401   else
402      ret = 0;
403
404   return ret;
405}
406
407
408VIDEO_UPDATE( crtc6845 )
409{
410   crtc6845_state *chip = &crtc6845;
411
412   if (chip->has_valid_parameters)
413   {
414      UINT16 y;
415
416      /* call the set up function if any */
417      void *param = 0;
418
419      if (chip->intf->begin_update)
420         param = chip->intf->begin_update(machine, screen, bitmap, cliprect);
421
422      /* read the start address at the beginning of the frame */
423      if (cliprect->min_y == 0)
424         chip->current_ma = chip->start_addr;
425
426      /* for each row in the visible region */
427      for (y = cliprect->min_y; y <= cliprect->max_y; y++)
428      {
429         UINT8 ra = y % (chip->max_ras_addr + 1);
430
431         /* call the external system to draw it */
432         chip->intf->update_row(bitmap, cliprect, chip->current_ma, ra, y, chip->horiz_disp, param);
433
434         /* update MA if the last raster address */
435         if (ra == chip->max_ras_addr)
436            chip->current_ma = (chip->current_ma + chip->horiz_disp) & 0x3fff;
437      }
438
439      /* call the tear down function if any */
440      if (chip->intf->end_update)
441         chip->intf->end_update(bitmap, cliprect, param);
442   }
443
444   return 0;
445}
src/emu/video/crtc6845.h
r1679r1680
1/**********************************************************************
2
3    Motorola 6845 CRT controller emulation
4
5**********************************************************************/
6
7
8typedef struct _crtc6845_interface crtc6845_interface;
9struct _crtc6845_interface
10{
11   int scrnum;               /* screen we are acting on */
12   int clock;               /* the clock (pin 21) of the chip */
13   int hpixels_per_column;      /* number of pixels per video memory address */
14
15   /* if specified, this gets called before any pixel update,
16       optionally return a pointer that will be passed to the
17       update and tear down callbacks */
18   void * (*begin_update)(running_machine *machine, int screen,
19                     mame_bitmap *bitmap, const rectangle *cliprect);
20
21   /* this gets called for every row, the driver must output
22       x_count * hpixels_per_column pixels */
23   void (*update_row)(mame_bitmap *bitmap, const rectangle *cliprect,
24                  UINT16 ma, UINT8 ra, UINT16 y, UINT8 x_count, void *param);
25
26   /* if specified, this gets called after all row updating is complete */
27   void (*end_update)(mame_bitmap *bitmap, const rectangle *cliprect, void *param);
28
29   /* if specified, this gets called for every change of the disply enable (DT pin 18) */
30   void (*display_enable_changed)(int display_enabled);
31};
32
33
34/* Deprectated - use crtc6845_init to set up for save states only, but not to configure the screen */
35void crtc6845_init(void);
36
37/* use crtc6845_init to set up for save states AND to configure the screen
38   the 'which' argument is currently a dummy as only one instance is supported */
39void crtc6845_config(int which, const crtc6845_interface *intf);
40
41/* selects one of the registers for reading or writing */
42WRITE8_HANDLER( crtc6845_address_w );
43#define crtc6845_0_address_w  crtc6845_address_w
44
45/* reads the currently selected register */
46READ8_HANDLER( crtc6845_register_r );
47#define crtc6845_0_register_r  crtc6845_register_r
48
49/* writes the currently selected register */
50WRITE8_HANDLER( crtc6845_register_w );
51#define crtc6845_0_register_w  crtc6845_register_w
52
53/* return the current value on the MA0-MA13 pins */
54UINT16 crtc6845_get_ma(int which);
55
56/* return the current value on the RA0-RA4 pins */
57UINT8 crtc6845_get_ra(int which);
58
59/* updates the screen -- this will call begin_update(),
60   followed by update_row() reapeatedly and after all row
61   updating is complete, end_update() */
62VIDEO_UPDATE( crtc6845 );
src/emu/video/tms34061.c
r1679r1680
147147static TIMER_CALLBACK( tms34061_interrupt )
148148{
149149   /* set timer for next frame */
150   timer_adjust(tms34061.timer, video_screen_get_frame_period(tms34061.intf.scrnum), 0, attotime_zero);
150   timer_adjust_oneshot(tms34061.timer, video_screen_get_frame_period(tms34061.intf.scrnum), 0);
151151
152152   /* set the interrupt bit in the status reg */
153153   tms34061.regs[TMS34061_STATUS] |= 1;
r1679r1680
193193         if (scanline < 0)
194194            scanline += tms34061.regs[TMS34061_VERTOTAL];
195195
196         timer_adjust(tms34061.timer, video_screen_get_time_until_pos(tms34061.intf.scrnum, scanline, tms34061.regs[TMS34061_HORSTARTBLNK]), 0, attotime_zero);
196         timer_adjust_oneshot(tms34061.timer, video_screen_get_time_until_pos(tms34061.intf.scrnum, scanline, tms34061.regs[TMS34061_HORSTARTBLNK]), 0);
197197         break;
198198
199199      /* XY offset: set the X and Y masks */
src/emu/video/voodoo.c
r1679r1680
10871087   /* if zero, adjust to next frame, otherwise we may get stuck in an infinite loop */
10881088   if (attotime_compare(vblank_period, attotime_zero) == 0)
10891089      vblank_period = video_screen_get_frame_period(v->scrnum);
1090   timer_adjust(v->fbi.vblank_timer, vblank_period, 0, attotime_never);
1090   timer_adjust_oneshot(v->fbi.vblank_timer, vblank_period, 0);
10911091}
10921092
10931093
r1679r1680
21942194   /* if not, set a timer for the next one */
21952195   else
21962196   {
2197      timer_adjust(v->pci.continue_timer, attotime_sub(v->pci.op_end_time, current_time), 0, attotime_never);
2197      timer_adjust_oneshot(v->pci.continue_timer, attotime_sub(v->pci.op_end_time, current_time), 0);
21982198   }
21992199}
22002200
r1679r1680
22152215      cpu_spinuntil_trigger(v->trigger);
22162216
22172217   /* set a timer to clear the stall */
2218   timer_adjust(v->pci.continue_timer, attotime_sub(v->pci.op_end_time, current_time), 0, attotime_never);
2218   timer_adjust_oneshot(v->pci.continue_timer, attotime_sub(v->pci.op_end_time, current_time), 0);
22192219}
22202220
22212221
src/emu/video/s2636.c
r1679r1680
1/*************************************************************
2 *                                                           *
3 * Signetics 2636 video chip                                 *
4 *                                                           *
5 *************************************************************
1/**********************************************************************
62
7 PVI REGISTER DESCRIPTION
8 ------------------------
3    Signetics 2636 video chip
94
10       |              bit              |R/W| description
11 byte  | 7 | 6 | 5 | 4 | 3 | 2 | 1 | 0 |   |
12       |                               |   |
13 FC0   | size 4| size 3| size 2| size 1| W | size of the 4 objects(=sprites)
14       |                               |   |
15 FC1   |       |C1 |C2 |C3 |C1 |C2 |C3 | W | colours of the 4 objects
16       |       |  colour 1 |  colour 2 |   |
17 FC2   |       |C1 |C2 |C3 |C1 |C2 |C3 | W |
18       |       |  colour 3 |  colour 4 |   |
19       |                               |   |
20 FC3   |                       |sh |pos| W | 1=shape 0=position
21       |                               |   | display format and position
22 FC4   |            (free)             |   |
23 FC5   |            (free)             |   |
24       |                               |   |
25 FC6   |   |C1 |C2 |C3 |BG |scrn colr  | W | background lock and colour
26       |   |backg colr |enb|C1 |C2 |C3 |   | 3="enable"
27       |                               |   |
28 FC7   |            sound              | W | squarewave output
29       |                               |   |
30 FC8   |       N1      |      N2       | W | range of the 4 display digits
31 FC9   |       N3      |      N4       | W |
32       |                               |   |
33       |obj/backgrnd   |complete object| R |
34 FCA   | 1 | 2 | 3 | 4 | 1 | 2 | 3 | 4 |   |
35       |                               |   |
36 FCB   |   |VR-|   object collisions   | R | Composition of object and back-
37       |   |LE |1/2|1/3|1/3|1/4|2/4|3/4|   | ground,collision detection and
38       |                               |   | object display as a state display
39       |                               |   | for the status register.Set VRLE.
40       |                               |   | wait for VRST.Read out or transmit
41       |                               |   | [copy?] all bits until reset by
42       |                               |   | VRST.
43       |                               |   |
44 FCC   |            PORT1              | R | PORT1 and PORT2 for the range of
45 FCD   |            PORT2              |   | the A/D conversion.Cleared by VRST
46 FCE   |            (free)             |   |
47 FCF   |            (free)             |   |
5    Copyright Nicola Salmoria and the MAME Team.
6    Visit http://mamedev.org for licensing and usage restrictions.
487
498
50 Size control by byte FC0
9    PVI REGISTER DESCRIPTION
10    ------------------------
5111
52  bit  matrix
53 |0|0|  8x10
54 |0|1| 16x20
55 |1|0| 32x40
56 |1|1| 64x80
12          |              bit              |R/W| description
13    byte  | 7 | 6 | 5 | 4 | 3 | 2 | 1 | 0 |   |
14          |                               |   |
15    FC0   | size 4| size 3| size 2| size 1| W | size of the 4 objects(=sprites)
16          |                               |   |
17    FC1   |       |C1 |C2 |C3 |C1 |C2 |C3 | W | colors of the 4 objects
18          |       |  color 1  |  color 2  |   |
19    FC2   |       |C1 |C2 |C3 |C1 |C2 |C3 | W |
20          |       |  color 3  |  color 4  |   |
21          |                               |   |
22    FC3   |                       |sh |pos| W | 1=shape 0=position
23          |                               |   | display format and position
24    FC4   |            (free)             |   |
25    FC5   |            (free)             |   |
26          |                               |   |
27    FC6   |   |C1 |C2 |C3 |BG |scrn colr  | W | background lock and color
28          |   |backg colr |enb|C1 |C2 |C3 |   | 3="enable"
29          |                               |   |
30    FC7   |            sound              | W | squarewave output
31          |                               |   |
32    FC8   |       N1      |      N2       | W | range of the 4 display digits
33    FC9   |       N3      |      N4       | W |
34          |                               |   |
35          |obj/backgrnd   |complete object| R |
36    FCA   | 1 | 2 | 3 | 4 | 1 | 2 | 3 | 4 |   |
37          |                               |   |
38    FCB   |   |VR-|   object collisions   | R | Composition of object and back-
39          |   |LE |1/2|1/3|1/3|1/4|2/4|3/4|   | ground,collision detection and
40          |                               |   | object display as a state display
41          |                               |   | for the status register.Set VRLE.
42          |                               |   | wait for VRST.Read out or transmit
43          |                               |   | [copy?] all bits until reset by
44          |                               |   | VRST.
45          |                               |   |
46    FCC   |            PORT1              | R | PORT1 and PORT2 for the range of
47    FCD   |            PORT2              |   | the A/D conversion.Cleared by VRST
48    FCE   |            (free)             |   |
49    FCF   |            (free)             |   |
5750
58 CE1 and not-CE2 are outputs from the PVI.$E80..$EFF also controls the
59 analogue multiplexer.
6051
52    Size control by byte FC0
6153
62 SPRITES
63 -------
54     bit  matrix
55    |0|0|  8x10
56    |0|1| 16x20
57    |1|0| 32x40
58    |1|1| 64x80
6459
65 each object field: (=sprite data structure)
60    CE1 and not-CE2 are outputs from the PVI.$E80..$EFF also controls the
61    analog multiplexer.
6662
67 0 \ 10 bytes of bitmap (Each object is 8 pixels wide.)
68 9 /
69 A   HC  horizontal object coordinate
70 B   HCB horizontal dublicate coordinate
71 C   VC  vertical object coordinate
72 D   VCB vertical dublicate coordinate
7363
74 *************************************************************/
64    SPRITES
65    -------
7566
67    each object field: (=sprite data structure)
68
69    0 \ 10 bytes of bitmap (Each object is 8 pixels wide.)
70    9 /
71    A   HC  horizontal object coordinate
72    B   HCB horizontal duplicate coordinate
73    C   VC  vertical object coordinate
74    D   VCB vertical duplicate coordinate
75
76*************************************************************/
77
7678#include "driver.h"
7779#include "s2636.h"
7880
79static const int sprite_offsets[4] = { 0x00, 0x10, 0x20, 0x40};
8081
81/* To adjust sprites against bitmap */
8282
83UINT8 *s2636_1_ram;
84UINT8 *s2636_2_ram;
85UINT8 *s2636_3_ram;
83/*************************************
84 *
85 *  Constants
86 *
87 *************************************/
8688
87mame_bitmap *s2636_1_bitmap;
88mame_bitmap *s2636_2_bitmap;
89mame_bitmap *s2636_3_bitmap;
89#define SPRITE_WIDTH   (8)
90#define SPRITE_HEIGHT   (10)
9091
91int s2636_x_offset;
92int s2636_y_offset;
92static const int sprite_offsets[4] = { 0x00, 0x10, 0x20, 0x40 };
9393
94const gfx_layout s2636_gfx_layout =
94
95
96/*************************************
97 *
98 *  Internal S2636 data structure
99 *
100 *************************************/
101
102struct _s2636_t
95103{
96   8,10,
97   5,
98   1,
99   { 0 },
100   { 0, 1, 2, 3, 4, 5, 6, 7 },
101      { 0*8, 1*8, 2*8, 3*8, 4*8, 5*8, 6*8, 7*8, 8*8, 9*8 },
102   8*16
104   UINT8 *work_ram;
105   int y_offset;
106   int x_offset;
107
108   mame_bitmap *bitmap;
109   mame_bitmap *collision_bitmap;
103110};
104111
105112
106/*****************************************/
107/* Check for Collision between 2 sprites */
108/*****************************************/
109113
110static int SpriteCheck(running_machine *machine, int first,int second,UINT8 *workram,int Graphics_Bank,mame_bitmap *collision_bitmap)
114/*************************************
115 *
116 *  Configuration
117 *
118 *************************************/
119
120s2636_t *s2636_config(UINT8 *work_ram, int screen_height, int screen_width, int y_offset, int x_offset)
111121{
112   int Checksum=0;
113   int x,y;
122   s2636_t *s2636;
114123
115    // Does not check shadow sprites yet
124   /* allocate the object that holds the state */
125   s2636 = auto_malloc(sizeof(*s2636));
116126
117    if((workram[sprite_offsets[first] + 10] != 0xff) && (workram[sprite_offsets[second] + 10] != 0xff))
118    {
119       int fx1 = workram[sprite_offsets[first] + 10] + s2636_x_offset;
120        int fy1 = workram[sprite_offsets[first] + 12] + s2636_y_offset;
121      int fx2 = workram[sprite_offsets[second] + 10] + s2636_x_offset;
122      int fy2 = workram[sprite_offsets[second] + 12] + s2636_y_offset;
127   s2636->work_ram = work_ram;
128   s2636->y_offset = y_offset;
129   s2636->x_offset = x_offset;
123130
124        if((fx1>=0) && (fy1>=0) && (fx2>=0) && (fy2>=0))
131   s2636->bitmap = auto_bitmap_alloc(screen_width, screen_height, BITMAP_FORMAT_INDEXED8);
132   s2636->collision_bitmap = auto_bitmap_alloc(screen_width, screen_height, BITMAP_FORMAT_INDEXED8);
133
134   return s2636;
135}
136
137
138
139/*************************************
140 *
141 *  Draw a sprite
142 *
143 *************************************/
144
145static void draw_sprite(UINT8 *gfx, int color, int y, int x, int expand,
146                  int or_mode, mame_bitmap *bitmap, const rectangle *cliprect)
147{
148   int sy;
149
150   /* for each row */
151   for (sy = 0; sy < SPRITE_HEIGHT; sy++)
152   {
153      int sx;
154
155      /* for each pixel on the row */
156      for (sx = 0; sx < SPRITE_WIDTH; sx++)
125157      {
126            int expand1 = 1 << (16+((workram[0xC0]>>(first<<1)) & 3));
127            int expand2 = 1 << (16+((workram[0xC0]>>(second<<1)) & 3));
158         int ey;
128159
129           int char1   = sprite_offsets[first]>>4;
130           int char2   = sprite_offsets[second]>>4;
160         /* each pixel can be expanded */
161         for (ey = 0; ey <= expand; ey++)
162         {
163            int ex;
131164
132            /* Draw first sprite */
165            for (ex = 0; ex <= expand; ex++)
166            {
167               /* compute effective destination pixel */
168               int ty = y + sy * (expand + 1) + ey;
169               int tx = x + sx * (expand + 1) + ex;
133170
134          drawgfxzoom(collision_bitmap,machine->gfx[Graphics_Bank],
135                      char1,
136                     1,
137                      0,0,
138                      fx1,fy1,
139                      &machine->screen[0].visarea, TRANSPARENCY_PEN, 0,
140                    expand1,expand1);
171               /* get out if outside the drawing region */
172               if ((tx < cliprect->min_x) ||
173                  (tx > cliprect->max_x) ||
174                  (ty < cliprect->min_y) ||
175                  (ty > cliprect->max_y))
176                  continue;
141177
142            /* Get fingerprint */
178               /* get out if current image bit is transparent */
179               if (((gfx[sy] << sx) & 0x80) == 0x00)
180                  continue;
143181
144           for (x = fx1; x < fx1 + machine->gfx[Graphics_Bank]->width; x++)
145           {
146              for (y = fy1; y < fy1 + machine->gfx[Graphics_Bank]->height; y++)
147                {
148                 if ((x < machine->screen[0].visarea.min_x) ||
149                     (x > machine->screen[0].visarea.max_x) ||
150                     (y < machine->screen[0].visarea.min_y) ||
151                     (y > machine->screen[0].visarea.max_y))
152                 {
153                    continue;
154                 }
182               if (or_mode)
183                  *BITMAP_ADDR8(bitmap, ty, tx) = 0x08 | *BITMAP_ADDR8(bitmap, ty, tx) | color;
184               else
185                  *BITMAP_ADDR8(bitmap, ty, tx) = 0x08 | color;
186            }
187         }
188      }
189   }
190}
155191
156                   Checksum += *BITMAP_ADDR8(collision_bitmap, y, x);
157                }
158           }
159192
160            /* Blackout second sprite */
161193
162          drawgfxzoom(collision_bitmap,machine->gfx[Graphics_Bank],
163                      char2,
164                     0,
165                      0,0,
166                    fx2,fy2,
167                      &machine->screen[0].visarea, TRANSPARENCY_PEN, 0,
168                    expand2,expand2);
194/*************************************
195 *
196 *  Collision detection
197 *
198 *************************************/
169199
170            /* Remove fingerprint */
200static int check_collision(s2636_t *s2636, int spriteno1, int spriteno2, const rectangle *cliprect)
201{
202   int checksum = 0;
171203
172           for (x = fx1; x < fx1 + machine->gfx[Graphics_Bank]->width; x++)
173           {
174              for (y = fy1; y < fy1 + machine->gfx[Graphics_Bank]->height; y++)
175                {
176                 if ((x < machine->screen[0].visarea.min_x) ||
177                     (x > machine->screen[0].visarea.max_x) ||
178                     (y < machine->screen[0].visarea.min_y) ||
179                     (y > machine->screen[0].visarea.max_y))
180                 {
181                    continue;
182                 }
204   UINT8* attr1 = &s2636->work_ram[sprite_offsets[spriteno1]];
205   UINT8* attr2 = &s2636->work_ram[sprite_offsets[spriteno2]];
183206
184                   Checksum -= *BITMAP_ADDR8(collision_bitmap, y, x);
185                }
186           }
207   /* TODO: does not check shadow sprites yet */
187208
188            /* Zero bitmap */
209   fillbitmap(s2636->collision_bitmap, 0, cliprect);
189210
190          drawgfxzoom(collision_bitmap,machine->gfx[Graphics_Bank],
191                      char1,
192                     0,
193                      0,0,
194                      fx1,fy1,
195                      &machine->screen[0].visarea, TRANSPARENCY_PEN, 0,
196                    expand1,expand1);
197            }
198    }
211   if ((attr1[0x0a] != 0xff) && (attr2[0x0a] != 0xff))
212   {
213      int x, y;
199214
200   return Checksum;
215      int x1 = attr1[0x0a] + s2636->x_offset;
216      int y1 = attr1[0x0c] + s2636->y_offset;
217      int x2 = attr2[0x0a] + s2636->x_offset;
218      int y2 = attr2[0x0c] + s2636->y_offset;
219
220      int expand1 = (s2636->work_ram[0xc0] >> (spriteno1 << 1)) & 0x03;
221      int expand2 = (s2636->work_ram[0xc0] >> (spriteno2 << 1)) & 0x03;
222
223      /* draw first sprite */
224      draw_sprite(attr1, 1, y1, x1, expand1, FALSE, s2636->collision_bitmap, cliprect);
225
226      /* get fingerprint */
227      for (x = x1; x < x1 + SPRITE_WIDTH; x++)
228         for (y = y1; y < y1 + SPRITE_HEIGHT; y++)
229         {
230            if ((x < cliprect->min_x) ||
231               (x > cliprect->max_x) ||
232               (y < cliprect->min_y) ||
233               (y > cliprect->max_y))
234               continue;
235
236            checksum = checksum + *BITMAP_ADDR8(s2636->collision_bitmap, y, x);
237         }
238
239      /* black out second sprite */
240      draw_sprite(attr2, 0, y2, x2, expand2, FALSE, s2636->collision_bitmap, cliprect);
241
242      /* remove fingerprint */
243      for (x = x1; x < x1 + SPRITE_WIDTH; x++)
244         for (y = y1; y < y1 + SPRITE_HEIGHT; y++)
245         {
246            if ((x < cliprect->min_x) ||
247               (x > cliprect->max_x) ||
248               (y < cliprect->min_y) ||
249               (y > cliprect->max_y))
250               continue;
251
252            checksum = checksum - *BITMAP_ADDR8(s2636->collision_bitmap, y, x);
253         }
254   }
255
256   return (checksum != 0);
201257}
202258
203void s2636_update_bitmap(running_machine *machine,mame_bitmap *bitmap,UINT8 *workram,int Graphics_Bank,mame_bitmap *collision_bitmap)
259
260
261/*************************************
262 *
263 *  Main drawing
264 *
265 *************************************/
266
267mame_bitmap *s2636_update(s2636_t *s2636, const rectangle *cliprect)
204268{
205   int CollisionSprite = 0;
206    int spriteno;
207    int offs;
269   UINT8 collision = 0;
270   int spriteno;
208271
209    for(spriteno=0;spriteno<4;spriteno++)
210    {
211       offs = sprite_offsets[spriteno];
272   fillbitmap(s2636->bitmap, 0, cliprect);
212273
213       if(workram[offs+10]!=0xFF)
214      {
215         int charno   = offs>>4;
216           int expand   = 1 << (16+((workram[0xC0]>>(spriteno<<1)) & 3));
217            int bx       = workram[offs+10] + s2636_x_offset;
218            int by       = workram[offs+12] + s2636_y_offset;
274   for (spriteno = 0; spriteno < 4; spriteno++)
275   {
276      int color, expand, x, y;
219277
220            if((bx >= 0) && (by >= 0))
221            {
222                /* Get colour and mask correct bits */
278      UINT8* attr = &s2636->work_ram[sprite_offsets[spriteno]];
223279
224                int colour   = workram[0xC1 + (spriteno >> 1)];
280      /* get out if sprite is turned off */
281      if (attr[0x0a] == 0xff)
282         continue;
225283
226                if((spriteno & 1)==0) colour >>= 3;
284      x = attr[0x0a] + s2636->x_offset;
285      y = attr[0x0c] + s2636->y_offset;
227286
228                colour = (colour & 7) + 7;
287      color = (s2636->work_ram[0xc1 + (spriteno >> 1)] >> ((spriteno & 1) ? 0 : 3)) & 0x07;
288      expand = (s2636->work_ram[0xc0] >> (spriteno << 1)) & 0x03;
229289
230            decodechar(machine->gfx[Graphics_Bank],charno,workram);
290      draw_sprite(attr, color, y, x, expand, TRUE, s2636->bitmap, cliprect);
231291
232              drawgfxzoom(bitmap,machine->gfx[Graphics_Bank],
233                         charno,
234                        colour,
235                         0,0,
236                         bx,by,
237                         &machine->screen[0].visarea,
238                     TRANSPARENCY_BLEND_RAW, 0,
239                       expand,expand);
292      /* bail if no shadow sprites */
293      if ((attr[0x0b] == 0xff) || (attr[0x0d] == 0xfe))
294         continue;
240295
241             /* Shadow Sprites */
296      x = attr[0x0b] + s2636->x_offset;
242297
243                if((workram[offs+11]!=0xff) && (workram[offs+13]!=0xfe))
244                {
245                   bx=workram[offs+11] + s2636_x_offset;
298      while (y < 0xff)
299      {
300         y = y + SPRITE_HEIGHT + attr[0x0d];
246301
247                    if(bx >= 0)
248                    {
249                      for(;by < 255;)
250                   {
251                      by=by+10+workram[offs+13];
302         draw_sprite(attr, color, y, x, expand, TRUE, s2636->bitmap, cliprect);
303      }
304   }
252305
253                        drawgfxzoom(bitmap,machine->gfx[Graphics_Bank],
254                                   charno,
255                                  colour,
256                                   0,0,
257                                   bx,by,
258                                   &machine->screen[0].visarea,
259                              TRANSPARENCY_BLEND_RAW, 0,
260                                 expand,expand);
261                       }
262                    }
263                }
264            }
265        }
266    }
306   /* collision detection */
307   if (check_collision(s2636, 0, 1, cliprect))  collision |= 0x20;
308   if (check_collision(s2636, 0, 2, cliprect))  collision |= 0x10;
309   if (check_collision(s2636, 0, 3, cliprect))  collision |= 0x08;
310   if (check_collision(s2636, 1, 2, cliprect))  collision |= 0x04;
311   if (check_collision(s2636, 1, 3, cliprect))  collision |= 0x02;
312   if (check_collision(s2636, 2, 3, cliprect))  collision |= 0x01;
267313
268    /* Sprite->Sprite collision detection */
314   s2636->work_ram[0xcb] = collision;
269315
270    if(SpriteCheck(machine,0,1,workram,Graphics_Bank,collision_bitmap)) CollisionSprite |= 0x20;
271    if(SpriteCheck(machine,0,2,workram,Graphics_Bank,collision_bitmap)) CollisionSprite |= 0x10;
272    if(SpriteCheck(machine,0,3,workram,Graphics_Bank,collision_bitmap)) CollisionSprite |= 0x08;
273    if(SpriteCheck(machine,1,2,workram,Graphics_Bank,collision_bitmap)) CollisionSprite |= 0x04;
274    if(SpriteCheck(machine,1,3,workram,Graphics_Bank,collision_bitmap)) CollisionSprite |= 0x02;
275    if(SpriteCheck(machine,2,3,workram,Graphics_Bank,collision_bitmap)) CollisionSprite |= 0x01;
276
277    workram[0xCB] = CollisionSprite;
316   return s2636->bitmap;
278317}
src/emu/video/mc6845.c
r0r1680
1/**********************************************************************
2
3    Motorola MC6845 and compatible CRT controller emulation
4
5    Copyright Nicola Salmoria and the MAME Team.
6    Visit http://mamedev.org for licensing and usage restrictions.
7
8    The following variations exist that are different in
9    functionality and not just in speed rating(1):
10        * Motorola 6845, 6845-1
11        * Hitachi 46505
12        * Rockwell 6545, 6545-1 (= Synertek SY6545-1)
13        * Commodore 6545-1
14
15    (1) as per the document at
16    http://www.6502.org/users/andre/hwinfo/crtc/diffs.html
17
18**********************************************************************/
19
20#include "driver.h"
21#include "mc6845.h"
22
23
24#define LOG      (0)
25
26
27struct _mc6845_t
28{
29   const mc6845_interface *intf;
30
31   /* internal registers */
32   UINT8   address_latch;
33   UINT8   horiz_total;
34   UINT8   horiz_disp;
35   UINT8   horiz_sync_pos;
36   UINT8   sync_width;
37   UINT8   vert_total;
38   UINT8   vert_total_adj;
39   UINT8   vert_disp;
40   UINT8   vert_sync_pos;
41   UINT8   intl_skew;
42   UINT8   max_ras_addr;
43   UINT8   cursor_start_ras;
44   UINT8   cursor_end_ras;
45   UINT16   start_addr;
46   UINT16   cursor;
47   UINT16   light_pen;
48
49   emu_timer *display_enable_changed_timer;
50
51   /* saved screen parameters so we don't call
52       video_screen_configure() unneccessarily.
53       Do NOT state save these! */
54   UINT16   last_horiz_total;
55   UINT16   last_vert_total;
56   UINT16   last_max_x;
57   UINT16   last_max_y;
58   UINT16  current_ma;      /* the MA address currently drawn */
59   int      has_valid_parameters;
60};
61
62
63static void mc6845_state_save_postload(void *param);
64static void configure_screen(mc6845_t *mc6845, int postload);
65static void update_timer(mc6845_t *mc6845);
66static TIMER_CALLBACK( display_enable_changed_timer_cb );
67
68
69mc6845_t *mc6845_config(const mc6845_interface *intf)
70{
71   mc6845_t *mc6845;
72
73   /* allocate the object that holds the state */
74   mc6845 = auto_malloc(sizeof(*mc6845));
75   memset(mc6845, 0, sizeof(*mc6845));
76
77   mc6845->intf = intf;
78
79   /* create the timer if the user is interested in getting display enable
80       notifications */
81   if (intf && intf->display_enable_changed)
82      mc6845->display_enable_changed_timer = timer_alloc(display_enable_changed_timer_cb, mc6845);
83
84   /* register for state saving */
85   state_save_register_func_postload_ptr(mc6845_state_save_postload, mc6845);
86
87   state_save_register_item("mc6845", 0, mc6845->address_latch);
88   state_save_register_item("mc6845", 0, mc6845->horiz_total);
89   state_save_register_item("mc6845", 0, mc6845->horiz_disp);
90   state_save_register_item("mc6845", 0, mc6845->horiz_sync_pos);
91   state_save_register_item("mc6845", 0, mc6845->sync_width);
92   state_save_register_item("mc6845", 0, mc6845->vert_total);
93   state_save_register_item("mc6845", 0, mc6845->vert_total_adj);
94   state_save_register_item("mc6845", 0, mc6845->vert_disp);
95   state_save_register_item("mc6845", 0, mc6845->vert_sync_pos);
96   state_save_register_item("mc6845", 0, mc6845->intl_skew);
97   state_save_register_item("mc6845", 0, mc6845->max_ras_addr);
98   state_save_register_item("mc6845", 0, mc6845->cursor_start_ras);
99   state_save_register_item("mc6845", 0, mc6845->cursor_end_ras);
100   state_save_register_item("mc6845", 0, mc6845->start_addr);
101   state_save_register_item("mc6845", 0, mc6845->cursor);
102   state_save_register_item("mc6845", 0, mc6845->light_pen);
103
104   return mc6845;
105}
106
107
108static void mc6845_state_save_postload(void *param)
109{
110   mc6845_t *mc6845 = (mc6845_t *)param;
111
112   configure_screen(mc6845, TRUE);
113}
114
115
116void mc6845_address_w(mc6845_t *mc6845, UINT8 data)
117{
118   mc6845->address_latch = data & 0x1f;
119}
120
121
122UINT8 mc6845_register_r(mc6845_t *mc6845)
123{
124   UINT8 ret = 0;
125
126   switch (mc6845->address_latch)
127   {
128      case 12:
129         /* Motorola version only */
130         ret = mc6845->start_addr >> 8;
131         break;
132      case 13:
133         /* Motorola version only */
134         ret = mc6845->start_addr;
135         break;
136      case 14:
137         ret = mc6845->cursor >> 8;
138         break;
139      case 15:
140         ret = mc6845->cursor;
141         break;
142      case 16:
143         ret = mc6845->light_pen >> 8;
144         break;
145      case 17:
146         ret = mc6845->light_pen;
147         break;
148      default:
149         /* all other registers are write only */
150         break;
151   }
152
153   return ret;
154}
155
156
157void mc6845_register_w(mc6845_t *mc6845, UINT8 data)
158{
159   int call_configure_screen = FALSE;
160   if (LOG)  logerror("CRT #0 PC %04x: CRTC6845 reg 0x%02x = 0x%02x\n", activecpu_get_pc(), mc6845->address_latch, data);
161
162   switch (mc6845->address_latch)
163   {
164      case 0:
165         mc6845->horiz_total = data;
166         call_configure_screen = TRUE;
167         break;
168      case 1:
169         mc6845->horiz_disp = data;
170         call_configure_screen = TRUE;
171         break;
172      case 2:
173         mc6845->horiz_sync_pos = data;
174         break;
175      case 3:
176         mc6845->sync_width = data & 0x0f;
177         break;
178      case 4:
179         mc6845->vert_total = data & 0x7f;
180         call_configure_screen = TRUE;
181         break;
182      case 5:
183         mc6845->vert_total_adj = data & 0x1f;
184         call_configure_screen = TRUE;
185         break;
186      case 6:
187         mc6845->vert_disp = data & 0x7f;
188         call_configure_screen = TRUE;
189         break;
190      case 7:
191         mc6845->vert_sync_pos = data & 0x7f;
192         break;
193      case 8:
194         mc6845->intl_skew = data & 0x03;
195         break;
196      case 9:
197         mc6845->max_ras_addr = data & 0x1f;
198         call_configure_screen = TRUE;
199         break;
200      case 10:
201         mc6845->cursor_start_ras = data & 0x7f;
202         break;
203      case 11:
204         mc6845->cursor_end_ras = data & 0x1f;
205         break;
206      case 12:
207         mc6845->start_addr &= 0x00ff;
208         mc6845->start_addr |= (data & 0x3f) << 8;
209         call_configure_screen = TRUE;
210         break;
211      case 13:
212         mc6845->start_addr &= 0xff00;
213         mc6845->start_addr |= data;
214         call_configure_screen = TRUE;
215         break;
216      case 14:
217         mc6845->cursor &= 0x00ff;
218         mc6845->cursor |= (data & 0x3f) << 8;
219         break;
220      case 15:
221         mc6845->cursor &= 0xff00;
222         mc6845->cursor |= data;
223         break;
224      case 16:   /* read-only */
225         break;
226      case 17:   /* read-only */
227         break;
228      default:
229         break;
230   }
231
232   if (call_configure_screen)
233      configure_screen(mc6845, FALSE);
234}
235
236
237static void configure_screen(mc6845_t *mc6845, int postload)
238{
239   if (mc6845->intf)
240   {
241      /* compute the screen sizes */
242      UINT16 horiz_total = (mc6845->horiz_total + 1) * mc6845->intf->hpixels_per_column;
243      UINT16 vert_total = (mc6845->vert_total + 1) * (mc6845->max_ras_addr + 1) + mc6845->vert_total_adj;
244
245      /* determine the visible area, avoid division by 0 */
246      UINT16 max_x = mc6845->horiz_disp * mc6845->intf->hpixels_per_column - 1;
247      UINT16 max_y = mc6845->vert_disp * (mc6845->max_ras_addr + 1) - 1;
248
249      /* update only if screen parameters changed, unless we are coming here after loading the saved state */
250      if (postload ||
251          (horiz_total != mc6845->last_horiz_total) || (vert_total != mc6845->last_vert_total) ||
252         (max_x != mc6845->last_max_x) || (max_y != mc6845->last_max_y))
253      {
254         /* update the screen only if we have valid data */
255         if ((mc6845->horiz_total > 0) && (max_x < horiz_total) && (mc6845->vert_total > 0) && (max_y < vert_total))
256         {
257            rectangle visarea;
258
259            attoseconds_t refresh = HZ_TO_ATTOSECONDS(mc6845->intf->clock) * (mc6845->horiz_total + 1) * vert_total;
260
261            visarea.min_x = 0;
262            visarea.min_y = 0;
263            visarea.max_x = max_x;
264            visarea.max_y = max_y;
265
266            if (LOG) logerror("CRTC6845 config screen: HTOTAL: %x  VTOTAL: %x  MAX_X: %x  MAX_Y: %x  FPS: %f\n",
267                          horiz_total, vert_total, max_x, max_y, 1 / ATTOSECONDS_TO_DOUBLE(refresh));
268
269            video_screen_configure(mc6845->intf->scrnum, horiz_total, vert_total, &visarea, refresh);
270
271            mc6845->has_valid_parameters = TRUE;
272         }
273         else
274            mc6845->has_valid_parameters = FALSE;
275
276         mc6845->last_horiz_total = horiz_total;
277         mc6845->last_vert_total = vert_total;
278         mc6845->last_max_x = max_x;
279         mc6845->last_max_y = max_y;
280
281         update_timer(mc6845);
282      }
283   }
284}
285
286
287static int is_display_enabled(mc6845_t *mc6845)
288{
289   UINT16 y = video_screen_get_vpos(mc6845->intf->scrnum);
290   UINT16 x = video_screen_get_hpos(mc6845->intf->scrnum);
291
292   return (y <= mc6845->last_max_y) && (x <= mc6845->last_max_x);
293}
294
295
296static void update_timer(mc6845_t *mc6845)
297{
298   INT16 next_y;
299   UINT16 next_x;
300   attotime duration;
301
302   if (mc6845->has_valid_parameters && (mc6845->display_enable_changed_timer != 0))
303   {
304      if (is_display_enabled(mc6845))
305      {
306         /* we are in a display region,
307               get the location of the next blanking start */
308
309         /* normally, it's at end the current raster line */
310         next_y = video_screen_get_vpos(mc6845->intf->scrnum);
311         next_x = mc6845->last_max_x + 1;
312
313         /* but if visible width = horiz_total, then we need
314               to go to the beginning of VBLANK */
315         if (next_x == mc6845->last_horiz_total)
316         {
317            next_y = mc6845->last_max_y + 1;
318            next_x = 0;
319
320            /* abnormal case, no vertical blanking, either */
321            if (next_y == mc6845->last_vert_total)
322               next_y = -1;
323         }
324      }
325      else
326      {
327         /* we are in a blanking region,
328               get the location of the next display start */
329         next_x = 0;
330         next_y = (video_screen_get_vpos(mc6845->intf->scrnum) + 1) % mc6845->last_vert_total;
331
332         /* if we would now fall in the vertical blanking, we need
333               to go to the top of the screen */
334         if (next_y > mc6845->last_max_y)
335            next_y = 0;
336      }
337
338      if (next_y != -1)
339         duration = video_screen_get_time_until_pos(mc6845->intf->scrnum, next_y, next_x);
340      else
341         duration = attotime_never;
342
343      timer_adjust_oneshot(mc6845->display_enable_changed_timer, duration, 0);
344   }
345}
346
347
348static TIMER_CALLBACK( display_enable_changed_timer_cb )
349{
350   mc6845_t *mc6845 = ptr;
351
352   /* call the callback function -- we know it exists */
353   mc6845->intf->display_enable_changed(is_display_enabled(mc6845));
354
355   update_timer(mc6845);
356}
357
358
359UINT16 mc6845_get_ma(mc6845_t *mc6845)
360{
361   UINT16 ret;
362
363   if (mc6845->has_valid_parameters)
364   {
365      /* get the current raster positions and clamp them to the visible region */
366      int y = video_screen_get_vpos(0);
367      int x = video_screen_get_hpos(0);
368
369      /* since the MA counter stops in the blanking regions, if we are in a
370           VBLANK, both X and Y are at their max */
371      if ((y > mc6845->last_max_y) || (x > mc6845->last_max_x))
372         x = mc6845->last_max_x;
373
374      if (y > mc6845->last_max_y)
375         y = mc6845->last_max_y;
376
377      ret = (mc6845->start_addr +
378            (y / (mc6845->max_ras_addr + 1)) * mc6845->horiz_disp +
379            (x / mc6845->intf->hpixels_per_column)) & 0x3fff;
380   }
381   else
382      ret = 0;
383
384   return ret;
385}
386
387
388UINT8 mc6845_get_ra(mc6845_t *mc6845)
389{
390   UINT8 ret;
391
392   if (mc6845->has_valid_parameters)
393   {
394      /* get the current vertical raster position and clamp it to the visible region */
395      int y = video_screen_get_vpos(0);
396
397      if (y > mc6845->last_max_y)
398         y = mc6845->last_max_y;
399
400      ret = y % (mc6845->max_ras_addr + 1);
401   }
402   else
403      ret = 0;
404
405   return ret;
406}
407
408
409void mc6845_update(mc6845_t *mc6845, mame_bitmap *bitmap, const rectangle *cliprect)
410{
411   if (mc6845->has_valid_parameters)
412   {
413      UINT16 y;
414
415      /* call the set up function if any */
416      void *param = 0;
417
418      if (mc6845->intf->begin_update)
419         param = mc6845->intf->begin_update(bitmap, cliprect);
420
421      /* read the start address at the beginning of the frame */
422      if (cliprect->min_y == 0)
423         mc6845->current_ma = mc6845->start_addr;
424
425      /* for each row in the visible region */
426      for (y = cliprect->min_y; y <= cliprect->max_y; y++)
427      {
428         UINT8 ra = y % (mc6845->max_ras_addr + 1);
429
430         /* call the external system to draw it */
431         mc6845->intf->update_row(bitmap, cliprect, mc6845->current_ma, ra, y, mc6845->horiz_disp, param);
432
433         /* update MA if the last raster address */
434         if (ra == mc6845->max_ras_addr)
435            mc6845->current_ma = (mc6845->current_ma + mc6845->horiz_disp) & 0x3fff;
436      }
437
438      /* call the tear down function if any */
439      if (mc6845->intf->end_update)
440         mc6845->intf->end_update(bitmap, cliprect, param);
441   }
442}
src/emu/video/s2636.h
r1679r1680
1extern UINT8 *s2636_1_ram;
2extern UINT8 *s2636_2_ram;
3extern UINT8 *s2636_3_ram;
1/**********************************************************************
42
5extern mame_bitmap *s2636_1_bitmap;
6extern mame_bitmap *s2636_2_bitmap;
7extern mame_bitmap *s2636_3_bitmap;
3    Signetics 2636 video chip
84
9extern int s2636_x_offset;
10extern int s2636_y_offset;
5**********************************************************************/
116
12extern const gfx_layout s2636_gfx_layout;
7#ifndef S2636
8#define S2636
139
14void s2636_update_bitmap(running_machine *machine,mame_bitmap *bitmap,UINT8 *workram,int Graphics_Bank,mame_bitmap *collision_bitmap);
1510
11typedef struct _s2636_t s2636_t;
12
13/* helpful macros to parse the bitmap returned by s2636_update */
14#define S2636_IS_PIXEL_DRAWN(p)      (((p) & 0x08) ? TRUE : FALSE)
15#define S2636_PIXEL_COLOR(p)      ((p) & 0x07)
16
17s2636_t *s2636_config(UINT8 *work_ram, int screen_height, int screen_width, int y_offset, int x_offset);
18
19/* returns a BITMAP_FORMAT_INDEXED8 bitmap the size of the screen
20   D0-D2 of each pixel is the pixel color
21   D3 indicates whether the S2636 drew this pixel - 0 = not drawn, 1 = drawn */
22mame_bitmap *s2636_update(s2636_t *s2636, const rectangle *cliprect);
23
24#endif
src/emu/video/mc6845.h
r0r1680
1/**********************************************************************
2
3    Motorola MC6845 and compatible CRT controller emulation
4
5    Copyright Nicola Salmoria and the MAME Team.
6    Visit http://mamedev.org for licensing and usage restrictions.
7
8    The following variations exist that are different in
9    functionality and not just in speed rating(1):
10        * Motorola 6845, 6845-1
11        * Hitachi 46505
12        * Rockwell 6545, 6545-1 (= Synertek SY6545-1)
13        * Commodore 6545-1
14
15    (1) as per the document at
16    http://www.6502.org/users/andre/hwinfo/crtc/diffs.html
17
18**********************************************************************/
19
20#ifndef MC6845
21#define MC6845
22
23
24typedef struct _mc6845_t mc6845_t;
25typedef struct _mc6845_interface mc6845_interface;
26
27struct _mc6845_interface
28{
29   int scrnum;               /* screen we are acting on */
30   int clock;               /* the clock (pin 21) of the chip */
31   int hpixels_per_column;      /* number of pixels per video memory address */
32
33   /* if specified, this gets called before any pixel update,
34       optionally return a pointer that will be passed to the
35       update and tear down callbacks */
36   void * (*begin_update)(mame_bitmap *bitmap, const rectangle *cliprect);
37
38   /* this gets called for every row, the driver must output
39       x_count * hpixels_per_column pixels */
40   void (*update_row)(mame_bitmap *bitmap, const rectangle *cliprect,
41                  UINT16 ma, UINT8 ra, UINT16 y, UINT8 x_count, void *param);
42
43   /* if specified, this gets called after all row updating is complete */
44   void (*end_update)(mame_bitmap *bitmap, const rectangle *cliprect, void *param);
45
46   /* if specified, this gets called for every change of the disply enable (DT pin 18) */
47   void (*display_enable_changed)(int display_enabled);
48};
49
50
51/* use mc6845_init to set up for save states.
52   if intf is NULL, the emulator will NOT call video_configure_screen() */
53mc6845_t *mc6845_config(const mc6845_interface *intf);
54
55/* selects one of the registers for reading or writing */
56void mc6845_address_w(mc6845_t *mc6845, UINT8 data);
57
58/* reads the currently selected register */
59UINT8 mc6845_register_r(mc6845_t *mc6845);
60
61/* writes the currently selected register */
62void mc6845_register_w(mc6845_t *mc6845, UINT8 data);
63
64/* return the current value on the MA0-MA13 pins */
65UINT16 mc6845_get_ma(mc6845_t *mc6845);
66
67/* return the current value on the RA0-RA4 pins */
68UINT8 mc6845_get_ra(mc6845_t *mc6845);
69
70/* updates the screen -- this will call begin_update(),
71   followed by update_row() reapeatedly and after all row
72   updating is complete, end_update() */
73void mc6845_update(mc6845_t *mc6845, mame_bitmap *bitmap, const rectangle *cliprect);
74
75#endif
src/emu/tilemap.c
r1679r1680
2525/* invalid logical index */
2626#define INVALID_LOGICAL_INDEX         ((tilemap_logical_index)~0)
2727
28/* maximum index in each array */
29#define MAX_PEN_TO_FLAGS            256
2830
2931
3032/***************************************************************************
r1679r1680
6971   tilemap *               next;            /* pointer to next tilemap */
7072
7173   /* basic tilemap metrics */
72   tilemap_type             type;            /* type of tilemap */
7374   UINT32                  rows;            /* number of tile rows */
7475   UINT32                  cols;            /* number of tile columns */
7576   UINT32                  tilewidth;         /* width of a single tile in pixels */
r1679r1680
113114   mame_bitmap *            flagsmap;         /* per-pixel flags */
114115   UINT8 *                  tileflags;         /* per-tile flags */
115116   UINT8 *                  pen_to_flags;       /* mapping of pens to flags */
116   UINT32                  max_pen_to_flags;   /* maximum index in each array */
117117};
118118
119119
r1679r1680
150150static void tile_update(tilemap *tmap, tilemap_logical_index logindex, UINT32 cached_col, UINT32 cached_row);
151151static UINT8 tile_draw(tilemap *tmap, const UINT8 *pendata, UINT32 x0, UINT32 y0, UINT32 palette_base, UINT8 category, UINT8 group, UINT8 flags);
152152static UINT8 tile_draw_colortable(tilemap *tmap, const UINT8 *pendata, UINT32 x0, UINT32 y0, UINT32 palette_base, UINT8 category, UINT8 group, UINT8 flags);
153static UINT8 tile_draw_colortrans(tilemap *tmap, const UINT8 *pendata, UINT32 x0, UINT32 y0, UINT32 palette_base, UINT8 category, UINT8 group, UINT8 flags);
154153static UINT8 tile_apply_bitmask(tilemap *tmap, const UINT8 *maskdata, UINT32 x0, UINT32 y0, UINT8 category, UINT8 flags);
155154
156155/* drawing helpers */
r1679r1680
289288    tilemap_create - allocate a new tilemap
290289-------------------------------------------------*/
291290
292tilemap *tilemap_create(tile_get_info_callback tile_get_info, tilemap_mapper_callback mapper, tilemap_type type, int tilewidth, int tileheight, int cols, int rows)
291tilemap *tilemap_create(tile_get_info_callback tile_get_info, tilemap_mapper_callback mapper, int tilewidth, int tileheight, int cols, int rows)
293292{
294293   tilemap *tmap;
295294   int group;
r1679r1680
299298   memset(tmap, 0, sizeof(tilemap));
300299
301300   /* fill in the basic metrics */
302   tmap->type = type;
303301   tmap->rows = rows;
304302   tmap->cols = cols;
305303   tmap->tilewidth = tilewidth;
r1679r1680
332330   /* allocate transparency mapping data */
333331   tmap->tileflags = malloc_or_die(tmap->max_logical_index);
334332   tmap->flagsmap = bitmap_alloc(tmap->width, tmap->height, BITMAP_FORMAT_INDEXED8);
335   tmap->max_pen_to_flags = (tmap->type != TILEMAP_TYPE_COLORTABLE) ? 256 : Machine->drv->color_table_len;
336   tmap->pen_to_flags = malloc_or_die(sizeof(tmap->pen_to_flags[0]) * tmap->max_pen_to_flags * TILEMAP_NUM_GROUPS);
333   tmap->pen_to_flags = malloc_or_die(sizeof(tmap->pen_to_flags[0]) * MAX_PEN_TO_FLAGS * TILEMAP_NUM_GROUPS);
337334   for (group = 0; group < TILEMAP_NUM_GROUPS; group++)
338335      tilemap_map_pens_to_layer(tmap, group, 0, 0, TILEMAP_PIXEL_LAYER0);
339336
r1679r1680
487484
488485void tilemap_map_pens_to_layer(tilemap *tmap, int group, pen_t pen, pen_t mask, UINT8 layermask)
489486{
490   UINT8 *array = tmap->pen_to_flags + group * tmap->max_pen_to_flags;
487   UINT8 *array = tmap->pen_to_flags + group * MAX_PEN_TO_FLAGS;
491488   pen_t start, stop, cur;
492489   UINT8 changed = FALSE;
493490
r1679r1680
501498   stop = start | ~mask;
502499
503500   /* clamp to the number of entries actually there */
504   stop = MIN(stop, tmap->max_pen_to_flags - 1);
501   stop = MIN(stop, MAX_PEN_TO_FLAGS - 1);
505502
506503   /* iterate and set */
507504   for (cur = start; cur <= stop; cur++)
r1679r1680
12511248
12521249   /* draw the tile, using either direct or transparent */
12531250   if (Machine->game_colortable != NULL)
1254   {
1255      if (tmap->type != TILEMAP_TYPE_COLORTABLE)
1256         tmap->tileflags[logindex] = tile_draw_colortable(tmap, tmap->tileinfo.pen_data, x0, y0, tmap->tileinfo.palette_base, tmap->tileinfo.category, tmap->tileinfo.group, flags);
1257      else
1258         tmap->tileflags[logindex] = tile_draw_colortrans(tmap, tmap->tileinfo.pen_data, x0, y0, tmap->tileinfo.palette_base, tmap->tileinfo.category, tmap->tileinfo.group, flags);
1259   }
1251      tmap->tileflags[logindex] = tile_draw_colortable(tmap, tmap->tileinfo.pen_data, x0, y0, tmap->tileinfo.palette_base, tmap->tileinfo.category, tmap->tileinfo.group, flags);
12601252   else
12611253      tmap->tileflags[logindex] = tile_draw(tmap, tmap->tileinfo.pen_data, x0, y0, tmap->tileinfo.palette_base, tmap->tileinfo.category, tmap->tileinfo.group, flags);
12621254
r1679r1680
12771269
12781270static UINT8 tile_draw(tilemap *tmap, const UINT8 *pendata, UINT32 x0, UINT32 y0, UINT32 palette_base, UINT8 category, UINT8 group, UINT8 flags)
12791271{
1280   const UINT8 *penmap = tmap->pen_to_flags + group * tmap->max_pen_to_flags;
1272   const UINT8 *penmap = tmap->pen_to_flags + group * MAX_PEN_TO_FLAGS;
12811273   mame_bitmap *flagsmap = tmap->flagsmap;
12821274   mame_bitmap *pixmap = tmap->pixmap;
12831275   int height = tmap->tileheight;
r1679r1680
13741366
13751367static UINT8 tile_draw_colortable(tilemap *tmap, const UINT8 *pendata, UINT32 x0, UINT32 y0, UINT32 palette_base, UINT8 category, UINT8 group, UINT8 flags)
13761368{
1377   const UINT8 *penmap = tmap->pen_to_flags + group * tmap->max_pen_to_flags;
1369   const UINT8 *penmap = tmap->pen_to_flags + group * MAX_PEN_TO_FLAGS;
13781370   const pen_t *palette_lookup = Machine->remapped_colortable + palette_base;
13791371   mame_bitmap *flagsmap = tmap->flagsmap;
13801372   mame_bitmap *pixmap = tmap->pixmap;
r1679r1680
14651457
14661458
14671459/*-------------------------------------------------
1468    tile_draw_colortrans - draw a single tile to
1469    the tilemap's internal pixmap, using the
1470    remapped pen as the pen_to_flags lookup value
1471-------------------------------------------------*/
1472
1473static UINT8 tile_draw_colortrans(tilemap *tmap, const UINT8 *pendata, UINT32 x0, UINT32 y0, UINT32 palette_base, UINT8 category, UINT8 group, UINT8 flags)
1474{
1475   const UINT8 *penmap = tmap->pen_to_flags + group * tmap->max_pen_to_flags;
1476   const pen_t *palette_lookup = Machine->remapped_colortable + palette_base;
1477   mame_bitmap *flagsmap = tmap->flagsmap;
1478   mame_bitmap *pixmap = tmap->pixmap;
1479   int height = tmap->tileheight;
1480   int width = tmap->tilewidth;
1481   UINT8 andmask = ~0, ormask = 0;
1482   int dx0 = 1, dy0 = 1;
1483   int tx, ty;
1484
1485   /* OR in the force layer flags */
1486   category |= flags & (TILE_FORCE_LAYER0 | TILE_FORCE_LAYER1 | TILE_FORCE_LAYER2);
1487
1488   /* if we're vertically flipped, point to the bottom row and work backwards */
1489   if (flags & TILE_FLIPY)
1490   {
1491      y0 += height - 1;
1492      dy0 = -1;
1493   }
1494
1495   /* if we're horizontally flipped, point to the rightmost column and work backwards */
1496   if (flags & TILE_FLIPX)
1497   {
1498      x0 += width - 1;
1499      dx0 = -1;
1500   }
1501
1502   /* in 4bpp mode, we draw in groups of 2 pixels, so halve the width now */
1503   if (flags & TILE_4BPP)
1504   {
1505      assert(width % 2 == 0);
1506      width /= 2;
1507   }
1508
1509   /* iterate over rows */
1510   for (ty = 0; ty < height; ty++)
1511   {
1512      UINT16 *pixptr = BITMAP_ADDR16(pixmap, y0, x0);
1513      UINT8 *flagsptr = BITMAP_ADDR8(flagsmap, y0, x0);
1514      int xoffs = 0;
1515
1516      /* pre-advance to the next row */
1517      y0 += dy0;
1518
1519      /* 8bpp data */
1520      if (!(flags & TILE_4BPP))
1521      {
1522         for (tx = 0; tx < width; tx++)
1523         {
1524            pen_t pen = palette_lookup[*pendata++];
1525            UINT8 map = penmap[pen];
1526            pixptr[xoffs] = pen;
1527            flagsptr[xoffs] = map | category;
1528            andmask &= map;
1529            ormask |= map;
1530            xoffs += dx0;
1531         }
1532      }
1533
1534      /* 4bpp data */
1535      else
1536      {
1537         for (tx = 0; tx < width; tx++)
1538         {
1539            UINT8 data = *pendata++;
1540            pen_t pen;
1541            UINT8 map;
1542
1543            pen = palette_lookup[data & 0x0f];
1544            map = penmap[pen];
1545            pixptr[xoffs] = pen;
1546            flagsptr[xoffs] = map | category;
1547            andmask &= map;
1548            ormask |= map;
1549            xoffs += dx0;
1550
1551            pen = palette_lookup[data >> 4];
1552            map = penmap[pen];
1553            pixptr[xoffs] = pen;
1554            flagsptr[xoffs] = map | category;
1555            andmask &= map;
1556            ormask |= map;
1557            xoffs += dx0;
1558         }
1559      }
1560   }
1561   return andmask ^ ormask;
1562}
1563
1564
1565/*-------------------------------------------------
15661460    tile_apply_bitmask - apply a bitmask to an
15671461    already-rendered tile by modifying the
15681462    flagsmap appropriately
src/emu/tilemap.h
r1679r1680
104104            column and row to a memory index; several standard mappers
105105            are provided, with tilemap_scan_rows being the most common
106106
107        type = the type of tilemap this is;
108
109            TILEMAP_TYPE_PEN - this is the most common type,
110                and means that transparency is determined by taking the
111                raw pen value and looking it up in a table to determine
112                which layer(s) each pixel belongs to
113
114            TILEMAP_TYPE_COLORTABLE - this is less common and
115                will eventually be deprecated; it means that transparency
116                is determined by taking the raw pen value, looking it up
117                in the machine's colortable, and then looking that value
118                up in a table to determine which layer(s) each pixel
119                belongs to
120
121107        tilewidth = the width, in pixels, of each individual tile
122108
123109        tileheight = the height, in pixels, of each individual tile
r1679r1680
205191            tmap = tilemap_create(
206192                    my_get_info,            // pointer to your get_info
207193                    tilemap_scan_rows,      // standard row-major mapper
208                    TILEMAP_TYPE_PEN, // transparency from pens
209194                    8,8,                    // 8x8 tiles
210195                    64,32);                 // 64 columns, 32 rows
211196
r1679r1680
255240            transparent pen for them; this no longer works.
256241
257242        TILEMAP_TRANSPARENT: This described a tilemap with a single
258            transparent pen. To create the same effect, make a new tilemap
259            of type TILEMAP_TYPE_PEN, and then call
243            transparent pen. To create the same effect, call
260244            tilemap_set_transparent_pen() to specify which pen is
261245            transparent; all other pens will map to layer 0.
262246
263        TILEMAP_TRANSPARENT_COLOR: This works just like before and
264            even has the same type name. Create a tilemap of type
265            TILEMAP_TYPE_COLORTABLE and call
266            tilemap_set_transparent_pen() to specify which remapped pen
267            is transparent.
268
269247        TILEMAP_BITMASK: This type is no longer special; with the new
270248            code, any tile_get_info callback can specify a bitmask which
271249            will be processed after rendering to make some pixels
r1679r1680
276254            also allowed for you to choose one of 4 mappings on a per-tile
277255            basis. All of this functionality is now expanded: you can
278256            specify one of 3 layers and can choose from one of 256 mappings
279            on a per-tile basis. You just create a tilemap of type
280            TILEMAP_TYPE_PEN and call tilemap_set_transmask(),
257            on a per-tile basis. You just call tilemap_set_transmask(),
281258            which still exists but maps onto the new behavior. The "front"
282259            layer is now "layer 0" and the "back" layer is now "layer 1".
283260
r1679r1680
406383typedef struct _tilemap tilemap;
407384
408385
409/* tilemap types */
410enum _tilemap_type
411{
412   TILEMAP_TYPE_PEN,            /* pen-to-layer mapping is determined by pen lookup */
413   TILEMAP_TYPE_COLORTABLE         /* pen-to-layer mapping is determined by colortable[pen] lookup */
414};
415typedef enum _tilemap_type tilemap_type;
416
417
418386/* tile_data is filled in by the get_tile_info callback */
419387typedef struct _tile_data tile_data;
420388struct _tile_data
421389{
422390   const UINT8 *   pen_data;      /* required */
423   const UINT8 *   mask_data;      /* required for TILEMAP_TYPE_PEN */
391   const UINT8 *   mask_data;      /* required */
424392   pen_t         palette_base;   /* defaults to 0 */
425393   UINT8          category;      /* defaults to 0; range from 0..15 */
426394   UINT8         group;         /* defaults to 0; range from 0..TILEMAP_NUM_GROUPS */
r1679r1680
459427/* ----- tilemap creation and configuration ----- */
460428
461429/* create a new tilemap; note that tilemaps are tracked by the core so there is no dispose */
462tilemap *tilemap_create(tile_get_info_callback tile_get_info, tilemap_mapper_callback mapper, tilemap_type type, int tilewidth, int tileheight, int cols, int rows);
430tilemap *tilemap_create(tile_get_info_callback tile_get_info, tilemap_mapper_callback mapper, int tilewidth, int tileheight, int cols, int rows);
463431
464432/* specify a parameter to be passed into the tile_get_info callback */
465433void tilemap_set_user_data(tilemap *tmap, void *user_data);
src/emu/video.c
r1679r1680
333333         if (machine->drv->video_attributes & VIDEO_UPDATE_SCANLINE)
334334         {
335335            info->scanline_timer = timer_alloc(scanline_update_callback, NULL);
336            timer_adjust(info->scanline_timer, video_screen_get_time_until_pos(scrnum, 0, 0), scrnum, attotime_never);
336            timer_adjust_oneshot(info->scanline_timer, video_screen_get_time_until_pos(scrnum, 0, 0), scrnum);
337337         }
338338
339339         /* register for save states */
r1679r1680
774774   /* if we are on scanline 0 already, reset the update timer immediately */
775775   /* otherwise, defer until the next scanline 0 */
776776   if (video_screen_get_vpos(scrnum) == 0)
777      timer_adjust(info->scanline0_timer, attotime_zero, scrnum, attotime_zero);
777      timer_adjust_oneshot(info->scanline0_timer, attotime_zero, scrnum);
778778   else
779      timer_adjust(info->scanline0_timer, video_screen_get_time_until_pos(scrnum, 0, 0), scrnum, attotime_zero);
779      timer_adjust_oneshot(info->scanline0_timer, video_screen_get_time_until_pos(scrnum, 0, 0), scrnum);
780780}
781781
782782
r1679r1680
10381038   viddata->scrinfo[scrnum].last_partial_scan = 0;
10391039   global.partial_updates_this_frame = 0;
10401040
1041   timer_adjust(viddata->scrinfo[scrnum].scanline0_timer, video_screen_get_time_until_pos(scrnum, 0, 0), scrnum, attotime_zero);
1041   timer_adjust_oneshot(viddata->scrinfo[scrnum].scanline0_timer, video_screen_get_time_until_pos(scrnum, 0, 0), scrnum);
10421042}
10431043
10441044
r1679r1680
10601060   scanline++;
10611061   if (scanline > machine->screen[scrnum].visarea.max_y)
10621062      scanline = machine->screen[scrnum].visarea.min_y;
1063   timer_adjust(viddata->scrinfo[scrnum].scanline_timer, video_screen_get_time_until_pos(scrnum, scanline, 0), (scanline << 8) | scrnum, attotime_never);
1063   timer_adjust_oneshot(viddata->scrinfo[scrnum].scanline_timer, video_screen_get_time_until_pos(scrnum, scanline, 0), (scanline << 8) | scrnum);
10641064}
10651065
10661066
src/emu/memory.c
r1679r1680
541541   opbasefunc = cpudata[activecpu].opbase;
542542
543543#ifdef ENABLE_DEBUGGER
544   if (activecpu != -1)
544   if (activecpu != -1 && Machine->debug_mode)
545545      debug_get_memory_hooks(activecpu, &debug_hook_read, &debug_hook_write);
546546   else
547547   {
src/emu/emu.mak
r1679r1680
166166
167167EMUVIDEOOBJS = \
168168    $(EMUVIDEO)/cdp1869.o \
169    $(EMUVIDEO)/crtc6845.o \
170169   $(EMUVIDEO)/generic.o \
170    $(EMUVIDEO)/mc6845.o \
171171   $(EMUVIDEO)/poly.o \
172172   $(EMUVIDEO)/resnet.o \
173173   $(EMUVIDEO)/s2636.o \
src/emu/mame.c
r1679r1680
642642{
643643   mame_private *mame = machine->mame_data;
644644
645   timer_adjust(mame->soft_reset_timer, attotime_zero, 0, attotime_zero);
645   timer_adjust_oneshot(mame->soft_reset_timer, attotime_zero, 0);
646646
647647   /* we can't be paused since the timer needs to fire */
648648   mame_pause(machine, FALSE);
src/emu/inptport.c
r1679r1680
11671167
11681168   /* Check if input file is an eXtended INP file */
11691169   extended_inp = (memcmp(check, "XINP\0\0\0", 7) == 0);
1170   if (extended_inp)
1170   if (!extended_inp)
11711171   {
11721172      /* read playback header */
11731173      mame_fread(machine->playback_file, &inpheader, sizeof(inpheader));
src/emu/machine/timekpr.c
r1679r1680
316316
317317   timer = timer_alloc( timekeeper_tick, c );
318318   duration = ATTOTIME_IN_SEC(1);
319   timer_adjust( timer, duration, 0, duration );
319   timer_adjust_periodic( timer, duration, 0, duration );
320320}
321321
322322static void timekeeper_nvram( int chip, mame_file *file, int read_or_write )
src/emu/machine/6526cia.c
r1679r1680
324324   {
325325      /* timer is on and is connected to clock */
326326      attotime period = attotime_mul(ATTOTIME_IN_HZ(timer->cia->clock), (timer->count ? timer->count : 0x10000));
327      timer_adjust(timer->timer, period, 0, attotime_zero);
327      timer_adjust_oneshot(timer->timer, period, 0);
328328   }
329329   else
330330   {
331331      /* timer is off or not connected to clock */
332      timer_adjust(timer->timer, attotime_never, 0, attotime_zero);
332      timer_adjust_oneshot(timer->timer, attotime_never, 0);
333333   }
334334}
335335
src/emu/machine/74123.c
r1679r1680
129129
130130      if (attotime_compare(timer_timeelapsed(chip->timer), delay_time) >= 0)
131131      {
132         timer_adjust(chip->timer, duration, 0, attotime_never);
132         timer_adjust_oneshot(chip->timer, duration, 0);
133133
134134         if (LOG) logerror("74123 #%d:  Retriggering pulse.  Duration: %f\n", chip->which, attotime_to_double(duration));
135135      }
r1679r1680
141141   else
142142   {
143143      /* starting */
144      timer_adjust(chip->timer, duration, 0, attotime_never);
144      timer_adjust_oneshot(chip->timer, duration, 0);
145145
146146      set_output(chip);
147147
r1679r1680
181181   /* clear the output if A=LO, B=HI and falling edge on clear */
182182   if (!data && chip->clear && chip->B && !chip->A && !chip->clear)
183183   {
184      timer_adjust(chip->timer, attotime_zero, 0, attotime_never);
184      timer_adjust_oneshot(chip->timer, attotime_zero, 0);
185185
186186      if (LOG) logerror("74123 #%d:  Cleared\n", which);
187187   }
src/emu/machine/6850acia.c
r1679r1680
299299   {
300300      attotime rx_period = attotime_mul(ATTOTIME_IN_HZ(acia_p->rx_clock), acia_p->divide);
301301      attotime tx_period = attotime_mul(ATTOTIME_IN_HZ(acia_p->tx_clock), acia_p->divide);
302      timer_adjust(acia_p->rx_timer, rx_period, which, rx_period);
303      timer_adjust(acia_p->tx_timer, tx_period, which, tx_period);
302      timer_adjust_periodic(acia_p->rx_timer, rx_period, which, rx_period);
303      timer_adjust_periodic(acia_p->tx_timer, tx_period, which, tx_period);
304304   }
305305}
306306
src/emu/machine/mb3773.c
r1679r1680
1919
2020static void reset_timer( void )
2121{
22   timer_adjust( watchdog_timer, ATTOTIME_IN_SEC( 5 ), 0, attotime_zero );
22   timer_adjust_oneshot( watchdog_timer, ATTOTIME_IN_SEC( 5 ), 0 );
2323}
2424
2525void mb3773_set_ck( UINT8 new_ck )
src/emu/machine/idectrl.c
r1679r1680
13881388         if (attotime_compare(timer_timeelapsed(ide->last_status_timer), TIME_PER_ROTATION) > 0)
13891389         {
13901390            result |= IDE_STATUS_HIT_INDEX;
1391            timer_adjust(ide->last_status_timer, attotime_never, 0, attotime_zero);
1391            timer_adjust_oneshot(ide->last_status_timer, attotime_never, 0);
13921392         }
13931393
13941394         /* clear interrutps only when reading the real status */
r1679r1680
15541554         {
15551555            ide->status |= IDE_STATUS_BUSY;
15561556            ide->status &= ~IDE_STATUS_DRIVE_READY;
1557            timer_adjust(ide->reset_timer, ATTOTIME_IN_MSEC(5), 0, attotime_zero);
1557            timer_adjust_oneshot(ide->reset_timer, ATTOTIME_IN_MSEC(5), 0);
15581558         }
15591559         break;
15601560   }
src/emu/machine/6532riot.c
r1679r1680
4646
4747INLINE void r6532_set_timer(int which, UINT8 count)
4848{
49   timer_adjust( r6532[which].counter_timer, attotime_mul(ATTOTIME_IN_HZ(r6532[which].clock), (count << r6532[which].shift) + 1), which, attotime_zero );
49   timer_adjust_oneshot( r6532[which].counter_timer, attotime_mul(ATTOTIME_IN_HZ(r6532[which].clock), (count << r6532[which].shift) + 1), which );
5050}
5151
5252
src/emu/machine/6522via.c
r1679r1680
322322    {
323323      if (T1_SET_PB7(v->acr))
324324         v->out_b ^= 0x80;
325      timer_adjust(v->t1, v_cycles_to_time(v, TIMER1_VALUE(v) + IFR_DELAY), which, attotime_zero);
325      timer_adjust_oneshot(v->t1, v_cycles_to_time(v, TIMER1_VALUE(v) + IFR_DELAY), which);
326326    }
327327   else
328328    {
r1679r1680
719719               logerror("6522VIA chip %d: Port B is being written to but has no handler.  PC: %08X - %02X\n", which, safe_activecpu_get_pc(), write_data);
720720         }
721721      }
722      timer_adjust(v->t1, v_cycles_to_time(v, TIMER1_VALUE(v) + IFR_DELAY), which, attotime_zero);
722      timer_adjust_oneshot(v->t1, v_cycles_to_time(v, TIMER1_VALUE(v) + IFR_DELAY), which);
723723      v->t1_active = 1;
724724      break;
725725
r1679r1680
735735
736736      if (!T2_COUNT_PB6(v->acr))
737737      {
738         timer_adjust(v->t2, v_cycles_to_time(v, TIMER2_VALUE(v) + IFR_DELAY), which, attotime_zero);
738         timer_adjust_oneshot(v->t2, v_cycles_to_time(v, TIMER2_VALUE(v) + IFR_DELAY), which);
739739         v->t2_active = 1;
740740      }
741741      else
r1679r1680
802802         }
803803         if (T1_CONTINUOUS(data))
804804         {
805            timer_adjust(v->t1, v_cycles_to_time(v, counter1 + IFR_DELAY), which, attotime_zero);
805            timer_adjust_oneshot(v->t1, v_cycles_to_time(v, counter1 + IFR_DELAY), which);
806806            v->t1_active = 1;
807807         }
808808      }
src/emu/machine/wd33c93.c
r1679r1680
287287static void wd33c93_complete_cmd( UINT8 status )
288288{
289289   /* fire off a timer to complete the command */
290   timer_adjust( scsi_data.cmd_timer, ATTOTIME_IN_USEC(1), status, attotime_zero );
290   timer_adjust_oneshot( scsi_data.cmd_timer, ATTOTIME_IN_USEC(1), status );
291291}
292292
293293/* command handlers */
src/emu/machine/pic8259.c
r1679r1680
128128
129129static void pic8259_set_timer(int which)
130130{
131   timer_adjust(pic[which].timer, attotime_zero, which, attotime_zero);
131   timer_adjust_oneshot(pic[which].timer, attotime_zero, which);
132132}
133133
134134
src/emu/machine/intelfsh.c
r1679r1680
335335         c->status = 1 << 3;
336336         c->flash_mode = FM_ERASEAMD4;
337337
338         timer_adjust( c->timer, ATTOTIME_IN_SEC( 17 ), 0, attotime_zero );
338         timer_adjust_oneshot( c->timer, ATTOTIME_IN_SEC( 17 ), 0 );
339339      }
340340      else if( ( data & 0xff ) == 0x30 )
341341      {
r1679r1680
360360         c->status = 1 << 3;
361361         c->flash_mode = FM_ERASEAMD4;
362362
363         timer_adjust( c->timer, ATTOTIME_IN_SEC( 1 ), 0, attotime_zero );
363         timer_adjust_oneshot( c->timer, ATTOTIME_IN_SEC( 1 ), 0 );
364364      }
365365      else
366366      {
r1679r1680
429429         c->status = 0x00;
430430         c->flash_mode = FM_READSTATUS;
431431
432         timer_adjust( c->timer, ATTOTIME_IN_SEC( 1 ), 0, attotime_zero );
432         timer_adjust_oneshot( c->timer, ATTOTIME_IN_SEC( 1 ), 0 );
433433         break;
434434      }
435435      else
src/emu/machine/ds2401.c
r1679r1680
7272   verboselog( 1, "ds2401_reset(%d)\n", which );
7373
7474   c->state = STATE_RESET;
75   timer_adjust( c->timer, attotime_never, which, attotime_never );
75   timer_adjust_oneshot( c->timer, attotime_never, which );
7676}
7777
7878static TIMER_CALLBACK( ds2401_tick )
r1679r1680
8686      verboselog( 2, "ds2401_tick(%d) state_reset1 %d\n", which, c->rx );
8787      c->tx = 0;
8888      c->state = STATE_RESET2;
89      timer_adjust( c->timer, c->t_pdl, which, attotime_never );
89      timer_adjust_oneshot( c->timer, c->t_pdl, which );
9090      break;
9191   case STATE_RESET2:
9292      verboselog( 2, "ds2401_tick(%d) state_reset2 %d\n", which, c->rx );
r1679r1680
181181         break;
182182      case STATE_COMMAND:
183183         verboselog( 2, "ds2401_write(%d) state_command\n", which );
184         timer_adjust( c->timer, c->t_samp, which, attotime_never );
184         timer_adjust_oneshot( c->timer, c->t_samp, which );
185185         break;
186186      case STATE_READROM:
187187         if( c->bit == 0 )
r1679r1680
198198            c->byte++;
199199         }
200200         verboselog( 2, "ds2401_write(%d) state_readrom %d\n", which, c->tx );
201         timer_adjust( c->timer, c->t_rdv, which, attotime_never );
201         timer_adjust_oneshot( c->timer, c->t_rdv, which );
202202         break;
203203      default:
204204         verboselog( 0, "ds2401_write(%d) state not handled: %d\n", which, c->state );
205205         break;
206206      }
207      timer_adjust( c->reset_timer, c->t_rstl, which, attotime_never );
207      timer_adjust_oneshot( c->reset_timer, c->t_rstl, which );
208208   }
209209   else if( data == 1 && c->rx == 0 )
210210   {
r1679r1680
212212      {
213213      case STATE_RESET:
214214         c->state = STATE_RESET1;
215         timer_adjust( c->timer, c->t_pdh, which, attotime_never );
215         timer_adjust_oneshot( c->timer, c->t_pdh, which );
216216         break;
217217      }
218      timer_adjust( c->reset_timer, attotime_never, which, attotime_never );
218      timer_adjust_oneshot( c->reset_timer, attotime_never, which );
219219   }
220220   c->rx = data;
221221}
src/emu/machine/6840ptm.c
r1679r1680
171171
172172      /* store the result */
173173      currptr->counter[counter] = (msb << 8) | lsb;
174      timer_adjust(currptr->timer[counter], attotime_mul(ATTOTIME_IN_HZ(clock), currptr->counter[counter]), which, attotime_zero);
174      timer_adjust_oneshot(currptr->timer[counter], attotime_mul(ATTOTIME_IN_HZ(clock), currptr->counter[counter]), which);
175175   }
176176
177177   /* word mode */
r1679r1680
197197      currptr->counter[counter] = word;
198198      duration = attotime_mul(ATTOTIME_IN_HZ(clock), currptr->counter[counter]);
199199      if (counter == 2) duration = attotime_mul(duration, currptr->t3_divisor);
200      timer_adjust(currptr->timer[counter], duration, which, attotime_zero);
200      timer_adjust_oneshot(currptr->timer[counter], duration, which);
201201   }
202202}
203203
r1679r1680
321321
322322   duration = attotime_mul(ATTOTIME_IN_HZ(clock), count);
323323   if (idx == 2) duration = attotime_mul(duration, currptr->t3_divisor);
324   timer_adjust(currptr->timer[idx], duration, which, attotime_zero);
324   timer_adjust_oneshot(currptr->timer[idx], duration, which);
325325   PLOG(("MC6840 #%d: reload_count(%d): output = %lf\n", which, idx, attotime_to_double(duration)));
326326
327327   if (!currptr->control_reg[idx] & 0x02)
src/emu/machine/z80dma.c
r1679r1680
297297      dma[which].is_read = 1;
298298      dma[which].cur_cycle = (PORTA_IS_SOURCE(cntx) ? PORTA_CYCLE_LEN(cntx) : PORTB_CYCLE_LEN(cntx));
299299      next = ATTOTIME_IN_HZ(dma[which].intf->clockhz);
300      timer_adjust(dma[which].timer,
300      timer_adjust_periodic(dma[which].timer,
301301         attotime_zero,
302302         which,
303303         /* 1 byte transferred in 4 clock cycles */
src/emu/machine/pc16552d.c
r1679r1680
152152   ch->pending_interrupt |= IRQ_TX_HOLDING_REG_EMPTY;
153153   check_interrupts(chip, channel);
154154
155   timer_adjust(duart[chip].ch[channel].tx_fifo_timer, attotime_never, (chip * 2) + channel, attotime_never);
155   timer_adjust_oneshot(duart[chip].ch[channel].tx_fifo_timer, attotime_never, (chip * 2) + channel);
156156}
157157
158158static void duart_push_tx_fifo(int chip, int channel, UINT8 data)
r1679r1680
164164
165165   period = attotime_mul(ATTOTIME_IN_HZ(duart[chip].frequency), ch->divisor * 16 * 16 * 8);
166166
167   timer_adjust(duart[chip].ch[channel].tx_fifo_timer, period, (chip * 2) + channel, attotime_zero);
167   timer_adjust_oneshot(duart[chip].ch[channel].tx_fifo_timer, period, (chip * 2) + channel);
168168}
169169
170170#ifdef UNUSED_FUNCTION
r1679r1680
395395
396396   // allocate transmit timers
397397   duart[chip].ch[0].tx_fifo_timer = timer_alloc(tx_fifo_timer_callback, NULL);
398   timer_adjust(duart[chip].ch[0].tx_fifo_timer, attotime_never, (chip * 2) + 0, attotime_never);
398   timer_adjust_oneshot(duart[chip].ch[0].tx_fifo_timer, attotime_never, (chip * 2) + 0);
399399
400400   duart[chip].ch[1].tx_fifo_timer = timer_alloc(tx_fifo_timer_callback, NULL);
401   timer_adjust(duart[chip].ch[1].tx_fifo_timer, attotime_never, (chip * 2) + 1, attotime_never);
401   timer_adjust_oneshot(duart[chip].ch[1].tx_fifo_timer, attotime_never, (chip * 2) + 1);
402402}
403403
404404void pc16552d_rx_data(int chip, int channel, UINT8 data)
src/emu/machine/8237dma.c
r1679r1680
196196         dma[which].status |= 0x10 << channel;
197197         dma[which].status &= ~(0x01 << channel);
198198
199         timer_adjust(dma[which].timer,
199         timer_adjust_periodic(dma[which].timer,
200200            attotime_zero,
201201            which * 4 + channel,
202202            double_to_attotime(dma[which].intf->bus_speed));
r1679r1680
237237
238238static void prepare_msb_flip(int which)
239239{
240   timer_adjust(dma[which].msbflip_timer, attotime_zero, which, attotime_zero);
240   timer_adjust_oneshot(dma[which].msbflip_timer, attotime_zero, which);
241241}
242242
243243
src/emu/machine/8257dma.c
r1679r1680
220220   if (pending_transfer)
221221   {
222222      next = ATTOTIME_IN_HZ(dma[which].intf->clockhz / 4 );
223      timer_adjust(dma[which].timer,
223      timer_adjust_periodic(dma[which].timer,
224224         attotime_zero,
225225         which,
226226         /* 1 byte transferred in 4 clock cycles */
r1679r1680
247247
248248static void prepare_msb_flip(int which)
249249{
250   timer_adjust(dma[which].msbflip_timer, attotime_zero, which, attotime_zero);
250   timer_adjust_oneshot(dma[which].msbflip_timer, attotime_zero, which);
251251}
252252
253253
src/emu/machine/z80sio.c
r1679r1680
329329   interrupt_check(sio);
330330
331331   /* start the receive timer running */
332   timer_adjust(chan->receive_timer, tpc, ((sio - sios) << 1) | ch, tpc);
332   timer_adjust_periodic(chan->receive_timer, tpc, ((sio - sios) << 1) | ch, tpc);
333333}
334334
335335
src/emu/machine/tmp68301.c
r1679r1680
7171   int max = 0;
7272   attotime duration = attotime_zero;
7373
74   timer_adjust(tmp68301_timer[i],attotime_never,i,attotime_never);
74   timer_adjust_oneshot(tmp68301_timer[i],attotime_never,i);
7575
7676   // timers 1&2 only
7777   switch( (TCR & 0x0030)>>4 )                  // MR2..1
r1679r1680
101101   if (!(TCR & 0x0002))            // CS
102102   {
103103      if (attotime_compare(duration, attotime_zero))
104         timer_adjust(tmp68301_timer[i],duration,i,attotime_zero);
104         timer_adjust_oneshot(tmp68301_timer[i],duration,i);
105105      else
106106         logerror("CPU #0 PC %06X: TMP68301 error, timer %d duration is 0\n",activecpu_get_pc(),i);
107107   }
src/emu/machine/z80ctc.c
r1679r1680
188188   {
189189      ctc->mode[i] = RESET_ACTIVE;
190190      ctc->tconst[i] = 0x100;
191      timer_adjust(ctc->timer[i], attotime_never, 0, attotime_never);
191      timer_adjust_oneshot(ctc->timer[i], attotime_never, 0);
192192      ctc->int_state[i] = 0;
193193   }
194194   interrupt_check(which);
r1679r1680
256256               attotime period = ((mode & PRESCALER) == PRESCALER_16) ? ctc->period16 : ctc->period256;
257257               period = attotime_mul(period, ctc->tconst[ch]);
258258
259               timer_adjust(ctc->timer[ch], period, (which << 2) + ch, period);
259               timer_adjust_periodic(ctc->timer[ch], period, (which << 2) + ch, period);
260260            }
261261            else
262               timer_adjust(ctc->timer[ch], attotime_never, 0, attotime_never);
262               timer_adjust_oneshot(ctc->timer[ch], attotime_never, 0);
263263         }
264264
265265         /* else set the bit indicating that we're waiting for the appropriate trigger */
r1679r1680
298298      /* if we're being reset, clear out any pending timers for this channel */
299299      if ((data & RESET) == RESET_ACTIVE)
300300      {
301         timer_adjust(ctc->timer[ch], attotime_never, 0, attotime_zero);
301         timer_adjust_oneshot(ctc->timer[ch], attotime_never, 0);
302302         /* note that we don't clear the interrupt state here! */
303303      }
304304
r1679r1680
371371               period = attotime_mul(period, ctc->tconst[ch]);
372372
373373               VPRINTF(("CTC period %s\n", attotime_string(period, 9)));
374               timer_adjust(ctc->timer[ch], period, (which << 2) + ch, period);
374               timer_adjust_periodic(ctc->timer[ch], period, (which << 2) + ch, period);
375375            }
376376            else
377377            {
378378               VPRINTF(("CTC disabled\n"));
379379
380               timer_adjust(ctc->timer[ch], attotime_never, 0, attotime_never);
380               timer_adjust_oneshot(ctc->timer[ch], attotime_never, 0);
381381            }
382382         }
383383
src/emu/machine/pit8253.c
r1679r1680
774774         else
775775         {
776776            timer->outputtimer = timer_alloc(outputcallback, NULL);
777            timer_adjust(timer->outputtimer, attotime_never, i   | (timerno<<4),   attotime_zero);
777            timer_adjust_oneshot(timer->outputtimer, attotime_never, i   | (timerno<<4));
778778         }
779779         if (timer->freq_callback ==   NULL)
780780            timer->freqtimer = NULL;
781781         else
782782         {
783783            timer->freqtimer = timer_alloc(freqcallback, NULL);
784            timer_adjust(timer->freqtimer,   attotime_never,   i |   (timerno<<4), attotime_zero);
784            timer_adjust_oneshot(timer->freqtimer,   attotime_never,   i |   (timerno<<4));
785785         }
786786
787787         /* set up state save values */
src/emu/machine/ds2404.c
r1679r1680
306306   ds2404.rtc[ 4 ] = ( current_time >> 24 ) & 0xff;
307307
308308   timer = timer_alloc( DS2404_tick , NULL);
309   timer_adjust( timer, ATTOTIME_IN_HZ( 256 ), 0, ATTOTIME_IN_HZ( 256 ) );
309   timer_adjust_periodic( timer, ATTOTIME_IN_HZ( 256 ), 0, ATTOTIME_IN_HZ( 256 ) );
310310}
311311
312312void DS2404_load(mame_file *file)
src/emu/machine/rtc65271.c
r1679r1680
318318   rtc.xram = xram;
319319
320320   rtc.update_timer = timer_alloc(rtc_begin_update_callback, NULL);
321   timer_adjust(rtc.update_timer, ATTOTIME_IN_SEC(1), 0, ATTOTIME_IN_SEC(1));
321   timer_adjust_periodic(rtc.update_timer, ATTOTIME_IN_SEC(1), 0, ATTOTIME_IN_SEC(1));
322322   rtc.SQW_timer = timer_alloc(rtc_SQW_callback, NULL);
323323   rtc.interrupt_callback = interrupt_callback;
324324}
r1679r1680
410410                  attotime elapsed = timer_timeelapsed(rtc.update_timer);
411411
412412                  if (attotime_compare(half_period, elapsed) > 0)
413                     timer_adjust(rtc.SQW_timer, attotime_sub(half_period, elapsed), 0, attotime_never);
413                     timer_adjust_oneshot(rtc.SQW_timer, attotime_sub(half_period, elapsed), 0);
414414                  else
415                     timer_adjust(rtc.SQW_timer, half_period, 0, attotime_never);
415                     timer_adjust_oneshot(rtc.SQW_timer, half_period, 0);
416416               }
417417               else
418418               {
419419                  rtc.SQW_internal_state = 0;   /* right??? */
420420
421421                  /* Stop the divider used for SQW and periodic interrupts. */
422                  timer_adjust(rtc.SQW_timer, attotime_never, 0, attotime_never);
422                  timer_adjust_oneshot(rtc.SQW_timer, attotime_never, 0);
423423               }
424424            }
425425            /* The UIP bit is read-only */
r1679r1680
489489   }
490490
491491   half_period = attotime_div(ATTOTIME_IN_HZ(SQW_freq_table[rtc.regs[reg_A] & reg_A_RS]), 2);
492   timer_adjust(rtc.SQW_timer, half_period, 0, attotime_never);
492   timer_adjust_oneshot(rtc.SQW_timer, half_period, 0);
493493}
494494
495495/*
src/emu/cpuexec.c
r1679r1680
415415   LOG(("cpu_boost_interleave(%s, %s)\n", attotime_string(timeslice_time, 9), attotime_string(boost_duration, 9)));
416416
417417   /* adjust the interleave timer */
418   timer_adjust(interleave_boost_timer, timeslice_time, 0, timeslice_time);
418   timer_adjust_periodic(interleave_boost_timer, timeslice_time, 0, timeslice_time);
419419
420420   /* adjust the end timer, but only if we are going to extend it */
421421   if (!timer_enabled(interleave_boost_timer_end) || attotime_compare(timer_timeleft(interleave_boost_timer_end), boost_duration) < 0)
422      timer_adjust(interleave_boost_timer_end, boost_duration, 0, attotime_never);
422      timer_adjust_oneshot(interleave_boost_timer_end, boost_duration, 0);
423423}
424424
425425
r1679r1680
823823{
824824   /* if we're not enabled, skip it */
825825   if (!watchdog_enabled)
826      timer_adjust(watchdog_timer, attotime_never, 0, attotime_zero);
826      timer_adjust_oneshot(watchdog_timer, attotime_never, 0);
827827
828828   /* VBLANK-based watchdog? */
829829   else if (machine->drv->watchdog_vblank_count != 0)
r1679r1680
831831
832832   /* timer-based watchdog? */
833833   else if (attotime_compare(machine->drv->watchdog_time, attotime_zero) != 0)
834      timer_adjust(watchdog_timer, machine->drv->watchdog_time, 0, attotime_zero);
834      timer_adjust_oneshot(watchdog_timer, machine->drv->watchdog_time, 0);
835835
836836   /* default to an obscene amount of time (3 seconds) */
837837   else
838      timer_adjust(watchdog_timer, ATTOTIME_IN_SEC(3), 0, attotime_zero);
838      timer_adjust_oneshot(watchdog_timer, ATTOTIME_IN_SEC(3), 0);
839839}
840840
841841
r1679r1680
875875      attotime remaining = timer_timeleft(vblank_timer);
876876      if (remaining.seconds == 0 && remaining.attoseconds == 0)
877877         remaining = vblank_period;
878      timer_adjust(vblank_timer, remaining, 0, vblank_period);
878      timer_adjust_periodic(vblank_timer, remaining, 0, vblank_period);
879879   }
880880
881881   LOG(("cpu_compute_vblank_timing: refresh=%s vblank=%s\n", attotime_string(refresh_period, 9), attotime_string(vblank_period, 9)));
r1679r1680
981981static TIMER_CALLBACK( cpu_firstvblankcallback )
982982{
983983   /* now that we're synced up, pulse from here on out */
984   timer_adjust(vblank_timer, vblank_period, param, vblank_period);
984   timer_adjust_periodic(vblank_timer, vblank_period, param, vblank_period);
985985
986986   /* but we need to call the standard routine as well */
987987   cpu_vblankcallback(machine, NULL, param);
r1679r1680
10261026
10271027            /* reset the countdown and timer */
10281028            cpu[cpunum].vblankint_countdown = cpu[cpunum].vblankint_multiplier;
1029            timer_adjust(cpu[cpunum].vblankint_timer, attotime_never, 0, attotime_never);
1029            timer_adjust_oneshot(cpu[cpunum].vblankint_timer, attotime_never, 0);
10301030         }
10311031      }
10321032
10331033      /* else reset the VBLANK timer if this is going to be a real VBLANK */
10341034      else if (vblank_countdown == 1)
1035         timer_adjust(cpu[cpunum].vblankint_timer, attotime_never, 0, attotime_never);
1035         timer_adjust_oneshot(cpu[cpunum].vblankint_timer, attotime_never, 0);
10361036   }
10371037
10381038   /* is it a real VBLANK? */
r1679r1680
10431043         video_frame_update(machine, FALSE);
10441044
10451045      /* Set the timer to update the screen */
1046      timer_adjust(update_timer, attotime_make(0, machine->screen[0].vblank), 0, attotime_zero);
1046      timer_adjust_oneshot(update_timer, attotime_make(0, machine->screen[0].vblank), 0);
10471047
10481048      /* reset the globals */
10491049      cpu_vblankreset(machine);
r1679r1680
10781078   current_frame++;
10791079
10801080   /* reset the refresh timer */
1081   timer_adjust(refresh_timer, attotime_never, 0, attotime_never);
1081   timer_adjust_oneshot(refresh_timer, attotime_never, 0);
10821082}
10831083
10841084
r1679r1680
11171117
11181118static TIMER_CALLBACK( end_interleave_boost )
11191119{
1120   timer_adjust(interleave_boost_timer, attotime_never, 0, attotime_never);
1120   timer_adjust_oneshot(interleave_boost_timer, attotime_never, 0);
11211121   LOG(("end_interleave_boost\n"));
11221122}
11231123
r1679r1680
11731173      ipf = 1;
11741174   timeslice_period = attotime_make(0, machine->screen[0].refresh / ipf);
11751175   timeslice_timer = timer_alloc(cpu_timeslicecallback, NULL);
1176   timer_adjust(timeslice_timer, timeslice_period, 0, timeslice_period);
1176   timer_adjust_periodic(timeslice_timer, timeslice_period, 0, timeslice_period);
11771177
11781178   /* allocate timers to handle interleave boosts */
11791179   interleave_boost_timer = timer_alloc(NULL, NULL);
r1679r1680
12461246      {
12471247         cpu[cpunum].timedint_period = attotime_make(0, machine->drv->cpu[cpunum].timed_interrupt_period);
12481248         cpu[cpunum].timedint_timer = timer_alloc(cpu_timedintcallback, NULL);
1249         timer_adjust(cpu[cpunum].timedint_timer, cpu[cpunum].timedint_period, cpunum, cpu[cpunum].timedint_period);
1249         timer_adjust_periodic(cpu[cpunum].timedint_timer, cpu[cpunum].timedint_period, cpunum, cpu[cpunum].timedint_period);
12501250      }
12511251   }
12521252
r1679r1680
12621262   timer_set(first_time, NULL, 0, cpu_firstvblankcallback);
12631263
12641264   /* reset the refresh timer to get ourself back in sync */
1265   timer_adjust(refresh_timer, attotime_never, 0, attotime_never);
1265   timer_adjust_oneshot(refresh_timer, attotime_never, 0);
12661266}
src/emu/sound/ym2413.c
r1679r1680
88** Version 1.0
99**
1010
11   Features as listed in LSI-212413A2 data sheet:
12    1. FM Sound Generator for real sound creation.
13    2. Two Selectable modes: 9 simultaneous sounds or 6 melody sounds plus 5 rhythm sounds
14       (different tones can be used together in either case).
15    3. Built-in Instruments data (15 melody tones, 5 rhythm tones, "CAPTAIN and TELETEXT applicalbe tones).
16    4. Built-in DA Converter.
17    5. Built-in Quartz Oscillator.
18    6. Built-in Vibrato Oscillator/AM Oscillator
19    7. TTL Compatible Input.
20    8. Si-Gate NMOS LSI
21    9. A single 5V power source.
1122
1223to do:
1324
src/emu/sound/2612intf.c
r1679r1680
5757   {   /* Start FM Timer */
5858      attotime period = attotime_mul(ATTOTIME_IN_HZ(clock), count);
5959      if (!timer_enable(info->timer[c], 1))
60         timer_adjust(info->timer[c], period, 0, attotime_zero);
60         timer_adjust_oneshot(info->timer[c], period, 0);
6161   }
6262}
6363
src/emu/sound/msm5205.c
r1679r1680
268268      if( prescaler )
269269      {
270270         attotime period = attotime_mul(ATTOTIME_IN_HZ(voice->clock), prescaler);
271         timer_adjust(voice->timer, period, 0, period);
271         timer_adjust_periodic(voice->timer, period, 0, period);
272272      }
273273      else
274         timer_adjust(voice->timer, attotime_never, 0, attotime_zero);
274         timer_adjust_oneshot(voice->timer, attotime_never, 0);
275275   }
276276
277277   if( voice->bitwidth != bitwidth )
src/emu/sound/3812intf.c
r1679r1680
6060   }
6161   else
6262   {   /* Start FM Timer */
63      timer_adjust(info->timer[c], period, 0, attotime_zero);
63      timer_adjust_oneshot(info->timer[c], period, 0);
6464   }
6565}
6666
r1679r1680
229229   }
230230   else
231231   {   /* Start FM Timer */
232      timer_adjust(info->timer[c], period, 0, attotime_zero);
232      timer_adjust_oneshot(info->timer[c], period, 0);
233233   }
234234}
235235
r1679r1680
394394   }
395395   else
396396   {   /* Start FM Timer */
397      timer_adjust(info->timer[c], period, 0, attotime_zero);
397      timer_adjust_oneshot(info->timer[c], period, 0);
398398   }
399399}
400400
src/emu/sound/ymf262.c
r1679r1680
1414 - thanks to Olivier Galibert and Chris Hardy for YMF262 and YAC512 chips
1515 - thanks to Stiletto for the datasheets
1616
17   Features as listed in 4MF262A6 data sheet:
18    1. Registers are compatible with YM3812 (OPL2) FM sound source.
19    2. Up to six sounds can be used as four-operator melody sounds for variety.
20    3. 18 simultaneous melody sounds, or 15 melody sounds with 5 rhythm sounds (with two operators).
21    4. 6 four-operator melody sounds and 6 two-operator melody sounds, or 6 four-operator melody
22       sounds, 3 two-operator melody sounds and 5 rhythm sounds (with four operators).
23    5. 8 selectable waveforms.
24    6. 4-channel sound output.
25    7. YMF262 compabile DAC (YAC512) is available.
26    8. LFO for vibrato and tremolo effedts.
27    9. 2 programable timers.
28   10. Shorter register access time compared with YM3812.
29   11. 5V single supply silicon gate CMOS process.
30   12. 24 Pin SOP Package (YMF262-M), 48 Pin SQFP Package (YMF262-S).
1731
1832
1933differences between OPL2 and OPL3 not documented in Yamaha datahasheets:
src/emu/sound/wave.h
r1679r1680
55 *  CassetteWave interface
66 *****************************************************************************/
77
8#ifdef MESS
89#include "messdrv.h"
10#endif
911
1012
1113
src/emu/sound/upd7759.c
r1679r1680
540540
541541   /* set a timer to go off when that is done */
542542   if (chip->state != STATE_IDLE)
543      timer_adjust(chip->timer, attotime_mul(chip->clock_period, chip->clocks_left), 0, attotime_zero);
543      timer_adjust_oneshot(chip->timer, attotime_mul(chip->clock_period, chip->clocks_left), 0);
544544}
545545
546546
r1679r1680
575575
576576   /* turn off any timer */
577577   if (chip->timer)
578      timer_adjust(chip->timer, attotime_never, 0, attotime_zero);
578      timer_adjust_oneshot(chip->timer, attotime_never, 0);
579579}
580580
581581
r1679r1680
702702
703703      /* for slave mode, start the timer going */
704704      if (chip->timer)
705         timer_adjust(chip->timer, attotime_zero, 0, attotime_zero);
705         timer_adjust_oneshot(chip->timer, attotime_zero, 0);
706706   }
707707}
708708
src/emu/sound/ymf271.c
r1679r1680
14571457               //period = (double)(256.0 - chip->timerAVal ) * ( 384.0 * 4.0 / (double)CLOCK);
14581458               period = attotime_mul(ATTOTIME_IN_HZ(chip->clock), 384 * (1024 - chip->timerAVal));
14591459
1460               timer_adjust(chip->timA, period, 0, period);
1460               timer_adjust_periodic(chip->timA, period, 0, period);
14611461            }
14621462            if (data & 0x20)
14631463            {   // timer B reset
r1679r1680
14681468
14691469               period = attotime_mul(ATTOTIME_IN_HZ(chip->clock), 384 * 16 * (256 - chip->timerBVal));
14701470
1471               timer_adjust(chip->timB, period, 0, period);
1471               timer_adjust_periodic(chip->timB, period, 0, period);
14721472            }
14731473
14741474            break;
src/emu/sound/pokey.c
r1679r1680
466466         PROCESS_SAMPLE(chip);                              \
467467      }                                                \
468468   }                                                   \
469   timer_adjust(chip->rtimer, attotime_never, 0, attotime_zero)
469   timer_adjust_oneshot(chip->rtimer, attotime_never, 0)
470470
471471#else   /* no HEAVY_MACRO_USAGE */
472472/*
r1679r1680
517517         PROCESS_CHANNEL(chip,channel);                        \
518518      }                                                \
519519   }                                                   \
520   timer_adjust(chip->rtimer, attotime_never, 0, attotime_zero)
520   timer_adjust_oneshot(chip->rtimer, attotime_never, 0)
521521
522522#endif
523523
r1679r1680
819819
820820                /* final value */
821821                p->POTx[pot] = r;
822            timer_adjust(p->ptimer[pot], attotime_mul(AD_TIME, r), pot, attotime_zero);
822            timer_adjust_oneshot(p->ptimer[pot], attotime_mul(AD_TIME, r), pot);
823823         }
824824      }
825825   }
r1679r1680
925925         LOG_RAND(("POKEY #%d adjust %u rand17[$%05x]: $%02x\n", chip, adjust, p->r17, p->RANDOM));
926926      }
927927      if (adjust > 0)
928           timer_adjust(p->rtimer, attotime_never, 0, attotime_zero);
928           timer_adjust_oneshot(p->rtimer, attotime_never, 0);
929929      data = p->RANDOM ^ 0xff;
930930      break;
931931
r1679r1680
10861086        /* first remove any existing timers */
10871087      LOG_TIMER(("POKEY #%d STIMER $%02x\n", chip, data));
10881088
1089      timer_adjust(p->timer[TIMER1], attotime_never, p->timer_param[TIMER1], attotime_zero);
1090      timer_adjust(p->timer[TIMER2], attotime_never, p->timer_param[TIMER2], attotime_zero);
1091      timer_adjust(p->timer[TIMER4], attotime_never, p->timer_param[TIMER4], attotime_zero);
1089      timer_adjust_oneshot(p->timer[TIMER1], attotime_never, p->timer_param[TIMER1]);
1090      timer_adjust_oneshot(p->timer[TIMER2], attotime_never, p->timer_param[TIMER2]);
1091      timer_adjust_oneshot(p->timer[TIMER4], attotime_never, p->timer_param[TIMER4]);
10921092
10931093        /* reset all counters to zero (side effect) */
10941094      p->polyadjust = 0;
r1679r1680
11061106            /* set timer #1 _and_ #2 event after timer_div clocks of joined CHAN1+CHAN2 */
11071107            p->timer_period[TIMER2] = attotime_mul(p->clock_period, p->divisor[CHAN2]);
11081108            p->timer_param[TIMER2] = (chip<<3)|IRQ_TIMR2|IRQ_TIMR1;
1109            timer_adjust(p->timer[TIMER2], p->timer_period[TIMER2], p->timer_param[TIMER2], p->timer_period[TIMER2]);
1109            timer_adjust_periodic(p->timer[TIMER2], p->timer_period[TIMER2], p->timer_param[TIMER2], p->timer_period[TIMER2]);
11101110         }
11111111        }
11121112        else
r1679r1680
11171117            /* set timer #1 event after timer_div clocks of CHAN1 */
11181118            p->timer_period[TIMER1] = attotime_mul(p->clock_period, p->divisor[CHAN1]);
11191119            p->timer_param[TIMER1] = (chip<<3)|IRQ_TIMR1;
1120            timer_adjust(p->timer[TIMER1], p->timer_period[TIMER1], p->timer_param[TIMER1], p->timer_period[TIMER1]);
1120            timer_adjust_periodic(p->timer[TIMER1], p->timer_period[TIMER1], p->timer_param[TIMER1], p->timer_period[TIMER1]);
11211121         }
11221122
11231123         if( p->divisor[CHAN2] > 4 )
r1679r1680
11261126            /* set timer #2 event after timer_div clocks of CHAN2 */
11271127            p->timer_period[TIMER2] = attotime_mul(p->clock_period, p->divisor[CHAN2]);
11281128            p->timer_param[TIMER2] = (chip<<3)|IRQ_TIMR2;
1129            timer_adjust(p->timer[TIMER2], p->timer_period[TIMER2], p->timer_param[TIMER2], p->timer_period[TIMER2]);
1129            timer_adjust_periodic(p->timer[TIMER2], p->timer_period[TIMER2], p->timer_param[TIMER2], p->timer_period[TIMER2]);
11301130         }
11311131        }
11321132
r1679r1680
11431143               /* set timer #4 event after timer_div clocks of CHAN4 */
11441144               p->timer_period[TIMER4] = attotime_mul(p->clock_period, p->divisor[CHAN4]);
11451145               p->timer_param[TIMER4] = (chip<<3)|IRQ_TIMR4;
1146               timer_adjust(p->timer[TIMER4], p->timer_period[TIMER4], p->timer_param[TIMER4], p->timer_period[TIMER4]);
1146               timer_adjust_periodic(p->timer[TIMER4], p->timer_period[TIMER4], p->timer_param[TIMER4], p->timer_period[TIMER4]);
11471147            }
11481148            }
11491149        }
r1679r1680
11551155            /* set timer #4 event after timer_div clocks of CHAN4 */
11561156            p->timer_period[TIMER4] = attotime_mul(p->clock_period, p->divisor[CHAN4]);
11571157            p->timer_param[TIMER4] = (chip<<3)|IRQ_TIMR4;
1158            timer_adjust(p->timer[TIMER4], p->timer_period[TIMER4], p->timer_param[TIMER4], p->timer_period[TIMER4]);
1158            timer_adjust_periodic(p->timer[TIMER4], p->timer_period[TIMER4], p->timer_param[TIMER4], p->timer_period[TIMER4]);
11591159         }
11601160        }
11611161
r1679r1680
12521252      if( new_val < p->counter[CHAN1] )
12531253         p->counter[CHAN1] = new_val;
12541254      if( p->interrupt_cb && p->timer[TIMER1] )
1255         timer_adjust(p->timer[TIMER1], attotime_mul(p->clock_period, new_val), p->timer_param[TIMER1], p->timer_period[TIMER1]);
1255         timer_adjust_periodic(p->timer[TIMER1], attotime_mul(p->clock_period, new_val), p->timer_param[TIMER1], p->timer_period[TIMER1]);
12561256      p->audible[CHAN1] = !(
12571257         (p->AUDC[CHAN1] & VOLUME_ONLY) ||
12581258         (p->AUDC[CHAN1] & VOLUME_MASK) == 0 ||
r1679r1680
12881288      if( new_val < p->counter[CHAN2] )
12891289         p->counter[CHAN2] = new_val;
12901290      if( p->interrupt_cb && p->timer[TIMER2] )
1291         timer_adjust(p->timer[TIMER2], attotime_mul(p->clock_period, new_val), p->timer_param[TIMER2], p->timer_period[TIMER2]);
1291         timer_adjust_periodic(p->timer[TIMER2], attotime_mul(p->clock_period, new_val), p->timer_param[TIMER2], p->timer_period[TIMER2]);
12921292      p->audible[CHAN2] = !(
12931293         (p->AUDC[CHAN2] & VOLUME_ONLY) ||
12941294         (p->AUDC[CHAN2] & VOLUME_MASK) == 0 ||
r1679r1680
13531353      if( new_val < p->counter[CHAN4] )
13541354         p->counter[CHAN4] = new_val;
13551355      if( p->interrupt_cb && p->timer[TIMER4] )
1356         timer_adjust(p->timer[TIMER4], attotime_mul(p->clock_period, new_val), p->timer_param[TIMER4], p->timer_period[TIMER4]);
1356         timer_adjust_periodic(p->timer[TIMER4], attotime_mul(p->clock_period, new_val), p->timer_param[TIMER4], p->timer_period[TIMER4]);
13571357      p->audible[CHAN4] = !(
13581358         (p->AUDC[CHAN4] & VOLUME_ONLY) ||
13591359         (p->AUDC[CHAN4] & VOLUME_MASK) == 0 ||
src/emu/sound/ym2151.c
r1679r1680
826826static TIMER_CALLBACK( timer_callback_a )
827827{
828828   YM2151 *chip = ptr;
829   timer_adjust(chip->timer_A, chip->timer_A_time[ chip->timer_A_index ], 0, attotime_zero);
829   timer_adjust_oneshot(chip->timer_A, chip->timer_A_time[ chip->timer_A_index ], 0);
830830   chip->timer_A_index_old = chip->timer_A_index;
831831   if (chip->irq_enable & 0x04)
832832   {
r1679r1680
839839static TIMER_CALLBACK( timer_callback_b )
840840{
841841   YM2151 *chip = ptr;
842   timer_adjust(chip->timer_B, chip->timer_B_time[ chip->timer_B_index ], 0, attotime_zero);
842   timer_adjust_oneshot(chip->timer_B, chip->timer_B_time[ chip->timer_B_index ], 0);
843843   chip->timer_B_index_old = chip->timer_B_index;
844844   if (chip->irq_enable & 0x08)
845845   {
r1679r1680
11331133            /* start timer _only_ if it wasn't already started (it will reload time value next round) */
11341134               if (!timer_enable(chip->timer_B, 1))
11351135               {
1136                  timer_adjust(chip->timer_B, chip->timer_B_time[ chip->timer_B_index ], 0, attotime_zero);
1136                  timer_adjust_oneshot(chip->timer_B, chip->timer_B_time[ chip->timer_B_index ], 0);
11371137                  chip->timer_B_index_old = chip->timer_B_index;
11381138               }
11391139            #else
r1679r1680
11581158            /* start timer _only_ if it wasn't already started (it will reload time value next round) */
11591159               if (!timer_enable(chip->timer_A, 1))
11601160               {
1161                  timer_adjust(chip->timer_A, chip->timer_A_time[ chip->timer_A_index ], 0, attotime_zero);
1161                  timer_adjust_oneshot(chip->timer_A, chip->timer_A_time[ chip->timer_A_index ], 0);
11621162                  chip->timer_A_index_old = chip->timer_A_index;
11631163               }
11641164            #else
src/emu/sound/scsp.c
r1679r1680
2222                             Enabled DSP again.
2323    * December 16, 2007 (kingshriek) Many EG bug fixes, implemented effects mixer,
2424                             implemented FM.
25    * January 5, 2007   (kingshriek+RB) Working, good-sounding FM, removed obsolete non-USEDSP code.
25    * January 5, 2008   (kingshriek+RB) Working, good-sounding FM, removed obsolete non-USEDSP code.
2626*/
2727
2828#include "sndintrf.h"
r1679r1680
735735               time = (44100 / SCSP->TimPris[0]) / (255-(SCSP->udata.data[0x18/2]&0xff));
736736               if (time)
737737               {
738                  timer_adjust(SCSP->timerA, ATTOTIME_IN_HZ(time), 0, attotime_never);
738                  timer_adjust_oneshot(SCSP->timerA, ATTOTIME_IN_HZ(time), 0);
739739               }
740740            }
741741         }
r1679r1680
754754               time = (44100 / SCSP->TimPris[1]) / (255-(SCSP->udata.data[0x1A/2]&0xff));
755755               if (time)
756756               {
757                  timer_adjust(SCSP->timerB, ATTOTIME_IN_HZ(time), 0, attotime_never);
757                  timer_adjust_oneshot(SCSP->timerB, ATTOTIME_IN_HZ(time), 0);
758758               }
759759            }
760760         }
r1679r1680
773773               time = (44100 / SCSP->TimPris[2]) / (255-(SCSP->udata.data[0x1C/2]&0xff));
774774               if (time)
775775               {
776                  timer_adjust(SCSP->timerC, ATTOTIME_IN_HZ(time), 0, attotime_never);
776                  timer_adjust_oneshot(SCSP->timerC, ATTOTIME_IN_HZ(time), 0);
777777               }
778778            }
779779         }
src/emu/sound/2610intf.c
r1679r1680
9393      attotime period = attotime_mul(ATTOTIME_IN_HZ(clock), count);
9494
9595      if (!timer_enable(info->timer[c], 1))
96         timer_adjust(info->timer[c], period, 0, attotime_zero);
96         timer_adjust_oneshot(info->timer[c], period, 0);
9797   }
9898}
9999
src/emu/sound/ics2115.c
r1679r1680
195195   if(chip->timer[timer].period != period) {
196196      chip->timer[timer].period = period;
197197      if(period)
198         timer_adjust(chip->timer[timer].timer, ATTOTIME_IN_NSEC(period), 0, ATTOTIME_IN_NSEC(period));
198         timer_adjust_periodic(chip->timer[timer].timer, ATTOTIME_IN_NSEC(period), 0, ATTOTIME_IN_NSEC(period));
199199      else
200         timer_adjust(chip->timer[timer].timer, attotime_never, 0, attotime_zero);
200         timer_adjust_oneshot(chip->timer[timer].timer, attotime_never, 0);
201201   }
202202}
203203
r1679r1680
532532   chip->irq_en = 0;
533533   chip->irq_pend = 0;
534534   memset(chip->voice, 0, sizeof(chip->voice));
535   timer_adjust(chip->timer[0].timer, attotime_never, 0, attotime_zero);
536   timer_adjust(chip->timer[1].timer, attotime_never, 0, attotime_zero);
535   timer_adjust_oneshot(chip->timer[0].timer, attotime_never, 0);
536   timer_adjust_oneshot(chip->timer[1].timer, attotime_never, 0);
537537   chip->timer[0].period = 0;
538538   chip->timer[1].period = 0;
539539   recalc_irq(chip);
src/emu/sound/2608intf.c
r1679r1680
9292   {   /* Start FM Timer */
9393      attotime period = attotime_mul(ATTOTIME_IN_HZ(clock), count);
9494      if (!timer_enable(info->timer[c], 1))
95         timer_adjust(info->timer[c], period, 0, attotime_zero);
95         timer_adjust_oneshot(info->timer[c], period, 0);
9696   }
9797}
9898
src/emu/sound/ymf278b.c
r1679r1680
373373      if (chip->clock != YMF278B_STD_CLOCK)
374374         period = attotime_div(attotime_mul(period, chip->clock), YMF278B_STD_CLOCK);
375375
376      timer_adjust(chip->timer_a, period, 0, period);
376      timer_adjust_periodic(chip->timer_a, period, 0, period);
377377   }
378378   else
379      timer_adjust(chip->timer_a, attotime_never, 0, attotime_zero);
379      timer_adjust_oneshot(chip->timer_a, attotime_never, 0);
380380}
381381
382382static void ymf278b_timer_b_reset(YMF278BChip *chip)
r1679r1680
388388      if (chip->clock != YMF278B_STD_CLOCK)
389389         period = attotime_div(attotime_mul(period, chip->clock), YMF278B_STD_CLOCK);
390390
391      timer_adjust(chip->timer_a, period, 0, period);
391      timer_adjust_periodic(chip->timer_a, period, 0, period);
392392   }
393393   else
394      timer_adjust(chip->timer_b, attotime_never, 0, attotime_zero);
394      timer_adjust_oneshot(chip->timer_b, attotime_never, 0);
395395}
396396
397397static void ymf278b_A_w(YMF278BChip *chip, UINT8 reg, UINT8 data)
src/emu/sound/sound.mak
r1679r1680
592592SOUNDDEFS += -DHAS_TMS5200=$(if $(filter TMS5200,$(SOUNDS)),1,0)
593593SOUNDDEFS += -DHAS_TMS5220=$(if $(filter TMS5220,$(SOUNDS)),1,0)
594594
595ifneq ($(filter TMS5110,$(SOUNDS)),)
595ifneq ($(filter TMS5100 TMS5110 TMS5110A CD2801 TMC0281 CD2802 M58817,$(SOUNDS)),)
596596SOUNDOBJS += $(SOUNDOBJ)/tms5110.o $(SOUNDOBJ)/5110intf.o
597597endif
598598
src/emu/sound/2203intf.c
r1679r1680
8686   {   /* Start FM Timer */
8787      attotime period = attotime_mul(ATTOTIME_IN_HZ(clock), count);
8888      if (!timer_enable(info->timer[c], 1))
89         timer_adjust(info->timer[c], period, 0, attotime_zero);
89         timer_adjust_oneshot(info->timer[c], period, 0);
9090   }
9191}
9292
src/emu/sound/es5503.c
r1679r1680
460460                  // ok, we run for this long
461461                  period = attotime_mul(ATTOTIME_IN_HZ(chip->output_rate), length);
462462
463                  timer_adjust(chip->oscillators[osc].timer, period, 0, period);
463                  timer_adjust_periodic(chip->oscillators[osc].timer, period, 0, period);
464464               }
465465            }
466466            else if (!(chip->oscillators[osc].control & 1) && (data&1))
467467            {
468468               // key off
469               timer_adjust(chip->oscillators[osc].timer, attotime_never, 0, attotime_never);
469               timer_adjust_oneshot(chip->oscillators[osc].timer, attotime_never, 0);
470470            }
471471
472472            chip->oscillators[osc].control = data;
src/emu/sound/262intf.c
r1679r1680
4949   }
5050   else
5151   {   /* Start FM Timer */
52      timer_adjust(info->timer[timer], period, 0, attotime_zero);
52      timer_adjust_oneshot(info->timer[timer], period, 0);
5353   }
5454}
5555
src/emu/sound.c
r1679r1680
192192
193193   /* allocate a global timer for sound timing */
194194   sound_update_timer = timer_alloc(sound_update, NULL);
195   timer_adjust(sound_update_timer, update_frequency, 0, update_frequency);
195   timer_adjust_periodic(sound_update_timer, update_frequency, 0, update_frequency);
196196
197197   /* initialize the streams engine */
198198   VPRINTF(("streams_init\n"));
src/emu/drawgfx.c
r1679r1680
925925                                     transparency.
926926  transparency == TRANSPARENCY_PENS - as above, but transparent_color is a mask of
927927                                     transparent pens.
928  transparency == TRANSPARENCY_COLOR - bits whose _remapped_ palette index (taken from
929                                     machine->game_colortable) is == transparent_color
930
931928  transparency == TRANSPARENCY_PEN_TABLE - the transparency condition is same as TRANSPARENCY_PEN
932929                    A special drawing is done according to gfx_drawmode_table[source pixel].
933930                    DRAWMODE_NONE      transparent
r1679r1680
945942
946943   code %= gfx->total_elements;
947944
948   if ((transparency != TRANSPARENCY_PEN_RAW) && (transparency != TRANSPARENCY_BLEND_RAW))
945   if (transparency != TRANSPARENCY_PEN_RAW)
949946      color %= gfx->total_colors;
950947
951948   if ((dest->format == BITMAP_FORMAT_INDEXED8 || dest->format == BITMAP_FORMAT_INDEXED16 || dest->format == BITMAP_FORMAT_INDEXED32) &&
r1679r1680
13201317      transparent_color = -1;
13211318   }
13221319
1323   /* if necessary, remap the transparent color */
1324   if (transparency == TRANSPARENCY_COLOR)
1325   {
1326      transparency = TRANSPARENCY_PEN;
1327      transparent_color = Machine->pens[transparent_color];
1328   }
1329
13301320   if (transparency != TRANSPARENCY_PEN)
13311321   {
13321322      popmessage("copyrozbitmap unsupported trans %02x",transparency);
r1679r1680
13641354      return;
13651355   }
13661356
1367   if (transparency != TRANSPARENCY_PEN && transparency != TRANSPARENCY_PEN_RAW
1368         && transparency != TRANSPARENCY_PENS && transparency != TRANSPARENCY_COLOR
1369         && transparency != TRANSPARENCY_PEN_TABLE
1370         && transparency != TRANSPARENCY_BLEND_RAW
1371         && transparency != TRANSPARENCY_ALPHA && transparency != TRANSPARENCY_ALPHARANGE
1372         && transparency != TRANSPARENCY_NONE)
1373   {
1374      popmessage("drawgfxzoom unsupported trans %02x",transparency);
1375      return;
1376   }
1377
13781357   if ((dest_bmp->format == BITMAP_FORMAT_INDEXED8 || dest_bmp->format == BITMAP_FORMAT_INDEXED16 || dest_bmp->format == BITMAP_FORMAT_INDEXED32) &&
13791358      (transparency == TRANSPARENCY_ALPHA || transparency == TRANSPARENCY_ALPHARANGE))
13801359   {
r1679r1680
13821361      transparent_color &= 0xff;
13831362   }
13841363
1385   if (transparency == TRANSPARENCY_COLOR)
1386      transparent_color = Machine->pens[transparent_color];
1387
1388
13891364   /*
13901365    scalex and scaley are 16.16 fixed point numbers
13911366    1<<15 : shrink to 50%
r1679r1680
17111686                  }
17121687               }
17131688
1714               /* case 1c: TRANSPARENCY_BLEND_RAW */
1715               if (transparency == TRANSPARENCY_BLEND_RAW)
1716               {
1717                  if (pri_buffer)
1718                  {
1719                     for( y=sy; y<ey; y++ )
1720                     {
1721                        UINT8 *source = source_base + (y_index>>16) * gfx->line_modulo;
1722                        UINT8 *dest = BITMAP_ADDR8(dest_bmp, y, 0);
1723                        UINT8 *pri = BITMAP_ADDR8(pri_buffer, y, 0);
1724
1725                        int x, x_index = x_index_base;
1726                        for( x=sx; x<ex; x++ )
1727                        {
1728                           int c = source[x_index>>16];
1729                           if( c != transparent_color )
1730                           {
1731                              if (((1 << pri[x]) & pri_mask) == 0)
1732                                 dest[x] |= (color + c);
1733                              pri[x] = 31;
1734                           }
1735                           x_index += dx;
1736                        }
1737
1738                        y_index += dy;
1739                     }
1740                  }
1741                  else
1742                  {
1743                     for( y=sy; y<ey; y++ )
1744                     {
1745                        UINT8 *source = source_base + (y_index>>16) * gfx->line_modulo;
1746                        UINT8 *dest = BITMAP_ADDR8(dest_bmp, y, 0);
1747
1748                        int x, x_index = x_index_base;
1749                        for( x=sx; x<ex; x++ )
1750                        {
1751                           int c = source[x_index>>16];
1752                           if( c != transparent_color ) dest[x] |= (color + c);
1753                           x_index += dx;
1754                        }
1755
1756                        y_index += dy;
1757                     }
1758                  }
1759               }
1760
17611689               /* case 2: TRANSPARENCY_PENS */
17621690               if (transparency == TRANSPARENCY_PENS)
17631691               {
r1679r1680
18061734                  }
18071735               }
18081736
1809               /* case 3: TRANSPARENCY_COLOR */
1810               else if (transparency == TRANSPARENCY_COLOR)
1811               {
1812                  if (pri_buffer)
1813                  {
1814                     for( y=sy; y<ey; y++ )
1815                     {
1816                        UINT8 *source = source_base + (y_index>>16) * gfx->line_modulo;
1817                        UINT8 *dest = BITMAP_ADDR8(dest_bmp, y, 0);
1818                        UINT8 *pri = BITMAP_ADDR8(pri_buffer, y, 0);
1819
1820                        int x, x_index = x_index_base;
1821                        for( x=sx; x<ex; x++ )
1822                        {
1823                           int c = pal[source[x_index>>16]];
1824                           if( c != transparent_color )
1825                           {
1826                              if (((1 << pri[x]) & pri_mask) == 0)
1827                                 dest[x] = c;
1828                              pri[x] = 31;
1829                           }
1830                           x_index += dx;
1831                        }
1832
1833                        y_index += dy;
1834                     }
1835                  }
1836                  else
1837                  {
1838                     for( y=sy; y<ey; y++ )
1839                     {
1840                        UINT8 *source = source_base + (y_index>>16) * gfx->line_modulo;
1841                        UINT8 *dest = BITMAP_ADDR8(dest_bmp, y, 0);
1842
1843                        int x, x_index = x_index_base;
1844                        for( x=sx; x<ex; x++ )
1845                        {
1846                           int c = pal[source[x_index>>16]];
1847                           if( c != transparent_color ) dest[x] = c;
1848                           x_index += dx;
1849                        }
1850
1851                        y_index += dy;
1852                     }
1853                  }
1854               }
1855
1856               /* case 4: TRANSPARENCY_PEN_TABLE */
1737               /* case 3: TRANSPARENCY_PEN_TABLE */
18571738               if (transparency == TRANSPARENCY_PEN_TABLE)
18581739               {
18591740                  pen_t *palette_shadow_table = Machine->shadow_table;
r1679r1680
22322113                  }
22332114               }
22342115
2235               /* case 1c: TRANSPARENCY_BLEND_RAW */
2236               if (transparency == TRANSPARENCY_BLEND_RAW)
2237               {
2238                  if (pri_buffer)
2239                  {
2240                     for( y=sy; y<ey; y++ )
2241                     {
2242                        UINT8 *source = source_base + (y_index>>16) * gfx->line_modulo;
2243                        UINT16 *dest = BITMAP_ADDR16(dest_bmp, y, 0);
2244                        UINT8 *pri = BITMAP_ADDR8(pri_buffer, y, 0);
2245
2246                        int x, x_index = x_index_base;
2247                        for( x=sx; x<ex; x++ )
2248                        {
2249                           int c = source[x_index>>16];
2250                           if( c != transparent_color )
2251                           {
2252                              if (((1 << pri[x]) & pri_mask) == 0)
2253                                 dest[x] |= color + c;
2254                              pri[x] = 31;
2255                           }
2256                           x_index += dx;
2257                        }
2258
2259                        y_index += dy;
2260                     }
2261                  }
2262                  else
2263                  {
2264                     for( y=sy; y<ey; y++ )
2265                     {
2266                        UINT8 *source = source_base + (y_index>>16) * gfx->line_modulo;
2267                        UINT16 *dest = BITMAP_ADDR16(dest_bmp, y, 0);
2268
2269                        int x, x_index = x_index_base;
2270                        for( x=sx; x<ex; x++ )
2271                        {
2272                           int c = source[x_index>>16];
2273                           if( c != transparent_color ) dest[x] |= color + c;
2274                           x_index += dx;
2275                        }
2276
2277                        y_index += dy;
2278                     }
2279                  }
2280               }
2281
22822116               /* case 2: TRANSPARENCY_PENS */
22832117               if (transparency == TRANSPARENCY_PENS)
22842118               {
r1679r1680
23272161                  }
23282162               }
23292163
2330               /* case 3: TRANSPARENCY_COLOR */
2331               else if (transparency == TRANSPARENCY_COLOR)
2332               {
2333                  if (pri_buffer)
2334                  {
2335                     for( y=sy; y<ey; y++ )
2336                     {
2337                        UINT8 *source = source_base + (y_index>>16) * gfx->line_modulo;
2338                        UINT16 *dest = BITMAP_ADDR16(dest_bmp, y, 0);
2339                        UINT8 *pri = BITMAP_ADDR8(pri_buffer, y, 0);
2340
2341                        int x, x_index = x_index_base;
2342                        for( x=sx; x<ex; x++ )
2343                        {
2344                           int c = pal[source[x_index>>16]];
2345                           if( c != transparent_color )
2346                           {
2347                              if (((1 << pri[x]) & pri_mask) == 0)
2348                                 dest[x] = c;
2349                              pri[x] = 31;
2350                           }
2351                           x_index += dx;
2352                        }
2353
2354                        y_index += dy;
2355                     }
2356                  }
2357                  else
2358                  {
2359                     for( y=sy; y<ey; y++ )
2360                     {
2361                        UINT8 *source = source_base + (y_index>>16) * gfx->line_modulo;
2362                        UINT16 *dest = BITMAP_ADDR16(dest_bmp, y, 0);
2363
2364                        int x, x_index = x_index_base;
2365                        for( x=sx; x<ex; x++ )
2366                        {
2367                           int c = pal[source[x_index>>16]];
2368                           if( c != transparent_color ) dest[x] = c;
2369                           x_index += dx;
2370                        }
2371
2372                        y_index += dy;
2373                     }
2374                  }
2375               }
2376
2377               /* case 4: TRANSPARENCY_PEN_TABLE */
2164               /* case 3: TRANSPARENCY_PEN_TABLE */
23782165               if (transparency == TRANSPARENCY_PEN_TABLE)
23792166               {
23802167                  pen_t *palette_shadow_table = Machine->shadow_table;
r1679r1680
27692556                  }
27702557               }
27712558
2772               /* case 1c: TRANSPARENCY_BLEND_RAW */
2773               if (transparency == TRANSPARENCY_BLEND_RAW)
2774               {
2775                  if (pri_buffer)
2776                  {
2777                     for( y=sy; y<ey; y++ )
2778                     {
2779                        UINT8 *source = source_base + (y_index>>16) * gfx->line_modulo;
2780                        UINT32 *dest = BITMAP_ADDR32(dest_bmp, y, 0);
2781                        UINT8 *pri = BITMAP_ADDR8(pri_buffer, y, 0);
2782
2783                        int x, x_index = x_index_base;
2784                        for( x=sx; x<ex; x++ )
2785                        {
2786                           int c = source[x_index>>16];
2787                           if( c != transparent_color )
2788                           {
2789                              if (((1 << pri[x]) & pri_mask) == 0)
2790                                 dest[x] |= color + c;
2791                              pri[x] = 31;
2792                           }
2793                           x_index += dx;
2794                        }
2795
2796                        y_index += dy;
2797                     }
2798                  }
2799                  else
2800                  {
2801                     for( y=sy; y<ey; y++ )
2802                     {
2803                        UINT8 *source = source_base + (y_index>>16) * gfx->line_modulo;
2804                        UINT32 *dest = BITMAP_ADDR32(dest_bmp, y, 0);
2805
2806                        int x, x_index = x_index_base;
2807                        for( x=sx; x<ex; x++ )
2808                        {
2809                           int c = source[x_index>>16];
2810                           if( c != transparent_color ) dest[x] |= color + c;
2811                           x_index += dx;
2812                        }
2813
2814                        y_index += dy;
2815                     }
2816                  }
2817               }
2818
28192559               /* case 2: TRANSPARENCY_PENS */
28202560               if (transparency == TRANSPARENCY_PENS)
28212561               {
r1679r1680
28642604                  }
28652605               }
28662606
2867               /* case 3: TRANSPARENCY_COLOR */
2868               else if (transparency == TRANSPARENCY_COLOR)
2869               {
2870                  if (pri_buffer)
2871                  {
2872                     for( y=sy; y<ey; y++ )
2873                     {
2874                        UINT8 *source = source_base + (y_index>>16) * gfx->line_modulo;
2875                        UINT32 *dest = BITMAP_ADDR32(dest_bmp, y, 0);
2876                        UINT8 *pri = BITMAP_ADDR8(pri_buffer, y, 0);
2877
2878                        int x, x_index = x_index_base;
2879                        for( x=sx; x<ex; x++ )
2880                        {
2881                           int c = pal[source[x_index>>16]];
2882                           if( c != transparent_color )
2883                           {
2884                              if (((1 << pri[x]) & pri_mask) == 0)
2885                                 dest[x] = c;
2886                              pri[x] = 31;
2887                           }
2888                           x_index += dx;
2889                        }
2890
2891                        y_index += dy;
2892                     }
2893                  }
2894                  else
2895                  {
2896                     for( y=sy; y<ey; y++ )
2897                     {
2898                        UINT8 *source = source_base + (y_index>>16) * gfx->line_modulo;
2899                        UINT32 *dest = BITMAP_ADDR32(dest_bmp, y, 0);
2900
2901                        int x, x_index = x_index_base;
2902                        for( x=sx; x<ex; x++ )
2903                        {
2904                           int c = pal[source[x_index>>16]];
2905                           if( c != transparent_color ) dest[x] = c;
2906                           x_index += dx;
2907                        }
2908
2909                        y_index += dy;
2910                     }
2911                  }
2912               }
2913
2914               /* case 4: TRANSPARENCY_PEN_TABLE */
2607               /* case 3: TRANSPARENCY_PEN_TABLE */
29152608               if (transparency == TRANSPARENCY_PEN_TABLE)
29162609               {
29172610                  pen_t *palette_shadow_table = Machine->shadow_table;
r1679r1680
35483241   }
35493242})
35503243
3551#if (RAW == 1)
3552DECLARE_SWAP_RAW_PRI(blockmove_8toN_transblend,(COMMON_ARGS,
3553      COLOR_ARG,int transpen),
3554{
3555   pen_t *palette_shadow_table = Machine->shadow_table;
3556   ADJUST_8
35573244
3558   (void)palette_shadow_table;
3559
3560   if (flipx)
3561   {
3562      DATA_TYPE *end;
3563      int trans4;
3564      UINT32 *sd4;
3565
3566      trans4 = transpen * 0x01010101;
3567
3568      while (dstheight)
3569      {
3570         end = dstdata - dstwidth*HMODULO;
3571         while (((FPTR)srcdata & 3) && dstdata > end)   /* longword align */
3572         {
3573            int col;
3574
3575            col = *(srcdata++);
3576            if (col != transpen) SETPIXELCOLOR(0,*dstdata | LOOKUP(col))
3577            INCREMENT_DST(-HMODULO);
3578         }
3579         sd4 = (UINT32 *)srcdata;
3580         while (dstdata >= end + 4*HMODULO)
3581         {
3582            UINT32 col4;
3583
3584            INCREMENT_DST(-4*HMODULO);
3585            if ((col4 = *(sd4++)) != trans4)
3586            {
3587               UINT32 xod4;
3588
3589               xod4 = col4 ^ trans4;
3590               if (xod4 & (0xff<<SHIFT0)) SETPIXELCOLOR(4*HMODULO,dstdata[4*HMODULO] | LOOKUP((col4>>SHIFT0) & 0xff))
3591               if (xod4 & (0xff<<SHIFT1)) SETPIXELCOLOR(3*HMODULO,dstdata[3*HMODULO] | LOOKUP((col4>>SHIFT1) & 0xff))
3592               if (xod4 & (0xff<<SHIFT2)) SETPIXELCOLOR(2*HMODULO,dstdata[2*HMODULO] | LOOKUP((col4>>SHIFT2) & 0xff))
3593               if (xod4 & (0xff<<SHIFT3)) SETPIXELCOLOR(1*HMODULO,dstdata[1*HMODULO] | LOOKUP((col4>>SHIFT3) & 0xff))
3594            }
3595         }
3596         srcdata = (UINT8 *)sd4;
3597         while (dstdata > end)
3598         {
3599            int col;
3600
3601            col = *(srcdata++);
3602            if (col != transpen) SETPIXELCOLOR(0,*dstdata | LOOKUP(col))
3603            INCREMENT_DST(-HMODULO);
3604         }
3605
3606         srcdata += srcmodulo;
3607         INCREMENT_DST(ydir*VMODULO + dstwidth*HMODULO);
3608         dstheight--;
3609      }
3610   }
3611   else
3612   {
3613      DATA_TYPE *end;
3614      int trans4;
3615      UINT32 *sd4;
3616
3617      trans4 = transpen * 0x01010101;
3618
3619      while (dstheight)
3620      {
3621         end = dstdata + dstwidth*HMODULO;
3622         while (((FPTR)srcdata & 3) && dstdata < end)   /* longword align */
3623         {
3624            int col;
3625
3626            col = *(srcdata++);
3627            if (col != transpen) SETPIXELCOLOR(0,*dstdata | LOOKUP(col))
3628            INCREMENT_DST(HMODULO);
3629         }
3630         sd4 = (UINT32 *)srcdata;
3631         while (dstdata <= end - 4*HMODULO)
3632         {
3633            UINT32 col4;
3634
3635            if ((col4 = *(sd4++)) != trans4)
3636            {
3637               UINT32 xod4;
3638
3639               xod4 = col4 ^ trans4;
3640               if (xod4 & (0xff<<SHIFT0)) SETPIXELCOLOR(0*HMODULO,dstdata[0*HMODULO] | LOOKUP((col4>>SHIFT0) & 0xff))
3641               if (xod4 & (0xff<<SHIFT1)) SETPIXELCOLOR(1*HMODULO,dstdata[1*HMODULO] | LOOKUP((col4>>SHIFT1) & 0xff))
3642               if (xod4 & (0xff<<SHIFT2)) SETPIXELCOLOR(2*HMODULO,dstdata[2*HMODULO] | LOOKUP((col4>>SHIFT2) & 0xff))
3643               if (xod4 & (0xff<<SHIFT3)) SETPIXELCOLOR(3*HMODULO,dstdata[3*HMODULO] | LOOKUP((col4>>SHIFT3) & 0xff))
3644            }
3645            INCREMENT_DST(4*HMODULO);
3646         }
3647         srcdata = (UINT8 *)sd4;
3648         while (dstdata < end)
3649         {
3650            int col;
3651
3652            col = *(srcdata++);
3653            if (col != transpen) SETPIXELCOLOR(0,*dstdata | LOOKUP(col))
3654            INCREMENT_DST(HMODULO);
3655         }
3656
3657         srcdata += srcmodulo;
3658         INCREMENT_DST(ydir*VMODULO - dstwidth*HMODULO);
3659         dstheight--;
3660      }
3661   }
3662})
3663#endif
3664
3665
36663245#if (RAW == 0)
36673246#define PEN_IS_OPAQUE ((1<<col)&transmask) == 0
36683247
r1679r1680
37743353#endif
37753354
37763355#if (RAW == 0)
3777DECLARE_SWAP_RAW_PRI(blockmove_8toN_transcolor,(COMMON_ARGS,
3778      COLOR_ARG,const UINT16 *colortable,int transcolor),
3779{
3780   pen_t *palette_shadow_table = Machine->shadow_table;
3781   ADJUST_8
3782
3783   (void)palette_shadow_table;
3784
3785   if (flipx)
3786   {
3787      DATA_TYPE *end;
3788
3789      while (dstheight)
3790      {
3791         end = dstdata - dstwidth*HMODULO;
3792         while (dstdata > end)
3793         {
3794            if (colortable[*srcdata] != transcolor) SETPIXELCOLOR(0,LOOKUP(*srcdata))
3795            srcdata++;
3796            INCREMENT_DST(-HMODULO)
3797         }
3798
3799         srcdata += srcmodulo;
3800         INCREMENT_DST(ydir*VMODULO + dstwidth*HMODULO)
3801         dstheight--;
3802      }
3803   }
3804   else
3805   {
3806      DATA_TYPE *end;
3807
3808      while (dstheight)
3809      {
3810         end = dstdata + dstwidth*HMODULO;
3811         while (dstdata < end)
3812         {
3813            if (colortable[*srcdata] != transcolor) SETPIXELCOLOR(0,LOOKUP(*srcdata))
3814            srcdata++;
3815            INCREMENT_DST(HMODULO)
3816         }
3817
3818         srcdata += srcmodulo;
3819         INCREMENT_DST(ydir*VMODULO - dstwidth*HMODULO)
3820         dstheight--;
3821      }
3822   }
3823})
3824
3825DECLARE_SWAP_RAW_PRI(blockmove_4toN_transcolor,(COMMON_ARGS,
3826      COLOR_ARG,const UINT16 *colortable,int transcolor),
3827{
3828   pen_t *palette_shadow_table = Machine->shadow_table;
3829   ADJUST_4
3830
3831   (void)palette_shadow_table;
3832
3833   if (flipx)
3834   {
3835      DATA_TYPE *end;
3836
3837      while (dstheight)
3838      {
3839         int col;
3840
3841         end = dstdata - dstwidth*HMODULO;
3842         if (leftskip)
3843         {
3844            col = *(srcdata++)>>4;
3845            if (colortable[col] != transcolor) SETPIXELCOLOR(0,LOOKUP(col))
3846            INCREMENT_DST(-HMODULO)
3847         }
3848         while (dstdata > end)
3849         {
3850            col = *(srcdata)&0x0f;
3851            if (colortable[col] != transcolor) SETPIXELCOLOR(0,LOOKUP(col))
3852            INCREMENT_DST(-HMODULO)
3853            if (dstdata > end)
3854            {
3855               col = *(srcdata++)>>4;
3856               if (colortable[col] != transcolor) SETPIXELCOLOR(0,LOOKUP(col))
3857               INCREMENT_DST(-HMODULO)
3858            }
3859         }
3860
3861         srcdata += srcmodulo;
3862         INCREMENT_DST(ydir*VMODULO + dstwidth*HMODULO)
3863         dstheight--;
3864      }
3865   }
3866   else
3867   {
3868      DATA_TYPE *end;
3869
3870      while (dstheight)
3871      {
3872         int col;
3873
3874         end = dstdata + dstwidth*HMODULO;
3875         if (leftskip)
3876         {
3877            col = *(srcdata++)>>4;
3878            if (colortable[col] != transcolor) SETPIXELCOLOR(0,LOOKUP(col))
3879            INCREMENT_DST(HMODULO)
3880         }
3881         while (dstdata < end)
3882         {
3883            col = *(srcdata)&0x0f;
3884            if (colortable[col] != transcolor) SETPIXELCOLOR(0,LOOKUP(col))
3885            INCREMENT_DST(HMODULO)
3886            if (dstdata < end)
3887            {
3888               col = *(srcdata++)>>4;
3889               if (colortable[col] != transcolor) SETPIXELCOLOR(0,LOOKUP(col))
3890               INCREMENT_DST(HMODULO)
3891            }
3892         }
3893
3894         srcdata += srcmodulo;
3895         INCREMENT_DST(ydir*VMODULO - dstwidth*HMODULO)
3896         dstheight--;
3897      }
3898   }
3899})
3900#endif
3901
3902#if (RAW == 0)
39033356#if DEPTH == 32
39043357DECLARE_SWAP_RAW_PRI(blockmove_8toN_pen_table,(COMMON_ARGS,
39053358      COLOR_ARG,int transcolor),
r1679r1680
44063859               BLOCKMOVELU(8toN_transmask,(sd,sw,sh,sm,ls,ts,flipx,flipy,dd,dw,dh,dm,paldata,transparent_color));
44073860            break;
44083861
4409         case TRANSPARENCY_COLOR:
4410            if (gfx->flags & GFX_ELEMENT_PACKED)
4411            {
4412               if (pribuf)
4413                  BLOCKMOVEPRI(4toN_transcolor,(sd,sw,sh,sm,ls,ts,flipx,flipy,dd,dw,dh,dm,paldata,pribuf,pri_mask,Machine->game_colortable + (paldata - Machine->remapped_colortable),transparent_color));
4414               else
4415                  BLOCKMOVELU(4toN_transcolor,(sd,sw,sh,sm,ls,ts,flipx,flipy,dd,dw,dh,dm,paldata,Machine->game_colortable + (paldata - Machine->remapped_colortable),transparent_color));
4416            }
4417            else
4418            {
4419               if (pribuf)
4420                  BLOCKMOVEPRI(8toN_transcolor,(sd,sw,sh,sm,ls,ts,flipx,flipy,dd,dw,dh,dm,paldata,pribuf,pri_mask,Machine->game_colortable + (paldata - Machine->remapped_colortable),transparent_color));
4421               else
4422                  BLOCKMOVELU(8toN_transcolor,(sd,sw,sh,sm,ls,ts,flipx,flipy,dd,dw,dh,dm,paldata,Machine->game_colortable + (paldata - Machine->remapped_colortable),transparent_color));
4423            }
4424            break;
4425
44263862         case TRANSPARENCY_PEN_TABLE:
44273863            if (pribuf)
44283864               BLOCKMOVEPRI(8toN_pen_table,(sd,sw,sh,sm,ls,ts,flipx,flipy,dd,dw,dh,dm,paldata,pribuf,pri_mask,transparent_color));
r1679r1680
44303866               BLOCKMOVELU(8toN_pen_table,(sd,sw,sh,sm,ls,ts,flipx,flipy,dd,dw,dh,dm,paldata,transparent_color));
44313867            break;
44323868
4433         case TRANSPARENCY_BLEND_RAW:
4434            if (pribuf)
4435               BLOCKMOVERAWPRI(8toN_transblend,(sd,sw,sh,sm,ls,ts,flipx,flipy,dd,dw,dh,dm,color,pribuf,pri_mask,transparent_color));
4436            else
4437               BLOCKMOVERAW(8toN_transblend,(sd,sw,sh,sm,ls,ts,flipx,flipy,dd,dw,dh,dm,color,transparent_color));
4438            break;
4439
44403869         case TRANSPARENCY_ALPHA:
44413870            if (pribuf)
44423871               BLOCKMOVEPRI(8toN_alpha,(sd,sw,sh,sm,ls,ts,flipx,flipy,dd,dw,dh,dm,paldata,pribuf,pri_mask,transparent_color));
src/emu/drawgfx.h
r1679r1680
5454   TRANSPARENCY_PEN,         /* single pen transparency with remapping */
5555   TRANSPARENCY_PEN_RAW,      /* single pen transparency with no remapping */
5656   TRANSPARENCY_PENS,         /* multiple pen transparency with remapping */
57   TRANSPARENCY_COLOR,         /* single remapped pen transparency with remapping */
5857   TRANSPARENCY_PEN_TABLE,      /* special pen remapping modes (see DRAWMODE_xxx below) with remapping */
59   TRANSPARENCY_BLEND_RAW,      /* blend two bitmaps, shifting the source and ORing to the dest with no remapping */
6058   TRANSPARENCY_ALPHA,         /* single pen transparency, other pens alpha */
6159   TRANSPARENCY_ALPHARANGE,   /* single pen transparency, multiple pens alpha depending on array, see psikyosh.c */
6260
src/emu/timer.c
r1679r1680
526526***************************************************************************/
527527
528528/*-------------------------------------------------
529    timer_adjust - adjust the time when this
530    timer will fire, and whether or not it will
531    fire periodically
529    timer_adjust_oneshot - adjust the time when this timer
530    will fire and disable any periodic firings
532531-------------------------------------------------*/
533532
534void timer_adjust(emu_timer *which, attotime duration, INT32 param, attotime period)
533void timer_adjust_oneshot(emu_timer *which, attotime duration, INT32 param)
535534{
535   timer_adjust_periodic(which, duration, param, attotime_never);
536}
537
538
539/*-------------------------------------------------
540    timer_adjust_periodic - adjust the time when
541    this timer will fire and specify a period for
542    subsequent firings
543-------------------------------------------------*/
544
545void timer_adjust_periodic(emu_timer *which, attotime duration, INT32 param, attotime period)
546{
536547   attotime time = get_current_time();
537548
538549   /* if this is the callback timer, mark it modified */
r1679r1680
557568   timer_list_insert(which);
558569
559570   /* if this was inserted as the head, abort the current timeslice and resync */
560   LOG(("timer_adjust %s.%s:%d to expire @ %s\n", which->file, which->func, which->line, attotime_string(which->expire, 9)));
571   LOG(("timer_adjust_oneshot %s.%s:%d to expire @ %s\n", which->file, which->func, which->line, attotime_string(which->expire, 9)));
561572   if (which == timer_head && cpu_getexecutingcpu() >= 0)
562573      activecpu_abort_timeslice();
563574}
r1679r1680
577588void _timer_pulse_internal(attotime period, void *ptr, INT32 param, timer_callback callback, const char *file, int line, const char *func)
578589{
579590   emu_timer *timer = _timer_alloc_common(callback, ptr, file, line, func, FALSE);
580   timer_adjust(timer, period, param, period);
591   timer_adjust_periodic(timer, period, param, period);
581592}
582593
583594
r1679r1680
589600void _timer_set_internal(attotime duration, void *ptr, INT32 param, timer_callback callback, const char *file, int line, const char *func)
590601{
591602   emu_timer *timer = _timer_alloc_common(callback, ptr, file, line, func, TRUE);
592   timer_adjust(timer, duration, param, attotime_zero);
603   timer_adjust_oneshot(timer, duration, param);
593604}
594605
595606
r1679r1680
604615
605616void timer_reset(emu_timer *which, attotime duration)
606617{
607   timer_adjust(which, duration, which->param, which->period);
618   timer_adjust_periodic(which, duration, which->param, which->period);
608619}
609620
610621
src/emu/cheat.c
r1679r1680
15001500   InitStringTable();
15011501
15021502   periodic_timer = timer_alloc(cheat_periodic, NULL);
1503   timer_adjust(periodic_timer, attotime_make(0, machine->screen[0].refresh), 0, attotime_make(0, machine->screen[0].refresh));
1503   timer_adjust_periodic(periodic_timer, attotime_make(0, machine->screen[0].refresh), 0, attotime_make(0, machine->screen[0].refresh));
15041504
15051505   add_exit_callback(machine, cheat_exit);
15061506}
src/emu/timer.h
r1679r1680
106106/* allocate a permament timer that isn't primed yet */
107107emu_timer *_timer_alloc_internal(timer_callback callback, void *param, const char *file, int line, const char *func);
108108
109/* adjust the time when this timer will fire, and whether or not it will fire periodically */
110void timer_adjust(emu_timer *which, attotime duration, INT32 param, attotime period);
109/* adjust the time when this timer will fire and disable any periodic firings */
110void timer_adjust_oneshot(emu_timer *which, attotime duration, INT32 param);
111111
112/* adjust the time when this timer will fire and specify a period for subsequent firings */
113void timer_adjust_periodic(emu_timer *which, attotime duration, INT32 param, attotime period);
112114
113115
116
114117/* ----- anonymous timer management ----- */
115118
116119/* allocate a one-shot timer, which calls the callback after the given duration */
src/emu/drivers/xtal.h
r1679r1680
5454   XTAL_5MHz          = 5000000,      /* Mutant Night */
5555   XTAL_6MHz          = 6000000,
5656   XTAL_6_144MHz      = 6144000,      /* Used on Alpha Denshi early 80's games sound board */
57   XTAL_7_15909MHz      = 7159090,      /* Blood Bros */
5758   XTAL_7_3728MHz      = 7372800,
5859   XTAL_8MHz          = 8000000,
5960   XTAL_9_987MHz      = 9987000,      /* Crazy Balloon */
src/mess/devices/flopdrv.c
r1679r1680
1616*/
1717
1818#include "driver.h"
19#include "mslegacy.h"
1920#include "flopdrv.h"
2021
2122
src/mess/devices/thomflop.c
r1679r1680
77**********************************************************************/
88
99#include "driver.h"
10#include "mslegacy.h"
1011#include "includes/thomson.h"
1112#include "machine/wd17xx.h"
1213#include "devices/flopdrv.h"
src/mess/mslegacy.c
r1679r1680
99
1010#include "driver.h"
1111#include "mslegacy.h"
12#include "video/mc6845.h"
1213
1314
1415static const char *const mess_default_text[] =
r1679r1680
100101{
101102   return mess_default_text[string_num];
102103}
104
105
106
107/***************************************************************************
108    TIMER
109***************************************************************************/
110
111void timer_adjust(emu_timer *which, attotime duration, INT32 param, attotime period)
112{
113   if (attotime_compare(period, attotime_zero) == 0)
114      timer_adjust_oneshot(which, duration, param);
115   else
116      timer_adjust_periodic(which, duration, param, period);
117}
118
119
120
121/***************************************************************************
122    MC6845
123***************************************************************************/
124
125mc6845_t *mslegacy_mc6845;
126
127void crtc6845_config(int index, const mc6845_interface *intf)
128{
129   assert(index == 0);
130   mslegacy_mc6845 = mc6845_config(intf);
131}
132
133
134
135WRITE8_HANDLER(crtc6845_0_address_w)
136{
137   mc6845_address_w(mslegacy_mc6845, data);
138}
139
140
141
142READ8_HANDLER(crtc6845_0_register_r)
143{
144   return mc6845_register_r(mslegacy_mc6845);
145}
146
147
148
149WRITE8_HANDLER(crtc6845_0_register_w)
150{
151   mc6845_register_w(mslegacy_mc6845, data);
152}
153
154
155
156VIDEO_UPDATE(crtc6845)
157{
158   mc6845_update(mslegacy_mc6845, bitmap, cliprect);
159   return 0;
160}
161
src/mess/mslegacy.h
r1679r1680
1010#ifndef MSLEGACY_H
1111#define MSLEGACY_H
1212
13#include "driver.h"
1314
1415enum
1516{
r1679r1680
8384const char * ui_getstring (int string_num);
8485
8586
87/* timer */
88void timer_adjust(emu_timer *which, attotime duration, INT32 param, attotime period);
89
90
91/* mc6845 */
92struct _mc6845_t;
93struct _mc6845_interface;
94
95extern struct _mc6845_t *mslegacy_mc6845;
96
97WRITE8_HANDLER(crtc6845_0_address_w);
98READ8_HANDLER(crtc6845_0_register_r);
99WRITE8_HANDLER(crtc6845_0_register_w);
100VIDEO_UPDATE(crtc6845);
101void crtc6845_config(int index, const struct _mc6845_interface *intf);
102
103
104
86105#endif /* MSLEGACY_H */
src/mess/audio/t6721.c
r1679r1680
1515
1616#include <ctype.h>
1717#include "driver.h"
18#include "mslegacy.h"
1819#include "cpu/m6502/m6502.h"
1920
2021#define VERBOSE_DBG 1
src/mess/video/cbmb.c
r1679r1680
77#include "driver.h"
88#include "deprecat.h"
99#include "includes/cbmb.h"
10#include "video/crtc6845.h"
10#include "video/mc6845.h"
1111
1212
1313static int cbmb_font=0;
src/mess/video/gb.c
r1679r1680
1313
1414#include "driver.h"
1515#include "deprecat.h"
16#include "mslegacy.h"
1617#include "includes/gb.h"
1718#include "cpu/z80gb/z80gb.h"
1819#include "profiler.h"
src/mess/video/vectrex.c
r1679r1680
11#include <math.h>
22#include "driver.h"
33#include "deprecat.h"
4#include "mslegacy.h"
45#include "includes/vectrex.h"
56#include "video/vector.h"
67#include "machine/6522via.h"
src/mess/video/aim65.c
r1679r1680
66******************************************************************************/
77
88#include "driver.h"
9#include "mslegacy.h"
910
1011#include "includes/aim65.h"
1112#include "machine/6522via.h"
src/mess/video/m6847.c
r1679r1680
6666#include "driver.h"
6767#include "m6847.h"
6868#include "deprecat.h"
69#include "mslegacy.h"
6970
7071#ifdef ENABLE_DEBUGGER
7172#include "debug/debugcpu.h"
src/mess/video/thomson.c
r1679r1680
99#include <math.h>
1010#include "driver.h"
1111#include "deprecat.h"
12#include "mslegacy.h"
1213#include "includes/thomson.h"
1314#include "cpu/m6809/m6809.h"
1415#include "machine/6821pia.h"
src/mess/video/aquarius.c
r1679r1680
2727   aquarius_tilemap = tilemap_create(
2828      aquarius_gettileinfo,
2929      tilemap_scan_rows,
30      TILEMAP_TYPE_PEN,
3130      8, 8,
3231      40, 24);
3332}
src/mess/video/abc80.c
r1679r1680
55 ****************************************************************************/
66
77#include "driver.h"
8#include "mslegacy.h"
89#include "includes/abc80.h"
910
1011
r1679r1680
7374   timer_adjust(abc80_blink_timer, attotime_zero, 0, ATTOTIME_IN_HZ(ABC80_XTAL/2/6/64/312/16));
7475
7576   tx_tilemap = tilemap_create(abc80_get_tile_info, abc80_tilemap_scan,
76      TILEMAP_TYPE_PEN, 6, 10, 40, 24);
77      6, 10, 40, 24);
7778
7879   tilemap_set_scrolldx(tx_tilemap, ABC80_HDSTART, ABC80_HDSTART);
7980   tilemap_set_scrolldy(tx_tilemap, ABC80_VDSTART, ABC80_VDSTART);
src/mess/video/x68k.c
r1679r1680
2626*/
2727
2828#include "driver.h"
29#include "mslegacy.h"
2930#include "includes/x68k.h"
3031#include "machine/68901mfp.h"
3132
r1679r1680
966967   machine->gfx[gfx_index]->total_colors = 32;
967968
968969   /* Tilemaps */
969   x68k_bg0_8 = tilemap_create(x68k_get_bg0_tile,tilemap_scan_rows,TILEMAP_TYPE_PEN,8,8,64,64);
970   x68k_bg1_8 = tilemap_create(x68k_get_bg1_tile,tilemap_scan_rows,TILEMAP_TYPE_PEN,8,8,64,64);
971   x68k_bg0_16 = tilemap_create(x68k_get_bg0_tile_16,tilemap_scan_rows,TILEMAP_TYPE_PEN,16,16,64,64);
972   x68k_bg1_16 = tilemap_create(x68k_get_bg1_tile_16,tilemap_scan_rows,TILEMAP_TYPE_PEN,16,16,64,64);
970   x68k_bg0_8 = tilemap_create(x68k_get_bg0_tile,tilemap_scan_rows,8,8,64,64);
971   x68k_bg1_8 = tilemap_create(x68k_get_bg1_tile,tilemap_scan_rows,8,8,64,64);
972   x68k_bg0_16 = tilemap_create(x68k_get_bg0_tile_16,tilemap_scan_rows,16,16,64,64);
973   x68k_bg1_16 = tilemap_create(x68k_get_bg1_tile_16,tilemap_scan_rows,16,16,64,64);
973974
974975   tilemap_set_transparent_pen(x68k_bg0_8,0);
975976   tilemap_set_transparent_pen(x68k_bg1_8,0);
src/mess/video/atarist.c
r1679r1680
1515#include "cpu/m68000/m68000.h"
1616#include "machine/68901mfp.h"
1717#include "video/atarist.h"
18#include "mslegacy.h"
1819
1920static struct SHIFTER
2021{
src/mess/video/osi.c
r1679r1680
2121VIDEO_START( sb2m600 )
2222{
2323   bg_tilemap = tilemap_create(get_bg_tile_info, tilemap_scan_rows,
24      TILEMAP_TYPE_PEN, 8, 8, 32, 32);
24      8, 8, 32, 32);
2525}
2626
2727VIDEO_START( uk101 )
2828{
2929   bg_tilemap = tilemap_create(get_bg_tile_info, tilemap_scan_rows,
30      TILEMAP_TYPE_PEN, 8, 16, 32, 32);
30      8, 16, 32, 32);
3131}
3232
3333VIDEO_UPDATE( sb2m600 )
src/mess/video/zx8301.c
r1679r1680
66
77#include "driver.h"
88#include "deprecat.h"
9#include "mslegacy.h"
910#include "zx8301.h"
1011
1112
src/mess/video/abc80x.c
r1679r1680
66
77#include "driver.h"
88#include "includes/abc80x.h"
9#include "video/crtc6845.h"
9#include "video/mc6845.h"
1010
1111
1212static tilemap *tx_tilemap;
r1679r1680
3737   palette_set_color_rgb(machine, 7, 0xff, 0xff, 0xff); // white
3838}
3939
40static const crtc6845_interface crtc6845_intf =
40static const mc6845_interface crtc6845_intf =
4141{
4242   0,                  /* screen we are acting on */
4343   ABC800_X01/6,         /* the clock (pin 21) of the chip */
r1679r1680
6161VIDEO_START( abc800m )
6262{
6363   tx_tilemap = tilemap_create(abc800_get_tile_info, tilemap_scan_rows,
64      TILEMAP_TYPE_PEN, 6, 10, 80, 24);
64      6, 10, 80, 24);
6565}
6666
6767static TILE_GET_INFO(abc800c_get_tile_info)
r1679r1680
7575VIDEO_START( abc800c )
7676{
7777   tx_tilemap = tilemap_create(abc800c_get_tile_info, tilemap_scan_rows,
78      TILEMAP_TYPE_PEN, 6, 10, 40, 24);
78      6, 10, 40, 24);
7979}
8080
8181VIDEO_UPDATE( abc800 )
r1679r1680
109109VIDEO_START( abc802 )
110110{
111111   tx_tilemap_40 = tilemap_create(abc802_get_tile_info_40, tilemap_scan_rows,
112      TILEMAP_TYPE_PEN, 12, 10, 40, 24);
112      12, 10, 40, 24);
113113
114114   tx_tilemap = tilemap_create(abc802_get_tile_info_80, tilemap_scan_rows,
115      TILEMAP_TYPE_PEN, 6, 10, 80, 24);
115      6, 10, 80, 24);
116116
117117   abc802_columns = 80;
118118}
src/mess/video/coco3.c
r1679r1680
3232#include "machine/6883sam.h"
3333#include "video/m6847.h"
3434#include "includes/coco.h"
35#include "mslegacy.h"
3536
3637
3738#if defined(__GNUC__) && (__GNUC__ >= 3)
src/mess/video/smsvdp.c
r1679r1680
3838
3939#include "driver.h"
4040#include "deprecat.h"
41#include "mslegacy.h"
4142#include "video/smsvdp.h"
4243#include "includes/sms.h"
4344
src/mess/video/microtan.c
r1679r1680
4242VIDEO_START( microtan )
4343{
4444   bg_tilemap = tilemap_create(get_bg_tile_info, tilemap_scan_rows,
45      TILEMAP_TYPE_PEN, 8, 16, 32, 16);
45      8, 16, 32, 16);
4646
4747   microtan_chunky_buffer = auto_malloc(videoram_size);
4848   memset(microtan_chunky_buffer, 0, videoram_size);
src/mess/video/cdp1864.c
r1679r1680
33#include "cpu/cdp1802/cdp1802.h"
44#include "sound/beep.h"
55#include "video/cdp1864.h"
6#include "mslegacy.h"
67
78static mame_bitmap *cdptmpbitmap;
89
src/mess/video/amstrad.c
r1679r1680
952952         yloc += rect.min_y;
953953         decodechar(Machine->gfx[0],spr,amstrad_plus_asic_ram);
954954         drawgfxzoom(scr_bitmap,Machine->gfx[0],spr,0,0,0,xloc,yloc,&rect,
955            TRANSPARENCY_COLOR,32,xmag,ymag);
955            TRANSPARENCY_PEN,32,xmag,ymag);
956956      }
957957   }
958958}
src/mess/video/trs80.c
r1679r1680
5252   dblwidth_tilemap = tilemap_create(
5353      dblwidth_gettileinfo,
5454      tilemap_scan_rows,
55      TILEMAP_TYPE_PEN,
5655      FW * 2, FH,
5756      64, videoram_size / 64);
5857
5958   normwidth_tilemap = tilemap_create(
6059      normwidth_gettileinfo,
6160      tilemap_scan_rows,
62      TILEMAP_TYPE_PEN,
6361      FW, FH,
6462      64, videoram_size / 64);
6563
src/mess/video/apple2.c
r1679r1680
347347   text_tilemap = tilemap_create(
348348      apple2_text_gettileinfo,
349349      apple2_text_getmemoryoffset,
350      TILEMAP_TYPE_PEN,
351350      7*2, 8,
352351      40, 24);
353352
354353   dbltext_tilemap = tilemap_create(
355354      apple2_dbltext_gettileinfo,
356355      apple2_dbltext_getmemoryoffset,
357      TILEMAP_TYPE_PEN,
358356      7, 8,
359357      80, 24);
360358
361359   lores_tilemap = tilemap_create(
362360      apple2_lores_gettileinfo,
363361      apple2_text_getmemoryoffset,
364      TILEMAP_TYPE_PEN,
365362      14, 8,
366363      40, 24);
367364
src/mess/video/ted7360.c
r1679r1680
356356#include <stdio.h>
357357#include "driver.h"
358358#include "deprecat.h"
359#include "mslegacy.h"
359360#include "utils.h"
360361#include "sound/custom.h"
361362
src/mess/video/cdp1861.c
r1679r1680
11#include "driver.h"
22#include "deprecat.h"
3#include "mslegacy.h"
34#include "cpu/cdp1802/cdp1802.h"
45#include "video/cdp1861.h"
56
src/mess/inputx.c
r1679r1680
793793   /* need to start up the timer? */
794794   if (keybuf->begin_pos == keybuf->end_pos)
795795   {
796      timer_adjust(inputx_timer, choose_delay(ch), 0, attotime_zero);
796      timer_adjust_oneshot(inputx_timer, choose_delay(ch), 0);
797797      keybuf->status_keydown = 0;
798798   }
799799
r1679r1680
909909   if (keybuf->begin_pos != keybuf->end_pos)
910910   {
911911      delay = choose_delay(keybuf->buffer[keybuf->begin_pos]);
912      timer_adjust(inputx_timer, delay, 0, attotime_zero);
912      timer_adjust_oneshot(inputx_timer, delay, 0);
913913   }
914914}
915915
src/mess/osd/winui/winui.mak
r1679r1680
123123   @echo Compiling resources $<...
124124   $(RC) $(RCDEFS) $(RCFLAGS) --include-dir $(WINUISRC) --include-dir $(MESS_WINUISRC) --include-dir $(WINUIOBJ) -o $@ -i $(MESS_WINUISRC)/messui.rc
125125
126$(WINUIOBJ)/mamevers.rc: $(WINOBJ)/verinfo$(EXE) $(SRC)/version.c
126$(WINUIOBJ)/mamevers.rc: $(OBJ)/build/verinfo$(EXE) $(SRC)/version.c
127127   @echo Emitting $@...
128128   @$(VERINFO) $(SRC)/version.c > $@
src/mess/machine/zx.c
r1679r1680
1111#include "cpu/z80/z80.h"
1212#include "includes/zx.h"
1313#include "devices/cassette.h"
14#include "mslegacy.h"
1415
1516#define   DEBUG_ZX81_PORTS   1
1617#define DEBUG_ZX81_VSYNC   1
src/mess/machine/pdp1.c
r1679r1680
1313
1414#include "driver.h"
1515#include "deprecat.h"
16#include "mslegacy.h"
1617
1718#include "cpu/pdp1/pdp1.h"
1819#include "includes/pdp1.h"
src/mess/machine/nec765.c
r1679r1680
2121***************************************************************************/
2222
2323#include "driver.h"
24#include "mslegacy.h"
2425#include "machine/nec765.h"
2526
2627typedef enum
src/mess/machine/apple2gs.c
r1679r1680
107107#include <assert.h>
108108#include "driver.h"
109109#include "deprecat.h"
110#include "mslegacy.h"
110111
111112#include "includes/apple2gs.h"
112113#include "includes/apple2.h"
src/mess/machine/applefdc.c
r1679r1680
3737
3838#include "applefdc.h"
3939#include "deprecat.h"
40#include "mslegacy.h"
4041
4142/* logging */
4243#define LOG_IWM         0
src/mess/machine/mac.c
r1679r1680
3939
4040#include "driver.h"
4141#include "deprecat.h"
42#include "mslegacy.h"
4243#include "machine/6522via.h"
4344#include "machine/8530scc.h"
4445#include "cpu/m68000/m68000.h"
src/mess/machine/pcf8593.c
r1679r1680
88
99#include "pcf8593.h"
1010#include "deprecat.h"
11#include "mslegacy.h"
1112
1213#include <time.h>
1314
src/mess/machine/cbmb.c
r1679r1680
1010#include "sound/sid6581.h"
1111#include "machine/6526cia.h"
1212#include "deprecat.h"
13#include "mslegacy.h"
1314
1415#define VERBOSE_DBG 1
1516#include "includes/cbm.h"
r1679r1680
1920#include "includes/vc20tape.h"
2021#include "includes/cbmieeeb.h"
2122#include "video/vic6567.h"
22#include "video/crtc6845.h"
23#include "video/mc6845.h"
2324
2425
2526static TIMER_CALLBACK(cbmb_frame_interrupt);
r1679r1680
252253}
253254
254255//static const struct mscrtc6845_config cbm600_crtc= { 1600000 /*?*/, cbmb_vh_cursor };
255static const crtc6845_interface cbm600_crtc = {
256static const mc6845_interface cbm600_crtc = {
256257   0,
257258   1600000 /*?*/,
258259   8 /*?*/,
r1679r1680
286287}
287288
288289//static const struct mscrtc6845_config cbm700_crtc= { 2000000 /*?*/, cbmb_vh_cursor };
289static const crtc6845_interface cbm700_crtc = {
290static const mc6845_interface cbm700_crtc = {
290291   0,
291292   2000000 /*?*/,
292293   9 /*?*/,
src/mess/machine/i8271.c
r1679r1680
1515#include "driver.h"
1616#include "i8271.h"
1717#include "devices/flopdrv.h"
18#include "mslegacy.h"
1819
1920
2021I8271_STATE_t I8271_STATE;
src/mess/machine/pokemini.c
r1679r1680
11#include "driver.h"
2#include "mslegacy.h"
23#include "includes/pokemini.h"
34#include "cpu/minx/minx.h"
45
src/mess/machine/rp5c15.c
r1679r1680
6969
7070#include "rp5c15.h"
7171#include "deprecat.h"
72#include "mslegacy.h"
7273
7374static struct rp5c15 rtc;
7475
src/mess/machine/coco.c
r1679r1680
9898#include "sound/dac.h"
9999#include "sound/ay8910.h"
100100#include "devices/cococart.h"
101#include "mslegacy.h"
101102
102103/*common vars/calls */
103104static UINT8 *coco_rom;
src/mess/machine/amigacd.c
r1679r1680
1616#include "machine/wd33c93.h"
1717#include "machine/tpi6525.h"
1818#include "matsucd.h"
19#include "mslegacy.h"
1920
2021
2122#define VERBOSE_DMAC 0
src/mess/machine/gb.c
r1679r1680
3737
3838#include "driver.h"
3939#include "deprecat.h"
40#include "mslegacy.h"
4041#include "includes/gb.h"
4142#include "cpu/z80gb/z80gb.h"
4243#include "image.h"
src/mess/machine/kim1.c
r1679r1680
88******************************************************************************/
99
1010#include "driver.h"
11#include "mslegacy.h"
1112#include "cpu/m6502/m6502.h"
1213#include "includes/kim1.h"
1314#include "sound/dac.h"
src/mess/machine/99_dsk.c
r1679r1680
2525
2626#include "driver.h"
2727#include "deprecat.h"
28#include "mslegacy.h"
2829#include "machine/wd17xx.h"
2930#include "smc92x4.h"
3031#include "ti99_4x.h"
src/mess/machine/at29040.c
r1679r1680
1010*/
1111
1212#include "driver.h"
13#include "mslegacy.h"
1314#include "at29040.h"
1415
1516#define MAX_AT29C040A 4
src/mess/machine/gamecom.c
r1679r1680
11
22#include "driver.h"
33#include "deprecat.h"
4#include "mslegacy.h"
45#include "includes/gamecom.h"
56#include "cpu/sm8500/sm8500.h"
67#include "image.h"
src/mess/machine/mz700.c
r1679r1680
1313#include "driver.h"
1414#include "deprecat.h"
1515#include "includes/mz700.h"
16#include "mslegacy.h"
1617
1718/* Components */
1819#include "cpu/z80/z80.h"
src/mess/machine/serial.c
r1679r1680
3030*/
3131
3232#include "driver.h"
33#include "mslegacy.h"
3334#include "includes/serial.h"
3435
3536#define VERBOSE 0
src/mess/machine/vectrex.c
r1679r1680
11#include "driver.h"
22#include "deprecat.h"
3#include "mslegacy.h"
34#include "video/vector.h"
45#include "machine/6522via.h"
56#include "cpu/m6809/m6809.h"
67#include "sound/ay8910.h"
78#include "image.h"
9#include "mslegacy.h"
810
911#include "includes/vectrex.h"
1012
src/mess/machine/nes_mmc.c
r1679r1680
3030#include "osdepend.h"
3131#include "deprecat.h"
3232#include "driver.h"
33#include "mslegacy.h"
3334#include "includes/nes.h"
3435#include "nes_mmc.h"
3536#include "sound/nes_apu.h"
src/mess/machine/vc1541.c
r1679r1680
102102
103103#include "driver.h"
104104#include "deprecat.h"
105#include "mslegacy.h"
105106#include "image.h"
106107#include "cpu/m6502/m6502.h"
107108#include "machine/6522via.h"
src/mess/machine/thomson.c
r1679r1680
88
99#include "driver.h"
1010#include "deprecat.h"
11#include "mslegacy.h"
1112#include "includes/thomson.h"
1213#include "cpu/m6809/m6809.h"
1314#include "machine/6821pia.h"
src/mess/machine/lisa.c
r1679r1680
3838
3939#include "driver.h"
4040#include "deprecat.h"
41#include "mslegacy.h"
4142#include "includes/lisa.h"
4243#include "machine/6522via.h"
4344#include "machine/applefdc.h"
src/mess/machine/sym1.c
r1679r1680
99
1010#include "driver.h"
1111#include "deprecat.h"
12#include "mslegacy.h"
1213#include "includes/sym1.h"
1314
1415/* M6502 CPU */
src/mess/machine/lynx.c
r1679r1680
55#include "driver.h"
66#include "includes/lynx.h"
77#include "deprecat.h"
8#include "mslegacy.h"
89
910#include "cpu/m6502/m6502.h"
1011
src/mess/machine/pmd85.c
r1679r1680
1212#include <stdarg.h>
1313#include "driver.h"
1414#include "deprecat.h"
15#include "mslegacy.h"
1516#include "devices/cassette.h"
1617#include "cpu/i8085/i8085.h"
1718#include "includes/pmd85.h"
src/mess/machine/rriot.c
r1679r1680
1212 **********************************************************************/
1313#include "driver.h"
1414#include "rriot.h"
15#include "mslegacy.h"
1516
1617#define VERBOSE 0
1718
src/mess/machine/tx0.c
r1679r1680
88
99#include "cpu/pdp1/tx0.h"
1010#include "includes/tx0.h"
11#include "mslegacy.h"
1112#include "video/crt.h"
1213
1314
src/mess/machine/tms9901.c
r1679r1680
66
77#include <math.h>
88#include "driver.h"
9#include "mslegacy.h"
910
1011#include "tms9901.h"
1112
src/mess/machine/pet.c
r1679r1680
66
77#include "driver.h"
88#include "deprecat.h"
9#include "mslegacy.h"
910#include "cpu/m6502/m6502.h"
1011#include "cpu/m6809/m6809.h"
1112
r1679r1680
1718#include "includes/pet.h"
1819#include "includes/cbmserb.h"
1920#include "includes/cbmieeeb.h"
20#include "video/crtc6845.h"
21#include "video/mc6845.h"
2122
2223/* keyboard lines */
2324static int pet_basic1=0; /* basic version 1 for quickloader */
r1679r1680
497498static void pet_display_enable_changed(int display_enabled) {
498499}
499500
500static const crtc6845_interface crtc_pet40 = {
501static const mc6845_interface crtc_pet40 = {
501502   0,
502503   800000 /*?*/,
503504   8 /*?*/,
r1679r1680
507508   pet_display_enable_changed
508509};
509510
510static const crtc6845_interface crtc_pet80 = {
511static const mc6845_interface crtc_pet80 = {
511512   0,
512513   800000 /*?*/,
513514   16 /*?*/,
src/mess/machine/europc.c
r1679r1680
55#include "video/pc_aga.h"
66#include "audio/pc.h"
77#include "deprecat.h"
8#include "mslegacy.h"
89
910/*
1011
src/mess/machine/6551.c
r1679r1680
11#include "driver.h"
22#include "6551.h"
33#include "includes/serial.h"
4#include "mslegacy.h"
45
56static void acia_6551_receive_char(unsigned char ch);
67static void acia_6551_refresh_ints(void);
src/mess/machine/electron.c
r1679r1680
99
1010#include "driver.h"
1111#include "deprecat.h"
12#include "mslegacy.h"
1213#include "includes/electron.h"
1314#include "sound/beep.h"
1415#include "devices/cassette.h"
src/mess/machine/pc_hdc.c
r1679r1680
2424#include "machine/8237dma.h"
2525#include "devices/harddriv.h"
2626#include "memconv.h"
27#include "mslegacy.h"
2728
2829
2930#define LOG_HDC_STATUS      0
src/mess/machine/centroni.c
r1679r1680
66
77#include "driver.h"
88#include "centroni.h"
9#include "mslegacy.h"
910#include "devices/printer.h"
1011
1112typedef struct {
src/mess/machine/mc6843.c
r1679r1680
3333#include "driver.h"
3434#include "mc6843.h"
3535#include "devices/flopdrv.h"
36#include "mslegacy.h"
3637
3738
3839/******************* parameters ******************/
src/mess/machine/mm58274c.c
r1679r1680
2020
2121#include "driver.h"
2222#include "deprecat.h"
23#include "mslegacy.h"
2324#include "mm58274c.h"
2425
2526
src/mess/machine/ibmpc.c
r1679r1680
11#include "driver.h"
22#include "memconv.h"
3#include "mslegacy.h"
34#include "includes/ibmpc.h"
45
56#include "machine/pcshare.h"
src/mess/machine/68901mfp.c
r1679r1680
3434*/
3535
3636#include "68901mfp.h"
37#include "mslegacy.h"
3738
3839typedef struct
3940{
src/mess/machine/amigafdc.c
r1679r1680
1515#include "amiga.h"
1616#include "amigafdc.h"
1717#include "machine/6526cia.h"
18#include "mslegacy.h"
1819
1920
2021#define MAX_TRACK_BYTES         12500
src/mess/machine/z80dart.c
r1679r1680
88***************************************************************************/
99
1010#include "driver.h"
11#include "mslegacy.h"
1112#include "z80dart.h"
1213#include "cpu/z80/z80.h"
1314#include "cpu/z80/z80daisy.h"
src/mess/machine/amigakbd.c
r1679r1680
99#include "amiga.h"
1010#include "amigakbd.h"
1111#include "machine/6526cia.h"
12#include "mslegacy.h"
1213
1314
1415#define KEYBOARD_BUFFER_SIZE   256
src/mess/machine/matsucd.c
r1679r1680
1616#include "devices/chd_cd.h"
1717#include "sound/cdda.h"
1818#include "machine/matsucd.h"
19#include "mslegacy.h"
1920
2021
2122#define MATSU_STATUS_READY      ( 1 << 0 )   /* driver ready */
src/mess/machine/tms9902.c
r1679r1680
66
77#include <math.h>
88#include "driver.h"
9#include "mslegacy.h"
910
1011#include "tms9902.h"
1112
src/mess/machine/osborne1.c
r1679r1680
1616
1717#include "driver.h"
1818#include "deprecat.h"
19#include "mslegacy.h"
1920#include "cpu/z80/z80.h"
2021#include "machine/6821pia.h"
2122#include "machine/6850acia.h"
src/mess/machine/sms.c
r1679r1680
22#include "driver.h"
33#include "image.h"
44#include "deprecat.h"
5#include "mslegacy.h"
56#include "includes/sms.h"
67#include "video/smsvdp.h"
78#include "sound/2413intf.h"
src/mess/machine/wd17xx.c
r1679r1680
3737
3838#include "driver.h"
3939#include "deprecat.h"
40#include "mslegacy.h"
4041#include "machine/wd17xx.h"
4142#include "devices/flopdrv.h"
4243
src/mess/machine/pc_mouse.c
r1679r1680
99#include "driver.h"
1010#include "machine/uart8250.h"
1111#include "includes/pc_mouse.h"
12#include "mslegacy.h"
1213
1314
1415static struct {
src/mess/machine/hd63450.c
r1679r1680
66
77#include "machine/hd63450.h"
88#include "deprecat.h"
9#include "mslegacy.h"
910
1011static struct hd63450 dmac;
1112
src/mess/machine/svi318.c
r1679r1680
1010
1111#include "driver.h"
1212#include "deprecat.h"
13#include "mslegacy.h"
1314#include "includes/svi318.h"
1415#include "cpu/z80/z80.h"
15#include "video/crtc6845.h"
16#include "video/mc6845.h"
1617#include "video/tms9928a.h"
1718#include "machine/8255ppi.h"
1819#include "machine/uart8250.h"
r1679r1680
443444   }
444445}
445446
446static const crtc6845_interface svi806_crtc6845_interface = {
447static const mc6845_interface svi806_crtc6845_interface = {
447448   1,
448449   3579545 /*?*/,
449450   8 /*?*/,
src/mess/machine/pce.c
r1679r1680
11
22#include "driver.h"
33#include "deprecat.h"
4#include "mslegacy.h"
45#include "video/vdc.h"
56#include "cpu/h6280/h6280.h"
67#include "includes/pce.h"
src/mess/machine/tms5501.c
r1679r1680
1616
1717#include "driver.h"
1818#include "tms5501.h"
19#include "mslegacy.h"
1920
2021#define DEBUG_TMS5501   0
2122
src/mess/machine/sgi.c
r1679r1680
99#include "driver.h"
1010#include "sgi.h"
1111#include "deprecat.h"
12#include "mslegacy.h"
1213
1314#define VERBOSE_LEVEL ( 1 )
1415
src/mess/machine/bbc.c
r1679r1680
1111#include "ctype.h"
1212#include "driver.h"
1313#include "deprecat.h"
14#include "mslegacy.h"
1415#include "cpu/m6502/m6502.h"
1516#include "machine/6522via.h"
1617#include "machine/wd17xx.h"
src/mess/machine/compis.c
r1679r1680
1414
1515#include "driver.h"
1616#include "deprecat.h"
17#include "mslegacy.h"
1718#include "cpu/i86/i186intf.h"
1819#include "video/i82720.h"
1920#include "machine/8255ppi.h"
src/mess/machine/kc.c
r1679r1680
11/* Core includes */
22#include "driver.h"
33#include "deprecat.h"
4#include "mslegacy.h"
45#include "includes/kc.h"
56
67/* Components */
src/mess/machine/corvushd.c
r1679r1680
6464//
6565
6666#include "driver.h"
67#include "mslegacy.h"
6768#include "devices/harddriv.h"
6869#include "includes/corvushd.h"
6970#include <ctype.h>
src/mess/mscommon.c
r1679r1680
6969      + (num_cols * num_rows * sizeof(termchar_t)));
7070
7171   term->tm = tilemap_create(terminal_gettileinfo, tilemap_scan_rows,
72      TILEMAP_TYPE_PEN, char_width, char_height, num_cols, num_rows);
72      char_width, char_height, num_cols, num_rows);
7373
7474   term->gfx = gfx;
7575   term->blank_char = blank_char;
src/mess/drivers/nc.c
r1679r1680
9595
9696#include "driver.h"
9797#include "deprecat.h"
98#include "mslegacy.h"
9899#include "includes/nc.h"
99100#include "includes/serial.h"   /* for serial data transfers */
100101#include "machine/msm8251.h"   /* for NC100 uart */
src/mess/drivers/cbmb.c
r1679r1680
167167#include "includes/cbm.h"
168168#include "machine/tpi6525.h"
169169#include "video/vic6567.h"
170#include "video/crtc6845.h"
170#include "video/mc6845.h"
171171#include "includes/cbmserb.h"
172172#include "includes/vc1541.h"
173173#include "includes/vc20tape.h"
src/mess/drivers/dc.c
r1679r1680
1616
1717static UINT64 *dc_sound_ram;
1818
19UINT32 dma_offset;   /* silly MAME global variable */
20
1921static ADDRESS_MAP_START( dc_map, ADDRESS_SPACE_PROGRAM, 64 )
2022   AM_RANGE(0x00000000, 0x001fffff) AM_ROM                  // BIOS
2123   AM_RANGE(0x00200000, 0x0021ffff) AM_ROM AM_REGION(REGION_CPU1, 0x200000)   // flash
src/mess/drivers/abc80.c
r1679r1680
7979#include "machine/z80pio.h"
8080#include "sound/sn76477.h"
8181#include "machine/abcbus.h"
82#include "mslegacy.h"
8283
8384/* Devices */
8485#include "devices/basicdsk.h"
src/mess/drivers/x68k.c
r1679r1680
127127#include "driver.h"
128128#include "render.h"
129129#include "deprecat.h"
130#include "mslegacy.h"
130131#include "cpu/m68000/m68000.h"
131132#include "machine/68901mfp.h"
132133#include "machine/8255ppi.h"
src/mess/drivers/atarist.c
r1679r1680
11#include "driver.h"
22#include "deprecat.h"
3#include "mslegacy.h"
34#include "video/atarist.h"
45#include "cpu/m68000/m68k.h"
56#include "cpu/m68000/m68000.h"
src/mess/drivers/exidy.c
r1679r1680
9494#include "devices/printer.h"
9595#include "devices/z80bin.h"
9696#include "sound/speaker.h"
97#include "mslegacy.h"
9798
9899
99100static int device_load_exidy_floppy(mess_image *image)
src/mess/drivers/pet.c
r1679r1680
120120#include "machine/6821pia.h"
121121#include "machine/6522via.h"
122122#include "includes/pet.h"
123#include "video/crtc6845.h"
123#include "video/mc6845.h"
124124#include "includes/cbmserb.h"
125125#include "includes/cbmieeeb.h"
126126/*#include "includes/vc1541.h" */
src/mess/drivers/a2600.c
r1679r1680
1313#include "formats/a26_cas.h"
1414#include "video/tia.h"
1515#include "deprecat.h"
16#include "mslegacy.h"
1617
1718#define CART memory_region(REGION_USER1)
1819
src/mess/drivers/ql.c
r1679r1680
11#include "driver.h"
22#include "deprecat.h"
3#include "mslegacy.h"
34#include "cpu/i8039/i8039.h"
45#include "cpu/m68000/m68000.h"
56#include "devices/cartslot.h"
src/mess/drivers/abc80x.c
r1679r1680
7171/* Core includes */
7272#include "driver.h"
7373#include "includes/abc80x.h"
74#include "mslegacy.h"
7475
7576/* Components */
7677#include "cpu/z80/z80daisy.h"
r1679r1680
8182#include "machine/z80sio.h"
8283#include "machine/z80dart.h"
8384#include "machine/abcbus.h"
84#include "video/crtc6845.h"
85#include "video/mc6845.h"
8586
8687/* Devices */
8788#include "devices/basicdsk.h"
r1679r1680
276277   AM_RANGE(0x07, 0x07) AM_READWRITE(abcbus_reset_r, hrc_w)
277278   AM_RANGE(0x20, 0x23) AM_READWRITE(dart_r, dart_w)
278279   AM_RANGE(0x30, 0x32) AM_WRITE(ram_ctrl_w)
279   AM_RANGE(0x31, 0x31) AM_READ(crtc6845_register_r)
280   AM_RANGE(0x38, 0x38) AM_WRITE(crtc6845_address_w)
281   AM_RANGE(0x39, 0x39) AM_WRITE(crtc6845_register_w)
280   AM_RANGE(0x31, 0x31) AM_READ(crtc6845_0_register_r)
281   AM_RANGE(0x38, 0x38) AM_WRITE(crtc6845_0_address_w)
282   AM_RANGE(0x39, 0x39) AM_WRITE(crtc6845_0_register_w)
282283   AM_RANGE(0x40, 0x43) AM_READWRITE(sio2_r, sio2_w)
283284   AM_RANGE(0x50, 0x53) AM_READWRITE(z80ctc_0_r, z80ctc_0_w)
284285   AM_RANGE(0x80, 0xff) AM_READWRITE(abcbus_strobe_r, abcbus_strobe_w)
r1679r1680
314315   AM_RANGE(0x06, 0x06) AM_WRITE(hrs_w)
315316   AM_RANGE(0x07, 0x07) AM_READWRITE(abcbus_reset_r, hrc_w)
316317   AM_RANGE(0x20, 0x23) AM_READWRITE(dart_r, dart_w)
317   AM_RANGE(0x31, 0x31) AM_READ(crtc6845_register_r)
318   AM_RANGE(0x31, 0x31) AM_READ(crtc6845_0_register_r)
318319   AM_RANGE(0x32, 0x35) AM_READWRITE(sio2_r, sio2_w)
319   AM_RANGE(0x38, 0x38) AM_WRITE(crtc6845_address_w)
320   AM_RANGE(0x39, 0x39) AM_WRITE(crtc6845_register_w)
320   AM_RANGE(0x38, 0x38) AM_WRITE(crtc6845_0_address_w)
321   AM_RANGE(0x39, 0x39) AM_WRITE(crtc6845_0_register_w)
321322   AM_RANGE(0x60, 0x63) AM_READWRITE(z80ctc_0_r, z80ctc_0_w)
322323   AM_RANGE(0x80, 0xff) AM_READWRITE(abcbus_strobe_r, abcbus_strobe_w)
323324ADDRESS_MAP_END
r1679r1680
339340   AM_RANGE(0x06, 0x06) AM_WRITE(hrs_w)
340341   AM_RANGE(0x07, 0x07) AM_READWRITE(abcbus_reset_r, hrc_w)
341342   AM_RANGE(0x20, 0x23) AM_READWRITE(dart_r, dart_w)
342   AM_RANGE(0x31, 0x31) AM_READ(crtc6845_register_r)
343   AM_RANGE(0x31, 0x31) AM_READ(crtc6845_0_register_r)
343344   AM_RANGE(0x34, 0x34) AM_READWRITE(bankswitch_r, bankswitch_w)
344345   AM_RANGE(0x35, 0x35) AM_READWRITE(attribute_r, attribute_w)
345346   AM_RANGE(0x37, 0x37) AM_READWRITE(sync_r, fgctlprom_w)
346   AM_RANGE(0x38, 0x38) AM_WRITE(crtc6845_address_w)
347   AM_RANGE(0x39, 0x39) AM_WRITE(crtc6845_register_w)
347   AM_RANGE(0x38, 0x38) AM_WRITE(crtc6845_0_address_w)
348   AM_RANGE(0x39, 0x39) AM_WRITE(crtc6845_0_register_w)
348349   AM_RANGE(0x40, 0x41) AM_READWRITE(sio2_r, sio2_w)
349350   AM_RANGE(0x60, 0x63) AM_READWRITE(z80ctc_0_r, z80ctc_0_w)
350351   AM_RANGE(0x80, 0xff) AM_READWRITE(abcbus_strobe_r, abcbus_strobe_w)
src/mess/drivers/einstein.c
r1679r1680
8080
8181#include "driver.h"
8282#include "deprecat.h"
83#include "mslegacy.h"
8384#include "machine/z80ctc.h"
8485#include "machine/z80pio.h"
8586#include "machine/z80sio.h"
r1679r1680
9394#include "devices/basicdsk.h"
9495#include "devices/printer.h"
9596#include "sound/ay8910.h"
96#include "video/crtc6845.h"
97#include "video/mc6845.h"
9798
9899#define EINSTEIN_SYSTEM_CLOCK 4000000
99100
r1679r1680
253254   }
254255}
255256
256static const crtc6845_interface einstein_crtc6845_interface = {
257static const mc6845_interface einstein_crtc6845_interface = {
257258   0,
258259   EINSTEIN_SYSTEM_CLOCK /*?*/,
259260   8 /*?*/,
src/mess/drivers/a310.c
r1679r1680
3535#include "cpu/arm/arm.h"
3636#include "sound/dac.h"
3737#include "deprecat.h"
38#include "mslegacy.h"
3839
3940
4041// interrupt register stuff
src/mess/drivers/tutor.c
r1679r1680
7474
7575#include "driver.h"
7676#include "deprecat.h"
77#include "mslegacy.h"
7778#include "cpu/tms9900/tms9900.h"
7879#include "video/tms9928a.h"
7980#include "devices/cartslot.h"
docs/messnew.txt
r1679r1680
2626
2727Source Changes:
2828----------------
29(none)
29- The core is based on MAME 0.123u1.  This incorporates all features of the
30  update to this core.  [MAME team]
3031
3132
3233

Previous 15994 Revisions Next


© 1998-2018 The MESS Team